[
  {
    "path": ".gitattributes",
    "content": "*.sh            eol=lf\n*.ac            eol=lf\n*.am            eol=lf\n*.in            eol=lf\n*.m4            eol=lf\nmissing         eol=lf\ncompile         eol=lf\nconfigure       eol=lf\ninstall-sh      eol=lf\n*.sln           eol=crlf\n*.vcxproj*      eol=crlf\n*.rc            eol=crlf\n*.cmd           eol=crlf\n*.txt           eol=crlf\n*.loc           eol=crlf\n*.sh            export-ignore\n*.cmd           export-ignore\n.gitattributes  export-ignore\n.gitignore      export-ignore\n.github         export-ignore\n*.creole        export-ignore\n\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/issue-report.md",
    "content": "---\nname: Report an issue with the application\nabout: Please make sure you follow the check-list carefully!\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n<!-- \nPLEASE READ THIS CAREFULLY:\n\n1. You *MUST* read and complete the steps from the checklist below, by placing\n   an x into each [ ] (so that it shows '[x]', NOT '[ x]' or '[x ]'), BEFORE\n   clicking on 'Submit new issue'.\n\n2. Failure to perform these steps, WHICH ARE ONLY THERE TO HELP *YOU*, will\n   usually result in your issue being dismissed without notice.\n\n3. If you are reporting an issue when trying to run Rufus, or when trying to\n   boot a media created by Rufus, you *MUST* provide a log, period. Please do\n   not assume that the developer(s) will be able to \"guess\" the specifics of\n   your environment, what image you used, what type of media you used it with\n   or the many many other critical parameters that the log provides data for.\n   To investigate an issue, a log from Rufus is ALWAYS required.\n\n4. If you still *choose* not to provide a log when reporting a problem, you\n   agree that your issue will be closed without any further investigation.\n\nYOU HAVE BEEN WARNED.\n-->\n\nChecklist\n---------\n- [ ] I have been made aware that if my problem can be summarized as _\"I've created or tried to create a media using Rufus, and ...\"_, and I am not including a log, **this issue will be summarily closed**.\n- [ ] I looked at https://github.com/pbatard/rufus/wiki/FAQ to see if my question has already been answered.\n- [ ] I performed a search in the issue tracker for similar issues using keywords relevant to my problem, such as the error message I got from the log.\n- [ ] I clicked the 'Log' button (🗒️) or pressed <kbd>Ctrl</kbd>-<kbd>L</kbd> in Rufus, or used [DebugView](https://learn.microsoft.com/en-us/sysinternals/downloads/debugview), and copy/pasted the log into the section that says `<FULL LOG>` below.\n- [ ] The log I am copying is the FULL log, starting with the line `Rufus version: x.y.z` - I have NOT removed any part of it.\n\nAdditionally (if applicable):\n- [ ] I ran a bad blocks check, by clicking _Show advanced format options_ then _Check device for bad blocks_, and confirmed that my USB is not defective.\n- [ ] I also tried one or more of the following:\n  - [ ] Using a different USB drive.\n  - [ ] Plugging the USB into a different port.\n  - [ ] Running Rufus on a different computer.\n- [ ] If using an image, I clicked on the `(✓)` button to compute the MD5, SHA1 and SHA256 checksums, which are therefore present in the log I copied. I confirmed, by performing an internet search, that these values match the ones from the official image.\n\nIssue description\n-----------------\n<Please describe your issue here>\n\nLog\n---\n```\n<FULL LOG>\n```\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n"
  },
  {
    "path": ".github/pull_request_template.md",
    "content": "<!--\nPlease do not create an unsolicited Pull Requests for a translation update.\nSee https://github.com/pbatard/rufus/wiki/FAQ#user-content-Why_dont_you_accept_unsolicited_translation_updates.\n-->"
  },
  {
    "path": ".github/workflows/codeql.yml",
    "content": "name: \"CodeQL\"\n\non:\n  push:\n    branches: [master]\n    paths-ignore:\n      - '.github/ISSUE_TEMPLATE/**'\n      - '.gitignore'\n      - '.gitattributes'\n      - 'res/**'\n      - '**.cmd'\n      - '**.md'\n      - '**.rc'\n      - '**.sh'\n      - '**.txt'\n      - '**.xml'\n  pull_request:\n    branches: [master]\n    paths-ignore:\n      - '.gitignore'\n      - '.gitattributes'\n      - 'res/**'\n      - '**.cmd'\n      - '**.md'\n      - '**.rc'\n      - '**.sh'\n      - '**.txt'\n      - '**.xml'\n\nenv:\n  SOLUTION_FILE_PATH: ./rufus.sln\n  BUILD_CONFIGURATION: Release\n  TARGET_PLATFORM: x64\n\njobs:\n  CodeQL-Build:\n    runs-on: windows-latest\n\n    permissions:\n      security-events: write\n\n    steps:\n    - name: Checkout repository\n      uses: actions/checkout@v6\n\n    - name: Initialize CodeQL\n      uses: github/codeql-action/init@v4\n      with:\n        languages: cpp\n\n    - name: Add MSBuild to PATH\n      uses: microsoft/setup-msbuild@v2\n      with:\n        msbuild-architecture: x64\n\n    - name: Build \n      run: msbuild ${{env.SOLUTION_FILE_PATH}} /m /p:Configuration=${{ env.BUILD_CONFIGURATION}},Platform=${{ env.TARGET_PLATFORM }}\n\n    - name: Perform CodeQL Analysis\n      uses: github/codeql-action/analyze@v4\n"
  },
  {
    "path": ".github/workflows/coverity.yml",
    "content": "name: Coverity\n\non:\n  push:\n    branches: [master]\n    paths-ignore:\n      - '.github/ISSUE_TEMPLATE/**'\n      - '.gitignore'\n      - '.gitattributes'\n      - 'res/**'\n      - '**.cmd'\n      - '**.md'\n      - '**.rc'\n      - '**.sh'\n      - '**.txt'\n      - '**.xml'\n\nenv:\n  SOLUTION_FILE_PATH: ./rufus.sln\n  EMAIL: pete@akeo.ie\n  BUILD_CONFIGURATION: Release\n  TARGET_PLATFORM: x64\n  COVERITY_PROJECT_NAME: pbatard%2Frufus\n\njobs:\n  Coverity-Build:\n    runs-on: windows-latest\n\n    steps:\n    - name: Checkout repository\n      uses: actions/checkout@v6\n      with:\n        fetch-depth: 0\n        submodules: recursive\n\n    - name: Download Coverity\n      run: |\n        curl -d \"token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=${{ env.COVERITY_PROJECT_NAME }}\" -L https://scan.coverity.com/download/cxx/win64 -o cov-analysis-win64.zip\n        7z x cov-analysis-win64.zip\n        del cov-analysis-win64.zip\n        move cov-analysis-win64* cov-analysis-win64\n\n    - name: Add Coverity to PATH\n      shell: bash\n      run: echo \"${{github.workspace}}/cov-analysis-win64/bin\" >> $GITHUB_PATH\n\n    - name: Add MSBuild to PATH\n      uses: microsoft/setup-msbuild@v2\n\n    - name: Build with Coverity\n      run: | \n        cov-configure --msvc\n        cov-build.exe --dir cov-int msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ env.TARGET_PLATFORM }}\n\n    - name: Publish Coverity artifacts\n      uses: actions/upload-artifact@v7\n      with:\n        name: cov-int\n        path: cov-int/\n      \n    - name: Upload Coverity build for analysis\n      run: |\n        7z a -r cov-int.zip cov-int\n        curl --form email=${{ env.EMAIL }} --form token=${{ secrets.COVERITY_SCAN_TOKEN }} --form file=@cov-int.zip --form version=\"${{ env.GITHUB_SHA }}\" --form description=\"Automated build\" https://scan.coverity.com/builds?project=${{ env.COVERITY_PROJECT_NAME }}\n\n"
  },
  {
    "path": ".github/workflows/lock.yml",
    "content": "# Configuration for https://github.com/dessant/lock-threads\nname: '[cron] Lock stale issues'\n\non:\n  schedule:\n    - cron: '33 22 * * *'\n\njobs:\n  lock:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: dessant/lock-threads@v5\n        with:\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          issue-inactive-days: '90'\n          issue-comment: >\n            This thread has been automatically locked since there has not been\n            any recent activity after it was closed. Please open a new issue\n            if you think you have a related problem or query.\n"
  },
  {
    "path": ".github/workflows/mingw.yml",
    "content": "name: MinGW\n\non: \n  push:\n    paths-ignore:\n      - '.github/ISSUE_TEMPLATE/**'\n      - '.gitignore'\n      - '.gitattributes'\n      - 'res/**'\n      - '**.cmd'\n      - '**.md'\n      - '**.rc'\n      - '**.sh'\n      - '**.txt'\n      - '**.xml'\n  pull_request:\n    branches: [master]\n    paths-ignore:\n      - '.gitignore'\n      - '.gitattributes'\n      - 'res/**'\n      - '**.cmd'\n      - '**.md'\n      - '**.rc'\n      - '**.sh'\n      - '**.txt'\n      - '**.xml'\n\njobs:\n  MinGW-Build:\n    runs-on: windows-latest\n\n    strategy:\n      matrix:\n        include:\n          - { sys: mingw64, env: x86_64, exe: rufus.exe }\n          - { sys: mingw32, env: i686, exe: rufus_x86.exe }\n\n    defaults:\n      run:\n        shell: msys2 {0}\n\n    steps:\n    - name: Install MinGW\n      uses: msys2/setup-msys2@v2\n      with:\n        msystem: ${{ matrix.sys }}\n        update: true\n        install: >-\n          mingw-w64-${{ matrix.env }}-toolchain\n          base-devel\n          autotools\n          git\n          upx\n\n    - name: Checkout repository\n      uses: actions/checkout@v6\n      with:\n        fetch-depth: 0\n        submodules: recursive\n\n    - name: Set ALPHA\n      id: set_alpha\n      shell: bash\n      if: ${{ !startsWith(github.ref, 'refs/tags/') }}\n      # This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT\n      run: |\n        echo \"option=--enable-alpha\" >> $GITHUB_OUTPUT\n        sed -b -i 's/VALUE \"InternalName\", \"Rufus\"/VALUE \"InternalName\", \"Rufus (ALPHA)\"/' ./src/rufus.rc\n\n    - name: Set BETA\n      id: set_beta\n      shell: bash\n      if: ${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'BETA') }}\n      # This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT\n      run: |\n        echo \"option=--enable-beta\" >> $GITHUB_OUTPUT\n        sed -b -i 's/VALUE \"InternalName\", \"Rufus\"/VALUE \"InternalName\", \"Rufus (BETA)\"/' ./src/rufus.rc\n\n    - name: Build\n      run: |\n        ./configure --disable-debug ${{ steps.set_alpha.outputs.option }} ${{ steps.set_beta.outputs.option }}\n        make -j4\n        mv ./src/rufus.exe ./${{ matrix.exe }}\n        strip ./${{ matrix.exe }}\n        upx --lzma --best ./${{ matrix.exe }}\n\n    - name: Prepare to sign ALPHA\n      if: ${{ !startsWith(github.ref, 'refs/tags/') }}\n      shell: bash\n      # NB: The Base64 encoded variable should not have line breaks or this will fail!\n      run: echo ${{ secrets.RUFUS_GITHUB_OFFICIAL_BUILD }} | base64 -di > ./sign.pfx\n\n    - name: Add signtool to path\n      if: ${{ !startsWith(github.ref, 'refs/tags/') }}\n      uses: KamaranL/add-signtool-action@v1\n\n    - name: Sign ALPHA\n      if: ${{ !startsWith(github.ref, 'refs/tags/') }}\n      shell: cmd\n      run: |\n        signtool sign /v /f sign.pfx /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ${{ matrix.exe }}\n        del sign.pfx\n\n    - name: Display SHA-256\n      run: sha256sum ./${{ matrix.exe }}\n\n    - name: Upload to VirusTotal\n      if: ${{ github.event_name == 'push' && matrix.env == 'x86_64'  }}\n      continue-on-error: true\n      run: |\n        curl --request POST --url https://www.virustotal.com/vtapi/v2/file/scan --form apikey=${{ secrets.VIRUSTOTAL_API_KEY }} --form file=@./${{ matrix.exe }}\n        curl --request POST --url https://www.virustotal.com/api/v3/monitor/items --header 'x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}' --form path='/${{ matrix.exe }}' --form file=@./${{ matrix.exe }}\n\n    - name: Upload artifacts\n      if: ${{ github.event_name == 'push' }}\n      uses: actions/upload-artifact@v7\n      with:\n        name: ${{ matrix.sys }}\n        path: ./*.exe\n\n  Extra-Step-To-Merge-Artifacts-Thanks-To-Upload-Artifact-v4-Breaking-Backwards-Compatibility:\n    runs-on: windows-latest\n    needs: MinGW-Build\n    steps:\n      - name: Merge Artifacts\n        uses: actions/upload-artifact/merge@v7\n        if: ${{ github.event_name == 'push' }}\n        with:\n          name: MinGW\n          delete-merged: true"
  },
  {
    "path": ".github/workflows/setup.yml",
    "content": "name: setup\nrun-name: Windows setup wrapper build\n\non: \n  workflow_dispatch:\n    branches: [ master ]\n\nenv:\n  SOLUTION_FILE_PATH: ./res/setup/setup.sln\n  BUILD_CONFIGURATION: Release\n\njobs:\n  VS2022-Build:\n    runs-on: windows-latest\n\n    strategy:\n      matrix:\n        TARGET_PLATFORM: [x64, arm64]\n\n    steps:\n    - name: Checkout repository\n      uses: actions/checkout@v6\n\n    - name: Add MSBuild to PATH\n      uses: microsoft/setup-msbuild@v2\n      with:\n        msbuild-architecture: x64\n\n    - name: Build\n      shell: cmd\n      run: |\n        msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ matrix.TARGET_PLATFORM }}\n        move .\\res\\setup\\${{ matrix.TARGET_PLATFORM }}\\Release\\setup.exe .\\setup_${{ matrix.TARGET_PLATFORM }}.exe\n\n    - name: Display SHA-256\n      run: sha256sum ./setup_${{ matrix.TARGET_PLATFORM }}.exe\n\n    - name: Upload artifacts\n      uses: actions/upload-artifact@v7\n      with:\n        name: ${{ matrix.TARGET_PLATFORM }}\n        path: ./*.exe\n\n  Extra-Step-To-Merge-Artifacts-Thanks-To-Upload-Artifact-v4-Breaking-Backwards-Compatibility:\n    runs-on: windows-latest\n    needs: VS2022-Build\n    steps:\n      - name: Merge Artifacts\n        uses: actions/upload-artifact/merge@v7\n        with:\n          name: setup\n          delete-merged: true\n"
  },
  {
    "path": ".github/workflows/vs2022.yml",
    "content": "name: VS2022\n\non: \n  push:\n    paths-ignore:\n      - '.github/ISSUE_TEMPLATE/**'\n      - '.gitignore'\n      - '.gitattributes'\n      - 'res/**'\n      - '**.cmd'\n      - '**.md'\n      - '**.rc'\n      - '**.sh'\n      - '**.txt'\n      - '**.xml'\n  pull_request:\n    branches: [master]\n    paths-ignore:\n      - '.gitignore'\n      - '.gitattributes'\n      - 'res/**'\n      - '**.cmd'\n      - '**.md'\n      - '**.rc'\n      - '**.sh'\n      - '**.txt'\n      - '**.xml'\n\nenv:\n  SOLUTION_FILE_PATH: ./rufus.sln\n  BUILD_CONFIGURATION: Release\n\njobs:\n  VS2022-Build:\n    runs-on: windows-latest\n\n    strategy:\n      matrix:\n        TARGET_PLATFORM: [x64, x86, arm64]\n\n    steps:\n    - name: Checkout repository\n      uses: actions/checkout@v6\n      with:\n        fetch-depth: 0\n        submodules: recursive\n\n    - name: Add MSBuild to PATH\n      uses: microsoft/setup-msbuild@v2\n      with:\n        msbuild-architecture: x64\n\n    - name: Install UPX\n      uses: crazy-max/ghaction-upx@v4\n      with:\n        install-only: true\n\n    - name: Set version\n      id: set_version\n      shell: bash\n      run: |\n        version=$(git describe --tags)\n        version=${version:1}\n        version=${version%%-*}\n        echo \"version=$version\" >> $GITHUB_OUTPUT\n\n    - name: Set ALPHA\n      id: set_alpha\n      shell: bash\n      if: ${{ !startsWith(github.ref, 'refs/tags/') }}\n      # This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT\n      run: |\n        echo \"option=/DALPHA\" >> $GITHUB_OUTPUT\n        sed -b -i 's/VALUE \"InternalName\", \"Rufus\"/VALUE \"InternalName\", \"Rufus (ALPHA)\"/' ./src/rufus.rc\n\n    - name: Set BETA\n      id: set_beta\n      shell: bash\n      if: ${{ startsWith(github.ref, 'refs/tags/') && contains(github.ref, 'BETA') }}\n      # This ONLY works if the shell is bash or if using $env:GITHUB_OUTPUT\n      run: |\n        echo \"option=/DBETA\" >> $GITHUB_OUTPUT\n        sed -b -i 's/VALUE \"InternalName\", \"Rufus\"/VALUE \"InternalName\", \"Rufus (BETA)\"/' ./src/rufus.rc\n\n    - name: Build\n      shell: cmd\n      run: |\n        set ExternalCompilerOptions=${{ steps.set_alpha.outputs.option }} ${{ steps.set_beta.outputs.option }}\n        msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ matrix.TARGET_PLATFORM }},ForceImportBeforeCppTargets=%GITHUB_WORKSPACE%\\.vs\\Generate.PDB.props\n        move .\\${{ matrix.TARGET_PLATFORM }}\\Release\\rufus.exe .\\rufus_${{ matrix.TARGET_PLATFORM }}.exe\n        move .\\${{ matrix.TARGET_PLATFORM }}\\Release\\rufus.pdb .\\rufus_${{ matrix.TARGET_PLATFORM }}.pdb\n\n    - name: Prepare to sign ALPHA\n      if: ${{ !startsWith(github.ref, 'refs/tags/') }}\n      shell: bash\n      # NB: The Base64 encoded variable should not have line breaks or this will fail!\n      run: echo ${{ secrets.RUFUS_GITHUB_OFFICIAL_BUILD }} | base64 -di > ./sign.pfx\n\n    - name: Add signtool to path\n      if: ${{ !startsWith(github.ref, 'refs/tags/') }}\n      uses: KamaranL/add-signtool-action@v1\n\n    - name: Sign ALPHA\n      if: ${{ !startsWith(github.ref, 'refs/tags/') }}\n      shell: cmd\n      run: |\n        signtool sign /v /f sign.pfx /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 rufus_${{ matrix.TARGET_PLATFORM }}.exe\n        del sign.pfx\n\n    - name: Create standalone release executables\n      if: ${{ startsWith(github.ref, 'refs/tags/') }}\n      shell: cmd\n      run: |\n        copy rufus_${{ matrix.TARGET_PLATFORM }}.exe rufus-${{ steps.set_version.outputs.version }}_${{ matrix.TARGET_PLATFORM }}.exe\n        if exist rufus-${{ steps.set_version.outputs.version }}_x64.exe ( ren rufus-${{ steps.set_version.outputs.version }}_x64.exe rufus-${{ steps.set_version.outputs.version }}.exe )\n        if not ${{ matrix.TARGET_PLATFORM }}==arm64 ( upx --lzma --best rufus-*.exe )\n\n    - name: Display SHA-256\n      run: sha256sum ./rufus_${{ matrix.TARGET_PLATFORM }}.exe\n\n    - name: Upload to VirusTotal\n      continue-on-error: true\n      if: ${{ github.event_name == 'push' }}\n      run: |\n        curl --request POST --url https://www.virustotal.com/vtapi/v2/file/scan --form apikey=${{ secrets.VIRUSTOTAL_API_KEY }} --form file=@./rufus_${{ matrix.TARGET_PLATFORM }}.exe\n        curl --request POST --url https://www.virustotal.com/api/v3/monitor/items --header 'x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}' --form path='/rufus_${{ matrix.TARGET_PLATFORM }}.exe' --form file=@./rufus_${{ matrix.TARGET_PLATFORM }}.exe\n\n    - name: Upload artifacts\n      uses: actions/upload-artifact@v7\n      if: ${{ github.event_name == 'push' }}\n      with:\n        name: ${{ matrix.TARGET_PLATFORM }}\n        path: |\n          ./*.exe\n          ./*.pdb\n\n  Extra-Step-To-Merge-Artifacts-Thanks-To-Upload-Artifact-v4-Breaking-Backwards-Compatibility:\n    runs-on: windows-latest\n    needs: VS2022-Build\n    steps:\n      - name: Merge Artifacts\n        uses: actions/upload-artifact/merge@v7\n        if: ${{ github.event_name == 'push' }}\n        with:\n          name: VS2022\n          delete-merged: true\n"
  },
  {
    "path": ".gitignore",
    "content": "*.a\n*.aps\n*.appx\n*.appxupload\n*.bak\n*.db\n*.db-shm\n*.db-wal\n*.dep\n*.diff\n*.dll\n*.efi\n*.exe\n*.htm\n*.idb\n*.ipch\n*.la\n*.lib\n*.lo\n*.lock\n*.log\n*.mac\n*.mo\n*.mp4\n*.ncb\n*.nope\n*.o\n*.obj\n*.old\n*.opendb\n*.opt\n*.org\n*.p7x\n*.patch\n*.pc\n*.pdb\n*.pdf\n*.plg\n*.res\n*.sig\n*.sdf\n*.suo\n*.swp\n*.tlog\n*.user\n*.opensdf\n*.o_manifest\n.deps\n.libs\nMakefile\n/arm\n/arm64\n/x64\n/x86\nautom4te.cache\nconfig.guess\n/config.h\nconfig.log\nconfig.status\nconfig.sub\ndepcomp\nembedded.loc\n/res/loc/pollock/.vs\n/res/loc/pollock/bin\n/res/loc/pollock/obj\n/rufus_files\nstamp-h1\n/.vs/rufus\n"
  },
  {
    "path": ".mingw/Makefile.am",
    "content": "# Create delay-loaded libraries from a DLL, that aren't vulnerable to side-loading\nAM_V_DLLTOOL_0 = @echo \"  LIB      $@\";$(DLLTOOL)\nAM_V_DLLTOOL_1 = $(DLLTOOL)\nAM_V_DLLTOOL_  = $(AM_V_DLLTOOL_$(AM_DEFAULT_VERBOSITY))\nAM_V_DLLTOOL   = $(AM_V_DLLTOOL_$(V))\n\nAM_V_SED_0     = @echo \"  SED      $<\";$(SED)\nAM_V_SED_1     = $(SED)\nAM_V_SED_      = $(AM_V_SED_$(AM_DEFAULT_VERBOSITY))\nAM_V_SED       = $(AM_V_SED_$(V))\n\n# Ah the joys of Windows DLL calling conventions, that require an @## suffix in the .def\n# for x86_32 and but no @## for x86_64, thereby forcing us to strip stuff according to the\n# target arch. Oh, and we can't use 'target_cpu' or AC definitions on account that we are\n# switching archs when building on our local machine, and don't want to have to go though\n# a costly reconf each time when we can simply issue a 'make clean'.\n# Oh, and to find the number after the @ sign, just have a look at the MinGW .a libraries.\nTUPLE         := $(shell $(CC) -dumpmachine)\nTARGET        := $(word 1,$(subst -, ,$(TUPLE)))\nDEF_SUFFIX    := $(if $(TARGET:x86_64=),.def,.def64)\n\n.PHONY: all\nall: crypt32-delaylib.lib dwmapi-delaylib.lib setupapi-delaylib.lib uxtheme-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib\n\n%.def64: %.def\n\t$(AM_V_SED) \"s/@.*//\" $< >$@\n\n%-delaylib.lib: %$(DEF_SUFFIX)\n\t$(AM_V_DLLTOOL) --input-def $< --output-delaylib $@ --dllname $(basename $<).dll\n\nclean:\n\t$(RM) -f $(CURDIR)/*.lib\n"
  },
  {
    "path": ".mingw/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = .mingw\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \ndepcomp =\nam__depfiles_maybe =\nSOURCES =\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\n\n# Create delay-loaded libraries from a DLL, that aren't vulnerable to side-loading\nAM_V_DLLTOOL_0 = @echo \"  LIB      $@\";$(DLLTOOL)\nAM_V_DLLTOOL_1 = $(DLLTOOL)\nAM_V_DLLTOOL_ = $(AM_V_DLLTOOL_$(AM_DEFAULT_VERBOSITY))\nAM_V_DLLTOOL = $(AM_V_DLLTOOL_$(V))\nAM_V_SED_0 = @echo \"  SED      $<\";$(SED)\nAM_V_SED_1 = $(SED)\nAM_V_SED_ = $(AM_V_SED_$(AM_DEFAULT_VERBOSITY))\nAM_V_SED = $(AM_V_SED_$(V))\n\n# Ah the joys of Windows DLL calling conventions, that require an @## suffix in the .def\n# for x86_32 and but no @## for x86_64, thereby forcing us to strip stuff according to the\n# target arch. Oh, and we can't use 'target_cpu' or AC definitions on account that we are\n# switching archs when building on our local machine, and don't want to have to go though\n# a costly reconf each time when we can simply issue a 'make clean'.\n# Oh, and to find the number after the @ sign, just have a look at the MinGW .a libraries.\nTUPLE := $(shell $(CC) -dumpmachine)\nTARGET := $(word 1,$(subst -, ,$(TUPLE)))\nDEF_SUFFIX := $(if $(TARGET:x86_64=),.def,.def64)\nall: all-am\n\n.SUFFIXES:\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps .mingw/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps .mingw/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\ntags TAGS:\n\nctags CTAGS:\n\ncscope cscopelist:\n\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean-am: clean-generic mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-generic\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: all all-am check check-am clean clean-generic cscopelist-am \\\n\tctags-am distclean distclean-generic dvi dvi-am html html-am \\\n\tinfo info-am install install-am install-data install-data-am \\\n\tinstall-dvi install-dvi-am install-exec install-exec-am \\\n\tinstall-html install-html-am install-info install-info-am \\\n\tinstall-man install-pdf install-pdf-am install-ps \\\n\tinstall-ps-am install-strip installcheck installcheck-am \\\n\tinstalldirs maintainer-clean maintainer-clean-generic \\\n\tmostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags-am \\\n\tuninstall uninstall-am\n\n\n.PHONY: all\nall: crypt32-delaylib.lib dwmapi-delaylib.lib setupapi-delaylib.lib uxtheme-delaylib.lib version-delaylib.lib virtdisk-delaylib.lib wininet-delaylib.lib wintrust-delaylib.lib\n\n%.def64: %.def\n\t$(AM_V_SED) \"s/@.*//\" $< >$@\n\n%-delaylib.lib: %$(DEF_SUFFIX)\n\t$(AM_V_DLLTOOL) --input-def $< --output-delaylib $@ --dllname $(basename $<).dll\n\nclean:\n\t$(RM) -f $(CURDIR)/*.lib\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": ".mingw/cfgmgr32.def",
    "content": "EXPORTS\n  CM_Get_Device_IDA@16\n  CM_Get_Device_ID_List_SizeA@12\n  CM_Get_Device_ID_ListA@16\n  CM_Locate_DevNodeA@12\n  CM_Get_Child@12\n  CM_Get_Sibling@12\n  CM_Get_Parent@12\n  CM_Get_DevNode_Status@16\n  CM_Get_DevNode_Registry_PropertyA@24\n"
  },
  {
    "path": ".mingw/crypt32.def",
    "content": "EXPORTS\n  CertFindCertificateInStore@24\n  CertGetCertificateChain@32\n  CertGetNameStringA@24\n  CertCloseStore@8\n  CertFreeCertificateContext@4\n  CryptQueryObject@44\n  CryptDecodeObjectEx@32\n  CryptHashCertificate@28\n  CryptMsgGetParam@20\n  CryptMsgClose@4\n  CryptMsgGetParam@20\n  CryptMsgOpenToDecode@24\n  CryptMsgUpdate@16\n"
  },
  {
    "path": ".mingw/dwmapi.def",
    "content": "EXPORTS\n  DwmGetColorizationColor@8\n  DwmGetWindowAttribute@16\n  DwmSetWindowAttribute@16\n"
  },
  {
    "path": ".mingw/setupapi.def",
    "content": "EXPORTS\n  CM_Locate_DevNodeA@12\n  CM_Get_DevNode_Registry_PropertyA@24\n  CM_Get_DevNode_Status@16\n  CM_Get_Child@12\n  CM_Get_Parent@12\n  CM_Get_Sibling@12\n  CM_Get_Device_IDA@16\n  CM_Get_Device_ID_ListA@16\n  CM_Get_Device_ID_List_SizeA@12\n  SetupDiGetDeviceInstanceIdA@20\n  SetupDiGetDeviceRegistryPropertyA@28\n  SetupDiGetDeviceRegistryPropertyW@28\n  SetupDiChangeState@8\n  SetupDiGetClassDevsA@16\n  SetupDiSetClassInstallParamsW@16\n  SetupDiEnumDeviceInfo@12\n  SetupDiEnumDeviceInterfaces@20\n  SetupDiDestroyDeviceInfoList@4\n  SetupDiGetDeviceInterfaceDetailA@24\n"
  },
  {
    "path": ".mingw/uxtheme.def",
    "content": "EXPORTS\n  BeginBufferedAnimation@32\n  BufferedPaintRenderAnimation@8\n  BufferedPaintStopAllAnimations@4\n  CloseThemeData@4\n  DrawThemeBackground@24\n  DrawThemeParentBackground@12\n  DrawThemeTextEx@36\n  EndBufferedAnimation@8\n  GetThemeBackgroundContentRect@24\n  GetThemeFont@24\n  GetThemePartSize@28\n  GetThemeTransitionDuration@24\n  OpenThemeData@8\n  SetWindowTheme@12\n"
  },
  {
    "path": ".mingw/version.def",
    "content": "EXPORTS\n  GetFileVersionInfoSizeW@8\n  GetFileVersionInfoW@16\n  VerQueryValueA@16\n"
  },
  {
    "path": ".mingw/virtdisk.def",
    "content": "EXPORTS\n  AttachVirtualDisk@24\n  CreateVirtualDisk@36\n  DetachVirtualDisk@12\n  GetVirtualDiskInformation@16\n  GetVirtualDiskPhysicalPath@12\n  GetVirtualDiskOperationProgress@12\n  OpenVirtualDisk@24\n"
  },
  {
    "path": ".mingw/wininet.def",
    "content": "EXPORTS\n  HttpQueryInfoA@20\n  HttpOpenRequestA@32\n  HttpSendRequestA@20\n  HttpAddRequestHeadersA@16\n  InternetCloseHandle@4\n  InternetConnectA@32\n  InternetCrackUrlA@16\n  InternetGetConnectedState@8\n  InternetGetLastResponseInfoA@12\n  InternetOpenA@20\n  InternetReadFile@16\n  InternetSetOptionA@16\n"
  },
  {
    "path": ".mingw/wintrust.def",
    "content": "EXPORTS\n  WinVerifyTrustEx@12\n"
  },
  {
    "path": ".vs/Generate.PDB.props",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemDefinitionGroup>\n    <Link>\n      <GenerateDebugInformation>DebugFull</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n</Project>\n"
  },
  {
    "path": ".vs/bled.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\bled\\bled.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\crc32.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\data_align.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\data_extract_all.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\data_skip.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_bunzip2.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_gunzip.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_uncompress.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_unlzma.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_unxz.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_unzip.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_unzstd.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_vtsi.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\filter_accept_all.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\filter_accept_list.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\filter_accept_reject_list.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\find_list_entry.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\fse_decompress.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\header_list.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\header_skip.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\header_verbose_list.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\huf_decompress.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\init_handle.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\open_transformer.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\seek_by_jump.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\seek_by_read.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\xxhash.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\xz_dec_bcj.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\xz_dec_lzma2.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\xz_dec_stream.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_common.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_ddict.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_decompress.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_decompress_block.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_entropy_common.c\" />\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_error_private.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\bled\\bb_archive.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\bled.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\fse.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\fse_bitstream.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\huf.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\libbb.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\platform.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\xxhash.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\xz.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\xz_config.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\xz_lzma2.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\xz_private.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\xz_stream.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_bits.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_compiler.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_config.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_cpu.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_ddict.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_decompress_block.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_decompress_internal.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_deps.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_errors.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_error_private.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_internal.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_mem.h\" />\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectName>bled</ProjectName>\r\n    <ProjectGuid>{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}</ProjectGuid>\r\n    <RootNamespace>bled</RootNamespace>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src</AdditionalIncludeDirectories>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src</AdditionalIncludeDirectories>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n    <Lib>\r\n      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src</AdditionalIncludeDirectories>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n    <Lib>\r\n      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src</AdditionalIncludeDirectories>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n    <Lib>\r\n      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ModuleDefinitionFile>.\\7z.def</ModuleDefinitionFile>\r\n    </Link>\r\n    <Lib>\r\n      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n</Project>"
  },
  {
    "path": ".vs/bled.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{396df203-84ec-49b8-ae11-074c50a020f0}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{0147b833-dc8f-4666-be99-77dfae5e6679}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\bled\\bled.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\crc32.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\data_extract_all.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\data_skip.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\data_align.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\filter_accept_all.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\filter_accept_list.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\filter_accept_reject_list.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\find_list_entry.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\header_list.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\header_skip.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\header_verbose_list.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\init_handle.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\seek_by_jump.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\seek_by_read.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_bunzip2.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_gunzip.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_uncompress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_unlzma.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_unxz.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\open_transformer.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\xz_dec_bcj.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\xz_dec_lzma2.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\xz_dec_stream.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_unzip.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_vtsi.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\decompress_unzstd.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\fse_decompress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\huf_decompress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\xxhash.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_decompress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_decompress_block.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_entropy_common.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_error_private.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_common.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\bled\\zstd_ddict.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\bled\\bb_archive.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\bled.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\libbb.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\platform.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\xz.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\xz_config.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\xz_lzma2.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\xz_private.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\xz_stream.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\fse.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\fse_bitstream.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\huf.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\xxhash.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_compiler.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_config.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_cpu.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_ddict.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_decompress_block.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_decompress_internal.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_deps.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_error_private.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_errors.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_internal.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_mem.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\zstd_bits.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": ".vs/ext2fs.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\alloc.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\alloc_sb.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\alloc_stats.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\alloc_tables.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\badblocks.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\bb_inode.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\bitmaps.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\bitops.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\blkmap64_ba.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\blkmap64_rb.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\blknum.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\block.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\bmap.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\closefs.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\crc16.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\crc32c.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\csum.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\dirblock.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\dirhash.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\dir_iterate.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\extent.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\ext_attr.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\fallocate.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\fileio.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\freefs.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\gen_bitmap.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\gen_bitmap64.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\get_num_dirs.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\hashmap.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\ind_block.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\initialize.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\inline.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\inline_data.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\inode.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\io_manager.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\i_block.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\link.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\lookup.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\mkdir.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\mkjournal.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\mmp.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\namei.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\newdir.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\nt_io.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\openfs.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\punch.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\rbtree.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\read_bb.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\rw_bitmaps.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\sha512.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\symlink.c\" />\r\n    <ClCompile Include=\"..\\src\\ext2fs\\valid_blk.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\bitops.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\bmap64.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\com_err.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\config.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\crc16.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\crc32c_defs.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\crc32c_table.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\e2image.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2fs.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2fsP.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2_err.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2_ext_attr.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2_fs.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2_io.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2_types.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext3_extents.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext4_acl.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\hashmap.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\jfs_compat.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\kernel-jbd.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\kernel-list.h\" />\r\n    <ClInclude Include=\"..\\src\\ext2fs\\rbtree.h\" />\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectName>ext2fs</ProjectName>\r\n    <ProjectGuid>{B01F5886-2B39-4B66-B65C-6427135B6A02}</ProjectGuid>\r\n    <RootNamespace>ext2fs</RootNamespace>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <DisableSpecificWarnings>4018;4146;4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing</AdditionalIncludeDirectories>\r\n      <DisableSpecificWarnings>4018;4146;4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing</AdditionalIncludeDirectories>\r\n      <DisableSpecificWarnings>4018;4146;4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <DisableSpecificWarnings>4018;4146;4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <DisableSpecificWarnings>4018;4146;4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n      <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n    <Lib>\r\n      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing</AdditionalIncludeDirectories>\r\n      <DisableSpecificWarnings>4018;4146;4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n    </Link>\r\n    <Lib>\r\n      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing</AdditionalIncludeDirectories>\r\n      <DisableSpecificWarnings>4018;4146;4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n    </Link>\r\n    <Lib>\r\n      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <DisableSpecificWarnings>4018;4146;4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SuppressStartupBanner>true</SuppressStartupBanner>\r\n      <LinkDLL>true</LinkDLL>\r\n      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r\n    </Link>\r\n    <Lib>\r\n      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n</Project>"
  },
  {
    "path": ".vs/ext2fs.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{396df203-84ec-49b8-ae11-074c50a020f0}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{0147b833-dc8f-4666-be99-77dfae5e6679}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\initialize.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\nt_io.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\alloc_sb.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\blknum.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\freefs.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\bitmaps.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\closefs.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\gen_bitmap.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\gen_bitmap64.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\inode.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\io_manager.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\csum.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\bitops.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\get_num_dirs.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\blkmap64_ba.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\blkmap64_rb.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\rbtree.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\crc16.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\crc32c.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\rw_bitmaps.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\mmp.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\dir_iterate.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\inline.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\block.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\extent.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\alloc.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\alloc_stats.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\dirblock.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\inline_data.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\fileio.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\ext_attr.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\i_block.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\punch.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\ind_block.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\bmap.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\read_bb.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\badblocks.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\symlink.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\valid_blk.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\lookup.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\link.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\alloc_tables.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\mkdir.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\newdir.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\bb_inode.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\hashmap.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\sha512.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\mkjournal.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\fallocate.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\openfs.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\namei.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ext2fs\\dirhash.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2_fs.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2fs.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext3_extents.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2_io.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2_ext_attr.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\com_err.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\bitops.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\config.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2_err.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2_types.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext2fsP.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\rbtree.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\crc16.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\crc32c_defs.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\bmap64.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\ext4_acl.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\e2image.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\crc32c_table.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\hashmap.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\kernel-list.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\kernel-jbd.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ext2fs\\jfs_compat.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": ".vs/getopt.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}</ProjectGuid>\r\n    <RootNamespace>getopt</RootNamespace>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <Optimization>Disabled</Optimization>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Lib>\r\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Lib>\r\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Lib>\r\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Midl>\r\n      <TargetEnvironment>X64</TargetEnvironment>\r\n    </Midl>\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <Optimization>Disabled</Optimization>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Lib>\r\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib>\r\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <ClCompile>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib>\r\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib>\r\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Midl>\r\n      <TargetEnvironment>X64</TargetEnvironment>\r\n    </Midl>\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib>\r\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\getopt\\getopt.c\" />\r\n    <ClCompile Include=\"..\\src\\getopt\\getopt1.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\getopt\\getopt.h\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": ".vs/getopt.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\getopt\\getopt.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\getopt\\getopt1.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\getopt\\getopt.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": ".vs/libcdio-driver.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\disc.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\ds.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\logging.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\memory.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\read.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\sector.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\track.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\utf8.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\util.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\_cdio_stdio.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\_cdio_stream.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\cdio.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\ds.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\logging.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\memory.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\sector.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\types.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\util.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\version.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\config.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\cdio_assert.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\cdio_private.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\filemode.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\portable.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\_cdio_stdio.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\_cdio_stream.h\" />\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{FA1B1093-BA86-410A-B7A0-7A54C605F812}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>driver</RootNamespace>\r\n    <ProjectName>libcdio-driver</ProjectName>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": ".vs/libcdio-driver.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\_cdio_stdio.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\_cdio_stream.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\logging.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\ds.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\read.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\util.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\sector.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\disc.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\track.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\utf8.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\driver\\memory.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\_cdio_stdio.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\_cdio_stream.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\cdio_assert.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\cdio_private.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\filemode.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\logging.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\util.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\cdio.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\ds.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\types.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\config.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\sector.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\version.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\portable.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\memory.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": ".vs/libcdio-iso9660.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\bytesex.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\cdio.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\cdtext.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\iso9660.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\logging.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\portable.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\rock.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\utf8.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\util.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\config.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\cdio_assert.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\cdio_private.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\filemode.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\_cdio_stdio.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\iso9660\\iso9660_private.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\libcdio\\iso9660\\iso9660.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\iso9660\\iso9660_fs.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\iso9660\\rock.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\iso9660\\xa.c\" />\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{D4E80F35-2604-40AC-B436-97B052ECB572}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>iso9660</RootNamespace>\r\n    <ProjectName>libcdio-iso9660</ProjectName>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": ".vs/libcdio-iso9660.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\libcdio\\iso9660\\iso9660_private.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\config.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\cdio_assert.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\bytesex.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\iso9660.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\util.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\cdio.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\utf8.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\_cdio_stdio.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\cdio_private.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\logging.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\filemode.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\cdtext.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\portable.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\rock.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\libcdio\\iso9660\\iso9660_fs.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\iso9660\\rock.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\iso9660\\xa.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\iso9660\\iso9660.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": ".vs/libcdio-udf.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\libcdio\\udf\\filemode.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\udf\\udf.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\udf\\udf_file.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\udf\\udf_fs.c\" />\r\n    <ClCompile Include=\"..\\src\\libcdio\\udf\\udf_time.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\bytesex.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\udf.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\config.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\cdio_assert.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\filemode.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\udf\\udf_fs.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\udf\\udf_private.h\" />\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>udf</RootNamespace>\r\n    <ProjectName>libcdio-udf</ProjectName>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>HAVE_CONFIG_H;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\libcdio;..\\src\\libcdio\\driver;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": ".vs/libcdio-udf.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\libcdio\\udf\\filemode.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\udf\\udf.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\udf\\udf_file.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\udf\\udf_fs.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\libcdio\\udf\\udf_time.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\libcdio\\udf\\udf_fs.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\udf\\udf_private.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\udf.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\config.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\filemode.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\bytesex.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\driver\\cdio_assert.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": ".vs/ms-sys.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat12_0x0.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat12_0x3e.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat16fd_0x3e.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat16ros_0x0.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat16ros_0x3e.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat16_0x0.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat16_0x3e.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32fd_0x3f0.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32fd_0x52.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32kos_0x52.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32nt_0x1800.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32nt_0x3f0.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32nt_0x52.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32pe_0x1800.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32pe_0x3f0.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32pe_0x52.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32ros_0x1c00.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32ros_0x3f0.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32ros_0x52.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32_0x0.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32_0x3f0.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32_0x52.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_ntfs_0x0.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_ntfs_0x54.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\fat12.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\fat16.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\fat32.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\file.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\label_11_char.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\libintl.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_2000.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_95b.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_dos.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_dos_f2.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_gpt_syslinux.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_grub.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_grub2.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_kolibri.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_msg_rufus.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_reactos.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_rufus.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_syslinux.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_vista.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_win7.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_zero.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\nls.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\ntfs.h\" />\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\partition_info.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\ms-sys\\br.c\" />\r\n    <ClCompile Include=\"..\\src\\ms-sys\\fat12.c\" />\r\n    <ClCompile Include=\"..\\src\\ms-sys\\fat16.c\" />\r\n    <ClCompile Include=\"..\\src\\ms-sys\\fat32.c\" />\r\n    <ClCompile Include=\"..\\src\\ms-sys\\file.c\" />\r\n    <ClCompile Include=\"..\\src\\ms-sys\\ntfs.c\" />\r\n    <ClCompile Include=\"..\\src\\ms-sys\\partition_info.c\" />\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{2B1D078D-8EB4-4398-9CA4-23457265A7F6}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>mssys</RootNamespace>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\ms-sys\\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\ms-sys\\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/analyze:stacksize32850 /utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\ms-sys\\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/analyze:stacksize32850 /utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\ms-sys\\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\ms-sys\\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/analyze:stacksize32850 /utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\ms-sys\\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/analyze:stacksize32850 /utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\ms-sys\\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\ms-sys\\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": ".vs/ms-sys.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\partition_info.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat12_0x0.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat12_0x3e.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat16_0x0.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat16_0x3e.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat16fd_0x3e.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32_0x0.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32_0x3f0.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32_0x52.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32fd_0x3f0.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32fd_0x52.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32nt_0x1800.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32nt_0x3f0.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32nt_0x52.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\fat12.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\fat16.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\fat32.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\file.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\label_11_char.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_2000.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_95b.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_dos.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_dos_f2.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_syslinux.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_vista.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_win7.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_zero.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\ntfs.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_ntfs_0x0.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_ntfs_0x54.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_reactos.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32ros_0x1c00.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32ros_0x3f0.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32ros_0x52.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat16ros_0x3e.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat16ros_0x0.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_rufus.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32kos_0x52.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_kolibri.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_grub.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_grub2.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\nls.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\libintl.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32pe_0x3f0.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32pe_0x52.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\br_fat32pe_0x1800.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_gpt_syslinux.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ms-sys\\inc\\mbr_msg_rufus.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\ms-sys\\br.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ms-sys\\file.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ms-sys\\fat12.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ms-sys\\fat16.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ms-sys\\fat32.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ms-sys\\partition_info.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ms-sys\\ntfs.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": ".vs/rufus.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectName>rufus</ProjectName>\r\n    <ProjectGuid>{731858A7-0303-4988-877B-9C0DD6471864}</ProjectGuid>\r\n    <RootNamespace>rufus</RootNamespace>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <BuildLog />\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;..\\src\\ms-sys\\inc;..\\src\\syslinux\\libinstaller;..\\src\\syslinux\\libfat;..\\src\\syslinux\\win;..\\src\\libcdio;..\\src\\getopt;..\\src\\wimlib;..\\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <ExceptionHandling>Async</ExceptionHandling>\r\n      <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <Optimization>Disabled</Optimization>\r\n      <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <SubSystem>Windows</SubSystem>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n      <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r\n      <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ResourceCompile>\r\n    <PreBuildEvent>\r\n      <Command>type $(SolutionDir)res\\loc\\rufus.loc | findstr /v MSG_9 &gt; $(SolutionDir)res\\loc\\embedded.loc</Command>\r\n      <Message>Generating 'embedded.loc' file</Message>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <BuildLog />\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;..\\src\\ms-sys\\inc;..\\src\\syslinux\\libinstaller;..\\src\\syslinux\\libfat;..\\src\\syslinux\\win;..\\src\\libcdio;..\\src\\getopt;..\\src\\wimlib;..\\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <ExceptionHandling>Async</ExceptionHandling>\r\n      <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <SubSystem>Windows</SubSystem>\r\n      <AdditionalLibraryDirectories>C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.15063.0\\um\\arm</AdditionalLibraryDirectories>\r\n      <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r\n      <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <Culture>\r\n      </Culture>\r\n    </ResourceCompile>\r\n    <PreBuildEvent>\r\n      <Command>type $(SolutionDir)res\\loc\\rufus.loc | findstr /v MSG_9 &gt; $(SolutionDir)res\\loc\\embedded.loc</Command>\r\n      <Message>Generating 'embedded.loc' file</Message>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <BuildLog />\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;..\\src\\ms-sys\\inc;..\\src\\syslinux\\libinstaller;..\\src\\syslinux\\libfat;..\\src\\syslinux\\win;..\\src\\libcdio;..\\src\\getopt;..\\src\\wimlib;..\\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <ExceptionHandling>Async</ExceptionHandling>\r\n      <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <SubSystem>Windows</SubSystem>\r\n      <AdditionalLibraryDirectories>C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.16299.0\\um\\arm64</AdditionalLibraryDirectories>\r\n      <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r\n      <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <Culture>\r\n      </Culture>\r\n    </ResourceCompile>\r\n    <PreBuildEvent>\r\n      <Command>type $(SolutionDir)res\\loc\\rufus.loc | findstr /v MSG_9 &gt; $(SolutionDir)res\\loc\\embedded.loc</Command>\r\n      <Message>Generating 'embedded.loc' file</Message>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <BuildLog />\r\n    <Midl>\r\n      <TargetEnvironment>X64</TargetEnvironment>\r\n    </Midl>\r\n    <ClCompile>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;..\\src\\ms-sys\\inc;..\\src\\syslinux\\libinstaller;..\\src\\syslinux\\libfat;..\\src\\syslinux\\win;..\\src\\libcdio;..\\src\\getopt;..\\src\\wimlib;..\\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <ExceptionHandling>Async</ExceptionHandling>\r\n      <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <Optimization>Disabled</Optimization>\r\n      <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <SubSystem>Windows</SubSystem>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n      <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r\n      <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ResourceCompile>\r\n    <PreBuildEvent>\r\n      <Command>type $(SolutionDir)res\\loc\\rufus.loc | findstr /v MSG_9 &gt; $(SolutionDir)res\\loc\\embedded.loc</Command>\r\n      <Message>Generating 'embedded.loc' file</Message>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <BuildLog />\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;..\\src\\ms-sys\\inc;..\\src\\syslinux\\libinstaller;..\\src\\syslinux\\libfat;..\\src\\syslinux\\win;..\\src\\libcdio;..\\src\\getopt;..\\src\\wimlib;..\\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <ExceptionHandling>Async</ExceptionHandling>\r\n      <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions>\r\n      <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n      <GenerateDebugInformation>false</GenerateDebugInformation>\r\n      <SubSystem>Windows</SubSystem>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n      <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions>\r\n      <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r\n    </Link>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ResourceCompile>\r\n    <PreBuildEvent>\r\n      <Command>type $(SolutionDir)res\\loc\\rufus.loc | findstr /v MSG_9 &gt; $(SolutionDir)res\\loc\\embedded.loc</Command>\r\n      <Message>Generating 'embedded.loc' file</Message>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <BuildLog />\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;..\\src\\ms-sys\\inc;..\\src\\syslinux\\libinstaller;..\\src\\syslinux\\libfat;..\\src\\syslinux\\win;..\\src\\libcdio;..\\src\\getopt;..\\src\\wimlib;..\\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <ExceptionHandling>Async</ExceptionHandling>\r\n      <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions>\r\n      <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n      <GenerateDebugInformation>false</GenerateDebugInformation>\r\n      <SubSystem>Windows</SubSystem>\r\n      <AdditionalLibraryDirectories>C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.15063.0\\um\\arm</AdditionalLibraryDirectories>\r\n      <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions>\r\n      <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r\n    </Link>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <Culture>\r\n      </Culture>\r\n    </ResourceCompile>\r\n    <PreBuildEvent>\r\n      <Command>type $(SolutionDir)res\\loc\\rufus.loc | findstr /v MSG_9 &gt; $(SolutionDir)res\\loc\\embedded.loc</Command>\r\n      <Message>Generating 'embedded.loc' file</Message>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <BuildLog />\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;..\\src\\ms-sys\\inc;..\\src\\syslinux\\libinstaller;..\\src\\syslinux\\libfat;..\\src\\syslinux\\win;..\\src\\libcdio;..\\src\\getopt;..\\src\\wimlib;..\\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <ExceptionHandling>Async</ExceptionHandling>\r\n      <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions>\r\n      <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;comdlg32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n      <GenerateDebugInformation>false</GenerateDebugInformation>\r\n      <SubSystem>Windows</SubSystem>\r\n      <AdditionalLibraryDirectories>C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.16299.0\\um\\arm64</AdditionalLibraryDirectories>\r\n      <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions>\r\n      <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r\n    </Link>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <Culture>\r\n      </Culture>\r\n    </ResourceCompile>\r\n    <PreBuildEvent>\r\n      <Command>type $(SolutionDir)res\\loc\\rufus.loc | findstr /v MSG_9 &gt; $(SolutionDir)res\\loc\\embedded.loc</Command>\r\n      <Message>Generating 'embedded.loc' file</Message>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <BuildLog />\r\n    <Midl>\r\n      <TargetEnvironment>X64</TargetEnvironment>\r\n    </Midl>\r\n    <ClCompile>\r\n      <PreprocessorDefinitions>_RUFUS;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;..\\src\\ms-sys\\inc;..\\src\\syslinux\\libinstaller;..\\src\\syslinux\\libfat;..\\src\\syslinux\\win;..\\src\\libcdio;..\\src\\getopt;..\\src\\wimlib;..\\res;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <ExceptionHandling>Async</ExceptionHandling>\r\n      <DisableSpecificWarnings>4091;5255;28251;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <UndefinePreprocessorDefinitions>NDEBUG</UndefinePreprocessorDefinitions>\r\n      <AdditionalOptions>/utf-8 /std:clatest $(ExternalCompilerOptions) %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <AdditionalDependencies>advapi32.lib;comctl32.lib;crypt32.lib;gdi32.lib;ole32.lib;dwmapi.lib;setupapi.lib;shell32.lib;ntdll.lib;shlwapi.lib;uxtheme.lib;version.lib;virtdisk.lib;wininet.lib;wintrust.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n      <GenerateDebugInformation>false</GenerateDebugInformation>\r\n      <SubSystem>Windows</SubSystem>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n      <AdditionalOptions>/BREPRO /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions)</AdditionalOptions>\r\n      <DelayLoadDLLs>advapi32.dll;comctl32.dll;crypt32.dll;gdi32.dll;ole32.dll;dwmapi.dll;setupapi.dll;shell32.dll;shlwapi.dll;uxtheme.dll;version.dll;virtdisk.dll;wininet.dll;wintrust.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r\n    </Link>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ResourceCompile>\r\n    <PreBuildEvent>\r\n      <Command>type $(SolutionDir)res\\loc\\rufus.loc | findstr /v MSG_9 &gt; $(SolutionDir)res\\loc\\embedded.loc</Command>\r\n      <Message>Generating 'embedded.loc' file</Message>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\badblocks.c\" />\r\n    <ClCompile Include=\"..\\src\\cregex_compile.c\" />\r\n    <ClCompile Include=\"..\\src\\cregex_parse.c\" />\r\n    <ClCompile Include=\"..\\src\\cregex_vm.c\" />\r\n    <ClCompile Include=\"..\\src\\darkmode.c\" />\r\n    <ClCompile Include=\"..\\src\\dos_locale.c\" />\r\n    <ClCompile Include=\"..\\src\\drive.c\" />\r\n    <ClCompile Include=\"..\\src\\format.c\" />\r\n    <ClCompile Include=\"..\\src\\dos.c\" />\r\n    <ClCompile Include=\"..\\src\\format_ext.c\" />\r\n    <ClCompile Include=\"..\\src\\format_fat32.c\" />\r\n    <ClCompile Include=\"..\\src\\icon.c\" />\r\n    <ClCompile Include=\"..\\src\\iso.c\" />\r\n    <ClCompile Include=\"..\\src\\localization.c\" />\r\n    <ClCompile Include=\"..\\src\\net.c\" />\r\n    <ClCompile Include=\"..\\src\\parser.c\" />\r\n    <ClCompile Include=\"..\\src\\pki.c\" />\r\n    <ClCompile Include=\"..\\src\\process.c\" />\r\n    <ClCompile Include=\"..\\src\\rufus.c\" />\r\n    <ClCompile Include=\"..\\src\\hash.c\" />\r\n    <ClCompile Include=\"..\\src\\smart.c\" />\r\n    <ClCompile Include=\"..\\src\\stdfn.c\" />\r\n    <ClCompile Include=\"..\\src\\stdio.c\" />\r\n    <ClCompile Include=\"..\\src\\stdlg.c\" />\r\n    <ClCompile Include=\"..\\src\\syslinux.c\" />\r\n    <ClCompile Include=\"..\\src\\dev.c\" />\r\n    <ClCompile Include=\"..\\src\\ui.c\" />\r\n    <ClCompile Include=\"..\\src\\vhd.c\" />\r\n    <ClCompile Include=\"..\\src\\wue.c\" />\r\n    <ClCompile Include=\"..\\src\\xml.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\res\\dbx\\dbx_info.h\" />\r\n    <ClInclude Include=\"..\\res\\grub2\\grub2_version.h\" />\r\n    <ClInclude Include=\"..\\res\\grub\\grub_version.h\" />\r\n    <ClInclude Include=\"..\\src\\badblocks.h\" />\r\n    <ClInclude Include=\"..\\src\\bled\\bled.h\" />\r\n    <ClInclude Include=\"..\\src\\cregex.h\" />\r\n    <ClInclude Include=\"..\\src\\darkmode.h\" />\r\n    <ClInclude Include=\"..\\src\\drive.h\" />\r\n    <ClInclude Include=\"..\\src\\efi.h\" />\r\n    <ClInclude Include=\"..\\src\\format.h\" />\r\n    <ClInclude Include=\"..\\src\\gpt_types.h\" />\r\n    <ClInclude Include=\"..\\src\\hdd_vs_ufd.h\" />\r\n    <ClInclude Include=\"..\\src\\mbr_types.h\" />\r\n    <ClInclude Include=\"..\\src\\missing.h\" />\r\n    <ClInclude Include=\"..\\src\\msvc-missing\\unistd.h\" />\r\n    <ClInclude Include=\"..\\src\\ntdll.h\" />\r\n    <ClInclude Include=\"..\\src\\settings.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\cdio.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\iso9660.h\" />\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\udf.h\" />\r\n    <ClInclude Include=\"..\\src\\localization.h\" />\r\n    <ClInclude Include=\"..\\src\\localization_data.h\" />\r\n    <ClInclude Include=\"..\\src\\msapi_utf8.h\" />\r\n    <ClInclude Include=\"..\\src\\dos.h\" />\r\n    <ClInclude Include=\"..\\src\\registry.h\" />\r\n    <ClInclude Include=\"..\\src\\resource.h\" />\r\n    <ClInclude Include=\"..\\src\\rufus.h\" />\r\n    <ClInclude Include=\"..\\src\\license.h\" />\r\n    <ClInclude Include=\"..\\src\\db.h\" />\r\n    <ClInclude Include=\"..\\src\\smart.h\" />\r\n    <ClInclude Include=\"..\\src\\dev.h\" />\r\n    <ClInclude Include=\"..\\src\\ui.h\" />\r\n    <ClInclude Include=\"..\\src\\ui_data.h\" />\r\n    <ClInclude Include=\"..\\src\\vhd.h\" />\r\n    <ClInclude Include=\"..\\src\\winio.h\" />\r\n    <ClInclude Include=\"..\\src\\wue.h\" />\r\n    <ClInclude Include=\"..\\src\\xml.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Manifest Include=\"..\\src\\rufus.manifest\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"..\\res\\down.ico\" />\r\n    <None Include=\"..\\res\\rufus.ico\" />\r\n    <None Include=\"..\\res\\up.ico\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\rufus.rc\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\".\\bled.vcxproj\">\r\n      <Project>{fb6d52d4-a2f8-c358-db85-bbcaecfddd7d}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\".\\getopt.vcxproj\">\r\n      <Project>{ae83e1b4-ce06-47ee-b7a3-c3a1d7c2d71e}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\".\\libcdio-driver.vcxproj\">\r\n      <Project>{fa1b1093-ba86-410a-b7a0-7a54c605f812}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\".\\libcdio-iso9660.vcxproj\">\r\n      <Project>{d4e80f35-2604-40ac-b436-97b052ecb572}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\".\\libcdio-udf.vcxproj\">\r\n      <Project>{0cec40a6-a195-4be5-a88b-0ab00eb142ec}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\".\\ms-sys.vcxproj\">\r\n      <Project>{2b1d078d-8eb4-4398-9ca4-23457265a7f6}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\".\\syslinux-libfat.vcxproj\">\r\n      <Project>{8390dce0-859d-4f57-ad9c-aaeac4d77eef}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\".\\syslinux-libinstaller.vcxproj\">\r\n      <Project>{266502ac-cd74-4581-b707-938a7d05ad7a}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\".\\syslinux-win.vcxproj\">\r\n      <Project>{7d2e9784-ddf7-4988-a887-cf099bc3b340}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"ext2fs.vcxproj\">\r\n      <Project>{b01f5886-2b39-4b66-b65c-6427135b6a02}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"wimlib.vcxproj\">\r\n      <Project>{633cfc82-e01b-4777-bde4-dc0739804332}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": ".vs/rufus.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Resource Files\">\r\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\rufus.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\stdlg.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\dos.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\stdio.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\format.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\drive.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\badblocks.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\dos_locale.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\syslinux.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\iso.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\icon.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\parser.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\net.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\vhd.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\stdfn.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\localization.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\smart.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\hash.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\pki.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\dev.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\process.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ui.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\format_ext.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\format_fat32.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wue.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\xml.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\darkmode.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\cregex_compile.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\cregex_parse.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\cregex_vm.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\rufus.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\msapi_utf8.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\license.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\dos.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\format.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\badblocks.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\resource.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\cdio.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\iso9660.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\libcdio\\cdio\\udf.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\registry.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\localization.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\localization_data.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\smart.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\hdd_vs_ufd.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\drive.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\bled\\bled.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\settings.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\missing.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\dev.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\db.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ntdll.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ui.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ui_data.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\mbr_types.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\gpt_types.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\winio.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\res\\grub\\grub_version.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\res\\grub2\\grub2_version.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wue.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\vhd.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\efi.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\res\\dbx\\dbx_info.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\msvc-missing\\unistd.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\xml.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\darkmode.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\cregex.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"..\\res\\rufus.ico\">\r\n      <Filter>Resource Files</Filter>\r\n    </None>\r\n    <None Include=\"..\\res\\up.ico\">\r\n      <Filter>Resource Files</Filter>\r\n    </None>\r\n    <None Include=\"..\\res\\down.ico\">\r\n      <Filter>Resource Files</Filter>\r\n    </None>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Manifest Include=\"..\\src\\rufus.manifest\">\r\n      <Filter>Resource Files</Filter>\r\n    </Manifest>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\rufus.rc\">\r\n      <Filter>Resource Files</Filter>\r\n    </ResourceCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": ".vs/syslinux-libfat.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\syslinux\\libfat\\fat.h\" />\r\n    <ClInclude Include=\"..\\src\\syslinux\\libfat\\libfat.h\" />\r\n    <ClInclude Include=\"..\\src\\syslinux\\libfat\\libfatint.h\" />\r\n    <ClInclude Include=\"..\\src\\syslinux\\libfat\\ulint.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\syslinux\\libfat\\cache.c\" />\r\n    <ClCompile Include=\"..\\src\\syslinux\\libfat\\dumpdir.c\" />\r\n    <ClCompile Include=\"..\\src\\syslinux\\libfat\\fatchain.c\" />\r\n    <ClCompile Include=\"..\\src\\syslinux\\libfat\\open.c\" />\r\n    <ClCompile Include=\"..\\src\\syslinux\\libfat\\searchdir.c\" />\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>libfat</RootNamespace>\r\n    <ProjectName>syslinux-libfat</ProjectName>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": ".vs/syslinux-libfat.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\syslinux\\libfat\\fat.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\syslinux\\libfat\\libfat.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\syslinux\\libfat\\libfatint.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\syslinux\\libfat\\ulint.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\syslinux\\libfat\\cache.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\syslinux\\libfat\\fatchain.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\syslinux\\libfat\\open.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\syslinux\\libfat\\searchdir.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\syslinux\\libfat\\dumpdir.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": ".vs/syslinux-libinstaller.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\syslinux\\libinstaller\\advconst.h\" />\r\n    <ClInclude Include=\"..\\src\\syslinux\\libinstaller\\syslinux.h\" />\r\n    <ClInclude Include=\"..\\src\\syslinux\\libinstaller\\syslxcom.h\" />\r\n    <ClInclude Include=\"..\\src\\syslinux\\libinstaller\\syslxfs.h\" />\r\n    <ClInclude Include=\"..\\src\\syslinux\\libinstaller\\syslxint.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\syslinux\\libinstaller\\fs.c\" />\r\n    <ClCompile Include=\"..\\src\\syslinux\\libinstaller\\setadv.c\" />\r\n    <ClCompile Include=\"..\\src\\syslinux\\libinstaller\\syslxmod.c\" />\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{266502AC-CD74-4581-B707-938A7D05AD7A}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>libinstaller</RootNamespace>\r\n    <ProjectName>syslinux-libinstaller</ProjectName>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": ".vs/syslinux-libinstaller.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\syslinux\\libinstaller\\advconst.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\syslinux\\libinstaller\\syslinux.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\syslinux\\libinstaller\\syslxint.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\syslinux\\libinstaller\\syslxfs.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\syslinux\\libinstaller\\syslxcom.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\syslinux\\libinstaller\\fs.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\syslinux\\libinstaller\\setadv.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\syslinux\\libinstaller\\syslxmod.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": ".vs/syslinux-win.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\syslinux\\win\\ntfssect.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\syslinux\\win\\ntfssect.c\" />\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{7D2E9784-DDF7-4988-A887-CF099BC3B340}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>win</RootNamespace>\r\n    <ProjectName>syslinux-win</ProjectName>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": ".vs/syslinux-win.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\syslinux\\win\\ntfssect.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\syslinux\\win\\ntfssect.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": ".vs/wimlib.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\wimlib\\avl_tree.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\blob_table.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\compress.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\compress_common.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\compress_parallel.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\compress_serial.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\cpu_features.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\decompress.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\decompress_common.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\dentry.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\divsufsort.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\encoding.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\error.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\export_image.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\extract.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\file_io.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\header.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\inode.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\inode_fixup.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\inode_table.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\integrity.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\iterate_dir.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\lcpit_matchfinder.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzms_common.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzms_compress.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzms_decompress.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzx_common.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzx_compress.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzx_decompress.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\metadata_resource.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\pathlist.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\paths.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\pattern.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\progress.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\registry.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\reparse.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\resource.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\scan.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\security.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\sha1.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\solid.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\split.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\tagged_items.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\textfile.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\threads.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\timestamp.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\update_image.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\util.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\wim.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\wimboot.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\win32_apply.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\win32_capture.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\win32_common.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\win32_replacements.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\win32_vss.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\write.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\xml.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\xmlproc.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\xml_windows.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\xpress_compress.c\" />\r\n    <ClCompile Include=\"..\\src\\wimlib\\xpress_decompress.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\wimlib\\config.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\alloca.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\apply.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\assert.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\avl_tree.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\bitops.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\blob_table.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\bt_matchfinder.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\case.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\chunk_compressor.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\compiler.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\compressor_ops.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\compress_common.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\cpu_features.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\decompressor_ops.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\decompress_common.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\dentry.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\divsufsort.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\encoding.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\endianness.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\error.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\file_io.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\glob.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\guid.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\hc_matchfinder.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\header.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\inode.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\inode_table.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\integrity.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\lcpit_matchfinder.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\list.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\lzms_common.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\lzms_constants.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\lzx_common.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\lzx_constants.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\matchfinder_common.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\metadata.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\ntfs_3g.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\object_id.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\pathlist.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\paths.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\pattern.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\progress.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\registry.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\reparse.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\resource.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\scan.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\security.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\security_descriptor.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\sha1.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\solid.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\tagged_items.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\test_support.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\textfile.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\threads.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\timestamp.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\types.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\unaligned.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\unix_data.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\util.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\wim.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\wimboot.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\win32.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\win32_common.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\win32_vss.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\wof.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\write.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\xattr.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\xml.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\xmlproc.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\xml_windows.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\xpress_constants.h\" />\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib_tchar.h\" />\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{633CFC82-E01B-4777-BDE4-DC0739804332}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>wimlib</RootNamespace>\r\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n    <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">$(SolutionDir)arm\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\wimlib;..\\src\\msvc-missing;..\\src\\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/std:clatest</AdditionalOptions>\r\n      <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\wimlib;..\\src\\msvc-missing;..\\src\\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/std:clatest</AdditionalOptions>\r\n      <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\wimlib;..\\src\\msvc-missing;..\\src\\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/std:clatest</AdditionalOptions>\r\n      <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\wimlib;..\\src\\msvc-missing;..\\src\\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/std:clatest</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n      <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ClCompile>\r\n    <Lib>\r\n      <TargetMachine>MachineX86</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\wimlib;..\\src\\msvc-missing;..\\src\\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/std:clatest</AdditionalOptions>\r\n      <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings>\r\n      <StringPooling>true</StringPooling>\r\n      <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>\r\n      </PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\wimlib;..\\src\\msvc-missing;..\\src\\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <AdditionalOptions>/std:clatest</AdditionalOptions>\r\n      <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings>\r\n      <StringPooling>true</StringPooling>\r\n      <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ClCompile>\r\n    <Lib />\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\wimlib;..\\src\\msvc-missing;..\\src\\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/std:clatest</AdditionalOptions>\r\n      <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\wimlib;..\\src\\msvc-missing;..\\src\\libcdio;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <DisableSpecificWarnings>4018;4146;4267;4244;4334;4789;4996;6201;6239;6246;6255;6262;6297;6326;28252;28253</DisableSpecificWarnings>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <AdditionalOptions>/std:clatest</AdditionalOptions>\r\n      <StringPooling>true</StringPooling>\r\n      <PreprocessorDefinitions>_RUFUS;HAVE_CONFIG_H;UNICODE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;__SSE2__;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TargetMachine>MachineX64</TargetMachine>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": ".vs/wimlib.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Header Files\">\r\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\wimlib\\wim.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\extract.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\xml.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\xmlproc.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\util.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\error.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\win32_replacements.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\win32_common.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\blob_table.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\encoding.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\cpu_features.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\threads.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\win32_apply.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\win32_vss.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\header.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\metadata_resource.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\resource.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\security.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\decompress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\decompress_common.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\sha1.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\xpress_decompress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\write.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\file_io.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\progress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\integrity.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\dentry.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\export_image.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\inode.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\iterate_dir.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\avl_tree.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\win32_capture.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\timestamp.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\pathlist.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\paths.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\scan.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzms_common.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzms_decompress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzx_common.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzx_decompress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\solid.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\reparse.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\compress_parallel.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\compress_serial.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\compress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\xpress_compress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzms_compress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\lzx_compress.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\compress_common.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\pattern.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\lcpit_matchfinder.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\textfile.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\divsufsort.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\inode_table.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\inode_fixup.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\tagged_items.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\wimboot.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\update_image.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\xml_windows.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\registry.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wimlib\\split.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\wimlib\\config.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\assert.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\blob_table.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\cpu_features.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\dentry.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\encoding.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\file_io.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\integrity.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\metadata.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\security.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\threads.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\wim.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\win32.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\xml.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\list.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\resource.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\sha1.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\types.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\util.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib_tchar.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\compiler.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\avl_tree.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\case.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\inode.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\error.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\guid.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\header.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\apply.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\progress.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\endianness.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\object_id.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\pathlist.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\paths.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\pattern.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\reparse.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\tagged_items.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\unix_data.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\xattr.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\timestamp.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\write.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\xmlproc.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\test_support.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\glob.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\win32_common.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\win32_vss.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\bitops.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\ntfs_3g.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\scan.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\unaligned.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\inode_table.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\textfile.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\wimboot.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\wof.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\alloca.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\decompress_common.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\decompressor_ops.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\xpress_constants.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\chunk_compressor.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\solid.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\lzms_common.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\lzms_constants.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\lzx_common.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\lzx_constants.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\compress_common.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\compressor_ops.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\hc_matchfinder.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\matchfinder_common.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\bt_matchfinder.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\lcpit_matchfinder.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\divsufsort.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\xml_windows.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\registry.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wimlib\\wimlib\\security_descriptor.h\">\r\n      <Filter>Header Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "ChangeLog.txt",
    "content": "o Version 4.13 (2026.02.17) [BUGFIX RELEASE]\r\n    Fix UEFI:NTFS not selecting the proper driver for ARM/ARM64\r\n    Update embedded GRUB to v2.14\r\n\r\no Version 4.12 (2026.01.30)\r\n    Filter out the new Bitdefender VHDs\r\n    Filter disallowed characters in local account names\r\n    Improve Microsoft Dev Drive detection (courtesy of Martin Kuschnik)\r\n    Improve the pre-formatting partition cleanup code\r\n    Improve error reporting on ISO extraction issues\r\n    Improve detection of drives with long hardware IDs (typically SSDs)\r\n    Improve conflicting process reporting\r\n    Improve support for Nutanix and umbrelOS ISOs\r\n    Fix a TOCTOU vulnerability in Fido script execution (CVE-2026-2398, reported by @independent-arg)\r\n    Fix replacement vulnerabilities for diskcopy.dll and oscdimg.exe\r\n    Fix FFU image creation being erroneously invocated, when trying to save an ISO image\r\n    Fix saving of ISO images to paths that contain spaces\r\n    Update UEFI:NTFS and UEFI DBXs to latest\r\n\r\no Version 4.11 (2025.10.02)\r\n    Add a cheat mode to toggle between Light and Dark mode\r\n    Improve WUE option text relating to the CA 2023 option\r\n    Update Linux SBAT / Microsoft SVN Secure Boot revocation values to latest\r\n    Fix some GRUB/Syslinux download dialogs showing only the 'Close' button\r\n    Fix an assert being triggered when using the WUE CA 2023 option on its own\r\n    Fix an application crash on systems that have a failed dynamic disk\r\n\r\no Version 4.10 (2025.09.24)\r\n    Add Dark Mode support (courtesy of @ozone10)\r\n    Add support for creating Windows CA 2023 compatible media (requires a Windows 11 25H2 ISO)\r\n    Add support for saving an existing drive to ISO (UDF only)\r\n    Improve error reporting when saving to VHD/VHDX (with thanks to @Kazkans)\r\n    Improve persistence support for Linux Mint\r\n    Fix UEFI DBX updates being reported in some timezones, even when there are none\r\n    Fix a situation where no file system can be selected in ISO mode\r\n    Fix a crash when trying to process Windows ISOs with very long paths\r\n\r\no Version 4.9 (2025.06.15) [BUGFIX RELEASE]\r\n    Fix downloads from https://rufus.ie no longer working due to recent GitHub server changes\r\n    Fix unofficial Windows ISOs, with single index WIMs, not presenting the WUE dialog\r\n\r\no Version 4.8 (2025.06.11)\r\n    Switch to wimlib for all WIM image processing:\r\n      - Greatly speeds up image analysis when opening Windows ISOs\r\n      - Can speed up Windows To Go drive creation (But won't do miracles if you have a crap drive)\r\n      - Might help with Parallels limitations on Mac (But Rufus on Parallels is still UNSUPPORTED)\r\n      - Enables the splitting of >4GB files with Alt-E (But still WAY SLOWER than using UEFI:NTFS)\r\n    Switch to using Visual Studio binaries everywhere, due to MinGW DLL delay-loading limitations\r\n    Add more exceptions for Linux ISOs that restrict themselves to DD mode (Nobara, openSUSE, ...)\r\n    Improve reporting of UEFI bootloaders in the log, with info on the Secure Boot status\r\n    Fix an issue with size limitations when writing an uncompressed VHD back to the same drive\r\n    Fix a crash when opening the log with the 32-bit MinGW compiled version\r\n    Fix commandline parameters not being forwarded to original Windows setup.exe\r\n\r\no Version 4.7 (2025.04.09)\r\n    Add a mechanism to detect and download updated DBXs from the official UEFI repository\r\n    Add zstd compression support for disk images\r\n    Add a new exclusion feature in the settings, to ignore disks with a specific GPT GUID\r\n    Improve detection for compressed VHD images that are too large to fit the target drive\r\n    Fix commandline hogger not being deleted when running Rufus from a different directory\r\n    Fix FAT filenames from embedded images being potentially truncated on image extraction\r\n    Fix a side-loading vulnerability [CVE-2025-26624] with cfgmgr32.dll (with thanks to @EmperialX)\r\n    Fix UI memory leaks (courtesy of @ozone10)\r\n    Fall back to user/system default locale when getting error description (courtesy of @Wack0)\r\n    Don't run the commandline hogger on POSIX shells\r\n    Drop ARM 32-bit builds (Note that ARM 64-bit builds are *NOT* affected by this)\r\n    Update FreeDOS and Grub4DOS to latest\r\n\r\no Version 4.6 (2024.10.21)\r\n    Add a new setup.exe wrapper to bypass Windows 11 24H2 in-place upgrade restrictions\r\n    Add TimeZone to regional options replication\r\n    Set local account passwords to not expire by default\r\n    Fix an error when trying to write compressed VHD images\r\n    Fix an error when invoking Rufus from the PowerShell commandline\r\n    Improve revoked UEFI bootloaders check to support Linux SBAT, Windows SVN and cert DBX\r\n    Improve support for ReactOS boot media\r\n  \r\no Version 4.5 (2024.05.22)\r\n    Add new advanced option to perform runtime UEFI media validation of suitable images (Windows, most Linux)\r\n    Move the 'Use Rufus MBR' advanced option to a cheat mode (Alt-A)\r\n    Fix truncation of VHDX images, as well as a benign error message when writing VHD/VHDX\r\n    Fix support for Linux persistence in some configurations (Mint, Ubuntu 24.04)\r\n    Fix multiple potential vulnerabilities (with thanks to Mansour Gashasbi)\r\n    Update internal GRUB to version 2.12\r\n    Update UEFI:NTFS to latest (now always uses the ntfs-3g driver, rather than the buggy AMI NTFS one)\r\n    Increase buffer size when copying ISO files, in an attempt to minimize the AMI NTFS UEFI driver bug\r\n    Improve partition creation handling\r\n    Don't display the WUE dialog when a conflicting 'unattend.xml' already exists\r\n\r\no Version 4.4 (2024.01.17)\r\n    Add workaround for distros that use broken symbolic links as their UEFI bootloaders (such as Mint 21.3)\r\n    Add support for GRUB 2.12\r\n    Fix a crash when saving .ffu images\r\n    Fix UEFI:NTFS partition not being added, in MBR mode, for some Linux ISOs\r\n    Prevent Microsoft Dev Drives from being listed\r\n    Improve support for SDXC card readers\r\n    Improve Large FAT32 formatting by aligning start of data regions to 1 MB (courtesy of Fred)\r\n\r\no Version 4.3 (2023.10.19)\r\n    Add support for Rock Ridge symbolic links preservation when NTFS is used\r\n    Add an exception to enforce NTFS for Linux Mint's LMDE\r\n    Add an expert feature to restrict a Windows installation to S Mode\r\n    Fix persistence support for Debian 12 when booted in BIOS mode\r\n    Fix a regression that prevented the opening of .vhd images\r\n    Update UEFI:NTFS to report a more explicit error on bootmgr security issues\r\n    Improve the search for conflicting processes by running it in a background thread\r\n    Improve support for Slax Linux\r\n\r\no Version 4.2 (2023.07.26)\r\n    Add detection and warning for UEFI revoked bootloaders (including ones revoked through SkuSiPolicy.p7b)\r\n    Add ZIP64 support, to extract .zip images that are larger than 4 GB\r\n    Add saving and restoring current drive to/from compressed VHDX image\r\n    Add saving and restoring current drive to/from compressed FFU (Full Flash Update) image [EXPERIMENTAL]\r\n    Fix a crash when trying to open Windows ISOs, with the MinGW compiled x86 32-bit version\r\n    Fix an issue where ISOs that contain a boot image with an 'EFI' label are not detected as bootable\r\n    Increase the ISO → ESP limit for Debian 12 netinst images\r\n    Ensure that the main partition size is aligned to the cluster size\r\n\r\no Version 4.1 (2023.05.31)\r\n    Add timeouts on enumeration queries that may stall on some systems\r\n    Restore MS-DOS drive creation through the download of binaries from Microsoft\r\n    Update the log button icon\r\n    Fix UEFI:NTFS incompatibility with Windows Dev Kit 2023 platform\r\n    Fix more GRUB 'out of range pointer' errors with Ubuntu/Fedora when booting in BIOS mode\r\n\r\no Version 4.0 (2023.04.26)\r\n    Fix persistent partition not working with Ubuntu 23.04\r\n    Fix out of range pointer error with Ubuntu 23.04 when booting in BIOS mode\r\n    Fix boot freeze with Ubuntu Studio when Secure Boot is enabled\r\n    Fix incorrect architecture detection when checking for updates\r\n    Fix a Windows Store application crash when processing GRUB bootloaders\r\n    Fix a Windows Store application crash when enumerating processes that contain a % sign\r\n    Fix a Windows Store application crash when using German localization\r\n    Note that the major version was bumped on account of:\r\n      - New versions of Rufus requiring Windows 8 or later\r\n      - New versions of Rufus defaulting to a 64-bit executable\r\n      - Old versions of Rufus potentially not being able to update properly\r\n\r\no Version 3.22 (2023.03.25)\r\n    Add SHA-1 and SHA-256 x86 acceleration on CPUs that support it (courtesy of Jeffrey Walton)\r\n    Add an option to disable BitLocker device encryption in the Windows User Experience dialog\r\n    Add a cheat mode (Ctrl-P) to preserve the log between sessions\r\n    Fix potential media creation errors by forcing the unmount of stale WIM images\r\n    Fix potential access errors in ISO → ESP mode by forcing Large FAT32 formatting\r\n    Fix user-specified label not being preserved on error/cancel\r\n    Fix some large SSD devices being listed by default\r\n    Fix processing of Rock Ridge CE fields\r\n    Work around the use of Rock Ridge symbolic links for Linux firmware packages (Debian)\r\n    Remove the ISO download feature on Windows 7\r\n    Note: This is the last version of Rufus that can run on Windows 7\r\n\r\no Version 3.21 (2022.11.28)\r\n    Allow the provision of an arbitrary local account username in the Windows User Experience dialog\r\n    Improve Windows version reporting from ISO/.wim\r\n    Update UEFI:NTFS' NTFS drivers to v1.4 and exFAT drivers to v1.9\r\n    Switch to remote download for nonstandard GRUB (Fedora 37, openSUSE Live, GeckoLinux)\r\n    Fix UEFI:NTFS partition not being set in MBR mode for ISOs with a >4GB file (UwUntu)\r\n    Fix GRUB support for Arch and derivatives, when a non FAT compliant label is used\r\n    Fix incorrect detection of GRUB with nonstandard prefixes\r\n    Fix tab order not working on the Windows User Experience dialog\r\n\r\no Version 3.20 (2022.08.03)\r\n    Enable applicable Windows User Experience options for Windows 10\r\n    Remember last Windows User Experience selection between sessions\r\n    Add automatic local account creation and regional options duplication\r\n    (NB: This is limited to creating an account with the same name as the current user and\r\n     with an empty password that the user will be prompted to change after first reboot)\r\n    Add a workaround for ISOs that have a 'syslinux' symbolic link to '/isolinux/' (Knoppix)\r\n    Revert to offline insertion of registry keys for the TPM/SB/RAM bypass where possible\r\n    Remove storage bypass, since this is a bogus bypass that doesn't do anything\r\n    Improve BIOS compatibility when displaying the \"UEFI boot only\" alert message\r\n    Fix Windows User Experience dialog appearing twice for Windows To Go\r\n    Fix Windows User Experience options not being applied for ARM64\r\n    Fix Microsoft Account bypass not being applied unless TPM/SB/RAM bypass is selected\r\n    Fix overeager detection of GRUB2 bootloaders with nonstandard prefixes\r\n\r\no Version 3.19 (2022.07.01)\r\n    Add a new selection dialog for Windows 11 setup customization:\r\n      - Secure Boot and TPM bypass have now been moved to this dialog\r\n      - Also allows to bypass the mandatory requirement for a Microsoft account on Windows 11 22H2\r\n        (NB: Network *MUST* be temporarily disabled for the local account creation to be proposed)\r\n      - Also add an option to skip all collection questions (Sets all answers to \"Don't allow\")\r\n      - Also add an option for setting internal drives offline for Windows To Go\r\n      Note: These customization options are only proposed when using a Windows 11 image.\r\n    Add support for distros using a nonstandard GRUB 2.0 prefix directory (openSUSE Live, GeckoLinux)\r\n    Add the ability to ignore USBs (See https://github.com/pbatard/rufus/blob/master/res/rufus.ini)\r\n    Change drive listing to always list in increasing order of size\r\n    Update exceptions needed by Red Hat and derivatives for the 9.x releases\r\n    Update UEFI:NTFS drivers to latest\r\n    Reassign a letter for drives written in DD mode that don't have an ESP (e.g. CoreELEC)\r\n    Fix Windows refusing to mount Linux MBR partitions on FIXED drives\r\n    Fix support for multiextent files when Joliet is in use\r\n\r\no Version 3.18 (2022.03.11)\r\n    Fix DLL sideloading vulnerabilities\r\n    Fix ISO → ESP creation when running on Windows 11\r\n    Fix an issue when detecting network connectivity when the DHCP service is disabled\r\n    Update FreeDOS to version 1.3\r\n    Add bypass of Windows 11 restrictions for in-place upgrades\r\n    Add Miracle Linux 8 to the list of Red Hat exceptions\r\n    Other internal fixes and improvements\r\n\r\no Version 3.17 (2021.10.23) [BUGFIX RELEASE]\r\n    Fix MBR not being properly cleared\r\n    Fix commandline hogger not being deleted on exit\r\n    Improve ReFS handling for platforms that support it\r\n    Update UEFI:NTFS to latest and remove Secure Boot notice since this version is Secure Boot signed\r\n    Update Grub4DOS to latest\r\n\r\no Version 3.16 (2021.10.13)\r\n    Fix ISO mode support for Red Hat 8.2+ and derivatives\r\n    Fix BIOS boot support for Arch derivatives\r\n    Fix removal of some boot entries for Ubuntu derivatives\r\n    Fix log not being saved on exit\r\n    Add Windows 11 \"Extended\" installation support (Disables TPM/Secure Boot requirements)\r\n    Add UEFI Shell ISO downloads\r\n    Add support for Intel NUC card readers\r\n    Improve Windows 11 support\r\n    Improve Windows version reporting\r\n    Speed up clearing of MBR/GPT\r\n\r\no Version 3.15 (2021.08.03)\r\n    Update GRUB to version 2.06\r\n    Add support for .vtsi files (Ventoy Sparse Image, courtesy of longpanda/ventoy)\r\n    Add workaround for openSUSE Live ISOs\r\n    Move default app directory to %LocalAppData%\\Rufus\\ and always save a log there on exit\r\n    Fix AppStore version of Rufus not being able to store downloaded files\r\n    Fix failure to open Syslinux/GRUB files when Rufus is located at the root of a drive\r\n    Prevent the creation of 'System Volume Information' on ESPs written in DD mode\r\n    Prevent drive letter assignation to the UEFI:NTFS partition\r\n    Prevent persistent partition creation errors due to size\r\n    Enhance safety checks before running the Fido ISO download script\r\n    Other internal fixes and improvements\r\n\r\no Version 3.14 (2021.04.30)\r\n    Improve DD write speed (uncompressed images only)\r\n    Improve checksum computation speed\r\n    Improve network connectivity detection\r\n    Only prompt for additional GRUB/Syslinux downloads when not writing in DD mode\r\n    Fix potential \"loss\" of disk after writing Ubuntu 20.10 in DD mode\r\n    Fix GRUB compatibility issue with Ubuntu 21.04\r\n    Fix Rufus MBR not being selected by default for Windows ISOs\r\n    Fix drag and drop being enabled during drive creation\r\n    Add more \"exceptions\" for forced DD image writing\r\n\r\no Version 3.13 (2020.11.20)\r\n    Add a cheat mode (Alt-M) to accept disk images without a Boot Marker\r\n    Add marquee operation progress to the taskbar icon\r\n    Add zeroing/image writing progress to the log\r\n    Switch to using 0x55 and 0xAA instead of 0x00 and 0xFF for low pass badblock check\r\n    Switch to using fake/manufacturer units when computing the default label\r\n    Fix overnumerous write retries on error when writing a disk image\r\n    Work around Windows' abysmal handling of removable drives that contain an ESP\r\n    Improve mounting/unmounting of volumes\r\n    Update UEFI:NTFS file system drivers to version 1.7\r\n    Other internal fixes and improvements (VDS, error reporting, etc.)\r\n\r\no Version 3.12 (2020.10.14)\r\n    Add optional SHA-512 digest algorithm (Alt-H)\r\n    Add a cheat mode (Alt +/-) to increase/decrease application priority\r\n    Enable direct provision of install.wim/install.esd for Windows To Go\r\n    Move Windows To Go ESP to the beginning of the drive, on systems that allow it\r\n    Enforce a minimum volume size of 256 MB for ext2/ext3 partitions\r\n    Speed up the scanning of ISOs with lots of Rock Ridge deep directory entries\r\n    Fix detection of GRUB version and update embedded GRUB for Ubuntu 20.10 support\r\n    Fix user interface labels for accessibility\r\n    Work around a Windows bug where the wrong drive letter may be returned\r\n\r\no Version 3.11 (2020.06.18)\r\n    Add Rock Ridge deep directory support\r\n    Add an option to write small ISOs to an ESP (GPT only)\r\n    Add a cheat mode (Ctrl-SELECT) to extract content from an additional zip archive on top of the ISO\r\n    Add a cheat mode (Alt-G) to disable Virtual Hard Disk listing\r\n    Add a cheat mode (Alt-P) to toggle a GPT ESP to Basic Data (Windows 10 only)\r\n    Fix improper x86 32-bit NTFS driver being used for UEFI:NTFS\r\n    Improve UEFI:NTFS compatibility with older UEFI firmwares\r\n    Improve startup time by running the ISO download feature check in the background\r\n    Remove Ubuntu's splash screen for persistent UEFI drives\r\n    Enable ASLR for the Rufus executable\r\n\r\no Version 3.10 (2020.04.22)\r\n    Improve support for Ubuntu 20.04\r\n    Improve detection of FIXED drives with no mounted partitions\r\n    Improve extfs formatting (courtesy of Marcos Mello)\r\n    Update UEFI:NTFS file system drivers to v1.5\r\n    Fix progress not being updated when using the German localization\r\n    Fix primary GPT being overwritten when adding the protective MBR message\r\n    Fix a regression with lousy security solutions that prevent the creation of an 'autorun.inf'\r\n    Fix an assert during FreeDOS drive creation when the Windows system locale is set to UTF-8\r\n    Fix invalid label errors when using a non-Western locale\r\n\r\no Version 3.9 (2020.02.29)\r\n    Add exFAT support when creating blank UEFI:NTFS drives [EXPERIMENTAL]\r\n    Fix ext2/ext3 corruption for partitions larger than 4 GB\r\n    Fix early boot files not being usable on compressed NTFS partitions\r\n    Fix writing of compressed streams that don't end on sector boundary\r\n    Fix percent not being displayed on slow format\r\n    Improve file preallocation and speed up ISO extraction (courtesy of Mattiwatti)\r\n    Improve ext2/ext3 formatting speed\r\n    Improve protective MBR message for GPT partitioned drives\r\n    Improve reporting of Syslinux/GRUB download errors\r\n    Improve reporting of partition types and of Windows' version\r\n    Report the usage of UDF symbolic links\r\n    Update embedded Syslinux to 6.04-pre1\r\n\r\no Version 3.8 (2019.09.16) [BUGFIX RELEASE]\r\n    Fix regression where some ISOs (Debian) would produce a Syslinux error when booted in BIOS mode\r\n    Fix potential 0xC0030057 errors when trying to create a persistent partitions on a non-FIXED drive\r\n\r\no Version 3.7 (2019.09.09)\r\n    Finalize persistent partition support for Debian and Ubuntu [EXPERIMENTAL]:\r\n    - Debian with persistence should work out of the box with any recent \"Debian Live\" ISO.\r\n    - Ubuntu with persistence should also work *IF* using a post 2019.08.01 ISO. Note that,\r\n      because of bug #1489855, trying to use persistence with Ubuntu ISOs that were released\r\n      before August 2019 will only result in rescue mode during boot - You have been warned!\r\n    - Other distros may work with persistence as long as they use a Debian-like or Ubuntu-like\r\n      method, and, in the case of Ubuntu-like, if they use casper with the #1489855 bugfix.\r\n    - Persistence and ext formatting support should still be considered EXPERIMENTAL at this stage.\r\n    Add cheat mode (<Alt>) to switch between percent/speed/ETA on *some* operations [EXPERIMENTAL]\r\n    Report SuperSpeed+ devices in the log (Come on USB-IF, just add \"Ludicrous Speed\" already!)\r\n    Fix UI checkboxes (Extended label, Fixes for old BIOSes) being cleared on START\r\n    Fix \"Can't mount GUID volume\" regression when creating Windows To Go drives\r\n    Fix \"Volume label is invalid\" error with empty labels on Windows 7\r\n    Fix stale progress bar during standalone ext2/ext3 formatting\r\n    Fix an extraction failure with R-Drive Image bootable ISOs\r\n    Disable ISO mode for Pop_OS\r\n    Other cosmetic and internal improvements\r\n\r\no Version 3.6 (2019.07.18)\r\n    Add support for persistent partitions [EXPERIMENTAL]\r\n    (Note: The above won't work with Ubuntu until Ubuntu bug #1489855 is properly fixed)\r\n    Add a mode to use VDS when partitioning/formatting (Alt-V) [EXPERIMENTAL]\r\n    Add full extraction support for efi.img (Solus)\r\n    Fix listing of potentially blocking processes\r\n    Fix NTFS not being selectable when using Grub4DOS\r\n    Fix download script not being launched when the user name contains a space\r\n    Fix translated messages potentially being truncated (e.g. Thai)\r\n    Fix progress bar report for screen readers (Accessibility issue)\r\n    Fix a regression where Windows format prompts would not be suppressed\r\n    Improve(?) Windows To Go support by following Microsoft's recommended partition order\r\n    Don't enumerate Windows Sandbox VHDs\r\n    Disable ISO mode when Manjaro ISOHybrids are being used\r\n    Update embedded GRUB to version 2.04\r\n\r\no Version 3.5 (2019.03.28)\r\n    Add a feature to download official retail Windows 8.1 or Windows 10 ISOs\r\n    (Note: 'Check for updates' must be enabled for the above to be active)\r\n    Add Windows To Go support for MCT generated Windows ISOs\r\n    Add a notice about the 'WppRecorder.sys' Microsoft bug for Windows 10 1809 ISOs\r\n    Add a notice about trying to format a drive larger than 2 TB in MBR mode\r\n    Add a notice about Legacy boot when trying to boot UEFI-only media in Legacy mode\r\n    Report the full PID and command line of potentially blocking processes in the log\r\n    Fix a potential silent abort when the drive is in use\r\n    Fix 'Quick Format' option always being activated\r\n    Fix potential change of the selected file system after an ISO has been loaded\r\n    Fix Win7 x64 EFI bootloader not being extracted in dual BIOS+UEFI mode (Alt-E)\r\n\r\no Version 3.4 (2018.12.05)\r\n    Set the default image selection directory to Downloads\\ instead of My Documents\\\r\n    Add ARM/ARM64 automatic update support\r\n    Improve UEFI:NTFS compatibility\r\n    Improve access issues by using VDS to delete all partitions\r\n    Update the .appx to include all architectures as well as request elevation\r\n    Fix broken detection of some EFI based images\r\n    Fix broken update check due to server switch\r\n    UI and accessibility fixes and improvements\r\n\r\no Version 3.3 (2018.09.17) [BUGFIX RELEASE]\r\n    Fix a regression when processing uncompressed bootable DD images\r\n    Fix Windows To Go drive creation for ARM64 Windows ISOs\r\n\r\no Version 3.2 (2018.09.11)\r\n    Add RSA-2048 signature validation on all the server downloads\r\n    Add \"Fast zeroing\" cheat mode (courtesy of René van der Zee)\r\n    Add support for XP/Server 2003 x64 ISOs (courtesy of Mattiwatti)\r\n    Improve ISO extraction performance by preallocating files (courtesy of Mattiwatti)\r\n    Improve bad blocks check algorithm (from suggestions by AL.Skywalker)\r\n    Fix progress not being displayed for Syslinux or GRUB downloads\r\n    Fix unwanted application close when cancelling an image scan\r\n    Fix an issue where FAT32 could still be selected for ISOs containing a >4GB file\r\n\r\no Version 3.1 (2018.06.19)\r\n    Fix extraction of ISO content for GRUB based ISOs (Manjaro, Kaspersky, etc.)\r\n    Fix text being truncated on some dialogs (mostly Russian and Thai)\r\n    Add detection & warning about the 'Controlled Folder Access' Windows 10 feature\r\n    Improve retry attempts for transient errors\r\n    Increase size of the ESP to 300MB, for Windows To Go drives partitioned as GPT\r\n    Update GRUB 2.0 and Grub4DOS to latest\r\n    Update libcdio to latest\r\n\r\no Version 3.0 (2018.05.29)\r\n    UI redesign to follow the flow of user operations (with thanks to Fahad Al-Riyami for the concept)\r\n    Drop XP and Vista platform support\r\n    Switch all downloads to SSL and use https://rufus.ie as the new base URL\r\n    Add ARM64 support for UEFI:NTFS\r\n    Fix delays when querying floppy drives during device enumeration\r\n    Improve support of efi.img files on Linux ISOs\r\n    Improve support for non-ISO9660 compliant openSUSE Leap ISOs\r\n    Improve translation support and remove manual positioning\r\n    Internal fixes and improvements\r\n\r\no Version 2.18 (2017.11.07)\r\n    Ensure that the same drive is reselected on device refresh\r\n    Add a cheat mode to cycle the USB port of currently selected device\r\n    Make lookup for updatable .cfg file more generic (e.g. ESET SysRescue)\r\n    Fix handling of multiextent ISOs (e.g. BlackArch Linux)\r\n    Fix propagation of image decompression errors\r\n    Update grub4dos to latest\r\n\r\n    IMPORTANT: THIS IS THE LAST RELEASE TO SUPPORT WINDOWS XP AND WINDOWS VISTA\r\n    SUBSEQUENT RUFUS RELEASES ARE *NO LONGER* COMPATIBLE WITH THESE PLATFORMS\r\n\r\no Version 2.17 (2017.09.12)\r\n    Add support for Debian 9 live ISOs in UEFI mode\r\n    Add support for Super Floppy Disk \"partitioning\" mode\r\n    Add support for more non-USB card readers\r\n    Strengthen download update checks, to prevent attack scenarios that leverage user unawareness\r\n    Fix an issue with Spanish translation prompts not displaying properly\r\n    Fix an issue with Windows To Go support on some non-official Windows ISOs\r\n    Fix an issue with log autoscrolling\r\n    Fix an issue when using A: or B: as drive letters\r\n\r\no Version 2.16 (2017.07.31)\r\n    Add an audiovisual cue on completion/error\r\n    Add a workaround for ISOs using nonstandard Rock Ridge extensions (looking at you Kali Linux!)\r\n    Notify user when an ISO is broken or truncated\r\n    Notify user if other processes are accessing the drive before format\r\n    List processes that are locking a drive on failure\r\n    Improve verbosity of the Windows To Go process\r\n    Other fixes and improvements\r\n\r\no Version 2.15 (2017.05.17)\r\n    Fix non-listing of drives that are opened for write access by another process\r\n    Report external processes that may be preventing disk access (in the log)\r\n    Improve Windows To Go support for Windows 10 Creators Update\r\n    Don't report an error on checkdisk failure\r\n    Update GRUB 2.0 and Grub4DOS to latest\r\n    Other fixes and improvements\r\n\r\no Version 2.14 (2017.04.10) [BUGFIX RELEASE]\r\n    Fix inability to create BIOS-bootable drives, in some circumstances, due to write sharing permissions\r\n\r\no Version 2.13 (2017.04.06)\r\n    Preserve 'GPT for UEFI' option if the user changed it before selecting an ISO\r\n    Fix unwanted notification sound when closing with the X button (#893)\r\n    Fix inability to restore the minimized application after a popup is displayed (#896)\r\n    Fix an issue when trying to install Syslinux/NTFS twice in a row (#904)\r\n    Work around Microsoft's inconsistent casing of device IDs during device enumeration\r\n    Work around Microsoft's aggressive locking of partitions in Windows 10 Creators Update (#883)\r\n    Restrict write sharing permissions when accessing a device\r\n    Update libcdio and GRUB 2.0 to latest\r\n\r\no Version 2.12 (2017.01.27)\r\n    Add Hebrew translation, courtesy of NSBuilder and פלוני אלמוני\r\n    Add a cheat mode (Alt-O) to create an ISO from the first optical media found\r\n    Enable target system selection for Windows To Go\r\n    Enable NTFS selection for Syslinux 6.x (EXPERIMENTAL)\r\n    Fix an issue that allowed BIOS target selection with pure UEFI images\r\n    Fix license display for RTL languages\r\n    Update Grub4DOS and FreeDOS to latest\r\n    Additional fixes and improvements\r\n\r\no Version 2.11 (2016.09.08)\r\n    Do not download BIOS related files unless BIOS boot is selected\r\n    Improve support for Arch Linux derivatives\r\n    Add a cheat mode to disable drive indexing (Alt-Q) on format\r\n    Fix handling of 'Super Floppy Disk' formatted drives\r\n    Fix handling of misleading short write reports, for drives larger than 1 TB\r\n    Fix an issue that enabled FAT32 file system selection on some Windows images\r\n    Fix broken UI font for XP users\r\n    Fix sanitizing of exFAT labels\r\n\r\no Version 2.10 (2016.07.20)\r\n    Add SHA-256 validation for downloaded files. You will now see an ✓ or ✗ in the log for relevant content\r\n    Add support for O2Micro PCI-E card readers\r\n    Add compressed NTFS support for UEFI:NTFS\r\n    Improve automatic closure of the Windows default format prompt\r\n    Improve support for Ubuntu (silence a benign warning), Springdale (use the actual label) and Antergos (Syslinux version detection)\r\n    Work around a Windows bug that can render a GPT disk inaccessible after cleanup (e.g. ChromeOS image)\r\n    Fix hash computation for content that isn't a multiple of 64 bytes (NB: This did not affect ISOs)\r\n    Fix Syslinux installation on some media, with huge thanks to 424778940z for the tests\r\n    Fix a corner case where settings could be altered after Start had been pressed, if a hotplug event also occurred\r\n    Additional fixes and improvements\r\n\r\no Version 2.9 (2016.05.17)\r\n    Add ARM support for UEFI:NTFS\r\n    Fix UEFI:NTFS support for HP and Gigabyte firmwares (with thanks to Rod Smith and linnaea)\r\n    Fix unwanted listing of some internal removable drives\r\n    Fix the resurgence of a possible Syslinux installation crash\r\n    Fix missing default cluster size default on exFAT for >32GB drives\r\n    Fix the non-removal of the commandline hogger in some corner cases\r\n    Use \"modern\" file selection dialog on Vista or later (if you can spot the difference, good for you...)\r\n\r\no Version 2.8 (2016.03.22)\r\n    Enable listing of non-USB card readers (EXPERIMENTAL)\r\n    Major speed improvement for checksum computation\r\n    Fix UI flicker during progress actualization\r\n    Fix computation of FAT size for Large FAT32 (with thanks to Ady)\r\n    Syslinux improvements\r\n    Update GRUB to 2.02~beta3\r\n\r\no Version 2.7 (2016.02.14)\r\n    Add Thai translation, courtesy of Sippapas Wangsri\r\n    Add Drag and Drop support, courtesy of SeymourApps\r\n    Add a retry for most write operations\r\n    Update UEFI:NTFS, ms-sys and Grub4DOS to latest\r\n    Dual sign Rufus with both SHA-1 and SHA-256\r\n    Fix 2nd line of SHA-256 being hidden on some platforms\r\n    Fix shutdown prevention issues\r\n    Additional fixes & translation updates\r\n\r\no Version 2.6 (2015.12.22)\r\n    Add Serbian (Latin) translation, courtesy of Ivan Strugar\r\n    Add a cheat mode to zero a device (Alt-Z)\r\n    Fix dual BIOS/UEFI mode not being disabled once enabled (Alt-E)\r\n    Fix a crash when Syslinux downloaded files are modified by a firewall\r\n    Fix FAT32 not being disabled for Windows ISOs in BIOS/CSM mode\r\n    Additional translation updates\r\n\r\no Version 2.5 (2015.10.26)\r\n    Add SHA-256 checksum verification\r\n    Add a cheat mode to disable exclusive USB drive locking (Alt-,)\r\n    Add digital signature check on update downloads\r\n    Add Azerbaijani translation, courtesy of Elvin Məlikov\r\n    Add Persian translation, courtesy of Seyed Zia Azimi (ziaa)\r\n    Fix an issue where the update settings dialog may not display properly\r\n    Report Windows build number in the log (Windows 8 or later)\r\n    Many localization improvements and fixes, especially for right-to-left languages\r\n    Additional translation updates\r\n\r\no Version 2.4 (2015.09.27)\r\n    Allow some settings and cheat modes to be persisted between sessions\r\n    Fix multiple issues with flash drive detection\r\n    Fix listing of drives that contain no media\r\n    Fix cheat mode to save the current USB to *uncompressed* VHD (Alt-V)\r\n    Fix an UI scaling issue with high DPI displays for non English languages\r\n    Update most of the translations\r\n    Additional cosmetic improvements\r\n\r\no Version 2.3 (2015.08.28)\r\n    Detect ISOHybrid images and ask users how they should be written\r\n    Add MD5/SHA1 checksum verification ('#' button on the status bar)\r\n    Add Zip decompression support for DD Images\r\n    Add a cheat mode to save the current USB to *uncompressed* VHD (Alt-V)\r\n    Add a cheat mode for ISO timestamp preservation (Alt-T)\r\n    Add a cheat mode for USB enumeration debugging (Alt-.)\r\n    Disable MS-DOS creation for Windows 10 or later (FreeDOS is still available)\r\n    Fix Windows To Go creation issues, and enable access to internal disks\r\n    Fix UEFI support for Fedora ISOs\r\n    Fix some USB enumeration issues\r\n    Other improvements and fixes, including translation updates\r\n\r\no Version 2.2 (2015.05.31)\r\n    Modernize the language selection button, courtesy of David Warner\r\n    Add keyboard accessibility, courtesy of David Warner\r\n    Add a clear indication of when UEFI-CSM is to be used\r\n    Fix an USB detection issue and add support for ASUS UASP \"Turbo Mode\"\r\n    Fix prevention of Windows shutdown when Rufus is idle\r\n    Improve UI on high DPI monitors\r\n    Update Grub4DOS to 0.4.6a [2015.05.18]\r\n    Other UI improvements and fixes, including translation updates\r\n\r\no Version 2.1 (2015.03.23)\r\n    Add 32 bit support to UEFI:NTFS boot\r\n    Add standalone UEFI:NTFS boot installation, in advanced mode\r\n    Add Vietnamese translation, courtesy of thanhtai2009\r\n    Disable support for ISOs that don't report their GRUB version (looking at you Kaspersky!)\r\n    Fix broken Windows UEFI installation when using GPT/NTFS\r\n    Fix creation of 32 bit UEFI Windows 10 installation flash drives\r\n    Other improvements\r\n\r\no Version 2.0 (2015.03.03)\r\n    Major UI improvements (improved font, new info field, no separate progress dialog, etc.)\r\n    Add support for Windows To Go (if Rufus is running on Windows 8 or later)\r\n    Add support for Grub4DOS and GRUB 2 based images (e.g. FreeNAS)\r\n    Add portable application support, through a 'rufus.ini' file\r\n    Add native decompression support for DD images (.Z, .gz, .lzma, .bz2 and .xz)\r\n    Add seamless UEFI boot of NTFS partitions, for Windows ISOs with large files (>4GB)\r\n    Add support for Windows multipart 'install.swm'\r\n    Add support for non Microsoft VHD drivers\r\n    Add Norwegian translation, courtesy of JED\r\n    Fix a crash on image selection when no device is present\r\n    Fix broken VHD support for non-English version of Windows\r\n    Fix write error for DD images that are not a multiple of the sector size\r\n    Fix broken Unicode support\r\n    Update embedded Syslinux to 6.03\r\n    Other improvements and fixes\r\n\r\no Version 1.4.12 (2014.11.09) [BUGFIX RELEASE]\r\n    Fix support for Red Hat 7 and CentOS 7\r\n    Fix support for Debian 7.x\r\n    Fix default listing of Mushkin Ventura Ultra USB 3.0 drives\r\n    Fix Czech translation, courtesy of Jakub Moc\r\n    Update Windows version listing for Windows 10\r\n\r\no Version 1.4.11 (2014.11.04)\r\n    Add Czech translation, courtesy of Richard Kahl\r\n    Add Ukrainian translation, courtesy of VKS\r\n    Fix formatting of drives with a large sector size (2K, 4K)\r\n    Fix UEFI boot for Tails and other Syslinux/EFI based ISOs\r\n    Fix listing of devices when all 26 drive letters are in use\r\n    Add a minimize button and minor UI changes\r\n    Other improvements\r\n\r\no Version 1.4.10 (2014.08.15)\r\n    Fix a crash when scanning disk images with no USB drive plugged\r\n    Fix default detection of some OCZ flash drives\r\n    Improve Syslinux 6.x support (for Tails 1.x and other ISOs)\r\n    Improve disk image handling (refresh partitions, remount drive, etc.)\r\n    Other fixes and improvements\r\n\r\no Version 1.4.9 (2014.06.08) [BUGFIX RELEASE]\r\n    Fix listing of drives for Windows XP and Windows Vista (reported by Alex Andrews)\r\n\r\no Version 1.4.8 (2014.06.03)\r\n    Add KolibriOS ISO support\r\n    Add Arabic translation, courtesy of عمر الصمد\r\n    Add Croatian translation, courtesy of Dario Komar\r\n    Add Danish translation, courtesy of Jens Hansen\r\n    Add Latvian translation, courtesy of Aldis Tutins\r\n    Add Portuguese Brazilian translation, courtesy of Chateaubriand Vieira Moura\r\n    Allow the use of VHDs as DD image source (fixed disk/uncompressed only)\r\n    Report the detected USB speed in the log\r\n    Fix a long standing issue when launching Rufus using Far Manager\r\n    Fix support for pure UEFI bootable disk images\r\n    Fix detection for some Buffalo, Lacie, Samsung, Toshiba and Verbatim drives\r\n    Various other fixes and improvements\r\n\r\no Version 1.4.7 (2014.04.22)\r\n    Add VHD support as a target, courtesy of Scott\r\n    Add ReFS support (only for Windows 8.1 or later and only for fixed drives)\r\n    Add a cheat mode to force the use of DD image writing for dual ISOs\r\n    Add Japanese translation, courtesy of Chantella Jackson\r\n    Add Slovak translation, courtesy of martinco78\r\n    Add Swedish translation, courtesy of Sopor\r\n    Improve the display of filesizes when copying content\r\n    Fix FAT32 cluster transitions\r\n    Fix unpartitioned drives not always being listed\r\n    Fix bad blocks report\r\n\r\no Version 1.4.6 (2014.03.17)\r\n    Display USB size in the dropdown list\r\n    Add Bulgarian translation, courtesy of Krasimir Nevenov\r\n    Improve checkbox handling in the UI and fix UDF/exFAT formatting issues\r\n    Fix replacement of obsolete vesamenu.c32 (reported by Liang)\r\n    Fix an issue that could prevent the download of files from the Rufus website\r\n    Fix untimely libcdio messages when processing Rock-Ridge ISOs (such as Ubuntu)\r\n    Other fixes\r\n\r\no Version 1.4.5 (2014.02.27) [BUGFIX RELEASE]\r\n    Fix detection of fixed drives (reported by dominiquesb)\r\n\r\no Version 1.4.4 (2014.02.26)\r\n    Add *uncompressed* Disk Image support (FreeBSD, FreeNAS, etc.)\r\n    Add right-to-left language support\r\n    Add an alert when multiple partitions are about to be erased\r\n    Add (unofficial) NTFS Compression support\r\n    Add Finnish translation, courtesy of Riku Brander\r\n    Ignore failure on ISO autorun.inf creation, to keep dumb security applications happy\r\n    Improve hotplug detection\r\n    Improve Syslinux v5+ support (requires an internet connection to download extra files)\r\n    Fix support for latest gparted, ArchLinux, and other Syslinux v5+ based ISOs\r\n    Fix detection for Toshiba drives (again)\r\n    Fix UDF Unicode support\r\n\r\no Version 1.4.3 (2014.01.21) [BUGFIX RELEASE]\r\n    Fix format operation not starting on Windows XP (reported by ank91)\r\n\r\no Version 1.4.2 (2014.01.18)\r\n    Add USB Attached SCSI (UAS) support\r\n    Add ReactOS support\r\n    Add NTFS UEFI support, for targets that can support it\r\n    Add insertion detection for USB memory card readers\r\n    Add retry when writing ISO files... again\r\n    Add Chinese (Simplified) translation, courtesy of 佚名\r\n    Add Indonesian translation, courtesy of Abe Akatsuki\r\n    Add Malay translation, courtesy of Muhammad Aman\r\n    Add Portuguese (Portugal) translation, courtesy of Fernando Baptista\r\n    Speed up boot record cleanup, for slow drives\r\n    Improve initial locale detection\r\n    Save user selected locale between sessions\r\n    Always use English locale in the log, where possible\r\n    Fix detection for some SanDisk, Kingston, HP and Toshiba drives\r\n    Fix a potential issue with drive letter assignation\r\n    Various other fixes and improvements\r\n\r\no Version 1.4.1 (2013.12.05) [BUGFIX RELEASE]\r\n    Fix broken Syslinux support (reported by ank91)\r\n    Add Slovenian support, courtesy of Matej Horvat\r\n\r\no Version 1.4.0 (2013.12.02)\r\n    Add localization support, with native integration for the following languages:\r\n    - Chinese (Traditional), courtesy of 佚\r\n    - Dutch, courtesy of Roberto Pino\r\n    - French, courtesy of myself (\"Je vais me gêner !\")\r\n    - German, courtesy of Thilo Langbein\r\n    - Greek, courtesy of Konstantinos and Nikolaos Margaritis\r\n    - Hungarian, courtesy of georg1136\r\n    - Italian, courtesy of bovirus\r\n    - Korean, courtesy of 나두야간다\r\n    - Lithuanian, courtesy of Gintaras Venslovas\r\n    - Polish, courtesy of Piotr Halama\r\n    - Romanian, courtesy of Gîrlea Alexandru\r\n    - Russian, courtesy of Кирилл Иванов\r\n    - Spanish, courtesy of José Pineda\r\n    - Turkish, courtesy of Mehmetali Kuran\r\n    - More to come, more wanted! See http://rufus.akeo.ie/translations\r\n    Add \"smart\" detection of USB HDD vs USB Flash Drive\r\n    Add retry when writing ISO files\r\n    Add detection and display of VID:PID for the target device (in the log)\r\n    Updated Syslinux to v4.0.7\r\n    Fixed some issues with DOS localization\r\n    Fixed FAT32 formatting for large and GPT disks\r\n    Fixed support for Ubuntu, Scientific Linux, unofficial Windows and other ISOs\r\n    Various other fixes and improvements\r\n\r\no Version 1.3.4 (2013.07.15)\r\n    Syslinux v5 support (NEW)\r\n    UDF formatting support (NEW - Vista and later only)\r\n    More drive handling improvements, to avoid \"Could not open media\" errors\r\n    Fixed support for ISOs containing files larger than 4GB\r\n    Fixed elevation request for unprivileged users\r\n    Fixed download of c32 files into the application directory\r\n    Better compression algorithm for the executable\r\n    Other bug fixes and improvements (spelling, UI, etc.)\r\n\r\no Version 1.3.3 (2013.06.10)\r\n    Drive handling and hotplug detection overhaul\r\n    Add support for raw/unpartitioned drives\r\n    Add (limited) commandline support, to specify the ISO image to open\r\n    Add option to list fixed/unpartitioned drives, in the advanced options\r\n    Fix broken detection of unsupported ISO images\r\n    Don't assume C: to be the drive letter for DOS\r\n    Various other fixes and improvements\r\n\r\no Version 1.3.2 (2013.01.27)\r\n    Fix support for newer ArchLinux ISOs, that was removed in 1.3.1\r\n    Add support for UEFI boot, as well as GPT. What this means is that Rufus can\r\n      now produce UEFI bootable UFDs from EFI compatible ISOs, such as Windows 7 x64,\r\n      Windows 8, ArchLinux, etc.\r\n    The first partition is now always aligned to 1MB (unless advanced options are used)\r\n    Internal refactoring and fixes\r\n\r\no Version 1.3.1 (2013.01.09)\r\n    Fix Windows XP ISO support, that was broken in 1.3.0\r\n    Drop support for newer ArchLinux ISOs - this will be fixed in 1.3.2\r\n    Indicate which of FAT32 or Large FAT32 will be used as well as Partition Scheme\r\n    Various internal fixes\r\n\r\no Version 1.3.0 (2012.12.16)\r\n    FAT32 format support for >32GB drives\r\n      Based on fat32format from Ridgecrop Consultants Ltd:\r\n      http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm\r\n    Automated update check\r\n    Relax ISO9660 compliance for Arch Linux images\r\n    Add support for VMWare ESXi 5.1 ISO images\r\n    Update Syslinux to v4.0.6 and libcdio to v0.90\r\n    Miscellaneous UI improvements and fixes\r\n\r\no Version 1.2.0 (2012.06.04)\r\n    Single version of Rufus, that includes FreeDOS support always\r\n    Add a toggleable advanced options panel\r\n    Add bare Syslinux installation for (FAT partitions only)\r\n    Add taskbar progress (Windows 7 or later)\r\n    Integrate logging output in the application\r\n    Fixes unavailable boot option when an empty card reader is plugged (reported by TheHive)\r\n    Works around the use of non-ISO compliant LiveXP images (reported by TheHive)\r\n    Various other bugfixes and improvements\r\n\r\no Version 1.1.7 (2012.04.06):\r\n    Fixes wrong bootable disk ID introduced in 1.1.6 (reported by Jeff Byers)\r\n    Fixes support for minint WinPE 1.x images\r\n\r\no Version 1.1.6 (2012.03.27):\r\n    Add ISO support for Windows XP (SP2 or later), Windows 2003 and BartPE\r\n\r\no Version 1.1.5 (2012.03.12):\r\n    Fixes detection of devices without friendly name (reported by rschiang)\r\n    Fixes support of WinPE/AIK ISO images (reported by Dmitry Sokolov)\r\n    Fixes no disk at launch with empty card readers (reported by ChrisR\r\n    Add download of vesamenu.c32 for ISOs that need it\r\n\r\no Version 1.1.4 (2012.03.03):\r\n    Fixes ISO support for directories with extended characters (reported by ChrisR)\r\n    Fixes bad blocks test issues (reported by steve6375)\r\n    Read extended labels from autorun.inf when present\r\n    Update FreeDOS files to latest versions\r\n\r\no Version 1.1.3 (2012.02.24):\r\n    Fixes an issue on XP when using Windows ISOs (reported by wimb)\r\n    Disable listing of fixed drives (eg. HDDs)\r\n    Add 'fake' USB drive detection during bad blocks check\r\n\r\no Version 1.1.2 (2012.02.22):\r\n    Fixes ISO support for Fedora, openSUSE and Hiren's Boot CD\r\n    Add icon and extended/international label support\r\n\r\no Version 1.1.1 (2012.02.16):\r\n    ISO image support (syslinux) - targeted at Linux installation ISOs\r\n    ISO fixes and UI improvements\r\n\r\no Version 1.1.0 (2012.02.08):\r\n    ISO image support (NTFS, bootmgr only - targeted at Windows installation ISOs)\r\n\r\no Version 1.0.7 (2012.02.02):\r\n    Fixes a detection issue on platforms with multiple optical drives (with thanks to ElGaton)\r\n    Add number of passes for bad blocks check\r\n    Improved locale selection for FreeDOS\r\n\r\no Version 1.0.6 (2012.01.03):\r\n    Log report when bad blocks are found\r\n\r\no Version 1.0.5 (2011.12.25):\r\n    Keyboard layout detection & support\r\n\r\no Version 1.0.4 (2011.12.16):\r\n    FreeDOS support\r\n\r\no Version 1.0.3 (2011.12.12):\r\n    First public release\r\n    Progress status improvements\r\n    Filtering of invalid cluster sizes\r\n    Disable Autoplay on Vista and later while the application is running\r\n\r\no Version 1.0.2 (2011.12.06):\r\n    Beta release\r\n    Support for bad blocks check\r\n\r\no Version 1.0.1 (2011.12.04):\r\n    Alpha release\r\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "                    GNU GENERAL PUBLIC LICENSE\r\n                       Version 3, 29 June 2007\r\n\r\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\r\n Everyone is permitted to copy and distribute verbatim copies\r\n of this license document, but changing it is not allowed.\r\n\r\n                            Preamble\r\n\r\n  The GNU General Public License is a free, copyleft license for\r\nsoftware and other kinds of works.\r\n\r\n  The licenses for most software and other practical works are designed\r\nto take away your freedom to share and change the works.  By contrast,\r\nthe GNU General Public License is intended to guarantee your freedom to\r\nshare and change all versions of a program--to make sure it remains free\r\nsoftware for all its users.  We, the Free Software Foundation, use the\r\nGNU General Public License for most of our software; it applies also to\r\nany other work released this way by its authors.  You can apply it to\r\nyour programs, too.\r\n\r\n  When we speak of free software, we are referring to freedom, not\r\nprice.  Our General Public Licenses are designed to make sure that you\r\nhave the freedom to distribute copies of free software (and charge for\r\nthem if you wish), that you receive source code or can get it if you\r\nwant it, that you can change the software or use pieces of it in new\r\nfree programs, and that you know you can do these things.\r\n\r\n  To protect your rights, we need to prevent others from denying you\r\nthese rights or asking you to surrender the rights.  Therefore, you have\r\ncertain responsibilities if you distribute copies of the software, or if\r\nyou modify it: responsibilities to respect the freedom of others.\r\n\r\n  For example, if you distribute copies of such a program, whether\r\ngratis or for a fee, you must pass on to the recipients the same\r\nfreedoms that you received.  You must make sure that they, too, receive\r\nor can get the source code.  And you must show them these terms so they\r\nknow their rights.\r\n\r\n  Developers that use the GNU GPL protect your rights with two steps:\r\n(1) assert copyright on the software, and (2) offer you this License\r\ngiving you legal permission to copy, distribute and/or modify it.\r\n\r\n  For the developers' and authors' protection, the GPL clearly explains\r\nthat there is no warranty for this free software.  For both users' and\r\nauthors' sake, the GPL requires that modified versions be marked as\r\nchanged, so that their problems will not be attributed erroneously to\r\nauthors of previous versions.\r\n\r\n  Some devices are designed to deny users access to install or run\r\nmodified versions of the software inside them, although the manufacturer\r\ncan do so.  This is fundamentally incompatible with the aim of\r\nprotecting users' freedom to change the software.  The systematic\r\npattern of such abuse occurs in the area of products for individuals to\r\nuse, which is precisely where it is most unacceptable.  Therefore, we\r\nhave designed this version of the GPL to prohibit the practice for those\r\nproducts.  If such problems arise substantially in other domains, we\r\nstand ready to extend this provision to those domains in future versions\r\nof the GPL, as needed to protect the freedom of users.\r\n\r\n  Finally, every program is threatened constantly by software patents.\r\nStates should not allow patents to restrict development and use of\r\nsoftware on general-purpose computers, but in those that do, we wish to\r\navoid the special danger that patents applied to a free program could\r\nmake it effectively proprietary.  To prevent this, the GPL assures that\r\npatents cannot be used to render the program non-free.\r\n\r\n  The precise terms and conditions for copying, distribution and\r\nmodification follow.\r\n\r\n                       TERMS AND CONDITIONS\r\n\r\n  0. Definitions.\r\n\r\n  \"This License\" refers to version 3 of the GNU General Public License.\r\n\r\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\r\nworks, such as semiconductor masks.\r\n\r\n  \"The Program\" refers to any copyrightable work licensed under this\r\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\r\n\"recipients\" may be individuals or organizations.\r\n\r\n  To \"modify\" a work means to copy from or adapt all or part of the work\r\nin a fashion requiring copyright permission, other than the making of an\r\nexact copy.  The resulting work is called a \"modified version\" of the\r\nearlier work or a work \"based on\" the earlier work.\r\n\r\n  A \"covered work\" means either the unmodified Program or a work based\r\non the Program.\r\n\r\n  To \"propagate\" a work means to do anything with it that, without\r\npermission, would make you directly or secondarily liable for\r\ninfringement under applicable copyright law, except executing it on a\r\ncomputer or modifying a private copy.  Propagation includes copying,\r\ndistribution (with or without modification), making available to the\r\npublic, and in some countries other activities as well.\r\n\r\n  To \"convey\" a work means any kind of propagation that enables other\r\nparties to make or receive copies.  Mere interaction with a user through\r\na computer network, with no transfer of a copy, is not conveying.\r\n\r\n  An interactive user interface displays \"Appropriate Legal Notices\"\r\nto the extent that it includes a convenient and prominently visible\r\nfeature that (1) displays an appropriate copyright notice, and (2)\r\ntells the user that there is no warranty for the work (except to the\r\nextent that warranties are provided), that licensees may convey the\r\nwork under this License, and how to view a copy of this License.  If\r\nthe interface presents a list of user commands or options, such as a\r\nmenu, a prominent item in the list meets this criterion.\r\n\r\n  1. Source Code.\r\n\r\n  The \"source code\" for a work means the preferred form of the work\r\nfor making modifications to it.  \"Object code\" means any non-source\r\nform of a work.\r\n\r\n  A \"Standard Interface\" means an interface that either is an official\r\nstandard defined by a recognized standards body, or, in the case of\r\ninterfaces specified for a particular programming language, one that\r\nis widely used among developers working in that language.\r\n\r\n  The \"System Libraries\" of an executable work include anything, other\r\nthan the work as a whole, that (a) is included in the normal form of\r\npackaging a Major Component, but which is not part of that Major\r\nComponent, and (b) serves only to enable use of the work with that\r\nMajor Component, or to implement a Standard Interface for which an\r\nimplementation is available to the public in source code form.  A\r\n\"Major Component\", in this context, means a major essential component\r\n(kernel, window system, and so on) of the specific operating system\r\n(if any) on which the executable work runs, or a compiler used to\r\nproduce the work, or an object code interpreter used to run it.\r\n\r\n  The \"Corresponding Source\" for a work in object code form means all\r\nthe source code needed to generate, install, and (for an executable\r\nwork) run the object code and to modify the work, including scripts to\r\ncontrol those activities.  However, it does not include the work's\r\nSystem Libraries, or general-purpose tools or generally available free\r\nprograms which are used unmodified in performing those activities but\r\nwhich are not part of the work.  For example, Corresponding Source\r\nincludes interface definition files associated with source files for\r\nthe work, and the source code for shared libraries and dynamically\r\nlinked subprograms that the work is specifically designed to require,\r\nsuch as by intimate data communication or control flow between those\r\nsubprograms and other parts of the work.\r\n\r\n  The Corresponding Source need not include anything that users\r\ncan regenerate automatically from other parts of the Corresponding\r\nSource.\r\n\r\n  The Corresponding Source for a work in source code form is that\r\nsame work.\r\n\r\n  2. Basic Permissions.\r\n\r\n  All rights granted under this License are granted for the term of\r\ncopyright on the Program, and are irrevocable provided the stated\r\nconditions are met.  This License explicitly affirms your unlimited\r\npermission to run the unmodified Program.  The output from running a\r\ncovered work is covered by this License only if the output, given its\r\ncontent, constitutes a covered work.  This License acknowledges your\r\nrights of fair use or other equivalent, as provided by copyright law.\r\n\r\n  You may make, run and propagate covered works that you do not\r\nconvey, without conditions so long as your license otherwise remains\r\nin force.  You may convey covered works to others for the sole purpose\r\nof having them make modifications exclusively for you, or provide you\r\nwith facilities for running those works, provided that you comply with\r\nthe terms of this License in conveying all material for which you do\r\nnot control copyright.  Those thus making or running the covered works\r\nfor you must do so exclusively on your behalf, under your direction\r\nand control, on terms that prohibit them from making any copies of\r\nyour copyrighted material outside their relationship with you.\r\n\r\n  Conveying under any other circumstances is permitted solely under\r\nthe conditions stated below.  Sublicensing is not allowed; section 10\r\nmakes it unnecessary.\r\n\r\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\r\n\r\n  No covered work shall be deemed part of an effective technological\r\nmeasure under any applicable law fulfilling obligations under article\r\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\r\nsimilar laws prohibiting or restricting circumvention of such\r\nmeasures.\r\n\r\n  When you convey a covered work, you waive any legal power to forbid\r\ncircumvention of technological measures to the extent such circumvention\r\nis effected by exercising rights under this License with respect to\r\nthe covered work, and you disclaim any intention to limit operation or\r\nmodification of the work as a means of enforcing, against the work's\r\nusers, your or third parties' legal rights to forbid circumvention of\r\ntechnological measures.\r\n\r\n  4. Conveying Verbatim Copies.\r\n\r\n  You may convey verbatim copies of the Program's source code as you\r\nreceive it, in any medium, provided that you conspicuously and\r\nappropriately publish on each copy an appropriate copyright notice;\r\nkeep intact all notices stating that this License and any\r\nnon-permissive terms added in accord with section 7 apply to the code;\r\nkeep intact all notices of the absence of any warranty; and give all\r\nrecipients a copy of this License along with the Program.\r\n\r\n  You may charge any price or no price for each copy that you convey,\r\nand you may offer support or warranty protection for a fee.\r\n\r\n  5. Conveying Modified Source Versions.\r\n\r\n  You may convey a work based on the Program, or the modifications to\r\nproduce it from the Program, in the form of source code under the\r\nterms of section 4, provided that you also meet all of these conditions:\r\n\r\n    a) The work must carry prominent notices stating that you modified\r\n    it, and giving a relevant date.\r\n\r\n    b) The work must carry prominent notices stating that it is\r\n    released under this License and any conditions added under section\r\n    7.  This requirement modifies the requirement in section 4 to\r\n    \"keep intact all notices\".\r\n\r\n    c) You must license the entire work, as a whole, under this\r\n    License to anyone who comes into possession of a copy.  This\r\n    License will therefore apply, along with any applicable section 7\r\n    additional terms, to the whole of the work, and all its parts,\r\n    regardless of how they are packaged.  This License gives no\r\n    permission to license the work in any other way, but it does not\r\n    invalidate such permission if you have separately received it.\r\n\r\n    d) If the work has interactive user interfaces, each must display\r\n    Appropriate Legal Notices; however, if the Program has interactive\r\n    interfaces that do not display Appropriate Legal Notices, your\r\n    work need not make them do so.\r\n\r\n  A compilation of a covered work with other separate and independent\r\nworks, which are not by their nature extensions of the covered work,\r\nand which are not combined with it such as to form a larger program,\r\nin or on a volume of a storage or distribution medium, is called an\r\n\"aggregate\" if the compilation and its resulting copyright are not\r\nused to limit the access or legal rights of the compilation's users\r\nbeyond what the individual works permit.  Inclusion of a covered work\r\nin an aggregate does not cause this License to apply to the other\r\nparts of the aggregate.\r\n\r\n  6. Conveying Non-Source Forms.\r\n\r\n  You may convey a covered work in object code form under the terms\r\nof sections 4 and 5, provided that you also convey the\r\nmachine-readable Corresponding Source under the terms of this License,\r\nin one of these ways:\r\n\r\n    a) Convey the object code in, or embodied in, a physical product\r\n    (including a physical distribution medium), accompanied by the\r\n    Corresponding Source fixed on a durable physical medium\r\n    customarily used for software interchange.\r\n\r\n    b) Convey the object code in, or embodied in, a physical product\r\n    (including a physical distribution medium), accompanied by a\r\n    written offer, valid for at least three years and valid for as\r\n    long as you offer spare parts or customer support for that product\r\n    model, to give anyone who possesses the object code either (1) a\r\n    copy of the Corresponding Source for all the software in the\r\n    product that is covered by this License, on a durable physical\r\n    medium customarily used for software interchange, for a price no\r\n    more than your reasonable cost of physically performing this\r\n    conveying of source, or (2) access to copy the\r\n    Corresponding Source from a network server at no charge.\r\n\r\n    c) Convey individual copies of the object code with a copy of the\r\n    written offer to provide the Corresponding Source.  This\r\n    alternative is allowed only occasionally and noncommercially, and\r\n    only if you received the object code with such an offer, in accord\r\n    with subsection 6b.\r\n\r\n    d) Convey the object code by offering access from a designated\r\n    place (gratis or for a charge), and offer equivalent access to the\r\n    Corresponding Source in the same way through the same place at no\r\n    further charge.  You need not require recipients to copy the\r\n    Corresponding Source along with the object code.  If the place to\r\n    copy the object code is a network server, the Corresponding Source\r\n    may be on a different server (operated by you or a third party)\r\n    that supports equivalent copying facilities, provided you maintain\r\n    clear directions next to the object code saying where to find the\r\n    Corresponding Source.  Regardless of what server hosts the\r\n    Corresponding Source, you remain obligated to ensure that it is\r\n    available for as long as needed to satisfy these requirements.\r\n\r\n    e) Convey the object code using peer-to-peer transmission, provided\r\n    you inform other peers where the object code and Corresponding\r\n    Source of the work are being offered to the general public at no\r\n    charge under subsection 6d.\r\n\r\n  A separable portion of the object code, whose source code is excluded\r\nfrom the Corresponding Source as a System Library, need not be\r\nincluded in conveying the object code work.\r\n\r\n  A \"User Product\" is either (1) a \"consumer product\", which means any\r\ntangible personal property which is normally used for personal, family,\r\nor household purposes, or (2) anything designed or sold for incorporation\r\ninto a dwelling.  In determining whether a product is a consumer product,\r\ndoubtful cases shall be resolved in favor of coverage.  For a particular\r\nproduct received by a particular user, \"normally used\" refers to a\r\ntypical or common use of that class of product, regardless of the status\r\nof the particular user or of the way in which the particular user\r\nactually uses, or expects or is expected to use, the product.  A product\r\nis a consumer product regardless of whether the product has substantial\r\ncommercial, industrial or non-consumer uses, unless such uses represent\r\nthe only significant mode of use of the product.\r\n\r\n  \"Installation Information\" for a User Product means any methods,\r\nprocedures, authorization keys, or other information required to install\r\nand execute modified versions of a covered work in that User Product from\r\na modified version of its Corresponding Source.  The information must\r\nsuffice to ensure that the continued functioning of the modified object\r\ncode is in no case prevented or interfered with solely because\r\nmodification has been made.\r\n\r\n  If you convey an object code work under this section in, or with, or\r\nspecifically for use in, a User Product, and the conveying occurs as\r\npart of a transaction in which the right of possession and use of the\r\nUser Product is transferred to the recipient in perpetuity or for a\r\nfixed term (regardless of how the transaction is characterized), the\r\nCorresponding Source conveyed under this section must be accompanied\r\nby the Installation Information.  But this requirement does not apply\r\nif neither you nor any third party retains the ability to install\r\nmodified object code on the User Product (for example, the work has\r\nbeen installed in ROM).\r\n\r\n  The requirement to provide Installation Information does not include a\r\nrequirement to continue to provide support service, warranty, or updates\r\nfor a work that has been modified or installed by the recipient, or for\r\nthe User Product in which it has been modified or installed.  Access to a\r\nnetwork may be denied when the modification itself materially and\r\nadversely affects the operation of the network or violates the rules and\r\nprotocols for communication across the network.\r\n\r\n  Corresponding Source conveyed, and Installation Information provided,\r\nin accord with this section must be in a format that is publicly\r\ndocumented (and with an implementation available to the public in\r\nsource code form), and must require no special password or key for\r\nunpacking, reading or copying.\r\n\r\n  7. Additional Terms.\r\n\r\n  \"Additional permissions\" are terms that supplement the terms of this\r\nLicense by making exceptions from one or more of its conditions.\r\nAdditional permissions that are applicable to the entire Program shall\r\nbe treated as though they were included in this License, to the extent\r\nthat they are valid under applicable law.  If additional permissions\r\napply only to part of the Program, that part may be used separately\r\nunder those permissions, but the entire Program remains governed by\r\nthis License without regard to the additional permissions.\r\n\r\n  When you convey a copy of a covered work, you may at your option\r\nremove any additional permissions from that copy, or from any part of\r\nit.  (Additional permissions may be written to require their own\r\nremoval in certain cases when you modify the work.)  You may place\r\nadditional permissions on material, added by you to a covered work,\r\nfor which you have or can give appropriate copyright permission.\r\n\r\n  Notwithstanding any other provision of this License, for material you\r\nadd to a covered work, you may (if authorized by the copyright holders of\r\nthat material) supplement the terms of this License with terms:\r\n\r\n    a) Disclaiming warranty or limiting liability differently from the\r\n    terms of sections 15 and 16 of this License; or\r\n\r\n    b) Requiring preservation of specified reasonable legal notices or\r\n    author attributions in that material or in the Appropriate Legal\r\n    Notices displayed by works containing it; or\r\n\r\n    c) Prohibiting misrepresentation of the origin of that material, or\r\n    requiring that modified versions of such material be marked in\r\n    reasonable ways as different from the original version; or\r\n\r\n    d) Limiting the use for publicity purposes of names of licensors or\r\n    authors of the material; or\r\n\r\n    e) Declining to grant rights under trademark law for use of some\r\n    trade names, trademarks, or service marks; or\r\n\r\n    f) Requiring indemnification of licensors and authors of that\r\n    material by anyone who conveys the material (or modified versions of\r\n    it) with contractual assumptions of liability to the recipient, for\r\n    any liability that these contractual assumptions directly impose on\r\n    those licensors and authors.\r\n\r\n  All other non-permissive additional terms are considered \"further\r\nrestrictions\" within the meaning of section 10.  If the Program as you\r\nreceived it, or any part of it, contains a notice stating that it is\r\ngoverned by this License along with a term that is a further\r\nrestriction, you may remove that term.  If a license document contains\r\na further restriction but permits relicensing or conveying under this\r\nLicense, you may add to a covered work material governed by the terms\r\nof that license document, provided that the further restriction does\r\nnot survive such relicensing or conveying.\r\n\r\n  If you add terms to a covered work in accord with this section, you\r\nmust place, in the relevant source files, a statement of the\r\nadditional terms that apply to those files, or a notice indicating\r\nwhere to find the applicable terms.\r\n\r\n  Additional terms, permissive or non-permissive, may be stated in the\r\nform of a separately written license, or stated as exceptions;\r\nthe above requirements apply either way.\r\n\r\n  8. Termination.\r\n\r\n  You may not propagate or modify a covered work except as expressly\r\nprovided under this License.  Any attempt otherwise to propagate or\r\nmodify it is void, and will automatically terminate your rights under\r\nthis License (including any patent licenses granted under the third\r\nparagraph of section 11).\r\n\r\n  However, if you cease all violation of this License, then your\r\nlicense from a particular copyright holder is reinstated (a)\r\nprovisionally, unless and until the copyright holder explicitly and\r\nfinally terminates your license, and (b) permanently, if the copyright\r\nholder fails to notify you of the violation by some reasonable means\r\nprior to 60 days after the cessation.\r\n\r\n  Moreover, your license from a particular copyright holder is\r\nreinstated permanently if the copyright holder notifies you of the\r\nviolation by some reasonable means, this is the first time you have\r\nreceived notice of violation of this License (for any work) from that\r\ncopyright holder, and you cure the violation prior to 30 days after\r\nyour receipt of the notice.\r\n\r\n  Termination of your rights under this section does not terminate the\r\nlicenses of parties who have received copies or rights from you under\r\nthis License.  If your rights have been terminated and not permanently\r\nreinstated, you do not qualify to receive new licenses for the same\r\nmaterial under section 10.\r\n\r\n  9. Acceptance Not Required for Having Copies.\r\n\r\n  You are not required to accept this License in order to receive or\r\nrun a copy of the Program.  Ancillary propagation of a covered work\r\noccurring solely as a consequence of using peer-to-peer transmission\r\nto receive a copy likewise does not require acceptance.  However,\r\nnothing other than this License grants you permission to propagate or\r\nmodify any covered work.  These actions infringe copyright if you do\r\nnot accept this License.  Therefore, by modifying or propagating a\r\ncovered work, you indicate your acceptance of this License to do so.\r\n\r\n  10. Automatic Licensing of Downstream Recipients.\r\n\r\n  Each time you convey a covered work, the recipient automatically\r\nreceives a license from the original licensors, to run, modify and\r\npropagate that work, subject to this License.  You are not responsible\r\nfor enforcing compliance by third parties with this License.\r\n\r\n  An \"entity transaction\" is a transaction transferring control of an\r\norganization, or substantially all assets of one, or subdividing an\r\norganization, or merging organizations.  If propagation of a covered\r\nwork results from an entity transaction, each party to that\r\ntransaction who receives a copy of the work also receives whatever\r\nlicenses to the work the party's predecessor in interest had or could\r\ngive under the previous paragraph, plus a right to possession of the\r\nCorresponding Source of the work from the predecessor in interest, if\r\nthe predecessor has it or can get it with reasonable efforts.\r\n\r\n  You may not impose any further restrictions on the exercise of the\r\nrights granted or affirmed under this License.  For example, you may\r\nnot impose a license fee, royalty, or other charge for exercise of\r\nrights granted under this License, and you may not initiate litigation\r\n(including a cross-claim or counterclaim in a lawsuit) alleging that\r\nany patent claim is infringed by making, using, selling, offering for\r\nsale, or importing the Program or any portion of it.\r\n\r\n  11. Patents.\r\n\r\n  A \"contributor\" is a copyright holder who authorizes use under this\r\nLicense of the Program or a work on which the Program is based.  The\r\nwork thus licensed is called the contributor's \"contributor version\".\r\n\r\n  A contributor's \"essential patent claims\" are all patent claims\r\nowned or controlled by the contributor, whether already acquired or\r\nhereafter acquired, that would be infringed by some manner, permitted\r\nby this License, of making, using, or selling its contributor version,\r\nbut do not include claims that would be infringed only as a\r\nconsequence of further modification of the contributor version.  For\r\npurposes of this definition, \"control\" includes the right to grant\r\npatent sublicenses in a manner consistent with the requirements of\r\nthis License.\r\n\r\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\r\npatent license under the contributor's essential patent claims, to\r\nmake, use, sell, offer for sale, import and otherwise run, modify and\r\npropagate the contents of its contributor version.\r\n\r\n  In the following three paragraphs, a \"patent license\" is any express\r\nagreement or commitment, however denominated, not to enforce a patent\r\n(such as an express permission to practice a patent or covenant not to\r\nsue for patent infringement).  To \"grant\" such a patent license to a\r\nparty means to make such an agreement or commitment not to enforce a\r\npatent against the party.\r\n\r\n  If you convey a covered work, knowingly relying on a patent license,\r\nand the Corresponding Source of the work is not available for anyone\r\nto copy, free of charge and under the terms of this License, through a\r\npublicly available network server or other readily accessible means,\r\nthen you must either (1) cause the Corresponding Source to be so\r\navailable, or (2) arrange to deprive yourself of the benefit of the\r\npatent license for this particular work, or (3) arrange, in a manner\r\nconsistent with the requirements of this License, to extend the patent\r\nlicense to downstream recipients.  \"Knowingly relying\" means you have\r\nactual knowledge that, but for the patent license, your conveying the\r\ncovered work in a country, or your recipient's use of the covered work\r\nin a country, would infringe one or more identifiable patents in that\r\ncountry that you have reason to believe are valid.\r\n\r\n  If, pursuant to or in connection with a single transaction or\r\narrangement, you convey, or propagate by procuring conveyance of, a\r\ncovered work, and grant a patent license to some of the parties\r\nreceiving the covered work authorizing them to use, propagate, modify\r\nor convey a specific copy of the covered work, then the patent license\r\nyou grant is automatically extended to all recipients of the covered\r\nwork and works based on it.\r\n\r\n  A patent license is \"discriminatory\" if it does not include within\r\nthe scope of its coverage, prohibits the exercise of, or is\r\nconditioned on the non-exercise of one or more of the rights that are\r\nspecifically granted under this License.  You may not convey a covered\r\nwork if you are a party to an arrangement with a third party that is\r\nin the business of distributing software, under which you make payment\r\nto the third party based on the extent of your activity of conveying\r\nthe work, and under which the third party grants, to any of the\r\nparties who would receive the covered work from you, a discriminatory\r\npatent license (a) in connection with copies of the covered work\r\nconveyed by you (or copies made from those copies), or (b) primarily\r\nfor and in connection with specific products or compilations that\r\ncontain the covered work, unless you entered into that arrangement,\r\nor that patent license was granted, prior to 28 March 2007.\r\n\r\n  Nothing in this License shall be construed as excluding or limiting\r\nany implied license or other defenses to infringement that may\r\notherwise be available to you under applicable patent law.\r\n\r\n  12. No Surrender of Others' Freedom.\r\n\r\n  If conditions are imposed on you (whether by court order, agreement or\r\notherwise) that contradict the conditions of this License, they do not\r\nexcuse you from the conditions of this License.  If you cannot convey a\r\ncovered work so as to satisfy simultaneously your obligations under this\r\nLicense and any other pertinent obligations, then as a consequence you may\r\nnot convey it at all.  For example, if you agree to terms that obligate you\r\nto collect a royalty for further conveying from those to whom you convey\r\nthe Program, the only way you could satisfy both those terms and this\r\nLicense would be to refrain entirely from conveying the Program.\r\n\r\n  13. Use with the GNU Affero General Public License.\r\n\r\n  Notwithstanding any other provision of this License, you have\r\npermission to link or combine any covered work with a work licensed\r\nunder version 3 of the GNU Affero General Public License into a single\r\ncombined work, and to convey the resulting work.  The terms of this\r\nLicense will continue to apply to the part which is the covered work,\r\nbut the special requirements of the GNU Affero General Public License,\r\nsection 13, concerning interaction through a network will apply to the\r\ncombination as such.\r\n\r\n  14. Revised Versions of this License.\r\n\r\n  The Free Software Foundation may publish revised and/or new versions of\r\nthe GNU General Public License from time to time.  Such new versions will\r\nbe similar in spirit to the present version, but may differ in detail to\r\naddress new problems or concerns.\r\n\r\n  Each version is given a distinguishing version number.  If the\r\nProgram specifies that a certain numbered version of the GNU General\r\nPublic License \"or any later version\" applies to it, you have the\r\noption of following the terms and conditions either of that numbered\r\nversion or of any later version published by the Free Software\r\nFoundation.  If the Program does not specify a version number of the\r\nGNU General Public License, you may choose any version ever published\r\nby the Free Software Foundation.\r\n\r\n  If the Program specifies that a proxy can decide which future\r\nversions of the GNU General Public License can be used, that proxy's\r\npublic statement of acceptance of a version permanently authorizes you\r\nto choose that version for the Program.\r\n\r\n  Later license versions may give you additional or different\r\npermissions.  However, no additional obligations are imposed on any\r\nauthor or copyright holder as a result of your choosing to follow a\r\nlater version.\r\n\r\n  15. Disclaimer of Warranty.\r\n\r\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\r\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\r\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\r\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\r\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\r\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\r\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r\n\r\n  16. Limitation of Liability.\r\n\r\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\r\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\r\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\r\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\r\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\r\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\r\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\r\nSUCH DAMAGES.\r\n\r\n  17. Interpretation of Sections 15 and 16.\r\n\r\n  If the disclaimer of warranty and limitation of liability provided\r\nabove cannot be given local legal effect according to their terms,\r\nreviewing courts shall apply local law that most closely approximates\r\nan absolute waiver of all civil liability in connection with the\r\nProgram, unless a warranty or assumption of liability accompanies a\r\ncopy of the Program in return for a fee.\r\n\r\n                     END OF TERMS AND CONDITIONS\r\n\r\n            How to Apply These Terms to Your New Programs\r\n\r\n  If you develop a new program, and you want it to be of the greatest\r\npossible use to the public, the best way to achieve this is to make it\r\nfree software which everyone can redistribute and change under these terms.\r\n\r\n  To do so, attach the following notices to the program.  It is safest\r\nto attach them to the start of each source file to most effectively\r\nstate the exclusion of warranty; and each file should have at least\r\nthe \"copyright\" line and a pointer to where the full notice is found.\r\n\r\n    <one line to give the program's name and a brief idea of what it does.>\r\n    Copyright (C) <year>  <name of author>\r\n\r\n    This program is free software: you can redistribute it and/or modify\r\n    it under the terms of the GNU General Public License as published by\r\n    the Free Software Foundation, either version 3 of the License, or\r\n    (at your option) any later version.\r\n\r\n    This program is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n    GNU General Public License for more details.\r\n\r\n    You should have received a copy of the GNU General Public License\r\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\r\n\r\nAlso add information on how to contact you by electronic and paper mail.\r\n\r\n  If the program does terminal interaction, make it output a short\r\nnotice like this when it starts in an interactive mode:\r\n\r\n    <program>  Copyright (C) <year>  <name of author>\r\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r\n    This is free software, and you are welcome to redistribute it\r\n    under certain conditions; type `show c' for details.\r\n\r\nThe hypothetical commands `show w' and `show c' should show the appropriate\r\nparts of the General Public License.  Of course, your program's commands\r\nmight be different; for a GUI interface, you would use an \"about box\".\r\n\r\n  You should also get your employer (if you work as a programmer) or school,\r\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\r\nFor more information on this, and how to apply and follow the GNU GPL, see\r\n<http://www.gnu.org/licenses/>.\r\n\r\n  The GNU General Public License does not permit incorporating your program\r\ninto proprietary programs.  If your program is a subroutine library, you\r\nmay consider it more useful to permit linking proprietary applications with\r\nthe library.  If this is what you want to do, use the GNU Lesser General\r\nPublic License instead of this License.  But first, please read\r\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\r\n"
  },
  {
    "path": "Makefile.am",
    "content": "SUBDIRS = src\nTARGET  = rufus\nTAGVER  = $(shell git log --oneline | wc -l)\nSEDCMD  = s/^\\([ \\t]*\\)Version=\"\\([0-9]*\\)\\.\\([0-9]*\\)\\.[0-9]*\\.\\([0-9]*\\)\"\\(.*\\)/\\1Version=\"\\2.\\3.@@TAGVER@@.\\4\"\\5/\n\nupx: all\n\t@upx --lzma --best src/$(TARGET)$(EXEEXT)\n\n# This step produces the UPX compressed and signed releases that are made available for public download\n# NB: UPX v3.09 or later is needed for LZMA compression (http://upx.sourceforge.net/)\nrelease: all\n\t@mv src/$(TARGET)$(EXEEXT) .\n\t@sleep 1\n\t@$(STRIP) $(TARGET)$(EXEEXT)\n\t@upx --lzma --best $(TARGET)$(EXEEXT)\n\t@mv $(TARGET)$(EXEEXT) $(TARGET)-$(VERSION)$(SUFFIX)$(EXEEXT)\n\t@cmd.exe //c _sign.cmd $(TARGET)-$(VERSION)$(SUFFIX)$(EXEEXT)\n"
  },
  {
    "path": "Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = .\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \\\n\t$(top_srcdir)/configure $(am__configure_deps)\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nam__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \\\n configure.lineno config.status.lineno\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \ndepcomp =\nam__depfiles_maybe =\nSOURCES =\nRECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \\\n\tctags-recursive dvi-recursive html-recursive info-recursive \\\n\tinstall-data-recursive install-dvi-recursive \\\n\tinstall-exec-recursive install-html-recursive \\\n\tinstall-info-recursive install-pdf-recursive \\\n\tinstall-ps-recursive install-recursive installcheck-recursive \\\n\tinstalldirs-recursive pdf-recursive ps-recursive \\\n\ttags-recursive uninstall-recursive\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nRECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive\t\\\n  distclean-recursive maintainer-clean-recursive\nam__recursive_targets = \\\n  $(RECURSIVE_TARGETS) \\\n  $(RECURSIVE_CLEAN_TARGETS) \\\n  $(am__extra_recursive_targets)\nAM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \\\n\tcscope\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nCSCOPE = cscope\nDIST_SUBDIRS = $(SUBDIRS)\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nSUBDIRS = src\nTARGET = rufus\nTAGVER = $(shell git log --oneline | wc -l)\nSEDCMD = s/^\\([ \\t]*\\)Version=\"\\([0-9]*\\)\\.\\([0-9]*\\)\\.[0-9]*\\.\\([0-9]*\\)\"\\(.*\\)/\\1Version=\"\\2.\\3.@@TAGVER@@.\\4\"\\5/\nall: all-recursive\n\n.SUFFIXES:\nam--refresh: Makefile\n\t@:\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps'; \\\n\t      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps \\\n\t\t&& exit 0; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    echo ' $(SHELL) ./config.status'; \\\n\t    $(SHELL) ./config.status;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\t$(SHELL) ./config.status --recheck\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\t$(am__cd) $(srcdir) && $(AUTOCONF)\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\t$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)\n$(am__aclocal_m4_deps):\n\n# This directory's subdirectories are mostly independent; you can cd\n# into them and run 'make' without going through this Makefile.\n# To change the values of 'make' variables: instead of editing Makefiles,\n# (1) if the variable is set in 'config.status', edit 'config.status'\n#     (which will cause the Makefiles to be regenerated when you run 'make');\n# (2) otherwise, pass the desired values on the 'make' command line.\n$(am__recursive_targets):\n\t@fail=; \\\n\tif $(am__make_keepgoing); then \\\n\t  failcom='fail=yes'; \\\n\telse \\\n\t  failcom='exit 1'; \\\n\tfi; \\\n\tdot_seen=no; \\\n\ttarget=`echo $@ | sed s/-recursive//`; \\\n\tcase \"$@\" in \\\n\t  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \\\n\t  *) list='$(SUBDIRS)' ;; \\\n\tesac; \\\n\tfor subdir in $$list; do \\\n\t  echo \"Making $$target in $$subdir\"; \\\n\t  if test \"$$subdir\" = \".\"; then \\\n\t    dot_seen=yes; \\\n\t    local_target=\"$$target-am\"; \\\n\t  else \\\n\t    local_target=\"$$target\"; \\\n\t  fi; \\\n\t  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \\\n\t  || eval $$failcom; \\\n\tdone; \\\n\tif test \"$$dot_seen\" = \"no\"; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) \"$$target-am\" || exit 1; \\\n\tfi; test -z \"$$fail\"\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-recursive\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\tif ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \\\n\t  include_option=--etags-include; \\\n\t  empty_fix=.; \\\n\telse \\\n\t  include_option=--include; \\\n\t  empty_fix=; \\\n\tfi; \\\n\tlist='$(SUBDIRS)'; for subdir in $$list; do \\\n\t  if test \"$$subdir\" = .; then :; else \\\n\t    test ! -f $$subdir/TAGS || \\\n\t      set \"$$@\" \"$$include_option=$$here/$$subdir/TAGS\"; \\\n\t  fi; \\\n\tdone; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-recursive\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscope: cscope.files\n\ttest ! -s cscope.files \\\n\t  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)\nclean-cscope:\n\t-rm -f cscope.files\ncscope.files: clean-cscope cscopelist\ncscopelist: cscopelist-recursive\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\n\t-rm -f cscope.out cscope.in.out cscope.po.out cscope.files\ncheck-am: all-am\ncheck: check-recursive\nall-am: Makefile\ninstalldirs: installdirs-recursive\ninstalldirs-am:\ninstall: install-recursive\ninstall-exec: install-exec-recursive\ninstall-data: install-data-recursive\nuninstall: uninstall-recursive\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-recursive\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-recursive\n\nclean-am: clean-generic mostlyclean-am\n\ndistclean: distclean-recursive\n\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-generic distclean-tags\n\ndvi: dvi-recursive\n\ndvi-am:\n\nhtml: html-recursive\n\nhtml-am:\n\ninfo: info-recursive\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-recursive\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-recursive\n\ninstall-html-am:\n\ninstall-info: install-info-recursive\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-recursive\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-recursive\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-recursive\n\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n\t-rm -rf $(top_srcdir)/autom4te.cache\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-recursive\n\nmostlyclean-am: mostlyclean-generic\n\npdf: pdf-recursive\n\npdf-am:\n\nps: ps-recursive\n\nps-am:\n\nuninstall-am:\n\n.MAKE: $(am__recursive_targets) install-am install-strip\n\n.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \\\n\tam--refresh check check-am clean clean-cscope clean-generic \\\n\tcscope cscopelist-am ctags ctags-am distclean \\\n\tdistclean-generic distclean-tags dvi dvi-am html html-am info \\\n\tinfo-am install install-am install-data install-data-am \\\n\tinstall-dvi install-dvi-am install-exec install-exec-am \\\n\tinstall-html install-html-am install-info install-info-am \\\n\tinstall-man install-pdf install-pdf-am install-ps \\\n\tinstall-ps-am install-strip installcheck installcheck-am \\\n\tinstalldirs installdirs-am maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-generic pdf \\\n\tpdf-am ps ps-am tags tags-am uninstall uninstall-am\n\n\nupx: all\n\t@upx --lzma --best src/$(TARGET)$(EXEEXT)\n\n# This step produces the UPX compressed and signed releases that are made available for public download\n# NB: UPX v3.09 or later is needed for LZMA compression (http://upx.sourceforge.net/)\nrelease: all\n\t@mv src/$(TARGET)$(EXEEXT) .\n\t@sleep 1\n\t@$(STRIP) $(TARGET)$(EXEEXT)\n\t@upx --lzma --best $(TARGET)$(EXEEXT)\n\t@mv $(TARGET)$(EXEEXT) $(TARGET)-$(VERSION)$(SUFFIX)$(EXEEXT)\n\t@cmd.exe //c _sign.cmd $(TARGET)-$(VERSION)$(SUFFIX)$(EXEEXT)\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "README.md",
    "content": "Rufus: The Reliable USB Formatting Utility\n==========================================\n\n[![VS2022 Build Status](https://img.shields.io/github/actions/workflow/status/pbatard/rufus/vs2022.yml?branch=master&style=flat-square&label=VS2022%20Build)](https://github.com/pbatard/rufus/actions/workflows/vs2022.yml)\n[![MinGW Build Status](https://img.shields.io/github/actions/workflow/status/pbatard/rufus/mingw.yml?branch=master&style=flat-square&label=MinGW%20Build)](https://github.com/pbatard/rufus/actions/workflows/mingw.yml)\n[![Coverity Scan Status](https://img.shields.io/coverity/scan/2172.svg?style=flat-square&label=Coverity%20Analysis)](https://scan.coverity.com/projects/pbatard-rufus)  \n[![Latest Release](https://img.shields.io/github/release-pre/pbatard/rufus.svg?style=flat-square&label=Latest%20Release)](https://github.com/pbatard/rufus/releases)\n[![Licence](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat-square&label=License)](https://www.gnu.org/licenses/gpl-3.0.en.html)\n[![Download Stats](https://img.shields.io/github/downloads/pbatard/rufus/total.svg?label=Downloads&style=flat-square)](https://github.com/pbatard/rufus/releases)\n[![Contributors](https://img.shields.io/github/contributors/pbatard/rufus.svg?style=flat-square&label=Contributors)](https://github.com/pbatard/rufus/graphs/contributors)\n\n![Rufus logo](https://raw.githubusercontent.com/pbatard/rufus/master/res/icons/rufus-128.png)\n\nRufus is a utility that helps format and create bootable USB flash drives.\n\nFeatures\n--------\n\n* Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\n* Create DOS bootable USB drives using [FreeDOS](https://www.freedos.org) or MS-DOS\n* Create BIOS or UEFI bootable drives, including [UEFI bootable NTFS](https://github.com/pbatard/uefi-ntfs)\n* Create bootable drives from bootable ISOs (Windows, Linux, etc.)\n* Create bootable drives from bootable disk images, including compressed ones\n* Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\n* Create [Windows To Go](https://en.wikipedia.org/wiki/Windows_To_Go) drives\n* Create VHD/DD, VHDX and FFU images of an existing drive\n* Create persistent Linux partitions\n* Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\n* Perform runtime validation of UEFI bootable media\n* Improve Windows installation experience by automatically setting up OOBE parameters (local account, privacy options, etc.)\n* Perform bad blocks checks, including detection of \"fake\" flash drives\n* Download official Microsoft Windows 8, Windows 10 or Windows 11 retail ISOs\n* Download [UEFI Shell](https://github.com/pbatard/UEFI-Shell) ISOs\n* Modern and familiar UI, with [38 languages natively supported](https://github.com/pbatard/rufus/wiki/FAQ#What_languages_are_natively_supported_by_Rufus)\n* Small footprint. No installation required.\n* Portable. Secure Boot compatible.\n* 100% [Free Software](https://www.gnu.org/philosophy/free-sw) ([GPL v3](https://www.gnu.org/licenses/gpl-3.0))\n\nCompilation\n-----------\n\nUse either Visual Studio 2022 or MinGW and then invoke the `.sln` or `configure`/`make` respectively.\n\n#### Visual Studio\n\nRufus is an OSI compliant Open Source project. You are entitled to\ndownload and use the *freely available* [Visual Studio Community Edition](https://www.visualstudio.com/vs/community/)\nto build, run or develop for Rufus. As per the Visual Studio Community Edition license,\nthis applies regardless of whether you are an individual or a corporate user.\n\nAdditional information\n----------------------\n\nRufus provides extensive information about what it is doing, either through its\neasily accessible log, or through the [Windows debug facility](https://docs.microsoft.com/en-us/sysinternals/downloads/debugview).\n\n* [__Official Website__](https://rufus.ie)\n* [FAQ](https://github.com/pbatard/rufus/wiki/FAQ)\n* [Security and safety measures](https://github.com/pbatard/rufus/wiki/Security)\n\nEnhancements/Bugs\n-----------------\n\nPlease use the [GitHub issue tracker](https://github.com/pbatard/rufus/issues)\nfor reporting problems or suggesting new features.\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Reporting a security vulnerability\n\nTo report a **security** vulnerability for Rufus (i.e. an issue that you believe could lead to malicious actors being able to exploit the Rufus application), please e-mail support@akeo.ie.\n\nPlease do **NOT** use the e-mail above if you have a regular issue, such as a problem creating or using a bootable drive. Instead go back to https://github.com/pbatard/rufus/issues and create an issue using the regular *Issue Report* template.\n\nFor any security vulnerability report, we kindly ask you to respect [responsible disclosure](https://en.wikipedia.org/wiki/Responsible_disclosure) practices.\n\nIn return, we will endeavour to respond to security vulnerability reports within 48 hours.\n"
  },
  {
    "path": "_chver.sh",
    "content": "#!/bin/sh\n# Changes the version number\n# !!!THIS SCRIPT IS FOR INTERNAL DEVELOPER USE ONLY!!!\n\ntype -P sed &>/dev/null || { echo \"sed command not found. Aborting.\" >&2; exit 1; }\n\nif [ ! -n \"$1\" ]; then\n  echo \"you must provide a version number (eg. 2.1)\"\n  exit 1\nelse\n  MAJOR=`echo $1 | sed \"s/\\(.*\\)[.].*/\\1/\"`\n  MINOR=`echo $1 | sed \"s/.*[.]\\(.*\\)/\\1/\"`\nfi\ncase $MAJOR in *[!0-9]*) \n  echo \"$MAJOR is not a number\"\n  exit 1\nesac\ncase $MINOR in *[!0-9]*) \n  echo \"$MINOR is not a number\"\n  exit 1\nesac\necho \"changing version to $MAJOR.$MINOR\"\nsed -i -e \"s/^AC_INIT(\\[\\([^ ]*\\)\\], \\[[^ ]*\\]\\(.*\\)/AC_INIT([\\1], [$MAJOR.$MINOR]\\2/\" configure.ac\ncat > cmd.sed <<\\_EOF\ns/^\\([ \\t]*\\)\\(FILE\\|PRODUCT\\)VERSION\\([ \\t]*\\)[0-9]*,[0-9]*\\(.*\\)/\\1\\2VERSION\\3@@MAJOR@@,@@MINOR@@\\4/\ns/^\\([ \\t]*\\)VALUE\\([ \\t]*\\)\"\\(File\\|Product\\)Version\",\\([ \\t]*\\)\"[0-9]*\\.[0-9]*\\.\\(.*\\)/\\1VALUE\\2\"\\3Version\",\\4\"@@MAJOR@@.@@MINOR@@.\\5/\ns/^\\([ \\t]*\\)VALUE\\([ \\t]*\\)\"OriginalFilename\",\\([ \\t]*\\)\"rufus-[0-9]*\\.[0-9]*\\.exe\\(.*\\)/\\1VALUE\\2\"OriginalFilename\",\\3\"rufus-@@MAJOR@@.@@MINOR@@.exe\\4/\ns/^\\(.*\\)\"Rufus [0-9]*\\.[0-9]*\\.\\(.*\\)\"\\(.*\\)/\\1\"Rufus @@MAJOR@@.@@MINOR@@.\\2\"\\3/\ns/^\\([ \\t]*\\)Version=\"[0-9]*\\.[0-9]*\\.\\(.*\\)\"\\(.*\\)/\\1Version=\"@@MAJOR@@.@@MINOR@@.\\2\"\\3/\ns/^set VERSION=[0-9]*\\.[0-9]*/set VERSION=@@MAJOR@@.@@MINOR@@/\n_EOF\n\n# First run sed to substitute our variable in the sed command file\nsed -i -e \"s/@@MAJOR@@/$MAJOR/g\" -e \"s/@@MINOR@@/$MINOR/g\" cmd.sed\nsed -b -i -f cmd.sed src/rufus.rc\nrm cmd.sed\nsource ./bootstrap.sh\n"
  },
  {
    "path": "_coverity.cmd",
    "content": "@rem *** Internal developer script to run Coverity ***\r\n@echo off\r\ncall \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\VsDevCmd.bat\"\r\nset COV_DIR=B:\\cov-analysis-win64-2019.03\r\nset PATH=%PATH%;%COV_DIR%\\bin\r\nset PWD=%~dp0\r\nset TARGET=x86\r\nrmdir cov-int /s /q >NUL 2>NUL\r\nrmdir %TARGET% /s /q >NUL 2>NUL\r\ndel cov-int.zip >NUL 2>NUL\r\nmkdir cov-int\r\ncov-build --dir cov-int msbuild rufus.sln /p:Configuration=Release,Platform=%TARGET% /maxcpucount\r\nrem *** for when/if Coverity manage to clean their act\r\nrem cov-build --dir cov-int C:\\msys64\\usr\\bin\\bash -cl \"export PATH=/mingw32/bin:$PATH; cd /c/rufus; ./configure --build=i686-w64-mingw32 --host=i686-w64-mingw32 --disable-debug; make -j4\"\r\nrem *** zip script by Peter Mortensen - http://superuser.com/a/111266/286681\r\necho Set objArgs = WScript.Arguments> zip.vbs\r\necho InputFolder = objArgs(0)>> zip.vbs\r\necho ZipFile = objArgs(1)>> zip.vbs\r\necho CreateObject(\"Scripting.FileSystemObject\").CreateTextFile(ZipFile, True).Write \"PK\" ^& Chr(5) ^& Chr(6) ^& String(18, vbNullChar)>> zip.vbs\r\necho Set objShell = CreateObject(\"Shell.Application\")>> zip.vbs\r\necho Set source = objShell.NameSpace(InputFolder)>> zip.vbs\r\necho objShell.NameSpace(ZipFile).CopyHere(source)>> zip.vbs\r\necho wScript.Sleep 8000>> zip.vbs\r\nCScript zip.vbs %PWD%cov-int %PWD%cov-int.zip\r\ndel zip.vbs\r\npause\r\n"
  },
  {
    "path": "_detect-amend.sh",
    "content": "#!/bin/sh\n#\n# This script detects whether git commit is being executed in amend or regular mode\n# Needed to determine whether the build number should be incremented or not.\n#\n\n# Need to figure out if we are running on Windows or *NIX\nif [ \"$(uname -o)\" = \"Msys\" ]; then\n  type -P PowerShell &>/dev/null || { echo \"PowerShell command not found. Aborting.\" >&2; exit 1; }\n  type -P grep &>/dev/null || { echo \"grep command not found. Aborting.\" >&2; exit 1; }\n  GITCMD=`PowerShell -command \"Get-WmiObject win32_process -Filter \\\"name like '%git.exe'\\\" | select CommandLine\"`\n  if $(echo $GITCMD | grep -q -- --amend); then\n    echo AMEND detected\n    touch ./.amend\n  fi\nelse\n  if $(ps -fp $PPID | grep -q -- --amend); then\n    echo AMEND detected\n    touch ./.amend\n  fi\nfi\n"
  },
  {
    "path": "_pre-commit.sh",
    "content": "#!/bin/sh\n#\n# Bumps the micro version according to the number of commits on this branch\n#\n# To have git run this script on commit, create a \"pre-commit\" text file in\n# .git/hooks/ with the following content:\n# #!/bin/sh\n# if [ -x ./_pre-commit.sh ]; then\n# \t. ./_pre-commit.sh\n# fi\n\ntype -P sed &>/dev/null || { echo \"sed command not found. Aborting.\" >&2; exit 1; }\ntype -P git &>/dev/null || { echo \"git command not found. Aborting.\" >&2; exit 1; }\n\nif [ -x ./_detect-amend.sh ]; then\n\t. ./_detect-amend.sh\nfi\n\nBUILD=`git rev-list HEAD --count`\n# adjust so that we match the github commit count\n((BUILD++))\n# there may be a better way to prevent improper micro on amend. For now the detection\n# of a .amend file in the current directory will do\nif [ -f ./.amend ]; then\n\t((BUILD--))\n\trm ./.amend;\nfi\necho \"setting micro to $BUILD\"\n\ncat > cmd.sed <<\\_EOF\ns/^\\([ \\t]*\\)*\\(FILE\\|PRODUCT\\)VERSION\\([ \\t]*\\)\\([0-9]*\\),\\([0-9]*\\),[0-9]*,\\(.*\\)/\\1\\2VERSION\\3\\4,\\5,@@BUILD@@,\\6/\ns/^\\([ \\t]*\\)VALUE\\([ \\t]*\\)\"\\(File\\|Product\\)Version\",\\([ \\t]*\\)\"\\(.*\\)\\..*\"[ \\t]*/\\1VALUE\\2\"\\3Version\",\\4\"\\5.@@BUILD@@\"/\ns/^\\(.*\\)\"Rufus \\(.*\\)\\..*\"\\(.*\\)/\\1\"Rufus \\2.@@BUILD@@\"\\3/\ns/^\\([ \\t]*\\)Version=\"\\([0-9]*\\)\\.\\([0-9]*\\)\\.[0-9]*\\.\\([0-9]*\\)\"\\(.*\\)/\\1Version=\"\\2.\\3.@@BUILD@@.\\4\"\\5/\ns/\\xef\\xbf\\xbd/\\xa9/\n_EOF\n\n# First run sed to substitute our variable in the sed command file\nsed -i -e \"s/@@BUILD@@/$BUILD/g\" cmd.sed\n# Run sed to update the nano version\nsed -b -i -f cmd.sed src/rufus.rc\n# NB: we need to run git add else the modified files may be ignored\ngit add src/rufus.rc\n\nrm cmd.sed\n"
  },
  {
    "path": "_release.sh",
    "content": "#!/bin/sh\n./configure --disable-debug \"$@\"\nmake -j12 clean\nmake -j12 release\n"
  },
  {
    "path": "_set_git_hooks.sh",
    "content": "#!/bin/sh\n# Sets the git hooks on a new git development system\nif [ -e \".git/hooks/pre-commit\" ]; then\n    echo 'pre-commit git hook is already set, aborting.'\n    exit\nfi\n\necho 'Creating pre-commit git hook...'\necho '#!/bin/sh' > .git/hooks/pre-commit\necho 'if [ -x ./_pre-commit.sh ]; then' >> .git/hooks/pre-commit\necho '\t. ./_pre-commit.sh' >> .git/hooks/pre-commit\necho 'fi' >> .git/hooks/pre-commit\n"
  },
  {
    "path": "_sign.cmd",
    "content": "@echo off\r\n\"C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22000.0\\x64\\signtool\" sign /v /sha1 fc4686753937a93fdcd48c2bb4375e239af92dcb /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 %*\r\n"
  },
  {
    "path": "aclocal.m4",
    "content": "# generated automatically by aclocal 1.14.1 -*- Autoconf -*-\n\n# Copyright (C) 1996-2013 Free Software Foundation, Inc.\n\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\nm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])\nm4_ifndef([AC_AUTOCONF_VERSION],\n  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl\nm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,\n[m4_warning([this file was generated for autoconf 2.71.\nYou have another version of autoconf.  It may work, but is not guaranteed to.\nIf you have problems, you may need to regenerate the build system entirely.\nTo do so, use the procedure documented by the package, typically 'autoreconf'.])])\n\n# Copyright (C) 2002-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_AUTOMAKE_VERSION(VERSION)\n# ----------------------------\n# Automake X.Y traces this macro to ensure aclocal.m4 has been\n# generated from the m4 files accompanying Automake X.Y.\n# (This private macro should not be called outside this file.)\nAC_DEFUN([AM_AUTOMAKE_VERSION],\n[am__api_version='1.14'\ndnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to\ndnl require some minimum version.  Point them to the right macro.\nm4_if([$1], [1.14.1], [],\n      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl\n])\n\n# _AM_AUTOCONF_VERSION(VERSION)\n# -----------------------------\n# aclocal traces this macro to find the Autoconf version.\n# This is a private macro too.  Using m4_define simplifies\n# the logic in aclocal, which can simply ignore this definition.\nm4_define([_AM_AUTOCONF_VERSION], [])\n\n# AM_SET_CURRENT_AUTOMAKE_VERSION\n# -------------------------------\n# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.\n# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.\nAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],\n[AM_AUTOMAKE_VERSION([1.14.1])dnl\nm4_ifndef([AC_AUTOCONF_VERSION],\n  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl\n_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])\n\n# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-\n\n# Copyright (C) 2001-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets\n# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to\n# '$srcdir', '$srcdir/..', or '$srcdir/../..'.\n#\n# Of course, Automake must honor this variable whenever it calls a\n# tool from the auxiliary directory.  The problem is that $srcdir (and\n# therefore $ac_aux_dir as well) can be either absolute or relative,\n# depending on how configure is run.  This is pretty annoying, since\n# it makes $ac_aux_dir quite unusable in subdirectories: in the top\n# source directory, any form will work fine, but in subdirectories a\n# relative path needs to be adjusted first.\n#\n# $ac_aux_dir/missing\n#    fails when called from a subdirectory if $ac_aux_dir is relative\n# $top_srcdir/$ac_aux_dir/missing\n#    fails if $ac_aux_dir is absolute,\n#    fails when called from a subdirectory in a VPATH build with\n#          a relative $ac_aux_dir\n#\n# The reason of the latter failure is that $top_srcdir and $ac_aux_dir\n# are both prefixed by $srcdir.  In an in-source build this is usually\n# harmless because $srcdir is '.', but things will broke when you\n# start a VPATH build or use an absolute $srcdir.\n#\n# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,\n# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:\n#   am_aux_dir='\\$(top_srcdir)/'`expr \"$ac_aux_dir\" : \"$srcdir//*\\(.*\\)\"`\n# and then we would define $MISSING as\n#   MISSING=\"\\${SHELL} $am_aux_dir/missing\"\n# This will work as long as MISSING is not called from configure, because\n# unfortunately $(top_srcdir) has no meaning in configure.\n# However there are other variables, like CC, which are often used in\n# configure, and could therefore not use this \"fixed\" $ac_aux_dir.\n#\n# Another solution, used here, is to always expand $ac_aux_dir to an\n# absolute PATH.  The drawback is that using absolute paths prevent a\n# configured tree to be moved without reconfiguration.\n\nAC_DEFUN([AM_AUX_DIR_EXPAND],\n[dnl Rely on autoconf to set up CDPATH properly.\nAC_PREREQ([2.50])dnl\n# expand $ac_aux_dir to an absolute path\nam_aux_dir=`cd $ac_aux_dir && pwd`\n])\n\n# AM_CONDITIONAL                                            -*- Autoconf -*-\n\n# Copyright (C) 1997-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_CONDITIONAL(NAME, SHELL-CONDITION)\n# -------------------------------------\n# Define a conditional.\nAC_DEFUN([AM_CONDITIONAL],\n[AC_PREREQ([2.52])dnl\n m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],\n       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl\nAC_SUBST([$1_TRUE])dnl\nAC_SUBST([$1_FALSE])dnl\n_AM_SUBST_NOTMAKE([$1_TRUE])dnl\n_AM_SUBST_NOTMAKE([$1_FALSE])dnl\nm4_define([_AM_COND_VALUE_$1], [$2])dnl\nif $2; then\n  $1_TRUE=\n  $1_FALSE='#'\nelse\n  $1_TRUE='#'\n  $1_FALSE=\nfi\nAC_CONFIG_COMMANDS_PRE(\n[if test -z \"${$1_TRUE}\" && test -z \"${$1_FALSE}\"; then\n  AC_MSG_ERROR([[conditional \"$1\" was never defined.\nUsually this means the macro was only invoked conditionally.]])\nfi])])\n\n# Do all the work for Automake.                             -*- Autoconf -*-\n\n# Copyright (C) 1996-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This macro actually does too much.  Some checks are only needed if\n# your package does certain things.  But this isn't really a big deal.\n\ndnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.\nm4_define([AC_PROG_CC],\nm4_defn([AC_PROG_CC])\n[_AM_PROG_CC_C_O\n])\n\n# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])\n# AM_INIT_AUTOMAKE([OPTIONS])\n# -----------------------------------------------\n# The call with PACKAGE and VERSION arguments is the old style\n# call (pre autoconf-2.50), which is being phased out.  PACKAGE\n# and VERSION should now be passed to AC_INIT and removed from\n# the call to AM_INIT_AUTOMAKE.\n# We support both call styles for the transition.  After\n# the next Automake release, Autoconf can make the AC_INIT\n# arguments mandatory, and then we can depend on a new Autoconf\n# release and drop the old call support.\nAC_DEFUN([AM_INIT_AUTOMAKE],\n[AC_PREREQ([2.65])dnl\ndnl Autoconf wants to disallow AM_ names.  We explicitly allow\ndnl the ones we care about.\nm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl\nAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl\nAC_REQUIRE([AC_PROG_INSTALL])dnl\nif test \"`cd $srcdir && pwd`\" != \"`pwd`\"; then\n  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output\n  # is not polluted with repeated \"-I.\"\n  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl\n  # test to see if srcdir already configured\n  if test -f $srcdir/config.status; then\n    AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])\n  fi\nfi\n\n# test whether we have cygpath\nif test -z \"$CYGPATH_W\"; then\n  if (cygpath --version) >/dev/null 2>/dev/null; then\n    CYGPATH_W='cygpath -w'\n  else\n    CYGPATH_W=echo\n  fi\nfi\nAC_SUBST([CYGPATH_W])\n\n# Define the identity of the package.\ndnl Distinguish between old-style and new-style calls.\nm4_ifval([$2],\n[AC_DIAGNOSE([obsolete],\n             [$0: two- and three-arguments forms are deprecated.])\nm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl\n AC_SUBST([PACKAGE], [$1])dnl\n AC_SUBST([VERSION], [$2])],\n[_AM_SET_OPTIONS([$1])dnl\ndnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.\nm4_if(\n  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),\n  [ok:ok],,\n  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl\n AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl\n AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl\n\n_AM_IF_OPTION([no-define],,\n[AC_DEFINE_UNQUOTED([PACKAGE], [\"$PACKAGE\"], [Name of package])\n AC_DEFINE_UNQUOTED([VERSION], [\"$VERSION\"], [Version number of package])])dnl\n\n# Some tools Automake needs.\nAC_REQUIRE([AM_SANITY_CHECK])dnl\nAC_REQUIRE([AC_ARG_PROGRAM])dnl\nAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])\nAM_MISSING_PROG([AUTOCONF], [autoconf])\nAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])\nAM_MISSING_PROG([AUTOHEADER], [autoheader])\nAM_MISSING_PROG([MAKEINFO], [makeinfo])\nAC_REQUIRE([AM_PROG_INSTALL_SH])dnl\nAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl\nAC_REQUIRE([AC_PROG_MKDIR_P])dnl\n# For better backward compatibility.  To be removed once Automake 1.9.x\n# dies out for good.  For more background, see:\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>\nAC_SUBST([mkdir_p], ['$(MKDIR_P)'])\n# We need awk for the \"check\" target.  The system \"awk\" is bad on\n# some platforms.\nAC_REQUIRE([AC_PROG_AWK])dnl\nAC_REQUIRE([AC_PROG_MAKE_SET])dnl\nAC_REQUIRE([AM_SET_LEADING_DOT])dnl\n_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],\n\t      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],\n\t\t\t     [_AM_PROG_TAR([v7])])])\n_AM_IF_OPTION([no-dependencies],,\n[AC_PROVIDE_IFELSE([AC_PROG_CC],\n\t\t  [_AM_DEPENDENCIES([CC])],\n\t\t  [m4_define([AC_PROG_CC],\n\t\t\t     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl\nAC_PROVIDE_IFELSE([AC_PROG_CXX],\n\t\t  [_AM_DEPENDENCIES([CXX])],\n\t\t  [m4_define([AC_PROG_CXX],\n\t\t\t     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl\nAC_PROVIDE_IFELSE([AC_PROG_OBJC],\n\t\t  [_AM_DEPENDENCIES([OBJC])],\n\t\t  [m4_define([AC_PROG_OBJC],\n\t\t\t     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl\nAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],\n\t\t  [_AM_DEPENDENCIES([OBJCXX])],\n\t\t  [m4_define([AC_PROG_OBJCXX],\n\t\t\t     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl\n])\nAC_REQUIRE([AM_SILENT_RULES])dnl\ndnl The testsuite driver may need to know about EXEEXT, so add the\ndnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This\ndnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.\nAC_CONFIG_COMMANDS_PRE(dnl\n[m4_provide_if([_AM_COMPILER_EXEEXT],\n  [AM_CONDITIONAL([am__EXEEXT], [test -n \"$EXEEXT\"])])])dnl\n\n# POSIX will say in a future version that running \"rm -f\" with no argument\n# is OK; and we want to be able to make that assumption in our Makefile\n# recipes.  So use an aggressive probe to check that the usage we want is\n# actually supported \"in the wild\" to an acceptable degree.\n# See automake bug#10828.\n# To make any issue more visible, cause the running configure to be aborted\n# by default if the 'rm' program in use doesn't match our expectations; the\n# user can still override this though.\nif rm -f && rm -fr && rm -rf; then : OK; else\n  cat >&2 <<'END'\nOops!\n\nYour 'rm' program seems unable to run without file operands specified\non the command line, even when the '-f' option is present.  This is contrary\nto the behaviour of most rm programs out there, and not conforming with\nthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>\n\nPlease tell bug-automake@gnu.org about your system, including the value\nof your $PATH and any error possibly output before this message.  This\ncan help us improve future automake versions.\n\nEND\n  if test x\"$ACCEPT_INFERIOR_RM_PROGRAM\" = x\"yes\"; then\n    echo 'Configuration will proceed anyway, since you have set the' >&2\n    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to \"yes\"' >&2\n    echo >&2\n  else\n    cat >&2 <<'END'\nAborting the configuration process, to ensure you take notice of the issue.\n\nYou can download and install GNU coreutils to get an 'rm' implementation\nthat behaves properly: <http://www.gnu.org/software/coreutils/>.\n\nIf you want to complete the configuration process using your problematic\n'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM\nto \"yes\", and re-run configure.\n\nEND\n    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])\n  fi\nfi])\n\ndnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not\ndnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further\ndnl mangled by Autoconf and run in a shell conditional statement.\nm4_define([_AC_COMPILER_EXEEXT],\nm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])\n\n# When config.status generates a header, we must update the stamp-h file.\n# This file resides in the same directory as the config header\n# that is generated.  The stamp files are numbered to have different names.\n\n# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the\n# loop where config.status creates the headers, so we can generate\n# our stamp files there.\nAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],\n[# Compute $1's index in $config_headers.\n_am_arg=$1\n_am_stamp_count=1\nfor _am_header in $config_headers :; do\n  case $_am_header in\n    $_am_arg | $_am_arg:* )\n      break ;;\n    * )\n      _am_stamp_count=`expr $_am_stamp_count + 1` ;;\n  esac\ndone\necho \"timestamp for $_am_arg\" >`AS_DIRNAME([\"$_am_arg\"])`/stamp-h[]$_am_stamp_count])\n\n# Copyright (C) 2001-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_PROG_INSTALL_SH\n# ------------------\n# Define $install_sh.\nAC_DEFUN([AM_PROG_INSTALL_SH],\n[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\nif test x\"${install_sh}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    install_sh=\"\\${SHELL} '$am_aux_dir/install-sh'\" ;;\n  *)\n    install_sh=\"\\${SHELL} $am_aux_dir/install-sh\"\n  esac\nfi\nAC_SUBST([install_sh])])\n\n# Copyright (C) 2003-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# Check whether the underlying file-system supports filenames\n# with a leading dot.  For instance MS-DOS doesn't.\nAC_DEFUN([AM_SET_LEADING_DOT],\n[rm -rf .tst 2>/dev/null\nmkdir .tst 2>/dev/null\nif test -d .tst; then\n  am__leading_dot=.\nelse\n  am__leading_dot=_\nfi\nrmdir .tst 2>/dev/null\nAC_SUBST([am__leading_dot])])\n\n# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-\n\n# Copyright (C) 1997-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_MISSING_PROG(NAME, PROGRAM)\n# ------------------------------\nAC_DEFUN([AM_MISSING_PROG],\n[AC_REQUIRE([AM_MISSING_HAS_RUN])\n$1=${$1-\"${am_missing_run}$2\"}\nAC_SUBST($1)])\n\n# AM_MISSING_HAS_RUN\n# ------------------\n# Define MISSING if not defined so far and test if it is modern enough.\n# If it is, set am_missing_run to use it, otherwise, to nothing.\nAC_DEFUN([AM_MISSING_HAS_RUN],\n[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\nAC_REQUIRE_AUX_FILE([missing])dnl\nif test x\"${MISSING+set}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    MISSING=\"\\${SHELL} \\\"$am_aux_dir/missing\\\"\" ;;\n  *)\n    MISSING=\"\\${SHELL} $am_aux_dir/missing\" ;;\n  esac\nfi\n# Use eval to expand $SHELL\nif eval \"$MISSING --is-lightweight\"; then\n  am_missing_run=\"$MISSING \"\nelse\n  am_missing_run=\n  AC_MSG_WARN(['missing' script is too old or missing])\nfi\n])\n\n# Helper functions for option handling.                     -*- Autoconf -*-\n\n# Copyright (C) 2001-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_MANGLE_OPTION(NAME)\n# -----------------------\nAC_DEFUN([_AM_MANGLE_OPTION],\n[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])\n\n# _AM_SET_OPTION(NAME)\n# --------------------\n# Set option NAME.  Presently that only means defining a flag for this option.\nAC_DEFUN([_AM_SET_OPTION],\n[m4_define(_AM_MANGLE_OPTION([$1]), [1])])\n\n# _AM_SET_OPTIONS(OPTIONS)\n# ------------------------\n# OPTIONS is a space-separated list of Automake options.\nAC_DEFUN([_AM_SET_OPTIONS],\n[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])\n\n# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])\n# -------------------------------------------\n# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.\nAC_DEFUN([_AM_IF_OPTION],\n[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])\n\n# Copyright (C) 1999-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_PROG_CC_C_O\n# ---------------\n# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC\n# to automatically call this.\nAC_DEFUN([_AM_PROG_CC_C_O],\n[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\nAC_REQUIRE_AUX_FILE([compile])dnl\nAC_LANG_PUSH([C])dnl\nAC_CACHE_CHECK(\n  [whether $CC understands -c and -o together],\n  [am_cv_prog_cc_c_o],\n  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])\n  # Make sure it works both with $CC and with simple cc.\n  # Following AC_PROG_CC_C_O, we do the test twice because some\n  # compilers refuse to overwrite an existing .o file with -o,\n  # though they will create one.\n  am_cv_prog_cc_c_o=yes\n  for am_i in 1 2; do\n    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \\\n         && test -f conftest2.$ac_objext; then\n      : OK\n    else\n      am_cv_prog_cc_c_o=no\n      break\n    fi\n  done\n  rm -f core conftest*\n  unset am_i])\nif test \"$am_cv_prog_cc_c_o\" != yes; then\n   # Losing compiler, so override with the script.\n   # FIXME: It is wrong to rewrite CC.\n   # But if we don't then we get into trouble of one sort or another.\n   # A longer-term fix would be to have automake use am__CC in this case,\n   # and then we could set am__CC=\"\\$(top_srcdir)/compile \\$(CC)\"\n   CC=\"$am_aux_dir/compile $CC\"\nfi\nAC_LANG_POP([C])])\n\n# For backward compatibility.\nAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])\n\n# Copyright (C) 2001-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_RUN_LOG(COMMAND)\n# -------------------\n# Run COMMAND, save the exit status in ac_status, and log it.\n# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)\nAC_DEFUN([AM_RUN_LOG],\n[{ echo \"$as_me:$LINENO: $1\" >&AS_MESSAGE_LOG_FD\n   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD\n   ac_status=$?\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&AS_MESSAGE_LOG_FD\n   (exit $ac_status); }])\n\n# Check to make sure that the build environment is sane.    -*- Autoconf -*-\n\n# Copyright (C) 1996-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_SANITY_CHECK\n# ---------------\nAC_DEFUN([AM_SANITY_CHECK],\n[AC_MSG_CHECKING([whether build environment is sane])\n# Reject unsafe characters in $srcdir or the absolute working directory\n# name.  Accept space and tab only in the latter.\nam_lf='\n'\ncase `pwd` in\n  *[[\\\\\\\"\\#\\$\\&\\'\\`$am_lf]]*)\n    AC_MSG_ERROR([unsafe absolute working directory name]);;\nesac\ncase $srcdir in\n  *[[\\\\\\\"\\#\\$\\&\\'\\`$am_lf\\ \\\t]]*)\n    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;\nesac\n\n# Do 'set' in a subshell so we don't clobber the current shell's\n# arguments.  Must try -L first in case configure is actually a\n# symlink; some systems play weird games with the mod time of symlinks\n# (eg FreeBSD returns the mod time of the symlink's containing\n# directory).\nif (\n   am_has_slept=no\n   for am_try in 1 2; do\n     echo \"timestamp, slept: $am_has_slept\" > conftest.file\n     set X `ls -Lt \"$srcdir/configure\" conftest.file 2> /dev/null`\n     if test \"$[*]\" = \"X\"; then\n\t# -L didn't work.\n\tset X `ls -t \"$srcdir/configure\" conftest.file`\n     fi\n     if test \"$[*]\" != \"X $srcdir/configure conftest.file\" \\\n\t&& test \"$[*]\" != \"X conftest.file $srcdir/configure\"; then\n\n\t# If neither matched, then we have a broken ls.  This can happen\n\t# if, for instance, CONFIG_SHELL is bash and it inherits a\n\t# broken ls alias from the environment.  This has actually\n\t# happened.  Such a system could not be considered \"sane\".\n\tAC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken\n  alias in your environment])\n     fi\n     if test \"$[2]\" = conftest.file || test $am_try -eq 2; then\n       break\n     fi\n     # Just in case.\n     sleep 1\n     am_has_slept=yes\n   done\n   test \"$[2]\" = conftest.file\n   )\nthen\n   # Ok.\n   :\nelse\n   AC_MSG_ERROR([newly created file is older than distributed files!\nCheck your system clock])\nfi\nAC_MSG_RESULT([yes])\n# If we didn't sleep, we still need to ensure time stamps of config.status and\n# generated files are strictly newer.\nam_sleep_pid=\nif grep 'slept: no' conftest.file >/dev/null 2>&1; then\n  ( sleep 1 ) &\n  am_sleep_pid=$!\nfi\nAC_CONFIG_COMMANDS_PRE(\n  [AC_MSG_CHECKING([that generated files are newer than configure])\n   if test -n \"$am_sleep_pid\"; then\n     # Hide warnings about reused PIDs.\n     wait $am_sleep_pid 2>/dev/null\n   fi\n   AC_MSG_RESULT([done])])\nrm -f conftest.file\n])\n\n# Copyright (C) 2009-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_SILENT_RULES([DEFAULT])\n# --------------------------\n# Enable less verbose build rules; with the default set to DEFAULT\n# (\"yes\" being less verbose, \"no\" or empty being verbose).\nAC_DEFUN([AM_SILENT_RULES],\n[AC_ARG_ENABLE([silent-rules], [dnl\nAS_HELP_STRING(\n  [--enable-silent-rules],\n  [less verbose build output (undo: \"make V=1\")])\nAS_HELP_STRING(\n  [--disable-silent-rules],\n  [verbose build output (undo: \"make V=0\")])dnl\n])\ncase $enable_silent_rules in @%:@ (((\n  yes) AM_DEFAULT_VERBOSITY=0;;\n   no) AM_DEFAULT_VERBOSITY=1;;\n    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;\nesac\ndnl\ndnl A few 'make' implementations (e.g., NonStop OS and NextStep)\ndnl do not support nested variable expansions.\ndnl See automake bug#9928 and bug#10237.\nam_make=${MAKE-make}\nAC_CACHE_CHECK([whether $am_make supports nested variables],\n   [am_cv_make_support_nested_variables],\n   [if AS_ECHO([['TRUE=$(BAR$(V))\nBAR0=false\nBAR1=true\nV=1\nam__doit:\n\t@$(TRUE)\n.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then\n  am_cv_make_support_nested_variables=yes\nelse\n  am_cv_make_support_nested_variables=no\nfi])\nif test $am_cv_make_support_nested_variables = yes; then\n  dnl Using '$V' instead of '$(V)' breaks IRIX make.\n  AM_V='$(V)'\n  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'\nelse\n  AM_V=$AM_DEFAULT_VERBOSITY\n  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY\nfi\nAC_SUBST([AM_V])dnl\nAM_SUBST_NOTMAKE([AM_V])dnl\nAC_SUBST([AM_DEFAULT_V])dnl\nAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl\nAC_SUBST([AM_DEFAULT_VERBOSITY])dnl\nAM_BACKSLASH='\\'\nAC_SUBST([AM_BACKSLASH])dnl\n_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl\n])\n\n# Copyright (C) 2001-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_PROG_INSTALL_STRIP\n# ---------------------\n# One issue with vendor 'install' (even GNU) is that you can't\n# specify the program used to strip binaries.  This is especially\n# annoying in cross-compiling environments, where the build's strip\n# is unlikely to handle the host's binaries.\n# Fortunately install-sh will honor a STRIPPROG variable, so we\n# always use install-sh in \"make install-strip\", and initialize\n# STRIPPROG with the value of the STRIP variable (set by the user).\nAC_DEFUN([AM_PROG_INSTALL_STRIP],\n[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl\n# Installed binaries are usually stripped using 'strip' when the user\n# run \"make install-strip\".  However 'strip' might not be the right\n# tool to use in cross-compilation environments, therefore Automake\n# will honor the 'STRIP' environment variable to overrule this program.\ndnl Don't test for $cross_compiling = yes, because it might be 'maybe'.\nif test \"$cross_compiling\" != no; then\n  AC_CHECK_TOOL([STRIP], [strip], :)\nfi\nINSTALL_STRIP_PROGRAM=\"\\$(install_sh) -c -s\"\nAC_SUBST([INSTALL_STRIP_PROGRAM])])\n\n# Copyright (C) 2006-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_SUBST_NOTMAKE(VARIABLE)\n# ---------------------------\n# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.\n# This macro is traced by Automake.\nAC_DEFUN([_AM_SUBST_NOTMAKE])\n\n# AM_SUBST_NOTMAKE(VARIABLE)\n# --------------------------\n# Public sister of _AM_SUBST_NOTMAKE.\nAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])\n\n# Check how to create a tarball.                            -*- Autoconf -*-\n\n# Copyright (C) 2004-2013 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_PROG_TAR(FORMAT)\n# --------------------\n# Check how to create a tarball in format FORMAT.\n# FORMAT should be one of 'v7', 'ustar', or 'pax'.\n#\n# Substitute a variable $(am__tar) that is a command\n# writing to stdout a FORMAT-tarball containing the directory\n# $tardir.\n#     tardir=directory && $(am__tar) > result.tar\n#\n# Substitute a variable $(am__untar) that extract such\n# a tarball read from stdin.\n#     $(am__untar) < result.tar\n#\nAC_DEFUN([_AM_PROG_TAR],\n[# Always define AMTAR for backward compatibility.  Yes, it's still used\n# in the wild :-(  We should find a proper way to deprecate it ...\nAC_SUBST([AMTAR], ['$${TAR-tar}'])\n\n# We'll loop over all known methods to create a tar archive until one works.\n_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'\n\nm4_if([$1], [v7],\n  [am__tar='$${TAR-tar} chof - \"$$tardir\"' am__untar='$${TAR-tar} xf -'],\n\n  [m4_case([$1],\n    [ustar],\n     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.\n      # There is notably a 21 bits limit for the UID and the GID.  In fact,\n      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343\n      # and bug#13588).\n      am_max_uid=2097151 # 2^21 - 1\n      am_max_gid=$am_max_uid\n      # The $UID and $GID variables are not portable, so we need to resort\n      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls\n      # below are definitely unexpected, so allow the users to see them\n      # (that is, avoid stderr redirection).\n      am_uid=`id -u || echo unknown`\n      am_gid=`id -g || echo unknown`\n      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])\n      if test $am_uid -le $am_max_uid; then\n         AC_MSG_RESULT([yes])\n      else\n         AC_MSG_RESULT([no])\n         _am_tools=none\n      fi\n      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])\n      if test $am_gid -le $am_max_gid; then\n         AC_MSG_RESULT([yes])\n      else\n        AC_MSG_RESULT([no])\n        _am_tools=none\n      fi],\n\n  [pax],\n    [],\n\n  [m4_fatal([Unknown tar format])])\n\n  AC_MSG_CHECKING([how to create a $1 tar archive])\n\n  # Go ahead even if we have the value already cached.  We do so because we\n  # need to set the values for the 'am__tar' and 'am__untar' variables.\n  _am_tools=${am_cv_prog_tar_$1-$_am_tools}\n\n  for _am_tool in $_am_tools; do\n    case $_am_tool in\n    gnutar)\n      for _am_tar in tar gnutar gtar; do\n        AM_RUN_LOG([$_am_tar --version]) && break\n      done\n      am__tar=\"$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - \"'\"$$tardir\"'\n      am__tar_=\"$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - \"'\"$tardir\"'\n      am__untar=\"$_am_tar -xf -\"\n      ;;\n    plaintar)\n      # Must skip GNU tar: if it does not support --format= it doesn't create\n      # ustar tarball either.\n      (tar --version) >/dev/null 2>&1 && continue\n      am__tar='tar chf - \"$$tardir\"'\n      am__tar_='tar chf - \"$tardir\"'\n      am__untar='tar xf -'\n      ;;\n    pax)\n      am__tar='pax -L -x $1 -w \"$$tardir\"'\n      am__tar_='pax -L -x $1 -w \"$tardir\"'\n      am__untar='pax -r'\n      ;;\n    cpio)\n      am__tar='find \"$$tardir\" -print | cpio -o -H $1 -L'\n      am__tar_='find \"$tardir\" -print | cpio -o -H $1 -L'\n      am__untar='cpio -i -H $1 -d'\n      ;;\n    none)\n      am__tar=false\n      am__tar_=false\n      am__untar=false\n      ;;\n    esac\n\n    # If the value was cached, stop now.  We just wanted to have am__tar\n    # and am__untar set.\n    test -n \"${am_cv_prog_tar_$1}\" && break\n\n    # tar/untar a dummy directory, and stop if the command works.\n    rm -rf conftest.dir\n    mkdir conftest.dir\n    echo GrepMe > conftest.dir/file\n    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])\n    rm -rf conftest.dir\n    if test -s conftest.tar; then\n      AM_RUN_LOG([$am__untar <conftest.tar])\n      AM_RUN_LOG([cat conftest.dir/file])\n      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break\n    fi\n  done\n  rm -rf conftest.dir\n\n  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])\n  AC_MSG_RESULT([$am_cv_prog_tar_$1])])\n\nAC_SUBST([am__tar])\nAC_SUBST([am__untar])\n]) # _AM_PROG_TAR\n\n"
  },
  {
    "path": "bootstrap.sh",
    "content": "#!/bin/sh\nmkdir -p m4\naclocal || exit 1\nautomake -a -c || exit 1\nautoconf || exit 1\nrm -rf autom4te.cache\nrm -d m4\n"
  },
  {
    "path": "compile",
    "content": "#! /bin/sh\n# Wrapper for compilers which do not understand '-c -o'.\n\nscriptversion=2012-10-14.11; # UTC\n\n# Copyright (C) 1999-2013 Free Software Foundation, Inc.\n# Written by Tom Tromey <tromey@cygnus.com>.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# This file is maintained in Automake, please report\n# bugs to <bug-automake@gnu.org> or send patches to\n# <automake-patches@gnu.org>.\n\nnl='\n'\n\n# We need space, tab and new line, in precisely that order.  Quoting is\n# there to prevent tools from complaining about whitespace usage.\nIFS=\" \"\"\t$nl\"\n\nfile_conv=\n\n# func_file_conv build_file lazy\n# Convert a $build file to $host form and store it in $file\n# Currently only supports Windows hosts. If the determined conversion\n# type is listed in (the comma separated) LAZY, no conversion will\n# take place.\nfunc_file_conv ()\n{\n  file=$1\n  case $file in\n    / | /[!/]*) # absolute file, and not a UNC file\n      if test -z \"$file_conv\"; then\n\t# lazily determine how to convert abs files\n\tcase `uname -s` in\n\t  MINGW*)\n\t    file_conv=mingw\n\t    ;;\n\t  CYGWIN*|MSYS*)\n\t    file_conv=cygwin\n\t    ;;\n\t  *)\n\t    file_conv=wine\n\t    ;;\n\tesac\n      fi\n      case $file_conv/,$2, in\n\t*,$file_conv,*)\n\t  ;;\n\tmingw/*)\n\t  file=`cmd //C echo \"$file \" | sed -e 's/\"\\(.*\\) \" *$/\\1/'`\n\t  ;;\n\tcygwin/*|msys/*)\n\t  file=`cygpath -m \"$file\" || echo \"$file\"`\n\t  ;;\n\twine/*)\n\t  file=`winepath -w \"$file\" || echo \"$file\"`\n\t  ;;\n      esac\n      ;;\n  esac\n}\n\n# func_cl_dashL linkdir\n# Make cl look for libraries in LINKDIR\nfunc_cl_dashL ()\n{\n  func_file_conv \"$1\"\n  if test -z \"$lib_path\"; then\n    lib_path=$file\n  else\n    lib_path=\"$lib_path;$file\"\n  fi\n  linker_opts=\"$linker_opts -LIBPATH:$file\"\n}\n\n# func_cl_dashl library\n# Do a library search-path lookup for cl\nfunc_cl_dashl ()\n{\n  lib=$1\n  found=no\n  save_IFS=$IFS\n  IFS=';'\n  for dir in $lib_path $LIB\n  do\n    IFS=$save_IFS\n    if $shared && test -f \"$dir/$lib.dll.lib\"; then\n      found=yes\n      lib=$dir/$lib.dll.lib\n      break\n    fi\n    if test -f \"$dir/$lib.lib\"; then\n      found=yes\n      lib=$dir/$lib.lib\n      break\n    fi\n    if test -f \"$dir/lib$lib.a\"; then\n      found=yes\n      lib=$dir/lib$lib.a\n      break\n    fi\n  done\n  IFS=$save_IFS\n\n  if test \"$found\" != yes; then\n    lib=$lib.lib\n  fi\n}\n\n# func_cl_wrapper cl arg...\n# Adjust compile command to suit cl\nfunc_cl_wrapper ()\n{\n  # Assume a capable shell\n  lib_path=\n  shared=:\n  linker_opts=\n  for arg\n  do\n    if test -n \"$eat\"; then\n      eat=\n    else\n      case $1 in\n\t-o)\n\t  # configure might choose to run compile as 'compile cc -o foo foo.c'.\n\t  eat=1\n\t  case $2 in\n\t    *.o | *.[oO][bB][jJ])\n\t      func_file_conv \"$2\"\n\t      set x \"$@\" -Fo\"$file\"\n\t      shift\n\t      ;;\n\t    *)\n\t      func_file_conv \"$2\"\n\t      set x \"$@\" -Fe\"$file\"\n\t      shift\n\t      ;;\n\t  esac\n\t  ;;\n\t-I)\n\t  eat=1\n\t  func_file_conv \"$2\" mingw\n\t  set x \"$@\" -I\"$file\"\n\t  shift\n\t  ;;\n\t-I*)\n\t  func_file_conv \"${1#-I}\" mingw\n\t  set x \"$@\" -I\"$file\"\n\t  shift\n\t  ;;\n\t-l)\n\t  eat=1\n\t  func_cl_dashl \"$2\"\n\t  set x \"$@\" \"$lib\"\n\t  shift\n\t  ;;\n\t-l*)\n\t  func_cl_dashl \"${1#-l}\"\n\t  set x \"$@\" \"$lib\"\n\t  shift\n\t  ;;\n\t-L)\n\t  eat=1\n\t  func_cl_dashL \"$2\"\n\t  ;;\n\t-L*)\n\t  func_cl_dashL \"${1#-L}\"\n\t  ;;\n\t-static)\n\t  shared=false\n\t  ;;\n\t-Wl,*)\n\t  arg=${1#-Wl,}\n\t  save_ifs=\"$IFS\"; IFS=','\n\t  for flag in $arg; do\n\t    IFS=\"$save_ifs\"\n\t    linker_opts=\"$linker_opts $flag\"\n\t  done\n\t  IFS=\"$save_ifs\"\n\t  ;;\n\t-Xlinker)\n\t  eat=1\n\t  linker_opts=\"$linker_opts $2\"\n\t  ;;\n\t-*)\n\t  set x \"$@\" \"$1\"\n\t  shift\n\t  ;;\n\t*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)\n\t  func_file_conv \"$1\"\n\t  set x \"$@\" -Tp\"$file\"\n\t  shift\n\t  ;;\n\t*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])\n\t  func_file_conv \"$1\" mingw\n\t  set x \"$@\" \"$file\"\n\t  shift\n\t  ;;\n\t*)\n\t  set x \"$@\" \"$1\"\n\t  shift\n\t  ;;\n      esac\n    fi\n    shift\n  done\n  if test -n \"$linker_opts\"; then\n    linker_opts=\"-link$linker_opts\"\n  fi\n  exec \"$@\" $linker_opts\n  exit 1\n}\n\neat=\n\ncase $1 in\n  '')\n     echo \"$0: No command.  Try '$0 --help' for more information.\" 1>&2\n     exit 1;\n     ;;\n  -h | --h*)\n    cat <<\\EOF\nUsage: compile [--help] [--version] PROGRAM [ARGS]\n\nWrapper for compilers which do not understand '-c -o'.\nRemove '-o dest.o' from ARGS, run PROGRAM with the remaining\narguments, and rename the output as expected.\n\nIf you are trying to build a whole package this is not the\nright script to run: please start by reading the file 'INSTALL'.\n\nReport bugs to <bug-automake@gnu.org>.\nEOF\n    exit $?\n    ;;\n  -v | --v*)\n    echo \"compile $scriptversion\"\n    exit $?\n    ;;\n  cl | *[/\\\\]cl | cl.exe | *[/\\\\]cl.exe )\n    func_cl_wrapper \"$@\"      # Doesn't return...\n    ;;\nesac\n\nofile=\ncfile=\n\nfor arg\ndo\n  if test -n \"$eat\"; then\n    eat=\n  else\n    case $1 in\n      -o)\n\t# configure might choose to run compile as 'compile cc -o foo foo.c'.\n\t# So we strip '-o arg' only if arg is an object.\n\teat=1\n\tcase $2 in\n\t  *.o | *.obj)\n\t    ofile=$2\n\t    ;;\n\t  *)\n\t    set x \"$@\" -o \"$2\"\n\t    shift\n\t    ;;\n\tesac\n\t;;\n      *.c)\n\tcfile=$1\n\tset x \"$@\" \"$1\"\n\tshift\n\t;;\n      *)\n\tset x \"$@\" \"$1\"\n\tshift\n\t;;\n    esac\n  fi\n  shift\ndone\n\nif test -z \"$ofile\" || test -z \"$cfile\"; then\n  # If no '-o' option was seen then we might have been invoked from a\n  # pattern rule where we don't need one.  That is ok -- this is a\n  # normal compilation that the losing compiler can handle.  If no\n  # '.c' file was seen then we are probably linking.  That is also\n  # ok.\n  exec \"$@\"\nfi\n\n# Name of file we expect compiler to create.\ncofile=`echo \"$cfile\" | sed 's|^.*[\\\\/]||; s|^[a-zA-Z]:||; s/\\.c$/.o/'`\n\n# Create the lock directory.\n# Note: use '[/\\\\:.-]' here to ensure that we don't use the same name\n# that we are using for the .o file.  Also, base the name on the expected\n# object file name, since that is what matters with a parallel build.\nlockdir=`echo \"$cofile\" | sed -e 's|[/\\\\:.-]|_|g'`.d\nwhile true; do\n  if mkdir \"$lockdir\" >/dev/null 2>&1; then\n    break\n  fi\n  sleep 1\ndone\n# FIXME: race condition here if user kills between mkdir and trap.\ntrap \"rmdir '$lockdir'; exit 1\" 1 2 15\n\n# Run the compile.\n\"$@\"\nret=$?\n\nif test -f \"$cofile\"; then\n  test \"$cofile\" = \"$ofile\" || mv \"$cofile\" \"$ofile\"\nelif test -f \"${cofile}bj\"; then\n  test \"${cofile}bj\" = \"$ofile\" || mv \"${cofile}bj\" \"$ofile\"\nfi\n\nrmdir \"$lockdir\"\nexit $ret\n\n# Local Variables:\n# mode: shell-script\n# sh-indentation: 2\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "configure",
    "content": "#! /bin/sh\n# Guess values for system-dependent variables and create Makefiles.\n# Generated by GNU Autoconf 2.71 for rufus 4.14.\n#\n# Report bugs to <https://github.com/pbatard/rufus/issues>.\n#\n#\n# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,\n# Inc.\n#\n#\n# This configure script is free software; the Free Software Foundation\n# gives unlimited permission to copy, distribute and modify it.\n## -------------------- ##\n## M4sh Initialization. ##\n## -------------------- ##\n\n# Be more Bourne compatible\nDUALCASE=1; export DUALCASE # for MKS sh\nas_nop=:\nif test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1\nthen :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\n  setopt NO_GLOB_SUBST\nelse $as_nop\n  case `(set -o) 2>/dev/null` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac\nfi\n\n\n\n# Reset variables that may have inherited troublesome values from\n# the environment.\n\n# IFS needs to be set, to space, tab, and newline, in precisely that order.\n# (If _AS_PATH_WALK were called with IFS unset, it would have the\n# side effect of setting IFS to empty, thus disabling word splitting.)\n# Quoting is to prevent editors from complaining about space-tab.\nas_nl='\n'\nexport as_nl\nIFS=\" \"\"\t$as_nl\"\n\nPS1='$ '\nPS2='> '\nPS4='+ '\n\n# Ensure predictable behavior from utilities with locale-dependent output.\nLC_ALL=C\nexport LC_ALL\nLANGUAGE=C\nexport LANGUAGE\n\n# We cannot yet rely on \"unset\" to work, but we need these variables\n# to be unset--not just set to an empty or harmless value--now, to\n# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh).  This construct\n# also avoids known problems related to \"unset\" and subshell syntax\n# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).\nfor as_var in BASH_ENV ENV MAIL MAILPATH CDPATH\ndo eval test \\${$as_var+y} \\\n  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :\ndone\n\n# Ensure that fds 0, 1, and 2 are open.\nif (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi\nif (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi\nif (exec 3>&2)            ; then :; else exec 2>/dev/null; fi\n\n# The user is always right.\nif ${PATH_SEPARATOR+false} :; then\n  PATH_SEPARATOR=:\n  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n      PATH_SEPARATOR=';'\n  }\nfi\n\n\n# Find who we are.  Look in the path if we contain no directory separator.\nas_myself=\ncase $0 in #((\n  *[\\\\/]* ) as_myself=$0 ;;\n  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    test -r \"$as_dir$0\" && as_myself=$as_dir$0 && break\n  done\nIFS=$as_save_IFS\n\n     ;;\nesac\n# We did not find ourselves, most probably we were run as `sh COMMAND'\n# in which case we are not to be found in the path.\nif test \"x$as_myself\" = x; then\n  as_myself=$0\nfi\nif test ! -f \"$as_myself\"; then\n  printf \"%s\\n\" \"$as_myself: error: cannot find myself; rerun with an absolute file name\" >&2\n  exit 1\nfi\n\n\n# Use a proper internal environment variable to ensure we don't fall\n  # into an infinite loop, continuously re-executing ourselves.\n  if test x\"${_as_can_reexec}\" != xno && test \"x$CONFIG_SHELL\" != x; then\n    _as_can_reexec=no; export _as_can_reexec;\n    # We cannot yet assume a decent shell, so we have to provide a\n# neutralization value for shells without unset; and this also\n# works around shells that cannot unset nonexistent variables.\n# Preserve -v and -x to the replacement shell.\nBASH_ENV=/dev/null\nENV=/dev/null\n(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV\ncase $- in # ((((\n  *v*x* | *x*v* ) as_opts=-vx ;;\n  *v* ) as_opts=-v ;;\n  *x* ) as_opts=-x ;;\n  * ) as_opts= ;;\nesac\nexec $CONFIG_SHELL $as_opts \"$as_myself\" ${1+\"$@\"}\n# Admittedly, this is quite paranoid, since all the known shells bail\n# out after a failed `exec'.\nprintf \"%s\\n\" \"$0: could not re-execute with $CONFIG_SHELL\" >&2\nexit 255\n  fi\n  # We don't want this to propagate to other subprocesses.\n          { _as_can_reexec=; unset _as_can_reexec;}\nif test \"x$CONFIG_SHELL\" = x; then\n  as_bourne_compatible=\"as_nop=:\nif test \\${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1\nthen :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on \\${1+\\\"\\$@\\\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '\\${1+\\\"\\$@\\\"}'='\\\"\\$@\\\"'\n  setopt NO_GLOB_SUBST\nelse \\$as_nop\n  case \\`(set -o) 2>/dev/null\\` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac\nfi\n\"\n  as_required=\"as_fn_return () { (exit \\$1); }\nas_fn_success () { as_fn_return 0; }\nas_fn_failure () { as_fn_return 1; }\nas_fn_ret_success () { return 0; }\nas_fn_ret_failure () { return 1; }\n\nexitcode=0\nas_fn_success || { exitcode=1; echo as_fn_success failed.; }\nas_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }\nas_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }\nas_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }\nif ( set x; as_fn_ret_success y && test x = \\\"\\$1\\\" )\nthen :\n\nelse \\$as_nop\n  exitcode=1; echo positional parameters were not saved.\nfi\ntest x\\$exitcode = x0 || exit 1\nblah=\\$(echo \\$(echo blah))\ntest x\\\"\\$blah\\\" = xblah || exit 1\ntest -x / || exit 1\"\n  as_suggested=\"  as_lineno_1=\";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested\" as_lineno_1a=\\$LINENO\n  as_lineno_2=\";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested\" as_lineno_2a=\\$LINENO\n  eval 'test \\\"x\\$as_lineno_1'\\$as_run'\\\" != \\\"x\\$as_lineno_2'\\$as_run'\\\" &&\n  test \\\"x\\`expr \\$as_lineno_1'\\$as_run' + 1\\`\\\" = \\\"x\\$as_lineno_2'\\$as_run'\\\"' || exit 1\ntest \\$(( 1 + 1 )) = 2 || exit 1\"\n  if (eval \"$as_required\") 2>/dev/null\nthen :\n  as_have_required=yes\nelse $as_nop\n  as_have_required=no\nfi\n  if test x$as_have_required = xyes && (eval \"$as_suggested\") 2>/dev/null\nthen :\n\nelse $as_nop\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nas_found=false\nfor as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n  as_found=:\n  case $as_dir in #(\n\t /*)\n\t   for as_base in sh bash ksh sh5; do\n\t     # Try only shells that exist, to save several forks.\n\t     as_shell=$as_dir$as_base\n\t     if { test -f \"$as_shell\" || test -f \"$as_shell.exe\"; } &&\n\t\t    as_run=a \"$as_shell\" -c \"$as_bourne_compatible\"\"$as_required\" 2>/dev/null\nthen :\n  CONFIG_SHELL=$as_shell as_have_required=yes\n\t\t   if as_run=a \"$as_shell\" -c \"$as_bourne_compatible\"\"$as_suggested\" 2>/dev/null\nthen :\n  break 2\nfi\nfi\n\t   done;;\n       esac\n  as_found=false\ndone\nIFS=$as_save_IFS\nif $as_found\nthen :\n\nelse $as_nop\n  if { test -f \"$SHELL\" || test -f \"$SHELL.exe\"; } &&\n\t      as_run=a \"$SHELL\" -c \"$as_bourne_compatible\"\"$as_required\" 2>/dev/null\nthen :\n  CONFIG_SHELL=$SHELL as_have_required=yes\nfi\nfi\n\n\n      if test \"x$CONFIG_SHELL\" != x\nthen :\n  export CONFIG_SHELL\n             # We cannot yet assume a decent shell, so we have to provide a\n# neutralization value for shells without unset; and this also\n# works around shells that cannot unset nonexistent variables.\n# Preserve -v and -x to the replacement shell.\nBASH_ENV=/dev/null\nENV=/dev/null\n(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV\ncase $- in # ((((\n  *v*x* | *x*v* ) as_opts=-vx ;;\n  *v* ) as_opts=-v ;;\n  *x* ) as_opts=-x ;;\n  * ) as_opts= ;;\nesac\nexec $CONFIG_SHELL $as_opts \"$as_myself\" ${1+\"$@\"}\n# Admittedly, this is quite paranoid, since all the known shells bail\n# out after a failed `exec'.\nprintf \"%s\\n\" \"$0: could not re-execute with $CONFIG_SHELL\" >&2\nexit 255\nfi\n\n    if test x$as_have_required = xno\nthen :\n  printf \"%s\\n\" \"$0: This script requires a shell more modern than all\"\n  printf \"%s\\n\" \"$0: the shells that I found on your system.\"\n  if test ${ZSH_VERSION+y} ; then\n    printf \"%s\\n\" \"$0: In particular, zsh $ZSH_VERSION has bugs and should\"\n    printf \"%s\\n\" \"$0: be upgraded to zsh 4.3.4 or later.\"\n  else\n    printf \"%s\\n\" \"$0: Please tell bug-autoconf@gnu.org and\n$0: https://github.com/pbatard/rufus/issues about your\n$0: system, including any error possibly output before this\n$0: message. Then install a modern shell, or manually run\n$0: the script under such a shell if you do have one.\"\n  fi\n  exit 1\nfi\nfi\nfi\nSHELL=${CONFIG_SHELL-/bin/sh}\nexport SHELL\n# Unset more variables known to interfere with behavior of common tools.\nCLICOLOR_FORCE= GREP_OPTIONS=\nunset CLICOLOR_FORCE GREP_OPTIONS\n\n## --------------------- ##\n## M4sh Shell Functions. ##\n## --------------------- ##\n# as_fn_unset VAR\n# ---------------\n# Portably unset VAR.\nas_fn_unset ()\n{\n  { eval $1=; unset $1;}\n}\nas_unset=as_fn_unset\n\n\n# as_fn_set_status STATUS\n# -----------------------\n# Set $? to STATUS, without forking.\nas_fn_set_status ()\n{\n  return $1\n} # as_fn_set_status\n\n# as_fn_exit STATUS\n# -----------------\n# Exit the shell with STATUS, even in a \"trap 0\" or \"set -e\" context.\nas_fn_exit ()\n{\n  set +e\n  as_fn_set_status $1\n  exit $1\n} # as_fn_exit\n# as_fn_nop\n# ---------\n# Do nothing but, unlike \":\", preserve the value of $?.\nas_fn_nop ()\n{\n  return $?\n}\nas_nop=as_fn_nop\n\n# as_fn_mkdir_p\n# -------------\n# Create \"$as_dir\" as a directory, including parents if necessary.\nas_fn_mkdir_p ()\n{\n\n  case $as_dir in #(\n  -*) as_dir=./$as_dir;;\n  esac\n  test -d \"$as_dir\" || eval $as_mkdir_p || {\n    as_dirs=\n    while :; do\n      case $as_dir in #(\n      *\\'*) as_qdir=`printf \"%s\\n\" \"$as_dir\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; #'(\n      *) as_qdir=$as_dir;;\n      esac\n      as_dirs=\"'$as_qdir' $as_dirs\"\n      as_dir=`$as_dirname -- \"$as_dir\" ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n      test -d \"$as_dir\" && break\n    done\n    test -z \"$as_dirs\" || eval \"mkdir $as_dirs\"\n  } || test -d \"$as_dir\" || as_fn_error $? \"cannot create directory $as_dir\"\n\n\n} # as_fn_mkdir_p\n\n# as_fn_executable_p FILE\n# -----------------------\n# Test if FILE is an executable regular file.\nas_fn_executable_p ()\n{\n  test -f \"$1\" && test -x \"$1\"\n} # as_fn_executable_p\n# as_fn_append VAR VALUE\n# ----------------------\n# Append the text in VALUE to the end of the definition contained in VAR. Take\n# advantage of any shell optimizations that allow amortized linear growth over\n# repeated appends, instead of the typical quadratic growth present in naive\n# implementations.\nif (eval \"as_var=1; as_var+=2; test x\\$as_var = x12\") 2>/dev/null\nthen :\n  eval 'as_fn_append ()\n  {\n    eval $1+=\\$2\n  }'\nelse $as_nop\n  as_fn_append ()\n  {\n    eval $1=\\$$1\\$2\n  }\nfi # as_fn_append\n\n# as_fn_arith ARG...\n# ------------------\n# Perform arithmetic evaluation on the ARGs, and store the result in the\n# global $as_val. Take advantage of shells that can avoid forks. The arguments\n# must be portable across $(()) and expr.\nif (eval \"test \\$(( 1 + 1 )) = 2\") 2>/dev/null\nthen :\n  eval 'as_fn_arith ()\n  {\n    as_val=$(( $* ))\n  }'\nelse $as_nop\n  as_fn_arith ()\n  {\n    as_val=`expr \"$@\" || test $? -eq 1`\n  }\nfi # as_fn_arith\n\n# as_fn_nop\n# ---------\n# Do nothing but, unlike \":\", preserve the value of $?.\nas_fn_nop ()\n{\n  return $?\n}\nas_nop=as_fn_nop\n\n# as_fn_error STATUS ERROR [LINENO LOG_FD]\n# ----------------------------------------\n# Output \"`basename $0`: error: ERROR\" to stderr. If LINENO and LOG_FD are\n# provided, also output the error to LOG_FD, referencing LINENO. Then exit the\n# script with STATUS, using 1 if that was 0.\nas_fn_error ()\n{\n  as_status=$1; test $as_status -eq 0 && as_status=1\n  if test \"$4\"; then\n    as_lineno=${as_lineno-\"$3\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: $2\" >&$4\n  fi\n  printf \"%s\\n\" \"$as_me: error: $2\" >&2\n  as_fn_exit $as_status\n} # as_fn_error\n\nif expr a : '\\(a\\)' >/dev/null 2>&1 &&\n   test \"X`expr 00001 : '.*\\(...\\)'`\" = X001; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nif (basename -- /) >/dev/null 2>&1 && test \"X`basename -- / 2>&1`\" = \"X/\"; then\n  as_basename=basename\nelse\n  as_basename=false\nfi\n\nif (as_dir=`dirname -- /` && test \"X$as_dir\" = X/) >/dev/null 2>&1; then\n  as_dirname=dirname\nelse\n  as_dirname=false\nfi\n\nas_me=`$as_basename -- \"$0\" ||\n$as_expr X/\"$0\" : '.*/\\([^/][^/]*\\)/*$' \\| \\\n\t X\"$0\" : 'X\\(//\\)$' \\| \\\n\t X\"$0\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X/\"$0\" |\n    sed '/^.*\\/\\([^/][^/]*\\)\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n\n# Avoid depending upon Character Ranges.\nas_cr_letters='abcdefghijklmnopqrstuvwxyz'\nas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\nas_cr_Letters=$as_cr_letters$as_cr_LETTERS\nas_cr_digits='0123456789'\nas_cr_alnum=$as_cr_Letters$as_cr_digits\n\n\n  as_lineno_1=$LINENO as_lineno_1a=$LINENO\n  as_lineno_2=$LINENO as_lineno_2a=$LINENO\n  eval 'test \"x$as_lineno_1'$as_run'\" != \"x$as_lineno_2'$as_run'\" &&\n  test \"x`expr $as_lineno_1'$as_run' + 1`\" = \"x$as_lineno_2'$as_run'\"' || {\n  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)\n  sed -n '\n    p\n    /[$]LINENO/=\n  ' <$as_myself |\n    sed '\n      s/[$]LINENO.*/&-/\n      t lineno\n      b\n      :lineno\n      N\n      :loop\n      s/[$]LINENO\\([^'$as_cr_alnum'_].*\\n\\)\\(.*\\)/\\2\\1\\2/\n      t loop\n      s/-\\n.*//\n    ' >$as_me.lineno &&\n  chmod +x \"$as_me.lineno\" ||\n    { printf \"%s\\n\" \"$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell\" >&2; as_fn_exit 1; }\n\n  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have\n  # already done that, so ensure we don't try to do so again and fall\n  # in an infinite loop.  This has already happened in practice.\n  _as_can_reexec=no; export _as_can_reexec\n  # Don't try to exec as it changes $[0], causing all sort of problems\n  # (the dirname of $[0] is not the place where we might find the\n  # original and so on.  Autoconf is especially sensitive to this).\n  . \"./$as_me.lineno\"\n  # Exit status is that of the last command.\n  exit\n}\n\n\n# Determine whether it's possible to make 'echo' print without a newline.\n# These variables are no longer used directly by Autoconf, but are AC_SUBSTed\n# for compatibility with existing Makefiles.\nECHO_C= ECHO_N= ECHO_T=\ncase `echo -n x` in #(((((\n-n*)\n  case `echo 'xy\\c'` in\n  *c*) ECHO_T='\t';;\t# ECHO_T is single tab character.\n  xy)  ECHO_C='\\c';;\n  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null\n       ECHO_T='\t';;\n  esac;;\n*)\n  ECHO_N='-n';;\nesac\n\n# For backward compatibility with old third-party macros, we provide\n# the shell variables $as_echo and $as_echo_n.  New code should use\n# AS_ECHO([\"message\"]) and AS_ECHO_N([\"message\"]), respectively.\nas_echo='printf %s\\n'\nas_echo_n='printf %s'\n\n\nrm -f conf$$ conf$$.exe conf$$.file\nif test -d conf$$.dir; then\n  rm -f conf$$.dir/conf$$.file\nelse\n  rm -f conf$$.dir\n  mkdir conf$$.dir 2>/dev/null\nfi\nif (echo >conf$$.file) 2>/dev/null; then\n  if ln -s conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s='ln -s'\n    # ... but there are two gotchas:\n    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.\n    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.\n    # In both cases, we have to default to `cp -pR'.\n    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||\n      as_ln_s='cp -pR'\n  elif ln conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s=ln\n  else\n    as_ln_s='cp -pR'\n  fi\nelse\n  as_ln_s='cp -pR'\nfi\nrm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file\nrmdir conf$$.dir 2>/dev/null\n\nif mkdir -p . 2>/dev/null; then\n  as_mkdir_p='mkdir -p \"$as_dir\"'\nelse\n  test -d ./-p && rmdir ./-p\n  as_mkdir_p=false\nfi\n\nas_test_x='test -x'\nas_executable_p=as_fn_executable_p\n\n# Sed expression to map a string onto a valid CPP name.\nas_tr_cpp=\"eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'\"\n\n# Sed expression to map a string onto a valid variable name.\nas_tr_sh=\"eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'\"\n\n\ntest -n \"$DJDIR\" || exec 7<&0 </dev/null\nexec 6>&1\n\n# Name of the host.\n# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,\n# so uname gets run too.\nac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`\n\n#\n# Initializations.\n#\nac_default_prefix=/usr/local\nac_clean_files=\nac_config_libobj_dir=.\nLIBOBJS=\ncross_compiling=no\nsubdirs=\nMFLAGS=\nMAKEFLAGS=\n\n# Identity of this package.\nPACKAGE_NAME='rufus'\nPACKAGE_TARNAME='rufus'\nPACKAGE_VERSION='4.14'\nPACKAGE_STRING='rufus 4.14'\nPACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues'\nPACKAGE_URL='https://rufus.ie'\n\nac_unique_file=\"src/rufus.c\"\nac_subst_vars='am__EXEEXT_FALSE\nam__EXEEXT_TRUE\nLTLIBOBJS\nLIBOBJS\nSUFFIX\nAM_LDFLAGS\nAM_CFLAGS\nVISIBILITY_CFLAGS\nWINDRES\nDLLTOOL\nRM\nSED\nRANLIB\nAR\nOBJEXT\nEXEEXT\nac_ct_CC\nCPPFLAGS\nLDFLAGS\nCFLAGS\nCC\nAM_BACKSLASH\nAM_DEFAULT_VERBOSITY\nAM_DEFAULT_V\nAM_V\nam__untar\nam__tar\nAMTAR\nam__leading_dot\nSET_MAKE\nAWK\nmkdir_p\nMKDIR_P\nINSTALL_STRIP_PROGRAM\nSTRIP\ninstall_sh\nMAKEINFO\nAUTOHEADER\nAUTOMAKE\nAUTOCONF\nACLOCAL\nVERSION\nPACKAGE\nCYGPATH_W\nam__isrc\nINSTALL_DATA\nINSTALL_SCRIPT\nINSTALL_PROGRAM\ntarget_alias\nhost_alias\nbuild_alias\nLIBS\nECHO_T\nECHO_N\nECHO_C\nDEFS\nmandir\nlocaledir\nlibdir\npsdir\npdfdir\ndvidir\nhtmldir\ninfodir\ndocdir\noldincludedir\nincludedir\nrunstatedir\nlocalstatedir\nsharedstatedir\nsysconfdir\ndatadir\ndatarootdir\nlibexecdir\nsbindir\nbindir\nprogram_transform_name\nprefix\nexec_prefix\nPACKAGE_URL\nPACKAGE_BUGREPORT\nPACKAGE_STRING\nPACKAGE_VERSION\nPACKAGE_TARNAME\nPACKAGE_NAME\nPATH_SEPARATOR\nSHELL'\nac_subst_files=''\nac_user_opts='\nenable_option_checking\nenable_silent_rules\nenable_debug\nenable_alpha\nenable_beta\nenable_test\n'\n      ac_precious_vars='build_alias\nhost_alias\ntarget_alias\nCC\nCFLAGS\nLDFLAGS\nLIBS\nCPPFLAGS'\n\n\n# Initialize some variables set by options.\nac_init_help=\nac_init_version=false\nac_unrecognized_opts=\nac_unrecognized_sep=\n# The variables have the same names as the options, with\n# dashes changed to underlines.\ncache_file=/dev/null\nexec_prefix=NONE\nno_create=\nno_recursion=\nprefix=NONE\nprogram_prefix=NONE\nprogram_suffix=NONE\nprogram_transform_name=s,x,x,\nsilent=\nsite=\nsrcdir=\nverbose=\nx_includes=NONE\nx_libraries=NONE\n\n# Installation directory options.\n# These are left unexpanded so users can \"make install exec_prefix=/foo\"\n# and all the variables that are supposed to be based on exec_prefix\n# by default will actually change.\n# Use braces instead of parens because sh, perl, etc. also accept them.\n# (The list follows the same order as the GNU Coding Standards.)\nbindir='${exec_prefix}/bin'\nsbindir='${exec_prefix}/sbin'\nlibexecdir='${exec_prefix}/libexec'\ndatarootdir='${prefix}/share'\ndatadir='${datarootdir}'\nsysconfdir='${prefix}/etc'\nsharedstatedir='${prefix}/com'\nlocalstatedir='${prefix}/var'\nrunstatedir='${localstatedir}/run'\nincludedir='${prefix}/include'\noldincludedir='/usr/include'\ndocdir='${datarootdir}/doc/${PACKAGE_TARNAME}'\ninfodir='${datarootdir}/info'\nhtmldir='${docdir}'\ndvidir='${docdir}'\npdfdir='${docdir}'\npsdir='${docdir}'\nlibdir='${exec_prefix}/lib'\nlocaledir='${datarootdir}/locale'\nmandir='${datarootdir}/man'\n\nac_prev=\nac_dashdash=\nfor ac_option\ndo\n  # If the previous option needs an argument, assign it.\n  if test -n \"$ac_prev\"; then\n    eval $ac_prev=\\$ac_option\n    ac_prev=\n    continue\n  fi\n\n  case $ac_option in\n  *=?*) ac_optarg=`expr \"X$ac_option\" : '[^=]*=\\(.*\\)'` ;;\n  *=)   ac_optarg= ;;\n  *)    ac_optarg=yes ;;\n  esac\n\n  case $ac_dashdash$ac_option in\n  --)\n    ac_dashdash=yes ;;\n\n  -bindir | --bindir | --bindi | --bind | --bin | --bi)\n    ac_prev=bindir ;;\n  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)\n    bindir=$ac_optarg ;;\n\n  -build | --build | --buil | --bui | --bu)\n    ac_prev=build_alias ;;\n  -build=* | --build=* | --buil=* | --bui=* | --bu=*)\n    build_alias=$ac_optarg ;;\n\n  -cache-file | --cache-file | --cache-fil | --cache-fi \\\n  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)\n    ac_prev=cache_file ;;\n  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \\\n  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)\n    cache_file=$ac_optarg ;;\n\n  --config-cache | -C)\n    cache_file=config.cache ;;\n\n  -datadir | --datadir | --datadi | --datad)\n    ac_prev=datadir ;;\n  -datadir=* | --datadir=* | --datadi=* | --datad=*)\n    datadir=$ac_optarg ;;\n\n  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \\\n  | --dataroo | --dataro | --datar)\n    ac_prev=datarootdir ;;\n  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \\\n  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)\n    datarootdir=$ac_optarg ;;\n\n  -disable-* | --disable-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*disable-\\(.*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid feature name: \\`$ac_useropt'\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`printf \"%s\\n\" \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"enable_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval enable_$ac_useropt=no ;;\n\n  -docdir | --docdir | --docdi | --doc | --do)\n    ac_prev=docdir ;;\n  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)\n    docdir=$ac_optarg ;;\n\n  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)\n    ac_prev=dvidir ;;\n  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)\n    dvidir=$ac_optarg ;;\n\n  -enable-* | --enable-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*enable-\\([^=]*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid feature name: \\`$ac_useropt'\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`printf \"%s\\n\" \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"enable_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval enable_$ac_useropt=\\$ac_optarg ;;\n\n  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \\\n  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \\\n  | --exec | --exe | --ex)\n    ac_prev=exec_prefix ;;\n  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \\\n  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \\\n  | --exec=* | --exe=* | --ex=*)\n    exec_prefix=$ac_optarg ;;\n\n  -gas | --gas | --ga | --g)\n    # Obsolete; use --with-gas.\n    with_gas=yes ;;\n\n  -help | --help | --hel | --he | -h)\n    ac_init_help=long ;;\n  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)\n    ac_init_help=recursive ;;\n  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)\n    ac_init_help=short ;;\n\n  -host | --host | --hos | --ho)\n    ac_prev=host_alias ;;\n  -host=* | --host=* | --hos=* | --ho=*)\n    host_alias=$ac_optarg ;;\n\n  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)\n    ac_prev=htmldir ;;\n  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \\\n  | --ht=*)\n    htmldir=$ac_optarg ;;\n\n  -includedir | --includedir | --includedi | --included | --include \\\n  | --includ | --inclu | --incl | --inc)\n    ac_prev=includedir ;;\n  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \\\n  | --includ=* | --inclu=* | --incl=* | --inc=*)\n    includedir=$ac_optarg ;;\n\n  -infodir | --infodir | --infodi | --infod | --info | --inf)\n    ac_prev=infodir ;;\n  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)\n    infodir=$ac_optarg ;;\n\n  -libdir | --libdir | --libdi | --libd)\n    ac_prev=libdir ;;\n  -libdir=* | --libdir=* | --libdi=* | --libd=*)\n    libdir=$ac_optarg ;;\n\n  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \\\n  | --libexe | --libex | --libe)\n    ac_prev=libexecdir ;;\n  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \\\n  | --libexe=* | --libex=* | --libe=*)\n    libexecdir=$ac_optarg ;;\n\n  -localedir | --localedir | --localedi | --localed | --locale)\n    ac_prev=localedir ;;\n  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)\n    localedir=$ac_optarg ;;\n\n  -localstatedir | --localstatedir | --localstatedi | --localstated \\\n  | --localstate | --localstat | --localsta | --localst | --locals)\n    ac_prev=localstatedir ;;\n  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \\\n  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)\n    localstatedir=$ac_optarg ;;\n\n  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)\n    ac_prev=mandir ;;\n  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)\n    mandir=$ac_optarg ;;\n\n  -nfp | --nfp | --nf)\n    # Obsolete; use --without-fp.\n    with_fp=no ;;\n\n  -no-create | --no-create | --no-creat | --no-crea | --no-cre \\\n  | --no-cr | --no-c | -n)\n    no_create=yes ;;\n\n  -no-recursion | --no-recursion | --no-recursio | --no-recursi \\\n  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)\n    no_recursion=yes ;;\n\n  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \\\n  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \\\n  | --oldin | --oldi | --old | --ol | --o)\n    ac_prev=oldincludedir ;;\n  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \\\n  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \\\n  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)\n    oldincludedir=$ac_optarg ;;\n\n  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)\n    ac_prev=prefix ;;\n  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)\n    prefix=$ac_optarg ;;\n\n  -program-prefix | --program-prefix | --program-prefi | --program-pref \\\n  | --program-pre | --program-pr | --program-p)\n    ac_prev=program_prefix ;;\n  -program-prefix=* | --program-prefix=* | --program-prefi=* \\\n  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)\n    program_prefix=$ac_optarg ;;\n\n  -program-suffix | --program-suffix | --program-suffi | --program-suff \\\n  | --program-suf | --program-su | --program-s)\n    ac_prev=program_suffix ;;\n  -program-suffix=* | --program-suffix=* | --program-suffi=* \\\n  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)\n    program_suffix=$ac_optarg ;;\n\n  -program-transform-name | --program-transform-name \\\n  | --program-transform-nam | --program-transform-na \\\n  | --program-transform-n | --program-transform- \\\n  | --program-transform | --program-transfor \\\n  | --program-transfo | --program-transf \\\n  | --program-trans | --program-tran \\\n  | --progr-tra | --program-tr | --program-t)\n    ac_prev=program_transform_name ;;\n  -program-transform-name=* | --program-transform-name=* \\\n  | --program-transform-nam=* | --program-transform-na=* \\\n  | --program-transform-n=* | --program-transform-=* \\\n  | --program-transform=* | --program-transfor=* \\\n  | --program-transfo=* | --program-transf=* \\\n  | --program-trans=* | --program-tran=* \\\n  | --progr-tra=* | --program-tr=* | --program-t=*)\n    program_transform_name=$ac_optarg ;;\n\n  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)\n    ac_prev=pdfdir ;;\n  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)\n    pdfdir=$ac_optarg ;;\n\n  -psdir | --psdir | --psdi | --psd | --ps)\n    ac_prev=psdir ;;\n  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)\n    psdir=$ac_optarg ;;\n\n  -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n  | -silent | --silent | --silen | --sile | --sil)\n    silent=yes ;;\n\n  -runstatedir | --runstatedir | --runstatedi | --runstated \\\n  | --runstate | --runstat | --runsta | --runst | --runs \\\n  | --run | --ru | --r)\n    ac_prev=runstatedir ;;\n  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \\\n  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \\\n  | --run=* | --ru=* | --r=*)\n    runstatedir=$ac_optarg ;;\n\n  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)\n    ac_prev=sbindir ;;\n  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \\\n  | --sbi=* | --sb=*)\n    sbindir=$ac_optarg ;;\n\n  -sharedstatedir | --sharedstatedir | --sharedstatedi \\\n  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \\\n  | --sharedst | --shareds | --shared | --share | --shar \\\n  | --sha | --sh)\n    ac_prev=sharedstatedir ;;\n  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \\\n  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \\\n  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \\\n  | --sha=* | --sh=*)\n    sharedstatedir=$ac_optarg ;;\n\n  -site | --site | --sit)\n    ac_prev=site ;;\n  -site=* | --site=* | --sit=*)\n    site=$ac_optarg ;;\n\n  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)\n    ac_prev=srcdir ;;\n  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)\n    srcdir=$ac_optarg ;;\n\n  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \\\n  | --syscon | --sysco | --sysc | --sys | --sy)\n    ac_prev=sysconfdir ;;\n  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \\\n  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)\n    sysconfdir=$ac_optarg ;;\n\n  -target | --target | --targe | --targ | --tar | --ta | --t)\n    ac_prev=target_alias ;;\n  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)\n    target_alias=$ac_optarg ;;\n\n  -v | -verbose | --verbose | --verbos | --verbo | --verb)\n    verbose=yes ;;\n\n  -version | --version | --versio | --versi | --vers | -V)\n    ac_init_version=: ;;\n\n  -with-* | --with-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*with-\\([^=]*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid package name: \\`$ac_useropt'\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`printf \"%s\\n\" \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"with_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval with_$ac_useropt=\\$ac_optarg ;;\n\n  -without-* | --without-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*without-\\(.*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid package name: \\`$ac_useropt'\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`printf \"%s\\n\" \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"with_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval with_$ac_useropt=no ;;\n\n  --x)\n    # Obsolete; use --with-x.\n    with_x=yes ;;\n\n  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \\\n  | --x-incl | --x-inc | --x-in | --x-i)\n    ac_prev=x_includes ;;\n  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \\\n  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)\n    x_includes=$ac_optarg ;;\n\n  -x-libraries | --x-libraries | --x-librarie | --x-librari \\\n  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)\n    ac_prev=x_libraries ;;\n  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \\\n  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)\n    x_libraries=$ac_optarg ;;\n\n  -*) as_fn_error $? \"unrecognized option: \\`$ac_option'\nTry \\`$0 --help' for more information\"\n    ;;\n\n  *=*)\n    ac_envvar=`expr \"x$ac_option\" : 'x\\([^=]*\\)='`\n    # Reject names that are not valid shell variable names.\n    case $ac_envvar in #(\n      '' | [0-9]* | *[!_$as_cr_alnum]* )\n      as_fn_error $? \"invalid variable name: \\`$ac_envvar'\" ;;\n    esac\n    eval $ac_envvar=\\$ac_optarg\n    export $ac_envvar ;;\n\n  *)\n    # FIXME: should be removed in autoconf 3.0.\n    printf \"%s\\n\" \"$as_me: WARNING: you should use --build, --host, --target\" >&2\n    expr \"x$ac_option\" : \".*[^-._$as_cr_alnum]\" >/dev/null &&\n      printf \"%s\\n\" \"$as_me: WARNING: invalid host type: $ac_option\" >&2\n    : \"${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}\"\n    ;;\n\n  esac\ndone\n\nif test -n \"$ac_prev\"; then\n  ac_option=--`echo $ac_prev | sed 's/_/-/g'`\n  as_fn_error $? \"missing argument to $ac_option\"\nfi\n\nif test -n \"$ac_unrecognized_opts\"; then\n  case $enable_option_checking in\n    no) ;;\n    fatal) as_fn_error $? \"unrecognized options: $ac_unrecognized_opts\" ;;\n    *)     printf \"%s\\n\" \"$as_me: WARNING: unrecognized options: $ac_unrecognized_opts\" >&2 ;;\n  esac\nfi\n\n# Check all directory arguments for consistency.\nfor ac_var in\texec_prefix prefix bindir sbindir libexecdir datarootdir \\\n\t\tdatadir sysconfdir sharedstatedir localstatedir includedir \\\n\t\toldincludedir docdir infodir htmldir dvidir pdfdir psdir \\\n\t\tlibdir localedir mandir runstatedir\ndo\n  eval ac_val=\\$$ac_var\n  # Remove trailing slashes.\n  case $ac_val in\n    */ )\n      ac_val=`expr \"X$ac_val\" : 'X\\(.*[^/]\\)' \\| \"X$ac_val\" : 'X\\(.*\\)'`\n      eval $ac_var=\\$ac_val;;\n  esac\n  # Be sure to have absolute directory names.\n  case $ac_val in\n    [\\\\/$]* | ?:[\\\\/]* )  continue;;\n    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;\n  esac\n  as_fn_error $? \"expected an absolute directory name for --$ac_var: $ac_val\"\ndone\n\n# There might be people who depend on the old broken behavior: `$host'\n# used to hold the argument of --host etc.\n# FIXME: To remove some day.\nbuild=$build_alias\nhost=$host_alias\ntarget=$target_alias\n\n# FIXME: To remove some day.\nif test \"x$host_alias\" != x; then\n  if test \"x$build_alias\" = x; then\n    cross_compiling=maybe\n  elif test \"x$build_alias\" != \"x$host_alias\"; then\n    cross_compiling=yes\n  fi\nfi\n\nac_tool_prefix=\ntest -n \"$host_alias\" && ac_tool_prefix=$host_alias-\n\ntest \"$silent\" = yes && exec 6>/dev/null\n\n\nac_pwd=`pwd` && test -n \"$ac_pwd\" &&\nac_ls_di=`ls -di .` &&\nac_pwd_ls_di=`cd \"$ac_pwd\" && ls -di .` ||\n  as_fn_error $? \"working directory cannot be determined\"\ntest \"X$ac_ls_di\" = \"X$ac_pwd_ls_di\" ||\n  as_fn_error $? \"pwd does not report name of working directory\"\n\n\n# Find the source files, if location was not specified.\nif test -z \"$srcdir\"; then\n  ac_srcdir_defaulted=yes\n  # Try the directory containing this script, then the parent directory.\n  ac_confdir=`$as_dirname -- \"$as_myself\" ||\n$as_expr X\"$as_myself\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_myself\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_myself\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_myself\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X\"$as_myself\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n  srcdir=$ac_confdir\n  if test ! -r \"$srcdir/$ac_unique_file\"; then\n    srcdir=..\n  fi\nelse\n  ac_srcdir_defaulted=no\nfi\nif test ! -r \"$srcdir/$ac_unique_file\"; then\n  test \"$ac_srcdir_defaulted\" = yes && srcdir=\"$ac_confdir or ..\"\n  as_fn_error $? \"cannot find sources ($ac_unique_file) in $srcdir\"\nfi\nac_msg=\"sources are in $srcdir, but \\`cd $srcdir' does not work\"\nac_abs_confdir=`(\n\tcd \"$srcdir\" && test -r \"./$ac_unique_file\" || as_fn_error $? \"$ac_msg\"\n\tpwd)`\n# When building in place, set srcdir=.\nif test \"$ac_abs_confdir\" = \"$ac_pwd\"; then\n  srcdir=.\nfi\n# Remove unnecessary trailing slashes from srcdir.\n# Double slashes in file names in object file debugging info\n# mess up M-x gdb in Emacs.\ncase $srcdir in\n*/) srcdir=`expr \"X$srcdir\" : 'X\\(.*[^/]\\)' \\| \"X$srcdir\" : 'X\\(.*\\)'`;;\nesac\nfor ac_var in $ac_precious_vars; do\n  eval ac_env_${ac_var}_set=\\${${ac_var}+set}\n  eval ac_env_${ac_var}_value=\\$${ac_var}\n  eval ac_cv_env_${ac_var}_set=\\${${ac_var}+set}\n  eval ac_cv_env_${ac_var}_value=\\$${ac_var}\ndone\n\n#\n# Report the --help message.\n#\nif test \"$ac_init_help\" = \"long\"; then\n  # Omit some internal or obsolete options to make the list less imposing.\n  # This message is too long to be a string in the A/UX 3.1 sh.\n  cat <<_ACEOF\n\\`configure' configures rufus 4.14 to adapt to many kinds of systems.\n\nUsage: $0 [OPTION]... [VAR=VALUE]...\n\nTo assign environment variables (e.g., CC, CFLAGS...), specify them as\nVAR=VALUE.  See below for descriptions of some of the useful variables.\n\nDefaults for the options are specified in brackets.\n\nConfiguration:\n  -h, --help              display this help and exit\n      --help=short        display options specific to this package\n      --help=recursive    display the short help of all the included packages\n  -V, --version           display version information and exit\n  -q, --quiet, --silent   do not print \\`checking ...' messages\n      --cache-file=FILE   cache test results in FILE [disabled]\n  -C, --config-cache      alias for \\`--cache-file=config.cache'\n  -n, --no-create         do not create output files\n      --srcdir=DIR        find the sources in DIR [configure dir or \\`..']\n\nInstallation directories:\n  --prefix=PREFIX         install architecture-independent files in PREFIX\n                          [$ac_default_prefix]\n  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX\n                          [PREFIX]\n\nBy default, \\`make install' will install all the files in\n\\`$ac_default_prefix/bin', \\`$ac_default_prefix/lib' etc.  You can specify\nan installation prefix other than \\`$ac_default_prefix' using \\`--prefix',\nfor instance \\`--prefix=\\$HOME'.\n\nFor better control, use the options below.\n\nFine tuning of the installation directories:\n  --bindir=DIR            user executables [EPREFIX/bin]\n  --sbindir=DIR           system admin executables [EPREFIX/sbin]\n  --libexecdir=DIR        program executables [EPREFIX/libexec]\n  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]\n  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]\n  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]\n  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]\n  --libdir=DIR            object code libraries [EPREFIX/lib]\n  --includedir=DIR        C header files [PREFIX/include]\n  --oldincludedir=DIR     C header files for non-gcc [/usr/include]\n  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]\n  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]\n  --infodir=DIR           info documentation [DATAROOTDIR/info]\n  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]\n  --mandir=DIR            man documentation [DATAROOTDIR/man]\n  --docdir=DIR            documentation root [DATAROOTDIR/doc/rufus]\n  --htmldir=DIR           html documentation [DOCDIR]\n  --dvidir=DIR            dvi documentation [DOCDIR]\n  --pdfdir=DIR            pdf documentation [DOCDIR]\n  --psdir=DIR             ps documentation [DOCDIR]\n_ACEOF\n\n  cat <<\\_ACEOF\n\nProgram names:\n  --program-prefix=PREFIX            prepend PREFIX to installed program names\n  --program-suffix=SUFFIX            append SUFFIX to installed program names\n  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names\n_ACEOF\nfi\n\nif test -n \"$ac_init_help\"; then\n  case $ac_init_help in\n     short | recursive ) echo \"Configuration of rufus 4.14:\";;\n   esac\n  cat <<\\_ACEOF\n\nOptional Features:\n  --disable-option-checking  ignore unrecognized --enable/--with options\n  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)\n  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]\n  --enable-silent-rules   less verbose build output (undo: \"make V=1\")\n  --disable-silent-rules  verbose build output (undo: \"make V=0\")\n  --enable-debug          keep debug symbols for gdb (default=yes)\n  --enable-alpha          build an ALPHA release (default=no)\n  --enable-beta           build a BETA release (default=no)\n  --enable-test=#         build a TEST release (default=no)\n\nSome influential environment variables:\n  CC          C compiler command\n  CFLAGS      C compiler flags\n  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a\n              nonstandard directory <lib dir>\n  LIBS        libraries to pass to the linker, e.g. -l<library>\n  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if\n              you have headers in a nonstandard directory <include dir>\n\nUse these variables to override the choices made by `configure' or to help\nit to find libraries and programs with nonstandard names/locations.\n\nReport bugs to <https://github.com/pbatard/rufus/issues>.\nrufus home page: <https://rufus.ie>.\n_ACEOF\nac_status=$?\nfi\n\nif test \"$ac_init_help\" = \"recursive\"; then\n  # If there are subdirs, report their specific --help.\n  for ac_dir in : $ac_subdirs_all; do test \"x$ac_dir\" = x: && continue\n    test -d \"$ac_dir\" ||\n      { cd \"$srcdir\" && ac_pwd=`pwd` && srcdir=. && test -d \"$ac_dir\"; } ||\n      continue\n    ac_builddir=.\n\ncase \"$ac_dir\" in\n.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;\n*)\n  ac_dir_suffix=/`printf \"%s\\n\" \"$ac_dir\" | sed 's|^\\.[\\\\/]||'`\n  # A \"..\" for each directory in $ac_dir_suffix.\n  ac_top_builddir_sub=`printf \"%s\\n\" \"$ac_dir_suffix\" | sed 's|/[^\\\\/]*|/..|g;s|/||'`\n  case $ac_top_builddir_sub in\n  \"\") ac_top_builddir_sub=. ac_top_build_prefix= ;;\n  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;\n  esac ;;\nesac\nac_abs_top_builddir=$ac_pwd\nac_abs_builddir=$ac_pwd$ac_dir_suffix\n# for backward compatibility:\nac_top_builddir=$ac_top_build_prefix\n\ncase $srcdir in\n  .)  # We are building in place.\n    ac_srcdir=.\n    ac_top_srcdir=$ac_top_builddir_sub\n    ac_abs_top_srcdir=$ac_pwd ;;\n  [\\\\/]* | ?:[\\\\/]* )  # Absolute name.\n    ac_srcdir=$srcdir$ac_dir_suffix;\n    ac_top_srcdir=$srcdir\n    ac_abs_top_srcdir=$srcdir ;;\n  *) # Relative name.\n    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix\n    ac_top_srcdir=$ac_top_build_prefix$srcdir\n    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;\nesac\nac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix\n\n    cd \"$ac_dir\" || { ac_status=$?; continue; }\n    # Check for configure.gnu first; this name is used for a wrapper for\n    # Metaconfig's \"Configure\" on case-insensitive file systems.\n    if test -f \"$ac_srcdir/configure.gnu\"; then\n      echo &&\n      $SHELL \"$ac_srcdir/configure.gnu\" --help=recursive\n    elif test -f \"$ac_srcdir/configure\"; then\n      echo &&\n      $SHELL \"$ac_srcdir/configure\" --help=recursive\n    else\n      printf \"%s\\n\" \"$as_me: WARNING: no configuration information is in $ac_dir\" >&2\n    fi || ac_status=$?\n    cd \"$ac_pwd\" || { ac_status=$?; break; }\n  done\nfi\n\ntest -n \"$ac_init_help\" && exit $ac_status\nif $ac_init_version; then\n  cat <<\\_ACEOF\nrufus configure 4.14\ngenerated by GNU Autoconf 2.71\n\nCopyright (C) 2021 Free Software Foundation, Inc.\nThis configure script is free software; the Free Software Foundation\ngives unlimited permission to copy, distribute and modify it.\n_ACEOF\n  exit\nfi\n\n## ------------------------ ##\n## Autoconf initialization. ##\n## ------------------------ ##\n\n# ac_fn_c_try_compile LINENO\n# --------------------------\n# Try to compile conftest.$ac_ext, and return whether this succeeded.\nac_fn_c_try_compile ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  rm -f conftest.$ac_objext conftest.beam\n  if { { ac_try=\"$ac_compile\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compile\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    grep -v '^ *+' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n    mv -f conftest.er1 conftest.err\n  fi\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && {\n\t test -z \"$ac_c_werror_flag\" ||\n\t test ! -s conftest.err\n       } && test -s conftest.$ac_objext\nthen :\n  ac_retval=0\nelse $as_nop\n  printf \"%s\\n\" \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n\tac_retval=1\nfi\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_compile\nac_configure_args_raw=\nfor ac_arg\ndo\n  case $ac_arg in\n  *\\'*)\n    ac_arg=`printf \"%s\\n\" \"$ac_arg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n  esac\n  as_fn_append ac_configure_args_raw \" '$ac_arg'\"\ndone\n\ncase $ac_configure_args_raw in\n  *$as_nl*)\n    ac_safe_unquote= ;;\n  *)\n    ac_unsafe_z='|&;<>()$`\\\\\"*?[ ''\t' # This string ends in space, tab.\n    ac_unsafe_a=\"$ac_unsafe_z#~\"\n    ac_safe_unquote=\"s/ '\\\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\\\)'/ \\\\1/g\"\n    ac_configure_args_raw=`      printf \"%s\\n\" \"$ac_configure_args_raw\" | sed \"$ac_safe_unquote\"`;;\nesac\n\ncat >config.log <<_ACEOF\nThis file contains any messages produced by compilers while\nrunning configure, to aid debugging if configure makes a mistake.\n\nIt was created by rufus $as_me 4.14, which was\ngenerated by GNU Autoconf 2.71.  Invocation command line was\n\n  $ $0$ac_configure_args_raw\n\n_ACEOF\nexec 5>>config.log\n{\ncat <<_ASUNAME\n## --------- ##\n## Platform. ##\n## --------- ##\n\nhostname = `(hostname || uname -n) 2>/dev/null | sed 1q`\nuname -m = `(uname -m) 2>/dev/null || echo unknown`\nuname -r = `(uname -r) 2>/dev/null || echo unknown`\nuname -s = `(uname -s) 2>/dev/null || echo unknown`\nuname -v = `(uname -v) 2>/dev/null || echo unknown`\n\n/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`\n/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`\n\n/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`\n/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`\n/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`\n/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`\n/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`\n/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`\n/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`\n\n_ASUNAME\n\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    printf \"%s\\n\" \"PATH: $as_dir\"\n  done\nIFS=$as_save_IFS\n\n} >&5\n\ncat >&5 <<_ACEOF\n\n\n## ----------- ##\n## Core tests. ##\n## ----------- ##\n\n_ACEOF\n\n\n# Keep a trace of the command line.\n# Strip out --no-create and --no-recursion so they do not pile up.\n# Strip out --silent because we don't want to record it for future runs.\n# Also quote any args containing shell meta-characters.\n# Make two passes to allow for proper duplicate-argument suppression.\nac_configure_args=\nac_configure_args0=\nac_configure_args1=\nac_must_keep_next=false\nfor ac_pass in 1 2\ndo\n  for ac_arg\n  do\n    case $ac_arg in\n    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;\n    -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n    | -silent | --silent | --silen | --sile | --sil)\n      continue ;;\n    *\\'*)\n      ac_arg=`printf \"%s\\n\" \"$ac_arg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    esac\n    case $ac_pass in\n    1) as_fn_append ac_configure_args0 \" '$ac_arg'\" ;;\n    2)\n      as_fn_append ac_configure_args1 \" '$ac_arg'\"\n      if test $ac_must_keep_next = true; then\n\tac_must_keep_next=false # Got value, back to normal.\n      else\n\tcase $ac_arg in\n\t  *=* | --config-cache | -C | -disable-* | --disable-* \\\n\t  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \\\n\t  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \\\n\t  | -with-* | --with-* | -without-* | --without-* | --x)\n\t    case \"$ac_configure_args0 \" in\n\t      \"$ac_configure_args1\"*\" '$ac_arg' \"* ) continue ;;\n\t    esac\n\t    ;;\n\t  -* ) ac_must_keep_next=true ;;\n\tesac\n      fi\n      as_fn_append ac_configure_args \" '$ac_arg'\"\n      ;;\n    esac\n  done\ndone\n{ ac_configure_args0=; unset ac_configure_args0;}\n{ ac_configure_args1=; unset ac_configure_args1;}\n\n# When interrupted or exit'd, cleanup temporary files, and complete\n# config.log.  We remove comments because anyway the quotes in there\n# would cause problems or look ugly.\n# WARNING: Use '\\'' to represent an apostrophe within the trap.\n# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.\ntrap 'exit_status=$?\n  # Sanitize IFS.\n  IFS=\" \"\"\t$as_nl\"\n  # Save into config.log some information that might help in debugging.\n  {\n    echo\n\n    printf \"%s\\n\" \"## ---------------- ##\n## Cache variables. ##\n## ---------------- ##\"\n    echo\n    # The following way of writing the cache mishandles newlines in values,\n(\n  for ac_var in `(set) 2>&1 | sed -n '\\''s/^\\([a-zA-Z_][a-zA-Z0-9_]*\\)=.*/\\1/p'\\''`; do\n    eval ac_val=\\$$ac_var\n    case $ac_val in #(\n    *${as_nl}*)\n      case $ac_var in #(\n      *_cv_*) { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: cache variable $ac_var contains a newline\" >&2;} ;;\n      esac\n      case $ac_var in #(\n      _ | IFS | as_nl) ;; #(\n      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(\n      *) { eval $ac_var=; unset $ac_var;} ;;\n      esac ;;\n    esac\n  done\n  (set) 2>&1 |\n    case $as_nl`(ac_space='\\'' '\\''; set) 2>&1` in #(\n    *${as_nl}ac_space=\\ *)\n      sed -n \\\n\t\"s/'\\''/'\\''\\\\\\\\'\\'''\\''/g;\n\t  s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1='\\''\\\\2'\\''/p\"\n      ;; #(\n    *)\n      sed -n \"/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p\"\n      ;;\n    esac |\n    sort\n)\n    echo\n\n    printf \"%s\\n\" \"## ----------------- ##\n## Output variables. ##\n## ----------------- ##\"\n    echo\n    for ac_var in $ac_subst_vars\n    do\n      eval ac_val=\\$$ac_var\n      case $ac_val in\n      *\\'\\''*) ac_val=`printf \"%s\\n\" \"$ac_val\" | sed \"s/'\\''/'\\''\\\\\\\\\\\\\\\\'\\'''\\''/g\"`;;\n      esac\n      printf \"%s\\n\" \"$ac_var='\\''$ac_val'\\''\"\n    done | sort\n    echo\n\n    if test -n \"$ac_subst_files\"; then\n      printf \"%s\\n\" \"## ------------------- ##\n## File substitutions. ##\n## ------------------- ##\"\n      echo\n      for ac_var in $ac_subst_files\n      do\n\teval ac_val=\\$$ac_var\n\tcase $ac_val in\n\t*\\'\\''*) ac_val=`printf \"%s\\n\" \"$ac_val\" | sed \"s/'\\''/'\\''\\\\\\\\\\\\\\\\'\\'''\\''/g\"`;;\n\tesac\n\tprintf \"%s\\n\" \"$ac_var='\\''$ac_val'\\''\"\n      done | sort\n      echo\n    fi\n\n    if test -s confdefs.h; then\n      printf \"%s\\n\" \"## ----------- ##\n## confdefs.h. ##\n## ----------- ##\"\n      echo\n      cat confdefs.h\n      echo\n    fi\n    test \"$ac_signal\" != 0 &&\n      printf \"%s\\n\" \"$as_me: caught signal $ac_signal\"\n    printf \"%s\\n\" \"$as_me: exit $exit_status\"\n  } >&5\n  rm -f core *.core core.conftest.* &&\n    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&\n    exit $exit_status\n' 0\nfor ac_signal in 1 2 13 15; do\n  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal\ndone\nac_signal=0\n\n# confdefs.h avoids OS command line length limits that DEFS can exceed.\nrm -f -r conftest* confdefs.h\n\nprintf \"%s\\n\" \"/* confdefs.h */\" > confdefs.h\n\n# Predefined preprocessor variables.\n\nprintf \"%s\\n\" \"#define PACKAGE_NAME \\\"$PACKAGE_NAME\\\"\" >>confdefs.h\n\nprintf \"%s\\n\" \"#define PACKAGE_TARNAME \\\"$PACKAGE_TARNAME\\\"\" >>confdefs.h\n\nprintf \"%s\\n\" \"#define PACKAGE_VERSION \\\"$PACKAGE_VERSION\\\"\" >>confdefs.h\n\nprintf \"%s\\n\" \"#define PACKAGE_STRING \\\"$PACKAGE_STRING\\\"\" >>confdefs.h\n\nprintf \"%s\\n\" \"#define PACKAGE_BUGREPORT \\\"$PACKAGE_BUGREPORT\\\"\" >>confdefs.h\n\nprintf \"%s\\n\" \"#define PACKAGE_URL \\\"$PACKAGE_URL\\\"\" >>confdefs.h\n\n\n# Let the site file select an alternate cache file if it wants to.\n# Prefer an explicitly selected file to automatically selected ones.\nif test -n \"$CONFIG_SITE\"; then\n  ac_site_files=\"$CONFIG_SITE\"\nelif test \"x$prefix\" != xNONE; then\n  ac_site_files=\"$prefix/share/config.site $prefix/etc/config.site\"\nelse\n  ac_site_files=\"$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site\"\nfi\n\nfor ac_site_file in $ac_site_files\ndo\n  case $ac_site_file in #(\n  */*) :\n     ;; #(\n  *) :\n    ac_site_file=./$ac_site_file ;;\nesac\n  if test -f \"$ac_site_file\" && test -r \"$ac_site_file\"; then\n    { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file\" >&5\nprintf \"%s\\n\" \"$as_me: loading site script $ac_site_file\" >&6;}\n    sed 's/^/| /' \"$ac_site_file\" >&5\n    . \"$ac_site_file\" \\\n      || { { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"failed to load site script $ac_site_file\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\n  fi\ndone\n\nif test -r \"$cache_file\"; then\n  # Some versions of bash will fail to source /dev/null (special files\n  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.\n  if test /dev/null != \"$cache_file\" && test -f \"$cache_file\"; then\n    { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: loading cache $cache_file\" >&5\nprintf \"%s\\n\" \"$as_me: loading cache $cache_file\" >&6;}\n    case $cache_file in\n      [\\\\/]* | ?:[\\\\/]* ) . \"$cache_file\";;\n      *)                      . \"./$cache_file\";;\n    esac\n  fi\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: creating cache $cache_file\" >&5\nprintf \"%s\\n\" \"$as_me: creating cache $cache_file\" >&6;}\n  >$cache_file\nfi\n\n# Test code for whether the C compiler supports C89 (global declarations)\nac_c_conftest_c89_globals='\n/* Does the compiler advertise C89 conformance?\n   Do not test the value of __STDC__, because some compilers set it to 0\n   while being otherwise adequately conformant. */\n#if !defined __STDC__\n# error \"Compiler does not advertise C89 conformance\"\n#endif\n\n#include <stddef.h>\n#include <stdarg.h>\nstruct stat;\n/* Most of the following tests are stolen from RCS 5.7 src/conf.sh.  */\nstruct buf { int x; };\nstruct buf * (*rcsopen) (struct buf *, struct stat *, int);\nstatic char *e (char **p, int i)\n{\n  return p[i];\n}\nstatic char *f (char * (*g) (char **, int), char **p, ...)\n{\n  char *s;\n  va_list v;\n  va_start (v,p);\n  s = g (p, va_arg (v,int));\n  va_end (v);\n  return s;\n}\n\n/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has\n   function prototypes and stuff, but not \\xHH hex character constants.\n   These do not provoke an error unfortunately, instead are silently treated\n   as an \"x\".  The following induces an error, until -std is added to get\n   proper ANSI mode.  Curiously \\x00 != x always comes out true, for an\n   array size at least.  It is necessary to write \\x00 == 0 to get something\n   that is true only with -std.  */\nint osf4_cc_array ['\\''\\x00'\\'' == 0 ? 1 : -1];\n\n/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters\n   inside strings and character constants.  */\n#define FOO(x) '\\''x'\\''\nint xlc6_cc_array[FOO(a) == '\\''x'\\'' ? 1 : -1];\n\nint test (int i, double x);\nstruct s1 {int (*f) (int a);};\nstruct s2 {int (*f) (double a);};\nint pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),\n               int, int);'\n\n# Test code for whether the C compiler supports C89 (body of main).\nac_c_conftest_c89_main='\nok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);\n'\n\n# Test code for whether the C compiler supports C99 (global declarations)\nac_c_conftest_c99_globals='\n// Does the compiler advertise C99 conformance?\n#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L\n# error \"Compiler does not advertise C99 conformance\"\n#endif\n\n#include <stdbool.h>\nextern int puts (const char *);\nextern int printf (const char *, ...);\nextern int dprintf (int, const char *, ...);\nextern void *malloc (size_t);\nextern void free (void *);\n\n// Check varargs macros.  These examples are taken from C99 6.10.3.5.\n// dprintf is used instead of fprintf to avoid needing to declare\n// FILE and stderr.\n#define debug(...) dprintf (2, __VA_ARGS__)\n#define showlist(...) puts (#__VA_ARGS__)\n#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))\nstatic void\ntest_varargs_macros (void)\n{\n  int x = 1234;\n  int y = 5678;\n  debug (\"Flag\");\n  debug (\"X = %d\\n\", x);\n  showlist (The first, second, and third items.);\n  report (x>y, \"x is %d but y is %d\", x, y);\n}\n\n// Check long long types.\n#define BIG64 18446744073709551615ull\n#define BIG32 4294967295ul\n#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)\n#if !BIG_OK\n  #error \"your preprocessor is broken\"\n#endif\n#if BIG_OK\n#else\n  #error \"your preprocessor is broken\"\n#endif\nstatic long long int bignum = -9223372036854775807LL;\nstatic unsigned long long int ubignum = BIG64;\n\nstruct incomplete_array\n{\n  int datasize;\n  double data[];\n};\n\nstruct named_init {\n  int number;\n  const wchar_t *name;\n  double average;\n};\n\ntypedef const char *ccp;\n\nstatic inline int\ntest_restrict (ccp restrict text)\n{\n  // See if C++-style comments work.\n  // Iterate through items via the restricted pointer.\n  // Also check for declarations in for loops.\n  for (unsigned int i = 0; *(text+i) != '\\''\\0'\\''; ++i)\n    continue;\n  return 0;\n}\n\n// Check varargs and va_copy.\nstatic bool\ntest_varargs (const char *format, ...)\n{\n  va_list args;\n  va_start (args, format);\n  va_list args_copy;\n  va_copy (args_copy, args);\n\n  const char *str = \"\";\n  int number = 0;\n  float fnumber = 0;\n\n  while (*format)\n    {\n      switch (*format++)\n\t{\n\tcase '\\''s'\\'': // string\n\t  str = va_arg (args_copy, const char *);\n\t  break;\n\tcase '\\''d'\\'': // int\n\t  number = va_arg (args_copy, int);\n\t  break;\n\tcase '\\''f'\\'': // float\n\t  fnumber = va_arg (args_copy, double);\n\t  break;\n\tdefault:\n\t  break;\n\t}\n    }\n  va_end (args_copy);\n  va_end (args);\n\n  return *str && number && fnumber;\n}\n'\n\n# Test code for whether the C compiler supports C99 (body of main).\nac_c_conftest_c99_main='\n  // Check bool.\n  _Bool success = false;\n  success |= (argc != 0);\n\n  // Check restrict.\n  if (test_restrict (\"String literal\") == 0)\n    success = true;\n  char *restrict newvar = \"Another string\";\n\n  // Check varargs.\n  success &= test_varargs (\"s, d'\\'' f .\", \"string\", 65, 34.234);\n  test_varargs_macros ();\n\n  // Check flexible array members.\n  struct incomplete_array *ia =\n    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));\n  ia->datasize = 10;\n  for (int i = 0; i < ia->datasize; ++i)\n    ia->data[i] = i * 1.234;\n\n  // Check named initializers.\n  struct named_init ni = {\n    .number = 34,\n    .name = L\"Test wide string\",\n    .average = 543.34343,\n  };\n\n  ni.number = 58;\n\n  int dynamic_array[ni.number];\n  dynamic_array[0] = argv[0][0];\n  dynamic_array[ni.number - 1] = 543;\n\n  // work around unused variable warnings\n  ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\\''x'\\''\n\t || dynamic_array[ni.number - 1] != 543);\n'\n\n# Test code for whether the C compiler supports C11 (global declarations)\nac_c_conftest_c11_globals='\n// Does the compiler advertise C11 conformance?\n#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L\n# error \"Compiler does not advertise C11 conformance\"\n#endif\n\n// Check _Alignas.\nchar _Alignas (double) aligned_as_double;\nchar _Alignas (0) no_special_alignment;\nextern char aligned_as_int;\nchar _Alignas (0) _Alignas (int) aligned_as_int;\n\n// Check _Alignof.\nenum\n{\n  int_alignment = _Alignof (int),\n  int_array_alignment = _Alignof (int[100]),\n  char_alignment = _Alignof (char)\n};\n_Static_assert (0 < -_Alignof (int), \"_Alignof is signed\");\n\n// Check _Noreturn.\nint _Noreturn does_not_return (void) { for (;;) continue; }\n\n// Check _Static_assert.\nstruct test_static_assert\n{\n  int x;\n  _Static_assert (sizeof (int) <= sizeof (long int),\n                  \"_Static_assert does not work in struct\");\n  long int y;\n};\n\n// Check UTF-8 literals.\n#define u8 syntax error!\nchar const utf8_literal[] = u8\"happens to be ASCII\" \"another string\";\n\n// Check duplicate typedefs.\ntypedef long *long_ptr;\ntypedef long int *long_ptr;\ntypedef long_ptr long_ptr;\n\n// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.\nstruct anonymous\n{\n  union {\n    struct { int i; int j; };\n    struct { int k; long int l; } w;\n  };\n  int m;\n} v1;\n'\n\n# Test code for whether the C compiler supports C11 (body of main).\nac_c_conftest_c11_main='\n  _Static_assert ((offsetof (struct anonymous, i)\n\t\t   == offsetof (struct anonymous, w.k)),\n\t\t  \"Anonymous union alignment botch\");\n  v1.i = 2;\n  v1.w.k = 5;\n  ok |= v1.i != 5;\n'\n\n# Test code for whether the C compiler supports C11 (complete).\nac_c_conftest_c11_program=\"${ac_c_conftest_c89_globals}\n${ac_c_conftest_c99_globals}\n${ac_c_conftest_c11_globals}\n\nint\nmain (int argc, char **argv)\n{\n  int ok = 0;\n  ${ac_c_conftest_c89_main}\n  ${ac_c_conftest_c99_main}\n  ${ac_c_conftest_c11_main}\n  return ok;\n}\n\"\n\n# Test code for whether the C compiler supports C99 (complete).\nac_c_conftest_c99_program=\"${ac_c_conftest_c89_globals}\n${ac_c_conftest_c99_globals}\n\nint\nmain (int argc, char **argv)\n{\n  int ok = 0;\n  ${ac_c_conftest_c89_main}\n  ${ac_c_conftest_c99_main}\n  return ok;\n}\n\"\n\n# Test code for whether the C compiler supports C89 (complete).\nac_c_conftest_c89_program=\"${ac_c_conftest_c89_globals}\n\nint\nmain (int argc, char **argv)\n{\n  int ok = 0;\n  ${ac_c_conftest_c89_main}\n  return ok;\n}\n\"\n\n\n# Auxiliary files required by this configure script.\nac_aux_files=\"compile missing install-sh\"\n\n# Locations in which to look for auxiliary files.\nac_aux_dir_candidates=\"${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../..\"\n\n# Search for a directory containing all of the required auxiliary files,\n# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.\n# If we don't find one directory that contains all the files we need,\n# we report the set of missing files from the *first* directory in\n# $ac_aux_dir_candidates and give up.\nac_missing_aux_files=\"\"\nac_first_candidate=:\nprintf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files\" >&5\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nas_found=false\nfor as_dir in $ac_aux_dir_candidates\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n  as_found=:\n\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:  trying $as_dir\" >&5\n  ac_aux_dir_found=yes\n  ac_install_sh=\n  for ac_aux in $ac_aux_files\n  do\n    # As a special case, if \"install-sh\" is required, that requirement\n    # can be satisfied by any of \"install-sh\", \"install.sh\", or \"shtool\",\n    # and $ac_install_sh is set appropriately for whichever one is found.\n    if test x\"$ac_aux\" = x\"install-sh\"\n    then\n      if test -f \"${as_dir}install-sh\"; then\n        printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   ${as_dir}install-sh found\" >&5\n        ac_install_sh=\"${as_dir}install-sh -c\"\n      elif test -f \"${as_dir}install.sh\"; then\n        printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   ${as_dir}install.sh found\" >&5\n        ac_install_sh=\"${as_dir}install.sh -c\"\n      elif test -f \"${as_dir}shtool\"; then\n        printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   ${as_dir}shtool found\" >&5\n        ac_install_sh=\"${as_dir}shtool install -c\"\n      else\n        ac_aux_dir_found=no\n        if $ac_first_candidate; then\n          ac_missing_aux_files=\"${ac_missing_aux_files} install-sh\"\n        else\n          break\n        fi\n      fi\n    else\n      if test -f \"${as_dir}${ac_aux}\"; then\n        printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   ${as_dir}${ac_aux} found\" >&5\n      else\n        ac_aux_dir_found=no\n        if $ac_first_candidate; then\n          ac_missing_aux_files=\"${ac_missing_aux_files} ${ac_aux}\"\n        else\n          break\n        fi\n      fi\n    fi\n  done\n  if test \"$ac_aux_dir_found\" = yes; then\n    ac_aux_dir=\"$as_dir\"\n    break\n  fi\n  ac_first_candidate=false\n\n  as_found=false\ndone\nIFS=$as_save_IFS\nif $as_found\nthen :\n\nelse $as_nop\n  as_fn_error $? \"cannot find required auxiliary files:$ac_missing_aux_files\" \"$LINENO\" 5\nfi\n\n\n# These three variables are undocumented and unsupported,\n# and are intended to be withdrawn in a future Autoconf release.\n# They can cause serious problems if a builder's source tree is in a directory\n# whose full name contains unusual characters.\nif test -f \"${ac_aux_dir}config.guess\"; then\n  ac_config_guess=\"$SHELL ${ac_aux_dir}config.guess\"\nfi\nif test -f \"${ac_aux_dir}config.sub\"; then\n  ac_config_sub=\"$SHELL ${ac_aux_dir}config.sub\"\nfi\nif test -f \"$ac_aux_dir/configure\"; then\n  ac_configure=\"$SHELL ${ac_aux_dir}configure\"\nfi\n\n# Check that the precious variables saved in the cache have kept the same\n# value.\nac_cache_corrupted=false\nfor ac_var in $ac_precious_vars; do\n  eval ac_old_set=\\$ac_cv_env_${ac_var}_set\n  eval ac_new_set=\\$ac_env_${ac_var}_set\n  eval ac_old_val=\\$ac_cv_env_${ac_var}_value\n  eval ac_new_val=\\$ac_env_${ac_var}_value\n  case $ac_old_set,$ac_new_set in\n    set,)\n      { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: \\`$ac_var' was set to \\`$ac_old_val' in the previous run\" >&5\nprintf \"%s\\n\" \"$as_me: error: \\`$ac_var' was set to \\`$ac_old_val' in the previous run\" >&2;}\n      ac_cache_corrupted=: ;;\n    ,set)\n      { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: \\`$ac_var' was not set in the previous run\" >&5\nprintf \"%s\\n\" \"$as_me: error: \\`$ac_var' was not set in the previous run\" >&2;}\n      ac_cache_corrupted=: ;;\n    ,);;\n    *)\n      if test \"x$ac_old_val\" != \"x$ac_new_val\"; then\n\t# differences in whitespace do not lead to failure.\n\tac_old_val_w=`echo x $ac_old_val`\n\tac_new_val_w=`echo x $ac_new_val`\n\tif test \"$ac_old_val_w\" != \"$ac_new_val_w\"; then\n\t  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: \\`$ac_var' has changed since the previous run:\" >&5\nprintf \"%s\\n\" \"$as_me: error: \\`$ac_var' has changed since the previous run:\" >&2;}\n\t  ac_cache_corrupted=:\n\telse\n\t  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \\`$ac_var' since the previous run:\" >&5\nprintf \"%s\\n\" \"$as_me: warning: ignoring whitespace changes in \\`$ac_var' since the previous run:\" >&2;}\n\t  eval $ac_var=\\$ac_old_val\n\tfi\n\t{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   former value:  \\`$ac_old_val'\" >&5\nprintf \"%s\\n\" \"$as_me:   former value:  \\`$ac_old_val'\" >&2;}\n\t{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   current value: \\`$ac_new_val'\" >&5\nprintf \"%s\\n\" \"$as_me:   current value: \\`$ac_new_val'\" >&2;}\n      fi;;\n  esac\n  # Pass precious variables to config.status.\n  if test \"$ac_new_set\" = set; then\n    case $ac_new_val in\n    *\\'*) ac_arg=$ac_var=`printf \"%s\\n\" \"$ac_new_val\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    *) ac_arg=$ac_var=$ac_new_val ;;\n    esac\n    case \" $ac_configure_args \" in\n      *\" '$ac_arg' \"*) ;; # Avoid dups.  Use of quotes ensures accuracy.\n      *) as_fn_append ac_configure_args \" '$ac_arg'\" ;;\n    esac\n  fi\ndone\nif $ac_cache_corrupted; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in \\`$ac_pwd':\" >&2;}\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build\" >&5\nprintf \"%s\\n\" \"$as_me: error: changes in the environment can compromise the build\" >&2;}\n  as_fn_error $? \"run \\`${MAKE-make} distclean' and/or \\`rm $cache_file'\n\t    and start over\" \"$LINENO\" 5\nfi\n## -------------------- ##\n## Main body of script. ##\n## -------------------- ##\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\nam__api_version='1.14'\n\n\n\n  # Find a good install program.  We prefer a C program (faster),\n# so one script is as good as another.  But avoid the broken or\n# incompatible versions:\n# SysV /etc/install, /usr/sbin/install\n# SunOS /usr/etc/install\n# IRIX /sbin/install\n# AIX /bin/install\n# AmigaOS /C/install, which installs bootblocks on floppy discs\n# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag\n# AFS /usr/afsws/bin/install, which mishandles nonexistent args\n# SVR4 /usr/ucb/install, which tries to use the nonexistent group \"staff\"\n# OS/2's system install, which has a completely different semantic\n# ./install, which can be erroneously created by make from ./install.sh.\n# Reject install programs that cannot install multiple files.\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install\" >&5\nprintf %s \"checking for a BSD-compatible install... \" >&6; }\nif test -z \"$INSTALL\"; then\nif test ${ac_cv_path_install+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    # Account for fact that we put trailing slashes in our PATH walk.\ncase $as_dir in #((\n  ./ | /[cC]/* | \\\n  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \\\n  ?:[\\\\/]os2[\\\\/]install[\\\\/]* | ?:[\\\\/]OS2[\\\\/]INSTALL[\\\\/]* | \\\n  /usr/ucb/* ) ;;\n  *)\n    # OSF1 and SCO ODT 3.0 have their own names for install.\n    # Don't use installbsd from OSF since it installs stuff as root\n    # by default.\n    for ac_prog in ginstall scoinst install; do\n      for ac_exec_ext in '' $ac_executable_extensions; do\n\tif as_fn_executable_p \"$as_dir$ac_prog$ac_exec_ext\"; then\n\t  if test $ac_prog = install &&\n\t    grep dspmsg \"$as_dir$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # AIX install.  It has an incompatible calling convention.\n\t    :\n\t  elif test $ac_prog = install &&\n\t    grep pwplus \"$as_dir$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # program-specific install script used by HP pwplus--don't use.\n\t    :\n\t  else\n\t    rm -rf conftest.one conftest.two conftest.dir\n\t    echo one > conftest.one\n\t    echo two > conftest.two\n\t    mkdir conftest.dir\n\t    if \"$as_dir$ac_prog$ac_exec_ext\" -c conftest.one conftest.two \"`pwd`/conftest.dir/\" &&\n\t      test -s conftest.one && test -s conftest.two &&\n\t      test -s conftest.dir/conftest.one &&\n\t      test -s conftest.dir/conftest.two\n\t    then\n\t      ac_cv_path_install=\"$as_dir$ac_prog$ac_exec_ext -c\"\n\t      break 3\n\t    fi\n\t  fi\n\tfi\n      done\n    done\n    ;;\nesac\n\n  done\nIFS=$as_save_IFS\n\nrm -rf conftest.one conftest.two conftest.dir\n\nfi\n  if test ${ac_cv_path_install+y}; then\n    INSTALL=$ac_cv_path_install\n  else\n    # As a last resort, use the slow shell script.  Don't cache a\n    # value for INSTALL within a source directory, because that will\n    # break other packages using the cache if that directory is\n    # removed, or if the value is a relative name.\n    INSTALL=$ac_install_sh\n  fi\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $INSTALL\" >&5\nprintf \"%s\\n\" \"$INSTALL\" >&6; }\n\n# Use test -z because SunOS4 sh mishandles braces in ${var-val}.\n# It thinks the first close brace ends the variable substitution.\ntest -z \"$INSTALL_PROGRAM\" && INSTALL_PROGRAM='${INSTALL}'\n\ntest -z \"$INSTALL_SCRIPT\" && INSTALL_SCRIPT='${INSTALL}'\n\ntest -z \"$INSTALL_DATA\" && INSTALL_DATA='${INSTALL} -m 644'\n\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether build environment is sane\" >&5\nprintf %s \"checking whether build environment is sane... \" >&6; }\n# Reject unsafe characters in $srcdir or the absolute working directory\n# name.  Accept space and tab only in the latter.\nam_lf='\n'\ncase `pwd` in\n  *[\\\\\\\"\\#\\$\\&\\'\\`$am_lf]*)\n    as_fn_error $? \"unsafe absolute working directory name\" \"$LINENO\" 5;;\nesac\ncase $srcdir in\n  *[\\\\\\\"\\#\\$\\&\\'\\`$am_lf\\ \\\t]*)\n    as_fn_error $? \"unsafe srcdir value: '$srcdir'\" \"$LINENO\" 5;;\nesac\n\n# Do 'set' in a subshell so we don't clobber the current shell's\n# arguments.  Must try -L first in case configure is actually a\n# symlink; some systems play weird games with the mod time of symlinks\n# (eg FreeBSD returns the mod time of the symlink's containing\n# directory).\nif (\n   am_has_slept=no\n   for am_try in 1 2; do\n     echo \"timestamp, slept: $am_has_slept\" > conftest.file\n     set X `ls -Lt \"$srcdir/configure\" conftest.file 2> /dev/null`\n     if test \"$*\" = \"X\"; then\n\t# -L didn't work.\n\tset X `ls -t \"$srcdir/configure\" conftest.file`\n     fi\n     if test \"$*\" != \"X $srcdir/configure conftest.file\" \\\n\t&& test \"$*\" != \"X conftest.file $srcdir/configure\"; then\n\n\t# If neither matched, then we have a broken ls.  This can happen\n\t# if, for instance, CONFIG_SHELL is bash and it inherits a\n\t# broken ls alias from the environment.  This has actually\n\t# happened.  Such a system could not be considered \"sane\".\n\tas_fn_error $? \"ls -t appears to fail.  Make sure there is not a broken\n  alias in your environment\" \"$LINENO\" 5\n     fi\n     if test \"$2\" = conftest.file || test $am_try -eq 2; then\n       break\n     fi\n     # Just in case.\n     sleep 1\n     am_has_slept=yes\n   done\n   test \"$2\" = conftest.file\n   )\nthen\n   # Ok.\n   :\nelse\n   as_fn_error $? \"newly created file is older than distributed files!\nCheck your system clock\" \"$LINENO\" 5\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\nprintf \"%s\\n\" \"yes\" >&6; }\n# If we didn't sleep, we still need to ensure time stamps of config.status and\n# generated files are strictly newer.\nam_sleep_pid=\nif grep 'slept: no' conftest.file >/dev/null 2>&1; then\n  ( sleep 1 ) &\n  am_sleep_pid=$!\nfi\n\nrm -f conftest.file\n\ntest \"$program_prefix\" != NONE &&\n  program_transform_name=\"s&^&$program_prefix&;$program_transform_name\"\n# Use a double $ so make ignores it.\ntest \"$program_suffix\" != NONE &&\n  program_transform_name=\"s&\\$&$program_suffix&;$program_transform_name\"\n# Double any \\ or $.\n# By default was `s,x,x', remove it if useless.\nac_script='s/[\\\\$]/&&/g;s/;s,x,x,$//'\nprogram_transform_name=`printf \"%s\\n\" \"$program_transform_name\" | sed \"$ac_script\"`\n\n# expand $ac_aux_dir to an absolute path\nam_aux_dir=`cd $ac_aux_dir && pwd`\n\n\n  if test x\"${MISSING+set}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    MISSING=\"\\${SHELL} \\\"$am_aux_dir/missing\\\"\" ;;\n  *)\n    MISSING=\"\\${SHELL} $am_aux_dir/missing\" ;;\n  esac\nfi\n# Use eval to expand $SHELL\nif eval \"$MISSING --is-lightweight\"; then\n  am_missing_run=\"$MISSING \"\nelse\n  am_missing_run=\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: 'missing' script is too old or missing\" >&2;}\nfi\n\nif test x\"${install_sh}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    install_sh=\"\\${SHELL} '$am_aux_dir/install-sh'\" ;;\n  *)\n    install_sh=\"\\${SHELL} $am_aux_dir/install-sh\"\n  esac\nfi\n\n# Installed binaries are usually stripped using 'strip' when the user\n# run \"make install-strip\".  However 'strip' might not be the right\n# tool to use in cross-compilation environments, therefore Automake\n# will honor the 'STRIP' environment variable to overrule this program.\nif test \"$cross_compiling\" != no; then\n  if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}strip\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}strip; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_STRIP+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$STRIP\"; then\n  ac_cv_prog_STRIP=\"$STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_STRIP=\"${ac_tool_prefix}strip\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nSTRIP=$ac_cv_prog_STRIP\nif test -n \"$STRIP\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $STRIP\" >&5\nprintf \"%s\\n\" \"$STRIP\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_STRIP\"; then\n  ac_ct_STRIP=$STRIP\n  # Extract the first word of \"strip\", so it can be a program name with args.\nset dummy strip; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_ac_ct_STRIP+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$ac_ct_STRIP\"; then\n  ac_cv_prog_ac_ct_STRIP=\"$ac_ct_STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_STRIP=\"strip\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP\nif test -n \"$ac_ct_STRIP\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP\" >&5\nprintf \"%s\\n\" \"$ac_ct_STRIP\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_STRIP\" = x; then\n    STRIP=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    STRIP=$ac_ct_STRIP\n  fi\nelse\n  STRIP=\"$ac_cv_prog_STRIP\"\nfi\n\nfi\nINSTALL_STRIP_PROGRAM=\"\\$(install_sh) -c -s\"\n\n\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p\" >&5\nprintf %s \"checking for a race-free mkdir -p... \" >&6; }\nif test -z \"$MKDIR_P\"; then\n  if test ${ac_cv_path_mkdir+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_prog in mkdir gmkdir; do\n\t for ac_exec_ext in '' $ac_executable_extensions; do\n\t   as_fn_executable_p \"$as_dir$ac_prog$ac_exec_ext\" || continue\n\t   case `\"$as_dir$ac_prog$ac_exec_ext\" --version 2>&1` in #(\n\t     'mkdir ('*'coreutils) '* | \\\n\t     'BusyBox '* | \\\n\t     'mkdir (fileutils) '4.1*)\n\t       ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext\n\t       break 3;;\n\t   esac\n\t done\n       done\n  done\nIFS=$as_save_IFS\n\nfi\n\n  test -d ./--version && rmdir ./--version\n  if test ${ac_cv_path_mkdir+y}; then\n    MKDIR_P=\"$ac_cv_path_mkdir -p\"\n  else\n    # As a last resort, use the slow shell script.  Don't cache a\n    # value for MKDIR_P within a source directory, because that will\n    # break other packages using the cache if that directory is\n    # removed, or if the value is a relative name.\n    MKDIR_P=\"$ac_install_sh -d\"\n  fi\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $MKDIR_P\" >&5\nprintf \"%s\\n\" \"$MKDIR_P\" >&6; }\n\nfor ac_prog in gawk mawk nawk awk\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_AWK+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$AWK\"; then\n  ac_cv_prog_AWK=\"$AWK\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_AWK=\"$ac_prog\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nAWK=$ac_cv_prog_AWK\nif test -n \"$AWK\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $AWK\" >&5\nprintf \"%s\\n\" \"$AWK\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\n  test -n \"$AWK\" && break\ndone\n\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \\$(MAKE)\" >&5\nprintf %s \"checking whether ${MAKE-make} sets \\$(MAKE)... \" >&6; }\nset x ${MAKE-make}\nac_make=`printf \"%s\\n\" \"$2\" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`\nif eval test \\${ac_cv_prog_make_${ac_make}_set+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  cat >conftest.make <<\\_ACEOF\nSHELL = /bin/sh\nall:\n\t@echo '@@@%%%=$(MAKE)=@@@%%%'\n_ACEOF\n# GNU make sometimes prints \"make[1]: Entering ...\", which would confuse us.\ncase `${MAKE-make} -f conftest.make 2>/dev/null` in\n  *@@@%%%=?*=@@@%%%*)\n    eval ac_cv_prog_make_${ac_make}_set=yes;;\n  *)\n    eval ac_cv_prog_make_${ac_make}_set=no;;\nesac\nrm -f conftest.make\nfi\nif eval test \\$ac_cv_prog_make_${ac_make}_set = yes; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\nprintf \"%s\\n\" \"yes\" >&6; }\n  SET_MAKE=\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\n  SET_MAKE=\"MAKE=${MAKE-make}\"\nfi\n\nrm -rf .tst 2>/dev/null\nmkdir .tst 2>/dev/null\nif test -d .tst; then\n  am__leading_dot=.\nelse\n  am__leading_dot=_\nfi\nrmdir .tst 2>/dev/null\n\n# Check whether --enable-silent-rules was given.\nif test ${enable_silent_rules+y}\nthen :\n  enableval=$enable_silent_rules;\nfi\n\ncase $enable_silent_rules in # (((\n  yes) AM_DEFAULT_VERBOSITY=0;;\n   no) AM_DEFAULT_VERBOSITY=1;;\n    *) AM_DEFAULT_VERBOSITY=1;;\nesac\nam_make=${MAKE-make}\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables\" >&5\nprintf %s \"checking whether $am_make supports nested variables... \" >&6; }\nif test ${am_cv_make_support_nested_variables+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if printf \"%s\\n\" 'TRUE=$(BAR$(V))\nBAR0=false\nBAR1=true\nV=1\nam__doit:\n\t@$(TRUE)\n.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then\n  am_cv_make_support_nested_variables=yes\nelse\n  am_cv_make_support_nested_variables=no\nfi\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables\" >&5\nprintf \"%s\\n\" \"$am_cv_make_support_nested_variables\" >&6; }\nif test $am_cv_make_support_nested_variables = yes; then\n    AM_V='$(V)'\n  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'\nelse\n  AM_V=$AM_DEFAULT_VERBOSITY\n  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY\nfi\nAM_BACKSLASH='\\'\n\nif test \"`cd $srcdir && pwd`\" != \"`pwd`\"; then\n  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output\n  # is not polluted with repeated \"-I.\"\n  am__isrc=' -I$(srcdir)'\n  # test to see if srcdir already configured\n  if test -f $srcdir/config.status; then\n    as_fn_error $? \"source directory already configured; run \\\"make distclean\\\" there first\" \"$LINENO\" 5\n  fi\nfi\n\n# test whether we have cygpath\nif test -z \"$CYGPATH_W\"; then\n  if (cygpath --version) >/dev/null 2>/dev/null; then\n    CYGPATH_W='cygpath -w'\n  else\n    CYGPATH_W=echo\n  fi\nfi\n\n\n# Define the identity of the package.\n PACKAGE='rufus'\n VERSION='4.14'\n\n\nprintf \"%s\\n\" \"#define PACKAGE \\\"$PACKAGE\\\"\" >>confdefs.h\n\n\nprintf \"%s\\n\" \"#define VERSION \\\"$VERSION\\\"\" >>confdefs.h\n\n# Some tools Automake needs.\n\nACLOCAL=${ACLOCAL-\"${am_missing_run}aclocal-${am__api_version}\"}\n\n\nAUTOCONF=${AUTOCONF-\"${am_missing_run}autoconf\"}\n\n\nAUTOMAKE=${AUTOMAKE-\"${am_missing_run}automake-${am__api_version}\"}\n\n\nAUTOHEADER=${AUTOHEADER-\"${am_missing_run}autoheader\"}\n\n\nMAKEINFO=${MAKEINFO-\"${am_missing_run}makeinfo\"}\n\n# For better backward compatibility.  To be removed once Automake 1.9.x\n# dies out for good.  For more background, see:\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>\nmkdir_p='$(MKDIR_P)'\n\n# We need awk for the \"check\" target.  The system \"awk\" is bad on\n# some platforms.\n# Always define AMTAR for backward compatibility.  Yes, it's still used\n# in the wild :-(  We should find a proper way to deprecate it ...\nAMTAR='$${TAR-tar}'\n\n\n# We'll loop over all known methods to create a tar archive until one works.\n_am_tools='gnutar  pax cpio none'\n\nam__tar='$${TAR-tar} chof - \"$$tardir\"' am__untar='$${TAR-tar} xf -'\n\n\n\n\n\n\n# POSIX will say in a future version that running \"rm -f\" with no argument\n# is OK; and we want to be able to make that assumption in our Makefile\n# recipes.  So use an aggressive probe to check that the usage we want is\n# actually supported \"in the wild\" to an acceptable degree.\n# See automake bug#10828.\n# To make any issue more visible, cause the running configure to be aborted\n# by default if the 'rm' program in use doesn't match our expectations; the\n# user can still override this though.\nif rm -f && rm -fr && rm -rf; then : OK; else\n  cat >&2 <<'END'\nOops!\n\nYour 'rm' program seems unable to run without file operands specified\non the command line, even when the '-f' option is present.  This is contrary\nto the behaviour of most rm programs out there, and not conforming with\nthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>\n\nPlease tell bug-automake@gnu.org about your system, including the value\nof your $PATH and any error possibly output before this message.  This\ncan help us improve future automake versions.\n\nEND\n  if test x\"$ACCEPT_INFERIOR_RM_PROGRAM\" = x\"yes\"; then\n    echo 'Configuration will proceed anyway, since you have set the' >&2\n    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to \"yes\"' >&2\n    echo >&2\n  else\n    cat >&2 <<'END'\nAborting the configuration process, to ensure you take notice of the issue.\n\nYou can download and install GNU coreutils to get an 'rm' implementation\nthat behaves properly: <http://www.gnu.org/software/coreutils/>.\n\nIf you want to complete the configuration process using your problematic\n'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM\nto \"yes\", and re-run configure.\n\nEND\n    as_fn_error $? \"Your 'rm' program is bad, sorry.\" \"$LINENO\" 5\n  fi\nfi\n\n\n# Check whether --enable-silent-rules was given.\nif test ${enable_silent_rules+y}\nthen :\n  enableval=$enable_silent_rules;\nfi\n\ncase $enable_silent_rules in # (((\n  yes) AM_DEFAULT_VERBOSITY=0;;\n   no) AM_DEFAULT_VERBOSITY=1;;\n    *) AM_DEFAULT_VERBOSITY=0;;\nesac\nam_make=${MAKE-make}\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables\" >&5\nprintf %s \"checking whether $am_make supports nested variables... \" >&6; }\nif test ${am_cv_make_support_nested_variables+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if printf \"%s\\n\" 'TRUE=$(BAR$(V))\nBAR0=false\nBAR1=true\nV=1\nam__doit:\n\t@$(TRUE)\n.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then\n  am_cv_make_support_nested_variables=yes\nelse\n  am_cv_make_support_nested_variables=no\nfi\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables\" >&5\nprintf \"%s\\n\" \"$am_cv_make_support_nested_variables\" >&6; }\nif test $am_cv_make_support_nested_variables = yes; then\n    AM_V='$(V)'\n  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'\nelse\n  AM_V=$AM_DEFAULT_VERBOSITY\n  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY\nfi\nAM_BACKSLASH='\\'\n\n\n\n\n\n\n\n\n\n\n\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}gcc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}gcc; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_CC+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}gcc\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\nprintf \"%s\\n\" \"$CC\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_CC\"; then\n  ac_ct_CC=$CC\n  # Extract the first word of \"gcc\", so it can be a program name with args.\nset dummy gcc; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_ac_ct_CC+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"gcc\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC\" >&5\nprintf \"%s\\n\" \"$ac_ct_CC\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_CC\" = x; then\n    CC=\"\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    CC=$ac_ct_CC\n  fi\nelse\n  CC=\"$ac_cv_prog_CC\"\nfi\n\nif test -z \"$CC\"; then\n          if test -n \"$ac_tool_prefix\"; then\n    # Extract the first word of \"${ac_tool_prefix}cc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}cc; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_CC+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}cc\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\nprintf \"%s\\n\" \"$CC\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\n  fi\nfi\nif test -z \"$CC\"; then\n  # Extract the first word of \"cc\", so it can be a program name with args.\nset dummy cc; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_CC+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\n  ac_prog_rejected=no\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    if test \"$as_dir$ac_word$ac_exec_ext\" = \"/usr/ucb/cc\"; then\n       ac_prog_rejected=yes\n       continue\n     fi\n    ac_cv_prog_CC=\"cc\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nif test $ac_prog_rejected = yes; then\n  # We found a bogon in the path, so make sure we never use it.\n  set dummy $ac_cv_prog_CC\n  shift\n  if test $# != 0; then\n    # We chose a different compiler from the bogus one.\n    # However, it has the same basename, so the bogon will be chosen\n    # first if we set CC to just the basename; use the full file name.\n    shift\n    ac_cv_prog_CC=\"$as_dir$ac_word${1+' '}$@\"\n  fi\nfi\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\nprintf \"%s\\n\" \"$CC\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$CC\"; then\n  if test -n \"$ac_tool_prefix\"; then\n  for ac_prog in cl.exe\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_CC+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"$ac_tool_prefix$ac_prog\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\nprintf \"%s\\n\" \"$CC\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\n    test -n \"$CC\" && break\n  done\nfi\nif test -z \"$CC\"; then\n  ac_ct_CC=$CC\n  for ac_prog in cl.exe\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_ac_ct_CC+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"$ac_prog\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC\" >&5\nprintf \"%s\\n\" \"$ac_ct_CC\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\n  test -n \"$ac_ct_CC\" && break\ndone\n\n  if test \"x$ac_ct_CC\" = x; then\n    CC=\"\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    CC=$ac_ct_CC\n  fi\nfi\n\nfi\nif test -z \"$CC\"; then\n  if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}clang\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}clang; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_CC+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}clang\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\nprintf \"%s\\n\" \"$CC\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_CC\"; then\n  ac_ct_CC=$CC\n  # Extract the first word of \"clang\", so it can be a program name with args.\nset dummy clang; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_ac_ct_CC+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"clang\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC\" >&5\nprintf \"%s\\n\" \"$ac_ct_CC\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_CC\" = x; then\n    CC=\"\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    CC=$ac_ct_CC\n  fi\nelse\n  CC=\"$ac_cv_prog_CC\"\nfi\n\nfi\n\n\ntest -z \"$CC\" && { { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"no acceptable C compiler found in \\$PATH\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\n\n# Provide some information about the compiler.\nprintf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for C compiler version\" >&5\nset X $ac_compile\nac_compiler=$2\nfor ac_option in --version -v -V -qversion -version; do\n  { { ac_try=\"$ac_compiler $ac_option >&5\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compiler $ac_option >&5\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    sed '10a\\\n... rest of stderr output deleted ...\n         10q' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n  fi\n  rm -f conftest.er1 conftest.err\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\ndone\n\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nac_clean_files_save=$ac_clean_files\nac_clean_files=\"$ac_clean_files a.out a.out.dSYM a.exe b.out\"\n# Try to create an executable without -o first, disregard a.out.\n# It will help us diagnose broken compilers, and finding out an intuition\n# of exeext.\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether the C compiler works\" >&5\nprintf %s \"checking whether the C compiler works... \" >&6; }\nac_link_default=`printf \"%s\\n\" \"$ac_link\" | sed 's/ -o *conftest[^ ]*//'`\n\n# The possible output files:\nac_files=\"a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*\"\n\nac_rmfiles=\nfor ac_file in $ac_files\ndo\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;\n    * ) ac_rmfiles=\"$ac_rmfiles $ac_file\";;\n  esac\ndone\nrm -f $ac_rmfiles\n\nif { { ac_try=\"$ac_link_default\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link_default\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\nthen :\n  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.\n# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'\n# in a Makefile.  We should not override ac_cv_exeext if it was cached,\n# so that the user can short-circuit this test for compilers unknown to\n# Autoconf.\nfor ac_file in $ac_files ''\ndo\n  test -f \"$ac_file\" || continue\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )\n\t;;\n    [ab].out )\n\t# We found the default executable, but exeext='' is most\n\t# certainly right.\n\tbreak;;\n    *.* )\n\tif test ${ac_cv_exeext+y} && test \"$ac_cv_exeext\" != no;\n\tthen :; else\n\t   ac_cv_exeext=`expr \"$ac_file\" : '[^.]*\\(\\..*\\)'`\n\tfi\n\t# We set ac_cv_exeext here because the later test for it is not\n\t# safe: cross compilers may not add the suffix if given an `-o'\n\t# argument, so we may need to know it at that point already.\n\t# Even if this section looks crufty: it has the advantage of\n\t# actually working.\n\tbreak;;\n    * )\n\tbreak;;\n  esac\ndone\ntest \"$ac_cv_exeext\" = no && ac_cv_exeext=\n\nelse $as_nop\n  ac_file=''\nfi\nif test -z \"$ac_file\"\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nprintf \"%s\\n\" \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n{ { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error 77 \"C compiler cannot create executables\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\nelse $as_nop\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\nprintf \"%s\\n\" \"yes\" >&6; }\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name\" >&5\nprintf %s \"checking for C compiler default output file name... \" >&6; }\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_file\" >&5\nprintf \"%s\\n\" \"$ac_file\" >&6; }\nac_exeext=$ac_cv_exeext\n\nrm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out\nac_clean_files=$ac_clean_files_save\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for suffix of executables\" >&5\nprintf %s \"checking for suffix of executables... \" >&6; }\nif { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\nthen :\n  # If both `conftest.exe' and `conftest' are `present' (well, observable)\n# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will\n# work properly (i.e., refer to `conftest.exe'), while it won't with\n# `rm'.\nfor ac_file in conftest.exe conftest conftest.*; do\n  test -f \"$ac_file\" || continue\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;\n    *.* ) ac_cv_exeext=`expr \"$ac_file\" : '[^.]*\\(\\..*\\)'`\n\t  break;;\n    * ) break;;\n  esac\ndone\nelse $as_nop\n  { { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"cannot compute suffix of executables: cannot compile and link\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\nfi\nrm -f conftest conftest$ac_cv_exeext\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext\" >&5\nprintf \"%s\\n\" \"$ac_cv_exeext\" >&6; }\n\nrm -f conftest.$ac_ext\nEXEEXT=$ac_cv_exeext\nac_exeext=$EXEEXT\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdio.h>\nint\nmain (void)\n{\nFILE *f = fopen (\"conftest.out\", \"w\");\n return ferror (f) || fclose (f) != 0;\n\n  ;\n  return 0;\n}\n_ACEOF\nac_clean_files=\"$ac_clean_files conftest.out\"\n# Check that the compiler produces executables we can run.  If not, either\n# the compiler is broken, or we cross compile.\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling\" >&5\nprintf %s \"checking whether we are cross compiling... \" >&6; }\nif test \"$cross_compiling\" != yes; then\n  { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n  if { ac_try='./conftest$ac_cv_exeext'\n  { { case \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_try\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; }; then\n    cross_compiling=no\n  else\n    if test \"$cross_compiling\" = maybe; then\n\tcross_compiling=yes\n    else\n\t{ { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error 77 \"cannot run C compiled programs.\nIf you meant to cross compile, use \\`--host'.\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\n    fi\n  fi\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $cross_compiling\" >&5\nprintf \"%s\\n\" \"$cross_compiling\" >&6; }\n\nrm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out\nac_clean_files=$ac_clean_files_save\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for suffix of object files\" >&5\nprintf %s \"checking for suffix of object files... \" >&6; }\nif test ${ac_cv_objext+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.o conftest.obj\nif { { ac_try=\"$ac_compile\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compile\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\nthen :\n  for ac_file in conftest.o conftest.obj conftest.*; do\n  test -f \"$ac_file\" || continue;\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;\n    *) ac_cv_objext=`expr \"$ac_file\" : '.*\\.\\(.*\\)'`\n       break;;\n  esac\ndone\nelse $as_nop\n  printf \"%s\\n\" \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n{ { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"cannot compute suffix of object files: cannot compile\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\nfi\nrm -f conftest.$ac_cv_objext conftest.$ac_ext\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext\" >&5\nprintf \"%s\\n\" \"$ac_cv_objext\" >&6; }\nOBJEXT=$ac_cv_objext\nac_objext=$OBJEXT\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C\" >&5\nprintf %s \"checking whether the compiler supports GNU C... \" >&6; }\nif test ${ac_cv_c_compiler_gnu+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n#ifndef __GNUC__\n       choke me\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_compiler_gnu=yes\nelse $as_nop\n  ac_compiler_gnu=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\nac_cv_c_compiler_gnu=$ac_compiler_gnu\n\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu\" >&5\nprintf \"%s\\n\" \"$ac_cv_c_compiler_gnu\" >&6; }\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nif test $ac_compiler_gnu = yes; then\n  GCC=yes\nelse\n  GCC=\nfi\nac_test_CFLAGS=${CFLAGS+y}\nac_save_CFLAGS=$CFLAGS\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g\" >&5\nprintf %s \"checking whether $CC accepts -g... \" >&6; }\nif test ${ac_cv_prog_cc_g+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  ac_save_c_werror_flag=$ac_c_werror_flag\n   ac_c_werror_flag=yes\n   ac_cv_prog_cc_g=no\n   CFLAGS=\"-g\"\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_prog_cc_g=yes\nelse $as_nop\n  CFLAGS=\"\"\n      cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n\nelse $as_nop\n  ac_c_werror_flag=$ac_save_c_werror_flag\n\t CFLAGS=\"-g\"\n\t cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_prog_cc_g=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n   ac_c_werror_flag=$ac_save_c_werror_flag\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g\" >&5\nprintf \"%s\\n\" \"$ac_cv_prog_cc_g\" >&6; }\nif test $ac_test_CFLAGS; then\n  CFLAGS=$ac_save_CFLAGS\nelif test $ac_cv_prog_cc_g = yes; then\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-g -O2\"\n  else\n    CFLAGS=\"-g\"\n  fi\nelse\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-O2\"\n  else\n    CFLAGS=\n  fi\nfi\nac_prog_cc_stdc=no\nif test x$ac_prog_cc_stdc = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features\" >&5\nprintf %s \"checking for $CC option to enable C11 features... \" >&6; }\nif test ${ac_cv_prog_cc_c11+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  ac_cv_prog_cc_c11=no\nac_save_CC=$CC\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$ac_c_conftest_c11_program\n_ACEOF\nfor ac_arg in '' -std=gnu11\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  if ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_prog_cc_c11=$ac_arg\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam\n  test \"x$ac_cv_prog_cc_c11\" != \"xno\" && break\ndone\nrm -f conftest.$ac_ext\nCC=$ac_save_CC\nfi\n\nif test \"x$ac_cv_prog_cc_c11\" = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\nprintf \"%s\\n\" \"unsupported\" >&6; }\nelse $as_nop\n  if test \"x$ac_cv_prog_cc_c11\" = x\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\nprintf \"%s\\n\" \"none needed\" >&6; }\nelse $as_nop\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11\" >&5\nprintf \"%s\\n\" \"$ac_cv_prog_cc_c11\" >&6; }\n     CC=\"$CC $ac_cv_prog_cc_c11\"\nfi\n  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11\n  ac_prog_cc_stdc=c11\nfi\nfi\nif test x$ac_prog_cc_stdc = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features\" >&5\nprintf %s \"checking for $CC option to enable C99 features... \" >&6; }\nif test ${ac_cv_prog_cc_c99+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  ac_cv_prog_cc_c99=no\nac_save_CC=$CC\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$ac_c_conftest_c99_program\n_ACEOF\nfor ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  if ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_prog_cc_c99=$ac_arg\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam\n  test \"x$ac_cv_prog_cc_c99\" != \"xno\" && break\ndone\nrm -f conftest.$ac_ext\nCC=$ac_save_CC\nfi\n\nif test \"x$ac_cv_prog_cc_c99\" = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\nprintf \"%s\\n\" \"unsupported\" >&6; }\nelse $as_nop\n  if test \"x$ac_cv_prog_cc_c99\" = x\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\nprintf \"%s\\n\" \"none needed\" >&6; }\nelse $as_nop\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99\" >&5\nprintf \"%s\\n\" \"$ac_cv_prog_cc_c99\" >&6; }\n     CC=\"$CC $ac_cv_prog_cc_c99\"\nfi\n  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99\n  ac_prog_cc_stdc=c99\nfi\nfi\nif test x$ac_prog_cc_stdc = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features\" >&5\nprintf %s \"checking for $CC option to enable C89 features... \" >&6; }\nif test ${ac_cv_prog_cc_c89+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  ac_cv_prog_cc_c89=no\nac_save_CC=$CC\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$ac_c_conftest_c89_program\n_ACEOF\nfor ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae \"-Aa -D_HPUX_SOURCE\" \"-Xc -D__EXTENSIONS__\"\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  if ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_prog_cc_c89=$ac_arg\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam\n  test \"x$ac_cv_prog_cc_c89\" != \"xno\" && break\ndone\nrm -f conftest.$ac_ext\nCC=$ac_save_CC\nfi\n\nif test \"x$ac_cv_prog_cc_c89\" = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\nprintf \"%s\\n\" \"unsupported\" >&6; }\nelse $as_nop\n  if test \"x$ac_cv_prog_cc_c89\" = x\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\nprintf \"%s\\n\" \"none needed\" >&6; }\nelse $as_nop\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89\" >&5\nprintf \"%s\\n\" \"$ac_cv_prog_cc_c89\" >&6; }\n     CC=\"$CC $ac_cv_prog_cc_c89\"\nfi\n  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89\n  ac_prog_cc_stdc=c89\nfi\nfi\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\n  ac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together\" >&5\nprintf %s \"checking whether $CC understands -c and -o together... \" >&6; }\nif test ${am_cv_prog_cc_c_o+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\n  # Make sure it works both with $CC and with simple cc.\n  # Following AC_PROG_CC_C_O, we do the test twice because some\n  # compilers refuse to overwrite an existing .o file with -o,\n  # though they will create one.\n  am_cv_prog_cc_c_o=yes\n  for am_i in 1 2; do\n    if { echo \"$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext\" >&5\n   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5\n   ac_status=$?\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   (exit $ac_status); } \\\n         && test -f conftest2.$ac_objext; then\n      : OK\n    else\n      am_cv_prog_cc_c_o=no\n      break\n    fi\n  done\n  rm -f core conftest*\n  unset am_i\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o\" >&5\nprintf \"%s\\n\" \"$am_cv_prog_cc_c_o\" >&6; }\nif test \"$am_cv_prog_cc_c_o\" != yes; then\n   # Losing compiler, so override with the script.\n   # FIXME: It is wrong to rewrite CC.\n   # But if we don't then we get into trouble of one sort or another.\n   # A longer-term fix would be to have automake use am__CC in this case,\n   # and then we could set am__CC=\"\\$(top_srcdir)/compile \\$(CC)\"\n   CC=\"$am_aux_dir/compile $CC\"\nfi\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\n# autoconf 2.61 doesn't have AC_PROG_AR, but 2.63 has it\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}ar\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}ar; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_AR+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$AR\"; then\n  ac_cv_prog_AR=\"$AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_AR=\"${ac_tool_prefix}ar\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nAR=$ac_cv_prog_AR\nif test -n \"$AR\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $AR\" >&5\nprintf \"%s\\n\" \"$AR\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_AR\"; then\n  ac_ct_AR=$AR\n  # Extract the first word of \"ar\", so it can be a program name with args.\nset dummy ar; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_ac_ct_AR+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$ac_ct_AR\"; then\n  ac_cv_prog_ac_ct_AR=\"$ac_ct_AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_AR=\"ar\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_AR=$ac_cv_prog_ac_ct_AR\nif test -n \"$ac_ct_AR\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR\" >&5\nprintf \"%s\\n\" \"$ac_ct_AR\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_AR\" = x; then\n    AR=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    AR=$ac_ct_AR\n  fi\nelse\n  AR=\"$ac_cv_prog_AR\"\nfi\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}ranlib\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}ranlib; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_RANLIB+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$RANLIB\"; then\n  ac_cv_prog_RANLIB=\"$RANLIB\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_RANLIB=\"${ac_tool_prefix}ranlib\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nRANLIB=$ac_cv_prog_RANLIB\nif test -n \"$RANLIB\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $RANLIB\" >&5\nprintf \"%s\\n\" \"$RANLIB\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_RANLIB\"; then\n  ac_ct_RANLIB=$RANLIB\n  # Extract the first word of \"ranlib\", so it can be a program name with args.\nset dummy ranlib; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_ac_ct_RANLIB+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$ac_ct_RANLIB\"; then\n  ac_cv_prog_ac_ct_RANLIB=\"$ac_ct_RANLIB\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_RANLIB=\"ranlib\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB\nif test -n \"$ac_ct_RANLIB\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB\" >&5\nprintf \"%s\\n\" \"$ac_ct_RANLIB\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_RANLIB\" = x; then\n    RANLIB=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    RANLIB=$ac_ct_RANLIB\n  fi\nelse\n  RANLIB=\"$ac_cv_prog_RANLIB\"\nfi\n\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output\" >&5\nprintf %s \"checking for a sed that does not truncate output... \" >&6; }\nif test ${ac_cv_path_SED+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/\n     for ac_i in 1 2 3 4 5 6 7; do\n       ac_script=\"$ac_script$as_nl$ac_script\"\n     done\n     echo \"$ac_script\" 2>/dev/null | sed 99q >conftest.sed\n     { ac_script=; unset ac_script;}\n     if test -z \"$SED\"; then\n  ac_path_SED_found=false\n  # Loop through the user's path and test for each of PROGNAME-LIST\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_prog in sed gsed\n   do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      ac_path_SED=\"$as_dir$ac_prog$ac_exec_ext\"\n      as_fn_executable_p \"$ac_path_SED\" || continue\n# Check for GNU ac_path_SED and select it if it is found.\n  # Check for GNU $ac_path_SED\ncase `\"$ac_path_SED\" --version 2>&1` in\n*GNU*)\n  ac_cv_path_SED=\"$ac_path_SED\" ac_path_SED_found=:;;\n*)\n  ac_count=0\n  printf %s 0123456789 >\"conftest.in\"\n  while :\n  do\n    cat \"conftest.in\" \"conftest.in\" >\"conftest.tmp\"\n    mv \"conftest.tmp\" \"conftest.in\"\n    cp \"conftest.in\" \"conftest.nl\"\n    printf \"%s\\n\" '' >> \"conftest.nl\"\n    \"$ac_path_SED\" -f conftest.sed < \"conftest.nl\" >\"conftest.out\" 2>/dev/null || break\n    diff \"conftest.out\" \"conftest.nl\" >/dev/null 2>&1 || break\n    as_fn_arith $ac_count + 1 && ac_count=$as_val\n    if test $ac_count -gt ${ac_path_SED_max-0}; then\n      # Best one so far, save it but keep looking for a better one\n      ac_cv_path_SED=\"$ac_path_SED\"\n      ac_path_SED_max=$ac_count\n    fi\n    # 10*(2^10) chars as input seems more than enough\n    test $ac_count -gt 10 && break\n  done\n  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;\nesac\n\n      $ac_path_SED_found && break 3\n    done\n  done\n  done\nIFS=$as_save_IFS\n  if test -z \"$ac_cv_path_SED\"; then\n    as_fn_error $? \"no acceptable sed could be found in \\$PATH\" \"$LINENO\" 5\n  fi\nelse\n  ac_cv_path_SED=$SED\nfi\n\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED\" >&5\nprintf \"%s\\n\" \"$ac_cv_path_SED\" >&6; }\n SED=\"$ac_cv_path_SED\"\n  rm -f conftest.sed\n\n# Extract the first word of \"rm\", so it can be a program name with args.\nset dummy rm; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_path_RM+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  case $RM in\n  [\\\\/]* | ?:[\\\\/]*)\n  ac_cv_path_RM=\"$RM\" # Let the user override the test with a path.\n  ;;\n  *)\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_path_RM=\"$as_dir$ac_word$ac_exec_ext\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\n  test -z \"$ac_cv_path_RM\" && ac_cv_path_RM=\"rm\"\n  ;;\nesac\nfi\nRM=$ac_cv_path_RM\nif test -n \"$RM\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $RM\" >&5\nprintf \"%s\\n\" \"$RM\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}dlltool\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}dlltool; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_DLLTOOL+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$DLLTOOL\"; then\n  ac_cv_prog_DLLTOOL=\"$DLLTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_DLLTOOL=\"${ac_tool_prefix}dlltool\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nDLLTOOL=$ac_cv_prog_DLLTOOL\nif test -n \"$DLLTOOL\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $DLLTOOL\" >&5\nprintf \"%s\\n\" \"$DLLTOOL\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_DLLTOOL\"; then\n  ac_ct_DLLTOOL=$DLLTOOL\n  # Extract the first word of \"dlltool\", so it can be a program name with args.\nset dummy dlltool; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_ac_ct_DLLTOOL+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$ac_ct_DLLTOOL\"; then\n  ac_cv_prog_ac_ct_DLLTOOL=\"$ac_ct_DLLTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_DLLTOOL=\"dlltool\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL\nif test -n \"$ac_ct_DLLTOOL\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL\" >&5\nprintf \"%s\\n\" \"$ac_ct_DLLTOOL\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_DLLTOOL\" = x; then\n    DLLTOOL=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    DLLTOOL=$ac_ct_DLLTOOL\n  fi\nelse\n  DLLTOOL=\"$ac_cv_prog_DLLTOOL\"\nfi\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}strip\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}strip; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_STRIP+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$STRIP\"; then\n  ac_cv_prog_STRIP=\"$STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_STRIP=\"${ac_tool_prefix}strip\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nSTRIP=$ac_cv_prog_STRIP\nif test -n \"$STRIP\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $STRIP\" >&5\nprintf \"%s\\n\" \"$STRIP\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_STRIP\"; then\n  ac_ct_STRIP=$STRIP\n  # Extract the first word of \"strip\", so it can be a program name with args.\nset dummy strip; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_ac_ct_STRIP+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$ac_ct_STRIP\"; then\n  ac_cv_prog_ac_ct_STRIP=\"$ac_ct_STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_STRIP=\"strip\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP\nif test -n \"$ac_ct_STRIP\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP\" >&5\nprintf \"%s\\n\" \"$ac_ct_STRIP\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_STRIP\" = x; then\n    STRIP=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    STRIP=$ac_ct_STRIP\n  fi\nelse\n  STRIP=\"$ac_cv_prog_STRIP\"\nfi\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}windres\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}windres; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_WINDRES+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$WINDRES\"; then\n  ac_cv_prog_WINDRES=\"$WINDRES\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_WINDRES=\"${ac_tool_prefix}windres\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nWINDRES=$ac_cv_prog_WINDRES\nif test -n \"$WINDRES\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $WINDRES\" >&5\nprintf \"%s\\n\" \"$WINDRES\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_WINDRES\"; then\n  ac_ct_WINDRES=$WINDRES\n  # Extract the first word of \"windres\", so it can be a program name with args.\nset dummy windres; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_ac_ct_WINDRES+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  if test -n \"$ac_ct_WINDRES\"; then\n  ac_cv_prog_ac_ct_WINDRES=\"$ac_ct_WINDRES\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_WINDRES=\"windres\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES\nif test -n \"$ac_ct_WINDRES\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES\" >&5\nprintf \"%s\\n\" \"$ac_ct_WINDRES\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_WINDRES\" = x; then\n    WINDRES=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    WINDRES=$ac_ct_WINDRES\n  fi\nelse\n  WINDRES=\"$ac_cv_prog_WINDRES\"\nfi\n\n\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for inline\" >&5\nprintf %s \"checking for inline... \" >&6; }\nif test ${ac_cv_c_inline+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse $as_nop\n  ac_cv_c_inline=no\nfor ac_kw in inline __inline__ __inline; do\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#ifndef __cplusplus\ntypedef int foo_t;\nstatic $ac_kw foo_t static_foo (void) {return 0; }\n$ac_kw foo_t foo (void) {return 0; }\n#endif\n\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_c_inline=$ac_kw\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n  test \"$ac_cv_c_inline\" != no && break\ndone\n\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline\" >&5\nprintf \"%s\\n\" \"$ac_cv_c_inline\" >&6; }\n\ncase $ac_cv_c_inline in\n  inline | yes) ;;\n  *)\n    case $ac_cv_c_inline in\n      no) ac_val=;;\n      *) ac_val=$ac_cv_c_inline;;\n    esac\n    cat >>confdefs.h <<_ACEOF\n#ifndef __cplusplus\n#define inline $ac_val\n#endif\n_ACEOF\n    ;;\nesac\n\n\nprintf \"%s\\n\" \"#define _GNU_SOURCE /**/\" >>confdefs.h\n\n\nAM_CFLAGS=\"${AM_CFLAGS} -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00 -D_WIN32_IE=0x0A00\"\n# \"-Wl,--nxcompat\" to enable DEP (Data Execution Prevention)\n# \"-Wl,--dynamicbase\" to enable ASLR (Address Space Layout Randomization)\nAM_LDFLAGS=\"${AM_LDFLAGS} -Wl,-no-undefined -Wl,--nxcompat -Wl,--no-insert-timestamp -Wl,--dynamicbase\"\n\n# Debug symbols\n# Check whether --enable-debug was given.\nif test ${enable_debug+y}\nthen :\n  enableval=$enable_debug; debug_enabled=$enableval\nelse $as_nop\n  debug_enabled='yes'\nfi\n\nif test \"x$debug_enabled\" != \"xno\" ; then\n  CFLAGS=\"-g -O0\"\nelse\n  CFLAGS=\"-Os\"\n  LDFLAGS=\"-s\"\nfi\n\n# Alpha/Beta/Test\n# Check whether --enable-alpha was given.\nif test ${enable_alpha+y}\nthen :\n  enableval=$enable_alpha; alpha_enabled=$enableval\nelse $as_nop\n  alpha_enabled='no'\nfi\n\nif test \"x$alpha_enabled\" != \"xno\" ; then\n  CFLAGS+=\" -DALPHA\"\n  SUFFIX=_ALPHA\nfi\n# Check whether --enable-beta was given.\nif test ${enable_beta+y}\nthen :\n  enableval=$enable_beta; beta_enabled=$enableval\nelse $as_nop\n  beta_enabled='no'\nfi\n\nif test \"x$beta_enabled\" != \"xno\" ; then\n  CFLAGS+=\" -DBETA\"\n  SUFFIX=_BETA\nfi\n# Check whether --enable-test was given.\nif test ${enable_test+y}\nthen :\n  enableval=$enable_test; test_enabled=$enableval\nelse $as_nop\n  test_enabled='no'\nfi\n\nif test \"x$test_enabled\" != \"xno\" ; then\n  if test \"x$test_enabled\" == \"xyes\" ; then $enableval=\"\" ; fi\n  CFLAGS+=\" -DTEST=$enableval\"\n  SUFFIX=_TEST$enableval\nfi\n\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: enabling Large File Support (ISO support)\" >&5\nprintf \"%s\\n\" \"enabling Large File Support (ISO support)\" >&6; }\nAM_CFLAGS=\"$AM_CFLAGS -D_FILE_OFFSET_BITS=64 -D_OFF_T_ -D_off_t=off64_t -Doff_t=off64_t -Doff32_t=long\"\n\n# Check for -Wno-pointer-sign compiler support (GCC >= 4)\nsaved_CFLAGS=\"${CFLAGS}\"\nCFLAGS=\"$CFLAGS -Wno-pointer-sign\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  nopointersign_cflags=\"-Wno-pointer-sign\"\nelse $as_nop\n  nopointersign_cflags=\"\"\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\nCFLAGS=\"${saved_CFLAGS}\"\n\n# NB: The DECLSPEC_IMPORT redefinition below is a temporary(?) workaround for MinGW32 delay-loading\n# See https://github.com/pbatard/rufus/pull/2513 as well as https://sourceware.org/bugzilla/show_bug.cgi?id=14339\nAM_CFLAGS=\"$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -D__USE_MINGW_ANSI_STDIO=0 -UDECLSPEC_IMPORT -DDECLSPEC_IMPORT=__attribute__\\(\\(visibility\\(\\\\\\\"hidden\\\\\\\"\\)\\)\\) -std=gnu11 -Wshadow -Wall -Wformat-security -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Wno-array-bounds -Werror-implicit-function-declaration -Wbidi-chars=none $nopointersign_cflags\"\n\n\n\n\n\n\nac_config_files=\"$ac_config_files Makefile\"\n\nac_config_files=\"$ac_config_files .mingw/Makefile\"\n\nac_config_files=\"$ac_config_files src/Makefile\"\n\nac_config_files=\"$ac_config_files src/bled/Makefile\"\n\nac_config_files=\"$ac_config_files src/ext2fs/Makefile\"\n\nac_config_files=\"$ac_config_files src/libcdio/iso9660/Makefile\"\n\nac_config_files=\"$ac_config_files src/libcdio/udf/Makefile\"\n\nac_config_files=\"$ac_config_files src/libcdio/driver/Makefile\"\n\nac_config_files=\"$ac_config_files res/loc/Makefile\"\n\nac_config_files=\"$ac_config_files src/ms-sys/Makefile\"\n\nac_config_files=\"$ac_config_files src/syslinux/libfat/Makefile\"\n\nac_config_files=\"$ac_config_files src/syslinux/libinstaller/Makefile\"\n\nac_config_files=\"$ac_config_files src/syslinux/win/Makefile\"\n\nac_config_files=\"$ac_config_files src/wimlib/Makefile\"\n\ncat >confcache <<\\_ACEOF\n# This file is a shell script that caches the results of configure\n# tests run on this system so they can be shared between configure\n# scripts and configure runs, see configure's option --config-cache.\n# It is not useful on other systems.  If it contains results you don't\n# want to keep, you may remove or edit it.\n#\n# config.status only pays attention to the cache file if you give it\n# the --recheck option to rerun configure.\n#\n# `ac_cv_env_foo' variables (set or unset) will be overridden when\n# loading this file, other *unset* `ac_cv_foo' will be assigned the\n# following values.\n\n_ACEOF\n\n# The following way of writing the cache mishandles newlines in values,\n# but we know of no workaround that is simple, portable, and efficient.\n# So, we kill variables containing newlines.\n# Ultrix sh set writes to stderr and can't be redirected directly,\n# and sets the high bit in the cache file unless we assign to the vars.\n(\n  for ac_var in `(set) 2>&1 | sed -n 's/^\\([a-zA-Z_][a-zA-Z0-9_]*\\)=.*/\\1/p'`; do\n    eval ac_val=\\$$ac_var\n    case $ac_val in #(\n    *${as_nl}*)\n      case $ac_var in #(\n      *_cv_*) { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: cache variable $ac_var contains a newline\" >&2;} ;;\n      esac\n      case $ac_var in #(\n      _ | IFS | as_nl) ;; #(\n      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(\n      *) { eval $ac_var=; unset $ac_var;} ;;\n      esac ;;\n    esac\n  done\n\n  (set) 2>&1 |\n    case $as_nl`(ac_space=' '; set) 2>&1` in #(\n    *${as_nl}ac_space=\\ *)\n      # `set' does not quote correctly, so add quotes: double-quote\n      # substitution turns \\\\\\\\ into \\\\, and sed turns \\\\ into \\.\n      sed -n \\\n\t\"s/'/'\\\\\\\\''/g;\n\t  s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1='\\\\2'/p\"\n      ;; #(\n    *)\n      # `set' quotes correctly as required by POSIX, so do not add quotes.\n      sed -n \"/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p\"\n      ;;\n    esac |\n    sort\n) |\n  sed '\n     /^ac_cv_env_/b end\n     t clear\n     :clear\n     s/^\\([^=]*\\)=\\(.*[{}].*\\)$/test ${\\1+y} || &/\n     t end\n     s/^\\([^=]*\\)=\\(.*\\)$/\\1=${\\1=\\2}/\n     :end' >>confcache\nif diff \"$cache_file\" confcache >/dev/null 2>&1; then :; else\n  if test -w \"$cache_file\"; then\n    if test \"x$cache_file\" != \"x/dev/null\"; then\n      { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: updating cache $cache_file\" >&5\nprintf \"%s\\n\" \"$as_me: updating cache $cache_file\" >&6;}\n      if test ! -f \"$cache_file\" || test -h \"$cache_file\"; then\n\tcat confcache >\"$cache_file\"\n      else\n        case $cache_file in #(\n        */* | ?:*)\n\t  mv -f confcache \"$cache_file\"$$ &&\n\t  mv -f \"$cache_file\"$$ \"$cache_file\" ;; #(\n        *)\n\t  mv -f confcache \"$cache_file\" ;;\n\tesac\n      fi\n    fi\n  else\n    { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file\" >&5\nprintf \"%s\\n\" \"$as_me: not updating unwritable cache $cache_file\" >&6;}\n  fi\nfi\nrm -f confcache\n\ntest \"x$prefix\" = xNONE && prefix=$ac_default_prefix\n# Let make expand exec_prefix.\ntest \"x$exec_prefix\" = xNONE && exec_prefix='${prefix}'\n\n# Transform confdefs.h into DEFS.\n# Protect against shell expansion while executing Makefile rules.\n# Protect against Makefile macro expansion.\n#\n# If the first sed substitution is executed (which looks for macros that\n# take arguments), then branch to the quote section.  Otherwise,\n# look for a macro that doesn't take arguments.\nac_script='\n:mline\n/\\\\$/{\n N\n s,\\\\\\n,,\n b mline\n}\nt clear\n:clear\ns/^[\t ]*#[\t ]*define[\t ][\t ]*\\([^\t (][^\t (]*([^)]*)\\)[\t ]*\\(.*\\)/-D\\1=\\2/g\nt quote\ns/^[\t ]*#[\t ]*define[\t ][\t ]*\\([^\t ][^\t ]*\\)[\t ]*\\(.*\\)/-D\\1=\\2/g\nt quote\nb any\n:quote\ns/[\t `~#$^&*(){}\\\\|;'\\''\"<>?]/\\\\&/g\ns/\\[/\\\\&/g\ns/\\]/\\\\&/g\ns/\\$/$$/g\nH\n:any\n${\n\tg\n\ts/^\\n//\n\ts/\\n/ /g\n\tp\n}\n'\nDEFS=`sed -n \"$ac_script\" confdefs.h`\n\n\nac_libobjs=\nac_ltlibobjs=\nU=\nfor ac_i in : $LIBOBJS; do test \"x$ac_i\" = x: && continue\n  # 1. Remove the extension, and $U if already installed.\n  ac_script='s/\\$U\\././;s/\\.o$//;s/\\.obj$//'\n  ac_i=`printf \"%s\\n\" \"$ac_i\" | sed \"$ac_script\"`\n  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR\n  #    will be set to the directory where LIBOBJS objects are built.\n  as_fn_append ac_libobjs \" \\${LIBOBJDIR}$ac_i\\$U.$ac_objext\"\n  as_fn_append ac_ltlibobjs \" \\${LIBOBJDIR}$ac_i\"'$U.lo'\ndone\nLIBOBJS=$ac_libobjs\n\nLTLIBOBJS=$ac_ltlibobjs\n\n\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure\" >&5\nprintf %s \"checking that generated files are newer than configure... \" >&6; }\n   if test -n \"$am_sleep_pid\"; then\n     # Hide warnings about reused PIDs.\n     wait $am_sleep_pid 2>/dev/null\n   fi\n   { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: done\" >&5\nprintf \"%s\\n\" \"done\" >&6; }\n if test -n \"$EXEEXT\"; then\n  am__EXEEXT_TRUE=\n  am__EXEEXT_FALSE='#'\nelse\n  am__EXEEXT_TRUE='#'\n  am__EXEEXT_FALSE=\nfi\n\n\n: \"${CONFIG_STATUS=./config.status}\"\nac_write_fail=0\nac_clean_files_save=$ac_clean_files\nac_clean_files=\"$ac_clean_files $CONFIG_STATUS\"\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS\" >&5\nprintf \"%s\\n\" \"$as_me: creating $CONFIG_STATUS\" >&6;}\nas_write_fail=0\ncat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1\n#! $SHELL\n# Generated by $as_me.\n# Run this file to recreate the current configuration.\n# Compiler output produced by configure, useful for debugging\n# configure, is in config.log if it exists.\n\ndebug=false\nac_cs_recheck=false\nac_cs_silent=false\n\nSHELL=\\${CONFIG_SHELL-$SHELL}\nexport SHELL\n_ASEOF\ncat >>$CONFIG_STATUS <<\\_ASEOF || as_write_fail=1\n## -------------------- ##\n## M4sh Initialization. ##\n## -------------------- ##\n\n# Be more Bourne compatible\nDUALCASE=1; export DUALCASE # for MKS sh\nas_nop=:\nif test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1\nthen :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\n  setopt NO_GLOB_SUBST\nelse $as_nop\n  case `(set -o) 2>/dev/null` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac\nfi\n\n\n\n# Reset variables that may have inherited troublesome values from\n# the environment.\n\n# IFS needs to be set, to space, tab, and newline, in precisely that order.\n# (If _AS_PATH_WALK were called with IFS unset, it would have the\n# side effect of setting IFS to empty, thus disabling word splitting.)\n# Quoting is to prevent editors from complaining about space-tab.\nas_nl='\n'\nexport as_nl\nIFS=\" \"\"\t$as_nl\"\n\nPS1='$ '\nPS2='> '\nPS4='+ '\n\n# Ensure predictable behavior from utilities with locale-dependent output.\nLC_ALL=C\nexport LC_ALL\nLANGUAGE=C\nexport LANGUAGE\n\n# We cannot yet rely on \"unset\" to work, but we need these variables\n# to be unset--not just set to an empty or harmless value--now, to\n# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh).  This construct\n# also avoids known problems related to \"unset\" and subshell syntax\n# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).\nfor as_var in BASH_ENV ENV MAIL MAILPATH CDPATH\ndo eval test \\${$as_var+y} \\\n  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :\ndone\n\n# Ensure that fds 0, 1, and 2 are open.\nif (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi\nif (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi\nif (exec 3>&2)            ; then :; else exec 2>/dev/null; fi\n\n# The user is always right.\nif ${PATH_SEPARATOR+false} :; then\n  PATH_SEPARATOR=:\n  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n      PATH_SEPARATOR=';'\n  }\nfi\n\n\n# Find who we are.  Look in the path if we contain no directory separator.\nas_myself=\ncase $0 in #((\n  *[\\\\/]* ) as_myself=$0 ;;\n  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    test -r \"$as_dir$0\" && as_myself=$as_dir$0 && break\n  done\nIFS=$as_save_IFS\n\n     ;;\nesac\n# We did not find ourselves, most probably we were run as `sh COMMAND'\n# in which case we are not to be found in the path.\nif test \"x$as_myself\" = x; then\n  as_myself=$0\nfi\nif test ! -f \"$as_myself\"; then\n  printf \"%s\\n\" \"$as_myself: error: cannot find myself; rerun with an absolute file name\" >&2\n  exit 1\nfi\n\n\n\n# as_fn_error STATUS ERROR [LINENO LOG_FD]\n# ----------------------------------------\n# Output \"`basename $0`: error: ERROR\" to stderr. If LINENO and LOG_FD are\n# provided, also output the error to LOG_FD, referencing LINENO. Then exit the\n# script with STATUS, using 1 if that was 0.\nas_fn_error ()\n{\n  as_status=$1; test $as_status -eq 0 && as_status=1\n  if test \"$4\"; then\n    as_lineno=${as_lineno-\"$3\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: $2\" >&$4\n  fi\n  printf \"%s\\n\" \"$as_me: error: $2\" >&2\n  as_fn_exit $as_status\n} # as_fn_error\n\n\n\n# as_fn_set_status STATUS\n# -----------------------\n# Set $? to STATUS, without forking.\nas_fn_set_status ()\n{\n  return $1\n} # as_fn_set_status\n\n# as_fn_exit STATUS\n# -----------------\n# Exit the shell with STATUS, even in a \"trap 0\" or \"set -e\" context.\nas_fn_exit ()\n{\n  set +e\n  as_fn_set_status $1\n  exit $1\n} # as_fn_exit\n\n# as_fn_unset VAR\n# ---------------\n# Portably unset VAR.\nas_fn_unset ()\n{\n  { eval $1=; unset $1;}\n}\nas_unset=as_fn_unset\n\n# as_fn_append VAR VALUE\n# ----------------------\n# Append the text in VALUE to the end of the definition contained in VAR. Take\n# advantage of any shell optimizations that allow amortized linear growth over\n# repeated appends, instead of the typical quadratic growth present in naive\n# implementations.\nif (eval \"as_var=1; as_var+=2; test x\\$as_var = x12\") 2>/dev/null\nthen :\n  eval 'as_fn_append ()\n  {\n    eval $1+=\\$2\n  }'\nelse $as_nop\n  as_fn_append ()\n  {\n    eval $1=\\$$1\\$2\n  }\nfi # as_fn_append\n\n# as_fn_arith ARG...\n# ------------------\n# Perform arithmetic evaluation on the ARGs, and store the result in the\n# global $as_val. Take advantage of shells that can avoid forks. The arguments\n# must be portable across $(()) and expr.\nif (eval \"test \\$(( 1 + 1 )) = 2\") 2>/dev/null\nthen :\n  eval 'as_fn_arith ()\n  {\n    as_val=$(( $* ))\n  }'\nelse $as_nop\n  as_fn_arith ()\n  {\n    as_val=`expr \"$@\" || test $? -eq 1`\n  }\nfi # as_fn_arith\n\n\nif expr a : '\\(a\\)' >/dev/null 2>&1 &&\n   test \"X`expr 00001 : '.*\\(...\\)'`\" = X001; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nif (basename -- /) >/dev/null 2>&1 && test \"X`basename -- / 2>&1`\" = \"X/\"; then\n  as_basename=basename\nelse\n  as_basename=false\nfi\n\nif (as_dir=`dirname -- /` && test \"X$as_dir\" = X/) >/dev/null 2>&1; then\n  as_dirname=dirname\nelse\n  as_dirname=false\nfi\n\nas_me=`$as_basename -- \"$0\" ||\n$as_expr X/\"$0\" : '.*/\\([^/][^/]*\\)/*$' \\| \\\n\t X\"$0\" : 'X\\(//\\)$' \\| \\\n\t X\"$0\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X/\"$0\" |\n    sed '/^.*\\/\\([^/][^/]*\\)\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n\n# Avoid depending upon Character Ranges.\nas_cr_letters='abcdefghijklmnopqrstuvwxyz'\nas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\nas_cr_Letters=$as_cr_letters$as_cr_LETTERS\nas_cr_digits='0123456789'\nas_cr_alnum=$as_cr_Letters$as_cr_digits\n\n\n# Determine whether it's possible to make 'echo' print without a newline.\n# These variables are no longer used directly by Autoconf, but are AC_SUBSTed\n# for compatibility with existing Makefiles.\nECHO_C= ECHO_N= ECHO_T=\ncase `echo -n x` in #(((((\n-n*)\n  case `echo 'xy\\c'` in\n  *c*) ECHO_T='\t';;\t# ECHO_T is single tab character.\n  xy)  ECHO_C='\\c';;\n  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null\n       ECHO_T='\t';;\n  esac;;\n*)\n  ECHO_N='-n';;\nesac\n\n# For backward compatibility with old third-party macros, we provide\n# the shell variables $as_echo and $as_echo_n.  New code should use\n# AS_ECHO([\"message\"]) and AS_ECHO_N([\"message\"]), respectively.\nas_echo='printf %s\\n'\nas_echo_n='printf %s'\n\nrm -f conf$$ conf$$.exe conf$$.file\nif test -d conf$$.dir; then\n  rm -f conf$$.dir/conf$$.file\nelse\n  rm -f conf$$.dir\n  mkdir conf$$.dir 2>/dev/null\nfi\nif (echo >conf$$.file) 2>/dev/null; then\n  if ln -s conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s='ln -s'\n    # ... but there are two gotchas:\n    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.\n    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.\n    # In both cases, we have to default to `cp -pR'.\n    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||\n      as_ln_s='cp -pR'\n  elif ln conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s=ln\n  else\n    as_ln_s='cp -pR'\n  fi\nelse\n  as_ln_s='cp -pR'\nfi\nrm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file\nrmdir conf$$.dir 2>/dev/null\n\n\n# as_fn_mkdir_p\n# -------------\n# Create \"$as_dir\" as a directory, including parents if necessary.\nas_fn_mkdir_p ()\n{\n\n  case $as_dir in #(\n  -*) as_dir=./$as_dir;;\n  esac\n  test -d \"$as_dir\" || eval $as_mkdir_p || {\n    as_dirs=\n    while :; do\n      case $as_dir in #(\n      *\\'*) as_qdir=`printf \"%s\\n\" \"$as_dir\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; #'(\n      *) as_qdir=$as_dir;;\n      esac\n      as_dirs=\"'$as_qdir' $as_dirs\"\n      as_dir=`$as_dirname -- \"$as_dir\" ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n      test -d \"$as_dir\" && break\n    done\n    test -z \"$as_dirs\" || eval \"mkdir $as_dirs\"\n  } || test -d \"$as_dir\" || as_fn_error $? \"cannot create directory $as_dir\"\n\n\n} # as_fn_mkdir_p\nif mkdir -p . 2>/dev/null; then\n  as_mkdir_p='mkdir -p \"$as_dir\"'\nelse\n  test -d ./-p && rmdir ./-p\n  as_mkdir_p=false\nfi\n\n\n# as_fn_executable_p FILE\n# -----------------------\n# Test if FILE is an executable regular file.\nas_fn_executable_p ()\n{\n  test -f \"$1\" && test -x \"$1\"\n} # as_fn_executable_p\nas_test_x='test -x'\nas_executable_p=as_fn_executable_p\n\n# Sed expression to map a string onto a valid CPP name.\nas_tr_cpp=\"eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'\"\n\n# Sed expression to map a string onto a valid variable name.\nas_tr_sh=\"eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'\"\n\n\nexec 6>&1\n## ----------------------------------- ##\n## Main body of $CONFIG_STATUS script. ##\n## ----------------------------------- ##\n_ASEOF\ntest $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# Save the log message, to keep $0 and so on meaningful, and to\n# report actual input values of CONFIG_FILES etc. instead of their\n# values after options handling.\nac_log=\"\nThis file was extended by rufus $as_me 4.14, which was\ngenerated by GNU Autoconf 2.71.  Invocation command line was\n\n  CONFIG_FILES    = $CONFIG_FILES\n  CONFIG_HEADERS  = $CONFIG_HEADERS\n  CONFIG_LINKS    = $CONFIG_LINKS\n  CONFIG_COMMANDS = $CONFIG_COMMANDS\n  $ $0 $@\n\non `(hostname || uname -n) 2>/dev/null | sed 1q`\n\"\n\n_ACEOF\n\ncase $ac_config_files in *\"\n\"*) set x $ac_config_files; shift; ac_config_files=$*;;\nesac\n\n\n\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n# Files that config.status was made for.\nconfig_files=\"$ac_config_files\"\n\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nac_cs_usage=\"\\\n\\`$as_me' instantiates files and other configuration actions\nfrom templates according to the current configuration.  Unless the files\nand actions are specified as TAGs, all are instantiated by default.\n\nUsage: $0 [OPTION]... [TAG]...\n\n  -h, --help       print this help, then exit\n  -V, --version    print version number and configuration settings, then exit\n      --config     print configuration, then exit\n  -q, --quiet, --silent\n                   do not print progress messages\n  -d, --debug      don't remove temporary files\n      --recheck    update $as_me by reconfiguring in the same conditions\n      --file=FILE[:TEMPLATE]\n                   instantiate the configuration file FILE\n\nConfiguration files:\n$config_files\n\nReport bugs to <https://github.com/pbatard/rufus/issues>.\nrufus home page: <https://rufus.ie>.\"\n\n_ACEOF\nac_cs_config=`printf \"%s\\n\" \"$ac_configure_args\" | sed \"$ac_safe_unquote\"`\nac_cs_config_escaped=`printf \"%s\\n\" \"$ac_cs_config\" | sed \"s/^ //; s/'/'\\\\\\\\\\\\\\\\''/g\"`\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nac_cs_config='$ac_cs_config_escaped'\nac_cs_version=\"\\\\\nrufus config.status 4.14\nconfigured by $0, generated by GNU Autoconf 2.71,\n  with options \\\\\"\\$ac_cs_config\\\\\"\n\nCopyright (C) 2021 Free Software Foundation, Inc.\nThis config.status script is free software; the Free Software Foundation\ngives unlimited permission to copy, distribute and modify it.\"\n\nac_pwd='$ac_pwd'\nsrcdir='$srcdir'\nINSTALL='$INSTALL'\nMKDIR_P='$MKDIR_P'\nAWK='$AWK'\ntest -n \"\\$AWK\" || AWK=awk\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# The default lists apply if the user does not specify any file.\nac_need_defaults=:\nwhile test $# != 0\ndo\n  case $1 in\n  --*=?*)\n    ac_option=`expr \"X$1\" : 'X\\([^=]*\\)='`\n    ac_optarg=`expr \"X$1\" : 'X[^=]*=\\(.*\\)'`\n    ac_shift=:\n    ;;\n  --*=)\n    ac_option=`expr \"X$1\" : 'X\\([^=]*\\)='`\n    ac_optarg=\n    ac_shift=:\n    ;;\n  *)\n    ac_option=$1\n    ac_optarg=$2\n    ac_shift=shift\n    ;;\n  esac\n\n  case $ac_option in\n  # Handling of the options.\n  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)\n    ac_cs_recheck=: ;;\n  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )\n    printf \"%s\\n\" \"$ac_cs_version\"; exit ;;\n  --config | --confi | --conf | --con | --co | --c )\n    printf \"%s\\n\" \"$ac_cs_config\"; exit ;;\n  --debug | --debu | --deb | --de | --d | -d )\n    debug=: ;;\n  --file | --fil | --fi | --f )\n    $ac_shift\n    case $ac_optarg in\n    *\\'*) ac_optarg=`printf \"%s\\n\" \"$ac_optarg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    '') as_fn_error $? \"missing file argument\" ;;\n    esac\n    as_fn_append CONFIG_FILES \" '$ac_optarg'\"\n    ac_need_defaults=false;;\n  --he | --h |  --help | --hel | -h )\n    printf \"%s\\n\" \"$ac_cs_usage\"; exit ;;\n  -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n  | -silent | --silent | --silen | --sile | --sil | --si | --s)\n    ac_cs_silent=: ;;\n\n  # This is an error.\n  -*) as_fn_error $? \"unrecognized option: \\`$1'\nTry \\`$0 --help' for more information.\" ;;\n\n  *) as_fn_append ac_config_targets \" $1\"\n     ac_need_defaults=false ;;\n\n  esac\n  shift\ndone\n\nac_configure_extra_args=\n\nif $ac_cs_silent; then\n  exec 6>/dev/null\n  ac_configure_extra_args=\"$ac_configure_extra_args --silent\"\nfi\n\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nif \\$ac_cs_recheck; then\n  set X $SHELL '$0' $ac_configure_args \\$ac_configure_extra_args --no-create --no-recursion\n  shift\n  \\printf \"%s\\n\" \"running CONFIG_SHELL=$SHELL \\$*\" >&6\n  CONFIG_SHELL='$SHELL'\n  export CONFIG_SHELL\n  exec \"\\$@\"\nfi\n\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nexec 5>>config.log\n{\n  echo\n  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX\n## Running $as_me. ##\n_ASBOX\n  printf \"%s\\n\" \"$ac_log\"\n} >&5\n\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n\n# Handling of arguments.\nfor ac_config_target in $ac_config_targets\ndo\n  case $ac_config_target in\n    \"Makefile\") CONFIG_FILES=\"$CONFIG_FILES Makefile\" ;;\n    \".mingw/Makefile\") CONFIG_FILES=\"$CONFIG_FILES .mingw/Makefile\" ;;\n    \"src/Makefile\") CONFIG_FILES=\"$CONFIG_FILES src/Makefile\" ;;\n    \"src/bled/Makefile\") CONFIG_FILES=\"$CONFIG_FILES src/bled/Makefile\" ;;\n    \"src/ext2fs/Makefile\") CONFIG_FILES=\"$CONFIG_FILES src/ext2fs/Makefile\" ;;\n    \"src/libcdio/iso9660/Makefile\") CONFIG_FILES=\"$CONFIG_FILES src/libcdio/iso9660/Makefile\" ;;\n    \"src/libcdio/udf/Makefile\") CONFIG_FILES=\"$CONFIG_FILES src/libcdio/udf/Makefile\" ;;\n    \"src/libcdio/driver/Makefile\") CONFIG_FILES=\"$CONFIG_FILES src/libcdio/driver/Makefile\" ;;\n    \"res/loc/Makefile\") CONFIG_FILES=\"$CONFIG_FILES res/loc/Makefile\" ;;\n    \"src/ms-sys/Makefile\") CONFIG_FILES=\"$CONFIG_FILES src/ms-sys/Makefile\" ;;\n    \"src/syslinux/libfat/Makefile\") CONFIG_FILES=\"$CONFIG_FILES src/syslinux/libfat/Makefile\" ;;\n    \"src/syslinux/libinstaller/Makefile\") CONFIG_FILES=\"$CONFIG_FILES src/syslinux/libinstaller/Makefile\" ;;\n    \"src/syslinux/win/Makefile\") CONFIG_FILES=\"$CONFIG_FILES src/syslinux/win/Makefile\" ;;\n    \"src/wimlib/Makefile\") CONFIG_FILES=\"$CONFIG_FILES src/wimlib/Makefile\" ;;\n\n  *) as_fn_error $? \"invalid argument: \\`$ac_config_target'\" \"$LINENO\" 5;;\n  esac\ndone\n\n\n# If the user did not use the arguments to specify the items to instantiate,\n# then the envvar interface is used.  Set only those that are not.\n# We use the long form for the default assignment because of an extremely\n# bizarre bug on SunOS 4.1.3.\nif $ac_need_defaults; then\n  test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files\nfi\n\n# Have a temporary directory for convenience.  Make it in the build tree\n# simply because there is no reason against having it here, and in addition,\n# creating and moving files from /tmp can sometimes cause problems.\n# Hook for its removal unless debugging.\n# Note that there is a small window in which the directory will not be cleaned:\n# after its creation but before its name has been assigned to `$tmp'.\n$debug ||\n{\n  tmp= ac_tmp=\n  trap 'exit_status=$?\n  : \"${ac_tmp:=$tmp}\"\n  { test ! -d \"$ac_tmp\" || rm -fr \"$ac_tmp\"; } && exit $exit_status\n' 0\n  trap 'as_fn_exit 1' 1 2 13 15\n}\n# Create a (secure) tmp directory for tmp files.\n\n{\n  tmp=`(umask 077 && mktemp -d \"./confXXXXXX\") 2>/dev/null` &&\n  test -d \"$tmp\"\n}  ||\n{\n  tmp=./conf$$-$RANDOM\n  (umask 077 && mkdir \"$tmp\")\n} || as_fn_error $? \"cannot create a temporary directory in .\" \"$LINENO\" 5\nac_tmp=$tmp\n\n# Set up the scripts for CONFIG_FILES section.\n# No need to generate them if there are no CONFIG_FILES.\n# This happens for instance with `./config.status config.h'.\nif test -n \"$CONFIG_FILES\"; then\n\n\nac_cr=`echo X | tr X '\\015'`\n# On cygwin, bash can eat \\r inside `` if the user requested igncr.\n# But we know of no other shell where ac_cr would be empty at this\n# point, so we can use a bashism as a fallback.\nif test \"x$ac_cr\" = x; then\n  eval ac_cr=\\$\\'\\\\r\\'\nfi\nac_cs_awk_cr=`$AWK 'BEGIN { print \"a\\rb\" }' </dev/null 2>/dev/null`\nif test \"$ac_cs_awk_cr\" = \"a${ac_cr}b\"; then\n  ac_cs_awk_cr='\\\\r'\nelse\n  ac_cs_awk_cr=$ac_cr\nfi\n\necho 'BEGIN {' >\"$ac_tmp/subs1.awk\" &&\n_ACEOF\n\n\n{\n  echo \"cat >conf$$subs.awk <<_ACEOF\" &&\n  echo \"$ac_subst_vars\" | sed 's/.*/&!$&$ac_delim/' &&\n  echo \"_ACEOF\"\n} >conf$$subs.sh ||\n  as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\nac_delim_num=`echo \"$ac_subst_vars\" | grep -c '^'`\nac_delim='%!_!# '\nfor ac_last_try in false false false false false :; do\n  . ./conf$$subs.sh ||\n    as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\n\n  ac_delim_n=`sed -n \"s/.*$ac_delim\\$/X/p\" conf$$subs.awk | grep -c X`\n  if test $ac_delim_n = $ac_delim_num; then\n    break\n  elif $ac_last_try; then\n    as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\n  else\n    ac_delim=\"$ac_delim!$ac_delim _$ac_delim!! \"\n  fi\ndone\nrm -f conf$$subs.sh\n\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\ncat >>\"\\$ac_tmp/subs1.awk\" <<\\\\_ACAWK &&\n_ACEOF\nsed -n '\nh\ns/^/S[\"/; s/!.*/\"]=/\np\ng\ns/^[^!]*!//\n:repl\nt repl\ns/'\"$ac_delim\"'$//\nt delim\n:nl\nh\ns/\\(.\\{148\\}\\)..*/\\1/\nt more1\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\\\\n\"\\\\/\np\nn\nb repl\n:more1\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"\\\\/\np\ng\ns/.\\{148\\}//\nt nl\n:delim\nh\ns/\\(.\\{148\\}\\)..*/\\1/\nt more2\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"/\np\nb\n:more2\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"\\\\/\np\ng\ns/.\\{148\\}//\nt delim\n' <conf$$subs.awk | sed '\n/^[^\"\"]/{\n  N\n  s/\\n//\n}\n' >>$CONFIG_STATUS || ac_write_fail=1\nrm -f conf$$subs.awk\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n_ACAWK\ncat >>\"\\$ac_tmp/subs1.awk\" <<_ACAWK &&\n  for (key in S) S_is_set[key] = 1\n  FS = \"\u0007\"\n\n}\n{\n  line = $ 0\n  nfields = split(line, field, \"@\")\n  substed = 0\n  len = length(field[1])\n  for (i = 2; i < nfields; i++) {\n    key = field[i]\n    keylen = length(key)\n    if (S_is_set[key]) {\n      value = S[key]\n      line = substr(line, 1, len) \"\" value \"\" substr(line, len + keylen + 3)\n      len += length(value) + length(field[++i])\n      substed = 1\n    } else\n      len += 1 + keylen\n  }\n\n  print line\n}\n\n_ACAWK\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nif sed \"s/$ac_cr//\" < /dev/null > /dev/null 2>&1; then\n  sed \"s/$ac_cr\\$//; s/$ac_cr/$ac_cs_awk_cr/g\"\nelse\n  cat\nfi < \"$ac_tmp/subs1.awk\" > \"$ac_tmp/subs.awk\" \\\n  || as_fn_error $? \"could not setup config files machinery\" \"$LINENO\" 5\n_ACEOF\n\n# VPATH may cause trouble with some makes, so we remove sole $(srcdir),\n# ${srcdir} and @srcdir@ entries from VPATH if srcdir is \".\", strip leading and\n# trailing colons and then remove the whole line if VPATH becomes empty\n# (actually we leave an empty line to preserve line numbers).\nif test \"x$srcdir\" = x.; then\n  ac_vpsub='/^[\t ]*VPATH[\t ]*=[\t ]*/{\nh\ns///\ns/^/:/\ns/[\t ]*$/:/\ns/:\\$(srcdir):/:/g\ns/:\\${srcdir}:/:/g\ns/:@srcdir@:/:/g\ns/^:*//\ns/:*$//\nx\ns/\\(=[\t ]*\\).*/\\1/\nG\ns/\\n//\ns/^[^=]*=[\t ]*$//\n}'\nfi\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nfi # test -n \"$CONFIG_FILES\"\n\n\neval set X \"  :F $CONFIG_FILES      \"\nshift\nfor ac_tag\ndo\n  case $ac_tag in\n  :[FHLC]) ac_mode=$ac_tag; continue;;\n  esac\n  case $ac_mode$ac_tag in\n  :[FHL]*:*);;\n  :L* | :C*:*) as_fn_error $? \"invalid tag \\`$ac_tag'\" \"$LINENO\" 5;;\n  :[FH]-) ac_tag=-:-;;\n  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;\n  esac\n  ac_save_IFS=$IFS\n  IFS=:\n  set x $ac_tag\n  IFS=$ac_save_IFS\n  shift\n  ac_file=$1\n  shift\n\n  case $ac_mode in\n  :L) ac_source=$1;;\n  :[FH])\n    ac_file_inputs=\n    for ac_f\n    do\n      case $ac_f in\n      -) ac_f=\"$ac_tmp/stdin\";;\n      *) # Look for the file first in the build tree, then in the source tree\n\t # (if the path is not absolute).  The absolute path cannot be DOS-style,\n\t # because $ac_f cannot contain `:'.\n\t test -f \"$ac_f\" ||\n\t   case $ac_f in\n\t   [\\\\/$]*) false;;\n\t   *) test -f \"$srcdir/$ac_f\" && ac_f=\"$srcdir/$ac_f\";;\n\t   esac ||\n\t   as_fn_error 1 \"cannot find input file: \\`$ac_f'\" \"$LINENO\" 5;;\n      esac\n      case $ac_f in *\\'*) ac_f=`printf \"%s\\n\" \"$ac_f\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; esac\n      as_fn_append ac_file_inputs \" '$ac_f'\"\n    done\n\n    # Let's still pretend it is `configure' which instantiates (i.e., don't\n    # use $as_me), people would be surprised to read:\n    #    /* config.h.  Generated by config.status.  */\n    configure_input='Generated from '`\n\t  printf \"%s\\n\" \"$*\" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'\n\t`' by configure.'\n    if test x\"$ac_file\" != x-; then\n      configure_input=\"$ac_file.  $configure_input\"\n      { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: creating $ac_file\" >&5\nprintf \"%s\\n\" \"$as_me: creating $ac_file\" >&6;}\n    fi\n    # Neutralize special characters interpreted by sed in replacement strings.\n    case $configure_input in #(\n    *\\&* | *\\|* | *\\\\* )\n       ac_sed_conf_input=`printf \"%s\\n\" \"$configure_input\" |\n       sed 's/[\\\\\\\\&|]/\\\\\\\\&/g'`;; #(\n    *) ac_sed_conf_input=$configure_input;;\n    esac\n\n    case $ac_tag in\n    *:-:* | *:-) cat >\"$ac_tmp/stdin\" \\\n      || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5 ;;\n    esac\n    ;;\n  esac\n\n  ac_dir=`$as_dirname -- \"$ac_file\" ||\n$as_expr X\"$ac_file\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)$' \\| \\\n\t X\"$ac_file\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X\"$ac_file\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n  as_dir=\"$ac_dir\"; as_fn_mkdir_p\n  ac_builddir=.\n\ncase \"$ac_dir\" in\n.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;\n*)\n  ac_dir_suffix=/`printf \"%s\\n\" \"$ac_dir\" | sed 's|^\\.[\\\\/]||'`\n  # A \"..\" for each directory in $ac_dir_suffix.\n  ac_top_builddir_sub=`printf \"%s\\n\" \"$ac_dir_suffix\" | sed 's|/[^\\\\/]*|/..|g;s|/||'`\n  case $ac_top_builddir_sub in\n  \"\") ac_top_builddir_sub=. ac_top_build_prefix= ;;\n  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;\n  esac ;;\nesac\nac_abs_top_builddir=$ac_pwd\nac_abs_builddir=$ac_pwd$ac_dir_suffix\n# for backward compatibility:\nac_top_builddir=$ac_top_build_prefix\n\ncase $srcdir in\n  .)  # We are building in place.\n    ac_srcdir=.\n    ac_top_srcdir=$ac_top_builddir_sub\n    ac_abs_top_srcdir=$ac_pwd ;;\n  [\\\\/]* | ?:[\\\\/]* )  # Absolute name.\n    ac_srcdir=$srcdir$ac_dir_suffix;\n    ac_top_srcdir=$srcdir\n    ac_abs_top_srcdir=$srcdir ;;\n  *) # Relative name.\n    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix\n    ac_top_srcdir=$ac_top_build_prefix$srcdir\n    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;\nesac\nac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix\n\n\n  case $ac_mode in\n  :F)\n  #\n  # CONFIG_FILE\n  #\n\n  case $INSTALL in\n  [\\\\/$]* | ?:[\\\\/]* ) ac_INSTALL=$INSTALL ;;\n  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;\n  esac\n  ac_MKDIR_P=$MKDIR_P\n  case $MKDIR_P in\n  [\\\\/$]* | ?:[\\\\/]* ) ;;\n  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;\n  esac\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# If the template does not know about datarootdir, expand it.\n# FIXME: This hack should be removed a few years after 2.60.\nac_datarootdir_hack=; ac_datarootdir_seen=\nac_sed_dataroot='\n/datarootdir/ {\n  p\n  q\n}\n/@datadir@/p\n/@docdir@/p\n/@infodir@/p\n/@localedir@/p\n/@mandir@/p'\ncase `eval \"sed -n \\\"\\$ac_sed_dataroot\\\" $ac_file_inputs\"` in\n*datarootdir*) ac_datarootdir_seen=yes;;\n*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting\" >&2;}\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n  ac_datarootdir_hack='\n  s&@datadir@&$datadir&g\n  s&@docdir@&$docdir&g\n  s&@infodir@&$infodir&g\n  s&@localedir@&$localedir&g\n  s&@mandir@&$mandir&g\n  s&\\\\\\${datarootdir}&$datarootdir&g' ;;\nesac\n_ACEOF\n\n# Neutralize VPATH when `$srcdir' = `.'.\n# Shell code in configure.ac might set extrasub.\n# FIXME: do we really want to maintain this feature?\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nac_sed_extra=\"$ac_vpsub\n$extrasub\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n:t\n/@[a-zA-Z_][a-zA-Z_0-9]*@/!b\ns|@configure_input@|$ac_sed_conf_input|;t t\ns&@top_builddir@&$ac_top_builddir_sub&;t t\ns&@top_build_prefix@&$ac_top_build_prefix&;t t\ns&@srcdir@&$ac_srcdir&;t t\ns&@abs_srcdir@&$ac_abs_srcdir&;t t\ns&@top_srcdir@&$ac_top_srcdir&;t t\ns&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t\ns&@builddir@&$ac_builddir&;t t\ns&@abs_builddir@&$ac_abs_builddir&;t t\ns&@abs_top_builddir@&$ac_abs_top_builddir&;t t\ns&@INSTALL@&$ac_INSTALL&;t t\ns&@MKDIR_P@&$ac_MKDIR_P&;t t\n$ac_datarootdir_hack\n\"\neval sed \\\"\\$ac_sed_extra\\\" \"$ac_file_inputs\" | $AWK -f \"$ac_tmp/subs.awk\" \\\n  >$ac_tmp/out || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n\ntest -z \"$ac_datarootdir_hack$ac_datarootdir_seen\" &&\n  { ac_out=`sed -n '/\\${datarootdir}/p' \"$ac_tmp/out\"`; test -n \"$ac_out\"; } &&\n  { ac_out=`sed -n '/^[\t ]*datarootdir[\t ]*:*=/p' \\\n      \"$ac_tmp/out\"`; test -z \"$ac_out\"; } &&\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \\`datarootdir'\nwhich seems to be undefined.  Please make sure it is defined\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: $ac_file contains a reference to the variable \\`datarootdir'\nwhich seems to be undefined.  Please make sure it is defined\" >&2;}\n\n  rm -f \"$ac_tmp/stdin\"\n  case $ac_file in\n  -) cat \"$ac_tmp/out\" && rm -f \"$ac_tmp/out\";;\n  *) rm -f \"$ac_file\" && mv \"$ac_tmp/out\" \"$ac_file\";;\n  esac \\\n  || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n ;;\n\n\n\n  esac\n\ndone # for ac_tag\n\n\nas_fn_exit 0\n_ACEOF\nac_clean_files=$ac_clean_files_save\n\ntest $ac_write_fail = 0 ||\n  as_fn_error $? \"write failure creating $CONFIG_STATUS\" \"$LINENO\" 5\n\n\n# configure is writing to config.log, and then calls config.status.\n# config.status does its own redirection, appending to config.log.\n# Unfortunately, on DOS this fails, as config.log is still kept open\n# by configure, so config.status won't be able to write to it; its\n# output is simply discarded.  So we exec the FD to /dev/null,\n# effectively closing config.log, so it can be properly (re)opened and\n# appended to by config.status.  When coming back to configure, we\n# need to make the FD available again.\nif test \"$no_create\" != yes; then\n  ac_cs_success=:\n  ac_config_status_args=\n  test \"$silent\" = yes &&\n    ac_config_status_args=\"$ac_config_status_args --quiet\"\n  exec 5>/dev/null\n  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false\n  exec 5>>config.log\n  # Use ||, not &&, to avoid exiting from the if with $? = 1, which\n  # would make configure fail if this is the last instruction.\n  $ac_cs_success || as_fn_exit 1\nfi\nif test -n \"$ac_unrecognized_opts\" && test \"$enable_option_checking\" != no; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: unrecognized options: $ac_unrecognized_opts\" >&2;}\nfi\n\n\n"
  },
  {
    "path": "configure.ac",
    "content": "AC_INIT([rufus], [4.14], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie])\nAM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])\nAC_CONFIG_SRCDIR([src/rufus.c])\nAC_CONFIG_MACRO_DIR([m4])\nAM_SILENT_RULES([yes])\n\nAC_PREREQ([2.50])\nAC_PROG_CC\n# autoconf 2.61 doesn't have AC_PROG_AR, but 2.63 has it\nAC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])\nAC_PROG_AR\nAC_PROG_RANLIB\nAC_PROG_SED\nAC_PATH_PROG(RM, rm, rm)\nAC_CHECK_TOOL(DLLTOOL, dlltool, :)\nAC_CHECK_TOOL(STRIP, strip, :)\nAC_CHECK_TOOL(WINDRES, windres, :)\nAC_C_INLINE\nAC_DEFINE([_GNU_SOURCE], [], [Use GNU extensions])\n\nAM_CFLAGS=\"${AM_CFLAGS} -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00 -D_WIN32_IE=0x0A00\"\n# \"-Wl,--nxcompat\" to enable DEP (Data Execution Prevention)\n# \"-Wl,--dynamicbase\" to enable ASLR (Address Space Layout Randomization)\nAM_LDFLAGS=\"${AM_LDFLAGS} -Wl,-no-undefined -Wl,--nxcompat -Wl,--no-insert-timestamp -Wl,--dynamicbase\"\n\n# Debug symbols\nAC_ARG_ENABLE([debug],\n\t[AS_HELP_STRING([--enable-debug],\n\t\t[keep debug symbols for gdb (default=yes)])],\n\t[debug_enabled=$enableval],\n\t[debug_enabled='yes'])\nif test \"x$debug_enabled\" != \"xno\" ; then\n  CFLAGS=\"-g -O0\"\nelse\n  CFLAGS=\"-Os\"\n  LDFLAGS=\"-s\"\nfi\n\n# Alpha/Beta/Test\nAC_ARG_ENABLE([alpha],[AS_HELP_STRING([--enable-alpha], [build an ALPHA release (default=no)])], [alpha_enabled=$enableval], [alpha_enabled='no'])\nif test \"x$alpha_enabled\" != \"xno\" ; then\n  CFLAGS+=\" -DALPHA\"\n  SUFFIX=_ALPHA\nfi\nAC_ARG_ENABLE([beta],[AS_HELP_STRING([--enable-beta], [build a BETA release (default=no)])], [beta_enabled=$enableval], [beta_enabled='no'])\nif test \"x$beta_enabled\" != \"xno\" ; then\n  CFLAGS+=\" -DBETA\"\n  SUFFIX=_BETA\nfi\nAC_ARG_ENABLE([test],[AS_HELP_STRING([--enable-test=#], [build a TEST release (default=no)])], [test_enabled=$enableval], [test_enabled='no'])\nif test \"x$test_enabled\" != \"xno\" ; then\n  if test \"x$test_enabled\" == \"xyes\" ; then $enableval=\"\" ; fi\n  CFLAGS+=\" -DTEST=$enableval\"\n  SUFFIX=_TEST$enableval\nfi\n\nAC_MSG_RESULT([enabling Large File Support (ISO support)])\nAM_CFLAGS=\"$AM_CFLAGS -D_FILE_OFFSET_BITS=64 -D_OFF_T_ -D_off_t=off64_t -Doff_t=off64_t -Doff32_t=long\"\n\n# Check for -Wno-pointer-sign compiler support (GCC >= 4)\nsaved_CFLAGS=\"${CFLAGS}\"\nCFLAGS=\"$CFLAGS -Wno-pointer-sign\"\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],\n\t[nopointersign_cflags=\"-Wno-pointer-sign\"], [nopointersign_cflags=\"\"])\nCFLAGS=\"${saved_CFLAGS}\"\n\n# NB: The DECLSPEC_IMPORT redefinition below is a temporary(?) workaround for MinGW32 delay-loading\n# See https://github.com/pbatard/rufus/pull/2513 as well as https://sourceware.org/bugzilla/show_bug.cgi?id=14339\nAM_CFLAGS=\"$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -D__USE_MINGW_ANSI_STDIO=0 -UDECLSPEC_IMPORT -DDECLSPEC_IMPORT=__attribute__\\(\\(visibility\\(\\\\\\\"hidden\\\\\\\"\\)\\)\\) -std=gnu11 -Wshadow -Wall -Wformat-security -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Wno-array-bounds -Werror-implicit-function-declaration -Wbidi-chars=none $nopointersign_cflags\"\n\nAC_SUBST([VISIBILITY_CFLAGS])\nAC_SUBST([AM_CFLAGS])\nAC_SUBST([AM_LDFLAGS])\nAC_SUBST([SUFFIX])\n\nAC_CONFIG_FILES([Makefile])\nAC_CONFIG_FILES([.mingw/Makefile])\nAC_CONFIG_FILES([src/Makefile])\nAC_CONFIG_FILES([src/bled/Makefile])\nAC_CONFIG_FILES([src/ext2fs/Makefile])\nAC_CONFIG_FILES([src/libcdio/iso9660/Makefile])\nAC_CONFIG_FILES([src/libcdio/udf/Makefile])\nAC_CONFIG_FILES([src/libcdio/driver/Makefile])\nAC_CONFIG_FILES([res/loc/Makefile])\nAC_CONFIG_FILES([src/ms-sys/Makefile])\nAC_CONFIG_FILES([src/syslinux/libfat/Makefile])\nAC_CONFIG_FILES([src/syslinux/libinstaller/Makefile])\nAC_CONFIG_FILES([src/syslinux/win/Makefile])\nAC_CONFIG_FILES([src/wimlib/Makefile])\nAC_OUTPUT\n"
  },
  {
    "path": "install-sh",
    "content": "#!/bin/sh\n# install - install a program, script, or datafile\n\nscriptversion=2020-11-14.01; # UTC\n\n# This originates from X11R5 (mit/util/scripts/install.sh), which was\n# later released in X11R6 (xc/config/util/install.sh) with the\n# following copyright and license.\n#\n# Copyright (C) 1994 X Consortium\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to\n# deal in the Software without restriction, including without limitation the\n# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n# sell copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-\n# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n# Except as contained in this notice, the name of the X Consortium shall not\n# be used in advertising or otherwise to promote the sale, use or other deal-\n# ings in this Software without prior written authorization from the X Consor-\n# tium.\n#\n#\n# FSF changes to this file are in the public domain.\n#\n# Calling this script install-sh is preferred over install.sh, to prevent\n# 'make' implicit rules from creating a file called install from it\n# when there is no Makefile.\n#\n# This script is compatible with the BSD install script, but was written\n# from scratch.\n\ntab='\t'\nnl='\n'\nIFS=\" $tab$nl\"\n\n# Set DOITPROG to \"echo\" to test this script.\n\ndoit=${DOITPROG-}\ndoit_exec=${doit:-exec}\n\n# Put in absolute file names if you don't have them in your path;\n# or use environment vars.\n\nchgrpprog=${CHGRPPROG-chgrp}\nchmodprog=${CHMODPROG-chmod}\nchownprog=${CHOWNPROG-chown}\ncmpprog=${CMPPROG-cmp}\ncpprog=${CPPROG-cp}\nmkdirprog=${MKDIRPROG-mkdir}\nmvprog=${MVPROG-mv}\nrmprog=${RMPROG-rm}\nstripprog=${STRIPPROG-strip}\n\nposix_mkdir=\n\n# Desired mode of installed file.\nmode=0755\n\n# Create dirs (including intermediate dirs) using mode 755.\n# This is like GNU 'install' as of coreutils 8.32 (2020).\nmkdir_umask=22\n\nbackupsuffix=\nchgrpcmd=\nchmodcmd=$chmodprog\nchowncmd=\nmvcmd=$mvprog\nrmcmd=\"$rmprog -f\"\nstripcmd=\n\nsrc=\ndst=\ndir_arg=\ndst_arg=\n\ncopy_on_change=false\nis_target_a_directory=possibly\n\nusage=\"\\\nUsage: $0 [OPTION]... [-T] SRCFILE DSTFILE\n   or: $0 [OPTION]... SRCFILES... DIRECTORY\n   or: $0 [OPTION]... -t DIRECTORY SRCFILES...\n   or: $0 [OPTION]... -d DIRECTORIES...\n\nIn the 1st form, copy SRCFILE to DSTFILE.\nIn the 2nd and 3rd, copy all SRCFILES to DIRECTORY.\nIn the 4th, create DIRECTORIES.\n\nOptions:\n     --help     display this help and exit.\n     --version  display version info and exit.\n\n  -c            (ignored)\n  -C            install only if different (preserve data modification time)\n  -d            create directories instead of installing files.\n  -g GROUP      $chgrpprog installed files to GROUP.\n  -m MODE       $chmodprog installed files to MODE.\n  -o USER       $chownprog installed files to USER.\n  -p            pass -p to $cpprog.\n  -s            $stripprog installed files.\n  -S SUFFIX     attempt to back up existing files, with suffix SUFFIX.\n  -t DIRECTORY  install into DIRECTORY.\n  -T            report an error if DSTFILE is a directory.\n\nEnvironment variables override the default commands:\n  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG\n  RMPROG STRIPPROG\n\nBy default, rm is invoked with -f; when overridden with RMPROG,\nit's up to you to specify -f if you want it.\n\nIf -S is not specified, no backups are attempted.\n\nEmail bug reports to bug-automake@gnu.org.\nAutomake home page: https://www.gnu.org/software/automake/\n\"\n\nwhile test $# -ne 0; do\n  case $1 in\n    -c) ;;\n\n    -C) copy_on_change=true;;\n\n    -d) dir_arg=true;;\n\n    -g) chgrpcmd=\"$chgrpprog $2\"\n        shift;;\n\n    --help) echo \"$usage\"; exit $?;;\n\n    -m) mode=$2\n        case $mode in\n          *' '* | *\"$tab\"* | *\"$nl\"* | *'*'* | *'?'* | *'['*)\n            echo \"$0: invalid mode: $mode\" >&2\n            exit 1;;\n        esac\n        shift;;\n\n    -o) chowncmd=\"$chownprog $2\"\n        shift;;\n\n    -p) cpprog=\"$cpprog -p\";;\n\n    -s) stripcmd=$stripprog;;\n\n    -S) backupsuffix=\"$2\"\n        shift;;\n\n    -t)\n        is_target_a_directory=always\n        dst_arg=$2\n        # Protect names problematic for 'test' and other utilities.\n        case $dst_arg in\n          -* | [=\\(\\)!]) dst_arg=./$dst_arg;;\n        esac\n        shift;;\n\n    -T) is_target_a_directory=never;;\n\n    --version) echo \"$0 $scriptversion\"; exit $?;;\n\n    --) shift\n        break;;\n\n    -*) echo \"$0: invalid option: $1\" >&2\n        exit 1;;\n\n    *)  break;;\n  esac\n  shift\ndone\n\n# We allow the use of options -d and -T together, by making -d\n# take the precedence; this is for compatibility with GNU install.\n\nif test -n \"$dir_arg\"; then\n  if test -n \"$dst_arg\"; then\n    echo \"$0: target directory not allowed when installing a directory.\" >&2\n    exit 1\n  fi\nfi\n\nif test $# -ne 0 && test -z \"$dir_arg$dst_arg\"; then\n  # When -d is used, all remaining arguments are directories to create.\n  # When -t is used, the destination is already specified.\n  # Otherwise, the last argument is the destination.  Remove it from $@.\n  for arg\n  do\n    if test -n \"$dst_arg\"; then\n      # $@ is not empty: it contains at least $arg.\n      set fnord \"$@\" \"$dst_arg\"\n      shift # fnord\n    fi\n    shift # arg\n    dst_arg=$arg\n    # Protect names problematic for 'test' and other utilities.\n    case $dst_arg in\n      -* | [=\\(\\)!]) dst_arg=./$dst_arg;;\n    esac\n  done\nfi\n\nif test $# -eq 0; then\n  if test -z \"$dir_arg\"; then\n    echo \"$0: no input file specified.\" >&2\n    exit 1\n  fi\n  # It's OK to call 'install-sh -d' without argument.\n  # This can happen when creating conditional directories.\n  exit 0\nfi\n\nif test -z \"$dir_arg\"; then\n  if test $# -gt 1 || test \"$is_target_a_directory\" = always; then\n    if test ! -d \"$dst_arg\"; then\n      echo \"$0: $dst_arg: Is not a directory.\" >&2\n      exit 1\n    fi\n  fi\nfi\n\nif test -z \"$dir_arg\"; then\n  do_exit='(exit $ret); exit $ret'\n  trap \"ret=129; $do_exit\" 1\n  trap \"ret=130; $do_exit\" 2\n  trap \"ret=141; $do_exit\" 13\n  trap \"ret=143; $do_exit\" 15\n\n  # Set umask so as not to create temps with too-generous modes.\n  # However, 'strip' requires both read and write access to temps.\n  case $mode in\n    # Optimize common cases.\n    *644) cp_umask=133;;\n    *755) cp_umask=22;;\n\n    *[0-7])\n      if test -z \"$stripcmd\"; then\n        u_plus_rw=\n      else\n        u_plus_rw='% 200'\n      fi\n      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;\n    *)\n      if test -z \"$stripcmd\"; then\n        u_plus_rw=\n      else\n        u_plus_rw=,u+rw\n      fi\n      cp_umask=$mode$u_plus_rw;;\n  esac\nfi\n\nfor src\ndo\n  # Protect names problematic for 'test' and other utilities.\n  case $src in\n    -* | [=\\(\\)!]) src=./$src;;\n  esac\n\n  if test -n \"$dir_arg\"; then\n    dst=$src\n    dstdir=$dst\n    test -d \"$dstdir\"\n    dstdir_status=$?\n    # Don't chown directories that already exist.\n    if test $dstdir_status = 0; then\n      chowncmd=\"\"\n    fi\n  else\n\n    # Waiting for this to be detected by the \"$cpprog $src $dsttmp\" command\n    # might cause directories to be created, which would be especially bad\n    # if $src (and thus $dsttmp) contains '*'.\n    if test ! -f \"$src\" && test ! -d \"$src\"; then\n      echo \"$0: $src does not exist.\" >&2\n      exit 1\n    fi\n\n    if test -z \"$dst_arg\"; then\n      echo \"$0: no destination specified.\" >&2\n      exit 1\n    fi\n    dst=$dst_arg\n\n    # If destination is a directory, append the input filename.\n    if test -d \"$dst\"; then\n      if test \"$is_target_a_directory\" = never; then\n        echo \"$0: $dst_arg: Is a directory\" >&2\n        exit 1\n      fi\n      dstdir=$dst\n      dstbase=`basename \"$src\"`\n      case $dst in\n\t*/) dst=$dst$dstbase;;\n\t*)  dst=$dst/$dstbase;;\n      esac\n      dstdir_status=0\n    else\n      dstdir=`dirname \"$dst\"`\n      test -d \"$dstdir\"\n      dstdir_status=$?\n    fi\n  fi\n\n  case $dstdir in\n    */) dstdirslash=$dstdir;;\n    *)  dstdirslash=$dstdir/;;\n  esac\n\n  obsolete_mkdir_used=false\n\n  if test $dstdir_status != 0; then\n    case $posix_mkdir in\n      '')\n        # With -d, create the new directory with the user-specified mode.\n        # Otherwise, rely on $mkdir_umask.\n        if test -n \"$dir_arg\"; then\n          mkdir_mode=-m$mode\n        else\n          mkdir_mode=\n        fi\n\n        posix_mkdir=false\n\t# The $RANDOM variable is not portable (e.g., dash).  Use it\n\t# here however when possible just to lower collision chance.\n\ttmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$\n\n\ttrap '\n\t  ret=$?\n\t  rmdir \"$tmpdir/a/b\" \"$tmpdir/a\" \"$tmpdir\" 2>/dev/null\n\t  exit $ret\n\t' 0\n\n\t# Because \"mkdir -p\" follows existing symlinks and we likely work\n\t# directly in world-writeable /tmp, make sure that the '$tmpdir'\n\t# directory is successfully created first before we actually test\n\t# 'mkdir -p'.\n\tif (umask $mkdir_umask &&\n\t    $mkdirprog $mkdir_mode \"$tmpdir\" &&\n\t    exec $mkdirprog $mkdir_mode -p -- \"$tmpdir/a/b\") >/dev/null 2>&1\n\tthen\n\t  if test -z \"$dir_arg\" || {\n\t       # Check for POSIX incompatibilities with -m.\n\t       # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or\n\t       # other-writable bit of parent directory when it shouldn't.\n\t       # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.\n\t       test_tmpdir=\"$tmpdir/a\"\n\t       ls_ld_tmpdir=`ls -ld \"$test_tmpdir\"`\n\t       case $ls_ld_tmpdir in\n\t\t d????-?r-*) different_mode=700;;\n\t\t d????-?--*) different_mode=755;;\n\t\t *) false;;\n\t       esac &&\n\t       $mkdirprog -m$different_mode -p -- \"$test_tmpdir\" && {\n\t\t ls_ld_tmpdir_1=`ls -ld \"$test_tmpdir\"`\n\t\t test \"$ls_ld_tmpdir\" = \"$ls_ld_tmpdir_1\"\n\t       }\n\t     }\n\t  then posix_mkdir=:\n\t  fi\n\t  rmdir \"$tmpdir/a/b\" \"$tmpdir/a\" \"$tmpdir\"\n\telse\n\t  # Remove any dirs left behind by ancient mkdir implementations.\n\t  rmdir ./$mkdir_mode ./-p ./-- \"$tmpdir\" 2>/dev/null\n\tfi\n\ttrap '' 0;;\n    esac\n\n    if\n      $posix_mkdir && (\n        umask $mkdir_umask &&\n        $doit_exec $mkdirprog $mkdir_mode -p -- \"$dstdir\"\n      )\n    then :\n    else\n\n      # mkdir does not conform to POSIX,\n      # or it failed possibly due to a race condition.  Create the\n      # directory the slow way, step by step, checking for races as we go.\n\n      case $dstdir in\n        /*) prefix='/';;\n        [-=\\(\\)!]*) prefix='./';;\n        *)  prefix='';;\n      esac\n\n      oIFS=$IFS\n      IFS=/\n      set -f\n      set fnord $dstdir\n      shift\n      set +f\n      IFS=$oIFS\n\n      prefixes=\n\n      for d\n      do\n        test X\"$d\" = X && continue\n\n        prefix=$prefix$d\n        if test -d \"$prefix\"; then\n          prefixes=\n        else\n          if $posix_mkdir; then\n            (umask $mkdir_umask &&\n             $doit_exec $mkdirprog $mkdir_mode -p -- \"$dstdir\") && break\n            # Don't fail if two instances are running concurrently.\n            test -d \"$prefix\" || exit 1\n          else\n            case $prefix in\n              *\\'*) qprefix=`echo \"$prefix\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;;\n              *) qprefix=$prefix;;\n            esac\n            prefixes=\"$prefixes '$qprefix'\"\n          fi\n        fi\n        prefix=$prefix/\n      done\n\n      if test -n \"$prefixes\"; then\n        # Don't fail if two instances are running concurrently.\n        (umask $mkdir_umask &&\n         eval \"\\$doit_exec \\$mkdirprog $prefixes\") ||\n          test -d \"$dstdir\" || exit 1\n        obsolete_mkdir_used=true\n      fi\n    fi\n  fi\n\n  if test -n \"$dir_arg\"; then\n    { test -z \"$chowncmd\" || $doit $chowncmd \"$dst\"; } &&\n    { test -z \"$chgrpcmd\" || $doit $chgrpcmd \"$dst\"; } &&\n    { test \"$obsolete_mkdir_used$chowncmd$chgrpcmd\" = false ||\n      test -z \"$chmodcmd\" || $doit $chmodcmd $mode \"$dst\"; } || exit 1\n  else\n\n    # Make a couple of temp file names in the proper directory.\n    dsttmp=${dstdirslash}_inst.$$_\n    rmtmp=${dstdirslash}_rm.$$_\n\n    # Trap to clean up those temp files at exit.\n    trap 'ret=$?; rm -f \"$dsttmp\" \"$rmtmp\" && exit $ret' 0\n\n    # Copy the file name to the temp name.\n    (umask $cp_umask &&\n     { test -z \"$stripcmd\" || {\n\t # Create $dsttmp read-write so that cp doesn't create it read-only,\n\t # which would cause strip to fail.\n\t if test -z \"$doit\"; then\n\t   : >\"$dsttmp\" # No need to fork-exec 'touch'.\n\t else\n\t   $doit touch \"$dsttmp\"\n\t fi\n       }\n     } &&\n     $doit_exec $cpprog \"$src\" \"$dsttmp\") &&\n\n    # and set any options; do chmod last to preserve setuid bits.\n    #\n    # If any of these fail, we abort the whole thing.  If we want to\n    # ignore errors from any of these, just make sure not to ignore\n    # errors from the above \"$doit $cpprog $src $dsttmp\" command.\n    #\n    { test -z \"$chowncmd\" || $doit $chowncmd \"$dsttmp\"; } &&\n    { test -z \"$chgrpcmd\" || $doit $chgrpcmd \"$dsttmp\"; } &&\n    { test -z \"$stripcmd\" || $doit $stripcmd \"$dsttmp\"; } &&\n    { test -z \"$chmodcmd\" || $doit $chmodcmd $mode \"$dsttmp\"; } &&\n\n    # If -C, don't bother to copy if it wouldn't change the file.\n    if $copy_on_change &&\n       old=`LC_ALL=C ls -dlL \"$dst\"     2>/dev/null` &&\n       new=`LC_ALL=C ls -dlL \"$dsttmp\"  2>/dev/null` &&\n       set -f &&\n       set X $old && old=:$2:$4:$5:$6 &&\n       set X $new && new=:$2:$4:$5:$6 &&\n       set +f &&\n       test \"$old\" = \"$new\" &&\n       $cmpprog \"$dst\" \"$dsttmp\" >/dev/null 2>&1\n    then\n      rm -f \"$dsttmp\"\n    else\n      # If $backupsuffix is set, and the file being installed\n      # already exists, attempt a backup.  Don't worry if it fails,\n      # e.g., if mv doesn't support -f.\n      if test -n \"$backupsuffix\" && test -f \"$dst\"; then\n        $doit $mvcmd -f \"$dst\" \"$dst$backupsuffix\" 2>/dev/null\n      fi\n\n      # Rename the file to the real destination.\n      $doit $mvcmd -f \"$dsttmp\" \"$dst\" 2>/dev/null ||\n\n      # The rename failed, perhaps because mv can't rename something else\n      # to itself, or perhaps because mv is so ancient that it does not\n      # support -f.\n      {\n        # Now remove or move aside any old file at destination location.\n        # We try this two ways since rm can't unlink itself on some\n        # systems and the destination file might be busy for other\n        # reasons.  In this case, the final cleanup might fail but the new\n        # file should still install successfully.\n        {\n          test ! -f \"$dst\" ||\n          $doit $rmcmd \"$dst\" 2>/dev/null ||\n          { $doit $mvcmd -f \"$dst\" \"$rmtmp\" 2>/dev/null &&\n            { $doit $rmcmd \"$rmtmp\" 2>/dev/null; :; }\n          } ||\n          { echo \"$0: cannot unlink or rename $dst\" >&2\n            (exit 1); exit 1\n          }\n        } &&\n\n        # Now rename the file to the real destination.\n        $doit $mvcmd \"$dsttmp\" \"$dst\"\n      }\n    fi || exit 1\n\n    trap '' 0\n  fi\ndone\n\n# Local variables:\n# eval: (add-hook 'before-save-hook 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC0\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "missing",
    "content": "#! /bin/sh\n# Common wrapper for a few potentially missing GNU programs.\n\nscriptversion=2013-10-28.13; # UTC\n\n# Copyright (C) 1996-2013 Free Software Foundation, Inc.\n# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\nif test $# -eq 0; then\n  echo 1>&2 \"Try '$0 --help' for more information\"\n  exit 1\nfi\n\ncase $1 in\n\n  --is-lightweight)\n    # Used by our autoconf macros to check whether the available missing\n    # script is modern enough.\n    exit 0\n    ;;\n\n  --run)\n    # Back-compat with the calling convention used by older automake.\n    shift\n    ;;\n\n  -h|--h|--he|--hel|--help)\n    echo \"\\\n$0 [OPTION]... PROGRAM [ARGUMENT]...\n\nRun 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due\nto PROGRAM being missing or too old.\n\nOptions:\n  -h, --help      display this help and exit\n  -v, --version   output version information and exit\n\nSupported PROGRAM values:\n  aclocal   autoconf  autoheader   autom4te  automake  makeinfo\n  bison     yacc      flex         lex       help2man\n\nVersion suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and\n'g' are ignored when checking the name.\n\nSend bug reports to <bug-automake@gnu.org>.\"\n    exit $?\n    ;;\n\n  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)\n    echo \"missing $scriptversion (GNU Automake)\"\n    exit $?\n    ;;\n\n  -*)\n    echo 1>&2 \"$0: unknown '$1' option\"\n    echo 1>&2 \"Try '$0 --help' for more information\"\n    exit 1\n    ;;\n\nesac\n\n# Run the given program, remember its exit status.\n\"$@\"; st=$?\n\n# If it succeeded, we are done.\ntest $st -eq 0 && exit 0\n\n# Also exit now if we it failed (or wasn't found), and '--version' was\n# passed; such an option is passed most likely to detect whether the\n# program is present and works.\ncase $2 in --version|--help) exit $st;; esac\n\n# Exit code 63 means version mismatch.  This often happens when the user\n# tries to use an ancient version of a tool on a file that requires a\n# minimum version.\nif test $st -eq 63; then\n  msg=\"probably too old\"\nelif test $st -eq 127; then\n  # Program was missing.\n  msg=\"missing on your system\"\nelse\n  # Program was found and executed, but failed.  Give up.\n  exit $st\nfi\n\nperl_URL=http://www.perl.org/\nflex_URL=http://flex.sourceforge.net/\ngnu_software_URL=http://www.gnu.org/software\n\nprogram_details ()\n{\n  case $1 in\n    aclocal|automake)\n      echo \"The '$1' program is part of the GNU Automake package:\"\n      echo \"<$gnu_software_URL/automake>\"\n      echo \"It also requires GNU Autoconf, GNU m4 and Perl in order to run:\"\n      echo \"<$gnu_software_URL/autoconf>\"\n      echo \"<$gnu_software_URL/m4/>\"\n      echo \"<$perl_URL>\"\n      ;;\n    autoconf|autom4te|autoheader)\n      echo \"The '$1' program is part of the GNU Autoconf package:\"\n      echo \"<$gnu_software_URL/autoconf/>\"\n      echo \"It also requires GNU m4 and Perl in order to run:\"\n      echo \"<$gnu_software_URL/m4/>\"\n      echo \"<$perl_URL>\"\n      ;;\n  esac\n}\n\ngive_advice ()\n{\n  # Normalize program name to check for.\n  normalized_program=`echo \"$1\" | sed '\n    s/^gnu-//; t\n    s/^gnu//; t\n    s/^g//; t'`\n\n  printf '%s\\n' \"'$1' is $msg.\"\n\n  configure_deps=\"'configure.ac' or m4 files included by 'configure.ac'\"\n  case $normalized_program in\n    autoconf*)\n      echo \"You should only need it if you modified 'configure.ac',\"\n      echo \"or m4 files included by it.\"\n      program_details 'autoconf'\n      ;;\n    autoheader*)\n      echo \"You should only need it if you modified 'acconfig.h' or\"\n      echo \"$configure_deps.\"\n      program_details 'autoheader'\n      ;;\n    automake*)\n      echo \"You should only need it if you modified 'Makefile.am' or\"\n      echo \"$configure_deps.\"\n      program_details 'automake'\n      ;;\n    aclocal*)\n      echo \"You should only need it if you modified 'acinclude.m4' or\"\n      echo \"$configure_deps.\"\n      program_details 'aclocal'\n      ;;\n   autom4te*)\n      echo \"You might have modified some maintainer files that require\"\n      echo \"the 'autom4te' program to be rebuilt.\"\n      program_details 'autom4te'\n      ;;\n    bison*|yacc*)\n      echo \"You should only need it if you modified a '.y' file.\"\n      echo \"You may want to install the GNU Bison package:\"\n      echo \"<$gnu_software_URL/bison/>\"\n      ;;\n    lex*|flex*)\n      echo \"You should only need it if you modified a '.l' file.\"\n      echo \"You may want to install the Fast Lexical Analyzer package:\"\n      echo \"<$flex_URL>\"\n      ;;\n    help2man*)\n      echo \"You should only need it if you modified a dependency\" \\\n           \"of a man page.\"\n      echo \"You may want to install the GNU Help2man package:\"\n      echo \"<$gnu_software_URL/help2man/>\"\n    ;;\n    makeinfo*)\n      echo \"You should only need it if you modified a '.texi' file, or\"\n      echo \"any other file indirectly affecting the aspect of the manual.\"\n      echo \"You might want to install the Texinfo package:\"\n      echo \"<$gnu_software_URL/texinfo/>\"\n      echo \"The spurious makeinfo call might also be the consequence of\"\n      echo \"using a buggy 'make' (AIX, DU, IRIX), in which case you might\"\n      echo \"want to install GNU make:\"\n      echo \"<$gnu_software_URL/make/>\"\n      ;;\n    *)\n      echo \"You might have modified some files without having the proper\"\n      echo \"tools for further handling them.  Check the 'README' file, it\"\n      echo \"often tells you about the needed prerequisites for installing\"\n      echo \"this package.  You may also peek at any GNU archive site, in\"\n      echo \"case some other package contains this missing '$1' program.\"\n      ;;\n  esac\n}\n\ngive_advice \"$1\" | sed -e '1s/^/WARNING: /' \\\n                       -e '2,$s/^/         /' >&2\n\n# Propagate the correct exit status (expected to be 127 for a program\n# not found, 63 for a program that failed due to version mismatch).\nexit $st\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "res/appstore/.editorconfig",
    "content": "# indicate this is the root of the project\nroot = true\n\n[*]\ncharset = utf-8-bom\ninsert_final_newline = true\nindent_style = space\ntrim_trailing_whitespace = true\n"
  },
  {
    "path": "res/appstore/RufusAppxManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<Package\n IgnorableNamespaces=\"uap uap7 uap8 rescap build\"\n xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\"\n xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\"\n xmlns:uap7=\"http://schemas.microsoft.com/appx/manifest/uap/windows10/7\"\n xmlns:uap8=\"http://schemas.microsoft.com/appx/manifest/uap/windows10/8\"\n xmlns:rescap=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities\"\n xmlns:build=\"http://schemas.microsoft.com/developer/appx/2015/build\">\n  <Identity\n   Name=\"19453.net.Rufus\"\n   Publisher=\"CN=7AC86D13-3E5A-491A-ADD5-80095C212740\"\n   Version=\"@VERSION@\"\n   ProcessorArchitecture=\"@ARCH@\"/>\n  <Properties>\n    <DisplayName>Rufus</DisplayName>\n    <PublisherDisplayName>Akeo Consulting</PublisherDisplayName>\n    <Logo>Images\\StoreLogo.png</Logo>\n  </Properties>\n  <Dependencies>\n    <TargetDeviceFamily \n     Name=\"Windows.Desktop\"\n     MinVersion=\"10.0.14316.0\"\n     MaxVersionTested=\"10.0.22000.194\"/>\n    <PackageDependency\n     Name=\"Microsoft.VCLibs.140.00.UWPDesktop\"\n     MinVersion=\"14.0.30035.0\"\n     Publisher=\"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US\"/>\n  </Dependencies>\n  <Resources>\n    <Resource Language=\"en-US\"/>\n    <Resource Language=\"ar-SA\"/>\n    <Resource Language=\"bg-BG\"/>\n    <Resource Language=\"zh-CN\"/>\n    <Resource Language=\"zh-TW\"/>\n    <Resource Language=\"hr-HR\"/>\n    <Resource Language=\"cs-CZ\"/>\n    <Resource Language=\"da-DK\"/>\n    <Resource Language=\"nl-NL\"/>\n    <Resource Language=\"fi-FI\"/>\n    <Resource Language=\"fr-FR\"/>\n    <Resource Language=\"de-DE\"/>\n    <Resource Language=\"el-GR\"/>\n    <Resource Language=\"he-IL\"/>\n    <Resource Language=\"hu-HU\"/>\n    <Resource Language=\"id-ID\"/>\n    <Resource Language=\"it-IT\"/>\n    <Resource Language=\"ja-JP\"/>\n    <Resource Language=\"ko-KR\"/>\n    <Resource Language=\"lv-LV\"/>\n    <Resource Language=\"lt-LT\"/>\n    <Resource Language=\"ms-MY\"/>\n    <Resource Language=\"nb-NO\"/>\n    <Resource Language=\"fa-IR\"/>\n    <Resource Language=\"pl-PL\"/>\n    <Resource Language=\"pt-BR\"/>\n    <Resource Language=\"pt-PT\"/>\n    <Resource Language=\"ro-RO\"/>\n    <Resource Language=\"ru-RU\"/>\n    <Resource Language=\"sr-Latn-RS\"/>\n    <Resource Language=\"sk-SK\"/>\n    <Resource Language=\"sl-SI\"/>\n    <Resource Language=\"es-ES\"/>\n    <Resource Language=\"sv-SE\"/>\n    <Resource Language=\"th-TH\"/>\n    <Resource Language=\"tr-TR\"/>\n    <Resource Language=\"uk-UA\"/>\n    <Resource Language=\"vi-VN\"/>\n    <Resource uap:Scale=\"200\"/>\n  </Resources>\n  <Applications>\n    <Application\n     Id=\"Rufus\"\n     Executable=\"rufus\\rufus.exe\"\n     EntryPoint=\"Windows.FullTrustApplication\">\n      <uap:VisualElements\n       DisplayName=\"Rufus\"\n       Description=\"Rufus\"\n       BackgroundColor=\"transparent\"\n       Square150x150Logo=\"Images\\Square150x150Logo.png\"\n       Square44x44Logo=\"Images\\Square44x44Logo.png\">\n        <uap:DefaultTile\n         Wide310x150Logo=\"Images\\Wide310x150Logo.png\"\n         Square71x71Logo=\"Images\\SmallTile.png\"\n         Square310x310Logo=\"Images\\LargeTile.png\">\n          <uap:ShowNameOnTiles>\n            <uap:ShowOn Tile=\"square150x150Logo\"/>\n            <uap:ShowOn Tile=\"wide310x150Logo\"/>\n            <uap:ShowOn Tile=\"square310x310Logo\"/>\n          </uap:ShowNameOnTiles>\n        </uap:DefaultTile>\n      </uap:VisualElements>\n      <uap7:Properties>\n        <uap8:ActiveCodePage>UTF-8</uap8:ActiveCodePage>\n      </uap7:Properties>\n    </Application>\n  </Applications>\n  <Capabilities>\n    <rescap:Capability Name=\"runFullTrust\"/>\n    <rescap:Capability Name=\"allowElevation\"/>\n  </Capabilities>\n</Package>"
  },
  {
    "path": "res/appstore/ScaleAppxManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<Package\n xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\"\n xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\"\n IgnorableNamespaces=\"uap\">\n  <Identity\n   Name=\"19453.net.Rufus\"\n   Publisher=\"CN=7AC86D13-3E5A-491A-ADD5-80095C212740\"\n   Version=\"@VERSION@\"\n   ResourceId=\"split.scale-@SCALE@\"/>\n  <Properties>\n    <ResourcePackage>true</ResourcePackage>\n    <DisplayName>Rufus</DisplayName>\n    <PublisherDisplayName>Akeo Consulting</PublisherDisplayName>\n    <Logo>Images\\StoreLogo.png</Logo>\n  </Properties>\n  <Resources>\n    <Resource uap:Scale=\"@SCALE@\"/>\n  </Resources>\n  <Dependencies>\n    <TargetDeviceFamily\n     Name=\"Windows.Desktop\" \n     MinVersion=\"10.0.14316.0\"\n     MaxVersionTested=\"10.0.22000.194\"/>\n  </Dependencies>\n</Package>\n"
  },
  {
    "path": "res/appstore/gen_listing.ps1",
    "content": "# PowerShell script to parse rufus.loc and create a listing.csv\n# Copyright © 2023 Pete Batard <pete@akeo.ie>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n#\n\ntry {\n  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8\n} catch {}\n\nfunction InsertMsg([object]$translated_msgs, [string]$lang, [string]$msg_id, [string]$msg)\n{\n  for ($i = 0; $i -lt $translated_msgs.MSG_ID.Count; $i++) {\n    if ($translated_msgs.MSG_ID[$i] -eq $msg_id) {\n      $translated_msgs.$lang[$i] = $msg\n    }\n  }\n}\n\nfunction GetMsg([object]$translated_msgs, [string]$lang, [string]$msg_id)\n{\n  for ($i = 0; $i -lt $translated_msgs.MSG_ID.Count; $i++) {\n    if ($translated_msgs.MSG_ID[$i] -eq $msg_id) {\n      if ($msg_id -eq \"MSG_901\" -or $msg_id -eq \"MSG_902\" -or $msg_id -eq \"MSG_903\") {\n        if (-not $translated_msgs.$lang[$i]) {\n          return $translated_msgs.\"en-us\"[$i]\n        }\n      }\n      return $translated_msgs.$lang[$i]\n    }\n  }\n  return \"\"\n}\n\n$csv = Import-Csv -Path .\\listing_template.csv -Encoding UTF8\n\n# Get the translated MSG_ID's we need\n$translated_msg_ids = @()\n$empty = @()\nforeach($row in $csv) {\n  # There may be multiple MSG_ID's in the row\n  Select-String \"MSG_\\d+\" -input $row -AllMatches | foreach {\n    foreach ($match in $_.matches) {\n      $translated_msg_ids += $match.Value\n      $empty += \"\"\n    }\n  }\n}\n\n$translated_msgs = New-Object PSObject\nAdd-Member -InputObject $translated_msgs -NotePropertyName MSG_ID -NotePropertyValue $translated_msg_ids\n\n$lang = \"\"\n$langs = @()\nforeach ($line in Get-Content ..\\loc\\rufus.loc) {\n  # Get the language for the current section\n  if ($line -Like \"l *\") {\n    $lang = $line.split(\" \",[System.StringSplitOptions]::RemoveEmptyEntries)[1].Trim('\"').ToLower()\n    if ($lang -eq \"sr-rs\") {\n      $lang = \"sr-latn-rs\"\n    }\n    $langs += $lang\n    Add-Member -InputObject $translated_msgs -NotePropertyName $lang -NotePropertyValue $empty.PsObject.Copy()\n  }\n  # Add translated messages to our array\n  if ($line -Like \"t MSG_*\") {\n    $msg_id = $line.Substring(2, 7)\n    if ($translated_msg_ids.Contains($msg_id)) {\n      $msg = $line.Substring(10).Trim('\"').Replace(\"\\n\",\"`n\").Replace('\\\"','\"')\n      # Insert URLs in the relevant messages\n      if ($msg.Contains(\"%s\")) {\n        $url = switch ($msg_id) {\n          MSG_901 { \"https://rufus.ie\" }\n          MSG_902 { \"https://github.com/pbatard/rufus\" }\n          MSG_903 { \"https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\" }\n        }\n        $msg = $msg.Replace(\"%s\", $url)\n      }\n      InsertMsg $translated_msgs $lang $msg_id \"$msg\"\n    }\n  }\n}\n\n# Add the extra columns to our CSV\nforeach ($lang in $langs) {\n  $csv = $csv | Select-Object *, @{ n = $lang; e = \" \" }\n}\n\n# Now insert the translated strings and whatnot\nforeach($row in $csv) {\n  Select-String \"MSG_\\d+\" -input $row -AllMatches | foreach {\n    foreach ($lang in $langs) {\n      $row.$lang = $row.default\n      foreach ($match in $_.matches) {\n        $msg = GetMsg $translated_msgs $lang $match.Value\n        $row.$lang = $row.$lang.Replace($match.Value, $msg)\n      }\n    }\n    # Override some defaults\n    if ($row.default -eq \"MSG_904\") {\n      $row.default = \"https://www.gnu.org/licenses/gpl-3.0.html\"\n    } elseif ($row.default -eq \"MSG_905\") {\n      $row.default = \"Boot\"\n    } else {\n      $row.default = \"\"\n    }\n  }\n  if ($row.default -like \"<AUTOGENERATED>\") {\n    # Insert current year into CopyrightTrademarkInformation\n    if ($row.Field -eq \"CopyrightTrademarkInformation\") {\n      $year = Get-Date -Format \"yyyy\"\n      $row.default = \"© 2011-\" + $year + \" Pete Batard\"\n    } elseif ($row.Field -eq \"ReleaseNotes\") {\n      $section = 0\n      $row.default = \"\"\n      foreach ($line in Get-Content ..\\..\\ChangeLog.txt) {\n        if ($line.StartsWith(\"o Version\")) {\n          $section++\n          continue\n        }\n        if ($section -eq 1 -and $line) {\n          if ($row.default) {\n            $row.default += \"`n\"\n          }\n          $row.default += $line.Replace(\"    \", \"• \")\n        }\n      }\n    } elseif ($row.Field.StartsWith(\"DesktopScreenshot\")) {\n      # NB: Per https://learn.microsoft.com/en-us/windows/apps/publish/publish-your-app/import-and-export-store-listings?pivots=store-installer-msix#update-listing-info\n      # you need to use slashes rather than backslashes and include the name of the folder to upload as part of the path.\n      $row.default = \"\"\n      foreach ($lang in $langs) {\n        $path = \"listing/\" + $lang  + \"/\" + $row.Field.Replace(\"Desktop\", \"\") + \".png\"\n        if (Test-Path -Path $path) {\n          $row.$lang = $path\n        }\n      }\n    }\n  }\n}\n\n$csv | Export-Csv 'listing\\listing.csv' -NoTypeInformation -Encoding UTF8\n"
  },
  {
    "path": "res/appstore/get_pe_info.c",
    "content": "// Compile with: gcc -lversion -o get_pe_info get_pe_info.c\n\n#include <windows.h>\n#include <stdio.h>\n#include <stdlib.h>\n\nint main(int argc, char *argv[]) {\n    VS_FIXEDFILEINFO *file_info;\n    DWORD handle, size;\n    WORD lang, codepage;\n    UINT len;\n    void *buffer = NULL, *translation, *version_info;\n    char sub_block[50];\n    int ret = 1;\n\n    if (argc != 3 || argv[1][0] != '-') {\n        printf(\"Usage: %s [-i|-v] <path_to_executable>\\n\", argv[0]);\n        goto out;\n    }\n\n    size = GetFileVersionInfoSizeA(argv[2], &handle);\n    if (size == 0) {\n        fprintf(stderr, \"Failed to get version info size.\\n\");\n        goto out;\n    }\n\n    buffer = malloc(size);\n    if (buffer == NULL)\n        goto out;\n\n    if (!GetFileVersionInfoA(argv[2], handle, size, buffer)) {\n        fprintf(stderr, \"Failed to get version info.\\n\");\n        goto out;\n    }\n\n    if (argv[1][1] == 'i') {\n        if (!VerQueryValueA(buffer, \"\\\\VarFileInfo\\\\Translation\", &translation, &len) || len < 4) {\n            fprintf(stderr, \"Failed to retrieve language and codepage information.\\n\");\n            goto out;\n        }\n        lang = *(WORD*)translation;\n        codepage = *((WORD*)translation + 1);\n        snprintf(sub_block, sizeof(sub_block), \"\\\\StringFileInfo\\\\%04x%04x\\\\InternalName\", lang, codepage);\n        if (!VerQueryValueA(buffer, sub_block, &version_info, &len)) {\n            fprintf(stderr, \"Failed to retrieve Internal Name.\\n\");\n            goto out;\n        }\n        printf(\"%s\\n\", (char*)version_info);\n    } else {\n        if (!VerQueryValueA(buffer, \"\\\\\", (LPVOID*)&file_info, &len) || len < sizeof(VS_FIXEDFILEINFO)) {\n            fprintf(stderr, \"Failed to retrieve file info.\\n\");\n            goto out;\n        }\n        printf(\"%d.%d.%d.%d\\n\", HIWORD(file_info->dwFileVersionMS), LOWORD(file_info->dwFileVersionMS),\n               HIWORD(file_info->dwFileVersionLS), LOWORD(file_info->dwFileVersionLS));\n    }\n    ret = 0;\n\nout:\n    free(buffer);\n    return ret;\n}\n"
  },
  {
    "path": "res/appstore/listing/listing.csv",
    "content": "﻿\"Field\",\"ID\",\"Type (Type)\",\"default\",\"en-us\",\"ar-sa\",\"bg-bg\",\"zh-cn\",\"zh-tw\",\"hr-hr\",\"cs-cz\",\"da-dk\",\"nl-nl\",\"fi-fi\",\"fr-fr\",\"de-de\",\"el-gr\",\"he-il\",\"hu-hu\",\"id-id\",\"it-it\",\"ja-jp\",\"ko-kr\",\"lv-lv\",\"lt-lt\",\"ms-my\",\"nb-no\",\"fa-ir\",\"pl-pl\",\"pt-br\",\"pt-pt\",\"ro-ro\",\"ru-ru\",\"sr-latn-rs\",\"sk-sk\",\"sl-si\",\"es-es\",\"sv-se\",\"th-th\",\"tr-tr\",\"uk-ua\",\"vi-vn\"\n\"Description\",\"2\",\"Text\",\"\",\"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\n• Official site: https://rufus.ie\n• Source Code: https://github.com/pbatard/rufus\n• ChangeLog: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"برنامج Rufus هو أداة تساعد في تنسيق وإنشاء أقراص الإقلاع USB، مثل مفاتيح USB، بطاقات الذاكرة، وغيرها.\n• الموقع الرسمي: https://rufus.ie\n• كود المصدر: https://github.com/pbatard/rufus\n• سجل التغييرات: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus е програма, с която можете лесно да форматирате и създавате стартиращи USB устройства, карти с памет и др.\n• Официален сайт: https://rufus.ie\n• Изходен код: https://github.com/pbatard/rufus\n• Лог на промените: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus 是一个帮助您格式化并创建可启动 USB 驱动器（如 U 盘和存储卡）的工具。\n• 官方网站: https://rufus.ie\n• 源代码: https://github.com/pbatard/rufus\n• 更新日志: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus 是個能格式化並製作可開機 USB 快閃磁碟 (如 USB 隨身碟等) 的工具。\n• 官方網站: https://rufus.ie\n• 原始碼: https://github.com/pbatard/rufus\n• 更新日誌: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus je aplikacija koja olakšava formatiranje i stvaranje USB pokretačkih jedinica.\n• Službena stranica: https://rufus.ie\n• Šifra izvora: https://github.com/pbatard/rufus\n• ChangeLog: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus je nástroj, který pomáhá formátovat a vytvářet bootovací USB flash disky, jako jsou USB klíče, paměťové karty atd.\n• Oficiální stránky: https://rufus.ie\n• Zdrojový kód: https://github.com/pbatard/rufus\n• Protokol změn: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus er et værktøj, der hjælper med at formatere og skabe startbare USB-flashdrev, såsom USB-nøgler/USB-pinde, USB-stik, osv.\n• Officiel side: https://rufus.ie\n• Kildekode: https://github.com/pbatard/rufus\n• Ændrings log: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus is een programma dat helpt bij het formatteren en aanmaken van opstartbare USB-flash-drives, zoals USB-sticks, geheugensticks, enz.\n• Officiële site: https://rufus.ie\n• Broncode: https://github.com/pbatard/rufus\n• Wijzigingslog: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus on ohjelma, joka auttaa alustamaan ja luomaan boottaavia USB-laitteita, kuten esimerkiksi USB-avaimia, muistitikkuja jne.\n• Virallinen sivusto: https://rufus.ie\n• Lähdekoodi: https://github.com/pbatard/rufus\n• Muutosloki: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus est un utilitaire permettant de formater et de créer des média USB amorçables, tels que clés USB, mémoire flash, etc.\n• Site officiel : https://rufus.ie\n• Code source: https://github.com/pbatard/rufus\n• ChangeLog: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus ist ein Werkzeug, das beim Formatieren und Erstellen bootfähiger USB-Flash-Laufwerke wie USB-Sticks, Speichersticks usw. hilft.\n• Offizielle Website: https://rufus.ie\n• Quellcode: https://github.com/pbatard/rufus\n• Änderungsprotokoll: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Το Rufus είναι ένα βοηθητικό πρόγραμμα που βοηθά στη διαμόρφωση και τη δημιουργία μονάδων flash USB με δυνατότητα εκκίνησης, όπως κλειδιά USB/pendrives,κάρτες μνήμης κ.λπ.\n• Επίσημος ιστότοπος: https://rufus.ie\n• Πηγαίος κώδικας: https://github.com/pbatard/rufus\n• Αρχείο καταγραφής αλλαγών: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus הוא כלי המסייע באתחול ויצירת כונני הבזק מסוג USB הניתנים לאתחול, כמו דיסק און קי, כרטיסי זיכרון וכו׳.\n• האתר הרשמי: https://rufus.ie\n• קוד מקור: https://github.com/pbatard/rufus\n• הערות שחרור: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"A Rufus egy segédprogram, amellyel bootolható USB flash meghajtókat formázhat és készíthet, például USB kulcsokat/pendrive-okat, memóriakártyákat, stb.\n• Hivatalos oldal: https://rufus.ie\n• Forráskód: https://github.com/pbatard/rufus\n• Változási napló: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus adalah alat yang membantu untuk memformat dan membuat perangkat USB flash menjadi bootable, seperti USB flashdisk, kartu memori, dll.\n• Situs resmi: https://rufus.ie\n• Kode Sumber: https://github.com/pbatard/rufus\n• Catatan pergantian: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus è un programma che ti aiuta a formattare e creare una unità flash USB avviabile, come una unità USB, memory stick, ecc.\n• Sito ufficiale: https://rufus.ie\n• Codice sorgente: https://github.com/pbatard/rufus\n• Novità: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus (ルーファス) とは、起動可能なUSBフラッシュドライブ（USBメモリなど）を作成したり、フォーマットをするためのソフトウェアです。\n• 公式サイト: https://rufus.ie\n• ソースコード: https://github.com/pbatard/rufus\n• 変更履歴: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus는 USB 메모리 및 플래시 드라이브를 포맷하고 부팅할 수 있도록 만드는 도구입니다.\n• 공식 사이트: https://rufus.ie\n• 소스 코드: https://github.com/pbatard/rufus\n• 변경 사항: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus ir instruments ar kura palīdzību var formatēt un izveidot USB ielādes ierīces uz tādiem nesējiem, kā USB pieslēguma zibatmiņas, atmiņas kartes u.c.\n• Oficiālā mājas lapa: https://rufus.ie\n• Sākotnējais kods: https://github.com/pbatard/rufus\n• Izmaiņas: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus programa leidžia suženklinti ir sukurti sistemų paleidimo laikmenas, kaip pvz. USB atmintukus, atminties korteles ir pan.\n• Oficiali svetainė: https://rufus.ie\n• Šaltinio kodas: https://github.com/pbatard/rufus\n• Pakeitimų žurnalas: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus adalah utiliti yang membantu memformat dan mencipta pemacu kilat USB boot, seperti pemacu pen/kekunci USB, kayu memori, dan lain-lain.\n• Laman rasmi: https://rufus.ie\n• Kod Sumber: https://github.com/pbatard/rufus\n• ChangeLog: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus er et verktøy som hjelper til med å formatere og lage oppstartbare USB-stasjoner, for eksempel USB-minnepinner, USB-harddisker, og lignende.\n• Offisiell webside: https://rufus.ie\n• Kildekode: https://github.com/pbatard/rufus\n• Endringslogg: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus ابزاری است که به فرمت و ایجاد درایوهای فلش USB قابل بوت، مانند کلیدهای USB/pendrives، مموری استیک ها و غیره به شما کمک می کند.\n• سایت رسمی: https://rufus.ie\n• منبع کد: https://github.com/pbatard/rufus\n• لیست تغییرات https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus to narzędzie, które pomaga formatować i tworzyć dyski rozruchowe flash USB, takie jak klucze USB, pendrive-y itp.\n• Oficjalna strona: https://rufus.ie\n• Kod źródłowy: https://github.com/pbatard/rufus\n• Zmiany: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus é um utilitário que ajuda a formatar e a criar unidades flash USB inicializáveis, tais como pendrives USB, cartões de memória, etc.\n• Site oficial: https://rufus.ie\n• Código fonte: https://github.com/pbatard/rufus\n• Registro de alterações: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus é um utilitário que ajuda a formatar e a criar unidades USB inicializáveis, tais como dispositivos USB/pendrives, cartões de memória, etc.\n• Site oficial: https://rufus.ie\n• Código fonte: https://github.com/pbatard/rufus\n• Alterações: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus este un utilitar care ajută la formatarea și crearea de drive-uri USB bootabile, precum cheile sau pendriverele USB, unități de memorie, etc.\n• Site official: https://rufus.ie\n• Codul Sursei: https://github.com/pbatard/rufus\n• Listă de schimbări: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus - это утилита для форматирования и создания загрузочных флеш-накопителей USB.\n• Официальный сайт: https://rufus.ie\n• Исходный код: https://github.com/pbatard/rufus\n• Изменения: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus je uslužni program koji pomaže u formatiranju i kreiranju USB fleš diskova koji se mogu pokretati, kao što su USB ključevi, memorijski štapići itd.\n• Zvaničan sajt: https://rufus.ie\n• Izvorni kod: https://github.com/pbatard/rufus\n• Evidencija promena: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus je utilita, ktorá vám pomôže naformátovať a vytvoriť bootovacie jednotky USB Flash, ako sú napr. USB kľúče, pamäťové karty, atď.\n• Oficiálna stránka: https://rufus.ie\n• Zdrojový kód: https://github.com/pbatard/rufus\n• Zoznam zmien: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus je program za formatiranje in ustvarjanje zagonskih naprav USB.\n• Uradna stran: https://rufus.ie\n• Šifra vira: https://github.com/pbatard/rufus\n• Spremenitve: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus es una utilidad que le ayuda a formatear y crear dispositivos flash booteables, como «pendrives», tarjetas de memoria, etcétera.\n• Sitio oficial https://rufus.ie\n• Código fuente https://github.com/pbatard/rufus\n• Registro de cambios https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus är ett program som hjälper dig formatera och skapa startbara USB-diskar, så som USB-minnen, minneskort, etc.\n• Officiell webbplats: https://rufus.ie\n• Källkod: https://github.com/pbatard/rufus\n• Ändringslogg: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus คือ โปรแกรมที่ช่วยฟอร์แมต และสร้างไดรฟ์บูต USB จาก USB keys, pendrives, memory sticks เป็นต้น\n• เว็บไซต์ทางการ: https://rufus.ie\n• ซอร์สโค้ด: https://github.com/pbatard/rufus\n• บันทึกการเปลี่ยนแปลง: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus, USB anahtar/bellekler, hafıza kartları vb. USB sürücüleri, biçimlendirmeye ve önyüklemeli hale getirmeye yardımcı olan bir araçtır.\n• Resmi site: https://rufus.ie\n• Kaynak Kodu: https://github.com/pbatard/rufus\n• Sürüm Notları https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus це утиліта, яка допомагає форматувати та створювати завантажувальні флешки, картки пам'яті, тощо.\n• Офіційний сайт: https://rufus.ie\n• Сирцевий код: https://github.com/pbatard/rufus\n• Список змін: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\",\"Rufus là một tiện ích giúp định dạng và tạo khả năng khởi động cho các thiết bị USB, ví dụ như thẻ USB/đĩa di động, thẻ nhớ, v.v...\n• Trang web chính thức: https://rufus.ie\n• Mã nguồn: https://github.com/pbatard/rufus\n• Nhật ký thay đổi: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt\"\n\"ReleaseNotes\",\"3\",\"Text\",\"• Fix UEFI:NTFS not selecting the proper driver for ARM/ARM64\n• Update embedded GRUB to v2.14\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Title\",\"4\",\"Text\",\"Rufus\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"ShortTitle\",\"5\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"SortTitle\",\"6\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"VoiceTitle\",\"7\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"ShortDescription\",\"8\",\"Text\",\"\",\"Rufus - The Reliable USB Formatting Utility\",\"Rufus - أداة فرمتة الـ USB جديرة بالثقة\",\"Rufus - Надеждната USB форматираща програма\",\"Rufus - 可靠的 USB 格式化工具\",\"Rufus - 快速可靠的 USB 格式化工具\",\"Rufus - Pouzdan alat za formatiranje USB-a\",\"Rufus - Spolehlivý program pro formátování USB\",\"Rufus - Det pålidelige USB-formateringsværktøj\",\"Rufus - de betrouwbare USB-formatteertool\",\"Rufus - Luotettava USB-alustusohjelma\",\"Rufus - L'utilitaire de formatage USB fiable\",\"Rufus - Das zuverlässige USB-Formatierungstool\",\"Rufus - Μία αξιόπιστη εφαρμογή διαμόρφωσης USB\",\"Rufus - הכלי לאתחול USB האמין ביותר\",\"Rufus - A megbízható USB-formázó segédprogram\",\"Rufus - Utilitas Pemformatan USB yang Handal\",\"Rufus - Utility affidabile per la formattazione di unità USB\",\"Rufus - 信頼性の高い USB フォーマット ユーティリティ\",\"Rufus - 신뢰할 수 있는 USB 포맷 유틸리티\",\"Rufus - uzticama un vienkārša USB formatēšanas utilīta\",\"Rufus - patikima USB formatavimo priemonė\",\"Rufus - Utiliti pemformatan USB yang dipercayai\",\"Rufus - Det pålitelige USB-formateringsprogrammet\",\"Rufus، ابزاری کاربردی و قابل‌اطمینان برای فرمت کردن درایوهای USB\",\"Rufus - niezawodne narzędzie do formatowania USB\",\"Rufus - O Utilitário de Formatação USB Confiável\",\"Rufus - O utilitário de confiança para formatação USB\",\"Rufus - Instrumentul de încredere pentru formatări USB\",\"Rufus - Надёжная утилита для форматирования USB-дисков\",\"Rufus - Pouzdan Alat Za Formatiranje USB diska\",\"Rufus - Spoľahlivý program pre formátovanie USB\",\"Rufus - zanesljivi pripomoček za USB formatiranje\",\"Rufus, la herramienta de formateo de USBs en la que puedes confiar\",\"Rufus - Det pålitliga verktyget för USB-formatering\",\"Rufus - ยูทิลิตี้การฟอร์แมต USB ที่ไว้ใจได้\",\"Rufus - Güvenilir USB Biçimlendirme Programı\",\"Rufus - надійна утиліта для форматування USB-накопичувачів\",\"Rufus - Tiện ích Định dạng USB Đáng tin cậy\"\n\"DevStudio\",\"9\",\"Text\",\"Pete Batard\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"CopyrightTrademarkInformation\",\"12\",\"Text\",\"© 2011-2026 Pete Batard\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"AdditionalLicenseTerms\",\"13\",\"Text\",\"https://www.gnu.org/licenses/gpl-3.0.html\",\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\nSee https://www.gnu.org/licenses/gpl-3.0.en.html for details.\",\"هذا التطبيق مُرخص بموجب شروط رخصة جنو (GNU) العمومية (GPL) الإصدار 3.\nراجع https://www.gnu.org/licenses/gpl-3.0.ar.html لمزيد من التفاصيل.\",\"Тази програма е лицензирана според условията на GNU Public License (GPL) версия 3.\nВижте https://www.gnu.org/licenses/gpl-3.0.html за подробности.\",\"本应用采用 GNU 通用公共许可证 (GPL) 第三版。\n具体许可证见 https://www.gnu.org/licenses/gpl-3.0.zh-cn.html。\",\"本應用採用 GNU 通用公共許可證 (GPL) 第三版。\n具體許可證見 https://www.gnu.org/licenses/gpl-3.0.zh-tw.html。\",\"Ova je aplikacija licencirana pod uvjetima GNU Javne licence (GPL) verzije 3.\nDetalje potražite u https://www.gnu.org/licenses/gpl-3.0.html.\",\"Tato aplikace je licencována podle podmínek GNU Public License (GPL) verze 3.\nPodrobnosti naleznete na adrese https://www.gnu.org/licenses/gpl-3.0.html.\",\"Denne application er licenceret under GNU Public License (GPL) version 3's vilkår.\nSe https://www.gnu.org/licenses/gpl-3.0.html for detaljer.\",\"Deze toepassing valt onder de voorwaarden van de GNU Public License (GPL) versie 3.\nZie https://www.gnu.org/licenses/gpl-3.0.nl.html voor details.\",\"Tämä sovellus on lisensoitu GNU Public License (GPL) version 3 ehtojen mukaisesti.\nLisätietoja osoitteessa https://www.gnu.org/licenses/gpl-3.0.html (englanniksi).\",\"Cette application est fournie sous les termes de la Licence publique générale GNU (GPL) version 3.\nVeuillez consulter https://www.gnu.org/licenses/gpl-3.0.fr.html pour plus de details.\",\"Diese Anwendung ist unter den Bedingungen der GNU Public License (GPL) Version 3 lizenziert.\nSiehe https://www.gnu.org/licenses/gpl-3.0.de.html für Details.\",\"Αυτή η εφαρμογή έχει άδεια χρήσης σύμφωνα με τους όρους της GNU Public License (GPL) έκδοση 3.\nΔείτε https://www.gnu.org/licenses/gpl-3.0.html για λεπτομέρειες.\",\"יישום זה ברישיון תחת התנאים של גרסה 3 של הרישיון הציבורי של גנו (GPL).\nלפרטים נוספים, יש להיכנס אל https://www.gnu.org/licenses/gpl-3.0.html.\",\"Ezen alkalmazás használata a GNU Public License (GPL) 3-as verzió feltételei szerint engedélyezett.\nTovábbi információ: https://www.gnu.org/licenses/gpl-3.0.html.\",\"Aplikasi ini dilisensikan di bawah ketentuan GNU Public License (GPL) versi 3.\nLihat https://www.gnu.org/licenses/gpl-3.0.html untuk detail lebih lanjut.\",\"Questa applicazione è rilasciata sotto i termini della GNU Public License (GPL) versione 3.\nVedere https://www.gnu.org/licenses/gpl-3.0.html per dettagli.\",\"このアプリケーションはGNU Public License (GPL) version 3でライセンスされています。\n詳細は https://www.gnu.org/licenses/gpl-3.0.ja.html をご覧ください。\",\"이 응용 프로그램은 GNU Public License (GPL) 버전 3의 조건에 따라 라이선스가 부여됩니다.\n자세한 내용은 https://www.gnu.org/licenses/gpl-3.0.html 을 참조하세요.\",\"Šai programmai ir licences noteikumi, kā GNU Public License (GPL) version 3.\nPapildinformācijai skatīt https://www.gnu.org/licenses/gpl-3.0.html.\",\"Ši programa yra licencijuota pagal GNU viešosios licencijos (GPL) 3 versijos sąlygas.\nDaugiau informacijos rasite https://www.gnu.org/licenses/gpl-3.0.html.\",\"Permohonan ini dilesenkan di bawah syarat-syarat Lesen Awam GNU (GPL) versi 3.\nLihat https://www.gnu.org/licenses/gpl-3.0.html untuk butiran.\",\"Dette programmet er lisensiert under GNU Public Licence (GPL) versjon 3.\nSe https://www.gnu.org/licenses/gpl-3.0.html for mer informasjon.\",\"این برنامه تحت شرایط مجوز عمومی گنو (GPL) نسخه 3 مجوز دارد.\nبرای جزئیات به https://www.gnu.org/licenses/gpl-3.0.html مراجعه کنید.\",\"Ta aplikacja jest objęta licencją na warunkach licencji publicznej GNU (GPL) w wersji 3.\nZ obacz https://www.gnu.org/licenses/gpl-3.0.html, aby uzyskać szczegółowe informacje.\",\"Este software está licenciado sob os termos da GNU Public License (GPL) versão 3.\nConsulte https://www.gnu.org/licenses/gpl-3.0.pt-br.html para mais detalhes.\",\"Este software está licenciado sob os termos da GNU Public License (GPL) versão 3.\nConsulte https://www.gnu.org/licenses/gpl-3.0.html para mais detalhes.\",\"Această aplicație este sub liciența și termenii și condițiile ale lui GNU Public License (GPL) versiunea a 3-a.\nVazi https://www.gnu.org/licenses/gpl-3.0.en.html pentru detalii.\",\"Это приложение распространяется по лицензии GNU Public License (GPL) версии 3.\nПодробнее см. https://www.gnu.org/licenses/gpl-3.0.ru.html.\",\"Ova aplikacija je licencirana pod uslovima GNU Javne licence (GPL) verzije 3. \nPogledajte https://www.gnu.org/licenses/gpl-3.0.en.html za više informacija.\",\"Táto aplikácia je licencovaná podľa podmienok GNU Public License (GPL) verzia 3.\nPodrobnosti nájdete na https://www.gnu.org/licenses/gpl-3.0.html.\",\"Ta aplikacija je licencirana pod pogoji GNU Javne licence (GPL) različice 3.\nOglejte si https://www.gnu.org/licenses/gpl-3.0.html podrobnosti.\",\"Esta aplicación tiene licencia bajo los términos de la Licencia Pública GNU (GPL) versión 3.\nConsulte https://www.gnu.org/licenses/gpl-3.0.html para obtener más información.\",\"Denna applikation är licensierad under villkoren i GNU Public License (GPL) version 3.\nSe https://www.gnu.org/licenses/gpl-3.0.en.html för mer information.\",\"แอปพลิเคชันนี้ได้รับอนุญาตภายใต้เงื่อนไขของ GNU Public License (GPL) เวอร์ชัน 3\nดูรายละเอียดได้ที่ https://www.gnu.org/licenses/gpl-3.0.html\",\"Bu uygulama, GNU Kamu Lisansı (GPL) sürüm 3'ün koşulları altında lisanslanmıştır.\nDetaylar için https://www.gnu.org/licenses/gpl-3.0.tr.html sayfasını ziyaret edin.\",\"Ця програма ліцензована згідно з умовами GNU Public License (GPL) version 3.\nБільше: https://www.gnu.org/licenses/gpl-3.0.uk.html.\",\"Phần mềm này đã được cấp phép dưới các điều khoản của GNU Public License (GPL) phiên bản 3.\nXem tại https://www.gnu.org/licenses/gpl-3.0.html để biết thêm chi tiết.\"\n\"DesktopScreenshot1\",\"100\",\"Relative path (or URL to file in Partner Center)\",\"\",\"listing/en-us/Screenshot1.png\",\"listing/ar-sa/Screenshot1.png\",\"listing/bg-bg/Screenshot1.png\",\"listing/zh-cn/Screenshot1.png\",\"listing/zh-tw/Screenshot1.png\",\"listing/hr-hr/Screenshot1.png\",\"listing/cs-cz/Screenshot1.png\",\"listing/da-dk/Screenshot1.png\",\"listing/nl-nl/Screenshot1.png\",\"listing/fi-fi/Screenshot1.png\",\"listing/fr-fr/Screenshot1.png\",\"listing/de-de/Screenshot1.png\",\"listing/el-gr/Screenshot1.png\",\"listing/he-il/Screenshot1.png\",\"listing/hu-hu/Screenshot1.png\",\"listing/id-id/Screenshot1.png\",\"listing/it-it/Screenshot1.png\",\"listing/ja-jp/Screenshot1.png\",\"listing/ko-kr/Screenshot1.png\",\"listing/lv-lv/Screenshot1.png\",\"listing/lt-lt/Screenshot1.png\",\"listing/ms-my/Screenshot1.png\",\"listing/nb-no/Screenshot1.png\",\"listing/fa-ir/Screenshot1.png\",\"listing/pl-pl/Screenshot1.png\",\"listing/pt-br/Screenshot1.png\",\"listing/pt-pt/Screenshot1.png\",\"listing/ro-ro/Screenshot1.png\",\"listing/ru-ru/Screenshot1.png\",\"listing/sr-latn-rs/Screenshot1.png\",\"listing/sk-sk/Screenshot1.png\",\"listing/sl-si/Screenshot1.png\",\"listing/es-es/Screenshot1.png\",\"listing/sv-se/Screenshot1.png\",\"listing/th-th/Screenshot1.png\",\"listing/tr-tr/Screenshot1.png\",\"listing/uk-ua/Screenshot1.png\",\"listing/vi-vn/Screenshot1.png\"\n\"DesktopScreenshot2\",\"101\",\"Relative path (or URL to file in Partner Center)\",\"\",\"listing/en-us/Screenshot2.png\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshot3\",\"102\",\"Relative path (or URL to file in Partner Center)\",\"\",\"listing/en-us/Screenshot3.png\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshot4\",\"103\",\"Relative path (or URL to file in Partner Center)\",\"\",\"listing/en-us/Screenshot4.png\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshot5\",\"104\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshot6\",\"105\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshot7\",\"106\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshot8\",\"107\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshot9\",\"108\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshot10\",\"109\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshotCaption1\",\"150\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshotCaption2\",\"151\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshotCaption3\",\"152\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshotCaption4\",\"153\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshotCaption5\",\"154\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshotCaption6\",\"155\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshotCaption7\",\"156\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshotCaption8\",\"157\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshotCaption9\",\"158\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"DesktopScreenshotCaption10\",\"159\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshot1\",\"200\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshot2\",\"201\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshot3\",\"202\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshot4\",\"203\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshot5\",\"204\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshot6\",\"205\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshot7\",\"206\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshot8\",\"207\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshot9\",\"208\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshot10\",\"209\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshotCaption1\",\"250\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshotCaption2\",\"251\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshotCaption3\",\"252\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshotCaption4\",\"253\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshotCaption5\",\"254\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshotCaption6\",\"255\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshotCaption7\",\"256\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshotCaption8\",\"257\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshotCaption9\",\"258\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MobileScreenshotCaption10\",\"259\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshot1\",\"300\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshot2\",\"301\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshot3\",\"302\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshot4\",\"303\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshot5\",\"304\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshot6\",\"305\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshot7\",\"306\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshot8\",\"307\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshot9\",\"308\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshot10\",\"309\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshotCaption1\",\"350\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshotCaption2\",\"351\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshotCaption3\",\"352\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshotCaption4\",\"353\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshotCaption5\",\"354\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshotCaption6\",\"355\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshotCaption7\",\"356\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshotCaption8\",\"357\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshotCaption9\",\"358\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxScreenshotCaption10\",\"359\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshot1\",\"400\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshot2\",\"401\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshot3\",\"402\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshot4\",\"403\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshot5\",\"404\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshot6\",\"405\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshot7\",\"406\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshot8\",\"407\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshot9\",\"408\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshot10\",\"409\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshotCaption1\",\"450\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshotCaption2\",\"451\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshotCaption3\",\"452\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshotCaption4\",\"453\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshotCaption5\",\"454\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshotCaption6\",\"455\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshotCaption7\",\"456\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshotCaption8\",\"457\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshotCaption9\",\"458\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"HolographicScreenshotCaption10\",\"459\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"StoreLogo720x1080\",\"600\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"StoreLogo1080x1080\",\"601\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"StoreLogo300x300\",\"602\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"OverrideLogosForWin10\",\"603\",\"True/False\",\"FALSE\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"StoreLogoOverride150x150\",\"604\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"StoreLogoOverride71x71\",\"605\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"PromoImage1920x1080\",\"606\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"PromoImage2400x1200\",\"607\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxBrandedKeyArt584x800\",\"608\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxTitledHero1920x1080\",\"609\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"XboxFeaturedPromo1080x1080\",\"610\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"OptionalPromo358x358\",\"611\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"OptionalPromo1000x800\",\"612\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"OptionalPromo414x180\",\"613\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Feature1\",\"700\",\"Text\",\"\",\"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"تهيئة USB وبطاقة الفلاش ومحركات الأقراص الافتراضية إلى FAT / FAT32 / NTFS / UDF / exFAT / ReFS / ext2 / ext3\",\"Форматиране на USB, карти памет и виртуални устройства с FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"将 U 盘、存储卡或虚拟驱动器格式化为 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式\",\"將隨身碟、記憶卡或虛擬光碟機格式化為 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式\",\"Formatirajte USB, flash karticu i virtualne pogone na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formátování USB, flash karet a virtuálních jednotek na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formater USB, flash kort og virtuelle drev til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"USB, flashkaart en virtuele schijven formatteren naar FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Alusta USB-asemia, muistikortteja ja virtuaalisia asemia muotoon FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formatez des périphériques USB, des cartes flash et des disques virtuels en FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formatieren von USB, Flash-Karte und virtuellen Laufwerken in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Μορφοποίηση USB, κάρτας flash και εικονικών μονάδων δίσκου σε FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"אתחול USB, כרטיסי זיכרון וכוננים וירטואליים ל־FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"USB, flash memóriakártyák és virtuális meghajtók formázása FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 fájlrendszerre\",\"Format USB, kartu flash dan penyimpanan maya ke FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formatta USB, flash card e unità virtuali in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"USBメモリやSDカード、仮想ドライブをFAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3でフォーマットします。\",\"USB, 플래시 카드 및 가상 드라이브를 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3로 포맷\",\"Formatē USB, atmiņas kartes un virtuālos diskus formātos FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Suformatuokite USB, flash kortelę ir virtualius diskus į FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formatkan USB, kad flash dan pemacu maya kepada FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formater USB, minnekort og virtuelle disker til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"فرمت USB، فلش کارت و درایوهای مجازی به FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Sformatuj nośnik używając: FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formatar dispositivos USB, cartões flash e discos virtuais com FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formatar dispositivos USB, cartão de memória e drives virtuais em FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formatează USB, card flash si drive-uri virtuale la FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Форматирование USB, флешек и виртуальных дисков в FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formatiraj USB, flash kartice, i virtualne diskove u FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Naformátujte USB, kartu a virtuálne disky do FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formatiranje USB, bliskavice in virtualnih pogonov na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formatee USB, tarjetas flash y unidades virtuales a FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Formatera USB-enheter, flash-kort och virtuella enheter till FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"ฟอร์แมต USB, แฟลชการ์ด หรือไดรฟ์เสมือน ให้อยู่ในรูปแบบของ FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"USB, flash kart ve sanal sürücüleri FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 olarak biçimlendirin\",\"Форматування USB-накопичувачів, флешок, карток пам'яті у FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\",\"Định dạng USB, thẻ nhớ hoặc ổ nhớ ảo với FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\"Feature2\",\"701\",\"Text\",\"\",\"Create FreeDOS bootable USB drives\",\"إنشاء محركات أقراص USB قابلة للإقلاع من FreeDOS\",\"Създаване на FreeDOS стартиращ USB устройства\",\"创建 FreeDOS 可启动驱动器\",\"建立 FreeDOS  可開機隨身碟\",\"Stvaranje FreeDOS USB pogona za pokretanje\",\"Vytvoření bootovacích disků USB se systémem FreeDOS\",\"Lav FreeDOS opstartsbare USB drev\",\"FreeDOS opstartbare USB-schijven aanmaken\",\"Luo boottaavia FreeDOS USB-asemia\",\"Créez des disques amorçable FreeDOS\",\"FreeDOS-bootfähige USB-Laufwerke erstellen\",\"Δημιουργήστε μονάδες USB με δυνατότητα εκκίνησης FreeDOS\",\"יצירת כונני USB הניתנים לאתחול של FreeDOS\",\"Bootolható FreeDOS USB meghajtó készítése\",\"Buat perangkat USB FreeDOS yang dapat di boot\",\"Crea unità USB avviabili FreeDOS\",\"FreeDOSの起動可能ドライブを作成します。\",\"FreeDOS 부팅 가능한 USB 드라이브 만들기\",\"Izveido FreeDOS ielādes USB ierīces\",\"Sukurkite FreeDOS įkrovos USB diskus\",\"Buat pemacu USB boleh boot FreeDOS\",\"Lag FreeDos oppstartbar USB stick\",\"درایوهای USB قابل بوت FreeDOS را ایجاد کنید\",\"Stwórz nośnik rozruchowy USB FreeDOS\",\"Criar discos USB inicializáveis FreeDOS\",\"Criar unidades USB inicializáveis FreeDOS\",\"Crează drive USB bootabil FreeDOS\",\"Создание загрузочных USB-дисков FreeDOS\",\"Kreiraj FreeDOS butabilni USB disk\",\"Vytvorte bootovacie usb zariadenia FreeDOS\",\"Ustvarite FreeDOS zagonske USB pogone\",\"Crear unidades USB de arranque FreeDOS\",\"Skapa FreeDOS startbara USB-enheter\",\"สร้าง USB ไดรฟ์บูตสำหรับระบบ FreeDOS\",\"FreeDOS önyüklenebilir USB sürücüleri oluşturun\",\"Створення завантажувальних пристроїв FreeDOS\",\"Tạo USB có thể khởi động với FreeDOS\"\n\"Feature3\",\"702\",\"Text\",\"\",\"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\",\"إنشاء محركات أقراص قابلة للإقلاع من ملفات ISO القابلة للإقلاع (Windows و Linux وما إلى ذلك)\",\"Създаване на стартиращи устройства от ISO образи (Windows, Linux и др.)\",\"从可启动 ISO 文件 (Windows 和 Linux 等) 创建可启动驱动器\",\"從可開機 ISO 檔案 (Windows 和 Linux 等) 建立可開機隨身碟\",\"Stvaranje pogona za pokretanje iz ISO-ova za pokretanje (Windows, Linux itd.)\",\"Vytváření bootovacích jednotek ze zaváděcích ISO (Windows, Linux atd.)\",\"Lav opstartsbarer drev fra opstartsbarer ISOer (Window, Linux, osv.)\",\"Opstartbare schijven aanmaken via opstartbare ISO's (Windows, Linux, enz)\",\"Luo käynnistysasemia boottaavista ISO-kuvista (Windows, Linux jne.)\",\"Créez des disques amorçables à partir d'images ISOs (Windows, Linux, etc.)\",\"Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux etc.)\",\"Δημιουργήστε εκκινήσιμες μονάδες από ISO με δυνατότητα εκκίνησης (Windows, Linux, κ.λπ.)\",\"יצירת כוננים הניתנים לאתחול מקובצי ISO הניתנים לאתחול (Windows‏, Linux וכו')\",\"Bootolható meghajtók készítése bootolható ISO képfájlokból (Windows, Linux, stb.)\",\"Buat perangkat yang dapat di boot dari ISO (Windows, Linux, dll.)\",\"Crea unità avviabili da ISO avviabili (Windows, Linux, ecc.)\",\"WindowsやLinuxなどのISOファイルから起動可能ドライブを作成します。\",\"부팅 가능한 ISO (Windows, Linux 등)에서 부팅 가능한 드라이브 만들기\",\"Izveido ielādes ierīces no ISO failiem (Windows, Linux, u.c.)\",\"Sukurkite įkrovos diskus iš įkrovos ISO (Windows, Linux ir kt.)\",\"Buat pemacu boleh boot daripada ISO boleh boot (Windows, Linux, dll.)\",\"Lag oppstartabar enhet/disk fra ISOer (Windows, Linux, etc.)\",\"ایجاد درایوهای قابل بوت از ISOهای قابل بوت (ویندوز، لینوکس و غیره)\",\"Twórz dyski rozruchowe z obrazów ISO (Windows, Linux itp.)\",\"Criar discos inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)\",\"Criar unidades inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)\",\"Crează drive-uri bootabile de la ISO-uri bootabile (Windows, Linux, etc.)\",\"Создание загрузочных дисков из загрузочных образов ISO (Windows, Linux и т.д.)\",\"Kreirajte disk jedinice za pokretanje sistema od ISO-a koji se mogu pokretanja sistema (Windows, Linux itd.)\",\"Vytvorte bootovacie jednotky z ISO súborov (Windows, Linux atď.)\",\"Ustvarite zagonske pogone iz zagonskih ISO-jev (Windows, Linux itd.)\",\"Cree unidades de arranque desde ISO de arranque (Windows, Linux, etc.)\",\"Skapa startbara enheter från startbara ISO-filer (Windows, Linux, etc.)\",\"สร้าง USB ไดรฟ์บูตจากไฟล์ ISO ที่บูตได้ (เช่น ไฟล์ติดตั้ง Windows หรือ Linux เป็นต้น)\",\"Önyüklenebilir ISO'lardan önyüklenebilir sürücüler oluşturun (Windows, Linux, vb.)\",\"Створення завантажувальних пристроїв з завантажувальних образів (Windows, Linux, тощо)\",\"Tạo ổ đĩa có thể khởi động từ các file ISO có thể khởi động (Windows, Linux, v.v...)\"\n\"Feature4\",\"703\",\"Text\",\"\",\"Create bootable drives from bootable disk images, including compressed ones\",\"إنشاء محركات أقراص قابلة للإقلاع من صور الأقراص القابلة للإقلاع ، بما في ذلك الأقراص المضغوطة\",\"Създаване на стартиращи устройства от образи, включително компресирани такива\",\"从可启动硬盘镜像 (包括压缩镜像) 创建可启动驱动器\",\"從可開機硬碟映像檔 (包括壓縮映像檔) 建立可開機隨身碟\",\"Stvaranje pogona za pokretanje iz slika diska za pokretanje, uključujući komprimirane\",\"Vytváření zaváděcích jednotek ze zaváděcích obrazů disků, včetně komprimovaných\",\"Lav opstartsbarer drev fra opstartsbarer disk billeder, inklusiv komprimerede billeder\",\"Opstartbare schijven aanmaken van opstartbare schijf-images, inclusief gecomprimeerde images\",\"Luo käynnistysasemia boottaavista levykuvista, pakatut kuvat mukaanlukien\",\"Créez des disques amorçables à partir d'images disque, y compris à partir d'images compressées\",\"Erstellen bootfähiger Laufwerke aus bootfähigen Festplatten-Images, einschließlich komprimierter Images\",\"Δημιουργήστε μονάδες εκκίνησης από εικόνες δίσκου με δυνατότητα εκκίνησης, συμπεριλαμβανομένων συμπιεσμένων\",\"יצירת כוננים הניתנים לאתחול מקובצי תמונת דיסק הניתנים לאתחול, כולל קבצים דחוסים\",\"Bootolható meghajtók készítése bootolható lemez képfájlokból, beleértve a tömörítetteket is\",\"Buat perangkat yang dapat di boot dari Disk Image, termasuk yang Disk Image yang terkompresi\",\"Crea unità avviabili da immagini disco avviabili, incluse quelle compresse\",\"圧縮済みのものを含むディスクイメージから起動可能ドライブを作成します。\",\"압축된 이미지를 포함하여 부팅 가능한 디스크 이미지에서 부팅 가능한 드라이브 만들기\",\"Izveido ielādes ierīces no ielādes disku virtuālajiem attēliem, tai skaitā arī no saspiestajiem\",\"Sukurkite įkrovos diskus iš įkrovos disko vaizdų, įskaitant suspaustus\",\"Buat pemacu boleh boot daripada imej cakera boleh boot, termasuk yang dimampatkan\",\"Lag oppstartbare disker fra images, inkludert komprimerte sådan\",\"درایوهای قابل بوت را از تصاویر دیسک قابل بوت، از جمله موارد فشرده، ایجاد کنید\",\"Twórz dyski rozruchowe z obrazów dysków, włączając skompresowane\",\"Criar discos inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas\",\"Criar unidades inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas\",\"Crează drive-uri de la imagini de disc bootabile, incluzând cele compresate\",\"Создание загрузочных дисков из образов загрузочных дисков, в том числе сжатых\",\"Kreiranje disk jedinica za pokretanje sistema sa slika diska koji se može pokretanja, uključujući kompresovane\",\"Vytvorte bootovacie jednotky z diskových obrazov, vrátane tých komprimovaných\",\"Ustvarite zagonske pogone iz slik diska, ki jih je mogoče zagnati, vključno s stisnjenimi\",\"Cree unidades de arranque a partir de imágenes de disco de arranque, incluidas las comprimidas\",\"Skapa startbara enheter från startbara diskavbildningar, inklusive komprimerade\",\"สร้างไดรฟ์บูตจากดิสก์อิมเมจที่บูตได้ (รองรับไฟล์ดิสก์อิมเมจที่ถูกบีบอัด)\",\"Sıkıştırılmış olanlar da dahil olmak üzere önyüklenebilir disk yansısından önyüklenebilir sürücüler oluşturun\",\"Створення завантажувальних пристроїв з завантажувальних образів, у тому числі стиснутих\",\"Tạo ổ đĩa có thể khởi động từ các tệp đĩa có thể khởi động, bao gồm cả tệp nén\"\n\"Feature5\",\"704\",\"Text\",\"\",\"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\",\"إنشاء BIOS أو محركات أقراص UEFI قابلة للإقلاع ، بما في ذلك UEFI NTFS القابل للتشغيل\",\"Създаване на BIOS или UEFI стартиращи устройства, включително UEFI стартиращ NTFS\",\"创建 BIOS 或 UEFI 可启动驱动器，包括 UEFI 可启动的 NTFS 驱动器\",\"建立 BIOS 或 UEFI 可開機隨身碟，包括 UEFI 下的可開機  NTFS 隨身碟\",\"Stvaranje BIOS ili UEFI pogona za pokretanje, uključujući UEFI NTFS za pokretanje\",\"Vytvořte zaváděcí jednotky BIOS nebo UEFI, včetně zaváděcích souborů NTFS UEFI\",\"Lav BIOS eller UEFI opstartsbarer drev, inklusiv UEFI opstartsbarer NTFS\",\"BIOS of UEFI opstartbare schijven aanmaken, inclusief UEFI opstartbare NTFS\",\"Luo BIOS- tai UEFI-boottaavia asemia, mukaanlukien UEFI-boottaavat NTFS-asemat\",\"Créez des disques amorçables BIOS ou UEFI, y compris des disques UEFI amorçables utilisant NTFS\",\"Erstellen von BIOS- oder UEFI-bootfähigen Laufwerken, einschließlich UEFI-bootfähigem NTFS\",\"Δημιουργήστε μονάδες δίσκου με δυνατότητα εκκίνησης BIOS ή UEFI, συμπεριλαμβανομένων NTFS με δυνατότητα εκκίνησης UEFI\",\"יצירת כוננים הניתנים לאתחול ממחשבים התומכים ב־BIOS או UEFI, לרבות כוננים הניתנים לאתחול מ־UEFI, המשתמשים במערכת הקבצים NTFS\",\"BIOS-ból vagy UEFI-ből bootolható meghajtók készítése, beleértve az UEFI-ből bootolható NTFS meghajtókat is\",\"Buat perangkat BIOS atau UEFI yang dapat di boot, termasuk perangkat NTFS yang dapat di boot oleh UEFI\",\"Crea unità avviabili BIOS o UEFI, incluso NTFS avviabile UEFI\",\"UEFI:NTFSを含むBIOS及びUEFIで起動可能なドライブを作成します。\",\"UEFI 부팅 가능한 NTFS를 포함하여 BIOS 또는 UEFI 부팅 가능 드라이브 만들기\",\"Izveido BIOS vai UEFI ielādes ierīces, ieskaitot UEFI ielādi no NTFS\",\"Sukurkite BIOS arba UEFI įkrovos diskus, įskaitant UEFI įkrovos NTFS\",\"Buat pemacu boleh boot BIOS atau UEFI, termasuk NTFS boleh boot UEFI\",\"Lag BIOS eller UEFI oppstartbare disker, inkludert UEFI oppstartbar NTFS\",\"درایوهای قابل بوت بایوس یا UEFI از جمله NTFS قابل بوت UEFI ایجاد کنید\",\"Stwórz dysk rozruchowy BIOS lub UEFI, włączając bootowalny dysk UEFI NTFS\",\"Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS\",\"Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS\",\"Crează discuri bootabile BIOS sau UEFI, incluzând NTFS-uri bootabile de UEFI\",\"Создание загрузочных дисков BIOS или UEFI, включая загрузочный UEFI NTFS\",\"Kreiranje BIOS ili UEFI disk jedinica za pokretanje sistema, uključujući NTFS sa UEFI pokretanjem sistema\",\"Vytvorte bootovacie jednotky systému BIOS alebo UEFI vrátane UEFI bootovateľnej jednotky NTFS\",\"Ustvarite zagonske pogone BIOS ali UEFI, vključno z UEFI bootable NTFS\",\"Cree unidades de arranque BIOS o UEFI, incluido NTFS de arranque UEFI\",\"Skapa BIOS- eller UEFI-startbara enheter, inklusive UEFI-startbar NTFS\",\"สร้างไดรฟ์บูตสำหรับระบบ BIOS หรือ UEFI และ UEFI bootable NTFS\",\"UEFI önyüklenebilir NTFS dahil BIOS ya da UEFI önyüklenebilir sürücüler oluşturun\",\"Створення завантажувальних пристроїв BIOS чи UEFI, включаючи завантажувальний UEFI NTFS\",\"Tạo ổ đĩa có thể khởi động với hệ thống BIOS hoặc UEFI, bao gồm cả NTFS có thể khởi động với UEFI\"\n\"Feature6\",\"705\",\"Text\",\"\",\"Create 'Windows To Go' drives\",\"إنشاء محركات أقراص \"\"Windows To Go\\\",\"Създаване на 'Windows To Go' устройства\",\"创建 'Windows To Go' 驱动器\",\"建立 'Windows To Go' 隨身碟\",\"Stvaranje pogona \"\"Windows To Go\\\",\"Vytvoření jednotek \"\"Windows To Go\",\"Lav 'Windows To Go' drev\",\"'Windows To Go'-schijven aanmaken\",\"Luo 'Windows To Go' -asemia\",\"Créez des disques 'Windows To Go'\",\"Erstellen von 'Windows To Go'-Laufwerken\",\"Δημιουργήστε μονάδες δίσκου \"\"Windows To Go\\\",\"יצירת כונני Windows To Go\",\"'Windows To Go' meghajtók készítése\",\"Buat perangkat Windows To Go\",\"Crea unità 'Windows To Go'\",\"Windows To Goドライブを作成します。\",\"'Windows To Go' 드라이브 만들기\",\"Izveido 'Windows To Go' ierīces\",\"Sukurkite \"\"Windows To Go\"\" diskus\",\"Buat pemacu 'Windows To Go'\",\"Lag 'Windows To Go' disker\",\"درایوهای \"\"Windows To Go\"\" را ایجاد کنید\",\"Stwórz dysk 'Windows To Go'\",\"Criar discos 'Windows To Go'\",\"Criar discos 'Windows To Go'\",\"Crează discuri 'Windows To Go'\",\"Создание дисков Windows To Go\",\"Kreiranje disk jedinica \"\"Windows to Go\\\",\"Vytvorte jednotky „Windows To Go\\\",\"Ustvarjanje pogonov »Windows To Go'\",\"Cree unidades 'Windows To Go'\",\"Skapa \"\"Windows To Go\"\"-enheter\",\"สร้างไดรฟ์ของ 'Windows To Go'\",\"'Windows To Go' sürücüleri oluşturun\",\"Створення пристроїв 'Windows To Go'\",\"Tạo ổ đĩa 'Windows To Go'\"\n\"Feature7\",\"706\",\"Text\",\"\",\"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\",\"قم بإنشاء محركات تثبيت ويندوز 11 لأجهزة الكمبيوتر التي لا تحتوي على TPM أو الإقلاع الآمن (Secure Boot)\",\"Създаване на Windows 11 инсталационно устройство за компютри, които нямат TPM или Secure Boot\",\"为没有 TPM 或安全启动功能的电脑创建 Windows 11 安装驱动器\",\"為沒有 TPM 或安全開機功能的電腦建立 Windows 11 安裝隨身碟\",\"Stvaranje instalacijskih pogona sustava Windows 11 za PC-jeve koji nemaju TPM ili Sigurno pokretanje\",\"Vytvoření instalačních jednotek systému Windows 11 pro počítače bez čipu TPM nebo Secure Boot\",\"Lav Windows 11 installations drev for PCer der ikker har TPM eller Secure Boot\",\"Windows 11 installatieschijven aanmaken voor pc's die geen TPM of Secure Boot hebben\",\"Luo Windows 11 -asennusasemia tietokoneille, jotka eivät tue TPM- tai Secure Boot -ominaisuuksia\",\"Créez des disques d'installation Windows 11 pour des PCs qui ne disposent pas de TPM ou Secure Boot\",\"Erstellen von Windows 11-Installationslaufwerken für PCs ohne TPM oder Secure Boot\",\"Δημιουργήστε μονάδες εγκατάστασης των Windows 11 για υπολογιστές που δεν διαθέτουν TPM ή Ασφαλή Εκκίνηση\",\"יצירת כונני התקנה של Windows 11 עבור מחשבים שאין להם TPM או Secure Boot\",\"Windows 11 telepítési meghajtók készítése olyan PC-k számára, amelyek nem rendelkeznek TPM vagy Secure Boot funkciókkal\",\"Buat perangkat pemasang Windows 11 untuk PC yang tidak mempunyai TPM atau Secure Boot\",\"Crea unità di installazione di Windows 11 per PC che non dispongono di TPM o avvio protetto\",\"TPM及びセキュアブート非対応のPC向けのWindows 11インストールドライブを作成します\",\"TPM 또는 보안 부팅이 없는 PC용 Windows 11 설치 드라이브 만들기\",\"Izveido Windows 11 instalācijas ierīces datoriem, kam nav TPM vai Secure Boot\",\"Sukurkite Windows 11 diegimo diskus kompiuteriams, kuriuose nėra TPM arba saugaus įkrovimo\",\"Buat pemacu pemasangan Windows 11 untuk PC yang tidak mempunyai TPM atau But Selamat\",\"Lag oppstartsmedia for Windows 11 som ikke krever TPM eller Secure Boot\",\"درایوهای نصب ویندوز 11 را برای رایانه هایی که TPM یا Secure Boot ندارند ایجاد کنید\",\"Twórz dyski instalacyjne systemu Windows 11 dla komputerów, które nie posiadają modułu TPM ani Secure Boot\",\"Criar discos de instalação do Windows 11 para PCs que não possuem TPM ou Secure Boot\",\"Criar discos de instalação do Windows 11 para PCs que não possuem TPM ou Arranque Seguro\",\"Crează drive de instalare Windows 11 pe computere care nu au TPM sau Bootare Securizată\",\"Создание установочных дисков Windows 11 для компьютеров без TPM или безопасной загрузки\",\"Kreiranje windows 11 instalacionih disk jedinica za računare koji nemaju TPM ili bezbedno pokretanje sistema\",\"Vytvorte inštalačné jednotky Windows 11 pre počítače, ktoré nemajú modul TPM, ani Secure Boot\",\"Ustvarjanje namestitvenih pogonov za Windows 11 za računalnike, ki nimate TPM ali Varnega zagona\",\"Cree unidades de instalación de Windows 11 para PC que no tienen TPM o Arranque seguro\",\"Skapa installationsenheter till Windows 11 för datorer som inte har TPM eller säker start\",\"สร้างไดรฟ์ติดตั้ง Windows 11 สำหรับคอมพิวเตอร์ที่ไม่มี TPM หรือ Secure Boot\",\"TPM ya da Güvenli Önyüklemeye sahip olmayan bilgisayarlar için Windows 11 kurulum sürücüleri oluşturun\",\"Створення інсталяційних дисків Windows 11 для ПК, які не мають TPM чи Secure Boot\",\"Tạo ổ đĩa cài đặt Windows 11 cho các máy tính không có TPM hoặc Secure Boot\"\n\"Feature8\",\"707\",\"Text\",\"\",\"Create persistent Linux partitions\",\"إنشاء Persistent Linux partitions\",\"Създаване на устойчиви Linux дялове\",\"创建持久 Linux 分区\",\"建立持續性 Linux 磁區\",\"Stvaranje trajnih Linux particija\",\"Vytvoření trvalých oddílů systému Linux\",\"Lav vedvarende Linux adskillelser\",\"Persistent Linux partities aanmaken\",\"Luo pysyviä Linux-osioita\",\"Créez des partitions persistentes pour Linux\",\"Persistente Linux-Partitionen erstellen\",\"Δημιουργήστε μόνιμα διαμερίσματα Linux\",\"יצירת מחיצות Linux קבועות\",\"Tartós Linux partíciók készítése\",\"Buat partisi Linux yang tetap/persistent\",\"Crea partizioni persistenti Linux\",\"記録用Linuxパーティションを作成します。\",\"영구 리눅스 파티션 만들기\",\"Izveido pastāvīgas Linux partīcijas\",\"Sukurkite nuolatinius Linux skaidinius\",\"Buat partition Linux berterusan\",\"Lag persistente Linux partisjoner\",\"ایجاد پارتیشن های لینوکس دائمی\",\"Utwórz trwałe partycje Linux\",\"Criar partições persistentes para Linux\",\"Crie partições persistentes para Linux\",\"Crează partiție de Linux persistentă\",\"Создание постоянных разделов Linux\",\"Kreiranje upornih Linux particija\",\"Vytvorte trvalé oblasti systému Linux\",\"Ustvarjanje trajnih Linux particij\",\"Crear particiones persistentes de Linux\",\"Skapa beständiga Linux-partitioner\",\"สร้าง Linux partition แบบ persistent\",\"Kalıcı Linux bölümleri oluşturun\",\"Створення розділу збереження Linux\",\"Tạo phân vùng Linux liên tục\"\n\"Feature9\",\"708\",\"Text\",\"\",\"Create VHD/DD images of the selected drive\",\"إنشاء صور VHD / DD لمحرك الأقراص المحدد\",\"Създаване на VHD/DD образи на избраното устройство\",\"为选择的驱动器创建 VHD/DD 镜像\",\"為選取的磁碟機建立 VHD/DD 映像檔\",\"Stvaranje VHD/DD slika odabranog pogona\",\"Vytvoření obrazů VHD/DD z vybrané jednotky\",\"Lav VHD/DD billeder af det valgte drev\",\"VHD/DD-images van de geselecteerde schijf aanmaken\",\"Luo VHD/DD-kuvia valitusta asemasta\",\"Créez des images VHD/DD du périphérique sélectionné\",\"VHD/DD-Images des ausgewählten Laufwerks erstellen\",\"Δημιουργήστε εικόνες VHD/DD της επιλεγμένης μονάδας δίσκου\",\"יצירת קובצי תמונה מסוג VHD/DD של הכונן שנבחר\",\"VHD/DD képfájl készítése a kiválasztott meghajtóról\",\"Buat image VHD/DD dari penyimpanan yang dipilih\",\"Crea immagini VHD/DD dell'unità selezionata\",\"選択されたドライブのVHD/DDイメージを作成します。\",\"선택한 드라이브의 VHD/DD 이미지 만들기\",\"Izveido izvēlētā diska VHD/DD virtuālos attēlus\",\"Sukurkite pasirinkto disko VHD / DD vaizdus\",\"Buat imej VHD/DD bagi pemacu yang dipilih\",\"Lag VHD/DD speilinger av valgt disk\",\"تصاویر VHD/DD از درایو انتخاب شده ایجاد کنید\",\"Stwórz obraz VHD/DD z wybranego dysku\",\"Criar imagens VHD/DD do dispositivo selecionado\",\"Criar imagens VHD/DD do dispositivo selecionado\",\"Crează imagini VHD/DD de pe drive-ul selectat\",\"Создание образов VHD/DD выбранного диска\",\"Kreiranje VHD/DD slika izabrane disk jedinice\",\"Vytvorte obrazy VHD/DD z vybratej jednotky\",\"Ustvarjanje VHD/DD slik izbranega pogona\",\"Cree imágenes VHD/DD de la unidad seleccionada\",\"Skapa VHD/DD-avbilder av den valda enheten\",\"สร้างอิมเมจไฟล์แบบ VHD/DD จากไดรฟ์ที่เลือก\",\"Seçilen sürücünün VHD/DD yansılarını oluşturun\",\"Створення образів VHD/DD з вибраних дисків\",\"Tạo tệp VHD/DD từ ổ đĩa đã chọn\"\n\"Feature10\",\"709\",\"Text\",\"\",\"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\",\"حساب المجاميع الإختبارية MD5 و SHA-1 و SHA-256 و SHA-512 للصورة المحددة\",\"Изчисляване на MD5, SHA-1, SHA-256 и SHA-512 чексуми на избраният образ\",\"计算被选择镜像的 MD5、SHA-1、SHA-256 和 SHA-512 校验码\",\"計算被選取映像的 MD5、SHA-1、SHA-256 和 SHA-512 檢查碼\",\"Izračunajte kontrolne zbrojeve odabrane slike MD5, SHA-1, SHA-256 i SHA-512\",\"Výpočet kontrolních součtů MD5, SHA-1, SHA-256 a SHA-512 vybraného obrazu\",\"Beregn MD5, SHA-1, SHA-256 og SHA-512 checksums af det valgte billede\",\"MD5, SHA-1, SHA-256 en SHA-512 controlesommen berekenen van de geselecteerde image\",\"Laske MD5, SHA-1, SHA-256 ja SHA-512 tarkistussummia valitusta levykuvasta\",\"Calculez les sommes de contrôle MD5, SHA-1, SHA-256 et SHA-512 de l'image sélectionnée\",\"Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Image\",\"Υπολογίστε τα αθροίσματα ελέγχου MD5, SHA-1, SHA-256 και SHA-512 της επιλεγμένης εικόνας\",\"חישוב סיכומי ביקורת מסוג MD5,‏ SHA-1,‏ SHA-256 ו־SHA-512 של קובץ התמונה שנבחרה\",\"A kiválasztott képfájl MD5, SHA-1, SHA-256 és SHA-512 ellenőrző összegének kiszámítása\",\"Hitung checksum MD5, SHA-1, SHA-256 dan SHA-512 dari image yang dipilih\",\"Calcola i checksum MD5, SHA-1, SHA-256 e SHA-512 dell'immagine selezionata\",\"選択されたイメージのMD5、SHA-1、SHA-256及びSHA-512チェックサムを計算します。\",\"선택한 이미지의 MD5, SHA-1, SHA-256 및 SHA-512 체크섬 계산\",\"Izskaitļo izvēlētā virtuālā attēla MD5, SHA-1, SHA-256 un SHA-512 kontrolsummas\",\"Apskaičiuokite pasirinkto vaizdo MD5, SHA-1, SHA-256 ir SHA-512 kontrolines sumas\",\"Kira MD5, SHA-1, SHA-256 dan SHA-512 checksum imej yang dipilih\",\"Kalkuler MD5, SHA-1, SHA-256 og SHA-512 sjekksummer fra valgt speiling\",\"MD5، SHA-1، SHA-256 و SHA-512 را برای تصویر انتخابی محاسبه کنید\",\"Oblicz sumy kontrolne MD5, SHA-1, SHA-256 i SHA-512 dla wybranego obrazu\",\"Calcular somas de verificação MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada\",\"Calcular checksums MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada\",\"Compută MD5, SHA-1, SHA-256 și SHA-512 suma de control ale imaginilor selectate\",\"Вычисление контрольных сумм MD5, SHA-1, SHA-256 и SHA-512 выбранного образа\",\"Izračunajte MD5, SHA-1, SHA-256 i SHA-512 kontrolne preglede izabrane slike\",\"Vypočítajte kontrolné súčty vybratého obrazu (MD5, SHA-1, SHA-256 a SHA-512)\",\"Račun MD5, SHA-1, SHA-256 in SHA-512 kontrolni vsoti izbrane slike\",\"Calcule las sumas de comprobación MD5, SHA-1, SHA-256 y SHA-512 de la imagen seleccionada\",\"Beräkna kontrollsummor MD5, SHA-1, SHA-256 och SHA-512 för den valda avbilden\",\"คำนวณรหัส MD5, SHA-1, SHA-256, SHA-512 ของไฟล์อิมเมจที่เลือก\",\"Seçilen yansının MD5, SHA-1, SHA-256 ve SHA-512 sağlama toplamlarını hesaplayın\",\"Обчислення контрольних сум MD5, SHA-1, SHA-256 та SHA-512 для вибраних образів\",\"Tính tổng kiểm MD5, SHA-1, SHA-256 và SHA-512 của tệp đã chọn\"\n\"Feature11\",\"710\",\"Text\",\"\",\"Perform bad blocks checks, including detection of \"\"fake\"\" flash drives\",\"إجراء فحوصات كتل تالفة ، بما في ذلك الكشف عن محركات أقراص فلاش \"\"زائفة\\\",\"Проверяване за лоши блокове, включително засичане на \"\"фалшиви\"\" устройства\",\"执行坏块检查，包括对”假“U盘的检测\",\"執行壞軌檢查，包括對”假“USB 快閃磁碟\n的偵測\",\"Izvršite provjere loših blokova, uključujući otkrivanje \"\"lažnih\"\" flash pogona\",\"Provést kontrolu vadných bloků, včetně detekce \"\"falešných\"\" bloků. flash disky\",\"Udøv dårlige blokke tjeks, inklusiv opdagelse af \"\"falske\"\" flashdrev\",\"Controles uitvoeren op slechte blokken, inclusief detectie van \"\"valse\"\" flashdrives\",\"Suorita viallisten lohkojen tarkistuksia, sisältäen \"\"valheellisten\"\" muistitikkujen tunnistamisen\",\"Executez un test de mauvais secteurs avec detection des \"\"fake drives\\\",\"Durchführung von Prüfungen auf fehlerhafte Blöcke, einschließlich der Erkennung von \"\"gefälschten\"\" Flash-Laufwerken\",\"Εκτελέστε ελέγχους εσφαλμένων block, συμπεριλαμβανομένου του εντοπισμού \"\"ψευδών\"\" μονάδων flash\",\"ביצוע בדיקות אחר בלוקים (אזורים) פגומים, כולל זיהוי של כונני הבזק \"\"מזוייפים\\\",\"Hibás blokkok ellenőrzése, beleértve a \"\"hamis\"\" flash meghajtók detektálását\",\"Lakukan cek Blok yang buruk, termasuk deteksi USB Flash Disk \"\"PALSU\\\",\"Esegui controlli dei blocchi danneggiati, incluso il rilevamento di unità flash \"\"false\\\",\"不良ブロックチェック及び容量詐欺ドライブの検知を行います。\",\"\"\"위조\"\" 플래시 드라이브 감지를 포함하여 불량 블록 검사 수행\",\"Izpilda bojāto bloku pārbaudi ieskaitot \"\"falsificēto\"\" nesēju noteikšanu\",\"Atlikite blogų blokų patikrinimus, įskaitant \"\"netikrų\"\" flash diskų aptikimą\",\"Melakukan pemeriksaan blok buruk, termasuk pengesanan pemacu kilat \"\"palsu\\\",\"Utfør sjekk for dårlige sektorer, inkludert sjekk for forfalskede flash disker\",\"بررسی بلوک های بد، از جمله تشخیص درایوهای فلش \"\"جعلی\"\" را انجام دهید\",\"Sprawdź dysk pod względem spójności danych lub wykryj \"\"nieoryginalny\"\" pendrive\",\"Executar verificações de blocos defeituosos, incluindo detecção de unidades flash \"\"falsificadas\\\",\"Executar verificações de blocos inválidos, incluindo a deteção de unidades flash \"\"falsas\\\",\"Verifică blocuri rele, incluzând detectarea de drive-uri flash \"\"false\\\",\"Проверка на плохие блоки, обнаружение \"\"поддельных\"\" флешек\",\"Izvršite provere loših blokova, uključujući otkrivanje \"\"lažnih\"\" fleš diskova\",\"Vykonajte kontroly zlých blokov vrátane detekcie „falošných\"\" prenosných diskov\",\"Izvajanje preverjanj slabih blokov, vključno z odkrivanjem »lažnih« bliskavic\",\"Realice comprobaciones de bloques defectuosos, incluida la detección de unidades flash \"\"falsas\\\",\"Utför kontroll av trasiga block, inklusive upptäckt av \"\"falska\"\" USB-minnen\",\"ตรวจสอบจุดบกพร่อง รวมไปถึงการทดสอบแฟลชไดรฟ์ว่าเป็น \"\"ของปลอม\"\" หรือไม่\",\"\"\"Sahte\"\" flash sürücülerin tespiti de dahil olmak üzere hatalı blok kontrolleri gerçekleştirin\",\"Перевірка дисків (включаючи фальшиві диски)\",\"Thực hiện kiểm tra điểm lỗi, bao gồm phát hiện ổ đĩa \"\"giả\\\"\n\"Feature12\",\"711\",\"Text\",\"\",\"Download official Microsoft Windows retail ISOs\",\"قم بتنزيل ملفات ISO الرسمية الخاصة بـ Microsoft Windows\",\"Изтегляне на официални Microsoft Windows ISO образи\",\"下载微软官方 Windows 镜像\",\"下載微軟官方 Windows 映像檔\",\"Preuzimanje službenih ISO-ova za maloprodaju sustava Microsoft Windows\",\"Stažení oficiálních souborů ISO systému Microsoft Windows\",\"Hent officielle Microsoft Windows detail ISOer\",\"Officiële Microsoft Windows retail ISO's downloaden\",\"Lataa virallisia Microsoft Windowsin jälleenmyyntiversion ISO-levykuvia\",\"Téléchargez des images ISOs commerciales officielles de Microsoft Windows\",\"Offizielle Microsoft Windows-ISOs herunterladen\",\"Κατεβάστε τα επίσημα retail ISO των Microsoft Windows\",\"הורדת קובצי ה־ISO הקמעונאיים הרשמיים של Microsoft Windows\",\"Hivatalos Microsoft Windows kiskereskedelmi ISO képfájlok letöltése\",\"Unduh ISO Microsoft Windows resmi\",\"Scarica le ISO ufficiali di Microsoft Windows\",\"マイクロソフト公式のWindows ISOをダウンロードします。\",\"공식 Microsoft Windows 리테일 ISO 다운로드\",\"Lejupielādē oficiālos Microsoft ISO failus\",\"Atsisiųskite oficialius Microsoft Windows mažmeninės prekybos ISO\",\"Muat turun rasmi ISO runcit Microsoft Windows\",\"Last ned offisielle Windows ISOer\",\"ISO های رسمی ماکروسافت را دریافت کنید\",\"Pobierz oficjalny obraz ISO systemu Microsoft Windows\",\"Baixar ISOs oficiais do Microsoft Windows\",\"Transferir ISOs oficiais do Microsoft Windows Retail\",\"Descarcă un Microsoft Windows ISO oficial de vânzare\",\"Загрузка официальных ISO-образов Windows\",\"Preuzmite zvanične Microsoft Windows maloprodajne ISO-ove\",\"Stiahnite si oficiálne ISO pre Microsoft Windows\",\"Prenos uradnih Microsoft Windows maloprodaja ISOs\",\"Descargue los ISO oficiales de Microsoft Windows\",\"Ladda ner officiella Microsoft Windows ISO-filer\",\"ดาวน์โหลดไฟล์ ISO ของ Microsoft Windows จากเว็บไซต์ทางการของ Microsoft\",\"Resmi Microsoft Windows Retail ISO'larını indirin\",\"Завантаження офіційних образів Microsoft Windows\",\"Tải xuống các tệp Microsoft Windows ISO bán lẻ chính thức\"\n\"Feature13\",\"712\",\"Text\",\"\",\"Download UEFI Shell ISOs\",\"قم بتنزيل UEFI Shell ISOs\",\"Изтегляне на UEFI Shell образи\",\"下载 UEFI Shell 镜像\",\"下載 UEFI Shell 映像檔\",\"Preuzmite ISO-ove UEFI ljuske\",\"Stažení souborů UEFI Shell ISO\",\"Hent UEFI Shell ISOer\",\"UEFI Shell ISO's downloaden\",\"Lataa UEFI Shell ISO-levykuvia\",\"Téléchargez des images ISOs du Shell UEFI\",\"UEFI-Shell-ISOs herunterladen\",\"Κατεβάστε τα ISO Shell UEFI\",\"הורדת קובצי ISO של מעטפת UEFI\",\"UEFI Shell ISO képfájlok letöltése\",\"Unduh Shell ISO UEFI\",\"Scarica le ISO della shell UEFI\",\"UEFIシェルのISOをダウンロードします。\",\"UEFI Shell ISO 다운로드\",\"Lejupielādē UEFI OS ISO failus\",\"Atsisiųskite UEFI Shell ISO\",\"Muat turun ISO Shell UEFI\",\"Last ned UEFI kommandolinje ISOer\",\"ISO های پوسته UEFI را دانلود کنید\",\"Ściągnij obrazy ISO UEFI Shell\",\"Baixar ISOs do Shell UEFI\",\"Transferir ISOs de UEFI Shell\",\"Descarcă UEFI Shell ISO-uri\",\"Загрузка ISO-образов оболочки UEFI\",\"Preuzmite UEFI Shell ISOs\",\"Stiahnite UEFI Shell ISO\",\"Prenos UEFI Shell ISOs\",\"Descargar ISO de UEFI Shell\",\"Ladda ner UEFI-skal ISO-filer\",\"ดาวน์โหลดไฟล์ ISO ของ UEFI Shell\",\"UEFI Shell ISO'larını indirin\",\"Завантаження командної оболонки UEFI ISO\",\"Tải xuống các tệp UEFI Shell ISO\"\n\"Feature14\",\"713\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Feature15\",\"714\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Feature16\",\"715\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Feature17\",\"716\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Feature18\",\"717\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Feature19\",\"718\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Feature20\",\"719\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MinimumHardwareReq1\",\"800\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MinimumHardwareReq2\",\"801\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MinimumHardwareReq3\",\"802\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MinimumHardwareReq4\",\"803\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MinimumHardwareReq5\",\"804\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MinimumHardwareReq6\",\"805\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MinimumHardwareReq7\",\"806\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MinimumHardwareReq8\",\"807\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MinimumHardwareReq9\",\"808\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MinimumHardwareReq10\",\"809\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"MinimumHardwareReq11\",\"810\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"RecommendedHardwareReq1\",\"850\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"RecommendedHardwareReq2\",\"851\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"RecommendedHardwareReq3\",\"852\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"RecommendedHardwareReq4\",\"853\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"RecommendedHardwareReq5\",\"854\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"RecommendedHardwareReq6\",\"855\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"RecommendedHardwareReq7\",\"856\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"RecommendedHardwareReq8\",\"857\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"RecommendedHardwareReq9\",\"858\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"RecommendedHardwareReq10\",\"859\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"RecommendedHardwareReq11\",\"860\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"SearchTerm1\",\"900\",\"Text\",\"Boot\",\"Boot\",\"الإقلاع (Boot)\",\"\",\"启动\",\"啟動\",\"\",\"\",\"\",\"Opstarten\",\"Boottaus\",\"Amorçable\",\"\",\"\",\"בוט\",\"\",\"\",\"Avvio\",\"起動\",\"부팅\",\"Ielāde\",\"Batas\",\"\",\"Oppstart\",\"راه‌اندازی\",\"\",\"Inicialização\",\"Inicializável\",\"Bootează\",\"Загрузочный\",\"\",\"boot\",\"Zagon\",\"Arranque\",\"Uppstart\",\"\",\"Önyükle\",\"Отримати\",\"Khởi động\"\n\"SearchTerm2\",\"901\",\"Text\",\"USB\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"SearchTerm3\",\"902\",\"Text\",\"ISO\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"SearchTerm4\",\"903\",\"Text\",\"Windows\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"SearchTerm5\",\"904\",\"Text\",\"Linux\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"SearchTerm6\",\"905\",\"Text\",\"UEFI\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"SearchTerm7\",\"906\",\"Text\",\"Windows To Go\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerToPlayAtTopOfListing\",\"999\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer1\",\"1000\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer2\",\"1001\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer3\",\"1002\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer4\",\"1003\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer5\",\"1004\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer6\",\"1005\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer7\",\"1006\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer8\",\"1007\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer9\",\"1008\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer10\",\"1009\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer11\",\"1010\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer12\",\"1011\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer13\",\"1012\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer14\",\"1013\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"Trailer15\",\"1014\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle1\",\"1020\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle2\",\"1021\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle3\",\"1022\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle4\",\"1023\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle5\",\"1024\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle6\",\"1025\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle7\",\"1026\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle8\",\"1027\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle9\",\"1028\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle10\",\"1029\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle11\",\"1030\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle12\",\"1031\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle13\",\"1032\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle14\",\"1033\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerTitle15\",\"1034\",\"Text\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail1\",\"1040\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail2\",\"1041\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail3\",\"1042\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail4\",\"1043\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail5\",\"1044\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail6\",\"1045\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail7\",\"1046\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail8\",\"1047\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail9\",\"1048\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail10\",\"1049\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail11\",\"1050\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail12\",\"1051\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail13\",\"1052\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail14\",\"1053\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n\"TrailerThumbnail15\",\"1054\",\"Relative path (or URL to file in Partner Center)\",\"\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\n"
  },
  {
    "path": "res/appstore/listing_template.csv",
    "content": "﻿Field,ID,Type (Type),default\nDescription,2,Text,\"MSG_900\n• MSG_901\n• MSG_902\n• MSG_903\"\nReleaseNotes,3,Text,<AUTOGENERATED>\nTitle,4,Text,Rufus\nShortTitle,5,Text,\nSortTitle,6,Text,\nVoiceTitle,7,Text,\nShortDescription,8,Text,MSG_174\nDevStudio,9,Text,Pete Batard\nCopyrightTrademarkInformation,12,Text,<AUTOGENERATED>\nAdditionalLicenseTerms,13,Text,MSG_904\nDesktopScreenshot1,100,Relative path (or URL to file in Partner Center),<AUTOGENERATED>\nDesktopScreenshot2,101,Relative path (or URL to file in Partner Center),<AUTOGENERATED>\nDesktopScreenshot3,102,Relative path (or URL to file in Partner Center),<AUTOGENERATED>\nDesktopScreenshot4,103,Relative path (or URL to file in Partner Center),<AUTOGENERATED>\nDesktopScreenshot5,104,Relative path (or URL to file in Partner Center),\nDesktopScreenshot6,105,Relative path (or URL to file in Partner Center),\nDesktopScreenshot7,106,Relative path (or URL to file in Partner Center),\nDesktopScreenshot8,107,Relative path (or URL to file in Partner Center),\nDesktopScreenshot9,108,Relative path (or URL to file in Partner Center),\nDesktopScreenshot10,109,Relative path (or URL to file in Partner Center),\nDesktopScreenshotCaption1,150,Text,\nDesktopScreenshotCaption2,151,Text,\nDesktopScreenshotCaption3,152,Text,\nDesktopScreenshotCaption4,153,Text,\nDesktopScreenshotCaption5,154,Text,\nDesktopScreenshotCaption6,155,Text,\nDesktopScreenshotCaption7,156,Text,\nDesktopScreenshotCaption8,157,Text,\nDesktopScreenshotCaption9,158,Text,\nDesktopScreenshotCaption10,159,Text,\nMobileScreenshot1,200,Relative path (or URL to file in Partner Center),\nMobileScreenshot2,201,Relative path (or URL to file in Partner Center),\nMobileScreenshot3,202,Relative path (or URL to file in Partner Center),\nMobileScreenshot4,203,Relative path (or URL to file in Partner Center),\nMobileScreenshot5,204,Relative path (or URL to file in Partner Center),\nMobileScreenshot6,205,Relative path (or URL to file in Partner Center),\nMobileScreenshot7,206,Relative path (or URL to file in Partner Center),\nMobileScreenshot8,207,Relative path (or URL to file in Partner Center),\nMobileScreenshot9,208,Relative path (or URL to file in Partner Center),\nMobileScreenshot10,209,Relative path (or URL to file in Partner Center),\nMobileScreenshotCaption1,250,Text,\nMobileScreenshotCaption2,251,Text,\nMobileScreenshotCaption3,252,Text,\nMobileScreenshotCaption4,253,Text,\nMobileScreenshotCaption5,254,Text,\nMobileScreenshotCaption6,255,Text,\nMobileScreenshotCaption7,256,Text,\nMobileScreenshotCaption8,257,Text,\nMobileScreenshotCaption9,258,Text,\nMobileScreenshotCaption10,259,Text,\nXboxScreenshot1,300,Relative path (or URL to file in Partner Center),\nXboxScreenshot2,301,Relative path (or URL to file in Partner Center),\nXboxScreenshot3,302,Relative path (or URL to file in Partner Center),\nXboxScreenshot4,303,Relative path (or URL to file in Partner Center),\nXboxScreenshot5,304,Relative path (or URL to file in Partner Center),\nXboxScreenshot6,305,Relative path (or URL to file in Partner Center),\nXboxScreenshot7,306,Relative path (or URL to file in Partner Center),\nXboxScreenshot8,307,Relative path (or URL to file in Partner Center),\nXboxScreenshot9,308,Relative path (or URL to file in Partner Center),\nXboxScreenshot10,309,Relative path (or URL to file in Partner Center),\nXboxScreenshotCaption1,350,Text,\nXboxScreenshotCaption2,351,Text,\nXboxScreenshotCaption3,352,Text,\nXboxScreenshotCaption4,353,Text,\nXboxScreenshotCaption5,354,Text,\nXboxScreenshotCaption6,355,Text,\nXboxScreenshotCaption7,356,Text,\nXboxScreenshotCaption8,357,Text,\nXboxScreenshotCaption9,358,Text,\nXboxScreenshotCaption10,359,Text,\nHolographicScreenshot1,400,Relative path (or URL to file in Partner Center),\nHolographicScreenshot2,401,Relative path (or URL to file in Partner Center),\nHolographicScreenshot3,402,Relative path (or URL to file in Partner Center),\nHolographicScreenshot4,403,Relative path (or URL to file in Partner Center),\nHolographicScreenshot5,404,Relative path (or URL to file in Partner Center),\nHolographicScreenshot6,405,Relative path (or URL to file in Partner Center),\nHolographicScreenshot7,406,Relative path (or URL to file in Partner Center),\nHolographicScreenshot8,407,Relative path (or URL to file in Partner Center),\nHolographicScreenshot9,408,Relative path (or URL to file in Partner Center),\nHolographicScreenshot10,409,Relative path (or URL to file in Partner Center),\nHolographicScreenshotCaption1,450,Text,\nHolographicScreenshotCaption2,451,Text,\nHolographicScreenshotCaption3,452,Text,\nHolographicScreenshotCaption4,453,Text,\nHolographicScreenshotCaption5,454,Text,\nHolographicScreenshotCaption6,455,Text,\nHolographicScreenshotCaption7,456,Text,\nHolographicScreenshotCaption8,457,Text,\nHolographicScreenshotCaption9,458,Text,\nHolographicScreenshotCaption10,459,Text,\nStoreLogo720x1080,600,Relative path (or URL to file in Partner Center),\nStoreLogo1080x1080,601,Relative path (or URL to file in Partner Center),\nStoreLogo300x300,602,Relative path (or URL to file in Partner Center),\nOverrideLogosForWin10,603,True/False,FALSE\nStoreLogoOverride150x150,604,Relative path (or URL to file in Partner Center),\nStoreLogoOverride71x71,605,Relative path (or URL to file in Partner Center),\nPromoImage1920x1080,606,Relative path (or URL to file in Partner Center),\nPromoImage2400x1200,607,Relative path (or URL to file in Partner Center),\nXboxBrandedKeyArt584x800,608,Relative path (or URL to file in Partner Center),\nXboxTitledHero1920x1080,609,Relative path (or URL to file in Partner Center),\nXboxFeaturedPromo1080x1080,610,Relative path (or URL to file in Partner Center),\nOptionalPromo358x358,611,Relative path (or URL to file in Partner Center),\nOptionalPromo1000x800,612,Relative path (or URL to file in Partner Center),\nOptionalPromo414x180,613,Relative path (or URL to file in Partner Center),\nFeature1,700,Text,MSG_910\nFeature2,701,Text,MSG_911\nFeature3,702,Text,MSG_912\nFeature4,703,Text,MSG_913\nFeature5,704,Text,MSG_914\nFeature6,705,Text,MSG_915\nFeature7,706,Text,MSG_916\nFeature8,707,Text,MSG_917\nFeature9,708,Text,MSG_918\nFeature10,709,Text,MSG_919\nFeature11,710,Text,MSG_920\nFeature12,711,Text,MSG_921\nFeature13,712,Text,MSG_922\nFeature14,713,Text,\nFeature15,714,Text,\nFeature16,715,Text,\nFeature17,716,Text,\nFeature18,717,Text,\nFeature19,718,Text,\nFeature20,719,Text,\nMinimumHardwareReq1,800,Text,\nMinimumHardwareReq2,801,Text,\nMinimumHardwareReq3,802,Text,\nMinimumHardwareReq4,803,Text,\nMinimumHardwareReq5,804,Text,\nMinimumHardwareReq6,805,Text,\nMinimumHardwareReq7,806,Text,\nMinimumHardwareReq8,807,Text,\nMinimumHardwareReq9,808,Text,\nMinimumHardwareReq10,809,Text,\nMinimumHardwareReq11,810,Text,\nRecommendedHardwareReq1,850,Text,\nRecommendedHardwareReq2,851,Text,\nRecommendedHardwareReq3,852,Text,\nRecommendedHardwareReq4,853,Text,\nRecommendedHardwareReq5,854,Text,\nRecommendedHardwareReq6,855,Text,\nRecommendedHardwareReq7,856,Text,\nRecommendedHardwareReq8,857,Text,\nRecommendedHardwareReq9,858,Text,\nRecommendedHardwareReq10,859,Text,\nRecommendedHardwareReq11,860,Text,\nSearchTerm1,900,Text,MSG_905\nSearchTerm2,901,Text,USB\nSearchTerm3,902,Text,ISO\nSearchTerm4,903,Text,Windows\nSearchTerm5,904,Text,Linux\nSearchTerm6,905,Text,UEFI\nSearchTerm7,906,Text,Windows To Go\nTrailerToPlayAtTopOfListing,999,Relative path (or URL to file in Partner Center),\nTrailer1,1000,Relative path (or URL to file in Partner Center),\nTrailer2,1001,Relative path (or URL to file in Partner Center),\nTrailer3,1002,Relative path (or URL to file in Partner Center),\nTrailer4,1003,Relative path (or URL to file in Partner Center),\nTrailer5,1004,Relative path (or URL to file in Partner Center),\nTrailer6,1005,Relative path (or URL to file in Partner Center),\nTrailer7,1006,Relative path (or URL to file in Partner Center),\nTrailer8,1007,Relative path (or URL to file in Partner Center),\nTrailer9,1008,Relative path (or URL to file in Partner Center),\nTrailer10,1009,Relative path (or URL to file in Partner Center),\nTrailer11,1010,Relative path (or URL to file in Partner Center),\nTrailer12,1011,Relative path (or URL to file in Partner Center),\nTrailer13,1012,Relative path (or URL to file in Partner Center),\nTrailer14,1013,Relative path (or URL to file in Partner Center),\nTrailer15,1014,Relative path (or URL to file in Partner Center),\nTrailerTitle1,1020,Text,\nTrailerTitle2,1021,Text,\nTrailerTitle3,1022,Text,\nTrailerTitle4,1023,Text,\nTrailerTitle5,1024,Text,\nTrailerTitle6,1025,Text,\nTrailerTitle7,1026,Text,\nTrailerTitle8,1027,Text,\nTrailerTitle9,1028,Text,\nTrailerTitle10,1029,Text,\nTrailerTitle11,1030,Text,\nTrailerTitle12,1031,Text,\nTrailerTitle13,1032,Text,\nTrailerTitle14,1033,Text,\nTrailerTitle15,1034,Text,\nTrailerThumbnail1,1040,Relative path (or URL to file in Partner Center),\nTrailerThumbnail2,1041,Relative path (or URL to file in Partner Center),\nTrailerThumbnail3,1042,Relative path (or URL to file in Partner Center),\nTrailerThumbnail4,1043,Relative path (or URL to file in Partner Center),\nTrailerThumbnail5,1044,Relative path (or URL to file in Partner Center),\nTrailerThumbnail6,1045,Relative path (or URL to file in Partner Center),\nTrailerThumbnail7,1046,Relative path (or URL to file in Partner Center),\nTrailerThumbnail8,1047,Relative path (or URL to file in Partner Center),\nTrailerThumbnail9,1048,Relative path (or URL to file in Partner Center),\nTrailerThumbnail10,1049,Relative path (or URL to file in Partner Center),\nTrailerThumbnail11,1050,Relative path (or URL to file in Partner Center),\nTrailerThumbnail12,1051,Relative path (or URL to file in Partner Center),\nTrailerThumbnail13,1052,Relative path (or URL to file in Partner Center),\nTrailerThumbnail14,1053,Relative path (or URL to file in Partner Center),\nTrailerThumbnail15,1054,Relative path (or URL to file in Partner Center),\n"
  },
  {
    "path": "res/appstore/packme.cmd",
    "content": "@rem This script creates the Rufus appxupload for upload to the Windows Store.\r\n@rem It attemps to follow as closely as possible what Visual Studio does.\r\n@echo off\r\nsetlocal EnableExtensions DisableDelayedExpansion\r\n\r\nrem if set, this will override the version for the package\r\nrem set VERSION_OVERRIDE=4.4.2104.0\r\n\r\ngoto main\r\n\r\n:ReplaceTokenInFile\r\nsetlocal EnableDelayedExpansion\r\nset FILE=%~1\r\nset TOKEN=%~2\r\nset VALUE=%~3\r\nfor /f \"delims=\" %%i in ('type %FILE% ^& break ^> %FILE%') do (\r\n  set \"line=%%i\"\r\n  >>%FILE% echo(!line:%TOKEN%=%VALUE%!\r\n)\r\nendlocal\r\nexit /B 0\r\n\r\n:main\r\ndel /q *.appx >NUL 2>&1\r\ndel /q *.appxbundle >NUL 2>&1\r\ndel /q *.map >NUL 2>&1\r\n\r\nset WDK_PATH=C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22000.0\\x64\r\nset ZIP_PATH=C:\\Program Files\\7-Zip\r\nset SIGNATURE_SHA1=fc4686753937a93fdcd48c2bb4375e239af92dcb\r\nset MANIFEST=AppxManifest.xml\r\nset ARCHS=x86 x64 arm64\r\nset DEFAULT_SCALE=200\r\nset OTHER_SCALES=100 125 150 400\r\nset SCALED_IMAGES=LargeTile SmallTile Square44x44Logo Square150x150Logo StoreLogo Wide310x150Logo\r\nrem All the languages listed below *MUST* match the ones from the Resources section of AppManifest.xml\r\nrem Oh, and these must be *valid* codes that Microsoft accepts, else your users will get an error\r\nrem (that the Microsoft validation and certification process will *NOT* catch) during install.\r\nset DEFAULT_LANGUAGE=en-US\r\nset ADDITIONAL_LANGUAGES=ar-SA bg-BG zh-CN zh-TW hr-HR cs-CZ da-DK nl-NL fi-FI fr-FR de-DE el-GR he-IL hu-HU id-ID it-IT ja-JP ko-KR lv-LV lt-LT ms-MY nb-NO fa-IR pl-PL pt-BR pt-PT ro-RO ru-RU sr-Latn-RS sk-SK sl-SI es-ES sv-SE th-TH tr-TR uk-UA vi-VN\r\nset PACKAGE_IMAGES=^\r\n Square44x44Logo.altform-lightunplated_targetsize-16.png^\r\n Square44x44Logo.altform-lightunplated_targetsize-24.png^\r\n Square44x44Logo.altform-lightunplated_targetsize-256.png^\r\n Square44x44Logo.altform-lightunplated_targetsize-32.png^\r\n Square44x44Logo.altform-lightunplated_targetsize-48.png^\r\n Square44x44Logo.altform-unplated_targetsize-16.png^\r\n Square44x44Logo.altform-unplated_targetsize-256.png^\r\n Square44x44Logo.altform-unplated_targetsize-32.png^\r\n Square44x44Logo.altform-unplated_targetsize-48.png^\r\n Square44x44Logo.targetsize-16.png^\r\n Square44x44Logo.targetsize-24.png^\r\n Square44x44Logo.targetsize-24_altform-unplated.png^\r\n Square44x44Logo.targetsize-256.png^\r\n Square44x44Logo.targetsize-32.png^\r\n Square44x44Logo.targetsize-48.png\r\n\r\nrem if you don't set the temp/tmp you get:\r\nrem error MSB6001: Invalid command line switch for \"CL.exe\". System.ArgumentExcep Key being added: 'TEMP'\r\nset temp=\r\nset tmp=\r\n\r\ncd /d \"%~dp0\"\r\n\r\nfor %%a in (%ARCHS%) do (\r\n  if not exist rufus_%%a.exe (\r\n    echo rufus_%%a.exe is missing from the current directory\r\n    goto out\r\n  )\r\n)\r\n\r\nrem Use our own get_pe_info executable - source is in this directory\r\nif not exist ..\\get_pe_info.exe (\r\n  echo ..\\get_pe_info.exe must exist in the parent directory. Compile it with MinGW.\r\n  goto out\r\n)\r\n\r\nrem Make sure we're not trying to create a package from an ALPHA or BETA version!\r\n..\\get_pe_info.exe -i rufus_x64.exe | findstr /C:\"ALPHA\" 1>nul && (\r\n  echo Alpha version detected - ABORTED\r\n  goto out\r\n)\r\n..\\get_pe_info.exe -i rufus_x64.exe | findstr /C:\"BETA\" 1>nul && (\r\n  echo Beta version detected - ABORTED\r\n  goto out\r\n)\r\n\r\nrem Populate the version from the executable\r\nif \"%VERSION_OVERRIDE%\"==\"\" (\r\n  ..\\get_pe_info.exe -v rufus_x64.exe > version.txt\r\n  set /p VERSION=<version.txt\r\n  del version.txt\r\n) else (\r\n  echo WARNING: Forcing version to %VERSION_OVERRIDE%\r\n  set VERSION=%VERSION_OVERRIDE%\r\n)\r\n\r\necho Will create %VERSION% AppStore Bundle\r\npause\r\n\r\n\"%WDK_PATH%\\signtool\" sign /v /sha1 %SIGNATURE_SHA1% /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 *.exe\r\nif ERRORLEVEL 1 goto out\r\n\r\necho [Files]> bundle.map\r\n\r\nrem Now who the £$%^&* at Microsoft thought it was a good idea to have MakePri require '/dq lang-en-US_lang-fr-FR-...'\r\nrem so that you actually end up with a <qualifier name=\"Language\" value=\"en-US;fr-FR;...\"/> in priconfig.xml?!?\r\nrem Oh, and of course, good luck finding this documented ANYWHERE on Microsoft's website!\r\nsetlocal EnableDelayedExpansion\r\nset STUPID_MAKEPRI_LANGUAGES=lang-%DEFAULT_LANGUAGE%\r\nfor %%l in (%ADDITIONAL_LANGUAGES%) do (\r\n  set STUPID_MAKEPRI_LANGUAGES=!STUPID_MAKEPRI_LANGUAGES!_lang-%%l\r\n)\r\nsetlocal DisableDelayedExpansion\r\n\r\nfor %%a in (%ARCHS%) do (\r\n  echo.\r\n  echo Creating Rufus_%VERSION%_%%a.appx...\r\n  cd /d \"%~dp0\"\r\n  echo \"Rufus_%VERSION%_%%a.appx\" \"Rufus_%VERSION%_%%a.appx\">> bundle.map\r\n  mkdir %%a >NUL 2>&1\r\n  cd %%a\r\n  mkdir Images >NUL 2>&1\r\n  for %%i in (%PACKAGE_IMAGES%) do (\r\n    copy \"..\\Images\\%%i\" Images\\ >NUL 2>&1\r\n  )\r\n  for %%i in (%SCALED_IMAGES%) do (\r\n    copy \"..\\Images\\%%i.scale-%DEFAULT_SCALE%.png\" Images\\ >NUL 2>&1\r\n  )\r\n  mkdir rufus\r\n  copy \"..\\rufus_%%a.exe\" \"rufus\\rufus.exe\" >NUL 2>&1\r\n  copy /y NUL \"rufus\\rufus.app\" >NUL 2>&1\r\n  rem When invoking MakePri, it is very important that you don't have files such as AppxManifest.xml or priconfig.xml\r\n  rem in the directory referenced by /pr or you may get ERROR_MRM_DUPLICATE_ENTRY when validating the submission as,\r\n  rem for instance, the 'AppxManifest.xml' from the 100% scale bundle will conflict the one from the x64 bundle.\r\n  \"%WDK_PATH%\\MakePri\" createconfig /o /pv 10.0.0 /cf ..\\priconfig.xml /dq %STUPID_MAKEPRI_LANGUAGES%_scale-%DEFAULT_SCALE%_theme-light\r\n  \"%WDK_PATH%\\MakePri\" new /o /pr . /cf ..\\priconfig.xml\r\n  del /q ..\\priconfig.xml\r\n  copy ..\\RufusAppxManifest.xml %MANIFEST% >NUL 2>&1\r\n  call:ReplaceTokenInFile %MANIFEST% @ARCH@ %%a\r\n  call:ReplaceTokenInFile %MANIFEST% @VERSION@ %VERSION%\r\n  \"%WDK_PATH%\\MakeAppx\" pack /o /d . /p ..\\Rufus_%VERSION%_%%a.appx\r\n  if ERRORLEVEL 1 goto out\r\n)\r\n\r\nfor %%a in (%OTHER_SCALES%) do (\r\n  echo.\r\n  echo Creating Rufus_%VERSION%_scale-%%a.appx...\r\n  cd /d \"%~dp0\"\r\n  echo \"Rufus_%VERSION%_scale-%%a.appx\" \"Rufus_%VERSION%_scale-%%a.appx\">> bundle.map\r\n  mkdir %%a >NUL 2>&1\r\n  cd %%a\r\n  mkdir Images >NUL 2>&1\r\n  for %%i in (%SCALED_IMAGES%) do (\r\n    copy \"..\\Images\\%%i.scale-%%a.png\" Images\\ >NUL 2>&1\r\n  )\r\n  \"%WDK_PATH%\\MakePri\" createconfig /o /pv 10.0.0 /cf ..\\priconfig.xml /dq %STUPID_MAKEPRI_LANGUAGES%_scale-%%a_theme-light\r\n  \"%WDK_PATH%\\MakePri\" new /o /pr . /cf ..\\priconfig.xml\r\n  del /q ..\\priconfig.xml\r\n  copy ..\\ScaleAppxManifest.xml %MANIFEST% >NUL 2>&1\r\n  call:ReplaceTokenInFile %MANIFEST% @SCALE@ %%a\r\n  call:ReplaceTokenInFile %MANIFEST% @VERSION@ %VERSION%\r\n  \"%WDK_PATH%\\MakeAppx\" pack /o /d . /p ..\\Rufus_%VERSION%_scale-%%a.appx\r\n)\r\n\r\nsetlocal EnableDelayedExpansion\r\nset ALL_ARCHS=\r\nfor %%a in (%ARCHS%) do set ALL_ARCHS=!ALL_ARCHS!_%%a\r\ncd /d \"%~dp0\"\r\n\"%WDK_PATH%\\MakeAppx\" bundle /f bundle.map /bv %VERSION% /p Rufus_%VERSION%%ALL_ARCHS%.appxbundle\r\nrem Visual Studio zips the appxbundle into an appxupload for store upload, so we do the same...\r\n\"%ZIP_PATH%\\7z\" a -tzip Rufus_%VERSION%%ALL_ARCHS%_bundle.appxupload Rufus_%VERSION%%ALL_ARCHS%.appxbundle\r\nendlocal\r\n\r\n:out\r\ncd /d \"%~dp0\"\r\nfor %%a in (%ARCHS%) do (\r\n  rd /S /Q %%a >NUL 2>&1\r\n)\r\nfor %%a in (%OTHER_SCALES%) do (\r\n  rd /S /Q %%a >NUL 2>&1\r\n)\r\ndel /q *.map >NUL 2>&1\r\ndel /q *.appx >NUL 2>&1\r\ndel /q *.appxbundle >NUL 2>&1\r\npause\r\nexit\r\n"
  },
  {
    "path": "res/appstore/runme.ps1",
    "content": "# PowerShell script to parse listing.csv and retrieve our screenshots\n# Copyright © 2023 Pete Batard <pete@akeo.ie>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n#\ntry {\n  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8\n} catch {}\n\n# NB: All languages IDs from the .csv are lowercase version of the one\n# from rufus.loc, except for 'sr-RS' that becomes 'sr-latn-rs'. \n\nfunction GetCellByName([object]$csv, [string]$row_name, [string]$column_name)\n{\n  foreach ($row in $csv | Where-Object {$_.Field -eq $row_name}) {\n    foreach ($column in $row.PSObject.properties) {\n      if ($column.name -eq $column_name) {\n        return $column.value\n      }\n    }\n  }\n  return [string]::Empty\n} \n\n$csv = Import-Csv -Path .\\listing.csv\n$langs = $csv | Select-Object -First 1 | Select * -ExcludeProperty 'Field','ID','Type (Type)','default' | ForEach-Object { $_.PSObject.Properties } | Select-Object -ExpandProperty Name\n\nforeach ($lang in $langs) {\n  $null = New-Item $lang -ItemType Directory -Force\n  $url = GetCellByName $csv 'DesktopScreenshot1' $lang\n  # Annoying but heck if I'm gonna bother with Microsoft's Auth in PowerShell...\n  Start-Process -NoNewWindow -FilePath \"C:\\Program Files\\Mozilla Firefox\\firefox.exe\" -ArgumentList \"-new-tab $url\"\n  Write-Host $lang;\n  $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');\n}\n"
  },
  {
    "path": "res/dbx/dbx_info.h",
    "content": "// Autogenerated - DO NOT EDIT\n\n#include <stdint.h>\n#pragma once\n\nstruct {\n\tchar* url;\n\tuint64_t timestamp;\n} dbx_info[] = {\n\t{ \"https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/x86/DBXUpdate.bin\", 1760555920 },\n\t{ \"https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/amd64/DBXUpdate.bin\", 1760555920 },\n\t{ \"https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm/DBXUpdate.bin\", 1740428422 },\n\t{ \"https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm64/DBXUpdate.bin\", 1740428422 },\n\t{ \"https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/ia64/DBXUpdate.bin\", 0 },\n\t{ \"https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/riscv64/DBXUpdate.bin\", 0 },\n\t{ \"https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/loongarch64/DBXUpdate.bin\", 0 },\n};\n"
  },
  {
    "path": "res/dbx/dbx_update.sh",
    "content": "#!/bin/env bash\n# This script downloads the latest UEFI DBXs and creates the dbx_info.h header\n\ngithub_url=\"https://api.github.com/\"\n\n# Retrieve the commit epoch from a GitHub URL or 0 if not available\nget_commit_date() {\n  url=$1\n  if [[ \"${url}\" =~ ^\"${github_url}\" ]]; then\n    parts=($(awk -F'contents/' '{ for(i=1;i<=NF;i++) print $i }' <<< ${url}))\n    date_url=\"${parts[0]}commits?path=${parts[1]//\\//%2F}&page=1&per_page=1\"\n    epoch=\"$(curl -s -L ${date_url} | python -m json.tool | grep -m1 \\\"date\\\": | sed -e 's/^.*\\\"date\\\":.*\\\"\\(.*\\)\\\".*/\\1/' | date -u -f - +%s)\"\n  fi\n  echo ${epoch:-0}\n}\n\n# Should be in the same order as the ArchType enum in Rufus with the first entry (ARCH_UNKNOWN = 0) skipped\n# Note that are GUESSING the RISC-V 64 and LoongArch 64 URLS since there are no DBX revocations for those archs yet.\n# Also use api.github.com (which is rate limited) so we don't get the stupid 404 GitHub page on error, which is 10\n# times larger than our largest DBX update binary...\ndeclare -a dbx_urls=(\n  'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/x86/DBXUpdate.bin'\n  'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/amd64/DBXUpdate.bin'\n  'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm/DBXUpdate.bin'\n  'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/arm64/DBXUpdate.bin'\n  'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/ia64/DBXUpdate.bin'\n  'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/riscv64/DBXUpdate.bin'\n  'https://api.github.com/repos/microsoft/secureboot_objects/contents/PostSignedObjects/DBX/loongarch64/DBXUpdate.bin'\n)\n\ncat << EOF > dbx_info.h\n// Autogenerated - DO NOT EDIT\n\n#include <stdint.h>\n#pragma once\n\nstruct {\n\tchar* url;\n\tuint64_t timestamp;\n} dbx_info[] = {\nEOF\nfor url in \"${dbx_urls[@]}\"; do\n  if [[ ! -z \"${url}\" ]]; then\n    dst=$(echo ${url} | cut -f10,11 -d'/' | tr '/' '_')\n    curl -L -H \"Accept: application/vnd.github.v3.raw\" \"${url}\" -o \"${dst}\"\n    fgrep -q \"Not Found\" \"${dst}\" && :> \"${dst}\"\n  fi\n  echo \"\t{ \\\"${url}\\\", $(get_commit_date ${url}) },\" >> dbx_info.h\ndone\necho \"};\" >> dbx_info.h\n"
  },
  {
    "path": "res/dbx/readme.txt",
    "content": "This directory contains the official UEFI revocation databases, as provided by\r\nhttps://github.com/microsoft/secureboot_objects/tree/main/PostSignedObjects.\r\n\r\nThese are used by Rufus to warn the user if a UEFI bootloader has been revoked."
  },
  {
    "path": "res/freedos/readme.txt",
    "content": "All of the executables found in this repository where extracted from FreeDOS v1.4:\r\nhttps://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.4/FD14-FullUSB.zip\r\n\r\no COMMAND.COM was extracted from packages\\base\\freecom.zip\r\no DISPLAY.EXE was extracted from packages\\base\\display.zip\r\no The EGA[#].CPX files were extracted from packages\\base\\cpidos.zip\r\no KERNEL.SYS was taken from packages\\base\\kernel.zip (KERNL386.SYS)\r\n  It was modified to have FORCELBA enabled (byte offset 0x0D set to 0x01)\r\no KEYB.EXE was extracted from packages\\base\\keyb.zip\r\no The KEYB###.SYS keyboard layouts were extracted from packages\\base\\keyb_lay.zip\r\no MODE.COM was extracted from packages\\base\\mode.zip\r\n"
  },
  {
    "path": "res/grub/grub_version.h",
    "content": "/*\n * This file contains the version string of the Grub4Dos 2.x binary embedded in Rufus.\n * Should be the same as the grub4dos_version file in the source Grub4Dos was compiled from.\n */\n#define GRUB4DOS_VERSION \"0.4.6a\"\n"
  },
  {
    "path": "res/grub/readme.txt",
    "content": "This directory contains the Grub4DOS boot records that are used by Rufus\r\n\r\n* grldr.mbr was taken from the official 2024-02-26 release from\r\n  https://github.com/chenall/grub4dos/releases/tag/0.4.6a\r\n\r\n* Note that, for convenience reasons, the first 512 bytes from this grldr.mbr are\r\n  *not* the ones that Rufus processes when writing the actual MBR (first 512 bytes).\r\n  Instead, the byte array from src/ms-sys/inc/mbr_grub.h (whose content is identical)\r\n  is what Rufus uses. If you have modified this file, and the MBR section is altered,\r\n  be mindful that you also need to update the array in mbr_grub.h.\r\n\r\n* For details, see src/format.c, src/msys/br.c and src/msys/inc/mbr_grub.h.\r\n"
  },
  {
    "path": "res/grub2/grub2_version.h",
    "content": "/*\n * This file contains the version string of the GRUB 2.x binary embedded in Rufus.\n * Should be the same as GRUB's PACKAGE_VERSION in config.h.\n */\n#pragma once\n\n#define GRUB2_PACKAGE_VERSION \"2.14\"\n"
  },
  {
    "path": "res/grub2/readme.txt",
    "content": "This directory contains the Grub 2.0 boot records that are used by Rufus\r\n\r\n* boot.img and core.img were created from https://ftp.gnu.org/gnu/grub/grub-2.14.tar.xz\r\n  with https://github.com/gentoo/gentoo/raw/d51cbeb087dbbe979ff29af645f32071cce2834d/sys-boot/grub/files/grub-2.14-revert-image-base.patch\r\n  applied (since GRUB are apparently unable to perform BASIC testing of their releases)\r\n  on a Debian 13 x64 system using the commands:\r\n    patch -p1 < grub-2.14-revert-image-base.patch\r\n    ./autogen.sh\r\n    # --enable-boot-time for Manjaro Linux\r\n    ./configure --disable-nls --enable-boot-time\r\n    make -j4\r\n    cd grub-core\r\n    ../grub-mkimage -v -O i386-pc -d. -p\\(hd0,msdos1\\)/boot/grub biosdisk fat exfat ext2 ntfs ntfscomp part_msdos -o core.img\r\n\r\n* boot.img has been modified to nop the jump @ 0x66 as per grub2's setup.c comments:\r\n  /* If DEST_DRIVE is a hard disk, enable the workaround, which is\r\n     for buggy BIOSes which don't pass boot drive correctly. Instead,\r\n     they pass 0x00 or 0x01 even when booted from 0x80.  */\r\n\r\n* Note that, for convenience reasons, the content of boot.img is *not* the one that\r\n  Rufus processes when writing the MBR.\r\n  Instead, the byte array from src/ms-sys/inc/mbr_grub2.h (whose content is identical)\r\n  is what Rufus uses. If you modify these files, be mindful that you may also need\r\n  to update the array in mbr_grub2.h.\r\n\r\n* For details, see src/format.c, src/msys/br.c and src/msys/inc/mbr_grub2.h."
  },
  {
    "path": "res/hogger/hogger.asm",
    "content": " ; Rufus: The Reliable USB Formatting Utility\n ; Commandline hogger, assembly version (NASM)\n ; Copyright © 2014 Pete Batard <pete@akeo.ie>\n ;\n ; This program is free software: you can redistribute it and/or modify\n ; it under the terms of the GNU General Public License as published by\n ; the Free Software Foundation, either version 3 of the License, or\n ; (at your option) any later version.\n ;\n ; This program is distributed in the hope that it will be useful,\n ; but WITHOUT ANY WARRANTY; without even the implied warranty of\n ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n ; GNU General Public License for more details.\n ;\n ; You should have received a copy of the GNU General Public License\n ; along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n\tglobal _main\n\textern _GetStdHandle@4\n\textern _OpenMutexA@12\n\textern _WaitForSingleObject@8\n\textern _WriteFile@20\n\textern _ExitProcess@4\n\n\tsection .text\n_main:\n\t; DWORD size;\n\tmov     ebp, esp\n\tsub     esp, 4\n\n\t; register HANDLE mutex [-> ecx], stdout [-> ebx];\n\n\t; stdout = GetStdHandle(STD_OUTPUT_HANDLE);\n\tpush    -11\n\tcall    _GetStdHandle@4\n\tmov     ebx, eax\n\n\t; mutex = OpenMutexA(SYNCHRONIZE, FALSE, \"Global/Rufus_CmdLine\");\n\tpush    mutex_name\n\tpush    0\n\tpush    1048576 ; 0x00100000\n\tcall    _OpenMutexA@12\n\tmov     ecx, eax\n\n\t; if (mutex == NULL)\n\ttest    eax, eax\n\t\n\t; goto error\n\tje      error\n\t\n\t; WaitForSingleObject(mutex, INFINITE);\n\tpush    -1\n\tpush    ecx\n\tcall    _WaitForSingleObject@8\n\t\n\t; goto out;\n\tjmp     out;\n\n\t; error:\nerror:\n\n\t;\tWriteFile(stdout, error_msg, sizeof(error_msg), &size, 0);\n\tpush    0\n\tlea     eax, [ebp-4]\n\tpush    eax\n\tpush    (error_msg_end - error_msg)\n\tpush    error_msg\n\tpush    ebx\n\tcall    _WriteFile@20\n\n\t; out:\nout:\n\n\t; ExitProcess(0)\n\tpush    0\n\tcall    _ExitProcess@4\n\n\t; Just in case...\n\thlt\n\nmutex_name:\n\tdb \"Global/Rufus_CmdLine\",0\nerror_msg:\n\tdb \"Unable to synchronize with GUI application.\",0\nerror_msg_end:"
  },
  {
    "path": "res/hogger/hogger.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Commandline hogger, C version\n * Copyright © 2014 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <windows.h>\n\nconst char error_msg[] = \"Unable to synchronize with UI application.\";\n\nint __cdecl main(int argc_ansi, char** argv_ansi)\n{\n\tDWORD size;\n\tregister HANDLE mutex, stdout;\n\tstdout = GetStdHandle(STD_OUTPUT_HANDLE);\n\tmutex = OpenMutexA(SYNCHRONIZE, FALSE, \"Global/Rufus_CmdLine\");\n\tif (mutex == NULL)\n\t\tgoto error;\n\tWaitForSingleObject(mutex, INFINITE);\n\tgoto out;\n\nerror:\n\tWriteFile(stdout, error_msg, sizeof(error_msg), &size, 0);\n\nout:\n\tExitProcess(0);\n}\n"
  },
  {
    "path": "res/hogger/readme.txt",
    "content": "Rufus: The Reliable USB Formatting Utility - Commandline hogger\r\n\r\n# Description\r\n\r\nThis little utility is intended to solve the issue of Windows applications not\r\nbeing able to be BOTH console and GUI [1], leading to all kind of annoyances [2].\r\n\r\nThe basic problem is as follows:\r\n\r\n1. You have an awesome Windows UI application that you want your users to be\r\n   able to start from the commandline (to provide parameters, etc.)\r\n2. If an application is set to operate in UI mode, then when you launch it from\r\n   the command line, you will NOT get a command prompt freeze until it exits, as\r\n   you'd expect from any console app, but instead the prompt will return to the\r\n   user right away.\r\n3. This means that any message that you try to output from your app to the\r\n   console will appear as ugly as:\r\n   C:\\Some\\Directory> Some Application Message\r\n4. Another unfortunate effect is that, when users exit your app, they might\r\n   continue to wait for the prompt to come back, when it is already available\r\n   whilst polluted by output that looks out of place => Your user experience is\r\n   now subpar...\r\n5. To compensate for this, you might try to be (somewhat) clever, through the\r\n   simulating an <Enter> keypress when your app exit, but lo and behold, soon\r\n   enough you start receiving complaints left and right from Far Manager [3]\r\n   users, due to the fact that this application uses the <Enter> keypress as an\r\n   \"I want to launch the currently selected app\" event.\r\n6. HEY, MICROSOFT, THIS SUPER-SUCKS!!!!\r\n\r\n# Primer\r\n\r\nSo, how far do we need to go to address this?\r\n\r\n1. We'll create a console hogger application, that does just what you'd expect\r\n   a regular commandline app to do (hog the console prompt until the app exits)\r\n   and wait for a signal (Mutex) from the UI app to indicate that it is closed.\r\n2. We'll embed this console hogger as a resource in our app, to be extracted\r\n   and run in the current directory whenever we detect that our UI app has\r\n   been launched from the commandline\r\n3. Because we want this annoyance to have the least impact possible, we'll\r\n   make sure that it is AS SMALL AS POSSIBLE, by writing it in pure assembly\r\n   so that we can compile it with NASM and linking it with WDK, leaving us\r\n   with a 2 KB executable (that will further be compressed to about 1/4th of\r\n   this size through UPX/LZMA).\r\n\r\n# Drawbacks\r\n\r\nThe one annoyance with this workaround is that our 'hogger' will appear in the\r\ncommand history (doskey). This means that when when a user wants to navigate\r\nback to the command they launched, they need to skip through an extra entry,\r\nwhich they probably have no idea about. And of course, doskey does not provide\r\nthe ability to suppress this last entry.\r\n\r\nOh, and you also need to release the mutex so that you can delete the file \r\nbefore you exit, though that's not a big deal...\r\n\r\n# Compilation\r\n\r\n; From a WDK command prompt\r\n\r\nnasm -fwin32 hogger.asm\r\n\r\nlink /subsystem:console /nodefaultlib /entry:main hogger.obj %SDK_LIB_DEST%\\i386\\kernel32.lib\r\n\r\n# Links\r\n\r\n[1] http://blogs.msdn.com/b/oldnewthing/archive/2009/01/01/9259142.aspx\r\n[2] https://github.com/pbatard/rufus/issues/161\r\n[3] http://www.farmanager.com/\r\n"
  },
  {
    "path": "res/icons/license.txt",
    "content": "Please note the following licensing information for the icons:\r\n\r\no rufus*.* - Public Domain, courtesy of PC Unleashed\r\n  http://pcunleashed.com\r\n\r\no hash-*.png, info-*.png, lang-*.png, log-*.png, save-*.png, settings-*.png\r\n  From Axialis Fluent Pro 2018 Icon Set\r\n  CC BY-ND 4.0 when used as native resolution bitmaps, Commercial License otherwise\r\n  See https://www.axialis.com/icongenerator/iconset-license.html#free\r\n\r\no setup.ico\r\n  Base SVG from https://tablericons.com/\r\n  No attribution required.\r\n  With arrow overlay from Axialis Icon Set.\r\n\r\nNB: To be on the safe side with regards to icon use and redistribution, we\r\n    did purchase a Commercial License for the Axialis icons.\r\n    If you are planning to use these icons outside of this project, you may\r\n    need to contact Axialis Software to clarify the extent to which you are\r\n    legally entitled to do so.\r\n"
  },
  {
    "path": "res/loc/ChangeLog.txt",
    "content": "This file lists all the changes that have been applied to the en-US translation of\r\nrufus.loc since its original version.\r\n\r\nTo edit a translation, please make sure to follow:\r\nhttps://github.com/pbatard/rufus/wiki/Localization#Editing_an_existing_translation\r\nOr simply download https://files.akeo.ie/pollock/pollock-1.6.exe and follow its directions.\r\n\r\no v4.14 (2026.??.??)\r\n  // NB: I used Google translate to update the following message, so please check for accuracy!\r\n  - *UPDATED*  MSG_337 \"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\" -> \"An additional file ('%s') must be downloaded from Microsoft to use this feature:\"\r\n  // From the WUE dialog with tooltip at MSG_369. Indicates that once installed, Windows will copy a file (SkuSiPolicy.p7b) to the EFI partition. KB5042562 refers to https://support.microsoft.com/kb/5042562.\r\n  // NB: WUE refers to the \"Windows User Experience\" dialog that Rufus displays after you select a Windows 11 ISO and press START.\r\n  - *NEW*      MSG_323 \"Apply SkuSiPolicy.p7b on installation (See KB5042562)\"\r\n  // From the WUE dialog with tooltip at MSG_370. Please do NOT translate \"QoL\" or \"Copilot, OneDrive, Outlook, Fast Startup\".\r\n  - *NEW*      MSG_324 \"QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)\"\r\n  // From the WUE dialog with tooltip at MSG_368. 'Windows CA 2023' refers to the new Windows security certificate https://go.microsoft.com/fwlink/?linkid=2239776 which is a binary digital signature certificate used for Secure Boot.\r\n  - *NEW*      MSG_350 \"Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)\"\r\n  // The following 4 messages refer to Secure Boot revocation updates, such as the ones provided at https://uefi.org/revocationlistfile. 'DBX' is the main UEFI revocation database and should not be translated.\r\n  - *NEW*      MSG_351 \"Checking for UEFI bootloader revocation...\"\r\n  - *NEW*      MSG_352 \"Checking for UEFI DBX updates...\"\r\n  - *NEW*      MSG_353 \"DBX update available\"\r\n  - *NEW*      MSG_354 \"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks...\"\r\n  // From the WUE dialog with tooltip at MSG_371 and further description at MSG_356. This basically allows a fully unattended Windows installation, that will not prompt the user at all and therefore automatically (and SILENTLY)\r\n  // erase all data on the first found disk on the PC on which the media is booted, before partitioning it and installing Windows. Because the media does not prompt before erasing all data on the first disk, it is obvioulsy a\r\n  // very DANGEROUS option, hence the ⚠ signs and the extra dialog that shows for it, in MSG_356, to ensure that the user accepts the consequences of selecting it.\r\n  // In case it matters, the implied tense for the verb is FUTURE and indicates what the media/installer will do once booted. It does not indicate what Rufus itself does.\r\n  - *NEW*      MSG_355 \"⚠SILENTLY⚠ erase disk and install:\"\r\n  - *NEW*      MSG_356 \"You have selected to use the \\\"silent\\\" Windows installation option (...)\"\r\n  // The following two messages can be tested if you select an image (e.g. ISO) that is located on the drive you are trying to create\r\n  // If not directly relatable, the \"saw the branch you are sitting on\" idiom should be translated into a similar popular metaphor (for something that is so illogically bad that it will obviously end in disaster) in your language.\r\n  - *NEW*      MSG_358 \"Unsupported image location\"\r\n  - *NEW*      MSG_359 \"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on (...)\"\r\n  // Tooltip for WUE MSG_329\r\n  - *NEW*      MSG_360 \"It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available.\"\r\n  // Tooltip for WUE MSG_330\r\n  - *NEW*      MSG_361 \"For this option to work, network/Internet MUST be disconnected during installation!\"\r\n  // Tooltip for WUE MSG_331\r\n  - *NEW*      MSG_362 \"Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user.\"\r\n  // Tooltip for WUE MSG_332. Please avoid translating 'Windows To Go'.\r\n  - *NEW*      MSG_363 \"You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades.\"\r\n  // Tooltip for WUE MSG_333\r\n  - *NEW*      MSG_364 \"Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon.\"\r\n  // Tooltip for WUE MSG_334\r\n  - *NEW*      MSG_365 \"Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user.\"\r\n  // Tooltip for WUE MSG_335\r\n  - *NEW*      MSG_366 \"Don't encrypt the system disk, unless explicitly requested by the user.\"\r\n  // Tooltip for WUE MSG_346 (that requires \"Expert Mode\" to first be enabled with Ctrl-Alt-E)\r\n  - *NEW*      MSG_367 \"Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows.\"\r\n  // Tooltip for WUE MSG_350. Mosby refers to https://github.com/pbatard/Mosby.\r\n  - *NEW*      MSG_368 \"Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system.\"\r\n  // Tooltip for WUE MSG_323\r\n  - *NEW*      MSG_369 \"Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting.\"\r\n  // Tooltip for WUE MSG_324. Do not translate \"Quality of Life\", since it must match the QoL abbreviation from MSG_324 and it is meant to be known by the user (and is clarified by the rest of the message anyway)\r\n  - *NEW*      MSG_370 \"\\\"Quality of Life\\\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users.\"\r\n  // Tooltip for WUE MSG_355\r\n  - *NEW*      MSG_371 \"If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase.\"   \r\n\r\no v4.5 (2024.05.22)\r\n  - *UPDATED*  IDC_RUFUS_MBR -> IDC_UEFI_MEDIA_VALIDATION \"Enable runtime UEFI media validation\"\r\n  - *UPDATED*  MSG_167 \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\r\n  - *NEW*      MSG_337 \"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS (...)\"\r\n  - *NEW*      MSG_338 \"Revoked UEFI bootloader detected\"\r\n  - *NEW*      MSG_339 \"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked (...)\"\r\n  - *NEW*      MSG_340 \"a \\\"Security Violation\\\" screen\"\r\n  - *NEW*      MSG_341 \"a Windows Recovery Screen (BSOD) with '%s'\"\r\n  - *NEW       MSG_342 \"Compressed VHDX Image\"\r\n  - *NEW*      MSG_343 \"Uncompressed VHD Image\"\r\n  - *NEW*      MSG_344 \"Full Flash Update Image\"\r\n  - *NEW*      MSG_345 \"Some additional data must be downloaded from Microsoft to use this functionality (...)\"\r\n  - *NEW*      MSG_346 \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\r\n  - *NEW*      MSG_347 \"Expert Mode\"\r\n  - *NEW*      MSG_348 \"Extracting archive files: %s\"\r\n  - *NEW*      MSG_349 \"Use Rufus MBR\"\r\n\r\no v3.22 (2023.03.25)\r\n  // MSG_144 is aimed the the ISO download feature\r\n  - *UPDATED*  MSG_144 \"Temporarily banned by Microsoft for requesting too many downloads (...)\" -> \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\r\n  // MSG_199 will appear for the ISO download feature if running on Windows 7 \r\n  - *NEW*      MSG_199 \"This feature is not available on this platform.\"\r\n  // MSG_294 can be tested by launching Rufus from the commandline with option -z61\r\n  - *UPDATED*  MSG_294 \"This version of Windows is no longer supported by Rufus.\" -> added \"\\nThe last version of Rufus compatible with this platform is v%d.%d.\"\r\n  - *NEW*      MSG_322 \"Unable to open or read '%s'\"\r\n  // MSG_325 appears on the status bar when creating a customized Windows 10 or Windows 11 media\r\n  - *NEW*      MSG_325 \"Applying Windows customization: %s\"\r\n  // The following messages appear after selecting a Windows 11 ISO and pressing START\r\n  - *NEW*      MSG_326 \"Applying user options...\"\r\n  - *NEW*      MSG_327 \"Windows User Experience\"\r\n  - *NEW*      MSG_328 \"Customize Windows installation?\"\r\n  - *NEW*      MSG_329 \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\r\n  - *NEW*      MSG_330 \"Remove requirement for an online Microsoft account\"\r\n  - *NEW*      MSG_331 \"Disable data collection (Skip privacy questions)\"\r\n  - *NEW*      MSG_332 \"Prevent 'Windows To Go' from accessing internal disks\"\r\n  - *NEW*      MSG_333 \"Create a local account with username:\"\r\n  - *NEW*      MSG_334 \"Set regional options to the same values as this user's\"\r\n  - *NEW*      MSG_335 \"Disable BitLocker automatic device encryption\"\r\n  // MSG_336 can be tested with <Ctrl>-<P>\r\n  - *NEW*      MSG_336 \"Persistent log\"\r\n  // The following messages are used for the Windows Store listing at https://apps.microsoft.com/store/detail/rufus/9PC3H3V7Q9CH\r\n  - *NEW*      MSG_900 \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\r\n  - *NEW*      MSG_901 \"Official site: %s\"\r\n  - *NEW*      MSG_902 \"Source Code: %s\"\r\n  - *NEW*      MSG_903 \"ChangeLog: %s\"\r\n  // The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\r\n  // Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it below.\r\n  - *NEW*      MSG_904 \"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\nSee https://www.gnu.org/licenses/gpl-3.0.en.html for details\"\r\n  // Keyword for \"boot\" that can be used for search in the Windows Store\r\n  - *NEW*      MSG_905 \"Boot\"\r\n  // This and subsequent messages will be listed in the 'Features' section of the Windows Store page\r\n  - *NEW*      MSG_910 \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\n  - *NEW*      MSG_911 \"Create FreeDOS bootable USB drives\"\r\n  - *NEW*      MSG_912 \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\r\n  - *NEW*      MSG_913 \"Create bootable drives from bootable disk images, including compressed ones\"\r\n  - *NEW*      MSG_914 \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\r\n  - *NEW*      MSG_915 \"Create 'Windows To Go' drives\"\r\n  - *NEW*      MSG_916 \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\r\n  - *NEW*      MSG_917 \"Create persistent Linux partitions\"\r\n  - *NEW*      MSG_918 \"Create a VHD/DD image of a drive\"\r\n  - *NEW*      MSG_919 \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\r\n  - *NEW*      MSG_920 \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\r\n  - *NEW*      MSG_921 \"Download official Microsoft Windows retail ISOs\"\r\n  - *NEW*      MSG_922 \"Download UEFI Shell ISOs\"\r\n\r\no v3.14 (2021.03.31)\r\n  - *UPDATED*  MSG_068 \"Error while partitioning drive.\" -> \"Could not partition drive.\"\r\n  - *UPDATED*  MSG_274 \"IsoHybrid image detected\" -> \"%s image detected\"\r\n  // MSG_308 can be tested with <Alt>-<G>\r\n  - *NEW*      MSG_308 \"VHD detection\"\r\n  // MSG_309 can be seen in the file selection dialog *after* having selected an ISO (e.g. esp_test.iso below)\r\n  // and pressing <Ctrl>-<SELECT> (i.e. clicking on the 'SELECT' button while maintaining the <Ctrl> key pressed)\r\n  - *NEW*      MSG_309 \"Compressed archive\"\r\n  // MSG_310 can be tested with https://github.com/pbatard/rufus/raw/master/res/loc/test/esp_test.iso\r\n  - *NEW*      MSG_310 \"The ISO you have selected uses UEFI and is small enough to be written as (...)\"\r\n  // MSG_311 can be seen after selecting an ISO (such as the previous one) and clicking the (✓) button\r\n  - *NEW*      MSG_311 \"Use %s (in the main application window) to enable.\"\r\n  // MSG_312 Can be tested with <Alt>-<H>\r\n  - *NEW*      MSG_312 \"Extra hashes (SHA512)\"\r\n  // The following are accessibility labels for some UI elements.\r\n  // They can be tested with https://accessibilityinsights.io/docs/en/windows/overview\r\n  - *NEW*      MSG_313 \"Save to VHD\"\r\n  - *NEW*      MSG_314 \"Compute image checksums\"\r\n  - *NEW*      MSG_315 \"Multiple buttons\"\r\n  - *NEW*      MSG_316 \"Number of passes\"\r\n  - *NEW*      MSG_317 \"Disk ID\"\r\n  // MSG_318 can be tested with <Alt>-<+> and <Alt>-<->\r\n  - *NEW*      MSG_318 \"Default thread priority: %d\"\r\n  // MSG_319 can be tested with <Alt>-<M>\r\n  - *NEW*      MSG_319 \"Ignore Boot Marker\"\r\n  - *NEW*      MSG_320 \"Refreshing partition layout\"\r\n  // MSG_321 can be tested with https://manjaro.org/downloads/official/xfce/\r\n  - *NEW*      MSG_321 \"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO mode (...)\r\n\r\no v3.5 (2019.03.12)\r\n  The following 3 messages can be tested by creating a UEFI:NTFS drive in Rufus ('Show advanced drive properties' must be enabled\r\n  and then you can just select 'UEFI:NTFS' under 'Boot selection' and click 'START'. Then, when the drive creation is complete, you\r\n  will see a dialog using the 3 messages below)\r\n  - *NEW*      MSG_127 \"Do not show this message again\"\r\n  In the following '%s' will be one of \"MBR\", \"Secure Boot\", \"Windows To Go\" (in English). Please be mindful that the (...) below\r\n  means that there is MORE DATA to this message and that you need to look at the English version in the loc file for the full text.\r\n  - *NEW*      MSG_128 \"Important notice about %s\"\r\n  - *NEW*      MSG_129 \"You have just created a media that includes the UEFI:NTFS bootloader (...)\"\r\n  The following 2 messages can be tested when creating a Windows image from the latest Windows 10 retail ISOs\r\n  - *NEW*      MSG_130 \"Windows image selection\"\r\n  - *NEW*      MSG_131 \"This ISO contains multiple Windows images.\\nPlease select the image you wish to use for this installation:\"\r\n  You should be able to see this message if you open a command prompt to the root of your flash drive and then attempt to format\r\n  it in Rufus. For instance, if your flash drive is E: just open cmd.exe and then type E: to navigate to that drive.\r\n  - *NEW*      MSG_132 \"Another program or process is accessing this drive. Do you want to format it anyway?\"\r\n  The following message will appear if you create a Windows To Go drive from a Windows 10 1809 ISO. Please be mindful that the (...)\r\n  below means that there is MORE DATA to this message and that you need to look at the English version to translate it.\r\n  - *NEW*      MSG_133 \"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO. (...)\"\r\n  The following will appear if you attempt to format a drive that is larger than 2 TB. Again, please be mindful that (...) means\r\n  that there is more data to this message and that you must look at the English version to translate it.\r\n  - *NEW*      MSG_134 \"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB (...)\"\r\n  MSG_135 to 149 appear in the \"Download ISO Image\" dialog that is proposed from the SELECT split button when clicking DOWNLOAD\r\n  - *NEW*      MSG_135 \"Version\"\r\n  - *NEW*      MSG_136 \"Release\"\r\n  - *NEW*      MSG_137 \"Edition\"\r\n  - *NEW*      MSG_138 \"Language\"\r\n  - *NEW*      MSG_139 \"Architecture\"\r\n  - *NEW*      MSG_140 \"Confirm\"\r\n  - *NEW*      MSG_141 \"Back\"\r\n  - *NEW*      MSG_142 \"Please wait...\"\r\n  - *NEW*      MSG_143 \"Download using a browser\"\r\n  - *NEW*      MSG_144 \"Temporarily banned by Microsoft for requesting too many downloads - Please try again later...\"\r\n  The following 2 messages should only appear on vanilla Windows 7 platforms when launching the 'Download ISO Image' script\r\n  - *NEW*      MSG_145 \"PowerShell 3.0 or later is required to run this script.\"\r\n  - *NEW*      MSG_146 \"Do you want to go online and download it?\"\r\n  - *NEW*      MSG_148 \"Running download script...\"\r\n  - *NEW*      MSG_149 \"Download ISO Image\"\r\n  The tooltip for the SELECT button has been updated to mention downloads\r\n  - *UPDATED*  MSG_165 \"Click to select an image...\" -> \"Click to select or download an image...\"\r\n\r\no v3.2 (2018.07.20)\r\n\tThe following appears in Advanced format options → Check device for bad blocks → dropdown menu with\r\n  %s being replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory. In other words,\r\n  this message should mean \"for a flash memory device of type %s\". *Please* try to keep the translation\r\n  as short as possible so that it won't result in an overly large dropdown...\r\n  See https://www.mydigitaldiscount.com/everything-you-need-to-know-about-slc-mlc-and-tlc-nand-flash.html\r\n  - *NEW*      MSG_087 \"for %s NAND\"\r\n  The following 4 messages can be tested using https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\r\n  - *NEW*      MSG_123 \"Persistent partition size\"\r\n  - *NEW*      MSG_124 \"No persistence\"\r\n  - *NEW*      MSG_125 \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\r\n  - *NEW*      MSG_126 \"Set the partition size units.\"\r\n  As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\r\n  public key that is embedded in the application. This message appears in an error dialog if the validation fails.\r\n  - *NEW*      MSG_172 \"Invalid download signature\"\r\n  This message was present in 3.0, but I forgot to mention it then. It has to do with the signature\r\n  validation that Rufus uses when downloading an update.\r\n  - *NEW*      MSG_240 \"The signature for the downloaded update can not be validated (...)\"\r\n  You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting Start.\r\n  It's the same as MSG_286 but with a process that *may* be faster, hence the name.\r\n  - *NEW*      MSG_306 \"Fast-zeroing drive: %0.1f%% completed\"\r\n  Note: Because this is the introduction of a new translation framework, and I am a bit short of time for that\r\n  unification of MSG_084/MSG_104/MSG_114/MSG_116 will happen in another translation round...\r\n\r\no v3.0 (2018.03.27)\r\n  - All positioning ('m', 's') has now been removed as well as some controls, for the 3.0 UI redesign\r\n  - *NEW*      IDS_DRIVE_PROPERTIES_TXT \"Drive Properties\"\r\n  - *NEW*      IDS_BOOT_SELECTION_TXT \"Boot selection\"\r\n               Note: The current translation was taken from MSG_278 when available, which was for \"Boot type\".\r\n               However, \"Boot selection\", is more appropriate, so please update if it makes sense.\r\n  - *NEW*      IDC_SELECT \"Select\"\r\n  - *NEW*      IDS_IMAGE_OPTION_TXT \"Image Option\"\r\n  - *UPDATED*  IDS_PARTITION_TYPE_TXT Partition scheme and target system type -> \"Partition scheme\"\r\n  - *NEW*      IDS_TARGET_SYSTEM_TXT \"Target system\"\r\n  - *REPLACED* IDS_LABEL_TXT \"New Volume label\" -> \"Volume label\"\r\n  - *NEW*      IDS_STATUS_TXT \"Status\"\r\n  - *REPLACED* MSG_031 -> \"BIOS (or UEFI-CSM)\"\r\n  - *REPLACED* MSG_032 -> \"UEFI (non CSM)\"\r\n  - *REPLACED* MSG_033 -> \"BIOS or UEFI\"\r\n  - *REMOVED*  MSG_087\r\n  - *RENAMED*  IDC_WINDOWS_INSTALL -> MSG_117\r\n  - *RENAMED*  IDC_WINDOWS_TO_GO -> MSG_118\r\n               Note: In most cases, you should not have to add MSG_118 as the English for \"Windows To Go\" should work for most countries.\r\n  - *NEW*      MSG_119 \"advanced drive properties\"\r\n  - *NEW*      MSG_120 \"advanced format options\"\r\n  - *NEW*      MSG_121 \"Show %s\"\r\n  - *NEW*      MSG_122 \"Hide %s\"\r\n     MSG_119/120 + MSG_121/122 are used to create the advanced options clickable toolbars\r\n  - *REPLACED* MSG_150 -> \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether \"\r\n                          \"your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\r\n  - *REPLACED* MSG_151 -> \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\r\n               Be mindful that you probably don't want to translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\r\n  - *REPLACED* MSG_152 -> \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\r\n  - *REPLACED* MSG_163 -> \"Method that will be used to create partitions\"\r\n  - *REMOVED*  MSG_172\r\n  - *REMOVED*  MSG_199\r\n  - *REMOVED*  MSG_200\r\n  - *NEW*      MSG_278 \"Checking for conflicting processes...\"\r\n  - *REPLACED* MSG_280 \"Image selection\" -> \"Disk or ISO image\"\r\n  - *REPLACED* MSG_281 \"(Please select an image)\" -> \"%s (Please select)\"\r\n     MSG_281 + MSG_280 are used to create the message that appears in the boot selection dropdown when an image has not been selected.\r\n  - *UPDATED*  MSG_298 The '#' button is now the (✓) button\r\n  - *NEW*      MSG_299 \"Timestamp validation error\"\r\n  - *NEW*      MSG_300 \"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the \"\r\n                       \"current executable.\\n\\nIn order to prevent potential attack scenarios, the update process has been aborted and \"\r\n                       \"the download will be deleted. Please check the log for more details.\"\r\n  - *NEW*      MSG_301 \"Show application settings\"\r\n  - *NEW*      MSG_302 \"Show information about this application\"\r\n  - *NEW*      MSG_303 \"Show the log\"\r\n  - *NEW*      MSG_304 \"Create a disk image of the selected device\"\r\n  - *NEW*      MSG_305 \"Use this option to indicate whether you want to use this device to install Windows on another disk, \"\r\n                        \"or if you want to run Windows directly from this drive (Windows To Go).\"\r\n  - *UPDATED*  On IDD_LOG, IDC_LOG_CLEAR, IDC_LOG_SAVE and IDCANCEL were updated to remove the redundant mention of \"Log\" in the buttons\r\n               for the languages who did that. This means that \"Save Log\", \"Clear Log\" \"Close Log\" have become \"Save\", \"Clear\", \"Close\".\r\n               *PLEASE* verify that the modification looks correct in your language.\r\n\r\no v2.16 (2017.07.17)\r\n  - *NEW* MSG_295 \"Warning: Unofficial version\"\r\n  - *NEW* MSG_296 \"This version of Rufus was NOT produced by its official developer(s).\\n\\nAre you sure you want to run it?\"\r\n  - *NEW* MSG_297 \"Truncated ISO detected\"\r\n  - *NEW* MSG_298 \"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\\nIf you obtained \"\r\n    \"this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the \"\r\n    \"official ones.\\n\\nNote that you can compute the MD5 or SHA in Rufus by clicking the '#' button.\"\r\n  Note: You can test MSG_297/MSG_298 using https://github.com/pbatard/rufus/raw/master/res/loc/test/arch_trunc.iso\r\n  A truncated version of archlinux-2017.07.01-x86_64.iso)\r\n\r\no v2.12 (2017.01.16)\r\n  - *NEW* MSG_288 \"Missing elevated privileges\"\r\n  - *NEW* MSG_289 \"This application can only run with elevated privileges\"\r\n    This message, along with the previous, is just to notify the user when they have\r\n    managed to run Rufus in non-elevated mode. This shouldn't happen in most case\r\n    so this is not something that you can easily test.\r\n  - *NEW* MSG_290 \"File Indexing\"\r\n    This is a cheat mode that can be tested with Alt-Q, that is equivalent to the\r\n    \"Allow files on this drive to have contents indexed in addition to file properties\"\r\n    (i.e. file indexing) option one can see when looking at the drive properties. See:\r\n    https://rufus.akeo.ie/pics/FileIndexing.png\r\n  - *NEW* MSG_291 \"Version selection\"\r\n  - *NEW* MSG_292 \"Please select the version of Windows you want to install:\"\r\n    These two messages are used when the user has the possibility to select between\r\n    multiple versions of Windows in Windows To Go mode. In this case, a prompt like\r\n    this will appear, using these 2 messages: https://rufus.akeo.ie/pics/Win2GoVersion.png\r\n    If you have an official Windows ISO, and the platform you run Rufus on supports\r\n    Windows To Go (Windows 8 or later *ONLY*), you should be able to test this message.\r\n  - *NEW* MSG_293 \"Unsupported Windows version\"\r\n  - *NEW* MSG_294 \"This version of Windows is no longer supported by Rufus.\"\r\n    These two messages are not used anywhere yet, but may be needed in a future prompt.\r\n\r\no v2.9 (2016.05.09)\r\n  - *NEW* MSG_286 \"Zeroing drive: %0.1f%% completed\"\r\n    Used when filling a whole drive with zero bytes, to display progress in percent (e.g. \"Zeroing drive: 12.3% completed\")\r\n    Can be tested with Alt-Z (CAUTION: THIS WILL COMPLETELY ERASE THE SELECTED DRIVE!!)\r\n  - *NEW* MSG_287 \"Detection of non-USB removable drives\"\r\n    Note, this message is followed by either \"enabled\"/\"disabled\" (see MSG_250/251) and is similar to MSG_253\r\n    The message appears on the status bar and can be tested with Ctrl-Alt-F.\r\n\r\no v2.5 (2015.10.15)\r\n    Note: The following message can be tested by pressing Alt-, (That's the 'Alt' and 'comma' keys on your keyboard)\r\n          In case the message below is not clear, you can consider that it says \"Exclusive locking of the USB drive\"\r\n  - *NEW* MSG_282 \"Exclusive USB drive locking\"\r\n    Note: The following messages will appear after a new Rufus update has been downloaded from the\r\n          Internet in case something is very wrong with its digital signature...\r\n  - *NEW* MSG_283 \"Invalid signature\"\r\n  - *NEW* MSG_284 \"The downloaded executable is missing a digital signature.\"\r\n  - *NEW* MSG_285 \"The downloaded executable is signed by '%s'.\\nThis is not a signature we recognize and could \"\r\n                  \"indicate some form of malicious activity...\\nAre you sure you want to run this file?\"\r\n\r\no v2.4 (2015.09.03)\r\n  - Changed MSG_081 \"Unsupported ISO\" -> \"Unsupported image\"\r\n  - Changed MSG_082 -> \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\r\n  - *NEW* MSG_269 \"Preserve timestamps\"\r\n    Note: You can use the Alt-T cheat mode to see this message. Also, if 'timestamp' doesn't really translate in your language,\r\n    \"file dates preservation\" is a good approximation of what this is about.\r\n  - *NEW* MSG_270 \"USB debug\"\r\n    Note: You can use the Alt-. cheat mode to see the message above\r\n  For an idea of what the 'checksums' in the 2 messages below are used for, see https://en.wikipedia.org/wiki/Md5sum:\r\n  - *NEW* MSG_271 \"Computing image checksums: %0.1f%% completed\"\r\n  - *NEW* MSG_272 \"Compute the SHA1 and MD5 checksums for the selected image\"\r\n  - *NEW* MSG_273 \"Change the application language\"\r\n    Note: You can see the message above by hovering on the language button\r\n  - *NEW* MSG_274 \"ISOHybrid image detected\"\r\n    Note: You can test this message and the one below by downloading and trying to write the latest menu_c32_test.iso (120 KB) from:\r\n    https://github.com/pbatard/rufus/raw/master/res/loc/test/menu_c32_test.iso\r\n\t- *NEW* MSG_275 \"The image you have selected is...\" [TRANSLATORS: Please refer to the English section of 'rufus.loc' for the FULL message]\r\n\t  For more info on the messages below, also see the comments in the English section of rufus.loc\r\n  - *NEW* MSG_276 \"Write in %s mode (Recommended)\"\r\n  - *NEW* MSG_277 \"Write in %s mode\"\r\n  - *NEW* MSG_278 \"Boot type\"\r\n  - *NEW* MSG_279 \"Non bootable\"\r\n  - *NEW* MSG_280 \"Image selection\"\r\n  - *NEW* MSG_281 \"(Please select an image)\"\r\n\r\no v2.0 (2015.02.04)\r\n  - *NEW CONTROL* IDC_WINDOWS_INSTALL \"Standard Windows installation\" (Main dialog)\r\n  - *NEW CONTROL* IDC_WINDOWS_TO_GO \"Windows To Go\" (Main dialog)\r\n  Note: to see the 2 controls above displayed, you will need to load the \"windows_to_go.iso\" image from\r\n  https://github.com/pbatard/rufus/raw/master/res/loc/test/windows_to_go.iso (356 KB)\r\n  Also see the comment for IDC_WINDOWS_TO_GO in the English translation.\r\n  - *NEW* MSG_096 \"The file system currently selected can not be used with this type of ISO (...)\"\r\n  - *NEW* MSG_097 \"'Windows To Go' can only be applied if the file system is NTFS.\"\r\n  - *NEW* MSG_098 \"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't (...)\"\r\n  - *NEW* MSG_116 \"This image uses Grub %s but the application only includes the installation files for (...)\"\r\n    Similar to MSG_114. Please see the comment from the English translation if you want to test this message.\r\n  - *NEW* MSG_190 \"Incompatible drive detected\"\r\n  - *NEW* MSG_191 \"Write pass\"\r\n  - *NEW* MSG_192 \"Read pass\"\r\n    See MSG_235 for where the 2 messages above are being used.\r\n  - *NEW* MSG_193 \"Downloaded %s\"\r\n  - *NEW* MSG_194 \"Could not download %s\"\r\n  - *NEW* MSG_195 \"Using embedded version of %s file(s)\"\r\n  - *NEW* MSG_196 \"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!! (...)\"\r\n  - *NEW* MSG_197 \"Nonstandard sector size detected\"\r\n  - *NEW* MSG_198 \"'Windows To Go' can only be installed on a GPT partitioned drive if it has (...)\"\r\n  - *NEW* MSG_199 \"Choose this if you plan to install Windows, to another disk, using (...)\"\r\n  - *NEW* MSG_200 \"Choose this if you want to run Windows directly from the selected device.\"\r\n  - Changed MSG_205 \"Using ISO: %s\" -> \"Using image: %s\"\r\n  - Changed MSG_210 \"DONE\" -> \"READY\".\r\n    This message appears in the new Info field that was added to Rufus 2.0 and reflects\r\n    when the application is ready to take an action from the user.\r\n  - Changed MSG_235 \"Bad Blocks: PASS %d/%d - %0.2f%% (%d/%d/%d errors)\" -> \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\r\n    Basically \"PASS\" will be replaced by \"Write pass\" or \"Read pass\" from MSG_191/192 (printed in place of the '%s')\r\n  - Changed MSG_253 \"Fixed disks detection\" -> \"Hard disk detection\"\r\n  - *NEW* MSG_264 \"Deleting directory '%s'\"\r\n  - *NEW* MSG_265 \"VMWare disk detection\"\r\n  - *NEW* MSG_266 \"Dual UEFI/BIOS mode\"\r\n  - *NEW* MSG_267 \"Applying Windows image: %0.1f%% completed\"\r\n  - *NEW* MSG_268 \"Applying Windows image...\"\r\n\r\no Version 1.0.16 (2015.02.03)\r\n  - Removed MSG_096 - MSG_098\r\n  Note: since this doesn't require translator involvement, I have applied the changes to existing translations.\r\n\r\no Version 1.0.15 (2015.01.23)\r\n  - IDD_ISO_EXTRACT dialog and associated translations have been removed\r\n  Note: since this doesn't require translator involvement, I have applied the changes to existing translations.\r\n\r\no Version 1.0.14 (2014.11.27)\r\n  - Updated translations for the new 2.0 UI font and layout.\r\n  Note: since this doesn't require translator involvement, I have applied the changes to existing translations.\r\n\r\no Version 1.0.13 (2014.11.14)\r\n  - Changed MSG_104 \"Syslinux v5.0 or later requires a '%s' file to be installed.\\n\"\r\n    \"Because this file is more than 100 KB in size, and always present on Syslinux v5+ ISO images (...)\"\r\n    -> \"%s or later requires a '%s' file to be installed.\\n\"\r\n\t  \"Because this file is more than 100 KB in size, and always present on %s ISO images (...)\"\r\n  Note: since this doesn't require translator involvement, I have applied the change to existing translations.\r\n\r\no Version 1.0.12 (2014.05.19)\r\n  - *NEW* MSG_079 \"The device is not ready.\"\r\n  - *NEW* MSG_189 \"This ISO image is not compatible with the selected filesystem\"\r\n  - *NEW* MSG_262 \"ISO Support\" (If you want to know what it's about, see comment in English translation)\r\n  - *NEW* MSG_263 \"Use PROPER size units\" (If you want to know what it's about, see comment from English translation)\r\n  - Changed MSG_165 \"Click to select an ISO...\" -> \"Click to select an image...\"\r\n\r\no Version 1.0.11 (2014.03.29)\r\n  - Changed MSG_011 \"%u bad block(s) found\" -> \"%d bad block(s) found\"\r\n  Note: since this doesn't require translator involvement, I have applied the change to existing translations.\r\n\r\no Version 1.0.10 (2014.02.09)\r\n  - *NEW* MSG_095 \"DD Image\"\r\n  - *NEW* MSG_261 \"Writing image: %0.1f%% completed\"\r\n  - *NEW* MSG_187 \"Invalid image for selected boot option\"\r\n  - *NEW* MSG_188 \"The current image doesn't match the boot option selected...\" (see rufus.loc for full text)\r\n  - Changed MSG_086 \"No ISO image selected\" -> \"No image selected\"\r\n  - Changed MSG_087 \"Please click on the disc button to select a bootable ISO...\" -> \"Please click on the disc button to select a bootable image...\" (see rufus.loc for full text)\r\n  - Changed MSG_088 \"ISO too big\" -> \"Image is too big\"\r\n  - Changed MSG_089 \"This ISO image is too big for the selected target.\" -> \"The image is too big for the selected target.\"\r\n  - Changed MSG_202 \"Scanning ISO image...\" -> \"Scanning image...\"\r\n  - Changed MSG_203 \"Failed to scan ISO image\" -> \"Failed to scan image\"\r\n\r\no Version 1.0.9 (2014.01.31)\r\n  - *NEW* MSG_260 \"NTFS compression\"\r\n    Note: Since this is a cheat-mode message, I don't specially care if it gets translated for the next version\r\n\r\no Version 1.0.8 (2014.01.21)\r\n  - Changed MSG_047 \"%s (%c:)\" -> \"Multiple Volumes\" (non-updated ones have been commented out)\r\n  - *NEW* MSG_093 \"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS OR VOLUMES!!\"\r\n  - *NEW* MSG_094 \"Multiple partitions detected\"\r\n  - *NEW* MSG_114 \"This image uses Syslinux %s but this application only includes the installation files for Syslinux %s.\"\r\n  - *NEW* MSG_115 \"Download required\"\r\n  - Changed MSG_234: 'v%d' is replaced with '%s' (change already applied to existing translations)\r\n\r\no Version 1.0.7 (2014.01.01)\r\n  - Added MSG_092 again\r\n  - Added English example for OK button in About box (IDOK)\r\n\r\no Version 1.0.6 (2013.12.17)\r\n  - Removed IDD_MESSAGES (and the need for 'g IDD_MESSAGES')\r\n\r\no Version 1.0.5 (2013.12.11)\r\n  - Removed MSG_092 to MSG_094\r\n\r\no Version 1.0.4 (2013.12.02)\r\n  - MSG_033 -> MSG_031\r\n  - MSG_031 -> MSG_032\r\n  - MSG_032 -> MSG_033\r\n\r\no Version 1.0.3 (2013.11.15)\r\n  - IDC_ENABLE_FIXED_DISKS \"List non removable or unpartitioned USB disks\" -> \"List USB Hard Drives\"\r\n  - MSG_170 \"Enable detection for disks not normally detected by Rufus\" -> \"Enable the listing of USB Hard Drive enclosures\"\r\n\r\no Version 1.0.2 (2013.10.30)\r\n  - *NEW* MSG_110 \"MS-DOS cannot boot from a drive using a 64 kilobyte Cluster size...\"\r\n  - *NEW* MSG_111 \"Incompatible Cluster size\"\r\n  - *NEW* MSG_112 \"Formatting a large UDF volumes can take a lot of time...\"\r\n  - *NEW* MSG_113 \"Large UDF volume\"\r\n  - *NEW* MSG_220 \"Formatting (%s) - estimated duration %d:%02d...\"\r\n  - *NEW* MSG_207 \"New Volume\"\r\n\r\no Version 1.0.1 (2013.10.28)\r\n  - MSG_061 \"Please insert a media in drive.\" -> \"Please insert a removable media in drive.\"\r\n  - MSG_071 \"Unable to create formatting thread.\" -> \"Unable to start thread.\"\r\n\r\no Version 1.0.0 (2013.10.20)\r\n  - Initial version\r\n"
  },
  {
    "path": "res/loc/Makefile.am",
    "content": "all-local: embedded.loc\n\nBUILT_SOURCES = embedded.loc\nnoinst_PROGRAMS =\nnoinst_EXES =\n\nAM_V_SED_0 = @echo \"  SED    $<\";$(SED)\nAM_V_SED_1 = $(SED)\nAM_V_SED_  = $(AM_V_SED_$(AM_DEFAULT_VERBOSITY))\nAM_V_SED   = $(AM_V_SED_$(V))\n\nembedded.loc: rufus.loc\n\t$(AM_V_SED) -f $(srcdir)/embedded.sed $< > $@\n\nclean-local:\n\t-rm -rf embedded.loc\n"
  },
  {
    "path": "res/loc/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nnoinst_PROGRAMS =\nsubdir = res/loc\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nPROGRAMS = $(noinst_PROGRAMS)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \ndepcomp =\nam__depfiles_maybe =\nSOURCES =\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nBUILT_SOURCES = embedded.loc\nnoinst_EXES = \nAM_V_SED_0 = @echo \"  SED    $<\";$(SED)\nAM_V_SED_1 = $(SED)\nAM_V_SED_ = $(AM_V_SED_$(AM_DEFAULT_VERBOSITY))\nAM_V_SED = $(AM_V_SED_$(V))\nall: $(BUILT_SOURCES)\n\t$(MAKE) $(AM_MAKEFLAGS) all-am\n\n.SUFFIXES:\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps res/loc/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps res/loc/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstPROGRAMS:\n\t-test -z \"$(noinst_PROGRAMS)\" || rm -f $(noinst_PROGRAMS)\ntags TAGS:\n\nctags CTAGS:\n\ncscope cscopelist:\n\ncheck-am: all-am\ncheck: $(BUILT_SOURCES)\n\t$(MAKE) $(AM_MAKEFLAGS) check-am\nall-am: Makefile $(PROGRAMS) all-local\ninstalldirs:\ninstall: $(BUILT_SOURCES)\n\t$(MAKE) $(AM_MAKEFLAGS) install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\n\t-test -z \"$(BUILT_SOURCES)\" || rm -f $(BUILT_SOURCES)\nclean: clean-am\n\nclean-am: clean-generic clean-local clean-noinstPROGRAMS \\\n\tmostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-generic\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: all check install install-am install-strip\n\n.PHONY: all all-am all-local check check-am clean clean-generic \\\n\tclean-local clean-noinstPROGRAMS cscopelist-am ctags-am \\\n\tdistclean distclean-generic dvi dvi-am html html-am info \\\n\tinfo-am install install-am install-data install-data-am \\\n\tinstall-dvi install-dvi-am install-exec install-exec-am \\\n\tinstall-html install-html-am install-info install-info-am \\\n\tinstall-man install-pdf install-pdf-am install-ps \\\n\tinstall-ps-am install-strip installcheck installcheck-am \\\n\tinstalldirs maintainer-clean maintainer-clean-generic \\\n\tmostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags-am \\\n\tuninstall uninstall-am\n\nall-local: embedded.loc\n\nembedded.loc: rufus.loc\n\t$(AM_V_SED) -f $(srcdir)/embedded.sed $< > $@\n\nclean-local:\n\t-rm -rf embedded.loc\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "res/loc/embedded.sed",
    "content": "# This sed script removes everything we don't need from rufus.loc, for embedding.\n\n# remove comments (but not so aggressively as to drop the end of MSG_298!)\ns/^#.*$//\ns/[ \\t]#.*$//\n\n# remove empty lines\n/^$/d\n\n# remove trailing whitespaces\ns/[ \\t]*$//\n\n# remove the UI controls for \"en-US\" as they are just here for translators\n# 1,300 means we only do this for the the first 300 lines\n1,300 {/^g IDD_DIALOG/,/^t MSG_001/{/^t MSG_001/!d}}\n\n# remove the Windows AppStore specific messages\n/MSG_9/d\n\n# output file *MUST* be CR/LF\ns/$/\\r/"
  },
  {
    "path": "res/loc/po/!update.cmd",
    "content": "@echo off\r\nif not exist pollock.exe curl https://files.akeo.ie/pollock/pollock-1.6.exe --output pollock.exe\r\ncls\r\n:menu\r\necho 1 - Import .po into .loc\r\necho 2 - Create .po from .loc\r\necho 3 - Exit\r\nchoice /N /C:123%1\r\nif ERRORLEVEL==3 goto exit\r\nif ERRORLEVEL==2 (\r\n  pollock.exe -l\r\n  goto menu\r\n)\r\nif ERRORLEVEL==1 (\r\n  pollock.exe -i\r\n  goto menu\r\n)\r\n:exit\r\ndel *.pot 2>NUL:\r\ndel *.mo 2>NUL:"
  },
  {
    "path": "res/loc/po/ar-SA.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-04-26 10:29+0100\\n\"\n\"PO-Revision-Date: 2024-04-29 10:22+0100\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: ar_SA\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Arabic (العربية)\\n\"\n\"X-Rufus-LCID: 0x0401, 0x0801, 0x0c01, 0x1001, 0x1401, 0x1801, 0x1c01, 0x2001, 0x2401, 0x2801, 0x2c01, 0x3001, 0x3401, 0x3801, 0x3c01, 0x4001\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"خصائص محرك الأقراص\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"الجهاز\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"اختيار نوع الإقلاع\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"اختيار\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"خيارات صورة القرص\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"مخطط التقسيم\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"النظام الهدف\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"قائمة محركات الأقراص الثابتة USB\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"إضافة إصلاحات لنظام الإدخال والإخراج الأساسي (BIOS) القديم\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"تمكين التحقق من صحة وسائط UEFI في وقت التشغيل\"\n\n# fixed translation since فورمات is the pronounce of format in arabic, correct translation is تهّيئة\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"خيارات التهيئة\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"نظام الملفات\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"حجم المجموعة\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"تسمية وحدة التخزين\"\n\n# fixed translation since فورمات is the pronounce of format in arabic, correct translation is تهّيئة\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"التهيئة السريعة\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"فحص الجهاز من الأجزاء التالفة\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"إنشاء تسمية موسّعة وأيقونة ملفات\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"الحالة\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"إغلاق\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"بدء\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"حول Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"الترخيص\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"موافق\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"ترخيص Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"مزيد من المعلومات\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"نعم\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"لا\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"السجل\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"مسح الكل\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"حفظ\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"تحديث السياسة والإعدادات\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"الإعدادات\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"التحقق من وجود تحديثات\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"تضمين الإصدارات التجريبية\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"تحقق الآن\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"التحقق من وجود تحديثات - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"يوجد إصدار أحدث متوفر. يرجى تنزيل أحدث إصدار!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"إضغط هنا للذهاب إلى الموقع\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"ملاحظات الإصدار\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"تنزيل\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"تم الكشف عن نسخة أخرى\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"هناك تطبيق Rufus آخر قيد التشغيل.\\n\"\n\"الرجاء إغلاق التطبيق الأول قبل تشغيل تطبيق آخر.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"تحذير: كل البيانات على الجهاز '%s' سيتم حذفها.\\n\"\n\"لمتابعة هذه العملية، انقر فوق \\\"موافق\\\". للإنهاء، انقر فوق \\\"إلغاء\\\".\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"تحديث سياسة Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"هل تريد السماح لـ Rufus بالتحقق من وجود تحديثات التطبيق عبر الإنترنت؟\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"إلغاء\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"تم العثور على أجزاء تالفة\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"اكتمال التحقق: %d جزء تالف(s) تم الكشف\\n\"\n\"  %d خطأ قراءة(s)\\n\"\n\"  %d خطأ كتابة(s)\\n\"\n\"  %d خطأ التلف(s)\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"يمكن الإطلاع على تقرير مفصّل من خلال:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"تم التعطيل\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"يومياً\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"أسبوعيًا\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"شهرياً\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"مخصص\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"نسختك: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"آخر نسخة: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"بايت\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"ك.ب\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"م.ب\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"غ.ب\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"ت.ب\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"ب.ب\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"كيلو بايت\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"ميغا بايت\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"الإفتراضي\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (الإفتراضي)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (أو UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (بدون CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS أو UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d تجاوز\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d تجاوزات %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"صورة قرص ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"التطبيق\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"إيقاف\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"بدأ\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"تم إلغاء العملية من قبل المستخدم\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"خطأ\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"خطأ: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"تنزيل الملف\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"جهاز تخزين USB (عام)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (قرص %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"أقسام متعددة\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - تفريغ الذاكرة\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - إلغاء\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"نجاح.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"خطأ غير محدد أثناء التهيئة.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"لا يمكن استخدام نظام الملفات المحدد لهذه الوسائط.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"تم رفض الوصول إلى الجهاز.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"الوسائط محمية ضد الكتابة.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"الجهاز قيد الاستخدام بواسطة عملية أخرى. الرجاء إغلاق أي عملية أخرى قد تقوم بالوصول إلى الجهاز.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"التهّيئة السريعة غير متاحة لهذا الجهاز.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"تسمية وحدة التخزين غير صالحة.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"معالج الجهاز غير صالح.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"حجم المجموعة المحدد غير صالح لهذا الجهاز.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"حجم وحدة التخزين غير صالح.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"الرجاء ادراج وسائط قابلة للإزالة في محرك الأقراص.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"تم استلام أمر غير مدعوم.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"خطأ في تخصيص الذاكرة.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"خطأ في القراءة.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"خطأ في الكتابة.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"فشل التثبيت\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"تعذر فتح الوسائط. قد يكون قيد الاستخدام من قبل عملية أخرى. الرجاء إعادة توصيل الوسائط وحاول مرة أخرى.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"تعذر تقسيم محرك الأقراص.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"تعذر نسخ الملفات إلى محرك الأقراص المستهدف.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"تم الإلغاء من قبل المستخدم.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"غير قادر على بدء الـ thread.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"لم يكتمل فحص الأجزاء السيئة.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"فشل فحص صورة قرص ISO.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"فشل استخراج صورة قرص ISO.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"إعادة تركيب وحدة التخزين غير ممكنة.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"تعذر تصحيح/إعداد ملفات الاقلاع.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"تعذر تعيين حرف لمحرك أقراص.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"لا يمكن تحميل وحدة تخزين GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"الجهاز غير جاهز.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"اكتشف Rufus أن Windows لا يزال يقوم بمسح المخازن المؤقتة للذاكرة الداخلية الخاصة به على جهاز USB.\\n\"\n\"\\n\"\n\"اعتمادًا على سرعة جهاز USB الخاص بك، قد تستغرق هذه العملية وقتًا طويلاً حتى تكتمل، خاصة للملفات الكبيرة.\\n\"\n\"\\n\"\n\"نوصي بترك Windows ينتهي لتجنب التلف. ولكن إذا مللت من الانتظار، يمكنك فقط فصل الجهاز ...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"صورة قرص غير مدعومة\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"صورة القرص هذه إما غير قابلة للاقلاع، أو تستخدم طريقة اقلاع أو ضغط لا يدعمها Rufus ...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"إستبدال %s؟\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"صورة الـISO يبدو استخدامها لإصدار قديم من '%s'. \\n\"\n\"قوائم الإقلاع قد لا يتم عرضها بشكل صحيح بهذا السبب.\\n\"\n\"\\n\"\n\"لإصلاح الخلل يمكنك تحميل إصدار جديد من قبل Rufus:\\n\"\n\"- إختر ‘نعم’ للإتصال بالإنترنت وتحميل الملف\\n\"\n\"- إختر ‘لا’ لترك ملف الISO دون تعديل\\n\"\n\"إذا كنت لا تعرف ما عليك فعله, عليك اختيار ‘نعم’.\\n\"\n\"\\n\"\n\"ملاحظة: سيتم تحميل ملف جديد في المجلد الحالي للتطبيق وبعد العثور على ‘%s’ هناك, سوف يتم إعادة إستخدامه تلقائياً.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"جاري تنزيل %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"لم يتم اختيار أي صورة قرص\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"ل %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"صورة القرص كبيرة جدًا\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"صورة القرص كبيرة جدًا بالنسبة للهدف المحدد.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"ISO غير مدعوم\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"عند استخدام نوع هدف UEFI، يتم دعم صور أقراص ISO القابلة للاقلاع من EFI فقط. الرجاء تحديد ملف ISO قابل للاقلاع من EFI أو تعيين نوع الهدف على BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"نظام ملفات غير مدعوم\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"هام: هذا المحرك يحتوي على أجزاء متعددة !!\\n\"\n\"\\n\"\n\"قد يشمل ذلك أقسامًا أو وحدات تخزين غير مدرجة أو حتى مرئية من Windows. إذا كنت ترغب في المتابعة، فأنت مسؤول عن أي فقدان للبيانات في هذه الأقسام.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"تم الكشف عن أقسام متعددة\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"صورة قرص DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"لا يمكن استخدام نظام الملفات المحدد حاليًا مع هذا النوع من ISO. الرجاء تحديد نظام ملفات مختلف أو استخدام ملف ISO مختلف.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' يمكن فقط تطبيقه إذا كان نظام الملفات NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"هام: أنت تحاول تثبيت 'Windows To Go'، لكن القرص المستهدف ليس لديه السمة 'FIXED'. على الأرجح سيتسبب هذا في تجمد ويندوز أثناء الإقلاع، لأن ميكروسوفت لم تصممه ليعمل مع الأقراص ذات السمة 'REMOVABLE'.\\n\"\n\"\\n\"\n\"هل لا زلت تريد الإستمرار؟\\n\"\n\"\\n\"\n\"ملاحظة: السمات 'FIXED/REMOVABLE' هي خصائص للعتاد يمكن تغييرها فقط باستعمال أدوات خاصة من مُصنع الأقراص. لكن هذه الأدوات لا تُّوفر للعامة غالبا...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"قيود نظام الملفات\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"تحتوي صورة قرص ISO هذه على ملف أكبر من 4 جيجابايت، وهو أكثر من الحجم الأقصى المسموح به لنظام الملفات FAT أو FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"دعم WIM مفقود\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"لا يمكن لنظامك الأساسي استخراج الملفات من أرشيفات WIM. يلزم استخراج WIM لإنشاء محركات أقراص USB قابلة للإقلاع من EFI لنظامي التشغيل Windows 7 و Windows Vista. يمكنك إصلاح ذلك عن طريق تثبيت إصدار حديث من 7-Zip.\\n\"\n\"هل تريد زيارة صفحة التنزيل 7-zip؟\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"تنزيل %s؟\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s أو أحدث تتطلّب ملف '%s' ليتم التثبيت.\\n\"\n\"لأن هذا الملف هو أكثر من 100KB في الحجم، ومتوفّر دائماً في ملفات ISO %s, ليس متوفّرا في Rufus. \\n\"\n\"\\n\"\n\"Rufus يمكنه تحميل الملف المفقود لك: \\n\"\n\"- إختر ‘نعم’ للإتصال بالإنترنت وتحميل الملف\\n\"\n\"- إختر ‘لا’ إذا كنت تريد نسخ هذا الملف على محرك الأقراص يدوياً في وقت لاحق\\n\"\n\"\\n\"\n\"ملاحظة: سيتم تحميل ملف جديد في المجلد الحالي للتطبيق وبعد العثور على ‘%s’ هناك, سوف يتم إعادة إستخدامه تلقائياً.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"الإلغاء قد يترك الجهاز في حالة غير صالحة للاستعمال.\\n\"\n\"إذا كنت متأكداً من أنك تريد الإلغاء، إضغط \\\"نعم\\\"، وإلا، إضغط \\\"لا\\\".\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"الرجاء إختيار مجلد\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"جميع الملفات\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"سجلّ Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (قرص %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"لا يمكن لـ MS-DOS الإقلاع من محرك أقراص يستخدم حجم الكتلة 64 كيلو بايت.\\n\"\n\"الرجاء تغيير حجم الكتلة أو استخدام FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"حجم الكتلة غير متوافق\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"يمكن أن تستغرق تهيئة وحدات التخزين UDF الكبيرة الكثير من الوقت. عند سرعات USB 2.0، تكون مدة التهيئة المقدرة بـ %d:%02d, حيث سيظهر شريط التقدم مجمداً. يرجى التحلي بالصبر!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"وحدة تخزين UDF كبيرة\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"تستخدم هذه الصورة Syslinux %s%s لكن هذا التطبيق يتضمن فقط ملفات التثبيت لـ Syslinux %s%s.\\n\"\n\"\\n\"\n\"نظرًا لأن الإصدارات الجديدة من Syslinux غير متوافقة مع بعضها البعض، ولن يكون من الممكن لـ Rufus تضمينها جميعًا، يجب تنزيل ملفين إضافيين من الإنترنت ('ldlinux.sys' و 'ldlinux.bss'):\\n\"\n\"- قم بتحديد 'نعم' للاتصال بالإنترنت وتنزيل هذه الملفات\\n\"\n\"- قم بتحديد 'لا' لإلغاء العملية\\n\"\n\"\\n\"\n\"ملاحظة: سيتم تنزيل الملفات في مجلد التطبيق الحالي وستتم إعادة استخدامها تلقائيًا إذا كانت موجودة.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"التنزيل من الانترنت مطلوب\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"هذه الصورة (image) تستعمل Grub %s لكن التطبيق يحتوي فقط على ملفات تثبيت Grub %s.\\n\"\n\"\\n\"\n\"بما أن إصدارات Grub المختلفة قد لا تتوافق مع بعضهاالبعض، وبما أنه لا يمكن ضمها كلها، فسيحاول Rufus تحديد مكان إصدار من ملف تثبيت Grub ('core.img') يتوافق مع الموجود في صورتك:\\n\"\n\"- إختر 'نعم' للاتصال بلالأنترنت ومحاولة تنزيله\\n\"\n\"- إختر 'لا' لاستعمال الإصدار الافتراضي من Rufus\\n\"\n\"- إختر 'إلغاء' لوقف العملية\\n\"\n\"\\n\"\n\"ملاحظة: سيتم تنزيل الملف في المجلد الحالي للتطبيق و سيستعمل تلقائيا إذا كان موجداً. إذا لم يتم العثور على إصدار موافق، فسيُستعمل الإصدار الافتراضي كبديل.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"التثبيت القياسي لنظام التشغيل Windows\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"Windows To Go\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"خصائص محرك الأقراص المتقدّمة\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"خيارات التهّيئة المتقدّمة\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"أظهار %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"أخفاء %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"حجم التقسيم المستمر\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"لا استمرارية\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"حدد حجم التقسيم المستمر لجهاز ال USB الحي, تحديد الحجم بقيمة 0 سيعطل التقسيم المستمر.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"حدد حجم  وحدات التقسيم.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"لا تظهر هذه الرسالة مرة آخرى\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"تنويه مهم عن %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"لقد قمت لتوك بإنشاء وسائط تستخدم محمل الإقلاع UEFI:NTFS. يرجى التذكر أنه يجب تعطيل Secure Boot للتمكن من إقلاع الوسائط.\\n\"\n\"للمزيد من التفاصيل عن ضرورة الإجراء المذكور, إضغط على زر 'مزيد من المعلومات' أدناه.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"اختيار صورة Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"يحتوي ملف ISO هذا على العديد من صور Windows.\\n\"\n\"الرجاء تحديد الصورة التي ترغب في استخدامها لهذا التثبيت:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"هذا القرص يستخدم من قبل برنامج آخر. هل تود التهيئة على أية حال ؟\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"لقد قام Rufus بإكتشاف أنك تحاول إنشاء وسائط Windows To Go بناءً على ISO 1809\\n\"\n\"\\n\"\n\"بسبب عيب في Microsoft, سوف تتوقف الوسائط خلال إقلاع Windows (شاشة الموت الزرقاء) ما لم تقم يدوياً بإستبدال ملف 'WppRecorder.sys' بإصدار 1803.\\n\"\n\"\\n\"\n\"يرجى العلم أن سبب عدم إمكانية Rufus من إصلاح المشكلة تلقائيا هو أن ملف 'WppRecorder.sys' محفوظ الحقوق ل Microsoft, لذلك لا يمكننا تضمين نسخة من الملف في التطبيق...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"بسبب إختيار نظام التجزئة MBR, Rufus(Rufus) قادر فقط على إنشاء تجزئة لغاية 2 TB على هذه الوسائط, الذي سوف يؤدي إلى عدم توفر %s من مساحة القرص.\\n\"\n\"\\n\"\n\"هل تريد المتابعة ؟\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"الإصدار\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"الإطلاق\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"النسخة\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"اللغة\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"البنية\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"متابعة\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"رجوع\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"يرجى الانتظار ...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"التنزيل باستخدام المتصفح\"\n\n# mentioned the minimum 12 hours wait.\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"لا يتوفر تنزيل Windows ISOs نظرًا لأن شركة Microsoft قد غيرت موقعها على الويب لمنع ذلك.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"مطلوب PowerShell 3.0 أو أحدث لتشغيل هذا البرنامج النصي.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"هل ترغب بالتحميل عن طريق الإنترنت ؟\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"جارٍ تشغيل برنامج التنزيل ...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"تحميل صورة ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"نوع الكمبيوتر الذي تخطط لاستخدام محرك الأقراص القابل للاقلاع معه. تقع على عاتقك مسؤولية تحديد ما إذا كان هدفك من نوع BIOS أو UEFI قبل البدء في إنشاء محرك الأقراص، حيث قد يفشل في الاقلاع بطريقة أخرى.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' تعني أن الجهاز سوف يقلع فقط في وضع محاكات BIOS (يعرف أيضا ب 'Legacy Mode') في وضع UEFI, وليس في وضع UEFI الأساسي.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'بدون CSM' تعني أن الجهاز سوف يقلع فثط في وضع UEFI الأساسي, وليس وضع محاكات BIOS (تعرف أيضا ب 'Legacy Mode')\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"إختبار نمط: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"إختبار نمط: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"إختبار نمط: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"إختبار نمط: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"يحدد نظام الملفات المستهدف\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"الحد الأدنى لحجم كتلة البيانات التي ستشغله في نظام الملفات\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"استخدام هذا الحقل لتعيين تسمية محرك الأقراص \\n\"\n\"الرموز الدولية مقبولة.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"إدراج الخيارات المتقدّمة\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"فحص الجهاز من الأجزاء التالفة باستخدام نمط اختبار\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"قم بإلغاء الإختيار لهذا المربّع لاستخدام طريقة فرمتة \\\"بطيئة \\\"\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"الطريقة اللتي سيتم إستخدامها لإنشاء الاتجزئات\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"الطريقة التي سيتّم إستخدامها لخلق محرك أقراص إقلاعي\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"إضغط لإختيار أو تحميل صورة ...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"حدّد هذا المربّع للسماح بعرض التسميات الدولية وتعيين أيقونة الجهاز (إنشاء autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"قم بتثبيت أداة تحميل تشغيل UEFI، و التي ستقوم بالتحقق من صحة الملف بإستخدام MD5\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"إنشاء قسم إضافي خفي ومحاذاة حدود الأقسام.\\n\"\n\"هذا يمكنه تحسين إكتشاف الإقلاع لـ BIOSes قديمة.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"تمكين إدراج مرفقات القرص الصلب USB. إستخدمه على مسؤوليتك الخاصة!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"بدء عملية الفرمتة. \\n\"\n\"ستم تدمير أية بيانات على الهدف!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"التوقيع الرقمي للتحميل غير صالح\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"إضغط لاختيار...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - أداة فرمتة الـ USB جديرة بالثقة\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"إصدار %d.%d (بناء %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"الترجمة إلى العربية:\\\\line• أ. راس النعامة \\\\line• عمر الصمد \\\\line• فراس السيخ \\\\line• عبدالمجيد\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"الإبلاغ عن الأخطاء أو طلب التحسينات على:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"حقوق النشر الإضافية:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"سياسة التحديث:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"إذا اخترت السماح لهذا البرنامج بالتحقق من تحديثات التطبيق، فأنت توافق على أنه يمكن جمع المعلومات التالية على الخادم (الخوادم) الخاصة بنا:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"بنية نظام التشغيل الخاص بك وإصداره\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"إصدار التطبيق الذي تستخدمه\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"عنوان IP الخاص بك\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"لغرض إنشاء إحصاءات الاستخدام الخاصة، قد نحتفظ بالمعلومات التي تم جمعها, \\\\b لمدة عام على الأكثر\\\\b0 . ومع ذلك،، فإننا لن نكشف عن أي من هذه البيانات الفردية طوعًا لأطراف ثالثة.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"عملية التحديث:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus لا يقوم بتثبيت أو تشغيل خدمات خلفية, وبالتالي يتم التحقّق من تحديثات فقط عند تشغيل التطبيق الرئيسي. \\\\line\\n\"\n\"الإتصال بالإنترنت بالطبع مطلوب عند التحقّق من وجود تحديثات.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"صورة (image) غير صالحة للخيار الإقلاعي المحدّد\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"الصورة (image) الحالية لا تتطابق مع الخيار الإقلاعي المحدّد. يُرجى إستخدام صورة مختلفة أو تحديد خيار إقلاعي آخر.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"صورة  ISO هذه غير متوافقة مع نظام الملفات المحدّد\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"إكتشاف قرص غير متوافق\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"تجاوز الكتابة\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"تجاوز القراءة\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"تم تنزيل %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"تعذر تنزيل %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"استعمال الإصدار المُضمّن من ملف(ات) %s\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"هام: هذا القرص يستخدم حجم قطاع غير قياسي!\\n\"\n\"\\n\"\n\"الأقراص التقليدية تستعمل 512-بايت كحجن قطاع لكن هذا القراص يستعمل %d-بايت. في العديد من الحالات، هذا يعني أنك لن تستطيع الإقلاع من هذا القرص.\\n\"\n\"يستطيع Rufus محاولة إنشاء قرص إقلاع، لكن من دون ضمان أنه سيعمل.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"إكتشاف حجم قطاع غير قياسي\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"يمكن تثبيت 'Windows To Go' فقط على قرص بتقسيمات GPT إذا كان عنده السمة FIXED مُحددة. لم يتم إكتشاف FIXED في القرص الحالي.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"هذه الميزة غير متوفرة في هذه المنصة.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"جاري الإلغاء – الرجاء الإنتظار...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"فحص الصورة (image)...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"فشل فحص الصورة\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"إكتشاف %s قديمة\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"إستخدام صورة: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"ملف %s مفقود\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"وحدة جديدة\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"إكتشاف جهاز %d\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"إكتشاف أجهزة %d\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"جاهز\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"تم الإلغاء\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"فشلت\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"إطلاق تطبيق جديد...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"فشل إطلاق تطبيق جديد\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"تم فتح ‪%s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"تم حفظ ‪%s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"التهيئة: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"إنشاء نظام الملفات: عملية %d/%d تمت\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"إصلاح NTFS: تم إصلاح %d%%\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"فرمتة (%s) – المدة التقديرية %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"جاري تسمية (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"فرمتة (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"إصلاح NTFS (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"مسح بنية MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"طلب الوصول إلى القرص...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"تحليل سجلّات الإقلاع الموجودة...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"غلق وحدة التخزين الموجودة...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"كتابة سجلّ الإقلاع الرئيسي (MBR) ...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"كتابة سجل إقلاع القسم ...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"نسخ ملفات الـDOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"نسخ ملفات الـISO: ‏%s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"إعداد إقلاع EFI ل ويندوز7 (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"وضع اللمسات الأخيرة، يرجى الانتظار...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"تثبيت Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"الأجزاء التالفة: تجاوز %d/%d - %0.2f%% (%d/%d/%d أخطاء)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"الأجزاء التالفة: إختبار بواسطة نمط عشوائي\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"الأجزاء التالفة: إختبار بواسطة نمط 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"تقسيم (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"حذف الأقسام (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"لا يمكن التحقق من صحة التوقيع الرقمي للتحديث المحمل, قد يعني ذلك ان نظامك مضبوط بشكل غير صحيح للتعامل مع التحقق من التوقيع الرقمي أو قد يدل على تحميل خبيث.\\n\"\n\"\\n\"\n\"سيتم حذف التحميل, راجع السجل للاطلاع على المزيد من التفاصيل.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"التحميل: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"فشل في تحميل الملف.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"التحقّق من تحديثات Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"التحديثات: عدم القدرة على الإتصال بالإنترنت\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"التحديثات: عدم القدرة على الوصول إلى بيانات الإصدار\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"إصدار جديد متاح من Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"لم يتم العثور على إصدار جديد من Rufus\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"تم حذف مفاتيح التسجيل للتطبيق بنجاح\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"فشل في حذف مفاتيح التسجيل للتطبيق\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"تفعيل %s\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"تعطيل %s\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"التحقّق من الحجم\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"الكشف عن الأقراص الثابتة\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"فرض فرمتة FAT32 كبيرة\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"سيتمّ حذف NoDriveTypeAutorun عند الخروج\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"الكشف عن محرّك وهمي\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"دعم Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"دعم Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"فرض التحديث\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"ضغط NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"كتابة الصورة: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"دعم ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"استعمل وحدات حجم مناسبة (PROPER)\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"حذف المجلد '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"الكشف عن قرص VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"نمط UEFI/BIOS ثنائي\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"تطبيق صورة (نسخة) ويندوز: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"تطبيق صورة (نسخة) ويندوز...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"الحفاظ على الطوابع الزمنية\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"تنقيح الأخطاء عن طريق USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"حساب مجاميع الإختبار (Checksums) للصورة (Image): %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"حساب مجاميع اختبار (checksums) SHA256 و SHA1 و MD5 للصورة المختارة\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"تغيير لغة التطبيق\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"تم إكتشاف صورة ٪ s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"الصورة التي اخترتها هي صورة 'ISOHybrid'. هذا يعني أنه يمكن كتابتها إما في نمط نسخة ملف %s وإما في نمط نسخة قرص %s.\\n\"\n\" Rufus يوصي باستعمال نمط %s، كي تتمكن دوما من الوصول الكامل إلى القرص بعد كتابته.\\n\"\n\"لكن، إذا واجهت مشاكلا خلال الإقلاع يمكنك محاولة كتابة هاته الصورة مرة أخرى في نمط %s.\\n\"\n\"\\n\"\n\"فضلا اختر النمط الذي تريده لكتابة هاته الصورة:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"كتابة في نمط %s (موصى به)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"كتابة في نمط %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"التحقق من العمليات المتعارضة...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"لا يمكن الإقلاع منه\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"قرص أو صورة ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"(الرجاء الأختيار) %s\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"القفل الحصري للUSB\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"التوفيع الرقمي غير صالح\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"الملف التنفيذي المحمل ينقصه توقيع رقمي.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"الملف التنفيذي المحمل موقع من قبل '%s'.\\n\"\n\"هذا ليس بتوقيع رقمي موثوق من قبلنا وقد يسبب نشاطات تخريبية...\\n\"\n\"هل أنت متأكد من الأستمرار؟\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"تصفير القرص: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"الكشف عن الأقراص غير USB القابلة للإزالة\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"عدم التوفر على صلاحيات رفيعة\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"هذا التطبيق يمكنه العمل فقط عند وجود صلاحيات رفيعة\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"فهرسة الملفات\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"إختيار الإصدار\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"الرجاء إختيار إصدار الويندوز المراد تنصيبه:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"إصدار ويندوز غير مدعوم\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"هذا الإصدار من الويندوز لم يعد مدعوماً من قبل Rufusـ\\n\"\n\"الإصدار الأخير من Rufus المتوافق مع هذه المنصة هو v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"تحذير: إصدار غير رسمي\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"هذا الإصدار من Rufus لم يتم إنتاجه من قبل المطورين الرسميين.\\n\"\n\"\\n\"\n\"؟هل أنت متأكد من الأستمرار?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"إكتشاف ISO مقطوعة\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"ملف الISO المحدد لا يطابق حجمه المعلن من قبله: %s من البيانات مفقود!\\n\"\n\"\\n\"\n\"إذا قمت بالحصول على هذا الملف من الإنترنت, يجب عليك تحميل نسخة جديدة و التحقق من أن المجموع الإختباري لMD5 و SHA مطابق للنسخ(ة) الأصلية.\\n\"\n\"\\n\"\n\"علماُ بانه يمكنك مقارنة الMD5 و SHA في Rufus عن طريق الضغط على زر (✓)\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"خطأ في التحقق من الطابع الزمني\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus لم يتمكن من التحقق أن الطابع الزمني للتحديث الذي تم تنزيله أحدث من ذلك الذي في البرنامج التنفيذي الحالي. \\n\"\n\"\\n\"\n\" من أجل منع سيناريوهات الهجوم المحتملة, تم إحباط عملية التحديث و سيتم حذف التحديث, الرجاء التحقق من السجل لمزيد من التفاصيل.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"عرض إعدادات التطبيق\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"عرض معلومات حول هذا التطبيق\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"إظهار السجل\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"قم بإنشاء صورة قرص للجهاز المحدد\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"استخدم هذا الخيار للإشارة إلى ما إذا كنت تخطط لتثبيت Windows على قرص مختلف ، أو إذا كنت تريد إقلاع Windows بشكل مباشر من محرك الأقراص هذا (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"التصفير السريع لمحرك الأقراص: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"هذا قد يستغرق بعض الوقت\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"إكتشاف VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"أرشيف مضغوط\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"يستخدم ISO الذي حددته UEFI وهو صغير بما يكفي ليتم كتابته كقسم نظام EFI (ESP). يمكن أن تكون الكتابة إلى ESP ، بدلاً من الكتابة إلى قسم بيانات عام تشغل القرص بأكمله ، هي الأفضل لبعض أنواع التثبيتات.\\n\"\n\"\\n\"\n\"الرجاء تحديد الوضع الذي تريد استخدامه لكتابة هذه الصورة(Image):\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"استخدم %s (في نافذة التطبيق الرئيسية) للتمكين.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"علامات التجزئة الإضافية (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"حفظ إلى VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"حساب المجاميع الاختبارية للصور\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"أزرار متعددة\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"عدد مرات المرور\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"رقم تعريف القرص\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"الأفضلية الافتراضية لـ thread : %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"تجاهل علامة الإقلاع\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"جاري تحديث تخطيط القسم (%s) ...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"الصورة التي حددتها هي  ISO-Hybrid (هجينة) ، لكن منشئوها لم يجعلوها متوافقة مع وضع نسخ ملف  ISO. \\n\"\n\"نتيجة لذلك ، سيتم فرض وضع DD لكتابة الصورة.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"غير قادر على فتح أو قراءة '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"جاري تطبيق تخصيصات ويندوز: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"جاري تطبيق خيارات المستخدم ...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"تجربة مستخدم ويندوز\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"هل تريد تخصيص تثبيت ويندوز؟\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"قم بإزالة متطلبات 4GB + RAM ، Secure Boot و TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"قم بإزالة متطلبات حساب مايكروسوفت عبر الإنترنت\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"تعطيل جمع البيانات (تخطي أسئلة الخصوصية)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"منع Windows To Go من الوصول إلى الأقراص الداخلية\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"قم بإنشاء حساب محلي باسم المستخدم:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"قم بتعيين الخيارات الإقليمية لتطابق خيارات المستخدم الحالي\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"تعطيل التشفير التلقائي BitLocker للجهاز\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"سجل متواصل\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"يجب تنزيل ملف إضافي ('diskcopy.dll') من Microsoft لتثبيت MS-DOS:\\n\"\n\"- حدد \\\"نعم\\\" للاتصال بالإنترنت وتنزيله\\n\"\n\"- اختر \\\"لا\\\" لإلغاء العملية\\n\"\n\"\\n\"\n\"ملاحظة: سيتم تنزيل الملف في مجلد التطبيق وسيتم إعادة استخدامه تلقائيًا إذا كان موجودًا.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"تم اكتشاف أداة تحميل التشغيل UEFI التي تم إبطالها سابقا\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"اكتشف Rufus أن ملف ISO الذي حددته يحتوي على أداة تحميل التشغيل UEFI التي تم إبطالها سابقا والتي ستنتج %s، عند تمكين Secure Boot محدث بالكامل على نظام UEFI .\\n\"\n\"\\n\"\n\"- إذا حصلت على صورة ISO هذه من مصدر غير حسن السمعة، فيجب أن تفكر في احتمالية احتوائها على برامج UEFI ضارة وتجنب التشغيل منها.\\n\"\n\"- إذا حصلت على صورة ISO هذه من مصدر موثوق به، فعليك محاولة العثور على إصدار أكثر حداثة، والذي لن ينتج عنه هذا التحذير.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"شاشة \\\"الانتهاكات الأمنية\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"شاشة استرداد ويندوز (BSOD) مع '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"صورة VHDX مضغوطة\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"صورة VHD غير مضغوطة\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"صورة (image) لتحديث فلاشة كاملة (FFU)\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"يجب تنزيل بعض البيانات الإضافية من Microsoft لاستخدام هذه الوظيفة:\\n\"\n\"- اختر \\\"نعم\\\" للاتصال بالإنترنت وتنزيلها\\n\"\n\"- اختر \\\"لا\\\" لإلغاء العملية\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"تقييد Windows على الوضع \\\"S\\\" (S-Mode، غير متوافق مع تجاوز الحساب عبر الإنترنت)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"وضع الخبير\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"استخراج ملفات الأرشيف: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"استخدم Refus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"برنامج Rufus هو أداة تساعد في تنسيق وإنشاء أقراص الإقلاع USB، مثل مفاتيح USB، بطاقات الذاكرة، وغيرها.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"الموقع الرسمي: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"كود المصدر: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"سجل التغييرات: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"هذا التطبيق مُرخص بموجب شروط رخصة جنو (GNU) العمومية (GPL) الإصدار 3.\\n\"\n\"راجع https://www.gnu.org/licenses/gpl-3.0.ar.html لمزيد من التفاصيل.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"الإقلاع (Boot)\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"تهيئة USB وبطاقة الفلاش ومحركات الأقراص الافتراضية إلى FAT / FAT32 / NTFS / UDF / exFAT / ReFS / ext2 / ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"إنشاء محركات أقراص USB قابلة للإقلاع من FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"إنشاء محركات أقراص قابلة للإقلاع من ملفات ISO القابلة للإقلاع (Windows و Linux وما إلى ذلك)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"إنشاء محركات أقراص قابلة للإقلاع من صور الأقراص القابلة للإقلاع ، بما في ذلك الأقراص المضغوطة\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"إنشاء BIOS أو محركات أقراص UEFI قابلة للإقلاع ، بما في ذلك UEFI NTFS القابل للتشغيل\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"إنشاء محركات أقراص \\\"Windows To Go\\\"\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"قم بإنشاء محركات تثبيت ويندوز 11 لأجهزة الكمبيوتر التي لا تحتوي على TPM أو الإقلاع الآمن (Secure Boot)\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"إنشاء Persistent Linux partitions\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"إنشاء صور VHD / DD لمحرك الأقراص المحدد\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"حساب المجاميع الإختبارية MD5 و SHA-1 و SHA-256 و SHA-512 للصورة المحددة\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"إجراء فحوصات كتل تالفة ، بما في ذلك الكشف عن محركات أقراص فلاش \\\"زائفة\\\"\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"قم بتنزيل ملفات ISO الرسمية الخاصة بـ Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"قم بتنزيل UEFI Shell ISOs\"\n"
  },
  {
    "path": "res/loc/po/bg-BG.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 3.22\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2023-03-23 15:50+0000\\n\"\n\"PO-Revision-Date: 2023-03-23 15:53+0000\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: bg_BG\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Bulgarian (Български)\\n\"\n\"X-Rufus-LCID: 0x0402\\n\"\n\"X-Generator: Poedit 3.2.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Свойства на устройството\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Устройство\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Тип на стартирането\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Избери\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Опция за образ\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Дялова схема\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Целева система\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Изброяване на USB дискове\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Добави поправки за стари BIOS-и\"\n\n#. • IDD_DIALOG → IDC_RUFUS_MBR\n#.\n#. 'MBR': See http://en.wikipedia.org/wiki/Master_boot_record\n#. Rufus can install it's own custom MBR (the Rufus MBR), which also allows users to\n#. specify a custom disk ID for the BIOS. The tooltip for this control is MSG_167.\nmsgid \"Use Rufus MBR with BIOS ID\"\nmsgstr \"Използвай Rufus MBR с BIOS ID\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Опции за форматиране\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Файлова система\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Размер на клъстера\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Нов етикет на тома\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Бързо форматиране\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Провери устройството за лоши сектори\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Създай разширен етикет и икони\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Статус\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Затвори\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Старт\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Относно Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Лиценз\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"ОК\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus лиценз\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Повече информация\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Да\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Не\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Регистър\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Изчисти\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Запази\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Политика за актуализации и настройки\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Настройки\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Провери за актуализации\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Включи и бета версиите\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Провери сега\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Провери за актуализации - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Налична е по-нова версия. Моля, изтеглете последната версия!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Щракнете тук, за да отидете на сайта\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Бележки по дистрибуцията\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Изтегли\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Засечена е друга инстанция\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Засечено е друго работещо Rufus приложение.\\n\"\n\"Моля, затворете първото приложение преди да стартирате ново.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"ВНИМАНИЕ: ВСИЧКАТА ИНФОРМАЦИЯ НА УСТРОЙСТВО '%s' ЩЕ БЪДЕ УНИЩОЖЕНА.\\n\"\n\"За да продължите с тази операция, натиснете OK. За да я прекратите, натиснете CANCEL.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus политика за актуализации\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Желаете ли да разрешите на Rufus да проверява за актуализации в интернет?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Откажи\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Намерени са лоши блокове\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Проверката завършена: намерени са %d лоши блокове\\n\"\n\"  %d грешки при четене\\n\"\n\"  %d грешки при записване\\n\"\n\"  %d грешки с увреждания\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"По-подробен доклад може да намерите в:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Забранено\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Ежедневно\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Ежеседмично\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Ежемесечно\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Персонално\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Вашата версия е: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Последната версия е: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"байта\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"КБ\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"МБ\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"ГБ\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"ТБ\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"ПБ\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"килобайта\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"мегабайта\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"По подразбиране\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (По подразбиране)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (или UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (без CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS или UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d пробег\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d пробега %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO образ\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Приложение\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Прекрати\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Стартирай\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Операцията прекратена от потребителя\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Грешка\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Грешка: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Изтегляне на файл\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB съхраняващо устройство (Generic)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Диск %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Множество дялове\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Прочистване на буферите\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Прекратяване\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Завършено успешно.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Неопределена грешка при форматирането.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Не може да използвате избраната файлова система за този вид устройство.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Достъпът до устройството е забранен.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Устройството е защитено срещу записване.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Това устройство се използва от друг процес. Моля, спрете всички процеси, които използват това устройство.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Бързото форматиране не е налично за това устройство.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Етикетът на тома е невалиден.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Устройственият манипулатор е невалиден.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Избраният размер на клъстера е невалиден за това устройство.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Размерът на този том е невалиден.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Моля, поставете сменяем носител в устройството.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Получена е неподдържана команда.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Грешка при разпределяне на паметта.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Грешка при четене.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Грешка при записване.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Неуспешна инсталация\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Устройството не можа да бъде отворено. Възможно е да се използва от друг процес. Моля, изкарайте и вкарайте повторно устройството и опитайте отново.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Грешка при създаването на дялове.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Файловете не можаха да бъдат копирани на целевото устройство.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Прекратено от потребител.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Неуспешно стартиране на нишка.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Проверката за лоши блокове не беше завършена.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Сканирането за ISO изображения се провали.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Извличането на ISO образа се провали.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Неуспешно монтиране на дяла.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Файловете за стартиране на операционната система не могат да бъдат актуализирани.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Не можа да се зададе буква към устройството.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"GUID томът не може да бъде монтиран.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Устройството не е готово.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus засече, че Windows все още прочиства вътрешните буфери на USB устройството.\\n\"\n\"\\n\"\n\"В зависимост от скоростта на вашето USB устройство, тази операция може да отнеме дълго време за завършване, особено за по-големи файлове.\\n\"\n\"\\n\"\n\"Препоръчваме ви да оставите Windows да приключи, за да избегнете увреждания. Но, ако ви омръзне да чакате, можете просто да извадите устройството...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Неподдържан образ\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Този образ не е зареждащ или използва зареждащ или компресиращ метод който не се поддържа от  Rufus..\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Заместване на %s ?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Изглежда, че този ISO образ използва стара версия на '%s'.\\n\"\n\"Поради тази причина стартиращите менюта може да не бъдат изобразени правилно.\\n\"\n\"\\n\"\n\"По-нова версия може да бъде изтеглена от Rufus, за да отстрани този проблем:\\n\"\n\"- Изберете 'Yes', за да се свържете с интернет и да изтеглите необходимият файл\\n\"\n\"- Изберете 'No', за да продължите с настоящият ISO файл\\n\"\n\"Ако не знаете какво да правите, е препоръчително да изберете 'Yes'.\\n\"\n\"\\n\"\n\"Бележка: Този файл ще бъде изтеглен в настоящата директория и щом '%s' е наличен, процесът ще продължи автоматично.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Изтегляне %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Не е избран образ\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"за %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Образът е твърде голям\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Образът е твърде голям за избраната цел.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Неподдържано ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Когато се използва UEFI тип на целта, само EFI стартиращи ISO образи са поддържани. Моля изберете EFI стартиращо ISO или задайте целевия тип на BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Неподдържана файлова система\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"ВАЖНО: ТОВА УСТРОЙСТВО СЪДЪРЖА МНОЖЕСТВО ДЯЛОВЕ!!\\n\"\n\"\\n\"\n\"Това може да включва дялове/томове, които не са показани в Windows. Ако желаете да продължите, вие носите отговорност за загубата на информация на тези дялове.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Засечени са множество дялове\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD Образ\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Избраната файлова система не може да бъде използвана за този тип ISO. Моля, изберете друга файлова система или друг ISO образ.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' може да се приложи само ако файловата ситема е NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"ВАЖНО: Опитвате се да инсталирате 'Windows To Go', но вашето целево устройство не притежава атрибутът 'FIXED'. Поради това е много вероятно Winodows да замръзне по време на стартиране, тъй като Microsoft не са предвиждали продуктът им да се използва на устройства с атрибут 'REMOVABLE'. \\n\"\n\"\\n\"\n\"Желаете ли да продължите?\\n\"\n\"\\n\"\n\"Бележка: Атрибутите FIXED/REMOVABLE са хардуерни свойства който могат да бъдат променени само от специализиран софтуер на производителя. Само че този софтуер ПОЧТИ НИКОГА не е достъпен за потребителите...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Ограничение на файловата система\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Този ISO образ съдържа файл по голям от 4 GB, което е повече от допустимият размер за FAT или FAT32 файлова система.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Липсваща WIM подръжка\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Вашата платформа не може да извлече файлове от WIM архивите. WIM извличането е необходимо за създаване на EFI стартиращи Windows 7 и Windows Vista USB устройства. Може да поправите това като инсталирате последната версия на 7-Zip.\\n\"\n\"Искате ли да посетите страницата за изтегляне на 7-zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Изтегляне на %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s или по-нов изисква '%s' файл да бъде инсталиран.\\n\"\n\"Тъй като този файл е повече от 100 KB в размер и винаги присъства на %s ISO образи, той не е включен в Rufus.\\n\"\n\"\\n\"\n\"Rufus може да изтегли липсващият файл за вас:\\n\"\n\"- Изберете 'Yes', за да се свържете с интернет и да изтеглите файла\\n\"\n\"- Изберете 'No', ако искате ръчно да копирате този файл\\n\"\n\"\\n\"\n\"Бележка: Този файл ще бъде изтеглен в настоящата директория и щом '%s' е наличен, процесът ще продължи автоматично.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Прекратяването може да остави устройството в НЕИЗПОЛЗВАЕМО състояние.\\n\"\n\"Ако сте сигурни, че искате да прекратите, натиснете YES. В противен случай, натиснете NO.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Моля изберете папка\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Всички файлове\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus регистър\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Диск %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS не може да стартира от устройство с 64 килобайтов размер на клъстера.\\n\"\n\"Моля, използвайте друг размер на клъстера или използвайте FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Несъвместим размер на клъстера\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Форматирането на големи UDF томове може да отнеме много време. При USB 2.0 скорости, изчисленото време за форматиране е %d:%02d, при което процесната лента ще изглежда като замръзнала. Моля, бъдете търпеливи!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Голям UDF дял\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Този образ използва Syslinux %s%s, но тази програма включва само инсталационни файлове за Syslinux %s%s.\\n\"\n\"\\n\"\n\"Тъй като новите версии на Syslinux не са съвместими една с друга и няма да е възможно Rufus да ги включи всичките, два допълнителни файла трябва да бъдат изтеглени от Интернет ('ldlinux.sys' и 'ldlinux.bss'):\\n\"\n\"- Изберете 'Yes', за да се свържете с интернет и да изтеглите тези файлове\\n\"\n\"- Изберете 'No', за да прекратите тази операция\\n\"\n\"\\n\"\n\"Бележка: Тези файлове ще бъдат изтеглени в настоящата директория на програмата и ще бъдат използвани автоматично щом са налични.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Необходимо е изтегляне\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Този образ използва GRUB %s Но приложението съдържа само инсталацйонните файлове за GRUB %s.\\n\"\n\"\\n\"\n\" Тъй като различните версии на GRUB може да не са съвместими една с друга и не е възможно да се включат всички, Rufus ще опита да намери версия на GRUB инсталационният файл ('core.img'), който съвпада с този от вашият образ: \\n\"\n\"- Изберете 'Yes', за да се свържете с интернет и да я изтеглите\\n\"\n\"- Изберете 'No', за да използвате версията по подразбиране на Rufus\\n\"\n\"- Изберете 'Cancel', за да прекратите операцията\\n\"\n\"\\n\"\n\"Забележка: Файлът ще бъде изтеглен в настоящата директория и ще бъде използван автоматично, щом е наличен. Ако не е намерено съвпадение, ще бъде използвана версията по подразбиране.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Стандартна Windows инсталация\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"Windows To Go (Windows за USB Flash устройство)\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"разширени свойства на устройството\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"разширени опции за форматиране\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Покажи %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Скрий %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Размер на устойчив дял\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Без устойчивост\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Задайте размера на устойчивия дял за \\\"живото\\\" USB устройство. Ако го зададете на 0, устойчивия дял ще бъде изключен.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Задайте размера на единиците на дяла.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Не показвай това съобщение отново\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Важно известие относно %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Създадохте носител, който използва UEFI: NTFS bootloader. Моля, не забравяйте, че за да заредите този носител, ТРЯБВА ДА ЗАБРАНИТЕ ЗАЩИТЕНОТО ЗАРЕЖДАНЕ.\\n\"\n\"За подробности относно защо това е необходимо, вижте бутона \\\"Повече информация\\\" по-долу.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Избор на образ на Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Този ISO съдържа няколко образа на Windows.\\n\"\n\"Моля, изберете образа, който искате да използвате за тази инсталация:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Друга програма или процес използва това устройство. Наистина ли искате да го форматирате?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus забеляза, че се опитвате да създадете носител с \\\"Windows To Go\\\", базиран на 1809 ISO.\\n\"\n\"\\n\"\n\"Поради *MICROSOFT BUG*, този носител ще крашне при зареждане на Windows (Син екран на смъртта), ако не замените ръчно файла 'WppRecorder.sys' със същия от версия 1803.\\n\"\n\"\\n\"\n\"Забележка: Rufus не може автоматично да поправи това, защото файлът 'WppRecorder.sys' е запазен с авторско право от Microsoft, поради което не можем да съхраняваме легално копие на този файл в програмата...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Тъй като за схемата за дял е избрано MBR, Rufus може да създаде дял до максимум 2 ТБ на този носител, което ще остави %s дисково пространство неизползвано.\\n\"\n\"\\n\"\n\"Наистина ли искате да продължите?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Версия\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Издание\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Издание\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Език\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Архитектура\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Продължи\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Назад\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Моля, изчакайте...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Изтегляне чрез браузър\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Изтеглянето на Windows ISO образи е недостъпно, тъй като Microsoft измени сайта си, за да го предотврати.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 или по нова версия е нужна, за да се изпълни този скрипт.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Искате ли да се свържете с интернет и да започне изтегляне?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Изпълнява се скрипт за изтегляне...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Изтегляне на ISO образ\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Типът компютър, с който планирате да използвате това стартиращо устройство. Ваша отговорност е да определите дали целевата ви система е от BIOS или UEFI тип преди да започнете създаването на устройството, тъй като в противен случай може да изникне грешка при стартиране.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' означава, че това устройство ще се стартира само в BIOS-симулиращ режим (познат също и като 'Legacy Mode') под UEFI, и не в стандартен UEFI режим.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'без CSM' означава, че устройството ще се стартира само в стандартен UEFI режим, а не в BIOS режим (познат също и като 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Тестов модел: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Тестов модел: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Тестов модел: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Тестов модел: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Задава целевата файлова система\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Минималният размер, който един блок информация ще заема във файловата система\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Използвайте това поле, за да зададете етикет на устройството.\\n\"\n\"Интернационални символи са позволени.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Покажи/Скрий разширените настройки\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Провери устройството за лоши блокове, използвайки тестов модел\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Махнете тази отметка, ако искате да използвате \\\"бавен\\\" метод на форматиране\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Метод по който ще бъдат създадени дяловете\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Метод, който ще бъде използван, за да се направи устройството стартиращо\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Натиснете, за да изберете или изтеглите образ...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Сложете тази отметка за да разрешите показването на интернационални етикети и да зададете икона на устройството (създава autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install an MBR that allows boot selection and can masquerade the BIOS USB drive ID\"\nmsgstr \"Инсталира MBR, който позволява избор на операционна система и може да маскира BIOS USB устройствения ИД\"\n\n#. • MSG_168\nmsgid \"\"\n\"Try to masquerade first bootable USB drive (usually 0x80) as a different disk.\\n\"\n\"This should only be necessary if you install Windows XP and have more than one disk.\"\nmsgstr \"\"\n\"Опитва да маскираш първото USB устройство(обикновено 0x80) като различен диск.\\n\"\n\"Това би трябвало да е необходимо само ако инсталирате Windows XP и имате повече от един диск.\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Създай допълнителен скрит дял и опитай да подредиш границите на дяловете.\\n\"\n\"Това може да подобри засичането на стартиращи системи при по-стари версии на BIOS.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Разреши изброяването на USB хард дискови заграждения. ИЗПОЛЗВАЙТЕ НА СВОЙ РИСК!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Стартиране на форматиращата операция.\\n\"\n\"Това ще УНИЩОЖИ всякаква информация на целта!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Невалиден подпис на изтеглянето\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Натиснете тук за да изберете...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Надеждната USB форматираща програма\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Версия %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Български превод:\\\\line• Krasimir Nevenov <mailto:berzabel@yahoo.com>\\\\line• Kaloyan Nikolov <mailto:kotipuka01@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Докладвайте за проблем или поискайте подобрения на:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Допълнителни авторски права:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Политика за актуализации:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Ако изберете да позволите на програмата да проверява за актуализации, вие се съгласявате че следната информация може да бъде събирана на нашият сървър:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Архитектура и версия на вашата операционна система\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Версия на настоящата програма която използвате\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Вашият IP адрес\"\n\n# \"най-много за година\" is a bit hard to read in Bold. Perhaps try underlining it?\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"С цел създаването на частна статистика на потреблението е възможно да запазим тази информация, \\\\b най-много за година\\\\b0 . Въпреки това, ние няма да предоставяме тази информация на трети лица или организации.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Процес на актуализиране:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus не инсталира и не използва скрити услуги и процеси, затова актуализиции са възможни само когато е активна програмата.\\\\line\\n\"\n\"Естествено, достъп до интернет е необходим, за да може да се направи проверка за актуализиции.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Невалиден образ за избраната стартираща опция\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Настоящият образ не съвпада с избраната стартиращата опция. Моля използвайте друг образ или различна стартираща опция.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Този ISO образ не е съвместим с избраната файлова система\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Засечено е не съвместимо устройство\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Пробег Записване\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Пробег Четене\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Изтеглено %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Не можа да се изтегли %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Използване на вградената версия на %s файл(ове)\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"ВАЖНО: ТОВА УСТРОЙСТВО ИЗПОЛЗВА НЕСТАНДАРТЕН РАЗМЕР НА СЕКТОРА!! \\n\"\n\"\\n\"\n\"Стандартните устройства използват 512-байтов размер на сектора но това устройство е %d-байтово. В много случаи , това означава че НЯМА да можете да заредите операционната система от това устройство.\\n\"\n\"Rufus може да се опита да поправи това, но НЕ МОЖЕ ДА ГАРАНТИРА че ще проработи.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Засечен е нестандартен размер на сектора\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' може да се инсталира само на устройство с GPT дялове и с атрибут FIXED. Настоящият дял не притежава атрибутът FIXED.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Тази функция не е налична на тази платформа.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Прекратяване - Моля изчакайте...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Сканиране на образ...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Неуспешно сканиране на образ\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Засечен е остарял %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Използва се образ: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Липсващ %s файл\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Нов дял\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"Намерено е %d устройство\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"Намерени са %d устройства\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"ГОТОВО\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Прекратено\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"НЕУСПЕШНО\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Стартиране на ново приложение...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Неуспешно стартиране на новото приложение\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Отворен %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Запазен %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Форматиране: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Създаване на файлова система: Задача %d/%d завършена\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS поправка: %d%% завършена\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Форматиране (%s) - Приблизително времетраене %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Задаване на етикет (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Форматиране (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS поправка (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Създаване на MBR/PBR/GPT структури...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Поискване на дисков достъп...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Анализиране на съществуващите стартиращи записи...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Затваряне на съществуващия том...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Създаване на MBR...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Създаване на стартиращ запис на дяла...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Копиране на DOS файловете...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Копиране на ISO файловете: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI стартиращ план (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Финализиране, моля изчакайте...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Инсталиране на Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Лоши блокове: %s %d/%d - %0.2f%% (%d/%d/%d грешки)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Лоши блокове: Тестване с произволен модел\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Лоши блокове: Тестване с модел 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Създаване на дял(ове) (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Изтриване на дялове (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Подписът на изтеглената актуализация не може да бъде удостоверен. Това може да означава, че системата ви е неправилно конфигурирана за удостоверяване на подписи или че изтеглянето е зловредно.\\n\"\n\"\\n\"\n\"Изтеглянето ще бъде изтрито. Проверете регистъра за повече детайли.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Изтегляне: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Неуспешно изтегляне на файл.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Проверка за Rufus актуализации...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Актуализиране: Неуспешно свързване с интернет\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Актуализиране: Няма достъп до информация за версията\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Налична е нова версия на Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Не е открита нова версия на Rufus\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Регистрационните ключове на приложението са изтрити успешно\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Неуспешно изтриване на регистрационните ключове на приложението\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s разрешено\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s забранено\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Проверка на размера\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Засичане на външен хард диск\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Принудително голямо FAT32 форматиране\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun ще бъде изтрит на излизане\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Засичане на фалшиви устройства\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet подръжка\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge подръжка\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Принудително актуализиране\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS компресиране\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Записване на образ: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO поддръжка\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Използване на ПРАВИЛЕН размер единици (1КБ = 1024 байта)\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Изтриване на директория '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Засичане на VMWare диск\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Двоен UEFI/BIOS режим\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Прилагане на Windows образ: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Прилагане на Windows образ...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Запазване на времеви маркери\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Отстраняване на USB грешки\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Изчисляване на чексуми на образа: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Изчисли MD5, SHA1, SHA256 чексуми на избраният образ\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Смени езикът на приложението\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Засечен е %s образ\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Образът, който сте избрали е тип 'ISOHybrid'. Това означава, че може да бъде записан като режим %s (копиране на файлове) или режим %s (дисков образ).\\n\"\n\"Rufus препоръчва режим %s, така че да разполагате с пълен достъп до устройството след записа.\\n\"\n\"Въпреки това, ако възникнат проблеми при зареждането, може да опитате и с режим %s.\\n\"\n\"\\n\"\n\"Моля, изберете режимът с който желаете да запишете този образ:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Запиши в режим %s (Препоръчителен)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Запиши в режим %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Проверява се за конфликтуващи процеси...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Не стартиращ\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Диск или ISO образ\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Моля, изберете)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Нестандартно заключване на USB устройство\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Невалиден подпис\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Изтегленото приложение е без дигитален подпис.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Изтегленото приложение е с подпис от '%s'.\\n\"\n\"Това е непознат дигитален подпис и може да е признак на злонамерена дейност...\\n\"\n\"Сигурни ли сте че искате да стартирате тази програма?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Нулиране на устройството: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Засичане на преносими устройства неизползващи USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Липсват повишени правомощия\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Приложението може да работи само с повишени правомощия\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Индексиране на файлове\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Избор на версия\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Моля, изберете версията на Windows, която желаете да инсталирате:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Неподдържана версия на Windows\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Тази версия на Windows вече не се поддържа от Rufus.\\n\"\n\"Последната версия на Rufus, съвместима с тази платформа е v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Внимание: Неофициална версия\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Тази версия на Rufus не е създадена от официалния разработчик.\\n\"\n\"\\n\"\n\"Сигурни ли сте, че желаете да я използвате?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Засечено е съкратено ISO\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"ISO файлът който сте избрали не съвпада с обявения си размер: %s от информацията липсва.\\n\"\n\"\\n\"\n\"Ако сте се сдобили с този файл от интернет, опитайте се да изтеглите ново копие и се уверете, че чексумите на MD5 или SHA съвпадат с официалните.\\n\"\n\"\\n\"\n\"Забележете, че можете да изчислите MD5 или SHA, използвайки Rufus като натиснете бутона (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Грешка при удостоверяването на времевият маркер\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus не можа да удостовери, че времевият маркер на изтеглената актуализация е по-скорошен от този на сегашното приложение.\\n\"\n\"\\n\"\n\"За да се предотвратят потенциални възможности за атака, процесът на актуализиране беше прекратен и изтеглянето ще бъде изтрито. Моля, проверете регистъра за повече детайли.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Покажи настройките на приложението\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Покажи информация за това приложение\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Покажи регистъра\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Създай дисков образ на избраното устройство\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Използвайте тази опция, за да изберете дали искате да използвате това устройство, за да инсталирате Windows на друг диск, или за да създадете преносима инсталация на Windows на това устройство (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Бързо нулиране на устройството: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"Това може да отнеме време\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Засичане на VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Компресиран архив\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"ISO-то, което сте избрали, използва UEFI и е достатъчно малко да бъде записано като EFI System Partition (ESP). Записването в ESP, вместо в обикновен дял, може да е по-подходящо за някои типове инсталации.\\n\"\n\"\\n\"\n\"Моля, изберете режимът, който искате да използвате, за да запишете този образ:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Използвайте %s (в основният прозорец на програмата), за да го включите.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Допълнителни хешове (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Запазване като VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Изчисляване на чексуми на образа\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Множество бутони\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Брой пробези\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID на диск\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Приоритет на нишката по подразбиране: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Игнорирай Boot маркер\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Обновяване на дяловете (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Образът, който сте избрали, е ISOHybrid, но създателите му не са го направили съвместим с ISO/File режим на копиране.\\n\"\n\"Затова ще бъде използван DD метод на записване на образа.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Неуспешно отваряне или прочитане на '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Прилагане на персонализации на Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Прилагане на настройки на потребителя...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Персонализиране на инсталацията на Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Премахване на изискването за 4GB+ RAM, Secure Boot и TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Премахване на изискването за онлайн Microsoft акаунт\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Изключване на събирането на данни (пропускане на въпросите за поверителност)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Предотврати достъпа на Windows To Go до вътрешни дискове\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Създаване на локален акаунт с потребителско име:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Задаване на регионални настройки със същите стойности, като на този потребител\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Изключване на автоматичното криптиране на устройството с BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Устойчив лог\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus е програма, с която можете лесно да форматирате и създавате стартиращи USB устройства, карти с памет и др.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Официален сайт: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Изходен код: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Лог на промените: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Тази програма е лицензирана според условията на GNU Public License (GPL) версия 3.\\n\"\n\"Вижте https://www.gnu.org/licenses/gpl-3.0.html за подробности.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Форматиране на USB, карти памет и виртуални устройства с FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Създаване на FreeDOS стартиращ USB устройства\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Създаване на стартиращи устройства от ISO образи (Windows, Linux и др.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Създаване на стартиращи устройства от образи, включително компресирани такива\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Създаване на BIOS или UEFI стартиращи устройства, включително UEFI стартиращ NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Създаване на 'Windows To Go' устройства\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Създаване на Windows 11 инсталационно устройство за компютри, които нямат TPM или Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Създаване на устойчиви Linux дялове\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Създаване на VHD/DD образи на избраното устройство\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Изчисляване на MD5, SHA-1, SHA-256 и SHA-512 чексуми на избраният образ\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Проверяване за лоши блокове, включително засичане на \\\"фалшиви\\\" устройства\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Изтегляне на официални Microsoft Windows ISO образи\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Изтегляне на UEFI Shell образи\"\n"
  },
  {
    "path": "res/loc/po/cs-CZ.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-04-25 20:58+0200\\n\"\n\"PO-Revision-Date: 2024-04-25 21:23+0200\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: cs_CZ\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Czech (Čeština)\\n\"\n\"X-Rufus-LCID: 0x0405\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Vlastnosti disku\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Zařízení\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Výběr boot\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Vybrat\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Možnosti obrazu\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Oddíl a typ cílového systému\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Cílový systém\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Seznam USB disků\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Přidat opravu pro starší BIOSy (extra partition, align, etc.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Povolit ověřování médií UEFI za běhu\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Možnosti formátování\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Souborový systém\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Velikost clusteru\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Název svazku\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Rychlý formát\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Kontrola vadných bloků\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Vytvořit rozšířené označení a symbol souborů\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Stav\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Zavřít\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Spustit\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"O programu Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licence\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Licence programu Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Další informace\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Ano\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Ne\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Záznam činnosti programu Rufus\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Smazat\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Uložit\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Zásady aktualizací a nastavení\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Nastavení automatických aktualizací\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Kontrolovat\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Zahrnout beta verze\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Zkontrolovat\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Kontrola aktualizace - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Je dostupná novější verze. Stáhněte poslední verzi!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Kliknutím přejdete na web aplikace\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Poznámky k vydání\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Stažení\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Zjištěna běžící instance aplikace\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Program Rufus je již spuštěný.\\n\"\n\"Prosím zavřete běžící aplikaci před opětovným spuštěním.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"VAROVÁNÍ: VŠECHNA DATA NA CÍLOVÉM DISKU %s. BUDOU SMAZÁNA\\n\"\n\"Chcete-li pokračovat v této operaci, klikněte na tlačítko OK.\\n\"\n\"Pro zrušení klikněte na tlačítko ZRUŠIT.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Nastavení automatických aktualizací\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Chcete povolit online kontrolu aktualizací programu Rufus?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Zrušit\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Byly nalezeny chybné bloky\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Kontrola dokončena:\\n\"\n\"  počet chybných bloků: %d\\n\"\n\"  počet chyb čtení: %d\\n\"\n\"  počet chyb při zápisu: %d\\n\"\n\"  počet zjištěných poškození: %d\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Podrobnější zprávu najdete zde:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Zakázáno\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Denně\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Týdně\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Měsíčně\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Vlastní\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Vaše verze: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Poslední verze: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"bajtů\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobajtů\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabajtů\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Výchozí\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Výchozí)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (ne CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS nebo UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d pokus\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d pokusy %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Obraz ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Aplikace\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Přerušit\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Spustit\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operace byla přerušena uživatelem\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Chyba\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Chyba: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Stažení souboru\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Zařízení USB (Obecné)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Disk %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Více diskových oddílů\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Čištění vyrovnávací paměti\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Ukončení\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Hotovo.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Neznámá chyba během formátování.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Zvolený souborový systém nelze pro toto zařízení použít.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Přístup k zařízení byl odmítnut.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Zařízení je chráněno proti zápisu.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Zařízení je používáno jiným procesem. Ukončete prosím všechny procesy, které mohou přistupovat k zařízení.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Rychlé formátování není pro toto zařízení dostupné.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Neplatný název svazku.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Neplatný identifikátor zařízení.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Zvolená velikost alokační jednotky není platná pro toto zařízení.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Velikost svazku je neplatná.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Vložte vyměnitelné zařízení.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Obdržen nepodporovaný příkaz.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Chyba při přidělení paměti.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Chyba čtení.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Chyba zápisu.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Instalace selhala\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Není možné otevřít zařízení. Zřejmě je používáno jiným procesem. Odpojte a opět připojte zařízení a zkuste to znovu.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Disk nelze rozdělit.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Kopírování souborů na cílový disk se nezdařilo.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Zrušeno uživatelem.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Nelze spustit vlákno.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Kontrola chybných bloků nebyla dokončena.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Analýza ISO obrazu selhala.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Rozbalovaní ISO obrazu selhalo.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Není možné znovu připojit svazek.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Není možné opravit/instalovat soubory pro spouštění počítače.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Není možné přiřadit písmeno jednotky.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Není možné pripojit GUID svazek.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Zařízení není připraveno.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Program Rufus zjistil, že Windows stále čistí interní vyrovnávací paměť na USB zařízení.\\n\"\n\"\\n\"\n\"Dokončení této operace může trvat dlouho, v závislosti na rychlosti Vašeho USB zařízení, zvláště u velkých souborů.\\n\"\n\"\\n\"\n\"Doporučujeme nechat Windows dokončit akci, zabráníte tak poškození dat. Pokud už nechcete dále čekat, můžete zařízení odpojit...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Nepodporovaný obraz\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Obraz není bootovací, nebo používá metodu spuštění nebo kompresi, která není podporován Rufusem...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Nahradit %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Zdá se, že tento ISO obraz používá zastaralou verzi '%s'.\\n\"\n\"Nabídka boot systému se proto nemusí zobrazovat správně.\\n\"\n\"\\n\"\n\"Rufus může odstranit tento problém stažením nové verze:\\n\"\n\"- Zvolte 'Ano' pro připojení na Internet a stažení souboru\\n\"\n\"- Zvolte 'Ne' pro ponechání stávajícího ISO souboru beze změny\\n\"\n\"Pokud nevíte, co máte udělat, zvolte 'Ano'.\\n\"\n\"\\n\"\n\"Poznámka: Nový soubor %s bude stažen do aktuální složky pro opětovné automatické použití.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Staženo %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Nebyl zvolen žádný obraz disku\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"pro %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Obraz disku je příliš velký\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Obraz disku je příliš velký pro zvolený cíl.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Nepodporovaný ISO obraz\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Při zvolení cílového systému typu UEFI jsou podporování jen ISO obrazy spustitelné pomocí EFI. Vyberte spustitelný EFI ISO obraz nebo nastavte cílový typ systému v BIOSu.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Nepodporovaný souborový systém\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"DŮLEŽITÉ: TOTO ZAŘÍZENÍ OBSAHUJE NĚKOLIK ODDÍLŮ!!\\n\"\n\"\\n\"\n\"Zařízení může obsahovat oddíly nebo svazky, které nejsou zobrazeny, případně nejsou ani viditelné pro Windows. Pokud přesto chcete pokračovat, nesete odpovědnost za ztrátu veškerých dat na těchto oddílech.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Bylo zjištěno více oddílů\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"Obraz DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Aktuálně vybraný souborový systém nelze použít u tohoto typu ISO. Prosím, vyberte jiný souborový systém, nebo použijte jiné ISO.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' lze použít pouze v případě, že souborový systém je NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"DŮLEŽITÉ: Pokoušíte se nainstalovat 'Přenosný systém Windows', ale váš cílový disk má 'PEVNÝ' atribut. Vzhledem k tomuto systému Windows bude s největší pravděpodobností zamrzat během spouštění, Microsoft nepodporuje práce s 'VYMĚNITELNÝMI' disky, které mají tento atribut.\\n\"\n\"\\n\"\n\"přesto chcete pokračovat?\\n\"\n\"\\n\"\n\"Poznámka: 'PEVNÝ/VYMĚNITELNÝ' atribut má hardwarové vlastnosti, které lze změnit pouze pomocí vlastních nástrojů od výrobce disku. Nicméně tyto nástroje nejsou NIKDY poskytovány veřejnosti...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Omezení souborového systému\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Tento obraz ISO obsahuje soubor větší než 4 GB, což je více než maximální povolená velikost pro systém souborů FAT nebo FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Chybí podpora WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Váš systém neumí rozbalit soubory z WIM archivu. Rozbalení WIM je nutné k vytvoření USB disků Windows 7 a Windows Vista spustitelných pomocí EFI. Problém lze vyřešit nainstalováním aktuální verze programu 7-Zip.\\n\"\n\"Chcete přejít na stránku pro stažení 7-Zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Stáhnout %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s nebo vyšší vyžaduje instalaci souboru %s.\\n\"\n\"Protože tento soubor je větší než 100 KB a vždy je součástí %s ISO obrazu, není součástí programu Rufus.\\n\"\n\"\\n\"\n\"Program Rufus může chybějící soubor stáhnout za Vás:\\n\"\n\"- Zvolte 'Ano' pro připojení na internet a stažení souboru\\n\"\n\"- Zvolte 'Ne' pokud chcete tento soubor na disk později zkopírovat ručně\\n\"\n\"\\n\"\n\"Poznámka: Soubor %s bude stažen do aktuální složky pro opětovné automatické použití.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Po zrušení akce bude zařízení v NEPOUŽITELNÉM stavu.\\n\"\n\"Pokud jste si jisti, že chcete akci zrušit, klepněte na ANO. V opačném případě klepněte na NE.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Prosím vyberte složku\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Všechny soubory\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Záznam programu Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS nelze spustit z disku používajícího alokační jednotku o velikostí 64KB.\\n\"\n\"Změňte velikost alokační jednotky nebo použijte FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Nekompatibilní velikost alokační jednotky\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Formátování velkých UDF svazků může trvat delší čas. Při rychlosti USB 2.0 bude formátování trvat přibližně %d:%02d, ukazatel průběhu operace je během formátování zdánlivě nefunkční. Buďte trpělivý!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Velký UDF svazku\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Tento obraz používá Syslinux %s%s, tato aplikace však obsahuje pouze instalační soubory pro Syslinux %s%s.\\n\"\n\"\\n\"\n\"Jelikož nové verze Syslinux nejsou vzájemně kompatibilní a není možné v programu Rufus zahrnout všechny verze, je nutné z Internetu stáhnout dodatečné dva soubory (ldlinux.sys a ldlinux.bss):\\n\"\n\"- Zvolte 'Ano' pro stažení souborů z Internetu\\n\"\n\"- Zvolte 'Ne' pro zrušení operace\\n\"\n\"\\n\"\n\"Poznámka: Soubory budou staženy do aktuální složky programu pro opětovné automatické použití.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Nutné stažení souborů\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Tento obraz používá Grub %s ale aplikace obsahuje pouze instalační soubory Grub %s.\\n\"\n\"\\n\"\n\"Vzhledem k různým verzím Grub nemusí být kompatibilní mezi sebou, Není možné je mít všechny, Rufus se pokusí najít verzi Grub instalace souboru ('core.img') který odpovídá vaší image:\\n\"\n\"- Vybrat 'Ano' připojit k internetu a pokusit se stáhnout\\n\"\n\"- Vybrat 'Ne' použít výchozí verzi z Rufus\\n\"\n\"- Vybrat 'Zrušit' pro zrušení operace\\n\"\n\"\\n\"\n\"Poznámka: Soubor se stáhne do aktuální složky aplikace a bude použit automaticky, pokud je přítomen. Není-li shoda k dispozici online, pak bude použita standardní verze.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Standardní instalace systému Windows\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"pokročilé vlastnosti disku\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"pokročilé možnosti formátování\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Zobrazit %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Skrýt %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Velikost trvalého oddílu\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Ne trvalý\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Nastavte velikost trvalého oddílu pro živá média USB. Nastavení velikosti 0 zakáže trvalý oddíl.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Nastavení velikosti jednotky.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Příště zprávu nezobrazovat\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Důležité upozornění o %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Vytvořili jste médium, které používá zavaděč UEFI: NTFS. Pamatujte, že pro zavedení tohoto média MUSÍTE VYPNOUT SECURE BOOT.\\n\"\n\"Podrobnosti o tom, proč je to nutné, naleznete níže v části „Další informace“.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Vybrat obrazu systému Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"ISO obsahuje více obrazů Windows..\\n\"\n\"Vyberte prosím obraz, který chcete použít pro tuto instalaci:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"K tomuto disku přistupuje jiný program nebo proces. Chcete ho přesto formátovat?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus zjistil, že se pokoušíte vytvořit Windows To Go médií založené na 1809 ISO.\\n\"\n\"\\n\"\n\"Vzhledem k tomu, že *MICROSOFT BUG*, toto médium se při spouštění systému Windows zhroutí (Blue Screen), pokud soubor „WppRecorder.sys“ ručně nenahradíte verzí 1803.\\n\"\n\"\\n\"\n\"Důvodem proč Rufus nemůže automaticky opravit, je, že soubor „WppRecorder.sys“ je souborem chráněným autorskými právy společnosti Microsoft, takže nemůžeme legálně vložit kopii souboru do aplikace...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Pro schéma oddílu byla vybráno MBR, Rufus na tomto médiu vytvořit pouze oddíl o velikosti až 2 TB, což ponechá místo na disku %s nedostupné.\\n\"\n\"\\n\"\n\"Jste si jistý, že chcete pokračovat?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Verze\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Vydání\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Edice\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Jazyk\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Architektura\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Pokračovat\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Zpět\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Počkejte prosím...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Stáhnout pomocí prohlížeče\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Stahování ISO systému Windows je nedostupné, protože společnost Microsoft změnila své webové stránky, aby tomu zabránila.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Pro spuštění skriptu je nutná verze PowerShell 3.0 nebo novější.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Chcete přejít do režimu online a stáhnout ji?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Spuštění skriptu pro stahování ...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Stáhnout obraz ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Typ počítače, ve kterém chcete tuto zaváděcí jednotku používat. Je nutné zjistit zda cílové zařízení má klasický BIOS nebo UEFI, zadejte při vytváření media jinak nepůjde správně zavést.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' znamená, že zařízení bude spouštěno pouze v režimu emulace systému BIOS (také známý jako 'Legacy Mode') pod UEFI, a ne v nativním UEFI modu.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'non CSM' znamená to, že zařízení bude startovat pouze v nativním UEFI modu, ne v BIOS emulaci režimu (také známý jako 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Zkušební vzorek: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Zkušební vzorek: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Zkušební vzorek: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Zkušební vzorek: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Nastaví cílový souborový systém\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Minimální velikost, kterou zabere blok dat v souborovém systému\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Pokud chcete nastavit jmenovku svazku, vyplňte pole.\\n\"\n\"Jsou podporované i mezinárodní znaky.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Přepnout pokročilá nastavení\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"\"\n\"Zkontrolovat zařízení na přítomnost chybných\\n\"\n\"bloků použitím zkušebního vzorku\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Odškrtnutím použijete pomalou metodu formátování\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metoda, která bude použita k vytváření oddílů\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Vyberte metodu, která bude použitá k vytvoření boot zařízení\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Kliknutím vyberte nebo stáhněte obraz...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Povolíte v názvu disku zobrazení mezinárodních znaků a vytvoření ikony zařízení (vytvořením souboru autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Nainstalujte zavaděč UEFI, který provede ověření souboru MD5Sum na médiu\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Vytvořit další skryté oddíly a pokusí se o zarovnání oddílů.\\n\"\n\"Toto nastavení může zlepšit detekci spustitelného zařízení pro starší BIOS.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Zobrazí pevné disky a USB. !!!POUŽITÍ NA VLASTNÍ RIZIKO!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Klepnutím spustíte formátování.\\n\"\n\"FORMÁTOVANÍM SE ODSTRANÍ VEŠKERÁ DATA NA CÍLOVÉM ZAŘÍZENÍ!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Neplatný podpis stažení\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Kliknutím zvolit...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Spolehlivý program pro formátování USB\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Verze %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Čeština: Richard Kahl <mailto:richard.kahl@seznam.cz>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Nahlášení chyb nebo námětů pro zlepšení programu:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Další licenční informace:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Zásady aktualizace:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Pokud povolíte tomuto programu kontrolu aktualizací, souhlasíte s tím, že naše servery mohou shromažďovat následující údaje:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Architektura vašeho operačního systému a jeho verzi\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Použitá verze aplikace Rufus\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Vaši IP adresa\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Pro účely vytváření neveřejných statistik používání programu můžeme uchovávat tyto shromážděné údaje, a to \\\\b nejvýše po dobu jednoho roku\\\\b0 . Žádný z těchto jednotlivých údajů však dobrovolně nepředáme třetí osobě.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Aktualizační proces:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus neinstaluje ani nespouští služby na pozadí. Kontrola aktualizací proto probíhá pouze v případě, kdy je spuštěna hlavní aplikace.\\\\line\\n\"\n\"Pro kontrolu aktualizací programu je samozřejmě nutný přístup k Internetu.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Neplatný obraz pro zvolené nastavení zavaděče\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Aktuální obraz neodpovídá zvolenému nastavení spouštěcího disku. Použijte jiný obraz nebo změňte nastavení.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Tento ISO obraz není kompatibilní s vybraným souborovým systémem\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Rozpoznán nekompatibilní disk\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Zapsat průchod\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Přečíst průchod\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Staženo %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Nelze stáhnout %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Pomocí integrované verze %s soubor(s)\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"DŮLEŽITÉ: TATO JEDNOTKA POUŽÍVÁ NESTANDARTNÍ VELIKOS SEKTORŮ!\\n\"\n\"\\n\"\n\"Běžné disky používají 512-byte velikost sektorů jednotka používá %d-byte one. V mnoha případech to znamená, že nebudete moci zavádět systém z jednotky.\\n\"\n\"Rufus můžete zkusit vytvořit bootovací jednotku, ale neexistuje žádná záruka, že to bude fungovat.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Zjištěna Nestandartní velikost sektorů\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Přenosný Windows' lze nainstalovat pouze na GPT oddíl, nastavte PEVNÝ atribut. Aktuální jednotka nebyla detekována jako PEVNÁ.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Tato funkce není na této platformě k dispozici.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Ukončuje se operace - čekejte...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Analýza obrazu disku...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Analýza obrazu selhala\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Zjištěn zastaralý modul: %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Použitý obraz: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Chybějící soubor: %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Nový svazek\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"Bylo nalezeno %d zařízení\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"Bylo nalezeno %d zařízení\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"PŘIPRAVEN\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"ZRUŠENO\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"NEZDAŘILO SE\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Spuštění nové verze programu...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Spuštění nové verze programu se nezdařilo\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Otevřený soubor: %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Uložený soubor: %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formátování: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Vytváření souborového systému: úloha %d/%d dokončena\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Oprava NTFS: %d%% dokončeno\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formátování (%s) - zbývající čas: %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Nastavení jmenovky (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formátování (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Oprava NTFS (Kontrola disku)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Odstranění MBR/PBR/GPT struktury...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Požadavek na přístup na disk...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analyzování stávajících zaváděcích záznamů...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Uzavření stávajícího svazku...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Zápis hlavního spouštěcího záznamu...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Zapisování spouštěcího záznamu oddílu...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopírování DOS souborů...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopírování ISO souborů: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Nastavení Win7 EFI režimu boot (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Dokončování, čekejte...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Instaluje se Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Chybné bloky: %s %d/%d - %0.2f%% (%d/%d/%d Chyby)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Chybné bloky: Testovaní s náhodným vzorkem\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Chybné bloky: Testovaní se vzorkem 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Vytváření oddílů (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Odstraňování oddílů (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Podpis stažené aktualizace nelze ověřit. To může znamenat, že systém je nesprávně nakonfigurován pro ověření podpisu nebo označil stažený soubor jako škodlivý.\\n\"\n\"\\n\"\n\"Stahování bude smazáno. Zkontrolujte podrobnosti v protokolu.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Stahování: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Stažení souboru se nezdařilo.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Kontrola aktualizací programu Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Aktualizace: Není připojení k Internetu\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Aktualizace: Údaje o verzi jsou nedostupné\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Je dostupná nová verze programu Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Nebyla nalezena nová verze programu\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Klíče registrů aplikace byly úspěšně odstraněny\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Odstraněné klíčů registrů aplikace se nezdařilo\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s: povoleno\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s: zakázáno\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Kontrola velikosti\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Detekce HDD\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Vynutit formátování velkého FAT32 oddílu\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun bude při ukončení odstraněn\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Zjištěna emulovaná jednotka\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet podpora\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge podpora\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Vynutit aktualizaci\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS komprese\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Zápis obrazu: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO podpora\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Použit BINÁRNÍ předpony jednotek\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Odstranění adresář '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare detekce disk\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Dvojí UEFI/BIOS režim\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Použití obrazu systému Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Použití Windows obrazu...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Zachovat časovou značku\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB ladění\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Výpočet kontrolních součtů obrazů: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Vypočet MD5, SHA1 a SHA256 kontrolního součty pro vybraný obraz\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Změna jazyka aplikace\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s obraz detekován\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Obráz, který jste si vybrali, je obraz 'ISO Hybrid'. To znamená, že může být zapsán buď v %s (kopírování souborů) v režimu %s (obraz disku) režim.\\n\"\n\"Rufus doporučuje použití %s režim, pokud je plný přístup k jednotce pro zápis.\\n\"\n\"Pokud narazíte na problémy při startu, můžete zkusit zapsat tento obraz znovu %s režim.\\n\"\n\"\\n\"\n\"Vyberte režim, který chcete použít k zapsání tohoto obrázu:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Režim zápisu %s (Doporučená)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Režim zápisu %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Kontrola konfliktních procesů...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Není boot\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disk nebo obraz ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Prosím vyberte)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Uzamčení USB disku\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Neplatný podpis\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Schází digitální podpis u staženého programu.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Stažený program je podepsán '%s'.\\n\"\n\"Tento není jste si vědomi že muže být indikovaná jako škodlivý program...\\n\"\n\"Opravdu chcete spustit tento program?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Nulování jednotky: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Detekce není vložen USB disk\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Nemáte oprávnění správce\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Tuto aplikaci lze spustit pouze s oprávněním správce\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Indexování souborů\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Výběr verze\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Vyberte verzi systému Windows kterou chcete nainstalovat:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Nepodporovaná verze systému Windows\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Tato verze systému Windows již není systémem Rufus podporována.\\n\"\n\"Poslední verze systému Rufus kompatibilní s touto platformou je v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Upozornění: Neoficiální verze\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Tato verze Rufus, nebyl nepochází z oficiálního vývoje.\\n\"\n\"\\n\"\n\"Jsou si jisti, že ji chcete spustit?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Redukované ISO detekováno\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"U vybraného ISO soubor neodpovídá deklarovaná velikost: %s z údajů chybí!\\n\"\n\"\\n\"\n\"Pokud jste jej získali z internetu, měli by jste stáhnout novou kopii a ověřt, zda odpovídají kontrolní součty MD5 nebo SHA. oficiálně.\\n\"\n\"\\n\"\n\"Poznámka: Klepnutím na(✓)lze vypočítat MD5 nebo SHA v Rufusu.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Chyba ověření časového razítka\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus nemohl ověřit časové razítko stažené aktualizace, zda je novější než časový údaj minulé aktuální spustitelný soubor.\\n\"\n\"\\n\"\n\"Aby se zabránilo možným scénářům útoků, proces aktualizace byl zrušen stahování bude smazáno. Zkontrolujte podrobnosti protokolu.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Zobrazit nastavení aplikace\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Zobrazte informace o této aplikaci\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Zobrazit protokol\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Vytvořit obraz disku vybraného zařízení\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Pomocí této možnosti určete, zda plánujete nainstalovat systém Windows na jiný disk, nebo zda chcete spustit systém Windows přímo z této jednotky (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Rychlé-přepsání jednotky: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"může to chvíli trvat\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Detekce VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Komprimovaný archiv\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Vybraný soubor ISO používá systém UEFI a je dostatečně malý na to, aby mohl být zapsán jako systémový oddíl EFI (ESP). Pro některé typy instalací může být vhodnější zapisovat do ESP místo do obecného datového oddílu zabírajícího celý disk..\\n\"\n\"\\n\"\n\"Vyberte režim, který chcete použít pro zápis tohoto obrázku:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Use %s (v hlavním okně aplikace) povolit.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Další hashe (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Uložit do VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Výpočet kontrolních součtů obrazů\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Více tlačítek\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Počet průchodů\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Výchozí priorita vlákna: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignorovat Boot Marker\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Obnovení rozložení oddílu (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Vybraný obraz je ISOHybrid, ale jeho tvůrci ho neudělali kompatibilní s režimem kopírování ISO/File..\\n\"\n\"V důsledku toho bude vynucen režim zápisu obrázků DD.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Nelze otevřít nebo přečíst soubor '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Použití přizpůsobení systému Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Použití uživatelských možností...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Uživatelské prostředí systému Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Přizpůsobení instalace systému Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Odstranění požadavku na více než 4 GB RAM, Secure Boot a TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Odstranění požadavku na online účet Microsoft\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Zakázat sběr dat (Přeskočit otázky týkající se ochrany osobních údajů)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Zabránění přístupu systému Windows To Go k interním diskům\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Vytvořte místní účet s uživatelským jménem:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Nastavení regionálních voleb na stejné hodnoty jako u tohoto uživatele\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Zakázání automatického šifrování zařízení nástrojem BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Trvalý protokol\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Pro instalaci systému MS-DOS je nutné stáhnout další soubor ('diskcopy.dll') od společnosti Microsoft:\\n\"\n\"- Vyberte 'Ano' pro připojení k internetu a stažení\\n\"\n\"- Výběrem možnosti \\\"Ne\\\" operaci zrušíte\\n\"\n\"\\n\"\n\"Poznámka: Soubor bude stažen do adresáře aplikace a bude automaticky znovu použit, pokud je přítomen.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Byl zjištěn odvolaný zavaděč UEFI\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus zjistil, že vámi vybraný ISO obsahuje zavaděč UEFI, který byl odvolán a který vytvoří %s, když je v plně aktuálním systému UEFI povoleno Secure Boot.\\n\"\n\"\\n\"\n\"- Pokud jste tento obraz ISO získali z nerenomovaného zdroje, měli byste zvážit možnost, že by mohl obsahovat malware UEFI a vyhnout se bootování z něj.\\n\"\n\"- Pokud jste jej získali z důvěryhodného zdroje, měli byste se pokusit najít aktuálnější verzi, která toto varování nevyvolá.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"obrazovka \\\"Porušení zabezpečení\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"a Obrazovka zotavení systému Windows (BSOD) s '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Komprimovaný obraz VHDX\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Nekomprimovaný obraz VHD\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Úplná aktualizace Flash Image\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"K použití této funkce je třeba stáhnout některá další data od společnosti Microsoft:\\n\"\n\"- Vyberte 'Ano' pro připojení k internetu a stažení\\n\"\n\"- Výběrem možnosti \\\"Ne\\\" operaci zrušíte\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Omezit Windows na S-Mode (NEKOMPATIBILNÍ s online vynecháním účtu)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Expertní režim\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Rozbalení archivních souborů: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Použijte Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus je nástroj, který pomáhá formátovat a vytvářet bootovací USB flash disky, jako jsou USB klíče, paměťové karty atd.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Oficiální stránky: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Zdrojový kód: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Protokol změn: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Tato aplikace je licencována podle podmínek GNU Public License (GPL) verze 3.\\n\"\n\"Podrobnosti naleznete na adrese https://www.gnu.org/licenses/gpl-3.0.html.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formátování USB, flash karet a virtuálních jednotek na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Vytvoření bootovacích disků USB se systémem FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Vytváření bootovacích jednotek ze zaváděcích ISO (Windows, Linux atd.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Vytváření zaváděcích jednotek ze zaváděcích obrazů disků, včetně komprimovaných\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Vytvořte zaváděcí jednotky BIOS nebo UEFI, včetně zaváděcích souborů NTFS UEFI\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Vytvoření jednotek \\\"Windows To Go\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Vytvoření instalačních jednotek systému Windows 11 pro počítače bez čipu TPM nebo Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Vytvoření trvalých oddílů systému Linux\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Vytvoření obrazů VHD/DD z vybrané jednotky\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Výpočet kontrolních součtů MD5, SHA-1, SHA-256 a SHA-512 vybraného obrazu\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Provést kontrolu vadných bloků, včetně detekce \\\"falešných\\\" bloků. flash disky\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Stažení oficiálních souborů ISO systému Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Stažení souborů UEFI Shell ISO\"\n"
  },
  {
    "path": "res/loc/po/da-DK.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-04-25 13:41-0700\\n\"\n\"PO-Revision-Date: 2024-04-25 14:34-0700\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: da_DK\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Danish (Dansk)\\n\"\n\"X-Rufus-LCID: 0x0406\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Drev Indstillinger\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Enhed\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Opstartstype\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Valg\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Installationstype\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Partitionstype\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Målsystem\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Vis USB-harddiske\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Tilføj rettelser for ældre BIOS'er\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Slå runtime UEFI medie validering til\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Formateringsindstillinger\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Filsystem\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Klyngestørrelse\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Volume-etiket\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Ekspresformatering\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Søg efter fejlbehæftede blokke\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Brug udvidet etiket og ikon-filer\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Afslut\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Om Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licens\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus Licens\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Mere information\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Ja\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Nej\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Slet\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Gem\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Opdateringspolitik og indstillinger\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Indstillinger\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Søg efter opdateringer\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Inkluder betaversioner\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Søg nu\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Søg efter opdateringer - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"En nyere version er tilgængelig. Download seneste version!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Klik her for at gå til hjemmesiden\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Programinformation\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Hent\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Anden instans opdaget\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"En anden Rufus applikation kører allerede.\\n\"\n\"Afslut venligst den første instans af Rufus inden du starter en ny.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"ADVARSEL: AL DATA PÅ '%s' VIL FORSVINDE.\\n\"\n\"\\n\"\n\"Klik 'OK' for at fortsætte. Klik 'Annuller' for at fortryde.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus opdateringspolitik\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Giver du tilladelse til at Rufus søger efter opdateringer online?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Annuller\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Fejlbehæftede blokke fundet\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Kontrol færdig: %d fejlbehæftede blokke fundet\\n\"\n\"  %d læsefejl\\n\"\n\"  %d skrivefejl\\n\"\n\"  %d korruptionsfejl\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"En mere detaljeret rapport kan findes i:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Deaktiveret\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Dagligt\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Ugentligt\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Månedligt\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Tilpasset\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Din version: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Seneste version: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"byte\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobyte\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabyte\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Standard\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (standard)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (eller UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (ikke CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS eller UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d gennemløb\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d gennemløb %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO-image\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Applikation\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Annuller\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Kør\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operation afbrudt af brugeren\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Fejl\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Fejl: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Filhentning\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB-lagerenhed (generisk)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Flere partitioner\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - tømmer buffere\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - annullerer\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Succes.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Ukendt fejl under formatering.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Kan ikke benytte det valgte filsystem for dette medie.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Adgang til enheden blev nægtet.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Mediet er skrivebeskyttet.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Enheden er i brug af en anden proces. Afslut venligst enhver anden proces der kan have låst enheden.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Ekspresformatering er ikke tilgængelig for denne enhed.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Volume-etiketten er ugyldig.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Enhedshandle er ugyldig.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Den valgte klyngestørrelse er ikke gyldig for denne enhed.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Den valgte volumestørrelse er ugyldig.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Indsæt venligst et flytbart medie i drevet.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"En ikke understøttet kommando blev modtaget.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Fejl ved allokering af hukommelse.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Læsefejl.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Skrivefejl.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Installationsfejl\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Kan ikke åbne medie. Det kan være i brug af en anden proces. Fjern og genindsæt mediet.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Der kunne ikke partitioneres drev.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Kunne ikke kopiere filer til destinationsdrevet.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Afbrudt af bruger.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Ikke i stand til at starte tråd.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Søgning efter fejlbehæftede blokke blev ikke fuldført.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Fejl ved scanning af ISO-image.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Fejl ved udpakning af ISO-image.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Kan ikke genmontere volumen.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Kan ikke installere boot-filer.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Kan ikke tildele drevbogstav.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Kan ikke montere GUID-volumen.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Enheden er ikke parat.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus har opdaget, at Windows stadig tømmer sine interne buffere til USB-enheden.\\n\"\n\"\\n\"\n\"Afhængig af hastigheden på din USB-enhed, kan denne operation tage lang tid at gennemføre, især for store filer.\\n\"\n\"\\n\"\n\"Vi anbefaler, at du lader Windows blive færdig for at undgå korruption. Men hvis du bliver træt af at vente, kan du bare trække enheden ud...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"ISO-filen er ikke understøttet\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Denne ISO er enten ikke-bootbar eller er baseret på boot eller kompression metode, der er ikke støttet af Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Erstat %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Dette ISO-image lader til at bruge en forældet version af '%s'.\\n\"\n\"På grund af dette bliver Boot-menuer måske ikke vist korrekt.\\n\"\n\"\\n\"\n\"Rufus kan hente en nyere version for at fikse dette problem:\\n\"\n\"- Vælg 'Ja' for at oprette forbindelse til internettet og hente filen\\n\"\n\"- Vælg 'Nej' for at lade ISO-filen forblive uændret\\n\"\n\"Hvis du er i tvivl om, hvad du skal vælge, bør du vælge 'Ja'.\\n\"\n\"\\n\"\n\"Bemærk: '%s' bliver gemt i den nuværende mappe og bliver efterfølgende automatisk genanvendt, hvis den er der.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Downloader %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Ingen image-fil er valgt\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"til %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Image-filen er for stor\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Diskbilledet er for stort til den valgte destination.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"ISO-filen er ikke understøttet\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Når UEFI vælges som destinationssystem er kun EFI boot-ISO'er understøttet. Vælg venligst en EFI boot-ISO eller sæt destinationssystem til BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Filsystemet er ikke understøttet\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"VIGTIGT: DETTE DREV INDEHOLDER FLERE PARTITIONER!!\\n\"\n\"\\n\"\n\"Dette kan omfatte partitioner, der er skjulte eller endda er synlige fra Windows. Hvis du ønsker at fortsætte, er du selv ansvarlig for eventuelle tab af data på disse partitioner.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Flere partitioner blev fundet\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD-image\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Det valgte filsystem kan ikke bruges med denne ISO-fil. Vælg et andet filsystem eller en anden ISO-fil.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' kan kun bruges med filsystemet NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"VIGTIGT: Du er ved at installere 'Windows To Go', men installationsdrevet er ikke en 'Lokal' disk. På grund af dette vil Windows muligvis 'fryse' under opstart, da Microsoft ikke har designet Windows til at virke med 'Flytbare' diske \\n\"\n\"\\n\"\n\"Vil du fortsætte alligevel?\\n\"\n\"\\n\"\n\"Bemærk: 'Lokal/Flytbar'-flaget er et hardwareflag som kun kan ændres med specielle værktøjer fra producenten. Disse værktøjer er næsten aldrig tilgængelige for almindelige mennesker...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Filsystem begrænsning\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Dette ISO-image indeholder en fil, der er større end 4 GB, hvilket er mere end den maksimale størrelse, der er tilladt for et FAT- eller FAT32 filsystem.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Manglende WIM-understøttelse\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Din platform kan ikke udpakke filer fra et WIM-arkiv. Udpakning af WIM-filer er påkrævet for at oprette en EFI Windows 7 og Windows Vista USB boot-disk. Du kan løse det ved at hente og installere 7-Zip.\\n\"\n\"Ønsker du at gå til 7-zip's downloadside?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Hent %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s eller senere kræver at en '%s'-fil bliver installeret.\\n\"\n\"Fordi denne fil er større end 100 KB, og altid er i %s ISO-filer, er den ikke indbygget i Rufus.\\n\"\n\"\\n\"\n\"Rufus kan downloade den manglede fil for dig:\\n\"\n\"- Vælg 'Ja' for at oprette forbindelse til internettet og hente filen\\n\"\n\"- Vælg 'Nej' hvis du selv ønsker at kopiere filen til drevet senere\\n\"\n\"\\n\"\n\"Bemærk: '%s' bliver gemt i den nuværende mappe og bliver efterfølgende automatisk genanvendt, hvis den er der.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Annullering kan efterlade enheden i en ubrugelig tilstand.\\n\"\n\"Hvis du er sikker på at du vil annullere, klik JA. Ellers, klik NEJ.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Vælg en mappe\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Alle filer\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS kan ikke boote fra et drev der bruger 64 kilobyte klyngestørrelse.\\n\"\n\"Vær venlig at ændre klyngestørrelsen eller brug FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Inkompatibel klyngestørrelse\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Formatering af en stor UDF volume kan tage lang tid. Ved USB 2.0-hastigheder, er den anslåede varighed af formatering %d:%02d, hvorunder statuslinjen forekommer frosset. Vær tålmodig!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Stort UDF volume\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Dette image benytter Syslinux %s%s men denne applikation indeholder kun installationsfilerne til Syslinux %s%s.\\n\"\n\"\\n\"\n\"Da nye versioner af Syslinux ikke er kompatible med hinanden, og det desuden ikke ville være muligt for Rufus at inkludere dem alle, er det nødvendigt at hente to yderligere filer fra internettet ('ldlinux.sys' og 'ldlinux.bss'):\\n\"\n\"- Vælg 'Ja' for at oprette forbindelse til internettet og hente filerne\\n\"\n\"- Vælg 'Nej' for at annullere operationen\\n\"\n\"\\n\"\n\"Bemærk: Disse filer bliver gemt i den nuværende mappe og bliver efterfølgende automatisk genanvendt, hvis de er der.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Download nødvendig\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Dette image bruger Grub %s, og dette program har kun installationsfiler til Grub %s.\\n\"\n\"\\n\"\n\"Da forskellige versioner af Grub muligvis ikke er kompatible med hinanden, og det ikke er muligt at inkludere alle versioner vil Rufus forsøge at finde en version af Grub-installationsfilen ('core.img') der matcher versionen fra dit image:\\n\"\n\"- Vælg 'Ja' for at oprette forbindelse til internettet og hente filen\\n\"\n\"- Vælg 'Nej' for at bruge den version der kommer med Rufus\\n\"\n\"- Vælg 'Annuller' for at afbryde\\n\"\n\"\\n\"\n\"Bemærk: Filen vil blive hentet til samme placering som Rufus og vil blive genbrugt automatisk hvis behovet genopstår. Hvis der ikke findes en matchene version online, vil standardversionen blive brugt.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Standard Windows-installation\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"Windows To Go (din PC på en USB-nøgle)\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"avancerede drev indstillinger\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"avancerede formateringsindstillinger\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Vis %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Skjul %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Vedvarende partition størrelse\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Ingen partition\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Indstil størrelsen for den vedvarende partition til live USB media. Ved at vælge størrelsen 0 slår man den vedvarende partition fra.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Indstil partition størrelses enheder.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Vis ikke denne besked igen\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Vigtig besked om %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Du hare lige oprettet et medie, der bruger UEFI:NTFS bootloader. Husk, at du skal DEAKTIVERE SIKKER BOOT for at starte dette medie.\\n\"\n\"\\vFor flere detaljer om hvorfor dette er nødvendigt, se \\\"Mere information\\\" knappen nedenfor.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows billedvalg\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Denne ISO indeholder flere Windows-billeder.\\n\"\n\"Vælg venligt billedet, du vil bruge til denne installation:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Et andet program eller en proces er i gang med at tilgå dette drev. Vil du formatere det alligevel?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus har opdaget, at du forsøger at oprette et Windows To Go medie baseret på en 1908 ISO.\\n\"\n\"\\n\"\n\"På grund af en *MICROSOFT BUG* vil dette medie fejle under Windows boot (Blue Screen of Death) medmindre du manuelt erstatter filen 'WppRecorder.sys' med en 1803-version.\\n\"\n\"\\n\"\n\"Bemærk også, at årsagen til, at Rufus ikke automatisk kan løse dette for dig, er at 'WppRecorder.sys' er en Microsoft-ophavsretlig beskyttet fil, så vi kan ikke lovligt inkludere en kopi af filen i applikationen...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Fordi MBR er udvalgt for partitionsordning, kan Rufus kun oprette en partition op til 2 TB på dette medie, hvilket gør %s af diskplads utilgængelig.\\n\"\n\"\\n\"\n\"Er du sikker, du vil fortsætte?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Udgave\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Sprog\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Artitektur\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Fortsæt\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Tilbage\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Vent venligst...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Download med en browser\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Downloads af Windows ISOer er i øjeblikket utilgængeligt da Micrososft har ændret deres side for at forhindre det.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 eller senere version er påkrævet for at køre dette script.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Vil du gå online og downloade det?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Kører download script...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Download ISO-image\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Enhedstypen du planlægger at bruge denne bootbare drev med. Det er dit ansvar at afgøre om dit mål er af BIOS eller UEFI-typen før du begynder at oprette drevet, da det ellers kan mislykkes at boote.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' betyder at enheden kun booter i BIOS-emuleringsmodus (også kendt som 'Legacy Mode') under UEFI, og ikke i indbygget UEFI-modus.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'ikke CSM' betyderr at enheden kun booter i indbygget UEFI-modus, og ikke i BIOS-emuleringsmodus (også kendt som 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Test mønster: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Test mønster: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Test mønster: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Test mønster: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Sætter destinationsfilsystem\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Mindste datamængde, en blok af data vil optage i filsystemet\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Brug dette felt til at ændre volume-etiketten.\\n\"\n\"Internationale tegn accepteres.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Skift avancerede indstillinger\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Kontroller enheden for fejlbehæftede blokke ved brug af et test-mønster\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Fravælg denne mulighed for at bruge den \\\"langsomme\\\" formateringsmetode\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metoden som bliver brugt for at lægge partitioner\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Metode til at oprette en boot-disk\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Klik for at vælge eller downloade et billede...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Vælg denne mulighed for at tillade visning af internationale etiketter og skabe et enheds-ikon (opretter en autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Installer en UEFI bootloader, der vil udføre en MD5Sum fil validering af mediet\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Opret en ekstra skjult partition og forsøg at tilpasse afgrænsning af partitioner.\\n\"\n\"Dette kan forbedre boot-disk genkendelse for ældre BIOS'er.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Vis liste over USB harddisk kabinetter. Brug på egen RISIKO!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Start formateringen.\\n\"\n\"Dette vil SLETTE alle data på destinationsdrevet!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Ugyldig download signatur\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Klik for at vælge...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Det pålidelige USB-formateringsværktøj\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"\"\n\"Dansk oversættelse:\\\\line• Mike Handberg Hovedskov <mailto:mikehovedskov@gmail.com>\\\\line• Jens Hansen <mailto:zenzay@gmail.com>\\\\line• Bo Riis\\n\"\n\"<mailto:supergoof@live.dk>\\\\line• Andrea Wood <mailto:annideer@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Rapporter fejl eller anmod om forbedringer på:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Yderligere rettigheder:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Opdateringspolitik:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Hvis du vælger at tillade dette program at søge efter applikationsopdateringer, accepterer du, at følgende oplysninger kan indsamles på vores server(e):\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Dit operativsystems arkitektur og version\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Versionen af den applikation du bruger\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Din IP-adresse\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Med henblik på at generere private brugerstatistikker, kan vi beholde de indsamlede oplysninger, \\\\b højst et år\\\\b0 . Men vi vil ikke, frivilligt, videregive nogle af disse individuelle data til en tredjepart.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Opdateringsproces:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus kører eller installerer ikke nogle baggrundstjenester, derfor bliver søgning efter opdateringer kun udført, når hovedprogrammet kører.\\\\line\\n\"\n\"Internetadgang er naturligvis påkrævet, når du søger efter opdateringer.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Ugyldig image for den valgte boot mulighed\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Det nuværende image matcher ikke den valgte boot mulighed. Vælg venligst et andet image eller vælg en anden boot mulighed.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Dette ISO-image er ikke kompatibelt med det valgte filsystem\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Inkompatibelt drev fundet\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Skrive test\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Læse test\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Hentet %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Kunne ikke hente %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Benytter standard version af %s fil(er)\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"VIGTIGT: DETTE DREV BENYTTER IKKE STANDARD SEKTOR STØRRELSE!\\n\"\n\"\\n\"\n\"Normale drev benytter en 512-byte sektorstørrelse mens dette drev benytter %d-byte sektorstørrelse. Det betyder ofte at du ikke vil kunne boote fra dette drev.\\n\"\n\"Rufus kan forsøge at lave et bootbar drev, men det er ikke sikkert at det lykkes.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"IKKE standard sektor størrelse fundet\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' kan kun installeres på et GPT-partitioneret drev hvis det er af 'Lokal' drev typen. Det valgte drev er IKKE af 'Lokal' typen.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Denne funktion er ikke tilgængelig på denne platform.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Annullerer - vent venligst...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Scanner image...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Fejl opstod ved scanning af image\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Forældet %s fundet\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"ISO-image: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Manglende %s fil\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Ny disk\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d enhed fundet\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d enheder fundet\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"Klar\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Afbrudt\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Fejl\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Starter ny applikation...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Kan ikke starte ny applikation\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Åbnet %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Gemt %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formaterer: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Opretter filsystem: Opgave %d/%d fuldført\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS-fiks: %d%% fuldført\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formaterer (%s) - estimeret varighed %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Opretter etiket (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formaterer (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS-fiks (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Nulstiller MBR/PBR/GPT-strukturer...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Anmoder om disk tilgang...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analyserer eksisterende boot records...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Lukker eksisterende volume...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Skriver Master boot record...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Skriver partitionsstartpost...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopierer DOS-filer...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopierer ISO-filer: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Afslutter, vent venligst...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Installerer Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Disktest: %s %d/%d - %0.2f%% (%d/%d/%d fejl)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Disktest: Tester med tilfældigt mønster\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Disktest: Tester med mønsteret 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Partitionerer (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Sletter partitioner (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Signaturen for den downloaded opdatering kan ikke bekræftes. Det kunne betyde, at dit system er ukorrekt indstillet for signatur bekræftelse eller indikerer en ondsindet download.\\n\"\n\"\\n\"\n\"Downloaded vil blive slettet. Tjek log for flere detaljer.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Downloader: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Kunne ikke hente fil.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Søger efter Rufus opdateringer...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Opdateringer: Ikke i stand til at tilslutte internettet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Opdateringer: Ikke i stand til at tilgå versionsdata\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"En ny version af Rufus er tilgængelig!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Ingen nyere version af Rufus blev fundet\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Applikationsnøgler i registreringsdatabasen er blevet slettet\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Kunne ikke slette applikationsnøgler i registreringsdatabasen\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s aktiveret\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s deaktiveret\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Tjek størrelsen på ISO-filen\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Lokal-disk detektering\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Tvunget 'large FAT32' formatering\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun bliver detekteret ved exit\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Opdag falske drev\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet understøttelse\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge understøttelse\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Tvunget opdatering\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS-komprimering\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Skriver til image: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO-understøttelse\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"MiB notation\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Sletter mappen '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare disk detektering\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Anvender Windows-image: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Anvender Windows-image...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Bevar tidsstempler\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Beregner imagechecksumme: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Beregner MD5-, SHA1- og SHA256-checksumme for det valgte diskbillede\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Skift programsprog\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s-diskbillede opdaget\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Det diskbillede du har valgt er et 'ISOHybrid'-diskbillede. Det betyder at det både kan skrives som %s (filkopiering) og %s (diskbillede).\\n\"\n\"Rufus anbefaler at du skriver det som %s, så du altid har fuld adgang til drevet efter du har overskrevet det.\\n\"\n\"Men hvis du støder på problemer under boot, kan du prøve at skrive diskbilledet som %s.\\n\"\n\"\\n\"\n\"Vælg den metode som du ønsker at bruge til at skrive diskbilledet:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Skriv som %s (Anbefalet)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Skriv som %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Tjekker for modstridende processer...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Ikke opstartbar\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disk eller ISO billede\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Valg venligst)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Isoleret USB-lukning\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Ugyldig signatur\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Den hentede fil mangler en digital signatur.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Den hentede fil er signeret af '%s'.\\n\"\n\"Det er ikke en signatur vi genkender og det kan tyde på at der er en form for ondsindet aktivitet...\\n\"\n\"Er du sikker på at du vil køre denne fil?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Nulstilled drev: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Opdagelse af ikke-USB flytbare drev\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Manglende udvidede rettigheder\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Dette program kan bare køre med udvidede rettigheder\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Fil Indeksering\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Versions valg\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Valg venligst versionen af Windows du ønsker at installere:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Ikke støttet Windows version\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Denne version af Windows er ikke længere understøttet af Rufus.\\n\"\n\"Den seneste version af Rufus, der er kompatibel med denne platform, er v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Advarsel: Uofficiel version\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Denne version af Rufus er IKKE produceret af dens officielle udvikler(e).\\n\"\n\"\\n\"\n\"Er du sikker på at du vil køre programmet?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Forkortet ISO opdaget\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"ISO-filen du har valgt, stemmer ikke overens med den erklærede størrelse: %s af dataene mangler!\\n\"\n\"\\n\"\n\"Hvis du har downloadet filen fra internettet, bør du prøve at downloade en ny kopi og verificere at MD5 eller SHA kontrolsummen svarer til de officielle.\\n\"\n\"\\n\"\n\"Læg mærke til at du kan beregne MD5 eller SHA i Rufus ved at klikke på (✓)-knappen.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Tidsstempel bekræftelses fejl\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus kunne ikke bekræfte på tidspunktet af den downloadedde opdatering er nyere end den nuværende eksekverbare.\\n\"\n\"\\n\"\n\"For at to forhindre potentielle angrebsscenarier, har opdateringsprocessen blevet afbrudt og downloadet vil blive slettet. Tjek venligst loggen for flere detaljer.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Vis applikationsindstillinger\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Vis oplysninger om denne applikation\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Vis loggen\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Opret et diskbillede af den valgte enhed\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Brug dette alternativ for at angive om du vil bruge denne enhed til at installere Windows på en anden disk, eller hvis du vil køre Windows direkte fra dette drev (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Hurtigt-nulstilling af drev: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"dette kan tage noget tid\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Opdager VHDD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Komprimeret arkiv\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Den ISO, du har valgt, bruger UEFI og er lille nok til at blive skrevet som en EFI systempartition (ESP). Skrivning til en ESP i stedet for at skrive til en generisk datapartition, der optager hele disken, kan være at foretrække for nogle typer installationer.\\n\"\n\"\\n\"\n\"Vælg den metode, du vil bruge til at skrive dette billede:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Brug %s (i hovedprogramvinduet) til at aktivere.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Ekstra checksumme (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Gem på VHDD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Beregn billedechecksumme\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Flere knapper\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Antal gennemløb\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Standard trådpriorietet: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignorer boot markering\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Genindlæser partition layout (%s)\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Det valgte billede er et ISOHybrid, men dets skabere har ikke gjort det kompatibelt med ISO / Fil kopi måde.\\n\"\n\"Derfor bruges DD-billedskrivningstilstand.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Ude af stand til at åbne eller læse '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Anvender Windows tilpasninger : %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Anvender bruger valgmuligheder...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows Bruger Oplevelse\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Tilpas Windows installation?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Fjern kravet for 4GB+ RAM, Secure Boot og TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Fjern kravet for en online Microsoft konto\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Deaktiver data indsamling (Skip privatlivs spørgsmål)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Forhindre Windows To Go i at tilgå interne diske\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Opret en local burger med brugernavn:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Sæt regionale muligheder til de samme værdier some denne brugers\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Deaktiver Bitlockers automatiske apparat kryptering\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Vedvarende log\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"En ekstra fil ('diskcopy.dll') skal hentes fra Microsoft for at installere MS-DOS:\\n\"\n\"- Vælg 'Ja' for at tilslutte til internettet og hente den\\n\"\n\"- Vælg 'Nej' for at afbryde operationen\\n\"\n\"\\n\"\n\"Note: Filen vil blive hentet i programmets mappe og vil blive genbrugt automatisk hvis tilstede.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Tilbagekaldt UEFI Bootloader opdaget\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus har opdaget at ISO filen du har valgt indeholder en UEFI bootloader der er blevet tilbagekaldt og vil producere %s, når Secure Boot er slået til på et fuldt opdateret UEFI system.\\n\"\n\"\\n\"\n\"- Hvis du har hentet dette ISO billed fra en upålidelig kilde, bør du overveje muligheden for at den muligvis indeholder UEFI malware og undgå at boote fra den.\\n\"\n\"- Hvis du har hentet den fra en pålidelig kilde, bør du kigge efter en nyere version, som ikke vil producere denne advarsel.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"en \\\"Sikkerhedsbrud\\\" skærm\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"en Windows Gendannelsesskærm (BSOD) med '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Komprimeret VHDX Afbildning\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Ukomprimeret VHD Afbildning\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Full Flash Update Afbildning\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Noget ekstra data skal hentes fra Microsoft for at udnytte denne funktionalitet:\\n\"\n\"- Vælg 'Ja' for at tilslutte til internettet og hente det\\n\"\n\"- Vælg 'Nej' for at afbryde operationen\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Begræns Windows til S-Mode (Inkompatibel med Online bruger bypass)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Ekspert Tilstand\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Udpakker arkiv filer: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Brug Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus er et værktøj, der hjælper med at formatere og skabe startbare USB-flashdrev, såsom USB-nøgler/USB-pinde, USB-stik, osv.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Officiel side: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Kildekode: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Ændrings log: %s\"\n\n# I cannot find an official translation, but here's a unofficial translated txtfile of the site from:\n# https://www.gnu.org/licenses/translations.en.html\n# https://raw.githubusercontent.com/scootergrisen/licenser/master/gpl-3.0.da.txt\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Denne application er licenceret under GNU Public License (GPL) version 3's vilkår.\\n\"\n\"Se https://www.gnu.org/licenses/gpl-3.0.html for detaljer.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formater USB, flash kort og virtuelle drev til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Lav FreeDOS opstartsbare USB drev\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Lav opstartsbarer drev fra opstartsbarer ISOer (Window, Linux, osv.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Lav opstartsbarer drev fra opstartsbarer disk billeder, inklusiv komprimerede billeder\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Lav BIOS eller UEFI opstartsbarer drev, inklusiv UEFI opstartsbarer NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Lav 'Windows To Go' drev\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Lav Windows 11 installations drev for PCer der ikker har TPM eller Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Lav vedvarende Linux adskillelser\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Lav VHD/DD billeder af det valgte drev\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Beregn MD5, SHA-1, SHA-256 og SHA-512 checksums af det valgte billede\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Udøv dårlige blokke tjeks, inklusiv opdagelse af \\\"falske\\\" flashdrev\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Hent officielle Microsoft Windows detail ISOer\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Hent UEFI Shell ISOer\"\n"
  },
  {
    "path": "res/loc/po/de-DE.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2025-11-12 17:32+0000\\n\"\n\"PO-Revision-Date: 2025-11-12 17:32+0000\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: de_DE\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: German (Deutsch)\\n\"\n\"X-Rufus-LCID: 0x0407, 0x0807, 0x0c07, 0x1007, 0x1407\\n\"\n\"X-Generator: Poedit 3.8\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Laufwerkseigenschaften\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Laufwerk\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Startart\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Auswahl\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Image-Eigenschaft\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Partitionsschema\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Zielsystem\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"USB-Festplatten anzeigen\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Fix für ältere BIOSe verwenden (zusätzliche Partition usw.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"UEFI-Medienvalidierung zur Laufzeit aktivieren\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Formatierungseinstellungen\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Dateisystem\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Größe der Zuordnungseinheit\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Laufwerksbezeichnung\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Schnellformatierung\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Auf defekte Blöcke prüfen\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Erweiterte Bezeichnung und Symbole erstellen\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Schließen\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Über Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Lizenz\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus-Lizenz\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Weitere Informationen\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Ja\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Nein\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Löschen\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Speichern\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Aktualisierungseinstellungen\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Einstellungen\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Auf neue Version prüfen\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Beta-Version verwenden\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Jetzt prüfen\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Prüfe auf neue Version - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Eine neuere Version ist verfügbar. Bitte laden Sie die aktuelle Version herunter!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Klicken Sie hier, um zur Webseite zu gelangen\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Versionshinweise\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Rufus ist bereits gestartet\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Rufus ist bereits gestartet.\\n\"\n\"Bitte schließen Sie es erst, bevor Sie es erneut starten.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"WARNUNG: ALLE DATEN AUF LAUFWERK '%s' WERDEN GELÖSCHT.\\n\"\n\"Klicken Sie auf OK, um fortzufahren. Klicken Sie auf ABBRECHEN, um abzubrechen.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus-Aktualisierungseinstellungen\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Wollen Sie, dass Rufus auf neuen Versionen prüft?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Abbrechen\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Fehlerhafte Blöcke gefunden\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Prüfung abgeschlossen: %d fehlerhafte Blöcke gefunden\\n\"\n\"  %d Lesefehler\\n\"\n\"  %d Schreibfehler\\n\"\n\"  %d Defekt(e)\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Ein detaillierter Bericht ist hier zu finden:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Deaktiviert\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Täglich\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Wöchentlich\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Monatlich\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Speziell\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Ihre Version: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Aktuelle Version: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"Byte\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the petabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"Kilobyte\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"Megabyte\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Standard\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Standard)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (bzw. UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (ohne CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS oder UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d Durchgang\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d Durchgänge %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO-Image\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Programm\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Abbruch\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Start\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operation vom Benutzer abgebrochen\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Fehler\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Fehler: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Dateidownload\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB-Massenspeichergerät (allgemein)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Mehrere Partitionen\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Leere Puffer\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Abbrechen\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Erfolg.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Unbekannter Fehler während der Formatierung.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Das gewählte Dateisystem kann für diesen Datenträger nicht verwendet werden.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Der Zugriff auf das Laufwerk wurde verweigert.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Der Datenträger ist schreibgeschützt.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Das Laufwerk wird von einem anderen Prozess verwendet. Bitte beenden Sie diesen anderen Prozess.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Die Schnellformatierung ist für dieses Laufwerk nicht verfügbar.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Die Laufwerksbezeichnung ist ungültig.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Das Geräte-Handle ist ungültig.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Die ausgewählte Größe der Zuordnungseinheit ist für dieses Laufwerk nicht gültig.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Die Volume-Größe ist ungültig.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Bitte legen Sie einen Wechseldatenträger ein.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Ein nicht unterstütztes Kommando wurde erkannt.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Fehler bei der Speicherzuweisung.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Lesefehler.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Schreibfehler.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Installationsfehler\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Datenträger konnte nicht geöffnet werden. Möglicherweise wird er von einem anderen Prozess verwendet. Bitte legen Sie den Datenträger noch einmal ein und versuchen Sie es erneut.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Laufwerk konnte nicht partitioniert werden.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Dateien konnten nicht auf das Ziellaufwerk kopiert werden.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Vom Benutzer abgebrochen.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Thread konnte nicht gestartet werden.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Prüfung auf fehlerhafte Blöcke nicht abgeschlossen.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Fehler beim Analysieren der ISO-Image-Datei.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Fehler beim Entpacken der ISO-Image-Datei.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Volume konnte nicht neu angelegt werden.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Startfähige Dateien konnten nicht erstellt werden.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Laufwerksbuchstabe konnte nicht zugewiesen werden.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"GUID-Laufwerk konnte nicht angelegt werden.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Das Laufwerk ist nicht bereit.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus hat erkannt, dass Inhalte des Datenpuffers auf das USB-Laufwerk geschrieben werden.\\n\"\n\"\\n\"\n\"Abhängig von der Geschwindigkeit des USB-Laufwerks kann dieser Vorgang lange dauern, insbesondere bei großen Dateien.\\n\"\n\"\\n\"\n\"Wir empfehlen, dass Sie Windows den Vorgang beenden lassen, um ein Problem zu vermeiden. Wenn Ihnen der Vorgang zu lange dauert, können Sie das Gerät einfach entfernen.\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Nicht unterstützte Image-Datei\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Dieses Image ist nicht startfähig oder benutzt eine nicht unterstützte Start- oder Kompressionsmethode.\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"%s ersetzen?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Diese ISO-Image-Datei verwendet eine veraltete Version von '%s'.\\n\"\n\"Bootmenüs werden deswegen möglicherweise fehlerhaft dargestellt.\\n\"\n\"\\n\"\n\"Eine neuere Version kann von Rufus heruntergeladen werden, um dieses Problem zu vermeiden:\\n\"\n\"- Wählen Sie 'Ja', um die Datei herunterzuladen\\n\"\n\"- Wählen Sie 'Nein', um das ISO-Image nicht zu verändern\\n\"\n\"Wenn Sie unsicher sind, wählen Sie 'Ja'.\\n\"\n\"\\n\"\n\"Hinweis: Die neue Datei wird in das aktuelle Verzeichnis heruntergeladen und falls '%s' bereits vorhanden ist, wird sie automatisch wiederverwendet.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Herunterladen von %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Keine Image-Datei gewählt\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"für %s-Flash\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Image ist zu groß\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Dieses Image ist zu groß für das gewählte Ziel.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"ISO-Image nicht unterstützt\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Wenn UEFI als Typ des Zielsystems gewählt ist, werden nur EFI-startfähige ISO-Images unterstützt. Bitte wählen Sie ein EFI-startfähiges ISO-Image oder ändern Sie den Typ des Zielsystems zu BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Nicht unterstütztes Dateisystem\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"ACHTUNG! DIESES LAUFWERK VERFÜGT ÜBER MEHRERE PARTITIONEN!\\n\"\n\"\\n\"\n\"Darunter sind möglicherweise Partitionen, die unter Windows nicht sicht- bzw. nutzbar sind. Wenn Sie fortfahren, sind Sie selbst für den Datenverlust auf diesen Partitionen verantwortlich.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Mehrere Partitionen erkannt\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD-Image\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Das aktuell gewählte Dateisystem kann für dieses ISO-Image nicht verwendet werden. Bitte wählen Sie ein anderes Dateisystem oder ein anderes ISO-Image.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"Für '%s' muss NTFS als Dateisystem verwendet werden.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"WICHTIG: Sie versuchen, 'Windows To Go' zu installieren, aber das Ziel-Laufwerk hat nicht das 'FIXED'-Attribut. Deswegen wird Windows beim Systemstart höchstwahrscheinlich einfrieren, weil Microsoft nicht vorgesehen hat, Laufwerke mit dem 'REMOVABLE'-Attribut zu unterstützen.\\n\"\n\"\\n\"\n\"Wollen Sie den Vorgang trotzdem fortsetzen?\\n\"\n\"\\n\"\n\"Hinweis: Das 'FIXED/REMOVABLE'-Attribut ist eine Hardware-Eigenschaft und kann nur mit speziellen Tools der Hersteller geändert werden. Wobei diese Tools MEIST NICHT öffentlich sind.\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Dateisystembeschränkung\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Diese ISO-Image-Datei enthält eine Datei größer als 4 GB. Diese Dateigröße ist für FAT- oder FAT32-Dateisysteme nicht zulässig.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Fehlende WIM-Unterstützung\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Ihre Plattform kann keine Dateien aus WIM-Containern extrahieren. WIM-Extraktion ist erforderlich, um EFI-startfähige Windows 7 und Windows Vista USB-Laufwerke zu erzeugen. Sie können das durch die Installation der aktuellen 7-Zip-Version beheben.\\n\"\n\"Möchten Sie die 7-Zip-Download-Seite aufrufen?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s oder neuer erfordert, dass eine Datei '%s' installiert ist.\\n\"\n\"Weil diese Datei größer als 100 kB ist und in %s ISO-Images immer enthalten ist, ist sie in Rufus nicht enthalten.\\n\"\n\"\\n\"\n\"Rufus kann die fehlende Datei für Sie herunterladen:\\n\"\n\"- Wählen Sie 'Ja', um die Datei herunterzuladen\\n\"\n\"- Wählen Sie 'Nein', wenn Sie diese Datei später selbst auf das Laufwerk kopieren wollen\\n\"\n\"\\n\"\n\"Hinweis: Die neue Datei wird in das aktuelle Verzeichnis heruntergeladen und falls '%s' bereits vorhanden ist, wird sie automatisch wiederverwendet.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Durch einen Abbruch wird das Gerät in einen INSTABILEN Zustand versetzt.\\n\"\n\"Wenn Sie sicher sind, dass Sie abbrechen wollen, klicken Sie JA, andernfalls klicken Sie NEIN.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Ordner wählen\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Alle Dateien\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus-Log\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS kann nicht von einem Laufwerk mit einer Zuordnungseinheitengröße von 64 Kilobyte starten.\\n\"\n\"Bitte ändern Sie die Zuordnungseinheitengröße oder verwenden Sie FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Inkompatible Zuordnungseinheitengröße\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Die Formatierung eines großen UDF-Laufwerks kann viel Zeit benötigen. Bei USB 2.0-Geschwindigkeiten beträgt die geschätzte Formatierungsdauer %d:%02d, während der die Fortschrittsleiste eingefroren erscheint. Bitte haben Sie Geduld!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Großes UDF-Laufwerk\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Dieses Image benutzt Syslinux %s%s, aber diese Anwendung verfügt nur über Installationsdateien für Syslinux %s%s.\\n\"\n\"\\n\"\n\"Neuere Syslinux-Versionen sind untereinander nicht kompatibel. Rufus kann nicht alle Versionen unterstützen. Zwei zusätzliche Dateien müssen aus dem Internet heruntergeladen werden ('ldlinux.sys' und 'ldlinux.bss'):\\n\"\n\"- Wählen Sie 'Ja', um dem Download zuzustimmen\\n\"\n\"- Wählen Sie 'Nein', um den Vorgang abzubrechen\\n\"\n\"\\n\"\n\"Hinweis: Die Dateien werden in das Programmverzeichnis heruntergeladen und können bei Bedarf wiederverwendet werden.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Download erforderlich\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Dieses Image verwendet Grub %s, aber die Anwendung beinhaltet nur Installationsdateien für Grub %s.\\n\"\n\"\\n\"\n\"Weil verschiedene Versionen von Grub nicht untereinander kompatibel sind und es nicht möglich ist, alle mit Rufus auszuliefern, wird Rufus versuchen, eine Version der Installationsdatei ('core.img') von Grub zu finden, die zur Version im Image passt:\\n\"\n\"- Wählen Sie 'Ja', um sich mit dem Internet zu verbinden und sie herunterzuladen\\n\"\n\"- Wählen Sie 'Nein', um die Standardversion zu verwenden\\n\"\n\"- Wählen Sie 'Abbrechen', um den Vorgang abzubrechen\\n\"\n\"\\n\"\n\"Hinweis: Die Datei wird in das Programmverzeichnis heruntergeladen und ggf. automatisch wiederverwendet. Wenn online nichts gefunden wird, wird die Standardversion verwendet.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Standard-Windows-Installation\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"Erweiterte Laufwerkseigenschaften\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"Erweiterte Formatierungsoptionen\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"%s einblenden\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"%s ausblenden\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Größe der persistenten Partition\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Keine Persistenz\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the persistence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Größe der persistenten Partition des Live-USB-Systems. Eine Größe von 0 deaktiviert die Persistenz.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Einheit der Partitionsgröße festlegen.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Diese Nachricht nicht mehr anzeigen\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Wichtiger Hinweis zu %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Sie haben gerade ein Medium erstellt, welches das UEFI:NTFS-Startprogramm verwendet. Bitte denken Sie daran, dass Sie zum Starten dieses Mediums SECURE BOOT DEAKTIVIEREN müssen.\\n\"\n\"Nach dem Abschluss des Vorgangs sollten Sie SECURE BOOT wieder aktivieren.\\n\"\n\"Weitere Informationen, warum dies notwendig ist, finden Sie über die Schaltfläche \\\"Weitere Informationen\\\".\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows-Image auswählen\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Dieses ISO-Image enthält mehrere Windows-Images.\\n\"\n\"Bitte wählen Sie das Image aus, das Sie für diese Installation verwenden möchten:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Ein anderer Prozess bzw. ein anderes Programm verwendet das Laufwerk gerade. Wollen Sie es trotzdem formatieren?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus hat erkannt, dass Sie ein 'Windows To Go'-Startmedium, basierend auf Windows 10 Version 1809, erstellen wollen.\\n\"\n\"\\n\"\n\"Aufgrund eines \\\"MICROSOFT BUGS\\\" wird das Startmedium nicht funktionieren (Blue Screen), wenn Sie die Datei 'WppRecorder.sys' nicht mit der 1803-Version ersetzen.\\n\"\n\"\\n\"\n\"Aufgrund von Copyright-Richtlinien kann Rufus die Datei 'WppRecorder.sys' nicht selbst reparieren, weil wir diese Datei nicht in unsere Applikation einbetten dürfen.\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Weil MBR als Partitionsschema gewählt wurde, kann Rufus nur eine maximal 2 TB große Partition auf diesem Laufwerk erstellen. %s des Speicherplatzes bleiben ungenutzt.\\n\"\n\"\\n\"\n\"Wollen Sie fortfahren?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Sprache\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Architektur\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Weiter\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Zurück\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Bitte warten...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Mit dem Browser herunterladen\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Der Download von Windows-ISOs ist nicht möglich, da Microsoft seine Website geändert hat, um dies zu verhindern.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 oder neuer ist erforderlich, um dieses Skript auszuführen.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Wollen Sie online gehen und den Download ausführen?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Download-Skript ausführen...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"ISO-Image herunterladen\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Der Typ des Computers, an dem Sie das startfähige Laufwerk verwenden wollen. Sie müssen entscheiden, ob Ihr Ziel vom Typ BIOS oder UEFI ist. Andernfalls schlägt der Start fehl.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' bedeutet, dass der Computer unter UEFI nur im BIOS-Emulationsmodus (auch als 'Legacy-Modus' bezeichnet) und nicht im nativen UEFI-Modus gestartet wird.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'Ohne CSM' bedeutet, dass das Gerät nur im nativen UEFI-Modus und nicht im 'Legacy- bzw. CSM-Modus' startet.\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Prüfmuster: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Prüfmuster: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Prüfmuster: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Prüfmuster: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Zieldateisystem auswählen\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Kleinste Größe, die ein Datenblock im Dateisystem belegt\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Geben Sie hier die Datenträgerbezeichnung ein.\\n\"\n\"Internationale Schriftzeichen sind erlaubt.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Erweiterte Optionen ein- bzw. ausblenden\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Das Laufwerk mittels eines Testmusters auf fehlerhafte Blöcke prüfen\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Wenn nicht aktiviert, wird die \\\"langsame\\\" Formatierung verwendet\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Methode, mit der das Laufwerk partitioniert wird\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Methode, um das Laufwerk startfähig zu machen\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Image-Datei oder Download auswählen...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Wählen Sie diese Option, um die Anzeige internationaler Bezeichnungen zu ermöglichen und ein Gerätesymbol zu erzeugen (autorun.inf).\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Ein UEFI-Startprogramm installieren, das eine MD5Sum-Dateiüberprüfung auf dem Datenträger durchführt\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Eine zusätzliche versteckte Partition erzeugen und die Partitionsgrenzen ausrichten.\\n\"\n\"Das kann die Starterkennung für ältere BIOSe verbessern.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Erkennung von externen USB-Festplatten aktivieren. VERWENDUNG AUF EIGENES RISIKO!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Formatierung starten.\\n\"\n\"Alle Daten auf dem Ziellaufwerk werden GELÖSCHT!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Ungültige Download-Signatur\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Klicken Sie, um auszuwählen...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Das zuverlässige USB-Formatierungstool\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Deutsche Übersetzung: Thilo Langbein <mailto:mail@thilo-langbein.de>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Fehler und Anforderungen an:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Weitere Copyrights:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Aktualisierungseinstellungen:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Wenn Sie die Prüfung auf neue Versionen verwenden, erlauben Sie, dass die folgenden Informationen auf unseren Systemen gespeichert werden:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Ihre Betriebssystem-Architektur und -Version\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Die Version der Anwendung, die Sie einsetzen\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Ihre IP-Adresse\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Zu privaten Statistikzwecken speichern wir diese Informationen \\\\b für höchstens ein Jahr\\\\b0. Es werden keine Daten an Dritte weitergegeben.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Update-Vorgang:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus verwendet keine Hintergrundprozesse. Deshalb wird nur auf Updates geprüft, wenn die Anwendung läuft.\\\\line\\n\"\n\"Eine Internetverbindung ist natürlich für die Prüfung auf neue Versionen erforderlich.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Image-Datei für die gewählte Boot-Option nicht passend\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Die derzeitige Image-Datei passt nicht zur gewählten Boot-Option. Bitte wählen sie eine andere Image-Datei oder eine andere Boot-Option.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Dieses ISO-Image ist mit dem gewählten Dateisystem nicht kompatibel\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Inkompatibles Laufwerk erkannt\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Schreiben durchgeführt\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Lesen durchgeführt\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"%s heruntergeladen\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"%s konnte nicht heruntergeladen werden\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Embedded-Version der %s Datei(en) verwenden\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"WICHTIG: DIESES LAUFWERK HAT EINE NICHT STANDARDISIERTE SEKTORGRÖẞE!\\n\"\n\"\\n\"\n\"Herkömmliche Laufwerke nutzen eine Sektorgröße von 512 Byte, aber dieses Laufwerk nutzt %d Byte. Höchstwahrscheinlich können Sie von diesem Laufwerk NICHT starten.\\n\"\n\"Rufus kann versuchen, ein startfähiges Laufwerk zu erstellen, aber es gibt KEINE GARANTIE, dass es funktionieren wird.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Nicht standardisierte Sektorgröße erkannt\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' kann nur auf ein GPT-partitioniertes Laufwerk installiert werden, wenn das FIXED-Attribut gesetzt ist. Das aktuelle Laufwerk hat dieses nicht.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Diese Funktion ist auf dieser Plattform nicht verfügbar.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Abbrechen - Bitte warten...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Image-Datei lesen...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Fehler beim Lesen der Image-Datei\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Überflüssige %s erkannt\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Verwende Image: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Fehlende %s Datei\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Neues Volume\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d Laufwerk gefunden\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d Laufwerke gefunden\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"FERTIG\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Abgebrochen\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"FEHLGESCHLAGEN\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Anwendung neu starten...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Fehler beim Anwendungsneustart\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Geöffnet %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Gespeichert %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formatieren: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Dateisystem erzeugen: Aufgabe %d/%d abgeschlossen\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS-Reparatur: %d%% erledigt\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formatiere (%s) - geschätzte Dauer %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Bezeichnung einstellen (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formatiere (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS-Reparatur (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"MBR/PBR/GPT zurücksetzen...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Laufwerkszugriff angefordert...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Vorhandene Boot-Datensätze analysieren...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Vorhandenes Volume schließen...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Master Boot Record schreiben...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Partition Boot Record schreiben...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"DOS-Dateien kopieren...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"ISO-Dateien kopieren: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI-Boot-Setup (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Abschließen, bitte warten...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Installiere Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Fehlerhafte Blöcke: %s %d/%d - %0.2f%% (%d/%d/%d Fehler)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Fehlerhafte Blöcke: Mit Zufallsmuster prüfen\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Fehlerhafte Blöcke: Mit Muster 0x%02X prüfen\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Partitioniere (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Lösche Partitionen (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Die Signatur des heruntergeladenen Updates konnte nicht überprüft werden. Das könnte bedeuten, dass Ihr System für die Prüfung der Signatur nicht konfiguriert ist oder der Download bösartig ist.\\n\"\n\"\\n\"\n\"Der Download wird gelöscht. Bitte prüfen Sie das Log für weitere Informationen.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Download: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Fehler beim Dateidownload.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Prüfe auf neue Rufus-Version...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Update: Keine Verbindung zum Internet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Update: Versionsinformationen können nicht ermittelt werden\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Eine neue Version von Rufus ist verfügbar!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Es wurde keine neue Version von Rufus gefunden\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Anwendungseinstellungen in der Registrierdatenbank erfolgreich gelöscht\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Fehler beim Löschen der Anwendungseinstellungen in der Registrierdatenbank\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s aktiviert\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s deaktiviert\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Größenprüfung\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Festplattenerkennung\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Large FAT32-Formatierung erzwingen\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun wird beim Beenden gelöscht\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Erkennung falscher Laufwerke\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet-Unterstützung\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge-Unterstützung\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Update erzwingen\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS-Komprimierung\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Schreibe Image-Datei: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO-Unterstützung\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Korrekte Größeneinheiten verwenden\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Lösche Ordner '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMware-Laufwerkserkennung\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Dualer UEFI/BIOS-Modus\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Windows-Image aufspielen: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Windows-Image aufspielen...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Zeitstempel bewahren\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB-Testmodus\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Berechne Image-Prüfsumme: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Berechne MD5-, SHA1- und SHA256-Prüfsumme für das gewählte Image\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Sprache der Anwendung ändern\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s-Image erkannt\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Das gewählte Image ist eine hybrides ISO-Image. Es kann entweder im %s- (Dateikopier-) oder im %s- (Image-) Modus kopiert werden.\\n\"\n\"Rufus empfiehlt den %s-Modus, denn dann haben Sie nach dem Schreiben vollen Zugriff auf das Laufwerk.\\n\"\n\"Wenn Sie beim Starten Probleme haben, können Sie den %s-Modus versuchen.\\n\"\n\"\\n\"\n\"Bitte wählen Sie den Modus, mit dem Sie das Image schreiben wollen:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Im %s-Modus schreiben (empfohlen)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Im %s-Modus schreiben\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Prüfe auf konkurrierende Prozesse...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Nicht startfähig\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Laufwerk oder ISO-Image\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Bitte wählen Sie ein Image)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Exklusive Sperre für das USB-Laufwerk\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Ungültige Signatur\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Der heruntergeladenen ausführbaren Datei fehlt eine digitale Signatur.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Die heruntergeladene ausführbare Datei ist mit '%s' signiert.\\n\"\n\"Diese Signatur ist nicht akzeptiert und könnte auf eine böswillige Aktivität hindeuten.\\n\"\n\"Sind Sie sicher, dass Sie diese Datei ausführen wollen?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Laufwerk mit Nullen überschreiben: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Erkennung nicht wechselbarer USB-Laufwerke\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Administrative Rechte nicht vorhanden\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Dieses Programm kann nur mit administrativen Rechten ausgeführt werden\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Datei-Indizierung\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Versionsauswahl\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Bitte wählen Sie die Version von Windows aus, die Sie installieren wollen:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Nicht unterstützte Windows-Version\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Diese Version von Windows wird nicht mehr von Rufus unterstützt.\\n\"\n\"\\vDie letzte mit dieser Plattform kompatible Version von Rufus ist v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Warnung: Inoffizielle Version\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Diese Version von Rufus wurde nicht vom offiziellen Entwickler zur Verfügung gestellt.\\n\"\n\"\\n\"\n\"Sind Sie sicher, dass Sie sie ausführen wollen?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Unvollständiges ISO-Image erkannt\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Das ISO-Image, dass Sie gewählt haben, hat nicht die erwartete Größe. %s Daten fehlen!\\n\"\n\"\\n\"\n\"Wenn Sie das Image aus dem Internet heruntergeladen haben, sollten Sie den Download wiederholen und prüfen, ob die MD5- oder SHA-Prüfsummen übereinstimmen.\\n\"\n\"\\n\"\n\"Hinweis: Mit der Schaltfläche (✓) in der Statuszeile können Sie die Prüfsummen des gewählten Images anzeigen.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Fehler bei der Überprüfung des Zeitstempels\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus konnten nicht prüfen, ob der Zeitstempel des Update-Downloads aktueller ist als der des aktuell ausgeführten Programms.\\n\"\n\"\\n\"\n\"Aus Sicherheitsgründen wurde der Aktualisierungsprozess abgebrochen und der Download wurde gelöscht. Im Log finden Sie weitere Details.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Applikationseinstellungen anzeigen\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Informationen über dieses Programm anzeigen\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Log anzeigen\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Ein Image des gewählten Laufwerks erstellen\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Verwenden Sie diese Option, um anzugeben, ob Sie Windows auf einem anderen Datenträger installieren möchten oder ob Sie Windows direkt von diesem Laufwerk ausführen möchten (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Laufwerk mit Nullen überschreiben (schnell): %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"Der Vorgang nimmt einige Zeit in Anspruch\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD-Erkennung\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Archivdatei\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Das ausgewählte ISO-Image verwendet UEFI und ist klein genug, um auf eine EFI-Systempartition (ESP) geschrieben zu werden. Es auf eine ESP anstelle einer normalen Partition zu schreiben, die die gesamte Festplatte belegt, kann für bestimmte Installationsarten vorteilhaft sein.\\n\"\n\"\\n\"\n\"Bitte wählen Sie einen Modus aus:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Verwende %s (Hauptfenster der Anwendung) zum Aktivieren.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Zusätzliche Prüfsummen (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Als VHD speichern\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Prüfsumme des Images berechnen\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Mehrere Schaltflächen\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Anzahl der Durchläufe\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"Disk-ID\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Standardmäßige Thread-Priorität: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Boot-Markierung ignorieren\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Liste der Partitionen aktualisieren (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Das ausgewählte Image ist vom Typ ISOHybrid, aber der Ersteller hat es nicht mit dem ISO/Dateikopiermodus kompatibel gemacht.\\n\"\n\"Deswegen wird der DD-Schreibmodus verwendet.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"'%' kann nicht geöffnet/gelesen werden\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Windows-Anpassungen anwenden: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Benutzereinstellungen anwenden...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows-Benutzererfahrung\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Windows-Installation anpassen?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Anforderung für 4GB+ RAM, Secure Boot und TPM 2.0 entfernen\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Anforderung für Online-Microsoft-Konto entfernen\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Datenerfassung deaktivieren (Fragen zum Datenschutz überspringen)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Verhindern, dass Windows To Go auf interne Laufwerke zugreifen kann\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Ein lokales Benutzerkonto erstellen:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Regionale Optionen auf die gleichen Werte wie die dieses Benutzers setzen\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Deaktivieren der automatischen BitLocker-Laufwerksverschlüsselung\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Dauerhaftes Protokoll\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('%s') must be downloaded from Microsoft to use this feature:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Eine zusätzliche Datei ('%s') muss von Microsoft heruntergeladen werden, um diese Funktion zu nutzen:\\n\"\n\"- Wählen Sie 'Ja', um eine Verbindung mit dem Internet herzustellen und die Datei herunterzuladen\\n\"\n\"- Wählen Sie 'Nein', um den Vorgang abzubrechen\\n\"\n\"\\n\"\n\"Hinweis: Die Datei wird ins Programmverzeichnis heruntergeladen und bei Bedarf wiederverwendet.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Zurückgezogenes UEFI-Startprogramm erkannt\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus hat erkannt, dass das gewählte ISO-Image ein UEFI-Startprogramm enthält, das zurückgezogen wurde. Das führt zu %s, wenn das UEFI-System aktuell ist und Secure Boot aktiv ist.\\n\"\n\"\\n\"\n\"- Wenn Sie das ISO-Image aus einer unzuverlässigen Quelle haben, sollten Sie in Betracht ziehen, dass es UEFI-Schadcode enthält und es deshalb nicht verwenden.\\n\"\n\"- Wenn Sie es aus einer vertrauenswürdigen Quelle haben, sollten Sie versuchen, eine aktuellere Version zu bekommen, die dieses Problem nicht hat.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"ein Bildschirm \\\"Sicherheitsverletzung\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"ein Windows-Wiederherstellungsbildschirm (BSOD) mit '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Komprimiertes VHDX-Image\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Unkomprimiertes VHD-Image\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Vollständiges Flash-Update-Image\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Einige weitere Daten müssen von Microsoft heruntergeladen werden, um diese Funktion zu verwenden:\\n\"\n\"- Wählen Sie 'Ja', um eine Verbindung mit dem Internet herzustellen und diese herunterzuladen\\n\"\n\"- Wählen Sie 'Nein', um den Vorgang abzubrechen\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Windows im S-Modus (nicht kompatibel mit Online Konto-Umgehung)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Expertenmodus\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Archivdatei extrahieren: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Rufus MBR verwenden\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus ist ein Werkzeug, das beim Formatieren und Erstellen bootfähiger USB-Flash-Laufwerke wie USB-Sticks, Speichersticks usw. hilft.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Offizielle Website: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Quellcode: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Änderungsprotokoll: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Diese Anwendung ist unter den Bedingungen der GNU Public License (GPL) Version 3 lizenziert.\\n\"\n\"Siehe https://www.gnu.org/licenses/gpl-3.0.de.html für Details.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatieren von USB, Flash-Karte und virtuellen Laufwerken in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"FreeDOS-bootfähige USB-Laufwerke erstellen\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux etc.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Erstellen bootfähiger Laufwerke aus bootfähigen Festplatten-Images, einschließlich komprimierter Images\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Erstellen von BIOS- oder UEFI-bootfähigen Laufwerken, einschließlich UEFI-bootfähigem NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Erstellen von 'Windows To Go'-Laufwerken\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Erstellen von Windows 11-Installationslaufwerken für PCs ohne TPM oder Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Persistente Linux-Partitionen erstellen\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"VHD/DD-Images des ausgewählten Laufwerks erstellen\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Image\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Durchführung von Prüfungen auf fehlerhafte Blöcke, einschließlich der Erkennung von \\\"gefälschten\\\" Flash-Laufwerken\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Offizielle Microsoft Windows-ISOs herunterladen\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"UEFI-Shell-ISOs herunterladen\"\n"
  },
  {
    "path": "res/loc/po/el-GR.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-09 12:52+0300\\n\"\n\"PO-Revision-Date: 2024-05-09 13:07+0300\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: el_GR\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Greek (Ελληνικά)\\n\"\n\"X-Rufus-LCID: 0x0408\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Ιδιότητες Δίσκου\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Συσκευή\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Τύπος εκκίνησης\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Επιλέξτε\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Επιλογές αρχείου ISO\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Σχέδιο κατανομής\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Επιθυμητό λειτουργικό σύστημα\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Εμφάνιση συσκευων USB\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Προσθήκη διορθώσεων για παλαιότερα BIOS(επιπλέον διχοτόμηση, ευθυγράμμιση, κλπ.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Ενεργοποίηση επικύρωσης μέσων UEFI χρόνου εκτέλεσης\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Επιλογές μορφοποίησης\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Σύστημα αρχείων\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Μέγεθος συμπλέγματος\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Ετικέτα τόμου\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Γρήγορη διαμόρφωση\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Ελέγξτε τη συσκευή για κατεστραμμένους τομείς\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Δημιουργία εκτεταμένης ετικέτας και εικονιδίων\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Κατάσταση\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Κλείσιμο\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Εκκίνηση\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Σχετικά με το Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Άδεια χρήσης\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"OK\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Άδεια χρήσης για το Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Περισσότερες πληροφορίες\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Ναι\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Όχι\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Αρχείο καταγραφής\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Καθαρισμός\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Αποθήκευση\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Πολιτική ενημέρωσης και ρυθμίσεων\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Ρυθμίσεις\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Έλεγχος για ενημερώσεις\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Συμπερίληψη εκδοχών beta\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Έλεγχος τώρα\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Έλεγχος για ενημερώσεις - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Μια νεότερη εκδοχή είναι διαθέσιμη. Παρακαλώ κάντε λήψη της τελευταίας έκδοσης!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Κάντε κλικ εδώ για να μεταβείτε στην ιστοσελίδα\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Σημειώσεις έκδοσης\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Λήψη\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Ανιχνεύθηκε άλλη εφαρμογή Rufus\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Μία άλλη εφαρμογή Rufus εκτελείται ήδη.\\n\"\n\"Παρακαλώ κλείστε την πρώτη εφαρμογή πριν εκτελέσετε μία άλλη.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"ΠΡΟΣΟΧΗ: ΟΛΑ ΤΑ ΔΕΔΟΜΈΝΑ ΣΤΗ ΣΥΣΚΕΥΗ '%s' ΘΑ ΔΙΑΓΡΑΦΟΥΝ.\\n\"\n\"Για να προχωρήσετε με την ενέργεια κάντε κλικ στο OK. Διαφορετικά,για ακύρωση κάντε κλικ στο Άκυρο.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Πολιτική αναβάθμισης του Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Θέλετε να επιτραπεί στο Rufus να ελέγχει για ενημερώσεις;\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Άκυρο\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Βρέθηκαν κατεστραμμένοι τομείς\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Ο έλεγχος ολοκληρώθηκε: βρέθηκαν %d κατεστραμμένοι τομείς\\n\"\n\"  %d σφάλματα ανάγνωσης\\n\"\n\"  %d σφάλματα εγγραφής\\n\"\n\"  %d σφάλματα διαφθοράς\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Μια πιο λεπτομερής αναφορά μπορεί να βρεθεί στο:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Απενεργοποιημένο\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Καθημερινά\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Εβδομαδιαία\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Μηνιαία\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Προσαρμογή\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Η εκδοχή σας: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Τελευταία εκδοχή: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Προεπιλογή\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Προεπιλογή)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (ή UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (εκτός από CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS ή UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d Πέρασμα\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d Περάσματα %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Αρχείο ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Εφαρμογή\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Ακύρωση\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Εκκίνηση\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Η διαδικασία ακυρώθηκε από το χρήστη\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Σφάλμα\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Σφάλμα: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Λήψη αρχείου\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Συσκευή αποθήκευσης USB(Generic)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Δίσκος %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Πολλαπλά διαμερίσματα\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Ρήξη προσωρινής μνήμης\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Ακύρωση\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Επιτυχεία.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Απροσδιόριστο σφάλμα κατά τη διαμόρφωση.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Δεν μπορείτε να χρησιμοποιήσετε το επιλεγμένο σύστημα αρχείων για αυτό το μέσο.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Η πρόσβαση στη συσκευή δεν επιτρέπεται.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Το μέσο έχει προστασία εγγραφής.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Η συσκευή είναι σε χρησιμοποιείται από άλλη διαδικασία. Παρακαλώ κλείστε κάθε άλλη διαδικασία που μπορεί να έχει πρόσβαση στη συσκευή.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Η γρήγορη διαμόρφωση δεν είναι διαθέσιμη για αυτήν τη συσκευή.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Η ετικέτα του τόμου δεν είναι έγκυρη.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Η αναφορά πόρου(handle) συσκευής δεν είναι έγκυρη.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Το επιλεγμένο μέγεθος μονάδας εκχώρησης δεν είναι έγκυρο για αυτήν τη συσκευή.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Το μέγεθος του τόμου δεν είναι έγκυρο.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Παρακαλώ εισάγετε κάποιο αφαιρούμενο μέσο στο δίσκο.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Δόθηκε μη έγκυρη εντολή.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Σφάλμα ταξινόμησης μνήμης.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Σφάλμα ανάγνωσης.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Σφάλμα εγγραφής.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Αποτυχία εγκατάστασης\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Το μέσο δεν μπορεί να ανοίξει. Πιθανόν να είναι σε χρήση από κάποια άλλη διαδικασία. Παρακαλώ επανασυνδέστε το μέσο και δοκιμάστε ξανά.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Σφάλμα κατά το διαμερισμό της μονάδας δίσκου.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Δεν ήταν δυνατή η αντιγραφή αρχείων στον επιθυμητό δίσκο.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Ακυρώθηκε από το χρήστη.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Δεν είναι δυνατή η εκκίνηση της διεργασίας(thread).\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Ο έλεγχος για κατεστραμμένους τομείς δεν ολοκληρώθηκε.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Αποτυχία σάρωσης αρχείου ISO.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Αποτυχία εξαγωγής αρχείου ISO.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Δεν είναι δυνατή η επανατοποθέτηση του τόμου.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Δεν είναι δυνατή η εγκατάσταση/τροποποίηση(patch) των αρχείων για εκκίνηση.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Αδυναμία αναθέτησης γράμματος στη μονάδα δίσκου.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Δεν είναι δυνατή η προσάρτηση του τόμου GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Η συσκευή δεν είναι έτοιμη.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Το Rufus διαπίστωσε ότι τα Windows κάνουν ακόμη flushing της προσωρινής μνήμης στο USB.\\n\"\n\"\\n\"\n\"Ανάλογα με την ταχύτητα του USB σας, αυτή η διαδικασία μπορεί να διαρκέσει αρκετή ώρα για την ολοκλήρωση του, ειδικά για μεγάλα αρχεία.\\n\"\n\"\\n\"\n\"Σας συνιστούμε να αφήσετε τα Windows να τελειώσουν την διαδικασία τους, έτσι ώστε να αποφευχθεί κάποιο σφάλμα. Εάν δεν θέλετε να περιμένετε απλώς αποσυνδέσετε τη συσκευή...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Μη υποστηριζόμενο αρχείο\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Αυτό το αρχείο είτε δεν διαθέτει δυνατότητα εκκίνησης ή δεν χρησιμοποιεί κάποια από τις μεθόδους συμπίεσης/εκκίνησης υποστηριζόμενη απο το Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Αντικατάσταση %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Αυτό το αρχείο ISO φαίνεται να χρησιμοποιεί μία ξεπερασμένη εκδοχή του '%s'.\\n\"\n\"Το μενού εκκίνησης μπορεί να μην εμφανίζεται σωστά εξαιτίας αυτού.\\n\"\n\"\\n\"\n\"Το Rufus είναι σε θέση να κάνει λήψη μίας νεότερης έκδοσης για να διορθωθεί αυτό το πρόβλημα:\\n\"\n\"- Επιλέξτε το 'Ναι' για να συνδεθείτε στο διαδίκτυο και να κάνετε λήψη του αρχείου\\n\"\n\"- Επιλέξτε το 'Όχι' για να αφήσετε το αρχείο ISO αμετάβλητο.\\n\"\n\"Σε περίπτωση που δεν γνωρίζετε τι να κάνετε, καλύτερα να επιλέξετε το 'Ναι'.\\n\"\n\"\\n\"\n\"Σημείωση: Η λήψη του νέου αρχείου θα γίνει στον τρέχοντα φάκελο και εφόσον το'%s' υπάρχει εκεί, θα επαναχρησιμοποιηθεί αυτόματα.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Κατάσταση Λήψης %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Δεν έχει επιλεχθεί κάποιο επιλεγμένο αρχείο\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"για %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Το αρχείο έχει πολύ μεγάλο μέγεθος\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Το μέγεθος του επιλεγμένου αρχείου είναι μεγαλύτερο από την χωρητικότητα του επιλεγμένου μέσου.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Μη υποστηριζόμενο ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Όταν χρησιμοποιείτε ως επιθυμητό τύπο το UEFI μόνο είδωλα ISO με δυνατότητα εκκίνησης τύπου EFI υποστηρίζονται. Παρακαλώ επιλέξτε ένα είδωλο ISO με δυνατότητα εκκίνησης τύπου EFI ή επιλέξτε ως επιθυμητό τύπο το BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Μη υποστηριζόμενο σύστημα αρχείων\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"ΠΡΟΣΟΧΗ: Η ΕΠΙΛΕΓΜΕΝΗ ΣΥΣΚΕΥΗ ΠΕΡΙΕΧΕΙ ΠΟΛΛΑΠΛΟΥΣ ΔΙΑΜΕΡΙΣΜΟΥΣ!!\\n\"\n\"\\n\"\n\"Μπορεί να εμπεριέχονται διαμερισμοί/τόμοι οι οποίοι δεν έχουν εισαχθεί ή δεν είναι ορατοί από τα Windows. Εάν επιθυμείτε να συνεχίσετε, είστε υπεύθυνοι για τυχόν απώλειες δεδομένων σε αυτούς τους διαμερισμούς.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Εντοπίστηκαν πολλαπλοί διαμερισμοί\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"Αρχείο DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Αυτό το αρχείο ISO δεν είναι συμβατό με το επιλεγμένο σύστημα αρχείων. Παρακαλώ χρησιμοποιήστε κάποιο άλλο σύστημα αρχείων ή κάποιο άλλο αρχείο ISO.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"Η επιλογή '%s' μπορεί να χρησιμοποιηθεί μόνο αν το σύστημα αρχείων είναι NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"ΣΗΜΑΝΤΙΚΟ: Προσπαθείτε να εγκαταστήσετε τα 'Windows To Go', αλλά ο επιλεγμένος δίσκος δεν διαθέτει το χαρακτηριστικό 'ΣΤΑΘΕΡΑ'. Λόγω αυτού, τα Windows πιθανότατα θα 'παγώνουν' κατά τη διάρκεια της εκκίνησης εφόσον η Microsoft δεν έχει σχεδιάσει τα 'Windows To Go' για λειτουργία με δίσκους που έχουν το χαρακτηριστικό 'ΑΦΑΙΡΟΥΜΕΝΟΣ'.\\n\"\n\"\\n\"\n\"Είστε σίγουροι ότι θέλετε να συνεχίσετε?\\n\"\n\"\\n\"\n\"Σημείωση: Το χαρακτηριστικό 'ΣΤΑΘΕΡΟΣ / ΑΦΑΙΡΟΥΜΕΝΟΣ' ενός δίσκου είναι μια ιδιότητα που μπορεί να αλλάξει μόνο χρησιμοποιώντας προσαρμοσμένα εργαλεία από τον κατασκευαστή της μονάδας. Ωστόσο, τα εργαλεία αυτά δεν διατίθενται στο κοινό.\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Περιορισμός του συστήματος αρχείων\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Αυτό το αρχείο ISO περιέχει ένα αρχείο μεγαλύτερο από 4 GB, το οποίο είναι μεγαλύτερο από το μέγιστο επιτρεπόμενο μέγεθος για το σύστημα αρχείων FAT ή FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Ελλιπής υποστήριξη για το WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Η πλατφόρμα σας δεν μπορεί να εξάγει αρχεία WIM. Η αποσυμπίεση του αρχείου WIM είναι απαραίτητη για την δημιουργία USBWindows 7 και Windows Vista δίσκων με δυνατότητα εκκίνησης τύπου EFI.Μπορείτε να διορθώσετε αυτό το πρόβλημα με την χρήση μίας πρόσφατης εκδοχής του 7-Zip.\\n\"\n\" Θα θέλατε να επισκεφθείτε την σελίδα λήψης του 7-Zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Λήψη %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Το %s ή κάποια νεότερη έκδοση χρειάζεται το αρχείο '%s' να είναι εγκατεστημένο.\\n\"\n\"Επειδή αυτό το αρχείο είναι μεγαλύτερο από 100 KB σε μέγεθος, και υπάρχει πάντα σε είδωλα ISO %s, δεν είναι ενσωματωμένο στο Rufus.\\n\"\n\"\\n\"\n\"Το Rufus είναι σε θέση να κάνει λήψη αυτού το αρχείου για εσάς:\\n\"\n\"- Επιλέξτε το 'Ναι' για να συνδεθείτε στο διαδίκτυο και να κάνετε λήψη του αρχείου\\n\"\n\"- Επιλέξτε το 'Όχι' αν θέλετε να αντιγράψετε με μη αυτόματο τρόπο το αρχείο στο δίσκο αργότερα.\\n\"\n\"\\n\"\n\"Σημείωση: Η λήψη του νέου αρχείου θα γίνει στον τρέχοντα κατάλογο και εφόσον το '%s' υπάρχει εκεί, θα επαναχρησιμοποιηθεί αυτόματα.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Η ακύρωση μπορεί να αφήσει τη συσκευή σε κατάσταση όπου δεν μπορεί να χρησιμοποιηθεί.\\n\"\n\"Εάν είστε σίγουροι ότι θέλετε να χρησιμοποιήσετε την ακύρωση, κάντε κλικ στο 'Ναι'. Διαφορετικά, κάντε κλικ στο 'Όχι'.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Παρακαλώ επιλέξτε φάκελο\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Όλα τα αρχεία\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Αρχείο καταγραφής Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Δίσκος %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"Το MS-DOS δεν μπορεί να κάνει εκκίνηση από ένα δίσκο χρησιμοποιώντας μέγεθος συμπλέγματος 64 kilobyte.\\n\"\n\"Παρακαλώ αλλάξτε το μέγεθος συμπλέγματος ή χρησιμοποιήστε το FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Μη συμβατό μέγεθος συμπλέγματος\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Η διαμόρφωση μεγάλων τόμων UDF ίσως διαρκέσει αρκετά. Ο χρόνος διαμόρφωσης, στις ταχύτητες του USB 2.0 είναι %d:%02d. Κατά την διάρκεια της διαμόρφωσης η μπάρα προόδου θα είναι στατική. Παρακαλώ περιμένετε!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Mεγάλος τόμος UDF\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Αυτό το αρχείο χρησιμοποιεί το Syslinux %s%s παρόλα αυτά η εφαρμογή(Rufus) εμπεριέχει μόνο τα αρχεία εγκατάστασης του Syslinux %s%s.\\n\"\n\"\\n\"\n\" Εφόσον οι νέες εκδόσεις του Syslinux δεν είναι συμβατές μεταξύ τους, δεν είναι δυνατό για το Rufus να τις εμπεριέχει όλες. Επομένως, απαιτείται η λήψη δύο νέων αρχείων απο το διαδίκτυο ('ldlinux.sys' και 'ldlinux.bss'): \\n\"\n\"- Επιλέξτε το 'Ναι' για να συνδεθείτε στο διαδίκτυο και να κάνετε λήψη των αρχείων\\n\"\n\"- Επιλέξτε το 'Όχι' για να ακυρώσετε τη λειτουργία.\\n\"\n\"Σημείωση: Η λήψη των νέων αρχείων θα γίνει στον τρέχοντα κατάλογο και εφόσον τα αρχεία υπάρχουν εκεί, θα επαναχρησιμοποιηθούν αυτόματα.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Απαιτείται λήψη\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Αυτό το αρχείο χρησιμοποιεί το Grub %s παρόλα αυτά η εφαρμογή(Rufus) εμπεριέχει μόνο τα αρχεία εγκατάστασης του Grub %s.\\n\"\n\"\\n\"\n\" Εφόσον οι διαφορετικές εκδόσεις του Grub δεν είναι συμβατές μεταξύ τους, δεν είναι δυνατό για το Rufus να τις εμπεριέχει όλες. Επομένως, το Rufus θα επιχειρήσει να κάνει λήψη μιας έκδοσης του Grub ('core.img') που είναι συμβατή με το αρχείο σας:\\n\"\n\"- Επιλέξτε το 'Ναι' για να συνδεθείτε στο διαδίκτυο και να κάνετε λήψη του αρχείου\\n\"\n\"- Επιλέξτε το 'Όχι' για να ακυρώσετε τη λειτουργία.\\n\"\n\"Σημείωση: Η λήψη των νέων αρχείων θα γίνει στον τρέχοντα κατάλογο και εφόσον τα αρχεία υπάρχουν εκεί, θα επαναχρησιμοποιηθούν αυτόματα. Εάν δε βρεθεί κάποιο συμβατό αρχείο τότε η προεπιλεγμένη έκδοση θα χρησιμοποιηθεί.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Προσαρμοσμένη εγκατάσταση για Windows\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"Windows To Go (USB με δυνατότητα εκκίνησης)\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"επιλογές δίσκου για προχωρημένους\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"προηγμένες επιλογές διαμόρφωσης\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Εμφάνιση %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Απόκρυψη %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Μέγεθος μόνιμου διαμερίσματος\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Ανενεργό\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Ορίστε το μέγεθος του μόνιμου διαμερίσματος για USB με δυνατότητα εκκίνησης. Η ρύθμιση του μεγέθους σε 0 απενεργοποιεί το μόνιμο διαμέρισμα.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Ορίστε τις μονάδες μεγέθους διαμερίσματος.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Μην ξαναδείξεις αυτό το μήνυμα\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Σημαντική ειδοποίηση για το %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Μόλις δημιουργήσατε ένα μέσο που χρησιμοποιεί το bootloader UEFI:NTFS. Σας παρακαλούμε να θυμάστε ότι, για να εκκινήσετε αυτά τα μέσα, πρέπει να απενεργοποιήσετε την ασφαλή εκκίνηση.\\n\"\n\"Για λεπτομέρειες σχετικά με το γιατί αυτό είναι απαραίτητο, ανατρέξτε στο κουμπί \\\"Περισσότερες πληροφορίες\\\" παρακάτω.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Επιλογή αρχείου Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Αυτό το ISO περιέχει πολλά ειδώλια των Windows.\\n\"\n\"Επιλέξτε το αρχειο που θέλετε να χρησιμοποιήσετε για αυτήν την εγκατάσταση:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Ένα άλλο πρόγραμμα ή διαδικασία έχει πρόσβαση σε αυτήν τη μονάδα δίσκου. Θέλετε να το διαμορφώσετε ούτως ή άλλως;\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Το Rufus έχει εντοπίσει ότι προσπαθείτε να δημιουργήσετε ένα μέσο Windows To Go βάσει ενός ISO 1809.\\n\"\n\"\\n\"\n\"Λόγω ενός * MICROSOFT BUG *, αυτό το μέσο θα καταρρεύσει κατά την εκκίνηση των Windows (Blue Screen Of Death), εκτός αν αλλάξετε με το χέρι το αρχείο 'WppRecorder.sys' με εκδοχή 1803.\\n\"\n\"\\n\"\n\"Επίσης, σημειώστε ότι ο λόγος για τον οποίο ο Rufus δεν μπορεί να διορθώσει αυτόματα αυτό για εσάς είναι ότι το \\\"WppRecorder.sys\\\" είναι αρχείο Microsoft που προστατεύεται από πνευματικά δικαιώματα, επομένως δεν μπορούμε να ενσωματώσουμε νόμιμα ένα αντίγραφο του αρχείου στην εφαρμογή ...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Επειδή το MBR έχει επιλεγεί για το σχήμα διαμέρισης, ο Rufus μπορεί να δημιουργήσει ένα διαμέρισμα έως 2 TB μόνο σε αυτό το μέσο, το οποίο θα αφήσει το %s χώρου στο δίσκο μη διαθέσιμο.\\n\"\n\"\\n\"\n\"Είστε σίγουροι οτι θέλετε να συνεχίσετε?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Εκδοχή\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Κυκλοφορία\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Έκδοση\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Γλώσσα\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Αρχιτακτονική\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Συνέχεια\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Πίσω\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Παρακαλώ περιμένετε...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Λήψη με τη χρήση περιηγητή\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Η λήψη των ISO των Windows δεν είναι διαθέσιμη επειδή η Microsoft έχει τροποποιήσει τον ιστότοπό της για να την αποτρέψει.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Το PowerShell 3.0 ή νεότερη έκδοση απαιτείται για να εκτελέσετε αυτήν τη δέσμη ενεργειών.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Θέλετε να συνδεθείτε στο διαδίκτυο και να το κατεβάσετε;\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Εκτελείται ληφθέν αρχείο...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Λήψη αρχείου ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Επιλέξτε τον τύπο του υπολογιστή που θα χρησιμοποιήσετε μετά, για την εγκατάσταση του περιεχομένου του δίσκου με δυνατότητα εκκίνησης. Είναι δική σας αρμοδιότητα να γνωρίζετε άν θέλετε να προβείτε σε εγκατάσταση BIOS ή UEFI, ειδάλλως θα αποτύχει η εκκίνηση.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"Άν επιλέξετε 'UEFI-CSM' η συσκευή θα μιμηθεί την εκκίνηση για BIOS εντός UEFI (όχι native)\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"Άν επιλέξετε 'εκτός από CSM' η συσκευή θα τρέχει μόνο σε UEFI συστήματα (native)\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Μοτίβο δοκιμής: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Μοτίβο δοκιμής: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Μοτίβο δοκιμής: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Μοτίβο δοκιμής: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Ρυθμίζει το επιθυμητό σύστημα αρχείων\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Το ελάχιστο μέγεθος που κάθε κομμάτι δεδομένων(data block) θα καταλάβει στο σύστημα αρχείων\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Χρησιμοποιήστε αυτό το πεδίο για να ορίσετε την ετικέτα της μονάδας δίσκου.\\n\"\n\"Γίνονται δεκτοί διεθνείς χαρακτήρες.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Εμφάνιση επιλογών για προχωρημένους\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Ελέγξτε τη συσκευή για κατεστραμμένους τομείς χρησιμοποιώντας το μοτίβο δοκιμής\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Αποεπιλέξτε αυτό το πλαίσιο για να χρησιμοποιήσετε την \\\"αργή\\\" μέθοδο διαμόρφωσης\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Επιλογή μεθόδου για την δημιουργία διαμερισμών δίσκου\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Η μέθοδος που θα χρησιμοποιηθεί για να δημιουργηθεί ο δίσκος με δυνατότητα εκκίνησης\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Κάντε κλικ για να επιλέξετε ή να κατεβάσετε ένα αρχείο...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Επιλέξτε αυτό το πλαίσιο για να επιτραπεί η εμφάνιση των διεθνών ετικετών και ο ορισμός ενός εικονιδίου συσκευής (δημιουργείτε ένα autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Εγκαταστήστε UEFI bootloader, ο οποίος θα εκτελέσει την επικύρωση του αρχείου MD5Sum των μέσων\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Δημιουργία ενός επιπλέον κρυφού διαμερίσματος και προσπάθεια ευθυγράμμισης των ορίων των διαμερισμάτων.\\n\"\n\"Μπορεί να βελτιώσει την ανίχνευση εκκίνησης για παλαιότερα BIOS.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Ενεργοποίηση της εμφάνισης σκληρών δίσκων USB. Η χρήση γίνεται με δική σας ευθύνη!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Εκκίνηση της λειτουργίας διαμόρφωσης.\\n\"\n\"Η λειτουργία θα διαγράψει όλα τα υπάρχοντα δεδομένα από την επιλεγμένη συσκευή!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Η υπογραφή του αρχείου λήψης δεν είναι έγκυρη\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Κάντε κλικ για επιλογή...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Μία αξιόπιστη εφαρμογή διαμόρφωσης USB\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Εκδοχή %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Μετάφραση στα ελληνικά:\\\\line• Konstantinos Margaritis <mailto:kotsos.marga@gmail.com>\\\\line• Nikolaos Margaritis <mailto:marga.nikos@gmail.com>\\\\line• Alex F. <mailto:alirael@outlook.com>\\\\line• Christos Alvanos <mailto:chrisalvanos17@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Για αναφορά σφαλμάτων ή βελτιώσεων επισκεφθείτε το:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Επιπλέον Πνευματικά δικαιώματα:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Πολιτική ενημέρωσης:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Εάν επιλέξετε να επιτρέψετε στο πρόγραμμα να ελέγχει για ενημερώσεις, συμφωνείτε ότι οι ακόλουθες πληροφορίες μπορεί να συλλεχθούν στους διακομιστές μας:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Η αρχιτεκτονική και η εκδοχή του λειτουργικού σας συστήματος\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Η εκδοχή της εφαρμογής που χρησιμοποιείτε\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Η διεύθυνση διαδικτυακού πρωτοκόλλου(IP) σας\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Όλες αυτές οι πληροφορίες συλλέγονται με σκοπό τη δημιουργία ιδιωτικών στατιστικών χρήσης και μπορεί να παραμείνουν αποθηκευμένες \\\\b το μέγιστο για ένα χρόνο\\\\b0 . Ωστόσο, σε καμία περίπτωση δεν θα αποκαλύψουμε οποιαδήποτε από αυτά τα ατομικά σας στοιχεία σε τρίτους.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Διαδικασία ενημέρωσης:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Το Rufus δεν εγκαθιστά και δεν εκτελεί υπηρεσίες στο παρασκήνιο, ως εκ τούτου οι έλεγχοι ενημέρωσης εκτελούνται μόνο όταν η κύρια εφαρμογή εκτελείται.\\\\line\\n\"\n\"Απαιτείται σύνδεση στο διαδίκτυο για να ελέγξετε για ενημερώσεις.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Μη έγκυρο είδωλο για τρέχων επιλογή εκκίνησης\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Το είδωλο δεν ταιριάζει με την τρέχων επιλογή εκκινησης. Παρακαλώ χρησιμοποιήστε κάποιο άλλο είδωλο ή διαφορετική επιλογή εκκίνησης.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Αυτό το είδωλο ISO δεν είναι συμβατό με το επιλεγμένο σύστημα αρχείων\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Ανιχνεύθηκε μη συμβατός δίσκος\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Πέρασμα εγγραφής\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Πέρασμα ανάγνωσης\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Έγινε λήψη του %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Αποτυχία λήψης του %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Γίνεται χρήση της ενσωματωμένης εκδοχή του/των %s αρχείου/ων\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"Σημαντικό: Αυτή η μονάδα δίσκου χρησιμοποιεί μη προσαρμοσμένο μέγεθος διαμερισμου!\\n\"\n\"\\n\"\n\"Οι συμβατικoί δίσκοι χρησιμοποιούν ένα μέγεθος τομέα 512 byte, αλλά αυτή η μονάδα χρησιμοποιεί %d-byte.Σε πολλές περιπτώσεις, αυτό σημαίνει ότι δεν θα είστε σε θέση να κάνετε εκκινήση από αυτό το δίσκο.\\n\"\n\"Το Rufus θα προσπαθήσει να δημιουργήσει ένα δίσκο με δυνατότητα εκκίνησης, παρόλα αυτά δεν υπάρχει καμία εγγύηση ότι αυτός θα λειτουργήσει.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Ανιχνεύθηκε μη προσαρμοσμένο μέγεθος διαμερισμου\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"Τα 'Windows To Go' μπορούν να εγκαταστηθούν μόνο σε δίσκους με διαμερισμό GPT εάν αυτοί διαθέτουν το χαρακτηριστικό ΄ΣΤΑΘΕΡΟΣ'. Ο επιλεγμενος δίσκος δε διαθέτει αυτο το χαρακτηριστικό.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Αυτή η δυνατότητα δεν είναι διαθέσιμη σε αυτήν την πλατφόρμα.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Ακύρωση - Παρακαλώ περιμένετε...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Σάρωση ειδώλου...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Αποτυχία σάρωσης ειδώλου\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Ανιχνεύθηκε ξεπερασμένο %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Είδωλο σε χρήση: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Το αρχείο %s λείπει\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Νέος Τόμος\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"Βρέθηκε %d συσκευή\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"Βρέθηκαν %d συσκευές\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"Έτοιμο για χρήση\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Ακυρώθηκε\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Απέτυχε\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Εκκίνηση νέας εφαρμογής...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Αποτυχία εκκίνησης νέας εφαρμογής\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Άνοιγμα %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Αποθήκευση %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Διαμόρφωση: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Δημιουργία συστήματος αρχείων: Βήμα %d/%d ολοκληρώθηκε\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Επιδιόρθωση NTFS: %d%% ολοκληρώθηκε\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Γίνεται Διαμόρφωση(%s) - εκτιμώμενη διάρκεια %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Ορισμός ετικέτας (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Διαμόρφωση (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Επιδιόρθωση NTFS (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Εκκαθάριση δομών MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Ζητείται πρόσβαση στο δίσκο...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Αναλύοντας τα υπάρχοντα αρχεία εκκίνησης...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Κλείσιμο υπάρχοντος τόμου...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Εγγραφή Master Boot Record...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Εγγραφή διαμερίσματος εκκίνησης...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Αντιγραφή αρχείων DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Αντιγραφή αρχείων ISO: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Ρυθμίσεις εκκίνησης Win7 EFI (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Οριστικοποίηση, παρακαλώ περιμένετε...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Εγκατάσταση Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Κατεστραμμένοι τομείς: %s %d/%d - %0.2f%% (%d/%d/%d σφάλματα)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Κατεστραμμένοι τομείς: Έλεγχος με τυχαίο διάταξη\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Κατεστραμμένοι τομείς: Έλεγχος με διάταξη 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Διαμερισμός (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Διαγραφή διαμερισμάτων (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Δεν είναι δυνατή η επικύρωση της υπογραφής του αρχείου λήψης. Αυτό μπορεί να σημαίνει ότι το σύστημά σας έχει ρυθμιστεί εσφαλμένα για την επικύρωση υπογραφής αρχείων λήψης ή υποδεικνύει ένα κακόβουλο αρχείο.\\n\"\n\"\\n\"\n\"Το αρχείο λήψης θα διαγραφεί. Παρακαλώ ελέγξτε το αρχείο καταγραφής για περισσότερες λεπτομέρειες.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Γίνετε λήψη: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Η λήψη του αρχείου απέτυχε.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Έλεγχος για ενημερώσεις του Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Ενημερώσεις: Δεν ήταν δυνατή η σύνδεση στο διαδίκτυο\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Ενημερώσεις: Δεν είναι δυνατή η πρόσβαση στα δεδομένα της έκδοσης\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Μια νέα έκδοση του Rufus είναι διαθέσιμη!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Δεν βρέθηκε κάποια νέα έκδοση του Rufus\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Τα κλειδιά μητρώου της εφαρμογής διαγράφηκαν με επιτυχία\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Αποτυχία διαγραφής των κλειδιών μητρώου της εφαρμογής\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s :ενεργό/η\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s :ανενεργό/η\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Έλεγχος μεγέθους\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Ανίχνευση κρυφών σκληρών δίσκων\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Εξαναγκασμένη διαμόρφωση FAT32\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"Το NoDriveTypeAutorun θα διαγραφεί κατά την έξοδο από την εφαρμογή\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Ανίχνευση ψεύτικης μονάδας δίσκου\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Υποστήριξη Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Υποστήριξη Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Εξαναγκασμένη ενημέρωση\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"Συμπίεση NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Εγγραφή ειδώλου: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Υποστήριξη ειδώλου ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Χρησιμοποιήστε ΣΩΣΤΑ μεγέθοι μονάδων\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Διαγραφή καταλόγου '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Ανίχνευση δίσκου VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Λειτουργία UEFI και BIOS (ταυτόχρονα)\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Εγγραφή ειδώλου Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Εγγραφή ειδώλου Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Διατήρηση ημερομηνιών αρχείων\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Έλεγχος USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Υπολογισμός checksums ειδώλου: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Υπολογισμός checksums MD5, SHA1 και SHA256 για το επιλεγμένο είδωλο\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Αλλαγή γλώσσας\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Ανιχνεύθηκε είδωλο τύπου %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Το είδωλο που χρησιμοποιήσατε είναι τύπου 'ISOHybrid'. Αυτό σημαίνει πως μπορεί να εγγραφεί ως %s ή ως %s.\\n\"\n\"Το Rufus συνιστά να κάνετε την εγγραφή ώς %s, για να μπορείτε να έχετε πλήρη πρόσβαση στο δίσκο μετα την εγγραφή.\\n\"\n\"Σε περίπτωση που αντιμετωπίσετε πρόβλημα κατά την εκκίνηση του είδώλου μπορείτε να ξανακάνετε την εγγραφή ως %s.\\n\"\n\"\\n\"\n\"Παρακαλώ επιλέξτε τον τρόπο με τον οποίο θέλετε να κάνετε την εγγραφή του ειδώλου:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Εγγραφή ως %s (Προτεινόμενο)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Εγγραφή ως %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Γίνεται έλεγχος για αντικρουόμενες διαδικασίες...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Δεν διαθέτει δυνατότητα εκκίνησης\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Επιλογή δίσκου ή ειδώλου ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Παρακαλώ Επιλέξτε)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Κλείδωμα μονάδας USB\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Μη έγκυρη ψηφιακή υπογραφή\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Το εκτελέσιμο αρχείο που κατεβάσατε δεν περιλαμβάνει ψηφιακή υπογραφή.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Το εκτελέσιμο αρχείο που κατεβάσατε έχει υπογραφτεί από τον/την '%s'.\\n\"\n\"Αύτη η υπογραφή δεν αναγνωρίζεται από το Rufus. Ενδεχομένως να υπάρχει συσχέτιση με κάποια κακόβουλη προσπάθεια...\\n\"\n\"Είστε σίγουροι ότι θέλετε να εκτελέσετε αυτό το αρχείο?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Άδειασμα δίσκου: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Ανίχνευση μη αφαιρούμενων δίσκων USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Δεν διαθέτετε δικαιώματα διαχειριστή\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Η εφαρμογή απαιτεί δικαιώματα διαχειριστή για να λειτουργήσει\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Φόρτωση στοιχείων αρχείου\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Επιλέξτε εκδοχή\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Παρακαλώ επιλέξτε την εκδοχή των Windows που θέλετε να εγκαταστήσετε:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Μη υποστηριζόμενη εκδοχή Windows\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Το Rufus δεν υποστηρίζει αυτή την εκδοχή των Windows.\\n\"\n\"Η τελευταία έκδοση του Rufus που είναι συμβατή με αυτήν την πλατφόρμα είναι η v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Προσοχή: Ανεπίσημη εκδοχή\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Αυτή η έκδοση του Rufus δεν έχει δημιουργηθεί απο τους επίσημους προγραμματιστές.\\n\"\n\"\\n\"\n\" Είστε σίγουροι οτι θέλετε να εκτελέσετε το πρόγραμμα?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Το αρχείο ISO δεν είναι έγκυρο/ολόκληρο\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Το αρχείο ISO που επιλέξατε δεν ειναι έγκυρο/ολόκληρο. %s από τα δεδομένα του αρχείου λείπουν.\\n\"\n\"\\n\"\n\"Άν κατεβάσατε αυτό το αρχείο απο το διαδίκτυο, προσπαθήστε να επαναλάβετε την λήψη του αρχείου. Βεβαιωθείτε ότι οι MD5 ή SHA σφραγίδες του αρχείου που κατεβάσατε είναι ίδιες με αυτες του αρχειου που θέλατε να κατεβάσετε.\\n\"\n\"\\n\"\n\"Μπορείτε να ελέγξετε τις σφραγίδες MD5 ή SHA μέσω του Rufus πατώντας το κουμπί (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Σφάλμα επικύρωσης χρόνου (timestamp)\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Το Rufus δεν κατάφερε να διαβεβαιώσει ότι η έκδοση αναβάθμισης έχει εκδωθεί σε νεώτερη ημερομηνία απο την έκδοση που έχετε ήδη.\\n\"\n\"\\n\"\n\"Για λόγους ασφαλείας η εγκατάσταση έχει ακυρωθεί και η έκδοση που κατεβάσατε θα διαγραφεί. Για περισσότερες πληροφορίες, ελέγξτε το αρχείο καταγραφής.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Εμφάνιση ρυθμίσεων εφαρμογής\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Εμφάνιση πληροφοριών εφαρφογής\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Εμφάνιση καταγραφών εφαρμογής (log)\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Δημιουργία ειδώλου δίσκου από την επιλεγμένη συσκευή\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Χρησιμοποιήστε αυτήν την επιλογή εάν σκοπεύετε να εγκαταστήσετε τα Windows σε διαφορετικό δίσκο ή εάν θέλετε να εκτελέσετε τα Windows απευθείας από αυτήν τη μονάδα δίσκου (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Γρήγορος μηδενισμός μονάδας δίσκου: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"η διαδικασία ίσως διαρκέσει αρκετά\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Εντοπισμός VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Συμπιεσμένο αρχείο\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Το ISO που επιλέξατε χρησιμοποιεί UEFI και είναι αρκετά μικρό ώστε να γραφτεί ως διαμέρισμα συστήματος EFI (ESP). Η εγγραφή σε ένα ESP, αντί της εγγραφής σε ένα διαμέρισμα γενικών δεδομένων που καταλαμβάνει ολόκληρο τον δίσκο, μπορεί να είναι προτιμότερο για ορισμένους τύπους εγκαταστάσεων.\\n\"\n\"\\n\"\n\"Παρακαλούμε επιλέξτε τη λειτουργία που θέλετε να χρησιμοποιήσετε για να γράψετε αυτή την εικόνα:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Χρησιμοποιήστε %s (στο κύριο παράθυρο της εφαρμογής) για ενεργοποίηση.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Επιπλέον hashes (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Αποθήκευση σε VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Υπολογίστε αθροίσματα ελέγχου εικόνας\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Πολλαπλά κουμπιά\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Αριθμός περασμάτων\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID δίσκου\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Προεπιλεγμένη προτεραιότητα πυρήνα %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Αγνοήστε τον Boot marker\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Ανανέωση διάταξης διαμερισμάτων (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Η εικόνα που επιλέξατε είναι ISOHybrid, αλλά οι δημιουργοί της δεν την έχουν κάνει συμβατή με τη λειτουργία αντιγραφής ISO/Αρχείου.\\n\"\n\"Ως αποτέλεσμα, θα επιβληθεί η λειτουργία εγγραφής εικόνας DD.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Δεν είναι δυνατό το άνοιγμα ή η ανάγνωση του '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Εφαρμογή προσαρμογής των Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Εφαρμογή επιλογών χρήστη...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Εμπειρία χρήστη των Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Προσαρμογή εγκατάστασης των Windows;\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Κατάργηση απαίτησης για 4 GB+ RAM, Ασφαλής εκκίνηση και TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Καταργήστε την απαίτηση για έναν ηλεκτρονικό λογαριασμό Microsoft\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Απενεργοποίηση συλλογής δεδομένων (Παράβλεψη ερωτήσεων απορρήτου)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Αποτρέψτε την πρόσβαση των Windows To Go σε εσωτερικούς δίσκους\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Δημιουργήστε έναν τοπικό λογαριασμό με όνομα χρήστη:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Ορίστε τις τοπικές επιλογές στις ίδιες τιμές με αυτές του χρήστη\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Απενεργοποιήστε την αυτόματη κρυπτογράφηση συσκευής BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Διατήρηση log\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Πρέπει να γίνει λήψη ενός πρόσθετου αρχείου ('diskcopy.dll') από τη Microsoft για να εγκαταστήσετε το MS-DOS:\\n\"\n\"- Επιλέξτε 'Ναι' για να συνδεθείτε στο Internet και να το κατεβάσετε\\n\"\n\"- Επιλέξτε 'Όχι' για να ακυρώσετε τη λειτουργία\\n\"\n\"\\n\"\n\"Σημείωση: Το αρχείο θα ληφθεί στον κατάλογο της εφαρμογής και θα επαναχρησιμοποιηθεί αυτόματα εάν υπάρχει.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Εντοπίστηκε ανακληθέν bootloader UEFI\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Ο Rufus εντόπισε ότι το ISO που επιλέξατε περιέχει έναν bootloader UEFI που έχει ανακληθεί και θα παράγει %s, όταν η Ασφαλής Εκκίνηση είναι ενεργοποιημένη σε ένα πλήρως ενημερωμένο σύστημα UEFI.\\n\"\n\"\\n\"\n\"- Εάν λάβατε αυτήν την εικόνα ISO από μη αξιόπιστη πηγή, θα πρέπει να εξετάσετε το ενδεχόμενο να περιέχει κακόβουλο λογισμικό UEFI και να αποφύγετε την εκκίνηση από αυτό.\\n\"\n\"- Εάν το λάβατε από αξιόπιστη πηγή, θα πρέπει να προσπαθήσετε να εντοπίσετε μια πιο ενημερωμένη έκδοση, η οποία δεν θα παράγει αυτήν την προειδοποίηση.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"μια οθόνη \\\"Παραβίαση ασφαλείας\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"μια οθόνη αποκατάστασης των Windows (BSOD) με '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Συμπιεσμένη εικόνα VHDX\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Μη συμπιεσμένη εικόνα VHDX\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Full Flash Update Image\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Ορισμένα πρόσθετα δεδομένα πρέπει να ληφθούν από τη Microsoft για να χρησιμοποιήσετε αυτήν τη λειτουργία:\\n\"\n\"- Επιλέξτε 'Ναι' για να συνδεθείτε στο Internet και να τα κατεβάσετε\\n\"\n\"- Επιλέξτε 'Όχι' για να ακυρώσετε τη λειτουργία\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Περιορισμός των Windows σε S-Mode (ΑΣΥΜΒΑΤΟ με ηλεκτρονική παράκαμψη λογαριασμού)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Λειτουργία ειδικού\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Εξαγωγή αρχείων: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Χρησιμοποίηση του Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Το Rufus είναι ένα βοηθητικό πρόγραμμα που βοηθά στη διαμόρφωση και τη δημιουργία μονάδων flash USB με δυνατότητα εκκίνησης, όπως κλειδιά USB/pendrives,κάρτες μνήμης κ.λπ.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Επίσημος ιστότοπος: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Πηγαίος κώδικας: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Αρχείο καταγραφής αλλαγών: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Αυτή η εφαρμογή έχει άδεια χρήσης σύμφωνα με τους όρους της GNU Public License (GPL) έκδοση 3.\\n\"\n\"Δείτε https://www.gnu.org/licenses/gpl-3.0.html για λεπτομέρειες.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Μορφοποίηση USB, κάρτας flash και εικονικών μονάδων δίσκου σε FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Δημιουργήστε μονάδες USB με δυνατότητα εκκίνησης FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Δημιουργήστε εκκινήσιμες μονάδες από ISO με δυνατότητα εκκίνησης (Windows, Linux, κ.λπ.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Δημιουργήστε μονάδες εκκίνησης από εικόνες δίσκου με δυνατότητα εκκίνησης, συμπεριλαμβανομένων συμπιεσμένων\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Δημιουργήστε μονάδες δίσκου με δυνατότητα εκκίνησης BIOS ή UEFI, συμπεριλαμβανομένων NTFS με δυνατότητα εκκίνησης UEFI\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Δημιουργήστε μονάδες δίσκου \\\"Windows To Go\\\"\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Δημιουργήστε μονάδες εγκατάστασης των Windows 11 για υπολογιστές που δεν διαθέτουν TPM ή Ασφαλή Εκκίνηση\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Δημιουργήστε μόνιμα διαμερίσματα Linux\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Δημιουργήστε εικόνες VHD/DD της επιλεγμένης μονάδας δίσκου\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Υπολογίστε τα αθροίσματα ελέγχου MD5, SHA-1, SHA-256 και SHA-512 της επιλεγμένης εικόνας\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Εκτελέστε ελέγχους εσφαλμένων block, συμπεριλαμβανομένου του εντοπισμού \\\"ψευδών\\\" μονάδων flash\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Κατεβάστε τα επίσημα retail ISO των Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Κατεβάστε τα ISO Shell UEFI\"\n"
  },
  {
    "path": "res/loc/po/es-ES.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-09 12:54-0300\\n\"\n\"PO-Revision-Date: 2024-05-09 12:58-0300\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: es_ES\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Spanish (Español)\\n\"\n\"X-Rufus-LCID: 0x040a, 0x080a, 0x0c0a, 0x100a, 0x140a, 0x180a, 0x1c0a, 0x200a, 0x240a, 0x280a, 0x2c0a, 0x300a, 0x340a, 0x380a, 0x3c0a, 0x400a, 0x440a, 0x480a, 0x4c0a, 0x500a, 0x540a, 0x580a\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Propiedades de la unidad\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Dispositivo\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Elección de arranque\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Seleccionar\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Opciones de imagen\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Esquema de partición\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Sistema de destino\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Listar los discos duros USB\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Agrega correcciones para BIOS viejos (partición extra, alineación, etc.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Habilitar la validación de medios UEFI en tiempo de ejecución\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Opciones de formateo\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Sistema de archivos\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Tamaño del clúster\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Etiqueta de volumen\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Formateo rápido\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Buscar bloques dañados en dispositivo\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Añadir etiquetas extendidas e iconos\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Estado\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Cerrar\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Empezar\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Acerca de Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licencia\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Licencia de Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Más información\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Sí\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Historial de eventos\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Borrar\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Guardar\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Actualizar la política y configuración\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Configuraciones\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Buscar actualizaciones\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Incluir versiones beta\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Buscar ahora\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Buscar actualizaciones de Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Hay una nueva versión disponible. ¡Por favor, descargue la última versión!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Haga clic aquí para ir al sitio web de Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Notas relativas a esta versión\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Descarga\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Se detectó otra instancia\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Ya existe una instancia de Rufus ejecutándose.\\n\"\n\"Cierre la primera instancia antes de ejecutar otra.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"ADVERTENCIA: TODOS LOS DATOS EN LA UNIDAD %s SERÁN ELIMINADOS.\\n\"\n\"Para continuar, haga clic en OK. Para detener la operación, haga clic en CANCELAR.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Política de actualización de Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"¿Quieres permitir que Rufus busque actualizaciones en línea?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Cancelar\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Se encontraron bloques defectuosos\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Verificación completa: se encontraron %d bloques dañados\\n\"\n\"  %d errores de lectura\\n\"\n\"  %d errores de escritura\\n\"\n\"  %d errores de corrupción\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"El informe detallado se puede encontrar en:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Deshabilitado\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Diario\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Semanalmente\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Mensualmente\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Personalizado\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Su versión: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Última versión: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Por defecto\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Por defecto)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (o UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (no CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS o UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d pasada\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d pasadas %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Imagen ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Aplicación\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Abortar\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Lanzar\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operación cancelada por el usuario\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Descarga de archivo\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Dispositivo de almacenamiento USB (Genérico)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Disco %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Particiones múltiples\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Purgando los buffers\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Cancelación\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Éxito.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Error indeterminado durante el formateo.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"No se puede usar el sistema de archivos seleccionado para este dispositivo.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"No se permite el acceso al dispositivo.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"El dispositivo está protegido contra escritura.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"El dispositivo está en uso por otra aplicación. Cierre todas las aplicaciones que puedan estar usando el dispositivo.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"El formateo rápido no está disponible para este dispositivo.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"La etiqueta de volumen no es válida.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"El gestor de dispositivo no es válido.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"El tamaño de clúster indicado no es válido para este dispositivo.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"El tamaño del volúmen no es válido.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Inserte un dispositivo en la unidad.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Se ha recibido un comando no compatible.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Error en la asignación de memoria.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Error de lectura.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Error de escritura.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Fallo en la instalación\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Imposible abrir el medio - otro proceso lo está usando. Desconecte y vuelva a conectar la unidad, luego inténtelo nuevamente.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"No se pudo particionar la unidad.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"No se pudieron copiar los archivos al dispositivo destino.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Cancelado por el usuario.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"No se pudo crear el hilo.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"La verificación de bloques defectuosos ha sido interrumpida.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Falló el análisis de la imagen ISO.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Falló la extracción de la imagen ISO.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"No se pudo volver a montar el volumen.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Imposible parchear/configurar ficheros de arranque.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"No se pudo asignar una letra de unidad.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"No se pudo montar el volumen GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"El dispositivo no está listo.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus detectó que Windows aún está purgando sus buffers internos en el dispositivo USB.\\n\"\n\"\\n\"\n\"Dependiendo de la velocidad de su dispositivo USB, esta operación puede tomar mucho tiempo en finalizar, especialmente en archivos grandes.\\n\"\n\"\\n\"\n\"Recomendamos que deje a Windows terminar para que no se corrompa la integridad del USB; Pero si se cansa de esperar, puede simplemente desconectar el dispositivo...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Tipo de imagen no soportada\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Esta imagen ISO, o no es autoarrancable, o usa un método de arranque o compresión que no es soportado por Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"¿Reemplazar %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Esta imagen ISO parece que usa una versión obsoleta del archivo '%s'.\\n\"\n\"Esto puede hacer que los menús de arranque no se muestren correctamente.\\n\"\n\"\\n\"\n\"Rufus puede descargar una versión más reciente para resolver este problema:\\n\"\n\"- Seleccione 'Sí' para conectarse al Internet y descargar el archivo\\n\"\n\"- Seleccione 'No' para dejar el archivo ISO tal como está\\n\"\n\"Si no sabe qué hacer, se recomienda seleccionar 'Sí'.\\n\"\n\"\\n\"\n\"Nota: El nuevo archivo se descargará en el directorio actual, en el momento que un archivo\\n\"\n\" '%s' exista ahí, será usado automáticamente.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Descargando %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"No hay imagen ISO seleccionada\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"para NAND %s\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Imagen ISO demasiado grande\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"La imagen ISO es demasiado grande para el destino seleccionado.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"ISO no soportado\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Cuando se usa UEFI como tipo de destino, sólo se soportan imágenes ISO de ejecución automática tipo EFI. Seleccione una imagen de ejecución automática ISO de tipo EFI o cambie el tipo de destino a BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Sistema de archivos no soportado\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"¡¡¡IMPORTANTE: ESTE DISCO CONTIENE MÚLTIPLES PARTICIONES!!!\\n\"\n\"\\n\"\n\"Esto puede incluir particiones/volúmenes no mostrados o incluso visibles por Windows. Si desea continuar con el proceso, se hace responsable de cualquier pérdida de datos en esas particiones.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Detectadas múltiples particiones\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"Imagen DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"El sistema de ficheros seleccionado no puede usarse con este tipo de imagen ISO Por favor, seleccione un sistema de ficheros distinto o use otra ISO.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' sólo puede aplicarse si el sistema de ficheros es NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"IMPORTANTE: Está intentando instalar 'Windows To Go', pero la unidad destino no tiene el atributo 'FIXED' (fijo). Debido a esto es muy probable que Windows se detenga en el arranque ya que Microsoft no lo ha diseñado para funcionar con unidades que tengan el atributo 'REMOVABLE' (extraible) \\n\"\n\"\\n\"\n\"¿Desea continuar con el proceso?\\n\"\n\"\\n\"\n\"Nota: El atributo 'FIXED/REMOVABLE' es una propiedad hardware que sólo se puede cambiarusando herramientas del fabricante. Sin embargo estas herramientas CASI NUNCA se facilitan al público...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Limitación del sistema de archivos\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Esta imagen ISO contiene un archivo de más de 4 GB, sobrepasando el tamaño máximo permitido para un sistema de archivos FAT o FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"El soporte para archivos WIM no está disponible\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Su plataforma no puede extraer archivos de ficheros comprimidos WIM. La extracción de ficheros desde archivos WIM es necesaria para crear dispositivos USB arrancables tipo EFI con Windows 7 y Windows Vista.Puede solucionar esto instalando una versión reciente de 7-Zip.\\n\"\n\"¿Desea visitar la página de descargas de 7-zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"¿Descargar %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s o posterior requiere que esté instalado un archivo '%s'.\\n\"\n\"Dado que este archivo pesa más de 100 KB y siempre está presente en las \\n\"\n\"imágenes ISO %s, Rufus no lo incluye en su distribución.\\n\"\n\"\\n\"\n\"Rufus puede descargar el archivo que falta:\\n\"\n\"- Seleccione 'Sí' para conectarse a Internet y descargar el archivo\\n\"\n\"- Seleccione 'No' si desea copiar manualmente este archivo en la unidad después\\n\"\n\"\\n\"\n\"Nota: El archivo será descargado en la carpeta actual y en el momento que exista el \\n\"\n\" archivo '%s' ahí, volverá a usarse automáticamente.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Cancelar ahora puede dejar el dispositivo en un estado INUTILIZABLE.\\n\"\n\"Si está seguro de cancelar, seleccione SÍ. De lo contrario, seleccione NO.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Seleccione una carpeta\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Todos los archivos\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Registro de eventos de Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Disco %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS no puede arrancar desde un disco con un tamaño de clúster de 64 kilobytes.\\n\"\n\"Por favor cambie el tamaño del clúster o use FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Tamaño de clúster incompatible\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Dar formato a un volumen UDF de gran tamaño puede tomar mucho tiempo. A la velocidad de USB 2.0, el tiempo estimado de formateo es %d:%02d, durante el cual la barra de progreso parecerá no moverse. ¡Por favor, sea paciente!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Volumen UDF de gran tamaño\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Esta imagen usa Syslinux %s%s pero este programa sólo incluye los ficheros de instalación para Syslinux %s%s.\\n\"\n\"\\n\"\n\"Debido a que las nuevas versiones de Syslinux no son compatibles entre si, y no es posible para Rufus incluirlas todas, se deben descargar dos ficheros adicionales de internet ('ldlinux.sys' y 'ldlinux.bss'):\\n\"\n\"- Elije 'Si' para conectarse a internet y descargar estos ficheros\\n\"\n\"- Elije 'No' para cancelar la operación\\n\"\n\"\\n\"\n\"Nota: Los ficheros se descargarán en la carpeta actual y volverán a usarse automáticamente si se encuentran.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Descarga requerida\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Esta imagen hace uso de Grub %s pero este programa sólo incluye los ficheros de instalación para Grub %s.\\n\"\n\"\\n\"\n\"Debido a que las diferentes versiones de Grub no son compatibles entre sí, y no es posible incluir todas, Rufus intentará encontrar una versión del fichero de instalación de Grub 'core.img' que se adecue con el de su imagen ISO:\\n\"\n\"- Elija 'Si' para conectarse a internet e intentar descargarlo\\n\"\n\"- Elija 'No' para usar la versión por defecto de Rufus\\n\"\n\"- Elija 'Cancelar' para cancelar la operación\\n\"\n\"\\n\"\n\"Nota: El fichero será descargado en la carpeta de ejecución del programa y volverá a usarse automáticamente si se encuentra.Si no se puede encontrar el fichero en línea se usará la versión por defecto.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Instalación de Windows estandar\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"propiedades avanzadas de la unidad\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"opciones avanzadas de formato\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Mostrar %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Ocultar %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Tamaño de partición persistente\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"No persistente\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Establece el tamaño de la partición persistente para el medio USB autoarrancable. Estableciendo un valor 0 deshabilita la partición persistente.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Establece la unidad de tamaño de partición.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"No volver a mostrar este mensaje\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Aviso importante respecto %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Has creado un sistema que usa un bootloader UEFI:NTFS. Por favor, recuerda que para arrancar con este dispositivo, SECURE BOOT DEBE ESTAR DESACTIVADO.\\n\"\n\"Para más detalles respecto a porqué es necesario, use el siguiente botón \\\"Más información\\\".\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Selección de imagen de Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Esta ISO contiene múltiples imágenes de Windows.\\n\"\n\"Por favor, seleccione la imagen que desea usar para esta instalación:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Otro programa o proceso está accediendo a esta unidad. ¿Deseas formatearlo de todas formas?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus ha detectado que estás intentando crear un medio en Windows To Go basado en la ISO 1809.\\n\"\n\"\\n\"\n\"Debido a un *FALLO DE MICROSOFT*, este medio no arrancará al iniciar Windows (Pantallazo Azul de la Muerte), a no ser que manualmente reemplaces el fichero 'WppRecorder.sys' con la versión 1803.\\n\"\n\"\\n\"\n\"Ten en cuenta que el motivo por el que Rufus no puede arreglar esto automáticamente es debido a que el fichero 'WppRecorder.sys' es un fichero con copyright, por lo que legalmente no podemos añadir una copia del fichero en la aplicación...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Debido a que has seleccionado MBR para el sistema de particiones, Rufus sólo puede crear una partición de hasta 2TB en este dispositivo, lo que dejará %s del disco no disponibles.\\n\"\n\"\\n\"\n\"¿Estas seguro de que deseas continuar?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Versión\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Emisión\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Edición\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Idioma\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Arquitectura\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Continuar\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Atrás\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Espere por favor...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Descargar usando un navegador\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"La descarga de ISO de Windows no está disponible debido a que Microsoft modificó su sitio web para evitarlo.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Se requiere PowerShell 3.0 o posterior para ejecutar este script.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"¿Desea descargar la versión on-line?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Ejecutando script descargado...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Descargar Imagen ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"El tipo de sistema donde desea usar este dispositivo autoarrancable. Es su responsabilidad determinar si el equipo es BIOS o UEFI antes de empezar la creación del dispositivo, si no es la correcta posiblemente no funcione.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' significa que el dispositivo sólo arrancará en modo UEFI con emulación de BIOS (también conocido como 'Legacy Mode'), y no en modo UEFI nativo.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'no CSM' significa que el dispositivo sólo arrancará en modo UEFI nativo, y no en modo emulación de BIOS (también conocido como 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Patrón de pruebas: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Patrón de pruebas: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Patrón de pruebas: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Patrón de pruebas: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Seleccione el sistema de archivos destino\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Tamaño mínimo que un bloque de datos ocupará en el sistema de archivos\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Use este campo para establecer el nombre del volumen.\\n\"\n\"Se aceptan caracteres internacionales.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Mostrar opciones avanzadas\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Revisa el dispositivo buscando bloques defectuosos aplicando un patrón de pruebas\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Desmarque esta opción para usar el método \\\"lento\\\" de formateo\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Método a usar para crear particiones\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Método a usar para hacer que la unidad sea de ejecución automática\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Haga clic para seleccionar una imagen ISO...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Seleccione esta opción para permitir que se muestren caracteres internacionales y establecer un icono para la unidad (crea un archivo autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Instale un gestor de arranque UEFI, que realizará la validación del archivo MD5Sum del medio\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Crea una partición oculta extra y trata de alinear los límites de las particiones.\\n\"\n\" Esto puede mejorar la detección de dispositivos de arranque en las BIOS antiguas.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Activa la detección de discos duros externos USB. ¡¡¡ÚSESE BAJO SU PROPIO RIESGO!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Comienza la operación de formateo.\\n\"\n\"¡Todos los datos en el dispositivo elegido serán DESTRUIDOS!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Firma de descarga inválida\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Haga clic para seleccionar...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus, la herramienta de formateo de USBs en la que puedes confiar\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Versión %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Traducción al español:\\\\line• José Pineda <mailto:battletroll@gmail.com>\\\\line• MaKK <mailto:jordikab@gmail.com>\\\\line• Marco A. Ramirez Madrid <mailto:rastrillin@hotmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Para indicar fallos o sugerir mejoras, acceda a:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Derechos de autor adicionales:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Política de actualización:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Si usted autoriza que este programa busque e instale actualizaciones por sí mismo acepta que la siguiente información pueda ser recogida en nuestros servidores:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Arquitectura y versión de su sistema operativo\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"La versión de la aplicación que posee\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Su dirección IP\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"A fin de generar estadísticas de uso privadas, la información recogida puede ser retenida \\\\b como mucho hasta un año\\\\b0 . A menos que así sea requerido por la ley, no transmitiremos nada de esta información a terceros.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Proceso de actualización:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus no instala ni ejecuta ningún servicio ni tarea programada. Por tanto la búsqueda de actualizaciones sólo se realiza cuando la aplicación principal se está ejecutando.\\\\line\\n\"\n\"Se requiere acceso a Internet.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Imagen ISO no válida para la opción de arranque seleccionada\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"La imagen actual no coincide con la opción de arranque elegida. Por favor use otra imagen o seleccione una opción de arranque distinta.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Esta imagen ISO no es compatible con el sistema de archivos seleccionado\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Dispositivo incompatible detectado\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Barrido de escritura\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Barrido de lectura\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Descargado %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"No se ha podido descargar %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Usando la versión integrada de/los fichero/s %s\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"¡IMPORTANTE: ESTE DISPOSITIVO USA UN TAMAÑO DE SECTOR NO ESTÁNDARD!\\n\"\n\"\\n\"\n\"Los dispositivos convencionales usan un tamaño de sector de 512 bytes, pero esta unidad usa un tamaño de %d bytes.En muchos casos esto significa que NO podrás arrancar desde este dispositivo. \\n\"\n\"Rufus puede intentar crear un dispositivo arrancable, pero NO SE GARANTIZA que funcione.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Detectado tamaño de sector no estándar\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' sólo puede ser instalado en una partición GPT si tiene el atributo FIXED activo. El dispositivoactual no ha sido detectado como FIXED.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Esta función no está disponible en esta plataforma.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Cancelando - por favor espere...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Analizando la imagen...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Fallo al analizar la imagen\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"El archivo %s está obsoleto\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Usando la imagen ISO: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Falta el archivo %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Etiqueta del volumen\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d dispositivo encontrado\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d dispositivos encontrados\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"PREPARADO\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"CANCELADO\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"FALLO al realizar la operación\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Lanzando la nueva aplicación...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Error al lanzar la nueva aplicación\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"%s abierto\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"%s guardado\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formateando: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Creando sistema de archivos: Tarea %d/%d completa\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Arreglo en NTFS: %d%% completo\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formateando (%s) - duración estimada %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Escribiendo la etiqueta del volumen (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formateando (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Arreglos en NTFS (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Limpiando las estructuras MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Solicitando acceso al disco...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analizando las estructuras de arranque existentes...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Cerrando el volumen existente...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Escribiendo el registro maestro de arranque (Master Boot Record)...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Escribiendo el registro de arranque de la partición (Partition Boot Record)...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Copiando archivos DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Copiando archivos ISO: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Configuración de arranque Win7 EFI (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Finalizando, por favor espere...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Instalando Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Bloques dañados: %s %d/%d - %0.2f%% (%d/%d/%d errores)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Bloques dañados: Probando con patron aleatorio\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Bloques dañados: Probando con el patrón 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Particionando (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Borrando particiones (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"La firma de la actualización descargada no puede ser validada. Esto puede significar que tu sistema está configurado inapropiadamente para la validación de firmas o indicar una descarga maliciosa.\\n\"\n\"\\n\"\n\"La descargas será borrada. Revise el registro para más detalles.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Descargando: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Error al descargar el archivo.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Buscando actualizaciones de Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Actualizaciones: No es posible conectarse a Internet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Actualizaciones: No es posible acceder a la información de posibles actualizaciones\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"¡Hay una nueva versión de Rufus disponible!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"No hay nuevas versiones de Rufus\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Claves de la aplicación eliminadas del registro con éxito\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"No se han podido eliminar las claves de la aplicación del registro\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s activado\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s desactivado\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Verificación de tamaño\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Detección de discos duros\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Forzar formateo FAT32 largo\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"Se eliminará NoDriveTypeAutorun al salir\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Simulación de la detección del dispositivo\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Soporte a Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Soporte a Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Forzar actualización\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"Compresión NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Escribiendo imagen: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Soporte ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Usar tamaños de unidad ADECUADOS\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Eliminando directorio '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Detección de discos VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Modo dual EFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Aplicando imagen Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Aplicando imagen Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Mantener la información de tiempo\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Depuración USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Calculando checksums de la imagen: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Calcular los checksums MD5, SHA1 y SHA256 para la imagen seleccionada\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Cambiar idioma\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Imagen %s detectada\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"La imagen que ha seleccionado es una imagen de tipo 'ISOHybrid', esto significa que puede ser escrita tanto en modo %s (copia de fichero) o modo %s (imagen de disco).\\n\"\n\"Rufus recomienda usar el modo %s , así siempre podrás tener acceso completo a la unidad tras escribir en ella.\\n\"\n\"Sin embargo, si encuentra problemas durante el arranque, puede intentar escribir de nuevo esta imagen en modo %s.\\n\"\n\"\\n\"\n\"Por favor, selecciona el modo en el que quiere escribir esta imagen:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Escribir en modo %s (Recomendado)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Escribir en modo %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Comprobando si hay procesos en conflicto...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"No auto-ejecutable\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disco o imagen ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Elija por favor)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Dispositivo USB bloqueado de forma exclusiva\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Firma no válida\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"El ejecutable descargado carece de firma digital.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"El ejecutable descargado está firmado por '%s'.\\n\"\n\"No reconocemos este tipo de firma y podría indicar alguna forma de actividad maliciosa...\\n\"\n\"¿Está seguro que desea ejecutar este fichero?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Borrando a ceros la unidad: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Detección de unidades extraibles no USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Falta elevación de permisos\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Esta aplicación sólo puede funcionar con elevación de permisos\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Indexando fichero\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Selección de versión\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Por favor seleccione la versión de Windows que desea instalar:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Versión de Windows no soportada\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Esta versión de Windows ya no es compatible con Rufus.\\n\"\n\"La última versión de Rufus compatible con esta plataforma es v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Atención: Versión no oficial\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Esta versión de Rufus NO ha sido generada por su(s) desarrollador(es) oficial(es).\\n\"\n\"\\n\"\n\"¿Está seguro de que desea ejecutarlo?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Se ha detectado una ISO truncada\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"El fichero ISO seleccionado no tiene su tamaño declarado: ¡Falta un %s de los datos!\\n\"\n\"\\n\"\n\"Si has obtenido este fichero de Internet, deberías intentar una nueva descarga y verificar que los checksum MD5 y SHA coinciden con los originales.\\n\"\n\"\\n\"\n\"Puedes calcular los valores MD5 o SHA con Rufus, desde el botón (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Error al validar la marca de hora\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus no ha podido verificar si la marca de tiempo de la actualización descargada es más reciente queel ejecutable actual.\\n\"\n\"\\n\"\n\"Con objeto de prevenir una situación potencial de ataque, el proceso de actualizaciónse ha abortado y la descarga será eliminada. Por favor revise el registro para más detalles.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Mostrar parámetros de la aplicación\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Mostrar información de la aplicación\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Mostrar el registro\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Crear una imagen de disco del dispositivo seleccionado\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Use esta opción para indicar si desea usar este dispositivo para instalar Windows en otro disco, o si quiere ejecutar Windows directamente desde esta unidad (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Borrando a ceros la unidad de forma rápida: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"esto puede tardar un rato\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Detección VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Archivo comprimido\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"La ISO seleccionada usa UEFI y es lo suficientemente pequeña para ser escrita como un sistema de partición EFI (ESP). Escribiendo como ESP en lugar de como una partición de datos genérica (ocupando todo el disco), puede ser preferible para algunos tipos de instalación.\\n\"\n\"\\n\"\n\"Por favor, seleccione el modo que quiere usar para escribir esta imagen:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Utilice %s (en la ventana principal de la aplicación) para habilitar.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Extractos (hashes) adicionales (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Guardar como VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Procesar suma de verificación (checksum) de imagen\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Botones múltiples\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Número de pasadas\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID de disco\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Prioridad de hilo (thread) por defecto: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignorar marca de arranque (Boot Marker)\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Actualizando disposición de partición (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"La imagen seleccionada es ISOHybrid, pero sus creadores no la han creado compatible con el modo de copia ISO/FILE.\\n\"\n\"Por consiguiente, se forzará el modo de escritura de imágenes DD.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"No se puede abrir o leer '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Aplicando personalización de Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Aplicando opciones de usuario...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Experiencia de usuario de Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"¿Personalizar la instalación de Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Eliminar el requisito de más de 4 GB de RAM, Arranque seguro y TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Eliminar el requisito de una cuenta de Microsoft en línea\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Deshabilitar la recopilación de datos (Omitir preguntas de privacidad)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Impedir que Windows To Go acceda a los discos internos\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Crear una cuenta local con nombre de usuario:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Establezca las opciones regionales en los mismos valores que las de este usuario\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Deshabilitar el cifrado automático de dispositivos BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Registro persistente\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Se debe descargar un archivo adicional ('diskcopy.dll') de Microsoft para instalar MS-DOS:\\n\"\n\"- Seleccione 'Sí' para conectarse a Internet y descargarlo\\n\"\n\"- Seleccione 'No' para cancelar la operación.\\n\"\n\"\\n\"\n\"Nota: El archivo se descargará en el directorio de la aplicación y se reutilizará automáticamente si está presente.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Se detectó un gestor de arranque UEFI revocado\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus detectó que el ISO que seleccionó contiene un gestor de arranque UEFI que ha sido revocado y que producirá %s, cuando el arranque seguro esté habilitado en un sistema UEFI completamente actualizado.\\n\"\n\"\\n\"\n\"- Si obtuvo esta imagen ISO de una fuente no confiable, debe considerar la posibilidad de que contenga malware UEFI y evitar arrancar desde allí.\\n\"\n\"- Si lo obtuvo de una fuente confiable, debe intentar localizar una versión más actualizada, que no producirá esta advertencia.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"una pantalla de \\\"violación de seguridad\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"una pantalla de recuperación de Windows (BSOD) con '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Imagen VHDX comprimida\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Imagen VHD sin comprimir\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Imagen de actualización completa de Flash\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Se deben descargar algunos datos adicionales de Microsoft para utilizar esta funcionalidad:\\n\"\n\"- Seleccione 'Sí' para conectarse a Internet y descargarlo\\n\"\n\"- Seleccione 'No' para cancelar la operación.\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Restringir Windows al Modo S (INCOMPATIBLE con la omisión de cuenta en línea)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Modo experto\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Extrayendo archivos comprimidos: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Utilice Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus es una utilidad que le ayuda a formatear y crear dispositivos flash booteables, como «pendrives», tarjetas de memoria, etcétera.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Sitio oficial %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Código fuente %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Registro de cambios %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Esta aplicación tiene licencia bajo los términos de la Licencia Pública GNU (GPL) versión 3.\\n\"\n\"Consulte https://www.gnu.org/licenses/gpl-3.0.html para obtener más información.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Arranque\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatee USB, tarjetas flash y unidades virtuales a FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Crear unidades USB de arranque FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Cree unidades de arranque desde ISO de arranque (Windows, Linux, etc.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Cree unidades de arranque a partir de imágenes de disco de arranque, incluidas las comprimidas\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Cree unidades de arranque BIOS o UEFI, incluido NTFS de arranque UEFI\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Cree unidades 'Windows To Go'\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Cree unidades de instalación de Windows 11 para PC que no tienen TPM o Arranque seguro\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Crear particiones persistentes de Linux\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Cree imágenes VHD/DD de la unidad seleccionada\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Calcule las sumas de comprobación MD5, SHA-1, SHA-256 y SHA-512 de la imagen seleccionada\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Realice comprobaciones de bloques defectuosos, incluida la detección de unidades flash \\\"falsas\\\"\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Descargue los ISO oficiales de Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Descargar ISO de UEFI Shell\"\n"
  },
  {
    "path": "res/loc/po/fa-IR.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-04-29 19:24+0300\\n\"\n\"PO-Revision-Date: 2025-02-13 12:00+0000\\n\"\n\"Last-Translator: MasterVito <mv@mvaop.ir>\\n\"\n\"Language-Team: \\n\"\n\"Language: fa_IR\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Persian (پارسی)\\n\"\n\"X-Rufus-LCID: 0x0429\\n\"\n\"X-Generator: Poedit 3.5\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"مشخصات درایو\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"درایو USB (حافظه فلش یا سایر ابزارهای ذخیره‌سازی قابل‌حمل)\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"نوع راه‌اندازی (Boot)\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"انتخاب\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"تنظیمات ایمیج\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"نوع پارتیشن\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"سیستم موردنظر\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"نمایش هارد دیسک‌های اکسترنال در فهرست درایوهای USB موجود\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"بهسازی و اصلاح تنظیمات برای شناسایی بهتر درایو در BIOSهای قدیمی\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"فغال سازی زمان اجرا UEFI media  تایید\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"گزینه‌ها و تنظیمات\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"سیستم فایل\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"اندازه کلاستر\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"نام دلخواه برای درایو USB\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"فرمت کردن سریع (Quick format)\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"بررسی وجود بدسکتور در درایو به روشِ\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"ایجاد آیکون و نام‌گذاری درایو USB با استفاده از فایل autorun.inf\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"وضعیت\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"خروج\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"شروع\"\n\n# To make the output look correct, there are two invisible Unicode directional formatting characters in the line below.\n# • RLE (right-to-left embedding, UTF-8: 0xE2 0x80 0xAB) at the beginning of the string\n# • PDF (pop directional formatting, UTF-8: 0xE2 0x80 0xAC) at the end of the string\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"‫درباره Rufus‬\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"پروانه نرم‌افزار (License)\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"بستن\"\n\n# To make the output look correct, there are two invisible Unicode directional formatting characters in the line below.\n# • RLE (right-to-left embedding, UTF-8: 0xE2 0x80 0xAB) at the beginning of the string\n# • PDF (pop directional formatting, UTF-8: 0xE2 0x80 0xAC) at the end of the string\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"‫پروانه نرم‌افزار Rufus‬\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"اطلاعات بیشتر\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"بله\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"خیر\"\n\n# 'RLE' & 'PDF' are used\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"‫گزارش‌های ثبت‌شده (Log)‬\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"پاک کردن\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"ذخیره\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"سیاست و تنظیمات به‌روزرسانی نرم‌افزار\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"تنظیمات\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"بررسی آپدیت‌های جدید\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"شامل نسخه‌های آزمایشی (Beta)\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"همین الآن بررسی کن\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Rufus بررسی آپدیت‌های جدید و به‌روزرسانی نرم‌افزار\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"نسخه جدیدی از نرم‌افزار موجود است. لطفاً آخرین نسخه نرم‌افزار را دانلود کنید!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"برای رفتن به سایت نرم‌افزار، کلیک کنید\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"یادداشت‌های انتشار نسخه جدید (Release Notes)\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"دانلود\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"شناسایی نمونه دیگری از نرم‌افزار\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"نمونه دیگری از نرم‌افزار Rufus در حال اجراست.\\n\"\n\"امکان اجرای همزمان دو نمونه از نرم‌افزار وجود ندارد. لطفاً قبل از باز کردن نرم‌افزار جدید، نمونه قبلی در حال اجرا را ببندید.\"\n\n# To make the output look correct, in the line below there are LRE & PDF invisible Unicode directional formatting characters.\n# Position: (LRE) At the beginning and (PDF) at the end of %s.\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"هشدار:تمام داده‌ها و اطلاعات موجود در درایو '‪%s‬' پاک خواهد شد.\\n\"\n\"آیا برای ادامه این عملیات مطمئن هستید.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"سیاست به‌روزرسانی نرم‌افزار\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"آیا برای بررسی آپدیت جدید و به‌روزرسانی نرم‌افزار، به Rufus اجازه اتصال به اینترنت را می‌دهید؟\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"لغو\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"تعدادی بدسکتور پیدا شده است\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"بررسی انجام شد. تعداد بدسکتور(های) پیدا شده: %d\\n\"\n\"  خطا(های) خواندن: %d\\n\"\n\"  خطا(های) نوشتن: %d\\n\"\n\"  خطا(های) خرابی (corruption) داده‌ها: %d\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\" گزارش با جزئیات بیشتر را می‌توانید در فایل زیر مشاهده کنید.\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"غیرفعال\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"روزانه\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"هفتگی\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"ماهانه\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"سفارشی\"\n\n# 'LRE' & 'PDF' are used\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"نسخه کنونی نرم‌افزار شما: ‪%d.%d (Build %d)\"\n\n# 'LRE' & 'PDF' are used\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"آخرین نسخه موجود: ‪%d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"کیلوبایت\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"مگابایت\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"پیش‌فرض\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (پیش‌فرض)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (یا UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (بجز CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS یا UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d گذره\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d گذره %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ایمیج ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"برنامه\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"لغو\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"اجرا\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"کاربر ادامه فرآیند را لغو کرد\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"خطا\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"خطا: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"دانلود فایل\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (هارد %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"درایو بیش از یک پارتیشن دارد\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - در حال تخلیه میان‌گیر (بافر)\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - در حال لغو کردن\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"موفق بود.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"برخورد با خطای نامشخص، هنگام فرمت کردن.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"برای این ابزار ذخیره‌سازی نمی‌توان از سیستم فایل انتخاب‌شده استفاده کرد.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"اجازه دسترسی به درایو انتخاب‌شده وجود ندارد.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"درایو انتخاب‌شده نسبت به «نوشتن» محافظت شده است (Write Protected).\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"برنامه یا فرآیند (Process) دیگری در حال استفاده از درایو انتخاب‌شده است.لطفاً سایر برنامه‌هایی را که در حال استفاده کردن از درایو موردنظر هستند؛ ببندید.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"برای درایو انتخاب‌شده، امکان «فرمت کردن سریع» وجود ندارد.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"نام انتخاب‌شده برای درایو، نامعتبر است. لطفاً نام دیگری را انتخاب کنید.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"دستگیره (handle) نرم‌افزاری درایو موردنظر نامعتبر است.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"برای درایو موردنظر اندازه کلاستری که انتخاب کرده‌اید نامعتبر است. لطفاً اندازه دیگری را انتخاب کنید.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"اندازه فضای ذخیره‌سازی درایو موردنظر نامعتبر است.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"لطفاً در درایو USB، یک ابزار ذخیره‌سازی قابل‌حمل وارد کنید.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"فرمان غیرقابل پشتیبانی و نامشخصی دریافت شد.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"خطا در تخصیص حافظه (Memory Allocation)\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"خطا در خواندن.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"خطا در نوشتن.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"فرآیند نصب ناموفق بود\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"\"\n\"نرم‌افزار نتوانست درایو موردنظر را باز کند. ممکن است برنامه یا فرآیند دیگری در حال استفاده از این درایو باشد.\\n\"\n\"لطفاً وسیله موردنظر را از درگاه USB بیرون بیاورید و سپس دوباره آن را متصل و امتحان کنید.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"خطا در هنگام پارتیشن‌بندی درایو.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"نمی‌توان فایل‌ها را در درایو موردنظر کپی کرد.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"کاربر ادامه فرآیند را لغو کرد.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"نرم‌افزار نتوانست ریسه (Thread) را اجرا کند.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"بررسی بدسکتورها کامل انجام نشد.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"بررسی اطلاعات موجود در فایل ISO ناموفق بود.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"استخراج (Extraction) اطلاعات موجود در فایل ISO ناموفق بود.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"اتصال دوباره و سوار کردن (Mount) درایو ناموفق بود.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"نصب فایل‌های موردنیاز برای راه‌اندازی (Boot) سیستم‌عامل ناموفق بود.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"اختصاص حروف الفبا به درایو موردنظر ناموفق بود.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"امکان وصل و سوار کردن (Mount) فضای ذخیره‌سازی GUID وجود ندارد.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"درایو موردنظر هنوز آماده استفاده کردن نیست.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"ویندوز در حال تخلیه اطلاعات و میان‌گیر (بافر) خود در درایو USB موردنظر است.\\n\"\n\"\\n\"\n\"با توجه به سرعت درایو USB، این فرآیند ممکن است کمی زمان‌بر باشد (به‌ویژه برای فایل‌های بزرگ).\\n\"\n\"\\n\"\n\"برای جلوگیری از خرابی فایل‌ها، بهتر است اجازه دهید ویندوز کار خود را کامل کند.اما اگر از صبر کردن خسته شده‌اید؛ می‌توانید وسیله موردنظر را از درگاه USB بیرون بیاورید.\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"فایل ایمیج انتخاب‌شده پشتیبانی نمی‌شود\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"فایل ایمیج (Image) انتخاب‌شده، قابلیت راه‌اندازی سیستم‌عامل را ندارد (none-bootable) یا ساختاری دارد که Rufus آن را پشتیبانی نمی‌کند.\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"%s جایگزین شود؟\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"انگار این فایل ISO از نسخه قدیمی «%s» استفاده می‌کند.\\n\"\n\"به همین دلیل، ممکن است منوی راه‌اندازی (Boot Menu) به‌درستی نمایش داده نشود.\\n\"\n\"\\n\"\n\"برای از بین بردن این مشکل، Rufus می‌تواند نسخه جدید آن را دانلود کند.\\n\"\n\"-برای اتصال به اینترنت و دانلود این فایل «بله» را انتخاب کنید\\n\"\n\"-اگر نمی‌خواهید این فایل را دانلود کنید، «خیر» را انتخاب کنید.\\n\"\n\"\\n\"\n\"نکته: این فایل در پوشه نرم‌افزار دانلود می‌شود و در دفعات بعد به‌صورت خودکار از آن استفاده خواهد شد.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"در حال دانلود کردن %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"فایل ایمیج انتخاب نشده است\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"برای نوع %s\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"فایل ایمیج بیش از اندازه بزرگ است\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"اندازه فایل ایمیج (Image) از ظرفیت درایو انتخاب‌شده بیشتر است.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"خطا در انتخاب فایل ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"هنگامی‌که نوع UEFI را انتخاب می‌کنید؛ فقط می‌توانید از فایل‌های ISO با قابلیت راه‌اندازی EFI (EFI Bootable) استفاده کنید. لطفاً از یک فایل ISO با قابلیت راه‌اندازی EFI استفاده کنید یا در گزینه‌ها نوع BIOS را انتخاب کنید.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"سیستم فایل پشتیبانی نمی‌شود\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"هشدار مهم! درایو انتخاب‌شده چندین پارتیشن دارد.\\n\"\n\"\\n\"\n\"ممکن است این پارتیشن‌ها پنهان باشند و شما آن‌ها را در فهرست ویندوز نبینید. اگر می‌خواهید ادامه دهید، مسئولیت هرگونه پاک شدن اطلاعات در این پارتیشن‌ها به عهده خود شما است.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"چندین پارتیشن شناسایی شده است\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"ایمیج DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"سیستم فایلی را که انتخاب کرده‌اید  با این نوع از فایل ISO نمی‌توان استفاده کرد. لطفاً سیستم فایل یا فایل ISO دیگری را انتخاب کنید.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"«%s» فقط زمانی قابل استفاده است که سیستم فایل انتخاب‌شده NTFS باشد.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"هشدار مهم! شما گزینه «Windows To Go» را انتخاب کرده‌اید اما درایو موردنظر شما فاقد ویژگی «FIXED» است. به همین دلیل هنگام راه‌اندازی سیستم‌عامل (Boot) با استفاده از این درایو به احتمال زیاد اجرای ویندوز متوقف می‌شود. چون‌که مایکروسافت این امکان را برای درایوهایی که ویژگی «REMOVABLE» دارند، طراحی نکرده است.\\n\"\n\"\\n\"\n\"آیا می‌خواهید این کار را ادامه دهید؟\\n\"\n\"\\n\"\n\"نکته: ویژگی‌های «FIXED» و «REMOVABLE» خاصیت سخت‌افزاری هستند و فقط شرکت‌های سازنده درایو با ابزارهای مخصوصی می‌توانند آن‌ها را تغییر دهند. این ابزارها تقریباً هیچ‌وقت در اختیار عموم مردم قرار نمی‌گیرد.\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"محدودیت در سیستم فایل\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"ایمیج (Image) انتخاب‌شده فایلی بزرگ‌تر از ۴ گیگابایت دارد. این مقدار از حداکثر اندازه مجاز برای سیستم فایل FAT و FAT32 بیشتر است.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"استخراج اطلاعات فایل WIM پشتیبانی نمی‌شود\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"سیستم‌عامل شما نمی‌تواند اطلاعات فایل‌های WIM را از حالت فشرده خارج کند. استخراج اطلاعات موجود در این نوع از فایل‌ها، برای ساختن درایو USB «ویندوز ویستا» و «ویندوز ۷» با قابلیت راه‌اندازی EFI لازم است. شما می‌توانید با نصب کردن نرم‌افزار 7-Zip این مشکل را حل کنید.\\n\"\n\"آیا می‌خواهید وارد سایت دانلود نرم‌افزار 7-Zip شوید؟\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"%s دانلود شود؟\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s یا نسخه‌های بعدی آن، نیازمند فایل %s است.\\n\"\n\"چون اندازه این فایل از ۱۰۰ کیلوبایت بیشتر است و معمولاً در ایمیج‌های %s موجود است؛ این فایل به همراه نرم‌افزار Rufus عرضه نشده است.\\n\"\n\"\\n\"\n\"Rufus می‌تواند این فایل را از اینترنت دانلود کند.\\n\"\n\"-برای اتصال به اینترنت و دانلود این فایل «بله» را انتخاب کنید\\n\"\n\"-اگر می‌خواهید بعداً خودتان این فایل را در درایو موردنظر کپی کنید؛ «خیر» را انتخاب کنید\\n\"\n\"\\n\"\n\"نکته: این فایل در پوشه نرم‌افزار دانلود می‌شود و در دفعات بعد به‌صورت خودکار از آن استفاده خواهد شد.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"لغو این فرآیند ممکن است درایو موردنظر را در وضعیت غیرقابل استفاده (UNUSABLE) قرار دهد.\\n\"\n\"آیا مطمئن هستید که می‌خواهید این فرآیند را لغو کنید.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"لطفاً یک پوشه انتخاب کنید\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"همه فایل‌ها\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"گزارش Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (دیسک %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS با استفاده از درایوی که اندازه کلاستر آن ۶۴ کیلوبایت است؛ راه‌اندازی (Boot) نمی‌شود.\\n\"\n\"لطفاً اندازه کلاستر را تغییر دهید یا از FreeDOS استفاده کنید.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"اندازه کلاستر ناسازگار و نامناسب است\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"\"\n\"معمولاً فرمت کردن درایو UDF حجیم و بزرگ زمان‌بر است. زمان تخمینی با استفاده از درگاه USB 2.0 «%d:%02d» است. ممکن است هنگام فرمت کردن، نوار لغزنده‌ای که پیشرفت فرآیند را نشان می‌دهد بی‌حرکت و ثابت شود.\\n\"\n\"پس لطفاً صبور باشید!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"درایو UDF حجیم\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"این ایمیج (Image) از «Syslinux %s%s» استفاده می‌کند؛ اما نرم‌افزار Rufus فقط تنظیمات و فایل‌های نصب «Syslinux %s%s» را به همراه دارد. از آنجا که نسخه‌های مختلف Syslinux با یکدیگر سازگار نیستند و امکان قرار دادن همه آن‌ها در نرم‌افزار Rufus وجود ندارد؛ Rufus باید دو فایل «ldlinux.sys» و «ldlinux.bss» را از اینترنت دانلود کند.\\n\"\n\"-برای اتصال به اینترنت و دانلود این فایل‌ها «بله» را انتخاب کنید\\n\"\n\"-اگر از ادامه این فرآیند منصرف شده‌اید، «خیر» را انتخاب کنید.\\n\"\n\"\\n\"\n\"نکته: این فایل‌ها در پوشه نرم‌افزار دانلود می‌شود و در دفعات بعد به‌صورت خودکار از آن‌ها استفاده خواهد شد.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"دانلود چند فایل لازم است\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"این ایمیج (Image) از «Grub %s» استفاده می‌کند؛ اما نرم‌افزار Rufus فقط تنظیمات و فایل‌های نصب «Grub %s» را به همراه دارد. از آنجا که نسخه‌های مختلف Grub ممکن است با یکدیگر سازگار نباشند و امکان قرار دادن همه آن‌ها در نرم‌افزار Rufus وجود ندارد؛ Rufus تلاش می‌کند فایل نصب «core.img» مناسب ایمیج شما را در اینترنت پیدا کند.\\n\"\n\"\\n\"\n\"installation file ('core.img') that matches the one from your image:\\n\"\n\"-برای اتصال به اینترنت و تلاش برای دانلود این فایل «بله» را انتخاب کنید\\n\"\n\"-اگر می‌خواهید از فایل کنونی و پیش‌فرض Rufus استفاده کنید «خیر» را انتخاب کنید\\n\"\n\"-اگر از ادامه این فرآیند منصرف شده‌اید، «لغو» را انتخاب کنید.\\n\"\n\"\\n\"\n\"نکته: این فایل در پوشه نرم‌افزار دانلود می‌شود و در دفعات بعد به‌صورت خودکار از آن استفاده خواهد شد. اگر فایل مناسبی در اینترنت پیدا نشود، نرم‌افزار از نسخه پیش‌فرض استفاده خواهد کرد.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"نصب ویندوز به روش استاندارد و رایج\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"تنظیمات پیشرفته درایو\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"تنظیمات پیشرفته فرمت\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"نمایش دادن %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"پنهان کردن %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"اندازه پارتیشن پایدار ذخیره‌سازی اطلاعات\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"غیرفعال\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"برای ایجاد live USB با قابلیت ذخیره‌سازی اطلاعات، اندازه پارتیشن پایدار را تعیین کنید. در این حالت، اطلاعات با راه‌اندازی مجدد (ریست) از بین نخواهد رفت. برای غیرفعال کردن عدد صفر (۰) را وارد کنید.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"واحد اندازه‌گیری پارتیشن را تعیین کنید.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"این پیام را دیگر نمایش نده\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"نکته مهم درباره %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"شما درایو UEFI:NTFS ایجاد کردید. لطفا به یاد داشته باشید که برای راه‌اندازی (boot) این درایو، حتما باید راه‌اندازی امن (secure boot) را غیرفعال کنید.\\n\"\n\"برای جزئیات بیشتر در مورد این که چرا این کار لازم است، دکمه \\\"اطلاعات بیشتر\\\" را در زیر ببینید.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"انتخاب ایمیج (Image) ویندوز\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"این فایل ISO چند ایمیج (Image) مختلف ویندوز دارد.\\n\"\n\"لطفا ایمیجی که می‌خواهید نصب کنید را انتخاب کنید:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"برنامه دیگری در حال استفاده از این درایو است. آیا می‌خواهید در هر صورت این درایو را فرمت کنید؟\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus تشخیص داده است که شما می‌خواهید با ISO ورژن 1809 درایوی با قابلیت «Windows To Go»  ایجاد کنید.\\n\"\n\"به دلیل باگی که شرکت مایکروسافت در این مورد دارد؛  در هنگام راه‌اندازی ویندوز به خطای «Blue Screen Of Death» خواهید خورد. برای رفع این مشکل می‌توانید فایل 'WppRecorder.sys' را با ورژن 1803 جایگزین کنید.\\n\"\n\"همچنین در نظر داشته باشید به دلیل اینکه کپی‌رایت فایل 'WppRecorder.sys' برای مایکروسافت است؛ Rufus نمی‌تواند به صورت خودکار این مشکل را برای شما برطرف کند و این فایل را در برنامه خود قرار دهد.\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"چون MBR برای ساختار پارتیشن انتخاب شده است؛ Rufus تنها می‌تواند پارتیشن با حداکثر ظرفیت 2TB روی این دیسک ایجاد کند. بنابراین %s از ظرفیت دیسک در دسترس نخواهد بود.\\n\"\n\"آیا برای ادامه این عملیات مطمئن هستید؟\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"نسخه\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"انتشار\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"ویرایش\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"زبان\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"معماری\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"ادامه\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"بازگشت\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"لطفاً صبور باشید...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"دانلود با استفاده از مرورگر\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"به دلیل درخواست‌های دانلود خیلی زیاد؛ به طور موقت از طرف مایکروسافت بسته شد. لطفا بعدا دوباره امتحان کنید...\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"اجرای این اسکریپت به PowerShell 3.0 یا بالاتر نیاز دارد.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"آیا می‌خواهید به اینترنت متصل شده و آن را دانلود کنید؟\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"در حال اجرای اسکرپیت دانلود...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"دانلود ایمیج ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"نوع کامپیوتری که می‌خواهید درایو USB ساخته‌شده را در آن استفاده کنید. شما می‌بایست قبل از ساختن درایو نوع راه‌اندازی کامپیوتر مقصد را شناسایی و مشخص کنید که از نوع BIOS است یا UEFI. اگرنه ممکن است با استفاده از این درایو نتوانید سیستم مورد نظر را راه‌اندازی کنید.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' به این معنی است که این دستگاه بجای راه‌اندازی به روش اصلی UEFI، در حالت شبیه‌سازی BIOS بالا می‌آید که به 'Legacy Mode' مشهور است.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'non CSM' به این معنی است که این دستگاه برخلاف روش شبیه‌سازی BIOS ('Legacy Mode') به روش اصلی UEFI راه‌اندازی می‌شود.\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"الگوی آزمایش: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"الگوی آزمایش: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"الگوی آزمایش: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"الگوی آزمایش: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"\"\n\"سیستم فایل موردنظر را انتخاب کنید.\\n\"\n\"اگر نمی‌دانید کدام گزینه مناسب است؛ مقدار پیش‌فرض را انتخاب کنید\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"\"\n\"کمترین مقداری که یک بلاک داده (Data block) در سیستم فایل اشغال می‌کند.\\n\"\n\"اگر نمی‌دانید کدام گزینه مناسب است؛ مقدار پیش‌فرض را انتخاب کنید\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"شما می‌توانید برای درایو USB موردنظر؛ نام دلخواهی را انتخاب کنید.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"نمایش دادن/پنهان کردن تنظیمات پیشرفته\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"بررسی وجود بدسکتور (Bad sector) در حافظه و درایو موردنظر با استفاده از یک الگوی آزمایش (Test pattern)\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"برای فرمت کردن به روش آهسته یا کامل (Full format) این گزینه را غیرفعال کنید\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"روشی که برای ساخت پارتیشن‌ها استفاده می‌شود\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"انتخاب روش و نوع فایلی که می‌خواهید با استفاده از آن یک درایو USB با قابلیت راه‌اندازی بسازید\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"برای انتخاب یا دانلود فایل ایمیج (Image) کلیک کنید.\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"اگر نامی که برای درایو موردنظر انتخاب کرده‌اید طولانی و یا دارای حروف غیر انگلیسی است و یا اگر می‌خواهید درایو موردنظر آیکون داشته باشد؛ این گزینه را انتخاب کنید.\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"نصب یک UEFI bootloader این کار باعث اعتبارسنجی نوع md5sUM برای رسانه میشود\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"افزودن تنظیماتی مثل ساختن یک پارتیشن اضافی و مخفی (Extra hidden partition) در درایو و یا تراز کردن (Align) حدود و مرزهای پارتیشن‌ها که باعث شناسایی بهتر درایو در بایوس‌های قدیمی می‌شود.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"لطفاً با آگاهی کامل این گزینه را انتخاب کنید و در صورت نیاز حتماً از اطلاعات موجود در هارد اکسترنال یک نسخه پشتیبان (بکاپ) تهیه کنید!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"شروع فرآیند فرمت کردن\\n\"\n\" با این کار، همه اطلاعات موجود در درایوی که انتخاب کرده‌اید «پاک» می‌شود!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"امضای فایل دانلود شده معتبر نیست\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"برای انتخاب کلیک کنید...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus، ابزاری کاربردی و قابل‌اطمینان برای فرمت کردن درایوهای USB\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"نسخه %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"ترجمه فارسی:\\\\line‏ •مستر ویتو <mailto:mv@mvaop.ir>\\\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"گزارش اشکال (Bug) یا درخواست قابلیت جدید و بهبود نرم‌افزار در:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"حقوق نشر دیگران:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"سیاست به‌روزرسانی:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"اگر به این نرم‌افزار اجازه بررسی به‌روزرسانی‌های جدید را بدهید؛ شما موافقت خود را با احتمال جمع‌آوری اطلاعات زیر در سرور یا سرورهای ما اعلام کرده‌اید:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"معماری و نسخه سیستم‌عامل شما\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"نسخه این نرم‌افزار که در حال استفاده از آن هستید\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"آدرس IP شما\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"به جهت تولید آمار استفاده شخصی، ممکن است ما این اطلاعات جمع‌آوری‌شده را \\\\b برای حداکثر یک سال \\\\b0نگه‌داری کنیم. با وجود این، ما از روی میل این داده‌های فردی را در اختیار شخص ثالث قرار نخواهیم داد.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"فرآیند به‌روزرسانی:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus هیچ سرویس پس‌زمینه‌ای را اجرا یا نصب نمی‌کند؛ بنابراین فقط زمانی که نرم‌افزار در حال اجرا است فرآیند بررسی به‌روزرسانی‌های جدید انجام می‌شود.\\\\line\\n\"\n\"واضح است هنگام بررسی به‌روزرسانی‌ها، دسترسی به اینترنت لازم است.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"ناهماهنگی بین ایمیج و گزینه راه‌اندازی انتخاب‌شده\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"این فایل ایمیج (Image)، با تنظیمات راه‌اندازی (Boot) انتخاب‌شده؛ سازگار نیست. لطفاً فایل یا تنظیمات دیگری انتخاب کنید.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"این فایل ایمیج (Image) با سیستم فایل انتخاب‌شده سازگار نیست\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"درایو ناسازگار و ناهماهنگ شناسایی شده است\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"مرحله نوشتن\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"مرحله خواندن\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"%s دانلود شد\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"دانلود %s امکان‌پذیر نیست\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"در حال استفاده از نسخه جاسازی‌شده و داخلی فایل %s\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"مهم!\\n\"\n\"این درایو اندازه سکتور غیراستانداردی دارد.\\n\"\n\"\\n\"\n\"درایوهای شناخته‌شده، اندازه سکتور ۵۱۲ بایت دارند اما این درایو از %d بایت استفاده می‌کند. این به این معنی است که (در بیشتر موارد) شما قادر به راه‌اندازی سیستم با استفاده از این درایو نخواهید بود.\\n\"\n\"نرم‌افزار Rufus تلاش می‌کند یک درایو قابل راه‌اندازی را بسازد؛ اما در مورد درست کار کردن آن تضمینی نخواهد داد.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"شناسایی اندازه سکتور غیراستاندارد\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"استفاده از قابلیت «Windows To Go» فقط در درایوهای پارتیشن‌بندی‌شده به روش GPT که دارای ویژگی «FIXED» هستند؛ امکان‌پذیر است. درایوی که شما انتخاب کرده‌اید ویژگی «FIXED» را ندارد.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"این ویژگی در این پلتفرم موجود نیست.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"در حال لغو کردن؛ لطفاً صبور باشید...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"در حال پویش و بررسی ایمیج...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"بررسی ایمیج ناموفق بود\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"فایل قدیمی و منسوخ %s شناسایی شد\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"در حال استفاده از ایمیج: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"فایل %s موجود نیست\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"بخش جدید\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d درایو شناسایی شد\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d درایو شناسایی شد\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"آماده\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"لغو شد\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"ناموفق بود\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"در حال راه‌اندازی نسخه جدید نرم‌افزار...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"راه‌اندازی نسخه جدید نرم‌افزار ناموفق بود\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"‪%s‬ باز شد\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"‪%s‬ ذخیره شد\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"در حال فرمت کردن؛ درصد پیشرفت: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"در حال ساختن سیستم فایل؛ تعداد وظایف انجام شده: %d/%d\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"ایجاد ساختار NTFS Fixup؛ درصد پیشرفت: %d%%\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"در حال فرمت کردن (%s)؛ زمان تخمینی: %d:%02d.\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"در حال نام‌گذاری درایو (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"در حال فرمت کردن (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"در حال ایجاد ساختار NTFS Fixup (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"در حال پاک‌کردن ساختارهای MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"در حال درخواست دسترسی به دیسک...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"در حال بررسی رکوردهای راه‌انداز موجود...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"در حال بستن درایوهای موجود...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"در حال نوشتن رکورد راه‌انداز اصلی (MBR)...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"در حال نوشتن رکورد راه‌انداز پارتیشن (PBR)...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"در حال کپی کردن فایل‌های DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"در حال کپی کردن محتویات فایل ISO: ‏%s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"در حال نصب راه‌انداز EFI ویندوز ۷ (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"در حال انجام مرحله نهایی، لطفاً صبور باشید...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"در حال نصب Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"بررسی بدسکتور: %s %d/%d - %0.2f%% (%d/%d/%d خطاها)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"بررسی بدسکتور: آزمایش با استفاده از الگوی تصادفی\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"بررسی بدسکتور: آزمایش با استفاده از الگوی 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"در حال پارتیشن‌بندی (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"در حال حذف پارتیشن‌ (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"امضای دیجیتال آپدیت دانلود شده معتبر نیست. ممکن است تنظیمات اعتبارسنجی امضا در سیستم شما درست نباشد یا اینکه فایل دانلود شده خراب باشد.\\n\"\n\"فایل دانلود شده پاک خواهد شد. برای جزئیات بیشتر گزارش (log) را مشاهده کنید.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"در حال دانلود کردن %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"دانلود فایل ناموفق بود.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"در حال بررسی به‌روزرسانی‌های Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"به‌روزرسانی: نرم‌افزار نتوانست به اینترنت وصل شود\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"به‌روزرسانی: نرم‌افزار نتوانست به اطلاعات نسخه برنامه دسترسی پیدا کند\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"نسخه جدیدی از Rufus موجود است!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"نسخه جدیدی برای Rufus پیدا نشد\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"کلیدهای رجیستری برنامه با موفقیت حذف شدند\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"حذف کلیدهای رجیستری برنامه ناموفق بود\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s فعال شد\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s غیرفعال شد\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"بررسی اندازه ایمیج\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"تشخیص دیسک سخت (هارد دیسک) USB\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"وادار کردن استفاده از فرمت Large FAT32\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"هنگام خروج، NoDriveTypeAutorun حذف خواهد شد\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"تشخیص درایو ساختگی و تقلبی\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"پشتیبانی از سیستم فایل Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"پشتیبانی از سیستم فایل Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"وادار کردن به‌روزرسانی\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"فشرده‌سازی NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"در حال استفاده از ایمیج: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"پشتیبانی از فایل ISO\"\n\n# 'LRE' & 'PDF' are used\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"نمایش دودویی واحدهای حافظه (‪1 KB = 1024 bytes‬)\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"در حال حذف کردن پوشه '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"شناسایی دیسک VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"روش دوگانه UEFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"در حال استفاده از ایمیج ویندوز: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"در حال استفاده از ایمیج ویندوز...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"نگه‌داری برچسب زمان (timestamp)\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"اشکال‌زدایی (debug) USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"محاسبه جمع کنترلی (Checksum) ایمیج؛ درصد پیشرفت: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"محاسبه جمع کنترلی (Checksum) SHA1 و MD5 برای ایمیج انتخاب‌شده\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"تغییر زبان برنامه\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"ایمیج %s شناسایی شد\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"ایمیجی که شما انتخاب کرده‌اید از نوع «ISOHybrid» است. به این معنی که این فایل می‌تواند به روش «%s (کپی کردن فایل)» یا «%s (ایمیج دیسک)» نوشته شود.\\n\"\n\"Rufus استفاده از روش «%s» را پیشنهاد می‌کند. در این روش پس از نوشتن اطلاعات در درایو، شما همیشه دسترسی کاملی به درایو خواهید داشت. \\n\"\n\"با این حال، اگر هنگام راه‌اندازی (boot) سیستم‌عامل با مشکلی برخورد کردید؛ شما می‌توانید دوباره نوشتن اطلاعات به روش «%s» را امتحان کنید.\\n\"\n\"\\n\"\n\"لطفاً شیوه‌ای را که می‌خواهید با استفاده از آن اطلاعات ایمیج نوشته شود؛ انتخاب کنید:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"نوشتن به روش «%s» (پیشنهاد برنامه)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"نوشتن به روش «%s»\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"درحال بررسی فرآیندهای ناسازگار و متناقض...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"غیرقابل راه‌اندازی (Non bootable)\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"دیسک یا ایمیج ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (لطفاً انتخاب کنید)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"قفل کردن اختصاصی درایو USB\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"امضای نامعتبر\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"فایل اجرایی دانلود شده امضای دیجیتال ندارد.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"این فایل اجرایی دانلود شده، توسط '%s' امضا شده است.\\n\"\n\" ما این امضا را نمی‌شناسیم و ناشناس بودن آن ممکن است نشانه نوعی فعالیت خرابکارانه باشد...\\n\"\n\"آیا مطمئن هستید می‌خواهید این فایل را اجرا کنید؟\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"صفر کردن درایو: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"شناسایی درایوهای غیر USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"دسترسی‌های سطح بالا وجود ندارد\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"این نرم‌افزار فقط با دسترسی‌های سطح بالا می‌تواند اجرا شود\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"ایندکس گذاری فایل\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"انتخاب نسخه (ورژن)\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"لطفاً نسخه ویندوزی را که می‌خواهید نصب کنید؛ انتخاب کنید:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"نسخه ویندوز پشتیبانی نمی‌شود\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"Rufus دیگر این نسخه از ویندوز را پشتیبانی نمی‌کند آخرین ورژن قابل پشتیبانی برنامه Rufus نصب این نسخه از ویندوز v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"هشدار: نسخه غیررسمی\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"این نسخه از Rufus توسط توسعه‌دهندگان اصلی و رسمی آن تهیه نشده است.\\n\"\n\"\\n\"\n\"آیا برای اجرای آن مطمئن هستید؟\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"فایل ISO ناقص شناسایی شده است\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"این فایل ISO که انتخاب کرده‌اید با اندازه تعیین شده در آن هماهنگی ندارد. %s از داده‌ها موجود نیست!\\n\"\n\"\\n\"\n\"اگر این فایل را از اینترنت دانلود کرده‌اید، لطفا نسخه‌ای جدید از آن را دانلود کرده و مطمئن شوید که مقادیر کنترلی MD5 یا SHA آن عینا برابر با مقادیر رسمی آن‌هاست.\\n\"\n\"\\n\"\n\"توجه داشته باشید که در Rufus می‌توانید با انتخاب دکمه (✓) مقادیر MD5 یا SHA را  محاسبه کنید.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"خطای اعتبارسنجی برچسب زمان (timestamp)\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"از نظر برنامه، برچسب زمانی آپدیت دانلود شده معتبر نیست. \\n\"\n\"\\n\"\n\"برای پیشگیری از حملات هک احتمالی، فرآیند به‌روزرسانی متوقف و فایل دانلود شده حذف خواهد شد. لطفا برای جزئیات بیشتر گزارش‌ها (لاگ) را بررسی کنید.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"نمایش تنظیمات برنامه\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"نمایش اطلاعات مربوط به این برنامه\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"نمایش گزارش‌ها (Log)\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"ساخت ایمیج از دستگاه انتخاب‌شده\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"با استفاده از این گزینه مشخص کنید که آیا می‌خواهید از این درایو برای نصب ویندوز استفاده کنید یا اینکه می‌خواهید مستقیما ویندوز را از روی آن اجرا کنید (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"درحال بازنویسی سریع درایو با داده صفر؛ درصد پیشرفت: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"ممکن است کمی زمان‌بر باشد\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"پیداشدن VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"آرشیو فشرده\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"ISO که انتخاب کرده اید از UEFI استفاده می کند و به اندازه کافی کوچک است که به عنوان یک پارتیشن سیستم EFI (ESP) نوشته شود. نوشتن به ESP، به جای نوشتن به یک پارتیشن داده عمومی اشغال کل دیسک، می تواند برای برخی از انواع تاسیسات ترجیح داده شود. لطفا حالتی را که می خواهید برای نوشتن این تصویر استفاده کنید انتخاب کنید:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"برای فعال کردن از %s (در پنجره اصلی برنامه) استفاده کنید.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"هش های اضافی (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"ثبت در VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"جمع های چک تصویر را محاسبه کنید\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"چندین دکمه\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"ردیف عدد\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"شناسه دیسک\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"اولویت موضوع پیش فرض: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Boot Marker را نادیده بگیرید\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"در حال تازه کردن طرح پارتیشن (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"تصویری که انتخاب کرده‌اید ISOHybrid است، اما سازندگان آن آنرا با حالت کپی ISO/File سازگار نکرده‌اند.\\n\"\n\"در نتیجه حالت نوشتن تصویر DD اعمال خواهد شد.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"باز کردن یا خواندن %s ممکن نیست\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"اعمال سفارشی سازی ویندوز: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"اعمال گزینه های کاربر...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"تجربه کاربری ویندوز\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"شخصی سازی نصب ویندوز؟\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"نیاز به رم 4 گیگابایتی، Secure Boot و TPM 2.0 را حذف کنید\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"نیاز به حساب آنلاین مایکروسافت را حذف کنید\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"غیرفعال کردن جمع آوری داده ها (رد شدن از سوالات حریم خصوصی)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"از دسترسی Windows To Go به دیسک های داخلی جلوگیری کنید\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"یک حساب کاربری محلی با نام کاربری ایجاد کنید:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"گزینه های منطقه ای را روی همان مقادیر این کاربر تنظیم کنید\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"رمزگذاری خودکار دستگاه BitLocker را غیرفعال کنید\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"لیست مداوم\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"فایل دیگری ('diskcopy.dll:) نیاز است دانلود شود از مایکروسافت برای نصب MS-DOS:\\n\"\n\"- انتخاب :'بله' برای وصل شدن به اینترنت و دانلود آن\\n\"\n\"- انتخاب 'نه' برای کنسل کردن این کار\\n\"\n\"\\n\"\n\"نکته: فایل در مکان نرم افزار دانلود میشود و دوباره استفاده میشود درصورت انجام مجدد این کار.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"بوت لودر UEFI کنسل شده شناسایی شد\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus متوجه شده که فایل ISO که انتخاب کردید دارای UEFI بوت لودری است که لفو شده و باعث %s, درصورتی که بوت امن فعال شده بر روی سیستم کاملا اپدیت شده UEFI\\v\\v- اگه شما این فایل ISO رو از یک جای غیر قابل اعتماد دریافت کردید ممکن است این فایل دارای ویروس UEFI باشد و نباید آنرا بوت کرد \\n\"\n\"\\v- اگه شما شما از جای مورد اغفماد دریافت کردیدش, میتونید تلاش کنید برای پیدا کردن نسخه جدیدتر, با اینکار دیگر این هشتار را دریافت نمیکنید.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"یک  صفحه  \\\"مشکلی امنیتی\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"یک صفخه ریکاوری ویندوز (BSOD) با '%S\\\"\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"فایل VHDX  فشرده شده\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"فایل VHD  فشرده نشده\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"دیتا های دیگری نیاز به دانلود از مایکروسافت برای انجام دادن این کار نیاز است:\\n\"\n\"- انتخاب 'بله' برای وصل شدن به اینترنت و دانلود آنها\\n\"\n\"- انتخاب 'نه' برای لغو کردن این کار\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"مجبور کردن ویندوز به S-Mode ( دارای مشکلات با حذفز استفاده  اکانت آنلاین )\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"بخش حرفه ای\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"استراج کردن فایل های آرشیو: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"استفاده از Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus ابزاری است که به فرمت و ایجاد درایوهای فلش USB قابل بوت، مانند کلیدهای USB/pendrives، مموری استیک ها و غیره به شما کمک می کند.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"سایت رسمی: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"منبع کد: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"لیست تغییرات %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"این برنامه تحت شرایط مجوز عمومی گنو (GPL) نسخه 3 مجوز دارد.\\n\"\n\"برای جزئیات به https://www.gnu.org/licenses/gpl-3.0.html مراجعه کنید.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"راه‌اندازی\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"فرمت USB، فلش کارت و درایوهای مجازی به FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"درایوهای USB قابل بوت FreeDOS را ایجاد کنید\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"ایجاد درایوهای قابل بوت از ISOهای قابل بوت (ویندوز، لینوکس و غیره)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"درایوهای قابل بوت را از تصاویر دیسک قابل بوت، از جمله موارد فشرده، ایجاد کنید\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"درایوهای قابل بوت بایوس یا UEFI از جمله NTFS قابل بوت UEFI ایجاد کنید\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"درایوهای \\\"Windows To Go\\\" را ایجاد کنید\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"درایوهای نصب ویندوز 11 را برای رایانه هایی که TPM یا Secure Boot ندارند ایجاد کنید\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"ایجاد پارتیشن های لینوکس دائمی\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"تصاویر VHD/DD از درایو انتخاب شده ایجاد کنید\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"MD5، SHA-1، SHA-256 و SHA-512 را برای تصویر انتخابی محاسبه کنید\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"بررسی بلوک های بد، از جمله تشخیص درایوهای فلش \\\"جعلی\\\" را انجام دهید\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"ISO های رسمی ماکروسافت را دریافت کنید\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"ISO های پوسته UEFI را دانلود کنید\"\n"
  },
  {
    "path": "res/loc/po/fi-FI.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-14 12:47+0300\\n\"\n\"PO-Revision-Date: 2024-05-14 14:07+0300\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: fi_FI\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Finnish (Suomi)\\n\"\n\"X-Rufus-LCID: 0x040B\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Aseman ominaisuudet\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Laite\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Boottaustyypin valinta\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Valitse\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Levykuvan määritys\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Osion tyyppi\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Kohdejärjestelmä\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Näytä USB-kiintolevyt\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Lisää korjauksia vanhoja BIOS-versioita varten\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Ota käyttöön ajonaikainen UEFI-tietovälineen tarkistus\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Alustusasetukset\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Tiedostojärjestelmä\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Tilanvarausyksikkö\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Aseman nimi\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Pika-alustus\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Vioittuneiden lohkojen tarkistus\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Luo laajennetut nimi- ja kuvaketiedostot\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Tila\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Sulje\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Aloita\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Tietoja Rufus-sovelluksesta\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Lisenssi\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus-lisenssi\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Lisätietoja\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Kyllä\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Ei\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Loki\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Tyhjennä\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Tallenna\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Päivityskäytäntö ja -asetukset\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Asetukset\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Tarkista päivitykset\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Sisällytä beta-versiot\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Tarkista nyt\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Tarkista päivitysten saatavuus - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Saatavilla on uudempi versio. Ole hyvä ja lataa ohjelman uusin versio!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Klikkaa tästä päästäksesi verkkosivulle\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Julkaisutiedotteet\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Lataa\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Toinen prosessi käynnissä\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Rufus-sovellus on jo käynnissä.\\n\"\n\"Sulje ensimmäinen Rufus-sovellus jatkaaksesi tämän sovelluksen käyttöä.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"VAROITUS: KAIKKI TIEDOT LAITTEESSA '%s' POISTETAAN.\\n\"\n\"Jatkaaksesi toimenpidettä valitse OK. Lopettaaksesi valitse PERUUTA.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus-päivityskäytäntö\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Haluatko sallia Rufuksen etsiä uusia päivityksiä verkosta?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Peruuta\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Viallisia lohkoja löydetty\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Tarkistus valmis: %d viallista lohkoa löydetty\\n\"\n\"  %d lukuvirhe(ttä)\\n\"\n\"  %d kirjoitusvirhe(ttä)\\n\"\n\"  %d korruptiovirhe(ttä)\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"A voit tarkastella tarkempaa raporttia kohteessa:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Pois käytöstä\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Päivittäin\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Viikoittain\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Kuukausittain\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Mukautettu\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Tämä versio: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Viimeisin versio: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"tavua\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilotavua\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megatavua\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Oletus\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Oletus)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (tai UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (ei-CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS tai UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d testi\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d testiä %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO-kuva\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Sovellus\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Keskeytä\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Käynnistä\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Käyttäjä peruutti toiminnon\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Virhe\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Virhe: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Tiedoston lataus\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB-tallennuslaite (Yleinen)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Levy %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Useita osioita\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Tyhjennetään puskuria\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Peruutus\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Onnistui.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Määrittämätön virhe alustaessa.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Valittua tiedostojärjestelmää ei voida käyttää tässä tietovälineessä.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Pääsy laitteeseen on evätty.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Tietoväline on kirjoitussuojattu.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Laite on toisen prosessin käytössä. Sulje prosessit, jotka saattavat käyttää laitetta.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Tälle laitteelle ei voida suorittaa pika-alustusta.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Aseman nimi ei kelpaa.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Laitteen tunniste ei kelpaa.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Valittua tilanvarausyksikköä ei voida käyttää tämän laitteen kanssa.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Aseman koko ei kelpaa.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Aseta irroitettava tietoväline asemaan.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Ohjelma vastaanotti ei-tuetun komennon.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Muistinvarausvirhe.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Virhe lukiessa.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Virhe kirjoittaessa.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Asennus epäonnistui\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Tietovälinettä ei voitu avata. Se voi olla toisen prosessin käytössä. Irroita ja yhdistä tietoväline ja yritä uudelleen.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Levyä ei voitu osioida.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Tietoja ei voitu kopioida kohdelevylle.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Käyttäjä peruutti.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Säiettä ei voitu käynnistää.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Lohkojen tarkistus ei valmistunut.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"ISO-levykuvan skannaus epäonnistui.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"ISO-levykuvan purkaminen epäonnistui.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Asemaa ei voitu ottaa uudelleen käyttöön.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Tiedostoja ei voitu päivittää/asentaa käynnistystä varten.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Levykirjainta ei voitu asettaa.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"GUID-asemaa ei voitu ottaa käyttöön.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Laite ei ole valmis.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus havaitsi, että Windows tyhjentää sisäistä puskuria USB-laitteelle.\\n\"\n\"\\n\"\n\"USB-laitteesi nopeudesta riippuen toiminnon suorittamisessa voi kestää kauan, varsinkin suurilla tiedostoilla.\\n\"\n\"\\n\"\n\"Suosittelemme, että annat Windowsin suorittaa toiminnon loppuun välttyäksesi virheiltä. Jos et kuitenkaan jaksa enää odottaa, voit ottaa laitteen irti...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Levykuvaa ei tueta\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Valittu levykuva ei ole boottava tai se käyttää käynnistys- tai pakkausmenetelmää jota Rufus ei tue...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Korvataanko %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Tämä ISO-levykuva vaikuttaisi käyttävän vanhentunutta '%s'-versiota.\\n\"\n\"Tämän vuoksi käynnistysvalikot saattavat näkyä väärin.\\n\"\n\"\\n\"\n\"Rufus voi ladata uudemman version ongelman korjaamiseksi:\\n\"\n\"- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi tiedoston\\n\"\n\"- Valitse 'Ei' jättääksesi ISO-levykuvan alkuperäiseen muotoonsa\\n\"\n\"Jos et ole varma, sinun kannattaa valita 'Kyllä'.\\n\"\n\"\\n\"\n\"Huomio: Uusi tiedosto ladataan nykyiseen sijaintiin ja kun '%s' löytyy sijainnista, sitä käytetään automaattisesti.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Ladataan %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"ISO-levykuvaa ei valittu\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"%s NAND-muistille\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Levykuva on liian suuri\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Levykuva on liian suuri valittuun kohteeseen.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"ISO-levykuvaa ei tueta\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"UEFI-kohdetyyppiä käytettäessä vain EFI-boottaavat ISO-levykuvat ovat tuettuna. Valitse EFI-boottaava ISO-levykuva tai valitse kohdetyypiksi BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Tiedostojärjestelmää ei tueta\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"TÄRKEÄÄ: TÄMÄ LEVYASEMA SISÄLTÄÄ USEITA OSIOITA!!\\n\"\n\"\\n\"\n\"Siihen saattaa kuulua osioita/asemia, joita ei ole listattuna tai edes näkyvissä Windowsissa. Jos haluat jatkaa, olet vastuussa mahdollisesta tietojen häviämisestä näillä osioilla.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Useita osioita havaittu\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD-kuva\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Valittua tiedostojärjestelmää ei voida käyttää tämäntyyppisen ISO-levykuvan kanssa. Valitse toinen tiedostojärjestelmä tai käytä toista ISO-levykuvaa.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' on käytettävissä vain NTFS-tiedostojärjestelmän kanssa.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"TÄRKEÄÄ: Olet asentamassa 'Windows To Go' -järjestelmää, mutta kohdeasemaa ei ole määritelty kiinteäksi. Tästä johtuen Windows todennäköisesti pysähtyy käynnistyksessä, sillä Microsoft ei ole suunnitellut sitä toimivaksi asemilla, jotka ovat merkitty irroitettaviksi.\\n\"\n\"\\n\"\n\"Haluatko kuitenkin jatkaa?\\n\"\n\"\\n\"\n\"Huomio: 'Kiinteä/irroitettava' -määritys on laitteiston ominaisuus, joka voidaan vaihtaa vain aseman valmistajan erityisohjelmistolla. Näitä työkaluja ei kuitenkaan lähes milloinkaan levitetä julkiseen käyttöön...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Tiedostojärjestelmärajoitus\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Tämä ISO-levykuva sisältää yli 4 GB-kokoisen tiedoston, joka ylittää FAT ja FAT32 -tiedostojärjestelmien enimmäiskoon.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"WIM-tuki puuttuu\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Käytössä oleva alusta ei kykene purkamaan tiedostoja WIM-arkistoista. WIM-purkaminen on välttämätöntä EFI-bootattavien Windows 7 ja Windows Vista USB-asemien luomisessa. Voit korjata tilanteenasentamalla viimeaikaisen version 7-Zip-ohjelmasta.\\n\"\n\"Haluatko vierailla 7-Zip-lataussivustolla?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Ladataanko %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s tai uudempi vaatii '%s'-tiedoston asennuksen.\\n\"\n\"Koska kyseinen tiedosto on kooltaan aina yli 100 KB, ja se löytyy aina %s ISO-levykuvista, sitä ei ole sisällytetty Rufukseen.\\n\"\n\"\\n\"\n\"Rufus voi ladata puuttuvan tiedoston puolestasi:\\n\"\n\"- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi tiedoston\\n\"\n\"- Valitse 'Ei' jos haluat manuaalisesti kopioida tämän tiedoston asemalle myöhemmin\\n\"\n\"\\n\"\n\"Huomio: Tiedosto ladataan nykyseen sijaintiin ja kun '%s' löytyy sijainnista, sitä käytetään automaattisesti.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Peruuttaminen saattaa jättää laitteen KÄYTTÖKELVOTTOMAAN tilaan.\\n\"\n\"Jos haluat varmasti peruuttaa, valitse KYLLÄ. Muuten, valitse EI.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Valitse kansio\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Kaikki tiedostot\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufuksen loki\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Levy %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS ei voi käynnistyä laitteelta, joka käyttää 64 kilotavun tilanvarausyksikköä.\\n\"\n\"Vaihda tilanvarausyksikköä tai käytä FreeDOSia.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Epäsopiva tilanvarausyksikkö\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Suurten UDF-asemien alustus voi kestää kauan. USB 2.0-nopeuksilla arvioitu alustuksen kesto on %d:%02d, minkä aikana etenemispalkki vaikuttaa pysähtyneeltä. Ole kärsivällinen!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Suuri UDF-asema\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Tämä kuva käyttää Syslinuxia %s%s, mutta tämä sovellus sisältää asennustiedostot vain Syslinuxille %s%s.\\n\"\n\"\\n\"\n\"Koska Syslinuxin uudet versiot eivät ole keskenään yhteensopivia, eikä Rufus voisi sisältää niitä kaikkia, on kaksi lisätiedostoa ladattava internetistä ('ldlinux.sys' ja 'ldlinux.bss'):\\n\"\n\"- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi nämä tiedostot\\n\"\n\"- Valitse 'Ei' peruaksesi toiminnon\\n\"\n\"\\n\"\n\"Huomio: Tiedostot ladataan nykyiseen sovelluskansioon ja niitä uudelleenkäytetään automaattisesti, jos se ovat jo olemassa.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Lataus vaaditaan\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Tämä kuva käyttää Grubia %s, mutta tämä sovellus sisältää asennustiedostot vain Grubille %s.\\n\"\n\"\\n\"\n\"Koska Grubin eri versiot eivät välttämättä ole yhteensopivia eikä jokaista versiota voida sisällyttää, Rufus yrittää etsiä versiota Grub-asennustiedostosta ('core.img'), joka täsmäisi levykuvaasi:\\n\"\n\"- Valitse 'Kyllä' yhdistääksesi internetiin ja yrittääksesi ladata tämän\\n\"\n\"- Valitse 'Ei' käyttääksesi Rufuksen sisältämää vakioversiota\\n\"\n\"- Valitse 'Peruuta' peruaksesi toiminnon\\n\"\n\"\\n\"\n\"Huomio: Tiedosto ladataan nykyiseen sovelluskansioon ja sitä käytetään automaattisesti sen löytyessä. Jos vastaavaa ei löydy verkosta, käytetään vakioversiota.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Tavanomainen Windowsin asennus\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"aseman lisäasetukset\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"formatoinnin lisäasetukset\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Näytä %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Piilota %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Pysyvän osion koko\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Ei pysyvää osiota\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Aseta pysyvän osion koko 'live USB' -tietovälineitä varten. Koon asettaminen arvoon 0 poistaa pysyvän osion käytöstä.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Valitse osion kokoyksikkö.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Älä näytä tätä viestiä uudelleen\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Tärkeä huomio liittyen %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Loit juuri tietovälineen, joka käyttää UEFI:NTFS -käynnistyslataajaa. Muistathan, että käynnistäminen tältä tietovälineeltä VAATII SECURE BOOT -OMINAISUUDEN POISTAMISTA KÄYTÖSTÄ.\\n\"\n\"Jos haluat tietää tarkemmin miksi tämä on välttämätöntä, voit painaa alla olevaa 'Lisätietoja' -painiketta.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows-levykuvan valinta\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Tämä ISO-tiedosto sisältää useita Windows-levykuvia.\\n\"\n\"Valitse levykuva, jota haluat käyttää tähän asennukseen:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Jokin toinen ohjelma tai prosessi käyttää tätä levyä parhaillaan. Haluatko silti alustaa sen?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus on havainnut, että yrität luoda Windows to Go -tietovälinettä joka pohjautuu 1809 ISO-levykuvaan.\\n\"\n\"\\n\"\n\"*MICROSOFTIN OHJELMOINTIVIRHEEN* vuoksi tämä tietoväline kaatuu Windowsin käynnistyksen aikana (Blue Screen Of Death), ellet manuaalisesti korvaa 'WppRecorder.sys' -tiedostoa 1803-versiolla.\\n\"\n\"\\n\"\n\"Huomaathan, että 'WppRecorder.sys' on Microsoftin tekijänoikeudellinen tiedosto ja täten Rufus ei voi automaattisesti korjata tätä virhettä, sillä emme voi tarjota kyseistä tiedostoa sovelluksemme kautta lakiteknisistä syistä...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Koska osion tyypiksi on valittu MBR, voi Rufus luoda vain maksimissaan 2 TB:n kokoisen osion tälle tietovälineelle jättäen %s levytilaa käyttökelvottomaksi.\\n\"\n\"\\n\"\n\"Haluatko varmasti jatkaa?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Versio\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Julkaisu\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Painos\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Kieli\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Arkkitehtuuri\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Jatka\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Takaisin\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Odota...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Lataa käyttäen selainta\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Windowsin ISO-levykuvien lataaminen ei ole mahdollista, koska Microsoft on muuttanut verkkosivujaan sen estämiseksi.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 tai uudempi tarvitaan tämän komennon suorittamiseksi.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Haluatko yhdistää verkkoon ja ladata sen?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Suoritetaan latauskomentoa...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Lataa ISO-levykuva\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Tietokoneen tyyppi, jonka kanssa aiot käyttää asemaa. Sinun on määritettävä, onko kohdelaitteesi BIOS- vai UEFI-tyyppinen ennen aseman luomista, sillä väärän tyypin valinta voi estää käynnistymisen.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' tarkoittaa, että laite käynnistyy vain emuloidussa BIOS-tilassa (tunnetaan myös nimellä 'Legacy Mode') UEFIn alaisena eikä natiivissa UEFI-tilassa.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'ei-CSM' tarkoittaa, että laite käynnistyy vain natiivissa UEFI-tilassa eikä emuloidussa BIOS-tilassa (joka tunnetaan myös nimellä 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Testikuvio: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Testikuvio: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testikuvio: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testikuvio: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Asettaa kohteen tiedostojärjestelmän\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Minimikoko, jonka datalohko varaa tiedostojärjestelmässä\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Käytä tätä kenttää valitaksesi aseman nimen.\\n\"\n\"Voit käyttää kansainvälisiä merkkejä.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Näytä tai piilota lisäasetukset\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Tarkista laite testikuviolla vioittuneiden lohkojen varalta\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Poista valintaruudun valinta käyttääksesi \\\"hidasta\\\" alustustapaa\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Tapa, jota käytetään osioiden luomiseen\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Tapa, jolla asemasta tehdään boottaava\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Paina valitaksesi tai lataaksesi levykuvan...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Valitse valintaruutu salliaksesi kansainvälisten merkkien näyttämisen ja asettaaksesi laitekuvakkeen (luo autorun.inf-tiedoston)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Asenna UEFI-käynnistyslataaja, joka tulee suorittamaan tietovälineelle MD5Sum-tiedostotarkistuksen\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Luo ylimääräinen, piilotettu osio ja yritä kohdistaa osioiden rajoja.\\n\"\n\"Tämä voi parantaa USB-laitteiden havaitsemista käynnistyksessä vanhemmissa BIOSeissa.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Ota käyttöön USB-kiintolevyjen listaus. KÄYTÄ OMALLA VASTUULLA!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Käynnistä alustustoiminto.\\n\"\n\"Tämä POISTAA kaiken tiedon kohteesta!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Epäkelpo latauksen allekirjoitus\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Paina valitaksesi...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Luotettava USB-alustusohjelma\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Versio %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Suomenkielinen käännös: Riku Brander\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Raportoi virheitä tai pyydä parannuksia osoitteessa:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Muut tekijänoikeudet:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Päivityskäytäntö:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Jos annat ohjelman etsiä sovelluspäivityksiä, hyväksyt, että seuraavia tietoja saatetaan kerätä palvelimillemme:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Käyttöjärjestelmäsi arkkitehtuuri ja versio\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Käyttämäsi sovelluksen versio\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"IP-osoitteesi\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Yksityisten käyttötilastojen luomiseksi saatamme pitää tietoja kerättynä \\\\b enimmillään vuoden\\\\b0 . Emme kuitenkaan anna vapaaehtoisesti mitään yksittäistietoja kolmansille osapuolille.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Päivitysprosessi:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus ei asenna tai aja taustapalveluja, siksi päivitystarkistukset suoritetaan vain pääsovelluksen ollessa käynnissä.\\\\line\\n\"\n\"Internetyhteys toki vaaditaan päivityksiä tarkistettaessa.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Levykuva ei ole sopiva valitulle käynnistysvalinnalle\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Nykyinen levykuva ei vastaa valittua käynnistysvalintaa. Käytä toista levykuvaa tai valitse eri käynnistysvalinta.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Tämä ISO-levykuva ei ole yhteensopiva valitun tiedostojärjestelmän kanssa\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Epäsopiva asema havaittu\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Kirjoitustesti\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Lukutesti\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Ladattu %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Ei voitu ladata %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Käytetään sisällytettyä versiota %s -tiedostoista\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"TÄRKEÄÄ: TÄMÄ ASEMA KÄYTTÄÄ EPÄSTANDARDIA SEKTORIKOKOA!\\n\"\n\"\\n\"\n\"Perinteiset asemat käyttävät 512-tavuista sektorikokoa, mutta tämä asema käyttää %d-tavuista. Monesti tämä tarkoittaa sitä, että tältä asemalta boottaminen EI ONNISTU.\\n\"\n\"Rufus voi yrittää luoda boottaavan aseman, mutta sen toiminnasta EI OLE TAKUITA.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Epästandardi sektorikoko havaittu\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' voidaan asentaa GPT-osioidulle asemalla vain, jos asema on merkitty kiinteäksi. Valittua asemaa ei havaittu asetetuksi kiinteäksi.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Tämä ominaisuus ei ole käytettävissä tällä alustalla.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Peruutetaan - Odota...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Skannataan ISO-levykuvaa...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"ISO-levykuvan skannaus epäonnistui\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Vanhentunut %s havaittu\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Käytössä oleva levykuva: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Tiedosto %s puuttuu\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Uusi asema\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d laite havaittu\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d laitetta havaittu\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"VALMIINA\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Peruutettu\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"EPÄONNISTUI\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Käynnistetään uutta sovellusta...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Uuden sovelluksen käynnistäminen epäonnistui\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Avattu %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Tallennettu %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Alustus: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Luodaan tiedostojärjestelmää: Toiminto %d/%d suoritettu\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS-korjaus: %d%% valmiina\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Alustetaan (%s) - arvioitu kesto %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Asetetaan nimeä (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Alustetaan (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS-korjaus (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Selvitetään MBR/PBR/GPT -rakenteita...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Pyydetään pääsyä levylle...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analysoidaan löytyviä käynnistyslistauksia...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Suljetaan olemassaolevaa asemaa...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Kirjoitetaan Master Boot Record...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Kirjoitetaan Partition Boot Record...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopioidaan DOS-tiedostoja...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopioidaan ISO-tiedostoja: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI -käynnistysasetus (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Viimeistellään, odota...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Asennetaan Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Lohkot: %s %d/%d - %0.2f%% (%d/%d/%d virhettä)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Lohkot: Testataan satunnaisella kuviolla\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Lohkot: Testataan kuviolla 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Osioidaan (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Poistetaan osioita (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Ladatun päivityksen digitaalista allekirjoitusta ei voitu varmentaa. Järjestelmässäsi saattaa olla määritysongelma allekirjoitusten suhteen tai kyseessä voi olla haitallinen lataus.\\n\"\n\"\\n\"\n\"Ladattu tiedosto poistetaan. Lisätietoja tapahtumasta löytyy Rufuksen lokista.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Ladataan: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Tiedoston lataaminen epäonnistui.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Tarkistetaan Rufus-päivityksiä...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Päivitykset: Ei saatu yhteyttä internetiin\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Päivitykset: Ei päästy käsiksi versiotietoihin\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Uusi Rufus-versio on saatavilla!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Ei löytynyt uudempaa Rufus-versiota\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Rekisteriavaimet poistettu onnistuneesti\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Rekisteriavainten poistaminen epäonnistui\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s päällä\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s pois päältä\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Kokotarkistukset\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Kiintolevyjen havaitseminen\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Laajan FAT32-alustuksen pakotus\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun poistetaan suljettaessa\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Valeasemien havaitseminen\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet-tuki\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge -tuki\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Päivityksen pakotus\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS-pakkaaminen\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Kirjoitetaan levykuvaa: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO-tuki\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"OIKEIDEN tilayksiköiden kerrannaisten käyttö\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Poistetaan kansiota '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare-levyn havaitseminen\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Kaksois-UEFI/BIOS -tila\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Asetetaan Windows-levykuvaa: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Asetetaan Windows-levykuvaa...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Aikaleimojen käyttö\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB-virheenkorjaus\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Lasketaan levykuvan tarkistussummia: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Laske valitun levykuvan MD5-, SHA1- ja SHA256-tarkistussummat\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Vaihda sovelluksen kieltä\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s-levykuva havaittu\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Valitsemasi levykuva on muotoa 'ISOHybrid'. Tämä tarkoittaa, että se voidaan kirjoittaa joko %sna (tiedostojen kopiointi) tai %sna (levykuva).\\n\"\n\"Rufus suosittelee käyttämään '%s' -tilaa, jotta sinulla pysyy täysi pääsy asemaan kirjoittamisen jälkeen.\\n\"\n\"Jos törmäät ongelmiin käynnistyksessä, voit yrittää kirjoittaa levykuvaa uudelleen '%s' -tilassa.\\n\"\n\"\\n\"\n\"Valitse tila, jota haluat käyttää levykuvan kirjoittamiseen:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Kirjoita %sna (Suositellaan)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Kirjoita %sna\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Tarkistetaan ristiriidassa olevien prosessien varalta...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Ei-boottaava\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Levy tai ISO-levykuva\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Ole hyvä ja valitse)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"USB-aseman eksklusiivinen käyttö\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Epäkelpo allekirjoitus\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Ladatusta tiedostosta puuttuu digitaalinen allekirjoitus.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Ladatun tiedoston on allekirjoittanut '%s'.\\n\"\n\"Emme tunnista kyseistä allekirjoitusta, mikä saattaa viitata haitalliseen toimintaan...\\n\"\n\"Haluatko varmasti suorittaa tämän tiedoston?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Nollataan asemaa: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Ei-USB-liitäntäisten irroitettavien asemien tunnistus\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Laajennetut käyttöoikeudet puuttuvat\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Tämä sovellus vaatii laajennetut käyttöoikeudet toimiakseen\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Tiedostojen indeksointi\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Version valinta\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Valitse Windows-versio, jonka haluat asentaa:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Tätä Windows-versiota ei tueta\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Rufus ei enää tue tätä Windows-versiota.\\n\"\n\"Viimeisin alustan kanssa yhteensopiva Rufus-versio on v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Varoitus: Epävirallinen versio\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Tämä versio ei ole Rufuksen virallisen kehittäjän tekemä.\\n\"\n\"\\n\"\n\"Haluatko varmasti suorittaa ohjelman?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Vajaakokoinen ISO-levykuva havaittu\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Valitsemasi ISO-levykuva ei vastaa sen ilmoittamaa tiedostokokoa: %s ohjelmatiedosta puuttuu!\\n\"\n\"\\n\"\n\"Jos latasit tämän tiedoston internetistä, yritä ladata tiedosto uudelleen ja varmista, että MD5- tai SHA-tarkistussumma täsmää alkuperäisen summan kanssa.\\n\"\n\"\\n\"\n\"Voit laskea MD5- tai SHA-tarkistussumman Rufuksessa painamalla (✓)-painiketta.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Aikaleiman vahvistusvirhe\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus ei pystynyt varmistamaan, että ladatun päivityksen aikaleima on nykyistä tiedostoa uudempi.\\n\"\n\"\\n\"\n\"Mahdollisten hyökkäysmahdollisuuksien estämiseksi päivitysprosessi on keskeytetty ja lataus tullaan poistamaan. Lisätietoja tapahtumasta löytyy Rufuksen lokista.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Näytä sovelluksen asetukset\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Näytä tietoa tästä sovelluksesta\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Näytä loki\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Luo levykuva valitusta laitteesta\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Tällä valinnalla voit määrittää, aiotko asentaa Windowsin toiselle levylle vai haluatko käyttää Windowsia suoraan tältä asemalta (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Pikanollataan asemaa: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"tämä voi viedä hetken\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD-tunnistus\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Pakattu arkisto\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Valitsemasi ISO-levykuva on UEFI-muotoinen ja tarpeeksi pienikokoinen kirjoitettavaksi EFI-järjestelmäosiona (ESP). ESP-osioon kirjoittaminen voi soveltua paremmin tietyille asennustavoille sen sijaan, että kirjoitus tapahtuisi yleiseen dataosioon käyttäen kaiken levytilan.\\n\"\n\"\\n\"\n\"Valitse tila, jota haluat käyttää tämän levykuvan kirjoittamiseen:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Paina %s (ohjelman pääikkunassa) ottaaksesi ominaisuuden käyttöön.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Lisähajautusarvot (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Tallenna VHD:lle\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Laske levykuvan tarkistussummat\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Useita painikkeita\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Testien lukumäärä\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"Levyn tunniste\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Säikeiden vakioprioriteetti: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Sivuuta Boot Marker\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Päivitetään osioiden sijoittelua (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Valitsemasi levykuva on ISOHybrid-muotoinen, mutta sen tekijät eivät ole tehneet siitä yhteensopivaa ISO/tiedostotyyppisen kopiointitilan kanssa.\\n\"\n\"Tämän vuoksi käyttöön otetaan DD-kuvan kirjoitustila.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Ei voitu avata tai lukea kohdetta '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Asetetaan Windowsin mukautusasetuksia: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Asetetaan käyttäjäasetuksia...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows-käyttäjäkokemus\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Mukauta Windows-asennusta?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Poista vaatimus 4GB+ keskusmuistille, Secure Bootille ja TPM 2.0:lle\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Poista vaatimus Microsoftin online-käyttäjätilille\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Poista käytöstä datan keräys (Ohita yksityisyyskysymykset)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Estä Windows To Go:n pääsy sisäisiin levyihin\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Luo paikallinen käyttäjätili käyttäjänimellä:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Aseta alueelliset vaihtoehdot samoihin asetuksiin kuin nykyisellä käyttäjällä\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Poista käytöstä automaattinen laitteen BitLocker-salaus\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Pysyvä lokitiedosto\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Uusi tiedosto ('diskcopy.dll') on ladattava Microsoftilta MS-DOSin asennusta varten:\\n\"\n\"- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi sen\\n\"\n\"- Valitse 'Ei' peruuttaaksesi toiminnon\\n\"\n\"\\n\"\n\"Huomio: Tiedosto ladataan sovelluksen kansioon ja sitä uudelleenkäytetään automaattisesti, jos se on jo olemassa.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Mitätöity UEFI-käynnistyslataaja havaittu\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus havaitsi, että käyttämäsi ISO-levykuva sisältää UEFI-käynnistyslataajan, joka on mitätöity ja tulee aiheuttamaan %s Secure Bootin ollessa päällä ajantasaisessa UEFI-kokoonpanossa.\\n\"\n\"\\n\"\n\"- Jos olet hankkinut tämän ISO-levykuvan ei-luotettavasta lähteestä, huomioi UEFI-haittaohjelmien mahdollisuus ja vältä siltä käynnistämistä.\\n\"\n\"- Jos olet hankkinut sen luotettavasta lähteestä, sinun tulisi yrittää etsiä uudempi versio, joka ei aiheuta tätä varoitusta.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"\\\"Turvallisuusrikkomus\\\"-näkymän\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"Windowsin palautusnäkymän (BSOD) viestillä '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Pakattu VHDX-levykuva\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Pakkaamaton VHD-levykuva\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Full Flash Update -levykuva\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Tämän toiminnon käyttäminen vaatii lisätiedostojen lataamista Microsoftilta:\\n\"\n\"- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi ne\\n\"\n\"- Valitse 'Ei' peruuttaaksesi toiminnon\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Rajoita Windows S Mode-tilaan (EI YHTEENSOPIVA verkkotilin ohituksen kanssa)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Asiantuntijatila\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Puretaan tiedostoarkistoja: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Rufusin MBR:n käyttö\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus on ohjelma, joka auttaa alustamaan ja luomaan boottaavia USB-laitteita, kuten esimerkiksi USB-avaimia, muistitikkuja jne.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Virallinen sivusto: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Lähdekoodi: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Muutosloki: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Tämä sovellus on lisensoitu GNU Public License (GPL) version 3 ehtojen mukaisesti.\\n\"\n\"Lisätietoja osoitteessa https://www.gnu.org/licenses/gpl-3.0.html (englanniksi).\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Boottaus\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Alusta USB-asemia, muistikortteja ja virtuaalisia asemia muotoon FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Luo boottaavia FreeDOS USB-asemia\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Luo käynnistysasemia boottaavista ISO-kuvista (Windows, Linux jne.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Luo käynnistysasemia boottaavista levykuvista, pakatut kuvat mukaanlukien\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Luo BIOS- tai UEFI-boottaavia asemia, mukaanlukien UEFI-boottaavat NTFS-asemat\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Luo 'Windows To Go' -asemia\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Luo Windows 11 -asennusasemia tietokoneille, jotka eivät tue TPM- tai Secure Boot -ominaisuuksia\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Luo pysyviä Linux-osioita\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Luo VHD/DD-kuvia valitusta asemasta\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Laske MD5, SHA-1, SHA-256 ja SHA-512 tarkistussummia valitusta levykuvasta\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Suorita viallisten lohkojen tarkistuksia, sisältäen \\\"valheellisten\\\" muistitikkujen tunnistamisen\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Lataa virallisia Microsoft Windowsin jälleenmyyntiversion ISO-levykuvia\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Lataa UEFI Shell ISO-levykuvia\"\n"
  },
  {
    "path": "res/loc/po/fr-FR.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.14\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2026-03-17 22:51+0000\\n\"\n\"PO-Revision-Date: 2026-03-17 23:06+0000\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: fr_FR\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: French (Français)\\n\"\n\"X-Rufus-LCID: 0x040c, 0x080c, 0x0c0c, 0x100c, 0x140c, 0x180c, 0x1c0c, 0x200c, 0x240c, 0x280c, 0x2c0c, 0x300c, 0x340c, 0x380c, 0xe40c\\n\"\n\"X-Generator: Poedit 3.9\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Options de Périphérique\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Périphérique\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Type de démarrage\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Sélection\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Option d'image\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Schéma de partition\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Système de destination\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Lister les disques durs USB\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Ajouter les options de compatibilité pour vieux BIOS\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Activer la validation des média sous UEFI\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Options de Formatage\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Système de fichiers\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Taille d'unité d'allocation\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Nom de volume\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Formatage rapide\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Vérification de mauvais blocs\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Ajouter un label étendu et une icône\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Statut\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Fermer\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Démarrer\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"A propos de Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licence\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Licence Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Plus d'information\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Oui\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Non\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Effacer\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Enregistrer\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Paramètres de mises à jour\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Options\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Recherche mises à jour\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Inclure les versions bêta\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Chercher maintenant\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Mise à jour de Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Une nouvelle version est disponible. Veuillez télécharger la nouvelle version !\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Cliquez ici pour aller sur le site de Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Notes relatives à cette version\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Télécharger\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Autre instance détectée\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Une autre instance de Rufus est en cours d'exécution.\\n\"\n\"Veuillez fermer la première instance avant d'en lancer une seconde.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"ATTENTION : TOUTES LES DONNEES DU VOLUME '%s' VONT ETRE EFFACEES.\\n\"\n\"Pour continuer cette opération, cliquez sur OK.\\n\"\n\"Pour quitter cliquez sur ANNULER.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Mises à jour\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Voulez-vous autoriser Rufus à chercher des mises à jour en ligne ?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Annuler\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Blocs défectueux détectés\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Vérification complète : %d bloc(s) défectueux détecté(s)\\n\"\n\"  %d erreur(s) de lecture\\n\"\n\"  %d erreur(s) d'écriture\\n\"\n\"  %d erreur(s) de corruption\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Un rapport plus détaillé peut être obtenu à :\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Jamais\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Quotidienne\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Hebdomadaire\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Mensuelle\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Personnalisée\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Votre version : %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Dernière version : %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"octets\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"Ko\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"Mo\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"Go\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"To\"\n\n#. • MSG_025\n#.\n#. *Short* version of the petabyte size suffix\nmsgid \"PB\"\nmsgstr \"Po\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilo-octets\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"méga-octets\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Défaut\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Défaut)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (ou UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS ou UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d passe\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Image ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Annuler\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Lancer\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Opération annulée par l'utilisateur\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Erreur\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Erreur : %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Téléchargement de fichier\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Pérpih. de stockage USB (Générique)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Disque %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Plusieurs partitions\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Flush de la mémoire tampon\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Annulation\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Opération réussie.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Erreur indéterminée lors du formatage.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Ce système de fichiers ne peut pas être utilisé ici.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"L'accès au périphérique est refusé.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Le périphérique est protégé en écriture.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Le périphérique est en cours d'utilisation par une autre application. Veuillez fermer toute autre application susceptible d'accéder au périphérique.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Le formatage rapide n'est pas disponible pour ce périphérique.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Le nom de volume est invalide.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Le handle de périphérique est invalide.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Cette taille de cluster n'est pas applicable ici.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"La taille du volume est invalide.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Veuillez insérer un média dans le lecteur.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Une commande non prise en charge a été reçue.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Erreur d'allocation mémoire.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Erreur de lecture.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Erreur d'écriture.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"L'installation a échoué\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Impossible d'accéder au média. Il peut être en cours d'utilisation par une autre application. Essayer de déconnecter le média et essayez à nouveau.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Échec de partitionnement.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Impossible de copier les fichiers sur le périphérique de destination.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Opération annulée par l'utilisateur.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Impossible de créer le thread.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"La vérification de blocs défectueux a été interrompue.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Échec d'analyse de l'image ISO.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Échec d'extraction de l'image ISO.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Échec lors du remontage du volume.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Échec de modification des fichiers de démarrage.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Échec d'assignation d'une lettre de volume.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Impossible de monter le volume GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Le périphérique n'est pas prêt.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus a détecté que Windows est en train de finir de vider la mémoire tampon.\\n\"\n\"\\n\"\n\"En fonction de la vitesse de votre périphérique et de la taille du fichier, cette opération peut prendre beaucoup de temps.\\n\"\n\"\\n\"\n\"Nous recommandons d'attendre que Windows complète cette opération pour éviter la corruption du périphérique. Mais si jamais vous en avez marre d'attendre, vous pouvez essayer de déconnecter le média...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Image non prise en charge\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Cette image n'est pas démarrable, ou bien elle utilise une méthode de démarrage ou de compression qui n'est pas compatible avec Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Remplacer %s ?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Cette image ISO utilise une version obsolète du fichier '%s'.\\n\"\n\"Les menus de démarrage peuvent de pas fonctionner à cause de cela.\\n\"\n\"\\n\"\n\"Rufus peut télécharger une nouvelle version du fichier pour résoudre ce problème :\\n\"\n\"- Choisissez 'Oui' pour télécharger le fichier depuis Internet\\n\"\n\"- Choisissez 'Non' pour garder le fichier de l'image ISO\\n\"\n\"Si vous ne savez pas quoi faire, sélectionnez 'Oui'.\\n\"\n\"\\n\"\n\"Note : Le nouveau fichier sera téléchargé dans le répertoire courant. Si un '%s' existe à cet endroit, il sera réutilisé automatiquement.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Téléchargement de %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Aucune image sélectionnée\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"pour NAND %s\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Image trop large\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"L'image est trop large pour être copiée sur le périphérique sélectionné.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Image ISO non prise en charge\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Quand UEFI est sélectionné, seules les images ISO basées sur EFI sont supportées. Veuillez sélectionner une image ISO démarrable avec EFI ou sélectionner BIOS pour le système de destination.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Système de fichiers non pris en charge\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"IMPORTANT : CE PÉRIPHÉRIQUE CONTIENT PLUSIEURS PARTITIONS !!\\n\"\n\"\\n\"\n\"Ceci peut inclure des partitions/volumes qui ne sont pas listées ou bien visibles depuis Windows. Si vous décidez de continuer, vous êtes responsable de toute perte de données intervenant sur ces partitions.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Partitions multiples détectées\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"Image DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Le système de fichiers sélectionné ne peut pas être utilisé avec ce type d'image ISO. Veuillez sélectionner un système de fichiers different file ou une autre ISO.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' peut seulement être appliqué pour un système de fichiers NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"IMPORTANT : Vous essayez d'installer 'Windows To Go', mais votre périphérique de destination ne possède pas l'attribut 'FIXE'. A cause de cela, Windows va très probablement geler lors du démarrage, car Microsoft ne l'a pas conçu pour fonctionner avec des périphériques qui possèdent l'attribut 'AMOVIBLE'.\\n\"\n\"\\n\"\n\"Voulez vous continuer malgré celà ?\\n\"\n\"\\n\"\n\"Note : L'attribut 'FIXE/AMOVIBLE' est une propriété matérielle qui peut uniquement être changée avec des outils propriétaires, que les fabriquants de périphériques ne fournissent PRESQUE JAMAIS au public...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Limitation du système de fichiers\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Cette image ISO contient un fichier de plus de 4 Go, soit plus que la taille maximale autorisée pour un système de fichiers FAT ou FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Prise en charge des archives WIM non disponible\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Votre plateforme ne peut pas extraire les fichiers depuis les archives WIM. L'extraction de données WIM est nécessaire pour créer des médias USB démarrable avec EFI pour Windows 7/8 ou Windows Vista. Vous pouvez adresser ce problème en téléchargeant une version récente de l'utilitaire 7-Zip.\\n\"\n\"Voulez-vous visiter la page de téléchargements de 7-zip ?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Télécharger %s ?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s ou plus récent requiert l'installation d'un fichier '%s'.\\n\"\n\"Puisque ce fichier fait plus de 100 Ko et est toujours présent sur les images ISO à base de %s, il n'est pas inclus dans l'application.\\n\"\n\"\\n\"\n\"Rufus peut télécharger ce fichier pour vous :\\n\"\n\"- Choisissez 'Oui' pour télécharger le fichier depuis Internet\\n\"\n\"- Choisissez 'Non' si vous compter copier ce fichier manuellement\\n\"\n\"Note : Ce fichier est téléchargé dans le répertoire courant. Une fois qu'un fichier'%s' existe à cet endroit, il sera réutilisé automatiquement.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Annuler peut laisser le périphérique dans un état inutilisable.\\n\"\n\"Si vous êtes sûr de vouloir annuler, sélectionnez OUI. Sinon, sélectionnez NON.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Sélection de répertoire\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Tous les fichiers\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Log Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (disque %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS ne peut pas être utilisé sur un disque avec une Taille de clusters de 64 kilo-octets.\\n\"\n\"Veuillez changer la Taille de clusters ou utilisez FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Taille de clusters incompatible\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Le formatage d'un volume UDF de grande taille peut prendre beaucoup de temps. Aux vitesses USB 2.0, la durée de formatage estimée est %d :%02d, pendant laquelle la barre de progrès semblera gelée. Veuillez être patient !\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Volume UDF de grand taille\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Cette image utilise Syslinux %s%s mais l'application inclus seulement les fichiers d'installation pour Syslinux %s%s.\\n\"\n\"\\n\"\n\"Comme les nouvelles versions de Syslinux sont incompatibles entre elles, et il n'est pas possible à Rufus de toutes les inclure, deux fichiers supplémentaires ('ldlinux.sys' et 'ldlinux.bss') doivent être téléchargés :\\n\"\n\"- Choisissez 'Oui' pour télécharger ces fichier depuis Internet\\n\"\n\"- Choisissez 'Non' pour annuler l'opération\\n\"\n\"Note : Ces fichier seront téléchargés dans le répertoire courant et réutilisés automatiquement une fois présents.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Téléchargement nécessaire\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Cette image utilise Grub %s mais l'application inclus seulement les fichiers d'installation pour Grub %s.\\n\"\n\"\\n\"\n\"Comme différentes versions de Grub peuvent êtres incompatibles, et il n'est pas possible à Rufus de toutes les inclure, Rufus va essayer de télécharger une version du fichier d'installation de Grub ('core.img') qui correspond a cette de votre image :\\n\"\n\"- Choisissez 'Oui' pour télécharger ces fichier depuis Internet\\n\"\n\"- Choisissez 'Non' pour utiliser la version par défaut de Rufus\\n\"\n\"- Choisissez 'Annuler' pour annuler cette opération\\n\"\n\"Note : Ce fichier sera téléchargé dans le répertoire courant et réutilisé automatiquement une fois présent. Si il n'est pas possible de trouver une version correspondante en ligne, la version par défaut sera utilisée.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Installation standard de Windows\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"options de périphérique avancées\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"options de formatage avancées\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Afficher les %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Cacher les %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Taille de partition persistente\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Désactivée\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the persistence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Etablit la taille de la partition persistente pour media USB de type \\\"live\\\". Une taille de 0 désactive l’utilisation d’une partition persistente.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Unité de taille utilisée pour la partition persistente.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Ne plus montrer ce message\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Note importante à propos de %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Vous venez juste de créer un média qui utilise UEFI:NTFS. Veuillez prendre note que, pour pouvoir démarrer ce média, VOUS DEVEZ DESACTIVER SECURE BOOT.\\n\"\n\"Pour plus d'informations (en Anglais) sur les raisons nécessitant ce changement, vous pouvez cliquer sur le bouton ci dessous.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Sélection d'image Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Cette ISO contient plusieurs images Windows.\\n\"\n\"Veuillez sélectionner l'image que vous souhaitez utiliser pour cette installation :\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Ce lecteur est utilisé par une autre application ou un autre processus. Voulez-vous quand même le formater ?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus a détecté que vous êtes en train de créer un média 'Windows To Go' à partir d'une ISO 1809.\\n\"\n\"\\n\"\n\"A cause d'un *BUG MICROSOFT*, ce média va planter durant le démarrage de Windows (Blue Screen Of Death), à moins que vous ne remplaciez le fichier 'WppRecorder.sys' par la version 1803.\\n\"\n\"\\n\"\n\"Veuillez aussi noter que la raison pour laquelle Rufus ne peut pas corriger ce problème pour vous est que le fichier 'WppRecorder.sys' est sujet au copyright de Microsoft, donc nous ne pouvons pas légalement en produire une copie avec cette application...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Parce que MBR a été sélectionné pour le schéma de partition, Rufus peut seulement créer une partition sur ce média occupant jusqu’à 2 To, ce qui laissera %s d’espace disque non-disponible.\\n\"\n\"\\n\"\n\"Êtes-vous sûr de vouloir continuer ?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Édition\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Langue de produit\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Continuer\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Retour\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Veuillez patienter...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Télécharger avec un navigateur\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Le téléchargement des ISOs de Windows n'est pas disponible car Microsoft a modifié son site web pour les empêcher.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 ou ultérieur est nécessaire pour lancer ce script.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Voulez-vous aller en ligne pour le télécharger ?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Execution du script de téléchargement...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Télécharger une image ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Type d'ordinateur avec lequel vous comptez utiliser ce disque démarrable. Il est de votre responsabilité de déterminer s'il s'agit d'un type BIOS ou UEFI avant de commencer a créer votre périphérique, car il risque de ne pas démarrer sinon.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' signifie que le périphérique démarrera seulement en mode émulation BIOS (i.e. 'Legacy Mode') sous UEFI, et non pas en mode UEFI natif.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'non CSM' signifie que le périphérique démarrera seulement en mode UEFI natif, et non pas en mode émulation BIOS (i.e. 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Motif de test : 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Motif de test : 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Motif de test : 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Motif de test : 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Sélectionne le système de fichiers\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Taille minimum qu’un bloc de données occupera sur le système de fichiers\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Utilisez ce champ pour mettre à jour le nom du volume.\\n\"\n\"Les caractères étendus et les accents sont acceptés.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Affiche/Cache les options avancées\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Détecte la présence de blocs défectueux en écrivant un motif de test\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Décochez cette case si vous voulez utiliser la méthode de formatage \\\"lente\\\"\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Methode qui sera utilisée pour créer les partitions\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Méthode à utiliser pour rendre le périphérique démarrable\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Cliquez ici pour sélectionner ou télécharger une image...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Cochez cette case pour permettre l’affichage des caractères étendus/internationaux et ajouter une icône (ceci crée un fichier autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Installe un fichier de démarrage UEFI, qui effectue une validation MD5Sum du média\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Créé une petite partition supplémentaire et aligner les partitions.\\n\"\n\"Peut améliorer la détection du périphérique pour les vieux BIOS.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Liste les disques durs externes USB. UTILISEZ A VOS PROPRES RISQUES !!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"Lance le formatage. Cette opération DETRUIT toutes les données sur le périphérique sélectionné !\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Signature de téléchargement invalide\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Cliquez pour sélectionner...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - L'utilitaire de formatage USB fiable\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Traduction Française : Pete Batard <mailto:pete@akeo.ie>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Soumettre un bug ou une demande d'amélioration à :\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Copyrights supplémentaires :\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Politique de mises à jour :\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Si vous autorisez ce programme à chercher les mises à jour, vous acceptez que les informations suivantes peuvent être collectées sur nos serveurs :\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"L’architecture de votre système d’exploitation ainsi que sa version\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"La version de l’application que vous utilisez\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Votre adresse IP\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Afin de générer des statistiques d’utilisation privées, il se peut que nous gardions les informations ainsi obtenues \\\\b au plus un an\\\\b0 . A moins d’y être contraint par la loi, nous nous engageons aussi à ne pas diffuser ces informations à de tierce parties.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Processus de mise à jour :\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Aucun service ou tâche de fond n'est installé ou lancé par Rufus ; la vérification de mises à jour intervient seulement lorsque l’application principale s'exécute.\\\\line\\n\"\n\"Bien entendu, un accès à internet est requis pour vérifier les mises à jour.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Image invalide pour l'option de démarrage sélectionnée\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"L'image choisie ne correspond pas à l'option de démarrage sélectionnée. Veuillez utiliser une image ou une option de démarrage différente.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Cette image ISO n'est pas compatible avec le système de fichiers sélectionné\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Périphérique incompatible détecté\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Phase d'écriture\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Phase de lecture\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Téléchargement completé pour %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Impossible de télécharger %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"La version par défaut du fichier %s sera utilisée\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"IMPORTANT : CE PÉRIPHÉRIQUE UTILISE UNE TAILLE DE SECTEUR NON STANDARD !\\n\"\n\"\\n\"\n\"La majorité des disques utilisent une taille de secteur de 512 octets, mais celui ci utilise une taille de %d octets. Dans la majorité des cas, cela veut dire que vous ne POUVEZ PAS démarrer un oridinateur depusi ce disque.\\n\"\n\"Rufus peut toujours essayer de créer un disque démarrable, mais il n'y a AUCUNE guarantie que cela marchera.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Taille de secteur non standard détectée\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' peut seulement être installé sur un disque partitionné au format GPT si il a l'attribut FIXE.Le disque sélectionné na pas été détecté comme FIXE.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Cette fonctionalité n'est pas disponible pour cette plateforme.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Annulation - Veuillez patienter...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Analyse de l'image...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Échec de l'analyse de l'image\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Fichier %s obsolète détecté\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Image utilisée : %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Fichier %s manquant\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Nouveau volume\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d périphérique détecté\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d périphériques détectés\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"PRÊT\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Opération annulée\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Échec\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Lancement de la nouvelle application...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Échec de lancement de l'application\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"%s ouvert\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"%s sauvegardé\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formatage : %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Système de fichiers : Tâche %d/%d terminée\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Finalisation NTFS : %d%% terminé\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formatage (%s) - durée estimée %d :%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Écriture du label (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formatage (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Finalisation NTFS (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Effacement des structures MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Requête d'accès disque...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analyse des structures de boot existantes...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Fermeture des volumes existants...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Écriture du MBR...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Écriture du PBR...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Copie des fichiers DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Copie des fichiers ISO : %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Écriture boot Win7 EFI (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Finalisation, veuillez patienter...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Installation de Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Test de défauts : %s %d/%d - %0.2f%% (%d/%d/%d erreurs)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Test de défauts : Test avec motif aléatoire\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Test de défauts : Test avec motif 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Partitionnement (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Suppression des partitions (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"La signature de la mise à jour qui vient d’être téléchargée ne peut pas être validée. Cela peut indiquer que votre système n’est pas configuré correctement pour la validation de signatures numériques, ou que le téléchargement contient un fichier malicieux.\\n\"\n\"\\n\"\n\"Le téléchargement va être supprimé. Veuillez consulter le log pour plus de détails.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Téléchargement : %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Échec de téléchargement du fichier.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Recherche des mises à jour...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Mises à jour : Impossible de se connecter\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Mises à jour : Impossible de lire les données\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Une nouvelle version de Rufus est disponible !\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Pas de nouvelle mise à jour\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Clés de registre supprimées\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Échec de suppression des clés registres\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s activé\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s désactivé\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Tests de dépassement de taille\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Détection de disques fixes\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Force 'large FAT32'\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun sera effacé en sortie\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Test de contrefaçons\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Support Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Support Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Forçage de mise à jour\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"Compression NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Écriture d'image : %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Support ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Affichage de tailles avec de VRAIES unités\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Suppression du dossier '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Détection de disque VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Mode dual UEFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Application de l'image Windows : %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Application de l'image Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Préservation des dates de fichiers\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Debug USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Calcul des checksums de l'image : %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Calcule les checksums MD5, SHA1 et SHA256 pour l'image sélectionée\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Change la langue de l'application\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Image %s détectée\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"L'image que vous avez sélectionnée est une image 'ISOHybrid'. Cela veut dire qu’elle peut être écrite soit en mode %s (copie de fichiers) ou en mode %s (image disque).\\n\"\n\"Rufus recommande d’utiliser le mode %s, de manière à ce que vous conserviez l’accès à votre périphérique après écriture.\\n\"\n\"Cependant, si vous rencontrez des erreurs lors du démarrage, vous pouvez à nouveau essayer d’écrire cette image, en mode %s.\\n\"\n\"\\n\"\n\"Veuillez sélectionner le mode que vous souhaitez utiliser pour écrire cette image :\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Écrire en mode %s (Recommandé)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Écrire en mode %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Recherche de processus en conflit...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Non démarrable\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Image disque ou ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Veuillez sélectionner)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Verrouillage exclusif de périphérique USB\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Signature invalide\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"L'exécutable téléchargé ne possède pas de signature numérique.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"L'exécutable téléchargé est signé par '%s'.\\n\"\n\"Il ne s'agit pas d'une signature que nous connaissons et peut indiquer une activité malicieuse...\\n\"\n\"Êtes-vous certain de vouloir lancer ce fichier ?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Effacement à zéro : %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Détection des disques détachables non-USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Privilèges élevés manquants\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Cette application peut seulement être exécutée avec les privilèges administrateur\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Indexation des fichiers\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Sélection de la version\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Sélectionnez la version de Windows que vous souhaitez installer :\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Version de Windows non prise en charge\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Cette version de Windows n'est plus prise en charge par Rufus.\\n\"\n\"La dernière version de Rufus compatible avec cette plateforme est v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Alerte: Version non-officielle\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Cette version de Rufus n'a pas produite par ses développeurs officiels.\\n\"\n\"\\n\"\n\"Êtes-vous sûr de vouloir la lancer ?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"ISO tronquée détectée\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Le fichier ISO que vous avez sélectionné ne fait pas la bonne taille : %s de données sont manquantes !\\n\"\n\"\\n\"\n\"Si vous avez obtenu ce fichier depuis Internet, vous devriez essayer de le télécharger à nouveau et verifier que le MD5 ou SHA correspond aux valeurs officielles.\\n\"\n\"\\n\"\n\"Notez que vous pouvez calculer le MD5 ou SHA depuis Rufus en cliquant le bouton (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Erreur de validation du timestamp\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus n'a pas pu valider que le timestamp du fichier de mise à jour téléchargé est plus récent que celui de l'exécutable en cours.\\n\"\n\"\\n\"\n\"Afin d'éviter des scenarios d'attaque potentiels, le processus de mise à jour a été interrompu et le téléchargement va être supprimé. Pour plus de détails, veuillez consulter le log.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Affiche les paramètres de l'application\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Affiche des informations à propos de cette application\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Affiche le log\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Crée une image disque à partir du périphérique sélectionné\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Utilisez cette option pour indiquer si vous voulez installer Windows sur un autre disque, ou bien exécuter Windows directement depuis ce périphérique (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Effacement 'rapide' à zéro : %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"peut prendre du temps\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Détection VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Archive compressée\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"L’image ISO que vous avez sélectionnée utilise EFI et est suffisamment petite pour être contenue entièrement dans une ESP (EFI System Partition). L’écriture en ESP, plutôt qu’en partition générique occupant la totalité de l’espace disque, peut s’avérer préférable pour certaines méthodes d’installation.\\n\"\n\"Veuillez sélectionner le mode d’écriture que vous souhaitez utiliser pour écrire cette image :\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Utilisez %s (dans la fenêtre d’application principale) pour active.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Checksum supplémentaire (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Sauver en image VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Calculer les checksums de l’image sélectionnée\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Multiples boutons\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Nombre de passes\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID disque\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Priorité de thread par défaut : %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignorer le marqueur de démarrage\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Rafraîchissement du schéma de partition (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"L’image que vous avez sélectionnée est de type ISOHybrid, mais ses créateurs ne l’ont pas rendue compatible avec le mode ISO (i.e. copie de fichier).\\n\"\n\"À cause de cela, seule l’écriture en mode DD est applicable.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Impossible d'ouvrir ou de lire '%s'\"\n\n#. • MSG_323\nmsgid \"Apply SkuSiPolicy.p7b on installation (See KB5042562)\"\nmsgstr \"Appliquer SkuSiPolicy.p7b après installation (Consultez KB5042562)\"\n\n#. • MSG_324\nmsgid \"QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)\"\nmsgstr \"Améliorations 'QoL' (Ne force pas Copilot, OneDrive, Outlook, Fast Startup, etc.)\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Application des options de personnalisation de Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Application des options utilisateur...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Expérience de l'utilisateur Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Personnaliser l'installation de Windows ?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Supprimer la nécessité d'avoir 4Go+ de RAM, Secure Boot et TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Supprimer la nécessité d'utiliser un compte utilisateur Microsoft en ligne\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Désactiver la collecte de données (Supprime les questions de confidentialité)\"\n\n#. • MSG_332\nmsgid \"Prevent 'Windows To Go' from accessing internal disks\"\nmsgstr \"Empêcher 'Windows To Go' d'accéder aux disques internes\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Créer un compte local sous le nom de :\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Définir les options régionales avec les mêmes valeurs que celles de cet utilisateur\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Désactiver le chiffrement automatique BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Log persistent\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('%s') must be downloaded from Microsoft to use this feature:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Un fichier supplémentaire ('%s') doit être téléchargé depuis Microsoft pour utiliser cette fonctionalité :\\n\"\n\"- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger\\n\"\n\"- Sélectionnez 'Non' pour annuler l’opération\\n\"\n\"\\n\"\n\"Note : Ce fichier sera téléchargé dans le répertoire de l'application et réutilisé automatiquement s'il est présent.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Bootloader UEFI révoqué détecté\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus a détecté que l’ISO que vous avez sélectionnée contient un bootloader UEFI révoqué, qui devrait produire %s sur un système UEFI à jour, lorsque 'Secure Boot' est activé.\\n\"\n\"\\n\"\n\"- Si vous avez obtenu cette image ISO à partir d’une source douteuse, vous devriez envisager la possibilité qu’elle puisse contenir un logiciel malveillant, et éviter de démarrer à partir de celle-ci.\\n\"\n\"- Si vous l’avez obtenu à partir d’une source fiable, vous devriez essayer de trouver une version plus récente, où cette notification ne se produit pas.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"un écran « Violation de sécurité »\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"un écran de récupération Windows (BSOD) avec '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Image VHDX compressée\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Image VHD non compressée\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Image 'Full Flash Update'\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Des données complémentaires doivent être téléchargées à partir du site Microsoft avant d'utiliser cette fonctionnalité :\\n\"\n\"- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger ces données\\n\"\n\"- Sélectionnez 'Non' pour annuler l’opération\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Restreint Windows au mode \\\"S\\\" (INCOMPATIBLE avec l'option de désactivation d'un compte utilisateur Microsoft en ligne)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Mode expert\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Extraction d'archive : %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Utilisation du MBR Rufus\"\n\n#. • MSG_350\nmsgid \"Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)\"\nmsgstr \"Utiliser les bootloaders signés par 'Windows CA 2023' (nécessite un PC cible compatible)\"\n\n#. • MSG_351\nmsgid \"Checking for UEFI bootloader revocation...\"\nmsgstr \"Vérification de la revocation des bootloaders UEFI...\"\n\n#. • MSG_352\nmsgid \"Checking for UEFI DBX updates...\"\nmsgstr \"Vérification des mises à jour de DBX UEFI...\"\n\n#. • MSG_353\nmsgid \"DBX update available\"\nmsgstr \"Mise à jour DBX disponible\"\n\n#. • MSG_354\nmsgid \"\"\n\"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\\n\"\n\"- Select 'Yes' to connect to the Internet and download this content\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Rufus a trouvé une mise à jour des fichiers DBX utilisés pour effectuer la validation des revocations Secure Boot sous UEFI. Voulez-vous télécharger cette mise à jour ?\\n\"\n\"- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger ce contenu\\n\"\n\"- Sélectionnez 'Non' pour annuler l’opération\\n\"\n\"\\n\"\n\"Note : Ces fichiers seront téléchargés dans le répertoire de l'application et réutilisés automatiquement si ils sont présent.\"\n\n#. • MSG_355\nmsgid \"⚠SILENTLY⚠ erase disk and install:\"\nmsgstr \"Effacera le disque ⚠SILENCIEUSEMENT⚠ et installera:\"\n\n#. • MSG_356\nmsgid \"\"\n\"You have selected to use the \\\"silent\\\" Windows installation option.\\n\"\n\"\\n\"\n\"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\\n\"\n\"\\n\"\n\"If this is not what you want, please select 'No'to go back and uncheck the option.\\n\"\n\"Otherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU.\"\nmsgstr \"\"\n\"Vous avez sélectionné l'option d'installation de Windows dite \\\"silencieuse\\\".\\n\"\n\"\\n\"\n\"Il s'agit d'une option avancée, réservée à ceux qui souhaitent créer un média d'installation qui ne posera aucune question à l'utilisateur pendant l'installation de Windows et qui EFFACERA SANS CONDITION le premier disque détecté sur le système cible. Si vous n'y prenez pas garde, l'utilisation de cette option peut résulter en une PERTE DE DONNÉES IRREVERSIBLE !\\n\"\n\"\\n\"\n\"Si cela n'est pas ce que vous souhaitez veuillez sélectionner 'Non' pour revenir en arrière et désélectionner cette option.\\n\"\n\"Sinon, si vous sélectionnez 'Oui', vous indiquez que toute perte de donnée en résultant sera entièrement VOTRE responsabilité.\"\n\n#. • MSG_358\nmsgid \"Unsupported image location\"\nmsgstr \"Placement d'image non supporté\"\n\n#. • MSG_359\nmsgid \"\"\n\"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\\n\"\n\"\\n\"\n\"Please move the image to a different location and try again.\"\nmsgstr \"\"\n\"Vous ne pouvez pas utiliser une image située sur le périphérique cible, puisque ce dernier va être complètement effacé. Cela revient au même qu'essayer de scier la branche sur laquelle vous êtes assis !\\n\"\n\"\\n\"\n\"Veuillez déplacer l'image sur un autre disque et réessayez.\"\n\n#. • MSG_360\nmsgid \"It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available.\"\nmsgstr \"Vous pouvez laisser cette option activée même si vous avez une puce TPM ou plus de RAM, car l'option contourne simplement les prérequis du programme d'installation et n'empêche absolument pas Windows d'utiliser toutes ces ressources si disponibles.\"\n\n#. • MSG_361\nmsgid \"For this option to work, network/Internet MUST be disconnected during installation!\"\nmsgstr \"Pour que cette option fonctionne, vous DEVEZ déconnecter le réseau/Internet pendant l'installation !\"\n\n#. • MSG_362\nmsgid \"Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user.\"\nmsgstr \"Répond automatiquement 'non' aux questions du programme d'installation de Windows en ce qui concerne l'autorisation du partage de données avec Microsoft, au lieu de demander à l'utilisateur.\"\n\n#. • MSG_363\nmsgid \"You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades.\"\nmsgstr \"Laissez cette option activée à moins que vous acceptiez que 'Windows To Go' puisse accéder aux disques internes pour effectuer des mises à jour, silencieuses et irréversible, des systèmes de fichiers.\"\n\n#. • MSG_364\nmsgid \"Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon.\"\nmsgstr \"Crée un compte local automatiquement, pour le nom spécifié, et avec un mot de passe vide qui devra être changé à la prochaine session.\"\n\n#. • MSG_365\nmsgid \"Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user.\"\nmsgstr \"Réplique les options régionales de ce PC (clavier, fuseau horaire, monnaie), au lieu de demander à l'utilisateur.\"\n\n#. • MSG_366\nmsgid \"Don't encrypt the system disk, unless explicitly requested by the user.\"\nmsgstr \"Ne chiffre pas le disque système, sauf si l'utilisateur le demande explicitement.\"\n\n#. • MSG_367\nmsgid \"Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows.\"\nmsgstr \"Activez cette option seulement si vous savez ce qu'est S-Mode et comprenez que votre système pourra être restreint au S-Mode même si vous supprimez Windows et le réinstallez complètement.\"\n\n#. • MSG_368\nmsgid \"Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system.\"\nmsgstr \"Activez cette option si le système que vous installez utilise des certificats Secure Boot complètement à jour. Si nécessaire, vous pouvez utiliser 'Mosby' pour mettre votre système à jour.\"\n\n#. • MSG_369\nmsgid \"Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting.\"\nmsgstr \"Activez cette option pour révoquer des bootloaders supplémentaires de Windows, mais avec le risque de ne plus pouvoir démarrer depuis des media Windows standard.\"\n\n#. • MSG_370\nmsgid \"\\\"Quality of Life\\\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users.\"\nmsgstr \"Améliorations \\\"Quality of Life\\\" : Désactive la plupart des fonctionnalités que Microsoft essaie de pousser, contre leur gré, aux utilisateurs.\"\n\n#. • MSG_371\nmsgid \"If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase.\"\nmsgstr \"Si vous utilisez cette option, veuillez-vous assurer que tous les disques, sauf celui sur lequel vous voulez installer Windows, est déconnecté du PC cible, et aussi que vous ne laisserez pas le média connecté sur un PC que vous ne voulez pas réinstaller.\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus est un utilitaire permettant de formater et de créer des média USB amorçables, tels que clés USB, mémoire flash, etc.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Site officiel : %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Code source: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Cette application est fournie sous les termes de la Licence publique générale GNU (GPL) version 3.\\n\"\n\"Veuillez consulter https://www.gnu.org/licenses/gpl-3.0.fr.html pour plus de details.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Amorçable\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatez des périphériques USB, des cartes flash et des disques virtuels en FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Créez des disques amorçable FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Créez des disques amorçables à partir d'images ISOs (Windows, Linux, etc.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Créez des disques amorçables à partir d'images disque, y compris à partir d'images compressées\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Créez des disques amorçables BIOS ou UEFI, y compris des disques UEFI amorçables utilisant NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Créez des disques 'Windows To Go'\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Créez des disques d'installation Windows 11 pour des PCs qui ne disposent pas de TPM ou Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Créez des partitions persistentes pour Linux\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Créez des images VHD/DD du périphérique sélectionné\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Calculez les sommes de contrôle MD5, SHA-1, SHA-256 et SHA-512 de l'image sélectionnée\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Executez un test de mauvais secteurs avec detection des \\\"fake drives\\\"\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Téléchargez des images ISOs commerciales officielles de Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Téléchargez des images ISOs du Shell UEFI\"\n"
  },
  {
    "path": "res/loc/po/he-IL.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-04-25 21:07+0300\\n\"\n\"PO-Revision-Date: 2024-04-26 01:31+0300\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: he_IL\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Hebrew (עברית)\\n\"\n\"X-Rufus-LCID: 0x040d\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"מאפייני הכונן\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"התקן\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"בחירת האתחול\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"בחירה\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"אפשרות קובץ תמונה\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"סגנון המחיצות\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"מערכת היעד\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"הצגת רשימה של כונני USB קשיחים\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"הוספת תיקונים ל־BIOS־ים ישנים (מחיצה נוספת, יישור...)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"הפעלת אימות מדיה של UEFI בזמן ריצה\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"אפשרויות אתחול\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"מערכת הקבצים\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"גודל האשכול\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"תווית שם אמצעי האחסון\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"אתחול מהיר\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"בדיקת ההתקן אחר אזורים פגומים\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"יצירת תווית מורחבת וקובצי סמל\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"מצב\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"סגירה\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"התחלה\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"על אודות Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"רישיון\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"אישור\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"רישיון Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"מידע נוסף\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"כן\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"לא\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"יומן רישום\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"ניקוי\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"שמירה\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"מדיניות העדכונים והגדרות\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"הגדרות\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"חיפוש אחר עדכונים\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"כולל גרסאות בטא\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"לבדוק כעת\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"חיפוש אחר עדכונים - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"גרסה חדשה זמינה להורדה. נא להוריד את הגרסה האחרונה!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"נא ללחוץ כאן כדי לעבור לאתר הבית\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"הערות שחרור גרסה\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"הורדה\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"זוהתה הפעלה אחרת\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"חלון Rufus אחר פועל ברקע.\\n\"\n\"נא לסגור את היישום הראשון לפני הפעלת יישום נוסף.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"אזהרה: כל הנתונים על ההתקן '%s' יושמדו.\\n\"\n\"כדי להמשיך בפעולה זו, יש ללחוץ על אישור. כדי לצאת יש ללחוץ על ביטול.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"מדיניות העדכונים של Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"האם ברצונך לאפשר ל־Rufus לבדוק אחר עדכונים באינטרנט?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"ביטול\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"נמצאו אזורים פגומים\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"הבדיקה הושלמה: %d אזורים פגומים נמצאו\\n\"\n\"  %d שגיאות קריאה\\n\"\n\"  %d שגיאות כתיבה\\n\"\n\"  %d שגיאות השחתה\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"ניתן למצוא דוח מפורט יותר במיקום:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"מושבת\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"יומי\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"שבועי\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"חודשי\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"מותאם אישית\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"הגרסה שלך: %d.%d (בנייה %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"הגרסה האחרונה: %d.%d (בנייה %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"בתים\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"קילו בתים\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"מגה בתים\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"ברירת מחדל\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (ברירת מחדל)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (או UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (שאינו CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS או UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"מעבר אחד\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d מעברים %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"קובץ ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"יישום\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"ביטול\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"פתיחה\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"הפעולה בוטלה על־ידי המשתמש\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"שגיאה\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"שגיאה: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"הורדת קובץ\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"התקן אחסון USB (כללי)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (דיסק %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"מחיצות מרובות\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - מרוקן חוצצים\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - ביטול\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"הצלחה.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"שגיאה לא מזוהה במהלך האתחול.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"לא ניתן להשתמש במערכת הקבצים שנבחרה עבור המדיה הזו.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"הגישה להתקן נדחתה.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"ההתקן מוגן מפני כתיבה.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"ההתקן בשימוש על־ידי תהליך אחר. נא לסגור כל תהליך אחר שעשוי להשתמש בהתקן.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"אתחול מהיר אינו זמין עבור התקן זה.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"תווית השם של אמצעי האחסון אינה תקינה.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"מזהה ההתקן (handle) אינו תקין.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"גודל האשכול שנבחר אינו תקין להתקן זה.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"גודל אמצעי האחסון אינו תקין.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"נא להכניס מדיה נשלפת לכונן.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"התקבלה פקודה שאינה נתמכת.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"שגיאה בהקצאת זיכרון.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"שגיאת קריאה.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"שגיאת כתיבה.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"שגיאת התקנה\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"לא ניתן לפתוח את המדיה. ייתכן שהיא בשימוש על־ידי תהליך אחר. נא לחבר מחדש את המדיה ולנסות שוב.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"לא ניתן לחלק את הכונן למחיצות.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"לא ניתן להעתיק קבצים לכונן היעד.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"בוטל על־ידי המשתמש.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"לא ניתן להתחיל תהליכון.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"בדיקת האזורים הפגומים לא הושלמה.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"כשל בסריקת קובץ ה־ISO.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"כשל בחילוץ קובץ ה־ISO.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"לא ניתן להציב מחדש את אמצעי האחסון.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"לא ניתן להכין קבצים לאתחול.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"לא ניתן להקצות אות לכונן.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"לא ניתן להציב אמצעי אחסון GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"ההתקן לא מוכן.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus זיהה ש־Windows עדיין מרוקן את החוצצים הפנימיים שלו לתוך התקן ה־USB.\\n\"\n\"\\n\"\n\"בהתאם למהירות התקן ה־USB שלך, פעולה זו עשויה להימשך זמן רב, במיוחד עבור קבצים גדולים.\\n\"\n\"\\n\"\n\"אנחנו ממליצים לתת ל־Windows לסיים, כדי להימנע מיצירת שגיאות נתונים. אבל אם נמאס לך לחכות, ניתן פשוט לנתק את ההתקן...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"קובץ לא נתמך\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"קובץ תמונה זה לא ניתן לאתחול, או שהוא משתמש בשיטת כיווץ או אתחול שלא נתמכת על־ידי Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"האם להחליף את %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"נראה שקובץ ה־ISO הזה משתמש בגרסה מיושנת של '%s'.\\n\"\n\"לפיכך, ייתכן שתפריטי האתחול לא יוצגו כראוי.\\n\"\n\"\\n\"\n\"Rufus יכול להוריד גרסה חדשה יותר כדי לתקן בעיה זו:\\n\"\n\"- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את הקובץ\\n\"\n\"- יש לבחור 'לא' כדי להשאיר את קובץ ה־ISO ללא שינויים\\n\"\n\"אם לא ברור לך מה לעשות, כדאי לבחור באפשרות 'כן'.\\n\"\n\"\\n\"\n\"הערה: הקובץ החדש יירד לספרייה בה ממוקם היישום וכל עוד ש־'%s' קיים שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"מוריד את %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"לא נבחר קובץ תמונה\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"עבור %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"קובץ התמונה גדול מדי\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"קובץ התמונה גדול מדי עבור התקן היעד שנבחר.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"קובץ ISO לא נתמך\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"בעת שימוש ב־UEFI כסוג מערכת היעד, רק קובצי ISO הניתנים לאתחול מסוג EFI נתמכים. נא לבחור קובץ ISO שניתן לאתחול מסוג EFI או להגדיר את סוג מערכת היעד כ־BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"מערכת קבצים לא נתמכת\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"חשוב: התקן זה מכיל מחיצות מרובות!!\\n\"\n\"\\n\"\n\"זה עשוי לכלול מחיצות/אמצעי אחסון שלא מופיעים ברשימה או אפילו בלתי נראים ב־Windows. אם ברצונך להמשיך, האחריות על אובדן המידע במחיצות האלה היא עליך.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"אותרו מחיצות מרובות\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"קובץ תמונה DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"לא ניתן להשתמש במערכת הקבצים שנבחרה עם קובץ ISO מהסוג הזה. נא להשתמש במערכת קבצים אחרת או לבחור בקובץ ISO אחר.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"ניתן להחיל את '%s' רק אם מערכת הקבצים היא NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"חשוב: הינך מנסה להתקין את 'Windows To Go', אבל לכונן היעד שלך אין את התכונה 'FIXED'. בגלל זה רוב הסיכויים הם ש־Windows ייקפא בזמן העלייה באתחול מכיוון ש־Microsoft לא יצרה את Windows To Go בצורה שתוכל לעבוד עם כוננים שיש להם את התכונה 'REMOVABLE'.\\n\"\n\"\\n\"\n\"האם עדיין ברצונך להמשיך?\\n\"\n\"\\n\"\n\"הערה: התכונה 'FIXED/REMOVABLE' היא מאפיין חומרה הניתן לשינוי רק בעזרת כלים מיוחדים של יצרן הכונן. עם זאת, הכלים האלה כמעט אף פעם לא משוחררים לציבור...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"מגבלה של מערכת הקבצים\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"קובץ ה־ISO הזה מכיל קובץ שגדול מ־‎4 GB‏, וזה יותר מהגודל המירבי המותר עבור מערכות הקבצים FAT או FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"חסרה תמיכה ב־WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"מערכת ההפעלה שלך לא יכולה לחלץ קבצים מארכיוני WIM. חילוץ מ־WIM דרוש ליצירת כונני USB של Windows Vista ו־Windows 7 הניתנים לאתחול מסוג EFI. ניתן לתקן את זה על־ידי הורדת הגרסה האחרונה של ‎7-Zip‏.\\n\"\n\"האם ברצונך לעבור לאתר ההורדה של ‎7-Zip‏?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"להוריד את %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s ומעלה דורש שקובץ '%s' יהיה מותקן.\\n\"\n\"מכיוון שקובץ זה גדול מ־‎100 KB‏ ותמיד קיים בקובצי ISO של %s, הוא לא מוטמע ב־Rufus.\\n\"\n\"\\n\"\n\"Rufus יכול להוריד את הקובץ החסר עבורך:\\n\"\n\"- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את הקובץ\\n\"\n\"- יש לבחור 'לא' אם ברצונך להעתיק את הקובץ הזה באופן ידני לכונן מאוחר יותר\\n\"\n\"\\n\"\n\"הערה: הקובץ החדש לספרייה בה ממוקם היישום וכל עוד ש־'%s' קיים שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"ביטול הפעולה עשוי להשאיר את ההתקן במצב בלתי שמיש.\\n\"\n\"אם ברצונך לבטל בכל זאת, יש ללחוץ על כן. אחרת, יש ללחוץ על לא.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"נא לבחור תיקייה\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"כל הקבצים\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"יומן רישום של Rufus\"\n\n# LTR & RTL before and after \"0x%02X\"\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"‎0x%02X‏ (דיסק %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS לא יכול לעלות באתחול מכונן המשתמש בגודל אשכול של 64 קילו בתים.\\n\"\n\"נא לשנות את גודל האשכול או להשתמש ב־FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"גודל אשכול לא תואם\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"אתחול אמצעי אחסון גדולים מסוג UDF עשוי לארוך זמן רב. במהירויות של USB 2.0, זמן האתחול המשוער הוא: %d:%02d, ובזמן הזה מד ההתקדמות ייראה קפוא. נא להיות סבלני!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"אמצעי אחסון UDF גדול\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"קובץ תמונה זה משתמש ב־Syslinux %s%s אבל יישום זה כולל רק את קובצי ההתקנה עבור Syslinux %s%s.\\n\"\n\"\\n\"\n\"מכיוון שגרסאות חדשות של Syslinux אינן תואמות אחת לשניה ובלתי אפשרי ש־Rufus יכלול את כולן, יש להוריד 2 קבצים נוספים מהאינטרנט ('ldlinux.sys' ו־'ldlinux.bss'):\\n\"\n\"- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את הקבצים האלו\\n\"\n\"- יש לבחור 'לא' כדי לבטל את הפעולה\\n\"\n\"\\n\"\n\"הערה: הקבצים יירדו לספרייה בה ממוקם היישום וכל עוד קבצים אלו יהיו שם, Rufus ישתמש בהם באופן אוטומטי במידת הצורך.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"נדרשת הורדה\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"קובץ תמונה זה משתמש ב־Grub %s אבל היישום כולל רק את קובצי ההתקנה עבור Grub %s.\\n\"\n\"\\n\"\n\"מכיוון שגרסאות שונות של Grub עשויות שלא להיות תואמות אחת לשניה ובלתי אפשרי ש־Rufus יכלול את כולן, Rufus ינסה למצוא גרסה של קובץ ההתקנה של Grub‏ ('core.img') המתאימה לזו שבקובץ התמונה שלך:\\n\"\n\"- יש לבחור 'כן' כדי להתחבר לאינטרנט ולנסות להוריד אותה\\n\"\n\"- יש לבחור 'לא' כדי להשתמש בגרסת ברירת המחדל מ־Rufus\\n\"\n\"- יש לבחור 'ביטול' כדי לבטל את הפעולה\\n\"\n\"\\n\"\n\"הערה: הקובץ יירד לספרייה בה ממוקם היישום ו־Rufus ישתמש בו באופן אוטומטי במידת הצורך. אם לא תימצא התאמה באינטרנט, Rufus ישתמש בגרסה ברירת המחדל.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"התקנת Windows רגילה\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"מאפייני כונן מתקדמים\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"אפשרויות אתחול מתקדמות\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"הצגת %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"הסתרת %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"גודל מחיצה קבועה\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"ללא\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"הגדרת גודל המחיצה הקבועה עבור מדיית Live USB. הגדרת הגודל ל־0 מבטלת את המחיצה הקבועה.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"הגדרת יחידות גודל המחיצה.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"לא להציג הודעה זו שוב\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"הודעה חשובה לגבי %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"זה עתה יצרת מדיה המשתמשת במנהל אתחול מסוג UEFI:NTFS. יש לזכור שכדי שניתן יהיה לאתחל ממדיה זו, חובה לבטל את Secure Boot.\\n\"\n\"לקבלת פרטים על הסיבה לכך ניתן ללחוץ על הכפתור 'מידע נוסף' שלהלן.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"בחירת תמונת Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"קובץ ISO זה מכיל מספר תמונות Windows.\\n\"\n\"נא לבחור בתמונה שברצונך להשתמש עבור התקנה זו:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"יישום או תהליך אחר משתמש בכונן זה. האם ברצונך לאתחל אותו בכל זאת?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus מזהה שברצונך ליצור מדיית Windows To Go המבוססת על קובץ ISO בגרסה 1809.\\n\"\n\"\\n\"\n\"בגלל *באג של Microsoft*, מדיה זו תקרוס במהלך העלייה באתחול של ה־Windows (מסך המוות הכחול) אלא אם הקובץ WppRecorder.sys יוחלף באופן ידני בקובץ מה־ISO של 1803.\\n\"\n\"\\n\"\n\"לתשומת ליבך, הסיבה לכך של־Rufus אין אפשרות לתקן זאת עבורך היא ש־WppRecorder.sys הוא קובץ המוגן בזכויות יוצרים של Microsoft, כך שאיננו יכולים משפטית להטמיע עותק של הקובץ ביישום...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"מכיוון ש־MBR נבחר כסוג המחיצה, ל־Rufus יש אפשרות ליצור מחיצה בגודל של עד ‎2 TB‏ על המדיה הזו, פעולה שתגרום ל־%s מנפח הדיסק להיות לא זמינים.\\n\"\n\"האם ברצונך להמשיך בכל זאת?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"גרסה\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"שחרור\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"מהדורה\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"שפה\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"ארכיטקטורה\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"המשך\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"חזרה\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"נא להמתין...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"הורדה באמצעות דפדפן\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"הורדה של קובצי ISO של Windows אינה זמינה עקב כך ש־Microsoft שינתה את אתר האינטרנט שלה כדי למנוע זאת.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"נדרש PowerShell 3.0 ומעלה כדי להריץ תסריט זה.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"האם ברצונך לעבור לאינטרנט ולהוריד אותו?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"מריץ תסריט הורדה...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"הורדת קובץ ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"סוג המחשב שברצונך להשתמש עם הכונן בר־האתחול. זוהי אחריותך לבדוק האם מערכת היעד היא מסוג BIOS או UEFI לפני התחלת יצירת הכונן, מכיוון שאחרת הוא עשוי להיכשל לעלות באתחול.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"הכוונה באפשרות 'UEFI-CSM' היא שההתקן יוכל לעלות באתחול רק במצב הדמיית BIOS (הידוע גם כ־Legacy Mode) תחת UEFI, ולא במצב UEFI טבעי.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"הכוונה באפשרות 'שאינו CSM' היא שההתקן יוכל לעלות באתחול רק במצב UEFI טבעי, ולא במצב הדמיית BIOS (הידוע גם כ־Legacy Mode).\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"דפוס בדיקה: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"דפוס בדיקה: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"דפוס בדיקה: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"דפוס בדיקה: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"הגדרת מערכת הקבצים של היעד\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"הגודל המינימלי שבלוק של נתונים יתפוס במערכת הקבצים\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"יש להשתמש בשדה זה כדי להגדיר את תווית הכונן.\\n\"\n\"ניתן להשתמש גם בתווים בינלאומיים.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"הצגה/הסתרה של האפשרויות המתקדמות\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"בדיקת ההתקן אחר אזורים פגומים בעזרת דפוס בדיקה\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"יש לבטל את סימון התיבה הזו כדי להשתמש בשיטת האתחול ה\\\"איטית\\\"\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"השיטה שתהיה בשימוש ליצירת מחיצות\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"השיטה שתהיה בשימוש להפיכת הכונן לבר־אתחול\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"יש ללחוץ כדי לבחור או להוריד קובץ תמונה...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"יש לסמן תיבה זו כדי לאפשר הצגה של תוויות שם בינלאומיות וכדי להגדיר סמל להתקן (יוצר קובץ autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"מתקין מנהל אתחול UEFI שיבצע אימות קבצים שעל המדיה בשיטת MD5Sum\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"יוצר מחיצה נוספת נסתרת ומנסה ליישר את הגבולות של המחיצות.\\n\"\n\"זה עשוי לשפר את זיהוי האתחול עבור BIOS־ים ישנים.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"מאפשר הצגת מארזים חיצוניים לכוננים קשיחים בחיבור USB ברשימת ההתקנים. השימוש על אחריותך בלבד!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"התחלת פעולת האתחול.\\n\"\n\"תהליך זה ישמיד את כל הנתונים על ההתקן!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"חתימת הורדה לא חוקית\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"יש ללחוץ כדי לבחור...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - הכלי לאתחול USB האמין ביותר\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"גרסה %d.%d (בנייה %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"תרגום לעברית: נועם סרוסי, איתיאל וידידים\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"דיווח על תקלות או הצעת שיפורים בכתובת:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"זכויות יוצרים נוספות:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"מדיניות עדכונים:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"אם בחירתך היא לאפשר ליישום זה לבדוק אחר עדכונים, מקובל עליך שהמידע הזה יישמר בשרתים שלנו:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"סוג וגרסת מערכת ההפעלה שלך\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"גרסת היישום שבשימוש\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"כתובת ה־IP שלך\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"לצורך יצירת סטטיסטיקת שימוש פרטית, ייתכן שנשמור את המידע שייאסף \\\\b לשנה לכל היותר\\\\b0 . עם זאת, אנחנו לא נמסור מרצוננו החופשי את הנתונים האלה לשום גורם צד שלישי.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"תהליך העדכון:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus לא מתקין או מפעיל שירותים ברקע, לכן חיפוש אחר עדכונים יתבצע רק כשהיישום הראשי פועל.\\\\line\\n\"\n\"כמובן שנדרשת גישה לאינטרנט כדי לחפש עדכונים.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"קובץ תמונה שגוי עבור אפשרות האתחול שנבחרה\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"קובץ התמונה הנוכחי אינו מתאים לאפשרות האתחול שנבחרה. נא להשתמש בקובץ תמונה אחר או לבחור באפשרות אתחול אחרת..\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"קובץ ה־ISO הזה אינו מותאם למערכת הקבצים שנבחרה\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"זוהה כונן שאינו תואם\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"מעבר כתיבה\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"מעבר קריאה\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"%s הורד\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"לא ניתן להוריד את %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"משתמש בגרסה מוטמעת של קובצי %s\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"חשוב: כונן זה משתמש בגודל אשכול שאינו סטנדרטי!\\n\"\n\"\\n\"\n\"כוננים רגילים משתמשים בגודל אשכול של 512 בתים אבל הכונן הזה משתמש בגודל של %d בתים. בהרבה מקרים, זה אומר שלא תהיה לך אפשרות לעלות באתחול מכונן זה.\\n\"\n\"Rufus יכול לנסות ליצור כונן בר־אתחול, אבל אין שום אחריות או הבטחה שזה יעבוד.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"זוהה גודל אשכול שאינו סטנדרטי\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"ניתן להתקין את 'Windows To Go' על כונן במחיצת GPT רק אם מוגדרת לו התכונה FIXED. לכונן הנוכחי לא זוהתה תכונה זו.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"תכונה זו אינה זמינה בפלטפורמה זו.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"מבטל - נא להמתין...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"סורק קובץ תמונה...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"נכשל בסריקת קובץ התמונה\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"זוהה %s מיושן\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"משתמש בקובץ תמונה: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"קובץ %s חסר\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"אמצעי אחסון חדש\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"נמצא התקן אחד\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"נמצאו %d התקנים\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"מוכן\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"בוטל\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"נכשל\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"פותח את היישום החדש...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"נכשל בפתיחת היישום החדש\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"הקובץ ‪%s‬ נפתח\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"הקובץ ‪%s‬ נשמר\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"מאתחל: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"יוצר מערכת קבצים: משימה %d/%d הושלמה\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"תיקון NTFS‏: %d%% הושלמו\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"מאתחל (%s) - משך זמן משוער %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"מגדיר תווית (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"מאתחל (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"תיקון NTFS‏ (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"מנקה מבני מחיצות MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"מבקש גישה לדיסק...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"מנתח את רשומות האתחול הקיימות...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"סוגר את אמצעי האחסון הקיים...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"כותב רשומת אתחול ראשית (MBR)...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"כותב רשומת אתחול של המחיצה (PBR)...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"מעתיק קובצי DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"מעתיק קובצי ISO: ‏%s\"\n\n# RLM is not needed here as the placeholder is fully localized (the \"this may take a while\" string).\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"מגדיר אתחול EFI של Win7 (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"משלים, נא להמתין...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"מתקין את Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"אזורים פגומים: %s %d/%d - %0.2f%% (%d/%d/%d שגיאות)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"אזורים פגומים: בודק בדפוס אקראי\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"אזורים פגומים: בודק בדפוס 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"יוצר מחיצות (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"מוחק מחיצות (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"לא ניתן לאמת את החתימה של העדכון שהורד. זה יכול לנבוע מכך שהמערכת שלך לא מוגדרת כראוי עבור אימות חתימות או להצביע על הורדה זדונית.\\n\"\n\"\\n\"\n\"ההורדה תימחק. נא לבדוק את יומן הרישום לפרטים נוספים.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"מוריד: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"נכשל בהורדת הקובץ.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"בודק אחר עדכונים עבור Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"עדכונים: לא ניתן להתחבר לאינטרנט\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"עדכונים: לא ניתן לגשת לנתוני הגרסה\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"זמינה גרסה חדשה של Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"לא נמצאה גרסה חדשה של Rufus\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"מפתחות הרישום של היישום נמחקו בהצלחה\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"נכשל במחיקת מפתחות הרישום של היישום\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s מופעל\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s מושבת\"\n\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"מצב בדיקות גודל\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"זיהוי כוננים קשיחים\"\n\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"מצב כפיית אתחול כ־Large FAT32\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun יימחק ביציאה\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"זיהוי כוננים מזוייפים\"\n\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"מצב תמיכה ב־Joliet\"\n\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"מצב תמיכה ב־Rock Ridge\"\n\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"מצב כפיית עדכון\"\n\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"מצב דחיסת NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"כותב קובץ תמונה: %s\"\n\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"מצב תמיכה ב־ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"שימוש ביחידות מידה תקינות\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"מוחק את התיקייה '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"זיהוי כונני VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"מצב UEFI/BIOS משולב\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"מחיל קובץ תמונה של Windows‏: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"מחיל קובץ תמונה של Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"שימור חותמות זמן\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"ניפוי שגיאות USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"מחשב סיכומי ביקורת של קובץ תמונה: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"חישוב סיכומי הביקורת MD5‏, SHA1 ו־SHA256 עבור קובץ התמונה הנבחר\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"שינוי שפת היישום\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"זוהה קובץ תמונה מסוג %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"הקובץ שבחרת הוא קובץ תמונה מסוג ISOHybrid. זה אומר שהוא יכול להיכתב גם במצב %s (העתקת קבצים) וגם במצב %s (קובץ תמונת דיסק).\\n\"\n\"Rufus ממליץ על מצב %s, כדי שתמיד תהיה לך גישה מלאה לכונן לאחר הכתיבה.\\n\"\n\"עם זאת, אם ישנן בעיות במהלך העלייה באתחול, ניתן לנסות לכתוב את קובץ התמונה שוב במצב %s.\\n\"\n\"\\n\"\n\"נא לבחור במצב שברצונך להשתמש לכתיבת קובץ תמונה זה:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"כתיבה במצב %s (מומלץ)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"כתיבה במצב %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"בודק אם קיימים תהליכים מתנגשים...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"לא בר־אתחול\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"דיסק או קובץ תמונה ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (נא לבחור)\"\n\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"מצב נעילת כונן USB בלעדית\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"חתימה לא חוקית\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"לקובץ ההרצה שהורד חסרה חתימה דיגיטלית.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"קובץ ההרצה שהורד חתום על־ידי '%s'.\\n\"\n\"זוהי לא חתימה שאנחנו מזהים, מה שיכול להצביע על פעילות זדונית...\\n\"\n\"האם ברצונך להפעיל קובץ זה בכל זאת?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"מבצע איפוס לכונן: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"זיהוי כוננים נשלפים שאינם מסוג USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"הרשאות מוגדלות חסרות\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"ניתן להריץ יישום זה רק עם הרשאות מוגדלות\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"סידור קבצים באינדקס\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"בחירת גרסה\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"נא לבחור בגרסת ה־Windows שברצונך להתקין:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"גירסת Windows לא נתמכת\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"גרסה זו של Windows אינה נתמכת יותר על־ידי Rufus.\\n\"\n\"הגרסה האחרונה של Rufus הנתמכת בפלטפורמה זו היא v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"אזהרה: גרסה לא רשמית\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"גרסה זו של Rufus לא נוצרה על־ידי המפתחים הרשמיים שלה.\\n\"\n\"\\n\"\n\"האם ברצונך להריץ אותה בכל זאת?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"זוהה קובץ ISO קטוע\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"קובץ ה־ISO שבחרת לא תואם לגודלו המוצהר: חסרים נתונים בגודל של %s!\\n\"\n\"\\n\"\n\"אם הורדת את הקובץ הזה מהאינטרנט, כדאי לנסות להוריד עותק חדש ולוודא שסיכומי הביקורת MD5 או SHA תואמים לאלו הרשמיים.\\n\"\n\"\\n\"\n\"לתשומת ליבך, ניתן לחשב את ה־MD5 או SHA בתוך Rufus על־ידי לחיצה על הכפתור (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"שגיאת אימות חותמת זמן\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus לא יכל לוודא שחותמת הזמן של העדכון שהורד חדשה יותר מזו של קובץ ההרצה הנוכחי.\\n\"\n\"\\n\"\n\"כדי למנוע תרחישי תקיפה אפשריים, תהליך העדכון בוטל וההורדה תימחק. נא לבדוק את יומן הרישום לפרטים נוספים.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"הצגת הגדרות היישום\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"הצגת מידע על אודות יישום זה\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"הצגת יומן הרישום\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"יצירת קובץ תמונת דיסק של ההתקן הנבחר\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"ניתן להשתמש באפשרות זו כדי לציין האם ברצונך להתקין את Windows על דיסק אחר, או להריץ את Windows ישירות מכונן זה (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"מבצע איפוס מהיר לכונן: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"זה עשוי לקחת זמן\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"איתור VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"ארכיון מכווץ\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"קובץ ה־ISO שבחרת משתמש ב־UEFI והוא בגודל מספיק קטן כדי להיכתב כ־EFI System Partition (ESP). כתיבה למחיצה מסוג ESP, בניגוד לכתיבה למחיצת נתונים רגילה המתפרסת על כל שטח הדיסק, עשויה להיות מועדפת עבור סוגי התקנות מסויימים.\\n\"\n\"\\n\"\n\"נא לבחור במצב שברצונך להשתמש כדי לכתוב את קובץ התמונה הזה:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"יש להשתמש ב־%s (בחלון היישום הראשי) כדי להפעיל.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"חישוב גיבובים נוספים (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"שמירה ל־VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"חישוב סיכומי ביקורת של קובץ התמונה\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"כפתורים מרובים\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"מספר המעברים\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"מזהה דיסק\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"עדיפות תהליכון ברירת מחדל: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"מצב התעלמות מסמן האתחול (Boot Marker)\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"מרענן את מבנה המחיצות (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"קובץ התמונה שבחרת הוא מסוג ISOHybrid, אבל היוצרים שלו לא תכננו אותו בצורה שיהיה נתמך במצב העתקת קבצים מ־ISO.\\n\"\n\"כתוצאה מכך, ייאכף שימוש במצב כתיבה כקובץ תמונה DD.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"לא ניתן לפתוח או לקרוא את '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"מחיל התאמה אישית של Windows‏: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"מחיל אפשרויות משתמש...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"חוויית המשתמש של Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"להתאים אישית את ההתקנה של Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"הסרת דרישה ל־4GB RAM ומעלה, Secure Boot ו־TPM\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"הסרת דרישה לחשבון Microsoft מקוון\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"השבתת איסוף נתונים (דילוג על שאלות של פרטיות)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"למנוע מ־Windows To Go לגשת לדיסקים פנימיים\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"יצירת חשבון מקומי עם שם המשתמש:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"הגדרת אפשרויות האזור לאותם ערכים כמו של משתמש זה\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"השבתת הצפנת מכשיר אוטומטית של BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"יומן קבוע\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"יש להוריד קובץ נוסף ('diskcopy.dll') מ־Microsoft על מנת להתקין MS-DOS:\\n\"\n\"- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד אותו\\n\"\n\"- יש לבחור 'לא' כדי לבטל את הפעולה\\n\"\n\"\\n\"\n\"הערה: הקובץ יירד לספרייה בה ממוקם היישום וכל עוד הקובץ יהיה שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"אותר מנהל אתחול UEFI שנאסר לשימוש\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus איתר שקובץ ה־ISO שבחרת מכיל מנהל אתחול UEFI שנאסר לשימוש ושיציג %s, כאשר Secure Boot מופעל על מערכת UEFI מעודכנת לחלוטין.\\n\"\n\"\\n\"\n\"- אם השגת את קובץ תמונת ISO זה ממקור מפוקפק, כדאי לשקול את האפשרות שייתכן שהוא מכיל נוזקת UEFI, ולהימנע מלאתחל ממנו.\\n\"\n\"- אם השגת אותה ממקור מהימן, כדאי לנסות לאתר גרסה יותר עדכנית, שלא תציג אזהרה זו.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"מסך \\\"הפרת אבטחה\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"מסך שחזור של Windows ‏(BSOD) עם '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"קובץ תמונה VHDX מכווץ\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"קובץ תמונה VHD שאינו מכווץ\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"קובץ תמונה של Full Flash Update\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"יש להוריד נתונים נוספים מ־Microsoft על מנת להשתמש באפשרות זו:\\n\"\n\"- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד אותם\\n\"\n\"- יש לבחור 'לא' כדי לבטל את הפעולה\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"הגבלת ההתקנה של Windows למצב S-Mode (אינו נתמך עם האפשרות לעקיפת חשבון מקוון)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"מצב מומחה\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"מחלץ קובצי ארכיון: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"שימוש ב־MBR של Rufus\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus הוא כלי המסייע באתחול ויצירת כונני הבזק מסוג USB הניתנים לאתחול, כמו דיסק און קי, כרטיסי זיכרון וכו׳.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"האתר הרשמי: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"קוד מקור: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"הערות שחרור: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"יישום זה ברישיון תחת התנאים של גרסה 3 של הרישיון הציבורי של גנו (GPL).\\n\"\n\"לפרטים נוספים, יש להיכנס אל https://www.gnu.org/licenses/gpl-3.0.html.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"בוט\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"אתחול USB, כרטיסי זיכרון וכוננים וירטואליים ל־FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"יצירת כונני USB הניתנים לאתחול של FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"יצירת כוננים הניתנים לאתחול מקובצי ISO הניתנים לאתחול (Windows‏, Linux וכו')\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"יצירת כוננים הניתנים לאתחול מקובצי תמונת דיסק הניתנים לאתחול, כולל קבצים דחוסים\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"יצירת כוננים הניתנים לאתחול ממחשבים התומכים ב־BIOS או UEFI, לרבות כוננים הניתנים לאתחול מ־UEFI, המשתמשים במערכת הקבצים NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"יצירת כונני Windows To Go\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"יצירת כונני התקנה של Windows 11 עבור מחשבים שאין להם TPM או Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"יצירת מחיצות Linux קבועות\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"יצירת קובצי תמונה מסוג VHD/DD של הכונן שנבחר\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"חישוב סיכומי ביקורת מסוג MD5,‏ SHA-1,‏ SHA-256 ו־SHA-512 של קובץ התמונה שנבחרה\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"ביצוע בדיקות אחר בלוקים (אזורים) פגומים, כולל זיהוי של כונני הבזק \\\"מזוייפים\\\"\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"הורדת קובצי ה־ISO הקמעונאיים הרשמיים של Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"הורדת קובצי ISO של מעטפת UEFI\"\n"
  },
  {
    "path": "res/loc/po/hr-HR.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-09 18:57+0200\\n\"\n\"PO-Revision-Date: 2024-05-09 19:30+0200\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: hr_HR\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Croatian (Hrvatski)\\n\"\n\"X-Rufus-LCID: 0x041a, 0x081a, 0x101a\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Svojstva jedinice\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Uređaj\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Izvor podizanja\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Odaberi\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Mogućnosti slike\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Tip particije\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Ciljani sustav\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Prikaži USB čvrste diskove\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Dodavanje zakrpa za stari BIOS (dodatne particije, poravnanje, itd.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Omogućite provjeru valjanosti UEFI medija\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Mogućnosti formatiranja\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Datotečni sustav\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Veličina grupiranja\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Naziv jedinice\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Brzo formatiranje\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Provjera za loše blokove\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Izradi produženu oznaku i ikonu\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Zatvori\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Započni\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"O Rufusu\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licenca\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"U redu\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus Licenca\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Više informacija\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Da\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Ne\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Zapisnik\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Očisti\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Spremi\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Ažuriranja\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Postavke\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Provjeri ažuriranja\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Obuhvati beta verzije\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Provjeri\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Provjera ažuriranja - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Dostupna je novija verzija. Preporuka je odmah preuzeti ažuriranje!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Kliknite ovdje za pristup web-stranici\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Bilješke distribucije\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Preuzmi\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Aplikacija je već pokrenuta\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Aplikacija je već pokrenuta.\\n\"\n\"Samo jedna Rufus aplikacija može biti pokrenuta u isto vrijeme.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"UPOZORENJE: Ovaj postupak briše postojeće datoteke na odabranoj jedinici.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Politika Rufus ažuriranja\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Dopusti Rufusu da provjeri dostupnost nove verzije?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Odustani\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Pronađeni loši blokovi\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Provjera gotova: %d loših blokova pronađeno\\n\"\n\"  %d greška čitanja\\n\"\n\"  %d greška pisanja\\n\"\n\"  %d korupcija\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Detaljno izvješče se nalazi u:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Onemogučeno\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Dnevno\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Tjedno\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Mjesečno\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Prilagođeno\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Instalirana verzija: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Zadnja verzija: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"bajtova\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobajta\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabajta\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Zadano\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Zadano)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (ili UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (bez CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS ili UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d prolaz\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d prolaza %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO slika\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Aplikacija\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Prekini\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Pokreni\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Radnja prekinuta od strane korisnika\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Greška\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Greška: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Preuzimanje datoteka\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB uređaj za pohranu (Generičan)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (disk %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Više particija\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Čišćenje buffera\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Otkazivanje\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Uspješno.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Neutvrđena greška pri formatiranju.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Nije moguće upotrijebiti odabrani datotečni sustav na ovom mediju.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Odbijen pristup uređaju.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Uređaj je zaštićen od zapisivanja.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Uređaj se koristi u drugom procesu. Obustavite procese koji koriste uređaj.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Brzo formatiranje nije dostupno za ovaj uređaj.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Nevažeći naziv jedinice.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Nevažeći odabir jedinice.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Uređaj ne podržava odabranu veličinu grupiranja.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Nevažeća veličina particije.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Priključite uklonjivi medij.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Zaprimljena je nepoznata komanda.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Greška raspodjele memorije.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Greška kod čitanja.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Greška kod pisanja.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Instalacija nije uspjela\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Ne mogu otvoriti medij. Možda ga koristi drugi proces. Ponovo priključite uređaj i zatim pokušajte ponovo.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Pogreška kod particioniranja pogona.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Datoteke se ne mogu kopirati na odabrani pogon.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Otkazao korisnik.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Ne mogu započeti nit.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Nije završena provjera blokova.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Neuspješno skeniranje ISO slike.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Neuspješno izvlačenje ISO slike.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Uređaj se nije mogao podići.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Ne mogu zakrpati/postaviti datoteke za bootanje.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Ne mogu dodijeliti slovo jedinici.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Ne mogu podići GUID jedinicu.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Uređaj nije spreman.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus je otkrio da Windows još uvijek čisti unutarnje buffere na USB uređaju.\\n\"\n\"\\n\"\n\"Ovisno o brzini USB uređaja, ova operacija bi mogla potrajati, posebice za veće datoteke.\\n\"\n\"\\n\"\n\"Preporuka je da dopustite Windowsima da završe. Ako ne želite čekati, odspojite uređaj...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Nepodržana slika\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Ova slika nije podržana ili koristi metodu kompresije koju Rufus ne podržava.\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Zamijeni %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Ova ISO slika koristi staru verziju '%s'.\\n\"\n\"Boot izbornici možda neće raditi pravilno zbog toga.\\n\"\n\"\\n\"\n\"Rufus može preuzeti novu verziju da ne dođe do problema:\\n\"\n\"- Odaberite 'Da' kako bi se datoteka preuzela\\n\"\n\"- Odaberite 'Ne' da nastavite bez preuzimanja\\n\"\n\"Preporuka je da odabarete 'Da'.\\n\"\n\"\\n\"\n\"Nova datoteka preuzima se u mapu gdje je Rufus.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Preuzimanje %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Nema odabrane slike\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"za %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Slika je prevelika\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Slika je prevelika za odabrani medij.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Nepodržani ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Dok koristite UEFI particiju, samo EFI ISO slike su podržane. Molimo odaberite EFI ISO ili postavite dotičnu particiju na BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Nepodržani datotečni sustav\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"VAŽNO: OVAJ UREĐAJ IMA VIŠE PARTICIJA!!!\\n\"\n\"\\n\"\n\"Ovo uključuje particije koje možda nisu vidljive u Windowsima. Ako nastavite, odgovorni ste za sve izgubljene datoteke na tim particijama.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Otkriveno je više particija\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD slika\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Odabrani datotečni sustav ne može se koristiti s ovim tipom ISO-a. Odaberite drugi datotečni sustav ili drugu ISO datoteku.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' se može koristiti samo ako je datotečni sustav NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"VAŽNO: Pokušavate postaviti 'Windows To Go', ali odabrani uređaj ima 'FIXED' atribut. Zbog toga će se Windows vjerojatno zamrznuti pri pokretanju, pošto je Microsoft prilagodio Windows To Go za uređaje s 'REMOVABLE' atributom.\\n\"\n\"\\n\"\n\"Želite li svejedno nastaviti?\\n\"\n\"\\n\"\n\"Info: 'FIXED/REMOVABLE' atribut je hardversko svojstvo koje se može izmijeniti samo pomoću specijalnih alata proizvođača diska . Dotični alati su vrlo rijetko dostupni krajnjim korisnicima.\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Ograničenje datotečnog sustava\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Ova ISO slika sadrži datoteku veličine 4 GB ili veću, što je više od podržanog za FAT ili FAT32 datotečni sustav.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Nedostaje WIM podrška\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Vaša platforma ne može raspakirati datoteke iz WIM arhiva. WIM raspak. je potrebno za kreiranje bootabilnih EFI Windows 7 i Vista USB jedinice. Preuzmite najnoviju verziju programa 7-Zip.\\n\"\n\"Želite li posjetiti 7-Zip stranicu za preuzimanje?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Preuzmi %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s ili noviji zahtijeva '%s' za instalaciju.\\n\"\n\"Zato što je datoteka veća od 100 KB i uvijek prisutna na %s ISO slikama, nije ugrađena u Rufus.\\n\"\n\"\\n\"\n\"Rufus je može preuzeti:\\n\"\n\"- Odaberite 'Da' kako bi preuzeli datoteku\\n\"\n\"- Odaberite 'Ne' ako ne želite ručno kopirati datoteku\\n\"\n\"\\n\"\n\"Datoteka će se spremiti u isti direktorij i kad '%s' postoji tamo, automatski će biti korištena.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Prekidanje može dovesti do toga da uređaj postane nedostupan.\\n\"\n\"Ako ste sigurni da želite prekinuti, kliknite DA. U suprotnom, kliknite NE.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Molim odaberite mapu\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Sve datoteke\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus zapisnik\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Pogon %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS se ne može podignuti iz uređaja s grupiranjem od 64 kilobajta.\\n\"\n\"Promijenite veličinu grupiranja ili odaberite FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Nekompatibilna veličina grupiranja\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Formatiranje velike UDF jedinice može potrajati. Pri USB 2.0 brzini, trajanja formatiranja procjenjuje se na %d:%02d, može vam se učiniti da je proces zablokirao. Budite strpljivi!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Velika UDF jedinica\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Ova slika koristi Syslinux %s%s ali ova aplikacija uključuje instalacijske datoteke za Syslinux %s%s.\\n\"\n\"\\n\"\n\"Pošto nove verzije Syslinuxa nisu međusobno kompatibilne, nemoguće je da Rufus sadrži sve, dvije dodatne datoteke se trebaju preuzeti: ('ldlinux.sys' i 'ldlinux.bss')\\n\"\n\"- Odaberite 'Da' kako bi se preuzeli datoteke\\n\"\n\"- Odaberite 'Ne' za prekid\\n\"\n\"\\n\"\n\"Info: Datoteke se preuzimaju u trenutni direktorij programa i koristit će se automatski ako bude potrebno.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Potrebno preuzimanje\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Ova slika koristi Grub %s, a aplikacija sadrži samo instalacijske datoteke za Grub %s.\\n\"\n\"\\n\"\n\"Pošto razne Grub verzije nisu međusobno kompatibilne, a nije moguće uključiti sve Grub datoteke, Rufus će probati locirati verziju Grub instalacijske datoteke ('core.img') koja odgovara onoj iz vaše slike:\\n\"\n\"- Odaberite 'Da' kako bi se preuzeli datoteke\\n\"\n\"- Odaberite 'Ne' za korištenje verzije od Rufus-a\\n\"\n\"- Odaberite 'Odustani' za prekid.\\n\"\n\"\\n\"\n\"Info: Datoteke se preuzimaju u trenutni direktorij programa i koristit će se automatski ako bude potrebno. Ako se ne pronađe potrebna verzija, koristi se dostupna verzija.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Uobičajena Windows instalacija\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"Prijenosni Windowsi\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"napredna svojstva jedinica\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"napredne mogućnosti formatiranja\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Prikaži %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Sakrij %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Veličina trajne particije\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Bez trajne particije\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Zadaj veličinu trajne particije za \\\"live\\\" USB medij. Ako je zadana veličina 0, isključuje se trajna particija.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Zadaj jedinicu veličine particije.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Više ne prikazuj ovu poruku\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Važna napomena za %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Kreirali ste medij koji koristi UEFI:NTFS bootloader. Da bi ste boot-ali s ovog medija, MORATE ISKLJUČITI \\\"SECURE BOOT\\\".\\n\"\n\"Za detaljno informiranje o ovome, pogledajte na 'Više informacija' ispod.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Odabir Windows slike\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Ova ISO datoteka sadrži više Windows slika.\\n\"\n\"Odaberite sliku koju želite koristiti za instalaciju:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Drugi program ili proces pristupa pogonu. Da li ipak želiš formatirati pogon?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus je otkrio da pokušavate kreirati \\\"Windows To Go\\\" medij baziran na verziji 1809 ISO.\\n\"\n\"\\n\"\n\"Zbog *MICROSOFT BUG-a*, doći će do fatalne greške kod podizanja Windows-a (Blue Screen Of Death), osim ako ne zamijenite datoteku 'WppRecorder.sys' s verzijom 1803.\\n\"\n\"\\n\"\n\"Rufus nije u mogućnosti ispraviti problem jer datoteka 'WppRecorder.sys' podliježe Microsoft \\\"copyright-u\\\", tako da bi to bilo ilegalno.\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Odabrali ste MBR za shemu particije. Rufus može kreirati maksimalnu partiticiju do 2 TB na ovom mediju, ostaje %s diska neiskorišteno.\\n\"\n\"\\n\"\n\"Jeste li sigurni da želite nastaviti?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Verzija\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Podverzija\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Edicija\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Jezik\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Arhitektura\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Nastavi\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Natrag\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Molim pričekajte...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Preuzmi koristeći tražilicu\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Preuzimanje ISO-ova sustava Windows nije dostupno jer je Microsoft promijenio web-mjesto da bi ga spriječio.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 ili noviji je potreban za pokretanje skripte.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Želiš li preuzimanje?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Pokretanje skripte za preuzimanje...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Preuzmi ISO sliku\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Vrsta računala koje će podići sadržaj s ovog uređaja. Vaša je odgovornost odrediti da li računalo koristi BIOS ili UEFI prije kreiranja BOOT-abilnog USB pogona, u suprotnom neće biti moguće podići sustav.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' znači će se s USB pogona boot-ati samo u modu emulacije BIOS-a (poznatom kao \\\"Legacy Mode\\\") pod UEFI, a ne u \\\"pravom\\\" UEFI modu.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'bez CSM' znači da će se s USB pogona boot-ati samo u UEFI modu (ne u BIOS modu emulacije - poznat kao \\\"Legacy Mode\\\").\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Test uzorak: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Test uzorak: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Test uzorak: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Test uzorak: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Odabire datotečni sustav\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Minimalna veličina koju će blok okupirati u datotečnom sustavu\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Koristi ovo polje za zadavanje oznake diska.\\n\"\n\"Prihvaćeni su i internacionalni znakovi.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Otvori napredne postavke\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Provjeri prisutnost loših blokova pomoću uzorka\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Ostavite prazno za \\\"sporu\\\" metodu formatiranja\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metoda koja će se koristiti kod kreiranja particija\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Metoda koja će biti korištena za kreiranje boot-abilnog USB-a\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Kliknite za odabir ili preuzimanje slike... (ISO)\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Potvrdite ovo da dozvolite prikaz internacionalnih oznaka i napravite ikonu (stvara autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Instaliraj UEFI bootloader koji će izvršiti MD5 Sum provjeru valjanosti datoteke medije\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Stvori dodatnu skrivenu particiju i pokušaj poravnati granice particije.\\n\"\n\"Ovo je korisno za stare BIOS-e.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Otkrivanje USB čvrstih diskova. KORISTI NA VLASTITU ODGOVORNOST!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Započni proces.\\n\"\n\"To BRIŠE sve podatke s uređaja!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Neispravan potpis datoteke\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Klikni za odabir...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Pouzdan alat za formatiranje USB-a\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Verzija %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Preveo:\\\\line• Dario Komar <mailto:dkmr_main@hotmail.com>\\\\line• Saša Vujanić <mailto:svujanic@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Prijavite greške u prijevodu na navedenu adresu:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Dodatna autorska prava:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Politika ažuriranja:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Ako želite automatska ažuriranja, slažete se da se sljedeće informacije skupljaju na našem serveru:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Arhitektura vašeg OS-a i verzija\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Verzija Rufusa koju koristite\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Vaša IP adresa\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Zbog statistika, navedene informacije možemo čuvati \\\\b najduže jednu godinu\\\\b0 . Vaše informacije ne dijele se trećim strankama.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Proces ažuriranja:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus nema pozadinskih servisa, tako da se ažuriranja provjeravaju samo kada je Rufus aktivan.\\\\line\\n\"\n\"Naravno, prilikom provjere i preuzimanja ažuriranja, potrebna je veza s internetom.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Nepodržana slika za odabrani način pokretanja\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Trenutna slika se ne podudara s odabranim opcijama pokretanja. Odaberite drugu sliku ili opcije pokretanja.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Ova ISO slika nije kompatibilna s odabranim datotečnim sustavom\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Pronađen nekompatibilan uređaj\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Prolaz zapisivanja\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Prolaz čitanja\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Preuzeto %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Ne mogu preuzeti %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Korištenje ugrađenih verzija od %s datoteka\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"VAŽNO: OVAJ UREĐAJ NEMA STANDARDNU VELIČINU SEKTORA!\\n\"\n\"\\n\"\n\"Uobičajeni mediji koriste veličinu sektora od 512 bajtova ali ovaj koristi od %d. U većini slučaja, ovo znači da NEĆETE moći bootati s ovog uređaja.\\n\"\n\"Rufus može pokušati kreirati bootabilni uređaj, ali ne može se garantirati uspjeh.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Otkrivena nestandardna veličina sektora\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' se može instalirati samo na uređaj s GPT particijom koja ima FIXED atribut. Odabrani uređaj nema taj atribut.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Ova značajka nije dostupna na ovoj platformi.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Otkazujem - Pričekajte...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Skeniram sliku...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Neuspjelo skeniranje\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Zastarjeli %s otkriven\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Koristim sliku: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Nedostaje %s datoteka\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Nova jedinica\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d uređaj pronađen\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d uređaja pronađeno\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"SPREMNO\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Otkazano\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Neuspješno\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Pokretanje nove aplikacije...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Greška kod pokretanja nove aplikacije\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Otvoreno %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Spremljeno %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formatiranje: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Stvaram datotečni sustav: %d/%d završeno\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS Fixup: %d%% završeno\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formatiranje(%s) - Procijenjeno %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Postavljanje jedinice (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formatiranje (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS popravak (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Čistim MBR/PBR/GPT strukture...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Zahtijevam pristup disku...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analiziram postojeće boot zapise...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Zatvaram postojeću jedinicu...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Zapisujem \\\"Master Boot Record\\\"…\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Zapisujem \\\"Partition Boot Record\\\"...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopiram DOS datoteke...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopiram ISO datoteku: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI boot postavljanje (%s)…\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Završavanje, pričekajte...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Instaliram Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Loši blokovi: %s %d/%d - %0.2f%% (%d/%d/%d grešaka)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Loši blokovi: Testiram s nasumičnim uzorkom\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Loši blokovi: Testiram s uzorkom 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Particioniranje (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Brisanje particija (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Potpis preuzetog ažuriranja ne može biti provjeren. Možda je sistem nepravilno konfiguriran za provjeru potpisa ili indicira zaraženu datoteku..\\n\"\n\"\\n\"\n\"Preuzeta datoteka će biti obrisana. Provjerite zapisnik za više detalja.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Preuzimam: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Neuspješno preuzimanje.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Provjera ažuriranja Rufus-a...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Ažuriranje: Internet nije dostupan\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Ažuriranje: Nije moguće utvrditi verziju\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Dostupna je nova verzija Rufusa!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Nema novijih verzija Rufusa\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Ključevi registra uspješno izbrisani\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Ključevi registra nisu se mogli izbrisati\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s omogućeno\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s onemogućeno\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Provjera veličine\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Otkrivanje čvrstih diskova\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Prisili veće FAT32 formatiranje\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"\\\"NoDriveTypeAutorun\\\" će biti izbrisan pri izlasku\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Otkrivanje lažnih jedinica\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet podrška\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge podrška\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Prisilno ažuriranje\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS kompresija\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Zapisujem image: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO podrška\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Koristi ISPRAVNE veličine jedinica\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Brišem direktorij '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Otkrivanje VMware diska\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Dual UEFI/BIOS mod\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Primjenjujem Windows sliku: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Primjenjujem Windows sliku...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Očuvanje datuma datoteka\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB debagiranje\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Računanje kontrolnog zbroja: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Izračunaj MD5, SHA1 i SHA256 kontrolni zbroj u odabranoj datoteci\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Odabir jezika aplikacije\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s slike detektirano\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Slika koju ste odabrali je 'ISOHybrid'. Takva datoteka može biti zapisana metodom %s (kopiranje) ili %s (disk image).\\n\"\n\"Preporuka je upotrijebiti metodu %s, tako da imate neograničen pristup jedinici nakon zapisivanja.\\n\"\n\"Ako naiđete na probleme kod pokretanja, isprobajte metodu %s.\\n\"\n\"\\n\"\n\"Odaberite metodu za ovu operaciju:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Metodom %s (Preporučeno)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Metodom %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Provjera konflikata...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Nije bootabilna\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disk ili ISO slika\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Odabrati)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Ekskluzivno zaključavanje USB medija\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Nevažeći potpis\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Preuzeta aplikacija ne sadrži digitalni potpis.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Preuzeta aplikacija je potpisana od strane ‘%s’.\\n\"\n\"Ovo nije prepoznatljiv izvor i može biti zlonamjeran...\\n\"\n\"Želite li svejedno pokrenuti datoteku?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Brisanje uređaja: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Detektiranje ne uklonjivih USB uređaja\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Potrebna administratorska ovlaštenja\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Ovaj program radi samo s administratorskim ovlaštenjem\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Indeksiranje datoteka\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Odabir verzije\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Molimo odaberite verziju Windowsa koju želite instalirati:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Nepodržana verzija Windowsa\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Ova verzija Windowsa više nije podržana od strane Rufusa.\\n\"\n\"Posljednja verzija Rufusa kompatibilna s ovom platformom je v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Upozorenje: Neslužbena verzija\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Ova verzija Rufusa NIJE proizvod službenog razvojnog programera.\\n\"\n\"\\n\"\n\"Svejedno pokrenuti program?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Otkrivena skraćena ISO datoteka\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"ISO datoteka koju ste odabrali ne odgovara deklariranoj veličini: %s podataka nedostaje!\\n\"\n\"\\n\"\n\"Ako ste ovu datoteku preuzeli na internetu, pokušajte preuzeti novu kopiju i provjerite da su MD5 ili SHA kontrolni zbrojevi identični kao u originalu.\\n\"\n\"\\n\"\n\"Rufus može provjeriti MD5 ili SHA pritiskom na (✓) tipku.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Pogreška kod potvrđivanja vremenske oznake\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus nije mogao potvrditi da je vremenska oznaka preuzetog ažuriranja novija od oznake u trenutnoj verziji.\\n\"\n\"\\n\"\n\"S ciljem sprječavanja mogućih eksploatacija sustava, postupak ažuriranja je obustavljen te se preuzeta datoteka uklanja. Više informacija možete pronaći u zapisniku.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Prikaži postavke aplikacije\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Prikaži informacije o aplikaciji\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Prikaži zapisnik\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Stvori sliku diska iz odabranog uređaja\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Ovom opcijom naznačite ako želite koristiti ovaj uređaj kako bi instalirali Windows na drugi disk ili ako želite podići Windows direktno s ovog uređaja (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"\\\"Fast-zeroing\\\" pogona: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"ovo može potrajati neko vrijeme\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD detekcija\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Komprimirana arhiva\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"ISO datoteka koju ste odabrali koristi UEFI i dovoljno je mala da bi bila zapisana kao \\\"EFI System Partition\\\" (ESP). Zapisanje u ESP, umjesto zapisivanje u generičku podatkovnu particiju, možda je bolji izbor za neke tipove instalacija.\\n\"\n\"\\n\"\n\"Odaberite mod koji želite koristi za kreiranje slike:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Koristi %s (u glavnom prozoru aplikacije) za uključenje.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"\\\"Ekstra hashes\\\" (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Snimi u VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Izračunaj \\\"checksum\\\" slike\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Višestruki gumbi\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Broj prolaza\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID uređaja\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Prioritet glavne niti %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Zanemari Boot Marker\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Osvježavam raspored particija (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Slika koju ste odabrali je \\\"ISOHybrid\\\", ali nije kompatibilna s \\\"ISO/File\\\" mod kopiranja.\\n\"\n\"Zbog toga će DD mod zapisivanja slike biti korišten.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Nije moguće otvoriti ili pročitati '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Primjena prilagodbe sustava Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Primjena korisničkih mogućnosti...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Korisničko iskustvo sustava Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Želite li prilagoditi instalaciju sustava Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Uklonite zahtjev za 4GB+ RAM-a, Sigurno pokretanje i TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Uklanjanje preduvjeta za mrežni Microsoftov račun\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Onemogući prikupljanje podataka (Preskoči pitanja o privatnosti)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Sprječavanje pristupa internim diskovima sustavu Windows To Go\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Stvorite lokalni račun s korisničkim imenom:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Postavljanje regionalnih mogućnosti na iste vrijednosti kao i vrijednosti ovog korisnika\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Onemogući BitLocker automatsko šifriranje uređaja\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Stalni zapisnik\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Dodatnu datoteku ('diskcopy.dll') potrebno je preuzeti s Microsofta da biste instalirali MS-DOS:\\n\"\n\"- Odaberite 'Da' za spajanje na Internet i preuzimanje\\n\"\n\"- Odaberite 'Ne' za poništavanje operacije\\n\"\n\"\\n\"\n\"Napomena: Datoteka će se preuzeti u imenik aplikacije i automatski će se ponovno koristiti ako postoji.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Otkriven opozvani UEFI pokretački program\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus je otkrio da ISO koji ste odabrali sadrži UEFI bootloader koji je opozvan i koji će proizvesti %s, kada je Secure Boot omogućen na potpuno ažuriranom UEFI sustavu.\\n\"\n\"\\n\"\n\"- Ako ste nabavili ovu ISO sliku iz izvora koji nije renomiran, trebali biste razmotriti mogućnost da ona sadrži zlonamjerni softver UEFI i izbjegavati pokretanje ga.\\n\"\n\"- Ako ste ga dobili od pouzdanog izvora, trebali biste pokušati locirati noviju verziju koja neće proizvesti ovo upozorenje.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"zaslon \\\"Sigurnosna povreda\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"zaslon za oporavak sustava Windows (BSOD) s '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Komprimirana VHDX slika\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Nekomprimirana VHD slika\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Potpuna ažuriranje flash slike\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Za korištenje ove funkcije potrebno je preuzeti neke dodatne podatke od Microsofta:\\n\"\n\"- Odaberite 'Da' za spajanje na Internet i preuzimanje\\n\"\n\"- Odaberite 'Ne' za poništavanje operacije\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Ograniči Windows na S-Mode (NEKOMPATIBILNO s mrežnim zaobilaženjem računa)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Stručnog načina rada\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Izdvajanje arhivskih datoteka: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Koristiti Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus je aplikacija koja olakšava formatiranje i stvaranje USB pokretačkih jedinica.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Službena stranica: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Šifra izvora: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Ova je aplikacija licencirana pod uvjetima GNU Javne licence (GPL) verzije 3.\\n\"\n\"Detalje potražite u https://www.gnu.org/licenses/gpl-3.0.html.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatirajte USB, flash karticu i virtualne pogone na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Stvaranje FreeDOS USB pogona za pokretanje\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Stvaranje pogona za pokretanje iz ISO-ova za pokretanje (Windows, Linux itd.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Stvaranje pogona za pokretanje iz slika diska za pokretanje, uključujući komprimirane\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Stvaranje BIOS ili UEFI pogona za pokretanje, uključujući UEFI NTFS za pokretanje\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Stvaranje pogona \\\"Windows To Go\\\"\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Stvaranje instalacijskih pogona sustava Windows 11 za PC-jeve koji nemaju TPM ili Sigurno pokretanje\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Stvaranje trajnih Linux particija\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Stvaranje VHD/DD slika odabranog pogona\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Izračunajte kontrolne zbrojeve odabrane slike MD5, SHA-1, SHA-256 i SHA-512\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Izvršite provjere loših blokova, uključujući otkrivanje \\\"lažnih\\\" flash pogona\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Preuzimanje službenih ISO-ova za maloprodaju sustava Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Preuzmite ISO-ove UEFI ljuske\"\n"
  },
  {
    "path": "res/loc/po/hu-HU.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-09 13:01+0200\\n\"\n\"PO-Revision-Date: 2024-05-10 10:46+0100\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: hu_HU\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Hungarian (Magyar)\\n\"\n\"X-Rufus-LCID: 0x040e\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Meghajtó tulajdonságai\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Eszköz\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Rendszerindító (boot) kiválasztása\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Kiválasztás\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Kép opció\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Partíciós séma\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Célrendszer\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"USB merevlemezek listázása\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Javítások hozzáadása régi BIOS-okhoz (extra partíció, igazítás, stb.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Futásidejű UEFI adathordozó érvényesítés\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Formázási beállítások\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Fájlrendszer\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Klaszter mérete\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Kötetcímke\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Gyorsformázás\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Hibás blokkok keresése az eszközön\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Kiterjesztett kötetcímke és ikonfájlok használata\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Állapot\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Bezárás\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Indítás\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"A Rufus névjegye\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licensz\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus Licensz\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"További információk\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Igen\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Nem\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Napló\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Törlés\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Mentés\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Frissítési irányelvek és beállítások\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Beállítások\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Frissítések keresése\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Beta verziókat is\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Ellenőrzés\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Frissítések keresése - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Egy újabb verzió érhető el. Kérlek, töltsd le a legújabb verziót!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Kattints ide a weboldalra ugráshoz\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Kiadási jegyzék\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Letöltés\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Másik példány észlelve\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Egy másik Rufus példány már fut.\\n\"\n\"Kérlek, zárd be, mielőtt ezt futtatnád.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"FIGYELMEZTETÉS: A(Z) '%s' ESZKÖZÖN AZ ÖSSZES ADAT LE LESZ TÖRÖLVE!\\n\"\n\"A művelet folytatásához kattints az OK gombra.\\n\"\n\"A művelet megszakításához kattints a Mégse gombra.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus frissítési irányelvek\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Engedélyezed, hogy a Rufus frissítéseket keressen?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Mégse\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Hibás blokkok találhatóak\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Ellenőrzés befejezve: %d hibás blokk található\\n\"\n\"  %d olvasási hiba\\n\"\n\"  %d írási hiba\\n\"\n\"  %d megsérülve\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Egy részletesebb jelentés megtalálható itt:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Letiltva\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Naponta\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Hetente\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Havonta\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Egyéni\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Jelenlegi verzió: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Legújabb verzió: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"bájt\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobájt\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabájt\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Alapértelmezett\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Alapértelmezett)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (vagy UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (nem CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS vagy UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d menet\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d menet %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO kép\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Alkalmazás\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Megszakít\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Indítás\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"A folyamat a felhasználó által megszakítva\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Hiba\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Hiba: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Fájl letöltése\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB tárolóeszköz (általános)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Lemez %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Több partíció\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Pufferek kiürítése\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Megszakítás\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Siker.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Ismeretlen hiba formázás közben.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"A kiválasztott fájlrendszer nem használható ehhez az eszközhöz.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Az eszközhöz a hozzáférés megtagadva.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Az eszköz írásvédett.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Az eszközt más folyamat használja. Kérlek, zárj be minden más alkalmazást, ami használhatja ezt az eszközt.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"A gyorsformázás nem elérhető ehhez az eszközhöz.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"A kötetcímke érvénytelen.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Az eszközkezelő érvénytelen.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"A kiválasztott klaszterméret érvénytelen ehhez az eszközhöz.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"A kötetméret érvénytelen.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Kérlek, helyezz be egy eltávolítható eszközt a meghajtóba.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Nem támogatott parancs.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Memóriafoglalási hiba.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Olvasási hiba.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Írási hiba.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Telepítési hiba\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Nem sikerült megnyitni az adathordozót. Lehet, hogy másik folyamat használja. Kérlek, helyezd be újra és próbáld újra.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Nem sikerült a meghajtót particionálni.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Nem sikerült fájlokat másolni a célmeghajtóra.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Felhasználó által megszakítva.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Nem sikerült elindítani a folyamatot.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"A hibás blokkok ellenőrzése nem fejeződött be.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"ISO képfájl beolvasási hiba.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"ISO képfájl kibontási hiba.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Nem lehet a kötetet újracsatlakoztatni.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Nem lehet a fájlokat frissíteni/telepíteni bootoláshoz.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Nem lehet meghajtóbetűjelet hozzárendelni.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Nem lehet GUID kötetet csatlakoztatni.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Az eszköz nem áll készen.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"A Rufus észlelte, hogy a Windows még mindig ír az USB eszközre.\\n\"\n\"\\n\"\n\"Az USB eszközöd sebességétől függően e művelet befejezése hosszú ideig is eltarthat, különösen nagy fájlok esetén.\\n\"\n\"\\n\"\n\"A hibák elkerülése érdekében hagyd, hogy a Windows befejezze az írást. De ha belefáradtál a várakozásba, akkor egyszerűen távolítsd el az USB eszközt...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Nem támogatott képfájl\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Ez a képfájl vagy nem bootolható, vagy olyan bootolási vagy tömörítési módszert használ, amelyet a Rufus nem támogat...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Felülírod ezt: %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Úgy tűnik, hogy ez az ISO képfájl a(z) '%s' elavult verzióját használja.\\n\"\n\"Emiatt a boot menü valószínűleg nem fog megfelelően megjelenni.\\n\"\n\"\\n\"\n\"A Rufus le tud tölteni egy újabb verziót a probléma megoldásához:\\n\"\n\"- Válaszd az 'Igen' gombot az új verzió letöltéséhez\\n\"\n\"- Válaszd a 'Nem' gombot a létező ISO képfájl változatlanul hagyásához\\n\"\n\"Ha nem tudod, hogy mit kell tenned, akkor válaszd az 'Igen' gombot.\\n\"\n\"\\n\"\n\"Megjegyzés: Az új fájl a jelenlegi mappába lesz letöltve, és ha egy '%s' létezik, akkor az automatikusan újra lesz használva.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"%s letöltése\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Nincs képfájl kiválasztva\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"%s NAND típushoz\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"A képfájl túl nagy\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"A képfájl túl nagy a kiválasztott célhoz.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Nem támogatott ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"UEFI típusú célrendszer esetén csak EFI alól bootolható ISO képfájlok támogatottak. Kérlek, válassz egy EFI alól bootolható ISO-t, vagy állítsd a célrendszer típusát BIOS-ra.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Nem támogatott fájlrendszer\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"FONTOS: EZ A MEGHAJTÓ TÖBB PARTÍCIÓT TARTALMAZ!!\\n\"\n\"\\n\"\n\"Ez olyan partíciókat/köteteket is jelenthet, amelyek nincsenek listázva, vagy nem is láthatóak Windows alól. Ha folytatni szeretnéd, akkor Te vagy a felelős az ezeken a partíciókon bekövetkező adatvesztésekért.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Több partíció észlelve\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD képfájl\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"A jelenleg kiválasztott fájlrendszer nem használható ezzel a típusú ISO képfájllal. Kérlek, válassz ki egy másik fájlrendszert vagy egy másik ISO képfájlt.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"A '%s' csak NTFS fájlrendszerrel használható.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"FONTOS: 'Windows To Go'-t próbálsz telepíteni, de a célmeghajtó nem 'BEÉPÍTETT' megjelölésű. Emiatt a Windows bootolás közben lefagyhat, mivel a Microsoft nem úgy tervezte, hogy 'ELTÁVOLÍTHATÓ' megjelölésű eszközzel is működjön.\\n\"\n\"\\n\"\n\"Szeretnéd folytatni?\\n\"\n\"\\n\"\n\"Megjegyzés: A 'BEÉPÍTETT/ELTÁVOLÍTHATÓ' megjelölés egy hardveres tulajdonság, amely csak az eszköz gyártójától származó egyedi eszközökkel változtatható meg. Azonban ezek az eszközök SZINTE SOHA SEM publikusak...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Fájlrendszer korlátozás\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Ez az ISO képfájl olyan fájlt tartalmaz, amely nagyobb, mint 4 GB, ami több, mint a maximális megengedett méret FAT vagy FAT32 fájlrendszer esetén.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"HIányzó WIM támogatás\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"A rendszered nem képes WIM archívumokat kicsomagolni. A WIM kicsomagolása szükséges az EFI alól bootolható Windows 7 és Windows Vista USB meghajtók készítéséhez. Ezt megoldhatod a 7-Zip aktuális verziójának telepítésével.\\n\"\n\"Meg szeretnéd látogatni a 7-Zip letöltési oldalát?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Letöltöd ezt: %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"A(z) %s vagy újabb verziójához telepíteni kell egy '%s' fájlt.\\n\"\n\"Mivel ez a fájl nagyobb, mint 100 KB, és mindig szerepel a(z) %s ISO képfájlokban, ezért nincs a Rufusba beépítve.\\n\"\n\"\\n\"\n\"A Rufus letöltheti a hiányzó fájlt:\\n\"\n\"- Válaszd az 'Igen' gombot az internethez történő csatlakozáshoz és a fájl letöltéséhez\\n\"\n\"- Válaszd a 'Nem' gombot, ha magad szeretnéd felmásolni a fájlt a meghajtóra később\\n\"\n\"\\n\"\n\"Megjegyzés: A fájl a jelenlegi mappába lesz letöltve, és ha a(z) '%s' nevű fájl létezik, akkor az automatikusan újra lesz használva.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"A megszakítás az eszközt HASZNÁLHATATLAN állapotba hozhatja.\\n\"\n\"Ha biztosan meg szeretnéd szakítani, kattints az IGEN gombra. Egyébként kattints a NEM gombra.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Kérlek, válassz mappát\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Minden fájl\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus napló\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Lemez: %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"Az MS-DOS nem tud bootolni 64 kilobájt klaszterméretű eszközről.\\n\"\n\"Kérlek, változtasd meg a klaszterméret beállítást, vagy használj FreeDOS-t.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Nem kompatibilis klaszterméret\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Nagy UDF kötetek formázása sok időt igénybe vehet. USB 2.0 sebességgel számolva a formázás becsült ideje %d:%02d, és addig a folyamat jelző nem változik. Kérlek, légy türelemmel!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Nagy UDF kötet\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Ez a képfájl ezt használja: Syslinux %s%s, de ez az alkalmazás csak a Syslinux %s%s telepítő fájljait tartalmazza.\\n\"\n\"\\n\"\n\"Mivel a Syslinux új verziói nem kompatibilisek egymással, és a Rufus sem tartalmazhatja az összes verziót, ezért két további fájlt le kell tölteni az internetről ('ldlinux.sys' és 'ldlinux.bss'):\\n\"\n\"- Válaszd az 'Igen' gombot az internethez történő kapcsolódáshoz, és ezen fájlok letöltéséhez\\n\"\n\"- Válaszd a 'Nem' gombot a művelet megszakításához\\n\"\n\"\\n\"\n\"Megjegyzés: A fájlok a program mappájába lesznek letöltve és automatikusan újra lesznek használva.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Letöltés szükséges\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Ez a képfájl ezt használja: Grub %s, de ez az alkalmazás csak a Grub %s telepítő fájljait tartalmazza.\\n\"\n\"\\n\"\n\"Mivel a Grub különböző verziói nem feltétlenül kompatibilisek egymással, és a Rufus sem tartalmazhatja az összes verziót, ezért a Rufus megkísérel találni egy olyan verziót a Grub telepítő fájlból ('core.img'), ami egyezik a képfájlban lévővel:\\n\"\n\"- Válaszd az 'Igen' gombot az internethez történő csatlakozáshoz és a letöltés megkísérléséhez\\n\"\n\"- Válaszd a 'Nem' gombot a Rufus által biztosított, alapértelmezett verzió használatához\\n\"\n\"- Válaszd a 'Mégse' gombot a művelet megszakításához\\n\"\n\"\\n\"\n\"Megjegyzés: A fájl a program mappájába lesz letöltve és automatikusan újra lesz használva, ha létezik. Ha az interneten nincs megegyező verzió, akkor az alapértelmezett verzió lesz használva.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Alapértelmezett Windows telepítés\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"Haladó eszköz tulajdonságok\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"Haladó formázási beállítások\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"%s megjelenítése\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"%s elrejtése\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Tartós partíció mérete\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Kikapcsolva\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Állítsd be a tartós partíció méretét a Live USB adathordozóhoz. A méret 0-ra állításával letiltod a tartós partíciót.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Állítsd be a partíció méretegységét.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Többet ne mutassa ezt az üzenetet\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Fontos figyelmeztetés erről: %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Egy UEFI:NTFS bootloaderrel rendelkező adathordozót készítettél. Kérlek, ne felejtsd el, hogy a sikeres bootoláshoz, KI KELL KAPCSOLNI A SECURE BOOTOT!\\n\"\n\"Hogy ez miért is szükséges, a 'További információk' gombra kattintva elolvashatod.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows kép kiválasztása\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Ez az ISO több Windows képet is tartalmaz.\\n\"\n\"Kérlek, válaszd ki azt a képet, amelyet használni szeretnél a telepítéshez:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Egy másik alkalmazás vagy folyamat használja ezt az eszközt. Így is formázni szeretnéd?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"A Rufus észlelte, hogy egy 1809-es verziójú ISO alapján kíséreltél meg egy Windows To Go meghajtót készíteni\\n\"\n\"\\n\"\n\"Egy *MICROSOFT HIBA* miatt ez a meghajtó a Windows indulása során össze fog omlani (kék halál), hacsak nem cseréled ki manuálisan a 'WppRecorder.sys' fájlt egy 1803-as verzióra.\\n\"\n\"\\n\"\n\"Vedd figyelembe azt is, hogy a Rufus azért nem tudja automatikusan kijavítani ezt, mert a 'WppRecorder.sys' a Microsoft jogvédett fájlja, ezért nem tudjuk törvényesen beágyazni a fájl másolatát az alkalmazásba...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Mivel MBR lett kiválasztva partíciós sémaként, a Rufus legfeljebb 2 TB-os partíciót tud létrehozni ezen az adathordozón, amellyel így %s lemezterület elérhetetlenné válik.\\n\"\n\"\\n\"\n\"Biztosan folytatni szeretnéd?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Verzió\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Kiadás\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Változat\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Nyelv\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Architektúra\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Folytatás\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Vissza\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Kérlek, várj...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Letöltés böngészővel\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"A Windows ISO fájlok letöltése nem lehetséges, mert a Microsoft módosította a weboldalát, hogy ezt megakadályozza.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 vagy újabb szükséges a kód futtatásához.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Fel szeretnél lépni az internetre és letölteni?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Letöltőkód futtatása...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"ISO képfájl letöltése\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"A számítógép típusa, amellyel használni szeretnéd ezt a rendszerindító meghajtót. A meghajtó létrehozásának megkezdése előtt a te felelősséged annak eldöntése, hogy a célrendszer BIOS vagy UEFI típusú-e, mivel ellenkező esetben előfordulhat, hogy nem indul el.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' azt jelenti, hogy az eszköz csak BIOS emulációs módban ('Legacy Mode'), és nem natív UEFI módban bootol.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'nem CSM' azt jelenti, hogy az eszköz csak natív UEFI módban bootol, BIOS emulációs ('Legacy Mode') módban pedig nem.\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Teszt minta: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Teszt minta: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Teszt minta: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Teszt minta: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"A fájlrendszert állítja be\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"A legkisebb méret, amelyet egy adatblokk elfoglal a fájlrendszerben\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Használd ezt a mezőt a kötetcímke megadásához.\\n\"\n\"A nemzetközi karakterek is elfogadottak.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Haladó beállítások megjelenítése/elrejtése\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Hibás blokkok keresése az eszközön egy teszt minta segítségével\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Vedd ki innen a pipát a \\\"lassú\\\" formázáshoz\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"A partíciók létrehozásához használt metódus\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Az USB meghajtó bootolhatóvá tételéhez használt metódus\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Kattints ide egy képfájl kiválasztásához vagy letöltéséhez...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Pipáld be a nemzetközi címkék megjelenítésének engedélyezéséhez, és az eszköz ikon beállításához (egy autorun.inf fájlt készít)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Olyan UEFI rendszerbetöltő telepítése, ami elvégzi az adathordozón található fájlok MD5Sum érvényesítését\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Készíts egy extra rejtett partíciót és próbáld meg a partíciók határait egymáshoz igazítani.\\n\"\n\"Ez segíthet a régi BIOS-oknak a boot meghajtókat észlelni.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"USB-s merevlemezek listázásának engedélyezése. CSAK SAJÁT FELELŐSSÉGRE HASZNÁLD!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"A formázás elkezdése.\\n\"\n\"Ez MINDEN ADATOT TÖRÖL az eszközön!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Érvénytelen a letöltés aláírása\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Kattints a kiválasztáshoz...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - A megbízható USB-formázó segédprogram\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Verzió: %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Magyar fordítás:\\\\line• Csizmadia Gábor <mailto:gabor.csizmadia@hotmail.hu>\\\\line• Viszokai György <mailto:familyguyfan79@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Hibák bejelentése és fejlesztések kérése:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"További jogi információk:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Frissítési irányelvek:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Ha engedélyezed, hogy a program frissítéseket keressen, akkor elfogadod azt, hogy az alábbi információkat a szerverünkön fogjuk tárolni:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Az operációs rendszered architektúrája és verziója\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"A program verziója, amit használsz\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Az IP címed\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Használati statisztikák készítése céljából az összegyűjtött információkat megtarthatjuk \\\\b legfeljebb egy évig\\\\b0 . Mi NEM adjuk ki az adataidat más személyeknek.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Frissítési folyamat:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"A Rufus nem telepít vagy futtat háttérben futó szolgáltatásokat, a frissítések ellenőrzése csak akkor történik, amikor az alkalmazás fut.\\\\line\\n\"\n\"Természetesen a frissítések ellenőrzéséhez internet kapcsolat szükséges.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Érvénytelen képfájl a kiválasztott boot opcióhoz\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"A jelenlegi képfájl nem passzol a kiválasztott boot opcióhoz. Kérlek, használj egy másik képfájlt vagy válassz egy másik boot opciót.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Ez az ISO képfájl nem kompatibilis a kiválasztott fájlrendszerrel\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Inkompatibilis meghajtó észlelve\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Sikeres írás\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Sikeres olvasás\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Letöltve: %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Nem sikerült letölteni: %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"A(z) %s fájl(ok) beágyazott verziójának használata\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"FONTOS: EZ AZ ESZKÖZ 'NEM SZABVÁNYOS' SZEKTOR MÉRETET HASZNÁL!\\n\"\n\"\\n\"\n\"A hagyományos eszközök szektor mérete 512 bájt, de ennek az eszköznek a szektor mérete %d bájt. Sok esetben ez azt jelenti, hogy NEM lehet bootolni erről az eszközről.\\n\"\n\"A Rufus megpróbálhat egy bootolható meghajtót készíteni, de NINCS RÁ GARANCIA hogy működni fog.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"'Nem szabványos' szektor méret észlelve\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' csak akkor telepíthető GPT típusúra particionált meghajtóra, ha az BEÉPÍTETT megjelölésű. A jelenlegi eszközt nem BEÉPÍTETT megjelölésűnek észleltük.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Ez a funkció ezen a platformon nem elérhető.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Megszakítás - Kérlek, várj...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Képfájl beolvasása...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Nem sikerült a képfájlt beolvasni\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Elavult %s észlelve\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Képfájl használata: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Hiányzó fájl: %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Új kötet\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d eszközt találtam\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d eszközt találtam\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"KÉSZ\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Megszakítva\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Sikertelen\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Az új alkalmazás elindítása...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Nem sikerült az új alkalmazást elindítani\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Megnyitva: %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Mentve: %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formázás: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Fájlrendszer készítése: %d/%d feladat kész\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS Fixup: %d%% kész\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formázás (%s) - becsült idő: %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Kötetcímke beállítása (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formázás (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS Fixup (lemezellenőrzés)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"MBR/PBR/GPT struktúrák tisztítása...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Lemez hozzáférés kérése...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Boot rekordok vizsgálata...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Létező kötet bezárása...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"MBR írása...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Partíció boot rekord írása...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"DOS fájlok másolása...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"ISO fájlok másolása: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI boot telepítés (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Véglegesítés, kérlek, várj...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Syslinux %s telepítése...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Hibás blokkok: %s %d/%d - %0.2f%% (%d/%d/%d hiba)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Hibás blokkok: Tesztelés véletlen mintával\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Hibás blokkok: Tesztelés 0x%02X mintával\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Particionálás (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Partíciók törlése (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"A letöltött frissítés aláírása nem érvényesíthető. Ez azt jelentheti, hogy a rendszer helytelenül van konfigurálva aláírás érvényesítéshez, vagy fertőzött letöltést jelezhet.\\n\"\n\" \\n\"\n\"A letöltés törölve lesz. Kérlek, ellenőrizd a naplót további részletekért.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Letöltés: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"A fájl letöltése sikertelen.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Rufus frissítések keresése...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Frissítés: Nem sikerült csatlakozni az internethez\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Frissítés: Nem sikerült a verzióadatokhoz hozzáférni\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Elérhető egy új Rufus verzió!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Nem található új Rufus verzió\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Az alkalmazás Windows beállításjegyzékben tárolt kulcsai sikeresen eltávolítva\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Az alkalmazás Windows beállításjegyzékben tárolt kulcsait nem sikerült eltávolítani\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s engedélyezve\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s letiltva\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Méret ellenőrzések\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Merevlemezek észlelése\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"FAT32 formázás kényszerítése\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun törölve lesz a kilépéskor\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Hamis eszköz észlelése\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet támogatás\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge támogatás\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Frissítés kényszerítése\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS tömörítés\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Képfájl írása: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO támogatás\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"MEGFELELŐ mértékegység használata\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Mappa törlése: '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMware lemez észlelése\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Duális UEFI/BIOS mód\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Windows kép alkalmazása: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Windows kép alkalmazása...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Időbélyegek megtartása\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB hibakeresés\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Képfájl ellenőrző összegének számítása: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"MD5, SHA1 és SHA256 ellenőrzőösszegek kiszámítása a kiválasztott képhez\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Alkalmazás nyelvének megváltoztatása\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s képfájl észlelve\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"A kiválasztott képfájl egy 'ISOHybrid' képfájl. Ez azt jelenti, hogy írható %s (fájlmásolás) módban vagy %s (lemezképfájl) módban.\\n\"\n\"A Rufus a(z) %s mód használatát javasolja, mivel így mindig teljes hozzáférésed lesz a meghajtóhoz az írás után.\\n\"\n\"Azonban, ha bootolás közben hibát észlelsz, akkor megpróbálhatod ezt a képfájlt újraírni %s módban.\\n\"\n\"\\n\"\n\"Kérlek, válaszd ki, hogy mely írási módot szeretnéd használni:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Írás %s módban (Ajánlott)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Írás %s módban\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Összeütköző folyamatok ellenőrzése...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Nem bootolható\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Lemez vagy ISO képfájl\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Kérlek, válassz!)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Kizárólagos USB meghajtó zárolás\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Érvénytelen aláírás\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"A letöltött futtatható fájl nem rendelkezik digitális aláírással.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"A letöltött futtatható fájlt '%s' írta alá.\\n\"\n\"Ez egy általunk nem felismert aláírás, és rosszindulatú tevékenységre utalhat...\\n\"\n\"Biztosan futtatni szeretnéd ezt a fájlt?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Meghajtó nullázása: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Nem-USB eltávolítható meghajtók észlelése\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Hiányzó emelt szintű felhasználói jogok\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Az alkalmazás csak emelt szintű felhasználói jogokkal tud futni\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Fájl indexelése\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Verzió kiválasztása\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Kérlek, válaszd ki a telepíteni kívánt Windows verziót:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Nem támogatott Windows verzió\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"A Rufus már nem támogatja a Windows ezen verzióját.\\n\"\n\"A jelenlegi platformmal kompatibilis utolsó Rufus verzió: v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Figyelem: Nem hivatalos verzió\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"A Rufus ezen verzióját nem a hivatalos fejlesztője adta ki.\\n\"\n\"\\n\"\n\"Biztosan futtatni szeretnéd?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Csonkított ISO észlelve\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"A kiválasztott ISO képfájl nem egyezik az általa meghatározott mérettel: %s mennyiségű adat hiányzik!\\n\"\n\"\\n\"\n\"Ha ezt a fájlt az internetről szerezted be, próbálj meg egy új példányt letölteni, és ellenőrizd, hogy az MD5 vagy SHA ellenőrző összegek megegyeznek-e a hivatalosakkal.\\n\"\n\"\\n\"\n\"Vedd figyelembe, hogy a (✓) gombra kattintva kiszámíthatod az MD5 vagy SHA értékeket a Rufusban.\"\n\n# ' gombbal számíthatod ki\"\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Időbélyeg érvényesítési hiba\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"A Rufus nem tudta érvényesíteni, hogy a letöltött frissítés időbélyege újabb-e, mint a jelenlegié.\\n\"\n\"\\n\"\n\"Egy esetleges támadást megelőzve a frissítési folyamat meg lett szakítva, és a letöltött fájlok törölve lettek. Kérlek, ellenőrizd a naplót több részletért.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Az alkalmazás beállításainak megjelenítése\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Az alkalmazás névjegyének megjelenítése\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Napló megjelenítése\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Lemezkép készítése a kiválasztott eszközről\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Ezzel a beállítással jelezheted, ha a Windows rendszert egy másik lemezre szeretnéd telepíteni, vagy közvetlenül erről a meghajtóról szeretnéd futtatni a Windows rendszert (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Meghajtó gyors-nullázása: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"ez eltarthat egy kis ideig\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD észlelés\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Tömörített archívum\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"A kiválasztott ISO képfájl UEFI-t használ, és elég kicsi ahhoz, hogy EFI rendszerpartícióként (ESP) legyen írva. Bizonyos típusú telepítéseknél előnyösebb lehet az ESP-re írás, ahelyett, hogy egy általános adatpartícióra írna, amely a teljes lemezt elfoglalja.\\n\"\n\"\\n\"\n\"Kérlek, válaszd ki a módot, amellyel ezt a képet írni szeretnéd:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Az engedélyezéshez használd ezt: %s (az alkalmazás főablakában)\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Extra kivonatok (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Mentés VHD-re\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Képfájl ellenőrzőösszegeinek számítása\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Több gomb\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Menetek száma\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"Lemezazonosító\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Alapértelmezett szál prioritás: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Boot Marker figyelmen kívül hagyása\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Partíció elrendezés frissítése (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"A kiválasztott képfájl egy ISOHybrid képfájl, de a készítői nem tették kompatibilissé az ISO (fájlmásolás) móddal.\\n\"\n\"Emiatt a DD képfájl írási mód lesz kényszerítve.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Nem lehet megnyitni vagy olvasni ezt: '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Windows testreszabás alkalmazása: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Felhasználói beállítások alkalmazása...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows Felhasználói Élmény\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Testreszabja a Windows telepítést?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Követelmény eltávolítása: 4GB+ RAM, Secure Boot és TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Követelmény eltávolítása: online Microsoft-fiók\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Adatgyűjtés letiltása (Adatvédelmi kérdések kihagyása)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"A belső lemezekhez történő hozzáférés megakadályozása a Windows To Go számára\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Helyi fiók létrehozása ezzel a felhasználónévvel:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"A jelenlegi felhasználó területi beállításainak használata\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"BitLocker automatikus eszköz titkosítás letiltása\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Tartós naplózás\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Az MS-DOS telepítéséhez egy további fájlt ('diskcopy.dll') kell letölteni a Microsofttól:\\n\"\n\"- Válaszd az 'Igen' gombot az internethez történő kapcsolódáshoz, és a fájl letöltéséhez\\n\"\n\"- Válaszd a 'Nem' gombot a művelet megszakításához\\n\"\n\"\\n\"\n\"Megjegyzés: A fájl a program mappájába lesz letöltve, és automatikusan újra lesz használva, ha létezik.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Visszavont UEFI rendszerbetöltő detektálva\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"A Rufus észlelte, hogy a kiválasztott ISO egy olyan UEFI rendszerbetöltőt tartalmaz, amelyet visszavontak, és ha a Secure Boot engedélyezve van egy teljesen naprakész UEFI rendszeren, akkor ehhez vezet: %s.\\n\"\n\"\\n\"\n\"- Ha ezt az ISO képet nem megbízható forrásból szerezted be, akkor számolnod kell azzal a lehetőséggel, hogy UEFI kártevőt tartalmazhat, és elkerülendő az erről történő rendszerindítás.\\n\"\n\"- Ha megbízható forrásból szerezted be, akkor próbálj meg egy naprakészebb verziót találni, amelyre ez a figyelmeztetés nem jelenik meg.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"\\\"Security Violation\\\" képernyő\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"Windows helyreállítási képernyő (BSOD / kék halál) ezzel: '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Tömörített VHDX képfájl\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Nem tömörített VHD képfájl\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Full Flash Update (FFU) képfájl\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"E funkcionalitás használatához néhány további adat letöltése szükséges a Microsofttól:\\n\"\n\"- Válaszd az 'Igen' gombot az internethez történő csatlakozáshoz, és az adatok letöltéséhez\\n\"\n\"- Válaszd a 'Nem' gombot a művelet megszakításához\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Windows korlátozása S módra (NEM KOMPATIBILIS az online Microsoft-fiók követelmény eltávolításával)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Szakértő mód\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Archív fájlok kibontása: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Rufus MBR használata\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"A Rufus egy segédprogram, amellyel bootolható USB flash meghajtókat formázhat és készíthet, például USB kulcsokat/pendrive-okat, memóriakártyákat, stb.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Hivatalos oldal: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Forráskód: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Változási napló: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Ezen alkalmazás használata a GNU Public License (GPL) 3-as verzió feltételei szerint engedélyezett.\\n\"\n\"További információ: https://www.gnu.org/licenses/gpl-3.0.html.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"USB, flash memóriakártyák és virtuális meghajtók formázása FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 fájlrendszerre\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Bootolható FreeDOS USB meghajtó készítése\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Bootolható meghajtók készítése bootolható ISO képfájlokból (Windows, Linux, stb.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Bootolható meghajtók készítése bootolható lemez képfájlokból, beleértve a tömörítetteket is\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"BIOS-ból vagy UEFI-ből bootolható meghajtók készítése, beleértve az UEFI-ből bootolható NTFS meghajtókat is\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"'Windows To Go' meghajtók készítése\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Windows 11 telepítési meghajtók készítése olyan PC-k számára, amelyek nem rendelkeznek TPM vagy Secure Boot funkciókkal\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Tartós Linux partíciók készítése\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"VHD/DD képfájl készítése a kiválasztott meghajtóról\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"A kiválasztott képfájl MD5, SHA-1, SHA-256 és SHA-512 ellenőrző összegének kiszámítása\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Hibás blokkok ellenőrzése, beleértve a \\\"hamis\\\" flash meghajtók detektálását\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Hivatalos Microsoft Windows kiskereskedelmi ISO képfájlok letöltése\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"UEFI Shell ISO képfájlok letöltése\"\n"
  },
  {
    "path": "res/loc/po/id-ID.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 3.22\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2023-03-16 16:28+0700\\n\"\n\"PO-Revision-Date: 2023-03-17 14:13+0000\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: id_ID\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Indonesian (Bahasa Indonesia)\\n\"\n\"X-Rufus-LCID: 0x0421\\n\"\n\"X-Generator: Poedit 3.2.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Properti Drive\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Perangkat\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Pilihan Boot\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Pilih\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Opsi Image\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Skema partisi\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Sistem target\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Daftar USB Hard Drives\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Tambah perbaikan untuk BIOS lama (partisi ekstra, penyesuaian, dll.)\"\n\n#. • IDD_DIALOG → IDC_RUFUS_MBR\n#.\n#. 'MBR': See http://en.wikipedia.org/wiki/Master_boot_record\n#. Rufus can install it's own custom MBR (the Rufus MBR), which also allows users to\n#. specify a custom disk ID for the BIOS. The tooltip for this control is MSG_167.\nmsgid \"Use Rufus MBR with BIOS ID\"\nmsgstr \"Gunakan MBR Rufus dengan ID BIOS\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Opsi Format\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Sistem berkas\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Ukuran klatser\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Label volume\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Format cepat\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Periksa blok buruk pada perangkat\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Buat label dan berkas ikon tambahan\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Tutup\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Mulai\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Tentang Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Lisensi\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"Oke\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Lisensi Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Informasi lebih lanjut\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Ya\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Tidak\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Catatan\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Bersihkan\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Simpan\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Ketentuan pembaruan dan setelan\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Setelan\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Periksa pembaruan\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Sertakan versi beta\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Periksa Sekarang\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Periksa Pembaruan - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Versi yang lebih baru telah tersedia. Silakan unduh versi terbaru!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Klik disini untuk pergi ke situs web\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Catatan Rilis\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Unduh\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Rufus lain terdeteksi\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Aplikasi Rufus lain sedang berjalan.\\n\"\n\"Silakan tutup aplikasi tersebut dulu sebelum menjalankan yang lain.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"PERINGATAN: SEMUA DATA PADA PERANGKAT '%s' AKAN DIHAPUS.\\n\"\n\"Untuk melanjutkan operasi ini, klik OKE. Untuk keluar klik BATAL.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Ketentuan pembaruan Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Apakah Anda ingin mengizinkan Rufus memeriksa pembaruan aplikasi secara online?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Batal\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Blok buruk ditemukan\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Pemeriksaan selesai: %d blok buruk ditemukan\\n\"\n\"  %d kesalahan baca\\n\"\n\"  %d kesalahan tulis\\n\"\n\"  %d kesalahan korupsi\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Laporan lebih lengkap dapat ditemukan di:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Dinonaktifkan\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Harian\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Mingguan\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Bulanan\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Kustom\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Versi Anda: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Versi terbaru: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"byte\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobyte\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabyte\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Standar\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Standar)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (atau UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS atau UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d lulus uji\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d lulus uji %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Aplikasi\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Batal\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Luncurkan\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operasi dibatalkan oleh pengguna\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Kesalahan\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Kesalahan: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Unduh berkas\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Perangkat Penyimpanan USB (Generic)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Banyak Partisi\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Pembatalan\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Sukses.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Kesalahan tidak diketahui saat memformat.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Tidak dapat menggunakan sistem berkas terpilih untuk media ini.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Akses ke perangkat ditolak.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Media terlindungi penulisan.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Perangkat ini sedang digunakan oleh proses lain. Silakan tutup semua proses lain yang sedang mengakses perangkat ini.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Format cepat tidak tersedia bagi perangkat ini.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Label volume tidak sah.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Perangkat tidak sah.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Ukuran klaster terpilih tidak sah untuk perangkat ini.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Ukuran volume tidak sah.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Silakan sisipkan media kedalam perangkat.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Perintah tidak didukung.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Kesalahan pengalokasian memori.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Kesalahan baca.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Kesalahan tulis.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Instalasi gagal\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Tidak dapat membuka media. Media mungkin sedang digunakan oleh proses lain. Silakan pasang ulang media dan coba lagi.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Tidak dapat mempartisi perangkat.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Tidak dapat menyalin berkas ke perangkat tujuan.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Dibatalkan oleh pengguna.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Tidak dapat memulai thread.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Pemeriksaan blok buruk tidak selesai.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Pemindaian ISO image gagal.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Mengekstrak ISO image gagal.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Tidak dapat me-mount ulang volume.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Tidak dapat menambal/berkas setelan untuk boot.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Tidak dapat menetapkan huruf perangkat.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Tidak dapat me-mount volume GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Perangkat tidak siap.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus mendeteksi bahwa Windows masih mem-buffer ke perangkat USB.\\n\"\n\"\\n\"\n\"Tergantung pada kecepatan perangkat USB Anda , operasi ini mungkin memakan waktu lama untuk selesai, terutama untuk file besar.\\n\"\n\"\\n\"\n\"Kami menyarankan Anda membiarkan Windows selesai, untuk menghindari kerusakan. Tapi jika Anda bosan menunggu, Anda dapat mencabut perangkat...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Image tidak didukung\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Image ini kemungkinan non-bootable, atau menggunakan metode boot atau kompresi yang tidak didukung oleh Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Ganti %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"ISO image ini tampaknya menggunakan versi lawas dari '%s'.\\n\"\n\"Menu Boot mungkin tidak ditampilkan dengan baik karena masalah ini.\\n\"\n\"\\n\"\n\"Versi yang lebih baru dapat diunduh oleh Rufus untuk menyelesaikan masalah ini:\\n\"\n\"- Pilih 'Ya' untuk menyambungkan ke internet dan mengunduh berkas\\n\"\n\"- Pilih 'Tidak' untuk membiarkan berkas ISO yang ada tidak termodifikasi\\n\"\n\"Jika Anda tidak mengetahui apa yang harus dilakukan, sebaiknya pilih 'Ya'.\\n\"\n\"\\n\"\n\"Catatan: Berkas baru akan diunduh di direktori saat ini dan karena '%s' sudah ada disana, berkas tersebut akan digunakan kembali secara otomatis.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Mengunduh %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Tidak ada image terpilih\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"untuk %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Image terlalu besar\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Image terlalu besar untuk Target yang dipilih.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"ISO tidak didukung\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Ketika menggunakan Tipe Target UEFI, hanya ISO images bootable EFI yang didukung. Silakan pilih ISO bootable EFI atau atur Tipe Target ke BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Sistem berkas tidak didukung\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"PENTING: PERANGKAT INI BERISI BANYAK PARTISI!!\\n\"\n\"\\n\"\n\"Perangkat ini berisi partisi/volume yang tidak tercantum atau bahkan terlihat dari Windows. Jika Anda tetap ingin melanjutkan, Anda bertanggung jawab atas kehilangan data pada partisi tersebut.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Banyak partisi terdeteksi\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Sistem berkas yang saat ini dipilih tidak dapat digunakan dengan tipe ISO ini. Silakan pilih sistem berkas lain atau gunakan ISO yang berbeda.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' hanya dapat diterapkan jika sistem berkas NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"PENTING: Anda mencoba untuk menginstal 'Windows To Go', namun perangkat target tidak memiliki atribut 'FIXED'. Windows ini kemungkinan akan berhenti saat boot, karena Microsoft tidak merancangnya untuk bekerja dengan perangkat yang tidak memiliki atribut 'REMOVABLE'.\\n\"\n\"\\n\"\n\"Apakah Anda tetap ingin melanjutkan?\\n\"\n\"\\n\"\n\"Catatan: Atribut 'FIXED/REMOVABLE' adalah properti hardware yang hanya dapat diubah menggunakan alat kostum dari produsen perangkat. Namun alat ini HAMPIR TIDAK PERNAH disediakan kepada publik...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Batasan sistem berkas\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Image ISO ini berisi berkas yang lebih besar dari 4 GB, yang lebih dari ukuran maksimum yang diperbolehkan untuk sistem file FAT atau FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Dukungan WIM hilang\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Platform Anda tidak dapat mengekstrak berkas dari arsip WIM. Pengektrakan WIM diperlukan untuk membuat bootable EFI Windows 7 dan Windows Vista di perangkat USB. Anda dapat memperbaikinya dengan mengunduh versi terbaru 7-Zip.\\n\"\n\"Apakah Anda ingin mengunjungi halaman unduhan 7-zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Unduh %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s  atau yang lebih baru memerlukan berkas '%s' untuk diinstal.\\n\"\n\"Karena berkas ini berukuran lebih dari 100 KB, dan selalu ada pada ISO images %s, berkas ini tidak tersematkan didalam Rufus.\\n\"\n\"\\n\"\n\"Rufus dapat mengunduh berkas yang hilang ini untuk Anda:\\n\"\n\"- Pilih 'Ya' untuk menyambungkan ke internet dan mengunduh berkas\\n\"\n\"- Pilih 'Tidak' jika Anda ingin menyalin berkas ini secara manual pada perangkat nanti\\n\"\n\"\\n\"\n\"Catatan: Berkas akan diunduh di direktori saat ini dan karena berkas '%s' sudah ada disana, berkas ini akan digunakan kembali secara otomatis.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Membatalkan dapat menyebabkan perangkat TIDAK DAPAT DIGUNAKAN.\\n\"\n\"Jika Anda yakin ingin membatalkan, klik YA. Jika tidak ingin, klik TIDAK.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Silakan pilih folder\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Semua berkas\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Log Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS tidak dapat boot dari perangkat yang menggunakan ukuran Klaster 64 kilobyte.\\n\"\n\"Silakan ubah ukuran Klaster atau gunakan FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Ukuran Klaster tidak kompatibel\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Memformat volume UDF yang besar memerlukan waktu lama. Di kecepatan USB 2.0, perkiraan durasi memformat sekitar %d:%02d, selama berlangsung bilah kemajuan akan tampak berhenti. Harap bersabar!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Volume UDF besar\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Image ini menggunakan Syslinux %s%s namun aplikasi ini hanya menyertakan berkas instalasi untuk Syslinux %s%s.\\n\"\n\"\\n\"\n\"Karena versi baru Syslinux tidak kompatibel satu dengan lainnya, dan tidak mungkin bagi Rufus untuk menyertakan semuanya, dua berkas tambahan harus diunduh dari Internet ('ldlinux.sys' dan 'ldlinux.bss'):\\n\"\n\"- Pilih 'Ya' untuk menyambungkan ke Internet dan mengunduh berkas tersebut\\n\"\n\"- Pilih 'Tidak' untuk membatalkan operasi\\n\"\n\"\\n\"\n\"Catatan: Berkas akan diunduh di direktori aplikasi saat ini dan akan digunakan kembali secara otomatis jika diminta.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Unduh diperlukan\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Image ini menggunakan Grub %s namun aplikasi ini hanya menyertakan berkas instalasi untuk Grub %s.\\n\"\n\"\\n\"\n\"Karena versi baru Grub tidak kompatibel satu dengan lainnya, dan tidak mungkin bagi Rufus untuk menyertakan semuanya, Rufus akan mencoba mencari versi berkas instalasi Grub ('core.img') yang sesuai dengan image Anda:\\n\"\n\"- Pilih 'Ya' untuk menyambungkan ke Internet dan mencoba untuk mengunduhnya\\n\"\n\"- Pilih 'Tidak' untuk menggunakan versi default dari Rufus\\n\"\n\"- Pilih 'Batal' untuk membatalkan operasi\\n\"\n\"\\n\"\n\"Catatan: Berkas akan diunduh di direktori aplikasi saat ini dan akan digunakan kembali jika diminta. Jika tidak ada yang cocok yang ditemukan secara online, versi default akan digunakan.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Instalasi Windows standar\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"properti drive lanjutan\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"opsi format lanjutan\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Tampilkan %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Sembunyikan %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Ukuran partisi persisten\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Tanpa persisten\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Atur ukuran partisi persisten untuk media USB live. Mengatur ukuran ke 0 akan menonaktifkan partisi persisten.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Atur unit ukuran pastisi.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Jangan tampilkan pesan ini lagi\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Pemberitahuan penting tentang %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Anda baru saja membuat media yang menggunakan UEFI: NTFS bootloader. Harap diingat bahwa, untuk mem-boot media ini, ANDA HARUS MENONAKTIFKAN SECURE BOOT.\\n\"\n\"Untuk rincian mengapa hal ini perlu dilakukan, lihat tombol 'Informasi lebih lanjut' dibawah.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Pemilihan image Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Berkas ISO ini berisi beberapa image Windows.\\n\"\n\"Silakan pilih image yang ingin Anda gunakan untuk instalasi:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Program atau proses lain sedang mengakses drive ini. Apakah Anda tetap ingin memformatnya?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus mendeteksi Anda sedang mencoba membuat media Windows To Go berbasis pada ISO 1809.\\n\"\n\"\\n\"\n\"Karena terdapat *MICROSOFT BUG*, media ini akan crash saat proses booting Windows (Blue Screen Of Death), kecuali Anda mengganti secara manual berkas 'WppRecorder.sys' dengan versi 1803.\\n\"\n\"\\n\"\n\"Perhatikan juga bahwa alasan Rufus tidak dapat secara otomatis memperbaikinya untuk Anda adalah bahwa 'WppRecorder.sys' adalah berkas yang dilindungi hak cipta Microsoft, jadi kami tidak dapat secara legal menyematkan salinan berkas tersebut ke dalam aplikasi ...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Karena MBR telah dipilih untuk skema partisi ini, Rufus hanya dapat membuat partisi sampai 2 TB pada media ini, yang akan membuat %s ruang disk menjadi tidak tersedia.\\n\"\n\"\\n\"\n\"Apakah Anda yakin ingin melanjutkan?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Versi\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Rilis\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Edisi\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Bahasa\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Arsitektur\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Lanjut\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Kembali\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Mohon tunggu...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Unduh menggunakan browser\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Pengunduhan berkas ISO Windows tidak tersedia karena dicekal oleh Microsoft.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Diperlukan PowerShell 3.0 atau yang lebih baru untuk menjalankan skrip ini.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Apakah Anda ingin mengunduhnya?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Menjalankan skrip unduhan...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Unduh ISO Image\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Tipe komputer yang akan menggunakan drive bootable ini. Anda harus menentukan apakah target komputer bertipe BIOS atau UEFI sebelum Anda memulai pembuatan drive ini. Jika salah memilih, drive akan gagal diboot.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' artinya perangkat tersebut hanya akan boot dalam mode emulasi BIOS (juga dikenal dengan 'Legacy Mode') di bawah UEFI, dan tidak dalam mode UEFI asli.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'non CSM' artinya perangkat tersebut hanya akan boot dalam UEFI asli, dan tidak dalam mode emulasi BIOS (juga dikenal dengan 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Tes pola: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Tes pola: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Tes pola: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Tes pola: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Atur sistem berkas target\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Ukuran minimal blok data yang akan menempati sistem berkas\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Gunakan bidang ini untuk mengatur label perangkat.\\n\"\n\"Karakter internasional diperbolehkan.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Tombol untuk opsi lanjutan\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Periksa blok buruk pada perangkat menggunakan tes pola\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Hapus centang kotak ini untuk menggunakan metode format \\\"lambat\\\"\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metode yang akan digunakan untuk membuat partisi\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Metode yang akan digunakan untuk membuat perangkat bootable\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Klik untuk memilih sebuah image...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Centang kotak ini untuk menampilkan label internasional dan menyetel ikon perangkat (membuat autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install an MBR that allows boot selection and can masquerade the BIOS USB drive ID\"\nmsgstr \"Menginstal MBR memungkinkan untuk boot dan dapat memanipulasi ID perangkat USB di BIOS\"\n\n#. • MSG_168\nmsgid \"\"\n\"Try to masquerade first bootable USB drive (usually 0x80) as a different disk.\\n\"\n\"This should only be necessary if you install Windows XP and have more than one disk.\"\nmsgstr \"\"\n\"Mencoba menyamarkan perangkat USB bootable pertama (biasanya 0x80) sebagai disk yang berbeda.\\n\"\n\"Biasanya hanya diperlukan jika Anda memasang Windows XP dan memiliki lebih dari satu disk.\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Membuat partisi tersembunyi tambahan dan memcoba menyelaraskan batas partisi.\\n\"\n\"Upaya ini dapat memperbaiki deteksi boot bagi BIOS versi lama.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Aktifkan pencantuman USB Hard Drive enclosures. RESIKO DITANGGUNG ANDA SENDIRI!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Mulai operasi format.\\n\"\n\"Tindakan ini akan MENGHAPUS semua data pada target!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Tanda tangan unduhan tidak valid\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Klik untuk memilih...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Utilitas Pemformatan USB yang Handal\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Versi %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Terjemahan Bahasa Indonesia: \\\\line• Abe Akatsuki\\\\line • Arif Budiman <mailto:arifpedia@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Laporkan bug atau permintaan perbaikan di:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Hak Cipta Tambahan:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Ketentuan Pembaruan:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Jika Anda memilih untuk mengizinkan program ini memeriksa pembaruan aplikasi, Anda setuju bahwa informasi berikut dapat dikumpulkan pada server kami:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Arsitektur dan versi sistem operasi Anda\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Versi aplikasi yang Anda gunakan\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Alamat IP Anda\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Dengan tujuan untuk menghasilkan statistik penggunaan pribadi, kami dapat menyimpan informasi yang dikumpulkan, \\\\b selama satu tahun\\\\b0 . Namun, kami tidak akan pernah memberikan semua data individu ini kepada pihak ketiga.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Proses Pembaruan:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus tidak memasang atau menjalankan layanan latar belakang, oleh karena itu pemeriksaan pembaruan dapat dilakukan hanya ketika aplikasi utama berjalan.\\\\line\\n\"\n\"Akses internet tentu saja diperlukan bila memeriksa pembaruan.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Image tidak sah untuk opsi boot yang dipilih\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Image saat ini tidak cocok dengan opsi boot yang dipilih. Silakan gunakan image yang lain atau pilih opsi boot yang berbeda.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Image ISO ini tidak kompatibel dengan sistem berkas yang dipilih\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Perangkat tidak kompatibel terdeteksi\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Tulis berlalu\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Baca berlalu\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Diunduh %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Tidak dapat mengunduh %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Menggunakan %s berkas versi tersemat\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"PENTING: PERANGKAT INI MENGGUNAKAN UKURAN SEKTOR YANG TIDAK STANDAR!\\n\"\n\"\\n\"\n\"Perangkat konvensional menggunakan ukuran sektor 512-byte tetapi perangkat ini menggunakan %d-byte. Biasanya, hal ini berarti Anda TIDAK dapat melakukan boot dari perangkat ini.\\n\"\n\"Rufus dapat mencoba untuk membuat perangkat bootable, tetapi TIDAK ADA JAMINAN ini akan dapat bekerja.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Ukuran sektor tidak standar terdeteksi\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' hanya dapat diinstal pada perangkat yang berpartisi GPT yang memiliki atribut FIXED. Perangkat saat ini tidak terdeteksi beratribut FIXED.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Fitur ini tidak tersedia pada perangkat ini.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Membatalkan - Silakan Tunggu...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Memindai image...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Gagal memindai image\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"%s usang terdeteksi\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Menggunakan image: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Berkas %s hilang\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Volume Baru\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d perangkat ditemukan\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d perangkat ditemukan\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"SIAP\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Dibatalkan\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Gagal\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Meluncurkan aplikasi baru...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Gagal meluncurkan aplikasi baru\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Membuka %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Menyimpan %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Memformat: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Membuat sistem berkas: Tugas %d/%d selesai\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Perbaikan NTFS: %d%% selesai\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Memformat (%s) - perkiraan durasi %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Menyetel Label (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Memformat (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Perbaikan NTFS (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Membersihkan struktur MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Meminta akses disk...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Menganalisa boot records yang ada...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Menutup volume yang ada...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Menulis Master Boot Record...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Menulis Partition Boot Record...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Menyalin berkas DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Menyalin berkas ISO: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Pengaturan boot EFI Win7 (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Menyelesaikan, silakan tunggu...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Menginstal Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Blok Buruk: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Blok Buruk: Mencoba dengan pola acak\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Blok Buruk: Mencoba dengan pola 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Mempartisi (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Menghapus partisi (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Tanda tangan untuk pembaruan yang diunduh tidak dapat divalidasi. Kemungkinan sistem Anda tidak terkonfigurasi dengan benar untuk validasi tanda tangan atau mengindikasikan unduhan berbahaya.\\n\"\n\"\\n\"\n\"Unduhan akan dihapus. Silakan periksa log untuk lebih rinci.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Mengunduh: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Gagal mengunduh berkas.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Memeriksa pembaruan Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Pembaruan: Tidak dapat menyambungkan ke internet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Pembaruan: Tidak dapat mengakses data versi\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Versi baru Rufus tersedia!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Tidak ada versi baru Rufus yang ditemukan\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Registry aplikasi berhasil dihapus\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Gagal menghapus kunci registry aplikasi\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s diaktifkan\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s dinonaktifkan\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Periksa ukuran\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Deteksi Hard disk\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Format paksa FAT32 yang besar\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun akan dihapus saat keluar\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Deteksi perangkat palsu\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Dukungan Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Dukungan Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Pembaruan Paksa\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"Kompresi NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Menulis image: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Dukungan ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Gunakan unit ukuran PROPER\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Menghapus direktori '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Deteksi VMWare disk\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Modus Dual UEFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Menerapkan image Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Menerapkan image Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Pertahankan timestamps\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Menghitung ceksum image: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Hitung ceksum MD5, SHA1 dan SHA256 pada image yang dipilih\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Ubah bahasa aplikasi\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Image %s terdeteksi\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Image yang Anda pilih merupakan image 'ISOHybrid'. Ini artinya image tersebut dapat ditulis dalam mode %s (salin berkas) atau mode %s (disk image).\\n\"\n\"Rufus menyarankan untuk menggunakan mode %s, sehingga Anda tetap memiliki akses pada perangkat setelah menulisnya.\\n\"\n\"Namun, jika Anda menemukan masalah saat boot, Anda bisa mencoba menulis image ini kembali dalam mode %s.\\n\"\n\"\\n\"\n\"Silakan pilih mode mana yang ingin digunakan untuk menulis image ini:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Tulis dalam mode %s (Disarankan)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Tulis dalam mode %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Memeriksa proses yang konflik...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disk atau ISO image\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Silakan Pilih)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Penguncian perangkat USB khusus\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Tanda tangan digital tidak valid\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Berkas exe yang diunduh memiliki tanda tangan digital yang salah.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Berkas exe yang diunduh ditandatangani oleh '%s'.\\n\"\n\"Tanda tangan ini tidak kami kenali dan bisa menjadi pertanda dari aktivitas berbahaya...\\n\"\n\"Apakah Anda yakin ingin menjalankan berkas ini?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Mengosongkan perangkat: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Deteksi selain perangkat USB yang dapat dilepas\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Hak akses yang tinggi tidak ada\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Aplikasi ini hanya dapat dijalankan dengan hak akses yang tinggi\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Pengindeksan Berkas\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Pilihan versi\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Silakan pilih versi Windows yang ingin dipasang:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Versi Windows Tidak didukung\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Windows versi ini tidak lagi didukung oleh Rufus.\\n\"\n\"Versi terakhir Rufus yang kompatibel dengan platform ini adalah v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Peringatan: Versi tidak resmi\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Rufus versi ini TIDAK diproduksi oleh pengembang resminya.\\n\"\n\"\\n\"\n\"Apakah Anda yakin ingin menjalankannya?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Terdeteksi ISO Terpotong\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Berkas ISO yang Anda pilih tidak sesuai dengan ukuran yang dideklarasikan: %s data hilang!\\n\"\n\"\\n\"\n\"Jika Anda mendapatkan berkas ini dari Internet, Anda sebaiknya mengunduh salinan yang baru dan pastikan ceksum MD5 atau SHA cocok dengan yang asli.\\n\"\n\"\\n\"\n\"Perhatikan bahwa Anda dapat menghitung MD5 atau SHA dalam Rufus dengan mengklik tombol (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Kesalahan memvalidasi stempel waktu\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"Rufus tidak dapat memvalidasi bahwa stempel waktu pembaruan yang diunduh lebih baru daripada yang sedang dijalankan saat ini. Untuk mencegah kemungkinan skenario serangan, proses pembaruan telah dibatalkan dan unduhan akan dihapus. Silakan periksa log untuk lebih jelasnya.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Tampilkan pengaturan aplikasi\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Tampilkan informasi tentang aplikasi ini\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Tampilkan log\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Buat disk image dari perangkat yang dipilih\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Gunakan opsi ini jika Anda ingin menggunakan perangkat ini untuk memasang Windows pada disk lain, atau jika Anda ingin menjalankan Windows secara langsung dari drive ini (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Pengosongan-cepat perangkat: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"Memerlukan beberapa saat\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Deteksi VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Arsip terkompresi\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"ISO yang Anda pilih menggunakan UEFI dan cukup kecil untuk ditulis sebagai Partisi Sistem EFI (ESP). Menulis ke ESP lebih disukai untuk beberapa jenis penginstalan daripada menulis ke partisi data generik yang menempati seluruh disk.\\n\"\n\"\\n\"\n\"Pilih mode yang ingin Anda gunakan untuk menulis image ini:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Gunakan %s (di jendela aplikasi utama) untuk mengaktifkan.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Hash ekstra (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Simpan ke VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Hitung checksum image\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Beberapa tombol\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Jumlah lulus\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID Disk\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Prioritas utas default: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Abaikan Penanda Boot\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Menyegarkan tata letak partisi (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Gambar yang Anda pilih adalah ISOHybrid, tetapi pembuatnya belum membuatnya kompatibel dengan mode salin ISO/Berkas.\\n\"\n\"Akibatnya, mode penulisan DD image akan diberlakukan.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Tidak dapat membuka atau membaca '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Menerapkan kustomisasi Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Menerapkan pilihan pengguna...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Pengalaman Pengguna Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Kustomisasi pemasangan Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Hilangkan persyaratan untuk RAM 4GB+, Secure Boot dan TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Hilangkan persyaratan untuk akun daring Microsoft\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Matikan fitur koleksi data (Loncati pertanyaan privasi)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Cekal Windows To Go dari mengakses penyimpanan internal\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Buat akun lokal dengan username:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Atur pilihan wilayah sama seperti pengguna saat ini\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Matikan enkripsi perangkat otomatis BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Catatan yang tetap/persistent\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus adalah alat yang membantu untuk memformat dan membuat perangkat USB flash menjadi bootable, seperti USB flashdisk, kartu memori, dll.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Situs resmi: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Kode Sumber: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Catatan pergantian: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Aplikasi ini dilisensikan di bawah ketentuan GNU Public License (GPL) versi 3.\\n\"\n\"Lihat https://www.gnu.org/licenses/gpl-3.0.html untuk detail lebih lanjut.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Format USB, kartu flash dan penyimpanan maya ke FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Buat perangkat USB FreeDOS yang dapat di boot\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Buat perangkat yang dapat di boot dari ISO (Windows, Linux, dll.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Buat perangkat yang dapat di boot dari Disk Image, termasuk yang Disk Image yang terkompresi\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Buat perangkat BIOS atau UEFI yang dapat di boot, termasuk perangkat NTFS yang dapat di boot oleh UEFI\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Buat perangkat Windows To Go\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Buat perangkat pemasang Windows 11 untuk PC yang tidak mempunyai TPM atau Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Buat partisi Linux yang tetap/persistent\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Buat image VHD/DD dari penyimpanan yang dipilih\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Hitung checksum MD5, SHA-1, SHA-256 dan SHA-512 dari image yang dipilih\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Lakukan cek Blok yang buruk, termasuk deteksi USB Flash Disk \\\"PALSU\\\"\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Unduh ISO Microsoft Windows resmi\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Unduh Shell ISO UEFI\"\n"
  },
  {
    "path": "res/loc/po/it-IT.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-12 12:06+0100\\n\"\n\"PO-Revision-Date: 2024-05-12 12:12+0100\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: it_IT\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Italian (Italiano)\\n\"\n\"X-Rufus-LCID: 0x0410, 0x0810\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Opzioni unità\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Dispositivo/unità\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Tipo boot sistema\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Seleziona\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Opzioni immagine\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Tipo schema partizione\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Tipo sistema destinazione\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Elenco unità disco USB\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Aggiungi correzioni per vecchi BIOS (partizioni extra, allineamento, etc)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Abilita convalida multimediale UEFI in runtime\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Opzioni formattazione\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Dimensione cluster\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Etichetta volume\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Formattazione rapida\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Test controllo blocchi errati unità\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Crea etichetta estesa e file icone\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Stato\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Chiudi\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Avvia\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Info su Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licenza\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Licenza Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Altre informazioni\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Sì\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Registro eventi\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Azzera\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Salva\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Impostazioni e policy aggiornamenti\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Impostazioni\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Controllo aggiornamenti\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Includi versioni beta\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Controlla ora\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Rufus - Controllo aggiornamenti\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"È disponibile una nuova versione. Scarica la versione aggiornata!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Fai clic qui per visitare il sito web\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Informazioni versione\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Rilevata altra istanza Rufus\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"È in esecuzione un'altra applicazione Rufus.\\n\"\n\"Chiudi la prima applicazione prima di eseguirne una seconda.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"ATTENZIONE: TUTTI I DATI NELL'UNITÀ '%s' SARANNO CANCELLATI.\\n\"\n\"Per continuare seleziona 'OK'. Per annullare seleziona 'ANNULLA'.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Policy aggiornamenti Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Vuoi permettere a Rufus di controllare gli aggiornamenti online?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Annulla\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Rilevato blocco difettoso\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Controllo completato: trovati %d blocchi difettosi\\n\"\n\"  %d errori lettura\\n\"\n\"  %d errori scrittura\\n\"\n\"  %d errori corruzione\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Un report più dettagliato è disponibile in:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Disabilitato\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Giornaliero\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Settimanale\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Mensile\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Personalizzato\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Versione installata: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Versione aggiornata: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"byte\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobyte\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabyte\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Predefinito\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (predefinito)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (o UEFI CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS o UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d passaggio\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d passaggi %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Immagine ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Applicazione\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Annulla\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Esegui\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operazione annullata dall'utente\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Errore\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Errore: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Download file\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Unità memorizzazione USB (generica)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (disco %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Partizioni multiple\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Svuotamento buffer\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Cancellazione\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Operazione completata.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Errore sconosciuto durante la formattazione.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Impossibile usare il filesystem selezionato.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Accesso negato all'unità.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Il supporto è protetto da scrittura.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"L'unità è in uso da un altro processo. Chiudi ogni altro processo che potrebbe accedere all'unità.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Formattazione rapida non disponibile per questa unità.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Etichetta volume non valida.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Il gestore unità non è valido.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Dimensione cluster selezionata non valida per questa unità.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Dimensione volume non valida.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Connetti un supporto nell'unità.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"È stato ricevuto un comando non supportato.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Errore allocazione memoria.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Errore lettura.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Errore scrittura.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Installazione fallita\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Impossibile aprire il supporto. Potrebbe essere in uso da un altro processo. Riconnetti il supporto e riprova.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Impossibile partizionare il disco.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Impossibile copiare i file nell'unità destinazione.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Annullato dall'utente.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Impossibile creare attività formattazione.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Controllo blocchi errati non completato.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Analisi fallita immagine ISO.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Estrazione fallita immagine ISO.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Impossibile rimontare l'unità.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Impossibile correggere/impostare i file per il boot.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Impossibile assegnare una lettera all'unità.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Impossibile montare volume GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"L'unità non è pronta.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus ha rilevato che Windows sta ancora svuotando i buffer interni relativi all'unità USB.\\n\"\n\"\\n\"\n\"A seconda della velocità dell'unità USB, questa operazione potrebbe richiedere un certo tempo per essere completata, specialmente per file molto grandi.\\n\"\n\"\\n\"\n\"Ti suggeriamo di attendere che Windows completi le operazioni per evitare la corruzione dei dati. Se non vuoi attendere oltre, puoi semplicemente scollegare l'unità...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Formato immagine non supportato\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Questa immagine non è avviabile, o usa un metodo di boot o di compressione non supportato da Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Sostituire %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Questa immagine sembra che usi una versione obsoleta di '%s'.\\n\"\n\"A causa di ciò il menu di avvio potrebbe non essere visualizzato correttamente.\\n\"\n\"\\n\"\n\"Una nuova versione può essere scaricata da Rufus per correggere questo problema:\\n\"\n\"- Seleziona 'Sì' per collegarsi a internet e scaricare il file\\n\"\n\"- Seleziona 'No' per lasciare inalterato il file immagine ISO\\n\"\n\"In caso di dubbi, è preferibile selezionare 'Sì'.\\n\"\n\"\\n\"\n\"Nota: il nuovo file verrà scaricato nella cartella attuale e una volta scaricato '%s', verrà riusato automaticamente.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Download %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Nessuna immagine selezionata\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"per NAND %s\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Immagine troppo grande\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Questa immagine è troppo grande per l'unità di destinazione.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Formato ISO non supportato\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Quando usi una destinazione di tipo UEFI, sono supportate solo immagini ISO avviabili EFI. Scegli un'immagine avviabile EFI o imposta una destinazione di tipo BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Filesystem non supportato\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"IMPORTANTE: QUESTA UNITÀ CONTIENE PARTIZIONI MULTIPLE!\\n\"\n\"\\n\"\n\"Questo può includere partizioni/volumi che non sono elencati anche se visibili da Windows. Se vuoi procedere, sei responsabile per qualsiasi perdita di dati in queste partizioni.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Rilevate partizioni multiple\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"Immagine DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Il file system attualmente selezionato non può essere usato con questo tipo di file ISO. Seleziona un differente file system o usa un differente file ISO.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' può essere applicato solo se il file system è NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"IMPORTANTE: stai tentando di installare 'Windows To Go', ma l'unità destinazione non ha l'attributo 'FISSO'. Windows molto probabilmente si bloccherà durante il boot, poiché non è stato progettato per lavorare con unità che hanno invece l'attributo 'RIMOVIBILE'.\\n\"\n\"\\n\"\n\"Vuoi ancora procedere?\\n\"\n\"\\n\"\n\"Nota: l'attributo 'FISSO/RIMOVIBILE' è una proprietà hardware che può essere modificata solo usando strumenti personalizzati del produttore dell'unità. Comunque questi strumenti non sono QUASI MAI forniti all'utente...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Limitazione filesystem\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Questa immagine ISO contiene un file più grande di 4 GB, che è superiore alla dimensione massima permessa per il filesystem FAT o FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Supporto WIM mancante\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Il sistema operativo non può estrarre file dall'archivio WIM. L'estrazione WIM è necessaria per creare una unità USB avviabile EFI Windows 7 e Windows Vista. Puoi correggere ciò installando una versione recente di 7-Zip.\\n\"\n\"Vuoi visitare la pagina web da cui scaricare 7-zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Vuoi scaricare %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s o successivo richiedono l'installazione del file '%s'.\\n\"\n\"Poiché questo file è più grande di 100 KB, ed è sempre presente nell'immagine ISO di %s, il file non è incluso in Rufus.\\n\"\n\"\\n\"\n\"Rufus può scaricare per te il file mancante:\\n\"\n\"- Seleziona 'Sì' per collegarti a internet e scaricare il file\\n\"\n\"- Seleziona 'No' se vuoi copiare manualmente questo file nell'unità più tardi\\n\"\n\"\\n\"\n\"Nota: il file verrà scaricato nella cartella attuale e una volta che '%s' è stato scaricato, verrà riusato automaticamente.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"La cancellazione potrebbe lasciare il dispositivo in uno stato NON USABILE.\\n\"\n\"Se sei sicuro di volerlo cancellare, seleziona 'SI'. Altrimenti, seleziona 'NO'.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Seleziona la cartella\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Tutti i file\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Registro eventi Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (disco %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"Non si può avviare MS-DOS da una unità che usa una dimensione del cluster di 64 kilobyte.\\n\"\n\"Modifica la dimensione del cluster o usa FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Dimensione cluster incompatibile\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"La formattazione di un volume UDF di grandi dimensioni può richiedere molto tempo. In modo USB 2.0, il tempo stimato per la formattazione sarà di %d:%02d, durante il quale la barra di progresso non verrà aggiornata. Attendi il completamento dell'operazione!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Volume UDF di grandi dimensioni\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Questa immagine usa Syslinux %s%s ma questa applicazione include solo i file di installazione per Syslinux %s%s.\\n\"\n\"\\n\"\n\"Poiché le nuove versioni di Syslinux non sono compatibili con le precedenti e non sarebbe possibile per Rufus includerle tutte, devono essere scaricati da internet due file aggiuntivi ('ldlinux.sys' e 'ldlinux.bss'):\\n\"\n\"- Seleziona 'Sì' per collegarti a internet e scaricare questi due file\\n\"\n\"- Seleziona 'No' per annullare l'operazione\\n\"\n\"\\n\"\n\"Nota: questi file verranno scaricati nella cartella corrente dell'applicazione e se presenti verranno riusati automaticamente.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Richiede download\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Questa immagine usa Grub %s ma l'applicazione include solo i file di installazione per Grub %s.\\n\"\n\"\\n\"\n\"Questa differente versione di Grub potrebbe non essere compatibile con l'altra, e non è possibile includere i file di installazione. Rufus tenterà di trovare una versione dei file di installazione di Grub ('core.img') che corrisponda a quella dell'immagine.\\n\"\n\"- Seleziona 'Sì' per collegarti a internet e tentare il download\\n\"\n\"- Seleziona 'No' per usare la versione predefinita di Rufus\\n\"\n\"- Seleziona 'Annulla' per interrompere l'operazione.\\n\"\n\"\\n\"\n\"Note: i file verranno scaricati nella cartella attuale dell'applicazione e verranno riusati automaticamente se presenti. Se non sarà trovata online nessuna corrispondenza, verrà usata la versione predefinita.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Installazione Windows standard\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"opzioni avanzate unità\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"opzioni avanzate formattazione\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Visualizza %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Nascondi %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Dimensione partizione persistente\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"No persistenza\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"\"\n\"Imposta la dimensione della partizione persistente per il media USB live.\\n\"\n\"Impostando la dimensione a zero disabiliti la partizione persistente.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Imposta la dimensione di partizione dell'unità.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Non visualizzare più questo messaggio\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Informazioni importanti su %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Hai appena creato un media che utilizza il bootloader UEFI:NTFS.\\n\"\n\"Ricordati che per avviare questo supporto è NECESSARIO DISATTIVARE L'AVVIO PROTETTO.\\n\"\n\"Per i dettagli sul motivo per cui è necessario, seleziona il pulsante 'Altre info'.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Selezione immagine Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Questa immagine ISO contiene più immagini di Windows.\\n\"\n\"Seleziona l'immagine che vuoi usare per questa installazione:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"\"\n\"Un altro programma o processo sta accedendo a questa unità.\\n\"\n\"Vuoi formattare comunque l'unità?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus ha rilevato che stai tentando di creare un media 'Windows To Go' basato su una ISO 1809.\\n\"\n\"\\n\"\n\"A causa di un *BUG MICROSOFT*, questo supporto si arresta in modo anomalo durante l'avvio di Windows (Blue Screen Of Death), a meno che non si sostituisca manualmente il file 'WppRecorder.sys' con una versione 1803.\\n\"\n\"\\n\"\n\"Nota inoltre che il motivo per cui Rufus non può risolvere automaticamente questo problema è che 'WppRecorder.sys' è un file protetto da copyright di Microsoft, quindi non è possibile incorporare legalmente una copia del file nell'applicazione...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Poiché è stato selezionato 'MBR' per lo schema partizione, Rufus può creare su questo supporto solo una partizione fino ad un massimo di 2 TB, che lascerà %s di spazio su disco non disponibile.\\n\"\n\"\\n\"\n\"Sei sicuro di voler continuare?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Versione\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Edizione\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Lingua\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Architettura\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Continua\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Indietro\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Attendi...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Download via browser\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Il download delle ISO di Windows non è disponibile a causa di Microsoft che ha modificato il proprio sito Web per impedirlo.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Per eseguire questo script è necessario PowerShell v. 3.0 o successiva.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Vuoi andare online ed effettuare il download?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Esecuzione script download...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Download immagine ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Tipo di computer con cui pensi di effettuare il boot. È una tua responsabilità, prima di creare l'unità, identificare se il tipo di sistema destinazione è di tipo BIOS o UEFI. Altrimenti il boot potrebbe fallire.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI CSM' significa che l'unità effettuerà il boot solo in modo emulazione BIOS (conosciuto come 'Legacy Mode') in UEFI, e non in modo nativo UEFI.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'non CSM' significa che l'unità effettuerà il modo nativo UEFI, e non in modo emulazione BIOS (conosciuto come 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Pattern test: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Pattern test: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Pattern test: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Pattern test: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Impostazione filesystem destinazione\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Dimensione minima blocco dati filesystem\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Usa questo campo per impostare l'etichetta dell'unità.\\n\"\n\"I caratteri internazionali sono permessi.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Abilita/disabilita opzioni avanzate\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Abilita questa opzione per effettuare un controllo dei blocchi danneggiati nel dispositivo usando un pattern di test\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Deseleziona questa opzione per usare il metodo di formattazione completo ma 'lento'\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metodo che verrà usato per creare le partizioni\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Metodo che verrà usato per rendere l'unità USB avviabile\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Fai clic per selezionare o scaricare l'immagine...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Abilita questa opzione per permettere la visualizzazione delle etichette internazionali e impostare una icona dispositivo (creerà un file autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Installa un MBR che permette la selezione all'avvio e maschera l'ID unità USB del BIOS\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Crea una partizione aggiuntiva e nascosta e prova ad allineare le diverse partizioni.\\n\"\n\"Questo può migliorare il rilevamento all'avvio con vecchi BIOS.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Abilita il rilevamento per i dischi USB. USALO A TUO RISCHIO!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Avvia l'operazione di formattazione.\\n\"\n\"Questa operazione DISTRUGGERÀ qualsiasi dato sull'unità di destinazione!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Firma download non valida\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Fai clic per selezionare...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Utility affidabile per la formattazione di unità USB\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Versione %d.%d (build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Traduzione italiana a cura di R.B.\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Segnala i problemi o richiedi nuove funzionalità a:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Diritti aggiuntivi:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Policy aggiornamenti:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Se permetti a questo programma di controllare automaticamente gli aggiornamenti, accetti che le seguenti informazioni saranno catalogate nei nostri server:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"L'architettura del sistema operativo e la versione\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"La versione dell'applicazione in uso\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Indirizzo IP\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Potremmo mantenere le informazioni al solo scopo di creare una statistica privata di utilizzo, \\\\b per massimo un anno\\\\b0 . Comunque ti garantiamo che NON invieremo nessuno di questi dati a nessuna terza parte.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Processo aggiornamento:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus non installa o esegue servizi in background. Il controllo aggiornamenti verrà effettuato solo quando l'applicazione è in esecuzione.\\\\line\\n\"\n\"Quando si effettua il controllo aggiornamenti è ovviamente richiesto l'accesso ad internet.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Immagine non valida per opzione boot selezionata\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"L'immagine selezionata non corrisponde all'opzione boot scelta. Usa un'immagine differente o scegli un'opzione boot differente.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Questa immagine non è compatibile con il filesystem selezionato\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Rilevata unità incompatibile\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Fase di scrittura\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Fase di lettura\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Scaricati %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Impossibile scaricare %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Utilizzo versione integrata dei file %s\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"IMPORTANTE: QUESTA UNITÀ USA UNA DIMENSIONE SETTORI NON STANDARD!\\n\"\n\"\\n\"\n\"Le unità convenzionali usano una dimensione settore di 512 byte ma questa unità usa una dimensione di %d byte. In molti casi, ciò significa che NON potrai effettuare il boot da questa unità.\\n\"\n\"Rufus può provare a creare una unità avviabile, ma non c'è NESSUNA GARANZIA che funzionerà.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Rilevata dimensione settore non standard\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' può essere installato solo su una unità partizionata GPT se ha l'attributo FISSA impostato. L'unità attuale non è stata rilevata come FISSA.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Questa caratteristica non è disponibile in questa piattaforma.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Annullamento...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Analisi immagine...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Analisi immagine fallita\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Rilevato %s obsoleto\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Uso immagine: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"File %s mancante\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Nuovo volume\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"Rilevato %d dispositivo\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"Rilevati %d dispositivi\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"PRONTO\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Annullata\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Operazione fallita\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Avvio nuova applicazione...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Avvio nuova applicazione fallito\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Aperto %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Salvato %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formattazione: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Creazione filesystem: attività %d/%d completata\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Correzione NTFS: %d%% completata\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formattazione (%s) - durata stimata %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Impostazione etichetta (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formattazione (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Correzione NTFS (controllo disco)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Azzeramento struttura MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Richiesta accesso disco...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analisi dati avvio...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Chiusura volume esistente...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Scrittura MBR (Master Boot Record)...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Scrittura partizione di avvio...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Copia file DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Copia file immagine ISO: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Impostazione avvio EFI Windows 7 (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Finalizzazione...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Installazione Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Blocchi danneggiati: %s %d/%d - %0.2f%% (%d/%d/%d errori)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Blocchi danneggiati: test con pattern casuali\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Blocchi danneggiati: test con pattern 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Partizionamento (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Eliminazione partizioni (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"La firma per l'aggiornamento scaricato non può essere validata. Questo può significare che il sistema non è correttamente configurato per la validazione della firma o indica un download non corretto.\\n\"\n\"\\n\"\n\"Il file scaricato verrà eliminato. Per maggiori dettagli consulta il registro eventi.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Download: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Impossibile scaricare il file.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Verifica disponibilità aggiornamenti Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Aggiornamento: impossibile collegarsi a internet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Aggiornamento: impossibile accedere alle info versione\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"È disponibile una nuova versione di Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"La versione installata è aggiornata\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Registro applicazione correttamente eliminato\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Impossibile eliminare il registro applicazione\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"Abilitato %s\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"Disabilitato %s\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Controllo dimensione\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Rilevamento dischi fissi\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Forza formattazione FAT32 estesa\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"All'uscita verrà eliminato NoDriveTypeAutorun\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Rilevamento unità fittizie\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Supporto Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Supporto Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Forza aggiornamento\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"Compressione NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Scrittura immagine: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Supporto ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Usa unità dimensione APPROPRIATA\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Eliminazione cartella '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Rilevamento disco VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Modo duale UEFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Applicazione immagine Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Applicazione immagine Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Preserva data/ora\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Debug USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Calcolo checksum immagine: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Calcola le checksum MD5, SHA1 e SHA256 per l'immagine selezionata\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Cambia la lingua dell'interfaccia\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Rilevata immagine %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"L'immagine selezionata è un'immagine ISO ibrida. Questo significa che può essere registrata in modo '%s' (copia file) o in modo '%s' (immagine disco).\\n\"\n\"Rufus suggerisce di usare il modo '%s', in modo da avere sempre pieno accesso all'unità dopo la scrittura.\\n\"\n\"Se incontri problemi al boot, puoi provare a scrivere questa immagine in modo %s.\\n\"\n\"\\n\"\n\"Seleziona il modo che vuoi usare per scrivere questa immagine:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Scrivi in modo %s (suggerito)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Scrivi in modo %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Verifica processi in conflitto...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Non avviabile\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"File immagine disco o file ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (seleziona)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Blocco esclusivo unità USB\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Firma non valida\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"L'eseguibile scaricato non ha una firma digitale.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"L'eseguibile scaricato è firmato da '%s'.\\n\"\n\"Questa non è una firma riconosciuta e potrebbe indicare qualche forma di attività malevola.\\n\"\n\"Sei sicuro di voler eseguire questo file?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Azzeramento disco: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Rilevamento di unità rimovibili non USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Privilegi elevati non disponibili\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Questa applicazione può essere eseguita solo con privilegi elevati\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Indicizzazione file\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Selezione versione\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Seleziona la versione di Windows che vuoi installare:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Versione Windows non supportata\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Questa versione di Windows non è più supportata da Rufus.\\n\"\n\"L'ultima versione di Rufus compatibile con questa piattaforma è v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Attenzione: versione non ufficiale\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Questa versione di Rufus non è stata sviluppata dai suoi sviluppatori ufficiali.\\n\"\n\"\\n\"\n\"Sei sicuro di volerla eseguire?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Rilevato file ISO troncato\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Il file ISO selezionato non corrisponde alla dimensione dichiarata: %s dei dati mancanti!\\n\"\n\"\\n\"\n\"Se hai scaricato questo file da internet, prova a scaricarne una nuova copia e verifica che la checksum MD5 o SHA corrisponda alla checksum ufficiale.\\n\"\n\"\\n\"\n\"Nota che puoi calcolare in Rufus la checksum cliccando sul pulsante (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Errore validazione data/ora\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus non può validare che la data/ora del pacchetto aggiornamento sia più recente di quelle per l'attuale eseguibile.\\n\"\n\"\\n\"\n\"Per prevenire possibili scenari di un attacco malware, il processo di aggiornamento è stato interrotto e il file scaricato verrà eliminato. Per maggiori dettagli controlla il registro eventi.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Visualizza impostazioni applicazione\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Visualizza informazioni su questa applicazione\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Visualizza registro eventi\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Crea un'immagine disco dell'unità selezionata\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Usa questa opzione per indicare se vuoi usare questa unità per installare Windows in un altro disco, o se vuoi avviare Windows direttamente da questa unità (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Azzeramento veloce unità: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"potrebbe richiedere del tempo\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Rilevamento VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Archivio compresso\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Il file ISO selezionato usa UEFI ed è abbastanza piccolo da poter essere scritto come una partizione di sistema EFI (ESP). Per alcuni tipi di installazione può essere preferibile la scrittura su un ESP, invece di scrivere su una partizione di dati generica che occupa l'intero disco.\\n\"\n\"\\n\"\n\"Seleziona la modalità che vuoi usare per scrivere questa immagine:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Per abilitare usa %s (nella finestra principale dell'applicazione).\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Hash extra (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Salva in VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Checksum immagine computer\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Pulsanti multipli\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Numero passate\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID disco\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Priorità predefinita thread: %s\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignora marcatore boot\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Aggiornamento layout partizione (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"L'immagine selezionata è una ISO ibrida, ma i suoi creatori non l'hanno resa compatibile con la modalità di copia ISO/file.\\n\"\n\"Di conseguenza, verrà applicata la modalità di scrittura delle immagini DD.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Impossibile aprire o leggere '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Applicando personalizzazione Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Applicando opzioni utente...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Esperienza utente Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Personalizzare installazione di Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Rimuovi requisiti per 4GB+ RAM, Secure Boot e TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Rimuovi requisiti per Microsoft account online\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Disabilita raccolta dati (salta domande su privacy)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Previeni Windows To Go dall'accesso ai dischi interni\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Crea account locale con nome utente:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Imposta opzioni regionali agli stessi valori di questo utente\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Disabilita la crittografia automatica dei dispositivi BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Log persistente\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Per installare MS-DOS è necessario scaricare da Microsoft un file aggiuntivo (\\\"diskcopy.dll\\\"):\\n\"\n\"- Seleziona 'Sì' per connettersi ad internet e scaricarlo\\n\"\n\"- Seleziona 'No' per annullare l'operazione\\n\"\n\"\\n\"\n\"Nota: il file verrà scaricato nella cartella dell'applicazione e se presente verrà riutilizzato automaticamente.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Rilevato bootloader UEFI revocato\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus ha rilevato che l'ISO selezionata contiene un bootloader UEFI che è stato revocato e che quando Secure Boot è abilitato su un sistema UEFI completamente aggiornato produrrà %s. \\n\"\n\"\\n\"\n\"- Se hai ottenuto questa immagine ISO da una sorgente non affidabile, dovresti considerare la possibilità che possa contenere malware UEFI ed evitare di eseguire l'avvio da esso.\\n\"\n\"- Se l'hai ottenuto da una sorgente attendibile, dovresti provare a cercare una versione più aggiornata, che non genererà questo avviso.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"una schermata \\\"Violazione sicurezza\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"una schermata di ripristino Windows (BSOD) con '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Immagine VHDX compressa\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Immagine VHD non compressa\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Immagine aggiornamento flash completa\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Per usare questa funzionalità è necessario scaricare da Microsoft alcuni dati aggiuntivi:\\n\"\n\"- Seleziona 'Sì' per connettersi ad internet e scaricarli\\n\"\n\"- Seleziona 'No' per annullare l'operazione\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Limita Windows alla modalità S (INCOMPATIBILE con il bypass dell'account online)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Modalità esperto\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Estrazione file archivio: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Usa MBR Rufus\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus è un programma che ti aiuta a formattare e creare una unità flash USB avviabile, come una unità USB, memory stick, ecc.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Sito ufficiale: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Codice sorgente: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Novità: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Questa applicazione è rilasciata sotto i termini della GNU Public License (GPL) versione 3.\\n\"\n\"Vedere https://www.gnu.org/licenses/gpl-3.0.html per dettagli.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Avvio\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatta USB, flash card e unità virtuali in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Crea unità USB avviabili FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Crea unità avviabili da ISO avviabili (Windows, Linux, ecc.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Crea unità avviabili da immagini disco avviabili, incluse quelle compresse\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Crea unità avviabili BIOS o UEFI, incluso NTFS avviabile UEFI\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Crea unità 'Windows To Go'\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Crea unità di installazione di Windows 11 per PC che non dispongono di TPM o avvio protetto\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Crea partizioni persistenti Linux\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Crea immagini VHD/DD dell'unità selezionata\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Calcola i checksum MD5, SHA-1, SHA-256 e SHA-512 dell'immagine selezionata\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Esegui controlli dei blocchi danneggiati, incluso il rilevamento di unità flash \\\"false\\\"\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Scarica le ISO ufficiali di Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Scarica le ISO della shell UEFI\"\n"
  },
  {
    "path": "res/loc/po/ja-JP.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-09 21:04+0900\\n\"\n\"PO-Revision-Date: 2024-05-09 22:07+0900\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: ja_JP\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Japanese (日本語)\\n\"\n\"X-Rufus-LCID: 0x0411\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"ドライブ プロパティ\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"デバイス\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"ブートの種類\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"選択\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"イメージ オプション\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"パーティション構成\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"ターゲット システム\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"USB 接続の HDD を一覧表示\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"古い BIOS のために修正を追加 (パーティションの拡張、並び替え、その他)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"ランタイムUEFIメディア検証を有効化\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"フォーマット オプション\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"ファイル システム\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"クラスター サイズ\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"ボリューム ラベル\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"クイック フォーマット\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"不良ブロックを検出\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"機能拡張されたラベルとアイコン ファイルを作成\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"状態\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"閉じる\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"スタート\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Rufus について\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"ライセンス\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus のライセンス\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"詳細情報\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"はい\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"いいえ\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"ログ\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"消去する\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"保存する\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"アップデート ポリシーと設定\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"設定\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"アップデートの確認\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"ベータ バージョンを含める\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"今すぐに確認\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"アップデートの確認 - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"新しいバージョンを利用できます。新しいバージョンをダウンロードしてください!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"ウェブサイトにアクセスするにはここをクリックしてください。\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"リリース ノート\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"ダウンロード\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"他のインスタンスを検出しました。\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Rufus は既に実行されています。\\n\"\n\"もう一度実行する前に既に起動中の Rufus を終了してください。\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"警告: デバイス “%s” のデータは消去されます。\\n\"\n\"この操作を続けるには [OK] を、終了する場合は [キャンセル] をクリックしてください。\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus の更新ポリシー\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"オンラインで行われるアップデートの自動確認機能を有効にしますか?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"キャンセル\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"不良ブロックを検出しました。\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"検出完了\\n\"\n\"不良ブロックの数: %d\\n\"\n\"リードエラーの数: %d\\n\"\n\"ライトエラーの数: %d\\n\"\n\"破損エラーの数: %d\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"詳細なレポートは%sで見ることができます。\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"無効\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"毎日\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"毎週\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"毎月\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"カスタム\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"利用中のバージョン: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"最新のバージョン: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"バイト\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"キロバイト\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"メガバイト\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"規定\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (規定)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (または UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (CSM 無効)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS または UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d パス\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d パス %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO イメージ\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"アプリケーション\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"中止\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"開始\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"操作はユーザーによりキャンセルされました。\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"エラー\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"エラー: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"ファイルダウンロード\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB 記憶装置 (汎用)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (ディスク %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"複数のパーティション\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - バッファを消去中\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - キャンセル中\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"成功しました。\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"フォーマット中に判別できないエラーが起きました。\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"選択したシステムはこのメディアに使えません。\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"このデバイスへのアクセスは拒否されました。\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"メディアは書き込み禁止です。\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"デバイスは他のプロセスで使われています。デバイスにアクセスしているプロセスを停止してください。\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"このデバイスはクイック フォーマットできません。\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"ボリューム ラベルは無効です。\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"デバイス ハンドルは無効です。\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"選択されたクラスター サイズはこのデバイスには無効です。\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"ボリューム サイズは無効です。\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"ドライブにリムーバブル メディアを挿入してください。\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"非対応コマンドを受け取りました。\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"メモリ割り当てエラー\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"読み込みエラー\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"書き込みエラー\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"インストールに失敗\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"メディアを開けませんでした。他のプログラムで使われている可能性があります。もう一度接続し、やり直してください。\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"ドライブのパーティション設定中にエラーが発生しました。\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"ファイルをターゲット ドライブへコピーできませんでした。\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"ユーザーによってキャンセルされました。\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"スレッドを開始できません。\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"不良ブロックの検出処理が完了しませんでした。\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"ISO イメージのスキャンに失敗しました。\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"ISO イメージからの抽出に失敗しました。\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"ボリュームを再マウントできません。\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"ファイルへブート用パッチを当てられません。\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"ドライブ レターを割り振れません。\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"GUID ボリュームをマウントできません。\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"デバイスの準備ができていません。\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Windows が内部バッファから USB デバイスに書き込み中であることを検出しました。\\n\"\n\"\\n\"\n\"特に大きなファイルの場合、 USB デバイスのスピードによっては、この操作に時間がかかるかもしれません。\\n\"\n\"\\n\"\n\"ファイル破損を避けるためには、作業完了まで待つことを推奨しますが、デバイスを取り外すこともできます。\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"非対応のイメージです。\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"このイメージはブート非対応あるいは Rufus でサポートされていないブート方式、圧縮方式を使用しています。\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"%sを置き換えますか?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"この ISO は “%s” の古いバージョンを使用するようです。\\n\"\n\"ブートメニューが正しく表示できないかもしれません。\\n\"\n\"\\n\"\n\"この問題を解決するために新しいバージョンをダウンロードできます。\\n\"\n\"- インターネットに接続し、ファイルをダウンロードするには [はい] をクリックしてください。\\n\"\n\"- 既存のISOを変更しない場合は [いいえ] をクリックしてください。\\n\"\n\"どうしたらよいかわからない場合は [はい] をクリックすることを推奨します。\\n\"\n\"\\n\"\n\"注意: 新しいファイルは現在のフォルダーにダウンロードされます。すでに “%s” のファイルがある場合は自動的に再利用します。\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"%s をダウンロード中\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"イメージが選択されていません。\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"(%s NAND 用)\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"イメージが大きすぎます。\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"イメージが選択したターゲットには大きすぎます。\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"非対応の ISO です。\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"UEFI ターゲット タイプを使用する場合、EFI でブート可能な ISO だけがサポートされています。 EFI でブート可能な ISO を選択するか、 BIOS の設定でターゲット タイプを設定し直してください。\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"このファイル システムには非対応です。\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"重要: このドライブは複数のパーティションを含んでいます!! \\n\"\n\"\\n\"\n\"Windows が認識できないあるいはリスト化できないパーティションやボリュームが存在する可能性があります。続行する場合、これらのパーティションでのデータ損失の責任はユーザーにあります。\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"複数のパーティションを検出しました。\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD イメージ\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"現在の選択されたファイル システムではこの ISO を使用することができません。別のファイル システムか別の ISO を使用してください。\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"ファイル システムが NTFS の場合のみ “%s” は適用可能です。\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"注意: Windows To Go をインストールしようとしていますが、ターゲット ドライブは “FIXED” 属性を持ちません。“REMOVABLE” 属性があるドライブで動作するように Microsoft は Windows を設計していないため、Windows のブート中にフリーズする可能性が高くなります。\\n\"\n\"\\n\"\n\"続けてよろしいですか?\\n\"\n\"\\n\"\n\"注意: “FIXED/REMOVABLE” 属性は、ハードウェア固有のプロパティで製造メーカーからのツール等でのみ変更可能ですが、残念ながらそのようなツールは全くと言っていいほど公開されていません。\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"ファイル システム制限\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"ISO イメージに 4 GB より大きなファイルがあります。FAT、FAT32 ファイル システムで使用可能な最大のサイズを超えています。\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"WIM のサポートがありません\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"利用中のこの環境では WIM ファイルからファイルを抽出できません。EFI でのブートを必要とする Windows 7 と Windows Vista 用の USB ドライブを作るためには、WIM ファイルを展開できる必要があります。最近のバージョンの 7-Zip で展開することができます。\\n\"\n\"7-Zip のダウンロード ページを開きますか?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"%s をダウンロードしますか?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s またはそれ以後のバージョンは “%s” ファイルがインストールされている必要があります。\\n\"\n\"このファイルは 100 KB より大きいので Rufus に内蔵していません。%s に ISO イメージが常時あるためです。\\n\"\n\"\\n\"\n\"Rufus で不足しているファイルをダウンロードすることができます。\\n\"\n\"- インターネットに接続し、ファイルをダウンロードするには [はい] を選択してください。\\n\"\n\"- 後でファイルをドライブに置いて手動でコピーする場合は [いいえ] を選択してください。\\n\"\n\"\\n\"\n\"注意:ファイルは現在のディレクトリへダウンロードされます。“%s” が既にディレクトリにある場合、自動的に再使用します。\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"キャンセルするとデバイスは使用不可能になるかもしれません。\\n\"\n\"キャンセルするには [はい] を、そうではない場合は [いいえ] をクリックしてください。\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"フォルダーを選択してください。\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"全てのファイル\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus のログ\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (ディスク %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS はクラスター サイズが 64 キロバイトのドライブからブートできません。\\n\"\n\"クラスター サイズを変更、または FreeDOS を使用してください。\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"互換性のないクラスター サイズ\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"大きな UDF ボリュームをフォーマットするには時間がかかります。USB2.0 接続の場合、フォーマット完了までの推定時間は %d:%02d です。この間、プログレス バーは進んでいないように見えます。終了までしばらくお待ちください。\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"大きな UDF ボリューム\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"このイメージは Syslinux %s%s を使用しますが、このアプリケーションには Syslinux %s%s のインストールファイルのみ内蔵しています。\\n\"\n\"\\n\"\n\"新しいバージョンの Syslinux は古い Syslinux と完全な互換性はありません。Rufus にすべてのバージョンの Syslinux データを含むことはできないため、インターネットから 2 つのファイル (ldlinux.sys と ldlinux.bss) を追加でダウンロードする必要があります。\\n\"\n\"- インターネットに接続し、ファイルをダウンロードするには [はい] を選択してください。\\n\"\n\"- 取り消したい場合は [いいえ] を選択してください。\\n\"\n\"\\n\"\n\"注意: ファイルは現在のディレクトリへダウンロードされます。ファイルが既に現在のディレクトリにある場合はダウンロードせず自動的に再使用されます。\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"ダウンロードが必要です\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"このイメージは Grub %s を使用しますが、このアプリケーションには Grub %s のインストールファイルのみ内蔵しています。\\n\"\n\"\\n\"\n\"それぞれのバージョンの Grub は他のバージョンの Grub と完全な互換性はありません。イメージに適合したバージョンの Grub インストール ファイル (core.img) を探すことができます。\\n\"\n\"- インターネットに接続し、ダウンロードを試行するには [はい] を選択してください。\\n\"\n\"- Rufus のデフォルトのバージョンを使用する場合は [いいえ] を選択してください。\\n\"\n\"- この操作を中止する場合は [キャンセル] を選択してください。\\n\"\n\"\\n\"\n\"注意: ファイルは現在のディレクトリへダウンロードされます。ファイルが既に現在のディレクトリにある場合はダウンロードせず自動的に再使用されます。\\n\"\n\"適合するバージョンがオンラインで見つからなかった場合は内蔵しているバージョンの Grub が使用されます。\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"標準の Windows インストール\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"詳細なドライブ プロパティ\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"詳細なフォーマット オプション\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"%s を表示\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"%s を隠す\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"保存領域のサイズ\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"保存領域なし\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"ライブ USB メディアの保存領域のサイズを設定します。 サイズを 0 に設定すると保存領域が無効になります。保存領域は「Persistent パーティション」「Persistence 機能」とも言われます。\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"パーティション サイズの単位を設定します。\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"次回からこのメッセージを表示しない\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"%s に関する重要なお知らせ\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"UEFI:NTFS ブートローダーを使用するメディアを作成しました。 このメディアを起動するには、セキュアブートを無効にする必要があります。\\n\"\n\"この変更が必要な理由については、下の [詳細情報] から確認してください。\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows イメージの選択\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"この ISO には複数の Windows イメージが含まれます。\\n\"\n\"このインストールに使用したいイメージを選択してください。\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"別のプログラムまたはプロセスがこのドライブにアクセスしています。このままフォーマットしますか?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"1809 バージョンの ISO を使用して Windows To Go のメディアを作成しようとしていることを検出しました。\\n\"\n\"\\n\"\n\"このメディアは、“WppRecorder.sys” を 1803 バージョンのファイルに手動で置き換えない限り、Windowsのブート中にクラッシュ (ブルースクリーン) します。これは * Microsoftのバグ * によるものです。\\n\"\n\"\\n\"\n\"“WppRecorder.sys” は Microsoft の著作権で保護されたファイルであり、アプリケーションにファイルのコピーを合法的に埋め込めないため、Rufus が自動的にこの不具合を修正することはできません。\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"パーティション構成に MBR が選択されているため、Rufus はこのメディア上に最大 2 TB のパーティションしか作成できません。そのため、％s のディスク容量が使用できなくなります。\\n\"\n\"\\n\"\n\"続けますか?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"バージョン\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"リリース\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"エディション\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"言語\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"アーキテクチャ\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"続ける\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"戻る\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"お待ちください...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"ブラウザーを使ってダウンロードする\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"リクエストが多すぎたため Microsoft が一時的にダウンロードを禁止しました - しばらくしてからもう一度お試しください...\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"このスクリプトの実行には PowerShell 3.0 以降が必要です。\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"ネットワークに接続してダウンロードしますか?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"ダウンロード スクリプトを実行中...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"ISO イメージのダウンロード\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"\"\n\"このブート用ドライブを使用する予定のコンピューターの種類です。\\n\"\n\"起動に失敗する可能性を減らすため、ドライブの作成を開始する前にターゲットが BIOS と UEFI のどちらの形式を使うかを確認してください。\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"UEFI-CSM では UEFI モードではなく、UEFI 環境下での BIOS エミュレーション モード (レガシー モード) でのみデバイスを起動することができます。\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"CSM が無効な環境では UEFI 環境下での BIOS エミュレーション モード (レガシー モード) ではなく、 UEFI モードでのみデバイスを起動することができます。\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"テスト パターン: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"テスト パターン: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"テスト パターン: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"テスト パターン: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"ターゲット ドライブに設定するファイル システムです。\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"ファイル システム内で使用するデータ ブロックの最小サイズです。\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"ここでドライブのラベルを設定可能です。\\n\"\n\"各国の文字が使用できます。\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"詳細設定に切り替えます。\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"テスト パターンで不良ブロックを検出するにはチェック ボックスをオンにします。\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"“クイックではない”フォーマットをするにはチェック ボックスをオフにします。\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"パーティションの作成方法です。\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"ドライブを起動可能にするために使用する方法です。\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"イメージを選択するか、イメージをダウンロードするにはここをクリックしてください。\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"機能拡張されたラベルの表示とデバイス アイコンの設定を有効するにはこのチェック ボックスをオンにします。“autorun.inf” を作成します。\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"MD5チェックサム検証を行うUEFIブートローダーをインストールします。\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"特別な隠しパーティションを作成し、各パーティションの位置合わせを行います。\\n\"\n\"古い BIOS を使用する場合にブート時の検出を改善できます。\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"外付け USB HDD のリストを有効にします。自己責任で使用してください。\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"フォーマットを始めます。\\n\"\n\"ターゲット ドライブのデータは全て破棄されます。\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"無効なデジタル署名です。\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"選択するにはクリックしてください。\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - 信頼性の高い USB フォーマット ユーティリティ\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"バージョン %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"日本語翻訳:\\\\line• チャンテラ・ジャクソン <mailto:chantella-eng@live.com>\\\\line• Tiryoh <mailto:tiryoh+rufus@gmail.com>\\\\line• 五月雨 <mailto:samidare3desu@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"バグの報告、お問い合わせ等はこちらから:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"各種著作権: \"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"アップデート ポリシー: \"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"このアプリケーションのアップデート確認を許可した場合、\\\\line以下の情報をサーバーに送信することに同意します。\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"ご使用中の OS の種類とバージョン\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"ご使用中の Rufus のバージョン\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"IP アドレス\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"利用統計を作るために、\\\\line収集した情報は\\\\b最大で一年間\\\\b0 保管する場合があります。 \\\\lineただし、そのデータを安易に第三者へ開示することはありません。\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"アップデートの方法: \"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus は、本アプリケーション実行時のみアップデートの確認を行います。インストールまたはバックグラウンド サービスを実行して処理を行うことは一切ありません。\\\\line\\n\"\n\"また、アップデートの確認にはインターネット接続が必要です。\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"選択したブート設定には無効なイメージです。\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"現在選択中のイメージとブート設定が一致しません。別のイメージを使うか、他のブート設定を使用してください。\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"この ISO は選択中のファイル システムと互換性がありません。\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"互換性のないドライブが検出されました。\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"書き込み中\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"読み出し中\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"%s をダウンロードしました。\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"%s はダウンロードできませんでした。\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"内蔵している %s ファイルを使用します。\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"重要: このドライブは標準以外のセクタ サイズを使用しています!\\n\"\n\"\\n\"\n\"従来のドライブは、512 バイトのセクタ サイズを使用しますが、このドライブは %d バイトを使用しています。多くの場合、このようなドライブからブートできません。\\n\"\n\"このままブート用ドライブを作成しようとしますが、動作保証はありません。\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"標準以外のセクタサイズが検出されました。\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"“FIXED” 属性が設定されている場合に限り、 GPT パーティションのドライブに Windows To Go をインストールすることができます。 現在のドライブは FIXED として検出されませんでした。\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"この機能は、このプラットフォームでは利用できません。\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"キャンセル中 - お待ちください...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"イメージをスキャン中...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"イメージのスキャンに失敗\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"廃止された %s を検出しました\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"%s を使用中\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"ファイルが見つかりません: %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"新しいボリューム ラベル\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d 個のデバイスを検出しました。\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d 個のデバイスを検出しました。\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"準備完了\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"キャンセル\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"失敗しました。\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"更新されたアプリケーションを開始中...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"更新されたアプリケーションを開始することができませんでした。\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"%s を開きました。\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"%s を保存しました。\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"フォーマット中: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"ファイル システムを作成中: %d/%d のタスクが完了\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS 修正中: %d%% 完了\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"フォーマット中 (%s) - 残り約 %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"ラベル作成中 (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"フォーマット中 (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS の修正が必要か確認中 (チェックディスク)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"MBR/PBR/GPT 構造のクリーニング中...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"ディスク アクセスを要求しています...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"ブート レコードを分析してます...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"ボリュームを閉じています...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"マスター ブート レコードを書き込んでいます...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"パーティション ブート レコードを書き込んでいます...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"DOS ファイルをコピー中...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"ISO ファイルをコピー中: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI ブート セットアップ中 (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"最終処理中です。もう間もなく終わります...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Syslinux %s をインストール中...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"不良ブロック: %s %d/%d パス - %0.2f%% (エラー: %d/%d/%d)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"不良ブロック: ランダムパターンでテスト\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"不良ブロック: パターン 0x%02X でテスト\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"パーティション分割中 (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"パーティション削除中 (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"ダウンロードしたアップデートのデジタル署名が無効です。あなたが使用しているシステムの構成が署名検証のために不適切であるか、または悪意のあるソフトウェアがダウンロードされた可能性があります\\n\"\n\"\\n\"\n\"ダウンロードは削除されます。詳しくはログを確認してください。\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"ダウンロード中: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"ファイルのダウンロードに失敗しました。\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Rufus のアップデートを確認しています...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"アップデート: インターネット接続に失敗しました。\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"アップデート: バージョン管理データにアクセスできません。\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Rufus の新しいバージョンを利用できます!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Rufus の新しいバージョンはありませんでした。\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"アプリケーションのレジストリ キーを正常に削除しました。\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"アプリケーションのレジストリ キーの削除に失敗しました。\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s 有効\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s 無効\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"サイズの確認\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"ハードディスクの検出\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Large FAT32 でのフォーマットを強制\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun は Rufus を閉じる時に削除されます。\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"偽装されたドライブの検出\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Juliet のサポート\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge のサポート\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"強制的にアップデート\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS 圧縮\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"イメージを書き込み中: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO のサポート\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"正確なサイズ単位を使用\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"“%s” フォルダーを削除しています。\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare ディスクの検出\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"デュアル UEFI/BIOS モード\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Windows イメージを適用中: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Windows イメージを適用します...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"タイムスタンプ (ファイル更新日付) を保持\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB デバッグ\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"イメージのチェックサムを計算中: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"選択したイメージの MD5、SHA1、SHA256 チェックサムを計算します。\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"アプリケーションの使用言語を変更します。\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s イメージの検出\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"選択されたイメージはハイブリッド ISO 形式です。\\n\"\n\"%s (ファイル コピー) モードまたは%s (ディスク イメージ) モードで書き込むことができます。\\n\"\n\"書き込み後、ドライブにフルアクセスできるよう、 Rufus は%s モードを推奨します。\\n\"\n\"ブート中にエラーが発生する場合には、%s モードで再度試してみてください。\\n\"\n\"\\n\"\n\"このイメージを書き込む際に使用するモードを選択してください。\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"%s モードで書き込む (推奨)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"%s モードで書き込む\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"競合するプロセスの確認中...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"非ブート用\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"ディスクまたは ISO イメージ\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (選択してください)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"USB ドライブを専用にロック\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"無効なデジタル署名\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"ダウンロードした実行可能ファイルにはデジタル署名がありません。\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"このダウンロードした実行可能ファイルのデジタル署名は “%s” です。\\n\"\n\"これは正規の署名ではありません。悪意のあるソフトウェアの可能性があります。\\n\"\n\"このファイルを実行しますか?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"“0” をドライブへ書き込み初期化中: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"USB 接続でないリムーバブル ディスクを検出しました。\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"管理者権限がありません。\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"このアプリケーションは管理者権限でのみ実行できます。\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"ファイルの索引化\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"バージョン選択\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"インストールしたい Windows のバージョンを選択してください。\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"サポートされていない Windows のバージョンです。\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"このバージョンの Windows は Rufus のサポート対象外となりました。\\n\"\n\"このプラットフォームと互換性のあるRufusの最終バージョンはv%d.%dです。\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"警告: 非公式版\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"このバージョンの Rufus は公式の開発者によって提供されたものではありません。\\n\"\n\"\\n\"\n\"非公式版 Rufus を実行しますか?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"不完全な ISO ファイルを検出しました。\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"選択された ISO ファイルは定義されているファイル サイズと一致しません。%sのデータが不足しています。\\n\"\n\"\\n\"\n\"このファイルがインターネットからダウンロードされたものならば、再ダウンロードし、 MD5 または SHA のチェックサムが公式のものと一致しているか確認してください。\\n\"\n\"\\n\"\n\"MD5 と SHA は(✓)ボタンをクリックすれば Rufus で確認できます。\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"タイムスタンプの検証エラー\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"ダウンロードしたアップデートのタイム スタンプが現在の実行ファイルのタイム スタンプよりも新しいことを確認できませんでした。\\n\"\n\"\\n\"\n\"潜在的な攻撃シナリオを防止するため、更新プロセスを中止しダウンロードしたファイルを削除します。 詳細はログを確認してください。\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"アプリケーションの設定を表示します。\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"このアプリケーションの情報を表示します。\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"ログを表示します。\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"選択したデバイスのディスク イメージを作成します。\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"このデバイスを使用して別のディスクに Windows をインストールしたい場合、またはこのドライブから Windows を直接実行 (Windows To Go) したい場合にこのオプションを使用します。\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"ドライブを高速完全消去中: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"時間がかかることがあります\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD の検出\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"圧縮ファイル\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"選択した ISO は UEFI を使用しており、 EFI システム パーティション (ESP) として書き込めるサイズです。ディスク全体を占める一般的なデータ パーティションに書き込むのではなく、 ESP に書き込む方が適しているインストーラもあります。\\n\"\n\"\\n\"\n\"このイメージを書き込むのに使用したいモードを選択してください。\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"有効にするには %s をメイン アプリケーション ウィンドウで実行してください。\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"追加のハッシュ値 (SHA512) を有効にする\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"VHD に保存\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"イメージのチェックサムを計算する\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"複数のボタン\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"チェックをパスした数\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ディスク ID\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"スレッドの優先度: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Boot Maker を無視\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"パーティション レイアウトを更新中 (%s)\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"選択されたイメージはハイブリッド ISO 形式ですが、 ISO イメージ モード / ファイル コピー モードと互換性がありません。\\n\"\n\"そのため、書き込みには DD イメージ モードが適用されます。\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"'%s'の読み取り\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Windowsカスタムを適応: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"ユーザー設定を適応中...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows ユーザーエクスペリエンス\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"インストーラーをカスタムしますか?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"4GB以上のRAM、セキュアブート及びTPM 2.0の要件を削除\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"オンラインアカウントの要件を削除\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"データ収集を無効化\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Windows To Goへの内部ディスクからのアクセスを防ぐ\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"ローカルアカウントを次の名前で作成:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"地域設定をこのユーザーと同じものに設定\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"BitLocker 自動デバイス暗号化を無効化します。\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"永続ログ\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"MS-DOSをインストールするにはMicrosoftから追加のファイル(diskcopy.dll)をダウンロードする必要があります。\\n\"\n\"- はいを選択すると、インターネットに接続しダウンロードします。\\n\"\n\"- いいえを選択すると、キャンセルします\\n\"\n\"\\n\"\n\"注意:ファイルはアプリケーションのディレクトリへダウンロードされ、今後自動的に再利用されます。\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"無効なUEFIブートローダーが検出されました。\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufusは選択されたISOイメージが無効なUEFIブートローダーを含み、最新のUEFIでセキュアブートが有効である場合%sを引き起こすことを検出しました。\\n\"\n\"\\n\"\n\"- このファイルが信頼できないソースから入手されたものであれば、マルウェア混入の可能性があるため起動しないことをお勧めします。\\n\"\n\"- このファイルが信頼できるソースから取得したものであれば、警告が発生しない新しいバージョンを探すことをお勧めします。\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"セキュリティ侵害表示\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"\\\"%s\\\"によるWindowsのブルースクリーン\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"圧縮されたVHDXイメージ\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"圧縮されていないVHDイメージ\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Full Flash Updateイメージ\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"この機能を使用するにはMicrosoftから追加のファイルをいくつかダウンロードする必要があります。\\n\"\n\"- はいを選択すると、インターネットに接続しダウンロードします。\\n\"\n\"- いいえを選択すると、キャンセルします\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"WindowsのSモードを強制する(オンラインアカウント要件の削除と同時に使用できません)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"エキスパートモード\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"ファイルを展開中: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Rufus MBRを使用する\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus (ルーファス) とは、起動可能なUSBフラッシュドライブ（USBメモリなど）を作成したり、フォーマットをするためのソフトウェアです。\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"公式サイト: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"ソースコード: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"変更履歴: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"このアプリケーションはGNU Public License (GPL) version 3でライセンスされています。\\n\"\n\"詳細は https://www.gnu.org/licenses/gpl-3.0.ja.html をご覧ください。\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"起動\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"USBメモリやSDカード、仮想ドライブをFAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3でフォーマットします。\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"FreeDOSの起動可能ドライブを作成します。\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"WindowsやLinuxなどのISOファイルから起動可能ドライブを作成します。\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"圧縮済みのものを含むディスクイメージから起動可能ドライブを作成します。\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"UEFI:NTFSを含むBIOS及びUEFIで起動可能なドライブを作成します。\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Windows To Goドライブを作成します。\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"TPM及びセキュアブート非対応のPC向けのWindows 11インストールドライブを作成します\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"記録用Linuxパーティションを作成します。\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"選択されたドライブのVHD/DDイメージを作成します。\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"選択されたイメージのMD5、SHA-1、SHA-256及びSHA-512チェックサムを計算します。\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"不良ブロックチェック及び容量詐欺ドライブの検知を行います。\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"マイクロソフト公式のWindows ISOをダウンロードします。\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"UEFIシェルのISOをダウンロードします。\"\n"
  },
  {
    "path": "res/loc/po/ko-KR.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2025-08-26 05:39+0900\\n\"\n\"PO-Revision-Date: 2026-01-28 21:33+0000\\n\"\n\"Last-Translator: VenusGirl <venusgirl@outlook.com>\\n\"\n\"Language-Team: 비너스걸 <https://venusgirls.tistory.com/>\\n\"\n\"Language: ko_KR\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Korean (한국어)\\n\"\n\"X-Rufus-LCID: 0x0412\\n\"\n\"X-Generator: Poedit 3.8\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"드라이브 속성\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"장치\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"부팅 선택\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"선택\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"이미지 옵션\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"파티션 구성\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"대상 시스템\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"USB 하드 드라이브 목록\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"오래된 BIOS에 대한 수정 추가 (추가 파티션, 정렬 등)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"런타임 UEFI 미디어 유효성 검증 사용\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"포맷 옵션\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"파일 시스템\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"클러스터 크기\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"볼륨 레이블\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"빠른 포맷\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"장치의 불량 블록 검사\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"확장 레이블 및 아이콘 파일 만들기\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"상태\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"닫기\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"시작\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Rufus 정보\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"라이선스\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"확인\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus 라이선스\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"추가 정보\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"예\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"아니요\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"로그\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"지우기\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"저장\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"업데이트 정책 및 설정\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"설정\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"업데이트 확인\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"베타 버전 포함\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"지금 확인\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"업데이트 확인 - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"최신 버전을 사용할 수 있습니다. 최신 버전을 다운로드하세요!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"웹사이트로 이동하려면 여기를 클릭하세요\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"릴리즈 정보\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"다운로드\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"다른 인스턴스가 감지되었습니다\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"다른 Rufus 응용 프로그램이 실행 중입니다.\\n\"\n\"다른 응용 프로그램을 실행하기 전에 첫 번째 응용 프로그램을 닫아주세요.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"경고: '%s' 장치의 모든 데이터가 삭제됩니다.\\n\"\n\"이 작업을 계속하려면 확인을 클릭합니다. 종료하려면 취소를 클릭합니다.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus 업데이트 정책\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Rufus가 온라인으로 응용 프로그램 업데이트를 확인할 수 있도록 허용하시겠습니까?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"취소\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"불량 블록을 찾았습니다\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"검사 완료: %d개의 불량 블록을 찾았습니다\\n\"\n\"  %d개 읽기 오류\\n\"\n\"  %d개 쓰기 오류\\n\"\n\"  %d개 손상 오류\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"더 자세한 보고서는 다음에서 확인할 수 있습니다:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"사용 안 함\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"매일\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"매주\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"매월\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"사용자 지정\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"현재 버전: %d.%d (빌드 %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"최신 버전: %d.%d (빌드 %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"바이트\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"킬로바이트\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"메가바이트\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"기본값\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (기본값)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (또는 UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (비 CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS 또는 UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d회\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d회 %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO 이미지\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"응용 프로그램\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"중단\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"실행\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"사용자가 작업을 취소했습니다\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"오류\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"오류: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"파일 다운로드\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB 저장 장치 (일반)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (디스크 %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"다중 파티션\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - 버퍼 비우기\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - 취소\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"성공했습니다.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"포맷하는 동안 알 수 없는 오류가 발생했습니다.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"이 미디어에 선택한 파일 시스템을 사용할 수 없습니다.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"장치에 대한 액세스가 거부되었습니다.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"미디어가 쓰기 금지되어 있습니다.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"다른 프로세스에서 장치를 사용 중입니다. 장치에 액세스할 수 있는 다른 프로세스를 모두 닫으세요.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"이 장치에는 빠른 포맷을 사용할 수 없습니다.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"볼륨 레이블이 유효하지 않습니다.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"장치 핸들이 유효하지 않습니다.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"선택한 클러스터 크기가 이 장치에 적합하지 않습니다.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"볼륨 크기가 유효하지 않습니다.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"드라이브에 이동식 미디어를 삽입하세요.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"지원되지 않는 명령이 수신되었습니다.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"메모리 할당 오류입니다.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"읽기 오류입니다.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"쓰기 오류입니다.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"설치 실패\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"미디어를 열 수 없습니다. 다른 프로세스에서 사용 중일 수 있습니다. 미디어를 다시 연결하고 다시 시도하세요.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"드라이브를 분할할 수 없습니다.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"대상 드라이브에 파일을 복사할 수 없습니다.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"사용자가 취소했습니다.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"스레드를 시작할 수 없습니다.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"불량 블록 검사가 완료되지 않았습니다.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"ISO 이미지 검색에 실패했습니다.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"ISO 이미지 추출에 실패했습니다.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"볼륨을 다시 마운트할 수 없습니다.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"부팅할 파일을 패치/설정할 수 없습니다.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"드라이브 문자를 할당할 수 없습니다.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"GUID 볼륨을 마운트할 수 없습니다.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"장치가 준비되지 않았습니다.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus는 Windows가 여전히 내부 버퍼를 USB 장치로 플러시하고 있음을 감지했습니다.\\n\"\n\"\\n\"\n\"USB 장치의 속도에 따라 특히 대용량 파일의 경우 이 작업을 완료하는 데 시간이 오래 걸릴 수 있습니다.\\n\"\n\"\\n\"\n\"손상되는 것을 방지하기 위해 Windows를 종료하는 것이 좋습니다.. 그러나 기다리는 것에 지치면 장치의 플러그를 뽑을 수 있습니다...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"지원되지 않는 이미지\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"이 이미지는 부팅할 수 없거나 Rufus에서 지원하지 않는 부팅 또는 압축 방식을 사용합니다...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"%s를 교체하시겠습니까?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"이 ISO 이미지는 '%s'의 오래된 버전을 사용하는 것 같습니다.\\n\"\n\"이로 인해 부팅 메뉴가 제대로 표시되지 않을 수 있습니다.\\n\"\n\"\\n\"\n\"Rufus는 이 문제를 해결하기 위해 최신 버전을 다운로드할 수 있습니다:\\n\"\n\"- 인터넷에 연결하고 파일을 다운로드하려면 '예'를 선택합니다\\n\"\n\"- 기존 ISO 파일을 수정하지 않은 상태로 두려면 '아니요'를 선택합니다\\n\"\n\"무엇을 해야 할지 모르면 '예'를 선택해야 합니다.\\n\"\n\"\\n\"\n\"참고: 새 파일이 현재 디렉터리에 다운로드되고 '%s'가 있으면 자동으로 재사용됩니다.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"%s 다운로드 중\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"선택된 ISO 이미지가 없습니다\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"%s 장치\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"이미지가 너무 큽니다\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"선택한 대상에 비해 이미지가 너무 큽니다.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"지원되지 않는 ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"UEFI 대상 유형을 사용하는 경우, EFI 부팅 가능한 ISO 이미지만 지원됩니다. EFI 부팅 가능한 ISO를 선택하거나 대상 유형을 BIOS로 설정하세요.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"지원되지 않는 파일 시스템\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"중요: 이 드라이브에는 다중 파티션이 있습니다!!\\n\"\n\"\\n\"\n\"여기에는 나열되지 않았거나 Windows에서 볼 수 없는 파티션/볼륨이 포함될 수 있습니다. 계속 진행하려면 이 파티션의 모든 데이터 손실에 대한 책임이 있습니다.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"다중 파티션이 감지되었습니다\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD 이미지\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"현재 선택한 파일 시스템은 이 유형의 ISO와 함께 사용할 수 없습니다. 다른 파일 시스템을 선택하거나 다른 ISO를 사용하세요.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s'는 파일 시스템이 NTFS인 경우에만 적용할 수 있습니다.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"중요: 'Windows To Go'를 설치하려고 하는데 대상 드라이브에 '고정' 속성이 없습니다. 이 때문에 Microsoft는 Windows가 '이동식' 속성을 가진 드라이브와 함께 작동하도록 설계하지 않았기 때문에 부팅 중에 Windows가 중지될 가능성이 높습니다.\\n\"\n\"\\n\"\n\"계속하시겠습니까?\\n\"\n\"\\n\"\n\"참고: '고정/이동식' 속성은 드라이브 제조업체의 사용자 지정 도구를 사용해야만 변경할 수 있는 하드웨어 속성입니다. 하지만 그 도구들은 일반인들에게는 거의 제공되지 않습니다...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"파일 시스템 제한\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"이 ISO 이미지에는 FAT 또는 FAT32 파일 시스템에 허용되는 최대 크기보다 큰 4GB 이상의 파일이 포함되어 있습니다.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"WIM 지원 누락\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"플랫폼이 WIM 압축파일에서 파일을 추출할 수 없습니다. EFI 부팅 가능한 Windows 7 및 Windows Vista USB 드라이브를 생성하려면 WIM 압축을 풀어야 합니다. 최신 버전의 7-Zip을 설치하여 이 문제를 해결할 수 있습니다.\\n\"\n\"7-zip 다운로드 페이지를 방문하시겠습니까?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"%s(을)를 다운로드하시겠습니까?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s 이상에서는 '%s' 파일을 설치해야 합니다.\\n\"\n\"이 파일은 크기가 100KB 이상이고 항상 %s ISO 이미지에 존재하기 때문에 Rufus에 포함되어 있지 않습니다.\\n\"\n\"\\n\"\n\"Rufus가 누락된 파일을 다운로드할 수 있습니다:\\n\"\n\"- 인터넷에 연결하고 파일을 다운로드하려면 '예'를 선택합니다\\n\"\n\"- 나중에 드라이브에 이 파일을 수동으로 복사하려면 '아니요'를 선택합니다\\n\"\n\"\\n\"\n\"참고: 파일이 현재 디렉터리에 다운로드되고 '%s'가 있으면 자동으로 재사용됩니다.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"취소하면 장치를 사용할 수 없는 상태가 될 수 있습니다.\\n\"\n\"취소하려면 예를 클릭합니다. 그렇지 않으면 아니요를 클릭합니다.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"폴더를 선택하세요\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"모든 파일\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus 로그\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (디스크 %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS는 64KB 클러스터 크기를 사용하는 드라이브에서 부팅할 수 없습니다.\\n\"\n\"클러스터 크기를 변경하거나 FreeDOS를 사용하세요.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"호환되지 않는 클러스터 크기\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"대용량 UDF 볼륨을 포맷하는 데 많은 시간이 걸릴 수 있습니다. USB 2.0 속도에서 예상 포맷 지속 시간은 %d:%02d이며, 이 기간 동안 진행률 표시줄이 고정된 것처럼 보입니다. 기다려주세요!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"대용량 UDF 볼륨\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"이 이미지에서는 Syslinux %s%s를 사용하지만 이 응용 프로그램에는 Syslinux %s%s에 대한 설치 파일만 포함됩니다.\\n\"\n\"\\n\"\n\"새 버전의 Syslinux는 서로 호환되지 않으므로 Rufus가 모두 포함할 수 없으므로 인터넷에서 두 개의 추가 파일 ('ldlinux.sys' 및 'ldlinux.bss')을 다운로드해야 합니다:\\n\"\n\"- 인터넷에 연결하고 이러한 파일을 다운로드하려면 '예'를 선택합니다\\n\"\n\"- 작업을 취소하려면 '아니요'를 선택합니다\\n\"\n\"\\n\"\n\"참고: 파일은 현재 응용 프로그램 디렉터리에 다운로드되며 있는 경우 자동으로 재사용됩니다.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"다운로드가 필요합니다\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"이 이미지는 Grub %s을(를) 사용하지만 응용 프로그램에는 Grub %s에 대한 설치 파일만 포함합니다.\\n\"\n\"\\n\"\n\"다른 버전의 Grub은 서로 호환되지 않을 수 있으며, 모두 포함할 수 없기 때문에 Rufus는 이미지에서 일치하는 Grub 설치 파일 ('core.img')의 버전을 찾으려고 시도합니다:\\n\"\n\"- 인터넷에 연결하고 다운로드하려면 '예'를 선택합니다\\n\"\n\"- Rufus의 기본 버전을 사용하려면 '아니요'를 선택합니다\\n\"\n\"- 작업을 중단하려면 '취소'를 선택합니다\\n\"\n\"\\n\"\n\"참고: 파일은 현재 응용 프로그램 디렉터리에 다운로드되며 있는 경우 자동으로 재사용됩니다. 일치하는 항목을 온라인으로 찾을 수 없는 경우 기본 버전이 사용됩니다.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"표준 Windows 설치\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"고급 드라이브 속성\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"고급 포맷 옵션\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"%s 표시\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"%s 숨기기\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"영구 파티션 크기\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"영구적 아님\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"라이브 USB 미디어의 영구 파티션 크기를 설정합니다. 크기를 0으로 설정하면 영구 파티션이 비활성화됩니다.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"파티션 크기 단위를 설정합니다.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"이 메시지를 다시 표시하지 않음\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"%s에 대한 중요 공지\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"UEFI:NTFS 부트 로더를 사용하는 미디어를 방금 만들었습니다. 이 미디어를 부팅하려면 보안 부팅을 비활성화해야 합니다.\\n\"\n\"이 기능이 필요한 이유에 대한 자세한 내용은 아래의 '추가 정보' 버튼을 참조하세요.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows 이미지 선택\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"이 ISO에는 여러 개의 Windows 이미지가 포함되어 있습니다.\\n\"\n\"이 설치에 사용할 이미지를 선택하세요:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"다른 프로그램 또는 프로세스가 이 드라이브에 액세스하고 있습니다. 포맷하시겠습니까?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus가 1809 ISO를 기반으로 Windows To Go 미디어를 만들려고 하는 것을 감지했습니다.\\n\"\n\"\\n\"\n\"*MICROSOFT BUG*로 인해 수동으로 'WppRecorder.sys' 파일을 1803 버전으로 교체하지 않으면 Windows 부팅 중 이 미디어가 충돌합니다.\\n\"\n\"\\n\"\n\"또한 Rufus가 이 문제를 자동으로 해결할 수 없는 이유는 'WppRecorder.sys'가 Microsoft의 저작권이 있는 파일이기 때문에 해당 파일의 복사본을 응용 프로그램에 법적으로 포함할 수 없기 때문입니다...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"파티션 구성표에서 MBR이 선택되었기 때문에 Rufus는 이 미디어에 최대 2TB의 파티션만 만들 수 있으며, 이로 인해 %s의 디스크 공간을 사용할 수 없게 됩니다.\\n\"\n\"\\n\"\n\"계속하시겠습니까?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"버전\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"릴리즈\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"에디션\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"언어\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"아키텍처\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"계속\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"뒤로\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"기다려주세요...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"브라우저를 사용하여 다운로드\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Microsoft가 이를 방지하기 위해 웹사이트를 변경했기 때문에 Windows ISO를 다운로드할 수 없습니다.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"이 스크립트를 실행하려면 PowerShell 3.0 이상이 필요합니다.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"온라인으로 이동하여 다운로드하시겠습니까?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"다운로드 스크립트 실행 중...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"ISO 이미지 다운로드\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"이 부팅 가능한 드라이브를 사용하려는 컴퓨터 유형입니다. 드라이브를 만들기 전에 대상이 BIOS인지 UEFI 유형인지 확인해야 합니다. 그렇지 않으면 부팅에 실패할 수도 있기 때문입니다.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM'은 장치가 네이티브 UEFI 모드가 아닌 UEFI에서 BIOS 에뮬레이션 모드 (레거시 모드라고도 함)에서만 부팅됨을 의미합니다.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'비 CSM'은 장치가 기본 UEFI 모드에서만 부팅되고 BIOS 에뮬레이션 모드 ('레거시 모드'라고도 함)에서는 부팅되지 않음을 의미합니다.\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"테스트 패턴: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"테스트 패턴: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"테스트 패턴: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"테스트 패턴: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"대상 파일 시스템 설정\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"파일 시스템에서 데이터 블록이 차지하는 최소 크기\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"이 필드를 사용하여 드라이브 레이블을 설정합니다.\\n\"\n\"국제 문자를 사용할 수 있습니다.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"고급 옵션 전환\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"테스트 패턴을 사용하여 장치의 불량 블록을 확인합니다\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"\\\"느린\\\" 포맷 방법을 사용하려면 이 상자의 선택을 취소합니다\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"파티션을 만드는 데 사용할 방법\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"드라이브를 부팅 가능하게 만드는 데 사용되는 방법\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"이미지를 선택하거나 다운로드하려면 클릭...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"이 확인란을 선택하면 국제 레이블 표시를 허용하고 장치 아이콘을 설정할 수 있습니다 (autorun.inf 생성).\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"미디어의 MD5Sum 파일 유효성 검사를 수행할 UEFI 부트로더 설치\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"숨겨진 파티션을 추가로 만들고 파티션 경계를 정렬합니다.\\n\"\n\"이를 통해 오래된 BIOS의 부팅 감지 성능을 향상시킬 수 있습니다.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"USB 하드 드라이브 외장 장치 목록을 활성화합니다. 위험을 감수하고 사용하세요!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"포맷 작업을 시작합니다.\\n\"\n\"대상에 있는 모든 데이터가 삭제됩니다!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"유효하지 않은 다운로드 서명\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"선택하려면 클릭...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - 신뢰할 수 있는 USB 포맷 유틸리티\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"버전 %d.%d (빌드 %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"한국어 번역:\\\\line• 세상사는이야기-나두 <mailto:ho82.kr@gmail.com>\\\\line• Uk-Jin Jang <mailto:doublestat@gmail.com>\\\\line• 비너스걸 (VᴇɴᴜsGɪʀʟ♥) <mailto:venusgirl@outlook.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"버그 보고 또는 향상된 기능 요청:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"추가 저작권:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"업데이트 정책:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"이 프로그램에서 응용 프로그램 업데이트를 확인하도록 선택한 경우, 다음 정보가 서버에서 수집될 수 있다는 데 동의하는 것입니다:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"운영 체제의 아키텍처 및 버전\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"사용하는 응용 프로그램의 버전\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"사용자의 IP 주소\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"개인 사용 통계를 생성하기 위해 당사는 수집한 정보를 \\\\b최대 1년 동안\\\\b0 보관할 수 있습니다. 그러나 당사는 이러한 개별 데이터를 제3자에게 기꺼이 공개하지 않을 것입니다.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"업데이트 과정:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus는 백그라운드 서비스를 설치하거나 실행하지 않으므로 업데이트 확인은 기본 응용 프로그램이 실행 중일 때만 수행됩니다.\\\\line\\n\"\n\"업데이트를 확인할 때는 당연히 인터넷 접속이 필요합니다.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"선택한 부팅 옵션에 대한 잘못된 이미지\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"현재 이미지가 선택한 부팅 옵션과 일치하지 않습니다. 다른 이미지를 사용하거나 다른 부팅 옵션을 선택하세요.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"이 ISO 이미지는 선택한 파일 시스템과 호환되지 않습니다\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"호환되지 않는 드라이브가 감지되었습니다\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"쓰기 통과\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"읽기 통과\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"%s을(를) 다운로드했습니다\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"%s을(를) 다운로드할 수 없습니다\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"내장된 버전의 %s 파일 사용\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"중요: 이 드라이브는 비표준 섹터 크기를 사용합니다!\\n\"\n\"\\n\"\n\"기존 드라이브는 512바이트 섹터 크기를 사용하지만 이 드라이브는 %d바이트 섹터 크기를 사용합니다. 대부분의 경우 이 드라이브에서 부팅할 수 없습니다.\\n\"\n\"Rufus는 부팅 가능한 드라이브를 만들 수 있지만 작동한다는 보장은 없습니다.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"비표준 섹터 크기가 감지됨\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go'는 고정 속성이 설정된 GPT 파티션 드라이브에만 설치할 수 있습니다. 현재 드라이브가 고정 드라이브로 감지되지 않았습니다.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"이 플랫폼에서는 이 기능을 사용할 수 없습니다.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"취소 중 - 잠시 기다려 주세요...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"이미지 검색 중...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"이미지를 검색하지 못했습니다\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"오래된 %s이(가) 감지되었습니다\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"이미지 사용: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"%s 파일 누락\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"새 볼륨\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d개의 장치를 찾았습니다\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d개의 장치를 찾았습니다\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"준비\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"취소\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"실패\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"새 응용 프로그램을 시작하는 중...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"새 응용 프로그램을 시작하지 못했습니다\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"%s 열림\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"%s 저장됨\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"포맷 중: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"파일 시스템을 만드는 중: 작업 %d/%d 완료\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS 오류 복구: %d%% 완료\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"(%s) 포맷 중... - 예상 시간 %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"레이블 설정 중 (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"포맷 중 (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS 오류 복구 (디스크 검사)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"MBR/PBR/GPT 구조 지우기...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"디스크 액세스 요청 중...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"기존 부팅 레코드 분석 중...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"기존 볼륨을 닫는 중...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"마스터 부트 레코드 작성 중...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"파티션 부트 레코드 작성 중...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"DOS 파일 복사 중...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"ISO 파일 복사 중: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI 부팅 설정 (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"마무리 중, 기다려 주세요...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Syslinux %s 설치 중...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"불량 블록: %s %d/%d - %0.2f%% (%d/%d/%d 오류)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"불량 블록: 무작위 패턴으로 테스트\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"불량 불록: 0x%02X 패턴으로 테스트\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"파티션 중 (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"파티션 삭제 중 (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"다운로드한 업데이트의 서명을 확인할 수 없습니다. 이는 시스템이 서명 유효성 검사를 위해 잘못 구성되었거나 악의적인 다운로드를 의미할 수 있습니다.\\n\"\n\"\\n\"\n\"다운로드가 삭제됩니다. 자세한 내용은 로그에서 확인하세요.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"다운로드 중: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"파일을 다운로드하지 못했습니다.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Rufus 업데이트 확인 중...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"업데이트: 인터넷에 연결할 수 없습니다\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"업데이트: 버전 데이터에 액세스할 수 없습니다\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Rufus의 새 버전을 사용할 수 있습니다!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Rufus의 새 버전이 발견되지 않았습니다\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"응용 프로그램 레지스트리 키가 성공적으로 삭제되었습니다\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"응용 프로그램 레지스트리 키를 삭제하지 못했습니다\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s 사용함\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s 사용 안 함\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"크기 확인\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"하드 디스크 감지\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"대용량 FAT32 포맷 강제 실행\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun은 종료시 삭제됩니다\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"가짜 드라이브 감지\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet 지원\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge 지원\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"강제 업데이트\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS 압축\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"이미지를 쓰는 중: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO 지원\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"적절한 크기 단위 사용\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"'%s' 디렉터리 삭제\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare 디스크 감지\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"듀얼 UEFI/BIOS 모드\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Windows 이미지 적용 중: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Windows 이미지 적용 중...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"타임스탬프 유지\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB 디버그\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"이미지 체크섬 계산 중: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"선택한 이미지에 대한 MD5, SHA1 및 SHA256 체크섬 계산\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"응용 프로그램 언어 변경\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s 이미지가 감지되었습니다\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"선택한 이미지는 'ISO 하이브리드' 이미지입니다. 즉, %s (파일 복사) 모드 또는 %s (디스크 이미지) 모드로 쓸 수 있습니다.\\n\"\n\"Rufus는 %s 모드를 사용하는 것이 좋습니다. 따라서 드라이브를 작성한 후에는 항상 드라이브에 대한 전체 액세스 권한을 가질 수 있습니다.\\n\"\n\"그러나 부팅하는 동안 문제가 발생하면 %s 모드에서 이 이미지를 다시 작성해 볼 수 있습니다.\\n\"\n\"\\n\"\n\"이 이미지를 작성하는 데 사용할 모드를 선택하세요:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"%s 모드로 쓰기 (권장)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"%s 모드로 쓰기\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"충돌하는 프로세스 확인 중...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"부팅 불가능\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"디스크 또는 ISO 이미지\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (선택해 주세요)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"독점적인 USB 드라이브 잠금\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"유효하지 않은 서명\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"다운로드한 실행 파일에 디지털 서명이 없습니다.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"다운로드한 실행 파일은 '%s'이(가) 서명했습니다.\\n\"\n\"이것은 우리가 인식하는 서명이 아니며 어떤 형태의 악의적인 활동을 나타낼 수 있습니다...\\n\"\n\"이 파일을 실행하시겠습니까?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"드라이브 제로화 중: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"비 USB 이동식 드라이브 감지\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"상승된 권한이 없습니다\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"이 응용 프로그램은 상승된 권한으로만 실행할 수 있습니다\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"파일 색인 중\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"버전 선택\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"설치하려는 Windows 버전을 선택하세요:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"지원되지 않는 Windows 버전\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"이 버전의 Windows는 더 이상 Rufus에서 지원되지 않습니다.\\n\"\n\"이 플랫폼과 호환되는 Rufus의 마지막 버전은 v%d.%d입니다.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"경고: 비공식 버전\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"이 버전의 Rufus는 공식 개발자가 제작한 것이 아닙니다.\\n\"\n\"\\n\"\n\"정말 실행하시겠습니까?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"불완전한 ISO가 감지되었습니다\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"선택한 ISO 파일이 선언된 크기와 일치하지 않습니다. %s의 데이터가 없습니다!\\n\"\n\"\\n\"\n\"인터넷에서 이 파일을 가져온 경우 새 사본을 다운로드하고 MD5 또는 SHA 체크섬이 공식 체크섬과 일치하는지 확인해야 합니다.\\n\"\n\"\\n\"\n\"(✓) 버튼을 클릭하여 Rufus에서 MD5 또는 SHA를 계산할 수 있습니다.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"타임스탬프 유효성 검사 오류\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus가 다운로드한 업데이트의 타임스탬프가 현재 실행 파일의 타임스탬프보다 최신인지 확인할 수 없습니다.\\n\"\n\"\\n\"\n\"잠재적인 공격 시나리오를 방지하기 위해 업데이트 프로세스가 중단되었으며 다운로드가 삭제됩니다. 자세한 내용은 로그를 확인하시기 바랍니다.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"응용 프로그램 설정 표시\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"이 응용 프로그램에 대한 정보 표시\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"로그 보기\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"선택한 장치의 디스크 이미지 만들기\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"이 장치를 사용하여 다른 디스크에 Windows를 설치할지 또는 이 드라이브 (Windows To Go)에서 Windows를 직접 실행할지 여부를 지정하려면 이 옵션을 사용합니다.\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"드라이브 빠른 0 채우기: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"시간이 걸릴 수 있습니다\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD 감지\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"압축된 보관\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"선택한 ISO는 UEFI를 사용하며 EFI 시스템 파티션 (ESP)으로 작성할 수 있을 정도로 작습니다. 일부 유형의 설치에서는 전체 디스크를 차지하는 일반 데이터 파티션에 쓰는 대신 ESP에 쓰는 것이 바람직할 수 있습니다.\\n\"\n\"\\n\"\n\"이 이미지를 작성하는 데 사용할 모드를 선택하세요:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"%s (기본 응용 프로그램 창에서)을(를) 사용하여 활성화합니다.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"추가 해시 (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"VHD에 저장\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"이미지 체크섬 계산\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"다중 버튼\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"검사 통과 수\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"디스크 ID\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"기본 스레드 우선 순위: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"부팅 마커 무시\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"파티션 레이아웃 (%s)을 새로 고치는 중...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"선택한 이미지는 ISO 하이브리드이지만 제작자가 ISO/파일 복사 모드와 호환되도록 만들지 않았습니다.\\n\"\n\"이에 따라 DD 이미지 쓰기 모드가 적용됩니다.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"'%s'을(를) 열거나 읽을 수 없습니다\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Windows 사용자 지정 적용 중: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"사용자 옵션을 적용하는 중...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows 사용자 환경\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Windows 설치를 사용자 지정하시겠습니까?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"4GB 이상의 RAM, Secure Boot 및 TPM 2.0에 대한 요구 사항 제거\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"온라인 Microsoft 계정에 대한 요구 사항 제거\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"데이터 수집 사용 안 함 (개인 정보 보호 질문 건너뛰기)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Windows To Go가 내부 디스크에 액세스하지 못하도록 차단\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"사용자 이름으로 로컬 계정 만들기:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"이 사용자의 값과 동일한 값을 사용하여 국가별 옵션 설정\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"BitLocker 자동 장치 암호화 사용 안 함\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"영구 로그\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('%s') must be downloaded from Microsoft to use this feature:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"이 기능을 사용하려면 Microsoft에서 추가 파일('%s')을 다운로드해야 합니다:\\n\"\n\"- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\\n\"\n\"- 작업을 취소하려면 '아니요'를 선택합니다\\n\"\n\"\\n\"\n\"참고: 해당 파일은 응용 프로그램의 디렉터리에 다운로드되며 존재하는 경우 자동으로 재사용됩니다.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"취소된 UEFI 부트로더가 탐지됨\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus는 사용자가 선택한 ISO에 취소된 UEFI 부트로더가 포함되어 있으며, 이는 완전히 최신 UEFI 시스템에서 보안 부팅이 활성화된 경우에 %s을(를) 생성한다는 것을 감지했습니다.\\n\"\n\"\\n\"\n\"- 평판이 좋지 않은 소스에서 이 ISO 이미지를 가져온 경우 UEFI 멀웨어가 포함되어 있을 가능성을 고려하고 부팅을 피해야 합니다.\\n\"\n\"- 신뢰할 수 있는 소스에서 가져온 경우에는 보다 최신 버전을 찾아야 합니다. 그러면 이 경고가 발생하지 않습니다..\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"\\\"보안 위반\\\" 화면\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"%s이(가) 있는 Windows 복구 화면 (BSOD)\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"압축된 VHDX 이미지\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"압축되지 않은 VHD 이미지\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"전체 플래시 업데이트 이미지\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"이 기능을 사용하려면 Microsoft에서 몇 가지 추가 데이터를 다운로드해야 합니다:\\n\"\n\"- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\\n\"\n\"- 작업을 취소하려면 '아니요'를 선택합니다\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Windows를 S-Mode로 제한 (온라인 계정 우회와 호환되지 않음)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"전문가 모드\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"압축 파일 추출 중: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Rufus MBR 사용\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus는 USB 메모리 및 플래시 드라이브를 포맷하고 부팅할 수 있도록 만드는 도구입니다.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"공식 사이트: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"소스 코드: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"변경 사항: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"이 응용 프로그램은 GNU Public License (GPL) 버전 3의 조건에 따라 라이선스가 부여됩니다.\\n\"\n\"자세한 내용은 https://www.gnu.org/licenses/gpl-3.0.html 을 참조하세요.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"부팅\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"USB, 플래시 카드 및 가상 드라이브를 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3로 포맷\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"FreeDOS 부팅 가능한 USB 드라이브 만들기\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"부팅 가능한 ISO (Windows, Linux 등)에서 부팅 가능한 드라이브 만들기\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"압축된 이미지를 포함하여 부팅 가능한 디스크 이미지에서 부팅 가능한 드라이브 만들기\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"UEFI 부팅 가능한 NTFS를 포함하여 BIOS 또는 UEFI 부팅 가능 드라이브 만들기\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"'Windows To Go' 드라이브 만들기\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"TPM 또는 보안 부팅이 없는 PC용 Windows 11 설치 드라이브 만들기\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"영구 리눅스 파티션 만들기\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"선택한 드라이브의 VHD/DD 이미지 만들기\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"선택한 이미지의 MD5, SHA-1, SHA-256 및 SHA-512 체크섬 계산\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"\\\"위조\\\" 플래시 드라이브 감지를 포함하여 불량 블록 검사 수행\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"공식 Microsoft Windows 리테일 ISO 다운로드\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"UEFI Shell ISO 다운로드\"\n"
  },
  {
    "path": "res/loc/po/lt-LT.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 3.22\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2023-04-25 13:16+0100\\n\"\n\"PO-Revision-Date: 2023-04-25 13:48+0100\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: lt_LT\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Lithuanian (Lietuvių)\\n\"\n\"X-Rufus-LCID: 0x0427\\n\"\n\"X-Generator: Poedit 3.2.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Disko ypatybės\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Įrenginys\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Įkrovos parinktis\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Pasirinkite\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Atvaizdo parinktis\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Skaidinių schema\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Paskirties sistema\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Išvardinti USB kietuosius diskus\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Pataisos seniems BIOS (papildomas skaidinys, ir kt.)\"\n\n#. • IDD_DIALOG → IDC_RUFUS_MBR\n#.\n#. 'MBR': See http://en.wikipedia.org/wiki/Master_boot_record\n#. Rufus can install it's own custom MBR (the Rufus MBR), which also allows users to\n#. specify a custom disk ID for the BIOS. The tooltip for this control is MSG_167.\nmsgid \"Use Rufus MBR with BIOS ID\"\nmsgstr \"Naudoti Rufus MBR su BIOS ID\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Formatavimo parinktys\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Failų sistema\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Klasterio dydis\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Tomo žymė\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Greitasis formatavimas\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Tikrinti įrenginį dėl blogų blokų\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Kurti išplėstinių žymių ir piktogramų failus\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Būsena\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Uždaryti\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Pradėti\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Apie Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licencija\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus licencija\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Daugiau informacijos\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Taip\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Ne\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Dienynas\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Valyti\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Išsaugoti\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Naujinių politika ir nuostatos\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Nuostatos\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Ieškoti naujinių\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Įtraukti beta versijas\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Tikrinti dabar\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Rufus naujinių paieška\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Rasta naujesnė versija. Atsisiųskite naujausią versiją!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Eiti į Rufus svetainę\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Versijos pastabos\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Atsisiųsti\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Aptiktas kitas programos atvejis\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Vykdoma kita Rufus programa.\\n\"\n\"Prieš vykdydami naują programą, uždarykite ankstesniąją.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"ĮSPĖJIMAS: VISI DUOMENYS ĮRENGINYJE „%s“ BUS SUNAIKINTI.\\n\"\n\"Norėdami tęsti šį veiksmą, spauskite Gerai. Norėdami išeiti - spauskite Atšaukti.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus naujinių politika\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Ar norite leisti Rufus ieškoti programos naujinių internete?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Atšaukti\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Rasta blogų blokų\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Tikrinimas baigtas: rasta %d blogų blokų\\n\"\n\"  %d skaitymo klaidų\\n\"\n\"  %d rašymo klaidų\\n\"\n\"  %d iškraipymo klaidų\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Išsamesnę ataskaitą rasite:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Išjungta\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Kasdien\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Kas savaitę\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Kas mėnesį\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Pasirinktinai\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Jūsų versija: %d.%d (sąranka %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Naujausia versija: %d.%d (sąranka %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"baitai\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobaitai\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabaitai\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Numatytas\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (numatytas)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (arba UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (ne CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS arba UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d bandymas\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d bandymai %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO atvaizdas\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Programa\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Nutraukti\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Vykdyti\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Veiksmas atšauktas naudotojo\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Klaida\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Klaida: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Failo atsisiuntimas\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB saugyklos įrenginys (bendrinis)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (diskas %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Keli skaidiniai\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - išvalomi buferiai\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - atšaukimas\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Sėkmingai.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Nenustatyta klaida formatuojant.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Negalima naudoti parinktos failų sistemos šiai laikmenai.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Prieiga prie šio įrenginio uždrausta.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Laikmena apsaugota nuo įrašymo.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Įrenginį naudoja kitas procesas. Prašau uždaryti kitus procesus, kurie gali kreiptis į įrenginį.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Greitasis formatavimas negalimas šiam įrenginiui.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Tomo žymė negaliojanti.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Įrenginio klasės vardas negaliojantis.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Pasirinktas klasterio dydis negalioja šiam įrenginiui.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Tomo dydis negaliojantis.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Įdėkite keičiamą laikmeną į įrenginį.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Gauta nepalaikoma komanda.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Atminties paskirstymo klaida.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Skaitymo klaida.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Rašymo klaida.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Įdiegimo triktis\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Nepavyko atverti laikmenos. Ji gali būti naudojama kito proceso. Prašau įdėti laikmeną iš naujo ir bandykite vėl.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Nepavyko išskaidyti disko.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Nepavyko nukopijuoti failų į paskirties diską.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Atšaukta naudotojo.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Negalima pradėti gijos.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Blogų blokų tikrinimas nebuvo baigtas.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"ISO atvaizdo peržiūros triktis.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"ISO atvaizdo išskleidimo triktis.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Negalima prijungti tomo.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Negalima papildyti/paruošti failų įkrovai.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Negalima priskirti disko raidės.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Negalima prijungti GUID tomo.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Įrenginys nepasiruošęs.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus aptiko, kad Windows vis dar išvalo savo vidinius buferius į USB įrenginį.\\n\"\n\"\\n\"\n\"Priklausomai nuo jūsų USB įrenginio spartos, šis veiksmas gali užtrukti ilgai, ypač su dideliais failais.\\n\"\n\"\\n\"\n\"Mes patariame jums leisti Windows pabaigti, kad išvengtumėte iškraipymų. Bet jei jums nusibos laukti, galite tiesiog ištraukti įrenginį...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Nepalaikomas atvaizdas\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Arba tai ne įkrovos atvaizdas, arba jis naudoja įkrovos ar glaudinimo metodą, kurio nepalaiko Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Pakeisti %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Atrodo, šis ISO atvaizdas naudoja pasenusią „%s“ versiją.\\n\"\n\"Įkrovos meniu dėl to gali būti vaizduojamas blogai.\\n\"\n\"\\n\"\n\"Galima atsisiųsti naujesnę Rufus versiją išspręsti problemai:\\n\"\n\"- Pasirinkite 'Taip' norėdami prisijungti prie interneto ir atsisiųsti failą\\n\"\n\"- Pasirinkite 'Ne' norėdami palikti esamą ISO failą nepakeistą\\n\"\n\"Jei nežinote ką daryti, reikėtų pasirinkti 'Taip'.\\n\"\n\"\\n\"\n\"Pastaba: naujas failas bus atsiųstas į dabartinį katalogą ir jei „%s“ ten jau yra, jis bus panaudotas iš naujo automatiškai.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Atsisiunčiama: %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Atvaizdas nepasirinktas\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"su %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Atvaizdas per didelis\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Atvaizdas yra per didelis pasirinktai paskirčiai.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Nepalaikomas ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Naudojant UEFI paskirties tipą, tik EFI įkrovos ISO atvaizdai yra palaikomi. Prašome pasirinkti EFI įkrovos ISO arba pakeisti paskirties tipą į BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Nepalaikoma failų sistema\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"SVARBU: ŠIS DISKAS TURI KELETĄ SKAIDINIŲ!!\\n\"\n\"\\n\"\n\"Tarp jų gali būti skaidinių/tomų, neparodytų ar net nematomų iš Windows. Jei norėsite tęsti, būsite atsakingi dėl galimo duomenų praradimo šiuose skaidiniuose.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Aptikta keletas skaidinių\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD atvaizdas\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Pasirinkta failų sistema negali būti naudojama su šiuo ISO tipu.Pasirinkite kitą failų sistemą arba naudokite kitokį ISO.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"„%so“ gali būti taikomas tik jei failų sistema yra NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"SVARBU: Jūs bandote įdiegti 'Windows To Go', bet jūsų paskirties diskas neturi atributo ´FIKSUOTAS´. Dėl to sistema Windows greičiausiai pakibs įkrovos metu, nes Microsoft nepritaikė jos veikti su diskais, turinčiais ´KEIČIAMAS´ atributą.\\n\"\n\"\\n\"\n\"Ar vis tiek norite tęsti?\\n\"\n\"\\n\"\n\"Pastaba: Atributas 'FIKSUOTAS/KEIČIAMAS' yra techninės įrangos savybė, kurią galima pakeisti tik naudojant specialias priemones iš disko gamintojo. Tačiau šios priemonės BEVEIK NIEKADA viešai nepateikiamos...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Failų sistemos apribojimas\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Šiame ISO atvaizde yra failas, didesnis nei 4 GB, tai daugiau nei maksimalus leistinas FAT arba FAT32 failų sistemos dydis.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Trūksta WIM palaikymo\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Jūsų platforma negali išskleisti failų iš WIM archyvų. WIM išskleidimas būtinas norint sukurti EFI įkraunamus Windows 7 ir Windows Vista USB diskus. Jūs galite tai sutvarkyti įdiegdami dabartinę 7-Zip versiją.\\n\"\n\"Ar norite apsilankyti 7-zip atsisiuntimo puslapyje?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Atsiųsti %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s ar vėlesniam reikia, kad '%s' failas būtų įdiegtas.\\n\"\n\"Kadangi šis failas didesnis nei 100 KB ir visada yra %s ISO atvaizduose, jis nėra įtrauktas į Rufus.\\n\"\n\"\\n\"\n\"Rufus gali jums atsiųsti trūkstamą failą:\\n\"\n\"- Pasirinkite 'Taip' norėdami prisijungti prie interneto ir atsisiųsti failą\\n\"\n\"- Pasirinkite 'Ne' norėdami rankiniu būdu nukopijuoti šį failą į diską vėliau\\n\"\n\"\\n\"\n\"Pastaba: failas bus atsiųstas į dabartinį katalogą ir kai „%s“ bus ten, jis bus pakartotinai naudojamas automatiškai.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Atšaukus dabar, įrenginys gali likti NEPRIEINAMOJE būsenoje.\\n\"\n\"Jei tikrai norite atšaukti, spauskite TAIP. Kitu atveju, spauskite NE.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Pasirinkite katalogą\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Visi failai\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus dienynas\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Diskas %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS negali įsikelti iš disko naudojant 64 kilobaitų klasterio dydį.\\n\"\n\"Pakeiskite klasterio dydį arba naudokite FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Nesuderinamas klasterio dydis\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Didelių UDF tomų formatavimas gali užimti daug laiko. USB 2.0 greičiu numatoma formatavimo trukmė yra %d:%02d, tuo metu eigos juosta gali atrodyti sustingusi. Būkite kantrūs!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Didelis UDF tomas\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Šis atvaizdas naudoja Syslinux %s%s, bet ši programa turi tik diegimo failus, skirtus Syslinux %s%s.\\n\"\n\"\\n\"\n\"Kadangi naujos Syslinux versijos tarpusavyje nesuderinamos, ir nėra galimybės į Rufus įtraukti jas visas, du papildomi failai turi būti atsisiųsti iš interneto ('ldlinux.sys' ir 'ldlinux.bss'):\\n\"\n\"- Pasirinkite 'Taip' norėdami prisijungti prie interneto ir atsisiųsti šiuos failus\\n\"\n\"- Pasirinkite 'Ne' norėdami veiksmą atšaukti\\n\"\n\"\\n\"\n\"Pastaba: Failai bus atsiųsti į dabartinį programos katalogą ir bus naudojami vėl automatiškai, juos ten radus.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Reikalingas atsisiuntimas\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Šis atvaizdas naudoja Grub %s, bet ši programa turi tik diegimo failus, skirtus Grub %s.\\n\"\n\"\\n\"\n\"Kadangi skirtingos Grub versijos gali būti nesuderinamos tarpusavyje, o jų visų įtraukti nėra galimybės, Rufus bandys surasti Grub įdiegimo failo ('core.img') versiją, atitinkančią esančią jūsų atvaizde:\\n\"\n\"- Pasirinkite 'Taip' norėdami prisijungti prie interneto ir atsisiųsti ją\\n\"\n\"- Pasirinkite 'Ne' norėdami naudoti numatytąją versiją iš Rufus\\n\"\n\"- Pasirinkite 'Atšaukti' norėdami nutraukti veiksmą\\n\"\n\"\\n\"\n\"Pastaba: Failas bus atsiųstas į dabartinį programos aplanką ir vėliau jam ten esant bus naudojamas automatiškai. Jei atitinkančio nebus rasta internete, bus naudojama numatytoji versija.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Standartinė Windows įdiegtis\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"išsamias disko ypatybes\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"išsamias formatavimo parinktis\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Rodyti %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Slėpti %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Išliekamojo skaidinio dydis\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Be išlikimo\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Nustatykite išliekamojo skaidinio dydį gyvai USB laikmenai. Nustačius 0 dydį, išliekamasis skaidinys išjungiamas.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Nustatykite skaidinio dydžio vienetus.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Neberodyti šio pranešimo\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Svarbi pastaba apie %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Jūs ką tik sukūrėte laikmeną, kuri naudoja UEFI:NTFS įkėliklį. Atminkite, norėdami įkrovos sistemą iš šios laikmenos, turite išjungti SECURE BOOT.\\n\"\n\"Išsamiau apie tai, kodėl tai būtina, žiūrėkite žemiau esančiame mygtuke \\\"Daugiau informacijos\\\".\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows atvaizdo pasirinkimas\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Šiame ISO yra keli Windows atvaizdai.\\n\"\n\"Pasirinkite atvaizdą, kurį norite naudoti šiam diegimui:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Kita programa arba procesas kreipiasi į šį diską. Ar vis tiek norite jį formatuoti?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus aptiko, kad jūs bandote sukurti Windows To Go laikmeną remiantis 1809 ISO.\\n\"\n\"\\n\"\n\"Dėl *MICROSOFT klaidos*, ši laikmena užlūš įkraunant Windows (mėlynas mirties ekranas), nebent jūs rankiniu būdu pakeisite failą \\\"WppRecorder. sys\\\" į 1803 versiją.\\n\"\n\"\\n\"\n\"Taip pat atkreipkite dėmesį, kad Rufus negali automatiškai pataisyti to už jus, nes \\\"WppRecorder. sys\\\" yra \\\"Microsoft\\\" autorių teisėmis apsaugotas failas, todėl mes negalime legaliai įterpti šio failo kopijos mūsų programoje...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Kadangi MBR buvo pasirinkta kaip skaidinio schema, Rufus gali sukurti tik iki 2 TB skaidinį šioje laikmenoje, dėl ko %s disko vietos liks nepasiekiama.\\n\"\n\"\\n\"\n\"Ar tikrai norite tęsti?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Versija\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Laida\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Leidimas\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Kalba\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Architektūra\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Tęsti\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Atgal\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Palaukite...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Atsisiųsti naudojant naršyklę\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Windows ISO atsisiuntimas nepasiekiamas, nes Microsoft pakeitė savo svetainę, kad to išvengtų.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 ar vėlesnis būtinas šiam scenarijui vykdyti.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Ar norite jungtis prie interneto ir atsisiųsti?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Vykdomas atsisiuntimo scenarijus...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Atsisiųsti ISO atvaizdą\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Paprastai saugiausias pasirinkimas. Bet jei turite UEFI kompiuterį ir norite įdiegti operacinę sistemą EFI režimu, turėtumėte pasirinkit vieną iš kitų parinkčių.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' reiškia, kad įrenginys įkėlimą vykdys BIOS emuliacijos režimu (žinomu kaip 'Legacy Mode') esant UEFI, o ne tikruoju UEFI režimu.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'ne CSM' reiškia, kad įrenginys įkėlimą vykdys tikruoju UEFI režimu, o ne BIOS emuliacijos režimu (žinomu kaip 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Testo šablonas: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Testo šablonas: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testo šablonas: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testo šablonas: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Nustato paskirties failų sistemą\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Mažiausias dydis, kurį duomenų blokas užims failų sistemoje\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Šiame laukelyje įrašykite disko žymę.\\n\"\n\"Galite naudoti tarptautinius simbolius.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Įjungti išsamias parinktis\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Tikrinti įrenginį dėl blogų blokų naudojant testo šabloną\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Nuimkite šio langelio žymę norėdami naudoti \\\"lėtą\\\" formatavimo būdą\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Būdas, kuris bus naudojamas skaidiniams kurti\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Būdas, kuris bus naudojamas padaryti diską įkraunamą\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Spauskite, jei norite pasirinkti ar atsisiųsti atvaizdą...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Pažymėkite šį langelį, norėdami įgalinti tarptautinių žymių rodymą ir įrenginio piktogramos nustatymą (sukuria autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install an MBR that allows boot selection and can masquerade the BIOS USB drive ID\"\nmsgstr \"Įdiegia MBR, kuris įgalina įkrovos pasirinkimą ir gali maskuoti BIOS USB disko ID\"\n\n#. • MSG_168\nmsgid \"\"\n\"Try to masquerade first bootable USB drive (usually 0x80) as a different disk.\\n\"\n\"This should only be necessary if you install Windows XP and have more than one disk.\"\nmsgstr \"\"\n\"Bandyti maskuoti pirmą įkraunamą USB diską (paprastai 0x80) kaip kitą diską.\\n\"\n\"To turėtų prireikti tik jei diegsite Windows XP ir bus daugiau nei vienas diskas.\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Sukurti papildomą slaptą skaidinį ir bandyti sulygiuoti skaidinių ribas.\\n\"\n\"Tai gali pagerinti įkrovos aptikimą su senais BIOSais.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Įgalinti išorinių USB kietųjų diskų pateiktį. NAUDOTI SAVO RIZIKA!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Pradėti formatavimą.\\n\"\n\"Tai SUNAIKINS visus duomenis paskirtyje!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Negaliojantis atsisiuntimo parašas\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Spauskite pasirinkti...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - patikima USB formatavimo priemonė\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Versija %d.%d (sąranka %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Lietuviškas vertimas: Gintaras Venslovas <gintaras.venslovas@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Dėl pastebėtų klaidų ar pageidaujamų patobulinimų kreipkitės:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Kitos autorių teisės:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Naujinių politika:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Jei leisite šiai programai tikrinti, ar yra naujinių, jūs sutinkate, kad mūsų serveriuose gali būti renkama ši informacija:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Jūsų operacinės sistemos architektūra ir versija\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Programos, kurią naudojate, versija\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Jūsų IP adresas\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Asmeninio naudojimo statistikos generavimo tikslu mes galime saugoti surinktą informaciją \\\\b ne daugiau kaip metus\\\\b0 . Tačiau mes savo valia neatskleisime nieko iš šios informacijos trečiosioms šalims.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Atnaujinimo procesas:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus neįdiegia ir nevykdo foninių tarnybų, todėl naujinių tikrinimai yra atliekami tik vykdant pagrindinę programą.\\\\line\\n\"\n\"Interneto prieiga, be abejo, yra reikalinga naujinių tikrinimui.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Negaliojantis atvaizdas pasirinktai įkrovos parinkčiai\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Dabartinis atvaizdas neatitinka pasirinktos įkrovos parinkties. Prašome naudoti kitą atvaizdą arba rinktis kitą įkrovos parinktį.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Šis ISO atvaizdas nesuderinamas su pasirinkta failų sistema\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Aptiktas nesuderinamas diskas\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Rašymo bandymas\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Skaitymo bandymas\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Atsiųsta %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Nepavyko atsiųsti %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Naudojama įterpta failo(ų) %s versija\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"SVARBU: ŠIS DISKAS NAUDOJA NESTANDARTINĮ SEKTORIAUS DYDĮ!\\n\"\n\"\\n\"\n\"Įprastiniai diskai naudoja 512 baitų sektoriaus dydį, bet šis diskas naudoja %d baitų. Daugeliu atveju tai reiškia, kad jūs NEGALĖSITE įkrauti sistemos iš šio disko.\\n\"\n\"Rufus gali mėginti sukurti įkrovos diską, bet NĖRA GARANTIJŲ, kad jis veiks.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Aptiktas nestandartinis sektoriaus dydis\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' gali būti įdiegta tik į GPT skaidinių diską, jei jis turi įjungtą atributą 'FIKSUOTAS'. Pasirinktas diskas nebuvo aptiktas kaip FIKSUOTAS.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Ši funkcija šioje platformoje nepasiekiama.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Atšaukiama - prašome palaukti...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Peržiūrimas atvaizdas...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Nepavyko peržiūrėti atvaizdo\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Aptiktas pasenęs %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Naudojamas atvaizdas: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Trūksta %s failo\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Naujas tomas\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d įrenginys rastas\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d įrenginiai rasti\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"PASIRUOŠĘS\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Atšaukta\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"NEPAVYKO\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Paleidžiama nauja programa...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Nepavyko paleisti naujos programos\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Atidarytas %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Išsaugotas %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formatuojama: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Kuriama failų sistema: Užduotis %d/%d atlikta\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS taisymas: %d%% atlikta\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formatuojama (%s) - numatoma trukmė %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Rašoma žymė (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formatuojama (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS taisymas (disko tikrinimas)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Išvalomos MBR/PBR/GPT struktūros...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Užsakoma disko prieiga...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Tiriami esami įkrovos įrašai...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Uždaromas esamas tomas...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Rašomas pagrindinis įkrovos įrašas (MBR)...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Rašomas skaidinio įkrovos įrašas...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopijuojami DOS failai...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopijuojami ISO failai: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI įkrovos sąranka (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Baigiama, prašome palaukti...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Įdiegiama Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Blogi blokai: %s %d/%d - %0.2f%% (%d/%d/%d klaidos)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Blogi blokai: tikrinama su atsitiktiniu šablonu\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Blogi blokai: tikrinama su šablonu 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Skaidoma (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Naikinami skaidiniai (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Atsisiųsto naujinio parašo galiojimas negali būti patikrintas. Tai gali reikšti, kad jūsų sistema nėra tinkamai suderinta parašų patikrinimui arba, kad siuntinys yra pakenktas.\\n\"\n\"\\n\"\n\"Siuntinys bus ištrintas. Daugiau informacijos rasite dienyne.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Atsiunčiama: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Nepavyko atsiųsti failo.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Tikrinama, ar yra Rufus naujinių...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Naujiniai: negaliu prisijungti prie interneto\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Naujiniai: negaliu pasiekti versijos duomenų\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Rasta nauja Rufus versija!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Naujos Rufus versijos nerasta\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Programos registro raktai sėkmingai ištrinti\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Nepavyko ištrinti programos registro raktų\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s įjungtas\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s išjungtas\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Dydžio tikrinimas\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Kietųjų diskų aptikimas\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Priversti didelį FAT32 formatavimą\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun bus ištrintas išeinant\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Netikrų diskų aptikimas\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet palaikymas\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge palaikymas\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Priversti naujintis\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS glaudinimas\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Įrašomas atvaizdas: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO palaikymas\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Naudoti TEISINGUS dydžio vienetus\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Trinamas aplankas „%s“\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare disko aptikimas\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Dvigubas UEFI/BIOS režimas\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Taikomas Windows atvaizdas: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Taikomas Windows atvaizdas...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Išsaugoti laiko žymas\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB derinimas\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Skaičiuojamos atvaizdo kontrolinės sumos: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Skaičiuoti MD5, SHA1 ir SHA256 kontrolines sumas pasirinktam atvaizdui\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Keisti programos kalbą\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Aptiktas %s atvaizdas\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Jūsų pasirinktas atvaizdas yra „ISOHybrid“ atvaizdas. Tai reiškia, kad jis gali būti įrašytas %s (failų kopijavimo) režimu arba %s (disko atvaizdo) režimu.\\n\"\n\"Rufus rekomenduoja naudoti režimą %s tam, kad visada turėtumėte visišką prieigą prie disko po įrašymo.\\n\"\n\"Tačiau, jei susiduriate su problemomis įkrovos metu, galite pabandyti įrašyti šį atvaizdą iš naujo %s režimu.\\n\"\n\"\\n\"\n\"Prašome pasirinkti režimą, kuriuo norite įrašyti šį atvaizdą:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Įrašyti %s režimu (rekomenduojama)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Įrašyti %s režimu\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Konfliktuojančių procesų tikrinimas...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Neįkraunamas\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Atvaizdo parinktis\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"(Prašome pasirinkti atvaizdą)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Išimtinis USB disko užrakinimas\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Negaliojantis parašas\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Atsiųstas vykdomasis failas neturi skaitmeninio parašo.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Atsiųstą vykdomąjį failą pasirašė „%s“.\\n\"\n\"Šio parašo mes neatpažįstame ir tai gali būti tam tikros kenkėjiškos veiklos požymis...\\n\"\n\"Ar jūs tikrai norite vykdyti šį failą?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Nulinamas diskas: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Ne USB keičiamų diskų aptikimas\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Reikia aukštesnių teisių\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Šiai programai vykdyti būtinos aukštesnės teisės\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Failų indeksavimas\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Versijos parinktis\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Prašome pasirinkti Windows versiją, kurią norite įdiegti:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Nepalaikoma Windows versija\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Šios Windows versijos Rufus nebepalaiko.\\n\"\n\"Paskutinė Rufus versija, suderinama su šia platforma, yra v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Įspėjimas: neoficiali versija\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Ši Rufus versija NĖRA išleista jos oficialaus kūrėjo(ų).\\n\"\n\"\\n\"\n\"Ar tikrai norite ją vykdyti?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Aptiktas nepilnas ISO\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Jūsų pasirinktas ISO failas neatitinka deklaruojamo dydžio: %s duomenų trūksta!\\n\"\n\"\\n\"\n\"Jei jūs gavote šį failą iš interneto, pabandykite atsisiųsti jį iš naujo ir patikrinkite, ar MD5 arba SHA kontrolinės sumos atitinka oficialiąsias.\\n\"\n\"\\n\"\n\"Beje, jūs galite apskaičiuoti MD5 arba SHA per Rufus, paspaudę.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Laiko žymos tikrinimo klaida\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus negalėjo patikrinti ar atsisiųsto naujinio laiko žyma yra naujesnė už dabartinio vykdomojo failo.\\n\"\n\"\\n\"\n\"Kad būtų užkirstas kelias galimai atakos grėsmei, naujinimo procesas buvo nutrauktas, o naujinys bus ištrintas. Daugiau informacijos rasite dienyne.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Rodyti programos nuostatas\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Rodyti informaciją apie šią programą\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Rodyti dienyną\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Kurti pasirinkto įrenginio disko atvaizdą\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Šią parinktį naudokite norėdami nurodyti ar naudosite šį įrenginį įdiegti Windows į kitą diską, ar norėsite vykdyti Windows tiesiogiai iš šio disko (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Greitasis disko nulinimas: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"tai gali užtrukti\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD aptikimas\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Suglaudintas archyvas\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Jūsų pasirinktas ISO naudoja UEFI ir yra pakankamai mažas, kad būtų įrašytas kaip ESI sistemos skaidinys (ESP). Rašymas į ESP gali būti tinkamesnis kai kuriems diegimo būdams negu rašymas į paprastą duomenų skaidinį užimantį visą diską.\\n\"\n\"\\n\"\n\"Pasirinkite būdą kuriuo norite įrašyti šį atvaizdą:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Naudokite %s (pagrindiniame programos lange), kad įjungtumėte.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Papildomos maišos (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Išsaugoti į VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Skaičiuoti atvaizdo kontrolines sumas\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Keletas mygtukų\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Bandymų skaičius\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"Disko ID\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Numatytasis gijos pirmumas\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Nepasyti įkrovos žymės\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Atnaujinamas skaidinių išdėstymas (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Jūsų pasirinktas atvaizdas yra \\\"ISOHybrid\\\" atvaizdas, tačiau jo kūrėjai nepadarė jo suderinamu su ISO/failų kopijavimo režimu.\\n\"\n\"Dėl to bus įgalintas DD atvaizdo įrašymo režimas.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Nepavyksta atidaryti arba perskaityti \\\"%s\\\"\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Windows tinkinimo taikymas: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Vartotojo parinkčių taikymas...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows vartotojo patirtis\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Tinkinti Windows diegimą?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Pašalinkite 4 GB + RAM, saugaus įkrovimo ir TPM 2.0 reikalavimus\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Pašalinkite internetinės Microsoft paskyros reikalavimą\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Išjungti duomenų rinkimą (praleisti klausimus apie privatumą)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Neleiskite Windows To Go pasiekti vidinių diskų\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Sukurkite vietinę paskyrą naudodami vartotojo vardą:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Regiono parinkčių nustatymas į tas pačias reikšmes kaip ir šio vartotojo\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"BitLocker automatinio įrenginių šifravimo išjungimas\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Nuolatinis žurnalas\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus programa leidžia suženklinti ir sukurti sistemų paleidimo laikmenas, kaip pvz. USB atmintukus, atminties korteles ir pan.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Oficiali svetainė: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Šaltinio kodas: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Pakeitimų žurnalas: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Ši programa yra licencijuota pagal GNU viešosios licencijos (GPL) 3 versijos sąlygas.\\n\"\n\"Daugiau informacijos rasite https://www.gnu.org/licenses/gpl-3.0.html.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Batas\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Suformatuokite USB, flash kortelę ir virtualius diskus į FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Sukurkite FreeDOS įkrovos USB diskus\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Sukurkite įkrovos diskus iš įkrovos ISO (Windows, Linux ir kt.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Sukurkite įkrovos diskus iš įkrovos disko vaizdų, įskaitant suspaustus\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Sukurkite BIOS arba UEFI įkrovos diskus, įskaitant UEFI įkrovos NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Sukurkite \\\"Windows To Go\\\" diskus\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Sukurkite Windows 11 diegimo diskus kompiuteriams, kuriuose nėra TPM arba saugaus įkrovimo\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Sukurkite nuolatinius Linux skaidinius\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Sukurkite pasirinkto disko VHD / DD vaizdus\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Apskaičiuokite pasirinkto vaizdo MD5, SHA-1, SHA-256 ir SHA-512 kontrolines sumas\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Atlikite blogų blokų patikrinimus, įskaitant \\\"netikrų\\\" flash diskų aptikimą\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Atsisiųskite oficialius Microsoft Windows mažmeninės prekybos ISO\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Atsisiųskite UEFI Shell ISO\"\n"
  },
  {
    "path": "res/loc/po/lv-LV.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-14 16:22+0100\\n\"\n\"PO-Revision-Date: 2024-05-14 16:22+0100\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: lv_LV\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Latvian (Latviešu)\\n\"\n\"X-Rufus-LCID: 0x0426\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Ierīces īpašības\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Ierīce\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Ielādes izvēle\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Izvēlēties\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Virtuālā attēla īpašības\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Sadaļas veids\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Datu nesēja failu sistēma\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"USB disku saraksts\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Pievienot vecāku BIOSu labojumus (partīcijām, dalījumam, u.c.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Ieslēgt UEFI nesēja pārbaudi izpildīšanas laikā\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Formatēšanas opcijas\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Failu sistēma\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Bloka izmērs\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Datu nesēja nosaukums\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Ātrā formatēšana\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Pārbaudīt ierīci uz bojātiem sektoriem\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Izveidot papildus nosaukumu un failu ikonas\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Statuss\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Aizvērt\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Sākt\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Par Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licence\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"Apstiprināt\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus licence\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Vairāk informācijas\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Jā\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Nē\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Atskaite\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Dzēst\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Saglabāt\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Jaunināšanas noteikumi un uzstādījumi\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Uzstādījumi\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Pārbaudīt jauninājumus\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Ieskaitot Beta versijas\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Pārbaudīt\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Jaunākas versijas meklēšana\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Ir pieejama jaunāka programmas versija. Varat to lejupielādēt!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Piespiediet šeit lai pāriet uz programmas mājas lapu\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Piezīmes\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Lejupielādēt\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Noteikta cita procesa esamība\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Darbojas cits Rufus eksemplārs.\\n\"\n\"Lūdzu aizveriet iepriekš startēto programmu pirms palaist no jauna.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"UZMANĪBU: VISI DATI NO NESĒJA '%s' TIKS IZDZĒSTI!!!\\n\"\n\"Turpinājumam piespiediet OK. Lai atcelt, piespiediet Atcelt.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus jaunināšanas noteikumi\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Vai vēlaties atļaut programmai meklēt jauninājumus internetā?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Atcelt\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Atrasti bojāti sektori\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Pārbaude pabeigta: atrasts(-i) %d bojāts(-i) sektors(-i)\\n\"\n\"  %d nolasīšanas kļūda(-s)\\n\"\n\"  %d ieraksta kļūda(-s)\\n\"\n\"  %d bojājuma(-u) kļūda(-s)\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Sīkāku atskaiti var atrast:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Atslēgt\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Ik dienu\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Ik nedēļu\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Ik mēnesi\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Citādi\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Jūsu versija: %d.%d (Būvējums %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Pēdējā versija: %d.%d (Būvējums %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"baiti\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobaiti\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabaiti\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Noklusējums\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Noklusējums)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (vai UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"BIOS (bez CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS vai UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d mēģ.\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d mēģ. %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO virtuālais attēls\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Programma\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Pārtraukt\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Startēt\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Darbību atcēla lietotājs\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Kļūda\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Kļūda: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Fails lejuplādēts\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB atmiņas ierīce (Generic)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Disks %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Vairākas partīcijas\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Buferu attīrīšana\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Darbības atcelšana\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Veiksmīgi.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Nezināma formatēšanas kļūda.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Šim nesējam nevar izmantot izvēlēto failu sistēmu.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Piekļuve iekārtai liegta.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Iekārta aizsargāta no ieraksta.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Iekārtu izmanto kāds cits process. Lai izmantot izvēlēto iekārtu aizveriet citu procesu.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Šai ierīcei ātrā formatēšana nav iespējama.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Ierīces nosaukums nav korekts.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Ierīces pazīme nav korekta.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Izvēlētais klastera izmērs nesader ar šo ierīci.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Nekorekts partīcijas izmērs.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Lūdzu ievietojiet datu nesēju.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Tika saņemta neatbalstāma komanda.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Atmiņas iedalīšanas kļūda.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Nolasīšanas kļūda.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Ieraksta kļūda.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Nesekmīga instalācija\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Nevar atvērt ierīci. Iespējams, to izmanto kāds cits process. Atvienojiet ierīci, un pieslēdziet no jauna.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Diska veidošanas kļūda.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Neizdevās nokopēt failus uz ierīci.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Darbību atcēla lietotājs.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Neizdevās palaist izpildes plūsmu.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Bojāto sektoru pārbaude netika pabeigta.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"ISO virtuālā attēla pārbaudes kļūda.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"ISO virtuālā attēla atpakošanas kļūda.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Neizdevās izveidot disku.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Neizdevās izveidot failus ielādei.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Neizdevās diskam piešķirt burtu.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Neizdevās izveidot GUID disku.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Ierīce nav gatava.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus noteica ka Windows nav beidzis darbu ar USB ierīces ātrpiekļuves buferi.\\n\"\n\"\\n\"\n\"Atkarībā no USB ierīces ātruma šīs operācijas pabeigšana var aizņemt ilgāku laiku, īpaši lielākiem failiem.\\n\"\n\"\\n\"\n\"Ieteikums: sagaidīt Windows darbības beigas, lai nesabojāt ierīci. Ja jums nav iespējas gaidīt, varat vienkārši atvienot ierīci...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Neatbalstāms virtuālā attēla formāts\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Izvēlētais virtuālais attēls nav ielādes, jeb izmanto Rufus nezināmu ielādes metodi vai saspiešanas formātu.\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Aizvietot %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Šis ISO virtuālais attēls izmanto novecojušas versijas '%s'.\\n\"\n\"Ielādes komandkarte var attēloties nekorekti.\\n\"\n\"\\n\"\n\"Šīs kļūdas novēršanai jāielādē jaunāka Rufus versija:\\n\"\n\"- Izvēlieties 'Jā' lai pieslēgtos pie interneta un ielādētu jaunāku versiju\\n\"\n\"- Izvēlieties 'Nē' lai ISO fails paliktu nemainīts\\n\"\n\"Ja nezināt ko darīt, izvēlieties 'Jā'.\\n\"\n\"\\n\"\n\"Piezīme: Jaunais fails tiks lejupielādēts tekošajā mapē, un eksistējošais '%s' automātiski tiks samainīts.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Lejuplādēts %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Nav izvēlēts virtuālais attēls\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"no %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Virtuālais attēls pārāk liels\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Izvēlētajam nesējam virtuālais attēls pārāk liels.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Neatbalstāms ISO formāts\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Izmantojot sistēmas interfeisu UEFI tikai EFI atbalsta ISO ielādes virtuālo attēlu. Izvēlieties EFI ielādes ISO failu vai izvēlieties interfeisu BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Neatbalstāma failu sistēma\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"SVARĪGI: ŠIS NESĒJS SATUR VAIRĀKAS PARTĪCIJAS!!\\n\"\n\"\\n\"\n\"Nesējs var saturēt sadaļas kuras nav attēlotas vai redzamas no Windows OS. Ja vēlaties turpināt, paši esat atbildīgi par datu zaudēšanu uz šādām partīcijām.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Konstatētas vairākas partīcijas\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD virtuālais attēls\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Tekošā failu sistēma nevar tikt izmantota ar šo ISO tipu. Izvēlieties citu failu sistēmu vai citu ISO failu.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' var izmantot tikai ar NTFS failu sistēmu.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"SVARĪGI: Jūs mēģinat instalēt 'Windows To Go', bet izvēlētajam diskam nav nepieciešamā atribūta 'FIKSĒTS', līdz ar to Windows ielāde visticamāk nenotiks, jo šis Microsoft produkts neatbalsta iekārtas kurām ir atribūts 'NOŅEMAMS'. \\n\"\n\"\\n\"\n\"Vai vēlaties turpināt?\\n\"\n\"\\n\"\n\"Piezīme: Atribūtu 'FIKSĒTS/NOŅEMAMS' var mainīt tikai iekārtas uzstādījumos izmantojot rīkus no iekārtas ražotāja. Šādi rīki parasti brīvā piekļuvē NETIEK IZVIETOTI...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Failu sistēmas ierobežojums\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Šis ISO virtuālais attēls satur failu(-s) lielāku(-s) par 4 GB, kas ir vairāk nekā maksimāli pieļaujamais apjoms izmantojot FAT vai FAT32 failu sistēmu.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Kļūdains WIM atbalsts\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Jūsu OS nevar atpakot failus no WIM arhīviem. Savukārt tas nepieciešams EFI ielādes diska izveidei OS Windows 7 vai Windows Vista USB diskiem. To var izlabot instalējot pēdējo 7-Zip versiju.\\n\"\n\"Vai vēlaties apmeklēt 7-zip ielādes mājas lapu?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Lejuplādēts %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Instalācijai nepieciešama %s vai jaunāka faila '%s' versija.\\n\"\n\"Tā kā fails ir lielāks par 100 KB, un pieder %s ISO virtuālajiem attēliem, tas netika iekļauts programmā Rufus.\\n\"\n\"\\n\"\n\"Rufus var ielādēt nepieciešamo failu:\\n\"\n\"- Izvēlieties 'Jā' lai pieslēgties internetam un ielādētu failu\\n\"\n\"- Izvēlieties 'Nē' ja vēlaties failu ielādēt vēlāk patstāvīgi\\n\"\n\"\\n\"\n\"Piezīme: Fails tiks lejuplādēts tekošajā mapē un ja '%s' jau ir, tas tiks pārrakstīts automātiski.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Darbības atcelšana var iekārtu atstāt kā NEIZMANTOJAMU.\\n\"\n\"Ja vēlaties atcelt, spiediet JĀ, pretējā gadījumā spiediet NĒ.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Izvēlieties mapi\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Visi faili\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus logs\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Disks %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS nevar ielādēties no nesēja ar klastera izmēru 64 Kb.\\n\"\n\"Pamainiet klastera izmēru izmantojot FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Nekorekts klastera izmērs\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Large UDF disku formatēšana var aizņemt daudz laika. Izmantojot USB 2.0 aprēķinātais formatēšanas ilgums ir %d:%02d, kura laikā izpildes līnija var apstāties. Esiet pacietīgi!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Large UDF disks\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Šis virtuālais attēls izmanto Syslinux %s%s, bet programma satur instalācijas failus Syslinux %s%s.\\n\"\n\"\\n\"\n\"Tā kā jaunās Syslinux versijas nav savstarpēji atbalstāmas, nepieciešams ielādēt no interneta vajadzīgos failus ('ldlinux.sys' un 'ldlinux.bss'):\\n\"\n\"- Izvēlieties 'Jā' lai pieslēgtos pie interneta un mēģināt ielādētu šos failus\\n\"\n\"- Izvēlieties 'Nē' lai atceltu šo darbību\\n\"\n\"\\n\"\n\"Piezīme: Faili tiks lejuplādēti tekošajā mapē, un ja tādi eksistē, automātiski tiks pārrakstīti.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Nepieciešams lejuplādēt\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Šis virtuālais attēls izmanto Grub %s bet programma satur instalācijas failus Grub %s.\\n\"\n\"\\n\"\n\"Tā kā jaunās Grub versijas nav savstarpēji atbalstāmas, un visas versijas iekļaut nav iespējams, Rufus mēģinās noteikt Grub instalācijas faila versiju ('core.img') kuru meklēs Jūsu virtuālajā attēlā:\\n\"\n\"- Izvēlieties 'Jā' lai pieslēgtos pie interneta un mēģināt ielādētu šos failus\\n\"\n\"- Izvēlieties 'Nē' lai izmantot noklusējuma versiju, kuru iekļauj Rufus\\n\"\n\"- Izvēlieties 'Atcelt' lai atceltu šo darbību\\n\"\n\"\\n\"\n\"Piezīme: Faili tiks lejuplādēti tekošajā mapē, un ja tādi eksistē, automātiski tiks pārrakstīti. Ja Internetā netiks atrasta meklējamā versija, tiks izmantots fails iekļautais Rufus.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Windows standarta instalācija\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"diska paplašinātās īpašības\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"formatēšanas paplašinātās īpašības\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Rādīt %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Slēpt %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Fiksētā apjoma sadaļa\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Nav sadaļas\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Fiksētās sadaļas apjoma izvēle uz USB nesēja. Ja nav fiksētās sadaļas ievadiet 0.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Fiksētās sadaļas apjoma mērvienības.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Nerādīt šo paziņojumu atkārtoti\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Svarīgs paziņojums par %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Tikko tika izveidots nesējs ar UEFI:NTFS ielādi. Atcerieties, lai piestartēt no šīs ierīces NEPIECIEŠAMS ATSLĒGT SECURE BOOT.\\n\"\n\"Papildus informāciju var iegūt piespiežot pogu 'Vairāk informācijas'.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows virtuālā attēla izvēle\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Šis ISO satur vairāku Windows OS virtuālos attēlus.\\n\"\n\"Izvēlieties virtuālo attēlu, kuru vēlaties izmantot instalācijai:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Citai programmai vai procesam ir piekļuve šai ierīcei. Vienalga vēlaties formatēt?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus noteica, ka mēģinat veidot Windows To Go disku formātā 1809 ISO\\n\"\n\"\\n\"\n\"Atsaucoties uz *MICROSOFT BUG*, šis nesējs var izsaukt Windows ielādes kļūdu (BSOD), šādā gadījumā nepieciešams manuāli samainīt 'WppRecorder.sys' failu uz 1803 versiju.\\n\"\n\"\\n\"\n\"Rufus automātiski nemaina šo failu, jo 'WppRecorder.sys' ir Microsoft īpašums, un legāli ievietot failu programmā nav iespējams...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Tā kā par ielādes sadaļu tika izvēlēts MBR, Rufus var izveidot sadaļu ar apjomu līdz 2 TB, pēc kā paliks %s brīvi pieejamas diska vietas papildus sadaļām.\\n\"\n\"\\n\"\n\"Vēlaties turpināt?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Versija\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Laidiens\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Redakcija\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Valoda\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Arhitektūra\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Turpināt\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Atpakaļ\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Uzgaidiet...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Lejuplādēt izmantojot pārlūkprogrammu\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Windows ISO fails nav lejupielādējams, jo Microsoft ir izmainījuši piekļuvi lai to liegtu.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Šī skripta darbībai nepieciešams PowerShell 3.0 vai vēlāks.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Vēlaties to ielādēt tiešsaistē?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Darbojas skripta lejupielāde...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Lejuplādēt ISO virtuālo attēlu\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Datora tips, uz kāda tiks izmantota ielāde no šīs iekārtas. Jūs esat atbildīgi par savu izvēli, nepareizi norādot BIOS vai UEFI ielādes veidu izveidotais disks var nedarboties kā ielādes disks.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' nozīmē, ka iekārta ielādei izmantos BIOSa emulāciju (zināmu arī kā 'Legacy Mode'), un nedarbosies UEFI režīmā.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'bez CSM' nozīmē, ka iekārta ielādei izmantos UEFI režīmu, un nedarbosies BIOSa emulācijas režīmā (zināms arī kā 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Bojāto sektoru noteikšana izmantojot 1 mēģinājumu\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Bojāto sektoru noteikšana izmantojot 2 mēģinājumus\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Bojāto sektoru noteikšana izmantojot 3 mēģinājumus\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Bojāto sektoru noteikšana izmantojot 4 mēģinājumus\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Failu sistēmas izvēlne\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Minimālais failu sistēmas izmantojamā bloka izmērs\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Ievadiet nesēja nosaukumu.\\n\"\n\"Atbalstās starptautiskie simboli.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Atvērt papildus parametrus\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Atzīmējiet lai pārbaudīt ierīci uz bojātiem sektoriem\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Noņemiet atzīmi lai izmantot \\\"lēno\\\" formatēšanu\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Sadaļu veidošanas metode\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Ielādes varianti\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Piespiediet virtuālā attēla izvēlei...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Atzīmējiet starptautisko simbolu atbalstam un ierīces ikonas izveidei (tiek izveidots fails autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Instalēt MBR, kur var izvēlēties ielādi un kurš var maskēties BIOS'ā ar ierīces identifikatoru\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Izveidot papildus slēpto partīciju un izlīdzināt partīciju robežas.\\n\"\n\"Šī opcija var atvieglot ielādes noteikšanu vecākās BIOS versijās.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Rādīt ārējos USB pieslēguma HDD. IZMANTOJAT UZ SAVAS ATBILDĪBAS!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Tiks sākta formatēšana.\\n\"\n\"Visi dati no nesēja tiks IZNĪCINĀTI!!!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Nekorekts lejupielādes paraksts\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Piespiediet izvēlei...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - uzticama un vienkārša USB formatēšanas utilīta\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Versija %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Latviešu tulkojums: Aldis Tutins <mailto:alibaba@inbox.lv>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Paziņot par kļūdu vai ieteikt uzlabojumus:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Papildus autortiesības:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Jauninājumu politika:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Ja jūs ļaujat programmai veikt jauninājumus, jūs piekrītat tam ka uz mūsu serveriem tiks saglabāta sekojoša informācija:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Jūsu OS arhitektūra un versija\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Izmantojamās programmas versija\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Jūsu IP adrese\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Statistikas nolūkos apkopotā informācija var tikt uzglabāta \\\\b gada laikā\\\\b0 . Savukārt apkopotā informācija netiks izpausta jebkādai trešai pusei.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Jaunināšanas process:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus netiek instalēta kā OS serviss, tāpēc jauninājumu pārbaude iespējama tikai tad, kad programma darbojas.\\\\line\\n\"\n\"\\n\"\n\"Jauninājumu pārbaudei un ielādei nepieciešams interneta pieslēgums.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Izvēlētajai ielādes opcijai nederīgs virtuālais attēls\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Izvēlētais virtuālais attēls neatbalsta izvēlēto ielādes variantu. Lūdzu izvēlieties citu virtuālo attēlu vai citas ielādes opcijas.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Šis ISO virtuālais attēls neatbalstās ar izvēlēto failu sistēmu\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Noteikts neatbalstāms nesējs\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Mēģinājums\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Nolasīts\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Ielādēts %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Nevar ielādēt %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Izmantot %s faila(u) iekļauto versiju\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"SVARĪGI: ŠĪ IEKĀRTA IZMANTO NESTANDARTA SEKTORU IZMĒRU!\\n\"\n\"\\n\"\n\"Parasti iekārtas izmanto 512-bitu sektora izmēru, bet šī iekārta izmanto %d-bitu. Visbiežāk tas nozīmē ka no šī diska NEVARĒS ielādēties no šīs ierīces.\\n\"\n\"Rufus var mēģināt izveidot ielādes diesku, bet NEGARANTĒ tā korektu darbību.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Noteikts nestandarta sektoru izmērs\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' var tikt instalēts tikai uz GPT failu sistēmas nesēja, ja tam ir atribūts 'FIKSĒTS'. Tekošai ierīcei NAV noteikts atribūts 'FIKSĒTS'.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Šī iespēja dotajai OS nav pieejama.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Atcelšana - lūdzu uzgaidiet...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Diska virtuālā attēla pārskats...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Kļūda pārskatot diska virtuālo attēlu\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Noteikts novecojis %s modulis\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Tiek izmantots virtuālais attēls: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Kļūdains %s fails\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Jauns Disks\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"Atrasta %d ierīce\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"Atrastas %d ierīces\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"Gatavs darbam\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Darbība atcelta\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Kļūda\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Tiek startēta jaunā versija...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Kļūda jaunās versijas palaišanā\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Atvērts %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Saglabāts %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formatēšana: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Failu sistēmas izveide: Paveikts %d/%d\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS labojums: Paveikts %d%%\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formatēšana (%s) - aprēķinātais laiks %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Nosaukuma ieraksts (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formatēšana (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS labojums (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"MBR/PBR/GPT struktūras attīrīšana...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Nepieciešama piekļuve diskam...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Esošā ielādes ieraksta analīze...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Eksistējošā diska aizvēršana...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Galvenā ielādes ieraksta (MBR) izveide...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Sadaļas ielādes ieraksta izveide...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopē DOS failus...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopē ISO failus: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI ielādes uzstādīšana (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Pabeigšana, lūdzu uzgaidiet...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Instalējas Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Bojātie sektori: %s %d/%d - %0.2f%% (%d/%d/%d kļūdu)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Bojātie sektori: Testēšana pēc nejaušā šablona\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Bojātie sektori: Testēšana ar 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Sadaļas izveide (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Sadaļas dzēšana (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Lejupielādes paraksts nav apstiprināts. Tas nozīmē, ka lejupielādētais fails ir vai nu bojāts, vai satur kādu vīrusu.\\n\"\n\"\\n\"\n\"Lejupielādētais fails tiks izdzēsts.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Lejupielādē: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Kļūda lejuplādējot failu.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Tiek pārbaudīti Rufus jauninājumi...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Jauninājumi: Nevar pieslēgties internetam\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Jauninājumi: Nav piekļuves versijas datiem\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Ir pieejama jaunāka Rufus versija!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Nav atrasta jaunāka Rufus versija\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Programmas reģistru ieraksti veiksmīgi dzēsti\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Kļūda programmas reģistru dzēšanā\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s ieslēgta\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s izslēgta\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Izmēra pārbaude\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Iekšējo disku noteikšana\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Paplašinātā FAT32 formatēšana\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun pārtraucot darbu tiks nodzēsts\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Konstatēts neeksistējošs disks\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet atbalsts\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge atbalsts\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Piespiedu jaunināšana\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS kompresija\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Virtuālā attēla ieraksts: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO atbalsts\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Izvēlieties atbilstošas vienības\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Tiek dzēsta mape '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Noteikts VMWare disks\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Apvienotais UEFI/BIOS režīms\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Pielietots Windows virtuālais attēls: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Pielietots Windows virtuālais attēls...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Saglabāt laika zīmogu\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB-atkļūdošana\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Kontrolsummu skaitļošana: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Izskaitļot MD5, SHA1 un SHA256 kontrolsummas izvēlētajam virtuālajam attēlam\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Mainīt programmas valodu\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Pamanīts %s-virtuālais attēls\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Izvēlētajam virtuālajam attēlam ir 'ISOHybrid' formāts. Tas nozīmē ka virtuālo attēlu var ierakstīt vai %s kopēšanas režīmā, vai %s diska virtuālā attēla režīmā.\\n\"\n\"Ieteicams izmantot %s režīmu pilnīgai piekļuvei diska saturam pēc ieraksta.\\n\"\n\"Ja ielādes laikā rodas problēmas, Jūs varat atkārtoti mēģināt ierakstīt virtuālo attēlu %s režīmā.\\n\"\n\"\\n\"\n\"Lūdzu, izvēlieties režīmu, kurš tiks izmantots izvēlētā virtuālā attēla ierakstam:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Ierakstīt %s režīmā (Ieteicams)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Ierakstīt %s režīmā\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Procesu konfliktu pārbaude...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Neielādējams virtuālais attēls\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disks vai ISO virtuālais attēls\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Izvēlieties)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Ekskluzīva USB nesēja slēgšana\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Nederīgs paraksts\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Ielādētajam izpildfailam ir kļūdains ciparu paraksts.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Ielādētais izpildfails parakstīts kā '%s'.\\n\"\n\"Tas ir neatpazīts paraksts un iespējams, var radīt aizdomīgas aktivitātes...\\n\"\n\"Vai tiešām vēlaties izpildīt šo failu?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Diska nullēšana: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"neUSB disku noteikšana\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Nepietiekamas lietotāja tiesības\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Šai programmai nepieciešamas speciālas tiesības\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Failu indeksācija\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Versijas izvēle\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Izvēlieties Windows versiju, kuru vēlaties instalēt:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Neatbalstāma Windows versija\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Šo Windows versiju Rufus vairs neatbalsta.\\n\"\n\"Pēdējā Rufus atbalstāmā versija šai OS ir v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Uzmanību: Neoficiāla programmas versija\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Šī Rufus versija nav no oficiālā izstrādātāja.\\n\"\n\"\\n\"\n\"Vai tiešām vēlaties to izmantot?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Noteikts samazināts ISO\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Izvēlētais ISO fails neatbilst noteiktajam izmēram: %s datu ir kļūdaini!\\n\"\n\"\\n\"\n\"Ja šis fails tika lejuplādēts no Interneta, nepieciešams lejuplādēt no jauna un pārbaudīt MD5 vai SHA kontrolsummu atbilstību.\\n\"\n\"\\n\"\n\"Piezīme: aprēķināt MD5 vai SHA kontrolsummu programmā Rufus var piespiežot taustiņu (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Laika zīmoga kļūda\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus neizdevās identificēt jauninājuma laika zīmogu, kā jaunāku attiecībā pret pašreizējo.\\n\"\n\"\\n\"\n\"Lai nepieļaut iespējamu ļaundarības varbūtību, programmas jaunināšanas process tika pārtraukts, un lejuplādētais fails tika izdzēsts. Sīkākai informācijai pārbaudiet atskaiti.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Programmas uzstādījumi\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Informācija par programmu\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Rādīt atskaiti\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Veidot virtuālo attēlu no izvēlētās iekārtas\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Izmantojiet šo opciju, lai norādīt vai vēlaties izmantot ierīci Windows instalēšanai uz cita diska, vai vēlaties startēt Windows no šīs ierīces (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Ātrā diska nullēšana: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"šī darbība var aizņemt laiku\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Noteikts VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Saspiests arhīvs\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Izvēlētais ISO-fails izmanto UEFI un ir pietiekoši mazs, lai varētu tikt ierakstīts, kā EFI (ESP) sistēmas sadaļa. Ieraksts iekš ESP, nevis kopējā datu sadaļā, kas aizņem visu disku, var būt ieteicamāks dažu ielāžu tipiem.\\n\"\n\"\\n\"\n\"Izvēlieties to režīmu, kuru nepieciešams izmantot lai ierakstīt šo virtuālo attēlu:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Lai ieslēgt, izmantojiet %s programmas galvenajā izvēlnē.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Ekstra heši (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Saglabāt VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Izskaitļo virtuālo attēlu kontrolsummas\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Vairāk pogu\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Mēģinājumu skaits\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"Diska ID\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Noklusējuma prioritāte: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignorēt ielādes marķeri\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Atjauno sadaļas izkārtojumu (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Izvēlētais virtuālais attēls ir ISOHybrid, bet tā veidotājs nav izveidojis ISO/Failu kopēšanas .\\n\"\n\"Tiks izmantots DD virtuālā attēla kopēšanas režīms.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Neizdevās atvērt vai izlasīt '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Pielietot Windows kastomizāciju: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Lietotāja opciju pielietošana...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows lietotāju pieredze\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Izvēles Windows instalācija?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Atslēgt prasības priekš 4GB+ RAM, Secure Boot un TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Atslēgt prasību Microsoft kontam\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Atslēgt datu nodošanu (Izlaist jautājumus par privātumu)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Aizliegt Windows To Go piekļuvi iekšējiem nesējiem\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Izveidot lokālo kontu ar lietotājvārdu:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Izvēlēties reģionālos uzstādījumus kā šim lietotājam\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Atslēgt automātisko šifrēšanu ar BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Pastāvīgs žurnāls\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Lai instalēt MS-DOS no Microsoft vietnes nepieciešams lejuplādēt papildus failu («diskcopy.dll»):\\n\"\n\"- Izvēlieties «Jā», lai pieslēgties pie Interneta un failu lejuplādēt.\\n\"\n\"- Izvēlieties «Nē», lai atcelt darbību.\\n\"\n\"\\n\"\n\"Piezīme. Fails tiks lejuplādēts programmas mapē, ja tas jau eksistē, tiks izmantots atkārtoti.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Pamanīts atceltais UEFI ielādes ieraksts\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus konstatēja Jūsu izvēlētais ISO-fails satur atceltu UEFI ielādes ierakstu, kurš izdos %s, ja būs ieslēgta drošā ielāde pilnīgi jauninātajā UEFI sistēmā.\\n\"\n\"\\n\"\n\"- Ja šis ISO fails ir iegūts no nedrošiem avotiem, vajag ņemt vērā, ka tas var saturēt UEFI ļaunatūru un censties no tā nestartēt.\\n\"\n\"- Ja fails iegūts no droša avota, būtu jāatrod jaunāka versija, kurai nerādīs šādu brīdinājumu.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"a \\\"Drošības pārkāpuma\\\" ekrāns\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"a Windows atkopšanas ekrāns (BSOD) ar '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Saspiests VHDX attēls\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Nesaspiests VHDX attēls\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Full Flash atjauninājuma attēls\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Lai izmantotu šo funkcionalitāti, no Microsoft ir jālejupielādē daži papildus dati:\\n\"\n\"- Izvēlieties 'Jā', lai izveidotu savienojumu ar Internetu un lejupielādētu tos\\n\"\n\"- Izvēlieties \\\"Nē\\\", lai atceltu darbību\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Ierobežot Windows tikai S režīmā (NESADERĪGS ar tiešsaistes konta apiešanu)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Eksperta režīms\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Atpakot arhīva failus: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Izmantot Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus ir instruments ar kura palīdzību var formatēt un izveidot USB ielādes ierīces uz tādiem nesējiem, kā USB pieslēguma zibatmiņas, atmiņas kartes u.c.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Oficiālā mājas lapa: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Sākotnējais kods: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Izmaiņas: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Šai programmai ir licences noteikumi, kā GNU Public License (GPL) version 3.\\n\"\n\"Papildinformācijai skatīt https://www.gnu.org/licenses/gpl-3.0.html.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Ielāde\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatē USB, atmiņas kartes un virtuālos diskus formātos FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Izveido FreeDOS ielādes USB ierīces\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Izveido ielādes ierīces no ISO failiem (Windows, Linux, u.c.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Izveido ielādes ierīces no ielādes disku virtuālajiem attēliem, tai skaitā arī no saspiestajiem\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Izveido BIOS vai UEFI ielādes ierīces, ieskaitot UEFI ielādi no NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Izveido 'Windows To Go' ierīces\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Izveido Windows 11 instalācijas ierīces datoriem, kam nav TPM vai Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Izveido pastāvīgas Linux partīcijas\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Izveido izvēlētā diska VHD/DD virtuālos attēlus\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Izskaitļo izvēlētā virtuālā attēla MD5, SHA-1, SHA-256 un SHA-512 kontrolsummas\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Izpilda bojāto bloku pārbaudi ieskaitot \\\"falsificēto\\\" nesēju noteikšanu\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Lejupielādē oficiālos Microsoft ISO failus\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Lejupielādē UEFI OS ISO failus\"\n"
  },
  {
    "path": "res/loc/po/ms-MY.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 3.22\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2023-04-25 13:26+0100\\n\"\n\"PO-Revision-Date: 2023-04-25 13:33+0100\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: ms_MY\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Malay (Bahasa Malaysia)\\n\"\n\"X-Rufus-LCID: 0x043e, 0x083e\\n\"\n\"X-Generator: Poedit 3.2.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Sifat cakera\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Peranti\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Jenis boot\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Pilih\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Pilihan Imej\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Skema partisyen\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Sistem yang akan dipasang\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Senaraikan Cakera Keras USB\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Tambah pembaikan untuk BIOS lama\"\n\n#. • IDD_DIALOG → IDC_RUFUS_MBR\n#.\n#. 'MBR': See http://en.wikipedia.org/wiki/Master_boot_record\n#. Rufus can install it's own custom MBR (the Rufus MBR), which also allows users to\n#. specify a custom disk ID for the BIOS. The tooltip for this control is MSG_167.\nmsgid \"Use Rufus MBR with BIOS ID\"\nmsgstr \"Guna MBR Rufus dengan BIOS ID\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Pilihan format\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Sistem fail\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Saiz gugusan\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Label jilid baharu\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Format pantas\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Semak peranti untuk blok rosak\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Cipta label lanjut dan fail ikon\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Tutup\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Mula\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Mengenai Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Lesen\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Lesen Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Maklumat lanjut\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Ya\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Tidak\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Padam\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Simpan\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Kemaskini dasar dan tetapan\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Tetapan\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Semak untuk versi baharu\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Termasuk versi beta\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Semak sekarang\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Semak untuk versi baharu - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Terdapat versi Rufus yang baharu. Sila muat turun versi yang terkini!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Klik di sini untuk ke laman sesawang Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Maklumat versi terbaharu\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Muat turun\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Proses Rufus lain dikesan\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Terdapat aplikasi Rufus sedang berjalan.\\n\"\n\"Sila tutup aplikasi tersebut sebelum melancarkan aplikasi Rufus baharu.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"AMARAN: SEMUA DATA DI DALAM PERANTI '%s' AKAN DIPADAM.\\n\"\n\"Jika hendak teruskan, klik OK. Untuk berhenti, klik BATAL.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Dasar kemas kini Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Adakah anda mahu membenarkan Rufus menyemak untuk versi baharu dalam talian?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Batal\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Blok rosak dijumpai\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Semak selesai: %d blok rosak dijumpai\\n\"\n\"  %d ralat membaca\\n\"\n\"  %d ralat menulis\\n\"\n\"  %d ralat korupsi\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Laporan lebih terperinci boleh dijumpai di:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Nyahaktif\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Harian\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Mingguan\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Bulanan\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Tetapan sendiri\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Versi anda: %d.%d (Binaan %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Versi terkini: %d.%d (Binaan %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"bait\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobait\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabait\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Tetapan asal\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Tetapan asal)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (atau UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (bukan CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS atau UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d kali lulus\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d kali lulus %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Imej ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Aplikasi\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Batal\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Mula\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operasi dibatalkan oleh pengguna\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Ralat\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Ralat: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Muat turun fail\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Peranti storan USB (Generik)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Cakera %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Beberapa Partisyen\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - 'Flush' penimbal\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Pembatalan\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Berjaya.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Ralat yang tidak dapat ditentukan ketika memformat.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Tidak boleh menggunakan sistem fail yang dipilih untuk media ini.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Akses kepada peranti dinafikan.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Tidak boleh menulis data ke peranti (Dilindungi)\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Peranti ini digunakan oleh proses lain. Sila tutup mana-mana program yang mungkin menggunakan peranti ini.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Format pantas tidak boleh digunakan pada peranti ini.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Label jilid tidak sah.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Pengendali peranti tidak sah.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Saiz gugusan yang dipilih tidak boleh digunakan pada peranti ini.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Saiz jilid tidak sah.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Sila masukkan media boleh alih ke dalam pemacu.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Arahan yang tidak disokong diterima.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Kesilapan peruntukkan memori.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Kesilapan membaca.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Kesilapan menulis.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Kegagalan memasang\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Media tidak boleh dibuka. Ia mungkin digunakan dalam proses yang lain. Sila cabut dan masukkan semula dan cuba sekali lagi.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Tidak boleh partition drive.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Tidak boleh meyalin fail kepada pemacu.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Dibatalkan oleh pengguna.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Proses-proses kecil tidak boleh dimulakan.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Penyemakan blok rosak tidak dapat diselesaikan.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Kegagalan imbasan imej ISO.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Pengekstrakan imej ISO gagal.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Tidak dapat melekap semula jilid.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Tidak dapat menyediakan fail-fail untuk boot.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Tidak dapat menetapkan huruf pemacu.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Tidak boleh lekap jilid GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Peranti ini tidak sedia untuk digunakan.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus mengesan bahawa Windows masih lagi menarik penimbal ke dalam peranti USB.\\n\"\n\"\\n\"\n\"Bergantung kepada kelajuan peranti USB anda, operasi ini mungkin mengambil masa yang amat lama.Terutamanya untuk fail besar.\\n\"\n\"\\n\"\n\"Kami cadangkan anda biarkan proses Windows untuk tamat dahulu supaya mengelakkan korupsi.Namun, jika anda kesuntukan masa, anda boleh cabutkan peranti anda...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Imej tidak disokong\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Imej ini sama ada tidak boleh boot, atau ia menggunakan kaedah boot atau mampatan yang tidak disokong oleh Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Gantikan %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Imej ISO ini menggunakan versi '%s' yang telah lapuk.\\n\"\n\"Oleh sebab ini, menu boot mungkin tidak dipaparkan dengan betul.\\n\"\n\"\\n\"\n\"Versi yang lebih baharu boleh dimuat turun oleh Rufus untuk memperbaiki isu ini:\\n\"\n\"- Pilih 'Ya' untuk menyambung ke internet dan muat turun fail tersebut\\n\"\n\"- Pilih 'Tidak' untuk tidak mengubahsuai fail ISO yang digunakan\\n\"\n\"Jika anda tidak pasti apa yang perlu dilakukan, pilih 'Ya'.\\n\"\n\"\\n\"\n\"Perhatian: Fail yang dimuat turun akan disimpan di dalam direktori bersamaan dengan Rufus dan apabila terdapat '%s' , ia akan digunakan secara automatik.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Sedang memuat turun %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Tiada imej yang dipilih\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"untuk %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Imej terlalu besar\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Imej ini terlalu besar untuk sasaran yang dipilih.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"ISO tidak disokong\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Apabila menggunakan jenis sasaran UEFI , hanya imej boot jenis EFI sahaja disokong. Sila pilih ISO boot jenis EFI atau tukarkan jenis sasaran kepada BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Sistem fail tidak disokong\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"PENTING: PERANTI INI MEMPUNYAI BEBERAPA PARTISYEN!!\\n\"\n\"\\n\"\n\"Ini mungkin termasuk partisyen/jilid yang tidak disenaraikan atau tidak boleh dilihat dari Windows. Jika anda mahu meneruskannya, anda bertanggungjawab ke atas kehilangan data dalam partisyen tersebut.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Beberapa partisyen dikesan\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD Imej\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Sistem fail yang sedang dipilih tidak boleh digunakan dengan jenis ISO ini. Sila pilih sistem fail berlainan atau gunakan ISO berlainan.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'Windows To Go' hanya boleh digunakan jika sistem fail adalah NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"PENTING: Anda cuba memasang 'Windows To Go', tetapi pemacu sasaran anda tidak mempunyai atribut 'FIXED'. Disebabkan ini Windows akan berkemungkinan besar sangkut sepanjang but, kerana Microsoft tidak merekanya untuk berfungsi dengan pemacu yang sebaliknya mempunyai atribut 'REMOVABLE'.\\n\"\n\"\\n\"\n\"Adakah anda masih mahu teruskan?\\n\"\n\"\\n\"\n\"Nota: Atribut 'FIXED/REMOVABLE'adalah sifat perkakasan yang hanya boleh ditukar menggunakan alatan tersuai daripada pengilang pemacu. Bagaimanapun alatan tersebut adalah HAMPIR TIDAK AKAN diberikan kepada umum...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Had sistem fail\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Imej ISO ini mengandungi fail yang lebih besar daripada 4 GB iaitu saiz maksima yang dibenarkan untuk sistem fail FAT atau FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Tiada sokongan WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Platform anda tidak boleh mengekstrak fail daripada arkib WIM. Ini diperlukan untuk mencipta cakera boot EFI Windows 7 dan Windows Vista. Anda boleh membaikinya dengan cara mendapatkan versi 7-Zip terbaharu.\\n\"\n\"Adakah anda mahu ke halaman muat turun 7-zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Muat turun %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s atau kemudian memerlukan fail '%s' di komputer anda.\\n\"\n\"Oleh sebab fail tersebut lebih besar daripada 100 KB dan sentiasa ada dalam imej %s, Ia tidak termasuk dalam Rufus.\\n\"\n\"\\n\"\n\"Rufus boleh memuat turun fail tersebut untuk anda:\\n\"\n\"- Pilih 'Ya' untuk muat turun fail tersebut\\n\"\n\"- Pilih 'Tidak' jika anda mahu menyalin fail tersebut secara manual ke cakera ini pada masa lain\\n\"\n\"\\n\"\n\"Perhatian: Fail akan dimuat turun ke direktori bersamaan Rufus dan apabila '%s' ada di sana, ia akan digunakan semula secara automatik.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Pembatalan boleh menyebabkan peranti ini TIDAK BOLEH DIGUNAKAN SEMULA.\\n\"\n\"Jika anda pasti anda mahu membatalkannya, klik Ya. Sebaliknya, klik Tidak.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Sila pilih folder\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Semua fail\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Log Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Cakera %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS tidak boleh boot daripada cakera yang menggunakan saiz gugusan 64 kilobait.\\n\"\n\"Sila tukarkan saiz gugusan atau gunakan FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Saiz gugusan tidak sesuai\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Pemformatan jilid UDF yang besar mengambil masa yang amat lama. Pada kelajuan USB 2.0, anggaran masa pemformatan adalah %d:%02d, dimana bar kemajuan akan kelihatan seperti ia tidak bergerak. Sila bersabar!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Jilid UDF besar\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Imej ini menggunakan Syslinux %s%s tetapi aplikasi ini hanya mempunyai fail pemasangan untukSyslinux %s%s.\\n\"\n\"\\n\"\n\"Oleh kerana versi-versi baharu Syslinux tidak serasi dengan satu sama lain, maka tidakwajar Rufus menyediakan semuanya, dua fail tambahan perlu dimuat turun dariInternet ('ldlinux.sys' dan 'ldlinux.bss'):\\n\"\n\"- Pilih 'Ya' untuk menyambung ke Internet dan memuat turun fail tersebut\\n\"\n\"- Pilih 'Tidak' untuk membatalkan operasi\\n\"\n\"\\n\"\n\"NOTA:Fail akan dimuat turun ke dalam direktori aplikasi ini dan akan digunakan semulasecara automatik sekiranya sedia ada.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Muat turun diperlukan\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Imej ini menggunakan Grub %s tetapi aplikasi hanya termasuk fail pemasangan untuk Grub %s.\\n\"\n\"\\n\"\n\"Sepertimana versi Grub berlainan mungkin tidak sesuai antara satu sama lain, dan ianya tidak mungkin untuk memasukkan mereka semua, Rufus akan cuba mengesan versi fail pemasangan Grub ('core.img') yang sepadan dengan salah satu daripada imej anda:\\n\"\n\"- Pilih 'Ya' untuk bersambung ke Internet dan cuba memuat turunnya\\n\"\n\"- Pilih 'Tidak' untuk menggunakan versi lalai dari Rufus\\n\"\n\"- Pilih 'Batal' untuk membatalkan operasi\\n\"\n\"\\n\"\n\"Nota: Fail akan dimuat turun dalam direktori aplikasi semasa dan akan digunakan semula secara automatik jika ada. Jika tiada padanan boleh dijumpai dalam talian, versi lalai akan digunakan.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Pemasangan Windows biasa\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"pilihan tambahan pemacu\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"pilihan format tambahan\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Tunjuk %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Sembunyi %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Saiz pemetakan berterusan (persistence partition)\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Tidak berterusan\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Mengeset saiz pemetakan berterusan (persistent partition) untuk media 'live USB'. Setkan saiz kepada 0 untuk melumpuhkan pemetakan berterusan.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Set saiz unit pemetakan.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Henti papar mesej ini\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Notis penting berkenaan %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Anda telah menghasilkan media yang menggunakan bootloader UEFI:NTFS. ANDA PERLU MEMATIKAN PILIHAN SECURE BOOT.\\n\"\n\"Untuk mengetahui dengan lebih lanjut, sila klik butang 'Maklumat Lanjut' di bawah.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Pemilihan imej Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"ISO ini mengandungi beberapa imej Windows.\\n\"\n\"Sila pilih imej yang anda ingin gunakan untuk pemasangan:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Terdapat program atau proses lain sedang mencapai pemacu ini. Adakah anda mahu memformatnya juga?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus telah mengesan bahawa anda sedang mencuba untuk mencipta media Windows To Go berasaskan imej ISO 1809.\\n\"\n\"\\n\"\n\"Memandangkan terdapat pepijat dari MICROSOFT, media ini akan menghadapi masalah (Blue Scree Of Death) semasa memulakan Windows, melainkan anda menukar fail 'WppRecorder.sys' kepada versi 1803.\\n\"\n\"\\n\"\n\"Sila ambil perhatian. Rufus tidak akan membaiki masalah ini kerana 'WppRecorder.sys' adalah hak cipta milik Microsoft dan kami tidak dapat menyertakan salinan fail berkenaan bersama-sama aplikasi ini...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Memandangkan skema pemetakan MBR telah dipilih, Rufus akan menghasilkan petak storan media dengan saiz maksimum 2 TB, di mana %s ruang cakera adalah tidak tersedia.\\n\"\n\"\\n\"\n\"Adakah anda pasti ingin meneruskan operasi?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Versi\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Keluaran\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Edisi\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Bahasa\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Kerangka\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Terus\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Undur\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Sila tunggu...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Muat turun menggunakan pelayar web\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Muat turun ISO Windows tidak tersedia kerana Microsoft telah mengubah laman web mereka untuk menghalangnya.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 atau versi lebih baru diperlukan untuk menjalankan skrip ini.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Adakah anda ingin ke dalam talian dan memuat turun?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Menjalankan skrip untuk memuat turun...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Memuat turun imej ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Jenis komputer yang anda merancang untuk menggunakan cakera \\\"bootable\\\" ini. Adalah menjadi tanggungjawab anda untuk menentukan sama ada sasaran anda adalah jenis BIOS atau UEFI sebelum anda wujudkan cakera tersebut, kerana ia mungkin gagal untuk boot.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' bermaksud peranti hanya akan boot di dalam mod emulasi BIOS (juga dikenali sebagai 'Legacy Mode') dibawah UEFI, dan bukan dalam mod asli UEFI.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'bukan CSM' bermaksud peranti hanya akan boot di dalam mod asli UEFI, dan bukan di mod emulasi BIOS (juga dikenali sebagai 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Uji corak: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Uji corak: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Uji corak: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Uji corak: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Menetapkan sistem fail sasaran\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Saiz minima satu blok data akan gunakan dalam sistem fail\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Gunakan ini untuk tetapkan label cakera.\\n\"\n\"Huruf antarabangsa boleh digunakan.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Togel pilihan lanjutan\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Semak peranti untuk blok rosak menggunakan corak ujian\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Nyahtanda kotak ini untuk menggunakan kaedah pemformatan perlahan\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Kaedah yang digunakan untuk mencipta partisyen\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Kaedah yang digunakan untuk membuat cakera boot\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Klik untuk memilih atau memuat turun imej...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Klik kotak ini untuk membenarkan paparan label antarabangsa dan menetapkan ikon cakera (akan membuat fail autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install an MBR that allows boot selection and can masquerade the BIOS USB drive ID\"\nmsgstr \"Memasang MBR yang membenarkan pilihan boot dan mampu menyamar ID BIOS USB\"\n\n#. • MSG_168\nmsgid \"\"\n\"Try to masquerade first bootable USB drive (usually 0x80) as a different disk.\\n\"\n\"This should only be necessary if you install Windows XP and have more than one disk.\"\nmsgstr \"\"\n\"Cuba menyamarkan cakera USB boot (biasanya 0x80) sebagai cakera lain.\\n\"\n\"Ini hanya diperlukan jika anda memasang Windows XP dan mempunyai lebih daripada satu cakera.\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Ciptakan partisyen tambahan tersembunyi dan cuba melaraskan sempadan partisyen.\\n\"\n\"Ini boleh mempertingkatkan pengesanan boot untuk BIOS lama.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Membolehkan penyenaraian pagaran cakera keras USB. GUNAKAN ATAS RISIKO SENDIRI!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Mulakan operasi pemformatan.\\n\"\n\"Ini akan MEMADAMKAN semua data pada sasaran!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Tandatangan digital muat turun tidak sah\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Klik untuk memilih...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Utiliti pemformatan USB yang dipercayai\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Versi %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"\"\n\"Terjemahan Bahasa Malaysia:\\\\line\\n\"\n\"• Muhammad Aman <mailto:aman.tifli@gmail.com>\\\\line\\n\"\n\"• VGPlayer <mailto:razman90a@yahoo.com.my>\\\\line\\n\"\n\"• Mohamad Ikhwan bin Kori <mailto:ikhwankori@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Laporkan masalah atau cadangan penambahbaikan di:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Hak cipta tambahan:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Polisi kemaskini:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Jika anda pilih untuk membenarkan perisian ini menyemak untuk aplikasi versi baharu, anda bersetuju untuk membenarkan pelayan kami mengumpulkan maklumat berikut:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Versi dan kerangka sistem operasi\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Versi aplikasi yang anda gunakan\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Alamat IP anda\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Untuk tujuan menjana statistik penggunaan peribadi , kami mungkin menyimpan maklumat yang dikumpulkan, \\\\b untuk sekurang-kurangnya setahun\\\\b0 . Namun, kami tidak rela untuk mendedahkan maklumat ini kepada mana-mana pihak ketiga.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Proses mengemas kini:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus tidak memasang atau menjalankan servis di latar belakang. Oleh itu, semakan kemas kini hanya dijalankan apabila aplikasi utama berjalan.\\\\line\\n\"\n\"Akses internet diperlukan untuk menyemak untuk versi baru.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Imej tidak sah untuk pilihan boot yang dipilih\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Imej\\ttidak serasi dengan pilihan boot yang dipilih. Sila gunakan imej lain atau pilih pilihan boot lain.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Imej ISO ini tidak serasi dengan sistem fail yang dipilih\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Pemacu tidak serasi dikesan\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Melepasi tulisan\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Melepasi bacaan\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Muat turun %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Tidak boleh muat turun %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Menggunakan %s fail versi dibenam\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"PENTING: PEMACU INI MENGGUNAKAN SAIZ SEKTOR BUKAN PIAWAIAN!\\n\"\n\"\\n\"\n\"Pemacu konvensional mengunakan saiz sektor 512 bait tetapi pemacu ini menggunakan %d bait. Dalam banyak kes, ini bermaksud anda TIDAK akan mampu untuk but dari pemacu ini.\\n\"\n\"Rufus boleh cuba untuk mencipta pemacu boleh but, tetapi TIDAK ADA JAMINAN ianya akan berfungsi.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Saiz sektor bukan standard dikesan\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' hanya boleh dipasang dalam pemacu berpartisyen GPT jika ia mempunyai set atribut 'FIXED'. Pemacu semasa tidak dikesan sebagai 'FIXED'.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Ciri ini tidak tersedia di platform ini.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Sedang membatalkan - Sila tunggu...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Mengimbas imej...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Imbasan imej gagal\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"%s lapuk dikesan\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Menggunakan imej: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Tidak menjumpai fail %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Jilid baharu\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d peranti dijumpai\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d peranti dijumpai\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"SEDIA\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"DIBATALKAN\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"GAGAL\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Melancarkan aplikasi baru...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Gagal untuk melancarkan aplikasi baru\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"%s dibuka\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"%s disimpan\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Pemformatan: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Mencipta sistem fail: Tugas %d/%d selesai\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Pembaikian NTFS: %d%% selesai\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Pemformatan (%s) - Jangka masa anggaran %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Menetapkan Label (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Pemformatan (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Pembaikian NTFS (Periksa cakera)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Memadam struktur MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Meminta akses cakera...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Menganalisis rekod boot sedia ada...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Menutup jilid sedia ada...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Menulis \\\"Rekod master boot\\\"...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Menulis \\\"Rekod boot partisyen\\\"...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Menyalin fail DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Menyalin fail ISO: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Persediaan boot EFI Win7 (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Menyiapkan, sila tunggu...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Memasang Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Blok rosak: %s %d/%d - %0.2f%% (%d/%d/%d kesilapan)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Blok rosak: menguji dengan corak rawak\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Blok rosak: Menguji dengan corak 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Mempartisyenkan (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Memadam partisyen (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Tandatangan untuk pengemaskinian telah dimuat turun tidak dapat disahkan. Ini boleh bermakna bahawa sistem anda dikonfigurasi dengan salah untuk pengesahan tandatangan atau menunjukkan fail yang dimuat turun berisi dengan virus\\n\"\n\"\\n\"\n\"Fail yang dimuat turun akan dihapuskan. Sila periksa log untuk maklumat lanjut.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Memuat turun: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Gagal memuat turun fail.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Memeriksa untuk kemas kini Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Kemas kini: Tidak dapat menyambung ke internet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Kemas kini: Tidak dapat mengakses data versi\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Versi baru Rufus boleh didapati!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Tiada versi baru Rufus didapati\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Kekunci daftar aplikasi berjaya dipadam\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Gagal memadam kekunci daftar aplikasi\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s dibolehkan\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s tidak dibolehkan\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Menyemak saiz\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Pengesanan cakera keras\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Memaksa pemformatan FAT32 besar\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun akan dipadam apabila keluar\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Pengesanan cakera palsu\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Sokongan Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Sokongan Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Paksa kemas kini\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"Mampatan NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Menulis imej: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Sokongan ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Guna saiz seunit yang BETUL\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Memadam direktori '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Pengesanan cakera VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Mod dwi UEFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Menggunakan imej Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Menggunakan imej Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Mengekalkan cap masa\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Nyahpijat USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Mengira semak tambah imej: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Mengira semak tambah MD5, SHA1 dan SHA256 imej dipilih\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Menukar bahasa aplikasi\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s imej dikesan\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Imej yang anda telah pilih adalah imej 'ISOHybrid'. Ini bermaksud ia boleh ditulis sama ada dalam %s mod (salinan fail) atau %s mod (imej cakera).\\n\"\n\"Rufus galakkan menggunakan mod %s, jadi anda selalu mempunyai akses penuh ke pemacu selepas menulisnya.\\n\"\n\"Bagaimanapun, jika anda menghadapi isu-isu semasa boot, anda boleh cuba menulis imej ini lagi dalam mod %s.\\n\"\n\"\\n\"\n\"Sila pilih mod yang anda mahu guna untuk menulis imej ini:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Menulis dalam mod %s (Digalakkan)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Menulis dalam mod %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Menyemak proses yang berkonflik.\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Tidak boleh boot\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Cakera atau imej ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Sila pilih)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Penguncian pemacu USB eksklusif\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Tandatangan tidak sah\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"'Executable' yang dimuat turun kehilangan tandatangan digital.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"'Executable' yang dimuat turun ditandatangani oleh '%s'.\\n\"\n\"Ini bukannya tandatangan yang kami kenal dan boleh menunjukkan beberapa bentuk aktiviti berniat jahat...\\n\"\n\"Adakah anda pasti anda mahu menjalankan fail ini?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Mensifarkan pemacu: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Mengesan cakera bukan USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Hilang hak kebenaran istimewa\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Aplikasi ini hanya boleh digunakan apabila diberikan hak kebenaran istimewa\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Pengindeksan Fail\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Pemilihan versi\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Sila pilih versi Windows yang anda ingin memasang:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Versi Windows tidak disokong\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Versi Windows ini tidak lagi disokong oleh Rufus.\\n\"\n\"Versi terakhir Rufus yang serasi dengan platform ini ialah v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Amaran: versi bukan rasmi\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Versi Rufus ini bukan dibuat oleh pemaju-pemaju rasmi Rufus. \\n\"\n\"\\n\"\n\"Adakan anda yakin ingin menggunakannya?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"ISO yang dipenggal dikesan\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Saiz fail ISO yang anda pilih adalah tidak sama dengan saiz yang diisytiharkan oleh fail ISO ini. %s data telah hilang!\\n\"\n\"\\n\"\n\"Jika fail ini diperolehi dari intenet, anda sepatutnya muat turun semula fail ini dan sahkan bahawa tandatangan MD5 atau SHA adalah sama dengan versi yang rasmi.\\n\"\n\"\\n\"\n\"Anda boleh dapatkan MD5 atau SHA fail yang dipilih ini dengan menekan butang (✓). Kemudian anda perlu membandingkan dengan MD5 atau SHA daripada fail yang rasmi.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Ralat validasi cap waktu\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus tidak dapat mengesahkan bahawa kemas kini yang dimuat turun adalah lebih baru daripada aplikasi yang dijalankan sekarang.\\n\"\n\"\\n\"\n\"Untuk mengelakkan daripada senario dimana PC diserang dengan virus, proses kemaskini telah dibatalkan dan fail yang telah dimuat turun akan dipadam. Sila semak log untuk maklumat lanjut.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Tunjuk tetapan aplikasi\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Paparkan maklumat tentang aplikasi ini\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Paparkan log\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Cipta imej cakera untuk peranti yang dipilih\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Pilih pilihan ini jika anda mahu memasang Windows pada komputer lain atau ingin menggunakan Windows terus daripada cakera/media ini (Windows To Go)\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Mensifarkan pemacu 'Fast': %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"ini mungkin mengambil sedikit masa\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Pengesanan VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Arkib termampat\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"ISO yang anda pilih menggunakan UEFI dan cukup kecil untuk ditulis sebagai Partition Sistem EFI (ESP). Menulis kepada ESP, bukannya menulis kepada partition data generik yang menduduki keseluruhan cakera, boleh menjadi lebih baik untuk beberapa jenis pemasangan.\\n\"\n\"\\n\"\n\"Sila pilih mod yang anda mahu gunakan untuk menulis imej ini:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Gunakan %s (dalam tetingkap aplikasi utama) untuk mendayakan.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Cincangan tambahan (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Simpan ke VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Pengiraan semakan imej\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Pelbagai butang\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Bilangan pas\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID Cakera\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Keutamaan benang lalai: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Abaikan penanda but\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Tataletak partition yang menyegarkan (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Imej yang anda pilih ialah ISOHybrid, tetapi penciptanya tidak menjadikannya serasi dengan mod salinan ISO/Fail.\\n\"\n\"Akibatnya, mod penulisan imej DD akan dikuatkuasakan.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Tidak dapat membuka atau membaca '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Menggunakan penyesuaian Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Menggunakan pilihan pengguna...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Pengalaman Pengguna Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Sesuaikan pemasangan Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Alih keluar keperluan untuk 4GB+ RAM, But Selamat dan TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Alih keluar keperluan untuk akaun Microsoft dalam talian\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Nyahdayakan pengumpulan data (Langkau soalan privasi)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Halang Windows To Go daripada mengakses cakera dalaman\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Buat akaun tempatan dengan nama pengguna:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Mengesetkan opsyen rantau kepada nilai yang sama seperti pengguna ini\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Lumpuhkan penyulitan peranti automatik BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Log berterusan\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus adalah utiliti yang membantu memformat dan mencipta pemacu kilat USB boot, seperti pemacu pen/kekunci USB, kayu memori, dan lain-lain.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Laman rasmi: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Kod Sumber: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Permohonan ini dilesenkan di bawah syarat-syarat Lesen Awam GNU (GPL) versi 3.\\n\"\n\"Lihat https://www.gnu.org/licenses/gpl-3.0.html untuk butiran.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatkan USB, kad flash dan pemacu maya kepada FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Buat pemacu USB boleh boot FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Buat pemacu boleh boot daripada ISO boleh boot (Windows, Linux, dll.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Buat pemacu boleh boot daripada imej cakera boleh boot, termasuk yang dimampatkan\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Buat pemacu boleh boot BIOS atau UEFI, termasuk NTFS boleh boot UEFI\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Buat pemacu 'Windows To Go'\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Buat pemacu pemasangan Windows 11 untuk PC yang tidak mempunyai TPM atau But Selamat\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Buat partition Linux berterusan\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Buat imej VHD/DD bagi pemacu yang dipilih\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Kira MD5, SHA-1, SHA-256 dan SHA-512 checksum imej yang dipilih\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Melakukan pemeriksaan blok buruk, termasuk pengesanan pemacu kilat \\\"palsu\\\"\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Muat turun rasmi ISO runcit Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Muat turun ISO Shell UEFI\"\n"
  },
  {
    "path": "res/loc/po/nb-NO.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-09 19:38+0100\\n\"\n\"PO-Revision-Date: 2024-05-09 19:44+0100\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: nb_NO\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Norwegian (Norsk)\\n\"\n\"X-Rufus-LCID: 0x0414\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Stasjons rettigheter\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Enhet\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Oppstartstype\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Velg\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Bildevalg\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Partisjonskjema\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Målsystem\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Før opp USB harddisker\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Legger til fiks for gamle BIOSer (ekstra partisjon, etc.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Aktiver runtime UEFI-medievalidering\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Format-valg\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Filsystem\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Cluster-størrelse\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Volumnavn\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Hurtigformatering\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Sjekk enhet for dårlige blokker\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Lager utvidet merke og ikon-filer\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Lukk\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Om Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Lisens\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus Lisens\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Mer informasjon\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Ja\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Nei\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Logg\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Slett\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Lagre\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Oppdateringspolitikk og innstillinger\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Innstillinger\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Se etter oppdateringer\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Inkluder betaversjoner\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Sjekk nå\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Sjekker for oppdateringer - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"En ny versjon er tilgjengelig. Vennligst last ned den nyeste versjonen!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Klikk her for å gå til nettsiden\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Utgivelsesnotater\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Last ned\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Annen forekomst oppdaget\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Annen Rufus-utgave kjører.\\n\"\n\"Vennligst lukk den første utgaven, før du åpner en ny.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"ADVARSEL: ALLE DATA PÅ STASJONEN '%s' VIL BLI OVERSKREVET.\\n\"\n\"For å fortsette denne operasjonen, klikk OK. For å avslutte klikk Avbryt.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus oppdateringspolitikk\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Vil du tillate at Rufus ser etter oppdateringer online?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Avbryt\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Dårlige blokker funnet\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Sjekk fullført: %d dårlig(e) blokke(r) funnet\\n\"\n\"  %d Lese feil\\n\"\n\"  %d Skrivefeil\\n\"\n\"  %d Korrupte feil\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"A Mer detaljert rapport kan finnes her:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Deaktivert\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Daglig\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Ukentlig\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Månedlig\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Bruker\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Din versjon: %d.%d (Utgave %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Siste versjon: %d.%d (Utgave %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobyte\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabyte\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Standard\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Standard)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (eller UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (ikke CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS eller UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d Passering\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d Passeringer %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO-bilde\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Applikasjon\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Avbryt\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Kjør\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operasjon avbrutt av bruker\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Feil\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Feil: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Fil-nedlasting\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB-lagringsenhet (Generisk)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Flere partisjoner\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Tømmer buffere\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Avbryter\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Suksess.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Ubestemmelig feil under formateringen.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Kan ikke bruke det valgte filsystem for dette mediet.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Ikke tilgang til denne enheten.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Mediet er skrivebeskyttet.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Enheten brukes av en annen prosess. Vennligst lukk den andre prosessen som muligens bruker denne enheten.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Hurtigformatering er ikke tilgjengelig for denne enheten.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Volumnavnet er ugyldig.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Enhetshåndteringen er ugyldig.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Den valgte cluster-størrelsen er ikke gyldig for denne enheten.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Volumstørrelsen er ugyldig.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Vennligst sett inn et media i stasjonen.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Ustøttet kommando mottatt.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Minnetildelingsfeil.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Lesefeil.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Skrivefeil.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Installasjonsfeil\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Kunne ikke åpne media. Er muligens i bruk av en annen prosess. Vennligst koble fra, og prøv å koble til på nytt.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Kunne ikke partisjonere disken.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Kunne ikke kopiere filer til målstasjonen.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Brukeravbrutt.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Ikke mulig å starte tråd.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Dårlig blokk-kontroll ikke fullført.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"ISO-bilde skanningsfeil.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"ISO-bilde utpakkingsfeil.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Ikke mulig å igjen-innkoble volum.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Ute av stand til å reparere filer for boot.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Ikke mulig å tildele en stasjonsbokstav.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Kan ikke montere GUID stasjon.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Denne enheten er ikke klar.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus oppdaget at Windows fortsatt skriver til denne USB-enhetens interne buffer.\\n\"\n\"\\n\"\n\"Avhengig av hastigheten på din USB-enhet, vil muligens denne operasjonen ta lang til å fullføre, spesielt for store filer.\\n\"\n\"\\n\"\n\"Vi anbefaler at du lar Windows fullføre, slik at feil unngås. Men blir du lei av og vente..., kan du koble fra enheten...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Ikke støttet bildefil\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Dette ISO-bildet er enten ikke oppstartbar, eller så bruker den en oppstart eller pakkemetode som ikke er støttet av Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Bytte ut %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Dette ISO-bildet ser ut til å inneholde en foreldet versjon av '%s'.\\n\"\n\"Boot-menyene vil muligens bli vist feil p.g.a. dette.\\n\"\n\"\\n\"\n\"En nyere versjon kan lastes ned fra Rufus for å fikse dette problemet:\\n\"\n\"- Velg 'Ja' for å koble til internett og laste ned filen\\n\"\n\"- Velg 'Nei' for å bruke den eksisterende ISO-filen\\n\"\n\"Hvis du ikke vet hva du skal gjøre, bør du velge 'Ja'.\\n\"\n\"\\n\"\n\"OBS: Den nye filen vil bli lastet ned i den gjeldende mappen, og når'%s' er der, vil den bli brukt automatisk.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Laster ned %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Intet bilde valgt\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"til %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Bildet er for stort\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Bildet er for stort for det valgte målet.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Ikke støttet ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Når UEFI måltype blir brukt, er kun EFI oppstartbar ISO-bilde støttet. Vennligst velg en EFI oppstartbar ISO-fil eller sett måltype i BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Ikke støttet filsystem\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"VIKTIGT: DENNE STASJONEN INNEHOLDER FLERE PARTISJONER!!\\n\"\n\"\\n\"\n\"Denne inneholder kanskje partisjoner/volumer som ikke er listet, og muligens ikke er synlig i Windows. Hvis du ønsker å fortsette, er du selv ansvarlig for evt. tapte data på disse partisjonene.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Flere partisjoner oppdaget\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD-bilde\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Filsystemet som er valgt kan ikke brukes med denne type ISOVennligst velg ett annet filsystem, eller bruk en annen ISO.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' kan kun brukes hvis filsystemet er NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"VIKTIGT: Du prøver å installere 'Windows To Go', med målstasjonen ikke harden rette beskrivelsen. P.g.a dette vil Windows sannsynligvis stoppe opp under oppstarten, da Microsoft ikke har designet den til å virke med stasjoner som er 'FLYTTBAR'. \\n\"\n\"\\n\"\n\"Ønsker du å fortsette?\\n\"\n\"\\n\"\n\"OBS:'FAST/FLYTTBAR' er et hardware-valg som kun kan endres ved å bruke spesialutstyr fra stasjonsprodusenten. Uansett er dette verktøyet NESTEN ALDRI tilgjengelig for publikum...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Filsystem begrensning\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Dette ISO-bildet inneholder filer større enn 4 GB, som er mer enn den maksimalt tillate størrelsen for FAT eller FAT32 fil-systemet.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Mangler WIM-støtte\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Din plattform kan ikke pakke ut filer fra WIM-arkiver. WIM-utpakking er påkrevd for å lage EFI oppstartbar Windows 7 og Windows Vista USB-stasjoner. Du kan fikse det ved å installere siste versjon av 7-Zip.\\n\"\n\"Vil du besøke 7-zip nedlastingssiden?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Lastet ned %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s eller senere er påkrevd for at '%s' filen kan bli innstallert.\\n\"\n\"P.g.a. filen er mer enn 100 KB i størrelse, og er alltid tilstede i %s ISO-bilder, og den ikke er innebygd i Rufus.\\n\"\n\"\\n\"\n\"Rufus kan laste den den manglende filen for deg:\\n\"\n\"- Velg 'Ja' for å koble til internett og laste ned filen\\n\"\n\"- Velg 'Nei' hvis du vil kopiere denne filen manuelt til stasjonen senere\\n\"\n\"\\n\"\n\"OBS: Denne filen vil bli lastet ned i den aktuelle mappen og straks den '%s' er der, vil den bli brukt automatisk.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Å avbryte, vil enheten være i en USTABIL tilstand.\\n\"\n\"Hvis du er sikker på at du vil avbryte, klikk JA. Ellers klikk NEI.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Vennligst velg en mappe\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Alle filer\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus logg\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS kan ikke boote fra en stasjon som brukeren 64 kilobytes Cluster størrelse.\\n\"\n\"Vennligst bytt Cluster-størrelse eller bruk FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Inkompatibelt Cluster-størrelse\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Formatere et stort UDF-volum kan ta lang tid. Ved å bruke USB 2.0 hastighet, den estimerte formateringstiden er %d:%02d, under denne tiden vil framgangslinjen virke frossen. Vennligst vær tålmodig!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Stort UDF-volum\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Dette bildet bruker Syslinux %s%s men dette programmet inkluderer kun installsjonsfiler for Syslinux %s%s.\\n\"\n\"\\n\"\n\"Nye versjoner av Syslinux er ikke kompatible med hverandre, og dermed ikke mulig for Rufus å inkludere alle, 2 ekstra filer må lastes ned fra Internett ('ldlinux.sys' og 'ldlinux.bss'):\\n\"\n\"- Velg 'Ja' For å koble til internett og laste ned disse filene\\n\"\n\"- Velg 'Nei' for å avbryte\\n\"\n\"\\n\"\n\"OBS: Filene vil bli lastet ned i det aktuelle programmets mappe og vil bli brukt automatisk hvis de er tilstede.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Nedlasting påkrevd\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Dette bildet bruker Grub %s, men programmet inkluderer kun installasjonsfiler forGrub %s.\\n\"\n\"\\n\"\n\"Forskjellige versjoner av Grub er muligens ikke kompatible med hverandre, og er ikke mulig å inkludere dem alle, Rufus vil prøve å finne en versjon av Grub installasjonfilen ('core.img') som passer til ditt bilde:\\n\"\n\"- Velg 'Ja' for å koble til internett og forsøke å laste den ned\\n\"\n\"- Velg 'Nei' for å bruke den innebygde versjonen uansett\\n\"\n\"- Velg 'Avbryt' for å avbryte\\n\"\n\"\\n\"\n\"OBS: Filen vil bli lastet ned i den aktuelle program-mappen og vil bli brukt automatisk hvis tilgjengelig. Hvis ingen treff kan bli funnet, den innebygde versjonen vil bli brukt.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Standard Windows installasjon\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"avanserte stasjonsegenskaper\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"avanserte formatalternativer\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Vis %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Skjul %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Vedvarende partisjon størrelse\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Ingen varighet\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Still størrelsen på den vedvarende partisjonen for live USB media. Angir størrelsen til 0 deaktiverer den vedvarende partisjonen.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Sett partisjonens størrelse enheter.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Ikke vis denne beskjeden igjen\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Viktig varsel om %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Du har nettopp opprettet et medie som bruker UEFI: NTFS bootloader. Husk at, for å starte dette mediet, må du deaktivere SECURE BOOT.\\n\"\n\"For detaljer om hvorfor dette er nødvendig, se \\\"Mer informasjon\\\" knappen nedenfor.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows image-valg\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Denne ISO inneholder flere Windows-imager.\\n\"\n\"Vennligst velg image du vil bruke til denne installasjonen:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Et annet program eller en prosess holder tilgang til denne disken. Vil du formatere det uansett?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus har oppdaget at du forsøker å lage et Windows To Go-medie basert på en 1809 ISO.\\n\"\n\"\\n\"\n\"På grunn av en *MICROSOFT BUG*, vil dette mediet krasje under Windows boot (Blue Screen Of Death), med mindre du manuelt erstatter filen 'WppRecorder.sys' med en 1803-versjon.\\n\"\n\"\\n\"\n\"Vær også oppmerksom på at grunnen til at Rufus ikke automatisk kan fikse dette for deg, er at 'WppRecorder.sys' er en opphavsrettslig beskyttet fil fra Microsoft, slik at vi ikke lovlig kan legge inn en kopi av filen i programmet...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Fordi MBR er valgt for partisjonsskjemaet, kan Rufus bare opprette en partisjon på opptil 2 TB på dette mediet, noe som vil føre til at %s diskplass ikke er tilgjengelig.\\n\"\n\"\\n\"\n\"Er du sikker på at du vil fortsette?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Versjon\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Utgivelse\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Utgave\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Språk\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Arkitektur\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Fortsett\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Tilbake\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Vennligst vent...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Last ned ved hjelp av en nettleser\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Nedlasting av Windows ISO fra Microsoft er ikke tilgjengelig. Microsoft har endret websiden for å forhindre nedlastinger på denne måten.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 eller nyere kreves for å kjøre dette skriptet.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Ønsker du å gå online og laste den ned?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Kjører nedlastingskript...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Last ned ISO-image\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Datamaskin typen du planlegger å bruke denne oppstartbare stasjonen med. Det er ditt ansvar å avgjøre om målet ditt er av BIOS eller UEFI-typen før du begynner å lage stasjonen, da det kan mislykkes å starte opp ellers.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' betyr at enheten bare starter opp i BIOS-emuleringsmodus (også kjent som 'Legacy Mode') under UEFI, og ikke i innebygde UEFI-modus.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'ikke-CSM' betyr at enheten bare starter opp i innebygde UEFI-modus, og ikke i BIOS-emuleringsmodus (også kjent som 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Testmønster: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Testmønster: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testmønster: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testmønster: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Setter målfilsystemet\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Minimum størrelse en datablokk vil okkupere i filsystemet\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Bruk dette feltet for å lage disketikett.\\n\"\n\"Internasjonale bokstaver er tillatt.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Avanserte valg\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Velg antall passeringer for å teste etter dårlige blokker, bruker forskjellige mønstre\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Bruk \\\"langsom\\\" formateringsmetode ved å fjerne haken i denne ruten\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metoden som vil bli brukt for å lage partisjonene\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Metoden som vil bli brukt for å gjøre stasjonen oppstartbar\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Klikk for å velge et bilde...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Merk denne boksen for å tillate visning av internasjonal merkelapp og lage et stasjonsikon (lager en autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Installer en UEFI bootloader, som vil utføre MD5Sum-filvalidering av media\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Opprett en ekstra skjult partisjon og forsøk å justere partisjonsgrenser.\\n\"\n\"Dette kan gjøre det lettere å oppdage for eldre BIOSer.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Aktivere listen av USB-harddisk-kabinetter. BRUKES PÅ EGEN RISIKO!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Starter formateringsoperasjonen.\\n\"\n\"Dette vil SLETTE data på målstasjonen!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Ugyldig nedlastings signatur\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Klikk for å velge...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Det pålitelige USB-formateringsprogrammet\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Versjon %d.%d (Utgave %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Norsk oversettelse:\\\\line• JED <mailto:translator744@outlook.com>\\\\line• Thorbjørn Bruarøy <mailto:problemkontroll@gmail.com>\\\\line• Jakub Zieciak\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Rapporter feil, og forespør forbedringer på:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Tilleggs Copyright:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Oppdateringspolitikk:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Hvis du ønsker å tillate at programmet skal sjekke for oppdateringer, du tillater da følgende informasjon å bli samlet inn til vår server(e):\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Ditt operativsystems arkitektur og versjon\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Versjon av programmet du bruker\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Din IP-adresse\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"For muligheten å lage privat bruksstatistikk, vil vi lagre informasjonen for senere bruk, \\\\b for det meste opp mot ett år\\\\b0 . Men vi vil ikke frivillig avsløre noen av personens data til tredjepart.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Oppdateringsprosess:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus vil ikke installere eller kjøre bakgrunnsprogrammer, derfor vil oppdateringskontrollen kun bli utført når hovedprogrammet kjører.\\\\line\\n\"\n\"Internett-tilgang er selvfølgelig påkrevd for å se etter oppdateringer.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Ugyldig bilde for valgt oppstartsløsning\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Det nåværende bilde passer ikke det valgte oppstartsvalget. Vennligst velg et annet bilde, eller velg et annet oppstartsvalg.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Dette ISO-bildet er ikke kompatibelt med det valgte filsystemet\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Ikke kompatibel stasjon oppdaget\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Skriving\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Lesing\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Lastet ned %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Kunne ikke laste ned %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Bruker innebygget versjon av %s fil(er)\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"VIKTIGT: DENNE STASJONEN BRUKER IKKE STANDARD SEKTORSTØRRELSE!!\\n\"\n\"\\n\"\n\"Konvensjonelle stasjoner bruker en 512-byte sektorstørrelse, mens denne stasjonen bruker en %d-byte. I mange tilfeller betyr dette at du IKKE vil kunne starte fra denne stasjonen.\\n\"\n\"Rufus kan fortsatt prøve å lage en oppstartbar stasjon, men det er INGEN GARANTI for at det vil fungere.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Ikke standard sektorstørrelse oppdaget\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' kan kun installeres på en GPT-partisjonert stasjon hvis den er FAST stasjonstype. Den aktuelle stasjonen ble ikke oppdaget som FAST.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Denne funksjonen er ikke tilgjengelig på denne plattformen.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Avbryter - Vennligst vent...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Skanner bilde...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Feilet i bildesøk\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Foreldet %s oppdaget\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Bruker bilde: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Mangler filen %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Nytt volum\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d enhet funnet\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d enhet funnet\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"KLAR\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Avbrutt\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Feilet\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Starter et nytt program...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Oppstart feilet\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Åpnet %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Lagret %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formatering: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Lager filsystem: Oppgave %d/%d fullført\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS opprettet: %d%% fullført\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formaterer (%s) - estimeret varighet %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Lager merkelapp (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formaterer (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS-retting (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Fjerner MBR/PBR/GPT-strukturer...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Ber om stasjonstilgang...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analyserer oppstartsarkiver...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Lukker eksisterende volum...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Skriver til Master Boot Record...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Skriver til Partition Boot Record...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopierer DOS-filer...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopierer ISO-filer: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI oppstartsoppsett (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Ferdiggjør, vennligst vent...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Installerer Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Dårlige blokker: %s %d/%d - %0.2f%% (%d/%d/%d feil)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Dårlige blokker: Tester tilfeldig mønster\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Dårlige blokker: Tester med mønster 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Partisjonerer (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Sletter partisjoner (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Signaturen for den nedlastede oppdateringen kan ikke valideres. Dette kan bety at systemet ditt er feil konfigurert for godkjenning av signatur eller angi en ondsinnet nedlasting.\\n\"\n\"\\n\"\n\"Nedlastingen vil bli slettet. Vennligst sjekk loggen for mer informasjon.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Laster ned: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Nedlasting av fil feilet.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Sjekker for Rufus-oppdateringer...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Oppdateringer: Ikke mulig å koble til internett\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Oppdateringer: Ikke mulig å sjekke versjonsdata\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"En ny versjon av Rufus er tilgjengelig!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Ingen ny versjon av Rufus er funnet\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Programmets registernøkler er slettet\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Sletting av registernøkler feilet\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s aktivert\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s deaktivert\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Størrelse kontrollert\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Harddisk-oppdagelse\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Tvinger stor FAT32-formatering\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun vil bli oppdaget ved avsluttning\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Falsk stasjon oppdaget\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet-støtte\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge-støtte\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Tvungen oppdatering\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS-pakking\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Skriver bilde: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO-støtte\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Bruk SKIKKELIG størrelsesenhet\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Sletter mappe '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare-disk oppdagelse\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Dobbel UEFI/BIOS-innstilling\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Legger til Windows-bilde: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Legger til Windows-bilde...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Bevarer tidskode\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB-avkoding\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Regner ut bilde-sjekksummer: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Regner ut MD5, SHA1 og SHA256-sjekksummer for det valgte bilde\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Bytt programspråk\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s-bilde oppdaget\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Bildet du har valgt er et 'ISOHybrid'-bilde. Dette betyr det enten kan bli skrevet i %s (filkopi) -modus eller %s (bildefil) -modus.\\n\"\n\"Rufus anbefaler å bruke %s -modus, slik at du har full tilgang til stasjonen etter at du har skrevet til den.\\n\"\n\"Hvis du skulle få problemer under oppstart, kan du prøve å skrive bildet igjen i %s -modus.\\n\"\n\"\\n\"\n\"Vennligst velg modus du ønsker å skrive dette bildet i:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Skriv i %s -modus (anbefalt)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Skriv i %s -modus\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Sjekker for motstridende prosesser...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Ikke oppstartbar\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disk eller ISO bilde\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Vennligst velg)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Utelat USB stasjonslås\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Ugyldig signatur\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Den nedlastede programfil mangler en digital signatur.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Den nedlastede programfil er signert av '%s'.\\n\"\n\"Dette er en signatur vi ikke gjenkjenner, og kan indikere en form for skadelig aktivitet...\\n\"\n\"Er du sikker på at du vil kjøre denne filen?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Skriver 0-er til disken: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Oppdagelse av ikke-USB flyttbare disker\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Mangler utvidede rettigheter\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Dette programmet kan bare kjøre med utvidede rettigheter\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Filindeksering\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Versjonsvalg\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Vennligst velg den versjonen av Windows du ønsker å installere:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Ikke støttet Windows-versjon\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Denne versjonen av Windows er ikke støttet av Rufus lengre.\\n\"\n\"Den siste versjonen av Rufus som er kompatibel med denne plattformen er v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Advarsel: Uoffisiell versjon\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Denne versjonen av Rufus er IKKE laget av dens offisielle utvikler(e).\\n\"\n\"\\n\"\n\"Er du sikker på at du vil kjøre programmet?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Forkortet ISO oppdaget\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"ISO-filen du har valgt, stemmer ikke overens med den deklarerte størrelsen: %s av dataene mangler!\\n\"\n\"\\n\"\n\"Hvis du har lastet ned denne filen fra internett, bør du prøve å laste ned en ny kopi, og verifisere at MD5- eller SHA-kontrollsummen samsvarer med de offisielle.\\n\"\n\"\\n\"\n\"Legg merke til at du kan beregne MD5 eller SHA i Rufus ved å klikke på (✓)-knappen.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Tidspunkt bekreftelses feil\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus kunne ikke bekrefte at tidspunktet av den nedlastede oppdateringen er nyere enn den nåværende startede.\\n\"\n\"\\n\"\n\"For å forhindre potensielle angrepsscenarier, har oppdateringsprosessen blitt avbrutt og nedlastingen vil bli slettet. Vennligst sjekk loggen for mer informasjon.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Vis programinnstillinger\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Vis informasjon om denne applikasjonen\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Vis loggen\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Opprett et diskbilde av den valgte enheten\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Bruk dette alternativet for å angi om du vil bruke denne enheten til å installere Windows på en annen disk, eller hvis du vil kjøre Windows direkte fra denne stasjonen (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Hurtig nullstilling av disken: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"dette kan ta litt tid\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD deteksjon\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Komprimert arkiv\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"ISO du har valgt bruker UEFI og er liten nok til å bli skrevet som en EFI System Partition (ESP). Å skrive til en ESP, i stedet for å skrive til en generisk datapartisjon som okkuperer hele disken, kan være å foretrekke for noen typer installasjoner.\\n\"\n\"\\n\"\n\"Vennligst velg modusen du vil bruke til å skrive dette bildet:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Bruk %s i hoved applikasjonsvinduet til å slå på.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Ekstra hashes (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Lagre til VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Beregn bildetskontrollsummen\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Flere knapper\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Antall pasninger\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Standard trådprioritet: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignorer oppstartsmarkør\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Forfriskende partisjonsoppsett (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Bildet du har valgt er en ISOHybrid, men skaperne har ikke gjort det kompatibelt med ISO / File copy modus.\\n\"\n\"Som et resultat vil DD-skrivemodus bli håndhevet.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Kan ikke åpne eller lese '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Utfører tilpasning av Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Aktiverer brukertilpasninger...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows brukeropplevelse\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Tilpasse Windows installasjonen?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Fjern krav om 4GB+ RAM, Secure Boot og TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Fjern krav om en Microsoft konto\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Slå av all datainnsamling (hopp over spørsmålene)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Ikke gi Windows To Go tilgang til interne harddisker\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Lag en lokal brukerkonto med brukernavnet:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Sett regionale innstillinger til det samme som den aktive brukerkontoen\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Deaktiver BitLocker kryptering av enheten\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Behold log\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"En ekstra fil ('diskcopy.dll') må lastes ned fra Microsoft for å installere MS-DOS:\\n\"\n\"- Velg \\\"Ja\\\" for å koble til Internett og laste den ned\\n\"\n\"- Velg 'Nei' for å avbryte operasjonen\\n\"\n\"\\n\"\n\"Merk: Filen vil bli lastet ned i programmets katalog og vil automatisk bli gjenbrukt hvis den er tilstede.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Opphevet UEFI bootloader oppdaget\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus oppdaget at ISO-en du har valgt inneholder en UEFI-oppstartslaster som har blitt tilbakekalt og som vil produsere %s, når sikker oppstart er aktivert på et fullstendig oppdatert UEFI-system.\\n\"\n\"\\n\"\n\"- Hvis du har fått dette ISO-bildet fra en ikke-anerkjent kilde, bør du vurdere muligheten for at det kan inneholde UEFI-malware og unngå å starte opp fra det.\\n\"\n\"- Hvis du har fått det fra en pålitelig kilde, bør du prøve å finne en mer oppdatert versjon, som ikke vil gi denne advarselen.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"en \\\"Sikkerhetsbrudd\\\"-skjerm\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"en Windows-gjenopprettingsskjerm (BSOD) med '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Komprimert VHDX-imaget\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Ukomprimert VHD-imaget\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Full Flash Update Image\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Noen tilleggsdata må lastes ned fra Microsoft for å bruke denne funksjonaliteten:\\n\"\n\"- Velg \\\"Ja\\\" for å koble til Internett og laste den ned\\n\"\n\"- Velg 'Nei' for å avbryte operasjonen\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Begrens Windows til S-modus (INKOMPATIBEL med online kontoomgåelse)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Ekspert modus\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Pakker ut arkivfiler: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Bruk Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus er et verktøy som hjelper til med å formatere og lage oppstartbare USB-stasjoner, for eksempel USB-minnepinner, USB-harddisker, og lignende.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Offisiell webside: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Kildekode: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Endringslogg: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Dette programmet er lisensiert under GNU Public Licence (GPL) versjon 3.\\n\"\n\"Se https://www.gnu.org/licenses/gpl-3.0.html for mer informasjon.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Oppstart\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formater USB, minnekort og virtuelle disker til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Lag FreeDos oppstartbar USB stick\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Lag oppstartabar enhet/disk fra ISOer (Windows, Linux, etc.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Lag oppstartbare disker fra images, inkludert komprimerte sådan\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Lag BIOS eller UEFI oppstartbare disker, inkludert UEFI oppstartbar NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Lag 'Windows To Go' disker\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Lag oppstartsmedia for Windows 11 som ikke krever TPM eller Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Lag persistente Linux partisjoner\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Lag VHD/DD speilinger av valgt disk\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Kalkuler MD5, SHA-1, SHA-256 og SHA-512 sjekksummer fra valgt speiling\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Utfør sjekk for dårlige sektorer, inkludert sjekk for forfalskede flash disker\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Last ned offisielle Windows ISOer\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Last ned UEFI kommandolinje ISOer\"\n"
  },
  {
    "path": "res/loc/po/nl-NL.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-04-26 11:15+0200\\n\"\n\"PO-Revision-Date: 2024-04-26 11:44+0200\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: nl_NL\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Dutch (Nederlands)\\n\"\n\"X-Rufus-LCID: 0x0413, 0x0813\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Eigenschappen van drive\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Apparaat\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Opstartselectie\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Selecteren\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Image-optie\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Partitie-indeling\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Doelsysteem\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"USB-harde schijven weergeven\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Oplossingen voor oude BIOS'en toevoegen (extra partitie, uitlijnen, etc.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Media-validatie via UEFI inschakelen\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Opties voor formatteren\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Bestandssysteem\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Clustergrootte\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Volumelabel\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Snelformatteren\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Apparaat controleren op slechte blokken\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Uitgebreid label en pictogrambestanden aanmaken\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Sluiten\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Starten\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Over Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licentie\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"Ok\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus-licentie\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Meer informatie\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Ja\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Nee\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Wissen\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Opslaan\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Updatebeleid en instellingen\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Instellingen\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Op updates controleren\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Bètaversies insluiten\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Nu controleren\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Op updates controleren - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Er is een nieuwere versie beschikbaar. Download de laatste versie!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Klik hier om naar de website te gaan\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Uitgave-opmerkingen\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Downloaden\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Andere instantie gedetecteerd\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Er is een andere Rufus-toepassing actief.\\n\"\n\"Sluit de eerste toepassing voordat u een andere opent.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"WAARSCHUWING: ALLE DATA OP APPARAAT '%s' ZAL VERNIETIGD WORDEN.\\n\"\n\"Klik op OK om verder te gaan met deze handeling. Klik op ANNULEREN om af te sluiten.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus updatebeleid\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Wilt u Rufus toestaan om online te zoeken naar programma-updates?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Annuleren\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Slechte blokken gevonden\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Controle voltooid: %d slechte blok(ken) gevonden\\n\"\n\"  %d leesfout(en)\\n\"\n\"  %d schrijffout(en)\\n\"\n\"  %d corruptiefout(en)\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Een meer gedetailleerd rapport kan teruggevonden worden in:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Uitgeschakeld\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Dagelijks\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Wekelijks\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Maandelijks\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Aangepast\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Uw versie: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Laatste versie: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"kB\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobyte\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabyte\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Standaard\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Standaard)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (of UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (geen CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS of UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d ronde\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d rondes %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO-image\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Toepassing\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Afbreken\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Starten\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Opdracht geannuleerd door de gebruiker\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Fout\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Fout: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Bestand-download\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB-opslagapparaat (algemeen)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (schijf %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Meerdere partities\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Buffers aan het legen\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Annuleren\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Succesvol.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Onbepaalde fout tijdens formatteren.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Kan het geselecteerde bestandssysteem niet gebruiken voor dit medium.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Toegang tot apparaat is geweigerd.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Medium is beveiligd tegen schrijven.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Het apparaat is in gebruik door een ander proces. Sluit alle processen af die toegang hebben tot het apparaat.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Snelformatteren is niet beschikbaar voor dit apparaat.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Het volumelabel is ongeldig.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"De apparaat-handle is ongeldig.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"De geselecteerde clustergrootte is ongeldig voor dit apparaat.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"De volumegrootte is ongeldig.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Plaats een verwisselbaar medium in de drive.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Er werd een niet-ondersteunde opdracht ontvangen.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Geheugentoewijzingsfout.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Leesfout.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Schrijffout.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Installatie mislukt\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Kon medium niet openen. Het kan in gebruik zijn door een ander proces. Sluit het medium opnieuw aan en probeer het opnieuw.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Kon de drive niet partitioneren.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Kon bestanden niet kopiëren naar de doel-drive.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Geannuleerd door gebruiker.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Kon thread niet starten.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Controle van slechte blokken niet voltooid.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"ISO-image scanfout.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"ISO-image extractiefout.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Kon volume niet opnieuw koppelen.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Kon bestanden niet patchen/instellen voor opstarten.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Kon geen driveletter toewijzen.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Kan GUID-volume niet koppelen.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Het apparaat is niet klaar.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus heeft gedetecteerd dat Windows nog steeds bezig is om zijn interne buffers te legen naar het USB-apparaat.\\n\"\n\"\\n\"\n\"Afhankelijk van de snelheid van uw USB-apparaat kan deze handeling een lange tijd duren voordat ze voltooid is, zeker voor grote bestanden.\\n\"\n\"\\n\"\n\"Het is aanbevolen om Windows de taak volledig te laten voltooien om datacorruptie te voorkomen, maar als het erg lang duurt dan kunt u het apparaat gewoon loskoppelen...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Niet-ondersteunde image\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Deze image is ofwel niet opstartbaar, of het gebruikt een opstart- of compressiemethode die niet ondersteund wordt door Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"%s vervangen?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Deze ISO-image lijkt een verouderde versie te gebruiken van '%s'.\\n\"\n\"Opstartmenu's worden hierdoor mogelijk niet goed weergegeven.\\n\"\n\"\\n\"\n\"Een nieuwere versie kan gedownload worden door Rufus om dit probleem op te lossen:\\n\"\n\"- Kies 'Ja' om met het internet te verbinden en het bestand te downloaden\\n\"\n\"- Kies 'Nee' om het bestaande ISO-bestand ongewijzigd te laten.\\n\"\n\"Als u niet weet wat u moet doen, selecteert u best 'Ja'.\\n\"\n\"\\n\"\n\"Opmerking: Het nieuwe bestand wordt naar de huidige map gedownload en eens er een '%s' bestaat, zal deze automatisch opnieuw gebruikt worden.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Downloaden van %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Geen image geselecteerd\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"voor %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Image is te groot\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"De image is te groot voor het geselecteerde doelapparaat.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Niet-ondersteunde ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Bij gebruik van UEFI-doeltype zijn alleen EFI-opstartbare ISO-images ondersteund. Selecteer een EFI-opstartbare ISO of stel het doeltype in op BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Niet ondersteund bestandssysteem\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"BELANGRIJK: DEZE DRIVE BEVAT MEERDERE PARTITIES!\\n\"\n\"\\n\"\n\"Dit kunnen partities/volumes zijn die niet in de lijst voorkomen of zelfs niet zichtbaar zijn voor Windows. Als u verder wilt gaan, bent u zelf verantwoordelijk voor gegevensverlies op deze partities.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Meerdere partities gedetecteerd\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD-image\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Het geselecteerde bestandssysteem kan niet gebruikt worden met dit type ISO. Selecteer een ander bestandssysteem of gebruik een andere ISO.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' kan alleen toegepast worden als het bestandssysteem NTFS is.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"BELANGRIJK: U probeert 'Windows To Go' te installeren, maar uw doelschijf heeft het 'FIXED'-attribuut niet. Hierdoor zal Windows hoogstwaarschijnlijk vastlopen tijdens het opstarten omdat Microsoft het niet zo heeft ontworpen dat het werkt met drives die het 'REMOVABLE' attribuut hebben.\\n\"\n\"\\n\"\n\"Wilt u nog steeds doorgaan?\\n\"\n\"\\n\"\n\"Opmerking: Het 'FIXED/REMOVABLE'-attribuut is een hardware-eigenschap die alleen veranderd kan worden door gebruik te maken van tools van de drive-fabrikant. Deze tools worden echter BIJNA NOOIT aan het publiek aangeboden...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Beperking van bestandssysteem\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Deze ISO-image bevat een bestand dat groter is dan 4 GB wat meer is dan de maximum toegestane grootte voor een FAT- of FAT32-bestandssysteem.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"WIM-ondersteuning ontbreekt\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Uw platform kan geen bestanden uitpakken van WIM-archieven. WIM-extractie is nodig om EFI-opstartbare Windows 7 en Windows Vista USB-drives te maken. U kunt dit oplossen door een recente versie van 7-Zip te installeren.\\n\"\n\"Wilt u de 7-Zip downloadpagina bezoeken?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"%s downloaden?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s of hoger vereist een '%s'-bestand om het te kunnen installeren.\\n\"\n\"Omdat dit bestand groter is dan 100 kB en altijd aanwezig is op %s ISO-images,is het niet in Rufus ingebouwd.\\n\"\n\"\\n\"\n\"Rufus kan het ontbrekende bestand voor u downloaden:\\n\"\n\"- Selecteer 'Ja' om verbinding met het internet te maken en het bestand te downloaden\\n\"\n\"- Selecteer 'Nee' als u dit bestand later handmatig naar de drive wilt kopiëren\\n\"\n\"\\n\"\n\"Opmerking: Het bestand wordt gedownload in de huidige map en wanneer er al een '%s' bestaat, zal die automatisch vervangen worden.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Wanneer u annuleert kan het apparaat ONBRUIKBAAR worden.\\n\"\n\"Als u zeker weet dat u wilt annuleren, klik op JA. Anders klikt u op NEE.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Selecteer een map\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Alle bestanden\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus-log\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (schijf %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS kan niet opstarten van een apparaat met een clustergrootte van 64 kilobyte\\n\"\n\"Wijzig de clustergrootte of gebruik FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Incompatibele clustergrootte\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Het formatteren van grote UDF-volumes kan een lange tijd duren. Bij USB 2.0-snelheden is de geschatte formatteertijd %d:%02d, waarbij de voortgangsbalk zal geblokkeerd lijken. Wees geduldig!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Groot UDF-volume\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Deze image maakt gebruik van Syslinux %s%s maar de toepassing bevat alleen de installatiebestanden voor Syslinux %s%s.\\n\"\n\"\\n\"\n\"Omdat oude en nieuwe versies van Syslinux niet compatibel zijn met elkaar, en het niet mogelijk is voor Rufus om alle versies te beheren, moeten twee extra bestanden gedownload worden van het internet ('ldlinux.sys' en 'ldlinux.bss'):\\n\"\n\"- Klik op 'Ja' om via internet deze bestanden te downloaden\\n\"\n\"- Klik op 'Nee' om de opdracht te annuleren\\n\"\n\"\\n\"\n\"Let op: De bestanden worden in de huidige map opgeslagen en zullen automatisch vervangen worden als het bestand al bestaat.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Download is vereist\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Deze image maakt gebruik van Grub %s maar de toepassing bevat alleen de installatiebestanden voor Grub %s.\\n\"\n\"\\n\"\n\"Als verschillende versies van Grub mogelijk niet compatibel met elkaar zijn, en het is niet mogelijk om ze allemaal toe te voegen, dan zal Rufus proberen om een versie van het Grub installatie bestand ('core.img') te zoeken dat overeenkomst met uw image:\\n\"\n\"- Selecteer 'Ja' om te proberen het te downloaden\\n\"\n\"- Selecteer 'Nee' om de standaard versie van Rufus te gebruiken\\n\"\n\"- Selecteer 'Annuleren' om de bewerking te stoppen\\n\"\n\"\\n\"\n\"Aantekening: Het bestand zal in de huidige programma map gedownload en automatisch vervangen worden als het bestand al bestaat. Als er geen bestand online wordt gevonden, dan zal de standaard versie worden gebruikt.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Standaard Windows-installatie\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"geavanceerde eigenschappen van drive\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"geavanceerde opties voor formatteren\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"%s weergeven\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"%s verbergen\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Grootte van persistente partitie\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Geen persistentie\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"De grootte van de persistente partitie instellen voor live USB-media. De grootte op 0 instellen schakelt de persistente partitie uit.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Grootte-units van de partitie instellen.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Dit bericht niet opnieuw weergeven\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Belangrijke mededeling over %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"U hebt net een medium aangemaakt dat de UEFI:NTFS-bootloader gebruikt. Onthoud dat u SECURE BOOT MOET UITSCHAKELEN om op te starten vanaf dit medium.\\n\"\n\"Zie de 'meer informatie'-knop hieronder voor details over waarom dit nodig is.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows-image selectie\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Deze ISO bevat meerdere Windows-images.\\n\"\n\"Selecteer de image die u wilt gebruiken voor deze installatie:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Een ander programma of proces gebruikt deze schijf. Wilt u ze toch formatteren?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus heeft gedetecteerd dat u probeert om een Windows To Go medium aan te maken gebaseerd op een 1809-ISO\\n\"\n\"\\n\"\n\"Door een *MICROSOFT-BUG* zal dit medium crashen tijdens het opstarten van Windows (Blue Screen Of Death), tenzij u manueel het bestand 'WppRecorder.sys' vervangt door een 1803-versie.\\n\"\n\"\\n\"\n\"Merk ook op dat Rufus dit voor u niet automatisch kan oplossen omdat 'WppRecorder.sys' een Microsoft-auteursrecht heeft, dus we kunnen geen kopie van het bestand in de toepassing inbedden op een legale manier...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Omdat MBR geselecteerd werd als partitie-indeling, kan Rufus slechts een partitie tot 2 TB aanmaken op dit medium, wat %s schijfruimte onbeschikbaar zal laten.\\n\"\n\"\\n\"\n\"Weet u zeker dat u wilt doorgaan?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Versie\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Editie\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Taal\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Architectuur\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Doorgaan\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Terug\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Even geduld...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Downloaden via een browser\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Downloaden van Windows ISO's is niet mogelijk omdat Microsoft hun website heeft aangepast om dit te voorkomen.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 of nieuwer is nodig om dit script uit te voeren.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Wilt u online gaan en het downloaden?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Downloadscript uitvoeren...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"ISO-image downloaden\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Type computer waarop u deze opstartbare schijf wilt gebruiken. Het is uw verantwoordelijkheid om te bepalen of u een BIOS- of UEFI-type wilt voordat u begint met het maken van de schijf, anders kunt u deze niet opstarten.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' betekent dat het apparaat alleen in BIOS-emulatiemodus kan starten (beter bekend als 'Legacy Modus') onder UEFI, en niet in native UEFI-modus.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'geen CSM' betekent dat het apparaat alleen in native UEFI-modus kan starten, en niet in BIOS-emulatiemodus (beter bekend als 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Testpatroon: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Testpatroon: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testpatroon: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testpatroon: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Stelt het doel-bestandssysteem in\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Minimumruimte die een datablok inneemt in het bestandssysteem\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Gebruik dit veld om de drive-naam in te stellen.\\n\"\n\"Internationale tekens worden aanvaard.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Geavanceerde opties in-/uitschakelen\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Controleer het apparaat op slechte blokken tijdens een testpatroon\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Uitvinken om de \\\"langzame\\\" formatteermethode te gebruiken\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Methode die gebruikt zal worden om partities te maken\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Methode die gebruikt zal worden om de drive opstartbaar te maken\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Klikken om een image te selecteren of te downloaden...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Aanvinken om weergave van internationale labels toe te laten en een apparaat-pictogram in te stellen (maakt een autorun.inf aan)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Installeert een UEFI-bootloader die bij elke opstart vanaf het medium een MD5Sum-bestandsvalidatie uitvoert op het medium zelf\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Een extra verborgen partitie aanmaken en proberen om partitiegrenzen uit te lijnen.\\n\"\n\"Dit kan de opstartdetectie verbeteren voor oudere BIOS'en.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Weergeven van USB-harde schijfbehuizingen inschakelen. GEBRUIK OP EIGEN RISICO!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"De formatteerhandeling starten.\\n\"\n\"Dit zal alle data op de doeldrive VERWIJDEREN!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Ongeldige downloadhandtekening\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Klikken om te selecteren...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - de betrouwbare USB-formatteertool\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Versie %d.%d (build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Nederlandse vertaling:\\\\line• Roberto Pino <mailto:rcp@eclipso.me>\\\\line• Thomas De Rocker <mailto:thomasderocker@outlook.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Meld fouten of verbeteringsverzoeken naar:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Aanvullende auteursrechten:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Updatebeleid:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Als u ervoor kiest dat dit programma op updates controleert, dan gaat u akkoord dat de volgende informatie verzameld kan worden op onze server(s):\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Type besturingssysteem en versienummer\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Versienummer van de toepassing die u gebruikt\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Uw IP-adres\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Om statistieken voor privégebruik te genereren, kunnen we de informatie blijven verzamelen\\\\b voor maximaal een jaar\\\\b0 . Wij zullen deze individuele gegevens echter niet vrijwillig openbaar maken aan derden.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Update-proces:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus installeert of start geen achtergrondservices. Daarom worden updatecontroles alleen uitgevoerd als de toepassing uitgevoerd wordt.\\\\line\\n\"\n\"Internettoegang is natuurlijk vereist wanneer er op updates gecontroleerd wordt.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Ongeldige image voor geselecteerde opstartoptie\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"De huidige image komt niet overeen met de opstartoptie die geselecteerd is. Gebruik een andere image of kies een andere opstartoptie.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Deze ISO-image is niet compatibel met het geselecteerde bestandssysteem\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Niet-compatibele drive gedetecteerd\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Schrijfactie\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Leesactie\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"%s gedownload\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Kon %s niet downloaden\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Geïntegreerde versie van %s-bestand(en) gebruiken\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"BELANGRIJK: DEZE DRIVE GEBRUIKT EEN NIET-STANDAARD SECTORGROOTTE!!\\n\"\n\"\\n\"\n\"Conventionele drives gebruiken een 512-byte sectorgrootte maar deze drive gebruikt er een van %d byte. In veel gevallen betekent dit dat u NIET van deze drive kan opstarten.\\n\"\n\"Rufus kan proberen om een opstartbare drive te maken, maar er is GEEN GARANTIE dat het gaat werken.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Niet-standaard sectorgrootte gedetecteerd\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' kan alleen geïnstalleerd worden op een GPT-gepartitioneerde schijf als het FIXED-attribuut ingesteld is. De huidige drive wordt niet herkend als FIXED.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Deze functie is niet beschikbaar op dit platform.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Annuleren - even geduld...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Image scannen...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Scannen van image mislukt\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Verouderde %s gedetecteerd\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Gebruikte image: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Ontbrekend %s-bestand\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Nieuw volume\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d apparaat gevonden\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d apparaten gevonden\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"KLAAR\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Geannuleerd\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Mislukt\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Nieuwe toepassing starten...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Nieuwe toepassing starten mislukt\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"%s geopend\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"%s opgeslagen\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formatteren: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Bestandssysteem aanmaken: Taak %d/%d voltooid\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS herstellen: %d%% voltooid\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formatteren (%s) - geschatte duur %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Label instellen (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formatteren (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS herstellen (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"MBR/PBR/GPT-structuren wissen...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Schijftoegang aanvragen...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Bestaande boot-records analyseren...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Bestaand volume afsluiten...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Master Boot Record schrijven...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Partitie Boot Record schrijven...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"DOS-bestanden kopiëren...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"ISO-bestanden kopiëren: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI boot-setup (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Afwerken, even geduld...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Syslinux %s installeren...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Slechte blokken: %s %d/%d - %0.2f%% (%d/%d/%d fouten)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Slechte blokken: testen met willekeurig patroon\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Slechte blokken: testen met patroon 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Partitioneren (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Partities verwijderen (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"De handtekening voor de gedownloade update kan niet gevalideerd worden. Dit kan betekenen dat uw systeem onjuist geconfigureerd is voor handtekeningvalidatie of een kwaadwillende download aantonen.\\n\"\n\"\\n\"\n\"De download zal verwijderd worden. Controleer het logboek voor meer details.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Downloaden: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Downloaden van bestand mislukt.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Controleren op Rufus-updates...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Updates: verbinden met het internet niet mogelijk\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Updates: kon versie-data niet ophalen\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Er is een nieuwe versie van Rufus beschikbaar!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Geen nieuwe versie van Rufus gevonden\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Registersleutels van toepassing succesvol verwijderd\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Registersleutels van toepassing verwijderen mislukt\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s ingeschakeld\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s uitgeschakeld\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Grootte-controles\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Detectie harde schijven\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Uitgebreide FAT32-formattering forceren\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun zal verwijderd worden bij afsluiten\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Valse drive-detectie\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet-ondersteuning\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge-ondersteuning\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Update forceren\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS-compressie\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Image schrijven: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO-ondersteuning\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"JUISTE grootte-eenheden gebruiken\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Map '%s' verwijderen\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare-schijfdetectie\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Dubbele UEFI/BIOS-modus\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Windows-image toepassen: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Windows-image toepassen...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Tijdstempels behouden\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB-debug\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Image checksums berekenen: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"MD5-, SHA1- en SHA256-checksums voor de geselecteerde image berekenen\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"De taal van de toepassing wijzigen\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s-image gedetecteerd\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"De geselecteerde image is een 'ISOHybrid'-image. Dit betekent dat hij geschreven kan worden in %s (bestandskopie)-modus of %s (schijf-image)-modus.\\n\"\n\"Rufus beveelt de %s-modus aan zodat er altijd volledige toegang is tot de schijf nadat ze geschreven is.\\n\"\n\"Als er problemen zijn tijdens het opstarten, kunt u echter proberen om deze image opnieuw te schrijven in %s-modus.\\n\"\n\"\\n\"\n\"Selecteer de modus die u wilt gebruiken om deze image te schrijven:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Schrijven in %s-modus (aanbevolen)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Schrijven in %s-modus\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Controleren op conflicterende processen...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Niet opstartbaar\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Schijf of ISO-image\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (selecteren)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Exclusieve USB-drive vergrendeling\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Ongeldige handtekening\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Het gedownloade programmabestand heeft geen digitale handtekening.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Het gedownloade programmabestand is ondertekend door '%s'.\\n\"\n\"Dit is geen herkende handtekening en zou dus kunnen betekenen dat iemand malware in dit bestand heeft verborgen...\\n\"\n\"Weet u zeker dat u dit bestand wilt uitvoeren?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Nullen schrijven : %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Detectie van niet-USB verwijderbare drives\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Ontbrekende verhoogde rechten\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Dit programma kan alleen starten met verhoogde rechten\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Bestandsindexering\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Versie-selectie\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Selecteer de Windows-versie die u wilt installeren:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Niet ondersteunde Windows-versie\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Deze Windows-versie wordt niet langer ondersteund door Rufus.\\n\"\n\"De laatste versie van Rufus die compatibel is met dit platform is v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Waarschuwing: niet-officiële versie\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Deze versie van Rufus is NIET gemaakt door de originele ontwikkelaar(s).\\n\"\n\"\\n\"\n\"Weet u zeker dat u dit programma wilt uitvoeren?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Onvolledige ISO gedetecteerd\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Het ISO-bestand dat u geselecteerd heeft, komt niet overeen met zijn opgegeven grootte: %s van de data ontbreekt!\\n\"\n\"\\n\"\n\"Als u dit bestand van het internet heeft gehaald, probeer een nieuwe kopie te downloaden en te verifiëren of de MD5- of SHA-checksums overeenkomen met de officiële versies.\\n\"\n\"\\n\"\n\"Merk op dat u de MD5 of SHA in Rufus kunt berekenen door op de (✓)-knop te klikken.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Validatiefout tijdstempel\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus kon niet valideren dat de tijdstempel van de gedownloade update recenter is dan die van de huidige versie.\\n\"\n\"\\n\"\n\"Om mogelijke aanvalsscenario's te voorkomen is het updateproces afgebroken en zal de download verwijderd worden. Controleer het logboek voor meer details.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Toepassingsinstellingen weergeven\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Informatie over deze toepassing weergeven\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Logboek weergeven\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Een schijf-image aanmaken van het geselecteerde apparaat\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Gebruik deze optie om aan te geven of u Windows op een andere schijf wilt installeren, of als u Windows rechtstreeks vanaf deze schijf wilt opstarten (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Snel nullen schrijven: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"dit kan een tijdje duren\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD-detectie\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Gecomprimeerd archief\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"De ISO die u hebt geselecteerd, maakt gebruik van UEFI en is klein genoeg om te worden geschreven als een EFI-systeempartitie (ESP). Schrijven naar een ESP in plaats van te schrijven naar een generieke gegevenspartitie die de hele schijf bezet, kan de voorkeur hebben voor sommige soorten installaties.\\n\"\n\"\\n\"\n\"Selecteer de modus die u wilt gebruiken om deze image te schrijven:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Gebruik %s (in het hoofdvenster) om in te schakelen.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Opslaan naar VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Image-checksums berekenen\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Meerdere knoppen\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Aantal bewerkingen\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"Schijf-ID\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Standaard thread-prioriteit: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Opstartmarkering negeren\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Partitie-layout verversen (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"De image die u hebt geselecteerd is een ISOHybrid, maar de makers ervan hebben hem niet compatibel gemaakt met de ISO/bestandskopieermodus.\\n\"\n\"Als gevolg daarvan zal de DD-image schrijfmodus worden afgedwongen.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Kan '%s' niet openen of lezen\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Windows aanpassen: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Gebruikersopties toepassen...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows gebruikerservaring\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Windows-installatie aanpassen?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Verwijder de vereiste voor 4GB+ RAM, Secure Boot en TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Verwijder de vereiste voor een online Microsoft-account\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Gegevensverzameling uitschakelen (privacy-vragen overslaan)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Voorkomen dat Windows To Go toegang heeft tot interne schijven\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Lokale account met gebruikersnaam aanmaken:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Regionale opties op dezelfde waarden als deze gebruiker instellen\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Automatische Bitlocker-apparaatversleuteling uitschakelen\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Er moet een extra bestand ('diskcopy.dll') worden gedownload van Microsoft om MS-DOS te installeren:\\n\"\n\"- Selecteer 'Ja' om verbinding te maken met internet en het bestand te downloaden\\n\"\n\"- Selecteer 'Nee' om de bewerking te annuleren\\n\"\n\"\\n\"\n\"Opmerking: het bestand wordt gedownload in de map van de toepassing en wordt automatisch opnieuw gebruikt als het aanwezig is.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Ingetrokken UEFI-bootloader gedetecteerd\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus heeft gedetecteerd dat de ISO die u hebt geselecteerd een UEFI-bootloader bevat die is ingetrokken en %s zal produceren wanneer Secure Boot is ingeschakeld op een volledig bijgewerkt UEFI-systeem.\\n\"\n\"\\n\"\n\"- Als u deze ISO-image hebt verkregen van een niet-vertrouwde bron, houdt u best rekening met de mogelijkheid dat het UEFI-malware bevat en vermijdt u om ervan op te starten.\\n\"\n\"- Als u het van een betrouwbare bron hebt verkregen, moet u proberen een meer up-to-date versie te vinden die deze waarschuwing niet produceert.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"een \\\"Security Violation\\\"-scherm\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"een Windows-herstelscherm (BSOD) met '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Gecomprimeerde VHDX-image\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Niet-gecomprimeerde VHD-image\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Full Flash Update image\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Om deze functionaliteit te kunnen gebruiken, moeten enkele extra gegevens worden gedownload van Microsoft:\\n\"\n\"- Selecteer 'Ja' om verbinding te maken met internet en ze te downloaden\\n\"\n\"- Selecteer 'Nee' om de bewerking te annuleren\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Windows beperken tot S-Modus (NIET COMPATIBEL met omzeiling voor online account)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Expert-modus\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Archiefbestanden uitpakken: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Rufus MBR gebruiken\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus is een programma dat helpt bij het formatteren en aanmaken van opstartbare USB-flash-drives, zoals USB-sticks, geheugensticks, enz.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Officiële site: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Broncode: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Wijzigingslog: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Deze toepassing valt onder de voorwaarden van de GNU Public License (GPL) versie 3.\\n\"\n\"Zie https://www.gnu.org/licenses/gpl-3.0.nl.html voor details.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Opstarten\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"USB, flashkaart en virtuele schijven formatteren naar FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"FreeDOS opstartbare USB-schijven aanmaken\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Opstartbare schijven aanmaken via opstartbare ISO's (Windows, Linux, enz)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Opstartbare schijven aanmaken van opstartbare schijf-images, inclusief gecomprimeerde images\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"BIOS of UEFI opstartbare schijven aanmaken, inclusief UEFI opstartbare NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"'Windows To Go'-schijven aanmaken\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Windows 11 installatieschijven aanmaken voor pc's die geen TPM of Secure Boot hebben\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Persistent Linux partities aanmaken\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"VHD/DD-images van de geselecteerde schijf aanmaken\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"MD5, SHA-1, SHA-256 en SHA-512 controlesommen berekenen van de geselecteerde image\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Controles uitvoeren op slechte blokken, inclusief detectie van \\\"valse\\\" flashdrives\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Officiële Microsoft Windows retail ISO's downloaden\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"UEFI Shell ISO's downloaden\"\n"
  },
  {
    "path": "res/loc/po/pl-PL.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-08-13 12:38+0100\\n\"\n\"PO-Revision-Date: 2024-08-13 13:22+0100\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: pl_PL\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Polish (Polski)\\n\"\n\"X-Rufus-LCID: 0x0415\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Właściwości dysku\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Urządzenie\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Wybór bootowania\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Wybierz\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Opcje obrazu\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Schemat partycjonowania\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Docelowy system\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Pokaż dyski twarde USB\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Dodaj łatkę dla starych BIOSów (dodatkowa partycja, itp.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Włącz weryfikację nośnika UEFI w czasie wykonywania\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Opcje formatowania\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"System plików\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Rozmiar jednostki alokacji\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Nazwa woluminu\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Szybkie formatowanie\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Szukaj błędnych sektorów na urządzeniu\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Utwórz rozszerzoną nazwę i pliki ikon\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Stan\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Zamknij\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"O Rufusie\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licencja\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Licencja Rufusa\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Więcej informacji\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Tak\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Nie\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Wyczyść\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Zapisz\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Polityka aktualizacji i ustawienia\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Ustawienia\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Szukaj aktualizacji\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Dołącz wersje beta\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Sprawdź teraz\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Szukaj aktualizacji - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Nowsza wersja jest dostępna. Proszę pobrać najnowszą wersję!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Kliknij tutaj, aby przejść na stronę www\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Informacje o wydaniu\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Pobierz\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Wykryto inną instancję\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Inna aplikacja Rufus jest uruchomiona.\\n\"\n\"Proszę zamknąć pierwszą aplikację przed otwarciem innej.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"UWAGA: WSZYSTKIE DANE NA URZĄDZENIU '%s' ZOSTANĄ ZNISZCZONE.\\n\"\n\"Aby kontynuować tę operację naciśnij OK. Aby wyjść naciśnij ANULUJ.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Polityka aktualizacji Rufusa\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Czy chcesz zezwolić Rufusowi na sprawdzanie aktualizacji online?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Anuluj\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Znaleziono uszkodzone sektory\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Sprawdzanie zakończone: znaleziono %d uszkodzone sektory(ów)\\n\"\n\"  %d błędów odczytu\\n\"\n\"  %d błędów zapisu\\n\"\n\"  %d błędy(ów) uszkodzeń\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Raport szczegółowy jest dostępny w:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Wyłączone\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Dziennie\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Tygodniowo\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Miesięcznie\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Własne\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Twoja wersja: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Najnowsza wersja: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"bajtów\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobajtów\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabajtów\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Domyślne\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Domyślne)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (lub UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (bez CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS lub UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d Przebieg\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d Przebiegi %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Obraz ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Aplikacja\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Przerwij\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Uruchom\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operacja anulowana przez użytkownika\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Błąd\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Błąd: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Pobieranie pliku\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Urządzenie pamięci masowej USB (Ogólny)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Dysk %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Wiele Partycji\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Czyszczenie buforów\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Anulowanie\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Sukces.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Niezidentyfikowany błąd podczas formatowania.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Nie można użyć wybranego systemu plików dla tego nośnika.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Dostęp do urządzenia jest zabroniony.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Nośnik jest w trybie chronionym przed zapisem.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Urządzenie jest używane przez inny proces. Proszę zamknąć inne procesy, które mogą korzystać z tego urządzenia.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Szybkie formatowanie jest niedostępne dla tego urządzenia.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Nazwa woluminu jest nieprawidłowa.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Uchwyt urządzenia jest nieprawidłowy.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Wybrany rozmiar jednostki alokacji jest nieprawidłowy dla tego urządzenia.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Rozmiar woluminu jest nieprawidłowy.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Proszę włożyć dysk wymienny do napędu.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Otrzymano niewspieraną komendę.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Błąd alokacji pamięci.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Błąd odczytu.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Błąd zapisu.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Niepowodzenie instalacji\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Nie można otworzyć nośnika. Może być używany przez inny proces. Proszę podłączyć ponownie nośnik i spróbować jeszcze raz.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Nie można podzielić dysku na partycje.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Nie można skopiować plików na dysk docelowy.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Przerwane przez użytkownika.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Nie można rozpocząć wątku.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Nie ukończono sprawdzania błędnych sektorów.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Niepowodzenie skanowania pliku ISO.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Niepowodzenie wypakowywania pliku ISO.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Nie można ponownie zamontować woluminu.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Nie można załatać/skonfigurować plików do rozruchu.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Nie można przypisać litery dysku.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Nie można zamontować woluminu GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Urządzenie nie jest gotowe.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus wykrył, że Windows wciąż opróżnia swoje bufory na urządzenie USB.\\n\"\n\"\\n\"\n\"Zależnie od prędkości twojego urządzenia USB, ta operacja może zająć dużo czasu, zwłaszcza dla dużych plików.\\n\"\n\"\\n\"\n\"Zalecamy, abyś pozwolił Windowsowi skończyć, żeby uniknąć uszkodzeń. Jeśli jesteś już zmęczony czekaniem, możesz po prostu odłączyć urządzenie...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Niewspierany obraz\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Ten obraz nie jest rozruchowy lub używa kompresji sektora rozruchowego niewspieranej przez Rufusa...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Zastąpić %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Ten obraz ISO wydaje się używać przestarzałej wersji '%s'.\\n\"\n\"Z tego powodu menu rozruchowe może nie wyświetlać się poprawnie.\\n\"\n\"\\n\"\n\"Nowsza wersja może być pobrana przez Rufus, aby naprawić ten błąd:\\n\"\n\"- Wybierz 'Tak', aby połączyć się z internetem i pobrać plik\\n\"\n\"- Wybierz 'Nie', aby zostawić istniejący plik ISO niezmienionym\\n\"\n\"Jeśli nie wiesz co zrobić, powinieneś wybrać 'Tak'.\\n\"\n\"\\n\"\n\"Informacja: Nowy plik będzie pobrany do aktualnej lokalizacji i jeśli '%s' istnieje, zostanie ponownie użyte automatycznie.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Pobieranie %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Nie wybrano obrazu\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"dla NAND %s\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Obraz jest zbyt duży\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Ten obraz jest zbyt duży dla wybranego celu.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Niewspierane ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Podczas używania Systemu Typu UEFI, tylko rozruchowe obrazy ISO EFI są wspierane. Proszę wybrać rozruchowy obraz ISO EFI lub ustawić System Docelowy na BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Niewspierany system plików\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"WAŻNE: TEN NAPĘD ZAWIERA WIELE PARTYCJI!!\\n\"\n\"\\n\"\n\"Może to obejmować partycje/woluminy, które nie są wymienione lub nawet widoczne z poziomu Windows. Jeżeli chcesz kontynuować, jesteś odpowiedzialny za utratę danych na tych partycjach.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Wykryto wiele partycji\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"Obraz DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Aktualnie zaznaczony system plików nie może zostać użyty z tym typem ISO. Proszę wybrać inny system plików lub użyć innego ISO.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' może zostać użyte wyłącznie, jeżeli system plików to NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"WAŻNE: Próbujesz zainstalować 'Windows To Go', lecz dysk docelowy nie ma atrybutu 'LOKALNY'. Z tego powodu Windows prawdopodobnie zawiesi się podczas startu, ponieważ Microsoft nie zaprojektował go do działania z dyskami, które zamiast tego mają atrybut 'WYMIENNY'.\\n\"\n\"\\n\"\n\"Czy nadal chcesz kontynuować?\\n\"\n\"\\n\"\n\"Informacja: Atrybut 'LOKALNY/WYMIENNY' to właściwość sprzętowa, która może jedynie zostać zmieniona używając narzędzi dostarczanych przez producenta dysku. Jednak te narzędzia PRAWIE NIGDY nie są udostępniane publicznie...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Ograniczenia systemu plików\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Ten obraz ISO zawiera plik większy niż 4 GB, większy niż maksymalny dozwolony rozmiar dla systemu plików FAT lub FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Brakujące wsparcie WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Twoja platforma nie może wypakować plików z archiwów WIM. Wypakowanie WIM jest wymagane aby utworzyć rozruchowy dysk USB EFI z Windows 7 i Windows Vista. Możesz to naprawić instalując aktualną wersję 7-Zip.\\n\"\n\"Czy chcesz odwiedzić stronę pobierania 7-zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Pobrać %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s lub późniejszy wymaga zainstalowania pliku '%s'.\\n\"\n\"Ponieważ ten plik jest większy niż 100 KB i zawsze jest obecny na obrazach ISO %s, nie jest dołączony do Rufusa.\\n\"\n\"\\n\"\n\"Rufus może pobrać brakujący plik dla ciebie:\\n\"\n\"- Wybierz 'Yes', aby połączyć się z internetem i pobrać plik\\n\"\n\"- Wybierz 'No', jeśli chcesz później ręcznie skopiować ten plik na dysk \\n\"\n\"\\n\"\n\"Informacja: Plik zostanie pobrany do obecnego folderu i jeśli '%s' istnieje, zostanie użyty ponownie automatycznie.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Przerwanie operacji może pozostawić urządzenie w stanie NIEZDATNYM DO UŻYTKU.\\n\"\n\"Jeśli jesteś pewien, że chcesz przerwać operację, naciśnij TAK. W innym razie naciśnij NIE.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Proszę wybrać folder\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Wszystkie pliki\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Dziennik Rufusa\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Dysk %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS nie może być uruchomiony z dysku korzystającego z 64 kilobajtowego Rozmiaru jednostki alokacji.\\n\"\n\"Proszę zmienić rozmiar jednostki alokacji lub użyć FreeDOSa.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Niekompatybilny rozmiar jednostki alokacji\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Formatowanie dużych woluminów UDF może zająć dużo czasu. Przy prędkości USB 2.0 , szacunkowy czas formatowania wynosi %d:%02d, podczas którego pasek postępu będzie wydawał się być zamrożony. Proszę być cierpliwym!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Duży wolumin UDF\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Ten obraz używa Syslinux %s%s, lecz ta aplikacja dołącza pliki instalacyjne tylko dla Syslinux %s%s.\\n\"\n\"\\n\"\n\"Ponieważ nowa wersja Syslinux nie jest kompatybilna z inną i nie jest możliwe dla Rufusa aby załączyć je wszystkie, dwa dodatkowe pliki muszą być pobrane z Internetu ('ldlinux.sys' oraz 'ldlinux.bss'):\\n\"\n\"- Wybierz 'Tak' aby połączyć z Internetem i pobrać te pliki\\n\"\n\"- Wybierz 'Nie' aby anulować operację\\n\"\n\"\\n\"\n\"Informacja: Pliki zostaną pobrane do aktualnego folderu aplikacji i zostaną użyte ponownie automatycznie, jeśli istnieją.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Wymagane pobieranie\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Ten obraz używa Grub %s, lecz ta aplikacja dołącza pliki instalacyjne tylko dla Grub %s.\\n\"\n\"\\n\"\n\"Ponieważ inna wersja Grub może nie być kompatybilna, oraz nie jest możliwe dołączenie wszystkich, Rufus spróbuje zlokalizować wersję pliku instalacyjnego Grub ('core.img'), która jest zgodna z użytą w twoim obrazie:\\n\"\n\"- Wybierz 'Tak' aby połączyć z Internetem i spróbować ją pobrać\\n\"\n\"- Wybierz 'Nie' aby użyć domyślnej wersji z Rufusa\\n\"\n\"- Wybierz 'Anuluj' aby przerwać operację\\n\"\n\"\\n\"\n\"Informacja: Pliki zostaną pobrane do aktualnego folderu aplikacji i zostaną użyte ponownie automatycznie, jeśli istnieją. Jeżeli nie można znależć odpowiednich plików online, zostanie użyta domyślna wersja plików.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Standardowa instalacja Windowsa\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"zaawansowane właściwości dysku\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"zaawansowane opcje formatowania\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Pokaż %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Ukryj %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Rozmiar trwałej partycji\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Brak trwałości\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Ustaw rozmiar stałej partycji dla nośnika live USB. Ustawienie rozmiaru na 0 wyłącza trwałą partycję.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Wybierz jednostkę rozmiaru partycji.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Nie pokazuj więcej tej wiadomości\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Ważna informacja o %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Właśnie utworzyłeś nośnik, który używa bootloadera UEFI:NTFS. Pamiętaj, że aby wystartować z tego medium, MUSISZ WYŁĄCZYĆ \\\"SECURE BOOT\\\".\\n\"\n\"Aby dowiedzieć się więcej dlaczego jest to wymagane, kliknij poniżej przycisk \\\"Więcej informacji\\\".\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Wybór obrazu Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"To ISO zawiera wiele obrazów Windows.\\n\"\n\"Wybierz obraz, którego chcesz użyć dla tej instalacji:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Inny program lub proces używa tego dysku. Czy chcesz go sformatować mimo to?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus wykrył, że próbujesz utworzyć nośnik \\\"Windows To Go\\\" bazujący na ISO 1809.\\n\"\n\"\\n\"\n\"Z powodu *BŁĘDU MICROSOFTU*, ten nośnik ulegnie awarii podczas rozruchu systemu (Blue Screen of Death), chyba że ręcznie zastąpisz plik \\\"WppRecorder.sys\\\" wersją z 1803.\\n\"\n\"\\n\"\n\"Należy również pamiętać, że powodem, dla którego Rufus nie może automatycznie rozwiązać tego problemu, jest to, że \\\"WppRecorder.sys” jest plikiem chronionym prawem autorskim firmy Microsoft, więc nie możemy zgodnie z prawem osadzić kopii pliku w aplikacji.\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Ponieważ MBR został wybrany jako schemat partycji, Rufus może utworzyć partycję o rozmiarze do 2 TB na tym nośniku, co spowoduje, że %s miejsca na dysku będzie niedostępne.\\n\"\n\"\\n\"\n\"Jesteś pewien, że chcesz kontynuować?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Wersja\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Wydanie\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Edycja\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Język\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Architektura\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Kontynuuj\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Powrót\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Proszę czekać....\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Pobierz za pomocą przeglądarki\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Tymczasowo zablokowany przez Microsoft za żądanie zbyt wielu pobrań - spróbuj ponownie później...\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 albo nowszy wymagany do uruchomienia tego skryptu.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Czy chcesz przejść do trybu online i go pobrać?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Uruchamianie skryptu pobierania...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Pobierz obraz ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Typ komputera, na którym chcesz użyć dysku rozruchowego. Przed stworzeniem dysku musisz sam określić, czy docelowy komputer posiada BIOS, czy UEFI, inaczej może się nie uruchomić.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' oznacza, że urządzenie uruchomi się jedynie w trybie emulacji BIOSu (znanej jako 'Legacy Mode') w UEFI, ale nie w natywnym trybie UEFI.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'bez CSM' oznacza, że urządzenie uruchomi się jedynie w natywnym trybie UEFI, ale nie w trybie emulacji BIOSu (znanej jako 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Wzorzec testowy: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Wzorzec testowy: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Wzorzec testowy: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Wzorzec testowy: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Ustawia docelowy system plików\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Minimalny rozmiar jaki blok będzie zajmował w systemie plików\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Użyj tego pola, aby ustawić etykietę dysku.\\n\"\n\"Znaki międzynarodowe są dozwolone.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Przełącz opcje zaawansowane\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Sprawdź urządzenie pod kątem błędnych sektorów używając wzoru testowego\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Odznacz to pole, aby użyć \\\"powolnej\\\" metody formatowania\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metoda, która zostanie użyta do stworzenia partycji\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Metoda, która zostanie użyta, aby uczynić dysk rozruchowym\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Kliknij, aby wybrać lub pobrać obraz...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Zaznacz to pole, aby zezwolić na wyświetlanie etykiet międzynarodowych i ustawić ikonę urządzenia (tworzy plik autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Zainstaluj bootloader UEFI, który przeprowadzi weryfikację typu MD5SUM na nośniku\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Tworzy dodatkową, ukrytą partycję i próbuje wyrównać granice partycji.\\n\"\n\"To może poprawić wykrywanie uruchamiania dla starszych BIOSów.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Włącza listowanie Dysków Twardych USB. UŻYWASZ NA WŁASNĄ ODPOWIEDZIALNOŚĆ!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Uruchom operację formatowania.\\n\"\n\"To ZNISZCZY wszystkie dane na urządzeniu docelowym!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Nieprawidłowa sygnatura pobranego pliku\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Kliknij, aby wybrać...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - niezawodne narzędzie do formatowania USB\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Wersja %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Polskie tłumaczenie:\\\\line• Piotr Halama <http://halamix2.pl>\\\\line• Krzysztof J. Szklarski\\\\line• Jakub Zieciak\\\\line• Jakub Mierzejewski <mailto:jakmierzejewski@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Zgłaszaj błędy lub ulepszenia na:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Dodatkowe prawa autorskie:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Polityka aktualizacji:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Jeśli pozwolisz temu programowi szukać aktualizacji aplikacji, zgadzasz się na to, że następujące informacje mogą być zbierane na naszym serwerze (serwerach):\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Architektura i wersja twojego systemu operacyjnego\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Wersja aplikacji, z której korzystasz\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Twój adres IP\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"W celu generowania poufnych statystyk użytkowania tego programu możemy przechowywać zebrane informacje \\\\b co najwyżej rok\\\\b0, jednak nie będziemy udostępniać żadnych z indywidualnych danych osobom trzecim.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Proces aktualizacji:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus nie instaluje lub uruchamia procesów w tle, dlatego aktualizacje są sprawdzane wyłącznie przy starcie głównego okna aplikacji.\\\\line\\n\"\n\"Dostęp do internetu jest wymagany podczas sprawdzania aktualizacji.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Obraz nieprawidłowy dla wybranej opcji rozruchowej\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Obecny obraz nie pasuje do wybranej opcji rozruchowej. Proszę użyć innego obrazu lub wybrać inną opcję rozruchową.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Ten obraz ISO jest niekompatybilny z wybranym systemem plików\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Wykryto niekompatybilny dysk\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Postęp zapisu\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Postęp odczytu\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Pobrano %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Nie można pobrać %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Używanie wbudowanej wersji pliku(ów) %s\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"WAŻNE: TEN DYSK UŻYWA NIESTANDARDOWEGO ROZMIARU SEKTORA!\\n\"\n\"\\n\"\n\"Standardowe dyski używają 512-bajtowego rozmiaru sektora, lecz ten dysk używa %d-bajtowego. W wielu przypadkach oznacza to, że NIE będziesz mógł startować z tego dysku.\\n\"\n\"Rufus może spróbować utworzyć dysk rozruchowy, ale NIE MA GWARANCJI, że to zadziała.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Wykryto niestandardowy rozmiar sektora\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' może zostać zainstalowany jedynie na dysku ze strukturą GPT jeżeli ma on ustawiony atrybut LOKALNY. Obecny dysk nie został wykryty jako LOKALNY.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Ta funkcja nie jest dostępna na tej platformie.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Anulowanie - Proszę czekać...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Skanowanie obrazu...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Niepowodzenie skanowania obrazu\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Wykryto przestarzałe %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Używany obraz: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Brak pliku %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Nowy wolumin\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"znaleziono %d urządzenie\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"znaleziono %d urządzenia\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"Gotowy\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Anulowano\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"NIEPOWODZENIE\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Uruchamianie nowej aplikacji...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Niepowodzenie uruchomienia nowej aplikacji\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Otwarto %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Zapisano %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formatowanie: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Tworzenie systemu plików: Ukończono zadanie %d/%d\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Naprawianie NTFS: %d%% ukończenia\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formatowanie (%s) - przewidywany czas %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Ustawianie Etykiety (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formatowanie (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Naprawianie NTFS (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Czyszczenie struktur MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Żądanie dostępu do dysku...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analizowanie istniejących boot sektorów...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Zamykanie istniejącego woluminu...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Zapisywanie Master Boot Record...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Zapisywanie Partition Boot Record...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopiowanie plików DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopiowanie plików ISO: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Ustawianie rozruchu Win7 EFI (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Finalizacja, proszę czekać...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Instalowanie Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Błędne Sektory: %s %d/%d - %0.2f%% (%d/%d/%d błędów)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Błędne Sektory: Testowanie z losowym wzorem\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Błędne Sektory: Testowanie z wzorem 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Partycjonowanie (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Usuwanie partycji (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Sygnatura pobranej aktualizacji nie mogła zostać sprawdzona. To może oznaczać, że twój system jest nieprawidłowo skonfigurowany dla sprawdzania sygnatur lub wskazywać na pobrany złośliwy plik.\\n\"\n\"\\n\"\n\"Pobrany plik zostanie usunięty. Proszę sprawdzić dziennik, żeby dowiedzieć się więcej.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Pobieranie: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Niepowodzenie pobierania pliku.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Sprawdzanie aktualizacji Rufusa...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Aktualizacje: Nie można połączyć z internetem\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Aktualizacje: Nie można sprawdzić danych wersji\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Jest dostępna nowa wersja Rufusa!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Nie znaleziono nowszej wersji Rufusa\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Pomyślnie usunięto klucze rejestru aplikacji\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Niepowodzenie usuwania kluczy rejestru aplikacji\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"Włączono %s\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"Wyłączono %s\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Sprawdzanie rozmiaru\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Wykrywanie dysków twardych\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Siłowe formatowanie dużych FAT32\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun zostanie usunięte przy wyjściu\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Fałszywe wykrywanie dysku\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Wsparcie Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Wsparcie Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Siłowa aktualizacja\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"Kompresja NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Zapisywanie obrazu: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Wsparcie ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Użyj WŁAŚCIWEGO rozmiaru jednostek\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Usuwanie folderu '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Wykrywanie dysków VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Tryb dual UEFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Zastosowywanie obrazu Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Zastosowywanie obrazu Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Zachowaj znaczniki czasu\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Debugowanie USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Obliczanie sum kontrolnych obrazu: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Oblicz sumy kontrolne MD5, SHA1 oraz SHA256 dla wybranego obrazu\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Zmień język aplikacji\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Wykryto obraz %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Obraz, który wybrałeś to obraz 'ISOHybrid'. Oznacza to, że może zostać zapisany w trybie %s (kopia plików) lub trybie %s (obraz dysku).\\n\"\n\"Rufus zaleca użycie trybu %s, abyś zawsze miał pełny dostęp do dysku po jego zapisaniu.\\n\"\n\"Jednak jeśli napotkasz problemy podczas rozruchu możesz spróbować zapisać ten obraz ponownie w trybie %s.\\n\"\n\"\\n\"\n\"Proszę wybrać tryb którego chcesz użyć do zapisania tego obrazu:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Zapisz w trybie %s (zalecane)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Zapisz w trybie %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Sprawdzanie kolidujących procesów...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Niebootowalne\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Obraz dysku lub ISO płyty\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Proszę wybrać)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Blokowanie dysku USB na wyłączność\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Nieprawidłowa sygnatura\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Pobrany plik wykonywalny nie posiada cyfrowej sygnatury.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Pobrany plik wykonywalny jest podpisany przez '%s'.\\n\"\n\"To nie jest rozpoznawana przez nas sygnatura i może wskazywać na pewne formy złośliwych zachowań...\\n\"\n\"Czy na pewno chcesz uruchomić ten plik?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Zerowanie dysku: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Wykrywanie dysków wymiennych nie-USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Brakujące uprawnienia administratora\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Ta aplikacja może działać wyłącznie z uprawnieniami administratora\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Indeksowanie plików\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Wybór wersji\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Proszę wybrać wersję Windowsa, którą chcesz zainstalować:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Niewspierana wersja Windowsa\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Ta wersja Windowsa nie jest już wspierana przez Rufusa.\\n\"\n\"Ostatnia wersja w pełni wspierana przez Rufusa: v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Uwaga: Nieoficjalna wersja\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Ta wersja Rufusa nie została stworzona przez oficjalnego dewelopera(ów).\\n\"\n\"\\n\"\n\"Czy na pewno chcesz ją uruchomić?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Wykryto obcięte ISO\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Rozmiar pliku ISO, który wybrałeś nie zgadza się z jego deklarowanym rozmiarem: brakuje %s danych!\\n\"\n\"\\n\"\n\"Jeżeli uzyskałeś ten plik z internetu, powinieneś spróbować pobrać nową kopię oraz zweryfikować, że sumy kontrolne MD5 lub SHA zgadzają się z oficjalnymi.\\n\"\n\"\\n\"\n\"Zauważ, że możesz obliczyć sumy MD5 lub SHA w Rufusie klikając przycisk (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Błąd sprawdzania poprawności znacznika czasu\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus nie był w stanie potwierdzić, że znacznik czasu pobranej aktualizacji jest nowszy niż ten, który jest dla obecnego pliku wykonywalnego.\\n\"\n\"\\n\"\n\"Aby zapobiec potencjalnym atakom proces aktualizacji został przerwany, a pobrana aktualizacja zostanie usunięta. Proszę sprawdzić dziennik dla większej ilości szczegółów.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Pokaż ustawienia aplikacji\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Pokaż informacje o tej aplikacji\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Pokaż dziennik\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Utwórz obraz dysku wybranego urządzenia\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Użyj tej opcji, aby wskazać, czy chcesz użyć tego dysku do instalacji Windowsa na innym dysku, czy chcesz uruchomić Windowsa bezpośrednio z dysku (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Szybkie zerowanie dysku: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"to może chwilę potrwać\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Detekcja VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Skompresowane archiwum\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Wybrany plik ISO używa UEFI i jest na tyle mały, że można go zapisać jako partycję systemową EFI (ESP). Zapisanie na ESP, zamiast zapisywania na ogólnej partycji danych zajmującej cały dysk, może być preferowane dla niektórych typów instalacji.\\n\"\n\"\\n\"\n\"Proszę wybrać tryb, w którym chcesz zapisać ten obraz:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Użyj %s w głównym oknie aplikacji, żeby włączyć.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Dodatkowe hasze (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Zapisz do VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Oblicz sumy kontrolne obrazu\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Wiele przycisków\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Liczba przebiegów\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"Identyfikator dysku\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Domyślny priorytet wątku: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Zignoruj znacznik 'boot'\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Odświeżanie układu partycji (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Obraz, który został wybrany jest Hybrydą ISO i nie jest zgodny z trybem kopiowania ISO.\\n\"\n\"Wynikiem tego będzie przymusowe zapisywanie w trybie DD.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Nie można otworzyć '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Zastosuj niestandardowe ustawienia Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Aplikowanie ustawień użytkownika...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Niestandardowe ustawienia Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Dezaktywuj wymaganie niezbędnej minimalnej ilości pamięci RAM (4GB+), Secure Boot i TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Usuń wymaganie konta Microsoft online\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Wyłącz zbieranie osobistych danych\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Zapobiegnij używania wewnętrznego magazynu danych przez Windows To Go\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Stwórz konto lokalne o nazwie użytkownika:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Ustaw taką samą lokalizację i wartości jak obecny użytkownik\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Dezaktywuj automatyczne szyfrowanie BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Stały dziennik (log)\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Dodatkowy plik (\\\"diskcopy.dll\\\") musi zostać pobrany od Microsoft, żeby zainstalować MS-DOS:\\n\"\n\"- Wybierz opcję \\\"Tak\\\", aby pobrać pliku z internetu\\n\"\n\"- Wybierz opcję \\\"Nie\\\", aby anulować operację\\n\"\n\"\\n\"\n\"Uwaga: Plik zostanie pobrany do folderu aplikacji i będzie użyty ponownie, gdy będzie dostępny.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Wykryto unieważniony bootloader UEFI\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus wykrył, że wybrany plik ISO zawiera bootloader UEFI, który został unieważniony, i który wygeneruje %s. gdy włączony zostanie \\\"Secure Boot\\\" w pełni zaktualizowanym systemie UEFI.\\n\"\n\"\\n\"\n\"- Jeśli uzyskałeś ten obraz ISO z niezaufanego źródła, powinieneś rozważyć możliwość, że może on zawierać złośliwe oprogramowanie dla UEFI i unikać jego uruchamiania.\\n\"\n\"- Jeśli uzyskałeś go z zaufanego źródła, powinieneś spróbować znaleźć nowszą wersję, która nie wygeneruje tego ostrzeżenia.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"ekran \\\"Naruszenie Bezpieczeństwa\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"\\\"Ekran odzyskiwania systemu Windows\\\" (BSOD) z '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Zkompresowany obraz VHDX\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Zdekompresowany obraz VHD\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Obraz typu \\\"aktualizacja full flush\\\"\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Aby móc korzystać z tej funkcji, należy pobrać pewne dodatkowe dane od firmy Microsoft:\\n\"\n\"- Wybierz opcję „Tak”, aby połączyć się z Internetem i pobrać plik\\n\"\n\"- Wybierz opcję „Nie”, aby anulować operację\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Ogranicz system Windows do trybu S (NIEZGODNY z obejściem konta online)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Tryb eksperta\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Wypakowywanie plików z archiwum: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Użyj Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus to narzędzie, które pomaga formatować i tworzyć dyski rozruchowe flash USB, takie jak klucze USB, pendrive-y itp.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Oficjalna strona: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Kod źródłowy: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Zmiany: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Ta aplikacja jest objęta licencją na warunkach licencji publicznej GNU (GPL) w wersji 3.\\n\"\n\"Z obacz https://www.gnu.org/licenses/gpl-3.0.html, aby uzyskać szczegółowe informacje.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Sformatuj nośnik używając: FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Stwórz nośnik rozruchowy USB FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Twórz dyski rozruchowe z obrazów ISO (Windows, Linux itp.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Twórz dyski rozruchowe z obrazów dysków, włączając skompresowane\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Stwórz dysk rozruchowy BIOS lub UEFI, włączając bootowalny dysk UEFI NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Stwórz dysk 'Windows To Go'\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Twórz dyski instalacyjne systemu Windows 11 dla komputerów, które nie posiadają modułu TPM ani Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Utwórz trwałe partycje Linux\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Stwórz obraz VHD/DD z wybranego dysku\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Oblicz sumy kontrolne MD5, SHA-1, SHA-256 i SHA-512 dla wybranego obrazu\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Sprawdź dysk pod względem spójności danych lub wykryj \\\"nieoryginalny\\\" pendrive\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Pobierz oficjalny obraz ISO systemu Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Ściągnij obrazy ISO UEFI Shell\"\n"
  },
  {
    "path": "res/loc/po/pt-BR.po",
    "content": "msgid \"\"\r\nmsgstr \"\"\r\n\"Project-Id-Version: 4.5\\n\"\r\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\r\n\"POT-Creation-Date: 2024-05-01 14:24-0300\\n\"\r\n\"PO-Revision-Date: 2024-05-04 12:06+0100\\n\"\r\n\"Last-Translator: \\n\"\r\n\"Language-Team: \\n\"\r\n\"Language: pt_BR\\n\"\r\n\"MIME-Version: 1.0\\n\"\r\n\"Content-Type: text/plain; charset=UTF-8\\n\"\r\n\"Content-Transfer-Encoding: 8bit\\n\"\r\n\"X-Poedit-SourceCharset: UTF-8\\n\"\r\n\"X-Rufus-LanguageName: Portuguese Brazilian (Português do Brasil)\\n\"\r\n\"X-Rufus-LCID: 0x0416\\n\"\r\n\"X-Generator: Poedit 3.4.2\\n\"\r\n\r\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\r\nmsgid \"Drive Properties\"\r\nmsgstr \"Propriedades do Drive\"\r\n\r\n#. • IDD_DIALOG → IDS_DEVICE_TXT\r\nmsgid \"Device\"\r\nmsgstr \"Dispositivo\"\r\n\r\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\r\nmsgid \"Boot selection\"\r\nmsgstr \"Seleção de Boot\"\r\n\r\n#. • IDD_DIALOG → IDC_SELECT\r\nmsgid \"Select\"\r\nmsgstr \"Selecionar\"\r\n\r\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\r\nmsgid \"Image Option\"\r\nmsgstr \"Opções da Imagem\"\r\n\r\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\r\nmsgid \"Partition scheme\"\r\nmsgstr \"Esquema de partição\"\r\n\r\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\r\nmsgid \"Target system\"\r\nmsgstr \"Sistema de destino\"\r\n\r\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\r\nmsgid \"List USB Hard Drives\"\r\nmsgstr \"Listar Discos Rígidos USB\"\r\n\r\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\r\n#.\r\n#. It is acceptable to drop the parenthesis () if you are running out of space\r\n#. as there is a tooltip (MSG_169) providing these details.\r\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\r\nmsgstr \"Opções de compatibilidade para BIOSs antigos\"\r\n\r\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\r\n#.\r\n#. It is acceptable to drop the \"runtime\" if you are running out of space\r\nmsgid \"Enable runtime UEFI media validation\"\r\nmsgstr \"Habilitar validação de mídia UEFI\"\r\n\r\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\r\nmsgid \"Format Options\"\r\nmsgstr \"Opções de formatação\"\r\n\r\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\r\nmsgid \"File system\"\r\nmsgstr \"Sistema de arquivos\"\r\n\r\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\r\nmsgid \"Cluster size\"\r\nmsgstr \"Tamanho do cluster\"\r\n\r\n#. • IDD_DIALOG → IDS_LABEL_TXT\r\nmsgid \"Volume label\"\r\nmsgstr \"Nome do volume\"\r\n\r\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\r\nmsgid \"Quick format\"\r\nmsgstr \"Formatação rápida\"\r\n\r\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\r\nmsgid \"Check device for bad blocks\"\r\nmsgstr \"Procurar blocos defeituosos\"\r\n\r\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\r\nmsgid \"Create extended label and icon files\"\r\nmsgstr \"Criar arquivos de nome estendido e ícone\"\r\n\r\n#. • IDD_DIALOG → IDS_STATUS_TXT\r\nmsgid \"Status\"\r\nmsgstr \"\"\r\n\r\n#. • IDD_DIALOG → IDCANCEL\r\n#. • IDD_LICENSE → IDCANCEL\r\n#. • IDD_LOG → IDCANCEL\r\n#. • IDD_UPDATE_POLICY → IDCANCEL\r\n#. • IDD_NEW_VERSION → IDCANCEL\r\n#. • MSG_006\r\nmsgid \"Close\"\r\nmsgstr \"Fechar\"\r\n\r\n#. • IDD_DIALOG → IDC_START\r\nmsgid \"Start\"\r\nmsgstr \"Iniciar\"\r\n\r\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\r\nmsgid \"About Rufus\"\r\nmsgstr \"Sobre o Rufus\"\r\n\r\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\r\nmsgid \"License\"\r\nmsgstr \"Licença\"\r\n\r\n#. • IDD_ABOUTBOX → IDOK\r\nmsgid \"OK\"\r\nmsgstr \"\"\r\n\r\n#. • IDD_LICENSE → IDD_LICENSE\r\nmsgid \"Rufus License\"\r\nmsgstr \"Licença do Rufus\"\r\n\r\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\r\nmsgid \"More information\"\r\nmsgstr \"Mais informações\"\r\n\r\n#. • IDD_NOTIFICATION → IDYES\r\n#. • MSG_008\r\nmsgid \"Yes\"\r\nmsgstr \"Sim\"\r\n\r\n#. • IDD_NOTIFICATION → IDNO\r\n#. • MSG_009\r\nmsgid \"No\"\r\nmsgstr \"Não\"\r\n\r\n#. • IDD_LOG → IDD_LOG\r\nmsgid \"Log\"\r\nmsgstr \"Histórico de eventos\"\r\n\r\n#. • IDD_LOG → IDC_LOG_CLEAR\r\nmsgid \"Clear\"\r\nmsgstr \"Limpar\"\r\n\r\n#. • IDD_LOG → IDC_LOG_SAVE\r\nmsgid \"Save\"\r\nmsgstr \"Guardar\"\r\n\r\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\r\nmsgid \"Update policy and settings\"\r\nmsgstr \"Configurações e política de atualização\"\r\n\r\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\r\nmsgid \"Settings\"\r\nmsgstr \"Configurações\"\r\n\r\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\r\nmsgid \"Check for updates\"\r\nmsgstr \"Procurar atualizações\"\r\n\r\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\r\nmsgid \"Include beta versions\"\r\nmsgstr \"Incluir versões beta\"\r\n\r\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\r\nmsgid \"Check Now\"\r\nmsgstr \"Procurar\"\r\n\r\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\r\nmsgid \"Check For Updates - Rufus\"\r\nmsgstr \"Procurar atualizações do Rufus\"\r\n\r\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\r\nmsgid \"A newer version is available. Please download the latest version!\"\r\nmsgstr \"Nova versão disponível. Por favor, faça o download da última versão!\"\r\n\r\n#. • IDD_NEW_VERSION → IDC_WEBSITE\r\nmsgid \"Click here to go to the website\"\r\nmsgstr \"Clique aqui para ir ao site do Rufus\"\r\n\r\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\r\nmsgid \"Release Notes\"\r\nmsgstr \"Notas de Lançamento\"\r\n\r\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\r\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\r\n#. • MSG_040\r\nmsgid \"Download\"\r\nmsgstr \"Baixar\"\r\n\r\n#. • MSG_001\r\nmsgid \"Other instance detected\"\r\nmsgstr \"Outra instância detectada\"\r\n\r\n#. • MSG_002\r\nmsgid \"\"\r\n\"Another Rufus application is running.\\n\"\r\n\"Please close the first application before running another one.\"\r\nmsgstr \"\"\r\n\"Outro aplicativo Rufus está em execução.\\n\"\r\n\"Feche o primeiro aplicativo antes de executar outro.\"\r\n\r\n#. • MSG_003\r\nmsgid \"\"\r\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\r\n\"To continue with this operation, click OK. To quit click CANCEL.\"\r\nmsgstr \"\"\r\n\"AVISO: TODOS OS DADOS EM %s SERÃO ELIMINADOS.\\n\"\r\n\"Para continuar, clique em OK. Para sair da operação, clique em CANCELAR.\"\r\n\r\n#. • MSG_004\r\nmsgid \"Rufus update policy\"\r\nmsgstr \"Política de atualização do Rufus\"\r\n\r\n#. • MSG_005\r\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\r\nmsgstr \"Permitir que o Rufus procure atualizações na Internet?\"\r\n\r\n#. • MSG_007\r\nmsgid \"Cancel\"\r\nmsgstr \"Cancelar\"\r\n\r\n#. • MSG_010\r\nmsgid \"Bad blocks found\"\r\nmsgstr \"Foram encontrados blocos defeituosos\"\r\n\r\n#. • MSG_011\r\nmsgid \"\"\r\n\"Check completed: %d bad block(s) found\\n\"\r\n\"  %d read error(s)\\n\"\r\n\"  %d write error(s)\\n\"\r\n\"  %d corruption error(s)\"\r\nmsgstr \"\"\r\n\"Verificação completada: %d bloco(s) defeituoso(s) encontrado(s)\\n\"\r\n\"  %d erros de leitura\\n\"\r\n\"  %d erros de gravação\\n\"\r\n\"  %d erros de corrupção\"\r\n\r\n#. • MSG_012\r\n#.\r\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\r\nmsgid \"\"\r\n\"%s\\n\"\r\n\"A more detailed report can be found in:\\n\"\r\n\"%s\"\r\nmsgstr \"\"\r\n\"%s\\n\"\r\n\"Mais informações disponíveis em:\\n\"\r\n\"%s\"\r\n\r\n#. • MSG_013\r\nmsgid \"Disabled\"\r\nmsgstr \"Desativado\"\r\n\r\n#. • MSG_014\r\nmsgid \"Daily\"\r\nmsgstr \"Diariamente\"\r\n\r\n#. • MSG_015\r\nmsgid \"Weekly\"\r\nmsgstr \"Semanalmente\"\r\n\r\n#. • MSG_016\r\nmsgid \"Monthly\"\r\nmsgstr \"Mensalmente\"\r\n\r\n#. • MSG_017\r\nmsgid \"Custom\"\r\nmsgstr \"Personalizado\"\r\n\r\n#. • MSG_018\r\nmsgid \"Your version: %d.%d (Build %d)\"\r\nmsgstr \"Sua versão: %d.%d (Build %d)\"\r\n\r\n#. • MSG_019\r\nmsgid \"Latest version: %d.%d (Build %d)\"\r\nmsgstr \"Última versão: %d.%d (Build %d)\"\r\n\r\n#. • MSG_020\r\n#. • MSG_026\r\nmsgid \"bytes\"\r\nmsgstr \"\"\r\n\r\n#. • MSG_021\r\n#.\r\n#. *Short* version of the kilobyte size suffix\r\nmsgid \"KB\"\r\nmsgstr \"\"\r\n\r\n#. • MSG_022\r\n#.\r\n#. *Short* version of the megabyte size suffix\r\nmsgid \"MB\"\r\nmsgstr \"\"\r\n\r\n#. • MSG_023\r\n#.\r\n#. *Short* version of the gigabyte size suffix\r\nmsgid \"GB\"\r\nmsgstr \"\"\r\n\r\n#. • MSG_024\r\n#.\r\n#. *Short* version of the terabyte size suffix\r\nmsgid \"TB\"\r\nmsgstr \"\"\r\n\r\n#. • MSG_025\r\n#.\r\n#. *Short* version of the pentabyte size suffix\r\nmsgid \"PB\"\r\nmsgstr \"\"\r\n\r\n#. • MSG_027\r\nmsgid \"kilobytes\"\r\nmsgstr \"quilobytes\"\r\n\r\n#. • MSG_028\r\nmsgid \"megabytes\"\r\nmsgstr \"\"\r\n\r\n#. • MSG_029\r\nmsgid \"Default\"\r\nmsgstr \"Padrão\"\r\n\r\n#. • MSG_030\r\n#.\r\n#. This gets appended to the file system, cluster size, etc.\r\nmsgid \"%s (Default)\"\r\nmsgstr \"%s (Padrão)\"\r\n\r\n#. • MSG_031\r\nmsgid \"BIOS (or UEFI-CSM)\"\r\nmsgstr \"BIOS (ou UEFI-CSM)\"\r\n\r\n#. • MSG_032\r\nmsgid \"UEFI (non CSM)\"\r\nmsgstr \"UEFI (não CSM)\"\r\n\r\n#. • MSG_033\r\nmsgid \"BIOS or UEFI\"\r\nmsgstr \"BIOS ou UEFI\"\r\n\r\n#. • MSG_034\r\n#.\r\n#. Number of bad block check passes (singular for 1 pass)\r\nmsgid \"%d pass\"\r\nmsgstr \"%d passada\"\r\n\r\n#. • MSG_035\r\n#.\r\n#. Number of bad block check passes (plural for 2 or more passes).\r\n#. See MSG_087 for the message that %s gets replaced with.\r\nmsgid \"%d passes %s\"\r\nmsgstr \"%d passadas %s\"\r\n\r\n#. • MSG_036\r\nmsgid \"ISO Image\"\r\nmsgstr \"Imagem ISO\"\r\n\r\n#. • MSG_037\r\nmsgid \"Application\"\r\nmsgstr \"Aplicativo\"\r\n\r\n#. • MSG_038\r\nmsgid \"Abort\"\r\nmsgstr \"Abortar\"\r\n\r\n#. • MSG_039\r\nmsgid \"Launch\"\r\nmsgstr \"Iniciar\"\r\n\r\n#. • MSG_041\r\nmsgid \"Operation cancelled by the user\"\r\nmsgstr \"Operação cancelada pelo usuário\"\r\n\r\n#. • MSG_042\r\nmsgid \"Error\"\r\nmsgstr \"Erro\"\r\n\r\n#. • MSG_043\r\nmsgid \"Error: %s\"\r\nmsgstr \"Erro: %s\"\r\n\r\n#. • MSG_044\r\nmsgid \"File download\"\r\nmsgstr \"Download do arquivo\"\r\n\r\n#. • MSG_045\r\nmsgid \"USB Storage Device (Generic)\"\r\nmsgstr \"Dispositivo de armazenamento USB (Genérico)\"\r\n\r\n#. • MSG_046\r\nmsgid \"%s (Disk %d) [%s]\"\r\nmsgstr \"%s (Disco %d) [%s]\"\r\n\r\n#. • MSG_047\r\n#.\r\n#. Used when a drive is detected that contains more than one partition\r\nmsgid \"Multiple Partitions\"\r\nmsgstr \"Múltiplas Partições\"\r\n\r\n#. • MSG_048\r\nmsgid \"Rufus - Flushing buffers\"\r\nmsgstr \"Rufus - Limpando buffers\"\r\n\r\n#. • MSG_049\r\nmsgid \"Rufus - Cancellation\"\r\nmsgstr \"Rufus - Cancelamento\"\r\n\r\n#. • MSG_050\r\nmsgid \"Success.\"\r\nmsgstr \"Sucesso.\"\r\n\r\n#. • MSG_051\r\nmsgid \"Undetermined error while formatting.\"\r\nmsgstr \"Erro indeterminado durante a formatação.\"\r\n\r\n#. • MSG_052\r\nmsgid \"Cannot use the selected file system for this media.\"\r\nmsgstr \"Não é possível usar o sistema de arquivos selecionado para esta mídia.\"\r\n\r\n#. • MSG_053\r\nmsgid \"Access to the device is denied.\"\r\nmsgstr \"Acesso ao dispositivo negado.\"\r\n\r\n#. • MSG_054\r\nmsgid \"Media is write protected.\"\r\nmsgstr \"A mídia está protegida contra gravação.\"\r\n\r\n#. • MSG_055\r\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\r\nmsgstr \"Outro processo está usando o dispositivo. Feche qualquer outro processo que possa estar acessando o dispositivo.\"\r\n\r\n#. • MSG_056\r\nmsgid \"Quick format is not available for this device.\"\r\nmsgstr \"Formatação rápida não está disponível para este dispositivo.\"\r\n\r\n#. • MSG_057\r\nmsgid \"The volume label is invalid.\"\r\nmsgstr \"O nome do volume não é válido.\"\r\n\r\n#. • MSG_058\r\nmsgid \"The device handle is invalid.\"\r\nmsgstr \"O identificador do dispositivo não é válido.\"\r\n\r\n#. • MSG_059\r\nmsgid \"The selected cluster size is not valid for this device.\"\r\nmsgstr \"O tamanho do cluster selecionado não é válido para este dispositivo.\"\r\n\r\n#. • MSG_060\r\nmsgid \"The volume size is invalid.\"\r\nmsgstr \"O tamanho do volume não é válido.\"\r\n\r\n#. • MSG_061\r\nmsgid \"Please insert a removable media in drive.\"\r\nmsgstr \"Por favor, insira uma mídia removível no drive.\"\r\n\r\n#. • MSG_062\r\nmsgid \"An unsupported command was received.\"\r\nmsgstr \"Comando não suportado.\"\r\n\r\n#. • MSG_063\r\nmsgid \"Memory allocation error.\"\r\nmsgstr \"Erro na alocação de memória.\"\r\n\r\n#. • MSG_064\r\nmsgid \"Read error.\"\r\nmsgstr \"Erro de leitura.\"\r\n\r\n#. • MSG_065\r\nmsgid \"Write error.\"\r\nmsgstr \"Erro de gravação.\"\r\n\r\n#. • MSG_066\r\nmsgid \"Installation failure\"\r\nmsgstr \"Falha na instalação\"\r\n\r\n#. • MSG_067\r\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\r\nmsgstr \"Impossível abrir a mídia. Ela pode estar sendo utilizada por outro processo. Por favor, reconecte a mídia e tente novamente.\"\r\n\r\n#. • MSG_068\r\nmsgid \"Could not partition drive.\"\r\nmsgstr \"Erro ao particionar o drive.\"\r\n\r\n#. • MSG_069\r\nmsgid \"Could not copy files to target drive.\"\r\nmsgstr \"Não é possível copiar arquivos para o drive de destino.\"\r\n\r\n#. • MSG_070\r\nmsgid \"Cancelled by user.\"\r\nmsgstr \"Cancelado pelo usuário.\"\r\n\r\n#. • MSG_071\r\n#.\r\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\r\nmsgid \"Unable to start thread.\"\r\nmsgstr \"Impossível iniciar thread.\"\r\n\r\n#. • MSG_072\r\nmsgid \"Bad blocks check didn't complete.\"\r\nmsgstr \"A verificação de blocos defeituosos foi interrompida.\"\r\n\r\n#. • MSG_073\r\nmsgid \"ISO image scan failure.\"\r\nmsgstr \"Falha na análise da imagem ISO.\"\r\n\r\n#. • MSG_074\r\nmsgid \"ISO image extraction failure.\"\r\nmsgstr \"Falha na extração da imagem ISO.\"\r\n\r\n#. • MSG_075\r\nmsgid \"Unable to remount volume.\"\r\nmsgstr \"Impossível remontar o volume.\"\r\n\r\n#. • MSG_076\r\nmsgid \"Unable to patch/setup files for boot.\"\r\nmsgstr \"Impossível corrigir/configurar arquivos para inicialização.\"\r\n\r\n#. • MSG_077\r\nmsgid \"Unable to assign a drive letter.\"\r\nmsgstr \"Impossível atribuir letra de unidade.\"\r\n\r\n#. • MSG_078\r\nmsgid \"Can't mount GUID volume.\"\r\nmsgstr \"Impossível montar o volume GUID.\"\r\n\r\n#. • MSG_079\r\nmsgid \"The device is not ready.\"\r\nmsgstr \"O dispositivo não está pronto.\"\r\n\r\n#. • MSG_080\r\nmsgid \"\"\r\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\r\n\"\\n\"\r\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\r\n\"\\n\"\r\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\r\nmsgstr \"\"\r\n\"O Rufus detectou que o Windows ainda está limpando seus buffers internos no dispositivo USB.\\n\"\r\n\"\\n\"\r\n\"Dependendo da velocidade do dispositivo USB, esta operação pode demorar muito tempo para terminar, especialmente para arquivos grandes.\\n\"\r\n\"\\n\"\r\n\"Recomendamos que espere o Windows terminar para evitar corrupção de dados. Mas, se já está cansado de esperar, você pode simplesmente desconectar o dispositivo...\"\r\n\r\n#. • MSG_081\r\nmsgid \"Unsupported image\"\r\nmsgstr \"Imagem não suportada\"\r\n\r\n#. • MSG_082\r\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\r\nmsgstr \"Esta imagem não é inicializável ou utiliza um método de inicialização ou compressão não suportado pelo Rufus...\"\r\n\r\n#. • MSG_083\r\nmsgid \"Replace %s?\"\r\nmsgstr \"Substituir %s?\"\r\n\r\n#. • MSG_084\r\nmsgid \"\"\r\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\r\n\"Boot menus may not display properly because of this.\\n\"\r\n\"\\n\"\r\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\r\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\r\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\r\n\"If you don't know what to do, you should select 'Yes'.\\n\"\r\n\"\\n\"\r\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\r\nmsgstr \"\"\r\n\"Parece que esta imagem ISO usa uma versão obsoleta do arquivo '%s'.\\n\"\r\n\"Isso pode fazer com que os menus de inicialização não sejam exibidos corretamente.\\n\"\r\n\"\\n\"\r\n\"O Rufus pode baixar uma versão mais recente para resolver esse problema:\\n\"\r\n\"- Selecione 'Sim' para se conectar à Internet e baixar o arquivo\\n\"\r\n\"- Selecione 'Não' para deixar o arquivo ISO tal como está\\n\"\r\n\"Se não sabe o que fazer, é recomendado selecionar 'Sim'.\\n\"\r\n\"\\n\"\r\n\"Nota: O novo arquivo será baixado na pasta atual e, caso exista um arquivo\\n\"\r\n\" '%s' nela, ele será reutilizado automaticamente.\"\r\n\r\n#. • MSG_085\r\nmsgid \"Downloading %s\"\r\nmsgstr \"Baixando %s\"\r\n\r\n#. • MSG_086\r\nmsgid \"No image selected\"\r\nmsgstr \"Nenhuma imagem ISO foi selecionada\"\r\n\r\n#. • MSG_087\r\n#.\r\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\r\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\r\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\r\n#. the translation as short as possible so that it won't result in an overly large dropdown...\r\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\r\n#. See also MSG_035.\r\nmsgid \"for %s NAND\"\r\nmsgstr \"para %s NAND\"\r\n\r\n#. • MSG_088\r\nmsgid \"Image is too big\"\r\nmsgstr \"Imagem é muito grande\"\r\n\r\n#. • MSG_089\r\nmsgid \"The image is too big for the selected target.\"\r\nmsgstr \"A imagem é muito grande para o destino selecionado.\"\r\n\r\n#. • MSG_090\r\nmsgid \"Unsupported ISO\"\r\nmsgstr \"ISO não suportada\"\r\n\r\n#. • MSG_091\r\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\r\nmsgstr \"Quando se usa UEFI como tipo de destino, só são suportadas imagens ISO inicializáveis do tipo EFI. Selecione uma imagem ISO inicializável do tipo EFI ou altere o tipo de destino para BIOS.\"\r\n\r\n#. • MSG_092\r\nmsgid \"Unsupported filesystem\"\r\nmsgstr \"Sistema de arquivos não suportado\"\r\n\r\n#. • MSG_093\r\nmsgid \"\"\r\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\r\n\"\\n\"\r\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\r\nmsgstr \"\"\r\n\"IMPORTANTE: ESTE DRIVE CONTÉM MÚLTIPLAS PARTIÇÕES!!\\n\"\r\n\"\\n\"\r\n\"Isso pode incluir partições/volumes que não estão listados, ou até mesmo visíveis para o Windows. Se você deseja prosseguir, você é responsável por qualquer perda de dados nessas partições.\"\r\n\r\n#. • MSG_094\r\nmsgid \"Multiple partitions detected\"\r\nmsgstr \"Múltiplas partições detectadas\"\r\n\r\n#. • MSG_095\r\nmsgid \"DD Image\"\r\nmsgstr \"Imagem DD\"\r\n\r\n#. • MSG_096\r\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\r\nmsgstr \"O sistema de arquivos selecionado não pode ser usado com este tipo de ISO. Por favor, selecione outro sistema de arquivos ou use outra ISO.\"\r\n\r\n#. • MSG_097\r\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\r\nmsgstr \"'%s' só pode ser aplicado se o sistema de arquivos for NTFS.\"\r\n\r\n#. • MSG_098\r\nmsgid \"\"\r\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\r\n\"\\n\"\r\n\"Do you still want to proceed?\\n\"\r\n\"\\n\"\r\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\r\nmsgstr \"\"\r\n\"IMPORTANTE: Você está tentando instalar 'Windows To Go', porém o drive de destino não tem o atributo 'FIXED'. Portanto, é possível que o Windows trave durante a inicialização, pois a Microsoft não o desenvolveu para funcionar em drives que, em lugar daquele, tenham o atributo 'REMOVABLE'. \\n\"\r\n\"\\n\"\r\n\"Você ainda deseja continuar?\\n\"\r\n\"\\n\"\r\n\"Nota: O atributo 'FIXED/REMOVABLE' é uma propriedade do hardware que só pode ser alterada utilizando-se ferramentas personalizadas do fabricante do drive. No entanto, essas ferramentas QUASE NUNCA são disponibilizadas para o público...\"\r\n\r\n#. • MSG_099\r\nmsgid \"Filesystem limitation\"\r\nmsgstr \"Limitação do sistema de arquivos\"\r\n\r\n#. • MSG_100\r\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\r\nmsgstr \"Essa imagem ISO contém um arquivo maior que 4 GB, que é mais que o tamanho máximo permitido para um sistema de arquivos FAT ou FAT32.\"\r\n\r\n#. • MSG_101\r\nmsgid \"Missing WIM support\"\r\nmsgstr \"Falta o suporte para WIM\"\r\n\r\n#. • MSG_102\r\nmsgid \"\"\r\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\r\n\"Do you want to visit the 7-zip download page?\"\r\nmsgstr \"\"\r\n\"A sua plataforma não pode extrair arquivos de arquivos WIM. A extração de WIM é requerida para criar dispositivos USB inicializáveis do tipo EFI com Windows 7 e Windows Vista. Você pode corrigir isso instalando uma versão recente do 7-Zip.\\n\"\r\n\"Quer visitar a página de download do 7-zip?\"\r\n\r\n#. • MSG_103\r\nmsgid \"Download %s?\"\r\nmsgstr \"Baixar %s?\"\r\n\r\n#. • MSG_104\r\n#.\r\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\r\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\r\nmsgid \"\"\r\n\"%s or later requires a '%s' file to be installed.\\n\"\r\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\r\n\"\\n\"\r\n\"Rufus can download the missing file for you:\\n\"\r\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\r\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\r\n\"\\n\"\r\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\r\nmsgstr \"\"\r\n\"%s ou posterior requer que esteja instalado um arquivo '%s'.\\n\"\r\n\"Uma vez que este arquivo tem mais de 100 KB e está sempre presente nas \\n\"\r\n\"imagens ISO %s, o Rufus não o inclui na sua distribuição.\\n\"\r\n\"\\n\"\r\n\"O Rufus pode baixar o arquivo em falta:\\n\"\r\n\"- Selecione 'Sim' para se conectar à Internet e baixar o arquivo\\n\"\r\n\"- Selecione 'Não' se deseja copiar manualmente esse arquivo para o drive mais tarde\\n\"\r\n\"\\n\"\r\n\"Nota: O arquivo será baixado na pasta atual e, caso exista um \\n\"\r\n\" arquivo '%s' nela, ele será reutilizado automaticamente.\"\r\n\r\n#. • MSG_105\r\nmsgid \"\"\r\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\r\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\r\nmsgstr \"\"\r\n\"Cancelar agora pode deixar o dispositivo INUTILIZÁVEL.\\n\"\r\n\"Se quer mesmo cancelar, clique em SIM. Caso contrário, clique em NÃO.\"\r\n\r\n#. • MSG_106\r\nmsgid \"Please select folder\"\r\nmsgstr \"Selecione a pasta\"\r\n\r\n#. • MSG_107\r\nmsgid \"All files\"\r\nmsgstr \"Todos os arquivos\"\r\n\r\n#. • MSG_108\r\nmsgid \"Rufus log\"\r\nmsgstr \"Registro de eventos do Rufus\"\r\n\r\n#. • MSG_109\r\nmsgid \"0x%02X (Disk %d)\"\r\nmsgstr \"0x%02X (Disco %d)\"\r\n\r\n#. • MSG_110\r\n#.\r\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\r\n#. \"kilobytes\" should be the same as in MSG_027\r\nmsgid \"\"\r\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\r\n\"Please change the Cluster size or use FreeDOS.\"\r\nmsgstr \"\"\r\n\"O MS-DOS não se inicializa a partir de um drive com um Tamanho do cluster de 64 quilobytes.\\n\"\r\n\"Por favor, altere o Tamanho do cluster ou use o FreeDOS.\"\r\n\r\n#. • MSG_111\r\nmsgid \"Incompatible Cluster size\"\r\nmsgstr \"Tamanho do cluster incompatível\"\r\n\r\n#. • MSG_112\r\n#.\r\n#. \"%d:%02d\" is a duration (mins:secs)\r\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\r\nmsgstr \"Formatar um volume UDF de tamanho grande pode demorar muito tempo. À velocidade de USB 2.0, o tempo estimado de formatação é de %d:%02d, durante o qual a barra de progresso parecerá congelada. Por favor, seja paciente!\"\r\n\r\n#. • MSG_113\r\nmsgid \"Large UDF volume\"\r\nmsgstr \"Volume UDF de tamanho grande\"\r\n\r\n#. • MSG_114\r\nmsgid \"\"\r\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\r\n\"\\n\"\r\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\r\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\r\n\"- Select 'No' to cancel the operation\\n\"\r\n\"\\n\"\r\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\r\nmsgstr \"\"\r\n\"Esta imagem usa Syslinux %s%s, mas este aplicativo inclui somente os arquivos de instalação para Syslinux %s%s.\\n\"\r\n\"\\n\"\r\n\"Como novas versões de Syslinux não são compatíveis entre si, e não seria seja possível para o Rufus incluir todas elas, dois arquivos adicionais devem ser baixados a partir da Internet ('ldlinux.sys' e 'ldlinux.bss'):\\n\"\r\n\"- Selecione 'Sim' para se conectar à Internet e baixar esses arquivos\\n\"\r\n\"- Selecione 'Não' para cancelar a operação\\n\"\r\n\"\\n\"\r\n\"Nota: Os arquivos serão baixados no diretório atual do aplicativo e serão reutilizados automaticamente se estiverem presentes.\"\r\n\r\n#. • MSG_115\r\nmsgid \"Download required\"\r\nmsgstr \"Download necessário\"\r\n\r\n#. • MSG_116\r\n#.\r\n#. You should be able to test this message with Super Grub2 Disk ISO:\r\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\r\nmsgid \"\"\r\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\r\n\"\\n\"\r\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\r\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\r\n\"- Select 'No' to use the default version from Rufus\\n\"\r\n\"- Select 'Cancel' to abort the operation\\n\"\r\n\"\\n\"\r\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\r\nmsgstr \"\"\r\n\"Esta imagem usa o Grub %s, mas este aplicativo inclui somente os arquivos de instalação para Grub %s.\\n\"\r\n\"\\n\"\r\n\"Como novas versões do Grub podem não ser compatíveis entre si, e que não é possível incluí-las todas, o Rufus tentará localizar uma versão do arquivo de instalação do Grub ('core.img') que corresponda ao da sua imagem:\\n\"\r\n\"- Selecione 'Sim' para se conectar à Internet e tentar baixá-lo\\n\"\r\n\"- Selecione 'Não' para usar a versão padrão do Rufus\\n\"\r\n\"- Selecione 'Cancelar' para abortar a operação\\n\"\r\n\"\\n\"\r\n\"Nota: O arquivo será baixado no diretório atual do aplicativo e será reutilizado automaticamente se estiver presente. Se nenhum arquivo correspondente puder ser encontrado online, será usada a versão padrão.\"\r\n\r\n#. • MSG_117\r\nmsgid \"Standard Windows installation\"\r\nmsgstr \"Instalação padrão do Windows\"\r\n\r\n#. • MSG_118\r\n#.\r\n#. Only translate this message *if* Microsoft has a specific name for\r\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\r\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\r\nmsgid \"Windows To Go\"\r\nmsgstr \"\"\r\n\r\n#. • MSG_119\r\nmsgid \"advanced drive properties\"\r\nmsgstr \"propriedades avançadas do drive\"\r\n\r\n#. • MSG_120\r\nmsgid \"advanced format options\"\r\nmsgstr \"opções avançadas de formatação\"\r\n\r\n#. • MSG_121\r\nmsgid \"Show %s\"\r\nmsgstr \"Exibir %s\"\r\n\r\n#. • MSG_122\r\nmsgid \"Hide %s\"\r\nmsgstr \"Esconder %s\"\r\n\r\n#. • MSG_123\r\n#.\r\n#. A persistent partitions can be used with \"Live\" USB media to store data.\r\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\r\n#. To test this feature, please download and select 'casper_test.iso' from:\r\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\r\nmsgid \"Persistent partition size\"\r\nmsgstr \"Tamanho da partição persistente\"\r\n\r\n#. • MSG_124\r\n#.\r\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\r\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\r\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\r\nmsgid \"No persistence\"\r\nmsgstr \"Sem persistência\"\r\n\r\n#. • MSG_125\r\n#.\r\n#. Tooltips used for the peristence size slider and edit control\r\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\r\nmsgstr \"Defina o tamanho da partição persistente para mídia USB ativa. Definir o tamanho como 0 desativa a partição persistente.\"\r\n\r\n#. • MSG_126\r\nmsgid \"Set the partition size units.\"\r\nmsgstr \"Defina as unidades de tamanho da partição.\"\r\n\r\n#. • MSG_127\r\nmsgid \"Do not show this message again\"\r\nmsgstr \"Não mostrar esta mensagem novamente\"\r\n\r\n#. • MSG_128\r\nmsgid \"Important notice about %s\"\r\nmsgstr \"Aviso importante sobre %s\"\r\n\r\n#. • MSG_129\r\nmsgid \"\"\r\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\r\n\"For details on why this is necessary, see the 'More Information' button below.\"\r\nmsgstr \"\"\r\n\"Você acabou de criar uma mídia que usa o carregador de inicialização UEFI: NTFS. Lembre-se de que, para inicializar esta mídia, VOCÊ DEVE DESABILITAR O BOOT SEGURO.\\n\"\r\n\"Para detalhes sobre por que isso é necessário, consulte o botão \\\"Mais informações\\\" abaixo.\"\r\n\r\n#. • MSG_130\r\nmsgid \"Windows image selection\"\r\nmsgstr \"Seleção de imagem do Windows\"\r\n\r\n#. • MSG_131\r\nmsgid \"\"\r\n\"This ISO contains multiple Windows images.\\n\"\r\n\"Please select the image you wish to use for this installation:\"\r\nmsgstr \"\"\r\n\"Este ISO contém várias imagens do Windows.\\n\"\r\n\"Por favor, selecione a imagem que você deseja usar para esta instalação:\"\r\n\r\n#. • MSG_132\r\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\r\nmsgstr \"Outro programa ou processo está acessando esta unidade. Você quer formatá-lo mesmo assim?\"\r\n\r\n#. • MSG_133\r\nmsgid \"\"\r\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\r\n\"\\n\"\r\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\r\n\"\\n\"\r\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\r\nmsgstr \"\"\r\n\"Rufus detectou que você está tentando criar uma mídia do Windows To Go com base em uma ISO 1809.\\n\"\r\n\"Devido a um *MICROSOFT BUG*, esta mídia irá travar durante a inicialização do Windows (Tela Azul da Morte), a menos que você substitua manualmente o arquivo 'WppRecorder.sys' por uma versão 1803.\\n\"\r\n\"Observe também que a razão pela qual o Rufus não pode corrigir isso automaticamente para você é que 'WppRecorder.sys' é um arquivo protegido por direitos autorais da Microsoft, portanto, não podemos incorporar legalmente uma cópia do arquivo no aplicativo...\"\r\n\r\n#. • MSG_134\r\nmsgid \"\"\r\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\r\n\"\\n\"\r\n\"Are you sure you want to continue?\"\r\nmsgstr \"\"\r\n\"Como o MBR foi selecionado para o esquema de partição, o Rufus só pode criar uma partição de até 2 TB nessa mídia, o que deixará %s de espaço em disco indisponível.\\n\"\r\n\"\\n\"\r\n\"Você tem certeza que quer continuar?\"\r\n\r\n#. • MSG_135\r\nmsgid \"Version\"\r\nmsgstr \"Versão\"\r\n\r\n#. • MSG_136\r\nmsgid \"Release\"\r\nmsgstr \"Lançamento\"\r\n\r\n#. • MSG_137\r\nmsgid \"Edition\"\r\nmsgstr \"Edição\"\r\n\r\n#. • MSG_138\r\nmsgid \"Language\"\r\nmsgstr \"Idioma\"\r\n\r\n#. • MSG_139\r\nmsgid \"Architecture\"\r\nmsgstr \"Arquitetura\"\r\n\r\n#. • MSG_140\r\nmsgid \"Continue\"\r\nmsgstr \"Continuar\"\r\n\r\n#. • MSG_141\r\nmsgid \"Back\"\r\nmsgstr \"Voltar\"\r\n\r\n#. • MSG_142\r\nmsgid \"Please wait...\"\r\nmsgstr \"Por favor, aguarde...\"\r\n\r\n#. • MSG_143\r\nmsgid \"Download using a browser\"\r\nmsgstr \"Baixar usando um navegador\"\r\n\r\n#. • MSG_144\r\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\r\nmsgstr \"Download de ISOs do Windows não está disponível porque a Microsoft alterou o seu site para evitá-lo.\"\r\n\r\n#. • MSG_145\r\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\r\nmsgstr \"PowerShell 3.0 ou superior é requerido para rodar esse script.\"\r\n\r\n#. • MSG_146\r\nmsgid \"Do you want to go online and download it?\"\r\nmsgstr \"Deseja ir online e baixar?\"\r\n\r\n#. • MSG_148\r\nmsgid \"Running download script...\"\r\nmsgstr \"Rodando o script de download...\"\r\n\r\n#. • MSG_149\r\nmsgid \"Download ISO Image\"\r\nmsgstr \"Baixar imagem ISO\"\r\n\r\n#. • MSG_150\r\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\r\nmsgstr \"Tipo de computador no qual deseja utilizar o disco de inicialização. É de sua responsabilidade determinar se o destino utiliza BIOS ou UEFI antes de começar a criar um disco, caso contrário poderá haver falhas.\"\r\n\r\n#. • MSG_151\r\n#.\r\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\r\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\r\nmsgstr \"'UEFI-CSM' significa que o dispositivo apenas irá inicializar no modo BIOS emulação (também conhecido como 'Legacy Mode') quando UEFI, e não UEFI nativo.\"\r\n\r\n#. • MSG_152\r\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\r\nmsgstr \"'não CSM' significa que o dispositivo irá inicializar apenas no modo UEFI nativo, e não no modo BIOS emulação (também conhecido como 'Legacy Mode').\"\r\n\r\n#. • MSG_153\r\nmsgid \"Test pattern: 0x%02X\"\r\nmsgstr \"Padrão de teste: 0x%02X\"\r\n\r\n#. • MSG_154\r\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\r\nmsgstr \"Padrão de teste: 0x%02X, 0x%02X\"\r\n\r\n#. • MSG_155\r\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\r\nmsgstr \"Padrão de teste: 0x%02X, 0x%02X, 0x%02X\"\r\n\r\n#. • MSG_156\r\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nmsgstr \"Padrão de teste: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\n\r\n#. • MSG_157\r\nmsgid \"Sets the target filesystem\"\r\nmsgstr \"Define o sistema de arquivos de destino\"\r\n\r\n#. • MSG_158\r\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\r\nmsgstr \"Tamanho mínimo que um bloco de dados ocupará no sistema de arquivos\"\r\n\r\n#. • MSG_159\r\nmsgid \"\"\r\n\"Use this field to set the drive label.\\n\"\r\n\"International characters are accepted.\"\r\nmsgstr \"\"\r\n\"Use este campo para definir o nome do drive.\\n\"\r\n\"Caracteres acentuados são aceitos.\"\r\n\r\n#. • MSG_160\r\nmsgid \"Toggle advanced options\"\r\nmsgstr \"Exibir opções avançadas\"\r\n\r\n#. • MSG_161\r\nmsgid \"Check the device for bad blocks using a test pattern\"\r\nmsgstr \"Verificar o dispositivo para blocos defeituosos usando um padrão de teste\"\r\n\r\n#. • MSG_162\r\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\r\nmsgstr \"Desmarque esta opção para usar o método de formatação \\\"lento\\\"\"\r\n\r\n#. • MSG_163\r\nmsgid \"Method that will be used to create partitions\"\r\nmsgstr \"Método que será usado para criar partições\"\r\n\r\n#. • MSG_164\r\nmsgid \"Method that will be used to make the drive bootable\"\r\nmsgstr \"Método que será usado para tornar a unidade inicializável\"\r\n\r\n#. • MSG_165\r\nmsgid \"Click to select or download an image...\"\r\nmsgstr \"Clique para selecionar ou baixar uma imagem...\"\r\n\r\n#. • MSG_166\r\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\r\nmsgstr \"Selecione esta opção para permitir a exibição de caracteres acentuados e atribuir um ícone para a unidade (cria um arquivo autorun.inf)\"\r\n\r\n#. • MSG_167\r\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\r\nmsgstr \"Instalar um carregador de inicialização que realizará validação da mídia usando MD5Sum\"\r\n\r\n#. • MSG_169\r\nmsgid \"\"\r\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\r\n\"This can improve boot detection for older BIOSes.\"\r\nmsgstr \"\"\r\n\"Criar uma partição oculta extra e tentar alinhar os limites das partições.\\n\"\r\n\"Isso pode melhorar a detecção de inicialização para BIOSs mais antigos.\"\r\n\r\n#. • MSG_170\r\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\r\nmsgstr \"Ativar a listagem de discos rígidos portáteis USB. USE POR SUA CONTA E RISCO!!!\"\r\n\r\n#. • MSG_171\r\nmsgid \"\"\r\n\"Start the formatting operation.\\n\"\r\n\"This will DESTROY any data on the target!\"\r\nmsgstr \"\"\r\n\"Iniciar a operação de formatação.\\n\"\r\n\"Todos os dados no dispositivo serão DESTRUÍDOS!\"\r\n\r\n#. • MSG_172\r\n#.\r\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\r\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\r\nmsgid \"Invalid download signature\"\r\nmsgstr \"Assinatura do download inválida\"\r\n\r\n#. • MSG_173\r\nmsgid \"Click to select...\"\r\nmsgstr \"Clique para selecionar...\"\r\n\r\n#. • MSG_174\r\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\r\nmsgstr \"Rufus - O Utilitário de Formatação USB Confiável\"\r\n\r\n#. • MSG_175\r\nmsgid \"Version %d.%d (Build %d)\"\r\nmsgstr \"Versão %d.%d (Build %d)\"\r\n\r\n#. • MSG_176\r\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\r\nmsgstr \"Tradutores:\\\\line• Tiago Rinaldi <mailto:trinaldi@gmail.com>\\\\line• Chateaubriand Vieira Moura <mailto:chateaubriand@ifse.com.br>\\\\line• Maison da Silva <mailto:maisonmdsgreen@hotmail.com>\\\\line• Marcos Mello <mailto:marcosfrm@gmail.com>\"\r\n\r\n#. • MSG_177\r\nmsgid \"Report bugs or request enhancements at:\"\r\nmsgstr \"Relate bugs ou solicite aprimoramentos em:\"\r\n\r\n#. • MSG_178\r\nmsgid \"Additional Copyrights:\"\r\nmsgstr \"Direitos Autorais Adicionais:\"\r\n\r\n#. • MSG_179\r\nmsgid \"Update Policy:\"\r\nmsgstr \"Política de Atualização:\"\r\n\r\n#. • MSG_180\r\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\r\nmsgstr \"Se você optar por permitir que este programa verifique se há atualizações do aplicativo, você concorda que as seguintes informações possam ser coletadas em nosso(s) servidor(es):\"\r\n\r\n#. • MSG_181\r\nmsgid \"Your operating system's architecture and version\"\r\nmsgstr \"A arquitetura e versão do seu sistema operacional\"\r\n\r\n#. • MSG_182\r\nmsgid \"The version of the application you use\"\r\nmsgstr \"A versão do aplicativo que você usa\"\r\n\r\n#. • MSG_183\r\nmsgid \"Your IP address\"\r\nmsgstr \"Seu endereço de IP\"\r\n\r\n#. • MSG_184\r\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\r\nmsgstr \"A fim de gerar estatísticas de uso privadas, as informações recolhidas podem ser retidas, \\\\b por até um ano\\\\b0 . A menos que assim seja requerido por lei, não será transmitida nenhuma dessas informações a terceiros.\"\r\n\r\n#. • MSG_185\r\nmsgid \"Update Process:\"\r\nmsgstr \"Processo de Atualização:\"\r\n\r\n#. • MSG_186\r\nmsgid \"\"\r\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\r\n\"Internet access is of course required when checking for updates.\"\r\nmsgstr \"\"\r\n\"O Rufus não instala nem executa serviços em segundo plano. Portanto, as verificações de atualização só se realizam quando o aplicativo principal está em execução.\\\\line\\n\"\r\n\"O acesso à Internet, é claro, é necessário ao verificar atualizações.\"\r\n\r\n#. • MSG_187\r\nmsgid \"Invalid image for selected boot option\"\r\nmsgstr \"Imagem inválida para a opção de inicialização selecionada\"\r\n\r\n#. • MSG_188\r\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\r\nmsgstr \"A imagem atual não combina com a opção de inicialização selecionada. Por favor, use uma imagem diferente ou escolha uma opção de inicialização diferente.\"\r\n\r\n#. • MSG_189\r\nmsgid \"This ISO image is not compatible with the selected filesystem\"\r\nmsgstr \"Esta imagem ISO não é compatível com o sistema de arquivos selecionado\"\r\n\r\n#. • MSG_190\r\nmsgid \"Incompatible drive detected\"\r\nmsgstr \"Drive incompatível detectado\"\r\n\r\n#. • MSG_191\r\n#.\r\n#. Used in MSG_235\r\nmsgid \"Write pass\"\r\nmsgstr \"Verificação de escrita\"\r\n\r\n#. • MSG_192\r\n#.\r\n#. Used in MSG_235\r\nmsgid \"Read pass\"\r\nmsgstr \"Verificação de leitura\"\r\n\r\n#. • MSG_193\r\nmsgid \"Downloaded %s\"\r\nmsgstr \"Baixado(s) %s\"\r\n\r\n#. • MSG_194\r\nmsgid \"Could not download %s\"\r\nmsgstr \"Não foi possível baixar %s\"\r\n\r\n#. • MSG_195\r\n#.\r\n#. Example: \"Using embedded version of Grub2 file(s)\"\r\nmsgid \"Using embedded version of %s file(s)\"\r\nmsgstr \"Usando a versão incorporada do(s) arquivo(s) %s\"\r\n\r\n#. • MSG_196\r\nmsgid \"\"\r\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\r\n\"\\n\"\r\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\r\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\r\nmsgstr \"\"\r\n\"IMPORTANTE: ESTE DRIVE USA UM TAMANHO DE SETOR FORA DO PADRÃO!\\n\"\r\n\"\\n\"\r\n\"Drives convencionais usam um tamanho de setor de 512 bytes, mas este usa um de %d bytes. Em muitos casos, isso significa que você NÃO poderá inicializar a partir deste drive.\\n\"\r\n\"O Rufus pode tentar criar um drive inicializável, mas não há NENHUMA garantia de que ele funcionará.\"\r\n\r\n#. • MSG_197\r\nmsgid \"Nonstandard sector size detected\"\r\nmsgstr \"Detectado tamanho de setor fora do padrão\"\r\n\r\n#. • MSG_198\r\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\r\nmsgstr \"'Windows To Go' só pode ser instalado em um drive particionado como GPT se ele tiver o atributo FIXO ativo. O drive atual não apresenta o atributo FIXO.\"\r\n\r\n#. • MSG_199\r\nmsgid \"This feature is not available on this platform.\"\r\nmsgstr \"Este recurso não está disponível nesta plataforma.\"\r\n\r\n#. • MSG_201\r\nmsgid \"Cancelling - Please wait...\"\r\nmsgstr \"Cancelando - Por favor, aguarde...\"\r\n\r\n#. • MSG_202\r\nmsgid \"Scanning image...\"\r\nmsgstr \"Escaneando a imagem...\"\r\n\r\n#. • MSG_203\r\nmsgid \"Failed to scan image\"\r\nmsgstr \"Falha ao escanear a imagem\"\r\n\r\n#. • MSG_204\r\n#.\r\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\r\nmsgid \"Obsolete %s detected\"\r\nmsgstr \"%s obsoleto detectado\"\r\n\r\n#. • MSG_205\r\n#.\r\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\r\nmsgid \"Using image: %s\"\r\nmsgstr \"Usando a imagem: %s\"\r\n\r\n#. • MSG_206\r\n#.\r\n#. Example: \"Missing ldlinux.c32 file\"\r\nmsgid \"Missing %s file\"\r\nmsgstr \"Falta o arquivo %s\"\r\n\r\n#. • MSG_207\r\n#.\r\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\r\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\r\nmsgid \"New Volume\"\r\nmsgstr \"Novo Volume\"\r\n\r\n#. • MSG_208\r\n#.\r\n#. Singular. Example: \"1 device found\"\r\nmsgid \"%d device found\"\r\nmsgstr \"%d dispositivo encontrado\"\r\n\r\n#. • MSG_209\r\n#.\r\n#. Plural. Example: \"3 devices found\"\r\nmsgid \"%d devices found\"\r\nmsgstr \"%d dispositivos encontrados\"\r\n\r\n#. • MSG_210\r\nmsgid \"READY\"\r\nmsgstr \"PRONTO\"\r\n\r\n#. • MSG_211\r\nmsgid \"Cancelled\"\r\nmsgstr \"Operação cancelada\"\r\n\r\n#. • MSG_212\r\nmsgid \"Failed\"\r\nmsgstr \"A operação falhou\"\r\n\r\n#. • MSG_213\r\n#.\r\n#. Used when a new update has been downloaded and launched\r\nmsgid \"Launching new application...\"\r\nmsgstr \"Iniciando o novo aplicativo...\"\r\n\r\n#. • MSG_214\r\nmsgid \"Failed to launch new application\"\r\nmsgstr \"Falha ao iniciar o novo aplicativo\"\r\n\r\n#. • MSG_215\r\n#.\r\n#. Example: \"Opened some_file.txt\"\r\nmsgid \"Opened %s\"\r\nmsgstr \"%s aberto\"\r\n\r\n#. • MSG_216\r\n#.\r\n#. Example: \"Saved rufus.log\"\r\nmsgid \"Saved %s\"\r\nmsgstr \"%s salvo\"\r\n\r\n#. • MSG_217\r\n#.\r\n#. Formatting status\r\nmsgid \"Formatting: %s\"\r\nmsgstr \"Formatando: %s\"\r\n\r\n#. • MSG_218\r\nmsgid \"Creating file system: Task %d/%d completed\"\r\nmsgstr \"Criando sistema de arquivos: Tarefa %d/%d completada\"\r\n\r\n#. • MSG_219\r\nmsgid \"NTFS Fixup: %d%% completed\"\r\nmsgstr \"Reparo do NTFS: %d%% completado(s)\"\r\n\r\n#. • MSG_220\r\n#.\r\n#. Parameter: the file system and an estimated duration in mins and secs.\r\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\r\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\r\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\r\nmsgstr \"Formatando (%s) - duração estimada %d:%02d...\"\r\n\r\n#. • MSG_221\r\nmsgid \"Setting label (%s)...\"\r\nmsgstr \"Atribuindo o nome do volume (%s)...\"\r\n\r\n#. • MSG_222\r\n#.\r\n#. Example: \"Formatting (FAT32)...\"\r\nmsgid \"Formatting (%s)...\"\r\nmsgstr \"Formatando (%s)...\"\r\n\r\n#. • MSG_223\r\nmsgid \"NTFS Fixup (Checkdisk)...\"\r\nmsgstr \"Reparo do NTFS (Checkdisk)...\"\r\n\r\n#. • MSG_224\r\nmsgid \"Clearing MBR/PBR/GPT structures...\"\r\nmsgstr \"Apagando as estruturas MBR/PBR/GPT...\"\r\n\r\n#. • MSG_225\r\nmsgid \"Requesting disk access...\"\r\nmsgstr \"Solicitando acesso ao disco...\"\r\n\r\n#. • MSG_226\r\nmsgid \"Analyzing existing boot records...\"\r\nmsgstr \"Analisando registros de inicialização existentes...\"\r\n\r\n#. • MSG_227\r\nmsgid \"Closing existing volume...\"\r\nmsgstr \"Fechando o volume existente...\"\r\n\r\n#. • MSG_228\r\nmsgid \"Writing Master Boot Record...\"\r\nmsgstr \"Escrevendo o registro mestre de inicialização (Master Boot Record)...\"\r\n\r\n#. • MSG_229\r\nmsgid \"Writing Partition Boot Record...\"\r\nmsgstr \"Escrevendo o registro de inicialização de partição (Partition Boot Record)...\"\r\n\r\n#. • MSG_230\r\nmsgid \"Copying DOS files...\"\r\nmsgstr \"Copiando arquivos do DOS...\"\r\n\r\n#. • MSG_231\r\nmsgid \"Copying ISO files: %s\"\r\nmsgstr \"Copiando arquivos da ISO: %s\"\r\n\r\n#. • MSG_232\r\nmsgid \"Win7 EFI boot setup (%s)...\"\r\nmsgstr \"Configuração de inicialização EFI do Win7 (%s)...\"\r\n\r\n#. • MSG_233\r\nmsgid \"Finalizing, please wait...\"\r\nmsgstr \"Finalizando, por favor aguarde...\"\r\n\r\n#. • MSG_234\r\n#.\r\n#. Takes a Syslinux version as parameter.\r\n#. Example: \"Installing Syslinux v5.10...\"\r\nmsgid \"Installing Syslinux %s...\"\r\nmsgstr \"Instalando Syslinux %d...\"\r\n\r\n#. • MSG_235\r\n#.\r\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\r\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\r\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\r\nmsgstr \"Blocos Defeituosos: %s %d/%d - %0.2f%% (%d/%d/%d erros)\"\r\n\r\n#. • MSG_236\r\nmsgid \"Bad Blocks: Testing with random pattern\"\r\nmsgstr \"Blocos Defeituosos: Testando com padrão aleatório\"\r\n\r\n#. • MSG_237\r\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\r\nmsgstr \"Blocos Defeituosos: Testando com padrão 0x%02X\"\r\n\r\n#. • MSG_238\r\n#.\r\n#. Example: \"Partitioning (MBR)...\"\r\nmsgid \"Partitioning (%s)...\"\r\nmsgstr \"Particionando (%s)...\"\r\n\r\n#. • MSG_239\r\nmsgid \"Deleting partitions (%s)...\"\r\nmsgstr \"Apagando partições (%s)...\"\r\n\r\n#. • MSG_240\r\n#.\r\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\r\nmsgid \"\"\r\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\r\n\"\\n\"\r\n\"The download will be deleted. Please check the log for more details.\"\r\nmsgstr \"\"\r\n\"A assinatura da atualização baixada não pode ser validada. Isso pode significar que seu sistema está configurado incorretamente para validação de assinatura ou indica um download malicioso.\\n\"\r\n\"\\n\"\r\n\"O download será excluído. Verifique o registro para obter mais detalhes.\"\r\n\r\n#. • MSG_241\r\nmsgid \"Downloading: %s\"\r\nmsgstr \"Baixando: %s\"\r\n\r\n#. • MSG_242\r\nmsgid \"Failed to download file.\"\r\nmsgstr \"Falha ao baixar o arquivo.\"\r\n\r\n#. • MSG_243\r\nmsgid \"Checking for Rufus updates...\"\r\nmsgstr \"Procurando atualizações do Rufus...\"\r\n\r\n#. • MSG_244\r\nmsgid \"Updates: Unable to connect to the internet\"\r\nmsgstr \"Atualizações: Não é possível conectar-se à Internet\"\r\n\r\n#. • MSG_245\r\nmsgid \"Updates: Unable to access version data\"\r\nmsgstr \"Atualizações: Não foi possível acessar dados da versão\"\r\n\r\n#. • MSG_246\r\nmsgid \"A new version of Rufus is available!\"\r\nmsgstr \"Uma nova versão do Rufus está disponível!\"\r\n\r\n#. • MSG_247\r\nmsgid \"No new version of Rufus was found\"\r\nmsgstr \"Nenhuma nova versão do Rufus foi encontrada\"\r\n\r\n#. • MSG_248\r\nmsgid \"Application registry keys successfully deleted\"\r\nmsgstr \"As chaves de registro do aplicativo foram apagadas com êxito\"\r\n\r\n#. • MSG_249\r\nmsgid \"Failed to delete application registry keys\"\r\nmsgstr \"Falha ao apagar as chaves de registro do aplicativo\"\r\n\r\n#. • MSG_250\r\n#.\r\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\r\nmsgid \"%s enabled\"\r\nmsgstr \"%s ativado(a)\"\r\n\r\n#. • MSG_251\r\nmsgid \"%s disabled\"\r\nmsgstr \"%s desativado(a)\"\r\n\r\n#. • MSG_252\r\nmsgid \"Size checks\"\r\nmsgstr \"Verificações de tamanho\"\r\n\r\n#. • MSG_253\r\nmsgid \"Hard disk detection\"\r\nmsgstr \"Detecção de disco rígido\"\r\n\r\n#. • MSG_254\r\nmsgid \"Force large FAT32 formatting\"\r\nmsgstr \"Forçar formatação FAT32 extensa\"\r\n\r\n#. • MSG_255\r\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\r\nmsgstr \"Apagar NoDriveTypeAutorun ao sair\"\r\n\r\n#. • MSG_256\r\nmsgid \"Fake drive detection\"\r\nmsgstr \"Detecção de drive falsificado\"\r\n\r\n#. • MSG_257\r\nmsgid \"Joliet support\"\r\nmsgstr \"Suporte para Joliet\"\r\n\r\n#. • MSG_258\r\nmsgid \"Rock Ridge support\"\r\nmsgstr \"Suporte para Rock Ridge\"\r\n\r\n#. • MSG_259\r\nmsgid \"Force update\"\r\nmsgstr \"Forçar atualização\"\r\n\r\n#. • MSG_260\r\nmsgid \"NTFS compression\"\r\nmsgstr \"Compressão do NTFS\"\r\n\r\n#. • MSG_261\r\nmsgid \"Writing image: %s\"\r\nmsgstr \"Escrevendo imagem: %s\"\r\n\r\n#. • MSG_262\r\n#.\r\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\r\nmsgid \"ISO Support\"\r\nmsgstr \"Suporte a ISO\"\r\n\r\n#. • MSG_263\r\n#.\r\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\r\nmsgid \"Use PROPER size units\"\r\nmsgstr \"Use unidades de tamanho APROPRIADAS\"\r\n\r\n#. • MSG_264\r\nmsgid \"Deleting directory '%s'\"\r\nmsgstr \"Apagando o diretório '%s'\"\r\n\r\n#. • MSG_265\r\nmsgid \"VMWare disk detection\"\r\nmsgstr \"Detecção de disco VMWare\"\r\n\r\n#. • MSG_266\r\nmsgid \"Dual UEFI/BIOS mode\"\r\nmsgstr \"Modo dual UEFI/BIOS\"\r\n\r\n#. • MSG_267\r\nmsgid \"Applying Windows image: %s\"\r\nmsgstr \"Aplicando imagem do Windows: %s\"\r\n\r\n#. • MSG_268\r\nmsgid \"Applying Windows image...\"\r\nmsgstr \"Aplicando imagem do Windows...\"\r\n\r\n#. • MSG_269\r\nmsgid \"Preserve timestamps\"\r\nmsgstr \"Preservar marcas temporais\"\r\n\r\n#. • MSG_270\r\nmsgid \"USB debug\"\r\nmsgstr \"Depuração do USB\"\r\n\r\n#. • MSG_271\r\nmsgid \"Computing image checksums: %s\"\r\nmsgstr \"Calculando as somas de verificação da imagem: %s\"\r\n\r\n#. • MSG_272\r\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\r\nmsgstr \"Calcular as somas de verificação MD5, SHA1 e SHA256 da imagem selecionada\"\r\n\r\n#. • MSG_273\r\nmsgid \"Change the application language\"\r\nmsgstr \"Mudar o idioma do aplicativo\"\r\n\r\n#. • MSG_274\r\nmsgid \"%s image detected\"\r\nmsgstr \"Imagem %s detectada\"\r\n\r\n#. • MSG_275\r\n#.\r\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\r\nmsgid \"\"\r\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\r\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\r\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\r\n\"\\n\"\r\n\"Please select the mode that you want to use to write this image:\"\r\nmsgstr \"\"\r\n\"A imagem que você selecionou é do tipo 'ISOHybrid'. Isso significa que pode ser escrita em modo %s (cópia de arquivo) ou modo %s (imagem de disco).\\n\"\r\n\"O Rufus recomenda usar o modo %s, para que você sempre tenha acesso total ao drive após a gravação.\\n\"\r\n\"No entanto, se você encontrar problemas durante a inicialização, tente gravar novamente pelo modo %s.\\n\"\r\n\"\\n\"\r\n\"Por favor, selecione o modo que deseja usar para gravar essa imagem:\"\r\n\r\n#. • MSG_276\r\n#.\r\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\r\nmsgid \"Write in %s mode (Recommended)\"\r\nmsgstr \"Gravar no modo %s (Recomendado)\"\r\n\r\n#. • MSG_277\r\n#.\r\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\r\nmsgid \"Write in %s mode\"\r\nmsgstr \"Gravar no modo %s\"\r\n\r\n#. • MSG_278\r\nmsgid \"Checking for conflicting processes...\"\r\nmsgstr \"Checando por processos em conflito...\"\r\n\r\n#. • MSG_279\r\nmsgid \"Non bootable\"\r\nmsgstr \"Não inicializável\"\r\n\r\n#. • MSG_280\r\nmsgid \"Disk or ISO image\"\r\nmsgstr \"Disco ou imagem ISO\"\r\n\r\n#. • MSG_281\r\nmsgid \"%s (Please select)\"\r\nmsgstr \"%s (Por favor, selecione)\"\r\n\r\n#. • MSG_282\r\nmsgid \"Exclusive USB drive locking\"\r\nmsgstr \"Bloqueio exclusivo para drive USB\"\r\n\r\n#. • MSG_283\r\nmsgid \"Invalid signature\"\r\nmsgstr \"Assinatura digital inválida\"\r\n\r\n#. • MSG_284\r\nmsgid \"The downloaded executable is missing a digital signature.\"\r\nmsgstr \"O executável baixado não contém uma assinatura digital.\"\r\n\r\n#. • MSG_285\r\nmsgid \"\"\r\n\"The downloaded executable is signed by '%s'.\\n\"\r\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\r\n\"Are you sure you want to run this file?\"\r\nmsgstr \"\"\r\n\"O executável baixado é assinado por '%s'.\\n\"\r\n\"Essa assinatura não é reconhecida e pode indicar alguma forma de atividade maliciosa...\\n\"\r\n\"Você tem certeza de que deseja executar esse arquivo?\"\r\n\r\n#. • MSG_286\r\nmsgid \"Zeroing drive: %s\"\r\nmsgstr \"Zerando o drive: %s\"\r\n\r\n#. • MSG_287\r\nmsgid \"Detection of non-USB removable drives\"\r\nmsgstr \"Detecção de drives removíveis não USB\"\r\n\r\n#. • MSG_288\r\nmsgid \"Missing elevated privileges\"\r\nmsgstr \"Faltando privilégios elevados\"\r\n\r\n#. • MSG_289\r\nmsgid \"This application can only run with elevated privileges\"\r\nmsgstr \"Este aplicativo só pode ser executado com privilégios elevados\"\r\n\r\n#. • MSG_290\r\nmsgid \"File Indexing\"\r\nmsgstr \"Indexação de Arquivos\"\r\n\r\n#. • MSG_291\r\nmsgid \"Version selection\"\r\nmsgstr \"Seleção de versão\"\r\n\r\n#. • MSG_292\r\nmsgid \"Please select the version of Windows you want to install:\"\r\nmsgstr \"Por favor, selecione a versão do Windows que deseja instalar:\"\r\n\r\n#. • MSG_293\r\nmsgid \"Unsupported Windows version\"\r\nmsgstr \"Versão do Windows não suportada\"\r\n\r\n#. • MSG_294\r\nmsgid \"\"\r\n\"This version of Windows is no longer supported by Rufus.\\n\"\r\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\r\nmsgstr \"\"\r\n\"Esta versão do Windows não é mais suportada pelo Rufus.\\n\"\r\n\"A última versão do Rufus compatível com esta plataforma é a v%d.%d.\"\r\n\r\n#. • MSG_295\r\nmsgid \"Warning: Unofficial version\"\r\nmsgstr \"Atenção: Versão não oficial\"\r\n\r\n#. • MSG_296\r\nmsgid \"\"\r\n\"This version of Rufus was not produced by its official developer(s).\\n\"\r\n\"\\n\"\r\n\"Are you sure you want to run it?\"\r\nmsgstr \"\"\r\n\"Esta versão do Rufus não foi produzida pelo(s) seu(s) desenvolvedor(es) oficial(is).\\n\"\r\n\"\\n\"\r\n\"Tem certeza de que deseja executá-la?\"\r\n\r\n#. • MSG_297\r\nmsgid \"Truncated ISO detected\"\r\nmsgstr \"ISO truncada detectada\"\r\n\r\n#. • MSG_298\r\nmsgid \"\"\r\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\r\n\"\\n\"\r\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\r\n\"\\n\"\r\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\r\nmsgstr \"\"\r\n\"O arquivo ISO selecionado não corresponde ao seu tamanho declarado: %s de dados estão faltando!\\n\"\r\n\"\\n\"\r\n\"Se você obteve este arquivo da Internet, faça o download de uma nova cópia e verifique se as somas de verificação MD5 ou SHA correspondem às oficiais.\\n\"\r\n\"\\n\"\r\n\"Você pode calcular o MD5 ou SHA no Rufus clicando no botão (✓).\"\r\n\r\n#. • MSG_299\r\nmsgid \"Timestamp validation error\"\r\nmsgstr \"Erro de validação da marca temporal\"\r\n\r\n#. • MSG_300\r\nmsgid \"\"\r\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\r\n\"\\n\"\r\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\r\nmsgstr \"\"\r\n\"O Rufus não pôde validar que a marca temporal da atualização baixada é mais recente do que aquela do executável atual.\\n\"\r\n\"\\n\"\r\n\"Para evitar possíveis cenários de ataque, o processo de atualização foi interrompido e o arquivo baixado será excluído. Verifique o registro para obter mais detalhes.\"\r\n\r\n#. • MSG_301\r\nmsgid \"Show application settings\"\r\nmsgstr \"Exibir configurações do programa\"\r\n\r\n#. • MSG_302\r\nmsgid \"Show information about this application\"\r\nmsgstr \"Exibir informações sobre este programa\"\r\n\r\n#. • MSG_303\r\nmsgid \"Show the log\"\r\nmsgstr \"Exibir o registro\"\r\n\r\n#. • MSG_304\r\nmsgid \"Create a disk image of the selected device\"\r\nmsgstr \"Criar uma imagem do dispositivo selecionado\"\r\n\r\n#. • MSG_305\r\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\r\nmsgstr \"Use esta opção caso queira instalar o Windows neste dispositivo ou em outro, ou se deseja rodar o Windows direto deste dispositivo (Windows To Go).\"\r\n\r\n#. • MSG_306\r\n#.\r\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\r\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\r\nmsgid \"Fast-zeroing drive: %s\"\r\nmsgstr \"Modo expresso de zerar o disco: %s\"\r\n\r\n#. • MSG_307\r\nmsgid \"this may take a while\"\r\nmsgstr \"isso pode demorar um pouco\"\r\n\r\n#. • MSG_308\r\nmsgid \"VHD detection\"\r\nmsgstr \"Detecção de VHD\"\r\n\r\n#. • MSG_309\r\nmsgid \"Compressed archive\"\r\nmsgstr \"Arquivo comprimido\"\r\n\r\n#. • MSG_310\r\nmsgid \"\"\r\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\r\n\"\\n\"\r\n\"Please select the mode that you want to use to write this image:\"\r\nmsgstr \"\"\r\n\"O ISO que você selecionou usa UEFI e é pequeno o suficiente para ser escrito como uma partição do sistema EFI (ESP). Escrever para uma ESP, em vez de escrever para uma partição genérica de dados que ocupa o disco todo, pode ser preferível para alguns tipos de instalações.\\n\"\r\n\"\\n\"\r\n\"Por favor, selecione o modo que pretende utilizar para escrever esta imagem:\"\r\n\r\n#. • MSG_311\r\nmsgid \"Use %s (in the main application window) to enable.\"\r\nmsgstr \"Usar %s (na janela principal da aplicação) para habilitar.\"\r\n\r\n#. • MSG_312\r\nmsgid \"Extra hashes (SHA512)\"\r\nmsgstr \"Hashes extra (SHA512)\"\r\n\r\n#. • MSG_313\r\nmsgid \"Save to VHD\"\r\nmsgstr \"Salvar em VHD\"\r\n\r\n#. • MSG_314\r\nmsgid \"Compute image checksums\"\r\nmsgstr \"Calcular somas de verificação da imagem\"\r\n\r\n#. • MSG_315\r\nmsgid \"Multiple buttons\"\r\nmsgstr \"Múltiplos botões\"\r\n\r\n#. • MSG_316\r\nmsgid \"Number of passes\"\r\nmsgstr \"Número de passadas\"\r\n\r\n#. • MSG_317\r\nmsgid \"Disk ID\"\r\nmsgstr \"ID do Disco\"\r\n\r\n#. • MSG_318\r\nmsgid \"Default thread priority: %d\"\r\nmsgstr \"Prioridade padrão da thread: %d\"\r\n\r\n#. • MSG_319\r\nmsgid \"Ignore Boot Marker\"\r\nmsgstr \"Ignorar marcador de inicialização\"\r\n\r\n#. • MSG_320\r\nmsgid \"Refreshing partition layout (%s)...\"\r\nmsgstr \"Atualizando o layout da partição (%s)...\"\r\n\r\n#. • MSG_321\r\nmsgid \"\"\r\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\r\n\"As a result, DD image writing mode will be enforced.\"\r\nmsgstr \"\"\r\n\"A imagem que você selecionou é uma ISOHybrid, mas os criadores não a tornaram compatível com o modo de cópia ISO/Arquivo.\\n\"\r\n\"Como resultado, o modo de gravação de imagem DD será aplicado.\"\r\n\r\n#. • MSG_322\r\nmsgid \"Unable to open or read '%s'\"\r\nmsgstr \"Impossível abrir ou ler '%s'\"\r\n\r\n#. • MSG_325\r\nmsgid \"Applying Windows customization: %s\"\r\nmsgstr \"Aplicando a personalização do Windows: %s\"\r\n\r\n#. • MSG_326\r\nmsgid \"Applying user options...\"\r\nmsgstr \"Aplicando opções do usuário...\"\r\n\r\n#. • MSG_327\r\nmsgid \"Windows User Experience\"\r\nmsgstr \"Experiência do Usuário do Windows\"\r\n\r\n#. • MSG_328\r\nmsgid \"Customize Windows installation?\"\r\nmsgstr \"Personalizar a instalação do Windows?\"\r\n\r\n#. • MSG_329\r\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\r\nmsgstr \"Remover a exigência de 4GB+ RAM, Secure Boot e TPM 2.0\"\r\n\r\n#. • MSG_330\r\nmsgid \"Remove requirement for an online Microsoft account\"\r\nmsgstr \"Remover a exigência de uma conta online da Microsoft\"\r\n\r\n#. • MSG_331\r\nmsgid \"Disable data collection (Skip privacy questions)\"\r\nmsgstr \"Desativar a coleta de dados (Pular as perguntas sobre privacidade)\"\r\n\r\n#. • MSG_332\r\nmsgid \"Prevent Windows To Go from accessing internal disks\"\r\nmsgstr \"Impedir que o Windows To Go acesse discos internos\"\r\n\r\n#. • MSG_333\r\nmsgid \"Create a local account with username:\"\r\nmsgstr \"Criar uma conta local com nome de usuário:\"\r\n\r\n#. • MSG_334\r\nmsgid \"Set regional options to the same values as this user's\"\r\nmsgstr \"Definir as opções regionais com os mesmos valores deste usuário\"\r\n\r\n#. • MSG_335\r\nmsgid \"Disable BitLocker automatic device encryption\"\r\nmsgstr \"Desativar a encriptação automática BitLocker\"\r\n\r\n#. • MSG_336\r\nmsgid \"Persistent log\"\r\nmsgstr \"Registo persistente\"\r\n\r\n#. • MSG_337\r\nmsgid \"\"\r\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\r\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\r\n\"- Select 'No' to cancel the operation\\n\"\r\n\"\\n\"\r\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\r\nmsgstr \"\"\r\n\"Um arquivo adicional ('diskcopy.dll') precisa ser baixado da Microsoft para instalar o MS-DOS:\\n\"\r\n\"- Selecione 'Sim' para se conectar à Internet e baixá-lo\\n\"\r\n\"- Selecione 'Não' para cancelar a operação\\n\"\r\n\"\\n\"\r\n\"Nota: O arquivo será baixado no diretório da aplicação e será reutilizado automaticamente caso presente.\"\r\n\r\n#. • MSG_338\r\nmsgid \"Revoked UEFI bootloader detected\"\r\nmsgstr \"Detectado carregador de inicialização UEFI revogado\"\r\n\r\n#. • MSG_339\r\nmsgid \"\"\r\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\r\n\"\\n\"\r\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\r\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\r\nmsgstr \"\"\r\n\"Rufus detectou que o ISO selecionado contém um carregador de inicialização UEFI que foi revogado e produzirá %s quando Secure Boot estiver habilitado em um sistema UEFI atualizado.\\n\"\r\n\"\\n\"\r\n\"- Se você obteve essa imagem ISO de uma fonte não confiável, você deve considerar a possibilidade da mesma conter malware UEFI e evitar inicializar através dela.\\n\"\r\n\"- Se você a obteve de uma fonte confiável, você deve tentar achar uma versão mais recente, que não produza este aviso.\"\r\n\r\n#. • MSG_340\r\nmsgid \"a \\\"Security Violation\\\" screen\"\r\nmsgstr \"uma tela \\\"Security Violation\\\"\"\r\n\r\n#. • MSG_341\r\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\r\nmsgstr \"uma tela de Reparo do Windows (BSOD) com '%s'\"\r\n\r\n#. • MSG_342\r\nmsgid \"Compressed VHDX Image\"\r\nmsgstr \"Imagem VHDX comprimida\"\r\n\r\n#. • MSG_343\r\nmsgid \"Uncompressed VHD Image\"\r\nmsgstr \"Imagem VHD não comprimida\"\r\n\r\n#. • MSG_344\r\nmsgid \"Full Flash Update Image\"\r\nmsgstr \"Imagem Full Flash Update\"\r\n\r\n#. • MSG_345\r\nmsgid \"\"\r\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\r\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\r\n\"- Select 'No' to cancel the operation\"\r\nmsgstr \"\"\r\n\"Alguns dados adicionais precisam ser baixados da Microsoft para usar essa funcionalidade:\\n\"\r\n\"- Selecione 'Sim' para se conectar à Internet e baixá-los\\n\"\r\n\"- Selecione 'Não' para cancelar a operação\"\r\n\r\n#. • MSG_346\r\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\r\nmsgstr \"Restringir Windows ao modo S (INCOMPATÍVEL com remoção de exigência de conta online)\"\r\n\r\n#. • MSG_347\r\nmsgid \"Expert Mode\"\r\nmsgstr \"Modo Especialista\"\r\n\r\n#. • MSG_348\r\nmsgid \"Extracting archive files: %s\"\r\nmsgstr \"Extraindo arquivos: %s\"\r\n\r\n#. • MSG_349\r\nmsgid \"Use Rufus MBR\"\r\nmsgstr \"Usar MBR do Rufus\"\r\n\r\n#. • MSG_900\r\n#.\r\n#. The following messages are for the Windows Store listing only and are not used by the application\r\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\r\nmsgstr \"Rufus é um utilitário que ajuda a formatar e a criar unidades flash USB inicializáveis, tais como pendrives USB, cartões de memória, etc.\"\r\n\r\n#. • MSG_901\r\nmsgid \"Official site: %s\"\r\nmsgstr \"Site oficial: %s\"\r\n\r\n#. • MSG_902\r\nmsgid \"Source Code: %s\"\r\nmsgstr \"Código fonte: %s\"\r\n\r\n#. • MSG_903\r\nmsgid \"ChangeLog: %s\"\r\nmsgstr \"Registro de alterações: %s\"\r\n\r\n#. • MSG_904\r\n#.\r\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\r\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\r\nmsgid \"\"\r\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\r\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\r\nmsgstr \"\"\r\n\"Este software está licenciado sob os termos da GNU Public License (GPL) versão 3.\\n\"\r\n\"Consulte https://www.gnu.org/licenses/gpl-3.0.pt-br.html para mais detalhes.\"\r\n\r\n#. • MSG_905\r\n#.\r\n#. Keyword for \"boot\" will be used for search in the Windows Store\r\nmsgid \"Boot\"\r\nmsgstr \"Inicialização\"\r\n\r\n#. • MSG_910\r\n#.\r\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\r\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nmsgstr \"Formatar dispositivos USB, cartões flash e discos virtuais com FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\n\r\n#. • MSG_911\r\nmsgid \"Create FreeDOS bootable USB drives\"\r\nmsgstr \"Criar discos USB inicializáveis FreeDOS\"\r\n\r\n#. • MSG_912\r\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\r\nmsgstr \"Criar discos inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)\"\r\n\r\n#. • MSG_913\r\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\r\nmsgstr \"Criar discos inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas\"\r\n\r\n#. • MSG_914\r\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\r\nmsgstr \"Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS\"\r\n\r\n#. • MSG_915\r\nmsgid \"Create 'Windows To Go' drives\"\r\nmsgstr \"Criar discos 'Windows To Go'\"\r\n\r\n#. • MSG_916\r\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\r\nmsgstr \"Criar discos de instalação do Windows 11 para PCs que não possuem TPM ou Secure Boot\"\r\n\r\n#. • MSG_917\r\nmsgid \"Create persistent Linux partitions\"\r\nmsgstr \"Criar partições persistentes para Linux\"\r\n\r\n#. • MSG_918\r\nmsgid \"Create VHD/DD images of the selected drive\"\r\nmsgstr \"Criar imagens VHD/DD do dispositivo selecionado\"\r\n\r\n#. • MSG_919\r\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\r\nmsgstr \"Calcular somas de verificação MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada\"\r\n\r\n#. • MSG_920\r\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\r\nmsgstr \"Executar verificações de blocos defeituosos, incluindo detecção de unidades flash \\\"falsificadas\\\"\"\r\n\r\n#. • MSG_921\r\nmsgid \"Download official Microsoft Windows retail ISOs\"\r\nmsgstr \"Baixar ISOs oficiais do Microsoft Windows\"\r\n\r\n#. • MSG_922\r\nmsgid \"Download UEFI Shell ISOs\"\r\nmsgstr \"Baixar ISOs do Shell UEFI\"\r\n"
  },
  {
    "path": "res/loc/po/pt-PT.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-20 22:00+0100\\n\"\n\"PO-Revision-Date: 2024-05-20 22:37+0100\\n\"\n\"Last-Translator: Hugo Carvalho <hugokarvalho@hotmail.com>\\n\"\n\"Language-Team: Portuguese <hugokarvalho@hotmail.com>\\n\"\n\"Language: pt_PT\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Portuguese Standard (Português)\\n\"\n\"X-Rufus-LCID: 0x0816\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Propriedades do dispositivo\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Dispositivo/Disco\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Tipo de arranque\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Selecionar\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Opções da Imagem\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Esquema de partição\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Sistema do destino\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Mostrar unidades USB\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Opções de compatibilidade para BIOS antigas\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Ativar a validação do suporte UEFI\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Opções de formatação\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Sistema de ficheiros\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Tamanho do cluster\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Nome\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Formatação rápida\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Procurar erros no disco USB\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Criar nomes estendidos e ícones\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Estado\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Fechar\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Iniciar\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Acerca do Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licença\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Licença\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Mais informações\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Sim\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Não\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Histórico de eventos\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Limpar\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Guardar\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Configuração e política das atualizações\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Configurações\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Procurar atualizações\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Incluir versões de teste\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Procurar\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Procurar atualizações de Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Nova versão disponível. Por favor, descarregue a última versão!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Clique aqui para aceder ao Site de Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Notas relativas a esta versão\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Transferir\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Foi detetada outra instância da aplicação\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Outra instância da aplicação Rufus está em execução.\\n\"\n\"Feche a primeira intância da aplicação antes de iniciar outra.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"AVISO: TODOS OS DADOS EM %s SERÃO ELIMINADOS.\\n\"\n\"Para continuar, prima OK. Para sair da operação, prima CANCELAR.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Atualização de Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Permitir que Rufus procure atualizações na Internet?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Cancelar\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Foram encontrados erros no disco\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Verificação completa: %d erros encontrados\\n\"\n\"  %d erros de leitura\\n\"\n\"  %d erros de escrita\\n\"\n\"  %d erros de corrompimento\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Mais informações disponíveis em:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Nunca\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Diariamente\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Semanalmente\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Mensalmente\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Personalizado\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Versão instalada: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Última versão: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Padrão\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Padrão)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (ou UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (não CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS ou UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d verificado\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d verificados %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Imagem ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Aplicação\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Abortar\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Iniciar\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operação cancelada pelo utilizador\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Erro\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Erro: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Transferência de ficheiro\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Dispositivo de armazenamento USB (Genérico)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Disco %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Várias partições\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - A limpar buffers\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Cancelar\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Sucesso.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Erro indeterminado durante a formatação.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Não pode usar o sistema de ficheiros selecionado para este dispositivo.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Não é possível aceder ao dispositivo.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Dispositivo está protegido contra escrita.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Outra aplicação está a usar o dispositivo. Feche todas as aplicações que possam estar a usar o dispositivo.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Formatação rápida não está disponível para este dispositivo.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"O Nome do volume não é válido.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"O identificador do dispositivo não é válido.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"O tamanho de cluster indicado não é válido para este dispositivo.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"O tamanho do volume não é válido.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Inserir um dispositivo USB.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Comando não suportado.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Erro na alocação de memória.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Erro de leitura.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Erro de escrita.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Falha na instalação\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Impossível abrir dispositivo - pode estar em utilização. Retire, volte a ligar a unidade e tente novamente.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Erro ao criar partição.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Erro ao copiar ficheiros para o dispositivo de destino.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Cancelado pelo utilizador.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Impossível iniciar tópico.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Verificação de erros no disco foi interrompida.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Erro na análise da imagem ISO.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Erro na extração da imagem ISO.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Impossível montar o volume.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Impossível alterar/configurar ficheiros para arranque.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Impossível atribuir letra à unidade.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Impossível montar o volume GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"O dispositivo não está pronto.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus detetou que o Windows ainda está a limpar o buffer interno no dispositivo USB.\\n\"\n\"\\n\"\n\"Dependendo da velocidade do dispositivo USB, esta operação pode demorar muito tempo a terminar, especialmente para ficheiros grandes.\\n\"\n\"\\n\"\n\"Recomendamos que deixe o Windows terminar para evitar corrompimentos; No entanto, se não quiser esperar, pode simplesmente desligar o dispositivo...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Tipo de imagem não suportada\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Esta imagem não é inicializável ou então usa um método de arranque ou compressão não suportado.\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Substituir %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Esta imagem ISO usa uma versão obsoleta do ficheiro '%s'.\\n\"\n\"Isto pode fazer com que o menu de arranque não seja exibido corretamente.\\n\"\n\"\\n\"\n\"O Rufus pode transferir uma versão mais recente para resolver este problema:\\n\"\n\"- Selecione 'Sim' para ligar-se à Internet e transferir o ficheiro\\n\"\n\"- Selecione 'Não' para deixar o ficheiro ISO tal como está\\n\"\n\"Se não sabe o que fazer, é recomendado selecionar 'Sim'.\\n\"\n\"\\n\"\n\"Nota: O novo ficheiro será transferido para a pasta atual, e se o ficheiro\\n\"\n\" '%s' já existir, será substituído automaticamente.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"A transferir %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Nenhuma imagem selecionada\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"para %s TIPO\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Imagem demasiado grande\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"A imagem é demasiado grande para o destino selecionado.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"ISO não suportado\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Quando usa UEFI como tipo de destino, só são suportadas imagens ISO inicializáveis tipo EFI. Selecione uma imagem ISO inicializável do tipo EFI ou altere o tipo de destino para BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Sistema de ficheiros não suportado\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"IMPORTANTE: ESTA DRIVE CONTÉM VÁRIAS PARTIÇÕES!!\\n\"\n\"\\n\"\n\"Isto pode incluir partições/volumes que não estão listados ou invisíveis a partir do Windows. Caso queira prosseguir, é responsável por qualquer perda de dados nessas partições.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Várias partições detetadas\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"Imagem DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"O sistema de ficheiros selecionado não pode ser usado com este tipo de ISO. Por favor, selecione um sistema de ficheiros diferente ou use um ISO diferente.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' apenas pode ser aplicado se o sistema de ficheiros for NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"IMPORTANTE: Está a tentar instalar 'Windows To Go', mas a drive de destino não tem o atributos 'FIXO'. Por isso o Windows provalvelmente irá parar durante o arranque, uma vez que não está preparado para trabalhar em drives que tenham o atributo de 'AMOVÍVEL'.\\n\"\n\"\\n\"\n\"Deseja continuar mesmo assim?\\n\"\n\"\\n\"\n\"Nota: O atributo 'FIXO/AMOVÍVEL' é uma propriedade do hardware que apenas pode se alterado através de ferramentas do fabricante da drive. No entanto, estas ferramentas na MAIORIA dos CASOS, NUNCA são fornecidas aos utilizadores...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Limitação de sistema de ficheiros\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Esta imagem ISO contém um ficheiro com mais de 4 GB, que ultrapassa o tamanho máximo permitido para o sistema de ficheiros FAT ou FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"O suporte para ficheiro WIM não está disponível\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Não é possível extrair ficheiros comprimidos WIM. A extração WIM é necessária para criar dispositivos USB inicializável tipo EFI com Windows 7 e Windows Vista. Para corrigir, instale uma versão recente do 7-Zip.\\n\"\n\"Quer visitar a página de transferências do 7-Zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Pretende transferir %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s ou posterior requer que esteja instalado o ficheiro '%s'.\\n\"\n\"Dado que este ficheiro tem mais de 100 KB e está sempre presente nas \\n\"\n\"imagens ISO %s, Rufus não o inclui na sua distribuição.\\n\"\n\"\\n\"\n\"O Rufus pode transferir o ficheiro em falta:\\n\"\n\"- Selecione 'Sim' transferir o ficheiro\\n\"\n\"- Selecione 'Não' se deseja mais tarde copiar manualmente este ficheiro para a unidade\\n\"\n\"\\n\"\n\"Nota: O novo ficheiro será transferido para a pasta atual, e se o ficheiro\\n\"\n\" '%s' já existir, será substituído automaticamente.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Se cancelar agora pode deixar o dispositivo INUTILIZADO.\\n\"\n\"Se pretende mesmo cancelar, selecione SIM. Caso contrário, selecione NÃO.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Selecione a pasta\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Todos os ficheiros\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Registo de eventos do Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Disco %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS não arranca de um disco com um tamanho de cluster de 64 kilobytes.\\n\"\n\"Por favor altere o tamanho do cluster ou use o FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Tamanho de cluster incompatível\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Formatar um volume UDF de tamanho grande pode demorar muito tempo. À velocidade de USB 2.0, o tempo estimado de formatação é de %d:%02d, durante o qual a barra de progresso parecerá \\\"congelada\\\". Por favor, seja paciente!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Volume UDF de tamanho grande\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Esta imagem usa Syslinux %s%s mas a aplicação inclui apenas os ficheiros de instalação para Syslinux %s%s.\\n\"\n\"\\n\"\n\"Como as diferentes versões de Syslinux podem não ser compatíveis entre si e não é possível o Rufus incluir todas elas, dois ficheiros adicionais devem ser transferidos ('ldlinux.sys' e 'ldlinux.bss'):\\n\"\n\"- Selecione 'Sim' para transferir os ficheiros\\n\"\n\"- Selecione 'Não' para cancelar\\n\"\n\"\\n\"\n\"Nota: Os ficheiros serão transferidos para a pasta atual da aplicação e serão usados automaticamente se presentes.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Transferência\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Esta imagem usa Grub %s mas a aplicação inclui apenas os ficheiros de instalação para Grub %s.\\n\"\n\"\\n\"\n\"As diferentes versões de Grub podem não ser compatíveis entre si e não é possível incluir todas elas. Rufus irá tentar localizar para a versão de Grub o ficheiro de instalação ('core.img') que coincida com o da imagem:\\n\"\n\"- Selecione 'Sim' para tentar transferir\\n\"\n\"- Selecione 'Não' para usar a versão padrão do Rufus\\n\"\n\"- Selecione 'Cancelar' para abortar a operação\\n\"\n\"\\n\"\n\"Nota: O ficheiro será transferido para a pasta atual da aplicação e será usado automaticamente sempre que presente. Se não for possível encontrar online, a versão padrão será utilizada.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Instalação padrão do Windows\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"propriedades avançadas da unidade\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"opções avançadas de formatação\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Mostrar %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Ocultar %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Tamanho da partição persistente\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Nenhuma\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Defina o tamanho da partição persistente para a unidade USB. Definir o tamanho como 0 desabilita a partição persistente.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Defina as unidades do tamanho da partição.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Não mostrar esta mensagem novamente\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Aviso importante sobre %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Acabou de criar um disco que usa o carregador de inicialização UEFI:NTFS. Tenha em atenção que, para inicializar com este disco, TEM DE DESATIVAR O ARRANQUE SEGURO.\\n\"\n\"Para mais detalhes clique no botão \\\"Mais informações\\\" abaixo.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Seleção de imagem do Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Este ISO contém várias imagens do Windows.\\n\"\n\"Por favor, selecione a imagem que pretende usar para esta instalação:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Outro programa ou processo está a aceder a esta unidade. Mesmo assim, pretende formatá-la?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus detetou que está a tentar criar um disco Windows To Go com base num ISO da versão 1809.\\n\"\n\"\\n\"\n\"Devido a um *BUG da MICROSOFT*, este disco irá bloquear durante a inicialização do Windows (Ecrã Azul da Morte), a menos que substitua manualmente o ficheiro 'WppRecorder.sys' por um da versão 1803.\\n\"\n\"\\n\"\n\"Tenha em atenção também que a razão pela qual o Rufus não pode corrigir automaticamente é que 'WppRecorder.sys' é um ficheiro protegido por direitos de autor da Microsoft, portanto, não podemos incorporar legalmente uma cópia do ficheiro no Rufus...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Uma vez que foi selecionado o MBR para o esquema de partição, o Rufus só pode criar uma partição de até 2 TB neste disco, o que deixará %s de espaço em disco indisponível.\\n\"\n\"\\n\"\n\"Tem a certeza de que pretende continuar?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Versão\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Lançamento\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Edição\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Idioma\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Arquitetura\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Continuar\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Voltar\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Por favor, aguarde...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Transferir no browser\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"A transferência de ISOs do Windows não está disponível porque a Microsoft alterou o seu site para evitá-la.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"É necessário o PowerShell 3.0 ou posterior para executar este script.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Pretende ligar e fazer a transferência?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"A executar script da transferência...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Transferir imagem ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Tipo de computador com o qual pretende usar esta unidade inicializável. É da sua responsabilidade determinar se o computador é do tipo BIOS ou UEFI antes de começar a criar a unidade, pois pode falhar no arranque.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' significa que o dispositivo inicializará apenas no modo de emulação da BIOS (também conhecido como 'Legacy Mode') em UEFI e não no modo UEFI nativo.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'não CSM' significa que o dispositivo inicializará apenas no modo UEFI nativo, e não no modo de emulação da BIOS (também conhecido como 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Padrão de teste: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Padrão de teste: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Padrão de teste: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Padrão de teste: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Selecionar o sistema de ficheiros destino\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Tamanho mínimo que um bloco de dados ocupará no sistema de ficheiros\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Use este campo para atribuir o nome ao volume.\\n\"\n\"Podem ser caracteres acentuados.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Mostrar opções avançadas\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Verificação de erros no dispositivo com o padrão de teste\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Desmarque esta opção para usar o método de formatação \\\"lento\\\"\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Método a usar para criar partições\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Método a usar para tornar a unidade inicializável\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Clique para selecionar ou transferir uma imagem..\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Selecione esta opção para permitir a exibição de caracteres acentuados e atribuir um ícone para a unidade (cria um ficheiro autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Instalar um carregador de arranque UEFI, que irá efetuar a validação do ficheiro MD5Sum do suporte de dados\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"Criar uma partição extra oculta e tentar alinhar limites das partições. Isto pode melhorar a deteção de USB inicializável para as BIOS antigas.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Ativa a deteção de discos rígidos portáteis USB. USE-O POR SEU PRÓPRIO RISCO!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Iniciar a operação de formatação.\\n\"\n\"Todos os dados no dispositivo serão DESTRUÍDOS!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Assinatura do ficheiro inválida\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Clique para selecionar...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - O utilitário de confiança para formatação USB\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Versão %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Tradução para Português Europeu: Dinis Medeiros, Fernando Baptista\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Para reportar erros ou sugerir melhorias, visite:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Direitos de autor adicionais:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Politica de atualização:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Autoriza que este programa procure e instale automaticamente as atualizações e aceita que a seguinte informação possa ser recolhida nos nossos servidores:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"A arquitetura e versão do seu sistema operativo\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"A versão da aplicação que está a usar\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"O seu endereço IP\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"A fim de gerar estatísticas de uso privado, a informação recolhida pode ser retida \\\\b até um ano\\\\b0 . A menos que seja requerido por lei, não forneceremos nenhuma desta informação a terceiros.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Processo de atualização:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus não instala nem executa nenhum serviço nem programa em segundo plano. A procura de atualizações só se realiza quando a aplicação principal está em execução.\\\\line\\n\"\n\"É necessário acesso à Internet para verificar se existem atualizações.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Imagem inválida para a opção de inicialização selecionada\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"A imagem atual não coincide com a opção de inicialização selecionada. Utilize uma imagem diferente ou escolha uma opção de inicialização diferente.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Esta imagem ISO não é compatível com o sistema de ficheiros selecionado\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Detetada unidade incompatível\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Escrita\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Leitura\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Transferido %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Não é possível transferir %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"A usar a versão incorporada do(s) ficheiro(s) %s\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"IMPORTANTE: ESTA DRIVE USA UM TAMANHO DE SECTOR NÃO CONVENCIONAL!\\n\"\n\"\\n\"\n\"As drives convencionais usam o tamanho de sector de 512-byte mas esta drive usa %d-byte. Em muitos casos, isto implica que NÃO será possível fazer arranque com esta drive.\\n\"\n\"Rufus pode tentar criar uma drive inicializável, mas SEM GARANTIA que funcione.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Detetado tamanho de sector não standard\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' apenas pode ser instalado numa drive com partição GPT se o atributo FIXO estiver selecionado. A drive atual não foi detetada como FIXO.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Esta funcionalidade não está disponível nesta plataforma.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"A cancelar - por favor aguarde...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"A analisar a imagem...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Ocorreu um erro ao analisar a imagem\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Foi detetado um ficheiro %s obsoleto\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"A usar a imagem: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Falta o ficheiro %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Novo volume\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d dispositivo encontrado\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d dispositivos encontrados\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"PRONTO\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Operação cancelada\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"A operação FALHOU\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"A iniciar a nova aplicação...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Erro ao iniciar a nova aplicação\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"%s aberto\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"%s guardado\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"A formatar: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"A criar sistema de ficheiros: Tarefa %d/%d completa\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Verificação NTFS: %d%% completo\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"A formatar (%s) - duração estimada %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"A atribuir a etiqueta do volume (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"A formatar (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Verificação NTFS (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"A limpar as estruturas MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"A solicitar acesso ao disco...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"A analisar registos de arranque existentes...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"A fechar o volume existente...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"A escrever o registo mestre de arranque (Master Boot Record)...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"A escrever o registo da partição de arranque (Partition Boot Record)...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"A copiar ficheiros DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"A copiar ficheiros ISO: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Configuração de arranque EFI para Win7 EFI (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"A finalizar, por favor aguarde...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"A instalar Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Blocos com erros: %s %d/%d - %0.2f%% (%d/%d/%d erros)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Blocos com erro: A verificar com padrão aleatório\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Blocos com erro: A verificar com padrão 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"A criar partições (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"A apagar partições (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"A assinatura da atualização transferida não foi validada. Isto pode significar que o seu sistema está configurado incorretamente para validação de assinaturas ou indicar uma transferência maliciosa.\\n\"\n\"\\n\"\n\"O ficheiro transferido será eliminado. Por favor, verifique o registo para mais detalhes.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"A transferir: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Erro ao transferir o ficheiro.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Procurar atualizações de Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Atualizações: Não é possível ligar à Internet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Atualizações: Impossível aceder aos dados da versão\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Está disponível uma nova versão de Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Não foi encontrada uma nova versão de Rufus\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Foram apagadas as chaves de registo da aplicação\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Falha ao apagar as chaves de registo da aplicação\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s ativado\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s desativado\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Verificação de tamanho\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Deteção de discos rígidos\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Forçar formatação FAT32 em discos grandes\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"Apagar NoDriveTypeAutorun ao sair\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Simulação de deteção de dispositivo\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Suporte para Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Suporte para Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Forçar a atualização\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"Compressão NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"A criar imagem: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Suporte ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Usar unidade de tamanho APROPRIADO\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"A apagar pasta '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"A detetar disco VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Modo duplo UEFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Aplicar imagem Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Aplicar imagem Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Manter data/hora dos ficheiros\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Depuração USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Cálculo do checksums da imagem: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Calcular MD5, SHA1 e SHA256 da imagem selecionada\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Alterar o idioma da aplicação\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Detetada imagem %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"A imagem selecionada é uma imagem 'ISOHybrid'. Isto significa que pode ser escrita no modo %s (cópia de ficheiros) ou no modo %s (cópia de imagem).\\n\"\n\"Rufus recomenda o modo %s para que tenha sempre acesso total ao disco após a escrita.\\n\"\n\"No entanto, se existirem erros durante o arranque, pode tentar escrever no modo %s.\\n\"\n\"\\n\"\n\"Selecione o modo que realmente pretende para escrever esta imagem:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Escrever no modo %s (Recomendado)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Escrever no modo %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"A verificar processos em conflito...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Não inicializável\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disco ou imagem ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (selecionar)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Bloqueio exclusivo do dispositivo USB\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Assinatura inválida\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Está em falta uma assinatura digital no executável transferido.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"O executável transferido está assinado por '%s'.\\n\"\n\"Não é uma assinatura reconhecida e poderá indiciar algum tipo de atividade mal intencionada...\\n\"\n\"Tem a certeza de que pretende executar este ficheiro?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"A limpar disco: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Detecção de unidades removíveis não-USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Sem privilégios de administrador\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Esta aplicação só pode ser executada com privilégios de administrador\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Indexação de ficheiros\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Seleção da versão\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Selecione a versão do Windows que pretende instalar:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Versão do Windows não suportada\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Esta versão do Windows já não é suportada por Rufus.\\n\"\n\"A última versão do Rufus compatível com esta plataforma é a v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Aviso: versão não oficial\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Esta versão de Rufus NÃO foi desenvolvida pelo autor oficial.\\n\"\n\"\\n\"\n\"Tem a certeza de que pretende executar?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Detetado ISO truncado\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"O ficheiro ISO selecionado não corresponde ao tamanho declarado: faltam %s de dados!\\n\"\n\"\\n\"\n\"Se obteve este ficheiro da Internet, deve tentar transferir uma nova cópia e verificar se os checksums MD5 ou SHA correspondem aos oficiais.\\n\"\n\"\\n\"\n\"Para calcular o MD5 ou SHA com Rufus, clique no botão (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Erro de validação da data/hora\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Não foi possível ao Rufus confirmar que a data e hora da atualização transferida é mais recente que a do executável atual.\\n\"\n\"\\n\"\n\"Para evitar possíveis cenários de ataque informático, o processo de atualização foi cancelado e o ficheiro transferido será apagado. Para mais detalhes, verifique o registo.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Mostrar configurações da aplicação\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Mostrar informações acerca da aplicação\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Mostrar registo de eventos\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Criar imagem do disco do dispositivo selecionado\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Use esta opção se pretende instalar o Windows noutro disco, ou se pretende executar o Windows diretamente desta unidade (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Limpeza rápida da unidade: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"pode demorar algum tempo\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Deteção VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Arquivo comprimido\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"O ISO selecionado utiliza UEFI e é pequeno para ser escrito como uma partição do sistema EFI (ESP). Escrever para uma ESP em vez de escrever para uma partição genérica de dados que ocupa o disco todo, pode ser preferível para alguns tipos de instalações.\\n\"\n\"\\n\"\n\"Por favor, selecione o modo que pretende utilizar para escrever esta imagem:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Usar %s para ativar (na janela principal da aplicação).\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Hashes extra (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Guardar para VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Calcular cheksums da imagem\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Múltiplos botões\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Número de passagens\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID Disco\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Prioridade padrão do thread: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignorar marcador de arranque\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"A atualizar a estrutura da partição (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"A imagem que selecionou é ISOHybrid mas os criadores não a tornaram compatível com o modo de cópia ISO/Ficheiro.\\n\"\n\"Como resultado, será aplicado o modo de gravação da imagem DD.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Não foi possível abrir ou ler '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"A aplicar personalização do Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"A aplicar as opções do utilizador...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Experiência do Utilizador Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Personalizar instalação do Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Remover o requisito de 4 GB ou mais de RAM, Arranque Seguro e TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Remover o requisito de uma conta Microsoft online\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Desativar a recolha de dados (suprime as perguntas sobre privacidade)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Impedir que o Windows To Go aceda a discos internos\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Criar uma conta local com o nome de utilizador:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Definir as opções regionais com os mesmos valores deste utilizador\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Desativar a encriptação automática BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Registo permanente (log)\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Um ficheiro adicional ('diskcopy.dll') deve ser transferido da Microsoft para instalar o MS-DOS:\\n\"\n\"- Selecione 'Sim' para se ligar à Internet e descarregá-lo\\n\"\n\"- Selecione 'Não' para cancelar a operação\\n\"\n\"\\n\"\n\"Nota: O ficheiro será transferido para a pasta da aplicação e será reutilizado automaticamente se estiver presente.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Detetado carregador de arranque UEFI revogado\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"O Rufus detetou que a ISO que selecionou contém um carregador de arranque UEFI que foi revogado e que produzirá %s, quando o Arranque Seguro está ativado num sistema UEFI totalmente atualizado.\\n\"\n\"\\n\"\n\"- Se obteve esta imagem ISO de uma fonte não segura, deve considerar a possibilidade de que a mesma possa conter malware UEFI e evitar arrancar a partir dela.\\n\"\n\"- Se a obteve de uma fonte segura, deve tentar localizar uma versão mais atualizada, que não produza este aviso.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"um ecrã de \\\"Violação de Segurança\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"um ecrã de recuperação do Windows (BSOD) com '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Imagem VHDX comprimida\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Imagem VHD não comprimida\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Imagem de atualização completa\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"É necessário transferir alguns dados adicionais da Microsoft para usar esta funcionalidade:\\n\"\n\"- Selecione 'Sim' para se ligar à Internet e descarregá-los\\n\"\n\"- Selecione 'Não' para cancelar a operação\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Restringir o Windows ao modo S (INCOMPATÍVEL com o ignorar da conta online)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Modo avançado\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"A extrair ficheiros de arquivo: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Usar o MBR do Rufus\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus é um utilitário que ajuda a formatar e a criar unidades USB inicializáveis, tais como dispositivos USB/pendrives, cartões de memória, etc.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Site oficial: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Código fonte: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Alterações: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Este software está licenciado sob os termos da GNU Public License (GPL) versão 3.\\n\"\n\"Consulte https://www.gnu.org/licenses/gpl-3.0.html para mais detalhes.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Inicializável\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatar dispositivos USB, cartão de memória e drives virtuais em FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Criar unidades USB inicializáveis FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Criar unidades inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Criar unidades inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Criar discos 'Windows To Go'\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Criar discos de instalação do Windows 11 para PCs que não possuem TPM ou Arranque Seguro\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Crie partições persistentes para Linux\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Criar imagens VHD/DD do dispositivo selecionado\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Calcular checksums MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Executar verificações de blocos inválidos, incluindo a deteção de unidades flash \\\"falsas\\\"\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Transferir ISOs oficiais do Microsoft Windows Retail\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Transferir ISOs de UEFI Shell\"\n"
  },
  {
    "path": "res/loc/po/ro-RO.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-04-25 21:23+0300\\n\"\n\"PO-Revision-Date: 2024-04-25 22:00+0300\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: ro_RO\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Romanian (Română)\\n\"\n\"X-Rufus-LCID: 0x0418, 0x0818\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Proprietăți unitate\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Dispozitiv\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Selectare boot\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Selectare\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Opțiune imagine\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Schemă de partiționare\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Sistemul vizat\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Afișare unități conectate prin USB\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Adăugare remedieri pentru BIOS-uri vechi (partiție extra, aliniere, etc.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Activați validarea mediilor UEFI în timpul execuției\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Opțiuni formatare\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Sistem de fișiere\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Mărime cluster\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Etichetă volum\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Formatare rapidă\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Căutare blocuri defecte\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Creare fișiere extinse pentru etichete și iconițe\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Stare\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Închidere\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Despre Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licență\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Licență Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Mai multe informații\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Da\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Nu\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Jurnal\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Ștergere\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Salvare\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Politică de actualizare și setări\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Setări\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Căutare actualizări\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Includere versiuni beta\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Căutare acum\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Căutare actualizări - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Este disponibilă o nouă versiune. Vă rugăm să descărcați cea mai recentă versiune!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Apăsați aici pentru a accesa pagina web\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Informații despre lansări\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Descărcare\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"S-a detectat altă instanță\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"O altă aplicație Rufus rulează.\\n\"\n\"Vă rugăm să închideți prima aplicație înainte de a deschide alta.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"ATENȚIE: TOATE DATELE DE PE DISPOZITIVUL '%s' VOR FI DISTRUSE.\\n\"\n\"Pentru a continua, alegeți OK. Pentru a renunța, alegeți ANULARE.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Politica de actualizare Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Permiteți aplicației Rufus să caute actualizări pe internet?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Anulare\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"S-au găsit blocuri defecte\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Verificare finalizată: s-au găsit %d blocuri defecte\\n\"\n\"  %d erori de citire\\n\"\n\"  %d erori de scriere\\n\"\n\"  %d erori de integritate\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Un raport mai detaliat se află în:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Dezactivată\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Zilnic\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Săptămânal\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Lunar\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Personalizat\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Versiune instalată: %d.%d (Generare %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Cea mai recentă versiune: %d.%d (Generare %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"baiți\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobaiți\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabaiți\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Implicit\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Implicit)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (sau UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (fără CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS sau UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d pas\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d pași %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Imagine ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Aplicație\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Anulare\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Lansare\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operațiune anulată de către utilizator\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Eroare\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Eroare: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Descărcare fișier\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Dispozitiv de stocare USB (Generic)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Disc %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Partiții multiple\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Curățare buffer\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Anulare\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Finalizat cu succes.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Eroare necunoscută în timpul formatării.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Nu se poate utiliza sistemul de fișiere selectat pe acest dispozitiv media.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Accesul la dispozitiv a fost respins.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Dispozitivul media are scrierea protejată.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Dispozitivul este utilizat de către un alt proces. Vă rugăm să închideți orice alt proces care ar putea să acceseze dispozitivul.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Formatarea rapidă nu este disponibilă pentru acest dispozitiv.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Eticheta volumului nu este validă.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Procesul de gestionare al dispozitivului nu este valid.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Dimensiunea selectată pentru cluster nu este validă pentru acest dispozitiv.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Dimensiunea volumului nu este validă.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Vă rugăm să introduceți un dispozitiv media detașabil.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"A fost primită o comandă neacceptată.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Eroare de alocare memorie.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Eroare de citire.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Eroare de scriere.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Instalarea a eșuat\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Nu s-a putut deschide dispozitivul media. Este posibil ca acesta să fie utilizat de către un alt proces. Vă rugăm să reintroduceți dispozitivul și să încercați din nou.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Nu s-a putut partiționa unitatea.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Nu s-au putut copia fișierele pe dispozitivul țintă.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Anulat de către utilizator.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Nu se poate porni firul de execuție.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Căutarea blocurilor defecte nu s-a finalizat.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Analiza imaginii ISO a eșuat.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Extragerea imaginii ISO a eșuat.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Nu se poate remonta volumul.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Nu se pot configura fișierele pentru boot.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Nu se poate atribui litera unității.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Nu se poate monta volumul GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Dispozitivul nu este pregătit.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus a observat că Windows încă mai scrie date din buffer pe dispozitivul USB.\\n\"\n\"\\n\"\n\"În funcție de viteza dispozitivului USB, poate dura mult timp pentru ca această operațiune să se finalizeze, mai ales dacă există fișiere mari.\\n\"\n\"\\n\"\n\"Pentru a evita deteriorarea datelor, vă recomandăm să așteptați câteva momente pentru ca Windows să finalizeze scrierea. Dacă nu doriți să așteptați, puteți scoate dispozitivul USB, însă integritatea datelor nu va fi garantată.\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Imagine neacceptată\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Această imagine nu este de tip boot, sau folosește o metodă de boot sau compresie care nu este acceptată de Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Înlocuiți %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Această imagine ISO pare să folosească o versiune învechită de '%s'.\\n\"\n\"Drept urmare, este posibil ca meniul de boot să nu funcționeze corect.\\n\"\n\"\\n\"\n\"Rufus poate descărca o versiune mai nouă pentru rezolva această problemă:\\n\"\n\"- Alegeți 'Da' pentru a vă conecta la internet și a descărca fișierul\\n\"\n\"- Alegeți 'Nu' pentru a lăsa fișierul ISO neschimbat.\\n\"\n\"Dacă nu știți care este alegerea potrivită, este recomandat să alegeți 'Da'.\\n\"\n\"\\n\"\n\"Observație: Un nou fișier va fi descărcat în folderul curent. Odată descărcat, noua versiune de '%s' va fi refolosită automat.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Se descarcă %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Nicio imagine selectată\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"pentru tip %s\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Imaginea este prea mare\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Imaginea este prea mare pentru dispozitivul selectat.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Imagine ISO neacceptată\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Atunci când este selectat UEFI drept țintă, doar imaginile ISO de tip EFI boot sunt acceptate. Vă rugăm să alegeți un fișier ISO de tip EFI, sau să selectați BIOS drept țintă.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Sistem de fișiere neacceptat\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"IMPORTANT: ACEASTĂ UNITATE CONȚINE MAI MULTE PARTIȚII!!\\n\"\n\"\\n\"\n\"Aceste partiții pot fi ascunse sau invizibile în Windows. Continuând, dumneavoastră veți fi responsabil(ă) pentru orice pierderi de date apărute în urma ștergerii acestor partiții.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Au fost detectate mai multe partiții\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"Imagine DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Sistemul de fișiere selectat nu poate fi utilizat cu acest tip de ISO. Vă rugăm să selectați alt sistem de fișiere sau să folosiți alt fișier ISO.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' poate fi aplicat doar dacă sistemul de fișiere este NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"IMPORTANT: Ați ales să instalați 'Windows To Go', dar unitatea aleasă nu are atributul 'FIXED'. Drept urmare, Windows nu va porni corect, întrucât Microsoft nu a proiectat acest sistem de operare să funcționeze cu unitățile care au atributul 'REMOVABLE'.\\n\"\n\"\\n\"\n\"Doriți totuși să continuați?\\n\"\n\"\\n\"\n\"Observație: Atributul 'FIXED/REMOVABLE' este o proprietate hardware. Atributul poate fi schimbat doar folosind instrumente speciale personalizate de către producătorul unității, însă aceste instrumente nu sunt APROAPE NICIODATĂ oferite publicului...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Limitare a sistemului de fișiere\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Această imagine ISO conține un fișier mai mare de 4 GO, care depășește dimensiunea maximă permisă pentru un sistem de fișiere FAT sau FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Lipsește suportul WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Platforma dvs. nu poate extrage fișiere din archive WIM. Extragerea din WIM este necesară pentru a crea unități de boot EFI pentru Windows 7 și Windows Vista. Puteți rezolva această problemă descărcând 7-Zip.\\n\"\n\"Doriți să accesați pagina de descărcare 7-Zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Descărcați %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Începând cu %s, este necesară instalarea unui fișier '%s'.\\n\"\n\"Având o mărime de peste 100 KB și fiind mereu prezent în imaginile ISO %s, acest fișier nu este integrat în Rufus.\\n\"\n\"\\n\"\n\"Rufus poate descărca fișierul pentru dumneavoastră:\\n\"\n\"- Alegeți 'Da' pentru a vă conecta la internet și a descărca fișierul\\n\"\n\"- Alegeți 'Nu' dacă doriți să copiați manual acest fișier mai târziu\\n\"\n\"\\n\"\n\"Observație: Fișierul va fi descărcat în folderul curent și odată ce '%s' a fost descărcat, acesta va fi reutilizat automat.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Anularea poate lăsa dispozitivul într-o stare INUTILIZABILĂ.\\n\"\n\"Dacă într-adevăr doriți să anulați, alegeți DA. În caz contrar, alegeți NU.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Vă rugăm să selectați folderul\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Toate fișierele\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Jurnal Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (discul %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS nu poate porni de pe o unitate ce are dimensiunea clusterului de 64 kilobaiți.\\n\"\n\"Vă rugăm să modificați dimensiunea clusterului sau să utilizați FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Dimensiune cluster incompatibilă\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Formatarea volumelor UDF largi poate dura mult timp. Cu viteza USB 2.0, timpul estimat de așteptare este %d:%02d, timp în care bara de progres se va bloca. Vă rugăm să așteptați!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Volum UDF mare\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Această imagine folosește Syslinux %s%s, însă această aplicație include doar fișierele de instalare pentru Syslinux %s%s.\\n\"\n\"\\n\"\n\"Întrucât versiunile noi de Syslinux nu sunt compatibile cu cele vechi, iar Rufus nu le poate include pe toate, este necesar ca două fișiere suplimentare să fie descărcate de pe internet ('ldlinux.sys' și 'ldlinux.bss'):\\n\"\n\"- Alegeți 'Da' pentru a vă conecta la internet și a descărca fișierele respective\\n\"\n\"- Alegeți 'Nu' pentru a anula operațiunea.\\n\"\n\"\\n\"\n\"Observație: Noile fișiere vor fi descărcate în folderul curent al aplicației. Odată prezente în folder, acestea vor fi refolosite automat.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Descărcare necesară\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Această imagine folosește Grub %s, însă aplicația include doar fișierele de instalare pentru Grub %s.\\n\"\n\"\\n\"\n\"Întrucât versiunile noi de Grub pot fi incompatibile cu cele vechi, iar Rufus nu le poate include pe toate, Rufus va căuta un fișier de instalare Grub ('core.img') potrivit pentru versiunea din imaginea dvs:\\n\"\n\"- Alegeți 'Da' pentru a vă conecta la internet și a încerca descărcarea\\n\"\n\"- Alegeți 'Nu' pentru a utiliza versiunea implicită din Rufus\\n\"\n\"- Alegeți 'Anulare' pentru a anula operațiunea\\n\"\n\"\\n\"\n\"Observație: Noul fișier va fi descărcat în folderul curent al aplicației. Odată prezent în folder, acesta va fi refolosit automat. Daca nu este găsită nicio potrivire online, atunci va fi utilizată versiunea implicită.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Instalare Windows standard\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"proprietăți unitate avansate\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"opțiuni formatare avansate\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Afișare %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Ascundere %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Dimensiune partiție persistentă\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Fără persistență\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Setați dimensiunea partiției persistente pentru dispozitivul USB live. Setarea mărimii la 0 va dezactiva partiția persistentă.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Alegeți unitatea de măsură pentru dimensiunea partiției.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Nu mai afișa acest mesaj\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Aviz important în legătură cu %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Tocmai ați creat un media care utilizează bootloader-ul UEFI:NTFS. Pentru a porni acest media, ESTE NECESAR SĂ DEZACTIVAȚI SECURE BOOT.\\n\"\n\"Pentru a afla de ce este necesar acest lucru, alegeți 'Mai multe informații'.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Selectare imagine Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Acest ISO conține mai multe imagini Windows.\\n\"\n\"Vă rugăm să selectați imaginea pe care doriți să o utilizați pentru această instalare:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Un alt program sau proces utilizează această unitate. Doriți să o formatați oricum?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus a observat că încercați să creați un media Windows To Go bazat pe un ISO cu versiunea 1809.\\n\"\n\"\\n\"\n\"Din cauza unui *BUG MICROSOFT*, acest media va eșua în timpul pornirii Windows (Blue Screen Of Death), cu excepția cazului în care înlocuiți manual fișierul 'WppRecorder.sys' cu o versiune 1803.\\n\"\n\"\\n\"\n\"De asemenea, rețineți că motivul pentru care Rufus nu poate remedia automat acest lucru pentru dvs. este că 'WppRecorder.sys' este un fișier Microsoft protejat prin drepturi de autor, deci nu putem încorpora în mod legal o copie a fișierului în aplicație...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Deoarece MBR a fost selectat pentru schema de partiționare, Rufus poate crea doar o partiție de până la 2 TB pe acest suport media, ceea ce va lăsa %s spațiu de disc indisponibil.\\n\"\n\"\\n\"\n\"Sigur doriți să continuați?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Versiune\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Lansare\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Ediție\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Limbă\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Arhitectură\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Continuare\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Înapoi\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Vă rugăm să așteptați...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Descărcați folosind un browser\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Desărcarea de Windows ISO-uri nu este valabilă din cauza unor schimbări al paginii web de la Microsoft care previn această acțiune.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 sau mai nou este necesar pentru a rula acest script.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Doriți să intrați pe internet și să îl descărcați?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Se rulează scriptul pentru descărcare...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Descărcare imagine ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Tipul computerului pe care doriți să utilizați unitatea bootabilă. Este responsabilitatea dvs. să determinați dacă acesta este de tip BIOS sau UEFI înainte de a crea unitatea. Dacă alegeți tipul greșit, unitatea nu va funcționa și sistemul nu va porni.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' înseamnă că dispozitivul NU va porni în modul UEFI nativ, ci doar în modul de BIOS emulat (cunoscut și ca 'Legacy Mode') sub UEFI.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'non-CSM' înseamnă că dispozitivul va porni DOAR în modul UEFI nativ. Acesta NU va porni în modul de BIOS emulat (cunoscut și ca 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Model de test: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Model de test: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Model de test: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Model de test: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Setează sistemul de fișiere pentru dispozitiv\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Dimensiunea minimă pe care un bloc de date o va ocupa în sistemul de fișiere\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Utilizați acest câmp pentru a seta eticheta unității.\\n\"\n\"Sunt acceptate caractere internaționale.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Afișare sau ascundere opțiuni avansate\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Căutați blocuri defecte pe dispozitiv utilizând un model de test\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Debifați această casetă pentru a utiliza metoda de formatare \\\"înceată\\\"\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metoda care va fi folosită pentru a crea partiții\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Metoda care va fi folosită pentru a face unitatea USB să fie bootabilă\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Dați click pentru a selecta sau descărca o imagine...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Bifați această casetă pentru a permite afișarea etichetelor internaționale și pentru a seta o pictogramă pentru dispozitiv (se va crea un fișier autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Instalează un bootloader UEFI care poate performa validări MD5sum a fișierelor media\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Creează o partiție ascunsă suplimentară și încearcă să alinieze delimitările pentru partiții.\\n\"\n\"Poate îmbunătăți detectarea pe BIOS-uri mai vechi.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Activează afișarea unităților de tip hard conectate prin USB. UTILIZAȚI PE PROPRIA RĂSPUNDERE!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Începe operațiunea de formatare.\\n\"\n\"Aceasta va DISTRUGE toate datele de pe dispozitivul țintă!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Semnătura descărcării nu este validă\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Dați click pentru a selecta...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Instrumentul de încredere pentru formatări USB\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Versiunea %d.%d (generare %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Traducerea în limba română:\\\\line• Alexandru Gîrlea\\\\line• Mihai Străuț\\\\line• Fedorovici Constantin-Robert\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Raportați probleme sau solicitați îmbunătățiri la:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Drepturi de autor suplimentare:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Politică de actualizare:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Dacă alegeți să permiteți acestui program să caute actualizări, sunteți de acord ca următoarele informații să fie colectate și stocate pe serverele noastre:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Arhitectura și versiunea sistemului dvs. de operare\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Versiunea de aplicație pe care o utilizați\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Adresa dvs. IP\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Vom păstra aceste informații, în scopul de a crea statistici de utilizare private, \\\\b timp de cel mult un an\\\\b0 . Totuși, vă garantăm că nu vom trimite aceste date către terțe părți.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Proces de actualizare:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus nu instalează și nu rulează servicii de fundal. Așadar, căutarea actualizărilor va avea loc doar în timp ce aplicația principală rulează.\\\\line\\n\"\n\"Accesul la internet este, desigur, necesar atunci când se caută actualizări.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Imaginea nu este validă pentru opțiunea de boot selectată\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Imaginea curentă nu se potrivește cu opțiunea de boot selectată. Vă rugăm să folosiți altă imagine sau să alegeți altă opțiune de boot.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Această imagine ISO nu este compatibilă cu sistemul de fișiere selectat\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Unitate incompatibilă detectată\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Pas scriere\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Pas citire\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"S-a descărcat %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Nu s-a putut descărca %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Se folosește versiunea inclusă a fișierului/fișierelor %s\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"IMPORTANT: ACEASTĂ UNITATE UTILIZEAZĂ O MĂRIME DE SECTOR NON-STANDARD!\\n\"\n\"\\n\"\n\"Unitățile convenționale folosesc o mărime de sector de 512 baiți, însă această unitate folosește una de %d baiți. În multe cazuri, unitatea NU va porni.\\n\"\n\"Rufus poate încerca să creeze o unitate bootabilă, însă nu există NICIO GARANȚIE că aceasta va funcționa corect.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Mărime sector non-standard detectată\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' poate fi instalat pe o unitate partiționată cu GPT doar dacă aceasta are atributul FIXED setat. Unitatea curentă nu a fost detectată ca fiind FIXED...\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Această acțiune nu este valabilă pe această platformă.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Se anulează - Vă rugăm să așteptați...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Se scanează imaginea...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Nu s-a putut scana imaginea\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"%s învechit detectat\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Se folosește imaginea: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Lipsește fișierul %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Volum nou\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"S-a găsit %d dispozitiv\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"S-au găsit %d dispozitive\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"GATA\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Anulat\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Eșuat\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Se lansează noua aplicație...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Lansarea noii aplicații a eșuat\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Deschis %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Salvat %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Se formatează: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Se creează sistemul de fișiere: Pasul %d din %d\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Fixup NTFS: %d%% finalizat\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Se formatează (%s) - durată estimată %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Se setează eticheta (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Se formatează (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Fixup NTFS (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Se șterg structurile MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Se solicită accesul la disc...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Se analizează înregistrările de boot existente...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Se închide volumul existent...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Se scrie Master Boot Record...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Se scrie Partition Boot Record...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Se copiază fișierele DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Se copiază fișierele imaginii ISO: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Configurare boot EFI Win7 (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Se finalizează, vă rugăm să așteptați...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Se instalează Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Blocuri defecte: %s %d/%d - %0.2f%% (erori %d/%d/%d)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Blocuri defecte: se testează cu modelul aleator\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Blocuri defecte: se testează cu modelul 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Se partiționează (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Se șterg partițiile (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Semnătura pentru actualizarea descărcată nu poate fi validată. Ori că sistemul dvs. nu este configurat pentru validarea semnăturilor, ori este vorba de o descărcare malițioasă.\\n\"\n\"\\n\"\n\"Descărcarea va fi ștearsă. Vă rugăm să verificați jurnalul pentru mai multe detalii.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Se descarcă: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Nu s-a putut descărca fișierul.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Se caută actualizări Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Actualizări: Nu s-a putut realiza conexiunea la internet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Actualizări: Nu s-au putut accesa datele despre versiune\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Este disponibilă o nouă versiune Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Nu a fost găsită o versiune nouă de Rufus\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Registrul de chei al aplicației a fost șters cu succes\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Nu s-a putut șterge registrul aplicației\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s activat\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s dezactivat\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Verificări mărime\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Detectare hard disk\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Formatare Large FAT32 forțată\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutoRun va fi șters la ieșire\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Detectare unitate falsă\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Suport Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Suport Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Actualizare forțată\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"Compresie NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Se scrie imaginea: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Suport ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Utilizare unități de măsură corecte\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Se șterge directorul '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Detectare disc VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Mod UEFI/BIOS dual\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Se aplică imaginea Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Se aplică imaginea Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Păstrare marcaje de timp\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Depanare USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Se calculează sumele de control ale imaginii: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Calculează sumele de control MD5, SHA1 și SHA256 pentru imaginea selectată\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Schimbați limba aplicației\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Imagine %s detectată\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Imaginea selectată este de tip 'ISOHybrid'. Aceasta poate fi scrisă fie în modul %s (copiere fișiere) sau în modul %s (imagine disc).\\n\"\n\"Rufus recomandă modul %s, astfel încât să aveți acces deplin la unitatea utilizată.\\n\"\n\"Dacă vă confruntați cu probleme în timpul pornirii, puteți încerca să scrieți imaginea din nou în modul %s.\\n\"\n\"\\n\"\n\"Vă rugăm să alegeți modul în care doriți să se scrie această imagine:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Scriere în modul %s (Recomandat)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Scriere în modul %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Se caută procese conflictuale...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Nebootabil\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disc sau imagine ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Vă rugăm să selectați)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Blocare unitate USB exclusivă\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Semnătura nu este validă\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Fișierului executabil descărcat îi lipsește o semnătură digitală.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Executabilul descărcat este semnat de către '%s'.\\n\"\n\"Aceasta nu este o semnătură recunoscută și ar putea indica o anumită formă de activitate dăunătoare...\\n\"\n\"Sigur doriți să executați acest fișier?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Se scriu zerouri pe unitate: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Detectarea unităților amovibile non-USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Lipsă permisiuni administrator\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Această aplicație va funcționa doar dacă o executați ca administrator\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Indexare fișiere\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Selectare versiune\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Vă rugăm să selectați versiunea de Windows pe care doriți să o instalați:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Versiune Windows neacceptată\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Această versiune de Windows nu mai este acceptată de Rufus.\\n\"\n\"Ultima versiune de Rufus compatibilă cu această platformă este v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Avertisment: versiune neoficială\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Această versiune de Rufus nu a fost produsă de dezvoltatorul oficial.\\n\"\n\"\\n\"\n\"Sigur doriți să o rulați?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"S-a detectat un ISO trunchiat\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Fișierul ISO pe care l-ați selectat nu se potrivește cu dimensiunea sa declarată: %s de date lipsesc!\\n\"\n\"\\n\"\n\"Dacă ați obținut acest fișier de pe internet, ar trebui să încercați să descărcați o copie nouă și să verificați dacă sumele de control MD5 sau SHA se potrivesc cu cele oficiale.\\n\"\n\"\\n\"\n\"Rețineți că puteți calcula MD5 sau SHA în Rufus dând click pe butonul (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Eroare validare marcaj de timp\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus nu a putut valida că marcajul de timp al actualizării descărcate este mai recent decât executabilul curent.\\n\"\n\"\\n\"\n\"Pentru a preveni posibilele scenarii de atac, procesul de actualizare a fost anulat și descărcarea va fi ștearsă. Vă rugăm să verificați jurnalul pentru mai multe detalii.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Afișați setările aplicației\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Afișați informații despre această aplicație\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Afișați jurnalul\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Generați o imagine de disc după dispozitivul selectat\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Utilizați această opțiune pentru a indica dacă planificați să instalați Windows pe un alt disc, sau dacă doriți să rulați Windows direct de pe această unitate (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Se scriu rapid zerouri pe unitate: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"poate dura mai mult timp\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Detectare VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Arhivă comprimată\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Fișierul ISO selectat utilizează UEFI și este destul de mic pentru a fi scris ca EFI System Partition (ESP). Scrierea ca ESP, în locul scrierii unei partiții generice ce ocupă întregul disc, este de preferat pentru anumite tipuri de instalare.\\n\"\n\"\\n\"\n\"Vă rugăm să selectați modul în care doriți să scrieți această imagine:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Folosiți %s (în fereastra principală a aplicației) pentru a activa.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Hash-uri extra (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Salvare pe VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Calculare sume de control pentru imagine\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Butoane multiple\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Număr de pași\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID disc\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Prioritate implicită pentru firul de execuție: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignorare Boot Marker\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Se reîmprospătează așezarea partițiilor (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Imaginea selectată este de tip ISOHybrid, însă creatorii acesteia nu au făcut-o să fie compatibilă cu modul ISO/Copiere fișiere.\\n\"\n\"Drept urmare, modul imagine DD va fi aplicat.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Nu se poate deschide sau citii '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Aplicând modificări la Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Aplicând optiuni de utilizator...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Experiența utilizatorului de Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Doriți să modificați instalația de Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Elimină necesitatea de 4GB+ RAM, Bootare Securizată si TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Elimină necesitatea pentru un cont Microsoft\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Blochează colectarea de date (Sari peste întrebările de intimitate)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Blochează Windows To Go de la accesarea discurilor interne\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Crează un cont local cu nume de utilizator:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Serează opțiunile regionale să aibă aceleași valori ca acestui utilizator\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Blochează BitLocker de la encriptarea automată a dispozitivului\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Logare persistentă\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Un fișier adițional ('diskcopy.dll') trebuie să fie descărcat de la Microsoft pentru  a instala MS-DOS:\\n\"\n\"- Selectează 'Da' ca să te conectezi la Internet și să le descarci\\n\"\n\"- Selectează 'Nu' pentru a anula operațiunea\\n\"\n\"\\n\"\n\"Notiță: Acest fișier va fi descărcat in aceeași locație cu aplicația și va fi reutilizat automat dacă este prezent.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Bootloader UEFI nepermis detectat\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus a detectat că fișierul ISO care lai selectat conține un bootloader UEFI care nu este permis si ar produce %s, cand Secure Boot este activat pe un system UEFI actualizat.\\n\"\n\"\\n\"\n\"- Dacă ai făcut rost de aceasta imagine ISO de la o sursă de neîncredere, este recomandat să consideri posibilitatea că ar putea conține malware UEFI ce nu ar permite pornirea de la aceasta.\\n\"\n\"- Dacă ai făcut rost de aceasta de la o sursă de încredere, ar putea fi necesară căutarea unei versiuni mai noi, care nu ar produce acest avertisment.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"un ecran de \\\"Încălcare de Securitate\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"un ecran de Recuperare Windows (BSOD) cu '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Imagine VHDX comprimată\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Imagine VHD necomprimată\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Flash complet de imagine de actualizare\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Niște date adiționale trebuie descărcate de la Microsoft pentru a folosii această funție:\\n\"\n\"- Selectează 'Da' ca să te conectezi la Internet și să le descarci\\n\"\n\"- Selectează 'Nu' pentru a anula operațiunea\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Restricționează Windows la S-Mode (INCOMPATIBIL cu bypass-ul pentru un cont online)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Mod expert\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Extractând fișiere arhivate: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Folosește Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus este un utilitar care ajută la formatarea și crearea de drive-uri USB bootabile, precum cheile sau pendriverele USB, unități de memorie, etc.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Site official: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Codul Sursei: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Listă de schimbări: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Această aplicație este sub liciența și termenii și condițiile ale lui GNU Public License (GPL) versiunea a 3-a.\\n\"\n\"Vazi https://www.gnu.org/licenses/gpl-3.0.en.html pentru detalii.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Bootează\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatează USB, card flash si drive-uri virtuale la FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Crează drive USB bootabil FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Crează drive-uri bootabile de la ISO-uri bootabile (Windows, Linux, etc.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Crează drive-uri de la imagini de disc bootabile, incluzând cele compresate\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Crează discuri bootabile BIOS sau UEFI, incluzând NTFS-uri bootabile de UEFI\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Crează discuri 'Windows To Go'\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Crează drive de instalare Windows 11 pe computere care nu au TPM sau Bootare Securizată\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Crează partiție de Linux persistentă\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Crează imagini VHD/DD de pe drive-ul selectat\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Compută MD5, SHA-1, SHA-256 și SHA-512 suma de control ale imaginilor selectate\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Verifică blocuri rele, incluzând detectarea de drive-uri flash \\\"false\\\"\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Descarcă un Microsoft Windows ISO oficial de vânzare\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Descarcă UEFI Shell ISO-uri\"\n"
  },
  {
    "path": "res/loc/po/ru-RU.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2025-11-12 17:40+0000\\n\"\n\"PO-Revision-Date: 2025-11-12 17:42+0000\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: ru_RU\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Russian (Русский)\\n\"\n\"X-Rufus-LCID: 0x0419, 0x0819\\n\"\n\"X-Generator: Poedit 3.8\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Свойства диска\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Устройство\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Метод загрузки\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Выбрать\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Параметры образа\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Схема раздела\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Целевая система\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Список USB-дисков\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Добавить исправления для старых BIOS\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Проверка носителя UEFI во время выполнения\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Параметры форматирования\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Файловая система\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Размер кластера\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Новая метка тома\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Быстрое форматирование\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Проверить на плохие блоки\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Создать расширенную метку и значок устройства\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Статус\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Закрыть\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Старт\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"О программе Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Лицензия\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"ОК\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Лицензия Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Ещё\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Да\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Нет\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Журнал\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Очистить\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Сохранить\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Политика обновления и параметры\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Параметры\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Проверка наличия обновлений\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Включая бета-версии\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Проверить\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Проверка наличия обновлений - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Доступна новая версия. Скачайте её!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Щёлкните здесь, чтобы перейти на сайт\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Примечания к версии\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Скачать\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Запущена другая копия Rufus\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Запущена другая копия программы.\\n\"\n\"Закройте первую копию перед запуском ещё одной.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"ВНИМАНИЕ: ВСЕ ДАННЫЕ НА ДИСКЕ '%s' БУДУТ УНИЧТОЖЕНЫ.\\n\"\n\"Чтобы продолжить, нажмите ОК. Для выхода нажмите 'Отмена'.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Политика обновления Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Хотите, чтобы Rufus проверял обновления автоматически?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Отмена\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Найдены плохие блоки\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Проверка закончена. Плохих блоков: %d\\n\"\n\"  Ошибок чтения: %d\\n\"\n\"  Ошибок записи: %d\\n\"\n\"  Повреждённых блоков: %d\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Подробный отчёт см. тут:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Отключено\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Ежедневно\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Еженедельно\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Ежемесячно\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"По выбору\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Ваша версия: %d.%d (сборка %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Новейшая версия: %d.%d (сборка %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"байт\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"КБ\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"МБ\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"ГБ\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"ТБ\"\n\n#. • MSG_025\n#.\n#. *Short* version of the petabyte size suffix\nmsgid \"PB\"\nmsgstr \"ПБ\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"КБ\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"МБ\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"По умолчанию\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (по умолчанию)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (или UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (не-CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS или UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d проход\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d прохода %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Образ ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Приложение\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Отменить\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Запустить\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Операция прервана пользователем\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Ошибка\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Ошибка: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Скачивание файла\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB-устройство хранения данных\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Диск %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Несколько разделов\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Очистка буферов\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Отмена\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Успешно.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Неизвестная ошибка при форматировании.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Для этого устройства невозможно использовать выбранную файловую систему.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Нет доступа к устройству.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Носитель данных защищён от записи.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Это устройство используется другим процессом. Сначала завершите процесс.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Для этого устройства быстрый формат недоступен.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Недопустимая метка тома.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Недопустимый дескриптор устройства.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Недопустимый размер кластера для этого устройства.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Недопустимый размер тома.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Вставьте сменный носитель информации в устройство.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Получена неподдерживаемая команда.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Ошибка распределения памяти.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Ошибка чтения.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Ошибка записи.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Ошибка установки\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Невозможно открыть носитель информации. Возможно, он используется другим процессом. Извлеките носитель информации и вставьте его вновь.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Не удалось создать раздел на диске.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Не удалось скопировать файлы на целевое устройство.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Отменено пользователем.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Невозможно запустить поток.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Проверка на плохие блоки не завершена.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Ошибка сканирования образа ISO.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Ошибка извлечения образа ISO.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Невозможно перемонтировать том.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Невозможно исправить/настроить файлы для загрузки.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Невозможно назначить букву диска.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Невозможно смонтировать том GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Устройство не готово.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus обнаружил, что Windows всё ещё очищает внутренний буфер USB-устройства.\\n\"\n\"\\n\"\n\"В зависимости от скорости USB-устройства, эта операция может занять много времени, особенно для больших файлов.\\n\"\n\"\\n\"\n\"Чтобы избежать повреждения устройства, дождитесь, пока Windows закончит. Но если Вам надоест ждать, можете просто отключить устройство...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Неподдерживаемый образ\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Образ либо незагрузочный, либо использует метод загрузки или сжатия, не поддерживаемый Rufus.\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Заменить %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Образ ISO использует устаревшую версию '%s'.\\n\"\n\"Загрузочные меню могут отображаться неправильно.\\n\"\n\"\\n\"\n\"Новую версию можно скачать с помощью Rufus:\\n\"\n\"- Выберите 'Да', чтобы скачать файл из Интернета\\n\"\n\"- Выберите 'Нет', чтобы не изменять образ ISO\\n\"\n\"Если вы не знаете, что делать, то выберите 'Да'.\\n\"\n\"\\n\"\n\"Файл загрузится в текущую папку, а если в ней есть '%s', то он будет автоматически заменён.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Загрузка %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Не выбран образ\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"для %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Слишком большой образ\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Образ слишком большой для выбранного устройства.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Неподдерживаемый образ ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"При использовании целевого типа UEFI поддерживаются только загрузочные образы ISO. Выберите загрузочный образ EFI или измените целевой тип BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Неподдерживаемая файловая система\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"ВАЖНО: НА ЭТОМ ДИСКЕ НЕСКОЛЬКО РАЗДЕЛОВ!!\\n\"\n\"\\n\"\n\"Этот диск может содержать разделы/тома, которые отсутствуют в списке или даже не видны в Windows. В случае продолжения Вы несёте ответственность за любую потерю данных на этих разделах.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Обнаружено несколько разделов\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD-образ\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Выбранная файловая система не может использоваться с этим типом образа ISO. Выберите другую файловую систему или другой образ ISO.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' может использоваться только с файловой системой NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"ВАЖНО: Вы пытаетесь установить Windows To Go, но у целевого диска нет атрибута 'FIXED' (несъёмный). Из-за этого Windows, скорее всего, зависнет при загрузке, так как Windows To Go предназначена для работы только с дисками с атрибутом 'REMOVABLE' (съёмный).\\n\"\n\"\\n\"\n\"Всё равно хотите продолжить?\\n\"\n\"\\n\"\n\"* Атрибут 'FIXED/REMOVABLE' - это свойство оборудования. Его можно изменить только с помощью специальных инструментов от производителя, которые ПОЧТИ НИКОГДА не предоставляются общественности...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Ограничения файловой системы\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Этот образ ISO содержит файл размером более 4 ГБ, что превосходит максимальный размер для файловой системы FAT или FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Отсутствует поддержка WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Ваша система не может извлекать файлы из архивов WIM. Распаковка таких архивов необходима для создания загрузочных USB-накопителей EFI для Windows 7 и Windows Vista. Чтобы решить эту проблему, установите новейшую версию 7-Zip.\\n\"\n\"Открыть страницу загрузки 7-Zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Загрузить %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s или новее требует наличия файла '%s'.\\n\"\n\"Поскольку размер этого файла больше 100 КБ, и он всегда присутствует в ISO-образах %s, он не встроен в Rufus.\\n\"\n\"\\n\"\n\"Rufus может скачать недостающий файл:\\n\"\n\"- Выберите 'Да', если хотите скачать этот файл\\n\"\n\"- Выберите 'Нет', если хотите скачать его вручную позже\\n\"\n\"\\n\"\n\"* Файл будет скачан в текущую папку. Если в ней есть '%s', он будет автоматически перезаписан.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"При отмене устройство может оказаться в НЕРАБОЧЕМ состоянии.\\n\"\n\"Если Вы уверены, что хотите отменить операцию, нажмите 'Да'. Иначе - нажмите 'Нет'.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Выберите папку\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Все файлы\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Журнал Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Диск %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS не может загрузиться с диска с кластерами размером 64 КБ.\\n\"\n\"Измените размер кластера или используйте FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Несовместимый размер кластеров\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Форматирование больших томов UDF может занять много времени. При скоростях USB 2.0 форматирование продлится примерно %d:%02d, в течение этого времени индикатор хода операции будет казаться неработающим. Проявите терпение, пожалуйста!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Большой UDF-том\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Этот образ использует Syslinux %s%s, но в данном приложении есть только установочные файлы для Syslinux %s%s.\\n\"\n\"\\n\"\n\"Так как версии Syslinux несовместимы друг с другом, дополнительные файлы (ldlinux.sys and ldlinux.bss) нужно загрузить из Интернета:\\n\"\n\"- Выберите 'Да', чтобы скачать файлы из Интернета\\n\"\n\"- Выберите 'Нет', чтобы отменить операцию\\n\"\n\"\\n\"\n\"* Файлы загрузятся в текущую папку приложения, имеющиеся там одноимённые файлы будут перезаписаны.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Требуется загрузка из Интернета\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Этот образ использует загрузчик GRUB %s, но приложение включает только установочные файлы для GRUB %s.\\n\"\n\"\\n\"\n\"Различные версии GRUB могут быть несовместимы друг с другом. Rufus попытается найти нужную версию установочного файла GRUB (core.img), соответствующую версии загрузчика вашего образа:\\n\"\n\"- Выберите 'Да', чтобы скачать установочный файл из Интернета\\n\"\n\"- Выберите 'Нет', чтобы использовать версию по умолчанию из Rufus\\n\"\n\"- Выберите 'Отмена', чтобы отменить операцию\\n\"\n\"\\n\"\n\"* Файл загрузится в текущую папку приложения, если в ней уже есть одноимённый файл, он будет автоматически перезаписан. Если нужную версию установщика не удастся найти в Интернете, будет использоваться версия по умолчанию.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Стандартная установка Windows\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"расширенные свойства диска\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"расширенные параметры форматирования\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Показать %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Скрыть %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Постоянный размер раздела\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Без раздела\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the persistence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Установите размер постоянного раздела для live-носителя USB. 0 - отключить постоянный раздел.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Установите единицы размера раздела.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Больше это не показывать\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Важное примечание о %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Вы только что создали носитель с загрузчиком UEFI:NTFS. Учтите, что для загрузки этого носителя НУЖНО ОТКЛЮЧИТЬ БЕЗОПАСНУЮ ЗАГРУЗКУ.\\n\"\n\"Чтобы узнать, почему это необходимо, нажмите кнопку 'Ещё'.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Выбор образа Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Этот файл ISO содержит несколько образов Windows.\\n\"\n\"Выберите образ, который Вы хотите использовать для этой установки:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"К этому диску обращается другая программа или процесс. Всё равно настаиваете на форматировании?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus обнаружил, что вы пытаетесь создать носитель Windows To Go на основе ISO 1809.\\n\"\n\"\\n\"\n\"Из-за *ОШИБКИ MICROSOFT* этот носитель будет давать сбой при загрузке Windows (BSOD), если вы вручную не замените файл WppRecorder.sys версией 1803.\\n\"\n\"\\n\"\n\"Rufus не может это исправить автоматически, так как WppRecorder.sys - это файл Microsoft, защищённый авторскими правами, поэтому мы не можем легально встраивать в приложение его копию.\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Поскольку для схемы разделов выбрана MBR, на этом носителе Rufus может создать только раздел размером до 2 ТБ, а %s дискового пространства останутся недоступными.\\n\"\n\"\\n\"\n\"Вы действительно хотите продолжить?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Версия\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Выпуск\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Редакция\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Язык\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Архитектура\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Продолжить\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Назад\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Подождите...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Скачать в браузере\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Microsoft временно заблокировала скачивание образов Windows из-за большого количества загрузок.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Для запуска этого скрипта требуется PowerShell версии 3.0 или новее.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Хотите скачать из Интернета?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Запуск загрузки скрипта...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Загрузить образ ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Тип компьютера, с которым вы планируете использовать этот загрузочный диск. Прежде чем создавать диск, вы должны определить, что используется в вашей системе: BIOS или UEFI, иначе диск может не загрузиться.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' означает, что устройство будет загружаться только в режиме эмуляции BIOS (также называемом 'Legacy Mode') под UEFI, а не в режиме UEFI.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'non-CSM' означает, что устройство будет загружаться только в режиме UEFI, а не в режиме эмуляции BIOS (также известном как 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Тестовый образец: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Тестовый образец: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Тестовый образец: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Тестовый образец: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Выбор целевой файловой системы\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Выбор минимального размера блока данных в файловой системе\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Запись новой метки тома.\\n\"\n\"Поддерживаются международные символы.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Развернуть дополнительные параметры\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Проверка устройства на плохие блоки с помощью тестового образца\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Снимите этот флажок, чтобы использовать \\\"медленное\\\" форматирование\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Метод, который будет использоваться для создания разделов\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Метод, который будет использоваться для создания загрузочного диска\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Нажмите, чтобы выбрать или загрузить образ...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"\"\n\"Разрешить отображение меток с международными символами и задать значок устройства\\n\"\n\"(создаётся файл autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Установить загрузчик UEFI, который проверит файл MD5Sum на носителе\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Создать дополнительный скрытый раздел и попробовать выровнять границы разделов.\\n\"\n\"Это может улучшить обнаружение загрузчика в старых BIOS.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"\"\n\"Отображать внешние жёсткие диски USB.\\n\"\n\"ИСПОЛЬЗУЙТЕ НА СВОЙ СТРАХ И РИСК!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Начать форматирование.\\n\"\n\"Все данные на диске будут УНИЧТОЖЕНЫ!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Неверная подпись обновления\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Нажмите для выбора...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Надёжная утилита для форматирования USB-дисков\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Версия %d.%d (сборка %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Русский перевод: Дмитрий Ерохин <mailto:erodim@mail.ru>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Сообщить об ошибке или предложить улучшение:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Дополнительные авторские права:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Политика обновления:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Разрешая проверку обновлений, Вы соглашаетесь, что на наших серверах может собираться следующая информация:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Версия и архитектура Вашей операционной системы\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Версия используемого приложения\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Ваш IP-адрес\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Для получения статистики использования программы мы можем хранить собранную информацию \\\\b не более года\\\\b0 . Однако мы не будем добровольно раскрывать какие-либо из этих персональных данных сторонним лицам.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Обновление:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus не устанавливает и не запускает фоновые службы, поэтому проверка наличия обновлений выполняется, только когда запущено основное приложение.\\\\line\\n\"\n\"Для проверки обновлений требуется доступ к Интернету.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Неверный образ для выбранного варианта загрузки\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Текущий образ не соответствует выбранному варианту загрузки. Выберите другой образ или другой вариант загрузки.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Этот образ ISO не совместим с выбранной файловой системой\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Обнаружен несовместимый диск\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Запись\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Чтение\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Загружено %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Не удалось загрузить %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Использовать встроенную версию %s файлов\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"ВАЖНО: НА ЭТОМ ДИСКЕ СЕКТОРЫ НЕСТАНДАРТНОГО РАЗМЕРА!\\n\"\n\"\\n\"\n\"Обычные накопители используют секторы размером 512 байт, а на этом диске они %d-байтовые. Во многих случаях это означает, что Вы НЕ СМОЖЕТЕ загрузиться с этого диска.\\n\"\n\"Rufus попытается создать загрузочный диск, но БЕЗ ГАРАНТИИ, что он будет работать.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Обнаружен нестандартный размер секторов\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"Windows To Go может быть установлена на диск с разделом GPT только в том случае, если у диска есть атрибут FIXED (несъёмный). У выбранного диска такого атрибута не обнаружено.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Эта функция недоступна на данной платформе.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Отмена, подождите...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Сканирование образа...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Не удалось просканировать образ\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Обнаружен устаревший %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Используется образ: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Отсутствует файл %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Новый том\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"Обнаружено устройств: %d\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"Обнаружено устройств: %d\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"Готов\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Отменено\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Ошибка\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Запуск нового приложения...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Не удалось запустить новое приложение\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Открыт %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Сохранён %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Форматирование: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Создание файловой системы: %d/%d выполнено\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS Fixup: %d%% выполнено\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Форматирование (%s), примерно %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Установка метки (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Форматирование (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Проверка NTFS-области Fixup...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Очистка структур MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Запрос доступа к диску...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Анализ загрузочных записей...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Закрытие существующего тома...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Запись главной загрузочной записи...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Запись загрузочной записи раздела...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Копирование DOS-файлов...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Копирование ISO-файлов: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Настройка EFI-загрузки Win7 (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Завершение, подождите...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Установка Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Плохие блоки: %s %d/%d - %0.2f%% (ошибки: %d/%d/%d)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Плохие блоки: Тестирование со случайным шаблоном\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Плохие блоки: Тестирование с шаблоном 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Разметка раздела (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Удаление разделов (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Невозможно проверить подпись загруженного обновления. Это может означать, что Ваша система неправильно настроена для проверки подписей, либо было загружено вредоносное ПО.\\n\"\n\"\\n\"\n\"Обновление будет удалено. См. подробности в файле-журнале.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Загрузка: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Не удалось скачать файл.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Проверка наличия обновлений...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Обновления: Нет доступа в Интернет\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Обновления: Нет доступа к данным о версии\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Доступна новая версия Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Новых версий Rufus не найдено\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Ключи приложения в реестре успешно удалены\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Не удалось удалить ключи приложения в реестре\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s - вкл.\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s - откл.\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Определение размера\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Определение накопителей\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Форматирование в Large FAT32\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"Параметр NoDriveTypeAutorun будет удалён при выходе\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Обнаружение поддельных дисков\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Поддержка Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Поддержка Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Принудительное обновление\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS-сжатие\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Запись образа: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Поддержка ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Использовать правильные размеры\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Удаление папки '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Обнаружение дисков VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Двойной режим UEFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Применение образа Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Применение образа Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Сохранять даты\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB-отладка\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Вычисление контрольных сумм: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Вычислить контрольные суммы MD5, SHA1 и SHA256 для выбранного образа\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Изменить язык приложения\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Обнаружен образ %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Выбран образ ISOHybrid. Это означает, что его можно записать либо в %s режиме копирования файлов, либо в %s режиме образа диска.\\n\"\n\"Для полного доступа к диску после записи рекомендуется использовать режим %s.\\n\"\n\"Если возникают проблемы при загрузке, ещё раз попробуйте записать образ в режиме %s.\\n\"\n\"\\n\"\n\"Выберите режим записи этого образа:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Запись в режиме %s (рекомендуется)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Запись в режиме %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Проверка конфликтующих процессов...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Незагрузочный\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Диск или образ ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (выберите)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Эксклюзивная блокировка USB-диска\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Неверная подпись\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"У загруженного файла отсутствует цифровая подпись.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Загруженный файл подписан '%s'.\\n\"\n\"Это не наша подпись, возможно, похозяйничало вредоносное ПО...\\n\"\n\"Вы действительно хотите запустить этот файл?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Обнуление диска: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Обнаружение съёмных дисков не-USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Отсутствуют повышенные привилегии\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Эта программа может работать только с повышенными правами\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Индексирование файлов\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Выбор версии\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Выберите версию Windows для установки:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Неподдерживаемая версия Windows\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Эта версия Windows больше не поддерживается Rufus.\\n\"\n\"Последняя версия Rufus, совместимая с этой платформой - v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"ВНИМАНИЕ: Неофициальная версия\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Эта версия Rufus не была выпущена официальным разработчиком.\\n\"\n\"\\n\"\n\"Вы действительно хотите её запустить?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Обнаружен усечённый образ ISO\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Выбранный образ ISO не соответствует заявленному размеру: %s данных отсутствует!\\n\"\n\"\\n\"\n\"Если Вы скачали этот файл из Интернета, загрузите его снова и проверьте, совпадают ли контрольные суммы MD5 или SHA.\\n\"\n\"\\n\"\n\"Чтобы вычислить MD5 или SHA в Rufus, нажмите кнопку (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Ошибка проверки временной метки\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus не смог подтвердить, что временная метка загруженного обновления более поздняя, ​​чем дата текущего исполняемого файла.\\n\"\n\"\\n\"\n\"Чтобы предотвратить возможную атаку, обновление было прервано, а загруженный файл - удалён. См. подробности в файле-журнале.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Показать настройки приложения\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Показать информацию о приложении\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Показать журнал\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Создать образ диска выбранного устройства\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Используйте эту опцию, если Вы хотите установить Windows на другой диск или запускать Windows прямо с этого диска (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Быстрое обнуление диска: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"это может занять время\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Обнаружение VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Сжатый архив\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Выбранный образ ISO использует UEFI и достаточно мал, чтобы его можно было записать как системный раздел EFI (ESP). Запись в ESP вместо записи в общий раздел данных, занимающий весь диск, может быть предпочтительнее для некоторых типов установок.\\n\"\n\"\\n\"\n\"Выберите режим записи этого образа:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Чтобы включить, используйте %s (в главном окне программы).\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Дополнительные хеши (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Сохранить в VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Вычислить контрольные суммы образа\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Несколько кнопок\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Количество проходов\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"Идентификатор диска\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Приоритет потока по умолчанию: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Игнорировать загрузочный маркер\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Обновление макета разделов (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Выбранный образ - ISOHybrid, но создатели не сделали его совместимым с режимом копирования ISO/файла.\\n\"\n\"Из-за этого будет применён режим записи образа DD.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Не удалось открыть или прочитать '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Применение настройки Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Применение параметров пользователя...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Опыт использования Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Настроить установку Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Удалить требования 4+ ГБ ОЗУ, безопасной загрузки и TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Удалить требование сетевой учётной записи Microsoft\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Отключить сбор данных (пропустить вопросы о конфиденциальности)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Запретить Windows To Go доступ к внутренним дискам\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Создать локальную учётную запись с именем пользователя:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Установить те же региональные параметры, что и для этого пользователя\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Отключить автоматическое шифрование устройств BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Постоянный журнал\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('%s') must be downloaded from Microsoft to use this feature:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Для использования этой функции необходимо загрузить дополнительный файл ('%s') с сайта Microsoft:\\n\"\n\" 'Да' - загрузить его из Интернета\\n\"\n\" 'Нет' - отменить операцию\\n\"\n\"\\n\"\n\"* Файл загрузится в папку приложения, если там есть одноимённый файл, он будет автоматически перезаписан.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Обнаружен отозванный загрузчик UEFI\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Выбранный образ ISO содержит отозванный загрузчик UEFI, который выдаёт %s, когда безопасная загрузка включена в полностью обновленной системе UEFI.\\n\"\n\"\\n\"\n\"- Если Вы получили этот образ ISO из ненадёжного источника, учтите, что он может содержать вредоносное ПО UEFI, и не загружайтесь с него.\\n\"\n\"- Если Вы получили его из надёжного источника, попробуйте найти более новую версию, которая не будет выдавать это предупреждение.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"экран нарушения безопасности\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"экран восстановления Windows (BSOD) с '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Сжатый образ VHDX\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Несжатый образ VHD\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Образ Full Flash Update (FFU)\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Для этой функции необходимо загрузить дополнительные данные с сайта Microsoft:\\n\"\n\" 'Да' - загрузить их из Интернета\\n\"\n\" 'Нет' - отменить операцию\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Ограничить Windows S-режимом (НЕСОВМЕСТИМО с обходом онлайн-аккаунта)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Экспертный режим\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Распаковка архивов: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Использовать MBR Rufus\"\n\n#. • MSG_350\nmsgid \"Use 'Windows CA 2023' signed bootloaders (requires a compatible target PC)\"\nmsgstr \"\"\n\n#. • MSG_351\nmsgid \"Checking for UEFI bootloader revocation...\"\nmsgstr \"\"\n\n#. • MSG_352\nmsgid \"Checking for UEFI DBX updates...\"\nmsgstr \"\"\n\n#. • MSG_353\nmsgid \"DBX update available\"\nmsgstr \"\"\n\n#. • MSG_354\nmsgid \"\"\n\"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\\n\"\n\"- Select 'Yes' to connect to the Internet and download this content\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus - это утилита для форматирования и создания загрузочных флеш-накопителей USB.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Официальный сайт: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Исходный код: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Изменения: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Это приложение распространяется по лицензии GNU Public License (GPL) версии 3.\\n\"\n\"Подробнее см. https://www.gnu.org/licenses/gpl-3.0.ru.html.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Загрузочный\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Форматирование USB, флешек и виртуальных дисков в FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Создание загрузочных USB-дисков FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Создание загрузочных дисков из загрузочных образов ISO (Windows, Linux и т.д.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Создание загрузочных дисков из образов загрузочных дисков, в том числе сжатых\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Создание загрузочных дисков BIOS или UEFI, включая загрузочный UEFI NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Создание дисков Windows To Go\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Создание установочных дисков Windows 11 для компьютеров без TPM или безопасной загрузки\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Создание постоянных разделов Linux\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Создание образов VHD/DD выбранного диска\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Вычисление контрольных сумм MD5, SHA-1, SHA-256 и SHA-512 выбранного образа\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Проверка на плохие блоки, обнаружение \\\"поддельных\\\" флешек\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Загрузка официальных ISO-образов Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Загрузка ISO-образов оболочки UEFI\"\n"
  },
  {
    "path": "res/loc/po/sk-SK.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-12 10:18+0200\\n\"\n\"PO-Revision-Date: 2024-05-12 10:38+0200\\n\"\n\"Last-Translator: martinco78\\n\"\n\"Language-Team: \\n\"\n\"Language: sk_SK\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Slovak (Slovensky)\\n\"\n\"X-Rufus-LCID: 0x041B\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Nastavenia zariadenia\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Zariadenie\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Typ bootovania\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Prehliadať\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Nastavenia obrazu\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Schéma oddielu\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Cieľový systém\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Zobraziť zoznam USB pevných diskov (USB HDD)\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Pridať úpravy pre staré BIOSy (extra partície, ...)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Povoliť overenie médií UEFI v runtime režime\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Nastavenia formátovania\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Súborový systém\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Veľkosť klastra\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Nový názov zväzku\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Rýchle formátovanie\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Skontrolovať chybné bloky zariadenia\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Použiť poskytnutú menovku a súbory miniatúry\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Stav\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Zatvoriť\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Štart\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"O programe Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licencia\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"OK\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Licencia programu Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Viac informácií\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Áno\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Nie\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Záznam činnosti programu Rufus\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Vyčistiť\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Uložiť\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Zásady a nastavenia aktualizácií\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Nastavenia automatických aktualizácií\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Skontrolovať aktualizácie\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Zahrnúť beta verzie\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Skontrolovať\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Kontrola aktualizácií - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Je dostupná nová verzia. Stiahnite si poslednú verziu!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Kliknite tu, ak chcete prejsť na stránku a stiahnuť program manuálne\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Poznámky k vydaniu\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Stiahnuť\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Zistený spustený program\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Program Rufus je už spustený.\\n\"\n\"Pred spustením ďalšieho programu musíte zavrieť spustený program.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"VAROVANIE: PO SPUSTENÍ FORMÁTOVANIA BUDÚ VYMAZANÉ VŠETKY ÚDAJE NA CIEĽOVOM DISKU: %s\\n\"\n\"Ak chcete spustiť formátovanie disku stlačte tlačidlo OK.\\n\"\n\"Ak chcete túto operáciu ukončiť, stlačte tlačidlo ZRUŠIŤ.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Nastavenie automatických aktualizácií programu Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Chcete povoliť kontrolu aktualizácií programu Rufus?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Zrušiť\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Boli nájdené chybné bloky\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Kontrola dokončená:\\n\"\n\"  počet chybných blokov: %d\\n\"\n\"  počet chýb pri čítaní: %d\\n\"\n\"  počet chýb pri zapisovaní: %d\\n\"\n\"  počet poškodzujúcich chýb: %d\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Podrobnejšiu správu nájdete tu:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Zakázané\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Denne\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Týždenne\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Mesačne\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Vlastné\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Aktuálna verzia: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Posledná verzia: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"bajtov\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"KB\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"MB\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"GB\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"TB\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"PB\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobajtov\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabajtov\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Predvolené\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (predvolené)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (alebo UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (bez CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS alebo UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d pokus\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d pokusy %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Obraz ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Aplikácia\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Ukončiť\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Spustiť\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operácia bola zrušená používateľom\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Chyba\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Chyba: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Stiahnuť súbor\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Úložné zariadenie USB (všeobecné)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Disk %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Zariadenie s viacerým oddielmi\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Vyprázdňovanie dočasnej pamäte\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Ukončovanie operácie\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Dokončené.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Neurčitá chyba počas formátovania.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Nie je možné použiť vybraný súborový systém pre toto médium.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Prístup na disk bol odmietnutý.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Médium je chránené proti zápisu.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Disk je používaný iným procesom. Zatvorte procesy, ktoré môžu pristupovať na disk.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Rýchle formátovanie tohto disku nie je dovolené.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Názov disku je neplatný.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Identifikátor zariadenia je neplatný.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Vybraný klaster nie je platný pre toto zariadenie.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Názov zväzku je neplatný.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Pripojte výmenné médium.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Bol prijatý nepodporovaný príkaz.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Chyba pri pridelení pamäte.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Chyba čítania.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Chyba zápisu.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Inštalácia zlyhala\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Nie je možné otvoriť zariadenie. Možno je používané iným procesom. Skúste odpojiť a znovu pripojiť zariadenie a vyskúšajte to znovu.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Nie je možné vytvoriť oddiely.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Nie je možné kopírovať súbory do cieľovej jednotky.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Prerušené používateľom.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Nie je možné spustiť vlákno.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Kontrola chybných blokov nebola dokončená.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Analýza ISO obrazu zlyhala.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Rozbaľovanie ISO obrazu zlyhalo.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Nie je možné znovu pripojiť zväzok.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Nie je možné opraviť/inštalovať súbory pre bootovanie.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Nie je možné priradiť písmeno jednotky.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Nie je možné pripojiť GUID zväzok.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Zariadenie nie je pripravené.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Program Rufus zistil, že Windows stále vyprázdňuje internú vyrovnávajúcu pamäť na USB zariadení.\\n\"\n\"\\n\"\n\"Doba tejto operácie závisí na rýchlosti vášho USB disku, môže trvať dlhší čas, špeciálne pri veľkých súboroch.\\n\"\n\"\\n\"\n\"Doporučujeme nechať Windows dokončiť akciu, zabránite tak poškodeniu dát. Ak bude operácia trvať príliš dlho, môžete odpojiť zariadenie...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Nepodporovaný obraz\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Tento obraz už viac nie je bootovateľný alebo používa boot alebo kompresnú metódu, ktorá nie je podporovaná programom Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Nahradenie modulu %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Zdá sa, že tento ISO obraz používa zastaralú verziu modulu %s.\\n\"\n\"Bootovacie menu sa preto nemusí zobrazovať správne.\\n\"\n\"\\n\"\n\"Nová verzia modulu bude automaticky stiahnutá programom Rufus\\n\"\n\"a môže jednoducho odstrániť tento problém:\\n\"\n\"- Stlačte „Áno\\\" pre pripojenie na internet a stiahnutie súboru\\n\"\n\"- Stlačte „Nie\\\" a nechajte existujúci ISO súbor nezmenený\\n\"\n\"Ak neviete, čo máte robiť, vyberte tlačidlo „Áno\\\".\\n\"\n\"\\n\"\n\"Poznámka: Nový súbor „%s\\\" bude stiahnutý do aktuálneho priečinka programu a potom bude automaticky použitý.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Sťahovanie %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Nie je vybraný žiadny obraz disku\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"pre %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Obraz disku je príliš veľký\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Obraz disku je príliš veľký pre vybraný disk.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Nepodporovaný ISO obraz\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Ak použijete typ UEFI, iba EFI bootovateľné ISO obrazy budú podporované. Vyberte EFI bootovateľné ISO alebo nastavte cieľový typ ako BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Nepodporovaný súborový systém\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"DÔLEŽITÉ: TOTO ZARIADENIE OBSAHUJE NIEKOĽKO ODDIELOV!!\\n\"\n\"\\n\"\n\"Zariadenie môže obsahovať oddiely alebo zväzky, ktorú nie sú čitateľné alebo dokonca viditeľné pre Windows. Ak budete pokračovať, môžete stratiť všetky údaje na týchto oddieloch.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Boli zistené viaceré oddiely\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"Obraz DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"\"\n\"Vybratý systém súborov nemôže byť použitý pre tento typ ISO obrazu.\\n\"\n\"Vyberte iný súborový systém alebo použite iný ISO obraz.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"„%s\\\" môže byť použitý iba pre súborový systém NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"DÔLEŽITÉ: Pokúšate sa nainštalovať „Windows To Go\\\", ale vaša cieľová jednotkanemá atribút „UPRAVENÝ„. Takýto systém Windows takmer určite zamrzne počas bootovania,ak nebol navrhnutý spoločnosťou Microsoft pre prácu so zariadeniami, ktoré majú atribút „VYMENITEĽNÝ\\\".\\n\"\n\"\\n\"\n\"Ste si istý, že chcete pokračovať?\\n\"\n\"\\n\"\n\"Poznámka: Atribút „UPRAVENÝ/VYMENITEĽNÝ\\\" je hardvérová charakteristika, ktorá môže byť zmenená iba použitím vlastných nástrojov od výrobcu zariadenia. Napriek tomu tieto nástroje nie sú SKORO NIKDY poskytnuté verejnosti...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Obmedzenie súborového systému\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Tento ISO obraz obsahuje súbor s veľkosťou viac ako 4 GB, čo je viac ako podporuje súborový systém FAT alebo FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Chýba podpora WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Vaša platforma nedokáže rozbaliť súbory z WIM archívov. WIM extrakcia požaduje vytvorenie EFI bootovateľnej USB jednotky s Windows 7 a Windows Vista nainštalovaním novej verzie programu 7-Zip.\\n\"\n\"Chcete navštíviť webstránku 7-Zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Stiahnúť %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s alebo vyššie požadujú nainštalovať súbor: %s.\\n\"\n\"Pretože tento súbor je väčší ako 100 KB a vždy prítomný v %s ISO obrazoch, nie je implementovaný v programe Rufus.\\n\"\n\"\\n\"\n\"Program Rufus môže za vás stiahnuť chýbajúci súbor:\\n\"\n\"- Stlačte „Áno\\\" pre pripojenie na internet a stiahnutie súboru\\n\"\n\"- Stlačte „Nie\\\" ak chcete manuálne skopírovať tento súbor na jednotku neskôr\\n\"\n\"\\n\"\n\"Poznámka: Súbor „%s\\\" bude stiahnutý do aktuálneho priečinku a potom bude automaticky znovu použitý.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Po zrušení tejto operácie bude zariadenie v NEPOUŽITEĽNOM stave.\\n\"\n\"Ak ste si istý, že chcete túto zrušiť operáciu, stlačte tlačidlo ÁNO. \\n\"\n\"V opačnom prípade stlačte tlačidlo NIE.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Vyberte priečinok\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Všetky súbory\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Záznam programu Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Disk %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"Systém MS-DOS nemôže byť spustený z jednotky používajúcej klastre s veľkosťou 64kb.\\n\"\n\"Zmeňte veľkosť klastra alebo použite FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Nekompatibilná veľkosť klastra\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Formátovanie veľkých UDF zväzkov môže trvať dlhý čas. Rýchlosť USB 2.0 určuje trvanie formátovania (približne %d:%02d), počas procesu sa vám môže zdať, že aplikácia zamrzla. Buďte trpezlivý!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Veľkosť UDF zväzku\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Tento obraz používa Syslinux %s%s ale tento program obsahuje inštaláciu pre Syslinux %s%s.\\n\"\n\"\\n\"\n\"Ak nová verzia Syslinuxu nie je kompaktibilná s ďalším obrazom, je možné, že program Rufus neobsahuje dva doplnkové súbory, ktoré budú musieť byť stiahnuté z internetu (ldlinux.sys a ldlinux.bss):\\n\"\n\"- Stlačte „Áno\\\" pre stiahnutie týchto súborov z internetu\\n\"\n\"- Stlačte „Nie\\\" pre zrušenie operácie\\n\"\n\"\\n\"\n\"Poznámka: Súbory budú stiahnuté do aktuálneho priečinku programu a budú použité automaticky po stiahnutí.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Je požadované stiahnutie\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Tento obraz používa bootloader Grub %s ale tento program zahŕňa iba inštalačné súbory pre Grub %s.\\n\"\n\"\\n\"\n\"Pretože rozličné verzie Grubu nie sú kompatibilné s inými, nie je možné obsiahnuť všetky verzie. Program Rufus sa pokúsi nájsť verziu inštalačného súboru bootloaderu Grub ('core.img'), ktorý je zhodný s vašim obrazom:\\n\"\n\"- Vyberte „Áno\\\" pre pripojenie na internet a pokus o jeho stiahnutie\\n\"\n\"- Vyberte „Nie\\\" pre použitie pôvodnej verzie z programu Rufus\\n\"\n\"- Vyberte „Zrušiť\\\" pre zrušenie operácie\\n\"\n\"\\n\"\n\"Poznámka: Súbor bude stiahnutý do aktuálneho priečinku programu a bude teraz automatickypoužitý. Ak nebude nájdený na internete, bude použitá pôvodná verzia.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Štandardná inštalácia Windows (Inštalátor)\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"Windows To Go (Prenosná verzia)\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"pokročilé nastavenia zariadenia\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"pokročilé nastavenia formátovania\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Zobraziť %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Skryť %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Trvalá veľkosť partície\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Bez partície\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Nastavte veľkosť trvalej partície pre Live USB médium. Nastavením hodnoty na 0 zakážete trvalú partíciu.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Nastavte veľkosť partície.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Nabudúce nezobrazovať túto správu\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Dôležité upozornenie o %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Práve ste vytvorili médium, ktoré používa UEFI: NTFS bootloader. Pamätajte prosím, že na zavedenie tohto média, MUSÍTE VYPNÚŤ SECURE BOOT.\\n\"\n\"Podrobnosti o tom, prečo je to potrebné, nájdete v nižšie zobrazenom tlačidle \\\"Ďalšie informácie\\\".\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Výber obrázkov systému Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Tento ISO obsahuje viac obrazov Windows.\\n\"\n\"Prosím, vyberte obrázok, ktorý chcete použiť pre túto inštaláciu:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Prístup k tejto jednotke má iný program alebo proces. Chcete ho napriek tomu naformátovať?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Program Rufus zistil, že sa pokúšate vytvoriť Windows To Go médium založeného na 1809 ISO.\\n\"\n\"\\n\"\n\"Kvôli *MICROSOFT BUG*, toto médium môže zlyhať počas zavádzania systému Windows (modrá obrazovka smrti), pokiaľ manuálne nenahradíte súbor „WppRecorder. sys\\\" verziou 1803.\\n\"\n\"\\n\"\n\"Dôvodom, prečo program Rufus nemôže automaticky toto opraviť to, že súbor „WppRecorder.sys\\\" je chránený súbor spoločnosti Microsoft, takže nie je legálne vložiť kópiu súboru do aplikácie...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Pretože bola vybraná MBR schéma disku, program Rufus môže na tomto médiu vytvoriť partíciu iba do veľkosti 2 TB a zvyšných %s na disku ostane nedostupných.\\n\"\n\"\\n\"\n\"Naozaj chcete pokračovať?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Verzia\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Poznámky k vydaniu\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Vydanie\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Jazyk\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Architektúra\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Pokračovať\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Späť\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Čakajte prosím...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Sťahovanie pomocou prehliadača\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Sťahovanie bolo zakázané spoločnosťou Microsoft, pretože Microsoft zmenil svoju stránku, aby tomu zabránil.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Pre spustenie tohto skriptu je potrebný PowerShell 3.0 alebo novší.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Chcete prejsť do režimu online a stiahnuť ho?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Spúšťanie skriptu sťahovania...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Stiahnúť ISO obraz\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Vyberte typ bootovateľného disku, ktorým chcete nabootovať počítač. Musíte určiť, či chcete vytvoriť BIOS alebo UEFI predtým, ako začnete vytvárať disk, inak sa zariadenie nemusí spustiť.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"„UEFI-CSM\\\" znamená, že zariadenie bude bootovateľné iba emulovanom BIOS režime (taktiež známom ako „Legacy Mode\\\") pod UEFI a nie v natívnom UEFI režime.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"„Bez CSM\\\" znamená, že zariadenie bude bootovateľné iba v natívnom UEFI režime a nie v emulovanom BIOS režime (taktiež známom ako „Legacy Mode\\\").\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Skúšobná vzorka: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Skúšobné vzorka: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Skúšobná vzorka: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Skúšobná vzorka: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Nastavte cieľový súborový systém\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Minimálna veľkosť bloku použitého v súborovom systéme\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Ak chcete nastaviť menovku disku, vyplňte pole.\\n\"\n\"Podporované sú aj medzinárodné znaky.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Prepínač pokročilých nastavení\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"\"\n\"Skontrolovať zariadenie na prítomnosť chybných\\n\"\n\"blokov použitím skúšobných vzoriek\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Odznačením tohto políčka použijete „pomalú\\\" metódu formátovania\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metóda, ktorá bude použitá na vytvorenie partícií\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Vyberte metódu, ktorá bude použitá na vytvorenie bootovateľného zariadenia\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Stlačte tlačidlo alebo stiahnite obraz...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Označením tohto políčka povolíte v názve disku zobrazenie medzinárodných znakov a vytvorenie ikony zariadenia (vytvorením súboru autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Nainštalovať zavádzač UEFI, ktorý vykoná overenie média prostredníctvom MD5Sum súboru\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Bude naviac vytvorený skrytý oddiel, program sa pokúsi nastaviť hranice oddielov.\\n\"\n\"Toto nastavenie môže zlepšiť boot detekciu pre staršie BIOSy.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Povolí zobrazovanie USB pevných diskov (USB HDD). POUŽITIE LEN NA VLASTNÉ RIZIKO!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Stlačením tohto tlačidla spustíte formátovanie.\\n\"\n\"Formátovaním sa VYMAŽÚ všetky údaje na disku!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Neplatný podpis stiahnutého súboru\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Stlačením vybrať...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Spoľahlivý program pre formátovanie USB\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Verzia %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Do slovenčiny preložil martinco78 <mailto:martinco78@azet.sk>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Oznámenie chýb alebo žiadosti o zlepšenie programu:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Doplnkové Copyrighty:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Zásady aktuálizácií:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Ak povolíte tomuto programu kontrolu aktualizácií, súhlasíte s tým, že nasledujúce informácie budú zbierané našimi servermi:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Architektúra vášho operačného systému a jeho verzia\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Verzia používaného programu Rufus\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Vaša IP adresa\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Pre účel vytvárania osobných štatistík používania programu, môžeme uschovávať tieto zhromaždené informácie, \\\\b väčšinou rok\\\\b0 . Avšak, tieto osobné informácie neposkytujeme dobrovoľne tretím stranám.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Aktualizačný proces:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Program Rufus nepobeží ako služba na pozadí a nenainštaluje aktualizáciu. Pre kontrolu aktualizácií, musí byť spustené hlavné okno.\\\\line\\n\"\n\"Pre aktualizáciu programu je potrebný prístup na internet.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Neplatný obraz pre vybrané nastavenie bootovania\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Aktuálny obraz sa nehodí pre vybrané nastavenia bootovania. Použite iný obraz alebo zmeňte nastavenia bootovania.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Tento ISO obraz nie je kompatibilný s vybratým súborovým systémom\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Zistené nekompatibilné zariadenie\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Prebieha zápis\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Prebieha čítanie\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Stiahnuté: %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Nie je možné stiahnúť: %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Použitie súboru (-ov) obsiahnutej verzie %s\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"DÔLEŽITÉ: TOTO ZARIADENIE POUŽÍVA NEŠTANDARDNÚ VEĽKOSŤ SEKTORU!\\n\"\n\"\\n\"\n\"Bežné jednotky použivájú 512-bitový sektor, ale táto jednotka používa %d-bitový sektor. Vo veľa prípadoch to znamená, že NEBUDE možné bootovať z tejto jednotky.\\n\"\n\"Program Rufus sa pokúsi vytvoriť bootovateľnú jednotku, ale nie je tu ŽIADNA ZÁRUKA, že to bude fungovať.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Zistená neštandardná veľkosť sektora\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"„Windows To Go\\\" môže byť nainštalovaný iba na oddiely rozdelenú GPT jednotku ak má nastavený atribút UPRAVENÝ. Aktuálna jednotka nebola zistená ako UPRAVENÁ.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Táto funkcia nie je na tejto platforme k dispozícii.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Ukončuje sa operácia - čakajte prosím...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Analýza obrazu disku...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Analýza obrazu zlyhala\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Zistený zastaralý modul: %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Použítý obraz: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Chýbajúci súbor: %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Nový zväzok\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"Bolo nájdené %d zariadenie\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"Počet nájdených zariadení: %d\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"PRIPRAVENÝ\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Operácia zrušená\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"NEÚSPEŠNÉ\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Spúšťanie novej aplikácie...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Neúspešné spustenie novej aplikácie\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Otvorený súbor: %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Uložený súbor: %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formátovanie: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Vytváranie súborového systému: %d/%d\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS Fixup: %d%% dokončených\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formátovanie (%s) - zostávajúci čas: %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Nastavovanie menovky (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formátovanie (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS Fixup (kontrola disku)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Vymazávanie MBR/PBR/GPT štruktúr...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Požiadavka na prístup na disk...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analyzovanie existujúcich boot zápisov...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Uzatváranie existujúceho zväzku...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Zapisovanie hlavného zavádzacieho záznamu (MBR)...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Zapisovanie boot záznamu oddielu...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopírovanie súborov z DOS obrazu...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopírovanie súborov z ISO obrazu: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI boot inštalácia (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Prebieha dokončovanie, čakajte...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Inštaluje sa Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Chybné bloky: %s %d/%d - %0.2f%% (Chyby: %d/%d/%d)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Chybné bloky: Testovanie s náhodným vzorkami\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Chybné bloky: Testovanie s vzorkou 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Vytváranie oddielov (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Vymazávanie oddielov (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Podpis stiahnutej aktualizácie nemôže byť overený. To by mohlo znamenať, že váš systém nie je správne nastavený pre overenie podpisu alebo indikuje škodlivé sťahovanie.\\n\"\n\"\\n\"\n\"Stiahnutý súbor bude vymazaný. Pre viac informácií skontrolujte záznam.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Sťahovanie: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Neúspešné sťahovanie súboru.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Kontrola aktualizácií programu Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Aktualizácia: Chyba pripojenia\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Aktualizácia: Nedostupné údaje o verzii\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Je dostupná nová verzia programu Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Nebola nájdená novšia verzia programu\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Kľúče registrov programu boli úspešné vymazané\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Kľúče registrov programu neboli vymazané\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s: povolené\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s: zakázané\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Kontrola veľkosti\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Vyhľadávanie USB HDD\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Formátovanie Force large FAT32\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun bol vymazaný pri ukončení\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Použiť imitáciu jednotky\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet podpora\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge podpora\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Vynútená aktualizácia\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS kompresia\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Zápis obrazu: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO podpora\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Použiť PROPER veľkosť jednotiek\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Vymazávanie priečinku: „%s\\\"\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Vyhľadávanie VMWare disku\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Duálny UEFI/BIOS mód\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Používanie Windows obrazu: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Používanie Windows obrazu...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Zachovať časové značky\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB ladenie\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Prebieha výpočet kontrolného súčtu: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Vypočítať MD5, SHA1 a SHA256 kontrolný súčet pre vybraný obraz\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Zmeniť jazyk programu\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Bol zistený obraz %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Tento obraz bol označený ako „Hybridný ISO obraz\\\". To znamená, že môže byť zapísaný iba v režime „%s\\\" (kopírovanie súboru) alebo režime „%s\\\" (obraz disku).\\n\"\n\"Program Rufus odporúča použiť režim „%s\\\", aby ste mali plný prístup k zariadeniu aj po zápise naň.\\n\"\n\"Ak sa predsa len vyskytnú problémy počas bootovania, môžete vyskúšať zapísať tento obraz znovu v režime „%s\\\".\\n\"\n\"\\n\"\n\"Vyberte režim, v ktorom chcete zapísať tento obraz:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Zápis v režime %s (odporúčané)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Zápis v režime %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Vyhľadávanie konfliktných procesov...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Bez bootovania (iba formátovanie)\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disk alebo ISO obraz\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (vybrať obraz)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Uzamknutie USB zariadenia\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Neplatný podpis\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Stiahnutému inštalátoru chýba digitálny podpis.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Stiahnutý inštalátor podpísal „%s\\\".\\n\"\n\"Tento podpis nebol rozoznaný a môže znamenať nejakú formu škodlivej aktivity...\\n\"\n\"Ste si istý, že chcete spustiť tento súbor?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Vymazávanie zariadenia: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Zisťovanie nie-USB vymeniteľných zariadení\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Chýbajúce zvýšené oprávnenia\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Tento program je možné spustiť len s právami správcu\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Indexovanie súborov\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Výber verzie\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Vyberte verziu systému Windows, ktorú chcete nainštalovať:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Nepodporovaná veria systému Windows\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Táto verzia systému Windows už nie je podporovaná programom Rufus.\\n\"\n\"Posledná verzia programu Rufus je kompatibilná s touto platformou: v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Upozornenie: Neoficiálna verzia\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Táto verzia programu Rufus NIE JE vydaná oficiálnymi vývojármi.\\n\"\n\"\\n\"\n\"Ste si istý, že ju chcete spustiť?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Bol zistený skrátený ISO súbor\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Veľkosť vybraného ISO súboru sa nezhoduje s jeho deklarovanou veľkosťou (chýba %s)!\\n\"\n\"\\n\"\n\"Ak ste získali tento súbor z internetu, pokúste sa znova stiahnuť novú kópiu tohto súboru a overiť ju MD5 alebo SHA kontrolným súčtom s originálnym súborom.\\n\"\n\"\\n\"\n\"Ak chcete vypočítať kontrolný súčet MD5 alebo SHA pre vybraný súbor v programe Rufus, stlačte tlačidlo (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Vyskytla sa chyba pri overení časovej známky\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Program Rufus nemohol overiť časovú známku stiahnutej aktualizácie, ktorá je aktuálnejšia ako aktuálne spustená verzia.\\n\"\n\"\\n\"\n\"Pre ochranu voči potencionálnemu útoku bude inštalácia zrušená a stiahnutý súbor bude vymazaný. Pre viac detailov skontrolujte záznam.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Zobraziť nastavenia programu\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Zobraziť informácie o tomto programe\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Zobraziť záznam činnosti programu\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Vytvoriť obraz disku z vybraného zariadenia\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Pomocou tejto možnosti môže použiť toto zariadenie na inštaláciu systému Windows na iný disk, alebo ak chcete spustiť systém Windows priamo z tohto zariadenia (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Rýchle vymazávanie zariadenia: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"môže to chvíľu trvať\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Detekcia VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Komprimovaný archív\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Vami vybraný ISO obraz používa UEFI a je dostatočne malý na to, aby sa zapísal do systémovej oblasti EFI (ESP). Zápisom do ESP namiesto zápisu do všeobecnej oblasti zaberajúcej celý disk, môže byť vhodnejšie pre niektoré typy inštalácií.\\n\"\n\"\\n\"\n\"Vyberte režim, ktorý chcete použiť na zápis tohto obrazu:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Pre povolenie použite %s (v hlavnom okne aplikácie).\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Extra hash (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Uložiť do VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Prebieha výpočet kontrolného súčtu\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Viacero tlačidiel\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Počet prechodov\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID disku\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Predvolená priorita vlákna: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignorovať zavádzaciu značku\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Obnovuje sa rozloženie oblasti (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Obráz, ktorý ste vybrali, je ISOHybrid a nie je kompatibilný s ISO/režim kopírovania súboru.\\n\"\n\"V dôsledku toho sa vynúti režim zápisu obrazu DD.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Nedá sa otvoriť alebo prečítať „%s\\\"\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Použitie prispôsobenia systému Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Použitie používateľských nastavení...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Používateľská skúsenosť so systémom Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Prajete si prispôsobiť inštaláciu systému Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Odstrániť požiadavku pre 4GB+ RAM, Secure Boot a TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Odstrániť požiadavky na online konto Microsoft\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Zakázať zhromažďovanie údajov (preskočiť otázky týkajúce sa ochrany osobných údajov)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Zabrániť funkcii Windows To Go v prístupe na interné disky\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Vytvorte si lokálny účet s používateľským menom:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Nastaviť miestne možnosti na rovnaké hodnoty, ako možnosti tohto používateľa\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Vypnutie automatického šifrovania zariadenia BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Trvalý záznam činností\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Pre inštaláciu systému MS-DOS je potrebné prevziať od spoločnosti Microsoft ďalší súbor („diskcopy.dll\\\"):\\n\"\n\"- Výberom možnosti „Áno\\\" ho stiahnete z internetu\\n\"\n\"- Výberom možnosti „Nie\\\" zrušíte operáciu\\n\"\n\"\\n\"\n\"Poznámka: Súbor sa stiahne do adresára aplikácie a automaticky sa znova použije, ak je k dispozícii.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Bol zistený zrušený zavádzač UEFI\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Program Rufus zistil, že ISO, ktoré ste vybrali, obsahuje zavádzač UEFI, ktorý bol zrušený a ktorý bude produkovať %s, keď je povolené zabezpečené spustenie na plne aktuálnom systéme UEFI.\\n\"\n\"\\n\"\n\"- Ak ste tento obraz ISO získali z neseriózneho zdroja, mali by ste zvážiť možnosť, že by mohol obsahovať malvér UEFI a vyhnúť sa bootovaniu z neho.\\n\"\n\"- Ak ste ho získali z dôveryhodného zdroja, mali by ste sa pokúsiť nájsť aktuálnejšiu verziu, ktorá toto upozornenie nespustí.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"obrazovka „Narušenie bezpečnosti\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"a Obrazovka obnovenia systému Windows (BSOD) s %s\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Komprimovaný obraz VHDX\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Nekomprimovaný obraz VHD\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Obraz úplnej flash aktualizácie\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Ak chcete používať túto funkciu, musíte si od spoločnosti Microsoft stiahnuť niektoré ďalšie dáta:\\n\"\n\"- Výberom možnosti „Áno\\\" ich stiahnete z internetu\\n\"\n\"- Výberom možnosti „Nie\\\" zrušíte túto operáciu\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Obmedziť systém Windows s režimom S (NEKOMPATIBILNÝ s obídením konta online)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Expertný režim\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Extrahovanie archívnych súborov: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Použiť Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus je utilita, ktorá vám pomôže naformátovať a vytvoriť bootovacie jednotky USB Flash, ako sú napr. USB kľúče, pamäťové karty, atď.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Oficiálna stránka: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Zdrojový kód: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Zoznam zmien: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Táto aplikácia je licencovaná podľa podmienok GNU Public License (GPL) verzia 3.\\n\"\n\"Podrobnosti nájdete na https://www.gnu.org/licenses/gpl-3.0.html.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"boot\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Naformátujte USB, kartu a virtuálne disky do FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Vytvorte bootovacie usb zariadenia FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Vytvorte bootovacie jednotky z ISO súborov (Windows, Linux atď.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Vytvorte bootovacie jednotky z diskových obrazov, vrátane tých komprimovaných\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Vytvorte bootovacie jednotky systému BIOS alebo UEFI vrátane UEFI bootovateľnej jednotky NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Vytvorte jednotky „Windows To Go\\\"\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Vytvorte inštalačné jednotky Windows 11 pre počítače, ktoré nemajú modul TPM, ani Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Vytvorte trvalé oblasti systému Linux\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Vytvorte obrazy VHD/DD z vybratej jednotky\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Vypočítajte kontrolné súčty vybratého obrazu (MD5, SHA-1, SHA-256 a SHA-512)\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Vykonajte kontroly zlých blokov vrátane detekcie „falošných\\\" prenosných diskov\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Stiahnite si oficiálne ISO pre Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Stiahnite UEFI Shell ISO\"\n"
  },
  {
    "path": "res/loc/po/sl-SI.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-12 20:45+0300\\n\"\n\"PO-Revision-Date: 2024-05-20 10:37+0100\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: sl_SI\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Slovenian (Slovenščina)\\n\"\n\"X-Rufus-LCID: 0x0424\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Lastnosti pogona\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Naprava\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Izbira zagona\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Izberi\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Možnosti slike\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Particijska shema\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Ciljni sistem\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Naštej USB trde diske\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Dodaj popravke za stare BIOSe\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Med zagonom omogoči UEFI preverjanje integritete medija\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Možnosti formatiranja\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Datotečni sistem\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Velikost gruče\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Oznaka nosilca\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Hitro formatiranje\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Odkrij slabe bloke\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Ustvari datoteki za ikono in podaljšano oznako\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Stanje\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Zapri\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Začni\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"O Rufusu\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licenca\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"V redu\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufusova licenca\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Več informacij\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Da\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Ne\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Zapisnik\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Izprazni\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Shrani\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Posodobitvena politika in nastavitve\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Nastavitve\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Preveri za posodobitve\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Upoštevaj beta verzije\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Preveri zdaj\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Rufus - posodobitve\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Novejša verzija je na voljo. Prosim, prenesite jo!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Kliknite sem, da greste na spletno stran\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Opombe ob izdaji\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Prenesi\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Drug primerek zaznan\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Še en primerek Rufusa se izvaja.\\n\"\n\"Prosim, zaprite ga, preden zaženete še enega.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"OPOZORILO: VSI PODATKI NA NAPRAVI \\\"%s\\\" BODO UNIČENI.\\n\"\n\"Če želite nadaljevati s to operacijo, izberite \\\"V redu\\\", drugače izberite \\\"Prekliči\\\".\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufusova posodobitvena politika\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Ali dovolite, da Rufus na internetu išče posodobitve zase?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Prekliči\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Slabi bloki najdeni\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Preizkus končan: %d slabih blokov najdenih\\n\"\n\"  Napak pri branju: %d\\n\"\n\"  Napak pri pisanju: %d\\n\"\n\"  Nezanesljivih blokov: %d\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Podrobnejše poročilo lahko najdete v datoteki\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Onemogočeno\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Dnevno\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Tedensko\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Mesečno\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Po meri\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Vaša verzija: %d.%d (izgradnja %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Najnovejša verzija: %d.%d (izgradnja %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"bajtov\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobajtov\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabajtov\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Privzeto\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (privzeto)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (oz. UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (brez CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS ali UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d prehod\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d prehoda/-i %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Sliko ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Aplikacija\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Prekini\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Zaženi\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operacijo je prekinil uporabnik\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Napaka\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Napaka: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Prenos datoteke\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB podatkovni nosilec (generičen)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (disk %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Več particij\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - izpiranje medpomnilnika\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - preklic\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Uspešno zaključeno.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Nedoločena napaka med formatiranjem.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Za ta medij tega datotečnega sistema ni mogoče uporabiti.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Dostop do naprave je zavrnjen.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Na medij ni mogoče pisati.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Napravo uporablja drug proces. Prosim, zaprite vse procese, ki bi lahko uporabljali to napravo.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Za to napravo hitro formatiranje ni na voljo.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Oznaka nosilca je neveljavna.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Napravin oprimek je neveljaven.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Izbrana velikost gruče ni veljavna za to napravo.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Velikost nosilca je neveljavna.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Prosim, vstavite izmenljiv medij v pogon.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Prejet je bil nepodprt ukaz.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Napaka pri dodelitvi spomina.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Napaka pri branju.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Napaka pri pisanju.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Napaka pri nameščanju\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Ni mogoče odpreti medija. Morda ga uporablja drug proces. Prosim, ponovno priključite medij in poskusite znova.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Ustvarjanje particije ni uspelo.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Ni bilo mogoče kopirati datotek na ciljni pogon.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Uporabnik je prekinil operacijo.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Niti ni mogoče zagnati.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Preizkus blokov se ni zaključil.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Napaka pri preiskovanju ISO slike.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Napaka pri vlečenju iz ISO slike.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Nosilca ni mogoče ponovno priklopiti.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Ni mogoče popraviti oz. pripraviti zagonskih datotek.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Pogonu ni mogoče dodeliti črke.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Ni mogoče priklopiti nosilca z GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Naprava ni pripravljena.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus je zaznal, da Windows še vedno izpira svoje notranje medpomnilnike na napravo USB.\\n\"\n\"\\n\"\n\"Odvisno od hitrosti naprave to lahko traja veliko časa, še posebej za velike datoteke.\\n\"\n\"\\n\"\n\"Priporočamo vam, da počakate, da Windows opravi svoje, da se izognete poškodbi podatkov. Če pa se čakanja naveličate, lahko napravo kar izvlečete...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Nepodprta slika\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Ta slika ni zagonska ali pa Rufus ne podpira njenega načina zagona ali metode stiskanja.Ta ISO očitno ne uporablja nobenega izmed njih...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Zamenjam %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Zdi se, da ta ISO slika uporablja zastarelo verzijo \\\"%s\\\".\\n\"\n\"Zaradi tega se zagonski meniji morda ne bodo prikazovali pravilno.\\n\"\n\"\\n\"\n\"Rufus lahko prenese novejšo verzijo, da to težavo odpravi.\\n\"\n\"- Izberite \\\"Da\\\", da se povežete na internet in prenesete datoteko.\\n\"\n\"- Izberite \\\"Ne\\\", da slike ne spreminjate.\\n\"\n\"Če ne veste, kaj storiti, izberite \\\"Da\\\".\\n\"\n\"\\n\"\n\"Opomba: nova datoteka bo prenesena v trenutni imenik in ko datoteka \\\"%s\\\" tam enkrat obstaja, bo samodejno uporabljena tudi v bodoče.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Prenašam %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Izbrana ni nobena slika\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"za nosilec vrste %s\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Slika je prevelika\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Ta slika je prevelika za izbrani cilj.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Nepodprt ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Za cilj UEFI so podprte samo zagonske ISO slike, združljive z EFI. Prosim, izberite zagonski ISO, združljiv z EFI, ali nastavite cilj na BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Nepodprt datotečni sistem\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"TA POGON IMA VEČ PARTICIJ!\\n\"\n\"\\n\"\n\"To lahko vključuje particije, ki jih Windows niti ne prikazuje. Če nadaljujete, ste odgovorni za morebitno izgubo podatkov na teh particijah.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Zaznanih več particij\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"Sliko DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Trenutno izbranega datotečnega sistema ni mogoče uporabljati s to vrsto slike ISO. Izberite drug datotečni sistem ali pa uporabite drugo sliko.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%so' je mogoče uporabiti samo z datotečnim sistemom NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"POMEMBNO: Namestiti poskušate 'Windows To Go' na odstranljiv nosilec. Windows se bo najverjetneje ustavil med zagonom, ker zagon z odstranljivega nosilca ni uradno podprt.\\n\"\n\"\\n\"\n\"Ali še vedno želite nadaljevati?\\n\"\n\"\\n\"\n\"Opomba: atribut, ki določa, ali je nosilec \\\"fiksen\\\" ali \\\"odstranljiv\\\", je mogoče spremeniti le s posebnim programom proizvajalca naprave. Takšni programi navadno niso na voljo javnosti.\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Omejitev datotečnega sistema\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Ta slika vsebuje datoteko, večjo od 4 GB, kar je več kot največja velikost, ki jo dopuščata datotečna sistema FAT in FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Manjkajoča podpora za WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Vaš sistem ne more vleči datotek iz arhivov WIM. To je potrebno za ustvarjanje zagonskih pogonov USB z operacijskim sistemom Windows Vista ali Windows 7. To lahko popravite, če namestite nedavno verzijo programa 7-Zip.\\n\"\n\"Želite obiskati spletno stran, kjer lahko 7-Zip prenesete?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Prenesem %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s ali novejši zahteva, da je nameščena datoteka \\\"%s\\\".\\n\"\n\"Ker je ta datoteka večja od 100 KB in je vedno prisotna na ISO slikah s %s ali novejšim, ni vgrajena v Rufus.\\n\"\n\"\\n\"\n\"Rufus jo lahko prenese namesto vas.\\n\"\n\"- Izberite \\\"Da\\\", da se povežete na internet in prenesete datoteko.\\n\"\n\"- Izberite \\\"Ne\\\", če želite to datoteko pozneje sami kopirati na pogon.\\n\"\n\"\\n\"\n\"Opomba: nova datoteka bo prenesena v trenutni imenik in ko datoteka \\\"%s\\\" tam enkrat obstaja, bo samodejno uporabljena tudi v bodoče.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Preklic lahko pusti napravo v NEUPORABNEM stanju.\\n\"\n\"Če ste prepričani, da želite operacijo preklicati, izberite DA, drugače izberite NE.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Prosim, izberite mapo\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Vse datoteke\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufusov zapisnik\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (disk %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS se ne more zagnati s pogona, na katerem so gruče velike 64 KB.\\n\"\n\"Prosim, spremenite velikost gruče ali uporabite FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Nezdružljiva velikost gruče\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Formatiranje velikih nosilcev UDF lahko traja veliko časa. Pri hitrostih USB 2.0 je predvideno trajanje formatiranja %d:%02d, med čimer se kazalnik poteka ne bo premaknil. Prosim, bodite potrpežljivi!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Velik nosilec UDF\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Ta slika uporablja Syslinux %s%s, toda ta aplikacija vsebuje le namestitvene datoteke za Syslinux %s%s.\\n\"\n\"\\n\"\n\"Ker novejše verzije Syslinuxa niso združljive in Rufus ne more vsebovati vseh, morata biti prenešeni še dve dodatni datoteki (ldlinux.sys in ldlinux.bss):\\n\"\n\"- Izberite \\\"Da\\\", da se povežete na internet in prenesete ti dve datoteki.\\n\"\n\"- Izberite \\\"Ne\\\", da prekinete dejanje.\\n\"\n\"\\n\"\n\"Opomba: datoteki bosta prenešeni v mapo, kjer je nameščen Rufus, in bosta v prihodnje ponovno uporabljeni.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Prenos potreben\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Ta slika uporablja GRUB %s, toda ta aplikacija vsebuje le namestitvene datoteke za GRUB %s.\\n\"\n\"\\n\"\n\"Ker različne verzije programa GRUB niso nujno združljive in Rufus ne more vsebovati vseh, bo Rufus poskušal najti verzijo namestitvene datoteke za GRUB (core.img), ki se ujema s tisto na sliki:\\n\"\n\"- Izberite \\\"Da\\\", da se povežete na internet in prenesete to datoteko.\\n\"\n\"- Izberite \\\"Ne\\\", da uporabite privzeto verzijo, ki jo Rufus že vsebuje.\\n\"\n\"- Izberite \\\"Prekliči\\\", da prekinete dejanje.\\n\"\n\"\\n\"\n\"Opomba: datoteka bo prenešena v mapo, kjer je nameščen Rufus, in bo v prihodnje ponovno uporabljena. Če Rufus ne more najti ustrezne datoteke, bo uporabljena privzeta verzija.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Standardna namestitev operacijskega sistema Windows\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"napredne lastnosti pogona\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"napredne možnosti formatiranja\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Pokaži %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Skrij %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Velikost trajne particije\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Brez\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Nastavi velikost trajne particije za \\\"živ\\\" medij. Velikost 0 onemogoči trajno particijo.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Nastavi enote velikosti particije.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Tega sporočila ne prikaži več\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Pomembno obvestilo o %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Ustvarili ste medij, ki uporablja nalagalnik UEFI:NTFS. Pomnite, da morate za zagon s tega medija ONEMOGOČITI Secure Boot.\\n\"\n\"Za razlago, zakaj je to potrebno, kliknite gumb \\\"Več informacij\\\" spodaj.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Izbira slike Windowsa\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Ta ISO vsebuje več slik Windowsa.\\n\"\n\"Izberite sliko, ki jo želite uporabiti za to namestitev:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Do tega pogona dostopa drug program oz. proces. Ali ga želite vseeno formatirati?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus je zaznal, da poskušate ustvariti medij za Windows To Go z verzijo 1809.\\n\"\n\"\\n\"\n\"Zaradi hrošča v Windowsu bo ta medij povzročil sesutje (\\\"blue screen of death\\\" - BSOD) med zagonom, razen če ročno zamenjate datoteko WppRecorder.sys s tisto iz verzije 1803.\\n\"\n\"\\n\"\n\"Ker avtorske pravice za to datoteko pripadajo Microsoftu, Rufus te datoteke ne vključuje in zato tega ne more storiti namesto vas.\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Največja možna velikost particije v particijski shemi MBR je 2 TB. To bo pustilo %s prostora neizkoriščenega.\\n\"\n\"\\n\"\n\"Ali želite nadaljevati?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Verzija\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Izdaja\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Različica\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Jezik\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Arhitektura\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Nadaljuj\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Nazaj\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Prosim, počakajte...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Prenesi z brskalnikom\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Prenos sistema Windows ISOs ni na voljo, ker je Microsoft spremenil njihovo spletno mesto, da bi ga preprečil.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Ta skripta zahteva PowerShell 3.0 ali novejši.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Ali ga želite prenesti?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Izvajam skripto za prenos...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Prenesi sliko ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Vrsta računalnika, ki jo nameravate zagnati s tem pogonom. To morate ugotoviti, preden ustvarite pogon, drugače zagon morda ne bo uspel.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' pomeni, da se bo v UEFI s pogona mogoče zagnati le v načinu emulacije BIOS (imenovanem tudi 'Legacy Mode') in ne v običajnem UEFI načinu.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'brez CSM' pomeni, da se bo v UEFI s pogona mogoče zagnati le v običajnem UEFI načinu in ne v načinu emulacije BIOS (imenovanem tudi 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Testni vzorec: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Testni vzorec: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testni vzorec: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testni vzorec: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Nastavi ciljni datotečni sistem\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Minimalna velikost, ki jo bo zasedel kos podatkov v datotečnem sistemu\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"S tem poljem nastavite oznako pogona.\\n\"\n\"Lahko uporabite mednarodne znake (npr. Č, Š, Ž).\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Prikaže ali skrije dodatne možnosti\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Preveri, ali so na napravi slabi bloki z uporabo testnega vzorca\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"To možnost odznačite za \\\"počasen\\\" način formatiranja\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metoda, ki bo uporabljena za ustvarjanje particij\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Metoda, ki bo uporabljena, da bo s pogona mogoče zagnati računalnik\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Kliknite, da izberete sliko...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"To možnost izberite, če želite omogočiti prikaz \\\"mednarodnih\\\" oznak nosilca in nastaviti ikono za napravo (to ustvari datoteko autorun.inf).\"\n\n#. • MSG_167\n#, fuzzy\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Ta možnost namesti zagonski sektor, ki omogoča izbiro pri zagonu in lahko \\\"zamaskira\\\" BIOS ID pogona USB\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Ta možnost ustvari dodatno skrito particijo in poskuša poravnati particije.\\n\"\n\"To lahko izboljša zaznavo zagonskih naprav v starih BIOS verzijah.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Omogoči naštevanje trdih diskov, priključenih preko USB. TO JE NA VAŠO ODGOVORNOST!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Začne formatirati.\\n\"\n\"To bo UNIČILO vse podatke na ciljni napravi!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Podpis prenesene datoteke ni pristen\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Kliknite, da izberete...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - zanesljivi pripomoček za USB formatiranje\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Verzija %d.%d (izgradnja %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"V slovenščino prevedel Matej Horvat <mailto:matej.horvat@guest.arnes.si>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Prijavite hrošče ali zahtevajte izboljšave na:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Dodatne avtorske pravice:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Politika posodobitev:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Če programu dovolite, da preverja za posodobitve, se strinjate, da se na naših strežnikih lahko zbirajo naslednje informacije:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Arhitektura in verzija vašega operacijskega sistema\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Verzija programa, ki jo uporabljate\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Vaš IP naslov\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Za računanje zasebne statistike o uporabi programa bomo morda te informacije obdržali \\\\b največ eno leto\\\\b0 . Ne bomo pa jih nalašč predali nikomur drugemu.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Postopek posodobitve:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus ne namesti ali zaganja storitev v ozadju, zato se posodobitve prenašajo samo, ko Rufus zaženete sami.\\\\line\\n\"\n\"Za preverjanje in prenos posodobitev seveda potrebujete povezavo z internetom.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Neveljavna slika za izbran način zagona\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Trenutna slika se ne ujema z izbranim načinom zagona. Prosim, uporabite drugo sliko ali izberite drug način zagona.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Ta slika ni združljiva z izbranim datotečnim sistemom\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Zaznana je bila nezdružljiva naprava\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Pisalni prehod\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Bralni prehod\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Prenesel %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Ni bilo mogoče prenesti %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Uporabljam vgrajeno verzijo datotek(e) %s.\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"OPOZORILO: TA NAPRAVA UPORABLJA NESTANDARDNO VELIKOST SEKTORJEV!\\n\"\n\"\\n\"\n\"Večina naprav uporablja 512-bajtne sektorje, ta naprava pa %d-bajtne. V večini primerov to pomeni, da z nje NE boste mogli zagnati računalnika.\\n\"\n\"Rufus lahko poskusi ustvariti zagonski disk, vendar NI ZAGOTOVILA, da bo to delovalo.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Zaznana nestandardna velikost sektorjev\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' je lahko nameščen le na napravo s particijsko shemo GPT, če naprava ni odstranljiva. Trenutna naprava pravi, da je odstranljiva.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Ta funkcija ni na voljo na tej platformi.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Preklicujem - prosim, počakajte...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Preiskujem sliko...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Preiskava slike ni uspela\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Zaznan je bil zastarel %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Uporabljam sliko: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Manjkajoča datoteka %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Nov nosilec\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d naprava najdena\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d naprav najdenih\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"PRIPRAVLJEN\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Preklicano\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Ni uspelo\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Zaganjam novo aplikacijo...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Ni mogoče zagnati nove aplikacije\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Odprl %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Shranil %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formatiram: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Ustvarjam datotečni sistem: opravilo %d/%d končano\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Popravki za NTFS: %d%% končano\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formatiranje (%s) - predviden čas trajanja %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Nastavljam oznako (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formatiranje (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Popravki za NTFS (chkdsk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Brišem strukture MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Zahtevam dostop do diska...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Pregledujem obstoječe zagonske vnose...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Zapiram obstoječi nosilec...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Zapisujem glavni zagonski sektor (MBR)...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Zapisujem podatke o particiji...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopiram DOS datoteke...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopiram datoteke s slike ISO: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Pripravljam pogon za zagon Windows 7 na EFI (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Zaključujem; prosim, počakajte...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Nameščam Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Slabi bloki: %s %d/%d - %0.2f%% (%d/%d/%d napak)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Slabi bloki: testiram z naključnim vzorcem\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Slabi bloki: testiram z vzorcem 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Ustvarjam particije (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Brišem particije (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Ni mogoče potrditi pristnosti podpisa prenesene posodobitve. To lahko pomeni ali, da vaš sistem nima ustreznih nastavitev za preverjanje podpisov, ali vam nekdo poskuša podtakniti zlonamerno vsebino.\\n\"\n\"\\n\"\n\"Prenesena datoteka bo izbrisana. Prosim, preverite zapisnik za več podrobnosti.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Prenašam: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Ni mogoče prenesti datoteke.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Preverjam za posodobitve Rufusa...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Posodobitve: ni se mogoče povezati na internet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Posodobitve: ni mogoče dostopati do podatka o verziji\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Nova verzija Rufusa je na voljo!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Najdena ni bila nobena novejša verzija\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Registrski ključi uspešno izbrisani\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Brisanje registrskih ključev ni uspelo\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s: omogočeno\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s: onemogočeno\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Preverjanje velikosti\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Zaznava trdih diskov\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Prisili véliko formatiranje FAT32\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun bo izbrisan ob izhodu\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Zaznava lažnih pogonov\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Podpora za Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Podpora za Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Prisili posodobitev\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS stiskanje\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Zapisujem sliko: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Podpora za slike ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Uporabi enote PRAVIH velikosti\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Brišem imenik %s\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Zaznavanje diskov VMware\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Dvojni način BIOS/UEFI\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Nameščam sliko za Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Nameščam sliko za Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Ohranjanje časov datotek\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Razhroščevanje USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Računam zgoščene vrednosti: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Izračuna zgoščene vrednosti MD5, SHA1 in SHA256 za izbrano sliko\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Spremeni jezik aplikacije\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Zaznana je bila slika %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Slika, ki ste jo izbrali, je vrste \\\"ISOHybrid\\\". To pomeni, da jo lahko zapišete kot %s (s kopiranjem datotek) ali pa kot %s (s kopiranjem cele slike).\\n\"\n\"Rufus priporoča, da jo zapišete kot %s, tako da boste imeli poln dostop do nosilca, ko bo slika zapisana.\\n\"\n\"Če opazite težave pri zaganjanju, pa jo lahko še enkrat zapišete kot %s..\\n\"\n\"\\n\"\n\"Izberite, kako jo želite zapisati:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Zapiši kot %s (priporočeno)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Zapiši kot %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Preverjam, ali se izvajajo konfliktni procesi...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Nezagonska\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Slika diska oz. ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (izberite)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Ekskluzivno zaklepanje nosilca USB\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Neveljaven podpis\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Prenesena datoteka nima digitalnega podpisa.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Oseba, ki je podpisala preneseno datoteko, je '%s'.\\n\"\n\"Ta podpis se ne ujema s pričakovanim, kar lahko pomeni, da je to zlonamerna datoteka, ki jo vam je nekdo podtaknil.\\n\"\n\"Ali ste prepričani, da jo želite zagnati?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Zapolnjujem nosilec z ničlami: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Zaznava neodstranljivih nosilcev\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Nimate dovolj pravic\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Za uporabo te aplikacije potrebujete dodatne pravice\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Indeksiranje diska\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Izbira verzije\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Izberite, katero verzijo operacijskega sistema Windows želite namestiti:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Operacijski sistem ni podprt\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Rufus več ne podpira tega operacijskega sistema.\\n\"\n\"Zadnja različica programa Rufus, združljiva s to platformo, je v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Opozorilo: neuradna verzija\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Te verzije Rufusa ni izdelal njegov uradni razvijalec.\\n\"\n\"\\n\"\n\"Ali ste prepričani, da jo želite uporabljati?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Odrezana datoteka ISO\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Datoteka ISO, ki ste jo izbrali, ni pričakovane velikosti: %s njenih podatkov manjka.\\n\"\n\"\\n\"\n\"Če ste jo prenesli z interneta, jo prenesite še enkrat in preverite, ali se vrednosti MD5 in SHA ujemata z uradnima.\\n\"\n\"\\n\"\n\"V Rufusu ju lahko izračunate z gumbom (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Napaka pri preverjanju časovnega žiga\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Ni bilo mogoče ugotoviti, da je časovni žig prenesene posodobitve res novejši od vaše trenutne verzije Rufusa.\\n\"\n\"\\n\"\n\"Da ne bi prišlo do potencialnega napada, je bil postopek posodobitve prekinjen, prenesena posodobitev pa bo izbrisana. Za več podrobnosti preverite zapisnik.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Nastavitve aplikacije\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Informacije o tej aplikaciji\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Prikaži zapisnik\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Ustvari sliko izbrane naprave\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Tu izberete, ali želite uporabiti to napravo, da bi namestili operacijski sistem Windows na drug disk, ali da bi ga neposredno izvajali s tega pogona (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Hitro zapolnjujem nosilec z ničlami: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"to lahko traja\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Zaznavanje navideznih nosilcev (VHD)\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Stisnjen arhiv\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Izbrana ISO slika uporablja UEFI in je dovolj majhna, da jo je mogoče zapisati na sistemsko particijo EFI (EFI System Partition oz. ESP). Za nekatere vrste namestitev je to lahko bolje kot običajni način, pri katerem se slika zapiše na particijo, ki zaseda celoten disk.\\n\"\n\"\\n\"\n\"Izberite, na kateri način želite zapisati to sliko:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"To lahko omogočite z %s v glavnem oknu aplikacije.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Dodatne zgoščene vrednosti (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Shrani v VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Izračunaj kontrolne vsote slik\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Skupek gumbov\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Število prehodov\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"Identifikator diska\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Privzeta prioriteta niti: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Indikator zagonskosti (Boot Marker, \\\"55 AA\\\") se ignorira\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Osvežujem razpored particij (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Izbrana slika je vrste ISOHybrid, vendar ni združljiva z načinom kopiranja datotek (ISO),\\n\"\n\"zato bo za zapisovanje uporabljen način za slike DD.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Ni mogoče odpreti ali brati »%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Uporaba prilagoditve sistema Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Uporaba uporabniških možnosti ...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Uporabniška izkušnja sistema Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Prilagodite namestitev sistema Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Odstranite zahtevo za 4GB+ RAM, Varni zagon in TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Odstranjevanje zahteve za spletni Microsoftov račun\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Onemogoči zbiranje podatkov (Preskoči vprašanja o zasebnosti)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Preprečevanje dostopa do notranjih diskov za Windows To Go\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Ustvarite lokalni račun z uporabniškim imenom:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Nastavite regionalne možnosti na enake vrednosti, kot jih ima ta uporabnik\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Onemogoči samodejno šifriranje naprave BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Trajni dnevnik\"\n\n#. • MSG_337\n#, fuzzy\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Za namestitev MS-DOS je treba od Microsofta prenesti dodatno datoteko ('diskcopy.dll'):\\n\"\n\"- Izberite 'Da', da se povežete z internetom in jo prenesete\\n\"\n\"- Izberite 'Ne', da prekličete operacijo\\n\"\n\"\\n\"\n\"Opomba: datoteka bo prenesena v imenik aplikacije in samodejno ponovno uporabljena, če je prisotna.\"\n\n#. • MSG_338\n#, fuzzy\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Zaznan preklican zagonski nalagalnik UEFI\"\n\n#. • MSG_339\n#, fuzzy\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus je zaznal, da ISO, ki ste ga izbrali, vsebuje zagonski nalagalnik UEFI, ki je bil preklican in bo ustvaril %s, ko je varen zagon omogočen v popolnoma posodobljenem sistemu UEFI.\\n\"\n\"\\n\"\n\"- Če ste to ISO sliko pridobili iz neuglednega vira, razmislite o možnosti, da morda vsebuje zlonamerno programsko opremo UEFI, in se izogibajte zagonu iz nje.\\n\"\n\"- Če ste jo pridobili iz zaupanja vrednega vira, poskusite poiskati posodobljenejšo različico, ki tega ne bo povzročila tega opozorila.\"\n\n#. • MSG_340\n#, fuzzy\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"zaslon \\\"Kršitev varnosti\\\".\"\n\n#. • MSG_341\n#, fuzzy\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"zaslon za obnovitev sistema Windows (BSOD) z '%s'\"\n\n#. • MSG_342\n#, fuzzy\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Stisnjena VHDX slika\"\n\n#. • MSG_343\n#, fuzzy\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Nestisnjena VHD Slika\"\n\n#. • MSG_344\n#, fuzzy\nmsgid \"Full Flash Update Image\"\nmsgstr \"Slika celotne posodobitve Flash\"\n\n#. • MSG_345\n#, fuzzy\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Za uporabo te funkcije je treba od Microsofta prenesti nekaj dodatnih podatkov:\\n\"\n\"- Izberite 'Da', da se povežete z internetom in jih prenesete\\n\"\n\"- Izberite 'Ne0, da prekličete operacijo\"\n\n#. • MSG_346\n#, fuzzy\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Omejite Windows na S-način (NEZDRUŽLJIVO z obvodom spletnega računa)\"\n\n#. • MSG_347\n#, fuzzy\nmsgid \"Expert Mode\"\nmsgstr \"Strokovni način\"\n\n#. • MSG_348\n#, fuzzy\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Ekstrahiranje arhivskih datotek: %s\"\n\n#. • MSG_349\n#, fuzzy\nmsgid \"Use Rufus MBR\"\nmsgstr \"Uporabite Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus je program za formatiranje in ustvarjanje zagonskih naprav USB.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Uradna stran: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Šifra vira: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Spremenitve: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Ta aplikacija je licencirana pod pogoji GNU Javne licence (GPL) različice 3.\\n\"\n\"Oglejte si https://www.gnu.org/licenses/gpl-3.0.html podrobnosti.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Zagon\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatiranje USB, bliskavice in virtualnih pogonov na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Ustvarite FreeDOS zagonske USB pogone\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Ustvarite zagonske pogone iz zagonskih ISO-jev (Windows, Linux itd.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Ustvarite zagonske pogone iz slik diska, ki jih je mogoče zagnati, vključno s stisnjenimi\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Ustvarite zagonske pogone BIOS ali UEFI, vključno z UEFI bootable NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Ustvarjanje pogonov »Windows To Go'\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Ustvarjanje namestitvenih pogonov za Windows 11 za računalnike, ki nimate TPM ali Varnega zagona\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Ustvarjanje trajnih Linux particij\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Ustvarjanje VHD/DD slik izbranega pogona\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Račun MD5, SHA-1, SHA-256 in SHA-512 kontrolni vsoti izbrane slike\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Izvajanje preverjanj slabih blokov, vključno z odkrivanjem »lažnih« bliskavic\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Prenos uradnih Microsoft Windows maloprodaja ISOs\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Prenos UEFI Shell ISOs\"\n"
  },
  {
    "path": "res/loc/po/sr-RS.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-10 22:14+0200\\n\"\n\"PO-Revision-Date: 2024-05-10 22:25+0200\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: sr_RS\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Serbian (Srpski)\\n\"\n\"X-Rufus-LCID: 0x241a, 0x081a, 0x181a, 0x2c1a, 0x701a, 0x7c1a\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Osobine diska\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Uređaj\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Izbor podizanja sistema\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Izaberi\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Opcija slike\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Particijska šema\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Izabrani sistem\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Pokaži USB čvrste diskove\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Dodaj ispravke za stare BIOS-e (dodatne particije, svrstanje, itd.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Омогућите проверу UEFI медија током извршавања\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Opcije formata\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Datotečni sistem\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Veličina klastera\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Naziv novog volumena\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Brzo formatiranje\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Proveri prisutnost neispravnih blokova\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Izradi produženu oznaku i ikone\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Stanje\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Zatvori\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Započni\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"O Rufus-u\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licenca\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"U redu\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus Licenca\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Više informacija\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Da\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Ne\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Zapisnik\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Obriši\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Sačuvaj\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Polisa ažuriranja i podešavanja\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Podešavanja\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Proveri nova ažuriranja\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Obuhvati beta verzije\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Provjeri\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Provjera ažuriranja - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Dostupna je novija verzija. Molimo preuzmite tu verziju!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Klikni ovdje za pristup web-stranici\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Bilješke distribucije\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Preuzmi\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Još jedna instanca pronađena\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Postoji već jedna instanca Rufus-a.\\n\"\n\"Molimo zatvorite pokrenutu instancu prije pokretanja nove.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"UPOZORENJE: SVI PODACI NA OVOM UREĐAJU '%s' ĆE BITI UNIŠTENI.\\n\"\n\"Da nastavite, odaberite U REDU. Da odustanete odaberite OTKAŽI.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Polisa ažuriranja Rufus-a\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Dozvolite Rufus-u da automatski traži nove verzije?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Odustani\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Pronađeni neispravni blokovi\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Provjera završena: %d nespravnih blokova pronađeno\\n\"\n\"  %d grešaka čitanja\\n\"\n\"  %d grešaka pisanja\\n\"\n\"  %d korupcija\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Detaljan izvještaj se nalazi u:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Onemogućeno\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Dnevno\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Sedmično\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Mjesečno\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Prilagođeno\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Vaša verzija: %d.%d (Izvršna verzija %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Zadnja verzija: %d.%d (Izvršna verzija %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"bajti\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobajti\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabajti\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Uobičajeno\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Uobičajeno)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (ili UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (ne CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS ili UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d sekvenca\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d sekvence %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO datoteke\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Aplikacija\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Prekini\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Pokreni\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operaciju prekinuo korisnik\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Greška\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Greška: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Preuzimanje datoteka\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB uređaj za pohranu (Opšti)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Više particije\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Ispiranje bafera\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Otkazivanje\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Uspešno.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Neutvrđena greška pri formatiranju.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Ne može se korititi odabrani sistem datoteka za ovaj uređaj.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Odbijen pristup uređaju.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Uređaj je zaštićen od pisanja.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Uređaj se koristi u drugom procesu. Zatvorite procese koji koriste uređaj.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Brzo formatiranje nije nedostupno za ovaj uređaju.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Oznaka volumena je neispravna.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Identifikator uređaja ja neispravan.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Odabrana veličina klastera nije ispravna za ovaj uređaj.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Veličina volumena je neispravna.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Umetnite prenosni uređaj.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Primljena je nepodržana komanda.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Greška pri raspodjeli memorije.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Greška pri čitanju.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Greška pri pisanju.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Neuspjela instalacija\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Nije moguće otvoriti medij. Možda ga koristi drugi proces. Ponovo umetnite uređaj i pokušajte ponovo.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Greška pri particionisanju uređaja.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Datoteke se ne mogu kopirati na odabrani uređaj.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Otkazao korisnik.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Nije moguće započeti nit.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Provjera neispravnih blokova nije završena.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Neuspjelo skeniranje ISO datoteke.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Neuspjelo raspakivanje ISO datoteke.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Nije moguće postaviti volumen.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Nije moguće zakrpiti/postaviti datoteke za podizanje sistema.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Nije moguće dodijeliti slovo disk jedinici.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Nije moguće postaviti GUID volumen.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Uređaj nije spreman.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus je otkrio da Windows još uvjek ispira svoje unutrašnje bafere na USB uređaj.\\n\"\n\"\\n\"\n\"Zavsino od brzine vašeg USB uređaja, ova operacija može potrajati dugo, naročito za velike datoteke.\\n\"\n\"\\n\"\n\"Preporučujemo da dozvolite Windows-u da završi, kako bi izbjegli korupciju. Ukoliko ne želite čekati, samo izvadite USB uređaj...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Nepodržana datoteka\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Ova slika nije podržana, ili koristi metodu kompresije koju Rufus ne podržava...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Zameni %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Ova ISO datoteka koristi zastarjelu verziju '%s'.\\n\"\n\"Zbog toga, moguće je da se meniji pri podizanju sistema ne prikažu valjano.\\n\"\n\"\\n\"\n\"Rufus može preuzeti noviju verziju da ne dođe do problema:\\n\"\n\"- Odaberite 'Da' kako bi ste datoteka preuzela\\n\"\n\"- Odaberite 'Ne' da ostavite postojeću ISO datoteku\\n\"\n\"Ukoliko niste sigurni šta da odaberete, odaberite 'Da'.\\n\"\n\"\\n\"\n\"Napomena: Nova datoteka će biti sačuvana u istom direktorijumu kao i Rufus, i kad datoteka '%s' postoji tamo, automatski će biti korišćena.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Preuzimam %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Nije odabrana datoteka\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"za %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Datoteka je prevelika\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Datoteka je prevelika za odabrani uređaj.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Nepodržana ISO datoteka\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Kada koristite UEFI tip, samo EFI datoteke za podizanje sistema su podržane. Odaberite EFI ISO datoteku za podizanje sistema ili postavite tip na BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Nepodržan sistem datoteka\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"VAŽNO: OVAJ UREĐAJ SADRŽI VIŠE PARTICIJA!!\\n\"\n\"\\n\"\n\"Ovo uključuje particije/ koje nisu vidljive u Windows-u. Ako nastavite, bilo kakav gubitak podataka na ovim particijama je vaša odgovornost.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Pronađeno više particija\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD datoteka\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Trenutno odabrani sistem datoteka se ne može koristiti s ovim tipom ISO datoteke Molimo odaberite drugi sistem datoteka ili odaberite drugu ISO datoteku.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' se može koristiti samo ako je sistem datoteka NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"VAŽNO: Želite instalirati 'Windows To Go', ali vaš odabrani uređaj ima 'FIXED' atribut. Zbog ovoga Windows će se vrlo vjerovatno zamrznuti pri pokretanju, ojer Microsoft nije dizajnirao Windows To Go za uređaje sa 'REMOVABLE' atributa.\\n\"\n\"\\n\"\n\"Želite nastaviti svjedeno?\\n\"\n\"\\n\"\n\"Napomena: 'FIXED/REMOVABLE' atribut je hardversko svojstvo koje može izmijeniti samo pomoću specijalnih alata od proizvođača uređaja. Ovi alati SKORO NIKAD nisu dostupni javnosti...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Ograničenja sistema datoteka\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Ova ISO datoteka sadrži fajl veću od 4 GB, što je više nego dozvoljeno za FAT ili FAT32 sisteme datoteka.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Nedostaje WIM podrška\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Vaša platforma ne može raspakovati datoteke iz WIM arhiva. WIM raspakivanje je potrebno za izradu EFI Windows 7 i Windows Vista USB uređaja za podizanje sistema. Ta opcija je dostupna u poslednjim verzijama 7-Zip-a.\\n\"\n\"Da li želite da posjetite 7-zip stranicu za preuzimanje?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Preuzmi %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s ili noviji zahtijeva '%s' za instalaciju.\\n\"\n\"Zato što je veća od 100 KB, i uvijek prisutna na %s ISO datotekama, nije ugrađena u Rufus.\\n\"\n\"\\n\"\n\"Rufus je može preuzeti:\\n\"\n\"- Odaberite 'Da' kako bi se datoteka preuzela\\n\"\n\"- Odaberite 'Ne' ako ne želite preuzeti datoteku\\n\"\n\"\\n\"\n\"Napomena: Nova datoteka će biti sačuvana u istom direktorijumu kao i Rufus, i kad datoteka '%s' postoji tamo, automatski će biti korišćena.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Otkazivanje može ostaviti uređaj u NEUPOTREBLJIVOM stanju.\\n\"\n\"Ukoliko ste sigurni da želite da odustanete, odaberite DA. U suprotnom, odaberite NE.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Molimo odaberite folder\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Sve datoteke\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus zapisnik\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS se ne može podići sa uređaja kod kojeg je veličina klastera 64 kilobajti.\\n\"\n\"Molimo promijenite veličinu klastera ili odaberite FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Nekompatibilna veličina klastera\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Formatiranje velikih UDF volumena može trajati dugo. Pri USB 2.0 brzinama, procijenjeno vrijeme formatiranja je %d:%02d, tokom kojeg će indikator napretka djelovati zamrznuto. Molimo Vas budite strpljivi!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Veliki UDF volumen\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Ova datoteka koristi Syslinux %s%s ali ova aplikacija uključuje samo instalacijske datoteke za Syslinux %s%s.\\n\"\n\"\\n\"\n\"Pošto nove verzije Syslinux-a nisu međusobno kompatibilne, dvije dodatne datoteke moraju biti preuzete sa Internet-a ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Odaberite 'Da' kako bi se datoteke preuzele\\n\"\n\"- Odaberite 'Ne' da odustanete od ove operacije\\n\"\n\"\\n\"\n\"Napomena: Nove datoteke će biti sačuvane u istom direktorijumu kao i Rufus, i kad datoteke '%s' postoje tamo, automatski će biti korišćene.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Potrebno preuzimanje\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Ova slika koristi Grub %s ali aplikacija sadrži samo instalacijske datoteke za Grub %s.\\n\"\n\"\\n\"\n\"Kako različite verzije Grub-a ne moraju biti kompatibilne, i nije ih moguće sve obuhvatiti, Rufus će pokušati da pronađe verziju instalacijske datoteke Grub-a ('core.img') koja odgovara onoj iz vaše datoteke:\\n\"\n\"- Odaberite 'Da' kako bi se datoteke preuzele\\n\"\n\"- Odaberite 'Ne' kako bi koristili verziju iz Rufus-a\\n\"\n\"- Odaberite 'Otkaži' kako biste prekinuli operaciju\\n\"\n\"\\n\"\n\"Napomena: Nove datoteke će biti sačuvane u istom direktorijumu kao i Rufus, i kad datoteke '%s' postoje tamo, automatski će biti korišćene.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Standardna instalacija Windows-a\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"Windows To Go (instaliran na USB-u)\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"detaljnije opcije diska\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"detaljnije opcije formata\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Prikaži %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Sakrij %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Stalna veličina particije\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Bez stalne veličine\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Izaberite veličinu stalne particije za live USB datoteku. Podešavanjem na 0 onemogućava stalnu particiju.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Izaberite veličinu jedinice particije.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Ne pokazuj više ovo uporuku\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Bitno obaveštenje %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Upravo si napravio mediju koja koristi UEFI:NTFS bootloader. Molim te zapamti da dabi koristi ovakve fajlove moraš da isključiš bezbedno butovanje. \\n\"\n\"Za detalje o tome zašto je ovo neophodno, pritisni dugme \\\"Više informacija\\\" dole.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows odabir slike\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Ovaj ISO sadrži više slika windows-a.\\n\"\n\"Molimte odaberi sliku koju želiš da koristiš za ovu instalaciju:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"NEki drugi program koristi uređaj. Da li idalje želiš da ga formatiraš?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus je detektovao da pokušavaš da kreiraš \\\"Windows To Go\\\" mediju maziranu na 1809 iso-u.\\n\"\n\"\\n\"\n\"Zbog Microsftovog baga ovaj medija će se krešovati tokom butovanja (plavi ekran smrti), osim ako manualno nezameniš fajl 'WppRecorder.sys' sa 1803 verzijom.\\n\"\n\"\\n\"\n\"Takođe zapamti da Rufus ovo nemože sam da popravi zato što je 'WppRecorder.sys' zaštićem autorskim pravima od strane Microsoft-a, tako da mi nemamo zakonska prava da koristimo taj fajl.\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Zato što je MBr odabran za šemu particija, rufus može da napravi particije smo do 2TB sa ovom medijom, što će da ostavi %s diska nedostupno.\\n\"\n\"\\n\"\n\"Da li želiš da nastaviš?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Verzija\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Izdanje\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Edicija\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Jezik\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Arhitektura\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Nastavi\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Nazad\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Molim sačekjate...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Skini koristeći pretraživač\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Preuzimanje Windows ISO-a nije dostupno zbog toga što je Microsoft izmenio njihovu sajt da bi to sprečio.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 ili noviji zahtevan da se pokrene ova skripta.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Da li želiš da odeš onlajn i skineš ga?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Pokrećem skriptu za skidanje...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Skini ISO S+sliku\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Tip računara sa kojim želite koristiti butabilni disk. Vaša je odgovornost da odredite da li je vaš sistem BIOS ili UEFI tip pre no što krenete sa pravljenjem ovog butabilnog diska, zbog mogućnosti da butabilni disk ne radi.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' znači da će se uređaj uključiti u emulaciji BIOS-a, (poznatog kao 'Legacy Mode') pod UEFI startovanja, ali ne i u prirodnom UEFI stanju.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'ne CSM' znači da će se uređaj samo startovati u prirodnom UEFI stanju, ali ne i u stanju emulacije BIOS-a (poznatog kao 'Legacy Mode')\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Test uzorak: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Test uzorak: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Test uzorak: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Test uzorak: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Postavi sistem datoteka\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Minimalna veličina koju će blok zauzeti u sistemu datoteka\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Ovde unesite naziv za disk.\\n\"\n\"Internacionalni karakteri su prihvatljivi.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Prikaži/Sakrij napredna podešavanja\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Provjeri prisutnost neispravnih blokova pomoću test uzorka\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Odznačite ovo polje kako bi koristili \\\"sporu\\\" metodu za formatiranje\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metod koji će biti korišćen za pravljenje particija\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Metoda za izradu uređaja sposobnog za podizanje sistema\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Klikni da skineš ili odabereš datoteku...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Označite ovo polje kako biste dozvolili prikaz internacionalnih oznaka i napravite ikonicu uređaja (izrađuje autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Инсталирајте UEFI боотлоадер, који ће извршити проверу МД5Сум-y датотеке медија\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Napravi dodatnu skrivenu particiju i pokušaj poravnati granice particije.\\n\"\n\"Ovo može poboljšati pronalaske uređaja za podizanje sistema kod starih BIOS-a.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Pronalazak USB hard diskova. Koristiti na vlastitu odgovornost!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Započni proces formatiranja.\\n\"\n\"Ovo će UNIŠTITI sve podatke na uređaju!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Neispravan potpis preuzimanja\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Kliknite za odabir...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Pouzdan Alat Za Formatiranje USB diska\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Verzija %d.%d (Izvršna verzija %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Preveo:\\\\line• Ivan Strugar <mailto:isdjuka@gmail.com>\\\\line• Aleksandar Predić <mailto:notesofdespairandlove@gmail.com>\\\\line• Miloš Ljubičić <mailto:ljubimilos@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Prijavite greške ili zahtjeve za poboljšanja na:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Dodatna autorska prava:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Polisa ažuriranja:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Ukoliko dozvolite ovom programu provjeru ažuriranja, dozvoljavate da sledeće informacije mogu biti prikupljene na našem serveru/serverima:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Arhitektura i verzija vašeg operativnog sistema\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Verzija aplikacije koju koristite\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Vaša IP adresa\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"U svrhu izrade privatne statistike korišćenja, možemo zadržati navedene informacije, \\\\b najduže jednu godinu\\\\b0 . Međutim, nećemo dobrovoljno dijeliti sa trećim strankama.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Proces ažuriranja:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus nema pozadinskih procesa, tako da se provjere ažuriranja se obavljaju samo kada je Rufus aktivan.\\\\line\\n\"\n\"Naravno pristup internetu je obavezan pri provjeri ažuriranja.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Neispravna datoteka za odabranu opciju podizanja sistema\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Trenutna datoteka se ne podudara s odabranim opcijama za podizanje sistema. Odaberite drugu datoteku ili drugu opciju za podizanje sitema.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Ova ISO datoteka nije kompatibilna sa odabranim sistemom datoteka\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Pronađen nekompatibilan uređaj\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Sekvenca pisanja\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Sekvenca čitanja\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Preuzeto %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Nije moguće preuzeti %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Korišćenje ugrađene verzije %s datoteke/datoteka\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"VAŽNO: OVAJ UREĐAJ KORISTI NESTANDARDNU VELIČINU SEKTORA!\\n\"\n\"\\n\"\n\"Uobičajeno uređaji koriste sektore veličine 512 bajti ali ovaj uređaj koristi sektore veličine %d bajti. U većini slučajeva, ovo znači da NEĆETE moći da podignete sistem sa ovog uređaja.\\n\"\n\"Rufus može probati da izradi uređaj sposoban za podizanje sistema, ali NEMA GARANCIJE da će uspjeti u tome.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Pronađena nestandardna veličina sektora\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' može biti instaliran samo na GPT particionisanom uređaju ukoliko ima postavljen FIXED atribut. U odabranom uređaju nije postavljen kao FIXED.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Ova funkcija nije dostupna na ovoj platformi.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Otkazivanje - Molimo Vas sačekajte...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Skeniranje slike u toku...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Neuspjeh pri skeniranju slike\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Pronađen zastario %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Koristi se slika: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Nedostaje %s datoteka\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Novi volumen\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d uređaj pronađen\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d uređaja pronađeno\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"SPREMNO\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Otkazano\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"NEUSPJEŠNO\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Pokretanje nove aplikacije...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Pokretanje nove aplikacije nije uspjelo\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Otvoreno %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Sačuvano %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formatiranje: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Izrada sistema datoteka: Zadatak %d/%d završen\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS krpljenje: %d%% završen\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formatiranje (%s) - Procijenjeno trajanje %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Postavljanje oznake (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formatiranje (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS krpljenje (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Čišćenje MBR/PBR/GPT struktura...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Zahtijevanje pristupa disku...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analiziranje postojeće evidencije za podizanje sistema...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Zatvaranje postojećeg volumena...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Pisanje glavne evidencije za podizanje sistema...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Pisanje particijske evidencije za podizanje sistema...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopiranje DOS datoteka...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopiranje ISO datoteka: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Postavljanje Win7 EFI postavki za podizanje sistema (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Dovršavanje...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Instaliranje Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Neispravni blokovi: %s %d/%d - %0.2f%% (%d/%d/%d greške)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Neispravni blokovi: Testiranje sa nasumičnim uzorkom\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Neispravni blokovi: Testiranje sa uzorkom 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Particionisanje (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Brisanje particija (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Nije moguće potvrditi digitalni potpis za skinutu nadogradnju. Ovo može da znači da vaš sistem nije ispravno konfigurisan za validaciju potpisa, ili prikazuje mogućnost da je preuzet maliciozan fajl.\\n\"\n\"\\n\"\n\"Preuzimanje će biti obrisano. Molimo vas pogledajte log fajl za više detalja.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Preuzimanje: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Neuspjelo preuzimanje datoteka.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Provjera ažuriranja Rufusa...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Ažuriranja: Nije moguće spojiti se na Internet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Ažuriranja: Nije moguće pristupiti podacima o verziji\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Dostupna nova verzija Rufus-a!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Nema novih verzija Rufus-a\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Ključevi aplikacionog registra uspješno obrisani\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Brisanje ključeva aplikacionog registra nije uspjelo\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s omogućeno\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s onemogućeno\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Provjerivanje veličine\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Otkrivanje čvrstih diskova\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Prisilno veliko FAT32 formatiranje\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun će biti obrisan pri izlasku\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Otkrivanje lažnog uređaja\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet podrška\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge podrška\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Prisilno ažuriranje\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS komprimovanje\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Pisanje slike: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO podržavanje\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Korišćenje PRAVIH jedinice mjere\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Brisanje direktorijuma '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Pronalaženje VMWare diska\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Dvostruki UEFI/BIOS režim\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Primjenjivanje Windows datoteke: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Primjenjivanje Windows datoteke...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Očuvanje vremenske oznake datoteka\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB uklanjanje grešaka\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Računanje kontrolnog zbira datoteke: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Računaj MD5, SHA1 and SHA256 kontrolne zbirove za odabranu datoteku\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Promjena aplikacijskog jezika\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Pronađena %s datoteka\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Datoteka koju ste odabrali je 'ISOHybrid' datoteka. Takva datoteka može biti zapisana metodom %s (kopiranje) ili %s (disk datoteka).\\n\"\n\"Rufus preporučuje metodu %s, tako da uvjek imate neograničen pristup uređaju nakon pisanja u njemu.\\n\"\n\"Ukoliko naiđete na probleme pri podizanju sistema, isprobajte metodu %s.\\n\"\n\"\\n\"\n\"Molimo odaberite metodu za ovu operaciju:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Metodom %s (Preporučeno)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Metodom %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Proveravanje za konfliktne procese...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Nije za podizane sistema\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disk ili ISO slika\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"(Odaberite datoteku)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Ekskluzivno zaključavanje USB uređaja\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Neispravan potpis\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Nedostaje digitalni potpis u izvršnoj datoteci.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Preuzeta izvršna datoteka je potpisana od strane '%s'.\\n\"\n\"Ovo nije potpis koji prepozanajemo i može ukazivati na neki oblik zlonamjerne aktivnosti...\\n\"\n\"Da li ste sigurni da želite pokrenuti ovaj program?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Anuliranje uređaja: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Detekcija ne-USB diskova\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Nedovoljno privilegija\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Aplikacija može biti pokrenuta samo uz administratorske privilegije\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Indeksiranje datoteka\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Odabir verzije\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Odaberite verziju Windows-a koju želite da instalirate:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Nepodržana verzija Windows-a\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Rufus više ne podržava ovu verziju Windows-a.\\n\"\n\"Poslednja verzija Rufus-a kompatibilna sa ovom platformom je v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Upozorenje: Nezvanična verzija\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Ovu verziju Rufus-a nije proizveo zvanični programer(i).\\n\"\n\"\\n\"\n\"Da li ste sigurni da želite da je pokrenete?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"ISO datoteka nije validna\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"ISO datoteka koju ste odabrali ne podudara se sa njenom zvaničnom veličinom: %s nedostaje!\\n\"\n\"\\n\"\n\"Ukoliko ste preuzeli ovu datoteka sa Interneta, pokušajte da preuzmete novu kopiju ove datoteke i proverite da li se podudara sa zvaničnom datotekom pomoću MD5 ili SHA kontrolne sume.\\n\"\n\"\\n\"\n\"Napomena, možete izračunati MD5 ili SHA kontrolnu sumu pomoću Rufus-a klikom na (✓) dugme.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Greška potvrđivanja vremenskog pečata\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus nije mogao potvrditi da je vremenski pečat preuzimanog ažuriranja noviji od trenutnog.\\n\"\n\"\\n\"\n\"Da bi se mogao sprečiti potencijalni napad, proces ažuriranja je zaustavljen i preuzimanje će biti obrisano. Molimo vas da proverite ispisani fajl za više detalja.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Prikaži podešavanja aplikacije\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Prikaži informacije o ovoj aplikacije\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Prikaži ispisani fajl\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Napravi disk sliku od izabranog fajla\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Izaberite ovu opciju kako bi odlučili da li želite koristiti ovaj uređaj kako bi instalirati Windows na drugi disk, ili da li želite koristiti Windows direktno sa ovog uređaja (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Brže-popunjavanje nulom diska: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"ovo može potrajati\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD detektovan\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Kompresovana arhiva\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"ISO koji ste odabrali koristi UEFI I dovoljno da je malo da bude napisano kao EFI sistemska particija (ESP). Pisanje na ESP umesto pisanje na genetičnu particiju koja zauzima celi disk može biti poželjnije za neke vrste instalacije \\n\"\n\"\\n\"\n\"Molimo odaberite model koj želite da koristite za pisanje ove slike:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Koristi %s (u glavnoj aplikaciji) da bi uključio.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Dodatni heševi (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Sačuvaj u VHD direktoriju\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Računaj kontrolni zbir slike\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Mnoštvo dugmadi\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Broj prelazaka\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID dika\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Podrazumevana prioritetna nit: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignoriši boot marker\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Osvežavanje participnog rasporeda (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Slika koju si odabrao je ISOHibrid, ali njeni kreatori ga nisu napravili kompatibilnim sa ISO/File copy mode-om.\\n\"\n\"Kao rezultat toga, DD režim pisanje slike će biti primenjen.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Nije moguće otvoriti ili pročitati '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Premena prilagođavanja Winodows-a\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Primena korisničkih opcija...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows-ovo korisnicko iskustvo\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Želite li da prilagodite Windows instalaciju?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Ukloni yahtev ya 4GB+ RAM-a, bezbednosno pokretanje i TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Ukloni zahteve za online Microsoft nalog\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Onemogući prikupljanje podataka (preskoči pitanja o privatnosti)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Spreči Windows to go da pristupa internim diskovima\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Kreiraj lokalni nalog sa imenom:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Stavi regionalnu opciju na istu vrednost kao i ovaj korisnik\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Onemogući BitLocker automatsku enkripciju uređaja\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Trajna evidencija\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Додатна датотека ('diskcopy.dll') мора да се преузме са Microsoft-a да би се инсталирао MS-DOS:\\n\"\n\"- Изаберите „Да“ да бисте се повезали на Интернет и преузели га\\n\"\n\"- Изаберите „Не“ да бисте отказали операцију\\n\"\n\"\\n\"\n\"Напомена: Датотека ће бити преузета у директоријум апликације и аутоматски ће се поново користити ако постоји.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Откривен је опозвани UEFI покретач\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Руфус је открио да ISO који сте изабрали садржи UEFI покретач који је опозван и који ће произвести %s када је безбедно покретање омогућено на потпуно ажурираном UEFI систему.\\n\"\n\"\\n\"\n\"- Ако сте ову ISO слику добили од неугледног извора, требало би да размотрите могућност да садржи UEIFI малвер и избегавајте покретање са њега.\\n\"\n\"- Ако сте га добили од поузданог извора, покушајте да пронађете новију верзију, која неће произвести ово упозорење.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"екран „Нарушавање безбедности“\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"Windows Рековери Екран (BSOD) са „%s“\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Компресована VHDX слика\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Некомпримована VHD слика\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Фулл Фласх Упдате Имаге\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Неки додатни подаци морају се преузети од Microsoft-a да бисте користили ову функцију:\\n\"\n\"- Изаберите „Да“ да бисте се повезали на Интернет и преузели га\\n\"\n\"- Изаберите „Не“ да бисте отказали операцију\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Ограничите Виндовс на С-Моде (НИЈЕ КОМПАТИБИЛАН са заобилажењем налога на мрежи)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Ekspertni Rezim\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Распакивање архивских датотека: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Koritsti Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus je uslužni program koji pomaže u formatiranju i kreiranju USB fleš diskova koji se mogu pokretati, kao što su USB ključevi, memorijski štapići itd.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Zvaničan sajt: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Izvorni kod: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Evidencija promena: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Ova aplikacija je licencirana pod uslovima GNU Javne licence (GPL) verzije 3. \\n\"\n\"Pogledajte https://www.gnu.org/licenses/gpl-3.0.en.html za više informacija.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatiraj USB, flash kartice, i virtualne diskove u FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Kreiraj FreeDOS butabilni USB disk\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Kreirajte disk jedinice za pokretanje sistema od ISO-a koji se mogu pokretanja sistema (Windows, Linux itd.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Kreiranje disk jedinica za pokretanje sistema sa slika diska koji se može pokretanja, uključujući kompresovane\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Kreiranje BIOS ili UEFI disk jedinica za pokretanje sistema, uključujući NTFS sa UEFI pokretanjem sistema\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Kreiranje disk jedinica \\\"Windows to Go\\\"\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Kreiranje windows 11 instalacionih disk jedinica za računare koji nemaju TPM ili bezbedno pokretanje sistema\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Kreiranje upornih Linux particija\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Kreiranje VHD/DD slika izabrane disk jedinice\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Izračunajte MD5, SHA-1, SHA-256 i SHA-512 kontrolne preglede izabrane slike\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Izvršite provere loših blokova, uključujući otkrivanje \\\"lažnih\\\" fleš diskova\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Preuzmite zvanične Microsoft Windows maloprodajne ISO-ove\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Preuzmite UEFI Shell ISOs\"\n"
  },
  {
    "path": "res/loc/po/sv-SE.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2025-09-23 20:25+0100\\n\"\n\"PO-Revision-Date: 2025-09-23 20:25+0100\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: sv_SE\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Swedish (Svenska)\\n\"\n\"X-Rufus-LCID: 0x041d, 0x081d\\n\"\n\"X-Generator: Poedit 3.7\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Enhetsegenskaper\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Enhet\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Startval\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Välj\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Avbildsalternativ\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Partitionsschema\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Målsystem\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Lista USB-hårddiskar\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Lägg till korrigeringar för äldre BIOS:ar (extra partition, etc)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Aktivera runtime UEFI-mediavalidering\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Formatalternativ\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Filsystem\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Klusterstorlek\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Volymetikett\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Snabbformatering\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Kontrollera enheten efter trasiga block\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Skapa utökat namn och ikonfiler\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Stäng\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Starta\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Om Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Licens\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus licens\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Mer information\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Ja\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Nej\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Logg\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Rensa\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Spara\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Uppdateringspolicy och inställningar\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Inställningar\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Sök efter uppdateringar\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Även beta-versioner\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Uppdatera nu\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Sök efter uppdateringar - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"En nyare version finns tillgänglig. Ladda gärna ner senaste versionen!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Tryck här för att komma till hemsidan\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Programinformation\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Nerladdning\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Programmet körs redan\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Rufus körs redan.\\n\"\n\"Stäng det första programmet innan du startar ett nytt.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"VARNING: ALL DATA PÅ ENHETEN '%s'\\n\"\n\"KOMMER ATT TAS BORT.\\n\"\n\"För att fortsätta tryck OK. För att avbryta tryck AVBRYT.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus uppdateringspolicy\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Tillåter du att Rufus söker efter uppdateringar på nätet?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Avbryt\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Trasiga block funna\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Kontroll klar: %d trasiga block funna\\n\"\n\"  %d läsfel\\n\"\n\"  %d skrivfel\\n\"\n\"  %d korruptionsfel\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"En mer detaljerad rapport hittar du i:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Inaktiverad\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Dagligen\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Veckovis\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Månadsvis\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Egen\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Din version: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Senaste version: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobyte\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabyte\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Standard\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Standard)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (eller UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (icke CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS eller UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d gång\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d gånger %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO-avbild\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Program\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Avbryt\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Starta\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Operationen avbröts av användaren\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Fel\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Fel: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Filnerladdning\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB-lagringsenhet (Allmänt)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Flera partitioner\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Tömmer buffertar\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Avbryter\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Lyckades.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Obestämd fel vid formatering.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Kan inte använda valt filsystem för detta media.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Åtkomst till enheten nekades.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Mediet är skrivskyddat.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Enheten används redan av en annan process. Stäng andra processer som kan tänkas använda enheten.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Enheten går inte att snabbformatera.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Volymens namn är ogiltigt.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Hantering av enheten är ogiltig.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Klusterstorlek är ogiltig för denna enheten.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Volymens storlek är ogiltig.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Sätt i ett flyttbart media i enheten.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Tog emot ett ogiltigt kommando.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Minnesfel.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Läsfel.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Skrivfel.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Installationsfel\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Kunde inte öppna mediet. Det verkar redan användas av en annan process. Prova ta ur och stoppa in mediet igen.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Det gick inte att partitionera enheten.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Kunde inte kopiera filer till målenheten.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Avbruten av användaren.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Kunde inte starta tråd.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Kontroll efter trasiga block slutfördes inte.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Misslyckades söka av ISO-avbilden.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Misslyckades packa upp ISO-avbilden.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Kunde inte återmontera volymen.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Kunde inte installera filer för uppstarten (boot).\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Kunde inte tilldela enhetsbokstav.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Kan inte montera GUID-volymen.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Enheten är inte klar.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus har upptäckt att Windows fortfarande tömmer den interna bufferten till USB-enheten.\\n\"\n\"\\n\"\n\"Beroende på hastigheten på din USB-enhet, kan detta ta en lång stund innan det är klart, speciellt för stora filer.\\n\"\n\"\\n\"\n\"Vi rekommenderar att du låter Windows få slutföra, för att undvika problem. Men tröttnar du på att vänta, kan du helt enkelt bara dra ur enheten...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Avbilden stöds ej\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Denna avbild är antingen icke startbar, eller så använder den en start- eller kompression-metod som Rufus inte stöder...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Ersätt %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Denna ISO-avbild verkar använda en gammal version av '%s'.\\n\"\n\"Startmenyn visas kanske inte på ett korrekt sätt på grund av detta.\\n\"\n\"\\n\"\n\"Ladda ner en nyare version av Rufus så löser det problemet:\\n\"\n\"- Välj 'Ja' för att ansluta till internet och ladda ner filen\\n\"\n\"- Välj 'Nej' för att låta befintlig ISO-fil vara omodifierad\\n\"\n\"Vet du inte vad du ska välja, så ska du välja 'Ja'.\\n\"\n\"\\n\"\n\"Obs: Filen kommer att laddas ner i nuvarande katalog och när '%s' sedan finns där, kommer den automatiskt att återanvändas.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Laddar ner %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Ingen avbild vald\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"för %s-NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Avbilden är för stor\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Avbilden är för stor för det valda målet.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"ISO-filen stöds ej\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"När UEFI används som måltyp, kan endast EFI-startbara ISO-avbilder användas. Välj en EFI-startbar ISO-fil eller sätt måltypen till BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Filsystemet stöds ej\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"VIKTIGT: DENNA ENHETEN INNEHÅLLER FLERA PARTITIONER!!\\n\"\n\"\\n\"\n\"Detta kan inkludera partitioner/volymer som inte är listade eller synliga i Windows. Fortsätter du, är du själv ansvarig för all data som kan försvinna på dessa partitioner.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Flera partitioner upptäcktes\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD-avbild\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Det valda filsystemet kan inte användas med denna typ av ISO-fil. Välj ett annat filsystem eller en annan ISO-fil.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' kan endast tillämpas om filsystemet är NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"VIKTIGT: Du försöker att installera 'Windows To Go', men din målenhet är inte en FIXERAD enhet. Därför kommer troligen Windows att låsa sig vid uppstart, eftersom Microsoft inte har designat det att fungera med FLYTTBARA enheter.\\n\"\n\"\\n\"\n\"Vill du ändå fortsätta?\\n\"\n\"\\n\"\n\"Obs: FIXERAD/FLYTTBAR enhet ligger i hårdvaran och kan endast ändras med hjälp utav speciella verktyg som endast tillverkarna har. Dessa vertyg är något som NÄSTAN ALDRIG allmänheten får tillgång till...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Begränsningar i filsystem\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Denna ISO-avbild innehåller en fil som är större än 4 GB, vilket är mer än maximal storlek tillåtet för FAT- och FAT32-filsystemet.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Stöd för WIM saknas\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Din dator kan inte packa upp filer från ett WIM-arkiv. WIM-uppackning krävs för att skapa EFI-startbar Windows 7 och Windows Vista USB-enheter. Du kan lösa detta genom att installera 7-Zip.\\n\"\n\"Vill du besöka nerladdningssidan för 7-Zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Ladda ner %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s eller senare kräver en '%s' fil för att bli installerad.\\n\"\n\"Eftersom filen är större än 100 KB, och alltid finns på %s ISO-avbilder, finns den inte inbyggd i Rufus.\\n\"\n\"\\n\"\n\"Rufus kan ladda ner denna filen åt dig:\\n\"\n\"- Välj 'Ja' för att ansluta till internet och ladda ner filen\\n\"\n\"- Välj 'Nej' om du själv senare vill kopiera in filen på enheten\\n\"\n\"\\n\"\n\"Obs: Filen kommer att laddas ner i nuvarande katalog och när '%s' sedan finns där, kommer den automatiskt att återanvändas.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"Avbryter du, finns det risk enheten blir oanvändbar.Är du säker du vill avbryta, tryck JA. Annars tryck NEJ.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Välj mapp\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Alla filer\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus logg\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS kan inte starta från en enhet som använder 64 kilobytes klusterstorlek.\\n\"\n\"Ändra klusterstorleken eller använd FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Klusterstorlek stöds ej\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Att formatera en stor UDF-volym kan ta lång tid. Vid USB 2.0-hastigheter, är den beräknade formateringstiden runt %d:%02d, och under tiden kan förloppsindikatorn se ut att stå stilla. Ta det bara lugnt, tack!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Stor UDF-volym\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Denna avbild använder Syslinux %s%s men detta programmet innehåller endast installationsfiler för Syslinux %s%s.\\n\"\n\"\\n\"\n\"Eftersom nya versioner av Syslinux inte är kompatibla med varandra, skulle det vara omöjligt att alla fanns med i Rufus, så därför måste två filer laddas ner från internet ('ldlinux.sys' och 'ldlinux.bss'):\\n\"\n\"- Välj 'Ja' för att ansluta till internet och ladda ner filerna\\n\"\n\"- Välj 'Nej' för att avbryta det hela\\n\"\n\"\\n\"\n\"Obs: Filerna kommer att laddas ner i programmets katalog och kommer att användas igen automatiskt om de finns där.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Nerladdning krävs\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Denna avbild använder Grub %s men programmet innehåller endast installationsfiler för Grub %s.\\n\"\n\"\\n\"\n\"Eftersom olika Grub-versioner inte är kompatibla med varandra och det skulle vara omöjligt att inkludera dem alla, därför kommer Rufus att försöka finna den versionen av Grub installationsfilen ('core.img') som matchar den från din avbild:\\n\"\n\"- Välj 'Ja' för att ansluta till Internet och försöka ladda ner det\\n\"\n\"- Välj 'Nej' för att använda standardversionen från Rufus\\n\"\n\"- Välj 'Avbryt' för att avbryta\\n\"\n\"\\n\"\n\"Obs: Filen kommer att laddas ner i nuvarande katalog och kommer att automatiskt återanvändas om den existerar. Om ingen fil hittas online, kommer standardversionen att användas.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Standard Windowsinstallation\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"avancerade enhetsegenskaper\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"avancerade formatalternativ\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Visa %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Dölj %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Bestående partitionsstorlek\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Ej bestående\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Ställ in den bestående partitionens storlek för live USB-media. Om du ställer in storleken till 0 inaktiveras den bestående partitionen.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Ställ in partitionsstorlekarna.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Visa inte detta meddelande igen\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Viktig information om %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Du har just skapat ett media som använder starthanteraren UEFI:NTFS. Kom i håg att, för att starta från detta media, MÅSTE DU INAKTIVERA 'SECURE BOOT'.\\n\"\n\"För detaljer om varför detta är nödvändigt, tryck på 'Mer information' här nedan.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows avbildsval\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"ISO-filen innehåller mer än en Windows-avbild.\\n\"\n\"Välj den avbild du vill använda för denna installationen:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Ett annat program eller process använder denna enheten Vill du ändå formatera den?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus har upptäckt att du försöker skapa en Windows To Go-media baserad på en 1809 ISO-fil.\\n\"\n\"\\n\"\n\"På grund av ett *FEL AV MICROSOFT* kommer detta media att krascha under uppstarten av Windows (Blåskärm), om du inte manuellt ersätter filen 'WppRecorder.sys' med en från version 1803.\\n\"\n\"\\n\"\n\"Anledningen till att Rufus inte automatiskt kan fixa det här är att \\\"WppRecorder.sys\\\" är en Microsoft-upphovsrättsskyddad fil, så vi kan inte lagligt bädda in en kopia av filen i programmet...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Eftersom MBR har valts för partitionsschema, kan Rufus bara skapa en partition upp till 2 TB på det här mediet, vilket kommer att lämna %s av diskutrymmet otillgänglig.\\n\"\n\"\\n\"\n\"Är det säkert att du vill fortsätta?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Utgåva\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Språk\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Arkitektur\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Fortsätt\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Tillbaka\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Vänta...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Ladda ner med webbläsaren\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Nerladdning av Windows ISO-filer är inte tillgängligt därför att Microsoft har blockerat det.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"PowerShell 3.0 eller senare krävs för att köra detta skriptet.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Vill du ansluta till internet och ladda ner det?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Kör nerladdningsskript...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Ladda ner ISO-avbild\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Typ av dator du planerar att använda den här startbara enheten på. Det är ditt ansvar att avgöra om ditt mål är av typen BIOS eller UEFI innan du börjar skapa enheten, eftersom den kanske inte startar sen.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"\\\"UEFI-CSM\\\" innebär att enheten startar i BIOS-emuleringsläge (kallas också för 'Legacy Mode') under UEFI och inte i nativ UEFI-läge.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"\\\"icke CSM\\\" innebär att enheten startar i nativ UEFI-läge och inte i BIOS-emuleringsläge (kallas också för 'Legacy Mode').\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Testmönster: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Testmönster: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testmönster: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Testmönster: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Ställer in målets filsystem\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Minsta storlek som ett block av data kommer att ta plats i filsystemet\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Använd detta fältet till att ange enhetens namn.\\n\"\n\"Internationella bokstäver är tillåtna.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Visa/dölj avancerat\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Kontrollera enheter om den har trasiga block genom att köra ett testmönster\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Avmarkera om du vill använda \\\"långsam\\\" formateringsmetod\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Metod som kommer att användas för att skapa partitioner\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Metod som kommer att användas för att göra enheten startbar\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Klicka för att välja eller ladda ner avbild...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Markera för att tillåta visa internationella namn och sätta en enhetsikon (en autorun.inf skapas)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Installera en UEFI-starthanterare som kommer att utföra MD5Sum-filvalidering av media\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Skapa en extra gömd partition och prova att justera om partitionsuppbyggnaden.\\n\"\n\"Detta kan förbättra uppstarten för äldre BIOS:ar.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"\"\n\"Lista alla USB-hårddiskar (även icke flyttbara).\\n\"\n\"ANVÄND PÅ EGEN RISK!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Starta formateringen.\\n\"\n\"Detta kommer att ta bort ALL data på målenheten!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Ogiltig nerladdningssignatur\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Tryck för att välja...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Det pålitliga verktyget för USB-formatering\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Svensk översättning: Sopor\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Rapportera fel eller om du har några idéer:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Andra upphovsrätter:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Uppdateringspolicy:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Om du väljer att tillåta detta program att leta efter uppdateringar, tillåter du även att följande information sparas på våra servrar:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Information om ditt operativsystem och version\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Version på programmet du använder\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Din IP-adress\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"För att kunna skapa användningsstatistik, kommer vi att spara informationen, \\\\b i högst ett år\\\\b0 . Vi kommer dock behålla informationen för oss själva.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Uppdateringsprocess:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus installerar inga bakgrundsprogram, därför sker endast uppdateringskontrollen när det körs.\\\\line\\n\"\n\"För att kontrollera efter uppdateringar krävs naturligtvis internettillgång.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Ogiltig avbild för valt startalternativ\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Nuvarande avbild matchar inte det startbara valet. Välj en annan avbild eller ändra de startbara valet.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Denna ISO-avbild är inte kompatibel med valt filsystem\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Enheten är inte kompatibel\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Skrivförsök\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Läsförsök\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Nerladdad %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Kunde inte ladda ner %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Använder den inbyggda versionen av %s fil(er)\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"VIKTIGT: DENNA ENHET ANVÄNDER SIG AV EN ICKE STANDARD SEKTORSTORLEK!\\n\"\n\"\\n\"\n\"Konventionella enheter använder en sektorstorlek på 512-byte men denna enheten använder %d-byte. I de flesta fall innebär detta att du INTE kommer att kunna starta från denna enheten.\\n\"\n\"Rufus kan försöka att skapa en startbar enhet, men det finns inga garantier på att den kommer att fungera.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"En icke standard sektorstorlek upptäckt\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"\\\"Windows To Go\\\" kan endast installeras på en enhet med GPT-partition om det är en FIXERAD enhet. Nuvarande enhet är inte FIXERAD.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Den här funktionen är inte tillgänglig på den här plattformen.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Avbryter - Vänta...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Söker igenom avbild...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Misslyckades att söka igenom avbilden\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Upptäckte en gammal %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Använder avbild: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Fil %s saknas\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Ny volym\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"Hittade %d enhet\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"Hittade %d enheter\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"REDO\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Avbruten\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"MISSLYCKADES\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Startar uppdaterad version...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Kunde inte starta den nya versionen\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Öppnad %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Sparad %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Formaterar: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Skapar filsystem: Uppgift %d/%d klart\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS-Fixup: %d%% klart\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Formaterar (%s) - beräknad tid %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Skriver etikett (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Formaterar (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS-Fixup (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Rensar MBR/PBR/GPT strukturer...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Begära diskåtkomst...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Analyserar nuvarande startsektor...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Stänger nuvarande volym...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Skriver huvudstartsektor...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Skriver partitionsstartsektor...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Kopierar DOS-filer...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Kopierar ISO-filer: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI-startinställningar (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Slutbehandlar, vänta...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Installerar Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Trasiga block: %s %d/%d - %0.2f%% (%d/%d/%d fel)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Trasiga block: Testar med varierande mönster\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Trasiga block: Testar med mönster 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Partitionerar (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Tar bort partitioner (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Signaturen för den hämtade uppdateringen kan inte valideras. Detta kan innebära att ditt system är felaktigt konfigurerat för validering av signaturer eller en indikation på att du laddat ner skadlig kod.\\n\"\n\"\\n\"\n\"Nerladdad fil kommer att tas bort. Kontrollera loggfilen för mer detaljerad information.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Laddar ner: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Kunde inte ladda ner filen.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Kontrollerar efter Rufus uppdateringar...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Uppdateringar: Kunde inte ansluta till internet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Uppdateringar: Har ingen tillgång till versionsdata\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Det finns en ny version av Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Det finns ingen ny version av Rufus\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Programmets registernycklar har tagits bort\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Kunde inte ta bort programmets registernycklar\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s aktiverad\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s inaktiverad\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Storlekskontrollen är\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Hårddiskdetekteringen är\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Tvinga formatera 'large FAT32' är\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun kommer att tas bort vid avslut\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Upptäckte en falsk enhet är\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet-stödet är\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge-stödet är\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Tvinga uppdatering är\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS-kompressionen är\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Skriver avbild: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO-stödet är\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Använd 'RÄTT' storleksenhet är\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Tar bort katalogen '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare diskdetekteringen är\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Dubbla UEFI/BIOS-läget är\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Tillämpar Windows-avbild: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Tillämpar Windows-avbild...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Bevara datum och tid är\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB-felsökning är\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Beräknar kontrollsummor för avbilden: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Beräkna MD5-, SHA1- och SHA256-kontrollsummor för den valda avbilden\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Ändra programspråk\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Avbilden är av typen %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Avbilden du har valt är en \\\"ISOHybrid-avbild\\\". Detta innebär att den kan skrivas i både läge %s (filkopiering) eller i läge %s (disk-avbild).\\n\"\n\"Rufus rekommenderar att läge %s används, så att du alltid har full tillgång till enheten efter att du skrivit till den.\\n\"\n\"Skulle du få problem vid uppstarten, kan du i stället prova skriva avbilden i läge %s.\\n\"\n\"\\n\"\n\"Välj det läge du vill använda för att skriva avbilden:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Skriv i läge %s (Rekommenderas)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Skriv i läge %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Kontrollerar om det finns några motstridiga processer...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Icke startbar\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disk- eller ISO-avbild\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (välj)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Exklusiv låsning av USB-enheten\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Ogiltig signatur\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Den nerladdade körbara filen saknar digital signatur.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Den nerladdade körbara filen är signerad av '%s'.\\n\"\n\"Detta är inte en signatur vi känner igen och detta kan tyda på någon form av skadlig aktivitet...\\n\"\n\"Är du säker på att du vill köra filen?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Nollställer enheten: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Visar även icke flyttbara USB-enheter\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Förhöjda privilegier saknas\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Detta program kräver förhöjda privilegier för att fungera\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Filindexering\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Välj version\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Välj den version av Windows du vill installera:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Denna version stöds inte\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Den här versionen av Windows stöds inte längre av Rufus.\\n\"\n\"Den senaste versionen av Rufus som är kompatibel med den här plattformen är v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Varning: Inofficiell version\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Denna version av Rufus producerades inte av originalutvecklaren.\\n\"\n\"\\n\"\n\"Är du säker på att du vill använda den?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Ej komplett ISO-fil\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"ISO-filen du har valt matchar inte den angivna storleken: %s av data saknas!\\n\"\n\"\\n\"\n\"Om du har hämtat den här filen från internet, prova då med att ladda ner filen igen och verifiera att checksumman MD5 eller SHA stämmer överens med den officiella filen.\\n\"\n\"\\n\"\n\"Tips: Du kan beräkna MD5 eller SHA i Rufus genom att klicka på knappen (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Valideringfel av tidsstämpeln\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus kunde inte validera att tidsstämpeln på den nerladdade uppdateringen är nyare än den gamla.\\n\"\n\"\\n\"\n\"För att förhindra potentiella angreppsscenarier, har uppdateringsprocessen avslutats och den nerladdade filen har tagits bort. Kontrollera loggen för mer information.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Visa programinställningar\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Visa information om programmet\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Visa loggen\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Skapa en skivavbildning av den valda enheten\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Använd det här alternativet om du planerar att installera Windows på en annan disk eller om du vill köra Windows direkt från den här enheten (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Snabbnollställer enheten: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"detta kan ta lång tid\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD-detektering\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Komprimerat arkiv\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"ISO-filen du har valt använder UEFI och är tillräckligt liten för att kunna skrivas som en EFI System Partition (ESP). Att skriva till en ESP istället för att skriva till en generisk datapartition som upptar hela disken, kan vara att föredra för vissa typer av installationer.\\n\"\n\"\\n\"\n\"Välj det läge som du vill använda för att skriva den här avbilden:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Använd %s (i huvudprogramfönstret) för att aktivera.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Extra hash (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Spara till VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Beräkna avbildkontrollsummor\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Flera knappar\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Antal gånger\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"Disk-ID\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Standard trådprioritet: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ignorera startmarkör\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Uppdaterar partitionslayout (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Avbilden du har valt är en ISOHybrid, men den som skapade filen har inte gjort den kompatibelt med ISO/Filkopieringsläge.\\n\"\n\"Därför kommer skrivläget DD-avbild att användas.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Det går inte att öppna eller läsa '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Verkställer Windows-anpassning: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Verkställer användaralternativ...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows användarupplevelse\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Anpassa Windows-installationen?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Ta bort kravet på 4GB+ RAM, Secure Boot och TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Ta bort kravet på ett online Microsoft-konto\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Inaktivera datainsamling (Hoppa över sekretessfrågor)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Förhindra \\\"Windows To Go\\\" från att komma åt interna diskar\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Skapa ett lokalt konto med användarnamn:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Ställ in regionala alternativ till samma värden som denna användares\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Inaktivera BitLockers automatiska enhetskryptering\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Bestående logg\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('%s') must be downloaded from Microsoft to use this feature:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"En fil (%s) måste laddas ner från Microsoft för att använda den här funktionen:\\n\"\n\"- Välj \\\"Ja\\\" för att ansluta till Internet och ladda ner den\\n\"\n\"- Välj \\\"Nej\\\" för att avbryta operationen\\n\"\n\"\\n\"\n\"Obs: Filen kommer att laddas ner i programmets katalog och kommer att återanvändas automatiskt om den finns.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Återkallad UEFI-starthanterare upptäcktes\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus upptäckte att den ISO-filen du har valt innehåller en UEFI-starthanterare som har återkallats och som kommer att producera %s, när \\\"Secure Boot\\\" är aktiverat på ett helt uppdaterat UEFI-system.\\n\"\n\"\\n\"\n\"- Om du skaffade den här ISO-avbilden från en icke ansedd källa bör du överväga möjligheten att den kan innehålla UEFI-skadlig programvara och undvika att starta från den.\\n\"\n\"- Om du har fått det från en pålitlig källa bör du försöka hitta en mer uppdaterad version som inte ger den här varningen.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"en \\\"Säkerhetsöverträdelseskärm\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"en Windows-återställningsskärm (BSOD) med '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Komprimerad VHDX-avbild\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Okomprimerad VHD-avbild\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Full flash uppdateringsavbild\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Ytterligare data måste laddas ner från Microsoft för att kunna använda den här funktionen:\\n\"\n\"- Välj \\\"Ja\\\" för att ansluta till Internet och ladda ner den\\n\"\n\"- Välj \\\"Nej\\\" för att avbryta operationen\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Begränsa Windows till S-läge (INKOMPATIBEL med förbikoppling av onlinekonto)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Expertläge\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Extraherar arkivfiler: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Använd Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus är ett program som hjälper dig formatera och skapa startbara USB-diskar, så som USB-minnen, minneskort, etc.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Officiell webbplats: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Källkod: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Ändringslogg: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Denna applikation är licensierad under villkoren i GNU Public License (GPL) version 3.\\n\"\n\"Se https://www.gnu.org/licenses/gpl-3.0.en.html för mer information.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Uppstart\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Formatera USB-enheter, flash-kort och virtuella enheter till FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Skapa FreeDOS startbara USB-enheter\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Skapa startbara enheter från startbara ISO-filer (Windows, Linux, etc.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Skapa startbara enheter från startbara diskavbildningar, inklusive komprimerade\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Skapa BIOS- eller UEFI-startbara enheter, inklusive UEFI-startbar NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Skapa \\\"Windows To Go\\\"-enheter\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Skapa installationsenheter till Windows 11 för datorer som inte har TPM eller säker start\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Skapa beständiga Linux-partitioner\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Skapa VHD/DD-avbilder av den valda enheten\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Beräkna kontrollsummor MD5, SHA-1, SHA-256 och SHA-512 för den valda avbilden\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Utför kontroll av trasiga block, inklusive upptäckt av \\\"falska\\\" USB-minnen\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Ladda ner officiella Microsoft Windows ISO-filer\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Ladda ner UEFI-skal ISO-filer\"\n"
  },
  {
    "path": "res/loc/po/th-TH.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-04-26 10:51+0700\\n\"\n\"PO-Revision-Date: 2024-04-26 18:32+0700\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: th_TH\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Thai (ไทย)\\n\"\n\"X-Rufus-LCID: 0x041e\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"คุณสมบัติของไดรฟ์\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"อุปกรณ์\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"ตัวเลือกการบูต\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"เลือก\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"ตัวเลือกอิมเมจ\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"รูปแบบของพาร์ติชัน\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"รูปแบบเครื่องเป้าหมาย\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"แสดงรายการ USB Drive\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"เพิ่มการรองรับให้กับ BIOS รุ่นเก่า\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"เปิดใช้งานการตรวจสอบอุปกรณ์ UEFI\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"ตัวเลือกการฟอร์แมต\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"ระบบไฟล์\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"ขนาดของคลัสเตอร์\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"ชื่อของไดรฟ์\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"ฟอร์แมตอย่างรวดเร็ว\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"ตรวจหาข้อบกพร่องของอุปกรณ์\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"ตั้งชื่อไดรฟ์ด้วยอักขระสากล และเพิ่มไอคอนของไดรฟ์\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"สถานะ\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"ปิด\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"เริ่ม\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"เกี่ยวกับ Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"ลิขสิทธิ์\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"ตกลง\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"ลิขสิทธิ์ของ Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"ข้อมูลเพิ่มเติม\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"ใช่\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"ไม่ใช่\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"รายการ Log\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"ล้าง\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"บันทึก\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"นโยบายการอัพเดต และการตั้งค่า\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"ตั้งค่า\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"ตรวจหาการอัพเดต\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"รวมเวอร์ชันทดสอบด้วย\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"ตรวจสอบ\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"ตรวจหาการอัพเดต - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"พบ Rufus รุ่นใหม่กว่า! โปรดอัพเดตโปรแกรมให้เป็นรุ่นล่าสุด!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"คลิกเพื่อเปิดเว็บไซต์\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"สิ่งที่เพิ่มมาใหม่\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"ดาวน์โหลด\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Rufus กำลังถูกเรียกใช้งานอยู่\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"คุณได้เปิด Rufus ไว้ก่อนหน้าแล้ว\\n\"\n\"กรุณาปิดหน้าต่างเก่าก่อนเรียกใช้งาน Rufus อีกครั้งหนึ่ง\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"โปรดระวัง: ข้อมูลทั้งหมดบนอุปกรณ์ '%s' จะถูกลบทิ้งทั้งหมด\\n\"\n\"หากต้องการดำเนินการต่อ โปรดคลิก OK แต่หากต้องการยกเลิก โปรดคลิก Cancel\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"นโยบายการอัพเดตของ Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"คุณต้องการให้ Rufus ตรวจหาการอัพเดตออนไลน์หรือไม่?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"ยกเลิก\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"พบข้อบกพร่อง\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"ตรวจสอบเรียบร้อย: พบ %d จุดบกพร่อง\\n\"\n\"  อ่านบกพร่อง %d จุด\\n\"\n\"  เขียนบกพร่อง %d จุด\\n\"\n\"  จุดเสียหาย %d จุด\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"อ่านรายละเอียดเพิ่มเติมได้ที่:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"ปิดใช้งาน\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"ทุกวัน\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"สัปดาห์ละครั้ง\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"เดือนละครั้ง\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"กำหนดเอง\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"เวอร์ชันของคุณ: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"เวอร์ชันล่าสุด: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"ไบต์\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"กิโลไบต์\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"เมกะไบต์\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"ค่าเริ่มต้น\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (ค่าเริ่มต้น)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (หรือ UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS หรือ UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d รอบ\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d รอบ %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"แอปพลิเคชัน\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"ยกเลิก\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"เปิด\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"การดำเนินการถูกยกเลิกโดยผู้ใช้\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"ความผิดพลาด\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"ผิดพลาด: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"ดาวน์โหลดไฟล์\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"อุปกรณ์ USB\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (ดิสก์ที่ %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"พบหลายพาร์ติชัน\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - กำลังล้างบัฟเฟอร์\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - ยกเลิกการดำเนินการ\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"สำเร็จ\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"พบข้อบกพร่องขณะดำเนินการฟอร์แมต\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"ไม่สามารถใช้ระบบไฟล์ที่เลือกกับอุปกรณ์นี้ได้\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"ไม่สามารถเข้าถึงอุปกรณ์ได้\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"อุปกรณ์นี้มีการป้องกันการเขียน\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"อุปกรณ์นี้กำลังถูกใช้งานโดยโปรแกรมอื่น กรุณาปิดโปรแกรมที่สงสัยว่ากำลังใช้งานอุปกรณ์นี้อยู่\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"อุปกรณ์นี้ไม่สามารถใช้การฟอร์แมตแบบรวดเร็วได้\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"ไม่สามารถใช้ชื่อนี้ตั้งชื่ออุปกรณ์ได้\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"การระบุตัวอุปกรณ์ผิดพลาด\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"ขนาดของคลัสเตอร์ไม่เข้ากับอุปกรณ์\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"ขนาดพื้นที่ของอุปกรณ์ไม่ถูกต้อง\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"กรุณาเชื่อมต่ออุปกรณ์เข้ากับเครื่องคอมพิวเตอร์\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"โปรแกรมได้รับคำสั่งที่ไม่รองรับ\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"การจัดสรรหน่วยความจำผิดพลาด\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"การอ่านผิดพลาด\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"การเขียนผิดพลาด\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"การติดตั้งโปรแกรมผิดพลาด\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"ไม่สามารถเข้าถึงอุปกรณ์ได้ อุปกรณ์นี้อาจกำลังถูกใช้งานโดยโปรแกรมอื่น โปรดถอด และเชื่อมต่ออุปกรณ์ใหม่แล้วลองอีกครั้ง\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"ไม่สามารถแบ่งพาร์ติชันไดรฟ์ได้\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"ไม่สามารถคัดลอกไฟล์ลงไปยังไดรฟ์ได้\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"ยกเลิกโดยผู้ใช้\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"ไม่สามารถเริ่มต้นเธรดการทำงานได้\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"การตรวจสอบจุดบกพร่องของไดรฟ์ไม่แล้วเสร็จ\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"การตรวจสอบอิมเมจ ISO ผิดพลาด\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"การแตกไฟล์อิมเมจ ISO ผิดพลาด\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"ไม่สามารถเชื่อมต่อ Volumn ได้\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"ไม่สามารถติดตั้งไฟล์แพทช์สำหรับบูตได้\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"ตั้งอักษรประจำไดรฟ์ไม่ได้\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"ไม่สามารถเชื่อมต่อ GUID volume ได้\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"อุปกรณ์ไม่พร้อมใช้งาน\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus พบว่าขณะนี้ Windows กำลังดำเนินการเขียนไฟล์ลงบนอุปกรณ์ USB\\n\"\n\"\\n\"\n\"ความเร็วขึ้นอยู่กับ USB ของคุณ ดังนั้นการดำเนินการนี้อาจใช้เวลานานโดยเฉพาะอย่างยิ่งกับไฟล์ที่มีขนาดใหญ่มากๆ\\n\"\n\"\\n\"\n\"เราแนะนำให้คุณรอให้การดำเนินการเสร็จสิ้นเพื่อป้องกันไฟล์เสียหาย อย่างไรก็ตาม หากคุณไม่ต้องการรอก็สามารถดึงอุปกรณ์ออกไปได้เลย...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"ไม่รองรับอิมเมจไฟล์นี้\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"อิมเมจไฟล์นี้ไม่สามารถบูตได้ หรืออาจจะมีการใช้วิธีการบูตอื่นๆ ที่ Rufus ไม่รองรับ\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"แทนที่ %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"ไฟล์ ISO นี้อาจมีการใช้เวอร์ชันที่ล้าสมัยของ '%s'\\n\"\n\"ซึ่งอาจทำให้เมนูการบูตไม่สามารถแสดงผลได้ถูกต้อง\\n\"\n\"\\n\"\n\"Rufus สามารถดาวน์โหลดเวอร์ชันที่ใหม่กว่าให้คุณได้:\\n\"\n\"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n\"\n\"- เลือก 'No' เพื่อใช้อิมเมจไฟล์อันเดิม\\n\"\n\"หากไม่รู้จะเลือกวิธีใด ให้เลือก 'Yes'\\n\"\n\"\\n\"\n\"หมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"กำลังดาวน์โหลด %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"ยังไม่ได้เลือกอิมเมจไฟล์\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"สำหรับ %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"อิมเมจไฟล์มีขนาดใหญ่เกินไป\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"อิมเมจไฟล์มีขนาดใหญ่กว่าอุปกรณ์\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"ไม่รองรับไฟล์ ISO นี้\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"เมื่อเลือกใช้รูปแบบ UEFI อิมเมจไฟล์ที่รองรับจะต้องเป็นแบบ EFI ด้วย กรุณาเลือก ISO ที่รองรับ EFI หรือเปลี่ยนรูปแบบเป็น BIOS แทน\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"ไม่รองรับระบบไฟล์นี้\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"คำเตือน:ไดรฟ์นี้มีหลายพาร์ติชัน!!\\n\"\n\"\\n\"\n\"ซึ่งอาจรวมไปถึงพาร์ติชันที่ไม่สามารถมองเห็นได้บน Windows หากดำเนินการต่อ ข้อมูลบนพาร์ติชันดังกล่าวจะหายไปอย่างถาวร\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"พบหลายพาร์ติชัน\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"ระบบไฟล์ที่เลือกปัจจุบันไม่สามารถใช้ได้กับ ISO รูปแบบนี้ กรุณาเลือกระบบไฟล์หรือ ISO ใหม่ที่ต่างไปจากเดิม\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' สามารถใช้ได้เฉพาะกับระบบไฟล์ NTFS เท่านั้น\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"คำเตือน: คุณกำลังเลือกติดตั้ง 'Windows To Go' แต่อุปกรณ์ของคุณไม่มีค่า attribute เป็น 'FIXED' ดังนั้น Windows อาจจะค้างขณะทำการบูตได้ เพราะ Microsoft ไม่ได้ออกแบบระบบให้ทำงานบนอุปกรณ์แบบถอดได้ (ค่า attribute เป็น 'REMOVABLE')\\n\"\n\"\\n\"\n\"คุณต้องการดำเนินการต่อหรือไม่?\\n\"\n\"\\n\"\n\"หมายเหตุ: แอททริบิวต์แบบ 'FIXED/REMOVABLE' เป็นคุณสมบัติเฉพาะของอุปกรณ์ และสามารถถูกแก้ไขได้โดยเครื่องมือที่สร้างโดยผู้ผลิตเท่านั้น ซึ่งหาได้ยากมาก และไม่ถูกปล่อยให้ใช้งานโดยทั่วไป...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"ข้อจำกัดของแต่ละระบบไฟล์\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"ไฟล์ ISO นี้ประกอบไปด้วยไฟล์ที่มีขนาดใหญ่กว่า 4 GB ซึ่งมากกว่าขนาดสูงสุดที่ระบบไฟล์แบบ FAT หรือ FAT32 จะรองรับได้\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"ไม่รองรับรูปแบบ WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"ระบบปฏิบัติการของคุณไม่สามารถแตกไฟล์แบบ WIM ได้ โดยไฟล์ WIM จำเป็นที่ต้องใช้ในการสร้าง Windows 7 ให้บูตได้แบบ EFI และ Windows Vista บน USB ซึ่งแก้ไขได้โดยการติดตั้ง 7-Zip เวอร์ชันล่าสุด\\n\"\n\"ต้องการเปิดหน้าดาวน์โหลด 7-zip หรือไม่?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"ดาวน์โหลด %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s หรือใหม่กว่า จำเป็นต้องมี '%s' ติดตั้งไว้\\n\"\n\"เนื่องจากไฟล์นี้มีขนาดใหญ่กว่า 100 KB และพบเจอได้ใน ISO: %s ซึ่งไม่ได้รวมไว้ในโปรแกรม Rufus\\n\"\n\"\\n\"\n\"Rufus สามารถดาวน์โหลดไฟล์ดังกล่าวให้คุณได้:\\n\"\n\"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n\"\n\"- เลือก 'No' คุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\\n\"\n\"\\n\"\n\"หมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"การยกเลิกอาจทำให้อุปกรณ์ไม่สามารถใช้การได้ !\\n\"\n\"หากคุณยืนยันที่จะยกเลิก คลิกที่ปุ่ม ใช่\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"กรุณาเลือกโฟลเดอร์\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"ไฟล์ทั้งหมด\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (ดิสก์ที่ %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS ไม่สามารถบูตจากไดรฟ์ที่ใช้ขนาดของคลัสเตอร์ 64 kilobytes ได้\\n\"\n\"โปรดเปลี่ยนขนาดของคลัสเตอร์ หรือเลือกใช้ FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"ไม่รองรับขนาดของคลัสเตอร์นี้\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"การฟอร์แมต UDF volume ขนาดใหญ่อาจใช้เวลานาน โดยความเร็วการฟอร์แมต USB 2.0 โดยประมาณคือ %d:%02d ซึ่งในระหว่างการฟอร์แมตแถบแสดงความคืบหน้าอาจหยุดนิ่ง โปรดรอ!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"UDF volume ขนาดใหญ่\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"อิมเมจนี้ใช้ Syslinux %s%s แต่โปรแกรมนี้มีเฉพาะไฟล์ติดตั้งของ Syslinux %s%s \\n\"\n\"\\n\"\n\"โดยเวอร์ชันใหม่ของ Syslinux อาจไม่รองรับกับรุ่นที่ต่างกันไปไฟล์จำนวน 2 ไฟล์ต่อไปนี้จะถูกดาวน์โหลดจากอินเทอร์เน็ต ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n\"\n\"- เลือก 'No' เมื่อคุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\\n\"\n\"\\n\"\n\"หมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และไฟล์ จะถูกเลือกใช้โดยอัตโนมัติ\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"จำเป็นต้องดาวน์โหลดไฟล์\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"อิมเมจนี้ใช้ Grub %s แต่โปรแกรมนี้มีเฉพาะไฟล์ติดตั้งของ Grub %s \\n\"\n\"\\n\"\n\"โดยเวอร์ชันใหม่ของ Grub อาจไม่รองรับกับรุ่นที่ต่างกันไป Rufus สามารถค้นหาอิมเมจของ Grub เวอร์ชันล่าสุด ('core.img') ที่เข้ากันได้กับอิมเมจไฟล์ที่คุณเลือก:\\n\"\n\"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n\"\n\"- เลือก 'No' เพื่อใช้เวอร์ชันปัจจุบันที่ติดมากับ Rufus\\n\"\n\"-เลือก 'Cancel' เพื่อยกเลิกการดำเนินการนี้\\n\"\n\"\\n\"\n\"หมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และไฟล์จะถูกเลือกใช้โดยอัตโนมัติหากไม่พบไฟล์ที่ใหม่กว่า ไฟล์เวอร์ชันปัจจุบันจะถูกใช้แทน\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"ตัวติดตั้ง Windows มาตรฐาน\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"คุณสมบัติไดรฟ์ขั้นสูง\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"คุณสมบัติการฟอร์แมตขั้นสูง\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"แสดง %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"ซ่อน %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"ขนาดของ Persistent partition\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"ไม่มี Persistent\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"ตั้งค่าขนาดของพาร์ติชันสำหรับ Live USB media (ตั้งขนาดเป็น 0 เพื่อปิดการทำงานของ persistent partition)\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"ตั้งขนาดของ Persistent partition\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"อย่าแสดงข้อความนี้อีก\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"ประกาศสำคัญเกี่ยวกับ %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"คุณพึ่งจะสร้างมีเดียที่ใช้ UEFI:NTFS bootloader โปรดจำไว้ว่า ถ้าคุณต้องการจะบูตมีเดียนี้ คุณต้องปิด Secure Boot ก่อน\\n\"\n\"สำหรับคำอธิบายว่าทำไมนี่จึงจำเป็นต้องทำ ให้เข้าไปคลิกที่ปุ่ม 'ข้อมูลเพิ่มเติม' ข้างล่าง\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"เลือกไฟล์อิมเมจ Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"ไฟล์ ISO นี้มีไฟล์อิมเมจ Windows อยู่หลายอิมเมจ\\n\"\n\"โปรดเลือกอิมเมจที่คุณต้องการใช้ในการติดตั้งครั้งนี้:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"ไดรฟ์นี้กำลังถูกใช้งานอยู่ คุณต้องการฟอร์แมตไดรฟ์นี้หรือไม่\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus ตรวจพบว่าคุณกำลังสร้าง Windows To Go จากไฟล์ ISO เวอร์ชัน 1809\\n\"\n\"\\n\"\n\"เพราะว่า *บั๊กจากทาง Microsoft* จึงทำให้ media นี้อาจจะขึ้นหน้าจอฟ้า (BSOD) ในระหว่างการบูตเข้า Windowsได้ นอกจากว่าคุณจะเปลี่ยนไฟล์ 'WppRecorder.sys' กลับไปเป็นของเวอร์ชัน 1803\\n\"\n\"\\n\"\n\"Rufus ไม่สามารถแก้ไขปัญหานี้โดยอัตโนมัติได้ เนื่องจาก ไฟล์ 'WppRecorder.sys' เป็นลิขสิทธิ์ของ Microsoft ทางเราจึงไม่สามารถใส่สำเนาของไฟล์นี้ลงมาในแอปพลิเคชันนี้ได้อย่างถูกกฎหมาย...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"เนื่องจากพาร์ติชันถูกเซ็ตเป็น MBR และ Rufus สามารถสร้างพาร์ติชันได้มากที่สุดเพียง 2 TB ซึ่งจะเหลือพื้นที่ว่าง %s\\n\"\n\"\\n\"\n\"คุณแน่ใจว่าจะทำต่อหรือไม่\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"ระบบปฏิบัติการ\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"เวอร์ชัน\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"รุ่น\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"ภาษา\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"สถาปัตยกรรม\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"ทำต่อ\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"กลับไป\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"รอสักครู่...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"ดาวน์โหลดโดยใช้เบราว์เซอร์\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"ไม่สามารถดาวน์โหลดไฟล์ Windows ได้ เนื่องจาก Microsoft ได้ทำการปรับเว็บไซต์เพื่อป้องกันเอาไว้ - โปรดลองใหม่ในภายหลัง...\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"ต้องใช้ PowerShell 3.0 หรือใหม่กว่านั้นในการรันสคริปต์นี้\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"คุณต้องการเชื่อมต่อออนไลน์ แล้วดาวน์โหลดหรือไม่\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"กำลังเรียกใช้สคริปต์ดาวน์โหลด...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"ดาวน์โหลดอิมเมจ ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"รูปแบบของเครื่องคอมพิวเตอร์ที่คุณจะนำไดรฟ์บูตไปใช้ ซึ่งคุณจะต้องทราบว่าเครื่องเป้าหมายมีรูปแบบการบูตเป็นแบบ BIOS หรือ UEFI หากเลือกผิดรูปแบบจะส่งผลให้ไม่สามารถบูตด้วยไดรฟ์นี้ได้\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' หมายถึงอุปกรณ์คุณจะสามารถบูตในโหมด BIOS emulation (Legacy Mode) ภายใต้ระบบ UEFI โดยต้องไม่ใช่แบบ Native UEFI\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'non CSM' หมายถึงอุปกรณ์คุณจะสามารถบูตในโหมด Native UEFI โดยที่ไม่ใช่ BIOS emulation หรือ Legacy Mode\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"รูปแบบการทดสอบ: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"รูปแบบการทดสอบ: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"รูปแบบการทดสอบ: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"รูปแบบการทดสอบ: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"เลือกระบบไฟล์\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"ขนาดที่เก็บข้อมูลที่น้อยที่สุดต่อไฟล์ที่ระบบไฟล์จะจัดสรรให้\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"กรอกชื่อไดรฟ์แบบกำหนดเองในช่องนี้ ตัวอักษรสากลสามารถใช้ได้\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"เปิด/ปิดตัวเลือกขั้นสูง\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"ตรวจสอบข้อบกพร่องของอุปกรณ์โดยใช้รูปแบบการทดสอบต่างๆ\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"ไม่ต้องเลือกตัวเลือกนี้หากต้องการฟอร์แมตแบบ \\\"ช้า\\\"\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"ระบบพาร์ติชันที่จะสร้าง\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"วิธีการทำไดรฟ์บูต\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"คลิกเพื่อเลือก หรือดาวน์โหลดอิมเมจไฟล์...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"เลือกตัวเลือกนี้เพื่อสร้างไฟล์ autorun.inf สำหรับตั้งชื่อไดรฟ์ด้วยอักขระสากล และเพิ่มไอคอนกราฟฟิคให้กับไดรฟ์\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"ติดตั้ง UEFI bootloader ซึ่งจะมีการตรวจสอบมีเดียด้วย MD5Sum\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"สร้างพาร์ติชันเพิ่มเติม และพยายามจัดพาร์ติชัน\\n\"\n\"วิธีนี้จะช่วยให้ BIOS รุ่นเก่าสามารถตรวจพบอุปกรณ์ได้ดีขึ้น\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"เปิดให้แสดงรายชื่อ USB Hard Drive ทั้งหมด (มีความเสี่ยง โปรดระมัดระวัง!!!)\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"กำลังเริ่มต้นฟอร์แมต\\n\"\n\"ข้อมูลทั้งหมดบนอุปกรณ์ที่เลือกจะถูกลบทิ้ง\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"ใบรับรองดิจิทัลของการดาวน์โหลดไม่ถูกต้อง\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"คลิกเพื่อเลือกไฟล์อิมเมจ...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - ยูทิลิตี้การฟอร์แมต USB ที่ไว้ใจได้\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"เวอร์ชัน %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"\"\n\"แปลไทยโดย:\\\\line\\n\"\n\"• Sippapas Wangsri <mailto:sippapas_w@cmu.ac.th>\\\\line\\n\"\n\"• Suttirak Mattayawerakiat <mailto:raksuttirak2@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"รายงานข้อบกพร่อง หรือแนะนำข้อเสนอแนะได้ที่:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"ลิขสิทธิ์เพิ่มเติม:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"นโยบายการอัพเดต:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"เมื่อคุณอนุญาตให้โปรแกรมตรวจหาอัพเดต ถือว่าคุณยอมรับว่าข้อมูลต่อไปนี้จะถูกส่งให้แก่เซิร์ฟเวอร์:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"สถาปัตยกรรมและเวอร์ชันของระบบปฏิบัติการของคุณ\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"เวอร์ชันของโปรแกรมที่คุณใช้\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"IP address ของคุณ\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"เพื่อจุดประสงค์ในการจัดทำสถิติ เราอาจเก็บข้อมูลดังกล่าว \\\\b ไว้เป็นระยะเวลาหนึ่ง\\\\b0 อย่างไรก็ตาม เราไม่มีนโยบายในการเปิดเผยข้อมูลของท่านให้แก่บุคคลที่สาม\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"กระบวนการการอัพเดต:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus ไม่ได้ติดตั้ง service ที่ทำงานในพื้นหลัง ดังนั้นการตรวจสอบอัพเดตจะเกิดขึ้นก็ต่อเมื่อมีการเปิดโปรแกรมเท่านั้น\\\\line\\n\"\n\"การเชื่อมต่ออินเทอร์เน็ตมีความจำเป็นที่จะทำการอัพเดต\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"อิมเมจสำหรับตัวเลือกการบูตไม่ถูกต้อง\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"อิมเมจปัจจุบันไม่ตรงกับตัวเลือกการบูตที่เลือก กรุณาเลือกอิมเมจหรือตัวเลือกการบูตใหม่\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"ไฟล์ ISO นี้ไม่รองรับกับระบบไฟล์ที่เลือก\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"ตรวจพบไดรฟ์ที่ไม่รองรับ\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"การเขียนรอบที่\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"การอ่านรอบที่\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"ดาวน์โหลด %s แล้ว\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"ไม่สามารถดาวน์โหลด %s ได้\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"กำลังใช้ไฟล์ที่ติดมาของ %s ไฟล์\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"สำคัญมาก: อุปกรณ์นี้ใช้ขนาดของเซคเตอร์ที่ไม่เป็นมาตรฐาน!!\\n\"\n\"\\n\"\n\"โดยทั่วไปไดรฟ์จะใช้ขนาดของเซคเตอร์เป็น 512 ไบต์ แต่อุปกรณ์นี้เป็น %d ไบต์หมายความว่าคุณจะไม่สามารถบูตจากอุปกรณ์นี้ได้\\n\"\n\"อย่างไรก็ตาม เราสามารถทดลองสร้างไดรฟ์ดังกล่าว แต่ไม่รับรองได้ว่าอุปกรณ์นั้นจะสามารถทำงานได้อย่างที่ควรเป็น\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"พบไดรฟ์ที่มีขนาดของเซคเตอร์ไม่เป็นมาตรฐาน\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' สามารถติดตั้งลงบนพาร์ติชันแบบ GPT เท่านั้นหากมีแอททริบิทต์แบบ FIXED แต่ไดรฟ์ปัจจุบันพบว่าไม่มีแอททริบิวต์แบบ FIXED\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"ฟีเจอร์นี้ไม่พร้อมใช้งานบนแพลตฟอร์มนี้\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"กำลังยกเลิก - โปรดรอสักครู่...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"กำลังสแกนอิมเมจ...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"การสแกนอิมเมจผิดพลาด\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"พบไฟล์ %s ที่ล้าสมัย\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"กำลังเรียกใช้อิมเมจ: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"ไม่พบไฟล์ %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Volume ใหม่\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"พบ %d อุปกรณ์\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"พบ %d อุปกรณ์\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"พร้อมทำงาน\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"ยกเลิกแล้ว\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"เกิดข้อผิดพลาด\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"กำลังเปิดแอปพลิเคชัน...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"ไม่สามารถเปิดแอปพลิเคชันได้\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"เปิด %s แล้ว\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"บันทึก %s แล้ว\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"กำลังฟอร์แมต: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"กำลังสร้างระบบไฟล์: แล้วเสร็จ %d จาก %d\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"ตรวจสอบระบบ NTFS: %d%%\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"กำลังฟอร์แมต (%s) - เวลาคงเหลือ %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"กำลังตั้งชื่อไดรฟ์ (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"กำลังฟอร์แมต (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"ตรวจสอบระบบ NTFS (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"กำลังจัดการโครงสร้าง MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"กำลังเข้าถึงดิสก์...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"กำลังวิเคราะห์ Boot Record...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"กำลังปิด volume ปัจจุบัน...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"กำลังเขียนระบบ Master Boot Record...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"กำลังเขียนระบบ Partition Boot Record...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"กำลังคัดลอกไฟล์ DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"กำลังคัดลอกไฟล์ ISO: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"ตั้งค่าการบูตระบบ Windows 7 EFI (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"กำลังทำให้เสร็จสมบูรณ์...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"กำลังติดตั้ง Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"พบข้อบกพร่อง: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"พบข้อบกพร่อง: กำลังทดสอบโดยรูปแบบแบบสุ่ม\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"พบข้อบกพร่อง: กำลังทดสอบโดยรูปแบบ 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"กำลังแบ่งพาร์ติชัน (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"กำลังลบพาร์ติชัน (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"ไม่สามารถตรวจความถูกต้องของไฟล์ที่ดาวน์โหลดมาได้ กรณีนี้อาจหมายถึงการตั้งค่าเครื่องของคุณผิดพลาดหรืออาจดาวน์โหลดไฟล์ที่เป็นอันตราย\\n\"\n\"\\n\"\n\"ไฟล์ที่ดาวน์โหลดมาจะถูกลบทิ้ง กรุณาตรวจสอบ log file สำหรับข้อมูลเพิ่มเติม\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"กำลังดาวน์โหลด: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"ไม่สามารถดาวน์โหลดไฟล์ได้\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"กำลังตรวจหาการอัพเดต Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"การอัพเดต: ไม่สามารถเชื่อมต่ออินเทอร์เน็ต\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"การอัพเดต: ไม่สามารถหาเวอร์ชันปัจจุบันได้\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"พบ Rufus เวอร์ชันใหม่!!!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"ไม่พบ Rufus เวอร์ชันที่ใหม่กว่า\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Registry keys ของแอปพลิเคชันถูกลบแล้ว\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"ไม่สามารถลบ Registry Keys ของแอปพลิเคชันได้\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"เปิดใช้งาน %s แล้ว\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"ปิดใช้งาน %s แล้ว\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"ตรวจสอบขนาด\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"การตรวจหาฮาร์ดดิสก์\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"การบังคับให้ฟอร์แมตเป็น FAT32 ขนาดใหญ่\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun จะถูกลบเมื่อปิดโปรแกรม\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"การตรวจสอบไดรฟ์ปลอม\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"การรองรับ Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"การรองรับ Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"การบังคับการอัพเดต\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"การบีบอัด NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"กำลังเขียนอิมเมจไฟล์: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"การรองรับไฟล์ ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"ใช้หน่วยของขนาดตามจริง (เช่น 1KB คือ 1024 bytes)\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"กำลังลบไดเรคทอรี่ '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"การตรวจหาดิสก์ VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"ระบบบูตคู่ UEFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"กำลังใช้อิมเมจ Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"กำลังใช้อิมเมจ Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"เก็บบันทึกเวลา\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"ดีบัก USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"กำลังตรวจสอบความถูกต้องของอิมเมจ: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"คำนวณความถูกต้องของอิมเมจด้วย MD5, SHA1 และ SHA256 checksums\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"เปลี่ยนภาษา\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"พบอิมเมจแบบ %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"อิมเมจที่คุณเลือกเป็นแบบ 'ISOHybrid' ดังนั้นจึงสามารถเขียนได้ทั้งในโหมด %s (ใช้การคัดลอกไฟล์) หรือโหมด %s (ใช้ดิสก์อิมเมจ)\\n\"\n\"เราแนะนำให้ใช้โหมด %s เพราะจะทำให้คุณยังสามารถได้สิทธิ์เต็มในการเข้าถึงไดรฟ์หลังจากเขียนเสร็จแล้ว\\n\"\n\"อย่างไรก็ตาม หากคุณพบปัญหาขณะบูต คุณสามารถลองเขียนอิมเมจนี้ใหม่อีกครั้งในโหมด %s แทน\\n\"\n\"\\n\"\n\"กรุณาเลือกรูปแบบที่คุณต้องใช้ในการเขียนอิมเมจนี้:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"เขียนในโหมด %s (แนะนำ)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"เขียนในโหมด %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"กำลังตรวจหา Process ที่ขัดแย้งกัน...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"แบบบูตไม่ได้\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"อิมเมจไฟล์\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (กรุณาเลือก)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"การล็อค Exclusive USB Drive\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"ใบรับรองผิดพลาด\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"ไฟล์ที่ดาวน์โหลดมาไม่มีใบรับรองดิจิทัล\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"ไฟล์ที่ดาวน์โหลดมาถูกรับรองโดย '%s'.\\n\"\n\"ซึ่งไม่ใช่การรับรองที่เรารู้จัก ซึ่งอาจจะเป็นการโจมตีได้...\\n\"\n\"คุณต้องการจะเปิดไฟล์นี้หรือไม่?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"กำลังล้างไดร์ฟด้วย zero byte: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"กำลังตรวจสอบไดรฟ์ที่ไม่ใช่ USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"ไม่มีสิทธิ์อนุญาตระดับสูง\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"แอปพลิเคชันนี้สามารถใช้งานได้เฉพาะการรันด้วยสิทธิ์อนุญาตระดับสูงเท่านั้น\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"ดรรชนีแฟ้มข้อมูล\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"การเลือกเวอร์ชัน\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"กรุณาเลือกเวอร์ชันของ Windows ที่ต้องการติดตั้ง:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"ไม่รองรับ Windows เวอร์ชันนี้\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"เวอร์ชันของ Windows นี้ไม่ได้รับการสนับสนุนโดย Rufus อีกต่อไป\\n\"\n\"Rufus เวอร์ชันล่าสุดที่เข้ากันได้กับแพลตฟอร์มนี้คือ v%d.%d\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"คำเตือน: เวอร์ชันที่ไม่เป็นทางการ\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Rufus เวอร์ชันนี้ ไม่ได้ถูกพัฒนาขึ้นโดยผู้พัฒนาหลัก\\n\"\n\"\\n\"\n\"คุณต้องการเริ่มโปรแกรมหรือไม่?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"พบไฟล์ ISO ที่ถูกตัดทอน\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"ไฟล์ ISO ที่คุณเลือกมีคุณสมบัติไม่ตรงกับที่ได้แจ้งไว้ ดังนี้ ขนาดไฟล์: ข้อมูลจำนวน %s ตัวได้หายไปจากต้นฉบับ!\\n\"\n\"\\n\"\n\"หากคุณดาวน์โหลดไฟล์นี้มาจากอินเทอร์เน็ต กรุณาดาวน์โหลดไฟล์อีกครั้ง และตรวจสอบว่าไฟล์นั้นมี MD5 หรือ SHA checksums ตรงกับเวอร์ชันทางการ\\n\"\n\"\\n\"\n\"โปรดจำไว้ว่าคุณสามารถตรวจสอบ checksum ของไฟล์ดังกล่าวได้จากโปรแกรม Rufus โดยกดปุ่ม (✓)\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"การตรวจสอบบันทึกเวลาผิดพลาด\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus ไม่สามารถยืนยันความถูกต้องของบันทึกเวลาของการอัพเดตที่เพิ่งดาวน์โหลดมาว่าใหม่กว่าเวอร์ชันที่กำลังใช้อยู่ในปัจจุบันหรือไม่\\n\"\n\"\\n\"\n\"เพื่อป้องกันความเป็นไปได้ว่านี่อาจจะเป็นการโจมตี การอัพเดตนี้จะถูกยกเลิก และลบทิ้งไป กรุณาดู Log เพื่ออ่านรายละเอียดเพิ่มเติม\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"แสดงการตั้งค่าของโปรแกรม\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"แสดงรายละเอียดของโปรแกรมนี้\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"แสดง Log\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"สร้างดิสก์อิมเมจของอุปกรณ์ที่เลือก\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"เลือกตัวเลือกนี้หากต้องการติดตั้ง Windows บนดิสก์อื่น หรือใช้งาน Windows จากไดรฟ์นี้โดยตรง (Windows To Go)\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"กำลังล้างไดรฟ์แบบรวดเร็ว: สำเร็จแล้ว: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"อาจใช้เวลาสักครู่\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"การตรวจหา VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"ไฟล์บีบอัด\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"ไฟล์ ISO ที่คุณเลือกใช้เป็นระบบ UEFI และมีขนาดเล็กพอที่จะเขียนเป็น EFI System Partition (ESP) การเขียนเป็น ESP แทนที่จะเป็นการเขียนเป็นพาร์ติชันแบบทั่วไปซึ่งจะใช้พื่นที่ข้อมูลไปทั้งหมด จะดีกว่าสำหรับการติดตั้งบางประเภท\\n\"\n\"\\n\"\n\"โปรดเลือกโหมดที่คุณต้องการใช้ในการเขียนอิมเมจไฟล์นี้:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"ใช้ %s (ในหน้าต่างโปรแกรมหลัก) เพื่อเปิดการใช้งาน\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"การแฮชเพิ่มเติม (SHA-512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"บันทึกลง VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"ตรวจสอบความถูกต้องของอิมเมจ\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"ปุ่มตั้งค่า และเพิ่มเติม\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"จำนวนรอบที่ผ่าน\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID ของดิสก์\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"ค่าลำดับความสำคัญเริ่มต้นของเธรด: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"ละเว้นการทำ Boot Marker\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"กำลังรีเฟรชเค้าโครงพาร์ติชัน (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"อิมเมจไฟล์ที่คุณใช้เป็นแบบ ISOHybrid แต่ผู้ผลิตไม่ได้ทำให้รองรับกับการคัดลอกไฟล์ ISO\\n\"\n\"นั่นทำให้โหมดการเขียนแบบ DD image writing จะถูกเรียกใช้งาน\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"ไม่สามารถเปิดหรืออ่าน '%s' ได้\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"ปรับใช้งานการปรับแต่งขั้นตอนการติดตั้ง Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"ปรับใช้งานการตั้งค่าของผู้ใช้...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"โปรแกรมประสบการณ์ผู้ใช้งาน Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"ต้องการปรับแต่งขั้นตอนการติดตั้ง Windows หรือไม่?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"ยกเลิกการตรวจสอบ: แรมขนาด 4 GB ขึ้นไป, Secure Boot และ TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"ยกเลิกการบังคับใช้บัญชี Microsoft\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"ยกเลิกการเก็บข้อมูลผู้ใช้ (ข้ามคำถามเกี่ยวกับความเป็นส่วนตัว)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"ป้องกันไม่ให้ Windows To Go เข้าถึงข้อมูลดิสก์ภายใน\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"สร้างบัญชีผู้ใช้ด้วยชื่อผู้ใช้:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"ตั้งค่าภูมิภาคให้ตรงกับค่าที่ใช้บนคอมพิวเตอร์เครื่องนี้\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"ยกเลิกการใช้ BitLocker เข้ารหัสอุปกรณ์อัตโนมัติ\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Log แบบถาวร\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"มีความจำเป็นต้องดาวน์โหลดไฟล์ ('diskcopy.dll') จาก Microsoft เพื่อติดตั้ง MS-DOS:\\n\"\n\"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n\"\n\"- เลือก 'No' เพื่อยกเลิก\\n\"\n\"\\n\"\n\"หมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"ตรวจพบ UEFI bootloader ที่ถูกเพิกถอน\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus ตรวจพบว่าไฟล์ ISO ที่คุณเลือกมี UEFI bootloader ที่ถูกเพิกถอน ซึ่งตุณอาจจะเจอกับ%s เมื่อ SecureBoot เปิดใช้งานบนระบบ UEFI ที่ทันสมัย\\n\"\n\"\\n\"\n\"- ถ้าคุณได้ไฟล์ ISO นี้มาจากแหล่งที่ไม่น่าเชื่อถือ คุณควรตระหนักถึงความเป็นไปได้ที่ไฟล์ดังกล่าวอาจมี UEFI malware และหลีกเลี่ยงการบูตจากอิมเมจดังกล่าว\\n\"\n\"- ถ้าคุณได้ไฟล์ ISO นี้มาจากแหล่งที่เชื่อถือได้ คุณควรพยายามค้นหาเวอร์ชันที่ทันสมัยกว่านี้ ซึ่งจะไม่ทำให้เกิดคำเตือนนี้\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"หน้าจอ \\\"Security Violation\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"หน้าจอ Windows Recovery (จอฟ้า; BSOD) พร้อมกับ '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"อิมเมจ VHDX ที่ถูกบีบอัด\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"อิมเมจ VHDX ที่ไม่บีบอัด\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"มีความจำเป็นต้องดาวน์โหลดข้อมูลเพิ่มเติมจาก Microsoft เพื่อใช้งานฟังก์ชั่นนี้:\\n\"\n\"- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n\"\n\"- เลือก 'No' เพื่อยกเลิก\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"จำกัด Windows ให้อยู่ใน S-Mode (ไม่รองรับการยกเลิกการบังคับใช้บัญชี Microsoft)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"โหมดผู้เชี่ยวชาญ\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"กำลังแตกไฟล์: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus คือ โปรแกรมที่ช่วยฟอร์แมต และสร้างไดรฟ์บูต USB จาก USB keys, pendrives, memory sticks เป็นต้น\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"เว็บไซต์ทางการ: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"ซอร์สโค้ด: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"บันทึกการเปลี่ยนแปลง: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"แอปพลิเคชันนี้ได้รับอนุญาตภายใต้เงื่อนไขของ GNU Public License (GPL) เวอร์ชัน 3\\n\"\n\"ดูรายละเอียดได้ที่ https://www.gnu.org/licenses/gpl-3.0.html\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"ฟอร์แมต USB, แฟลชการ์ด หรือไดรฟ์เสมือน ให้อยู่ในรูปแบบของ FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"สร้าง USB ไดรฟ์บูตสำหรับระบบ FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"สร้าง USB ไดรฟ์บูตจากไฟล์ ISO ที่บูตได้ (เช่น ไฟล์ติดตั้ง Windows หรือ Linux เป็นต้น)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"สร้างไดรฟ์บูตจากดิสก์อิมเมจที่บูตได้ (รองรับไฟล์ดิสก์อิมเมจที่ถูกบีบอัด)\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"สร้างไดรฟ์บูตสำหรับระบบ BIOS หรือ UEFI และ UEFI bootable NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"สร้างไดรฟ์ของ 'Windows To Go'\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"สร้างไดรฟ์ติดตั้ง Windows 11 สำหรับคอมพิวเตอร์ที่ไม่มี TPM หรือ Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"สร้าง Linux partition แบบ persistent\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"สร้างอิมเมจไฟล์แบบ VHD/DD จากไดรฟ์ที่เลือก\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"คำนวณรหัส MD5, SHA-1, SHA-256, SHA-512 ของไฟล์อิมเมจที่เลือก\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"ตรวจสอบจุดบกพร่อง รวมไปถึงการทดสอบแฟลชไดรฟ์ว่าเป็น \\\"ของปลอม\\\" หรือไม่\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"ดาวน์โหลดไฟล์ ISO ของ Microsoft Windows จากเว็บไซต์ทางการของ Microsoft\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"ดาวน์โหลดไฟล์ ISO ของ UEFI Shell\"\n"
  },
  {
    "path": "res/loc/po/tr-TR.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-04-28 09:05+0300\\n\"\n\"PO-Revision-Date: 2024-04-28 09:32+0300\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: tr_TR\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Turkish (Türkçe)\\n\"\n\"X-Rufus-LCID: 0x041F\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Sürücü Özellikleri\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Aygıt\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Önyükleme seçimi\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Seç\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Yansı Seçeneği\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Disk bölüm düzeni\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Hedef sistem\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"USB Sabit Sürücüleri Listele\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Eski BIOSlar için düzeltme ekle (ekstra bölüm, hizalama vs.)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Çalışma zamanı UEFI ortam doğrulamasını etkinleştir\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Biçimlendirme Seçenekleri\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Dosya sistemi\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Ayırma Birimi boyutu\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Yeni birim etiketi\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Hızlı biçimlendir\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Hatalı bloklar için aygıtı denetle\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Genişletilmiş etiket ve simge dosyaları oluştur\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Durum\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Kapat\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Başlat\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Rufus Hakkında\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Lisans\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"Tamam\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus Lisansı\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Daha fazla bilgi\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Evet\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Hayır\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Günlük\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Temizle\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Kaydet\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Güncelleme ilkesi ve ayarlar\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Ayarlar\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Güncellemeleri denetle\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Beta sürümlerini içersin\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Şimdi Denetle\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Güncellemeleri Denetle - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Yeni bir sürüm mevcut. Lütfen son sürümü indirin!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Web sitesine gitmek için buraya tıklayın\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Sürüm Notları\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"İndir\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Rufus'un zaten çalıştığı algılandı\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Başka bir Rufus uygulaması çalışıyor.\\n\"\n\"Lütfen başka bir uygulama çalıştırmak için ilkini kapatın.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"UYARI: '%s' AYGITINDAKİ TÜM VERİ YOK EDİLECEK.\\n\"\n\"İşleme devam etmek için TAMAM'a tıklayın. Çıkmak için İPTAL'e tıklayın.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus güncelleme ilkesi\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Rufus'un uygulama güncellemelerini çevrimiçi denetlemesine izin vermek istiyor musunuz?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Vazgeç\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Hatalı bloklar bulundu\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Denetim Tamamlandı: %d hatalı blok bulundu\\n\"\n\"  %d okuma hatası\\n\"\n\"  %d yazma hatası\\n\"\n\"  %d hata oluşumu\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Daha ayrıntılı rapor burada:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Devre dışı\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Günlük\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Haftalık\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Aylık\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Özel\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Mevcut sürüm: %d.%d (Yapı %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"En son sürüm: %d.%d (Yapı %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"byte\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"KB\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"MB\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"GB\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"TB\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"PB\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"kilobyte\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"megabyte\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Varsayılan\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Varsayılan)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (ya da UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (CSM yok)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS ya da UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d geçiş\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d geçiş %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO Yansısı\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Uygulama\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Vazgeç\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Başlat\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Kullanıcı tarafından işlemden vazgeçildi\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Hata\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Hata: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Dosya indirme\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB Depolama Aygıtı (Genel)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Disk %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Çoklu Disk Birimleri\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Tamponlanıyor\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - İptal\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Başarılı.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Biçimlendirilirken beklenmeyen hata.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Seçilen dosya sistemi bu medya için kullanılamaz.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Aygıta erişim engellendi.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Medya yazma korumalı.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Aygıt başka bir işlem tarafından kullanılıyor. Lütfen aygıta erişilebilmesi için diğer işlemi kapatın.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Bu aygıt için Hızlı Biçimlendirme yapılamaz.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Birim etiketi geçersiz.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Aygıt tanıtıcısı geçersiz.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Seçilen ayırma boyutu bu aygıt için geçerli değil.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Birim boyutu geçersiz.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Lütfen sürücüdeki kaldırılabilir medyayı takın.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Destelenmeyen bir komut alındı.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Bellek ayırma hatası.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Okuma Hatası.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Yazma Hatası.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Yükleme Hatası\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Medya açılamadı. Başka bir işlem tarafından kullanılıyor olabilir. Lütfen medyayı yeniden takın ve deneyin.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Sürücü bölümlenemedi.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Dosyalar hedef sürücüye kopyalanamadı.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Kullanıcı tarafından vazgeçildi.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"İş parçacığı başlatılamadı.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Hatalı blokların denetimi tamamlanamadı.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"ISO yansısı taranamadı.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"ISO yansısı ayrıştırma hatası.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Birim yeniden yerleştirilemedi.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Açılış için dosyalar yamalanamadı/kurulamadı.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Sürücü harfi atanamadı.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"GUID birimi yerleştirilemedi.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Aygıt hazır değil.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus Windows'un USB aygıtını kendi işlemlerinde hala kullandığını algıladı.\\n\"\n\"\\n\"\n\"USB aygıtınızın hızına bağlı olarak, bu işlemin tamamlanması özellikle büyük dosyalar için, uzun bir süre alabilir.\\n\"\n\"\\n\"\n\"Bozulmayı önlemek için Windows'un işini bitirmesine izin vermenizi öneriyoruz. Fakat beklemekten yorulduysanız, yalnız aygıtı çıkarabilirsiniz...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Desteklenmeyen yansı\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Bu yansı ya önyüklenebilir değil ya da Rufus tarafından desteklenmeyen bir önyükleme veya bir sıkıştırma yöntemi kullanıyor...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"%s yer değiştirilsin mi?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Bu ISO yansısı eski bir '%s' sürümünü kullanıyor gibi görünüyor.\\n\"\n\"Açılış menüsü bundan dolayı düzgün görüntülenmeyebilir.\\n\"\n\"\\n\"\n\"Bu durumu düzeltmek için yeni sürümü Rufus tarafından indirilebilir:\\n\"\n\"- İnternete bağlanıp dosyayı indirmek için 'Evet'i seçin\\n\"\n\"- Varolan ISO dosyasını olduğu gibi bırakmak için 'Hayır'ı seçin\\n\"\n\"Ne yapacağınızı bilmiyorsanız, 'Evet'i seçmelisiniz.\\n\"\n\"\\n\"\n\"Not: Yeni dosya mevcut dizine indirilecek ve '%s' orada var olunca, otomatik olarak kullanılacak.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"%s indiriliyor\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Yansı seçilmedi\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"%s NAND için\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Yansı boyutu çok büyük\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Seçilen yansı boyutu hedef için çok büyük.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Desteklenmeyen ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"EFI Hedef Türünü kullanıyorken, sadece EFI açılabilir ISO yansıları desteklenir. Lütfen bir EFI açılabilir ISO'su seçin ya da Hedef Türünü BIOS'a ayarlayın.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Desteklenmeyen Dosya Sistemi\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"ÖNEMLİ: BU SÜRÜCÜ ÇOKLU DİSK BÖLÜMÜ İÇERİYOR!!\\n\"\n\"\\n\"\n\"Listelenmeyen ya da Windows'un göremediği disk bölümü/birimi içeriyor olabilir. İşlem yapmayı tercih ederseniz, bu disk bölümlerindeki herhangi bir veri kaybında sorumluluğu kabul etmiş olursunuz.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Çoklu disk bölümü algılandı\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD Yansısı\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Mevcut seçili dosya sistemi bu ISO türüyle kullanılamaz. Lütfen farklı bir dosya sistemi seçin ya da farklı bir ISO kullanın.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' sadece dosya sistemi NTFS ise uygulanabilir.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"ÖNEMLİ: 'Windows To Go' yüklemeye çalışıyorsunuz, fakat hedef sürücünüz 'SABİT' niteliğinde bir disk değil. Bundan dolayı Windows, ön yükleme sırasında büyük olasılıkla donacaktır. Microsoft, bunu 'KALDIRILABİLİR' nitelikteki sürücüler ile çalışmak üzere tasarlamamıştır.\\n\"\n\"\\n\"\n\"Yine de devam etmek istiyor musunuz?\\n\"\n\"\\n\"\n\"Not: 'SABİT/KALDIRILABİLİR' niteliği, disk üreticileri tarafından özel araçlar kullanılarak değiştirilebilen bir donanım özelliğidir. Fakat bu araçlar genellikle herkese açık olarak paylaşılmaz...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Dosya Sistemi Sınırlandırması\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Bu ISO yansısı, FAT ya da FAT32 dosya sisteminin desteklediği en fazla boyut olan 4 GB'tan daha büyük bir dosya içeriyor.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Eksik WIM desteği\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Platformunuz WIM arşivlerinden dosyaları ayrıştıramaz. WIM ayrıştırması EFI açılabilir Windows 7 ve Windows Vista USB sürücüleri oluşturmak için gereklidir. Bu durumu 7-Zip son sürümünü yükleyerek aşabilirsiniz.\\n\"\n\"7-zip indirme sayfasına gitmek istiyor musunuz?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"%s indirilsin mi?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s ya da daha üstünün yüklenebilmesi için '%s' dosyası gerekir.\\n\"\n\"Çünkü bu dosyanın boyutu 100 KB tan daha büyüktür ve %s ISO yansılarında mutlaka bulunur, Rufus'a gömülü değildir.\\n\"\n\"\\n\"\n\"Rufus eksik dosyayı sizin için indirebilir:\\n\"\n\"- İnternete bağlanıp dosyayı indirmek için 'Evet'i seçin\\n\"\n\"- Dosyayı daha sonra sürücüye elle kopyalamak istiyorsanız 'Hayır'ı seçin\\n\"\n\"\\n\"\n\"Not: Dosya mevcut dizine indirilecek ve '%s' orda var olunca, otomatik olarak kullanılacak.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Vazgeçmek aygıtı KULLANILAMAZ hale getirebilir.\\n\"\n\"Vazgeçmek istediğinize eminseniz, EVET'e tıklayın. Aksi halde HAYIR'a tıklayın.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Lütfen klasör seçin\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Tüm Dosyalar\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus günlüğü\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Disk %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS, 64 kilobyte Ayırma Birimi Boyutu kullanan bir sürücüden başlatılamaz.\\n\"\n\"Lütfen farklı bir Ayırma Birimi Boyutu seçin ya da FreeDOS kullanın.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Uyumsuz Ayırma Boyutu\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Geniş bir UDF Biriminin biçimlendirilmesi çok uzun bir süre alabilir. USB 2.0 hızında, Tahmini biçimlendirme süresi %d:%02d, İlerleme çubuğu donmuş görünüyorken. Lütfen sabırlı olun!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Geniş UDF birimi\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Bu yansı Syslinux %s%s kullanıyor fakat bu uygulama yalnız Syslinux %s%s için yükleme dosyalarını içeriyor.\\n\"\n\"\\n\"\n\"Syslinux'un yeni sürümleri bir başkasıyla uyumlu olmadığından ve Rufus'un bunların tamamını içermesi mümkün olmadığından, iki ek dosyanın('ldlinux.sys' ve 'ldlinux.bss') internet üzerinden indirilmesi gerekli:\\n\"\n\"- İnternete bağlanıp bu dosyaları indirmek için 'Evet'i seçin\\n\"\n\"- İşlemden vazgeçmek için 'Hayır'ı seçin\\n\"\n\"\\n\"\n\"Not: Dosyalar mevcut uygulama dizinine indirilecek ve hazır olduğunda otomatik olarak kullanılacak.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"İndirme gerekli\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Bu yansı Grub %s kullanıyor fakat bu uygulama yalnız Grub %s için yükleme dosyalarını içeriyor.\\n\"\n\"\\n\"\n\"Grub 'un yeni sürümleri bir başkasıyla uyumlu olmadığından ve Rufus'un bunların tamamını içermesi mümkün olmadığından, Rufus yansısıyla eşleşen Grub'un bir yükleme dosyasını ('core.img') edinmeyi çalışacak:\\n\"\n\"- İnternete bağlanıp bu dosyaları indirmek için 'Evet'i seçin\\n\"\n\"- Rufustan varsayılan sürümü kullanmak için 'Hayır''ı seçin\\n\"\n\"- İşlemden vazgeçmek için 'Vazgeç'i seçin\\n\"\n\"\\n\"\n\"Not: Dosyalar mevcut uygulama dizinine indirilecek ve hazır olduğunda otomatik olarak kullanılacak. Çevrimiçi bulunanlar eşleşmiyorsa varsayılan sürüm kullanılacak.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Standart Windows yüklemesi\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"Windows To Go\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"gelişmiş sürücü özellikleri\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"gelişmiş biçimlendirme seçenekleri\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"%sni göster\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"%sni gizle\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Kalıcı disk bölümü boyutu\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Kalıcı bölüm yok\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Canlı USB ortamı için kalıcı disk bölümünün boyutunu ayarlayın. Boyutu 0 olarak ayarlamak, kalıcı bölümü devre dışı bırakır.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Disk bölümü boyutu birimlerini ayarlayın.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Bu iletiyi bir daha gösterme\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"%s hakkında önemli not\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Az önce UEFI:NTFS önyükleyicisini kullanan bir ortam yarattınız. Lütfen, bu ortamı önyükleyebilmek için GÜVENLİ BOOT'U DEVRE DIŞI BIRAKMANIZ gerektiğini unutmayın.\\n\"\n\"Bunun neden gerekli olduğu hakkında ayrıntılar için aşağıdaki 'Daha Fazla Bilgi' düğmesine bakın.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows yansı seçimi\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Bu ISO birden çok Windows iyansısı içeriyor.\\n\"\n\"Lütfen bu yükleme için kullanmak istediğiniz yansıyı seçin:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Başka bir program ya da işlem bu sürücüye erişiyor. Yine de biçimlendirmek ister misiniz?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus, 1809 ISO tabanlı bir Windows To Go ortamı oluşturmaya çalıştığınızı algıladı.\\n\"\n\"\\n\"\n\"Bir *MICROSOFT HATASI* nedeniyle, 'WppRecorder.sys' dosyasını 1803 sürümüyle el ile değiştirmediğiniz sürece, bu medya Windows açılışında (Ölü Mavi Ekran) çökecektir.\\n\"\n\"\\n\"\n\"Ayrıca, Rufus'un bunu sizin için otomatik olarak çözememesinin nedeninin 'WppRecorder.sys' dosyasının Microsoft'un telif hakkı olan bir dosya olduğunu ve bu nedenle dosyanın yasal olarak bir kopyasını uygulamaya koyamayacağımızı unutmayın...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"MBR, bölüm şeması için seçildiğinden, Rufus bu ortam üzerinde yalnızca 2 TB'a kadar bölüm oluşturabilir ve bu da %s disk alanını kullanılamaz duruma getirir.\\n\"\n\"\\n\"\n\"Devam etmek istediğine emin misin?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Sürüm\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Yayın\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Yapı\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Dil\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Mimari\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Sürdür\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Geri\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Lütfen Bekleyin...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Web tarayıcı kullanarak indir\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Windows ISO'larının indirilmesi, Microsoft'un web sitesini bunu engelleyecek şekilde değiştirmesi nedeniyle kullanılamıyor.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Bu komutu çalıştırmak için PowerShell 3.0 veya üstü gerekir.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Çevrimiçi olarak indirmek istiyor musunuz?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"İndirme komutu çalıştırılıyor...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"ISO yansısı İndir\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Bu önyüklenebilir sürücüyü kullanmayı planladığınız bilgisayarın türü. Sürücüyü oluşturmaya başlamadan önce hedefinizin BIOS ya da UEFI türü olup olmadığını belirlemek sizin sorumluluğunuzdur. Aksi halde önyükleme yapamayabilir.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM', cihazın yerel UEFI modunda değil, yalnız BIOS öykünme modunda ('Legacy Mode' olarak da bilinir) önyükleme yapacağı anlamına gelir.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'CSM yok', aygıtın BIOS'a öykünme modunda değil de ('Legacy Mode' olarak da bilinir) yalnızca yerel UEFI modunda önyükleme yapacağı anlamına gelir.\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Deneme Düzeni: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Deneme Düzeni: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Deneme Düzeni: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Deneme Düzeni: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Hedef Dosya Sistemini Ayarlar\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Dosya sisteminde tutulacak en küçük veri bloğu boyutu\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Bu alanı sürücü etiketini ayarlamak için kullanın.\\n\"\n\"Uluslararası karakterler kabul edilir.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Gelişmiş seçeneklere geçiş\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Kalıp denemesi kullanarak hatalı blokları denetle\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"\\\"Yavaş\\\" biçimlendirme yöntemini kullanmak için bu onay kutusu seçimini kaldırın\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Bölümleri oluşturmak için kullanılacak yöntem\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Sürücüyü açılabilir yapmak için kullanılacak yöntem\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Yansı seçmek ya da indirmek için tıklayın...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Uluslararası etiketleri görüntülemek için bu onay kutusunu seçin ve aygıt simgesini belirleyin (autorun.inf oluşturur)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Medyanın MD5Sum dosya doğrulamasını gerçekleştirecek bir UEFI önyükleyici yükleyin\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Ekstra gizli bir bölüm oluşturur ve bölümlerin sınırlarını hizalamaya çalışır.\\n\"\n\"Bu işlem eski BIOSlar için açılış algılamasını geliştirir.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"USB sabit sürücü eklerini listelemeyi etkinleştirir. SORUMLULUK SİZE AİTTİR!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Biçimlendirme işlemini başlat.\\n\"\n\"Bu hedef üzerinde tüm veriyi yok edecek!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Geçersiz indirme imzası\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Seçmek için tıklayın...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Güvenilir USB Biçimlendirme Programı\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Sürüm %d.%d (Yapı %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Türkçe Çeviri:\\\\line• Mehmetali KURAN <mailto:mehmetalikuran@gmail.com>\\\\line• İlhami TUĞRAL <mailto:ilhamitugral@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Hataları ya da geliştirme isteklerini buraya raporlayın:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Ek Telif Hakları:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Güncelleme İlkesi:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Programa güncellemelerini denetlemesi için izin vermeyi seçerseniz, aşağıdaki bilgilerin sunucu(lar)ımızda depolanabilmesini kabul etmiş olursunuz:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"İşletim Sistemi mimarisi ve sürümü\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Kullandığınız uygulamanın sürümü\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"IP Adresiniz\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Özel kullanım istatistikleri oluşturmak amacıyla, bilgi toplamaya \\\\b en fazla bir yıl için\\\\b0  devam edebiliriz. Fakat, Üçüncü şahıslarla isteyerek herhangi bir veri paylaşılmaz.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Güncelleme İlerlemesi:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Güncelleme denetiminin sadece ana uygulama çalışırken gerçekleşmesinden dolayı, Rufus arkaplan hizmeti yüklemez ya da çalıştırmaz.\\\\line\\n\"\n\"Güncellemeler denetlenirken doğal olarak internet erişimi gerekir.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Seçilen açılış seçeneği için geçersiz yansı\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Mevcut yansı, seçilen açılış seçeneği ile eşleşmiyor. Lütfen farklı bir yansı kullanın ya da farklı bir açılış seçeneği seçin.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Bu ISO yansısı, seçilen dosya sistemi ile uyumlu değil\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Uyumsuz sürücü algılandı\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Yazma geçişi\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Okuma geçişi\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"%s indirildi\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"%s indirilemedi\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"%s dosyalarının gömülü sürümü kullanılıyor\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"ÖNEMLİ: BU SÜRÜCÜ STANDART OLMAYAN BİR SEKTÖR BOYUTU KULLANIYOR!\\n\"\n\"\\n\"\n\"Geleneksel sürücüler 512-byte sektör boyutu kullanır fakat bu sürücü %d-byte kullanıyor. Birçok durumda, bu demek oluyor ki bu sürücüden önyükleme yapılamayacak.\\n\"\n\"Rufus önyüklemeli bir sürücü oluşturmayı deneyecektir fakat bunun olacağının GARANTİSİ verilemez.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Standart olmayan sektör boyutu algılandı\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go', SABİT disk niteliği ayarlanmışsa GPT olarak bölümlendiğinde yüklenebilir. Mevcut sürücü SABİT disk olarak algılanamadı.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Bu özellik bu platformda mevcut değil.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Vazgeçiliyor - Lütfen Bekleyin...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Yansı taranıyor...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Yansı taranamadı\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Eski %s algılandı\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Kullanılan Yansı: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Eksik %s dosyası\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Yeni Birim\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"%d aygıt bulundu\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"%d aygıt bulundu\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"HAZIR\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Vazgeçildi\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Başarısız\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Yeni uygulama başlatılıyor...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Yeni uygulama başlatılamadı\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"%s Açıldı\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"%s Kaydedildi\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Biçimlendiriliyor: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Dosya sistemi oluşturuluyor: Görev %d/%d tamamlandı\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS Düzeltme: %d%% tamamlandı\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Biçimlendiriliyor (%s) - Tahmini Süre %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Etiket Ayarlanıyor (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Biçimlendiriliyor (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS Onarımı (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"MBR/PBR/GPT yapıları temizleniyor...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Disk erişimi sorgulanıyor...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Varolan açılış kayıtları inceleniyor...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Varolan birim kapatılıyor...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"MBR Yazılıyor...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"PBR Yazılıyor...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"DOS Dosyaları Kopyalanıyor...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"ISO dosyası içeriği kopyalanıyor: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Win7 EFI Açılış Kurulumu (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Bitiriliyor, Lütfen Bekleyin...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Syslinux %s Yükleniyor...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Hatalı Bloklar: %s %d/%d - %0.2f%% (%d/%d/%d hata)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Hatalı Bloklar: Rastgele kalıpla deneniyor\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Hatalı Bloklar: 0x%02X kalıbıyla deneniyor\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Bölümlendiriliyor (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Bölümler siliniyor (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"İndirilen güncellemenin imzası doğrulanamadı. Bu, sisteminizin imza doğrulaması için yanlış yapılandırıldığı veya kötü amaçlı bir yüklemeyi gösterdiği anlamına gelebilir.\\n\"\n\"\\n\"\n\"İndirme silinecek. Lütfen daha fazla ayrıntı için günlüğü kontrol edin.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"İndiriliyor: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Dosya indirilemedi.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Rufus güncellemeleri denetleniyor...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Güncellemeler: İnternet erişimi yok\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Güncellemeler: Sürüm bilgisine erişilemedi\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Rufus'un yeni sürümü mevcut!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Rufus'un yeni sürümü bulunamadı\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Uygulama kayıt defteri anahtarları başarıyla silindi\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Uygulama kayıt defteri anahtarları silinemedi\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s etkin\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s devre dışı\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Boyut denetlemeleri\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Sabit disk algılama\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Geniş FAT32 biçimlendirmeye zorla\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun çıkışta silinecek\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Sahte sürücü algılama\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet desteği\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge desteği\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Güncellemeye zorla\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS sıkıştırma\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Yansı yazılıyor: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO Desteği\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"UYGUN boyutta birimleri kullanın\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"'%s' dizini siliniyor...\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare disk algılama\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Çift UEFI/BIOS modu\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Windows yansısı uygulanıyor: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Windows yansısı uygulanıyor...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Zaman damgalarını koruma\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB hata ayıklama\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Yansı sağlaması hesaplanıyor: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Seçilen yansı için MD5, SHA1 ve SHA256 sağlamasını hesapla\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Uygulama dilini değiştir\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"%s yansı algılandı\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Seçtiğiniz yansı bir 'ISOHybrid' yansısıdır. Bu da yansının ya %s (dosya kopyalama) modunda ya da %s (disk yansısı) modunda yazılabileceği anlamına geliyor.\\n\"\n\"Rufus %s modunun kullanılmasını önerir, Böylece yazdırmadan sonra, sürücüye her zaman tam erişim sağlanabilir.\\n\"\n\"Ancak, Önyükleme sırasında sorunlarla karşılaşırsanız, yansıyı %s modunda yeniden yazmayı deneyebilirsiniz.\\n\"\n\"\\n\"\n\"Lütfen bu yansının yazdırılmasında kullanmak istediğiniz modu seçin:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"%s modunda yazdır (Önerilen)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"%s modunda yazdır\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Çakışan işlemler denetleniyor...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Önyüklenebilir değil\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Disk ya da ISO yansısı\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Lütfen seçin)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Özel USB sürücü kilitleme\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Geçersiz imza\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"İndirilen yürütülebilir dosyanın dijital imzası eksik.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"İndirilen yürütülebilir dosya '%s' tarafından imzalanmış.\\n\"\n\"Bu tanımlayabildiğimiz ve kötü niyetli etkinliğini belirtebileceğimiz bir imza değil...\\n\"\n\"Bu dosyayı çalıştırmak istediğinize emin misiniz?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Sürücü sıfırlanıyor: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"USB olmayan çıkarılabilir aygıtlar taranıyor\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Yükseltilmiş ayrıcalıklar bulunamadı\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Bu uygulama yalnız yüksek ayrıcalıklarla çalıştırılabilir\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Dosya Dizinleme\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Sürüm seçimi\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Lütfen yüklemek istediğiniz Windows sürümünü seçin:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Desteklenmeyen Windows sürümü\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Windows'un bu sürümü artık Rufus tarafından desteklenmiyor.\\n\"\n\"Rufus'un bu platformla uyumlu son sürümü v%d.%d'dir.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Uyarı: Resmi olmayan sürüm\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Rufus'un bu sürümü, resmi geliştirici(ler)i tarafından oluşturulmadı.\\n\"\n\"\\n\"\n\"Çalıştırmak istediğinize emin misiniz?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Kırpılmış ISO algılandı\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Seçtiğiniz ISO dosyası bildirilen boyutla eşleşmiyor: Veri %s eksik!\\n\"\n\"\\n\"\n\"Bu dosyayı İnternet'ten edindiyseniz, yeni bir kopyasını indirip, MD5 veya SHA değerlerinin resmi dosyalarla eşleştiğini doğrulamanız gerekir.\\n\"\n\"\\n\"\n\"Rufus'daki MD5 veya SHA'yı (✓) işaretini tıklayarak hesaplayabileceğinizi unutmayın.\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Zaman damgası doğrulama hatası\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus, indirilen güncellemenin zaman damgasının geçerli yürütülebilir dosya için olandan daha güncel olduğunu doğrulayamadı.\\n\"\n\"\\n\"\n\"Potansiyel saldırı senaryolarını önlemek için güncelleme işleminden vazgeçildi ve indirme silinecek. Daha fazla bilgi için lütfen günlüğü kontrol edin.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Uygulama ayarlarını göster\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Bu uygulama hakkında bilgi göster\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Günlüğü göster\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Seçilen cihazın disk yansısını oluşturur\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Windows'u başka bir diske yüklemek ya da Windows'u doğrudan bu sürücüden çalıştırmak istiyorsanız (Windows To Go), bu cihazı kullanmak isteyip istemediğinizi belirtmek için bu seçeneği kullanın.\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Hızlı sürücü sıfırlama: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"bu biraz zaman alabilir\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"VHD Algılama\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Sıkıştırılmış arşiv\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Seçtiğiniz ISO yansısı, UEFI kullanıyor ve EFI Sistem Bölümü (ESP) olarak yazılabilecek kadar küçük. Tüm diski kapsayan genel bir veri bölümüne yazmak yerine bir ESP'ye yazmak, bazı kurulum türleri için tercih edilebilir.\\n\"\n\"\\n\"\n\"Lütfen bu yansıyı yazmak için kullanmak istediğiniz modu seçin:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Etkinleştirmek için %s (ana uygulama penceresinde) kullanın.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Ekstra Doğrulama Değerleri\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"VHD'ye kaydet\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Yansı doğrulamayı hesaplayın\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Çoklu düğme\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Geçiş sayısı\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"Disk Kimliği\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Varsayılan iş parçacığı önceliği: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Önyükleme İşaretleyicisini Yoksay\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Bölüm düzeni yenileniyor (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Seçtiğiniz yansı bir ISOHybrid, ancak yansı ISO/Dosya kopyalama modu ile uyumlu hale olrak oluşturulmamış.\\n\"\n\"Sonuç olarak, DD yansısı yazma modu uygulanacaktır.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"'%s' açılamıyor veya okunamıyor\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Windows özelleştirmesi uygulanıyor: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Kullanıcı seçenekleri uygulanıyor...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows Kullanıcı Deneyimi\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Windows kurulumunu özelleştirmek istiyor musunuz?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"4 GB+ RAM, Güvenli Önyükleme(Secure Boot) ve TPM 2.0 gereksinimini kaldırın\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Çevrimiçi Microsoft hesabı gereksinimini kaldırın\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Veri toplamayı devre dışı bırak (Gizlilik sorularını atla)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Windows To Go'nun dahili disklere erişmesini önleyin\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Kullanıcı adı ile yerel bir hesap oluşturun:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Bölgesel seçenekleri bu kullanıcınınkiyle aynı değerlere ayarlayın\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"BitLocker otomatik cihaz şifrelemesini devre dışı bırakın\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Kalıcı günlük\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"MS-DOS'u yüklemek için Microsoft'tan ek bir dosyanın ('diskcopy.dll') indirilmesi gerekir:\\n\"\n\"- İnternete bağlanıp indirmek için 'Evet'i seçin\\n\"\n\"- İşlemden vazgeçmek için 'Hayır'ı seçin\\n\"\n\"\\n\"\n\"Not: Dosya uygulamanın dizinine indirilecek ve varsa otomatik olarak yeniden kullanılacaktır.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"İptal edilen UEFI önyükleyici algılandı\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus, seçtiğiniz ISO'nun iptal edilmiş bir UEFI önyükleyici içerdiğini ve tamamen güncel bir UEFI sisteminde Güvenli Önyükleme etkinleştirildiğinde %s oluşturacağını algıladı.\\n\"\n\"\\n\"\n\"- Bu ISO görüntüsünü saygın olmayan bir kaynaktan aldıysanız, bunun UEFI kötü amaçlı yazılım içerme olasılığını göz önünde bulundurmalı ve bu görüntüden önyükleme yapmaktan kaçınmalısınız.\\n\"\n\"- Eğer güvenilir bir kaynaktan aldıysanız bu uyarıyı vermeyecek daha güncel bir versiyon bulmaya çalışmalısınız.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"\\\"Güvenlik İhlali\\\" ekranı\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"'%s' içeren bir Windows Kurtarma Ekranı (BSOD)\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Sıkıştırılmış VHDX Yansısı\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Sıkıştırılmamış VHD Yansısı\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Full Flash Update Yansısı\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Bu işlevselliği kullanmak için Microsoft'tan bazı ek verilerin indirilmesi gerekir:\\n\"\n\"- İnternete bağlanıp indirmek için 'Evet'i seçin\\n\"\n\"- İşlemden vazgeçmek için 'Hayır'ı seçin\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Windows'u S-Mode ile Kısıtlayın (çevrimiçi hesap atlamayla UYUMSUZ)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Uzman Modu\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Arşiv dosyaları çıkarılıyor: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Rufus MBR'yi kullanın\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus, USB anahtar/bellekler, hafıza kartları vb. USB sürücüleri, biçimlendirmeye ve önyüklemeli hale getirmeye yardımcı olan bir araçtır.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Resmi site: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Kaynak Kodu: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Sürüm Notları %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Bu uygulama, GNU Kamu Lisansı (GPL) sürüm 3'ün koşulları altında lisanslanmıştır.\\n\"\n\"Detaylar için https://www.gnu.org/licenses/gpl-3.0.tr.html sayfasını ziyaret edin.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Önyükle\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"USB, flash kart ve sanal sürücüleri FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 olarak biçimlendirin\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"FreeDOS önyüklenebilir USB sürücüleri oluşturun\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Önyüklenebilir ISO'lardan önyüklenebilir sürücüler oluşturun (Windows, Linux, vb.)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Sıkıştırılmış olanlar da dahil olmak üzere önyüklenebilir disk yansısından önyüklenebilir sürücüler oluşturun\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"UEFI önyüklenebilir NTFS dahil BIOS ya da UEFI önyüklenebilir sürücüler oluşturun\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"'Windows To Go' sürücüleri oluşturun\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"TPM ya da Güvenli Önyüklemeye sahip olmayan bilgisayarlar için Windows 11 kurulum sürücüleri oluşturun\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Kalıcı Linux bölümleri oluşturun\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Seçilen sürücünün VHD/DD yansılarını oluşturun\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Seçilen yansının MD5, SHA-1, SHA-256 ve SHA-512 sağlama toplamlarını hesaplayın\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"\\\"Sahte\\\" flash sürücülerin tespiti de dahil olmak üzere hatalı blok kontrolleri gerçekleştirin\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Resmi Microsoft Windows Retail ISO'larını indirin\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"UEFI Shell ISO'larını indirin\"\n"
  },
  {
    "path": "res/loc/po/uk-UA.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-07-23 23:38+0300\\n\"\n\"PO-Revision-Date: 2024-07-23 23:42+0300\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: uk_UA\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Ukrainian (Українська)\\n\"\n\"X-Rufus-LCID: 0x0422\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Властивості диска\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Пристрій\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Тип завантаження\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Вибрати\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Параметри образу\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Схема розділів\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Цільова система\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Список USB накопичувачів\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Додати виправлення для старих BIOS (додатковий розділ, вирівнювання, тощо)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Увімкнути перевірку носія UEFI під час виконання\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Параметри форматування\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Файлова система\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Розмір кластера\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Мітка тому\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Швидке форматування\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Перевірити пристрій на пошкоджені блоки\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Створити розширену мітку та значок пристрою\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Стан\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Закрити\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Почати\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Про Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Ліцензія\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"ОК\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Ліцензія Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Детальніше\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Так\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Ні\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Журнал\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Очистити\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Зберегти\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Політика оновлення та параметри\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Параметри\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Перевірити наявність оновлень\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Включаючи бета-версії\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Перевірити зараз\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Перевірити наявність оновлень - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Доступна нова версія. Будь ласка, завантажте останню версію!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Натисніть тут, щоб перейти на домашню сторінку\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Нотатки про випуск\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Завантажити\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Виявлено інший екземпляр Rufus\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Запущено інший додаток Rufus.\\n\"\n\"Закрийте перший додаток перед тим, як запустити ще один.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"УВАГА: ВСІ ДАНІ НА ДИСКУ '%s' БУДУТЬ ЗНИЩЕНІ.\\n\"\n\"Для того, щоб продовжити, натисніть ОК. Для виходу натисніть Скасувати.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Політика оновлення Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Чи хочете ви, щоб Rufus перевіряв оновлення автоматично?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Скасувати\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Знайдено пошкоджені блоки\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Перевірка завершена: %d пошкоджених блоків знайдено\\n\"\n\"  %d помилок читання\\n\"\n\"  %d помилок запису\\n\"\n\"  %d пошкоджених блоків\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Більш детальний звіт можна знайти в:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Вимкнено\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Щодня\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Щотижня\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Щомісяця\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"За вибором\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Ваша версія: %d.%d (Збірка %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Остання версія: %d.%d (Збірка %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"байт\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"Кб\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"Мб\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"Гб\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"Тб\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"Пб\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"кілобайт\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"мегабайт\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"За промовчанням\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (за промовчанням)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (чи UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (без CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS чи UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d прохід\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d проходів %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO-образ\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Додаток\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Скасувати\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Запустити\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Операція скасована користувачем\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Помилка\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Помилка: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Завантаження файлу\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB-накопичувач\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Диск %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Декілька розділів\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Очищення буферів\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Скасування\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Успішно.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Невідомі помилки під час форматування.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Неможливо використовувати вибрану файлову систему для даного пристрою.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Доступ до пристрою заборонений.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Вибраний пристрій захищений від запису.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Вибраний пристрій використовується іншим процесом. Будь ласка, завершіть процес перед використанням вибраного пристрою.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Швидке форматування недоступне для вибраного пристрою.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Неприпустима мітка пристрою.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Неприпустимий дескриптор пристрою.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Вибраний розмір кластеру не являється припустимим для даного пристрою.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Невірний розмір тому.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Вставте знімний носій до приводу.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Була отримана непідтримувана команда.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Помилка розподілу пам'яті.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Помилка читання.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Помилка запису.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Помилка встановлення\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Неможливо зчитати носій інформації. Можливо він використовується іншим процесом. Будь ласка, витягніть носій інформації та вставте його знову.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Помилка при створенні розділу.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Неможливо скопіювати файли на вибраний пристрій.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Скасовано користувачем.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Неможливо запустити потік виконання.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Перевірка на пошкоджені блоки не завершена.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Помилка перевірки ISO-образу.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Помилка видобування ISO-образу.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Неможливо змонтувати том.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Неможливо пропатчити/налаштувати файли для завантаження.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Неможливо призначити літеру диска.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Неможливо змонтувати GUID-том.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Пристрій не готовий.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus виявив, що Windows все ще очищає внутрішній буфер USB-накопичувача.\\n\"\n\"\\n\"\n\"В залежності від швидкості вашого USB-пристрою, ця операція може зайняти багато часу, особливо для великих файлів.\\n\"\n\"\\n\"\n\"Дочекайтесь доки Windows завершить очищення для того, щоб запобігти пошкодження пристрою. Однак, якщо ви втомились від очікування, можете просто відімкнути пристрій...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Непідтримуваний ISO-образ\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Вибраний образ або незавантажувальний або використовує метод завантаження чи стиснення, який не підтримується Rufus...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Перемістити %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Вибраний ISO-образ використовує застарілу версію '%s'.\\n\"\n\"Через це завантажувальне меню може відображатися неправильно.\\n\"\n\"\\n\"\n\"Нову версію можна завантажити за допомогою Rufus:\\n\"\n\"- Виберіть 'Так', щоб завантажити файл з інтернету\\n\"\n\"- Виберіть 'Ні', щоб не модифікувати ISO-образ\\n\"\n\"Якщо ви не знаєте що робити, то виберіть 'Так'.\\n\"\n\"\\n\"\n\"Файл буде завантажений в поточну директорію, а в разі наявності '%s' - замінений автоматично.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Завантаженя %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Виберіть образ\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"для %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Образ занадто великий\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Образ занадто великий для вибраного пристрою.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"Непідтримуваний ISO-образ\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"При використанні системного інтерфейсу UEFI підтримуються тільки завантажувальні EFI ISO-образи. Будь ласка, виберіть завантажувальний EFI ISO-образ чи змініть системний інтерфейс на BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Непідтримувана файлова система\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"ВАЖЛИВО: ДАНИЙ ДИСК МІСТИТЬ КІЛЬКА РОЗДІЛІВ!!\\n\"\n\"\\n\"\n\"Даний диск може включати розділи/томи, які не були перераховані або навіть видимі у Windows. Якщо ви хочете продовжити, то будете нести відповідальність за втрату даних на цих розділах.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Виявлено декілька розділів\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD-образ\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Вибрана файлова система не може використовуватись з цим типом ISO-образу. Будь ласка, виберіть іншу файлову систему чи інший ISO-образ.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' може використовуватись тільки з файловою системою NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"ВАЖЛИВО: Ви намагаєтесь встановити 'Windows To Go', але ваш диск призначення не повинен бути 'ФІКСОВАНИМ'. Через це Windows, швидше за все, зависне під час завантаження, так як Microsoft не передбачав дану функцію для роботи з 'ФІКСОВАНИМИ' дисками, а тільки зі 'ЗНІМНИМИ'.\\n\"\n\"\\n\"\n\"Ви все ще хочете продовжити?\\n\"\n\"\\n\"\n\"Примітка: Атрибути 'ФІКСОВАНИЙ/ЗНІМНИЙ' являються апаратними властивостями, які можуть бути змінені тільки за допомогою інструментів від виробників. Проте ці інструменти МАЙЖЕ НІКОЛИ не надаються громадськості...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Обмеження файлової системи\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Цей ISO-образ містить файл розміром більш ніж 4 Гб, що неприпустимо при використанні файлової системи FAT чи FAT32.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Відсутня підтримка WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Ваша система не може видобувати файли з WIM-архівів, однак це необхідно для створення завантажувального USB-накопичувача з Windows 7 чи Windows Vista. Ви можете виправити це встановивши останню версію 7-Zip\\n\"\n\"Хочете відвідати сторінку завантаження 7-zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Завантажити %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s чи більш пізньої версії потребує наявності '%s'.\\n\"\n\"Оскільки цей файл більший за 100 Кб, і завжди присутній в %s ISO-образах, він не був вбудований в Rufus.\\n\"\n\"\\n\"\n\"Rufus може завантажити відсутній файл:\\n\"\n\"- Виберіть 'Так', якщо хочете завантажити даний файл\\n\"\n\"- Виберіть 'Ні', якщо хочете завантажити його вручну пізніше\\n\"\n\"\\n\"\n\"Примітка: Файл буде завантажений в поточну директорію. За наявності '%s', він буде перезаписаний автоматично.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Скасування може залишити пристрій у НЕРОБОЧОМУ стані.\\n\"\n\"Якщо ви впевнені, що хочете скасувати процес, натисніть кнопку ТАК. В іншому випадку натисніть кнопку НІ.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Будь ласка, виберіть теку\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Всі файли\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Журнал Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Диск %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS не може завантажитися при використанні розміру кластера 64 Кб...\\n\"\n\"Будь ласка, змініть розмір кластеру чи використайте FreeDOS.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Несумісний розмір кластера\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Форматування великих UDF-томів займає багато часу. На швидкості USB 2.0 приблизна тривалість форматування складе %d:%02d, протягом якої індикатор прогресу буде заморожено. Будь ласка, будьте терплячі!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Великий UDF-том\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Даний образ використовує Syslinux %s%s, проте даний додаток включає в себе тільки настановні файли для Syslinux %s%s.\\n\"\n\"\\n\"\n\"Так як нові версії Syslinux несумісні одна з одною, необхідно, щоб додаткові файли ('ldlinux.sys' та 'ldlinux.bss') були завантажені з інтернету:\\n\"\n\"- Виберіть 'Так', щоб завантажити файли з інтернету\\n\"\n\"- Виберіть 'Ні', щоб скасувати операцію\\n\"\n\"\\n\"\n\"Примітка: Файли будуть завантажені в поточний каталог додатку і будуть використовуватися повторно за необхідності.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Необхідно завантажити\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Даний образ використовує завантажувач Grub %s, але додаток включає тільки настановні файли для завантажувача Grub %s.\\n\"\n\"\\n\"\n\"Різні версії завантажувача Grub можуть бути несумісними одна з одною та увімкнення їх усіх не являється можливим. Rufus намагатиметься знайти потрібну версію настановного файла завантажувача Grub ('core.img'), що відповідає версії завантажувача вашого образу:\\n\"\n\"- Виберіть 'Так', щоб скачати завантажувальний файл з інтернету\\n\"\n\"- Виберіть 'Ні', щоб використовувати версію за замовчуванням із Rufus\\n\"\n\"- Виберіть 'Скасувати', щоб скасувати операцію\\n\"\n\"\\n\"\n\"Примітка: Файл буде завантажено в поточний каталог додатку та буде використаний повторно наступного разу. Якщо потрібна версія настановного файла не буде знайдена в інтернеті, то буде використовуватися версія за замовчуванням.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Стандартне встановлення Windows\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"розширені властивості диска\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"розширені властивості форматування\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Показати %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Сховати %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Розмір розділу збереження\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Деактивовано\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Встановіть розмір розділу збереження для Live USB-накопичувача. Щоб вимкнути розділ збереження встановіть розмір 0.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Встановити розмір одиниць розділу.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Не показувати це повідомлення знову\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Важливе повідомлення щодо %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Ви тільки що створили носій, що використовує завантажувач UEFI:NTFS. Будь ласка, пам'ятайте, що для завантаження цього носія ВИ ПОВИННІ ВИМКНУТИ БЕЗПЕЧНЕ ЗАВАНТАЖЕННЯ.\\n\"\n\"Детальну інформацію про те, чому це необхідно ви можете побачити, натиснувши кнопку \\\"Додаткова інформація\\\" нижче.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Вибір образу Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"Цей ISO містить декілька образів Windows.\\n\"\n\"Будь ласка, виберіть образ, котрий ви хочете використати для встановлення:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Інша програма чи процес отримують доступ до цього диска. Ви все одно бажаєте форматувати його?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus виявив, що ви намагаєтесь створити носій Windows To Go, заснований на версії ISO 1809\\n\"\n\"\\n\"\n\"Через *ПОМИЛКУ MICROSOFT* цей носій буде припиняти роботу під час завантаження Windows (Синій екран смерті), доки ви вручну не перенесете файл 'WppRecorder.sys' з версії 1803.\\n\"\n\"\\n\"\n\"Також зауважте, що Rufus не може автоматично виправити цю помилку через те, що файл 'WppRecorder.sys' захищено авторським правом Microsoft, тому ми не можемо легально вставити копію файла в додаток...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Через те, що для схеми розділів вибрано MBR, Rufus може створити розділ на цьому носії лише розміром до 2 Тб, що не дозволить використовувати %s дискового простору.\\n\"\n\"\\n\"\n\"Ви бажаєте продовжити?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Версія\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Реліз\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Редакція\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Мова\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Архітектура\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Продовжити\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Назад\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Будь ласка, зачекайте...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Завантажити використовуючи браузер\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Неможливо завантажити: Microsoft внесла деякі зміни на свій вебсайт, щоб запобігти завантаженню образів Windows.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Для запуску сценарію необхідна наявність PowerShell 3.0 чи більш пізньої версії.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Чи хочете ви вийти в мережу та завантажити його?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Запуск сценарію завантаження...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Завантаження ISO образу\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Тип комп'ютера, разом з яким ви хочете використовувати завантажувальний диск. Ви повинні визначити який тип інтерфейсу (BIOS чи UEFI) використовує ваш комп'ютер перед початком створення диску, оскільки неправильний вибір може спровокувати помилку завантаження.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' означає, що пристрій завантажується лише в режимі емуляції BIOS (також відомому як 'Legacy Mode'), а не в рідному режимі UEFI.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'без CSM' означає, що пристрій завантажується лише в режимі UEFI.\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Тестовий паттерн: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Тестовий паттерн: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Тестовий паттерн: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Тестовий паттерн: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Встановити цільову файлову систему\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Вибір мінімального розміру кластера, що займає кожен блок даних\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Встановлення нової мітки тому.\\n\"\n\"Підтримуються міжнародні символи.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Показати розширені властивості\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Перевірка пристрою на наявність пошкоджених блоків за допомогою тестового паттерну\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Швидке форматування пристрою\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Метод створення розділів\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Метод створення завантажувального диска\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Натисніть, щоб вибрати образ...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Дозволити відображення міток з міжнародними символами та задати значок пристрою (створюється autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Встановити завантажувач UEFI, який буде виконувати перевірку MD5Sum\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Створити додатковий прихований розділ і вирівняти межі розділів.\\n\"\n\"Це допоможе покращити виявлення завантажувача в старих версіях BIOS.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Відображати зовнішні USB накопичувачі. ВИКОРИСТОВУЙТЕ НА СВІЙ СТРАХ І РИЗИК!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Почати форматування пристрою.\\n\"\n\"Всі дані на диску будуть ЗНИЩЕНІ!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Помилка завантаження підпису\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Натисніть для вибору...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - надійна утиліта для форматування USB-накопичувачів\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Версія %d.%d (Збірка %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Українською переклав: Великожон Костянтин <mailto:mind.converter@gmail.com>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Повідомити про помилку чи запропонувати покращення на веб-сайті:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Додаткові авторські права:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Політика оновлення:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Якщо ви дозволите цій програмі перевіряти наявність оновлень, значить ви погоджуєтесь, що наступна інформація може збиратися на наших серверах:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Версія та архітектура вашої операційної системи\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Версія використовуваного додатку\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Ваша IP-адреса\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Для отримання статистики використання програми, ми можемо зберігати зібрану інформацію \\\\b до одного року\\\\b0. Проте, ми не будемо розкривати будь-які особисті дані третім сторонам.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Процес оновлення:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Додаток Rufus не встановлює та не запускає фонові служби, тому перевірка наявності оновлень виконується тільки тоді, коли запущений основний додаток.\\\\line\\n\"\n\"Для перевірки наявності оновлень необхідний доступ до інтернету.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Невірний образ для вибраного варіанта завантаження\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Вибрано невірний образ для вибраного варіанта завантаження. Будь ласка, виберіть інший образ чи виберіть інший варіант завантаження.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Даний ISO-образ несумісний з обраною файловою системою\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Знайдено несумісний диск\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Прохід запису\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Прохід читання\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Завантажено %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Неможливо завантажити %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Використовувати вбудовану версію %s файлів\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"ВАЖЛИВО: ЦЕЙ ДИСК ВИКОРИСТОВУЄ НЕСТАНДАРТНИЙ РОЗМІР СЕКТОРА!\\n\"\n\"\\n\"\n\"Зазвичай диски використовують сектор розміром 512 байт, проте цей диск використовує сектор на %d байт. В більшості випадків це означає, що ви НЕ ЗМОЖЕТЕ завантажитись з цього диску.\\n\"\n\"Rufus може спробувати створити завантажувальний диск, але НЕ ДАЄ ГАРАНТІЇ, що він буде працювати.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Знайдено нестандартний розмір сектора\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' може використовуватись тільки з розділом GPT диска та якщо диск являється ФІКСОВАНИМ. Вибраний диск не являється ФІКСОВАНИМ.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Вибрана функція недоступна на даній платформі.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Скасування - Будь ласка, зачекайте...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Сканування образа...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Не вдалося відсканувати образ\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Виявлено застарілий %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Використання образа: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Відсутній файл %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"Новий том\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"Виявлено пристрій: %d\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"Виявлено пристроїв: %d\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"Готово\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Скасовано\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Невдало\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Запуск нового додатка...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Не вдалося запустити новий додаток\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Відкрито %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Збережено %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Форматування: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Створення файлової системи: Завдання виконано на %d/%d\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Створення NTFS області Fixup: %d%% виконано\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Форматування (%s) - завершення через %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Встановлення мітки тому (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Форматування (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Перевірка NTFS області Fixup (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Очистка структури MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Запит доступу до диска...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Аналіз завантажувальних записів...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Закриття існуючого розділу...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Створення головного завантажувального запису...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Створення завантажувального запису розділу...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Копіювання DOS-файлів...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Копіювання ISO-файлів: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Налаштування завантажувача Win7 EFI (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Завершення, будь ласка, чекайте...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Встановлення Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Пошкоджені блоки: %s %d/%d - %0.2f%% (%d/%d/%d помилок)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Пошкоджені блоки: Тестування випадковим паттерном\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Пошкоджені блоки: Тестування паттерном 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Розмітка розділу (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Видалення розділів (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Підпис для завантаженого оновлення не може бути підтверджений. Це означає, що ваша система неправильно налаштована для перевірки підпису чи може бути ознакою шкідливої програми.\\n\"\n\"\\n\"\n\"Завантаження було видалено. Будь ласка, перегляньте журнал для більш детальної інформації.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Завантаження: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Не вдалося завантажити файл.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Перевірка наявності оновлень...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Помилка: Необхідний доступ до інтернету\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Оновлення: Неможливо отримати доступ до даних про версію\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Доступна нова версія Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Нових версій Rufus не знайдено\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Ключі додатку в реєстрі успішно видалені\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Не вдалося видалити ключі додатку в реєстрі\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s увімкнено\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s вимкнено\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Визначення розміру\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Виявлення накопичувачів\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Примусове форматування в розширений FAT32\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun буде видалений при виході\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Виявлено фальшивий диск\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Підтримка Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Підтримка Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Примусове оновлення\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"Стиснення NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Запис образа: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Підтримка ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Використання ПРАВИЛЬНОГО розміру одиниць\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Видалення каталога '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Виявлено диск VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Подвійний режим UEFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Застосування Windows-образа: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Застосування Windows-образа...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Зберігати мітки часу\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Режим USB-відлагодження\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Обчислення контрольних сум: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Обчислити контрольні суми MD5, SHA1 та SHA256 для вибраного образа\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Змінити мову додатка\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Виявлено образ %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Вибраний образ є образом 'ISOHybrid'. Це означає, що образ можна записати або в %s (режимі копіювання) або в %s (режимі образа диска).\\n\"\n\"Rufus рекомендує використовувати %s режим для повного доступу до диска після запису.\\n\"\n\"Однак, якщо ви зіштовхнетесь з проблемами під час завантаження ви можете ще раз спробувати записати образ в %s режимі.\\n\"\n\"\\n\"\n\"Будь ласка, виберіть режим, який ви хочете використовувати для запису обраного образа:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Записати в %s режимі (Рекомендується)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Записати в %s режимі\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Перевірка конфліктних процесів...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Незавантажувальний образ\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Диск чи ISO-образ\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Будь ласка, виберіть)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Особливе блокування USB-накопичувача\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Невірний підпис\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"У завантаженого файлу відсутній цифровий підпис.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Завантажений файл підписаний '%s'.\\n\"\n\"Це не той підпис, який визнається нами, що вказує на деякі форми шкідливих дій...\\n\"\n\"Ви впевнені, що хочете запустити цей файл?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Обнуління диска: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Виявлення знімних не-USB носіїв\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Підвищені привілеї відсутні\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Ця програма може бути запущена лише з підвищеними привілеями\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Індексація файлів\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Вибір версії\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Будь ласка, виберіть версію Windows, яку ви хочете встановити:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Непідтримувана версія Windows\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Ця версія Windows більше не підтримується Rufus.\\n\"\n\"Остання підтримувана версія, що сумісна з цією платформою: v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Увага: Неофіційна версія\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Ця версія Rufus не була підготована її офіційним розробником.\\n\"\n\"\\n\"\n\"Ви впевнені, що хочете запустити її?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Виявлено усічений ISO\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Розмір вибраного файла ISO не співпадає з оголошеним розміром: %s даних відсутні!\\n\"\n\"\\n\"\n\"Якщо ви завантажили цей файл з інтернету, вам слід завантажити нову копію файла або перевірити співпадіння контрольних сум MD5 чи SHA з офіційним файлом.\\n\"\n\"\\n\"\n\"Пам'ятайте, що ви можете порівняти MD5 чи SHA в Rufus, натиснувши кнопку (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Помилка перевірки мітки часу\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus не може підтвердити, що мітка часу для завантаженого оновлення більш пізня, ніж мітка запущеної програми.\\n\"\n\"\\n\"\n\"Щоб запобігти можливим сценаріям атаки, процес оновлення було скасовано та завантаження було видалено. Будь ласка, перегляньте журнал для більш детальної інформації.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Показати налаштування додатка\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Показати інформацію про цей додаток\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Показати журнал\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Створити образ диска для вибраного пристрою\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Використовуйте цей параметр, щоб вказати, чи хочете ви використовувати цей пристрій для встановлення Windows на інший диск, чи хочете запускати Windows напряму з пристрою (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Швидке обнуління диска: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"це може тривати деякий час\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"Виявлення VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Стиснутий архів\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Вибраний ISO використовує UEFI та достатньо малий, щоб бути записаний як EFI System Partition (ESP). Запис до ESP замість запису до загального розділу, що займає весь диск, може мати переваги для деяких типів установок.\\n\"\n\"\\n\"\n\"Будь ласка, виберіть тип встановлення для даного образа:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Використайте %s (в головному вікні програми), щоб увімкнути.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Додаткові хеші (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Зберегти до VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Обчислити контрольні суми образа\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Декілька кнопок\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Кількість проходів\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID диска\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Пріоритет потоку за замовчуванням: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Ігнорувати Boot Marker\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Оновлення макета розділу (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Вибраний образ має властивості ISOHybrid, проте його автор не потурбувався про сумісність з режимом копіювання ISO-файлів.\\n\"\n\"Як результат, буде примусово застосовано режим запису образів DD.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Неможливо відкрити чи прочитати '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Застосування налаштувань Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Застосування параметрів користувача...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Інтерфейс користувача Windows\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Налаштувати встановлення Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Зняти обмеження на 4Гб+ ОЗП, Secure Boot та TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Видалити вимогу на онлайн обліковий запис Microsoft\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Вимкнути збір даних (Пропустити питання щодо конфіденційності)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Обмежити Windows To Go доступ до внутрішніх дисків\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Створити локальний обліковий запис з ім'ям:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Встановити регіональні параметри на такі самі, як у поточного користувача\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Вимкнути автоматичне шифрування пристрою BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Постійний журнал\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Необхідно завантажити додатковий файл ('diskcopy.dll') з сайту Microsoft для встановлення MS-DOS:\\n\"\n\"- Виберіть 'Так' для з'єднання з інтернетом та його завантаження\\n\"\n\"- Виберіть 'Ні' для скасування операції\\n\"\n\"\\n\"\n\"Примітка: файл буде завантажено в каталог додатку та повторно використано за наявності.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Виявлено відкликаний завантажувач UEFI\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus виявив, що вибраний ISO містить відкликаний завантажувач UEFI, що буде створювати %s, коли в оновленій системі UEFI буде ввімкнено безпечне завантаження.\\n\"\n\"\\n\"\n\"- Якщо ви отримали цей образ з неперевіреного джерела, Вам слід розглянути можливість того, що він може містити зловмисне ПЗ і уникнути завантаження з нього.\\n\"\n\"- Якщо ви отримали цей образ з довіреного джерела, Вам слід спробувати знайти більш актуальну версію, що не буде провокувати це попередження.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"вікно \\\"Security Violation\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"вікно Windows Recovery Screen (BSOD) з '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Образ VHDX зі стисненням\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Образ VHD без стиснення\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Образ Full Flash Update\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Для використання даного функціоналу необхідно завантажити деякі додаткові дані з сайту Microsoft:\\n\"\n\"- Виберіть 'Так' для з'єднання з інтернетом та завантаження даних\\n\"\n\"- Виберіть 'Ні' для скасування операції\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Обмежити Windows до S-Mode (НЕСУМІСНО з обходом облікового запису)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Просунутий режим\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Видобування архівованих файлів: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Використовувати Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus це утиліта, яка допомагає форматувати та створювати завантажувальні флешки, картки пам'яті, тощо.\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Офіційний сайт: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Сирцевий код: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Список змін: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Ця програма ліцензована згідно з умовами GNU Public License (GPL) version 3.\\n\"\n\"Більше: https://www.gnu.org/licenses/gpl-3.0.uk.html.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Отримати\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Форматування USB-накопичувачів, флешок, карток пам'яті у FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Створення завантажувальних пристроїв FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Створення завантажувальних пристроїв з завантажувальних образів (Windows, Linux, тощо)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Створення завантажувальних пристроїв з завантажувальних образів, у тому числі стиснутих\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Створення завантажувальних пристроїв BIOS чи UEFI, включаючи завантажувальний UEFI NTFS\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Створення пристроїв 'Windows To Go'\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Створення інсталяційних дисків Windows 11 для ПК, які не мають TPM чи Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Створення розділу збереження Linux\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Створення образів VHD/DD з вибраних дисків\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Обчислення контрольних сум MD5, SHA-1, SHA-256 та SHA-512 для вибраних образів\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Перевірка дисків (включаючи фальшиві диски)\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Завантаження офіційних образів Microsoft Windows\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Завантаження командної оболонки UEFI ISO\"\n"
  },
  {
    "path": "res/loc/po/vi-VN.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2025-06-21 21:57+0700\\n\"\n\"PO-Revision-Date: 2025-06-21 22:47+0700\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: vi_VN\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Vietnamese (Tiếng Việt)\\n\"\n\"X-Rufus-LCID: 0x042A\\n\"\n\"X-Generator: Poedit 3.6\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"Thuộc tính thiết bị lưu\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"Thiết bị lưu\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"Tùy chọn khởi động\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"Chọn\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"Tùy chọn tệp tin\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"Sơ đồ phân vùng\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"Hệ thống khởi động\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"Liệt kê danh sách ổ USB\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"Thêm các bản sửa lỗi cho BIOS cũ (phân vùng phụ, căn lề phân vùng, v.v...)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"Bật xác minh thiết bị UEFI trong thời gian chạy\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"Tùy chọn định dạng\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"Hệ thống tập tin\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"Kích thước cụm\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"Nhãn thiết bị lưu\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"Định dạng nhanh\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"Kiểm tra lỗi khối trên thiết bị lưu trữ\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"Tạo nhãn mở rộng và tệp tin biểu tượng\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"Trạng thái\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"Đóng\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"Bắt đầu\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"Thông tin về Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"Giấy phép\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Giấy phép Rufus\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"Thông tin thêm\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"Có\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"Không\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"Nhật ký\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"Xoá\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"Lưu\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"Cập nhật chính sách và thiết lập\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"Thiết lập\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"Kiểm tra cập nhật\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"Bao gồm bản thử nghiệm\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"Kiểm tra ngay\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"Kiểm tra cập nhật - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"Đã có phiên bản mới hơn. Vui lòng tải phiên bản mới nhất!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"Nhấn vào đây để truy cập website\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"Ghi chú phát hành\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"Tải xuống\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"Đã phát hiện tiến trình chạy đồng thời\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"Ứng dụng Rufus khác đang chạy.\\n\"\n\"Vui lòng đóng ứng dụng đầu tiên trước khi chạy một ứng dụng mới.\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"CẢNH BÁO: TẤT CẢ DỮ LIỆU TRÊN THIẾT BỊ '%s' SẼ BỊ XOÁ.\\n\"\n\"Để tiếp tục tiến trình này, nhấn OK. Để thoát nhấn HUỶ.\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Chính sách cập nhật Rufus\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"Bạn có muốn cho phép Rufus kiểm tra các bản cập nhật ứng dụng trực tuyến?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"Huỷ\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"Phát hiện khối hỏng\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"Kiểm tra hoàn tất: phát hiện %d khối hỏng\\n\"\n\"  %d lỗi đọc\\n\"\n\"  %d lỗi ghi\\n\"\n\"  %d lỗi cấu trúc\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"Một báo cáo chi tiết hơn có thể tìm thấy trong:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"Đã vô hiệu\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"Hàng ngày\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"Hàng tuần\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"Hàng tháng\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"Tuỳ chỉnh\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"Phiên bản của bạn: %d.%d (Bản dựng %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"Phiên bản mới nhất: %d.%d (Bản dựng %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"Mặc định\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (Mặc định)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (hoặc UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (không CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS hoặc UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"Đạt %d lần\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"Đã đạt %d lần %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"Tệp ISO\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"Ứng dụng\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"Huỷ bỏ\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"Khởi chạy\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"Tiến trình đã bị huỷ bởi người dùng\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"Lỗi\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"Lỗi: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"Tải xuống tập tin\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"Thiết bị lưu trữ USB (Cơ bản)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (Đĩa %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"Đa phân vùng\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - Đang xả bộ đệm\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - Hủy bỏ\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"Thành công.\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"Lỗi không xác định khi đang định dạng.\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"Không thể dùng hệ thống tập tin đã chọn cho thiết bị này.\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"Truy cập tới thiết bị đã bị từ chối.\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"Thiết bị đang được bảo vệ ghi.\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"Thiết bị đang được dùng bởi tiến trình khác. Vui lòng đóng mọi tiến trình có thể đang truy cập thiết bị.\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"Định dạng nhanh không khả dụng với thiết bị này.\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"Nhãn ổ đĩa không hợp lệ.\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"Tham chiếu thiết bị không hợp lệ.\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"Kích thước cụm đã chọn không hợp lệ với thiết bị này.\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"Kích cỡ thiết bị không hợp lệ.\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"Vui lòng cắm thiết bị lưu trữ di động vào ổ.\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"Đã nhận một lệnh không được hỗ trợ.\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"Lỗi sắp xếp bộ nhớ.\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"Lỗi đọc.\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"Lỗi ghi.\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"Cài đặt thất bại\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"Không thể mở thiết bị. Có thể nó đang được tiến trình khác sử dụng. Vui lòng cắm lại thiết bị và thử lại.\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"Không thể phân vùng thiết bị.\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"Không thể sao chép tệp vào thiết bị đích.\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"Đã huỷ bởi người dùng.\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"Không thể bắt đầu luồng.\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"Kiểm tra khối hỏng chưa hoàn tất.\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"Quét tệp ISO thất bại.\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"Trích xuất tệp ISO thất bại.\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"Không thể tái gắn ổ đĩa.\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"Không thể vá/cài đặt tập tin cho việc khởi động.\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"Không thể gán ký tự ổ đĩa.\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"Không thể gắn kết phân vùng GUID.\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"Thiết bị chưa sẵn sàng.\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus đã phát hiện Windows vẫn đang xả bộ đệm bên trong thiết bị USB.\\n\"\n\"\\n\"\n\"Tuỳ thuộc vào tốc độ thiết bị USB của bạn, hoạt động này có thể mất một thời gian dài để hoàn tất, đặc biệt với những tập tin lớn.\\n\"\n\"\\n\"\n\"Chúng tôi khuyên rằng bạn nên để Windows kết thúc để phòng hỏng dữ liệu. Nhưng nếu bạn cảm thấy quá lâu, hãy cứ tháo thiết bị ra...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"Tệp tin không được hỗ trợ\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"Tệp này không có khả năng khởi động hoặc sử dụng một tuỳ chọn khởi động hoặc nén không được Rufus hỗ trợ...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"Thay thế %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"Tệp ISO này có vẻ là phiên bản lỗi thời của '%s'.\\n\"\n\"Các menu khởi động có thể không hiện chính xác vì điều này.\\n\"\n\"\\n\"\n\"Một phiên bản mới có thể được tải xuống bởi Rufus để khắc phục vấn đề này:\\n\"\n\"- Chọn 'Có' để kết nối với Internet và tải tập tin xuống\\n\"\n\"- Chọn 'Không' để không thay đổi tập tin ISO đang có\\n\"\n\"Nếu bạn không biết phải làm gì, bạn nên chọn 'Có'.\\n\"\n\"\\n\"\n\"Ghi chú: Tập tin mới sẽ được tải xuống vào thư mục hiện tại và một khi '%s' tồn tại trong đó, nó sẽ được tự động tái sử dụng.\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"Đang tải xuống %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"Chưa tệp tin nào được chọn\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"cho %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"Tệp tin quá lớn\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"Tệp tin quá lớn cho thiết bị đích đã chọn.\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"ISO không được hỗ trợ\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"Khi sử dụng kiểu hệ thống khởi động UEFI, chỉ hỗ trợ các tệp ISO có khả năng khởi động bằng EFI. Vui lòng chọn một tệp ISO có hỗ trợ EFI hoặc chuyển kiểu hệ thống khởi động sang BIOS.\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"Hệ thống tập tin không được hỗ trợ\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"QUAN TRỌNG: Ổ ĐĨA NÀY CHỨA NHIỀU PHÂN VÙNG!!\\n\"\n\"\\n\"\n\"Có thể bao gồm phân vùng/ổ đĩa không có trong danh sách hoặc không hiển thị trong Windows. Nếu bạn tiến hành, bạn sẽ phải chịu trách nhiệm về mọi tổn thất dữ liệu trên những phân vùng này.\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"Đã phát hiện nhiều phân vùng\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"Tệp tin DD\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"Không thể dùng loại ISO này với hệ thống tập tin đã chọn. Vui lòng chọn một hệ thống tập tin hoặc chọn tệp ISO khác.\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"Chỉ có thể áp dụng '%s' nếu hệ thống tập tin là NTFS.\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"QUAN TRỌNG: Bạn đang cố cài đặt Windows To Go, nhưng ổ đĩa đích của bạn không có thuộc tính “CỐ ĐỊNH” (FIXED). Do đó, Windows có thể bị treo khi khởi động, vì Microsoft không thiết kế Windows To Go để hoạt động với ổ đĩa có thuộc tính “THÁO RỜI” (REMOVABLE).\\n\"\n\"\\n\"\n\"Bạn có chắc chắn muốn tiếp tục không?\\n\"\n\"\\n\"\n\"Lưu ý: Thuộc tính “CỐ ĐỊNH/THÁO RỜI” là một đặc điểm phần cứng và chỉ có thể thay đổi bằng công cụ đặc biệt từ nhà sản xuất ổ đĩa. Tuy nhiên, những công cụ này HẦU NHƯ KHÔNG bao giờ được cung cấp cho người dùng phổ thông...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"Giới hạn tập tin hệ thống\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"Tệp ISO này có chứa một tập tin lớn hơn 4 GB, lớn hơn kích thước tập tin tối đa được hệ thống FAT hoặc FAT32 cho phép.\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"Thiếu hỗ trợ WIM\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"Nền tảng của bạn không thể giải nén tệp từ lưu trữ WIM. Việc giải nén WIM là cần thiết để tạo đĩa USB khởi động Windows 7 và Windows Vista có hỗ trợ EFI. Bạn có thể khắc phục điều này bằng cách cài phiên bản mới nhất của 7-Zip.\\n\"\n\"Bạn muốn truy cập trang tải xuống của 7-Zip?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"Tải xuống %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s hoặc mới hơn yêu cầu tập tin '%s' được cài đặt.\\n\"\n\"Vì tập tin này lớn hơn 100 KB, và luôn có trong các tệp ISO %s, nó không được kèm theo trong Rufus.\\n\"\n\"\\n\"\n\"Rufus có thể tải xuống tập tin còn thiếu cho bạn:\\n\"\n\"- Chọn 'Có' để kết nối với Internet và tải tập tin\\n\"\n\"- Chọn 'Không' nếu bạn muốn tự chép tập tin này trên đĩa lúc khác\\n\"\n\"\\n\"\n\"Ghi chú: tập tin sẽ được tải xuống thư mục hiện tại và khi '%s' tồn tại ở đó, nó sẽ tự động được tái sử dụng.\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"Huỷ bỏ có thể làm thiết bị rơi vào trạng thái KHÔNG THỂ SỬ DỤNG.\\n\"\n\"Nếu bạn chắc chắn muốn huỷ, chọn CÓ. Nếu không, hãy chọn KHÔNG.\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"Vui lòng chọn thư mục\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"Tất cả tập tin\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Nhật ký Rufus\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (Đĩa %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS không thể khởi động từ ổ đĩa có kích thước cụm là 64 kilobyte.\\n\"\n\"Vui lòng thay đổi kích thước cụm hoặc sử dụng FreeDOS thay thế.\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"Kích thước cụm không tương thích\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"Định dạng ổ UDF lớn có thể mất nhiều thời gian. Với tốc độ của USB 2.0, thời gian định dạng dự kiến là %d:%02d, trong lúc này thanh tiến trình sẽ không thay đổi. Vui lòng kiên nhẫn!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"Ổ UDF lớn\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Tệp này dùng Syslinux %s%s nhưng ứng dụng này chỉ bao gồm tập tin cài đặt cho Syslinux %s%s.\\n\"\n\"\\n\"\n\"Phiên bản mới của Syslinux không tương thích với các phiên bản khác, và Rufus không thể kèm theo tất cả chúng, bạn phải tải xuống thêm hai tập tin từ Internet ('ldlinux.sys' và 'ldlinux.bss'):\\n\"\n\"- Chọn 'Có' để kết nối tới Internet và tải xuống những tập tin này\\n\"\n\"- Chọn 'Không' để huỷ hoạt động\\n\"\n\"\\n\"\n\"Chú ý: Các tập tin sẽ được tải xuống vào thư mục ứng dụng hiện tại và sẽ được tự tái sử dụng nếu có.\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"Yêu cầu tải xuống\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"Tệp này dùng Grub %s nhưng ứng dụng này chỉ bao gồm tập tin cài đặt cho Grub %s.\\n\"\n\"\\n\"\n\"Các phiên bản khác nhau của Grub có thể không tương thích với nhau, và Rufus không thể kèm theo tất cả chúng, ứng dụng sẽ cố tìm một phiên bản tập tin cài đặt Grub ('core.img') khớp với phiên bản có trong tệp của bạn:\\n\"\n\"- Chọn 'Có' để kết nối tới Internet và thử tải nó xuống\\n\"\n\"- Chọn 'Không' để dùng phiên bản mặc định từ Rufus\\n\"\n\"- Chọn 'Huỷ' để bỏ qua hoạt động\\n\"\n\"\\n\"\n\"Chú ý: Các tập tin sẽ được tải xuống vào thư mục ứng dụng hiện tại và sẽ được tự tái sử dụng nếu có. Nếu không tìm thấy bản trùng khớp nào trực tuyến thì phiên bản mặc định sẽ được sử dụng.\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"Cài đặt Windows tiêu chuẩn\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"thuộc tính ổ đĩa nâng cao\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"tùy chọn định dạng nâng cao\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"Hiện %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"Ẩn %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"Kích thước phân vùng cố định\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"Không cố định\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"Đặt kích thước phân vùng cố định cho live USB. Đặt kích thước là 0 để bỏ phân vùng cố định.\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"Chọn đơn vị kích thước cho phân vùng.\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"Không hiển thị lại thông báo này\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"Chú ý quan trọng về %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"Bạn vừa mới tạo ổ đĩa sử dung UEFI:NTFS bootloader. Hãy nhớ rằng để khởi động được đĩa này BẠN PHẢI VÔ HIỆU SECURE BOOT.\\n\"\n\"Để hiểu tại sao nó quan trọng, xem trong phần 'Thông tin thêm' phía dưới.\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Chọn file ảnh Windows\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"File ISO này chứa nhiều tệp ảnh Windows.\\n\"\n\"Hãy chọn tệp ảnh bạn muốn sử dung cho việc cài đặt này:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"Có một chương trình hoặc tiến trình khác đang truy cập ổ. Bạn vẫn muốn định dạng ổ đĩa?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus nhận thấy bạn đang cố gắng tạo ổ đĩa Windows To Go dựa vào ISO phiên bản 1809.\\n\"\n\"\\n\"\n\"Bởi vì một *LỖI CỦA MICROSOFT*, ổ đĩa này sẽ bị lỗi trong quá trình khởi động Windows (Màn hình xanh chết chóc), trừ khi bạn thay thế thủ công file 'WppRecorder.sys' của phiên bản 1803.\\n\"\n\"\\n\"\n\"Cũng xin lưu ý rằng Rufus không thể tự động sửa lỗi này vì file 'WppRecorder.sys' thuộc bản quyền của Microsoft, vì vậy chúng tôi không thể nhúng file này vào chương trình...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"Bởi vì MBR được chọn để định dạng phân vùng, Rufus chỉ có thể tạo phân vùng tới 2 TB cho ổ đĩa này, việc này sẽ bỏ phí %s không được sử dung.\\n\"\n\"\\n\"\n\"Bạn có muốn tiếp tục?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"Phiên bản\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"Phát hành\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"Chế bản\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"Ngôn ngữ\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"Kiến trúc\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"Tiếp tục\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"Quay lại\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"Vui lòng đợi...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"Tải bằng trình duyệt\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"Việc tải các tệp ISO Windows không có sẵn bởi Microsoft đã chỉnh lại trang web của họ để chống lại điều này.\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"Yêu cầu phiên bản PowerShell 3.0 hoặc cao hơn để chạy đoạn mã này.\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"Bạn có muốn kết nối Internet và tải nó?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"Đang chạy đoạn mã tải file...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"Tải tệp tin ISO\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"Loại máy tính mà bạn định sử dung với ổ có thể khởi động này. Bạn có trách nhiệm phải tìm hiểu máy đó là kiểu BIOS hay UEFI trước khi bạn tạo ổ đĩa, bởi nó có thể bị lỗi khi khởi động.\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' nghĩa là thiết bị chỉ có thể boot ở chế độ giả lập BIOS (hay còn gọi là 'Legacy Mode') bên trong chế độ UEFI, và nó không phải là chế độ thuần UEFI.\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'non CSM' nghĩa là thiết bị chỉ có thể boot ở chế độ thuần UEFI mà không phải chế độ giả lập BIOS (hay còn gọi là 'Legacy Mode')\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"Mẫu thử: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"Mẫu thử: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Mẫu thử: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"Mẫu thử: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"Đặt loại hệ thống tập tin\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"Kích thước tối thiểu của khối dữ liệu sẽ chiếm dụng trong hệ thống tập tin\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"Dùng trường này để đặt tên đĩa.\\n\"\n\"Các ký tự quốc tế được chấp nhận.\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"Bật/tắt các tuỳ chọn nâng cao\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"Kiểm tra thiết bị tìm khối lỗi bằng mẫu kiểm tra\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"Bỏ chọn mục này để dùng cách định dạng \\\"chậm\\\"\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"Cách thức để tạo phân vùng\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"Cách thức để tạo ổ đĩa có thể khởi động\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"Nhấn để chọn hoặc tải file ảnh...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"Chọn mục này để cho phép hiện tên ổ đĩa toàn hệ thống và đặt biểu tượng thiết bị (khởi tạo autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"Cài đặt bộ khởi động UEFI, cùng với việc tiến trình xác thực MD5Sum của phương tiện\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"Tạo một phân vùng ẩn khác và thử sắp xếp ranh giới phân vùng.\\n\"\n\"Điều này có thể cải thiện khả năng phát hiện khởi động cho BIOS cũ.\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"Bật hiển thị các ổ cứng gắn ngoài qua USB. TỰ CHỊU RỦI RO KHI SỬ DỤNG!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"Bắt đầu hoạt động định dạng.\\n\"\n\"Việc này sẽ TIÊU HUỶ mọi dữ liệu trên đĩa đã chọn!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"Chữ kí tải xuống không hợp lệ\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"Nhấn để chọn...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - Tiện ích Định dạng USB Đáng tin cậy\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"Phiên bản %d.%d (Bản dựng %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"Bản dịch Tiếng Việt:\\\\line• thanhtai2009 <mailto:thanhtai2009@outlook.com>\\\\line• caobach <mailto:caobach@gmail.com>\\\\line• Nguyễn Quang Minh (MinhNQ101) <mailto:admin@quangminh.name.vn>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Báo lỗi hoặc yêu cầu cải tiến tại:\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"Các bản quyền bổ sung:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"Chính sách cập nhật:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"Nếu bạn chọn cho phép chương trình này kiểm tra cập nhật ứng dụng, bạn đồng ý rằng những thông tin dưới đây có thể được thu thập trên (các) máy chủ của chúng tôi:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"Kiến trúc và phiên bản hệ điều hành của bạn\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"Phiên bản của ứng dụng bạn đang dùng\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"Địa chỉ IP của bạn\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"Vì mục đích tạo thống kê sử dụng riêng tư, chúng tôi có thể giữ thông tin đã thu thập, \\\\b tối đa một năm\\\\b0 . Tuy nhiên, chúng tôi sẽ không tiết lộ bất kỳ dữ liệu cá nhân nào cho bên thứ ba.\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"Tiến trình cập nhật:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus không cài đặt hoặc chạy dịch vụ nền, do đó việc kiểm tra cập nhật chỉ được thực hiện khi ứng dụng chính đang chạy.\\\\line\\n\"\n\"Quyền truy cập Internet dĩ nhiên cần thiết khi kiểm tra cập nhật.\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"Tệp tin không hợp lệ cho tuỳ chọn khởi động đã chọn\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"Tệp tin hiện tại không hợp với tuỳ chọn khởi động đã chọn. Vui lòng chọn tệp hoặc tuỳ chọn khởi động khác.\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"Tệp ISO không tương thích với hệ thống tập tin đã chọn\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"Phát hiện ổ đĩa không tương thích\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"Ghi đã đạt\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"Đọc đã đạt\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"Đã tải xuống %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"Không thể tải xuống %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"Dùng phiên bản (các) tập tin %s được nhúng sẵn\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"QUAN TRỌNG: ĐĨA NÀY DÙNG KÍCH CỠ CUNG KHÔNG CHUẨN!\\n\"\n\"\\n\"\n\"Ổ cứng thông thường dùng kích cỡ cung 512-byte nhưng ổ đĩa này lại dùng %d byte. Trong nhiều trường hợp, điều này có nghĩa bạn sẽ KHÔNG thể khởi động từ ổ đĩa này.\\n\"\n\"Rufus có thể thử tạo một ổ đĩa khởi động, nhưng KHÔNG ĐẢM BẢO rằng nó sẽ hoạt động.\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"Phát hiện kích cỡ cung không chuẩn\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go chỉ có thể được cài đặt trên ổ đĩa đã phân vùng GPT nếu nó có tập thuộc tính CỐ ĐỊNH. Ổ đĩa hiện tại không phải CỐ ĐỊNH.\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"Tính năng này không khả dụng trên nền tảng này.\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"Đang huỷ - Vui lòng chờ...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"Đang quét tệp...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"Không thể quét tệp\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"Đã phát hiện %s lỗi thời\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"Đang dùng tệp: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"Thiếu tập tin %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"O_DIA_MOI\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"Phát hiện %d thiết bị\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"Phát hiện %d thiết bị\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"SẴN SÀNG\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"Đã huỷ\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"Thất bại\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"Đang khởi chạy ứng dụng mới...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"Không thể khởi chạy ứng dụng mới\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"Đã mở %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"Đã lưu %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"Đang định dạng: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"Đang tạo hệ thống tập tin: Tác vụ đã hoàn tất %d/%d\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"Sắp xếp NTFS: %d%% đã hoàn thành\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"Đang định dạng (%s) - thời gian dự kiến %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"Đang đặt tên (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"Đang định dạng (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"Sắp xếp NTFS (Kiểm tra đĩa)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"Đang xoá cấu trúc MBR/PBR/GPT...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"Đang yêu cầu truy cập đĩa...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"Đang phân tích bản ghi khởi động đang có...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"Đang đóng ổ đang có...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"Đang ghi bản ghi khởi động chính...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"Đang ghi bản ghi khởi động phân vùng...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"Đang chép các tập tin DOS...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"Đang chép các tập tin ISO: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"Cài đặt khởi động Win7 EFI (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"Đang hoàn thiện, vui lòng chờ...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Đang cài đặt Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"Khối hỏng: %s %d/%d - %0.2f%% (%d/%d/%d lỗi)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"Khối hỏng: Kiểm tra với mẫu ngẫu nhiên\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"Khối hỏng: Kiểm tra với mẫu 0x%02X\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"Đang phân vùng (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"Đang xoá phân vùng (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Chữ kí cho bản cập nhật không thể chứng thực. Lỗi này có thể do hệ thống của bạn không được cấu hình chuẩn để chứng thực chữ ký hoặc bản tải bị lỗi.\\n\"\n\"\\n\"\n\"File tải sẽ bị xóa. Kiểm tra log để biết thêm thông tin.\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"Đang tải xuống: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"Không thể tải xuống tập tin.\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"Đang kiểm tra cập nhật Rufus...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"Cập nhật: Không thể kết nối với Internet\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"Cập nhật: Không thể truy cập dữ liệu phiên bản\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"Đã có phiên bản mới của Rufus!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"Không tìm thấy phiên bản mới của Rufus\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Đã xoá các khoá registry của ứng dụng thành công\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Không thể xoá các khoá registry của ứng dụng\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s được kích hoạt\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s bị vô hiệu\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"Kiểm tra kích cỡ\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"Phát hiện đĩa cứng\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"Buộc định dạng FAT32 lớn\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"NoDriveTypeAutorun sẽ bị xoá khi thoát\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"Phát hiện ổ đĩa giả\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Hỗ trợ Joliet\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Hỗ trợ Rock Ridge\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"Buộc cập nhật\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"Nén NTFS\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"Ghi tệp: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"Hỗ trợ ISO\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"Dùng đơn vị kích cỡ ĐÚNG\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"Đang xoá thư mục '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"Phát hiện đĩa VMWare\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"Chế độ Dual UEFI/BIOS\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"Đang áp dụng tệp Windows: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"Đang áp dụng tệp Windows...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"Giữ dấu thời gian\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"Gỡ rối USB\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"Đang tính toán kiểm tổng tệp: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"Tính toán giá trị tổng kiểm tra MD5, SHA1 và SHA256 với tệp đã chọn\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"Thay đổi ngôn ngữ ứng dụng\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"Đã phát hiện tệp %s\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"Tệp bạn đã chọn là một tệp 'ISOHybrid'. Điều này có nghĩa nó có thể được ghi trong chế độ %s (chép tập tin) hoặc %s (tệp đĩa).\\n\"\n\"Rufus khuyến cáo sử dụng chế độ %s, để bạn luôn có toàn quyền truy cập ổ đĩa sau khi ghi nó.\\n\"\n\"Tuy nhiên, nếu bạn gặp vấn đề trong lúc khởi động, bạn có thể thử ghi lại tệp này trong chế độ %s.\\n\"\n\"\\n\"\n\"Hãy chọn chế độ mà bạn muốn dùng để ghi tệp này:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"Ghi với chế độ %s (Khuyến cáo)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"Ghi với chế độ %s\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"Đang kiểm tra các tiến trình xung đột...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"Không có khả năng khởi động\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"Đĩa hoặc tệp tin ISO\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (Vui lòng chọn)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"Chặn truy cập ổ USB từ chương trình khác\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"Chữ ký không hợp lệ\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"Tập tin thực thi đã tải xuống thiếu chữ ký số.\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"Tập tin thực thi đã tải xuống được ký bởi '%s'.\\n\"\n\"Đây không phải chữ ký số chúng tôi công nhận và có thể xác định là một dạng hoạt động nguy hiểm...\\n\"\n\"Bạn chắc muốn chạy tập tin này?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"Đang ghi đè giá trị 0 lên ổ: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"Phát hiện ổ đĩa tháo được không phải USB\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"Thiếu quyền quản trị\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"Ứng dụng này chỉ có thể chạy với đặc quyền quản trị\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"Lập chỉ mục tập tin\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"Chọn phiên bản\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"Hãy chọn phiên bản Windows bạn muốn cài đặt:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"Phiên bản Windows không được hỗ trợ\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Phiên bản này của Windows không còn được Rufus hỗ trợ nữa.\\n\"\n\"Phiên bản cuối cùng của Rufus tương thích với nền tảng này là v%d.%d.\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"Cảnh báo: Phiên bản không chính thức\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"Phiên bản Rufus này KHÔNG PHẢI do chính tác giả tạo ra.\\n\"\n\"\\n\"\n\"Bạn chắc muốn tiếp tục chạy chứ?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"Đã phát hiện ISO bị cắt xén\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"Tập tin ISO bạn đã chọn không trùng khớp kích cỡ của nó: thiếu mất %s dữ liệu!\\n\"\n\"\\n\"\n\"nếu bạn tải tập tin này từ Internet, bạn nên tải lại một bản sao mới và xác nhận rằng mã MD5 hoặc SHA trùng khớp với bản chính thức.\\n\"\n\"\\n\"\n\"Hãy nhớ rằng bạn có thể tính mã MD5 hoặc SHA trong Rufus bằng cách chọn nút (✓).\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"Lỗi xác thực dấu thời gian\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus không thể xác thực liệu dấu thời gian trên phiên bản cập nhật được tải xuống gần đây có mới hơn so với phiên bản đang chạy.\\n\"\n\"\\n\"\n\"Để tránh nguy cơ bị tấn công tiềm ẩn, quá trình cập nhật đã bị hủy và file tải sẽ bị xóa. Hãy kiểm tra log để biết thêm thông tin.\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"Hiển thị cài đặt chương trình\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"Hiện thông tin về chương trình\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"Hiển thị log\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"Tạo file ảnh ổ đĩa từ thiết bị được chọn\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"Sử dụng tùy chọn này để chỉ thị rằng hoặc bạn muốn cài Windows lên một ổ đĩa khác, hoặc nếu bạn muốn chạy Windows trực tiếp từ thiết bị này (Windows To Go).\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"Đang ghi đè nhanh giá trị 0 lên ổ đĩa: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"điều này có thể mất một thời gian\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"phát hiện VHD\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"Lưu trữ đã nén\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"ISO bạn đã chọn sử dụng UEFI và đủ nhỏ để ghi dưới dạng Phân vùng hệ thống EFI (ESP). Ghi vào một ESP, thay vì ghi vào một phân vùng dữ liệu chung chiếm toàn bộ đĩa, có thể thích hợp hơn đối với một số loại cài đặt.\\n\"\n\"\\n\"\n\"Vui lòng chọn chế độ mà bạn muốn sử dụng để viết hình ảnh này:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"Sử dụng %s (tại cửa sổ chính của phần mềm) để thực thi.\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"Các băm thêm (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"Lưu vào VHD\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"Đang tính tổng kiểm cùa tệp\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"Nhiều nút\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"Số lượng đã đạt\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"ID ổ đĩa\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"Mặc định thứ tự ưu tiên luồng: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"Bỏ qua đánh dấu khởi động\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"Đang làm mới bố cục phân vùng (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"Hình ảnh bạn đã chọn là một ISOHybrid, nhưng những người tạo ra nó đã không làm cho nó tương thích với chế độ sao chép ISO/Tệp.\\n\"\n\"Do đó, chế độ ghi hình ảnh DD sẽ được thực thi.\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"Không thể mở hoặc đọc '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"Đang áp dụng tuỳ biến Windows: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"Đang áp dụng các cài đặt người dùng...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"Tuỳ biến cài đặt Windows?\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"Loại bỏ yêu cầu 4GB+ RAM, Secure Boot và TPM 2.0\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"Loại bỏ yêu cầu tài khoản Microsoft trực tuyến\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"Loại bỏ thu thập thông tin (Bỏ qua các câu hỏi riêng tư)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"Ngăn cản Windows To Go truy cập ổ đĩa trong\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"Tạo tài khoản nội bộ với tên người dùng:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"Đặt các cài đặt địa phương cùng giá trị với người dùng hiện tại\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"Vô hiệu tự động mã hoá thiết bị BitLocker\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"Nhật ký lưu vĩnh viễn\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Một tệp tin bổ sung ('diskcopy.dll') phải được tải về từ Microsoft để cài đặt MS-DOS:\\n\"\n\"- Chọn 'Có' để kết nối tới Internet và tải nó xuống\\n\"\n\"- Chọn 'Không' để huỷ tiến trình\\n\"\n\"\\n\"\n\"Ghi chú: Tệp tin sẽ được tải xuống tại đường dẫn của phần mềm và sẽ được tự động tái sử dụng nếu có sẵn.\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"Đã phát hiện bộ khởi động UEFI bị thu hồi\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus đã phát hiện ra rằng tệp ISO bạn đã chọn có chứa một bộ khởi động UEFI đã bị thu hồi và nó sẽ tạo ra %s, khi Secure Boot được kích hoạt trên một hệ thống UEFI được cập nhật đầy đủ và mới nhất.\\n\"\n\"\\n\"\n\"- Nếu bạn sở hữu tệp ISO này từ một nguồn không đáng tin cậy, bạn nên cân nhắc khả năng có thể chứa mã độc UEFI và tránh khởi động từ nó.\\n\"\n\"- Nếu bạn sở hữu từ một nguồn uy tín, bạn nên thử tìm một bản mới hơn, theo đó cảnh báo này sẽ không hiện ra.\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"một màn hình \\\"Vi phạm Bảo mật\\\"\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"một Màn hình Khôi phục Windows (BSOD) với '%s'\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"Tệp VHDX đã nén\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"Tệp VHD chưa nén\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"Ghi Đầy đủ Tệp Cập nhật\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"Một vài dữ liệu phải được tải xuống từ Microsoft để sử dụng tính năng này:\\n\"\n\"- Chọn 'Có' để kết nối tới Internet và tải xuống nó\\n\"\n\"- Chọn 'Không' để huỷ tiến trình\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"Giới hạn Windows vào S-Mode (KHÔNG TƯƠNG THÍCH với việc bỏ qua tài khoản trực tuyến)\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"Chế độ Chuyên nghiệp\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"Đang giải nén tệp lưu trữ: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"Sử dụng Rufus MBR\"\n\n#. • MSG_350\nmsgid \"Use 'Windows UEFI CA 2023' signed bootloaders [EXPERIMENTAL]\"\nmsgstr \"Sử dụng bootloader đã được ký bởi chứng chỉ “Windows UEFI CA 2023” (TÍNH NĂNG THỬ NGHIỆM)\"\n\n#. • MSG_351\nmsgid \"Checking for UEFI bootloader revocation...\"\nmsgstr \"Đang kiểm tra trạng thái thu hồi của bootloader UEFI...\"\n\n#. • MSG_352\nmsgid \"Checking for UEFI DBX updates...\"\nmsgstr \"Đang kiểm tra cập nhật cơ sở dữ liệu chặn (DBX) của UEFI…\"\n\n#. • MSG_353\nmsgid \"DBX update available\"\nmsgstr \"Đã phát hiện bản cập nhật DBX của UEFI\"\n\n#. • MSG_354\nmsgid \"\"\n\"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\\n\"\n\"- Select 'Yes' to connect to the Internet and download this content\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"Rufus đã phát hiện phiên bản cập nhật của các tệp DBX, được dùng để kiểm tra thu hồi Secure Boot trong UEFI. Bạn có muốn tải bản cập nhật này không?\\n\"\n\"- Chọn “Có” để kết nối Internet và tải nội dung này.\\n\"\n\"- Chọn “Không” để hủy thao tác.\\n\"\n\"\\n\"\n\"Lưu ý: Các tệp sẽ được tải về thư mục của ứng dụng và sẽ tự động được sử dụng lại nếu đã có sẵn.\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus là một tiện ích giúp định dạng và tạo khả năng khởi động cho các thiết bị USB, ví dụ như thẻ USB/đĩa di động, thẻ nhớ, v.v...\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"Trang web chính thức: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"Mã nguồn: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"Nhật ký thay đổi: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"Phần mềm này đã được cấp phép dưới các điều khoản của GNU Public License (GPL) phiên bản 3.\\n\"\n\"Xem tại https://www.gnu.org/licenses/gpl-3.0.html để biết thêm chi tiết.\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"Khởi động\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"Định dạng USB, thẻ nhớ hoặc ổ nhớ ảo với FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"Tạo USB có thể khởi động với FreeDOS\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"Tạo ổ đĩa có thể khởi động từ các file ISO có thể khởi động (Windows, Linux, v.v...)\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"Tạo ổ đĩa có thể khởi động từ các tệp đĩa có thể khởi động, bao gồm cả tệp nén\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"Tạo ổ đĩa có thể khởi động với hệ thống BIOS hoặc UEFI, bao gồm cả NTFS có thể khởi động với UEFI\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"Tạo ổ đĩa 'Windows To Go'\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"Tạo ổ đĩa cài đặt Windows 11 cho các máy tính không có TPM hoặc Secure Boot\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"Tạo phân vùng Linux liên tục\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"Tạo tệp VHD/DD từ ổ đĩa đã chọn\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"Tính tổng kiểm MD5, SHA-1, SHA-256 và SHA-512 của tệp đã chọn\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"Thực hiện kiểm tra điểm lỗi, bao gồm phát hiện ổ đĩa \\\"giả\\\"\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"Tải xuống các tệp Microsoft Windows ISO bán lẻ chính thức\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"Tải xuống các tệp UEFI Shell ISO\"\n"
  },
  {
    "path": "res/loc/po/zh-CN.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-04-28 10:38+0800\\n\"\n\"PO-Revision-Date: 2024-04-28 10:59+0800\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: zh_CN\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Chinese Simplified (简体中文)\\n\"\n\"X-Rufus-LCID: 0x0804, 0x1004\\n\"\n\"X-Generator: Poedit 3.4.2\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"设备选项\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"设备\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"引导类型选择\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"选择\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"镜像选项\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"分区类型\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"目标系统类型\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"显示 USB 外置硬盘\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"添加对旧 BIOS 修正(额外的分区，校准等)\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"启用运行时 UEFI 介质验证\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"格式化选项\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"文件系统\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"簇大小\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"卷标\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"快速格式化\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"检查设备坏块\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"创建扩展的标签和图标文件\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"状态\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"关闭\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"开始\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"关于 Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"许可\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"确定\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus 许可\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"更多信息\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"是\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"否\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"日志\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"清除\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"保存\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"更新策略和设置\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"设置\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"检查更新\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"包括测试版本\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"立即检查\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"检查更新 - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"有更新版本可用。请下载最新版本！\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"点击这里转到网站\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"发行说明\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"下载\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"检测到其它进程\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"另一个 Rufus 应用程序正在运行。\\n\"\n\"请在运行另一个应用程序前关闭第一个程序。\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"警告：设备 '%s' 上的所有数据将会被清除。\\n\"\n\"要继续本操作，请点击【确定】。要退出点击【取消】。\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus 更新策略\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"你是否允许 Rufus 联网检查程序更新？\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"取消\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"检测到坏块\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"检查完成：找到 %d 个坏块\\n\"\n\"  %d 个读取错误\\n\"\n\"  %d 个写入错误\\n\"\n\"  %d 个损坏错误\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"详细的报告位于：\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"禁用\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"每日\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"每周\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"每月\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"自定义\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"你的版本：%d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"最新版本：%d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"字节\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"K 字节\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"M 字节\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"默认\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (默认)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (或 UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (非 CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS 或 UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d 遍\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d 遍 %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO 镜像\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"程序\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"中止\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"启动\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"操作被用户取消\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"错误\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"错误：%s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"文件下载\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB 存储设备(通用)\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (磁盘 %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"多分区磁盘\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - 刷新缓冲区\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - 取消\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"成功。\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"未知格式化错误。\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"本介质不能使用选择的文件系统。\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"设备被拒绝访问。\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"介质被写保护。\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"设备正在被另一个使用中。请关闭可能访问设备的任意其它进程。\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"本设备不可使用快速格式化。\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"卷标无效。\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"设备句柄无效。\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"选择的簇大小对本设备来说无效。\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"卷大小无效。\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"请在驱动器中插入可移动介质。\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"接收到一个不被支持的命令。\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"内存分配错误。\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"读取错误。\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"写入错误。\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"安装失败\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"不能打开介质。可能是其他进程正在使用该设备。请重新插入设备后再试。\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"无法划分驱动器分区。\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"无法复制文件到目标驱动器。\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"用户取消操作。\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"不能创建线程。\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"坏块检查未完成。\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"ISO 镜像扫描失败。\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"ISO 镜像提取失败。\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"不能重新装载卷。\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"不能补丁/安装用于引导的文件。\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"不能指派盘符。\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"未能装载 GUID 卷。\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"设备没有准备好。\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus 检测到 Windows 仍在把它的内部缓冲区刷到 USB 设备上。\\n\"\n\"\\n\"\n\"根据你的 USB 设备的速度，此操作可能需要很长时间才能完成，尤其是大文件。\\n\"\n\"\\n\"\n\"我们建议你让 Windows 完成，避免数据损坏。但是如果你厌倦了等待的话，你可以就那样拔出设备...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"不支持的镜像\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"\"\n\"本镜像是不可引导的，或者使用了不被 Rufus 所支持的引导或压缩方式...\\n\"\n\"本版本 Rufus 仅支持基于 bootmgr, EFI, Grub4DOS, GRUB 2, isolinux 或 WinPE 的启动 ISO 镜像。\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"替换 %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"这个 ISO 镜像似乎使用一个过时的 '%s' 版本。\\n\"\n\"引导菜单可能因此而无法正常显示。\\n\"\n\"\\n\"\n\"Rufus 可以下载更新的版本来修复这个问题：\\n\"\n\"- 选择【是】连接网络并下载文件\\n\"\n\"- 选择【否】保留现有的 ISO 文件不变\\n\"\n\"如果不知道如何选择，请选择【是】。\\n\"\n\"\\n\"\n\"注意：新文件将会下载到当前目录，一旦 '%s' 存在则会被自动选用。\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"下载 %s 中\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"未选择镜像\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"对 %s 闪存\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"镜像文件过大\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"镜像对于选择目标来说太大。\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"不支持的 ISO\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"\"\n\"当使用 UEFI 目标类型时，只支持 EFI 可引导的 ISO 镜像。\\n\"\n\"请选择一个 EFI 可引导的 ISO 镜像，或设置“目标类型”为 BIOS。\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"不支持的文件系统\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"警告：本盘包含多分区！\\n\"\n\"\\n\"\n\"这个可能包含在 Windows 中无法列出甚至看到的分区/卷。如果你想继续操作可能造成这些分区上的数据丢失，后果自负。\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"检测到多分区磁盘\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD 镜像\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"当前选择的文件系统不能配合这个类型的 ISO 使用。请选择一个不同的文件系统或者使用不同的 ISO。\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' 仅适用于 NTFS 文件系统。\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"重要事项: 你正在尝试安装 'Windows To Go'，然而你的目标盘没有 'FIXED' (固定)属性。因此，Windows 在引导时将很可能冻住，因为微软并没有针对配合拥有 'REMOVABLE' (可移动)属性的驱动器使用而设计。\\n\"\n\"\\n\"\n\"你是否仍想继续?\\n\"\n\"\\n\"\n\"注意: 'FIXED/REMOVABLE' 属性是尽可以使用来自驱动器制造商的定制工具更改的硬件性质。尽管如此，那些工具几乎永远不会公开提供...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"文件系统限制\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"这个 ISO 镜像包含大于 4 GB 的文件，超出了 FAT/FAT32 文件系统所允许的最大尺寸。\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"缺少 WIM 支持\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"\"\n\"你的平台不能从 WIM 镜像提取文件。创建 EFI 可引导的 Windows 7 或 Windows Vista USB 盘需要 WIM 提取功能。你可以通过安装最新版本的 7-Zip 来解决这个问题。\\n\"\n\"你是否想访问 7-Zip 下载网页？\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"下载 %s 吗？\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s 或更新版本需要同时安装一个 '%s' 文件。\\n\"\n\"由于这个文件尺寸大于 100 KB 且总是存在于 %s ISO 镜像上，而未内置于 Rufus 中。\\n\"\n\"\\n\"\n\"Rufus 可以为你下载缺少的文件：\\n\"\n\"- 选择【是】则连接网络互联网并下载文件\\n\"\n\"- 选择【否】则你自己稍后自行下载到磁盘\\n\"\n\"\\n\"\n\"注意：文件将会在当前目录中下载，一旦 '%s' 文件存在，则它将会被自动选用。\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"现在取消可能导致设备处于不稳定状态。\\n\"\n\"如果你确定你想取消，请点击【是】。否则点击【否】。\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"请选择文件夹\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"全部文件\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus 日志\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (磁盘 %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS 无法从 64 KB 簇大小磁盘启动。\\n\"\n\"请更改簇大小或改用 FreeDOS。\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"不兼容的簇大小\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"格式化一个大 UDF 卷可能需要很长时间。以 USB 2.0 速度预计剩余时间：%d:%02d，在此期间进度条可能会呈禁止状态。请耐心等待！\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"大容量 UDF 卷\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"这个镜像使用 Syslinux %s%s，而本程序仅包含 Syslinux %s%s 的安装文件。\\n\"\n\"\\n\"\n\"由于新版本的 Syslinux 和其它版本的不能兼容，而 Rufus 也不可能包括它们全部，需要从互联网下载两个额外的文件('ldlinux.sys' 和 'ldlinux.bss'):\\n\"\n\"- 选择 '是' 连接网络并下载这些文件\\n\"\n\"- 选择 '否' 取消此项操作\\n\"\n\"\\n\"\n\"注意：文件将会被下载到当前应用程序目录，如果存在则会自动选用。\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"需要下载\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"本镜像使用 Grub %s 而应用程序只包含 Grub %s 的安装文件。\\n\"\n\"\\n\"\n\"由于不同版本的 Grub 彼此不能兼容，而且不可能包含它们全部，Rufus 将尝试定位一个匹配来自你的镜像的 Grub 版本的 Grub 安装文件('core.img'):\\n\"\n\"- 选择【是】则连接到互联网并尝试下载它\\n\"\n\"- 选择【否】则使用来自 Rufus 的默认版本\\n\"\n\"- 选择【取消】则放弃操作\\n\"\n\"\\n\"\n\"注意: 文件将会在当前应用程序目录下载，而如果存在的话则将会自动使用它。如果在线找不到匹配的，那么将会使用默认的版本。\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"标准 Windows 安装\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"高级设备选项\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"高级格式化选项\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"显示%s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"隐藏%s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"持久分区大小\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"无持久分区\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"设置Live USB驱动器的持久分区大小。设置为零将禁用持久分区。\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"设置分区大小单位。\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"不再显示此消息\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"关于 %s 的重要提示\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"您刚刚创建了使用 UEFI:NTFS 引导方式的驱动器。请注意您必须禁用安全启动(Secure Boot)以从此驱动器启动。\\n\"\n\"欲了解详情，请点击下方的'更多信息'按钮。\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows 镜像选择\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"本 ISO 文件包含多个 Windows 镜像。\\n\"\n\"请选择要使用的镜像：\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"另一程序正在使用此驱动器。您仍然要格式化它吗？\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus 检测到您正在使用 1809 版本的 ISO 文件创建 Windows To Go 驱动器。\\n\"\n\"\\n\"\n\"由于微软的程序故障，本驱动器启动 Windows 时将出现蓝屏崩溃，除非您手动将 'WppRecorder.sys' 文件替换为 1803 镜像中的版本。\\n\"\n\"\\n\"\n\"由于 'WppRecorder.sys' 是微软的版权文件，Rufus 无法包含此文件来自动为您修复此问题。\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"由于选择了 MBR 分区方式，在此驱动器上 Rufus 只能创建不大于 2 TB 的分区，这会导致 %s 的大小无法使用。 \\n\"\n\"\\n\"\n\"您确定要继续吗？\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"版本\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"发行\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"类型\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"语言\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"处理器架构\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"继续\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"返回\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"请稍等...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"使用浏览器下载\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"由于短时间内下载过多，已被微软临时封禁。请稍后再试。\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"此脚本依赖于 PowerShell 3.0 或更新版本。\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"您想要下载它吗？\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"正在运行下载脚本...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"下载 ISO 镜像\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"请选择您计算机支持的启动类型，如 BIOS 或 UEFI，否则启动可能会失败。\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' 指设备只会在 UEFI 系统的经典模式(Legacy Mode)下启动，不会在原生模式(UEFI Mode)下启动。\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'非 CSM' 指设备只会在 UEFI 系统的原生模式(UEFI Mode)下启动，不会在经典模式(Legacy Mode)下启动。\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"测试模式：0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"测试模式：0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"测试模式：0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"测试模式：0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"设置目标文件系统\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"文件系统的数据块最少占用大小\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"使用本框以设置驱动器卷标。\\n\"\n\"支持国际字符。\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"切换高级选项\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"使用测试模式检查设备坏块\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"取消本复选框使用\\\"慢速\\\"完全格式化方式\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"用于创建分区的方法\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"用于使驱动器可引导的方法\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"点击以选择或下载镜像...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"勾选本框允许国际卷标的显示并设置一个设备图标(创建一个 autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"安装 UEFI 引导加载器，该加载器将对介质进行 MD5 校验\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"创建一个额外的隐藏分区并尝试对齐分区分界。\\n\"\n\"这个可提高旧 BIOS 的引导检测率。\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"\"\n\"启用涵盖 USB 硬盘的显示\\n\"\n\"***请谨慎使用，后果自负！***\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"开始格式化操作。\\n\"\n\"这将会清除目标设备上的任何数据！\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"下载文件签名校验失败\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"点击选择...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - 可靠的 USB 格式化工具\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"版本 %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"简体中文翻译者：佚名、HRxiaohu、就不告诉你\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"报告错误或请求新功能：\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"更多版权信息：\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"更新策略：\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"如果你选择允许本程序检查应用程序更新，那么表示您同意被我们的服务器收集以下信息：\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"你的操作系统的架构和版本\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"你使用的应用程序的版本\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"您的 IP 地址\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"为了生成专用的使用情况统计，所收集的资料\\\\b最多保存一年\\\\b0。绝不会主动将资料提供给第三方。\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"更新进程：\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"\"\n\"Rufus 没有安装或运行后台服务，因此更新检查仅在主程序运行时进行。\\\\line\\n\"\n\"当然检查更新时需要网络连接。\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"镜像对选择的引导选项无效\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"当前镜像不匹配选择的引导选项。请使用不同的镜像或选择不同的引导选项。\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"这个 ISO 镜像不兼容选择的文件系统\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"检测到不兼容的驱动器\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"写入次数\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"读取次数\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"已下载 %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"不能下载 %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"使用 %s 文件的嵌入版本\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"重要事项: 本驱动器使用了非标准的扇区大小!\\n\"\n\"\\n\"\n\"传统的驱动器使用 512 字节扇区大小而本驱动器使用 %d 字节的扇区。在许多情况下，这意味着你将不可以从本驱动器引导。\\n\"\n\"Rufus 可以尝试创建一个可引导驱动器，但是不保证它有效。\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"检测到非标准扇区大小\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' 只可以在一个 GPT 分区的拥有 FIXED 属性设置的驱动器上安装当前驱动器没有被检测为 FIXED(固定盘)。\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"此功能在此平台上不可用。\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"取消中 - 请稍候...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"正在扫描镜像...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"未能扫描镜像\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"检测到过时的 %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"正在使用镜像：%s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"缺少 %s 文件\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"新加卷\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"检测到 %d 个设备\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"检测到 %d 个设备\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"准备就绪\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"已取消\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"操作失败\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"正在启动新程序...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"未能启动新程序\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"已打开 %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"已保存 %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"正在格式化: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"正在创建文件系统：已完成 %d/%d 项任务\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"修复 NTFS：已完成 %d%%\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"正在格式化 (%s) - 估计剩余时间 %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"正在设置卷标 (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"正在格式化 (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"修复 NTFS (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"正在清除 MBR/PBR/GPT 架构...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"正在请求磁盘访问...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"正在分析现有引导记录...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"正在关闭现有卷...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"正在写入主引导记录...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"正在写入分区引导记录...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"正在复制 DOS 文件...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"正在复制 ISO 文件: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"正在安装 Win7 EFI 引导 (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"完成中，请稍候...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"正在安装 Syslinux %s...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"检查坏块：%s 第 %d/%d 遍 - %0.2f%% (%d/%d/%d 错误)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"检查坏块：正在使用随机模式测试\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"检查坏块：正在使用模式 0x%02X 测试\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"正在分区 (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"正在删除分区 (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"下载的更新签名校验失败，这表明您的系统配置异常或收到恶意攻击。\\n\"\n\"\\n\"\n\"下载文件已被删除。详细信息请查看日志。\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"正在下载: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"未能下载文件。\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"正在检查 Rufus 更新...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"更新：无法连接到网络\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"更新：无法访问版本数据\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"检查到可用的新版本 Rufus！\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"找不到新版本的 Rufus\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"已成功删除程序注册表键\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"未能删除程序注册表键\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s 已启用\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s 已禁用\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"大小检查\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"硬盘检测\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"强制大 FAT32 格式化\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"在退出时将会删除 NoDriveTypeAutorun 注册表键\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"检测扩容盘\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet 支持\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge 支持\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"强制更新\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS 压缩\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"正在写入镜像: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO 镜像支持\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"使用恰当的大小单位\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"正在删除目录 '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare 磁盘检测\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"双 UEFI/BIOS 模式\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"正在应用 Windows 镜像: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"正在应用 Windows 镜像...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"保留时间标记\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB 调试\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"正在计算镜像校验和: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"计算所选镜像的 MD5, SHA1 和 SHA256 的校验和\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"语言\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"检测到 %s 镜像\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"您选择的镜像是一个 'ISOHybrid' (混合式)镜像。这意味着它可以以%s (文件复制) 模式或 %s (磁盘) 镜像模式写入。\\n\"\n\"Rufus 推荐使用 %s 模式，以便您在写入它之后总是可以对驱动器有完全的访问权。\\n\"\n\"尽管如此，如果您在引导时遇到问题，您可以尝试以 %s 模式再次写入这个镜像。\\n\"\n\"\\n\"\n\"请选择您想用于写入这个镜像所使用的模式:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"以 %s 模式写入(推荐)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"以 %s 模式写入\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"检测冲突进程中...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"非可引导\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"镜像文件\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (请选择)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"独占 USB 驱动器锁定\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"无效签名\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"已下载的可执行文件缺少一个数字签名。\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"已下载的可执行文件是由 '%s' 签署的。\\n\"\n\"这个不是我们能够识别的签名，而且这个可能意味着某种形式的恶意活动...\\n\"\n\"您是否确认您想运行这个文件?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"正在清空磁盘: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"检测非USB的可移除设备\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"缺少管理员权限\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"此程序只能以管理员权限执行\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"文件索引\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"版本选择\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"请选择你要安装的 Windows 版本:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"不支持的 Windows 版本\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Rufus 已不再支持此 Windows 版本。\\n\"\n\"最后一个与此平台兼容的 Rufus 版本为 v%d.%d。\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"警告：非官方版本\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"此版本的 Rufus 不是由官方开发者发布的。\\n\"\n\"\\n\"\n\"您确定要运行它吗？\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"检测到不完整镜像\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"您选择的镜像文件大小与其期望大小不符： %s 数据缺失！\\n\"\n\"\\n\"\n\"如果此镜像文件下载自互联网，请重新下载并校验其 MD5 或 SHA 校验和。\\n\"\n\"\\n\"\n\"您可在 Rufus 中点击 (✓) 键来计算 MD5 或 SHA 校验和。\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"时间戳校验错误\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus 下载的更新比当前程序更旧。\\n\"\n\"\\n\"\n\"为避免可能的攻击，更新已被阻止，下载的更新文件已被删除。如需了解更多，请查看软件日志。\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"设置\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"关于\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"日志\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"创建所选设备的镜像\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"请选择您希望将 Windows 安装至其他驱动器，还是直接从此驱动器运行(即 Windows To Go)。\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"正在快速清空磁盘: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"这可能需要一段时间\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"虚拟硬盘驱动器(VHD)探测\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"压缩文件\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"您选择的 ISO 文件使用了 UEFI 并且足够小，可被写入至 EFI 系统分区(ESP)。写入至 ESP 在某些情况下更好，但会覆写磁盘的全部内容（写入至一般数据分区不会）。\\n\"\n\"\\n\"\n\"请选择此镜像文件的写入方式:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"在应用程序主窗口中按下 %s 以激活。\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"可选哈希校验和 SHA512\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"保存至虚拟硬盘驱动器(VHD)\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"计算镜像校验和\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"多个按钮\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"检查次数\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"磁盘 ID\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"默认线程优先级: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"忽视启动标记(Boot Marker)\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"刷新分区布局 (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"您选择了一个 ISOHybrid 镜像文件，但此文件与 ISO/File 复制模式不兼容。\\n\"\n\"因此强制使用DD镜像写入模式。\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"无法打开或读取 '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"正在应用 Windows 设置: %s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"正在应用用户设置...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows 用户体验\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"自定义 Windows 安装？\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"移除对 4GB+ 内存、安全引导和 TPM 2.0 的要求\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"移除对登录微软账户的要求\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"禁止数据收集 (跳过隐私设置)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"阻止 Windows To Go 访问内部磁盘\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"创建一个使用此用户名的本地账号:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"使用当前用户的区域设置\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"禁用 BitLocker 自动设备加密\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"持久化日志\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"必须从微软下载额外的文件（\\\"diskcopy.dll\\\"），以安装 MS-DOS：\\n\"\n\"- 选择 '是' 连接网络并下载这些文件\\n\"\n\"- 选择 '否' 取消此项操作\\n\"\n\"\\n\"\n\"注意：文件将会被下载到当前应用程序目录，如果存在则会自动选用。\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"检测到被吊销的 UEFI 引导加载器\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus 检测到您选择的 ISO 包含一个已被吊销的 UEFI 引导加载器，当在最新的 UEFI 系统上启用安全启动时，将产生%s。\\n\"\n\"\\n\"\n\"- 如果您从非可信来源获取此 ISO 镜像，则应考虑其中可能包含 UEFI 恶意软件，应当避免启动此镜像。\\n\"\n\"- 如果是从可信来源获取的，则应尝试查找不会产生此警告的最新版本。\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"一个“安全违规”界面\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"一个包含 '%s' 的蓝屏界面\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"压缩的 VHDX 镜像\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"未压缩的 VHD 镜像\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"完整闪存更新镜像\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"使用此功能需要从微软下载一些额外数据:\\n\"\n\"- 选择 '是' 连接网络并下载这些文件\\n\"\n\"- 选择 '否' 取消此项操作\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"将 Windows 限制为 S 模式（与绕过在线账户功能不兼容）\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"专家模式\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"正在解压文件: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"使用 Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus 是一个帮助您格式化并创建可启动 USB 驱动器（如 U 盘和存储卡）的工具。\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"官方网站: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"源代码: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"更新日志: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"本应用采用 GNU 通用公共许可证 (GPL) 第三版。\\n\"\n\"具体许可证见 https://www.gnu.org/licenses/gpl-3.0.zh-cn.html。\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"启动\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"将 U 盘、存储卡或虚拟驱动器格式化为 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"创建 FreeDOS 可启动驱动器\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"从可启动 ISO 文件 (Windows 和 Linux 等) 创建可启动驱动器\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"从可启动硬盘镜像 (包括压缩镜像) 创建可启动驱动器\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"创建 BIOS 或 UEFI 可启动驱动器，包括 UEFI 可启动的 NTFS 驱动器\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"创建 'Windows To Go' 驱动器\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"为没有 TPM 或安全启动功能的电脑创建 Windows 11 安装驱动器\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"创建持久 Linux 分区\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"为选择的驱动器创建 VHD/DD 镜像\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"计算被选择镜像的 MD5、SHA-1、SHA-256 和 SHA-512 校验码\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"执行坏块检查，包括对”假“U盘的检测\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"下载微软官方 Windows 镜像\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"下载 UEFI Shell 镜像\"\n"
  },
  {
    "path": "res/loc/po/zh-TW.po",
    "content": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: 4.5\\n\"\n\"Report-Msgid-Bugs-To: pete@akeo.ie\\n\"\n\"POT-Creation-Date: 2024-05-25 18:11+0800\\n\"\n\"PO-Revision-Date: 2024-05-25 20:05+0800\\n\"\n\"Last-Translator: \\n\"\n\"Language-Team: \\n\"\n\"Language: zh_TW\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Poedit-SourceCharset: UTF-8\\n\"\n\"X-Rufus-LanguageName: Chinese Traditional (正體中文)\\n\"\n\"X-Rufus-LCID: 0x0404, 0x0c04, 0x1404, 0x7c04\\n\"\n\"X-Generator: Poedit 3.4.4\\n\"\n\n#. • IDD_DIALOG → IDS_DRIVE_PROPERTIES_TXT\nmsgid \"Drive Properties\"\nmsgstr \"裝置內容\"\n\n#. • IDD_DIALOG → IDS_DEVICE_TXT\nmsgid \"Device\"\nmsgstr \"裝置\"\n\n#. • IDD_DIALOG → IDS_BOOT_SELECTION_TXT\nmsgid \"Boot selection\"\nmsgstr \"開機模式\"\n\n#. • IDD_DIALOG → IDC_SELECT\nmsgid \"Select\"\nmsgstr \"選擇\"\n\n#. • IDD_DIALOG → IDS_IMAGE_OPTION_TXT\nmsgid \"Image Option\"\nmsgstr \"映像檔選項\"\n\n#. • IDD_DIALOG → IDS_PARTITION_TYPE_TXT\nmsgid \"Partition scheme\"\nmsgstr \"資料分割配置\"\n\n#. • IDD_DIALOG → IDS_TARGET_SYSTEM_TXT\nmsgid \"Target system\"\nmsgstr \"目標系統\"\n\n#. • IDD_DIALOG → IDC_LIST_USB_HDD\nmsgid \"List USB Hard Drives\"\nmsgstr \"顯示 USB 外接硬碟\"\n\n#. • IDD_DIALOG → IDC_OLD_BIOS_FIXES\n#.\n#. It is acceptable to drop the parenthesis () if you are running out of space\n#. as there is a tooltip (MSG_169) providing these details.\nmsgid \"Add fixes for old BIOSes (extra partition, align, etc.)\"\nmsgstr \"相容性模式\"\n\n#. • IDD_DIALOG → IDC_UEFI_MEDIA_VALIDATION\n#.\n#. It is acceptable to drop the \"runtime\" if you are running out of space\nmsgid \"Enable runtime UEFI media validation\"\nmsgstr \"啟用執行階段 UEFI 媒體驗證\"\n\n#. • IDD_DIALOG → IDS_FORMAT_OPTIONS_TXT\nmsgid \"Format Options\"\nmsgstr \"選項\"\n\n#. • IDD_DIALOG → IDS_FILE_SYSTEM_TXT\nmsgid \"File system\"\nmsgstr \"檔案系統\"\n\n#. • IDD_DIALOG → IDS_CLUSTER_SIZE_TXT\nmsgid \"Cluster size\"\nmsgstr \"配置單元大小\"\n\n#. • IDD_DIALOG → IDS_LABEL_TXT\nmsgid \"Volume label\"\nmsgstr \"磁碟區標籤\"\n\n#. • IDD_DIALOG → IDC_QUICK_FORMAT\nmsgid \"Quick format\"\nmsgstr \"快速格式化\"\n\n#. • IDD_DIALOG → IDC_BAD_BLOCKS\nmsgid \"Check device for bad blocks\"\nmsgstr \"檢查裝置毀損區塊\"\n\n#. • IDD_DIALOG → IDC_EXTENDED_LABEL\nmsgid \"Create extended label and icon files\"\nmsgstr \"建立延伸標籤及圖示\"\n\n#. • IDD_DIALOG → IDS_STATUS_TXT\nmsgid \"Status\"\nmsgstr \"狀態\"\n\n#. • IDD_DIALOG → IDCANCEL\n#. • IDD_LICENSE → IDCANCEL\n#. • IDD_LOG → IDCANCEL\n#. • IDD_UPDATE_POLICY → IDCANCEL\n#. • IDD_NEW_VERSION → IDCANCEL\n#. • MSG_006\nmsgid \"Close\"\nmsgstr \"離開\"\n\n#. • IDD_DIALOG → IDC_START\nmsgid \"Start\"\nmsgstr \"執行\"\n\n#. • IDD_ABOUTBOX → IDD_ABOUTBOX\nmsgid \"About Rufus\"\nmsgstr \"關於 Rufus\"\n\n#. • IDD_ABOUTBOX → IDC_ABOUT_LICENSE\nmsgid \"License\"\nmsgstr \"授權合約\"\n\n#. • IDD_ABOUTBOX → IDOK\nmsgid \"OK\"\nmsgstr \"關閉\"\n\n#. • IDD_LICENSE → IDD_LICENSE\nmsgid \"Rufus License\"\nmsgstr \"Rufus 授權合約\"\n\n#. • IDD_NOTIFICATION → IDC_MORE_INFO\nmsgid \"More information\"\nmsgstr \"進階說明\"\n\n#. • IDD_NOTIFICATION → IDYES\n#. • MSG_008\nmsgid \"Yes\"\nmsgstr \"是\"\n\n#. • IDD_NOTIFICATION → IDNO\n#. • MSG_009\nmsgid \"No\"\nmsgstr \"否\"\n\n#. • IDD_LOG → IDD_LOG\nmsgid \"Log\"\nmsgstr \"記錄檔\"\n\n#. • IDD_LOG → IDC_LOG_CLEAR\nmsgid \"Clear\"\nmsgstr \"清除\"\n\n#. • IDD_LOG → IDC_LOG_SAVE\nmsgid \"Save\"\nmsgstr \"儲存\"\n\n#. • IDD_UPDATE_POLICY → IDD_UPDATE_POLICY\nmsgid \"Update policy and settings\"\nmsgstr \"版本更新\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_SETTINGS_GRP\nmsgid \"Settings\"\nmsgstr \"設定\"\n\n#. • IDD_UPDATE_POLICY → IDS_UPDATE_FREQUENCY_TXT\nmsgid \"Check for updates\"\nmsgstr \"自動檢查更新\"\n\n#. • IDD_UPDATE_POLICY → IDS_INCLUDE_BETAS_TXT\nmsgid \"Include beta versions\"\nmsgstr \"包含測試版本\"\n\n#. • IDD_UPDATE_POLICY → IDC_CHECK_NOW\nmsgid \"Check Now\"\nmsgstr \"立即檢查\"\n\n#. • IDD_NEW_VERSION → IDD_NEW_VERSION\nmsgid \"Check For Updates - Rufus\"\nmsgstr \"線上更新 - Rufus\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_AVAIL_TXT\nmsgid \"A newer version is available. Please download the latest version!\"\nmsgstr \"找到更新版本，請下載更新!\"\n\n#. • IDD_NEW_VERSION → IDC_WEBSITE\nmsgid \"Click here to go to the website\"\nmsgstr \"前往官方網頁下載 (點選會開啟瀏覽器)\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_NOTES_GRP\nmsgid \"Release Notes\"\nmsgstr \"版本說明\"\n\n#. • IDD_NEW_VERSION → IDS_NEW_VERSION_DOWNLOAD_GRP\n#. • IDD_NEW_VERSION → IDC_DOWNLOAD\n#. • MSG_040\nmsgid \"Download\"\nmsgstr \"下載\"\n\n#. • MSG_001\nmsgid \"Other instance detected\"\nmsgstr \"偵測到其他程序\"\n\n#. • MSG_002\nmsgid \"\"\n\"Another Rufus application is running.\\n\"\n\"Please close the first application before running another one.\"\nmsgstr \"\"\n\"已有其他 Rufus 程序在執行中。\\n\"\n\"請先關閉執行中的程序。\"\n\n#. • MSG_003\nmsgid \"\"\n\"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\n\"To continue with this operation, click OK. To quit click CANCEL.\"\nmsgstr \"\"\n\"警告: 此動作將完全清除此裝置上的資料: '%s'\\n\"\n\"請再次確認是否繼續。\"\n\n#. • MSG_004\nmsgid \"Rufus update policy\"\nmsgstr \"Rufus 線上更新規則\"\n\n#. • MSG_005\nmsgid \"Do you want to allow Rufus to check for application updates online?\"\nmsgstr \"是否啟用自動線上檢查更新?\"\n\n#. • MSG_007\nmsgid \"Cancel\"\nmsgstr \"取消\"\n\n#. • MSG_010\nmsgid \"Bad blocks found\"\nmsgstr \"偵測到損毀磁區\"\n\n#. • MSG_011\nmsgid \"\"\n\"Check completed: %d bad block(s) found\\n\"\n\"  %d read error(s)\\n\"\n\"  %d write error(s)\\n\"\n\"  %d corruption error(s)\"\nmsgstr \"\"\n\"掃描結果: %d 個異常\\n\"\n\"  %d 讀取錯誤\\n\"\n\"  %d 寫入錯誤\\n\"\n\"  %d 損毀錯誤\"\n\n#. • MSG_012\n#.\n#. This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\nmsgid \"\"\n\"%s\\n\"\n\"A more detailed report can be found in:\\n\"\n\"%s\"\nmsgstr \"\"\n\"%s\\n\"\n\"詳細報告位於:\\n\"\n\"%s\"\n\n#. • MSG_013\nmsgid \"Disabled\"\nmsgstr \"停用\"\n\n#. • MSG_014\nmsgid \"Daily\"\nmsgstr \"每天\"\n\n#. • MSG_015\nmsgid \"Weekly\"\nmsgstr \"每週\"\n\n#. • MSG_016\nmsgid \"Monthly\"\nmsgstr \"每月\"\n\n#. • MSG_017\nmsgid \"Custom\"\nmsgstr \"自訂\"\n\n#. • MSG_018\nmsgid \"Your version: %d.%d (Build %d)\"\nmsgstr \"目前版本: %d.%d (Build %d)\"\n\n#. • MSG_019\nmsgid \"Latest version: %d.%d (Build %d)\"\nmsgstr \"最新版本: %d.%d (Build %d)\"\n\n#. • MSG_020\n#. • MSG_026\nmsgid \"bytes\"\nmsgstr \"位元組\"\n\n#. • MSG_021\n#.\n#. *Short* version of the kilobyte size suffix\nmsgid \"KB\"\nmsgstr \"\"\n\n#. • MSG_022\n#.\n#. *Short* version of the megabyte size suffix\nmsgid \"MB\"\nmsgstr \"\"\n\n#. • MSG_023\n#.\n#. *Short* version of the gigabyte size suffix\nmsgid \"GB\"\nmsgstr \"\"\n\n#. • MSG_024\n#.\n#. *Short* version of the terabyte size suffix\nmsgid \"TB\"\nmsgstr \"\"\n\n#. • MSG_025\n#.\n#. *Short* version of the pentabyte size suffix\nmsgid \"PB\"\nmsgstr \"\"\n\n#. • MSG_027\nmsgid \"kilobytes\"\nmsgstr \"KB\"\n\n#. • MSG_028\nmsgid \"megabytes\"\nmsgstr \"MB\"\n\n#. • MSG_029\nmsgid \"Default\"\nmsgstr \"預設\"\n\n#. • MSG_030\n#.\n#. This gets appended to the file system, cluster size, etc.\nmsgid \"%s (Default)\"\nmsgstr \"%s (預設)\"\n\n#. • MSG_031\nmsgid \"BIOS (or UEFI-CSM)\"\nmsgstr \"BIOS (或 UEFI-CSM)\"\n\n#. • MSG_032\nmsgid \"UEFI (non CSM)\"\nmsgstr \"UEFI (無 CSM)\"\n\n#. • MSG_033\nmsgid \"BIOS or UEFI\"\nmsgstr \"BIOS 或 UEFI\"\n\n#. • MSG_034\n#.\n#. Number of bad block check passes (singular for 1 pass)\nmsgid \"%d pass\"\nmsgstr \"%d 回\"\n\n#. • MSG_035\n#.\n#. Number of bad block check passes (plural for 2 or more passes).\n#. See MSG_087 for the message that %s gets replaced with.\nmsgid \"%d passes %s\"\nmsgstr \"%d 回 %s\"\n\n#. • MSG_036\nmsgid \"ISO Image\"\nmsgstr \"ISO 映像\"\n\n#. • MSG_037\nmsgid \"Application\"\nmsgstr \"程式\"\n\n#. • MSG_038\nmsgid \"Abort\"\nmsgstr \"終止\"\n\n#. • MSG_039\nmsgid \"Launch\"\nmsgstr \"執行\"\n\n#. • MSG_041\nmsgid \"Operation cancelled by the user\"\nmsgstr \"作業被使用者中斷\"\n\n#. • MSG_042\nmsgid \"Error\"\nmsgstr \"錯誤\"\n\n#. • MSG_043\nmsgid \"Error: %s\"\nmsgstr \"錯誤: %s\"\n\n#. • MSG_044\nmsgid \"File download\"\nmsgstr \"檔案下載\"\n\n#. • MSG_045\nmsgid \"USB Storage Device (Generic)\"\nmsgstr \"USB 儲存裝置\"\n\n#. • MSG_046\nmsgid \"%s (Disk %d) [%s]\"\nmsgstr \"%s (磁碟 %d) [%s]\"\n\n#. • MSG_047\n#.\n#. Used when a drive is detected that contains more than one partition\nmsgid \"Multiple Partitions\"\nmsgstr \"多個磁碟分割區\"\n\n#. • MSG_048\nmsgid \"Rufus - Flushing buffers\"\nmsgstr \"Rufus - 正在清空緩衝區\"\n\n#. • MSG_049\nmsgid \"Rufus - Cancellation\"\nmsgstr \"Rufus - 取消\"\n\n#. • MSG_050\nmsgid \"Success.\"\nmsgstr \"完成。\"\n\n#. • MSG_051\nmsgid \"Undetermined error while formatting.\"\nmsgstr \"格式化時發生不明錯誤。\"\n\n#. • MSG_052\nmsgid \"Cannot use the selected file system for this media.\"\nmsgstr \"此裝置無法使用選取之檔案系統。\"\n\n#. • MSG_053\nmsgid \"Access to the device is denied.\"\nmsgstr \"裝置存取遭拒。\"\n\n#. • MSG_054\nmsgid \"Media is write protected.\"\nmsgstr \"裝置唯讀模式無法寫入。\"\n\n#. • MSG_055\nmsgid \"The device is in use by another process. Please close any other process that may be accessing the device.\"\nmsgstr \"偵測到其他程序使用裝置。請先關閉正在存取裝置的程序。\"\n\n#. • MSG_056\nmsgid \"Quick format is not available for this device.\"\nmsgstr \"此裝置不支援快速格式化。\"\n\n#. • MSG_057\nmsgid \"The volume label is invalid.\"\nmsgstr \"磁碟區標籤輸入錯誤。\"\n\n#. • MSG_058\nmsgid \"The device handle is invalid.\"\nmsgstr \"裝置控制代碼錯誤。\"\n\n#. • MSG_059\nmsgid \"The selected cluster size is not valid for this device.\"\nmsgstr \"此裝置不支援選取之配置單元大小。\"\n\n#. • MSG_060\nmsgid \"The volume size is invalid.\"\nmsgstr \"磁碟區大小錯誤。\"\n\n#. • MSG_061\nmsgid \"Please insert a removable media in drive.\"\nmsgstr \"請插入可卸除式裝置。\"\n\n#. • MSG_062\nmsgid \"An unsupported command was received.\"\nmsgstr \"接收到不支援的指令。\"\n\n#. • MSG_063\nmsgid \"Memory allocation error.\"\nmsgstr \"記憶體配置錯誤。\"\n\n#. • MSG_064\nmsgid \"Read error.\"\nmsgstr \"讀取錯誤。\"\n\n#. • MSG_065\nmsgid \"Write error.\"\nmsgstr \"寫入錯誤。\"\n\n#. • MSG_066\nmsgid \"Installation failure\"\nmsgstr \"安裝失敗\"\n\n#. • MSG_067\nmsgid \"Could not open media. It may be in use by another process. Please re-plug the media and try again.\"\nmsgstr \"無法開啟裝置，可能被其他程序占用。請重新插拔一次試試。\"\n\n#. • MSG_068\nmsgid \"Could not partition drive.\"\nmsgstr \"無法分割磁碟。\"\n\n#. • MSG_069\nmsgid \"Could not copy files to target drive.\"\nmsgstr \"無法複製檔案到目標磁碟。\"\n\n#. • MSG_070\nmsgid \"Cancelled by user.\"\nmsgstr \"工作遭使用者中斷。\"\n\n#. • MSG_071\n#.\n#. See http://en.wikipedia.org/wiki/Thread_%28computing%29\nmsgid \"Unable to start thread.\"\nmsgstr \"無法啟動執行緒。\"\n\n#. • MSG_072\nmsgid \"Bad blocks check didn't complete.\"\nmsgstr \"損毀磁區檢查工作未完成。\"\n\n#. • MSG_073\nmsgid \"ISO image scan failure.\"\nmsgstr \"掃描 ISO 映像檔失敗。\"\n\n#. • MSG_074\nmsgid \"ISO image extraction failure.\"\nmsgstr \"解壓縮 ISO 映像檔失敗。\"\n\n#. • MSG_075\nmsgid \"Unable to remount volume.\"\nmsgstr \"無法重新裝載磁碟區。\"\n\n#. • MSG_076\nmsgid \"Unable to patch/setup files for boot.\"\nmsgstr \"無法設置開機檔案。\"\n\n#. • MSG_077\nmsgid \"Unable to assign a drive letter.\"\nmsgstr \"無法指定磁碟機代號。\"\n\n#. • MSG_078\nmsgid \"Can't mount GUID volume.\"\nmsgstr \"無法裝載 GUID 磁碟區。\"\n\n#. • MSG_079\nmsgid \"The device is not ready.\"\nmsgstr \"裝置尚未就緒。\"\n\n#. • MSG_080\nmsgid \"\"\n\"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\"\n\"\\n\"\n\"Depending on the speed of your USB device, this operation may take a long time to complete, especially for large files.\\n\"\n\"\\n\"\n\"We recommend that you let Windows finish, to avoid corruption. But if you grow tired of waiting, you can just unplug the device...\"\nmsgstr \"\"\n\"Rufus 偵測到 Windows 正在排清緩衝區至 USB 裝置。\\n\"\n\"\\n\"\n\"此作業可能需要一段時間才完成，視裝置速度及檔案大小而定。\\n\"\n\"\\n\"\n\"我們建議耐心等候操作完成，以免發生資料損毀。但如果不願意等待，可以直接移除裝置...\"\n\n#. • MSG_081\nmsgid \"Unsupported image\"\nmsgstr \"不支援的映像檔\"\n\n#. • MSG_082\nmsgid \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\nmsgstr \"此映像檔無法開機，或是使用 Rufus 不支援的開機、壓縮方式...\"\n\n#. • MSG_083\nmsgid \"Replace %s?\"\nmsgstr \"取代 %s?\"\n\n#. • MSG_084\nmsgid \"\"\n\"This ISO image seems to use an obsolete version of '%s'.\\n\"\n\"Boot menus may not display properly because of this.\\n\"\n\"\\n\"\n\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\n\"- Choose 'Yes' to connect to the internet and download the file\\n\"\n\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\n\"If you don't know what to do, you should select 'Yes'.\\n\"\n\"\\n\"\n\"Note: The new file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"此 ISO 映像檔似乎使用過時版本的 '%s'。\\n\"\n\"開機選單可能因此無法正常運作。\\n\"\n\"\\n\"\n\"Rufus 可下載新版本來修正問題:\\n\"\n\"- 選 '是' 將連線到網路並下載檔案\\n\"\n\"- 選 '否' 保留原始 ISO 內容\\n\"\n\"如果你不知道該如何抉擇，建議選擇 '是'。\\n\"\n\"\\n\"\n\"注意: 檔案會下載至目前資料夾，如果已存在 '%s' 檔案將直接使用。\"\n\n#. • MSG_085\nmsgid \"Downloading %s\"\nmsgstr \"下載中 %s\"\n\n#. • MSG_086\nmsgid \"No image selected\"\nmsgstr \"未選取任何映像檔\"\n\n#. • MSG_087\n#.\n#. This message appears in Advanced format options → Check device for bad blocks → dropdown menu\n#. %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\n#. words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\n#. the translation as short as possible so that it won't result in an overly large dropdown...\n#. If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\n#. See also MSG_035.\nmsgid \"for %s NAND\"\nmsgstr \"給 %s NAND\"\n\n#. • MSG_088\nmsgid \"Image is too big\"\nmsgstr \"映像檔之檔案大小過大\"\n\n#. • MSG_089\nmsgid \"The image is too big for the selected target.\"\nmsgstr \"此映像檔超過裝置大小。\"\n\n#. • MSG_090\nmsgid \"Unsupported ISO\"\nmsgstr \"不支援的 ISO 映像檔\"\n\n#. • MSG_091\nmsgid \"When using UEFI Target Type, only EFI bootable ISO images are supported. Please select an EFI bootable ISO or set the Target Type to BIOS.\"\nmsgstr \"當選擇 UEFI 目標類型時，僅支援 EFI 開機的 ISO 映像檔。請選取可 EFI 開機的 ISO 檔案，或將目標類型改為 BIOS。\"\n\n#. • MSG_092\nmsgid \"Unsupported filesystem\"\nmsgstr \"不支援的檔案系統\"\n\n#. • MSG_093\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\"\n\"\\n\"\n\"This may include partitions/volumes that aren't listed or even visible from Windows. Should you wish to proceed, you are responsible for any data loss on these partitions.\"\nmsgstr \"\"\n\"重要: 此裝置具有多重磁碟分割配置!!\\n\"\n\"\\n\"\n\"可能包含 Windows 無法辨識或無法顯示的磁碟分割。請確認是否繼續執行，所造成任何磁碟分割資料遺失請自行負責。\"\n\n#. • MSG_094\nmsgid \"Multiple partitions detected\"\nmsgstr \"偵測到多重磁碟分割\"\n\n#. • MSG_095\nmsgid \"DD Image\"\nmsgstr \"DD 映像\"\n\n#. • MSG_096\nmsgid \"The file system currently selected can not be used with this type of ISO. Please select a different file system or use a different ISO.\"\nmsgstr \"目前選取的檔案系統不適用此 ISO 映像檔，請選取其他檔案系統或更換其他 ISO 映像檔。\"\n\n#. • MSG_097\nmsgid \"'%s' can only be applied if the file system is NTFS.\"\nmsgstr \"'%s' 僅適用於 NTFS 檔案系統。\"\n\n#. • MSG_098\nmsgid \"\"\n\"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' attribute.\\n\"\n\"\\n\"\n\"Do you still want to proceed?\\n\"\n\"\\n\"\n\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed using custom tools from the drive manufacturer. However those tools are ALMOST NEVER provided to the public...\"\nmsgstr \"\"\n\"重要: 您正嘗試安裝 'Windows To Go' 於沒有 '固定' 屬性的裝置上，可能無法正常開機。微軟不允許安裝在 '可卸除' 的裝置上。\\n\"\n\"\\n\"\n\"請確認是否仍繼續執行?\\n\"\n\"\\n\"\n\"注意: '固定/可卸除' 屬性只能透過硬體製造商的工具設定，似乎未曾開放給大眾使用...\"\n\n#. • MSG_099\nmsgid \"Filesystem limitation\"\nmsgstr \"檔案系統限制\"\n\n#. • MSG_100\nmsgid \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\nmsgstr \"此 ISO 映像檔內含大一個大於 4 GB 的檔案，遠超出 FAT 或 FAT32 檔案系統可支援的上限。\"\n\n#. • MSG_101\nmsgid \"Missing WIM support\"\nmsgstr \"缺少 WIM 支援\"\n\n#. • MSG_102\nmsgid \"\"\n\"Your platform cannot extract files from WIM archives. WIM extraction is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that by installing a recent version of 7-Zip.\\n\"\n\"Do you want to visit the 7-zip download page?\"\nmsgstr \"目前系統環境不支援解壓縮 WIM 檔案，此功能為製作 EFI Win7/Vista 開機片之要件。此問題可利用 7-Zip (免費的開放軟體) 解決，是否要立即前往 7-Zip 網站下載?\"\n\n#. • MSG_103\nmsgid \"Download %s?\"\nmsgstr \"是否下載 %s?\"\n\n#. • MSG_104\n#.\n#. Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\n#. file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\nmsgid \"\"\n\"%s or later requires a '%s' file to be installed.\\n\"\n\"Because this file is more than 100 KB in size, and always present on %s ISO images, it is not embedded in Rufus.\\n\"\n\"\\n\"\n\"Rufus can download the missing file for you:\\n\"\n\"- Select 'Yes' to connect to the internet and download the file\\n\"\n\"- Select 'No' if you want to manually copy this file on the drive later\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current directory and once a '%s' exists there, it will be reused automatically.\"\nmsgstr \"\"\n\"%s 或更新版本需要同時安裝 '%s' 檔案方可支援。\\n\"\n\"由於這個檔案大於 100KB 且已包含在每一版 %s ISO 映像檔中，故 Rufus 未預載。\\n\"\n\"\\n\"\n\"Rufus 可自動下載:\\n\"\n\"- 選擇 '是' 將連上網並下載檔案\\n\"\n\"- 選擇 '否' 若您要自行複製檔案到裝置\\n\"\n\"\\n\"\n\"注意: 檔案會下載至目前資料夾，如果已存在 '%s' 檔案將直接使用。\"\n\n#. • MSG_105\nmsgid \"\"\n\"Cancelling may leave the device in an UNUSABLE state.\\n\"\n\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\nmsgstr \"\"\n\"現在取消可能導致裝置異常。\\n\"\n\"如果你確定要取消，點選 是。反之，點選 否。\"\n\n#. • MSG_106\nmsgid \"Please select folder\"\nmsgstr \"請選擇資料夾\"\n\n#. • MSG_107\nmsgid \"All files\"\nmsgstr \"所有檔案\"\n\n#. • MSG_108\nmsgid \"Rufus log\"\nmsgstr \"Rufus 記錄檔\"\n\n#. • MSG_109\nmsgid \"0x%02X (Disk %d)\"\nmsgstr \"0x%02X (磁碟 %d)\"\n\n#. • MSG_110\n#.\n#. \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\n#. \"kilobytes\" should be the same as in MSG_027\nmsgid \"\"\n\"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\n\"Please change the Cluster size or use FreeDOS.\"\nmsgstr \"\"\n\"MS-DOS 無法自 64 kilobytes 配置單元大小的磁區開機。\\n\"\n\"請更換配置單元大小或改用 FreeDOS。\"\n\n#. • MSG_111\nmsgid \"Incompatible Cluster size\"\nmsgstr \"不相容的配置單元大小\"\n\n#. • MSG_112\n#.\n#. \"%d:%02d\" is a duration (mins:secs)\nmsgid \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\nmsgstr \"格式化較大的 UDF 磁碟區需要較久的時間。假設使用 USB 2.0 速度，預估時間為 %d:%02d，過程中進度列表可能會呈現暫停狀態。請耐心等待!\"\n\n#. • MSG_113\nmsgid \"Large UDF volume\"\nmsgstr \"大 UDF 磁碟區\"\n\n#. • MSG_114\nmsgid \"\"\n\"This image uses Syslinux %s%s but this application only includes the installation files for Syslinux %s%s.\\n\"\n\"\\n\"\n\"As new versions of Syslinux are not compatible with one another, and it wouldn't be possible for Rufus to include them all, two additional files must be downloaded from the Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\n\"- Select 'Yes' to connect to the Internet and download these files\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The files will be downloaded in the current application directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"此映像檔使用到 Syslinux %s%s，但本軟體僅支援 Syslinux %s%s 安裝檔案。\\n\"\n\"\\n\"\n\"由於不同版本的 Syslinux 互不相容，因此需額外下載以下擴充檔案: \\n\"\n\"'ldlinux.sys' 和 'ldlinux.bss'\\n\"\n\"如欲下載這份檔案，請選擇「是」，Rufus 將會自動上網下載。若要終止作業，請選擇「否」\\n\"\n\"\\n\"\n\"(僅需下載一次，以後可直接沿用不須再次下載)\"\n\n#. • MSG_115\nmsgid \"Download required\"\nmsgstr \"需額外下載擴充檔案\"\n\n#. • MSG_116\n#.\n#. You should be able to test this message with Super Grub2 Disk ISO:\n#. https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\nmsgid \"\"\n\"This image uses Grub %s but the application only includes the installation files for Grub %s.\\n\"\n\"\\n\"\n\"As different versions of Grub may not be compatible with one another, and it is not possible to include them all, Rufus will attempt to locate a version of the Grub installation file ('core.img') that matches the one from your image:\\n\"\n\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\n\"- Select 'No' to use the default version from Rufus\\n\"\n\"- Select 'Cancel' to abort the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the current application directory and will be reused automatically if present. If no match can be found online, then the default version will be used.\"\nmsgstr \"\"\n\"此映像檔使用到 Grub %s，但本軟體僅支援 Grub %s 安裝檔案。\\n\"\n\"\\n\"\n\"由於不同版本的 Grub 互不相容，因此需額外下載以下符合映像檔 Grub 版本的擴充檔案: \\n\"\n\"'core.img'\\n\"\n\"如欲下載這份檔案，請選擇「是」，Rufus 將會自動上網下載，或選擇「否」使用 Rufus 內建版本。若要終止作業，請選擇「取消」\\n\"\n\"\\n\"\n\"(僅需下載一次，以後可直接沿用不須再次下載；若無法下載到相同版本的檔案，則會自動使用內建版本)\"\n\n#. • MSG_117\nmsgid \"Standard Windows installation\"\nmsgstr \"標準 Windows 安裝\"\n\n#. • MSG_118\n#.\n#. Only translate this message *if* Microsoft has a specific name for\n#. http://en.wikipedia.org/wiki/Windows_To_Go in your language.\n#. Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\nmsgid \"Windows To Go\"\nmsgstr \"\"\n\n#. • MSG_119\nmsgid \"advanced drive properties\"\nmsgstr \"裝置進階內容\"\n\n#. • MSG_120\nmsgid \"advanced format options\"\nmsgstr \"格式化進階選項\"\n\n#. • MSG_121\nmsgid \"Show %s\"\nmsgstr \"顯示 %s\"\n\n#. • MSG_122\nmsgid \"Hide %s\"\nmsgstr \"隱藏 %s\"\n\n#. • MSG_123\n#.\n#. A persistent partitions can be used with \"Live\" USB media to store data.\n#. It means that data can be preserved across reboots on \"Live\" USB drives.\n#. To test this feature, please download and select 'casper_test.iso' from:\n#. https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\nmsgid \"Persistent partition size\"\nmsgstr \"固定磁區大小\"\n\n#. • MSG_124\n#.\n#. This message appears in the persistence 'Size' control when the slider is set to 0.\n#. It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\n#. created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\nmsgid \"No persistence\"\nmsgstr \"不固定\"\n\n#. • MSG_125\n#.\n#. Tooltips used for the peristence size slider and edit control\nmsgid \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\nmsgstr \"設定 live USB 的固定磁區大小。大小設定為 0 則移除固定磁區。\"\n\n#. • MSG_126\nmsgid \"Set the partition size units.\"\nmsgstr \"設定磁區大小單位。\"\n\n#. • MSG_127\nmsgid \"Do not show this message again\"\nmsgstr \"不要再顯示此訊息\"\n\n#. • MSG_128\nmsgid \"Important notice about %s\"\nmsgstr \"重要通知關於 %s\"\n\n#. • MSG_129\nmsgid \"\"\n\"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\n\"For details on why this is necessary, see the 'More Information' button below.\"\nmsgstr \"\"\n\"你已建立使用 UEFI:NTFS 開機引導程式的裝置。如要使用此裝置開機，請記得關閉安全開機。\\n\"\n\"更多資訊請點選底下 '進階說明' 按鈕。\"\n\n#. • MSG_130\nmsgid \"Windows image selection\"\nmsgstr \"Windows 映像檔選擇\"\n\n#. • MSG_131\nmsgid \"\"\n\"This ISO contains multiple Windows images.\\n\"\n\"Please select the image you wish to use for this installation:\"\nmsgstr \"\"\n\"此 ISO 包含多個 Windows 映像\\n\"\n\"請選擇要安裝的映像:\"\n\n#. • MSG_132\nmsgid \"Another program or process is accessing this drive. Do you want to format it anyway?\"\nmsgstr \"另一個程式或程序正在使用此裝置，要繼續格式化?\"\n\n#. • MSG_133\nmsgid \"\"\n\"Rufus has detected that you are attempting to create a Windows To Go media based on a 1809 ISO.\\n\"\n\"\\n\"\n\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\"\n\"\\n\"\n\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\nmsgstr \"\"\n\"Rufus 偵測到您將要建立 'Windows To Go' 1809 版本。\\n\"\n\"\\n\"\n\"由於微軟的程式錯誤，您將無法正常開機 (藍白當機)，除非您自行更換 'WppRecorder.sys' 成 1803 版本。\\n\"\n\"\\n\"\n\"此檔案版權擁有者為微軟，Rufus 愛莫能助...\"\n\n#. • MSG_134\nmsgid \"\"\n\"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\"\n\"\\n\"\n\"Are you sure you want to continue?\"\nmsgstr \"\"\n\"由於選擇使用 MBR 磁區，Rufus 最大只能建立 2 TB 磁區，而剩下空間 %s 將無法使用\\n\"\n\"\\n\"\n\"請確認是否繼續?\"\n\n#. • MSG_135\nmsgid \"Version\"\nmsgstr \"版本\"\n\n#. • MSG_136\nmsgid \"Release\"\nmsgstr \"發布版本\"\n\n#. • MSG_137\nmsgid \"Edition\"\nmsgstr \"版本\"\n\n#. • MSG_138\nmsgid \"Language\"\nmsgstr \"語言\"\n\n#. • MSG_139\nmsgid \"Architecture\"\nmsgstr \"架構\"\n\n#. • MSG_140\nmsgid \"Continue\"\nmsgstr \"繼續\"\n\n#. • MSG_141\nmsgid \"Back\"\nmsgstr \"返回\"\n\n#. • MSG_142\nmsgid \"Please wait...\"\nmsgstr \"請稍候...\"\n\n#. • MSG_143\nmsgid \"Download using a browser\"\nmsgstr \"使用瀏覽器下載\"\n\n#. • MSG_144\nmsgid \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\nmsgstr \"由於 Microsoft 已更改其網站以阻止下載 Windows ISO，因此無法下載。\"\n\n#. • MSG_145\nmsgid \"PowerShell 3.0 or later is required to run this script.\"\nmsgstr \"需要 PowerShell 3.0 或更新版本才能執行。\"\n\n#. • MSG_146\nmsgid \"Do you want to go online and download it?\"\nmsgstr \"您要連上網並下載?\"\n\n#. • MSG_148\nmsgid \"Running download script...\"\nmsgstr \"執行下載程序中...\"\n\n#. • MSG_149\nmsgid \"Download ISO Image\"\nmsgstr \"下載 ISO 映像檔\"\n\n#. • MSG_150\nmsgid \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\nmsgstr \"你要使用此開機磁碟的電腦類型。在建立開機磁碟之前，你必須確定該電腦使用 BIOS 或是 UEFI，若沒正確對應可能無法開機。\"\n\n#. • MSG_151\n#.\n#. You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\nmsgid \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\nmsgstr \"'UEFI-CSM' 代表裝置只能在 UEFI 下的模擬 BIOS 模式 (或稱 'Legacy Mode') 開機，而非原生 UEFI 模式。\"\n\n#. • MSG_152\nmsgid \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\nmsgstr \"'無 CSM' 代表裝置只能在原生 UEFI 模式下啟動，而非模擬 BIOS 模式 (或稱 'Legacy Mode')。\"\n\n#. • MSG_153\nmsgid \"Test pattern: 0x%02X\"\nmsgstr \"測試模式: 0x%02X\"\n\n#. • MSG_154\nmsgid \"Test pattern: 0x%02X, 0x%02X\"\nmsgstr \"測試模式: 0x%02X, 0x%02X\"\n\n#. • MSG_155\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"測試模式: 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_156\nmsgid \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\nmsgstr \"測試模式: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\n\n#. • MSG_157\nmsgid \"Sets the target filesystem\"\nmsgstr \"設定檔案系統類型\"\n\n#. • MSG_158\nmsgid \"Minimum size that a block of data will occupy in the filesystem\"\nmsgstr \"資料區塊於檔案系統中最小的配置單元\"\n\n#. • MSG_159\nmsgid \"\"\n\"Use this field to set the drive label.\\n\"\n\"International characters are accepted.\"\nmsgstr \"\"\n\"自訂磁區標籤名稱。\\n\"\n\"可支援英數以外的字元 (如中文)。\"\n\n#. • MSG_160\nmsgid \"Toggle advanced options\"\nmsgstr \"顯示/隱藏進階選項\"\n\n#. • MSG_161\nmsgid \"Check the device for bad blocks using a test pattern\"\nmsgstr \"使用右方選項測試模式檢查裝置磁區有無損毀區塊\"\n\n#. • MSG_162\nmsgid \"Uncheck this box to use the \\\"slow\\\" format method\"\nmsgstr \"取消勾選可執行完整格式化\"\n\n#. • MSG_163\nmsgid \"Method that will be used to create partitions\"\nmsgstr \"用來建立磁區的方式\"\n\n#. • MSG_164\nmsgid \"Method that will be used to make the drive bootable\"\nmsgstr \"開機方法\"\n\n#. • MSG_165\nmsgid \"Click to select or download an image...\"\nmsgstr \"選取或下載映像檔...\"\n\n#. • MSG_166\nmsgid \"Check this box to allow the display of international labels and set a device icon (creates an autorun.inf)\"\nmsgstr \"允許顯示多國語言標籤及裝置圖示 (建立 autorun.inf)\"\n\n#. • MSG_167\nmsgid \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\nmsgstr \"安裝 UEFI 開機引導程式，該程式將對媒體進行 MD5 雜湊值驗證\"\n\n#. • MSG_169\nmsgid \"\"\n\"Create an extra hidden partition and try to align partitions boundaries.\\n\"\n\"This can improve boot detection for older BIOSes.\"\nmsgstr \"\"\n\"建立隱藏磁區分割並嘗試對齊資料分割界限。\\n\"\n\"可幫助老舊 BIOS 偵測到開機碟。\"\n\n#. • MSG_170\nmsgid \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\nmsgstr \"顯示連接到電腦的 USB 外接硬碟。請謹慎使用，後果自負!!!\"\n\n#. • MSG_171\nmsgid \"\"\n\"Start the formatting operation.\\n\"\n\"This will DESTROY any data on the target!\"\nmsgstr \"\"\n\"立即開始格式化作業。\\n\"\n\"注意: 裝置上所有的資料將被清除!\"\n\n#. • MSG_172\n#.\n#. As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\n#. public key that is embedded in the application. This message appears in an error dialog if the validation fails.\nmsgid \"Invalid download signature\"\nmsgstr \"下載簽章無效\"\n\n#. • MSG_173\nmsgid \"Click to select...\"\nmsgstr \"選取內容...\"\n\n#. • MSG_174\nmsgid \"Rufus - The Reliable USB Formatting Utility\"\nmsgstr \"Rufus - 快速可靠的 USB 格式化工具\"\n\n#. • MSG_175\nmsgid \"Version %d.%d (Build %d)\"\nmsgstr \"版本 %d.%d (Build %d)\"\n\n#. • MSG_176\nmsgid \"English translation: Pete Batard <mailto:pete@akeo.ie>\"\nmsgstr \"正體中文譯者: 佚 <mailto:mmmeow@gmail.com>\\\\line Chocobo1 <https://github.com/Chocobo1>\\\\line SiderealArt <https://github.com/SiderealArt>\\\\line Ocha <https://github.com/cupofocha>\"\n\n#. • MSG_177\nmsgid \"Report bugs or request enhancements at:\"\nmsgstr \"Bug 回報或請求新功能請至: (英文網頁)\"\n\n#. • MSG_178\nmsgid \"Additional Copyrights:\"\nmsgstr \"其他著作權資訊:\"\n\n#. • MSG_179\nmsgid \"Update Policy:\"\nmsgstr \"線上更新規則:\"\n\n#. • MSG_180\nmsgid \"If you choose to allow this program to check for application updates, you agree that the following information may be collected on our server(s):\"\nmsgstr \"若選擇啟用自動線上檢查更新機制，表示您同意並授權本軟體蒐集、回傳以下資訊:\"\n\n#. • MSG_181\nmsgid \"Your operating system's architecture and version\"\nmsgstr \"作業系統架構及版本\"\n\n#. • MSG_182\nmsgid \"The version of the application you use\"\nmsgstr \"本軟體目前的版本\"\n\n#. • MSG_183\nmsgid \"Your IP address\"\nmsgstr \"您的 IP 位置\"\n\n#. • MSG_184\nmsgid \"For the purpose of generating private usage statistics, we may keep the information collected, \\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\nmsgstr \"所蒐集之資料\\\\b最多保留一年\\\\b0 ，目的僅供內部統計分析 Rufus 使用概況，絕不會主動將資料提供給第三方。\"\n\n#. • MSG_185\nmsgid \"Update Process:\"\nmsgstr \"更新流程:\"\n\n#. • MSG_186\nmsgid \"\"\n\"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\n\"Internet access is of course required when checking for updates.\"\nmsgstr \"Rufus 沒有常駐或背景程式，因此當主程式執行時才會進行自動線上檢查更新。當然，還必須是在連網狀態。\"\n\n#. • MSG_187\nmsgid \"Invalid image for selected boot option\"\nmsgstr \"選取的開機方法不支援此映像檔\"\n\n#. • MSG_188\nmsgid \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\nmsgstr \"此映像檔與選取的開機方法不合，請更換映像檔或開機方法。\"\n\n#. • MSG_189\nmsgid \"This ISO image is not compatible with the selected filesystem\"\nmsgstr \"此映像檔與選取的檔案系統不相容\"\n\n#. • MSG_190\nmsgid \"Incompatible drive detected\"\nmsgstr \"偵測到不相容的磁碟\"\n\n#. • MSG_191\n#.\n#. Used in MSG_235\nmsgid \"Write pass\"\nmsgstr \"寫入測試\"\n\n#. • MSG_192\n#.\n#. Used in MSG_235\nmsgid \"Read pass\"\nmsgstr \"讀取測試\"\n\n#. • MSG_193\nmsgid \"Downloaded %s\"\nmsgstr \"已下載 %s\"\n\n#. • MSG_194\nmsgid \"Could not download %s\"\nmsgstr \"無法下載 %s\"\n\n#. • MSG_195\n#.\n#. Example: \"Using embedded version of Grub2 file(s)\"\nmsgid \"Using embedded version of %s file(s)\"\nmsgstr \"使用內建 %s 檔案\"\n\n#. • MSG_196\nmsgid \"\"\n\"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\"\n\"\\n\"\n\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. In many cases, this means that you will NOT be able to boot from this drive.\\n\"\n\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\nmsgstr \"\"\n\"重要: 此裝置使用非標準磁區大小!\\n\"\n\"\\n\"\n\"一般裝置使用 512-byte 磁區，但是此裝置使用 %d-byte。在多數情況下，這代表你無法使用此裝置開機。\\n\"\n\"Rufus 可嘗試建立開機磁碟，但不保證能正常使用。\"\n\n#. • MSG_197\nmsgid \"Nonstandard sector size detected\"\nmsgstr \"偵測到非標準磁區大小\"\n\n#. • MSG_198\nmsgid \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\nmsgstr \"'Windows To Go' 只能安裝於有 '固定' 屬性的 GPT 分割裝置。目前裝置屬性不是 '固定'。\"\n\n#. • MSG_199\nmsgid \"This feature is not available on this platform.\"\nmsgstr \"此功能在此平台上不可用。\"\n\n#. • MSG_201\nmsgid \"Cancelling - Please wait...\"\nmsgstr \"取消中，請稍候...\"\n\n#. • MSG_202\nmsgid \"Scanning image...\"\nmsgstr \"掃描映像檔中...\"\n\n#. • MSG_203\nmsgid \"Failed to scan image\"\nmsgstr \"映像檔掃描失敗\"\n\n#. • MSG_204\n#.\n#. %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\nmsgid \"Obsolete %s detected\"\nmsgstr \"偵測到過時檔案: %s\"\n\n#. • MSG_205\n#.\n#. Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\nmsgid \"Using image: %s\"\nmsgstr \"目前選取映像檔: %s\"\n\n#. • MSG_206\n#.\n#. Example: \"Missing ldlinux.c32 file\"\nmsgid \"Missing %s file\"\nmsgstr \"缺少檔案: %s\"\n\n#. • MSG_207\n#.\n#. The name proposed by Windows' Computer Management → Disk Management when you try to format\n#. a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\nmsgid \"New Volume\"\nmsgstr \"新增磁碟區\"\n\n#. • MSG_208\n#.\n#. Singular. Example: \"1 device found\"\nmsgid \"%d device found\"\nmsgstr \"偵測到 %d 個裝置\"\n\n#. • MSG_209\n#.\n#. Plural. Example: \"3 devices found\"\nmsgid \"%d devices found\"\nmsgstr \"偵測到 %d 個裝置\"\n\n#. • MSG_210\nmsgid \"READY\"\nmsgstr \"已就緒\"\n\n#. • MSG_211\nmsgid \"Cancelled\"\nmsgstr \"已取消\"\n\n#. • MSG_212\nmsgid \"Failed\"\nmsgstr \"作業失敗\"\n\n#. • MSG_213\n#.\n#. Used when a new update has been downloaded and launched\nmsgid \"Launching new application...\"\nmsgstr \"新版本啟動中...\"\n\n#. • MSG_214\nmsgid \"Failed to launch new application\"\nmsgstr \"無法啟動新版本\"\n\n#. • MSG_215\n#.\n#. Example: \"Opened some_file.txt\"\nmsgid \"Opened %s\"\nmsgstr \"已開啟: %s\"\n\n#. • MSG_216\n#.\n#. Example: \"Saved rufus.log\"\nmsgid \"Saved %s\"\nmsgstr \"已儲存: %s\"\n\n#. • MSG_217\n#.\n#. Formatting status\nmsgid \"Formatting: %s\"\nmsgstr \"格式化中: %s\"\n\n#. • MSG_218\nmsgid \"Creating file system: Task %d/%d completed\"\nmsgstr \"建立檔案系統中，已完成作業: %d/%d\"\n\n#. • MSG_219\nmsgid \"NTFS Fixup: %d%% completed\"\nmsgstr \"NTFS 修復，已完成: %d%%\"\n\n#. • MSG_220\n#.\n#. Parameter: the file system and an estimated duration in mins and secs.\n#. Example: \"Formatting (UDF) - Estimated duration 3:21...\"\n#. If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\nmsgid \"Formatting (%s) - estimated duration %d:%02d...\"\nmsgstr \"格式化 (%s) - 剩餘時間: %d:%02d...\"\n\n#. • MSG_221\nmsgid \"Setting label (%s)...\"\nmsgstr \"正在設定標籤 (%s)...\"\n\n#. • MSG_222\n#.\n#. Example: \"Formatting (FAT32)...\"\nmsgid \"Formatting (%s)...\"\nmsgstr \"格式化中 (%s)...\"\n\n#. • MSG_223\nmsgid \"NTFS Fixup (Checkdisk)...\"\nmsgstr \"NTFS 修復中 (Checkdisk)...\"\n\n#. • MSG_224\nmsgid \"Clearing MBR/PBR/GPT structures...\"\nmsgstr \"清除 MBR/PBR/GPT 架構...\"\n\n#. • MSG_225\nmsgid \"Requesting disk access...\"\nmsgstr \"請求磁碟存取...\"\n\n#. • MSG_226\nmsgid \"Analyzing existing boot records...\"\nmsgstr \"分析既有開機記錄...\"\n\n#. • MSG_227\nmsgid \"Closing existing volume...\"\nmsgstr \"關閉既有磁碟區...\"\n\n#. • MSG_228\nmsgid \"Writing Master Boot Record...\"\nmsgstr \"寫入主開機記錄...\"\n\n#. • MSG_229\nmsgid \"Writing Partition Boot Record...\"\nmsgstr \"寫入磁區開機記錄...\"\n\n#. • MSG_230\nmsgid \"Copying DOS files...\"\nmsgstr \"複製 DOS 檔案...\"\n\n#. • MSG_231\nmsgid \"Copying ISO files: %s\"\nmsgstr \"複製 ISO 檔案: %s\"\n\n#. • MSG_232\nmsgid \"Win7 EFI boot setup (%s)...\"\nmsgstr \"建置 Win7 EFI 開機 (%s)...\"\n\n#. • MSG_233\nmsgid \"Finalizing, please wait...\"\nmsgstr \"收尾中，請稍候...\"\n\n#. • MSG_234\n#.\n#. Takes a Syslinux version as parameter.\n#. Example: \"Installing Syslinux v5.10...\"\nmsgid \"Installing Syslinux %s...\"\nmsgstr \"Syslinux %s 安裝中...\"\n\n#. • MSG_235\n#.\n#. Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\n#. See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\nmsgid \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\nmsgstr \"損毀磁區: %s %d/%d - %0.2f%% (%d/%d/%d 錯誤)\"\n\n#. • MSG_236\nmsgid \"Bad Blocks: Testing with random pattern\"\nmsgstr \"損毀磁區: 掃描中 (隨機模式)\"\n\n#. • MSG_237\nmsgid \"Bad Blocks: Testing with pattern 0x%02X\"\nmsgstr \"損毀磁區: 掃描中 (0x%02X 模式)\"\n\n#. • MSG_238\n#.\n#. Example: \"Partitioning (MBR)...\"\nmsgid \"Partitioning (%s)...\"\nmsgstr \"磁區分割中 (%s)...\"\n\n#. • MSG_239\nmsgid \"Deleting partitions (%s)...\"\nmsgstr \"正在刪除磁區分割 (%s)...\"\n\n#. • MSG_240\n#.\n#. This message has to do with the signature validation that Rufus uses when downloading an update.\nmsgid \"\"\n\"The signature for the downloaded update can not be validated. This could mean that your system is improperly configured for signature validation or indicate a malicious download.\\n\"\n\"\\n\"\n\"The download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"無法驗證已下載的更新簽章。這代表你的系統可能未正確設定簽章驗證，或下載了惡意檔案。\\n\"\n\"\\n\"\n\"下載的檔案將被刪除。更詳盡資料請見記錄檔。\"\n\n#. • MSG_241\nmsgid \"Downloading: %s\"\nmsgstr \"下載中: %s\"\n\n#. • MSG_242\nmsgid \"Failed to download file.\"\nmsgstr \"檔案下載失敗。\"\n\n#. • MSG_243\nmsgid \"Checking for Rufus updates...\"\nmsgstr \"線上更新: 檢查更新版本中...\"\n\n#. • MSG_244\nmsgid \"Updates: Unable to connect to the internet\"\nmsgstr \"線上更新: 無法連線到網路\"\n\n#. • MSG_245\nmsgid \"Updates: Unable to access version data\"\nmsgstr \"線上更新: 無法確認軟體版本\"\n\n#. • MSG_246\nmsgid \"A new version of Rufus is available!\"\nmsgstr \"線上更新: 有更新版本!\"\n\n#. • MSG_247\nmsgid \"No new version of Rufus was found\"\nmsgstr \"線上更新: 已是最新版\"\n\n#. • MSG_248\nmsgid \"Application registry keys successfully deleted\"\nmsgstr \"Rufus 登錄檔已成功清除\"\n\n#. • MSG_249\nmsgid \"Failed to delete application registry keys\"\nmsgstr \"Rufus 登錄檔清除失敗\"\n\n#. • MSG_250\n#.\n#. Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\nmsgid \"%s enabled\"\nmsgstr \"%s 已啟用\"\n\n#. • MSG_251\nmsgid \"%s disabled\"\nmsgstr \"%s 已停用\"\n\n#. • MSG_252\nmsgid \"Size checks\"\nmsgstr \"大小偵測\"\n\n#. • MSG_253\nmsgid \"Hard disk detection\"\nmsgstr \"硬碟偵測\"\n\n#. • MSG_254\nmsgid \"Force large FAT32 formatting\"\nmsgstr \"強制大容量 FAT32 格式化模式\"\n\n#. • MSG_255\nmsgid \"NoDriveTypeAutorun will be deleted on exit\"\nmsgstr \"離開時清除 NoDriveTypeAutorun\"\n\n#. • MSG_256\nmsgid \"Fake drive detection\"\nmsgstr \"偵測偽磁碟\"\n\n#. • MSG_257\nmsgid \"Joliet support\"\nmsgstr \"Joliet 格式支援\"\n\n#. • MSG_258\nmsgid \"Rock Ridge support\"\nmsgstr \"Rock Ridge 格式支援\"\n\n#. • MSG_259\nmsgid \"Force update\"\nmsgstr \"強制更新\"\n\n#. • MSG_260\nmsgid \"NTFS compression\"\nmsgstr \"NTFS 壓縮\"\n\n#. • MSG_261\nmsgid \"Writing image: %s\"\nmsgstr \"映像檔寫入中: %s\"\n\n#. • MSG_262\n#.\n#. Cheat mode message to disable ISO Support, so that only DD images can be opened\nmsgid \"ISO Support\"\nmsgstr \"ISO 支援\"\n\n#. • MSG_263\n#.\n#. Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\nmsgid \"Use PROPER size units\"\nmsgstr \"正規位元單位\"\n\n#. • MSG_264\nmsgid \"Deleting directory '%s'\"\nmsgstr \"刪除目錄 '%s'\"\n\n#. • MSG_265\nmsgid \"VMWare disk detection\"\nmsgstr \"VMWare 磁碟偵測\"\n\n#. • MSG_266\nmsgid \"Dual UEFI/BIOS mode\"\nmsgstr \"UEFI/BIOS 雙模式\"\n\n#. • MSG_267\nmsgid \"Applying Windows image: %s\"\nmsgstr \"套用 Windows 映像檔: %s\"\n\n#. • MSG_268\nmsgid \"Applying Windows image...\"\nmsgstr \"建置 Windows 映像檔中...\"\n\n#. • MSG_269\nmsgid \"Preserve timestamps\"\nmsgstr \"保留時間戳記\"\n\n#. • MSG_270\nmsgid \"USB debug\"\nmsgstr \"USB 除錯\"\n\n#. • MSG_271\nmsgid \"Computing image checksums: %s\"\nmsgstr \"計算映像檔總和檢查碼: %s\"\n\n#. • MSG_272\nmsgid \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\nmsgstr \"計算已選擇映像檔的 MD5、SHA1 和 SHA256 總和檢查碼\"\n\n#. • MSG_273\nmsgid \"Change the application language\"\nmsgstr \"更改應用程式語言\"\n\n#. • MSG_274\nmsgid \"%s image detected\"\nmsgstr \"偵測到 %s 映像檔\"\n\n#. • MSG_275\n#.\n#. '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\nmsgid \"\"\n\"The image you have selected is an 'ISOHybrid' image. This means it can be written either in %s (file copy) mode or %s (disk image) mode.\\n\"\n\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\n\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"你選擇的映像檔為 'ISOHybrid' 格式。該檔案格式可以使用以下模式寫入%s (檔案複製) 模式 或 %s (磁碟映像) 模式。\\n\"\n\"Rufus 建議使用 %s 模式，你將擁有磁碟的完整存取權限。\\n\"\n\"如果你在開機時遭遇問題，你可以嘗試使用 %s 模式寫入。\\n\"\n\"\\n\"\n\"請選擇寫入模式:\"\n\n#. • MSG_276\n#.\n#. '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\nmsgid \"Write in %s mode (Recommended)\"\nmsgstr \"以 %s 模式寫入 (建議)\"\n\n#. • MSG_277\n#.\n#. '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\nmsgid \"Write in %s mode\"\nmsgstr \"以 %s 模式寫入\"\n\n#. • MSG_278\nmsgid \"Checking for conflicting processes...\"\nmsgstr \"檢查衝突的程序...\"\n\n#. • MSG_279\nmsgid \"Non bootable\"\nmsgstr \"不可開機\"\n\n#. • MSG_280\nmsgid \"Disk or ISO image\"\nmsgstr \"磁碟或 ISO 映像檔\"\n\n#. • MSG_281\nmsgid \"%s (Please select)\"\nmsgstr \"%s (請選擇)\"\n\n#. • MSG_282\nmsgid \"Exclusive USB drive locking\"\nmsgstr \"鎖定 USB 磁碟\"\n\n#. • MSG_283\nmsgid \"Invalid signature\"\nmsgstr \"無效簽章\"\n\n#. • MSG_284\nmsgid \"The downloaded executable is missing a digital signature.\"\nmsgstr \"下載的檔案缺少數位簽章。\"\n\n#. • MSG_285\nmsgid \"\"\n\"The downloaded executable is signed by '%s'.\\n\"\n\"This is not a signature we recognize and could indicate some form of malicious activity...\\n\"\n\"Are you sure you want to run this file?\"\nmsgstr \"\"\n\"下載的檔案簽章者為: '%s'。\\n\"\n\"本軟體未使用此簽章，代表檔案可能已遭受病毒感染...\\n\"\n\"是否要執行檔案?\"\n\n#. • MSG_286\nmsgid \"Zeroing drive: %s\"\nmsgstr \"正在寫入零: %s\"\n\n#. • MSG_287\nmsgid \"Detection of non-USB removable drives\"\nmsgstr \"偵測非 USB 可移除磁碟\"\n\n#. • MSG_288\nmsgid \"Missing elevated privileges\"\nmsgstr \"缺少較高的權限\"\n\n#. • MSG_289\nmsgid \"This application can only run with elevated privileges\"\nmsgstr \"此程式只能以較高的權限執行\"\n\n#. • MSG_290\nmsgid \"File Indexing\"\nmsgstr \"檔案索引屬性\"\n\n#. • MSG_291\nmsgid \"Version selection\"\nmsgstr \"版本選擇\"\n\n#. • MSG_292\nmsgid \"Please select the version of Windows you want to install:\"\nmsgstr \"請選擇你要安裝的 Windows 版本:\"\n\n#. • MSG_293\nmsgid \"Unsupported Windows version\"\nmsgstr \"不支援的 Windows 版本\"\n\n#. • MSG_294\nmsgid \"\"\n\"This version of Windows is no longer supported by Rufus.\\n\"\n\"The last version of Rufus compatible with this platform is v%d.%d.\"\nmsgstr \"\"\n\"Rufus 已不再支援此 Windows 版本。\\n\"\n\"此平台Rufus所支援的最新版本為v%d.%d。\"\n\n#. • MSG_295\nmsgid \"Warning: Unofficial version\"\nmsgstr \"警告: 非官方版本\"\n\n#. • MSG_296\nmsgid \"\"\n\"This version of Rufus was not produced by its official developer(s).\\n\"\n\"\\n\"\n\"Are you sure you want to run it?\"\nmsgstr \"\"\n\"此 Rufus 版本不是由官方開發者發布的。\\n\"\n\"\\n\"\n\"你確定要執行嗎?\"\n\n#. • MSG_297\nmsgid \"Truncated ISO detected\"\nmsgstr \"偵測到 ISO 映像檔不完整\"\n\n#. • MSG_298\nmsgid \"\"\n\"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\"\n\"\\n\"\n\"If you obtained this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match the official ones.\\n\"\n\"\\n\"\n\"Note that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\nmsgstr \"\"\n\"你選擇的 ISO 映像檔不符合它所宣告的大小: 缺少 %s !\\n\"\n\"\\n\"\n\"如果此檔案是從網路上下載的，請嘗試再次下載並且校驗 MD5 或 SHA 總和檢查碼是正確的。\\n\"\n\"\\n\"\n\"提示: 可點選狀態列 (✓) 按鈕來計算 MD5 或 SHA 總和檢查碼。\"\n\n#. • MSG_299\nmsgid \"Timestamp validation error\"\nmsgstr \"時間戳記驗證錯誤\"\n\n#. • MSG_300\nmsgid \"\"\n\"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the current executable.\\n\"\n\"\\n\"\n\"In order to prevent potential attack scenarios, the update process has been aborted and the download will be deleted. Please check the log for more details.\"\nmsgstr \"\"\n\"Rufus 不能驗證下載的更新其時間戳記比現有的執行檔還新。\\n\"\n\"\\n\"\n\"為避免可能的資安攻擊，更新流程已停止且下載的更新檔將會刪除。更多詳情請參見記錄檔。\"\n\n#. • MSG_301\nmsgid \"Show application settings\"\nmsgstr \"顯示應用程式設定\"\n\n#. • MSG_302\nmsgid \"Show information about this application\"\nmsgstr \"顯示此應用程式資訊\"\n\n#. • MSG_303\nmsgid \"Show the log\"\nmsgstr \"顯示記錄檔\"\n\n#. • MSG_304\nmsgid \"Create a disk image of the selected device\"\nmsgstr \"建立選擇的裝置的磁碟映像\"\n\n#. • MSG_305\nmsgid \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\nmsgstr \"是否要使用此裝置來安裝 Windows 在另一個磁碟上，或是要直接在此磁碟上執行 Windows (Windows To Go)。\"\n\n#. • MSG_306\n#.\n#. You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\n#. It's the same as MSG_286 but with a process that *may* be faster, hence the name.\nmsgid \"Fast-zeroing drive: %s\"\nmsgstr \"正在快速寫入零: %s\"\n\n#. • MSG_307\nmsgid \"this may take a while\"\nmsgstr \"可能需要一段時間\"\n\n#. • MSG_308\nmsgid \"VHD detection\"\nmsgstr \"虛擬硬碟偵測\"\n\n#. • MSG_309\nmsgid \"Compressed archive\"\nmsgstr \"壓縮檔\"\n\n#. • MSG_310\nmsgid \"\"\n\"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable for some types of installations.\\n\"\n\"\\n\"\n\"Please select the mode that you want to use to write this image:\"\nmsgstr \"\"\n\"你選擇的 ISO 使用 UEFI 可以直接當作 EFI System Partition (ESP)。比起占用整個通用磁區，使用 ESP 有時是更好的選擇。\\n\"\n\"\\n\"\n\"請選擇此映像檔的寫入模式:\"\n\n#. • MSG_311\nmsgid \"Use %s (in the main application window) to enable.\"\nmsgstr \"在主程式視窗按下 %s 以啟用。\"\n\n#. • MSG_312\nmsgid \"Extra hashes (SHA512)\"\nmsgstr \"額外雜湊值 (SHA512)\"\n\n#. • MSG_313\nmsgid \"Save to VHD\"\nmsgstr \"儲存至虛擬硬碟\"\n\n#. • MSG_314\nmsgid \"Compute image checksums\"\nmsgstr \"計算映像檔總和檢查碼\"\n\n#. • MSG_315\nmsgid \"Multiple buttons\"\nmsgstr \"數個按鈕\"\n\n#. • MSG_316\nmsgid \"Number of passes\"\nmsgstr \"檢查次數\"\n\n#. • MSG_317\nmsgid \"Disk ID\"\nmsgstr \"磁碟 ID\"\n\n#. • MSG_318\nmsgid \"Default thread priority: %d\"\nmsgstr \"預設執行緒優先順序: %d\"\n\n#. • MSG_319\nmsgid \"Ignore Boot Marker\"\nmsgstr \"忽略 Boot Marker\"\n\n#. • MSG_320\nmsgid \"Refreshing partition layout (%s)...\"\nmsgstr \"正在重新整理磁區分割 (%s)...\"\n\n#. • MSG_321\nmsgid \"\"\n\"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File copy mode.\\n\"\n\"As a result, DD image writing mode will be enforced.\"\nmsgstr \"\"\n\"你選擇的映像檔是 ISOHybrid，但是檔案作者沒有使之與 ISO/檔案複製模式相容。\\n\"\n\"因此強制使用 DD 映像寫入模式。\"\n\n#. • MSG_322\nmsgid \"Unable to open or read '%s'\"\nmsgstr \"無法開啟或讀取 '%s'\"\n\n#. • MSG_325\nmsgid \"Applying Windows customization: %s\"\nmsgstr \"正在套用 Windows 客製化設定：%s\"\n\n#. • MSG_326\nmsgid \"Applying user options...\"\nmsgstr \"正在套用使用者設定...\"\n\n#. • MSG_327\nmsgid \"Windows User Experience\"\nmsgstr \"Windows 使用者體驗\"\n\n#. • MSG_328\nmsgid \"Customize Windows installation?\"\nmsgstr \"客製化 Windows 安裝？\"\n\n#. • MSG_329\nmsgid \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\nmsgstr \"移除對 4GB+ 記憶體、安全開機和 TPM 2.0 的要求\"\n\n#. • MSG_330\nmsgid \"Remove requirement for an online Microsoft account\"\nmsgstr \"將登入微軟帳號的要求移除\"\n\n#. • MSG_331\nmsgid \"Disable data collection (Skip privacy questions)\"\nmsgstr \"關閉資料收集 (跳過隱私設定)\"\n\n#. • MSG_332\nmsgid \"Prevent Windows To Go from accessing internal disks\"\nmsgstr \"防止 Windows To Go 存取內部磁碟\"\n\n#. • MSG_333\nmsgid \"Create a local account with username:\"\nmsgstr \"使用此使用者名建立一個本機帳戶:\"\n\n#. • MSG_334\nmsgid \"Set regional options to the same values as this user's\"\nmsgstr \"使用目前用戶的區域設定\"\n\n#. • MSG_335\nmsgid \"Disable BitLocker automatic device encryption\"\nmsgstr \"關閉 BitLocker 自動設備加密\"\n\n#. • MSG_336\nmsgid \"Persistent log\"\nmsgstr \"持久化日誌\"\n\n#. • MSG_337\nmsgid \"\"\n\"An additional file ('diskcopy.dll') must be downloaded from Microsoft to install MS-DOS:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\\n\"\n\"\\n\"\n\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\nmsgstr \"\"\n\"必須從微軟下載額外的 'diskcopy.dll'  檔案，才能安裝 MS-DOS:\\n\"\n\"- 選 '是' 將連線到網路並進行下載\\n\"\n\"- 選 '否' 將取消操作\\n\"\n\"\\n\"\n\"註: 該檔案將被下載到 Rufus 所在的資料夾中，如果已存在將會自動使用。\"\n\n#. • MSG_338\nmsgid \"Revoked UEFI bootloader detected\"\nmsgstr \"偵測到被撤銷的 UEFI 開機引導程式\"\n\n#. • MSG_339\nmsgid \"\"\n\"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\"\n\"\\n\"\n\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\n\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\nmsgstr \"\"\n\"Rufus 偵測到選取的 ISO 包含一個被撤銷的 UEFI 開機引導程式，當你在完全更新的 UEFI 系統上啟用安全開機時，將產生 %s。\\n\"\n\"\\n\"\n\"- 如果你從無法信任的來源取得這個 ISO 映像，應該考慮到它可能包含 UEFI 惡意程式，並避免以此進行開機。\\n\"\n\"- 如果你從可以信任的來源取得，應該嘗試找到一個更新的版本，才不會出現這個警告。\"\n\n#. • MSG_340\nmsgid \"a \\\"Security Violation\\\" screen\"\nmsgstr \"一個 \\\"安全違規\\\" 畫面\"\n\n#. • MSG_341\nmsgid \"a Windows Recovery Screen (BSOD) with '%s'\"\nmsgstr \"一個有著 '%s' 的 Windows 復原畫面 (BSOD)\"\n\n#. • MSG_342\nmsgid \"Compressed VHDX Image\"\nmsgstr \"壓縮後的 VHDX 映像\"\n\n#. • MSG_343\nmsgid \"Uncompressed VHD Image\"\nmsgstr \"未壓縮的 VHD 映像\"\n\n#. • MSG_344\nmsgid \"Full Flash Update Image\"\nmsgstr \"完整寫入更新映像\"\n\n#. • MSG_345\nmsgid \"\"\n\"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\n\"- Select 'Yes' to connect to the Internet and download it\\n\"\n\"- Select 'No' to cancel the operation\"\nmsgstr \"\"\n\"必須從微軟下載一些額外的資料才能使用此功能:\\n\"\n\"- 選 '是' 將連線到網路並進行下載\\n\"\n\"- 選 '否' 將取消操作\"\n\n#. • MSG_346\nmsgid \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\nmsgstr \"將 Windows 限制為 S-模式 (不相容繞過線上帳號)。\"\n\n#. • MSG_347\nmsgid \"Expert Mode\"\nmsgstr \"專家模式\"\n\n#. • MSG_348\nmsgid \"Extracting archive files: %s\"\nmsgstr \"正在擷取封存檔案: %s\"\n\n#. • MSG_349\nmsgid \"Use Rufus MBR\"\nmsgstr \"使用 Rufus MBR\"\n\n#. • MSG_900\n#.\n#. The following messages are for the Windows Store listing only and are not used by the application\nmsgid \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\nmsgstr \"Rufus 是個能格式化並製作可開機 USB 快閃磁碟 (如 USB 隨身碟等) 的工具。\"\n\n#. • MSG_901\nmsgid \"Official site: %s\"\nmsgstr \"官方網站: %s\"\n\n#. • MSG_902\nmsgid \"Source Code: %s\"\nmsgstr \"原始碼: %s\"\n\n#. • MSG_903\nmsgid \"ChangeLog: %s\"\nmsgstr \"更新日誌: %s\"\n\n#. • MSG_904\n#.\n#. The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\n#. Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\nmsgid \"\"\n\"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\n\"\n\"See https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\nmsgstr \"\"\n\"本應用採用 GNU 通用公共許可證 (GPL) 第三版。\\n\"\n\"具體許可證見 https://www.gnu.org/licenses/gpl-3.0.zh-tw.html。\"\n\n#. • MSG_905\n#.\n#. Keyword for \"boot\" will be used for search in the Windows Store\nmsgid \"Boot\"\nmsgstr \"啟動\"\n\n#. • MSG_910\n#.\n#. This and subsequent messages will be listed in the 'Features' section of the Windows Store page\nmsgid \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\nmsgstr \"將隨身碟、記憶卡或虛擬光碟機格式化為 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式\"\n\n#. • MSG_911\nmsgid \"Create FreeDOS bootable USB drives\"\nmsgstr \"建立 FreeDOS  可開機隨身碟\"\n\n#. • MSG_912\nmsgid \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\nmsgstr \"從可開機 ISO 檔案 (Windows 和 Linux 等) 建立可開機隨身碟\"\n\n#. • MSG_913\nmsgid \"Create bootable drives from bootable disk images, including compressed ones\"\nmsgstr \"從可開機硬碟映像檔 (包括壓縮映像檔) 建立可開機隨身碟\"\n\n#. • MSG_914\nmsgid \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\nmsgstr \"建立 BIOS 或 UEFI 可開機隨身碟，包括 UEFI 下的可開機  NTFS 隨身碟\"\n\n#. • MSG_915\nmsgid \"Create 'Windows To Go' drives\"\nmsgstr \"建立 'Windows To Go' 隨身碟\"\n\n#. • MSG_916\nmsgid \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\nmsgstr \"為沒有 TPM 或安全開機功能的電腦建立 Windows 11 安裝隨身碟\"\n\n#. • MSG_917\nmsgid \"Create persistent Linux partitions\"\nmsgstr \"建立持續性 Linux 磁區\"\n\n#. • MSG_918\nmsgid \"Create VHD/DD images of the selected drive\"\nmsgstr \"為選取的磁碟機建立 VHD/DD 映像檔\"\n\n#. • MSG_919\nmsgid \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\nmsgstr \"計算被選取映像的 MD5、SHA-1、SHA-256 和 SHA-512 檢查碼\"\n\n#. • MSG_920\nmsgid \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\nmsgstr \"\"\n\"執行壞軌檢查，包括對”假“USB 快閃磁碟\\n\"\n\"的偵測\"\n\n#. • MSG_921\nmsgid \"Download official Microsoft Windows retail ISOs\"\nmsgstr \"下載微軟官方 Windows 映像檔\"\n\n#. • MSG_922\nmsgid \"Download UEFI Shell ISOs\"\nmsgstr \"下載 UEFI Shell 映像檔\"\n"
  },
  {
    "path": "res/loc/pollock/Pollock.cs",
    "content": "﻿/*\n * Rufus: The Reliable USB Formatting Utility\n * Poedit <-> rufus.loc conversion utility\n * Copyright © 2018-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/*\n * Icon courtesy of Axialis Fluent Pro 2018 - Letters and Symbols.\n * CC BY-ND 4.0 - https://www.axialis.com/icons.\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Net.Cache;\nusing System.Reflection;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing System.Threading;\nusing System.Windows.Forms;\n\n[assembly: AssemblyTitle(\"Pollock\")]\n[assembly: AssemblyDescription(\"Poedit ↔ Rufus loc conversion utility\")]\n[assembly: AssemblyCompany(\"Akeo Consulting\")]\n[assembly: AssemblyProduct(\"Pollock\")]\n[assembly: AssemblyCopyright(\"Copyright © 2018-2024 Pete Batard <pete@akeo.ie>\")]\n[assembly: AssemblyTrademark(\"GNU GPLv3\")]\n[assembly: AssemblyVersion(\"1.8.*\")]\n\nnamespace pollock\n{\n    public sealed class Message\n    {\n        public string id;\n        public string str;\n        public Message(string id, string str)\n        {\n            this.id = id;\n            this.str = str;\n        }\n    }\n\n    public sealed class Id\n    {\n        public string group;\n        public string id;\n        public Id(string group, string id)\n        {\n            this.group = group;\n            this.id = id;\n        }\n\n        public override bool Equals(object obj)\n        {\n            Id o = obj as Id;\n\n            return (o.group == this.group) && (o.id == this.id);\n        }\n\n        public override int GetHashCode()\n        {\n            return (this.group + \":\" + this.id).GetHashCode();\n        }\n\n        public override string ToString()\n        {\n            if (this.group == \"MSG\")\n                return this.id;\n            return this.group + \" → \" + this.id;\n        }\n    }\n\n    public sealed class Language\n    {\n        public string id;\n        public string name;\n        public string version;\n        public string lcid;\n        public SortedDictionary<string, List<Message>> sections;\n        public Dictionary<Id, string> comments;\n        public Dictionary<Id, string> id_to_str;\n        public Language()\n        {\n            sections = new SortedDictionary<string, List<Message>>();\n            comments = new Dictionary<Id, string>();\n            id_to_str = new Dictionary<Id, string>();\n        }\n    }\n\n    class Pollock\n    {\n        private static string app_name = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Assembly.GetExecutingAssembly().GetName().Name);\n        private static string app_dir = AppDomain.CurrentDomain.BaseDirectory;\n        private static int[] version = new int[2]\n            { Assembly.GetEntryAssembly().GetName().Version.Major, Assembly.GetEntryAssembly().GetName().Version.Minor };\n        private static string version_str = \"v\" + version[0].ToString() + \".\" + version[1].ToString();\n        private static bool cancel_requested = false;\n        private const string LANG_ID = \"Language\";\n        private const string LANG_NAME = \"X-Rufus-LanguageName\";\n        private const string LANG_VERSION = \"Project-Id-Version\";\n        private const string LANG_LCID = \"X-Rufus-LCID\";\n        private static Encoding encoding = new UTF8Encoding(false);\n        private static List<string> rtl_languages = new List<string> { \"ar-SA\", \"he-IL\", \"fa-IR\" };\n        private static Stopwatch sw = new System.Diagnostics.Stopwatch();\n        private static DateTime last_changed = DateTime.MinValue;\n        private static int download_status;\n        private static int console_x_pos;\n        private static bool in_progress = false;\n        private static double speed = 0.0f;\n\n        /// <summary>\n        /// Wait for a key to be pressed.\n        /// </summary>\n        static void WaitForKey(string msg = null)\n        {\n            if (msg == null)\n                msg = \"Press any key to continue...\";\n            // Flush the input buffer\n            while (Console.KeyAvailable)\n                Console.ReadKey(true);\n            Console.WriteLine(\"\");\n            Console.WriteLine(msg);\n            while (!Console.KeyAvailable)\n                Thread.Sleep(50);\n            Console.ReadKey(true);\n            while (Console.KeyAvailable)\n                Console.ReadKey(true);\n        }\n\n        /// <summary>\n        /// Import languages from an existing Rufus loc file\n        /// </summary>\n        /// <param name=\"file\">The name of the loc file.</param>\n        /// <param name=\"select_id\">(Optional) If specified, only the language with this id, along with en-US will be returned.</param>\n        /// <returns>A list of Language elements.</returns>\n        static List<Language> ParseLocFile(string file, string select_id = null)\n        {\n            var lines = File.ReadAllLines(file);\n            int line_nr = 0;\n            string format = \"D\" + (int)(Math.Log10((double)lines.Count()) + 0.99999);\n            string last_key = null;\n            string section_name = null;\n            string comment = null;\n            List<string> parts;\n            List<Language> langs = new List<Language>();\n            Language lang = null;\n            bool skip_line = false;\n            bool found_my_id = false;\n            Id id;\n\n            if (!File.Exists(file))\n            {\n                Console.Error.WriteLine($\"Could not open {file}\");\n                return null;\n            }\n\n            Console.Write($\"Importing data from '{file}'... \");\n\n            foreach (var line in lines)\n            {\n                if ((cancel_requested) || (found_my_id && skip_line))\n                    break;\n                ++line_nr;\n                //Console.SetCursorPosition(0, Console.CursorTop);\n                //Console.Write($\"[{line_nr.ToString(format)}/{lines.Count()}] \");\n                var data = line.Trim();\n                int i = data.IndexOf(\"#\");\n                if (i > 0)\n                {\n                    comment = data.Substring(i + 1).Trim();\n                    data = data.Substring(0, i).Trim();\n                }\n                if (string.IsNullOrEmpty(data))\n                    continue;\n                if (skip_line && data[0] != 'l')\n                    continue;\n                switch (data[0])\n                {\n                    case '#':\n                        comment += data.Substring(1).Trim() + \"\\n\";\n                        break;\n                    case 'l':\n                        comment = null;\n                        parts = Regex.Matches(data, @\"[\\\"\"].+?[\\\"\"]|[^ ]+\")\n                            .Cast<Match>()\n                            .Select(m => m.Value)\n                            .ToList();\n                        if (parts.Count < 4)\n                        {\n                            Console.WriteLine(\"Error: Invalid 'l' command\");\n                            return null;\n                        }\n                        string cur_id = parts[1].Replace(\"\\\"\", \"\");\n                        if (select_id != null)\n                        {\n                            if ((select_id == \"en-US\") && (cur_id != \"en-US\"))\n                                skip_line = true;\n                            else if ((!skip_line) && (select_id != cur_id) && (cur_id != \"en-US\"))\n                                skip_line = true;\n                            else if (skip_line && (select_id == cur_id))\n                                skip_line = false;\n                            if (select_id == cur_id)\n                                found_my_id = true;\n                            if (skip_line)\n                                break;\n                        }\n                        if (lang != null)\n                            langs.Add(lang);\n                        lang = new Language();\n                        lang.id = parts[1].Replace(\"\\\"\", \"\");\n                        lang.name = parts[2].Replace(\"\\\"\", \"\");\n                        //Console.WriteLine($\"Found language {lang.id} '{lang.name}'\");\n                        lang.lcid = parts[3];\n                        for (i = 4; i < parts.Count; i++)\n                            lang.lcid += \" \" + parts[i];\n                        break;\n                    case 'a':\n                        // This attribute will be restored manually\n                        break;\n                    case 'g':\n                        comment = null;\n                        section_name = data.Substring(2).Trim();\n                        lang.sections.Add(section_name, new List<Message>());\n                        break;\n                    case 'v':\n                        lang.version = data.Substring(2).Trim();\n                        break;\n                    case 't':\n                        if (data.StartsWith(\"t MSG\") && section_name != \"MSG\")\n                        {\n                            section_name = \"MSG\";\n                            lang.sections.Add(section_name, new List<Message>());\n                        }\n                        if (data[1] != ' ')\n                        {\n                            Console.WriteLine(\"Error: Invalid 'l' command\");\n                            continue;\n                        }\n                        parts = Regex.Matches(data, @\"(?<!\\\\)\"\".*?(?<!\\\\)\"\"|[^ ]+\")\n                            .Cast<Match>()\n                            .Select(m => m.Value)\n                            .ToList();\n                        if (parts.Count != 3)\n                        {\n                            Console.WriteLine(\"Error: Invalid 'l' command\");\n                            continue;\n                        }\n                        lang.sections[section_name].Add(new Message(parts[1], parts[2]));\n                        // We also maintain global list of Id -> str for convenience\n                        try\n                        {\n                            lang.id_to_str.Add(new Id(section_name, (parts[1])), parts[2]);\n                        }\n                        catch (Exception e)\n                        {\n                            Console.WriteLine($\"Error for {parts[1]}: \" + e.Message);\n                            continue;\n                        }\n                            last_key = parts[1];\n                        if (comment != null)\n                        {\n                            id = new Id(section_name, last_key);\n                            lang.comments[id] = comment.Trim();\n                            comment = null;\n                        }\n                        break;\n                    case '\"':\n                        if (String.IsNullOrEmpty(last_key))\n                        {\n                            Console.WriteLine($\"Error: No previous key for {data}\");\n                            continue;\n                        }\n                        lang.sections[section_name].Last().str += data;\n                        lang.sections[section_name].Last().str = lang.sections[section_name].Last().str.Replace(\"\\\"\\\"\", \"\");\n                        id = new Id(section_name, last_key);\n                        lang.id_to_str[id] += data;\n                        lang.id_to_str[id] = lang.id_to_str[id].Replace(\"\\\"\\\"\", \"\");\n                        break;\n                }\n            }\n            if (lang != null)\n                langs.Add(lang);\n\n            Console.WriteLine(cancel_requested ? \"CANCELLED\" : \"DONE\");\n\n            return langs;\n        }\n\n        /// <summary>\n        /// Create .po/.pot files from a list of Language elements.\n        /// </summary>\n        /// <param name=\"langs\">A list of Language objects to process.</param>\n        /// <param name=\"old_en_US\">(Optional) A previous version of en-US to use for comparison.</param>\n        /// <param name=\"path\">(Optional) The path where the .po/.pot files should be created.</param>\n        /// <returns>The number of PO files created.</returns>\n        static int CreatePoFiles(List<Language> langs, Language old_en_US = null, string path = null)\n        {\n            if (langs == null)\n                return 0;\n\n            var cur_en_US = langs.Find(x => x.id == \"en-US\");\n            if (cur_en_US == null)\n                return 0;\n\n            if (path == null)\n                path = app_dir;\n            if (!path.EndsWith(\"\\\\\"))\n                path += '\\\\';\n\n            // Build the list of all the current IDs we need to process\n            var en_ids = new List<Id>();\n            foreach (var kvp in cur_en_US.id_to_str)\n                en_ids.Add(new Id(kvp.Key.group, kvp.Key.id));\n\n            var added_ids = new List<Id>();\n            var modified_ids = new List<Id>();\n\n            if (old_en_US != null)\n            {\n                foreach (var id in cur_en_US.id_to_str.Keys)\n                {\n                    if (!old_en_US.id_to_str.ContainsKey(id))\n                    {\n                        // ID is not present in old -> added\n                        //Console.WriteLine($\"ADDED: {id} = {cur_en_US.id_to_str[id]}\");\n                        added_ids.Add(id);\n                    }\n                    else if (old_en_US.id_to_str[id] != cur_en_US.id_to_str[id])\n                    {\n                        // Ignore messages where we just removed the trailing \\n\n                        if (!old_en_US.id_to_str[id].EndsWith(\"\\\\n\\\"\"))\n                        {\n                            // ID exists in both but str has changed -> modified\n                            //Console.WriteLine($\"MODIFIED: {id} = {old_en_US.id_to_str[id]} → {cur_en_US.id_to_str[id]}\");\n                            modified_ids.Add(id);\n                        }\n                    }\n                }\n            }\n\n            int nb_po_saved = 0;\n            foreach (var lang in langs)\n            {\n                bool is_pot = (lang.id == \"en-US\");\n                // Don't create the .pot if we are producing a merge\n                if (is_pot && old_en_US != null)\n                    continue;\n                var target = path + (is_pot ? \"rufus.pot\" : lang.id + \".po\");\n                if (old_en_US != null)\n                    Console.Write($\"Computing differences and creating '{target}'... \");\n                else\n                    Console.Write($\"Creating '{target}'... \");\n\n                using (var writer = new StreamWriter(target, false, encoding))\n                {\n                    writer.WriteLine();\n                    writer.WriteLine(\"msgid \\\"\\\"\");\n                    writer.WriteLine(\"msgstr \\\"\\\"\");\n                    writer.WriteLine($\"\\\"Project-Id-Version: {((old_en_US != null) ? cur_en_US.version : lang.version)}\\\\n\\\"\");\n                    writer.WriteLine($\"\\\"Report-Msgid-Bugs-To: pete@akeo.ie\\\\n\\\"\");\n                    writer.WriteLine($\"\\\"POT-Creation-Date: {DateTime.Now.ToString(\"yyyy-MM-dd HH:mmzz00\")}\\\\n\\\"\");\n                    if (is_pot)\n                        writer.WriteLine($\"\\\"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\\\n\\\"\");\n                    else\n                        writer.WriteLine($\"\\\"PO-Revision-Date: {DateTime.Now.ToString(\"yyyy-MM-dd HH:mmzz00\")}\\\\n\\\"\");\n                    writer.WriteLine($\"\\\"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\\\n\\\"\");\n                    writer.WriteLine($\"\\\"Language-Team: LANGUAGE <LL@li.org>\\\\n\\\"\");\n                    writer.WriteLine($\"\\\"Language: {lang.id.Replace('-', '_')}\\\\n\\\"\");\n                    writer.WriteLine($\"\\\"MIME-Version: 1.0\\\\n\\\"\");\n                    writer.WriteLine($\"\\\"Content-Type: text/plain; charset=UTF-8\\\\n\\\"\");\n                    writer.WriteLine($\"\\\"Content-Transfer-Encoding: 8bit\\\\n\\\"\");\n                    writer.WriteLine($\"\\\"X-Poedit-SourceCharset: UTF-8\\\\n\\\"\");\n                    writer.WriteLine($\"\\\"X-Rufus-LanguageName: {lang.name}\\\\n\\\"\");\n                    writer.WriteLine($\"\\\"X-Rufus-LCID: {lang.lcid}\\\\n\\\"\");\n\n                    var dupes = new List<string>();\n\n                    foreach(var id in en_ids)\n                    {\n                        var en_str = cur_en_US.sections[id.group].Find(x => x.id == id.id).str;\n                        // Handle duplicate IDs\n                        if (dupes.Contains(en_str))\n                            continue;\n\n                        writer.WriteLine();\n\n                        var cid_list = cur_en_US.id_to_str.Where(x => x.Value == en_str).Select(x => x.Key);\n                        foreach (var cid in cid_list)\n                            writer.WriteLine($\"#. • {cid}\");\n                        if (cid_list.Count() > 1)\n                            dupes.Add(en_str);\n\n                        if (cur_en_US.comments.ContainsKey(id))\n                        {\n                            writer.WriteLine(\"#.\");\n                            foreach (var comment in cur_en_US.comments[id].Split('\\n'))\n                                if (comment.Trim() != \"\")\n                                    writer.WriteLine(\"#. \" + comment);\n                        }\n                        if (!is_pot && lang.comments.ContainsKey(id))\n                        {\n                            foreach (var comment in lang.comments[id].Split('\\n'))\n                                if (comment.Trim() != \"\")\n                                    writer.WriteLine(\"# \" + comment);\n                        }\n                        // Flag the new/modified messages as requiring work\n                        if ((old_en_US != null) && (added_ids.Contains(id) || modified_ids.Contains(id)))\n                            writer.WriteLine(\"#, fuzzy\");\n                        string msg_str = lang.sections[id.group].Where(x => x.id == id.id).Select(x => x.str).FirstOrDefault();\n                        // Special case for MSG_176, which we need to replace\n                        if (id.group == \"MSG\" && id.id == \"MSG_176\")\n                            en_str = \"\\\"English translation: Pete Batard <mailto:pete@akeo.ie>\\\"\";\n                        // Special case for MSG_240, which we missed in the last round\n                        if (id.group == \"MSG\" && id.id == \"MSG_240\" && msg_str == null)\n                            writer.WriteLine(\"#, fuzzy\");\n                        if (msg_str == null)\n                            msg_str = \"\\\"\\\"\";\n                        if (is_pot)\n                        {\n                            writer.WriteLine($\"msgid {msg_str}\");\n                            writer.WriteLine(\"msgstr \\\"\\\"\");\n                        }\n                        else\n                        {\n                            writer.WriteLine($\"msgid {en_str}\");\n                            writer.WriteLine($\"msgstr {((msg_str == en_str) ? \"\\\"\\\"\" : msg_str)}\");\n                        }\n                    }\n                }\n                nb_po_saved++;\n                Console.WriteLine(\"DONE\");\n            }\n            return nb_po_saved;\n        }\n\n        /// <summary>\n        /// Create a Language entry from a .po or .pot file.\n        /// </summary>\n        /// <param name=\"file\">The name of the .po/.pot file.</param>\n        /// <returns>A Language element or null on error.</returns>\n        static Language ParsePoFile(string file)\n        {\n            if (!File.Exists(file))\n            {\n                Console.Error.WriteLine($\"Could not open {file}\");\n                return null;\n            }\n            Console.Write($\"Importing data from '{file}'... \");\n            bool is_pot = file.EndsWith(\".pot\");\n            bool file_locked = true;\n            string[] lines = null;\n            // May get an I/O exception if Poedit is not done\n            do\n            {\n                try\n                {\n                    lines = File.ReadAllLines(file);\n                    file_locked = false;\n                }\n                catch (IOException)\n                {\n                    if (cancel_requested)\n                        return null;\n                    Thread.Sleep(100);\n                }\n            }\n            while (file_locked);\n            string format = \"D\" + (int)(Math.Log10((double)lines.Count()) + 0.99999);\n            int line_nr = 0;\n            // msg_data[0] -> msgid, msg_data[1] -> msgstr\n            string[] msg_data = new string[2] { null, null };\n            Language lang = new Language();\n            List<Id> ids = new List<Id>();\n            List<string> comments = new List<string>();\n            List<string> codes = new List<string>();\n            int msg_type = 0;\n\n            foreach (var line in lines)\n            {\n                if (cancel_requested)\n                    break;\n                ++line_nr;\n                var data = line.Trim();\n                if (!data.StartsWith(\"\\\"\"))\n                {\n                    var options = new Dictionary<string, string>();\n                    if ((msg_type == 1) && (string.IsNullOrEmpty(msg_data[0])) && (!string.IsNullOrEmpty(msg_data[1])))\n                    {\n                        // Process the header\n                        string[] header = msg_data[1].Split(new string[] { \"\\\\n\" }, StringSplitOptions.None);\n                        foreach (string header_line in header)\n                        {\n                            if (string.IsNullOrEmpty(header_line))\n                                continue;\n                            var sep = header_line.IndexOf(\":\");\n                            if (sep <= 0)\n                            {\n                                Console.WriteLine($\"ERROR: Invalid header line '{header_line}'\");\n                                continue;\n                            }\n                            options.Add(header_line.Substring(0, sep).Trim(), header_line.Substring(sep + 1).Trim());\n                        }\n                        lang.id = options[LANG_ID].Replace('_', '-');\n                        lang.name = options[LANG_NAME];\n                        lang.version = options[LANG_VERSION];\n                        lang.lcid = options[LANG_LCID];\n                    }\n                }\n                if (data.StartsWith(\"\\\"\"))\n                {\n                    if (data[data.Length - 1] != '\"')\n                    {\n                        Console.WriteLine(\"ERROR: Unexpected quoted data\");\n                        continue;\n                    }\n                    msg_data[msg_type] += data.Substring(1, data.Length - 2);\n                }\n                else if (data.StartsWith(\"msgid \"))\n                {\n                    if (data[6] != '\"')\n                    {\n                        Console.WriteLine(\"ERROR: Unexpected data after 'msgid'\");\n                        continue;\n                    }\n                    msg_type = 0;\n                    msg_data[msg_type] = data.Substring(7, data.Length - 8);\n                }\n                else if (data.StartsWith(\"msgstr \"))\n                {\n                    if (data[7] != '\"')\n                    {\n                        Console.WriteLine(\"ERROR: Unexpected data after 'msgstr'\");\n                        continue;\n                    }\n                    msg_type = 1;\n                    msg_data[msg_type] = data.Substring(8, data.Length - 9);\n                }\n                else if (data.StartsWith(\"#. •\"))\n                {\n                    if (data.StartsWith(\"#. • MSG\"))\n                    {\n                        ids.Add(new Id(\"MSG\", data.Substring(5).Trim()));\n                    }\n                    else\n                    {\n                        string[] str = data.Substring(5).Split(new string[] { \" → \" }, StringSplitOptions.None);\n                        if (str.Length != 2)\n                            Console.WriteLine($\"ERROR: Invalid ID {data}\");\n                        else\n                            ids.Add(new Id(str[0].Trim(), str[1].Trim()));\n                    }\n                }\n                else if ((is_pot && (data.StartsWith(\"#. \"))) || (!is_pot && (data.StartsWith(\"# \"))))\n                {\n                    if (comments == null)\n                        comments = new List<string>();\n                    comments.Add(data.Substring(2).Trim());\n                }\n                // Break or EOF => Process the previous section\n                if (string.IsNullOrEmpty(data) || (line_nr == lines.Count()))\n                {\n                    if ((!string.IsNullOrEmpty(msg_data[0])) && (ids.Count() != 0))\n                    {\n                        foreach (var id in ids)\n                        {\n                            if (comments != null)\n                            {\n                                lang.comments.Add(id, \"\");\n                                foreach (var comment in comments)\n                                    lang.comments[id] += comment + \"\\n\";\n                            }\n                            // Ignore messages that have the same translation as en-US\n                            if (msg_data[0] == msg_data[1])\n                                continue;\n                            // Ignore blank translations\n                            if (!is_pot && string.IsNullOrEmpty(msg_data[1]))\n                                continue;\n                            if (!lang.sections.ContainsKey(id.group))\n                                lang.sections.Add(id.group, new List<Message>());\n                            lang.sections[id.group].Add(new Message(id.id, msg_data[is_pot ? 0 : 1]));\n                        }\n                    }\n                    ids = new List<Id>();\n                    comments = null;\n                }\n            }\n\n            // Sort the MSG section alphabetically\n            lang.sections[\"MSG\"] = lang.sections[\"MSG\"].OrderBy(x => x.id).ToList();\n\n            Console.WriteLine(cancel_requested ? \"CANCELLED\" : \"DONE\");\n\n            return lang;\n        }\n\n        /// <summary>\n        /// Write a loc language section.\n        /// </summary>\n        /// <param name=\"writer\">A streamwriter to the file to write to.</param>\n        /// <param name=\"lang\">The Language to write.</param>\n        static void WriteLoc(StreamWriter writer, Language lang)\n        {\n            bool is_pot = (lang.id == \"en-US\");\n            bool is_rtl = rtl_languages.Contains(lang.id);\n            writer.WriteLine($\"l \\\"{lang.id}\\\" \\\"{lang.name}\\\" {lang.lcid}\");\n            writer.WriteLine($\"v {lang.version}\");\n            if (!is_pot)\n                writer.WriteLine(\"b \\\"en-US\\\"\");\n            if (is_rtl)\n                writer.WriteLine(\"a \\\"r\\\"\");\n\n            var sections = lang.sections.Keys.ToList();\n            foreach (var section in sections)\n            {\n                writer.WriteLine();\n                if (section != \"MSG\")\n                    writer.WriteLine($\"g {section}\");\n                foreach (var msg in lang.sections[section])\n                {\n                    var id = new Id(section, msg.id);\n                    if (lang.comments.ContainsKey(id))\n                    {\n                        foreach (var l in lang.comments[id].Split('\\n'))\n                            if (l.Trim() != \"\")\n                                writer.WriteLine($\"# {l}\");\n                    }\n                    writer.WriteLine($\"t {msg.id} \\\"{msg.str}\\\"\");\n                }\n            }\n        }\n\n        /// <summary>\n        /// Update a rufus.loc section from a language element.\n        /// </summary>\n        /// <param name=\"lang\">The Language elements to update.</param>\n        /// <param name=\"path\">(Optional) The path where 'rufus.loc' is located.</param>\n        /// <returns>true on success, false on error.</returns>\n        static bool UpdateLocFile(Language lang, string path = null)\n        {\n            if (lang == null)\n                return false;\n            if (path == null)\n                path = app_dir;\n            if (!path.EndsWith(\"\\\\\"))\n                path += '\\\\';\n\n            var target = path + \"rufus.loc\";\n            var lines = File.ReadAllLines(target);\n            using (var writer = new StreamWriter(target, false, encoding))\n            {\n                bool skip = false;\n                foreach (var line in lines)\n                {\n                    if (line.StartsWith($\"# • v\"))\n                    {\n                        var parts = line.Split('\"');\n                        if (parts.Count() < 2)\n                        {\n                            writer.WriteLine(line);\n                            continue;\n                        }\n                        if (parts[1] != lang.id)\n                        {\n                            writer.WriteLine(line);\n                            continue;\n                        }\n                        writer.WriteLine($\"# • v{lang.version,-4} \\\"{lang.id}\\\" \\\"{lang.name}\\\"\");\n                        continue;\n                    }\n                    else if (line.StartsWith($\"l \\\"{lang.id}\\\"\"))\n                    {\n                        skip = true;\n                        WriteLoc(writer, lang);\n                        writer.WriteLine();\n                    }\n                    else if (line.StartsWith(\"######\"))\n                    {\n                        skip = false;\n                    }\n                    if (!skip)\n                        writer.WriteLine(line);\n                }\n            }\n            return true;\n        }\n\n        /// <summary>\n        /// Create a new rufus.loc from a list of Language elements.\n        /// </summary>\n        /// <param name=\"list\">The list of Language elements.</param>\n        /// <param name=\"path\">(Optional) The path where the new 'rufus.loc' should be created.</param>\n        /// <returns>true on success, false on error.</returns>\n        static bool SaveLocFile(List<Language> list, string path = null)\n        {\n            if ((list == null) || (list.Count == 0))\n                return false;\n            if (path == null)\n                path = app_dir;\n            if (!path.EndsWith(\"\\\\\"))\n                path += '\\\\';\n            var target = path + \"rufus.loc\";\n\n            sw.Start();\n\n            Console.WriteLine($\"Creating '{target}':\");\n            using (var writer = new StreamWriter(target, false, encoding))\n            {\n                var notice = $\"### Autogenerated by {app_name} {version_str} for use with Rufus - DO NOT EDIT!!! ###\";\n                var sep = new String('#', notice.Length);\n                writer.WriteLine(sep);\n                writer.WriteLine(notice);\n                writer.WriteLine(sep);\n                writer.WriteLine();\n                writer.WriteLine(\"# List of all languages included in this file (with version)\");\n                foreach (var lang in list)\n                {\n                    writer.WriteLine($\"# • v{lang.version, -4} \\\"{lang.id}\\\" \\\"{lang.name}\\\"\");\n                }\n                foreach (var lang in list)\n                {\n                    if (cancel_requested)\n                        break;\n                    Console.WriteLine($\"Adding {lang.id}\");\n                    writer.WriteLine();\n                    writer.WriteLine(sep);\n                    WriteLoc(writer, lang);\n                }\n            }\n\n            sw.Stop();\n            Console.WriteLine($\"{(cancel_requested ? \"CANCELLED after\" : \"DONE in\")}\" +\n                $\" {sw.ElapsedMilliseconds / 1000.0}s.\");\n            sw.Reset();\n\n            return true;\n        }\n\n        /// <summary>\n        /// Download a file as a string. Codepage is assumed to be UTF-8.\n        /// </summary>\n        /// <param name=\"url\">The URL to download from.</param>\n        /// <returns>The downloaded string or null on error.</returns>\n        static string DownloadString(string url)\n        {\n            string str = null;\n\n            using (WebClient wc = new WebClient())\n            {\n                try\n                {\n                    str = System.Text.Encoding.UTF8.GetString(wc.DownloadData(new Uri(url)));\n                }\n                catch (Exception e)\n                {\n                    Console.WriteLine(\"ERROR: \" + e.Message);\n                    return null;\n                }\n            }\n            return str;\n        }\n\n        /// <summary>\n        /// Download a file.\n        /// </summary>\n        /// <param name=\"url\">The URL to download from.</param>\n        /// <param name=\"dest\">(Optional) The destination file.\n        /// If not provided the file is saved in the current directory, using the last part of the URL as its name.</param>\n        /// <returns>true if the download was complete, false otherwise.</returns>\n        static bool DownloadFile(string url, string dest = null)\n        {\n            download_status = 0;\n            in_progress = false;\n            var uri = new Uri(url);\n\n            if (dest == null)\n                dest = url.Split('/').Last();\n\n            console_x_pos = Console.CursorLeft;\n            using (WebClient wc = new WebClient())\n            {\n                wc.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);\n                wc.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadCompleted);\n                wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgress);\n\n                sw.Start();\n\n                try\n                {\n                    wc.DownloadFileAsync(uri, dest);\n                }\n                catch (Exception e)\n                {\n                    Console.WriteLine(\" Error: \" + e.Message);\n                    return false;\n                }\n            }\n            while (download_status == 0)\n                Thread.Sleep(100);\n\n            Console.WriteLine();\n            if (download_status == 1)\n                return true;\n\n            Console.WriteLine($\"Download has {((download_status == 2) ? \"been cancelled\" : \"failed\")}.\");\n            return false;\n        }\n\n        // Progress event used by DownloadFile()\n        static void DownloadProgress(object sender, DownloadProgressChangedEventArgs e)\n        {\n            if (cancel_requested)\n            {\n                ((WebClient)sender).CancelAsync();\n                return;\n            }\n\n            // Prevent this call from being re-entrant\n            if (in_progress)\n                return;\n            in_progress = true;\n\n            speed = (e.BytesReceived / 1024d / sw.Elapsed.TotalSeconds);\n            Console.SetCursorPosition(console_x_pos, Console.CursorTop);\n            Console.Write($\"{e.ProgressPercentage.ToString(\"0.0\"), 5}% ({speed.ToString(\"0.00\")} KB/s)\");\n            in_progress = false;\n        }\n\n        // Completed event used by DownloadFile()\n        static void DownloadCompleted(object sender, AsyncCompletedEventArgs e)\n        {\n            Console.SetCursorPosition(console_x_pos, Console.CursorTop);\n            sw.Reset();\n            if (e.Error != null)\n            {\n                Console.Write(\"Error: \" + e.Error.Message);\n                download_status = 3;\n            }\n            else\n            {\n                Console.Write($\"{100.0d.ToString(\"0.0\"),5}% ({speed.ToString(\"0.00\")} KB/s) {(e.Cancelled ? \"CANCELLED\" : \"DONE\")}\");\n                download_status = (e.Cancelled) ? 2 : 1;\n            }\n        }\n\n        /// <summary>\n        /// Prompt a user for a Y/N question.\n        /// </summary>\n        /// <param name=\"question\">The question string.</param>\n        /// <returns>true if the user answered 'Y'.</returns>\n        static bool PromptForQuestion(string question)\n        {\n            ConsoleKey response;\n            do\n            {\n                Console.Write(question + \" [y/n] \");\n                console_x_pos = Console.CursorLeft - 6;\n                response = Console.ReadKey(false).Key;\n                if (response != ConsoleKey.Enter)\n                    Console.WriteLine();\n            } while (response != ConsoleKey.Y && response != ConsoleKey.N);\n            // Flush\n            while (Console.KeyAvailable)\n                Console.ReadKey(true);\n            return (response == ConsoleKey.Y);\n        }\n\n        //\n        // Main entrypoint.\n        //\n        static void Main(string[] args)\n        {\n            // Fix needed for Windows 7 to download from github SSL\n            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;\n\n            // Also set the Console width to something that can accommodate us\n            if (Console.WindowWidth < 100)\n                Console.SetWindowSize(100, Console.WindowHeight);\n\n            bool maintainer_mode = false;\n            Console.OutputEncoding = System.Text.Encoding.UTF8;\n            Console.CancelKeyPress += delegate (object sender, ConsoleCancelEventArgs e) {\n                e.Cancel = true;\n                cancel_requested = true;\n            };\n            Console.WriteLine($\"{app_name} {version_str} - Poedit to rufus.loc conversion utility\");\n            Console.WriteLine();\n\n            string loc_url = \"https://github.com/pbatard/rufus/raw/master/res/loc/rufus.loc\";\n            string ver_url = \"https://rufus.ie/Loc.ver\";\n            string rufus_url = null;\n            string rufus_file = null;\n            string download_url = null;\n            string po_file = null;\n            string loc_file = null;\n            string id = \"\", name = \"\";\n            int[] update_version = new int[2] { 0, 0 };\n            var list = new List<string[]>();\n            int index = -1;\n\n            // Parse parameters\n            foreach (var arg in args)\n            {\n                if (arg.Contains(\"i\"))\n                {\n                    maintainer_mode = true;\n                    goto Import;\n                }\n                else if (arg.Contains(\"l\"))\n                {\n                    loc_file = @\"..\\rufus.loc\";\n                    foreach (var line in File.ReadAllLines(loc_file))\n                    {\n                        if (line.StartsWith(\"l \"))\n                        {\n                            var el = line.Split('\\\"');\n                            id = el[1];\n                            name = el[3].Split('(')[0].Trim();\n                        }\n                        else if (line.StartsWith(\"v \"))\n                        {\n                            list.Add(new string[] { name, id, line.Substring(2) });\n                        }\n                    }\n                    maintainer_mode = true;\n                    goto Menu;\n                }\n            }\n\n            // Check for updates of this application\n            Console.Write(\"Downloading latest application data... \");\n            var ver = DownloadString(ver_url);\n            if (ver == null)\n            {\n                Console.WriteLine(\"ERROR: Could not access application data.\");\n                goto Exit;\n            }\n            foreach (var line in ver.Split('\\n'))\n            {\n                var parts = line.Split('=');\n                if (parts.Count() < 2)\n                    continue;\n                switch(parts[0].Trim())\n                {\n                    case \"version\":\n                        Int32.TryParse(parts[1].Split('.')[0], out update_version[0]);\n                        Int32.TryParse(parts[1].Split('.')[1], out update_version[1]);\n                        break;\n                    case \"download_url\":\n                        download_url = parts[1].Trim();\n                        break;\n                    case \"rufus_url\":\n                        rufus_url = parts[1].Trim();\n                        break;\n                }\n            }\n            if ((download_url == null) || (rufus_url == null) || (update_version[0] == 0))\n            {\n                Console.WriteLine(\"FAILED\");\n                goto Exit;\n            }\n            Console.WriteLine(\"DONE\");\n\n            // Download new version\n            if ((update_version[0] > version[0]) || ((update_version[0] == version[0]) && (update_version[1] > version[1])))\n            {\n                Console.WriteLine();\n                if (PromptForQuestion(\"A new version of this application is available! Do you want to download it?\"))\n                {\n                    if (DownloadFile(download_url))\n                    {\n                        Console.WriteLine(\"Now re-launch this program using the latest version.\");\n                        goto Exit;\n                    }\n                    Console.WriteLine(\"Download failed.\");\n                }\n            }\n\n            if (rufus_url != null)\n            {\n                // Download the latest version of Rufus to use for translations\n                rufus_file = rufus_url.Split('/').Last();\n                Console.Write($\"Checking for the presence of '{rufus_file}'... \");\n                if (File.Exists(rufus_file))\n                {\n                    Console.WriteLine(\"FOUND\");\n                }\n                else\n                {\n                    var rufus_name = rufus_url.Split('/').Last();\n                    Console.WriteLine(\"MISSING\");\n                    Console.WriteLine($\"{rufus_name} doesn't exist in your translation directory.\");\n                    Console.WriteLine(\"This is the required version to validate your changes.\");\n                    if (PromptForQuestion($\"Do you want to download {rufus_name}?\")) {\n                        Console.SetCursorPosition(console_x_pos, Console.CursorTop - 1);\n                        DownloadFile(rufus_url);\n                    }\n                }\n            }\n\n            if (!maintainer_mode)\n            {\n                // Download the latest loc file\n                Console.Write(\"Downloading the latest loc file... \");\n                if (!DownloadFile(loc_url))\n                    goto Exit;\n            }\n            else\n            {\n                var local_loc = @\"C:\\Projects\\rufus\\res\\loc\\rufus.loc\";\n                Console.Write($\"Copying loc file from '{local_loc}'... \");\n                File.Copy(local_loc, \"rufus.loc\", true);\n            }\n\n            loc_file = loc_url.Split('/').Last();\n            // Convert to CRLF and get all the language ids\n            var lines = File.ReadAllLines(loc_file);\n            using (var writer = new StreamWriter(loc_file, false, encoding))\n            {\n                foreach (var line in lines)\n                {\n                    if (line.StartsWith(\"l \"))\n                    {\n                        var el = line.Split('\\\"');\n                        id = el[1];\n                        name = el[3].Split('(')[0].Trim();\n                    }\n                    else if (line.StartsWith(\"v \"))\n                    {\n                        list.Add(new string[] { name, id, line.Substring(2) });\n                    }\n                    writer.WriteLine(line);\n                }\n            }\n\nMenu:\n            Console.WriteLine();\n            Console.WriteLine(\"Please enter the number of the language you want to edit or 'q' to quit:\");\n            Console.WriteLine();\n            int split = list.Count / 2;\n            for (int i = 1; i < split + 1; i++)\n            {\n                name = $\"{list[i][0]} ({list[i][1]})\";\n                Console.Write($\"[{i.ToString(\"00\")}] {name,-29} {$\"(v{list[i][2]})\",-7}  |  \");\n                if ((i + split) < list.Count)\n                {\n                    name = $\"{list[i + split][0]} ({list[i + split][1]})\";\n                    Console.WriteLine($\"[{(i + split).ToString(\"00\")}] {name,-29} {$\"(v{list[i + split][2]})\",-7}\");\n                } else\n                {\n                    Console.WriteLine();\n                }\n            }\n            Console.WriteLine();\n\nRetry:\n            Console.Write(\"> \");\n            string input = Console.ReadLine();\n            if ((input == null) || (input.StartsWith(\"q\")))\n                goto Exit;\n            if (!Int32.TryParse(input, out index) || (index <= 0) || (index > list.Count))\n            {\n                if (input.StartsWith(\"m\"))\n                    goto Menu;\n                Console.WriteLine(\"Invalid selection (Type 'm' to display the menu again)\");\n                goto Retry;\n            }\n\n            Console.SetCursorPosition(0, Console.CursorTop - 1);\n            Console.WriteLine($\"{list[index][0]} was selected.\");\n            Console.WriteLine();\n            po_file = $\"{list[index][1]}.po\";\n\n            Language old_en_US = null;\n            if (list[index][2] == list[0][2])\n            {\n                if (!maintainer_mode)\n                {\n                    Console.WriteLine(\"Note: This language is already at the most recent version!\");\n                    if (!PromptForQuestion(\"Do you still want to edit it?\"))\n                        goto Exit;\n                }\n            }\n            else\n            {\n                var old_loc_file = $\"rufus-{list[index][2]}.loc\";\n                Console.WriteLine($\"Note: This language is at v{list[index][2]} but the English base it at v{list[0][2]}.\");\n                Console.Write($\"Checking for the presence of '{old_loc_file}' to compute the differences... \");\n                if (File.Exists(old_loc_file))\n                {\n                    Console.WriteLine(\"FOUND\");\n                }\n                else\n                {\n                    Console.WriteLine(\"MISSING\");\n                    Console.Write($\"Downloading '{old_loc_file}'... \");\n                    var url = \"https://github.com/pbatard/rufus/releases/tag/v\" + list[index][2];\n                    var str = DownloadString(url);\n                    if (str == null)\n                        goto Exit;\n                    var sha = str.Substring(str.IndexOf(\"/pbatard/rufus/commit/\") + 22, 40);\n                    url = \"https://github.com/pbatard/rufus/raw/\" + sha + \"/res/loc/rufus.loc\";\n                    if (!DownloadFile(url, old_loc_file))\n                        goto Exit;\n                }\n                var old_langs = ParseLocFile(old_loc_file, \"en-US\");\n                if ((old_langs == null) || (old_langs.Count != 1))\n                {\n                    Console.WriteLine(\"Error: Unable to get en-US data from previous loc file.\");\n                    goto Exit;\n                }\n                old_en_US = old_langs[0];\n            }\n\n            if (File.Exists(po_file) && !maintainer_mode)\n            {\n                if (!PromptForQuestion($\"A '{po_file}' file already exists. Do you want to overwrite it? (If unsure, say 'y')\"))\n                    goto Exit;\n            }\n            if (CreatePoFiles(ParseLocFile(loc_file, list[index][1]), old_en_US) < 1)\n            {\n                Console.WriteLine(\"Failed to create PO file\");\n                goto Exit;\n            }\n\n            if (maintainer_mode)\n                goto Exit;\n\n            // Open the file in PoEdit if we can\n            var poedit = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @\"\\Poedit\\Poedit.exe\";\n            if (File.Exists(poedit))\n            {\n                Console.WriteLine();\n                //                Console.WriteLine(\"Please press any key to launch Poedit and edit the PO file.\");\n                Console.WriteLine(\"*************************************************************************************\");\n                Console.WriteLine($\"* The {list[index][0]} translation file ({list[index][1]}) is now ready to be edited in Poedit.\");\n                Console.WriteLine(\"* Please look for entries highlited in orange - they are the ones requiring an update.\");\n                Console.WriteLine(\"*\");\n                Console.WriteLine(\"* Whenever you save your changes in Poedit, a new 'rufus.loc' will be generated so\");\n                Console.WriteLine($\"* that you can test it with '{rufus_file}' in the same directory.\");\n                Console.WriteLine(\"*\");\n                Console.WriteLine(\"* PLEASE DO NOT CLOSE THIS CONSOLE APPLICATION - IT NEEDS TO RUN IN THE BACKGROUND!\");\n                Console.WriteLine(\"* Instead, when you are done editing your translation, simply close Poedit.\");\n                Console.WriteLine(\"*************************************************************************************\");\n                WaitForKey($\"Press any key to open '{po_file}' in Poedit...\");\n\n                Process process = new Process();\n                process.StartInfo.FileName = poedit;\n                process.StartInfo.WorkingDirectory = app_dir;\n                process.StartInfo.Arguments = po_file;\n                process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;\n                if (!process.Start())\n                {\n                    Console.WriteLine(\"Error: Could not launch PoEdit\");\n                    goto Exit;\n                }\n                Console.SetCursorPosition(0, Console.CursorTop - 1);\n                Console.WriteLine(\"Running Poedit...                                 \");\n                DateTime launch_date = DateTime.Now;\n\n                // Somehow, Palp... I mean, Microsoft broke FileSystemWatcher, so perform our own file system monitoring\n                var info = new FileInfo(po_file);\n                var length = info.Length;\n                var write_time = info.LastWriteTime;\n                var create_time = info.CreationTime;\n                while (!process.WaitForExit(500))\n                {\n                    info = new FileInfo(po_file);\n                    if (info.Length != length || info.LastWriteTime != write_time || info.CreationTime != create_time)\n                    {\n                        FileStream stream = null;\n                        if (info.LastWriteTime >= last_changed.AddMilliseconds(250))\n                        {\n                            // File may still be locked by Poedit => detect that\n                            bool file_locked = true;\n                            do\n                            {\n                                try\n                                {\n                                    stream = info.Open(FileMode.Open, FileAccess.Read, FileShare.None);\n                                    file_locked = false;\n                                }\n                                catch (IOException)\n                                {\n                                    if (cancel_requested)\n                                        break;\n                                    Thread.Sleep(100);\n                                }\n                                finally\n                                {\n                                    if (!file_locked)\n                                    {\n                                        if (stream != null)\n                                            stream.Close();\n                                        last_changed = info.LastWriteTime;\n                                        Console.Write(info.LastWriteTime.ToLongTimeString() + \" - \");\n                                        UpdateLocFile(ParsePoFile(info.FullName));\n                                    }\n                                }\n                            }\n                            while (file_locked);\n                        }\n                    }\n                }\n \n                Console.WriteLine($\"Poedit {((DateTime.Now - launch_date).Milliseconds < 100? \"is already running (?)...\" : \"was closed.\")}\");\n                // Delete the .mo files which we don't need\n                var dir = new DirectoryInfo(app_dir);\n                foreach (var file in dir.EnumerateFiles(\"*.mo\"))\n                    file.Delete();\n            }\n            else\n            {\n                Console.WriteLine(\"Poedit was not found. You will have to launch it and open the\");\n                Console.WriteLine($\"'{po_file}' file manually.\");\n            }\n\n            WaitForKey(\"Now press any key to launch your e-mail client and exit this application...\");\n\n            if ((list.Count >= 2) && (index >= 0))\n            {\n                Process.Start($\"mailto:pete@akeo.ie?subject=Rufus%20{list[index][0]}%20translation%20v{list[0][2]}%20update\" +\n                    $\"&body=Hi%20Pete,%0D%0A%0D%0APlease%20find%20attached%20the%20latest%20{list[index][0]}%20translation.\" +\n                    $\"%0D%0A%0D%0A<PLEASE%20ATTACH%20'{app_dir}{po_file}'%20AND%20REMOVE%20THIS%20LINE>\" +\n                    $\"%0D%0A%0D%0ARegards,\");\n            }\n            return;\n\nImport:\n            string file_name;\n            OpenFileDialog file_dialog = new OpenFileDialog();\n            file_dialog.InitialDirectory = app_dir;\n            file_dialog.Filter = \"PO files (*.po)|*.po|All files (*.*)|*.*\";\n            file_dialog.ShowDialog();\n            file_name = file_dialog.FileName;\n            Console.WriteLine(file_name);\n            UpdateLocFile(ParsePoFile(file_name), app_dir + @\"..\\\");\n\nExit:\n            if (!maintainer_mode)\n                WaitForKey(\"Press any key to exit...\");\n        }\n    }\n}\n"
  },
  {
    "path": "res/loc/pollock/Pollock.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}</ProjectGuid>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>pollock</RootNamespace>\n    <AssemblyName>pollock</AssemblyName>\n    <TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|x64' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <PlatformTarget>x64</PlatformTarget>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <LangVersion>8.0</LangVersion>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|x64' \">\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <DebugType>pdbonly</DebugType>\n    <PlatformTarget>x64</PlatformTarget>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <LangVersion>8.0</LangVersion>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup>\n    <ApplicationIcon>pollock.ico</ApplicationIcon>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Net.Http\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"Pollock.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"pollock.ico\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"app.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\".NETFramework,Version=v4.8\">\n      <Visible>False</Visible>\n      <ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <Target Name=\"PostBuildMacros\">\n    <GetAssemblyIdentity AssemblyFiles=\"$(TargetPath)\">\n      <Output TaskParameter=\"Assemblies\" ItemName=\"Targets\" />\n    </GetAssemblyIdentity>\n    <ItemGroup>\n      <VersionNumber Include=\"@(Targets->'%(Version)')\" />\n    </ItemGroup>\n  </Target>\n  <PropertyGroup>\n    <PostBuildEventDependsOn>\n      $(PostBuildEventDependsOn);\n      PostBuildMacros;\n    </PostBuildEventDependsOn>\n    <PostBuildEvent>for /f \"tokens=1,2 delims=.\" %25%25i in (\"@(VersionNumber)\") do set \"major=%25%25i\" &amp;set \"minor=%25%25j\"\nset version=%25major%25.%25minor%25\n  if $(ConfigurationName) == Release (\n  copy $(TargetDir)$(TargetFileName) $(SolutionDir)..\\..\\..\\pollock-%25version%25.exe /y\n  $(SolutionDir)..\\..\\..\\_sign.cmd $(SolutionDir)..\\..\\..\\pollock-%25version%25.exe\n)</PostBuildEvent>\n  </PropertyGroup>\n</Project>"
  },
  {
    "path": "res/loc/pollock/Pollock.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio Version 17\r\nVisualStudioVersion = 17.14.37111.16 d17.14\r\nMinimumVisualStudioVersion = 10.0.40219.1\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Pollock\", \"Pollock.csproj\", \"{759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|x64 = Debug|x64\r\n\t\tRelease|x64 = Release|x64\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{759D557D-FA9B-4EE2-A6B3-3D30FC35F3CE}.Release|x64.Build.0 = Release|x64\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\n\tGlobalSection(ExtensibilityGlobals) = postSolution\r\n\t\tSolutionGuid = {E598CE39-98F7-4F0F-BF91-3C29C30919F9}\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "res/loc/pollock/app.config",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n<startup><supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.8.1\"/></startup></configuration>\n"
  },
  {
    "path": "res/loc/rufus.loc",
    "content": "#########################################################################\r\n### Autogenerated by pollock v1.0 for use with Rufus - DO NOT EDIT!!! ###\r\n#########################################################################\r\n\r\n# List of all languages included in this file (with version)\r\n# • v4.14 \"en-US\" \"English (English)\"\r\n# • v4.5  \"ar-SA\" \"Arabic (العربية)\"\r\n# • v3.22 \"bg-BG\" \"Bulgarian (Български)\"\r\n# • v4.5  \"zh-CN\" \"Chinese Simplified (简体中文)\"\r\n# • v4.5  \"zh-TW\" \"Chinese Traditional (正體中文)\"\r\n# • v4.5  \"hr-HR\" \"Croatian (Hrvatski)\"\r\n# • v4.5  \"cs-CZ\" \"Czech (Čeština)\"\r\n# • v4.5  \"da-DK\" \"Danish (Dansk)\"\r\n# • v4.5  \"nl-NL\" \"Dutch (Nederlands)\"\r\n# • v4.5  \"fi-FI\" \"Finnish (Suomi)\"\r\n# • v4.14 \"fr-FR\" \"French (Français)\"\r\n# • v4.5  \"de-DE\" \"German (Deutsch)\"\r\n# • v4.5  \"el-GR\" \"Greek (Ελληνικά)\"\r\n# • v4.5  \"he-IL\" \"Hebrew (עברית)\"\r\n# • v4.5  \"hu-HU\" \"Hungarian (Magyar)\"\r\n# • v3.22 \"id-ID\" \"Indonesian (Bahasa Indonesia)\"\r\n# • v4.5  \"it-IT\" \"Italian (Italiano)\"\r\n# • v4.5  \"ja-JP\" \"Japanese (日本語)\"\r\n# • v4.5  \"ko-KR\" \"Korean (한국어)\"\r\n# • v4.5  \"lv-LV\" \"Latvian (Latviešu)\"\r\n# • v3.22 \"lt-LT\" \"Lithuanian (Lietuvių)\"\r\n# • v3.22 \"ms-MY\" \"Malay (Bahasa Malaysia)\"\r\n# • v4.5  \"nb-NO\" \"Norwegian (Norsk)\"\r\n# • v4.5  \"fa-IR\" \"Persian (پارسی)\"\r\n# • v4.5  \"pl-PL\" \"Polish (Polski)\"\r\n# • v4.5  \"pt-BR\" \"Portuguese Brazilian (Português do Brasil)\"\r\n# • v4.5  \"pt-PT\" \"Portuguese Standard (Português)\"\r\n# • v4.5  \"ro-RO\" \"Romanian (Română)\"\r\n# • v4.5  \"ru-RU\" \"Russian (Русский)\"\r\n# • v4.5  \"sr-RS\" \"Serbian (Srpski)\"\r\n# • v4.5  \"sk-SK\" \"Slovak (Slovensky)\"\r\n# • v4.5  \"sl-SI\" \"Slovenian (Slovenščina)\"\r\n# • v4.5  \"es-ES\" \"Spanish (Español)\"\r\n# • v4.5  \"sv-SE\" \"Swedish (Svenska)\"\r\n# • v4.5  \"th-TH\" \"Thai (ไทย)\"\r\n# • v4.5  \"tr-TR\" \"Turkish (Türkçe)\"\r\n# • v4.5  \"uk-UA\" \"Ukrainian (Українська)\"\r\n# • v4.5  \"vi-VN\" \"Vietnamese (Tiếng Việt)\"\r\n\r\n#########################################################################\r\nl \"en-US\" \"English (English)\" 0x0409, 0x0809, 0x0c09, 0x1009, 0x1409, 0x1809, 0x1c09, 0x2009, 0x2409, 0x2809, 0x2c09, 0x3009, 0x3409, 0x3809, 0x3c09, 0x4009, 0x4409, 0x4809\r\nv 4.14\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Drive Properties\"\r\nt IDS_DEVICE_TXT \"Device\"\r\nt IDS_BOOT_SELECTION_TXT \"Boot selection\"\r\nt IDC_SELECT \"Select\"\r\nt IDS_IMAGE_OPTION_TXT \"Image Option\"\r\nt IDS_PARTITION_TYPE_TXT \"Partition scheme\"\r\nt IDS_TARGET_SYSTEM_TXT \"Target system\"\r\nt IDC_LIST_USB_HDD \"List USB Hard Drives\"\r\n# It is acceptable to drop the parenthesis () if you are running out of space\r\n# as there is a tooltip (MSG_169) providing these details.\r\nt IDC_OLD_BIOS_FIXES \"Add fixes for old BIOSes (extra partition, align, etc.)\"\r\n# It is acceptable to drop the \"runtime\" if you are running out of space\r\nt IDC_UEFI_MEDIA_VALIDATION \"Enable runtime UEFI media validation\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Format Options\"\r\nt IDS_FILE_SYSTEM_TXT \"File system\"\r\nt IDS_CLUSTER_SIZE_TXT \"Cluster size\"\r\nt IDS_LABEL_TXT \"Volume label\"\r\nt IDC_QUICK_FORMAT \"Quick format\"\r\nt IDC_BAD_BLOCKS \"Check device for bad blocks\"\r\nt IDC_EXTENDED_LABEL \"Create extended label and icon files\"\r\nt IDS_STATUS_TXT \"Status\"\r\nt IDCANCEL \"Close\"\r\nt IDC_START \"Start\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"About Rufus\"\r\nt IDC_ABOUT_LICENSE \"License\"\r\nt IDOK \"OK\"\r\n\r\ng IDD_LICENSE\r\nt IDD_LICENSE \"Rufus License\"\r\nt IDCANCEL \"Close\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"More information\"\r\nt IDYES \"Yes\"\r\nt IDNO \"No\"\r\n\r\ng IDD_LOG\r\nt IDD_LOG \"Log\"\r\nt IDC_LOG_CLEAR \"Clear\"\r\nt IDC_LOG_SAVE \"Save\"\r\nt IDCANCEL \"Close\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDD_UPDATE_POLICY \"Update policy and settings\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Settings\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Check for updates\"\r\nt IDS_INCLUDE_BETAS_TXT \"Include beta versions\"\r\nt IDC_CHECK_NOW \"Check Now\"\r\nt IDCANCEL \"Close\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDD_NEW_VERSION \"Check For Updates - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"A newer version is available. Please download the latest version!\"\r\nt IDC_WEBSITE \"Click here to go to the website\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Release Notes\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Download\"\r\nt IDC_DOWNLOAD \"Download\"\r\nt IDCANCEL \"Close\"\r\n\r\nt MSG_001 \"Other instance detected\"\r\nt MSG_002 \"Another Rufus application is running.\\n\"\r\n\t\"Please close the first application before running another one.\"\r\nt MSG_003 \"WARNING: ALL DATA ON DEVICE '%s' WILL BE DESTROYED.\\n\"\r\n\t\"To continue with this operation, click OK. To quit click CANCEL.\"\r\nt MSG_004 \"Rufus update policy\"\r\nt MSG_005 \"Do you want to allow Rufus to check for application updates online?\"\r\nt MSG_006 \"Close\"\r\nt MSG_007 \"Cancel\"\r\nt MSG_008 \"Yes\"\r\nt MSG_009 \"No\"\r\nt MSG_010 \"Bad blocks found\"\r\nt MSG_011 \"Check completed: %d bad block(s) found\\n\"\r\n\t\"  %d read error(s)\\n  %d write error(s)\\n  %d corruption error(s)\"\r\n# This contains the formatted message from MSG_001 as well as the name of the bad blocks logfile\r\nt MSG_012 \"%s\\nA more detailed report can be found in:\\n%s\"\r\nt MSG_013 \"Disabled\"\r\nt MSG_014 \"Daily\"\r\nt MSG_015 \"Weekly\"\r\nt MSG_016 \"Monthly\"\r\nt MSG_017 \"Custom\"\r\nt MSG_018 \"Your version: %d.%d (Build %d)\"\r\nt MSG_019 \"Latest version: %d.%d (Build %d)\"\r\nt MSG_020 \"bytes\"\r\n# *Short* version of the kilobyte size suffix\r\nt MSG_021 \"KB\"\r\n# *Short* version of the megabyte size suffix\r\nt MSG_022 \"MB\"\r\n# *Short* version of the gigabyte size suffix\r\nt MSG_023 \"GB\"\r\n# *Short* version of the terabyte size suffix\r\nt MSG_024 \"TB\"\r\n# *Short* version of the petabyte size suffix\r\nt MSG_025 \"PB\"\r\n# We use two different messages with the same translation for convenience\r\nt MSG_026 \"bytes\"\r\nt MSG_027 \"kilobytes\"\r\nt MSG_028 \"megabytes\"\r\nt MSG_029 \"Default\"\r\n# This gets appended to the file system, cluster size, etc.\r\nt MSG_030 \"%s (Default)\"\r\nt MSG_031 \"BIOS (or UEFI-CSM)\"\r\nt MSG_032 \"UEFI (non CSM)\"\r\nt MSG_033 \"BIOS or UEFI\"\r\n# Number of bad block check passes (singular for 1 pass)\r\nt MSG_034 \"%d pass\"\r\n# Number of bad block check passes (plural for 2 or more passes).\r\n# See MSG_087 for the message that %s gets replaced with.\r\nt MSG_035 \"%d passes %s\"\r\nt MSG_036 \"ISO Image\"\r\nt MSG_037 \"Application\"\r\nt MSG_038 \"Abort\"\r\nt MSG_039 \"Launch\"\r\nt MSG_040 \"Download\"\r\nt MSG_041 \"Operation cancelled by the user\"\r\nt MSG_042 \"Error\"\r\nt MSG_043 \"Error: %s\"\r\nt MSG_044 \"File download\"\r\nt MSG_045 \"USB Storage Device (Generic)\"\r\nt MSG_046 \"%s (Disk %d) [%s]\"\r\n# Used when a drive is detected that contains more than one partition\r\nt MSG_047 \"Multiple Partitions\"\r\nt MSG_048 \"Rufus - Flushing buffers\"\r\nt MSG_049 \"Rufus - Cancellation\"\r\nt MSG_050 \"Success.\"\r\nt MSG_051 \"Undetermined error while formatting.\"\r\nt MSG_052 \"Cannot use the selected file system for this media.\"\r\nt MSG_053 \"Access to the device is denied.\"\r\nt MSG_054 \"Media is write protected.\"\r\nt MSG_055 \"The device is in use by another process. \"\r\n\t\"Please close any other process that may be accessing the device.\"\r\nt MSG_056 \"Quick format is not available for this device.\"\r\nt MSG_057 \"The volume label is invalid.\"\r\nt MSG_058 \"The device handle is invalid.\"\r\nt MSG_059 \"The selected cluster size is not valid for this device.\"\r\nt MSG_060 \"The volume size is invalid.\"\r\nt MSG_061 \"Please insert a removable media in drive.\"\r\nt MSG_062 \"An unsupported command was received.\"\r\nt MSG_063 \"Memory allocation error.\"\r\nt MSG_064 \"Read error.\"\r\nt MSG_065 \"Write error.\"\r\nt MSG_066 \"Installation failure\"\r\nt MSG_067 \"Could not open media. It may be in use by another process. \"\r\n\t\"Please re-plug the media and try again.\"\r\nt MSG_068 \"Could not partition drive.\"\r\nt MSG_069 \"Could not copy files to target drive.\"\r\nt MSG_070 \"Cancelled by user.\"\r\n# See http://en.wikipedia.org/wiki/Thread_%28computing%29\r\nt MSG_071 \"Unable to start thread.\"\r\nt MSG_072 \"Bad blocks check didn't complete.\"\r\nt MSG_073 \"ISO image scan failure.\"\r\nt MSG_074 \"ISO image extraction failure.\"\r\nt MSG_075 \"Unable to remount volume.\"\r\nt MSG_076 \"Unable to patch/setup files for boot.\"\r\nt MSG_077 \"Unable to assign a drive letter.\"\r\nt MSG_078 \"Can't mount GUID volume.\"\r\nt MSG_079 \"The device is not ready.\"\r\nt MSG_080 \"Rufus detected that Windows is still flushing its internal buffers onto the USB device.\\n\\n\"\r\n\t\"Depending on the speed of your USB device, this operation may take a long time to complete, \"\r\n\t\"especially for large files.\\n\\nWe recommend that you let Windows finish, to avoid corruption. \"\r\n\t\"But if you grow tired of waiting, you can just unplug the device...\"\r\nt MSG_081 \"Unsupported image\"\r\nt MSG_082 \"This image is either non-bootable, or it uses a boot or compression method that is not supported by Rufus...\"\r\nt MSG_083 \"Replace %s?\"\r\nt MSG_084 \"This ISO image seems to use an obsolete version of '%s'.\\n\"\r\n\t\"Boot menus may not display properly because of this.\\n\\n\"\r\n\t\"A newer version can be downloaded by Rufus to fix this issue:\\n\"\r\n\t\"- Choose 'Yes' to connect to the internet and download the file\\n\"\r\n\t\"- Choose 'No' to leave the existing ISO file unmodified\\n\"\r\n\t\"If you don't know what to do, you should select 'Yes'.\\n\\n\"\r\n\t\"Note: The new file will be downloaded in the current directory and once a \"\r\n\t\"'%s' exists there, it will be reused automatically.\"\r\nt MSG_085 \"Downloading %s\"\r\nt MSG_086 \"No image selected\"\r\n# This message appears in Advanced format options → Check device for bad blocks → dropdown menu\r\n# %s will be replaced with SLC, MLC or TLC, which is a type of NAND (or flash memory). In other\r\n# words, this message should mean \"for a flash memory device of type %s\". *Please* try to keep\r\n# the translation as short as possible so that it won't result in an overly large dropdown...\r\n# If you prefer, it's okay to use \"type\" or \"device\" instead of \"NAND\" (e.g. \"for TLC type\").\r\n# See also MSG_035.\r\nt MSG_087 \"for %s NAND\"\r\nt MSG_088 \"Image is too big\"\r\nt MSG_089 \"The image is too big for the selected target.\"\r\nt MSG_090 \"Unsupported ISO\"\r\nt MSG_091 \"When using UEFI Target Type, only EFI bootable ISO images are supported. \"\r\n\t\"Please select an EFI bootable ISO or set the Target Type to BIOS.\"\r\nt MSG_092 \"Unsupported filesystem\"\r\nt MSG_093 \"IMPORTANT: THIS DRIVE CONTAINS MULTIPLE PARTITIONS!!\\n\\n\"\r\n\t\"This may include partitions/volumes that aren't listed or even visible from Windows. \"\r\n\t\"Should you wish to proceed, you are responsible for any data loss on these partitions.\"\r\nt MSG_094 \"Multiple partitions detected\"\r\nt MSG_095 \"DD Image\"\r\nt MSG_096 \"The file system currently selected can not be used with this type of ISO. \"\r\n\t\"Please select a different file system or use a different ISO.\"\r\nt MSG_097 \"'%s' can only be applied if the file system is NTFS.\"\r\nt MSG_098 \"IMPORTANT: You are trying to install 'Windows To Go', but your target drive doesn't \"\r\n\t\"have the 'FIXED' attribute. Because of this Windows will most likely freeze during boot, \"\r\n\t\"as Microsoft hasn't designed it to work with drives that instead have the 'REMOVABLE' \"\r\n\t\"attribute.\\n\\nDo you still want to proceed?\\n\\n\"\r\n\t\"Note: The 'FIXED/REMOVABLE' attribute is a hardware property that can only be changed \"\r\n\t\"using custom tools from the drive manufacturer. However those tools are ALMOST NEVER \"\r\n\t\"provided to the public...\"\r\nt MSG_099 \"Filesystem limitation\"\r\nt MSG_100 \"This ISO image contains a file larger than 4 GB, which is more than the maximum size allowed for a FAT or FAT32 file system.\"\r\nt MSG_101 \"Missing WIM support\"\r\nt MSG_102 \"Your platform cannot extract files from WIM archives. WIM extraction \"\r\n\t\"is required to create EFI bootable Windows 7 and Windows Vista USB drives. You can fix that \"\r\n\t\"by installing a recent version of 7-Zip.\\nDo you want to visit the 7-zip download page?\"\r\nt MSG_103 \"Download %s?\"\r\n# Example: \"Grub4DOS v0.4 or later requires a 'grldr' file to be installed. Because this\r\n# file is more than 100 KB in size, and always present on Grub4DOS ISO images (...)\"\r\nt MSG_104 \"%s or later requires a '%s' file to be installed.\\n\"\r\n\t\"Because this file is more than 100 KB in size, and always present on %s ISO images, \"\r\n\t\"it is not embedded in Rufus.\\n\\nRufus can download the missing file for you:\\n\"\r\n\t\"- Select 'Yes' to connect to the internet and download the file\\n\"\r\n\t\"- Select 'No' if you want to manually copy this file on the drive later\\n\\n\"\r\n\t\"Note: The file will be downloaded in the current directory and once a \"\r\n\t\"'%s' exists there, it will be reused automatically.\"\r\nt MSG_105 \"Cancelling may leave the device in an UNUSABLE state.\\n\"\r\n\t\"If you are sure you want to cancel, click YES. Otherwise, click NO.\"\r\nt MSG_106 \"Please select folder\"\r\nt MSG_107 \"All files\"\r\nt MSG_108 \"Rufus log\"\r\nt MSG_109 \"0x%02X (Disk %d)\"\r\n# \"Cluster size\" should be the same as the label for IDS_CLUSTER_SIZE_TXT\r\n# \"kilobytes\" should be the same as in MSG_027\r\nt MSG_110 \"MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size.\\n\"\r\n\t\"Please change the Cluster size or use FreeDOS.\"\r\nt MSG_111 \"Incompatible Cluster size\"\r\n# \"%d:%02d\" is a duration (mins:secs)\r\nt MSG_112 \"Formatting a large UDF volumes can take a lot of time. At USB 2.0 speeds, the estimated formatting \"\r\n\t\"duration is %d:%02d, during which the progress bar will appear frozen. Please be patient!\"\r\nt MSG_113 \"Large UDF volume\"\r\nt MSG_114 \"This image uses Syslinux %s%s but this application only includes the installation files for \"\r\n\t\"Syslinux %s%s.\\n\\nAs new versions of Syslinux are not compatible with one another, and it wouldn't \"\r\n\t\"be possible for Rufus to include them all, two additional files must be downloaded from the \"\r\n\t\"Internet ('ldlinux.sys' and 'ldlinux.bss'):\\n\"\r\n\t\"- Select 'Yes' to connect to the Internet and download these files\\n\"\r\n\t\"- Select 'No' to cancel the operation\\n\\n\"\r\n\t\"Note: The files will be downloaded in the current application directory and will be reused \"\r\n\t\"automatically if present.\"\r\nt MSG_115 \"Download required\"\r\n# You should be able to test this message with Super Grub2 Disk ISO:\r\n# https://sourceforge.net/projects/supergrub2/files/2.00s2/super_grub2_disk_hybrid_2.00s2.iso/download (11.9 MB)\r\nt MSG_116 \"This image uses Grub %s but the application only includes the installation files for \"\r\n\t\"Grub %s.\\n\\nAs different versions of Grub may not be compatible with one another, and it is \"\r\n\t\"not possible to include them all, Rufus will attempt to locate a version of the Grub \"\r\n\t\"installation file ('core.img') that matches the one from your image:\\n\"\r\n\t\"- Select 'Yes' to connect to the Internet and attempt to download it\\n\"\r\n\t\"- Select 'No' to use the default version from Rufus\\n\"\r\n\t\"- Select 'Cancel' to abort the operation\\n\\n\"\r\n\t\"Note: The file will be downloaded in the current application directory and will be reused \"\r\n\t\"automatically if present. If no match can be found online, then the default version will be used.\"\r\nt MSG_117 \"Standard Windows installation\"\r\n# Only translate this message *if* Microsoft has a specific name for\r\n# http://en.wikipedia.org/wiki/Windows_To_Go in your language.\r\n# Otherwise, you may add a parenthesis eg. \"Windows To Go (<hint at what it does>)\"\r\nt MSG_118 \"Windows To Go\"\r\nt MSG_119 \"advanced drive properties\"\r\nt MSG_120 \"advanced format options\"\r\nt MSG_121 \"Show %s\"\r\nt MSG_122 \"Hide %s\"\r\n# A persistent partitions can be used with \"Live\" USB media to store data.\r\n# It means that data can be preserved across reboots on \"Live\" USB drives.\r\n# To test this feature, please download and select 'casper_test.iso' from:\r\n# https://github.com/pbatard/rufus/raw/master/res/loc/test/casper_test.iso\r\nt MSG_123 \"Persistent partition size\"\r\n# This message appears in the persistence 'Size' control when the slider is set to 0.\r\n# It is okay to use \"No partition\" or \"None\" or \"Deactivated\" to indicate that a persistent partition will not be\r\n# created if the width of the control is too small (since the 'Size' edit control is *not* adjusted for width).\r\nt MSG_124 \"No persistence\"\r\n# Tooltips used for the persistence size slider and edit control\r\nt MSG_125 \"Set the size of the persistent partition for live USB media. Setting the size to 0 disables the persistent partition.\"\r\nt MSG_126 \"Set the partition size units.\"\r\nt MSG_127 \"Do not show this message again\"\r\nt MSG_128 \"Important notice about %s\"\r\nt MSG_129 \"You have just created a media that uses the UEFI:NTFS bootloader. Please remember that, to boot this media, YOU MUST DISABLE SECURE BOOT.\\n\"\r\n\t\"For details on why this is necessary, see the 'More Information' button below.\"\r\nt MSG_130 \"Windows image selection\"\r\nt MSG_131 \"This ISO contains multiple Windows images.\\nPlease select the image you wish to use for this installation:\"\r\nt MSG_132 \"Another program or process is accessing this drive. Do you want to format it anyway?\"\r\nt MSG_133 \"Rufus has detected that you are attempting to create a 'Windows To Go' media based on a 1809 ISO.\\n\\n\"\r\n\t\"Because of a *MICROSOFT BUG*, this media will crash during Windows boot (Blue Screen Of Death), unless you manually replace the file 'WppRecorder.sys' with a 1803 version.\\n\\n\"\r\n\t\"Also note that the reason Rufus cannot automatically fix this for you is that 'WppRecorder.sys' is a Microsoft copyrighted file, so we cannot legally embed a copy of the file in the application...\"\r\nt MSG_134 \"Because MBR has been selected for the partition scheme, Rufus can only create a partition up to 2 TB on this media, which will leave %s of disk space unavailable.\\n\\n\"\r\n\t\"Are you sure you want to continue?\"\r\nt MSG_135 \"Version\"\r\nt MSG_136 \"Release\"\r\nt MSG_137 \"Edition\"\r\nt MSG_138 \"Language\"\r\nt MSG_139 \"Architecture\"\r\nt MSG_140 \"Continue\"\r\nt MSG_141 \"Back\"\r\nt MSG_142 \"Please wait...\"\r\nt MSG_143 \"Download using a browser\"\r\nt MSG_144 \"Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.\"\r\nt MSG_145 \"PowerShell 3.0 or later is required to run this script.\"\r\nt MSG_146 \"Do you want to go online and download it?\"\r\nt MSG_148 \"Running download script...\"\r\nt MSG_149 \"Download ISO Image\"\r\nt MSG_150 \"Type of computer you plan to use this bootable drive with. It is your responsibility to determine whether \"\r\n\t\"your target is of BIOS or UEFI type before you start creating the drive, as it may fail to boot otherwise.\"\r\n# You shouldn't translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.\r\nt MSG_151 \"'UEFI-CSM' means that the device will only boot in BIOS emulation mode (also known as 'Legacy Mode') under UEFI, and not in native UEFI mode.\"\r\nt MSG_152 \"'non CSM' means that the device will only boot in native UEFI mode, and not in BIOS emulation mode (also known as 'Legacy Mode').\"\r\nt MSG_153 \"Test pattern: 0x%02X\"\r\nt MSG_154 \"Test pattern: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Test pattern: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Test pattern: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Sets the target filesystem\"\r\nt MSG_158 \"Minimum size that a block of data will occupy in the filesystem\"\r\nt MSG_159 \"Use this field to set the drive label.\\nInternational characters are accepted.\"\r\nt MSG_160 \"Toggle advanced options\"\r\nt MSG_161 \"Check the device for bad blocks using a test pattern\"\r\nt MSG_162 \"Uncheck this box to use the \\\"slow\\\" format method\"\r\nt MSG_163 \"Method that will be used to create partitions\"\r\nt MSG_164 \"Method that will be used to make the drive bootable\"\r\nt MSG_165 \"Click to select or download an image...\"\r\nt MSG_166 \"Check this box to allow the display of international labels \"\r\n\t\"and set a device icon (creates an autorun.inf)\"\r\nt MSG_167 \"Install a UEFI bootloader, that will perform MD5Sum file validation of the media\"\r\nt MSG_169 \"Create an extra hidden partition and try to align partitions boundaries.\\n\"\r\n\t\"This can improve boot detection for older BIOSes.\"\r\nt MSG_170 \"Enable the listing of USB Hard Drive enclosures. USE AT YOUR OWN RISKS!!!\"\r\nt MSG_171 \"Start the formatting operation.\\nThis will DESTROY any data on the target!\"\r\n# As of Rufus 3.2, *ALL* downloads from the servers are digitally signed, and their signature is validated using the\r\n# public key that is embedded in the application. This message appears in an error dialog if the validation fails.\r\nt MSG_172 \"Invalid download signature\"\r\nt MSG_173 \"Click to select...\"\r\nt MSG_174 \"Rufus - The Reliable USB Formatting Utility\"\r\nt MSG_175 \"Version %d.%d (Build %d)\"\r\nt MSG_176 \"mailto:support@akeo.ie\"\r\nt MSG_177 \"Report bugs or request enhancements at:\"\r\nt MSG_178 \"Additional Copyrights:\"\r\nt MSG_179 \"Update Policy:\"\r\nt MSG_180 \"If you choose to allow this program to check for application updates, \"\r\n\t\"you agree that the following information may be collected on our server(s):\"\r\nt MSG_181 \"Your operating system's architecture and version\"\r\nt MSG_182 \"The version of the application you use\"\r\nt MSG_183 \"Your IP address\"\r\nt MSG_184 \"For the purpose of generating private usage statistics, we may keep the information collected, \"\r\n\t\"\\\\b for at most a year\\\\b0 . However, we will not willingly disclose any of this individual data to third parties.\"\r\nt MSG_185 \"Update Process:\"\r\nt MSG_186 \"Rufus does not install or run background services, therefore update checks are performed only when the main application is running.\\\\line\\n\"\r\n\t\"Internet access is of course required when checking for updates.\"\r\nt MSG_187 \"Invalid image for selected boot option\"\r\nt MSG_188 \"The current image doesn't match the boot option selected. Please use a different image or choose a different boot option.\"\r\nt MSG_189 \"This ISO image is not compatible with the selected filesystem\"\r\nt MSG_190 \"Incompatible drive detected\"\r\n# Used in MSG_235\r\nt MSG_191 \"Write pass\"\r\n# Used in MSG_235\r\nt MSG_192 \"Read pass\"\r\nt MSG_193 \"Downloaded %s\"\r\nt MSG_194 \"Could not download %s\"\r\n# Example: \"Using embedded version of Grub2 file(s)\"\r\nt MSG_195 \"Using embedded version of %s file(s)\"\r\nt MSG_196 \"IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!\\n\\n\"\r\n\t\"Conventional drives use a 512-byte sector size but this drive uses a %d-byte one. \"\r\n\t\"In many cases, this means that you will NOT be able to boot from this drive.\\n\"\r\n\t\"Rufus can try to create a bootable drive, but there is NO WARRANTY that it will work.\"\r\nt MSG_197 \"Nonstandard sector size detected\"\r\nt MSG_198 \"'Windows To Go' can only be installed on a GPT partitioned drive if it has the FIXED attribute set. The current drive was not detected as FIXED.\"\r\nt MSG_199 \"This feature is not available on this platform.\"\r\nt MSG_201 \"Cancelling - Please wait...\"\r\nt MSG_202 \"Scanning image...\"\r\nt MSG_203 \"Failed to scan image\"\r\n# %s is the name of an obsolete Syslinux .c32 module. Example: \"Obsolete vesamenu.c32 detected\"\r\nt MSG_204 \"Obsolete %s detected\"\r\n# Display the name of the image selected. eg: \"Using image: en_win7_x64_sp1.iso\"\r\nt MSG_205 \"Using image: %s\"\r\n# Example: \"Missing ldlinux.c32 file\"\r\nt MSG_206 \"Missing %s file\"\r\n# The name proposed by Windows' Computer Management → Disk Management when you try to format\r\n# a drive with an empty label. For an example, see https://rufus.ie/pics/default_name.png.\r\nt MSG_207 \"New Volume\"\r\n# Singular. Example: \"1 device found\"\r\nt MSG_208 \"%d device found\"\r\n# Plural. Example: \"3 devices found\"\r\nt MSG_209 \"%d devices found\"\r\nt MSG_210 \"READY\"\r\nt MSG_211 \"Cancelled\"\r\nt MSG_212 \"Failed\"\r\n# Used when a new update has been downloaded and launched\r\nt MSG_213 \"Launching new application...\"\r\nt MSG_214 \"Failed to launch new application\"\r\n# Example: \"Opened some_file.txt\"\r\nt MSG_215 \"Opened %s\"\r\n# Example: \"Saved rufus.log\"\r\nt MSG_216 \"Saved %s\"\r\n# Formatting status\r\nt MSG_217 \"Formatting: %s\"\r\nt MSG_218 \"Creating file system: Task %d/%d completed\"\r\nt MSG_219 \"NTFS Fixup: %d%% completed\"\r\n# Parameter: the file system and an estimated duration in mins and secs.\r\n# Example: \"Formatting (UDF) - Estimated duration 3:21...\"\r\n# If \"estimated duration\" is too long, just use \"estimated\" or an abbreviation\r\nt MSG_220 \"Formatting (%s) - estimated duration %d:%02d...\"\r\nt MSG_221 \"Setting label (%s)...\"\r\n# Example: \"Formatting (FAT32)...\"\r\nt MSG_222 \"Formatting (%s)...\"\r\nt MSG_223 \"NTFS Fixup (Checkdisk)...\"\r\nt MSG_224 \"Clearing MBR/PBR/GPT structures...\"\r\nt MSG_225 \"Requesting disk access...\"\r\nt MSG_226 \"Analyzing existing boot records...\"\r\nt MSG_227 \"Closing existing volume...\"\r\nt MSG_228 \"Writing Master Boot Record...\"\r\nt MSG_229 \"Writing Partition Boot Record...\"\r\nt MSG_230 \"Copying DOS files...\"\r\nt MSG_231 \"Copying ISO files: %s\"\r\nt MSG_232 \"Win7 EFI boot setup (%s)...\"\r\nt MSG_233 \"Finalizing, please wait...\"\r\n# Takes a Syslinux version as parameter.\r\n# Example: \"Installing Syslinux v5.10...\"\r\nt MSG_234 \"Installing Syslinux %s...\"\r\n# Bad blocks status. Example: \"Bad Blocks: Write pass 1/2 - 12.34% (0/0/1 errors)\"\r\n# See MSG_191 & MSG_192 for \"Write pass\"/\"Read pass\" translation.\r\nt MSG_235 \"Bad Blocks: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\r\nt MSG_236 \"Bad Blocks: Testing with random pattern\"\r\nt MSG_237 \"Bad Blocks: Testing with pattern 0x%02X\"\r\n# Example: \"Partitioning (MBR)...\"\r\nt MSG_238 \"Partitioning (%s)...\"\r\nt MSG_239 \"Deleting partitions (%s)...\"\r\n# This message has to do with the signature validation that Rufus uses when downloading an update.\r\nt MSG_240 \"The signature for the downloaded update can not be validated. This could mean that your \"\r\n\t\"system is improperly configured for signature validation or indicate a malicious download.\\n\\n\"\r\n\t\"The download will be deleted. Please check the log for more details.\"\r\nt MSG_241 \"Downloading: %s\"\r\nt MSG_242 \"Failed to download file.\"\r\nt MSG_243 \"Checking for Rufus updates...\"\r\nt MSG_244 \"Updates: Unable to connect to the internet\"\r\nt MSG_245 \"Updates: Unable to access version data\"\r\nt MSG_246 \"A new version of Rufus is available!\"\r\nt MSG_247 \"No new version of Rufus was found\"\r\nt MSG_248 \"Application registry keys successfully deleted\"\r\nt MSG_249 \"Failed to delete application registry keys\"\r\n# Example: \"Fixed disk detection enabled\", \"ISO size check disabled\", etc.\r\nt MSG_250 \"%s enabled\"\r\nt MSG_251 \"%s disabled\"\r\nt MSG_252 \"Size checks\"\r\nt MSG_253 \"Hard disk detection\"\r\nt MSG_254 \"Force large FAT32 formatting\"\r\nt MSG_255 \"NoDriveTypeAutorun will be deleted on exit\"\r\nt MSG_256 \"Fake drive detection\"\r\nt MSG_257 \"Joliet support\"\r\nt MSG_258 \"Rock Ridge support\"\r\nt MSG_259 \"Force update\"\r\nt MSG_260 \"NTFS compression\"\r\nt MSG_261 \"Writing image: %s\"\r\n# Cheat mode message to disable ISO Support, so that only DD images can be opened\r\nt MSG_262 \"ISO Support\"\r\n# Cheat mode to force legacy size units, where 1 KB is 1024 bytes and NOT that fake 1000 bytes abomination!\r\nt MSG_263 \"Use PROPER size units\"\r\nt MSG_264 \"Deleting directory '%s'\"\r\nt MSG_265 \"VMWare disk detection\"\r\nt MSG_266 \"Dual UEFI/BIOS mode\"\r\nt MSG_267 \"Applying Windows image: %s\"\r\nt MSG_268 \"Applying Windows image...\"\r\nt MSG_269 \"Preserve timestamps\"\r\nt MSG_270 \"USB debug\"\r\nt MSG_271 \"Computing image checksums: %s\"\r\nt MSG_272 \"Compute the MD5, SHA1 and SHA256 checksums for the selected image\"\r\nt MSG_273 \"Change the application language\"\r\nt MSG_274 \"%s image detected\"\r\n# '%s' will be replaced with your translations for MSG_036 (\"ISO Image\") and MSG_095 (\"DD Image\")\r\nt MSG_275 \"The image you have selected is an 'ISOHybrid' image. This means it can be written either in \"\r\n\t\"%s (file copy) mode or %s (disk image) mode.\\n\"\r\n\t\"Rufus recommends using %s mode, so that you always have full access to the drive after writing it.\\n\"\r\n\t\"However, if you encounter issues during boot, you can try writing this image again in %s mode.\\n\\n\"\r\n\t\"Please select the mode that you want to use to write this image:\"\r\n# '%s' will be replaced with your translation for MSG_036 (\"ISO Image\")\r\nt MSG_276 \"Write in %s mode (Recommended)\"\r\n# '%s' will be replaced with your translation for MSG_095 (\"DD Image\")\r\nt MSG_277 \"Write in %s mode\"\r\nt MSG_278 \"Checking for conflicting processes...\"\r\nt MSG_279 \"Non bootable\"\r\nt MSG_280 \"Disk or ISO image\"\r\nt MSG_281 \"%s (Please select)\"\r\nt MSG_282 \"Exclusive USB drive locking\"\r\nt MSG_283 \"Invalid signature\"\r\nt MSG_284 \"The downloaded executable is missing a digital signature.\"\r\nt MSG_285 \"The downloaded executable is signed by '%s'.\\nThis is not a signature we recognize and could \"\r\n\t\"indicate some form of malicious activity...\\nAre you sure you want to run this file?\"\r\nt MSG_286 \"Zeroing drive: %s\"\r\nt MSG_287 \"Detection of non-USB removable drives\"\r\nt MSG_288 \"Missing elevated privileges\"\r\nt MSG_289 \"This application can only run with elevated privileges\"\r\nt MSG_290 \"File Indexing\"\r\nt MSG_291 \"Version selection\"\r\nt MSG_292 \"Please select the version of Windows you want to install:\"\r\nt MSG_293 \"Unsupported Windows version\"\r\nt MSG_294 \"This version of Windows is no longer supported by Rufus.\\nThe last version of Rufus compatible with this platform is v%d.%d.\"\r\nt MSG_295 \"Warning: Unofficial version\"\r\nt MSG_296 \"This version of Rufus was not produced by its official developer(s).\\n\\nAre you sure you want to run it?\"\r\nt MSG_297 \"Truncated ISO detected\"\r\nt MSG_298 \"The ISO file you have selected does not match its declared size: %s of data is missing!\\n\\nIf you obtained \"\r\n\t\"this file from the Internet, you should try to download a new copy and verify that the MD5 or SHA checksums match \"\r\n\t\"the official ones.\\n\\nNote that you can compute the MD5 or SHA in Rufus by clicking the (✓) button.\"\r\nt MSG_299 \"Timestamp validation error\"\r\nt MSG_300 \"Rufus could not validate that the timestamp of the downloaded update is more recent than the one for the \"\r\n\t\"current executable.\\n\\nIn order to prevent potential attack scenarios, the update process has been aborted and \"\r\n\t\"the download will be deleted. Please check the log for more details.\"\r\nt MSG_301 \"Show application settings\"\r\nt MSG_302 \"Show information about this application\"\r\nt MSG_303 \"Show the log\"\r\nt MSG_304 \"Create a disk image of the selected device\"\r\nt MSG_305 \"Use this option to indicate if you plan to install Windows to a different disk, or if you want to run Windows directly from this drive (Windows To Go).\"\r\n# You can see this status message by pressing <Ctrl>-<Alt>-<Z> and then selecting START.\r\n# It's the same as MSG_286 but with a process that *may* be faster, hence the name.\r\nt MSG_306 \"Fast-zeroing drive: %s\"\r\nt MSG_307 \"this may take a while\"\r\nt MSG_308 \"VHD detection\"\r\nt MSG_309 \"Compressed archive\"\r\nt MSG_310 \"The ISO you have selected uses UEFI and is small enough to be written as an EFI System Partition (ESP). \"\r\n\t\"Writing to an ESP, instead of writing to a generic data partition occupying the whole disk, can be preferable \"\r\n\t\"for some types of installations.\\n\\nPlease select the mode that you want to use to write this image:\"\r\nt MSG_311 \"Use %s (in the main application window) to enable.\"\r\nt MSG_312 \"Extra hashes (SHA512)\"\r\nt MSG_313 \"Save to VHD\"\r\nt MSG_314 \"Compute image checksums\"\r\nt MSG_315 \"Multiple buttons\"\r\nt MSG_316 \"Number of passes\"\r\nt MSG_317 \"Disk ID\" \r\nt MSG_318 \"Default thread priority: %d\"\r\nt MSG_319 \"Ignore Boot Marker\"\r\nt MSG_320 \"Refreshing partition layout (%s)...\"\r\nt MSG_321 \"The image you have selected is an ISOHybrid, but its creators have not made it compatible with ISO/File \"\r\n\t\"copy mode.\\nAs a result, DD image writing mode will be enforced.\"\r\nt MSG_322 \"Unable to open or read '%s'\"\r\nt MSG_323 \"Apply SkuSiPolicy.p7b on installation (See KB5042562)\"\r\nt MSG_324 \"QoL improvements (Don't force Copilot, OneDrive, Outlook, Fast Startup, etc.)\"\r\nt MSG_325 \"Applying Windows customization: %s\"\r\nt MSG_326 \"Applying user options...\"\r\nt MSG_327 \"Windows User Experience\"\r\nt MSG_328 \"Customize Windows installation?\"\r\nt MSG_329 \"Remove requirement for 4GB+ RAM, Secure Boot and TPM 2.0\"\r\nt MSG_330 \"Remove requirement for an online Microsoft account\"\r\nt MSG_331 \"Disable data collection (Skip privacy questions)\"\r\nt MSG_332 \"Prevent 'Windows To Go' from accessing internal disks\"\r\nt MSG_333 \"Create a local account with username:\"\r\nt MSG_334 \"Set regional options to the same values as this user's\"\r\nt MSG_335 \"Disable BitLocker automatic device encryption\"\r\nt MSG_336 \"Persistent log\"\r\nt MSG_337 \"An additional file ('%s') must be downloaded from Microsoft to use this feature:\\n\"\r\n\t\"- Select 'Yes' to connect to the Internet and download it\\n\"\r\n\t\"- Select 'No' to cancel the operation\\n\\n\"\r\n\t\"Note: The file will be downloaded in the application's directory and will be reused automatically if present.\"\r\nt MSG_338 \"Revoked UEFI bootloader detected\"\r\nt MSG_339 \"Rufus detected that the ISO you have selected contains a UEFI bootloader that has been revoked and that will produce %s, when Secure Boot is enabled on a fully up to date UEFI system.\\n\\n\"\r\n\t\"- If you obtained this ISO image from a non reputable source, you should consider the possibility that it might contain UEFI malware and avoid booting from it.\\n\"\r\n\t\"- If you obtained it from a trusted source, you should try to locate a more up to date version, that will not produce this warning.\"\r\nt MSG_340 \"a \\\"Security Violation\\\" screen\"\r\nt MSG_341 \"a Windows Recovery Screen (BSOD) with '%s'\"\r\nt MSG_342 \"Compressed VHDX Image\"\r\nt MSG_343 \"Uncompressed VHD Image\"\r\nt MSG_344 \"Full Flash Update Image\"\r\nt MSG_345 \"Some additional data must be downloaded from Microsoft to use this functionality:\\n\"\r\n\t\"- Select 'Yes' to connect to the Internet and download it\\n\"\r\n\t\"- Select 'No' to cancel the operation\"\r\nt MSG_346 \"Restrict Windows to S-Mode (INCOMPATIBLE with online account bypass)\"\r\nt MSG_347 \"Expert Mode\"\r\nt MSG_348 \"Extracting archive files: %s\"\r\nt MSG_349 \"Use Rufus MBR\"\r\nt MSG_350 \"Use 'Windows CA 2023' signed bootloaders (Requires a compatible target PC)\"\r\nt MSG_351 \"Checking for UEFI bootloader revocation...\"\r\nt MSG_352 \"Checking for UEFI DBX updates...\"\r\nt MSG_353 \"DBX update available\"\r\nt MSG_354 \"Rufus has found an updated version of the DBX files used to perform UEFI Secure Boot revocation checks. Do you want to download this update?\\n\"\r\n\t\"- Select 'Yes' to connect to the Internet and download this content\\n\"\r\n\t\"- Select 'No' to cancel the operation\\n\\n\"\r\n\t\"Note: The files will be downloaded in the application's directory and will be reused automatically if present.\"\r\nt MSG_355 \"⚠SILENTLY⚠ erase disk and install:\"\r\nt MSG_356 \"You have selected to use the \\\"silent\\\" Windows installation option.\\n\\n\"\r\n\t\"This is an advanced option, reserved for people who want to create media that does not prompt the user during Windows installation and therefore UNCONDITIONALLY ERASES the \"\r\n\t\"first detected disk on the target system. If you are not careful, using this option can result in IRREVERSIBLE DATA LOSS!\\n\\nIf this is not what you want, please select 'No'\"\r\n\t\"to go back and uncheck the option.\\nOtherwise, if you select 'Yes, you agree that the whole responsibility for any data loss will be entirely with YOU.\"\r\nt MSG_358 \"Unsupported image location\"\r\nt MSG_359 \"You cannot use an image that is located on the target drive, since that drive is going to be completely erased. It's the same thing as trying to saw the branch you are sitting on!\\n\\n\"\r\n\t\"Please move the image to a different location and try again.\"\r\nt MSG_360 \"It is safe to leave this option enabled even if you have a TPM or more RAM, as this option only bypasses the setup requirements and does not actually prevent Windows from using all the hardware available.\"\r\nt MSG_361 \"For this option to work, network/Internet MUST be disconnected during installation!\"\r\nt MSG_362 \"Automatically answer 'no' to the Windows setup questions relating to the sharing of data with Microsoft, instead of prompting the user.\"\r\nt MSG_363 \"You should leave this option enabled, unless you are okay with 'Windows To Go' accessing internal disks and silently performing irreversible file system upgrades.\"\r\nt MSG_364 \"Automatically create a local account with the specified user name, using an empty password that will need to be changed on next logon.\"\r\nt MSG_365 \"Duplicate the regional settings from this PC (keyboard, timezone, currency), instead of prompting the user.\"\r\nt MSG_366 \"Don't encrypt the system disk, unless explicitly requested by the user.\"\r\nt MSG_367 \"Use this option only if you know what S-Mode is and understand that your system may be locked into S-Mode even after you completely erase and reinstall Windows.\"\r\nt MSG_368 \"Use this option if the system you plan to install Windows on is using fully up-to-date Secure Boot certificates. If needed, you can look into using 'Mosby' to update your system.\"\r\nt MSG_369 \"Use this option if you want to revoke additional potentially unsafe Windows bootloaders, but with the potential of also preventing standard Windows media from booting.\"\r\nt MSG_370 \"\\\"Quality of Life\\\" enhancements: Disable most of the unwanted features Microsoft is trying to force onto end users.\"\r\nt MSG_371 \"If you use this option, please make sure to disconnect every disk from the target PC, except the one you want to install Windows on, as well as not leave the media plugged into any PC you don't want to erase.\"\r\n\r\n# The following messages are for the Windows Store listing only and are not used by the application\r\nt MSG_900 \"Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.\"\r\nt MSG_901 \"Official site: %s\"\r\nt MSG_902 \"Source Code: %s\"\r\nt MSG_903 \"ChangeLog: %s\"\r\n# The gnu.org website has many translations of the GPL (such as https://www.gnu.org/licenses/gpl-3.0.zh-cn.html, https://www.gnu.org/licenses/gpl-3.0.fr.html)\r\n# Please make sure you try to locate the relevant https://www.gnu.org/licenses/gpl-3.0.<LANG-ID>.html for your language and use it here.\r\nt MSG_904 \"This application is licensed under the terms of the GNU Public License (GPL) version 3.\\nSee https://www.gnu.org/licenses/gpl-3.0.en.html for details.\"\r\n# Keyword for \"boot\" will be used for search in the Windows Store\r\nt MSG_905 \"Boot\"\r\n# This and subsequent messages will be listed in the 'Features' section of the Windows Store page\r\nt MSG_910 \"Format USB, flash card and virtual drives to FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Create FreeDOS bootable USB drives\"\r\nt MSG_912 \"Create bootable drives from bootable ISOs (Windows, Linux, etc.)\"\r\nt MSG_913 \"Create bootable drives from bootable disk images, including compressed ones\"\r\nt MSG_914 \"Create BIOS or UEFI bootable drives, including UEFI bootable NTFS\"\r\nt MSG_915 \"Create 'Windows To Go' drives\"\r\nt MSG_916 \"Create Windows 11 installation drives for PCs that don't have TPM or Secure Boot\"\r\nt MSG_917 \"Create persistent Linux partitions\"\r\nt MSG_918 \"Create VHD/DD images of the selected drive\"\r\nt MSG_919 \"Compute MD5, SHA-1, SHA-256 and SHA-512 checksums of the selected image\"\r\nt MSG_920 \"Perform bad blocks checks, including detection of \\\"fake\\\" flash drives\"\r\nt MSG_921 \"Download official Microsoft Windows retail ISOs\"\r\nt MSG_922 \"Download UEFI Shell ISOs\"\r\n\r\n#########################################################################\r\nl \"ar-SA\" \"Arabic (العربية)\" 0x0401, 0x0801, 0x0c01, 0x1001, 0x1401, 0x1801, 0x1c01, 0x2001, 0x2401, 0x2801, 0x2c01, 0x3001, 0x3401, 0x3801, 0x3c01, 0x4001\r\nv 4.5\r\nb \"en-US\"\r\na \"r\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"حول Rufus\"\r\nt IDC_ABOUT_LICENSE \"الترخيص\"\r\nt IDOK \"موافق\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"خصائص محرك الأقراص\"\r\nt IDS_DEVICE_TXT \"الجهاز\"\r\nt IDS_BOOT_SELECTION_TXT \"اختيار نوع الإقلاع\"\r\nt IDC_SELECT \"اختيار\"\r\nt IDS_IMAGE_OPTION_TXT \"خيارات صورة القرص\"\r\nt IDS_PARTITION_TYPE_TXT \"مخطط التقسيم\"\r\nt IDS_TARGET_SYSTEM_TXT \"النظام الهدف\"\r\nt IDC_LIST_USB_HDD \"قائمة محركات الأقراص الثابتة USB\"\r\nt IDC_OLD_BIOS_FIXES \"إضافة إصلاحات لنظام الإدخال والإخراج الأساسي (BIOS) القديم\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"تمكين التحقق من صحة وسائط UEFI في وقت التشغيل\"\r\n# fixed translation since فورمات is the pronounce of format in arabic, correct translation is تهّيئة\r\nt IDS_FORMAT_OPTIONS_TXT \"خيارات التهيئة\"\r\nt IDS_FILE_SYSTEM_TXT \"نظام الملفات\"\r\nt IDS_CLUSTER_SIZE_TXT \"حجم المجموعة\"\r\nt IDS_LABEL_TXT \"تسمية وحدة التخزين\"\r\n# fixed translation since فورمات is the pronounce of format in arabic, correct translation is تهّيئة\r\nt IDC_QUICK_FORMAT \"التهيئة السريعة\"\r\nt IDC_BAD_BLOCKS \"فحص الجهاز من الأجزاء التالفة\"\r\nt IDC_EXTENDED_LABEL \"إنشاء تسمية موسّعة وأيقونة ملفات\"\r\nt IDS_STATUS_TXT \"الحالة\"\r\nt IDCANCEL \"إغلاق\"\r\nt IDC_START \"بدء\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"إغلاق\"\r\nt IDD_LICENSE \"ترخيص Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"إغلاق\"\r\nt IDD_LOG \"السجل\"\r\nt IDC_LOG_CLEAR \"مسح الكل\"\r\nt IDC_LOG_SAVE \"حفظ\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"إغلاق\"\r\nt IDD_NEW_VERSION \"التحقق من وجود تحديثات - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"يوجد إصدار أحدث متوفر. يرجى تنزيل أحدث إصدار!\"\r\nt IDC_WEBSITE \"إضغط هنا للذهاب إلى الموقع\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"ملاحظات الإصدار\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"تنزيل\"\r\nt IDC_DOWNLOAD \"تنزيل\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"مزيد من المعلومات\"\r\nt IDYES \"نعم\"\r\nt IDNO \"لا\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"إغلاق\"\r\nt IDD_UPDATE_POLICY \"تحديث السياسة والإعدادات\"\r\nt IDS_UPDATE_SETTINGS_GRP \"الإعدادات\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"التحقق من وجود تحديثات\"\r\nt IDS_INCLUDE_BETAS_TXT \"تضمين الإصدارات التجريبية\"\r\nt IDC_CHECK_NOW \"تحقق الآن\"\r\n\r\nt MSG_001 \"تم الكشف عن نسخة أخرى\"\r\nt MSG_002 \"هناك تطبيق Rufus آخر قيد التشغيل.\\nالرجاء إغلاق التطبيق الأول قبل تشغيل تطبيق آخر.\"\r\nt MSG_003 \"تحذير: كل البيانات على الجهاز '%s' سيتم حذفها.\\nلمتابعة هذه العملية، انقر فوق \\\"موافق\\\". للإنهاء، انقر فوق \\\"إلغاء\\\".\"\r\nt MSG_004 \"تحديث سياسة Rufus\"\r\nt MSG_005 \"هل تريد السماح لـ Rufus بالتحقق من وجود تحديثات التطبيق عبر الإنترنت؟\"\r\nt MSG_006 \"إغلاق\"\r\nt MSG_007 \"إلغاء\"\r\nt MSG_008 \"نعم\"\r\nt MSG_009 \"لا\"\r\nt MSG_010 \"تم العثور على أجزاء تالفة\"\r\nt MSG_011 \"اكتمال التحقق: %d جزء تالف(s) تم الكشف\\n  %d خطأ قراءة(s)\\n  %d خطأ كتابة(s)\\n  %d خطأ التلف(s)\"\r\nt MSG_012 \"%s\\nيمكن الإطلاع على تقرير مفصّل من خلال:\\n%s\"\r\nt MSG_013 \"تم التعطيل\"\r\nt MSG_014 \"يومياً\"\r\nt MSG_015 \"أسبوعيًا\"\r\nt MSG_016 \"شهرياً\"\r\nt MSG_017 \"مخصص\"\r\nt MSG_018 \"نسختك: %d.%d (Build %d)\"\r\nt MSG_019 \"آخر نسخة: %d.%d (Build %d)\"\r\nt MSG_020 \"بايت\"\r\nt MSG_021 \"ك.ب\"\r\nt MSG_022 \"م.ب\"\r\nt MSG_023 \"غ.ب\"\r\nt MSG_024 \"ت.ب\"\r\nt MSG_025 \"ب.ب\"\r\nt MSG_026 \"بايت\"\r\nt MSG_027 \"كيلو بايت\"\r\nt MSG_028 \"ميغا بايت\"\r\nt MSG_029 \"الإفتراضي\"\r\nt MSG_030 \"%s (الإفتراضي)\"\r\nt MSG_031 \"BIOS (أو UEFI-CSM)\"\r\nt MSG_032 \"UEFI (بدون CSM)\"\r\nt MSG_033 \"BIOS أو UEFI\"\r\nt MSG_034 \"%d تجاوز\"\r\nt MSG_035 \"%d تجاوزات %s\"\r\nt MSG_036 \"صورة قرص ISO\"\r\nt MSG_037 \"التطبيق\"\r\nt MSG_038 \"إيقاف\"\r\nt MSG_039 \"بدأ\"\r\nt MSG_040 \"تنزيل\"\r\nt MSG_041 \"تم إلغاء العملية من قبل المستخدم\"\r\nt MSG_042 \"خطأ\"\r\nt MSG_043 \"خطأ: %s\"\r\nt MSG_044 \"تنزيل الملف\"\r\nt MSG_045 \"جهاز تخزين USB (عام)\"\r\nt MSG_046 \"%s (قرص %d) [%s]\"\r\nt MSG_047 \"أقسام متعددة\"\r\nt MSG_048 \"Rufus - تفريغ الذاكرة\"\r\nt MSG_049 \"Rufus - إلغاء\"\r\nt MSG_050 \"نجاح.\"\r\nt MSG_051 \"خطأ غير محدد أثناء التهيئة.\"\r\nt MSG_052 \"لا يمكن استخدام نظام الملفات المحدد لهذه الوسائط.\"\r\nt MSG_053 \"تم رفض الوصول إلى الجهاز.\"\r\nt MSG_054 \"الوسائط محمية ضد الكتابة.\"\r\nt MSG_055 \"الجهاز قيد الاستخدام بواسطة عملية أخرى. الرجاء إغلاق أي عملية أخرى قد تقوم بالوصول إلى الجهاز.\"\r\nt MSG_056 \"التهّيئة السريعة غير متاحة لهذا الجهاز.\"\r\nt MSG_057 \"تسمية وحدة التخزين غير صالحة.\"\r\nt MSG_058 \"معالج الجهاز غير صالح.\"\r\nt MSG_059 \"حجم المجموعة المحدد غير صالح لهذا الجهاز.\"\r\nt MSG_060 \"حجم وحدة التخزين غير صالح.\"\r\nt MSG_061 \"الرجاء ادراج وسائط قابلة للإزالة في محرك الأقراص.\"\r\nt MSG_062 \"تم استلام أمر غير مدعوم.\"\r\nt MSG_063 \"خطأ في تخصيص الذاكرة.\"\r\nt MSG_064 \"خطأ في القراءة.\"\r\nt MSG_065 \"خطأ في الكتابة.\"\r\nt MSG_066 \"فشل التثبيت\"\r\nt MSG_067 \"تعذر فتح الوسائط. قد يكون قيد الاستخدام من قبل عملية أخرى. الرجاء إعادة توصيل الوسائط وحاول مرة أخرى.\"\r\nt MSG_068 \"تعذر تقسيم محرك الأقراص.\"\r\nt MSG_069 \"تعذر نسخ الملفات إلى محرك الأقراص المستهدف.\"\r\nt MSG_070 \"تم الإلغاء من قبل المستخدم.\"\r\nt MSG_071 \"غير قادر على بدء الـ thread.\"\r\nt MSG_072 \"لم يكتمل فحص الأجزاء السيئة.\"\r\nt MSG_073 \"فشل فحص صورة قرص ISO.\"\r\nt MSG_074 \"فشل استخراج صورة قرص ISO.\"\r\nt MSG_075 \"إعادة تركيب وحدة التخزين غير ممكنة.\"\r\nt MSG_076 \"تعذر تصحيح/إعداد ملفات الاقلاع.\"\r\nt MSG_077 \"تعذر تعيين حرف لمحرك أقراص.\"\r\nt MSG_078 \"لا يمكن تحميل وحدة تخزين GUID.\"\r\nt MSG_079 \"الجهاز غير جاهز.\"\r\nt MSG_080 \"اكتشف Rufus أن Windows لا يزال يقوم بمسح المخازن المؤقتة للذاكرة الداخلية الخاصة به على جهاز USB.\\n\\nاعتمادًا على سرعة جهاز USB الخاص بك، قد تستغرق هذه العملية وقتًا طويلاً حتى تكتمل، خاصة للملفات الكبيرة.\\n\\nنوصي بترك Windows ينتهي لتجنب التلف. ولكن إذا مللت من الانتظار، يمكنك فقط فصل الجهاز ...\"\r\nt MSG_081 \"صورة قرص غير مدعومة\"\r\nt MSG_082 \"صورة القرص هذه إما غير قابلة للاقلاع، أو تستخدم طريقة اقلاع أو ضغط لا يدعمها Rufus ...\"\r\nt MSG_083 \"إستبدال %s؟\"\r\nt MSG_084 \"صورة الـISO يبدو استخدامها لإصدار قديم من '%s'. \\nقوائم الإقلاع قد لا يتم عرضها بشكل صحيح بهذا السبب.\\n\\nلإصلاح الخلل يمكنك تحميل إصدار جديد من قبل Rufus:\\n- إختر ‘نعم’ للإتصال بالإنترنت وتحميل الملف\\n- إختر ‘لا’ لترك ملف الISO دون تعديل\\nإذا كنت لا تعرف ما عليك فعله, عليك اختيار ‘نعم’.\\n\\nملاحظة: سيتم تحميل ملف جديد في المجلد الحالي للتطبيق وبعد العثور على ‘%s’ هناك, سوف يتم إعادة إستخدامه تلقائياً.\"\r\nt MSG_085 \"جاري تنزيل %s\"\r\nt MSG_086 \"لم يتم اختيار أي صورة قرص\"\r\nt MSG_087 \"ل %s NAND\"\r\nt MSG_088 \"صورة القرص كبيرة جدًا\"\r\nt MSG_089 \"صورة القرص كبيرة جدًا بالنسبة للهدف المحدد.\"\r\nt MSG_090 \"ISO غير مدعوم\"\r\nt MSG_091 \"عند استخدام نوع هدف UEFI، يتم دعم صور أقراص ISO القابلة للاقلاع من EFI فقط. الرجاء تحديد ملف ISO قابل للاقلاع من EFI أو تعيين نوع الهدف على BIOS.\"\r\nt MSG_092 \"نظام ملفات غير مدعوم\"\r\nt MSG_093 \"هام: هذا المحرك يحتوي على أجزاء متعددة !!\\n\\nقد يشمل ذلك أقسامًا أو وحدات تخزين غير مدرجة أو حتى مرئية من Windows. إذا كنت ترغب في المتابعة، فأنت مسؤول عن أي فقدان للبيانات في هذه الأقسام.\"\r\nt MSG_094 \"تم الكشف عن أقسام متعددة\"\r\nt MSG_095 \"صورة قرص DD\"\r\nt MSG_096 \"لا يمكن استخدام نظام الملفات المحدد حاليًا مع هذا النوع من ISO. الرجاء تحديد نظام ملفات مختلف أو استخدام ملف ISO مختلف.\"\r\nt MSG_097 \"'%s' يمكن فقط تطبيقه إذا كان نظام الملفات NTFS.\"\r\nt MSG_098 \"هام: أنت تحاول تثبيت 'Windows To Go'، لكن القرص المستهدف ليس لديه السمة 'FIXED'. على الأرجح سيتسبب هذا في تجمد ويندوز أثناء الإقلاع، لأن ميكروسوفت لم تصممه ليعمل مع الأقراص ذات السمة 'REMOVABLE'.\\n\\nهل لا زلت تريد الإستمرار؟\\n\\nملاحظة: السمات 'FIXED/REMOVABLE' هي خصائص للعتاد يمكن تغييرها فقط باستعمال أدوات خاصة من مُصنع الأقراص. لكن هذه الأدوات لا تُّوفر للعامة غالبا...\"\r\nt MSG_099 \"قيود نظام الملفات\"\r\nt MSG_100 \"تحتوي صورة قرص ISO هذه على ملف أكبر من 4 جيجابايت، وهو أكثر من الحجم الأقصى المسموح به لنظام الملفات FAT أو FAT32.\"\r\nt MSG_101 \"دعم WIM مفقود\"\r\nt MSG_102 \"لا يمكن لنظامك الأساسي استخراج الملفات من أرشيفات WIM. يلزم استخراج WIM لإنشاء محركات أقراص USB قابلة للإقلاع من EFI لنظامي التشغيل Windows 7 و Windows Vista. يمكنك إصلاح ذلك عن طريق تثبيت إصدار حديث من 7-Zip.\\nهل تريد زيارة صفحة التنزيل 7-zip؟\"\r\nt MSG_103 \"تنزيل %s؟\"\r\nt MSG_104 \"%s أو أحدث تتطلّب ملف '%s' ليتم التثبيت.\\nلأن هذا الملف هو أكثر من 100KB في الحجم، ومتوفّر دائماً في ملفات ISO %s, ليس متوفّرا في Rufus. \\n\\nRufus يمكنه تحميل الملف المفقود لك: \\n- إختر ‘نعم’ للإتصال بالإنترنت وتحميل الملف\\n- إختر ‘لا’ إذا كنت تريد نسخ هذا الملف على محرك الأقراص يدوياً في وقت لاحق\\n\\nملاحظة: سيتم تحميل ملف جديد في المجلد الحالي للتطبيق وبعد العثور على ‘%s’ هناك, سوف يتم إعادة إستخدامه تلقائياً.\"\r\nt MSG_105 \"الإلغاء قد يترك الجهاز في حالة غير صالحة للاستعمال.\\nإذا كنت متأكداً من أنك تريد الإلغاء، إضغط \\\"نعم\\\"، وإلا، إضغط \\\"لا\\\".\"\r\nt MSG_106 \"الرجاء إختيار مجلد\"\r\nt MSG_107 \"جميع الملفات\"\r\nt MSG_108 \"سجلّ Rufus\"\r\nt MSG_109 \"0x%02X (قرص %d)\"\r\nt MSG_110 \"لا يمكن لـ MS-DOS الإقلاع من محرك أقراص يستخدم حجم الكتلة 64 كيلو بايت.\\nالرجاء تغيير حجم الكتلة أو استخدام FreeDOS.\"\r\nt MSG_111 \"حجم الكتلة غير متوافق\"\r\nt MSG_112 \"يمكن أن تستغرق تهيئة وحدات التخزين UDF الكبيرة الكثير من الوقت. عند سرعات USB 2.0، تكون مدة التهيئة المقدرة بـ %d:%02d, حيث سيظهر شريط التقدم مجمداً. يرجى التحلي بالصبر!\"\r\nt MSG_113 \"وحدة تخزين UDF كبيرة\"\r\nt MSG_114 \"تستخدم هذه الصورة Syslinux %s%s لكن هذا التطبيق يتضمن فقط ملفات التثبيت لـ Syslinux %s%s.\\n\\nنظرًا لأن الإصدارات الجديدة من Syslinux غير متوافقة مع بعضها البعض، ولن يكون من الممكن لـ Rufus تضمينها جميعًا، يجب تنزيل ملفين إضافيين من الإنترنت ('ldlinux.sys' و 'ldlinux.bss'):\\n- قم بتحديد 'نعم' للاتصال بالإنترنت وتنزيل هذه الملفات\\n- قم بتحديد 'لا' لإلغاء العملية\\n\\nملاحظة: سيتم تنزيل الملفات في مجلد التطبيق الحالي وستتم إعادة استخدامها تلقائيًا إذا كانت موجودة.\"\r\nt MSG_115 \"التنزيل من الانترنت مطلوب\"\r\nt MSG_116 \"هذه الصورة (image) تستعمل Grub %s لكن التطبيق يحتوي فقط على ملفات تثبيت Grub %s.\\n\\nبما أن إصدارات Grub المختلفة قد لا تتوافق مع بعضهاالبعض، وبما أنه لا يمكن ضمها كلها، فسيحاول Rufus تحديد مكان إصدار من ملف تثبيت Grub ('core.img') يتوافق مع الموجود في صورتك:\\n- إختر 'نعم' للاتصال بلالأنترنت ومحاولة تنزيله\\n- إختر 'لا' لاستعمال الإصدار الافتراضي من Rufus\\n- إختر 'إلغاء' لوقف العملية\\n\\nملاحظة: سيتم تنزيل الملف في المجلد الحالي للتطبيق و سيستعمل تلقائيا إذا كان موجداً. إذا لم يتم العثور على إصدار موافق، فسيُستعمل الإصدار الافتراضي كبديل.\"\r\nt MSG_117 \"التثبيت القياسي لنظام التشغيل Windows\"\r\nt MSG_119 \"خصائص محرك الأقراص المتقدّمة\"\r\nt MSG_120 \"خيارات التهّيئة المتقدّمة\"\r\nt MSG_121 \"أظهار %s\"\r\nt MSG_122 \"أخفاء %s\"\r\nt MSG_123 \"حجم التقسيم المستمر\"\r\nt MSG_124 \"لا استمرارية\"\r\nt MSG_125 \"حدد حجم التقسيم المستمر لجهاز ال USB الحي, تحديد الحجم بقيمة 0 سيعطل التقسيم المستمر.\"\r\nt MSG_126 \"حدد حجم  وحدات التقسيم.\"\r\nt MSG_127 \"لا تظهر هذه الرسالة مرة آخرى\"\r\nt MSG_128 \"تنويه مهم عن %s\"\r\nt MSG_129 \"لقد قمت لتوك بإنشاء وسائط تستخدم محمل الإقلاع UEFI:NTFS. يرجى التذكر أنه يجب تعطيل Secure Boot للتمكن من إقلاع الوسائط.\\nللمزيد من التفاصيل عن ضرورة الإجراء المذكور, إضغط على زر 'مزيد من المعلومات' أدناه.\"\r\nt MSG_130 \"اختيار صورة Windows\"\r\nt MSG_131 \"يحتوي ملف ISO هذا على العديد من صور Windows.\\nالرجاء تحديد الصورة التي ترغب في استخدامها لهذا التثبيت:\"\r\nt MSG_132 \"هذا القرص يستخدم من قبل برنامج آخر. هل تود التهيئة على أية حال ؟\"\r\nt MSG_133 \"لقد قام Rufus بإكتشاف أنك تحاول إنشاء وسائط Windows To Go بناءً على ISO 1809\\n\\nبسبب عيب في Microsoft, سوف تتوقف الوسائط خلال إقلاع Windows (شاشة الموت الزرقاء) ما لم تقم يدوياً بإستبدال ملف 'WppRecorder.sys' بإصدار 1803.\\n\\nيرجى العلم أن سبب عدم إمكانية Rufus من إصلاح المشكلة تلقائيا هو أن ملف 'WppRecorder.sys' محفوظ الحقوق ل Microsoft, لذلك لا يمكننا تضمين نسخة من الملف في التطبيق...\"\r\nt MSG_134 \"بسبب إختيار نظام التجزئة MBR, Rufus(Rufus) قادر فقط على إنشاء تجزئة لغاية 2 TB على هذه الوسائط, الذي سوف يؤدي إلى عدم توفر %s من مساحة القرص.\\n\\nهل تريد المتابعة ؟\"\r\nt MSG_135 \"الإصدار\"\r\nt MSG_136 \"الإطلاق\"\r\nt MSG_137 \"النسخة\"\r\nt MSG_138 \"اللغة\"\r\nt MSG_139 \"البنية\"\r\nt MSG_140 \"متابعة\"\r\nt MSG_141 \"رجوع\"\r\nt MSG_142 \"يرجى الانتظار ...\"\r\nt MSG_143 \"التنزيل باستخدام المتصفح\"\r\n# mentioned the minimum 12 hours wait.\r\nt MSG_144 \"لا يتوفر تنزيل Windows ISOs نظرًا لأن شركة Microsoft قد غيرت موقعها على الويب لمنع ذلك.\"\r\nt MSG_145 \"مطلوب PowerShell 3.0 أو أحدث لتشغيل هذا البرنامج النصي.\"\r\nt MSG_146 \"هل ترغب بالتحميل عن طريق الإنترنت ؟\"\r\nt MSG_148 \"جارٍ تشغيل برنامج التنزيل ...\"\r\nt MSG_149 \"تحميل صورة ISO\"\r\nt MSG_150 \"نوع الكمبيوتر الذي تخطط لاستخدام محرك الأقراص القابل للاقلاع معه. تقع على عاتقك مسؤولية تحديد ما إذا كان هدفك من نوع BIOS أو UEFI قبل البدء في إنشاء محرك الأقراص، حيث قد يفشل في الاقلاع بطريقة أخرى.\"\r\nt MSG_151 \"'UEFI-CSM' تعني أن الجهاز سوف يقلع فقط في وضع محاكات BIOS (يعرف أيضا ب 'Legacy Mode') في وضع UEFI, وليس في وضع UEFI الأساسي.\"\r\nt MSG_152 \"'بدون CSM' تعني أن الجهاز سوف يقلع فثط في وضع UEFI الأساسي, وليس وضع محاكات BIOS (تعرف أيضا ب 'Legacy Mode')\"\r\nt MSG_153 \"إختبار نمط: 0x%02X\"\r\nt MSG_154 \"إختبار نمط: 0x%02X, 0x%02X\"\r\nt MSG_155 \"إختبار نمط: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"إختبار نمط: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"يحدد نظام الملفات المستهدف\"\r\nt MSG_158 \"الحد الأدنى لحجم كتلة البيانات التي ستشغله في نظام الملفات\"\r\nt MSG_159 \"استخدام هذا الحقل لتعيين تسمية محرك الأقراص \\nالرموز الدولية مقبولة.\"\r\nt MSG_160 \"إدراج الخيارات المتقدّمة\"\r\nt MSG_161 \"فحص الجهاز من الأجزاء التالفة باستخدام نمط اختبار\"\r\nt MSG_162 \"قم بإلغاء الإختيار لهذا المربّع لاستخدام طريقة فرمتة \\\"بطيئة \\\"\"\r\nt MSG_163 \"الطريقة اللتي سيتم إستخدامها لإنشاء الاتجزئات\"\r\nt MSG_164 \"الطريقة التي سيتّم إستخدامها لخلق محرك أقراص إقلاعي\"\r\nt MSG_165 \"إضغط لإختيار أو تحميل صورة ...\"\r\nt MSG_166 \"حدّد هذا المربّع للسماح بعرض التسميات الدولية وتعيين أيقونة الجهاز (إنشاء autorun.inf)\"\r\nt MSG_167 \"قم بتثبيت أداة تحميل تشغيل UEFI، و التي ستقوم بالتحقق من صحة الملف بإستخدام MD5\"\r\nt MSG_169 \"إنشاء قسم إضافي خفي ومحاذاة حدود الأقسام.\\nهذا يمكنه تحسين إكتشاف الإقلاع لـ BIOSes قديمة.\"\r\nt MSG_170 \"تمكين إدراج مرفقات القرص الصلب USB. إستخدمه على مسؤوليتك الخاصة!!!\"\r\nt MSG_171 \"بدء عملية الفرمتة. \\nستم تدمير أية بيانات على الهدف!\"\r\nt MSG_172 \"التوقيع الرقمي للتحميل غير صالح\"\r\nt MSG_173 \"إضغط لاختيار...\"\r\nt MSG_174 \"Rufus - أداة فرمتة الـ USB جديرة بالثقة\"\r\nt MSG_175 \"إصدار %d.%d (بناء %d)\"\r\nt MSG_176 \"الترجمة إلى العربية:\\\\line• أ. راس النعامة \\\\line• عمر الصمد \\\\line• فراس السيخ \\\\line• عبدالمجيد\"\r\nt MSG_177 \"الإبلاغ عن الأخطاء أو طلب التحسينات على:\"\r\nt MSG_178 \"حقوق النشر الإضافية:\"\r\nt MSG_179 \"سياسة التحديث:\"\r\nt MSG_180 \"إذا اخترت السماح لهذا البرنامج بالتحقق من تحديثات التطبيق، فأنت توافق على أنه يمكن جمع المعلومات التالية على الخادم (الخوادم) الخاصة بنا:\"\r\nt MSG_181 \"بنية نظام التشغيل الخاص بك وإصداره\"\r\nt MSG_182 \"إصدار التطبيق الذي تستخدمه\"\r\nt MSG_183 \"عنوان IP الخاص بك\"\r\nt MSG_184 \"لغرض إنشاء إحصاءات الاستخدام الخاصة، قد نحتفظ بالمعلومات التي تم جمعها, \\\\b لمدة عام على الأكثر\\\\b0 . ومع ذلك،، فإننا لن نكشف عن أي من هذه البيانات الفردية طوعًا لأطراف ثالثة.\"\r\nt MSG_185 \"عملية التحديث:\"\r\nt MSG_186 \"Rufus لا يقوم بتثبيت أو تشغيل خدمات خلفية, وبالتالي يتم التحقّق من تحديثات فقط عند تشغيل التطبيق الرئيسي. \\\\line\\nالإتصال بالإنترنت بالطبع مطلوب عند التحقّق من وجود تحديثات.\"\r\nt MSG_187 \"صورة (image) غير صالحة للخيار الإقلاعي المحدّد\"\r\nt MSG_188 \"الصورة (image) الحالية لا تتطابق مع الخيار الإقلاعي المحدّد. يُرجى إستخدام صورة مختلفة أو تحديد خيار إقلاعي آخر.\"\r\nt MSG_189 \"صورة  ISO هذه غير متوافقة مع نظام الملفات المحدّد\"\r\nt MSG_190 \"إكتشاف قرص غير متوافق\"\r\nt MSG_191 \"تجاوز الكتابة\"\r\nt MSG_192 \"تجاوز القراءة\"\r\nt MSG_193 \"تم تنزيل %s\"\r\nt MSG_194 \"تعذر تنزيل %s\"\r\nt MSG_195 \"استعمال الإصدار المُضمّن من ملف(ات) %s\"\r\nt MSG_196 \"هام: هذا القرص يستخدم حجم قطاع غير قياسي!\\n\\nالأقراص التقليدية تستعمل 512-بايت كحجن قطاع لكن هذا القراص يستعمل %d-بايت. في العديد من الحالات، هذا يعني أنك لن تستطيع الإقلاع من هذا القرص.\\nيستطيع Rufus محاولة إنشاء قرص إقلاع، لكن من دون ضمان أنه سيعمل.\"\r\nt MSG_197 \"إكتشاف حجم قطاع غير قياسي\"\r\nt MSG_198 \"يمكن تثبيت 'Windows To Go' فقط على قرص بتقسيمات GPT إذا كان عنده السمة FIXED مُحددة. لم يتم إكتشاف FIXED في القرص الحالي.\"\r\nt MSG_199 \"هذه الميزة غير متوفرة في هذه المنصة.\"\r\nt MSG_201 \"جاري الإلغاء – الرجاء الإنتظار...\"\r\nt MSG_202 \"فحص الصورة (image)...\"\r\nt MSG_203 \"فشل فحص الصورة\"\r\nt MSG_204 \"إكتشاف %s قديمة\"\r\nt MSG_205 \"إستخدام صورة: %s\"\r\nt MSG_206 \"ملف %s مفقود\"\r\nt MSG_207 \"وحدة جديدة\"\r\nt MSG_208 \"إكتشاف جهاز %d\"\r\nt MSG_209 \"إكتشاف أجهزة %d\"\r\nt MSG_210 \"جاهز\"\r\nt MSG_211 \"تم الإلغاء\"\r\nt MSG_212 \"فشلت\"\r\nt MSG_213 \"إطلاق تطبيق جديد...\"\r\nt MSG_214 \"فشل إطلاق تطبيق جديد\"\r\nt MSG_215 \"تم فتح ‪%s\"\r\nt MSG_216 \"تم حفظ ‪%s\"\r\nt MSG_217 \"التهيئة: %s\"\r\nt MSG_218 \"إنشاء نظام الملفات: عملية %d/%d تمت\"\r\nt MSG_219 \"إصلاح NTFS: تم إصلاح %d%%\"\r\nt MSG_220 \"فرمتة (%s) – المدة التقديرية %d:%02d...\"\r\nt MSG_221 \"جاري تسمية (%s)...\"\r\nt MSG_222 \"فرمتة (%s)...\"\r\nt MSG_223 \"إصلاح NTFS (Checkdisk)...\"\r\nt MSG_224 \"مسح بنية MBR/PBR/GPT...\"\r\nt MSG_225 \"طلب الوصول إلى القرص...\"\r\nt MSG_226 \"تحليل سجلّات الإقلاع الموجودة...\"\r\nt MSG_227 \"غلق وحدة التخزين الموجودة...\"\r\nt MSG_228 \"كتابة سجلّ الإقلاع الرئيسي (MBR) ...\"\r\nt MSG_229 \"كتابة سجل إقلاع القسم ...\"\r\nt MSG_230 \"نسخ ملفات الـDOS...\"\r\nt MSG_231 \"نسخ ملفات الـISO: ‏%s\"\r\nt MSG_232 \"إعداد إقلاع EFI ل ويندوز7 (%s)...\"\r\nt MSG_233 \"وضع اللمسات الأخيرة، يرجى الانتظار...\"\r\nt MSG_234 \"تثبيت Syslinux %s...\"\r\nt MSG_235 \"الأجزاء التالفة: تجاوز %d/%d - %0.2f%% (%d/%d/%d أخطاء)\"\r\nt MSG_236 \"الأجزاء التالفة: إختبار بواسطة نمط عشوائي\"\r\nt MSG_237 \"الأجزاء التالفة: إختبار بواسطة نمط 0x%02X\"\r\nt MSG_238 \"تقسيم (%s)...\"\r\nt MSG_239 \"حذف الأقسام (%s)...\"\r\nt MSG_240 \"لا يمكن التحقق من صحة التوقيع الرقمي للتحديث المحمل, قد يعني ذلك ان نظامك مضبوط بشكل غير صحيح للتعامل مع التحقق من التوقيع الرقمي أو قد يدل على تحميل خبيث.\\n\\nسيتم حذف التحميل, راجع السجل للاطلاع على المزيد من التفاصيل.\"\r\nt MSG_241 \"التحميل: %s\"\r\nt MSG_242 \"فشل في تحميل الملف.\"\r\nt MSG_243 \"التحقّق من تحديثات Rufus...\"\r\nt MSG_244 \"التحديثات: عدم القدرة على الإتصال بالإنترنت\"\r\nt MSG_245 \"التحديثات: عدم القدرة على الوصول إلى بيانات الإصدار\"\r\nt MSG_246 \"إصدار جديد متاح من Rufus!\"\r\nt MSG_247 \"لم يتم العثور على إصدار جديد من Rufus\"\r\nt MSG_248 \"تم حذف مفاتيح التسجيل للتطبيق بنجاح\"\r\nt MSG_249 \"فشل في حذف مفاتيح التسجيل للتطبيق\"\r\nt MSG_250 \"تفعيل %s\"\r\nt MSG_251 \"تعطيل %s\"\r\nt MSG_252 \"التحقّق من الحجم\"\r\nt MSG_253 \"الكشف عن الأقراص الثابتة\"\r\nt MSG_254 \"فرض فرمتة FAT32 كبيرة\"\r\nt MSG_255 \"سيتمّ حذف NoDriveTypeAutorun عند الخروج\"\r\nt MSG_256 \"الكشف عن محرّك وهمي\"\r\nt MSG_257 \"دعم Joliet\"\r\nt MSG_258 \"دعم Rock Ridge\"\r\nt MSG_259 \"فرض التحديث\"\r\nt MSG_260 \"ضغط NTFS\"\r\nt MSG_261 \"كتابة الصورة: %s\"\r\nt MSG_262 \"دعم ISO\"\r\nt MSG_263 \"استعمل وحدات حجم مناسبة (PROPER)\"\r\nt MSG_264 \"حذف المجلد '%s'\"\r\nt MSG_265 \"الكشف عن قرص VMWare\"\r\nt MSG_266 \"نمط UEFI/BIOS ثنائي\"\r\nt MSG_267 \"تطبيق صورة (نسخة) ويندوز: %s\"\r\nt MSG_268 \"تطبيق صورة (نسخة) ويندوز...\"\r\nt MSG_269 \"الحفاظ على الطوابع الزمنية\"\r\nt MSG_270 \"تنقيح الأخطاء عن طريق USB\"\r\nt MSG_271 \"حساب مجاميع الإختبار (Checksums) للصورة (Image): %s\"\r\nt MSG_272 \"حساب مجاميع اختبار (checksums) SHA256 و SHA1 و MD5 للصورة المختارة\"\r\nt MSG_273 \"تغيير لغة التطبيق\"\r\nt MSG_274 \"تم إكتشاف صورة ٪ s\"\r\nt MSG_275 \"الصورة التي اخترتها هي صورة 'ISOHybrid'. هذا يعني أنه يمكن كتابتها إما في نمط نسخة ملف %s وإما في نمط نسخة قرص %s.\\n Rufus يوصي باستعمال نمط %s، كي تتمكن دوما من الوصول الكامل إلى القرص بعد كتابته.\\nلكن، إذا واجهت مشاكلا خلال الإقلاع يمكنك محاولة كتابة هاته الصورة مرة أخرى في نمط %s.\\n\\nفضلا اختر النمط الذي تريده لكتابة هاته الصورة:\"\r\nt MSG_276 \"كتابة في نمط %s (موصى به)\"\r\nt MSG_277 \"كتابة في نمط %s\"\r\nt MSG_278 \"التحقق من العمليات المتعارضة...\"\r\nt MSG_279 \"لا يمكن الإقلاع منه\"\r\nt MSG_280 \"قرص أو صورة ISO\"\r\nt MSG_281 \"(الرجاء الأختيار) %s\"\r\nt MSG_282 \"القفل الحصري للUSB\"\r\nt MSG_283 \"التوفيع الرقمي غير صالح\"\r\nt MSG_284 \"الملف التنفيذي المحمل ينقصه توقيع رقمي.\"\r\nt MSG_285 \"الملف التنفيذي المحمل موقع من قبل '%s'.\\nهذا ليس بتوقيع رقمي موثوق من قبلنا وقد يسبب نشاطات تخريبية...\\nهل أنت متأكد من الأستمرار؟\"\r\nt MSG_286 \"تصفير القرص: %s\"\r\nt MSG_287 \"الكشف عن الأقراص غير USB القابلة للإزالة\"\r\nt MSG_288 \"عدم التوفر على صلاحيات رفيعة\"\r\nt MSG_289 \"هذا التطبيق يمكنه العمل فقط عند وجود صلاحيات رفيعة\"\r\nt MSG_290 \"فهرسة الملفات\"\r\nt MSG_291 \"إختيار الإصدار\"\r\nt MSG_292 \"الرجاء إختيار إصدار الويندوز المراد تنصيبه:\"\r\nt MSG_293 \"إصدار ويندوز غير مدعوم\"\r\nt MSG_294 \"هذا الإصدار من الويندوز لم يعد مدعوماً من قبل Rufusـ\\nالإصدار الأخير من Rufus المتوافق مع هذه المنصة هو v%d.%d.\"\r\nt MSG_295 \"تحذير: إصدار غير رسمي\"\r\nt MSG_296 \"هذا الإصدار من Rufus لم يتم إنتاجه من قبل المطورين الرسميين.\\n\\n؟هل أنت متأكد من الأستمرار?\"\r\nt MSG_297 \"إكتشاف ISO مقطوعة\"\r\nt MSG_298 \"ملف الISO المحدد لا يطابق حجمه المعلن من قبله: %s من البيانات مفقود!\\n\\nإذا قمت بالحصول على هذا الملف من الإنترنت, يجب عليك تحميل نسخة جديدة و التحقق من أن المجموع الإختباري لMD5 و SHA مطابق للنسخ(ة) الأصلية.\\n\\nعلماُ بانه يمكنك مقارنة الMD5 و SHA في Rufus عن طريق الضغط على زر (✓)\"\r\nt MSG_299 \"خطأ في التحقق من الطابع الزمني\"\r\nt MSG_300 \"Rufus لم يتمكن من التحقق أن الطابع الزمني للتحديث الذي تم تنزيله أحدث من ذلك الذي في البرنامج التنفيذي الحالي. \\n\\n من أجل منع سيناريوهات الهجوم المحتملة, تم إحباط عملية التحديث و سيتم حذف التحديث, الرجاء التحقق من السجل لمزيد من التفاصيل.\"\r\nt MSG_301 \"عرض إعدادات التطبيق\"\r\nt MSG_302 \"عرض معلومات حول هذا التطبيق\"\r\nt MSG_303 \"إظهار السجل\"\r\nt MSG_304 \"قم بإنشاء صورة قرص للجهاز المحدد\"\r\nt MSG_305 \"استخدم هذا الخيار للإشارة إلى ما إذا كنت تخطط لتثبيت Windows على قرص مختلف ، أو إذا كنت تريد إقلاع Windows بشكل مباشر من محرك الأقراص هذا (Windows To Go).\"\r\nt MSG_306 \"التصفير السريع لمحرك الأقراص: %s\"\r\nt MSG_307 \"هذا قد يستغرق بعض الوقت\"\r\nt MSG_308 \"إكتشاف VHD\"\r\nt MSG_309 \"أرشيف مضغوط\"\r\nt MSG_310 \"يستخدم ISO الذي حددته UEFI وهو صغير بما يكفي ليتم كتابته كقسم نظام EFI (ESP). يمكن أن تكون الكتابة إلى ESP ، بدلاً من الكتابة إلى قسم بيانات عام تشغل القرص بأكمله ، هي الأفضل لبعض أنواع التثبيتات.\\n\\nالرجاء تحديد الوضع الذي تريد استخدامه لكتابة هذه الصورة(Image):\"\r\nt MSG_311 \"استخدم %s (في نافذة التطبيق الرئيسية) للتمكين.\"\r\nt MSG_312 \"علامات التجزئة الإضافية (SHA512)\"\r\nt MSG_313 \"حفظ إلى VHD\"\r\nt MSG_314 \"حساب المجاميع الاختبارية للصور\"\r\nt MSG_315 \"أزرار متعددة\"\r\nt MSG_316 \"عدد مرات المرور\"\r\nt MSG_317 \"رقم تعريف القرص\"\r\nt MSG_318 \"الأفضلية الافتراضية لـ thread : %d\"\r\nt MSG_319 \"تجاهل علامة الإقلاع\"\r\nt MSG_320 \"جاري تحديث تخطيط القسم (%s) ...\"\r\nt MSG_321 \"الصورة التي حددتها هي  ISO-Hybrid (هجينة) ، لكن منشئوها لم يجعلوها متوافقة مع وضع نسخ ملف  ISO. \\nنتيجة لذلك ، سيتم فرض وضع DD لكتابة الصورة.\"\r\nt MSG_322 \"غير قادر على فتح أو قراءة '%s'\"\r\nt MSG_325 \"جاري تطبيق تخصيصات ويندوز: %s\"\r\nt MSG_326 \"جاري تطبيق خيارات المستخدم ...\"\r\nt MSG_327 \"تجربة مستخدم ويندوز\"\r\nt MSG_328 \"هل تريد تخصيص تثبيت ويندوز؟\"\r\nt MSG_329 \"قم بإزالة متطلبات 4GB + RAM ، Secure Boot و TPM 2.0\"\r\nt MSG_330 \"قم بإزالة متطلبات حساب مايكروسوفت عبر الإنترنت\"\r\nt MSG_331 \"تعطيل جمع البيانات (تخطي أسئلة الخصوصية)\"\r\nt MSG_332 \"منع Windows To Go من الوصول إلى الأقراص الداخلية\"\r\nt MSG_333 \"قم بإنشاء حساب محلي باسم المستخدم:\"\r\nt MSG_334 \"قم بتعيين الخيارات الإقليمية لتطابق خيارات المستخدم الحالي\"\r\nt MSG_335 \"تعطيل التشفير التلقائي BitLocker للجهاز\"\r\nt MSG_336 \"سجل متواصل\"\r\nt MSG_337 \"يجب تنزيل ملف إضافي ('%s') من Microsoft لاستخدام هذه الميزة:\\n- حدد \\\"نعم\\\" للاتصال بالإنترنت وتنزيله\\n- اختر \\\"لا\\\" لإلغاء العملية\\n\\nملاحظة: سيتم تنزيل الملف في مجلد التطبيق وسيتم إعادة استخدامه تلقائيًا إذا كان موجودًا.\"\r\nt MSG_338 \"تم اكتشاف أداة تحميل التشغيل UEFI التي تم إبطالها سابقا\"\r\nt MSG_339 \"اكتشف Rufus أن ملف ISO الذي حددته يحتوي على أداة تحميل التشغيل UEFI التي تم إبطالها سابقا والتي ستنتج %s، عند تمكين Secure Boot محدث بالكامل على نظام UEFI .\\n\\n- إذا حصلت على صورة ISO هذه من مصدر غير حسن السمعة، فيجب أن تفكر في احتمالية احتوائها على برامج UEFI ضارة وتجنب التشغيل منها.\\n- إذا حصلت على صورة ISO هذه من مصدر موثوق به، فعليك محاولة العثور على إصدار أكثر حداثة، والذي لن ينتج عنه هذا التحذير.\"\r\nt MSG_340 \"شاشة \\\"الانتهاكات الأمنية\\\"\"\r\nt MSG_341 \"شاشة استرداد ويندوز (BSOD) مع '%s'\"\r\nt MSG_342 \"صورة VHDX مضغوطة\"\r\nt MSG_343 \"صورة VHD غير مضغوطة\"\r\nt MSG_344 \"صورة (image) لتحديث فلاشة كاملة (FFU)\"\r\nt MSG_345 \"يجب تنزيل بعض البيانات الإضافية من Microsoft لاستخدام هذه الوظيفة:\\n- اختر \\\"نعم\\\" للاتصال بالإنترنت وتنزيلها\\n- اختر \\\"لا\\\" لإلغاء العملية\"\r\nt MSG_346 \"تقييد Windows على الوضع \\\"S\\\" (S-Mode، غير متوافق مع تجاوز الحساب عبر الإنترنت)\"\r\nt MSG_347 \"وضع الخبير\"\r\nt MSG_348 \"استخراج ملفات الأرشيف: %s\"\r\nt MSG_349 \"استخدم Refus MBR\"\r\nt MSG_900 \"برنامج Rufus هو أداة تساعد في تنسيق وإنشاء أقراص الإقلاع USB، مثل مفاتيح USB، بطاقات الذاكرة، وغيرها.\"\r\nt MSG_901 \"الموقع الرسمي: %s\"\r\nt MSG_902 \"كود المصدر: %s\"\r\nt MSG_903 \"سجل التغييرات: %s\"\r\nt MSG_904 \"هذا التطبيق مُرخص بموجب شروط رخصة جنو (GNU) العمومية (GPL) الإصدار 3.\\nراجع https://www.gnu.org/licenses/gpl-3.0.ar.html لمزيد من التفاصيل.\"\r\nt MSG_905 \"الإقلاع (Boot)\"\r\nt MSG_910 \"تهيئة USB وبطاقة الفلاش ومحركات الأقراص الافتراضية إلى FAT / FAT32 / NTFS / UDF / exFAT / ReFS / ext2 / ext3\"\r\nt MSG_911 \"إنشاء محركات أقراص USB قابلة للإقلاع من FreeDOS\"\r\nt MSG_912 \"إنشاء محركات أقراص قابلة للإقلاع من ملفات ISO القابلة للإقلاع (Windows و Linux وما إلى ذلك)\"\r\nt MSG_913 \"إنشاء محركات أقراص قابلة للإقلاع من صور الأقراص القابلة للإقلاع ، بما في ذلك الأقراص المضغوطة\"\r\nt MSG_914 \"إنشاء BIOS أو محركات أقراص UEFI قابلة للإقلاع ، بما في ذلك UEFI NTFS القابل للتشغيل\"\r\nt MSG_915 \"إنشاء محركات أقراص \\\"Windows To Go\\\"\"\r\nt MSG_916 \"قم بإنشاء محركات تثبيت ويندوز 11 لأجهزة الكمبيوتر التي لا تحتوي على TPM أو الإقلاع الآمن (Secure Boot)\"\r\nt MSG_917 \"إنشاء Persistent Linux partitions\"\r\nt MSG_918 \"إنشاء صور VHD / DD لمحرك الأقراص المحدد\"\r\nt MSG_919 \"حساب المجاميع الإختبارية MD5 و SHA-1 و SHA-256 و SHA-512 للصورة المحددة\"\r\nt MSG_920 \"إجراء فحوصات كتل تالفة ، بما في ذلك الكشف عن محركات أقراص فلاش \\\"زائفة\\\"\"\r\nt MSG_921 \"قم بتنزيل ملفات ISO الرسمية الخاصة بـ Microsoft Windows\"\r\nt MSG_922 \"قم بتنزيل UEFI Shell ISOs\"\r\n\r\n######################################################################\r\nl \"bg-BG\" \"Bulgarian (Български)\" 0x0402\r\nv 3.22\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Относно Rufus\"\r\nt IDC_ABOUT_LICENSE \"Лиценз\"\r\nt IDOK \"ОК\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Свойства на устройството\"\r\nt IDS_DEVICE_TXT \"Устройство\"\r\nt IDS_BOOT_SELECTION_TXT \"Тип на стартирането\"\r\nt IDC_SELECT \"Избери\"\r\nt IDS_IMAGE_OPTION_TXT \"Опция за образ\"\r\nt IDS_PARTITION_TYPE_TXT \"Дялова схема\"\r\nt IDS_TARGET_SYSTEM_TXT \"Целева система\"\r\nt IDC_LIST_USB_HDD \"Изброяване на USB дискове\"\r\nt IDC_OLD_BIOS_FIXES \"Добави поправки за стари BIOS-и\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Активиране на валидирането на UEFI медия по време на изпълнение\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Опции за форматиране\"\r\nt IDS_FILE_SYSTEM_TXT \"Файлова система\"\r\nt IDS_CLUSTER_SIZE_TXT \"Размер на клъстера\"\r\nt IDS_LABEL_TXT \"Нов етикет на тома\"\r\nt IDC_QUICK_FORMAT \"Бързо форматиране\"\r\nt IDC_BAD_BLOCKS \"Провери устройството за лоши сектори\"\r\nt IDC_EXTENDED_LABEL \"Създай разширен етикет и икони\"\r\nt IDS_STATUS_TXT \"Статус\"\r\nt IDCANCEL \"Затвори\"\r\nt IDC_START \"Старт\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Затвори\"\r\nt IDD_LICENSE \"Rufus лиценз\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Затвори\"\r\nt IDD_LOG \"Регистър\"\r\nt IDC_LOG_CLEAR \"Изчисти\"\r\nt IDC_LOG_SAVE \"Запази\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Затвори\"\r\nt IDD_NEW_VERSION \"Провери за актуализации - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Налична е по-нова версия. Моля, изтеглете последната версия!\"\r\nt IDC_WEBSITE \"Щракнете тук, за да отидете на сайта\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Бележки по дистрибуцията\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Изтегли\"\r\nt IDC_DOWNLOAD \"Изтегли\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Повече информация\"\r\nt IDYES \"Да\"\r\nt IDNO \"Не\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Затвори\"\r\nt IDD_UPDATE_POLICY \"Политика за актуализации и настройки\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Настройки\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Провери за актуализации\"\r\nt IDS_INCLUDE_BETAS_TXT \"Включи и бета версиите\"\r\nt IDC_CHECK_NOW \"Провери сега\"\r\n\r\nt MSG_001 \"Засечена е друга инстанция\"\r\nt MSG_002 \"Засечено е друго работещо Rufus приложение.\\nМоля, затворете първото приложение преди да стартирате ново.\"\r\nt MSG_003 \"ВНИМАНИЕ: ВСИЧКАТА ИНФОРМАЦИЯ НА УСТРОЙСТВО '%s' ЩЕ БЪДЕ УНИЩОЖЕНА.\\nЗа да продължите с тази операция, натиснете OK. За да я прекратите, натиснете CANCEL.\"\r\nt MSG_004 \"Rufus политика за актуализации\"\r\nt MSG_005 \"Желаете ли да разрешите на Rufus да проверява за актуализации в интернет?\"\r\nt MSG_006 \"Затвори\"\r\nt MSG_007 \"Откажи\"\r\nt MSG_008 \"Да\"\r\nt MSG_009 \"Не\"\r\nt MSG_010 \"Намерени са лоши блокове\"\r\nt MSG_011 \"Проверката завършена: намерени са %d лоши блокове\\n  %d грешки при четене\\n  %d грешки при записване\\n  %d грешки с увреждания\"\r\nt MSG_012 \"%s\\nПо-подробен доклад може да намерите в:\\n%s\"\r\nt MSG_013 \"Забранено\"\r\nt MSG_014 \"Ежедневно\"\r\nt MSG_015 \"Ежеседмично\"\r\nt MSG_016 \"Ежемесечно\"\r\nt MSG_017 \"Персонално\"\r\nt MSG_018 \"Вашата версия е: %d.%d (Build %d)\"\r\nt MSG_019 \"Последната версия е: %d.%d (Build %d)\"\r\nt MSG_020 \"байта\"\r\nt MSG_021 \"КБ\"\r\nt MSG_022 \"МБ\"\r\nt MSG_023 \"ГБ\"\r\nt MSG_024 \"ТБ\"\r\nt MSG_025 \"ПБ\"\r\nt MSG_026 \"байта\"\r\nt MSG_027 \"килобайта\"\r\nt MSG_028 \"мегабайта\"\r\nt MSG_029 \"По подразбиране\"\r\nt MSG_030 \"%s (По подразбиране)\"\r\nt MSG_031 \"BIOS (или UEFI-CSM)\"\r\nt MSG_032 \"UEFI (без CSM)\"\r\nt MSG_033 \"BIOS или UEFI\"\r\nt MSG_034 \"%d пробег\"\r\nt MSG_035 \"%d пробега %s\"\r\nt MSG_036 \"ISO образ\"\r\nt MSG_037 \"Приложение\"\r\nt MSG_038 \"Прекрати\"\r\nt MSG_039 \"Стартирай\"\r\nt MSG_040 \"Изтегли\"\r\nt MSG_041 \"Операцията прекратена от потребителя\"\r\nt MSG_042 \"Грешка\"\r\nt MSG_043 \"Грешка: %s\"\r\nt MSG_044 \"Изтегляне на файл\"\r\nt MSG_045 \"USB съхраняващо устройство (Generic)\"\r\nt MSG_046 \"%s (Диск %d) [%s]\"\r\nt MSG_047 \"Множество дялове\"\r\nt MSG_048 \"Rufus - Прочистване на буферите\"\r\nt MSG_049 \"Rufus - Прекратяване\"\r\nt MSG_050 \"Завършено успешно.\"\r\nt MSG_051 \"Неопределена грешка при форматирането.\"\r\nt MSG_052 \"Не може да използвате избраната файлова система за този вид устройство.\"\r\nt MSG_053 \"Достъпът до устройството е забранен.\"\r\nt MSG_054 \"Устройството е защитено срещу записване.\"\r\nt MSG_055 \"Това устройство се използва от друг процес. Моля, спрете всички процеси, които използват това устройство.\"\r\nt MSG_056 \"Бързото форматиране не е налично за това устройство.\"\r\nt MSG_057 \"Етикетът на тома е невалиден.\"\r\nt MSG_058 \"Устройственият манипулатор е невалиден.\"\r\nt MSG_059 \"Избраният размер на клъстера е невалиден за това устройство.\"\r\nt MSG_060 \"Размерът на този том е невалиден.\"\r\nt MSG_061 \"Моля, поставете сменяем носител в устройството.\"\r\nt MSG_062 \"Получена е неподдържана команда.\"\r\nt MSG_063 \"Грешка при разпределяне на паметта.\"\r\nt MSG_064 \"Грешка при четене.\"\r\nt MSG_065 \"Грешка при записване.\"\r\nt MSG_066 \"Неуспешна инсталация\"\r\nt MSG_067 \"Устройството не можа да бъде отворено. Възможно е да се използва от друг процес. Моля, изкарайте и вкарайте повторно устройството и опитайте отново.\"\r\nt MSG_068 \"Грешка при създаването на дялове.\"\r\nt MSG_069 \"Файловете не можаха да бъдат копирани на целевото устройство.\"\r\nt MSG_070 \"Прекратено от потребител.\"\r\nt MSG_071 \"Неуспешно стартиране на нишка.\"\r\nt MSG_072 \"Проверката за лоши блокове не беше завършена.\"\r\nt MSG_073 \"Сканирането за ISO изображения се провали.\"\r\nt MSG_074 \"Извличането на ISO образа се провали.\"\r\nt MSG_075 \"Неуспешно монтиране на дяла.\"\r\nt MSG_076 \"Файловете за стартиране на операционната система не могат да бъдат актуализирани.\"\r\nt MSG_077 \"Не можа да се зададе буква към устройството.\"\r\nt MSG_078 \"GUID томът не може да бъде монтиран.\"\r\nt MSG_079 \"Устройството не е готово.\"\r\nt MSG_080 \"Rufus засече, че Windows все още прочиства вътрешните буфери на USB устройството.\\n\\nВ зависимост от скоростта на вашето USB устройство, тази операция може да отнеме дълго време за завършване, особено за по-големи файлове.\\n\\nПрепоръчваме ви да оставите Windows да приключи, за да избегнете увреждания. Но, ако ви омръзне да чакате, можете просто да извадите устройството...\"\r\nt MSG_081 \"Неподдържан образ\"\r\nt MSG_082 \"Този образ не е зареждащ или използва зареждащ или компресиращ метод който не се поддържа от Rufus...\"\r\nt MSG_083 \"Заместване на %s ?\"\r\nt MSG_084 \"Изглежда, че този ISO образ използва стара версия на '%s'.\\nПоради тази причина стартиращите менюта може да не бъдат изобразени правилно.\\n\\nПо-нова версия може да бъде изтеглена от Rufus, за да отстрани този проблем:\\n- Изберете 'Yes', за да се свържете с интернет и да изтеглите необходимият файл\\n- Изберете 'No', за да продължите с настоящият ISO файл\\nАко не знаете какво да правите, е препоръчително да изберете 'Yes'.\\n\\nБележка: Този файл ще бъде изтеглен в настоящата директория и щом '%s' е наличен, процесът ще продължи автоматично.\"\r\nt MSG_085 \"Изтегляне %s\"\r\nt MSG_086 \"Не е избран образ\"\r\nt MSG_087 \"за %s NAND\"\r\nt MSG_088 \"Образът е твърде голям\"\r\nt MSG_089 \"Образът е твърде голям за избраната цел.\"\r\nt MSG_090 \"Неподдържано ISO\"\r\nt MSG_091 \"Когато се използва UEFI тип на целта, само EFI стартиращи ISO образи са поддържани. Моля изберете EFI стартиращо ISO или задайте целевия тип на BIOS.\"\r\nt MSG_092 \"Неподдържана файлова система\"\r\nt MSG_093 \"ВАЖНО: ТОВА УСТРОЙСТВО СЪДЪРЖА МНОЖЕСТВО ДЯЛОВЕ!!\\n\\nТова може да включва дялове/томове, които не са показани в Windows. Ако желаете да продължите, вие носите отговорност за загубата на информация на тези дялове.\"\r\nt MSG_094 \"Засечени са множество дялове\"\r\nt MSG_095 \"DD Образ\"\r\nt MSG_096 \"Избраната файлова система не може да бъде използвана за този тип ISO. Моля, изберете друга файлова система или друг ISO образ.\"\r\nt MSG_097 \"'%s' може да се приложи само ако файловата ситема е NTFS.\"\r\nt MSG_098 \"ВАЖНО: Опитвате се да инсталирате 'Windows To Go', но вашето целево устройство не притежава атрибутът 'FIXED'. Поради това е много вероятно Winodows да замръзне по време на стартиране, тъй като Microsoft не са предвиждали продуктът им да се използва на устройства с атрибут 'REMOVABLE'. \\n\\nЖелаете ли да продължите?\\n\\nБележка: Атрибутите FIXED/REMOVABLE са хардуерни свойства който могат да бъдат променени само от специализиран софтуер на производителя. Само че този софтуер ПОЧТИ НИКОГА не е достъпен за потребителите...\"\r\nt MSG_099 \"Ограничение на файловата система\"\r\nt MSG_100 \"Този ISO образ съдържа файл по голям от 4 GB, което е повече от допустимият размер за FAT или FAT32 файлова система.\"\r\nt MSG_101 \"Липсваща WIM подръжка\"\r\nt MSG_102 \"Вашата платформа не може да извлече файлове от WIM архивите. WIM извличането е необходимо за създаване на EFI стартиращи Windows 7 и Windows Vista USB устройства. Може да поправите това като инсталирате последната версия на 7-Zip.\\nИскате ли да посетите страницата за изтегляне на 7-zip?\"\r\nt MSG_103 \"Изтегляне на %s?\"\r\nt MSG_104 \"%s или по-нов изисква '%s' файл да бъде инсталиран.\\nТъй като този файл е повече от 100 KB в размер и винаги присъства на %s ISO образи, той не е включен в Rufus.\\n\\nRufus може да изтегли липсващият файл за вас:\\n- Изберете 'Yes', за да се свържете с интернет и да изтеглите файла\\n- Изберете 'No', ако искате ръчно да копирате този файл\\n\\nБележка: Този файл ще бъде изтеглен в настоящата директория и щом '%s' е наличен, процесът ще продължи автоматично.\"\r\nt MSG_105 \"Прекратяването може да остави устройството в НЕИЗПОЛЗВАЕМО състояние.\\nАко сте сигурни, че искате да прекратите, натиснете YES. В противен случай, натиснете NO.\"\r\nt MSG_106 \"Моля изберете папка\"\r\nt MSG_107 \"Всички файлове\"\r\nt MSG_108 \"Rufus регистър\"\r\nt MSG_109 \"0x%02X (Диск %d)\"\r\nt MSG_110 \"MS-DOS не може да стартира от устройство с 64 килобайтов размер на клъстера.\\nМоля, използвайте друг размер на клъстера или използвайте FreeDOS.\"\r\nt MSG_111 \"Несъвместим размер на клъстера\"\r\nt MSG_112 \"Форматирането на големи UDF томове може да отнеме много време. При USB 2.0 скорости, изчисленото време за форматиране е %d:%02d, при което процесната лента ще изглежда като замръзнала. Моля, бъдете търпеливи!\"\r\nt MSG_113 \"Голям UDF дял\"\r\nt MSG_114 \"Този образ използва Syslinux %s%s, но тази програма включва само инсталационни файлове за Syslinux %s%s.\\n\\nТъй като новите версии на Syslinux не са съвместими една с друга и няма да е възможно Rufus да ги включи всичките, два допълнителни файла трябва да бъдат изтеглени от Интернет ('ldlinux.sys' и 'ldlinux.bss'):\\n- Изберете 'Yes', за да се свържете с интернет и да изтеглите тези файлове\\n- Изберете 'No', за да прекратите тази операция\\n\\nБележка: Тези файлове ще бъдат изтеглени в настоящата директория на програмата и ще бъдат използвани автоматично щом са налични.\"\r\nt MSG_115 \"Необходимо е изтегляне\"\r\nt MSG_116 \"Този образ използва GRUB %s Но приложението съдържа само инсталацйонните файлове за GRUB %s.\\n\\n Тъй като различните версии на GRUB може да не са съвместими една с друга и не е възможно да се включат всички, Rufus ще опита да намери версия на GRUB инсталационният файл ('core.img'), който съвпада с този от вашият образ: \\n- Изберете 'Yes', за да се свържете с интернет и да я изтеглите\\n- Изберете 'No', за да използвате версията по подразбиране на Rufus\\n- Изберете 'Cancel', за да прекратите операцията\\n\\nЗабележка: Файлът ще бъде изтеглен в настоящата директория и ще бъде използван автоматично, щом е наличен. Ако не е намерено съвпадение, ще бъде използвана версията по подразбиране.\"\r\nt MSG_117 \"Стандартна Windows инсталация\"\r\nt MSG_118 \"Windows To Go (Windows за USB Flash устройство)\"\r\nt MSG_119 \"разширени свойства на устройството\"\r\nt MSG_120 \"разширени опции за форматиране\"\r\nt MSG_121 \"Покажи %s\"\r\nt MSG_122 \"Скрий %s\"\r\nt MSG_123 \"Размер на устойчив дял\"\r\nt MSG_124 \"Без устойчивост\"\r\nt MSG_125 \"Задайте размера на устойчивия дял за \\\"живото\\\" USB устройство. Ако го зададете на 0, устойчивия дял ще бъде изключен.\"\r\nt MSG_126 \"Задайте размера на единиците на дяла.\"\r\nt MSG_127 \"Не показвай това съобщение отново\"\r\nt MSG_128 \"Важно известие относно %s\"\r\nt MSG_129 \"Създадохте носител, който използва UEFI: NTFS bootloader. Моля, не забравяйте, че за да заредите този носител, ТРЯБВА ДА ЗАБРАНИТЕ ЗАЩИТЕНОТО ЗАРЕЖДАНЕ.\\nЗа подробности относно защо това е необходимо, вижте бутона \\\"Повече информация\\\" по-долу.\"\r\nt MSG_130 \"Избор на образ на Windows\"\r\nt MSG_131 \"Този ISO съдържа няколко образа на Windows.\\nМоля, изберете образа, който искате да използвате за тази инсталация:\"\r\nt MSG_132 \"Друга програма или процес използва това устройство. Наистина ли искате да го форматирате?\"\r\nt MSG_133 \"Rufus забеляза, че се опитвате да създадете носител с \\\"Windows To Go\\\", базиран на 1809 ISO.\\n\\nПоради *MICROSOFT BUG*, този носител ще крашне при зареждане на Windows (Син екран на смъртта), ако не замените ръчно файла 'WppRecorder.sys' със същия от версия 1803.\\n\\nЗабележка: Rufus не може автоматично да поправи това, защото файлът 'WppRecorder.sys' е запазен с авторско право от Microsoft, поради което не можем да съхраняваме легално копие на този файл в програмата...\"\r\nt MSG_134 \"Тъй като за схемата за дял е избрано MBR, Rufus може да създаде дял до максимум 2 ТБ на този носител, което ще остави %s дисково пространство неизползвано.\\n\\nНаистина ли искате да продължите?\"\r\nt MSG_135 \"Версия\"\r\nt MSG_136 \"Издание\"\r\nt MSG_137 \"Издание\"\r\nt MSG_138 \"Език\"\r\nt MSG_139 \"Архитектура\"\r\nt MSG_140 \"Продължи\"\r\nt MSG_141 \"Назад\"\r\nt MSG_142 \"Моля, изчакайте...\"\r\nt MSG_143 \"Изтегляне чрез браузър\"\r\nt MSG_144 \"Изтеглянето на Windows ISO образи е недостъпно, тъй като Microsoft измени сайта си, за да го предотврати.\"\r\nt MSG_145 \"PowerShell 3.0 или по нова версия е нужна, за да се изпълни този скрипт.\"\r\nt MSG_146 \"Искате ли да се свържете с интернет и да започне изтегляне?\"\r\nt MSG_148 \"Изпълнява се скрипт за изтегляне...\"\r\nt MSG_149 \"Изтегляне на ISO образ\"\r\nt MSG_150 \"Типът компютър, с който планирате да използвате това стартиращо устройство. Ваша отговорност е да определите дали целевата ви система е от BIOS или UEFI тип преди да започнете създаването на устройството, тъй като в противен случай може да изникне грешка при стартиране.\"\r\nt MSG_151 \"'UEFI-CSM' означава, че това устройство ще се стартира само в BIOS-симулиращ режим (познат също и като 'Legacy Mode') под UEFI, и не в стандартен UEFI режим.\"\r\nt MSG_152 \"'без CSM' означава, че устройството ще се стартира само в стандартен UEFI режим, а не в BIOS режим (познат също и като 'Legacy Mode').\"\r\nt MSG_153 \"Тестов модел: 0x%02X\"\r\nt MSG_154 \"Тестов модел: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Тестов модел: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Тестов модел: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Задава целевата файлова система\"\r\nt MSG_158 \"Минималният размер, който един блок информация ще заема във файловата система\"\r\nt MSG_159 \"Използвайте това поле, за да зададете етикет на устройството.\\nИнтернационални символи са позволени.\"\r\nt MSG_160 \"Покажи/Скрий разширените настройки\"\r\nt MSG_161 \"Провери устройството за лоши блокове, използвайки тестов модел\"\r\nt MSG_162 \"Махнете тази отметка, ако искате да използвате \\\"бавен\\\" метод на форматиране\"\r\nt MSG_163 \"Метод по който ще бъдат създадени дяловете\"\r\nt MSG_164 \"Метод, който ще бъде използван, за да се направи устройството стартиращо\"\r\nt MSG_165 \"Натиснете, за да изберете или изтеглите образ...\"\r\nt MSG_166 \"Сложете тази отметка за да разрешите показването на интернационални етикети и да зададете икона на устройството (създава autorun.inf)\"\r\nt MSG_167 \"Инсталира MBR, който позволява избор на операционна система и може да маскира BIOS USB устройствения ИД\"\r\nt MSG_168 \"Опитва да маскираш първото USB устройство(обикновено 0x80) като различен диск.\\nТова би трябвало да е необходимо само ако инсталирате Windows XP и имате повече от един диск.\"\r\nt MSG_169 \"Създай допълнителен скрит дял и опитай да подредиш границите на дяловете.\\nТова може да подобри засичането на стартиращи системи при по-стари версии на BIOS.\"\r\nt MSG_170 \"Разреши изброяването на USB хард дискови заграждения. ИЗПОЛЗВАЙТЕ НА СВОЙ РИСК!!!\"\r\nt MSG_171 \"Стартиране на форматиращата операция.\\nТова ще УНИЩОЖИ всякаква информация на целта!\"\r\nt MSG_172 \"Невалиден подпис на изтеглянето\"\r\nt MSG_173 \"Натиснете тук за да изберете...\"\r\nt MSG_174 \"Rufus - Надеждната USB форматираща програма\"\r\nt MSG_175 \"Версия %d.%d (Build %d)\"\r\nt MSG_176 \"Български превод:\\\\line• Krasimir Nevenov <mailto:berzabel@yahoo.com>\\\\line• Kaloyan Nikolov <mailto:kotipuka01@gmail.com>\"\r\nt MSG_177 \"Докладвайте за проблем или поискайте подобрения на:\"\r\nt MSG_178 \"Допълнителни авторски права:\"\r\nt MSG_179 \"Политика за актуализации:\"\r\nt MSG_180 \"Ако изберете да позволите на програмата да проверява за актуализации, вие се съгласявате че следната информация може да бъде събирана на нашият сървър:\"\r\nt MSG_181 \"Архитектура и версия на вашата операционна система\"\r\nt MSG_182 \"Версия на настоящата програма която използвате\"\r\nt MSG_183 \"Вашият IP адрес\"\r\n# \"най-много за година\" is a bit hard to read in Bold. Perhaps try underlining it?\r\nt MSG_184 \"С цел създаването на частна статистика на потреблението е възможно да запазим тази информация, \\\\b най-много за година\\\\b0 . Въпреки това, ние няма да предоставяме тази информация на трети лица или организации.\"\r\nt MSG_185 \"Процес на актуализиране:\"\r\nt MSG_186 \"Rufus не инсталира и не използва скрити услуги и процеси, затова актуализиции са възможни само когато е активна програмата.\\\\line\\nЕстествено, достъп до интернет е необходим, за да може да се направи проверка за актуализиции.\"\r\nt MSG_187 \"Невалиден образ за избраната стартираща опция\"\r\nt MSG_188 \"Настоящият образ не съвпада с избраната стартиращата опция. Моля използвайте друг образ или различна стартираща опция.\"\r\nt MSG_189 \"Този ISO образ не е съвместим с избраната файлова система\"\r\nt MSG_190 \"Засечено е не съвместимо устройство\"\r\nt MSG_191 \"Пробег Записване\"\r\nt MSG_192 \"Пробег Четене\"\r\nt MSG_193 \"Изтеглено %s\"\r\nt MSG_194 \"Не можа да се изтегли %s\"\r\nt MSG_195 \"Използване на вградената версия на %s файл(ове)\"\r\nt MSG_196 \"ВАЖНО: ТОВА УСТРОЙСТВО ИЗПОЛЗВА НЕСТАНДАРТЕН РАЗМЕР НА СЕКТОРА!! \\n\\nСтандартните устройства използват 512-байтов размер на сектора но това устройство е %d-байтово. В много случаи , това означава че НЯМА да можете да заредите операционната система от това устройство.\\nRufus може да се опита да поправи това, но НЕ МОЖЕ ДА ГАРАНТИРА че ще проработи.\"\r\nt MSG_197 \"Засечен е нестандартен размер на сектора\"\r\nt MSG_198 \"'Windows To Go' може да се инсталира само на устройство с GPT дялове и с атрибут FIXED. Настоящият дял не притежава атрибутът FIXED.\"\r\nt MSG_199 \"Тази функция не е налична на тази платформа.\"\r\nt MSG_201 \"Прекратяване - Моля изчакайте...\"\r\nt MSG_202 \"Сканиране на образ...\"\r\nt MSG_203 \"Неуспешно сканиране на образ\"\r\nt MSG_204 \"Засечен е остарял %s\"\r\nt MSG_205 \"Използва се образ: %s\"\r\nt MSG_206 \"Липсващ %s файл\"\r\nt MSG_207 \"Нов дял\"\r\nt MSG_208 \"Намерено е %d устройство\"\r\nt MSG_209 \"Намерени са %d устройства\"\r\nt MSG_210 \"ГОТОВО\"\r\nt MSG_211 \"Прекратено\"\r\nt MSG_212 \"НЕУСПЕШНО\"\r\nt MSG_213 \"Стартиране на ново приложение...\"\r\nt MSG_214 \"Неуспешно стартиране на новото приложение\"\r\nt MSG_215 \"Отворен %s\"\r\nt MSG_216 \"Запазен %s\"\r\nt MSG_217 \"Форматиране: %s\"\r\nt MSG_218 \"Създаване на файлова система: Задача %d/%d завършена\"\r\nt MSG_219 \"NTFS поправка: %d%% завършена\"\r\nt MSG_220 \"Форматиране (%s) - Приблизително времетраене %d:%02d...\"\r\nt MSG_221 \"Задаване на етикет (%s)...\"\r\nt MSG_222 \"Форматиране (%s)...\"\r\nt MSG_223 \"NTFS поправка (Checkdisk)...\"\r\nt MSG_224 \"Създаване на MBR/PBR/GPT структури...\"\r\nt MSG_225 \"Поискване на дисков достъп...\"\r\nt MSG_226 \"Анализиране на съществуващите стартиращи записи...\"\r\nt MSG_227 \"Затваряне на съществуващия том...\"\r\nt MSG_228 \"Създаване на MBR...\"\r\nt MSG_229 \"Създаване на стартиращ запис на дяла...\"\r\nt MSG_230 \"Копиране на DOS файловете...\"\r\nt MSG_231 \"Копиране на ISO файловете: %s\"\r\nt MSG_232 \"Win7 EFI стартиращ план (%s)...\"\r\nt MSG_233 \"Финализиране, моля изчакайте...\"\r\nt MSG_234 \"Инсталиране на Syslinux %s...\"\r\nt MSG_235 \"Лоши блокове: %s %d/%d - %0.2f%% (%d/%d/%d грешки)\"\r\nt MSG_236 \"Лоши блокове: Тестване с произволен модел\"\r\nt MSG_237 \"Лоши блокове: Тестване с модел 0x%02X\"\r\nt MSG_238 \"Създаване на дял(ове) (%s)...\"\r\nt MSG_239 \"Изтриване на дялове (%s)...\"\r\nt MSG_240 \"Подписът на изтеглената актуализация не може да бъде удостоверен. Това може да означава, че системата ви е неправилно конфигурирана за удостоверяване на подписи или че изтеглянето е зловредно.\\n\\nИзтеглянето ще бъде изтрито. Проверете регистъра за повече детайли.\"\r\nt MSG_241 \"Изтегляне: %s\"\r\nt MSG_242 \"Неуспешно изтегляне на файл.\"\r\nt MSG_243 \"Проверка за Rufus актуализации...\"\r\nt MSG_244 \"Актуализиране: Неуспешно свързване с интернет\"\r\nt MSG_245 \"Актуализиране: Няма достъп до информация за версията\"\r\nt MSG_246 \"Налична е нова версия на Rufus!\"\r\nt MSG_247 \"Не е открита нова версия на Rufus\"\r\nt MSG_248 \"Регистрационните ключове на приложението са изтрити успешно\"\r\nt MSG_249 \"Неуспешно изтриване на регистрационните ключове на приложението\"\r\nt MSG_250 \"%s разрешено\"\r\nt MSG_251 \"%s забранено\"\r\nt MSG_252 \"Проверка на размера\"\r\nt MSG_253 \"Засичане на външен хард диск\"\r\nt MSG_254 \"Принудително голямо FAT32 форматиране\"\r\nt MSG_255 \"NoDriveTypeAutorun ще бъде изтрит на излизане\"\r\nt MSG_256 \"Засичане на фалшиви устройства\"\r\nt MSG_257 \"Joliet подръжка\"\r\nt MSG_258 \"Rock Ridge подръжка\"\r\nt MSG_259 \"Принудително актуализиране\"\r\nt MSG_260 \"NTFS компресиране\"\r\nt MSG_261 \"Записване на образ: %s\"\r\nt MSG_262 \"ISO поддръжка\"\r\nt MSG_263 \"Използване на ПРАВИЛЕН размер единици (1КБ = 1024 байта)\"\r\nt MSG_264 \"Изтриване на директория '%s'\"\r\nt MSG_265 \"Засичане на VMWare диск\"\r\nt MSG_266 \"Двоен UEFI/BIOS режим\"\r\nt MSG_267 \"Прилагане на Windows образ: %s\"\r\nt MSG_268 \"Прилагане на Windows образ...\"\r\nt MSG_269 \"Запазване на времеви маркери\"\r\nt MSG_270 \"Отстраняване на USB грешки\"\r\nt MSG_271 \"Изчисляване на чексуми на образа: %s\"\r\nt MSG_272 \"Изчисли MD5, SHA1, SHA256 чексуми на избраният образ\"\r\nt MSG_273 \"Смени езикът на приложението\"\r\nt MSG_274 \"Засечен е %s образ\"\r\nt MSG_275 \"Образът, който сте избрали е тип 'ISOHybrid'. Това означава, че може да бъде записан като режим %s (копиране на файлове) или режим %s (дисков образ).\\nRufus препоръчва режим %s, така че да разполагате с пълен достъп до устройството след записа.\\nВъпреки това, ако възникнат проблеми при зареждането, може да опитате и с режим %s.\\n\\nМоля, изберете режимът с който желаете да запишете този образ:\"\r\nt MSG_276 \"Запиши в режим %s (Препоръчителен)\"\r\nt MSG_277 \"Запиши в режим %s\"\r\nt MSG_278 \"Проверява се за конфликтуващи процеси...\"\r\nt MSG_279 \"Не стартиращ\"\r\nt MSG_280 \"Диск или ISO образ\"\r\nt MSG_281 \"%s (Моля, изберете)\"\r\nt MSG_282 \"Нестандартно заключване на USB устройство\"\r\nt MSG_283 \"Невалиден подпис\"\r\nt MSG_284 \"Изтегленото приложение е без дигитален подпис.\"\r\nt MSG_285 \"Изтегленото приложение е с подпис от '%s'.\\nТова е непознат дигитален подпис и може да е признак на злонамерена дейност...\\nСигурни ли сте че искате да стартирате тази програма?\"\r\nt MSG_286 \"Нулиране на устройството: %s\"\r\nt MSG_287 \"Засичане на преносими устройства неизползващи USB\"\r\nt MSG_288 \"Липсват повишени правомощия\"\r\nt MSG_289 \"Приложението може да работи само с повишени правомощия\"\r\nt MSG_290 \"Индексиране на файлове\"\r\nt MSG_291 \"Избор на версия\"\r\nt MSG_292 \"Моля, изберете версията на Windows, която желаете да инсталирате:\"\r\nt MSG_293 \"Неподдържана версия на Windows\"\r\nt MSG_294 \"Тази версия на Windows вече не се поддържа от Rufus.\\nПоследната версия на Rufus, съвместима с тази платформа е v%d.%d.\"\r\nt MSG_295 \"Внимание: Неофициална версия\"\r\nt MSG_296 \"Тази версия на Rufus не е създадена от официалния разработчик.\\n\\nСигурни ли сте, че желаете да я използвате?\"\r\nt MSG_297 \"Засечено е съкратено ISO\"\r\nt MSG_298 \"ISO файлът който сте избрали не съвпада с обявения си размер: %s от информацията липсва.\\n\\nАко сте се сдобили с този файл от интернет, опитайте се да изтеглите ново копие и се уверете, че чексумите на MD5 или SHA съвпадат с официалните.\\n\\nЗабележете, че можете да изчислите MD5 или SHA, използвайки Rufus като натиснете бутона (✓).\"\r\nt MSG_299 \"Грешка при удостоверяването на времевият маркер\"\r\nt MSG_300 \"Rufus не можа да удостовери, че времевият маркер на изтеглената актуализация е по-скорошен от този на сегашното приложение.\\n\\nЗа да се предотвратят потенциални възможности за атака, процесът на актуализиране беше прекратен и изтеглянето ще бъде изтрито. Моля, проверете регистъра за повече детайли.\"\r\nt MSG_301 \"Покажи настройките на приложението\"\r\nt MSG_302 \"Покажи информация за това приложение\"\r\nt MSG_303 \"Покажи регистъра\"\r\nt MSG_304 \"Създай дисков образ на избраното устройство\"\r\nt MSG_305 \"Използвайте тази опция, за да изберете дали искате да използвате това устройство, за да инсталирате Windows на друг диск, или за да създадете преносима инсталация на Windows на това устройство (Windows To Go).\"\r\nt MSG_306 \"Бързо нулиране на устройството: %s\"\r\nt MSG_307 \"Това може да отнеме време\"\r\nt MSG_308 \"Засичане на VHD\"\r\nt MSG_309 \"Компресиран архив\"\r\nt MSG_310 \"ISO-то, което сте избрали, използва UEFI и е достатъчно малко да бъде записано като EFI System Partition (ESP). Записването в ESP, вместо в обикновен дял, може да е по-подходящо за някои типове инсталации.\\n\\nМоля, изберете режимът, който искате да използвате, за да запишете този образ:\"\r\nt MSG_311 \"Използвайте %s (в основният прозорец на програмата), за да го включите.\"\r\nt MSG_312 \"Допълнителни хешове (SHA512)\"\r\nt MSG_313 \"Запазване като VHD\"\r\nt MSG_314 \"Изчисляване на чексуми на образа\"\r\nt MSG_315 \"Множество бутони\"\r\nt MSG_316 \"Брой пробези\"\r\nt MSG_317 \"ID на диск\"\r\nt MSG_318 \"Приоритет на нишката по подразбиране: %d\"\r\nt MSG_319 \"Игнорирай Boot маркер\"\r\nt MSG_320 \"Обновяване на дяловете (%s)...\"\r\nt MSG_321 \"Образът, който сте избрали, е ISOHybrid, но създателите му не са го направили съвместим с ISO/File режим на копиране.\\nЗатова ще бъде използван DD метод на записване на образа.\"\r\nt MSG_322 \"Неуспешно отваряне или прочитане на '%s'\"\r\nt MSG_325 \"Прилагане на персонализации на Windows: %s\"\r\nt MSG_326 \"Прилагане на настройки на потребителя...\"\r\nt MSG_328 \"Персонализиране на инсталацията на Windows?\"\r\nt MSG_329 \"Премахване на изискването за 4GB+ RAM, Secure Boot и TPM 2.0\"\r\nt MSG_330 \"Премахване на изискването за онлайн Microsoft акаунт\"\r\nt MSG_331 \"Изключване на събирането на данни (пропускане на въпросите за поверителност)\"\r\nt MSG_332 \"Предотврати достъпа на Windows To Go до вътрешни дискове\"\r\nt MSG_333 \"Създаване на локален акаунт с потребителско име:\"\r\nt MSG_334 \"Задаване на регионални настройки със същите стойности, като на този потребител\"\r\nt MSG_335 \"Изключване на автоматичното криптиране на устройството с BitLocker\"\r\nt MSG_336 \"Устойчив лог\"\r\nt MSG_900 \"Rufus е програма, с която можете лесно да форматирате и създавате стартиращи USB устройства, карти с памет и др.\"\r\nt MSG_901 \"Официален сайт: %s\"\r\nt MSG_902 \"Изходен код: %s\"\r\nt MSG_903 \"Лог на промените: %s\"\r\nt MSG_904 \"Тази програма е лицензирана според условията на GNU Public License (GPL) версия 3.\\nВижте https://www.gnu.org/licenses/gpl-3.0.html за подробности.\"\r\nt MSG_910 \"Форматиране на USB, карти памет и виртуални устройства с FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Създаване на FreeDOS стартиращ USB устройства\"\r\nt MSG_912 \"Създаване на стартиращи устройства от ISO образи (Windows, Linux и др.)\"\r\nt MSG_913 \"Създаване на стартиращи устройства от образи, включително компресирани такива\"\r\nt MSG_914 \"Създаване на BIOS или UEFI стартиращи устройства, включително UEFI стартиращ NTFS\"\r\nt MSG_915 \"Създаване на 'Windows To Go' устройства\"\r\nt MSG_916 \"Създаване на Windows 11 инсталационно устройство за компютри, които нямат TPM или Secure Boot\"\r\nt MSG_917 \"Създаване на устойчиви Linux дялове\"\r\nt MSG_918 \"Създаване на VHD/DD образи на избраното устройство\"\r\nt MSG_919 \"Изчисляване на MD5, SHA-1, SHA-256 и SHA-512 чексуми на избраният образ\"\r\nt MSG_920 \"Проверяване за лоши блокове, включително засичане на \\\"фалшиви\\\" устройства\"\r\nt MSG_921 \"Изтегляне на официални Microsoft Windows ISO образи\"\r\nt MSG_922 \"Изтегляне на UEFI Shell образи\"\r\n\r\n#########################################################################\r\nl \"zh-CN\" \"Chinese Simplified (简体中文)\" 0x0804, 0x1004\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"关于 Rufus\"\r\nt IDC_ABOUT_LICENSE \"许可\"\r\nt IDOK \"确定\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"设备选项\"\r\nt IDS_DEVICE_TXT \"设备\"\r\nt IDS_BOOT_SELECTION_TXT \"引导类型选择\"\r\nt IDC_SELECT \"选择\"\r\nt IDS_IMAGE_OPTION_TXT \"镜像选项\"\r\nt IDS_PARTITION_TYPE_TXT \"分区类型\"\r\nt IDS_TARGET_SYSTEM_TXT \"目标系统类型\"\r\nt IDC_LIST_USB_HDD \"显示 USB 外置硬盘\"\r\nt IDC_OLD_BIOS_FIXES \"添加对旧 BIOS 修正(额外的分区，校准等)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"启用运行时 UEFI 介质验证\"\r\nt IDS_FORMAT_OPTIONS_TXT \"格式化选项\"\r\nt IDS_FILE_SYSTEM_TXT \"文件系统\"\r\nt IDS_CLUSTER_SIZE_TXT \"簇大小\"\r\nt IDS_LABEL_TXT \"卷标\"\r\nt IDC_QUICK_FORMAT \"快速格式化\"\r\nt IDC_BAD_BLOCKS \"检查设备坏块\"\r\nt IDC_EXTENDED_LABEL \"创建扩展的标签和图标文件\"\r\nt IDS_STATUS_TXT \"状态\"\r\nt IDCANCEL \"关闭\"\r\nt IDC_START \"开始\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"关闭\"\r\nt IDD_LICENSE \"Rufus 许可\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"关闭\"\r\nt IDD_LOG \"日志\"\r\nt IDC_LOG_CLEAR \"清除\"\r\nt IDC_LOG_SAVE \"保存\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"关闭\"\r\nt IDD_NEW_VERSION \"检查更新 - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"有更新版本可用。请下载最新版本！\"\r\nt IDC_WEBSITE \"点击这里转到网站\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"发行说明\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"下载\"\r\nt IDC_DOWNLOAD \"下载\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"更多信息\"\r\nt IDYES \"是\"\r\nt IDNO \"否\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"关闭\"\r\nt IDD_UPDATE_POLICY \"更新策略和设置\"\r\nt IDS_UPDATE_SETTINGS_GRP \"设置\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"检查更新\"\r\nt IDS_INCLUDE_BETAS_TXT \"包括测试版本\"\r\nt IDC_CHECK_NOW \"立即检查\"\r\n\r\nt MSG_001 \"检测到其它进程\"\r\nt MSG_002 \"另一个 Rufus 应用程序正在运行。\\n请在运行另一个应用程序前关闭第一个程序。\"\r\nt MSG_003 \"警告：设备 '%s' 上的所有数据将会被清除。\\n要继续本操作，请点击【确定】。要退出点击【取消】。\"\r\nt MSG_004 \"Rufus 更新策略\"\r\nt MSG_005 \"你是否允许 Rufus 联网检查程序更新？\"\r\nt MSG_006 \"关闭\"\r\nt MSG_007 \"取消\"\r\nt MSG_008 \"是\"\r\nt MSG_009 \"否\"\r\nt MSG_010 \"检测到坏块\"\r\nt MSG_011 \"检查完成：找到 %d 个坏块\\n  %d 个读取错误\\n  %d 个写入错误\\n  %d 个损坏错误\"\r\nt MSG_012 \"%s\\n详细的报告位于：\\n%s\"\r\nt MSG_013 \"禁用\"\r\nt MSG_014 \"每日\"\r\nt MSG_015 \"每周\"\r\nt MSG_016 \"每月\"\r\nt MSG_017 \"自定义\"\r\nt MSG_018 \"你的版本：%d.%d (Build %d)\"\r\nt MSG_019 \"最新版本：%d.%d (Build %d)\"\r\nt MSG_020 \"字节\"\r\nt MSG_026 \"字节\"\r\nt MSG_027 \"K 字节\"\r\nt MSG_028 \"M 字节\"\r\nt MSG_029 \"默认\"\r\nt MSG_030 \"%s (默认)\"\r\nt MSG_031 \"BIOS (或 UEFI-CSM)\"\r\nt MSG_032 \"UEFI (非 CSM)\"\r\nt MSG_033 \"BIOS 或 UEFI\"\r\nt MSG_034 \"%d 遍\"\r\nt MSG_035 \"%d 遍 %s\"\r\nt MSG_036 \"ISO 镜像\"\r\nt MSG_037 \"程序\"\r\nt MSG_038 \"中止\"\r\nt MSG_039 \"启动\"\r\nt MSG_040 \"下载\"\r\nt MSG_041 \"操作被用户取消\"\r\nt MSG_042 \"错误\"\r\nt MSG_043 \"错误：%s\"\r\nt MSG_044 \"文件下载\"\r\nt MSG_045 \"USB 存储设备(通用)\"\r\nt MSG_046 \"%s (磁盘 %d) [%s]\"\r\nt MSG_047 \"多分区磁盘\"\r\nt MSG_048 \"Rufus - 刷新缓冲区\"\r\nt MSG_049 \"Rufus - 取消\"\r\nt MSG_050 \"成功。\"\r\nt MSG_051 \"未知格式化错误。\"\r\nt MSG_052 \"本介质不能使用选择的文件系统。\"\r\nt MSG_053 \"设备被拒绝访问。\"\r\nt MSG_054 \"介质被写保护。\"\r\nt MSG_055 \"设备正在被另一个使用中。请关闭可能访问设备的任意其它进程。\"\r\nt MSG_056 \"本设备不可使用快速格式化。\"\r\nt MSG_057 \"卷标无效。\"\r\nt MSG_058 \"设备句柄无效。\"\r\nt MSG_059 \"选择的簇大小对本设备来说无效。\"\r\nt MSG_060 \"卷大小无效。\"\r\nt MSG_061 \"请在驱动器中插入可移动介质。\"\r\nt MSG_062 \"接收到一个不被支持的命令。\"\r\nt MSG_063 \"内存分配错误。\"\r\nt MSG_064 \"读取错误。\"\r\nt MSG_065 \"写入错误。\"\r\nt MSG_066 \"安装失败\"\r\nt MSG_067 \"不能打开介质。可能是其他进程正在使用该设备。请重新插入设备后再试。\"\r\nt MSG_068 \"无法划分驱动器分区。\"\r\nt MSG_069 \"无法复制文件到目标驱动器。\"\r\nt MSG_070 \"用户取消操作。\"\r\nt MSG_071 \"不能创建线程。\"\r\nt MSG_072 \"坏块检查未完成。\"\r\nt MSG_073 \"ISO 镜像扫描失败。\"\r\nt MSG_074 \"ISO 镜像提取失败。\"\r\nt MSG_075 \"不能重新装载卷。\"\r\nt MSG_076 \"不能补丁/安装用于引导的文件。\"\r\nt MSG_077 \"不能指派盘符。\"\r\nt MSG_078 \"未能装载 GUID 卷。\"\r\nt MSG_079 \"设备没有准备好。\"\r\nt MSG_080 \"Rufus 检测到 Windows 仍在把它的内部缓冲区刷到 USB 设备上。\\n\\n根据你的 USB 设备的速度，此操作可能需要很长时间才能完成，尤其是大文件。\\n\\n我们建议你让 Windows 完成，避免数据损坏。但是如果你厌倦了等待的话，你可以就那样拔出设备...\"\r\nt MSG_081 \"不支持的镜像\"\r\nt MSG_082 \"本镜像是不可引导的，或者使用了不被 Rufus 所支持的引导或压缩方式...\\n本版本 Rufus 仅支持基于 bootmgr, EFI, Grub4DOS, GRUB 2, isolinux 或 WinPE 的启动 ISO 镜像。\"\r\nt MSG_083 \"替换 %s?\"\r\nt MSG_084 \"这个 ISO 镜像似乎使用一个过时的 '%s' 版本。\\n引导菜单可能因此而无法正常显示。\\n\\nRufus 可以下载更新的版本来修复这个问题：\\n- 选择【是】连接网络并下载文件\\n- 选择【否】保留现有的 ISO 文件不变\\n如果不知道如何选择，请选择【是】。\\n\\n注意：新文件将会下载到当前目录，一旦 '%s' 存在则会被自动选用。\"\r\nt MSG_085 \"下载 %s 中\"\r\nt MSG_086 \"未选择镜像\"\r\nt MSG_087 \"对 %s 闪存\"\r\nt MSG_088 \"镜像文件过大\"\r\nt MSG_089 \"镜像对于选择目标来说太大。\"\r\nt MSG_090 \"不支持的 ISO\"\r\nt MSG_091 \"当使用 UEFI 目标类型时，只支持 EFI 可引导的 ISO 镜像。\\n请选择一个 EFI 可引导的 ISO 镜像，或设置“目标类型”为 BIOS。\"\r\nt MSG_092 \"不支持的文件系统\"\r\nt MSG_093 \"警告：本盘包含多分区！\\n\\n这个可能包含在 Windows 中无法列出甚至看到的分区/卷。如果你想继续操作可能造成这些分区上的数据丢失，后果自负。\"\r\nt MSG_094 \"检测到多分区磁盘\"\r\nt MSG_095 \"DD 镜像\"\r\nt MSG_096 \"当前选择的文件系统不能配合这个类型的 ISO 使用。请选择一个不同的文件系统或者使用不同的 ISO。\"\r\nt MSG_097 \"'%s' 仅适用于 NTFS 文件系统。\"\r\nt MSG_098 \"重要事项: 你正在尝试安装 'Windows To Go'，然而你的目标盘没有 'FIXED' (固定)属性。因此，Windows 在引导时将很可能冻住，因为微软并没有针对配合拥有 'REMOVABLE' (可移动)属性的驱动器使用而设计。\\n\\n你是否仍想继续?\\n\\n注意: 'FIXED/REMOVABLE' 属性是尽可以使用来自驱动器制造商的定制工具更改的硬件性质。尽管如此，那些工具几乎永远不会公开提供...\"\r\nt MSG_099 \"文件系统限制\"\r\nt MSG_100 \"这个 ISO 镜像包含大于 4 GB 的文件，超出了 FAT/FAT32 文件系统所允许的最大尺寸。\"\r\nt MSG_101 \"缺少 WIM 支持\"\r\nt MSG_102 \"你的平台不能从 WIM 镜像提取文件。创建 EFI 可引导的 Windows 7 或 Windows Vista USB 盘需要 WIM 提取功能。你可以通过安装最新版本的 7-Zip 来解决这个问题。\\n你是否想访问 7-Zip 下载网页？\"\r\nt MSG_103 \"下载 %s 吗？\"\r\nt MSG_104 \"%s 或更新版本需要同时安装一个 '%s' 文件。\\n由于这个文件尺寸大于 100 KB 且总是存在于 %s ISO 镜像上，而未内置于 Rufus 中。\\n\\nRufus 可以为你下载缺少的文件：\\n- 选择【是】则连接网络互联网并下载文件\\n- 选择【否】则你自己稍后自行下载到磁盘\\n\\n注意：文件将会在当前目录中下载，一旦 '%s' 文件存在，则它将会被自动选用。\"\r\nt MSG_105 \"现在取消可能导致设备处于不稳定状态。\\n如果你确定你想取消，请点击【是】。否则点击【否】。\"\r\nt MSG_106 \"请选择文件夹\"\r\nt MSG_107 \"全部文件\"\r\nt MSG_108 \"Rufus 日志\"\r\nt MSG_109 \"0x%02X (磁盘 %d)\"\r\nt MSG_110 \"MS-DOS 无法从 64 KB 簇大小磁盘启动。\\n请更改簇大小或改用 FreeDOS。\"\r\nt MSG_111 \"不兼容的簇大小\"\r\nt MSG_112 \"格式化一个大 UDF 卷可能需要很长时间。以 USB 2.0 速度预计剩余时间：%d:%02d，在此期间进度条可能会呈禁止状态。请耐心等待！\"\r\nt MSG_113 \"大容量 UDF 卷\"\r\nt MSG_114 \"这个镜像使用 Syslinux %s%s，而本程序仅包含 Syslinux %s%s 的安装文件。\\n\\n由于新版本的 Syslinux 和其它版本的不能兼容，而 Rufus 也不可能包括它们全部，需要从互联网下载两个额外的文件('ldlinux.sys' 和 'ldlinux.bss'):\\n- 选择 '是' 连接网络并下载这些文件\\n- 选择 '否' 取消此项操作\\n\\n注意：文件将会被下载到当前应用程序目录，如果存在则会自动选用。\"\r\nt MSG_115 \"需要下载\"\r\nt MSG_116 \"本镜像使用 Grub %s 而应用程序只包含 Grub %s 的安装文件。\\n\\n由于不同版本的 Grub 彼此不能兼容，而且不可能包含它们全部，Rufus 将尝试定位一个匹配来自你的镜像的 Grub 版本的 Grub 安装文件('core.img'):\\n- 选择【是】则连接到互联网并尝试下载它\\n- 选择【否】则使用来自 Rufus 的默认版本\\n- 选择【取消】则放弃操作\\n\\n注意: 文件将会在当前应用程序目录下载，而如果存在的话则将会自动使用它。如果在线找不到匹配的，那么将会使用默认的版本。\"\r\nt MSG_117 \"标准 Windows 安装\"\r\nt MSG_119 \"高级设备选项\"\r\nt MSG_120 \"高级格式化选项\"\r\nt MSG_121 \"显示%s\"\r\nt MSG_122 \"隐藏%s\"\r\nt MSG_123 \"持久分区大小\"\r\nt MSG_124 \"无持久分区\"\r\nt MSG_125 \"设置Live USB驱动器的持久分区大小。设置为零将禁用持久分区。\"\r\nt MSG_126 \"设置分区大小单位。\"\r\nt MSG_127 \"不再显示此消息\"\r\nt MSG_128 \"关于 %s 的重要提示\"\r\nt MSG_129 \"您刚刚创建了使用 UEFI:NTFS 引导方式的驱动器。请注意您必须禁用安全启动(Secure Boot)以从此驱动器启动。\\n欲了解详情，请点击下方的'更多信息'按钮。\"\r\nt MSG_130 \"Windows 镜像选择\"\r\nt MSG_131 \"本 ISO 文件包含多个 Windows 镜像。\\n请选择要使用的镜像：\"\r\nt MSG_132 \"另一程序正在使用此驱动器。您仍然要格式化它吗？\"\r\nt MSG_133 \"Rufus 检测到您正在使用 1809 版本的 ISO 文件创建 Windows To Go 驱动器。\\n\\n由于微软的程序故障，本驱动器启动 Windows 时将出现蓝屏崩溃，除非您手动将 'WppRecorder.sys' 文件替换为 1803 镜像中的版本。\\n\\n由于 'WppRecorder.sys' 是微软的版权文件，Rufus 无法包含此文件来自动为您修复此问题。\"\r\nt MSG_134 \"由于选择了 MBR 分区方式，在此驱动器上 Rufus 只能创建不大于 2 TB 的分区，这会导致 %s 的大小无法使用。 \\n\\n您确定要继续吗？\"\r\nt MSG_135 \"版本\"\r\nt MSG_136 \"发行\"\r\nt MSG_137 \"类型\"\r\nt MSG_138 \"语言\"\r\nt MSG_139 \"处理器架构\"\r\nt MSG_140 \"继续\"\r\nt MSG_141 \"返回\"\r\nt MSG_142 \"请稍等...\"\r\nt MSG_143 \"使用浏览器下载\"\r\nt MSG_144 \"由于短时间内下载过多，已被微软临时封禁。请稍后再试。\"\r\nt MSG_145 \"此脚本依赖于 PowerShell 3.0 或更新版本。\"\r\nt MSG_146 \"您想要下载它吗？\"\r\nt MSG_148 \"正在运行下载脚本...\"\r\nt MSG_149 \"下载 ISO 镜像\"\r\nt MSG_150 \"请选择您计算机支持的启动类型，如 BIOS 或 UEFI，否则启动可能会失败。\"\r\nt MSG_151 \"'UEFI-CSM' 指设备只会在 UEFI 系统的经典模式(Legacy Mode)下启动，不会在原生模式(UEFI Mode)下启动。\"\r\nt MSG_152 \"'非 CSM' 指设备只会在 UEFI 系统的原生模式(UEFI Mode)下启动，不会在经典模式(Legacy Mode)下启动。\"\r\nt MSG_153 \"测试模式：0x%02X\"\r\nt MSG_154 \"测试模式：0x%02X, 0x%02X\"\r\nt MSG_155 \"测试模式：0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"测试模式：0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"设置目标文件系统\"\r\nt MSG_158 \"文件系统的数据块最少占用大小\"\r\nt MSG_159 \"使用本框以设置驱动器卷标。\\n支持国际字符。\"\r\nt MSG_160 \"切换高级选项\"\r\nt MSG_161 \"使用测试模式检查设备坏块\"\r\nt MSG_162 \"取消本复选框使用\\\"慢速\\\"完全格式化方式\"\r\nt MSG_163 \"用于创建分区的方法\"\r\nt MSG_164 \"用于使驱动器可引导的方法\"\r\nt MSG_165 \"点击以选择或下载镜像...\"\r\nt MSG_166 \"勾选本框允许国际卷标的显示并设置一个设备图标(创建一个 autorun.inf)\"\r\nt MSG_167 \"安装 UEFI 引导加载器，该加载器将对介质进行 MD5 校验\"\r\nt MSG_169 \"创建一个额外的隐藏分区并尝试对齐分区分界。\\n这个可提高旧 BIOS 的引导检测率。\"\r\nt MSG_170 \"启用涵盖 USB 硬盘的显示\\n***请谨慎使用，后果自负！***\"\r\nt MSG_171 \"开始格式化操作。\\n这将会清除目标设备上的任何数据！\"\r\nt MSG_172 \"下载文件签名校验失败\"\r\nt MSG_173 \"点击选择...\"\r\nt MSG_174 \"Rufus - 可靠的 USB 格式化工具\"\r\nt MSG_175 \"版本 %d.%d (Build %d)\"\r\nt MSG_176 \"简体中文翻译者：佚名、HRxiaohu、就不告诉你\"\r\nt MSG_177 \"报告错误或请求新功能：\"\r\nt MSG_178 \"更多版权信息：\"\r\nt MSG_179 \"更新策略：\"\r\nt MSG_180 \"如果你选择允许本程序检查应用程序更新，那么表示您同意被我们的服务器收集以下信息：\"\r\nt MSG_181 \"你的操作系统的架构和版本\"\r\nt MSG_182 \"你使用的应用程序的版本\"\r\nt MSG_183 \"您的 IP 地址\"\r\nt MSG_184 \"为了生成专用的使用情况统计，所收集的资料\\\\b最多保存一年\\\\b0。绝不会主动将资料提供给第三方。\"\r\nt MSG_185 \"更新进程：\"\r\nt MSG_186 \"Rufus 没有安装或运行后台服务，因此更新检查仅在主程序运行时进行。\\\\line\\n当然检查更新时需要网络连接。\"\r\nt MSG_187 \"镜像对选择的引导选项无效\"\r\nt MSG_188 \"当前镜像不匹配选择的引导选项。请使用不同的镜像或选择不同的引导选项。\"\r\nt MSG_189 \"这个 ISO 镜像不兼容选择的文件系统\"\r\nt MSG_190 \"检测到不兼容的驱动器\"\r\nt MSG_191 \"写入次数\"\r\nt MSG_192 \"读取次数\"\r\nt MSG_193 \"已下载 %s\"\r\nt MSG_194 \"不能下载 %s\"\r\nt MSG_195 \"使用 %s 文件的嵌入版本\"\r\nt MSG_196 \"重要事项: 本驱动器使用了非标准的扇区大小!\\n\\n传统的驱动器使用 512 字节扇区大小而本驱动器使用 %d 字节的扇区。在许多情况下，这意味着你将不可以从本驱动器引导。\\nRufus 可以尝试创建一个可引导驱动器，但是不保证它有效。\"\r\nt MSG_197 \"检测到非标准扇区大小\"\r\nt MSG_198 \"'Windows To Go' 只可以在一个 GPT 分区的拥有 FIXED 属性设置的驱动器上安装当前驱动器没有被检测为 FIXED(固定盘)。\"\r\nt MSG_199 \"此功能在此平台上不可用。\"\r\nt MSG_201 \"取消中 - 请稍候...\"\r\nt MSG_202 \"正在扫描镜像...\"\r\nt MSG_203 \"未能扫描镜像\"\r\nt MSG_204 \"检测到过时的 %s\"\r\nt MSG_205 \"正在使用镜像：%s\"\r\nt MSG_206 \"缺少 %s 文件\"\r\nt MSG_207 \"新加卷\"\r\nt MSG_208 \"检测到 %d 个设备\"\r\nt MSG_209 \"检测到 %d 个设备\"\r\nt MSG_210 \"准备就绪\"\r\nt MSG_211 \"已取消\"\r\nt MSG_212 \"操作失败\"\r\nt MSG_213 \"正在启动新程序...\"\r\nt MSG_214 \"未能启动新程序\"\r\nt MSG_215 \"已打开 %s\"\r\nt MSG_216 \"已保存 %s\"\r\nt MSG_217 \"正在格式化: %s\"\r\nt MSG_218 \"正在创建文件系统：已完成 %d/%d 项任务\"\r\nt MSG_219 \"修复 NTFS：已完成 %d%%\"\r\nt MSG_220 \"正在格式化 (%s) - 估计剩余时间 %d:%02d...\"\r\nt MSG_221 \"正在设置卷标 (%s)...\"\r\nt MSG_222 \"正在格式化 (%s)...\"\r\nt MSG_223 \"修复 NTFS (Checkdisk)...\"\r\nt MSG_224 \"正在清除 MBR/PBR/GPT 架构...\"\r\nt MSG_225 \"正在请求磁盘访问...\"\r\nt MSG_226 \"正在分析现有引导记录...\"\r\nt MSG_227 \"正在关闭现有卷...\"\r\nt MSG_228 \"正在写入主引导记录...\"\r\nt MSG_229 \"正在写入分区引导记录...\"\r\nt MSG_230 \"正在复制 DOS 文件...\"\r\nt MSG_231 \"正在复制 ISO 文件: %s\"\r\nt MSG_232 \"正在安装 Win7 EFI 引导 (%s)...\"\r\nt MSG_233 \"完成中，请稍候...\"\r\nt MSG_234 \"正在安装 Syslinux %s...\"\r\nt MSG_235 \"检查坏块：%s 第 %d/%d 遍 - %0.2f%% (%d/%d/%d 错误)\"\r\nt MSG_236 \"检查坏块：正在使用随机模式测试\"\r\nt MSG_237 \"检查坏块：正在使用模式 0x%02X 测试\"\r\nt MSG_238 \"正在分区 (%s)...\"\r\nt MSG_239 \"正在删除分区 (%s)...\"\r\nt MSG_240 \"下载的更新签名校验失败，这表明您的系统配置异常或收到恶意攻击。\\n\\n下载文件已被删除。详细信息请查看日志。\"\r\nt MSG_241 \"正在下载: %s\"\r\nt MSG_242 \"未能下载文件。\"\r\nt MSG_243 \"正在检查 Rufus 更新...\"\r\nt MSG_244 \"更新：无法连接到网络\"\r\nt MSG_245 \"更新：无法访问版本数据\"\r\nt MSG_246 \"检查到可用的新版本 Rufus！\"\r\nt MSG_247 \"找不到新版本的 Rufus\"\r\nt MSG_248 \"已成功删除程序注册表键\"\r\nt MSG_249 \"未能删除程序注册表键\"\r\nt MSG_250 \"%s 已启用\"\r\nt MSG_251 \"%s 已禁用\"\r\nt MSG_252 \"大小检查\"\r\nt MSG_253 \"硬盘检测\"\r\nt MSG_254 \"强制大 FAT32 格式化\"\r\nt MSG_255 \"在退出时将会删除 NoDriveTypeAutorun 注册表键\"\r\nt MSG_256 \"检测扩容盘\"\r\nt MSG_257 \"Joliet 支持\"\r\nt MSG_258 \"Rock Ridge 支持\"\r\nt MSG_259 \"强制更新\"\r\nt MSG_260 \"NTFS 压缩\"\r\nt MSG_261 \"正在写入镜像: %s\"\r\nt MSG_262 \"ISO 镜像支持\"\r\nt MSG_263 \"使用恰当的大小单位\"\r\nt MSG_264 \"正在删除目录 '%s'\"\r\nt MSG_265 \"VMWare 磁盘检测\"\r\nt MSG_266 \"双 UEFI/BIOS 模式\"\r\nt MSG_267 \"正在应用 Windows 镜像: %s\"\r\nt MSG_268 \"正在应用 Windows 镜像...\"\r\nt MSG_269 \"保留时间标记\"\r\nt MSG_270 \"USB 调试\"\r\nt MSG_271 \"正在计算镜像校验和: %s\"\r\nt MSG_272 \"计算所选镜像的 MD5, SHA1 和 SHA256 的校验和\"\r\nt MSG_273 \"语言\"\r\nt MSG_274 \"检测到 %s 镜像\"\r\nt MSG_275 \"您选择的镜像是一个 'ISOHybrid' (混合式)镜像。这意味着它可以以%s (文件复制) 模式或 %s (磁盘) 镜像模式写入。\\nRufus 推荐使用 %s 模式，以便您在写入它之后总是可以对驱动器有完全的访问权。\\n尽管如此，如果您在引导时遇到问题，您可以尝试以 %s 模式再次写入这个镜像。\\n\\n请选择您想用于写入这个镜像所使用的模式:\"\r\nt MSG_276 \"以 %s 模式写入(推荐)\"\r\nt MSG_277 \"以 %s 模式写入\"\r\nt MSG_278 \"检测冲突进程中...\"\r\nt MSG_279 \"非可引导\"\r\nt MSG_280 \"镜像文件\"\r\nt MSG_281 \"%s (请选择)\"\r\nt MSG_282 \"独占 USB 驱动器锁定\"\r\nt MSG_283 \"无效签名\"\r\nt MSG_284 \"已下载的可执行文件缺少一个数字签名。\"\r\nt MSG_285 \"已下载的可执行文件是由 '%s' 签署的。\\n这个不是我们能够识别的签名，而且这个可能意味着某种形式的恶意活动...\\n您是否确认您想运行这个文件?\"\r\nt MSG_286 \"正在清空磁盘: %s\"\r\nt MSG_287 \"检测非USB的可移除设备\"\r\nt MSG_288 \"缺少管理员权限\"\r\nt MSG_289 \"此程序只能以管理员权限执行\"\r\nt MSG_290 \"文件索引\"\r\nt MSG_291 \"版本选择\"\r\nt MSG_292 \"请选择你要安装的 Windows 版本:\"\r\nt MSG_293 \"不支持的 Windows 版本\"\r\nt MSG_294 \"Rufus 已不再支持此 Windows 版本。\\n最后一个与此平台兼容的 Rufus 版本为 v%d.%d。\"\r\nt MSG_295 \"警告：非官方版本\"\r\nt MSG_296 \"此版本的 Rufus 不是由官方开发者发布的。\\n\\n您确定要运行它吗？\"\r\nt MSG_297 \"检测到不完整镜像\"\r\nt MSG_298 \"您选择的镜像文件大小与其期望大小不符： %s 数据缺失！\\n\\n如果此镜像文件下载自互联网，请重新下载并校验其 MD5 或 SHA 校验和。\\n\\n您可在 Rufus 中点击 (✓) 键来计算 MD5 或 SHA 校验和。\"\r\nt MSG_299 \"时间戳校验错误\"\r\nt MSG_300 \"Rufus 下载的更新比当前程序更旧。\\n\\n为避免可能的攻击，更新已被阻止，下载的更新文件已被删除。如需了解更多，请查看软件日志。\"\r\nt MSG_301 \"设置\"\r\nt MSG_302 \"关于\"\r\nt MSG_303 \"日志\"\r\nt MSG_304 \"创建所选设备的镜像\"\r\nt MSG_305 \"请选择您希望将 Windows 安装至其他驱动器，还是直接从此驱动器运行(即 Windows To Go)。\"\r\nt MSG_306 \"正在快速清空磁盘: %s\"\r\nt MSG_307 \"这可能需要一段时间\"\r\nt MSG_308 \"虚拟硬盘驱动器(VHD)探测\"\r\nt MSG_309 \"压缩文件\"\r\nt MSG_310 \"您选择的 ISO 文件使用了 UEFI 并且足够小，可被写入至 EFI 系统分区(ESP)。写入至 ESP 在某些情况下更好，但会覆写磁盘的全部内容（写入至一般数据分区不会）。\\n\\n请选择此镜像文件的写入方式:\"\r\nt MSG_311 \"在应用程序主窗口中按下 %s 以激活。\"\r\nt MSG_312 \"可选哈希校验和 SHA512\"\r\nt MSG_313 \"保存至虚拟硬盘驱动器(VHD)\"\r\nt MSG_314 \"计算镜像校验和\"\r\nt MSG_315 \"多个按钮\"\r\nt MSG_316 \"检查次数\"\r\nt MSG_317 \"磁盘 ID\"\r\nt MSG_318 \"默认线程优先级: %d\"\r\nt MSG_319 \"忽视启动标记(Boot Marker)\"\r\nt MSG_320 \"刷新分区布局 (%s)...\"\r\nt MSG_321 \"您选择了一个 ISOHybrid 镜像文件，但此文件与 ISO/File 复制模式不兼容。\\n因此强制使用DD镜像写入模式。\"\r\nt MSG_322 \"无法打开或读取 '%s'\"\r\nt MSG_325 \"正在应用 Windows 设置: %s\"\r\nt MSG_326 \"正在应用用户设置...\"\r\nt MSG_327 \"Windows 用户体验\"\r\nt MSG_328 \"自定义 Windows 安装？\"\r\nt MSG_329 \"移除对 4GB+ 内存、安全引导和 TPM 2.0 的要求\"\r\nt MSG_330 \"移除对登录微软账户的要求\"\r\nt MSG_331 \"禁止数据收集 (跳过隐私设置)\"\r\nt MSG_332 \"阻止 Windows To Go 访问内部磁盘\"\r\nt MSG_333 \"创建一个使用此用户名的本地账号:\"\r\nt MSG_334 \"使用当前用户的区域设置\"\r\nt MSG_335 \"禁用 BitLocker 自动设备加密\"\r\nt MSG_336 \"持久化日志\"\r\nt MSG_337 \"必须从 Microsoft 下载附加文件（“%s”）才能使用此功能：\\n- 选择 '是' 连接网络并下载这些文件\\n- 选择 '否' 取消此项操作\\n\\n注意：文件将会被下载到当前应用程序目录，如果存在则会自动选用。\"\r\nt MSG_338 \"检测到被吊销的 UEFI 引导加载器\"\r\nt MSG_339 \"Rufus 检测到您选择的 ISO 包含一个已被吊销的 UEFI 引导加载器，当在最新的 UEFI 系统上启用安全启动时，将产生%s。\\n\\n- 如果您从非可信来源获取此 ISO 镜像，则应考虑其中可能包含 UEFI 恶意软件，应当避免启动此镜像。\\n- 如果是从可信来源获取的，则应尝试查找不会产生此警告的最新版本。\"\r\nt MSG_340 \"一个“安全违规”界面\"\r\nt MSG_341 \"一个包含 '%s' 的蓝屏界面\"\r\nt MSG_342 \"压缩的 VHDX 镜像\"\r\nt MSG_343 \"未压缩的 VHD 镜像\"\r\nt MSG_344 \"完整闪存更新镜像\"\r\nt MSG_345 \"使用此功能需要从微软下载一些额外数据:\\n- 选择 '是' 连接网络并下载这些文件\\n- 选择 '否' 取消此项操作\"\r\nt MSG_346 \"将 Windows 限制为 S 模式（与绕过在线账户功能不兼容）\"\r\nt MSG_347 \"专家模式\"\r\nt MSG_348 \"正在解压文件: %s\"\r\nt MSG_349 \"使用 Rufus MBR\"\r\nt MSG_900 \"Rufus 是一个帮助您格式化并创建可启动 USB 驱动器（如 U 盘和存储卡）的工具。\"\r\nt MSG_901 \"官方网站: %s\"\r\nt MSG_902 \"源代码: %s\"\r\nt MSG_903 \"更新日志: %s\"\r\nt MSG_904 \"本应用采用 GNU 通用公共许可证 (GPL) 第三版。\\n具体许可证见 https://www.gnu.org/licenses/gpl-3.0.zh-cn.html。\"\r\nt MSG_905 \"启动\"\r\nt MSG_910 \"将 U 盘、存储卡或虚拟驱动器格式化为 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式\"\r\nt MSG_911 \"创建 FreeDOS 可启动驱动器\"\r\nt MSG_912 \"从可启动 ISO 文件 (Windows 和 Linux 等) 创建可启动驱动器\"\r\nt MSG_913 \"从可启动硬盘镜像 (包括压缩镜像) 创建可启动驱动器\"\r\nt MSG_914 \"创建 BIOS 或 UEFI 可启动驱动器，包括 UEFI 可启动的 NTFS 驱动器\"\r\nt MSG_915 \"创建 'Windows To Go' 驱动器\"\r\nt MSG_916 \"为没有 TPM 或安全启动功能的电脑创建 Windows 11 安装驱动器\"\r\nt MSG_917 \"创建持久 Linux 分区\"\r\nt MSG_918 \"为选择的驱动器创建 VHD/DD 镜像\"\r\nt MSG_919 \"计算被选择镜像的 MD5、SHA-1、SHA-256 和 SHA-512 校验码\"\r\nt MSG_920 \"执行坏块检查，包括对”假“U盘的检测\"\r\nt MSG_921 \"下载微软官方 Windows 镜像\"\r\nt MSG_922 \"下载 UEFI Shell 镜像\"\r\n\r\n#########################################################################\r\nl \"zh-TW\" \"Chinese Traditional (正體中文)\" 0x0404, 0x0c04, 0x1404, 0x7c04\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"關於 Rufus\"\r\nt IDC_ABOUT_LICENSE \"授權合約\"\r\nt IDOK \"關閉\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"裝置內容\"\r\nt IDS_DEVICE_TXT \"裝置\"\r\nt IDS_BOOT_SELECTION_TXT \"開機模式\"\r\nt IDC_SELECT \"選擇\"\r\nt IDS_IMAGE_OPTION_TXT \"映像檔選項\"\r\nt IDS_PARTITION_TYPE_TXT \"資料分割配置\"\r\nt IDS_TARGET_SYSTEM_TXT \"目標系統\"\r\nt IDC_LIST_USB_HDD \"顯示 USB 外接硬碟\"\r\nt IDC_OLD_BIOS_FIXES \"相容性模式\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"啟用執行階段 UEFI 媒體驗證\"\r\nt IDS_FORMAT_OPTIONS_TXT \"選項\"\r\nt IDS_FILE_SYSTEM_TXT \"檔案系統\"\r\nt IDS_CLUSTER_SIZE_TXT \"配置單元大小\"\r\nt IDS_LABEL_TXT \"磁碟區標籤\"\r\nt IDC_QUICK_FORMAT \"快速格式化\"\r\nt IDC_BAD_BLOCKS \"檢查裝置毀損區塊\"\r\nt IDC_EXTENDED_LABEL \"建立延伸標籤及圖示\"\r\nt IDS_STATUS_TXT \"狀態\"\r\nt IDCANCEL \"離開\"\r\nt IDC_START \"執行\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"離開\"\r\nt IDD_LICENSE \"Rufus 授權合約\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"離開\"\r\nt IDD_LOG \"記錄檔\"\r\nt IDC_LOG_CLEAR \"清除\"\r\nt IDC_LOG_SAVE \"儲存\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"離開\"\r\nt IDD_NEW_VERSION \"線上更新 - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"找到更新版本，請下載更新!\"\r\nt IDC_WEBSITE \"前往官方網頁下載 (點選會開啟瀏覽器)\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"版本說明\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"下載\"\r\nt IDC_DOWNLOAD \"下載\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"進階說明\"\r\nt IDYES \"是\"\r\nt IDNO \"否\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"離開\"\r\nt IDD_UPDATE_POLICY \"版本更新\"\r\nt IDS_UPDATE_SETTINGS_GRP \"設定\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"自動檢查更新\"\r\nt IDS_INCLUDE_BETAS_TXT \"包含測試版本\"\r\nt IDC_CHECK_NOW \"立即檢查\"\r\n\r\nt MSG_001 \"偵測到其他程序\"\r\nt MSG_002 \"已有其他 Rufus 程序在執行中。\\n請先關閉執行中的程序。\"\r\nt MSG_003 \"警告: 此動作將完全清除此裝置上的資料: '%s'\\n請再次確認是否繼續。\"\r\nt MSG_004 \"Rufus 線上更新規則\"\r\nt MSG_005 \"是否啟用自動線上檢查更新?\"\r\nt MSG_006 \"離開\"\r\nt MSG_007 \"取消\"\r\nt MSG_008 \"是\"\r\nt MSG_009 \"否\"\r\nt MSG_010 \"偵測到損毀磁區\"\r\nt MSG_011 \"掃描結果: %d 個異常\\n  %d 讀取錯誤\\n  %d 寫入錯誤\\n  %d 損毀錯誤\"\r\nt MSG_012 \"%s\\n詳細報告位於:\\n%s\"\r\nt MSG_013 \"停用\"\r\nt MSG_014 \"每天\"\r\nt MSG_015 \"每週\"\r\nt MSG_016 \"每月\"\r\nt MSG_017 \"自訂\"\r\nt MSG_018 \"目前版本: %d.%d (Build %d)\"\r\nt MSG_019 \"最新版本: %d.%d (Build %d)\"\r\nt MSG_020 \"位元組\"\r\nt MSG_026 \"位元組\"\r\nt MSG_027 \"KB\"\r\nt MSG_028 \"MB\"\r\nt MSG_029 \"預設\"\r\nt MSG_030 \"%s (預設)\"\r\nt MSG_031 \"BIOS (或 UEFI-CSM)\"\r\nt MSG_032 \"UEFI (無 CSM)\"\r\nt MSG_033 \"BIOS 或 UEFI\"\r\nt MSG_034 \"%d 回\"\r\nt MSG_035 \"%d 回 %s\"\r\nt MSG_036 \"ISO 映像\"\r\nt MSG_037 \"程式\"\r\nt MSG_038 \"終止\"\r\nt MSG_039 \"執行\"\r\nt MSG_040 \"下載\"\r\nt MSG_041 \"作業被使用者中斷\"\r\nt MSG_042 \"錯誤\"\r\nt MSG_043 \"錯誤: %s\"\r\nt MSG_044 \"檔案下載\"\r\nt MSG_045 \"USB 儲存裝置\"\r\nt MSG_046 \"%s (磁碟 %d) [%s]\"\r\nt MSG_047 \"多個磁碟分割區\"\r\nt MSG_048 \"Rufus - 正在清空緩衝區\"\r\nt MSG_049 \"Rufus - 取消\"\r\nt MSG_050 \"完成。\"\r\nt MSG_051 \"格式化時發生不明錯誤。\"\r\nt MSG_052 \"此裝置無法使用選取之檔案系統。\"\r\nt MSG_053 \"裝置存取遭拒。\"\r\nt MSG_054 \"裝置唯讀模式無法寫入。\"\r\nt MSG_055 \"偵測到其他程序使用裝置。請先關閉正在存取裝置的程序。\"\r\nt MSG_056 \"此裝置不支援快速格式化。\"\r\nt MSG_057 \"磁碟區標籤輸入錯誤。\"\r\nt MSG_058 \"裝置控制代碼錯誤。\"\r\nt MSG_059 \"此裝置不支援選取之配置單元大小。\"\r\nt MSG_060 \"磁碟區大小錯誤。\"\r\nt MSG_061 \"請插入可卸除式裝置。\"\r\nt MSG_062 \"接收到不支援的指令。\"\r\nt MSG_063 \"記憶體配置錯誤。\"\r\nt MSG_064 \"讀取錯誤。\"\r\nt MSG_065 \"寫入錯誤。\"\r\nt MSG_066 \"安裝失敗\"\r\nt MSG_067 \"無法開啟裝置，可能被其他程序占用。請重新插拔一次試試。\"\r\nt MSG_068 \"無法分割磁碟。\"\r\nt MSG_069 \"無法複製檔案到目標磁碟。\"\r\nt MSG_070 \"工作遭使用者中斷。\"\r\nt MSG_071 \"無法啟動執行緒。\"\r\nt MSG_072 \"損毀磁區檢查工作未完成。\"\r\nt MSG_073 \"掃描 ISO 映像檔失敗。\"\r\nt MSG_074 \"解壓縮 ISO 映像檔失敗。\"\r\nt MSG_075 \"無法重新裝載磁碟區。\"\r\nt MSG_076 \"無法設置開機檔案。\"\r\nt MSG_077 \"無法指定磁碟機代號。\"\r\nt MSG_078 \"無法裝載 GUID 磁碟區。\"\r\nt MSG_079 \"裝置尚未就緒。\"\r\nt MSG_080 \"Rufus 偵測到 Windows 正在排清緩衝區至 USB 裝置。\\n\\n此作業可能需要一段時間才完成，視裝置速度及檔案大小而定。\\n\\n我們建議耐心等候操作完成，以免發生資料損毀。但如果不願意等待，可以直接移除裝置...\"\r\nt MSG_081 \"不支援的映像檔\"\r\nt MSG_082 \"此映像檔無法開機，或是使用 Rufus 不支援的開機、壓縮方式...\"\r\nt MSG_083 \"取代 %s?\"\r\nt MSG_084 \"此 ISO 映像檔似乎使用過時版本的 '%s'。\\n開機選單可能因此無法正常運作。\\n\\nRufus 可下載新版本來修正問題:\\n- 選 '是' 將連線到網路並下載檔案\\n- 選 '否' 保留原始 ISO 內容\\n如果你不知道該如何抉擇，建議選擇 '是'。\\n\\n注意: 檔案會下載至目前資料夾，如果已存在 '%s' 檔案將直接使用。\"\r\nt MSG_085 \"下載中 %s\"\r\nt MSG_086 \"未選取任何映像檔\"\r\nt MSG_087 \"給 %s NAND\"\r\nt MSG_088 \"映像檔之檔案大小過大\"\r\nt MSG_089 \"此映像檔超過裝置大小。\"\r\nt MSG_090 \"不支援的 ISO 映像檔\"\r\nt MSG_091 \"當選擇 UEFI 目標類型時，僅支援 EFI 開機的 ISO 映像檔。請選取可 EFI 開機的 ISO 檔案，或將目標類型改為 BIOS。\"\r\nt MSG_092 \"不支援的檔案系統\"\r\nt MSG_093 \"重要: 此裝置具有多重磁碟分割配置!!\\n\\n可能包含 Windows 無法辨識或無法顯示的磁碟分割。請確認是否繼續執行，所造成任何磁碟分割資料遺失請自行負責。\"\r\nt MSG_094 \"偵測到多重磁碟分割\"\r\nt MSG_095 \"DD 映像\"\r\nt MSG_096 \"目前選取的檔案系統不適用此 ISO 映像檔，請選取其他檔案系統或更換其他 ISO 映像檔。\"\r\nt MSG_097 \"'%s' 僅適用於 NTFS 檔案系統。\"\r\nt MSG_098 \"重要: 您正嘗試安裝 'Windows To Go' 於沒有 '固定' 屬性的裝置上，可能無法正常開機。微軟不允許安裝在 '可卸除' 的裝置上。\\n\\n請確認是否仍繼續執行?\\n\\n注意: '固定/可卸除' 屬性只能透過硬體製造商的工具設定，似乎未曾開放給大眾使用...\"\r\nt MSG_099 \"檔案系統限制\"\r\nt MSG_100 \"此 ISO 映像檔內含大一個大於 4 GB 的檔案，遠超出 FAT 或 FAT32 檔案系統可支援的上限。\"\r\nt MSG_101 \"缺少 WIM 支援\"\r\nt MSG_102 \"目前系統環境不支援解壓縮 WIM 檔案，此功能為製作 EFI Win7/Vista 開機片之要件。此問題可利用 7-Zip (免費的開放軟體) 解決，是否要立即前往 7-Zip 網站下載?\"\r\nt MSG_103 \"是否下載 %s?\"\r\nt MSG_104 \"%s 或更新版本需要同時安裝 '%s' 檔案方可支援。\\n由於這個檔案大於 100KB 且已包含在每一版 %s ISO 映像檔中，故 Rufus 未預載。\\n\\nRufus 可自動下載:\\n- 選擇 '是' 將連上網並下載檔案\\n- 選擇 '否' 若您要自行複製檔案到裝置\\n\\n注意: 檔案會下載至目前資料夾，如果已存在 '%s' 檔案將直接使用。\"\r\nt MSG_105 \"現在取消可能導致裝置異常。\\n如果你確定要取消，點選 是。反之，點選 否。\"\r\nt MSG_106 \"請選擇資料夾\"\r\nt MSG_107 \"所有檔案\"\r\nt MSG_108 \"Rufus 記錄檔\"\r\nt MSG_109 \"0x%02X (磁碟 %d)\"\r\nt MSG_110 \"MS-DOS 無法自 64 kilobytes 配置單元大小的磁區開機。\\n請更換配置單元大小或改用 FreeDOS。\"\r\nt MSG_111 \"不相容的配置單元大小\"\r\nt MSG_112 \"格式化較大的 UDF 磁碟區需要較久的時間。假設使用 USB 2.0 速度，預估時間為 %d:%02d，過程中進度列表可能會呈現暫停狀態。請耐心等待!\"\r\nt MSG_113 \"大 UDF 磁碟區\"\r\nt MSG_114 \"此映像檔使用到 Syslinux %s%s，但本軟體僅支援 Syslinux %s%s 安裝檔案。\\n\\n由於不同版本的 Syslinux 互不相容，因此需額外下載以下擴充檔案: \\n'ldlinux.sys' 和 'ldlinux.bss'\\n如欲下載這份檔案，請選擇「是」，Rufus 將會自動上網下載。若要終止作業，請選擇「否」\\n\\n(僅需下載一次，以後可直接沿用不須再次下載)\"\r\nt MSG_115 \"需額外下載擴充檔案\"\r\nt MSG_116 \"此映像檔使用到 Grub %s，但本軟體僅支援 Grub %s 安裝檔案。\\n\\n由於不同版本的 Grub 互不相容，因此需額外下載以下符合映像檔 Grub 版本的擴充檔案: \\n'core.img'\\n如欲下載這份檔案，請選擇「是」，Rufus 將會自動上網下載，或選擇「否」使用 Rufus 內建版本。若要終止作業，請選擇「取消」\\n\\n(僅需下載一次，以後可直接沿用不須再次下載；若無法下載到相同版本的檔案，則會自動使用內建版本)\"\r\nt MSG_117 \"標準 Windows 安裝\"\r\nt MSG_119 \"裝置進階內容\"\r\nt MSG_120 \"格式化進階選項\"\r\nt MSG_121 \"顯示 %s\"\r\nt MSG_122 \"隱藏 %s\"\r\nt MSG_123 \"固定磁區大小\"\r\nt MSG_124 \"不固定\"\r\nt MSG_125 \"設定 live USB 的固定磁區大小。大小設定為 0 則移除固定磁區。\"\r\nt MSG_126 \"設定磁區大小單位。\"\r\nt MSG_127 \"不要再顯示此訊息\"\r\nt MSG_128 \"重要通知關於 %s\"\r\nt MSG_129 \"你已建立使用 UEFI:NTFS 開機引導程式的裝置。如要使用此裝置開機，請記得關閉安全開機。\\n更多資訊請點選底下 '進階說明' 按鈕。\"\r\nt MSG_130 \"Windows 映像檔選擇\"\r\nt MSG_131 \"此 ISO 包含多個 Windows 映像\\n請選擇要安裝的映像:\"\r\nt MSG_132 \"另一個程式或程序正在使用此裝置，要繼續格式化?\"\r\nt MSG_133 \"Rufus 偵測到您將要建立 'Windows To Go' 1809 版本。\\n\\n由於微軟的程式錯誤，您將無法正常開機 (藍白當機)，除非您自行更換 'WppRecorder.sys' 成 1803 版本。\\n\\n此檔案版權擁有者為微軟，Rufus 愛莫能助...\"\r\nt MSG_134 \"由於選擇使用 MBR 磁區，Rufus 最大只能建立 2 TB 磁區，而剩下空間 %s 將無法使用\\n\\n請確認是否繼續?\"\r\nt MSG_135 \"版本\"\r\nt MSG_136 \"發布版本\"\r\nt MSG_137 \"版本\"\r\nt MSG_138 \"語言\"\r\nt MSG_139 \"架構\"\r\nt MSG_140 \"繼續\"\r\nt MSG_141 \"返回\"\r\nt MSG_142 \"請稍候...\"\r\nt MSG_143 \"使用瀏覽器下載\"\r\nt MSG_144 \"由於 Microsoft 已更改其網站以阻止下載 Windows ISO，因此無法下載。\"\r\nt MSG_145 \"需要 PowerShell 3.0 或更新版本才能執行。\"\r\nt MSG_146 \"您要連上網並下載?\"\r\nt MSG_148 \"執行下載程序中...\"\r\nt MSG_149 \"下載 ISO 映像檔\"\r\nt MSG_150 \"你要使用此開機磁碟的電腦類型。在建立開機磁碟之前，你必須確定該電腦使用 BIOS 或是 UEFI，若沒正確對應可能無法開機。\"\r\nt MSG_151 \"'UEFI-CSM' 代表裝置只能在 UEFI 下的模擬 BIOS 模式 (或稱 'Legacy Mode') 開機，而非原生 UEFI 模式。\"\r\nt MSG_152 \"'無 CSM' 代表裝置只能在原生 UEFI 模式下啟動，而非模擬 BIOS 模式 (或稱 'Legacy Mode')。\"\r\nt MSG_153 \"測試模式: 0x%02X\"\r\nt MSG_154 \"測試模式: 0x%02X, 0x%02X\"\r\nt MSG_155 \"測試模式: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"測試模式: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"設定檔案系統類型\"\r\nt MSG_158 \"資料區塊於檔案系統中最小的配置單元\"\r\nt MSG_159 \"自訂磁區標籤名稱。\\n可支援英數以外的字元 (如中文)。\"\r\nt MSG_160 \"顯示/隱藏進階選項\"\r\nt MSG_161 \"使用右方選項測試模式檢查裝置磁區有無損毀區塊\"\r\nt MSG_162 \"取消勾選可執行完整格式化\"\r\nt MSG_163 \"用來建立磁區的方式\"\r\nt MSG_164 \"開機方法\"\r\nt MSG_165 \"選取或下載映像檔...\"\r\nt MSG_166 \"允許顯示多國語言標籤及裝置圖示 (建立 autorun.inf)\"\r\nt MSG_167 \"安裝 UEFI 開機引導程式，該程式將對媒體進行 MD5 雜湊值驗證\"\r\nt MSG_169 \"建立隱藏磁區分割並嘗試對齊資料分割界限。\\n可幫助老舊 BIOS 偵測到開機碟。\"\r\nt MSG_170 \"顯示連接到電腦的 USB 外接硬碟。請謹慎使用，後果自負!!!\"\r\nt MSG_171 \"立即開始格式化作業。\\n注意: 裝置上所有的資料將被清除!\"\r\nt MSG_172 \"下載簽章無效\"\r\nt MSG_173 \"選取內容...\"\r\nt MSG_174 \"Rufus - 快速可靠的 USB 格式化工具\"\r\nt MSG_175 \"版本 %d.%d (Build %d)\"\r\nt MSG_176 \"正體中文譯者: 佚 <mailto:mmmeow@gmail.com>\\\\line Chocobo1 <https://github.com/Chocobo1>\\\\line SiderealArt <https://github.com/SiderealArt>\\\\line Ocha <https://github.com/cupofocha>\"\r\nt MSG_177 \"Bug 回報或請求新功能請至: (英文網頁)\"\r\nt MSG_178 \"其他著作權資訊:\"\r\nt MSG_179 \"線上更新規則:\"\r\nt MSG_180 \"若選擇啟用自動線上檢查更新機制，表示您同意並授權本軟體蒐集、回傳以下資訊:\"\r\nt MSG_181 \"作業系統架構及版本\"\r\nt MSG_182 \"本軟體目前的版本\"\r\nt MSG_183 \"您的 IP 位置\"\r\nt MSG_184 \"所蒐集之資料\\\\b最多保留一年\\\\b0 ，目的僅供內部統計分析 Rufus 使用概況，絕不會主動將資料提供給第三方。\"\r\nt MSG_185 \"更新流程:\"\r\nt MSG_186 \"Rufus 沒有常駐或背景程式，因此當主程式執行時才會進行自動線上檢查更新。當然，還必須是在連網狀態。\"\r\nt MSG_187 \"選取的開機方法不支援此映像檔\"\r\nt MSG_188 \"此映像檔與選取的開機方法不合，請更換映像檔或開機方法。\"\r\nt MSG_189 \"此映像檔與選取的檔案系統不相容\"\r\nt MSG_190 \"偵測到不相容的磁碟\"\r\nt MSG_191 \"寫入測試\"\r\nt MSG_192 \"讀取測試\"\r\nt MSG_193 \"已下載 %s\"\r\nt MSG_194 \"無法下載 %s\"\r\nt MSG_195 \"使用內建 %s 檔案\"\r\nt MSG_196 \"重要: 此裝置使用非標準磁區大小!\\n\\n一般裝置使用 512-byte 磁區，但是此裝置使用 %d-byte。在多數情況下，這代表你無法使用此裝置開機。\\nRufus 可嘗試建立開機磁碟，但不保證能正常使用。\"\r\nt MSG_197 \"偵測到非標準磁區大小\"\r\nt MSG_198 \"'Windows To Go' 只能安裝於有 '固定' 屬性的 GPT 分割裝置。目前裝置屬性不是 '固定'。\"\r\nt MSG_199 \"此功能在此平台上不可用。\"\r\nt MSG_201 \"取消中，請稍候...\"\r\nt MSG_202 \"掃描映像檔中...\"\r\nt MSG_203 \"映像檔掃描失敗\"\r\nt MSG_204 \"偵測到過時檔案: %s\"\r\nt MSG_205 \"目前選取映像檔: %s\"\r\nt MSG_206 \"缺少檔案: %s\"\r\nt MSG_207 \"新增磁碟區\"\r\nt MSG_208 \"偵測到 %d 個裝置\"\r\nt MSG_209 \"偵測到 %d 個裝置\"\r\nt MSG_210 \"已就緒\"\r\nt MSG_211 \"已取消\"\r\nt MSG_212 \"作業失敗\"\r\nt MSG_213 \"新版本啟動中...\"\r\nt MSG_214 \"無法啟動新版本\"\r\nt MSG_215 \"已開啟: %s\"\r\nt MSG_216 \"已儲存: %s\"\r\nt MSG_217 \"格式化中: %s\"\r\nt MSG_218 \"建立檔案系統中，已完成作業: %d/%d\"\r\nt MSG_219 \"NTFS 修復，已完成: %d%%\"\r\nt MSG_220 \"格式化 (%s) - 剩餘時間: %d:%02d...\"\r\nt MSG_221 \"正在設定標籤 (%s)...\"\r\nt MSG_222 \"格式化中 (%s)...\"\r\nt MSG_223 \"NTFS 修復中 (Checkdisk)...\"\r\nt MSG_224 \"清除 MBR/PBR/GPT 架構...\"\r\nt MSG_225 \"請求磁碟存取...\"\r\nt MSG_226 \"分析既有開機記錄...\"\r\nt MSG_227 \"關閉既有磁碟區...\"\r\nt MSG_228 \"寫入主開機記錄...\"\r\nt MSG_229 \"寫入磁區開機記錄...\"\r\nt MSG_230 \"複製 DOS 檔案...\"\r\nt MSG_231 \"複製 ISO 檔案: %s\"\r\nt MSG_232 \"建置 Win7 EFI 開機 (%s)...\"\r\nt MSG_233 \"收尾中，請稍候...\"\r\nt MSG_234 \"Syslinux %s 安裝中...\"\r\nt MSG_235 \"損毀磁區: %s %d/%d - %0.2f%% (%d/%d/%d 錯誤)\"\r\nt MSG_236 \"損毀磁區: 掃描中 (隨機模式)\"\r\nt MSG_237 \"損毀磁區: 掃描中 (0x%02X 模式)\"\r\nt MSG_238 \"磁區分割中 (%s)...\"\r\nt MSG_239 \"正在刪除磁區分割 (%s)...\"\r\nt MSG_240 \"無法驗證已下載的更新簽章。這代表你的系統可能未正確設定簽章驗證，或下載了惡意檔案。\\n\\n下載的檔案將被刪除。更詳盡資料請見記錄檔。\"\r\nt MSG_241 \"下載中: %s\"\r\nt MSG_242 \"檔案下載失敗。\"\r\nt MSG_243 \"線上更新: 檢查更新版本中...\"\r\nt MSG_244 \"線上更新: 無法連線到網路\"\r\nt MSG_245 \"線上更新: 無法確認軟體版本\"\r\nt MSG_246 \"線上更新: 有更新版本!\"\r\nt MSG_247 \"線上更新: 已是最新版\"\r\nt MSG_248 \"Rufus 登錄檔已成功清除\"\r\nt MSG_249 \"Rufus 登錄檔清除失敗\"\r\nt MSG_250 \"%s 已啟用\"\r\nt MSG_251 \"%s 已停用\"\r\nt MSG_252 \"大小偵測\"\r\nt MSG_253 \"硬碟偵測\"\r\nt MSG_254 \"強制大容量 FAT32 格式化模式\"\r\nt MSG_255 \"離開時清除 NoDriveTypeAutorun\"\r\nt MSG_256 \"偵測偽磁碟\"\r\nt MSG_257 \"Joliet 格式支援\"\r\nt MSG_258 \"Rock Ridge 格式支援\"\r\nt MSG_259 \"強制更新\"\r\nt MSG_260 \"NTFS 壓縮\"\r\nt MSG_261 \"映像檔寫入中: %s\"\r\nt MSG_262 \"ISO 支援\"\r\nt MSG_263 \"正規位元單位\"\r\nt MSG_264 \"刪除目錄 '%s'\"\r\nt MSG_265 \"VMWare 磁碟偵測\"\r\nt MSG_266 \"UEFI/BIOS 雙模式\"\r\nt MSG_267 \"套用 Windows 映像檔: %s\"\r\nt MSG_268 \"建置 Windows 映像檔中...\"\r\nt MSG_269 \"保留時間戳記\"\r\nt MSG_270 \"USB 除錯\"\r\nt MSG_271 \"計算映像檔總和檢查碼: %s\"\r\nt MSG_272 \"計算已選擇映像檔的 MD5、SHA1 和 SHA256 總和檢查碼\"\r\nt MSG_273 \"更改應用程式語言\"\r\nt MSG_274 \"偵測到 %s 映像檔\"\r\nt MSG_275 \"你選擇的映像檔為 'ISOHybrid' 格式。該檔案格式可以使用以下模式寫入%s (檔案複製) 模式 或 %s (磁碟映像) 模式。\\nRufus 建議使用 %s 模式，你將擁有磁碟的完整存取權限。\\n如果你在開機時遭遇問題，你可以嘗試使用 %s 模式寫入。\\n\\n請選擇寫入模式:\"\r\nt MSG_276 \"以 %s 模式寫入 (建議)\"\r\nt MSG_277 \"以 %s 模式寫入\"\r\nt MSG_278 \"檢查衝突的程序...\"\r\nt MSG_279 \"不可開機\"\r\nt MSG_280 \"磁碟或 ISO 映像檔\"\r\nt MSG_281 \"%s (請選擇)\"\r\nt MSG_282 \"鎖定 USB 磁碟\"\r\nt MSG_283 \"無效簽章\"\r\nt MSG_284 \"下載的檔案缺少數位簽章。\"\r\nt MSG_285 \"下載的檔案簽章者為: '%s'。\\n本軟體未使用此簽章，代表檔案可能已遭受病毒感染...\\n是否要執行檔案?\"\r\nt MSG_286 \"正在寫入零: %s\"\r\nt MSG_287 \"偵測非 USB 可移除磁碟\"\r\nt MSG_288 \"缺少較高的權限\"\r\nt MSG_289 \"此程式只能以較高的權限執行\"\r\nt MSG_290 \"檔案索引屬性\"\r\nt MSG_291 \"版本選擇\"\r\nt MSG_292 \"請選擇你要安裝的 Windows 版本:\"\r\nt MSG_293 \"不支援的 Windows 版本\"\r\nt MSG_294 \"Rufus 已不再支援此 Windows 版本。\\n此平台Rufus所支援的最新版本為v%d.%d。\"\r\nt MSG_295 \"警告: 非官方版本\"\r\nt MSG_296 \"此 Rufus 版本不是由官方開發者發布的。\\n\\n你確定要執行嗎?\"\r\nt MSG_297 \"偵測到 ISO 映像檔不完整\"\r\nt MSG_298 \"你選擇的 ISO 映像檔不符合它所宣告的大小: 缺少 %s !\\n\\n如果此檔案是從網路上下載的，請嘗試再次下載並且校驗 MD5 或 SHA 總和檢查碼是正確的。\\n\\n提示: 可點選狀態列 (✓) 按鈕來計算 MD5 或 SHA 總和檢查碼。\"\r\nt MSG_299 \"時間戳記驗證錯誤\"\r\nt MSG_300 \"Rufus 不能驗證下載的更新其時間戳記比現有的執行檔還新。\\n\\n為避免可能的資安攻擊，更新流程已停止且下載的更新檔將會刪除。更多詳情請參見記錄檔。\"\r\nt MSG_301 \"顯示應用程式設定\"\r\nt MSG_302 \"顯示此應用程式資訊\"\r\nt MSG_303 \"顯示記錄檔\"\r\nt MSG_304 \"建立選擇的裝置的磁碟映像\"\r\nt MSG_305 \"是否要使用此裝置來安裝 Windows 在另一個磁碟上，或是要直接在此磁碟上執行 Windows (Windows To Go)。\"\r\nt MSG_306 \"正在快速寫入零: %s\"\r\nt MSG_307 \"可能需要一段時間\"\r\nt MSG_308 \"虛擬硬碟偵測\"\r\nt MSG_309 \"壓縮檔\"\r\nt MSG_310 \"你選擇的 ISO 使用 UEFI 可以直接當作 EFI System Partition (ESP)。比起占用整個通用磁區，使用 ESP 有時是更好的選擇。\\n\\n請選擇此映像檔的寫入模式:\"\r\nt MSG_311 \"在主程式視窗按下 %s 以啟用。\"\r\nt MSG_312 \"額外雜湊值 (SHA512)\"\r\nt MSG_313 \"儲存至虛擬硬碟\"\r\nt MSG_314 \"計算映像檔總和檢查碼\"\r\nt MSG_315 \"數個按鈕\"\r\nt MSG_316 \"檢查次數\"\r\nt MSG_317 \"磁碟 ID\"\r\nt MSG_318 \"預設執行緒優先順序: %d\"\r\nt MSG_319 \"忽略 Boot Marker\"\r\nt MSG_320 \"正在重新整理磁區分割 (%s)...\"\r\nt MSG_321 \"你選擇的映像檔是 ISOHybrid，但是檔案作者沒有使之與 ISO/檔案複製模式相容。\\n因此強制使用 DD 映像寫入模式。\"\r\nt MSG_322 \"無法開啟或讀取 '%s'\"\r\nt MSG_325 \"正在套用 Windows 客製化設定：%s\"\r\nt MSG_326 \"正在套用使用者設定...\"\r\nt MSG_327 \"Windows 使用者體驗\"\r\nt MSG_328 \"客製化 Windows 安裝？\"\r\nt MSG_329 \"移除對 4GB+ 記憶體、安全開機和 TPM 2.0 的要求\"\r\nt MSG_330 \"將登入微軟帳號的要求移除\"\r\nt MSG_331 \"關閉資料收集 (跳過隱私設定)\"\r\nt MSG_332 \"防止 Windows To Go 存取內部磁碟\"\r\nt MSG_333 \"使用此使用者名建立一個本機帳戶:\"\r\nt MSG_334 \"使用目前用戶的區域設定\"\r\nt MSG_335 \"關閉 BitLocker 自動設備加密\"\r\nt MSG_336 \"持久化日誌\"\r\nt MSG_337 \"必須從 Microsoft 下載附加檔案（“%s”）才能使用此功能:\\n- 選 '是' 將連線到網路並進行下載\\n- 選 '否' 將取消操作\\n\\n註: 該檔案將被下載到 Rufus 所在的資料夾中，如果已存在將會自動使用。\"\r\nt MSG_338 \"偵測到被撤銷的 UEFI 開機引導程式\"\r\nt MSG_339 \"Rufus 偵測到選取的 ISO 包含一個被撤銷的 UEFI 開機引導程式，當你在完全更新的 UEFI 系統上啟用安全開機時，將產生 %s。\\n\\n- 如果你從無法信任的來源取得這個 ISO 映像，應該考慮到它可能包含 UEFI 惡意程式，並避免以此進行開機。\\n- 如果你從可以信任的來源取得，應該嘗試找到一個更新的版本，才不會出現這個警告。\"\r\nt MSG_340 \"一個 \\\"安全違規\\\" 畫面\"\r\nt MSG_341 \"一個有著 '%s' 的 Windows 復原畫面 (BSOD)\"\r\nt MSG_342 \"壓縮後的 VHDX 映像\"\r\nt MSG_343 \"未壓縮的 VHD 映像\"\r\nt MSG_344 \"完整寫入更新映像\"\r\nt MSG_345 \"必須從微軟下載一些額外的資料才能使用此功能:\\n- 選 '是' 將連線到網路並進行下載\\n- 選 '否' 將取消操作\"\r\nt MSG_346 \"將 Windows 限制為 S-模式 (不相容繞過線上帳號)。\"\r\nt MSG_347 \"專家模式\"\r\nt MSG_348 \"正在擷取封存檔案: %s\"\r\nt MSG_349 \"使用 Rufus MBR\"\r\nt MSG_900 \"Rufus 是個能格式化並製作可開機 USB 快閃磁碟 (如 USB 隨身碟等) 的工具。\"\r\nt MSG_901 \"官方網站: %s\"\r\nt MSG_902 \"原始碼: %s\"\r\nt MSG_903 \"更新日誌: %s\"\r\nt MSG_904 \"本應用採用 GNU 通用公共許可證 (GPL) 第三版。\\n具體許可證見 https://www.gnu.org/licenses/gpl-3.0.zh-tw.html。\"\r\nt MSG_905 \"啟動\"\r\nt MSG_910 \"將隨身碟、記憶卡或虛擬光碟機格式化為 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 格式\"\r\nt MSG_911 \"建立 FreeDOS  可開機隨身碟\"\r\nt MSG_912 \"從可開機 ISO 檔案 (Windows 和 Linux 等) 建立可開機隨身碟\"\r\nt MSG_913 \"從可開機硬碟映像檔 (包括壓縮映像檔) 建立可開機隨身碟\"\r\nt MSG_914 \"建立 BIOS 或 UEFI 可開機隨身碟，包括 UEFI 下的可開機  NTFS 隨身碟\"\r\nt MSG_915 \"建立 'Windows To Go' 隨身碟\"\r\nt MSG_916 \"為沒有 TPM 或安全開機功能的電腦建立 Windows 11 安裝隨身碟\"\r\nt MSG_917 \"建立持續性 Linux 磁區\"\r\nt MSG_918 \"為選取的磁碟機建立 VHD/DD 映像檔\"\r\nt MSG_919 \"計算被選取映像的 MD5、SHA-1、SHA-256 和 SHA-512 檢查碼\"\r\nt MSG_920 \"執行壞軌檢查，包括對”假“USB 快閃磁碟\\n的偵測\"\r\nt MSG_921 \"下載微軟官方 Windows 映像檔\"\r\nt MSG_922 \"下載 UEFI Shell 映像檔\"\r\n\r\n#########################################################################\r\nl \"hr-HR\" \"Croatian (Hrvatski)\" 0x041a, 0x081a, 0x101a\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"O Rufusu\"\r\nt IDC_ABOUT_LICENSE \"Licenca\"\r\nt IDOK \"U redu\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Svojstva jedinice\"\r\nt IDS_DEVICE_TXT \"Uređaj\"\r\nt IDS_BOOT_SELECTION_TXT \"Izvor podizanja\"\r\nt IDC_SELECT \"Odaberi\"\r\nt IDS_IMAGE_OPTION_TXT \"Mogućnosti slike\"\r\nt IDS_PARTITION_TYPE_TXT \"Tip particije\"\r\nt IDS_TARGET_SYSTEM_TXT \"Ciljani sustav\"\r\nt IDC_LIST_USB_HDD \"Prikaži USB čvrste diskove\"\r\nt IDC_OLD_BIOS_FIXES \"Dodavanje zakrpa za stari BIOS (dodatne particije, poravnanje, itd.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Omogućite provjeru valjanosti UEFI medija\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Mogućnosti formatiranja\"\r\nt IDS_FILE_SYSTEM_TXT \"Datotečni sustav\"\r\nt IDS_CLUSTER_SIZE_TXT \"Veličina grupiranja\"\r\nt IDS_LABEL_TXT \"Naziv jedinice\"\r\nt IDC_QUICK_FORMAT \"Brzo formatiranje\"\r\nt IDC_BAD_BLOCKS \"Provjera za loše blokove\"\r\nt IDC_EXTENDED_LABEL \"Izradi produženu oznaku i ikonu\"\r\nt IDCANCEL \"Zatvori\"\r\nt IDC_START \"Započni\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Zatvori\"\r\nt IDD_LICENSE \"Rufus Licenca\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Zatvori\"\r\nt IDD_LOG \"Zapisnik\"\r\nt IDC_LOG_CLEAR \"Očisti\"\r\nt IDC_LOG_SAVE \"Spremi\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Zatvori\"\r\nt IDD_NEW_VERSION \"Provjera ažuriranja - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Dostupna je novija verzija. Preporuka je odmah preuzeti ažuriranje!\"\r\nt IDC_WEBSITE \"Kliknite ovdje za pristup web-stranici\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Bilješke distribucije\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Preuzmi\"\r\nt IDC_DOWNLOAD \"Preuzmi\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Više informacija\"\r\nt IDYES \"Da\"\r\nt IDNO \"Ne\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Zatvori\"\r\nt IDD_UPDATE_POLICY \"Ažuriranja\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Postavke\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Provjeri ažuriranja\"\r\nt IDS_INCLUDE_BETAS_TXT \"Obuhvati beta verzije\"\r\nt IDC_CHECK_NOW \"Provjeri\"\r\n\r\nt MSG_001 \"Aplikacija je već pokrenuta\"\r\nt MSG_002 \"Aplikacija je već pokrenuta.\\nSamo jedna Rufus aplikacija može biti pokrenuta u isto vrijeme.\"\r\nt MSG_003 \"UPOZORENJE: Ovaj postupak briše postojeće datoteke na odabranoj jedinici.\"\r\nt MSG_004 \"Politika Rufus ažuriranja\"\r\nt MSG_005 \"Dopusti Rufusu da provjeri dostupnost nove verzije?\"\r\nt MSG_006 \"Zatvori\"\r\nt MSG_007 \"Odustani\"\r\nt MSG_008 \"Da\"\r\nt MSG_009 \"Ne\"\r\nt MSG_010 \"Pronađeni loši blokovi\"\r\nt MSG_011 \"Provjera gotova: %d loših blokova pronađeno\\n  %d greška čitanja\\n  %d greška pisanja\\n  %d korupcija\"\r\nt MSG_012 \"%s\\nDetaljno izvješče se nalazi u:\\n%s\"\r\nt MSG_013 \"Onemogučeno\"\r\nt MSG_014 \"Dnevno\"\r\nt MSG_015 \"Tjedno\"\r\nt MSG_016 \"Mjesečno\"\r\nt MSG_017 \"Prilagođeno\"\r\nt MSG_018 \"Instalirana verzija: %d.%d (Build %d)\"\r\nt MSG_019 \"Zadnja verzija: %d.%d (Build %d)\"\r\nt MSG_020 \"bajtova\"\r\nt MSG_026 \"bajtova\"\r\nt MSG_027 \"kilobajta\"\r\nt MSG_028 \"megabajta\"\r\nt MSG_029 \"Zadano\"\r\nt MSG_030 \"%s (Zadano)\"\r\nt MSG_031 \"BIOS (ili UEFI-CSM)\"\r\nt MSG_032 \"UEFI (bez CSM)\"\r\nt MSG_033 \"BIOS ili UEFI\"\r\nt MSG_034 \"%d prolaz\"\r\nt MSG_035 \"%d prolaza %s\"\r\nt MSG_036 \"ISO slika\"\r\nt MSG_037 \"Aplikacija\"\r\nt MSG_038 \"Prekini\"\r\nt MSG_039 \"Pokreni\"\r\nt MSG_040 \"Preuzmi\"\r\nt MSG_041 \"Radnja prekinuta od strane korisnika\"\r\nt MSG_042 \"Greška\"\r\nt MSG_043 \"Greška: %s\"\r\nt MSG_044 \"Preuzimanje datoteka\"\r\nt MSG_045 \"USB uređaj za pohranu (Generičan)\"\r\nt MSG_046 \"%s (disk %d) [%s]\"\r\nt MSG_047 \"Više particija\"\r\nt MSG_048 \"Rufus - Čišćenje buffera\"\r\nt MSG_049 \"Rufus - Otkazivanje\"\r\nt MSG_050 \"Uspješno.\"\r\nt MSG_051 \"Neutvrđena greška pri formatiranju.\"\r\nt MSG_052 \"Nije moguće upotrijebiti odabrani datotečni sustav na ovom mediju.\"\r\nt MSG_053 \"Odbijen pristup uređaju.\"\r\nt MSG_054 \"Uređaj je zaštićen od zapisivanja.\"\r\nt MSG_055 \"Uređaj se koristi u drugom procesu. Obustavite procese koji koriste uređaj.\"\r\nt MSG_056 \"Brzo formatiranje nije dostupno za ovaj uređaj.\"\r\nt MSG_057 \"Nevažeći naziv jedinice.\"\r\nt MSG_058 \"Nevažeći odabir jedinice.\"\r\nt MSG_059 \"Uređaj ne podržava odabranu veličinu grupiranja.\"\r\nt MSG_060 \"Nevažeća veličina particije.\"\r\nt MSG_061 \"Priključite uklonjivi medij.\"\r\nt MSG_062 \"Zaprimljena je nepoznata komanda.\"\r\nt MSG_063 \"Greška raspodjele memorije.\"\r\nt MSG_064 \"Greška kod čitanja.\"\r\nt MSG_065 \"Greška kod pisanja.\"\r\nt MSG_066 \"Instalacija nije uspjela\"\r\nt MSG_067 \"Ne mogu otvoriti medij. Možda ga koristi drugi proces. Ponovo priključite uređaj i zatim pokušajte ponovo.\"\r\nt MSG_068 \"Pogreška kod particioniranja pogona.\"\r\nt MSG_069 \"Datoteke se ne mogu kopirati na odabrani pogon.\"\r\nt MSG_070 \"Otkazao korisnik.\"\r\nt MSG_071 \"Ne mogu započeti nit.\"\r\nt MSG_072 \"Nije završena provjera blokova.\"\r\nt MSG_073 \"Neuspješno skeniranje ISO slike.\"\r\nt MSG_074 \"Neuspješno izvlačenje ISO slike.\"\r\nt MSG_075 \"Uređaj se nije mogao podići.\"\r\nt MSG_076 \"Ne mogu zakrpati/postaviti datoteke za bootanje.\"\r\nt MSG_077 \"Ne mogu dodijeliti slovo jedinici.\"\r\nt MSG_078 \"Ne mogu podići GUID jedinicu.\"\r\nt MSG_079 \"Uređaj nije spreman.\"\r\nt MSG_080 \"Rufus je otkrio da Windows još uvijek čisti unutarnje buffere na USB uređaju.\\n\\nOvisno o brzini USB uređaja, ova operacija bi mogla potrajati, posebice za veće datoteke.\\n\\nPreporuka je da dopustite Windowsima da završe. Ako ne želite čekati, odspojite uređaj...\"\r\nt MSG_081 \"Nepodržana slika\"\r\nt MSG_082 \"Ova slika nije podržana ili koristi metodu kompresije koju Rufus ne podržava.\"\r\nt MSG_083 \"Zamijeni %s?\"\r\nt MSG_084 \"Ova ISO slika koristi staru verziju '%s'.\\nBoot izbornici možda neće raditi pravilno zbog toga.\\n\\nRufus može preuzeti novu verziju da ne dođe do problema:\\n- Odaberite 'Da' kako bi se datoteka preuzela\\n- Odaberite 'Ne' da nastavite bez preuzimanja\\nPreporuka je da odabarete 'Da'.\\n\\nNova datoteka preuzima se u mapu gdje je Rufus.\"\r\nt MSG_085 \"Preuzimanje %s\"\r\nt MSG_086 \"Nema odabrane slike\"\r\nt MSG_087 \"za %s NAND\"\r\nt MSG_088 \"Slika je prevelika\"\r\nt MSG_089 \"Slika je prevelika za odabrani medij.\"\r\nt MSG_090 \"Nepodržani ISO\"\r\nt MSG_091 \"Dok koristite UEFI particiju, samo EFI ISO slike su podržane. Molimo odaberite EFI ISO ili postavite dotičnu particiju na BIOS.\"\r\nt MSG_092 \"Nepodržani datotečni sustav\"\r\nt MSG_093 \"VAŽNO: OVAJ UREĐAJ IMA VIŠE PARTICIJA!!!\\n\\nOvo uključuje particije koje možda nisu vidljive u Windowsima. Ako nastavite, odgovorni ste za sve izgubljene datoteke na tim particijama.\"\r\nt MSG_094 \"Otkriveno je više particija\"\r\nt MSG_095 \"DD slika\"\r\nt MSG_096 \"Odabrani datotečni sustav ne može se koristiti s ovim tipom ISO-a. Odaberite drugi datotečni sustav ili drugu ISO datoteku.\"\r\nt MSG_097 \"'%s' se može koristiti samo ako je datotečni sustav NTFS.\"\r\nt MSG_098 \"VAŽNO: Pokušavate postaviti 'Windows To Go', ali odabrani uređaj ima 'FIXED' atribut. Zbog toga će se Windows vjerojatno zamrznuti pri pokretanju, pošto je Microsoft prilagodio Windows To Go za uređaje s 'REMOVABLE' atributom.\\n\\nŽelite li svejedno nastaviti?\\n\\nInfo: 'FIXED/REMOVABLE' atribut je hardversko svojstvo koje se može izmijeniti samo pomoću specijalnih alata proizvođača diska . Dotični alati su vrlo rijetko dostupni krajnjim korisnicima.\"\r\nt MSG_099 \"Ograničenje datotečnog sustava\"\r\nt MSG_100 \"Ova ISO slika sadrži datoteku veličine 4 GB ili veću, što je više od podržanog za FAT ili FAT32 datotečni sustav.\"\r\nt MSG_101 \"Nedostaje WIM podrška\"\r\nt MSG_102 \"Vaša platforma ne može raspakirati datoteke iz WIM arhiva. WIM raspak. je potrebno za kreiranje bootabilnih EFI Windows 7 i Vista USB jedinice. Preuzmite najnoviju verziju programa 7-Zip.\\nŽelite li posjetiti 7-Zip stranicu za preuzimanje?\"\r\nt MSG_103 \"Preuzmi %s?\"\r\nt MSG_104 \"%s ili noviji zahtijeva '%s' za instalaciju.\\nZato što je datoteka veća od 100 KB i uvijek prisutna na %s ISO slikama, nije ugrađena u Rufus.\\n\\nRufus je može preuzeti:\\n- Odaberite 'Da' kako bi preuzeli datoteku\\n- Odaberite 'Ne' ako ne želite ručno kopirati datoteku\\n\\nDatoteka će se spremiti u isti direktorij i kad '%s' postoji tamo, automatski će biti korištena.\"\r\nt MSG_105 \"Prekidanje može dovesti do toga da uređaj postane nedostupan.\\nAko ste sigurni da želite prekinuti, kliknite DA. U suprotnom, kliknite NE.\"\r\nt MSG_106 \"Molim odaberite mapu\"\r\nt MSG_107 \"Sve datoteke\"\r\nt MSG_108 \"Rufus zapisnik\"\r\nt MSG_109 \"0x%02X (Pogon %d)\"\r\nt MSG_110 \"MS-DOS se ne može podignuti iz uređaja s grupiranjem od 64 kilobajta.\\nPromijenite veličinu grupiranja ili odaberite FreeDOS.\"\r\nt MSG_111 \"Nekompatibilna veličina grupiranja\"\r\nt MSG_112 \"Formatiranje velike UDF jedinice može potrajati. Pri USB 2.0 brzini, trajanja formatiranja procjenjuje se na %d:%02d, može vam se učiniti da je proces zablokirao. Budite strpljivi!\"\r\nt MSG_113 \"Velika UDF jedinica\"\r\nt MSG_114 \"Ova slika koristi Syslinux %s%s ali ova aplikacija uključuje instalacijske datoteke za Syslinux %s%s.\\n\\nPošto nove verzije Syslinuxa nisu međusobno kompatibilne, nemoguće je da Rufus sadrži sve, dvije dodatne datoteke se trebaju preuzeti: ('ldlinux.sys' i 'ldlinux.bss')\\n- Odaberite 'Da' kako bi se preuzeli datoteke\\n- Odaberite 'Ne' za prekid\\n\\nInfo: Datoteke se preuzimaju u trenutni direktorij programa i koristit će se automatski ako bude potrebno.\"\r\nt MSG_115 \"Potrebno preuzimanje\"\r\nt MSG_116 \"Ova slika koristi Grub %s, a aplikacija sadrži samo instalacijske datoteke za Grub %s.\\n\\nPošto razne Grub verzije nisu međusobno kompatibilne, a nije moguće uključiti sve Grub datoteke, Rufus će probati locirati verziju Grub instalacijske datoteke ('core.img') koja odgovara onoj iz vaše slike:\\n- Odaberite 'Da' kako bi se preuzeli datoteke\\n- Odaberite 'Ne' za korištenje verzije od Rufus-a\\n- Odaberite 'Odustani' za prekid.\\n\\nInfo: Datoteke se preuzimaju u trenutni direktorij programa i koristit će se automatski ako bude potrebno. Ako se ne pronađe potrebna verzija, koristi se dostupna verzija.\"\r\nt MSG_117 \"Uobičajena Windows instalacija\"\r\nt MSG_118 \"Prijenosni Windowsi\"\r\nt MSG_119 \"napredna svojstva jedinica\"\r\nt MSG_120 \"napredne mogućnosti formatiranja\"\r\nt MSG_121 \"Prikaži %s\"\r\nt MSG_122 \"Sakrij %s\"\r\nt MSG_123 \"Veličina trajne particije\"\r\nt MSG_124 \"Bez trajne particije\"\r\nt MSG_125 \"Zadaj veličinu trajne particije za \\\"live\\\" USB medij. Ako je zadana veličina 0, isključuje se trajna particija.\"\r\nt MSG_126 \"Zadaj jedinicu veličine particije.\"\r\nt MSG_127 \"Više ne prikazuj ovu poruku\"\r\nt MSG_128 \"Važna napomena za %s\"\r\nt MSG_129 \"Kreirali ste medij koji koristi UEFI:NTFS bootloader. Da bi ste boot-ali s ovog medija, MORATE ISKLJUČITI \\\"SECURE BOOT\\\".\\nZa detaljno informiranje o ovome, pogledajte na 'Više informacija' ispod.\"\r\nt MSG_130 \"Odabir Windows slike\"\r\nt MSG_131 \"Ova ISO datoteka sadrži više Windows slika.\\nOdaberite sliku koju želite koristiti za instalaciju:\"\r\nt MSG_132 \"Drugi program ili proces pristupa pogonu. Da li ipak želiš formatirati pogon?\"\r\nt MSG_133 \"Rufus je otkrio da pokušavate kreirati \\\"Windows To Go\\\" medij baziran na verziji 1809 ISO.\\n\\nZbog *MICROSOFT BUG-a*, doći će do fatalne greške kod podizanja Windows-a (Blue Screen Of Death), osim ako ne zamijenite datoteku 'WppRecorder.sys' s verzijom 1803.\\n\\nRufus nije u mogućnosti ispraviti problem jer datoteka 'WppRecorder.sys' podliježe Microsoft \\\"copyright-u\\\", tako da bi to bilo ilegalno.\"\r\nt MSG_134 \"Odabrali ste MBR za shemu particije. Rufus može kreirati maksimalnu partiticiju do 2 TB na ovom mediju, ostaje %s diska neiskorišteno.\\n\\nJeste li sigurni da želite nastaviti?\"\r\nt MSG_135 \"Verzija\"\r\nt MSG_136 \"Podverzija\"\r\nt MSG_137 \"Edicija\"\r\nt MSG_138 \"Jezik\"\r\nt MSG_139 \"Arhitektura\"\r\nt MSG_140 \"Nastavi\"\r\nt MSG_141 \"Natrag\"\r\nt MSG_142 \"Molim pričekajte...\"\r\nt MSG_143 \"Preuzmi koristeći tražilicu\"\r\nt MSG_144 \"Preuzimanje ISO-ova sustava Windows nije dostupno jer je Microsoft promijenio web-mjesto da bi ga spriječio.\"\r\nt MSG_145 \"PowerShell 3.0 ili noviji je potreban za pokretanje skripte.\"\r\nt MSG_146 \"Želiš li preuzimanje?\"\r\nt MSG_148 \"Pokretanje skripte za preuzimanje...\"\r\nt MSG_149 \"Preuzmi ISO sliku\"\r\nt MSG_150 \"Vrsta računala koje će podići sadržaj s ovog uređaja. Vaša je odgovornost odrediti da li računalo koristi BIOS ili UEFI prije kreiranja BOOT-abilnog USB pogona, u suprotnom neće biti moguće podići sustav.\"\r\nt MSG_151 \"'UEFI-CSM' znači će se s USB pogona boot-ati samo u modu emulacije BIOS-a (poznatom kao \\\"Legacy Mode\\\") pod UEFI, a ne u \\\"pravom\\\" UEFI modu.\"\r\nt MSG_152 \"'bez CSM' znači da će se s USB pogona boot-ati samo u UEFI modu (ne u BIOS modu emulacije - poznat kao \\\"Legacy Mode\\\").\"\r\nt MSG_153 \"Test uzorak: 0x%02X\"\r\nt MSG_154 \"Test uzorak: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Test uzorak: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Test uzorak: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Odabire datotečni sustav\"\r\nt MSG_158 \"Minimalna veličina koju će blok okupirati u datotečnom sustavu\"\r\nt MSG_159 \"Koristi ovo polje za zadavanje oznake diska.\\nPrihvaćeni su i internacionalni znakovi.\"\r\nt MSG_160 \"Otvori napredne postavke\"\r\nt MSG_161 \"Provjeri prisutnost loših blokova pomoću uzorka\"\r\nt MSG_162 \"Ostavite prazno za \\\"sporu\\\" metodu formatiranja\"\r\nt MSG_163 \"Metoda koja će se koristiti kod kreiranja particija\"\r\nt MSG_164 \"Metoda koja će biti korištena za kreiranje boot-abilnog USB-a\"\r\nt MSG_165 \"Kliknite za odabir ili preuzimanje slike... (ISO)\"\r\nt MSG_166 \"Potvrdite ovo da dozvolite prikaz internacionalnih oznaka i napravite ikonu (stvara autorun.inf)\"\r\nt MSG_167 \"Instaliraj UEFI bootloader koji će izvršiti MD5 Sum provjeru valjanosti datoteke medije\"\r\nt MSG_169 \"Stvori dodatnu skrivenu particiju i pokušaj poravnati granice particije.\\nOvo je korisno za stare BIOS-e.\"\r\nt MSG_170 \"Otkrivanje USB čvrstih diskova. KORISTI NA VLASTITU ODGOVORNOST!!!\"\r\nt MSG_171 \"Započni proces.\\nTo BRIŠE sve podatke s uređaja!\"\r\nt MSG_172 \"Neispravan potpis datoteke\"\r\nt MSG_173 \"Klikni za odabir...\"\r\nt MSG_174 \"Rufus - Pouzdan alat za formatiranje USB-a\"\r\nt MSG_175 \"Verzija %d.%d (Build %d)\"\r\nt MSG_176 \"Preveo:\\\\line• Dario Komar <mailto:dkmr_main@hotmail.com>\\\\line• Saša Vujanić <mailto:svujanic@gmail.com>\"\r\nt MSG_177 \"Prijavite greške u prijevodu na navedenu adresu:\"\r\nt MSG_178 \"Dodatna autorska prava:\"\r\nt MSG_179 \"Politika ažuriranja:\"\r\nt MSG_180 \"Ako želite automatska ažuriranja, slažete se da se sljedeće informacije skupljaju na našem serveru:\"\r\nt MSG_181 \"Arhitektura vašeg OS-a i verzija\"\r\nt MSG_182 \"Verzija Rufusa koju koristite\"\r\nt MSG_183 \"Vaša IP adresa\"\r\nt MSG_184 \"Zbog statistika, navedene informacije možemo čuvati \\\\b najduže jednu godinu\\\\b0 . Vaše informacije ne dijele se trećim strankama.\"\r\nt MSG_185 \"Proces ažuriranja:\"\r\nt MSG_186 \"Rufus nema pozadinskih servisa, tako da se ažuriranja provjeravaju samo kada je Rufus aktivan.\\\\line\\nNaravno, prilikom provjere i preuzimanja ažuriranja, potrebna je veza s internetom.\"\r\nt MSG_187 \"Nepodržana slika za odabrani način pokretanja\"\r\nt MSG_188 \"Trenutna slika se ne podudara s odabranim opcijama pokretanja. Odaberite drugu sliku ili opcije pokretanja.\"\r\nt MSG_189 \"Ova ISO slika nije kompatibilna s odabranim datotečnim sustavom\"\r\nt MSG_190 \"Pronađen nekompatibilan uređaj\"\r\nt MSG_191 \"Prolaz zapisivanja\"\r\nt MSG_192 \"Prolaz čitanja\"\r\nt MSG_193 \"Preuzeto %s\"\r\nt MSG_194 \"Ne mogu preuzeti %s\"\r\nt MSG_195 \"Korištenje ugrađenih verzija od %s datoteka\"\r\nt MSG_196 \"VAŽNO: OVAJ UREĐAJ NEMA STANDARDNU VELIČINU SEKTORA!\\n\\nUobičajeni mediji koriste veličinu sektora od 512 bajtova ali ovaj koristi od %d. U većini slučaja, ovo znači da NEĆETE moći bootati s ovog uređaja.\\nRufus može pokušati kreirati bootabilni uređaj, ali ne može se garantirati uspjeh.\"\r\nt MSG_197 \"Otkrivena nestandardna veličina sektora\"\r\nt MSG_198 \"'Windows To Go' se može instalirati samo na uređaj s GPT particijom koja ima FIXED atribut. Odabrani uređaj nema taj atribut.\"\r\nt MSG_199 \"Ova značajka nije dostupna na ovoj platformi.\"\r\nt MSG_201 \"Otkazujem - Pričekajte...\"\r\nt MSG_202 \"Skeniram sliku...\"\r\nt MSG_203 \"Neuspjelo skeniranje\"\r\nt MSG_204 \"Zastarjeli %s otkriven\"\r\nt MSG_205 \"Koristim sliku: %s\"\r\nt MSG_206 \"Nedostaje %s datoteka\"\r\nt MSG_207 \"Nova jedinica\"\r\nt MSG_208 \"%d uređaj pronađen\"\r\nt MSG_209 \"%d uređaja pronađeno\"\r\nt MSG_210 \"SPREMNO\"\r\nt MSG_211 \"Otkazano\"\r\nt MSG_212 \"Neuspješno\"\r\nt MSG_213 \"Pokretanje nove aplikacije...\"\r\nt MSG_214 \"Greška kod pokretanja nove aplikacije\"\r\nt MSG_215 \"Otvoreno %s\"\r\nt MSG_216 \"Spremljeno %s\"\r\nt MSG_217 \"Formatiranje: %s\"\r\nt MSG_218 \"Stvaram datotečni sustav: %d/%d završeno\"\r\nt MSG_219 \"NTFS Fixup: %d%% završeno\"\r\nt MSG_220 \"Formatiranje(%s) - Procijenjeno %d:%02d...\"\r\nt MSG_221 \"Postavljanje jedinice (%s)...\"\r\nt MSG_222 \"Formatiranje (%s)...\"\r\nt MSG_223 \"NTFS popravak (Checkdisk)...\"\r\nt MSG_224 \"Čistim MBR/PBR/GPT strukture...\"\r\nt MSG_225 \"Zahtijevam pristup disku...\"\r\nt MSG_226 \"Analiziram postojeće boot zapise...\"\r\nt MSG_227 \"Zatvaram postojeću jedinicu...\"\r\nt MSG_228 \"Zapisujem \\\"Master Boot Record\\\"…\"\r\nt MSG_229 \"Zapisujem \\\"Partition Boot Record\\\"...\"\r\nt MSG_230 \"Kopiram DOS datoteke...\"\r\nt MSG_231 \"Kopiram ISO datoteku: %s\"\r\nt MSG_232 \"Win7 EFI boot postavljanje (%s)…\"\r\nt MSG_233 \"Završavanje, pričekajte...\"\r\nt MSG_234 \"Instaliram Syslinux %s...\"\r\nt MSG_235 \"Loši blokovi: %s %d/%d - %0.2f%% (%d/%d/%d grešaka)\"\r\nt MSG_236 \"Loši blokovi: Testiram s nasumičnim uzorkom\"\r\nt MSG_237 \"Loši blokovi: Testiram s uzorkom 0x%02X\"\r\nt MSG_238 \"Particioniranje (%s)...\"\r\nt MSG_239 \"Brisanje particija (%s)...\"\r\nt MSG_240 \"Potpis preuzetog ažuriranja ne može biti provjeren. Možda je sistem nepravilno konfiguriran za provjeru potpisa ili indicira zaraženu datoteku..\\n\\nPreuzeta datoteka će biti obrisana. Provjerite zapisnik za više detalja.\"\r\nt MSG_241 \"Preuzimam: %s\"\r\nt MSG_242 \"Neuspješno preuzimanje.\"\r\nt MSG_243 \"Provjera ažuriranja Rufus-a...\"\r\nt MSG_244 \"Ažuriranje: Internet nije dostupan\"\r\nt MSG_245 \"Ažuriranje: Nije moguće utvrditi verziju\"\r\nt MSG_246 \"Dostupna je nova verzija Rufusa!\"\r\nt MSG_247 \"Nema novijih verzija Rufusa\"\r\nt MSG_248 \"Ključevi registra uspješno izbrisani\"\r\nt MSG_249 \"Ključevi registra nisu se mogli izbrisati\"\r\nt MSG_250 \"%s omogućeno\"\r\nt MSG_251 \"%s onemogućeno\"\r\nt MSG_252 \"Provjera veličine\"\r\nt MSG_253 \"Otkrivanje čvrstih diskova\"\r\nt MSG_254 \"Prisili veće FAT32 formatiranje\"\r\nt MSG_255 \"\\\"NoDriveTypeAutorun\\\" će biti izbrisan pri izlasku\"\r\nt MSG_256 \"Otkrivanje lažnih jedinica\"\r\nt MSG_257 \"Joliet podrška\"\r\nt MSG_258 \"Rock Ridge podrška\"\r\nt MSG_259 \"Prisilno ažuriranje\"\r\nt MSG_260 \"NTFS kompresija\"\r\nt MSG_261 \"Zapisujem image: %s\"\r\nt MSG_262 \"ISO podrška\"\r\nt MSG_263 \"Koristi ISPRAVNE veličine jedinica\"\r\nt MSG_264 \"Brišem direktorij '%s'\"\r\nt MSG_265 \"Otkrivanje VMware diska\"\r\nt MSG_266 \"Dual UEFI/BIOS mod\"\r\nt MSG_267 \"Primjenjujem Windows sliku: %s\"\r\nt MSG_268 \"Primjenjujem Windows sliku...\"\r\nt MSG_269 \"Očuvanje datuma datoteka\"\r\nt MSG_270 \"USB debagiranje\"\r\nt MSG_271 \"Računanje kontrolnog zbroja: %s\"\r\nt MSG_272 \"Izračunaj MD5, SHA1 i SHA256 kontrolni zbroj u odabranoj datoteci\"\r\nt MSG_273 \"Odabir jezika aplikacije\"\r\nt MSG_274 \"%s slike detektirano\"\r\nt MSG_275 \"Slika koju ste odabrali je 'ISOHybrid'. Takva datoteka može biti zapisana metodom %s (kopiranje) ili %s (disk image).\\nPreporuka je upotrijebiti metodu %s, tako da imate neograničen pristup jedinici nakon zapisivanja.\\nAko naiđete na probleme kod pokretanja, isprobajte metodu %s.\\n\\nOdaberite metodu za ovu operaciju:\"\r\nt MSG_276 \"Metodom %s (Preporučeno)\"\r\nt MSG_277 \"Metodom %s\"\r\nt MSG_278 \"Provjera konflikata...\"\r\nt MSG_279 \"Nije bootabilna\"\r\nt MSG_280 \"Disk ili ISO slika\"\r\nt MSG_281 \"%s (Odabrati)\"\r\nt MSG_282 \"Ekskluzivno zaključavanje USB medija\"\r\nt MSG_283 \"Nevažeći potpis\"\r\nt MSG_284 \"Preuzeta aplikacija ne sadrži digitalni potpis.\"\r\nt MSG_285 \"Preuzeta aplikacija je potpisana od strane ‘%s’.\\nOvo nije prepoznatljiv izvor i može biti zlonamjeran...\\nŽelite li svejedno pokrenuti datoteku?\"\r\nt MSG_286 \"Brisanje uređaja: %s\"\r\nt MSG_287 \"Detektiranje ne uklonjivih USB uređaja\"\r\nt MSG_288 \"Potrebna administratorska ovlaštenja\"\r\nt MSG_289 \"Ovaj program radi samo s administratorskim ovlaštenjem\"\r\nt MSG_290 \"Indeksiranje datoteka\"\r\nt MSG_291 \"Odabir verzije\"\r\nt MSG_292 \"Molimo odaberite verziju Windowsa koju želite instalirati:\"\r\nt MSG_293 \"Nepodržana verzija Windowsa\"\r\nt MSG_294 \"Ova verzija Windowsa više nije podržana od strane Rufusa.\\nPosljednja verzija Rufusa kompatibilna s ovom platformom je v%d.%d.\"\r\nt MSG_295 \"Upozorenje: Neslužbena verzija\"\r\nt MSG_296 \"Ova verzija Rufusa NIJE proizvod službenog razvojnog programera.\\n\\nSvejedno pokrenuti program?\"\r\nt MSG_297 \"Otkrivena skraćena ISO datoteka\"\r\nt MSG_298 \"ISO datoteka koju ste odabrali ne odgovara deklariranoj veličini: %s podataka nedostaje!\\n\\nAko ste ovu datoteku preuzeli na internetu, pokušajte preuzeti novu kopiju i provjerite da su MD5 ili SHA kontrolni zbrojevi identični kao u originalu.\\n\\nRufus može provjeriti MD5 ili SHA pritiskom na (✓) tipku.\"\r\nt MSG_299 \"Pogreška kod potvrđivanja vremenske oznake\"\r\nt MSG_300 \"Rufus nije mogao potvrditi da je vremenska oznaka preuzetog ažuriranja novija od oznake u trenutnoj verziji.\\n\\nS ciljem sprječavanja mogućih eksploatacija sustava, postupak ažuriranja je obustavljen te se preuzeta datoteka uklanja. Više informacija možete pronaći u zapisniku.\"\r\nt MSG_301 \"Prikaži postavke aplikacije\"\r\nt MSG_302 \"Prikaži informacije o aplikaciji\"\r\nt MSG_303 \"Prikaži zapisnik\"\r\nt MSG_304 \"Stvori sliku diska iz odabranog uređaja\"\r\nt MSG_305 \"Ovom opcijom naznačite ako želite koristiti ovaj uređaj kako bi instalirali Windows na drugi disk ili ako želite podići Windows direktno s ovog uređaja (Windows To Go).\"\r\nt MSG_306 \"\\\"Fast-zeroing\\\" pogona: %s\"\r\nt MSG_307 \"ovo može potrajati neko vrijeme\"\r\nt MSG_308 \"VHD detekcija\"\r\nt MSG_309 \"Komprimirana arhiva\"\r\nt MSG_310 \"ISO datoteka koju ste odabrali koristi UEFI i dovoljno je mala da bi bila zapisana kao \\\"EFI System Partition\\\" (ESP). Zapisanje u ESP, umjesto zapisivanje u generičku podatkovnu particiju, možda je bolji izbor za neke tipove instalacija.\\n\\nOdaberite mod koji želite koristi za kreiranje slike:\"\r\nt MSG_311 \"Koristi %s (u glavnom prozoru aplikacije) za uključenje.\"\r\nt MSG_312 \"\\\"Ekstra hashes\\\" (SHA512)\"\r\nt MSG_313 \"Snimi u VHD\"\r\nt MSG_314 \"Izračunaj \\\"checksum\\\" slike\"\r\nt MSG_315 \"Višestruki gumbi\"\r\nt MSG_316 \"Broj prolaza\"\r\nt MSG_317 \"ID uređaja\"\r\nt MSG_318 \"Prioritet glavne niti %d\"\r\nt MSG_319 \"Zanemari Boot Marker\"\r\nt MSG_320 \"Osvježavam raspored particija (%s)...\"\r\nt MSG_321 \"Slika koju ste odabrali je \\\"ISOHybrid\\\", ali nije kompatibilna s \\\"ISO/File\\\" mod kopiranja.\\nZbog toga će DD mod zapisivanja slike biti korišten.\"\r\nt MSG_322 \"Nije moguće otvoriti ili pročitati '%s'\"\r\nt MSG_325 \"Primjena prilagodbe sustava Windows: %s\"\r\nt MSG_326 \"Primjena korisničkih mogućnosti...\"\r\nt MSG_327 \"Korisničko iskustvo sustava Windows\"\r\nt MSG_328 \"Želite li prilagoditi instalaciju sustava Windows?\"\r\nt MSG_329 \"Uklonite zahtjev za 4GB+ RAM-a, Sigurno pokretanje i TPM 2.0\"\r\nt MSG_330 \"Uklanjanje preduvjeta za mrežni Microsoftov račun\"\r\nt MSG_331 \"Onemogući prikupljanje podataka (Preskoči pitanja o privatnosti)\"\r\nt MSG_332 \"Sprječavanje pristupa internim diskovima sustavu Windows To Go\"\r\nt MSG_333 \"Stvorite lokalni račun s korisničkim imenom:\"\r\nt MSG_334 \"Postavljanje regionalnih mogućnosti na iste vrijednosti kao i vrijednosti ovog korisnika\"\r\nt MSG_335 \"Onemogući BitLocker automatsko šifriranje uređaja\"\r\nt MSG_336 \"Stalni zapisnik\"\r\nt MSG_337 \"Za korištenje ove značajke potrebno je preuzeti dodatnu datoteku ('%s') s Microsofta:\\n- Odaberite 'Da' za spajanje na Internet i preuzimanje\\n- Odaberite 'Ne' za poništavanje operacije\\n\\nNapomena: Datoteka će se preuzeti u imenik aplikacije i automatski će se ponovno koristiti ako postoji.\"\r\nt MSG_338 \"Otkriven opozvani UEFI pokretački program\"\r\nt MSG_339 \"Rufus je otkrio da ISO koji ste odabrali sadrži UEFI bootloader koji je opozvan i koji će proizvesti %s, kada je Secure Boot omogućen na potpuno ažuriranom UEFI sustavu.\\n\\n- Ako ste nabavili ovu ISO sliku iz izvora koji nije renomiran, trebali biste razmotriti mogućnost da ona sadrži zlonamjerni softver UEFI i izbjegavati pokretanje ga.\\n- Ako ste ga dobili od pouzdanog izvora, trebali biste pokušati locirati noviju verziju koja neće proizvesti ovo upozorenje.\"\r\nt MSG_340 \"zaslon \\\"Sigurnosna povreda\\\"\"\r\nt MSG_341 \"zaslon za oporavak sustava Windows (BSOD) s '%s'\"\r\nt MSG_342 \"Komprimirana VHDX slika\"\r\nt MSG_343 \"Nekomprimirana VHD slika\"\r\nt MSG_344 \"Potpuna ažuriranje flash slike\"\r\nt MSG_345 \"Za korištenje ove funkcije potrebno je preuzeti neke dodatne podatke od Microsofta:\\n- Odaberite 'Da' za spajanje na Internet i preuzimanje\\n- Odaberite 'Ne' za poništavanje operacije\"\r\nt MSG_346 \"Ograniči Windows na S-Mode (NEKOMPATIBILNO s mrežnim zaobilaženjem računa)\"\r\nt MSG_347 \"Stručnog načina rada\"\r\nt MSG_348 \"Izdvajanje arhivskih datoteka: %s\"\r\nt MSG_349 \"Koristiti Rufus MBR\"\r\nt MSG_900 \"Rufus je aplikacija koja olakšava formatiranje i stvaranje USB pokretačkih jedinica.\"\r\nt MSG_901 \"Službena stranica: %s\"\r\nt MSG_902 \"Šifra izvora: %s\"\r\nt MSG_904 \"Ova je aplikacija licencirana pod uvjetima GNU Javne licence (GPL) verzije 3.\\nDetalje potražite u https://www.gnu.org/licenses/gpl-3.0.html.\"\r\nt MSG_910 \"Formatirajte USB, flash karticu i virtualne pogone na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Stvaranje FreeDOS USB pogona za pokretanje\"\r\nt MSG_912 \"Stvaranje pogona za pokretanje iz ISO-ova za pokretanje (Windows, Linux itd.)\"\r\nt MSG_913 \"Stvaranje pogona za pokretanje iz slika diska za pokretanje, uključujući komprimirane\"\r\nt MSG_914 \"Stvaranje BIOS ili UEFI pogona za pokretanje, uključujući UEFI NTFS za pokretanje\"\r\nt MSG_915 \"Stvaranje pogona \\\"Windows To Go\\\"\"\r\nt MSG_916 \"Stvaranje instalacijskih pogona sustava Windows 11 za PC-jeve koji nemaju TPM ili Sigurno pokretanje\"\r\nt MSG_917 \"Stvaranje trajnih Linux particija\"\r\nt MSG_918 \"Stvaranje VHD/DD slika odabranog pogona\"\r\nt MSG_919 \"Izračunajte kontrolne zbrojeve odabrane slike MD5, SHA-1, SHA-256 i SHA-512\"\r\nt MSG_920 \"Izvršite provjere loših blokova, uključujući otkrivanje \\\"lažnih\\\" flash pogona\"\r\nt MSG_921 \"Preuzimanje službenih ISO-ova za maloprodaju sustava Microsoft Windows\"\r\nt MSG_922 \"Preuzmite ISO-ove UEFI ljuske\"\r\n\r\n#########################################################################\r\nl \"cs-CZ\" \"Czech (Čeština)\" 0x0405\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"O programu Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licence\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Vlastnosti disku\"\r\nt IDS_DEVICE_TXT \"Zařízení\"\r\nt IDS_BOOT_SELECTION_TXT \"Výběr boot\"\r\nt IDC_SELECT \"Vybrat\"\r\nt IDS_IMAGE_OPTION_TXT \"Možnosti obrazu\"\r\nt IDS_PARTITION_TYPE_TXT \"Oddíl a typ cílového systému\"\r\nt IDS_TARGET_SYSTEM_TXT \"Cílový systém\"\r\nt IDC_LIST_USB_HDD \"Seznam USB disků\"\r\nt IDC_OLD_BIOS_FIXES \"Přidat opravu pro starší BIOSy (extra partition, align, etc.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Povolit ověřování médií UEFI za běhu\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Možnosti formátování\"\r\nt IDS_FILE_SYSTEM_TXT \"Souborový systém\"\r\nt IDS_CLUSTER_SIZE_TXT \"Velikost clusteru\"\r\nt IDS_LABEL_TXT \"Název svazku\"\r\nt IDC_QUICK_FORMAT \"Rychlý formát\"\r\nt IDC_BAD_BLOCKS \"Kontrola vadných bloků\"\r\nt IDC_EXTENDED_LABEL \"Vytvořit rozšířené označení a symbol souborů\"\r\nt IDS_STATUS_TXT \"Stav\"\r\nt IDCANCEL \"Zavřít\"\r\nt IDC_START \"Spustit\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Zavřít\"\r\nt IDD_LICENSE \"Licence programu Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Zavřít\"\r\nt IDD_LOG \"Záznam činnosti programu Rufus\"\r\nt IDC_LOG_CLEAR \"Smazat\"\r\nt IDC_LOG_SAVE \"Uložit\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Zavřít\"\r\nt IDD_NEW_VERSION \"Kontrola aktualizace - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Je dostupná novější verze. Stáhněte poslední verzi!\"\r\nt IDC_WEBSITE \"Kliknutím přejdete na web aplikace\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Poznámky k vydání\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Stažení\"\r\nt IDC_DOWNLOAD \"Stažení\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Další informace\"\r\nt IDYES \"Ano\"\r\nt IDNO \"Ne\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Zavřít\"\r\nt IDD_UPDATE_POLICY \"Zásady aktualizací a nastavení\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Nastavení automatických aktualizací\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Kontrolovat\"\r\nt IDS_INCLUDE_BETAS_TXT \"Zahrnout beta verze\"\r\nt IDC_CHECK_NOW \"Zkontrolovat\"\r\n\r\nt MSG_001 \"Zjištěna běžící instance aplikace\"\r\nt MSG_002 \"Program Rufus je již spuštěný.\\nProsím zavřete běžící aplikaci před opětovným spuštěním.\"\r\nt MSG_003 \"VAROVÁNÍ: VŠECHNA DATA NA CÍLOVÉM DISKU %s. BUDOU SMAZÁNA\\nChcete-li pokračovat v této operaci, klikněte na tlačítko OK.\\nPro zrušení klikněte na tlačítko ZRUŠIT.\"\r\nt MSG_004 \"Nastavení automatických aktualizací\"\r\nt MSG_005 \"Chcete povolit online kontrolu aktualizací programu Rufus?\"\r\nt MSG_006 \"Zavřít\"\r\nt MSG_007 \"Zrušit\"\r\nt MSG_008 \"Ano\"\r\nt MSG_009 \"Ne\"\r\nt MSG_010 \"Byly nalezeny chybné bloky\"\r\nt MSG_011 \"Kontrola dokončena:\\n  počet chybných bloků: %d\\n  počet chyb čtení: %d\\n  počet chyb při zápisu: %d\\n  počet zjištěných poškození: %d\"\r\nt MSG_012 \"%s\\nPodrobnější zprávu najdete zde:\\n%s\"\r\nt MSG_013 \"Zakázáno\"\r\nt MSG_014 \"Denně\"\r\nt MSG_015 \"Týdně\"\r\nt MSG_016 \"Měsíčně\"\r\nt MSG_017 \"Vlastní\"\r\nt MSG_018 \"Vaše verze: %d.%d (Build %d)\"\r\nt MSG_019 \"Poslední verze: %d.%d (Build %d)\"\r\nt MSG_020 \"bajtů\"\r\nt MSG_026 \"bajtů\"\r\nt MSG_027 \"kilobajtů\"\r\nt MSG_028 \"megabajtů\"\r\nt MSG_029 \"Výchozí\"\r\nt MSG_030 \"%s (Výchozí)\"\r\nt MSG_031 \"BIOS (UEFI-CSM)\"\r\nt MSG_032 \"UEFI (ne CSM)\"\r\nt MSG_033 \"BIOS nebo UEFI\"\r\nt MSG_034 \"%d pokus\"\r\nt MSG_035 \"%d pokusy %s\"\r\nt MSG_036 \"Obraz ISO\"\r\nt MSG_037 \"Aplikace\"\r\nt MSG_038 \"Přerušit\"\r\nt MSG_039 \"Spustit\"\r\nt MSG_040 \"Stažení\"\r\nt MSG_041 \"Operace byla přerušena uživatelem\"\r\nt MSG_042 \"Chyba\"\r\nt MSG_043 \"Chyba: %s\"\r\nt MSG_044 \"Stažení souboru\"\r\nt MSG_045 \"Zařízení USB (Obecné)\"\r\nt MSG_047 \"Více diskových oddílů\"\r\nt MSG_048 \"Rufus - Čištění vyrovnávací paměti\"\r\nt MSG_049 \"Rufus - Ukončení\"\r\nt MSG_050 \"Hotovo.\"\r\nt MSG_051 \"Neznámá chyba během formátování.\"\r\nt MSG_052 \"Zvolený souborový systém nelze pro toto zařízení použít.\"\r\nt MSG_053 \"Přístup k zařízení byl odmítnut.\"\r\nt MSG_054 \"Zařízení je chráněno proti zápisu.\"\r\nt MSG_055 \"Zařízení je používáno jiným procesem. Ukončete prosím všechny procesy, které mohou přistupovat k zařízení.\"\r\nt MSG_056 \"Rychlé formátování není pro toto zařízení dostupné.\"\r\nt MSG_057 \"Neplatný název svazku.\"\r\nt MSG_058 \"Neplatný identifikátor zařízení.\"\r\nt MSG_059 \"Zvolená velikost alokační jednotky není platná pro toto zařízení.\"\r\nt MSG_060 \"Velikost svazku je neplatná.\"\r\nt MSG_061 \"Vložte vyměnitelné zařízení.\"\r\nt MSG_062 \"Obdržen nepodporovaný příkaz.\"\r\nt MSG_063 \"Chyba při přidělení paměti.\"\r\nt MSG_064 \"Chyba čtení.\"\r\nt MSG_065 \"Chyba zápisu.\"\r\nt MSG_066 \"Instalace selhala\"\r\nt MSG_067 \"Není možné otevřít zařízení. Zřejmě je používáno jiným procesem. Odpojte a opět připojte zařízení a zkuste to znovu.\"\r\nt MSG_068 \"Disk nelze rozdělit.\"\r\nt MSG_069 \"Kopírování souborů na cílový disk se nezdařilo.\"\r\nt MSG_070 \"Zrušeno uživatelem.\"\r\nt MSG_071 \"Nelze spustit vlákno.\"\r\nt MSG_072 \"Kontrola chybných bloků nebyla dokončena.\"\r\nt MSG_073 \"Analýza ISO obrazu selhala.\"\r\nt MSG_074 \"Rozbalovaní ISO obrazu selhalo.\"\r\nt MSG_075 \"Není možné znovu připojit svazek.\"\r\nt MSG_076 \"Není možné opravit/instalovat soubory pro spouštění počítače.\"\r\nt MSG_077 \"Není možné přiřadit písmeno jednotky.\"\r\nt MSG_078 \"Není možné pripojit GUID svazek.\"\r\nt MSG_079 \"Zařízení není připraveno.\"\r\nt MSG_080 \"Program Rufus zjistil, že Windows stále čistí interní vyrovnávací paměť na USB zařízení.\\n\\nDokončení této operace může trvat dlouho, v závislosti na rychlosti Vašeho USB zařízení, zvláště u velkých souborů.\\n\\nDoporučujeme nechat Windows dokončit akci, zabráníte tak poškození dat. Pokud už nechcete dále čekat, můžete zařízení odpojit...\"\r\nt MSG_081 \"Nepodporovaný obraz\"\r\nt MSG_082 \"Obraz není bootovací, nebo používá metodu spuštění nebo kompresi, která není podporován Rufusem...\"\r\nt MSG_083 \"Nahradit %s?\"\r\nt MSG_084 \"Zdá se, že tento ISO obraz používá zastaralou verzi '%s'.\\nNabídka boot systému se proto nemusí zobrazovat správně.\\n\\nRufus může odstranit tento problém stažením nové verze:\\n- Zvolte 'Ano' pro připojení na Internet a stažení souboru\\n- Zvolte 'Ne' pro ponechání stávajícího ISO souboru beze změny\\nPokud nevíte, co máte udělat, zvolte 'Ano'.\\n\\nPoznámka: Nový soubor %s bude stažen do aktuální složky pro opětovné automatické použití.\"\r\nt MSG_085 \"Staženo %s\"\r\nt MSG_086 \"Nebyl zvolen žádný obraz disku\"\r\nt MSG_087 \"pro %s NAND\"\r\nt MSG_088 \"Obraz disku je příliš velký\"\r\nt MSG_089 \"Obraz disku je příliš velký pro zvolený cíl.\"\r\nt MSG_090 \"Nepodporovaný ISO obraz\"\r\nt MSG_091 \"Při zvolení cílového systému typu UEFI jsou podporování jen ISO obrazy spustitelné pomocí EFI. Vyberte spustitelný EFI ISO obraz nebo nastavte cílový typ systému v BIOSu.\"\r\nt MSG_092 \"Nepodporovaný souborový systém\"\r\nt MSG_093 \"DŮLEŽITÉ: TOTO ZAŘÍZENÍ OBSAHUJE NĚKOLIK ODDÍLŮ!!\\n\\nZařízení může obsahovat oddíly nebo svazky, které nejsou zobrazeny, případně nejsou ani viditelné pro Windows. Pokud přesto chcete pokračovat, nesete odpovědnost za ztrátu veškerých dat na těchto oddílech.\"\r\nt MSG_094 \"Bylo zjištěno více oddílů\"\r\nt MSG_095 \"Obraz DD\"\r\nt MSG_096 \"Aktuálně vybraný souborový systém nelze použít u tohoto typu ISO. Prosím, vyberte jiný souborový systém, nebo použijte jiné ISO.\"\r\nt MSG_097 \"'%s' lze použít pouze v případě, že souborový systém je NTFS.\"\r\nt MSG_098 \"DŮLEŽITÉ: Pokoušíte se nainstalovat 'Přenosný systém Windows', ale váš cílový disk má 'PEVNÝ' atribut. Vzhledem k tomuto systému Windows bude s největší pravděpodobností zamrzat během spouštění, Microsoft nepodporuje práce s 'VYMĚNITELNÝMI' disky, které mají tento atribut.\\n\\npřesto chcete pokračovat?\\n\\nPoznámka: 'PEVNÝ/VYMĚNITELNÝ' atribut má hardwarové vlastnosti, které lze změnit pouze pomocí vlastních nástrojů od výrobce disku. Nicméně tyto nástroje nejsou NIKDY poskytovány veřejnosti...\"\r\nt MSG_099 \"Omezení souborového systému\"\r\nt MSG_100 \"Tento obraz ISO obsahuje soubor větší než 4 GB, což je více než maximální povolená velikost pro systém souborů FAT nebo FAT32.\"\r\nt MSG_101 \"Chybí podpora WIM\"\r\nt MSG_102 \"Váš systém neumí rozbalit soubory z WIM archivu. Rozbalení WIM je nutné k vytvoření USB disků Windows 7 a Windows Vista spustitelných pomocí EFI. Problém lze vyřešit nainstalováním aktuální verze programu 7-Zip.\\nChcete přejít na stránku pro stažení 7-Zip?\"\r\nt MSG_103 \"Stáhnout %s?\"\r\nt MSG_104 \"%s nebo vyšší vyžaduje instalaci souboru %s.\\nProtože tento soubor je větší než 100 KB a vždy je součástí %s ISO obrazu, není součástí programu Rufus.\\n\\nProgram Rufus může chybějící soubor stáhnout za Vás:\\n- Zvolte 'Ano' pro připojení na internet a stažení souboru\\n- Zvolte 'Ne' pokud chcete tento soubor na disk později zkopírovat ručně\\n\\nPoznámka: Soubor %s bude stažen do aktuální složky pro opětovné automatické použití.\"\r\nt MSG_105 \"Po zrušení akce bude zařízení v NEPOUŽITELNÉM stavu.\\nPokud jste si jisti, že chcete akci zrušit, klepněte na ANO. V opačném případě klepněte na NE.\"\r\nt MSG_106 \"Prosím vyberte složku\"\r\nt MSG_107 \"Všechny soubory\"\r\nt MSG_108 \"Záznam programu Rufus\"\r\nt MSG_110 \"MS-DOS nelze spustit z disku používajícího alokační jednotku o velikostí 64KB.\\nZměňte velikost alokační jednotky nebo použijte FreeDOS.\"\r\nt MSG_111 \"Nekompatibilní velikost alokační jednotky\"\r\nt MSG_112 \"Formátování velkých UDF svazků může trvat delší čas. Při rychlosti USB 2.0 bude formátování trvat přibližně %d:%02d, ukazatel průběhu operace je během formátování zdánlivě nefunkční. Buďte trpělivý!\"\r\nt MSG_113 \"Velký UDF svazku\"\r\nt MSG_114 \"Tento obraz používá Syslinux %s%s, tato aplikace však obsahuje pouze instalační soubory pro Syslinux %s%s.\\n\\nJelikož nové verze Syslinux nejsou vzájemně kompatibilní a není možné v programu Rufus zahrnout všechny verze, je nutné z Internetu stáhnout dodatečné dva soubory (ldlinux.sys a ldlinux.bss):\\n- Zvolte 'Ano' pro stažení souborů z Internetu\\n- Zvolte 'Ne' pro zrušení operace\\n\\nPoznámka: Soubory budou staženy do aktuální složky programu pro opětovné automatické použití.\"\r\nt MSG_115 \"Nutné stažení souborů\"\r\nt MSG_116 \"Tento obraz používá Grub %s ale aplikace obsahuje pouze instalační soubory Grub %s.\\n\\nVzhledem k různým verzím Grub nemusí být kompatibilní mezi sebou, Není možné je mít všechny, Rufus se pokusí najít verzi Grub instalace souboru ('core.img') který odpovídá vaší image:\\n- Vybrat 'Ano' připojit k internetu a pokusit se stáhnout\\n- Vybrat 'Ne' použít výchozí verzi z Rufus\\n- Vybrat 'Zrušit' pro zrušení operace\\n\\nPoznámka: Soubor se stáhne do aktuální složky aplikace a bude použit automaticky, pokud je přítomen. Není-li shoda k dispozici online, pak bude použita standardní verze.\"\r\nt MSG_117 \"Standardní instalace systému Windows\"\r\nt MSG_119 \"pokročilé vlastnosti disku\"\r\nt MSG_120 \"pokročilé možnosti formátování\"\r\nt MSG_121 \"Zobrazit %s\"\r\nt MSG_122 \"Skrýt %s\"\r\nt MSG_123 \"Velikost trvalého oddílu\"\r\nt MSG_124 \"Ne trvalý\"\r\nt MSG_125 \"Nastavte velikost trvalého oddílu pro živá média USB. Nastavení velikosti 0 zakáže trvalý oddíl.\"\r\nt MSG_126 \"Nastavení velikosti jednotky.\"\r\nt MSG_127 \"Příště zprávu nezobrazovat\"\r\nt MSG_128 \"Důležité upozornění o %s\"\r\nt MSG_129 \"Vytvořili jste médium, které používá zavaděč UEFI: NTFS. Pamatujte, že pro zavedení tohoto média MUSÍTE VYPNOUT SECURE BOOT.\\nPodrobnosti o tom, proč je to nutné, naleznete níže v části „Další informace“.\"\r\nt MSG_130 \"Vybrat obrazu systému Windows\"\r\nt MSG_131 \"ISO obsahuje více obrazů Windows..\\nVyberte prosím obraz, který chcete použít pro tuto instalaci:\"\r\nt MSG_132 \"K tomuto disku přistupuje jiný program nebo proces. Chcete ho přesto formátovat?\"\r\nt MSG_133 \"Rufus zjistil, že se pokoušíte vytvořit Windows To Go médií založené na 1809 ISO.\\n\\nVzhledem k tomu, že *MICROSOFT BUG*, toto médium se při spouštění systému Windows zhroutí (Blue Screen), pokud soubor „WppRecorder.sys“ ručně nenahradíte verzí 1803.\\n\\nDůvodem proč Rufus nemůže automaticky opravit, je, že soubor „WppRecorder.sys“ je souborem chráněným autorskými právy společnosti Microsoft, takže nemůžeme legálně vložit kopii souboru do aplikace...\"\r\nt MSG_134 \"Pro schéma oddílu byla vybráno MBR, Rufus na tomto médiu vytvořit pouze oddíl o velikosti až 2 TB, což ponechá místo na disku %s nedostupné.\\n\\nJste si jistý, že chcete pokračovat?\"\r\nt MSG_135 \"Verze\"\r\nt MSG_136 \"Vydání\"\r\nt MSG_137 \"Edice\"\r\nt MSG_138 \"Jazyk\"\r\nt MSG_139 \"Architektura\"\r\nt MSG_140 \"Pokračovat\"\r\nt MSG_141 \"Zpět\"\r\nt MSG_142 \"Počkejte prosím...\"\r\nt MSG_143 \"Stáhnout pomocí prohlížeče\"\r\nt MSG_144 \"Stahování ISO systému Windows je nedostupné, protože společnost Microsoft změnila své webové stránky, aby tomu zabránila.\"\r\nt MSG_145 \"Pro spuštění skriptu je nutná verze PowerShell 3.0 nebo novější.\"\r\nt MSG_146 \"Chcete přejít do režimu online a stáhnout ji?\"\r\nt MSG_148 \"Spuštění skriptu pro stahování ...\"\r\nt MSG_149 \"Stáhnout obraz ISO\"\r\nt MSG_150 \"Typ počítače, ve kterém chcete tuto zaváděcí jednotku používat. Je nutné zjistit zda cílové zařízení má klasický BIOS nebo UEFI, zadejte při vytváření media jinak nepůjde správně zavést.\"\r\nt MSG_151 \"'UEFI-CSM' znamená, že zařízení bude spouštěno pouze v režimu emulace systému BIOS (také známý jako 'Legacy Mode') pod UEFI, a ne v nativním UEFI modu.\"\r\nt MSG_152 \"'non CSM' znamená to, že zařízení bude startovat pouze v nativním UEFI modu, ne v BIOS emulaci režimu (také známý jako 'Legacy Mode').\"\r\nt MSG_153 \"Zkušební vzorek: 0x%02X\"\r\nt MSG_154 \"Zkušební vzorek: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Zkušební vzorek: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Zkušební vzorek: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Nastaví cílový souborový systém\"\r\nt MSG_158 \"Minimální velikost, kterou zabere blok dat v souborovém systému\"\r\nt MSG_159 \"Pokud chcete nastavit jmenovku svazku, vyplňte pole.\\nJsou podporované i mezinárodní znaky.\"\r\nt MSG_160 \"Přepnout pokročilá nastavení\"\r\nt MSG_161 \"Zkontrolovat zařízení na přítomnost chybných\\nbloků použitím zkušebního vzorku\"\r\nt MSG_162 \"Odškrtnutím použijete pomalou metodu formátování\"\r\nt MSG_163 \"Metoda, která bude použita k vytváření oddílů\"\r\nt MSG_164 \"Vyberte metodu, která bude použitá k vytvoření boot zařízení\"\r\nt MSG_165 \"Kliknutím vyberte nebo stáhněte obraz...\"\r\nt MSG_166 \"Povolíte v názvu disku zobrazení mezinárodních znaků a vytvoření ikony zařízení (vytvořením souboru autorun.inf)\"\r\nt MSG_167 \"Nainstalujte zavaděč UEFI, který provede ověření souboru MD5Sum na médiu\"\r\nt MSG_169 \"Vytvořit další skryté oddíly a pokusí se o zarovnání oddílů.\\nToto nastavení může zlepšit detekci spustitelného zařízení pro starší BIOS.\"\r\nt MSG_170 \"Zobrazí pevné disky a USB. !!!POUŽITÍ NA VLASTNÍ RIZIKO!!!\"\r\nt MSG_171 \"Klepnutím spustíte formátování.\\nFORMÁTOVANÍM SE ODSTRANÍ VEŠKERÁ DATA NA CÍLOVÉM ZAŘÍZENÍ!\"\r\nt MSG_172 \"Neplatný podpis stažení\"\r\nt MSG_173 \"Kliknutím zvolit...\"\r\nt MSG_174 \"Rufus - Spolehlivý program pro formátování USB\"\r\nt MSG_175 \"Verze %d.%d (Build %d)\"\r\nt MSG_176 \"Čeština: Richard Kahl <mailto:richard.kahl@seznam.cz>\"\r\nt MSG_177 \"Nahlášení chyb nebo námětů pro zlepšení programu:\"\r\nt MSG_178 \"Další licenční informace:\"\r\nt MSG_179 \"Zásady aktualizace:\"\r\nt MSG_180 \"Pokud povolíte tomuto programu kontrolu aktualizací, souhlasíte s tím, že naše servery mohou shromažďovat následující údaje:\"\r\nt MSG_181 \"Architektura vašeho operačního systému a jeho verzi\"\r\nt MSG_182 \"Použitá verze aplikace Rufus\"\r\nt MSG_183 \"Vaši IP adresa\"\r\nt MSG_184 \"Pro účely vytváření neveřejných statistik používání programu můžeme uchovávat tyto shromážděné údaje, a to \\\\b nejvýše po dobu jednoho roku\\\\b0 . Žádný z těchto jednotlivých údajů však dobrovolně nepředáme třetí osobě.\"\r\nt MSG_185 \"Aktualizační proces:\"\r\nt MSG_186 \"Rufus neinstaluje ani nespouští služby na pozadí. Kontrola aktualizací proto probíhá pouze v případě, kdy je spuštěna hlavní aplikace.\\\\line\\nPro kontrolu aktualizací programu je samozřejmě nutný přístup k Internetu.\"\r\nt MSG_187 \"Neplatný obraz pro zvolené nastavení zavaděče\"\r\nt MSG_188 \"Aktuální obraz neodpovídá zvolenému nastavení spouštěcího disku. Použijte jiný obraz nebo změňte nastavení.\"\r\nt MSG_189 \"Tento ISO obraz není kompatibilní s vybraným souborovým systémem\"\r\nt MSG_190 \"Rozpoznán nekompatibilní disk\"\r\nt MSG_191 \"Zapsat průchod\"\r\nt MSG_192 \"Přečíst průchod\"\r\nt MSG_193 \"Staženo %s\"\r\nt MSG_194 \"Nelze stáhnout %s\"\r\nt MSG_195 \"Pomocí integrované verze %s soubor(s)\"\r\nt MSG_196 \"DŮLEŽITÉ: TATO JEDNOTKA POUŽÍVÁ NESTANDARTNÍ VELIKOS SEKTORŮ!\\n\\nBěžné disky používají 512-byte velikost sektorů jednotka používá %d-byte one. V mnoha případech to znamená, že nebudete moci zavádět systém z jednotky.\\nRufus můžete zkusit vytvořit bootovací jednotku, ale neexistuje žádná záruka, že to bude fungovat.\"\r\nt MSG_197 \"Zjištěna Nestandartní velikost sektorů\"\r\nt MSG_198 \"'Přenosný Windows' lze nainstalovat pouze na GPT oddíl, nastavte PEVNÝ atribut. Aktuální jednotka nebyla detekována jako PEVNÁ.\"\r\nt MSG_199 \"Tato funkce není na této platformě k dispozici.\"\r\nt MSG_201 \"Ukončuje se operace - čekejte...\"\r\nt MSG_202 \"Analýza obrazu disku...\"\r\nt MSG_203 \"Analýza obrazu selhala\"\r\nt MSG_204 \"Zjištěn zastaralý modul: %s\"\r\nt MSG_205 \"Použitý obraz: %s\"\r\nt MSG_206 \"Chybějící soubor: %s\"\r\nt MSG_207 \"Nový svazek\"\r\nt MSG_208 \"Bylo nalezeno %d zařízení\"\r\nt MSG_209 \"Bylo nalezeno %d zařízení\"\r\nt MSG_210 \"PŘIPRAVEN\"\r\nt MSG_211 \"ZRUŠENO\"\r\nt MSG_212 \"NEZDAŘILO SE\"\r\nt MSG_213 \"Spuštění nové verze programu...\"\r\nt MSG_214 \"Spuštění nové verze programu se nezdařilo\"\r\nt MSG_215 \"Otevřený soubor: %s\"\r\nt MSG_216 \"Uložený soubor: %s\"\r\nt MSG_217 \"Formátování: %s\"\r\nt MSG_218 \"Vytváření souborového systému: úloha %d/%d dokončena\"\r\nt MSG_219 \"Oprava NTFS: %d%% dokončeno\"\r\nt MSG_220 \"Formátování (%s) - zbývající čas: %d:%02d...\"\r\nt MSG_221 \"Nastavení jmenovky (%s)...\"\r\nt MSG_222 \"Formátování (%s)...\"\r\nt MSG_223 \"Oprava NTFS (Kontrola disku)...\"\r\nt MSG_224 \"Odstranění MBR/PBR/GPT struktury...\"\r\nt MSG_225 \"Požadavek na přístup na disk...\"\r\nt MSG_226 \"Analyzování stávajících zaváděcích záznamů...\"\r\nt MSG_227 \"Uzavření stávajícího svazku...\"\r\nt MSG_228 \"Zápis hlavního spouštěcího záznamu...\"\r\nt MSG_229 \"Zapisování spouštěcího záznamu oddílu...\"\r\nt MSG_230 \"Kopírování DOS souborů...\"\r\nt MSG_231 \"Kopírování ISO souborů: %s\"\r\nt MSG_232 \"Nastavení Win7 EFI režimu boot (%s)...\"\r\nt MSG_233 \"Dokončování, čekejte...\"\r\nt MSG_234 \"Instaluje se Syslinux %s...\"\r\nt MSG_235 \"Chybné bloky: %s %d/%d - %0.2f%% (%d/%d/%d Chyby)\"\r\nt MSG_236 \"Chybné bloky: Testovaní s náhodným vzorkem\"\r\nt MSG_237 \"Chybné bloky: Testovaní se vzorkem 0x%02X\"\r\nt MSG_238 \"Vytváření oddílů (%s)...\"\r\nt MSG_239 \"Odstraňování oddílů (%s)...\"\r\nt MSG_240 \"Podpis stažené aktualizace nelze ověřit. To může znamenat, že systém je nesprávně nakonfigurován pro ověření podpisu nebo označil stažený soubor jako škodlivý.\\n\\nStahování bude smazáno. Zkontrolujte podrobnosti v protokolu.\"\r\nt MSG_241 \"Stahování: %s\"\r\nt MSG_242 \"Stažení souboru se nezdařilo.\"\r\nt MSG_243 \"Kontrola aktualizací programu Rufus...\"\r\nt MSG_244 \"Aktualizace: Není připojení k Internetu\"\r\nt MSG_245 \"Aktualizace: Údaje o verzi jsou nedostupné\"\r\nt MSG_246 \"Je dostupná nová verze programu Rufus!\"\r\nt MSG_247 \"Nebyla nalezena nová verze programu\"\r\nt MSG_248 \"Klíče registrů aplikace byly úspěšně odstraněny\"\r\nt MSG_249 \"Odstraněné klíčů registrů aplikace se nezdařilo\"\r\nt MSG_250 \"%s: povoleno\"\r\nt MSG_251 \"%s: zakázáno\"\r\nt MSG_252 \"Kontrola velikosti\"\r\nt MSG_253 \"Detekce HDD\"\r\nt MSG_254 \"Vynutit formátování velkého FAT32 oddílu\"\r\nt MSG_255 \"NoDriveTypeAutorun bude při ukončení odstraněn\"\r\nt MSG_256 \"Zjištěna emulovaná jednotka\"\r\nt MSG_257 \"Joliet podpora\"\r\nt MSG_258 \"Rock Ridge podpora\"\r\nt MSG_259 \"Vynutit aktualizaci\"\r\nt MSG_260 \"NTFS komprese\"\r\nt MSG_261 \"Zápis obrazu: %s\"\r\nt MSG_262 \"ISO podpora\"\r\nt MSG_263 \"Použit BINÁRNÍ předpony jednotek\"\r\nt MSG_264 \"Odstranění adresář '%s'\"\r\nt MSG_265 \"VMWare detekce disk\"\r\nt MSG_266 \"Dvojí UEFI/BIOS režim\"\r\nt MSG_267 \"Použití obrazu systému Windows: %s\"\r\nt MSG_268 \"Použití Windows obrazu...\"\r\nt MSG_269 \"Zachovat časovou značku\"\r\nt MSG_270 \"USB ladění\"\r\nt MSG_271 \"Výpočet kontrolních součtů obrazů: %s\"\r\nt MSG_272 \"Vypočet MD5, SHA1 a SHA256 kontrolního součty pro vybraný obraz\"\r\nt MSG_273 \"Změna jazyka aplikace\"\r\nt MSG_274 \"%s obraz detekován\"\r\nt MSG_275 \"Obráz, který jste si vybrali, je obraz 'ISO Hybrid'. To znamená, že může být zapsán buď v %s (kopírování souborů) v režimu %s (obraz disku) režim.\\nRufus doporučuje použití %s režim, pokud je plný přístup k jednotce pro zápis.\\nPokud narazíte na problémy při startu, můžete zkusit zapsat tento obraz znovu %s režim.\\n\\nVyberte režim, který chcete použít k zapsání tohoto obrázu:\"\r\nt MSG_276 \"Režim zápisu %s (Doporučená)\"\r\nt MSG_277 \"Režim zápisu %s\"\r\nt MSG_278 \"Kontrola konfliktních procesů...\"\r\nt MSG_279 \"Není boot\"\r\nt MSG_280 \"Disk nebo obraz ISO\"\r\nt MSG_281 \"%s (Prosím vyberte)\"\r\nt MSG_282 \"Uzamčení USB disku\"\r\nt MSG_283 \"Neplatný podpis\"\r\nt MSG_284 \"Schází digitální podpis u staženého programu.\"\r\nt MSG_285 \"Stažený program je podepsán '%s'.\\nTento není jste si vědomi že muže být indikovaná jako škodlivý program...\\nOpravdu chcete spustit tento program?\"\r\nt MSG_286 \"Nulování jednotky: %s\"\r\nt MSG_287 \"Detekce není vložen USB disk\"\r\nt MSG_288 \"Nemáte oprávnění správce\"\r\nt MSG_289 \"Tuto aplikaci lze spustit pouze s oprávněním správce\"\r\nt MSG_290 \"Indexování souborů\"\r\nt MSG_291 \"Výběr verze\"\r\nt MSG_292 \"Vyberte verzi systému Windows kterou chcete nainstalovat:\"\r\nt MSG_293 \"Nepodporovaná verze systému Windows\"\r\nt MSG_294 \"Tato verze systému Windows již není systémem Rufus podporována.\\nPoslední verze systému Rufus kompatibilní s touto platformou je v%d.%d.\"\r\nt MSG_295 \"Upozornění: Neoficiální verze\"\r\nt MSG_296 \"Tato verze Rufus, nebyl nepochází z oficiálního vývoje.\\n\\nJsou si jisti, že ji chcete spustit?\"\r\nt MSG_297 \"Redukované ISO detekováno\"\r\nt MSG_298 \"U vybraného ISO soubor neodpovídá deklarovaná velikost: %s z údajů chybí!\\n\\nPokud jste jej získali z internetu, měli by jste stáhnout novou kopii a ověřt, zda odpovídají kontrolní součty MD5 nebo SHA. oficiálně.\\n\\nPoznámka: Klepnutím na(✓)lze vypočítat MD5 nebo SHA v Rufusu.\"\r\nt MSG_299 \"Chyba ověření časového razítka\"\r\nt MSG_300 \"Rufus nemohl ověřit časové razítko stažené aktualizace, zda je novější než časový údaj minulé aktuální spustitelný soubor.\\n\\nAby se zabránilo možným scénářům útoků, proces aktualizace byl zrušen stahování bude smazáno. Zkontrolujte podrobnosti protokolu.\"\r\nt MSG_301 \"Zobrazit nastavení aplikace\"\r\nt MSG_302 \"Zobrazte informace o této aplikaci\"\r\nt MSG_303 \"Zobrazit protokol\"\r\nt MSG_304 \"Vytvořit obraz disku vybraného zařízení\"\r\nt MSG_305 \"Pomocí této možnosti určete, zda plánujete nainstalovat systém Windows na jiný disk, nebo zda chcete spustit systém Windows přímo z této jednotky (Windows To Go).\"\r\nt MSG_306 \"Rychlé-přepsání jednotky: %s\"\r\nt MSG_307 \"může to chvíli trvat\"\r\nt MSG_308 \"Detekce VHD\"\r\nt MSG_309 \"Komprimovaný archiv\"\r\nt MSG_310 \"Vybraný soubor ISO používá systém UEFI a je dostatečně malý na to, aby mohl být zapsán jako systémový oddíl EFI (ESP). Pro některé typy instalací může být vhodnější zapisovat do ESP místo do obecného datového oddílu zabírajícího celý disk..\\n\\nVyberte režim, který chcete použít pro zápis tohoto obrázku:\"\r\nt MSG_311 \"Use %s (v hlavním okně aplikace) povolit.\"\r\nt MSG_312 \"Další hashe (SHA512)\"\r\nt MSG_313 \"Uložit do VHD\"\r\nt MSG_314 \"Výpočet kontrolních součtů obrazů\"\r\nt MSG_315 \"Více tlačítek\"\r\nt MSG_316 \"Počet průchodů\"\r\nt MSG_318 \"Výchozí priorita vlákna: %d\"\r\nt MSG_319 \"Ignorovat Boot Marker\"\r\nt MSG_320 \"Obnovení rozložení oddílu (%s)...\"\r\nt MSG_321 \"Vybraný obraz je ISOHybrid, ale jeho tvůrci ho neudělali kompatibilní s režimem kopírování ISO/File..\\nV důsledku toho bude vynucen režim zápisu obrázků DD.\"\r\nt MSG_322 \"Nelze otevřít nebo přečíst soubor '%s'\"\r\nt MSG_325 \"Použití přizpůsobení systému Windows: %s\"\r\nt MSG_326 \"Použití uživatelských možností...\"\r\nt MSG_327 \"Uživatelské prostředí systému Windows\"\r\nt MSG_328 \"Přizpůsobení instalace systému Windows?\"\r\nt MSG_329 \"Odstranění požadavku na více než 4 GB RAM, Secure Boot a TPM 2.0\"\r\nt MSG_330 \"Odstranění požadavku na online účet Microsoft\"\r\nt MSG_331 \"Zakázat sběr dat (Přeskočit otázky týkající se ochrany osobních údajů)\"\r\nt MSG_332 \"Zabránění přístupu systému Windows To Go k interním diskům\"\r\nt MSG_333 \"Vytvořte místní účet s uživatelským jménem:\"\r\nt MSG_334 \"Nastavení regionálních voleb na stejné hodnoty jako u tohoto uživatele\"\r\nt MSG_335 \"Zakázání automatického šifrování zařízení nástrojem BitLocker\"\r\nt MSG_336 \"Trvalý protokol\"\r\nt MSG_337 \"Pro použití této funkce je nutné stáhnout další soubor ('%s') od společnosti Microsoft::\\n- Vyberte 'Ano' pro připojení k internetu a stažení\\n- Výběrem možnosti \\\"Ne\\\" operaci zrušíte\\n\\nPoznámka: Soubor bude stažen do adresáře aplikace a bude automaticky znovu použit, pokud je přítomen.\"\r\nt MSG_338 \"Byl zjištěn odvolaný zavaděč UEFI\"\r\nt MSG_339 \"Rufus zjistil, že vámi vybraný ISO obsahuje zavaděč UEFI, který byl odvolán a který vytvoří %s, když je v plně aktuálním systému UEFI povoleno Secure Boot.\\n\\n- Pokud jste tento obraz ISO získali z nerenomovaného zdroje, měli byste zvážit možnost, že by mohl obsahovat malware UEFI a vyhnout se bootování z něj.\\n- Pokud jste jej získali z důvěryhodného zdroje, měli byste se pokusit najít aktuálnější verzi, která toto varování nevyvolá.\"\r\nt MSG_340 \"obrazovka \\\"Porušení zabezpečení\\\"\"\r\nt MSG_341 \"a Obrazovka zotavení systému Windows (BSOD) s '%s'\"\r\nt MSG_342 \"Komprimovaný obraz VHDX\"\r\nt MSG_343 \"Nekomprimovaný obraz VHD\"\r\nt MSG_344 \"Úplná aktualizace Flash Image\"\r\nt MSG_345 \"K použití této funkce je třeba stáhnout některá další data od společnosti Microsoft:\\n- Vyberte 'Ano' pro připojení k internetu a stažení\\n- Výběrem možnosti \\\"Ne\\\" operaci zrušíte\"\r\nt MSG_346 \"Omezit Windows na S-Mode (NEKOMPATIBILNÍ s online vynecháním účtu)\"\r\nt MSG_347 \"Expertní režim\"\r\nt MSG_348 \"Rozbalení archivních souborů: %s\"\r\nt MSG_349 \"Použijte Rufus MBR\"\r\nt MSG_900 \"Rufus je nástroj, který pomáhá formátovat a vytvářet bootovací USB flash disky, jako jsou USB klíče, paměťové karty atd.\"\r\nt MSG_901 \"Oficiální stránky: %s\"\r\nt MSG_902 \"Zdrojový kód: %s\"\r\nt MSG_903 \"Protokol změn: %s\"\r\nt MSG_904 \"Tato aplikace je licencována podle podmínek GNU Public License (GPL) verze 3.\\nPodrobnosti naleznete na adrese https://www.gnu.org/licenses/gpl-3.0.html.\"\r\nt MSG_910 \"Formátování USB, flash karet a virtuálních jednotek na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Vytvoření bootovacích disků USB se systémem FreeDOS\"\r\nt MSG_912 \"Vytváření bootovacích jednotek ze zaváděcích ISO (Windows, Linux atd.)\"\r\nt MSG_913 \"Vytváření zaváděcích jednotek ze zaváděcích obrazů disků, včetně komprimovaných\"\r\nt MSG_914 \"Vytvořte zaváděcí jednotky BIOS nebo UEFI, včetně zaváděcích souborů NTFS UEFI\"\r\nt MSG_915 \"Vytvoření jednotek \\\"Windows To Go\"\r\nt MSG_916 \"Vytvoření instalačních jednotek systému Windows 11 pro počítače bez čipu TPM nebo Secure Boot\"\r\nt MSG_917 \"Vytvoření trvalých oddílů systému Linux\"\r\nt MSG_918 \"Vytvoření obrazů VHD/DD z vybrané jednotky\"\r\nt MSG_919 \"Výpočet kontrolních součtů MD5, SHA-1, SHA-256 a SHA-512 vybraného obrazu\"\r\nt MSG_920 \"Provést kontrolu vadných bloků, včetně detekce \\\"falešných\\\" bloků. flash disky\"\r\nt MSG_921 \"Stažení oficiálních souborů ISO systému Microsoft Windows\"\r\nt MSG_922 \"Stažení souborů UEFI Shell ISO\"\r\n\r\n#########################################################################\r\nl \"da-DK\" \"Danish (Dansk)\" 0x0406\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Om Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licens\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Drev Indstillinger\"\r\nt IDS_DEVICE_TXT \"Enhed\"\r\nt IDS_BOOT_SELECTION_TXT \"Opstartstype\"\r\nt IDC_SELECT \"Valg\"\r\nt IDS_IMAGE_OPTION_TXT \"Installationstype\"\r\nt IDS_PARTITION_TYPE_TXT \"Partitionstype\"\r\nt IDS_TARGET_SYSTEM_TXT \"Målsystem\"\r\nt IDC_LIST_USB_HDD \"Vis USB-harddiske\"\r\nt IDC_OLD_BIOS_FIXES \"Tilføj rettelser for ældre BIOS'er\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Slå runtime UEFI medie validering til\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Formateringsindstillinger\"\r\nt IDS_FILE_SYSTEM_TXT \"Filsystem\"\r\nt IDS_CLUSTER_SIZE_TXT \"Klyngestørrelse\"\r\nt IDS_LABEL_TXT \"Volume-etiket\"\r\nt IDC_QUICK_FORMAT \"Ekspresformatering\"\r\nt IDC_BAD_BLOCKS \"Søg efter fejlbehæftede blokke\"\r\nt IDC_EXTENDED_LABEL \"Brug udvidet etiket og ikon-filer\"\r\nt IDCANCEL \"Afslut\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Afslut\"\r\nt IDD_LICENSE \"Rufus Licens\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Afslut\"\r\nt IDC_LOG_CLEAR \"Slet\"\r\nt IDC_LOG_SAVE \"Gem\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Afslut\"\r\nt IDD_NEW_VERSION \"Søg efter opdateringer - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"En nyere version er tilgængelig. Download seneste version!\"\r\nt IDC_WEBSITE \"Klik her for at gå til hjemmesiden\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Programinformation\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Hent\"\r\nt IDC_DOWNLOAD \"Hent\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Mere information\"\r\nt IDYES \"Ja\"\r\nt IDNO \"Nej\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Afslut\"\r\nt IDD_UPDATE_POLICY \"Opdateringspolitik og indstillinger\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Indstillinger\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Søg efter opdateringer\"\r\nt IDS_INCLUDE_BETAS_TXT \"Inkluder betaversioner\"\r\nt IDC_CHECK_NOW \"Søg nu\"\r\n\r\nt MSG_001 \"Anden instans opdaget\"\r\nt MSG_002 \"En anden Rufus applikation kører allerede.\\nAfslut venligst den første instans af Rufus inden du starter en ny.\"\r\nt MSG_003 \"ADVARSEL: AL DATA PÅ '%s' VIL FORSVINDE.\\n\\nKlik 'OK' for at fortsætte. Klik 'Annuller' for at fortryde.\"\r\nt MSG_004 \"Rufus opdateringspolitik\"\r\nt MSG_005 \"Giver du tilladelse til at Rufus søger efter opdateringer online?\"\r\nt MSG_006 \"Afslut\"\r\nt MSG_007 \"Annuller\"\r\nt MSG_008 \"Ja\"\r\nt MSG_009 \"Nej\"\r\nt MSG_010 \"Fejlbehæftede blokke fundet\"\r\nt MSG_011 \"Kontrol færdig: %d fejlbehæftede blokke fundet\\n  %d læsefejl\\n  %d skrivefejl\\n  %d korruptionsfejl\"\r\nt MSG_012 \"%s\\nEn mere detaljeret rapport kan findes i:\\n%s\"\r\nt MSG_013 \"Deaktiveret\"\r\nt MSG_014 \"Dagligt\"\r\nt MSG_015 \"Ugentligt\"\r\nt MSG_016 \"Månedligt\"\r\nt MSG_017 \"Tilpasset\"\r\nt MSG_018 \"Din version: %d.%d (Build %d)\"\r\nt MSG_019 \"Seneste version: %d.%d (Build %d)\"\r\nt MSG_020 \"byte\"\r\nt MSG_026 \"byte\"\r\nt MSG_027 \"kilobyte\"\r\nt MSG_028 \"megabyte\"\r\nt MSG_029 \"Standard\"\r\nt MSG_030 \"%s (standard)\"\r\nt MSG_031 \"BIOS (eller UEFI-CSM)\"\r\nt MSG_032 \"UEFI (ikke CSM)\"\r\nt MSG_033 \"BIOS eller UEFI\"\r\nt MSG_034 \"%d gennemløb\"\r\nt MSG_035 \"%d gennemløb %s\"\r\nt MSG_036 \"ISO-image\"\r\nt MSG_037 \"Applikation\"\r\nt MSG_038 \"Annuller\"\r\nt MSG_039 \"Kør\"\r\nt MSG_040 \"Hent\"\r\nt MSG_041 \"Operation afbrudt af brugeren\"\r\nt MSG_042 \"Fejl\"\r\nt MSG_043 \"Fejl: %s\"\r\nt MSG_044 \"Filhentning\"\r\nt MSG_045 \"USB-lagerenhed (generisk)\"\r\nt MSG_047 \"Flere partitioner\"\r\nt MSG_048 \"Rufus - tømmer buffere\"\r\nt MSG_049 \"Rufus - annullerer\"\r\nt MSG_050 \"Succes.\"\r\nt MSG_051 \"Ukendt fejl under formatering.\"\r\nt MSG_052 \"Kan ikke benytte det valgte filsystem for dette medie.\"\r\nt MSG_053 \"Adgang til enheden blev nægtet.\"\r\nt MSG_054 \"Mediet er skrivebeskyttet.\"\r\nt MSG_055 \"Enheden er i brug af en anden proces. Afslut venligst enhver anden proces der kan have låst enheden.\"\r\nt MSG_056 \"Ekspresformatering er ikke tilgængelig for denne enhed.\"\r\nt MSG_057 \"Volume-etiketten er ugyldig.\"\r\nt MSG_058 \"Enhedshandle er ugyldig.\"\r\nt MSG_059 \"Den valgte klyngestørrelse er ikke gyldig for denne enhed.\"\r\nt MSG_060 \"Den valgte volumestørrelse er ugyldig.\"\r\nt MSG_061 \"Indsæt venligst et flytbart medie i drevet.\"\r\nt MSG_062 \"En ikke understøttet kommando blev modtaget.\"\r\nt MSG_063 \"Fejl ved allokering af hukommelse.\"\r\nt MSG_064 \"Læsefejl.\"\r\nt MSG_065 \"Skrivefejl.\"\r\nt MSG_066 \"Installationsfejl\"\r\nt MSG_067 \"Kan ikke åbne medie. Det kan være i brug af en anden proces. Fjern og genindsæt mediet.\"\r\nt MSG_068 \"Der kunne ikke partitioneres drev.\"\r\nt MSG_069 \"Kunne ikke kopiere filer til destinationsdrevet.\"\r\nt MSG_070 \"Afbrudt af bruger.\"\r\nt MSG_071 \"Ikke i stand til at starte tråd.\"\r\nt MSG_072 \"Søgning efter fejlbehæftede blokke blev ikke fuldført.\"\r\nt MSG_073 \"Fejl ved scanning af ISO-image.\"\r\nt MSG_074 \"Fejl ved udpakning af ISO-image.\"\r\nt MSG_075 \"Kan ikke genmontere volumen.\"\r\nt MSG_076 \"Kan ikke installere boot-filer.\"\r\nt MSG_077 \"Kan ikke tildele drevbogstav.\"\r\nt MSG_078 \"Kan ikke montere GUID-volumen.\"\r\nt MSG_079 \"Enheden er ikke parat.\"\r\nt MSG_080 \"Rufus har opdaget, at Windows stadig tømmer sine interne buffere til USB-enheden.\\n\\nAfhængig af hastigheden på din USB-enhed, kan denne operation tage lang tid at gennemføre, især for store filer.\\n\\nVi anbefaler, at du lader Windows blive færdig for at undgå korruption. Men hvis du bliver træt af at vente, kan du bare trække enheden ud...\"\r\nt MSG_081 \"ISO-filen er ikke understøttet\"\r\nt MSG_082 \"Denne ISO er enten ikke-bootbar eller er baseret på boot eller kompression metode, der er ikke støttet af Rufus...\"\r\nt MSG_083 \"Erstat %s?\"\r\nt MSG_084 \"Dette ISO-image lader til at bruge en forældet version af '%s'.\\nPå grund af dette bliver Boot-menuer måske ikke vist korrekt.\\n\\nRufus kan hente en nyere version for at fikse dette problem:\\n- Vælg 'Ja' for at oprette forbindelse til internettet og hente filen\\n- Vælg 'Nej' for at lade ISO-filen forblive uændret\\nHvis du er i tvivl om, hvad du skal vælge, bør du vælge 'Ja'.\\n\\nBemærk: '%s' bliver gemt i den nuværende mappe og bliver efterfølgende automatisk genanvendt, hvis den er der.\"\r\nt MSG_085 \"Downloader %s\"\r\nt MSG_086 \"Ingen image-fil er valgt\"\r\nt MSG_087 \"til %s NAND\"\r\nt MSG_088 \"Image-filen er for stor\"\r\nt MSG_089 \"Diskbilledet er for stort til den valgte destination.\"\r\nt MSG_090 \"ISO-filen er ikke understøttet\"\r\nt MSG_091 \"Når UEFI vælges som destinationssystem er kun EFI boot-ISO'er understøttet. Vælg venligst en EFI boot-ISO eller sæt destinationssystem til BIOS.\"\r\nt MSG_092 \"Filsystemet er ikke understøttet\"\r\nt MSG_093 \"VIGTIGT: DETTE DREV INDEHOLDER FLERE PARTITIONER!!\\n\\nDette kan omfatte partitioner, der er skjulte eller endda er synlige fra Windows. Hvis du ønsker at fortsætte, er du selv ansvarlig for eventuelle tab af data på disse partitioner.\"\r\nt MSG_094 \"Flere partitioner blev fundet\"\r\nt MSG_095 \"DD-image\"\r\nt MSG_096 \"Det valgte filsystem kan ikke bruges med denne ISO-fil. Vælg et andet filsystem eller en anden ISO-fil.\"\r\nt MSG_097 \"'%s' kan kun bruges med filsystemet NTFS.\"\r\nt MSG_098 \"VIGTIGT: Du er ved at installere 'Windows To Go', men installationsdrevet er ikke en 'Lokal' disk. På grund af dette vil Windows muligvis 'fryse' under opstart, da Microsoft ikke har designet Windows til at virke med 'Flytbare' diske \\n\\nVil du fortsætte alligevel?\\n\\nBemærk: 'Lokal/Flytbar'-flaget er et hardwareflag som kun kan ændres med specielle værktøjer fra producenten. Disse værktøjer er næsten aldrig tilgængelige for almindelige mennesker...\"\r\nt MSG_099 \"Filsystem begrænsning\"\r\nt MSG_100 \"Dette ISO-image indeholder en fil, der er større end 4 GB, hvilket er mere end den maksimale størrelse, der er tilladt for et FAT- eller FAT32 filsystem.\"\r\nt MSG_101 \"Manglende WIM-understøttelse\"\r\nt MSG_102 \"Din platform kan ikke udpakke filer fra et WIM-arkiv. Udpakning af WIM-filer er påkrævet for at oprette en EFI Windows 7 og Windows Vista USB boot-disk. Du kan løse det ved at hente og installere 7-Zip.\\nØnsker du at gå til 7-zip's downloadside?\"\r\nt MSG_103 \"Hent %s?\"\r\nt MSG_104 \"%s eller senere kræver at en '%s'-fil bliver installeret.\\nFordi denne fil er større end 100 KB, og altid er i %s ISO-filer, er den ikke indbygget i Rufus.\\n\\nRufus kan downloade den manglede fil for dig:\\n- Vælg 'Ja' for at oprette forbindelse til internettet og hente filen\\n- Vælg 'Nej' hvis du selv ønsker at kopiere filen til drevet senere\\n\\nBemærk: '%s' bliver gemt i den nuværende mappe og bliver efterfølgende automatisk genanvendt, hvis den er der.\"\r\nt MSG_105 \"Annullering kan efterlade enheden i en ubrugelig tilstand.\\nHvis du er sikker på at du vil annullere, klik JA. Ellers, klik NEJ.\"\r\nt MSG_106 \"Vælg en mappe\"\r\nt MSG_107 \"Alle filer\"\r\nt MSG_110 \"MS-DOS kan ikke boote fra et drev der bruger 64 kilobyte klyngestørrelse.\\nVær venlig at ændre klyngestørrelsen eller brug FreeDOS.\"\r\nt MSG_111 \"Inkompatibel klyngestørrelse\"\r\nt MSG_112 \"Formatering af en stor UDF volume kan tage lang tid. Ved USB 2.0-hastigheder, er den anslåede varighed af formatering %d:%02d, hvorunder statuslinjen forekommer frosset. Vær tålmodig!\"\r\nt MSG_113 \"Stort UDF volume\"\r\nt MSG_114 \"Dette image benytter Syslinux %s%s men denne applikation indeholder kun installationsfilerne til Syslinux %s%s.\\n\\nDa nye versioner af Syslinux ikke er kompatible med hinanden, og det desuden ikke ville være muligt for Rufus at inkludere dem alle, er det nødvendigt at hente to yderligere filer fra internettet ('ldlinux.sys' og 'ldlinux.bss'):\\n- Vælg 'Ja' for at oprette forbindelse til internettet og hente filerne\\n- Vælg 'Nej' for at annullere operationen\\n\\nBemærk: Disse filer bliver gemt i den nuværende mappe og bliver efterfølgende automatisk genanvendt, hvis de er der.\"\r\nt MSG_115 \"Download nødvendig\"\r\nt MSG_116 \"Dette image bruger Grub %s, og dette program har kun installationsfiler til Grub %s.\\n\\nDa forskellige versioner af Grub muligvis ikke er kompatible med hinanden, og det ikke er muligt at inkludere alle versioner vil Rufus forsøge at finde en version af Grub-installationsfilen ('core.img') der matcher versionen fra dit image:\\n- Vælg 'Ja' for at oprette forbindelse til internettet og hente filen\\n- Vælg 'Nej' for at bruge den version der kommer med Rufus\\n- Vælg 'Annuller' for at afbryde\\n\\nBemærk: Filen vil blive hentet til samme placering som Rufus og vil blive genbrugt automatisk hvis behovet genopstår. Hvis der ikke findes en matchene version online, vil standardversionen blive brugt.\"\r\nt MSG_117 \"Standard Windows-installation\"\r\nt MSG_118 \"Windows To Go (din PC på en USB-nøgle)\"\r\nt MSG_119 \"avancerede drev indstillinger\"\r\nt MSG_120 \"avancerede formateringsindstillinger\"\r\nt MSG_121 \"Vis %s\"\r\nt MSG_122 \"Skjul %s\"\r\nt MSG_123 \"Vedvarende partition størrelse\"\r\nt MSG_124 \"Ingen partition\"\r\nt MSG_125 \"Indstil størrelsen for den vedvarende partition til live USB media. Ved at vælge størrelsen 0 slår man den vedvarende partition fra.\"\r\nt MSG_126 \"Indstil partition størrelses enheder.\"\r\nt MSG_127 \"Vis ikke denne besked igen\"\r\nt MSG_128 \"Vigtig besked om %s\"\r\nt MSG_129 \"Du hare lige oprettet et medie, der bruger UEFI:NTFS bootloader. Husk, at du skal DEAKTIVERE SIKKER BOOT for at starte dette medie.\\n\\vFor flere detaljer om hvorfor dette er nødvendigt, se \\\"Mere information\\\" knappen nedenfor.\"\r\nt MSG_130 \"Windows billedvalg\"\r\nt MSG_131 \"Denne ISO indeholder flere Windows-billeder.\\nVælg venligt billedet, du vil bruge til denne installation:\"\r\nt MSG_132 \"Et andet program eller en proces er i gang med at tilgå dette drev. Vil du formatere det alligevel?\"\r\nt MSG_133 \"Rufus har opdaget, at du forsøger at oprette et Windows To Go medie baseret på en 1908 ISO.\\n\\nPå grund af en *MICROSOFT BUG* vil dette medie fejle under Windows boot (Blue Screen of Death) medmindre du manuelt erstatter filen 'WppRecorder.sys' med en 1803-version.\\n\\nBemærk også, at årsagen til, at Rufus ikke automatisk kan løse dette for dig, er at 'WppRecorder.sys' er en Microsoft-ophavsretlig beskyttet fil, så vi kan ikke lovligt inkludere en kopi af filen i applikationen...\"\r\nt MSG_134 \"Fordi MBR er udvalgt for partitionsordning, kan Rufus kun oprette en partition op til 2 TB på dette medie, hvilket gør %s af diskplads utilgængelig.\\n\\nEr du sikker, du vil fortsætte?\"\r\nt MSG_136 \"Udgave\"\r\nt MSG_138 \"Sprog\"\r\nt MSG_139 \"Artitektur\"\r\nt MSG_140 \"Fortsæt\"\r\nt MSG_141 \"Tilbage\"\r\nt MSG_142 \"Vent venligst...\"\r\nt MSG_143 \"Download med en browser\"\r\nt MSG_144 \"Downloads af Windows ISOer er i øjeblikket utilgængeligt da Micrososft har ændret deres side for at forhindre det.\"\r\nt MSG_145 \"PowerShell 3.0 eller senere version er påkrævet for at køre dette script.\"\r\nt MSG_146 \"Vil du gå online og downloade det?\"\r\nt MSG_148 \"Kører download script...\"\r\nt MSG_149 \"Download ISO-image\"\r\nt MSG_150 \"Enhedstypen du planlægger at bruge denne bootbare drev med. Det er dit ansvar at afgøre om dit mål er af BIOS eller UEFI-typen før du begynder at oprette drevet, da det ellers kan mislykkes at boote.\"\r\nt MSG_151 \"'UEFI-CSM' betyder at enheden kun booter i BIOS-emuleringsmodus (også kendt som 'Legacy Mode') under UEFI, og ikke i indbygget UEFI-modus.\"\r\nt MSG_152 \"'ikke CSM' betyderr at enheden kun booter i indbygget UEFI-modus, og ikke i BIOS-emuleringsmodus (også kendt som 'Legacy Mode').\"\r\nt MSG_153 \"Test mønster: 0x%02X\"\r\nt MSG_154 \"Test mønster: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Test mønster: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Test mønster: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Sætter destinationsfilsystem\"\r\nt MSG_158 \"Mindste datamængde, en blok af data vil optage i filsystemet\"\r\nt MSG_159 \"Brug dette felt til at ændre volume-etiketten.\\nInternationale tegn accepteres.\"\r\nt MSG_160 \"Skift avancerede indstillinger\"\r\nt MSG_161 \"Kontroller enheden for fejlbehæftede blokke ved brug af et test-mønster\"\r\nt MSG_162 \"Fravælg denne mulighed for at bruge den \\\"langsomme\\\" formateringsmetode\"\r\nt MSG_163 \"Metoden som bliver brugt for at lægge partitioner\"\r\nt MSG_164 \"Metode til at oprette en boot-disk\"\r\nt MSG_165 \"Klik for at vælge eller downloade et billede...\"\r\nt MSG_166 \"Vælg denne mulighed for at tillade visning af internationale etiketter og skabe et enheds-ikon (opretter en autorun.inf)\"\r\nt MSG_167 \"Installer en UEFI bootloader, der vil udføre en MD5Sum fil validering af mediet\"\r\nt MSG_169 \"Opret en ekstra skjult partition og forsøg at tilpasse afgrænsning af partitioner.\\nDette kan forbedre boot-disk genkendelse for ældre BIOS'er.\"\r\nt MSG_170 \"Vis liste over USB harddisk kabinetter. Brug på egen RISIKO!!!\"\r\nt MSG_171 \"Start formateringen.\\nDette vil SLETTE alle data på destinationsdrevet!\"\r\nt MSG_172 \"Ugyldig download signatur\"\r\nt MSG_173 \"Klik for at vælge...\"\r\nt MSG_174 \"Rufus - Det pålidelige USB-formateringsværktøj\"\r\nt MSG_176 \"Dansk oversættelse:\\\\line• Mike Handberg Hovedskov <mailto:mikehovedskov@gmail.com>\\\\line• Jens Hansen <mailto:zenzay@gmail.com>\\\\line• Bo Riis\\n<mailto:supergoof@live.dk>\\\\line• Andrea Wood <mailto:annideer@gmail.com>\"\r\nt MSG_177 \"Rapporter fejl eller anmod om forbedringer på:\"\r\nt MSG_178 \"Yderligere rettigheder:\"\r\nt MSG_179 \"Opdateringspolitik:\"\r\nt MSG_180 \"Hvis du vælger at tillade dette program at søge efter applikationsopdateringer, accepterer du, at følgende oplysninger kan indsamles på vores server(e):\"\r\nt MSG_181 \"Dit operativsystems arkitektur og version\"\r\nt MSG_182 \"Versionen af den applikation du bruger\"\r\nt MSG_183 \"Din IP-adresse\"\r\nt MSG_184 \"Med henblik på at generere private brugerstatistikker, kan vi beholde de indsamlede oplysninger, \\\\b højst et år\\\\b0 . Men vi vil ikke, frivilligt, videregive nogle af disse individuelle data til en tredjepart.\"\r\nt MSG_185 \"Opdateringsproces:\"\r\nt MSG_186 \"Rufus kører eller installerer ikke nogle baggrundstjenester, derfor bliver søgning efter opdateringer kun udført, når hovedprogrammet kører.\\\\line\\nInternetadgang er naturligvis påkrævet, når du søger efter opdateringer.\"\r\nt MSG_187 \"Ugyldig image for den valgte boot mulighed\"\r\nt MSG_188 \"Det nuværende image matcher ikke den valgte boot mulighed. Vælg venligst et andet image eller vælg en anden boot mulighed.\"\r\nt MSG_189 \"Dette ISO-image er ikke kompatibelt med det valgte filsystem\"\r\nt MSG_190 \"Inkompatibelt drev fundet\"\r\nt MSG_191 \"Skrive test\"\r\nt MSG_192 \"Læse test\"\r\nt MSG_193 \"Hentet %s\"\r\nt MSG_194 \"Kunne ikke hente %s\"\r\nt MSG_195 \"Benytter standard version af %s fil(er)\"\r\nt MSG_196 \"VIGTIGT: DETTE DREV BENYTTER IKKE STANDARD SEKTOR STØRRELSE!\\n\\nNormale drev benytter en 512-byte sektorstørrelse mens dette drev benytter %d-byte sektorstørrelse. Det betyder ofte at du ikke vil kunne boote fra dette drev.\\nRufus kan forsøge at lave et bootbar drev, men det er ikke sikkert at det lykkes.\"\r\nt MSG_197 \"IKKE standard sektor størrelse fundet\"\r\nt MSG_198 \"'Windows To Go' kan kun installeres på et GPT-partitioneret drev hvis det er af 'Lokal' drev typen. Det valgte drev er IKKE af 'Lokal' typen.\"\r\nt MSG_199 \"Denne funktion er ikke tilgængelig på denne platform.\"\r\nt MSG_201 \"Annullerer - vent venligst...\"\r\nt MSG_202 \"Scanner image...\"\r\nt MSG_203 \"Fejl opstod ved scanning af image\"\r\nt MSG_204 \"Forældet %s fundet\"\r\nt MSG_205 \"ISO-image: %s\"\r\nt MSG_206 \"Manglende %s fil\"\r\nt MSG_207 \"Ny disk\"\r\nt MSG_208 \"%d enhed fundet\"\r\nt MSG_209 \"%d enheder fundet\"\r\nt MSG_210 \"Klar\"\r\nt MSG_211 \"Afbrudt\"\r\nt MSG_212 \"Fejl\"\r\nt MSG_213 \"Starter ny applikation...\"\r\nt MSG_214 \"Kan ikke starte ny applikation\"\r\nt MSG_215 \"Åbnet %s\"\r\nt MSG_216 \"Gemt %s\"\r\nt MSG_217 \"Formaterer: %s\"\r\nt MSG_218 \"Opretter filsystem: Opgave %d/%d fuldført\"\r\nt MSG_219 \"NTFS-fiks: %d%% fuldført\"\r\nt MSG_220 \"Formaterer (%s) - estimeret varighed %d:%02d...\"\r\nt MSG_221 \"Opretter etiket (%s)...\"\r\nt MSG_222 \"Formaterer (%s)...\"\r\nt MSG_223 \"NTFS-fiks (Checkdisk)...\"\r\nt MSG_224 \"Nulstiller MBR/PBR/GPT-strukturer...\"\r\nt MSG_225 \"Anmoder om disk tilgang...\"\r\nt MSG_226 \"Analyserer eksisterende boot records...\"\r\nt MSG_227 \"Lukker eksisterende volume...\"\r\nt MSG_228 \"Skriver Master boot record...\"\r\nt MSG_229 \"Skriver partitionsstartpost...\"\r\nt MSG_230 \"Kopierer DOS-filer...\"\r\nt MSG_231 \"Kopierer ISO-filer: %s\"\r\nt MSG_233 \"Afslutter, vent venligst...\"\r\nt MSG_234 \"Installerer Syslinux %s...\"\r\nt MSG_235 \"Disktest: %s %d/%d - %0.2f%% (%d/%d/%d fejl)\"\r\nt MSG_236 \"Disktest: Tester med tilfældigt mønster\"\r\nt MSG_237 \"Disktest: Tester med mønsteret 0x%02X\"\r\nt MSG_238 \"Partitionerer (%s)...\"\r\nt MSG_239 \"Sletter partitioner (%s)...\"\r\nt MSG_240 \"Signaturen for den downloaded opdatering kan ikke bekræftes. Det kunne betyde, at dit system er ukorrekt indstillet for signatur bekræftelse eller indikerer en ondsindet download.\\n\\nDownloaded vil blive slettet. Tjek log for flere detaljer.\"\r\nt MSG_241 \"Downloader: %s\"\r\nt MSG_242 \"Kunne ikke hente fil.\"\r\nt MSG_243 \"Søger efter Rufus opdateringer...\"\r\nt MSG_244 \"Opdateringer: Ikke i stand til at tilslutte internettet\"\r\nt MSG_245 \"Opdateringer: Ikke i stand til at tilgå versionsdata\"\r\nt MSG_246 \"En ny version af Rufus er tilgængelig!\"\r\nt MSG_247 \"Ingen nyere version af Rufus blev fundet\"\r\nt MSG_248 \"Applikationsnøgler i registreringsdatabasen er blevet slettet\"\r\nt MSG_249 \"Kunne ikke slette applikationsnøgler i registreringsdatabasen\"\r\nt MSG_250 \"%s aktiveret\"\r\nt MSG_251 \"%s deaktiveret\"\r\nt MSG_252 \"Tjek størrelsen på ISO-filen\"\r\nt MSG_253 \"Lokal-disk detektering\"\r\nt MSG_254 \"Tvunget 'large FAT32' formatering\"\r\nt MSG_255 \"NoDriveTypeAutorun bliver detekteret ved exit\"\r\nt MSG_256 \"Opdag falske drev\"\r\nt MSG_257 \"Joliet understøttelse\"\r\nt MSG_258 \"Rock Ridge understøttelse\"\r\nt MSG_259 \"Tvunget opdatering\"\r\nt MSG_260 \"NTFS-komprimering\"\r\nt MSG_261 \"Skriver til image: %s\"\r\nt MSG_262 \"ISO-understøttelse\"\r\nt MSG_263 \"MiB notation\"\r\nt MSG_264 \"Sletter mappen '%s'\"\r\nt MSG_265 \"VMWare disk detektering\"\r\nt MSG_267 \"Anvender Windows-image: %s\"\r\nt MSG_268 \"Anvender Windows-image...\"\r\nt MSG_269 \"Bevar tidsstempler\"\r\nt MSG_271 \"Beregner imagechecksumme: %s\"\r\nt MSG_272 \"Beregner MD5-, SHA1- og SHA256-checksumme for det valgte diskbillede\"\r\nt MSG_273 \"Skift programsprog\"\r\nt MSG_274 \"%s-diskbillede opdaget\"\r\nt MSG_275 \"Det diskbillede du har valgt er et 'ISOHybrid'-diskbillede. Det betyder at det både kan skrives som %s (filkopiering) og %s (diskbillede).\\nRufus anbefaler at du skriver det som %s, så du altid har fuld adgang til drevet efter du har overskrevet det.\\nMen hvis du støder på problemer under boot, kan du prøve at skrive diskbilledet som %s.\\n\\nVælg den metode som du ønsker at bruge til at skrive diskbilledet:\"\r\nt MSG_276 \"Skriv som %s (Anbefalet)\"\r\nt MSG_277 \"Skriv som %s\"\r\nt MSG_278 \"Tjekker for modstridende processer...\"\r\nt MSG_279 \"Ikke opstartbar\"\r\nt MSG_280 \"Disk eller ISO billede\"\r\nt MSG_281 \"%s (Valg venligst)\"\r\nt MSG_282 \"Isoleret USB-lukning\"\r\nt MSG_283 \"Ugyldig signatur\"\r\nt MSG_284 \"Den hentede fil mangler en digital signatur.\"\r\nt MSG_285 \"Den hentede fil er signeret af '%s'.\\nDet er ikke en signatur vi genkender og det kan tyde på at der er en form for ondsindet aktivitet...\\nEr du sikker på at du vil køre denne fil?\"\r\nt MSG_286 \"Nulstilled drev: %s\"\r\nt MSG_287 \"Opdagelse af ikke-USB flytbare drev\"\r\nt MSG_288 \"Manglende udvidede rettigheder\"\r\nt MSG_289 \"Dette program kan bare køre med udvidede rettigheder\"\r\nt MSG_290 \"Fil Indeksering\"\r\nt MSG_291 \"Versions valg\"\r\nt MSG_292 \"Valg venligst versionen af Windows du ønsker at installere:\"\r\nt MSG_293 \"Ikke støttet Windows version\"\r\nt MSG_294 \"Denne version af Windows er ikke længere understøttet af Rufus.\\nDen seneste version af Rufus, der er kompatibel med denne platform, er v%d.%d.\"\r\nt MSG_295 \"Advarsel: Uofficiel version\"\r\nt MSG_296 \"Denne version af Rufus er IKKE produceret af dens officielle udvikler(e).\\n\\nEr du sikker på at du vil køre programmet?\"\r\nt MSG_297 \"Forkortet ISO opdaget\"\r\nt MSG_298 \"ISO-filen du har valgt, stemmer ikke overens med den erklærede størrelse: %s af dataene mangler!\\n\\nHvis du har downloadet filen fra internettet, bør du prøve at downloade en ny kopi og verificere at MD5 eller SHA kontrolsummen svarer til de officielle.\\n\\nLæg mærke til at du kan beregne MD5 eller SHA i Rufus ved at klikke på (✓)-knappen.\"\r\nt MSG_299 \"Tidsstempel bekræftelses fejl\"\r\nt MSG_300 \"Rufus kunne ikke bekræfte på tidspunktet af den downloadedde opdatering er nyere end den nuværende eksekverbare.\\n\\nFor at to forhindre potentielle angrebsscenarier, har opdateringsprocessen blevet afbrudt og downloadet vil blive slettet. Tjek venligst loggen for flere detaljer.\"\r\nt MSG_301 \"Vis applikationsindstillinger\"\r\nt MSG_302 \"Vis oplysninger om denne applikation\"\r\nt MSG_303 \"Vis loggen\"\r\nt MSG_304 \"Opret et diskbillede af den valgte enhed\"\r\nt MSG_305 \"Brug dette alternativ for at angive om du vil bruge denne enhed til at installere Windows på en anden disk, eller hvis du vil køre Windows direkte fra dette drev (Windows To Go).\"\r\nt MSG_306 \"Hurtigt-nulstilling af drev: %s\"\r\nt MSG_307 \"dette kan tage noget tid\"\r\nt MSG_308 \"Opdager VHDD\"\r\nt MSG_309 \"Komprimeret arkiv\"\r\nt MSG_310 \"Den ISO, du har valgt, bruger UEFI og er lille nok til at blive skrevet som en EFI systempartition (ESP). Skrivning til en ESP i stedet for at skrive til en generisk datapartition, der optager hele disken, kan være at foretrække for nogle typer installationer.\\n\\nVælg den metode, du vil bruge til at skrive dette billede:\"\r\nt MSG_311 \"Brug %s (i hovedprogramvinduet) til at aktivere.\"\r\nt MSG_312 \"Ekstra checksumme (SHA512)\"\r\nt MSG_313 \"Gem på VHDD\"\r\nt MSG_314 \"Beregn billedechecksumme\"\r\nt MSG_315 \"Flere knapper\"\r\nt MSG_316 \"Antal gennemløb\"\r\nt MSG_318 \"Standard trådpriorietet: %d\"\r\nt MSG_319 \"Ignorer boot markering\"\r\nt MSG_320 \"Genindlæser partition layout (%s)\"\r\nt MSG_321 \"Det valgte billede er et ISOHybrid, men dets skabere har ikke gjort det kompatibelt med ISO / Fil kopi måde.\\nDerfor bruges DD-billedskrivningstilstand.\"\r\nt MSG_322 \"Ude af stand til at åbne eller læse '%s'\"\r\nt MSG_325 \"Anvender Windows tilpasninger : %s\"\r\nt MSG_326 \"Anvender bruger valgmuligheder...\"\r\nt MSG_327 \"Windows Bruger Oplevelse\"\r\nt MSG_328 \"Tilpas Windows installation?\"\r\nt MSG_329 \"Fjern kravet for 4GB+ RAM, Secure Boot og TPM 2.0\"\r\nt MSG_330 \"Fjern kravet for en online Microsoft konto\"\r\nt MSG_331 \"Deaktiver data indsamling (Skip privatlivs spørgsmål)\"\r\nt MSG_332 \"Forhindre Windows To Go i at tilgå interne diske\"\r\nt MSG_333 \"Opret en local burger med brugernavn:\"\r\nt MSG_334 \"Sæt regionale muligheder til de samme værdier some denne brugers\"\r\nt MSG_335 \"Deaktiver Bitlockers automatiske apparat kryptering\"\r\nt MSG_336 \"Vedvarende log\"\r\nt MSG_337 \"En yderligere fil ('%s') skal downloades fra Microsoft for at bruge denne funktion:\\n- Vælg 'Ja' for at tilslutte til internettet og hente den\\n- Vælg 'Nej' for at afbryde operationen\\n\\nNote: Filen vil blive hentet i programmets mappe og vil blive genbrugt automatisk hvis tilstede.\"\r\nt MSG_338 \"Tilbagekaldt UEFI Bootloader opdaget\"\r\nt MSG_339 \"Rufus har opdaget at ISO filen du har valgt indeholder en UEFI bootloader der er blevet tilbagekaldt og vil producere %s, når Secure Boot er slået til på et fuldt opdateret UEFI system.\\n\\n- Hvis du har hentet dette ISO billed fra en upålidelig kilde, bør du overveje muligheden for at den muligvis indeholder UEFI malware og undgå at boote fra den.\\n- Hvis du har hentet den fra en pålidelig kilde, bør du kigge efter en nyere version, som ikke vil producere denne advarsel.\"\r\nt MSG_340 \"en \\\"Sikkerhedsbrud\\\" skærm\"\r\nt MSG_341 \"en Windows Gendannelsesskærm (BSOD) med '%s'\"\r\nt MSG_342 \"Komprimeret VHDX Afbildning\"\r\nt MSG_343 \"Ukomprimeret VHD Afbildning\"\r\nt MSG_344 \"Full Flash Update Afbildning\"\r\nt MSG_345 \"Noget ekstra data skal hentes fra Microsoft for at udnytte denne funktionalitet:\\n- Vælg 'Ja' for at tilslutte til internettet og hente det\\n- Vælg 'Nej' for at afbryde operationen\"\r\nt MSG_346 \"Begræns Windows til S-Mode (Inkompatibel med Online bruger bypass)\"\r\nt MSG_347 \"Ekspert Tilstand\"\r\nt MSG_348 \"Udpakker arkiv filer: %s\"\r\nt MSG_349 \"Brug Rufus MBR\"\r\nt MSG_900 \"Rufus er et værktøj, der hjælper med at formatere og skabe startbare USB-flashdrev, såsom USB-nøgler/USB-pinde, USB-stik, osv.\"\r\nt MSG_901 \"Officiel side: %s\"\r\nt MSG_902 \"Kildekode: %s\"\r\nt MSG_903 \"Ændrings log: %s\"\r\n# I cannot find an official translation, but here's a unofficial translated txtfile of the site from:\r\n# https://www.gnu.org/licenses/translations.en.html\r\n# https://raw.githubusercontent.com/scootergrisen/licenser/master/gpl-3.0.da.txt\r\nt MSG_904 \"Denne application er licenceret under GNU Public License (GPL) version 3's vilkår.\\nSe https://www.gnu.org/licenses/gpl-3.0.html for detaljer.\"\r\nt MSG_910 \"Formater USB, flash kort og virtuelle drev til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Lav FreeDOS opstartsbare USB drev\"\r\nt MSG_912 \"Lav opstartsbarer drev fra opstartsbarer ISOer (Window, Linux, osv.)\"\r\nt MSG_913 \"Lav opstartsbarer drev fra opstartsbarer disk billeder, inklusiv komprimerede billeder\"\r\nt MSG_914 \"Lav BIOS eller UEFI opstartsbarer drev, inklusiv UEFI opstartsbarer NTFS\"\r\nt MSG_915 \"Lav 'Windows To Go' drev\"\r\nt MSG_916 \"Lav Windows 11 installations drev for PCer der ikker har TPM eller Secure Boot\"\r\nt MSG_917 \"Lav vedvarende Linux adskillelser\"\r\nt MSG_918 \"Lav VHD/DD billeder af det valgte drev\"\r\nt MSG_919 \"Beregn MD5, SHA-1, SHA-256 og SHA-512 checksums af det valgte billede\"\r\nt MSG_920 \"Udøv dårlige blokke tjeks, inklusiv opdagelse af \\\"falske\\\" flashdrev\"\r\nt MSG_921 \"Hent officielle Microsoft Windows detail ISOer\"\r\nt MSG_922 \"Hent UEFI Shell ISOer\"\r\n\r\n#########################################################################\r\nl \"nl-NL\" \"Dutch (Nederlands)\" 0x0413, 0x0813\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Over Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licentie\"\r\nt IDOK \"Ok\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Eigenschappen van drive\"\r\nt IDS_DEVICE_TXT \"Apparaat\"\r\nt IDS_BOOT_SELECTION_TXT \"Opstartselectie\"\r\nt IDC_SELECT \"Selecteren\"\r\nt IDS_IMAGE_OPTION_TXT \"Image-optie\"\r\nt IDS_PARTITION_TYPE_TXT \"Partitie-indeling\"\r\nt IDS_TARGET_SYSTEM_TXT \"Doelsysteem\"\r\nt IDC_LIST_USB_HDD \"USB-harde schijven weergeven\"\r\nt IDC_OLD_BIOS_FIXES \"Oplossingen voor oude BIOS'en toevoegen (extra partitie, uitlijnen, etc.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Media-validatie via UEFI inschakelen\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Opties voor formatteren\"\r\nt IDS_FILE_SYSTEM_TXT \"Bestandssysteem\"\r\nt IDS_CLUSTER_SIZE_TXT \"Clustergrootte\"\r\nt IDS_LABEL_TXT \"Volumelabel\"\r\nt IDC_QUICK_FORMAT \"Snelformatteren\"\r\nt IDC_BAD_BLOCKS \"Apparaat controleren op slechte blokken\"\r\nt IDC_EXTENDED_LABEL \"Uitgebreid label en pictogrambestanden aanmaken\"\r\nt IDCANCEL \"Sluiten\"\r\nt IDC_START \"Starten\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Sluiten\"\r\nt IDD_LICENSE \"Rufus-licentie\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Sluiten\"\r\nt IDC_LOG_CLEAR \"Wissen\"\r\nt IDC_LOG_SAVE \"Opslaan\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Sluiten\"\r\nt IDD_NEW_VERSION \"Op updates controleren - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Er is een nieuwere versie beschikbaar. Download de laatste versie!\"\r\nt IDC_WEBSITE \"Klik hier om naar de website te gaan\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Uitgave-opmerkingen\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Downloaden\"\r\nt IDC_DOWNLOAD \"Downloaden\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Meer informatie\"\r\nt IDYES \"Ja\"\r\nt IDNO \"Nee\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Sluiten\"\r\nt IDD_UPDATE_POLICY \"Updatebeleid en instellingen\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Instellingen\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Op updates controleren\"\r\nt IDS_INCLUDE_BETAS_TXT \"Bètaversies insluiten\"\r\nt IDC_CHECK_NOW \"Nu controleren\"\r\n\r\nt MSG_001 \"Andere instantie gedetecteerd\"\r\nt MSG_002 \"Er is een andere Rufus-toepassing actief.\\nSluit de eerste toepassing voordat u een andere opent.\"\r\nt MSG_003 \"WAARSCHUWING: ALLE DATA OP APPARAAT '%s' ZAL VERNIETIGD WORDEN.\\nKlik op OK om verder te gaan met deze handeling. Klik op ANNULEREN om af te sluiten.\"\r\nt MSG_004 \"Rufus updatebeleid\"\r\nt MSG_005 \"Wilt u Rufus toestaan om online te zoeken naar programma-updates?\"\r\nt MSG_006 \"Sluiten\"\r\nt MSG_007 \"Annuleren\"\r\nt MSG_008 \"Ja\"\r\nt MSG_009 \"Nee\"\r\nt MSG_010 \"Slechte blokken gevonden\"\r\nt MSG_011 \"Controle voltooid: %d slechte blok(ken) gevonden\\n  %d leesfout(en)\\n  %d schrijffout(en)\\n  %d corruptiefout(en)\"\r\nt MSG_012 \"%s\\nEen meer gedetailleerd rapport kan teruggevonden worden in:\\n%s\"\r\nt MSG_013 \"Uitgeschakeld\"\r\nt MSG_014 \"Dagelijks\"\r\nt MSG_015 \"Wekelijks\"\r\nt MSG_016 \"Maandelijks\"\r\nt MSG_017 \"Aangepast\"\r\nt MSG_018 \"Uw versie: %d.%d (Build %d)\"\r\nt MSG_019 \"Laatste versie: %d.%d (Build %d)\"\r\nt MSG_021 \"kB\"\r\nt MSG_027 \"kilobyte\"\r\nt MSG_028 \"megabyte\"\r\nt MSG_029 \"Standaard\"\r\nt MSG_030 \"%s (Standaard)\"\r\nt MSG_031 \"BIOS (of UEFI-CSM)\"\r\nt MSG_032 \"UEFI (geen CSM)\"\r\nt MSG_033 \"BIOS of UEFI\"\r\nt MSG_034 \"%d ronde\"\r\nt MSG_035 \"%d rondes %s\"\r\nt MSG_036 \"ISO-image\"\r\nt MSG_037 \"Toepassing\"\r\nt MSG_038 \"Afbreken\"\r\nt MSG_039 \"Starten\"\r\nt MSG_040 \"Downloaden\"\r\nt MSG_041 \"Opdracht geannuleerd door de gebruiker\"\r\nt MSG_042 \"Fout\"\r\nt MSG_043 \"Fout: %s\"\r\nt MSG_044 \"Bestand-download\"\r\nt MSG_045 \"USB-opslagapparaat (algemeen)\"\r\nt MSG_046 \"%s (schijf %d) [%s]\"\r\nt MSG_047 \"Meerdere partities\"\r\nt MSG_048 \"Rufus - Buffers aan het legen\"\r\nt MSG_049 \"Rufus - Annuleren\"\r\nt MSG_050 \"Succesvol.\"\r\nt MSG_051 \"Onbepaalde fout tijdens formatteren.\"\r\nt MSG_052 \"Kan het geselecteerde bestandssysteem niet gebruiken voor dit medium.\"\r\nt MSG_053 \"Toegang tot apparaat is geweigerd.\"\r\nt MSG_054 \"Medium is beveiligd tegen schrijven.\"\r\nt MSG_055 \"Het apparaat is in gebruik door een ander proces. Sluit alle processen af die toegang hebben tot het apparaat.\"\r\nt MSG_056 \"Snelformatteren is niet beschikbaar voor dit apparaat.\"\r\nt MSG_057 \"Het volumelabel is ongeldig.\"\r\nt MSG_058 \"De apparaat-handle is ongeldig.\"\r\nt MSG_059 \"De geselecteerde clustergrootte is ongeldig voor dit apparaat.\"\r\nt MSG_060 \"De volumegrootte is ongeldig.\"\r\nt MSG_061 \"Plaats een verwisselbaar medium in de drive.\"\r\nt MSG_062 \"Er werd een niet-ondersteunde opdracht ontvangen.\"\r\nt MSG_063 \"Geheugentoewijzingsfout.\"\r\nt MSG_064 \"Leesfout.\"\r\nt MSG_065 \"Schrijffout.\"\r\nt MSG_066 \"Installatie mislukt\"\r\nt MSG_067 \"Kon medium niet openen. Het kan in gebruik zijn door een ander proces. Sluit het medium opnieuw aan en probeer het opnieuw.\"\r\nt MSG_068 \"Kon de drive niet partitioneren.\"\r\nt MSG_069 \"Kon bestanden niet kopiëren naar de doel-drive.\"\r\nt MSG_070 \"Geannuleerd door gebruiker.\"\r\nt MSG_071 \"Kon thread niet starten.\"\r\nt MSG_072 \"Controle van slechte blokken niet voltooid.\"\r\nt MSG_073 \"ISO-image scanfout.\"\r\nt MSG_074 \"ISO-image extractiefout.\"\r\nt MSG_075 \"Kon volume niet opnieuw koppelen.\"\r\nt MSG_076 \"Kon bestanden niet patchen/instellen voor opstarten.\"\r\nt MSG_077 \"Kon geen driveletter toewijzen.\"\r\nt MSG_078 \"Kan GUID-volume niet koppelen.\"\r\nt MSG_079 \"Het apparaat is niet klaar.\"\r\nt MSG_080 \"Rufus heeft gedetecteerd dat Windows nog steeds bezig is om zijn interne buffers te legen naar het USB-apparaat.\\n\\nAfhankelijk van de snelheid van uw USB-apparaat kan deze handeling een lange tijd duren voordat ze voltooid is, zeker voor grote bestanden.\\n\\nHet is aanbevolen om Windows de taak volledig te laten voltooien om datacorruptie te voorkomen, maar als het erg lang duurt dan kunt u het apparaat gewoon loskoppelen...\"\r\nt MSG_081 \"Niet-ondersteunde image\"\r\nt MSG_082 \"Deze image is ofwel niet opstartbaar, of het gebruikt een opstart- of compressiemethode die niet ondersteund wordt door Rufus...\"\r\nt MSG_083 \"%s vervangen?\"\r\nt MSG_084 \"Deze ISO-image lijkt een verouderde versie te gebruiken van '%s'.\\nOpstartmenu's worden hierdoor mogelijk niet goed weergegeven.\\n\\nEen nieuwere versie kan gedownload worden door Rufus om dit probleem op te lossen:\\n- Kies 'Ja' om met het internet te verbinden en het bestand te downloaden\\n- Kies 'Nee' om het bestaande ISO-bestand ongewijzigd te laten.\\nAls u niet weet wat u moet doen, selecteert u best 'Ja'.\\n\\nOpmerking: Het nieuwe bestand wordt naar de huidige map gedownload en eens er een '%s' bestaat, zal deze automatisch opnieuw gebruikt worden.\"\r\nt MSG_085 \"Downloaden van %s\"\r\nt MSG_086 \"Geen image geselecteerd\"\r\nt MSG_087 \"voor %s NAND\"\r\nt MSG_088 \"Image is te groot\"\r\nt MSG_089 \"De image is te groot voor het geselecteerde doelapparaat.\"\r\nt MSG_090 \"Niet-ondersteunde ISO\"\r\nt MSG_091 \"Bij gebruik van UEFI-doeltype zijn alleen EFI-opstartbare ISO-images ondersteund. Selecteer een EFI-opstartbare ISO of stel het doeltype in op BIOS.\"\r\nt MSG_092 \"Niet ondersteund bestandssysteem\"\r\nt MSG_093 \"BELANGRIJK: DEZE DRIVE BEVAT MEERDERE PARTITIES!\\n\\nDit kunnen partities/volumes zijn die niet in de lijst voorkomen of zelfs niet zichtbaar zijn voor Windows. Als u verder wilt gaan, bent u zelf verantwoordelijk voor gegevensverlies op deze partities.\"\r\nt MSG_094 \"Meerdere partities gedetecteerd\"\r\nt MSG_095 \"DD-image\"\r\nt MSG_096 \"Het geselecteerde bestandssysteem kan niet gebruikt worden met dit type ISO. Selecteer een ander bestandssysteem of gebruik een andere ISO.\"\r\nt MSG_097 \"'%s' kan alleen toegepast worden als het bestandssysteem NTFS is.\"\r\nt MSG_098 \"BELANGRIJK: U probeert 'Windows To Go' te installeren, maar uw doelschijf heeft het 'FIXED'-attribuut niet. Hierdoor zal Windows hoogstwaarschijnlijk vastlopen tijdens het opstarten omdat Microsoft het niet zo heeft ontworpen dat het werkt met drives die het 'REMOVABLE' attribuut hebben.\\n\\nWilt u nog steeds doorgaan?\\n\\nOpmerking: Het 'FIXED/REMOVABLE'-attribuut is een hardware-eigenschap die alleen veranderd kan worden door gebruik te maken van tools van de drive-fabrikant. Deze tools worden echter BIJNA NOOIT aan het publiek aangeboden...\"\r\nt MSG_099 \"Beperking van bestandssysteem\"\r\nt MSG_100 \"Deze ISO-image bevat een bestand dat groter is dan 4 GB wat meer is dan de maximum toegestane grootte voor een FAT- of FAT32-bestandssysteem.\"\r\nt MSG_101 \"WIM-ondersteuning ontbreekt\"\r\nt MSG_102 \"Uw platform kan geen bestanden uitpakken van WIM-archieven. WIM-extractie is nodig om EFI-opstartbare Windows 7 en Windows Vista USB-drives te maken. U kunt dit oplossen door een recente versie van 7-Zip te installeren.\\nWilt u de 7-Zip downloadpagina bezoeken?\"\r\nt MSG_103 \"%s downloaden?\"\r\nt MSG_104 \"%s of hoger vereist een '%s'-bestand om het te kunnen installeren.\\nOmdat dit bestand groter is dan 100 kB en altijd aanwezig is op %s ISO-images,is het niet in Rufus ingebouwd.\\n\\nRufus kan het ontbrekende bestand voor u downloaden:\\n- Selecteer 'Ja' om verbinding met het internet te maken en het bestand te downloaden\\n- Selecteer 'Nee' als u dit bestand later handmatig naar de drive wilt kopiëren\\n\\nOpmerking: Het bestand wordt gedownload in de huidige map en wanneer er al een '%s' bestaat, zal die automatisch vervangen worden.\"\r\nt MSG_105 \"Wanneer u annuleert kan het apparaat ONBRUIKBAAR worden.\\nAls u zeker weet dat u wilt annuleren, klik op JA. Anders klikt u op NEE.\"\r\nt MSG_106 \"Selecteer een map\"\r\nt MSG_107 \"Alle bestanden\"\r\nt MSG_108 \"Rufus-log\"\r\nt MSG_109 \"0x%02X (schijf %d)\"\r\nt MSG_110 \"MS-DOS kan niet opstarten van een apparaat met een clustergrootte van 64 kilobyte\\nWijzig de clustergrootte of gebruik FreeDOS.\"\r\nt MSG_111 \"Incompatibele clustergrootte\"\r\nt MSG_112 \"Het formatteren van grote UDF-volumes kan een lange tijd duren. Bij USB 2.0-snelheden is de geschatte formatteertijd %d:%02d, waarbij de voortgangsbalk zal geblokkeerd lijken. Wees geduldig!\"\r\nt MSG_113 \"Groot UDF-volume\"\r\nt MSG_114 \"Deze image maakt gebruik van Syslinux %s%s maar de toepassing bevat alleen de installatiebestanden voor Syslinux %s%s.\\n\\nOmdat oude en nieuwe versies van Syslinux niet compatibel zijn met elkaar, en het niet mogelijk is voor Rufus om alle versies te beheren, moeten twee extra bestanden gedownload worden van het internet ('ldlinux.sys' en 'ldlinux.bss'):\\n- Klik op 'Ja' om via internet deze bestanden te downloaden\\n- Klik op 'Nee' om de opdracht te annuleren\\n\\nLet op: De bestanden worden in de huidige map opgeslagen en zullen automatisch vervangen worden als het bestand al bestaat.\"\r\nt MSG_115 \"Download is vereist\"\r\nt MSG_116 \"Deze image maakt gebruik van Grub %s maar de toepassing bevat alleen de installatiebestanden voor Grub %s.\\n\\nAls verschillende versies van Grub mogelijk niet compatibel met elkaar zijn, en het is niet mogelijk om ze allemaal toe te voegen, dan zal Rufus proberen om een versie van het Grub installatie bestand ('core.img') te zoeken dat overeenkomst met uw image:\\n- Selecteer 'Ja' om te proberen het te downloaden\\n- Selecteer 'Nee' om de standaard versie van Rufus te gebruiken\\n- Selecteer 'Annuleren' om de bewerking te stoppen\\n\\nAantekening: Het bestand zal in de huidige programma map gedownload en automatisch vervangen worden als het bestand al bestaat. Als er geen bestand online wordt gevonden, dan zal de standaard versie worden gebruikt.\"\r\nt MSG_117 \"Standaard Windows-installatie\"\r\nt MSG_119 \"geavanceerde eigenschappen van drive\"\r\nt MSG_120 \"geavanceerde opties voor formatteren\"\r\nt MSG_121 \"%s weergeven\"\r\nt MSG_122 \"%s verbergen\"\r\nt MSG_123 \"Grootte van persistente partitie\"\r\nt MSG_124 \"Geen persistentie\"\r\nt MSG_125 \"De grootte van de persistente partitie instellen voor live USB-media. De grootte op 0 instellen schakelt de persistente partitie uit.\"\r\nt MSG_126 \"Grootte-units van de partitie instellen.\"\r\nt MSG_127 \"Dit bericht niet opnieuw weergeven\"\r\nt MSG_128 \"Belangrijke mededeling over %s\"\r\nt MSG_129 \"U hebt net een medium aangemaakt dat de UEFI:NTFS-bootloader gebruikt. Onthoud dat u SECURE BOOT MOET UITSCHAKELEN om op te starten vanaf dit medium.\\nZie de 'meer informatie'-knop hieronder voor details over waarom dit nodig is.\"\r\nt MSG_130 \"Windows-image selectie\"\r\nt MSG_131 \"Deze ISO bevat meerdere Windows-images.\\nSelecteer de image die u wilt gebruiken voor deze installatie:\"\r\nt MSG_132 \"Een ander programma of proces gebruikt deze schijf. Wilt u ze toch formatteren?\"\r\nt MSG_133 \"Rufus heeft gedetecteerd dat u probeert om een Windows To Go medium aan te maken gebaseerd op een 1809-ISO\\n\\nDoor een *MICROSOFT-BUG* zal dit medium crashen tijdens het opstarten van Windows (Blue Screen Of Death), tenzij u manueel het bestand 'WppRecorder.sys' vervangt door een 1803-versie.\\n\\nMerk ook op dat Rufus dit voor u niet automatisch kan oplossen omdat 'WppRecorder.sys' een Microsoft-auteursrecht heeft, dus we kunnen geen kopie van het bestand in de toepassing inbedden op een legale manier...\"\r\nt MSG_134 \"Omdat MBR geselecteerd werd als partitie-indeling, kan Rufus slechts een partitie tot 2 TB aanmaken op dit medium, wat %s schijfruimte onbeschikbaar zal laten.\\n\\nWeet u zeker dat u wilt doorgaan?\"\r\nt MSG_135 \"Versie\"\r\nt MSG_137 \"Editie\"\r\nt MSG_138 \"Taal\"\r\nt MSG_139 \"Architectuur\"\r\nt MSG_140 \"Doorgaan\"\r\nt MSG_141 \"Terug\"\r\nt MSG_142 \"Even geduld...\"\r\nt MSG_143 \"Downloaden via een browser\"\r\nt MSG_144 \"Downloaden van Windows ISO's is niet mogelijk omdat Microsoft hun website heeft aangepast om dit te voorkomen.\"\r\nt MSG_145 \"PowerShell 3.0 of nieuwer is nodig om dit script uit te voeren.\"\r\nt MSG_146 \"Wilt u online gaan en het downloaden?\"\r\nt MSG_148 \"Downloadscript uitvoeren...\"\r\nt MSG_149 \"ISO-image downloaden\"\r\nt MSG_150 \"Type computer waarop u deze opstartbare schijf wilt gebruiken. Het is uw verantwoordelijkheid om te bepalen of u een BIOS- of UEFI-type wilt voordat u begint met het maken van de schijf, anders kunt u deze niet opstarten.\"\r\nt MSG_151 \"'UEFI-CSM' betekent dat het apparaat alleen in BIOS-emulatiemodus kan starten (beter bekend als 'Legacy Modus') onder UEFI, en niet in native UEFI-modus.\"\r\nt MSG_152 \"'geen CSM' betekent dat het apparaat alleen in native UEFI-modus kan starten, en niet in BIOS-emulatiemodus (beter bekend als 'Legacy Mode').\"\r\nt MSG_153 \"Testpatroon: 0x%02X\"\r\nt MSG_154 \"Testpatroon: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Testpatroon: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Testpatroon: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Stelt het doel-bestandssysteem in\"\r\nt MSG_158 \"Minimumruimte die een datablok inneemt in het bestandssysteem\"\r\nt MSG_159 \"Gebruik dit veld om de drive-naam in te stellen.\\nInternationale tekens worden aanvaard.\"\r\nt MSG_160 \"Geavanceerde opties in-/uitschakelen\"\r\nt MSG_161 \"Controleer het apparaat op slechte blokken tijdens een testpatroon\"\r\nt MSG_162 \"Uitvinken om de \\\"langzame\\\" formatteermethode te gebruiken\"\r\nt MSG_163 \"Methode die gebruikt zal worden om partities te maken\"\r\nt MSG_164 \"Methode die gebruikt zal worden om de drive opstartbaar te maken\"\r\nt MSG_165 \"Klikken om een image te selecteren of te downloaden...\"\r\nt MSG_166 \"Aanvinken om weergave van internationale labels toe te laten en een apparaat-pictogram in te stellen (maakt een autorun.inf aan)\"\r\nt MSG_167 \"Installeert een UEFI-bootloader die bij elke opstart vanaf het medium een MD5Sum-bestandsvalidatie uitvoert op het medium zelf\"\r\nt MSG_169 \"Een extra verborgen partitie aanmaken en proberen om partitiegrenzen uit te lijnen.\\nDit kan de opstartdetectie verbeteren voor oudere BIOS'en.\"\r\nt MSG_170 \"Weergeven van USB-harde schijfbehuizingen inschakelen. GEBRUIK OP EIGEN RISICO!!!\"\r\nt MSG_171 \"De formatteerhandeling starten.\\nDit zal alle data op de doeldrive VERWIJDEREN!\"\r\nt MSG_172 \"Ongeldige downloadhandtekening\"\r\nt MSG_173 \"Klikken om te selecteren...\"\r\nt MSG_174 \"Rufus - de betrouwbare USB-formatteertool\"\r\nt MSG_175 \"Versie %d.%d (build %d)\"\r\nt MSG_176 \"Nederlandse vertaling:\\\\line• Roberto Pino <mailto:rcp@eclipso.me>\\\\line• Thomas De Rocker <mailto:thomasderocker@outlook.com>\"\r\nt MSG_177 \"Meld fouten of verbeteringsverzoeken naar:\"\r\nt MSG_178 \"Aanvullende auteursrechten:\"\r\nt MSG_179 \"Updatebeleid:\"\r\nt MSG_180 \"Als u ervoor kiest dat dit programma op updates controleert, dan gaat u akkoord dat de volgende informatie verzameld kan worden op onze server(s):\"\r\nt MSG_181 \"Type besturingssysteem en versienummer\"\r\nt MSG_182 \"Versienummer van de toepassing die u gebruikt\"\r\nt MSG_183 \"Uw IP-adres\"\r\nt MSG_184 \"Om statistieken voor privégebruik te genereren, kunnen we de informatie blijven verzamelen\\\\b voor maximaal een jaar\\\\b0 . Wij zullen deze individuele gegevens echter niet vrijwillig openbaar maken aan derden.\"\r\nt MSG_185 \"Update-proces:\"\r\nt MSG_186 \"Rufus installeert of start geen achtergrondservices. Daarom worden updatecontroles alleen uitgevoerd als de toepassing uitgevoerd wordt.\\\\line\\nInternettoegang is natuurlijk vereist wanneer er op updates gecontroleerd wordt.\"\r\nt MSG_187 \"Ongeldige image voor geselecteerde opstartoptie\"\r\nt MSG_188 \"De huidige image komt niet overeen met de opstartoptie die geselecteerd is. Gebruik een andere image of kies een andere opstartoptie.\"\r\nt MSG_189 \"Deze ISO-image is niet compatibel met het geselecteerde bestandssysteem\"\r\nt MSG_190 \"Niet-compatibele drive gedetecteerd\"\r\nt MSG_191 \"Schrijfactie\"\r\nt MSG_192 \"Leesactie\"\r\nt MSG_193 \"%s gedownload\"\r\nt MSG_194 \"Kon %s niet downloaden\"\r\nt MSG_195 \"Geïntegreerde versie van %s-bestand(en) gebruiken\"\r\nt MSG_196 \"BELANGRIJK: DEZE DRIVE GEBRUIKT EEN NIET-STANDAARD SECTORGROOTTE!!\\n\\nConventionele drives gebruiken een 512-byte sectorgrootte maar deze drive gebruikt er een van %d byte. In veel gevallen betekent dit dat u NIET van deze drive kan opstarten.\\nRufus kan proberen om een opstartbare drive te maken, maar er is GEEN GARANTIE dat het gaat werken.\"\r\nt MSG_197 \"Niet-standaard sectorgrootte gedetecteerd\"\r\nt MSG_198 \"'Windows To Go' kan alleen geïnstalleerd worden op een GPT-gepartitioneerde schijf als het FIXED-attribuut ingesteld is. De huidige drive wordt niet herkend als FIXED.\"\r\nt MSG_199 \"Deze functie is niet beschikbaar op dit platform.\"\r\nt MSG_201 \"Annuleren - even geduld...\"\r\nt MSG_202 \"Image scannen...\"\r\nt MSG_203 \"Scannen van image mislukt\"\r\nt MSG_204 \"Verouderde %s gedetecteerd\"\r\nt MSG_205 \"Gebruikte image: %s\"\r\nt MSG_206 \"Ontbrekend %s-bestand\"\r\nt MSG_207 \"Nieuw volume\"\r\nt MSG_208 \"%d apparaat gevonden\"\r\nt MSG_209 \"%d apparaten gevonden\"\r\nt MSG_210 \"KLAAR\"\r\nt MSG_211 \"Geannuleerd\"\r\nt MSG_212 \"Mislukt\"\r\nt MSG_213 \"Nieuwe toepassing starten...\"\r\nt MSG_214 \"Nieuwe toepassing starten mislukt\"\r\nt MSG_215 \"%s geopend\"\r\nt MSG_216 \"%s opgeslagen\"\r\nt MSG_217 \"Formatteren: %s\"\r\nt MSG_218 \"Bestandssysteem aanmaken: Taak %d/%d voltooid\"\r\nt MSG_219 \"NTFS herstellen: %d%% voltooid\"\r\nt MSG_220 \"Formatteren (%s) - geschatte duur %d:%02d...\"\r\nt MSG_221 \"Label instellen (%s)...\"\r\nt MSG_222 \"Formatteren (%s)...\"\r\nt MSG_223 \"NTFS herstellen (Checkdisk)...\"\r\nt MSG_224 \"MBR/PBR/GPT-structuren wissen...\"\r\nt MSG_225 \"Schijftoegang aanvragen...\"\r\nt MSG_226 \"Bestaande boot-records analyseren...\"\r\nt MSG_227 \"Bestaand volume afsluiten...\"\r\nt MSG_228 \"Master Boot Record schrijven...\"\r\nt MSG_229 \"Partitie Boot Record schrijven...\"\r\nt MSG_230 \"DOS-bestanden kopiëren...\"\r\nt MSG_231 \"ISO-bestanden kopiëren: %s\"\r\nt MSG_232 \"Win7 EFI boot-setup (%s)...\"\r\nt MSG_233 \"Afwerken, even geduld...\"\r\nt MSG_234 \"Syslinux %s installeren...\"\r\nt MSG_235 \"Slechte blokken: %s %d/%d - %0.2f%% (%d/%d/%d fouten)\"\r\nt MSG_236 \"Slechte blokken: testen met willekeurig patroon\"\r\nt MSG_237 \"Slechte blokken: testen met patroon 0x%02X\"\r\nt MSG_238 \"Partitioneren (%s)...\"\r\nt MSG_239 \"Partities verwijderen (%s)...\"\r\nt MSG_240 \"De handtekening voor de gedownloade update kan niet gevalideerd worden. Dit kan betekenen dat uw systeem onjuist geconfigureerd is voor handtekeningvalidatie of een kwaadwillende download aantonen.\\n\\nDe download zal verwijderd worden. Controleer het logboek voor meer details.\"\r\nt MSG_241 \"Downloaden: %s\"\r\nt MSG_242 \"Downloaden van bestand mislukt.\"\r\nt MSG_243 \"Controleren op Rufus-updates...\"\r\nt MSG_244 \"Updates: verbinden met het internet niet mogelijk\"\r\nt MSG_245 \"Updates: kon versie-data niet ophalen\"\r\nt MSG_246 \"Er is een nieuwe versie van Rufus beschikbaar!\"\r\nt MSG_247 \"Geen nieuwe versie van Rufus gevonden\"\r\nt MSG_248 \"Registersleutels van toepassing succesvol verwijderd\"\r\nt MSG_249 \"Registersleutels van toepassing verwijderen mislukt\"\r\nt MSG_250 \"%s ingeschakeld\"\r\nt MSG_251 \"%s uitgeschakeld\"\r\nt MSG_252 \"Grootte-controles\"\r\nt MSG_253 \"Detectie harde schijven\"\r\nt MSG_254 \"Uitgebreide FAT32-formattering forceren\"\r\nt MSG_255 \"NoDriveTypeAutorun zal verwijderd worden bij afsluiten\"\r\nt MSG_256 \"Valse drive-detectie\"\r\nt MSG_257 \"Joliet-ondersteuning\"\r\nt MSG_258 \"Rock Ridge-ondersteuning\"\r\nt MSG_259 \"Update forceren\"\r\nt MSG_260 \"NTFS-compressie\"\r\nt MSG_261 \"Image schrijven: %s\"\r\nt MSG_262 \"ISO-ondersteuning\"\r\nt MSG_263 \"JUISTE grootte-eenheden gebruiken\"\r\nt MSG_264 \"Map '%s' verwijderen\"\r\nt MSG_265 \"VMWare-schijfdetectie\"\r\nt MSG_266 \"Dubbele UEFI/BIOS-modus\"\r\nt MSG_267 \"Windows-image toepassen: %s\"\r\nt MSG_268 \"Windows-image toepassen...\"\r\nt MSG_269 \"Tijdstempels behouden\"\r\nt MSG_270 \"USB-debug\"\r\nt MSG_271 \"Image checksums berekenen: %s\"\r\nt MSG_272 \"MD5-, SHA1- en SHA256-checksums voor de geselecteerde image berekenen\"\r\nt MSG_273 \"De taal van de toepassing wijzigen\"\r\nt MSG_274 \"%s-image gedetecteerd\"\r\nt MSG_275 \"De geselecteerde image is een 'ISOHybrid'-image. Dit betekent dat hij geschreven kan worden in %s (bestandskopie)-modus of %s (schijf-image)-modus.\\nRufus beveelt de %s-modus aan zodat er altijd volledige toegang is tot de schijf nadat ze geschreven is.\\nAls er problemen zijn tijdens het opstarten, kunt u echter proberen om deze image opnieuw te schrijven in %s-modus.\\n\\nSelecteer de modus die u wilt gebruiken om deze image te schrijven:\"\r\nt MSG_276 \"Schrijven in %s-modus (aanbevolen)\"\r\nt MSG_277 \"Schrijven in %s-modus\"\r\nt MSG_278 \"Controleren op conflicterende processen...\"\r\nt MSG_279 \"Niet opstartbaar\"\r\nt MSG_280 \"Schijf of ISO-image\"\r\nt MSG_281 \"%s (selecteren)\"\r\nt MSG_282 \"Exclusieve USB-drive vergrendeling\"\r\nt MSG_283 \"Ongeldige handtekening\"\r\nt MSG_284 \"Het gedownloade programmabestand heeft geen digitale handtekening.\"\r\nt MSG_285 \"Het gedownloade programmabestand is ondertekend door '%s'.\\nDit is geen herkende handtekening en zou dus kunnen betekenen dat iemand malware in dit bestand heeft verborgen...\\nWeet u zeker dat u dit bestand wilt uitvoeren?\"\r\nt MSG_286 \"Nullen schrijven : %s\"\r\nt MSG_287 \"Detectie van niet-USB verwijderbare drives\"\r\nt MSG_288 \"Ontbrekende verhoogde rechten\"\r\nt MSG_289 \"Dit programma kan alleen starten met verhoogde rechten\"\r\nt MSG_290 \"Bestandsindexering\"\r\nt MSG_291 \"Versie-selectie\"\r\nt MSG_292 \"Selecteer de Windows-versie die u wilt installeren:\"\r\nt MSG_293 \"Niet ondersteunde Windows-versie\"\r\nt MSG_294 \"Deze Windows-versie wordt niet langer ondersteund door Rufus.\\nDe laatste versie van Rufus die compatibel is met dit platform is v%d.%d.\"\r\nt MSG_295 \"Waarschuwing: niet-officiële versie\"\r\nt MSG_296 \"Deze versie van Rufus is NIET gemaakt door de originele ontwikkelaar(s).\\n\\nWeet u zeker dat u dit programma wilt uitvoeren?\"\r\nt MSG_297 \"Onvolledige ISO gedetecteerd\"\r\nt MSG_298 \"Het ISO-bestand dat u geselecteerd heeft, komt niet overeen met zijn opgegeven grootte: %s van de data ontbreekt!\\n\\nAls u dit bestand van het internet heeft gehaald, probeer een nieuwe kopie te downloaden en te verifiëren of de MD5- of SHA-checksums overeenkomen met de officiële versies.\\n\\nMerk op dat u de MD5 of SHA in Rufus kunt berekenen door op de (✓)-knop te klikken.\"\r\nt MSG_299 \"Validatiefout tijdstempel\"\r\nt MSG_300 \"Rufus kon niet valideren dat de tijdstempel van de gedownloade update recenter is dan die van de huidige versie.\\n\\nOm mogelijke aanvalsscenario's te voorkomen is het updateproces afgebroken en zal de download verwijderd worden. Controleer het logboek voor meer details.\"\r\nt MSG_301 \"Toepassingsinstellingen weergeven\"\r\nt MSG_302 \"Informatie over deze toepassing weergeven\"\r\nt MSG_303 \"Logboek weergeven\"\r\nt MSG_304 \"Een schijf-image aanmaken van het geselecteerde apparaat\"\r\nt MSG_305 \"Gebruik deze optie om aan te geven of u Windows op een andere schijf wilt installeren, of als u Windows rechtstreeks vanaf deze schijf wilt opstarten (Windows To Go).\"\r\nt MSG_306 \"Snel nullen schrijven: %s\"\r\nt MSG_307 \"dit kan een tijdje duren\"\r\nt MSG_308 \"VHD-detectie\"\r\nt MSG_309 \"Gecomprimeerd archief\"\r\nt MSG_310 \"De ISO die u hebt geselecteerd, maakt gebruik van UEFI en is klein genoeg om te worden geschreven als een EFI-systeempartitie (ESP). Schrijven naar een ESP in plaats van te schrijven naar een generieke gegevenspartitie die de hele schijf bezet, kan de voorkeur hebben voor sommige soorten installaties.\\n\\nSelecteer de modus die u wilt gebruiken om deze image te schrijven:\"\r\nt MSG_311 \"Gebruik %s (in het hoofdvenster) om in te schakelen.\"\r\nt MSG_313 \"Opslaan naar VHD\"\r\nt MSG_314 \"Image-checksums berekenen\"\r\nt MSG_315 \"Meerdere knoppen\"\r\nt MSG_316 \"Aantal bewerkingen\"\r\nt MSG_317 \"Schijf-ID\"\r\nt MSG_318 \"Standaard thread-prioriteit: %d\"\r\nt MSG_319 \"Opstartmarkering negeren\"\r\nt MSG_320 \"Partitie-layout verversen (%s)...\"\r\nt MSG_321 \"De image die u hebt geselecteerd is een ISOHybrid, maar de makers ervan hebben hem niet compatibel gemaakt met de ISO/bestandskopieermodus.\\nAls gevolg daarvan zal de DD-image schrijfmodus worden afgedwongen.\"\r\nt MSG_322 \"Kan '%s' niet openen of lezen\"\r\nt MSG_325 \"Windows aanpassen: %s\"\r\nt MSG_326 \"Gebruikersopties toepassen...\"\r\nt MSG_327 \"Windows gebruikerservaring\"\r\nt MSG_328 \"Windows-installatie aanpassen?\"\r\nt MSG_329 \"Verwijder de vereiste voor 4GB+ RAM, Secure Boot en TPM 2.0\"\r\nt MSG_330 \"Verwijder de vereiste voor een online Microsoft-account\"\r\nt MSG_331 \"Gegevensverzameling uitschakelen (privacy-vragen overslaan)\"\r\nt MSG_332 \"Voorkomen dat Windows To Go toegang heeft tot interne schijven\"\r\nt MSG_333 \"Lokale account met gebruikersnaam aanmaken:\"\r\nt MSG_334 \"Regionale opties op dezelfde waarden als deze gebruiker instellen\"\r\nt MSG_335 \"Automatische Bitlocker-apparaatversleuteling uitschakelen\"\r\nt MSG_337 \"Om deze functie te kunnen gebruiken, moet u een extra bestand ('%s') downloaden van Microsoft:\\n- Selecteer 'Ja' om verbinding te maken met internet en het bestand te downloaden\\n- Selecteer 'Nee' om de bewerking te annuleren\\n\\nOpmerking: het bestand wordt gedownload in de map van de toepassing en wordt automatisch opnieuw gebruikt als het aanwezig is.\"\r\nt MSG_338 \"Ingetrokken UEFI-bootloader gedetecteerd\"\r\nt MSG_339 \"Rufus heeft gedetecteerd dat de ISO die u hebt geselecteerd een UEFI-bootloader bevat die is ingetrokken en %s zal produceren wanneer Secure Boot is ingeschakeld op een volledig bijgewerkt UEFI-systeem.\\n\\n- Als u deze ISO-image hebt verkregen van een niet-vertrouwde bron, houdt u best rekening met de mogelijkheid dat het UEFI-malware bevat en vermijdt u om ervan op te starten.\\n- Als u het van een betrouwbare bron hebt verkregen, moet u proberen een meer up-to-date versie te vinden die deze waarschuwing niet produceert.\"\r\nt MSG_340 \"een \\\"Security Violation\\\"-scherm\"\r\nt MSG_341 \"een Windows-herstelscherm (BSOD) met '%s'\"\r\nt MSG_342 \"Gecomprimeerde VHDX-image\"\r\nt MSG_343 \"Niet-gecomprimeerde VHD-image\"\r\nt MSG_344 \"Full Flash Update image\"\r\nt MSG_345 \"Om deze functionaliteit te kunnen gebruiken, moeten enkele extra gegevens worden gedownload van Microsoft:\\n- Selecteer 'Ja' om verbinding te maken met internet en ze te downloaden\\n- Selecteer 'Nee' om de bewerking te annuleren\"\r\nt MSG_346 \"Windows beperken tot S-Modus (NIET COMPATIBEL met omzeiling voor online account)\"\r\nt MSG_347 \"Expert-modus\"\r\nt MSG_348 \"Archiefbestanden uitpakken: %s\"\r\nt MSG_349 \"Rufus MBR gebruiken\"\r\nt MSG_900 \"Rufus is een programma dat helpt bij het formatteren en aanmaken van opstartbare USB-flash-drives, zoals USB-sticks, geheugensticks, enz.\"\r\nt MSG_901 \"Officiële site: %s\"\r\nt MSG_902 \"Broncode: %s\"\r\nt MSG_903 \"Wijzigingslog: %s\"\r\nt MSG_904 \"Deze toepassing valt onder de voorwaarden van de GNU Public License (GPL) versie 3.\\nZie https://www.gnu.org/licenses/gpl-3.0.nl.html voor details.\"\r\nt MSG_905 \"Opstarten\"\r\nt MSG_910 \"USB, flashkaart en virtuele schijven formatteren naar FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"FreeDOS opstartbare USB-schijven aanmaken\"\r\nt MSG_912 \"Opstartbare schijven aanmaken via opstartbare ISO's (Windows, Linux, enz)\"\r\nt MSG_913 \"Opstartbare schijven aanmaken van opstartbare schijf-images, inclusief gecomprimeerde images\"\r\nt MSG_914 \"BIOS of UEFI opstartbare schijven aanmaken, inclusief UEFI opstartbare NTFS\"\r\nt MSG_915 \"'Windows To Go'-schijven aanmaken\"\r\nt MSG_916 \"Windows 11 installatieschijven aanmaken voor pc's die geen TPM of Secure Boot hebben\"\r\nt MSG_917 \"Persistent Linux partities aanmaken\"\r\nt MSG_918 \"VHD/DD-images van de geselecteerde schijf aanmaken\"\r\nt MSG_919 \"MD5, SHA-1, SHA-256 en SHA-512 controlesommen berekenen van de geselecteerde image\"\r\nt MSG_920 \"Controles uitvoeren op slechte blokken, inclusief detectie van \\\"valse\\\" flashdrives\"\r\nt MSG_921 \"Officiële Microsoft Windows retail ISO's downloaden\"\r\nt MSG_922 \"UEFI Shell ISO's downloaden\"\r\n\r\n#########################################################################\r\nl \"fi-FI\" \"Finnish (Suomi)\" 0x040B\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Tietoja Rufus-sovelluksesta\"\r\nt IDC_ABOUT_LICENSE \"Lisenssi\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Aseman ominaisuudet\"\r\nt IDS_DEVICE_TXT \"Laite\"\r\nt IDS_BOOT_SELECTION_TXT \"Boottaustyypin valinta\"\r\nt IDC_SELECT \"Valitse\"\r\nt IDS_IMAGE_OPTION_TXT \"Levykuvan määritys\"\r\nt IDS_PARTITION_TYPE_TXT \"Osion tyyppi\"\r\nt IDS_TARGET_SYSTEM_TXT \"Kohdejärjestelmä\"\r\nt IDC_LIST_USB_HDD \"Näytä USB-kiintolevyt\"\r\nt IDC_OLD_BIOS_FIXES \"Lisää korjauksia vanhoja BIOS-versioita varten\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Ota käyttöön ajonaikainen UEFI-tietovälineen tarkistus\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Alustusasetukset\"\r\nt IDS_FILE_SYSTEM_TXT \"Tiedostojärjestelmä\"\r\nt IDS_CLUSTER_SIZE_TXT \"Tilanvarausyksikkö\"\r\nt IDS_LABEL_TXT \"Aseman nimi\"\r\nt IDC_QUICK_FORMAT \"Pika-alustus\"\r\nt IDC_BAD_BLOCKS \"Vioittuneiden lohkojen tarkistus\"\r\nt IDC_EXTENDED_LABEL \"Luo laajennetut nimi- ja kuvaketiedostot\"\r\nt IDS_STATUS_TXT \"Tila\"\r\nt IDCANCEL \"Sulje\"\r\nt IDC_START \"Aloita\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Sulje\"\r\nt IDD_LICENSE \"Rufus-lisenssi\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Sulje\"\r\nt IDD_LOG \"Loki\"\r\nt IDC_LOG_CLEAR \"Tyhjennä\"\r\nt IDC_LOG_SAVE \"Tallenna\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Sulje\"\r\nt IDD_NEW_VERSION \"Tarkista päivitysten saatavuus - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Saatavilla on uudempi versio. Ole hyvä ja lataa ohjelman uusin versio!\"\r\nt IDC_WEBSITE \"Klikkaa tästä päästäksesi verkkosivulle\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Julkaisutiedotteet\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Lataa\"\r\nt IDC_DOWNLOAD \"Lataa\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Lisätietoja\"\r\nt IDYES \"Kyllä\"\r\nt IDNO \"Ei\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Sulje\"\r\nt IDD_UPDATE_POLICY \"Päivityskäytäntö ja -asetukset\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Asetukset\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Tarkista päivitykset\"\r\nt IDS_INCLUDE_BETAS_TXT \"Sisällytä beta-versiot\"\r\nt IDC_CHECK_NOW \"Tarkista nyt\"\r\n\r\nt MSG_001 \"Toinen prosessi käynnissä\"\r\nt MSG_002 \"Rufus-sovellus on jo käynnissä.\\nSulje ensimmäinen Rufus-sovellus jatkaaksesi tämän sovelluksen käyttöä.\"\r\nt MSG_003 \"VAROITUS: KAIKKI TIEDOT LAITTEESSA '%s' POISTETAAN.\\nJatkaaksesi toimenpidettä valitse OK. Lopettaaksesi valitse PERUUTA.\"\r\nt MSG_004 \"Rufus-päivityskäytäntö\"\r\nt MSG_005 \"Haluatko sallia Rufuksen etsiä uusia päivityksiä verkosta?\"\r\nt MSG_006 \"Sulje\"\r\nt MSG_007 \"Peruuta\"\r\nt MSG_008 \"Kyllä\"\r\nt MSG_009 \"Ei\"\r\nt MSG_010 \"Viallisia lohkoja löydetty\"\r\nt MSG_011 \"Tarkistus valmis: %d viallista lohkoa löydetty\\n  %d lukuvirhe(ttä)\\n  %d kirjoitusvirhe(ttä)\\n  %d korruptiovirhe(ttä)\"\r\nt MSG_012 \"%s\\nA voit tarkastella tarkempaa raporttia kohteessa:\\n%s\"\r\nt MSG_013 \"Pois käytöstä\"\r\nt MSG_014 \"Päivittäin\"\r\nt MSG_015 \"Viikoittain\"\r\nt MSG_016 \"Kuukausittain\"\r\nt MSG_017 \"Mukautettu\"\r\nt MSG_018 \"Tämä versio: %d.%d (Build %d)\"\r\nt MSG_019 \"Viimeisin versio: %d.%d (Build %d)\"\r\nt MSG_020 \"tavua\"\r\nt MSG_026 \"tavua\"\r\nt MSG_027 \"kilotavua\"\r\nt MSG_028 \"megatavua\"\r\nt MSG_029 \"Oletus\"\r\nt MSG_030 \"%s (Oletus)\"\r\nt MSG_031 \"BIOS (tai UEFI-CSM)\"\r\nt MSG_032 \"UEFI (ei-CSM)\"\r\nt MSG_033 \"BIOS tai UEFI\"\r\nt MSG_034 \"%d testi\"\r\nt MSG_035 \"%d testiä %s\"\r\nt MSG_036 \"ISO-kuva\"\r\nt MSG_037 \"Sovellus\"\r\nt MSG_038 \"Keskeytä\"\r\nt MSG_039 \"Käynnistä\"\r\nt MSG_040 \"Lataa\"\r\nt MSG_041 \"Käyttäjä peruutti toiminnon\"\r\nt MSG_042 \"Virhe\"\r\nt MSG_043 \"Virhe: %s\"\r\nt MSG_044 \"Tiedoston lataus\"\r\nt MSG_045 \"USB-tallennuslaite (Yleinen)\"\r\nt MSG_046 \"%s (Levy %d) [%s]\"\r\nt MSG_047 \"Useita osioita\"\r\nt MSG_048 \"Rufus - Tyhjennetään puskuria\"\r\nt MSG_049 \"Rufus - Peruutus\"\r\nt MSG_050 \"Onnistui.\"\r\nt MSG_051 \"Määrittämätön virhe alustaessa.\"\r\nt MSG_052 \"Valittua tiedostojärjestelmää ei voida käyttää tässä tietovälineessä.\"\r\nt MSG_053 \"Pääsy laitteeseen on evätty.\"\r\nt MSG_054 \"Tietoväline on kirjoitussuojattu.\"\r\nt MSG_055 \"Laite on toisen prosessin käytössä. Sulje prosessit, jotka saattavat käyttää laitetta.\"\r\nt MSG_056 \"Tälle laitteelle ei voida suorittaa pika-alustusta.\"\r\nt MSG_057 \"Aseman nimi ei kelpaa.\"\r\nt MSG_058 \"Laitteen tunniste ei kelpaa.\"\r\nt MSG_059 \"Valittua tilanvarausyksikköä ei voida käyttää tämän laitteen kanssa.\"\r\nt MSG_060 \"Aseman koko ei kelpaa.\"\r\nt MSG_061 \"Aseta irroitettava tietoväline asemaan.\"\r\nt MSG_062 \"Ohjelma vastaanotti ei-tuetun komennon.\"\r\nt MSG_063 \"Muistinvarausvirhe.\"\r\nt MSG_064 \"Virhe lukiessa.\"\r\nt MSG_065 \"Virhe kirjoittaessa.\"\r\nt MSG_066 \"Asennus epäonnistui\"\r\nt MSG_067 \"Tietovälinettä ei voitu avata. Se voi olla toisen prosessin käytössä. Irroita ja yhdistä tietoväline ja yritä uudelleen.\"\r\nt MSG_068 \"Levyä ei voitu osioida.\"\r\nt MSG_069 \"Tietoja ei voitu kopioida kohdelevylle.\"\r\nt MSG_070 \"Käyttäjä peruutti.\"\r\nt MSG_071 \"Säiettä ei voitu käynnistää.\"\r\nt MSG_072 \"Lohkojen tarkistus ei valmistunut.\"\r\nt MSG_073 \"ISO-levykuvan skannaus epäonnistui.\"\r\nt MSG_074 \"ISO-levykuvan purkaminen epäonnistui.\"\r\nt MSG_075 \"Asemaa ei voitu ottaa uudelleen käyttöön.\"\r\nt MSG_076 \"Tiedostoja ei voitu päivittää/asentaa käynnistystä varten.\"\r\nt MSG_077 \"Levykirjainta ei voitu asettaa.\"\r\nt MSG_078 \"GUID-asemaa ei voitu ottaa käyttöön.\"\r\nt MSG_079 \"Laite ei ole valmis.\"\r\nt MSG_080 \"Rufus havaitsi, että Windows tyhjentää sisäistä puskuria USB-laitteelle.\\n\\nUSB-laitteesi nopeudesta riippuen toiminnon suorittamisessa voi kestää kauan, varsinkin suurilla tiedostoilla.\\n\\nSuosittelemme, että annat Windowsin suorittaa toiminnon loppuun välttyäksesi virheiltä. Jos et kuitenkaan jaksa enää odottaa, voit ottaa laitteen irti...\"\r\nt MSG_081 \"Levykuvaa ei tueta\"\r\nt MSG_082 \"Valittu levykuva ei ole boottava tai se käyttää käynnistys- tai pakkausmenetelmää jota Rufus ei tue...\"\r\nt MSG_083 \"Korvataanko %s?\"\r\nt MSG_084 \"Tämä ISO-levykuva vaikuttaisi käyttävän vanhentunutta '%s'-versiota.\\nTämän vuoksi käynnistysvalikot saattavat näkyä väärin.\\n\\nRufus voi ladata uudemman version ongelman korjaamiseksi:\\n- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi tiedoston\\n- Valitse 'Ei' jättääksesi ISO-levykuvan alkuperäiseen muotoonsa\\nJos et ole varma, sinun kannattaa valita 'Kyllä'.\\n\\nHuomio: Uusi tiedosto ladataan nykyiseen sijaintiin ja kun '%s' löytyy sijainnista, sitä käytetään automaattisesti.\"\r\nt MSG_085 \"Ladataan %s\"\r\nt MSG_086 \"ISO-levykuvaa ei valittu\"\r\nt MSG_087 \"%s NAND-muistille\"\r\nt MSG_088 \"Levykuva on liian suuri\"\r\nt MSG_089 \"Levykuva on liian suuri valittuun kohteeseen.\"\r\nt MSG_090 \"ISO-levykuvaa ei tueta\"\r\nt MSG_091 \"UEFI-kohdetyyppiä käytettäessä vain EFI-boottaavat ISO-levykuvat ovat tuettuna. Valitse EFI-boottaava ISO-levykuva tai valitse kohdetyypiksi BIOS.\"\r\nt MSG_092 \"Tiedostojärjestelmää ei tueta\"\r\nt MSG_093 \"TÄRKEÄÄ: TÄMÄ LEVYASEMA SISÄLTÄÄ USEITA OSIOITA!!\\n\\nSiihen saattaa kuulua osioita/asemia, joita ei ole listattuna tai edes näkyvissä Windowsissa. Jos haluat jatkaa, olet vastuussa mahdollisesta tietojen häviämisestä näillä osioilla.\"\r\nt MSG_094 \"Useita osioita havaittu\"\r\nt MSG_095 \"DD-kuva\"\r\nt MSG_096 \"Valittua tiedostojärjestelmää ei voida käyttää tämäntyyppisen ISO-levykuvan kanssa. Valitse toinen tiedostojärjestelmä tai käytä toista ISO-levykuvaa.\"\r\nt MSG_097 \"'%s' on käytettävissä vain NTFS-tiedostojärjestelmän kanssa.\"\r\nt MSG_098 \"TÄRKEÄÄ: Olet asentamassa 'Windows To Go' -järjestelmää, mutta kohdeasemaa ei ole määritelty kiinteäksi. Tästä johtuen Windows todennäköisesti pysähtyy käynnistyksessä, sillä Microsoft ei ole suunnitellut sitä toimivaksi asemilla, jotka ovat merkitty irroitettaviksi.\\n\\nHaluatko kuitenkin jatkaa?\\n\\nHuomio: 'Kiinteä/irroitettava' -määritys on laitteiston ominaisuus, joka voidaan vaihtaa vain aseman valmistajan erityisohjelmistolla. Näitä työkaluja ei kuitenkaan lähes milloinkaan levitetä julkiseen käyttöön...\"\r\nt MSG_099 \"Tiedostojärjestelmärajoitus\"\r\nt MSG_100 \"Tämä ISO-levykuva sisältää yli 4 GB-kokoisen tiedoston, joka ylittää FAT ja FAT32 -tiedostojärjestelmien enimmäiskoon.\"\r\nt MSG_101 \"WIM-tuki puuttuu\"\r\nt MSG_102 \"Käytössä oleva alusta ei kykene purkamaan tiedostoja WIM-arkistoista. WIM-purkaminen on välttämätöntä EFI-bootattavien Windows 7 ja Windows Vista USB-asemien luomisessa. Voit korjata tilanteenasentamalla viimeaikaisen version 7-Zip-ohjelmasta.\\nHaluatko vierailla 7-Zip-lataussivustolla?\"\r\nt MSG_103 \"Ladataanko %s?\"\r\nt MSG_104 \"%s tai uudempi vaatii '%s'-tiedoston asennuksen.\\nKoska kyseinen tiedosto on kooltaan aina yli 100 KB, ja se löytyy aina %s ISO-levykuvista, sitä ei ole sisällytetty Rufukseen.\\n\\nRufus voi ladata puuttuvan tiedoston puolestasi:\\n- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi tiedoston\\n- Valitse 'Ei' jos haluat manuaalisesti kopioida tämän tiedoston asemalle myöhemmin\\n\\nHuomio: Tiedosto ladataan nykyseen sijaintiin ja kun '%s' löytyy sijainnista, sitä käytetään automaattisesti.\"\r\nt MSG_105 \"Peruuttaminen saattaa jättää laitteen KÄYTTÖKELVOTTOMAAN tilaan.\\nJos haluat varmasti peruuttaa, valitse KYLLÄ. Muuten, valitse EI.\"\r\nt MSG_106 \"Valitse kansio\"\r\nt MSG_107 \"Kaikki tiedostot\"\r\nt MSG_108 \"Rufuksen loki\"\r\nt MSG_109 \"0x%02X (Levy %d)\"\r\nt MSG_110 \"MS-DOS ei voi käynnistyä laitteelta, joka käyttää 64 kilotavun tilanvarausyksikköä.\\nVaihda tilanvarausyksikköä tai käytä FreeDOSia.\"\r\nt MSG_111 \"Epäsopiva tilanvarausyksikkö\"\r\nt MSG_112 \"Suurten UDF-asemien alustus voi kestää kauan. USB 2.0-nopeuksilla arvioitu alustuksen kesto on %d:%02d, minkä aikana etenemispalkki vaikuttaa pysähtyneeltä. Ole kärsivällinen!\"\r\nt MSG_113 \"Suuri UDF-asema\"\r\nt MSG_114 \"Tämä kuva käyttää Syslinuxia %s%s, mutta tämä sovellus sisältää asennustiedostot vain Syslinuxille %s%s.\\n\\nKoska Syslinuxin uudet versiot eivät ole keskenään yhteensopivia, eikä Rufus voisi sisältää niitä kaikkia, on kaksi lisätiedostoa ladattava internetistä ('ldlinux.sys' ja 'ldlinux.bss'):\\n- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi nämä tiedostot\\n- Valitse 'Ei' peruaksesi toiminnon\\n\\nHuomio: Tiedostot ladataan nykyiseen sovelluskansioon ja niitä uudelleenkäytetään automaattisesti, jos se ovat jo olemassa.\"\r\nt MSG_115 \"Lataus vaaditaan\"\r\nt MSG_116 \"Tämä kuva käyttää Grubia %s, mutta tämä sovellus sisältää asennustiedostot vain Grubille %s.\\n\\nKoska Grubin eri versiot eivät välttämättä ole yhteensopivia eikä jokaista versiota voida sisällyttää, Rufus yrittää etsiä versiota Grub-asennustiedostosta ('core.img'), joka täsmäisi levykuvaasi:\\n- Valitse 'Kyllä' yhdistääksesi internetiin ja yrittääksesi ladata tämän\\n- Valitse 'Ei' käyttääksesi Rufuksen sisältämää vakioversiota\\n- Valitse 'Peruuta' peruaksesi toiminnon\\n\\nHuomio: Tiedosto ladataan nykyiseen sovelluskansioon ja sitä käytetään automaattisesti sen löytyessä. Jos vastaavaa ei löydy verkosta, käytetään vakioversiota.\"\r\nt MSG_117 \"Tavanomainen Windowsin asennus\"\r\nt MSG_119 \"aseman lisäasetukset\"\r\nt MSG_120 \"formatoinnin lisäasetukset\"\r\nt MSG_121 \"Näytä %s\"\r\nt MSG_122 \"Piilota %s\"\r\nt MSG_123 \"Pysyvän osion koko\"\r\nt MSG_124 \"Ei pysyvää osiota\"\r\nt MSG_125 \"Aseta pysyvän osion koko 'live USB' -tietovälineitä varten. Koon asettaminen arvoon 0 poistaa pysyvän osion käytöstä.\"\r\nt MSG_126 \"Valitse osion kokoyksikkö.\"\r\nt MSG_127 \"Älä näytä tätä viestiä uudelleen\"\r\nt MSG_128 \"Tärkeä huomio liittyen %s\"\r\nt MSG_129 \"Loit juuri tietovälineen, joka käyttää UEFI:NTFS -käynnistyslataajaa. Muistathan, että käynnistäminen tältä tietovälineeltä VAATII SECURE BOOT -OMINAISUUDEN POISTAMISTA KÄYTÖSTÄ.\\nJos haluat tietää tarkemmin miksi tämä on välttämätöntä, voit painaa alla olevaa 'Lisätietoja' -painiketta.\"\r\nt MSG_130 \"Windows-levykuvan valinta\"\r\nt MSG_131 \"Tämä ISO-tiedosto sisältää useita Windows-levykuvia.\\nValitse levykuva, jota haluat käyttää tähän asennukseen:\"\r\nt MSG_132 \"Jokin toinen ohjelma tai prosessi käyttää tätä levyä parhaillaan. Haluatko silti alustaa sen?\"\r\nt MSG_133 \"Rufus on havainnut, että yrität luoda Windows to Go -tietovälinettä joka pohjautuu 1809 ISO-levykuvaan.\\n\\n*MICROSOFTIN OHJELMOINTIVIRHEEN* vuoksi tämä tietoväline kaatuu Windowsin käynnistyksen aikana (Blue Screen Of Death), ellet manuaalisesti korvaa 'WppRecorder.sys' -tiedostoa 1803-versiolla.\\n\\nHuomaathan, että 'WppRecorder.sys' on Microsoftin tekijänoikeudellinen tiedosto ja täten Rufus ei voi automaattisesti korjata tätä virhettä, sillä emme voi tarjota kyseistä tiedostoa sovelluksemme kautta lakiteknisistä syistä...\"\r\nt MSG_134 \"Koska osion tyypiksi on valittu MBR, voi Rufus luoda vain maksimissaan 2 TB:n kokoisen osion tälle tietovälineelle jättäen %s levytilaa käyttökelvottomaksi.\\n\\nHaluatko varmasti jatkaa?\"\r\nt MSG_135 \"Versio\"\r\nt MSG_136 \"Julkaisu\"\r\nt MSG_137 \"Painos\"\r\nt MSG_138 \"Kieli\"\r\nt MSG_139 \"Arkkitehtuuri\"\r\nt MSG_140 \"Jatka\"\r\nt MSG_141 \"Takaisin\"\r\nt MSG_142 \"Odota...\"\r\nt MSG_143 \"Lataa käyttäen selainta\"\r\nt MSG_144 \"Windowsin ISO-levykuvien lataaminen ei ole mahdollista, koska Microsoft on muuttanut verkkosivujaan sen estämiseksi.\"\r\nt MSG_145 \"PowerShell 3.0 tai uudempi tarvitaan tämän komennon suorittamiseksi.\"\r\nt MSG_146 \"Haluatko yhdistää verkkoon ja ladata sen?\"\r\nt MSG_148 \"Suoritetaan latauskomentoa...\"\r\nt MSG_149 \"Lataa ISO-levykuva\"\r\nt MSG_150 \"Tietokoneen tyyppi, jonka kanssa aiot käyttää asemaa. Sinun on määritettävä, onko kohdelaitteesi BIOS- vai UEFI-tyyppinen ennen aseman luomista, sillä väärän tyypin valinta voi estää käynnistymisen.\"\r\nt MSG_151 \"'UEFI-CSM' tarkoittaa, että laite käynnistyy vain emuloidussa BIOS-tilassa (tunnetaan myös nimellä 'Legacy Mode') UEFIn alaisena eikä natiivissa UEFI-tilassa.\"\r\nt MSG_152 \"'ei-CSM' tarkoittaa, että laite käynnistyy vain natiivissa UEFI-tilassa eikä emuloidussa BIOS-tilassa (joka tunnetaan myös nimellä 'Legacy Mode').\"\r\nt MSG_153 \"Testikuvio: 0x%02X\"\r\nt MSG_154 \"Testikuvio: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Testikuvio: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Testikuvio: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Asettaa kohteen tiedostojärjestelmän\"\r\nt MSG_158 \"Minimikoko, jonka datalohko varaa tiedostojärjestelmässä\"\r\nt MSG_159 \"Käytä tätä kenttää valitaksesi aseman nimen.\\nVoit käyttää kansainvälisiä merkkejä.\"\r\nt MSG_160 \"Näytä tai piilota lisäasetukset\"\r\nt MSG_161 \"Tarkista laite testikuviolla vioittuneiden lohkojen varalta\"\r\nt MSG_162 \"Poista valintaruudun valinta käyttääksesi \\\"hidasta\\\" alustustapaa\"\r\nt MSG_163 \"Tapa, jota käytetään osioiden luomiseen\"\r\nt MSG_164 \"Tapa, jolla asemasta tehdään boottaava\"\r\nt MSG_165 \"Paina valitaksesi tai lataaksesi levykuvan...\"\r\nt MSG_166 \"Valitse valintaruutu salliaksesi kansainvälisten merkkien näyttämisen ja asettaaksesi laitekuvakkeen (luo autorun.inf-tiedoston)\"\r\nt MSG_167 \"Asenna UEFI-käynnistyslataaja, joka tulee suorittamaan tietovälineelle MD5Sum-tiedostotarkistuksen\"\r\nt MSG_169 \"Luo ylimääräinen, piilotettu osio ja yritä kohdistaa osioiden rajoja.\\nTämä voi parantaa USB-laitteiden havaitsemista käynnistyksessä vanhemmissa BIOSeissa.\"\r\nt MSG_170 \"Ota käyttöön USB-kiintolevyjen listaus. KÄYTÄ OMALLA VASTUULLA!!!\"\r\nt MSG_171 \"Käynnistä alustustoiminto.\\nTämä POISTAA kaiken tiedon kohteesta!\"\r\nt MSG_172 \"Epäkelpo latauksen allekirjoitus\"\r\nt MSG_173 \"Paina valitaksesi...\"\r\nt MSG_174 \"Rufus - Luotettava USB-alustusohjelma\"\r\nt MSG_175 \"Versio %d.%d (Build %d)\"\r\nt MSG_176 \"Suomenkielinen käännös: Riku Brander\"\r\nt MSG_177 \"Raportoi virheitä tai pyydä parannuksia osoitteessa:\"\r\nt MSG_178 \"Muut tekijänoikeudet:\"\r\nt MSG_179 \"Päivityskäytäntö:\"\r\nt MSG_180 \"Jos annat ohjelman etsiä sovelluspäivityksiä, hyväksyt, että seuraavia tietoja saatetaan kerätä palvelimillemme:\"\r\nt MSG_181 \"Käyttöjärjestelmäsi arkkitehtuuri ja versio\"\r\nt MSG_182 \"Käyttämäsi sovelluksen versio\"\r\nt MSG_183 \"IP-osoitteesi\"\r\nt MSG_184 \"Yksityisten käyttötilastojen luomiseksi saatamme pitää tietoja kerättynä \\\\b enimmillään vuoden\\\\b0 . Emme kuitenkaan anna vapaaehtoisesti mitään yksittäistietoja kolmansille osapuolille.\"\r\nt MSG_185 \"Päivitysprosessi:\"\r\nt MSG_186 \"Rufus ei asenna tai aja taustapalveluja, siksi päivitystarkistukset suoritetaan vain pääsovelluksen ollessa käynnissä.\\\\line\\nInternetyhteys toki vaaditaan päivityksiä tarkistettaessa.\"\r\nt MSG_187 \"Levykuva ei ole sopiva valitulle käynnistysvalinnalle\"\r\nt MSG_188 \"Nykyinen levykuva ei vastaa valittua käynnistysvalintaa. Käytä toista levykuvaa tai valitse eri käynnistysvalinta.\"\r\nt MSG_189 \"Tämä ISO-levykuva ei ole yhteensopiva valitun tiedostojärjestelmän kanssa\"\r\nt MSG_190 \"Epäsopiva asema havaittu\"\r\nt MSG_191 \"Kirjoitustesti\"\r\nt MSG_192 \"Lukutesti\"\r\nt MSG_193 \"Ladattu %s\"\r\nt MSG_194 \"Ei voitu ladata %s\"\r\nt MSG_195 \"Käytetään sisällytettyä versiota %s -tiedostoista\"\r\nt MSG_196 \"TÄRKEÄÄ: TÄMÄ ASEMA KÄYTTÄÄ EPÄSTANDARDIA SEKTORIKOKOA!\\n\\nPerinteiset asemat käyttävät 512-tavuista sektorikokoa, mutta tämä asema käyttää %d-tavuista. Monesti tämä tarkoittaa sitä, että tältä asemalta boottaminen EI ONNISTU.\\nRufus voi yrittää luoda boottaavan aseman, mutta sen toiminnasta EI OLE TAKUITA.\"\r\nt MSG_197 \"Epästandardi sektorikoko havaittu\"\r\nt MSG_198 \"'Windows To Go' voidaan asentaa GPT-osioidulle asemalla vain, jos asema on merkitty kiinteäksi. Valittua asemaa ei havaittu asetetuksi kiinteäksi.\"\r\nt MSG_199 \"Tämä ominaisuus ei ole käytettävissä tällä alustalla.\"\r\nt MSG_201 \"Peruutetaan - Odota...\"\r\nt MSG_202 \"Skannataan ISO-levykuvaa...\"\r\nt MSG_203 \"ISO-levykuvan skannaus epäonnistui\"\r\nt MSG_204 \"Vanhentunut %s havaittu\"\r\nt MSG_205 \"Käytössä oleva levykuva: %s\"\r\nt MSG_206 \"Tiedosto %s puuttuu\"\r\nt MSG_207 \"Uusi asema\"\r\nt MSG_208 \"%d laite havaittu\"\r\nt MSG_209 \"%d laitetta havaittu\"\r\nt MSG_210 \"VALMIINA\"\r\nt MSG_211 \"Peruutettu\"\r\nt MSG_212 \"EPÄONNISTUI\"\r\nt MSG_213 \"Käynnistetään uutta sovellusta...\"\r\nt MSG_214 \"Uuden sovelluksen käynnistäminen epäonnistui\"\r\nt MSG_215 \"Avattu %s\"\r\nt MSG_216 \"Tallennettu %s\"\r\nt MSG_217 \"Alustus: %s\"\r\nt MSG_218 \"Luodaan tiedostojärjestelmää: Toiminto %d/%d suoritettu\"\r\nt MSG_219 \"NTFS-korjaus: %d%% valmiina\"\r\nt MSG_220 \"Alustetaan (%s) - arvioitu kesto %d:%02d...\"\r\nt MSG_221 \"Asetetaan nimeä (%s)...\"\r\nt MSG_222 \"Alustetaan (%s)...\"\r\nt MSG_223 \"NTFS-korjaus (Checkdisk)...\"\r\nt MSG_224 \"Selvitetään MBR/PBR/GPT -rakenteita...\"\r\nt MSG_225 \"Pyydetään pääsyä levylle...\"\r\nt MSG_226 \"Analysoidaan löytyviä käynnistyslistauksia...\"\r\nt MSG_227 \"Suljetaan olemassaolevaa asemaa...\"\r\nt MSG_228 \"Kirjoitetaan Master Boot Record...\"\r\nt MSG_229 \"Kirjoitetaan Partition Boot Record...\"\r\nt MSG_230 \"Kopioidaan DOS-tiedostoja...\"\r\nt MSG_231 \"Kopioidaan ISO-tiedostoja: %s\"\r\nt MSG_232 \"Win7 EFI -käynnistysasetus (%s)...\"\r\nt MSG_233 \"Viimeistellään, odota...\"\r\nt MSG_234 \"Asennetaan Syslinux %s...\"\r\nt MSG_235 \"Lohkot: %s %d/%d - %0.2f%% (%d/%d/%d virhettä)\"\r\nt MSG_236 \"Lohkot: Testataan satunnaisella kuviolla\"\r\nt MSG_237 \"Lohkot: Testataan kuviolla 0x%02X\"\r\nt MSG_238 \"Osioidaan (%s)...\"\r\nt MSG_239 \"Poistetaan osioita (%s)...\"\r\nt MSG_240 \"Ladatun päivityksen digitaalista allekirjoitusta ei voitu varmentaa. Järjestelmässäsi saattaa olla määritysongelma allekirjoitusten suhteen tai kyseessä voi olla haitallinen lataus.\\n\\nLadattu tiedosto poistetaan. Lisätietoja tapahtumasta löytyy Rufuksen lokista.\"\r\nt MSG_241 \"Ladataan: %s\"\r\nt MSG_242 \"Tiedoston lataaminen epäonnistui.\"\r\nt MSG_243 \"Tarkistetaan Rufus-päivityksiä...\"\r\nt MSG_244 \"Päivitykset: Ei saatu yhteyttä internetiin\"\r\nt MSG_245 \"Päivitykset: Ei päästy käsiksi versiotietoihin\"\r\nt MSG_246 \"Uusi Rufus-versio on saatavilla!\"\r\nt MSG_247 \"Ei löytynyt uudempaa Rufus-versiota\"\r\nt MSG_248 \"Rekisteriavaimet poistettu onnistuneesti\"\r\nt MSG_249 \"Rekisteriavainten poistaminen epäonnistui\"\r\nt MSG_250 \"%s päällä\"\r\nt MSG_251 \"%s pois päältä\"\r\nt MSG_252 \"Kokotarkistukset\"\r\nt MSG_253 \"Kiintolevyjen havaitseminen\"\r\nt MSG_254 \"Laajan FAT32-alustuksen pakotus\"\r\nt MSG_255 \"NoDriveTypeAutorun poistetaan suljettaessa\"\r\nt MSG_256 \"Valeasemien havaitseminen\"\r\nt MSG_257 \"Joliet-tuki\"\r\nt MSG_258 \"Rock Ridge -tuki\"\r\nt MSG_259 \"Päivityksen pakotus\"\r\nt MSG_260 \"NTFS-pakkaaminen\"\r\nt MSG_261 \"Kirjoitetaan levykuvaa: %s\"\r\nt MSG_262 \"ISO-tuki\"\r\nt MSG_263 \"OIKEIDEN tilayksiköiden kerrannaisten käyttö\"\r\nt MSG_264 \"Poistetaan kansiota '%s'\"\r\nt MSG_265 \"VMWare-levyn havaitseminen\"\r\nt MSG_266 \"Kaksois-UEFI/BIOS -tila\"\r\nt MSG_267 \"Asetetaan Windows-levykuvaa: %s\"\r\nt MSG_268 \"Asetetaan Windows-levykuvaa...\"\r\nt MSG_269 \"Aikaleimojen käyttö\"\r\nt MSG_270 \"USB-virheenkorjaus\"\r\nt MSG_271 \"Lasketaan levykuvan tarkistussummia: %s\"\r\nt MSG_272 \"Laske valitun levykuvan MD5-, SHA1- ja SHA256-tarkistussummat\"\r\nt MSG_273 \"Vaihda sovelluksen kieltä\"\r\nt MSG_274 \"%s-levykuva havaittu\"\r\nt MSG_275 \"Valitsemasi levykuva on muotoa 'ISOHybrid'. Tämä tarkoittaa, että se voidaan kirjoittaa joko %sna (tiedostojen kopiointi) tai %sna (levykuva).\\nRufus suosittelee käyttämään '%s' -tilaa, jotta sinulla pysyy täysi pääsy asemaan kirjoittamisen jälkeen.\\nJos törmäät ongelmiin käynnistyksessä, voit yrittää kirjoittaa levykuvaa uudelleen '%s' -tilassa.\\n\\nValitse tila, jota haluat käyttää levykuvan kirjoittamiseen:\"\r\nt MSG_276 \"Kirjoita %sna (Suositellaan)\"\r\nt MSG_277 \"Kirjoita %sna\"\r\nt MSG_278 \"Tarkistetaan ristiriidassa olevien prosessien varalta...\"\r\nt MSG_279 \"Ei-boottaava\"\r\nt MSG_280 \"Levy tai ISO-levykuva\"\r\nt MSG_281 \"%s (Ole hyvä ja valitse)\"\r\nt MSG_282 \"USB-aseman eksklusiivinen käyttö\"\r\nt MSG_283 \"Epäkelpo allekirjoitus\"\r\nt MSG_284 \"Ladatusta tiedostosta puuttuu digitaalinen allekirjoitus.\"\r\nt MSG_285 \"Ladatun tiedoston on allekirjoittanut '%s'.\\nEmme tunnista kyseistä allekirjoitusta, mikä saattaa viitata haitalliseen toimintaan...\\nHaluatko varmasti suorittaa tämän tiedoston?\"\r\nt MSG_286 \"Nollataan asemaa: %s\"\r\nt MSG_287 \"Ei-USB-liitäntäisten irroitettavien asemien tunnistus\"\r\nt MSG_288 \"Laajennetut käyttöoikeudet puuttuvat\"\r\nt MSG_289 \"Tämä sovellus vaatii laajennetut käyttöoikeudet toimiakseen\"\r\nt MSG_290 \"Tiedostojen indeksointi\"\r\nt MSG_291 \"Version valinta\"\r\nt MSG_292 \"Valitse Windows-versio, jonka haluat asentaa:\"\r\nt MSG_293 \"Tätä Windows-versiota ei tueta\"\r\nt MSG_294 \"Rufus ei enää tue tätä Windows-versiota.\\nViimeisin alustan kanssa yhteensopiva Rufus-versio on v%d.%d.\"\r\nt MSG_295 \"Varoitus: Epävirallinen versio\"\r\nt MSG_296 \"Tämä versio ei ole Rufuksen virallisen kehittäjän tekemä.\\n\\nHaluatko varmasti suorittaa ohjelman?\"\r\nt MSG_297 \"Vajaakokoinen ISO-levykuva havaittu\"\r\nt MSG_298 \"Valitsemasi ISO-levykuva ei vastaa sen ilmoittamaa tiedostokokoa: %s ohjelmatiedosta puuttuu!\\n\\nJos latasit tämän tiedoston internetistä, yritä ladata tiedosto uudelleen ja varmista, että MD5- tai SHA-tarkistussumma täsmää alkuperäisen summan kanssa.\\n\\nVoit laskea MD5- tai SHA-tarkistussumman Rufuksessa painamalla (✓)-painiketta.\"\r\nt MSG_299 \"Aikaleiman vahvistusvirhe\"\r\nt MSG_300 \"Rufus ei pystynyt varmistamaan, että ladatun päivityksen aikaleima on nykyistä tiedostoa uudempi.\\n\\nMahdollisten hyökkäysmahdollisuuksien estämiseksi päivitysprosessi on keskeytetty ja lataus tullaan poistamaan. Lisätietoja tapahtumasta löytyy Rufuksen lokista.\"\r\nt MSG_301 \"Näytä sovelluksen asetukset\"\r\nt MSG_302 \"Näytä tietoa tästä sovelluksesta\"\r\nt MSG_303 \"Näytä loki\"\r\nt MSG_304 \"Luo levykuva valitusta laitteesta\"\r\nt MSG_305 \"Tällä valinnalla voit määrittää, aiotko asentaa Windowsin toiselle levylle vai haluatko käyttää Windowsia suoraan tältä asemalta (Windows To Go).\"\r\nt MSG_306 \"Pikanollataan asemaa: %s\"\r\nt MSG_307 \"tämä voi viedä hetken\"\r\nt MSG_308 \"VHD-tunnistus\"\r\nt MSG_309 \"Pakattu arkisto\"\r\nt MSG_310 \"Valitsemasi ISO-levykuva on UEFI-muotoinen ja tarpeeksi pienikokoinen kirjoitettavaksi EFI-järjestelmäosiona (ESP). ESP-osioon kirjoittaminen voi soveltua paremmin tietyille asennustavoille sen sijaan, että kirjoitus tapahtuisi yleiseen dataosioon käyttäen kaiken levytilan.\\n\\nValitse tila, jota haluat käyttää tämän levykuvan kirjoittamiseen:\"\r\nt MSG_311 \"Paina %s (ohjelman pääikkunassa) ottaaksesi ominaisuuden käyttöön.\"\r\nt MSG_312 \"Lisähajautusarvot (SHA512)\"\r\nt MSG_313 \"Tallenna VHD:lle\"\r\nt MSG_314 \"Laske levykuvan tarkistussummat\"\r\nt MSG_315 \"Useita painikkeita\"\r\nt MSG_316 \"Testien lukumäärä\"\r\nt MSG_317 \"Levyn tunniste\"\r\nt MSG_318 \"Säikeiden vakioprioriteetti: %d\"\r\nt MSG_319 \"Sivuuta Boot Marker\"\r\nt MSG_320 \"Päivitetään osioiden sijoittelua (%s)...\"\r\nt MSG_321 \"Valitsemasi levykuva on ISOHybrid-muotoinen, mutta sen tekijät eivät ole tehneet siitä yhteensopivaa ISO/tiedostotyyppisen kopiointitilan kanssa.\\nTämän vuoksi käyttöön otetaan DD-kuvan kirjoitustila.\"\r\nt MSG_322 \"Ei voitu avata tai lukea kohdetta '%s'\"\r\nt MSG_325 \"Asetetaan Windowsin mukautusasetuksia: %s\"\r\nt MSG_326 \"Asetetaan käyttäjäasetuksia...\"\r\nt MSG_327 \"Windows-käyttäjäkokemus\"\r\nt MSG_328 \"Mukauta Windows-asennusta?\"\r\nt MSG_329 \"Poista vaatimus 4GB+ keskusmuistille, Secure Bootille ja TPM 2.0:lle\"\r\nt MSG_330 \"Poista vaatimus Microsoftin online-käyttäjätilille\"\r\nt MSG_331 \"Poista käytöstä datan keräys (Ohita yksityisyyskysymykset)\"\r\nt MSG_332 \"Estä Windows To Go:n pääsy sisäisiin levyihin\"\r\nt MSG_333 \"Luo paikallinen käyttäjätili käyttäjänimellä:\"\r\nt MSG_334 \"Aseta alueelliset vaihtoehdot samoihin asetuksiin kuin nykyisellä käyttäjällä\"\r\nt MSG_335 \"Poista käytöstä automaattinen laitteen BitLocker-salaus\"\r\nt MSG_336 \"Pysyvä lokitiedosto\"\r\nt MSG_337 \"Tämän ominaisuuden käyttämiseksi Microsoftilta on ladattava lisätiedosto ('%s'):\\n- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi sen\\n- Valitse 'Ei' peruuttaaksesi toiminnon\\n\\nHuomio: Tiedosto ladataan sovelluksen kansioon ja sitä uudelleenkäytetään automaattisesti, jos se on jo olemassa.\"\r\nt MSG_338 \"Mitätöity UEFI-käynnistyslataaja havaittu\"\r\nt MSG_339 \"Rufus havaitsi, että käyttämäsi ISO-levykuva sisältää UEFI-käynnistyslataajan, joka on mitätöity ja tulee aiheuttamaan %s Secure Bootin ollessa päällä ajantasaisessa UEFI-kokoonpanossa.\\n\\n- Jos olet hankkinut tämän ISO-levykuvan ei-luotettavasta lähteestä, huomioi UEFI-haittaohjelmien mahdollisuus ja vältä siltä käynnistämistä.\\n- Jos olet hankkinut sen luotettavasta lähteestä, sinun tulisi yrittää etsiä uudempi versio, joka ei aiheuta tätä varoitusta.\"\r\nt MSG_340 \"\\\"Turvallisuusrikkomus\\\"-näkymän\"\r\nt MSG_341 \"Windowsin palautusnäkymän (BSOD) viestillä '%s'\"\r\nt MSG_342 \"Pakattu VHDX-levykuva\"\r\nt MSG_343 \"Pakkaamaton VHD-levykuva\"\r\nt MSG_344 \"Full Flash Update -levykuva\"\r\nt MSG_345 \"Tämän toiminnon käyttäminen vaatii lisätiedostojen lataamista Microsoftilta:\\n- Valitse 'Kyllä' yhdistääksesi internetiin ja ladataksesi ne\\n- Valitse 'Ei' peruuttaaksesi toiminnon\"\r\nt MSG_346 \"Rajoita Windows S Mode-tilaan (EI YHTEENSOPIVA verkkotilin ohituksen kanssa)\"\r\nt MSG_347 \"Asiantuntijatila\"\r\nt MSG_348 \"Puretaan tiedostoarkistoja: %s\"\r\nt MSG_349 \"Rufusin MBR:n käyttö\"\r\nt MSG_900 \"Rufus on ohjelma, joka auttaa alustamaan ja luomaan boottaavia USB-laitteita, kuten esimerkiksi USB-avaimia, muistitikkuja jne.\"\r\nt MSG_901 \"Virallinen sivusto: %s\"\r\nt MSG_902 \"Lähdekoodi: %s\"\r\nt MSG_903 \"Muutosloki: %s\"\r\nt MSG_904 \"Tämä sovellus on lisensoitu GNU Public License (GPL) version 3 ehtojen mukaisesti.\\nLisätietoja osoitteessa https://www.gnu.org/licenses/gpl-3.0.html (englanniksi).\"\r\nt MSG_905 \"Boottaus\"\r\nt MSG_910 \"Alusta USB-asemia, muistikortteja ja virtuaalisia asemia muotoon FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Luo boottaavia FreeDOS USB-asemia\"\r\nt MSG_912 \"Luo käynnistysasemia boottaavista ISO-kuvista (Windows, Linux jne.)\"\r\nt MSG_913 \"Luo käynnistysasemia boottaavista levykuvista, pakatut kuvat mukaanlukien\"\r\nt MSG_914 \"Luo BIOS- tai UEFI-boottaavia asemia, mukaanlukien UEFI-boottaavat NTFS-asemat\"\r\nt MSG_915 \"Luo 'Windows To Go' -asemia\"\r\nt MSG_916 \"Luo Windows 11 -asennusasemia tietokoneille, jotka eivät tue TPM- tai Secure Boot -ominaisuuksia\"\r\nt MSG_917 \"Luo pysyviä Linux-osioita\"\r\nt MSG_918 \"Luo VHD/DD-kuvia valitusta asemasta\"\r\nt MSG_919 \"Laske MD5, SHA-1, SHA-256 ja SHA-512 tarkistussummia valitusta levykuvasta\"\r\nt MSG_920 \"Suorita viallisten lohkojen tarkistuksia, sisältäen \\\"valheellisten\\\" muistitikkujen tunnistamisen\"\r\nt MSG_921 \"Lataa virallisia Microsoft Windowsin jälleenmyyntiversion ISO-levykuvia\"\r\nt MSG_922 \"Lataa UEFI Shell ISO-levykuvia\"\r\n\r\n#########################################################################\r\nl \"fr-FR\" \"French (Français)\" 0x040c, 0x080c, 0x0c0c, 0x100c, 0x140c, 0x180c, 0x1c0c, 0x200c, 0x240c, 0x280c, 0x2c0c, 0x300c, 0x340c, 0x380c, 0xe40c\r\nv 4.14\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"A propos de Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licence\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Options de Périphérique\"\r\nt IDS_DEVICE_TXT \"Périphérique\"\r\nt IDS_BOOT_SELECTION_TXT \"Type de démarrage\"\r\nt IDC_SELECT \"Sélection\"\r\nt IDS_IMAGE_OPTION_TXT \"Option d'image\"\r\nt IDS_PARTITION_TYPE_TXT \"Schéma de partition\"\r\nt IDS_TARGET_SYSTEM_TXT \"Système de destination\"\r\nt IDC_LIST_USB_HDD \"Lister les disques durs USB\"\r\nt IDC_OLD_BIOS_FIXES \"Ajouter les options de compatibilité pour vieux BIOS\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Activer la validation des média sous UEFI\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Options de Formatage\"\r\nt IDS_FILE_SYSTEM_TXT \"Système de fichiers\"\r\nt IDS_CLUSTER_SIZE_TXT \"Taille d'unité d'allocation\"\r\nt IDS_LABEL_TXT \"Nom de volume\"\r\nt IDC_QUICK_FORMAT \"Formatage rapide\"\r\nt IDC_BAD_BLOCKS \"Vérification de mauvais blocs\"\r\nt IDC_EXTENDED_LABEL \"Ajouter un label étendu et une icône\"\r\nt IDS_STATUS_TXT \"Statut\"\r\nt IDCANCEL \"Fermer\"\r\nt IDC_START \"Démarrer\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Fermer\"\r\nt IDD_LICENSE \"Licence Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Fermer\"\r\nt IDC_LOG_CLEAR \"Effacer\"\r\nt IDC_LOG_SAVE \"Enregistrer\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Fermer\"\r\nt IDD_NEW_VERSION \"Mise à jour de Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Une nouvelle version est disponible. Veuillez télécharger la nouvelle version !\"\r\nt IDC_WEBSITE \"Cliquez ici pour aller sur le site de Rufus\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Notes relatives à cette version\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Télécharger\"\r\nt IDC_DOWNLOAD \"Télécharger\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Plus d'information\"\r\nt IDYES \"Oui\"\r\nt IDNO \"Non\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Fermer\"\r\nt IDD_UPDATE_POLICY \"Paramètres de mises à jour\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Options\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Recherche mises à jour\"\r\nt IDS_INCLUDE_BETAS_TXT \"Inclure les versions bêta\"\r\nt IDC_CHECK_NOW \"Chercher maintenant\"\r\n\r\nt MSG_001 \"Autre instance détectée\"\r\nt MSG_002 \"Une autre instance de Rufus est en cours d'exécution.\\nVeuillez fermer la première instance avant d'en lancer une seconde.\"\r\nt MSG_003 \"ATTENTION : TOUTES LES DONNEES DU VOLUME '%s' VONT ETRE EFFACEES.\\nPour continuer cette opération, cliquez sur OK.\\nPour quitter cliquez sur ANNULER.\"\r\nt MSG_004 \"Mises à jour\"\r\nt MSG_005 \"Voulez-vous autoriser Rufus à chercher des mises à jour en ligne ?\"\r\nt MSG_006 \"Fermer\"\r\nt MSG_007 \"Annuler\"\r\nt MSG_008 \"Oui\"\r\nt MSG_009 \"Non\"\r\nt MSG_010 \"Blocs défectueux détectés\"\r\nt MSG_011 \"Vérification complète : %d bloc(s) défectueux détecté(s)\\n  %d erreur(s) de lecture\\n  %d erreur(s) d'écriture\\n  %d erreur(s) de corruption\"\r\nt MSG_012 \"%s\\nUn rapport plus détaillé peut être obtenu à :\\n%s\"\r\nt MSG_013 \"Jamais\"\r\nt MSG_014 \"Quotidienne\"\r\nt MSG_015 \"Hebdomadaire\"\r\nt MSG_016 \"Mensuelle\"\r\nt MSG_017 \"Personnalisée\"\r\nt MSG_018 \"Votre version : %d.%d (Build %d)\"\r\nt MSG_019 \"Dernière version : %d.%d (Build %d)\"\r\nt MSG_020 \"octets\"\r\nt MSG_021 \"Ko\"\r\nt MSG_022 \"Mo\"\r\nt MSG_023 \"Go\"\r\nt MSG_024 \"To\"\r\nt MSG_025 \"Po\"\r\nt MSG_026 \"octets\"\r\nt MSG_027 \"kilo-octets\"\r\nt MSG_028 \"méga-octets\"\r\nt MSG_029 \"Défaut\"\r\nt MSG_030 \"%s (Défaut)\"\r\nt MSG_031 \"BIOS (ou UEFI-CSM)\"\r\nt MSG_033 \"BIOS ou UEFI\"\r\nt MSG_034 \"%d passe\"\r\nt MSG_036 \"Image ISO\"\r\nt MSG_038 \"Annuler\"\r\nt MSG_039 \"Lancer\"\r\nt MSG_040 \"Télécharger\"\r\nt MSG_041 \"Opération annulée par l'utilisateur\"\r\nt MSG_042 \"Erreur\"\r\nt MSG_043 \"Erreur : %s\"\r\nt MSG_044 \"Téléchargement de fichier\"\r\nt MSG_045 \"Pérpih. de stockage USB (Générique)\"\r\nt MSG_046 \"%s (Disque %d) [%s]\"\r\nt MSG_047 \"Plusieurs partitions\"\r\nt MSG_048 \"Rufus - Flush de la mémoire tampon\"\r\nt MSG_049 \"Rufus - Annulation\"\r\nt MSG_050 \"Opération réussie.\"\r\nt MSG_051 \"Erreur indéterminée lors du formatage.\"\r\nt MSG_052 \"Ce système de fichiers ne peut pas être utilisé ici.\"\r\nt MSG_053 \"L'accès au périphérique est refusé.\"\r\nt MSG_054 \"Le périphérique est protégé en écriture.\"\r\nt MSG_055 \"Le périphérique est en cours d'utilisation par une autre application. Veuillez fermer toute autre application susceptible d'accéder au périphérique.\"\r\nt MSG_056 \"Le formatage rapide n'est pas disponible pour ce périphérique.\"\r\nt MSG_057 \"Le nom de volume est invalide.\"\r\nt MSG_058 \"Le handle de périphérique est invalide.\"\r\nt MSG_059 \"Cette taille de cluster n'est pas applicable ici.\"\r\nt MSG_060 \"La taille du volume est invalide.\"\r\nt MSG_061 \"Veuillez insérer un média dans le lecteur.\"\r\nt MSG_062 \"Une commande non prise en charge a été reçue.\"\r\nt MSG_063 \"Erreur d'allocation mémoire.\"\r\nt MSG_064 \"Erreur de lecture.\"\r\nt MSG_065 \"Erreur d'écriture.\"\r\nt MSG_066 \"L'installation a échoué\"\r\nt MSG_067 \"Impossible d'accéder au média. Il peut être en cours d'utilisation par une autre application. Essayer de déconnecter le média et essayez à nouveau.\"\r\nt MSG_068 \"Échec de partitionnement.\"\r\nt MSG_069 \"Impossible de copier les fichiers sur le périphérique de destination.\"\r\nt MSG_070 \"Opération annulée par l'utilisateur.\"\r\nt MSG_071 \"Impossible de créer le thread.\"\r\nt MSG_072 \"La vérification de blocs défectueux a été interrompue.\"\r\nt MSG_073 \"Échec d'analyse de l'image ISO.\"\r\nt MSG_074 \"Échec d'extraction de l'image ISO.\"\r\nt MSG_075 \"Échec lors du remontage du volume.\"\r\nt MSG_076 \"Échec de modification des fichiers de démarrage.\"\r\nt MSG_077 \"Échec d'assignation d'une lettre de volume.\"\r\nt MSG_078 \"Impossible de monter le volume GUID.\"\r\nt MSG_079 \"Le périphérique n'est pas prêt.\"\r\nt MSG_080 \"Rufus a détecté que Windows est en train de finir de vider la mémoire tampon.\\n\\nEn fonction de la vitesse de votre périphérique et de la taille du fichier, cette opération peut prendre beaucoup de temps.\\n\\nNous recommandons d'attendre que Windows complète cette opération pour éviter la corruption du périphérique. Mais si jamais vous en avez marre d'attendre, vous pouvez essayer de déconnecter le média...\"\r\nt MSG_081 \"Image non prise en charge\"\r\nt MSG_082 \"Cette image n'est pas démarrable, ou bien elle utilise une méthode de démarrage ou de compression qui n'est pas compatible avec Rufus...\"\r\nt MSG_083 \"Remplacer %s ?\"\r\nt MSG_084 \"Cette image ISO utilise une version obsolète du fichier '%s'.\\nLes menus de démarrage peuvent de pas fonctionner à cause de cela.\\n\\nRufus peut télécharger une nouvelle version du fichier pour résoudre ce problème :\\n- Choisissez 'Oui' pour télécharger le fichier depuis Internet\\n- Choisissez 'Non' pour garder le fichier de l'image ISO\\nSi vous ne savez pas quoi faire, sélectionnez 'Oui'.\\n\\nNote : Le nouveau fichier sera téléchargé dans le répertoire courant. Si un '%s' existe à cet endroit, il sera réutilisé automatiquement.\"\r\nt MSG_085 \"Téléchargement de %s\"\r\nt MSG_086 \"Aucune image sélectionnée\"\r\nt MSG_087 \"pour NAND %s\"\r\nt MSG_088 \"Image trop large\"\r\nt MSG_089 \"L'image est trop large pour être copiée sur le périphérique sélectionné.\"\r\nt MSG_090 \"Image ISO non prise en charge\"\r\nt MSG_091 \"Quand UEFI est sélectionné, seules les images ISO basées sur EFI sont supportées. Veuillez sélectionner une image ISO démarrable avec EFI ou sélectionner BIOS pour le système de destination.\"\r\nt MSG_092 \"Système de fichiers non pris en charge\"\r\nt MSG_093 \"IMPORTANT : CE PÉRIPHÉRIQUE CONTIENT PLUSIEURS PARTITIONS !!\\n\\nCeci peut inclure des partitions/volumes qui ne sont pas listées ou bien visibles depuis Windows. Si vous décidez de continuer, vous êtes responsable de toute perte de données intervenant sur ces partitions.\"\r\nt MSG_094 \"Partitions multiples détectées\"\r\nt MSG_095 \"Image DD\"\r\nt MSG_096 \"Le système de fichiers sélectionné ne peut pas être utilisé avec ce type d'image ISO. Veuillez sélectionner un système de fichiers different file ou une autre ISO.\"\r\nt MSG_097 \"'%s' peut seulement être appliqué pour un système de fichiers NTFS.\"\r\nt MSG_098 \"IMPORTANT : Vous essayez d'installer 'Windows To Go', mais votre périphérique de destination ne possède pas l'attribut 'FIXE'. A cause de cela, Windows va très probablement geler lors du démarrage, car Microsoft ne l'a pas conçu pour fonctionner avec des périphériques qui possèdent l'attribut 'AMOVIBLE'.\\n\\nVoulez vous continuer malgré celà ?\\n\\nNote : L'attribut 'FIXE/AMOVIBLE' est une propriété matérielle qui peut uniquement être changée avec des outils propriétaires, que les fabriquants de périphériques ne fournissent PRESQUE JAMAIS au public...\"\r\nt MSG_099 \"Limitation du système de fichiers\"\r\nt MSG_100 \"Cette image ISO contient un fichier de plus de 4 Go, soit plus que la taille maximale autorisée pour un système de fichiers FAT ou FAT32.\"\r\nt MSG_101 \"Prise en charge des archives WIM non disponible\"\r\nt MSG_102 \"Votre plateforme ne peut pas extraire les fichiers depuis les archives WIM. L'extraction de données WIM est nécessaire pour créer des médias USB démarrable avec EFI pour Windows 7/8 ou Windows Vista. Vous pouvez adresser ce problème en téléchargeant une version récente de l'utilitaire 7-Zip.\\nVoulez-vous visiter la page de téléchargements de 7-zip ?\"\r\nt MSG_103 \"Télécharger %s ?\"\r\nt MSG_104 \"%s ou plus récent requiert l'installation d'un fichier '%s'.\\nPuisque ce fichier fait plus de 100 Ko et est toujours présent sur les images ISO à base de %s, il n'est pas inclus dans l'application.\\n\\nRufus peut télécharger ce fichier pour vous :\\n- Choisissez 'Oui' pour télécharger le fichier depuis Internet\\n- Choisissez 'Non' si vous compter copier ce fichier manuellement\\nNote : Ce fichier est téléchargé dans le répertoire courant. Une fois qu'un fichier'%s' existe à cet endroit, il sera réutilisé automatiquement.\"\r\nt MSG_105 \"Annuler peut laisser le périphérique dans un état inutilisable.\\nSi vous êtes sûr de vouloir annuler, sélectionnez OUI. Sinon, sélectionnez NON.\"\r\nt MSG_106 \"Sélection de répertoire\"\r\nt MSG_107 \"Tous les fichiers\"\r\nt MSG_108 \"Log Rufus\"\r\nt MSG_109 \"0x%02X (disque %d)\"\r\nt MSG_110 \"MS-DOS ne peut pas être utilisé sur un disque avec une Taille de clusters de 64 kilo-octets.\\nVeuillez changer la Taille de clusters ou utilisez FreeDOS.\"\r\nt MSG_111 \"Taille de clusters incompatible\"\r\nt MSG_112 \"Le formatage d'un volume UDF de grande taille peut prendre beaucoup de temps. Aux vitesses USB 2.0, la durée de formatage estimée est %d :%02d, pendant laquelle la barre de progrès semblera gelée. Veuillez être patient !\"\r\nt MSG_113 \"Volume UDF de grand taille\"\r\nt MSG_114 \"Cette image utilise Syslinux %s%s mais l'application inclus seulement les fichiers d'installation pour Syslinux %s%s.\\n\\nComme les nouvelles versions de Syslinux sont incompatibles entre elles, et il n'est pas possible à Rufus de toutes les inclure, deux fichiers supplémentaires ('ldlinux.sys' et 'ldlinux.bss') doivent être téléchargés :\\n- Choisissez 'Oui' pour télécharger ces fichier depuis Internet\\n- Choisissez 'Non' pour annuler l'opération\\nNote : Ces fichier seront téléchargés dans le répertoire courant et réutilisés automatiquement une fois présents.\"\r\nt MSG_115 \"Téléchargement nécessaire\"\r\nt MSG_116 \"Cette image utilise Grub %s mais l'application inclus seulement les fichiers d'installation pour Grub %s.\\n\\nComme différentes versions de Grub peuvent êtres incompatibles, et il n'est pas possible à Rufus de toutes les inclure, Rufus va essayer de télécharger une version du fichier d'installation de Grub ('core.img') qui correspond a cette de votre image :\\n- Choisissez 'Oui' pour télécharger ces fichier depuis Internet\\n- Choisissez 'Non' pour utiliser la version par défaut de Rufus\\n- Choisissez 'Annuler' pour annuler cette opération\\nNote : Ce fichier sera téléchargé dans le répertoire courant et réutilisé automatiquement une fois présent. Si il n'est pas possible de trouver une version correspondante en ligne, la version par défaut sera utilisée.\"\r\nt MSG_117 \"Installation standard de Windows\"\r\nt MSG_119 \"options de périphérique avancées\"\r\nt MSG_120 \"options de formatage avancées\"\r\nt MSG_121 \"Afficher les %s\"\r\nt MSG_122 \"Cacher les %s\"\r\nt MSG_123 \"Taille de partition persistente\"\r\nt MSG_124 \"Désactivée\"\r\nt MSG_125 \"Etablit la taille de la partition persistente pour media USB de type \\\"live\\\". Une taille de 0 désactive l’utilisation d’une partition persistente.\"\r\nt MSG_126 \"Unité de taille utilisée pour la partition persistente.\"\r\nt MSG_127 \"Ne plus montrer ce message\"\r\nt MSG_128 \"Note importante à propos de %s\"\r\nt MSG_129 \"Vous venez juste de créer un média qui utilise UEFI:NTFS. Veuillez prendre note que, pour pouvoir démarrer ce média, VOUS DEVEZ DESACTIVER SECURE BOOT.\\nPour plus d'informations (en Anglais) sur les raisons nécessitant ce changement, vous pouvez cliquer sur le bouton ci dessous.\"\r\nt MSG_130 \"Sélection d'image Windows\"\r\nt MSG_131 \"Cette ISO contient plusieurs images Windows.\\nVeuillez sélectionner l'image que vous souhaitez utiliser pour cette installation :\"\r\nt MSG_132 \"Ce lecteur est utilisé par une autre application ou un autre processus. Voulez-vous quand même le formater ?\"\r\nt MSG_133 \"Rufus a détecté que vous êtes en train de créer un média 'Windows To Go' à partir d'une ISO 1809.\\n\\nA cause d'un *BUG MICROSOFT*, ce média va planter durant le démarrage de Windows (Blue Screen Of Death), à moins que vous ne remplaciez le fichier 'WppRecorder.sys' par la version 1803.\\n\\nVeuillez aussi noter que la raison pour laquelle Rufus ne peut pas corriger ce problème pour vous est que le fichier 'WppRecorder.sys' est sujet au copyright de Microsoft, donc nous ne pouvons pas légalement en produire une copie avec cette application...\"\r\nt MSG_134 \"Parce que MBR a été sélectionné pour le schéma de partition, Rufus peut seulement créer une partition sur ce média occupant jusqu’à 2 To, ce qui laissera %s d’espace disque non-disponible.\\n\\nÊtes-vous sûr de vouloir continuer ?\"\r\nt MSG_137 \"Édition\"\r\nt MSG_138 \"Langue de produit\"\r\nt MSG_140 \"Continuer\"\r\nt MSG_141 \"Retour\"\r\nt MSG_142 \"Veuillez patienter...\"\r\nt MSG_143 \"Télécharger avec un navigateur\"\r\nt MSG_144 \"Le téléchargement des ISOs de Windows n'est pas disponible car Microsoft a modifié son site web pour les empêcher.\"\r\nt MSG_145 \"PowerShell 3.0 ou ultérieur est nécessaire pour lancer ce script.\"\r\nt MSG_146 \"Voulez-vous aller en ligne pour le télécharger ?\"\r\nt MSG_148 \"Execution du script de téléchargement...\"\r\nt MSG_149 \"Télécharger une image ISO\"\r\nt MSG_150 \"Type d'ordinateur avec lequel vous comptez utiliser ce disque démarrable. Il est de votre responsabilité de déterminer s'il s'agit d'un type BIOS ou UEFI avant de commencer a créer votre périphérique, car il risque de ne pas démarrer sinon.\"\r\nt MSG_151 \"'UEFI-CSM' signifie que le périphérique démarrera seulement en mode émulation BIOS (i.e. 'Legacy Mode') sous UEFI, et non pas en mode UEFI natif.\"\r\nt MSG_152 \"'non CSM' signifie que le périphérique démarrera seulement en mode UEFI natif, et non pas en mode émulation BIOS (i.e. 'Legacy Mode').\"\r\nt MSG_153 \"Motif de test : 0x%02X\"\r\nt MSG_154 \"Motif de test : 0x%02X, 0x%02X\"\r\nt MSG_155 \"Motif de test : 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Motif de test : 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Sélectionne le système de fichiers\"\r\nt MSG_158 \"Taille minimum qu’un bloc de données occupera sur le système de fichiers\"\r\nt MSG_159 \"Utilisez ce champ pour mettre à jour le nom du volume.\\nLes caractères étendus et les accents sont acceptés.\"\r\nt MSG_160 \"Affiche/Cache les options avancées\"\r\nt MSG_161 \"Détecte la présence de blocs défectueux en écrivant un motif de test\"\r\nt MSG_162 \"Décochez cette case si vous voulez utiliser la méthode de formatage \\\"lente\\\"\"\r\nt MSG_163 \"Methode qui sera utilisée pour créer les partitions\"\r\nt MSG_164 \"Méthode à utiliser pour rendre le périphérique démarrable\"\r\nt MSG_165 \"Cliquez ici pour sélectionner ou télécharger une image...\"\r\nt MSG_166 \"Cochez cette case pour permettre l’affichage des caractères étendus/internationaux et ajouter une icône (ceci crée un fichier autorun.inf)\"\r\nt MSG_167 \"Installe un fichier de démarrage UEFI, qui effectue une validation MD5Sum du média\"\r\nt MSG_169 \"Créé une petite partition supplémentaire et aligner les partitions.\\nPeut améliorer la détection du périphérique pour les vieux BIOS.\"\r\nt MSG_170 \"Liste les disques durs externes USB. UTILISEZ A VOS PROPRES RISQUES !!!\"\r\nt MSG_171 \"Lance le formatage. Cette opération DETRUIT toutes les données sur le périphérique sélectionné !\"\r\nt MSG_172 \"Signature de téléchargement invalide\"\r\nt MSG_173 \"Cliquez pour sélectionner...\"\r\nt MSG_174 \"Rufus - L'utilitaire de formatage USB fiable\"\r\nt MSG_176 \"Traduction Française : Pete Batard <mailto:pete@akeo.ie>\"\r\nt MSG_177 \"Soumettre un bug ou une demande d'amélioration à :\"\r\nt MSG_178 \"Copyrights supplémentaires :\"\r\nt MSG_179 \"Politique de mises à jour :\"\r\nt MSG_180 \"Si vous autorisez ce programme à chercher les mises à jour, vous acceptez que les informations suivantes peuvent être collectées sur nos serveurs :\"\r\nt MSG_181 \"L’architecture de votre système d’exploitation ainsi que sa version\"\r\nt MSG_182 \"La version de l’application que vous utilisez\"\r\nt MSG_183 \"Votre adresse IP\"\r\nt MSG_184 \"Afin de générer des statistiques d’utilisation privées, il se peut que nous gardions les informations ainsi obtenues \\\\b au plus un an\\\\b0 . A moins d’y être contraint par la loi, nous nous engageons aussi à ne pas diffuser ces informations à de tierce parties.\"\r\nt MSG_185 \"Processus de mise à jour :\"\r\nt MSG_186 \"Aucun service ou tâche de fond n'est installé ou lancé par Rufus ; la vérification de mises à jour intervient seulement lorsque l’application principale s'exécute.\\\\line\\nBien entendu, un accès à internet est requis pour vérifier les mises à jour.\"\r\nt MSG_187 \"Image invalide pour l'option de démarrage sélectionnée\"\r\nt MSG_188 \"L'image choisie ne correspond pas à l'option de démarrage sélectionnée. Veuillez utiliser une image ou une option de démarrage différente.\"\r\nt MSG_189 \"Cette image ISO n'est pas compatible avec le système de fichiers sélectionné\"\r\nt MSG_190 \"Périphérique incompatible détecté\"\r\nt MSG_191 \"Phase d'écriture\"\r\nt MSG_192 \"Phase de lecture\"\r\nt MSG_193 \"Téléchargement completé pour %s\"\r\nt MSG_194 \"Impossible de télécharger %s\"\r\nt MSG_195 \"La version par défaut du fichier %s sera utilisée\"\r\nt MSG_196 \"IMPORTANT : CE PÉRIPHÉRIQUE UTILISE UNE TAILLE DE SECTEUR NON STANDARD !\\n\\nLa majorité des disques utilisent une taille de secteur de 512 octets, mais celui ci utilise une taille de %d octets. Dans la majorité des cas, cela veut dire que vous ne POUVEZ PAS démarrer un oridinateur depusi ce disque.\\nRufus peut toujours essayer de créer un disque démarrable, mais il n'y a AUCUNE guarantie que cela marchera.\"\r\nt MSG_197 \"Taille de secteur non standard détectée\"\r\nt MSG_198 \"'Windows To Go' peut seulement être installé sur un disque partitionné au format GPT si il a l'attribut FIXE.Le disque sélectionné na pas été détecté comme FIXE.\"\r\nt MSG_199 \"Cette fonctionalité n'est pas disponible pour cette plateforme.\"\r\nt MSG_201 \"Annulation - Veuillez patienter...\"\r\nt MSG_202 \"Analyse de l'image...\"\r\nt MSG_203 \"Échec de l'analyse de l'image\"\r\nt MSG_204 \"Fichier %s obsolète détecté\"\r\nt MSG_205 \"Image utilisée : %s\"\r\nt MSG_206 \"Fichier %s manquant\"\r\nt MSG_207 \"Nouveau volume\"\r\nt MSG_208 \"%d périphérique détecté\"\r\nt MSG_209 \"%d périphériques détectés\"\r\nt MSG_210 \"PRÊT\"\r\nt MSG_211 \"Opération annulée\"\r\nt MSG_212 \"Échec\"\r\nt MSG_213 \"Lancement de la nouvelle application...\"\r\nt MSG_214 \"Échec de lancement de l'application\"\r\nt MSG_215 \"%s ouvert\"\r\nt MSG_216 \"%s sauvegardé\"\r\nt MSG_217 \"Formatage : %s\"\r\nt MSG_218 \"Système de fichiers : Tâche %d/%d terminée\"\r\nt MSG_219 \"Finalisation NTFS : %d%% terminé\"\r\nt MSG_220 \"Formatage (%s) - durée estimée %d :%02d...\"\r\nt MSG_221 \"Écriture du label (%s)...\"\r\nt MSG_222 \"Formatage (%s)...\"\r\nt MSG_223 \"Finalisation NTFS (Checkdisk)...\"\r\nt MSG_224 \"Effacement des structures MBR/PBR/GPT...\"\r\nt MSG_225 \"Requête d'accès disque...\"\r\nt MSG_226 \"Analyse des structures de boot existantes...\"\r\nt MSG_227 \"Fermeture des volumes existants...\"\r\nt MSG_228 \"Écriture du MBR...\"\r\nt MSG_229 \"Écriture du PBR...\"\r\nt MSG_230 \"Copie des fichiers DOS...\"\r\nt MSG_231 \"Copie des fichiers ISO : %s\"\r\nt MSG_232 \"Écriture boot Win7 EFI (%s)...\"\r\nt MSG_233 \"Finalisation, veuillez patienter...\"\r\nt MSG_234 \"Installation de Syslinux %s...\"\r\nt MSG_235 \"Test de défauts : %s %d/%d - %0.2f%% (%d/%d/%d erreurs)\"\r\nt MSG_236 \"Test de défauts : Test avec motif aléatoire\"\r\nt MSG_237 \"Test de défauts : Test avec motif 0x%02X\"\r\nt MSG_238 \"Partitionnement (%s)...\"\r\nt MSG_239 \"Suppression des partitions (%s)...\"\r\nt MSG_240 \"La signature de la mise à jour qui vient d’être téléchargée ne peut pas être validée. Cela peut indiquer que votre système n’est pas configuré correctement pour la validation de signatures numériques, ou que le téléchargement contient un fichier malicieux.\\n\\nLe téléchargement va être supprimé. Veuillez consulter le log pour plus de détails.\"\r\nt MSG_241 \"Téléchargement : %s\"\r\nt MSG_242 \"Échec de téléchargement du fichier.\"\r\nt MSG_243 \"Recherche des mises à jour...\"\r\nt MSG_244 \"Mises à jour : Impossible de se connecter\"\r\nt MSG_245 \"Mises à jour : Impossible de lire les données\"\r\nt MSG_246 \"Une nouvelle version de Rufus est disponible !\"\r\nt MSG_247 \"Pas de nouvelle mise à jour\"\r\nt MSG_248 \"Clés de registre supprimées\"\r\nt MSG_249 \"Échec de suppression des clés registres\"\r\nt MSG_250 \"%s activé\"\r\nt MSG_251 \"%s désactivé\"\r\nt MSG_252 \"Tests de dépassement de taille\"\r\nt MSG_253 \"Détection de disques fixes\"\r\nt MSG_254 \"Force 'large FAT32'\"\r\nt MSG_255 \"NoDriveTypeAutorun sera effacé en sortie\"\r\nt MSG_256 \"Test de contrefaçons\"\r\nt MSG_257 \"Support Joliet\"\r\nt MSG_258 \"Support Rock Ridge\"\r\nt MSG_259 \"Forçage de mise à jour\"\r\nt MSG_260 \"Compression NTFS\"\r\nt MSG_261 \"Écriture d'image : %s\"\r\nt MSG_262 \"Support ISO\"\r\nt MSG_263 \"Affichage de tailles avec de VRAIES unités\"\r\nt MSG_264 \"Suppression du dossier '%s'\"\r\nt MSG_265 \"Détection de disque VMWare\"\r\nt MSG_266 \"Mode dual UEFI/BIOS\"\r\nt MSG_267 \"Application de l'image Windows : %s\"\r\nt MSG_268 \"Application de l'image Windows...\"\r\nt MSG_269 \"Préservation des dates de fichiers\"\r\nt MSG_270 \"Debug USB\"\r\nt MSG_271 \"Calcul des checksums de l'image : %s\"\r\nt MSG_272 \"Calcule les checksums MD5, SHA1 et SHA256 pour l'image sélectionée\"\r\nt MSG_273 \"Change la langue de l'application\"\r\nt MSG_274 \"Image %s détectée\"\r\nt MSG_275 \"L'image que vous avez sélectionnée est une image 'ISOHybrid'. Cela veut dire qu’elle peut être écrite soit en mode %s (copie de fichiers) ou en mode %s (image disque).\\nRufus recommande d’utiliser le mode %s, de manière à ce que vous conserviez l’accès à votre périphérique après écriture.\\nCependant, si vous rencontrez des erreurs lors du démarrage, vous pouvez à nouveau essayer d’écrire cette image, en mode %s.\\n\\nVeuillez sélectionner le mode que vous souhaitez utiliser pour écrire cette image :\"\r\nt MSG_276 \"Écrire en mode %s (Recommandé)\"\r\nt MSG_277 \"Écrire en mode %s\"\r\nt MSG_278 \"Recherche de processus en conflit...\"\r\nt MSG_279 \"Non démarrable\"\r\nt MSG_280 \"Image disque ou ISO\"\r\nt MSG_281 \"%s (Veuillez sélectionner)\"\r\nt MSG_282 \"Verrouillage exclusif de périphérique USB\"\r\nt MSG_283 \"Signature invalide\"\r\nt MSG_284 \"L'exécutable téléchargé ne possède pas de signature numérique.\"\r\nt MSG_285 \"L'exécutable téléchargé est signé par '%s'.\\nIl ne s'agit pas d'une signature que nous connaissons et peut indiquer une activité malicieuse...\\nÊtes-vous certain de vouloir lancer ce fichier ?\"\r\nt MSG_286 \"Effacement à zéro : %s\"\r\nt MSG_287 \"Détection des disques détachables non-USB\"\r\nt MSG_288 \"Privilèges élevés manquants\"\r\nt MSG_289 \"Cette application peut seulement être exécutée avec les privilèges administrateur\"\r\nt MSG_290 \"Indexation des fichiers\"\r\nt MSG_291 \"Sélection de la version\"\r\nt MSG_292 \"Sélectionnez la version de Windows que vous souhaitez installer :\"\r\nt MSG_293 \"Version de Windows non prise en charge\"\r\nt MSG_294 \"Cette version de Windows n'est plus prise en charge par Rufus.\\nLa dernière version de Rufus compatible avec cette plateforme est v%d.%d.\"\r\nt MSG_295 \"Alerte: Version non-officielle\"\r\nt MSG_296 \"Cette version de Rufus n'a pas produite par ses développeurs officiels.\\n\\nÊtes-vous sûr de vouloir la lancer ?\"\r\nt MSG_297 \"ISO tronquée détectée\"\r\nt MSG_298 \"Le fichier ISO que vous avez sélectionné ne fait pas la bonne taille : %s de données sont manquantes !\\n\\nSi vous avez obtenu ce fichier depuis Internet, vous devriez essayer de le télécharger à nouveau et verifier que le MD5 ou SHA correspond aux valeurs officielles.\\n\\nNotez que vous pouvez calculer le MD5 ou SHA depuis Rufus en cliquant le bouton (✓).\"\r\nt MSG_299 \"Erreur de validation du timestamp\"\r\nt MSG_300 \"Rufus n'a pas pu valider que le timestamp du fichier de mise à jour téléchargé est plus récent que celui de l'exécutable en cours.\\n\\nAfin d'éviter des scenarios d'attaque potentiels, le processus de mise à jour a été interrompu et le téléchargement va être supprimé. Pour plus de détails, veuillez consulter le log.\"\r\nt MSG_301 \"Affiche les paramètres de l'application\"\r\nt MSG_302 \"Affiche des informations à propos de cette application\"\r\nt MSG_303 \"Affiche le log\"\r\nt MSG_304 \"Crée une image disque à partir du périphérique sélectionné\"\r\nt MSG_305 \"Utilisez cette option pour indiquer si vous voulez installer Windows sur un autre disque, ou bien exécuter Windows directement depuis ce périphérique (Windows To Go).\"\r\nt MSG_306 \"Effacement 'rapide' à zéro : %s\"\r\nt MSG_307 \"peut prendre du temps\"\r\nt MSG_308 \"Détection VHD\"\r\nt MSG_309 \"Archive compressée\"\r\nt MSG_310 \"L’image ISO que vous avez sélectionnée utilise EFI et est suffisamment petite pour être contenue entièrement dans une ESP (EFI System Partition). L’écriture en ESP, plutôt qu’en partition générique occupant la totalité de l’espace disque, peut s’avérer préférable pour certaines méthodes d’installation.\\nVeuillez sélectionner le mode d’écriture que vous souhaitez utiliser pour écrire cette image :\"\r\nt MSG_311 \"Utilisez %s (dans la fenêtre d’application principale) pour active.\"\r\nt MSG_312 \"Checksum supplémentaire (SHA512)\"\r\nt MSG_313 \"Sauver en image VHD\"\r\nt MSG_314 \"Calculer les checksums de l’image sélectionnée\"\r\nt MSG_315 \"Multiples boutons\"\r\nt MSG_316 \"Nombre de passes\"\r\nt MSG_317 \"ID disque\"\r\nt MSG_318 \"Priorité de thread par défaut : %d\"\r\nt MSG_319 \"Ignorer le marqueur de démarrage\"\r\nt MSG_320 \"Rafraîchissement du schéma de partition (%s)...\"\r\nt MSG_321 \"L’image que vous avez sélectionnée est de type ISOHybrid, mais ses créateurs ne l’ont pas rendue compatible avec le mode ISO (i.e. copie de fichier).\\nÀ cause de cela, seule l’écriture en mode DD est applicable.\"\r\nt MSG_322 \"Impossible d'ouvrir ou de lire '%s'\"\r\nt MSG_323 \"Appliquer SkuSiPolicy.p7b après installation (Consultez KB5042562)\"\r\nt MSG_324 \"Améliorations 'QoL' (Ne force pas Copilot, OneDrive, Outlook, Fast Startup, etc.)\"\r\nt MSG_325 \"Application des options de personnalisation de Windows: %s\"\r\nt MSG_326 \"Application des options utilisateur...\"\r\nt MSG_327 \"Expérience de l'utilisateur Windows\"\r\nt MSG_328 \"Personnaliser l'installation de Windows ?\"\r\nt MSG_329 \"Supprimer la nécessité d'avoir 4Go+ de RAM, Secure Boot et TPM 2.0\"\r\nt MSG_330 \"Supprimer la nécessité d'utiliser un compte utilisateur Microsoft en ligne\"\r\nt MSG_331 \"Désactiver la collecte de données (Supprime les questions de confidentialité)\"\r\nt MSG_332 \"Empêcher 'Windows To Go' d'accéder aux disques internes\"\r\nt MSG_333 \"Créer un compte local sous le nom de :\"\r\nt MSG_334 \"Définir les options régionales avec les mêmes valeurs que celles de cet utilisateur\"\r\nt MSG_335 \"Désactiver le chiffrement automatique BitLocker\"\r\nt MSG_336 \"Log persistent\"\r\nt MSG_337 \"Un fichier supplémentaire ('%s') doit être téléchargé depuis Microsoft pour utiliser cette fonctionalité :\\n- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger\\n- Sélectionnez 'Non' pour annuler l’opération\\n\\nNote : Ce fichier sera téléchargé dans le répertoire de l'application et réutilisé automatiquement s'il est présent.\"\r\nt MSG_338 \"Bootloader UEFI révoqué détecté\"\r\nt MSG_339 \"Rufus a détecté que l’ISO que vous avez sélectionnée contient un bootloader UEFI révoqué, qui devrait produire %s sur un système UEFI à jour, lorsque 'Secure Boot' est activé.\\n\\n- Si vous avez obtenu cette image ISO à partir d’une source douteuse, vous devriez envisager la possibilité qu’elle puisse contenir un logiciel malveillant, et éviter de démarrer à partir de celle-ci.\\n- Si vous l’avez obtenu à partir d’une source fiable, vous devriez essayer de trouver une version plus récente, où cette notification ne se produit pas.\"\r\nt MSG_340 \"un écran « Violation de sécurité »\"\r\nt MSG_341 \"un écran de récupération Windows (BSOD) avec '%s'\"\r\nt MSG_342 \"Image VHDX compressée\"\r\nt MSG_343 \"Image VHD non compressée\"\r\nt MSG_344 \"Image 'Full Flash Update'\"\r\nt MSG_345 \"Des données complémentaires doivent être téléchargées à partir du site Microsoft avant d'utiliser cette fonctionnalité :\\n- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger ces données\\n- Sélectionnez 'Non' pour annuler l’opération\"\r\nt MSG_346 \"Restreint Windows au mode \\\"S\\\" (INCOMPATIBLE avec l'option de désactivation d'un compte utilisateur Microsoft en ligne)\"\r\nt MSG_347 \"Mode expert\"\r\nt MSG_348 \"Extraction d'archive : %s\"\r\nt MSG_349 \"Utilisation du MBR Rufus\"\r\nt MSG_350 \"Utiliser les bootloaders signés par 'Windows CA 2023' (nécessite un PC cible compatible)\"\r\nt MSG_351 \"Vérification de la revocation des bootloaders UEFI...\"\r\nt MSG_352 \"Vérification des mises à jour de DBX UEFI...\"\r\nt MSG_353 \"Mise à jour DBX disponible\"\r\nt MSG_354 \"Rufus a trouvé une mise à jour des fichiers DBX utilisés pour effectuer la validation des revocations Secure Boot sous UEFI. Voulez-vous télécharger cette mise à jour ?\\n- Sélectionnez 'Oui' pour vous connecter à Internet et le télécharger ce contenu\\n- Sélectionnez 'Non' pour annuler l’opération\\n\\nNote : Ces fichiers seront téléchargés dans le répertoire de l'application et réutilisés automatiquement si ils sont présent.\"\r\nt MSG_355 \"Effacera le disque ⚠SILENCIEUSEMENT⚠ et installera:\"\r\nt MSG_356 \"Vous avez sélectionné l'option d'installation de Windows dite \\\"silencieuse\\\".\\n\\nIl s'agit d'une option avancée, réservée à ceux qui souhaitent créer un média d'installation qui ne posera aucune question à l'utilisateur pendant l'installation de Windows et qui EFFACERA SANS CONDITION le premier disque détecté sur le système cible. Si vous n'y prenez pas garde, l'utilisation de cette option peut résulter en une PERTE DE DONNÉES IRREVERSIBLE !\\n\\nSi cela n'est pas ce que vous souhaitez veuillez sélectionner 'Non' pour revenir en arrière et désélectionner cette option.\\nSinon, si vous sélectionnez 'Oui', vous indiquez que toute perte de donnée en résultant sera entièrement VOTRE responsabilité.\"\r\nt MSG_358 \"Placement d'image non supporté\"\r\nt MSG_359 \"Vous ne pouvez pas utiliser une image située sur le périphérique cible, puisque ce dernier va être complètement effacé. Cela revient au même qu'essayer de scier la branche sur laquelle vous êtes assis !\\n\\nVeuillez déplacer l'image sur un autre disque et réessayez.\"\r\nt MSG_360 \"Vous pouvez laisser cette option activée même si vous avez une puce TPM ou plus de RAM, car l'option contourne simplement les prérequis du programme d'installation et n'empêche absolument pas Windows d'utiliser toutes ces ressources si disponibles.\"\r\nt MSG_361 \"Pour que cette option fonctionne, vous DEVEZ déconnecter le réseau/Internet pendant l'installation !\"\r\nt MSG_362 \"Répond automatiquement 'non' aux questions du programme d'installation de Windows en ce qui concerne l'autorisation du partage de données avec Microsoft, au lieu de demander à l'utilisateur.\"\r\nt MSG_363 \"Laissez cette option activée à moins que vous acceptiez que 'Windows To Go' puisse accéder aux disques internes pour effectuer des mises à jour, silencieuses et irréversible, des systèmes de fichiers.\"\r\nt MSG_364 \"Crée un compte local automatiquement, pour le nom spécifié, et avec un mot de passe vide qui devra être changé à la prochaine session.\"\r\nt MSG_365 \"Réplique les options régionales de ce PC (clavier, fuseau horaire, monnaie), au lieu de demander à l'utilisateur.\"\r\nt MSG_366 \"Ne chiffre pas le disque système, sauf si l'utilisateur le demande explicitement.\"\r\nt MSG_367 \"Activez cette option seulement si vous savez ce qu'est S-Mode et comprenez que votre système pourra être restreint au S-Mode même si vous supprimez Windows et le réinstallez complètement.\"\r\nt MSG_368 \"Activez cette option si le système que vous installez utilise des certificats Secure Boot complètement à jour. Si nécessaire, vous pouvez utiliser 'Mosby' pour mettre votre système à jour.\"\r\nt MSG_369 \"Activez cette option pour révoquer des bootloaders supplémentaires de Windows, mais avec le risque de ne plus pouvoir démarrer depuis des media Windows standard.\"\r\nt MSG_370 \"Améliorations \\\"Quality of Life\\\" : Désactive la plupart des fonctionnalités que Microsoft essaie de pousser, contre leur gré, aux utilisateurs.\"\r\nt MSG_371 \"Si vous utilisez cette option, veuillez-vous assurer que tous les disques, sauf celui sur lequel vous voulez installer Windows, est déconnecté du PC cible, et aussi que vous ne laisserez pas le média connecté sur un PC que vous ne voulez pas réinstaller.\"\r\nt MSG_900 \"Rufus est un utilitaire permettant de formater et de créer des média USB amorçables, tels que clés USB, mémoire flash, etc.\"\r\nt MSG_901 \"Site officiel : %s\"\r\nt MSG_902 \"Code source: %s\"\r\nt MSG_904 \"Cette application est fournie sous les termes de la Licence publique générale GNU (GPL) version 3.\\nVeuillez consulter https://www.gnu.org/licenses/gpl-3.0.fr.html pour plus de details.\"\r\nt MSG_905 \"Amorçable\"\r\nt MSG_910 \"Formatez des périphériques USB, des cartes flash et des disques virtuels en FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Créez des disques amorçable FreeDOS\"\r\nt MSG_912 \"Créez des disques amorçables à partir d'images ISOs (Windows, Linux, etc.)\"\r\nt MSG_913 \"Créez des disques amorçables à partir d'images disque, y compris à partir d'images compressées\"\r\nt MSG_914 \"Créez des disques amorçables BIOS ou UEFI, y compris des disques UEFI amorçables utilisant NTFS\"\r\nt MSG_915 \"Créez des disques 'Windows To Go'\"\r\nt MSG_916 \"Créez des disques d'installation Windows 11 pour des PCs qui ne disposent pas de TPM ou Secure Boot\"\r\nt MSG_917 \"Créez des partitions persistentes pour Linux\"\r\nt MSG_918 \"Créez des images VHD/DD du périphérique sélectionné\"\r\nt MSG_919 \"Calculez les sommes de contrôle MD5, SHA-1, SHA-256 et SHA-512 de l'image sélectionnée\"\r\nt MSG_920 \"Executez un test de mauvais secteurs avec detection des \\\"fake drives\\\"\"\r\nt MSG_921 \"Téléchargez des images ISOs commerciales officielles de Microsoft Windows\"\r\nt MSG_922 \"Téléchargez des images ISOs du Shell UEFI\"\r\n\r\n#########################################################################\r\nl \"de-DE\" \"German (Deutsch)\" 0x0407, 0x0807, 0x0c07, 0x1007, 0x1407\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Über Rufus\"\r\nt IDC_ABOUT_LICENSE \"Lizenz\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Laufwerkseigenschaften\"\r\nt IDS_DEVICE_TXT \"Laufwerk\"\r\nt IDS_BOOT_SELECTION_TXT \"Startart\"\r\nt IDC_SELECT \"Auswahl\"\r\nt IDS_IMAGE_OPTION_TXT \"Image-Eigenschaft\"\r\nt IDS_PARTITION_TYPE_TXT \"Partitionsschema\"\r\nt IDS_TARGET_SYSTEM_TXT \"Zielsystem\"\r\nt IDC_LIST_USB_HDD \"USB-Festplatten anzeigen\"\r\nt IDC_OLD_BIOS_FIXES \"Fix für ältere BIOSe verwenden (zusätzliche Partition usw.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"UEFI-Medienvalidierung zur Laufzeit aktivieren\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Formatierungseinstellungen\"\r\nt IDS_FILE_SYSTEM_TXT \"Dateisystem\"\r\nt IDS_CLUSTER_SIZE_TXT \"Größe der Zuordnungseinheit\"\r\nt IDS_LABEL_TXT \"Laufwerksbezeichnung\"\r\nt IDC_QUICK_FORMAT \"Schnellformatierung\"\r\nt IDC_BAD_BLOCKS \"Auf defekte Blöcke prüfen\"\r\nt IDC_EXTENDED_LABEL \"Erweiterte Bezeichnung und Symbole erstellen\"\r\nt IDCANCEL \"Schließen\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Schließen\"\r\nt IDD_LICENSE \"Rufus-Lizenz\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Schließen\"\r\nt IDC_LOG_CLEAR \"Löschen\"\r\nt IDC_LOG_SAVE \"Speichern\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Schließen\"\r\nt IDD_NEW_VERSION \"Prüfe auf neue Version - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Eine neuere Version ist verfügbar. Bitte laden Sie die aktuelle Version herunter!\"\r\nt IDC_WEBSITE \"Klicken Sie hier, um zur Webseite zu gelangen\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Versionshinweise\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Weitere Informationen\"\r\nt IDYES \"Ja\"\r\nt IDNO \"Nein\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Schließen\"\r\nt IDD_UPDATE_POLICY \"Aktualisierungseinstellungen\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Einstellungen\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Auf neue Version prüfen\"\r\nt IDS_INCLUDE_BETAS_TXT \"Beta-Version verwenden\"\r\nt IDC_CHECK_NOW \"Jetzt prüfen\"\r\n\r\nt MSG_001 \"Rufus ist bereits gestartet\"\r\nt MSG_002 \"Rufus ist bereits gestartet.\\nBitte schließen Sie es erst, bevor Sie es erneut starten.\"\r\nt MSG_003 \"WARNUNG: ALLE DATEN AUF LAUFWERK '%s' WERDEN GELÖSCHT.\\nKlicken Sie auf OK, um fortzufahren. Klicken Sie auf ABBRECHEN, um abzubrechen.\"\r\nt MSG_004 \"Rufus-Aktualisierungseinstellungen\"\r\nt MSG_005 \"Wollen Sie, dass Rufus auf neuen Versionen prüft?\"\r\nt MSG_006 \"Schließen\"\r\nt MSG_007 \"Abbrechen\"\r\nt MSG_008 \"Ja\"\r\nt MSG_009 \"Nein\"\r\nt MSG_010 \"Fehlerhafte Blöcke gefunden\"\r\nt MSG_011 \"Prüfung abgeschlossen: %d fehlerhafte Blöcke gefunden\\n  %d Lesefehler\\n  %d Schreibfehler\\n  %d Defekt(e)\"\r\nt MSG_012 \"%s\\nEin detaillierter Bericht ist hier zu finden:\\n%s\"\r\nt MSG_013 \"Deaktiviert\"\r\nt MSG_014 \"Täglich\"\r\nt MSG_015 \"Wöchentlich\"\r\nt MSG_016 \"Monatlich\"\r\nt MSG_017 \"Speziell\"\r\nt MSG_018 \"Ihre Version: %d.%d (Build %d)\"\r\nt MSG_019 \"Aktuelle Version: %d.%d (Build %d)\"\r\nt MSG_020 \"Byte\"\r\nt MSG_026 \"Byte\"\r\nt MSG_027 \"Kilobyte\"\r\nt MSG_028 \"Megabyte\"\r\nt MSG_029 \"Standard\"\r\nt MSG_030 \"%s (Standard)\"\r\nt MSG_031 \"BIOS (bzw. UEFI-CSM)\"\r\nt MSG_032 \"UEFI (ohne CSM)\"\r\nt MSG_033 \"BIOS oder UEFI\"\r\nt MSG_034 \"%d Durchgang\"\r\nt MSG_035 \"%d Durchgänge %s\"\r\nt MSG_036 \"ISO-Image\"\r\nt MSG_037 \"Programm\"\r\nt MSG_038 \"Abbruch\"\r\nt MSG_039 \"Start\"\r\nt MSG_041 \"Operation vom Benutzer abgebrochen\"\r\nt MSG_042 \"Fehler\"\r\nt MSG_043 \"Fehler: %s\"\r\nt MSG_044 \"Dateidownload\"\r\nt MSG_045 \"USB-Massenspeichergerät (allgemein)\"\r\nt MSG_047 \"Mehrere Partitionen\"\r\nt MSG_048 \"Rufus - Leere Puffer\"\r\nt MSG_049 \"Rufus - Abbrechen\"\r\nt MSG_050 \"Erfolg.\"\r\nt MSG_051 \"Unbekannter Fehler während der Formatierung.\"\r\nt MSG_052 \"Das gewählte Dateisystem kann für diesen Datenträger nicht verwendet werden.\"\r\nt MSG_053 \"Der Zugriff auf das Laufwerk wurde verweigert.\"\r\nt MSG_054 \"Der Datenträger ist schreibgeschützt.\"\r\nt MSG_055 \"Das Laufwerk wird von einem anderen Prozess verwendet. Bitte beenden Sie diesen anderen Prozess.\"\r\nt MSG_056 \"Die Schnellformatierung ist für dieses Laufwerk nicht verfügbar.\"\r\nt MSG_057 \"Die Laufwerksbezeichnung ist ungültig.\"\r\nt MSG_058 \"Das Geräte-Handle ist ungültig.\"\r\nt MSG_059 \"Die ausgewählte Größe der Zuordnungseinheit ist für dieses Laufwerk nicht gültig.\"\r\nt MSG_060 \"Die Volume-Größe ist ungültig.\"\r\nt MSG_061 \"Bitte legen Sie einen Wechseldatenträger ein.\"\r\nt MSG_062 \"Ein nicht unterstütztes Kommando wurde erkannt.\"\r\nt MSG_063 \"Fehler bei der Speicherzuweisung.\"\r\nt MSG_064 \"Lesefehler.\"\r\nt MSG_065 \"Schreibfehler.\"\r\nt MSG_066 \"Installationsfehler\"\r\nt MSG_067 \"Datenträger konnte nicht geöffnet werden. Möglicherweise wird er von einem anderen Prozess verwendet. Bitte legen Sie den Datenträger noch einmal ein und versuchen Sie es erneut.\"\r\nt MSG_068 \"Laufwerk konnte nicht partitioniert werden.\"\r\nt MSG_069 \"Dateien konnten nicht auf das Ziellaufwerk kopiert werden.\"\r\nt MSG_070 \"Vom Benutzer abgebrochen.\"\r\nt MSG_071 \"Thread konnte nicht gestartet werden.\"\r\nt MSG_072 \"Prüfung auf fehlerhafte Blöcke nicht abgeschlossen.\"\r\nt MSG_073 \"Fehler beim Analysieren der ISO-Image-Datei.\"\r\nt MSG_074 \"Fehler beim Entpacken der ISO-Image-Datei.\"\r\nt MSG_075 \"Volume konnte nicht neu angelegt werden.\"\r\nt MSG_076 \"Startfähige Dateien konnten nicht erstellt werden.\"\r\nt MSG_077 \"Laufwerksbuchstabe konnte nicht zugewiesen werden.\"\r\nt MSG_078 \"GUID-Laufwerk konnte nicht angelegt werden.\"\r\nt MSG_079 \"Das Laufwerk ist nicht bereit.\"\r\nt MSG_080 \"Rufus hat erkannt, dass Inhalte des Datenpuffers auf das USB-Laufwerk geschrieben werden.\\n\\nAbhängig von der Geschwindigkeit des USB-Laufwerks kann dieser Vorgang lange dauern, insbesondere bei großen Dateien.\\n\\nWir empfehlen, dass Sie Windows den Vorgang beenden lassen, um ein Problem zu vermeiden. Wenn Ihnen der Vorgang zu lange dauert, können Sie das Gerät einfach entfernen.\"\r\nt MSG_081 \"Nicht unterstützte Image-Datei\"\r\nt MSG_082 \"Dieses Image ist nicht startfähig oder benutzt eine nicht unterstützte Start- oder Kompressionsmethode.\"\r\nt MSG_083 \"%s ersetzen?\"\r\nt MSG_084 \"Diese ISO-Image-Datei verwendet eine veraltete Version von '%s'.\\nBootmenüs werden deswegen möglicherweise fehlerhaft dargestellt.\\n\\nEine neuere Version kann von Rufus heruntergeladen werden, um dieses Problem zu vermeiden:\\n- Wählen Sie 'Ja', um die Datei herunterzuladen\\n- Wählen Sie 'Nein', um das ISO-Image nicht zu verändern\\nWenn Sie unsicher sind, wählen Sie 'Ja'.\\n\\nHinweis: Die neue Datei wird in das aktuelle Verzeichnis heruntergeladen und falls '%s' bereits vorhanden ist, wird sie automatisch wiederverwendet.\"\r\nt MSG_085 \"Herunterladen von %s\"\r\nt MSG_086 \"Keine Image-Datei gewählt\"\r\nt MSG_087 \"für %s-Flash\"\r\nt MSG_088 \"Image ist zu groß\"\r\nt MSG_089 \"Dieses Image ist zu groß für das gewählte Ziel.\"\r\nt MSG_090 \"ISO-Image nicht unterstützt\"\r\nt MSG_091 \"Wenn UEFI als Typ des Zielsystems gewählt ist, werden nur EFI-startfähige ISO-Images unterstützt. Bitte wählen Sie ein EFI-startfähiges ISO-Image oder ändern Sie den Typ des Zielsystems zu BIOS.\"\r\nt MSG_092 \"Nicht unterstütztes Dateisystem\"\r\nt MSG_093 \"ACHTUNG! DIESES LAUFWERK VERFÜGT ÜBER MEHRERE PARTITIONEN!\\n\\nDarunter sind möglicherweise Partitionen, die unter Windows nicht sicht- bzw. nutzbar sind. Wenn Sie fortfahren, sind Sie selbst für den Datenverlust auf diesen Partitionen verantwortlich.\"\r\nt MSG_094 \"Mehrere Partitionen erkannt\"\r\nt MSG_095 \"DD-Image\"\r\nt MSG_096 \"Das aktuell gewählte Dateisystem kann für dieses ISO-Image nicht verwendet werden. Bitte wählen Sie ein anderes Dateisystem oder ein anderes ISO-Image.\"\r\nt MSG_097 \"Für '%s' muss NTFS als Dateisystem verwendet werden.\"\r\nt MSG_098 \"WICHTIG: Sie versuchen, 'Windows To Go' zu installieren, aber das Ziel-Laufwerk hat nicht das 'FIXED'-Attribut. Deswegen wird Windows beim Systemstart höchstwahrscheinlich einfrieren, weil Microsoft nicht vorgesehen hat, Laufwerke mit dem 'REMOVABLE'-Attribut zu unterstützen.\\n\\nWollen Sie den Vorgang trotzdem fortsetzen?\\n\\nHinweis: Das 'FIXED/REMOVABLE'-Attribut ist eine Hardware-Eigenschaft und kann nur mit speziellen Tools der Hersteller geändert werden. Wobei diese Tools MEIST NICHT öffentlich sind.\"\r\nt MSG_099 \"Dateisystembeschränkung\"\r\nt MSG_100 \"Diese ISO-Image-Datei enthält eine Datei größer als 4 GB. Diese Dateigröße ist für FAT- oder FAT32-Dateisysteme nicht zulässig.\"\r\nt MSG_101 \"Fehlende WIM-Unterstützung\"\r\nt MSG_102 \"Ihre Plattform kann keine Dateien aus WIM-Containern extrahieren. WIM-Extraktion ist erforderlich, um EFI-startfähige Windows 7 und Windows Vista USB-Laufwerke zu erzeugen. Sie können das durch die Installation der aktuellen 7-Zip-Version beheben.\\nMöchten Sie die 7-Zip-Download-Seite aufrufen?\"\r\nt MSG_104 \"%s oder neuer erfordert, dass eine Datei '%s' installiert ist.\\nWeil diese Datei größer als 100 kB ist und in %s ISO-Images immer enthalten ist, ist sie in Rufus nicht enthalten.\\n\\nRufus kann die fehlende Datei für Sie herunterladen:\\n- Wählen Sie 'Ja', um die Datei herunterzuladen\\n- Wählen Sie 'Nein', wenn Sie diese Datei später selbst auf das Laufwerk kopieren wollen\\n\\nHinweis: Die neue Datei wird in das aktuelle Verzeichnis heruntergeladen und falls '%s' bereits vorhanden ist, wird sie automatisch wiederverwendet.\"\r\nt MSG_105 \"Durch einen Abbruch wird das Gerät in einen INSTABILEN Zustand versetzt.\\nWenn Sie sicher sind, dass Sie abbrechen wollen, klicken Sie JA, andernfalls klicken Sie NEIN.\"\r\nt MSG_106 \"Ordner wählen\"\r\nt MSG_107 \"Alle Dateien\"\r\nt MSG_108 \"Rufus-Log\"\r\nt MSG_110 \"MS-DOS kann nicht von einem Laufwerk mit einer Zuordnungseinheitengröße von 64 Kilobyte starten.\\nBitte ändern Sie die Zuordnungseinheitengröße oder verwenden Sie FreeDOS.\"\r\nt MSG_111 \"Inkompatible Zuordnungseinheitengröße\"\r\nt MSG_112 \"Die Formatierung eines großen UDF-Laufwerks kann viel Zeit benötigen. Bei USB 2.0-Geschwindigkeiten beträgt die geschätzte Formatierungsdauer %d:%02d, während der die Fortschrittsleiste eingefroren erscheint. Bitte haben Sie Geduld!\"\r\nt MSG_113 \"Großes UDF-Laufwerk\"\r\nt MSG_114 \"Dieses Image benutzt Syslinux %s%s, aber diese Anwendung verfügt nur über Installationsdateien für Syslinux %s%s.\\n\\nNeuere Syslinux-Versionen sind untereinander nicht kompatibel. Rufus kann nicht alle Versionen unterstützen. Zwei zusätzliche Dateien müssen aus dem Internet heruntergeladen werden ('ldlinux.sys' und 'ldlinux.bss'):\\n- Wählen Sie 'Ja', um dem Download zuzustimmen\\n- Wählen Sie 'Nein', um den Vorgang abzubrechen\\n\\nHinweis: Die Dateien werden in das Programmverzeichnis heruntergeladen und können bei Bedarf wiederverwendet werden.\"\r\nt MSG_115 \"Download erforderlich\"\r\nt MSG_116 \"Dieses Image verwendet Grub %s, aber die Anwendung beinhaltet nur Installationsdateien für Grub %s.\\n\\nWeil verschiedene Versionen von Grub nicht untereinander kompatibel sind und es nicht möglich ist, alle mit Rufus auszuliefern, wird Rufus versuchen, eine Version der Installationsdatei ('core.img') von Grub zu finden, die zur Version im Image passt:\\n- Wählen Sie 'Ja', um sich mit dem Internet zu verbinden und sie herunterzuladen\\n- Wählen Sie 'Nein', um die Standardversion zu verwenden\\n- Wählen Sie 'Abbrechen', um den Vorgang abzubrechen\\n\\nHinweis: Die Datei wird in das Programmverzeichnis heruntergeladen und ggf. automatisch wiederverwendet. Wenn online nichts gefunden wird, wird die Standardversion verwendet.\"\r\nt MSG_117 \"Standard-Windows-Installation\"\r\nt MSG_119 \"Erweiterte Laufwerkseigenschaften\"\r\nt MSG_120 \"Erweiterte Formatierungsoptionen\"\r\nt MSG_121 \"%s einblenden\"\r\nt MSG_122 \"%s ausblenden\"\r\nt MSG_123 \"Größe der persistenten Partition\"\r\nt MSG_124 \"Keine Persistenz\"\r\nt MSG_125 \"Größe der persistenten Partition des Live-USB-Systems. Eine Größe von 0 deaktiviert die Persistenz.\"\r\nt MSG_126 \"Einheit der Partitionsgröße festlegen.\"\r\nt MSG_127 \"Diese Nachricht nicht mehr anzeigen\"\r\nt MSG_128 \"Wichtiger Hinweis zu %s\"\r\nt MSG_129 \"Sie haben gerade ein Medium erstellt, welches das UEFI:NTFS-Startprogramm verwendet. Bitte denken Sie daran, dass Sie zum Starten dieses Mediums SECURE BOOT DEAKTIVIEREN müssen.\\nNach dem Abschluss des Vorgangs sollten Sie SECURE BOOT wieder aktivieren.\\nWeitere Informationen, warum dies notwendig ist, finden Sie über die Schaltfläche \\\"Weitere Informationen\\\".\"\r\nt MSG_130 \"Windows-Image auswählen\"\r\nt MSG_131 \"Dieses ISO-Image enthält mehrere Windows-Images.\\nBitte wählen Sie das Image aus, das Sie für diese Installation verwenden möchten:\"\r\nt MSG_132 \"Ein anderer Prozess bzw. ein anderes Programm verwendet das Laufwerk gerade. Wollen Sie es trotzdem formatieren?\"\r\nt MSG_133 \"Rufus hat erkannt, dass Sie ein 'Windows To Go'-Startmedium, basierend auf Windows 10 Version 1809, erstellen wollen.\\n\\nAufgrund eines \\\"MICROSOFT BUGS\\\" wird das Startmedium nicht funktionieren (Blue Screen), wenn Sie die Datei 'WppRecorder.sys' nicht mit der 1803-Version ersetzen.\\n\\nAufgrund von Copyright-Richtlinien kann Rufus die Datei 'WppRecorder.sys' nicht selbst reparieren, weil wir diese Datei nicht in unsere Applikation einbetten dürfen.\"\r\nt MSG_134 \"Weil MBR als Partitionsschema gewählt wurde, kann Rufus nur eine maximal 2 TB große Partition auf diesem Laufwerk erstellen. %s des Speicherplatzes bleiben ungenutzt.\\n\\nWollen Sie fortfahren?\"\r\nt MSG_138 \"Sprache\"\r\nt MSG_139 \"Architektur\"\r\nt MSG_140 \"Weiter\"\r\nt MSG_141 \"Zurück\"\r\nt MSG_142 \"Bitte warten...\"\r\nt MSG_143 \"Mit dem Browser herunterladen\"\r\nt MSG_144 \"Der Download von Windows-ISOs ist nicht möglich, da Microsoft seine Website geändert hat, um dies zu verhindern.\"\r\nt MSG_145 \"PowerShell 3.0 oder neuer ist erforderlich, um dieses Skript auszuführen.\"\r\nt MSG_146 \"Wollen Sie online gehen und den Download ausführen?\"\r\nt MSG_148 \"Download-Skript ausführen...\"\r\nt MSG_149 \"ISO-Image herunterladen\"\r\nt MSG_150 \"Der Typ des Computers, an dem Sie das startfähige Laufwerk verwenden wollen. Sie müssen entscheiden, ob Ihr Ziel vom Typ BIOS oder UEFI ist. Andernfalls schlägt der Start fehl.\"\r\nt MSG_151 \"'UEFI-CSM' bedeutet, dass der Computer unter UEFI nur im BIOS-Emulationsmodus (auch als 'Legacy-Modus' bezeichnet) und nicht im nativen UEFI-Modus gestartet wird.\"\r\nt MSG_152 \"'Ohne CSM' bedeutet, dass das Gerät nur im nativen UEFI-Modus und nicht im 'Legacy- bzw. CSM-Modus' startet.\"\r\nt MSG_153 \"Prüfmuster: 0x%02X\"\r\nt MSG_154 \"Prüfmuster: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Prüfmuster: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Prüfmuster: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Zieldateisystem auswählen\"\r\nt MSG_158 \"Kleinste Größe, die ein Datenblock im Dateisystem belegt\"\r\nt MSG_159 \"Geben Sie hier die Datenträgerbezeichnung ein.\\nInternationale Schriftzeichen sind erlaubt.\"\r\nt MSG_160 \"Erweiterte Optionen ein- bzw. ausblenden\"\r\nt MSG_161 \"Das Laufwerk mittels eines Testmusters auf fehlerhafte Blöcke prüfen\"\r\nt MSG_162 \"Wenn nicht aktiviert, wird die \\\"langsame\\\" Formatierung verwendet\"\r\nt MSG_163 \"Methode, mit der das Laufwerk partitioniert wird\"\r\nt MSG_164 \"Methode, um das Laufwerk startfähig zu machen\"\r\nt MSG_165 \"Image-Datei oder Download auswählen...\"\r\nt MSG_166 \"Wählen Sie diese Option, um die Anzeige internationaler Bezeichnungen zu ermöglichen und ein Gerätesymbol zu erzeugen (autorun.inf).\"\r\nt MSG_167 \"Ein UEFI-Startprogramm installieren, das eine MD5Sum-Dateiüberprüfung auf dem Datenträger durchführt\"\r\nt MSG_169 \"Eine zusätzliche versteckte Partition erzeugen und die Partitionsgrenzen ausrichten.\\nDas kann die Starterkennung für ältere BIOSe verbessern.\"\r\nt MSG_170 \"Erkennung von externen USB-Festplatten aktivieren. VERWENDUNG AUF EIGENES RISIKO!\"\r\nt MSG_171 \"Formatierung starten.\\nAlle Daten auf dem Ziellaufwerk werden GELÖSCHT!\"\r\nt MSG_172 \"Ungültige Download-Signatur\"\r\nt MSG_173 \"Klicken Sie, um auszuwählen...\"\r\nt MSG_174 \"Rufus - Das zuverlässige USB-Formatierungstool\"\r\nt MSG_176 \"Deutsche Übersetzung: Thilo Langbein <mailto:mail@thilo-langbein.de>\"\r\nt MSG_177 \"Fehler und Anforderungen an:\"\r\nt MSG_178 \"Weitere Copyrights:\"\r\nt MSG_179 \"Aktualisierungseinstellungen:\"\r\nt MSG_180 \"Wenn Sie die Prüfung auf neue Versionen verwenden, erlauben Sie, dass die folgenden Informationen auf unseren Systemen gespeichert werden:\"\r\nt MSG_181 \"Ihre Betriebssystem-Architektur und -Version\"\r\nt MSG_182 \"Die Version der Anwendung, die Sie einsetzen\"\r\nt MSG_183 \"Ihre IP-Adresse\"\r\nt MSG_184 \"Zu privaten Statistikzwecken speichern wir diese Informationen \\\\b für höchstens ein Jahr\\\\b0. Es werden keine Daten an Dritte weitergegeben.\"\r\nt MSG_185 \"Update-Vorgang:\"\r\nt MSG_186 \"Rufus verwendet keine Hintergrundprozesse. Deshalb wird nur auf Updates geprüft, wenn die Anwendung läuft.\\\\line\\nEine Internetverbindung ist natürlich für die Prüfung auf neue Versionen erforderlich.\"\r\nt MSG_187 \"Image-Datei für die gewählte Boot-Option nicht passend\"\r\nt MSG_188 \"Die derzeitige Image-Datei passt nicht zur gewählten Boot-Option. Bitte wählen sie eine andere Image-Datei oder eine andere Boot-Option.\"\r\nt MSG_189 \"Dieses ISO-Image ist mit dem gewählten Dateisystem nicht kompatibel\"\r\nt MSG_190 \"Inkompatibles Laufwerk erkannt\"\r\nt MSG_191 \"Schreiben durchgeführt\"\r\nt MSG_192 \"Lesen durchgeführt\"\r\nt MSG_193 \"%s heruntergeladen\"\r\nt MSG_194 \"%s konnte nicht heruntergeladen werden\"\r\nt MSG_195 \"Embedded-Version der %s Datei(en) verwenden\"\r\nt MSG_196 \"WICHTIG: DIESES LAUFWERK HAT EINE NICHT STANDARDISIERTE SEKTORGRÖẞE!\\n\\nHerkömmliche Laufwerke nutzen eine Sektorgröße von 512 Byte, aber dieses Laufwerk nutzt %d Byte. Höchstwahrscheinlich können Sie von diesem Laufwerk NICHT starten.\\nRufus kann versuchen, ein startfähiges Laufwerk zu erstellen, aber es gibt KEINE GARANTIE, dass es funktionieren wird.\"\r\nt MSG_197 \"Nicht standardisierte Sektorgröße erkannt\"\r\nt MSG_198 \"'Windows To Go' kann nur auf ein GPT-partitioniertes Laufwerk installiert werden, wenn das FIXED-Attribut gesetzt ist. Das aktuelle Laufwerk hat dieses nicht.\"\r\nt MSG_199 \"Diese Funktion ist auf dieser Plattform nicht verfügbar.\"\r\nt MSG_201 \"Abbrechen - Bitte warten...\"\r\nt MSG_202 \"Image-Datei lesen...\"\r\nt MSG_203 \"Fehler beim Lesen der Image-Datei\"\r\nt MSG_204 \"Überflüssige %s erkannt\"\r\nt MSG_205 \"Verwende Image: %s\"\r\nt MSG_206 \"Fehlende %s Datei\"\r\nt MSG_207 \"Neues Volume\"\r\nt MSG_208 \"%d Laufwerk gefunden\"\r\nt MSG_209 \"%d Laufwerke gefunden\"\r\nt MSG_210 \"FERTIG\"\r\nt MSG_211 \"Abgebrochen\"\r\nt MSG_212 \"FEHLGESCHLAGEN\"\r\nt MSG_213 \"Anwendung neu starten...\"\r\nt MSG_214 \"Fehler beim Anwendungsneustart\"\r\nt MSG_215 \"Geöffnet %s\"\r\nt MSG_216 \"Gespeichert %s\"\r\nt MSG_217 \"Formatieren: %s\"\r\nt MSG_218 \"Dateisystem erzeugen: Aufgabe %d/%d abgeschlossen\"\r\nt MSG_219 \"NTFS-Reparatur: %d%% erledigt\"\r\nt MSG_220 \"Formatiere (%s) - geschätzte Dauer %d:%02d...\"\r\nt MSG_221 \"Bezeichnung einstellen (%s)...\"\r\nt MSG_222 \"Formatiere (%s)...\"\r\nt MSG_223 \"NTFS-Reparatur (Checkdisk)...\"\r\nt MSG_224 \"MBR/PBR/GPT zurücksetzen...\"\r\nt MSG_225 \"Laufwerkszugriff angefordert...\"\r\nt MSG_226 \"Vorhandene Boot-Datensätze analysieren...\"\r\nt MSG_227 \"Vorhandenes Volume schließen...\"\r\nt MSG_228 \"Master Boot Record schreiben...\"\r\nt MSG_229 \"Partition Boot Record schreiben...\"\r\nt MSG_230 \"DOS-Dateien kopieren...\"\r\nt MSG_231 \"ISO-Dateien kopieren: %s\"\r\nt MSG_232 \"Win7 EFI-Boot-Setup (%s)...\"\r\nt MSG_233 \"Abschließen, bitte warten...\"\r\nt MSG_234 \"Installiere Syslinux %s...\"\r\nt MSG_235 \"Fehlerhafte Blöcke: %s %d/%d - %0.2f%% (%d/%d/%d Fehler)\"\r\nt MSG_236 \"Fehlerhafte Blöcke: Mit Zufallsmuster prüfen\"\r\nt MSG_237 \"Fehlerhafte Blöcke: Mit Muster 0x%02X prüfen\"\r\nt MSG_238 \"Partitioniere (%s)...\"\r\nt MSG_239 \"Lösche Partitionen (%s)...\"\r\nt MSG_240 \"Die Signatur des heruntergeladenen Updates konnte nicht überprüft werden. Das könnte bedeuten, dass Ihr System für die Prüfung der Signatur nicht konfiguriert ist oder der Download bösartig ist.\\n\\nDer Download wird gelöscht. Bitte prüfen Sie das Log für weitere Informationen.\"\r\nt MSG_241 \"Download: %s\"\r\nt MSG_242 \"Fehler beim Dateidownload.\"\r\nt MSG_243 \"Prüfe auf neue Rufus-Version...\"\r\nt MSG_244 \"Update: Keine Verbindung zum Internet\"\r\nt MSG_245 \"Update: Versionsinformationen können nicht ermittelt werden\"\r\nt MSG_246 \"Eine neue Version von Rufus ist verfügbar!\"\r\nt MSG_247 \"Es wurde keine neue Version von Rufus gefunden\"\r\nt MSG_248 \"Anwendungseinstellungen in der Registrierdatenbank erfolgreich gelöscht\"\r\nt MSG_249 \"Fehler beim Löschen der Anwendungseinstellungen in der Registrierdatenbank\"\r\nt MSG_250 \"%s aktiviert\"\r\nt MSG_251 \"%s deaktiviert\"\r\nt MSG_252 \"Größenprüfung\"\r\nt MSG_253 \"Festplattenerkennung\"\r\nt MSG_254 \"Large FAT32-Formatierung erzwingen\"\r\nt MSG_255 \"NoDriveTypeAutorun wird beim Beenden gelöscht\"\r\nt MSG_256 \"Erkennung falscher Laufwerke\"\r\nt MSG_257 \"Joliet-Unterstützung\"\r\nt MSG_258 \"Rock Ridge-Unterstützung\"\r\nt MSG_259 \"Update erzwingen\"\r\nt MSG_260 \"NTFS-Komprimierung\"\r\nt MSG_261 \"Schreibe Image-Datei: %s\"\r\nt MSG_262 \"ISO-Unterstützung\"\r\nt MSG_263 \"Korrekte Größeneinheiten verwenden\"\r\nt MSG_264 \"Lösche Ordner '%s'\"\r\nt MSG_265 \"VMware-Laufwerkserkennung\"\r\nt MSG_266 \"Dualer UEFI/BIOS-Modus\"\r\nt MSG_267 \"Windows-Image aufspielen: %s\"\r\nt MSG_268 \"Windows-Image aufspielen...\"\r\nt MSG_269 \"Zeitstempel bewahren\"\r\nt MSG_270 \"USB-Testmodus\"\r\nt MSG_271 \"Berechne Image-Prüfsumme: %s\"\r\nt MSG_272 \"Berechne MD5-, SHA1- und SHA256-Prüfsumme für das gewählte Image\"\r\nt MSG_273 \"Sprache der Anwendung ändern\"\r\nt MSG_274 \"%s-Image erkannt\"\r\nt MSG_275 \"Das gewählte Image ist eine hybrides ISO-Image. Es kann entweder im %s- (Dateikopier-) oder im %s- (Image-) Modus kopiert werden.\\nRufus empfiehlt den %s-Modus, denn dann haben Sie nach dem Schreiben vollen Zugriff auf das Laufwerk.\\nWenn Sie beim Starten Probleme haben, können Sie den %s-Modus versuchen.\\n\\nBitte wählen Sie den Modus, mit dem Sie das Image schreiben wollen:\"\r\nt MSG_276 \"Im %s-Modus schreiben (empfohlen)\"\r\nt MSG_277 \"Im %s-Modus schreiben\"\r\nt MSG_278 \"Prüfe auf konkurrierende Prozesse...\"\r\nt MSG_279 \"Nicht startfähig\"\r\nt MSG_280 \"Laufwerk oder ISO-Image\"\r\nt MSG_281 \"%s (Bitte wählen Sie ein Image)\"\r\nt MSG_282 \"Exklusive Sperre für das USB-Laufwerk\"\r\nt MSG_283 \"Ungültige Signatur\"\r\nt MSG_284 \"Der heruntergeladenen ausführbaren Datei fehlt eine digitale Signatur.\"\r\nt MSG_285 \"Die heruntergeladene ausführbare Datei ist mit '%s' signiert.\\nDiese Signatur ist nicht akzeptiert und könnte auf eine böswillige Aktivität hindeuten.\\nSind Sie sicher, dass Sie diese Datei ausführen wollen?\"\r\nt MSG_286 \"Laufwerk mit Nullen überschreiben: %s\"\r\nt MSG_287 \"Erkennung nicht wechselbarer USB-Laufwerke\"\r\nt MSG_288 \"Administrative Rechte nicht vorhanden\"\r\nt MSG_289 \"Dieses Programm kann nur mit administrativen Rechten ausgeführt werden\"\r\nt MSG_290 \"Datei-Indizierung\"\r\nt MSG_291 \"Versionsauswahl\"\r\nt MSG_292 \"Bitte wählen Sie die Version von Windows aus, die Sie installieren wollen:\"\r\nt MSG_293 \"Nicht unterstützte Windows-Version\"\r\nt MSG_294 \"Diese Version von Windows wird nicht mehr von Rufus unterstützt.\\n\\vDie letzte mit dieser Plattform kompatible Version von Rufus ist v%d.%d.\"\r\nt MSG_295 \"Warnung: Inoffizielle Version\"\r\nt MSG_296 \"Diese Version von Rufus wurde nicht vom offiziellen Entwickler zur Verfügung gestellt.\\n\\nSind Sie sicher, dass Sie sie ausführen wollen?\"\r\nt MSG_297 \"Unvollständiges ISO-Image erkannt\"\r\nt MSG_298 \"Das ISO-Image, dass Sie gewählt haben, hat nicht die erwartete Größe. %s Daten fehlen!\\n\\nWenn Sie das Image aus dem Internet heruntergeladen haben, sollten Sie den Download wiederholen und prüfen, ob die MD5- oder SHA-Prüfsummen übereinstimmen.\\n\\nHinweis: Mit der Schaltfläche (✓) in der Statuszeile können Sie die Prüfsummen des gewählten Images anzeigen.\"\r\nt MSG_299 \"Fehler bei der Überprüfung des Zeitstempels\"\r\nt MSG_300 \"Rufus konnten nicht prüfen, ob der Zeitstempel des Update-Downloads aktueller ist als der des aktuell ausgeführten Programms.\\n\\nAus Sicherheitsgründen wurde der Aktualisierungsprozess abgebrochen und der Download wurde gelöscht. Im Log finden Sie weitere Details.\"\r\nt MSG_301 \"Applikationseinstellungen anzeigen\"\r\nt MSG_302 \"Informationen über dieses Programm anzeigen\"\r\nt MSG_303 \"Log anzeigen\"\r\nt MSG_304 \"Ein Image des gewählten Laufwerks erstellen\"\r\nt MSG_305 \"Verwenden Sie diese Option, um anzugeben, ob Sie Windows auf einem anderen Datenträger installieren möchten oder ob Sie Windows direkt von diesem Laufwerk ausführen möchten (Windows To Go).\"\r\nt MSG_306 \"Laufwerk mit Nullen überschreiben (schnell): %s\"\r\nt MSG_307 \"Der Vorgang nimmt einige Zeit in Anspruch\"\r\nt MSG_308 \"VHD-Erkennung\"\r\nt MSG_309 \"Archivdatei\"\r\nt MSG_310 \"Das ausgewählte ISO-Image verwendet UEFI und ist klein genug, um auf eine EFI-Systempartition (ESP) geschrieben zu werden. Es auf eine ESP anstelle einer normalen Partition zu schreiben, die die gesamte Festplatte belegt, kann für bestimmte Installationsarten vorteilhaft sein.\\n\\nBitte wählen Sie einen Modus aus:\"\r\nt MSG_311 \"Verwende %s (Hauptfenster der Anwendung) zum Aktivieren.\"\r\nt MSG_312 \"Zusätzliche Prüfsummen (SHA512)\"\r\nt MSG_313 \"Als VHD speichern\"\r\nt MSG_314 \"Prüfsumme des Images berechnen\"\r\nt MSG_315 \"Mehrere Schaltflächen\"\r\nt MSG_316 \"Anzahl der Durchläufe\"\r\nt MSG_317 \"Disk-ID\"\r\nt MSG_318 \"Standardmäßige Thread-Priorität: %d\"\r\nt MSG_319 \"Boot-Markierung ignorieren\"\r\nt MSG_320 \"Liste der Partitionen aktualisieren (%s)...\"\r\nt MSG_321 \"Das ausgewählte Image ist vom Typ ISOHybrid, aber der Ersteller hat es nicht mit dem ISO/Dateikopiermodus kompatibel gemacht.\\nDeswegen wird der DD-Schreibmodus verwendet.\"\r\nt MSG_322 \"'%' kann nicht geöffnet/gelesen werden\"\r\nt MSG_325 \"Windows-Anpassungen anwenden: %s\"\r\nt MSG_326 \"Benutzereinstellungen anwenden...\"\r\nt MSG_327 \"Windows-Benutzererfahrung\"\r\nt MSG_328 \"Windows-Installation anpassen?\"\r\nt MSG_329 \"Anforderung für 4GB+ RAM, Secure Boot und TPM 2.0 entfernen\"\r\nt MSG_330 \"Anforderung für Online-Microsoft-Konto entfernen\"\r\nt MSG_331 \"Datenerfassung deaktivieren (Fragen zum Datenschutz überspringen)\"\r\nt MSG_332 \"Verhindern, dass Windows To Go auf interne Laufwerke zugreifen kann\"\r\nt MSG_333 \"Ein lokales Benutzerkonto erstellen:\"\r\nt MSG_334 \"Regionale Optionen auf die gleichen Werte wie die dieses Benutzers setzen\"\r\nt MSG_335 \"Deaktivieren der automatischen BitLocker-Laufwerksverschlüsselung\"\r\nt MSG_336 \"Dauerhaftes Protokoll\"\r\nt MSG_337 \"Eine zusätzliche Datei ('%s') muss von Microsoft heruntergeladen werden, um diese Funktion zu nutzen:\\n- Wählen Sie 'Ja', um eine Verbindung mit dem Internet herzustellen und die Datei herunterzuladen\\n- Wählen Sie 'Nein', um den Vorgang abzubrechen\\n\\nHinweis: Die Datei wird ins Programmverzeichnis heruntergeladen und bei Bedarf wiederverwendet.\"\r\nt MSG_338 \"Zurückgezogenes UEFI-Startprogramm erkannt\"\r\nt MSG_339 \"Rufus hat erkannt, dass das gewählte ISO-Image ein UEFI-Startprogramm enthält, das zurückgezogen wurde. Das führt zu %s, wenn das UEFI-System aktuell ist und Secure Boot aktiv ist.\\n\\n- Wenn Sie das ISO-Image aus einer unzuverlässigen Quelle haben, sollten Sie in Betracht ziehen, dass es UEFI-Schadcode enthält und es deshalb nicht verwenden.\\n- Wenn Sie es aus einer vertrauenswürdigen Quelle haben, sollten Sie versuchen, eine aktuellere Version zu bekommen, die dieses Problem nicht hat.\"\r\nt MSG_340 \"ein Bildschirm \\\"Sicherheitsverletzung\\\"\"\r\nt MSG_341 \"ein Windows-Wiederherstellungsbildschirm (BSOD) mit '%s'\"\r\nt MSG_342 \"Komprimiertes VHDX-Image\"\r\nt MSG_343 \"Unkomprimiertes VHD-Image\"\r\nt MSG_344 \"Vollständiges Flash-Update-Image\"\r\nt MSG_345 \"Einige weitere Daten müssen von Microsoft heruntergeladen werden, um diese Funktion zu verwenden:\\n- Wählen Sie 'Ja', um eine Verbindung mit dem Internet herzustellen und diese herunterzuladen\\n- Wählen Sie 'Nein', um den Vorgang abzubrechen\"\r\nt MSG_346 \"Windows im S-Modus (nicht kompatibel mit Online Konto-Umgehung)\"\r\nt MSG_347 \"Expertenmodus\"\r\nt MSG_348 \"Archivdatei extrahieren: %s\"\r\nt MSG_349 \"Rufus MBR verwenden\"\r\nt MSG_900 \"Rufus ist ein Werkzeug, das beim Formatieren und Erstellen bootfähiger USB-Flash-Laufwerke wie USB-Sticks, Speichersticks usw. hilft.\"\r\nt MSG_901 \"Offizielle Website: %s\"\r\nt MSG_902 \"Quellcode: %s\"\r\nt MSG_903 \"Änderungsprotokoll: %s\"\r\nt MSG_904 \"Diese Anwendung ist unter den Bedingungen der GNU Public License (GPL) Version 3 lizenziert.\\nSiehe https://www.gnu.org/licenses/gpl-3.0.de.html für Details.\"\r\nt MSG_910 \"Formatieren von USB, Flash-Karte und virtuellen Laufwerken in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"FreeDOS-bootfähige USB-Laufwerke erstellen\"\r\nt MSG_912 \"Erstellen bootfähiger Laufwerke aus bootfähigen ISOs (Windows, Linux etc.)\"\r\nt MSG_913 \"Erstellen bootfähiger Laufwerke aus bootfähigen Festplatten-Images, einschließlich komprimierter Images\"\r\nt MSG_914 \"Erstellen von BIOS- oder UEFI-bootfähigen Laufwerken, einschließlich UEFI-bootfähigem NTFS\"\r\nt MSG_915 \"Erstellen von 'Windows To Go'-Laufwerken\"\r\nt MSG_916 \"Erstellen von Windows 11-Installationslaufwerken für PCs ohne TPM oder Secure Boot\"\r\nt MSG_917 \"Persistente Linux-Partitionen erstellen\"\r\nt MSG_918 \"VHD/DD-Images des ausgewählten Laufwerks erstellen\"\r\nt MSG_919 \"Berechnung von MD5-, SHA-1-, SHA-256- und SHA-512-Prüfsummen für das ausgewählte Image\"\r\nt MSG_920 \"Durchführung von Prüfungen auf fehlerhafte Blöcke, einschließlich der Erkennung von \\\"gefälschten\\\" Flash-Laufwerken\"\r\nt MSG_921 \"Offizielle Microsoft Windows-ISOs herunterladen\"\r\nt MSG_922 \"UEFI-Shell-ISOs herunterladen\"\r\n\r\n#########################################################################\r\nl \"el-GR\" \"Greek (Ελληνικά)\" 0x0408\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Σχετικά με το Rufus\"\r\nt IDC_ABOUT_LICENSE \"Άδεια χρήσης\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Ιδιότητες Δίσκου\"\r\nt IDS_DEVICE_TXT \"Συσκευή\"\r\nt IDS_BOOT_SELECTION_TXT \"Τύπος εκκίνησης\"\r\nt IDC_SELECT \"Επιλέξτε\"\r\nt IDS_IMAGE_OPTION_TXT \"Επιλογές αρχείου ISO\"\r\nt IDS_PARTITION_TYPE_TXT \"Σχέδιο κατανομής\"\r\nt IDS_TARGET_SYSTEM_TXT \"Επιθυμητό λειτουργικό σύστημα\"\r\nt IDC_LIST_USB_HDD \"Εμφάνιση συσκευων USB\"\r\nt IDC_OLD_BIOS_FIXES \"Προσθήκη διορθώσεων για παλαιότερα BIOS(επιπλέον διχοτόμηση, ευθυγράμμιση, κλπ.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Ενεργοποίηση επικύρωσης μέσων UEFI χρόνου εκτέλεσης\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Επιλογές μορφοποίησης\"\r\nt IDS_FILE_SYSTEM_TXT \"Σύστημα αρχείων\"\r\nt IDS_CLUSTER_SIZE_TXT \"Μέγεθος συμπλέγματος\"\r\nt IDS_LABEL_TXT \"Ετικέτα τόμου\"\r\nt IDC_QUICK_FORMAT \"Γρήγορη διαμόρφωση\"\r\nt IDC_BAD_BLOCKS \"Ελέγξτε τη συσκευή για κατεστραμμένους τομείς\"\r\nt IDC_EXTENDED_LABEL \"Δημιουργία εκτεταμένης ετικέτας και εικονιδίων\"\r\nt IDS_STATUS_TXT \"Κατάσταση\"\r\nt IDCANCEL \"Κλείσιμο\"\r\nt IDC_START \"Εκκίνηση\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Κλείσιμο\"\r\nt IDD_LICENSE \"Άδεια χρήσης για το Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Κλείσιμο\"\r\nt IDD_LOG \"Αρχείο καταγραφής\"\r\nt IDC_LOG_CLEAR \"Καθαρισμός\"\r\nt IDC_LOG_SAVE \"Αποθήκευση\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Κλείσιμο\"\r\nt IDD_NEW_VERSION \"Έλεγχος για ενημερώσεις - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Μια νεότερη εκδοχή είναι διαθέσιμη. Παρακαλώ κάντε λήψη της τελευταίας έκδοσης!\"\r\nt IDC_WEBSITE \"Κάντε κλικ εδώ για να μεταβείτε στην ιστοσελίδα\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Σημειώσεις έκδοσης\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Λήψη\"\r\nt IDC_DOWNLOAD \"Λήψη\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Περισσότερες πληροφορίες\"\r\nt IDYES \"Ναι\"\r\nt IDNO \"Όχι\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Κλείσιμο\"\r\nt IDD_UPDATE_POLICY \"Πολιτική ενημέρωσης και ρυθμίσεων\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Ρυθμίσεις\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Έλεγχος για ενημερώσεις\"\r\nt IDS_INCLUDE_BETAS_TXT \"Συμπερίληψη εκδοχών beta\"\r\nt IDC_CHECK_NOW \"Έλεγχος τώρα\"\r\n\r\nt MSG_001 \"Ανιχνεύθηκε άλλη εφαρμογή Rufus\"\r\nt MSG_002 \"Μία άλλη εφαρμογή Rufus εκτελείται ήδη.\\nΠαρακαλώ κλείστε την πρώτη εφαρμογή πριν εκτελέσετε μία άλλη.\"\r\nt MSG_003 \"ΠΡΟΣΟΧΗ: ΟΛΑ ΤΑ ΔΕΔΟΜΈΝΑ ΣΤΗ ΣΥΣΚΕΥΗ '%s' ΘΑ ΔΙΑΓΡΑΦΟΥΝ.\\nΓια να προχωρήσετε με την ενέργεια κάντε κλικ στο OK. Διαφορετικά,για ακύρωση κάντε κλικ στο Άκυρο.\"\r\nt MSG_004 \"Πολιτική αναβάθμισης του Rufus\"\r\nt MSG_005 \"Θέλετε να επιτραπεί στο Rufus να ελέγχει για ενημερώσεις;\"\r\nt MSG_006 \"Κλείσιμο\"\r\nt MSG_007 \"Άκυρο\"\r\nt MSG_008 \"Ναι\"\r\nt MSG_009 \"Όχι\"\r\nt MSG_010 \"Βρέθηκαν κατεστραμμένοι τομείς\"\r\nt MSG_011 \"Ο έλεγχος ολοκληρώθηκε: βρέθηκαν %d κατεστραμμένοι τομείς\\n  %d σφάλματα ανάγνωσης\\n  %d σφάλματα εγγραφής\\n  %d σφάλματα διαφθοράς\"\r\nt MSG_012 \"%s\\nΜια πιο λεπτομερής αναφορά μπορεί να βρεθεί στο:\\n%s\"\r\nt MSG_013 \"Απενεργοποιημένο\"\r\nt MSG_014 \"Καθημερινά\"\r\nt MSG_015 \"Εβδομαδιαία\"\r\nt MSG_016 \"Μηνιαία\"\r\nt MSG_017 \"Προσαρμογή\"\r\nt MSG_018 \"Η εκδοχή σας: %d.%d (Build %d)\"\r\nt MSG_019 \"Τελευταία εκδοχή: %d.%d (Build %d)\"\r\nt MSG_029 \"Προεπιλογή\"\r\nt MSG_030 \"%s (Προεπιλογή)\"\r\nt MSG_031 \"BIOS (ή UEFI-CSM)\"\r\nt MSG_032 \"UEFI (εκτός από CSM)\"\r\nt MSG_033 \"BIOS ή UEFI\"\r\nt MSG_034 \"%d Πέρασμα\"\r\nt MSG_035 \"%d Περάσματα %s\"\r\nt MSG_036 \"Αρχείο ISO\"\r\nt MSG_037 \"Εφαρμογή\"\r\nt MSG_038 \"Ακύρωση\"\r\nt MSG_039 \"Εκκίνηση\"\r\nt MSG_040 \"Λήψη\"\r\nt MSG_041 \"Η διαδικασία ακυρώθηκε από το χρήστη\"\r\nt MSG_042 \"Σφάλμα\"\r\nt MSG_043 \"Σφάλμα: %s\"\r\nt MSG_044 \"Λήψη αρχείου\"\r\nt MSG_045 \"Συσκευή αποθήκευσης USB(Generic)\"\r\nt MSG_046 \"%s (Δίσκος %d) [%s]\"\r\nt MSG_047 \"Πολλαπλά διαμερίσματα\"\r\nt MSG_048 \"Rufus - Ρήξη προσωρινής μνήμης\"\r\nt MSG_049 \"Rufus - Ακύρωση\"\r\nt MSG_050 \"Επιτυχεία.\"\r\nt MSG_051 \"Απροσδιόριστο σφάλμα κατά τη διαμόρφωση.\"\r\nt MSG_052 \"Δεν μπορείτε να χρησιμοποιήσετε το επιλεγμένο σύστημα αρχείων για αυτό το μέσο.\"\r\nt MSG_053 \"Η πρόσβαση στη συσκευή δεν επιτρέπεται.\"\r\nt MSG_054 \"Το μέσο έχει προστασία εγγραφής.\"\r\nt MSG_055 \"Η συσκευή είναι σε χρησιμοποιείται από άλλη διαδικασία. Παρακαλώ κλείστε κάθε άλλη διαδικασία που μπορεί να έχει πρόσβαση στη συσκευή.\"\r\nt MSG_056 \"Η γρήγορη διαμόρφωση δεν είναι διαθέσιμη για αυτήν τη συσκευή.\"\r\nt MSG_057 \"Η ετικέτα του τόμου δεν είναι έγκυρη.\"\r\nt MSG_058 \"Η αναφορά πόρου(handle) συσκευής δεν είναι έγκυρη.\"\r\nt MSG_059 \"Το επιλεγμένο μέγεθος μονάδας εκχώρησης δεν είναι έγκυρο για αυτήν τη συσκευή.\"\r\nt MSG_060 \"Το μέγεθος του τόμου δεν είναι έγκυρο.\"\r\nt MSG_061 \"Παρακαλώ εισάγετε κάποιο αφαιρούμενο μέσο στο δίσκο.\"\r\nt MSG_062 \"Δόθηκε μη έγκυρη εντολή.\"\r\nt MSG_063 \"Σφάλμα ταξινόμησης μνήμης.\"\r\nt MSG_064 \"Σφάλμα ανάγνωσης.\"\r\nt MSG_065 \"Σφάλμα εγγραφής.\"\r\nt MSG_066 \"Αποτυχία εγκατάστασης\"\r\nt MSG_067 \"Το μέσο δεν μπορεί να ανοίξει. Πιθανόν να είναι σε χρήση από κάποια άλλη διαδικασία. Παρακαλώ επανασυνδέστε το μέσο και δοκιμάστε ξανά.\"\r\nt MSG_068 \"Σφάλμα κατά το διαμερισμό της μονάδας δίσκου.\"\r\nt MSG_069 \"Δεν ήταν δυνατή η αντιγραφή αρχείων στον επιθυμητό δίσκο.\"\r\nt MSG_070 \"Ακυρώθηκε από το χρήστη.\"\r\nt MSG_071 \"Δεν είναι δυνατή η εκκίνηση της διεργασίας(thread).\"\r\nt MSG_072 \"Ο έλεγχος για κατεστραμμένους τομείς δεν ολοκληρώθηκε.\"\r\nt MSG_073 \"Αποτυχία σάρωσης αρχείου ISO.\"\r\nt MSG_074 \"Αποτυχία εξαγωγής αρχείου ISO.\"\r\nt MSG_075 \"Δεν είναι δυνατή η επανατοποθέτηση του τόμου.\"\r\nt MSG_076 \"Δεν είναι δυνατή η εγκατάσταση/τροποποίηση(patch) των αρχείων για εκκίνηση.\"\r\nt MSG_077 \"Αδυναμία αναθέτησης γράμματος στη μονάδα δίσκου.\"\r\nt MSG_078 \"Δεν είναι δυνατή η προσάρτηση του τόμου GUID.\"\r\nt MSG_079 \"Η συσκευή δεν είναι έτοιμη.\"\r\nt MSG_080 \"Το Rufus διαπίστωσε ότι τα Windows κάνουν ακόμη flushing της προσωρινής μνήμης στο USB.\\n\\nΑνάλογα με την ταχύτητα του USB σας, αυτή η διαδικασία μπορεί να διαρκέσει αρκετή ώρα για την ολοκλήρωση του, ειδικά για μεγάλα αρχεία.\\n\\nΣας συνιστούμε να αφήσετε τα Windows να τελειώσουν την διαδικασία τους, έτσι ώστε να αποφευχθεί κάποιο σφάλμα. Εάν δεν θέλετε να περιμένετε απλώς αποσυνδέσετε τη συσκευή...\"\r\nt MSG_081 \"Μη υποστηριζόμενο αρχείο\"\r\nt MSG_082 \"Αυτό το αρχείο είτε δεν διαθέτει δυνατότητα εκκίνησης ή δεν χρησιμοποιεί κάποια από τις μεθόδους συμπίεσης/εκκίνησης υποστηριζόμενη απο το Rufus...\"\r\nt MSG_083 \"Αντικατάσταση %s?\"\r\nt MSG_084 \"Αυτό το αρχείο ISO φαίνεται να χρησιμοποιεί μία ξεπερασμένη εκδοχή του '%s'.\\nΤο μενού εκκίνησης μπορεί να μην εμφανίζεται σωστά εξαιτίας αυτού.\\n\\nΤο Rufus είναι σε θέση να κάνει λήψη μίας νεότερης έκδοσης για να διορθωθεί αυτό το πρόβλημα:\\n- Επιλέξτε το 'Ναι' για να συνδεθείτε στο διαδίκτυο και να κάνετε λήψη του αρχείου\\n- Επιλέξτε το 'Όχι' για να αφήσετε το αρχείο ISO αμετάβλητο.\\nΣε περίπτωση που δεν γνωρίζετε τι να κάνετε, καλύτερα να επιλέξετε το 'Ναι'.\\n\\nΣημείωση: Η λήψη του νέου αρχείου θα γίνει στον τρέχοντα φάκελο και εφόσον το'%s' υπάρχει εκεί, θα επαναχρησιμοποιηθεί αυτόματα.\"\r\nt MSG_085 \"Κατάσταση Λήψης %s\"\r\nt MSG_086 \"Δεν έχει επιλεχθεί κάποιο επιλεγμένο αρχείο\"\r\nt MSG_087 \"για %s NAND\"\r\nt MSG_088 \"Το αρχείο έχει πολύ μεγάλο μέγεθος\"\r\nt MSG_089 \"Το μέγεθος του επιλεγμένου αρχείου είναι μεγαλύτερο από την χωρητικότητα του επιλεγμένου μέσου.\"\r\nt MSG_090 \"Μη υποστηριζόμενο ISO\"\r\nt MSG_091 \"Όταν χρησιμοποιείτε ως επιθυμητό τύπο το UEFI μόνο είδωλα ISO με δυνατότητα εκκίνησης τύπου EFI υποστηρίζονται. Παρακαλώ επιλέξτε ένα είδωλο ISO με δυνατότητα εκκίνησης τύπου EFI ή επιλέξτε ως επιθυμητό τύπο το BIOS.\"\r\nt MSG_092 \"Μη υποστηριζόμενο σύστημα αρχείων\"\r\nt MSG_093 \"ΠΡΟΣΟΧΗ: Η ΕΠΙΛΕΓΜΕΝΗ ΣΥΣΚΕΥΗ ΠΕΡΙΕΧΕΙ ΠΟΛΛΑΠΛΟΥΣ ΔΙΑΜΕΡΙΣΜΟΥΣ!!\\n\\nΜπορεί να εμπεριέχονται διαμερισμοί/τόμοι οι οποίοι δεν έχουν εισαχθεί ή δεν είναι ορατοί από τα Windows. Εάν επιθυμείτε να συνεχίσετε, είστε υπεύθυνοι για τυχόν απώλειες δεδομένων σε αυτούς τους διαμερισμούς.\"\r\nt MSG_094 \"Εντοπίστηκαν πολλαπλοί διαμερισμοί\"\r\nt MSG_095 \"Αρχείο DD\"\r\nt MSG_096 \"Αυτό το αρχείο ISO δεν είναι συμβατό με το επιλεγμένο σύστημα αρχείων. Παρακαλώ χρησιμοποιήστε κάποιο άλλο σύστημα αρχείων ή κάποιο άλλο αρχείο ISO.\"\r\nt MSG_097 \"Η επιλογή '%s' μπορεί να χρησιμοποιηθεί μόνο αν το σύστημα αρχείων είναι NTFS.\"\r\nt MSG_098 \"ΣΗΜΑΝΤΙΚΟ: Προσπαθείτε να εγκαταστήσετε τα 'Windows To Go', αλλά ο επιλεγμένος δίσκος δεν διαθέτει το χαρακτηριστικό 'ΣΤΑΘΕΡΑ'. Λόγω αυτού, τα Windows πιθανότατα θα 'παγώνουν' κατά τη διάρκεια της εκκίνησης εφόσον η Microsoft δεν έχει σχεδιάσει τα 'Windows To Go' για λειτουργία με δίσκους που έχουν το χαρακτηριστικό 'ΑΦΑΙΡΟΥΜΕΝΟΣ'.\\n\\nΕίστε σίγουροι ότι θέλετε να συνεχίσετε?\\n\\nΣημείωση: Το χαρακτηριστικό 'ΣΤΑΘΕΡΟΣ / ΑΦΑΙΡΟΥΜΕΝΟΣ' ενός δίσκου είναι μια ιδιότητα που μπορεί να αλλάξει μόνο χρησιμοποιώντας προσαρμοσμένα εργαλεία από τον κατασκευαστή της μονάδας. Ωστόσο, τα εργαλεία αυτά δεν διατίθενται στο κοινό.\"\r\nt MSG_099 \"Περιορισμός του συστήματος αρχείων\"\r\nt MSG_100 \"Αυτό το αρχείο ISO περιέχει ένα αρχείο μεγαλύτερο από 4 GB, το οποίο είναι μεγαλύτερο από το μέγιστο επιτρεπόμενο μέγεθος για το σύστημα αρχείων FAT ή FAT32.\"\r\nt MSG_101 \"Ελλιπής υποστήριξη για το WIM\"\r\nt MSG_102 \"Η πλατφόρμα σας δεν μπορεί να εξάγει αρχεία WIM. Η αποσυμπίεση του αρχείου WIM είναι απαραίτητη για την δημιουργία USBWindows 7 και Windows Vista δίσκων με δυνατότητα εκκίνησης τύπου EFI.Μπορείτε να διορθώσετε αυτό το πρόβλημα με την χρήση μίας πρόσφατης εκδοχής του 7-Zip.\\n Θα θέλατε να επισκεφθείτε την σελίδα λήψης του 7-Zip?\"\r\nt MSG_103 \"Λήψη %s?\"\r\nt MSG_104 \"Το %s ή κάποια νεότερη έκδοση χρειάζεται το αρχείο '%s' να είναι εγκατεστημένο.\\nΕπειδή αυτό το αρχείο είναι μεγαλύτερο από 100 KB σε μέγεθος, και υπάρχει πάντα σε είδωλα ISO %s, δεν είναι ενσωματωμένο στο Rufus.\\n\\nΤο Rufus είναι σε θέση να κάνει λήψη αυτού το αρχείου για εσάς:\\n- Επιλέξτε το 'Ναι' για να συνδεθείτε στο διαδίκτυο και να κάνετε λήψη του αρχείου\\n- Επιλέξτε το 'Όχι' αν θέλετε να αντιγράψετε με μη αυτόματο τρόπο το αρχείο στο δίσκο αργότερα.\\n\\nΣημείωση: Η λήψη του νέου αρχείου θα γίνει στον τρέχοντα κατάλογο και εφόσον το '%s' υπάρχει εκεί, θα επαναχρησιμοποιηθεί αυτόματα.\"\r\nt MSG_105 \"Η ακύρωση μπορεί να αφήσει τη συσκευή σε κατάσταση όπου δεν μπορεί να χρησιμοποιηθεί.\\nΕάν είστε σίγουροι ότι θέλετε να χρησιμοποιήσετε την ακύρωση, κάντε κλικ στο 'Ναι'. Διαφορετικά, κάντε κλικ στο 'Όχι'.\"\r\nt MSG_106 \"Παρακαλώ επιλέξτε φάκελο\"\r\nt MSG_107 \"Όλα τα αρχεία\"\r\nt MSG_108 \"Αρχείο καταγραφής Rufus\"\r\nt MSG_109 \"0x%02X (Δίσκος %d)\"\r\nt MSG_110 \"Το MS-DOS δεν μπορεί να κάνει εκκίνηση από ένα δίσκο χρησιμοποιώντας μέγεθος συμπλέγματος 64 kilobyte.\\nΠαρακαλώ αλλάξτε το μέγεθος συμπλέγματος ή χρησιμοποιήστε το FreeDOS.\"\r\nt MSG_111 \"Μη συμβατό μέγεθος συμπλέγματος\"\r\nt MSG_112 \"Η διαμόρφωση μεγάλων τόμων UDF ίσως διαρκέσει αρκετά. Ο χρόνος διαμόρφωσης, στις ταχύτητες του USB 2.0 είναι %d:%02d. Κατά την διάρκεια της διαμόρφωσης η μπάρα προόδου θα είναι στατική. Παρακαλώ περιμένετε!\"\r\nt MSG_113 \"Mεγάλος τόμος UDF\"\r\nt MSG_114 \"Αυτό το αρχείο χρησιμοποιεί το Syslinux %s%s παρόλα αυτά η εφαρμογή(Rufus) εμπεριέχει μόνο τα αρχεία εγκατάστασης του Syslinux %s%s.\\n\\n Εφόσον οι νέες εκδόσεις του Syslinux δεν είναι συμβατές μεταξύ τους, δεν είναι δυνατό για το Rufus να τις εμπεριέχει όλες. Επομένως, απαιτείται η λήψη δύο νέων αρχείων απο το διαδίκτυο ('ldlinux.sys' και 'ldlinux.bss'): \\n- Επιλέξτε το 'Ναι' για να συνδεθείτε στο διαδίκτυο και να κάνετε λήψη των αρχείων\\n- Επιλέξτε το 'Όχι' για να ακυρώσετε τη λειτουργία.\\nΣημείωση: Η λήψη των νέων αρχείων θα γίνει στον τρέχοντα κατάλογο και εφόσον τα αρχεία υπάρχουν εκεί, θα επαναχρησιμοποιηθούν αυτόματα.\"\r\nt MSG_115 \"Απαιτείται λήψη\"\r\nt MSG_116 \"Αυτό το αρχείο χρησιμοποιεί το Grub %s παρόλα αυτά η εφαρμογή(Rufus) εμπεριέχει μόνο τα αρχεία εγκατάστασης του Grub %s.\\n\\n Εφόσον οι διαφορετικές εκδόσεις του Grub δεν είναι συμβατές μεταξύ τους, δεν είναι δυνατό για το Rufus να τις εμπεριέχει όλες. Επομένως, το Rufus θα επιχειρήσει να κάνει λήψη μιας έκδοσης του Grub ('core.img') που είναι συμβατή με το αρχείο σας:\\n- Επιλέξτε το 'Ναι' για να συνδεθείτε στο διαδίκτυο και να κάνετε λήψη του αρχείου\\n- Επιλέξτε το 'Όχι' για να ακυρώσετε τη λειτουργία.\\nΣημείωση: Η λήψη των νέων αρχείων θα γίνει στον τρέχοντα κατάλογο και εφόσον τα αρχεία υπάρχουν εκεί, θα επαναχρησιμοποιηθούν αυτόματα. Εάν δε βρεθεί κάποιο συμβατό αρχείο τότε η προεπιλεγμένη έκδοση θα χρησιμοποιηθεί.\"\r\nt MSG_117 \"Προσαρμοσμένη εγκατάσταση για Windows\"\r\nt MSG_118 \"Windows To Go (USB με δυνατότητα εκκίνησης)\"\r\nt MSG_119 \"επιλογές δίσκου για προχωρημένους\"\r\nt MSG_120 \"προηγμένες επιλογές διαμόρφωσης\"\r\nt MSG_121 \"Εμφάνιση %s\"\r\nt MSG_122 \"Απόκρυψη %s\"\r\nt MSG_123 \"Μέγεθος μόνιμου διαμερίσματος\"\r\nt MSG_124 \"Ανενεργό\"\r\nt MSG_125 \"Ορίστε το μέγεθος του μόνιμου διαμερίσματος για USB με δυνατότητα εκκίνησης. Η ρύθμιση του μεγέθους σε 0 απενεργοποιεί το μόνιμο διαμέρισμα.\"\r\nt MSG_126 \"Ορίστε τις μονάδες μεγέθους διαμερίσματος.\"\r\nt MSG_127 \"Μην ξαναδείξεις αυτό το μήνυμα\"\r\nt MSG_128 \"Σημαντική ειδοποίηση για το %s\"\r\nt MSG_129 \"Μόλις δημιουργήσατε ένα μέσο που χρησιμοποιεί το bootloader UEFI:NTFS. Σας παρακαλούμε να θυμάστε ότι, για να εκκινήσετε αυτά τα μέσα, πρέπει να απενεργοποιήσετε την ασφαλή εκκίνηση.\\nΓια λεπτομέρειες σχετικά με το γιατί αυτό είναι απαραίτητο, ανατρέξτε στο κουμπί \\\"Περισσότερες πληροφορίες\\\" παρακάτω.\"\r\nt MSG_130 \"Επιλογή αρχείου Windows\"\r\nt MSG_131 \"Αυτό το ISO περιέχει πολλά ειδώλια των Windows.\\nΕπιλέξτε το αρχειο που θέλετε να χρησιμοποιήσετε για αυτήν την εγκατάσταση:\"\r\nt MSG_132 \"Ένα άλλο πρόγραμμα ή διαδικασία έχει πρόσβαση σε αυτήν τη μονάδα δίσκου. Θέλετε να το διαμορφώσετε ούτως ή άλλως;\"\r\nt MSG_133 \"Το Rufus έχει εντοπίσει ότι προσπαθείτε να δημιουργήσετε ένα μέσο Windows To Go βάσει ενός ISO 1809.\\n\\nΛόγω ενός * MICROSOFT BUG *, αυτό το μέσο θα καταρρεύσει κατά την εκκίνηση των Windows (Blue Screen Of Death), εκτός αν αλλάξετε με το χέρι το αρχείο 'WppRecorder.sys' με εκδοχή 1803.\\n\\nΕπίσης, σημειώστε ότι ο λόγος για τον οποίο ο Rufus δεν μπορεί να διορθώσει αυτόματα αυτό για εσάς είναι ότι το \\\"WppRecorder.sys\\\" είναι αρχείο Microsoft που προστατεύεται από πνευματικά δικαιώματα, επομένως δεν μπορούμε να ενσωματώσουμε νόμιμα ένα αντίγραφο του αρχείου στην εφαρμογή ...\"\r\nt MSG_134 \"Επειδή το MBR έχει επιλεγεί για το σχήμα διαμέρισης, ο Rufus μπορεί να δημιουργήσει ένα διαμέρισμα έως 2 TB μόνο σε αυτό το μέσο, το οποίο θα αφήσει το %s χώρου στο δίσκο μη διαθέσιμο.\\n\\nΕίστε σίγουροι οτι θέλετε να συνεχίσετε?\"\r\nt MSG_135 \"Εκδοχή\"\r\nt MSG_136 \"Κυκλοφορία\"\r\nt MSG_137 \"Έκδοση\"\r\nt MSG_138 \"Γλώσσα\"\r\nt MSG_139 \"Αρχιτακτονική\"\r\nt MSG_140 \"Συνέχεια\"\r\nt MSG_141 \"Πίσω\"\r\nt MSG_142 \"Παρακαλώ περιμένετε...\"\r\nt MSG_143 \"Λήψη με τη χρήση περιηγητή\"\r\nt MSG_144 \"Η λήψη των ISO των Windows δεν είναι διαθέσιμη επειδή η Microsoft έχει τροποποιήσει τον ιστότοπό της για να την αποτρέψει.\"\r\nt MSG_145 \"Το PowerShell 3.0 ή νεότερη έκδοση απαιτείται για να εκτελέσετε αυτήν τη δέσμη ενεργειών.\"\r\nt MSG_146 \"Θέλετε να συνδεθείτε στο διαδίκτυο και να το κατεβάσετε;\"\r\nt MSG_148 \"Εκτελείται ληφθέν αρχείο...\"\r\nt MSG_149 \"Λήψη αρχείου ISO\"\r\nt MSG_150 \"Επιλέξτε τον τύπο του υπολογιστή που θα χρησιμοποιήσετε μετά, για την εγκατάσταση του περιεχομένου του δίσκου με δυνατότητα εκκίνησης. Είναι δική σας αρμοδιότητα να γνωρίζετε άν θέλετε να προβείτε σε εγκατάσταση BIOS ή UEFI, ειδάλλως θα αποτύχει η εκκίνηση.\"\r\nt MSG_151 \"Άν επιλέξετε 'UEFI-CSM' η συσκευή θα μιμηθεί την εκκίνηση για BIOS εντός UEFI (όχι native)\"\r\nt MSG_152 \"Άν επιλέξετε 'εκτός από CSM' η συσκευή θα τρέχει μόνο σε UEFI συστήματα (native)\"\r\nt MSG_153 \"Μοτίβο δοκιμής: 0x%02X\"\r\nt MSG_154 \"Μοτίβο δοκιμής: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Μοτίβο δοκιμής: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Μοτίβο δοκιμής: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Ρυθμίζει το επιθυμητό σύστημα αρχείων\"\r\nt MSG_158 \"Το ελάχιστο μέγεθος που κάθε κομμάτι δεδομένων(data block) θα καταλάβει στο σύστημα αρχείων\"\r\nt MSG_159 \"Χρησιμοποιήστε αυτό το πεδίο για να ορίσετε την ετικέτα της μονάδας δίσκου.\\nΓίνονται δεκτοί διεθνείς χαρακτήρες.\"\r\nt MSG_160 \"Εμφάνιση επιλογών για προχωρημένους\"\r\nt MSG_161 \"Ελέγξτε τη συσκευή για κατεστραμμένους τομείς χρησιμοποιώντας το μοτίβο δοκιμής\"\r\nt MSG_162 \"Αποεπιλέξτε αυτό το πλαίσιο για να χρησιμοποιήσετε την \\\"αργή\\\" μέθοδο διαμόρφωσης\"\r\nt MSG_163 \"Επιλογή μεθόδου για την δημιουργία διαμερισμών δίσκου\"\r\nt MSG_164 \"Η μέθοδος που θα χρησιμοποιηθεί για να δημιουργηθεί ο δίσκος με δυνατότητα εκκίνησης\"\r\nt MSG_165 \"Κάντε κλικ για να επιλέξετε ή να κατεβάσετε ένα αρχείο...\"\r\nt MSG_166 \"Επιλέξτε αυτό το πλαίσιο για να επιτραπεί η εμφάνιση των διεθνών ετικετών και ο ορισμός ενός εικονιδίου συσκευής (δημιουργείτε ένα autorun.inf)\"\r\nt MSG_167 \"Εγκαταστήστε UEFI bootloader, ο οποίος θα εκτελέσει την επικύρωση του αρχείου MD5Sum των μέσων\"\r\nt MSG_169 \"Δημιουργία ενός επιπλέον κρυφού διαμερίσματος και προσπάθεια ευθυγράμμισης των ορίων των διαμερισμάτων.\\nΜπορεί να βελτιώσει την ανίχνευση εκκίνησης για παλαιότερα BIOS.\"\r\nt MSG_170 \"Ενεργοποίηση της εμφάνισης σκληρών δίσκων USB. Η χρήση γίνεται με δική σας ευθύνη!!!\"\r\nt MSG_171 \"Εκκίνηση της λειτουργίας διαμόρφωσης.\\nΗ λειτουργία θα διαγράψει όλα τα υπάρχοντα δεδομένα από την επιλεγμένη συσκευή!\"\r\nt MSG_172 \"Η υπογραφή του αρχείου λήψης δεν είναι έγκυρη\"\r\nt MSG_173 \"Κάντε κλικ για επιλογή...\"\r\nt MSG_174 \"Rufus - Μία αξιόπιστη εφαρμογή διαμόρφωσης USB\"\r\nt MSG_175 \"Εκδοχή %d.%d (Build %d)\"\r\nt MSG_176 \"Μετάφραση στα ελληνικά:\\\\line• Konstantinos Margaritis <mailto:kotsos.marga@gmail.com>\\\\line• Nikolaos Margaritis <mailto:marga.nikos@gmail.com>\\\\line• Alex F. <mailto:alirael@outlook.com>\\\\line• Christos Alvanos <mailto:chrisalvanos17@gmail.com>\"\r\nt MSG_177 \"Για αναφορά σφαλμάτων ή βελτιώσεων επισκεφθείτε το:\"\r\nt MSG_178 \"Επιπλέον Πνευματικά δικαιώματα:\"\r\nt MSG_179 \"Πολιτική ενημέρωσης:\"\r\nt MSG_180 \"Εάν επιλέξετε να επιτρέψετε στο πρόγραμμα να ελέγχει για ενημερώσεις, συμφωνείτε ότι οι ακόλουθες πληροφορίες μπορεί να συλλεχθούν στους διακομιστές μας:\"\r\nt MSG_181 \"Η αρχιτεκτονική και η εκδοχή του λειτουργικού σας συστήματος\"\r\nt MSG_182 \"Η εκδοχή της εφαρμογής που χρησιμοποιείτε\"\r\nt MSG_183 \"Η διεύθυνση διαδικτυακού πρωτοκόλλου(IP) σας\"\r\nt MSG_184 \"Όλες αυτές οι πληροφορίες συλλέγονται με σκοπό τη δημιουργία ιδιωτικών στατιστικών χρήσης και μπορεί να παραμείνουν αποθηκευμένες \\\\b το μέγιστο για ένα χρόνο\\\\b0 . Ωστόσο, σε καμία περίπτωση δεν θα αποκαλύψουμε οποιαδήποτε από αυτά τα ατομικά σας στοιχεία σε τρίτους.\"\r\nt MSG_185 \"Διαδικασία ενημέρωσης:\"\r\nt MSG_186 \"Το Rufus δεν εγκαθιστά και δεν εκτελεί υπηρεσίες στο παρασκήνιο, ως εκ τούτου οι έλεγχοι ενημέρωσης εκτελούνται μόνο όταν η κύρια εφαρμογή εκτελείται.\\\\line\\nΑπαιτείται σύνδεση στο διαδίκτυο για να ελέγξετε για ενημερώσεις.\"\r\nt MSG_187 \"Μη έγκυρο είδωλο για τρέχων επιλογή εκκίνησης\"\r\nt MSG_188 \"Το είδωλο δεν ταιριάζει με την τρέχων επιλογή εκκινησης. Παρακαλώ χρησιμοποιήστε κάποιο άλλο είδωλο ή διαφορετική επιλογή εκκίνησης.\"\r\nt MSG_189 \"Αυτό το είδωλο ISO δεν είναι συμβατό με το επιλεγμένο σύστημα αρχείων\"\r\nt MSG_190 \"Ανιχνεύθηκε μη συμβατός δίσκος\"\r\nt MSG_191 \"Πέρασμα εγγραφής\"\r\nt MSG_192 \"Πέρασμα ανάγνωσης\"\r\nt MSG_193 \"Έγινε λήψη του %s\"\r\nt MSG_194 \"Αποτυχία λήψης του %s\"\r\nt MSG_195 \"Γίνεται χρήση της ενσωματωμένης εκδοχή του/των %s αρχείου/ων\"\r\nt MSG_196 \"Σημαντικό: Αυτή η μονάδα δίσκου χρησιμοποιεί μη προσαρμοσμένο μέγεθος διαμερισμου!\\n\\nΟι συμβατικoί δίσκοι χρησιμοποιούν ένα μέγεθος τομέα 512 byte, αλλά αυτή η μονάδα χρησιμοποιεί %d-byte.Σε πολλές περιπτώσεις, αυτό σημαίνει ότι δεν θα είστε σε θέση να κάνετε εκκινήση από αυτό το δίσκο.\\nΤο Rufus θα προσπαθήσει να δημιουργήσει ένα δίσκο με δυνατότητα εκκίνησης, παρόλα αυτά δεν υπάρχει καμία εγγύηση ότι αυτός θα λειτουργήσει.\"\r\nt MSG_197 \"Ανιχνεύθηκε μη προσαρμοσμένο μέγεθος διαμερισμου\"\r\nt MSG_198 \"Τα 'Windows To Go' μπορούν να εγκαταστηθούν μόνο σε δίσκους με διαμερισμό GPT εάν αυτοί διαθέτουν το χαρακτηριστικό ΄ΣΤΑΘΕΡΟΣ'. Ο επιλεγμενος δίσκος δε διαθέτει αυτο το χαρακτηριστικό.\"\r\nt MSG_199 \"Αυτή η δυνατότητα δεν είναι διαθέσιμη σε αυτήν την πλατφόρμα.\"\r\nt MSG_201 \"Ακύρωση - Παρακαλώ περιμένετε...\"\r\nt MSG_202 \"Σάρωση ειδώλου...\"\r\nt MSG_203 \"Αποτυχία σάρωσης ειδώλου\"\r\nt MSG_204 \"Ανιχνεύθηκε ξεπερασμένο %s\"\r\nt MSG_205 \"Είδωλο σε χρήση: %s\"\r\nt MSG_206 \"Το αρχείο %s λείπει\"\r\nt MSG_207 \"Νέος Τόμος\"\r\nt MSG_208 \"Βρέθηκε %d συσκευή\"\r\nt MSG_209 \"Βρέθηκαν %d συσκευές\"\r\nt MSG_210 \"Έτοιμο για χρήση\"\r\nt MSG_211 \"Ακυρώθηκε\"\r\nt MSG_212 \"Απέτυχε\"\r\nt MSG_213 \"Εκκίνηση νέας εφαρμογής...\"\r\nt MSG_214 \"Αποτυχία εκκίνησης νέας εφαρμογής\"\r\nt MSG_215 \"Άνοιγμα %s\"\r\nt MSG_216 \"Αποθήκευση %s\"\r\nt MSG_217 \"Διαμόρφωση: %s\"\r\nt MSG_218 \"Δημιουργία συστήματος αρχείων: Βήμα %d/%d ολοκληρώθηκε\"\r\nt MSG_219 \"Επιδιόρθωση NTFS: %d%% ολοκληρώθηκε\"\r\nt MSG_220 \"Γίνεται Διαμόρφωση(%s) - εκτιμώμενη διάρκεια %d:%02d...\"\r\nt MSG_221 \"Ορισμός ετικέτας (%s)...\"\r\nt MSG_222 \"Διαμόρφωση (%s)...\"\r\nt MSG_223 \"Επιδιόρθωση NTFS (Checkdisk)...\"\r\nt MSG_224 \"Εκκαθάριση δομών MBR/PBR/GPT...\"\r\nt MSG_225 \"Ζητείται πρόσβαση στο δίσκο...\"\r\nt MSG_226 \"Αναλύοντας τα υπάρχοντα αρχεία εκκίνησης...\"\r\nt MSG_227 \"Κλείσιμο υπάρχοντος τόμου...\"\r\nt MSG_228 \"Εγγραφή Master Boot Record...\"\r\nt MSG_229 \"Εγγραφή διαμερίσματος εκκίνησης...\"\r\nt MSG_230 \"Αντιγραφή αρχείων DOS...\"\r\nt MSG_231 \"Αντιγραφή αρχείων ISO: %s\"\r\nt MSG_232 \"Ρυθμίσεις εκκίνησης Win7 EFI (%s)...\"\r\nt MSG_233 \"Οριστικοποίηση, παρακαλώ περιμένετε...\"\r\nt MSG_234 \"Εγκατάσταση Syslinux %s...\"\r\nt MSG_235 \"Κατεστραμμένοι τομείς: %s %d/%d - %0.2f%% (%d/%d/%d σφάλματα)\"\r\nt MSG_236 \"Κατεστραμμένοι τομείς: Έλεγχος με τυχαίο διάταξη\"\r\nt MSG_237 \"Κατεστραμμένοι τομείς: Έλεγχος με διάταξη 0x%02X\"\r\nt MSG_238 \"Διαμερισμός (%s)...\"\r\nt MSG_239 \"Διαγραφή διαμερισμάτων (%s)...\"\r\nt MSG_240 \"Δεν είναι δυνατή η επικύρωση της υπογραφής του αρχείου λήψης. Αυτό μπορεί να σημαίνει ότι το σύστημά σας έχει ρυθμιστεί εσφαλμένα για την επικύρωση υπογραφής αρχείων λήψης ή υποδεικνύει ένα κακόβουλο αρχείο.\\n\\nΤο αρχείο λήψης θα διαγραφεί. Παρακαλώ ελέγξτε το αρχείο καταγραφής για περισσότερες λεπτομέρειες.\"\r\nt MSG_241 \"Γίνετε λήψη: %s\"\r\nt MSG_242 \"Η λήψη του αρχείου απέτυχε.\"\r\nt MSG_243 \"Έλεγχος για ενημερώσεις του Rufus...\"\r\nt MSG_244 \"Ενημερώσεις: Δεν ήταν δυνατή η σύνδεση στο διαδίκτυο\"\r\nt MSG_245 \"Ενημερώσεις: Δεν είναι δυνατή η πρόσβαση στα δεδομένα της έκδοσης\"\r\nt MSG_246 \"Μια νέα έκδοση του Rufus είναι διαθέσιμη!\"\r\nt MSG_247 \"Δεν βρέθηκε κάποια νέα έκδοση του Rufus\"\r\nt MSG_248 \"Τα κλειδιά μητρώου της εφαρμογής διαγράφηκαν με επιτυχία\"\r\nt MSG_249 \"Αποτυχία διαγραφής των κλειδιών μητρώου της εφαρμογής\"\r\nt MSG_250 \"%s :ενεργό/η\"\r\nt MSG_251 \"%s :ανενεργό/η\"\r\nt MSG_252 \"Έλεγχος μεγέθους\"\r\nt MSG_253 \"Ανίχνευση κρυφών σκληρών δίσκων\"\r\nt MSG_254 \"Εξαναγκασμένη διαμόρφωση FAT32\"\r\nt MSG_255 \"Το NoDriveTypeAutorun θα διαγραφεί κατά την έξοδο από την εφαρμογή\"\r\nt MSG_256 \"Ανίχνευση ψεύτικης μονάδας δίσκου\"\r\nt MSG_257 \"Υποστήριξη Joliet\"\r\nt MSG_258 \"Υποστήριξη Rock Ridge\"\r\nt MSG_259 \"Εξαναγκασμένη ενημέρωση\"\r\nt MSG_260 \"Συμπίεση NTFS\"\r\nt MSG_261 \"Εγγραφή ειδώλου: %s\"\r\nt MSG_262 \"Υποστήριξη ειδώλου ISO\"\r\nt MSG_263 \"Χρησιμοποιήστε ΣΩΣΤΑ μεγέθοι μονάδων\"\r\nt MSG_264 \"Διαγραφή καταλόγου '%s'\"\r\nt MSG_265 \"Ανίχνευση δίσκου VMWare\"\r\nt MSG_266 \"Λειτουργία UEFI και BIOS (ταυτόχρονα)\"\r\nt MSG_267 \"Εγγραφή ειδώλου Windows: %s\"\r\nt MSG_268 \"Εγγραφή ειδώλου Windows...\"\r\nt MSG_269 \"Διατήρηση ημερομηνιών αρχείων\"\r\nt MSG_270 \"Έλεγχος USB\"\r\nt MSG_271 \"Υπολογισμός checksums ειδώλου: %s\"\r\nt MSG_272 \"Υπολογισμός checksums MD5, SHA1 και SHA256 για το επιλεγμένο είδωλο\"\r\nt MSG_273 \"Αλλαγή γλώσσας\"\r\nt MSG_274 \"Ανιχνεύθηκε είδωλο τύπου %s\"\r\nt MSG_275 \"Το είδωλο που χρησιμοποιήσατε είναι τύπου 'ISOHybrid'. Αυτό σημαίνει πως μπορεί να εγγραφεί ως %s ή ως %s.\\nΤο Rufus συνιστά να κάνετε την εγγραφή ώς %s, για να μπορείτε να έχετε πλήρη πρόσβαση στο δίσκο μετα την εγγραφή.\\nΣε περίπτωση που αντιμετωπίσετε πρόβλημα κατά την εκκίνηση του είδώλου μπορείτε να ξανακάνετε την εγγραφή ως %s.\\n\\nΠαρακαλώ επιλέξτε τον τρόπο με τον οποίο θέλετε να κάνετε την εγγραφή του ειδώλου:\"\r\nt MSG_276 \"Εγγραφή ως %s (Προτεινόμενο)\"\r\nt MSG_277 \"Εγγραφή ως %s\"\r\nt MSG_278 \"Γίνεται έλεγχος για αντικρουόμενες διαδικασίες...\"\r\nt MSG_279 \"Δεν διαθέτει δυνατότητα εκκίνησης\"\r\nt MSG_280 \"Επιλογή δίσκου ή ειδώλου ISO\"\r\nt MSG_281 \"%s (Παρακαλώ Επιλέξτε)\"\r\nt MSG_282 \"Κλείδωμα μονάδας USB\"\r\nt MSG_283 \"Μη έγκυρη ψηφιακή υπογραφή\"\r\nt MSG_284 \"Το εκτελέσιμο αρχείο που κατεβάσατε δεν περιλαμβάνει ψηφιακή υπογραφή.\"\r\nt MSG_285 \"Το εκτελέσιμο αρχείο που κατεβάσατε έχει υπογραφτεί από τον/την '%s'.\\nΑύτη η υπογραφή δεν αναγνωρίζεται από το Rufus. Ενδεχομένως να υπάρχει συσχέτιση με κάποια κακόβουλη προσπάθεια...\\nΕίστε σίγουροι ότι θέλετε να εκτελέσετε αυτό το αρχείο?\"\r\nt MSG_286 \"Άδειασμα δίσκου: %s\"\r\nt MSG_287 \"Ανίχνευση μη αφαιρούμενων δίσκων USB\"\r\nt MSG_288 \"Δεν διαθέτετε δικαιώματα διαχειριστή\"\r\nt MSG_289 \"Η εφαρμογή απαιτεί δικαιώματα διαχειριστή για να λειτουργήσει\"\r\nt MSG_290 \"Φόρτωση στοιχείων αρχείου\"\r\nt MSG_291 \"Επιλέξτε εκδοχή\"\r\nt MSG_292 \"Παρακαλώ επιλέξτε την εκδοχή των Windows που θέλετε να εγκαταστήσετε:\"\r\nt MSG_293 \"Μη υποστηριζόμενη εκδοχή Windows\"\r\nt MSG_294 \"Το Rufus δεν υποστηρίζει αυτή την εκδοχή των Windows.\\nΗ τελευταία έκδοση του Rufus που είναι συμβατή με αυτήν την πλατφόρμα είναι η v%d.%d.\"\r\nt MSG_295 \"Προσοχή: Ανεπίσημη εκδοχή\"\r\nt MSG_296 \"Αυτή η έκδοση του Rufus δεν έχει δημιουργηθεί απο τους επίσημους προγραμματιστές.\\n\\n Είστε σίγουροι οτι θέλετε να εκτελέσετε το πρόγραμμα?\"\r\nt MSG_297 \"Το αρχείο ISO δεν είναι έγκυρο/ολόκληρο\"\r\nt MSG_298 \"Το αρχείο ISO που επιλέξατε δεν ειναι έγκυρο/ολόκληρο. %s από τα δεδομένα του αρχείου λείπουν.\\n\\nΆν κατεβάσατε αυτό το αρχείο απο το διαδίκτυο, προσπαθήστε να επαναλάβετε την λήψη του αρχείου. Βεβαιωθείτε ότι οι MD5 ή SHA σφραγίδες του αρχείου που κατεβάσατε είναι ίδιες με αυτες του αρχειου που θέλατε να κατεβάσετε.\\n\\nΜπορείτε να ελέγξετε τις σφραγίδες MD5 ή SHA μέσω του Rufus πατώντας το κουμπί (✓).\"\r\nt MSG_299 \"Σφάλμα επικύρωσης χρόνου (timestamp)\"\r\nt MSG_300 \"Το Rufus δεν κατάφερε να διαβεβαιώσει ότι η έκδοση αναβάθμισης έχει εκδωθεί σε νεώτερη ημερομηνία απο την έκδοση που έχετε ήδη.\\n\\nΓια λόγους ασφαλείας η εγκατάσταση έχει ακυρωθεί και η έκδοση που κατεβάσατε θα διαγραφεί. Για περισσότερες πληροφορίες, ελέγξτε το αρχείο καταγραφής.\"\r\nt MSG_301 \"Εμφάνιση ρυθμίσεων εφαρμογής\"\r\nt MSG_302 \"Εμφάνιση πληροφοριών εφαρφογής\"\r\nt MSG_303 \"Εμφάνιση καταγραφών εφαρμογής (log)\"\r\nt MSG_304 \"Δημιουργία ειδώλου δίσκου από την επιλεγμένη συσκευή\"\r\nt MSG_305 \"Χρησιμοποιήστε αυτήν την επιλογή εάν σκοπεύετε να εγκαταστήσετε τα Windows σε διαφορετικό δίσκο ή εάν θέλετε να εκτελέσετε τα Windows απευθείας από αυτήν τη μονάδα δίσκου (Windows To Go).\"\r\nt MSG_306 \"Γρήγορος μηδενισμός μονάδας δίσκου: %s\"\r\nt MSG_307 \"η διαδικασία ίσως διαρκέσει αρκετά\"\r\nt MSG_308 \"Εντοπισμός VHD\"\r\nt MSG_309 \"Συμπιεσμένο αρχείο\"\r\nt MSG_310 \"Το ISO που επιλέξατε χρησιμοποιεί UEFI και είναι αρκετά μικρό ώστε να γραφτεί ως διαμέρισμα συστήματος EFI (ESP). Η εγγραφή σε ένα ESP, αντί της εγγραφής σε ένα διαμέρισμα γενικών δεδομένων που καταλαμβάνει ολόκληρο τον δίσκο, μπορεί να είναι προτιμότερο για ορισμένους τύπους εγκαταστάσεων.\\n\\nΠαρακαλούμε επιλέξτε τη λειτουργία που θέλετε να χρησιμοποιήσετε για να γράψετε αυτή την εικόνα:\"\r\nt MSG_311 \"Χρησιμοποιήστε %s (στο κύριο παράθυρο της εφαρμογής) για ενεργοποίηση.\"\r\nt MSG_312 \"Επιπλέον hashes (SHA512)\"\r\nt MSG_313 \"Αποθήκευση σε VHD\"\r\nt MSG_314 \"Υπολογίστε αθροίσματα ελέγχου εικόνας\"\r\nt MSG_315 \"Πολλαπλά κουμπιά\"\r\nt MSG_316 \"Αριθμός περασμάτων\"\r\nt MSG_317 \"ID δίσκου\"\r\nt MSG_318 \"Προεπιλεγμένη προτεραιότητα πυρήνα %d\"\r\nt MSG_319 \"Αγνοήστε τον Boot marker\"\r\nt MSG_320 \"Ανανέωση διάταξης διαμερισμάτων (%s)...\"\r\nt MSG_321 \"Η εικόνα που επιλέξατε είναι ISOHybrid, αλλά οι δημιουργοί της δεν την έχουν κάνει συμβατή με τη λειτουργία αντιγραφής ISO/Αρχείου.\\nΩς αποτέλεσμα, θα επιβληθεί η λειτουργία εγγραφής εικόνας DD.\"\r\nt MSG_322 \"Δεν είναι δυνατό το άνοιγμα ή η ανάγνωση του '%s'\"\r\nt MSG_325 \"Εφαρμογή προσαρμογής των Windows: %s\"\r\nt MSG_326 \"Εφαρμογή επιλογών χρήστη...\"\r\nt MSG_327 \"Εμπειρία χρήστη των Windows\"\r\nt MSG_328 \"Προσαρμογή εγκατάστασης των Windows;\"\r\nt MSG_329 \"Κατάργηση απαίτησης για 4 GB+ RAM, Ασφαλής εκκίνηση και TPM 2.0\"\r\nt MSG_330 \"Καταργήστε την απαίτηση για έναν ηλεκτρονικό λογαριασμό Microsoft\"\r\nt MSG_331 \"Απενεργοποίηση συλλογής δεδομένων (Παράβλεψη ερωτήσεων απορρήτου)\"\r\nt MSG_332 \"Αποτρέψτε την πρόσβαση των Windows To Go σε εσωτερικούς δίσκους\"\r\nt MSG_333 \"Δημιουργήστε έναν τοπικό λογαριασμό με όνομα χρήστη:\"\r\nt MSG_334 \"Ορίστε τις τοπικές επιλογές στις ίδιες τιμές με αυτές του χρήστη\"\r\nt MSG_335 \"Απενεργοποιήστε την αυτόματη κρυπτογράφηση συσκευής BitLocker\"\r\nt MSG_336 \"Διατήρηση log\"\r\nt MSG_337 \"Πρέπει να κάνετε λήψη ενός επιπλέον αρχείου ('%s') από τη Microsoft για να χρησιμοποιήσετε αυτήν τη λειτουργία:\\n- Επιλέξτε 'Ναι' για να συνδεθείτε στο Internet και να το κατεβάσετε\\n- Επιλέξτε 'Όχι' για να ακυρώσετε τη λειτουργία\\n\\nΣημείωση: Το αρχείο θα ληφθεί στον κατάλογο της εφαρμογής και θα επαναχρησιμοποιηθεί αυτόματα εάν υπάρχει.\"\r\nt MSG_338 \"Εντοπίστηκε ανακληθέν bootloader UEFI\"\r\nt MSG_339 \"Ο Rufus εντόπισε ότι το ISO που επιλέξατε περιέχει έναν bootloader UEFI που έχει ανακληθεί και θα παράγει %s, όταν η Ασφαλής Εκκίνηση είναι ενεργοποιημένη σε ένα πλήρως ενημερωμένο σύστημα UEFI.\\n\\n- Εάν λάβατε αυτήν την εικόνα ISO από μη αξιόπιστη πηγή, θα πρέπει να εξετάσετε το ενδεχόμενο να περιέχει κακόβουλο λογισμικό UEFI και να αποφύγετε την εκκίνηση από αυτό.\\n- Εάν το λάβατε από αξιόπιστη πηγή, θα πρέπει να προσπαθήσετε να εντοπίσετε μια πιο ενημερωμένη έκδοση, η οποία δεν θα παράγει αυτήν την προειδοποίηση.\"\r\nt MSG_340 \"μια οθόνη \\\"Παραβίαση ασφαλείας\\\"\"\r\nt MSG_341 \"μια οθόνη αποκατάστασης των Windows (BSOD) με '%s'\"\r\nt MSG_342 \"Συμπιεσμένη εικόνα VHDX\"\r\nt MSG_343 \"Μη συμπιεσμένη εικόνα VHDX\"\r\nt MSG_345 \"Ορισμένα πρόσθετα δεδομένα πρέπει να ληφθούν από τη Microsoft για να χρησιμοποιήσετε αυτήν τη λειτουργία:\\n- Επιλέξτε 'Ναι' για να συνδεθείτε στο Internet και να τα κατεβάσετε\\n- Επιλέξτε 'Όχι' για να ακυρώσετε τη λειτουργία\"\r\nt MSG_346 \"Περιορισμός των Windows σε S-Mode (ΑΣΥΜΒΑΤΟ με ηλεκτρονική παράκαμψη λογαριασμού)\"\r\nt MSG_347 \"Λειτουργία ειδικού\"\r\nt MSG_348 \"Εξαγωγή αρχείων: %s\"\r\nt MSG_349 \"Χρησιμοποίηση του Rufus MBR\"\r\nt MSG_900 \"Το Rufus είναι ένα βοηθητικό πρόγραμμα που βοηθά στη διαμόρφωση και τη δημιουργία μονάδων flash USB με δυνατότητα εκκίνησης, όπως κλειδιά USB/pendrives,κάρτες μνήμης κ.λπ.\"\r\nt MSG_901 \"Επίσημος ιστότοπος: %s\"\r\nt MSG_902 \"Πηγαίος κώδικας: %s\"\r\nt MSG_903 \"Αρχείο καταγραφής αλλαγών: %s\"\r\nt MSG_904 \"Αυτή η εφαρμογή έχει άδεια χρήσης σύμφωνα με τους όρους της GNU Public License (GPL) έκδοση 3.\\nΔείτε https://www.gnu.org/licenses/gpl-3.0.html για λεπτομέρειες.\"\r\nt MSG_910 \"Μορφοποίηση USB, κάρτας flash και εικονικών μονάδων δίσκου σε FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Δημιουργήστε μονάδες USB με δυνατότητα εκκίνησης FreeDOS\"\r\nt MSG_912 \"Δημιουργήστε εκκινήσιμες μονάδες από ISO με δυνατότητα εκκίνησης (Windows, Linux, κ.λπ.)\"\r\nt MSG_913 \"Δημιουργήστε μονάδες εκκίνησης από εικόνες δίσκου με δυνατότητα εκκίνησης, συμπεριλαμβανομένων συμπιεσμένων\"\r\nt MSG_914 \"Δημιουργήστε μονάδες δίσκου με δυνατότητα εκκίνησης BIOS ή UEFI, συμπεριλαμβανομένων NTFS με δυνατότητα εκκίνησης UEFI\"\r\nt MSG_915 \"Δημιουργήστε μονάδες δίσκου \\\"Windows To Go\\\"\"\r\nt MSG_916 \"Δημιουργήστε μονάδες εγκατάστασης των Windows 11 για υπολογιστές που δεν διαθέτουν TPM ή Ασφαλή Εκκίνηση\"\r\nt MSG_917 \"Δημιουργήστε μόνιμα διαμερίσματα Linux\"\r\nt MSG_918 \"Δημιουργήστε εικόνες VHD/DD της επιλεγμένης μονάδας δίσκου\"\r\nt MSG_919 \"Υπολογίστε τα αθροίσματα ελέγχου MD5, SHA-1, SHA-256 και SHA-512 της επιλεγμένης εικόνας\"\r\nt MSG_920 \"Εκτελέστε ελέγχους εσφαλμένων block, συμπεριλαμβανομένου του εντοπισμού \\\"ψευδών\\\" μονάδων flash\"\r\nt MSG_921 \"Κατεβάστε τα επίσημα retail ISO των Microsoft Windows\"\r\nt MSG_922 \"Κατεβάστε τα ISO Shell UEFI\"\r\n\r\n#########################################################################\r\nl \"he-IL\" \"Hebrew (עברית)\" 0x040d\r\nv 4.5\r\nb \"en-US\"\r\na \"r\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"על אודות Rufus\"\r\nt IDC_ABOUT_LICENSE \"רישיון\"\r\nt IDOK \"אישור\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"מאפייני הכונן\"\r\nt IDS_DEVICE_TXT \"התקן\"\r\nt IDS_BOOT_SELECTION_TXT \"בחירת האתחול\"\r\nt IDC_SELECT \"בחירה\"\r\nt IDS_IMAGE_OPTION_TXT \"אפשרות קובץ תמונה\"\r\nt IDS_PARTITION_TYPE_TXT \"סגנון המחיצות\"\r\nt IDS_TARGET_SYSTEM_TXT \"מערכת היעד\"\r\nt IDC_LIST_USB_HDD \"הצגת רשימה של כונני USB קשיחים\"\r\nt IDC_OLD_BIOS_FIXES \"הוספת תיקונים ל־BIOS־ים ישנים (מחיצה נוספת, יישור...)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"הפעלת אימות מדיה של UEFI בזמן ריצה\"\r\nt IDS_FORMAT_OPTIONS_TXT \"אפשרויות אתחול\"\r\nt IDS_FILE_SYSTEM_TXT \"מערכת הקבצים\"\r\nt IDS_CLUSTER_SIZE_TXT \"גודל האשכול\"\r\nt IDS_LABEL_TXT \"תווית שם אמצעי האחסון\"\r\nt IDC_QUICK_FORMAT \"אתחול מהיר\"\r\nt IDC_BAD_BLOCKS \"בדיקת ההתקן אחר אזורים פגומים\"\r\nt IDC_EXTENDED_LABEL \"יצירת תווית מורחבת וקובצי סמל\"\r\nt IDS_STATUS_TXT \"מצב\"\r\nt IDCANCEL \"סגירה\"\r\nt IDC_START \"התחלה\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"סגירה\"\r\nt IDD_LICENSE \"רישיון Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"סגירה\"\r\nt IDD_LOG \"יומן רישום\"\r\nt IDC_LOG_CLEAR \"ניקוי\"\r\nt IDC_LOG_SAVE \"שמירה\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"סגירה\"\r\nt IDD_NEW_VERSION \"חיפוש אחר עדכונים - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"גרסה חדשה זמינה להורדה. נא להוריד את הגרסה האחרונה!\"\r\nt IDC_WEBSITE \"נא ללחוץ כאן כדי לעבור לאתר הבית\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"הערות שחרור גרסה\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"הורדה\"\r\nt IDC_DOWNLOAD \"הורדה\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"מידע נוסף\"\r\nt IDYES \"כן\"\r\nt IDNO \"לא\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"סגירה\"\r\nt IDD_UPDATE_POLICY \"מדיניות העדכונים והגדרות\"\r\nt IDS_UPDATE_SETTINGS_GRP \"הגדרות\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"חיפוש אחר עדכונים\"\r\nt IDS_INCLUDE_BETAS_TXT \"כולל גרסאות בטא\"\r\nt IDC_CHECK_NOW \"לבדוק כעת\"\r\n\r\nt MSG_001 \"זוהתה הפעלה אחרת\"\r\nt MSG_002 \"חלון Rufus אחר פועל ברקע.\\nנא לסגור את היישום הראשון לפני הפעלת יישום נוסף.\"\r\nt MSG_003 \"אזהרה: כל הנתונים על ההתקן '%s' יושמדו.\\nכדי להמשיך בפעולה זו, יש ללחוץ על אישור. כדי לצאת יש ללחוץ על ביטול.\"\r\nt MSG_004 \"מדיניות העדכונים של Rufus\"\r\nt MSG_005 \"האם ברצונך לאפשר ל־Rufus לבדוק אחר עדכונים באינטרנט?\"\r\nt MSG_006 \"סגירה\"\r\nt MSG_007 \"ביטול\"\r\nt MSG_008 \"כן\"\r\nt MSG_009 \"לא\"\r\nt MSG_010 \"נמצאו אזורים פגומים\"\r\nt MSG_011 \"הבדיקה הושלמה: %d אזורים פגומים נמצאו\\n  %d שגיאות קריאה\\n  %d שגיאות כתיבה\\n  %d שגיאות השחתה\"\r\nt MSG_012 \"%s\\nניתן למצוא דוח מפורט יותר במיקום:\\n%s\"\r\nt MSG_013 \"מושבת\"\r\nt MSG_014 \"יומי\"\r\nt MSG_015 \"שבועי\"\r\nt MSG_016 \"חודשי\"\r\nt MSG_017 \"מותאם אישית\"\r\nt MSG_018 \"הגרסה שלך: %d.%d (בנייה %d)\"\r\nt MSG_019 \"הגרסה האחרונה: %d.%d (בנייה %d)\"\r\nt MSG_020 \"בתים\"\r\nt MSG_026 \"בתים\"\r\nt MSG_027 \"קילו בתים\"\r\nt MSG_028 \"מגה בתים\"\r\nt MSG_029 \"ברירת מחדל\"\r\nt MSG_030 \"%s (ברירת מחדל)\"\r\nt MSG_031 \"BIOS (או UEFI-CSM)\"\r\nt MSG_032 \"UEFI (שאינו CSM)\"\r\nt MSG_033 \"BIOS או UEFI\"\r\nt MSG_034 \"מעבר אחד\"\r\nt MSG_035 \"%d מעברים %s\"\r\nt MSG_036 \"קובץ ISO\"\r\nt MSG_037 \"יישום\"\r\nt MSG_038 \"ביטול\"\r\nt MSG_039 \"פתיחה\"\r\nt MSG_040 \"הורדה\"\r\nt MSG_041 \"הפעולה בוטלה על־ידי המשתמש\"\r\nt MSG_042 \"שגיאה\"\r\nt MSG_043 \"שגיאה: %s\"\r\nt MSG_044 \"הורדת קובץ\"\r\nt MSG_045 \"התקן אחסון USB (כללי)\"\r\nt MSG_046 \"%s (דיסק %d) [%s]\"\r\nt MSG_047 \"מחיצות מרובות\"\r\nt MSG_048 \"Rufus - מרוקן חוצצים\"\r\nt MSG_049 \"Rufus - ביטול\"\r\nt MSG_050 \"הצלחה.\"\r\nt MSG_051 \"שגיאה לא מזוהה במהלך האתחול.\"\r\nt MSG_052 \"לא ניתן להשתמש במערכת הקבצים שנבחרה עבור המדיה הזו.\"\r\nt MSG_053 \"הגישה להתקן נדחתה.\"\r\nt MSG_054 \"ההתקן מוגן מפני כתיבה.\"\r\nt MSG_055 \"ההתקן בשימוש על־ידי תהליך אחר. נא לסגור כל תהליך אחר שעשוי להשתמש בהתקן.\"\r\nt MSG_056 \"אתחול מהיר אינו זמין עבור התקן זה.\"\r\nt MSG_057 \"תווית השם של אמצעי האחסון אינה תקינה.\"\r\nt MSG_058 \"מזהה ההתקן (handle) אינו תקין.\"\r\nt MSG_059 \"גודל האשכול שנבחר אינו תקין להתקן זה.\"\r\nt MSG_060 \"גודל אמצעי האחסון אינו תקין.\"\r\nt MSG_061 \"נא להכניס מדיה נשלפת לכונן.\"\r\nt MSG_062 \"התקבלה פקודה שאינה נתמכת.\"\r\nt MSG_063 \"שגיאה בהקצאת זיכרון.\"\r\nt MSG_064 \"שגיאת קריאה.\"\r\nt MSG_065 \"שגיאת כתיבה.\"\r\nt MSG_066 \"שגיאת התקנה\"\r\nt MSG_067 \"לא ניתן לפתוח את המדיה. ייתכן שהיא בשימוש על־ידי תהליך אחר. נא לחבר מחדש את המדיה ולנסות שוב.\"\r\nt MSG_068 \"לא ניתן לחלק את הכונן למחיצות.\"\r\nt MSG_069 \"לא ניתן להעתיק קבצים לכונן היעד.\"\r\nt MSG_070 \"בוטל על־ידי המשתמש.\"\r\nt MSG_071 \"לא ניתן להתחיל תהליכון.\"\r\nt MSG_072 \"בדיקת האזורים הפגומים לא הושלמה.\"\r\nt MSG_073 \"כשל בסריקת קובץ ה־ISO.\"\r\nt MSG_074 \"כשל בחילוץ קובץ ה־ISO.\"\r\nt MSG_075 \"לא ניתן להציב מחדש את אמצעי האחסון.\"\r\nt MSG_076 \"לא ניתן להכין קבצים לאתחול.\"\r\nt MSG_077 \"לא ניתן להקצות אות לכונן.\"\r\nt MSG_078 \"לא ניתן להציב אמצעי אחסון GUID.\"\r\nt MSG_079 \"ההתקן לא מוכן.\"\r\nt MSG_080 \"Rufus זיהה ש־Windows עדיין מרוקן את החוצצים הפנימיים שלו לתוך התקן ה־USB.\\n\\nבהתאם למהירות התקן ה־USB שלך, פעולה זו עשויה להימשך זמן רב, במיוחד עבור קבצים גדולים.\\n\\nאנחנו ממליצים לתת ל־Windows לסיים, כדי להימנע מיצירת שגיאות נתונים. אבל אם נמאס לך לחכות, ניתן פשוט לנתק את ההתקן...\"\r\nt MSG_081 \"קובץ לא נתמך\"\r\nt MSG_082 \"קובץ תמונה זה לא ניתן לאתחול, או שהוא משתמש בשיטת כיווץ או אתחול שלא נתמכת על־ידי Rufus...\"\r\nt MSG_083 \"האם להחליף את %s?\"\r\nt MSG_084 \"נראה שקובץ ה־ISO הזה משתמש בגרסה מיושנת של '%s'.\\nלפיכך, ייתכן שתפריטי האתחול לא יוצגו כראוי.\\n\\nRufus יכול להוריד גרסה חדשה יותר כדי לתקן בעיה זו:\\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את הקובץ\\n- יש לבחור 'לא' כדי להשאיר את קובץ ה־ISO ללא שינויים\\nאם לא ברור לך מה לעשות, כדאי לבחור באפשרות 'כן'.\\n\\nהערה: הקובץ החדש יירד לספרייה בה ממוקם היישום וכל עוד ש־'%s' קיים שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך.\"\r\nt MSG_085 \"מוריד את %s\"\r\nt MSG_086 \"לא נבחר קובץ תמונה\"\r\nt MSG_087 \"עבור %s NAND\"\r\nt MSG_088 \"קובץ התמונה גדול מדי\"\r\nt MSG_089 \"קובץ התמונה גדול מדי עבור התקן היעד שנבחר.\"\r\nt MSG_090 \"קובץ ISO לא נתמך\"\r\nt MSG_091 \"בעת שימוש ב־UEFI כסוג מערכת היעד, רק קובצי ISO הניתנים לאתחול מסוג EFI נתמכים. נא לבחור קובץ ISO שניתן לאתחול מסוג EFI או להגדיר את סוג מערכת היעד כ־BIOS.\"\r\nt MSG_092 \"מערכת קבצים לא נתמכת\"\r\nt MSG_093 \"חשוב: התקן זה מכיל מחיצות מרובות!!\\n\\nזה עשוי לכלול מחיצות/אמצעי אחסון שלא מופיעים ברשימה או אפילו בלתי נראים ב־Windows. אם ברצונך להמשיך, האחריות על אובדן המידע במחיצות האלה היא עליך.\"\r\nt MSG_094 \"אותרו מחיצות מרובות\"\r\nt MSG_095 \"קובץ תמונה DD\"\r\nt MSG_096 \"לא ניתן להשתמש במערכת הקבצים שנבחרה עם קובץ ISO מהסוג הזה. נא להשתמש במערכת קבצים אחרת או לבחור בקובץ ISO אחר.\"\r\nt MSG_097 \"ניתן להחיל את '%s' רק אם מערכת הקבצים היא NTFS.\"\r\nt MSG_098 \"חשוב: הינך מנסה להתקין את 'Windows To Go', אבל לכונן היעד שלך אין את התכונה 'FIXED'. בגלל זה רוב הסיכויים הם ש־Windows ייקפא בזמן העלייה באתחול מכיוון ש־Microsoft לא יצרה את Windows To Go בצורה שתוכל לעבוד עם כוננים שיש להם את התכונה 'REMOVABLE'.\\n\\nהאם עדיין ברצונך להמשיך?\\n\\nהערה: התכונה 'FIXED/REMOVABLE' היא מאפיין חומרה הניתן לשינוי רק בעזרת כלים מיוחדים של יצרן הכונן. עם זאת, הכלים האלה כמעט אף פעם לא משוחררים לציבור...\"\r\nt MSG_099 \"מגבלה של מערכת הקבצים\"\r\nt MSG_100 \"קובץ ה־ISO הזה מכיל קובץ שגדול מ־‎4 GB‏, וזה יותר מהגודל המירבי המותר עבור מערכות הקבצים FAT או FAT32.\"\r\nt MSG_101 \"חסרה תמיכה ב־WIM\"\r\nt MSG_102 \"מערכת ההפעלה שלך לא יכולה לחלץ קבצים מארכיוני WIM. חילוץ מ־WIM דרוש ליצירת כונני USB של Windows Vista ו־Windows 7 הניתנים לאתחול מסוג EFI. ניתן לתקן את זה על־ידי הורדת הגרסה האחרונה של ‎7-Zip‏.\\nהאם ברצונך לעבור לאתר ההורדה של ‎7-Zip‏?\"\r\nt MSG_103 \"להוריד את %s?\"\r\nt MSG_104 \"%s ומעלה דורש שקובץ '%s' יהיה מותקן.\\nמכיוון שקובץ זה גדול מ־‎100 KB‏ ותמיד קיים בקובצי ISO של %s, הוא לא מוטמע ב־Rufus.\\n\\nRufus יכול להוריד את הקובץ החסר עבורך:\\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את הקובץ\\n- יש לבחור 'לא' אם ברצונך להעתיק את הקובץ הזה באופן ידני לכונן מאוחר יותר\\n\\nהערה: הקובץ החדש לספרייה בה ממוקם היישום וכל עוד ש־'%s' קיים שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך.\"\r\nt MSG_105 \"ביטול הפעולה עשוי להשאיר את ההתקן במצב בלתי שמיש.\\nאם ברצונך לבטל בכל זאת, יש ללחוץ על כן. אחרת, יש ללחוץ על לא.\"\r\nt MSG_106 \"נא לבחור תיקייה\"\r\nt MSG_107 \"כל הקבצים\"\r\nt MSG_108 \"יומן רישום של Rufus\"\r\n# LTR & RTL before and after \"0x%02X\"\r\nt MSG_109 \"‎0x%02X‏ (דיסק %d)\"\r\nt MSG_110 \"MS-DOS לא יכול לעלות באתחול מכונן המשתמש בגודל אשכול של 64 קילו בתים.\\nנא לשנות את גודל האשכול או להשתמש ב־FreeDOS.\"\r\nt MSG_111 \"גודל אשכול לא תואם\"\r\nt MSG_112 \"אתחול אמצעי אחסון גדולים מסוג UDF עשוי לארוך זמן רב. במהירויות של USB 2.0, זמן האתחול המשוער הוא: %d:%02d, ובזמן הזה מד ההתקדמות ייראה קפוא. נא להיות סבלני!\"\r\nt MSG_113 \"אמצעי אחסון UDF גדול\"\r\nt MSG_114 \"קובץ תמונה זה משתמש ב־Syslinux %s%s אבל יישום זה כולל רק את קובצי ההתקנה עבור Syslinux %s%s.\\n\\nמכיוון שגרסאות חדשות של Syslinux אינן תואמות אחת לשניה ובלתי אפשרי ש־Rufus יכלול את כולן, יש להוריד 2 קבצים נוספים מהאינטרנט ('ldlinux.sys' ו־'ldlinux.bss'):\\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד את הקבצים האלו\\n- יש לבחור 'לא' כדי לבטל את הפעולה\\n\\nהערה: הקבצים יירדו לספרייה בה ממוקם היישום וכל עוד קבצים אלו יהיו שם, Rufus ישתמש בהם באופן אוטומטי במידת הצורך.\"\r\nt MSG_115 \"נדרשת הורדה\"\r\nt MSG_116 \"קובץ תמונה זה משתמש ב־Grub %s אבל היישום כולל רק את קובצי ההתקנה עבור Grub %s.\\n\\nמכיוון שגרסאות שונות של Grub עשויות שלא להיות תואמות אחת לשניה ובלתי אפשרי ש־Rufus יכלול את כולן, Rufus ינסה למצוא גרסה של קובץ ההתקנה של Grub‏ ('core.img') המתאימה לזו שבקובץ התמונה שלך:\\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולנסות להוריד אותה\\n- יש לבחור 'לא' כדי להשתמש בגרסת ברירת המחדל מ־Rufus\\n- יש לבחור 'ביטול' כדי לבטל את הפעולה\\n\\nהערה: הקובץ יירד לספרייה בה ממוקם היישום ו־Rufus ישתמש בו באופן אוטומטי במידת הצורך. אם לא תימצא התאמה באינטרנט, Rufus ישתמש בגרסה ברירת המחדל.\"\r\nt MSG_117 \"התקנת Windows רגילה\"\r\nt MSG_119 \"מאפייני כונן מתקדמים\"\r\nt MSG_120 \"אפשרויות אתחול מתקדמות\"\r\nt MSG_121 \"הצגת %s\"\r\nt MSG_122 \"הסתרת %s\"\r\nt MSG_123 \"גודל מחיצה קבועה\"\r\nt MSG_124 \"ללא\"\r\nt MSG_125 \"הגדרת גודל המחיצה הקבועה עבור מדיית Live USB. הגדרת הגודל ל־0 מבטלת את המחיצה הקבועה.\"\r\nt MSG_126 \"הגדרת יחידות גודל המחיצה.\"\r\nt MSG_127 \"לא להציג הודעה זו שוב\"\r\nt MSG_128 \"הודעה חשובה לגבי %s\"\r\nt MSG_129 \"זה עתה יצרת מדיה המשתמשת במנהל אתחול מסוג UEFI:NTFS. יש לזכור שכדי שניתן יהיה לאתחל ממדיה זו, חובה לבטל את Secure Boot.\\nלקבלת פרטים על הסיבה לכך ניתן ללחוץ על הכפתור 'מידע נוסף' שלהלן.\"\r\nt MSG_130 \"בחירת תמונת Windows\"\r\nt MSG_131 \"קובץ ISO זה מכיל מספר תמונות Windows.\\nנא לבחור בתמונה שברצונך להשתמש עבור התקנה זו:\"\r\nt MSG_132 \"יישום או תהליך אחר משתמש בכונן זה. האם ברצונך לאתחל אותו בכל זאת?\"\r\nt MSG_133 \"Rufus מזהה שברצונך ליצור מדיית Windows To Go המבוססת על קובץ ISO בגרסה 1809.\\n\\nבגלל *באג של Microsoft*, מדיה זו תקרוס במהלך העלייה באתחול של ה־Windows (מסך המוות הכחול) אלא אם הקובץ WppRecorder.sys יוחלף באופן ידני בקובץ מה־ISO של 1803.\\n\\nלתשומת ליבך, הסיבה לכך של־Rufus אין אפשרות לתקן זאת עבורך היא ש־WppRecorder.sys הוא קובץ המוגן בזכויות יוצרים של Microsoft, כך שאיננו יכולים משפטית להטמיע עותק של הקובץ ביישום...\"\r\nt MSG_134 \"מכיוון ש־MBR נבחר כסוג המחיצה, ל־Rufus יש אפשרות ליצור מחיצה בגודל של עד ‎2 TB‏ על המדיה הזו, פעולה שתגרום ל־%s מנפח הדיסק להיות לא זמינים.\\nהאם ברצונך להמשיך בכל זאת?\"\r\nt MSG_135 \"גרסה\"\r\nt MSG_136 \"שחרור\"\r\nt MSG_137 \"מהדורה\"\r\nt MSG_138 \"שפה\"\r\nt MSG_139 \"ארכיטקטורה\"\r\nt MSG_140 \"המשך\"\r\nt MSG_141 \"חזרה\"\r\nt MSG_142 \"נא להמתין...\"\r\nt MSG_143 \"הורדה באמצעות דפדפן\"\r\nt MSG_144 \"הורדה של קובצי ISO של Windows אינה זמינה עקב כך ש־Microsoft שינתה את אתר האינטרנט שלה כדי למנוע זאת.\"\r\nt MSG_145 \"נדרש PowerShell 3.0 ומעלה כדי להריץ תסריט זה.\"\r\nt MSG_146 \"האם ברצונך לעבור לאינטרנט ולהוריד אותו?\"\r\nt MSG_148 \"מריץ תסריט הורדה...\"\r\nt MSG_149 \"הורדת קובץ ISO\"\r\nt MSG_150 \"סוג המחשב שברצונך להשתמש עם הכונן בר־האתחול. זוהי אחריותך לבדוק האם מערכת היעד היא מסוג BIOS או UEFI לפני התחלת יצירת הכונן, מכיוון שאחרת הוא עשוי להיכשל לעלות באתחול.\"\r\nt MSG_151 \"הכוונה באפשרות 'UEFI-CSM' היא שההתקן יוכל לעלות באתחול רק במצב הדמיית BIOS (הידוע גם כ־Legacy Mode) תחת UEFI, ולא במצב UEFI טבעי.\"\r\nt MSG_152 \"הכוונה באפשרות 'שאינו CSM' היא שההתקן יוכל לעלות באתחול רק במצב UEFI טבעי, ולא במצב הדמיית BIOS (הידוע גם כ־Legacy Mode).\"\r\nt MSG_153 \"דפוס בדיקה: 0x%02X\"\r\nt MSG_154 \"דפוס בדיקה: 0x%02X, 0x%02X\"\r\nt MSG_155 \"דפוס בדיקה: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"דפוס בדיקה: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"הגדרת מערכת הקבצים של היעד\"\r\nt MSG_158 \"הגודל המינימלי שבלוק של נתונים יתפוס במערכת הקבצים\"\r\nt MSG_159 \"יש להשתמש בשדה זה כדי להגדיר את תווית הכונן.\\nניתן להשתמש גם בתווים בינלאומיים.\"\r\nt MSG_160 \"הצגה/הסתרה של האפשרויות המתקדמות\"\r\nt MSG_161 \"בדיקת ההתקן אחר אזורים פגומים בעזרת דפוס בדיקה\"\r\nt MSG_162 \"יש לבטל את סימון התיבה הזו כדי להשתמש בשיטת האתחול ה\\\"איטית\\\"\"\r\nt MSG_163 \"השיטה שתהיה בשימוש ליצירת מחיצות\"\r\nt MSG_164 \"השיטה שתהיה בשימוש להפיכת הכונן לבר־אתחול\"\r\nt MSG_165 \"יש ללחוץ כדי לבחור או להוריד קובץ תמונה...\"\r\nt MSG_166 \"יש לסמן תיבה זו כדי לאפשר הצגה של תוויות שם בינלאומיות וכדי להגדיר סמל להתקן (יוצר קובץ autorun.inf)\"\r\nt MSG_167 \"מתקין מנהל אתחול UEFI שיבצע אימות קבצים שעל המדיה בשיטת MD5Sum\"\r\nt MSG_169 \"יוצר מחיצה נוספת נסתרת ומנסה ליישר את הגבולות של המחיצות.\\nזה עשוי לשפר את זיהוי האתחול עבור BIOS־ים ישנים.\"\r\nt MSG_170 \"מאפשר הצגת מארזים חיצוניים לכוננים קשיחים בחיבור USB ברשימת ההתקנים. השימוש על אחריותך בלבד!!!\"\r\nt MSG_171 \"התחלת פעולת האתחול.\\nתהליך זה ישמיד את כל הנתונים על ההתקן!\"\r\nt MSG_172 \"חתימת הורדה לא חוקית\"\r\nt MSG_173 \"יש ללחוץ כדי לבחור...\"\r\nt MSG_174 \"Rufus - הכלי לאתחול USB האמין ביותר\"\r\nt MSG_175 \"גרסה %d.%d (בנייה %d)\"\r\nt MSG_176 \"תרגום לעברית: נועם סרוסי, איתיאל וידידים\"\r\nt MSG_177 \"דיווח על תקלות או הצעת שיפורים בכתובת:\"\r\nt MSG_178 \"זכויות יוצרים נוספות:\"\r\nt MSG_179 \"מדיניות עדכונים:\"\r\nt MSG_180 \"אם בחירתך היא לאפשר ליישום זה לבדוק אחר עדכונים, מקובל עליך שהמידע הזה יישמר בשרתים שלנו:\"\r\nt MSG_181 \"סוג וגרסת מערכת ההפעלה שלך\"\r\nt MSG_182 \"גרסת היישום שבשימוש\"\r\nt MSG_183 \"כתובת ה־IP שלך\"\r\nt MSG_184 \"לצורך יצירת סטטיסטיקת שימוש פרטית, ייתכן שנשמור את המידע שייאסף \\\\b לשנה לכל היותר\\\\b0 . עם זאת, אנחנו לא נמסור מרצוננו החופשי את הנתונים האלה לשום גורם צד שלישי.\"\r\nt MSG_185 \"תהליך העדכון:\"\r\nt MSG_186 \"Rufus לא מתקין או מפעיל שירותים ברקע, לכן חיפוש אחר עדכונים יתבצע רק כשהיישום הראשי פועל.\\\\line\\nכמובן שנדרשת גישה לאינטרנט כדי לחפש עדכונים.\"\r\nt MSG_187 \"קובץ תמונה שגוי עבור אפשרות האתחול שנבחרה\"\r\nt MSG_188 \"קובץ התמונה הנוכחי אינו מתאים לאפשרות האתחול שנבחרה. נא להשתמש בקובץ תמונה אחר או לבחור באפשרות אתחול אחרת..\"\r\nt MSG_189 \"קובץ ה־ISO הזה אינו מותאם למערכת הקבצים שנבחרה\"\r\nt MSG_190 \"זוהה כונן שאינו תואם\"\r\nt MSG_191 \"מעבר כתיבה\"\r\nt MSG_192 \"מעבר קריאה\"\r\nt MSG_193 \"%s הורד\"\r\nt MSG_194 \"לא ניתן להוריד את %s\"\r\nt MSG_195 \"משתמש בגרסה מוטמעת של קובצי %s\"\r\nt MSG_196 \"חשוב: כונן זה משתמש בגודל אשכול שאינו סטנדרטי!\\n\\nכוננים רגילים משתמשים בגודל אשכול של 512 בתים אבל הכונן הזה משתמש בגודל של %d בתים. בהרבה מקרים, זה אומר שלא תהיה לך אפשרות לעלות באתחול מכונן זה.\\nRufus יכול לנסות ליצור כונן בר־אתחול, אבל אין שום אחריות או הבטחה שזה יעבוד.\"\r\nt MSG_197 \"זוהה גודל אשכול שאינו סטנדרטי\"\r\nt MSG_198 \"ניתן להתקין את 'Windows To Go' על כונן במחיצת GPT רק אם מוגדרת לו התכונה FIXED. לכונן הנוכחי לא זוהתה תכונה זו.\"\r\nt MSG_199 \"תכונה זו אינה זמינה בפלטפורמה זו.\"\r\nt MSG_201 \"מבטל - נא להמתין...\"\r\nt MSG_202 \"סורק קובץ תמונה...\"\r\nt MSG_203 \"נכשל בסריקת קובץ התמונה\"\r\nt MSG_204 \"זוהה %s מיושן\"\r\nt MSG_205 \"משתמש בקובץ תמונה: %s\"\r\nt MSG_206 \"קובץ %s חסר\"\r\nt MSG_207 \"אמצעי אחסון חדש\"\r\nt MSG_208 \"נמצא התקן אחד\"\r\nt MSG_209 \"נמצאו %d התקנים\"\r\nt MSG_210 \"מוכן\"\r\nt MSG_211 \"בוטל\"\r\nt MSG_212 \"נכשל\"\r\nt MSG_213 \"פותח את היישום החדש...\"\r\nt MSG_214 \"נכשל בפתיחת היישום החדש\"\r\nt MSG_215 \"הקובץ ‪%s‬ נפתח\"\r\nt MSG_216 \"הקובץ ‪%s‬ נשמר\"\r\nt MSG_217 \"מאתחל: %s\"\r\nt MSG_218 \"יוצר מערכת קבצים: משימה %d/%d הושלמה\"\r\nt MSG_219 \"תיקון NTFS‏: %d%% הושלמו\"\r\nt MSG_220 \"מאתחל (%s) - משך זמן משוער %d:%02d...\"\r\nt MSG_221 \"מגדיר תווית (%s)...\"\r\nt MSG_222 \"מאתחל (%s)...\"\r\nt MSG_223 \"תיקון NTFS‏ (Checkdisk)...\"\r\nt MSG_224 \"מנקה מבני מחיצות MBR/PBR/GPT...\"\r\nt MSG_225 \"מבקש גישה לדיסק...\"\r\nt MSG_226 \"מנתח את רשומות האתחול הקיימות...\"\r\nt MSG_227 \"סוגר את אמצעי האחסון הקיים...\"\r\nt MSG_228 \"כותב רשומת אתחול ראשית (MBR)...\"\r\nt MSG_229 \"כותב רשומת אתחול של המחיצה (PBR)...\"\r\nt MSG_230 \"מעתיק קובצי DOS...\"\r\nt MSG_231 \"מעתיק קובצי ISO: ‏%s\"\r\n# RLM is not needed here as the placeholder is fully localized (the \"this may take a while\" string).\r\nt MSG_232 \"מגדיר אתחול EFI של Win7 (%s)...\"\r\nt MSG_233 \"משלים, נא להמתין...\"\r\nt MSG_234 \"מתקין את Syslinux %s...\"\r\nt MSG_235 \"אזורים פגומים: %s %d/%d - %0.2f%% (%d/%d/%d שגיאות)\"\r\nt MSG_236 \"אזורים פגומים: בודק בדפוס אקראי\"\r\nt MSG_237 \"אזורים פגומים: בודק בדפוס 0x%02X\"\r\nt MSG_238 \"יוצר מחיצות (%s)...\"\r\nt MSG_239 \"מוחק מחיצות (%s)...\"\r\nt MSG_240 \"לא ניתן לאמת את החתימה של העדכון שהורד. זה יכול לנבוע מכך שהמערכת שלך לא מוגדרת כראוי עבור אימות חתימות או להצביע על הורדה זדונית.\\n\\nההורדה תימחק. נא לבדוק את יומן הרישום לפרטים נוספים.\"\r\nt MSG_241 \"מוריד: %s\"\r\nt MSG_242 \"נכשל בהורדת הקובץ.\"\r\nt MSG_243 \"בודק אחר עדכונים עבור Rufus...\"\r\nt MSG_244 \"עדכונים: לא ניתן להתחבר לאינטרנט\"\r\nt MSG_245 \"עדכונים: לא ניתן לגשת לנתוני הגרסה\"\r\nt MSG_246 \"זמינה גרסה חדשה של Rufus!\"\r\nt MSG_247 \"לא נמצאה גרסה חדשה של Rufus\"\r\nt MSG_248 \"מפתחות הרישום של היישום נמחקו בהצלחה\"\r\nt MSG_249 \"נכשל במחיקת מפתחות הרישום של היישום\"\r\nt MSG_250 \"%s מופעל\"\r\nt MSG_251 \"%s מושבת\"\r\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\r\nt MSG_252 \"מצב בדיקות גודל\"\r\nt MSG_253 \"זיהוי כוננים קשיחים\"\r\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\r\nt MSG_254 \"מצב כפיית אתחול כ־Large FAT32\"\r\nt MSG_255 \"NoDriveTypeAutorun יימחק ביציאה\"\r\nt MSG_256 \"זיהוי כוננים מזוייפים\"\r\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\r\nt MSG_257 \"מצב תמיכה ב־Joliet\"\r\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\r\nt MSG_258 \"מצב תמיכה ב־Rock Ridge\"\r\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\r\nt MSG_259 \"מצב כפיית עדכון\"\r\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\r\nt MSG_260 \"מצב דחיסת NTFS\"\r\nt MSG_261 \"כותב קובץ תמונה: %s\"\r\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\r\nt MSG_262 \"מצב תמיכה ב־ISO\"\r\nt MSG_263 \"שימוש ביחידות מידה תקינות\"\r\nt MSG_264 \"מוחק את התיקייה '%s'\"\r\nt MSG_265 \"זיהוי כונני VMWare\"\r\nt MSG_266 \"מצב UEFI/BIOS משולב\"\r\nt MSG_267 \"מחיל קובץ תמונה של Windows‏: %s\"\r\nt MSG_268 \"מחיל קובץ תמונה של Windows...\"\r\nt MSG_269 \"שימור חותמות זמן\"\r\nt MSG_270 \"ניפוי שגיאות USB\"\r\nt MSG_271 \"מחשב סיכומי ביקורת של קובץ תמונה: %s\"\r\nt MSG_272 \"חישוב סיכומי הביקורת MD5‏, SHA1 ו־SHA256 עבור קובץ התמונה הנבחר\"\r\nt MSG_273 \"שינוי שפת היישום\"\r\nt MSG_274 \"זוהה קובץ תמונה מסוג %s\"\r\nt MSG_275 \"הקובץ שבחרת הוא קובץ תמונה מסוג ISOHybrid. זה אומר שהוא יכול להיכתב גם במצב %s (העתקת קבצים) וגם במצב %s (קובץ תמונת דיסק).\\nRufus ממליץ על מצב %s, כדי שתמיד תהיה לך גישה מלאה לכונן לאחר הכתיבה.\\nעם זאת, אם ישנן בעיות במהלך העלייה באתחול, ניתן לנסות לכתוב את קובץ התמונה שוב במצב %s.\\n\\nנא לבחור במצב שברצונך להשתמש לכתיבת קובץ תמונה זה:\"\r\nt MSG_276 \"כתיבה במצב %s (מומלץ)\"\r\nt MSG_277 \"כתיבה במצב %s\"\r\nt MSG_278 \"בודק אם קיימים תהליכים מתנגשים...\"\r\nt MSG_279 \"לא בר־אתחול\"\r\nt MSG_280 \"דיסק או קובץ תמונה ISO\"\r\nt MSG_281 \"%s (נא לבחור)\"\r\n# This was translated with \"mode\" as this string is a placeholder for \"%s disabled/enabled\", to match masculinity for both.\r\nt MSG_282 \"מצב נעילת כונן USB בלעדית\"\r\nt MSG_283 \"חתימה לא חוקית\"\r\nt MSG_284 \"לקובץ ההרצה שהורד חסרה חתימה דיגיטלית.\"\r\nt MSG_285 \"קובץ ההרצה שהורד חתום על־ידי '%s'.\\nזוהי לא חתימה שאנחנו מזהים, מה שיכול להצביע על פעילות זדונית...\\nהאם ברצונך להפעיל קובץ זה בכל זאת?\"\r\nt MSG_286 \"מבצע איפוס לכונן: %s\"\r\nt MSG_287 \"זיהוי כוננים נשלפים שאינם מסוג USB\"\r\nt MSG_288 \"הרשאות מוגדלות חסרות\"\r\nt MSG_289 \"ניתן להריץ יישום זה רק עם הרשאות מוגדלות\"\r\nt MSG_290 \"סידור קבצים באינדקס\"\r\nt MSG_291 \"בחירת גרסה\"\r\nt MSG_292 \"נא לבחור בגרסת ה־Windows שברצונך להתקין:\"\r\nt MSG_293 \"גירסת Windows לא נתמכת\"\r\nt MSG_294 \"גרסה זו של Windows אינה נתמכת יותר על־ידי Rufus.\\nהגרסה האחרונה של Rufus הנתמכת בפלטפורמה זו היא v%d.%d.\"\r\nt MSG_295 \"אזהרה: גרסה לא רשמית\"\r\nt MSG_296 \"גרסה זו של Rufus לא נוצרה על־ידי המפתחים הרשמיים שלה.\\n\\nהאם ברצונך להריץ אותה בכל זאת?\"\r\nt MSG_297 \"זוהה קובץ ISO קטוע\"\r\nt MSG_298 \"קובץ ה־ISO שבחרת לא תואם לגודלו המוצהר: חסרים נתונים בגודל של %s!\\n\\nאם הורדת את הקובץ הזה מהאינטרנט, כדאי לנסות להוריד עותק חדש ולוודא שסיכומי הביקורת MD5 או SHA תואמים לאלו הרשמיים.\\n\\nלתשומת ליבך, ניתן לחשב את ה־MD5 או SHA בתוך Rufus על־ידי לחיצה על הכפתור (✓).\"\r\nt MSG_299 \"שגיאת אימות חותמת זמן\"\r\nt MSG_300 \"Rufus לא יכל לוודא שחותמת הזמן של העדכון שהורד חדשה יותר מזו של קובץ ההרצה הנוכחי.\\n\\nכדי למנוע תרחישי תקיפה אפשריים, תהליך העדכון בוטל וההורדה תימחק. נא לבדוק את יומן הרישום לפרטים נוספים.\"\r\nt MSG_301 \"הצגת הגדרות היישום\"\r\nt MSG_302 \"הצגת מידע על אודות יישום זה\"\r\nt MSG_303 \"הצגת יומן הרישום\"\r\nt MSG_304 \"יצירת קובץ תמונת דיסק של ההתקן הנבחר\"\r\nt MSG_305 \"ניתן להשתמש באפשרות זו כדי לציין האם ברצונך להתקין את Windows על דיסק אחר, או להריץ את Windows ישירות מכונן זה (Windows To Go).\"\r\nt MSG_306 \"מבצע איפוס מהיר לכונן: %s\"\r\nt MSG_307 \"זה עשוי לקחת זמן\"\r\nt MSG_308 \"איתור VHD\"\r\nt MSG_309 \"ארכיון מכווץ\"\r\nt MSG_310 \"קובץ ה־ISO שבחרת משתמש ב־UEFI והוא בגודל מספיק קטן כדי להיכתב כ־EFI System Partition (ESP). כתיבה למחיצה מסוג ESP, בניגוד לכתיבה למחיצת נתונים רגילה המתפרסת על כל שטח הדיסק, עשויה להיות מועדפת עבור סוגי התקנות מסויימים.\\n\\nנא לבחור במצב שברצונך להשתמש כדי לכתוב את קובץ התמונה הזה:\"\r\nt MSG_311 \"יש להשתמש ב־%s (בחלון היישום הראשי) כדי להפעיל.\"\r\nt MSG_312 \"חישוב גיבובים נוספים (SHA512)\"\r\nt MSG_313 \"שמירה ל־VHD\"\r\nt MSG_314 \"חישוב סיכומי ביקורת של קובץ התמונה\"\r\nt MSG_315 \"כפתורים מרובים\"\r\nt MSG_316 \"מספר המעברים\"\r\nt MSG_317 \"מזהה דיסק\"\r\nt MSG_318 \"עדיפות תהליכון ברירת מחדל: %d\"\r\nt MSG_319 \"מצב התעלמות מסמן האתחול (Boot Marker)\"\r\nt MSG_320 \"מרענן את מבנה המחיצות (%s)...\"\r\nt MSG_321 \"קובץ התמונה שבחרת הוא מסוג ISOHybrid, אבל היוצרים שלו לא תכננו אותו בצורה שיהיה נתמך במצב העתקת קבצים מ־ISO.\\nכתוצאה מכך, ייאכף שימוש במצב כתיבה כקובץ תמונה DD.\"\r\nt MSG_322 \"לא ניתן לפתוח או לקרוא את '%s'\"\r\nt MSG_325 \"מחיל התאמה אישית של Windows‏: %s\"\r\nt MSG_326 \"מחיל אפשרויות משתמש...\"\r\nt MSG_327 \"חוויית המשתמש של Windows\"\r\nt MSG_328 \"להתאים אישית את ההתקנה של Windows?\"\r\nt MSG_329 \"הסרת דרישה ל־4GB RAM ומעלה, Secure Boot ו־TPM\"\r\nt MSG_330 \"הסרת דרישה לחשבון Microsoft מקוון\"\r\nt MSG_331 \"השבתת איסוף נתונים (דילוג על שאלות של פרטיות)\"\r\nt MSG_332 \"למנוע מ־Windows To Go לגשת לדיסקים פנימיים\"\r\nt MSG_333 \"יצירת חשבון מקומי עם שם המשתמש:\"\r\nt MSG_334 \"הגדרת אפשרויות האזור לאותם ערכים כמו של משתמש זה\"\r\nt MSG_335 \"השבתת הצפנת מכשיר אוטומטית של BitLocker\"\r\nt MSG_336 \"יומן קבוע\"\r\nt MSG_337 \"יש להוריד קובץ נוסף ('%s') ממיקרוסופט כדי להשתמש בתכונה זו:\\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד אותו\\n- יש לבחור 'לא' כדי לבטל את הפעולה\\n\\nהערה: הקובץ יירד לספרייה בה ממוקם היישום וכל עוד הקובץ יהיה שם, Rufus ישתמש בו באופן אוטומטי במידת הצורך.\"\r\nt MSG_338 \"אותר מנהל אתחול UEFI שנאסר לשימוש\"\r\nt MSG_339 \"Rufus איתר שקובץ ה־ISO שבחרת מכיל מנהל אתחול UEFI שנאסר לשימוש ושיציג %s, כאשר Secure Boot מופעל על מערכת UEFI מעודכנת לחלוטין.\\n\\n- אם השגת את קובץ תמונת ISO זה ממקור מפוקפק, כדאי לשקול את האפשרות שייתכן שהוא מכיל נוזקת UEFI, ולהימנע מלאתחל ממנו.\\n- אם השגת אותה ממקור מהימן, כדאי לנסות לאתר גרסה יותר עדכנית, שלא תציג אזהרה זו.\"\r\nt MSG_340 \"מסך \\\"הפרת אבטחה\\\"\"\r\nt MSG_341 \"מסך שחזור של Windows ‏(BSOD) עם '%s'\"\r\nt MSG_342 \"קובץ תמונה VHDX מכווץ\"\r\nt MSG_343 \"קובץ תמונה VHD שאינו מכווץ\"\r\nt MSG_344 \"קובץ תמונה של Full Flash Update\"\r\nt MSG_345 \"יש להוריד נתונים נוספים מ־Microsoft על מנת להשתמש באפשרות זו:\\n- יש לבחור 'כן' כדי להתחבר לאינטרנט ולהוריד אותם\\n- יש לבחור 'לא' כדי לבטל את הפעולה\"\r\nt MSG_346 \"הגבלת ההתקנה של Windows למצב S-Mode (אינו נתמך עם האפשרות לעקיפת חשבון מקוון)\"\r\nt MSG_347 \"מצב מומחה\"\r\nt MSG_348 \"מחלץ קובצי ארכיון: %s\"\r\nt MSG_349 \"שימוש ב־MBR של Rufus\"\r\nt MSG_900 \"Rufus הוא כלי המסייע באתחול ויצירת כונני הבזק מסוג USB הניתנים לאתחול, כמו דיסק און קי, כרטיסי זיכרון וכו׳.\"\r\nt MSG_901 \"האתר הרשמי: %s\"\r\nt MSG_902 \"קוד מקור: %s\"\r\nt MSG_903 \"הערות שחרור: %s\"\r\nt MSG_904 \"יישום זה ברישיון תחת התנאים של גרסה 3 של הרישיון הציבורי של גנו (GPL).\\nלפרטים נוספים, יש להיכנס אל https://www.gnu.org/licenses/gpl-3.0.html.\"\r\nt MSG_905 \"בוט\"\r\nt MSG_910 \"אתחול USB, כרטיסי זיכרון וכוננים וירטואליים ל־FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"יצירת כונני USB הניתנים לאתחול של FreeDOS\"\r\nt MSG_912 \"יצירת כוננים הניתנים לאתחול מקובצי ISO הניתנים לאתחול (Windows‏, Linux וכו')\"\r\nt MSG_913 \"יצירת כוננים הניתנים לאתחול מקובצי תמונת דיסק הניתנים לאתחול, כולל קבצים דחוסים\"\r\nt MSG_914 \"יצירת כוננים הניתנים לאתחול ממחשבים התומכים ב־BIOS או UEFI, לרבות כוננים הניתנים לאתחול מ־UEFI, המשתמשים במערכת הקבצים NTFS\"\r\nt MSG_915 \"יצירת כונני Windows To Go\"\r\nt MSG_916 \"יצירת כונני התקנה של Windows 11 עבור מחשבים שאין להם TPM או Secure Boot\"\r\nt MSG_917 \"יצירת מחיצות Linux קבועות\"\r\nt MSG_918 \"יצירת קובצי תמונה מסוג VHD/DD של הכונן שנבחר\"\r\nt MSG_919 \"חישוב סיכומי ביקורת מסוג MD5,‏ SHA-1,‏ SHA-256 ו־SHA-512 של קובץ התמונה שנבחרה\"\r\nt MSG_920 \"ביצוע בדיקות אחר בלוקים (אזורים) פגומים, כולל זיהוי של כונני הבזק \\\"מזוייפים\\\"\"\r\nt MSG_921 \"הורדת קובצי ה־ISO הקמעונאיים הרשמיים של Microsoft Windows\"\r\nt MSG_922 \"הורדת קובצי ISO של מעטפת UEFI\"\r\n\r\n#########################################################################v\r\nl \"hu-HU\" \"Hungarian (Magyar)\" 0x040e\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"A Rufus névjegye\"\r\nt IDC_ABOUT_LICENSE \"Licensz\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Meghajtó tulajdonságai\"\r\nt IDS_DEVICE_TXT \"Eszköz\"\r\nt IDS_BOOT_SELECTION_TXT \"Rendszerindító (boot) kiválasztása\"\r\nt IDC_SELECT \"Kiválasztás\"\r\nt IDS_IMAGE_OPTION_TXT \"Kép opció\"\r\nt IDS_PARTITION_TYPE_TXT \"Partíciós séma\"\r\nt IDS_TARGET_SYSTEM_TXT \"Célrendszer\"\r\nt IDC_LIST_USB_HDD \"USB merevlemezek listázása\"\r\nt IDC_OLD_BIOS_FIXES \"Javítások hozzáadása régi BIOS-okhoz (extra partíció, igazítás, stb.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Futásidejű UEFI adathordozó érvényesítés\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Formázási beállítások\"\r\nt IDS_FILE_SYSTEM_TXT \"Fájlrendszer\"\r\nt IDS_CLUSTER_SIZE_TXT \"Klaszter mérete\"\r\nt IDS_LABEL_TXT \"Kötetcímke\"\r\nt IDC_QUICK_FORMAT \"Gyorsformázás\"\r\nt IDC_BAD_BLOCKS \"Hibás blokkok keresése az eszközön\"\r\nt IDC_EXTENDED_LABEL \"Kiterjesztett kötetcímke és ikonfájlok használata\"\r\nt IDS_STATUS_TXT \"Állapot\"\r\nt IDCANCEL \"Bezárás\"\r\nt IDC_START \"Indítás\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Bezárás\"\r\nt IDD_LICENSE \"Rufus Licensz\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Bezárás\"\r\nt IDD_LOG \"Napló\"\r\nt IDC_LOG_CLEAR \"Törlés\"\r\nt IDC_LOG_SAVE \"Mentés\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Bezárás\"\r\nt IDD_NEW_VERSION \"Frissítések keresése - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Egy újabb verzió érhető el. Kérlek, töltsd le a legújabb verziót!\"\r\nt IDC_WEBSITE \"Kattints ide a weboldalra ugráshoz\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Kiadási jegyzék\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Letöltés\"\r\nt IDC_DOWNLOAD \"Letöltés\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"További információk\"\r\nt IDYES \"Igen\"\r\nt IDNO \"Nem\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Bezárás\"\r\nt IDD_UPDATE_POLICY \"Frissítési irányelvek és beállítások\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Beállítások\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Frissítések keresése\"\r\nt IDS_INCLUDE_BETAS_TXT \"Beta verziókat is\"\r\nt IDC_CHECK_NOW \"Ellenőrzés\"\r\n\r\nt MSG_001 \"Másik példány észlelve\"\r\nt MSG_002 \"Egy másik Rufus példány már fut.\\nKérlek, zárd be, mielőtt ezt futtatnád.\"\r\nt MSG_003 \"FIGYELMEZTETÉS: A(Z) '%s' ESZKÖZÖN AZ ÖSSZES ADAT LE LESZ TÖRÖLVE!\\nA művelet folytatásához kattints az OK gombra.\\nA művelet megszakításához kattints a Mégse gombra.\"\r\nt MSG_004 \"Rufus frissítési irányelvek\"\r\nt MSG_005 \"Engedélyezed, hogy a Rufus frissítéseket keressen?\"\r\nt MSG_006 \"Bezárás\"\r\nt MSG_007 \"Mégse\"\r\nt MSG_008 \"Igen\"\r\nt MSG_009 \"Nem\"\r\nt MSG_010 \"Hibás blokkok találhatóak\"\r\nt MSG_011 \"Ellenőrzés befejezve: %d hibás blokk található\\n  %d olvasási hiba\\n  %d írási hiba\\n  %d megsérülve\"\r\nt MSG_012 \"%s\\nEgy részletesebb jelentés megtalálható itt:\\n%s\"\r\nt MSG_013 \"Letiltva\"\r\nt MSG_014 \"Naponta\"\r\nt MSG_015 \"Hetente\"\r\nt MSG_016 \"Havonta\"\r\nt MSG_017 \"Egyéni\"\r\nt MSG_018 \"Jelenlegi verzió: %d.%d (Build %d)\"\r\nt MSG_019 \"Legújabb verzió: %d.%d (Build %d)\"\r\nt MSG_020 \"bájt\"\r\nt MSG_026 \"bájt\"\r\nt MSG_027 \"kilobájt\"\r\nt MSG_028 \"megabájt\"\r\nt MSG_029 \"Alapértelmezett\"\r\nt MSG_030 \"%s (Alapértelmezett)\"\r\nt MSG_031 \"BIOS (vagy UEFI-CSM)\"\r\nt MSG_032 \"UEFI (nem CSM)\"\r\nt MSG_033 \"BIOS vagy UEFI\"\r\nt MSG_034 \"%d menet\"\r\nt MSG_035 \"%d menet %s\"\r\nt MSG_036 \"ISO kép\"\r\nt MSG_037 \"Alkalmazás\"\r\nt MSG_038 \"Megszakít\"\r\nt MSG_039 \"Indítás\"\r\nt MSG_040 \"Letöltés\"\r\nt MSG_041 \"A folyamat a felhasználó által megszakítva\"\r\nt MSG_042 \"Hiba\"\r\nt MSG_043 \"Hiba: %s\"\r\nt MSG_044 \"Fájl letöltése\"\r\nt MSG_045 \"USB tárolóeszköz (általános)\"\r\nt MSG_046 \"%s (Lemez %d) [%s]\"\r\nt MSG_047 \"Több partíció\"\r\nt MSG_048 \"Rufus - Pufferek kiürítése\"\r\nt MSG_049 \"Rufus - Megszakítás\"\r\nt MSG_050 \"Siker.\"\r\nt MSG_051 \"Ismeretlen hiba formázás közben.\"\r\nt MSG_052 \"A kiválasztott fájlrendszer nem használható ehhez az eszközhöz.\"\r\nt MSG_053 \"Az eszközhöz a hozzáférés megtagadva.\"\r\nt MSG_054 \"Az eszköz írásvédett.\"\r\nt MSG_055 \"Az eszközt más folyamat használja. Kérlek, zárj be minden más alkalmazást, ami használhatja ezt az eszközt.\"\r\nt MSG_056 \"A gyorsformázás nem elérhető ehhez az eszközhöz.\"\r\nt MSG_057 \"A kötetcímke érvénytelen.\"\r\nt MSG_058 \"Az eszközkezelő érvénytelen.\"\r\nt MSG_059 \"A kiválasztott klaszterméret érvénytelen ehhez az eszközhöz.\"\r\nt MSG_060 \"A kötetméret érvénytelen.\"\r\nt MSG_061 \"Kérlek, helyezz be egy eltávolítható eszközt a meghajtóba.\"\r\nt MSG_062 \"Nem támogatott parancs.\"\r\nt MSG_063 \"Memóriafoglalási hiba.\"\r\nt MSG_064 \"Olvasási hiba.\"\r\nt MSG_065 \"Írási hiba.\"\r\nt MSG_066 \"Telepítési hiba\"\r\nt MSG_067 \"Nem sikerült megnyitni az adathordozót. Lehet, hogy másik folyamat használja. Kérlek, helyezd be újra és próbáld újra.\"\r\nt MSG_068 \"Nem sikerült a meghajtót particionálni.\"\r\nt MSG_069 \"Nem sikerült fájlokat másolni a célmeghajtóra.\"\r\nt MSG_070 \"Felhasználó által megszakítva.\"\r\nt MSG_071 \"Nem sikerült elindítani a folyamatot.\"\r\nt MSG_072 \"A hibás blokkok ellenőrzése nem fejeződött be.\"\r\nt MSG_073 \"ISO képfájl beolvasási hiba.\"\r\nt MSG_074 \"ISO képfájl kibontási hiba.\"\r\nt MSG_075 \"Nem lehet a kötetet újracsatlakoztatni.\"\r\nt MSG_076 \"Nem lehet a fájlokat frissíteni/telepíteni bootoláshoz.\"\r\nt MSG_077 \"Nem lehet meghajtóbetűjelet hozzárendelni.\"\r\nt MSG_078 \"Nem lehet GUID kötetet csatlakoztatni.\"\r\nt MSG_079 \"Az eszköz nem áll készen.\"\r\nt MSG_080 \"A Rufus észlelte, hogy a Windows még mindig ír az USB eszközre.\\n\\nAz USB eszközöd sebességétől függően e művelet befejezése hosszú ideig is eltarthat, különösen nagy fájlok esetén.\\n\\nA hibák elkerülése érdekében hagyd, hogy a Windows befejezze az írást. De ha belefáradtál a várakozásba, akkor egyszerűen távolítsd el az USB eszközt...\"\r\nt MSG_081 \"Nem támogatott képfájl\"\r\nt MSG_082 \"Ez a képfájl vagy nem bootolható, vagy olyan bootolási vagy tömörítési módszert használ, amelyet a Rufus nem támogat...\"\r\nt MSG_083 \"Felülírod ezt: %s?\"\r\nt MSG_084 \"Úgy tűnik, hogy ez az ISO képfájl a(z) '%s' elavult verzióját használja.\\nEmiatt a boot menü valószínűleg nem fog megfelelően megjelenni.\\n\\nA Rufus le tud tölteni egy újabb verziót a probléma megoldásához:\\n- Válaszd az 'Igen' gombot az új verzió letöltéséhez\\n- Válaszd a 'Nem' gombot a létező ISO képfájl változatlanul hagyásához\\nHa nem tudod, hogy mit kell tenned, akkor válaszd az 'Igen' gombot.\\n\\nMegjegyzés: Az új fájl a jelenlegi mappába lesz letöltve, és ha egy '%s' létezik, akkor az automatikusan újra lesz használva.\"\r\nt MSG_085 \"%s letöltése\"\r\nt MSG_086 \"Nincs képfájl kiválasztva\"\r\nt MSG_087 \"%s NAND típushoz\"\r\nt MSG_088 \"A képfájl túl nagy\"\r\nt MSG_089 \"A képfájl túl nagy a kiválasztott célhoz.\"\r\nt MSG_090 \"Nem támogatott ISO\"\r\nt MSG_091 \"UEFI típusú célrendszer esetén csak EFI alól bootolható ISO képfájlok támogatottak. Kérlek, válassz egy EFI alól bootolható ISO-t, vagy állítsd a célrendszer típusát BIOS-ra.\"\r\nt MSG_092 \"Nem támogatott fájlrendszer\"\r\nt MSG_093 \"FONTOS: EZ A MEGHAJTÓ TÖBB PARTÍCIÓT TARTALMAZ!!\\n\\nEz olyan partíciókat/köteteket is jelenthet, amelyek nincsenek listázva, vagy nem is láthatóak Windows alól. Ha folytatni szeretnéd, akkor Te vagy a felelős az ezeken a partíciókon bekövetkező adatvesztésekért.\"\r\nt MSG_094 \"Több partíció észlelve\"\r\nt MSG_095 \"DD képfájl\"\r\nt MSG_096 \"A jelenleg kiválasztott fájlrendszer nem használható ezzel a típusú ISO képfájllal. Kérlek, válassz ki egy másik fájlrendszert vagy egy másik ISO képfájlt.\"\r\nt MSG_097 \"A '%s' csak NTFS fájlrendszerrel használható.\"\r\nt MSG_098 \"FONTOS: 'Windows To Go'-t próbálsz telepíteni, de a célmeghajtó nem 'BEÉPÍTETT' megjelölésű. Emiatt a Windows bootolás közben lefagyhat, mivel a Microsoft nem úgy tervezte, hogy 'ELTÁVOLÍTHATÓ' megjelölésű eszközzel is működjön.\\n\\nSzeretnéd folytatni?\\n\\nMegjegyzés: A 'BEÉPÍTETT/ELTÁVOLÍTHATÓ' megjelölés egy hardveres tulajdonság, amely csak az eszköz gyártójától származó egyedi eszközökkel változtatható meg. Azonban ezek az eszközök SZINTE SOHA SEM publikusak...\"\r\nt MSG_099 \"Fájlrendszer korlátozás\"\r\nt MSG_100 \"Ez az ISO képfájl olyan fájlt tartalmaz, amely nagyobb, mint 4 GB, ami több, mint a maximális megengedett méret FAT vagy FAT32 fájlrendszer esetén.\"\r\nt MSG_101 \"HIányzó WIM támogatás\"\r\nt MSG_102 \"A rendszered nem képes WIM archívumokat kicsomagolni. A WIM kicsomagolása szükséges az EFI alól bootolható Windows 7 és Windows Vista USB meghajtók készítéséhez. Ezt megoldhatod a 7-Zip aktuális verziójának telepítésével.\\nMeg szeretnéd látogatni a 7-Zip letöltési oldalát?\"\r\nt MSG_103 \"Letöltöd ezt: %s?\"\r\nt MSG_104 \"A(z) %s vagy újabb verziójához telepíteni kell egy '%s' fájlt.\\nMivel ez a fájl nagyobb, mint 100 KB, és mindig szerepel a(z) %s ISO képfájlokban, ezért nincs a Rufusba beépítve.\\n\\nA Rufus letöltheti a hiányzó fájlt:\\n- Válaszd az 'Igen' gombot az internethez történő csatlakozáshoz és a fájl letöltéséhez\\n- Válaszd a 'Nem' gombot, ha magad szeretnéd felmásolni a fájlt a meghajtóra később\\n\\nMegjegyzés: A fájl a jelenlegi mappába lesz letöltve, és ha a(z) '%s' nevű fájl létezik, akkor az automatikusan újra lesz használva.\"\r\nt MSG_105 \"A megszakítás az eszközt HASZNÁLHATATLAN állapotba hozhatja.\\nHa biztosan meg szeretnéd szakítani, kattints az IGEN gombra. Egyébként kattints a NEM gombra.\"\r\nt MSG_106 \"Kérlek, válassz mappát\"\r\nt MSG_107 \"Minden fájl\"\r\nt MSG_108 \"Rufus napló\"\r\nt MSG_109 \"0x%02X (Lemez: %d)\"\r\nt MSG_110 \"Az MS-DOS nem tud bootolni 64 kilobájt klaszterméretű eszközről.\\nKérlek, változtasd meg a klaszterméret beállítást, vagy használj FreeDOS-t.\"\r\nt MSG_111 \"Nem kompatibilis klaszterméret\"\r\nt MSG_112 \"Nagy UDF kötetek formázása sok időt igénybe vehet. USB 2.0 sebességgel számolva a formázás becsült ideje %d:%02d, és addig a folyamat jelző nem változik. Kérlek, légy türelemmel!\"\r\nt MSG_113 \"Nagy UDF kötet\"\r\nt MSG_114 \"Ez a képfájl ezt használja: Syslinux %s%s, de ez az alkalmazás csak a Syslinux %s%s telepítő fájljait tartalmazza.\\n\\nMivel a Syslinux új verziói nem kompatibilisek egymással, és a Rufus sem tartalmazhatja az összes verziót, ezért két további fájlt le kell tölteni az internetről ('ldlinux.sys' és 'ldlinux.bss'):\\n- Válaszd az 'Igen' gombot az internethez történő kapcsolódáshoz, és ezen fájlok letöltéséhez\\n- Válaszd a 'Nem' gombot a művelet megszakításához\\n\\nMegjegyzés: A fájlok a program mappájába lesznek letöltve és automatikusan újra lesznek használva.\"\r\nt MSG_115 \"Letöltés szükséges\"\r\nt MSG_116 \"Ez a képfájl ezt használja: Grub %s, de ez az alkalmazás csak a Grub %s telepítő fájljait tartalmazza.\\n\\nMivel a Grub különböző verziói nem feltétlenül kompatibilisek egymással, és a Rufus sem tartalmazhatja az összes verziót, ezért a Rufus megkísérel találni egy olyan verziót a Grub telepítő fájlból ('core.img'), ami egyezik a képfájlban lévővel:\\n- Válaszd az 'Igen' gombot az internethez történő csatlakozáshoz és a letöltés megkísérléséhez\\n- Válaszd a 'Nem' gombot a Rufus által biztosított, alapértelmezett verzió használatához\\n- Válaszd a 'Mégse' gombot a művelet megszakításához\\n\\nMegjegyzés: A fájl a program mappájába lesz letöltve és automatikusan újra lesz használva, ha létezik. Ha az interneten nincs megegyező verzió, akkor az alapértelmezett verzió lesz használva.\"\r\nt MSG_117 \"Alapértelmezett Windows telepítés\"\r\nt MSG_119 \"Haladó eszköz tulajdonságok\"\r\nt MSG_120 \"Haladó formázási beállítások\"\r\nt MSG_121 \"%s megjelenítése\"\r\nt MSG_122 \"%s elrejtése\"\r\nt MSG_123 \"Tartós partíció mérete\"\r\nt MSG_124 \"Kikapcsolva\"\r\nt MSG_125 \"Állítsd be a tartós partíció méretét a Live USB adathordozóhoz. A méret 0-ra állításával letiltod a tartós partíciót.\"\r\nt MSG_126 \"Állítsd be a partíció méretegységét.\"\r\nt MSG_127 \"Többet ne mutassa ezt az üzenetet\"\r\nt MSG_128 \"Fontos figyelmeztetés erről: %s\"\r\nt MSG_129 \"Egy UEFI:NTFS bootloaderrel rendelkező adathordozót készítettél. Kérlek, ne felejtsd el, hogy a sikeres bootoláshoz, KI KELL KAPCSOLNI A SECURE BOOTOT!\\nHogy ez miért is szükséges, a 'További információk' gombra kattintva elolvashatod.\"\r\nt MSG_130 \"Windows kép kiválasztása\"\r\nt MSG_131 \"Ez az ISO több Windows képet is tartalmaz.\\nKérlek, válaszd ki azt a képet, amelyet használni szeretnél a telepítéshez:\"\r\nt MSG_132 \"Egy másik alkalmazás vagy folyamat használja ezt az eszközt. Így is formázni szeretnéd?\"\r\nt MSG_133 \"A Rufus észlelte, hogy egy 1809-es verziójú ISO alapján kíséreltél meg egy Windows To Go meghajtót készíteni\\n\\nEgy *MICROSOFT HIBA* miatt ez a meghajtó a Windows indulása során össze fog omlani (kék halál), hacsak nem cseréled ki manuálisan a 'WppRecorder.sys' fájlt egy 1803-as verzióra.\\n\\nVedd figyelembe azt is, hogy a Rufus azért nem tudja automatikusan kijavítani ezt, mert a 'WppRecorder.sys' a Microsoft jogvédett fájlja, ezért nem tudjuk törvényesen beágyazni a fájl másolatát az alkalmazásba...\"\r\nt MSG_134 \"Mivel MBR lett kiválasztva partíciós sémaként, a Rufus legfeljebb 2 TB-os partíciót tud létrehozni ezen az adathordozón, amellyel így %s lemezterület elérhetetlenné válik.\\n\\nBiztosan folytatni szeretnéd?\"\r\nt MSG_135 \"Verzió\"\r\nt MSG_136 \"Kiadás\"\r\nt MSG_137 \"Változat\"\r\nt MSG_138 \"Nyelv\"\r\nt MSG_139 \"Architektúra\"\r\nt MSG_140 \"Folytatás\"\r\nt MSG_141 \"Vissza\"\r\nt MSG_142 \"Kérlek, várj...\"\r\nt MSG_143 \"Letöltés böngészővel\"\r\nt MSG_144 \"A Windows ISO fájlok letöltése nem lehetséges, mert a Microsoft módosította a weboldalát, hogy ezt megakadályozza.\"\r\nt MSG_145 \"PowerShell 3.0 vagy újabb szükséges a kód futtatásához.\"\r\nt MSG_146 \"Fel szeretnél lépni az internetre és letölteni?\"\r\nt MSG_148 \"Letöltőkód futtatása...\"\r\nt MSG_149 \"ISO képfájl letöltése\"\r\nt MSG_150 \"A számítógép típusa, amellyel használni szeretnéd ezt a rendszerindító meghajtót. A meghajtó létrehozásának megkezdése előtt a te felelősséged annak eldöntése, hogy a célrendszer BIOS vagy UEFI típusú-e, mivel ellenkező esetben előfordulhat, hogy nem indul el.\"\r\nt MSG_151 \"'UEFI-CSM' azt jelenti, hogy az eszköz csak BIOS emulációs módban ('Legacy Mode'), és nem natív UEFI módban bootol.\"\r\nt MSG_152 \"'nem CSM' azt jelenti, hogy az eszköz csak natív UEFI módban bootol, BIOS emulációs ('Legacy Mode') módban pedig nem.\"\r\nt MSG_153 \"Teszt minta: 0x%02X\"\r\nt MSG_154 \"Teszt minta: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Teszt minta: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Teszt minta: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"A fájlrendszert állítja be\"\r\nt MSG_158 \"A legkisebb méret, amelyet egy adatblokk elfoglal a fájlrendszerben\"\r\nt MSG_159 \"Használd ezt a mezőt a kötetcímke megadásához.\\nA nemzetközi karakterek is elfogadottak.\"\r\nt MSG_160 \"Haladó beállítások megjelenítése/elrejtése\"\r\nt MSG_161 \"Hibás blokkok keresése az eszközön egy teszt minta segítségével\"\r\nt MSG_162 \"Vedd ki innen a pipát a \\\"lassú\\\" formázáshoz\"\r\nt MSG_163 \"A partíciók létrehozásához használt metódus\"\r\nt MSG_164 \"Az USB meghajtó bootolhatóvá tételéhez használt metódus\"\r\nt MSG_165 \"Kattints ide egy képfájl kiválasztásához vagy letöltéséhez...\"\r\nt MSG_166 \"Pipáld be a nemzetközi címkék megjelenítésének engedélyezéséhez, és az eszköz ikon beállításához (egy autorun.inf fájlt készít)\"\r\nt MSG_167 \"Olyan UEFI rendszerbetöltő telepítése, ami elvégzi az adathordozón található fájlok MD5Sum érvényesítését\"\r\nt MSG_169 \"Készíts egy extra rejtett partíciót és próbáld meg a partíciók határait egymáshoz igazítani.\\nEz segíthet a régi BIOS-oknak a boot meghajtókat észlelni.\"\r\nt MSG_170 \"USB-s merevlemezek listázásának engedélyezése. CSAK SAJÁT FELELŐSSÉGRE HASZNÁLD!!!\"\r\nt MSG_171 \"A formázás elkezdése.\\nEz MINDEN ADATOT TÖRÖL az eszközön!\"\r\nt MSG_172 \"Érvénytelen a letöltés aláírása\"\r\nt MSG_173 \"Kattints a kiválasztáshoz...\"\r\nt MSG_174 \"Rufus - A megbízható USB-formázó segédprogram\"\r\nt MSG_175 \"Verzió: %d.%d (Build %d)\"\r\nt MSG_176 \"Magyar fordítás:\\\\line• Csizmadia Gábor <mailto:gabor.csizmadia@hotmail.hu>\\\\line• Viszokai György <mailto:familyguyfan79@gmail.com>\"\r\nt MSG_177 \"Hibák bejelentése és fejlesztések kérése:\"\r\nt MSG_178 \"További jogi információk:\"\r\nt MSG_179 \"Frissítési irányelvek:\"\r\nt MSG_180 \"Ha engedélyezed, hogy a program frissítéseket keressen, akkor elfogadod azt, hogy az alábbi információkat a szerverünkön fogjuk tárolni:\"\r\nt MSG_181 \"Az operációs rendszered architektúrája és verziója\"\r\nt MSG_182 \"A program verziója, amit használsz\"\r\nt MSG_183 \"Az IP címed\"\r\nt MSG_184 \"Használati statisztikák készítése céljából az összegyűjtött információkat megtarthatjuk \\\\b legfeljebb egy évig\\\\b0 . Mi NEM adjuk ki az adataidat más személyeknek.\"\r\nt MSG_185 \"Frissítési folyamat:\"\r\nt MSG_186 \"A Rufus nem telepít vagy futtat háttérben futó szolgáltatásokat, a frissítések ellenőrzése csak akkor történik, amikor az alkalmazás fut.\\\\line\\nTermészetesen a frissítések ellenőrzéséhez internet kapcsolat szükséges.\"\r\nt MSG_187 \"Érvénytelen képfájl a kiválasztott boot opcióhoz\"\r\nt MSG_188 \"A jelenlegi képfájl nem passzol a kiválasztott boot opcióhoz. Kérlek, használj egy másik képfájlt vagy válassz egy másik boot opciót.\"\r\nt MSG_189 \"Ez az ISO képfájl nem kompatibilis a kiválasztott fájlrendszerrel\"\r\nt MSG_190 \"Inkompatibilis meghajtó észlelve\"\r\nt MSG_191 \"Sikeres írás\"\r\nt MSG_192 \"Sikeres olvasás\"\r\nt MSG_193 \"Letöltve: %s\"\r\nt MSG_194 \"Nem sikerült letölteni: %s\"\r\nt MSG_195 \"A(z) %s fájl(ok) beágyazott verziójának használata\"\r\nt MSG_196 \"FONTOS: EZ AZ ESZKÖZ 'NEM SZABVÁNYOS' SZEKTOR MÉRETET HASZNÁL!\\n\\nA hagyományos eszközök szektor mérete 512 bájt, de ennek az eszköznek a szektor mérete %d bájt. Sok esetben ez azt jelenti, hogy NEM lehet bootolni erről az eszközről.\\nA Rufus megpróbálhat egy bootolható meghajtót készíteni, de NINCS RÁ GARANCIA hogy működni fog.\"\r\nt MSG_197 \"'Nem szabványos' szektor méret észlelve\"\r\nt MSG_198 \"'Windows To Go' csak akkor telepíthető GPT típusúra particionált meghajtóra, ha az BEÉPÍTETT megjelölésű. A jelenlegi eszközt nem BEÉPÍTETT megjelölésűnek észleltük.\"\r\nt MSG_199 \"Ez a funkció ezen a platformon nem elérhető.\"\r\nt MSG_201 \"Megszakítás - Kérlek, várj...\"\r\nt MSG_202 \"Képfájl beolvasása...\"\r\nt MSG_203 \"Nem sikerült a képfájlt beolvasni\"\r\nt MSG_204 \"Elavult %s észlelve\"\r\nt MSG_205 \"Képfájl használata: %s\"\r\nt MSG_206 \"Hiányzó fájl: %s\"\r\nt MSG_207 \"Új kötet\"\r\nt MSG_208 \"%d eszközt találtam\"\r\nt MSG_209 \"%d eszközt találtam\"\r\nt MSG_210 \"KÉSZ\"\r\nt MSG_211 \"Megszakítva\"\r\nt MSG_212 \"Sikertelen\"\r\nt MSG_213 \"Az új alkalmazás elindítása...\"\r\nt MSG_214 \"Nem sikerült az új alkalmazást elindítani\"\r\nt MSG_215 \"Megnyitva: %s\"\r\nt MSG_216 \"Mentve: %s\"\r\nt MSG_217 \"Formázás: %s\"\r\nt MSG_218 \"Fájlrendszer készítése: %d/%d feladat kész\"\r\nt MSG_219 \"NTFS Fixup: %d%% kész\"\r\nt MSG_220 \"Formázás (%s) - becsült idő: %d:%02d...\"\r\nt MSG_221 \"Kötetcímke beállítása (%s)...\"\r\nt MSG_222 \"Formázás (%s)...\"\r\nt MSG_223 \"NTFS Fixup (lemezellenőrzés)...\"\r\nt MSG_224 \"MBR/PBR/GPT struktúrák tisztítása...\"\r\nt MSG_225 \"Lemez hozzáférés kérése...\"\r\nt MSG_226 \"Boot rekordok vizsgálata...\"\r\nt MSG_227 \"Létező kötet bezárása...\"\r\nt MSG_228 \"MBR írása...\"\r\nt MSG_229 \"Partíció boot rekord írása...\"\r\nt MSG_230 \"DOS fájlok másolása...\"\r\nt MSG_231 \"ISO fájlok másolása: %s\"\r\nt MSG_232 \"Win7 EFI boot telepítés (%s)...\"\r\nt MSG_233 \"Véglegesítés, kérlek, várj...\"\r\nt MSG_234 \"Syslinux %s telepítése...\"\r\nt MSG_235 \"Hibás blokkok: %s %d/%d - %0.2f%% (%d/%d/%d hiba)\"\r\nt MSG_236 \"Hibás blokkok: Tesztelés véletlen mintával\"\r\nt MSG_237 \"Hibás blokkok: Tesztelés 0x%02X mintával\"\r\nt MSG_238 \"Particionálás (%s)...\"\r\nt MSG_239 \"Partíciók törlése (%s)...\"\r\nt MSG_240 \"A letöltött frissítés aláírása nem érvényesíthető. Ez azt jelentheti, hogy a rendszer helytelenül van konfigurálva aláírás érvényesítéshez, vagy fertőzött letöltést jelezhet.\\n \\nA letöltés törölve lesz. Kérlek, ellenőrizd a naplót további részletekért.\"\r\nt MSG_241 \"Letöltés: %s\"\r\nt MSG_242 \"A fájl letöltése sikertelen.\"\r\nt MSG_243 \"Rufus frissítések keresése...\"\r\nt MSG_244 \"Frissítés: Nem sikerült csatlakozni az internethez\"\r\nt MSG_245 \"Frissítés: Nem sikerült a verzióadatokhoz hozzáférni\"\r\nt MSG_246 \"Elérhető egy új Rufus verzió!\"\r\nt MSG_247 \"Nem található új Rufus verzió\"\r\nt MSG_248 \"Az alkalmazás Windows beállításjegyzékben tárolt kulcsai sikeresen eltávolítva\"\r\nt MSG_249 \"Az alkalmazás Windows beállításjegyzékben tárolt kulcsait nem sikerült eltávolítani\"\r\nt MSG_250 \"%s engedélyezve\"\r\nt MSG_251 \"%s letiltva\"\r\nt MSG_252 \"Méret ellenőrzések\"\r\nt MSG_253 \"Merevlemezek észlelése\"\r\nt MSG_254 \"FAT32 formázás kényszerítése\"\r\nt MSG_255 \"NoDriveTypeAutorun törölve lesz a kilépéskor\"\r\nt MSG_256 \"Hamis eszköz észlelése\"\r\nt MSG_257 \"Joliet támogatás\"\r\nt MSG_258 \"Rock Ridge támogatás\"\r\nt MSG_259 \"Frissítés kényszerítése\"\r\nt MSG_260 \"NTFS tömörítés\"\r\nt MSG_261 \"Képfájl írása: %s\"\r\nt MSG_262 \"ISO támogatás\"\r\nt MSG_263 \"MEGFELELŐ mértékegység használata\"\r\nt MSG_264 \"Mappa törlése: '%s'\"\r\nt MSG_265 \"VMware lemez észlelése\"\r\nt MSG_266 \"Duális UEFI/BIOS mód\"\r\nt MSG_267 \"Windows kép alkalmazása: %s\"\r\nt MSG_268 \"Windows kép alkalmazása...\"\r\nt MSG_269 \"Időbélyegek megtartása\"\r\nt MSG_270 \"USB hibakeresés\"\r\nt MSG_271 \"Képfájl ellenőrző összegének számítása: %s\"\r\nt MSG_272 \"MD5, SHA1 és SHA256 ellenőrzőösszegek kiszámítása a kiválasztott képhez\"\r\nt MSG_273 \"Alkalmazás nyelvének megváltoztatása\"\r\nt MSG_274 \"%s képfájl észlelve\"\r\nt MSG_275 \"A kiválasztott képfájl egy 'ISOHybrid' képfájl. Ez azt jelenti, hogy írható %s (fájlmásolás) módban vagy %s (lemezképfájl) módban.\\nA Rufus a(z) %s mód használatát javasolja, mivel így mindig teljes hozzáférésed lesz a meghajtóhoz az írás után.\\nAzonban, ha bootolás közben hibát észlelsz, akkor megpróbálhatod ezt a képfájlt újraírni %s módban.\\n\\nKérlek, válaszd ki, hogy mely írási módot szeretnéd használni:\"\r\nt MSG_276 \"Írás %s módban (Ajánlott)\"\r\nt MSG_277 \"Írás %s módban\"\r\nt MSG_278 \"Összeütköző folyamatok ellenőrzése...\"\r\nt MSG_279 \"Nem bootolható\"\r\nt MSG_280 \"Lemez vagy ISO képfájl\"\r\nt MSG_281 \"%s (Kérlek, válassz!)\"\r\nt MSG_282 \"Kizárólagos USB meghajtó zárolás\"\r\nt MSG_283 \"Érvénytelen aláírás\"\r\nt MSG_284 \"A letöltött futtatható fájl nem rendelkezik digitális aláírással.\"\r\nt MSG_285 \"A letöltött futtatható fájlt '%s' írta alá.\\nEz egy általunk nem felismert aláírás, és rosszindulatú tevékenységre utalhat...\\nBiztosan futtatni szeretnéd ezt a fájlt?\"\r\nt MSG_286 \"Meghajtó nullázása: %s\"\r\nt MSG_287 \"Nem-USB eltávolítható meghajtók észlelése\"\r\nt MSG_288 \"Hiányzó emelt szintű felhasználói jogok\"\r\nt MSG_289 \"Az alkalmazás csak emelt szintű felhasználói jogokkal tud futni\"\r\nt MSG_290 \"Fájl indexelése\"\r\nt MSG_291 \"Verzió kiválasztása\"\r\nt MSG_292 \"Kérlek, válaszd ki a telepíteni kívánt Windows verziót:\"\r\nt MSG_293 \"Nem támogatott Windows verzió\"\r\nt MSG_294 \"A Rufus már nem támogatja a Windows ezen verzióját.\\nA jelenlegi platformmal kompatibilis utolsó Rufus verzió: v%d.%d.\"\r\nt MSG_295 \"Figyelem: Nem hivatalos verzió\"\r\nt MSG_296 \"A Rufus ezen verzióját nem a hivatalos fejlesztője adta ki.\\n\\nBiztosan futtatni szeretnéd?\"\r\nt MSG_297 \"Csonkított ISO észlelve\"\r\nt MSG_298 \"A kiválasztott ISO képfájl nem egyezik az általa meghatározott mérettel: %s mennyiségű adat hiányzik!\\n\\nHa ezt a fájlt az internetről szerezted be, próbálj meg egy új példányt letölteni, és ellenőrizd, hogy az MD5 vagy SHA ellenőrző összegek megegyeznek-e a hivatalosakkal.\\n\\nVedd figyelembe, hogy a (✓) gombra kattintva kiszámíthatod az MD5 vagy SHA értékeket a Rufusban.\"\r\n# ' gombbal számíthatod ki\"\r\nt MSG_299 \"Időbélyeg érvényesítési hiba\"\r\nt MSG_300 \"A Rufus nem tudta érvényesíteni, hogy a letöltött frissítés időbélyege újabb-e, mint a jelenlegié.\\n\\nEgy esetleges támadást megelőzve a frissítési folyamat meg lett szakítva, és a letöltött fájlok törölve lettek. Kérlek, ellenőrizd a naplót több részletért.\"\r\nt MSG_301 \"Az alkalmazás beállításainak megjelenítése\"\r\nt MSG_302 \"Az alkalmazás névjegyének megjelenítése\"\r\nt MSG_303 \"Napló megjelenítése\"\r\nt MSG_304 \"Lemezkép készítése a kiválasztott eszközről\"\r\nt MSG_305 \"Ezzel a beállítással jelezheted, ha a Windows rendszert egy másik lemezre szeretnéd telepíteni, vagy közvetlenül erről a meghajtóról szeretnéd futtatni a Windows rendszert (Windows To Go).\"\r\nt MSG_306 \"Meghajtó gyors-nullázása: %s\"\r\nt MSG_307 \"ez eltarthat egy kis ideig\"\r\nt MSG_308 \"VHD észlelés\"\r\nt MSG_309 \"Tömörített archívum\"\r\nt MSG_310 \"A kiválasztott ISO képfájl UEFI-t használ, és elég kicsi ahhoz, hogy EFI rendszerpartícióként (ESP) legyen írva. Bizonyos típusú telepítéseknél előnyösebb lehet az ESP-re írás, ahelyett, hogy egy általános adatpartícióra írna, amely a teljes lemezt elfoglalja.\\n\\nKérlek, válaszd ki a módot, amellyel ezt a képet írni szeretnéd:\"\r\nt MSG_311 \"Az engedélyezéshez használd ezt: %s (az alkalmazás főablakában)\"\r\nt MSG_312 \"Extra kivonatok (SHA512)\"\r\nt MSG_313 \"Mentés VHD-re\"\r\nt MSG_314 \"Képfájl ellenőrzőösszegeinek számítása\"\r\nt MSG_315 \"Több gomb\"\r\nt MSG_316 \"Menetek száma\"\r\nt MSG_317 \"Lemezazonosító\"\r\nt MSG_318 \"Alapértelmezett szál prioritás: %d\"\r\nt MSG_319 \"Boot Marker figyelmen kívül hagyása\"\r\nt MSG_320 \"Partíció elrendezés frissítése (%s)...\"\r\nt MSG_321 \"A kiválasztott képfájl egy ISOHybrid képfájl, de a készítői nem tették kompatibilissé az ISO (fájlmásolás) móddal.\\nEmiatt a DD képfájl írási mód lesz kényszerítve.\"\r\nt MSG_322 \"Nem lehet megnyitni vagy olvasni ezt: '%s'\"\r\nt MSG_325 \"Windows testreszabás alkalmazása: %s\"\r\nt MSG_326 \"Felhasználói beállítások alkalmazása...\"\r\nt MSG_327 \"Windows Felhasználói Élmény\"\r\nt MSG_328 \"Testreszabja a Windows telepítést?\"\r\nt MSG_329 \"Követelmény eltávolítása: 4GB+ RAM, Secure Boot és TPM 2.0\"\r\nt MSG_330 \"Követelmény eltávolítása: online Microsoft-fiók\"\r\nt MSG_331 \"Adatgyűjtés letiltása (Adatvédelmi kérdések kihagyása)\"\r\nt MSG_332 \"A belső lemezekhez történő hozzáférés megakadályozása a Windows To Go számára\"\r\nt MSG_333 \"Helyi fiók létrehozása ezzel a felhasználónévvel:\"\r\nt MSG_334 \"A jelenlegi felhasználó területi beállításainak használata\"\r\nt MSG_335 \"BitLocker automatikus eszköz titkosítás letiltása\"\r\nt MSG_336 \"Tartós naplózás\"\r\nt MSG_337 \"A funkció használatához egy további fájlt ('%s') kell letölteni a Microsofttól:\\n- Válaszd az 'Igen' gombot az internethez történő kapcsolódáshoz, és a fájl letöltéséhez\\n- Válaszd a 'Nem' gombot a művelet megszakításához\\n\\nMegjegyzés: A fájl a program mappájába lesz letöltve, és automatikusan újra lesz használva, ha létezik.\"\r\nt MSG_338 \"Visszavont UEFI rendszerbetöltő detektálva\"\r\nt MSG_339 \"A Rufus észlelte, hogy a kiválasztott ISO egy olyan UEFI rendszerbetöltőt tartalmaz, amelyet visszavontak, és ha a Secure Boot engedélyezve van egy teljesen naprakész UEFI rendszeren, akkor ehhez vezet: %s.\\n\\n- Ha ezt az ISO képet nem megbízható forrásból szerezted be, akkor számolnod kell azzal a lehetőséggel, hogy UEFI kártevőt tartalmazhat, és elkerülendő az erről történő rendszerindítás.\\n- Ha megbízható forrásból szerezted be, akkor próbálj meg egy naprakészebb verziót találni, amelyre ez a figyelmeztetés nem jelenik meg.\"\r\nt MSG_340 \"\\\"Security Violation\\\" képernyő\"\r\nt MSG_341 \"Windows helyreállítási képernyő (BSOD / kék halál) ezzel: '%s'\"\r\nt MSG_342 \"Tömörített VHDX képfájl\"\r\nt MSG_343 \"Nem tömörített VHD képfájl\"\r\nt MSG_344 \"Full Flash Update (FFU) képfájl\"\r\nt MSG_345 \"E funkcionalitás használatához néhány további adat letöltése szükséges a Microsofttól:\\n- Válaszd az 'Igen' gombot az internethez történő csatlakozáshoz, és az adatok letöltéséhez\\n- Válaszd a 'Nem' gombot a művelet megszakításához\"\r\nt MSG_346 \"Windows korlátozása S módra (NEM KOMPATIBILIS az online Microsoft-fiók követelmény eltávolításával)\"\r\nt MSG_347 \"Szakértő mód\"\r\nt MSG_348 \"Archív fájlok kibontása: %s\"\r\nt MSG_349 \"Rufus MBR használata\"\r\nt MSG_900 \"A Rufus egy segédprogram, amellyel bootolható USB flash meghajtókat formázhat és készíthet, például USB kulcsokat/pendrive-okat, memóriakártyákat, stb.\"\r\nt MSG_901 \"Hivatalos oldal: %s\"\r\nt MSG_902 \"Forráskód: %s\"\r\nt MSG_903 \"Változási napló: %s\"\r\nt MSG_904 \"Ezen alkalmazás használata a GNU Public License (GPL) 3-as verzió feltételei szerint engedélyezett.\\nTovábbi információ: https://www.gnu.org/licenses/gpl-3.0.html.\"\r\nt MSG_910 \"USB, flash memóriakártyák és virtuális meghajtók formázása FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 fájlrendszerre\"\r\nt MSG_911 \"Bootolható FreeDOS USB meghajtó készítése\"\r\nt MSG_912 \"Bootolható meghajtók készítése bootolható ISO képfájlokból (Windows, Linux, stb.)\"\r\nt MSG_913 \"Bootolható meghajtók készítése bootolható lemez képfájlokból, beleértve a tömörítetteket is\"\r\nt MSG_914 \"BIOS-ból vagy UEFI-ből bootolható meghajtók készítése, beleértve az UEFI-ből bootolható NTFS meghajtókat is\"\r\nt MSG_915 \"'Windows To Go' meghajtók készítése\"\r\nt MSG_916 \"Windows 11 telepítési meghajtók készítése olyan PC-k számára, amelyek nem rendelkeznek TPM vagy Secure Boot funkciókkal\"\r\nt MSG_917 \"Tartós Linux partíciók készítése\"\r\nt MSG_918 \"VHD/DD képfájl készítése a kiválasztott meghajtóról\"\r\nt MSG_919 \"A kiválasztott képfájl MD5, SHA-1, SHA-256 és SHA-512 ellenőrző összegének kiszámítása\"\r\nt MSG_920 \"Hibás blokkok ellenőrzése, beleértve a \\\"hamis\\\" flash meghajtók detektálását\"\r\nt MSG_921 \"Hivatalos Microsoft Windows kiskereskedelmi ISO képfájlok letöltése\"\r\nt MSG_922 \"UEFI Shell ISO képfájlok letöltése\"\r\n\r\n#########################################################################\r\nl \"id-ID\" \"Indonesian (Bahasa Indonesia)\" 0x0421\r\nv 3.22\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Tentang Rufus\"\r\nt IDC_ABOUT_LICENSE \"Lisensi\"\r\nt IDOK \"Oke\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Properti Drive\"\r\nt IDS_DEVICE_TXT \"Perangkat\"\r\nt IDS_BOOT_SELECTION_TXT \"Pilihan Boot\"\r\nt IDC_SELECT \"Pilih\"\r\nt IDS_IMAGE_OPTION_TXT \"Opsi Image\"\r\nt IDS_PARTITION_TYPE_TXT \"Skema partisi\"\r\nt IDS_TARGET_SYSTEM_TXT \"Sistem target\"\r\nt IDC_LIST_USB_HDD \"Daftar USB Hard Drives\"\r\nt IDC_OLD_BIOS_FIXES \"Tambah perbaikan untuk BIOS lama (partisi ekstra, penyesuaian, dll.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Aktifkan validasi media UEFI waktu proses\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Opsi Format\"\r\nt IDS_FILE_SYSTEM_TXT \"Sistem berkas\"\r\nt IDS_CLUSTER_SIZE_TXT \"Ukuran klatser\"\r\nt IDS_LABEL_TXT \"Label volume\"\r\nt IDC_QUICK_FORMAT \"Format cepat\"\r\nt IDC_BAD_BLOCKS \"Periksa blok buruk pada perangkat\"\r\nt IDC_EXTENDED_LABEL \"Buat label dan berkas ikon tambahan\"\r\nt IDCANCEL \"Tutup\"\r\nt IDC_START \"Mulai\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Tutup\"\r\nt IDD_LICENSE \"Lisensi Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Tutup\"\r\nt IDD_LOG \"Catatan\"\r\nt IDC_LOG_CLEAR \"Bersihkan\"\r\nt IDC_LOG_SAVE \"Simpan\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Tutup\"\r\nt IDD_NEW_VERSION \"Periksa Pembaruan - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Versi yang lebih baru telah tersedia. Silakan unduh versi terbaru!\"\r\nt IDC_WEBSITE \"Klik disini untuk pergi ke situs web\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Catatan Rilis\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Unduh\"\r\nt IDC_DOWNLOAD \"Unduh\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Informasi lebih lanjut\"\r\nt IDYES \"Ya\"\r\nt IDNO \"Tidak\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Tutup\"\r\nt IDD_UPDATE_POLICY \"Ketentuan pembaruan dan setelan\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Setelan\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Periksa pembaruan\"\r\nt IDS_INCLUDE_BETAS_TXT \"Sertakan versi beta\"\r\nt IDC_CHECK_NOW \"Periksa Sekarang\"\r\n\r\nt MSG_001 \"Rufus lain terdeteksi\"\r\nt MSG_002 \"Aplikasi Rufus lain sedang berjalan.\\nSilakan tutup aplikasi tersebut dulu sebelum menjalankan yang lain.\"\r\nt MSG_003 \"PERINGATAN: SEMUA DATA PADA PERANGKAT '%s' AKAN DIHAPUS.\\nUntuk melanjutkan operasi ini, klik OKE. Untuk keluar klik BATAL.\"\r\nt MSG_004 \"Ketentuan pembaruan Rufus\"\r\nt MSG_005 \"Apakah Anda ingin mengizinkan Rufus memeriksa pembaruan aplikasi secara online?\"\r\nt MSG_006 \"Tutup\"\r\nt MSG_007 \"Batal\"\r\nt MSG_008 \"Ya\"\r\nt MSG_009 \"Tidak\"\r\nt MSG_010 \"Blok buruk ditemukan\"\r\nt MSG_011 \"Pemeriksaan selesai: %d blok buruk ditemukan\\n  %d kesalahan baca\\n  %d kesalahan tulis\\n  %d kesalahan korupsi\"\r\nt MSG_012 \"%s\\nLaporan lebih lengkap dapat ditemukan di:\\n%s\"\r\nt MSG_013 \"Dinonaktifkan\"\r\nt MSG_014 \"Harian\"\r\nt MSG_015 \"Mingguan\"\r\nt MSG_016 \"Bulanan\"\r\nt MSG_017 \"Kustom\"\r\nt MSG_018 \"Versi Anda: %d.%d (Build %d)\"\r\nt MSG_019 \"Versi terbaru: %d.%d (Build %d)\"\r\nt MSG_020 \"byte\"\r\nt MSG_026 \"byte\"\r\nt MSG_027 \"kilobyte\"\r\nt MSG_028 \"megabyte\"\r\nt MSG_029 \"Standar\"\r\nt MSG_030 \"%s (Standar)\"\r\nt MSG_031 \"BIOS (atau UEFI-CSM)\"\r\nt MSG_033 \"BIOS atau UEFI\"\r\nt MSG_034 \"%d lulus uji\"\r\nt MSG_035 \"%d lulus uji %s\"\r\nt MSG_037 \"Aplikasi\"\r\nt MSG_038 \"Batal\"\r\nt MSG_039 \"Luncurkan\"\r\nt MSG_040 \"Unduh\"\r\nt MSG_041 \"Operasi dibatalkan oleh pengguna\"\r\nt MSG_042 \"Kesalahan\"\r\nt MSG_043 \"Kesalahan: %s\"\r\nt MSG_044 \"Unduh berkas\"\r\nt MSG_045 \"Perangkat Penyimpanan USB (Generic)\"\r\nt MSG_047 \"Banyak Partisi\"\r\nt MSG_049 \"Rufus - Pembatalan\"\r\nt MSG_050 \"Sukses.\"\r\nt MSG_051 \"Kesalahan tidak diketahui saat memformat.\"\r\nt MSG_052 \"Tidak dapat menggunakan sistem berkas terpilih untuk media ini.\"\r\nt MSG_053 \"Akses ke perangkat ditolak.\"\r\nt MSG_054 \"Media terlindungi penulisan.\"\r\nt MSG_055 \"Perangkat ini sedang digunakan oleh proses lain. Silakan tutup semua proses lain yang sedang mengakses perangkat ini.\"\r\nt MSG_056 \"Format cepat tidak tersedia bagi perangkat ini.\"\r\nt MSG_057 \"Label volume tidak sah.\"\r\nt MSG_058 \"Perangkat tidak sah.\"\r\nt MSG_059 \"Ukuran klaster terpilih tidak sah untuk perangkat ini.\"\r\nt MSG_060 \"Ukuran volume tidak sah.\"\r\nt MSG_061 \"Silakan sisipkan media kedalam perangkat.\"\r\nt MSG_062 \"Perintah tidak didukung.\"\r\nt MSG_063 \"Kesalahan pengalokasian memori.\"\r\nt MSG_064 \"Kesalahan baca.\"\r\nt MSG_065 \"Kesalahan tulis.\"\r\nt MSG_066 \"Instalasi gagal\"\r\nt MSG_067 \"Tidak dapat membuka media. Media mungkin sedang digunakan oleh proses lain. Silakan pasang ulang media dan coba lagi.\"\r\nt MSG_068 \"Tidak dapat mempartisi perangkat.\"\r\nt MSG_069 \"Tidak dapat menyalin berkas ke perangkat tujuan.\"\r\nt MSG_070 \"Dibatalkan oleh pengguna.\"\r\nt MSG_071 \"Tidak dapat memulai thread.\"\r\nt MSG_072 \"Pemeriksaan blok buruk tidak selesai.\"\r\nt MSG_073 \"Pemindaian ISO image gagal.\"\r\nt MSG_074 \"Mengekstrak ISO image gagal.\"\r\nt MSG_075 \"Tidak dapat me-mount ulang volume.\"\r\nt MSG_076 \"Tidak dapat menambal/berkas setelan untuk boot.\"\r\nt MSG_077 \"Tidak dapat menetapkan huruf perangkat.\"\r\nt MSG_078 \"Tidak dapat me-mount volume GUID.\"\r\nt MSG_079 \"Perangkat tidak siap.\"\r\nt MSG_080 \"Rufus mendeteksi bahwa Windows masih mem-buffer ke perangkat USB.\\n\\nTergantung pada kecepatan perangkat USB Anda , operasi ini mungkin memakan waktu lama untuk selesai, terutama untuk file besar.\\n\\nKami menyarankan Anda membiarkan Windows selesai, untuk menghindari kerusakan. Tapi jika Anda bosan menunggu, Anda dapat mencabut perangkat...\"\r\nt MSG_081 \"Image tidak didukung\"\r\nt MSG_082 \"Image ini kemungkinan non-bootable, atau menggunakan metode boot atau kompresi yang tidak didukung oleh Rufus...\"\r\nt MSG_083 \"Ganti %s?\"\r\nt MSG_084 \"ISO image ini tampaknya menggunakan versi lawas dari '%s'.\\nMenu Boot mungkin tidak ditampilkan dengan baik karena masalah ini.\\n\\nVersi yang lebih baru dapat diunduh oleh Rufus untuk menyelesaikan masalah ini:\\n- Pilih 'Ya' untuk menyambungkan ke internet dan mengunduh berkas\\n- Pilih 'Tidak' untuk membiarkan berkas ISO yang ada tidak termodifikasi\\nJika Anda tidak mengetahui apa yang harus dilakukan, sebaiknya pilih 'Ya'.\\n\\nCatatan: Berkas baru akan diunduh di direktori saat ini dan karena '%s' sudah ada disana, berkas tersebut akan digunakan kembali secara otomatis.\"\r\nt MSG_085 \"Mengunduh %s\"\r\nt MSG_086 \"Tidak ada image terpilih\"\r\nt MSG_087 \"untuk %s NAND\"\r\nt MSG_088 \"Image terlalu besar\"\r\nt MSG_089 \"Image terlalu besar untuk Target yang dipilih.\"\r\nt MSG_090 \"ISO tidak didukung\"\r\nt MSG_091 \"Ketika menggunakan Tipe Target UEFI, hanya ISO images bootable EFI yang didukung. Silakan pilih ISO bootable EFI atau atur Tipe Target ke BIOS.\"\r\nt MSG_092 \"Sistem berkas tidak didukung\"\r\nt MSG_093 \"PENTING: PERANGKAT INI BERISI BANYAK PARTISI!!\\n\\nPerangkat ini berisi partisi/volume yang tidak tercantum atau bahkan terlihat dari Windows. Jika Anda tetap ingin melanjutkan, Anda bertanggung jawab atas kehilangan data pada partisi tersebut.\"\r\nt MSG_094 \"Banyak partisi terdeteksi\"\r\nt MSG_096 \"Sistem berkas yang saat ini dipilih tidak dapat digunakan dengan tipe ISO ini. Silakan pilih sistem berkas lain atau gunakan ISO yang berbeda.\"\r\nt MSG_097 \"'%s' hanya dapat diterapkan jika sistem berkas NTFS.\"\r\nt MSG_098 \"PENTING: Anda mencoba untuk menginstal 'Windows To Go', namun perangkat target tidak memiliki atribut 'FIXED'. Windows ini kemungkinan akan berhenti saat boot, karena Microsoft tidak merancangnya untuk bekerja dengan perangkat yang tidak memiliki atribut 'REMOVABLE'.\\n\\nApakah Anda tetap ingin melanjutkan?\\n\\nCatatan: Atribut 'FIXED/REMOVABLE' adalah properti hardware yang hanya dapat diubah menggunakan alat kostum dari produsen perangkat. Namun alat ini HAMPIR TIDAK PERNAH disediakan kepada publik...\"\r\nt MSG_099 \"Batasan sistem berkas\"\r\nt MSG_100 \"Image ISO ini berisi berkas yang lebih besar dari 4 GB, yang lebih dari ukuran maksimum yang diperbolehkan untuk sistem file FAT atau FAT32.\"\r\nt MSG_101 \"Dukungan WIM hilang\"\r\nt MSG_102 \"Platform Anda tidak dapat mengekstrak berkas dari arsip WIM. Pengektrakan WIM diperlukan untuk membuat bootable EFI Windows 7 dan Windows Vista di perangkat USB. Anda dapat memperbaikinya dengan mengunduh versi terbaru 7-Zip.\\nApakah Anda ingin mengunjungi halaman unduhan 7-zip?\"\r\nt MSG_103 \"Unduh %s?\"\r\nt MSG_104 \"%s atau yang lebih baru memerlukan berkas '%s' untuk diinstal.\\nKarena berkas ini berukuran lebih dari 100 KB, dan selalu ada pada ISO images %s, berkas ini tidak tersematkan didalam Rufus.\\n\\nRufus dapat mengunduh berkas yang hilang ini untuk Anda:\\n- Pilih 'Ya' untuk menyambungkan ke internet dan mengunduh berkas\\n- Pilih 'Tidak' jika Anda ingin menyalin berkas ini secara manual pada perangkat nanti\\n\\nCatatan: Berkas akan diunduh di direktori saat ini dan karena berkas '%s' sudah ada disana, berkas ini akan digunakan kembali secara otomatis.\"\r\nt MSG_105 \"Membatalkan dapat menyebabkan perangkat TIDAK DAPAT DIGUNAKAN.\\nJika Anda yakin ingin membatalkan, klik YA. Jika tidak ingin, klik TIDAK.\"\r\nt MSG_106 \"Silakan pilih folder\"\r\nt MSG_107 \"Semua berkas\"\r\nt MSG_108 \"Log Rufus\"\r\nt MSG_110 \"MS-DOS tidak dapat boot dari perangkat yang menggunakan ukuran Klaster 64 kilobyte.\\nSilakan ubah ukuran Klaster atau gunakan FreeDOS.\"\r\nt MSG_111 \"Ukuran Klaster tidak kompatibel\"\r\nt MSG_112 \"Memformat volume UDF yang besar memerlukan waktu lama. Di kecepatan USB 2.0, perkiraan durasi memformat sekitar %d:%02d, selama berlangsung bilah kemajuan akan tampak berhenti. Harap bersabar!\"\r\nt MSG_113 \"Volume UDF besar\"\r\nt MSG_114 \"Image ini menggunakan Syslinux %s%s namun aplikasi ini hanya menyertakan berkas instalasi untuk Syslinux %s%s.\\n\\nKarena versi baru Syslinux tidak kompatibel satu dengan lainnya, dan tidak mungkin bagi Rufus untuk menyertakan semuanya, dua berkas tambahan harus diunduh dari Internet ('ldlinux.sys' dan 'ldlinux.bss'):\\n- Pilih 'Ya' untuk menyambungkan ke Internet dan mengunduh berkas tersebut\\n- Pilih 'Tidak' untuk membatalkan operasi\\n\\nCatatan: Berkas akan diunduh di direktori aplikasi saat ini dan akan digunakan kembali secara otomatis jika diminta.\"\r\nt MSG_115 \"Unduh diperlukan\"\r\nt MSG_116 \"Image ini menggunakan Grub %s namun aplikasi ini hanya menyertakan berkas instalasi untuk Grub %s.\\n\\nKarena versi baru Grub tidak kompatibel satu dengan lainnya, dan tidak mungkin bagi Rufus untuk menyertakan semuanya, Rufus akan mencoba mencari versi berkas instalasi Grub ('core.img') yang sesuai dengan image Anda:\\n- Pilih 'Ya' untuk menyambungkan ke Internet dan mencoba untuk mengunduhnya\\n- Pilih 'Tidak' untuk menggunakan versi default dari Rufus\\n- Pilih 'Batal' untuk membatalkan operasi\\n\\nCatatan: Berkas akan diunduh di direktori aplikasi saat ini dan akan digunakan kembali jika diminta. Jika tidak ada yang cocok yang ditemukan secara online, versi default akan digunakan.\"\r\nt MSG_117 \"Instalasi Windows standar\"\r\nt MSG_119 \"properti drive lanjutan\"\r\nt MSG_120 \"opsi format lanjutan\"\r\nt MSG_121 \"Tampilkan %s\"\r\nt MSG_122 \"Sembunyikan %s\"\r\nt MSG_123 \"Ukuran partisi persisten\"\r\nt MSG_124 \"Tanpa persisten\"\r\nt MSG_125 \"Atur ukuran partisi persisten untuk media USB live. Mengatur ukuran ke 0 akan menonaktifkan partisi persisten.\"\r\nt MSG_126 \"Atur unit ukuran pastisi.\"\r\nt MSG_127 \"Jangan tampilkan pesan ini lagi\"\r\nt MSG_128 \"Pemberitahuan penting tentang %s\"\r\nt MSG_129 \"Anda baru saja membuat media yang menggunakan UEFI: NTFS bootloader. Harap diingat bahwa, untuk mem-boot media ini, ANDA HARUS MENONAKTIFKAN SECURE BOOT.\\nUntuk rincian mengapa hal ini perlu dilakukan, lihat tombol 'Informasi lebih lanjut' dibawah.\"\r\nt MSG_130 \"Pemilihan image Windows\"\r\nt MSG_131 \"Berkas ISO ini berisi beberapa image Windows.\\nSilakan pilih image yang ingin Anda gunakan untuk instalasi:\"\r\nt MSG_132 \"Program atau proses lain sedang mengakses drive ini. Apakah Anda tetap ingin memformatnya?\"\r\nt MSG_133 \"Rufus mendeteksi Anda sedang mencoba membuat media Windows To Go berbasis pada ISO 1809.\\n\\nKarena terdapat *MICROSOFT BUG*, media ini akan crash saat proses booting Windows (Blue Screen Of Death), kecuali Anda mengganti secara manual berkas 'WppRecorder.sys' dengan versi 1803.\\n\\nPerhatikan juga bahwa alasan Rufus tidak dapat secara otomatis memperbaikinya untuk Anda adalah bahwa 'WppRecorder.sys' adalah berkas yang dilindungi hak cipta Microsoft, jadi kami tidak dapat secara legal menyematkan salinan berkas tersebut ke dalam aplikasi ...\"\r\nt MSG_134 \"Karena MBR telah dipilih untuk skema partisi ini, Rufus hanya dapat membuat partisi sampai 2 TB pada media ini, yang akan membuat %s ruang disk menjadi tidak tersedia.\\n\\nApakah Anda yakin ingin melanjutkan?\"\r\nt MSG_135 \"Versi\"\r\nt MSG_136 \"Rilis\"\r\nt MSG_137 \"Edisi\"\r\nt MSG_138 \"Bahasa\"\r\nt MSG_139 \"Arsitektur\"\r\nt MSG_140 \"Lanjut\"\r\nt MSG_141 \"Kembali\"\r\nt MSG_142 \"Mohon tunggu...\"\r\nt MSG_143 \"Unduh menggunakan browser\"\r\nt MSG_144 \"Pengunduhan berkas ISO Windows tidak tersedia karena dicekal oleh Microsoft.\"\r\nt MSG_145 \"Diperlukan PowerShell 3.0 atau yang lebih baru untuk menjalankan skrip ini.\"\r\nt MSG_146 \"Apakah Anda ingin mengunduhnya?\"\r\nt MSG_148 \"Menjalankan skrip unduhan...\"\r\nt MSG_149 \"Unduh ISO Image\"\r\nt MSG_150 \"Tipe komputer yang akan menggunakan drive bootable ini. Anda harus menentukan apakah target komputer bertipe BIOS atau UEFI sebelum Anda memulai pembuatan drive ini. Jika salah memilih, drive akan gagal diboot.\"\r\nt MSG_151 \"'UEFI-CSM' artinya perangkat tersebut hanya akan boot dalam mode emulasi BIOS (juga dikenal dengan 'Legacy Mode') di bawah UEFI, dan tidak dalam mode UEFI asli.\"\r\nt MSG_152 \"'non CSM' artinya perangkat tersebut hanya akan boot dalam UEFI asli, dan tidak dalam mode emulasi BIOS (juga dikenal dengan 'Legacy Mode').\"\r\nt MSG_153 \"Tes pola: 0x%02X\"\r\nt MSG_154 \"Tes pola: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Tes pola: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Tes pola: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Atur sistem berkas target\"\r\nt MSG_158 \"Ukuran minimal blok data yang akan menempati sistem berkas\"\r\nt MSG_159 \"Gunakan bidang ini untuk mengatur label perangkat.\\nKarakter internasional diperbolehkan.\"\r\nt MSG_160 \"Tombol untuk opsi lanjutan\"\r\nt MSG_161 \"Periksa blok buruk pada perangkat menggunakan tes pola\"\r\nt MSG_162 \"Hapus centang kotak ini untuk menggunakan metode format \\\"lambat\\\"\"\r\nt MSG_163 \"Metode yang akan digunakan untuk membuat partisi\"\r\nt MSG_164 \"Metode yang akan digunakan untuk membuat perangkat bootable\"\r\nt MSG_165 \"Klik untuk memilih sebuah image...\"\r\nt MSG_166 \"Centang kotak ini untuk menampilkan label internasional dan menyetel ikon perangkat (membuat autorun.inf)\"\r\nt MSG_167 \"Menginstal MBR memungkinkan untuk boot dan dapat memanipulasi ID perangkat USB di BIOS\"\r\nt MSG_168 \"Mencoba menyamarkan perangkat USB bootable pertama (biasanya 0x80) sebagai disk yang berbeda.\\nBiasanya hanya diperlukan jika Anda memasang Windows XP dan memiliki lebih dari satu disk.\"\r\nt MSG_169 \"Membuat partisi tersembunyi tambahan dan memcoba menyelaraskan batas partisi.\\nUpaya ini dapat memperbaiki deteksi boot bagi BIOS versi lama.\"\r\nt MSG_170 \"Aktifkan pencantuman USB Hard Drive enclosures. RESIKO DITANGGUNG ANDA SENDIRI!!!\"\r\nt MSG_171 \"Mulai operasi format.\\nTindakan ini akan MENGHAPUS semua data pada target!\"\r\nt MSG_172 \"Tanda tangan unduhan tidak valid\"\r\nt MSG_173 \"Klik untuk memilih...\"\r\nt MSG_174 \"Rufus - Utilitas Pemformatan USB yang Handal\"\r\nt MSG_175 \"Versi %d.%d (Build %d)\"\r\nt MSG_176 \"Terjemahan Bahasa Indonesia: \\\\line• Abe Akatsuki\\\\line • Arif Budiman <mailto:arifpedia@gmail.com>\"\r\nt MSG_177 \"Laporkan bug atau permintaan perbaikan di:\"\r\nt MSG_178 \"Hak Cipta Tambahan:\"\r\nt MSG_179 \"Ketentuan Pembaruan:\"\r\nt MSG_180 \"Jika Anda memilih untuk mengizinkan program ini memeriksa pembaruan aplikasi, Anda setuju bahwa informasi berikut dapat dikumpulkan pada server kami:\"\r\nt MSG_181 \"Arsitektur dan versi sistem operasi Anda\"\r\nt MSG_182 \"Versi aplikasi yang Anda gunakan\"\r\nt MSG_183 \"Alamat IP Anda\"\r\nt MSG_184 \"Dengan tujuan untuk menghasilkan statistik penggunaan pribadi, kami dapat menyimpan informasi yang dikumpulkan, \\\\b selama satu tahun\\\\b0 . Namun, kami tidak akan pernah memberikan semua data individu ini kepada pihak ketiga.\"\r\nt MSG_185 \"Proses Pembaruan:\"\r\nt MSG_186 \"Rufus tidak memasang atau menjalankan layanan latar belakang, oleh karena itu pemeriksaan pembaruan dapat dilakukan hanya ketika aplikasi utama berjalan.\\\\line\\nAkses internet tentu saja diperlukan bila memeriksa pembaruan.\"\r\nt MSG_187 \"Image tidak sah untuk opsi boot yang dipilih\"\r\nt MSG_188 \"Image saat ini tidak cocok dengan opsi boot yang dipilih. Silakan gunakan image yang lain atau pilih opsi boot yang berbeda.\"\r\nt MSG_189 \"Image ISO ini tidak kompatibel dengan sistem berkas yang dipilih\"\r\nt MSG_190 \"Perangkat tidak kompatibel terdeteksi\"\r\nt MSG_191 \"Tulis berlalu\"\r\nt MSG_192 \"Baca berlalu\"\r\nt MSG_193 \"Diunduh %s\"\r\nt MSG_194 \"Tidak dapat mengunduh %s\"\r\nt MSG_195 \"Menggunakan %s berkas versi tersemat\"\r\nt MSG_196 \"PENTING: PERANGKAT INI MENGGUNAKAN UKURAN SEKTOR YANG TIDAK STANDAR!\\n\\nPerangkat konvensional menggunakan ukuran sektor 512-byte tetapi perangkat ini menggunakan %d-byte. Biasanya, hal ini berarti Anda TIDAK dapat melakukan boot dari perangkat ini.\\nRufus dapat mencoba untuk membuat perangkat bootable, tetapi TIDAK ADA JAMINAN ini akan dapat bekerja.\"\r\nt MSG_197 \"Ukuran sektor tidak standar terdeteksi\"\r\nt MSG_198 \"'Windows To Go' hanya dapat diinstal pada perangkat yang berpartisi GPT yang memiliki atribut FIXED. Perangkat saat ini tidak terdeteksi beratribut FIXED.\"\r\nt MSG_199 \"Fitur ini tidak tersedia pada perangkat ini.\"\r\nt MSG_201 \"Membatalkan - Silakan Tunggu...\"\r\nt MSG_202 \"Memindai image...\"\r\nt MSG_203 \"Gagal memindai image\"\r\nt MSG_204 \"%s usang terdeteksi\"\r\nt MSG_205 \"Menggunakan image: %s\"\r\nt MSG_206 \"Berkas %s hilang\"\r\nt MSG_207 \"Volume Baru\"\r\nt MSG_208 \"%d perangkat ditemukan\"\r\nt MSG_209 \"%d perangkat ditemukan\"\r\nt MSG_210 \"SIAP\"\r\nt MSG_211 \"Dibatalkan\"\r\nt MSG_212 \"Gagal\"\r\nt MSG_213 \"Meluncurkan aplikasi baru...\"\r\nt MSG_214 \"Gagal meluncurkan aplikasi baru\"\r\nt MSG_215 \"Membuka %s\"\r\nt MSG_216 \"Menyimpan %s\"\r\nt MSG_217 \"Memformat: %s\"\r\nt MSG_218 \"Membuat sistem berkas: Tugas %d/%d selesai\"\r\nt MSG_219 \"Perbaikan NTFS: %d%% selesai\"\r\nt MSG_220 \"Memformat (%s) - perkiraan durasi %d:%02d...\"\r\nt MSG_221 \"Menyetel Label (%s)...\"\r\nt MSG_222 \"Memformat (%s)...\"\r\nt MSG_223 \"Perbaikan NTFS (Checkdisk)...\"\r\nt MSG_224 \"Membersihkan struktur MBR/PBR/GPT...\"\r\nt MSG_225 \"Meminta akses disk...\"\r\nt MSG_226 \"Menganalisa boot records yang ada...\"\r\nt MSG_227 \"Menutup volume yang ada...\"\r\nt MSG_228 \"Menulis Master Boot Record...\"\r\nt MSG_229 \"Menulis Partition Boot Record...\"\r\nt MSG_230 \"Menyalin berkas DOS...\"\r\nt MSG_231 \"Menyalin berkas ISO: %s\"\r\nt MSG_232 \"Pengaturan boot EFI Win7 (%s)...\"\r\nt MSG_233 \"Menyelesaikan, silakan tunggu...\"\r\nt MSG_234 \"Menginstal Syslinux %s...\"\r\nt MSG_235 \"Blok Buruk: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\r\nt MSG_236 \"Blok Buruk: Mencoba dengan pola acak\"\r\nt MSG_237 \"Blok Buruk: Mencoba dengan pola 0x%02X\"\r\nt MSG_238 \"Mempartisi (%s)...\"\r\nt MSG_239 \"Menghapus partisi (%s)...\"\r\nt MSG_240 \"Tanda tangan untuk pembaruan yang diunduh tidak dapat divalidasi. Kemungkinan sistem Anda tidak terkonfigurasi dengan benar untuk validasi tanda tangan atau mengindikasikan unduhan berbahaya.\\n\\nUnduhan akan dihapus. Silakan periksa log untuk lebih rinci.\"\r\nt MSG_241 \"Mengunduh: %s\"\r\nt MSG_242 \"Gagal mengunduh berkas.\"\r\nt MSG_243 \"Memeriksa pembaruan Rufus...\"\r\nt MSG_244 \"Pembaruan: Tidak dapat menyambungkan ke internet\"\r\nt MSG_245 \"Pembaruan: Tidak dapat mengakses data versi\"\r\nt MSG_246 \"Versi baru Rufus tersedia!\"\r\nt MSG_247 \"Tidak ada versi baru Rufus yang ditemukan\"\r\nt MSG_248 \"Registry aplikasi berhasil dihapus\"\r\nt MSG_249 \"Gagal menghapus kunci registry aplikasi\"\r\nt MSG_250 \"%s diaktifkan\"\r\nt MSG_251 \"%s dinonaktifkan\"\r\nt MSG_252 \"Periksa ukuran\"\r\nt MSG_253 \"Deteksi Hard disk\"\r\nt MSG_254 \"Format paksa FAT32 yang besar\"\r\nt MSG_255 \"NoDriveTypeAutorun akan dihapus saat keluar\"\r\nt MSG_256 \"Deteksi perangkat palsu\"\r\nt MSG_257 \"Dukungan Joliet\"\r\nt MSG_258 \"Dukungan Rock Ridge\"\r\nt MSG_259 \"Pembaruan Paksa\"\r\nt MSG_260 \"Kompresi NTFS\"\r\nt MSG_261 \"Menulis image: %s\"\r\nt MSG_262 \"Dukungan ISO\"\r\nt MSG_263 \"Gunakan unit ukuran PROPER\"\r\nt MSG_264 \"Menghapus direktori '%s'\"\r\nt MSG_265 \"Deteksi VMWare disk\"\r\nt MSG_266 \"Modus Dual UEFI/BIOS\"\r\nt MSG_267 \"Menerapkan image Windows: %s\"\r\nt MSG_268 \"Menerapkan image Windows...\"\r\nt MSG_269 \"Pertahankan timestamps\"\r\nt MSG_271 \"Menghitung ceksum image: %s\"\r\nt MSG_272 \"Hitung ceksum MD5, SHA1 dan SHA256 pada image yang dipilih\"\r\nt MSG_273 \"Ubah bahasa aplikasi\"\r\nt MSG_274 \"Image %s terdeteksi\"\r\nt MSG_275 \"Image yang Anda pilih merupakan image 'ISOHybrid'. Ini artinya image tersebut dapat ditulis dalam mode %s (salin berkas) atau mode %s (disk image).\\nRufus menyarankan untuk menggunakan mode %s, sehingga Anda tetap memiliki akses pada perangkat setelah menulisnya.\\nNamun, jika Anda menemukan masalah saat boot, Anda bisa mencoba menulis image ini kembali dalam mode %s.\\n\\nSilakan pilih mode mana yang ingin digunakan untuk menulis image ini:\"\r\nt MSG_276 \"Tulis dalam mode %s (Disarankan)\"\r\nt MSG_277 \"Tulis dalam mode %s\"\r\nt MSG_278 \"Memeriksa proses yang konflik...\"\r\nt MSG_280 \"Disk atau ISO image\"\r\nt MSG_281 \"%s (Silakan Pilih)\"\r\nt MSG_282 \"Penguncian perangkat USB khusus\"\r\nt MSG_283 \"Tanda tangan digital tidak valid\"\r\nt MSG_284 \"Berkas exe yang diunduh memiliki tanda tangan digital yang salah.\"\r\nt MSG_285 \"Berkas exe yang diunduh ditandatangani oleh '%s'.\\nTanda tangan ini tidak kami kenali dan bisa menjadi pertanda dari aktivitas berbahaya...\\nApakah Anda yakin ingin menjalankan berkas ini?\"\r\nt MSG_286 \"Mengosongkan perangkat: %s\"\r\nt MSG_287 \"Deteksi selain perangkat USB yang dapat dilepas\"\r\nt MSG_288 \"Hak akses yang tinggi tidak ada\"\r\nt MSG_289 \"Aplikasi ini hanya dapat dijalankan dengan hak akses yang tinggi\"\r\nt MSG_290 \"Pengindeksan Berkas\"\r\nt MSG_291 \"Pilihan versi\"\r\nt MSG_292 \"Silakan pilih versi Windows yang ingin dipasang:\"\r\nt MSG_293 \"Versi Windows Tidak didukung\"\r\nt MSG_294 \"Windows versi ini tidak lagi didukung oleh Rufus.\\nVersi terakhir Rufus yang kompatibel dengan platform ini adalah v%d.%d.\"\r\nt MSG_295 \"Peringatan: Versi tidak resmi\"\r\nt MSG_296 \"Rufus versi ini TIDAK diproduksi oleh pengembang resminya.\\n\\nApakah Anda yakin ingin menjalankannya?\"\r\nt MSG_297 \"Terdeteksi ISO Terpotong\"\r\nt MSG_298 \"Berkas ISO yang Anda pilih tidak sesuai dengan ukuran yang dideklarasikan: %s data hilang!\\n\\nJika Anda mendapatkan berkas ini dari Internet, Anda sebaiknya mengunduh salinan yang baru dan pastikan ceksum MD5 atau SHA cocok dengan yang asli.\\n\\nPerhatikan bahwa Anda dapat menghitung MD5 atau SHA dalam Rufus dengan mengklik tombol (✓).\"\r\nt MSG_299 \"Kesalahan memvalidasi stempel waktu\"\r\nt MSG_300 \"Rufus tidak dapat memvalidasi bahwa stempel waktu pembaruan yang diunduh lebih baru daripada yang sedang dijalankan saat ini. Untuk mencegah kemungkinan skenario serangan, proses pembaruan telah dibatalkan dan unduhan akan dihapus. Silakan periksa log untuk lebih jelasnya.\"\r\nt MSG_301 \"Tampilkan pengaturan aplikasi\"\r\nt MSG_302 \"Tampilkan informasi tentang aplikasi ini\"\r\nt MSG_303 \"Tampilkan log\"\r\nt MSG_304 \"Buat disk image dari perangkat yang dipilih\"\r\nt MSG_305 \"Gunakan opsi ini jika Anda ingin menggunakan perangkat ini untuk memasang Windows pada disk lain, atau jika Anda ingin menjalankan Windows secara langsung dari drive ini (Windows To Go).\"\r\nt MSG_306 \"Pengosongan-cepat perangkat: %s\"\r\nt MSG_307 \"Memerlukan beberapa saat\"\r\nt MSG_308 \"Deteksi VHD\"\r\nt MSG_309 \"Arsip terkompresi\"\r\nt MSG_310 \"ISO yang Anda pilih menggunakan UEFI dan cukup kecil untuk ditulis sebagai Partisi Sistem EFI (ESP). Menulis ke ESP lebih disukai untuk beberapa jenis penginstalan daripada menulis ke partisi data generik yang menempati seluruh disk.\\n\\nPilih mode yang ingin Anda gunakan untuk menulis image ini:\"\r\nt MSG_311 \"Gunakan %s (di jendela aplikasi utama) untuk mengaktifkan.\"\r\nt MSG_312 \"Hash ekstra (SHA512)\"\r\nt MSG_313 \"Simpan ke VHD\"\r\nt MSG_314 \"Hitung checksum image\"\r\nt MSG_315 \"Beberapa tombol\"\r\nt MSG_316 \"Jumlah lulus\"\r\nt MSG_317 \"ID Disk\"\r\nt MSG_318 \"Prioritas utas default: %d\"\r\nt MSG_319 \"Abaikan Penanda Boot\"\r\nt MSG_320 \"Menyegarkan tata letak partisi (%s)...\"\r\nt MSG_321 \"Gambar yang Anda pilih adalah ISOHybrid, tetapi pembuatnya belum membuatnya kompatibel dengan mode salin ISO/Berkas.\\nAkibatnya, mode penulisan DD image akan diberlakukan.\"\r\nt MSG_322 \"Tidak dapat membuka atau membaca '%s'\"\r\nt MSG_325 \"Menerapkan kustomisasi Windows: %s\"\r\nt MSG_326 \"Menerapkan pilihan pengguna...\"\r\nt MSG_327 \"Pengalaman Pengguna Windows\"\r\nt MSG_328 \"Kustomisasi pemasangan Windows?\"\r\nt MSG_329 \"Hilangkan persyaratan untuk RAM 4GB+, Secure Boot dan TPM 2.0\"\r\nt MSG_330 \"Hilangkan persyaratan untuk akun daring Microsoft\"\r\nt MSG_331 \"Matikan fitur koleksi data (Loncati pertanyaan privasi)\"\r\nt MSG_332 \"Cekal Windows To Go dari mengakses penyimpanan internal\"\r\nt MSG_333 \"Buat akun lokal dengan username:\"\r\nt MSG_334 \"Atur pilihan wilayah sama seperti pengguna saat ini\"\r\nt MSG_335 \"Matikan enkripsi perangkat otomatis BitLocker\"\r\nt MSG_336 \"Catatan yang tetap/persistent\"\r\nt MSG_900 \"Rufus adalah alat yang membantu untuk memformat dan membuat perangkat USB flash menjadi bootable, seperti USB flashdisk, kartu memori, dll.\"\r\nt MSG_901 \"Situs resmi: %s\"\r\nt MSG_902 \"Kode Sumber: %s\"\r\nt MSG_903 \"Catatan pergantian: %s\"\r\nt MSG_904 \"Aplikasi ini dilisensikan di bawah ketentuan GNU Public License (GPL) versi 3.\\nLihat https://www.gnu.org/licenses/gpl-3.0.html untuk detail lebih lanjut.\"\r\nt MSG_910 \"Format USB, kartu flash dan penyimpanan maya ke FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Buat perangkat USB FreeDOS yang dapat di boot\"\r\nt MSG_912 \"Buat perangkat yang dapat di boot dari ISO (Windows, Linux, dll.)\"\r\nt MSG_913 \"Buat perangkat yang dapat di boot dari Disk Image, termasuk yang Disk Image yang terkompresi\"\r\nt MSG_914 \"Buat perangkat BIOS atau UEFI yang dapat di boot, termasuk perangkat NTFS yang dapat di boot oleh UEFI\"\r\nt MSG_915 \"Buat perangkat Windows To Go\"\r\nt MSG_916 \"Buat perangkat pemasang Windows 11 untuk PC yang tidak mempunyai TPM atau Secure Boot\"\r\nt MSG_917 \"Buat partisi Linux yang tetap/persistent\"\r\nt MSG_918 \"Buat image VHD/DD dari penyimpanan yang dipilih\"\r\nt MSG_919 \"Hitung checksum MD5, SHA-1, SHA-256 dan SHA-512 dari image yang dipilih\"\r\nt MSG_920 \"Lakukan cek Blok yang buruk, termasuk deteksi USB Flash Disk \\\"PALSU\\\"\"\r\nt MSG_921 \"Unduh ISO Microsoft Windows resmi\"\r\nt MSG_922 \"Unduh Shell ISO UEFI\"\r\n\r\n#########################################################################\r\nl \"it-IT\" \"Italian (Italiano)\" 0x0410, 0x0810\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Info su Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licenza\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Opzioni unità\"\r\nt IDS_DEVICE_TXT \"Dispositivo/unità\"\r\nt IDS_BOOT_SELECTION_TXT \"Tipo boot sistema\"\r\nt IDC_SELECT \"Seleziona\"\r\nt IDS_IMAGE_OPTION_TXT \"Opzioni immagine\"\r\nt IDS_PARTITION_TYPE_TXT \"Tipo schema partizione\"\r\nt IDS_TARGET_SYSTEM_TXT \"Tipo sistema destinazione\"\r\nt IDC_LIST_USB_HDD \"Elenco unità disco USB\"\r\nt IDC_OLD_BIOS_FIXES \"Aggiungi correzioni per vecchi BIOS (partizioni extra, allineamento, etc)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Abilita convalida multimediale UEFI in runtime\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Opzioni formattazione\"\r\nt IDS_CLUSTER_SIZE_TXT \"Dimensione cluster\"\r\nt IDS_LABEL_TXT \"Etichetta volume\"\r\nt IDC_QUICK_FORMAT \"Formattazione rapida\"\r\nt IDC_BAD_BLOCKS \"Test controllo blocchi errati unità\"\r\nt IDC_EXTENDED_LABEL \"Crea etichetta estesa e file icone\"\r\nt IDS_STATUS_TXT \"Stato\"\r\nt IDCANCEL \"Chiudi\"\r\nt IDC_START \"Avvia\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Chiudi\"\r\nt IDD_LICENSE \"Licenza Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Chiudi\"\r\nt IDD_LOG \"Registro eventi\"\r\nt IDC_LOG_CLEAR \"Azzera\"\r\nt IDC_LOG_SAVE \"Salva\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Chiudi\"\r\nt IDD_NEW_VERSION \"Rufus - Controllo aggiornamenti\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"È disponibile una nuova versione. Scarica la versione aggiornata!\"\r\nt IDC_WEBSITE \"Fai clic qui per visitare il sito web\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Informazioni versione\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Altre informazioni\"\r\nt IDYES \"Sì\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Chiudi\"\r\nt IDD_UPDATE_POLICY \"Impostazioni e policy aggiornamenti\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Impostazioni\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Controllo aggiornamenti\"\r\nt IDS_INCLUDE_BETAS_TXT \"Includi versioni beta\"\r\nt IDC_CHECK_NOW \"Controlla ora\"\r\n\r\nt MSG_001 \"Rilevata altra istanza Rufus\"\r\nt MSG_002 \"È in esecuzione un'altra applicazione Rufus.\\nChiudi la prima applicazione prima di eseguirne una seconda.\"\r\nt MSG_003 \"ATTENZIONE: TUTTI I DATI NELL'UNITÀ '%s' SARANNO CANCELLATI.\\nPer continuare seleziona 'OK'. Per annullare seleziona 'ANNULLA'.\"\r\nt MSG_004 \"Policy aggiornamenti Rufus\"\r\nt MSG_005 \"Vuoi permettere a Rufus di controllare gli aggiornamenti online?\"\r\nt MSG_006 \"Chiudi\"\r\nt MSG_007 \"Annulla\"\r\nt MSG_008 \"Sì\"\r\nt MSG_010 \"Rilevato blocco difettoso\"\r\nt MSG_011 \"Controllo completato: trovati %d blocchi difettosi\\n  %d errori lettura\\n  %d errori scrittura\\n  %d errori corruzione\"\r\nt MSG_012 \"%s\\nUn report più dettagliato è disponibile in:\\n%s\"\r\nt MSG_013 \"Disabilitato\"\r\nt MSG_014 \"Giornaliero\"\r\nt MSG_015 \"Settimanale\"\r\nt MSG_016 \"Mensile\"\r\nt MSG_017 \"Personalizzato\"\r\nt MSG_018 \"Versione installata: %d.%d (Build %d)\"\r\nt MSG_019 \"Versione aggiornata: %d.%d (Build %d)\"\r\nt MSG_020 \"byte\"\r\nt MSG_026 \"byte\"\r\nt MSG_027 \"kilobyte\"\r\nt MSG_028 \"megabyte\"\r\nt MSG_029 \"Predefinito\"\r\nt MSG_030 \"%s (predefinito)\"\r\nt MSG_031 \"BIOS (o UEFI CSM)\"\r\nt MSG_033 \"BIOS o UEFI\"\r\nt MSG_034 \"%d passaggio\"\r\nt MSG_035 \"%d passaggi %s\"\r\nt MSG_036 \"Immagine ISO\"\r\nt MSG_037 \"Applicazione\"\r\nt MSG_038 \"Annulla\"\r\nt MSG_039 \"Esegui\"\r\nt MSG_041 \"Operazione annullata dall'utente\"\r\nt MSG_042 \"Errore\"\r\nt MSG_043 \"Errore: %s\"\r\nt MSG_044 \"Download file\"\r\nt MSG_045 \"Unità memorizzazione USB (generica)\"\r\nt MSG_046 \"%s (disco %d) [%s]\"\r\nt MSG_047 \"Partizioni multiple\"\r\nt MSG_048 \"Rufus - Svuotamento buffer\"\r\nt MSG_049 \"Rufus - Cancellazione\"\r\nt MSG_050 \"Operazione completata.\"\r\nt MSG_051 \"Errore sconosciuto durante la formattazione.\"\r\nt MSG_052 \"Impossibile usare il filesystem selezionato.\"\r\nt MSG_053 \"Accesso negato all'unità.\"\r\nt MSG_054 \"Il supporto è protetto da scrittura.\"\r\nt MSG_055 \"L'unità è in uso da un altro processo. Chiudi ogni altro processo che potrebbe accedere all'unità.\"\r\nt MSG_056 \"Formattazione rapida non disponibile per questa unità.\"\r\nt MSG_057 \"Etichetta volume non valida.\"\r\nt MSG_058 \"Il gestore unità non è valido.\"\r\nt MSG_059 \"Dimensione cluster selezionata non valida per questa unità.\"\r\nt MSG_060 \"Dimensione volume non valida.\"\r\nt MSG_061 \"Connetti un supporto nell'unità.\"\r\nt MSG_062 \"È stato ricevuto un comando non supportato.\"\r\nt MSG_063 \"Errore allocazione memoria.\"\r\nt MSG_064 \"Errore lettura.\"\r\nt MSG_065 \"Errore scrittura.\"\r\nt MSG_066 \"Installazione fallita\"\r\nt MSG_067 \"Impossibile aprire il supporto. Potrebbe essere in uso da un altro processo. Riconnetti il supporto e riprova.\"\r\nt MSG_068 \"Impossibile partizionare il disco.\"\r\nt MSG_069 \"Impossibile copiare i file nell'unità destinazione.\"\r\nt MSG_070 \"Annullato dall'utente.\"\r\nt MSG_071 \"Impossibile creare attività formattazione.\"\r\nt MSG_072 \"Controllo blocchi errati non completato.\"\r\nt MSG_073 \"Analisi fallita immagine ISO.\"\r\nt MSG_074 \"Estrazione fallita immagine ISO.\"\r\nt MSG_075 \"Impossibile rimontare l'unità.\"\r\nt MSG_076 \"Impossibile correggere/impostare i file per il boot.\"\r\nt MSG_077 \"Impossibile assegnare una lettera all'unità.\"\r\nt MSG_078 \"Impossibile montare volume GUID.\"\r\nt MSG_079 \"L'unità non è pronta.\"\r\nt MSG_080 \"Rufus ha rilevato che Windows sta ancora svuotando i buffer interni relativi all'unità USB.\\n\\nA seconda della velocità dell'unità USB, questa operazione potrebbe richiedere un certo tempo per essere completata, specialmente per file molto grandi.\\n\\nTi suggeriamo di attendere che Windows completi le operazioni per evitare la corruzione dei dati. Se non vuoi attendere oltre, puoi semplicemente scollegare l'unità...\"\r\nt MSG_081 \"Formato immagine non supportato\"\r\nt MSG_082 \"Questa immagine non è avviabile, o usa un metodo di boot o di compressione non supportato da Rufus...\"\r\nt MSG_083 \"Sostituire %s?\"\r\nt MSG_084 \"Questa immagine sembra che usi una versione obsoleta di '%s'.\\nA causa di ciò il menu di avvio potrebbe non essere visualizzato correttamente.\\n\\nUna nuova versione può essere scaricata da Rufus per correggere questo problema:\\n- Seleziona 'Sì' per collegarsi a internet e scaricare il file\\n- Seleziona 'No' per lasciare inalterato il file immagine ISO\\nIn caso di dubbi, è preferibile selezionare 'Sì'.\\n\\nNota: il nuovo file verrà scaricato nella cartella attuale e una volta scaricato '%s', verrà riusato automaticamente.\"\r\nt MSG_085 \"Download %s\"\r\nt MSG_086 \"Nessuna immagine selezionata\"\r\nt MSG_087 \"per NAND %s\"\r\nt MSG_088 \"Immagine troppo grande\"\r\nt MSG_089 \"Questa immagine è troppo grande per l'unità di destinazione.\"\r\nt MSG_090 \"Formato ISO non supportato\"\r\nt MSG_091 \"Quando usi una destinazione di tipo UEFI, sono supportate solo immagini ISO avviabili EFI. Scegli un'immagine avviabile EFI o imposta una destinazione di tipo BIOS.\"\r\nt MSG_092 \"Filesystem non supportato\"\r\nt MSG_093 \"IMPORTANTE: QUESTA UNITÀ CONTIENE PARTIZIONI MULTIPLE!\\n\\nQuesto può includere partizioni/volumi che non sono elencati anche se visibili da Windows. Se vuoi procedere, sei responsabile per qualsiasi perdita di dati in queste partizioni.\"\r\nt MSG_094 \"Rilevate partizioni multiple\"\r\nt MSG_095 \"Immagine DD\"\r\nt MSG_096 \"Il file system attualmente selezionato non può essere usato con questo tipo di file ISO. Seleziona un differente file system o usa un differente file ISO.\"\r\nt MSG_097 \"'%s' può essere applicato solo se il file system è NTFS.\"\r\nt MSG_098 \"IMPORTANTE: stai tentando di installare 'Windows To Go', ma l'unità destinazione non ha l'attributo 'FISSO'. Windows molto probabilmente si bloccherà durante il boot, poiché non è stato progettato per lavorare con unità che hanno invece l'attributo 'RIMOVIBILE'.\\n\\nVuoi ancora procedere?\\n\\nNota: l'attributo 'FISSO/RIMOVIBILE' è una proprietà hardware che può essere modificata solo usando strumenti personalizzati del produttore dell'unità. Comunque questi strumenti non sono QUASI MAI forniti all'utente...\"\r\nt MSG_099 \"Limitazione filesystem\"\r\nt MSG_100 \"Questa immagine ISO contiene un file più grande di 4 GB, che è superiore alla dimensione massima permessa per il filesystem FAT o FAT32.\"\r\nt MSG_101 \"Supporto WIM mancante\"\r\nt MSG_102 \"Il sistema operativo non può estrarre file dall'archivio WIM. L'estrazione WIM è necessaria per creare una unità USB avviabile EFI Windows 7 e Windows Vista. Puoi correggere ciò installando una versione recente di 7-Zip.\\nVuoi visitare la pagina web da cui scaricare 7-zip?\"\r\nt MSG_103 \"Vuoi scaricare %s?\"\r\nt MSG_104 \"%s o successivo richiedono l'installazione del file '%s'.\\nPoiché questo file è più grande di 100 KB, ed è sempre presente nell'immagine ISO di %s, il file non è incluso in Rufus.\\n\\nRufus può scaricare per te il file mancante:\\n- Seleziona 'Sì' per collegarti a internet e scaricare il file\\n- Seleziona 'No' se vuoi copiare manualmente questo file nell'unità più tardi\\n\\nNota: il file verrà scaricato nella cartella attuale e una volta che '%s' è stato scaricato, verrà riusato automaticamente.\"\r\nt MSG_105 \"La cancellazione potrebbe lasciare il dispositivo in uno stato NON USABILE.\\nSe sei sicuro di volerlo cancellare, seleziona 'SI'. Altrimenti, seleziona 'NO'.\"\r\nt MSG_106 \"Seleziona la cartella\"\r\nt MSG_107 \"Tutti i file\"\r\nt MSG_108 \"Registro eventi Rufus\"\r\nt MSG_109 \"0x%02X (disco %d)\"\r\nt MSG_110 \"Non si può avviare MS-DOS da una unità che usa una dimensione del cluster di 64 kilobyte.\\nModifica la dimensione del cluster o usa FreeDOS.\"\r\nt MSG_111 \"Dimensione cluster incompatibile\"\r\nt MSG_112 \"La formattazione di un volume UDF di grandi dimensioni può richiedere molto tempo. In modo USB 2.0, il tempo stimato per la formattazione sarà di %d:%02d, durante il quale la barra di progresso non verrà aggiornata. Attendi il completamento dell'operazione!\"\r\nt MSG_113 \"Volume UDF di grandi dimensioni\"\r\nt MSG_114 \"Questa immagine usa Syslinux %s%s ma questa applicazione include solo i file di installazione per Syslinux %s%s.\\n\\nPoiché le nuove versioni di Syslinux non sono compatibili con le precedenti e non sarebbe possibile per Rufus includerle tutte, devono essere scaricati da internet due file aggiuntivi ('ldlinux.sys' e 'ldlinux.bss'):\\n- Seleziona 'Sì' per collegarti a internet e scaricare questi due file\\n- Seleziona 'No' per annullare l'operazione\\n\\nNota: questi file verranno scaricati nella cartella corrente dell'applicazione e se presenti verranno riusati automaticamente.\"\r\nt MSG_115 \"Richiede download\"\r\nt MSG_116 \"Questa immagine usa Grub %s ma l'applicazione include solo i file di installazione per Grub %s.\\n\\nQuesta differente versione di Grub potrebbe non essere compatibile con l'altra, e non è possibile includere i file di installazione. Rufus tenterà di trovare una versione dei file di installazione di Grub ('core.img') che corrisponda a quella dell'immagine.\\n- Seleziona 'Sì' per collegarti a internet e tentare il download\\n- Seleziona 'No' per usare la versione predefinita di Rufus\\n- Seleziona 'Annulla' per interrompere l'operazione.\\n\\nNote: i file verranno scaricati nella cartella attuale dell'applicazione e verranno riusati automaticamente se presenti. Se non sarà trovata online nessuna corrispondenza, verrà usata la versione predefinita.\"\r\nt MSG_117 \"Installazione Windows standard\"\r\nt MSG_119 \"opzioni avanzate unità\"\r\nt MSG_120 \"opzioni avanzate formattazione\"\r\nt MSG_121 \"Visualizza %s\"\r\nt MSG_122 \"Nascondi %s\"\r\nt MSG_123 \"Dimensione partizione persistente\"\r\nt MSG_124 \"No persistenza\"\r\nt MSG_125 \"Imposta la dimensione della partizione persistente per il media USB live.\\nImpostando la dimensione a zero disabiliti la partizione persistente.\"\r\nt MSG_126 \"Imposta la dimensione di partizione dell'unità.\"\r\nt MSG_127 \"Non visualizzare più questo messaggio\"\r\nt MSG_128 \"Informazioni importanti su %s\"\r\nt MSG_129 \"Hai appena creato un media che utilizza il bootloader UEFI:NTFS.\\nRicordati che per avviare questo supporto è NECESSARIO DISATTIVARE L'AVVIO PROTETTO.\\nPer i dettagli sul motivo per cui è necessario, seleziona il pulsante 'Altre info'.\"\r\nt MSG_130 \"Selezione immagine Windows\"\r\nt MSG_131 \"Questa immagine ISO contiene più immagini di Windows.\\nSeleziona l'immagine che vuoi usare per questa installazione:\"\r\nt MSG_132 \"Un altro programma o processo sta accedendo a questa unità.\\nVuoi formattare comunque l'unità?\"\r\nt MSG_133 \"Rufus ha rilevato che stai tentando di creare un media 'Windows To Go' basato su una ISO 1809.\\n\\nA causa di un *BUG MICROSOFT*, questo supporto si arresta in modo anomalo durante l'avvio di Windows (Blue Screen Of Death), a meno che non si sostituisca manualmente il file 'WppRecorder.sys' con una versione 1803.\\n\\nNota inoltre che il motivo per cui Rufus non può risolvere automaticamente questo problema è che 'WppRecorder.sys' è un file protetto da copyright di Microsoft, quindi non è possibile incorporare legalmente una copia del file nell'applicazione...\"\r\nt MSG_134 \"Poiché è stato selezionato 'MBR' per lo schema partizione, Rufus può creare su questo supporto solo una partizione fino ad un massimo di 2 TB, che lascerà %s di spazio su disco non disponibile.\\n\\nSei sicuro di voler continuare?\"\r\nt MSG_135 \"Versione\"\r\nt MSG_137 \"Edizione\"\r\nt MSG_138 \"Lingua\"\r\nt MSG_139 \"Architettura\"\r\nt MSG_140 \"Continua\"\r\nt MSG_141 \"Indietro\"\r\nt MSG_142 \"Attendi...\"\r\nt MSG_143 \"Download via browser\"\r\nt MSG_144 \"Il download delle ISO di Windows non è disponibile a causa di Microsoft che ha modificato il proprio sito Web per impedirlo.\"\r\nt MSG_145 \"Per eseguire questo script è necessario PowerShell v. 3.0 o successiva.\"\r\nt MSG_146 \"Vuoi andare online ed effettuare il download?\"\r\nt MSG_148 \"Esecuzione script download...\"\r\nt MSG_149 \"Download immagine ISO\"\r\nt MSG_150 \"Tipo di computer con cui pensi di effettuare il boot. È una tua responsabilità, prima di creare l'unità, identificare se il tipo di sistema destinazione è di tipo BIOS o UEFI. Altrimenti il boot potrebbe fallire.\"\r\nt MSG_151 \"'UEFI CSM' significa che l'unità effettuerà il boot solo in modo emulazione BIOS (conosciuto come 'Legacy Mode') in UEFI, e non in modo nativo UEFI.\"\r\nt MSG_152 \"'non CSM' significa che l'unità effettuerà il modo nativo UEFI, e non in modo emulazione BIOS (conosciuto come 'Legacy Mode').\"\r\nt MSG_153 \"Pattern test: 0x%02X\"\r\nt MSG_154 \"Pattern test: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Pattern test: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Pattern test: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Impostazione filesystem destinazione\"\r\nt MSG_158 \"Dimensione minima blocco dati filesystem\"\r\nt MSG_159 \"Usa questo campo per impostare l'etichetta dell'unità.\\nI caratteri internazionali sono permessi.\"\r\nt MSG_160 \"Abilita/disabilita opzioni avanzate\"\r\nt MSG_161 \"Abilita questa opzione per effettuare un controllo dei blocchi danneggiati nel dispositivo usando un pattern di test\"\r\nt MSG_162 \"Deseleziona questa opzione per usare il metodo di formattazione completo ma 'lento'\"\r\nt MSG_163 \"Metodo che verrà usato per creare le partizioni\"\r\nt MSG_164 \"Metodo che verrà usato per rendere l'unità USB avviabile\"\r\nt MSG_165 \"Fai clic per selezionare o scaricare l'immagine...\"\r\nt MSG_166 \"Abilita questa opzione per permettere la visualizzazione delle etichette internazionali e impostare una icona dispositivo (creerà un file autorun.inf)\"\r\nt MSG_167 \"Installa un MBR che permette la selezione all'avvio e maschera l'ID unità USB del BIOS\"\r\nt MSG_169 \"Crea una partizione aggiuntiva e nascosta e prova ad allineare le diverse partizioni.\\nQuesto può migliorare il rilevamento all'avvio con vecchi BIOS.\"\r\nt MSG_170 \"Abilita il rilevamento per i dischi USB. USALO A TUO RISCHIO!!!\"\r\nt MSG_171 \"Avvia l'operazione di formattazione.\\nQuesta operazione DISTRUGGERÀ qualsiasi dato sull'unità di destinazione!\"\r\nt MSG_172 \"Firma download non valida\"\r\nt MSG_173 \"Fai clic per selezionare...\"\r\nt MSG_174 \"Rufus - Utility affidabile per la formattazione di unità USB\"\r\nt MSG_175 \"Versione %d.%d (build %d)\"\r\nt MSG_176 \"Traduzione italiana a cura di R.B.\"\r\nt MSG_177 \"Segnala i problemi o richiedi nuove funzionalità a:\"\r\nt MSG_178 \"Diritti aggiuntivi:\"\r\nt MSG_179 \"Policy aggiornamenti:\"\r\nt MSG_180 \"Se permetti a questo programma di controllare automaticamente gli aggiornamenti, accetti che le seguenti informazioni saranno catalogate nei nostri server:\"\r\nt MSG_181 \"L'architettura del sistema operativo e la versione\"\r\nt MSG_182 \"La versione dell'applicazione in uso\"\r\nt MSG_183 \"Indirizzo IP\"\r\nt MSG_184 \"Potremmo mantenere le informazioni al solo scopo di creare una statistica privata di utilizzo, \\\\b per massimo un anno\\\\b0 . Comunque ti garantiamo che NON invieremo nessuno di questi dati a nessuna terza parte.\"\r\nt MSG_185 \"Processo aggiornamento:\"\r\nt MSG_186 \"Rufus non installa o esegue servizi in background. Il controllo aggiornamenti verrà effettuato solo quando l'applicazione è in esecuzione.\\\\line\\nQuando si effettua il controllo aggiornamenti è ovviamente richiesto l'accesso ad internet.\"\r\nt MSG_187 \"Immagine non valida per opzione boot selezionata\"\r\nt MSG_188 \"L'immagine selezionata non corrisponde all'opzione boot scelta. Usa un'immagine differente o scegli un'opzione boot differente.\"\r\nt MSG_189 \"Questa immagine non è compatibile con il filesystem selezionato\"\r\nt MSG_190 \"Rilevata unità incompatibile\"\r\nt MSG_191 \"Fase di scrittura\"\r\nt MSG_192 \"Fase di lettura\"\r\nt MSG_193 \"Scaricati %s\"\r\nt MSG_194 \"Impossibile scaricare %s\"\r\nt MSG_195 \"Utilizzo versione integrata dei file %s\"\r\nt MSG_196 \"IMPORTANTE: QUESTA UNITÀ USA UNA DIMENSIONE SETTORI NON STANDARD!\\n\\nLe unità convenzionali usano una dimensione settore di 512 byte ma questa unità usa una dimensione di %d byte. In molti casi, ciò significa che NON potrai effettuare il boot da questa unità.\\nRufus può provare a creare una unità avviabile, ma non c'è NESSUNA GARANZIA che funzionerà.\"\r\nt MSG_197 \"Rilevata dimensione settore non standard\"\r\nt MSG_198 \"'Windows To Go' può essere installato solo su una unità partizionata GPT se ha l'attributo FISSA impostato. L'unità attuale non è stata rilevata come FISSA.\"\r\nt MSG_199 \"Questa caratteristica non è disponibile in questa piattaforma.\"\r\nt MSG_201 \"Annullamento...\"\r\nt MSG_202 \"Analisi immagine...\"\r\nt MSG_203 \"Analisi immagine fallita\"\r\nt MSG_204 \"Rilevato %s obsoleto\"\r\nt MSG_205 \"Uso immagine: %s\"\r\nt MSG_206 \"File %s mancante\"\r\nt MSG_207 \"Nuovo volume\"\r\nt MSG_208 \"Rilevato %d dispositivo\"\r\nt MSG_209 \"Rilevati %d dispositivi\"\r\nt MSG_210 \"PRONTO\"\r\nt MSG_211 \"Annullata\"\r\nt MSG_212 \"Operazione fallita\"\r\nt MSG_213 \"Avvio nuova applicazione...\"\r\nt MSG_214 \"Avvio nuova applicazione fallito\"\r\nt MSG_215 \"Aperto %s\"\r\nt MSG_216 \"Salvato %s\"\r\nt MSG_217 \"Formattazione: %s\"\r\nt MSG_218 \"Creazione filesystem: attività %d/%d completata\"\r\nt MSG_219 \"Correzione NTFS: %d%% completata\"\r\nt MSG_220 \"Formattazione (%s) - durata stimata %d:%02d...\"\r\nt MSG_221 \"Impostazione etichetta (%s)...\"\r\nt MSG_222 \"Formattazione (%s)...\"\r\nt MSG_223 \"Correzione NTFS (controllo disco)...\"\r\nt MSG_224 \"Azzeramento struttura MBR/PBR/GPT...\"\r\nt MSG_225 \"Richiesta accesso disco...\"\r\nt MSG_226 \"Analisi dati avvio...\"\r\nt MSG_227 \"Chiusura volume esistente...\"\r\nt MSG_228 \"Scrittura MBR (Master Boot Record)...\"\r\nt MSG_229 \"Scrittura partizione di avvio...\"\r\nt MSG_230 \"Copia file DOS...\"\r\nt MSG_231 \"Copia file immagine ISO: %s\"\r\nt MSG_232 \"Impostazione avvio EFI Windows 7 (%s)...\"\r\nt MSG_233 \"Finalizzazione...\"\r\nt MSG_234 \"Installazione Syslinux %s...\"\r\nt MSG_235 \"Blocchi danneggiati: %s %d/%d - %0.2f%% (%d/%d/%d errori)\"\r\nt MSG_236 \"Blocchi danneggiati: test con pattern casuali\"\r\nt MSG_237 \"Blocchi danneggiati: test con pattern 0x%02X\"\r\nt MSG_238 \"Partizionamento (%s)...\"\r\nt MSG_239 \"Eliminazione partizioni (%s)...\"\r\nt MSG_240 \"La firma per l'aggiornamento scaricato non può essere validata. Questo può significare che il sistema non è correttamente configurato per la validazione della firma o indica un download non corretto.\\n\\nIl file scaricato verrà eliminato. Per maggiori dettagli consulta il registro eventi.\"\r\nt MSG_241 \"Download: %s\"\r\nt MSG_242 \"Impossibile scaricare il file.\"\r\nt MSG_243 \"Verifica disponibilità aggiornamenti Rufus...\"\r\nt MSG_244 \"Aggiornamento: impossibile collegarsi a internet\"\r\nt MSG_245 \"Aggiornamento: impossibile accedere alle info versione\"\r\nt MSG_246 \"È disponibile una nuova versione di Rufus!\"\r\nt MSG_247 \"La versione installata è aggiornata\"\r\nt MSG_248 \"Registro applicazione correttamente eliminato\"\r\nt MSG_249 \"Impossibile eliminare il registro applicazione\"\r\nt MSG_250 \"Abilitato %s\"\r\nt MSG_251 \"Disabilitato %s\"\r\nt MSG_252 \"Controllo dimensione\"\r\nt MSG_253 \"Rilevamento dischi fissi\"\r\nt MSG_254 \"Forza formattazione FAT32 estesa\"\r\nt MSG_255 \"All'uscita verrà eliminato NoDriveTypeAutorun\"\r\nt MSG_256 \"Rilevamento unità fittizie\"\r\nt MSG_257 \"Supporto Joliet\"\r\nt MSG_258 \"Supporto Rock Ridge\"\r\nt MSG_259 \"Forza aggiornamento\"\r\nt MSG_260 \"Compressione NTFS\"\r\nt MSG_261 \"Scrittura immagine: %s\"\r\nt MSG_262 \"Supporto ISO\"\r\nt MSG_263 \"Usa unità dimensione APPROPRIATA\"\r\nt MSG_264 \"Eliminazione cartella '%s'\"\r\nt MSG_265 \"Rilevamento disco VMWare\"\r\nt MSG_266 \"Modo duale UEFI/BIOS\"\r\nt MSG_267 \"Applicazione immagine Windows: %s\"\r\nt MSG_268 \"Applicazione immagine Windows...\"\r\nt MSG_269 \"Preserva data/ora\"\r\nt MSG_270 \"Debug USB\"\r\nt MSG_271 \"Calcolo checksum immagine: %s\"\r\nt MSG_272 \"Calcola le checksum MD5, SHA1 e SHA256 per l'immagine selezionata\"\r\nt MSG_273 \"Cambia la lingua dell'interfaccia\"\r\nt MSG_274 \"Rilevata immagine %s\"\r\nt MSG_275 \"L'immagine selezionata è un'immagine ISO ibrida. Questo significa che può essere registrata in modo '%s' (copia file) o in modo '%s' (immagine disco).\\nRufus suggerisce di usare il modo '%s', in modo da avere sempre pieno accesso all'unità dopo la scrittura.\\nSe incontri problemi al boot, puoi provare a scrivere questa immagine in modo %s.\\n\\nSeleziona il modo che vuoi usare per scrivere questa immagine:\"\r\nt MSG_276 \"Scrivi in modo %s (suggerito)\"\r\nt MSG_277 \"Scrivi in modo %s\"\r\nt MSG_278 \"Verifica processi in conflitto...\"\r\nt MSG_279 \"Non avviabile\"\r\nt MSG_280 \"File immagine disco o file ISO\"\r\nt MSG_281 \"%s (seleziona)\"\r\nt MSG_282 \"Blocco esclusivo unità USB\"\r\nt MSG_283 \"Firma non valida\"\r\nt MSG_284 \"L'eseguibile scaricato non ha una firma digitale.\"\r\nt MSG_285 \"L'eseguibile scaricato è firmato da '%s'.\\nQuesta non è una firma riconosciuta e potrebbe indicare qualche forma di attività malevola.\\nSei sicuro di voler eseguire questo file?\"\r\nt MSG_286 \"Azzeramento disco: %s\"\r\nt MSG_287 \"Rilevamento di unità rimovibili non USB\"\r\nt MSG_288 \"Privilegi elevati non disponibili\"\r\nt MSG_289 \"Questa applicazione può essere eseguita solo con privilegi elevati\"\r\nt MSG_290 \"Indicizzazione file\"\r\nt MSG_291 \"Selezione versione\"\r\nt MSG_292 \"Seleziona la versione di Windows che vuoi installare:\"\r\nt MSG_293 \"Versione Windows non supportata\"\r\nt MSG_294 \"Questa versione di Windows non è più supportata da Rufus.\\nL'ultima versione di Rufus compatibile con questa piattaforma è v%d.%d.\"\r\nt MSG_295 \"Attenzione: versione non ufficiale\"\r\nt MSG_296 \"Questa versione di Rufus non è stata sviluppata dai suoi sviluppatori ufficiali.\\n\\nSei sicuro di volerla eseguire?\"\r\nt MSG_297 \"Rilevato file ISO troncato\"\r\nt MSG_298 \"Il file ISO selezionato non corrisponde alla dimensione dichiarata: %s dei dati mancanti!\\n\\nSe hai scaricato questo file da internet, prova a scaricarne una nuova copia e verifica che la checksum MD5 o SHA corrisponda alla checksum ufficiale.\\n\\nNota che puoi calcolare in Rufus la checksum cliccando sul pulsante (✓).\"\r\nt MSG_299 \"Errore validazione data/ora\"\r\nt MSG_300 \"Rufus non può validare che la data/ora del pacchetto aggiornamento sia più recente di quelle per l'attuale eseguibile.\\n\\nPer prevenire possibili scenari di un attacco malware, il processo di aggiornamento è stato interrotto e il file scaricato verrà eliminato. Per maggiori dettagli controlla il registro eventi.\"\r\nt MSG_301 \"Visualizza impostazioni applicazione\"\r\nt MSG_302 \"Visualizza informazioni su questa applicazione\"\r\nt MSG_303 \"Visualizza registro eventi\"\r\nt MSG_304 \"Crea un'immagine disco dell'unità selezionata\"\r\nt MSG_305 \"Usa questa opzione per indicare se vuoi usare questa unità per installare Windows in un altro disco, o se vuoi avviare Windows direttamente da questa unità (Windows To Go).\"\r\nt MSG_306 \"Azzeramento veloce unità: %s\"\r\nt MSG_307 \"potrebbe richiedere del tempo\"\r\nt MSG_308 \"Rilevamento VHD\"\r\nt MSG_309 \"Archivio compresso\"\r\nt MSG_310 \"Il file ISO selezionato usa UEFI ed è abbastanza piccolo da poter essere scritto come una partizione di sistema EFI (ESP). Per alcuni tipi di installazione può essere preferibile la scrittura su un ESP, invece di scrivere su una partizione di dati generica che occupa l'intero disco.\\n\\nSeleziona la modalità che vuoi usare per scrivere questa immagine:\"\r\nt MSG_311 \"Per abilitare usa %s (nella finestra principale dell'applicazione).\"\r\nt MSG_312 \"Hash extra (SHA512)\"\r\nt MSG_313 \"Salva in VHD\"\r\nt MSG_314 \"Checksum immagine computer\"\r\nt MSG_315 \"Pulsanti multipli\"\r\nt MSG_316 \"Numero passate\"\r\nt MSG_317 \"ID disco\"\r\nt MSG_318 \"Priorità predefinita thread: %s\"\r\nt MSG_319 \"Ignora marcatore boot\"\r\nt MSG_320 \"Aggiornamento layout partizione (%s)...\"\r\nt MSG_321 \"L'immagine selezionata è una ISO ibrida, ma i suoi creatori non l'hanno resa compatibile con la modalità di copia ISO/file.\\nDi conseguenza, verrà applicata la modalità di scrittura delle immagini DD.\"\r\nt MSG_322 \"Impossibile aprire o leggere '%s'\"\r\nt MSG_325 \"Applicando personalizzazione Windows: %s\"\r\nt MSG_326 \"Applicando opzioni utente...\"\r\nt MSG_327 \"Esperienza utente Windows\"\r\nt MSG_328 \"Personalizzare installazione di Windows?\"\r\nt MSG_329 \"Rimuovi requisiti per 4GB+ RAM, Secure Boot e TPM 2.0\"\r\nt MSG_330 \"Rimuovi requisiti per Microsoft account online\"\r\nt MSG_331 \"Disabilita raccolta dati (salta domande su privacy)\"\r\nt MSG_332 \"Previeni Windows To Go dall'accesso ai dischi interni\"\r\nt MSG_333 \"Crea account locale con nome utente:\"\r\nt MSG_334 \"Imposta opzioni regionali agli stessi valori di questo utente\"\r\nt MSG_335 \"Disabilita la crittografia automatica dei dispositivi BitLocker\"\r\nt MSG_336 \"Log persistente\"\r\nt MSG_337 \"Per utilizzare questa funzionalità è necessario scaricare un file aggiuntivo ('%s') da Microsoft:\\n- Seleziona 'Sì' per connettersi ad internet e scaricarlo\\n- Seleziona 'No' per annullare l'operazione\\n\\nNota: il file verrà scaricato nella cartella dell'applicazione e se presente verrà riutilizzato automaticamente.\"\r\nt MSG_338 \"Rilevato bootloader UEFI revocato\"\r\nt MSG_339 \"Rufus ha rilevato che l'ISO selezionata contiene un bootloader UEFI che è stato revocato e che quando Secure Boot è abilitato su un sistema UEFI completamente aggiornato produrrà %s. \\n\\n- Se hai ottenuto questa immagine ISO da una sorgente non affidabile, dovresti considerare la possibilità che possa contenere malware UEFI ed evitare di eseguire l'avvio da esso.\\n- Se l'hai ottenuto da una sorgente attendibile, dovresti provare a cercare una versione più aggiornata, che non genererà questo avviso.\"\r\nt MSG_340 \"una schermata \\\"Violazione sicurezza\\\"\"\r\nt MSG_341 \"una schermata di ripristino Windows (BSOD) con '%s'\"\r\nt MSG_342 \"Immagine VHDX compressa\"\r\nt MSG_343 \"Immagine VHD non compressa\"\r\nt MSG_344 \"Immagine aggiornamento flash completa\"\r\nt MSG_345 \"Per usare questa funzionalità è necessario scaricare da Microsoft alcuni dati aggiuntivi:\\n- Seleziona 'Sì' per connettersi ad internet e scaricarli\\n- Seleziona 'No' per annullare l'operazione\"\r\nt MSG_346 \"Limita Windows alla modalità S (INCOMPATIBILE con il bypass dell'account online)\"\r\nt MSG_347 \"Modalità esperto\"\r\nt MSG_348 \"Estrazione file archivio: %s\"\r\nt MSG_349 \"Usa MBR Rufus\"\r\nt MSG_900 \"Rufus è un programma che ti aiuta a formattare e creare una unità flash USB avviabile, come una unità USB, memory stick, ecc.\"\r\nt MSG_901 \"Sito ufficiale: %s\"\r\nt MSG_902 \"Codice sorgente: %s\"\r\nt MSG_903 \"Novità: %s\"\r\nt MSG_904 \"Questa applicazione è rilasciata sotto i termini della GNU Public License (GPL) versione 3.\\nVedere https://www.gnu.org/licenses/gpl-3.0.html per dettagli.\"\r\nt MSG_905 \"Avvio\"\r\nt MSG_910 \"Formatta USB, flash card e unità virtuali in FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Crea unità USB avviabili FreeDOS\"\r\nt MSG_912 \"Crea unità avviabili da ISO avviabili (Windows, Linux, ecc.)\"\r\nt MSG_913 \"Crea unità avviabili da immagini disco avviabili, incluse quelle compresse\"\r\nt MSG_914 \"Crea unità avviabili BIOS o UEFI, incluso NTFS avviabile UEFI\"\r\nt MSG_915 \"Crea unità 'Windows To Go'\"\r\nt MSG_916 \"Crea unità di installazione di Windows 11 per PC che non dispongono di TPM o avvio protetto\"\r\nt MSG_917 \"Crea partizioni persistenti Linux\"\r\nt MSG_918 \"Crea immagini VHD/DD dell'unità selezionata\"\r\nt MSG_919 \"Calcola i checksum MD5, SHA-1, SHA-256 e SHA-512 dell'immagine selezionata\"\r\nt MSG_920 \"Esegui controlli dei blocchi danneggiati, incluso il rilevamento di unità flash \\\"false\\\"\"\r\nt MSG_921 \"Scarica le ISO ufficiali di Microsoft Windows\"\r\nt MSG_922 \"Scarica le ISO della shell UEFI\"\r\n\r\n######################################################################\r\nl \"ja-JP\" \"Japanese (日本語)\" 0x0411\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Rufus について\"\r\nt IDC_ABOUT_LICENSE \"ライセンス\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"ドライブ プロパティ\"\r\nt IDS_DEVICE_TXT \"デバイス\"\r\nt IDS_BOOT_SELECTION_TXT \"ブートの種類\"\r\nt IDC_SELECT \"選択\"\r\nt IDS_IMAGE_OPTION_TXT \"イメージ オプション\"\r\nt IDS_PARTITION_TYPE_TXT \"パーティション構成\"\r\nt IDS_TARGET_SYSTEM_TXT \"ターゲット システム\"\r\nt IDC_LIST_USB_HDD \"USB 接続の HDD を一覧表示\"\r\nt IDC_OLD_BIOS_FIXES \"古い BIOS のために修正を追加 (パーティションの拡張、並び替え、その他)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"ランタイムUEFIメディア検証を有効化\"\r\nt IDS_FORMAT_OPTIONS_TXT \"フォーマット オプション\"\r\nt IDS_FILE_SYSTEM_TXT \"ファイル システム\"\r\nt IDS_CLUSTER_SIZE_TXT \"クラスター サイズ\"\r\nt IDS_LABEL_TXT \"ボリューム ラベル\"\r\nt IDC_QUICK_FORMAT \"クイック フォーマット\"\r\nt IDC_BAD_BLOCKS \"不良ブロックを検出\"\r\nt IDC_EXTENDED_LABEL \"機能拡張されたラベルとアイコン ファイルを作成\"\r\nt IDS_STATUS_TXT \"状態\"\r\nt IDCANCEL \"閉じる\"\r\nt IDC_START \"スタート\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"閉じる\"\r\nt IDD_LICENSE \"Rufus のライセンス\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"閉じる\"\r\nt IDD_LOG \"ログ\"\r\nt IDC_LOG_CLEAR \"消去する\"\r\nt IDC_LOG_SAVE \"保存する\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"閉じる\"\r\nt IDD_NEW_VERSION \"アップデートの確認 - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"新しいバージョンを利用できます。新しいバージョンをダウンロードしてください!\"\r\nt IDC_WEBSITE \"ウェブサイトにアクセスするにはここをクリックしてください。\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"リリース ノート\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"ダウンロード\"\r\nt IDC_DOWNLOAD \"ダウンロード\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"詳細情報\"\r\nt IDYES \"はい\"\r\nt IDNO \"いいえ\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"閉じる\"\r\nt IDD_UPDATE_POLICY \"アップデート ポリシーと設定\"\r\nt IDS_UPDATE_SETTINGS_GRP \"設定\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"アップデートの確認\"\r\nt IDS_INCLUDE_BETAS_TXT \"ベータ バージョンを含める\"\r\nt IDC_CHECK_NOW \"今すぐに確認\"\r\n\r\nt MSG_001 \"他のインスタンスを検出しました。\"\r\nt MSG_002 \"Rufus は既に実行されています。\\nもう一度実行する前に既に起動中の Rufus を終了してください。\"\r\nt MSG_003 \"警告: デバイス “%s” のデータは消去されます。\\nこの操作を続けるには [OK] を、終了する場合は [キャンセル] をクリックしてください。\"\r\nt MSG_004 \"Rufus の更新ポリシー\"\r\nt MSG_005 \"オンラインで行われるアップデートの自動確認機能を有効にしますか?\"\r\nt MSG_006 \"閉じる\"\r\nt MSG_007 \"キャンセル\"\r\nt MSG_008 \"はい\"\r\nt MSG_009 \"いいえ\"\r\nt MSG_010 \"不良ブロックを検出しました。\"\r\nt MSG_011 \"検出完了\\n不良ブロックの数: %d\\nリードエラーの数: %d\\nライトエラーの数: %d\\n破損エラーの数: %d\"\r\nt MSG_012 \"%s\\n詳細なレポートは%sで見ることができます。\"\r\nt MSG_013 \"無効\"\r\nt MSG_014 \"毎日\"\r\nt MSG_015 \"毎週\"\r\nt MSG_016 \"毎月\"\r\nt MSG_017 \"カスタム\"\r\nt MSG_018 \"利用中のバージョン: %d.%d (Build %d)\"\r\nt MSG_019 \"最新のバージョン: %d.%d (Build %d)\"\r\nt MSG_020 \"バイト\"\r\nt MSG_026 \"バイト\"\r\nt MSG_027 \"キロバイト\"\r\nt MSG_028 \"メガバイト\"\r\nt MSG_029 \"規定\"\r\nt MSG_030 \"%s (規定)\"\r\nt MSG_031 \"BIOS (または UEFI-CSM)\"\r\nt MSG_032 \"UEFI (CSM 無効)\"\r\nt MSG_033 \"BIOS または UEFI\"\r\nt MSG_034 \"%d パス\"\r\nt MSG_035 \"%d パス %s\"\r\nt MSG_036 \"ISO イメージ\"\r\nt MSG_037 \"アプリケーション\"\r\nt MSG_038 \"中止\"\r\nt MSG_039 \"開始\"\r\nt MSG_040 \"ダウンロード\"\r\nt MSG_041 \"操作はユーザーによりキャンセルされました。\"\r\nt MSG_042 \"エラー\"\r\nt MSG_043 \"エラー: %s\"\r\nt MSG_044 \"ファイルダウンロード\"\r\nt MSG_045 \"USB 記憶装置 (汎用)\"\r\nt MSG_046 \"%s (ディスク %d) [%s]\"\r\nt MSG_047 \"複数のパーティション\"\r\nt MSG_048 \"Rufus - バッファを消去中\"\r\nt MSG_049 \"Rufus - キャンセル中\"\r\nt MSG_050 \"成功しました。\"\r\nt MSG_051 \"フォーマット中に判別できないエラーが起きました。\"\r\nt MSG_052 \"選択したシステムはこのメディアに使えません。\"\r\nt MSG_053 \"このデバイスへのアクセスは拒否されました。\"\r\nt MSG_054 \"メディアは書き込み禁止です。\"\r\nt MSG_055 \"デバイスは他のプロセスで使われています。デバイスにアクセスしているプロセスを停止してください。\"\r\nt MSG_056 \"このデバイスはクイック フォーマットできません。\"\r\nt MSG_057 \"ボリューム ラベルは無効です。\"\r\nt MSG_058 \"デバイス ハンドルは無効です。\"\r\nt MSG_059 \"選択されたクラスター サイズはこのデバイスには無効です。\"\r\nt MSG_060 \"ボリューム サイズは無効です。\"\r\nt MSG_061 \"ドライブにリムーバブル メディアを挿入してください。\"\r\nt MSG_062 \"非対応コマンドを受け取りました。\"\r\nt MSG_063 \"メモリ割り当てエラー\"\r\nt MSG_064 \"読み込みエラー\"\r\nt MSG_065 \"書き込みエラー\"\r\nt MSG_066 \"インストールに失敗\"\r\nt MSG_067 \"メディアを開けませんでした。他のプログラムで使われている可能性があります。もう一度接続し、やり直してください。\"\r\nt MSG_068 \"ドライブのパーティション設定中にエラーが発生しました。\"\r\nt MSG_069 \"ファイルをターゲット ドライブへコピーできませんでした。\"\r\nt MSG_070 \"ユーザーによってキャンセルされました。\"\r\nt MSG_071 \"スレッドを開始できません。\"\r\nt MSG_072 \"不良ブロックの検出処理が完了しませんでした。\"\r\nt MSG_073 \"ISO イメージのスキャンに失敗しました。\"\r\nt MSG_074 \"ISO イメージからの抽出に失敗しました。\"\r\nt MSG_075 \"ボリュームを再マウントできません。\"\r\nt MSG_076 \"ファイルへブート用パッチを当てられません。\"\r\nt MSG_077 \"ドライブ レターを割り振れません。\"\r\nt MSG_078 \"GUID ボリュームをマウントできません。\"\r\nt MSG_079 \"デバイスの準備ができていません。\"\r\nt MSG_080 \"Windows が内部バッファから USB デバイスに書き込み中であることを検出しました。\\n\\n特に大きなファイルの場合、 USB デバイスのスピードによっては、この操作に時間がかかるかもしれません。\\n\\nファイル破損を避けるためには、作業完了まで待つことを推奨しますが、デバイスを取り外すこともできます。\"\r\nt MSG_081 \"非対応のイメージです。\"\r\nt MSG_082 \"このイメージはブート非対応あるいは Rufus でサポートされていないブート方式、圧縮方式を使用しています。\"\r\nt MSG_083 \"%sを置き換えますか?\"\r\nt MSG_084 \"この ISO は “%s” の古いバージョンを使用するようです。\\nブートメニューが正しく表示できないかもしれません。\\n\\nこの問題を解決するために新しいバージョンをダウンロードできます。\\n- インターネットに接続し、ファイルをダウンロードするには [はい] をクリックしてください。\\n- 既存のISOを変更しない場合は [いいえ] をクリックしてください。\\nどうしたらよいかわからない場合は [はい] をクリックすることを推奨します。\\n\\n注意: 新しいファイルは現在のフォルダーにダウンロードされます。すでに “%s” のファイルがある場合は自動的に再利用します。\"\r\nt MSG_085 \"%s をダウンロード中\"\r\nt MSG_086 \"イメージが選択されていません。\"\r\nt MSG_087 \"(%s NAND 用)\"\r\nt MSG_088 \"イメージが大きすぎます。\"\r\nt MSG_089 \"イメージが選択したターゲットには大きすぎます。\"\r\nt MSG_090 \"非対応の ISO です。\"\r\nt MSG_091 \"UEFI ターゲット タイプを使用する場合、EFI でブート可能な ISO だけがサポートされています。 EFI でブート可能な ISO を選択するか、 BIOS の設定でターゲット タイプを設定し直してください。\"\r\nt MSG_092 \"このファイル システムには非対応です。\"\r\nt MSG_093 \"重要: このドライブは複数のパーティションを含んでいます!! \\n\\nWindows が認識できないあるいはリスト化できないパーティションやボリュームが存在する可能性があります。続行する場合、これらのパーティションでのデータ損失の責任はユーザーにあります。\"\r\nt MSG_094 \"複数のパーティションを検出しました。\"\r\nt MSG_095 \"DD イメージ\"\r\nt MSG_096 \"現在の選択されたファイル システムではこの ISO を使用することができません。別のファイル システムか別の ISO を使用してください。\"\r\nt MSG_097 \"ファイル システムが NTFS の場合のみ “%s” は適用可能です。\"\r\nt MSG_098 \"注意: Windows To Go をインストールしようとしていますが、ターゲット ドライブは “FIXED” 属性を持ちません。“REMOVABLE” 属性があるドライブで動作するように Microsoft は Windows を設計していないため、Windows のブート中にフリーズする可能性が高くなります。\\n\\n続けてよろしいですか?\\n\\n注意: “FIXED/REMOVABLE” 属性は、ハードウェア固有のプロパティで製造メーカーからのツール等でのみ変更可能ですが、残念ながらそのようなツールは全くと言っていいほど公開されていません。\"\r\nt MSG_099 \"ファイル システム制限\"\r\nt MSG_100 \"ISO イメージに 4 GB より大きなファイルがあります。FAT、FAT32 ファイル システムで使用可能な最大のサイズを超えています。\"\r\nt MSG_101 \"WIM のサポートがありません\"\r\nt MSG_102 \"利用中のこの環境では WIM ファイルからファイルを抽出できません。EFI でのブートを必要とする Windows 7 と Windows Vista 用の USB ドライブを作るためには、WIM ファイルを展開できる必要があります。最近のバージョンの 7-Zip で展開することができます。\\n7-Zip のダウンロード ページを開きますか?\"\r\nt MSG_103 \"%s をダウンロードしますか?\"\r\nt MSG_104 \"%s またはそれ以後のバージョンは “%s” ファイルがインストールされている必要があります。\\nこのファイルは 100 KB より大きいので Rufus に内蔵していません。%s に ISO イメージが常時あるためです。\\n\\nRufus で不足しているファイルをダウンロードすることができます。\\n- インターネットに接続し、ファイルをダウンロードするには [はい] を選択してください。\\n- 後でファイルをドライブに置いて手動でコピーする場合は [いいえ] を選択してください。\\n\\n注意:ファイルは現在のディレクトリへダウンロードされます。“%s” が既にディレクトリにある場合、自動的に再使用します。\"\r\nt MSG_105 \"キャンセルするとデバイスは使用不可能になるかもしれません。\\nキャンセルするには [はい] を、そうではない場合は [いいえ] をクリックしてください。\"\r\nt MSG_106 \"フォルダーを選択してください。\"\r\nt MSG_107 \"全てのファイル\"\r\nt MSG_108 \"Rufus のログ\"\r\nt MSG_109 \"0x%02X (ディスク %d)\"\r\nt MSG_110 \"MS-DOS はクラスター サイズが 64 キロバイトのドライブからブートできません。\\nクラスター サイズを変更、または FreeDOS を使用してください。\"\r\nt MSG_111 \"互換性のないクラスター サイズ\"\r\nt MSG_112 \"大きな UDF ボリュームをフォーマットするには時間がかかります。USB2.0 接続の場合、フォーマット完了までの推定時間は %d:%02d です。この間、プログレス バーは進んでいないように見えます。終了までしばらくお待ちください。\"\r\nt MSG_113 \"大きな UDF ボリューム\"\r\nt MSG_114 \"このイメージは Syslinux %s%s を使用しますが、このアプリケーションには Syslinux %s%s のインストールファイルのみ内蔵しています。\\n\\n新しいバージョンの Syslinux は古い Syslinux と完全な互換性はありません。Rufus にすべてのバージョンの Syslinux データを含むことはできないため、インターネットから 2 つのファイル (ldlinux.sys と ldlinux.bss) を追加でダウンロードする必要があります。\\n- インターネットに接続し、ファイルをダウンロードするには [はい] を選択してください。\\n- 取り消したい場合は [いいえ] を選択してください。\\n\\n注意: ファイルは現在のディレクトリへダウンロードされます。ファイルが既に現在のディレクトリにある場合はダウンロードせず自動的に再使用されます。\"\r\nt MSG_115 \"ダウンロードが必要です\"\r\nt MSG_116 \"このイメージは Grub %s を使用しますが、このアプリケーションには Grub %s のインストールファイルのみ内蔵しています。\\n\\nそれぞれのバージョンの Grub は他のバージョンの Grub と完全な互換性はありません。イメージに適合したバージョンの Grub インストール ファイル (core.img) を探すことができます。\\n- インターネットに接続し、ダウンロードを試行するには [はい] を選択してください。\\n- Rufus のデフォルトのバージョンを使用する場合は [いいえ] を選択してください。\\n- この操作を中止する場合は [キャンセル] を選択してください。\\n\\n注意: ファイルは現在のディレクトリへダウンロードされます。ファイルが既に現在のディレクトリにある場合はダウンロードせず自動的に再使用されます。\\n適合するバージョンがオンラインで見つからなかった場合は内蔵しているバージョンの Grub が使用されます。\"\r\nt MSG_117 \"標準の Windows インストール\"\r\nt MSG_119 \"詳細なドライブ プロパティ\"\r\nt MSG_120 \"詳細なフォーマット オプション\"\r\nt MSG_121 \"%s を表示\"\r\nt MSG_122 \"%s を隠す\"\r\nt MSG_123 \"保存領域のサイズ\"\r\nt MSG_124 \"保存領域なし\"\r\nt MSG_125 \"ライブ USB メディアの保存領域のサイズを設定します。 サイズを 0 に設定すると保存領域が無効になります。保存領域は「Persistent パーティション」「Persistence 機能」とも言われます。\"\r\nt MSG_126 \"パーティション サイズの単位を設定します。\"\r\nt MSG_127 \"次回からこのメッセージを表示しない\"\r\nt MSG_128 \"%s に関する重要なお知らせ\"\r\nt MSG_129 \"UEFI:NTFS ブートローダーを使用するメディアを作成しました。 このメディアを起動するには、セキュアブートを無効にする必要があります。\\nこの変更が必要な理由については、下の [詳細情報] から確認してください。\"\r\nt MSG_130 \"Windows イメージの選択\"\r\nt MSG_131 \"この ISO には複数の Windows イメージが含まれます。\\nこのインストールに使用したいイメージを選択してください。\"\r\nt MSG_132 \"別のプログラムまたはプロセスがこのドライブにアクセスしています。このままフォーマットしますか?\"\r\nt MSG_133 \"1809 バージョンの ISO を使用して Windows To Go のメディアを作成しようとしていることを検出しました。\\n\\nこのメディアは、“WppRecorder.sys” を 1803 バージョンのファイルに手動で置き換えない限り、Windowsのブート中にクラッシュ (ブルースクリーン) します。これは * Microsoftのバグ * によるものです。\\n\\n“WppRecorder.sys” は Microsoft の著作権で保護されたファイルであり、アプリケーションにファイルのコピーを合法的に埋め込めないため、Rufus が自動的にこの不具合を修正することはできません。\"\r\nt MSG_134 \"パーティション構成に MBR が選択されているため、Rufus はこのメディア上に最大 2 TB のパーティションしか作成できません。そのため、％s のディスク容量が使用できなくなります。\\n\\n続けますか?\"\r\nt MSG_135 \"バージョン\"\r\nt MSG_136 \"リリース\"\r\nt MSG_137 \"エディション\"\r\nt MSG_138 \"言語\"\r\nt MSG_139 \"アーキテクチャ\"\r\nt MSG_140 \"続ける\"\r\nt MSG_141 \"戻る\"\r\nt MSG_142 \"お待ちください...\"\r\nt MSG_143 \"ブラウザーを使ってダウンロードする\"\r\nt MSG_144 \"リクエストが多すぎたため Microsoft が一時的にダウンロードを禁止しました - しばらくしてからもう一度お試しください...\"\r\nt MSG_145 \"このスクリプトの実行には PowerShell 3.0 以降が必要です。\"\r\nt MSG_146 \"ネットワークに接続してダウンロードしますか?\"\r\nt MSG_148 \"ダウンロード スクリプトを実行中...\"\r\nt MSG_149 \"ISO イメージのダウンロード\"\r\nt MSG_150 \"このブート用ドライブを使用する予定のコンピューターの種類です。\\n起動に失敗する可能性を減らすため、ドライブの作成を開始する前にターゲットが BIOS と UEFI のどちらの形式を使うかを確認してください。\"\r\nt MSG_151 \"UEFI-CSM では UEFI モードではなく、UEFI 環境下での BIOS エミュレーション モード (レガシー モード) でのみデバイスを起動することができます。\"\r\nt MSG_152 \"CSM が無効な環境では UEFI 環境下での BIOS エミュレーション モード (レガシー モード) ではなく、 UEFI モードでのみデバイスを起動することができます。\"\r\nt MSG_153 \"テスト パターン: 0x%02X\"\r\nt MSG_154 \"テスト パターン: 0x%02X, 0x%02X\"\r\nt MSG_155 \"テスト パターン: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"テスト パターン: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"ターゲット ドライブに設定するファイル システムです。\"\r\nt MSG_158 \"ファイル システム内で使用するデータ ブロックの最小サイズです。\"\r\nt MSG_159 \"ここでドライブのラベルを設定可能です。\\n各国の文字が使用できます。\"\r\nt MSG_160 \"詳細設定に切り替えます。\"\r\nt MSG_161 \"テスト パターンで不良ブロックを検出するにはチェック ボックスをオンにします。\"\r\nt MSG_162 \"“クイックではない”フォーマットをするにはチェック ボックスをオフにします。\"\r\nt MSG_163 \"パーティションの作成方法です。\"\r\nt MSG_164 \"ドライブを起動可能にするために使用する方法です。\"\r\nt MSG_165 \"イメージを選択するか、イメージをダウンロードするにはここをクリックしてください。\"\r\nt MSG_166 \"機能拡張されたラベルの表示とデバイス アイコンの設定を有効するにはこのチェック ボックスをオンにします。“autorun.inf” を作成します。\"\r\nt MSG_167 \"MD5チェックサム検証を行うUEFIブートローダーをインストールします。\"\r\nt MSG_169 \"特別な隠しパーティションを作成し、各パーティションの位置合わせを行います。\\n古い BIOS を使用する場合にブート時の検出を改善できます。\"\r\nt MSG_170 \"外付け USB HDD のリストを有効にします。自己責任で使用してください。\"\r\nt MSG_171 \"フォーマットを始めます。\\nターゲット ドライブのデータは全て破棄されます。\"\r\nt MSG_172 \"無効なデジタル署名です。\"\r\nt MSG_173 \"選択するにはクリックしてください。\"\r\nt MSG_174 \"Rufus - 信頼性の高い USB フォーマット ユーティリティ\"\r\nt MSG_175 \"バージョン %d.%d (Build %d)\"\r\nt MSG_176 \"日本語翻訳:\\\\line• チャンテラ・ジャクソン <mailto:chantella-eng@live.com>\\\\line• Tiryoh <mailto:tiryoh+rufus@gmail.com>\\\\line• 五月雨 <mailto:samidare3desu@gmail.com>\"\r\nt MSG_177 \"バグの報告、お問い合わせ等はこちらから:\"\r\nt MSG_178 \"各種著作権: \"\r\nt MSG_179 \"アップデート ポリシー: \"\r\nt MSG_180 \"このアプリケーションのアップデート確認を許可した場合、\\\\line以下の情報をサーバーに送信することに同意します。\"\r\nt MSG_181 \"ご使用中の OS の種類とバージョン\"\r\nt MSG_182 \"ご使用中の Rufus のバージョン\"\r\nt MSG_183 \"IP アドレス\"\r\nt MSG_184 \"利用統計を作るために、\\\\line収集した情報は\\\\b最大で一年間\\\\b0 保管する場合があります。 \\\\lineただし、そのデータを安易に第三者へ開示することはありません。\"\r\nt MSG_185 \"アップデートの方法: \"\r\nt MSG_186 \"Rufus は、本アプリケーション実行時のみアップデートの確認を行います。インストールまたはバックグラウンド サービスを実行して処理を行うことは一切ありません。\\\\line\\nまた、アップデートの確認にはインターネット接続が必要です。\"\r\nt MSG_187 \"選択したブート設定には無効なイメージです。\"\r\nt MSG_188 \"現在選択中のイメージとブート設定が一致しません。別のイメージを使うか、他のブート設定を使用してください。\"\r\nt MSG_189 \"この ISO は選択中のファイル システムと互換性がありません。\"\r\nt MSG_190 \"互換性のないドライブが検出されました。\"\r\nt MSG_191 \"書き込み中\"\r\nt MSG_192 \"読み出し中\"\r\nt MSG_193 \"%s をダウンロードしました。\"\r\nt MSG_194 \"%s はダウンロードできませんでした。\"\r\nt MSG_195 \"内蔵している %s ファイルを使用します。\"\r\nt MSG_196 \"重要: このドライブは標準以外のセクタ サイズを使用しています!\\n\\n従来のドライブは、512 バイトのセクタ サイズを使用しますが、このドライブは %d バイトを使用しています。多くの場合、このようなドライブからブートできません。\\nこのままブート用ドライブを作成しようとしますが、動作保証はありません。\"\r\nt MSG_197 \"標準以外のセクタサイズが検出されました。\"\r\nt MSG_198 \"“FIXED” 属性が設定されている場合に限り、 GPT パーティションのドライブに Windows To Go をインストールすることができます。 現在のドライブは FIXED として検出されませんでした。\"\r\nt MSG_199 \"この機能は、このプラットフォームでは利用できません。\"\r\nt MSG_201 \"キャンセル中 - お待ちください...\"\r\nt MSG_202 \"イメージをスキャン中...\"\r\nt MSG_203 \"イメージのスキャンに失敗\"\r\nt MSG_204 \"廃止された %s を検出しました\"\r\nt MSG_205 \"%s を使用中\"\r\nt MSG_206 \"ファイルが見つかりません: %s\"\r\nt MSG_207 \"新しいボリューム ラベル\"\r\nt MSG_208 \"%d 個のデバイスを検出しました。\"\r\nt MSG_209 \"%d 個のデバイスを検出しました。\"\r\nt MSG_210 \"準備完了\"\r\nt MSG_211 \"キャンセル\"\r\nt MSG_212 \"失敗しました。\"\r\nt MSG_213 \"更新されたアプリケーションを開始中...\"\r\nt MSG_214 \"更新されたアプリケーションを開始することができませんでした。\"\r\nt MSG_215 \"%s を開きました。\"\r\nt MSG_216 \"%s を保存しました。\"\r\nt MSG_217 \"フォーマット中: %s\"\r\nt MSG_218 \"ファイル システムを作成中: %d/%d のタスクが完了\"\r\nt MSG_219 \"NTFS 修正中: %d%% 完了\"\r\nt MSG_220 \"フォーマット中 (%s) - 残り約 %d:%02d...\"\r\nt MSG_221 \"ラベル作成中 (%s)...\"\r\nt MSG_222 \"フォーマット中 (%s)...\"\r\nt MSG_223 \"NTFS の修正が必要か確認中 (チェックディスク)...\"\r\nt MSG_224 \"MBR/PBR/GPT 構造のクリーニング中...\"\r\nt MSG_225 \"ディスク アクセスを要求しています...\"\r\nt MSG_226 \"ブート レコードを分析してます...\"\r\nt MSG_227 \"ボリュームを閉じています...\"\r\nt MSG_228 \"マスター ブート レコードを書き込んでいます...\"\r\nt MSG_229 \"パーティション ブート レコードを書き込んでいます...\"\r\nt MSG_230 \"DOS ファイルをコピー中...\"\r\nt MSG_231 \"ISO ファイルをコピー中: %s\"\r\nt MSG_232 \"Win7 EFI ブート セットアップ中 (%s)...\"\r\nt MSG_233 \"最終処理中です。もう間もなく終わります...\"\r\nt MSG_234 \"Syslinux %s をインストール中...\"\r\nt MSG_235 \"不良ブロック: %s %d/%d パス - %0.2f%% (エラー: %d/%d/%d)\"\r\nt MSG_236 \"不良ブロック: ランダムパターンでテスト\"\r\nt MSG_237 \"不良ブロック: パターン 0x%02X でテスト\"\r\nt MSG_238 \"パーティション分割中 (%s)...\"\r\nt MSG_239 \"パーティション削除中 (%s)...\"\r\nt MSG_240 \"ダウンロードしたアップデートのデジタル署名が無効です。あなたが使用しているシステムの構成が署名検証のために不適切であるか、または悪意のあるソフトウェアがダウンロードされた可能性があります\\n\\nダウンロードは削除されます。詳しくはログを確認してください。\"\r\nt MSG_241 \"ダウンロード中: %s\"\r\nt MSG_242 \"ファイルのダウンロードに失敗しました。\"\r\nt MSG_243 \"Rufus のアップデートを確認しています...\"\r\nt MSG_244 \"アップデート: インターネット接続に失敗しました。\"\r\nt MSG_245 \"アップデート: バージョン管理データにアクセスできません。\"\r\nt MSG_246 \"Rufus の新しいバージョンを利用できます!\"\r\nt MSG_247 \"Rufus の新しいバージョンはありませんでした。\"\r\nt MSG_248 \"アプリケーションのレジストリ キーを正常に削除しました。\"\r\nt MSG_249 \"アプリケーションのレジストリ キーの削除に失敗しました。\"\r\nt MSG_250 \"%s 有効\"\r\nt MSG_251 \"%s 無効\"\r\nt MSG_252 \"サイズの確認\"\r\nt MSG_253 \"ハードディスクの検出\"\r\nt MSG_254 \"Large FAT32 でのフォーマットを強制\"\r\nt MSG_255 \"NoDriveTypeAutorun は Rufus を閉じる時に削除されます。\"\r\nt MSG_256 \"偽装されたドライブの検出\"\r\nt MSG_257 \"Juliet のサポート\"\r\nt MSG_258 \"Rock Ridge のサポート\"\r\nt MSG_259 \"強制的にアップデート\"\r\nt MSG_260 \"NTFS 圧縮\"\r\nt MSG_261 \"イメージを書き込み中: %s\"\r\nt MSG_262 \"ISO のサポート\"\r\nt MSG_263 \"正確なサイズ単位を使用\"\r\nt MSG_264 \"“%s” フォルダーを削除しています。\"\r\nt MSG_265 \"VMWare ディスクの検出\"\r\nt MSG_266 \"デュアル UEFI/BIOS モード\"\r\nt MSG_267 \"Windows イメージを適用中: %s\"\r\nt MSG_268 \"Windows イメージを適用します...\"\r\nt MSG_269 \"タイムスタンプ (ファイル更新日付) を保持\"\r\nt MSG_270 \"USB デバッグ\"\r\nt MSG_271 \"イメージのチェックサムを計算中: %s\"\r\nt MSG_272 \"選択したイメージの MD5、SHA1、SHA256 チェックサムを計算します。\"\r\nt MSG_273 \"アプリケーションの使用言語を変更します。\"\r\nt MSG_274 \"%s イメージの検出\"\r\nt MSG_275 \"選択されたイメージはハイブリッド ISO 形式です。\\n%s (ファイル コピー) モードまたは%s (ディスク イメージ) モードで書き込むことができます。\\n書き込み後、ドライブにフルアクセスできるよう、 Rufus は%s モードを推奨します。\\nブート中にエラーが発生する場合には、%s モードで再度試してみてください。\\n\\nこのイメージを書き込む際に使用するモードを選択してください。\"\r\nt MSG_276 \"%s モードで書き込む (推奨)\"\r\nt MSG_277 \"%s モードで書き込む\"\r\nt MSG_278 \"競合するプロセスの確認中...\"\r\nt MSG_279 \"非ブート用\"\r\nt MSG_280 \"ディスクまたは ISO イメージ\"\r\nt MSG_281 \"%s (選択してください)\"\r\nt MSG_282 \"USB ドライブを専用にロック\"\r\nt MSG_283 \"無効なデジタル署名\"\r\nt MSG_284 \"ダウンロードした実行可能ファイルにはデジタル署名がありません。\"\r\nt MSG_285 \"このダウンロードした実行可能ファイルのデジタル署名は “%s” です。\\nこれは正規の署名ではありません。悪意のあるソフトウェアの可能性があります。\\nこのファイルを実行しますか?\"\r\nt MSG_286 \"“0” をドライブへ書き込み初期化中: %s\"\r\nt MSG_287 \"USB 接続でないリムーバブル ディスクを検出しました。\"\r\nt MSG_288 \"管理者権限がありません。\"\r\nt MSG_289 \"このアプリケーションは管理者権限でのみ実行できます。\"\r\nt MSG_290 \"ファイルの索引化\"\r\nt MSG_291 \"バージョン選択\"\r\nt MSG_292 \"インストールしたい Windows のバージョンを選択してください。\"\r\nt MSG_293 \"サポートされていない Windows のバージョンです。\"\r\nt MSG_294 \"このバージョンの Windows は Rufus のサポート対象外となりました。\\nこのプラットフォームと互換性のあるRufusの最終バージョンはv%d.%dです。\"\r\nt MSG_295 \"警告: 非公式版\"\r\nt MSG_296 \"このバージョンの Rufus は公式の開発者によって提供されたものではありません。\\n\\n非公式版 Rufus を実行しますか?\"\r\nt MSG_297 \"不完全な ISO ファイルを検出しました。\"\r\nt MSG_298 \"選択された ISO ファイルは定義されているファイル サイズと一致しません。%sのデータが不足しています。\\n\\nこのファイルがインターネットからダウンロードされたものならば、再ダウンロードし、 MD5 または SHA のチェックサムが公式のものと一致しているか確認してください。\\n\\nMD5 と SHA は(✓)ボタンをクリックすれば Rufus で確認できます。\"\r\nt MSG_299 \"タイムスタンプの検証エラー\"\r\nt MSG_300 \"ダウンロードしたアップデートのタイム スタンプが現在の実行ファイルのタイム スタンプよりも新しいことを確認できませんでした。\\n\\n潜在的な攻撃シナリオを防止するため、更新プロセスを中止しダウンロードしたファイルを削除します。 詳細はログを確認してください。\"\r\nt MSG_301 \"アプリケーションの設定を表示します。\"\r\nt MSG_302 \"このアプリケーションの情報を表示します。\"\r\nt MSG_303 \"ログを表示します。\"\r\nt MSG_304 \"選択したデバイスのディスク イメージを作成します。\"\r\nt MSG_305 \"このデバイスを使用して別のディスクに Windows をインストールしたい場合、またはこのドライブから Windows を直接実行 (Windows To Go) したい場合にこのオプションを使用します。\"\r\nt MSG_306 \"ドライブを高速完全消去中: %s\"\r\nt MSG_307 \"時間がかかることがあります\"\r\nt MSG_308 \"VHD の検出\"\r\nt MSG_309 \"圧縮ファイル\"\r\nt MSG_310 \"選択した ISO は UEFI を使用しており、 EFI システム パーティション (ESP) として書き込めるサイズです。ディスク全体を占める一般的なデータ パーティションに書き込むのではなく、 ESP に書き込む方が適しているインストーラもあります。\\n\\nこのイメージを書き込むのに使用したいモードを選択してください。\"\r\nt MSG_311 \"有効にするには %s をメイン アプリケーション ウィンドウで実行してください。\"\r\nt MSG_312 \"追加のハッシュ値 (SHA512) を有効にする\"\r\nt MSG_313 \"VHD に保存\"\r\nt MSG_314 \"イメージのチェックサムを計算する\"\r\nt MSG_315 \"複数のボタン\"\r\nt MSG_316 \"チェックをパスした数\"\r\nt MSG_317 \"ディスク ID\"\r\nt MSG_318 \"スレッドの優先度: %d\"\r\nt MSG_319 \"Boot Maker を無視\"\r\nt MSG_320 \"パーティション レイアウトを更新中 (%s)\"\r\nt MSG_321 \"選択されたイメージはハイブリッド ISO 形式ですが、 ISO イメージ モード / ファイル コピー モードと互換性がありません。\\nそのため、書き込みには DD イメージ モードが適用されます。\"\r\nt MSG_322 \"'%s'の読み取り\"\r\nt MSG_325 \"Windowsカスタムを適応: %s\"\r\nt MSG_326 \"ユーザー設定を適応中...\"\r\nt MSG_327 \"Windows ユーザーエクスペリエンス\"\r\nt MSG_328 \"インストーラーをカスタムしますか?\"\r\nt MSG_329 \"4GB以上のRAM、セキュアブート及びTPM 2.0の要件を削除\"\r\nt MSG_330 \"オンラインアカウントの要件を削除\"\r\nt MSG_331 \"データ収集を無効化\"\r\nt MSG_332 \"Windows To Goへの内部ディスクからのアクセスを防ぐ\"\r\nt MSG_333 \"ローカルアカウントを次の名前で作成:\"\r\nt MSG_334 \"地域設定をこのユーザーと同じものに設定\"\r\nt MSG_335 \"BitLocker 自動デバイス暗号化を無効化します。\"\r\nt MSG_336 \"永続ログ\"\r\nt MSG_337 \"この機能を使用するには、Microsoft から追加のファイル ('%s') をダウンロードする必要があります:\\n- はいを選択すると、インターネットに接続しダウンロードします。\\n- いいえを選択すると、キャンセルします\\n\\n注意:ファイルはアプリケーションのディレクトリへダウンロードされ、今後自動的に再利用されます。\"\r\nt MSG_338 \"無効なUEFIブートローダーが検出されました。\"\r\nt MSG_339 \"Rufusは選択されたISOイメージが無効なUEFIブートローダーを含み、最新のUEFIでセキュアブートが有効である場合%sを引き起こすことを検出しました。\\n\\n- このファイルが信頼できないソースから入手されたものであれば、マルウェア混入の可能性があるため起動しないことをお勧めします。\\n- このファイルが信頼できるソースから取得したものであれば、警告が発生しない新しいバージョンを探すことをお勧めします。\"\r\nt MSG_340 \"セキュリティ侵害表示\"\r\nt MSG_341 \"\\\"%s\\\"によるWindowsのブルースクリーン\"\r\nt MSG_342 \"圧縮されたVHDXイメージ\"\r\nt MSG_343 \"圧縮されていないVHDイメージ\"\r\nt MSG_344 \"Full Flash Updateイメージ\"\r\nt MSG_345 \"この機能を使用するにはMicrosoftから追加のファイルをいくつかダウンロードする必要があります。\\n- はいを選択すると、インターネットに接続しダウンロードします。\\n- いいえを選択すると、キャンセルします\"\r\nt MSG_346 \"WindowsのSモードを強制する(オンラインアカウント要件の削除と同時に使用できません)\"\r\nt MSG_347 \"エキスパートモード\"\r\nt MSG_348 \"ファイルを展開中: %s\"\r\nt MSG_349 \"Rufus MBRを使用する\"\r\nt MSG_900 \"Rufus (ルーファス) とは、起動可能なUSBフラッシュドライブ（USBメモリなど）を作成したり、フォーマットをするためのソフトウェアです。\"\r\nt MSG_901 \"公式サイト: %s\"\r\nt MSG_902 \"ソースコード: %s\"\r\nt MSG_903 \"変更履歴: %s\"\r\nt MSG_904 \"このアプリケーションはGNU Public License (GPL) version 3でライセンスされています。\\n詳細は https://www.gnu.org/licenses/gpl-3.0.ja.html をご覧ください。\"\r\nt MSG_905 \"起動\"\r\nt MSG_910 \"USBメモリやSDカード、仮想ドライブをFAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3でフォーマットします。\"\r\nt MSG_911 \"FreeDOSの起動可能ドライブを作成します。\"\r\nt MSG_912 \"WindowsやLinuxなどのISOファイルから起動可能ドライブを作成します。\"\r\nt MSG_913 \"圧縮済みのものを含むディスクイメージから起動可能ドライブを作成します。\"\r\nt MSG_914 \"UEFI:NTFSを含むBIOS及びUEFIで起動可能なドライブを作成します。\"\r\nt MSG_915 \"Windows To Goドライブを作成します。\"\r\nt MSG_916 \"TPM及びセキュアブート非対応のPC向けのWindows 11インストールドライブを作成します\"\r\nt MSG_917 \"記録用Linuxパーティションを作成します。\"\r\nt MSG_918 \"選択されたドライブのVHD/DDイメージを作成します。\"\r\nt MSG_919 \"選択されたイメージのMD5、SHA-1、SHA-256及びSHA-512チェックサムを計算します。\"\r\nt MSG_920 \"不良ブロックチェック及び容量詐欺ドライブの検知を行います。\"\r\nt MSG_921 \"マイクロソフト公式のWindows ISOをダウンロードします。\"\r\nt MSG_922 \"UEFIシェルのISOをダウンロードします。\"\r\n\r\n#########################################################################\r\nl \"ko-KR\" \"Korean (한국어)\" 0x0412\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Rufus 정보\"\r\nt IDC_ABOUT_LICENSE \"라이선스\"\r\nt IDOK \"확인\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"드라이브 속성\"\r\nt IDS_DEVICE_TXT \"장치\"\r\nt IDS_BOOT_SELECTION_TXT \"부팅 선택\"\r\nt IDC_SELECT \"선택\"\r\nt IDS_IMAGE_OPTION_TXT \"이미지 옵션\"\r\nt IDS_PARTITION_TYPE_TXT \"파티션 구성\"\r\nt IDS_TARGET_SYSTEM_TXT \"대상 시스템\"\r\nt IDC_LIST_USB_HDD \"USB 하드 드라이브 목록\"\r\nt IDC_OLD_BIOS_FIXES \"오래된 BIOS에 대한 수정 추가 (추가 파티션, 정렬 등)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"런타임 UEFI 미디어 유효성 검증 사용\"\r\nt IDS_FORMAT_OPTIONS_TXT \"포맷 옵션\"\r\nt IDS_FILE_SYSTEM_TXT \"파일 시스템\"\r\nt IDS_CLUSTER_SIZE_TXT \"클러스터 크기\"\r\nt IDS_LABEL_TXT \"볼륨 레이블\"\r\nt IDC_QUICK_FORMAT \"빠른 포맷\"\r\nt IDC_BAD_BLOCKS \"장치의 불량 블록 검사\"\r\nt IDC_EXTENDED_LABEL \"확장 레이블 및 아이콘 파일 만들기\"\r\nt IDS_STATUS_TXT \"상태\"\r\nt IDCANCEL \"닫기\"\r\nt IDC_START \"시작\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"닫기\"\r\nt IDD_LICENSE \"Rufus 라이선스\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"닫기\"\r\nt IDD_LOG \"로그\"\r\nt IDC_LOG_CLEAR \"지우기\"\r\nt IDC_LOG_SAVE \"저장\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"닫기\"\r\nt IDD_NEW_VERSION \"업데이트 확인 - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"최신 버전을 사용할 수 있습니다. 최신 버전을 다운로드하세요!\"\r\nt IDC_WEBSITE \"웹사이트로 이동하려면 여기를 클릭하세요\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"릴리즈 정보\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"다운로드\"\r\nt IDC_DOWNLOAD \"다운로드\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"추가 정보\"\r\nt IDYES \"예\"\r\nt IDNO \"아니요\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"닫기\"\r\nt IDD_UPDATE_POLICY \"업데이트 정책 및 설정\"\r\nt IDS_UPDATE_SETTINGS_GRP \"설정\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"업데이트 확인\"\r\nt IDS_INCLUDE_BETAS_TXT \"베타 버전 포함\"\r\nt IDC_CHECK_NOW \"지금 확인\"\r\n\r\nt MSG_001 \"다른 인스턴스가 감지되었습니다\"\r\nt MSG_002 \"다른 Rufus 응용 프로그램이 실행 중입니다.\\n다른 응용 프로그램을 실행하기 전에 첫 번째 응용 프로그램을 닫아주세요.\"\r\nt MSG_003 \"경고: '%s' 장치의 모든 데이터가 삭제됩니다.\\n이 작업을 계속하려면 확인을 클릭합니다. 종료하려면 취소를 클릭합니다.\"\r\nt MSG_004 \"Rufus 업데이트 정책\"\r\nt MSG_005 \"Rufus가 온라인으로 응용 프로그램 업데이트를 확인할 수 있도록 허용하시겠습니까?\"\r\nt MSG_006 \"닫기\"\r\nt MSG_007 \"취소\"\r\nt MSG_008 \"예\"\r\nt MSG_009 \"아니요\"\r\nt MSG_010 \"불량 블록을 찾았습니다\"\r\nt MSG_011 \"검사 완료: %d개의 불량 블록을 찾았습니다\\n  %d개 읽기 오류\\n  %d개 쓰기 오류\\n  %d개 손상 오류\"\r\nt MSG_012 \"%s\\n더 자세한 보고서는 다음에서 확인할 수 있습니다:\\n%s\"\r\nt MSG_013 \"사용 안 함\"\r\nt MSG_014 \"매일\"\r\nt MSG_015 \"매주\"\r\nt MSG_016 \"매월\"\r\nt MSG_017 \"사용자 지정\"\r\nt MSG_018 \"현재 버전: %d.%d (빌드 %d)\"\r\nt MSG_019 \"최신 버전: %d.%d (빌드 %d)\"\r\nt MSG_020 \"바이트\"\r\nt MSG_026 \"바이트\"\r\nt MSG_027 \"킬로바이트\"\r\nt MSG_028 \"메가바이트\"\r\nt MSG_029 \"기본값\"\r\nt MSG_030 \"%s (기본값)\"\r\nt MSG_031 \"BIOS (또는 UEFI-CSM)\"\r\nt MSG_032 \"UEFI (비 CSM)\"\r\nt MSG_033 \"BIOS 또는 UEFI\"\r\nt MSG_034 \"%d회\"\r\nt MSG_035 \"%d회 %s\"\r\nt MSG_036 \"ISO 이미지\"\r\nt MSG_037 \"응용 프로그램\"\r\nt MSG_038 \"중단\"\r\nt MSG_039 \"실행\"\r\nt MSG_040 \"다운로드\"\r\nt MSG_041 \"사용자가 작업을 취소했습니다\"\r\nt MSG_042 \"오류\"\r\nt MSG_043 \"오류: %s\"\r\nt MSG_044 \"파일 다운로드\"\r\nt MSG_045 \"USB 저장 장치 (일반)\"\r\nt MSG_046 \"%s (디스크 %d) [%s]\"\r\nt MSG_047 \"다중 파티션\"\r\nt MSG_048 \"Rufus - 버퍼 비우기\"\r\nt MSG_049 \"Rufus - 취소\"\r\nt MSG_050 \"성공했습니다.\"\r\nt MSG_051 \"포맷하는 동안 알 수 없는 오류가 발생했습니다.\"\r\nt MSG_052 \"이 미디어에 선택한 파일 시스템을 사용할 수 없습니다.\"\r\nt MSG_053 \"장치에 대한 액세스가 거부되었습니다.\"\r\nt MSG_054 \"미디어가 쓰기 금지되어 있습니다.\"\r\nt MSG_055 \"다른 프로세스에서 장치를 사용 중입니다. 장치에 액세스할 수 있는 다른 프로세스를 모두 닫으세요.\"\r\nt MSG_056 \"이 장치에는 빠른 포맷을 사용할 수 없습니다.\"\r\nt MSG_057 \"볼륨 레이블이 유효하지 않습니다.\"\r\nt MSG_058 \"장치 핸들이 유효하지 않습니다.\"\r\nt MSG_059 \"선택한 클러스터 크기가 이 장치에 적합하지 않습니다.\"\r\nt MSG_060 \"볼륨 크기가 유효하지 않습니다.\"\r\nt MSG_061 \"드라이브에 이동식 미디어를 삽입하세요.\"\r\nt MSG_062 \"지원되지 않는 명령이 수신되었습니다.\"\r\nt MSG_063 \"메모리 할당 오류입니다.\"\r\nt MSG_064 \"읽기 오류입니다.\"\r\nt MSG_065 \"쓰기 오류입니다.\"\r\nt MSG_066 \"설치 실패\"\r\nt MSG_067 \"미디어를 열 수 없습니다. 다른 프로세스에서 사용 중일 수 있습니다. 미디어를 다시 연결하고 다시 시도하세요.\"\r\nt MSG_068 \"드라이브를 분할할 수 없습니다.\"\r\nt MSG_069 \"대상 드라이브에 파일을 복사할 수 없습니다.\"\r\nt MSG_070 \"사용자가 취소했습니다.\"\r\nt MSG_071 \"스레드를 시작할 수 없습니다.\"\r\nt MSG_072 \"불량 블록 검사가 완료되지 않았습니다.\"\r\nt MSG_073 \"ISO 이미지 검색에 실패했습니다.\"\r\nt MSG_074 \"ISO 이미지 추출에 실패했습니다.\"\r\nt MSG_075 \"볼륨을 다시 마운트할 수 없습니다.\"\r\nt MSG_076 \"부팅할 파일을 패치/설정할 수 없습니다.\"\r\nt MSG_077 \"드라이브 문자를 할당할 수 없습니다.\"\r\nt MSG_078 \"GUID 볼륨을 마운트할 수 없습니다.\"\r\nt MSG_079 \"장치가 준비되지 않았습니다.\"\r\nt MSG_080 \"Rufus는 Windows가 여전히 내부 버퍼를 USB 장치로 플러시하고 있음을 감지했습니다.\\n\\nUSB 장치의 속도에 따라 특히 대용량 파일의 경우 이 작업을 완료하는 데 시간이 오래 걸릴 수 있습니다.\\n\\n손상되는 것을 방지하기 위해 Windows를 종료하는 것이 좋습니다.. 그러나 기다리는 것에 지치면 장치의 플러그를 뽑을 수 있습니다...\"\r\nt MSG_081 \"지원되지 않는 이미지\"\r\nt MSG_082 \"이 이미지는 부팅할 수 없거나 Rufus에서 지원하지 않는 부팅 또는 압축 방식을 사용합니다...\"\r\nt MSG_083 \"%s를 교체하시겠습니까?\"\r\nt MSG_084 \"이 ISO 이미지는 '%s'의 오래된 버전을 사용하는 것 같습니다.\\n이로 인해 부팅 메뉴가 제대로 표시되지 않을 수 있습니다.\\n\\nRufus는 이 문제를 해결하기 위해 최신 버전을 다운로드할 수 있습니다:\\n- 인터넷에 연결하고 파일을 다운로드하려면 '예'를 선택합니다\\n- 기존 ISO 파일을 수정하지 않은 상태로 두려면 '아니요'를 선택합니다\\n무엇을 해야 할지 모르면 '예'를 선택해야 합니다.\\n\\n참고: 새 파일이 현재 디렉터리에 다운로드되고 '%s'가 있으면 자동으로 재사용됩니다.\"\r\nt MSG_085 \"%s 다운로드 중\"\r\nt MSG_086 \"선택된 ISO 이미지가 없습니다\"\r\nt MSG_087 \"%s 장치\"\r\nt MSG_088 \"이미지가 너무 큽니다\"\r\nt MSG_089 \"선택한 대상에 비해 이미지가 너무 큽니다.\"\r\nt MSG_090 \"지원되지 않는 ISO\"\r\nt MSG_091 \"UEFI 대상 유형을 사용하는 경우, EFI 부팅 가능한 ISO 이미지만 지원됩니다. EFI 부팅 가능한 ISO를 선택하거나 대상 유형을 BIOS로 설정하세요.\"\r\nt MSG_092 \"지원되지 않는 파일 시스템\"\r\nt MSG_093 \"중요: 이 드라이브에는 다중 파티션이 있습니다!!\\n\\n여기에는 나열되지 않았거나 Windows에서 볼 수 없는 파티션/볼륨이 포함될 수 있습니다. 계속 진행하려면 이 파티션의 모든 데이터 손실에 대한 책임이 있습니다.\"\r\nt MSG_094 \"다중 파티션이 감지되었습니다\"\r\nt MSG_095 \"DD 이미지\"\r\nt MSG_096 \"현재 선택한 파일 시스템은 이 유형의 ISO와 함께 사용할 수 없습니다. 다른 파일 시스템을 선택하거나 다른 ISO를 사용하세요.\"\r\nt MSG_097 \"'%s'는 파일 시스템이 NTFS인 경우에만 적용할 수 있습니다.\"\r\nt MSG_098 \"중요: 'Windows To Go'를 설치하려고 하는데 대상 드라이브에 '고정' 속성이 없습니다. 이 때문에 Microsoft는 Windows가 '이동식' 속성을 가진 드라이브와 함께 작동하도록 설계하지 않았기 때문에 부팅 중에 Windows가 중지될 가능성이 높습니다.\\n\\n계속하시겠습니까?\\n\\n참고: '고정/이동식' 속성은 드라이브 제조업체의 사용자 지정 도구를 사용해야만 변경할 수 있는 하드웨어 속성입니다. 하지만 그 도구들은 일반인들에게는 거의 제공되지 않습니다...\"\r\nt MSG_099 \"파일 시스템 제한\"\r\nt MSG_100 \"이 ISO 이미지에는 FAT 또는 FAT32 파일 시스템에 허용되는 최대 크기보다 큰 4GB 이상의 파일이 포함되어 있습니다.\"\r\nt MSG_101 \"WIM 지원 누락\"\r\nt MSG_102 \"플랫폼이 WIM 압축파일에서 파일을 추출할 수 없습니다. EFI 부팅 가능한 Windows 7 및 Windows Vista USB 드라이브를 생성하려면 WIM 압축을 풀어야 합니다. 최신 버전의 7-Zip을 설치하여 이 문제를 해결할 수 있습니다.\\n7-zip 다운로드 페이지를 방문하시겠습니까?\"\r\nt MSG_103 \"%s(을)를 다운로드하시겠습니까?\"\r\nt MSG_104 \"%s 이상에서는 '%s' 파일을 설치해야 합니다.\\n이 파일은 크기가 100KB 이상이고 항상 %s ISO 이미지에 존재하기 때문에 Rufus에 포함되어 있지 않습니다.\\n\\nRufus가 누락된 파일을 다운로드할 수 있습니다:\\n- 인터넷에 연결하고 파일을 다운로드하려면 '예'를 선택합니다\\n- 나중에 드라이브에 이 파일을 수동으로 복사하려면 '아니요'를 선택합니다\\n\\n참고: 파일이 현재 디렉터리에 다운로드되고 '%s'가 있으면 자동으로 재사용됩니다.\"\r\nt MSG_105 \"취소하면 장치를 사용할 수 없는 상태가 될 수 있습니다.\\n취소하려면 예를 클릭합니다. 그렇지 않으면 아니요를 클릭합니다.\"\r\nt MSG_106 \"폴더를 선택하세요\"\r\nt MSG_107 \"모든 파일\"\r\nt MSG_108 \"Rufus 로그\"\r\nt MSG_109 \"0x%02X (디스크 %d)\"\r\nt MSG_110 \"MS-DOS는 64KB 클러스터 크기를 사용하는 드라이브에서 부팅할 수 없습니다.\\n클러스터 크기를 변경하거나 FreeDOS를 사용하세요.\"\r\nt MSG_111 \"호환되지 않는 클러스터 크기\"\r\nt MSG_112 \"대용량 UDF 볼륨을 포맷하는 데 많은 시간이 걸릴 수 있습니다. USB 2.0 속도에서 예상 포맷 지속 시간은 %d:%02d이며, 이 기간 동안 진행률 표시줄이 고정된 것처럼 보입니다. 기다려주세요!\"\r\nt MSG_113 \"대용량 UDF 볼륨\"\r\nt MSG_114 \"이 이미지에서는 Syslinux %s%s를 사용하지만 이 응용 프로그램에는 Syslinux %s%s에 대한 설치 파일만 포함됩니다.\\n\\n새 버전의 Syslinux는 서로 호환되지 않으므로 Rufus가 모두 포함할 수 없으므로 인터넷에서 두 개의 추가 파일 ('ldlinux.sys' 및 'ldlinux.bss')을 다운로드해야 합니다:\\n- 인터넷에 연결하고 이러한 파일을 다운로드하려면 '예'를 선택합니다\\n- 작업을 취소하려면 '아니요'를 선택합니다\\n\\n참고: 파일은 현재 응용 프로그램 디렉터리에 다운로드되며 있는 경우 자동으로 재사용됩니다.\"\r\nt MSG_115 \"다운로드가 필요합니다\"\r\nt MSG_116 \"이 이미지는 Grub %s을(를) 사용하지만 응용 프로그램에는 Grub %s에 대한 설치 파일만 포함합니다.\\n\\n다른 버전의 Grub은 서로 호환되지 않을 수 있으며, 모두 포함할 수 없기 때문에 Rufus는 이미지에서 일치하는 Grub 설치 파일 ('core.img')의 버전을 찾으려고 시도합니다:\\n- 인터넷에 연결하고 다운로드하려면 '예'를 선택합니다\\n- Rufus의 기본 버전을 사용하려면 '아니요'를 선택합니다\\n- 작업을 중단하려면 '취소'를 선택합니다\\n\\n참고: 파일은 현재 응용 프로그램 디렉터리에 다운로드되며 있는 경우 자동으로 재사용됩니다. 일치하는 항목을 온라인으로 찾을 수 없는 경우 기본 버전이 사용됩니다.\"\r\nt MSG_117 \"표준 Windows 설치\"\r\nt MSG_119 \"고급 드라이브 속성\"\r\nt MSG_120 \"고급 포맷 옵션\"\r\nt MSG_121 \"%s 표시\"\r\nt MSG_122 \"%s 숨기기\"\r\nt MSG_123 \"영구 파티션 크기\"\r\nt MSG_124 \"영구적 아님\"\r\nt MSG_125 \"라이브 USB 미디어의 영구 파티션 크기를 설정합니다. 크기를 0으로 설정하면 영구 파티션이 비활성화됩니다.\"\r\nt MSG_126 \"파티션 크기 단위를 설정합니다.\"\r\nt MSG_127 \"이 메시지를 다시 표시하지 않음\"\r\nt MSG_128 \"%s에 대한 중요 공지\"\r\nt MSG_129 \"UEFI:NTFS 부트 로더를 사용하는 미디어를 방금 만들었습니다. 이 미디어를 부팅하려면 보안 부팅을 비활성화해야 합니다.\\n이 기능이 필요한 이유에 대한 자세한 내용은 아래의 '추가 정보' 버튼을 참조하세요.\"\r\nt MSG_130 \"Windows 이미지 선택\"\r\nt MSG_131 \"이 ISO에는 여러 개의 Windows 이미지가 포함되어 있습니다.\\n이 설치에 사용할 이미지를 선택하세요:\"\r\nt MSG_132 \"다른 프로그램 또는 프로세스가 이 드라이브에 액세스하고 있습니다. 포맷하시겠습니까?\"\r\nt MSG_133 \"Rufus가 1809 ISO를 기반으로 Windows To Go 미디어를 만들려고 하는 것을 감지했습니다.\\n\\n*MICROSOFT BUG*로 인해 수동으로 'WppRecorder.sys' 파일을 1803 버전으로 교체하지 않으면 Windows 부팅 중 이 미디어가 충돌합니다.\\n\\n또한 Rufus가 이 문제를 자동으로 해결할 수 없는 이유는 'WppRecorder.sys'가 Microsoft의 저작권이 있는 파일이기 때문에 해당 파일의 복사본을 응용 프로그램에 법적으로 포함할 수 없기 때문입니다...\"\r\nt MSG_134 \"파티션 구성표에서 MBR이 선택되었기 때문에 Rufus는 이 미디어에 최대 2TB의 파티션만 만들 수 있으며, 이로 인해 %s의 디스크 공간을 사용할 수 없게 됩니다.\\n\\n계속하시겠습니까?\"\r\nt MSG_135 \"버전\"\r\nt MSG_136 \"릴리즈\"\r\nt MSG_137 \"에디션\"\r\nt MSG_138 \"언어\"\r\nt MSG_139 \"아키텍처\"\r\nt MSG_140 \"계속\"\r\nt MSG_141 \"뒤로\"\r\nt MSG_142 \"기다려주세요...\"\r\nt MSG_143 \"브라우저를 사용하여 다운로드\"\r\nt MSG_144 \"Microsoft가 이를 방지하기 위해 웹사이트를 변경했기 때문에 Windows ISO를 다운로드할 수 없습니다.\"\r\nt MSG_145 \"이 스크립트를 실행하려면 PowerShell 3.0 이상이 필요합니다.\"\r\nt MSG_146 \"온라인으로 이동하여 다운로드하시겠습니까?\"\r\nt MSG_148 \"다운로드 스크립트 실행 중...\"\r\nt MSG_149 \"ISO 이미지 다운로드\"\r\nt MSG_150 \"이 부팅 가능한 드라이브를 사용하려는 컴퓨터 유형입니다. 드라이브를 만들기 전에 대상이 BIOS인지 UEFI 유형인지 확인해야 합니다. 그렇지 않으면 부팅에 실패할 수도 있기 때문입니다.\"\r\nt MSG_151 \"'UEFI-CSM'은 장치가 네이티브 UEFI 모드가 아닌 UEFI에서 BIOS 에뮬레이션 모드 (레거시 모드라고도 함)에서만 부팅됨을 의미합니다.\"\r\nt MSG_152 \"'비 CSM'은 장치가 기본 UEFI 모드에서만 부팅되고 BIOS 에뮬레이션 모드 ('레거시 모드'라고도 함)에서는 부팅되지 않음을 의미합니다.\"\r\nt MSG_153 \"테스트 패턴: 0x%02X\"\r\nt MSG_154 \"테스트 패턴: 0x%02X, 0x%02X\"\r\nt MSG_155 \"테스트 패턴: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"테스트 패턴: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"대상 파일 시스템 설정\"\r\nt MSG_158 \"파일 시스템에서 데이터 블록이 차지하는 최소 크기\"\r\nt MSG_159 \"이 필드를 사용하여 드라이브 레이블을 설정합니다.\\n국제 문자를 사용할 수 있습니다.\"\r\nt MSG_160 \"고급 옵션 전환\"\r\nt MSG_161 \"테스트 패턴을 사용하여 장치의 불량 블록을 확인합니다\"\r\nt MSG_162 \"\\\"느린\\\" 포맷 방법을 사용하려면 이 상자의 선택을 취소합니다\"\r\nt MSG_163 \"파티션을 만드는 데 사용할 방법\"\r\nt MSG_164 \"드라이브를 부팅 가능하게 만드는 데 사용되는 방법\"\r\nt MSG_165 \"이미지를 선택하거나 다운로드하려면 클릭...\"\r\nt MSG_166 \"이 확인란을 선택하면 국제 레이블 표시를 허용하고 장치 아이콘을 설정할 수 있습니다 (autorun.inf 생성).\"\r\nt MSG_167 \"미디어의 MD5Sum 파일 유효성 검사를 수행할 UEFI 부트로더 설치\"\r\nt MSG_169 \"숨겨진 파티션을 추가로 만들고 파티션 경계를 정렬합니다.\\n이를 통해 오래된 BIOS의 부팅 감지 성능을 향상시킬 수 있습니다.\"\r\nt MSG_170 \"USB 하드 드라이브 외장 장치 목록을 활성화합니다. 위험을 감수하고 사용하세요!!!\"\r\nt MSG_171 \"포맷 작업을 시작합니다.\\n대상에 있는 모든 데이터가 삭제됩니다!\"\r\nt MSG_172 \"유효하지 않은 다운로드 서명\"\r\nt MSG_173 \"선택하려면 클릭...\"\r\nt MSG_174 \"Rufus - 신뢰할 수 있는 USB 포맷 유틸리티\"\r\nt MSG_175 \"버전 %d.%d (빌드 %d)\"\r\nt MSG_176 \"한국어 번역:\\\\line• 세상사는이야기-나두 <mailto:ho82.kr@gmail.com>\\\\line• Uk-Jin Jang <mailto:doublestat@gmail.com>\\\\line• 비너스걸 (VᴇɴᴜsGɪʀʟ♥) <mailto:venusgirl@outlook.com>\"\r\nt MSG_177 \"버그 보고 또는 향상된 기능 요청:\"\r\nt MSG_178 \"추가 저작권:\"\r\nt MSG_179 \"업데이트 정책:\"\r\nt MSG_180 \"이 프로그램에서 응용 프로그램 업데이트를 확인하도록 선택한 경우, 다음 정보가 서버에서 수집될 수 있다는 데 동의하는 것입니다:\"\r\nt MSG_181 \"운영 체제의 아키텍처 및 버전\"\r\nt MSG_182 \"사용하는 응용 프로그램의 버전\"\r\nt MSG_183 \"사용자의 IP 주소\"\r\nt MSG_184 \"개인 사용 통계를 생성하기 위해 당사는 수집한 정보를 \\\\b최대 1년 동안\\\\b0 보관할 수 있습니다. 그러나 당사는 이러한 개별 데이터를 제3자에게 기꺼이 공개하지 않을 것입니다.\"\r\nt MSG_185 \"업데이트 과정:\"\r\nt MSG_186 \"Rufus는 백그라운드 서비스를 설치하거나 실행하지 않으므로 업데이트 확인은 기본 응용 프로그램이 실행 중일 때만 수행됩니다.\\\\line\\n업데이트를 확인할 때는 당연히 인터넷 접속이 필요합니다.\"\r\nt MSG_187 \"선택한 부팅 옵션에 대한 잘못된 이미지\"\r\nt MSG_188 \"현재 이미지가 선택한 부팅 옵션과 일치하지 않습니다. 다른 이미지를 사용하거나 다른 부팅 옵션을 선택하세요.\"\r\nt MSG_189 \"이 ISO 이미지는 선택한 파일 시스템과 호환되지 않습니다\"\r\nt MSG_190 \"호환되지 않는 드라이브가 감지되었습니다\"\r\nt MSG_191 \"쓰기 통과\"\r\nt MSG_192 \"읽기 통과\"\r\nt MSG_193 \"%s을(를) 다운로드했습니다\"\r\nt MSG_194 \"%s을(를) 다운로드할 수 없습니다\"\r\nt MSG_195 \"내장된 버전의 %s 파일 사용\"\r\nt MSG_196 \"중요: 이 드라이브는 비표준 섹터 크기를 사용합니다!\\n\\n기존 드라이브는 512바이트 섹터 크기를 사용하지만 이 드라이브는 %d바이트 섹터 크기를 사용합니다. 대부분의 경우 이 드라이브에서 부팅할 수 없습니다.\\nRufus는 부팅 가능한 드라이브를 만들 수 있지만 작동한다는 보장은 없습니다.\"\r\nt MSG_197 \"비표준 섹터 크기가 감지됨\"\r\nt MSG_198 \"'Windows To Go'는 고정 속성이 설정된 GPT 파티션 드라이브에만 설치할 수 있습니다. 현재 드라이브가 고정 드라이브로 감지되지 않았습니다.\"\r\nt MSG_199 \"이 플랫폼에서는 이 기능을 사용할 수 없습니다.\"\r\nt MSG_201 \"취소 중 - 잠시 기다려 주세요...\"\r\nt MSG_202 \"이미지 검색 중...\"\r\nt MSG_203 \"이미지를 검색하지 못했습니다\"\r\nt MSG_204 \"오래된 %s이(가) 감지되었습니다\"\r\nt MSG_205 \"이미지 사용: %s\"\r\nt MSG_206 \"%s 파일 누락\"\r\nt MSG_207 \"새 볼륨\"\r\nt MSG_208 \"%d개의 장치를 찾았습니다\"\r\nt MSG_209 \"%d개의 장치를 찾았습니다\"\r\nt MSG_210 \"준비\"\r\nt MSG_211 \"취소\"\r\nt MSG_212 \"실패\"\r\nt MSG_213 \"새 응용 프로그램을 시작하는 중...\"\r\nt MSG_214 \"새 응용 프로그램을 시작하지 못했습니다\"\r\nt MSG_215 \"%s 열림\"\r\nt MSG_216 \"%s 저장됨\"\r\nt MSG_217 \"포맷 중: %s\"\r\nt MSG_218 \"파일 시스템을 만드는 중: 작업 %d/%d 완료\"\r\nt MSG_219 \"NTFS 오류 복구: %d%% 완료\"\r\nt MSG_220 \"(%s) 포맷 중... - 예상 시간 %d:%02d...\"\r\nt MSG_221 \"레이블 설정 중 (%s)...\"\r\nt MSG_222 \"포맷 중 (%s)...\"\r\nt MSG_223 \"NTFS 오류 복구 (디스크 검사)...\"\r\nt MSG_224 \"MBR/PBR/GPT 구조 지우기...\"\r\nt MSG_225 \"디스크 액세스 요청 중...\"\r\nt MSG_226 \"기존 부팅 레코드 분석 중...\"\r\nt MSG_227 \"기존 볼륨을 닫는 중...\"\r\nt MSG_228 \"마스터 부트 레코드 작성 중...\"\r\nt MSG_229 \"파티션 부트 레코드 작성 중...\"\r\nt MSG_230 \"DOS 파일 복사 중...\"\r\nt MSG_231 \"ISO 파일 복사 중: %s\"\r\nt MSG_232 \"Win7 EFI 부팅 설정 (%s)...\"\r\nt MSG_233 \"마무리 중, 기다려 주세요...\"\r\nt MSG_234 \"Syslinux %s 설치 중...\"\r\nt MSG_235 \"불량 블록: %s %d/%d - %0.2f%% (%d/%d/%d 오류)\"\r\nt MSG_236 \"불량 블록: 무작위 패턴으로 테스트\"\r\nt MSG_237 \"불량 불록: 0x%02X 패턴으로 테스트\"\r\nt MSG_238 \"파티션 중 (%s)...\"\r\nt MSG_239 \"파티션 삭제 중 (%s)...\"\r\nt MSG_240 \"다운로드한 업데이트의 서명을 확인할 수 없습니다. 이는 시스템이 서명 유효성 검사를 위해 잘못 구성되었거나 악의적인 다운로드를 의미할 수 있습니다.\\n\\n다운로드가 삭제됩니다. 자세한 내용은 로그에서 확인하세요.\"\r\nt MSG_241 \"다운로드 중: %s\"\r\nt MSG_242 \"파일을 다운로드하지 못했습니다.\"\r\nt MSG_243 \"Rufus 업데이트 확인 중...\"\r\nt MSG_244 \"업데이트: 인터넷에 연결할 수 없습니다\"\r\nt MSG_245 \"업데이트: 버전 데이터에 액세스할 수 없습니다\"\r\nt MSG_246 \"Rufus의 새 버전을 사용할 수 있습니다!\"\r\nt MSG_247 \"Rufus의 새 버전이 발견되지 않았습니다\"\r\nt MSG_248 \"응용 프로그램 레지스트리 키가 성공적으로 삭제되었습니다\"\r\nt MSG_249 \"응용 프로그램 레지스트리 키를 삭제하지 못했습니다\"\r\nt MSG_250 \"%s 사용함\"\r\nt MSG_251 \"%s 사용 안 함\"\r\nt MSG_252 \"크기 확인\"\r\nt MSG_253 \"하드 디스크 감지\"\r\nt MSG_254 \"대용량 FAT32 포맷 강제 실행\"\r\nt MSG_255 \"NoDriveTypeAutorun은 종료시 삭제됩니다\"\r\nt MSG_256 \"가짜 드라이브 감지\"\r\nt MSG_257 \"Joliet 지원\"\r\nt MSG_258 \"Rock Ridge 지원\"\r\nt MSG_259 \"강제 업데이트\"\r\nt MSG_260 \"NTFS 압축\"\r\nt MSG_261 \"이미지를 쓰는 중: %s\"\r\nt MSG_262 \"ISO 지원\"\r\nt MSG_263 \"적절한 크기 단위 사용\"\r\nt MSG_264 \"'%s' 디렉터리 삭제\"\r\nt MSG_265 \"VMWare 디스크 감지\"\r\nt MSG_266 \"듀얼 UEFI/BIOS 모드\"\r\nt MSG_267 \"Windows 이미지 적용 중: %s\"\r\nt MSG_268 \"Windows 이미지 적용 중...\"\r\nt MSG_269 \"타임스탬프 유지\"\r\nt MSG_270 \"USB 디버그\"\r\nt MSG_271 \"이미지 체크섬 계산 중: %s\"\r\nt MSG_272 \"선택한 이미지에 대한 MD5, SHA1 및 SHA256 체크섬 계산\"\r\nt MSG_273 \"응용 프로그램 언어 변경\"\r\nt MSG_274 \"%s 이미지가 감지되었습니다\"\r\nt MSG_275 \"선택한 이미지는 'ISO 하이브리드' 이미지입니다. 즉, %s (파일 복사) 모드 또는 %s (디스크 이미지) 모드로 쓸 수 있습니다.\\nRufus는 %s 모드를 사용하는 것이 좋습니다. 따라서 드라이브를 작성한 후에는 항상 드라이브에 대한 전체 액세스 권한을 가질 수 있습니다.\\n그러나 부팅하는 동안 문제가 발생하면 %s 모드에서 이 이미지를 다시 작성해 볼 수 있습니다.\\n\\n이 이미지를 작성하는 데 사용할 모드를 선택하세요:\"\r\nt MSG_276 \"%s 모드로 쓰기 (권장)\"\r\nt MSG_277 \"%s 모드로 쓰기\"\r\nt MSG_278 \"충돌하는 프로세스 확인 중...\"\r\nt MSG_279 \"부팅 불가능\"\r\nt MSG_280 \"디스크 또는 ISO 이미지\"\r\nt MSG_281 \"%s (선택해 주세요)\"\r\nt MSG_282 \"독점적인 USB 드라이브 잠금\"\r\nt MSG_283 \"유효하지 않은 서명\"\r\nt MSG_284 \"다운로드한 실행 파일에 디지털 서명이 없습니다.\"\r\nt MSG_285 \"다운로드한 실행 파일은 '%s'이(가) 서명했습니다.\\n이것은 우리가 인식하는 서명이 아니며 어떤 형태의 악의적인 활동을 나타낼 수 있습니다...\\n이 파일을 실행하시겠습니까?\"\r\nt MSG_286 \"드라이브 제로화 중: %s\"\r\nt MSG_287 \"비 USB 이동식 드라이브 감지\"\r\nt MSG_288 \"상승된 권한이 없습니다\"\r\nt MSG_289 \"이 응용 프로그램은 상승된 권한으로만 실행할 수 있습니다\"\r\nt MSG_290 \"파일 색인 중\"\r\nt MSG_291 \"버전 선택\"\r\nt MSG_292 \"설치하려는 Windows 버전을 선택하세요:\"\r\nt MSG_293 \"지원되지 않는 Windows 버전\"\r\nt MSG_294 \"이 버전의 Windows는 더 이상 Rufus에서 지원되지 않습니다.\\n이 플랫폼과 호환되는 Rufus의 마지막 버전은 v%d.%d입니다.\"\r\nt MSG_295 \"경고: 비공식 버전\"\r\nt MSG_296 \"이 버전의 Rufus는 공식 개발자가 제작한 것이 아닙니다.\\n\\n정말 실행하시겠습니까?\"\r\nt MSG_297 \"불완전한 ISO가 감지되었습니다\"\r\nt MSG_298 \"선택한 ISO 파일이 선언된 크기와 일치하지 않습니다. %s의 데이터가 없습니다!\\n\\n인터넷에서 이 파일을 가져온 경우 새 사본을 다운로드하고 MD5 또는 SHA 체크섬이 공식 체크섬과 일치하는지 확인해야 합니다.\\n\\n(✓) 버튼을 클릭하여 Rufus에서 MD5 또는 SHA를 계산할 수 있습니다.\"\r\nt MSG_299 \"타임스탬프 유효성 검사 오류\"\r\nt MSG_300 \"Rufus가 다운로드한 업데이트의 타임스탬프가 현재 실행 파일의 타임스탬프보다 최신인지 확인할 수 없습니다.\\n\\n잠재적인 공격 시나리오를 방지하기 위해 업데이트 프로세스가 중단되었으며 다운로드가 삭제됩니다. 자세한 내용은 로그를 확인하시기 바랍니다.\"\r\nt MSG_301 \"응용 프로그램 설정 표시\"\r\nt MSG_302 \"이 응용 프로그램에 대한 정보 표시\"\r\nt MSG_303 \"로그 보기\"\r\nt MSG_304 \"선택한 장치의 디스크 이미지 만들기\"\r\nt MSG_305 \"이 장치를 사용하여 다른 디스크에 Windows를 설치할지 또는 이 드라이브 (Windows To Go)에서 Windows를 직접 실행할지 여부를 지정하려면 이 옵션을 사용합니다.\"\r\nt MSG_306 \"드라이브 빠른 0 채우기: %s\"\r\nt MSG_307 \"시간이 걸릴 수 있습니다\"\r\nt MSG_308 \"VHD 감지\"\r\nt MSG_309 \"압축된 보관\"\r\nt MSG_310 \"선택한 ISO는 UEFI를 사용하며 EFI 시스템 파티션 (ESP)으로 작성할 수 있을 정도로 작습니다. 일부 유형의 설치에서는 전체 디스크를 차지하는 일반 데이터 파티션에 쓰는 대신 ESP에 쓰는 것이 바람직할 수 있습니다.\\n\\n이 이미지를 작성하는 데 사용할 모드를 선택하세요:\"\r\nt MSG_311 \"%s (기본 응용 프로그램 창에서)을(를) 사용하여 활성화합니다.\"\r\nt MSG_312 \"추가 해시 (SHA512)\"\r\nt MSG_313 \"VHD에 저장\"\r\nt MSG_314 \"이미지 체크섬 계산\"\r\nt MSG_315 \"다중 버튼\"\r\nt MSG_316 \"검사 통과 수\"\r\nt MSG_317 \"디스크 ID\"\r\nt MSG_318 \"기본 스레드 우선 순위: %d\"\r\nt MSG_319 \"부팅 마커 무시\"\r\nt MSG_320 \"파티션 레이아웃 (%s)을 새로 고치는 중...\"\r\nt MSG_321 \"선택한 이미지는 ISO 하이브리드이지만 제작자가 ISO/파일 복사 모드와 호환되도록 만들지 않았습니다.\\n이에 따라 DD 이미지 쓰기 모드가 적용됩니다.\"\r\nt MSG_322 \"'%s'을(를) 열거나 읽을 수 없습니다\"\r\nt MSG_325 \"Windows 사용자 지정 적용 중: %s\"\r\nt MSG_326 \"사용자 옵션을 적용하는 중...\"\r\nt MSG_327 \"Windows 사용자 환경\"\r\nt MSG_328 \"Windows 설치를 사용자 지정하시겠습니까?\"\r\nt MSG_329 \"4GB 이상의 RAM, Secure Boot 및 TPM 2.0에 대한 요구 사항 제거\"\r\nt MSG_330 \"온라인 Microsoft 계정에 대한 요구 사항 제거\"\r\nt MSG_331 \"데이터 수집 사용 안 함 (개인 정보 보호 질문 건너뛰기)\"\r\nt MSG_332 \"Windows To Go가 내부 디스크에 액세스하지 못하도록 차단\"\r\nt MSG_333 \"사용자 이름으로 로컬 계정 만들기:\"\r\nt MSG_334 \"이 사용자의 값과 동일한 값을 사용하여 국가별 옵션 설정\"\r\nt MSG_335 \"BitLocker 자동 장치 암호화 사용 안 함\"\r\nt MSG_336 \"영구 로그\"\r\nt MSG_337 \"이 기능을 사용하려면 Microsoft에서 추가 파일('%s')을 다운로드해야 합니다:\\n- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\\n- 작업을 취소하려면 '아니요'를 선택합니다\\n\\n참고: 해당 파일은 응용 프로그램의 디렉터리에 다운로드되며 존재하는 경우 자동으로 재사용됩니다.\"\r\nt MSG_338 \"취소된 UEFI 부트로더가 탐지됨\"\r\nt MSG_339 \"Rufus는 사용자가 선택한 ISO에 취소된 UEFI 부트로더가 포함되어 있으며, 이는 완전히 최신 UEFI 시스템에서 보안 부팅이 활성화된 경우에 %s을(를) 생성한다는 것을 감지했습니다.\\n\\n- 평판이 좋지 않은 소스에서 이 ISO 이미지를 가져온 경우 UEFI 멀웨어가 포함되어 있을 가능성을 고려하고 부팅을 피해야 합니다.\\n- 신뢰할 수 있는 소스에서 가져온 경우에는 보다 최신 버전을 찾아야 합니다. 그러면 이 경고가 발생하지 않습니다..\"\r\nt MSG_340 \"\\\"보안 위반\\\" 화면\"\r\nt MSG_341 \"%s이(가) 있는 Windows 복구 화면 (BSOD)\"\r\nt MSG_342 \"압축된 VHDX 이미지\"\r\nt MSG_343 \"압축되지 않은 VHD 이미지\"\r\nt MSG_344 \"전체 플래시 업데이트 이미지\"\r\nt MSG_345 \"이 기능을 사용하려면 Microsoft에서 몇 가지 추가 데이터를 다운로드해야 합니다:\\n- 인터넷에 연결하여 다운로드하려면 '예'를 선택합니다\\n- 작업을 취소하려면 '아니요'를 선택합니다\"\r\nt MSG_346 \"Windows를 S-Mode로 제한 (온라인 계정 우회와 호환되지 않음)\"\r\nt MSG_347 \"전문가 모드\"\r\nt MSG_348 \"압축 파일 추출 중: %s\"\r\nt MSG_349 \"Rufus MBR 사용\"\r\nt MSG_900 \"Rufus는 USB 메모리 및 플래시 드라이브를 포맷하고 부팅할 수 있도록 만드는 도구입니다.\"\r\nt MSG_901 \"공식 사이트: %s\"\r\nt MSG_902 \"소스 코드: %s\"\r\nt MSG_903 \"변경 사항: %s\"\r\nt MSG_904 \"이 응용 프로그램은 GNU Public License (GPL) 버전 3의 조건에 따라 라이선스가 부여됩니다.\\n자세한 내용은 https://www.gnu.org/licenses/gpl-3.0.html 을 참조하세요.\"\r\nt MSG_905 \"부팅\"\r\nt MSG_910 \"USB, 플래시 카드 및 가상 드라이브를 FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3로 포맷\"\r\nt MSG_911 \"FreeDOS 부팅 가능한 USB 드라이브 만들기\"\r\nt MSG_912 \"부팅 가능한 ISO (Windows, Linux 등)에서 부팅 가능한 드라이브 만들기\"\r\nt MSG_913 \"압축된 이미지를 포함하여 부팅 가능한 디스크 이미지에서 부팅 가능한 드라이브 만들기\"\r\nt MSG_914 \"UEFI 부팅 가능한 NTFS를 포함하여 BIOS 또는 UEFI 부팅 가능 드라이브 만들기\"\r\nt MSG_915 \"'Windows To Go' 드라이브 만들기\"\r\nt MSG_916 \"TPM 또는 보안 부팅이 없는 PC용 Windows 11 설치 드라이브 만들기\"\r\nt MSG_917 \"영구 리눅스 파티션 만들기\"\r\nt MSG_918 \"선택한 드라이브의 VHD/DD 이미지 만들기\"\r\nt MSG_919 \"선택한 이미지의 MD5, SHA-1, SHA-256 및 SHA-512 체크섬 계산\"\r\nt MSG_920 \"\\\"위조\\\" 플래시 드라이브 감지를 포함하여 불량 블록 검사 수행\"\r\nt MSG_921 \"공식 Microsoft Windows 리테일 ISO 다운로드\"\r\nt MSG_922 \"UEFI Shell ISO 다운로드\"\r\n\r\n#########################################################################\r\nl \"lv-LV\" \"Latvian (Latviešu)\" 0x0426\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Par Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licence\"\r\nt IDOK \"Apstiprināt\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Ierīces īpašības\"\r\nt IDS_DEVICE_TXT \"Ierīce\"\r\nt IDS_BOOT_SELECTION_TXT \"Ielādes izvēle\"\r\nt IDC_SELECT \"Izvēlēties\"\r\nt IDS_IMAGE_OPTION_TXT \"Virtuālā attēla īpašības\"\r\nt IDS_PARTITION_TYPE_TXT \"Sadaļas veids\"\r\nt IDS_TARGET_SYSTEM_TXT \"Datu nesēja failu sistēma\"\r\nt IDC_LIST_USB_HDD \"USB disku saraksts\"\r\nt IDC_OLD_BIOS_FIXES \"Pievienot vecāku BIOSu labojumus (partīcijām, dalījumam, u.c.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Ieslēgt UEFI nesēja pārbaudi izpildīšanas laikā\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Formatēšanas opcijas\"\r\nt IDS_FILE_SYSTEM_TXT \"Failu sistēma\"\r\nt IDS_CLUSTER_SIZE_TXT \"Bloka izmērs\"\r\nt IDS_LABEL_TXT \"Datu nesēja nosaukums\"\r\nt IDC_QUICK_FORMAT \"Ātrā formatēšana\"\r\nt IDC_BAD_BLOCKS \"Pārbaudīt ierīci uz bojātiem sektoriem\"\r\nt IDC_EXTENDED_LABEL \"Izveidot papildus nosaukumu un failu ikonas\"\r\nt IDS_STATUS_TXT \"Statuss\"\r\nt IDCANCEL \"Aizvērt\"\r\nt IDC_START \"Sākt\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Aizvērt\"\r\nt IDD_LICENSE \"Rufus licence\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Aizvērt\"\r\nt IDD_LOG \"Atskaite\"\r\nt IDC_LOG_CLEAR \"Dzēst\"\r\nt IDC_LOG_SAVE \"Saglabāt\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Aizvērt\"\r\nt IDD_NEW_VERSION \"Jaunākas versijas meklēšana\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Ir pieejama jaunāka programmas versija. Varat to lejupielādēt!\"\r\nt IDC_WEBSITE \"Piespiediet šeit lai pāriet uz programmas mājas lapu\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Piezīmes\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Lejupielādēt\"\r\nt IDC_DOWNLOAD \"Lejupielādēt\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Vairāk informācijas\"\r\nt IDYES \"Jā\"\r\nt IDNO \"Nē\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Aizvērt\"\r\nt IDD_UPDATE_POLICY \"Jaunināšanas noteikumi un uzstādījumi\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Uzstādījumi\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Pārbaudīt jauninājumus\"\r\nt IDS_INCLUDE_BETAS_TXT \"Ieskaitot Beta versijas\"\r\nt IDC_CHECK_NOW \"Pārbaudīt\"\r\n\r\nt MSG_001 \"Noteikta cita procesa esamība\"\r\nt MSG_002 \"Darbojas cits Rufus eksemplārs.\\nLūdzu aizveriet iepriekš startēto programmu pirms palaist no jauna.\"\r\nt MSG_003 \"UZMANĪBU: VISI DATI NO NESĒJA '%s' TIKS IZDZĒSTI!!!\\nTurpinājumam piespiediet OK. Lai atcelt, piespiediet Atcelt.\"\r\nt MSG_004 \"Rufus jaunināšanas noteikumi\"\r\nt MSG_005 \"Vai vēlaties atļaut programmai meklēt jauninājumus internetā?\"\r\nt MSG_006 \"Aizvērt\"\r\nt MSG_007 \"Atcelt\"\r\nt MSG_008 \"Jā\"\r\nt MSG_009 \"Nē\"\r\nt MSG_010 \"Atrasti bojāti sektori\"\r\nt MSG_011 \"Pārbaude pabeigta: atrasts(-i) %d bojāts(-i) sektors(-i)\\n  %d nolasīšanas kļūda(-s)\\n  %d ieraksta kļūda(-s)\\n  %d bojājuma(-u) kļūda(-s)\"\r\nt MSG_012 \"%s\\nSīkāku atskaiti var atrast:\\n%s\"\r\nt MSG_013 \"Atslēgt\"\r\nt MSG_014 \"Ik dienu\"\r\nt MSG_015 \"Ik nedēļu\"\r\nt MSG_016 \"Ik mēnesi\"\r\nt MSG_017 \"Citādi\"\r\nt MSG_018 \"Jūsu versija: %d.%d (Būvējums %d)\"\r\nt MSG_019 \"Pēdējā versija: %d.%d (Būvējums %d)\"\r\nt MSG_020 \"baiti\"\r\nt MSG_026 \"baiti\"\r\nt MSG_027 \"kilobaiti\"\r\nt MSG_028 \"megabaiti\"\r\nt MSG_029 \"Noklusējums\"\r\nt MSG_030 \"%s (Noklusējums)\"\r\nt MSG_031 \"BIOS (vai UEFI-CSM)\"\r\nt MSG_032 \"BIOS (bez CSM)\"\r\nt MSG_033 \"BIOS vai UEFI\"\r\nt MSG_034 \"%d mēģ.\"\r\nt MSG_035 \"%d mēģ. %s\"\r\nt MSG_036 \"ISO virtuālais attēls\"\r\nt MSG_037 \"Programma\"\r\nt MSG_038 \"Pārtraukt\"\r\nt MSG_039 \"Startēt\"\r\nt MSG_040 \"Lejupielādēt\"\r\nt MSG_041 \"Darbību atcēla lietotājs\"\r\nt MSG_042 \"Kļūda\"\r\nt MSG_043 \"Kļūda: %s\"\r\nt MSG_044 \"Fails lejuplādēts\"\r\nt MSG_045 \"USB atmiņas ierīce (Generic)\"\r\nt MSG_046 \"%s (Disks %d) [%s]\"\r\nt MSG_047 \"Vairākas partīcijas\"\r\nt MSG_048 \"Rufus - Buferu attīrīšana\"\r\nt MSG_049 \"Rufus - Darbības atcelšana\"\r\nt MSG_050 \"Veiksmīgi.\"\r\nt MSG_051 \"Nezināma formatēšanas kļūda.\"\r\nt MSG_052 \"Šim nesējam nevar izmantot izvēlēto failu sistēmu.\"\r\nt MSG_053 \"Piekļuve iekārtai liegta.\"\r\nt MSG_054 \"Iekārta aizsargāta no ieraksta.\"\r\nt MSG_055 \"Iekārtu izmanto kāds cits process. Lai izmantot izvēlēto iekārtu aizveriet citu procesu.\"\r\nt MSG_056 \"Šai ierīcei ātrā formatēšana nav iespējama.\"\r\nt MSG_057 \"Ierīces nosaukums nav korekts.\"\r\nt MSG_058 \"Ierīces pazīme nav korekta.\"\r\nt MSG_059 \"Izvēlētais klastera izmērs nesader ar šo ierīci.\"\r\nt MSG_060 \"Nekorekts partīcijas izmērs.\"\r\nt MSG_061 \"Lūdzu ievietojiet datu nesēju.\"\r\nt MSG_062 \"Tika saņemta neatbalstāma komanda.\"\r\nt MSG_063 \"Atmiņas iedalīšanas kļūda.\"\r\nt MSG_064 \"Nolasīšanas kļūda.\"\r\nt MSG_065 \"Ieraksta kļūda.\"\r\nt MSG_066 \"Nesekmīga instalācija\"\r\nt MSG_067 \"Nevar atvērt ierīci. Iespējams, to izmanto kāds cits process. Atvienojiet ierīci, un pieslēdziet no jauna.\"\r\nt MSG_068 \"Diska veidošanas kļūda.\"\r\nt MSG_069 \"Neizdevās nokopēt failus uz ierīci.\"\r\nt MSG_070 \"Darbību atcēla lietotājs.\"\r\nt MSG_071 \"Neizdevās palaist izpildes plūsmu.\"\r\nt MSG_072 \"Bojāto sektoru pārbaude netika pabeigta.\"\r\nt MSG_073 \"ISO virtuālā attēla pārbaudes kļūda.\"\r\nt MSG_074 \"ISO virtuālā attēla atpakošanas kļūda.\"\r\nt MSG_075 \"Neizdevās izveidot disku.\"\r\nt MSG_076 \"Neizdevās izveidot failus ielādei.\"\r\nt MSG_077 \"Neizdevās diskam piešķirt burtu.\"\r\nt MSG_078 \"Neizdevās izveidot GUID disku.\"\r\nt MSG_079 \"Ierīce nav gatava.\"\r\nt MSG_080 \"Rufus noteica ka Windows nav beidzis darbu ar USB ierīces ātrpiekļuves buferi.\\n\\nAtkarībā no USB ierīces ātruma šīs operācijas pabeigšana var aizņemt ilgāku laiku, īpaši lielākiem failiem.\\n\\nIeteikums: sagaidīt Windows darbības beigas, lai nesabojāt ierīci. Ja jums nav iespējas gaidīt, varat vienkārši atvienot ierīci...\"\r\nt MSG_081 \"Neatbalstāms virtuālā attēla formāts\"\r\nt MSG_082 \"Izvēlētais virtuālais attēls nav ielādes, jeb izmanto Rufus nezināmu ielādes metodi vai saspiešanas formātu.\"\r\nt MSG_083 \"Aizvietot %s?\"\r\nt MSG_084 \"Šis ISO virtuālais attēls izmanto novecojušas versijas '%s'.\\nIelādes komandkarte var attēloties nekorekti.\\n\\nŠīs kļūdas novēršanai jāielādē jaunāka Rufus versija:\\n- Izvēlieties 'Jā' lai pieslēgtos pie interneta un ielādētu jaunāku versiju\\n- Izvēlieties 'Nē' lai ISO fails paliktu nemainīts\\nJa nezināt ko darīt, izvēlieties 'Jā'.\\n\\nPiezīme: Jaunais fails tiks lejupielādēts tekošajā mapē, un eksistējošais '%s' automātiski tiks samainīts.\"\r\nt MSG_085 \"Lejuplādēts %s\"\r\nt MSG_086 \"Nav izvēlēts virtuālais attēls\"\r\nt MSG_087 \"no %s NAND\"\r\nt MSG_088 \"Virtuālais attēls pārāk liels\"\r\nt MSG_089 \"Izvēlētajam nesējam virtuālais attēls pārāk liels.\"\r\nt MSG_090 \"Neatbalstāms ISO formāts\"\r\nt MSG_091 \"Izmantojot sistēmas interfeisu UEFI tikai EFI atbalsta ISO ielādes virtuālo attēlu. Izvēlieties EFI ielādes ISO failu vai izvēlieties interfeisu BIOS.\"\r\nt MSG_092 \"Neatbalstāma failu sistēma\"\r\nt MSG_093 \"SVARĪGI: ŠIS NESĒJS SATUR VAIRĀKAS PARTĪCIJAS!!\\n\\nNesējs var saturēt sadaļas kuras nav attēlotas vai redzamas no Windows OS. Ja vēlaties turpināt, paši esat atbildīgi par datu zaudēšanu uz šādām partīcijām.\"\r\nt MSG_094 \"Konstatētas vairākas partīcijas\"\r\nt MSG_095 \"DD virtuālais attēls\"\r\nt MSG_096 \"Tekošā failu sistēma nevar tikt izmantota ar šo ISO tipu. Izvēlieties citu failu sistēmu vai citu ISO failu.\"\r\nt MSG_097 \"'%s' var izmantot tikai ar NTFS failu sistēmu.\"\r\nt MSG_098 \"SVARĪGI: Jūs mēģinat instalēt 'Windows To Go', bet izvēlētajam diskam nav nepieciešamā atribūta 'FIKSĒTS', līdz ar to Windows ielāde visticamāk nenotiks, jo šis Microsoft produkts neatbalsta iekārtas kurām ir atribūts 'NOŅEMAMS'. \\n\\nVai vēlaties turpināt?\\n\\nPiezīme: Atribūtu 'FIKSĒTS/NOŅEMAMS' var mainīt tikai iekārtas uzstādījumos izmantojot rīkus no iekārtas ražotāja. Šādi rīki parasti brīvā piekļuvē NETIEK IZVIETOTI...\"\r\nt MSG_099 \"Failu sistēmas ierobežojums\"\r\nt MSG_100 \"Šis ISO virtuālais attēls satur failu(-s) lielāku(-s) par 4 GB, kas ir vairāk nekā maksimāli pieļaujamais apjoms izmantojot FAT vai FAT32 failu sistēmu.\"\r\nt MSG_101 \"Kļūdains WIM atbalsts\"\r\nt MSG_102 \"Jūsu OS nevar atpakot failus no WIM arhīviem. Savukārt tas nepieciešams EFI ielādes diska izveidei OS Windows 7 vai Windows Vista USB diskiem. To var izlabot instalējot pēdējo 7-Zip versiju.\\nVai vēlaties apmeklēt 7-zip ielādes mājas lapu?\"\r\nt MSG_103 \"Lejuplādēts %s?\"\r\nt MSG_104 \"Instalācijai nepieciešama %s vai jaunāka faila '%s' versija.\\nTā kā fails ir lielāks par 100 KB, un pieder %s ISO virtuālajiem attēliem, tas netika iekļauts programmā Rufus.\\n\\nRufus var ielādēt nepieciešamo failu:\\n- Izvēlieties 'Jā' lai pieslēgties internetam un ielādētu failu\\n- Izvēlieties 'Nē' ja vēlaties failu ielādēt vēlāk patstāvīgi\\n\\nPiezīme: Fails tiks lejuplādēts tekošajā mapē un ja '%s' jau ir, tas tiks pārrakstīts automātiski.\"\r\nt MSG_105 \"Darbības atcelšana var iekārtu atstāt kā NEIZMANTOJAMU.\\nJa vēlaties atcelt, spiediet JĀ, pretējā gadījumā spiediet NĒ.\"\r\nt MSG_106 \"Izvēlieties mapi\"\r\nt MSG_107 \"Visi faili\"\r\nt MSG_108 \"Rufus logs\"\r\nt MSG_109 \"0x%02X (Disks %d)\"\r\nt MSG_110 \"MS-DOS nevar ielādēties no nesēja ar klastera izmēru 64 Kb.\\nPamainiet klastera izmēru izmantojot FreeDOS.\"\r\nt MSG_111 \"Nekorekts klastera izmērs\"\r\nt MSG_112 \"Large UDF disku formatēšana var aizņemt daudz laika. Izmantojot USB 2.0 aprēķinātais formatēšanas ilgums ir %d:%02d, kura laikā izpildes līnija var apstāties. Esiet pacietīgi!\"\r\nt MSG_113 \"Large UDF disks\"\r\nt MSG_114 \"Šis virtuālais attēls izmanto Syslinux %s%s, bet programma satur instalācijas failus Syslinux %s%s.\\n\\nTā kā jaunās Syslinux versijas nav savstarpēji atbalstāmas, nepieciešams ielādēt no interneta vajadzīgos failus ('ldlinux.sys' un 'ldlinux.bss'):\\n- Izvēlieties 'Jā' lai pieslēgtos pie interneta un mēģināt ielādētu šos failus\\n- Izvēlieties 'Nē' lai atceltu šo darbību\\n\\nPiezīme: Faili tiks lejuplādēti tekošajā mapē, un ja tādi eksistē, automātiski tiks pārrakstīti.\"\r\nt MSG_115 \"Nepieciešams lejuplādēt\"\r\nt MSG_116 \"Šis virtuālais attēls izmanto Grub %s bet programma satur instalācijas failus Grub %s.\\n\\nTā kā jaunās Grub versijas nav savstarpēji atbalstāmas, un visas versijas iekļaut nav iespējams, Rufus mēģinās noteikt Grub instalācijas faila versiju ('core.img') kuru meklēs Jūsu virtuālajā attēlā:\\n- Izvēlieties 'Jā' lai pieslēgtos pie interneta un mēģināt ielādētu šos failus\\n- Izvēlieties 'Nē' lai izmantot noklusējuma versiju, kuru iekļauj Rufus\\n- Izvēlieties 'Atcelt' lai atceltu šo darbību\\n\\nPiezīme: Faili tiks lejuplādēti tekošajā mapē, un ja tādi eksistē, automātiski tiks pārrakstīti. Ja Internetā netiks atrasta meklējamā versija, tiks izmantots fails iekļautais Rufus.\"\r\nt MSG_117 \"Windows standarta instalācija\"\r\nt MSG_119 \"diska paplašinātās īpašības\"\r\nt MSG_120 \"formatēšanas paplašinātās īpašības\"\r\nt MSG_121 \"Rādīt %s\"\r\nt MSG_122 \"Slēpt %s\"\r\nt MSG_123 \"Fiksētā apjoma sadaļa\"\r\nt MSG_124 \"Nav sadaļas\"\r\nt MSG_125 \"Fiksētās sadaļas apjoma izvēle uz USB nesēja. Ja nav fiksētās sadaļas ievadiet 0.\"\r\nt MSG_126 \"Fiksētās sadaļas apjoma mērvienības.\"\r\nt MSG_127 \"Nerādīt šo paziņojumu atkārtoti\"\r\nt MSG_128 \"Svarīgs paziņojums par %s\"\r\nt MSG_129 \"Tikko tika izveidots nesējs ar UEFI:NTFS ielādi. Atcerieties, lai piestartēt no šīs ierīces NEPIECIEŠAMS ATSLĒGT SECURE BOOT.\\nPapildus informāciju var iegūt piespiežot pogu 'Vairāk informācijas'.\"\r\nt MSG_130 \"Windows virtuālā attēla izvēle\"\r\nt MSG_131 \"Šis ISO satur vairāku Windows OS virtuālos attēlus.\\nIzvēlieties virtuālo attēlu, kuru vēlaties izmantot instalācijai:\"\r\nt MSG_132 \"Citai programmai vai procesam ir piekļuve šai ierīcei. Vienalga vēlaties formatēt?\"\r\nt MSG_133 \"Rufus noteica, ka mēģinat veidot Windows To Go disku formātā 1809 ISO\\n\\nAtsaucoties uz *MICROSOFT BUG*, šis nesējs var izsaukt Windows ielādes kļūdu (BSOD), šādā gadījumā nepieciešams manuāli samainīt 'WppRecorder.sys' failu uz 1803 versiju.\\n\\nRufus automātiski nemaina šo failu, jo 'WppRecorder.sys' ir Microsoft īpašums, un legāli ievietot failu programmā nav iespējams...\"\r\nt MSG_134 \"Tā kā par ielādes sadaļu tika izvēlēts MBR, Rufus var izveidot sadaļu ar apjomu līdz 2 TB, pēc kā paliks %s brīvi pieejamas diska vietas papildus sadaļām.\\n\\nVēlaties turpināt?\"\r\nt MSG_135 \"Versija\"\r\nt MSG_136 \"Laidiens\"\r\nt MSG_137 \"Redakcija\"\r\nt MSG_138 \"Valoda\"\r\nt MSG_139 \"Arhitektūra\"\r\nt MSG_140 \"Turpināt\"\r\nt MSG_141 \"Atpakaļ\"\r\nt MSG_142 \"Uzgaidiet...\"\r\nt MSG_143 \"Lejuplādēt izmantojot pārlūkprogrammu\"\r\nt MSG_144 \"Windows ISO fails nav lejupielādējams, jo Microsoft ir izmainījuši piekļuvi lai to liegtu.\"\r\nt MSG_145 \"Šī skripta darbībai nepieciešams PowerShell 3.0 vai vēlāks.\"\r\nt MSG_146 \"Vēlaties to ielādēt tiešsaistē?\"\r\nt MSG_148 \"Darbojas skripta lejupielāde...\"\r\nt MSG_149 \"Lejuplādēt ISO virtuālo attēlu\"\r\nt MSG_150 \"Datora tips, uz kāda tiks izmantota ielāde no šīs iekārtas. Jūs esat atbildīgi par savu izvēli, nepareizi norādot BIOS vai UEFI ielādes veidu izveidotais disks var nedarboties kā ielādes disks.\"\r\nt MSG_151 \"'UEFI-CSM' nozīmē, ka iekārta ielādei izmantos BIOSa emulāciju (zināmu arī kā 'Legacy Mode'), un nedarbosies UEFI režīmā.\"\r\nt MSG_152 \"'bez CSM' nozīmē, ka iekārta ielādei izmantos UEFI režīmu, un nedarbosies BIOSa emulācijas režīmā (zināms arī kā 'Legacy Mode').\"\r\nt MSG_153 \"Bojāto sektoru noteikšana izmantojot 1 mēģinājumu\"\r\nt MSG_154 \"Bojāto sektoru noteikšana izmantojot 2 mēģinājumus\"\r\nt MSG_155 \"Bojāto sektoru noteikšana izmantojot 3 mēģinājumus\"\r\nt MSG_156 \"Bojāto sektoru noteikšana izmantojot 4 mēģinājumus\"\r\nt MSG_157 \"Failu sistēmas izvēlne\"\r\nt MSG_158 \"Minimālais failu sistēmas izmantojamā bloka izmērs\"\r\nt MSG_159 \"Ievadiet nesēja nosaukumu.\\nAtbalstās starptautiskie simboli.\"\r\nt MSG_160 \"Atvērt papildus parametrus\"\r\nt MSG_161 \"Atzīmējiet lai pārbaudīt ierīci uz bojātiem sektoriem\"\r\nt MSG_162 \"Noņemiet atzīmi lai izmantot \\\"lēno\\\" formatēšanu\"\r\nt MSG_163 \"Sadaļu veidošanas metode\"\r\nt MSG_164 \"Ielādes varianti\"\r\nt MSG_165 \"Piespiediet virtuālā attēla izvēlei...\"\r\nt MSG_166 \"Atzīmējiet starptautisko simbolu atbalstam un ierīces ikonas izveidei (tiek izveidots fails autorun.inf)\"\r\nt MSG_167 \"Instalēt MBR, kur var izvēlēties ielādi un kurš var maskēties BIOS'ā ar ierīces identifikatoru\"\r\nt MSG_169 \"Izveidot papildus slēpto partīciju un izlīdzināt partīciju robežas.\\nŠī opcija var atvieglot ielādes noteikšanu vecākās BIOS versijās.\"\r\nt MSG_170 \"Rādīt ārējos USB pieslēguma HDD. IZMANTOJAT UZ SAVAS ATBILDĪBAS!!!\"\r\nt MSG_171 \"Tiks sākta formatēšana.\\nVisi dati no nesēja tiks IZNĪCINĀTI!!!\"\r\nt MSG_172 \"Nekorekts lejupielādes paraksts\"\r\nt MSG_173 \"Piespiediet izvēlei...\"\r\nt MSG_174 \"Rufus - uzticama un vienkārša USB formatēšanas utilīta\"\r\nt MSG_175 \"Versija %d.%d (Build %d)\"\r\nt MSG_176 \"Latviešu tulkojums: Aldis Tutins <mailto:alibaba@inbox.lv>\"\r\nt MSG_177 \"Paziņot par kļūdu vai ieteikt uzlabojumus:\"\r\nt MSG_178 \"Papildus autortiesības:\"\r\nt MSG_179 \"Jauninājumu politika:\"\r\nt MSG_180 \"Ja jūs ļaujat programmai veikt jauninājumus, jūs piekrītat tam ka uz mūsu serveriem tiks saglabāta sekojoša informācija:\"\r\nt MSG_181 \"Jūsu OS arhitektūra un versija\"\r\nt MSG_182 \"Izmantojamās programmas versija\"\r\nt MSG_183 \"Jūsu IP adrese\"\r\nt MSG_184 \"Statistikas nolūkos apkopotā informācija var tikt uzglabāta \\\\b gada laikā\\\\b0 . Savukārt apkopotā informācija netiks izpausta jebkādai trešai pusei.\"\r\nt MSG_185 \"Jaunināšanas process:\"\r\nt MSG_186 \"Rufus netiek instalēta kā OS serviss, tāpēc jauninājumu pārbaude iespējama tikai tad, kad programma darbojas.\\\\line\\n\\nJauninājumu pārbaudei un ielādei nepieciešams interneta pieslēgums.\"\r\nt MSG_187 \"Izvēlētajai ielādes opcijai nederīgs virtuālais attēls\"\r\nt MSG_188 \"Izvēlētais virtuālais attēls neatbalsta izvēlēto ielādes variantu. Lūdzu izvēlieties citu virtuālo attēlu vai citas ielādes opcijas.\"\r\nt MSG_189 \"Šis ISO virtuālais attēls neatbalstās ar izvēlēto failu sistēmu\"\r\nt MSG_190 \"Noteikts neatbalstāms nesējs\"\r\nt MSG_191 \"Mēģinājums\"\r\nt MSG_192 \"Nolasīts\"\r\nt MSG_193 \"Ielādēts %s\"\r\nt MSG_194 \"Nevar ielādēt %s\"\r\nt MSG_195 \"Izmantot %s faila(u) iekļauto versiju\"\r\nt MSG_196 \"SVARĪGI: ŠĪ IEKĀRTA IZMANTO NESTANDARTA SEKTORU IZMĒRU!\\n\\nParasti iekārtas izmanto 512-bitu sektora izmēru, bet šī iekārta izmanto %d-bitu. Visbiežāk tas nozīmē ka no šī diska NEVARĒS ielādēties no šīs ierīces.\\nRufus var mēģināt izveidot ielādes diesku, bet NEGARANTĒ tā korektu darbību.\"\r\nt MSG_197 \"Noteikts nestandarta sektoru izmērs\"\r\nt MSG_198 \"'Windows To Go' var tikt instalēts tikai uz GPT failu sistēmas nesēja, ja tam ir atribūts 'FIKSĒTS'. Tekošai ierīcei NAV noteikts atribūts 'FIKSĒTS'.\"\r\nt MSG_199 \"Šī iespēja dotajai OS nav pieejama.\"\r\nt MSG_201 \"Atcelšana - lūdzu uzgaidiet...\"\r\nt MSG_202 \"Diska virtuālā attēla pārskats...\"\r\nt MSG_203 \"Kļūda pārskatot diska virtuālo attēlu\"\r\nt MSG_204 \"Noteikts novecojis %s modulis\"\r\nt MSG_205 \"Tiek izmantots virtuālais attēls: %s\"\r\nt MSG_206 \"Kļūdains %s fails\"\r\nt MSG_207 \"Jauns Disks\"\r\nt MSG_208 \"Atrasta %d ierīce\"\r\nt MSG_209 \"Atrastas %d ierīces\"\r\nt MSG_210 \"Gatavs darbam\"\r\nt MSG_211 \"Darbība atcelta\"\r\nt MSG_212 \"Kļūda\"\r\nt MSG_213 \"Tiek startēta jaunā versija...\"\r\nt MSG_214 \"Kļūda jaunās versijas palaišanā\"\r\nt MSG_215 \"Atvērts %s\"\r\nt MSG_216 \"Saglabāts %s\"\r\nt MSG_217 \"Formatēšana: %s\"\r\nt MSG_218 \"Failu sistēmas izveide: Paveikts %d/%d\"\r\nt MSG_219 \"NTFS labojums: Paveikts %d%%\"\r\nt MSG_220 \"Formatēšana (%s) - aprēķinātais laiks %d:%02d...\"\r\nt MSG_221 \"Nosaukuma ieraksts (%s)...\"\r\nt MSG_222 \"Formatēšana (%s)...\"\r\nt MSG_223 \"NTFS labojums (Checkdisk)...\"\r\nt MSG_224 \"MBR/PBR/GPT struktūras attīrīšana...\"\r\nt MSG_225 \"Nepieciešama piekļuve diskam...\"\r\nt MSG_226 \"Esošā ielādes ieraksta analīze...\"\r\nt MSG_227 \"Eksistējošā diska aizvēršana...\"\r\nt MSG_228 \"Galvenā ielādes ieraksta (MBR) izveide...\"\r\nt MSG_229 \"Sadaļas ielādes ieraksta izveide...\"\r\nt MSG_230 \"Kopē DOS failus...\"\r\nt MSG_231 \"Kopē ISO failus: %s\"\r\nt MSG_232 \"Win7 EFI ielādes uzstādīšana (%s)...\"\r\nt MSG_233 \"Pabeigšana, lūdzu uzgaidiet...\"\r\nt MSG_234 \"Instalējas Syslinux %s...\"\r\nt MSG_235 \"Bojātie sektori: %s %d/%d - %0.2f%% (%d/%d/%d kļūdu)\"\r\nt MSG_236 \"Bojātie sektori: Testēšana pēc nejaušā šablona\"\r\nt MSG_237 \"Bojātie sektori: Testēšana ar 0x%02X\"\r\nt MSG_238 \"Sadaļas izveide (%s)...\"\r\nt MSG_239 \"Sadaļas dzēšana (%s)...\"\r\nt MSG_240 \"Lejupielādes paraksts nav apstiprināts. Tas nozīmē, ka lejupielādētais fails ir vai nu bojāts, vai satur kādu vīrusu.\\n\\nLejupielādētais fails tiks izdzēsts.\"\r\nt MSG_241 \"Lejupielādē: %s\"\r\nt MSG_242 \"Kļūda lejuplādējot failu.\"\r\nt MSG_243 \"Tiek pārbaudīti Rufus jauninājumi...\"\r\nt MSG_244 \"Jauninājumi: Nevar pieslēgties internetam\"\r\nt MSG_245 \"Jauninājumi: Nav piekļuves versijas datiem\"\r\nt MSG_246 \"Ir pieejama jaunāka Rufus versija!\"\r\nt MSG_247 \"Nav atrasta jaunāka Rufus versija\"\r\nt MSG_248 \"Programmas reģistru ieraksti veiksmīgi dzēsti\"\r\nt MSG_249 \"Kļūda programmas reģistru dzēšanā\"\r\nt MSG_250 \"%s ieslēgta\"\r\nt MSG_251 \"%s izslēgta\"\r\nt MSG_252 \"Izmēra pārbaude\"\r\nt MSG_253 \"Iekšējo disku noteikšana\"\r\nt MSG_254 \"Paplašinātā FAT32 formatēšana\"\r\nt MSG_255 \"NoDriveTypeAutorun pārtraucot darbu tiks nodzēsts\"\r\nt MSG_256 \"Konstatēts neeksistējošs disks\"\r\nt MSG_257 \"Joliet atbalsts\"\r\nt MSG_258 \"Rock Ridge atbalsts\"\r\nt MSG_259 \"Piespiedu jaunināšana\"\r\nt MSG_260 \"NTFS kompresija\"\r\nt MSG_261 \"Virtuālā attēla ieraksts: %s\"\r\nt MSG_262 \"ISO atbalsts\"\r\nt MSG_263 \"Izvēlieties atbilstošas vienības\"\r\nt MSG_264 \"Tiek dzēsta mape '%s'\"\r\nt MSG_265 \"Noteikts VMWare disks\"\r\nt MSG_266 \"Apvienotais UEFI/BIOS režīms\"\r\nt MSG_267 \"Pielietots Windows virtuālais attēls: %s\"\r\nt MSG_268 \"Pielietots Windows virtuālais attēls...\"\r\nt MSG_269 \"Saglabāt laika zīmogu\"\r\nt MSG_270 \"USB-atkļūdošana\"\r\nt MSG_271 \"Kontrolsummu skaitļošana: %s\"\r\nt MSG_272 \"Izskaitļot MD5, SHA1 un SHA256 kontrolsummas izvēlētajam virtuālajam attēlam\"\r\nt MSG_273 \"Mainīt programmas valodu\"\r\nt MSG_274 \"Pamanīts %s-virtuālais attēls\"\r\nt MSG_275 \"Izvēlētajam virtuālajam attēlam ir 'ISOHybrid' formāts. Tas nozīmē ka virtuālo attēlu var ierakstīt vai %s kopēšanas režīmā, vai %s diska virtuālā attēla režīmā.\\nIeteicams izmantot %s režīmu pilnīgai piekļuvei diska saturam pēc ieraksta.\\nJa ielādes laikā rodas problēmas, Jūs varat atkārtoti mēģināt ierakstīt virtuālo attēlu %s režīmā.\\n\\nLūdzu, izvēlieties režīmu, kurš tiks izmantots izvēlētā virtuālā attēla ierakstam:\"\r\nt MSG_276 \"Ierakstīt %s režīmā (Ieteicams)\"\r\nt MSG_277 \"Ierakstīt %s režīmā\"\r\nt MSG_278 \"Procesu konfliktu pārbaude...\"\r\nt MSG_279 \"Neielādējams virtuālais attēls\"\r\nt MSG_280 \"Disks vai ISO virtuālais attēls\"\r\nt MSG_281 \"%s (Izvēlieties)\"\r\nt MSG_282 \"Ekskluzīva USB nesēja slēgšana\"\r\nt MSG_283 \"Nederīgs paraksts\"\r\nt MSG_284 \"Ielādētajam izpildfailam ir kļūdains ciparu paraksts.\"\r\nt MSG_285 \"Ielādētais izpildfails parakstīts kā '%s'.\\nTas ir neatpazīts paraksts un iespējams, var radīt aizdomīgas aktivitātes...\\nVai tiešām vēlaties izpildīt šo failu?\"\r\nt MSG_286 \"Diska nullēšana: %s\"\r\nt MSG_287 \"neUSB disku noteikšana\"\r\nt MSG_288 \"Nepietiekamas lietotāja tiesības\"\r\nt MSG_289 \"Šai programmai nepieciešamas speciālas tiesības\"\r\nt MSG_290 \"Failu indeksācija\"\r\nt MSG_291 \"Versijas izvēle\"\r\nt MSG_292 \"Izvēlieties Windows versiju, kuru vēlaties instalēt:\"\r\nt MSG_293 \"Neatbalstāma Windows versija\"\r\nt MSG_294 \"Šo Windows versiju Rufus vairs neatbalsta.\\nPēdējā Rufus atbalstāmā versija šai OS ir v%d.%d.\"\r\nt MSG_295 \"Uzmanību: Neoficiāla programmas versija\"\r\nt MSG_296 \"Šī Rufus versija nav no oficiālā izstrādātāja.\\n\\nVai tiešām vēlaties to izmantot?\"\r\nt MSG_297 \"Noteikts samazināts ISO\"\r\nt MSG_298 \"Izvēlētais ISO fails neatbilst noteiktajam izmēram: %s datu ir kļūdaini!\\n\\nJa šis fails tika lejuplādēts no Interneta, nepieciešams lejuplādēt no jauna un pārbaudīt MD5 vai SHA kontrolsummu atbilstību.\\n\\nPiezīme: aprēķināt MD5 vai SHA kontrolsummu programmā Rufus var piespiežot taustiņu (✓).\"\r\nt MSG_299 \"Laika zīmoga kļūda\"\r\nt MSG_300 \"Rufus neizdevās identificēt jauninājuma laika zīmogu, kā jaunāku attiecībā pret pašreizējo.\\n\\nLai nepieļaut iespējamu ļaundarības varbūtību, programmas jaunināšanas process tika pārtraukts, un lejuplādētais fails tika izdzēsts. Sīkākai informācijai pārbaudiet atskaiti.\"\r\nt MSG_301 \"Programmas uzstādījumi\"\r\nt MSG_302 \"Informācija par programmu\"\r\nt MSG_303 \"Rādīt atskaiti\"\r\nt MSG_304 \"Veidot virtuālo attēlu no izvēlētās iekārtas\"\r\nt MSG_305 \"Izmantojiet šo opciju, lai norādīt vai vēlaties izmantot ierīci Windows instalēšanai uz cita diska, vai vēlaties startēt Windows no šīs ierīces (Windows To Go).\"\r\nt MSG_306 \"Ātrā diska nullēšana: %s\"\r\nt MSG_307 \"šī darbība var aizņemt laiku\"\r\nt MSG_308 \"Noteikts VHD\"\r\nt MSG_309 \"Saspiests arhīvs\"\r\nt MSG_310 \"Izvēlētais ISO-fails izmanto UEFI un ir pietiekoši mazs, lai varētu tikt ierakstīts, kā EFI (ESP) sistēmas sadaļa. Ieraksts iekš ESP, nevis kopējā datu sadaļā, kas aizņem visu disku, var būt ieteicamāks dažu ielāžu tipiem.\\n\\nIzvēlieties to režīmu, kuru nepieciešams izmantot lai ierakstīt šo virtuālo attēlu:\"\r\nt MSG_311 \"Lai ieslēgt, izmantojiet %s programmas galvenajā izvēlnē.\"\r\nt MSG_312 \"Ekstra heši (SHA512)\"\r\nt MSG_313 \"Saglabāt VHD\"\r\nt MSG_314 \"Izskaitļo virtuālo attēlu kontrolsummas\"\r\nt MSG_315 \"Vairāk pogu\"\r\nt MSG_316 \"Mēģinājumu skaits\"\r\nt MSG_317 \"Diska ID\"\r\nt MSG_318 \"Noklusējuma prioritāte: %d\"\r\nt MSG_319 \"Ignorēt ielādes marķeri\"\r\nt MSG_320 \"Atjauno sadaļas izkārtojumu (%s)...\"\r\nt MSG_321 \"Izvēlētais virtuālais attēls ir ISOHybrid, bet tā veidotājs nav izveidojis ISO/Failu kopēšanas .\\nTiks izmantots DD virtuālā attēla kopēšanas režīms.\"\r\nt MSG_322 \"Neizdevās atvērt vai izlasīt '%s'\"\r\nt MSG_325 \"Pielietot Windows kastomizāciju: %s\"\r\nt MSG_326 \"Lietotāja opciju pielietošana...\"\r\nt MSG_327 \"Windows lietotāju pieredze\"\r\nt MSG_328 \"Izvēles Windows instalācija?\"\r\nt MSG_329 \"Atslēgt prasības priekš 4GB+ RAM, Secure Boot un TPM 2.0\"\r\nt MSG_330 \"Atslēgt prasību Microsoft kontam\"\r\nt MSG_331 \"Atslēgt datu nodošanu (Izlaist jautājumus par privātumu)\"\r\nt MSG_332 \"Aizliegt Windows To Go piekļuvi iekšējiem nesējiem\"\r\nt MSG_333 \"Izveidot lokālo kontu ar lietotājvārdu:\"\r\nt MSG_334 \"Izvēlēties reģionālos uzstādījumus kā šim lietotājam\"\r\nt MSG_335 \"Atslēgt automātisko šifrēšanu ar BitLocker\"\r\nt MSG_336 \"Pastāvīgs žurnāls\"\r\nt MSG_337 \"Lai izmantotu šo funkciju, no Microsoft ir jālejupielādē papildu fails («%s»):\\n- Izvēlieties «Jā», lai pieslēgties pie Interneta un failu lejuplādēt.\\n- Izvēlieties «Nē», lai atcelt darbību.\\n\\nPiezīme. Fails tiks lejuplādēts programmas mapē, ja tas jau eksistē, tiks izmantots atkārtoti.\"\r\nt MSG_338 \"Pamanīts atceltais UEFI ielādes ieraksts\"\r\nt MSG_339 \"Rufus konstatēja Jūsu izvēlētais ISO-fails satur atceltu UEFI ielādes ierakstu, kurš izdos %s, ja būs ieslēgta drošā ielāde pilnīgi jauninātajā UEFI sistēmā.\\n\\n- Ja šis ISO fails ir iegūts no nedrošiem avotiem, vajag ņemt vērā, ka tas var saturēt UEFI ļaunatūru un censties no tā nestartēt.\\n- Ja fails iegūts no droša avota, būtu jāatrod jaunāka versija, kurai nerādīs šādu brīdinājumu.\"\r\nt MSG_340 \"a \\\"Drošības pārkāpuma\\\" ekrāns\"\r\nt MSG_341 \"a Windows atkopšanas ekrāns (BSOD) ar '%s'\"\r\nt MSG_342 \"Saspiests VHDX attēls\"\r\nt MSG_343 \"Nesaspiests VHDX attēls\"\r\nt MSG_344 \"Full Flash atjauninājuma attēls\"\r\nt MSG_345 \"Lai izmantotu šo funkcionalitāti, no Microsoft ir jālejupielādē daži papildus dati:\\n- Izvēlieties 'Jā', lai izveidotu savienojumu ar Internetu un lejupielādētu tos\\n- Izvēlieties \\\"Nē\\\", lai atceltu darbību\"\r\nt MSG_346 \"Ierobežot Windows tikai S režīmā (NESADERĪGS ar tiešsaistes konta apiešanu)\"\r\nt MSG_347 \"Eksperta režīms\"\r\nt MSG_348 \"Atpakot arhīva failus: %s\"\r\nt MSG_349 \"Izmantot Rufus MBR\"\r\nt MSG_900 \"Rufus ir instruments ar kura palīdzību var formatēt un izveidot USB ielādes ierīces uz tādiem nesējiem, kā USB pieslēguma zibatmiņas, atmiņas kartes u.c.\"\r\nt MSG_901 \"Oficiālā mājas lapa: %s\"\r\nt MSG_902 \"Sākotnējais kods: %s\"\r\nt MSG_903 \"Izmaiņas: %s\"\r\nt MSG_904 \"Šai programmai ir licences noteikumi, kā GNU Public License (GPL) version 3.\\nPapildinformācijai skatīt https://www.gnu.org/licenses/gpl-3.0.html.\"\r\nt MSG_905 \"Ielāde\"\r\nt MSG_910 \"Formatē USB, atmiņas kartes un virtuālos diskus formātos FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Izveido FreeDOS ielādes USB ierīces\"\r\nt MSG_912 \"Izveido ielādes ierīces no ISO failiem (Windows, Linux, u.c.)\"\r\nt MSG_913 \"Izveido ielādes ierīces no ielādes disku virtuālajiem attēliem, tai skaitā arī no saspiestajiem\"\r\nt MSG_914 \"Izveido BIOS vai UEFI ielādes ierīces, ieskaitot UEFI ielādi no NTFS\"\r\nt MSG_915 \"Izveido 'Windows To Go' ierīces\"\r\nt MSG_916 \"Izveido Windows 11 instalācijas ierīces datoriem, kam nav TPM vai Secure Boot\"\r\nt MSG_917 \"Izveido pastāvīgas Linux partīcijas\"\r\nt MSG_918 \"Izveido izvēlētā diska VHD/DD virtuālos attēlus\"\r\nt MSG_919 \"Izskaitļo izvēlētā virtuālā attēla MD5, SHA-1, SHA-256 un SHA-512 kontrolsummas\"\r\nt MSG_920 \"Izpilda bojāto bloku pārbaudi ieskaitot \\\"falsificēto\\\" nesēju noteikšanu\"\r\nt MSG_921 \"Lejupielādē oficiālos Microsoft ISO failus\"\r\nt MSG_922 \"Lejupielādē UEFI OS ISO failus\"\r\n\r\n#########################################################################\r\nl \"lt-LT\" \"Lithuanian (Lietuvių)\" 0x0427\r\nv 3.22\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Apie Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licencija\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Disko ypatybės\"\r\nt IDS_DEVICE_TXT \"Įrenginys\"\r\nt IDS_BOOT_SELECTION_TXT \"Įkrovos parinktis\"\r\nt IDC_SELECT \"Pasirinkite\"\r\nt IDS_IMAGE_OPTION_TXT \"Atvaizdo parinktis\"\r\nt IDS_PARTITION_TYPE_TXT \"Skaidinių schema\"\r\nt IDS_TARGET_SYSTEM_TXT \"Paskirties sistema\"\r\nt IDC_LIST_USB_HDD \"Išvardinti USB kietuosius diskus\"\r\nt IDC_OLD_BIOS_FIXES \"Pataisos seniems BIOS (papildomas skaidinys, ir kt.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Įgalinti vykdymo laiko UEFI laikmenos patvirtinimą\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Formatavimo parinktys\"\r\nt IDS_FILE_SYSTEM_TXT \"Failų sistema\"\r\nt IDS_CLUSTER_SIZE_TXT \"Klasterio dydis\"\r\nt IDS_LABEL_TXT \"Tomo žymė\"\r\nt IDC_QUICK_FORMAT \"Greitasis formatavimas\"\r\nt IDC_BAD_BLOCKS \"Tikrinti įrenginį dėl blogų blokų\"\r\nt IDC_EXTENDED_LABEL \"Kurti išplėstinių žymių ir piktogramų failus\"\r\nt IDS_STATUS_TXT \"Būsena\"\r\nt IDCANCEL \"Uždaryti\"\r\nt IDC_START \"Pradėti\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Uždaryti\"\r\nt IDD_LICENSE \"Rufus licencija\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Uždaryti\"\r\nt IDD_LOG \"Dienynas\"\r\nt IDC_LOG_CLEAR \"Valyti\"\r\nt IDC_LOG_SAVE \"Išsaugoti\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Uždaryti\"\r\nt IDD_NEW_VERSION \"Rufus naujinių paieška\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Rasta naujesnė versija. Atsisiųskite naujausią versiją!\"\r\nt IDC_WEBSITE \"Eiti į Rufus svetainę\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Versijos pastabos\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Atsisiųsti\"\r\nt IDC_DOWNLOAD \"Atsisiųsti\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Daugiau informacijos\"\r\nt IDYES \"Taip\"\r\nt IDNO \"Ne\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Uždaryti\"\r\nt IDD_UPDATE_POLICY \"Naujinių politika ir nuostatos\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Nuostatos\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Ieškoti naujinių\"\r\nt IDS_INCLUDE_BETAS_TXT \"Įtraukti beta versijas\"\r\nt IDC_CHECK_NOW \"Tikrinti dabar\"\r\n\r\nt MSG_001 \"Aptiktas kitas programos atvejis\"\r\nt MSG_002 \"Vykdoma kita Rufus programa.\\nPrieš vykdydami naują programą, uždarykite ankstesniąją.\"\r\nt MSG_003 \"ĮSPĖJIMAS: VISI DUOMENYS ĮRENGINYJE „%s“ BUS SUNAIKINTI.\\nNorėdami tęsti šį veiksmą, spauskite Gerai. Norėdami išeiti - spauskite Atšaukti.\"\r\nt MSG_004 \"Rufus naujinių politika\"\r\nt MSG_005 \"Ar norite leisti Rufus ieškoti programos naujinių internete?\"\r\nt MSG_006 \"Uždaryti\"\r\nt MSG_007 \"Atšaukti\"\r\nt MSG_008 \"Taip\"\r\nt MSG_009 \"Ne\"\r\nt MSG_010 \"Rasta blogų blokų\"\r\nt MSG_011 \"Tikrinimas baigtas: rasta %d blogų blokų\\n  %d skaitymo klaidų\\n  %d rašymo klaidų\\n  %d iškraipymo klaidų\"\r\nt MSG_012 \"%s\\nIšsamesnę ataskaitą rasite:\\n%s\"\r\nt MSG_013 \"Išjungta\"\r\nt MSG_014 \"Kasdien\"\r\nt MSG_015 \"Kas savaitę\"\r\nt MSG_016 \"Kas mėnesį\"\r\nt MSG_017 \"Pasirinktinai\"\r\nt MSG_018 \"Jūsų versija: %d.%d (sąranka %d)\"\r\nt MSG_019 \"Naujausia versija: %d.%d (sąranka %d)\"\r\nt MSG_020 \"baitai\"\r\nt MSG_026 \"baitai\"\r\nt MSG_027 \"kilobaitai\"\r\nt MSG_028 \"megabaitai\"\r\nt MSG_029 \"Numatytas\"\r\nt MSG_030 \"%s (numatytas)\"\r\nt MSG_031 \"BIOS (arba UEFI-CSM)\"\r\nt MSG_032 \"UEFI (ne CSM)\"\r\nt MSG_033 \"BIOS arba UEFI\"\r\nt MSG_034 \"%d bandymas\"\r\nt MSG_035 \"%d bandymai %s\"\r\nt MSG_036 \"ISO atvaizdas\"\r\nt MSG_037 \"Programa\"\r\nt MSG_038 \"Nutraukti\"\r\nt MSG_039 \"Vykdyti\"\r\nt MSG_040 \"Atsisiųsti\"\r\nt MSG_041 \"Veiksmas atšauktas naudotojo\"\r\nt MSG_042 \"Klaida\"\r\nt MSG_043 \"Klaida: %s\"\r\nt MSG_044 \"Failo atsisiuntimas\"\r\nt MSG_045 \"USB saugyklos įrenginys (bendrinis)\"\r\nt MSG_046 \"%s (diskas %d) [%s]\"\r\nt MSG_047 \"Keli skaidiniai\"\r\nt MSG_048 \"Rufus - išvalomi buferiai\"\r\nt MSG_049 \"Rufus - atšaukimas\"\r\nt MSG_050 \"Sėkmingai.\"\r\nt MSG_051 \"Nenustatyta klaida formatuojant.\"\r\nt MSG_052 \"Negalima naudoti parinktos failų sistemos šiai laikmenai.\"\r\nt MSG_053 \"Prieiga prie šio įrenginio uždrausta.\"\r\nt MSG_054 \"Laikmena apsaugota nuo įrašymo.\"\r\nt MSG_055 \"Įrenginį naudoja kitas procesas. Prašau uždaryti kitus procesus, kurie gali kreiptis į įrenginį.\"\r\nt MSG_056 \"Greitasis formatavimas negalimas šiam įrenginiui.\"\r\nt MSG_057 \"Tomo žymė negaliojanti.\"\r\nt MSG_058 \"Įrenginio klasės vardas negaliojantis.\"\r\nt MSG_059 \"Pasirinktas klasterio dydis negalioja šiam įrenginiui.\"\r\nt MSG_060 \"Tomo dydis negaliojantis.\"\r\nt MSG_061 \"Įdėkite keičiamą laikmeną į įrenginį.\"\r\nt MSG_062 \"Gauta nepalaikoma komanda.\"\r\nt MSG_063 \"Atminties paskirstymo klaida.\"\r\nt MSG_064 \"Skaitymo klaida.\"\r\nt MSG_065 \"Rašymo klaida.\"\r\nt MSG_066 \"Įdiegimo triktis\"\r\nt MSG_067 \"Nepavyko atverti laikmenos. Ji gali būti naudojama kito proceso. Prašau įdėti laikmeną iš naujo ir bandykite vėl.\"\r\nt MSG_068 \"Nepavyko išskaidyti disko.\"\r\nt MSG_069 \"Nepavyko nukopijuoti failų į paskirties diską.\"\r\nt MSG_070 \"Atšaukta naudotojo.\"\r\nt MSG_071 \"Negalima pradėti gijos.\"\r\nt MSG_072 \"Blogų blokų tikrinimas nebuvo baigtas.\"\r\nt MSG_073 \"ISO atvaizdo peržiūros triktis.\"\r\nt MSG_074 \"ISO atvaizdo išskleidimo triktis.\"\r\nt MSG_075 \"Negalima prijungti tomo.\"\r\nt MSG_076 \"Negalima papildyti/paruošti failų įkrovai.\"\r\nt MSG_077 \"Negalima priskirti disko raidės.\"\r\nt MSG_078 \"Negalima prijungti GUID tomo.\"\r\nt MSG_079 \"Įrenginys nepasiruošęs.\"\r\nt MSG_080 \"Rufus aptiko, kad Windows vis dar išvalo savo vidinius buferius į USB įrenginį.\\n\\nPriklausomai nuo jūsų USB įrenginio spartos, šis veiksmas gali užtrukti ilgai, ypač su dideliais failais.\\n\\nMes patariame jums leisti Windows pabaigti, kad išvengtumėte iškraipymų. Bet jei jums nusibos laukti, galite tiesiog ištraukti įrenginį...\"\r\nt MSG_081 \"Nepalaikomas atvaizdas\"\r\nt MSG_082 \"Arba tai ne įkrovos atvaizdas, arba jis naudoja įkrovos ar glaudinimo metodą, kurio nepalaiko Rufus...\"\r\nt MSG_083 \"Pakeisti %s?\"\r\nt MSG_084 \"Atrodo, šis ISO atvaizdas naudoja pasenusią „%s“ versiją.\\nĮkrovos meniu dėl to gali būti vaizduojamas blogai.\\n\\nGalima atsisiųsti naujesnę Rufus versiją išspręsti problemai:\\n- Pasirinkite 'Taip' norėdami prisijungti prie interneto ir atsisiųsti failą\\n- Pasirinkite 'Ne' norėdami palikti esamą ISO failą nepakeistą\\nJei nežinote ką daryti, reikėtų pasirinkti 'Taip'.\\n\\nPastaba: naujas failas bus atsiųstas į dabartinį katalogą ir jei „%s“ ten jau yra, jis bus panaudotas iš naujo automatiškai.\"\r\nt MSG_085 \"Atsisiunčiama: %s\"\r\nt MSG_086 \"Atvaizdas nepasirinktas\"\r\nt MSG_087 \"su %s NAND\"\r\nt MSG_088 \"Atvaizdas per didelis\"\r\nt MSG_089 \"Atvaizdas yra per didelis pasirinktai paskirčiai.\"\r\nt MSG_090 \"Nepalaikomas ISO\"\r\nt MSG_091 \"Naudojant UEFI paskirties tipą, tik EFI įkrovos ISO atvaizdai yra palaikomi. Prašome pasirinkti EFI įkrovos ISO arba pakeisti paskirties tipą į BIOS.\"\r\nt MSG_092 \"Nepalaikoma failų sistema\"\r\nt MSG_093 \"SVARBU: ŠIS DISKAS TURI KELETĄ SKAIDINIŲ!!\\n\\nTarp jų gali būti skaidinių/tomų, neparodytų ar net nematomų iš Windows. Jei norėsite tęsti, būsite atsakingi dėl galimo duomenų praradimo šiuose skaidiniuose.\"\r\nt MSG_094 \"Aptikta keletas skaidinių\"\r\nt MSG_095 \"DD atvaizdas\"\r\nt MSG_096 \"Pasirinkta failų sistema negali būti naudojama su šiuo ISO tipu.Pasirinkite kitą failų sistemą arba naudokite kitokį ISO.\"\r\nt MSG_097 \"„%so“ gali būti taikomas tik jei failų sistema yra NTFS.\"\r\nt MSG_098 \"SVARBU: Jūs bandote įdiegti 'Windows To Go', bet jūsų paskirties diskas neturi atributo ´FIKSUOTAS´. Dėl to sistema Windows greičiausiai pakibs įkrovos metu, nes Microsoft nepritaikė jos veikti su diskais, turinčiais ´KEIČIAMAS´ atributą.\\n\\nAr vis tiek norite tęsti?\\n\\nPastaba: Atributas 'FIKSUOTAS/KEIČIAMAS' yra techninės įrangos savybė, kurią galima pakeisti tik naudojant specialias priemones iš disko gamintojo. Tačiau šios priemonės BEVEIK NIEKADA viešai nepateikiamos...\"\r\nt MSG_099 \"Failų sistemos apribojimas\"\r\nt MSG_100 \"Šiame ISO atvaizde yra failas, didesnis nei 4 GB, tai daugiau nei maksimalus leistinas FAT arba FAT32 failų sistemos dydis.\"\r\nt MSG_101 \"Trūksta WIM palaikymo\"\r\nt MSG_102 \"Jūsų platforma negali išskleisti failų iš WIM archyvų. WIM išskleidimas būtinas norint sukurti EFI įkraunamus Windows 7 ir Windows Vista USB diskus. Jūs galite tai sutvarkyti įdiegdami dabartinę 7-Zip versiją.\\nAr norite apsilankyti 7-zip atsisiuntimo puslapyje?\"\r\nt MSG_103 \"Atsiųsti %s?\"\r\nt MSG_104 \"%s ar vėlesniam reikia, kad '%s' failas būtų įdiegtas.\\nKadangi šis failas didesnis nei 100 KB ir visada yra %s ISO atvaizduose, jis nėra įtrauktas į Rufus.\\n\\nRufus gali jums atsiųsti trūkstamą failą:\\n- Pasirinkite 'Taip' norėdami prisijungti prie interneto ir atsisiųsti failą\\n- Pasirinkite 'Ne' norėdami rankiniu būdu nukopijuoti šį failą į diską vėliau\\n\\nPastaba: failas bus atsiųstas į dabartinį katalogą ir kai „%s“ bus ten, jis bus pakartotinai naudojamas automatiškai.\"\r\nt MSG_105 \"Atšaukus dabar, įrenginys gali likti NEPRIEINAMOJE būsenoje.\\nJei tikrai norite atšaukti, spauskite TAIP. Kitu atveju, spauskite NE.\"\r\nt MSG_106 \"Pasirinkite katalogą\"\r\nt MSG_107 \"Visi failai\"\r\nt MSG_108 \"Rufus dienynas\"\r\nt MSG_109 \"0x%02X (Diskas %d)\"\r\nt MSG_110 \"MS-DOS negali įsikelti iš disko naudojant 64 kilobaitų klasterio dydį.\\nPakeiskite klasterio dydį arba naudokite FreeDOS.\"\r\nt MSG_111 \"Nesuderinamas klasterio dydis\"\r\nt MSG_112 \"Didelių UDF tomų formatavimas gali užimti daug laiko. USB 2.0 greičiu numatoma formatavimo trukmė yra %d:%02d, tuo metu eigos juosta gali atrodyti sustingusi. Būkite kantrūs!\"\r\nt MSG_113 \"Didelis UDF tomas\"\r\nt MSG_114 \"Šis atvaizdas naudoja Syslinux %s%s, bet ši programa turi tik diegimo failus, skirtus Syslinux %s%s.\\n\\nKadangi naujos Syslinux versijos tarpusavyje nesuderinamos, ir nėra galimybės į Rufus įtraukti jas visas, du papildomi failai turi būti atsisiųsti iš interneto ('ldlinux.sys' ir 'ldlinux.bss'):\\n- Pasirinkite 'Taip' norėdami prisijungti prie interneto ir atsisiųsti šiuos failus\\n- Pasirinkite 'Ne' norėdami veiksmą atšaukti\\n\\nPastaba: Failai bus atsiųsti į dabartinį programos katalogą ir bus naudojami vėl automatiškai, juos ten radus.\"\r\nt MSG_115 \"Reikalingas atsisiuntimas\"\r\nt MSG_116 \"Šis atvaizdas naudoja Grub %s, bet ši programa turi tik diegimo failus, skirtus Grub %s.\\n\\nKadangi skirtingos Grub versijos gali būti nesuderinamos tarpusavyje, o jų visų įtraukti nėra galimybės, Rufus bandys surasti Grub įdiegimo failo ('core.img') versiją, atitinkančią esančią jūsų atvaizde:\\n- Pasirinkite 'Taip' norėdami prisijungti prie interneto ir atsisiųsti ją\\n- Pasirinkite 'Ne' norėdami naudoti numatytąją versiją iš Rufus\\n- Pasirinkite 'Atšaukti' norėdami nutraukti veiksmą\\n\\nPastaba: Failas bus atsiųstas į dabartinį programos aplanką ir vėliau jam ten esant bus naudojamas automatiškai. Jei atitinkančio nebus rasta internete, bus naudojama numatytoji versija.\"\r\nt MSG_117 \"Standartinė Windows įdiegtis\"\r\nt MSG_119 \"išsamias disko ypatybes\"\r\nt MSG_120 \"išsamias formatavimo parinktis\"\r\nt MSG_121 \"Rodyti %s\"\r\nt MSG_122 \"Slėpti %s\"\r\nt MSG_123 \"Išliekamojo skaidinio dydis\"\r\nt MSG_124 \"Be išlikimo\"\r\nt MSG_125 \"Nustatykite išliekamojo skaidinio dydį gyvai USB laikmenai. Nustačius 0 dydį, išliekamasis skaidinys išjungiamas.\"\r\nt MSG_126 \"Nustatykite skaidinio dydžio vienetus.\"\r\nt MSG_127 \"Neberodyti šio pranešimo\"\r\nt MSG_128 \"Svarbi pastaba apie %s\"\r\nt MSG_129 \"Jūs ką tik sukūrėte laikmeną, kuri naudoja UEFI:NTFS įkėliklį. Atminkite, norėdami įkrovos sistemą iš šios laikmenos, turite išjungti SECURE BOOT.\\nIšsamiau apie tai, kodėl tai būtina, žiūrėkite žemiau esančiame mygtuke \\\"Daugiau informacijos\\\".\"\r\nt MSG_130 \"Windows atvaizdo pasirinkimas\"\r\nt MSG_131 \"Šiame ISO yra keli Windows atvaizdai.\\nPasirinkite atvaizdą, kurį norite naudoti šiam diegimui:\"\r\nt MSG_132 \"Kita programa arba procesas kreipiasi į šį diską. Ar vis tiek norite jį formatuoti?\"\r\nt MSG_133 \"Rufus aptiko, kad jūs bandote sukurti Windows To Go laikmeną remiantis 1809 ISO.\\n\\nDėl *MICROSOFT klaidos*, ši laikmena užlūš įkraunant Windows (mėlynas mirties ekranas), nebent jūs rankiniu būdu pakeisite failą \\\"WppRecorder. sys\\\" į 1803 versiją.\\n\\nTaip pat atkreipkite dėmesį, kad Rufus negali automatiškai pataisyti to už jus, nes \\\"WppRecorder. sys\\\" yra \\\"Microsoft\\\" autorių teisėmis apsaugotas failas, todėl mes negalime legaliai įterpti šio failo kopijos mūsų programoje...\"\r\nt MSG_134 \"Kadangi MBR buvo pasirinkta kaip skaidinio schema, Rufus gali sukurti tik iki 2 TB skaidinį šioje laikmenoje, dėl ko %s disko vietos liks nepasiekiama.\\n\\nAr tikrai norite tęsti?\"\r\nt MSG_135 \"Versija\"\r\nt MSG_136 \"Laida\"\r\nt MSG_137 \"Leidimas\"\r\nt MSG_138 \"Kalba\"\r\nt MSG_139 \"Architektūra\"\r\nt MSG_140 \"Tęsti\"\r\nt MSG_141 \"Atgal\"\r\nt MSG_142 \"Palaukite...\"\r\nt MSG_143 \"Atsisiųsti naudojant naršyklę\"\r\nt MSG_144 \"Windows ISO atsisiuntimas nepasiekiamas, nes Microsoft pakeitė savo svetainę, kad to išvengtų.\"\r\nt MSG_145 \"PowerShell 3.0 ar vėlesnis būtinas šiam scenarijui vykdyti.\"\r\nt MSG_146 \"Ar norite jungtis prie interneto ir atsisiųsti?\"\r\nt MSG_148 \"Vykdomas atsisiuntimo scenarijus...\"\r\nt MSG_149 \"Atsisiųsti ISO atvaizdą\"\r\nt MSG_150 \"Paprastai saugiausias pasirinkimas. Bet jei turite UEFI kompiuterį ir norite įdiegti operacinę sistemą EFI režimu, turėtumėte pasirinkit vieną iš kitų parinkčių.\"\r\nt MSG_151 \"'UEFI-CSM' reiškia, kad įrenginys įkėlimą vykdys BIOS emuliacijos režimu (žinomu kaip 'Legacy Mode') esant UEFI, o ne tikruoju UEFI režimu.\"\r\nt MSG_152 \"'ne CSM' reiškia, kad įrenginys įkėlimą vykdys tikruoju UEFI režimu, o ne BIOS emuliacijos režimu (žinomu kaip 'Legacy Mode').\"\r\nt MSG_153 \"Testo šablonas: 0x%02X\"\r\nt MSG_154 \"Testo šablonas: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Testo šablonas: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Testo šablonas: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Nustato paskirties failų sistemą\"\r\nt MSG_158 \"Mažiausias dydis, kurį duomenų blokas užims failų sistemoje\"\r\nt MSG_159 \"Šiame laukelyje įrašykite disko žymę.\\nGalite naudoti tarptautinius simbolius.\"\r\nt MSG_160 \"Įjungti išsamias parinktis\"\r\nt MSG_161 \"Tikrinti įrenginį dėl blogų blokų naudojant testo šabloną\"\r\nt MSG_162 \"Nuimkite šio langelio žymę norėdami naudoti \\\"lėtą\\\" formatavimo būdą\"\r\nt MSG_163 \"Būdas, kuris bus naudojamas skaidiniams kurti\"\r\nt MSG_164 \"Būdas, kuris bus naudojamas padaryti diską įkraunamą\"\r\nt MSG_165 \"Spauskite, jei norite pasirinkti ar atsisiųsti atvaizdą...\"\r\nt MSG_166 \"Pažymėkite šį langelį, norėdami įgalinti tarptautinių žymių rodymą ir įrenginio piktogramos nustatymą (sukuria autorun.inf)\"\r\nt MSG_167 \"Įdiegia MBR, kuris įgalina įkrovos pasirinkimą ir gali maskuoti BIOS USB disko ID\"\r\nt MSG_168 \"Bandyti maskuoti pirmą įkraunamą USB diską (paprastai 0x80) kaip kitą diską.\\nTo turėtų prireikti tik jei diegsite Windows XP ir bus daugiau nei vienas diskas.\"\r\nt MSG_169 \"Sukurti papildomą slaptą skaidinį ir bandyti sulygiuoti skaidinių ribas.\\nTai gali pagerinti įkrovos aptikimą su senais BIOSais.\"\r\nt MSG_170 \"Įgalinti išorinių USB kietųjų diskų pateiktį. NAUDOTI SAVO RIZIKA!!!\"\r\nt MSG_171 \"Pradėti formatavimą.\\nTai SUNAIKINS visus duomenis paskirtyje!\"\r\nt MSG_172 \"Negaliojantis atsisiuntimo parašas\"\r\nt MSG_173 \"Spauskite pasirinkti...\"\r\nt MSG_174 \"Rufus - patikima USB formatavimo priemonė\"\r\nt MSG_175 \"Versija %d.%d (sąranka %d)\"\r\nt MSG_176 \"Lietuviškas vertimas: Gintaras Venslovas <gintaras.venslovas@gmail.com>\"\r\nt MSG_177 \"Dėl pastebėtų klaidų ar pageidaujamų patobulinimų kreipkitės:\"\r\nt MSG_178 \"Kitos autorių teisės:\"\r\nt MSG_179 \"Naujinių politika:\"\r\nt MSG_180 \"Jei leisite šiai programai tikrinti, ar yra naujinių, jūs sutinkate, kad mūsų serveriuose gali būti renkama ši informacija:\"\r\nt MSG_181 \"Jūsų operacinės sistemos architektūra ir versija\"\r\nt MSG_182 \"Programos, kurią naudojate, versija\"\r\nt MSG_183 \"Jūsų IP adresas\"\r\nt MSG_184 \"Asmeninio naudojimo statistikos generavimo tikslu mes galime saugoti surinktą informaciją \\\\b ne daugiau kaip metus\\\\b0 . Tačiau mes savo valia neatskleisime nieko iš šios informacijos trečiosioms šalims.\"\r\nt MSG_185 \"Atnaujinimo procesas:\"\r\nt MSG_186 \"Rufus neįdiegia ir nevykdo foninių tarnybų, todėl naujinių tikrinimai yra atliekami tik vykdant pagrindinę programą.\\\\line\\nInterneto prieiga, be abejo, yra reikalinga naujinių tikrinimui.\"\r\nt MSG_187 \"Negaliojantis atvaizdas pasirinktai įkrovos parinkčiai\"\r\nt MSG_188 \"Dabartinis atvaizdas neatitinka pasirinktos įkrovos parinkties. Prašome naudoti kitą atvaizdą arba rinktis kitą įkrovos parinktį.\"\r\nt MSG_189 \"Šis ISO atvaizdas nesuderinamas su pasirinkta failų sistema\"\r\nt MSG_190 \"Aptiktas nesuderinamas diskas\"\r\nt MSG_191 \"Rašymo bandymas\"\r\nt MSG_192 \"Skaitymo bandymas\"\r\nt MSG_193 \"Atsiųsta %s\"\r\nt MSG_194 \"Nepavyko atsiųsti %s\"\r\nt MSG_195 \"Naudojama įterpta failo(ų) %s versija\"\r\nt MSG_196 \"SVARBU: ŠIS DISKAS NAUDOJA NESTANDARTINĮ SEKTORIAUS DYDĮ!\\n\\nĮprastiniai diskai naudoja 512 baitų sektoriaus dydį, bet šis diskas naudoja %d baitų. Daugeliu atveju tai reiškia, kad jūs NEGALĖSITE įkrauti sistemos iš šio disko.\\nRufus gali mėginti sukurti įkrovos diską, bet NĖRA GARANTIJŲ, kad jis veiks.\"\r\nt MSG_197 \"Aptiktas nestandartinis sektoriaus dydis\"\r\nt MSG_198 \"'Windows To Go' gali būti įdiegta tik į GPT skaidinių diską, jei jis turi įjungtą atributą 'FIKSUOTAS'. Pasirinktas diskas nebuvo aptiktas kaip FIKSUOTAS.\"\r\nt MSG_199 \"Ši funkcija šioje platformoje nepasiekiama.\"\r\nt MSG_201 \"Atšaukiama - prašome palaukti...\"\r\nt MSG_202 \"Peržiūrimas atvaizdas...\"\r\nt MSG_203 \"Nepavyko peržiūrėti atvaizdo\"\r\nt MSG_204 \"Aptiktas pasenęs %s\"\r\nt MSG_205 \"Naudojamas atvaizdas: %s\"\r\nt MSG_206 \"Trūksta %s failo\"\r\nt MSG_207 \"Naujas tomas\"\r\nt MSG_208 \"%d įrenginys rastas\"\r\nt MSG_209 \"%d įrenginiai rasti\"\r\nt MSG_210 \"PASIRUOŠĘS\"\r\nt MSG_211 \"Atšaukta\"\r\nt MSG_212 \"NEPAVYKO\"\r\nt MSG_213 \"Paleidžiama nauja programa...\"\r\nt MSG_214 \"Nepavyko paleisti naujos programos\"\r\nt MSG_215 \"Atidarytas %s\"\r\nt MSG_216 \"Išsaugotas %s\"\r\nt MSG_217 \"Formatuojama: %s\"\r\nt MSG_218 \"Kuriama failų sistema: Užduotis %d/%d atlikta\"\r\nt MSG_219 \"NTFS taisymas: %d%% atlikta\"\r\nt MSG_220 \"Formatuojama (%s) - numatoma trukmė %d:%02d...\"\r\nt MSG_221 \"Rašoma žymė (%s)...\"\r\nt MSG_222 \"Formatuojama (%s)...\"\r\nt MSG_223 \"NTFS taisymas (disko tikrinimas)...\"\r\nt MSG_224 \"Išvalomos MBR/PBR/GPT struktūros...\"\r\nt MSG_225 \"Užsakoma disko prieiga...\"\r\nt MSG_226 \"Tiriami esami įkrovos įrašai...\"\r\nt MSG_227 \"Uždaromas esamas tomas...\"\r\nt MSG_228 \"Rašomas pagrindinis įkrovos įrašas (MBR)...\"\r\nt MSG_229 \"Rašomas skaidinio įkrovos įrašas...\"\r\nt MSG_230 \"Kopijuojami DOS failai...\"\r\nt MSG_231 \"Kopijuojami ISO failai: %s\"\r\nt MSG_232 \"Win7 EFI įkrovos sąranka (%s)...\"\r\nt MSG_233 \"Baigiama, prašome palaukti...\"\r\nt MSG_234 \"Įdiegiama Syslinux %s...\"\r\nt MSG_235 \"Blogi blokai: %s %d/%d - %0.2f%% (%d/%d/%d klaidos)\"\r\nt MSG_236 \"Blogi blokai: tikrinama su atsitiktiniu šablonu\"\r\nt MSG_237 \"Blogi blokai: tikrinama su šablonu 0x%02X\"\r\nt MSG_238 \"Skaidoma (%s)...\"\r\nt MSG_239 \"Naikinami skaidiniai (%s)...\"\r\nt MSG_240 \"Atsisiųsto naujinio parašo galiojimas negali būti patikrintas. Tai gali reikšti, kad jūsų sistema nėra tinkamai suderinta parašų patikrinimui arba, kad siuntinys yra pakenktas.\\n\\nSiuntinys bus ištrintas. Daugiau informacijos rasite dienyne.\"\r\nt MSG_241 \"Atsiunčiama: %s\"\r\nt MSG_242 \"Nepavyko atsiųsti failo.\"\r\nt MSG_243 \"Tikrinama, ar yra Rufus naujinių...\"\r\nt MSG_244 \"Naujiniai: negaliu prisijungti prie interneto\"\r\nt MSG_245 \"Naujiniai: negaliu pasiekti versijos duomenų\"\r\nt MSG_246 \"Rasta nauja Rufus versija!\"\r\nt MSG_247 \"Naujos Rufus versijos nerasta\"\r\nt MSG_248 \"Programos registro raktai sėkmingai ištrinti\"\r\nt MSG_249 \"Nepavyko ištrinti programos registro raktų\"\r\nt MSG_250 \"%s įjungtas\"\r\nt MSG_251 \"%s išjungtas\"\r\nt MSG_252 \"Dydžio tikrinimas\"\r\nt MSG_253 \"Kietųjų diskų aptikimas\"\r\nt MSG_254 \"Priversti didelį FAT32 formatavimą\"\r\nt MSG_255 \"NoDriveTypeAutorun bus ištrintas išeinant\"\r\nt MSG_256 \"Netikrų diskų aptikimas\"\r\nt MSG_257 \"Joliet palaikymas\"\r\nt MSG_258 \"Rock Ridge palaikymas\"\r\nt MSG_259 \"Priversti naujintis\"\r\nt MSG_260 \"NTFS glaudinimas\"\r\nt MSG_261 \"Įrašomas atvaizdas: %s\"\r\nt MSG_262 \"ISO palaikymas\"\r\nt MSG_263 \"Naudoti TEISINGUS dydžio vienetus\"\r\nt MSG_264 \"Trinamas aplankas „%s“\"\r\nt MSG_265 \"VMWare disko aptikimas\"\r\nt MSG_266 \"Dvigubas UEFI/BIOS režimas\"\r\nt MSG_267 \"Taikomas Windows atvaizdas: %s\"\r\nt MSG_268 \"Taikomas Windows atvaizdas...\"\r\nt MSG_269 \"Išsaugoti laiko žymas\"\r\nt MSG_270 \"USB derinimas\"\r\nt MSG_271 \"Skaičiuojamos atvaizdo kontrolinės sumos: %s\"\r\nt MSG_272 \"Skaičiuoti MD5, SHA1 ir SHA256 kontrolines sumas pasirinktam atvaizdui\"\r\nt MSG_273 \"Keisti programos kalbą\"\r\nt MSG_274 \"Aptiktas %s atvaizdas\"\r\nt MSG_275 \"Jūsų pasirinktas atvaizdas yra „ISOHybrid“ atvaizdas. Tai reiškia, kad jis gali būti įrašytas %s (failų kopijavimo) režimu arba %s (disko atvaizdo) režimu.\\nRufus rekomenduoja naudoti režimą %s tam, kad visada turėtumėte visišką prieigą prie disko po įrašymo.\\nTačiau, jei susiduriate su problemomis įkrovos metu, galite pabandyti įrašyti šį atvaizdą iš naujo %s režimu.\\n\\nPrašome pasirinkti režimą, kuriuo norite įrašyti šį atvaizdą:\"\r\nt MSG_276 \"Įrašyti %s režimu (rekomenduojama)\"\r\nt MSG_277 \"Įrašyti %s režimu\"\r\nt MSG_278 \"Konfliktuojančių procesų tikrinimas...\"\r\nt MSG_279 \"Neįkraunamas\"\r\nt MSG_280 \"Atvaizdo parinktis\"\r\nt MSG_281 \"(Prašome pasirinkti atvaizdą)\"\r\nt MSG_282 \"Išimtinis USB disko užrakinimas\"\r\nt MSG_283 \"Negaliojantis parašas\"\r\nt MSG_284 \"Atsiųstas vykdomasis failas neturi skaitmeninio parašo.\"\r\nt MSG_285 \"Atsiųstą vykdomąjį failą pasirašė „%s“.\\nŠio parašo mes neatpažįstame ir tai gali būti tam tikros kenkėjiškos veiklos požymis...\\nAr jūs tikrai norite vykdyti šį failą?\"\r\nt MSG_286 \"Nulinamas diskas: %s\"\r\nt MSG_287 \"Ne USB keičiamų diskų aptikimas\"\r\nt MSG_288 \"Reikia aukštesnių teisių\"\r\nt MSG_289 \"Šiai programai vykdyti būtinos aukštesnės teisės\"\r\nt MSG_290 \"Failų indeksavimas\"\r\nt MSG_291 \"Versijos parinktis\"\r\nt MSG_292 \"Prašome pasirinkti Windows versiją, kurią norite įdiegti:\"\r\nt MSG_293 \"Nepalaikoma Windows versija\"\r\nt MSG_294 \"Šios Windows versijos Rufus nebepalaiko.\\nPaskutinė Rufus versija, suderinama su šia platforma, yra v%d.%d.\"\r\nt MSG_295 \"Įspėjimas: neoficiali versija\"\r\nt MSG_296 \"Ši Rufus versija NĖRA išleista jos oficialaus kūrėjo(ų).\\n\\nAr tikrai norite ją vykdyti?\"\r\nt MSG_297 \"Aptiktas nepilnas ISO\"\r\nt MSG_298 \"Jūsų pasirinktas ISO failas neatitinka deklaruojamo dydžio: %s duomenų trūksta!\\n\\nJei jūs gavote šį failą iš interneto, pabandykite atsisiųsti jį iš naujo ir patikrinkite, ar MD5 arba SHA kontrolinės sumos atitinka oficialiąsias.\\n\\nBeje, jūs galite apskaičiuoti MD5 arba SHA per Rufus, paspaudę.\"\r\nt MSG_299 \"Laiko žymos tikrinimo klaida\"\r\nt MSG_300 \"Rufus negalėjo patikrinti ar atsisiųsto naujinio laiko žyma yra naujesnė už dabartinio vykdomojo failo.\\n\\nKad būtų užkirstas kelias galimai atakos grėsmei, naujinimo procesas buvo nutrauktas, o naujinys bus ištrintas. Daugiau informacijos rasite dienyne.\"\r\nt MSG_301 \"Rodyti programos nuostatas\"\r\nt MSG_302 \"Rodyti informaciją apie šią programą\"\r\nt MSG_303 \"Rodyti dienyną\"\r\nt MSG_304 \"Kurti pasirinkto įrenginio disko atvaizdą\"\r\nt MSG_305 \"Šią parinktį naudokite norėdami nurodyti ar naudosite šį įrenginį įdiegti Windows į kitą diską, ar norėsite vykdyti Windows tiesiogiai iš šio disko (Windows To Go).\"\r\nt MSG_306 \"Greitasis disko nulinimas: %s\"\r\nt MSG_307 \"tai gali užtrukti\"\r\nt MSG_308 \"VHD aptikimas\"\r\nt MSG_309 \"Suglaudintas archyvas\"\r\nt MSG_310 \"Jūsų pasirinktas ISO naudoja UEFI ir yra pakankamai mažas, kad būtų įrašytas kaip ESI sistemos skaidinys (ESP). Rašymas į ESP gali būti tinkamesnis kai kuriems diegimo būdams negu rašymas į paprastą duomenų skaidinį užimantį visą diską.\\n\\nPasirinkite būdą kuriuo norite įrašyti šį atvaizdą:\"\r\nt MSG_311 \"Naudokite %s (pagrindiniame programos lange), kad įjungtumėte.\"\r\nt MSG_312 \"Papildomos maišos (SHA512)\"\r\nt MSG_313 \"Išsaugoti į VHD\"\r\nt MSG_314 \"Skaičiuoti atvaizdo kontrolines sumas\"\r\nt MSG_315 \"Keletas mygtukų\"\r\nt MSG_316 \"Bandymų skaičius\"\r\nt MSG_317 \"Disko ID\"\r\nt MSG_318 \"Numatytasis gijos pirmumas\"\r\nt MSG_319 \"Nepasyti įkrovos žymės\"\r\nt MSG_320 \"Atnaujinamas skaidinių išdėstymas (%s)...\"\r\nt MSG_321 \"Jūsų pasirinktas atvaizdas yra \\\"ISOHybrid\\\" atvaizdas, tačiau jo kūrėjai nepadarė jo suderinamu su ISO/failų kopijavimo režimu.\\nDėl to bus įgalintas DD atvaizdo įrašymo režimas.\"\r\nt MSG_322 \"Nepavyksta atidaryti arba perskaityti \\\"%s\\\"\"\r\nt MSG_325 \"Windows tinkinimo taikymas: %s\"\r\nt MSG_326 \"Vartotojo parinkčių taikymas...\"\r\nt MSG_327 \"Windows vartotojo patirtis\"\r\nt MSG_328 \"Tinkinti Windows diegimą?\"\r\nt MSG_329 \"Pašalinkite 4 GB + RAM, saugaus įkrovimo ir TPM 2.0 reikalavimus\"\r\nt MSG_330 \"Pašalinkite internetinės Microsoft paskyros reikalavimą\"\r\nt MSG_331 \"Išjungti duomenų rinkimą (praleisti klausimus apie privatumą)\"\r\nt MSG_332 \"Neleiskite Windows To Go pasiekti vidinių diskų\"\r\nt MSG_333 \"Sukurkite vietinę paskyrą naudodami vartotojo vardą:\"\r\nt MSG_334 \"Regiono parinkčių nustatymas į tas pačias reikšmes kaip ir šio vartotojo\"\r\nt MSG_335 \"BitLocker automatinio įrenginių šifravimo išjungimas\"\r\nt MSG_336 \"Nuolatinis žurnalas\"\r\nt MSG_900 \"Rufus programa leidžia suženklinti ir sukurti sistemų paleidimo laikmenas, kaip pvz. USB atmintukus, atminties korteles ir pan.\"\r\nt MSG_901 \"Oficiali svetainė: %s\"\r\nt MSG_902 \"Šaltinio kodas: %s\"\r\nt MSG_903 \"Pakeitimų žurnalas: %s\"\r\nt MSG_904 \"Ši programa yra licencijuota pagal GNU viešosios licencijos (GPL) 3 versijos sąlygas.\\nDaugiau informacijos rasite https://www.gnu.org/licenses/gpl-3.0.html.\"\r\nt MSG_905 \"Batas\"\r\nt MSG_910 \"Suformatuokite USB, flash kortelę ir virtualius diskus į FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Sukurkite FreeDOS įkrovos USB diskus\"\r\nt MSG_912 \"Sukurkite įkrovos diskus iš įkrovos ISO (Windows, Linux ir kt.)\"\r\nt MSG_913 \"Sukurkite įkrovos diskus iš įkrovos disko vaizdų, įskaitant suspaustus\"\r\nt MSG_914 \"Sukurkite BIOS arba UEFI įkrovos diskus, įskaitant UEFI įkrovos NTFS\"\r\nt MSG_915 \"Sukurkite \\\"Windows To Go\\\" diskus\"\r\nt MSG_916 \"Sukurkite Windows 11 diegimo diskus kompiuteriams, kuriuose nėra TPM arba saugaus įkrovimo\"\r\nt MSG_917 \"Sukurkite nuolatinius Linux skaidinius\"\r\nt MSG_918 \"Sukurkite pasirinkto disko VHD / DD vaizdus\"\r\nt MSG_919 \"Apskaičiuokite pasirinkto vaizdo MD5, SHA-1, SHA-256 ir SHA-512 kontrolines sumas\"\r\nt MSG_920 \"Atlikite blogų blokų patikrinimus, įskaitant \\\"netikrų\\\" flash diskų aptikimą\"\r\nt MSG_921 \"Atsisiųskite oficialius Microsoft Windows mažmeninės prekybos ISO\"\r\nt MSG_922 \"Atsisiųskite UEFI Shell ISO\"\r\n\r\n#########################################################################\r\nl \"ms-MY\" \"Malay (Bahasa Malaysia)\" 0x043e, 0x083e\r\nv 3.22\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Mengenai Rufus\"\r\nt IDC_ABOUT_LICENSE \"Lesen\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Sifat cakera\"\r\nt IDS_DEVICE_TXT \"Peranti\"\r\nt IDS_BOOT_SELECTION_TXT \"Jenis boot\"\r\nt IDC_SELECT \"Pilih\"\r\nt IDS_IMAGE_OPTION_TXT \"Pilihan Imej\"\r\nt IDS_PARTITION_TYPE_TXT \"Skema partisyen\"\r\nt IDS_TARGET_SYSTEM_TXT \"Sistem yang akan dipasang\"\r\nt IDC_LIST_USB_HDD \"Senaraikan Cakera Keras USB\"\r\nt IDC_OLD_BIOS_FIXES \"Tambah pembaikan untuk BIOS lama\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Dayakan pengesahan media UEFI masa jalan\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Pilihan format\"\r\nt IDS_FILE_SYSTEM_TXT \"Sistem fail\"\r\nt IDS_CLUSTER_SIZE_TXT \"Saiz gugusan\"\r\nt IDS_LABEL_TXT \"Label jilid baharu\"\r\nt IDC_QUICK_FORMAT \"Format pantas\"\r\nt IDC_BAD_BLOCKS \"Semak peranti untuk blok rosak\"\r\nt IDC_EXTENDED_LABEL \"Cipta label lanjut dan fail ikon\"\r\nt IDCANCEL \"Tutup\"\r\nt IDC_START \"Mula\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Tutup\"\r\nt IDD_LICENSE \"Lesen Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Tutup\"\r\nt IDC_LOG_CLEAR \"Padam\"\r\nt IDC_LOG_SAVE \"Simpan\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Tutup\"\r\nt IDD_NEW_VERSION \"Semak untuk versi baharu - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Terdapat versi Rufus yang baharu. Sila muat turun versi yang terkini!\"\r\nt IDC_WEBSITE \"Klik di sini untuk ke laman sesawang Rufus\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Maklumat versi terbaharu\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Muat turun\"\r\nt IDC_DOWNLOAD \"Muat turun\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Maklumat lanjut\"\r\nt IDYES \"Ya\"\r\nt IDNO \"Tidak\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Tutup\"\r\nt IDD_UPDATE_POLICY \"Kemaskini dasar dan tetapan\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Tetapan\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Semak untuk versi baharu\"\r\nt IDS_INCLUDE_BETAS_TXT \"Termasuk versi beta\"\r\nt IDC_CHECK_NOW \"Semak sekarang\"\r\n\r\nt MSG_001 \"Proses Rufus lain dikesan\"\r\nt MSG_002 \"Terdapat aplikasi Rufus sedang berjalan.\\nSila tutup aplikasi tersebut sebelum melancarkan aplikasi Rufus baharu.\"\r\nt MSG_003 \"AMARAN: SEMUA DATA DI DALAM PERANTI '%s' AKAN DIPADAM.\\nJika hendak teruskan, klik OK. Untuk berhenti, klik BATAL.\"\r\nt MSG_004 \"Dasar kemas kini Rufus\"\r\nt MSG_005 \"Adakah anda mahu membenarkan Rufus menyemak untuk versi baharu dalam talian?\"\r\nt MSG_006 \"Tutup\"\r\nt MSG_007 \"Batal\"\r\nt MSG_008 \"Ya\"\r\nt MSG_009 \"Tidak\"\r\nt MSG_010 \"Blok rosak dijumpai\"\r\nt MSG_011 \"Semak selesai: %d blok rosak dijumpai\\n  %d ralat membaca\\n  %d ralat menulis\\n  %d ralat korupsi\"\r\nt MSG_012 \"%s\\nLaporan lebih terperinci boleh dijumpai di:\\n%s\"\r\nt MSG_013 \"Nyahaktif\"\r\nt MSG_014 \"Harian\"\r\nt MSG_015 \"Mingguan\"\r\nt MSG_016 \"Bulanan\"\r\nt MSG_017 \"Tetapan sendiri\"\r\nt MSG_018 \"Versi anda: %d.%d (Binaan %d)\"\r\nt MSG_019 \"Versi terkini: %d.%d (Binaan %d)\"\r\nt MSG_020 \"bait\"\r\nt MSG_026 \"bait\"\r\nt MSG_027 \"kilobait\"\r\nt MSG_028 \"megabait\"\r\nt MSG_029 \"Tetapan asal\"\r\nt MSG_030 \"%s (Tetapan asal)\"\r\nt MSG_031 \"BIOS (atau UEFI-CSM)\"\r\nt MSG_032 \"UEFI (bukan CSM)\"\r\nt MSG_033 \"BIOS atau UEFI\"\r\nt MSG_034 \"%d kali lulus\"\r\nt MSG_035 \"%d kali lulus %s\"\r\nt MSG_036 \"Imej ISO\"\r\nt MSG_037 \"Aplikasi\"\r\nt MSG_038 \"Batal\"\r\nt MSG_039 \"Mula\"\r\nt MSG_040 \"Muat turun\"\r\nt MSG_041 \"Operasi dibatalkan oleh pengguna\"\r\nt MSG_042 \"Ralat\"\r\nt MSG_043 \"Ralat: %s\"\r\nt MSG_044 \"Muat turun fail\"\r\nt MSG_045 \"Peranti storan USB (Generik)\"\r\nt MSG_046 \"%s (Cakera %d) [%s]\"\r\nt MSG_047 \"Beberapa Partisyen\"\r\nt MSG_048 \"Rufus - 'Flush' penimbal\"\r\nt MSG_049 \"Rufus - Pembatalan\"\r\nt MSG_050 \"Berjaya.\"\r\nt MSG_051 \"Ralat yang tidak dapat ditentukan ketika memformat.\"\r\nt MSG_052 \"Tidak boleh menggunakan sistem fail yang dipilih untuk media ini.\"\r\nt MSG_053 \"Akses kepada peranti dinafikan.\"\r\nt MSG_054 \"Tidak boleh menulis data ke peranti (Dilindungi)\"\r\nt MSG_055 \"Peranti ini digunakan oleh proses lain. Sila tutup mana-mana program yang mungkin menggunakan peranti ini.\"\r\nt MSG_056 \"Format pantas tidak boleh digunakan pada peranti ini.\"\r\nt MSG_057 \"Label jilid tidak sah.\"\r\nt MSG_058 \"Pengendali peranti tidak sah.\"\r\nt MSG_059 \"Saiz gugusan yang dipilih tidak boleh digunakan pada peranti ini.\"\r\nt MSG_060 \"Saiz jilid tidak sah.\"\r\nt MSG_061 \"Sila masukkan media boleh alih ke dalam pemacu.\"\r\nt MSG_062 \"Arahan yang tidak disokong diterima.\"\r\nt MSG_063 \"Kesilapan peruntukkan memori.\"\r\nt MSG_064 \"Kesilapan membaca.\"\r\nt MSG_065 \"Kesilapan menulis.\"\r\nt MSG_066 \"Kegagalan memasang\"\r\nt MSG_067 \"Media tidak boleh dibuka. Ia mungkin digunakan dalam proses yang lain. Sila cabut dan masukkan semula dan cuba sekali lagi.\"\r\nt MSG_068 \"Tidak boleh partition drive.\"\r\nt MSG_069 \"Tidak boleh meyalin fail kepada pemacu.\"\r\nt MSG_070 \"Dibatalkan oleh pengguna.\"\r\nt MSG_071 \"Proses-proses kecil tidak boleh dimulakan.\"\r\nt MSG_072 \"Penyemakan blok rosak tidak dapat diselesaikan.\"\r\nt MSG_073 \"Kegagalan imbasan imej ISO.\"\r\nt MSG_074 \"Pengekstrakan imej ISO gagal.\"\r\nt MSG_075 \"Tidak dapat melekap semula jilid.\"\r\nt MSG_076 \"Tidak dapat menyediakan fail-fail untuk boot.\"\r\nt MSG_077 \"Tidak dapat menetapkan huruf pemacu.\"\r\nt MSG_078 \"Tidak boleh lekap jilid GUID.\"\r\nt MSG_079 \"Peranti ini tidak sedia untuk digunakan.\"\r\nt MSG_080 \"Rufus mengesan bahawa Windows masih lagi menarik penimbal ke dalam peranti USB.\\n\\nBergantung kepada kelajuan peranti USB anda, operasi ini mungkin mengambil masa yang amat lama.Terutamanya untuk fail besar.\\n\\nKami cadangkan anda biarkan proses Windows untuk tamat dahulu supaya mengelakkan korupsi.Namun, jika anda kesuntukan masa, anda boleh cabutkan peranti anda...\"\r\nt MSG_081 \"Imej tidak disokong\"\r\nt MSG_082 \"Imej ini sama ada tidak boleh boot, atau ia menggunakan kaedah boot atau mampatan yang tidak disokong oleh Rufus...\"\r\nt MSG_083 \"Gantikan %s?\"\r\nt MSG_084 \"Imej ISO ini menggunakan versi '%s' yang telah lapuk.\\nOleh sebab ini, menu boot mungkin tidak dipaparkan dengan betul.\\n\\nVersi yang lebih baharu boleh dimuat turun oleh Rufus untuk memperbaiki isu ini:\\n- Pilih 'Ya' untuk menyambung ke internet dan muat turun fail tersebut\\n- Pilih 'Tidak' untuk tidak mengubahsuai fail ISO yang digunakan\\nJika anda tidak pasti apa yang perlu dilakukan, pilih 'Ya'.\\n\\nPerhatian: Fail yang dimuat turun akan disimpan di dalam direktori bersamaan dengan Rufus dan apabila terdapat '%s' , ia akan digunakan secara automatik.\"\r\nt MSG_085 \"Sedang memuat turun %s\"\r\nt MSG_086 \"Tiada imej yang dipilih\"\r\nt MSG_087 \"untuk %s NAND\"\r\nt MSG_088 \"Imej terlalu besar\"\r\nt MSG_089 \"Imej ini terlalu besar untuk sasaran yang dipilih.\"\r\nt MSG_090 \"ISO tidak disokong\"\r\nt MSG_091 \"Apabila menggunakan jenis sasaran UEFI , hanya imej boot jenis EFI sahaja disokong. Sila pilih ISO boot jenis EFI atau tukarkan jenis sasaran kepada BIOS.\"\r\nt MSG_092 \"Sistem fail tidak disokong\"\r\nt MSG_093 \"PENTING: PERANTI INI MEMPUNYAI BEBERAPA PARTISYEN!!\\n\\nIni mungkin termasuk partisyen/jilid yang tidak disenaraikan atau tidak boleh dilihat dari Windows. Jika anda mahu meneruskannya, anda bertanggungjawab ke atas kehilangan data dalam partisyen tersebut.\"\r\nt MSG_094 \"Beberapa partisyen dikesan\"\r\nt MSG_095 \"DD Imej\"\r\nt MSG_096 \"Sistem fail yang sedang dipilih tidak boleh digunakan dengan jenis ISO ini. Sila pilih sistem fail berlainan atau gunakan ISO berlainan.\"\r\nt MSG_097 \"'Windows To Go' hanya boleh digunakan jika sistem fail adalah NTFS.\"\r\nt MSG_098 \"PENTING: Anda cuba memasang 'Windows To Go', tetapi pemacu sasaran anda tidak mempunyai atribut 'FIXED'. Disebabkan ini Windows akan berkemungkinan besar sangkut sepanjang but, kerana Microsoft tidak merekanya untuk berfungsi dengan pemacu yang sebaliknya mempunyai atribut 'REMOVABLE'.\\n\\nAdakah anda masih mahu teruskan?\\n\\nNota: Atribut 'FIXED/REMOVABLE'adalah sifat perkakasan yang hanya boleh ditukar menggunakan alatan tersuai daripada pengilang pemacu. Bagaimanapun alatan tersebut adalah HAMPIR TIDAK AKAN diberikan kepada umum...\"\r\nt MSG_099 \"Had sistem fail\"\r\nt MSG_100 \"Imej ISO ini mengandungi fail yang lebih besar daripada 4 GB iaitu saiz maksima yang dibenarkan untuk sistem fail FAT atau FAT32.\"\r\nt MSG_101 \"Tiada sokongan WIM\"\r\nt MSG_102 \"Platform anda tidak boleh mengekstrak fail daripada arkib WIM. Ini diperlukan untuk mencipta cakera boot EFI Windows 7 dan Windows Vista. Anda boleh membaikinya dengan cara mendapatkan versi 7-Zip terbaharu.\\nAdakah anda mahu ke halaman muat turun 7-zip?\"\r\nt MSG_103 \"Muat turun %s?\"\r\nt MSG_104 \"%s atau kemudian memerlukan fail '%s' di komputer anda.\\nOleh sebab fail tersebut lebih besar daripada 100 KB dan sentiasa ada dalam imej %s, Ia tidak termasuk dalam Rufus.\\n\\nRufus boleh memuat turun fail tersebut untuk anda:\\n- Pilih 'Ya' untuk muat turun fail tersebut\\n- Pilih 'Tidak' jika anda mahu menyalin fail tersebut secara manual ke cakera ini pada masa lain\\n\\nPerhatian: Fail akan dimuat turun ke direktori bersamaan Rufus dan apabila '%s' ada di sana, ia akan digunakan semula secara automatik.\"\r\nt MSG_105 \"Pembatalan boleh menyebabkan peranti ini TIDAK BOLEH DIGUNAKAN SEMULA.\\nJika anda pasti anda mahu membatalkannya, klik Ya. Sebaliknya, klik Tidak.\"\r\nt MSG_106 \"Sila pilih folder\"\r\nt MSG_107 \"Semua fail\"\r\nt MSG_108 \"Log Rufus\"\r\nt MSG_109 \"0x%02X (Cakera %d)\"\r\nt MSG_110 \"MS-DOS tidak boleh boot daripada cakera yang menggunakan saiz gugusan 64 kilobait.\\nSila tukarkan saiz gugusan atau gunakan FreeDOS.\"\r\nt MSG_111 \"Saiz gugusan tidak sesuai\"\r\nt MSG_112 \"Pemformatan jilid UDF yang besar mengambil masa yang amat lama. Pada kelajuan USB 2.0, anggaran masa pemformatan adalah %d:%02d, dimana bar kemajuan akan kelihatan seperti ia tidak bergerak. Sila bersabar!\"\r\nt MSG_113 \"Jilid UDF besar\"\r\nt MSG_114 \"Imej ini menggunakan Syslinux %s%s tetapi aplikasi ini hanya mempunyai fail pemasangan untukSyslinux %s%s.\\n\\nOleh kerana versi-versi baharu Syslinux tidak serasi dengan satu sama lain, maka tidakwajar Rufus menyediakan semuanya, dua fail tambahan perlu dimuat turun dariInternet ('ldlinux.sys' dan 'ldlinux.bss'):\\n- Pilih 'Ya' untuk menyambung ke Internet dan memuat turun fail tersebut\\n- Pilih 'Tidak' untuk membatalkan operasi\\n\\nNOTA:Fail akan dimuat turun ke dalam direktori aplikasi ini dan akan digunakan semulasecara automatik sekiranya sedia ada.\"\r\nt MSG_115 \"Muat turun diperlukan\"\r\nt MSG_116 \"Imej ini menggunakan Grub %s tetapi aplikasi hanya termasuk fail pemasangan untuk Grub %s.\\n\\nSepertimana versi Grub berlainan mungkin tidak sesuai antara satu sama lain, dan ianya tidak mungkin untuk memasukkan mereka semua, Rufus akan cuba mengesan versi fail pemasangan Grub ('core.img') yang sepadan dengan salah satu daripada imej anda:\\n- Pilih 'Ya' untuk bersambung ke Internet dan cuba memuat turunnya\\n- Pilih 'Tidak' untuk menggunakan versi lalai dari Rufus\\n- Pilih 'Batal' untuk membatalkan operasi\\n\\nNota: Fail akan dimuat turun dalam direktori aplikasi semasa dan akan digunakan semula secara automatik jika ada. Jika tiada padanan boleh dijumpai dalam talian, versi lalai akan digunakan.\"\r\nt MSG_117 \"Pemasangan Windows biasa\"\r\nt MSG_119 \"pilihan tambahan pemacu\"\r\nt MSG_120 \"pilihan format tambahan\"\r\nt MSG_121 \"Tunjuk %s\"\r\nt MSG_122 \"Sembunyi %s\"\r\nt MSG_123 \"Saiz pemetakan berterusan (persistence partition)\"\r\nt MSG_124 \"Tidak berterusan\"\r\nt MSG_125 \"Mengeset saiz pemetakan berterusan (persistent partition) untuk media 'live USB'. Setkan saiz kepada 0 untuk melumpuhkan pemetakan berterusan.\"\r\nt MSG_126 \"Set saiz unit pemetakan.\"\r\nt MSG_127 \"Henti papar mesej ini\"\r\nt MSG_128 \"Notis penting berkenaan %s\"\r\nt MSG_129 \"Anda telah menghasilkan media yang menggunakan bootloader UEFI:NTFS. ANDA PERLU MEMATIKAN PILIHAN SECURE BOOT.\\nUntuk mengetahui dengan lebih lanjut, sila klik butang 'Maklumat Lanjut' di bawah.\"\r\nt MSG_130 \"Pemilihan imej Windows\"\r\nt MSG_131 \"ISO ini mengandungi beberapa imej Windows.\\nSila pilih imej yang anda ingin gunakan untuk pemasangan:\"\r\nt MSG_132 \"Terdapat program atau proses lain sedang mencapai pemacu ini. Adakah anda mahu memformatnya juga?\"\r\nt MSG_133 \"Rufus telah mengesan bahawa anda sedang mencuba untuk mencipta media Windows To Go berasaskan imej ISO 1809.\\n\\nMemandangkan terdapat pepijat dari MICROSOFT, media ini akan menghadapi masalah (Blue Scree Of Death) semasa memulakan Windows, melainkan anda menukar fail 'WppRecorder.sys' kepada versi 1803.\\n\\nSila ambil perhatian. Rufus tidak akan membaiki masalah ini kerana 'WppRecorder.sys' adalah hak cipta milik Microsoft dan kami tidak dapat menyertakan salinan fail berkenaan bersama-sama aplikasi ini...\"\r\nt MSG_134 \"Memandangkan skema pemetakan MBR telah dipilih, Rufus akan menghasilkan petak storan media dengan saiz maksimum 2 TB, di mana %s ruang cakera adalah tidak tersedia.\\n\\nAdakah anda pasti ingin meneruskan operasi?\"\r\nt MSG_135 \"Versi\"\r\nt MSG_136 \"Keluaran\"\r\nt MSG_137 \"Edisi\"\r\nt MSG_138 \"Bahasa\"\r\nt MSG_139 \"Kerangka\"\r\nt MSG_140 \"Terus\"\r\nt MSG_141 \"Undur\"\r\nt MSG_142 \"Sila tunggu...\"\r\nt MSG_143 \"Muat turun menggunakan pelayar web\"\r\nt MSG_144 \"Muat turun ISO Windows tidak tersedia kerana Microsoft telah mengubah laman web mereka untuk menghalangnya.\"\r\nt MSG_145 \"PowerShell 3.0 atau versi lebih baru diperlukan untuk menjalankan skrip ini.\"\r\nt MSG_146 \"Adakah anda ingin ke dalam talian dan memuat turun?\"\r\nt MSG_148 \"Menjalankan skrip untuk memuat turun...\"\r\nt MSG_149 \"Memuat turun imej ISO\"\r\nt MSG_150 \"Jenis komputer yang anda merancang untuk menggunakan cakera \\\"bootable\\\" ini. Adalah menjadi tanggungjawab anda untuk menentukan sama ada sasaran anda adalah jenis BIOS atau UEFI sebelum anda wujudkan cakera tersebut, kerana ia mungkin gagal untuk boot.\"\r\nt MSG_151 \"'UEFI-CSM' bermaksud peranti hanya akan boot di dalam mod emulasi BIOS (juga dikenali sebagai 'Legacy Mode') dibawah UEFI, dan bukan dalam mod asli UEFI.\"\r\nt MSG_152 \"'bukan CSM' bermaksud peranti hanya akan boot di dalam mod asli UEFI, dan bukan di mod emulasi BIOS (juga dikenali sebagai 'Legacy Mode').\"\r\nt MSG_153 \"Uji corak: 0x%02X\"\r\nt MSG_154 \"Uji corak: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Uji corak: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Uji corak: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Menetapkan sistem fail sasaran\"\r\nt MSG_158 \"Saiz minima satu blok data akan gunakan dalam sistem fail\"\r\nt MSG_159 \"Gunakan ini untuk tetapkan label cakera.\\nHuruf antarabangsa boleh digunakan.\"\r\nt MSG_160 \"Togel pilihan lanjutan\"\r\nt MSG_161 \"Semak peranti untuk blok rosak menggunakan corak ujian\"\r\nt MSG_162 \"Nyahtanda kotak ini untuk menggunakan kaedah pemformatan perlahan\"\r\nt MSG_163 \"Kaedah yang digunakan untuk mencipta partisyen\"\r\nt MSG_164 \"Kaedah yang digunakan untuk membuat cakera boot\"\r\nt MSG_165 \"Klik untuk memilih atau memuat turun imej...\"\r\nt MSG_166 \"Klik kotak ini untuk membenarkan paparan label antarabangsa dan menetapkan ikon cakera (akan membuat fail autorun.inf)\"\r\nt MSG_167 \"Memasang MBR yang membenarkan pilihan boot dan mampu menyamar ID BIOS USB\"\r\nt MSG_168 \"Cuba menyamarkan cakera USB boot (biasanya 0x80) sebagai cakera lain.\\nIni hanya diperlukan jika anda memasang Windows XP dan mempunyai lebih daripada satu cakera.\"\r\nt MSG_169 \"Ciptakan partisyen tambahan tersembunyi dan cuba melaraskan sempadan partisyen.\\nIni boleh mempertingkatkan pengesanan boot untuk BIOS lama.\"\r\nt MSG_170 \"Membolehkan penyenaraian pagaran cakera keras USB. GUNAKAN ATAS RISIKO SENDIRI!!!\"\r\nt MSG_171 \"Mulakan operasi pemformatan.\\nIni akan MEMADAMKAN semua data pada sasaran!\"\r\nt MSG_172 \"Tandatangan digital muat turun tidak sah\"\r\nt MSG_173 \"Klik untuk memilih...\"\r\nt MSG_174 \"Rufus - Utiliti pemformatan USB yang dipercayai\"\r\nt MSG_175 \"Versi %d.%d (Build %d)\"\r\nt MSG_176 \"Terjemahan Bahasa Malaysia:\\\\line\\n• Muhammad Aman <mailto:aman.tifli@gmail.com>\\\\line\\n• VGPlayer <mailto:razman90a@yahoo.com.my>\\\\line\\n• Mohamad Ikhwan bin Kori <mailto:ikhwankori@gmail.com>\"\r\nt MSG_177 \"Laporkan masalah atau cadangan penambahbaikan di:\"\r\nt MSG_178 \"Hak cipta tambahan:\"\r\nt MSG_179 \"Polisi kemaskini:\"\r\nt MSG_180 \"Jika anda pilih untuk membenarkan perisian ini menyemak untuk aplikasi versi baharu, anda bersetuju untuk membenarkan pelayan kami mengumpulkan maklumat berikut:\"\r\nt MSG_181 \"Versi dan kerangka sistem operasi\"\r\nt MSG_182 \"Versi aplikasi yang anda gunakan\"\r\nt MSG_183 \"Alamat IP anda\"\r\nt MSG_184 \"Untuk tujuan menjana statistik penggunaan peribadi , kami mungkin menyimpan maklumat yang dikumpulkan, \\\\b untuk sekurang-kurangnya setahun\\\\b0 . Namun, kami tidak rela untuk mendedahkan maklumat ini kepada mana-mana pihak ketiga.\"\r\nt MSG_185 \"Proses mengemas kini:\"\r\nt MSG_186 \"Rufus tidak memasang atau menjalankan servis di latar belakang. Oleh itu, semakan kemas kini hanya dijalankan apabila aplikasi utama berjalan.\\\\line\\nAkses internet diperlukan untuk menyemak untuk versi baru.\"\r\nt MSG_187 \"Imej tidak sah untuk pilihan boot yang dipilih\"\r\nt MSG_188 \"Imej\\ttidak serasi dengan pilihan boot yang dipilih. Sila gunakan imej lain atau pilih pilihan boot lain.\"\r\nt MSG_189 \"Imej ISO ini tidak serasi dengan sistem fail yang dipilih\"\r\nt MSG_190 \"Pemacu tidak serasi dikesan\"\r\nt MSG_191 \"Melepasi tulisan\"\r\nt MSG_192 \"Melepasi bacaan\"\r\nt MSG_193 \"Muat turun %s\"\r\nt MSG_194 \"Tidak boleh muat turun %s\"\r\nt MSG_195 \"Menggunakan %s fail versi dibenam\"\r\nt MSG_196 \"PENTING: PEMACU INI MENGGUNAKAN SAIZ SEKTOR BUKAN PIAWAIAN!\\n\\nPemacu konvensional mengunakan saiz sektor 512 bait tetapi pemacu ini menggunakan %d bait. Dalam banyak kes, ini bermaksud anda TIDAK akan mampu untuk but dari pemacu ini.\\nRufus boleh cuba untuk mencipta pemacu boleh but, tetapi TIDAK ADA JAMINAN ianya akan berfungsi.\"\r\nt MSG_197 \"Saiz sektor bukan standard dikesan\"\r\nt MSG_198 \"'Windows To Go' hanya boleh dipasang dalam pemacu berpartisyen GPT jika ia mempunyai set atribut 'FIXED'. Pemacu semasa tidak dikesan sebagai 'FIXED'.\"\r\nt MSG_199 \"Ciri ini tidak tersedia di platform ini.\"\r\nt MSG_201 \"Sedang membatalkan - Sila tunggu...\"\r\nt MSG_202 \"Mengimbas imej...\"\r\nt MSG_203 \"Imbasan imej gagal\"\r\nt MSG_204 \"%s lapuk dikesan\"\r\nt MSG_205 \"Menggunakan imej: %s\"\r\nt MSG_206 \"Tidak menjumpai fail %s\"\r\nt MSG_207 \"Jilid baharu\"\r\nt MSG_208 \"%d peranti dijumpai\"\r\nt MSG_209 \"%d peranti dijumpai\"\r\nt MSG_210 \"SEDIA\"\r\nt MSG_211 \"DIBATALKAN\"\r\nt MSG_212 \"GAGAL\"\r\nt MSG_213 \"Melancarkan aplikasi baru...\"\r\nt MSG_214 \"Gagal untuk melancarkan aplikasi baru\"\r\nt MSG_215 \"%s dibuka\"\r\nt MSG_216 \"%s disimpan\"\r\nt MSG_217 \"Pemformatan: %s\"\r\nt MSG_218 \"Mencipta sistem fail: Tugas %d/%d selesai\"\r\nt MSG_219 \"Pembaikian NTFS: %d%% selesai\"\r\nt MSG_220 \"Pemformatan (%s) - Jangka masa anggaran %d:%02d...\"\r\nt MSG_221 \"Menetapkan Label (%s)...\"\r\nt MSG_222 \"Pemformatan (%s)...\"\r\nt MSG_223 \"Pembaikian NTFS (Periksa cakera)...\"\r\nt MSG_224 \"Memadam struktur MBR/PBR/GPT...\"\r\nt MSG_225 \"Meminta akses cakera...\"\r\nt MSG_226 \"Menganalisis rekod boot sedia ada...\"\r\nt MSG_227 \"Menutup jilid sedia ada...\"\r\nt MSG_228 \"Menulis \\\"Rekod master boot\\\"...\"\r\nt MSG_229 \"Menulis \\\"Rekod boot partisyen\\\"...\"\r\nt MSG_230 \"Menyalin fail DOS...\"\r\nt MSG_231 \"Menyalin fail ISO: %s\"\r\nt MSG_232 \"Persediaan boot EFI Win7 (%s)...\"\r\nt MSG_233 \"Menyiapkan, sila tunggu...\"\r\nt MSG_234 \"Memasang Syslinux %s...\"\r\nt MSG_235 \"Blok rosak: %s %d/%d - %0.2f%% (%d/%d/%d kesilapan)\"\r\nt MSG_236 \"Blok rosak: menguji dengan corak rawak\"\r\nt MSG_237 \"Blok rosak: Menguji dengan corak 0x%02X\"\r\nt MSG_238 \"Mempartisyenkan (%s)...\"\r\nt MSG_239 \"Memadam partisyen (%s)...\"\r\nt MSG_240 \"Tandatangan untuk pengemaskinian telah dimuat turun tidak dapat disahkan. Ini boleh bermakna bahawa sistem anda dikonfigurasi dengan salah untuk pengesahan tandatangan atau menunjukkan fail yang dimuat turun berisi dengan virus\\n\\nFail yang dimuat turun akan dihapuskan. Sila periksa log untuk maklumat lanjut.\"\r\nt MSG_241 \"Memuat turun: %s\"\r\nt MSG_242 \"Gagal memuat turun fail.\"\r\nt MSG_243 \"Memeriksa untuk kemas kini Rufus...\"\r\nt MSG_244 \"Kemas kini: Tidak dapat menyambung ke internet\"\r\nt MSG_245 \"Kemas kini: Tidak dapat mengakses data versi\"\r\nt MSG_246 \"Versi baru Rufus boleh didapati!\"\r\nt MSG_247 \"Tiada versi baru Rufus didapati\"\r\nt MSG_248 \"Kekunci daftar aplikasi berjaya dipadam\"\r\nt MSG_249 \"Gagal memadam kekunci daftar aplikasi\"\r\nt MSG_250 \"%s dibolehkan\"\r\nt MSG_251 \"%s tidak dibolehkan\"\r\nt MSG_252 \"Menyemak saiz\"\r\nt MSG_253 \"Pengesanan cakera keras\"\r\nt MSG_254 \"Memaksa pemformatan FAT32 besar\"\r\nt MSG_255 \"NoDriveTypeAutorun akan dipadam apabila keluar\"\r\nt MSG_256 \"Pengesanan cakera palsu\"\r\nt MSG_257 \"Sokongan Joliet\"\r\nt MSG_258 \"Sokongan Rock Ridge\"\r\nt MSG_259 \"Paksa kemas kini\"\r\nt MSG_260 \"Mampatan NTFS\"\r\nt MSG_261 \"Menulis imej: %s\"\r\nt MSG_262 \"Sokongan ISO\"\r\nt MSG_263 \"Guna saiz seunit yang BETUL\"\r\nt MSG_264 \"Memadam direktori '%s'\"\r\nt MSG_265 \"Pengesanan cakera VMWare\"\r\nt MSG_266 \"Mod dwi UEFI/BIOS\"\r\nt MSG_267 \"Menggunakan imej Windows: %s\"\r\nt MSG_268 \"Menggunakan imej Windows...\"\r\nt MSG_269 \"Mengekalkan cap masa\"\r\nt MSG_270 \"Nyahpijat USB\"\r\nt MSG_271 \"Mengira semak tambah imej: %s\"\r\nt MSG_272 \"Mengira semak tambah MD5, SHA1 dan SHA256 imej dipilih\"\r\nt MSG_273 \"Menukar bahasa aplikasi\"\r\nt MSG_274 \"%s imej dikesan\"\r\nt MSG_275 \"Imej yang anda telah pilih adalah imej 'ISOHybrid'. Ini bermaksud ia boleh ditulis sama ada dalam %s mod (salinan fail) atau %s mod (imej cakera).\\nRufus galakkan menggunakan mod %s, jadi anda selalu mempunyai akses penuh ke pemacu selepas menulisnya.\\nBagaimanapun, jika anda menghadapi isu-isu semasa boot, anda boleh cuba menulis imej ini lagi dalam mod %s.\\n\\nSila pilih mod yang anda mahu guna untuk menulis imej ini:\"\r\nt MSG_276 \"Menulis dalam mod %s (Digalakkan)\"\r\nt MSG_277 \"Menulis dalam mod %s\"\r\nt MSG_278 \"Menyemak proses yang berkonflik.\"\r\nt MSG_279 \"Tidak boleh boot\"\r\nt MSG_280 \"Cakera atau imej ISO\"\r\nt MSG_281 \"%s (Sila pilih)\"\r\nt MSG_282 \"Penguncian pemacu USB eksklusif\"\r\nt MSG_283 \"Tandatangan tidak sah\"\r\nt MSG_284 \"'Executable' yang dimuat turun kehilangan tandatangan digital.\"\r\nt MSG_285 \"'Executable' yang dimuat turun ditandatangani oleh '%s'.\\nIni bukannya tandatangan yang kami kenal dan boleh menunjukkan beberapa bentuk aktiviti berniat jahat...\\nAdakah anda pasti anda mahu menjalankan fail ini?\"\r\nt MSG_286 \"Mensifarkan pemacu: %s\"\r\nt MSG_287 \"Mengesan cakera bukan USB\"\r\nt MSG_288 \"Hilang hak kebenaran istimewa\"\r\nt MSG_289 \"Aplikasi ini hanya boleh digunakan apabila diberikan hak kebenaran istimewa\"\r\nt MSG_290 \"Pengindeksan Fail\"\r\nt MSG_291 \"Pemilihan versi\"\r\nt MSG_292 \"Sila pilih versi Windows yang anda ingin memasang:\"\r\nt MSG_293 \"Versi Windows tidak disokong\"\r\nt MSG_294 \"Versi Windows ini tidak lagi disokong oleh Rufus.\\nVersi terakhir Rufus yang serasi dengan platform ini ialah v%d.%d.\"\r\nt MSG_295 \"Amaran: versi bukan rasmi\"\r\nt MSG_296 \"Versi Rufus ini bukan dibuat oleh pemaju-pemaju rasmi Rufus. \\n\\nAdakan anda yakin ingin menggunakannya?\"\r\nt MSG_297 \"ISO yang dipenggal dikesan\"\r\nt MSG_298 \"Saiz fail ISO yang anda pilih adalah tidak sama dengan saiz yang diisytiharkan oleh fail ISO ini. %s data telah hilang!\\n\\nJika fail ini diperolehi dari intenet, anda sepatutnya muat turun semula fail ini dan sahkan bahawa tandatangan MD5 atau SHA adalah sama dengan versi yang rasmi.\\n\\nAnda boleh dapatkan MD5 atau SHA fail yang dipilih ini dengan menekan butang (✓). Kemudian anda perlu membandingkan dengan MD5 atau SHA daripada fail yang rasmi.\"\r\nt MSG_299 \"Ralat validasi cap waktu\"\r\nt MSG_300 \"Rufus tidak dapat mengesahkan bahawa kemas kini yang dimuat turun adalah lebih baru daripada aplikasi yang dijalankan sekarang.\\n\\nUntuk mengelakkan daripada senario dimana PC diserang dengan virus, proses kemaskini telah dibatalkan dan fail yang telah dimuat turun akan dipadam. Sila semak log untuk maklumat lanjut.\"\r\nt MSG_301 \"Tunjuk tetapan aplikasi\"\r\nt MSG_302 \"Paparkan maklumat tentang aplikasi ini\"\r\nt MSG_303 \"Paparkan log\"\r\nt MSG_304 \"Cipta imej cakera untuk peranti yang dipilih\"\r\nt MSG_305 \"Pilih pilihan ini jika anda mahu memasang Windows pada komputer lain atau ingin menggunakan Windows terus daripada cakera/media ini (Windows To Go)\"\r\nt MSG_306 \"Mensifarkan pemacu 'Fast': %s\"\r\nt MSG_307 \"ini mungkin mengambil sedikit masa\"\r\nt MSG_308 \"Pengesanan VHD\"\r\nt MSG_309 \"Arkib termampat\"\r\nt MSG_310 \"ISO yang anda pilih menggunakan UEFI dan cukup kecil untuk ditulis sebagai Partition Sistem EFI (ESP). Menulis kepada ESP, bukannya menulis kepada partition data generik yang menduduki keseluruhan cakera, boleh menjadi lebih baik untuk beberapa jenis pemasangan.\\n\\nSila pilih mod yang anda mahu gunakan untuk menulis imej ini:\"\r\nt MSG_311 \"Gunakan %s (dalam tetingkap aplikasi utama) untuk mendayakan.\"\r\nt MSG_312 \"Cincangan tambahan (SHA512)\"\r\nt MSG_313 \"Simpan ke VHD\"\r\nt MSG_314 \"Pengiraan semakan imej\"\r\nt MSG_315 \"Pelbagai butang\"\r\nt MSG_316 \"Bilangan pas\"\r\nt MSG_317 \"ID Cakera\"\r\nt MSG_318 \"Keutamaan benang lalai: %d\"\r\nt MSG_319 \"Abaikan penanda but\"\r\nt MSG_320 \"Tataletak partition yang menyegarkan (%s)...\"\r\nt MSG_321 \"Imej yang anda pilih ialah ISOHybrid, tetapi penciptanya tidak menjadikannya serasi dengan mod salinan ISO/Fail.\\nAkibatnya, mod penulisan imej DD akan dikuatkuasakan.\"\r\nt MSG_322 \"Tidak dapat membuka atau membaca '%s'\"\r\nt MSG_325 \"Menggunakan penyesuaian Windows: %s\"\r\nt MSG_326 \"Menggunakan pilihan pengguna...\"\r\nt MSG_327 \"Pengalaman Pengguna Windows\"\r\nt MSG_328 \"Sesuaikan pemasangan Windows?\"\r\nt MSG_329 \"Alih keluar keperluan untuk 4GB+ RAM, But Selamat dan TPM 2.0\"\r\nt MSG_330 \"Alih keluar keperluan untuk akaun Microsoft dalam talian\"\r\nt MSG_331 \"Nyahdayakan pengumpulan data (Langkau soalan privasi)\"\r\nt MSG_332 \"Halang Windows To Go daripada mengakses cakera dalaman\"\r\nt MSG_333 \"Buat akaun tempatan dengan nama pengguna:\"\r\nt MSG_334 \"Mengesetkan opsyen rantau kepada nilai yang sama seperti pengguna ini\"\r\nt MSG_335 \"Lumpuhkan penyulitan peranti automatik BitLocker\"\r\nt MSG_336 \"Log berterusan\"\r\nt MSG_900 \"Rufus adalah utiliti yang membantu memformat dan mencipta pemacu kilat USB boot, seperti pemacu pen/kekunci USB, kayu memori, dan lain-lain.\"\r\nt MSG_901 \"Laman rasmi: %s\"\r\nt MSG_902 \"Kod Sumber: %s\"\r\nt MSG_904 \"Permohonan ini dilesenkan di bawah syarat-syarat Lesen Awam GNU (GPL) versi 3.\\nLihat https://www.gnu.org/licenses/gpl-3.0.html untuk butiran.\"\r\nt MSG_910 \"Formatkan USB, kad flash dan pemacu maya kepada FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Buat pemacu USB boleh boot FreeDOS\"\r\nt MSG_912 \"Buat pemacu boleh boot daripada ISO boleh boot (Windows, Linux, dll.)\"\r\nt MSG_913 \"Buat pemacu boleh boot daripada imej cakera boleh boot, termasuk yang dimampatkan\"\r\nt MSG_914 \"Buat pemacu boleh boot BIOS atau UEFI, termasuk NTFS boleh boot UEFI\"\r\nt MSG_915 \"Buat pemacu 'Windows To Go'\"\r\nt MSG_916 \"Buat pemacu pemasangan Windows 11 untuk PC yang tidak mempunyai TPM atau But Selamat\"\r\nt MSG_917 \"Buat partition Linux berterusan\"\r\nt MSG_918 \"Buat imej VHD/DD bagi pemacu yang dipilih\"\r\nt MSG_919 \"Kira MD5, SHA-1, SHA-256 dan SHA-512 checksum imej yang dipilih\"\r\nt MSG_920 \"Melakukan pemeriksaan blok buruk, termasuk pengesanan pemacu kilat \\\"palsu\\\"\"\r\nt MSG_921 \"Muat turun rasmi ISO runcit Microsoft Windows\"\r\nt MSG_922 \"Muat turun ISO Shell UEFI\"\r\n\r\n#########################################################################\r\nl \"nb-NO\" \"Norwegian (Norsk)\" 0x0414\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Om Rufus\"\r\nt IDC_ABOUT_LICENSE \"Lisens\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Stasjons rettigheter\"\r\nt IDS_DEVICE_TXT \"Enhet\"\r\nt IDS_BOOT_SELECTION_TXT \"Oppstartstype\"\r\nt IDC_SELECT \"Velg\"\r\nt IDS_IMAGE_OPTION_TXT \"Bildevalg\"\r\nt IDS_PARTITION_TYPE_TXT \"Partisjonskjema\"\r\nt IDS_TARGET_SYSTEM_TXT \"Målsystem\"\r\nt IDC_LIST_USB_HDD \"Før opp USB harddisker\"\r\nt IDC_OLD_BIOS_FIXES \"Legger til fiks for gamle BIOSer (ekstra partisjon, etc.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Aktiver runtime UEFI-medievalidering\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Format-valg\"\r\nt IDS_FILE_SYSTEM_TXT \"Filsystem\"\r\nt IDS_CLUSTER_SIZE_TXT \"Cluster-størrelse\"\r\nt IDS_LABEL_TXT \"Volumnavn\"\r\nt IDC_QUICK_FORMAT \"Hurtigformatering\"\r\nt IDC_BAD_BLOCKS \"Sjekk enhet for dårlige blokker\"\r\nt IDC_EXTENDED_LABEL \"Lager utvidet merke og ikon-filer\"\r\nt IDCANCEL \"Lukk\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Lukk\"\r\nt IDD_LICENSE \"Rufus Lisens\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Lukk\"\r\nt IDD_LOG \"Logg\"\r\nt IDC_LOG_CLEAR \"Slett\"\r\nt IDC_LOG_SAVE \"Lagre\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Lukk\"\r\nt IDD_NEW_VERSION \"Sjekker for oppdateringer - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"En ny versjon er tilgjengelig. Vennligst last ned den nyeste versjonen!\"\r\nt IDC_WEBSITE \"Klikk her for å gå til nettsiden\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Utgivelsesnotater\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Last ned\"\r\nt IDC_DOWNLOAD \"Last ned\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Mer informasjon\"\r\nt IDYES \"Ja\"\r\nt IDNO \"Nei\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Lukk\"\r\nt IDD_UPDATE_POLICY \"Oppdateringspolitikk og innstillinger\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Innstillinger\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Se etter oppdateringer\"\r\nt IDS_INCLUDE_BETAS_TXT \"Inkluder betaversjoner\"\r\nt IDC_CHECK_NOW \"Sjekk nå\"\r\n\r\nt MSG_001 \"Annen forekomst oppdaget\"\r\nt MSG_002 \"Annen Rufus-utgave kjører.\\nVennligst lukk den første utgaven, før du åpner en ny.\"\r\nt MSG_003 \"ADVARSEL: ALLE DATA PÅ STASJONEN '%s' VIL BLI OVERSKREVET.\\nFor å fortsette denne operasjonen, klikk OK. For å avslutte klikk Avbryt.\"\r\nt MSG_004 \"Rufus oppdateringspolitikk\"\r\nt MSG_005 \"Vil du tillate at Rufus ser etter oppdateringer online?\"\r\nt MSG_006 \"Lukk\"\r\nt MSG_007 \"Avbryt\"\r\nt MSG_008 \"Ja\"\r\nt MSG_009 \"Nei\"\r\nt MSG_010 \"Dårlige blokker funnet\"\r\nt MSG_011 \"Sjekk fullført: %d dårlig(e) blokke(r) funnet\\n  %d Lese feil\\n  %d Skrivefeil\\n  %d Korrupte feil\"\r\nt MSG_012 \"%s\\nA Mer detaljert rapport kan finnes her:\\n%s\"\r\nt MSG_013 \"Deaktivert\"\r\nt MSG_014 \"Daglig\"\r\nt MSG_015 \"Ukentlig\"\r\nt MSG_016 \"Månedlig\"\r\nt MSG_017 \"Bruker\"\r\nt MSG_018 \"Din versjon: %d.%d (Utgave %d)\"\r\nt MSG_019 \"Siste versjon: %d.%d (Utgave %d)\"\r\nt MSG_027 \"kilobyte\"\r\nt MSG_028 \"megabyte\"\r\nt MSG_029 \"Standard\"\r\nt MSG_030 \"%s (Standard)\"\r\nt MSG_031 \"BIOS (eller UEFI-CSM)\"\r\nt MSG_032 \"UEFI (ikke CSM)\"\r\nt MSG_033 \"BIOS eller UEFI\"\r\nt MSG_034 \"%d Passering\"\r\nt MSG_035 \"%d Passeringer %s\"\r\nt MSG_036 \"ISO-bilde\"\r\nt MSG_037 \"Applikasjon\"\r\nt MSG_038 \"Avbryt\"\r\nt MSG_039 \"Kjør\"\r\nt MSG_040 \"Last ned\"\r\nt MSG_041 \"Operasjon avbrutt av bruker\"\r\nt MSG_042 \"Feil\"\r\nt MSG_043 \"Feil: %s\"\r\nt MSG_044 \"Fil-nedlasting\"\r\nt MSG_045 \"USB-lagringsenhet (Generisk)\"\r\nt MSG_047 \"Flere partisjoner\"\r\nt MSG_048 \"Rufus - Tømmer buffere\"\r\nt MSG_049 \"Rufus - Avbryter\"\r\nt MSG_050 \"Suksess.\"\r\nt MSG_051 \"Ubestemmelig feil under formateringen.\"\r\nt MSG_052 \"Kan ikke bruke det valgte filsystem for dette mediet.\"\r\nt MSG_053 \"Ikke tilgang til denne enheten.\"\r\nt MSG_054 \"Mediet er skrivebeskyttet.\"\r\nt MSG_055 \"Enheten brukes av en annen prosess. Vennligst lukk den andre prosessen som muligens bruker denne enheten.\"\r\nt MSG_056 \"Hurtigformatering er ikke tilgjengelig for denne enheten.\"\r\nt MSG_057 \"Volumnavnet er ugyldig.\"\r\nt MSG_058 \"Enhetshåndteringen er ugyldig.\"\r\nt MSG_059 \"Den valgte cluster-størrelsen er ikke gyldig for denne enheten.\"\r\nt MSG_060 \"Volumstørrelsen er ugyldig.\"\r\nt MSG_061 \"Vennligst sett inn et media i stasjonen.\"\r\nt MSG_062 \"Ustøttet kommando mottatt.\"\r\nt MSG_063 \"Minnetildelingsfeil.\"\r\nt MSG_064 \"Lesefeil.\"\r\nt MSG_065 \"Skrivefeil.\"\r\nt MSG_066 \"Installasjonsfeil\"\r\nt MSG_067 \"Kunne ikke åpne media. Er muligens i bruk av en annen prosess. Vennligst koble fra, og prøv å koble til på nytt.\"\r\nt MSG_068 \"Kunne ikke partisjonere disken.\"\r\nt MSG_069 \"Kunne ikke kopiere filer til målstasjonen.\"\r\nt MSG_070 \"Brukeravbrutt.\"\r\nt MSG_071 \"Ikke mulig å starte tråd.\"\r\nt MSG_072 \"Dårlig blokk-kontroll ikke fullført.\"\r\nt MSG_073 \"ISO-bilde skanningsfeil.\"\r\nt MSG_074 \"ISO-bilde utpakkingsfeil.\"\r\nt MSG_075 \"Ikke mulig å igjen-innkoble volum.\"\r\nt MSG_076 \"Ute av stand til å reparere filer for boot.\"\r\nt MSG_077 \"Ikke mulig å tildele en stasjonsbokstav.\"\r\nt MSG_078 \"Kan ikke montere GUID stasjon.\"\r\nt MSG_079 \"Denne enheten er ikke klar.\"\r\nt MSG_080 \"Rufus oppdaget at Windows fortsatt skriver til denne USB-enhetens interne buffer.\\n\\nAvhengig av hastigheten på din USB-enhet, vil muligens denne operasjonen ta lang til å fullføre, spesielt for store filer.\\n\\nVi anbefaler at du lar Windows fullføre, slik at feil unngås. Men blir du lei av og vente..., kan du koble fra enheten...\"\r\nt MSG_081 \"Ikke støttet bildefil\"\r\nt MSG_082 \"Dette ISO-bildet er enten ikke oppstartbar, eller så bruker den en oppstart eller pakkemetode som ikke er støttet av Rufus...\"\r\nt MSG_083 \"Bytte ut %s?\"\r\nt MSG_084 \"Dette ISO-bildet ser ut til å inneholde en foreldet versjon av '%s'.\\nBoot-menyene vil muligens bli vist feil p.g.a. dette.\\n\\nEn nyere versjon kan lastes ned fra Rufus for å fikse dette problemet:\\n- Velg 'Ja' for å koble til internett og laste ned filen\\n- Velg 'Nei' for å bruke den eksisterende ISO-filen\\nHvis du ikke vet hva du skal gjøre, bør du velge 'Ja'.\\n\\nOBS: Den nye filen vil bli lastet ned i den gjeldende mappen, og når'%s' er der, vil den bli brukt automatisk.\"\r\nt MSG_085 \"Laster ned %s\"\r\nt MSG_086 \"Intet bilde valgt\"\r\nt MSG_087 \"til %s NAND\"\r\nt MSG_088 \"Bildet er for stort\"\r\nt MSG_089 \"Bildet er for stort for det valgte målet.\"\r\nt MSG_090 \"Ikke støttet ISO\"\r\nt MSG_091 \"Når UEFI måltype blir brukt, er kun EFI oppstartbar ISO-bilde støttet. Vennligst velg en EFI oppstartbar ISO-fil eller sett måltype i BIOS.\"\r\nt MSG_092 \"Ikke støttet filsystem\"\r\nt MSG_093 \"VIKTIGT: DENNE STASJONEN INNEHOLDER FLERE PARTISJONER!!\\n\\nDenne inneholder kanskje partisjoner/volumer som ikke er listet, og muligens ikke er synlig i Windows. Hvis du ønsker å fortsette, er du selv ansvarlig for evt. tapte data på disse partisjonene.\"\r\nt MSG_094 \"Flere partisjoner oppdaget\"\r\nt MSG_095 \"DD-bilde\"\r\nt MSG_096 \"Filsystemet som er valgt kan ikke brukes med denne type ISOVennligst velg ett annet filsystem, eller bruk en annen ISO.\"\r\nt MSG_097 \"'%s' kan kun brukes hvis filsystemet er NTFS.\"\r\nt MSG_098 \"VIKTIGT: Du prøver å installere 'Windows To Go', med målstasjonen ikke harden rette beskrivelsen. P.g.a dette vil Windows sannsynligvis stoppe opp under oppstarten, da Microsoft ikke har designet den til å virke med stasjoner som er 'FLYTTBAR'. \\n\\nØnsker du å fortsette?\\n\\nOBS:'FAST/FLYTTBAR' er et hardware-valg som kun kan endres ved å bruke spesialutstyr fra stasjonsprodusenten. Uansett er dette verktøyet NESTEN ALDRI tilgjengelig for publikum...\"\r\nt MSG_099 \"Filsystem begrensning\"\r\nt MSG_100 \"Dette ISO-bildet inneholder filer større enn 4 GB, som er mer enn den maksimalt tillate størrelsen for FAT eller FAT32 fil-systemet.\"\r\nt MSG_101 \"Mangler WIM-støtte\"\r\nt MSG_102 \"Din plattform kan ikke pakke ut filer fra WIM-arkiver. WIM-utpakking er påkrevd for å lage EFI oppstartbar Windows 7 og Windows Vista USB-stasjoner. Du kan fikse det ved å installere siste versjon av 7-Zip.\\nVil du besøke 7-zip nedlastingssiden?\"\r\nt MSG_103 \"Lastet ned %s?\"\r\nt MSG_104 \"%s eller senere er påkrevd for at '%s' filen kan bli innstallert.\\nP.g.a. filen er mer enn 100 KB i størrelse, og er alltid tilstede i %s ISO-bilder, og den ikke er innebygd i Rufus.\\n\\nRufus kan laste den den manglende filen for deg:\\n- Velg 'Ja' for å koble til internett og laste ned filen\\n- Velg 'Nei' hvis du vil kopiere denne filen manuelt til stasjonen senere\\n\\nOBS: Denne filen vil bli lastet ned i den aktuelle mappen og straks den '%s' er der, vil den bli brukt automatisk.\"\r\nt MSG_105 \"Å avbryte, vil enheten være i en USTABIL tilstand.\\nHvis du er sikker på at du vil avbryte, klikk JA. Ellers klikk NEI.\"\r\nt MSG_106 \"Vennligst velg en mappe\"\r\nt MSG_107 \"Alle filer\"\r\nt MSG_108 \"Rufus logg\"\r\nt MSG_110 \"MS-DOS kan ikke boote fra en stasjon som brukeren 64 kilobytes Cluster størrelse.\\nVennligst bytt Cluster-størrelse eller bruk FreeDOS.\"\r\nt MSG_111 \"Inkompatibelt Cluster-størrelse\"\r\nt MSG_112 \"Formatere et stort UDF-volum kan ta lang tid. Ved å bruke USB 2.0 hastighet, den estimerte formateringstiden er %d:%02d, under denne tiden vil framgangslinjen virke frossen. Vennligst vær tålmodig!\"\r\nt MSG_113 \"Stort UDF-volum\"\r\nt MSG_114 \"Dette bildet bruker Syslinux %s%s men dette programmet inkluderer kun installsjonsfiler for Syslinux %s%s.\\n\\nNye versjoner av Syslinux er ikke kompatible med hverandre, og dermed ikke mulig for Rufus å inkludere alle, 2 ekstra filer må lastes ned fra Internett ('ldlinux.sys' og 'ldlinux.bss'):\\n- Velg 'Ja' For å koble til internett og laste ned disse filene\\n- Velg 'Nei' for å avbryte\\n\\nOBS: Filene vil bli lastet ned i det aktuelle programmets mappe og vil bli brukt automatisk hvis de er tilstede.\"\r\nt MSG_115 \"Nedlasting påkrevd\"\r\nt MSG_116 \"Dette bildet bruker Grub %s, men programmet inkluderer kun installasjonsfiler forGrub %s.\\n\\nForskjellige versjoner av Grub er muligens ikke kompatible med hverandre, og er ikke mulig å inkludere dem alle, Rufus vil prøve å finne en versjon av Grub installasjonfilen ('core.img') som passer til ditt bilde:\\n- Velg 'Ja' for å koble til internett og forsøke å laste den ned\\n- Velg 'Nei' for å bruke den innebygde versjonen uansett\\n- Velg 'Avbryt' for å avbryte\\n\\nOBS: Filen vil bli lastet ned i den aktuelle program-mappen og vil bli brukt automatisk hvis tilgjengelig. Hvis ingen treff kan bli funnet, den innebygde versjonen vil bli brukt.\"\r\nt MSG_117 \"Standard Windows installasjon\"\r\nt MSG_119 \"avanserte stasjonsegenskaper\"\r\nt MSG_120 \"avanserte formatalternativer\"\r\nt MSG_121 \"Vis %s\"\r\nt MSG_122 \"Skjul %s\"\r\nt MSG_123 \"Vedvarende partisjon størrelse\"\r\nt MSG_124 \"Ingen varighet\"\r\nt MSG_125 \"Still størrelsen på den vedvarende partisjonen for live USB media. Angir størrelsen til 0 deaktiverer den vedvarende partisjonen.\"\r\nt MSG_126 \"Sett partisjonens størrelse enheter.\"\r\nt MSG_127 \"Ikke vis denne beskjeden igjen\"\r\nt MSG_128 \"Viktig varsel om %s\"\r\nt MSG_129 \"Du har nettopp opprettet et medie som bruker UEFI: NTFS bootloader. Husk at, for å starte dette mediet, må du deaktivere SECURE BOOT.\\nFor detaljer om hvorfor dette er nødvendig, se \\\"Mer informasjon\\\" knappen nedenfor.\"\r\nt MSG_130 \"Windows image-valg\"\r\nt MSG_131 \"Denne ISO inneholder flere Windows-imager.\\nVennligst velg image du vil bruke til denne installasjonen:\"\r\nt MSG_132 \"Et annet program eller en prosess holder tilgang til denne disken. Vil du formatere det uansett?\"\r\nt MSG_133 \"Rufus har oppdaget at du forsøker å lage et Windows To Go-medie basert på en 1809 ISO.\\n\\nPå grunn av en *MICROSOFT BUG*, vil dette mediet krasje under Windows boot (Blue Screen Of Death), med mindre du manuelt erstatter filen 'WppRecorder.sys' med en 1803-versjon.\\n\\nVær også oppmerksom på at grunnen til at Rufus ikke automatisk kan fikse dette for deg, er at 'WppRecorder.sys' er en opphavsrettslig beskyttet fil fra Microsoft, slik at vi ikke lovlig kan legge inn en kopi av filen i programmet...\"\r\nt MSG_134 \"Fordi MBR er valgt for partisjonsskjemaet, kan Rufus bare opprette en partisjon på opptil 2 TB på dette mediet, noe som vil føre til at %s diskplass ikke er tilgjengelig.\\n\\nEr du sikker på at du vil fortsette?\"\r\nt MSG_135 \"Versjon\"\r\nt MSG_136 \"Utgivelse\"\r\nt MSG_137 \"Utgave\"\r\nt MSG_138 \"Språk\"\r\nt MSG_139 \"Arkitektur\"\r\nt MSG_140 \"Fortsett\"\r\nt MSG_141 \"Tilbake\"\r\nt MSG_142 \"Vennligst vent...\"\r\nt MSG_143 \"Last ned ved hjelp av en nettleser\"\r\nt MSG_144 \"Nedlasting av Windows ISO fra Microsoft er ikke tilgjengelig. Microsoft har endret websiden for å forhindre nedlastinger på denne måten.\"\r\nt MSG_145 \"PowerShell 3.0 eller nyere kreves for å kjøre dette skriptet.\"\r\nt MSG_146 \"Ønsker du å gå online og laste den ned?\"\r\nt MSG_148 \"Kjører nedlastingskript...\"\r\nt MSG_149 \"Last ned ISO-image\"\r\nt MSG_150 \"Datamaskin typen du planlegger å bruke denne oppstartbare stasjonen med. Det er ditt ansvar å avgjøre om målet ditt er av BIOS eller UEFI-typen før du begynner å lage stasjonen, da det kan mislykkes å starte opp ellers.\"\r\nt MSG_151 \"'UEFI-CSM' betyr at enheten bare starter opp i BIOS-emuleringsmodus (også kjent som 'Legacy Mode') under UEFI, og ikke i innebygde UEFI-modus.\"\r\nt MSG_152 \"'ikke-CSM' betyr at enheten bare starter opp i innebygde UEFI-modus, og ikke i BIOS-emuleringsmodus (også kjent som 'Legacy Mode').\"\r\nt MSG_153 \"Testmønster: 0x%02X\"\r\nt MSG_154 \"Testmønster: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Testmønster: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Testmønster: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Setter målfilsystemet\"\r\nt MSG_158 \"Minimum størrelse en datablokk vil okkupere i filsystemet\"\r\nt MSG_159 \"Bruk dette feltet for å lage disketikett.\\nInternasjonale bokstaver er tillatt.\"\r\nt MSG_160 \"Avanserte valg\"\r\nt MSG_161 \"Velg antall passeringer for å teste etter dårlige blokker, bruker forskjellige mønstre\"\r\nt MSG_162 \"Bruk \\\"langsom\\\" formateringsmetode ved å fjerne haken i denne ruten\"\r\nt MSG_163 \"Metoden som vil bli brukt for å lage partisjonene\"\r\nt MSG_164 \"Metoden som vil bli brukt for å gjøre stasjonen oppstartbar\"\r\nt MSG_165 \"Klikk for å velge et bilde...\"\r\nt MSG_166 \"Merk denne boksen for å tillate visning av internasjonal merkelapp og lage et stasjonsikon (lager en autorun.inf)\"\r\nt MSG_167 \"Installer en UEFI bootloader, som vil utføre MD5Sum-filvalidering av media\"\r\nt MSG_169 \"Opprett en ekstra skjult partisjon og forsøk å justere partisjonsgrenser.\\nDette kan gjøre det lettere å oppdage for eldre BIOSer.\"\r\nt MSG_170 \"Aktivere listen av USB-harddisk-kabinetter. BRUKES PÅ EGEN RISIKO!!!\"\r\nt MSG_171 \"Starter formateringsoperasjonen.\\nDette vil SLETTE data på målstasjonen!\"\r\nt MSG_172 \"Ugyldig nedlastings signatur\"\r\nt MSG_173 \"Klikk for å velge...\"\r\nt MSG_174 \"Rufus - Det pålitelige USB-formateringsprogrammet\"\r\nt MSG_175 \"Versjon %d.%d (Utgave %d)\"\r\nt MSG_176 \"Norsk oversettelse:\\\\line• JED <mailto:translator744@outlook.com>\\\\line• Thorbjørn Bruarøy <mailto:problemkontroll@gmail.com>\\\\line• Jakub Zieciak\"\r\nt MSG_177 \"Rapporter feil, og forespør forbedringer på:\"\r\nt MSG_178 \"Tilleggs Copyright:\"\r\nt MSG_179 \"Oppdateringspolitikk:\"\r\nt MSG_180 \"Hvis du ønsker å tillate at programmet skal sjekke for oppdateringer, du tillater da følgende informasjon å bli samlet inn til vår server(e):\"\r\nt MSG_181 \"Ditt operativsystems arkitektur og versjon\"\r\nt MSG_182 \"Versjon av programmet du bruker\"\r\nt MSG_183 \"Din IP-adresse\"\r\nt MSG_184 \"For muligheten å lage privat bruksstatistikk, vil vi lagre informasjonen for senere bruk, \\\\b for det meste opp mot ett år\\\\b0 . Men vi vil ikke frivillig avsløre noen av personens data til tredjepart.\"\r\nt MSG_185 \"Oppdateringsprosess:\"\r\nt MSG_186 \"Rufus vil ikke installere eller kjøre bakgrunnsprogrammer, derfor vil oppdateringskontrollen kun bli utført når hovedprogrammet kjører.\\\\line\\nInternett-tilgang er selvfølgelig påkrevd for å se etter oppdateringer.\"\r\nt MSG_187 \"Ugyldig bilde for valgt oppstartsløsning\"\r\nt MSG_188 \"Det nåværende bilde passer ikke det valgte oppstartsvalget. Vennligst velg et annet bilde, eller velg et annet oppstartsvalg.\"\r\nt MSG_189 \"Dette ISO-bildet er ikke kompatibelt med det valgte filsystemet\"\r\nt MSG_190 \"Ikke kompatibel stasjon oppdaget\"\r\nt MSG_191 \"Skriving\"\r\nt MSG_192 \"Lesing\"\r\nt MSG_193 \"Lastet ned %s\"\r\nt MSG_194 \"Kunne ikke laste ned %s\"\r\nt MSG_195 \"Bruker innebygget versjon av %s fil(er)\"\r\nt MSG_196 \"VIKTIGT: DENNE STASJONEN BRUKER IKKE STANDARD SEKTORSTØRRELSE!!\\n\\nKonvensjonelle stasjoner bruker en 512-byte sektorstørrelse, mens denne stasjonen bruker en %d-byte. I mange tilfeller betyr dette at du IKKE vil kunne starte fra denne stasjonen.\\nRufus kan fortsatt prøve å lage en oppstartbar stasjon, men det er INGEN GARANTI for at det vil fungere.\"\r\nt MSG_197 \"Ikke standard sektorstørrelse oppdaget\"\r\nt MSG_198 \"'Windows To Go' kan kun installeres på en GPT-partisjonert stasjon hvis den er FAST stasjonstype. Den aktuelle stasjonen ble ikke oppdaget som FAST.\"\r\nt MSG_199 \"Denne funksjonen er ikke tilgjengelig på denne plattformen.\"\r\nt MSG_201 \"Avbryter - Vennligst vent...\"\r\nt MSG_202 \"Skanner bilde...\"\r\nt MSG_203 \"Feilet i bildesøk\"\r\nt MSG_204 \"Foreldet %s oppdaget\"\r\nt MSG_205 \"Bruker bilde: %s\"\r\nt MSG_206 \"Mangler filen %s\"\r\nt MSG_207 \"Nytt volum\"\r\nt MSG_208 \"%d enhet funnet\"\r\nt MSG_209 \"%d enhet funnet\"\r\nt MSG_210 \"KLAR\"\r\nt MSG_211 \"Avbrutt\"\r\nt MSG_212 \"Feilet\"\r\nt MSG_213 \"Starter et nytt program...\"\r\nt MSG_214 \"Oppstart feilet\"\r\nt MSG_215 \"Åpnet %s\"\r\nt MSG_216 \"Lagret %s\"\r\nt MSG_217 \"Formatering: %s\"\r\nt MSG_218 \"Lager filsystem: Oppgave %d/%d fullført\"\r\nt MSG_219 \"NTFS opprettet: %d%% fullført\"\r\nt MSG_220 \"Formaterer (%s) - estimeret varighet %d:%02d...\"\r\nt MSG_221 \"Lager merkelapp (%s)...\"\r\nt MSG_222 \"Formaterer (%s)...\"\r\nt MSG_223 \"NTFS-retting (Checkdisk)...\"\r\nt MSG_224 \"Fjerner MBR/PBR/GPT-strukturer...\"\r\nt MSG_225 \"Ber om stasjonstilgang...\"\r\nt MSG_226 \"Analyserer oppstartsarkiver...\"\r\nt MSG_227 \"Lukker eksisterende volum...\"\r\nt MSG_228 \"Skriver til Master Boot Record...\"\r\nt MSG_229 \"Skriver til Partition Boot Record...\"\r\nt MSG_230 \"Kopierer DOS-filer...\"\r\nt MSG_231 \"Kopierer ISO-filer: %s\"\r\nt MSG_232 \"Win7 EFI oppstartsoppsett (%s)...\"\r\nt MSG_233 \"Ferdiggjør, vennligst vent...\"\r\nt MSG_234 \"Installerer Syslinux %s...\"\r\nt MSG_235 \"Dårlige blokker: %s %d/%d - %0.2f%% (%d/%d/%d feil)\"\r\nt MSG_236 \"Dårlige blokker: Tester tilfeldig mønster\"\r\nt MSG_237 \"Dårlige blokker: Tester med mønster 0x%02X\"\r\nt MSG_238 \"Partisjonerer (%s)...\"\r\nt MSG_239 \"Sletter partisjoner (%s)...\"\r\nt MSG_240 \"Signaturen for den nedlastede oppdateringen kan ikke valideres. Dette kan bety at systemet ditt er feil konfigurert for godkjenning av signatur eller angi en ondsinnet nedlasting.\\n\\nNedlastingen vil bli slettet. Vennligst sjekk loggen for mer informasjon.\"\r\nt MSG_241 \"Laster ned: %s\"\r\nt MSG_242 \"Nedlasting av fil feilet.\"\r\nt MSG_243 \"Sjekker for Rufus-oppdateringer...\"\r\nt MSG_244 \"Oppdateringer: Ikke mulig å koble til internett\"\r\nt MSG_245 \"Oppdateringer: Ikke mulig å sjekke versjonsdata\"\r\nt MSG_246 \"En ny versjon av Rufus er tilgjengelig!\"\r\nt MSG_247 \"Ingen ny versjon av Rufus er funnet\"\r\nt MSG_248 \"Programmets registernøkler er slettet\"\r\nt MSG_249 \"Sletting av registernøkler feilet\"\r\nt MSG_250 \"%s aktivert\"\r\nt MSG_251 \"%s deaktivert\"\r\nt MSG_252 \"Størrelse kontrollert\"\r\nt MSG_253 \"Harddisk-oppdagelse\"\r\nt MSG_254 \"Tvinger stor FAT32-formatering\"\r\nt MSG_255 \"NoDriveTypeAutorun vil bli oppdaget ved avsluttning\"\r\nt MSG_256 \"Falsk stasjon oppdaget\"\r\nt MSG_257 \"Joliet-støtte\"\r\nt MSG_258 \"Rock Ridge-støtte\"\r\nt MSG_259 \"Tvungen oppdatering\"\r\nt MSG_260 \"NTFS-pakking\"\r\nt MSG_261 \"Skriver bilde: %s\"\r\nt MSG_262 \"ISO-støtte\"\r\nt MSG_263 \"Bruk SKIKKELIG størrelsesenhet\"\r\nt MSG_264 \"Sletter mappe '%s'\"\r\nt MSG_265 \"VMWare-disk oppdagelse\"\r\nt MSG_266 \"Dobbel UEFI/BIOS-innstilling\"\r\nt MSG_267 \"Legger til Windows-bilde: %s\"\r\nt MSG_268 \"Legger til Windows-bilde...\"\r\nt MSG_269 \"Bevarer tidskode\"\r\nt MSG_270 \"USB-avkoding\"\r\nt MSG_271 \"Regner ut bilde-sjekksummer: %s\"\r\nt MSG_272 \"Regner ut MD5, SHA1 og SHA256-sjekksummer for det valgte bilde\"\r\nt MSG_273 \"Bytt programspråk\"\r\nt MSG_274 \"%s-bilde oppdaget\"\r\nt MSG_275 \"Bildet du har valgt er et 'ISOHybrid'-bilde. Dette betyr det enten kan bli skrevet i %s (filkopi) -modus eller %s (bildefil) -modus.\\nRufus anbefaler å bruke %s -modus, slik at du har full tilgang til stasjonen etter at du har skrevet til den.\\nHvis du skulle få problemer under oppstart, kan du prøve å skrive bildet igjen i %s -modus.\\n\\nVennligst velg modus du ønsker å skrive dette bildet i:\"\r\nt MSG_276 \"Skriv i %s -modus (anbefalt)\"\r\nt MSG_277 \"Skriv i %s -modus\"\r\nt MSG_278 \"Sjekker for motstridende prosesser...\"\r\nt MSG_279 \"Ikke oppstartbar\"\r\nt MSG_280 \"Disk eller ISO bilde\"\r\nt MSG_281 \"%s (Vennligst velg)\"\r\nt MSG_282 \"Utelat USB stasjonslås\"\r\nt MSG_283 \"Ugyldig signatur\"\r\nt MSG_284 \"Den nedlastede programfil mangler en digital signatur.\"\r\nt MSG_285 \"Den nedlastede programfil er signert av '%s'.\\nDette er en signatur vi ikke gjenkjenner, og kan indikere en form for skadelig aktivitet...\\nEr du sikker på at du vil kjøre denne filen?\"\r\nt MSG_286 \"Skriver 0-er til disken: %s\"\r\nt MSG_287 \"Oppdagelse av ikke-USB flyttbare disker\"\r\nt MSG_288 \"Mangler utvidede rettigheter\"\r\nt MSG_289 \"Dette programmet kan bare kjøre med utvidede rettigheter\"\r\nt MSG_290 \"Filindeksering\"\r\nt MSG_291 \"Versjonsvalg\"\r\nt MSG_292 \"Vennligst velg den versjonen av Windows du ønsker å installere:\"\r\nt MSG_293 \"Ikke støttet Windows-versjon\"\r\nt MSG_294 \"Denne versjonen av Windows er ikke støttet av Rufus lengre.\\nDen siste versjonen av Rufus som er kompatibel med denne plattformen er v%d.%d.\"\r\nt MSG_295 \"Advarsel: Uoffisiell versjon\"\r\nt MSG_296 \"Denne versjonen av Rufus er IKKE laget av dens offisielle utvikler(e).\\n\\nEr du sikker på at du vil kjøre programmet?\"\r\nt MSG_297 \"Forkortet ISO oppdaget\"\r\nt MSG_298 \"ISO-filen du har valgt, stemmer ikke overens med den deklarerte størrelsen: %s av dataene mangler!\\n\\nHvis du har lastet ned denne filen fra internett, bør du prøve å laste ned en ny kopi, og verifisere at MD5- eller SHA-kontrollsummen samsvarer med de offisielle.\\n\\nLegg merke til at du kan beregne MD5 eller SHA i Rufus ved å klikke på (✓)-knappen.\"\r\nt MSG_299 \"Tidspunkt bekreftelses feil\"\r\nt MSG_300 \"Rufus kunne ikke bekrefte at tidspunktet av den nedlastede oppdateringen er nyere enn den nåværende startede.\\n\\nFor å forhindre potensielle angrepsscenarier, har oppdateringsprosessen blitt avbrutt og nedlastingen vil bli slettet. Vennligst sjekk loggen for mer informasjon.\"\r\nt MSG_301 \"Vis programinnstillinger\"\r\nt MSG_302 \"Vis informasjon om denne applikasjonen\"\r\nt MSG_303 \"Vis loggen\"\r\nt MSG_304 \"Opprett et diskbilde av den valgte enheten\"\r\nt MSG_305 \"Bruk dette alternativet for å angi om du vil bruke denne enheten til å installere Windows på en annen disk, eller hvis du vil kjøre Windows direkte fra denne stasjonen (Windows To Go).\"\r\nt MSG_306 \"Hurtig nullstilling av disken: %s\"\r\nt MSG_307 \"dette kan ta litt tid\"\r\nt MSG_308 \"VHD deteksjon\"\r\nt MSG_309 \"Komprimert arkiv\"\r\nt MSG_310 \"ISO du har valgt bruker UEFI og er liten nok til å bli skrevet som en EFI System Partition (ESP). Å skrive til en ESP, i stedet for å skrive til en generisk datapartisjon som okkuperer hele disken, kan være å foretrekke for noen typer installasjoner.\\n\\nVennligst velg modusen du vil bruke til å skrive dette bildet:\"\r\nt MSG_311 \"Bruk %s i hoved applikasjonsvinduet til å slå på.\"\r\nt MSG_312 \"Ekstra hashes (SHA512)\"\r\nt MSG_313 \"Lagre til VHD\"\r\nt MSG_314 \"Beregn bildetskontrollsummen\"\r\nt MSG_315 \"Flere knapper\"\r\nt MSG_316 \"Antall pasninger\"\r\nt MSG_318 \"Standard trådprioritet: %d\"\r\nt MSG_319 \"Ignorer oppstartsmarkør\"\r\nt MSG_320 \"Forfriskende partisjonsoppsett (%s)...\"\r\nt MSG_321 \"Bildet du har valgt er en ISOHybrid, men skaperne har ikke gjort det kompatibelt med ISO / File copy modus.\\nSom et resultat vil DD-skrivemodus bli håndhevet.\"\r\nt MSG_322 \"Kan ikke åpne eller lese '%s'\"\r\nt MSG_325 \"Utfører tilpasning av Windows: %s\"\r\nt MSG_326 \"Aktiverer brukertilpasninger...\"\r\nt MSG_327 \"Windows brukeropplevelse\"\r\nt MSG_328 \"Tilpasse Windows installasjonen?\"\r\nt MSG_329 \"Fjern krav om 4GB+ RAM, Secure Boot og TPM 2.0\"\r\nt MSG_330 \"Fjern krav om en Microsoft konto\"\r\nt MSG_331 \"Slå av all datainnsamling (hopp over spørsmålene)\"\r\nt MSG_332 \"Ikke gi Windows To Go tilgang til interne harddisker\"\r\nt MSG_333 \"Lag en lokal brukerkonto med brukernavnet:\"\r\nt MSG_334 \"Sett regionale innstillinger til det samme som den aktive brukerkontoen\"\r\nt MSG_335 \"Deaktiver BitLocker kryptering av enheten\"\r\nt MSG_336 \"Behold log\"\r\nt MSG_337 \"En ekstra fil ('%s') må lastes ned fra Microsoft for å bruke denne funksjonen:\\n- Velg 'Ja' for å koble til Internett og laste den ned\\n- Velg 'Nei' for å avbryte operasjonen\\n\\nMerk: Filen vil bli lastet ned i programmets katalog og vil automatisk bli gjenbrukt hvis den er tilstede.\"\r\nt MSG_338 \"Opphevet UEFI bootloader oppdaget\"\r\nt MSG_339 \"Rufus oppdaget at ISO-en du har valgt inneholder en UEFI-oppstartslaster som har blitt tilbakekalt og som vil produsere %s, når sikker oppstart er aktivert på et fullstendig oppdatert UEFI-system.\\n\\n- Hvis du har fått dette ISO-bildet fra en ikke-anerkjent kilde, bør du vurdere muligheten for at det kan inneholde UEFI-malware og unngå å starte opp fra det.\\n- Hvis du har fått det fra en pålitelig kilde, bør du prøve å finne en mer oppdatert versjon, som ikke vil gi denne advarselen.\"\r\nt MSG_340 \"en \\\"Sikkerhetsbrudd\\\"-skjerm\"\r\nt MSG_341 \"en Windows-gjenopprettingsskjerm (BSOD) med '%s'\"\r\nt MSG_342 \"Komprimert VHDX-imaget\"\r\nt MSG_343 \"Ukomprimert VHD-imaget\"\r\nt MSG_345 \"Noen tilleggsdata må lastes ned fra Microsoft for å bruke denne funksjonaliteten:\\n- Velg \\\"Ja\\\" for å koble til Internett og laste den ned\\n- Velg 'Nei' for å avbryte operasjonen\"\r\nt MSG_346 \"Begrens Windows til S-modus (INKOMPATIBEL med online kontoomgåelse)\"\r\nt MSG_347 \"Ekspert modus\"\r\nt MSG_348 \"Pakker ut arkivfiler: %s\"\r\nt MSG_349 \"Bruk Rufus MBR\"\r\nt MSG_900 \"Rufus er et verktøy som hjelper til med å formatere og lage oppstartbare USB-stasjoner, for eksempel USB-minnepinner, USB-harddisker, og lignende.\"\r\nt MSG_901 \"Offisiell webside: %s\"\r\nt MSG_902 \"Kildekode: %s\"\r\nt MSG_903 \"Endringslogg: %s\"\r\nt MSG_904 \"Dette programmet er lisensiert under GNU Public Licence (GPL) versjon 3.\\nSe https://www.gnu.org/licenses/gpl-3.0.html for mer informasjon.\"\r\nt MSG_905 \"Oppstart\"\r\nt MSG_910 \"Formater USB, minnekort og virtuelle disker til FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Lag FreeDos oppstartbar USB stick\"\r\nt MSG_912 \"Lag oppstartabar enhet/disk fra ISOer (Windows, Linux, etc.)\"\r\nt MSG_913 \"Lag oppstartbare disker fra images, inkludert komprimerte sådan\"\r\nt MSG_914 \"Lag BIOS eller UEFI oppstartbare disker, inkludert UEFI oppstartbar NTFS\"\r\nt MSG_915 \"Lag 'Windows To Go' disker\"\r\nt MSG_916 \"Lag oppstartsmedia for Windows 11 som ikke krever TPM eller Secure Boot\"\r\nt MSG_917 \"Lag persistente Linux partisjoner\"\r\nt MSG_918 \"Lag VHD/DD speilinger av valgt disk\"\r\nt MSG_919 \"Kalkuler MD5, SHA-1, SHA-256 og SHA-512 sjekksummer fra valgt speiling\"\r\nt MSG_920 \"Utfør sjekk for dårlige sektorer, inkludert sjekk for forfalskede flash disker\"\r\nt MSG_921 \"Last ned offisielle Windows ISOer\"\r\nt MSG_922 \"Last ned UEFI kommandolinje ISOer\"\r\n\r\n#########################################################################\r\nl \"fa-IR\" \"Persian (پارسی)\" 0x0429\r\nv 4.5\r\nb \"en-US\"\r\na \"r\"\r\n\r\ng IDD_ABOUTBOX\r\n# To make the output look correct, there are two invisible Unicode directional formatting characters in the line below.\r\n# • RLE (right-to-left embedding, UTF-8: 0xE2 0x80 0xAB) at the beginning of the string\r\n# • PDF (pop directional formatting, UTF-8: 0xE2 0x80 0xAC) at the end of the string\r\nt IDD_ABOUTBOX \"‫درباره Rufus‬\"\r\nt IDC_ABOUT_LICENSE \"پروانه نرم‌افزار (License)\"\r\nt IDOK \"بستن\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"مشخصات درایو\"\r\nt IDS_DEVICE_TXT \"درایو USB (حافظه فلش یا سایر ابزارهای ذخیره‌سازی قابل‌حمل)\"\r\nt IDS_BOOT_SELECTION_TXT \"نوع راه‌اندازی (Boot)\"\r\nt IDC_SELECT \"انتخاب\"\r\nt IDS_IMAGE_OPTION_TXT \"تنظیمات ایمیج\"\r\nt IDS_PARTITION_TYPE_TXT \"نوع پارتیشن\"\r\nt IDS_TARGET_SYSTEM_TXT \"سیستم موردنظر\"\r\nt IDC_LIST_USB_HDD \"نمایش هارد دیسک‌های اکسترنال در فهرست درایوهای USB موجود\"\r\nt IDC_OLD_BIOS_FIXES \"بهسازی و اصلاح تنظیمات برای شناسایی بهتر درایو در BIOSهای قدیمی\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"فغال سازی زمان اجرا UEFI media  تایید\"\r\nt IDS_FORMAT_OPTIONS_TXT \"گزینه‌ها و تنظیمات\"\r\nt IDS_FILE_SYSTEM_TXT \"سیستم فایل\"\r\nt IDS_CLUSTER_SIZE_TXT \"اندازه کلاستر\"\r\nt IDS_LABEL_TXT \"نام دلخواه برای درایو USB\"\r\nt IDC_QUICK_FORMAT \"فرمت کردن سریع (Quick format)\"\r\nt IDC_BAD_BLOCKS \"بررسی وجود بدسکتور در درایو به روشِ\"\r\nt IDC_EXTENDED_LABEL \"ایجاد آیکون و نام‌گذاری درایو USB با استفاده از فایل autorun.inf\"\r\nt IDS_STATUS_TXT \"وضعیت\"\r\nt IDCANCEL \"خروج\"\r\nt IDC_START \"شروع\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"خروج\"\r\n# To make the output look correct, there are two invisible Unicode directional formatting characters in the line below.\r\n# • RLE (right-to-left embedding, UTF-8: 0xE2 0x80 0xAB) at the beginning of the string\r\n# • PDF (pop directional formatting, UTF-8: 0xE2 0x80 0xAC) at the end of the string\r\nt IDD_LICENSE \"‫پروانه نرم‌افزار Rufus‬\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"خروج\"\r\n# 'RLE' & 'PDF' are used\r\nt IDD_LOG \"‫گزارش‌های ثبت‌شده (Log)‬\"\r\nt IDC_LOG_CLEAR \"پاک کردن\"\r\nt IDC_LOG_SAVE \"ذخیره\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"خروج\"\r\nt IDD_NEW_VERSION \"Rufus بررسی آپدیت‌های جدید و به‌روزرسانی نرم‌افزار\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"نسخه جدیدی از نرم‌افزار موجود است. لطفاً آخرین نسخه نرم‌افزار را دانلود کنید!\"\r\nt IDC_WEBSITE \"برای رفتن به سایت نرم‌افزار، کلیک کنید\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"یادداشت‌های انتشار نسخه جدید (Release Notes)\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"دانلود\"\r\nt IDC_DOWNLOAD \"دانلود\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"اطلاعات بیشتر\"\r\nt IDYES \"بله\"\r\nt IDNO \"خیر\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"خروج\"\r\nt IDD_UPDATE_POLICY \"سیاست و تنظیمات به‌روزرسانی نرم‌افزار\"\r\nt IDS_UPDATE_SETTINGS_GRP \"تنظیمات\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"بررسی آپدیت‌های جدید\"\r\nt IDS_INCLUDE_BETAS_TXT \"شامل نسخه‌های آزمایشی (Beta)\"\r\nt IDC_CHECK_NOW \"همین الآن بررسی کن\"\r\n\r\nt MSG_001 \"شناسایی نمونه دیگری از نرم‌افزار\"\r\nt MSG_002 \"نمونه دیگری از نرم‌افزار Rufus در حال اجراست.\\nامکان اجرای همزمان دو نمونه از نرم‌افزار وجود ندارد. لطفاً قبل از باز کردن نرم‌افزار جدید، نمونه قبلی در حال اجرا را ببندید.\"\r\n# To make the output look correct, in the line below there are LRE & PDF invisible Unicode directional formatting characters.\r\n# Position: (LRE) At the beginning and (PDF) at the end of %s.\r\nt MSG_003 \"هشدار:تمام داده‌ها و اطلاعات موجود در درایو '‪%s‬' پاک خواهد شد.\\nآیا برای ادامه این عملیات مطمئن هستید.\"\r\nt MSG_004 \"سیاست به‌روزرسانی نرم‌افزار\"\r\nt MSG_005 \"آیا برای بررسی آپدیت جدید و به‌روزرسانی نرم‌افزار، به Rufus اجازه اتصال به اینترنت را می‌دهید؟\"\r\nt MSG_006 \"خروج\"\r\nt MSG_007 \"لغو\"\r\nt MSG_008 \"بله\"\r\nt MSG_009 \"خیر\"\r\nt MSG_010 \"تعدادی بدسکتور پیدا شده است\"\r\nt MSG_011 \"بررسی انجام شد. تعداد بدسکتور(های) پیدا شده: %d\\n  خطا(های) خواندن: %d\\n  خطا(های) نوشتن: %d\\n  خطا(های) خرابی (corruption) داده‌ها: %d\"\r\nt MSG_012 \"%s\\n گزارش با جزئیات بیشتر را می‌توانید در فایل زیر مشاهده کنید.\\n%s\"\r\nt MSG_013 \"غیرفعال\"\r\nt MSG_014 \"روزانه\"\r\nt MSG_015 \"هفتگی\"\r\nt MSG_016 \"ماهانه\"\r\nt MSG_017 \"سفارشی\"\r\n# 'LRE' & 'PDF' are used\r\nt MSG_018 \"نسخه کنونی نرم‌افزار شما: ‪%d.%d (Build %d)\"\r\n# 'LRE' & 'PDF' are used\r\nt MSG_019 \"آخرین نسخه موجود: ‪%d.%d (Build %d)\"\r\nt MSG_027 \"کیلوبایت\"\r\nt MSG_028 \"مگابایت\"\r\nt MSG_029 \"پیش‌فرض\"\r\nt MSG_030 \"%s (پیش‌فرض)\"\r\nt MSG_031 \"BIOS (یا UEFI-CSM)\"\r\nt MSG_032 \"UEFI (بجز CSM)\"\r\nt MSG_033 \"BIOS یا UEFI\"\r\nt MSG_034 \"%d گذره\"\r\nt MSG_035 \"%d گذره %s\"\r\nt MSG_036 \"ایمیج ISO\"\r\nt MSG_037 \"برنامه\"\r\nt MSG_038 \"لغو\"\r\nt MSG_039 \"اجرا\"\r\nt MSG_040 \"دانلود\"\r\nt MSG_041 \"کاربر ادامه فرآیند را لغو کرد\"\r\nt MSG_042 \"خطا\"\r\nt MSG_043 \"خطا: %s\"\r\nt MSG_044 \"دانلود فایل\"\r\nt MSG_046 \"%s (هارد %d) [%s]\"\r\nt MSG_047 \"درایو بیش از یک پارتیشن دارد\"\r\nt MSG_048 \"Rufus - در حال تخلیه میان‌گیر (بافر)\"\r\nt MSG_049 \"Rufus - در حال لغو کردن\"\r\nt MSG_050 \"موفق بود.\"\r\nt MSG_051 \"برخورد با خطای نامشخص، هنگام فرمت کردن.\"\r\nt MSG_052 \"برای این ابزار ذخیره‌سازی نمی‌توان از سیستم فایل انتخاب‌شده استفاده کرد.\"\r\nt MSG_053 \"اجازه دسترسی به درایو انتخاب‌شده وجود ندارد.\"\r\nt MSG_054 \"درایو انتخاب‌شده نسبت به «نوشتن» محافظت شده است (Write Protected).\"\r\nt MSG_055 \"برنامه یا فرآیند (Process) دیگری در حال استفاده از درایو انتخاب‌شده است.لطفاً سایر برنامه‌هایی را که در حال استفاده کردن از درایو موردنظر هستند؛ ببندید.\"\r\nt MSG_056 \"برای درایو انتخاب‌شده، امکان «فرمت کردن سریع» وجود ندارد.\"\r\nt MSG_057 \"نام انتخاب‌شده برای درایو، نامعتبر است. لطفاً نام دیگری را انتخاب کنید.\"\r\nt MSG_058 \"دستگیره (handle) نرم‌افزاری درایو موردنظر نامعتبر است.\"\r\nt MSG_059 \"برای درایو موردنظر اندازه کلاستری که انتخاب کرده‌اید نامعتبر است. لطفاً اندازه دیگری را انتخاب کنید.\"\r\nt MSG_060 \"اندازه فضای ذخیره‌سازی درایو موردنظر نامعتبر است.\"\r\nt MSG_061 \"لطفاً در درایو USB، یک ابزار ذخیره‌سازی قابل‌حمل وارد کنید.\"\r\nt MSG_062 \"فرمان غیرقابل پشتیبانی و نامشخصی دریافت شد.\"\r\nt MSG_063 \"خطا در تخصیص حافظه (Memory Allocation)\"\r\nt MSG_064 \"خطا در خواندن.\"\r\nt MSG_065 \"خطا در نوشتن.\"\r\nt MSG_066 \"فرآیند نصب ناموفق بود\"\r\nt MSG_067 \"نرم‌افزار نتوانست درایو موردنظر را باز کند. ممکن است برنامه یا فرآیند دیگری در حال استفاده از این درایو باشد.\\nلطفاً وسیله موردنظر را از درگاه USB بیرون بیاورید و سپس دوباره آن را متصل و امتحان کنید.\"\r\nt MSG_068 \"خطا در هنگام پارتیشن‌بندی درایو.\"\r\nt MSG_069 \"نمی‌توان فایل‌ها را در درایو موردنظر کپی کرد.\"\r\nt MSG_070 \"کاربر ادامه فرآیند را لغو کرد.\"\r\nt MSG_071 \"نرم‌افزار نتوانست ریسه (Thread) را اجرا کند.\"\r\nt MSG_072 \"بررسی بدسکتورها کامل انجام نشد.\"\r\nt MSG_073 \"بررسی اطلاعات موجود در فایل ISO ناموفق بود.\"\r\nt MSG_074 \"استخراج (Extraction) اطلاعات موجود در فایل ISO ناموفق بود.\"\r\nt MSG_075 \"اتصال دوباره و سوار کردن (Mount) درایو ناموفق بود.\"\r\nt MSG_076 \"نصب فایل‌های موردنیاز برای راه‌اندازی (Boot) سیستم‌عامل ناموفق بود.\"\r\nt MSG_077 \"اختصاص حروف الفبا به درایو موردنظر ناموفق بود.\"\r\nt MSG_078 \"امکان وصل و سوار کردن (Mount) فضای ذخیره‌سازی GUID وجود ندارد.\"\r\nt MSG_079 \"درایو موردنظر هنوز آماده استفاده کردن نیست.\"\r\nt MSG_080 \"ویندوز در حال تخلیه اطلاعات و میان‌گیر (بافر) خود در درایو USB موردنظر است.\\n\\nبا توجه به سرعت درایو USB، این فرآیند ممکن است کمی زمان‌بر باشد (به‌ویژه برای فایل‌های بزرگ).\\n\\nبرای جلوگیری از خرابی فایل‌ها، بهتر است اجازه دهید ویندوز کار خود را کامل کند.اما اگر از صبر کردن خسته شده‌اید؛ می‌توانید وسیله موردنظر را از درگاه USB بیرون بیاورید.\"\r\nt MSG_081 \"فایل ایمیج انتخاب‌شده پشتیبانی نمی‌شود\"\r\nt MSG_082 \"فایل ایمیج (Image) انتخاب‌شده، قابلیت راه‌اندازی سیستم‌عامل را ندارد (none-bootable) یا ساختاری دارد که Rufus آن را پشتیبانی نمی‌کند.\"\r\nt MSG_083 \"%s جایگزین شود؟\"\r\nt MSG_084 \"انگار این فایل ISO از نسخه قدیمی «%s» استفاده می‌کند.\\nبه همین دلیل، ممکن است منوی راه‌اندازی (Boot Menu) به‌درستی نمایش داده نشود.\\n\\nبرای از بین بردن این مشکل، Rufus می‌تواند نسخه جدید آن را دانلود کند.\\n-برای اتصال به اینترنت و دانلود این فایل «بله» را انتخاب کنید\\n-اگر نمی‌خواهید این فایل را دانلود کنید، «خیر» را انتخاب کنید.\\n\\nنکته: این فایل در پوشه نرم‌افزار دانلود می‌شود و در دفعات بعد به‌صورت خودکار از آن استفاده خواهد شد.\"\r\nt MSG_085 \"در حال دانلود کردن %s\"\r\nt MSG_086 \"فایل ایمیج انتخاب نشده است\"\r\nt MSG_087 \"برای نوع %s\"\r\nt MSG_088 \"فایل ایمیج بیش از اندازه بزرگ است\"\r\nt MSG_089 \"اندازه فایل ایمیج (Image) از ظرفیت درایو انتخاب‌شده بیشتر است.\"\r\nt MSG_090 \"خطا در انتخاب فایل ISO\"\r\nt MSG_091 \"هنگامی‌که نوع UEFI را انتخاب می‌کنید؛ فقط می‌توانید از فایل‌های ISO با قابلیت راه‌اندازی EFI (EFI Bootable) استفاده کنید. لطفاً از یک فایل ISO با قابلیت راه‌اندازی EFI استفاده کنید یا در گزینه‌ها نوع BIOS را انتخاب کنید.\"\r\nt MSG_092 \"سیستم فایل پشتیبانی نمی‌شود\"\r\nt MSG_093 \"هشدار مهم! درایو انتخاب‌شده چندین پارتیشن دارد.\\n\\nممکن است این پارتیشن‌ها پنهان باشند و شما آن‌ها را در فهرست ویندوز نبینید. اگر می‌خواهید ادامه دهید، مسئولیت هرگونه پاک شدن اطلاعات در این پارتیشن‌ها به عهده خود شما است.\"\r\nt MSG_094 \"چندین پارتیشن شناسایی شده است\"\r\nt MSG_095 \"ایمیج DD\"\r\nt MSG_096 \"سیستم فایلی را که انتخاب کرده‌اید  با این نوع از فایل ISO نمی‌توان استفاده کرد. لطفاً سیستم فایل یا فایل ISO دیگری را انتخاب کنید.\"\r\nt MSG_097 \"«%s» فقط زمانی قابل استفاده است که سیستم فایل انتخاب‌شده NTFS باشد.\"\r\nt MSG_098 \"هشدار مهم! شما گزینه «Windows To Go» را انتخاب کرده‌اید اما درایو موردنظر شما فاقد ویژگی «FIXED» است. به همین دلیل هنگام راه‌اندازی سیستم‌عامل (Boot) با استفاده از این درایو به احتمال زیاد اجرای ویندوز متوقف می‌شود. چون‌که مایکروسافت این امکان را برای درایوهایی که ویژگی «REMOVABLE» دارند، طراحی نکرده است.\\n\\nآیا می‌خواهید این کار را ادامه دهید؟\\n\\nنکته: ویژگی‌های «FIXED» و «REMOVABLE» خاصیت سخت‌افزاری هستند و فقط شرکت‌های سازنده درایو با ابزارهای مخصوصی می‌توانند آن‌ها را تغییر دهند. این ابزارها تقریباً هیچ‌وقت در اختیار عموم مردم قرار نمی‌گیرد.\"\r\nt MSG_099 \"محدودیت در سیستم فایل\"\r\nt MSG_100 \"ایمیج (Image) انتخاب‌شده فایلی بزرگ‌تر از ۴ گیگابایت دارد. این مقدار از حداکثر اندازه مجاز برای سیستم فایل FAT و FAT32 بیشتر است.\"\r\nt MSG_101 \"استخراج اطلاعات فایل WIM پشتیبانی نمی‌شود\"\r\nt MSG_102 \"سیستم‌عامل شما نمی‌تواند اطلاعات فایل‌های WIM را از حالت فشرده خارج کند. استخراج اطلاعات موجود در این نوع از فایل‌ها، برای ساختن درایو USB «ویندوز ویستا» و «ویندوز ۷» با قابلیت راه‌اندازی EFI لازم است. شما می‌توانید با نصب کردن نرم‌افزار 7-Zip این مشکل را حل کنید.\\nآیا می‌خواهید وارد سایت دانلود نرم‌افزار 7-Zip شوید؟\"\r\nt MSG_103 \"%s دانلود شود؟\"\r\nt MSG_104 \"%s یا نسخه‌های بعدی آن، نیازمند فایل %s است.\\nچون اندازه این فایل از ۱۰۰ کیلوبایت بیشتر است و معمولاً در ایمیج‌های %s موجود است؛ این فایل به همراه نرم‌افزار Rufus عرضه نشده است.\\n\\nRufus می‌تواند این فایل را از اینترنت دانلود کند.\\n-برای اتصال به اینترنت و دانلود این فایل «بله» را انتخاب کنید\\n-اگر می‌خواهید بعداً خودتان این فایل را در درایو موردنظر کپی کنید؛ «خیر» را انتخاب کنید\\n\\nنکته: این فایل در پوشه نرم‌افزار دانلود می‌شود و در دفعات بعد به‌صورت خودکار از آن استفاده خواهد شد.\"\r\nt MSG_105 \"لغو این فرآیند ممکن است درایو موردنظر را در وضعیت غیرقابل استفاده (UNUSABLE) قرار دهد.\\nآیا مطمئن هستید که می‌خواهید این فرآیند را لغو کنید.\"\r\nt MSG_106 \"لطفاً یک پوشه انتخاب کنید\"\r\nt MSG_107 \"همه فایل‌ها\"\r\nt MSG_108 \"گزارش Rufus\"\r\nt MSG_109 \"0x%02X (دیسک %d)\"\r\nt MSG_110 \"MS-DOS با استفاده از درایوی که اندازه کلاستر آن ۶۴ کیلوبایت است؛ راه‌اندازی (Boot) نمی‌شود.\\nلطفاً اندازه کلاستر را تغییر دهید یا از FreeDOS استفاده کنید.\"\r\nt MSG_111 \"اندازه کلاستر ناسازگار و نامناسب است\"\r\nt MSG_112 \"معمولاً فرمت کردن درایو UDF حجیم و بزرگ زمان‌بر است. زمان تخمینی با استفاده از درگاه USB 2.0 «%d:%02d» است. ممکن است هنگام فرمت کردن، نوار لغزنده‌ای که پیشرفت فرآیند را نشان می‌دهد بی‌حرکت و ثابت شود.\\nپس لطفاً صبور باشید!\"\r\nt MSG_113 \"درایو UDF حجیم\"\r\nt MSG_114 \"این ایمیج (Image) از «Syslinux %s%s» استفاده می‌کند؛ اما نرم‌افزار Rufus فقط تنظیمات و فایل‌های نصب «Syslinux %s%s» را به همراه دارد. از آنجا که نسخه‌های مختلف Syslinux با یکدیگر سازگار نیستند و امکان قرار دادن همه آن‌ها در نرم‌افزار Rufus وجود ندارد؛ Rufus باید دو فایل «ldlinux.sys» و «ldlinux.bss» را از اینترنت دانلود کند.\\n-برای اتصال به اینترنت و دانلود این فایل‌ها «بله» را انتخاب کنید\\n-اگر از ادامه این فرآیند منصرف شده‌اید، «خیر» را انتخاب کنید.\\n\\nنکته: این فایل‌ها در پوشه نرم‌افزار دانلود می‌شود و در دفعات بعد به‌صورت خودکار از آن‌ها استفاده خواهد شد.\"\r\nt MSG_115 \"دانلود چند فایل لازم است\"\r\nt MSG_116 \"این ایمیج (Image) از «Grub %s» استفاده می‌کند؛ اما نرم‌افزار Rufus فقط تنظیمات و فایل‌های نصب «Grub %s» را به همراه دارد. از آنجا که نسخه‌های مختلف Grub ممکن است با یکدیگر سازگار نباشند و امکان قرار دادن همه آن‌ها در نرم‌افزار Rufus وجود ندارد؛ Rufus تلاش می‌کند فایل نصب «core.img» مناسب ایمیج شما را در اینترنت پیدا کند.\\n\\ninstallation file ('core.img') that matches the one from your image:\\n-برای اتصال به اینترنت و تلاش برای دانلود این فایل «بله» را انتخاب کنید\\n-اگر می‌خواهید از فایل کنونی و پیش‌فرض Rufus استفاده کنید «خیر» را انتخاب کنید\\n-اگر از ادامه این فرآیند منصرف شده‌اید، «لغو» را انتخاب کنید.\\n\\nنکته: این فایل در پوشه نرم‌افزار دانلود می‌شود و در دفعات بعد به‌صورت خودکار از آن استفاده خواهد شد. اگر فایل مناسبی در اینترنت پیدا نشود، نرم‌افزار از نسخه پیش‌فرض استفاده خواهد کرد.\"\r\nt MSG_117 \"نصب ویندوز به روش استاندارد و رایج\"\r\nt MSG_119 \"تنظیمات پیشرفته درایو\"\r\nt MSG_120 \"تنظیمات پیشرفته فرمت\"\r\nt MSG_121 \"نمایش دادن %s\"\r\nt MSG_122 \"پنهان کردن %s\"\r\nt MSG_123 \"اندازه پارتیشن پایدار ذخیره‌سازی اطلاعات\"\r\nt MSG_124 \"غیرفعال\"\r\nt MSG_125 \"برای ایجاد live USB با قابلیت ذخیره‌سازی اطلاعات، اندازه پارتیشن پایدار را تعیین کنید. در این حالت، اطلاعات با راه‌اندازی مجدد (ریست) از بین نخواهد رفت. برای غیرفعال کردن عدد صفر (۰) را وارد کنید.\"\r\nt MSG_126 \"واحد اندازه‌گیری پارتیشن را تعیین کنید.\"\r\nt MSG_127 \"این پیام را دیگر نمایش نده\"\r\nt MSG_128 \"نکته مهم درباره %s\"\r\nt MSG_129 \"شما درایو UEFI:NTFS ایجاد کردید. لطفا به یاد داشته باشید که برای راه‌اندازی (boot) این درایو، حتما باید راه‌اندازی امن (secure boot) را غیرفعال کنید.\\nبرای جزئیات بیشتر در مورد این که چرا این کار لازم است، دکمه \\\"اطلاعات بیشتر\\\" را در زیر ببینید.\"\r\nt MSG_130 \"انتخاب ایمیج (Image) ویندوز\"\r\nt MSG_131 \"این فایل ISO چند ایمیج (Image) مختلف ویندوز دارد.\\nلطفا ایمیجی که می‌خواهید نصب کنید را انتخاب کنید:\"\r\nt MSG_132 \"برنامه دیگری در حال استفاده از این درایو است. آیا می‌خواهید در هر صورت این درایو را فرمت کنید؟\"\r\nt MSG_133 \"Rufus تشخیص داده است که شما می‌خواهید با ISO ورژن 1809 درایوی با قابلیت «Windows To Go»  ایجاد کنید.\\nبه دلیل باگی که شرکت مایکروسافت در این مورد دارد؛  در هنگام راه‌اندازی ویندوز به خطای «Blue Screen Of Death» خواهید خورد. برای رفع این مشکل می‌توانید فایل 'WppRecorder.sys' را با ورژن 1803 جایگزین کنید.\\nهمچنین در نظر داشته باشید به دلیل اینکه کپی‌رایت فایل 'WppRecorder.sys' برای مایکروسافت است؛ Rufus نمی‌تواند به صورت خودکار این مشکل را برای شما برطرف کند و این فایل را در برنامه خود قرار دهد.\"\r\nt MSG_134 \"چون MBR برای ساختار پارتیشن انتخاب شده است؛ Rufus تنها می‌تواند پارتیشن با حداکثر ظرفیت 2TB روی این دیسک ایجاد کند. بنابراین %s از ظرفیت دیسک در دسترس نخواهد بود.\\nآیا برای ادامه این عملیات مطمئن هستید؟\"\r\nt MSG_135 \"نسخه\"\r\nt MSG_136 \"انتشار\"\r\nt MSG_137 \"ویرایش\"\r\nt MSG_138 \"زبان\"\r\nt MSG_139 \"معماری\"\r\nt MSG_140 \"ادامه\"\r\nt MSG_141 \"بازگشت\"\r\nt MSG_142 \"لطفاً صبور باشید...\"\r\nt MSG_143 \"دانلود با استفاده از مرورگر\"\r\nt MSG_144 \"به دلیل درخواست‌های دانلود خیلی زیاد؛ به طور موقت از طرف مایکروسافت بسته شد. لطفا بعدا دوباره امتحان کنید...\"\r\nt MSG_145 \"اجرای این اسکریپت به PowerShell 3.0 یا بالاتر نیاز دارد.\"\r\nt MSG_146 \"آیا می‌خواهید به اینترنت متصل شده و آن را دانلود کنید؟\"\r\nt MSG_148 \"در حال اجرای اسکرپیت دانلود...\"\r\nt MSG_149 \"دانلود ایمیج ISO\"\r\nt MSG_150 \"نوع کامپیوتری که می‌خواهید درایو USB ساخته‌شده را در آن استفاده کنید. شما می‌بایست قبل از ساختن درایو نوع راه‌اندازی کامپیوتر مقصد را شناسایی و مشخص کنید که از نوع BIOS است یا UEFI. اگرنه ممکن است با استفاده از این درایو نتوانید سیستم مورد نظر را راه‌اندازی کنید.\"\r\nt MSG_151 \"'UEFI-CSM' به این معنی است که این دستگاه بجای راه‌اندازی به روش اصلی UEFI، در حالت شبیه‌سازی BIOS بالا می‌آید که به 'Legacy Mode' مشهور است.\"\r\nt MSG_152 \"'non CSM' به این معنی است که این دستگاه برخلاف روش شبیه‌سازی BIOS ('Legacy Mode') به روش اصلی UEFI راه‌اندازی می‌شود.\"\r\nt MSG_153 \"الگوی آزمایش: 0x%02X\"\r\nt MSG_154 \"الگوی آزمایش: 0x%02X, 0x%02X\"\r\nt MSG_155 \"الگوی آزمایش: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"الگوی آزمایش: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"سیستم فایل موردنظر را انتخاب کنید.\\nاگر نمی‌دانید کدام گزینه مناسب است؛ مقدار پیش‌فرض را انتخاب کنید\"\r\nt MSG_158 \"کمترین مقداری که یک بلاک داده (Data block) در سیستم فایل اشغال می‌کند.\\nاگر نمی‌دانید کدام گزینه مناسب است؛ مقدار پیش‌فرض را انتخاب کنید\"\r\nt MSG_159 \"شما می‌توانید برای درایو USB موردنظر؛ نام دلخواهی را انتخاب کنید.\"\r\nt MSG_160 \"نمایش دادن/پنهان کردن تنظیمات پیشرفته\"\r\nt MSG_161 \"بررسی وجود بدسکتور (Bad sector) در حافظه و درایو موردنظر با استفاده از یک الگوی آزمایش (Test pattern)\"\r\nt MSG_162 \"برای فرمت کردن به روش آهسته یا کامل (Full format) این گزینه را غیرفعال کنید\"\r\nt MSG_163 \"روشی که برای ساخت پارتیشن‌ها استفاده می‌شود\"\r\nt MSG_164 \"انتخاب روش و نوع فایلی که می‌خواهید با استفاده از آن یک درایو USB با قابلیت راه‌اندازی بسازید\"\r\nt MSG_165 \"برای انتخاب یا دانلود فایل ایمیج (Image) کلیک کنید.\"\r\nt MSG_166 \"اگر نامی که برای درایو موردنظر انتخاب کرده‌اید طولانی و یا دارای حروف غیر انگلیسی است و یا اگر می‌خواهید درایو موردنظر آیکون داشته باشد؛ این گزینه را انتخاب کنید.\"\r\nt MSG_167 \"نصب یک UEFI bootloader این کار باعث اعتبارسنجی نوع md5sUM برای رسانه میشود\"\r\nt MSG_169 \"افزودن تنظیماتی مثل ساختن یک پارتیشن اضافی و مخفی (Extra hidden partition) در درایو و یا تراز کردن (Align) حدود و مرزهای پارتیشن‌ها که باعث شناسایی بهتر درایو در بایوس‌های قدیمی می‌شود.\"\r\nt MSG_170 \"لطفاً با آگاهی کامل این گزینه را انتخاب کنید و در صورت نیاز حتماً از اطلاعات موجود در هارد اکسترنال یک نسخه پشتیبان (بکاپ) تهیه کنید!!!\"\r\nt MSG_171 \"شروع فرآیند فرمت کردن\\n با این کار، همه اطلاعات موجود در درایوی که انتخاب کرده‌اید «پاک» می‌شود!\"\r\nt MSG_172 \"امضای فایل دانلود شده معتبر نیست\"\r\nt MSG_173 \"برای انتخاب کلیک کنید...\"\r\nt MSG_174 \"Rufus، ابزاری کاربردی و قابل‌اطمینان برای فرمت کردن درایوهای USB\"\r\nt MSG_175 \"نسخه %d.%d (Build %d)\"\r\nt MSG_176 \"ترجمه فارسی:\\\\line‏ •مستر ویتو <mailto:mv@mvaop.ir>\\\\line‏ •ضیاءالدین عظیمی <mailto:s.zia.azimi@gmail.com>\"\r\nt MSG_177 \"گزارش اشکال (Bug) یا درخواست قابلیت جدید و بهبود نرم‌افزار در:\"\r\nt MSG_178 \"حقوق نشر دیگران:\"\r\nt MSG_179 \"سیاست به‌روزرسانی:\"\r\nt MSG_180 \"اگر به این نرم‌افزار اجازه بررسی به‌روزرسانی‌های جدید را بدهید؛ شما موافقت خود را با احتمال جمع‌آوری اطلاعات زیر در سرور یا سرورهای ما اعلام کرده‌اید:\"\r\nt MSG_181 \"معماری و نسخه سیستم‌عامل شما\"\r\nt MSG_182 \"نسخه این نرم‌افزار که در حال استفاده از آن هستید\"\r\nt MSG_183 \"آدرس IP شما\"\r\nt MSG_184 \"به جهت تولید آمار استفاده شخصی، ممکن است ما این اطلاعات جمع‌آوری‌شده را \\\\b برای حداکثر یک سال \\\\b0نگه‌داری کنیم. با وجود این، ما از روی میل این داده‌های فردی را در اختیار شخص ثالث قرار نخواهیم داد.\"\r\nt MSG_185 \"فرآیند به‌روزرسانی:\"\r\nt MSG_186 \"Rufus هیچ سرویس پس‌زمینه‌ای را اجرا یا نصب نمی‌کند؛ بنابراین فقط زمانی که نرم‌افزار در حال اجرا است فرآیند بررسی به‌روزرسانی‌های جدید انجام می‌شود.\\\\line\\nواضح است هنگام بررسی به‌روزرسانی‌ها، دسترسی به اینترنت لازم است.\"\r\nt MSG_187 \"ناهماهنگی بین ایمیج و گزینه راه‌اندازی انتخاب‌شده\"\r\nt MSG_188 \"این فایل ایمیج (Image)، با تنظیمات راه‌اندازی (Boot) انتخاب‌شده؛ سازگار نیست. لطفاً فایل یا تنظیمات دیگری انتخاب کنید.\"\r\nt MSG_189 \"این فایل ایمیج (Image) با سیستم فایل انتخاب‌شده سازگار نیست\"\r\nt MSG_190 \"درایو ناسازگار و ناهماهنگ شناسایی شده است\"\r\nt MSG_191 \"مرحله نوشتن\"\r\nt MSG_192 \"مرحله خواندن\"\r\nt MSG_193 \"%s دانلود شد\"\r\nt MSG_194 \"دانلود %s امکان‌پذیر نیست\"\r\nt MSG_195 \"در حال استفاده از نسخه جاسازی‌شده و داخلی فایل %s\"\r\nt MSG_196 \"مهم!\\nاین درایو اندازه سکتور غیراستانداردی دارد.\\n\\nدرایوهای شناخته‌شده، اندازه سکتور ۵۱۲ بایت دارند اما این درایو از %d بایت استفاده می‌کند. این به این معنی است که (در بیشتر موارد) شما قادر به راه‌اندازی سیستم با استفاده از این درایو نخواهید بود.\\nنرم‌افزار Rufus تلاش می‌کند یک درایو قابل راه‌اندازی را بسازد؛ اما در مورد درست کار کردن آن تضمینی نخواهد داد.\"\r\nt MSG_197 \"شناسایی اندازه سکتور غیراستاندارد\"\r\nt MSG_198 \"استفاده از قابلیت «Windows To Go» فقط در درایوهای پارتیشن‌بندی‌شده به روش GPT که دارای ویژگی «FIXED» هستند؛ امکان‌پذیر است. درایوی که شما انتخاب کرده‌اید ویژگی «FIXED» را ندارد.\"\r\nt MSG_199 \"این ویژگی در این پلتفرم موجود نیست.\"\r\nt MSG_201 \"در حال لغو کردن؛ لطفاً صبور باشید...\"\r\nt MSG_202 \"در حال پویش و بررسی ایمیج...\"\r\nt MSG_203 \"بررسی ایمیج ناموفق بود\"\r\nt MSG_204 \"فایل قدیمی و منسوخ %s شناسایی شد\"\r\nt MSG_205 \"در حال استفاده از ایمیج: %s\"\r\nt MSG_206 \"فایل %s موجود نیست\"\r\nt MSG_207 \"بخش جدید\"\r\nt MSG_208 \"%d درایو شناسایی شد\"\r\nt MSG_209 \"%d درایو شناسایی شد\"\r\nt MSG_210 \"آماده\"\r\nt MSG_211 \"لغو شد\"\r\nt MSG_212 \"ناموفق بود\"\r\nt MSG_213 \"در حال راه‌اندازی نسخه جدید نرم‌افزار...\"\r\nt MSG_214 \"راه‌اندازی نسخه جدید نرم‌افزار ناموفق بود\"\r\nt MSG_215 \"‪%s‬ باز شد\"\r\nt MSG_216 \"‪%s‬ ذخیره شد\"\r\nt MSG_217 \"در حال فرمت کردن؛ درصد پیشرفت: %s\"\r\nt MSG_218 \"در حال ساختن سیستم فایل؛ تعداد وظایف انجام شده: %d/%d\"\r\nt MSG_219 \"ایجاد ساختار NTFS Fixup؛ درصد پیشرفت: %d%%\"\r\nt MSG_220 \"در حال فرمت کردن (%s)؛ زمان تخمینی: %d:%02d.\"\r\nt MSG_221 \"در حال نام‌گذاری درایو (%s)...\"\r\nt MSG_222 \"در حال فرمت کردن (%s)...\"\r\nt MSG_223 \"در حال ایجاد ساختار NTFS Fixup (Checkdisk)...\"\r\nt MSG_224 \"در حال پاک‌کردن ساختارهای MBR/PBR/GPT...\"\r\nt MSG_225 \"در حال درخواست دسترسی به دیسک...\"\r\nt MSG_226 \"در حال بررسی رکوردهای راه‌انداز موجود...\"\r\nt MSG_227 \"در حال بستن درایوهای موجود...\"\r\nt MSG_228 \"در حال نوشتن رکورد راه‌انداز اصلی (MBR)...\"\r\nt MSG_229 \"در حال نوشتن رکورد راه‌انداز پارتیشن (PBR)...\"\r\nt MSG_230 \"در حال کپی کردن فایل‌های DOS...\"\r\nt MSG_231 \"در حال کپی کردن محتویات فایل ISO: ‏%s\"\r\nt MSG_232 \"در حال نصب راه‌انداز EFI ویندوز ۷ (%s)...\"\r\nt MSG_233 \"در حال انجام مرحله نهایی، لطفاً صبور باشید...\"\r\nt MSG_234 \"در حال نصب Syslinux %s...\"\r\nt MSG_235 \"بررسی بدسکتور: %s %d/%d - %0.2f%% (%d/%d/%d خطاها)\"\r\nt MSG_236 \"بررسی بدسکتور: آزمایش با استفاده از الگوی تصادفی\"\r\nt MSG_237 \"بررسی بدسکتور: آزمایش با استفاده از الگوی 0x%02X\"\r\nt MSG_238 \"در حال پارتیشن‌بندی (%s)...\"\r\nt MSG_239 \"در حال حذف پارتیشن‌ (%s)...\"\r\nt MSG_240 \"امضای دیجیتال آپدیت دانلود شده معتبر نیست. ممکن است تنظیمات اعتبارسنجی امضا در سیستم شما درست نباشد یا اینکه فایل دانلود شده خراب باشد.\\nفایل دانلود شده پاک خواهد شد. برای جزئیات بیشتر گزارش (log) را مشاهده کنید.\"\r\nt MSG_241 \"در حال دانلود کردن %s\"\r\nt MSG_242 \"دانلود فایل ناموفق بود.\"\r\nt MSG_243 \"در حال بررسی به‌روزرسانی‌های Rufus...\"\r\nt MSG_244 \"به‌روزرسانی: نرم‌افزار نتوانست به اینترنت وصل شود\"\r\nt MSG_245 \"به‌روزرسانی: نرم‌افزار نتوانست به اطلاعات نسخه برنامه دسترسی پیدا کند\"\r\nt MSG_246 \"نسخه جدیدی از Rufus موجود است!\"\r\nt MSG_247 \"نسخه جدیدی برای Rufus پیدا نشد\"\r\nt MSG_248 \"کلیدهای رجیستری برنامه با موفقیت حذف شدند\"\r\nt MSG_249 \"حذف کلیدهای رجیستری برنامه ناموفق بود\"\r\nt MSG_250 \"%s فعال شد\"\r\nt MSG_251 \"%s غیرفعال شد\"\r\nt MSG_252 \"بررسی اندازه ایمیج\"\r\nt MSG_253 \"تشخیص دیسک سخت (هارد دیسک) USB\"\r\nt MSG_254 \"وادار کردن استفاده از فرمت Large FAT32\"\r\nt MSG_255 \"هنگام خروج، NoDriveTypeAutorun حذف خواهد شد\"\r\nt MSG_256 \"تشخیص درایو ساختگی و تقلبی\"\r\nt MSG_257 \"پشتیبانی از سیستم فایل Joliet\"\r\nt MSG_258 \"پشتیبانی از سیستم فایل Rock Ridge\"\r\nt MSG_259 \"وادار کردن به‌روزرسانی\"\r\nt MSG_260 \"فشرده‌سازی NTFS\"\r\nt MSG_261 \"در حال استفاده از ایمیج: %s\"\r\nt MSG_262 \"پشتیبانی از فایل ISO\"\r\n# 'LRE' & 'PDF' are used\r\nt MSG_263 \"نمایش دودویی واحدهای حافظه (‪1 KB = 1024 bytes‬)\"\r\nt MSG_264 \"در حال حذف کردن پوشه '%s'\"\r\nt MSG_265 \"شناسایی دیسک VMWare\"\r\nt MSG_266 \"روش دوگانه UEFI/BIOS\"\r\nt MSG_267 \"در حال استفاده از ایمیج ویندوز: %s\"\r\nt MSG_268 \"در حال استفاده از ایمیج ویندوز...\"\r\nt MSG_269 \"نگه‌داری برچسب زمان (timestamp)\"\r\nt MSG_270 \"اشکال‌زدایی (debug) USB\"\r\nt MSG_271 \"محاسبه جمع کنترلی (Checksum) ایمیج؛ درصد پیشرفت: %s\"\r\nt MSG_272 \"محاسبه جمع کنترلی (Checksum) SHA1 و MD5 برای ایمیج انتخاب‌شده\"\r\nt MSG_273 \"تغییر زبان برنامه\"\r\nt MSG_274 \"ایمیج %s شناسایی شد\"\r\nt MSG_275 \"ایمیجی که شما انتخاب کرده‌اید از نوع «ISOHybrid» است. به این معنی که این فایل می‌تواند به روش «%s (کپی کردن فایل)» یا «%s (ایمیج دیسک)» نوشته شود.\\nRufus استفاده از روش «%s» را پیشنهاد می‌کند. در این روش پس از نوشتن اطلاعات در درایو، شما همیشه دسترسی کاملی به درایو خواهید داشت. \\nبا این حال، اگر هنگام راه‌اندازی (boot) سیستم‌عامل با مشکلی برخورد کردید؛ شما می‌توانید دوباره نوشتن اطلاعات به روش «%s» را امتحان کنید.\\n\\nلطفاً شیوه‌ای را که می‌خواهید با استفاده از آن اطلاعات ایمیج نوشته شود؛ انتخاب کنید:\"\r\nt MSG_276 \"نوشتن به روش «%s» (پیشنهاد برنامه)\"\r\nt MSG_277 \"نوشتن به روش «%s»\"\r\nt MSG_278 \"درحال بررسی فرآیندهای ناسازگار و متناقض...\"\r\nt MSG_279 \"غیرقابل راه‌اندازی (Non bootable)\"\r\nt MSG_280 \"دیسک یا ایمیج ISO\"\r\nt MSG_281 \"%s (لطفاً انتخاب کنید)\"\r\nt MSG_282 \"قفل کردن اختصاصی درایو USB\"\r\nt MSG_283 \"امضای نامعتبر\"\r\nt MSG_284 \"فایل اجرایی دانلود شده امضای دیجیتال ندارد.\"\r\nt MSG_285 \"این فایل اجرایی دانلود شده، توسط '%s' امضا شده است.\\n ما این امضا را نمی‌شناسیم و ناشناس بودن آن ممکن است نشانه نوعی فعالیت خرابکارانه باشد...\\nآیا مطمئن هستید می‌خواهید این فایل را اجرا کنید؟\"\r\nt MSG_286 \"صفر کردن درایو: %s\"\r\nt MSG_287 \"شناسایی درایوهای غیر USB\"\r\nt MSG_288 \"دسترسی‌های سطح بالا وجود ندارد\"\r\nt MSG_289 \"این نرم‌افزار فقط با دسترسی‌های سطح بالا می‌تواند اجرا شود\"\r\nt MSG_290 \"ایندکس گذاری فایل\"\r\nt MSG_291 \"انتخاب نسخه (ورژن)\"\r\nt MSG_292 \"لطفاً نسخه ویندوزی را که می‌خواهید نصب کنید؛ انتخاب کنید:\"\r\nt MSG_293 \"نسخه ویندوز پشتیبانی نمی‌شود\"\r\nt MSG_294 \"Rufus دیگر این نسخه از ویندوز را پشتیبانی نمی‌کند آخرین ورژن قابل پشتیبانی برنامه Rufus نصب این نسخه از ویندوز v%d.%d.\"\r\nt MSG_295 \"هشدار: نسخه غیررسمی\"\r\nt MSG_296 \"این نسخه از Rufus توسط توسعه‌دهندگان اصلی و رسمی آن تهیه نشده است.\\n\\nآیا برای اجرای آن مطمئن هستید؟\"\r\nt MSG_297 \"فایل ISO ناقص شناسایی شده است\"\r\nt MSG_298 \"این فایل ISO که انتخاب کرده‌اید با اندازه تعیین شده در آن هماهنگی ندارد. %s از داده‌ها موجود نیست!\\n\\nاگر این فایل را از اینترنت دانلود کرده‌اید، لطفا نسخه‌ای جدید از آن را دانلود کرده و مطمئن شوید که مقادیر کنترلی MD5 یا SHA آن عینا برابر با مقادیر رسمی آن‌هاست.\\n\\nتوجه داشته باشید که در Rufus می‌توانید با انتخاب دکمه (✓) مقادیر MD5 یا SHA را  محاسبه کنید.\"\r\nt MSG_299 \"خطای اعتبارسنجی برچسب زمان (timestamp)\"\r\nt MSG_300 \"از نظر برنامه، برچسب زمانی آپدیت دانلود شده معتبر نیست. \\n\\nبرای پیشگیری از حملات هک احتمالی، فرآیند به‌روزرسانی متوقف و فایل دانلود شده حذف خواهد شد. لطفا برای جزئیات بیشتر گزارش‌ها (لاگ) را بررسی کنید.\"\r\nt MSG_301 \"نمایش تنظیمات برنامه\"\r\nt MSG_302 \"نمایش اطلاعات مربوط به این برنامه\"\r\nt MSG_303 \"نمایش گزارش‌ها (Log)\"\r\nt MSG_304 \"ساخت ایمیج از دستگاه انتخاب‌شده\"\r\nt MSG_305 \"با استفاده از این گزینه مشخص کنید که آیا می‌خواهید از این درایو برای نصب ویندوز استفاده کنید یا اینکه می‌خواهید مستقیما ویندوز را از روی آن اجرا کنید (Windows To Go).\"\r\nt MSG_306 \"درحال بازنویسی سریع درایو با داده صفر؛ درصد پیشرفت: %s\"\r\nt MSG_307 \"ممکن است کمی زمان‌بر باشد\"\r\nt MSG_308 \"پیداشدن VHD\"\r\nt MSG_309 \"آرشیو فشرده\"\r\nt MSG_310 \"ISO که انتخاب کرده اید از UEFI استفاده می کند و به اندازه کافی کوچک است که به عنوان یک پارتیشن سیستم EFI (ESP) نوشته شود. نوشتن به ESP، به جای نوشتن به یک پارتیشن داده عمومی اشغال کل دیسک، می تواند برای برخی از انواع تاسیسات ترجیح داده شود. لطفا حالتی را که می خواهید برای نوشتن این تصویر استفاده کنید انتخاب کنید:\"\r\nt MSG_311 \"برای فعال کردن از %s (در پنجره اصلی برنامه) استفاده کنید.\"\r\nt MSG_312 \"هش های اضافی (SHA512)\"\r\nt MSG_313 \"ثبت در VHD\"\r\nt MSG_314 \"جمع های چک تصویر را محاسبه کنید\"\r\nt MSG_315 \"چندین دکمه\"\r\nt MSG_316 \"ردیف عدد\"\r\nt MSG_317 \"شناسه دیسک\"\r\nt MSG_318 \"اولویت موضوع پیش فرض: %d\"\r\nt MSG_319 \"Boot Marker را نادیده بگیرید\"\r\nt MSG_320 \"در حال تازه کردن طرح پارتیشن (%s)...\"\r\nt MSG_321 \"تصویری که انتخاب کرده‌اید ISOHybrid است، اما سازندگان آن آنرا با حالت کپی ISO/File سازگار نکرده‌اند.\\nدر نتیجه حالت نوشتن تصویر DD اعمال خواهد شد.\"\r\nt MSG_322 \"باز کردن یا خواندن %s ممکن نیست\"\r\nt MSG_325 \"اعمال سفارشی سازی ویندوز: %s\"\r\nt MSG_326 \"اعمال گزینه های کاربر...\"\r\nt MSG_327 \"تجربه کاربری ویندوز\"\r\nt MSG_328 \"شخصی سازی نصب ویندوز؟\"\r\nt MSG_329 \"نیاز به رم 4 گیگابایتی، Secure Boot و TPM 2.0 را حذف کنید\"\r\nt MSG_330 \"نیاز به حساب آنلاین مایکروسافت را حذف کنید\"\r\nt MSG_331 \"غیرفعال کردن جمع آوری داده ها (رد شدن از سوالات حریم خصوصی)\"\r\nt MSG_332 \"از دسترسی Windows To Go به دیسک های داخلی جلوگیری کنید\"\r\nt MSG_333 \"یک حساب کاربری محلی با نام کاربری ایجاد کنید:\"\r\nt MSG_334 \"گزینه های منطقه ای را روی همان مقادیر این کاربر تنظیم کنید\"\r\nt MSG_335 \"رمزگذاری خودکار دستگاه BitLocker را غیرفعال کنید\"\r\nt MSG_336 \"لیست مداوم\"\r\nt MSG_337 \"برای استفاده از این ویژگی، باید یک فایل اضافی ('%s') از مایکروسافت دانلود شود:\\n- انتخاب :'بله' برای وصل شدن به اینترنت و دانلود آن\\n- انتخاب 'نه' برای کنسل کردن این کار\\n\\nنکته: فایل در مکان نرم افزار دانلود میشود و دوباره استفاده میشود درصورت انجام مجدد این کار.\"\r\nt MSG_338 \"بوت لودر UEFI کنسل شده شناسایی شد\"\r\nt MSG_339 \"Rufus متوجه شده که فایل ISO که انتخاب کردید دارای UEFI بوت لودری است که لفو شده و باعث %s, درصورتی که بوت امن فعال شده بر روی سیستم کاملا اپدیت شده UEFI\\v\\v- اگه شما این فایل ISO رو از یک جای غیر قابل اعتماد دریافت کردید ممکن است این فایل دارای ویروس UEFI باشد و نباید آنرا بوت کرد \\n\\v- اگه شما شما از جای مورد اغفماد دریافت کردیدش, میتونید تلاش کنید برای پیدا کردن نسخه جدیدتر, با اینکار دیگر این هشتار را دریافت نمیکنید.\"\r\nt MSG_340 \"یک  صفحه  \\\"مشکلی امنیتی\\\"\"\r\nt MSG_341 \"یک صفخه ریکاوری ویندوز (BSOD) با '%S\\\"\"\r\nt MSG_342 \"فایل VHDX  فشرده شده\"\r\nt MSG_343 \"فایل VHD  فشرده نشده\"\r\nt MSG_345 \"دیتا های دیگری نیاز به دانلود از مایکروسافت برای انجام دادن این کار نیاز است:\\n- انتخاب 'بله' برای وصل شدن به اینترنت و دانلود آنها\\n- انتخاب 'نه' برای لغو کردن این کار\"\r\nt MSG_346 \"مجبور کردن ویندوز به S-Mode ( دارای مشکلات با حذفز استفاده  اکانت آنلاین )\"\r\nt MSG_347 \"بخش حرفه ای\"\r\nt MSG_348 \"استراج کردن فایل های آرشیو: %s\"\r\nt MSG_349 \"استفاده از Rufus MBR\"\r\nt MSG_900 \"Rufus ابزاری است که به فرمت و ایجاد درایوهای فلش USB قابل بوت، مانند کلیدهای USB/pendrives، مموری استیک ها و غیره به شما کمک می کند.\"\r\nt MSG_901 \"سایت رسمی: %s\"\r\nt MSG_902 \"منبع کد: %s\"\r\nt MSG_903 \"لیست تغییرات %s\"\r\nt MSG_904 \"این برنامه تحت شرایط مجوز عمومی گنو (GPL) نسخه 3 مجوز دارد.\\nبرای جزئیات به https://www.gnu.org/licenses/gpl-3.0.html مراجعه کنید.\"\r\nt MSG_905 \"راه‌اندازی\"\r\nt MSG_910 \"فرمت USB، فلش کارت و درایوهای مجازی به FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"درایوهای USB قابل بوت FreeDOS را ایجاد کنید\"\r\nt MSG_912 \"ایجاد درایوهای قابل بوت از ISOهای قابل بوت (ویندوز، لینوکس و غیره)\"\r\nt MSG_913 \"درایوهای قابل بوت را از تصاویر دیسک قابل بوت، از جمله موارد فشرده، ایجاد کنید\"\r\nt MSG_914 \"درایوهای قابل بوت بایوس یا UEFI از جمله NTFS قابل بوت UEFI ایجاد کنید\"\r\nt MSG_915 \"درایوهای \\\"Windows To Go\\\" را ایجاد کنید\"\r\nt MSG_916 \"درایوهای نصب ویندوز 11 را برای رایانه هایی که TPM یا Secure Boot ندارند ایجاد کنید\"\r\nt MSG_917 \"ایجاد پارتیشن های لینوکس دائمی\"\r\nt MSG_918 \"تصاویر VHD/DD از درایو انتخاب شده ایجاد کنید\"\r\nt MSG_919 \"MD5، SHA-1، SHA-256 و SHA-512 را برای تصویر انتخابی محاسبه کنید\"\r\nt MSG_920 \"بررسی بلوک های بد، از جمله تشخیص درایوهای فلش \\\"جعلی\\\" را انجام دهید\"\r\nt MSG_921 \"ISO های رسمی ماکروسافت را دریافت کنید\"\r\nt MSG_922 \"ISO های پوسته UEFI را دانلود کنید\"\r\n\r\n#########################################################################\r\nl \"pl-PL\" \"Polish (Polski)\" 0x0415\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"O Rufusie\"\r\nt IDC_ABOUT_LICENSE \"Licencja\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Właściwości dysku\"\r\nt IDS_DEVICE_TXT \"Urządzenie\"\r\nt IDS_BOOT_SELECTION_TXT \"Wybór bootowania\"\r\nt IDC_SELECT \"Wybierz\"\r\nt IDS_IMAGE_OPTION_TXT \"Opcje obrazu\"\r\nt IDS_PARTITION_TYPE_TXT \"Schemat partycjonowania\"\r\nt IDS_TARGET_SYSTEM_TXT \"Docelowy system\"\r\nt IDC_LIST_USB_HDD \"Pokaż dyski twarde USB\"\r\nt IDC_OLD_BIOS_FIXES \"Dodaj łatkę dla starych BIOSów (dodatkowa partycja, itp.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Włącz weryfikację nośnika UEFI w czasie wykonywania\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Opcje formatowania\"\r\nt IDS_FILE_SYSTEM_TXT \"System plików\"\r\nt IDS_CLUSTER_SIZE_TXT \"Rozmiar jednostki alokacji\"\r\nt IDS_LABEL_TXT \"Nazwa woluminu\"\r\nt IDC_QUICK_FORMAT \"Szybkie formatowanie\"\r\nt IDC_BAD_BLOCKS \"Szukaj błędnych sektorów na urządzeniu\"\r\nt IDC_EXTENDED_LABEL \"Utwórz rozszerzoną nazwę i pliki ikon\"\r\nt IDS_STATUS_TXT \"Stan\"\r\nt IDCANCEL \"Zamknij\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Zamknij\"\r\nt IDD_LICENSE \"Licencja Rufusa\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Zamknij\"\r\nt IDC_LOG_CLEAR \"Wyczyść\"\r\nt IDC_LOG_SAVE \"Zapisz\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Zamknij\"\r\nt IDD_NEW_VERSION \"Szukaj aktualizacji - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Nowsza wersja jest dostępna. Proszę pobrać najnowszą wersję!\"\r\nt IDC_WEBSITE \"Kliknij tutaj, aby przejść na stronę www\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Informacje o wydaniu\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Pobierz\"\r\nt IDC_DOWNLOAD \"Pobierz\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Więcej informacji\"\r\nt IDYES \"Tak\"\r\nt IDNO \"Nie\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Zamknij\"\r\nt IDD_UPDATE_POLICY \"Polityka aktualizacji i ustawienia\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Ustawienia\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Szukaj aktualizacji\"\r\nt IDS_INCLUDE_BETAS_TXT \"Dołącz wersje beta\"\r\nt IDC_CHECK_NOW \"Sprawdź teraz\"\r\n\r\nt MSG_001 \"Wykryto inną instancję\"\r\nt MSG_002 \"Inna aplikacja Rufus jest uruchomiona.\\nProszę zamknąć pierwszą aplikację przed otwarciem innej.\"\r\nt MSG_003 \"UWAGA: WSZYSTKIE DANE NA URZĄDZENIU '%s' ZOSTANĄ ZNISZCZONE.\\nAby kontynuować tę operację naciśnij OK. Aby wyjść naciśnij ANULUJ.\"\r\nt MSG_004 \"Polityka aktualizacji Rufusa\"\r\nt MSG_005 \"Czy chcesz zezwolić Rufusowi na sprawdzanie aktualizacji online?\"\r\nt MSG_006 \"Zamknij\"\r\nt MSG_007 \"Anuluj\"\r\nt MSG_008 \"Tak\"\r\nt MSG_009 \"Nie\"\r\nt MSG_010 \"Znaleziono uszkodzone sektory\"\r\nt MSG_011 \"Sprawdzanie zakończone: znaleziono %d uszkodzone sektory(ów)\\n  %d błędów odczytu\\n  %d błędów zapisu\\n  %d błędy(ów) uszkodzeń\"\r\nt MSG_012 \"%s\\nRaport szczegółowy jest dostępny w:\\n%s\"\r\nt MSG_013 \"Wyłączone\"\r\nt MSG_014 \"Dziennie\"\r\nt MSG_015 \"Tygodniowo\"\r\nt MSG_016 \"Miesięcznie\"\r\nt MSG_017 \"Własne\"\r\nt MSG_018 \"Twoja wersja: %d.%d (Build %d)\"\r\nt MSG_019 \"Najnowsza wersja: %d.%d (Build %d)\"\r\nt MSG_020 \"bajtów\"\r\nt MSG_026 \"bajtów\"\r\nt MSG_027 \"kilobajtów\"\r\nt MSG_028 \"megabajtów\"\r\nt MSG_029 \"Domyślne\"\r\nt MSG_030 \"%s (Domyślne)\"\r\nt MSG_031 \"BIOS (lub UEFI-CSM)\"\r\nt MSG_032 \"UEFI (bez CSM)\"\r\nt MSG_033 \"BIOS lub UEFI\"\r\nt MSG_034 \"%d Przebieg\"\r\nt MSG_035 \"%d Przebiegi %s\"\r\nt MSG_036 \"Obraz ISO\"\r\nt MSG_037 \"Aplikacja\"\r\nt MSG_038 \"Przerwij\"\r\nt MSG_039 \"Uruchom\"\r\nt MSG_040 \"Pobierz\"\r\nt MSG_041 \"Operacja anulowana przez użytkownika\"\r\nt MSG_042 \"Błąd\"\r\nt MSG_043 \"Błąd: %s\"\r\nt MSG_044 \"Pobieranie pliku\"\r\nt MSG_045 \"Urządzenie pamięci masowej USB (Ogólny)\"\r\nt MSG_046 \"%s (Dysk %d) [%s]\"\r\nt MSG_047 \"Wiele Partycji\"\r\nt MSG_048 \"Rufus - Czyszczenie buforów\"\r\nt MSG_049 \"Rufus - Anulowanie\"\r\nt MSG_050 \"Sukces.\"\r\nt MSG_051 \"Niezidentyfikowany błąd podczas formatowania.\"\r\nt MSG_052 \"Nie można użyć wybranego systemu plików dla tego nośnika.\"\r\nt MSG_053 \"Dostęp do urządzenia jest zabroniony.\"\r\nt MSG_054 \"Nośnik jest w trybie chronionym przed zapisem.\"\r\nt MSG_055 \"Urządzenie jest używane przez inny proces. Proszę zamknąć inne procesy, które mogą korzystać z tego urządzenia.\"\r\nt MSG_056 \"Szybkie formatowanie jest niedostępne dla tego urządzenia.\"\r\nt MSG_057 \"Nazwa woluminu jest nieprawidłowa.\"\r\nt MSG_058 \"Uchwyt urządzenia jest nieprawidłowy.\"\r\nt MSG_059 \"Wybrany rozmiar jednostki alokacji jest nieprawidłowy dla tego urządzenia.\"\r\nt MSG_060 \"Rozmiar woluminu jest nieprawidłowy.\"\r\nt MSG_061 \"Proszę włożyć dysk wymienny do napędu.\"\r\nt MSG_062 \"Otrzymano niewspieraną komendę.\"\r\nt MSG_063 \"Błąd alokacji pamięci.\"\r\nt MSG_064 \"Błąd odczytu.\"\r\nt MSG_065 \"Błąd zapisu.\"\r\nt MSG_066 \"Niepowodzenie instalacji\"\r\nt MSG_067 \"Nie można otworzyć nośnika. Może być używany przez inny proces. Proszę podłączyć ponownie nośnik i spróbować jeszcze raz.\"\r\nt MSG_068 \"Nie można podzielić dysku na partycje.\"\r\nt MSG_069 \"Nie można skopiować plików na dysk docelowy.\"\r\nt MSG_070 \"Przerwane przez użytkownika.\"\r\nt MSG_071 \"Nie można rozpocząć wątku.\"\r\nt MSG_072 \"Nie ukończono sprawdzania błędnych sektorów.\"\r\nt MSG_073 \"Niepowodzenie skanowania pliku ISO.\"\r\nt MSG_074 \"Niepowodzenie wypakowywania pliku ISO.\"\r\nt MSG_075 \"Nie można ponownie zamontować woluminu.\"\r\nt MSG_076 \"Nie można załatać/skonfigurować plików do rozruchu.\"\r\nt MSG_077 \"Nie można przypisać litery dysku.\"\r\nt MSG_078 \"Nie można zamontować woluminu GUID.\"\r\nt MSG_079 \"Urządzenie nie jest gotowe.\"\r\nt MSG_080 \"Rufus wykrył, że Windows wciąż opróżnia swoje bufory na urządzenie USB.\\n\\nZależnie od prędkości twojego urządzenia USB, ta operacja może zająć dużo czasu, zwłaszcza dla dużych plików.\\n\\nZalecamy, abyś pozwolił Windowsowi skończyć, żeby uniknąć uszkodzeń. Jeśli jesteś już zmęczony czekaniem, możesz po prostu odłączyć urządzenie...\"\r\nt MSG_081 \"Niewspierany obraz\"\r\nt MSG_082 \"Ten obraz nie jest rozruchowy lub używa kompresji sektora rozruchowego niewspieranej przez Rufusa...\"\r\nt MSG_083 \"Zastąpić %s?\"\r\nt MSG_084 \"Ten obraz ISO wydaje się używać przestarzałej wersji '%s'.\\nZ tego powodu menu rozruchowe może nie wyświetlać się poprawnie.\\n\\nNowsza wersja może być pobrana przez Rufus, aby naprawić ten błąd:\\n- Wybierz 'Tak', aby połączyć się z internetem i pobrać plik\\n- Wybierz 'Nie', aby zostawić istniejący plik ISO niezmienionym\\nJeśli nie wiesz co zrobić, powinieneś wybrać 'Tak'.\\n\\nInformacja: Nowy plik będzie pobrany do aktualnej lokalizacji i jeśli '%s' istnieje, zostanie ponownie użyte automatycznie.\"\r\nt MSG_085 \"Pobieranie %s\"\r\nt MSG_086 \"Nie wybrano obrazu\"\r\nt MSG_087 \"dla NAND %s\"\r\nt MSG_088 \"Obraz jest zbyt duży\"\r\nt MSG_089 \"Ten obraz jest zbyt duży dla wybranego celu.\"\r\nt MSG_090 \"Niewspierane ISO\"\r\nt MSG_091 \"Podczas używania Systemu Typu UEFI, tylko rozruchowe obrazy ISO EFI są wspierane. Proszę wybrać rozruchowy obraz ISO EFI lub ustawić System Docelowy na BIOS.\"\r\nt MSG_092 \"Niewspierany system plików\"\r\nt MSG_093 \"WAŻNE: TEN NAPĘD ZAWIERA WIELE PARTYCJI!!\\n\\nMoże to obejmować partycje/woluminy, które nie są wymienione lub nawet widoczne z poziomu Windows. Jeżeli chcesz kontynuować, jesteś odpowiedzialny za utratę danych na tych partycjach.\"\r\nt MSG_094 \"Wykryto wiele partycji\"\r\nt MSG_095 \"Obraz DD\"\r\nt MSG_096 \"Aktualnie zaznaczony system plików nie może zostać użyty z tym typem ISO. Proszę wybrać inny system plików lub użyć innego ISO.\"\r\nt MSG_097 \"'%s' może zostać użyte wyłącznie, jeżeli system plików to NTFS.\"\r\nt MSG_098 \"WAŻNE: Próbujesz zainstalować 'Windows To Go', lecz dysk docelowy nie ma atrybutu 'LOKALNY'. Z tego powodu Windows prawdopodobnie zawiesi się podczas startu, ponieważ Microsoft nie zaprojektował go do działania z dyskami, które zamiast tego mają atrybut 'WYMIENNY'.\\n\\nCzy nadal chcesz kontynuować?\\n\\nInformacja: Atrybut 'LOKALNY/WYMIENNY' to właściwość sprzętowa, która może jedynie zostać zmieniona używając narzędzi dostarczanych przez producenta dysku. Jednak te narzędzia PRAWIE NIGDY nie są udostępniane publicznie...\"\r\nt MSG_099 \"Ograniczenia systemu plików\"\r\nt MSG_100 \"Ten obraz ISO zawiera plik większy niż 4 GB, większy niż maksymalny dozwolony rozmiar dla systemu plików FAT lub FAT32.\"\r\nt MSG_101 \"Brakujące wsparcie WIM\"\r\nt MSG_102 \"Twoja platforma nie może wypakować plików z archiwów WIM. Wypakowanie WIM jest wymagane aby utworzyć rozruchowy dysk USB EFI z Windows 7 i Windows Vista. Możesz to naprawić instalując aktualną wersję 7-Zip.\\nCzy chcesz odwiedzić stronę pobierania 7-zip?\"\r\nt MSG_103 \"Pobrać %s?\"\r\nt MSG_104 \"%s lub późniejszy wymaga zainstalowania pliku '%s'.\\nPonieważ ten plik jest większy niż 100 KB i zawsze jest obecny na obrazach ISO %s, nie jest dołączony do Rufusa.\\n\\nRufus może pobrać brakujący plik dla ciebie:\\n- Wybierz 'Yes', aby połączyć się z internetem i pobrać plik\\n- Wybierz 'No', jeśli chcesz później ręcznie skopiować ten plik na dysk \\n\\nInformacja: Plik zostanie pobrany do obecnego folderu i jeśli '%s' istnieje, zostanie użyty ponownie automatycznie.\"\r\nt MSG_105 \"Przerwanie operacji może pozostawić urządzenie w stanie NIEZDATNYM DO UŻYTKU.\\nJeśli jesteś pewien, że chcesz przerwać operację, naciśnij TAK. W innym razie naciśnij NIE.\"\r\nt MSG_106 \"Proszę wybrać folder\"\r\nt MSG_107 \"Wszystkie pliki\"\r\nt MSG_108 \"Dziennik Rufusa\"\r\nt MSG_109 \"0x%02X (Dysk %d)\"\r\nt MSG_110 \"MS-DOS nie może być uruchomiony z dysku korzystającego z 64 kilobajtowego Rozmiaru jednostki alokacji.\\nProszę zmienić rozmiar jednostki alokacji lub użyć FreeDOSa.\"\r\nt MSG_111 \"Niekompatybilny rozmiar jednostki alokacji\"\r\nt MSG_112 \"Formatowanie dużych woluminów UDF może zająć dużo czasu. Przy prędkości USB 2.0 , szacunkowy czas formatowania wynosi %d:%02d, podczas którego pasek postępu będzie wydawał się być zamrożony. Proszę być cierpliwym!\"\r\nt MSG_113 \"Duży wolumin UDF\"\r\nt MSG_114 \"Ten obraz używa Syslinux %s%s, lecz ta aplikacja dołącza pliki instalacyjne tylko dla Syslinux %s%s.\\n\\nPonieważ nowa wersja Syslinux nie jest kompatybilna z inną i nie jest możliwe dla Rufusa aby załączyć je wszystkie, dwa dodatkowe pliki muszą być pobrane z Internetu ('ldlinux.sys' oraz 'ldlinux.bss'):\\n- Wybierz 'Tak' aby połączyć z Internetem i pobrać te pliki\\n- Wybierz 'Nie' aby anulować operację\\n\\nInformacja: Pliki zostaną pobrane do aktualnego folderu aplikacji i zostaną użyte ponownie automatycznie, jeśli istnieją.\"\r\nt MSG_115 \"Wymagane pobieranie\"\r\nt MSG_116 \"Ten obraz używa Grub %s, lecz ta aplikacja dołącza pliki instalacyjne tylko dla Grub %s.\\n\\nPonieważ inna wersja Grub może nie być kompatybilna, oraz nie jest możliwe dołączenie wszystkich, Rufus spróbuje zlokalizować wersję pliku instalacyjnego Grub ('core.img'), która jest zgodna z użytą w twoim obrazie:\\n- Wybierz 'Tak' aby połączyć z Internetem i spróbować ją pobrać\\n- Wybierz 'Nie' aby użyć domyślnej wersji z Rufusa\\n- Wybierz 'Anuluj' aby przerwać operację\\n\\nInformacja: Pliki zostaną pobrane do aktualnego folderu aplikacji i zostaną użyte ponownie automatycznie, jeśli istnieją. Jeżeli nie można znależć odpowiednich plików online, zostanie użyta domyślna wersja plików.\"\r\nt MSG_117 \"Standardowa instalacja Windowsa\"\r\nt MSG_119 \"zaawansowane właściwości dysku\"\r\nt MSG_120 \"zaawansowane opcje formatowania\"\r\nt MSG_121 \"Pokaż %s\"\r\nt MSG_122 \"Ukryj %s\"\r\nt MSG_123 \"Rozmiar trwałej partycji\"\r\nt MSG_124 \"Brak trwałości\"\r\nt MSG_125 \"Ustaw rozmiar stałej partycji dla nośnika live USB. Ustawienie rozmiaru na 0 wyłącza trwałą partycję.\"\r\nt MSG_126 \"Wybierz jednostkę rozmiaru partycji.\"\r\nt MSG_127 \"Nie pokazuj więcej tej wiadomości\"\r\nt MSG_128 \"Ważna informacja o %s\"\r\nt MSG_129 \"Właśnie utworzyłeś nośnik, który używa bootloadera UEFI:NTFS. Pamiętaj, że aby wystartować z tego medium, MUSISZ WYŁĄCZYĆ \\\"SECURE BOOT\\\".\\nAby dowiedzieć się więcej dlaczego jest to wymagane, kliknij poniżej przycisk \\\"Więcej informacji\\\".\"\r\nt MSG_130 \"Wybór obrazu Windows\"\r\nt MSG_131 \"To ISO zawiera wiele obrazów Windows.\\nWybierz obraz, którego chcesz użyć dla tej instalacji:\"\r\nt MSG_132 \"Inny program lub proces używa tego dysku. Czy chcesz go sformatować mimo to?\"\r\nt MSG_133 \"Rufus wykrył, że próbujesz utworzyć nośnik \\\"Windows To Go\\\" bazujący na ISO 1809.\\n\\nZ powodu *BŁĘDU MICROSOFTU*, ten nośnik ulegnie awarii podczas rozruchu systemu (Blue Screen of Death), chyba że ręcznie zastąpisz plik \\\"WppRecorder.sys\\\" wersją z 1803.\\n\\nNależy również pamiętać, że powodem, dla którego Rufus nie może automatycznie rozwiązać tego problemu, jest to, że \\\"WppRecorder.sys” jest plikiem chronionym prawem autorskim firmy Microsoft, więc nie możemy zgodnie z prawem osadzić kopii pliku w aplikacji.\"\r\nt MSG_134 \"Ponieważ MBR został wybrany jako schemat partycji, Rufus może utworzyć partycję o rozmiarze do 2 TB na tym nośniku, co spowoduje, że %s miejsca na dysku będzie niedostępne.\\n\\nJesteś pewien, że chcesz kontynuować?\"\r\nt MSG_135 \"Wersja\"\r\nt MSG_136 \"Wydanie\"\r\nt MSG_137 \"Edycja\"\r\nt MSG_138 \"Język\"\r\nt MSG_139 \"Architektura\"\r\nt MSG_140 \"Kontynuuj\"\r\nt MSG_141 \"Powrót\"\r\nt MSG_142 \"Proszę czekać....\"\r\nt MSG_143 \"Pobierz za pomocą przeglądarki\"\r\nt MSG_144 \"Tymczasowo zablokowany przez Microsoft za żądanie zbyt wielu pobrań - spróbuj ponownie później...\"\r\nt MSG_145 \"PowerShell 3.0 albo nowszy wymagany do uruchomienia tego skryptu.\"\r\nt MSG_146 \"Czy chcesz przejść do trybu online i go pobrać?\"\r\nt MSG_148 \"Uruchamianie skryptu pobierania...\"\r\nt MSG_149 \"Pobierz obraz ISO\"\r\nt MSG_150 \"Typ komputera, na którym chcesz użyć dysku rozruchowego. Przed stworzeniem dysku musisz sam określić, czy docelowy komputer posiada BIOS, czy UEFI, inaczej może się nie uruchomić.\"\r\nt MSG_151 \"'UEFI-CSM' oznacza, że urządzenie uruchomi się jedynie w trybie emulacji BIOSu (znanej jako 'Legacy Mode') w UEFI, ale nie w natywnym trybie UEFI.\"\r\nt MSG_152 \"'bez CSM' oznacza, że urządzenie uruchomi się jedynie w natywnym trybie UEFI, ale nie w trybie emulacji BIOSu (znanej jako 'Legacy Mode').\"\r\nt MSG_153 \"Wzorzec testowy: 0x%02X\"\r\nt MSG_154 \"Wzorzec testowy: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Wzorzec testowy: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Wzorzec testowy: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Ustawia docelowy system plików\"\r\nt MSG_158 \"Minimalny rozmiar jaki blok będzie zajmował w systemie plików\"\r\nt MSG_159 \"Użyj tego pola, aby ustawić etykietę dysku.\\nZnaki międzynarodowe są dozwolone.\"\r\nt MSG_160 \"Przełącz opcje zaawansowane\"\r\nt MSG_161 \"Sprawdź urządzenie pod kątem błędnych sektorów używając wzoru testowego\"\r\nt MSG_162 \"Odznacz to pole, aby użyć \\\"powolnej\\\" metody formatowania\"\r\nt MSG_163 \"Metoda, która zostanie użyta do stworzenia partycji\"\r\nt MSG_164 \"Metoda, która zostanie użyta, aby uczynić dysk rozruchowym\"\r\nt MSG_165 \"Kliknij, aby wybrać lub pobrać obraz...\"\r\nt MSG_166 \"Zaznacz to pole, aby zezwolić na wyświetlanie etykiet międzynarodowych i ustawić ikonę urządzenia (tworzy plik autorun.inf)\"\r\nt MSG_167 \"Zainstaluj bootloader UEFI, który przeprowadzi weryfikację typu MD5SUM na nośniku\"\r\nt MSG_169 \"Tworzy dodatkową, ukrytą partycję i próbuje wyrównać granice partycji.\\nTo może poprawić wykrywanie uruchamiania dla starszych BIOSów.\"\r\nt MSG_170 \"Włącza listowanie Dysków Twardych USB. UŻYWASZ NA WŁASNĄ ODPOWIEDZIALNOŚĆ!!!\"\r\nt MSG_171 \"Uruchom operację formatowania.\\nTo ZNISZCZY wszystkie dane na urządzeniu docelowym!\"\r\nt MSG_172 \"Nieprawidłowa sygnatura pobranego pliku\"\r\nt MSG_173 \"Kliknij, aby wybrać...\"\r\nt MSG_174 \"Rufus - niezawodne narzędzie do formatowania USB\"\r\nt MSG_175 \"Wersja %d.%d (Build %d)\"\r\nt MSG_176 \"Polskie tłumaczenie:\\\\line• Piotr Halama <http://halamix2.pl>\\\\line• Krzysztof J. Szklarski\\\\line• Jakub Zieciak\\\\line• Jakub Mierzejewski <mailto:jakmierzejewski@gmail.com>\"\r\nt MSG_177 \"Zgłaszaj błędy lub ulepszenia na:\"\r\nt MSG_178 \"Dodatkowe prawa autorskie:\"\r\nt MSG_179 \"Polityka aktualizacji:\"\r\nt MSG_180 \"Jeśli pozwolisz temu programowi szukać aktualizacji aplikacji, zgadzasz się na to, że następujące informacje mogą być zbierane na naszym serwerze (serwerach):\"\r\nt MSG_181 \"Architektura i wersja twojego systemu operacyjnego\"\r\nt MSG_182 \"Wersja aplikacji, z której korzystasz\"\r\nt MSG_183 \"Twój adres IP\"\r\nt MSG_184 \"W celu generowania poufnych statystyk użytkowania tego programu możemy przechowywać zebrane informacje \\\\b co najwyżej rok\\\\b0, jednak nie będziemy udostępniać żadnych z indywidualnych danych osobom trzecim.\"\r\nt MSG_185 \"Proces aktualizacji:\"\r\nt MSG_186 \"Rufus nie instaluje lub uruchamia procesów w tle, dlatego aktualizacje są sprawdzane wyłącznie przy starcie głównego okna aplikacji.\\\\line\\nDostęp do internetu jest wymagany podczas sprawdzania aktualizacji.\"\r\nt MSG_187 \"Obraz nieprawidłowy dla wybranej opcji rozruchowej\"\r\nt MSG_188 \"Obecny obraz nie pasuje do wybranej opcji rozruchowej. Proszę użyć innego obrazu lub wybrać inną opcję rozruchową.\"\r\nt MSG_189 \"Ten obraz ISO jest niekompatybilny z wybranym systemem plików\"\r\nt MSG_190 \"Wykryto niekompatybilny dysk\"\r\nt MSG_191 \"Postęp zapisu\"\r\nt MSG_192 \"Postęp odczytu\"\r\nt MSG_193 \"Pobrano %s\"\r\nt MSG_194 \"Nie można pobrać %s\"\r\nt MSG_195 \"Używanie wbudowanej wersji pliku(ów) %s\"\r\nt MSG_196 \"WAŻNE: TEN DYSK UŻYWA NIESTANDARDOWEGO ROZMIARU SEKTORA!\\n\\nStandardowe dyski używają 512-bajtowego rozmiaru sektora, lecz ten dysk używa %d-bajtowego. W wielu przypadkach oznacza to, że NIE będziesz mógł startować z tego dysku.\\nRufus może spróbować utworzyć dysk rozruchowy, ale NIE MA GWARANCJI, że to zadziała.\"\r\nt MSG_197 \"Wykryto niestandardowy rozmiar sektora\"\r\nt MSG_198 \"'Windows To Go' może zostać zainstalowany jedynie na dysku ze strukturą GPT jeżeli ma on ustawiony atrybut LOKALNY. Obecny dysk nie został wykryty jako LOKALNY.\"\r\nt MSG_199 \"Ta funkcja nie jest dostępna na tej platformie.\"\r\nt MSG_201 \"Anulowanie - Proszę czekać...\"\r\nt MSG_202 \"Skanowanie obrazu...\"\r\nt MSG_203 \"Niepowodzenie skanowania obrazu\"\r\nt MSG_204 \"Wykryto przestarzałe %s\"\r\nt MSG_205 \"Używany obraz: %s\"\r\nt MSG_206 \"Brak pliku %s\"\r\nt MSG_207 \"Nowy wolumin\"\r\nt MSG_208 \"znaleziono %d urządzenie\"\r\nt MSG_209 \"znaleziono %d urządzenia\"\r\nt MSG_210 \"Gotowy\"\r\nt MSG_211 \"Anulowano\"\r\nt MSG_212 \"NIEPOWODZENIE\"\r\nt MSG_213 \"Uruchamianie nowej aplikacji...\"\r\nt MSG_214 \"Niepowodzenie uruchomienia nowej aplikacji\"\r\nt MSG_215 \"Otwarto %s\"\r\nt MSG_216 \"Zapisano %s\"\r\nt MSG_217 \"Formatowanie: %s\"\r\nt MSG_218 \"Tworzenie systemu plików: Ukończono zadanie %d/%d\"\r\nt MSG_219 \"Naprawianie NTFS: %d%% ukończenia\"\r\nt MSG_220 \"Formatowanie (%s) - przewidywany czas %d:%02d...\"\r\nt MSG_221 \"Ustawianie Etykiety (%s)...\"\r\nt MSG_222 \"Formatowanie (%s)...\"\r\nt MSG_223 \"Naprawianie NTFS (Checkdisk)...\"\r\nt MSG_224 \"Czyszczenie struktur MBR/PBR/GPT...\"\r\nt MSG_225 \"Żądanie dostępu do dysku...\"\r\nt MSG_226 \"Analizowanie istniejących boot sektorów...\"\r\nt MSG_227 \"Zamykanie istniejącego woluminu...\"\r\nt MSG_228 \"Zapisywanie Master Boot Record...\"\r\nt MSG_229 \"Zapisywanie Partition Boot Record...\"\r\nt MSG_230 \"Kopiowanie plików DOS...\"\r\nt MSG_231 \"Kopiowanie plików ISO: %s\"\r\nt MSG_232 \"Ustawianie rozruchu Win7 EFI (%s)...\"\r\nt MSG_233 \"Finalizacja, proszę czekać...\"\r\nt MSG_234 \"Instalowanie Syslinux %s...\"\r\nt MSG_235 \"Błędne Sektory: %s %d/%d - %0.2f%% (%d/%d/%d błędów)\"\r\nt MSG_236 \"Błędne Sektory: Testowanie z losowym wzorem\"\r\nt MSG_237 \"Błędne Sektory: Testowanie z wzorem 0x%02X\"\r\nt MSG_238 \"Partycjonowanie (%s)...\"\r\nt MSG_239 \"Usuwanie partycji (%s)...\"\r\nt MSG_240 \"Sygnatura pobranej aktualizacji nie mogła zostać sprawdzona. To może oznaczać, że twój system jest nieprawidłowo skonfigurowany dla sprawdzania sygnatur lub wskazywać na pobrany złośliwy plik.\\n\\nPobrany plik zostanie usunięty. Proszę sprawdzić dziennik, żeby dowiedzieć się więcej.\"\r\nt MSG_241 \"Pobieranie: %s\"\r\nt MSG_242 \"Niepowodzenie pobierania pliku.\"\r\nt MSG_243 \"Sprawdzanie aktualizacji Rufusa...\"\r\nt MSG_244 \"Aktualizacje: Nie można połączyć z internetem\"\r\nt MSG_245 \"Aktualizacje: Nie można sprawdzić danych wersji\"\r\nt MSG_246 \"Jest dostępna nowa wersja Rufusa!\"\r\nt MSG_247 \"Nie znaleziono nowszej wersji Rufusa\"\r\nt MSG_248 \"Pomyślnie usunięto klucze rejestru aplikacji\"\r\nt MSG_249 \"Niepowodzenie usuwania kluczy rejestru aplikacji\"\r\nt MSG_250 \"Włączono %s\"\r\nt MSG_251 \"Wyłączono %s\"\r\nt MSG_252 \"Sprawdzanie rozmiaru\"\r\nt MSG_253 \"Wykrywanie dysków twardych\"\r\nt MSG_254 \"Siłowe formatowanie dużych FAT32\"\r\nt MSG_255 \"NoDriveTypeAutorun zostanie usunięte przy wyjściu\"\r\nt MSG_256 \"Fałszywe wykrywanie dysku\"\r\nt MSG_257 \"Wsparcie Joliet\"\r\nt MSG_258 \"Wsparcie Rock Ridge\"\r\nt MSG_259 \"Siłowa aktualizacja\"\r\nt MSG_260 \"Kompresja NTFS\"\r\nt MSG_261 \"Zapisywanie obrazu: %s\"\r\nt MSG_262 \"Wsparcie ISO\"\r\nt MSG_263 \"Użyj WŁAŚCIWEGO rozmiaru jednostek\"\r\nt MSG_264 \"Usuwanie folderu '%s'\"\r\nt MSG_265 \"Wykrywanie dysków VMWare\"\r\nt MSG_266 \"Tryb dual UEFI/BIOS\"\r\nt MSG_267 \"Zastosowywanie obrazu Windows: %s\"\r\nt MSG_268 \"Zastosowywanie obrazu Windows...\"\r\nt MSG_269 \"Zachowaj znaczniki czasu\"\r\nt MSG_270 \"Debugowanie USB\"\r\nt MSG_271 \"Obliczanie sum kontrolnych obrazu: %s\"\r\nt MSG_272 \"Oblicz sumy kontrolne MD5, SHA1 oraz SHA256 dla wybranego obrazu\"\r\nt MSG_273 \"Zmień język aplikacji\"\r\nt MSG_274 \"Wykryto obraz %s\"\r\nt MSG_275 \"Obraz, który wybrałeś to obraz 'ISOHybrid'. Oznacza to, że może zostać zapisany w trybie %s (kopia plików) lub trybie %s (obraz dysku).\\nRufus zaleca użycie trybu %s, abyś zawsze miał pełny dostęp do dysku po jego zapisaniu.\\nJednak jeśli napotkasz problemy podczas rozruchu możesz spróbować zapisać ten obraz ponownie w trybie %s.\\n\\nProszę wybrać tryb którego chcesz użyć do zapisania tego obrazu:\"\r\nt MSG_276 \"Zapisz w trybie %s (zalecane)\"\r\nt MSG_277 \"Zapisz w trybie %s\"\r\nt MSG_278 \"Sprawdzanie kolidujących procesów...\"\r\nt MSG_279 \"Niebootowalne\"\r\nt MSG_280 \"Obraz dysku lub ISO płyty\"\r\nt MSG_281 \"%s (Proszę wybrać)\"\r\nt MSG_282 \"Blokowanie dysku USB na wyłączność\"\r\nt MSG_283 \"Nieprawidłowa sygnatura\"\r\nt MSG_284 \"Pobrany plik wykonywalny nie posiada cyfrowej sygnatury.\"\r\nt MSG_285 \"Pobrany plik wykonywalny jest podpisany przez '%s'.\\nTo nie jest rozpoznawana przez nas sygnatura i może wskazywać na pewne formy złośliwych zachowań...\\nCzy na pewno chcesz uruchomić ten plik?\"\r\nt MSG_286 \"Zerowanie dysku: %s\"\r\nt MSG_287 \"Wykrywanie dysków wymiennych nie-USB\"\r\nt MSG_288 \"Brakujące uprawnienia administratora\"\r\nt MSG_289 \"Ta aplikacja może działać wyłącznie z uprawnieniami administratora\"\r\nt MSG_290 \"Indeksowanie plików\"\r\nt MSG_291 \"Wybór wersji\"\r\nt MSG_292 \"Proszę wybrać wersję Windowsa, którą chcesz zainstalować:\"\r\nt MSG_293 \"Niewspierana wersja Windowsa\"\r\nt MSG_294 \"Ta wersja Windowsa nie jest już wspierana przez Rufusa.\\nOstatnia wersja w pełni wspierana przez Rufusa: v%d.%d.\"\r\nt MSG_295 \"Uwaga: Nieoficjalna wersja\"\r\nt MSG_296 \"Ta wersja Rufusa nie została stworzona przez oficjalnego dewelopera(ów).\\n\\nCzy na pewno chcesz ją uruchomić?\"\r\nt MSG_297 \"Wykryto obcięte ISO\"\r\nt MSG_298 \"Rozmiar pliku ISO, który wybrałeś nie zgadza się z jego deklarowanym rozmiarem: brakuje %s danych!\\n\\nJeżeli uzyskałeś ten plik z internetu, powinieneś spróbować pobrać nową kopię oraz zweryfikować, że sumy kontrolne MD5 lub SHA zgadzają się z oficjalnymi.\\n\\nZauważ, że możesz obliczyć sumy MD5 lub SHA w Rufusie klikając przycisk (✓).\"\r\nt MSG_299 \"Błąd sprawdzania poprawności znacznika czasu\"\r\nt MSG_300 \"Rufus nie był w stanie potwierdzić, że znacznik czasu pobranej aktualizacji jest nowszy niż ten, który jest dla obecnego pliku wykonywalnego.\\n\\nAby zapobiec potencjalnym atakom proces aktualizacji został przerwany, a pobrana aktualizacja zostanie usunięta. Proszę sprawdzić dziennik dla większej ilości szczegółów.\"\r\nt MSG_301 \"Pokaż ustawienia aplikacji\"\r\nt MSG_302 \"Pokaż informacje o tej aplikacji\"\r\nt MSG_303 \"Pokaż dziennik\"\r\nt MSG_304 \"Utwórz obraz dysku wybranego urządzenia\"\r\nt MSG_305 \"Użyj tej opcji, aby wskazać, czy chcesz użyć tego dysku do instalacji Windowsa na innym dysku, czy chcesz uruchomić Windowsa bezpośrednio z dysku (Windows To Go).\"\r\nt MSG_306 \"Szybkie zerowanie dysku: %s\"\r\nt MSG_307 \"to może chwilę potrwać\"\r\nt MSG_308 \"Detekcja VHD\"\r\nt MSG_309 \"Skompresowane archiwum\"\r\nt MSG_310 \"Wybrany plik ISO używa UEFI i jest na tyle mały, że można go zapisać jako partycję systemową EFI (ESP). Zapisanie na ESP, zamiast zapisywania na ogólnej partycji danych zajmującej cały dysk, może być preferowane dla niektórych typów instalacji.\\n\\nProszę wybrać tryb, w którym chcesz zapisać ten obraz:\"\r\nt MSG_311 \"Użyj %s w głównym oknie aplikacji, żeby włączyć.\"\r\nt MSG_312 \"Dodatkowe hasze (SHA512)\"\r\nt MSG_313 \"Zapisz do VHD\"\r\nt MSG_314 \"Oblicz sumy kontrolne obrazu\"\r\nt MSG_315 \"Wiele przycisków\"\r\nt MSG_316 \"Liczba przebiegów\"\r\nt MSG_317 \"Identyfikator dysku\"\r\nt MSG_318 \"Domyślny priorytet wątku: %d\"\r\nt MSG_319 \"Zignoruj znacznik 'boot'\"\r\nt MSG_320 \"Odświeżanie układu partycji (%s)...\"\r\nt MSG_321 \"Obraz, który został wybrany jest Hybrydą ISO i nie jest zgodny z trybem kopiowania ISO.\\nWynikiem tego będzie przymusowe zapisywanie w trybie DD.\"\r\nt MSG_322 \"Nie można otworzyć '%s'\"\r\nt MSG_325 \"Zastosuj niestandardowe ustawienia Windows: %s\"\r\nt MSG_326 \"Aplikowanie ustawień użytkownika...\"\r\nt MSG_328 \"Niestandardowe ustawienia Windows?\"\r\nt MSG_329 \"Dezaktywuj wymaganie niezbędnej minimalnej ilości pamięci RAM (4GB+), Secure Boot i TPM 2.0\"\r\nt MSG_330 \"Usuń wymaganie konta Microsoft online\"\r\nt MSG_331 \"Wyłącz zbieranie osobistych danych\"\r\nt MSG_332 \"Zapobiegnij używania wewnętrznego magazynu danych przez Windows To Go\"\r\nt MSG_333 \"Stwórz konto lokalne o nazwie użytkownika:\"\r\nt MSG_334 \"Ustaw taką samą lokalizację i wartości jak obecny użytkownik\"\r\nt MSG_335 \"Dezaktywuj automatyczne szyfrowanie BitLocker\"\r\nt MSG_336 \"Stały dziennik (log)\"\r\nt MSG_337 \"Aby móc korzystać z tej funkcji, należy pobrać dodatkowy plik (\\\"%s\\\") z witryny firmy Microsoft:\\n- Wybierz opcję \\\"Tak\\\", aby pobrać pliku z internetu\\n- Wybierz opcję \\\"Nie\\\", aby anulować operację\\n\\nUwaga: Plik zostanie pobrany do folderu aplikacji i będzie użyty ponownie, gdy będzie dostępny.\"\r\nt MSG_338 \"Wykryto unieważniony bootloader UEFI\"\r\nt MSG_339 \"Rufus wykrył, że wybrany plik ISO zawiera bootloader UEFI, który został unieważniony, i który wygeneruje %s. gdy włączony zostanie \\\"Secure Boot\\\" w pełni zaktualizowanym systemie UEFI.\\n\\n- Jeśli uzyskałeś ten obraz ISO z niezaufanego źródła, powinieneś rozważyć możliwość, że może on zawierać złośliwe oprogramowanie dla UEFI i unikać jego uruchamiania.\\n- Jeśli uzyskałeś go z zaufanego źródła, powinieneś spróbować znaleźć nowszą wersję, która nie wygeneruje tego ostrzeżenia.\"\r\nt MSG_340 \"ekran \\\"Naruszenie Bezpieczeństwa\\\"\"\r\nt MSG_341 \"\\\"Ekran odzyskiwania systemu Windows\\\" (BSOD) z '%s'\"\r\nt MSG_342 \"Zkompresowany obraz VHDX\"\r\nt MSG_343 \"Zdekompresowany obraz VHD\"\r\nt MSG_344 \"Obraz typu \\\"aktualizacja full flush\\\"\"\r\nt MSG_345 \"Aby móc korzystać z tej funkcji, należy pobrać pewne dodatkowe dane od firmy Microsoft:\\n- Wybierz opcję „Tak”, aby połączyć się z Internetem i pobrać plik\\n- Wybierz opcję „Nie”, aby anulować operację\"\r\nt MSG_346 \"Ogranicz system Windows do trybu S (NIEZGODNY z obejściem konta online)\"\r\nt MSG_347 \"Tryb eksperta\"\r\nt MSG_348 \"Wypakowywanie plików z archiwum: %s\"\r\nt MSG_349 \"Użyj Rufus MBR\"\r\nt MSG_900 \"Rufus to narzędzie, które pomaga formatować i tworzyć dyski rozruchowe flash USB, takie jak klucze USB, pendrive-y itp.\"\r\nt MSG_901 \"Oficjalna strona: %s\"\r\nt MSG_902 \"Kod źródłowy: %s\"\r\nt MSG_903 \"Zmiany: %s\"\r\nt MSG_904 \"Ta aplikacja jest objęta licencją na warunkach licencji publicznej GNU (GPL) w wersji 3.\\nZ obacz https://www.gnu.org/licenses/gpl-3.0.html, aby uzyskać szczegółowe informacje.\"\r\nt MSG_910 \"Sformatuj nośnik używając: FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Stwórz nośnik rozruchowy USB FreeDOS\"\r\nt MSG_912 \"Twórz dyski rozruchowe z obrazów ISO (Windows, Linux itp.)\"\r\nt MSG_913 \"Twórz dyski rozruchowe z obrazów dysków, włączając skompresowane\"\r\nt MSG_914 \"Stwórz dysk rozruchowy BIOS lub UEFI, włączając bootowalny dysk UEFI NTFS\"\r\nt MSG_915 \"Stwórz dysk 'Windows To Go'\"\r\nt MSG_916 \"Twórz dyski instalacyjne systemu Windows 11 dla komputerów, które nie posiadają modułu TPM ani Secure Boot\"\r\nt MSG_917 \"Utwórz trwałe partycje Linux\"\r\nt MSG_918 \"Stwórz obraz VHD/DD z wybranego dysku\"\r\nt MSG_919 \"Oblicz sumy kontrolne MD5, SHA-1, SHA-256 i SHA-512 dla wybranego obrazu\"\r\nt MSG_920 \"Sprawdź dysk pod względem spójności danych lub wykryj \\\"nieoryginalny\\\" pendrive\"\r\nt MSG_921 \"Pobierz oficjalny obraz ISO systemu Microsoft Windows\"\r\nt MSG_922 \"Ściągnij obrazy ISO UEFI Shell\"\r\n\r\n#########################################################################\r\nl \"pt-BR\" \"Portuguese Brazilian (Português do Brasil)\" 0x0416\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Sobre o Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licença\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Propriedades do Drive\"\r\nt IDS_DEVICE_TXT \"Dispositivo\"\r\nt IDS_BOOT_SELECTION_TXT \"Seleção de Boot\"\r\nt IDC_SELECT \"Selecionar\"\r\nt IDS_IMAGE_OPTION_TXT \"Opções da Imagem\"\r\nt IDS_PARTITION_TYPE_TXT \"Esquema de partição\"\r\nt IDS_TARGET_SYSTEM_TXT \"Sistema de destino\"\r\nt IDC_LIST_USB_HDD \"Listar Discos Rígidos USB\"\r\nt IDC_OLD_BIOS_FIXES \"Opções de compatibilidade para BIOSs antigos\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Habilitar validação de mídia UEFI\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Opções de formatação\"\r\nt IDS_FILE_SYSTEM_TXT \"Sistema de arquivos\"\r\nt IDS_CLUSTER_SIZE_TXT \"Tamanho do cluster\"\r\nt IDS_LABEL_TXT \"Nome do volume\"\r\nt IDC_QUICK_FORMAT \"Formatação rápida\"\r\nt IDC_BAD_BLOCKS \"Procurar blocos defeituosos\"\r\nt IDC_EXTENDED_LABEL \"Criar arquivos de nome estendido e ícone\"\r\nt IDCANCEL \"Fechar\"\r\nt IDC_START \"Iniciar\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Fechar\"\r\nt IDD_LICENSE \"Licença do Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Fechar\"\r\nt IDD_LOG \"Histórico de eventos\"\r\nt IDC_LOG_CLEAR \"Limpar\"\r\nt IDC_LOG_SAVE \"Guardar\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Fechar\"\r\nt IDD_NEW_VERSION \"Procurar atualizações do Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Nova versão disponível. Por favor, faça o download da última versão!\"\r\nt IDC_WEBSITE \"Clique aqui para ir ao site do Rufus\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Notas de Lançamento\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Baixar\"\r\nt IDC_DOWNLOAD \"Baixar\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Mais informações\"\r\nt IDYES \"Sim\"\r\nt IDNO \"Não\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Fechar\"\r\nt IDD_UPDATE_POLICY \"Configurações e política de atualização\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Configurações\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Procurar atualizações\"\r\nt IDS_INCLUDE_BETAS_TXT \"Incluir versões beta\"\r\nt IDC_CHECK_NOW \"Procurar\"\r\n\r\nt MSG_001 \"Outra instância detectada\"\r\nt MSG_002 \"Outro aplicativo Rufus está em execução.\\nFeche o primeiro aplicativo antes de executar outro.\"\r\nt MSG_003 \"AVISO: TODOS OS DADOS EM %s SERÃO ELIMINADOS.\\nPara continuar, clique em OK. Para sair da operação, clique em CANCELAR.\"\r\nt MSG_004 \"Política de atualização do Rufus\"\r\nt MSG_005 \"Permitir que o Rufus procure atualizações na Internet?\"\r\nt MSG_006 \"Fechar\"\r\nt MSG_007 \"Cancelar\"\r\nt MSG_008 \"Sim\"\r\nt MSG_009 \"Não\"\r\nt MSG_010 \"Foram encontrados blocos defeituosos\"\r\nt MSG_011 \"Verificação completada: %d bloco(s) defeituoso(s) encontrado(s)\\n  %d erros de leitura\\n  %d erros de gravação\\n  %d erros de corrupção\"\r\nt MSG_012 \"%s\\nMais informações disponíveis em:\\n%s\"\r\nt MSG_013 \"Desativado\"\r\nt MSG_014 \"Diariamente\"\r\nt MSG_015 \"Semanalmente\"\r\nt MSG_016 \"Mensalmente\"\r\nt MSG_017 \"Personalizado\"\r\nt MSG_018 \"Sua versão: %d.%d (Build %d)\"\r\nt MSG_019 \"Última versão: %d.%d (Build %d)\"\r\nt MSG_027 \"quilobytes\"\r\nt MSG_029 \"Padrão\"\r\nt MSG_030 \"%s (Padrão)\"\r\nt MSG_031 \"BIOS (ou UEFI-CSM)\"\r\nt MSG_032 \"UEFI (não CSM)\"\r\nt MSG_033 \"BIOS ou UEFI\"\r\nt MSG_034 \"%d passada\"\r\nt MSG_035 \"%d passadas %s\"\r\nt MSG_036 \"Imagem ISO\"\r\nt MSG_037 \"Aplicativo\"\r\nt MSG_038 \"Abortar\"\r\nt MSG_039 \"Iniciar\"\r\nt MSG_040 \"Baixar\"\r\nt MSG_041 \"Operação cancelada pelo usuário\"\r\nt MSG_042 \"Erro\"\r\nt MSG_043 \"Erro: %s\"\r\nt MSG_044 \"Download do arquivo\"\r\nt MSG_045 \"Dispositivo de armazenamento USB (Genérico)\"\r\nt MSG_046 \"%s (Disco %d) [%s]\"\r\nt MSG_047 \"Múltiplas Partições\"\r\nt MSG_048 \"Rufus - Limpando buffers\"\r\nt MSG_049 \"Rufus - Cancelamento\"\r\nt MSG_050 \"Sucesso.\"\r\nt MSG_051 \"Erro indeterminado durante a formatação.\"\r\nt MSG_052 \"Não é possível usar o sistema de arquivos selecionado para esta mídia.\"\r\nt MSG_053 \"Acesso ao dispositivo negado.\"\r\nt MSG_054 \"A mídia está protegida contra gravação.\"\r\nt MSG_055 \"Outro processo está usando o dispositivo. Feche qualquer outro processo que possa estar acessando o dispositivo.\"\r\nt MSG_056 \"Formatação rápida não está disponível para este dispositivo.\"\r\nt MSG_057 \"O nome do volume não é válido.\"\r\nt MSG_058 \"O identificador do dispositivo não é válido.\"\r\nt MSG_059 \"O tamanho do cluster selecionado não é válido para este dispositivo.\"\r\nt MSG_060 \"O tamanho do volume não é válido.\"\r\nt MSG_061 \"Por favor, insira uma mídia removível no drive.\"\r\nt MSG_062 \"Comando não suportado.\"\r\nt MSG_063 \"Erro na alocação de memória.\"\r\nt MSG_064 \"Erro de leitura.\"\r\nt MSG_065 \"Erro de gravação.\"\r\nt MSG_066 \"Falha na instalação\"\r\nt MSG_067 \"Impossível abrir a mídia. Ela pode estar sendo utilizada por outro processo. Por favor, reconecte a mídia e tente novamente.\"\r\nt MSG_068 \"Erro ao particionar o drive.\"\r\nt MSG_069 \"Não é possível copiar arquivos para o drive de destino.\"\r\nt MSG_070 \"Cancelado pelo usuário.\"\r\nt MSG_071 \"Impossível iniciar thread.\"\r\nt MSG_072 \"A verificação de blocos defeituosos foi interrompida.\"\r\nt MSG_073 \"Falha na análise da imagem ISO.\"\r\nt MSG_074 \"Falha na extração da imagem ISO.\"\r\nt MSG_075 \"Impossível remontar o volume.\"\r\nt MSG_076 \"Impossível corrigir/configurar arquivos para inicialização.\"\r\nt MSG_077 \"Impossível atribuir letra de unidade.\"\r\nt MSG_078 \"Impossível montar o volume GUID.\"\r\nt MSG_079 \"O dispositivo não está pronto.\"\r\nt MSG_080 \"O Rufus detectou que o Windows ainda está limpando seus buffers internos no dispositivo USB.\\n\\nDependendo da velocidade do dispositivo USB, esta operação pode demorar muito tempo para terminar, especialmente para arquivos grandes.\\n\\nRecomendamos que espere o Windows terminar para evitar corrupção de dados. Mas, se já está cansado de esperar, você pode simplesmente desconectar o dispositivo...\"\r\nt MSG_081 \"Imagem não suportada\"\r\nt MSG_082 \"Esta imagem não é inicializável ou utiliza um método de inicialização ou compressão não suportado pelo Rufus...\"\r\nt MSG_083 \"Substituir %s?\"\r\nt MSG_084 \"Parece que esta imagem ISO usa uma versão obsoleta do arquivo '%s'.\\nIsso pode fazer com que os menus de inicialização não sejam exibidos corretamente.\\n\\nO Rufus pode baixar uma versão mais recente para resolver esse problema:\\n- Selecione 'Sim' para se conectar à Internet e baixar o arquivo\\n- Selecione 'Não' para deixar o arquivo ISO tal como está\\nSe não sabe o que fazer, é recomendado selecionar 'Sim'.\\n\\nNota: O novo arquivo será baixado na pasta atual e, caso exista um arquivo\\n '%s' nela, ele será reutilizado automaticamente.\"\r\nt MSG_085 \"Baixando %s\"\r\nt MSG_086 \"Nenhuma imagem ISO foi selecionada\"\r\nt MSG_087 \"para %s NAND\"\r\nt MSG_088 \"Imagem é muito grande\"\r\nt MSG_089 \"A imagem é muito grande para o destino selecionado.\"\r\nt MSG_090 \"ISO não suportada\"\r\nt MSG_091 \"Quando se usa UEFI como tipo de destino, só são suportadas imagens ISO inicializáveis do tipo EFI. Selecione uma imagem ISO inicializável do tipo EFI ou altere o tipo de destino para BIOS.\"\r\nt MSG_092 \"Sistema de arquivos não suportado\"\r\nt MSG_093 \"IMPORTANTE: ESTE DRIVE CONTÉM MÚLTIPLAS PARTIÇÕES!!\\n\\nIsso pode incluir partições/volumes que não estão listados, ou até mesmo visíveis para o Windows. Se você deseja prosseguir, você é responsável por qualquer perda de dados nessas partições.\"\r\nt MSG_094 \"Múltiplas partições detectadas\"\r\nt MSG_095 \"Imagem DD\"\r\nt MSG_096 \"O sistema de arquivos selecionado não pode ser usado com este tipo de ISO. Por favor, selecione outro sistema de arquivos ou use outra ISO.\"\r\nt MSG_097 \"'%s' só pode ser aplicado se o sistema de arquivos for NTFS.\"\r\nt MSG_098 \"IMPORTANTE: Você está tentando instalar 'Windows To Go', porém o drive de destino não tem o atributo 'FIXED'. Portanto, é possível que o Windows trave durante a inicialização, pois a Microsoft não o desenvolveu para funcionar em drives que, em lugar daquele, tenham o atributo 'REMOVABLE'. \\n\\nVocê ainda deseja continuar?\\n\\nNota: O atributo 'FIXED/REMOVABLE' é uma propriedade do hardware que só pode ser alterada utilizando-se ferramentas personalizadas do fabricante do drive. No entanto, essas ferramentas QUASE NUNCA são disponibilizadas para o público...\"\r\nt MSG_099 \"Limitação do sistema de arquivos\"\r\nt MSG_100 \"Essa imagem ISO contém um arquivo maior que 4 GB, que é mais que o tamanho máximo permitido para um sistema de arquivos FAT ou FAT32.\"\r\nt MSG_101 \"Falta o suporte para WIM\"\r\nt MSG_102 \"A sua plataforma não pode extrair arquivos de arquivos WIM. A extração de WIM é requerida para criar dispositivos USB inicializáveis do tipo EFI com Windows 7 e Windows Vista. Você pode corrigir isso instalando uma versão recente do 7-Zip.\\nQuer visitar a página de download do 7-zip?\"\r\nt MSG_103 \"Baixar %s?\"\r\nt MSG_104 \"%s ou posterior requer que esteja instalado um arquivo '%s'.\\nUma vez que este arquivo tem mais de 100 KB e está sempre presente nas \\nimagens ISO %s, o Rufus não o inclui na sua distribuição.\\n\\nO Rufus pode baixar o arquivo em falta:\\n- Selecione 'Sim' para se conectar à Internet e baixar o arquivo\\n- Selecione 'Não' se deseja copiar manualmente esse arquivo para o drive mais tarde\\n\\nNota: O arquivo será baixado na pasta atual e, caso exista um \\n arquivo '%s' nela, ele será reutilizado automaticamente.\"\r\nt MSG_105 \"Cancelar agora pode deixar o dispositivo INUTILIZÁVEL.\\nSe quer mesmo cancelar, clique em SIM. Caso contrário, clique em NÃO.\"\r\nt MSG_106 \"Selecione a pasta\"\r\nt MSG_107 \"Todos os arquivos\"\r\nt MSG_108 \"Registro de eventos do Rufus\"\r\nt MSG_109 \"0x%02X (Disco %d)\"\r\nt MSG_110 \"O MS-DOS não se inicializa a partir de um drive com um Tamanho do cluster de 64 quilobytes.\\nPor favor, altere o Tamanho do cluster ou use o FreeDOS.\"\r\nt MSG_111 \"Tamanho do cluster incompatível\"\r\nt MSG_112 \"Formatar um volume UDF de tamanho grande pode demorar muito tempo. À velocidade de USB 2.0, o tempo estimado de formatação é de %d:%02d, durante o qual a barra de progresso parecerá congelada. Por favor, seja paciente!\"\r\nt MSG_113 \"Volume UDF de tamanho grande\"\r\nt MSG_114 \"Esta imagem usa Syslinux %s%s, mas este aplicativo inclui somente os arquivos de instalação para Syslinux %s%s.\\n\\nComo novas versões de Syslinux não são compatíveis entre si, e não seria seja possível para o Rufus incluir todas elas, dois arquivos adicionais devem ser baixados a partir da Internet ('ldlinux.sys' e 'ldlinux.bss'):\\n- Selecione 'Sim' para se conectar à Internet e baixar esses arquivos\\n- Selecione 'Não' para cancelar a operação\\n\\nNota: Os arquivos serão baixados no diretório atual do aplicativo e serão reutilizados automaticamente se estiverem presentes.\"\r\nt MSG_115 \"Download necessário\"\r\nt MSG_116 \"Esta imagem usa o Grub %s, mas este aplicativo inclui somente os arquivos de instalação para Grub %s.\\n\\nComo novas versões do Grub podem não ser compatíveis entre si, e que não é possível incluí-las todas, o Rufus tentará localizar uma versão do arquivo de instalação do Grub ('core.img') que corresponda ao da sua imagem:\\n- Selecione 'Sim' para se conectar à Internet e tentar baixá-lo\\n- Selecione 'Não' para usar a versão padrão do Rufus\\n- Selecione 'Cancelar' para abortar a operação\\n\\nNota: O arquivo será baixado no diretório atual do aplicativo e será reutilizado automaticamente se estiver presente. Se nenhum arquivo correspondente puder ser encontrado online, será usada a versão padrão.\"\r\nt MSG_117 \"Instalação padrão do Windows\"\r\nt MSG_119 \"propriedades avançadas do drive\"\r\nt MSG_120 \"opções avançadas de formatação\"\r\nt MSG_121 \"Exibir %s\"\r\nt MSG_122 \"Esconder %s\"\r\nt MSG_123 \"Tamanho da partição persistente\"\r\nt MSG_124 \"Sem persistência\"\r\nt MSG_125 \"Defina o tamanho da partição persistente para mídia USB ativa. Definir o tamanho como 0 desativa a partição persistente.\"\r\nt MSG_126 \"Defina as unidades de tamanho da partição.\"\r\nt MSG_127 \"Não mostrar esta mensagem novamente\"\r\nt MSG_128 \"Aviso importante sobre %s\"\r\nt MSG_129 \"Você acabou de criar uma mídia que usa o carregador de inicialização UEFI: NTFS. Lembre-se de que, para inicializar esta mídia, VOCÊ DEVE DESABILITAR O BOOT SEGURO.\\nPara detalhes sobre por que isso é necessário, consulte o botão \\\"Mais informações\\\" abaixo.\"\r\nt MSG_130 \"Seleção de imagem do Windows\"\r\nt MSG_131 \"Este ISO contém várias imagens do Windows.\\nPor favor, selecione a imagem que você deseja usar para esta instalação:\"\r\nt MSG_132 \"Outro programa ou processo está acessando esta unidade. Você quer formatá-lo mesmo assim?\"\r\nt MSG_133 \"Rufus detectou que você está tentando criar uma mídia do Windows To Go com base em uma ISO 1809.\\nDevido a um *MICROSOFT BUG*, esta mídia irá travar durante a inicialização do Windows (Tela Azul da Morte), a menos que você substitua manualmente o arquivo 'WppRecorder.sys' por uma versão 1803.\\nObserve também que a razão pela qual o Rufus não pode corrigir isso automaticamente para você é que 'WppRecorder.sys' é um arquivo protegido por direitos autorais da Microsoft, portanto, não podemos incorporar legalmente uma cópia do arquivo no aplicativo...\"\r\nt MSG_134 \"Como o MBR foi selecionado para o esquema de partição, o Rufus só pode criar uma partição de até 2 TB nessa mídia, o que deixará %s de espaço em disco indisponível.\\n\\nVocê tem certeza que quer continuar?\"\r\nt MSG_135 \"Versão\"\r\nt MSG_136 \"Lançamento\"\r\nt MSG_137 \"Edição\"\r\nt MSG_138 \"Idioma\"\r\nt MSG_139 \"Arquitetura\"\r\nt MSG_140 \"Continuar\"\r\nt MSG_141 \"Voltar\"\r\nt MSG_142 \"Por favor, aguarde...\"\r\nt MSG_143 \"Baixar usando um navegador\"\r\nt MSG_144 \"Download de ISOs do Windows não está disponível porque a Microsoft alterou o seu site para evitá-lo.\"\r\nt MSG_145 \"PowerShell 3.0 ou superior é requerido para rodar esse script.\"\r\nt MSG_146 \"Deseja ir online e baixar?\"\r\nt MSG_148 \"Rodando o script de download...\"\r\nt MSG_149 \"Baixar imagem ISO\"\r\nt MSG_150 \"Tipo de computador no qual deseja utilizar o disco de inicialização. É de sua responsabilidade determinar se o destino utiliza BIOS ou UEFI antes de começar a criar um disco, caso contrário poderá haver falhas.\"\r\nt MSG_151 \"'UEFI-CSM' significa que o dispositivo apenas irá inicializar no modo BIOS emulação (também conhecido como 'Legacy Mode') quando UEFI, e não UEFI nativo.\"\r\nt MSG_152 \"'não CSM' significa que o dispositivo irá inicializar apenas no modo UEFI nativo, e não no modo BIOS emulação (também conhecido como 'Legacy Mode').\"\r\nt MSG_153 \"Padrão de teste: 0x%02X\"\r\nt MSG_154 \"Padrão de teste: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Padrão de teste: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Padrão de teste: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Define o sistema de arquivos de destino\"\r\nt MSG_158 \"Tamanho mínimo que um bloco de dados ocupará no sistema de arquivos\"\r\nt MSG_159 \"Use este campo para definir o nome do drive.\\nCaracteres acentuados são aceitos.\"\r\nt MSG_160 \"Exibir opções avançadas\"\r\nt MSG_161 \"Verificar o dispositivo para blocos defeituosos usando um padrão de teste\"\r\nt MSG_162 \"Desmarque esta opção para usar o método de formatação \\\"lento\\\"\"\r\nt MSG_163 \"Método que será usado para criar partições\"\r\nt MSG_164 \"Método que será usado para tornar a unidade inicializável\"\r\nt MSG_165 \"Clique para selecionar ou baixar uma imagem...\"\r\nt MSG_166 \"Selecione esta opção para permitir a exibição de caracteres acentuados e atribuir um ícone para a unidade (cria um arquivo autorun.inf)\"\r\nt MSG_167 \"Instalar um carregador de inicialização que realizará validação da mídia usando MD5Sum\"\r\nt MSG_169 \"Criar uma partição oculta extra e tentar alinhar os limites das partições.\\nIsso pode melhorar a detecção de inicialização para BIOSs mais antigos.\"\r\nt MSG_170 \"Ativar a listagem de discos rígidos portáteis USB. USE POR SUA CONTA E RISCO!!!\"\r\nt MSG_171 \"Iniciar a operação de formatação.\\nTodos os dados no dispositivo serão DESTRUÍDOS!\"\r\nt MSG_172 \"Assinatura do download inválida\"\r\nt MSG_173 \"Clique para selecionar...\"\r\nt MSG_174 \"Rufus - O Utilitário de Formatação USB Confiável\"\r\nt MSG_175 \"Versão %d.%d (Build %d)\"\r\nt MSG_176 \"Tradutores:\\\\line• Tiago Rinaldi <mailto:trinaldi@gmail.com>\\\\line• Chateaubriand Vieira Moura <mailto:chateaubriand@ifse.com.br>\\\\line• Maison da Silva <mailto:maisonmdsgreen@hotmail.com>\\\\line• Marcos Mello <mailto:marcosfrm@gmail.com>\"\r\nt MSG_177 \"Relate bugs ou solicite aprimoramentos em:\"\r\nt MSG_178 \"Direitos Autorais Adicionais:\"\r\nt MSG_179 \"Política de Atualização:\"\r\nt MSG_180 \"Se você optar por permitir que este programa verifique se há atualizações do aplicativo, você concorda que as seguintes informações possam ser coletadas em nosso(s) servidor(es):\"\r\nt MSG_181 \"A arquitetura e versão do seu sistema operacional\"\r\nt MSG_182 \"A versão do aplicativo que você usa\"\r\nt MSG_183 \"Seu endereço de IP\"\r\nt MSG_184 \"A fim de gerar estatísticas de uso privadas, as informações recolhidas podem ser retidas, \\\\b por até um ano\\\\b0 . A menos que assim seja requerido por lei, não será transmitida nenhuma dessas informações a terceiros.\"\r\nt MSG_185 \"Processo de Atualização:\"\r\nt MSG_186 \"O Rufus não instala nem executa serviços em segundo plano. Portanto, as verificações de atualização só se realizam quando o aplicativo principal está em execução.\\\\line\\nO acesso à Internet, é claro, é necessário ao verificar atualizações.\"\r\nt MSG_187 \"Imagem inválida para a opção de inicialização selecionada\"\r\nt MSG_188 \"A imagem atual não combina com a opção de inicialização selecionada. Por favor, use uma imagem diferente ou escolha uma opção de inicialização diferente.\"\r\nt MSG_189 \"Esta imagem ISO não é compatível com o sistema de arquivos selecionado\"\r\nt MSG_190 \"Drive incompatível detectado\"\r\nt MSG_191 \"Verificação de escrita\"\r\nt MSG_192 \"Verificação de leitura\"\r\nt MSG_193 \"Baixado(s) %s\"\r\nt MSG_194 \"Não foi possível baixar %s\"\r\nt MSG_195 \"Usando a versão incorporada do(s) arquivo(s) %s\"\r\nt MSG_196 \"IMPORTANTE: ESTE DRIVE USA UM TAMANHO DE SETOR FORA DO PADRÃO!\\n\\nDrives convencionais usam um tamanho de setor de 512 bytes, mas este usa um de %d bytes. Em muitos casos, isso significa que você NÃO poderá inicializar a partir deste drive.\\nO Rufus pode tentar criar um drive inicializável, mas não há NENHUMA garantia de que ele funcionará.\"\r\nt MSG_197 \"Detectado tamanho de setor fora do padrão\"\r\nt MSG_198 \"'Windows To Go' só pode ser instalado em um drive particionado como GPT se ele tiver o atributo FIXO ativo. O drive atual não apresenta o atributo FIXO.\"\r\nt MSG_199 \"Este recurso não está disponível nesta plataforma.\"\r\nt MSG_201 \"Cancelando - Por favor, aguarde...\"\r\nt MSG_202 \"Escaneando a imagem...\"\r\nt MSG_203 \"Falha ao escanear a imagem\"\r\nt MSG_204 \"%s obsoleto detectado\"\r\nt MSG_205 \"Usando a imagem: %s\"\r\nt MSG_206 \"Falta o arquivo %s\"\r\nt MSG_207 \"Novo Volume\"\r\nt MSG_208 \"%d dispositivo encontrado\"\r\nt MSG_209 \"%d dispositivos encontrados\"\r\nt MSG_210 \"PRONTO\"\r\nt MSG_211 \"Operação cancelada\"\r\nt MSG_212 \"A operação falhou\"\r\nt MSG_213 \"Iniciando o novo aplicativo...\"\r\nt MSG_214 \"Falha ao iniciar o novo aplicativo\"\r\nt MSG_215 \"%s aberto\"\r\nt MSG_216 \"%s salvo\"\r\nt MSG_217 \"Formatando: %s\"\r\nt MSG_218 \"Criando sistema de arquivos: Tarefa %d/%d completada\"\r\nt MSG_219 \"Reparo do NTFS: %d%% completado(s)\"\r\nt MSG_220 \"Formatando (%s) - duração estimada %d:%02d...\"\r\nt MSG_221 \"Atribuindo o nome do volume (%s)...\"\r\nt MSG_222 \"Formatando (%s)...\"\r\nt MSG_223 \"Reparo do NTFS (Checkdisk)...\"\r\nt MSG_224 \"Apagando as estruturas MBR/PBR/GPT...\"\r\nt MSG_225 \"Solicitando acesso ao disco...\"\r\nt MSG_226 \"Analisando registros de inicialização existentes...\"\r\nt MSG_227 \"Fechando o volume existente...\"\r\nt MSG_228 \"Escrevendo o registro mestre de inicialização (Master Boot Record)...\"\r\nt MSG_229 \"Escrevendo o registro de inicialização de partição (Partition Boot Record)...\"\r\nt MSG_230 \"Copiando arquivos do DOS...\"\r\nt MSG_231 \"Copiando arquivos da ISO: %s\"\r\nt MSG_232 \"Configuração de inicialização EFI do Win7 (%s)...\"\r\nt MSG_233 \"Finalizando, por favor aguarde...\"\r\nt MSG_234 \"Instalando Syslinux %d...\"\r\nt MSG_235 \"Blocos Defeituosos: %s %d/%d - %0.2f%% (%d/%d/%d erros)\"\r\nt MSG_236 \"Blocos Defeituosos: Testando com padrão aleatório\"\r\nt MSG_237 \"Blocos Defeituosos: Testando com padrão 0x%02X\"\r\nt MSG_238 \"Particionando (%s)...\"\r\nt MSG_239 \"Apagando partições (%s)...\"\r\nt MSG_240 \"A assinatura da atualização baixada não pode ser validada. Isso pode significar que seu sistema está configurado incorretamente para validação de assinatura ou indica um download malicioso.\\n\\nO download será excluído. Verifique o registro para obter mais detalhes.\"\r\nt MSG_241 \"Baixando: %s\"\r\nt MSG_242 \"Falha ao baixar o arquivo.\"\r\nt MSG_243 \"Procurando atualizações do Rufus...\"\r\nt MSG_244 \"Atualizações: Não é possível conectar-se à Internet\"\r\nt MSG_245 \"Atualizações: Não foi possível acessar dados da versão\"\r\nt MSG_246 \"Uma nova versão do Rufus está disponível!\"\r\nt MSG_247 \"Nenhuma nova versão do Rufus foi encontrada\"\r\nt MSG_248 \"As chaves de registro do aplicativo foram apagadas com êxito\"\r\nt MSG_249 \"Falha ao apagar as chaves de registro do aplicativo\"\r\nt MSG_250 \"%s ativado(a)\"\r\nt MSG_251 \"%s desativado(a)\"\r\nt MSG_252 \"Verificações de tamanho\"\r\nt MSG_253 \"Detecção de disco rígido\"\r\nt MSG_254 \"Forçar formatação FAT32 extensa\"\r\nt MSG_255 \"Apagar NoDriveTypeAutorun ao sair\"\r\nt MSG_256 \"Detecção de drive falsificado\"\r\nt MSG_257 \"Suporte para Joliet\"\r\nt MSG_258 \"Suporte para Rock Ridge\"\r\nt MSG_259 \"Forçar atualização\"\r\nt MSG_260 \"Compressão do NTFS\"\r\nt MSG_261 \"Escrevendo imagem: %s\"\r\nt MSG_262 \"Suporte a ISO\"\r\nt MSG_263 \"Use unidades de tamanho APROPRIADAS\"\r\nt MSG_264 \"Apagando o diretório '%s'\"\r\nt MSG_265 \"Detecção de disco VMWare\"\r\nt MSG_266 \"Modo dual UEFI/BIOS\"\r\nt MSG_267 \"Aplicando imagem do Windows: %s\"\r\nt MSG_268 \"Aplicando imagem do Windows...\"\r\nt MSG_269 \"Preservar marcas temporais\"\r\nt MSG_270 \"Depuração do USB\"\r\nt MSG_271 \"Calculando as somas de verificação da imagem: %s\"\r\nt MSG_272 \"Calcular as somas de verificação MD5, SHA1 e SHA256 da imagem selecionada\"\r\nt MSG_273 \"Mudar o idioma do aplicativo\"\r\nt MSG_274 \"Imagem %s detectada\"\r\nt MSG_275 \"A imagem que você selecionou é do tipo 'ISOHybrid'. Isso significa que pode ser escrita em modo %s (cópia de arquivo) ou modo %s (imagem de disco).\\nO Rufus recomenda usar o modo %s, para que você sempre tenha acesso total ao drive após a gravação.\\nNo entanto, se você encontrar problemas durante a inicialização, tente gravar novamente pelo modo %s.\\n\\nPor favor, selecione o modo que deseja usar para gravar essa imagem:\"\r\nt MSG_276 \"Gravar no modo %s (Recomendado)\"\r\nt MSG_277 \"Gravar no modo %s\"\r\nt MSG_278 \"Checando por processos em conflito...\"\r\nt MSG_279 \"Não inicializável\"\r\nt MSG_280 \"Disco ou imagem ISO\"\r\nt MSG_281 \"%s (Por favor, selecione)\"\r\nt MSG_282 \"Bloqueio exclusivo para drive USB\"\r\nt MSG_283 \"Assinatura digital inválida\"\r\nt MSG_284 \"O executável baixado não contém uma assinatura digital.\"\r\nt MSG_285 \"O executável baixado é assinado por '%s'.\\nEssa assinatura não é reconhecida e pode indicar alguma forma de atividade maliciosa...\\nVocê tem certeza de que deseja executar esse arquivo?\"\r\nt MSG_286 \"Zerando o drive: %s\"\r\nt MSG_287 \"Detecção de drives removíveis não USB\"\r\nt MSG_288 \"Faltando privilégios elevados\"\r\nt MSG_289 \"Este aplicativo só pode ser executado com privilégios elevados\"\r\nt MSG_290 \"Indexação de Arquivos\"\r\nt MSG_291 \"Seleção de versão\"\r\nt MSG_292 \"Por favor, selecione a versão do Windows que deseja instalar:\"\r\nt MSG_293 \"Versão do Windows não suportada\"\r\nt MSG_294 \"Esta versão do Windows não é mais suportada pelo Rufus.\\nA última versão do Rufus compatível com esta plataforma é a v%d.%d.\"\r\nt MSG_295 \"Atenção: Versão não oficial\"\r\nt MSG_296 \"Esta versão do Rufus não foi produzida pelo(s) seu(s) desenvolvedor(es) oficial(is).\\n\\nTem certeza de que deseja executá-la?\"\r\nt MSG_297 \"ISO truncada detectada\"\r\nt MSG_298 \"O arquivo ISO selecionado não corresponde ao seu tamanho declarado: %s de dados estão faltando!\\n\\nSe você obteve este arquivo da Internet, faça o download de uma nova cópia e verifique se as somas de verificação MD5 ou SHA correspondem às oficiais.\\n\\nVocê pode calcular o MD5 ou SHA no Rufus clicando no botão (✓).\"\r\nt MSG_299 \"Erro de validação da marca temporal\"\r\nt MSG_300 \"O Rufus não pôde validar que a marca temporal da atualização baixada é mais recente do que aquela do executável atual.\\n\\nPara evitar possíveis cenários de ataque, o processo de atualização foi interrompido e o arquivo baixado será excluído. Verifique o registro para obter mais detalhes.\"\r\nt MSG_301 \"Exibir configurações do programa\"\r\nt MSG_302 \"Exibir informações sobre este programa\"\r\nt MSG_303 \"Exibir o registro\"\r\nt MSG_304 \"Criar uma imagem do dispositivo selecionado\"\r\nt MSG_305 \"Use esta opção caso queira instalar o Windows neste dispositivo ou em outro, ou se deseja rodar o Windows direto deste dispositivo (Windows To Go).\"\r\nt MSG_306 \"Modo expresso de zerar o disco: %s\"\r\nt MSG_307 \"isso pode demorar um pouco\"\r\nt MSG_308 \"Detecção de VHD\"\r\nt MSG_309 \"Arquivo comprimido\"\r\nt MSG_310 \"O ISO que você selecionou usa UEFI e é pequeno o suficiente para ser escrito como uma partição do sistema EFI (ESP). Escrever para uma ESP, em vez de escrever para uma partição genérica de dados que ocupa o disco todo, pode ser preferível para alguns tipos de instalações.\\n\\nPor favor, selecione o modo que pretende utilizar para escrever esta imagem:\"\r\nt MSG_311 \"Usar %s (na janela principal da aplicação) para habilitar.\"\r\nt MSG_312 \"Hashes extra (SHA512)\"\r\nt MSG_313 \"Salvar em VHD\"\r\nt MSG_314 \"Calcular somas de verificação da imagem\"\r\nt MSG_315 \"Múltiplos botões\"\r\nt MSG_316 \"Número de passadas\"\r\nt MSG_317 \"ID do Disco\"\r\nt MSG_318 \"Prioridade padrão da thread: %d\"\r\nt MSG_319 \"Ignorar marcador de inicialização\"\r\nt MSG_320 \"Atualizando o layout da partição (%s)...\"\r\nt MSG_321 \"A imagem que você selecionou é uma ISOHybrid, mas os criadores não a tornaram compatível com o modo de cópia ISO/Arquivo.\\nComo resultado, o modo de gravação de imagem DD será aplicado.\"\r\nt MSG_322 \"Impossível abrir ou ler '%s'\"\r\nt MSG_325 \"Aplicando a personalização do Windows: %s\"\r\nt MSG_326 \"Aplicando opções do usuário...\"\r\nt MSG_327 \"Experiência do Usuário do Windows\"\r\nt MSG_328 \"Personalizar a instalação do Windows?\"\r\nt MSG_329 \"Remover a exigência de 4GB+ RAM, Secure Boot e TPM 2.0\"\r\nt MSG_330 \"Remover a exigência de uma conta online da Microsoft\"\r\nt MSG_331 \"Desativar a coleta de dados (Pular as perguntas sobre privacidade)\"\r\nt MSG_332 \"Impedir que o Windows To Go acesse discos internos\"\r\nt MSG_333 \"Criar uma conta local com nome de usuário:\"\r\nt MSG_334 \"Definir as opções regionais com os mesmos valores deste usuário\"\r\nt MSG_335 \"Desativar a encriptação automática BitLocker\"\r\nt MSG_336 \"Registo persistente\"\r\nt MSG_337 \"Um arquivo adicional ('%s') precisa ser baixado da Microsoft para usar este recurso:\\n- Selecione 'Sim' para se conectar à Internet e baixá-lo\\n- Selecione 'Não' para cancelar a operação\\n\\nNota: O arquivo será baixado no diretório da aplicação e será reutilizado automaticamente caso presente.\"\r\nt MSG_338 \"Detectado carregador de inicialização UEFI revogado\"\r\nt MSG_339 \"Rufus detectou que o ISO selecionado contém um carregador de inicialização UEFI que foi revogado e produzirá %s quando Secure Boot estiver habilitado em um sistema UEFI atualizado.\\n\\n- Se você obteve essa imagem ISO de uma fonte não confiável, você deve considerar a possibilidade da mesma conter malware UEFI e evitar inicializar através dela.\\n- Se você a obteve de uma fonte confiável, você deve tentar achar uma versão mais recente, que não produza este aviso.\"\r\nt MSG_340 \"uma tela \\\"Security Violation\\\"\"\r\nt MSG_341 \"uma tela de Reparo do Windows (BSOD) com '%s'\"\r\nt MSG_342 \"Imagem VHDX comprimida\"\r\nt MSG_343 \"Imagem VHD não comprimida\"\r\nt MSG_344 \"Imagem Full Flash Update\"\r\nt MSG_345 \"Alguns dados adicionais precisam ser baixados da Microsoft para usar essa funcionalidade:\\n- Selecione 'Sim' para se conectar à Internet e baixá-los\\n- Selecione 'Não' para cancelar a operação\"\r\nt MSG_346 \"Restringir Windows ao modo S (INCOMPATÍVEL com remoção de exigência de conta online)\"\r\nt MSG_347 \"Modo Especialista\"\r\nt MSG_348 \"Extraindo arquivos: %s\"\r\nt MSG_349 \"Usar MBR do Rufus\"\r\nt MSG_900 \"Rufus é um utilitário que ajuda a formatar e a criar unidades flash USB inicializáveis, tais como pendrives USB, cartões de memória, etc.\"\r\nt MSG_901 \"Site oficial: %s\"\r\nt MSG_902 \"Código fonte: %s\"\r\nt MSG_903 \"Registro de alterações: %s\"\r\nt MSG_904 \"Este software está licenciado sob os termos da GNU Public License (GPL) versão 3.\\nConsulte https://www.gnu.org/licenses/gpl-3.0.pt-br.html para mais detalhes.\"\r\nt MSG_905 \"Inicialização\"\r\nt MSG_910 \"Formatar dispositivos USB, cartões flash e discos virtuais com FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Criar discos USB inicializáveis FreeDOS\"\r\nt MSG_912 \"Criar discos inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)\"\r\nt MSG_913 \"Criar discos inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas\"\r\nt MSG_914 \"Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS\"\r\nt MSG_915 \"Criar discos 'Windows To Go'\"\r\nt MSG_916 \"Criar discos de instalação do Windows 11 para PCs que não possuem TPM ou Secure Boot\"\r\nt MSG_917 \"Criar partições persistentes para Linux\"\r\nt MSG_918 \"Criar imagens VHD/DD do dispositivo selecionado\"\r\nt MSG_919 \"Calcular somas de verificação MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada\"\r\nt MSG_920 \"Executar verificações de blocos defeituosos, incluindo detecção de unidades flash \\\"falsificadas\\\"\"\r\nt MSG_921 \"Baixar ISOs oficiais do Microsoft Windows\"\r\nt MSG_922 \"Baixar ISOs do Shell UEFI\"\r\n\r\n#########################################################################\r\nl \"pt-PT\" \"Portuguese Standard (Português)\" 0x0816\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Acerca do Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licença\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Propriedades do dispositivo\"\r\nt IDS_DEVICE_TXT \"Dispositivo/Disco\"\r\nt IDS_BOOT_SELECTION_TXT \"Tipo de arranque\"\r\nt IDC_SELECT \"Selecionar\"\r\nt IDS_IMAGE_OPTION_TXT \"Opções da Imagem\"\r\nt IDS_PARTITION_TYPE_TXT \"Esquema de partição\"\r\nt IDS_TARGET_SYSTEM_TXT \"Sistema do destino\"\r\nt IDC_LIST_USB_HDD \"Mostrar unidades USB\"\r\nt IDC_OLD_BIOS_FIXES \"Opções de compatibilidade para BIOS antigas\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Ativar a validação do suporte UEFI\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Opções de formatação\"\r\nt IDS_FILE_SYSTEM_TXT \"Sistema de ficheiros\"\r\nt IDS_CLUSTER_SIZE_TXT \"Tamanho do cluster\"\r\nt IDS_LABEL_TXT \"Nome\"\r\nt IDC_QUICK_FORMAT \"Formatação rápida\"\r\nt IDC_BAD_BLOCKS \"Procurar erros no disco USB\"\r\nt IDC_EXTENDED_LABEL \"Criar nomes estendidos e ícones\"\r\nt IDS_STATUS_TXT \"Estado\"\r\nt IDCANCEL \"Fechar\"\r\nt IDC_START \"Iniciar\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Fechar\"\r\nt IDD_LICENSE \"Licença\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Fechar\"\r\nt IDD_LOG \"Histórico de eventos\"\r\nt IDC_LOG_CLEAR \"Limpar\"\r\nt IDC_LOG_SAVE \"Guardar\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Fechar\"\r\nt IDD_NEW_VERSION \"Procurar atualizações de Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Nova versão disponível. Por favor, descarregue a última versão!\"\r\nt IDC_WEBSITE \"Clique aqui para aceder ao Site de Rufus\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Notas relativas a esta versão\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Transferir\"\r\nt IDC_DOWNLOAD \"Transferir\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Mais informações\"\r\nt IDYES \"Sim\"\r\nt IDNO \"Não\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Fechar\"\r\nt IDD_UPDATE_POLICY \"Configuração e política das atualizações\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Configurações\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Procurar atualizações\"\r\nt IDS_INCLUDE_BETAS_TXT \"Incluir versões de teste\"\r\nt IDC_CHECK_NOW \"Procurar\"\r\n\r\nt MSG_001 \"Foi detetada outra instância da aplicação\"\r\nt MSG_002 \"Outra instância da aplicação Rufus está em execução.\\nFeche a primeira intância da aplicação antes de iniciar outra.\"\r\nt MSG_003 \"AVISO: TODOS OS DADOS EM %s SERÃO ELIMINADOS.\\nPara continuar, prima OK. Para sair da operação, prima CANCELAR.\"\r\nt MSG_004 \"Atualização de Rufus\"\r\nt MSG_005 \"Permitir que Rufus procure atualizações na Internet?\"\r\nt MSG_006 \"Fechar\"\r\nt MSG_007 \"Cancelar\"\r\nt MSG_008 \"Sim\"\r\nt MSG_009 \"Não\"\r\nt MSG_010 \"Foram encontrados erros no disco\"\r\nt MSG_011 \"Verificação completa: %d erros encontrados\\n  %d erros de leitura\\n  %d erros de escrita\\n  %d erros de corrompimento\"\r\nt MSG_012 \"%s\\nMais informações disponíveis em:\\n%s\"\r\nt MSG_013 \"Nunca\"\r\nt MSG_014 \"Diariamente\"\r\nt MSG_015 \"Semanalmente\"\r\nt MSG_016 \"Mensalmente\"\r\nt MSG_017 \"Personalizado\"\r\nt MSG_018 \"Versão instalada: %d.%d (Build %d)\"\r\nt MSG_019 \"Última versão: %d.%d (Build %d)\"\r\nt MSG_029 \"Padrão\"\r\nt MSG_030 \"%s (Padrão)\"\r\nt MSG_031 \"BIOS (ou UEFI-CSM)\"\r\nt MSG_032 \"UEFI (não CSM)\"\r\nt MSG_033 \"BIOS ou UEFI\"\r\nt MSG_034 \"%d verificado\"\r\nt MSG_035 \"%d verificados %s\"\r\nt MSG_036 \"Imagem ISO\"\r\nt MSG_037 \"Aplicação\"\r\nt MSG_038 \"Abortar\"\r\nt MSG_039 \"Iniciar\"\r\nt MSG_040 \"Transferir\"\r\nt MSG_041 \"Operação cancelada pelo utilizador\"\r\nt MSG_042 \"Erro\"\r\nt MSG_043 \"Erro: %s\"\r\nt MSG_044 \"Transferência de ficheiro\"\r\nt MSG_045 \"Dispositivo de armazenamento USB (Genérico)\"\r\nt MSG_046 \"%s (Disco %d) [%s]\"\r\nt MSG_047 \"Várias partições\"\r\nt MSG_048 \"Rufus - A limpar buffers\"\r\nt MSG_049 \"Rufus - Cancelar\"\r\nt MSG_050 \"Sucesso.\"\r\nt MSG_051 \"Erro indeterminado durante a formatação.\"\r\nt MSG_052 \"Não pode usar o sistema de ficheiros selecionado para este dispositivo.\"\r\nt MSG_053 \"Não é possível aceder ao dispositivo.\"\r\nt MSG_054 \"Dispositivo está protegido contra escrita.\"\r\nt MSG_055 \"Outra aplicação está a usar o dispositivo. Feche todas as aplicações que possam estar a usar o dispositivo.\"\r\nt MSG_056 \"Formatação rápida não está disponível para este dispositivo.\"\r\nt MSG_057 \"O Nome do volume não é válido.\"\r\nt MSG_058 \"O identificador do dispositivo não é válido.\"\r\nt MSG_059 \"O tamanho de cluster indicado não é válido para este dispositivo.\"\r\nt MSG_060 \"O tamanho do volume não é válido.\"\r\nt MSG_061 \"Inserir um dispositivo USB.\"\r\nt MSG_062 \"Comando não suportado.\"\r\nt MSG_063 \"Erro na alocação de memória.\"\r\nt MSG_064 \"Erro de leitura.\"\r\nt MSG_065 \"Erro de escrita.\"\r\nt MSG_066 \"Falha na instalação\"\r\nt MSG_067 \"Impossível abrir dispositivo - pode estar em utilização. Retire, volte a ligar a unidade e tente novamente.\"\r\nt MSG_068 \"Erro ao criar partição.\"\r\nt MSG_069 \"Erro ao copiar ficheiros para o dispositivo de destino.\"\r\nt MSG_070 \"Cancelado pelo utilizador.\"\r\nt MSG_071 \"Impossível iniciar tópico.\"\r\nt MSG_072 \"Verificação de erros no disco foi interrompida.\"\r\nt MSG_073 \"Erro na análise da imagem ISO.\"\r\nt MSG_074 \"Erro na extração da imagem ISO.\"\r\nt MSG_075 \"Impossível montar o volume.\"\r\nt MSG_076 \"Impossível alterar/configurar ficheiros para arranque.\"\r\nt MSG_077 \"Impossível atribuir letra à unidade.\"\r\nt MSG_078 \"Impossível montar o volume GUID.\"\r\nt MSG_079 \"O dispositivo não está pronto.\"\r\nt MSG_080 \"Rufus detetou que o Windows ainda está a limpar o buffer interno no dispositivo USB.\\n\\nDependendo da velocidade do dispositivo USB, esta operação pode demorar muito tempo a terminar, especialmente para ficheiros grandes.\\n\\nRecomendamos que deixe o Windows terminar para evitar corrompimentos; No entanto, se não quiser esperar, pode simplesmente desligar o dispositivo...\"\r\nt MSG_081 \"Tipo de imagem não suportada\"\r\nt MSG_082 \"Esta imagem não é inicializável ou então usa um método de arranque ou compressão não suportado.\"\r\nt MSG_083 \"Substituir %s?\"\r\nt MSG_084 \"Esta imagem ISO usa uma versão obsoleta do ficheiro '%s'.\\nIsto pode fazer com que o menu de arranque não seja exibido corretamente.\\n\\nO Rufus pode transferir uma versão mais recente para resolver este problema:\\n- Selecione 'Sim' para ligar-se à Internet e transferir o ficheiro\\n- Selecione 'Não' para deixar o ficheiro ISO tal como está\\nSe não sabe o que fazer, é recomendado selecionar 'Sim'.\\n\\nNota: O novo ficheiro será transferido para a pasta atual, e se o ficheiro\\n '%s' já existir, será substituído automaticamente.\"\r\nt MSG_085 \"A transferir %s\"\r\nt MSG_086 \"Nenhuma imagem selecionada\"\r\nt MSG_087 \"para %s TIPO\"\r\nt MSG_088 \"Imagem demasiado grande\"\r\nt MSG_089 \"A imagem é demasiado grande para o destino selecionado.\"\r\nt MSG_090 \"ISO não suportado\"\r\nt MSG_091 \"Quando usa UEFI como tipo de destino, só são suportadas imagens ISO inicializáveis tipo EFI. Selecione uma imagem ISO inicializável do tipo EFI ou altere o tipo de destino para BIOS.\"\r\nt MSG_092 \"Sistema de ficheiros não suportado\"\r\nt MSG_093 \"IMPORTANTE: ESTA DRIVE CONTÉM VÁRIAS PARTIÇÕES!!\\n\\nIsto pode incluir partições/volumes que não estão listados ou invisíveis a partir do Windows. Caso queira prosseguir, é responsável por qualquer perda de dados nessas partições.\"\r\nt MSG_094 \"Várias partições detetadas\"\r\nt MSG_095 \"Imagem DD\"\r\nt MSG_096 \"O sistema de ficheiros selecionado não pode ser usado com este tipo de ISO. Por favor, selecione um sistema de ficheiros diferente ou use um ISO diferente.\"\r\nt MSG_097 \"'%s' apenas pode ser aplicado se o sistema de ficheiros for NTFS.\"\r\nt MSG_098 \"IMPORTANTE: Está a tentar instalar 'Windows To Go', mas a drive de destino não tem o atributos 'FIXO'. Por isso o Windows provalvelmente irá parar durante o arranque, uma vez que não está preparado para trabalhar em drives que tenham o atributo de 'AMOVÍVEL'.\\n\\nDeseja continuar mesmo assim?\\n\\nNota: O atributo 'FIXO/AMOVÍVEL' é uma propriedade do hardware que apenas pode se alterado através de ferramentas do fabricante da drive. No entanto, estas ferramentas na MAIORIA dos CASOS, NUNCA são fornecidas aos utilizadores...\"\r\nt MSG_099 \"Limitação de sistema de ficheiros\"\r\nt MSG_100 \"Esta imagem ISO contém um ficheiro com mais de 4 GB, que ultrapassa o tamanho máximo permitido para o sistema de ficheiros FAT ou FAT32.\"\r\nt MSG_101 \"O suporte para ficheiro WIM não está disponível\"\r\nt MSG_102 \"Não é possível extrair ficheiros comprimidos WIM. A extração WIM é necessária para criar dispositivos USB inicializável tipo EFI com Windows 7 e Windows Vista. Para corrigir, instale uma versão recente do 7-Zip.\\nQuer visitar a página de transferências do 7-Zip?\"\r\nt MSG_103 \"Pretende transferir %s?\"\r\nt MSG_104 \"%s ou posterior requer que esteja instalado o ficheiro '%s'.\\nDado que este ficheiro tem mais de 100 KB e está sempre presente nas \\nimagens ISO %s, Rufus não o inclui na sua distribuição.\\n\\nO Rufus pode transferir o ficheiro em falta:\\n- Selecione 'Sim' transferir o ficheiro\\n- Selecione 'Não' se deseja mais tarde copiar manualmente este ficheiro para a unidade\\n\\nNota: O novo ficheiro será transferido para a pasta atual, e se o ficheiro\\n '%s' já existir, será substituído automaticamente.\"\r\nt MSG_105 \"Se cancelar agora pode deixar o dispositivo INUTILIZADO.\\nSe pretende mesmo cancelar, selecione SIM. Caso contrário, selecione NÃO.\"\r\nt MSG_106 \"Selecione a pasta\"\r\nt MSG_107 \"Todos os ficheiros\"\r\nt MSG_108 \"Registo de eventos do Rufus\"\r\nt MSG_109 \"0x%02X (Disco %d)\"\r\nt MSG_110 \"MS-DOS não arranca de um disco com um tamanho de cluster de 64 kilobytes.\\nPor favor altere o tamanho do cluster ou use o FreeDOS.\"\r\nt MSG_111 \"Tamanho de cluster incompatível\"\r\nt MSG_112 \"Formatar um volume UDF de tamanho grande pode demorar muito tempo. À velocidade de USB 2.0, o tempo estimado de formatação é de %d:%02d, durante o qual a barra de progresso parecerá \\\"congelada\\\". Por favor, seja paciente!\"\r\nt MSG_113 \"Volume UDF de tamanho grande\"\r\nt MSG_114 \"Esta imagem usa Syslinux %s%s mas a aplicação inclui apenas os ficheiros de instalação para Syslinux %s%s.\\n\\nComo as diferentes versões de Syslinux podem não ser compatíveis entre si e não é possível o Rufus incluir todas elas, dois ficheiros adicionais devem ser transferidos ('ldlinux.sys' e 'ldlinux.bss'):\\n- Selecione 'Sim' para transferir os ficheiros\\n- Selecione 'Não' para cancelar\\n\\nNota: Os ficheiros serão transferidos para a pasta atual da aplicação e serão usados automaticamente se presentes.\"\r\nt MSG_115 \"Transferência\"\r\nt MSG_116 \"Esta imagem usa Grub %s mas a aplicação inclui apenas os ficheiros de instalação para Grub %s.\\n\\nAs diferentes versões de Grub podem não ser compatíveis entre si e não é possível incluir todas elas. Rufus irá tentar localizar para a versão de Grub o ficheiro de instalação ('core.img') que coincida com o da imagem:\\n- Selecione 'Sim' para tentar transferir\\n- Selecione 'Não' para usar a versão padrão do Rufus\\n- Selecione 'Cancelar' para abortar a operação\\n\\nNota: O ficheiro será transferido para a pasta atual da aplicação e será usado automaticamente sempre que presente. Se não for possível encontrar online, a versão padrão será utilizada.\"\r\nt MSG_117 \"Instalação padrão do Windows\"\r\nt MSG_119 \"propriedades avançadas da unidade\"\r\nt MSG_120 \"opções avançadas de formatação\"\r\nt MSG_121 \"Mostrar %s\"\r\nt MSG_122 \"Ocultar %s\"\r\nt MSG_123 \"Tamanho da partição persistente\"\r\nt MSG_124 \"Nenhuma\"\r\nt MSG_125 \"Defina o tamanho da partição persistente para a unidade USB. Definir o tamanho como 0 desabilita a partição persistente.\"\r\nt MSG_126 \"Defina as unidades do tamanho da partição.\"\r\nt MSG_127 \"Não mostrar esta mensagem novamente\"\r\nt MSG_128 \"Aviso importante sobre %s\"\r\nt MSG_129 \"Acabou de criar um disco que usa o carregador de inicialização UEFI:NTFS. Tenha em atenção que, para inicializar com este disco, TEM DE DESATIVAR O ARRANQUE SEGURO.\\nPara mais detalhes clique no botão \\\"Mais informações\\\" abaixo.\"\r\nt MSG_130 \"Seleção de imagem do Windows\"\r\nt MSG_131 \"Este ISO contém várias imagens do Windows.\\nPor favor, selecione a imagem que pretende usar para esta instalação:\"\r\nt MSG_132 \"Outro programa ou processo está a aceder a esta unidade. Mesmo assim, pretende formatá-la?\"\r\nt MSG_133 \"Rufus detetou que está a tentar criar um disco Windows To Go com base num ISO da versão 1809.\\n\\nDevido a um *BUG da MICROSOFT*, este disco irá bloquear durante a inicialização do Windows (Ecrã Azul da Morte), a menos que substitua manualmente o ficheiro 'WppRecorder.sys' por um da versão 1803.\\n\\nTenha em atenção também que a razão pela qual o Rufus não pode corrigir automaticamente é que 'WppRecorder.sys' é um ficheiro protegido por direitos de autor da Microsoft, portanto, não podemos incorporar legalmente uma cópia do ficheiro no Rufus...\"\r\nt MSG_134 \"Uma vez que foi selecionado o MBR para o esquema de partição, o Rufus só pode criar uma partição de até 2 TB neste disco, o que deixará %s de espaço em disco indisponível.\\n\\nTem a certeza de que pretende continuar?\"\r\nt MSG_135 \"Versão\"\r\nt MSG_136 \"Lançamento\"\r\nt MSG_137 \"Edição\"\r\nt MSG_138 \"Idioma\"\r\nt MSG_139 \"Arquitetura\"\r\nt MSG_140 \"Continuar\"\r\nt MSG_141 \"Voltar\"\r\nt MSG_142 \"Por favor, aguarde...\"\r\nt MSG_143 \"Transferir no browser\"\r\nt MSG_144 \"A transferência de ISOs do Windows não está disponível porque a Microsoft alterou o seu site para evitá-la.\"\r\nt MSG_145 \"É necessário o PowerShell 3.0 ou posterior para executar este script.\"\r\nt MSG_146 \"Pretende ligar e fazer a transferência?\"\r\nt MSG_148 \"A executar script da transferência...\"\r\nt MSG_149 \"Transferir imagem ISO\"\r\nt MSG_150 \"Tipo de computador com o qual pretende usar esta unidade inicializável. É da sua responsabilidade determinar se o computador é do tipo BIOS ou UEFI antes de começar a criar a unidade, pois pode falhar no arranque.\"\r\nt MSG_151 \"'UEFI-CSM' significa que o dispositivo inicializará apenas no modo de emulação da BIOS (também conhecido como 'Legacy Mode') em UEFI e não no modo UEFI nativo.\"\r\nt MSG_152 \"'não CSM' significa que o dispositivo inicializará apenas no modo UEFI nativo, e não no modo de emulação da BIOS (também conhecido como 'Legacy Mode').\"\r\nt MSG_153 \"Padrão de teste: 0x%02X\"\r\nt MSG_154 \"Padrão de teste: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Padrão de teste: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Padrão de teste: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Selecionar o sistema de ficheiros destino\"\r\nt MSG_158 \"Tamanho mínimo que um bloco de dados ocupará no sistema de ficheiros\"\r\nt MSG_159 \"Use este campo para atribuir o nome ao volume.\\nPodem ser caracteres acentuados.\"\r\nt MSG_160 \"Mostrar opções avançadas\"\r\nt MSG_161 \"Verificação de erros no dispositivo com o padrão de teste\"\r\nt MSG_162 \"Desmarque esta opção para usar o método de formatação \\\"lento\\\"\"\r\nt MSG_163 \"Método a usar para criar partições\"\r\nt MSG_164 \"Método a usar para tornar a unidade inicializável\"\r\nt MSG_165 \"Clique para selecionar ou transferir uma imagem..\"\r\nt MSG_166 \"Selecione esta opção para permitir a exibição de caracteres acentuados e atribuir um ícone para a unidade (cria um ficheiro autorun.inf)\"\r\nt MSG_167 \"Instalar um carregador de arranque UEFI, que irá efetuar a validação do ficheiro MD5Sum do suporte de dados\"\r\nt MSG_169 \"Criar uma partição extra oculta e tentar alinhar limites das partições. Isto pode melhorar a deteção de USB inicializável para as BIOS antigas.\"\r\nt MSG_170 \"Ativa a deteção de discos rígidos portáteis USB. USE-O POR SEU PRÓPRIO RISCO!!!\"\r\nt MSG_171 \"Iniciar a operação de formatação.\\nTodos os dados no dispositivo serão DESTRUÍDOS!\"\r\nt MSG_172 \"Assinatura do ficheiro inválida\"\r\nt MSG_173 \"Clique para selecionar...\"\r\nt MSG_174 \"Rufus - O utilitário de confiança para formatação USB\"\r\nt MSG_175 \"Versão %d.%d (Build %d)\"\r\nt MSG_176 \"Tradução para Português Europeu: Dinis Medeiros, Fernando Baptista\"\r\nt MSG_177 \"Para reportar erros ou sugerir melhorias, visite:\"\r\nt MSG_178 \"Direitos de autor adicionais:\"\r\nt MSG_179 \"Politica de atualização:\"\r\nt MSG_180 \"Autoriza que este programa procure e instale automaticamente as atualizações e aceita que a seguinte informação possa ser recolhida nos nossos servidores:\"\r\nt MSG_181 \"A arquitetura e versão do seu sistema operativo\"\r\nt MSG_182 \"A versão da aplicação que está a usar\"\r\nt MSG_183 \"O seu endereço IP\"\r\nt MSG_184 \"A fim de gerar estatísticas de uso privado, a informação recolhida pode ser retida \\\\b até um ano\\\\b0 . A menos que seja requerido por lei, não forneceremos nenhuma desta informação a terceiros.\"\r\nt MSG_185 \"Processo de atualização:\"\r\nt MSG_186 \"Rufus não instala nem executa nenhum serviço nem programa em segundo plano. A procura de atualizações só se realiza quando a aplicação principal está em execução.\\\\line\\nÉ necessário acesso à Internet para verificar se existem atualizações.\"\r\nt MSG_187 \"Imagem inválida para a opção de inicialização selecionada\"\r\nt MSG_188 \"A imagem atual não coincide com a opção de inicialização selecionada. Utilize uma imagem diferente ou escolha uma opção de inicialização diferente.\"\r\nt MSG_189 \"Esta imagem ISO não é compatível com o sistema de ficheiros selecionado\"\r\nt MSG_190 \"Detetada unidade incompatível\"\r\nt MSG_191 \"Escrita\"\r\nt MSG_192 \"Leitura\"\r\nt MSG_193 \"Transferido %s\"\r\nt MSG_194 \"Não é possível transferir %s\"\r\nt MSG_195 \"A usar a versão incorporada do(s) ficheiro(s) %s\"\r\nt MSG_196 \"IMPORTANTE: ESTA DRIVE USA UM TAMANHO DE SECTOR NÃO CONVENCIONAL!\\n\\nAs drives convencionais usam o tamanho de sector de 512-byte mas esta drive usa %d-byte. Em muitos casos, isto implica que NÃO será possível fazer arranque com esta drive.\\nRufus pode tentar criar uma drive inicializável, mas SEM GARANTIA que funcione.\"\r\nt MSG_197 \"Detetado tamanho de sector não standard\"\r\nt MSG_198 \"'Windows To Go' apenas pode ser instalado numa drive com partição GPT se o atributo FIXO estiver selecionado. A drive atual não foi detetada como FIXO.\"\r\nt MSG_199 \"Esta funcionalidade não está disponível nesta plataforma.\"\r\nt MSG_201 \"A cancelar - por favor aguarde...\"\r\nt MSG_202 \"A analisar a imagem...\"\r\nt MSG_203 \"Ocorreu um erro ao analisar a imagem\"\r\nt MSG_204 \"Foi detetado um ficheiro %s obsoleto\"\r\nt MSG_205 \"A usar a imagem: %s\"\r\nt MSG_206 \"Falta o ficheiro %s\"\r\nt MSG_207 \"Novo volume\"\r\nt MSG_208 \"%d dispositivo encontrado\"\r\nt MSG_209 \"%d dispositivos encontrados\"\r\nt MSG_210 \"PRONTO\"\r\nt MSG_211 \"Operação cancelada\"\r\nt MSG_212 \"A operação FALHOU\"\r\nt MSG_213 \"A iniciar a nova aplicação...\"\r\nt MSG_214 \"Erro ao iniciar a nova aplicação\"\r\nt MSG_215 \"%s aberto\"\r\nt MSG_216 \"%s guardado\"\r\nt MSG_217 \"A formatar: %s\"\r\nt MSG_218 \"A criar sistema de ficheiros: Tarefa %d/%d completa\"\r\nt MSG_219 \"Verificação NTFS: %d%% completo\"\r\nt MSG_220 \"A formatar (%s) - duração estimada %d:%02d...\"\r\nt MSG_221 \"A atribuir a etiqueta do volume (%s)...\"\r\nt MSG_222 \"A formatar (%s)...\"\r\nt MSG_223 \"Verificação NTFS (Checkdisk)...\"\r\nt MSG_224 \"A limpar as estruturas MBR/PBR/GPT...\"\r\nt MSG_225 \"A solicitar acesso ao disco...\"\r\nt MSG_226 \"A analisar registos de arranque existentes...\"\r\nt MSG_227 \"A fechar o volume existente...\"\r\nt MSG_228 \"A escrever o registo mestre de arranque (Master Boot Record)...\"\r\nt MSG_229 \"A escrever o registo da partição de arranque (Partition Boot Record)...\"\r\nt MSG_230 \"A copiar ficheiros DOS...\"\r\nt MSG_231 \"A copiar ficheiros ISO: %s\"\r\nt MSG_232 \"Configuração de arranque EFI para Win7 EFI (%s)...\"\r\nt MSG_233 \"A finalizar, por favor aguarde...\"\r\nt MSG_234 \"A instalar Syslinux %s...\"\r\nt MSG_235 \"Blocos com erros: %s %d/%d - %0.2f%% (%d/%d/%d erros)\"\r\nt MSG_236 \"Blocos com erro: A verificar com padrão aleatório\"\r\nt MSG_237 \"Blocos com erro: A verificar com padrão 0x%02X\"\r\nt MSG_238 \"A criar partições (%s)...\"\r\nt MSG_239 \"A apagar partições (%s)...\"\r\nt MSG_240 \"A assinatura da atualização transferida não foi validada. Isto pode significar que o seu sistema está configurado incorretamente para validação de assinaturas ou indicar uma transferência maliciosa.\\n\\nO ficheiro transferido será eliminado. Por favor, verifique o registo para mais detalhes.\"\r\nt MSG_241 \"A transferir: %s\"\r\nt MSG_242 \"Erro ao transferir o ficheiro.\"\r\nt MSG_243 \"Procurar atualizações de Rufus...\"\r\nt MSG_244 \"Atualizações: Não é possível ligar à Internet\"\r\nt MSG_245 \"Atualizações: Impossível aceder aos dados da versão\"\r\nt MSG_246 \"Está disponível uma nova versão de Rufus!\"\r\nt MSG_247 \"Não foi encontrada uma nova versão de Rufus\"\r\nt MSG_248 \"Foram apagadas as chaves de registo da aplicação\"\r\nt MSG_249 \"Falha ao apagar as chaves de registo da aplicação\"\r\nt MSG_250 \"%s ativado\"\r\nt MSG_251 \"%s desativado\"\r\nt MSG_252 \"Verificação de tamanho\"\r\nt MSG_253 \"Deteção de discos rígidos\"\r\nt MSG_254 \"Forçar formatação FAT32 em discos grandes\"\r\nt MSG_255 \"Apagar NoDriveTypeAutorun ao sair\"\r\nt MSG_256 \"Simulação de deteção de dispositivo\"\r\nt MSG_257 \"Suporte para Joliet\"\r\nt MSG_258 \"Suporte para Rock Ridge\"\r\nt MSG_259 \"Forçar a atualização\"\r\nt MSG_260 \"Compressão NTFS\"\r\nt MSG_261 \"A criar imagem: %s\"\r\nt MSG_262 \"Suporte ISO\"\r\nt MSG_263 \"Usar unidade de tamanho APROPRIADO\"\r\nt MSG_264 \"A apagar pasta '%s'\"\r\nt MSG_265 \"A detetar disco VMWare\"\r\nt MSG_266 \"Modo duplo UEFI/BIOS\"\r\nt MSG_267 \"Aplicar imagem Windows: %s\"\r\nt MSG_268 \"Aplicar imagem Windows...\"\r\nt MSG_269 \"Manter data/hora dos ficheiros\"\r\nt MSG_270 \"Depuração USB\"\r\nt MSG_271 \"Cálculo do checksums da imagem: %s\"\r\nt MSG_272 \"Calcular MD5, SHA1 e SHA256 da imagem selecionada\"\r\nt MSG_273 \"Alterar o idioma da aplicação\"\r\nt MSG_274 \"Detetada imagem %s\"\r\nt MSG_275 \"A imagem selecionada é uma imagem 'ISOHybrid'. Isto significa que pode ser escrita no modo %s (cópia de ficheiros) ou no modo %s (cópia de imagem).\\nRufus recomenda o modo %s para que tenha sempre acesso total ao disco após a escrita.\\nNo entanto, se existirem erros durante o arranque, pode tentar escrever no modo %s.\\n\\nSelecione o modo que realmente pretende para escrever esta imagem:\"\r\nt MSG_276 \"Escrever no modo %s (Recomendado)\"\r\nt MSG_277 \"Escrever no modo %s\"\r\nt MSG_278 \"A verificar processos em conflito...\"\r\nt MSG_279 \"Não inicializável\"\r\nt MSG_280 \"Disco ou imagem ISO\"\r\nt MSG_281 \"%s (selecionar)\"\r\nt MSG_282 \"Bloqueio exclusivo do dispositivo USB\"\r\nt MSG_283 \"Assinatura inválida\"\r\nt MSG_284 \"Está em falta uma assinatura digital no executável transferido.\"\r\nt MSG_285 \"O executável transferido está assinado por '%s'.\\nNão é uma assinatura reconhecida e poderá indiciar algum tipo de atividade mal intencionada...\\nTem a certeza de que pretende executar este ficheiro?\"\r\nt MSG_286 \"A limpar disco: %s\"\r\nt MSG_287 \"Detecção de unidades removíveis não-USB\"\r\nt MSG_288 \"Sem privilégios de administrador\"\r\nt MSG_289 \"Esta aplicação só pode ser executada com privilégios de administrador\"\r\nt MSG_290 \"Indexação de ficheiros\"\r\nt MSG_291 \"Seleção da versão\"\r\nt MSG_292 \"Selecione a versão do Windows que pretende instalar:\"\r\nt MSG_293 \"Versão do Windows não suportada\"\r\nt MSG_294 \"Esta versão do Windows já não é suportada por Rufus.\\nA última versão do Rufus compatível com esta plataforma é a v%d.%d.\"\r\nt MSG_295 \"Aviso: versão não oficial\"\r\nt MSG_296 \"Esta versão de Rufus NÃO foi desenvolvida pelo autor oficial.\\n\\nTem a certeza de que pretende executar?\"\r\nt MSG_297 \"Detetado ISO truncado\"\r\nt MSG_298 \"O ficheiro ISO selecionado não corresponde ao tamanho declarado: faltam %s de dados!\\n\\nSe obteve este ficheiro da Internet, deve tentar transferir uma nova cópia e verificar se os checksums MD5 ou SHA correspondem aos oficiais.\\n\\nPara calcular o MD5 ou SHA com Rufus, clique no botão (✓).\"\r\nt MSG_299 \"Erro de validação da data/hora\"\r\nt MSG_300 \"Não foi possível ao Rufus confirmar que a data e hora da atualização transferida é mais recente que a do executável atual.\\n\\nPara evitar possíveis cenários de ataque informático, o processo de atualização foi cancelado e o ficheiro transferido será apagado. Para mais detalhes, verifique o registo.\"\r\nt MSG_301 \"Mostrar configurações da aplicação\"\r\nt MSG_302 \"Mostrar informações acerca da aplicação\"\r\nt MSG_303 \"Mostrar registo de eventos\"\r\nt MSG_304 \"Criar imagem do disco do dispositivo selecionado\"\r\nt MSG_305 \"Use esta opção se pretende instalar o Windows noutro disco, ou se pretende executar o Windows diretamente desta unidade (Windows To Go).\"\r\nt MSG_306 \"Limpeza rápida da unidade: %s\"\r\nt MSG_307 \"pode demorar algum tempo\"\r\nt MSG_308 \"Deteção VHD\"\r\nt MSG_309 \"Arquivo comprimido\"\r\nt MSG_310 \"O ISO selecionado utiliza UEFI e é pequeno para ser escrito como uma partição do sistema EFI (ESP). Escrever para uma ESP em vez de escrever para uma partição genérica de dados que ocupa o disco todo, pode ser preferível para alguns tipos de instalações.\\n\\nPor favor, selecione o modo que pretende utilizar para escrever esta imagem:\"\r\nt MSG_311 \"Usar %s para ativar (na janela principal da aplicação).\"\r\nt MSG_312 \"Hashes extra (SHA512)\"\r\nt MSG_313 \"Guardar para VHD\"\r\nt MSG_314 \"Calcular cheksums da imagem\"\r\nt MSG_315 \"Múltiplos botões\"\r\nt MSG_316 \"Número de passagens\"\r\nt MSG_317 \"ID Disco\"\r\nt MSG_318 \"Prioridade padrão do thread: %d\"\r\nt MSG_319 \"Ignorar marcador de arranque\"\r\nt MSG_320 \"A atualizar a estrutura da partição (%s)...\"\r\nt MSG_321 \"A imagem que selecionou é ISOHybrid mas os criadores não a tornaram compatível com o modo de cópia ISO/Ficheiro.\\nComo resultado, será aplicado o modo de gravação da imagem DD.\"\r\nt MSG_322 \"Não foi possível abrir ou ler '%s'\"\r\nt MSG_325 \"A aplicar personalização do Windows: %s\"\r\nt MSG_326 \"A aplicar as opções do utilizador...\"\r\nt MSG_327 \"Experiência do Utilizador Windows\"\r\nt MSG_328 \"Personalizar instalação do Windows?\"\r\nt MSG_329 \"Remover o requisito de 4 GB ou mais de RAM, Arranque Seguro e TPM 2.0\"\r\nt MSG_330 \"Remover o requisito de uma conta Microsoft online\"\r\nt MSG_331 \"Desativar a recolha de dados (suprime as perguntas sobre privacidade)\"\r\nt MSG_332 \"Impedir que o Windows To Go aceda a discos internos\"\r\nt MSG_333 \"Criar uma conta local com o nome de utilizador:\"\r\nt MSG_334 \"Definir as opções regionais com os mesmos valores deste utilizador\"\r\nt MSG_335 \"Desativar a encriptação automática BitLocker\"\r\nt MSG_336 \"Registo permanente (log)\"\r\nt MSG_337 \"Um ficheiro adicional ('%s') deve ser transferido da Microsoft para utilizar esta funcionalidade:\\n- Selecione 'Sim' para se ligar à Internet e descarregá-lo\\n- Selecione 'Não' para cancelar a operação\\n\\nNota: O ficheiro será transferido para a pasta da aplicação e será reutilizado automaticamente se estiver presente.\"\r\nt MSG_338 \"Detetado carregador de arranque UEFI revogado\"\r\nt MSG_339 \"O Rufus detetou que a ISO que selecionou contém um carregador de arranque UEFI que foi revogado e que produzirá %s, quando o Arranque Seguro está ativado num sistema UEFI totalmente atualizado.\\n\\n- Se obteve esta imagem ISO de uma fonte não segura, deve considerar a possibilidade de que a mesma possa conter malware UEFI e evitar arrancar a partir dela.\\n- Se a obteve de uma fonte segura, deve tentar localizar uma versão mais atualizada, que não produza este aviso.\"\r\nt MSG_340 \"um ecrã de \\\"Violação de Segurança\\\"\"\r\nt MSG_341 \"um ecrã de recuperação do Windows (BSOD) com '%s'\"\r\nt MSG_342 \"Imagem VHDX comprimida\"\r\nt MSG_343 \"Imagem VHD não comprimida\"\r\nt MSG_344 \"Imagem de atualização completa\"\r\nt MSG_345 \"É necessário transferir alguns dados adicionais da Microsoft para usar esta funcionalidade:\\n- Selecione 'Sim' para se ligar à Internet e descarregá-los\\n- Selecione 'Não' para cancelar a operação\"\r\nt MSG_346 \"Restringir o Windows ao modo S (INCOMPATÍVEL com o ignorar da conta online)\"\r\nt MSG_347 \"Modo avançado\"\r\nt MSG_348 \"A extrair ficheiros de arquivo: %s\"\r\nt MSG_349 \"Usar o MBR do Rufus\"\r\nt MSG_900 \"Rufus é um utilitário que ajuda a formatar e a criar unidades USB inicializáveis, tais como dispositivos USB/pendrives, cartões de memória, etc.\"\r\nt MSG_901 \"Site oficial: %s\"\r\nt MSG_902 \"Código fonte: %s\"\r\nt MSG_903 \"Alterações: %s\"\r\nt MSG_904 \"Este software está licenciado sob os termos da GNU Public License (GPL) versão 3.\\nConsulte https://www.gnu.org/licenses/gpl-3.0.html para mais detalhes.\"\r\nt MSG_905 \"Inicializável\"\r\nt MSG_910 \"Formatar dispositivos USB, cartão de memória e drives virtuais em FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Criar unidades USB inicializáveis FreeDOS\"\r\nt MSG_912 \"Criar unidades inicializáveis a partir de ISOs inicializáveis (Windows, Linux, etc.)\"\r\nt MSG_913 \"Criar unidades inicializáveis a partir de imagens de disco inicializáveis, inclusive de imagens compactadas\"\r\nt MSG_914 \"Criar discos inicializáveis ​​BIOS ou UEFI, inclusive discos UEFI inicializáveis ​​usando NTFS\"\r\nt MSG_915 \"Criar discos 'Windows To Go'\"\r\nt MSG_916 \"Criar discos de instalação do Windows 11 para PCs que não possuem TPM ou Arranque Seguro\"\r\nt MSG_917 \"Crie partições persistentes para Linux\"\r\nt MSG_918 \"Criar imagens VHD/DD do dispositivo selecionado\"\r\nt MSG_919 \"Calcular checksums MD5, SHA-1, SHA-256 e SHA-512 da imagem selecionada\"\r\nt MSG_920 \"Executar verificações de blocos inválidos, incluindo a deteção de unidades flash \\\"falsas\\\"\"\r\nt MSG_921 \"Transferir ISOs oficiais do Microsoft Windows Retail\"\r\nt MSG_922 \"Transferir ISOs de UEFI Shell\"\r\n\r\n#########################################################################\r\nl \"ro-RO\" \"Romanian (Română)\" 0x0418, 0x0818\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Despre Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licență\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Proprietăți unitate\"\r\nt IDS_DEVICE_TXT \"Dispozitiv\"\r\nt IDS_BOOT_SELECTION_TXT \"Selectare boot\"\r\nt IDC_SELECT \"Selectare\"\r\nt IDS_IMAGE_OPTION_TXT \"Opțiune imagine\"\r\nt IDS_PARTITION_TYPE_TXT \"Schemă de partiționare\"\r\nt IDS_TARGET_SYSTEM_TXT \"Sistemul vizat\"\r\nt IDC_LIST_USB_HDD \"Afișare unități conectate prin USB\"\r\nt IDC_OLD_BIOS_FIXES \"Adăugare remedieri pentru BIOS-uri vechi (partiție extra, aliniere, etc.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Activați validarea mediilor UEFI în timpul execuției\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Opțiuni formatare\"\r\nt IDS_FILE_SYSTEM_TXT \"Sistem de fișiere\"\r\nt IDS_CLUSTER_SIZE_TXT \"Mărime cluster\"\r\nt IDS_LABEL_TXT \"Etichetă volum\"\r\nt IDC_QUICK_FORMAT \"Formatare rapidă\"\r\nt IDC_BAD_BLOCKS \"Căutare blocuri defecte\"\r\nt IDC_EXTENDED_LABEL \"Creare fișiere extinse pentru etichete și iconițe\"\r\nt IDS_STATUS_TXT \"Stare\"\r\nt IDCANCEL \"Închidere\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Închidere\"\r\nt IDD_LICENSE \"Licență Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Închidere\"\r\nt IDD_LOG \"Jurnal\"\r\nt IDC_LOG_CLEAR \"Ștergere\"\r\nt IDC_LOG_SAVE \"Salvare\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Închidere\"\r\nt IDD_NEW_VERSION \"Căutare actualizări - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Este disponibilă o nouă versiune. Vă rugăm să descărcați cea mai recentă versiune!\"\r\nt IDC_WEBSITE \"Apăsați aici pentru a accesa pagina web\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Informații despre lansări\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Descărcare\"\r\nt IDC_DOWNLOAD \"Descărcare\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Mai multe informații\"\r\nt IDYES \"Da\"\r\nt IDNO \"Nu\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Închidere\"\r\nt IDD_UPDATE_POLICY \"Politică de actualizare și setări\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Setări\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Căutare actualizări\"\r\nt IDS_INCLUDE_BETAS_TXT \"Includere versiuni beta\"\r\nt IDC_CHECK_NOW \"Căutare acum\"\r\n\r\nt MSG_001 \"S-a detectat altă instanță\"\r\nt MSG_002 \"O altă aplicație Rufus rulează.\\nVă rugăm să închideți prima aplicație înainte de a deschide alta.\"\r\nt MSG_003 \"ATENȚIE: TOATE DATELE DE PE DISPOZITIVUL '%s' VOR FI DISTRUSE.\\nPentru a continua, alegeți OK. Pentru a renunța, alegeți ANULARE.\"\r\nt MSG_004 \"Politica de actualizare Rufus\"\r\nt MSG_005 \"Permiteți aplicației Rufus să caute actualizări pe internet?\"\r\nt MSG_006 \"Închidere\"\r\nt MSG_007 \"Anulare\"\r\nt MSG_008 \"Da\"\r\nt MSG_009 \"Nu\"\r\nt MSG_010 \"S-au găsit blocuri defecte\"\r\nt MSG_011 \"Verificare finalizată: s-au găsit %d blocuri defecte\\n  %d erori de citire\\n  %d erori de scriere\\n  %d erori de integritate\"\r\nt MSG_012 \"%s\\nUn raport mai detaliat se află în:\\n%s\"\r\nt MSG_013 \"Dezactivată\"\r\nt MSG_014 \"Zilnic\"\r\nt MSG_015 \"Săptămânal\"\r\nt MSG_016 \"Lunar\"\r\nt MSG_017 \"Personalizat\"\r\nt MSG_018 \"Versiune instalată: %d.%d (Generare %d)\"\r\nt MSG_019 \"Cea mai recentă versiune: %d.%d (Generare %d)\"\r\nt MSG_020 \"baiți\"\r\nt MSG_026 \"baiți\"\r\nt MSG_027 \"kilobaiți\"\r\nt MSG_028 \"megabaiți\"\r\nt MSG_029 \"Implicit\"\r\nt MSG_030 \"%s (Implicit)\"\r\nt MSG_031 \"BIOS (sau UEFI-CSM)\"\r\nt MSG_032 \"UEFI (fără CSM)\"\r\nt MSG_033 \"BIOS sau UEFI\"\r\nt MSG_034 \"%d pas\"\r\nt MSG_035 \"%d pași %s\"\r\nt MSG_036 \"Imagine ISO\"\r\nt MSG_037 \"Aplicație\"\r\nt MSG_038 \"Anulare\"\r\nt MSG_039 \"Lansare\"\r\nt MSG_040 \"Descărcare\"\r\nt MSG_041 \"Operațiune anulată de către utilizator\"\r\nt MSG_042 \"Eroare\"\r\nt MSG_043 \"Eroare: %s\"\r\nt MSG_044 \"Descărcare fișier\"\r\nt MSG_045 \"Dispozitiv de stocare USB (Generic)\"\r\nt MSG_046 \"%s (Disc %d) [%s]\"\r\nt MSG_047 \"Partiții multiple\"\r\nt MSG_048 \"Rufus - Curățare buffer\"\r\nt MSG_049 \"Rufus - Anulare\"\r\nt MSG_050 \"Finalizat cu succes.\"\r\nt MSG_051 \"Eroare necunoscută în timpul formatării.\"\r\nt MSG_052 \"Nu se poate utiliza sistemul de fișiere selectat pe acest dispozitiv media.\"\r\nt MSG_053 \"Accesul la dispozitiv a fost respins.\"\r\nt MSG_054 \"Dispozitivul media are scrierea protejată.\"\r\nt MSG_055 \"Dispozitivul este utilizat de către un alt proces. Vă rugăm să închideți orice alt proces care ar putea să acceseze dispozitivul.\"\r\nt MSG_056 \"Formatarea rapidă nu este disponibilă pentru acest dispozitiv.\"\r\nt MSG_057 \"Eticheta volumului nu este validă.\"\r\nt MSG_058 \"Procesul de gestionare al dispozitivului nu este valid.\"\r\nt MSG_059 \"Dimensiunea selectată pentru cluster nu este validă pentru acest dispozitiv.\"\r\nt MSG_060 \"Dimensiunea volumului nu este validă.\"\r\nt MSG_061 \"Vă rugăm să introduceți un dispozitiv media detașabil.\"\r\nt MSG_062 \"A fost primită o comandă neacceptată.\"\r\nt MSG_063 \"Eroare de alocare memorie.\"\r\nt MSG_064 \"Eroare de citire.\"\r\nt MSG_065 \"Eroare de scriere.\"\r\nt MSG_066 \"Instalarea a eșuat\"\r\nt MSG_067 \"Nu s-a putut deschide dispozitivul media. Este posibil ca acesta să fie utilizat de către un alt proces. Vă rugăm să reintroduceți dispozitivul și să încercați din nou.\"\r\nt MSG_068 \"Nu s-a putut partiționa unitatea.\"\r\nt MSG_069 \"Nu s-au putut copia fișierele pe dispozitivul țintă.\"\r\nt MSG_070 \"Anulat de către utilizator.\"\r\nt MSG_071 \"Nu se poate porni firul de execuție.\"\r\nt MSG_072 \"Căutarea blocurilor defecte nu s-a finalizat.\"\r\nt MSG_073 \"Analiza imaginii ISO a eșuat.\"\r\nt MSG_074 \"Extragerea imaginii ISO a eșuat.\"\r\nt MSG_075 \"Nu se poate remonta volumul.\"\r\nt MSG_076 \"Nu se pot configura fișierele pentru boot.\"\r\nt MSG_077 \"Nu se poate atribui litera unității.\"\r\nt MSG_078 \"Nu se poate monta volumul GUID.\"\r\nt MSG_079 \"Dispozitivul nu este pregătit.\"\r\nt MSG_080 \"Rufus a observat că Windows încă mai scrie date din buffer pe dispozitivul USB.\\n\\nÎn funcție de viteza dispozitivului USB, poate dura mult timp pentru ca această operațiune să se finalizeze, mai ales dacă există fișiere mari.\\n\\nPentru a evita deteriorarea datelor, vă recomandăm să așteptați câteva momente pentru ca Windows să finalizeze scrierea. Dacă nu doriți să așteptați, puteți scoate dispozitivul USB, însă integritatea datelor nu va fi garantată.\"\r\nt MSG_081 \"Imagine neacceptată\"\r\nt MSG_082 \"Această imagine nu este de tip boot, sau folosește o metodă de boot sau compresie care nu este acceptată de Rufus...\"\r\nt MSG_083 \"Înlocuiți %s?\"\r\nt MSG_084 \"Această imagine ISO pare să folosească o versiune învechită de '%s'.\\nDrept urmare, este posibil ca meniul de boot să nu funcționeze corect.\\n\\nRufus poate descărca o versiune mai nouă pentru rezolva această problemă:\\n- Alegeți 'Da' pentru a vă conecta la internet și a descărca fișierul\\n- Alegeți 'Nu' pentru a lăsa fișierul ISO neschimbat.\\nDacă nu știți care este alegerea potrivită, este recomandat să alegeți 'Da'.\\n\\nObservație: Un nou fișier va fi descărcat în folderul curent. Odată descărcat, noua versiune de '%s' va fi refolosită automat.\"\r\nt MSG_085 \"Se descarcă %s\"\r\nt MSG_086 \"Nicio imagine selectată\"\r\nt MSG_087 \"pentru tip %s\"\r\nt MSG_088 \"Imaginea este prea mare\"\r\nt MSG_089 \"Imaginea este prea mare pentru dispozitivul selectat.\"\r\nt MSG_090 \"Imagine ISO neacceptată\"\r\nt MSG_091 \"Atunci când este selectat UEFI drept țintă, doar imaginile ISO de tip EFI boot sunt acceptate. Vă rugăm să alegeți un fișier ISO de tip EFI, sau să selectați BIOS drept țintă.\"\r\nt MSG_092 \"Sistem de fișiere neacceptat\"\r\nt MSG_093 \"IMPORTANT: ACEASTĂ UNITATE CONȚINE MAI MULTE PARTIȚII!!\\n\\nAceste partiții pot fi ascunse sau invizibile în Windows. Continuând, dumneavoastră veți fi responsabil(ă) pentru orice pierderi de date apărute în urma ștergerii acestor partiții.\"\r\nt MSG_094 \"Au fost detectate mai multe partiții\"\r\nt MSG_095 \"Imagine DD\"\r\nt MSG_096 \"Sistemul de fișiere selectat nu poate fi utilizat cu acest tip de ISO. Vă rugăm să selectați alt sistem de fișiere sau să folosiți alt fișier ISO.\"\r\nt MSG_097 \"'%s' poate fi aplicat doar dacă sistemul de fișiere este NTFS.\"\r\nt MSG_098 \"IMPORTANT: Ați ales să instalați 'Windows To Go', dar unitatea aleasă nu are atributul 'FIXED'. Drept urmare, Windows nu va porni corect, întrucât Microsoft nu a proiectat acest sistem de operare să funcționeze cu unitățile care au atributul 'REMOVABLE'.\\n\\nDoriți totuși să continuați?\\n\\nObservație: Atributul 'FIXED/REMOVABLE' este o proprietate hardware. Atributul poate fi schimbat doar folosind instrumente speciale personalizate de către producătorul unității, însă aceste instrumente nu sunt APROAPE NICIODATĂ oferite publicului...\"\r\nt MSG_099 \"Limitare a sistemului de fișiere\"\r\nt MSG_100 \"Această imagine ISO conține un fișier mai mare de 4 GO, care depășește dimensiunea maximă permisă pentru un sistem de fișiere FAT sau FAT32.\"\r\nt MSG_101 \"Lipsește suportul WIM\"\r\nt MSG_102 \"Platforma dvs. nu poate extrage fișiere din archive WIM. Extragerea din WIM este necesară pentru a crea unități de boot EFI pentru Windows 7 și Windows Vista. Puteți rezolva această problemă descărcând 7-Zip.\\nDoriți să accesați pagina de descărcare 7-Zip?\"\r\nt MSG_103 \"Descărcați %s?\"\r\nt MSG_104 \"Începând cu %s, este necesară instalarea unui fișier '%s'.\\nAvând o mărime de peste 100 KB și fiind mereu prezent în imaginile ISO %s, acest fișier nu este integrat în Rufus.\\n\\nRufus poate descărca fișierul pentru dumneavoastră:\\n- Alegeți 'Da' pentru a vă conecta la internet și a descărca fișierul\\n- Alegeți 'Nu' dacă doriți să copiați manual acest fișier mai târziu\\n\\nObservație: Fișierul va fi descărcat în folderul curent și odată ce '%s' a fost descărcat, acesta va fi reutilizat automat.\"\r\nt MSG_105 \"Anularea poate lăsa dispozitivul într-o stare INUTILIZABILĂ.\\nDacă într-adevăr doriți să anulați, alegeți DA. În caz contrar, alegeți NU.\"\r\nt MSG_106 \"Vă rugăm să selectați folderul\"\r\nt MSG_107 \"Toate fișierele\"\r\nt MSG_108 \"Jurnal Rufus\"\r\nt MSG_109 \"0x%02X (discul %d)\"\r\nt MSG_110 \"MS-DOS nu poate porni de pe o unitate ce are dimensiunea clusterului de 64 kilobaiți.\\nVă rugăm să modificați dimensiunea clusterului sau să utilizați FreeDOS.\"\r\nt MSG_111 \"Dimensiune cluster incompatibilă\"\r\nt MSG_112 \"Formatarea volumelor UDF largi poate dura mult timp. Cu viteza USB 2.0, timpul estimat de așteptare este %d:%02d, timp în care bara de progres se va bloca. Vă rugăm să așteptați!\"\r\nt MSG_113 \"Volum UDF mare\"\r\nt MSG_114 \"Această imagine folosește Syslinux %s%s, însă această aplicație include doar fișierele de instalare pentru Syslinux %s%s.\\n\\nÎntrucât versiunile noi de Syslinux nu sunt compatibile cu cele vechi, iar Rufus nu le poate include pe toate, este necesar ca două fișiere suplimentare să fie descărcate de pe internet ('ldlinux.sys' și 'ldlinux.bss'):\\n- Alegeți 'Da' pentru a vă conecta la internet și a descărca fișierele respective\\n- Alegeți 'Nu' pentru a anula operațiunea.\\n\\nObservație: Noile fișiere vor fi descărcate în folderul curent al aplicației. Odată prezente în folder, acestea vor fi refolosite automat.\"\r\nt MSG_115 \"Descărcare necesară\"\r\nt MSG_116 \"Această imagine folosește Grub %s, însă aplicația include doar fișierele de instalare pentru Grub %s.\\n\\nÎntrucât versiunile noi de Grub pot fi incompatibile cu cele vechi, iar Rufus nu le poate include pe toate, Rufus va căuta un fișier de instalare Grub ('core.img') potrivit pentru versiunea din imaginea dvs:\\n- Alegeți 'Da' pentru a vă conecta la internet și a încerca descărcarea\\n- Alegeți 'Nu' pentru a utiliza versiunea implicită din Rufus\\n- Alegeți 'Anulare' pentru a anula operațiunea\\n\\nObservație: Noul fișier va fi descărcat în folderul curent al aplicației. Odată prezent în folder, acesta va fi refolosit automat. Daca nu este găsită nicio potrivire online, atunci va fi utilizată versiunea implicită.\"\r\nt MSG_117 \"Instalare Windows standard\"\r\nt MSG_119 \"proprietăți unitate avansate\"\r\nt MSG_120 \"opțiuni formatare avansate\"\r\nt MSG_121 \"Afișare %s\"\r\nt MSG_122 \"Ascundere %s\"\r\nt MSG_123 \"Dimensiune partiție persistentă\"\r\nt MSG_124 \"Fără persistență\"\r\nt MSG_125 \"Setați dimensiunea partiției persistente pentru dispozitivul USB live. Setarea mărimii la 0 va dezactiva partiția persistentă.\"\r\nt MSG_126 \"Alegeți unitatea de măsură pentru dimensiunea partiției.\"\r\nt MSG_127 \"Nu mai afișa acest mesaj\"\r\nt MSG_128 \"Aviz important în legătură cu %s\"\r\nt MSG_129 \"Tocmai ați creat un media care utilizează bootloader-ul UEFI:NTFS. Pentru a porni acest media, ESTE NECESAR SĂ DEZACTIVAȚI SECURE BOOT.\\nPentru a afla de ce este necesar acest lucru, alegeți 'Mai multe informații'.\"\r\nt MSG_130 \"Selectare imagine Windows\"\r\nt MSG_131 \"Acest ISO conține mai multe imagini Windows.\\nVă rugăm să selectați imaginea pe care doriți să o utilizați pentru această instalare:\"\r\nt MSG_132 \"Un alt program sau proces utilizează această unitate. Doriți să o formatați oricum?\"\r\nt MSG_133 \"Rufus a observat că încercați să creați un media Windows To Go bazat pe un ISO cu versiunea 1809.\\n\\nDin cauza unui *BUG MICROSOFT*, acest media va eșua în timpul pornirii Windows (Blue Screen Of Death), cu excepția cazului în care înlocuiți manual fișierul 'WppRecorder.sys' cu o versiune 1803.\\n\\nDe asemenea, rețineți că motivul pentru care Rufus nu poate remedia automat acest lucru pentru dvs. este că 'WppRecorder.sys' este un fișier Microsoft protejat prin drepturi de autor, deci nu putem încorpora în mod legal o copie a fișierului în aplicație...\"\r\nt MSG_134 \"Deoarece MBR a fost selectat pentru schema de partiționare, Rufus poate crea doar o partiție de până la 2 TB pe acest suport media, ceea ce va lăsa %s spațiu de disc indisponibil.\\n\\nSigur doriți să continuați?\"\r\nt MSG_135 \"Versiune\"\r\nt MSG_136 \"Lansare\"\r\nt MSG_137 \"Ediție\"\r\nt MSG_138 \"Limbă\"\r\nt MSG_139 \"Arhitectură\"\r\nt MSG_140 \"Continuare\"\r\nt MSG_141 \"Înapoi\"\r\nt MSG_142 \"Vă rugăm să așteptați...\"\r\nt MSG_143 \"Descărcați folosind un browser\"\r\nt MSG_144 \"Desărcarea de Windows ISO-uri nu este valabilă din cauza unor schimbări al paginii web de la Microsoft care previn această acțiune.\"\r\nt MSG_145 \"PowerShell 3.0 sau mai nou este necesar pentru a rula acest script.\"\r\nt MSG_146 \"Doriți să intrați pe internet și să îl descărcați?\"\r\nt MSG_148 \"Se rulează scriptul pentru descărcare...\"\r\nt MSG_149 \"Descărcare imagine ISO\"\r\nt MSG_150 \"Tipul computerului pe care doriți să utilizați unitatea bootabilă. Este responsabilitatea dvs. să determinați dacă acesta este de tip BIOS sau UEFI înainte de a crea unitatea. Dacă alegeți tipul greșit, unitatea nu va funcționa și sistemul nu va porni.\"\r\nt MSG_151 \"'UEFI-CSM' înseamnă că dispozitivul NU va porni în modul UEFI nativ, ci doar în modul de BIOS emulat (cunoscut și ca 'Legacy Mode') sub UEFI.\"\r\nt MSG_152 \"'non-CSM' înseamnă că dispozitivul va porni DOAR în modul UEFI nativ. Acesta NU va porni în modul de BIOS emulat (cunoscut și ca 'Legacy Mode').\"\r\nt MSG_153 \"Model de test: 0x%02X\"\r\nt MSG_154 \"Model de test: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Model de test: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Model de test: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Setează sistemul de fișiere pentru dispozitiv\"\r\nt MSG_158 \"Dimensiunea minimă pe care un bloc de date o va ocupa în sistemul de fișiere\"\r\nt MSG_159 \"Utilizați acest câmp pentru a seta eticheta unității.\\nSunt acceptate caractere internaționale.\"\r\nt MSG_160 \"Afișare sau ascundere opțiuni avansate\"\r\nt MSG_161 \"Căutați blocuri defecte pe dispozitiv utilizând un model de test\"\r\nt MSG_162 \"Debifați această casetă pentru a utiliza metoda de formatare \\\"înceată\\\"\"\r\nt MSG_163 \"Metoda care va fi folosită pentru a crea partiții\"\r\nt MSG_164 \"Metoda care va fi folosită pentru a face unitatea USB să fie bootabilă\"\r\nt MSG_165 \"Dați click pentru a selecta sau descărca o imagine...\"\r\nt MSG_166 \"Bifați această casetă pentru a permite afișarea etichetelor internaționale și pentru a seta o pictogramă pentru dispozitiv (se va crea un fișier autorun.inf)\"\r\nt MSG_167 \"Instalează un bootloader UEFI care poate performa validări MD5sum a fișierelor media\"\r\nt MSG_169 \"Creează o partiție ascunsă suplimentară și încearcă să alinieze delimitările pentru partiții.\\nPoate îmbunătăți detectarea pe BIOS-uri mai vechi.\"\r\nt MSG_170 \"Activează afișarea unităților de tip hard conectate prin USB. UTILIZAȚI PE PROPRIA RĂSPUNDERE!!!\"\r\nt MSG_171 \"Începe operațiunea de formatare.\\nAceasta va DISTRUGE toate datele de pe dispozitivul țintă!\"\r\nt MSG_172 \"Semnătura descărcării nu este validă\"\r\nt MSG_173 \"Dați click pentru a selecta...\"\r\nt MSG_174 \"Rufus - Instrumentul de încredere pentru formatări USB\"\r\nt MSG_175 \"Versiunea %d.%d (generare %d)\"\r\nt MSG_176 \"Traducerea în limba română:\\\\line• Alexandru Gîrlea\\\\line• Mihai Străuț\\\\line• Fedorovici Constantin-Robert\"\r\nt MSG_177 \"Raportați probleme sau solicitați îmbunătățiri la:\"\r\nt MSG_178 \"Drepturi de autor suplimentare:\"\r\nt MSG_179 \"Politică de actualizare:\"\r\nt MSG_180 \"Dacă alegeți să permiteți acestui program să caute actualizări, sunteți de acord ca următoarele informații să fie colectate și stocate pe serverele noastre:\"\r\nt MSG_181 \"Arhitectura și versiunea sistemului dvs. de operare\"\r\nt MSG_182 \"Versiunea de aplicație pe care o utilizați\"\r\nt MSG_183 \"Adresa dvs. IP\"\r\nt MSG_184 \"Vom păstra aceste informații, în scopul de a crea statistici de utilizare private, \\\\b timp de cel mult un an\\\\b0 . Totuși, vă garantăm că nu vom trimite aceste date către terțe părți.\"\r\nt MSG_185 \"Proces de actualizare:\"\r\nt MSG_186 \"Rufus nu instalează și nu rulează servicii de fundal. Așadar, căutarea actualizărilor va avea loc doar în timp ce aplicația principală rulează.\\\\line\\nAccesul la internet este, desigur, necesar atunci când se caută actualizări.\"\r\nt MSG_187 \"Imaginea nu este validă pentru opțiunea de boot selectată\"\r\nt MSG_188 \"Imaginea curentă nu se potrivește cu opțiunea de boot selectată. Vă rugăm să folosiți altă imagine sau să alegeți altă opțiune de boot.\"\r\nt MSG_189 \"Această imagine ISO nu este compatibilă cu sistemul de fișiere selectat\"\r\nt MSG_190 \"Unitate incompatibilă detectată\"\r\nt MSG_191 \"Pas scriere\"\r\nt MSG_192 \"Pas citire\"\r\nt MSG_193 \"S-a descărcat %s\"\r\nt MSG_194 \"Nu s-a putut descărca %s\"\r\nt MSG_195 \"Se folosește versiunea inclusă a fișierului/fișierelor %s\"\r\nt MSG_196 \"IMPORTANT: ACEASTĂ UNITATE UTILIZEAZĂ O MĂRIME DE SECTOR NON-STANDARD!\\n\\nUnitățile convenționale folosesc o mărime de sector de 512 baiți, însă această unitate folosește una de %d baiți. În multe cazuri, unitatea NU va porni.\\nRufus poate încerca să creeze o unitate bootabilă, însă nu există NICIO GARANȚIE că aceasta va funcționa corect.\"\r\nt MSG_197 \"Mărime sector non-standard detectată\"\r\nt MSG_198 \"'Windows To Go' poate fi instalat pe o unitate partiționată cu GPT doar dacă aceasta are atributul FIXED setat. Unitatea curentă nu a fost detectată ca fiind FIXED...\"\r\nt MSG_199 \"Această acțiune nu este valabilă pe această platformă.\"\r\nt MSG_201 \"Se anulează - Vă rugăm să așteptați...\"\r\nt MSG_202 \"Se scanează imaginea...\"\r\nt MSG_203 \"Nu s-a putut scana imaginea\"\r\nt MSG_204 \"%s învechit detectat\"\r\nt MSG_205 \"Se folosește imaginea: %s\"\r\nt MSG_206 \"Lipsește fișierul %s\"\r\nt MSG_207 \"Volum nou\"\r\nt MSG_208 \"S-a găsit %d dispozitiv\"\r\nt MSG_209 \"S-au găsit %d dispozitive\"\r\nt MSG_210 \"GATA\"\r\nt MSG_211 \"Anulat\"\r\nt MSG_212 \"Eșuat\"\r\nt MSG_213 \"Se lansează noua aplicație...\"\r\nt MSG_214 \"Lansarea noii aplicații a eșuat\"\r\nt MSG_215 \"Deschis %s\"\r\nt MSG_216 \"Salvat %s\"\r\nt MSG_217 \"Se formatează: %s\"\r\nt MSG_218 \"Se creează sistemul de fișiere: Pasul %d din %d\"\r\nt MSG_219 \"Fixup NTFS: %d%% finalizat\"\r\nt MSG_220 \"Se formatează (%s) - durată estimată %d:%02d...\"\r\nt MSG_221 \"Se setează eticheta (%s)...\"\r\nt MSG_222 \"Se formatează (%s)...\"\r\nt MSG_223 \"Fixup NTFS (Checkdisk)...\"\r\nt MSG_224 \"Se șterg structurile MBR/PBR/GPT...\"\r\nt MSG_225 \"Se solicită accesul la disc...\"\r\nt MSG_226 \"Se analizează înregistrările de boot existente...\"\r\nt MSG_227 \"Se închide volumul existent...\"\r\nt MSG_228 \"Se scrie Master Boot Record...\"\r\nt MSG_229 \"Se scrie Partition Boot Record...\"\r\nt MSG_230 \"Se copiază fișierele DOS...\"\r\nt MSG_231 \"Se copiază fișierele imaginii ISO: %s\"\r\nt MSG_232 \"Configurare boot EFI Win7 (%s)...\"\r\nt MSG_233 \"Se finalizează, vă rugăm să așteptați...\"\r\nt MSG_234 \"Se instalează Syslinux %s...\"\r\nt MSG_235 \"Blocuri defecte: %s %d/%d - %0.2f%% (erori %d/%d/%d)\"\r\nt MSG_236 \"Blocuri defecte: se testează cu modelul aleator\"\r\nt MSG_237 \"Blocuri defecte: se testează cu modelul 0x%02X\"\r\nt MSG_238 \"Se partiționează (%s)...\"\r\nt MSG_239 \"Se șterg partițiile (%s)...\"\r\nt MSG_240 \"Semnătura pentru actualizarea descărcată nu poate fi validată. Ori că sistemul dvs. nu este configurat pentru validarea semnăturilor, ori este vorba de o descărcare malițioasă.\\n\\nDescărcarea va fi ștearsă. Vă rugăm să verificați jurnalul pentru mai multe detalii.\"\r\nt MSG_241 \"Se descarcă: %s\"\r\nt MSG_242 \"Nu s-a putut descărca fișierul.\"\r\nt MSG_243 \"Se caută actualizări Rufus...\"\r\nt MSG_244 \"Actualizări: Nu s-a putut realiza conexiunea la internet\"\r\nt MSG_245 \"Actualizări: Nu s-au putut accesa datele despre versiune\"\r\nt MSG_246 \"Este disponibilă o nouă versiune Rufus!\"\r\nt MSG_247 \"Nu a fost găsită o versiune nouă de Rufus\"\r\nt MSG_248 \"Registrul de chei al aplicației a fost șters cu succes\"\r\nt MSG_249 \"Nu s-a putut șterge registrul aplicației\"\r\nt MSG_250 \"%s activat\"\r\nt MSG_251 \"%s dezactivat\"\r\nt MSG_252 \"Verificări mărime\"\r\nt MSG_253 \"Detectare hard disk\"\r\nt MSG_254 \"Formatare Large FAT32 forțată\"\r\nt MSG_255 \"NoDriveTypeAutoRun va fi șters la ieșire\"\r\nt MSG_256 \"Detectare unitate falsă\"\r\nt MSG_257 \"Suport Joliet\"\r\nt MSG_258 \"Suport Rock Ridge\"\r\nt MSG_259 \"Actualizare forțată\"\r\nt MSG_260 \"Compresie NTFS\"\r\nt MSG_261 \"Se scrie imaginea: %s\"\r\nt MSG_262 \"Suport ISO\"\r\nt MSG_263 \"Utilizare unități de măsură corecte\"\r\nt MSG_264 \"Se șterge directorul '%s'\"\r\nt MSG_265 \"Detectare disc VMWare\"\r\nt MSG_266 \"Mod UEFI/BIOS dual\"\r\nt MSG_267 \"Se aplică imaginea Windows: %s\"\r\nt MSG_268 \"Se aplică imaginea Windows...\"\r\nt MSG_269 \"Păstrare marcaje de timp\"\r\nt MSG_270 \"Depanare USB\"\r\nt MSG_271 \"Se calculează sumele de control ale imaginii: %s\"\r\nt MSG_272 \"Calculează sumele de control MD5, SHA1 și SHA256 pentru imaginea selectată\"\r\nt MSG_273 \"Schimbați limba aplicației\"\r\nt MSG_274 \"Imagine %s detectată\"\r\nt MSG_275 \"Imaginea selectată este de tip 'ISOHybrid'. Aceasta poate fi scrisă fie în modul %s (copiere fișiere) sau în modul %s (imagine disc).\\nRufus recomandă modul %s, astfel încât să aveți acces deplin la unitatea utilizată.\\nDacă vă confruntați cu probleme în timpul pornirii, puteți încerca să scrieți imaginea din nou în modul %s.\\n\\nVă rugăm să alegeți modul în care doriți să se scrie această imagine:\"\r\nt MSG_276 \"Scriere în modul %s (Recomandat)\"\r\nt MSG_277 \"Scriere în modul %s\"\r\nt MSG_278 \"Se caută procese conflictuale...\"\r\nt MSG_279 \"Nebootabil\"\r\nt MSG_280 \"Disc sau imagine ISO\"\r\nt MSG_281 \"%s (Vă rugăm să selectați)\"\r\nt MSG_282 \"Blocare unitate USB exclusivă\"\r\nt MSG_283 \"Semnătura nu este validă\"\r\nt MSG_284 \"Fișierului executabil descărcat îi lipsește o semnătură digitală.\"\r\nt MSG_285 \"Executabilul descărcat este semnat de către '%s'.\\nAceasta nu este o semnătură recunoscută și ar putea indica o anumită formă de activitate dăunătoare...\\nSigur doriți să executați acest fișier?\"\r\nt MSG_286 \"Se scriu zerouri pe unitate: %s\"\r\nt MSG_287 \"Detectarea unităților amovibile non-USB\"\r\nt MSG_288 \"Lipsă permisiuni administrator\"\r\nt MSG_289 \"Această aplicație va funcționa doar dacă o executați ca administrator\"\r\nt MSG_290 \"Indexare fișiere\"\r\nt MSG_291 \"Selectare versiune\"\r\nt MSG_292 \"Vă rugăm să selectați versiunea de Windows pe care doriți să o instalați:\"\r\nt MSG_293 \"Versiune Windows neacceptată\"\r\nt MSG_294 \"Această versiune de Windows nu mai este acceptată de Rufus.\\nUltima versiune de Rufus compatibilă cu această platformă este v%d.%d.\"\r\nt MSG_295 \"Avertisment: versiune neoficială\"\r\nt MSG_296 \"Această versiune de Rufus nu a fost produsă de dezvoltatorul oficial.\\n\\nSigur doriți să o rulați?\"\r\nt MSG_297 \"S-a detectat un ISO trunchiat\"\r\nt MSG_298 \"Fișierul ISO pe care l-ați selectat nu se potrivește cu dimensiunea sa declarată: %s de date lipsesc!\\n\\nDacă ați obținut acest fișier de pe internet, ar trebui să încercați să descărcați o copie nouă și să verificați dacă sumele de control MD5 sau SHA se potrivesc cu cele oficiale.\\n\\nRețineți că puteți calcula MD5 sau SHA în Rufus dând click pe butonul (✓).\"\r\nt MSG_299 \"Eroare validare marcaj de timp\"\r\nt MSG_300 \"Rufus nu a putut valida că marcajul de timp al actualizării descărcate este mai recent decât executabilul curent.\\n\\nPentru a preveni posibilele scenarii de atac, procesul de actualizare a fost anulat și descărcarea va fi ștearsă. Vă rugăm să verificați jurnalul pentru mai multe detalii.\"\r\nt MSG_301 \"Afișați setările aplicației\"\r\nt MSG_302 \"Afișați informații despre această aplicație\"\r\nt MSG_303 \"Afișați jurnalul\"\r\nt MSG_304 \"Generați o imagine de disc după dispozitivul selectat\"\r\nt MSG_305 \"Utilizați această opțiune pentru a indica dacă planificați să instalați Windows pe un alt disc, sau dacă doriți să rulați Windows direct de pe această unitate (Windows To Go).\"\r\nt MSG_306 \"Se scriu rapid zerouri pe unitate: %s\"\r\nt MSG_307 \"poate dura mai mult timp\"\r\nt MSG_308 \"Detectare VHD\"\r\nt MSG_309 \"Arhivă comprimată\"\r\nt MSG_310 \"Fișierul ISO selectat utilizează UEFI și este destul de mic pentru a fi scris ca EFI System Partition (ESP). Scrierea ca ESP, în locul scrierii unei partiții generice ce ocupă întregul disc, este de preferat pentru anumite tipuri de instalare.\\n\\nVă rugăm să selectați modul în care doriți să scrieți această imagine:\"\r\nt MSG_311 \"Folosiți %s (în fereastra principală a aplicației) pentru a activa.\"\r\nt MSG_312 \"Hash-uri extra (SHA512)\"\r\nt MSG_313 \"Salvare pe VHD\"\r\nt MSG_314 \"Calculare sume de control pentru imagine\"\r\nt MSG_315 \"Butoane multiple\"\r\nt MSG_316 \"Număr de pași\"\r\nt MSG_317 \"ID disc\"\r\nt MSG_318 \"Prioritate implicită pentru firul de execuție: %d\"\r\nt MSG_319 \"Ignorare Boot Marker\"\r\nt MSG_320 \"Se reîmprospătează așezarea partițiilor (%s)...\"\r\nt MSG_321 \"Imaginea selectată este de tip ISOHybrid, însă creatorii acesteia nu au făcut-o să fie compatibilă cu modul ISO/Copiere fișiere.\\nDrept urmare, modul imagine DD va fi aplicat.\"\r\nt MSG_322 \"Nu se poate deschide sau citii '%s'\"\r\nt MSG_325 \"Aplicând modificări la Windows: %s\"\r\nt MSG_326 \"Aplicând optiuni de utilizator...\"\r\nt MSG_327 \"Experiența utilizatorului de Windows\"\r\nt MSG_328 \"Doriți să modificați instalația de Windows?\"\r\nt MSG_329 \"Elimină necesitatea de 4GB+ RAM, Bootare Securizată si TPM 2.0\"\r\nt MSG_330 \"Elimină necesitatea pentru un cont Microsoft\"\r\nt MSG_331 \"Blochează colectarea de date (Sari peste întrebările de intimitate)\"\r\nt MSG_332 \"Blochează Windows To Go de la accesarea discurilor interne\"\r\nt MSG_333 \"Crează un cont local cu nume de utilizator:\"\r\nt MSG_334 \"Serează opțiunile regionale să aibă aceleași valori ca acestui utilizator\"\r\nt MSG_335 \"Blochează BitLocker de la encriptarea automată a dispozitivului\"\r\nt MSG_336 \"Logare persistentă\"\r\nt MSG_337 \"Un fișier adițional ('%s') trebuie să fie descărcat de la Microsoft pentru a utiliza această funcție:\\n- Selectează 'Da' ca să te conectezi la Internet și să le descarci\\n- Selectează 'Nu' pentru a anula operațiunea\\n\\nNotiță: Acest fișier va fi descărcat in aceeași locație cu aplicația și va fi reutilizat automat dacă este prezent.\"\r\nt MSG_338 \"Bootloader UEFI nepermis detectat\"\r\nt MSG_339 \"Rufus a detectat că fișierul ISO care lai selectat conține un bootloader UEFI care nu este permis si ar produce %s, cand Secure Boot este activat pe un system UEFI actualizat.\\n\\n- Dacă ai făcut rost de aceasta imagine ISO de la o sursă de neîncredere, este recomandat să consideri posibilitatea că ar putea conține malware UEFI ce nu ar permite pornirea de la aceasta.\\n- Dacă ai făcut rost de aceasta de la o sursă de încredere, ar putea fi necesară căutarea unei versiuni mai noi, care nu ar produce acest avertisment.\"\r\nt MSG_340 \"un ecran de \\\"Încălcare de Securitate\\\"\"\r\nt MSG_341 \"un ecran de Recuperare Windows (BSOD) cu '%s'\"\r\nt MSG_342 \"Imagine VHDX comprimată\"\r\nt MSG_343 \"Imagine VHD necomprimată\"\r\nt MSG_344 \"Flash complet de imagine de actualizare\"\r\nt MSG_345 \"Niște date adiționale trebuie descărcate de la Microsoft pentru a folosii această funție:\\n- Selectează 'Da' ca să te conectezi la Internet și să le descarci\\n- Selectează 'Nu' pentru a anula operațiunea\"\r\nt MSG_346 \"Restricționează Windows la S-Mode (INCOMPATIBIL cu bypass-ul pentru un cont online)\"\r\nt MSG_347 \"Mod expert\"\r\nt MSG_348 \"Extractând fișiere arhivate: %s\"\r\nt MSG_349 \"Folosește Rufus MBR\"\r\nt MSG_900 \"Rufus este un utilitar care ajută la formatarea și crearea de drive-uri USB bootabile, precum cheile sau pendriverele USB, unități de memorie, etc.\"\r\nt MSG_901 \"Site official: %s\"\r\nt MSG_902 \"Codul Sursei: %s\"\r\nt MSG_903 \"Listă de schimbări: %s\"\r\nt MSG_904 \"Această aplicație este sub liciența și termenii și condițiile ale lui GNU Public License (GPL) versiunea a 3-a.\\nVazi https://www.gnu.org/licenses/gpl-3.0.en.html pentru detalii.\"\r\nt MSG_905 \"Bootează\"\r\nt MSG_910 \"Formatează USB, card flash si drive-uri virtuale la FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Crează drive USB bootabil FreeDOS\"\r\nt MSG_912 \"Crează drive-uri bootabile de la ISO-uri bootabile (Windows, Linux, etc.)\"\r\nt MSG_913 \"Crează drive-uri de la imagini de disc bootabile, incluzând cele compresate\"\r\nt MSG_914 \"Crează discuri bootabile BIOS sau UEFI, incluzând NTFS-uri bootabile de UEFI\"\r\nt MSG_915 \"Crează discuri 'Windows To Go'\"\r\nt MSG_916 \"Crează drive de instalare Windows 11 pe computere care nu au TPM sau Bootare Securizată\"\r\nt MSG_917 \"Crează partiție de Linux persistentă\"\r\nt MSG_918 \"Crează imagini VHD/DD de pe drive-ul selectat\"\r\nt MSG_919 \"Compută MD5, SHA-1, SHA-256 și SHA-512 suma de control ale imaginilor selectate\"\r\nt MSG_920 \"Verifică blocuri rele, incluzând detectarea de drive-uri flash \\\"false\\\"\"\r\nt MSG_921 \"Descarcă un Microsoft Windows ISO oficial de vânzare\"\r\nt MSG_922 \"Descarcă UEFI Shell ISO-uri\"\r\n\r\n#########################################################################\r\nl \"ru-RU\" \"Russian (Русский)\" 0x0419, 0x0819\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"О программе Rufus\"\r\nt IDC_ABOUT_LICENSE \"Лицензия\"\r\nt IDOK \"ОК\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Свойства диска\"\r\nt IDS_DEVICE_TXT \"Устройство\"\r\nt IDS_BOOT_SELECTION_TXT \"Метод загрузки\"\r\nt IDC_SELECT \"Выбрать\"\r\nt IDS_IMAGE_OPTION_TXT \"Параметры образа\"\r\nt IDS_PARTITION_TYPE_TXT \"Схема раздела\"\r\nt IDS_TARGET_SYSTEM_TXT \"Целевая система\"\r\nt IDC_LIST_USB_HDD \"Список USB-дисков\"\r\nt IDC_OLD_BIOS_FIXES \"Добавить исправления для старых BIOS\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Проверка носителя UEFI во время выполнения\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Параметры форматирования\"\r\nt IDS_FILE_SYSTEM_TXT \"Файловая система\"\r\nt IDS_CLUSTER_SIZE_TXT \"Размер кластера\"\r\nt IDS_LABEL_TXT \"Новая метка тома\"\r\nt IDC_QUICK_FORMAT \"Быстрое форматирование\"\r\nt IDC_BAD_BLOCKS \"Проверить на плохие блоки\"\r\nt IDC_EXTENDED_LABEL \"Создать расширенную метку и значок устройства\"\r\nt IDS_STATUS_TXT \"Статус\"\r\nt IDCANCEL \"Закрыть\"\r\nt IDC_START \"Старт\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Закрыть\"\r\nt IDD_LICENSE \"Лицензия Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Закрыть\"\r\nt IDD_LOG \"Журнал\"\r\nt IDC_LOG_CLEAR \"Очистить\"\r\nt IDC_LOG_SAVE \"Сохранить\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Закрыть\"\r\nt IDD_NEW_VERSION \"Проверка наличия обновлений - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Доступна новая версия. Скачайте её!\"\r\nt IDC_WEBSITE \"Щёлкните здесь, чтобы перейти на сайт\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Примечания к версии\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Скачать\"\r\nt IDC_DOWNLOAD \"Скачать\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Ещё\"\r\nt IDYES \"Да\"\r\nt IDNO \"Нет\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Закрыть\"\r\nt IDD_UPDATE_POLICY \"Политика обновления и параметры\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Параметры\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Проверка наличия обновлений\"\r\nt IDS_INCLUDE_BETAS_TXT \"Включая бета-версии\"\r\nt IDC_CHECK_NOW \"Проверить\"\r\n\r\nt MSG_001 \"Запущена другая копия Rufus\"\r\nt MSG_002 \"Запущена другая копия программы.\\nЗакройте первую копию перед запуском ещё одной.\"\r\nt MSG_003 \"ВНИМАНИЕ: ВСЕ ДАННЫЕ НА ДИСКЕ '%s' БУДУТ УНИЧТОЖЕНЫ.\\nЧтобы продолжить, нажмите ОК. Для выхода нажмите 'Отмена'.\"\r\nt MSG_004 \"Политика обновления Rufus\"\r\nt MSG_005 \"Хотите, чтобы Rufus проверял обновления автоматически?\"\r\nt MSG_006 \"Закрыть\"\r\nt MSG_007 \"Отмена\"\r\nt MSG_008 \"Да\"\r\nt MSG_009 \"Нет\"\r\nt MSG_010 \"Найдены плохие блоки\"\r\nt MSG_011 \"Проверка закончена. Плохих блоков: %d\\n  Ошибок чтения: %d\\n  Ошибок записи: %d\\n  Повреждённых блоков: %d\"\r\nt MSG_012 \"%s\\nПодробный отчёт см. тут:\\n%s\"\r\nt MSG_013 \"Отключено\"\r\nt MSG_014 \"Ежедневно\"\r\nt MSG_015 \"Еженедельно\"\r\nt MSG_016 \"Ежемесячно\"\r\nt MSG_017 \"По выбору\"\r\nt MSG_018 \"Ваша версия: %d.%d (сборка %d)\"\r\nt MSG_019 \"Новейшая версия: %d.%d (сборка %d)\"\r\nt MSG_020 \"байт\"\r\nt MSG_021 \"КБ\"\r\nt MSG_022 \"МБ\"\r\nt MSG_023 \"ГБ\"\r\nt MSG_024 \"ТБ\"\r\nt MSG_025 \"ПБ\"\r\nt MSG_026 \"байт\"\r\nt MSG_027 \"КБ\"\r\nt MSG_028 \"МБ\"\r\nt MSG_029 \"По умолчанию\"\r\nt MSG_030 \"%s (по умолчанию)\"\r\nt MSG_031 \"BIOS (или UEFI-CSM)\"\r\nt MSG_032 \"UEFI (не-CSM)\"\r\nt MSG_033 \"BIOS или UEFI\"\r\nt MSG_034 \"%d проход\"\r\nt MSG_035 \"%d прохода %s\"\r\nt MSG_036 \"Образ ISO\"\r\nt MSG_037 \"Приложение\"\r\nt MSG_038 \"Отменить\"\r\nt MSG_039 \"Запустить\"\r\nt MSG_040 \"Скачать\"\r\nt MSG_041 \"Операция прервана пользователем\"\r\nt MSG_042 \"Ошибка\"\r\nt MSG_043 \"Ошибка: %s\"\r\nt MSG_044 \"Скачивание файла\"\r\nt MSG_045 \"USB-устройство хранения данных\"\r\nt MSG_046 \"%s (Диск %d) [%s]\"\r\nt MSG_047 \"Несколько разделов\"\r\nt MSG_048 \"Очистка буферов\"\r\nt MSG_049 \"Отмена\"\r\nt MSG_050 \"Успешно.\"\r\nt MSG_051 \"Неизвестная ошибка при форматировании.\"\r\nt MSG_052 \"Для этого устройства невозможно использовать выбранную файловую систему.\"\r\nt MSG_053 \"Нет доступа к устройству.\"\r\nt MSG_054 \"Носитель данных защищён от записи.\"\r\nt MSG_055 \"Это устройство используется другим процессом. Сначала завершите процесс.\"\r\nt MSG_056 \"Для этого устройства быстрый формат недоступен.\"\r\nt MSG_057 \"Недопустимая метка тома.\"\r\nt MSG_058 \"Недопустимый дескриптор устройства.\"\r\nt MSG_059 \"Недопустимый размер кластера для этого устройства.\"\r\nt MSG_060 \"Недопустимый размер тома.\"\r\nt MSG_061 \"Вставьте сменный носитель информации в устройство.\"\r\nt MSG_062 \"Получена неподдерживаемая команда.\"\r\nt MSG_063 \"Ошибка распределения памяти.\"\r\nt MSG_064 \"Ошибка чтения.\"\r\nt MSG_065 \"Ошибка записи.\"\r\nt MSG_066 \"Ошибка установки\"\r\nt MSG_067 \"Невозможно открыть носитель информации. Возможно, он используется другим процессом. Извлеките носитель информации и вставьте его вновь.\"\r\nt MSG_068 \"Не удалось создать раздел на диске.\"\r\nt MSG_069 \"Не удалось скопировать файлы на целевое устройство.\"\r\nt MSG_070 \"Отменено пользователем.\"\r\nt MSG_071 \"Невозможно запустить поток.\"\r\nt MSG_072 \"Проверка на плохие блоки не завершена.\"\r\nt MSG_073 \"Ошибка сканирования образа ISO.\"\r\nt MSG_074 \"Ошибка извлечения образа ISO.\"\r\nt MSG_075 \"Невозможно перемонтировать том.\"\r\nt MSG_076 \"Невозможно исправить/настроить файлы для загрузки.\"\r\nt MSG_077 \"Невозможно назначить букву диска.\"\r\nt MSG_078 \"Невозможно смонтировать том GUID.\"\r\nt MSG_079 \"Устройство не готово.\"\r\nt MSG_080 \"Rufus обнаружил, что Windows всё ещё очищает внутренний буфер USB-устройства.\\n\\nВ зависимости от скорости USB-устройства, эта операция может занять много времени, особенно для больших файлов.\\n\\nЧтобы избежать повреждения устройства, дождитесь, пока Windows закончит. Но если Вам надоест ждать, можете просто отключить устройство...\"\r\nt MSG_081 \"Неподдерживаемый образ\"\r\nt MSG_082 \"Образ либо незагрузочный, либо использует метод загрузки или сжатия, не поддерживаемый Rufus.\"\r\nt MSG_083 \"Заменить %s?\"\r\nt MSG_084 \"Образ ISO использует устаревшую версию '%s'.\\nЗагрузочные меню могут отображаться неправильно.\\n\\nНовую версию можно скачать с помощью Rufus:\\n- Выберите 'Да', чтобы скачать файл из Интернета\\n- Выберите 'Нет', чтобы не изменять образ ISO\\nЕсли вы не знаете, что делать, то выберите 'Да'.\\n\\nФайл загрузится в текущую папку, а если в ней есть '%s', то он будет автоматически заменён.\"\r\nt MSG_085 \"Загрузка %s\"\r\nt MSG_086 \"Не выбран образ\"\r\nt MSG_087 \"для %s NAND\"\r\nt MSG_088 \"Слишком большой образ\"\r\nt MSG_089 \"Образ слишком большой для выбранного устройства.\"\r\nt MSG_090 \"Неподдерживаемый образ ISO\"\r\nt MSG_091 \"При использовании целевого типа UEFI поддерживаются только загрузочные образы ISO. Выберите загрузочный образ EFI или измените целевой тип BIOS.\"\r\nt MSG_092 \"Неподдерживаемая файловая система\"\r\nt MSG_093 \"ВАЖНО: НА ЭТОМ ДИСКЕ НЕСКОЛЬКО РАЗДЕЛОВ!!\\n\\nЭтот диск может содержать разделы/тома, которые отсутствуют в списке или даже не видны в Windows. В случае продолжения Вы несёте ответственность за любую потерю данных на этих разделах.\"\r\nt MSG_094 \"Обнаружено несколько разделов\"\r\nt MSG_095 \"DD-образ\"\r\nt MSG_096 \"Выбранная файловая система не может использоваться с этим типом образа ISO. Выберите другую файловую систему или другой образ ISO.\"\r\nt MSG_097 \"'%s' может использоваться только с файловой системой NTFS.\"\r\nt MSG_098 \"ВАЖНО: Вы пытаетесь установить Windows To Go, но у целевого диска нет атрибута 'FIXED' (несъёмный). Из-за этого Windows, скорее всего, зависнет при загрузке, так как Windows To Go предназначена для работы только с дисками с атрибутом 'REMOVABLE' (съёмный).\\n\\nВсё равно хотите продолжить?\\n\\n* Атрибут 'FIXED/REMOVABLE' - это свойство оборудования. Его можно изменить только с помощью специальных инструментов от производителя, которые ПОЧТИ НИКОГДА не предоставляются общественности...\"\r\nt MSG_099 \"Ограничения файловой системы\"\r\nt MSG_100 \"Этот образ ISO содержит файл размером более 4 ГБ, что превосходит максимальный размер для файловой системы FAT или FAT32.\"\r\nt MSG_101 \"Отсутствует поддержка WIM\"\r\nt MSG_102 \"Ваша система не может извлекать файлы из архивов WIM. Распаковка таких архивов необходима для создания загрузочных USB-накопителей EFI для Windows 7 и Windows Vista. Чтобы решить эту проблему, установите новейшую версию 7-Zip.\\nОткрыть страницу загрузки 7-Zip?\"\r\nt MSG_103 \"Загрузить %s?\"\r\nt MSG_104 \"%s или новее требует наличия файла '%s'.\\nПоскольку размер этого файла больше 100 КБ, и он всегда присутствует в ISO-образах %s, он не встроен в Rufus.\\n\\nRufus может скачать недостающий файл:\\n- Выберите 'Да', если хотите скачать этот файл\\n- Выберите 'Нет', если хотите скачать его вручную позже\\n\\n* Файл будет скачан в текущую папку. Если в ней есть '%s', он будет автоматически перезаписан.\"\r\nt MSG_105 \"При отмене устройство может оказаться в НЕРАБОЧЕМ состоянии.\\nЕсли Вы уверены, что хотите отменить операцию, нажмите 'Да'. Иначе - нажмите 'Нет'.\"\r\nt MSG_106 \"Выберите папку\"\r\nt MSG_107 \"Все файлы\"\r\nt MSG_108 \"Журнал Rufus\"\r\nt MSG_109 \"0x%02X (Диск %d)\"\r\nt MSG_110 \"MS-DOS не может загрузиться с диска с кластерами размером 64 КБ.\\nИзмените размер кластера или используйте FreeDOS.\"\r\nt MSG_111 \"Несовместимый размер кластеров\"\r\nt MSG_112 \"Форматирование больших томов UDF может занять много времени. При скоростях USB 2.0 форматирование продлится примерно %d:%02d, в течение этого времени индикатор хода операции будет казаться неработающим. Проявите терпение, пожалуйста!\"\r\nt MSG_113 \"Большой UDF-том\"\r\nt MSG_114 \"Этот образ использует Syslinux %s%s, но в данном приложении есть только установочные файлы для Syslinux %s%s.\\n\\nТак как версии Syslinux несовместимы друг с другом, дополнительные файлы (ldlinux.sys and ldlinux.bss) нужно загрузить из Интернета:\\n- Выберите 'Да', чтобы скачать файлы из Интернета\\n- Выберите 'Нет', чтобы отменить операцию\\n\\n* Файлы загрузятся в текущую папку приложения, имеющиеся там одноимённые файлы будут перезаписаны.\"\r\nt MSG_115 \"Требуется загрузка из Интернета\"\r\nt MSG_116 \"Этот образ использует загрузчик GRUB %s, но приложение включает только установочные файлы для GRUB %s.\\n\\nРазличные версии GRUB могут быть несовместимы друг с другом. Rufus попытается найти нужную версию установочного файла GRUB (core.img), соответствующую версии загрузчика вашего образа:\\n- Выберите 'Да', чтобы скачать установочный файл из Интернета\\n- Выберите 'Нет', чтобы использовать версию по умолчанию из Rufus\\n- Выберите 'Отмена', чтобы отменить операцию\\n\\n* Файл загрузится в текущую папку приложения, если в ней уже есть одноимённый файл, он будет автоматически перезаписан. Если нужную версию установщика не удастся найти в Интернете, будет использоваться версия по умолчанию.\"\r\nt MSG_117 \"Стандартная установка Windows\"\r\nt MSG_119 \"расширенные свойства диска\"\r\nt MSG_120 \"расширенные параметры форматирования\"\r\nt MSG_121 \"Показать %s\"\r\nt MSG_122 \"Скрыть %s\"\r\nt MSG_123 \"Постоянный размер раздела\"\r\nt MSG_124 \"Без раздела\"\r\nt MSG_125 \"Установите размер постоянного раздела для live-носителя USB. 0 - отключить постоянный раздел.\"\r\nt MSG_126 \"Установите единицы размера раздела.\"\r\nt MSG_127 \"Больше это не показывать\"\r\nt MSG_128 \"Важное примечание о %s\"\r\nt MSG_129 \"Вы только что создали носитель с загрузчиком UEFI:NTFS. Учтите, что для загрузки этого носителя НУЖНО ОТКЛЮЧИТЬ БЕЗОПАСНУЮ ЗАГРУЗКУ.\\nЧтобы узнать, почему это необходимо, нажмите кнопку 'Ещё'.\"\r\nt MSG_130 \"Выбор образа Windows\"\r\nt MSG_131 \"Этот файл ISO содержит несколько образов Windows.\\nВыберите образ, который Вы хотите использовать для этой установки:\"\r\nt MSG_132 \"К этому диску обращается другая программа или процесс. Всё равно настаиваете на форматировании?\"\r\nt MSG_133 \"Rufus обнаружил, что вы пытаетесь создать носитель Windows To Go на основе ISO 1809.\\n\\nИз-за *ОШИБКИ MICROSOFT* этот носитель будет давать сбой при загрузке Windows (BSOD), если вы вручную не замените файл WppRecorder.sys версией 1803.\\n\\nRufus не может это исправить автоматически, так как WppRecorder.sys - это файл Microsoft, защищённый авторскими правами, поэтому мы не можем легально встраивать в приложение его копию.\"\r\nt MSG_134 \"Поскольку для схемы разделов выбрана MBR, на этом носителе Rufus может создать только раздел размером до 2 ТБ, а %s дискового пространства останутся недоступными.\\n\\nВы действительно хотите продолжить?\"\r\nt MSG_135 \"Версия\"\r\nt MSG_136 \"Выпуск\"\r\nt MSG_137 \"Редакция\"\r\nt MSG_138 \"Язык\"\r\nt MSG_139 \"Архитектура\"\r\nt MSG_140 \"Продолжить\"\r\nt MSG_141 \"Назад\"\r\nt MSG_142 \"Подождите...\"\r\nt MSG_143 \"Скачать в браузере\"\r\nt MSG_144 \"Microsoft временно заблокировала скачивание образов Windows из-за большого количества загрузок.\"\r\nt MSG_145 \"Для запуска этого скрипта требуется PowerShell версии 3.0 или новее.\"\r\nt MSG_146 \"Хотите скачать из Интернета?\"\r\nt MSG_148 \"Запуск загрузки скрипта...\"\r\nt MSG_149 \"Загрузить образ ISO\"\r\nt MSG_150 \"Тип компьютера, с которым вы планируете использовать этот загрузочный диск. Прежде чем создавать диск, вы должны определить, что используется в вашей системе: BIOS или UEFI, иначе диск может не загрузиться.\"\r\nt MSG_151 \"'UEFI-CSM' означает, что устройство будет загружаться только в режиме эмуляции BIOS (также называемом 'Legacy Mode') под UEFI, а не в режиме UEFI.\"\r\nt MSG_152 \"'non-CSM' означает, что устройство будет загружаться только в режиме UEFI, а не в режиме эмуляции BIOS (также известном как 'Legacy Mode').\"\r\nt MSG_153 \"Тестовый образец: 0x%02X\"\r\nt MSG_154 \"Тестовый образец: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Тестовый образец: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Тестовый образец: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Выбор целевой файловой системы\"\r\nt MSG_158 \"Выбор минимального размера блока данных в файловой системе\"\r\nt MSG_159 \"Запись новой метки тома.\\nПоддерживаются международные символы.\"\r\nt MSG_160 \"Развернуть дополнительные параметры\"\r\nt MSG_161 \"Проверка устройства на плохие блоки с помощью тестового образца\"\r\nt MSG_162 \"Снимите этот флажок, чтобы использовать \\\"медленное\\\" форматирование\"\r\nt MSG_163 \"Метод, который будет использоваться для создания разделов\"\r\nt MSG_164 \"Метод, который будет использоваться для создания загрузочного диска\"\r\nt MSG_165 \"Нажмите, чтобы выбрать или загрузить образ...\"\r\nt MSG_166 \"Разрешить отображение меток с международными символами и задать значок устройства\\n(создаётся файл autorun.inf)\"\r\nt MSG_167 \"Установить загрузчик UEFI, который проверит файл MD5Sum на носителе\"\r\nt MSG_169 \"Создать дополнительный скрытый раздел и попробовать выровнять границы разделов.\\nЭто может улучшить обнаружение загрузчика в старых BIOS.\"\r\nt MSG_170 \"Отображать внешние жёсткие диски USB.\\nИСПОЛЬЗУЙТЕ НА СВОЙ СТРАХ И РИСК!\"\r\nt MSG_171 \"Начать форматирование.\\nВсе данные на диске будут УНИЧТОЖЕНЫ!\"\r\nt MSG_172 \"Неверная подпись обновления\"\r\nt MSG_173 \"Нажмите для выбора...\"\r\nt MSG_174 \"Rufus - Надёжная утилита для форматирования USB-дисков\"\r\nt MSG_175 \"Версия %d.%d (сборка %d)\"\r\nt MSG_176 \"Русский перевод: Дмитрий Ерохин <mailto:erodim@mail.ru>\"\r\nt MSG_177 \"Сообщить об ошибке или предложить улучшение:\"\r\nt MSG_178 \"Дополнительные авторские права:\"\r\nt MSG_179 \"Политика обновления:\"\r\nt MSG_180 \"Разрешая проверку обновлений, Вы соглашаетесь, что на наших серверах может собираться следующая информация:\"\r\nt MSG_181 \"Версия и архитектура Вашей операционной системы\"\r\nt MSG_182 \"Версия используемого приложения\"\r\nt MSG_183 \"Ваш IP-адрес\"\r\nt MSG_184 \"Для получения статистики использования программы мы можем хранить собранную информацию \\\\b не более года\\\\b0 . Однако мы не будем добровольно раскрывать какие-либо из этих персональных данных сторонним лицам.\"\r\nt MSG_185 \"Обновление:\"\r\nt MSG_186 \"Rufus не устанавливает и не запускает фоновые службы, поэтому проверка наличия обновлений выполняется, только когда запущено основное приложение.\\\\line\\nДля проверки обновлений требуется доступ к Интернету.\"\r\nt MSG_187 \"Неверный образ для выбранного варианта загрузки\"\r\nt MSG_188 \"Текущий образ не соответствует выбранному варианту загрузки. Выберите другой образ или другой вариант загрузки.\"\r\nt MSG_189 \"Этот образ ISO не совместим с выбранной файловой системой\"\r\nt MSG_190 \"Обнаружен несовместимый диск\"\r\nt MSG_191 \"Запись\"\r\nt MSG_192 \"Чтение\"\r\nt MSG_193 \"Загружено %s\"\r\nt MSG_194 \"Не удалось загрузить %s\"\r\nt MSG_195 \"Использовать встроенную версию %s файлов\"\r\nt MSG_196 \"ВАЖНО: НА ЭТОМ ДИСКЕ СЕКТОРЫ НЕСТАНДАРТНОГО РАЗМЕРА!\\n\\nОбычные накопители используют секторы размером 512 байт, а на этом диске они %d-байтовые. Во многих случаях это означает, что Вы НЕ СМОЖЕТЕ загрузиться с этого диска.\\nRufus попытается создать загрузочный диск, но БЕЗ ГАРАНТИИ, что он будет работать.\"\r\nt MSG_197 \"Обнаружен нестандартный размер секторов\"\r\nt MSG_198 \"Windows To Go может быть установлена на диск с разделом GPT только в том случае, если у диска есть атрибут FIXED (несъёмный). У выбранного диска такого атрибута не обнаружено.\"\r\nt MSG_199 \"Эта функция недоступна на данной платформе.\"\r\nt MSG_201 \"Отмена, подождите...\"\r\nt MSG_202 \"Сканирование образа...\"\r\nt MSG_203 \"Не удалось просканировать образ\"\r\nt MSG_204 \"Обнаружен устаревший %s\"\r\nt MSG_205 \"Используется образ: %s\"\r\nt MSG_206 \"Отсутствует файл %s\"\r\nt MSG_207 \"Новый том\"\r\nt MSG_208 \"Обнаружено устройств: %d\"\r\nt MSG_209 \"Обнаружено устройств: %d\"\r\nt MSG_210 \"Готов\"\r\nt MSG_211 \"Отменено\"\r\nt MSG_212 \"Ошибка\"\r\nt MSG_213 \"Запуск нового приложения...\"\r\nt MSG_214 \"Не удалось запустить новое приложение\"\r\nt MSG_215 \"Открыт %s\"\r\nt MSG_216 \"Сохранён %s\"\r\nt MSG_217 \"Форматирование: %s\"\r\nt MSG_218 \"Создание файловой системы: %d/%d выполнено\"\r\nt MSG_219 \"NTFS Fixup: %d%% выполнено\"\r\nt MSG_220 \"Форматирование (%s), примерно %d:%02d...\"\r\nt MSG_221 \"Установка метки (%s)...\"\r\nt MSG_222 \"Форматирование (%s)...\"\r\nt MSG_223 \"Проверка NTFS-области Fixup...\"\r\nt MSG_224 \"Очистка структур MBR/PBR/GPT...\"\r\nt MSG_225 \"Запрос доступа к диску...\"\r\nt MSG_226 \"Анализ загрузочных записей...\"\r\nt MSG_227 \"Закрытие существующего тома...\"\r\nt MSG_228 \"Запись главной загрузочной записи...\"\r\nt MSG_229 \"Запись загрузочной записи раздела...\"\r\nt MSG_230 \"Копирование DOS-файлов...\"\r\nt MSG_231 \"Копирование ISO-файлов: %s\"\r\nt MSG_232 \"Настройка EFI-загрузки Win7 (%s)...\"\r\nt MSG_233 \"Завершение, подождите...\"\r\nt MSG_234 \"Установка Syslinux %s...\"\r\nt MSG_235 \"Плохие блоки: %s %d/%d - %0.2f%% (ошибки: %d/%d/%d)\"\r\nt MSG_236 \"Плохие блоки: Тестирование со случайным шаблоном\"\r\nt MSG_237 \"Плохие блоки: Тестирование с шаблоном 0x%02X\"\r\nt MSG_238 \"Разметка раздела (%s)...\"\r\nt MSG_239 \"Удаление разделов (%s)...\"\r\nt MSG_240 \"Невозможно проверить подпись загруженного обновления. Это может означать, что Ваша система неправильно настроена для проверки подписей, либо было загружено вредоносное ПО.\\n\\nОбновление будет удалено. См. подробности в файле-журнале.\"\r\nt MSG_241 \"Загрузка: %s\"\r\nt MSG_242 \"Не удалось скачать файл.\"\r\nt MSG_243 \"Проверка наличия обновлений...\"\r\nt MSG_244 \"Обновления: Нет доступа в Интернет\"\r\nt MSG_245 \"Обновления: Нет доступа к данным о версии\"\r\nt MSG_246 \"Доступна новая версия Rufus!\"\r\nt MSG_247 \"Новых версий Rufus не найдено\"\r\nt MSG_248 \"Ключи приложения в реестре успешно удалены\"\r\nt MSG_249 \"Не удалось удалить ключи приложения в реестре\"\r\nt MSG_250 \"%s - вкл.\"\r\nt MSG_251 \"%s - откл.\"\r\nt MSG_252 \"Определение размера\"\r\nt MSG_253 \"Определение накопителей\"\r\nt MSG_254 \"Форматирование в Large FAT32\"\r\nt MSG_255 \"Параметр NoDriveTypeAutorun будет удалён при выходе\"\r\nt MSG_256 \"Обнаружение поддельных дисков\"\r\nt MSG_257 \"Поддержка Joliet\"\r\nt MSG_258 \"Поддержка Rock Ridge\"\r\nt MSG_259 \"Принудительное обновление\"\r\nt MSG_260 \"NTFS-сжатие\"\r\nt MSG_261 \"Запись образа: %s\"\r\nt MSG_262 \"Поддержка ISO\"\r\nt MSG_263 \"Использовать правильные размеры\"\r\nt MSG_264 \"Удаление папки '%s'\"\r\nt MSG_265 \"Обнаружение дисков VMWare\"\r\nt MSG_266 \"Двойной режим UEFI/BIOS\"\r\nt MSG_267 \"Применение образа Windows: %s\"\r\nt MSG_268 \"Применение образа Windows...\"\r\nt MSG_269 \"Сохранять даты\"\r\nt MSG_270 \"USB-отладка\"\r\nt MSG_271 \"Вычисление контрольных сумм: %s\"\r\nt MSG_272 \"Вычислить контрольные суммы MD5, SHA1 и SHA256 для выбранного образа\"\r\nt MSG_273 \"Изменить язык приложения\"\r\nt MSG_274 \"Обнаружен образ %s\"\r\nt MSG_275 \"Выбран образ ISOHybrid. Это означает, что его можно записать либо в %s режиме копирования файлов, либо в %s режиме образа диска.\\nДля полного доступа к диску после записи рекомендуется использовать режим %s.\\nЕсли возникают проблемы при загрузке, ещё раз попробуйте записать образ в режиме %s.\\n\\nВыберите режим записи этого образа:\"\r\nt MSG_276 \"Запись в режиме %s (рекомендуется)\"\r\nt MSG_277 \"Запись в режиме %s\"\r\nt MSG_278 \"Проверка конфликтующих процессов...\"\r\nt MSG_279 \"Незагрузочный\"\r\nt MSG_280 \"Диск или образ ISO\"\r\nt MSG_281 \"%s (выберите)\"\r\nt MSG_282 \"Эксклюзивная блокировка USB-диска\"\r\nt MSG_283 \"Неверная подпись\"\r\nt MSG_284 \"У загруженного файла отсутствует цифровая подпись.\"\r\nt MSG_285 \"Загруженный файл подписан '%s'.\\nЭто не наша подпись, возможно, похозяйничало вредоносное ПО...\\nВы действительно хотите запустить этот файл?\"\r\nt MSG_286 \"Обнуление диска: %s\"\r\nt MSG_287 \"Обнаружение съёмных дисков не-USB\"\r\nt MSG_288 \"Отсутствуют повышенные привилегии\"\r\nt MSG_289 \"Эта программа может работать только с повышенными правами\"\r\nt MSG_290 \"Индексирование файлов\"\r\nt MSG_291 \"Выбор версии\"\r\nt MSG_292 \"Выберите версию Windows для установки:\"\r\nt MSG_293 \"Неподдерживаемая версия Windows\"\r\nt MSG_294 \"Эта версия Windows больше не поддерживается Rufus.\\nПоследняя версия Rufus, совместимая с этой платформой - v%d.%d.\"\r\nt MSG_295 \"ВНИМАНИЕ: Неофициальная версия\"\r\nt MSG_296 \"Эта версия Rufus не была выпущена официальным разработчиком.\\n\\nВы действительно хотите её запустить?\"\r\nt MSG_297 \"Обнаружен усечённый образ ISO\"\r\nt MSG_298 \"Выбранный образ ISO не соответствует заявленному размеру: %s данных отсутствует!\\n\\nЕсли Вы скачали этот файл из Интернета, загрузите его снова и проверьте, совпадают ли контрольные суммы MD5 или SHA.\\n\\nЧтобы вычислить MD5 или SHA в Rufus, нажмите кнопку (✓).\"\r\nt MSG_299 \"Ошибка проверки временной метки\"\r\nt MSG_300 \"Rufus не смог подтвердить, что временная метка загруженного обновления более поздняя, ​​чем дата текущего исполняемого файла.\\n\\nЧтобы предотвратить возможную атаку, обновление было прервано, а загруженный файл - удалён. См. подробности в файле-журнале.\"\r\nt MSG_301 \"Показать настройки приложения\"\r\nt MSG_302 \"Показать информацию о приложении\"\r\nt MSG_303 \"Показать журнал\"\r\nt MSG_304 \"Создать образ диска выбранного устройства\"\r\nt MSG_305 \"Используйте эту опцию, если Вы хотите установить Windows на другой диск или запускать Windows прямо с этого диска (Windows To Go).\"\r\nt MSG_306 \"Быстрое обнуление диска: %s\"\r\nt MSG_307 \"это может занять время\"\r\nt MSG_308 \"Обнаружение VHD\"\r\nt MSG_309 \"Сжатый архив\"\r\nt MSG_310 \"Выбранный образ ISO использует UEFI и достаточно мал, чтобы его можно было записать как системный раздел EFI (ESP). Запись в ESP вместо записи в общий раздел данных, занимающий весь диск, может быть предпочтительнее для некоторых типов установок.\\n\\nВыберите режим записи этого образа:\"\r\nt MSG_311 \"Чтобы включить, используйте %s (в главном окне программы).\"\r\nt MSG_312 \"Дополнительные хеши (SHA512)\"\r\nt MSG_313 \"Сохранить в VHD\"\r\nt MSG_314 \"Вычислить контрольные суммы образа\"\r\nt MSG_315 \"Несколько кнопок\"\r\nt MSG_316 \"Количество проходов\"\r\nt MSG_317 \"Идентификатор диска\"\r\nt MSG_318 \"Приоритет потока по умолчанию: %d\"\r\nt MSG_319 \"Игнорировать загрузочный маркер\"\r\nt MSG_320 \"Обновление макета разделов (%s)...\"\r\nt MSG_321 \"Выбранный образ - ISOHybrid, но создатели не сделали его совместимым с режимом копирования ISO/файла.\\nИз-за этого будет применён режим записи образа DD.\"\r\nt MSG_322 \"Не удалось открыть или прочитать '%s'\"\r\nt MSG_325 \"Применение настройки Windows: %s\"\r\nt MSG_326 \"Применение параметров пользователя...\"\r\nt MSG_327 \"Опыт использования Windows\"\r\nt MSG_328 \"Настроить установку Windows?\"\r\nt MSG_329 \"Удалить требования 4+ ГБ ОЗУ, безопасной загрузки и TPM 2.0\"\r\nt MSG_330 \"Удалить требование сетевой учётной записи Microsoft\"\r\nt MSG_331 \"Отключить сбор данных (пропустить вопросы о конфиденциальности)\"\r\nt MSG_332 \"Запретить Windows To Go доступ к внутренним дискам\"\r\nt MSG_333 \"Создать локальную учётную запись с именем пользователя:\"\r\nt MSG_334 \"Установить те же региональные параметры, что и для этого пользователя\"\r\nt MSG_335 \"Отключить автоматическое шифрование устройств BitLocker\"\r\nt MSG_336 \"Постоянный журнал\"\r\nt MSG_337 \"Для использования этой функции необходимо загрузить дополнительный файл ('%s') с сайта Microsoft:\\n 'Да' - загрузить его из Интернета\\n 'Нет' - отменить операцию\\n\\n* Файл загрузится в папку приложения, если там есть одноимённый файл, он будет автоматически перезаписан.\"\r\nt MSG_338 \"Обнаружен отозванный загрузчик UEFI\"\r\nt MSG_339 \"Выбранный образ ISO содержит отозванный загрузчик UEFI, который выдаёт %s, когда безопасная загрузка включена в полностью обновленной системе UEFI.\\n\\n- Если Вы получили этот образ ISO из ненадёжного источника, учтите, что он может содержать вредоносное ПО UEFI, и не загружайтесь с него.\\n- Если Вы получили его из надёжного источника, попробуйте найти более новую версию, которая не будет выдавать это предупреждение.\"\r\nt MSG_340 \"экран нарушения безопасности\"\r\nt MSG_341 \"экран восстановления Windows (BSOD) с '%s'\"\r\nt MSG_342 \"Сжатый образ VHDX\"\r\nt MSG_343 \"Несжатый образ VHD\"\r\nt MSG_344 \"Образ Full Flash Update (FFU)\"\r\nt MSG_345 \"Для этой функции необходимо загрузить дополнительные данные с сайта Microsoft:\\n 'Да' - загрузить их из Интернета\\n 'Нет' - отменить операцию\"\r\nt MSG_346 \"Ограничить Windows S-режимом (НЕСОВМЕСТИМО с обходом онлайн-аккаунта)\"\r\nt MSG_347 \"Экспертный режим\"\r\nt MSG_348 \"Распаковка архивов: %s\"\r\nt MSG_349 \"Использовать MBR Rufus\"\r\nt MSG_900 \"Rufus - это утилита для форматирования и создания загрузочных флеш-накопителей USB.\"\r\nt MSG_901 \"Официальный сайт: %s\"\r\nt MSG_902 \"Исходный код: %s\"\r\nt MSG_903 \"Изменения: %s\"\r\nt MSG_904 \"Это приложение распространяется по лицензии GNU Public License (GPL) версии 3.\\nПодробнее см. https://www.gnu.org/licenses/gpl-3.0.ru.html.\"\r\nt MSG_905 \"Загрузочный\"\r\nt MSG_910 \"Форматирование USB, флешек и виртуальных дисков в FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Создание загрузочных USB-дисков FreeDOS\"\r\nt MSG_912 \"Создание загрузочных дисков из загрузочных образов ISO (Windows, Linux и т.д.)\"\r\nt MSG_913 \"Создание загрузочных дисков из образов загрузочных дисков, в том числе сжатых\"\r\nt MSG_914 \"Создание загрузочных дисков BIOS или UEFI, включая загрузочный UEFI NTFS\"\r\nt MSG_915 \"Создание дисков Windows To Go\"\r\nt MSG_916 \"Создание установочных дисков Windows 11 для компьютеров без TPM или безопасной загрузки\"\r\nt MSG_917 \"Создание постоянных разделов Linux\"\r\nt MSG_918 \"Создание образов VHD/DD выбранного диска\"\r\nt MSG_919 \"Вычисление контрольных сумм MD5, SHA-1, SHA-256 и SHA-512 выбранного образа\"\r\nt MSG_920 \"Проверка на плохие блоки, обнаружение \\\"поддельных\\\" флешек\"\r\nt MSG_921 \"Загрузка официальных ISO-образов Windows\"\r\nt MSG_922 \"Загрузка ISO-образов оболочки UEFI\"\r\n\r\n#########################################################################\r\nl \"sr-RS\" \"Serbian (Srpski)\" 0x241a, 0x081a, 0x181a, 0x2c1a, 0x701a, 0x7c1a\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"O Rufus-u\"\r\nt IDC_ABOUT_LICENSE \"Licenca\"\r\nt IDOK \"U redu\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Osobine diska\"\r\nt IDS_DEVICE_TXT \"Uređaj\"\r\nt IDS_BOOT_SELECTION_TXT \"Izbor podizanja sistema\"\r\nt IDC_SELECT \"Izaberi\"\r\nt IDS_IMAGE_OPTION_TXT \"Opcija slike\"\r\nt IDS_PARTITION_TYPE_TXT \"Particijska šema\"\r\nt IDS_TARGET_SYSTEM_TXT \"Izabrani sistem\"\r\nt IDC_LIST_USB_HDD \"Pokaži USB čvrste diskove\"\r\nt IDC_OLD_BIOS_FIXES \"Dodaj ispravke za stare BIOS-e (dodatne particije, svrstanje, itd.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Омогућите проверу UEFI медија током извршавања\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Opcije formata\"\r\nt IDS_FILE_SYSTEM_TXT \"Datotečni sistem\"\r\nt IDS_CLUSTER_SIZE_TXT \"Veličina klastera\"\r\nt IDS_LABEL_TXT \"Naziv novog volumena\"\r\nt IDC_QUICK_FORMAT \"Brzo formatiranje\"\r\nt IDC_BAD_BLOCKS \"Proveri prisutnost neispravnih blokova\"\r\nt IDC_EXTENDED_LABEL \"Izradi produženu oznaku i ikone\"\r\nt IDS_STATUS_TXT \"Stanje\"\r\nt IDCANCEL \"Zatvori\"\r\nt IDC_START \"Započni\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Zatvori\"\r\nt IDD_LICENSE \"Rufus Licenca\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Zatvori\"\r\nt IDD_LOG \"Zapisnik\"\r\nt IDC_LOG_CLEAR \"Obriši\"\r\nt IDC_LOG_SAVE \"Sačuvaj\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Zatvori\"\r\nt IDD_NEW_VERSION \"Provjera ažuriranja - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Dostupna je novija verzija. Molimo preuzmite tu verziju!\"\r\nt IDC_WEBSITE \"Klikni ovdje za pristup web-stranici\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Bilješke distribucije\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Preuzmi\"\r\nt IDC_DOWNLOAD \"Preuzmi\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Više informacija\"\r\nt IDYES \"Da\"\r\nt IDNO \"Ne\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Zatvori\"\r\nt IDD_UPDATE_POLICY \"Polisa ažuriranja i podešavanja\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Podešavanja\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Proveri nova ažuriranja\"\r\nt IDS_INCLUDE_BETAS_TXT \"Obuhvati beta verzije\"\r\nt IDC_CHECK_NOW \"Provjeri\"\r\n\r\nt MSG_001 \"Još jedna instanca pronađena\"\r\nt MSG_002 \"Postoji već jedna instanca Rufus-a.\\nMolimo zatvorite pokrenutu instancu prije pokretanja nove.\"\r\nt MSG_003 \"UPOZORENJE: SVI PODACI NA OVOM UREĐAJU '%s' ĆE BITI UNIŠTENI.\\nDa nastavite, odaberite U REDU. Da odustanete odaberite OTKAŽI.\"\r\nt MSG_004 \"Polisa ažuriranja Rufus-a\"\r\nt MSG_005 \"Dozvolite Rufus-u da automatski traži nove verzije?\"\r\nt MSG_006 \"Zatvori\"\r\nt MSG_007 \"Odustani\"\r\nt MSG_008 \"Da\"\r\nt MSG_009 \"Ne\"\r\nt MSG_010 \"Pronađeni neispravni blokovi\"\r\nt MSG_011 \"Provjera završena: %d nespravnih blokova pronađeno\\n  %d grešaka čitanja\\n  %d grešaka pisanja\\n  %d korupcija\"\r\nt MSG_012 \"%s\\nDetaljan izvještaj se nalazi u:\\n%s\"\r\nt MSG_013 \"Onemogućeno\"\r\nt MSG_014 \"Dnevno\"\r\nt MSG_015 \"Sedmično\"\r\nt MSG_016 \"Mjesečno\"\r\nt MSG_017 \"Prilagođeno\"\r\nt MSG_018 \"Vaša verzija: %d.%d (Izvršna verzija %d)\"\r\nt MSG_019 \"Zadnja verzija: %d.%d (Izvršna verzija %d)\"\r\nt MSG_020 \"bajti\"\r\nt MSG_026 \"bajti\"\r\nt MSG_027 \"kilobajti\"\r\nt MSG_028 \"megabajti\"\r\nt MSG_029 \"Uobičajeno\"\r\nt MSG_030 \"%s (Uobičajeno)\"\r\nt MSG_031 \"BIOS (ili UEFI-CSM)\"\r\nt MSG_032 \"UEFI (ne CSM)\"\r\nt MSG_033 \"BIOS ili UEFI\"\r\nt MSG_034 \"%d sekvenca\"\r\nt MSG_035 \"%d sekvence %s\"\r\nt MSG_036 \"ISO datoteke\"\r\nt MSG_037 \"Aplikacija\"\r\nt MSG_038 \"Prekini\"\r\nt MSG_039 \"Pokreni\"\r\nt MSG_040 \"Preuzmi\"\r\nt MSG_041 \"Operaciju prekinuo korisnik\"\r\nt MSG_042 \"Greška\"\r\nt MSG_043 \"Greška: %s\"\r\nt MSG_044 \"Preuzimanje datoteka\"\r\nt MSG_045 \"USB uređaj za pohranu (Opšti)\"\r\nt MSG_047 \"Više particije\"\r\nt MSG_048 \"Rufus - Ispiranje bafera\"\r\nt MSG_049 \"Rufus - Otkazivanje\"\r\nt MSG_050 \"Uspešno.\"\r\nt MSG_051 \"Neutvrđena greška pri formatiranju.\"\r\nt MSG_052 \"Ne može se korititi odabrani sistem datoteka za ovaj uređaj.\"\r\nt MSG_053 \"Odbijen pristup uređaju.\"\r\nt MSG_054 \"Uređaj je zaštićen od pisanja.\"\r\nt MSG_055 \"Uređaj se koristi u drugom procesu. Zatvorite procese koji koriste uređaj.\"\r\nt MSG_056 \"Brzo formatiranje nije nedostupno za ovaj uređaju.\"\r\nt MSG_057 \"Oznaka volumena je neispravna.\"\r\nt MSG_058 \"Identifikator uređaja ja neispravan.\"\r\nt MSG_059 \"Odabrana veličina klastera nije ispravna za ovaj uređaj.\"\r\nt MSG_060 \"Veličina volumena je neispravna.\"\r\nt MSG_061 \"Umetnite prenosni uređaj.\"\r\nt MSG_062 \"Primljena je nepodržana komanda.\"\r\nt MSG_063 \"Greška pri raspodjeli memorije.\"\r\nt MSG_064 \"Greška pri čitanju.\"\r\nt MSG_065 \"Greška pri pisanju.\"\r\nt MSG_066 \"Neuspjela instalacija\"\r\nt MSG_067 \"Nije moguće otvoriti medij. Možda ga koristi drugi proces. Ponovo umetnite uređaj i pokušajte ponovo.\"\r\nt MSG_068 \"Greška pri particionisanju uređaja.\"\r\nt MSG_069 \"Datoteke se ne mogu kopirati na odabrani uređaj.\"\r\nt MSG_070 \"Otkazao korisnik.\"\r\nt MSG_071 \"Nije moguće započeti nit.\"\r\nt MSG_072 \"Provjera neispravnih blokova nije završena.\"\r\nt MSG_073 \"Neuspjelo skeniranje ISO datoteke.\"\r\nt MSG_074 \"Neuspjelo raspakivanje ISO datoteke.\"\r\nt MSG_075 \"Nije moguće postaviti volumen.\"\r\nt MSG_076 \"Nije moguće zakrpiti/postaviti datoteke za podizanje sistema.\"\r\nt MSG_077 \"Nije moguće dodijeliti slovo disk jedinici.\"\r\nt MSG_078 \"Nije moguće postaviti GUID volumen.\"\r\nt MSG_079 \"Uređaj nije spreman.\"\r\nt MSG_080 \"Rufus je otkrio da Windows još uvjek ispira svoje unutrašnje bafere na USB uređaj.\\n\\nZavsino od brzine vašeg USB uređaja, ova operacija može potrajati dugo, naročito za velike datoteke.\\n\\nPreporučujemo da dozvolite Windows-u da završi, kako bi izbjegli korupciju. Ukoliko ne želite čekati, samo izvadite USB uređaj...\"\r\nt MSG_081 \"Nepodržana datoteka\"\r\nt MSG_082 \"Ova slika nije podržana, ili koristi metodu kompresije koju Rufus ne podržava...\"\r\nt MSG_083 \"Zameni %s?\"\r\nt MSG_084 \"Ova ISO datoteka koristi zastarjelu verziju '%s'.\\nZbog toga, moguće je da se meniji pri podizanju sistema ne prikažu valjano.\\n\\nRufus može preuzeti noviju verziju da ne dođe do problema:\\n- Odaberite 'Da' kako bi ste datoteka preuzela\\n- Odaberite 'Ne' da ostavite postojeću ISO datoteku\\nUkoliko niste sigurni šta da odaberete, odaberite 'Da'.\\n\\nNapomena: Nova datoteka će biti sačuvana u istom direktorijumu kao i Rufus, i kad datoteka '%s' postoji tamo, automatski će biti korišćena.\"\r\nt MSG_085 \"Preuzimam %s\"\r\nt MSG_086 \"Nije odabrana datoteka\"\r\nt MSG_087 \"za %s NAND\"\r\nt MSG_088 \"Datoteka je prevelika\"\r\nt MSG_089 \"Datoteka je prevelika za odabrani uređaj.\"\r\nt MSG_090 \"Nepodržana ISO datoteka\"\r\nt MSG_091 \"Kada koristite UEFI tip, samo EFI datoteke za podizanje sistema su podržane. Odaberite EFI ISO datoteku za podizanje sistema ili postavite tip na BIOS.\"\r\nt MSG_092 \"Nepodržan sistem datoteka\"\r\nt MSG_093 \"VAŽNO: OVAJ UREĐAJ SADRŽI VIŠE PARTICIJA!!\\n\\nOvo uključuje particije/ koje nisu vidljive u Windows-u. Ako nastavite, bilo kakav gubitak podataka na ovim particijama je vaša odgovornost.\"\r\nt MSG_094 \"Pronađeno više particija\"\r\nt MSG_095 \"DD datoteka\"\r\nt MSG_096 \"Trenutno odabrani sistem datoteka se ne može koristiti s ovim tipom ISO datoteke Molimo odaberite drugi sistem datoteka ili odaberite drugu ISO datoteku.\"\r\nt MSG_097 \"'%s' se može koristiti samo ako je sistem datoteka NTFS.\"\r\nt MSG_098 \"VAŽNO: Želite instalirati 'Windows To Go', ali vaš odabrani uređaj ima 'FIXED' atribut. Zbog ovoga Windows će se vrlo vjerovatno zamrznuti pri pokretanju, ojer Microsoft nije dizajnirao Windows To Go za uređaje sa 'REMOVABLE' atributa.\\n\\nŽelite nastaviti svjedeno?\\n\\nNapomena: 'FIXED/REMOVABLE' atribut je hardversko svojstvo koje može izmijeniti samo pomoću specijalnih alata od proizvođača uređaja. Ovi alati SKORO NIKAD nisu dostupni javnosti...\"\r\nt MSG_099 \"Ograničenja sistema datoteka\"\r\nt MSG_100 \"Ova ISO datoteka sadrži fajl veću od 4 GB, što je više nego dozvoljeno za FAT ili FAT32 sisteme datoteka.\"\r\nt MSG_101 \"Nedostaje WIM podrška\"\r\nt MSG_102 \"Vaša platforma ne može raspakovati datoteke iz WIM arhiva. WIM raspakivanje je potrebno za izradu EFI Windows 7 i Windows Vista USB uređaja za podizanje sistema. Ta opcija je dostupna u poslednjim verzijama 7-Zip-a.\\nDa li želite da posjetite 7-zip stranicu za preuzimanje?\"\r\nt MSG_103 \"Preuzmi %s?\"\r\nt MSG_104 \"%s ili noviji zahtijeva '%s' za instalaciju.\\nZato što je veća od 100 KB, i uvijek prisutna na %s ISO datotekama, nije ugrađena u Rufus.\\n\\nRufus je može preuzeti:\\n- Odaberite 'Da' kako bi se datoteka preuzela\\n- Odaberite 'Ne' ako ne želite preuzeti datoteku\\n\\nNapomena: Nova datoteka će biti sačuvana u istom direktorijumu kao i Rufus, i kad datoteka '%s' postoji tamo, automatski će biti korišćena.\"\r\nt MSG_105 \"Otkazivanje može ostaviti uređaj u NEUPOTREBLJIVOM stanju.\\nUkoliko ste sigurni da želite da odustanete, odaberite DA. U suprotnom, odaberite NE.\"\r\nt MSG_106 \"Molimo odaberite folder\"\r\nt MSG_107 \"Sve datoteke\"\r\nt MSG_108 \"Rufus zapisnik\"\r\nt MSG_110 \"MS-DOS se ne može podići sa uređaja kod kojeg je veličina klastera 64 kilobajti.\\nMolimo promijenite veličinu klastera ili odaberite FreeDOS.\"\r\nt MSG_111 \"Nekompatibilna veličina klastera\"\r\nt MSG_112 \"Formatiranje velikih UDF volumena može trajati dugo. Pri USB 2.0 brzinama, procijenjeno vrijeme formatiranja je %d:%02d, tokom kojeg će indikator napretka djelovati zamrznuto. Molimo Vas budite strpljivi!\"\r\nt MSG_113 \"Veliki UDF volumen\"\r\nt MSG_114 \"Ova datoteka koristi Syslinux %s%s ali ova aplikacija uključuje samo instalacijske datoteke za Syslinux %s%s.\\n\\nPošto nove verzije Syslinux-a nisu međusobno kompatibilne, dvije dodatne datoteke moraju biti preuzete sa Internet-a ('ldlinux.sys' and 'ldlinux.bss'):\\n- Odaberite 'Da' kako bi se datoteke preuzele\\n- Odaberite 'Ne' da odustanete od ove operacije\\n\\nNapomena: Nove datoteke će biti sačuvane u istom direktorijumu kao i Rufus, i kad datoteke '%s' postoje tamo, automatski će biti korišćene.\"\r\nt MSG_115 \"Potrebno preuzimanje\"\r\nt MSG_116 \"Ova slika koristi Grub %s ali aplikacija sadrži samo instalacijske datoteke za Grub %s.\\n\\nKako različite verzije Grub-a ne moraju biti kompatibilne, i nije ih moguće sve obuhvatiti, Rufus će pokušati da pronađe verziju instalacijske datoteke Grub-a ('core.img') koja odgovara onoj iz vaše datoteke:\\n- Odaberite 'Da' kako bi se datoteke preuzele\\n- Odaberite 'Ne' kako bi koristili verziju iz Rufus-a\\n- Odaberite 'Otkaži' kako biste prekinuli operaciju\\n\\nNapomena: Nove datoteke će biti sačuvane u istom direktorijumu kao i Rufus, i kad datoteke '%s' postoje tamo, automatski će biti korišćene.\"\r\nt MSG_117 \"Standardna instalacija Windows-a\"\r\nt MSG_118 \"Windows To Go (instaliran na USB-u)\"\r\nt MSG_119 \"detaljnije opcije diska\"\r\nt MSG_120 \"detaljnije opcije formata\"\r\nt MSG_121 \"Prikaži %s\"\r\nt MSG_122 \"Sakrij %s\"\r\nt MSG_123 \"Stalna veličina particije\"\r\nt MSG_124 \"Bez stalne veličine\"\r\nt MSG_125 \"Izaberite veličinu stalne particije za live USB datoteku. Podešavanjem na 0 onemogućava stalnu particiju.\"\r\nt MSG_126 \"Izaberite veličinu jedinice particije.\"\r\nt MSG_127 \"Ne pokazuj više ovo uporuku\"\r\nt MSG_128 \"Bitno obaveštenje %s\"\r\nt MSG_129 \"Upravo si napravio mediju koja koristi UEFI:NTFS bootloader. Molim te zapamti da dabi koristi ovakve fajlove moraš da isključiš bezbedno butovanje. \\nZa detalje o tome zašto je ovo neophodno, pritisni dugme \\\"Više informacija\\\" dole.\"\r\nt MSG_130 \"Windows odabir slike\"\r\nt MSG_131 \"Ovaj ISO sadrži više slika windows-a.\\nMolimte odaberi sliku koju želiš da koristiš za ovu instalaciju:\"\r\nt MSG_132 \"NEki drugi program koristi uređaj. Da li idalje želiš da ga formatiraš?\"\r\nt MSG_133 \"Rufus je detektovao da pokušavaš da kreiraš \\\"Windows To Go\\\" mediju maziranu na 1809 iso-u.\\n\\nZbog Microsftovog baga ovaj medija će se krešovati tokom butovanja (plavi ekran smrti), osim ako manualno nezameniš fajl 'WppRecorder.sys' sa 1803 verzijom.\\n\\nTakođe zapamti da Rufus ovo nemože sam da popravi zato što je 'WppRecorder.sys' zaštićem autorskim pravima od strane Microsoft-a, tako da mi nemamo zakonska prava da koristimo taj fajl.\"\r\nt MSG_134 \"Zato što je MBr odabran za šemu particija, rufus može da napravi particije smo do 2TB sa ovom medijom, što će da ostavi %s diska nedostupno.\\n\\nDa li želiš da nastaviš?\"\r\nt MSG_135 \"Verzija\"\r\nt MSG_136 \"Izdanje\"\r\nt MSG_137 \"Edicija\"\r\nt MSG_138 \"Jezik\"\r\nt MSG_139 \"Arhitektura\"\r\nt MSG_140 \"Nastavi\"\r\nt MSG_141 \"Nazad\"\r\nt MSG_142 \"Molim sačekjate...\"\r\nt MSG_143 \"Skini koristeći pretraživač\"\r\nt MSG_144 \"Preuzimanje Windows ISO-a nije dostupno zbog toga što je Microsoft izmenio njihovu sajt da bi to sprečio.\"\r\nt MSG_145 \"PowerShell 3.0 ili noviji zahtevan da se pokrene ova skripta.\"\r\nt MSG_146 \"Da li želiš da odeš onlajn i skineš ga?\"\r\nt MSG_148 \"Pokrećem skriptu za skidanje...\"\r\nt MSG_149 \"Skini ISO S+sliku\"\r\nt MSG_150 \"Tip računara sa kojim želite koristiti butabilni disk. Vaša je odgovornost da odredite da li je vaš sistem BIOS ili UEFI tip pre no što krenete sa pravljenjem ovog butabilnog diska, zbog mogućnosti da butabilni disk ne radi.\"\r\nt MSG_151 \"'UEFI-CSM' znači da će se uređaj uključiti u emulaciji BIOS-a, (poznatog kao 'Legacy Mode') pod UEFI startovanja, ali ne i u prirodnom UEFI stanju.\"\r\nt MSG_152 \"'ne CSM' znači da će se uređaj samo startovati u prirodnom UEFI stanju, ali ne i u stanju emulacije BIOS-a (poznatog kao 'Legacy Mode')\"\r\nt MSG_153 \"Test uzorak: 0x%02X\"\r\nt MSG_154 \"Test uzorak: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Test uzorak: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Test uzorak: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Postavi sistem datoteka\"\r\nt MSG_158 \"Minimalna veličina koju će blok zauzeti u sistemu datoteka\"\r\nt MSG_159 \"Ovde unesite naziv za disk.\\nInternacionalni karakteri su prihvatljivi.\"\r\nt MSG_160 \"Prikaži/Sakrij napredna podešavanja\"\r\nt MSG_161 \"Provjeri prisutnost neispravnih blokova pomoću test uzorka\"\r\nt MSG_162 \"Odznačite ovo polje kako bi koristili \\\"sporu\\\" metodu za formatiranje\"\r\nt MSG_163 \"Metod koji će biti korišćen za pravljenje particija\"\r\nt MSG_164 \"Metoda za izradu uređaja sposobnog za podizanje sistema\"\r\nt MSG_165 \"Klikni da skineš ili odabereš datoteku...\"\r\nt MSG_166 \"Označite ovo polje kako biste dozvolili prikaz internacionalnih oznaka i napravite ikonicu uređaja (izrađuje autorun.inf)\"\r\nt MSG_167 \"Инсталирајте UEFI боотлоадер, који ће извршити проверу МД5Сум-y датотеке медија\"\r\nt MSG_169 \"Napravi dodatnu skrivenu particiju i pokušaj poravnati granice particije.\\nOvo može poboljšati pronalaske uređaja za podizanje sistema kod starih BIOS-a.\"\r\nt MSG_170 \"Pronalazak USB hard diskova. Koristiti na vlastitu odgovornost!\"\r\nt MSG_171 \"Započni proces formatiranja.\\nOvo će UNIŠTITI sve podatke na uređaju!\"\r\nt MSG_172 \"Neispravan potpis preuzimanja\"\r\nt MSG_173 \"Kliknite za odabir...\"\r\nt MSG_174 \"Rufus - Pouzdan Alat Za Formatiranje USB diska\"\r\nt MSG_175 \"Verzija %d.%d (Izvršna verzija %d)\"\r\nt MSG_176 \"Preveo:\\\\line• Ivan Strugar <mailto:isdjuka@gmail.com>\\\\line• Aleksandar Predić <mailto:notesofdespairandlove@gmail.com>\\\\line• Miloš Ljubičić <mailto:ljubimilos@gmail.com>\"\r\nt MSG_177 \"Prijavite greške ili zahtjeve za poboljšanja na:\"\r\nt MSG_178 \"Dodatna autorska prava:\"\r\nt MSG_179 \"Polisa ažuriranja:\"\r\nt MSG_180 \"Ukoliko dozvolite ovom programu provjeru ažuriranja, dozvoljavate da sledeće informacije mogu biti prikupljene na našem serveru/serverima:\"\r\nt MSG_181 \"Arhitektura i verzija vašeg operativnog sistema\"\r\nt MSG_182 \"Verzija aplikacije koju koristite\"\r\nt MSG_183 \"Vaša IP adresa\"\r\nt MSG_184 \"U svrhu izrade privatne statistike korišćenja, možemo zadržati navedene informacije, \\\\b najduže jednu godinu\\\\b0 . Međutim, nećemo dobrovoljno dijeliti sa trećim strankama.\"\r\nt MSG_185 \"Proces ažuriranja:\"\r\nt MSG_186 \"Rufus nema pozadinskih procesa, tako da se provjere ažuriranja se obavljaju samo kada je Rufus aktivan.\\\\line\\nNaravno pristup internetu je obavezan pri provjeri ažuriranja.\"\r\nt MSG_187 \"Neispravna datoteka za odabranu opciju podizanja sistema\"\r\nt MSG_188 \"Trenutna datoteka se ne podudara s odabranim opcijama za podizanje sistema. Odaberite drugu datoteku ili drugu opciju za podizanje sitema.\"\r\nt MSG_189 \"Ova ISO datoteka nije kompatibilna sa odabranim sistemom datoteka\"\r\nt MSG_190 \"Pronađen nekompatibilan uređaj\"\r\nt MSG_191 \"Sekvenca pisanja\"\r\nt MSG_192 \"Sekvenca čitanja\"\r\nt MSG_193 \"Preuzeto %s\"\r\nt MSG_194 \"Nije moguće preuzeti %s\"\r\nt MSG_195 \"Korišćenje ugrađene verzije %s datoteke/datoteka\"\r\nt MSG_196 \"VAŽNO: OVAJ UREĐAJ KORISTI NESTANDARDNU VELIČINU SEKTORA!\\n\\nUobičajeno uređaji koriste sektore veličine 512 bajti ali ovaj uređaj koristi sektore veličine %d bajti. U većini slučajeva, ovo znači da NEĆETE moći da podignete sistem sa ovog uređaja.\\nRufus može probati da izradi uređaj sposoban za podizanje sistema, ali NEMA GARANCIJE da će uspjeti u tome.\"\r\nt MSG_197 \"Pronađena nestandardna veličina sektora\"\r\nt MSG_198 \"'Windows To Go' može biti instaliran samo na GPT particionisanom uređaju ukoliko ima postavljen FIXED atribut. U odabranom uređaju nije postavljen kao FIXED.\"\r\nt MSG_199 \"Ova funkcija nije dostupna na ovoj platformi.\"\r\nt MSG_201 \"Otkazivanje - Molimo Vas sačekajte...\"\r\nt MSG_202 \"Skeniranje slike u toku...\"\r\nt MSG_203 \"Neuspjeh pri skeniranju slike\"\r\nt MSG_204 \"Pronađen zastario %s\"\r\nt MSG_205 \"Koristi se slika: %s\"\r\nt MSG_206 \"Nedostaje %s datoteka\"\r\nt MSG_207 \"Novi volumen\"\r\nt MSG_208 \"%d uređaj pronađen\"\r\nt MSG_209 \"%d uređaja pronađeno\"\r\nt MSG_210 \"SPREMNO\"\r\nt MSG_211 \"Otkazano\"\r\nt MSG_212 \"NEUSPJEŠNO\"\r\nt MSG_213 \"Pokretanje nove aplikacije...\"\r\nt MSG_214 \"Pokretanje nove aplikacije nije uspjelo\"\r\nt MSG_215 \"Otvoreno %s\"\r\nt MSG_216 \"Sačuvano %s\"\r\nt MSG_217 \"Formatiranje: %s\"\r\nt MSG_218 \"Izrada sistema datoteka: Zadatak %d/%d završen\"\r\nt MSG_219 \"NTFS krpljenje: %d%% završen\"\r\nt MSG_220 \"Formatiranje (%s) - Procijenjeno trajanje %d:%02d...\"\r\nt MSG_221 \"Postavljanje oznake (%s)...\"\r\nt MSG_222 \"Formatiranje (%s)...\"\r\nt MSG_223 \"NTFS krpljenje (Checkdisk)...\"\r\nt MSG_224 \"Čišćenje MBR/PBR/GPT struktura...\"\r\nt MSG_225 \"Zahtijevanje pristupa disku...\"\r\nt MSG_226 \"Analiziranje postojeće evidencije za podizanje sistema...\"\r\nt MSG_227 \"Zatvaranje postojećeg volumena...\"\r\nt MSG_228 \"Pisanje glavne evidencije za podizanje sistema...\"\r\nt MSG_229 \"Pisanje particijske evidencije za podizanje sistema...\"\r\nt MSG_230 \"Kopiranje DOS datoteka...\"\r\nt MSG_231 \"Kopiranje ISO datoteka: %s\"\r\nt MSG_232 \"Postavljanje Win7 EFI postavki za podizanje sistema (%s)...\"\r\nt MSG_233 \"Dovršavanje...\"\r\nt MSG_234 \"Instaliranje Syslinux %s...\"\r\nt MSG_235 \"Neispravni blokovi: %s %d/%d - %0.2f%% (%d/%d/%d greške)\"\r\nt MSG_236 \"Neispravni blokovi: Testiranje sa nasumičnim uzorkom\"\r\nt MSG_237 \"Neispravni blokovi: Testiranje sa uzorkom 0x%02X\"\r\nt MSG_238 \"Particionisanje (%s)...\"\r\nt MSG_239 \"Brisanje particija (%s)...\"\r\nt MSG_240 \"Nije moguće potvrditi digitalni potpis za skinutu nadogradnju. Ovo može da znači da vaš sistem nije ispravno konfigurisan za validaciju potpisa, ili prikazuje mogućnost da je preuzet maliciozan fajl.\\n\\nPreuzimanje će biti obrisano. Molimo vas pogledajte log fajl za više detalja.\"\r\nt MSG_241 \"Preuzimanje: %s\"\r\nt MSG_242 \"Neuspjelo preuzimanje datoteka.\"\r\nt MSG_243 \"Provjera ažuriranja Rufusa...\"\r\nt MSG_244 \"Ažuriranja: Nije moguće spojiti se na Internet\"\r\nt MSG_245 \"Ažuriranja: Nije moguće pristupiti podacima o verziji\"\r\nt MSG_246 \"Dostupna nova verzija Rufus-a!\"\r\nt MSG_247 \"Nema novih verzija Rufus-a\"\r\nt MSG_248 \"Ključevi aplikacionog registra uspješno obrisani\"\r\nt MSG_249 \"Brisanje ključeva aplikacionog registra nije uspjelo\"\r\nt MSG_250 \"%s omogućeno\"\r\nt MSG_251 \"%s onemogućeno\"\r\nt MSG_252 \"Provjerivanje veličine\"\r\nt MSG_253 \"Otkrivanje čvrstih diskova\"\r\nt MSG_254 \"Prisilno veliko FAT32 formatiranje\"\r\nt MSG_255 \"NoDriveTypeAutorun će biti obrisan pri izlasku\"\r\nt MSG_256 \"Otkrivanje lažnog uređaja\"\r\nt MSG_257 \"Joliet podrška\"\r\nt MSG_258 \"Rock Ridge podrška\"\r\nt MSG_259 \"Prisilno ažuriranje\"\r\nt MSG_260 \"NTFS komprimovanje\"\r\nt MSG_261 \"Pisanje slike: %s\"\r\nt MSG_262 \"ISO podržavanje\"\r\nt MSG_263 \"Korišćenje PRAVIH jedinice mjere\"\r\nt MSG_264 \"Brisanje direktorijuma '%s'\"\r\nt MSG_265 \"Pronalaženje VMWare diska\"\r\nt MSG_266 \"Dvostruki UEFI/BIOS režim\"\r\nt MSG_267 \"Primjenjivanje Windows datoteke: %s\"\r\nt MSG_268 \"Primjenjivanje Windows datoteke...\"\r\nt MSG_269 \"Očuvanje vremenske oznake datoteka\"\r\nt MSG_270 \"USB uklanjanje grešaka\"\r\nt MSG_271 \"Računanje kontrolnog zbira datoteke: %s\"\r\nt MSG_272 \"Računaj MD5, SHA1 and SHA256 kontrolne zbirove za odabranu datoteku\"\r\nt MSG_273 \"Promjena aplikacijskog jezika\"\r\nt MSG_274 \"Pronađena %s datoteka\"\r\nt MSG_275 \"Datoteka koju ste odabrali je 'ISOHybrid' datoteka. Takva datoteka može biti zapisana metodom %s (kopiranje) ili %s (disk datoteka).\\nRufus preporučuje metodu %s, tako da uvjek imate neograničen pristup uređaju nakon pisanja u njemu.\\nUkoliko naiđete na probleme pri podizanju sistema, isprobajte metodu %s.\\n\\nMolimo odaberite metodu za ovu operaciju:\"\r\nt MSG_276 \"Metodom %s (Preporučeno)\"\r\nt MSG_277 \"Metodom %s\"\r\nt MSG_278 \"Proveravanje za konfliktne procese...\"\r\nt MSG_279 \"Nije za podizane sistema\"\r\nt MSG_280 \"Disk ili ISO slika\"\r\nt MSG_281 \"(Odaberite datoteku)\"\r\nt MSG_282 \"Ekskluzivno zaključavanje USB uređaja\"\r\nt MSG_283 \"Neispravan potpis\"\r\nt MSG_284 \"Nedostaje digitalni potpis u izvršnoj datoteci.\"\r\nt MSG_285 \"Preuzeta izvršna datoteka je potpisana od strane '%s'.\\nOvo nije potpis koji prepozanajemo i može ukazivati na neki oblik zlonamjerne aktivnosti...\\nDa li ste sigurni da želite pokrenuti ovaj program?\"\r\nt MSG_286 \"Anuliranje uređaja: %s\"\r\nt MSG_287 \"Detekcija ne-USB diskova\"\r\nt MSG_288 \"Nedovoljno privilegija\"\r\nt MSG_289 \"Aplikacija može biti pokrenuta samo uz administratorske privilegije\"\r\nt MSG_290 \"Indeksiranje datoteka\"\r\nt MSG_291 \"Odabir verzije\"\r\nt MSG_292 \"Odaberite verziju Windows-a koju želite da instalirate:\"\r\nt MSG_293 \"Nepodržana verzija Windows-a\"\r\nt MSG_294 \"Rufus više ne podržava ovu verziju Windows-a.\\nPoslednja verzija Rufus-a kompatibilna sa ovom platformom je v%d.%d.\"\r\nt MSG_295 \"Upozorenje: Nezvanična verzija\"\r\nt MSG_296 \"Ovu verziju Rufus-a nije proizveo zvanični programer(i).\\n\\nDa li ste sigurni da želite da je pokrenete?\"\r\nt MSG_297 \"ISO datoteka nije validna\"\r\nt MSG_298 \"ISO datoteka koju ste odabrali ne podudara se sa njenom zvaničnom veličinom: %s nedostaje!\\n\\nUkoliko ste preuzeli ovu datoteka sa Interneta, pokušajte da preuzmete novu kopiju ove datoteke i proverite da li se podudara sa zvaničnom datotekom pomoću MD5 ili SHA kontrolne sume.\\n\\nNapomena, možete izračunati MD5 ili SHA kontrolnu sumu pomoću Rufus-a klikom na (✓) dugme.\"\r\nt MSG_299 \"Greška potvrđivanja vremenskog pečata\"\r\nt MSG_300 \"Rufus nije mogao potvrditi da je vremenski pečat preuzimanog ažuriranja noviji od trenutnog.\\n\\nDa bi se mogao sprečiti potencijalni napad, proces ažuriranja je zaustavljen i preuzimanje će biti obrisano. Molimo vas da proverite ispisani fajl za više detalja.\"\r\nt MSG_301 \"Prikaži podešavanja aplikacije\"\r\nt MSG_302 \"Prikaži informacije o ovoj aplikacije\"\r\nt MSG_303 \"Prikaži ispisani fajl\"\r\nt MSG_304 \"Napravi disk sliku od izabranog fajla\"\r\nt MSG_305 \"Izaberite ovu opciju kako bi odlučili da li želite koristiti ovaj uređaj kako bi instalirati Windows na drugi disk, ili da li želite koristiti Windows direktno sa ovog uređaja (Windows To Go).\"\r\nt MSG_306 \"Brže-popunjavanje nulom diska: %s\"\r\nt MSG_307 \"ovo može potrajati\"\r\nt MSG_308 \"VHD detektovan\"\r\nt MSG_309 \"Kompresovana arhiva\"\r\nt MSG_310 \"ISO koji ste odabrali koristi UEFI I dovoljno da je malo da bude napisano kao EFI sistemska particija (ESP). Pisanje na ESP umesto pisanje na genetičnu particiju koja zauzima celi disk može biti poželjnije za neke vrste instalacije \\n\\nMolimo odaberite model koj želite da koristite za pisanje ove slike:\"\r\nt MSG_311 \"Koristi %s (u glavnoj aplikaciji) da bi uključio.\"\r\nt MSG_312 \"Dodatni heševi (SHA512)\"\r\nt MSG_313 \"Sačuvaj u VHD direktoriju\"\r\nt MSG_314 \"Računaj kontrolni zbir slike\"\r\nt MSG_315 \"Mnoštvo dugmadi\"\r\nt MSG_316 \"Broj prelazaka\"\r\nt MSG_317 \"ID dika\"\r\nt MSG_318 \"Podrazumevana prioritetna nit: %d\"\r\nt MSG_319 \"Ignoriši boot marker\"\r\nt MSG_320 \"Osvežavanje participnog rasporeda (%s)...\"\r\nt MSG_321 \"Slika koju si odabrao je ISOHibrid, ali njeni kreatori ga nisu napravili kompatibilnim sa ISO/File copy mode-om.\\nKao rezultat toga, DD režim pisanje slike će biti primenjen.\"\r\nt MSG_322 \"Nije moguće otvoriti ili pročitati '%s'\"\r\nt MSG_325 \"Premena prilagođavanja Winodows-a\"\r\nt MSG_326 \"Primena korisničkih opcija...\"\r\nt MSG_327 \"Windows-ovo korisnicko iskustvo\"\r\nt MSG_328 \"Želite li da prilagodite Windows instalaciju?\"\r\nt MSG_329 \"Ukloni yahtev ya 4GB+ RAM-a, bezbednosno pokretanje i TPM 2.0\"\r\nt MSG_330 \"Ukloni zahteve za online Microsoft nalog\"\r\nt MSG_331 \"Onemogući prikupljanje podataka (preskoči pitanja o privatnosti)\"\r\nt MSG_332 \"Spreči Windows to go da pristupa internim diskovima\"\r\nt MSG_333 \"Kreiraj lokalni nalog sa imenom:\"\r\nt MSG_334 \"Stavi regionalnu opciju na istu vrednost kao i ovaj korisnik\"\r\nt MSG_335 \"Onemogući BitLocker automatsku enkripciju uređaja\"\r\nt MSG_336 \"Trajna evidencija\"\r\nt MSG_337 \"Додатна датотека („%s“) мора да се преузме са Microsoft-а да бисте користили ову функцију:\\n- Изаберите „Да“ да бисте се повезали на Интернет и преузели га\\n- Изаберите „Не“ да бисте отказали операцију\\n\\nНапомена: Датотека ће бити преузета у директоријум апликације и аутоматски ће се поново користити ако постоји.\"\r\nt MSG_338 \"Откривен је опозвани UEFI покретач\"\r\nt MSG_339 \"Руфус је открио да ISO који сте изабрали садржи UEFI покретач који је опозван и који ће произвести %s када је безбедно покретање омогућено на потпуно ажурираном UEFI систему.\\n\\n- Ако сте ову ISO слику добили од неугледног извора, требало би да размотрите могућност да садржи UEIFI малвер и избегавајте покретање са њега.\\n- Ако сте га добили од поузданог извора, покушајте да пронађете новију верзију, која неће произвести ово упозорење.\"\r\nt MSG_340 \"екран „Нарушавање безбедности“\"\r\nt MSG_341 \"Windows Рековери Екран (BSOD) са „%s“\"\r\nt MSG_342 \"Компресована VHDX слика\"\r\nt MSG_343 \"Некомпримована VHD слика\"\r\nt MSG_344 \"Фулл Фласх Упдате Имаге\"\r\nt MSG_345 \"Неки додатни подаци морају се преузети од Microsoft-a да бисте користили ову функцију:\\n- Изаберите „Да“ да бисте се повезали на Интернет и преузели га\\n- Изаберите „Не“ да бисте отказали операцију\"\r\nt MSG_346 \"Ограничите Виндовс на С-Моде (НИЈЕ КОМПАТИБИЛАН са заобилажењем налога на мрежи)\"\r\nt MSG_347 \"Ekspertni Rezim\"\r\nt MSG_348 \"Распакивање архивских датотека: %s\"\r\nt MSG_349 \"Koritsti Rufus MBR\"\r\nt MSG_900 \"Rufus je uslužni program koji pomaže u formatiranju i kreiranju USB fleš diskova koji se mogu pokretati, kao što su USB ključevi, memorijski štapići itd.\"\r\nt MSG_901 \"Zvaničan sajt: %s\"\r\nt MSG_902 \"Izvorni kod: %s\"\r\nt MSG_903 \"Evidencija promena: %s\"\r\nt MSG_904 \"Ova aplikacija je licencirana pod uslovima GNU Javne licence (GPL) verzije 3. \\nPogledajte https://www.gnu.org/licenses/gpl-3.0.en.html za više informacija.\"\r\nt MSG_910 \"Formatiraj USB, flash kartice, i virtualne diskove u FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Kreiraj FreeDOS butabilni USB disk\"\r\nt MSG_912 \"Kreirajte disk jedinice za pokretanje sistema od ISO-a koji se mogu pokretanja sistema (Windows, Linux itd.)\"\r\nt MSG_913 \"Kreiranje disk jedinica za pokretanje sistema sa slika diska koji se može pokretanja, uključujući kompresovane\"\r\nt MSG_914 \"Kreiranje BIOS ili UEFI disk jedinica za pokretanje sistema, uključujući NTFS sa UEFI pokretanjem sistema\"\r\nt MSG_915 \"Kreiranje disk jedinica \\\"Windows to Go\\\"\"\r\nt MSG_916 \"Kreiranje windows 11 instalacionih disk jedinica za računare koji nemaju TPM ili bezbedno pokretanje sistema\"\r\nt MSG_917 \"Kreiranje upornih Linux particija\"\r\nt MSG_918 \"Kreiranje VHD/DD slika izabrane disk jedinice\"\r\nt MSG_919 \"Izračunajte MD5, SHA-1, SHA-256 i SHA-512 kontrolne preglede izabrane slike\"\r\nt MSG_920 \"Izvršite provere loših blokova, uključujući otkrivanje \\\"lažnih\\\" fleš diskova\"\r\nt MSG_921 \"Preuzmite zvanične Microsoft Windows maloprodajne ISO-ove\"\r\nt MSG_922 \"Preuzmite UEFI Shell ISOs\"\r\n\r\n#########################################################################\r\nl \"sk-SK\" \"Slovak (Slovensky)\" 0x041B\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"O programe Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licencia\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Nastavenia zariadenia\"\r\nt IDS_DEVICE_TXT \"Zariadenie\"\r\nt IDS_BOOT_SELECTION_TXT \"Typ bootovania\"\r\nt IDC_SELECT \"Prehliadať\"\r\nt IDS_IMAGE_OPTION_TXT \"Nastavenia obrazu\"\r\nt IDS_PARTITION_TYPE_TXT \"Schéma oddielu\"\r\nt IDS_TARGET_SYSTEM_TXT \"Cieľový systém\"\r\nt IDC_LIST_USB_HDD \"Zobraziť zoznam USB pevných diskov (USB HDD)\"\r\nt IDC_OLD_BIOS_FIXES \"Pridať úpravy pre staré BIOSy (extra partície, ...)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Povoliť overenie médií UEFI v runtime režime\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Nastavenia formátovania\"\r\nt IDS_FILE_SYSTEM_TXT \"Súborový systém\"\r\nt IDS_CLUSTER_SIZE_TXT \"Veľkosť klastra\"\r\nt IDS_LABEL_TXT \"Nový názov zväzku\"\r\nt IDC_QUICK_FORMAT \"Rýchle formátovanie\"\r\nt IDC_BAD_BLOCKS \"Skontrolovať chybné bloky zariadenia\"\r\nt IDC_EXTENDED_LABEL \"Použiť poskytnutú menovku a súbory miniatúry\"\r\nt IDS_STATUS_TXT \"Stav\"\r\nt IDCANCEL \"Zatvoriť\"\r\nt IDC_START \"Štart\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Zatvoriť\"\r\nt IDD_LICENSE \"Licencia programu Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Zatvoriť\"\r\nt IDD_LOG \"Záznam činnosti programu Rufus\"\r\nt IDC_LOG_CLEAR \"Vyčistiť\"\r\nt IDC_LOG_SAVE \"Uložiť\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Zatvoriť\"\r\nt IDD_NEW_VERSION \"Kontrola aktualizácií - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Je dostupná nová verzia. Stiahnite si poslednú verziu!\"\r\nt IDC_WEBSITE \"Kliknite tu, ak chcete prejsť na stránku a stiahnuť program manuálne\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Poznámky k vydaniu\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Stiahnuť\"\r\nt IDC_DOWNLOAD \"Stiahnuť\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Viac informácií\"\r\nt IDYES \"Áno\"\r\nt IDNO \"Nie\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Zatvoriť\"\r\nt IDD_UPDATE_POLICY \"Zásady a nastavenia aktualizácií\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Nastavenia automatických aktualizácií\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Skontrolovať aktualizácie\"\r\nt IDS_INCLUDE_BETAS_TXT \"Zahrnúť beta verzie\"\r\nt IDC_CHECK_NOW \"Skontrolovať\"\r\n\r\nt MSG_001 \"Zistený spustený program\"\r\nt MSG_002 \"Program Rufus je už spustený.\\nPred spustením ďalšieho programu musíte zavrieť spustený program.\"\r\nt MSG_003 \"VAROVANIE: PO SPUSTENÍ FORMÁTOVANIA BUDÚ VYMAZANÉ VŠETKY ÚDAJE NA CIEĽOVOM DISKU: %s\\nAk chcete spustiť formátovanie disku stlačte tlačidlo OK.\\nAk chcete túto operáciu ukončiť, stlačte tlačidlo ZRUŠIŤ.\"\r\nt MSG_004 \"Nastavenie automatických aktualizácií programu Rufus\"\r\nt MSG_005 \"Chcete povoliť kontrolu aktualizácií programu Rufus?\"\r\nt MSG_006 \"Zatvoriť\"\r\nt MSG_007 \"Zrušiť\"\r\nt MSG_008 \"Áno\"\r\nt MSG_009 \"Nie\"\r\nt MSG_010 \"Boli nájdené chybné bloky\"\r\nt MSG_011 \"Kontrola dokončená:\\n  počet chybných blokov: %d\\n  počet chýb pri čítaní: %d\\n  počet chýb pri zapisovaní: %d\\n  počet poškodzujúcich chýb: %d\"\r\nt MSG_012 \"%s\\nPodrobnejšiu správu nájdete tu:\\n%s\"\r\nt MSG_013 \"Zakázané\"\r\nt MSG_014 \"Denne\"\r\nt MSG_015 \"Týždenne\"\r\nt MSG_016 \"Mesačne\"\r\nt MSG_017 \"Vlastné\"\r\nt MSG_018 \"Aktuálna verzia: %d.%d (Build %d)\"\r\nt MSG_019 \"Posledná verzia: %d.%d (Build %d)\"\r\nt MSG_020 \"bajtov\"\r\nt MSG_026 \"bajtov\"\r\nt MSG_027 \"kilobajtov\"\r\nt MSG_028 \"megabajtov\"\r\nt MSG_029 \"Predvolené\"\r\nt MSG_030 \"%s (predvolené)\"\r\nt MSG_031 \"BIOS (alebo UEFI-CSM)\"\r\nt MSG_032 \"UEFI (bez CSM)\"\r\nt MSG_033 \"BIOS alebo UEFI\"\r\nt MSG_034 \"%d pokus\"\r\nt MSG_035 \"%d pokusy %s\"\r\nt MSG_036 \"Obraz ISO\"\r\nt MSG_037 \"Aplikácia\"\r\nt MSG_038 \"Ukončiť\"\r\nt MSG_039 \"Spustiť\"\r\nt MSG_040 \"Stiahnuť\"\r\nt MSG_041 \"Operácia bola zrušená používateľom\"\r\nt MSG_042 \"Chyba\"\r\nt MSG_043 \"Chyba: %s\"\r\nt MSG_044 \"Stiahnuť súbor\"\r\nt MSG_045 \"Úložné zariadenie USB (všeobecné)\"\r\nt MSG_047 \"Zariadenie s viacerým oddielmi\"\r\nt MSG_048 \"Rufus - Vyprázdňovanie dočasnej pamäte\"\r\nt MSG_049 \"Rufus - Ukončovanie operácie\"\r\nt MSG_050 \"Dokončené.\"\r\nt MSG_051 \"Neurčitá chyba počas formátovania.\"\r\nt MSG_052 \"Nie je možné použiť vybraný súborový systém pre toto médium.\"\r\nt MSG_053 \"Prístup na disk bol odmietnutý.\"\r\nt MSG_054 \"Médium je chránené proti zápisu.\"\r\nt MSG_055 \"Disk je používaný iným procesom. Zatvorte procesy, ktoré môžu pristupovať na disk.\"\r\nt MSG_056 \"Rýchle formátovanie tohto disku nie je dovolené.\"\r\nt MSG_057 \"Názov disku je neplatný.\"\r\nt MSG_058 \"Identifikátor zariadenia je neplatný.\"\r\nt MSG_059 \"Vybraný klaster nie je platný pre toto zariadenie.\"\r\nt MSG_060 \"Názov zväzku je neplatný.\"\r\nt MSG_061 \"Pripojte výmenné médium.\"\r\nt MSG_062 \"Bol prijatý nepodporovaný príkaz.\"\r\nt MSG_063 \"Chyba pri pridelení pamäte.\"\r\nt MSG_064 \"Chyba čítania.\"\r\nt MSG_065 \"Chyba zápisu.\"\r\nt MSG_066 \"Inštalácia zlyhala\"\r\nt MSG_067 \"Nie je možné otvoriť zariadenie. Možno je používané iným procesom. Skúste odpojiť a znovu pripojiť zariadenie a vyskúšajte to znovu.\"\r\nt MSG_068 \"Nie je možné vytvoriť oddiely.\"\r\nt MSG_069 \"Nie je možné kopírovať súbory do cieľovej jednotky.\"\r\nt MSG_070 \"Prerušené používateľom.\"\r\nt MSG_071 \"Nie je možné spustiť vlákno.\"\r\nt MSG_072 \"Kontrola chybných blokov nebola dokončená.\"\r\nt MSG_073 \"Analýza ISO obrazu zlyhala.\"\r\nt MSG_074 \"Rozbaľovanie ISO obrazu zlyhalo.\"\r\nt MSG_075 \"Nie je možné znovu pripojiť zväzok.\"\r\nt MSG_076 \"Nie je možné opraviť/inštalovať súbory pre bootovanie.\"\r\nt MSG_077 \"Nie je možné priradiť písmeno jednotky.\"\r\nt MSG_078 \"Nie je možné pripojiť GUID zväzok.\"\r\nt MSG_079 \"Zariadenie nie je pripravené.\"\r\nt MSG_080 \"Program Rufus zistil, že Windows stále vyprázdňuje internú vyrovnávajúcu pamäť na USB zariadení.\\n\\nDoba tejto operácie závisí na rýchlosti vášho USB disku, môže trvať dlhší čas, špeciálne pri veľkých súboroch.\\n\\nDoporučujeme nechať Windows dokončiť akciu, zabránite tak poškodeniu dát. Ak bude operácia trvať príliš dlho, môžete odpojiť zariadenie...\"\r\nt MSG_081 \"Nepodporovaný obraz\"\r\nt MSG_082 \"Tento obraz už viac nie je bootovateľný alebo používa boot alebo kompresnú metódu, ktorá nie je podporovaná programom Rufus...\"\r\nt MSG_083 \"Nahradenie modulu %s?\"\r\nt MSG_084 \"Zdá sa, že tento ISO obraz používa zastaralú verziu modulu %s.\\nBootovacie menu sa preto nemusí zobrazovať správne.\\n\\nNová verzia modulu bude automaticky stiahnutá programom Rufus\\na môže jednoducho odstrániť tento problém:\\n- Stlačte „Áno\\\" pre pripojenie na internet a stiahnutie súboru\\n- Stlačte „Nie\\\" a nechajte existujúci ISO súbor nezmenený\\nAk neviete, čo máte robiť, vyberte tlačidlo „Áno\\\".\\n\\nPoznámka: Nový súbor „%s\\\" bude stiahnutý do aktuálneho priečinka programu a potom bude automaticky použitý.\"\r\nt MSG_085 \"Sťahovanie %s\"\r\nt MSG_086 \"Nie je vybraný žiadny obraz disku\"\r\nt MSG_087 \"pre %s NAND\"\r\nt MSG_088 \"Obraz disku je príliš veľký\"\r\nt MSG_089 \"Obraz disku je príliš veľký pre vybraný disk.\"\r\nt MSG_090 \"Nepodporovaný ISO obraz\"\r\nt MSG_091 \"Ak použijete typ UEFI, iba EFI bootovateľné ISO obrazy budú podporované. Vyberte EFI bootovateľné ISO alebo nastavte cieľový typ ako BIOS.\"\r\nt MSG_092 \"Nepodporovaný súborový systém\"\r\nt MSG_093 \"DÔLEŽITÉ: TOTO ZARIADENIE OBSAHUJE NIEKOĽKO ODDIELOV!!\\n\\nZariadenie môže obsahovať oddiely alebo zväzky, ktorú nie sú čitateľné alebo dokonca viditeľné pre Windows. Ak budete pokračovať, môžete stratiť všetky údaje na týchto oddieloch.\"\r\nt MSG_094 \"Boli zistené viaceré oddiely\"\r\nt MSG_095 \"Obraz DD\"\r\nt MSG_096 \"Vybratý systém súborov nemôže byť použitý pre tento typ ISO obrazu.\\nVyberte iný súborový systém alebo použite iný ISO obraz.\"\r\nt MSG_097 \"„%s\\\" môže byť použitý iba pre súborový systém NTFS.\"\r\nt MSG_098 \"DÔLEŽITÉ: Pokúšate sa nainštalovať „Windows To Go\\\", ale vaša cieľová jednotkanemá atribút „UPRAVENÝ„. Takýto systém Windows takmer určite zamrzne počas bootovania,ak nebol navrhnutý spoločnosťou Microsoft pre prácu so zariadeniami, ktoré majú atribút „VYMENITEĽNÝ\\\".\\n\\nSte si istý, že chcete pokračovať?\\n\\nPoznámka: Atribút „UPRAVENÝ/VYMENITEĽNÝ\\\" je hardvérová charakteristika, ktorá môže byť zmenená iba použitím vlastných nástrojov od výrobcu zariadenia. Napriek tomu tieto nástroje nie sú SKORO NIKDY poskytnuté verejnosti...\"\r\nt MSG_099 \"Obmedzenie súborového systému\"\r\nt MSG_100 \"Tento ISO obraz obsahuje súbor s veľkosťou viac ako 4 GB, čo je viac ako podporuje súborový systém FAT alebo FAT32.\"\r\nt MSG_101 \"Chýba podpora WIM\"\r\nt MSG_102 \"Vaša platforma nedokáže rozbaliť súbory z WIM archívov. WIM extrakcia požaduje vytvorenie EFI bootovateľnej USB jednotky s Windows 7 a Windows Vista nainštalovaním novej verzie programu 7-Zip.\\nChcete navštíviť webstránku 7-Zip?\"\r\nt MSG_103 \"Stiahnúť %s?\"\r\nt MSG_104 \"%s alebo vyššie požadujú nainštalovať súbor: %s.\\nPretože tento súbor je väčší ako 100 KB a vždy prítomný v %s ISO obrazoch, nie je implementovaný v programe Rufus.\\n\\nProgram Rufus môže za vás stiahnuť chýbajúci súbor:\\n- Stlačte „Áno\\\" pre pripojenie na internet a stiahnutie súboru\\n- Stlačte „Nie\\\" ak chcete manuálne skopírovať tento súbor na jednotku neskôr\\n\\nPoznámka: Súbor „%s\\\" bude stiahnutý do aktuálneho priečinku a potom bude automaticky znovu použitý.\"\r\nt MSG_105 \"Po zrušení tejto operácie bude zariadenie v NEPOUŽITEĽNOM stave.\\nAk ste si istý, že chcete túto zrušiť operáciu, stlačte tlačidlo ÁNO. \\nV opačnom prípade stlačte tlačidlo NIE.\"\r\nt MSG_106 \"Vyberte priečinok\"\r\nt MSG_107 \"Všetky súbory\"\r\nt MSG_108 \"Záznam programu Rufus\"\r\nt MSG_110 \"Systém MS-DOS nemôže byť spustený z jednotky používajúcej klastre s veľkosťou 64kb.\\nZmeňte veľkosť klastra alebo použite FreeDOS.\"\r\nt MSG_111 \"Nekompatibilná veľkosť klastra\"\r\nt MSG_112 \"Formátovanie veľkých UDF zväzkov môže trvať dlhý čas. Rýchlosť USB 2.0 určuje trvanie formátovania (približne %d:%02d), počas procesu sa vám môže zdať, že aplikácia zamrzla. Buďte trpezlivý!\"\r\nt MSG_113 \"Veľkosť UDF zväzku\"\r\nt MSG_114 \"Tento obraz používa Syslinux %s%s ale tento program obsahuje inštaláciu pre Syslinux %s%s.\\n\\nAk nová verzia Syslinuxu nie je kompaktibilná s ďalším obrazom, je možné, že program Rufus neobsahuje dva doplnkové súbory, ktoré budú musieť byť stiahnuté z internetu (ldlinux.sys a ldlinux.bss):\\n- Stlačte „Áno\\\" pre stiahnutie týchto súborov z internetu\\n- Stlačte „Nie\\\" pre zrušenie operácie\\n\\nPoznámka: Súbory budú stiahnuté do aktuálneho priečinku programu a budú použité automaticky po stiahnutí.\"\r\nt MSG_115 \"Je požadované stiahnutie\"\r\nt MSG_116 \"Tento obraz používa bootloader Grub %s ale tento program zahŕňa iba inštalačné súbory pre Grub %s.\\n\\nPretože rozličné verzie Grubu nie sú kompatibilné s inými, nie je možné obsiahnuť všetky verzie. Program Rufus sa pokúsi nájsť verziu inštalačného súboru bootloaderu Grub ('core.img'), ktorý je zhodný s vašim obrazom:\\n- Vyberte „Áno\\\" pre pripojenie na internet a pokus o jeho stiahnutie\\n- Vyberte „Nie\\\" pre použitie pôvodnej verzie z programu Rufus\\n- Vyberte „Zrušiť\\\" pre zrušenie operácie\\n\\nPoznámka: Súbor bude stiahnutý do aktuálneho priečinku programu a bude teraz automatickypoužitý. Ak nebude nájdený na internete, bude použitá pôvodná verzia.\"\r\nt MSG_117 \"Štandardná inštalácia Windows (Inštalátor)\"\r\nt MSG_118 \"Windows To Go (Prenosná verzia)\"\r\nt MSG_119 \"pokročilé nastavenia zariadenia\"\r\nt MSG_120 \"pokročilé nastavenia formátovania\"\r\nt MSG_121 \"Zobraziť %s\"\r\nt MSG_122 \"Skryť %s\"\r\nt MSG_123 \"Trvalá veľkosť partície\"\r\nt MSG_124 \"Bez partície\"\r\nt MSG_125 \"Nastavte veľkosť trvalej partície pre Live USB médium. Nastavením hodnoty na 0 zakážete trvalú partíciu.\"\r\nt MSG_126 \"Nastavte veľkosť partície.\"\r\nt MSG_127 \"Nabudúce nezobrazovať túto správu\"\r\nt MSG_128 \"Dôležité upozornenie o %s\"\r\nt MSG_129 \"Práve ste vytvorili médium, ktoré používa UEFI: NTFS bootloader. Pamätajte prosím, že na zavedenie tohto média, MUSÍTE VYPNÚŤ SECURE BOOT.\\nPodrobnosti o tom, prečo je to potrebné, nájdete v nižšie zobrazenom tlačidle \\\"Ďalšie informácie\\\".\"\r\nt MSG_130 \"Výber obrázkov systému Windows\"\r\nt MSG_131 \"Tento ISO obsahuje viac obrazov Windows.\\nProsím, vyberte obrázok, ktorý chcete použiť pre túto inštaláciu:\"\r\nt MSG_132 \"Prístup k tejto jednotke má iný program alebo proces. Chcete ho napriek tomu naformátovať?\"\r\nt MSG_133 \"Program Rufus zistil, že sa pokúšate vytvoriť Windows To Go médium založeného na 1809 ISO.\\n\\nKvôli *MICROSOFT BUG*, toto médium môže zlyhať počas zavádzania systému Windows (modrá obrazovka smrti), pokiaľ manuálne nenahradíte súbor „WppRecorder. sys\\\" verziou 1803.\\n\\nDôvodom, prečo program Rufus nemôže automaticky toto opraviť to, že súbor „WppRecorder.sys\\\" je chránený súbor spoločnosti Microsoft, takže nie je legálne vložiť kópiu súboru do aplikácie...\"\r\nt MSG_134 \"Pretože bola vybraná MBR schéma disku, program Rufus môže na tomto médiu vytvoriť partíciu iba do veľkosti 2 TB a zvyšných %s na disku ostane nedostupných.\\n\\nNaozaj chcete pokračovať?\"\r\nt MSG_135 \"Verzia\"\r\nt MSG_136 \"Poznámky k vydaniu\"\r\nt MSG_137 \"Vydanie\"\r\nt MSG_138 \"Jazyk\"\r\nt MSG_139 \"Architektúra\"\r\nt MSG_140 \"Pokračovať\"\r\nt MSG_141 \"Späť\"\r\nt MSG_142 \"Čakajte prosím...\"\r\nt MSG_143 \"Sťahovanie pomocou prehliadača\"\r\nt MSG_144 \"Sťahovanie bolo zakázané spoločnosťou Microsoft, pretože Microsoft zmenil svoju stránku, aby tomu zabránil.\"\r\nt MSG_145 \"Pre spustenie tohto skriptu je potrebný PowerShell 3.0 alebo novší.\"\r\nt MSG_146 \"Chcete prejsť do režimu online a stiahnuť ho?\"\r\nt MSG_148 \"Spúšťanie skriptu sťahovania...\"\r\nt MSG_149 \"Stiahnúť ISO obraz\"\r\nt MSG_150 \"Vyberte typ bootovateľného disku, ktorým chcete nabootovať počítač. Musíte určiť, či chcete vytvoriť BIOS alebo UEFI predtým, ako začnete vytvárať disk, inak sa zariadenie nemusí spustiť.\"\r\nt MSG_151 \"„UEFI-CSM\\\" znamená, že zariadenie bude bootovateľné iba emulovanom BIOS režime (taktiež známom ako „Legacy Mode\\\") pod UEFI a nie v natívnom UEFI režime.\"\r\nt MSG_152 \"„Bez CSM\\\" znamená, že zariadenie bude bootovateľné iba v natívnom UEFI režime a nie v emulovanom BIOS režime (taktiež známom ako „Legacy Mode\\\").\"\r\nt MSG_153 \"Skúšobná vzorka: 0x%02X\"\r\nt MSG_154 \"Skúšobné vzorka: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Skúšobná vzorka: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Skúšobná vzorka: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Nastavte cieľový súborový systém\"\r\nt MSG_158 \"Minimálna veľkosť bloku použitého v súborovom systéme\"\r\nt MSG_159 \"Ak chcete nastaviť menovku disku, vyplňte pole.\\nPodporované sú aj medzinárodné znaky.\"\r\nt MSG_160 \"Prepínač pokročilých nastavení\"\r\nt MSG_161 \"Skontrolovať zariadenie na prítomnosť chybných\\nblokov použitím skúšobných vzoriek\"\r\nt MSG_162 \"Odznačením tohto políčka použijete „pomalú\\\" metódu formátovania\"\r\nt MSG_163 \"Metóda, ktorá bude použitá na vytvorenie partícií\"\r\nt MSG_164 \"Vyberte metódu, ktorá bude použitá na vytvorenie bootovateľného zariadenia\"\r\nt MSG_165 \"Stlačte tlačidlo alebo stiahnite obraz...\"\r\nt MSG_166 \"Označením tohto políčka povolíte v názve disku zobrazenie medzinárodných znakov a vytvorenie ikony zariadenia (vytvorením súboru autorun.inf)\"\r\nt MSG_167 \"Nainštalovať zavádzač UEFI, ktorý vykoná overenie média prostredníctvom MD5Sum súboru\"\r\nt MSG_169 \"Bude naviac vytvorený skrytý oddiel, program sa pokúsi nastaviť hranice oddielov.\\nToto nastavenie môže zlepšiť boot detekciu pre staršie BIOSy.\"\r\nt MSG_170 \"Povolí zobrazovanie USB pevných diskov (USB HDD). POUŽITIE LEN NA VLASTNÉ RIZIKO!!!\"\r\nt MSG_171 \"Stlačením tohto tlačidla spustíte formátovanie.\\nFormátovaním sa VYMAŽÚ všetky údaje na disku!\"\r\nt MSG_172 \"Neplatný podpis stiahnutého súboru\"\r\nt MSG_173 \"Stlačením vybrať...\"\r\nt MSG_174 \"Rufus - Spoľahlivý program pre formátovanie USB\"\r\nt MSG_175 \"Verzia %d.%d (Build %d)\"\r\nt MSG_176 \"Do slovenčiny preložil martinco78 <mailto:martinco78@azet.sk>\"\r\nt MSG_177 \"Oznámenie chýb alebo žiadosti o zlepšenie programu:\"\r\nt MSG_178 \"Doplnkové Copyrighty:\"\r\nt MSG_179 \"Zásady aktuálizácií:\"\r\nt MSG_180 \"Ak povolíte tomuto programu kontrolu aktualizácií, súhlasíte s tým, že nasledujúce informácie budú zbierané našimi servermi:\"\r\nt MSG_181 \"Architektúra vášho operačného systému a jeho verzia\"\r\nt MSG_182 \"Verzia používaného programu Rufus\"\r\nt MSG_183 \"Vaša IP adresa\"\r\nt MSG_184 \"Pre účel vytvárania osobných štatistík používania programu, môžeme uschovávať tieto zhromaždené informácie, \\\\b väčšinou rok\\\\b0 . Avšak, tieto osobné informácie neposkytujeme dobrovoľne tretím stranám.\"\r\nt MSG_185 \"Aktualizačný proces:\"\r\nt MSG_186 \"Program Rufus nepobeží ako služba na pozadí a nenainštaluje aktualizáciu. Pre kontrolu aktualizácií, musí byť spustené hlavné okno.\\\\line\\nPre aktualizáciu programu je potrebný prístup na internet.\"\r\nt MSG_187 \"Neplatný obraz pre vybrané nastavenie bootovania\"\r\nt MSG_188 \"Aktuálny obraz sa nehodí pre vybrané nastavenia bootovania. Použite iný obraz alebo zmeňte nastavenia bootovania.\"\r\nt MSG_189 \"Tento ISO obraz nie je kompatibilný s vybratým súborovým systémom\"\r\nt MSG_190 \"Zistené nekompatibilné zariadenie\"\r\nt MSG_191 \"Prebieha zápis\"\r\nt MSG_192 \"Prebieha čítanie\"\r\nt MSG_193 \"Stiahnuté: %s\"\r\nt MSG_194 \"Nie je možné stiahnúť: %s\"\r\nt MSG_195 \"Použitie súboru (-ov) obsiahnutej verzie %s\"\r\nt MSG_196 \"DÔLEŽITÉ: TOTO ZARIADENIE POUŽÍVA NEŠTANDARDNÚ VEĽKOSŤ SEKTORU!\\n\\nBežné jednotky použivájú 512-bitový sektor, ale táto jednotka používa %d-bitový sektor. Vo veľa prípadoch to znamená, že NEBUDE možné bootovať z tejto jednotky.\\nProgram Rufus sa pokúsi vytvoriť bootovateľnú jednotku, ale nie je tu ŽIADNA ZÁRUKA, že to bude fungovať.\"\r\nt MSG_197 \"Zistená neštandardná veľkosť sektora\"\r\nt MSG_198 \"„Windows To Go\\\" môže byť nainštalovaný iba na oddiely rozdelenú GPT jednotku ak má nastavený atribút UPRAVENÝ. Aktuálna jednotka nebola zistená ako UPRAVENÁ.\"\r\nt MSG_199 \"Táto funkcia nie je na tejto platforme k dispozícii.\"\r\nt MSG_201 \"Ukončuje sa operácia - čakajte prosím...\"\r\nt MSG_202 \"Analýza obrazu disku...\"\r\nt MSG_203 \"Analýza obrazu zlyhala\"\r\nt MSG_204 \"Zistený zastaralý modul: %s\"\r\nt MSG_205 \"Použítý obraz: %s\"\r\nt MSG_206 \"Chýbajúci súbor: %s\"\r\nt MSG_207 \"Nový zväzok\"\r\nt MSG_208 \"Bolo nájdené %d zariadenie\"\r\nt MSG_209 \"Počet nájdených zariadení: %d\"\r\nt MSG_210 \"PRIPRAVENÝ\"\r\nt MSG_211 \"Operácia zrušená\"\r\nt MSG_212 \"NEÚSPEŠNÉ\"\r\nt MSG_213 \"Spúšťanie novej aplikácie...\"\r\nt MSG_214 \"Neúspešné spustenie novej aplikácie\"\r\nt MSG_215 \"Otvorený súbor: %s\"\r\nt MSG_216 \"Uložený súbor: %s\"\r\nt MSG_217 \"Formátovanie: %s\"\r\nt MSG_218 \"Vytváranie súborového systému: %d/%d\"\r\nt MSG_219 \"NTFS Fixup: %d%% dokončených\"\r\nt MSG_220 \"Formátovanie (%s) - zostávajúci čas: %d:%02d...\"\r\nt MSG_221 \"Nastavovanie menovky (%s)...\"\r\nt MSG_222 \"Formátovanie (%s)...\"\r\nt MSG_223 \"NTFS Fixup (kontrola disku)...\"\r\nt MSG_224 \"Vymazávanie MBR/PBR/GPT štruktúr...\"\r\nt MSG_225 \"Požiadavka na prístup na disk...\"\r\nt MSG_226 \"Analyzovanie existujúcich boot zápisov...\"\r\nt MSG_227 \"Uzatváranie existujúceho zväzku...\"\r\nt MSG_228 \"Zapisovanie hlavného zavádzacieho záznamu (MBR)...\"\r\nt MSG_229 \"Zapisovanie boot záznamu oddielu...\"\r\nt MSG_230 \"Kopírovanie súborov z DOS obrazu...\"\r\nt MSG_231 \"Kopírovanie súborov z ISO obrazu: %s\"\r\nt MSG_232 \"Win7 EFI boot inštalácia (%s)...\"\r\nt MSG_233 \"Prebieha dokončovanie, čakajte...\"\r\nt MSG_234 \"Inštaluje sa Syslinux %s...\"\r\nt MSG_235 \"Chybné bloky: %s %d/%d - %0.2f%% (Chyby: %d/%d/%d)\"\r\nt MSG_236 \"Chybné bloky: Testovanie s náhodným vzorkami\"\r\nt MSG_237 \"Chybné bloky: Testovanie s vzorkou 0x%02X\"\r\nt MSG_238 \"Vytváranie oddielov (%s)...\"\r\nt MSG_239 \"Vymazávanie oddielov (%s)...\"\r\nt MSG_240 \"Podpis stiahnutej aktualizácie nemôže byť overený. To by mohlo znamenať, že váš systém nie je správne nastavený pre overenie podpisu alebo indikuje škodlivé sťahovanie.\\n\\nStiahnutý súbor bude vymazaný. Pre viac informácií skontrolujte záznam.\"\r\nt MSG_241 \"Sťahovanie: %s\"\r\nt MSG_242 \"Neúspešné sťahovanie súboru.\"\r\nt MSG_243 \"Kontrola aktualizácií programu Rufus...\"\r\nt MSG_244 \"Aktualizácia: Chyba pripojenia\"\r\nt MSG_245 \"Aktualizácia: Nedostupné údaje o verzii\"\r\nt MSG_246 \"Je dostupná nová verzia programu Rufus!\"\r\nt MSG_247 \"Nebola nájdená novšia verzia programu\"\r\nt MSG_248 \"Kľúče registrov programu boli úspešné vymazané\"\r\nt MSG_249 \"Kľúče registrov programu neboli vymazané\"\r\nt MSG_250 \"%s: povolené\"\r\nt MSG_251 \"%s: zakázané\"\r\nt MSG_252 \"Kontrola veľkosti\"\r\nt MSG_253 \"Vyhľadávanie USB HDD\"\r\nt MSG_254 \"Formátovanie Force large FAT32\"\r\nt MSG_255 \"NoDriveTypeAutorun bol vymazaný pri ukončení\"\r\nt MSG_256 \"Použiť imitáciu jednotky\"\r\nt MSG_257 \"Joliet podpora\"\r\nt MSG_258 \"Rock Ridge podpora\"\r\nt MSG_259 \"Vynútená aktualizácia\"\r\nt MSG_260 \"NTFS kompresia\"\r\nt MSG_261 \"Zápis obrazu: %s\"\r\nt MSG_262 \"ISO podpora\"\r\nt MSG_263 \"Použiť PROPER veľkosť jednotiek\"\r\nt MSG_264 \"Vymazávanie priečinku: „%s\\\"\"\r\nt MSG_265 \"Vyhľadávanie VMWare disku\"\r\nt MSG_266 \"Duálny UEFI/BIOS mód\"\r\nt MSG_267 \"Používanie Windows obrazu: %s\"\r\nt MSG_268 \"Používanie Windows obrazu...\"\r\nt MSG_269 \"Zachovať časové značky\"\r\nt MSG_270 \"USB ladenie\"\r\nt MSG_271 \"Prebieha výpočet kontrolného súčtu: %s\"\r\nt MSG_272 \"Vypočítať MD5, SHA1 a SHA256 kontrolný súčet pre vybraný obraz\"\r\nt MSG_273 \"Zmeniť jazyk programu\"\r\nt MSG_274 \"Bol zistený obraz %s\"\r\nt MSG_275 \"Tento obraz bol označený ako „Hybridný ISO obraz\\\". To znamená, že môže byť zapísaný iba v režime „%s\\\" (kopírovanie súboru) alebo režime „%s\\\" (obraz disku).\\nProgram Rufus odporúča použiť režim „%s\\\", aby ste mali plný prístup k zariadeniu aj po zápise naň.\\nAk sa predsa len vyskytnú problémy počas bootovania, môžete vyskúšať zapísať tento obraz znovu v režime „%s\\\".\\n\\nVyberte režim, v ktorom chcete zapísať tento obraz:\"\r\nt MSG_276 \"Zápis v režime %s (odporúčané)\"\r\nt MSG_277 \"Zápis v režime %s\"\r\nt MSG_278 \"Vyhľadávanie konfliktných procesov...\"\r\nt MSG_279 \"Bez bootovania (iba formátovanie)\"\r\nt MSG_280 \"Disk alebo ISO obraz\"\r\nt MSG_281 \"%s (vybrať obraz)\"\r\nt MSG_282 \"Uzamknutie USB zariadenia\"\r\nt MSG_283 \"Neplatný podpis\"\r\nt MSG_284 \"Stiahnutému inštalátoru chýba digitálny podpis.\"\r\nt MSG_285 \"Stiahnutý inštalátor podpísal „%s\\\".\\nTento podpis nebol rozoznaný a môže znamenať nejakú formu škodlivej aktivity...\\nSte si istý, že chcete spustiť tento súbor?\"\r\nt MSG_286 \"Vymazávanie zariadenia: %s\"\r\nt MSG_287 \"Zisťovanie nie-USB vymeniteľných zariadení\"\r\nt MSG_288 \"Chýbajúce zvýšené oprávnenia\"\r\nt MSG_289 \"Tento program je možné spustiť len s právami správcu\"\r\nt MSG_290 \"Indexovanie súborov\"\r\nt MSG_291 \"Výber verzie\"\r\nt MSG_292 \"Vyberte verziu systému Windows, ktorú chcete nainštalovať:\"\r\nt MSG_293 \"Nepodporovaná veria systému Windows\"\r\nt MSG_294 \"Táto verzia systému Windows už nie je podporovaná programom Rufus.\\nPosledná verzia programu Rufus je kompatibilná s touto platformou: v%d.%d.\"\r\nt MSG_295 \"Upozornenie: Neoficiálna verzia\"\r\nt MSG_296 \"Táto verzia programu Rufus NIE JE vydaná oficiálnymi vývojármi.\\n\\nSte si istý, že ju chcete spustiť?\"\r\nt MSG_297 \"Bol zistený skrátený ISO súbor\"\r\nt MSG_298 \"Veľkosť vybraného ISO súboru sa nezhoduje s jeho deklarovanou veľkosťou (chýba %s)!\\n\\nAk ste získali tento súbor z internetu, pokúste sa znova stiahnuť novú kópiu tohto súboru a overiť ju MD5 alebo SHA kontrolným súčtom s originálnym súborom.\\n\\nAk chcete vypočítať kontrolný súčet MD5 alebo SHA pre vybraný súbor v programe Rufus, stlačte tlačidlo (✓).\"\r\nt MSG_299 \"Vyskytla sa chyba pri overení časovej známky\"\r\nt MSG_300 \"Program Rufus nemohol overiť časovú známku stiahnutej aktualizácie, ktorá je aktuálnejšia ako aktuálne spustená verzia.\\n\\nPre ochranu voči potencionálnemu útoku bude inštalácia zrušená a stiahnutý súbor bude vymazaný. Pre viac detailov skontrolujte záznam.\"\r\nt MSG_301 \"Zobraziť nastavenia programu\"\r\nt MSG_302 \"Zobraziť informácie o tomto programe\"\r\nt MSG_303 \"Zobraziť záznam činnosti programu\"\r\nt MSG_304 \"Vytvoriť obraz disku z vybraného zariadenia\"\r\nt MSG_305 \"Pomocou tejto možnosti môže použiť toto zariadenie na inštaláciu systému Windows na iný disk, alebo ak chcete spustiť systém Windows priamo z tohto zariadenia (Windows To Go).\"\r\nt MSG_306 \"Rýchle vymazávanie zariadenia: %s\"\r\nt MSG_307 \"môže to chvíľu trvať\"\r\nt MSG_308 \"Detekcia VHD\"\r\nt MSG_309 \"Komprimovaný archív\"\r\nt MSG_310 \"Vami vybraný ISO obraz používa UEFI a je dostatočne malý na to, aby sa zapísal do systémovej oblasti EFI (ESP). Zápisom do ESP namiesto zápisu do všeobecnej oblasti zaberajúcej celý disk, môže byť vhodnejšie pre niektoré typy inštalácií.\\n\\nVyberte režim, ktorý chcete použiť na zápis tohto obrazu:\"\r\nt MSG_311 \"Pre povolenie použite %s (v hlavnom okne aplikácie).\"\r\nt MSG_312 \"Extra hash (SHA512)\"\r\nt MSG_313 \"Uložiť do VHD\"\r\nt MSG_314 \"Prebieha výpočet kontrolného súčtu\"\r\nt MSG_315 \"Viacero tlačidiel\"\r\nt MSG_316 \"Počet prechodov\"\r\nt MSG_317 \"ID disku\"\r\nt MSG_318 \"Predvolená priorita vlákna: %d\"\r\nt MSG_319 \"Ignorovať zavádzaciu značku\"\r\nt MSG_320 \"Obnovuje sa rozloženie oblasti (%s)...\"\r\nt MSG_321 \"Obráz, ktorý ste vybrali, je ISOHybrid a nie je kompatibilný s ISO/režim kopírovania súboru.\\nV dôsledku toho sa vynúti režim zápisu obrazu DD.\"\r\nt MSG_322 \"Nedá sa otvoriť alebo prečítať „%s\\\"\"\r\nt MSG_325 \"Použitie prispôsobenia systému Windows: %s\"\r\nt MSG_326 \"Použitie používateľských nastavení...\"\r\nt MSG_327 \"Používateľská skúsenosť so systémom Windows\"\r\nt MSG_328 \"Prajete si prispôsobiť inštaláciu systému Windows?\"\r\nt MSG_329 \"Odstrániť požiadavku pre 4GB+ RAM, Secure Boot a TPM 2.0\"\r\nt MSG_330 \"Odstrániť požiadavky na online konto Microsoft\"\r\nt MSG_331 \"Zakázať zhromažďovanie údajov (preskočiť otázky týkajúce sa ochrany osobných údajov)\"\r\nt MSG_332 \"Zabrániť funkcii Windows To Go v prístupe na interné disky\"\r\nt MSG_333 \"Vytvorte si lokálny účet s používateľským menom:\"\r\nt MSG_334 \"Nastaviť miestne možnosti na rovnaké hodnoty, ako možnosti tohto používateľa\"\r\nt MSG_335 \"Vypnutie automatického šifrovania zariadenia BitLocker\"\r\nt MSG_336 \"Trvalý záznam činností\"\r\nt MSG_337 \"Na použitie tejto funkcie je potrebné prevziať od spoločnosti Microsoft ďalší súbor („%s“):\\n- Výberom možnosti „Áno\\\" ho stiahnete z internetu\\n- Výberom možnosti „Nie\\\" zrušíte operáciu\\n\\nPoznámka: Súbor sa stiahne do adresára aplikácie a automaticky sa znova použije, ak je k dispozícii.\"\r\nt MSG_338 \"Bol zistený zrušený zavádzač UEFI\"\r\nt MSG_339 \"Program Rufus zistil, že ISO, ktoré ste vybrali, obsahuje zavádzač UEFI, ktorý bol zrušený a ktorý bude produkovať %s, keď je povolené zabezpečené spustenie na plne aktuálnom systéme UEFI.\\n\\n- Ak ste tento obraz ISO získali z neseriózneho zdroja, mali by ste zvážiť možnosť, že by mohol obsahovať malvér UEFI a vyhnúť sa bootovaniu z neho.\\n- Ak ste ho získali z dôveryhodného zdroja, mali by ste sa pokúsiť nájsť aktuálnejšiu verziu, ktorá toto upozornenie nespustí.\"\r\nt MSG_340 \"obrazovka „Narušenie bezpečnosti\\\"\"\r\nt MSG_341 \"a Obrazovka obnovenia systému Windows (BSOD) s %s\"\r\nt MSG_342 \"Komprimovaný obraz VHDX\"\r\nt MSG_343 \"Nekomprimovaný obraz VHD\"\r\nt MSG_344 \"Obraz úplnej flash aktualizácie\"\r\nt MSG_345 \"Ak chcete používať túto funkciu, musíte si od spoločnosti Microsoft stiahnuť niektoré ďalšie dáta:\\n- Výberom možnosti „Áno\\\" ich stiahnete z internetu\\n- Výberom možnosti „Nie\\\" zrušíte túto operáciu\"\r\nt MSG_346 \"Obmedziť systém Windows s režimom S (NEKOMPATIBILNÝ s obídením konta online)\"\r\nt MSG_347 \"Expertný režim\"\r\nt MSG_348 \"Extrahovanie archívnych súborov: %s\"\r\nt MSG_349 \"Použiť Rufus MBR\"\r\nt MSG_900 \"Rufus je utilita, ktorá vám pomôže naformátovať a vytvoriť bootovacie jednotky USB Flash, ako sú napr. USB kľúče, pamäťové karty, atď.\"\r\nt MSG_901 \"Oficiálna stránka: %s\"\r\nt MSG_902 \"Zdrojový kód: %s\"\r\nt MSG_903 \"Zoznam zmien: %s\"\r\nt MSG_904 \"Táto aplikácia je licencovaná podľa podmienok GNU Public License (GPL) verzia 3.\\nPodrobnosti nájdete na https://www.gnu.org/licenses/gpl-3.0.html.\"\r\nt MSG_905 \"boot\"\r\nt MSG_910 \"Naformátujte USB, kartu a virtuálne disky do FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Vytvorte bootovacie usb zariadenia FreeDOS\"\r\nt MSG_912 \"Vytvorte bootovacie jednotky z ISO súborov (Windows, Linux atď.)\"\r\nt MSG_913 \"Vytvorte bootovacie jednotky z diskových obrazov, vrátane tých komprimovaných\"\r\nt MSG_914 \"Vytvorte bootovacie jednotky systému BIOS alebo UEFI vrátane UEFI bootovateľnej jednotky NTFS\"\r\nt MSG_915 \"Vytvorte jednotky „Windows To Go\\\"\"\r\nt MSG_916 \"Vytvorte inštalačné jednotky Windows 11 pre počítače, ktoré nemajú modul TPM, ani Secure Boot\"\r\nt MSG_917 \"Vytvorte trvalé oblasti systému Linux\"\r\nt MSG_918 \"Vytvorte obrazy VHD/DD z vybratej jednotky\"\r\nt MSG_919 \"Vypočítajte kontrolné súčty vybratého obrazu (MD5, SHA-1, SHA-256 a SHA-512)\"\r\nt MSG_920 \"Vykonajte kontroly zlých blokov vrátane detekcie „falošných\\\" prenosných diskov\"\r\nt MSG_921 \"Stiahnite si oficiálne ISO pre Microsoft Windows\"\r\nt MSG_922 \"Stiahnite UEFI Shell ISO\"\r\n\r\n#########################################################################\r\nl \"sl-SI\" \"Slovenian (Slovenščina)\" 0x0424\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"O Rufusu\"\r\nt IDC_ABOUT_LICENSE \"Licenca\"\r\nt IDOK \"V redu\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Lastnosti pogona\"\r\nt IDS_DEVICE_TXT \"Naprava\"\r\nt IDS_BOOT_SELECTION_TXT \"Izbira zagona\"\r\nt IDC_SELECT \"Izberi\"\r\nt IDS_IMAGE_OPTION_TXT \"Možnosti slike\"\r\nt IDS_PARTITION_TYPE_TXT \"Particijska shema\"\r\nt IDS_TARGET_SYSTEM_TXT \"Ciljni sistem\"\r\nt IDC_LIST_USB_HDD \"Naštej USB trde diske\"\r\nt IDC_OLD_BIOS_FIXES \"Dodaj popravke za stare BIOSe\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Med zagonom omogoči UEFI preverjanje integritete medija\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Možnosti formatiranja\"\r\nt IDS_FILE_SYSTEM_TXT \"Datotečni sistem\"\r\nt IDS_CLUSTER_SIZE_TXT \"Velikost gruče\"\r\nt IDS_LABEL_TXT \"Oznaka nosilca\"\r\nt IDC_QUICK_FORMAT \"Hitro formatiranje\"\r\nt IDC_BAD_BLOCKS \"Odkrij slabe bloke\"\r\nt IDC_EXTENDED_LABEL \"Ustvari datoteki za ikono in podaljšano oznako\"\r\nt IDS_STATUS_TXT \"Stanje\"\r\nt IDCANCEL \"Zapri\"\r\nt IDC_START \"Začni\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Zapri\"\r\nt IDD_LICENSE \"Rufusova licenca\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Zapri\"\r\nt IDD_LOG \"Zapisnik\"\r\nt IDC_LOG_CLEAR \"Izprazni\"\r\nt IDC_LOG_SAVE \"Shrani\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Zapri\"\r\nt IDD_NEW_VERSION \"Rufus - posodobitve\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Novejša verzija je na voljo. Prosim, prenesite jo!\"\r\nt IDC_WEBSITE \"Kliknite sem, da greste na spletno stran\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Opombe ob izdaji\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Prenesi\"\r\nt IDC_DOWNLOAD \"Prenesi\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Več informacij\"\r\nt IDYES \"Da\"\r\nt IDNO \"Ne\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Zapri\"\r\nt IDD_UPDATE_POLICY \"Posodobitvena politika in nastavitve\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Nastavitve\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Preveri za posodobitve\"\r\nt IDS_INCLUDE_BETAS_TXT \"Upoštevaj beta verzije\"\r\nt IDC_CHECK_NOW \"Preveri zdaj\"\r\n\r\nt MSG_001 \"Drug primerek zaznan\"\r\nt MSG_002 \"Še en primerek Rufusa se izvaja.\\nProsim, zaprite ga, preden zaženete še enega.\"\r\nt MSG_003 \"OPOZORILO: VSI PODATKI NA NAPRAVI \\\"%s\\\" BODO UNIČENI.\\nČe želite nadaljevati s to operacijo, izberite \\\"V redu\\\", drugače izberite \\\"Prekliči\\\".\"\r\nt MSG_004 \"Rufusova posodobitvena politika\"\r\nt MSG_005 \"Ali dovolite, da Rufus na internetu išče posodobitve zase?\"\r\nt MSG_006 \"Zapri\"\r\nt MSG_007 \"Prekliči\"\r\nt MSG_008 \"Da\"\r\nt MSG_009 \"Ne\"\r\nt MSG_010 \"Slabi bloki najdeni\"\r\nt MSG_011 \"Preizkus končan: %d slabih blokov najdenih\\n  Napak pri branju: %d\\n  Napak pri pisanju: %d\\n  Nezanesljivih blokov: %d\"\r\nt MSG_012 \"%s\\nPodrobnejše poročilo lahko najdete v datoteki\\n%s\"\r\nt MSG_013 \"Onemogočeno\"\r\nt MSG_014 \"Dnevno\"\r\nt MSG_015 \"Tedensko\"\r\nt MSG_016 \"Mesečno\"\r\nt MSG_017 \"Po meri\"\r\nt MSG_018 \"Vaša verzija: %d.%d (izgradnja %d)\"\r\nt MSG_019 \"Najnovejša verzija: %d.%d (izgradnja %d)\"\r\nt MSG_020 \"bajtov\"\r\nt MSG_026 \"bajtov\"\r\nt MSG_027 \"kilobajtov\"\r\nt MSG_028 \"megabajtov\"\r\nt MSG_029 \"Privzeto\"\r\nt MSG_030 \"%s (privzeto)\"\r\nt MSG_031 \"BIOS (oz. UEFI-CSM)\"\r\nt MSG_032 \"UEFI (brez CSM)\"\r\nt MSG_033 \"BIOS ali UEFI\"\r\nt MSG_034 \"%d prehod\"\r\nt MSG_035 \"%d prehoda/-i %s\"\r\nt MSG_036 \"Sliko ISO\"\r\nt MSG_037 \"Aplikacija\"\r\nt MSG_038 \"Prekini\"\r\nt MSG_039 \"Zaženi\"\r\nt MSG_040 \"Prenesi\"\r\nt MSG_041 \"Operacijo je prekinil uporabnik\"\r\nt MSG_042 \"Napaka\"\r\nt MSG_043 \"Napaka: %s\"\r\nt MSG_044 \"Prenos datoteke\"\r\nt MSG_045 \"USB podatkovni nosilec (generičen)\"\r\nt MSG_046 \"%s (disk %d) [%s]\"\r\nt MSG_047 \"Več particij\"\r\nt MSG_048 \"Rufus - izpiranje medpomnilnika\"\r\nt MSG_049 \"Rufus - preklic\"\r\nt MSG_050 \"Uspešno zaključeno.\"\r\nt MSG_051 \"Nedoločena napaka med formatiranjem.\"\r\nt MSG_052 \"Za ta medij tega datotečnega sistema ni mogoče uporabiti.\"\r\nt MSG_053 \"Dostop do naprave je zavrnjen.\"\r\nt MSG_054 \"Na medij ni mogoče pisati.\"\r\nt MSG_055 \"Napravo uporablja drug proces. Prosim, zaprite vse procese, ki bi lahko uporabljali to napravo.\"\r\nt MSG_056 \"Za to napravo hitro formatiranje ni na voljo.\"\r\nt MSG_057 \"Oznaka nosilca je neveljavna.\"\r\nt MSG_058 \"Napravin oprimek je neveljaven.\"\r\nt MSG_059 \"Izbrana velikost gruče ni veljavna za to napravo.\"\r\nt MSG_060 \"Velikost nosilca je neveljavna.\"\r\nt MSG_061 \"Prosim, vstavite izmenljiv medij v pogon.\"\r\nt MSG_062 \"Prejet je bil nepodprt ukaz.\"\r\nt MSG_063 \"Napaka pri dodelitvi spomina.\"\r\nt MSG_064 \"Napaka pri branju.\"\r\nt MSG_065 \"Napaka pri pisanju.\"\r\nt MSG_066 \"Napaka pri nameščanju\"\r\nt MSG_067 \"Ni mogoče odpreti medija. Morda ga uporablja drug proces. Prosim, ponovno priključite medij in poskusite znova.\"\r\nt MSG_068 \"Ustvarjanje particije ni uspelo.\"\r\nt MSG_069 \"Ni bilo mogoče kopirati datotek na ciljni pogon.\"\r\nt MSG_070 \"Uporabnik je prekinil operacijo.\"\r\nt MSG_071 \"Niti ni mogoče zagnati.\"\r\nt MSG_072 \"Preizkus blokov se ni zaključil.\"\r\nt MSG_073 \"Napaka pri preiskovanju ISO slike.\"\r\nt MSG_074 \"Napaka pri vlečenju iz ISO slike.\"\r\nt MSG_075 \"Nosilca ni mogoče ponovno priklopiti.\"\r\nt MSG_076 \"Ni mogoče popraviti oz. pripraviti zagonskih datotek.\"\r\nt MSG_077 \"Pogonu ni mogoče dodeliti črke.\"\r\nt MSG_078 \"Ni mogoče priklopiti nosilca z GUID.\"\r\nt MSG_079 \"Naprava ni pripravljena.\"\r\nt MSG_080 \"Rufus je zaznal, da Windows še vedno izpira svoje notranje medpomnilnike na napravo USB.\\n\\nOdvisno od hitrosti naprave to lahko traja veliko časa, še posebej za velike datoteke.\\n\\nPriporočamo vam, da počakate, da Windows opravi svoje, da se izognete poškodbi podatkov. Če pa se čakanja naveličate, lahko napravo kar izvlečete...\"\r\nt MSG_081 \"Nepodprta slika\"\r\nt MSG_082 \"Ta slika ni zagonska ali pa Rufus ne podpira njenega načina zagona ali metode stiskanja.Ta ISO očitno ne uporablja nobenega izmed njih...\"\r\nt MSG_083 \"Zamenjam %s?\"\r\nt MSG_084 \"Zdi se, da ta ISO slika uporablja zastarelo verzijo \\\"%s\\\".\\nZaradi tega se zagonski meniji morda ne bodo prikazovali pravilno.\\n\\nRufus lahko prenese novejšo verzijo, da to težavo odpravi.\\n- Izberite \\\"Da\\\", da se povežete na internet in prenesete datoteko.\\n- Izberite \\\"Ne\\\", da slike ne spreminjate.\\nČe ne veste, kaj storiti, izberite \\\"Da\\\".\\n\\nOpomba: nova datoteka bo prenesena v trenutni imenik in ko datoteka \\\"%s\\\" tam enkrat obstaja, bo samodejno uporabljena tudi v bodoče.\"\r\nt MSG_085 \"Prenašam %s\"\r\nt MSG_086 \"Izbrana ni nobena slika\"\r\nt MSG_087 \"za nosilec vrste %s\"\r\nt MSG_088 \"Slika je prevelika\"\r\nt MSG_089 \"Ta slika je prevelika za izbrani cilj.\"\r\nt MSG_090 \"Nepodprt ISO\"\r\nt MSG_091 \"Za cilj UEFI so podprte samo zagonske ISO slike, združljive z EFI. Prosim, izberite zagonski ISO, združljiv z EFI, ali nastavite cilj na BIOS.\"\r\nt MSG_092 \"Nepodprt datotečni sistem\"\r\nt MSG_093 \"TA POGON IMA VEČ PARTICIJ!\\n\\nTo lahko vključuje particije, ki jih Windows niti ne prikazuje. Če nadaljujete, ste odgovorni za morebitno izgubo podatkov na teh particijah.\"\r\nt MSG_094 \"Zaznanih več particij\"\r\nt MSG_095 \"Sliko DD\"\r\nt MSG_096 \"Trenutno izbranega datotečnega sistema ni mogoče uporabljati s to vrsto slike ISO. Izberite drug datotečni sistem ali pa uporabite drugo sliko.\"\r\nt MSG_097 \"'%so' je mogoče uporabiti samo z datotečnim sistemom NTFS.\"\r\nt MSG_098 \"POMEMBNO: Namestiti poskušate 'Windows To Go' na odstranljiv nosilec. Windows se bo najverjetneje ustavil med zagonom, ker zagon z odstranljivega nosilca ni uradno podprt.\\n\\nAli še vedno želite nadaljevati?\\n\\nOpomba: atribut, ki določa, ali je nosilec \\\"fiksen\\\" ali \\\"odstranljiv\\\", je mogoče spremeniti le s posebnim programom proizvajalca naprave. Takšni programi navadno niso na voljo javnosti.\"\r\nt MSG_099 \"Omejitev datotečnega sistema\"\r\nt MSG_100 \"Ta slika vsebuje datoteko, večjo od 4 GB, kar je več kot največja velikost, ki jo dopuščata datotečna sistema FAT in FAT32.\"\r\nt MSG_101 \"Manjkajoča podpora za WIM\"\r\nt MSG_102 \"Vaš sistem ne more vleči datotek iz arhivov WIM. To je potrebno za ustvarjanje zagonskih pogonov USB z operacijskim sistemom Windows Vista ali Windows 7. To lahko popravite, če namestite nedavno verzijo programa 7-Zip.\\nŽelite obiskati spletno stran, kjer lahko 7-Zip prenesete?\"\r\nt MSG_103 \"Prenesem %s?\"\r\nt MSG_104 \"%s ali novejši zahteva, da je nameščena datoteka \\\"%s\\\".\\nKer je ta datoteka večja od 100 KB in je vedno prisotna na ISO slikah s %s ali novejšim, ni vgrajena v Rufus.\\n\\nRufus jo lahko prenese namesto vas.\\n- Izberite \\\"Da\\\", da se povežete na internet in prenesete datoteko.\\n- Izberite \\\"Ne\\\", če želite to datoteko pozneje sami kopirati na pogon.\\n\\nOpomba: nova datoteka bo prenesena v trenutni imenik in ko datoteka \\\"%s\\\" tam enkrat obstaja, bo samodejno uporabljena tudi v bodoče.\"\r\nt MSG_105 \"Preklic lahko pusti napravo v NEUPORABNEM stanju.\\nČe ste prepričani, da želite operacijo preklicati, izberite DA, drugače izberite NE.\"\r\nt MSG_106 \"Prosim, izberite mapo\"\r\nt MSG_107 \"Vse datoteke\"\r\nt MSG_108 \"Rufusov zapisnik\"\r\nt MSG_109 \"0x%02X (disk %d)\"\r\nt MSG_110 \"MS-DOS se ne more zagnati s pogona, na katerem so gruče velike 64 KB.\\nProsim, spremenite velikost gruče ali uporabite FreeDOS.\"\r\nt MSG_111 \"Nezdružljiva velikost gruče\"\r\nt MSG_112 \"Formatiranje velikih nosilcev UDF lahko traja veliko časa. Pri hitrostih USB 2.0 je predvideno trajanje formatiranja %d:%02d, med čimer se kazalnik poteka ne bo premaknil. Prosim, bodite potrpežljivi!\"\r\nt MSG_113 \"Velik nosilec UDF\"\r\nt MSG_114 \"Ta slika uporablja Syslinux %s%s, toda ta aplikacija vsebuje le namestitvene datoteke za Syslinux %s%s.\\n\\nKer novejše verzije Syslinuxa niso združljive in Rufus ne more vsebovati vseh, morata biti prenešeni še dve dodatni datoteki (ldlinux.sys in ldlinux.bss):\\n- Izberite \\\"Da\\\", da se povežete na internet in prenesete ti dve datoteki.\\n- Izberite \\\"Ne\\\", da prekinete dejanje.\\n\\nOpomba: datoteki bosta prenešeni v mapo, kjer je nameščen Rufus, in bosta v prihodnje ponovno uporabljeni.\"\r\nt MSG_115 \"Prenos potreben\"\r\nt MSG_116 \"Ta slika uporablja GRUB %s, toda ta aplikacija vsebuje le namestitvene datoteke za GRUB %s.\\n\\nKer različne verzije programa GRUB niso nujno združljive in Rufus ne more vsebovati vseh, bo Rufus poskušal najti verzijo namestitvene datoteke za GRUB (core.img), ki se ujema s tisto na sliki:\\n- Izberite \\\"Da\\\", da se povežete na internet in prenesete to datoteko.\\n- Izberite \\\"Ne\\\", da uporabite privzeto verzijo, ki jo Rufus že vsebuje.\\n- Izberite \\\"Prekliči\\\", da prekinete dejanje.\\n\\nOpomba: datoteka bo prenešena v mapo, kjer je nameščen Rufus, in bo v prihodnje ponovno uporabljena. Če Rufus ne more najti ustrezne datoteke, bo uporabljena privzeta verzija.\"\r\nt MSG_117 \"Standardna namestitev operacijskega sistema Windows\"\r\nt MSG_119 \"napredne lastnosti pogona\"\r\nt MSG_120 \"napredne možnosti formatiranja\"\r\nt MSG_121 \"Pokaži %s\"\r\nt MSG_122 \"Skrij %s\"\r\nt MSG_123 \"Velikost trajne particije\"\r\nt MSG_124 \"Brez\"\r\nt MSG_125 \"Nastavi velikost trajne particije za \\\"živ\\\" medij. Velikost 0 onemogoči trajno particijo.\"\r\nt MSG_126 \"Nastavi enote velikosti particije.\"\r\nt MSG_127 \"Tega sporočila ne prikaži več\"\r\nt MSG_128 \"Pomembno obvestilo o %s\"\r\nt MSG_129 \"Ustvarili ste medij, ki uporablja nalagalnik UEFI:NTFS. Pomnite, da morate za zagon s tega medija ONEMOGOČITI Secure Boot.\\nZa razlago, zakaj je to potrebno, kliknite gumb \\\"Več informacij\\\" spodaj.\"\r\nt MSG_130 \"Izbira slike Windowsa\"\r\nt MSG_131 \"Ta ISO vsebuje več slik Windowsa.\\nIzberite sliko, ki jo želite uporabiti za to namestitev:\"\r\nt MSG_132 \"Do tega pogona dostopa drug program oz. proces. Ali ga želite vseeno formatirati?\"\r\nt MSG_133 \"Rufus je zaznal, da poskušate ustvariti medij za Windows To Go z verzijo 1809.\\n\\nZaradi hrošča v Windowsu bo ta medij povzročil sesutje (\\\"blue screen of death\\\" - BSOD) med zagonom, razen če ročno zamenjate datoteko WppRecorder.sys s tisto iz verzije 1803.\\n\\nKer avtorske pravice za to datoteko pripadajo Microsoftu, Rufus te datoteke ne vključuje in zato tega ne more storiti namesto vas.\"\r\nt MSG_134 \"Največja možna velikost particije v particijski shemi MBR je 2 TB. To bo pustilo %s prostora neizkoriščenega.\\n\\nAli želite nadaljevati?\"\r\nt MSG_135 \"Verzija\"\r\nt MSG_136 \"Izdaja\"\r\nt MSG_137 \"Različica\"\r\nt MSG_138 \"Jezik\"\r\nt MSG_139 \"Arhitektura\"\r\nt MSG_140 \"Nadaljuj\"\r\nt MSG_141 \"Nazaj\"\r\nt MSG_142 \"Prosim, počakajte...\"\r\nt MSG_143 \"Prenesi z brskalnikom\"\r\nt MSG_144 \"Prenos sistema Windows ISOs ni na voljo, ker je Microsoft spremenil njihovo spletno mesto, da bi ga preprečil.\"\r\nt MSG_145 \"Ta skripta zahteva PowerShell 3.0 ali novejši.\"\r\nt MSG_146 \"Ali ga želite prenesti?\"\r\nt MSG_148 \"Izvajam skripto za prenos...\"\r\nt MSG_149 \"Prenesi sliko ISO\"\r\nt MSG_150 \"Vrsta računalnika, ki jo nameravate zagnati s tem pogonom. To morate ugotoviti, preden ustvarite pogon, drugače zagon morda ne bo uspel.\"\r\nt MSG_151 \"'UEFI-CSM' pomeni, da se bo v UEFI s pogona mogoče zagnati le v načinu emulacije BIOS (imenovanem tudi 'Legacy Mode') in ne v običajnem UEFI načinu.\"\r\nt MSG_152 \"'brez CSM' pomeni, da se bo v UEFI s pogona mogoče zagnati le v običajnem UEFI načinu in ne v načinu emulacije BIOS (imenovanem tudi 'Legacy Mode').\"\r\nt MSG_153 \"Testni vzorec: 0x%02X\"\r\nt MSG_154 \"Testni vzorec: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Testni vzorec: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Testni vzorec: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Nastavi ciljni datotečni sistem\"\r\nt MSG_158 \"Minimalna velikost, ki jo bo zasedel kos podatkov v datotečnem sistemu\"\r\nt MSG_159 \"S tem poljem nastavite oznako pogona.\\nLahko uporabite mednarodne znake (npr. Č, Š, Ž).\"\r\nt MSG_160 \"Prikaže ali skrije dodatne možnosti\"\r\nt MSG_161 \"Preveri, ali so na napravi slabi bloki z uporabo testnega vzorca\"\r\nt MSG_162 \"To možnost odznačite za \\\"počasen\\\" način formatiranja\"\r\nt MSG_163 \"Metoda, ki bo uporabljena za ustvarjanje particij\"\r\nt MSG_164 \"Metoda, ki bo uporabljena, da bo s pogona mogoče zagnati računalnik\"\r\nt MSG_165 \"Kliknite, da izberete sliko...\"\r\nt MSG_166 \"To možnost izberite, če želite omogočiti prikaz \\\"mednarodnih\\\" oznak nosilca in nastaviti ikono za napravo (to ustvari datoteko autorun.inf).\"\r\nt MSG_167 \"Ta možnost namesti zagonski sektor, ki omogoča izbiro pri zagonu in lahko \\\"zamaskira\\\" BIOS ID pogona USB\"\r\nt MSG_169 \"Ta možnost ustvari dodatno skrito particijo in poskuša poravnati particije.\\nTo lahko izboljša zaznavo zagonskih naprav v starih BIOS verzijah.\"\r\nt MSG_170 \"Omogoči naštevanje trdih diskov, priključenih preko USB. TO JE NA VAŠO ODGOVORNOST!\"\r\nt MSG_171 \"Začne formatirati.\\nTo bo UNIČILO vse podatke na ciljni napravi!\"\r\nt MSG_172 \"Podpis prenesene datoteke ni pristen\"\r\nt MSG_173 \"Kliknite, da izberete...\"\r\nt MSG_174 \"Rufus - zanesljivi pripomoček za USB formatiranje\"\r\nt MSG_175 \"Verzija %d.%d (izgradnja %d)\"\r\nt MSG_176 \"V slovenščino prevedel Matej Horvat <mailto:matej.horvat@guest.arnes.si>\"\r\nt MSG_177 \"Prijavite hrošče ali zahtevajte izboljšave na:\"\r\nt MSG_178 \"Dodatne avtorske pravice:\"\r\nt MSG_179 \"Politika posodobitev:\"\r\nt MSG_180 \"Če programu dovolite, da preverja za posodobitve, se strinjate, da se na naših strežnikih lahko zbirajo naslednje informacije:\"\r\nt MSG_181 \"Arhitektura in verzija vašega operacijskega sistema\"\r\nt MSG_182 \"Verzija programa, ki jo uporabljate\"\r\nt MSG_183 \"Vaš IP naslov\"\r\nt MSG_184 \"Za računanje zasebne statistike o uporabi programa bomo morda te informacije obdržali \\\\b največ eno leto\\\\b0 . Ne bomo pa jih nalašč predali nikomur drugemu.\"\r\nt MSG_185 \"Postopek posodobitve:\"\r\nt MSG_186 \"Rufus ne namesti ali zaganja storitev v ozadju, zato se posodobitve prenašajo samo, ko Rufus zaženete sami.\\\\line\\nZa preverjanje in prenos posodobitev seveda potrebujete povezavo z internetom.\"\r\nt MSG_187 \"Neveljavna slika za izbran način zagona\"\r\nt MSG_188 \"Trenutna slika se ne ujema z izbranim načinom zagona. Prosim, uporabite drugo sliko ali izberite drug način zagona.\"\r\nt MSG_189 \"Ta slika ni združljiva z izbranim datotečnim sistemom\"\r\nt MSG_190 \"Zaznana je bila nezdružljiva naprava\"\r\nt MSG_191 \"Pisalni prehod\"\r\nt MSG_192 \"Bralni prehod\"\r\nt MSG_193 \"Prenesel %s\"\r\nt MSG_194 \"Ni bilo mogoče prenesti %s\"\r\nt MSG_195 \"Uporabljam vgrajeno verzijo datotek(e) %s.\"\r\nt MSG_196 \"OPOZORILO: TA NAPRAVA UPORABLJA NESTANDARDNO VELIKOST SEKTORJEV!\\n\\nVečina naprav uporablja 512-bajtne sektorje, ta naprava pa %d-bajtne. V večini primerov to pomeni, da z nje NE boste mogli zagnati računalnika.\\nRufus lahko poskusi ustvariti zagonski disk, vendar NI ZAGOTOVILA, da bo to delovalo.\"\r\nt MSG_197 \"Zaznana nestandardna velikost sektorjev\"\r\nt MSG_198 \"'Windows To Go' je lahko nameščen le na napravo s particijsko shemo GPT, če naprava ni odstranljiva. Trenutna naprava pravi, da je odstranljiva.\"\r\nt MSG_199 \"Ta funkcija ni na voljo na tej platformi.\"\r\nt MSG_201 \"Preklicujem - prosim, počakajte...\"\r\nt MSG_202 \"Preiskujem sliko...\"\r\nt MSG_203 \"Preiskava slike ni uspela\"\r\nt MSG_204 \"Zaznan je bil zastarel %s\"\r\nt MSG_205 \"Uporabljam sliko: %s\"\r\nt MSG_206 \"Manjkajoča datoteka %s\"\r\nt MSG_207 \"Nov nosilec\"\r\nt MSG_208 \"%d naprava najdena\"\r\nt MSG_209 \"%d naprav najdenih\"\r\nt MSG_210 \"PRIPRAVLJEN\"\r\nt MSG_211 \"Preklicano\"\r\nt MSG_212 \"Ni uspelo\"\r\nt MSG_213 \"Zaganjam novo aplikacijo...\"\r\nt MSG_214 \"Ni mogoče zagnati nove aplikacije\"\r\nt MSG_215 \"Odprl %s\"\r\nt MSG_216 \"Shranil %s\"\r\nt MSG_217 \"Formatiram: %s\"\r\nt MSG_218 \"Ustvarjam datotečni sistem: opravilo %d/%d končano\"\r\nt MSG_219 \"Popravki za NTFS: %d%% končano\"\r\nt MSG_220 \"Formatiranje (%s) - predviden čas trajanja %d:%02d...\"\r\nt MSG_221 \"Nastavljam oznako (%s)...\"\r\nt MSG_222 \"Formatiranje (%s)...\"\r\nt MSG_223 \"Popravki za NTFS (chkdsk)...\"\r\nt MSG_224 \"Brišem strukture MBR/PBR/GPT...\"\r\nt MSG_225 \"Zahtevam dostop do diska...\"\r\nt MSG_226 \"Pregledujem obstoječe zagonske vnose...\"\r\nt MSG_227 \"Zapiram obstoječi nosilec...\"\r\nt MSG_228 \"Zapisujem glavni zagonski sektor (MBR)...\"\r\nt MSG_229 \"Zapisujem podatke o particiji...\"\r\nt MSG_230 \"Kopiram DOS datoteke...\"\r\nt MSG_231 \"Kopiram datoteke s slike ISO: %s\"\r\nt MSG_232 \"Pripravljam pogon za zagon Windows 7 na EFI (%s)...\"\r\nt MSG_233 \"Zaključujem; prosim, počakajte...\"\r\nt MSG_234 \"Nameščam Syslinux %s...\"\r\nt MSG_235 \"Slabi bloki: %s %d/%d - %0.2f%% (%d/%d/%d napak)\"\r\nt MSG_236 \"Slabi bloki: testiram z naključnim vzorcem\"\r\nt MSG_237 \"Slabi bloki: testiram z vzorcem 0x%02X\"\r\nt MSG_238 \"Ustvarjam particije (%s)...\"\r\nt MSG_239 \"Brišem particije (%s)...\"\r\nt MSG_240 \"Ni mogoče potrditi pristnosti podpisa prenesene posodobitve. To lahko pomeni ali, da vaš sistem nima ustreznih nastavitev za preverjanje podpisov, ali vam nekdo poskuša podtakniti zlonamerno vsebino.\\n\\nPrenesena datoteka bo izbrisana. Prosim, preverite zapisnik za več podrobnosti.\"\r\nt MSG_241 \"Prenašam: %s\"\r\nt MSG_242 \"Ni mogoče prenesti datoteke.\"\r\nt MSG_243 \"Preverjam za posodobitve Rufusa...\"\r\nt MSG_244 \"Posodobitve: ni se mogoče povezati na internet\"\r\nt MSG_245 \"Posodobitve: ni mogoče dostopati do podatka o verziji\"\r\nt MSG_246 \"Nova verzija Rufusa je na voljo!\"\r\nt MSG_247 \"Najdena ni bila nobena novejša verzija\"\r\nt MSG_248 \"Registrski ključi uspešno izbrisani\"\r\nt MSG_249 \"Brisanje registrskih ključev ni uspelo\"\r\nt MSG_250 \"%s: omogočeno\"\r\nt MSG_251 \"%s: onemogočeno\"\r\nt MSG_252 \"Preverjanje velikosti\"\r\nt MSG_253 \"Zaznava trdih diskov\"\r\nt MSG_254 \"Prisili véliko formatiranje FAT32\"\r\nt MSG_255 \"NoDriveTypeAutorun bo izbrisan ob izhodu\"\r\nt MSG_256 \"Zaznava lažnih pogonov\"\r\nt MSG_257 \"Podpora za Joliet\"\r\nt MSG_258 \"Podpora za Rock Ridge\"\r\nt MSG_259 \"Prisili posodobitev\"\r\nt MSG_260 \"NTFS stiskanje\"\r\nt MSG_261 \"Zapisujem sliko: %s\"\r\nt MSG_262 \"Podpora za slike ISO\"\r\nt MSG_263 \"Uporabi enote PRAVIH velikosti\"\r\nt MSG_264 \"Brišem imenik %s\"\r\nt MSG_265 \"Zaznavanje diskov VMware\"\r\nt MSG_266 \"Dvojni način BIOS/UEFI\"\r\nt MSG_267 \"Nameščam sliko za Windows: %s\"\r\nt MSG_268 \"Nameščam sliko za Windows...\"\r\nt MSG_269 \"Ohranjanje časov datotek\"\r\nt MSG_270 \"Razhroščevanje USB\"\r\nt MSG_271 \"Računam zgoščene vrednosti: %s\"\r\nt MSG_272 \"Izračuna zgoščene vrednosti MD5, SHA1 in SHA256 za izbrano sliko\"\r\nt MSG_273 \"Spremeni jezik aplikacije\"\r\nt MSG_274 \"Zaznana je bila slika %s\"\r\nt MSG_275 \"Slika, ki ste jo izbrali, je vrste \\\"ISOHybrid\\\". To pomeni, da jo lahko zapišete kot %s (s kopiranjem datotek) ali pa kot %s (s kopiranjem cele slike).\\nRufus priporoča, da jo zapišete kot %s, tako da boste imeli poln dostop do nosilca, ko bo slika zapisana.\\nČe opazite težave pri zaganjanju, pa jo lahko še enkrat zapišete kot %s..\\n\\nIzberite, kako jo želite zapisati:\"\r\nt MSG_276 \"Zapiši kot %s (priporočeno)\"\r\nt MSG_277 \"Zapiši kot %s\"\r\nt MSG_278 \"Preverjam, ali se izvajajo konfliktni procesi...\"\r\nt MSG_279 \"Nezagonska\"\r\nt MSG_280 \"Slika diska oz. ISO\"\r\nt MSG_281 \"%s (izberite)\"\r\nt MSG_282 \"Ekskluzivno zaklepanje nosilca USB\"\r\nt MSG_283 \"Neveljaven podpis\"\r\nt MSG_284 \"Prenesena datoteka nima digitalnega podpisa.\"\r\nt MSG_285 \"Oseba, ki je podpisala preneseno datoteko, je '%s'.\\nTa podpis se ne ujema s pričakovanim, kar lahko pomeni, da je to zlonamerna datoteka, ki jo vam je nekdo podtaknil.\\nAli ste prepričani, da jo želite zagnati?\"\r\nt MSG_286 \"Zapolnjujem nosilec z ničlami: %s\"\r\nt MSG_287 \"Zaznava neodstranljivih nosilcev\"\r\nt MSG_288 \"Nimate dovolj pravic\"\r\nt MSG_289 \"Za uporabo te aplikacije potrebujete dodatne pravice\"\r\nt MSG_290 \"Indeksiranje diska\"\r\nt MSG_291 \"Izbira verzije\"\r\nt MSG_292 \"Izberite, katero verzijo operacijskega sistema Windows želite namestiti:\"\r\nt MSG_293 \"Operacijski sistem ni podprt\"\r\nt MSG_294 \"Rufus več ne podpira tega operacijskega sistema.\\nZadnja različica programa Rufus, združljiva s to platformo, je v%d.%d.\"\r\nt MSG_295 \"Opozorilo: neuradna verzija\"\r\nt MSG_296 \"Te verzije Rufusa ni izdelal njegov uradni razvijalec.\\n\\nAli ste prepričani, da jo želite uporabljati?\"\r\nt MSG_297 \"Odrezana datoteka ISO\"\r\nt MSG_298 \"Datoteka ISO, ki ste jo izbrali, ni pričakovane velikosti: %s njenih podatkov manjka.\\n\\nČe ste jo prenesli z interneta, jo prenesite še enkrat in preverite, ali se vrednosti MD5 in SHA ujemata z uradnima.\\n\\nV Rufusu ju lahko izračunate z gumbom (✓).\"\r\nt MSG_299 \"Napaka pri preverjanju časovnega žiga\"\r\nt MSG_300 \"Ni bilo mogoče ugotoviti, da je časovni žig prenesene posodobitve res novejši od vaše trenutne verzije Rufusa.\\n\\nDa ne bi prišlo do potencialnega napada, je bil postopek posodobitve prekinjen, prenesena posodobitev pa bo izbrisana. Za več podrobnosti preverite zapisnik.\"\r\nt MSG_301 \"Nastavitve aplikacije\"\r\nt MSG_302 \"Informacije o tej aplikaciji\"\r\nt MSG_303 \"Prikaži zapisnik\"\r\nt MSG_304 \"Ustvari sliko izbrane naprave\"\r\nt MSG_305 \"Tu izberete, ali želite uporabiti to napravo, da bi namestili operacijski sistem Windows na drug disk, ali da bi ga neposredno izvajali s tega pogona (Windows To Go).\"\r\nt MSG_306 \"Hitro zapolnjujem nosilec z ničlami: %s\"\r\nt MSG_307 \"to lahko traja\"\r\nt MSG_308 \"Zaznavanje navideznih nosilcev (VHD)\"\r\nt MSG_309 \"Stisnjen arhiv\"\r\nt MSG_310 \"Izbrana ISO slika uporablja UEFI in je dovolj majhna, da jo je mogoče zapisati na sistemsko particijo EFI (EFI System Partition oz. ESP). Za nekatere vrste namestitev je to lahko bolje kot običajni način, pri katerem se slika zapiše na particijo, ki zaseda celoten disk.\\n\\nIzberite, na kateri način želite zapisati to sliko:\"\r\nt MSG_311 \"To lahko omogočite z %s v glavnem oknu aplikacije.\"\r\nt MSG_312 \"Dodatne zgoščene vrednosti (SHA512)\"\r\nt MSG_313 \"Shrani v VHD\"\r\nt MSG_314 \"Izračunaj kontrolne vsote slik\"\r\nt MSG_315 \"Skupek gumbov\"\r\nt MSG_316 \"Število prehodov\"\r\nt MSG_317 \"Identifikator diska\"\r\nt MSG_318 \"Privzeta prioriteta niti: %d\"\r\nt MSG_319 \"Indikator zagonskosti (Boot Marker, \\\"55 AA\\\") se ignorira\"\r\nt MSG_320 \"Osvežujem razpored particij (%s)...\"\r\nt MSG_321 \"Izbrana slika je vrste ISOHybrid, vendar ni združljiva z načinom kopiranja datotek (ISO),\\nzato bo za zapisovanje uporabljen način za slike DD.\"\r\nt MSG_322 \"Ni mogoče odpreti ali brati »%s'\"\r\nt MSG_325 \"Uporaba prilagoditve sistema Windows: %s\"\r\nt MSG_326 \"Uporaba uporabniških možnosti ...\"\r\nt MSG_327 \"Uporabniška izkušnja sistema Windows\"\r\nt MSG_328 \"Prilagodite namestitev sistema Windows?\"\r\nt MSG_329 \"Odstranite zahtevo za 4GB+ RAM, Varni zagon in TPM 2.0\"\r\nt MSG_330 \"Odstranjevanje zahteve za spletni Microsoftov račun\"\r\nt MSG_331 \"Onemogoči zbiranje podatkov (Preskoči vprašanja o zasebnosti)\"\r\nt MSG_332 \"Preprečevanje dostopa do notranjih diskov za Windows To Go\"\r\nt MSG_333 \"Ustvarite lokalni račun z uporabniškim imenom:\"\r\nt MSG_334 \"Nastavite regionalne možnosti na enake vrednosti, kot jih ima ta uporabnik\"\r\nt MSG_335 \"Onemogoči samodejno šifriranje naprave BitLocker\"\r\nt MSG_336 \"Trajni dnevnik\"\r\nt MSG_337 \"Za uporabo te funkcije je treba od Microsofta prenesti dodatno datoteko ('%s'):\\n- Izberite 'Da', da se povežete z internetom in jo prenesete\\n- Izberite 'Ne', da prekličete operacijo\\n\\nOpomba: datoteka bo prenesena v imenik aplikacije in samodejno ponovno uporabljena, če je prisotna.\"\r\nt MSG_338 \"Zaznan preklican zagonski nalagalnik UEFI\"\r\nt MSG_339 \"Rufus je zaznal, da ISO, ki ste ga izbrali, vsebuje zagonski nalagalnik UEFI, ki je bil preklican in bo ustvaril %s, ko je varen zagon omogočen v popolnoma posodobljenem sistemu UEFI.\\n\\n- Če ste to ISO sliko pridobili iz neuglednega vira, razmislite o možnosti, da morda vsebuje zlonamerno programsko opremo UEFI, in se izogibajte zagonu iz nje.\\n- Če ste jo pridobili iz zaupanja vrednega vira, poskusite poiskati posodobljenejšo različico, ki tega ne bo povzročila tega opozorila.\"\r\nt MSG_340 \"zaslon \\\"Kršitev varnosti\\\".\"\r\nt MSG_341 \"zaslon za obnovitev sistema Windows (BSOD) z '%s'\"\r\nt MSG_342 \"Stisnjena VHDX slika\"\r\nt MSG_343 \"Nestisnjena VHD Slika\"\r\nt MSG_344 \"Slika celotne posodobitve Flash\"\r\nt MSG_345 \"Za uporabo te funkcije je treba od Microsofta prenesti nekaj dodatnih podatkov:\\n- Izberite 'Da', da se povežete z internetom in jih prenesete\\n- Izberite 'Ne0, da prekličete operacijo\"\r\nt MSG_346 \"Omejite Windows na S-način (NEZDRUŽLJIVO z obvodom spletnega računa)\"\r\nt MSG_347 \"Strokovni način\"\r\nt MSG_348 \"Ekstrahiranje arhivskih datotek: %s\"\r\nt MSG_349 \"Uporabite Rufus MBR\"\r\nt MSG_900 \"Rufus je program za formatiranje in ustvarjanje zagonskih naprav USB.\"\r\nt MSG_901 \"Uradna stran: %s\"\r\nt MSG_902 \"Šifra vira: %s\"\r\nt MSG_903 \"Spremenitve: %s\"\r\nt MSG_904 \"Ta aplikacija je licencirana pod pogoji GNU Javne licence (GPL) različice 3.\\nOglejte si https://www.gnu.org/licenses/gpl-3.0.html podrobnosti.\"\r\nt MSG_905 \"Zagon\"\r\nt MSG_910 \"Formatiranje USB, bliskavice in virtualnih pogonov na FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Ustvarite FreeDOS zagonske USB pogone\"\r\nt MSG_912 \"Ustvarite zagonske pogone iz zagonskih ISO-jev (Windows, Linux itd.)\"\r\nt MSG_913 \"Ustvarite zagonske pogone iz slik diska, ki jih je mogoče zagnati, vključno s stisnjenimi\"\r\nt MSG_914 \"Ustvarite zagonske pogone BIOS ali UEFI, vključno z UEFI bootable NTFS\"\r\nt MSG_915 \"Ustvarjanje pogonov »Windows To Go'\"\r\nt MSG_916 \"Ustvarjanje namestitvenih pogonov za Windows 11 za računalnike, ki nimate TPM ali Varnega zagona\"\r\nt MSG_917 \"Ustvarjanje trajnih Linux particij\"\r\nt MSG_918 \"Ustvarjanje VHD/DD slik izbranega pogona\"\r\nt MSG_919 \"Račun MD5, SHA-1, SHA-256 in SHA-512 kontrolni vsoti izbrane slike\"\r\nt MSG_920 \"Izvajanje preverjanj slabih blokov, vključno z odkrivanjem »lažnih« bliskavic\"\r\nt MSG_921 \"Prenos uradnih Microsoft Windows maloprodaja ISOs\"\r\nt MSG_922 \"Prenos UEFI Shell ISOs\"\r\n\r\n#########################################################################\r\nl \"es-ES\" \"Spanish (Español)\" 0x040a, 0x080a, 0x0c0a, 0x100a, 0x140a, 0x180a, 0x1c0a, 0x200a, 0x240a, 0x280a, 0x2c0a, 0x300a, 0x340a, 0x380a, 0x3c0a, 0x400a, 0x440a, 0x480a, 0x4c0a, 0x500a, 0x540a, 0x580a\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Acerca de Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licencia\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Propiedades de la unidad\"\r\nt IDS_DEVICE_TXT \"Dispositivo\"\r\nt IDS_BOOT_SELECTION_TXT \"Elección de arranque\"\r\nt IDC_SELECT \"Seleccionar\"\r\nt IDS_IMAGE_OPTION_TXT \"Opciones de imagen\"\r\nt IDS_PARTITION_TYPE_TXT \"Esquema de partición\"\r\nt IDS_TARGET_SYSTEM_TXT \"Sistema de destino\"\r\nt IDC_LIST_USB_HDD \"Listar los discos duros USB\"\r\nt IDC_OLD_BIOS_FIXES \"Agrega correcciones para BIOS viejos (partición extra, alineación, etc.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Habilitar la validación de medios UEFI en tiempo de ejecución\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Opciones de formateo\"\r\nt IDS_FILE_SYSTEM_TXT \"Sistema de archivos\"\r\nt IDS_CLUSTER_SIZE_TXT \"Tamaño del clúster\"\r\nt IDS_LABEL_TXT \"Etiqueta de volumen\"\r\nt IDC_QUICK_FORMAT \"Formateo rápido\"\r\nt IDC_BAD_BLOCKS \"Buscar bloques dañados en dispositivo\"\r\nt IDC_EXTENDED_LABEL \"Añadir etiquetas extendidas e iconos\"\r\nt IDS_STATUS_TXT \"Estado\"\r\nt IDCANCEL \"Cerrar\"\r\nt IDC_START \"Empezar\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Cerrar\"\r\nt IDD_LICENSE \"Licencia de Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Cerrar\"\r\nt IDD_LOG \"Historial de eventos\"\r\nt IDC_LOG_CLEAR \"Borrar\"\r\nt IDC_LOG_SAVE \"Guardar\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Cerrar\"\r\nt IDD_NEW_VERSION \"Buscar actualizaciones de Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Hay una nueva versión disponible. ¡Por favor, descargue la última versión!\"\r\nt IDC_WEBSITE \"Haga clic aquí para ir al sitio web de Rufus\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Notas relativas a esta versión\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Descarga\"\r\nt IDC_DOWNLOAD \"Descarga\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Más información\"\r\nt IDYES \"Sí\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Cerrar\"\r\nt IDD_UPDATE_POLICY \"Actualizar la política y configuración\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Configuraciones\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Buscar actualizaciones\"\r\nt IDS_INCLUDE_BETAS_TXT \"Incluir versiones beta\"\r\nt IDC_CHECK_NOW \"Buscar ahora\"\r\n\r\nt MSG_001 \"Se detectó otra instancia\"\r\nt MSG_002 \"Ya existe una instancia de Rufus ejecutándose.\\nCierre la primera instancia antes de ejecutar otra.\"\r\nt MSG_003 \"ADVERTENCIA: TODOS LOS DATOS EN LA UNIDAD %s SERÁN ELIMINADOS.\\nPara continuar, haga clic en OK. Para detener la operación, haga clic en CANCELAR.\"\r\nt MSG_004 \"Política de actualización de Rufus\"\r\nt MSG_005 \"¿Quieres permitir que Rufus busque actualizaciones en línea?\"\r\nt MSG_006 \"Cerrar\"\r\nt MSG_007 \"Cancelar\"\r\nt MSG_008 \"Sí\"\r\nt MSG_010 \"Se encontraron bloques defectuosos\"\r\nt MSG_011 \"Verificación completa: se encontraron %d bloques dañados\\n  %d errores de lectura\\n  %d errores de escritura\\n  %d errores de corrupción\"\r\nt MSG_012 \"%s\\nEl informe detallado se puede encontrar en:\\n%s\"\r\nt MSG_013 \"Deshabilitado\"\r\nt MSG_014 \"Diario\"\r\nt MSG_015 \"Semanalmente\"\r\nt MSG_016 \"Mensualmente\"\r\nt MSG_017 \"Personalizado\"\r\nt MSG_018 \"Su versión: %d.%d (Build %d)\"\r\nt MSG_019 \"Última versión: %d.%d (Build %d)\"\r\nt MSG_029 \"Por defecto\"\r\nt MSG_030 \"%s (Por defecto)\"\r\nt MSG_031 \"BIOS (o UEFI-CSM)\"\r\nt MSG_032 \"UEFI (no CSM)\"\r\nt MSG_033 \"BIOS o UEFI\"\r\nt MSG_034 \"%d pasada\"\r\nt MSG_035 \"%d pasadas %s\"\r\nt MSG_036 \"Imagen ISO\"\r\nt MSG_037 \"Aplicación\"\r\nt MSG_038 \"Abortar\"\r\nt MSG_039 \"Lanzar\"\r\nt MSG_040 \"Descarga\"\r\nt MSG_041 \"Operación cancelada por el usuario\"\r\nt MSG_044 \"Descarga de archivo\"\r\nt MSG_045 \"Dispositivo de almacenamiento USB (Genérico)\"\r\nt MSG_046 \"%s (Disco %d) [%s]\"\r\nt MSG_047 \"Particiones múltiples\"\r\nt MSG_048 \"Rufus - Purgando los buffers\"\r\nt MSG_049 \"Rufus - Cancelación\"\r\nt MSG_050 \"Éxito.\"\r\nt MSG_051 \"Error indeterminado durante el formateo.\"\r\nt MSG_052 \"No se puede usar el sistema de archivos seleccionado para este dispositivo.\"\r\nt MSG_053 \"No se permite el acceso al dispositivo.\"\r\nt MSG_054 \"El dispositivo está protegido contra escritura.\"\r\nt MSG_055 \"El dispositivo está en uso por otra aplicación. Cierre todas las aplicaciones que puedan estar usando el dispositivo.\"\r\nt MSG_056 \"El formateo rápido no está disponible para este dispositivo.\"\r\nt MSG_057 \"La etiqueta de volumen no es válida.\"\r\nt MSG_058 \"El gestor de dispositivo no es válido.\"\r\nt MSG_059 \"El tamaño de clúster indicado no es válido para este dispositivo.\"\r\nt MSG_060 \"El tamaño del volúmen no es válido.\"\r\nt MSG_061 \"Inserte un dispositivo en la unidad.\"\r\nt MSG_062 \"Se ha recibido un comando no compatible.\"\r\nt MSG_063 \"Error en la asignación de memoria.\"\r\nt MSG_064 \"Error de lectura.\"\r\nt MSG_065 \"Error de escritura.\"\r\nt MSG_066 \"Fallo en la instalación\"\r\nt MSG_067 \"Imposible abrir el medio - otro proceso lo está usando. Desconecte y vuelva a conectar la unidad, luego inténtelo nuevamente.\"\r\nt MSG_068 \"No se pudo particionar la unidad.\"\r\nt MSG_069 \"No se pudieron copiar los archivos al dispositivo destino.\"\r\nt MSG_070 \"Cancelado por el usuario.\"\r\nt MSG_071 \"No se pudo crear el hilo.\"\r\nt MSG_072 \"La verificación de bloques defectuosos ha sido interrumpida.\"\r\nt MSG_073 \"Falló el análisis de la imagen ISO.\"\r\nt MSG_074 \"Falló la extracción de la imagen ISO.\"\r\nt MSG_075 \"No se pudo volver a montar el volumen.\"\r\nt MSG_076 \"Imposible parchear/configurar ficheros de arranque.\"\r\nt MSG_077 \"No se pudo asignar una letra de unidad.\"\r\nt MSG_078 \"No se pudo montar el volumen GUID.\"\r\nt MSG_079 \"El dispositivo no está listo.\"\r\nt MSG_080 \"Rufus detectó que Windows aún está purgando sus buffers internos en el dispositivo USB.\\n\\nDependiendo de la velocidad de su dispositivo USB, esta operación puede tomar mucho tiempo en finalizar, especialmente en archivos grandes.\\n\\nRecomendamos que deje a Windows terminar para que no se corrompa la integridad del USB; Pero si se cansa de esperar, puede simplemente desconectar el dispositivo...\"\r\nt MSG_081 \"Tipo de imagen no soportada\"\r\nt MSG_082 \"Esta imagen ISO, o no es autoarrancable, o usa un método de arranque o compresión que no es soportado por Rufus...\"\r\nt MSG_083 \"¿Reemplazar %s?\"\r\nt MSG_084 \"Esta imagen ISO parece que usa una versión obsoleta del archivo '%s'.\\nEsto puede hacer que los menús de arranque no se muestren correctamente.\\n\\nRufus puede descargar una versión más reciente para resolver este problema:\\n- Seleccione 'Sí' para conectarse al Internet y descargar el archivo\\n- Seleccione 'No' para dejar el archivo ISO tal como está\\nSi no sabe qué hacer, se recomienda seleccionar 'Sí'.\\n\\nNota: El nuevo archivo se descargará en el directorio actual, en el momento que un archivo\\n '%s' exista ahí, será usado automáticamente.\"\r\nt MSG_085 \"Descargando %s\"\r\nt MSG_086 \"No hay imagen ISO seleccionada\"\r\nt MSG_087 \"para NAND %s\"\r\nt MSG_088 \"Imagen ISO demasiado grande\"\r\nt MSG_089 \"La imagen ISO es demasiado grande para el destino seleccionado.\"\r\nt MSG_090 \"ISO no soportado\"\r\nt MSG_091 \"Cuando se usa UEFI como tipo de destino, sólo se soportan imágenes ISO de ejecución automática tipo EFI. Seleccione una imagen de ejecución automática ISO de tipo EFI o cambie el tipo de destino a BIOS.\"\r\nt MSG_092 \"Sistema de archivos no soportado\"\r\nt MSG_093 \"¡¡¡IMPORTANTE: ESTE DISCO CONTIENE MÚLTIPLES PARTICIONES!!!\\n\\nEsto puede incluir particiones/volúmenes no mostrados o incluso visibles por Windows. Si desea continuar con el proceso, se hace responsable de cualquier pérdida de datos en esas particiones.\"\r\nt MSG_094 \"Detectadas múltiples particiones\"\r\nt MSG_095 \"Imagen DD\"\r\nt MSG_096 \"El sistema de ficheros seleccionado no puede usarse con este tipo de imagen ISO Por favor, seleccione un sistema de ficheros distinto o use otra ISO.\"\r\nt MSG_097 \"'%s' sólo puede aplicarse si el sistema de ficheros es NTFS.\"\r\nt MSG_098 \"IMPORTANTE: Está intentando instalar 'Windows To Go', pero la unidad destino no tiene el atributo 'FIXED' (fijo). Debido a esto es muy probable que Windows se detenga en el arranque ya que Microsoft no lo ha diseñado para funcionar con unidades que tengan el atributo 'REMOVABLE' (extraible) \\n\\n¿Desea continuar con el proceso?\\n\\nNota: El atributo 'FIXED/REMOVABLE' es una propiedad hardware que sólo se puede cambiarusando herramientas del fabricante. Sin embargo estas herramientas CASI NUNCA se facilitan al público...\"\r\nt MSG_099 \"Limitación del sistema de archivos\"\r\nt MSG_100 \"Esta imagen ISO contiene un archivo de más de 4 GB, sobrepasando el tamaño máximo permitido para un sistema de archivos FAT o FAT32.\"\r\nt MSG_101 \"El soporte para archivos WIM no está disponible\"\r\nt MSG_102 \"Su plataforma no puede extraer archivos de ficheros comprimidos WIM. La extracción de ficheros desde archivos WIM es necesaria para crear dispositivos USB arrancables tipo EFI con Windows 7 y Windows Vista.Puede solucionar esto instalando una versión reciente de 7-Zip.\\n¿Desea visitar la página de descargas de 7-zip?\"\r\nt MSG_103 \"¿Descargar %s?\"\r\nt MSG_104 \"%s o posterior requiere que esté instalado un archivo '%s'.\\nDado que este archivo pesa más de 100 KB y siempre está presente en las \\nimágenes ISO %s, Rufus no lo incluye en su distribución.\\n\\nRufus puede descargar el archivo que falta:\\n- Seleccione 'Sí' para conectarse a Internet y descargar el archivo\\n- Seleccione 'No' si desea copiar manualmente este archivo en la unidad después\\n\\nNota: El archivo será descargado en la carpeta actual y en el momento que exista el \\n archivo '%s' ahí, volverá a usarse automáticamente.\"\r\nt MSG_105 \"Cancelar ahora puede dejar el dispositivo en un estado INUTILIZABLE.\\nSi está seguro de cancelar, seleccione SÍ. De lo contrario, seleccione NO.\"\r\nt MSG_106 \"Seleccione una carpeta\"\r\nt MSG_107 \"Todos los archivos\"\r\nt MSG_108 \"Registro de eventos de Rufus\"\r\nt MSG_109 \"0x%02X (Disco %d)\"\r\nt MSG_110 \"MS-DOS no puede arrancar desde un disco con un tamaño de clúster de 64 kilobytes.\\nPor favor cambie el tamaño del clúster o use FreeDOS.\"\r\nt MSG_111 \"Tamaño de clúster incompatible\"\r\nt MSG_112 \"Dar formato a un volumen UDF de gran tamaño puede tomar mucho tiempo. A la velocidad de USB 2.0, el tiempo estimado de formateo es %d:%02d, durante el cual la barra de progreso parecerá no moverse. ¡Por favor, sea paciente!\"\r\nt MSG_113 \"Volumen UDF de gran tamaño\"\r\nt MSG_114 \"Esta imagen usa Syslinux %s%s pero este programa sólo incluye los ficheros de instalación para Syslinux %s%s.\\n\\nDebido a que las nuevas versiones de Syslinux no son compatibles entre si, y no es posible para Rufus incluirlas todas, se deben descargar dos ficheros adicionales de internet ('ldlinux.sys' y 'ldlinux.bss'):\\n- Elije 'Si' para conectarse a internet y descargar estos ficheros\\n- Elije 'No' para cancelar la operación\\n\\nNota: Los ficheros se descargarán en la carpeta actual y volverán a usarse automáticamente si se encuentran.\"\r\nt MSG_115 \"Descarga requerida\"\r\nt MSG_116 \"Esta imagen hace uso de Grub %s pero este programa sólo incluye los ficheros de instalación para Grub %s.\\n\\nDebido a que las diferentes versiones de Grub no son compatibles entre sí, y no es posible incluir todas, Rufus intentará encontrar una versión del fichero de instalación de Grub 'core.img' que se adecue con el de su imagen ISO:\\n- Elija 'Si' para conectarse a internet e intentar descargarlo\\n- Elija 'No' para usar la versión por defecto de Rufus\\n- Elija 'Cancelar' para cancelar la operación\\n\\nNota: El fichero será descargado en la carpeta de ejecución del programa y volverá a usarse automáticamente si se encuentra.Si no se puede encontrar el fichero en línea se usará la versión por defecto.\"\r\nt MSG_117 \"Instalación de Windows estandar\"\r\nt MSG_119 \"propiedades avanzadas de la unidad\"\r\nt MSG_120 \"opciones avanzadas de formato\"\r\nt MSG_121 \"Mostrar %s\"\r\nt MSG_122 \"Ocultar %s\"\r\nt MSG_123 \"Tamaño de partición persistente\"\r\nt MSG_124 \"No persistente\"\r\nt MSG_125 \"Establece el tamaño de la partición persistente para el medio USB autoarrancable. Estableciendo un valor 0 deshabilita la partición persistente.\"\r\nt MSG_126 \"Establece la unidad de tamaño de partición.\"\r\nt MSG_127 \"No volver a mostrar este mensaje\"\r\nt MSG_128 \"Aviso importante respecto %s\"\r\nt MSG_129 \"Has creado un sistema que usa un bootloader UEFI:NTFS. Por favor, recuerda que para arrancar con este dispositivo, SECURE BOOT DEBE ESTAR DESACTIVADO.\\nPara más detalles respecto a porqué es necesario, use el siguiente botón \\\"Más información\\\".\"\r\nt MSG_130 \"Selección de imagen de Windows\"\r\nt MSG_131 \"Esta ISO contiene múltiples imágenes de Windows.\\nPor favor, seleccione la imagen que desea usar para esta instalación:\"\r\nt MSG_132 \"Otro programa o proceso está accediendo a esta unidad. ¿Deseas formatearlo de todas formas?\"\r\nt MSG_133 \"Rufus ha detectado que estás intentando crear un medio en Windows To Go basado en la ISO 1809.\\n\\nDebido a un *FALLO DE MICROSOFT*, este medio no arrancará al iniciar Windows (Pantallazo Azul de la Muerte), a no ser que manualmente reemplaces el fichero 'WppRecorder.sys' con la versión 1803.\\n\\nTen en cuenta que el motivo por el que Rufus no puede arreglar esto automáticamente es debido a que el fichero 'WppRecorder.sys' es un fichero con copyright, por lo que legalmente no podemos añadir una copia del fichero en la aplicación...\"\r\nt MSG_134 \"Debido a que has seleccionado MBR para el sistema de particiones, Rufus sólo puede crear una partición de hasta 2TB en este dispositivo, lo que dejará %s del disco no disponibles.\\n\\n¿Estas seguro de que deseas continuar?\"\r\nt MSG_135 \"Versión\"\r\nt MSG_136 \"Emisión\"\r\nt MSG_137 \"Edición\"\r\nt MSG_138 \"Idioma\"\r\nt MSG_139 \"Arquitectura\"\r\nt MSG_140 \"Continuar\"\r\nt MSG_141 \"Atrás\"\r\nt MSG_142 \"Espere por favor...\"\r\nt MSG_143 \"Descargar usando un navegador\"\r\nt MSG_144 \"La descarga de ISO de Windows no está disponible debido a que Microsoft modificó su sitio web para evitarlo.\"\r\nt MSG_145 \"Se requiere PowerShell 3.0 o posterior para ejecutar este script.\"\r\nt MSG_146 \"¿Desea descargar la versión on-line?\"\r\nt MSG_148 \"Ejecutando script descargado...\"\r\nt MSG_149 \"Descargar Imagen ISO\"\r\nt MSG_150 \"El tipo de sistema donde desea usar este dispositivo autoarrancable. Es su responsabilidad determinar si el equipo es BIOS o UEFI antes de empezar la creación del dispositivo, si no es la correcta posiblemente no funcione.\"\r\nt MSG_151 \"'UEFI-CSM' significa que el dispositivo sólo arrancará en modo UEFI con emulación de BIOS (también conocido como 'Legacy Mode'), y no en modo UEFI nativo.\"\r\nt MSG_152 \"'no CSM' significa que el dispositivo sólo arrancará en modo UEFI nativo, y no en modo emulación de BIOS (también conocido como 'Legacy Mode').\"\r\nt MSG_153 \"Patrón de pruebas: 0x%02X\"\r\nt MSG_154 \"Patrón de pruebas: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Patrón de pruebas: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Patrón de pruebas: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Seleccione el sistema de archivos destino\"\r\nt MSG_158 \"Tamaño mínimo que un bloque de datos ocupará en el sistema de archivos\"\r\nt MSG_159 \"Use este campo para establecer el nombre del volumen.\\nSe aceptan caracteres internacionales.\"\r\nt MSG_160 \"Mostrar opciones avanzadas\"\r\nt MSG_161 \"Revisa el dispositivo buscando bloques defectuosos aplicando un patrón de pruebas\"\r\nt MSG_162 \"Desmarque esta opción para usar el método \\\"lento\\\" de formateo\"\r\nt MSG_163 \"Método a usar para crear particiones\"\r\nt MSG_164 \"Método a usar para hacer que la unidad sea de ejecución automática\"\r\nt MSG_165 \"Haga clic para seleccionar una imagen ISO...\"\r\nt MSG_166 \"Seleccione esta opción para permitir que se muestren caracteres internacionales y establecer un icono para la unidad (crea un archivo autorun.inf)\"\r\nt MSG_167 \"Instale un gestor de arranque UEFI, que realizará la validación del archivo MD5Sum del medio\"\r\nt MSG_169 \"Crea una partición oculta extra y trata de alinear los límites de las particiones.\\n Esto puede mejorar la detección de dispositivos de arranque en las BIOS antiguas.\"\r\nt MSG_170 \"Activa la detección de discos duros externos USB. ¡¡¡ÚSESE BAJO SU PROPIO RIESGO!!!\"\r\nt MSG_171 \"Comienza la operación de formateo.\\n¡Todos los datos en el dispositivo elegido serán DESTRUIDOS!\"\r\nt MSG_172 \"Firma de descarga inválida\"\r\nt MSG_173 \"Haga clic para seleccionar...\"\r\nt MSG_174 \"Rufus, la herramienta de formateo de USBs en la que puedes confiar\"\r\nt MSG_175 \"Versión %d.%d (Build %d)\"\r\nt MSG_176 \"Traducción al español:\\\\line• José Pineda <mailto:battletroll@gmail.com>\\\\line• MaKK <mailto:jordikab@gmail.com>\\\\line• Marco A. Ramirez Madrid <mailto:rastrillin@hotmail.com>\"\r\nt MSG_177 \"Para indicar fallos o sugerir mejoras, acceda a:\"\r\nt MSG_178 \"Derechos de autor adicionales:\"\r\nt MSG_179 \"Política de actualización:\"\r\nt MSG_180 \"Si usted autoriza que este programa busque e instale actualizaciones por sí mismo acepta que la siguiente información pueda ser recogida en nuestros servidores:\"\r\nt MSG_181 \"Arquitectura y versión de su sistema operativo\"\r\nt MSG_182 \"La versión de la aplicación que posee\"\r\nt MSG_183 \"Su dirección IP\"\r\nt MSG_184 \"A fin de generar estadísticas de uso privadas, la información recogida puede ser retenida \\\\b como mucho hasta un año\\\\b0 . A menos que así sea requerido por la ley, no transmitiremos nada de esta información a terceros.\"\r\nt MSG_185 \"Proceso de actualización:\"\r\nt MSG_186 \"Rufus no instala ni ejecuta ningún servicio ni tarea programada. Por tanto la búsqueda de actualizaciones sólo se realiza cuando la aplicación principal se está ejecutando.\\\\line\\nSe requiere acceso a Internet.\"\r\nt MSG_187 \"Imagen ISO no válida para la opción de arranque seleccionada\"\r\nt MSG_188 \"La imagen actual no coincide con la opción de arranque elegida. Por favor use otra imagen o seleccione una opción de arranque distinta.\"\r\nt MSG_189 \"Esta imagen ISO no es compatible con el sistema de archivos seleccionado\"\r\nt MSG_190 \"Dispositivo incompatible detectado\"\r\nt MSG_191 \"Barrido de escritura\"\r\nt MSG_192 \"Barrido de lectura\"\r\nt MSG_193 \"Descargado %s\"\r\nt MSG_194 \"No se ha podido descargar %s\"\r\nt MSG_195 \"Usando la versión integrada de/los fichero/s %s\"\r\nt MSG_196 \"¡IMPORTANTE: ESTE DISPOSITIVO USA UN TAMAÑO DE SECTOR NO ESTÁNDARD!\\n\\nLos dispositivos convencionales usan un tamaño de sector de 512 bytes, pero esta unidad usa un tamaño de %d bytes.En muchos casos esto significa que NO podrás arrancar desde este dispositivo. \\nRufus puede intentar crear un dispositivo arrancable, pero NO SE GARANTIZA que funcione.\"\r\nt MSG_197 \"Detectado tamaño de sector no estándar\"\r\nt MSG_198 \"'Windows To Go' sólo puede ser instalado en una partición GPT si tiene el atributo FIXED activo. El dispositivoactual no ha sido detectado como FIXED.\"\r\nt MSG_199 \"Esta función no está disponible en esta plataforma.\"\r\nt MSG_201 \"Cancelando - por favor espere...\"\r\nt MSG_202 \"Analizando la imagen...\"\r\nt MSG_203 \"Fallo al analizar la imagen\"\r\nt MSG_204 \"El archivo %s está obsoleto\"\r\nt MSG_205 \"Usando la imagen ISO: %s\"\r\nt MSG_206 \"Falta el archivo %s\"\r\nt MSG_207 \"Etiqueta del volumen\"\r\nt MSG_208 \"%d dispositivo encontrado\"\r\nt MSG_209 \"%d dispositivos encontrados\"\r\nt MSG_210 \"PREPARADO\"\r\nt MSG_211 \"CANCELADO\"\r\nt MSG_212 \"FALLO al realizar la operación\"\r\nt MSG_213 \"Lanzando la nueva aplicación...\"\r\nt MSG_214 \"Error al lanzar la nueva aplicación\"\r\nt MSG_215 \"%s abierto\"\r\nt MSG_216 \"%s guardado\"\r\nt MSG_217 \"Formateando: %s\"\r\nt MSG_218 \"Creando sistema de archivos: Tarea %d/%d completa\"\r\nt MSG_219 \"Arreglo en NTFS: %d%% completo\"\r\nt MSG_220 \"Formateando (%s) - duración estimada %d:%02d...\"\r\nt MSG_221 \"Escribiendo la etiqueta del volumen (%s)...\"\r\nt MSG_222 \"Formateando (%s)...\"\r\nt MSG_223 \"Arreglos en NTFS (Checkdisk)...\"\r\nt MSG_224 \"Limpiando las estructuras MBR/PBR/GPT...\"\r\nt MSG_225 \"Solicitando acceso al disco...\"\r\nt MSG_226 \"Analizando las estructuras de arranque existentes...\"\r\nt MSG_227 \"Cerrando el volumen existente...\"\r\nt MSG_228 \"Escribiendo el registro maestro de arranque (Master Boot Record)...\"\r\nt MSG_229 \"Escribiendo el registro de arranque de la partición (Partition Boot Record)...\"\r\nt MSG_230 \"Copiando archivos DOS...\"\r\nt MSG_231 \"Copiando archivos ISO: %s\"\r\nt MSG_232 \"Configuración de arranque Win7 EFI (%s)...\"\r\nt MSG_233 \"Finalizando, por favor espere...\"\r\nt MSG_234 \"Instalando Syslinux %s...\"\r\nt MSG_235 \"Bloques dañados: %s %d/%d - %0.2f%% (%d/%d/%d errores)\"\r\nt MSG_236 \"Bloques dañados: Probando con patron aleatorio\"\r\nt MSG_237 \"Bloques dañados: Probando con el patrón 0x%02X\"\r\nt MSG_238 \"Particionando (%s)...\"\r\nt MSG_239 \"Borrando particiones (%s)...\"\r\nt MSG_240 \"La firma de la actualización descargada no puede ser validada. Esto puede significar que tu sistema está configurado inapropiadamente para la validación de firmas o indicar una descarga maliciosa.\\n\\nLa descargas será borrada. Revise el registro para más detalles.\"\r\nt MSG_241 \"Descargando: %s\"\r\nt MSG_242 \"Error al descargar el archivo.\"\r\nt MSG_243 \"Buscando actualizaciones de Rufus...\"\r\nt MSG_244 \"Actualizaciones: No es posible conectarse a Internet\"\r\nt MSG_245 \"Actualizaciones: No es posible acceder a la información de posibles actualizaciones\"\r\nt MSG_246 \"¡Hay una nueva versión de Rufus disponible!\"\r\nt MSG_247 \"No hay nuevas versiones de Rufus\"\r\nt MSG_248 \"Claves de la aplicación eliminadas del registro con éxito\"\r\nt MSG_249 \"No se han podido eliminar las claves de la aplicación del registro\"\r\nt MSG_250 \"%s activado\"\r\nt MSG_251 \"%s desactivado\"\r\nt MSG_252 \"Verificación de tamaño\"\r\nt MSG_253 \"Detección de discos duros\"\r\nt MSG_254 \"Forzar formateo FAT32 largo\"\r\nt MSG_255 \"Se eliminará NoDriveTypeAutorun al salir\"\r\nt MSG_256 \"Simulación de la detección del dispositivo\"\r\nt MSG_257 \"Soporte a Joliet\"\r\nt MSG_258 \"Soporte a Rock Ridge\"\r\nt MSG_259 \"Forzar actualización\"\r\nt MSG_260 \"Compresión NTFS\"\r\nt MSG_261 \"Escribiendo imagen: %s\"\r\nt MSG_262 \"Soporte ISO\"\r\nt MSG_263 \"Usar tamaños de unidad ADECUADOS\"\r\nt MSG_264 \"Eliminando directorio '%s'\"\r\nt MSG_265 \"Detección de discos VMWare\"\r\nt MSG_266 \"Modo dual EFI/BIOS\"\r\nt MSG_267 \"Aplicando imagen Windows: %s\"\r\nt MSG_268 \"Aplicando imagen Windows...\"\r\nt MSG_269 \"Mantener la información de tiempo\"\r\nt MSG_270 \"Depuración USB\"\r\nt MSG_271 \"Calculando checksums de la imagen: %s\"\r\nt MSG_272 \"Calcular los checksums MD5, SHA1 y SHA256 para la imagen seleccionada\"\r\nt MSG_273 \"Cambiar idioma\"\r\nt MSG_274 \"Imagen %s detectada\"\r\nt MSG_275 \"La imagen que ha seleccionado es una imagen de tipo 'ISOHybrid', esto significa que puede ser escrita tanto en modo %s (copia de fichero) o modo %s (imagen de disco).\\nRufus recomienda usar el modo %s , así siempre podrás tener acceso completo a la unidad tras escribir en ella.\\nSin embargo, si encuentra problemas durante el arranque, puede intentar escribir de nuevo esta imagen en modo %s.\\n\\nPor favor, selecciona el modo en el que quiere escribir esta imagen:\"\r\nt MSG_276 \"Escribir en modo %s (Recomendado)\"\r\nt MSG_277 \"Escribir en modo %s\"\r\nt MSG_278 \"Comprobando si hay procesos en conflicto...\"\r\nt MSG_279 \"No auto-ejecutable\"\r\nt MSG_280 \"Disco o imagen ISO\"\r\nt MSG_281 \"%s (Elija por favor)\"\r\nt MSG_282 \"Dispositivo USB bloqueado de forma exclusiva\"\r\nt MSG_283 \"Firma no válida\"\r\nt MSG_284 \"El ejecutable descargado carece de firma digital.\"\r\nt MSG_285 \"El ejecutable descargado está firmado por '%s'.\\nNo reconocemos este tipo de firma y podría indicar alguna forma de actividad maliciosa...\\n¿Está seguro que desea ejecutar este fichero?\"\r\nt MSG_286 \"Borrando a ceros la unidad: %s\"\r\nt MSG_287 \"Detección de unidades extraibles no USB\"\r\nt MSG_288 \"Falta elevación de permisos\"\r\nt MSG_289 \"Esta aplicación sólo puede funcionar con elevación de permisos\"\r\nt MSG_290 \"Indexando fichero\"\r\nt MSG_291 \"Selección de versión\"\r\nt MSG_292 \"Por favor seleccione la versión de Windows que desea instalar:\"\r\nt MSG_293 \"Versión de Windows no soportada\"\r\nt MSG_294 \"Esta versión de Windows ya no es compatible con Rufus.\\nLa última versión de Rufus compatible con esta plataforma es v%d.%d.\"\r\nt MSG_295 \"Atención: Versión no oficial\"\r\nt MSG_296 \"Esta versión de Rufus NO ha sido generada por su(s) desarrollador(es) oficial(es).\\n\\n¿Está seguro de que desea ejecutarlo?\"\r\nt MSG_297 \"Se ha detectado una ISO truncada\"\r\nt MSG_298 \"El fichero ISO seleccionado no tiene su tamaño declarado: ¡Falta un %s de los datos!\\n\\nSi has obtenido este fichero de Internet, deberías intentar una nueva descarga y verificar que los checksum MD5 y SHA coinciden con los originales.\\n\\nPuedes calcular los valores MD5 o SHA con Rufus, desde el botón (✓).\"\r\nt MSG_299 \"Error al validar la marca de hora\"\r\nt MSG_300 \"Rufus no ha podido verificar si la marca de tiempo de la actualización descargada es más reciente queel ejecutable actual.\\n\\nCon objeto de prevenir una situación potencial de ataque, el proceso de actualizaciónse ha abortado y la descarga será eliminada. Por favor revise el registro para más detalles.\"\r\nt MSG_301 \"Mostrar parámetros de la aplicación\"\r\nt MSG_302 \"Mostrar información de la aplicación\"\r\nt MSG_303 \"Mostrar el registro\"\r\nt MSG_304 \"Crear una imagen de disco del dispositivo seleccionado\"\r\nt MSG_305 \"Use esta opción para indicar si desea usar este dispositivo para instalar Windows en otro disco, o si quiere ejecutar Windows directamente desde esta unidad (Windows To Go).\"\r\nt MSG_306 \"Borrando a ceros la unidad de forma rápida: %s\"\r\nt MSG_307 \"esto puede tardar un rato\"\r\nt MSG_308 \"Detección VHD\"\r\nt MSG_309 \"Archivo comprimido\"\r\nt MSG_310 \"La ISO seleccionada usa UEFI y es lo suficientemente pequeña para ser escrita como un sistema de partición EFI (ESP). Escribiendo como ESP en lugar de como una partición de datos genérica (ocupando todo el disco), puede ser preferible para algunos tipos de instalación.\\n\\nPor favor, seleccione el modo que quiere usar para escribir esta imagen:\"\r\nt MSG_311 \"Utilice %s (en la ventana principal de la aplicación) para habilitar.\"\r\nt MSG_312 \"Extractos (hashes) adicionales (SHA512)\"\r\nt MSG_313 \"Guardar como VHD\"\r\nt MSG_314 \"Procesar suma de verificación (checksum) de imagen\"\r\nt MSG_315 \"Botones múltiples\"\r\nt MSG_316 \"Número de pasadas\"\r\nt MSG_317 \"ID de disco\"\r\nt MSG_318 \"Prioridad de hilo (thread) por defecto: %d\"\r\nt MSG_319 \"Ignorar marca de arranque (Boot Marker)\"\r\nt MSG_320 \"Actualizando disposición de partición (%s)...\"\r\nt MSG_321 \"La imagen seleccionada es ISOHybrid, pero sus creadores no la han creado compatible con el modo de copia ISO/FILE.\\nPor consiguiente, se forzará el modo de escritura de imágenes DD.\"\r\nt MSG_322 \"No se puede abrir o leer '%s'\"\r\nt MSG_325 \"Aplicando personalización de Windows: %s\"\r\nt MSG_326 \"Aplicando opciones de usuario...\"\r\nt MSG_327 \"Experiencia de usuario de Windows\"\r\nt MSG_328 \"¿Personalizar la instalación de Windows?\"\r\nt MSG_329 \"Eliminar el requisito de más de 4 GB de RAM, Arranque seguro y TPM 2.0\"\r\nt MSG_330 \"Eliminar el requisito de una cuenta de Microsoft en línea\"\r\nt MSG_331 \"Deshabilitar la recopilación de datos (Omitir preguntas de privacidad)\"\r\nt MSG_332 \"Impedir que Windows To Go acceda a los discos internos\"\r\nt MSG_333 \"Crear una cuenta local con nombre de usuario:\"\r\nt MSG_334 \"Establezca las opciones regionales en los mismos valores que las de este usuario\"\r\nt MSG_335 \"Deshabilitar el cifrado automático de dispositivos BitLocker\"\r\nt MSG_336 \"Registro persistente\"\r\nt MSG_337 \"Se debe descargar un archivo adicional ('%s') de Microsoft para usar esta función:\\n- Seleccione 'Sí' para conectarse a Internet y descargarlo\\n- Seleccione 'No' para cancelar la operación.\\n\\nNota: El archivo se descargará en el directorio de la aplicación y se reutilizará automáticamente si está presente.\"\r\nt MSG_338 \"Se detectó un gestor de arranque UEFI revocado\"\r\nt MSG_339 \"Rufus detectó que el ISO que seleccionó contiene un gestor de arranque UEFI que ha sido revocado y que producirá %s, cuando el arranque seguro esté habilitado en un sistema UEFI completamente actualizado.\\n\\n- Si obtuvo esta imagen ISO de una fuente no confiable, debe considerar la posibilidad de que contenga malware UEFI y evitar arrancar desde allí.\\n- Si lo obtuvo de una fuente confiable, debe intentar localizar una versión más actualizada, que no producirá esta advertencia.\"\r\nt MSG_340 \"una pantalla de \\\"violación de seguridad\\\"\"\r\nt MSG_341 \"una pantalla de recuperación de Windows (BSOD) con '%s'\"\r\nt MSG_342 \"Imagen VHDX comprimida\"\r\nt MSG_343 \"Imagen VHD sin comprimir\"\r\nt MSG_344 \"Imagen de actualización completa de Flash\"\r\nt MSG_345 \"Se deben descargar algunos datos adicionales de Microsoft para utilizar esta funcionalidad:\\n- Seleccione 'Sí' para conectarse a Internet y descargarlo\\n- Seleccione 'No' para cancelar la operación.\"\r\nt MSG_346 \"Restringir Windows al Modo S (INCOMPATIBLE con la omisión de cuenta en línea)\"\r\nt MSG_347 \"Modo experto\"\r\nt MSG_348 \"Extrayendo archivos comprimidos: %s\"\r\nt MSG_349 \"Utilice Rufus MBR\"\r\nt MSG_900 \"Rufus es una utilidad que le ayuda a formatear y crear dispositivos flash booteables, como «pendrives», tarjetas de memoria, etcétera.\"\r\nt MSG_901 \"Sitio oficial %s\"\r\nt MSG_902 \"Código fuente %s\"\r\nt MSG_903 \"Registro de cambios %s\"\r\nt MSG_904 \"Esta aplicación tiene licencia bajo los términos de la Licencia Pública GNU (GPL) versión 3.\\nConsulte https://www.gnu.org/licenses/gpl-3.0.html para obtener más información.\"\r\nt MSG_905 \"Arranque\"\r\nt MSG_910 \"Formatee USB, tarjetas flash y unidades virtuales a FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Crear unidades USB de arranque FreeDOS\"\r\nt MSG_912 \"Cree unidades de arranque desde ISO de arranque (Windows, Linux, etc.)\"\r\nt MSG_913 \"Cree unidades de arranque a partir de imágenes de disco de arranque, incluidas las comprimidas\"\r\nt MSG_914 \"Cree unidades de arranque BIOS o UEFI, incluido NTFS de arranque UEFI\"\r\nt MSG_915 \"Cree unidades 'Windows To Go'\"\r\nt MSG_916 \"Cree unidades de instalación de Windows 11 para PC que no tienen TPM o Arranque seguro\"\r\nt MSG_917 \"Crear particiones persistentes de Linux\"\r\nt MSG_918 \"Cree imágenes VHD/DD de la unidad seleccionada\"\r\nt MSG_919 \"Calcule las sumas de comprobación MD5, SHA-1, SHA-256 y SHA-512 de la imagen seleccionada\"\r\nt MSG_920 \"Realice comprobaciones de bloques defectuosos, incluida la detección de unidades flash \\\"falsas\\\"\"\r\nt MSG_921 \"Descargue los ISO oficiales de Microsoft Windows\"\r\nt MSG_922 \"Descargar ISO de UEFI Shell\"\r\n\r\n#########################################################################\r\nl \"sv-SE\" \"Swedish (Svenska)\" 0x041d, 0x081d\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Om Rufus\"\r\nt IDC_ABOUT_LICENSE \"Licens\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Enhetsegenskaper\"\r\nt IDS_DEVICE_TXT \"Enhet\"\r\nt IDS_BOOT_SELECTION_TXT \"Startval\"\r\nt IDC_SELECT \"Välj\"\r\nt IDS_IMAGE_OPTION_TXT \"Avbildsalternativ\"\r\nt IDS_PARTITION_TYPE_TXT \"Partitionsschema\"\r\nt IDS_TARGET_SYSTEM_TXT \"Målsystem\"\r\nt IDC_LIST_USB_HDD \"Lista USB-hårddiskar\"\r\nt IDC_OLD_BIOS_FIXES \"Lägg till korrigeringar för äldre BIOS:ar (extra partition, etc)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Aktivera runtime UEFI-mediavalidering\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Formatalternativ\"\r\nt IDS_FILE_SYSTEM_TXT \"Filsystem\"\r\nt IDS_CLUSTER_SIZE_TXT \"Klusterstorlek\"\r\nt IDS_LABEL_TXT \"Volymetikett\"\r\nt IDC_QUICK_FORMAT \"Snabbformatering\"\r\nt IDC_BAD_BLOCKS \"Kontrollera enheten efter trasiga block\"\r\nt IDC_EXTENDED_LABEL \"Skapa utökat namn och ikonfiler\"\r\nt IDCANCEL \"Stäng\"\r\nt IDC_START \"Starta\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Stäng\"\r\nt IDD_LICENSE \"Rufus licens\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Stäng\"\r\nt IDD_LOG \"Logg\"\r\nt IDC_LOG_CLEAR \"Rensa\"\r\nt IDC_LOG_SAVE \"Spara\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Stäng\"\r\nt IDD_NEW_VERSION \"Sök efter uppdateringar - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"En nyare version finns tillgänglig. Ladda gärna ner senaste versionen!\"\r\nt IDC_WEBSITE \"Tryck här för att komma till hemsidan\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Programinformation\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Nerladdning\"\r\nt IDC_DOWNLOAD \"Nerladdning\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Mer information\"\r\nt IDYES \"Ja\"\r\nt IDNO \"Nej\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Stäng\"\r\nt IDD_UPDATE_POLICY \"Uppdateringspolicy och inställningar\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Inställningar\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Sök efter uppdateringar\"\r\nt IDS_INCLUDE_BETAS_TXT \"Även beta-versioner\"\r\nt IDC_CHECK_NOW \"Uppdatera nu\"\r\n\r\nt MSG_001 \"Programmet körs redan\"\r\nt MSG_002 \"Rufus körs redan.\\nStäng det första programmet innan du startar ett nytt.\"\r\nt MSG_003 \"VARNING: ALL DATA PÅ ENHETEN '%s'\\nKOMMER ATT TAS BORT.\\nFör att fortsätta tryck OK. För att avbryta tryck AVBRYT.\"\r\nt MSG_004 \"Rufus uppdateringspolicy\"\r\nt MSG_005 \"Tillåter du att Rufus söker efter uppdateringar på nätet?\"\r\nt MSG_006 \"Stäng\"\r\nt MSG_007 \"Avbryt\"\r\nt MSG_008 \"Ja\"\r\nt MSG_009 \"Nej\"\r\nt MSG_010 \"Trasiga block funna\"\r\nt MSG_011 \"Kontroll klar: %d trasiga block funna\\n  %d läsfel\\n  %d skrivfel\\n  %d korruptionsfel\"\r\nt MSG_012 \"%s\\nEn mer detaljerad rapport hittar du i:\\n%s\"\r\nt MSG_013 \"Inaktiverad\"\r\nt MSG_014 \"Dagligen\"\r\nt MSG_015 \"Veckovis\"\r\nt MSG_016 \"Månadsvis\"\r\nt MSG_017 \"Egen\"\r\nt MSG_018 \"Din version: %d.%d (Build %d)\"\r\nt MSG_019 \"Senaste version: %d.%d (Build %d)\"\r\nt MSG_027 \"kilobyte\"\r\nt MSG_028 \"megabyte\"\r\nt MSG_029 \"Standard\"\r\nt MSG_030 \"%s (Standard)\"\r\nt MSG_031 \"BIOS (eller UEFI-CSM)\"\r\nt MSG_032 \"UEFI (icke CSM)\"\r\nt MSG_033 \"BIOS eller UEFI\"\r\nt MSG_034 \"%d gång\"\r\nt MSG_035 \"%d gånger %s\"\r\nt MSG_036 \"ISO-avbild\"\r\nt MSG_037 \"Program\"\r\nt MSG_038 \"Avbryt\"\r\nt MSG_039 \"Starta\"\r\nt MSG_040 \"Nerladdning\"\r\nt MSG_041 \"Operationen avbröts av användaren\"\r\nt MSG_042 \"Fel\"\r\nt MSG_043 \"Fel: %s\"\r\nt MSG_044 \"Filnerladdning\"\r\nt MSG_045 \"USB-lagringsenhet (Allmänt)\"\r\nt MSG_047 \"Flera partitioner\"\r\nt MSG_048 \"Rufus - Tömmer buffertar\"\r\nt MSG_049 \"Rufus - Avbryter\"\r\nt MSG_050 \"Lyckades.\"\r\nt MSG_051 \"Obestämd fel vid formatering.\"\r\nt MSG_052 \"Kan inte använda valt filsystem för detta media.\"\r\nt MSG_053 \"Åtkomst till enheten nekades.\"\r\nt MSG_054 \"Mediet är skrivskyddat.\"\r\nt MSG_055 \"Enheten används redan av en annan process. Stäng andra processer som kan tänkas använda enheten.\"\r\nt MSG_056 \"Enheten går inte att snabbformatera.\"\r\nt MSG_057 \"Volymens namn är ogiltigt.\"\r\nt MSG_058 \"Hantering av enheten är ogiltig.\"\r\nt MSG_059 \"Klusterstorlek är ogiltig för denna enheten.\"\r\nt MSG_060 \"Volymens storlek är ogiltig.\"\r\nt MSG_061 \"Sätt i ett flyttbart media i enheten.\"\r\nt MSG_062 \"Tog emot ett ogiltigt kommando.\"\r\nt MSG_063 \"Minnesfel.\"\r\nt MSG_064 \"Läsfel.\"\r\nt MSG_065 \"Skrivfel.\"\r\nt MSG_066 \"Installationsfel\"\r\nt MSG_067 \"Kunde inte öppna mediet. Det verkar redan användas av en annan process. Prova ta ur och stoppa in mediet igen.\"\r\nt MSG_068 \"Det gick inte att partitionera enheten.\"\r\nt MSG_069 \"Kunde inte kopiera filer till målenheten.\"\r\nt MSG_070 \"Avbruten av användaren.\"\r\nt MSG_071 \"Kunde inte starta tråd.\"\r\nt MSG_072 \"Kontroll efter trasiga block slutfördes inte.\"\r\nt MSG_073 \"Misslyckades söka av ISO-avbilden.\"\r\nt MSG_074 \"Misslyckades packa upp ISO-avbilden.\"\r\nt MSG_075 \"Kunde inte återmontera volymen.\"\r\nt MSG_076 \"Kunde inte installera filer för uppstarten (boot).\"\r\nt MSG_077 \"Kunde inte tilldela enhetsbokstav.\"\r\nt MSG_078 \"Kan inte montera GUID-volymen.\"\r\nt MSG_079 \"Enheten är inte klar.\"\r\nt MSG_080 \"Rufus har upptäckt att Windows fortfarande tömmer den interna bufferten till USB-enheten.\\n\\nBeroende på hastigheten på din USB-enhet, kan detta ta en lång stund innan det är klart, speciellt för stora filer.\\n\\nVi rekommenderar att du låter Windows få slutföra, för att undvika problem. Men tröttnar du på att vänta, kan du helt enkelt bara dra ur enheten...\"\r\nt MSG_081 \"Avbilden stöds ej\"\r\nt MSG_082 \"Denna avbild är antingen icke startbar, eller så använder den en start- eller kompression-metod som Rufus inte stöder...\"\r\nt MSG_083 \"Ersätt %s?\"\r\nt MSG_084 \"Denna ISO-avbild verkar använda en gammal version av '%s'.\\nStartmenyn visas kanske inte på ett korrekt sätt på grund av detta.\\n\\nLadda ner en nyare version av Rufus så löser det problemet:\\n- Välj 'Ja' för att ansluta till internet och ladda ner filen\\n- Välj 'Nej' för att låta befintlig ISO-fil vara omodifierad\\nVet du inte vad du ska välja, så ska du välja 'Ja'.\\n\\nObs: Filen kommer att laddas ner i nuvarande katalog och när '%s' sedan finns där, kommer den automatiskt att återanvändas.\"\r\nt MSG_085 \"Laddar ner %s\"\r\nt MSG_086 \"Ingen avbild vald\"\r\nt MSG_087 \"för %s-NAND\"\r\nt MSG_088 \"Avbilden är för stor\"\r\nt MSG_089 \"Avbilden är för stor för det valda målet.\"\r\nt MSG_090 \"ISO-filen stöds ej\"\r\nt MSG_091 \"När UEFI används som måltyp, kan endast EFI-startbara ISO-avbilder användas. Välj en EFI-startbar ISO-fil eller sätt måltypen till BIOS.\"\r\nt MSG_092 \"Filsystemet stöds ej\"\r\nt MSG_093 \"VIKTIGT: DENNA ENHETEN INNEHÅLLER FLERA PARTITIONER!!\\n\\nDetta kan inkludera partitioner/volymer som inte är listade eller synliga i Windows. Fortsätter du, är du själv ansvarig för all data som kan försvinna på dessa partitioner.\"\r\nt MSG_094 \"Flera partitioner upptäcktes\"\r\nt MSG_095 \"DD-avbild\"\r\nt MSG_096 \"Det valda filsystemet kan inte användas med denna typ av ISO-fil. Välj ett annat filsystem eller en annan ISO-fil.\"\r\nt MSG_097 \"'%s' kan endast tillämpas om filsystemet är NTFS.\"\r\nt MSG_098 \"VIKTIGT: Du försöker att installera 'Windows To Go', men din målenhet är inte en FIXERAD enhet. Därför kommer troligen Windows att låsa sig vid uppstart, eftersom Microsoft inte har designat det att fungera med FLYTTBARA enheter.\\n\\nVill du ändå fortsätta?\\n\\nObs: FIXERAD/FLYTTBAR enhet ligger i hårdvaran och kan endast ändras med hjälp utav speciella verktyg som endast tillverkarna har. Dessa vertyg är något som NÄSTAN ALDRIG allmänheten får tillgång till...\"\r\nt MSG_099 \"Begränsningar i filsystem\"\r\nt MSG_100 \"Denna ISO-avbild innehåller en fil som är större än 4 GB, vilket är mer än maximal storlek tillåtet för FAT- och FAT32-filsystemet.\"\r\nt MSG_101 \"Stöd för WIM saknas\"\r\nt MSG_102 \"Din dator kan inte packa upp filer från ett WIM-arkiv. WIM-uppackning krävs för att skapa EFI-startbar Windows 7 och Windows Vista USB-enheter. Du kan lösa detta genom att installera 7-Zip.\\nVill du besöka nerladdningssidan för 7-Zip?\"\r\nt MSG_103 \"Ladda ner %s?\"\r\nt MSG_104 \"%s eller senare kräver en '%s' fil för att bli installerad.\\nEftersom filen är större än 100 KB, och alltid finns på %s ISO-avbilder, finns den inte inbyggd i Rufus.\\n\\nRufus kan ladda ner denna filen åt dig:\\n- Välj 'Ja' för att ansluta till internet och ladda ner filen\\n- Välj 'Nej' om du själv senare vill kopiera in filen på enheten\\n\\nObs: Filen kommer att laddas ner i nuvarande katalog och när '%s' sedan finns där, kommer den automatiskt att återanvändas.\"\r\nt MSG_105 \"Avbryter du, finns det risk enheten blir oanvändbar.Är du säker du vill avbryta, tryck JA. Annars tryck NEJ.\"\r\nt MSG_106 \"Välj mapp\"\r\nt MSG_107 \"Alla filer\"\r\nt MSG_108 \"Rufus logg\"\r\nt MSG_110 \"MS-DOS kan inte starta från en enhet som använder 64 kilobytes klusterstorlek.\\nÄndra klusterstorleken eller använd FreeDOS.\"\r\nt MSG_111 \"Klusterstorlek stöds ej\"\r\nt MSG_112 \"Att formatera en stor UDF-volym kan ta lång tid. Vid USB 2.0-hastigheter, är den beräknade formateringstiden runt %d:%02d, och under tiden kan förloppsindikatorn se ut att stå stilla. Ta det bara lugnt, tack!\"\r\nt MSG_113 \"Stor UDF-volym\"\r\nt MSG_114 \"Denna avbild använder Syslinux %s%s men detta programmet innehåller endast installationsfiler för Syslinux %s%s.\\n\\nEftersom nya versioner av Syslinux inte är kompatibla med varandra, skulle det vara omöjligt att alla fanns med i Rufus, så därför måste två filer laddas ner från internet ('ldlinux.sys' och 'ldlinux.bss'):\\n- Välj 'Ja' för att ansluta till internet och ladda ner filerna\\n- Välj 'Nej' för att avbryta det hela\\n\\nObs: Filerna kommer att laddas ner i programmets katalog och kommer att användas igen automatiskt om de finns där.\"\r\nt MSG_115 \"Nerladdning krävs\"\r\nt MSG_116 \"Denna avbild använder Grub %s men programmet innehåller endast installationsfiler för Grub %s.\\n\\nEftersom olika Grub-versioner inte är kompatibla med varandra och det skulle vara omöjligt att inkludera dem alla, därför kommer Rufus att försöka finna den versionen av Grub installationsfilen ('core.img') som matchar den från din avbild:\\n- Välj 'Ja' för att ansluta till Internet och försöka ladda ner det\\n- Välj 'Nej' för att använda standardversionen från Rufus\\n- Välj 'Avbryt' för att avbryta\\n\\nObs: Filen kommer att laddas ner i nuvarande katalog och kommer att automatiskt återanvändas om den existerar. Om ingen fil hittas online, kommer standardversionen att användas.\"\r\nt MSG_117 \"Standard Windowsinstallation\"\r\nt MSG_119 \"avancerade enhetsegenskaper\"\r\nt MSG_120 \"avancerade formatalternativ\"\r\nt MSG_121 \"Visa %s\"\r\nt MSG_122 \"Dölj %s\"\r\nt MSG_123 \"Bestående partitionsstorlek\"\r\nt MSG_124 \"Ej bestående\"\r\nt MSG_125 \"Ställ in den bestående partitionens storlek för live USB-media. Om du ställer in storleken till 0 inaktiveras den bestående partitionen.\"\r\nt MSG_126 \"Ställ in partitionsstorlekarna.\"\r\nt MSG_127 \"Visa inte detta meddelande igen\"\r\nt MSG_128 \"Viktig information om %s\"\r\nt MSG_129 \"Du har just skapat ett media som använder starthanteraren UEFI:NTFS. Kom i håg att, för att starta från detta media, MÅSTE DU INAKTIVERA 'SECURE BOOT'.\\nFör detaljer om varför detta är nödvändigt, tryck på 'Mer information' här nedan.\"\r\nt MSG_130 \"Windows avbildsval\"\r\nt MSG_131 \"ISO-filen innehåller mer än en Windows-avbild.\\nVälj den avbild du vill använda för denna installationen:\"\r\nt MSG_132 \"Ett annat program eller process använder denna enheten Vill du ändå formatera den?\"\r\nt MSG_133 \"Rufus har upptäckt att du försöker skapa en Windows To Go-media baserad på en 1809 ISO-fil.\\n\\nPå grund av ett *FEL AV MICROSOFT* kommer detta media att krascha under uppstarten av Windows (Blåskärm), om du inte manuellt ersätter filen 'WppRecorder.sys' med en från version 1803.\\n\\nAnledningen till att Rufus inte automatiskt kan fixa det här är att \\\"WppRecorder.sys\\\" är en Microsoft-upphovsrättsskyddad fil, så vi kan inte lagligt bädda in en kopia av filen i programmet...\"\r\nt MSG_134 \"Eftersom MBR har valts för partitionsschema, kan Rufus bara skapa en partition upp till 2 TB på det här mediet, vilket kommer att lämna %s av diskutrymmet otillgänglig.\\n\\nÄr det säkert att du vill fortsätta?\"\r\nt MSG_137 \"Utgåva\"\r\nt MSG_138 \"Språk\"\r\nt MSG_139 \"Arkitektur\"\r\nt MSG_140 \"Fortsätt\"\r\nt MSG_141 \"Tillbaka\"\r\nt MSG_142 \"Vänta...\"\r\nt MSG_143 \"Ladda ner med webbläsaren\"\r\nt MSG_144 \"Nerladdning av Windows ISO-filer är inte tillgängligt därför att Microsoft har blockerat det.\"\r\nt MSG_145 \"PowerShell 3.0 eller senare krävs för att köra detta skriptet.\"\r\nt MSG_146 \"Vill du ansluta till internet och ladda ner det?\"\r\nt MSG_148 \"Kör nerladdningsskript...\"\r\nt MSG_149 \"Ladda ner ISO-avbild\"\r\nt MSG_150 \"Typ av dator du planerar att använda den här startbara enheten på. Det är ditt ansvar att avgöra om ditt mål är av typen BIOS eller UEFI innan du börjar skapa enheten, eftersom den kanske inte startar sen.\"\r\nt MSG_151 \"\\\"UEFI-CSM\\\" innebär att enheten startar i BIOS-emuleringsläge (kallas också för 'Legacy Mode') under UEFI och inte i nativ UEFI-läge.\"\r\nt MSG_152 \"\\\"icke CSM\\\" innebär att enheten startar i nativ UEFI-läge och inte i BIOS-emuleringsläge (kallas också för 'Legacy Mode').\"\r\nt MSG_153 \"Testmönster: 0x%02X\"\r\nt MSG_154 \"Testmönster: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Testmönster: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Testmönster: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Ställer in målets filsystem\"\r\nt MSG_158 \"Minsta storlek som ett block av data kommer att ta plats i filsystemet\"\r\nt MSG_159 \"Använd detta fältet till att ange enhetens namn.\\nInternationella bokstäver är tillåtna.\"\r\nt MSG_160 \"Visa/dölj avancerat\"\r\nt MSG_161 \"Kontrollera enheter om den har trasiga block genom att köra ett testmönster\"\r\nt MSG_162 \"Avmarkera om du vill använda \\\"långsam\\\" formateringsmetod\"\r\nt MSG_163 \"Metod som kommer att användas för att skapa partitioner\"\r\nt MSG_164 \"Metod som kommer att användas för att göra enheten startbar\"\r\nt MSG_165 \"Klicka för att välja eller ladda ner avbild...\"\r\nt MSG_166 \"Markera för att tillåta visa internationella namn och sätta en enhetsikon (en autorun.inf skapas)\"\r\nt MSG_167 \"Installera en UEFI-starthanterare som kommer att utföra MD5Sum-filvalidering av media\"\r\nt MSG_169 \"Skapa en extra gömd partition och prova att justera om partitionsuppbyggnaden.\\nDetta kan förbättra uppstarten för äldre BIOS:ar.\"\r\nt MSG_170 \"Lista alla USB-hårddiskar (även icke flyttbara).\\nANVÄND PÅ EGEN RISK!!!\"\r\nt MSG_171 \"Starta formateringen.\\nDetta kommer att ta bort ALL data på målenheten!\"\r\nt MSG_172 \"Ogiltig nerladdningssignatur\"\r\nt MSG_173 \"Tryck för att välja...\"\r\nt MSG_174 \"Rufus - Det pålitliga verktyget för USB-formatering\"\r\nt MSG_176 \"Svensk översättning: Sopor\"\r\nt MSG_177 \"Rapportera fel eller om du har några idéer:\"\r\nt MSG_178 \"Andra upphovsrätter:\"\r\nt MSG_179 \"Uppdateringspolicy:\"\r\nt MSG_180 \"Om du väljer att tillåta detta program att leta efter uppdateringar, tillåter du även att följande information sparas på våra servrar:\"\r\nt MSG_181 \"Information om ditt operativsystem och version\"\r\nt MSG_182 \"Version på programmet du använder\"\r\nt MSG_183 \"Din IP-adress\"\r\nt MSG_184 \"För att kunna skapa användningsstatistik, kommer vi att spara informationen, \\\\b i högst ett år\\\\b0 . Vi kommer dock behålla informationen för oss själva.\"\r\nt MSG_185 \"Uppdateringsprocess:\"\r\nt MSG_186 \"Rufus installerar inga bakgrundsprogram, därför sker endast uppdateringskontrollen när det körs.\\\\line\\nFör att kontrollera efter uppdateringar krävs naturligtvis internettillgång.\"\r\nt MSG_187 \"Ogiltig avbild för valt startalternativ\"\r\nt MSG_188 \"Nuvarande avbild matchar inte det startbara valet. Välj en annan avbild eller ändra de startbara valet.\"\r\nt MSG_189 \"Denna ISO-avbild är inte kompatibel med valt filsystem\"\r\nt MSG_190 \"Enheten är inte kompatibel\"\r\nt MSG_191 \"Skrivförsök\"\r\nt MSG_192 \"Läsförsök\"\r\nt MSG_193 \"Nerladdad %s\"\r\nt MSG_194 \"Kunde inte ladda ner %s\"\r\nt MSG_195 \"Använder den inbyggda versionen av %s fil(er)\"\r\nt MSG_196 \"VIKTIGT: DENNA ENHET ANVÄNDER SIG AV EN ICKE STANDARD SEKTORSTORLEK!\\n\\nKonventionella enheter använder en sektorstorlek på 512-byte men denna enheten använder %d-byte. I de flesta fall innebär detta att du INTE kommer att kunna starta från denna enheten.\\nRufus kan försöka att skapa en startbar enhet, men det finns inga garantier på att den kommer att fungera.\"\r\nt MSG_197 \"En icke standard sektorstorlek upptäckt\"\r\nt MSG_198 \"\\\"Windows To Go\\\" kan endast installeras på en enhet med GPT-partition om det är en FIXERAD enhet. Nuvarande enhet är inte FIXERAD.\"\r\nt MSG_199 \"Den här funktionen är inte tillgänglig på den här plattformen.\"\r\nt MSG_201 \"Avbryter - Vänta...\"\r\nt MSG_202 \"Söker igenom avbild...\"\r\nt MSG_203 \"Misslyckades att söka igenom avbilden\"\r\nt MSG_204 \"Upptäckte en gammal %s\"\r\nt MSG_205 \"Använder avbild: %s\"\r\nt MSG_206 \"Fil %s saknas\"\r\nt MSG_207 \"Ny volym\"\r\nt MSG_208 \"Hittade %d enhet\"\r\nt MSG_209 \"Hittade %d enheter\"\r\nt MSG_210 \"REDO\"\r\nt MSG_211 \"Avbruten\"\r\nt MSG_212 \"MISSLYCKADES\"\r\nt MSG_213 \"Startar uppdaterad version...\"\r\nt MSG_214 \"Kunde inte starta den nya versionen\"\r\nt MSG_215 \"Öppnad %s\"\r\nt MSG_216 \"Sparad %s\"\r\nt MSG_217 \"Formaterar: %s\"\r\nt MSG_218 \"Skapar filsystem: Uppgift %d/%d klart\"\r\nt MSG_219 \"NTFS-Fixup: %d%% klart\"\r\nt MSG_220 \"Formaterar (%s) - beräknad tid %d:%02d...\"\r\nt MSG_221 \"Skriver etikett (%s)...\"\r\nt MSG_222 \"Formaterar (%s)...\"\r\nt MSG_223 \"NTFS-Fixup (Checkdisk)...\"\r\nt MSG_224 \"Rensar MBR/PBR/GPT strukturer...\"\r\nt MSG_225 \"Begära diskåtkomst...\"\r\nt MSG_226 \"Analyserar nuvarande startsektor...\"\r\nt MSG_227 \"Stänger nuvarande volym...\"\r\nt MSG_228 \"Skriver huvudstartsektor...\"\r\nt MSG_229 \"Skriver partitionsstartsektor...\"\r\nt MSG_230 \"Kopierar DOS-filer...\"\r\nt MSG_231 \"Kopierar ISO-filer: %s\"\r\nt MSG_232 \"Win7 EFI-startinställningar (%s)...\"\r\nt MSG_233 \"Slutbehandlar, vänta...\"\r\nt MSG_234 \"Installerar Syslinux %s...\"\r\nt MSG_235 \"Trasiga block: %s %d/%d - %0.2f%% (%d/%d/%d fel)\"\r\nt MSG_236 \"Trasiga block: Testar med varierande mönster\"\r\nt MSG_237 \"Trasiga block: Testar med mönster 0x%02X\"\r\nt MSG_238 \"Partitionerar (%s)...\"\r\nt MSG_239 \"Tar bort partitioner (%s)...\"\r\nt MSG_240 \"Signaturen för den hämtade uppdateringen kan inte valideras. Detta kan innebära att ditt system är felaktigt konfigurerat för validering av signaturer eller en indikation på att du laddat ner skadlig kod.\\n\\nNerladdad fil kommer att tas bort. Kontrollera loggfilen för mer detaljerad information.\"\r\nt MSG_241 \"Laddar ner: %s\"\r\nt MSG_242 \"Kunde inte ladda ner filen.\"\r\nt MSG_243 \"Kontrollerar efter Rufus uppdateringar...\"\r\nt MSG_244 \"Uppdateringar: Kunde inte ansluta till internet\"\r\nt MSG_245 \"Uppdateringar: Har ingen tillgång till versionsdata\"\r\nt MSG_246 \"Det finns en ny version av Rufus!\"\r\nt MSG_247 \"Det finns ingen ny version av Rufus\"\r\nt MSG_248 \"Programmets registernycklar har tagits bort\"\r\nt MSG_249 \"Kunde inte ta bort programmets registernycklar\"\r\nt MSG_250 \"%s aktiverad\"\r\nt MSG_251 \"%s inaktiverad\"\r\nt MSG_252 \"Storlekskontrollen är\"\r\nt MSG_253 \"Hårddiskdetekteringen är\"\r\nt MSG_254 \"Tvinga formatera 'large FAT32' är\"\r\nt MSG_255 \"NoDriveTypeAutorun kommer att tas bort vid avslut\"\r\nt MSG_256 \"Upptäckte en falsk enhet är\"\r\nt MSG_257 \"Joliet-stödet är\"\r\nt MSG_258 \"Rock Ridge-stödet är\"\r\nt MSG_259 \"Tvinga uppdatering är\"\r\nt MSG_260 \"NTFS-kompressionen är\"\r\nt MSG_261 \"Skriver avbild: %s\"\r\nt MSG_262 \"ISO-stödet är\"\r\nt MSG_263 \"Använd 'RÄTT' storleksenhet är\"\r\nt MSG_264 \"Tar bort katalogen '%s'\"\r\nt MSG_265 \"VMWare diskdetekteringen är\"\r\nt MSG_266 \"Dubbla UEFI/BIOS-läget är\"\r\nt MSG_267 \"Tillämpar Windows-avbild: %s\"\r\nt MSG_268 \"Tillämpar Windows-avbild...\"\r\nt MSG_269 \"Bevara datum och tid är\"\r\nt MSG_270 \"USB-felsökning är\"\r\nt MSG_271 \"Beräknar kontrollsummor för avbilden: %s\"\r\nt MSG_272 \"Beräkna MD5-, SHA1- och SHA256-kontrollsummor för den valda avbilden\"\r\nt MSG_273 \"Ändra programspråk\"\r\nt MSG_274 \"Avbilden är av typen %s\"\r\nt MSG_275 \"Avbilden du har valt är en \\\"ISOHybrid-avbild\\\". Detta innebär att den kan skrivas i både läge %s (filkopiering) eller i läge %s (disk-avbild).\\nRufus rekommenderar att läge %s används, så att du alltid har full tillgång till enheten efter att du skrivit till den.\\nSkulle du få problem vid uppstarten, kan du i stället prova skriva avbilden i läge %s.\\n\\nVälj det läge du vill använda för att skriva avbilden:\"\r\nt MSG_276 \"Skriv i läge %s (Rekommenderas)\"\r\nt MSG_277 \"Skriv i läge %s\"\r\nt MSG_278 \"Kontrollerar om det finns några motstridiga processer...\"\r\nt MSG_279 \"Icke startbar\"\r\nt MSG_280 \"Disk- eller ISO-avbild\"\r\nt MSG_281 \"%s (välj)\"\r\nt MSG_282 \"Exklusiv låsning av USB-enheten\"\r\nt MSG_283 \"Ogiltig signatur\"\r\nt MSG_284 \"Den nerladdade körbara filen saknar digital signatur.\"\r\nt MSG_285 \"Den nerladdade körbara filen är signerad av '%s'.\\nDetta är inte en signatur vi känner igen och detta kan tyda på någon form av skadlig aktivitet...\\nÄr du säker på att du vill köra filen?\"\r\nt MSG_286 \"Nollställer enheten: %s\"\r\nt MSG_287 \"Visar även icke flyttbara USB-enheter\"\r\nt MSG_288 \"Förhöjda privilegier saknas\"\r\nt MSG_289 \"Detta program kräver förhöjda privilegier för att fungera\"\r\nt MSG_290 \"Filindexering\"\r\nt MSG_291 \"Välj version\"\r\nt MSG_292 \"Välj den version av Windows du vill installera:\"\r\nt MSG_293 \"Denna version stöds inte\"\r\nt MSG_294 \"Den här versionen av Windows stöds inte längre av Rufus.\\nDen senaste versionen av Rufus som är kompatibel med den här plattformen är v%d.%d.\"\r\nt MSG_295 \"Varning: Inofficiell version\"\r\nt MSG_296 \"Denna version av Rufus producerades inte av originalutvecklaren.\\n\\nÄr du säker på att du vill använda den?\"\r\nt MSG_297 \"Ej komplett ISO-fil\"\r\nt MSG_298 \"ISO-filen du har valt matchar inte den angivna storleken: %s av data saknas!\\n\\nOm du har hämtat den här filen från internet, prova då med att ladda ner filen igen och verifiera att checksumman MD5 eller SHA stämmer överens med den officiella filen.\\n\\nTips: Du kan beräkna MD5 eller SHA i Rufus genom att klicka på knappen (✓).\"\r\nt MSG_299 \"Valideringfel av tidsstämpeln\"\r\nt MSG_300 \"Rufus kunde inte validera att tidsstämpeln på den nerladdade uppdateringen är nyare än den gamla.\\n\\nFör att förhindra potentiella angreppsscenarier, har uppdateringsprocessen avslutats och den nerladdade filen har tagits bort. Kontrollera loggen för mer information.\"\r\nt MSG_301 \"Visa programinställningar\"\r\nt MSG_302 \"Visa information om programmet\"\r\nt MSG_303 \"Visa loggen\"\r\nt MSG_304 \"Skapa en skivavbildning av den valda enheten\"\r\nt MSG_305 \"Använd det här alternativet om du planerar att installera Windows på en annan disk eller om du vill köra Windows direkt från den här enheten (Windows To Go).\"\r\nt MSG_306 \"Snabbnollställer enheten: %s\"\r\nt MSG_307 \"detta kan ta lång tid\"\r\nt MSG_308 \"VHD-detektering\"\r\nt MSG_309 \"Komprimerat arkiv\"\r\nt MSG_310 \"ISO-filen du har valt använder UEFI och är tillräckligt liten för att kunna skrivas som en EFI System Partition (ESP). Att skriva till en ESP istället för att skriva till en generisk datapartition som upptar hela disken, kan vara att föredra för vissa typer av installationer.\\n\\nVälj det läge som du vill använda för att skriva den här avbilden:\"\r\nt MSG_311 \"Använd %s (i huvudprogramfönstret) för att aktivera.\"\r\nt MSG_312 \"Extra hash (SHA512)\"\r\nt MSG_313 \"Spara till VHD\"\r\nt MSG_314 \"Beräkna avbildkontrollsummor\"\r\nt MSG_315 \"Flera knappar\"\r\nt MSG_316 \"Antal gånger\"\r\nt MSG_317 \"Disk-ID\"\r\nt MSG_318 \"Standard trådprioritet: %d\"\r\nt MSG_319 \"Ignorera startmarkör\"\r\nt MSG_320 \"Uppdaterar partitionslayout (%s)...\"\r\nt MSG_321 \"Avbilden du har valt är en ISOHybrid, men den som skapade filen har inte gjort den kompatibelt med ISO/Filkopieringsläge.\\nDärför kommer skrivläget DD-avbild att användas.\"\r\nt MSG_322 \"Det går inte att öppna eller läsa '%s'\"\r\nt MSG_325 \"Verkställer Windows-anpassning: %s\"\r\nt MSG_326 \"Verkställer användaralternativ...\"\r\nt MSG_327 \"Windows användarupplevelse\"\r\nt MSG_328 \"Anpassa Windows-installationen?\"\r\nt MSG_329 \"Ta bort kravet på 4GB+ RAM, Secure Boot och TPM 2.0\"\r\nt MSG_330 \"Ta bort kravet på ett online Microsoft-konto\"\r\nt MSG_331 \"Inaktivera datainsamling (Hoppa över sekretessfrågor)\"\r\nt MSG_332 \"Förhindra \\\"Windows To Go\\\" från att komma åt interna diskar\"\r\nt MSG_333 \"Skapa ett lokalt konto med användarnamn:\"\r\nt MSG_334 \"Ställ in regionala alternativ till samma värden som denna användares\"\r\nt MSG_335 \"Inaktivera BitLockers automatiska enhetskryptering\"\r\nt MSG_336 \"Bestående logg\"\r\nt MSG_337 \"En fil (%s) måste laddas ner från Microsoft för att använda den här funktionen:\\n- Välj \\\"Ja\\\" för att ansluta till Internet och ladda ner den\\n- Välj \\\"Nej\\\" för att avbryta operationen\\n\\nObs: Filen kommer att laddas ner i programmets katalog och kommer att återanvändas automatiskt om den finns.\"\r\nt MSG_338 \"Återkallad UEFI-starthanterare upptäcktes\"\r\nt MSG_339 \"Rufus upptäckte att den ISO-filen du har valt innehåller en UEFI-starthanterare som har återkallats och som kommer att producera %s, när \\\"Secure Boot\\\" är aktiverat på ett helt uppdaterat UEFI-system.\\n\\n- Om du skaffade den här ISO-avbilden från en icke ansedd källa bör du överväga möjligheten att den kan innehålla UEFI-skadlig programvara och undvika att starta från den.\\n- Om du har fått det från en pålitlig källa bör du försöka hitta en mer uppdaterad version som inte ger den här varningen.\"\r\nt MSG_340 \"en \\\"Säkerhetsöverträdelseskärm\\\"\"\r\nt MSG_341 \"en Windows-återställningsskärm (BSOD) med '%s'\"\r\nt MSG_342 \"Komprimerad VHDX-avbild\"\r\nt MSG_343 \"Okomprimerad VHD-avbild\"\r\nt MSG_344 \"Full flash uppdateringsavbild\"\r\nt MSG_345 \"Ytterligare data måste laddas ner från Microsoft för att kunna använda den här funktionen:\\n- Välj \\\"Ja\\\" för att ansluta till Internet och ladda ner den\\n- Välj \\\"Nej\\\" för att avbryta operationen\"\r\nt MSG_346 \"Begränsa Windows till S-läge (INKOMPATIBEL med förbikoppling av onlinekonto)\"\r\nt MSG_347 \"Expertläge\"\r\nt MSG_348 \"Extraherar arkivfiler: %s\"\r\nt MSG_349 \"Använd Rufus MBR\"\r\nt MSG_900 \"Rufus är ett program som hjälper dig formatera och skapa startbara USB-diskar, så som USB-minnen, minneskort, etc.\"\r\nt MSG_901 \"Officiell webbplats: %s\"\r\nt MSG_902 \"Källkod: %s\"\r\nt MSG_903 \"Ändringslogg: %s\"\r\nt MSG_904 \"Denna applikation är licensierad under villkoren i GNU Public License (GPL) version 3.\\nSe https://www.gnu.org/licenses/gpl-3.0.en.html för mer information.\"\r\nt MSG_905 \"Uppstart\"\r\nt MSG_910 \"Formatera USB-enheter, flash-kort och virtuella enheter till FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Skapa FreeDOS startbara USB-enheter\"\r\nt MSG_912 \"Skapa startbara enheter från startbara ISO-filer (Windows, Linux, etc.)\"\r\nt MSG_913 \"Skapa startbara enheter från startbara diskavbildningar, inklusive komprimerade\"\r\nt MSG_914 \"Skapa BIOS- eller UEFI-startbara enheter, inklusive UEFI-startbar NTFS\"\r\nt MSG_915 \"Skapa \\\"Windows To Go\\\"-enheter\"\r\nt MSG_916 \"Skapa installationsenheter till Windows 11 för datorer som inte har TPM eller säker start\"\r\nt MSG_917 \"Skapa beständiga Linux-partitioner\"\r\nt MSG_918 \"Skapa VHD/DD-avbilder av den valda enheten\"\r\nt MSG_919 \"Beräkna kontrollsummor MD5, SHA-1, SHA-256 och SHA-512 för den valda avbilden\"\r\nt MSG_920 \"Utför kontroll av trasiga block, inklusive upptäckt av \\\"falska\\\" USB-minnen\"\r\nt MSG_921 \"Ladda ner officiella Microsoft Windows ISO-filer\"\r\nt MSG_922 \"Ladda ner UEFI-skal ISO-filer\"\r\n\r\n#########################################################################\r\nl \"th-TH\" \"Thai (ไทย)\" 0x041e\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"เกี่ยวกับ Rufus\"\r\nt IDC_ABOUT_LICENSE \"ลิขสิทธิ์\"\r\nt IDOK \"ตกลง\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"คุณสมบัติของไดรฟ์\"\r\nt IDS_DEVICE_TXT \"อุปกรณ์\"\r\nt IDS_BOOT_SELECTION_TXT \"ตัวเลือกการบูต\"\r\nt IDC_SELECT \"เลือก\"\r\nt IDS_IMAGE_OPTION_TXT \"ตัวเลือกอิมเมจ\"\r\nt IDS_PARTITION_TYPE_TXT \"รูปแบบของพาร์ติชัน\"\r\nt IDS_TARGET_SYSTEM_TXT \"รูปแบบเครื่องเป้าหมาย\"\r\nt IDC_LIST_USB_HDD \"แสดงรายการ USB Drive\"\r\nt IDC_OLD_BIOS_FIXES \"เพิ่มการรองรับให้กับ BIOS รุ่นเก่า\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"เปิดใช้งานการตรวจสอบอุปกรณ์ UEFI\"\r\nt IDS_FORMAT_OPTIONS_TXT \"ตัวเลือกการฟอร์แมต\"\r\nt IDS_FILE_SYSTEM_TXT \"ระบบไฟล์\"\r\nt IDS_CLUSTER_SIZE_TXT \"ขนาดของคลัสเตอร์\"\r\nt IDS_LABEL_TXT \"ชื่อของไดรฟ์\"\r\nt IDC_QUICK_FORMAT \"ฟอร์แมตอย่างรวดเร็ว\"\r\nt IDC_BAD_BLOCKS \"ตรวจหาข้อบกพร่องของอุปกรณ์\"\r\nt IDC_EXTENDED_LABEL \"ตั้งชื่อไดรฟ์ด้วยอักขระสากล และเพิ่มไอคอนของไดรฟ์\"\r\nt IDS_STATUS_TXT \"สถานะ\"\r\nt IDCANCEL \"ปิด\"\r\nt IDC_START \"เริ่ม\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"ปิด\"\r\nt IDD_LICENSE \"ลิขสิทธิ์ของ Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"ปิด\"\r\nt IDD_LOG \"รายการ Log\"\r\nt IDC_LOG_CLEAR \"ล้าง\"\r\nt IDC_LOG_SAVE \"บันทึก\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"ปิด\"\r\nt IDD_NEW_VERSION \"ตรวจหาการอัพเดต - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"พบ Rufus รุ่นใหม่กว่า! โปรดอัพเดตโปรแกรมให้เป็นรุ่นล่าสุด!\"\r\nt IDC_WEBSITE \"คลิกเพื่อเปิดเว็บไซต์\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"สิ่งที่เพิ่มมาใหม่\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"ดาวน์โหลด\"\r\nt IDC_DOWNLOAD \"ดาวน์โหลด\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"ข้อมูลเพิ่มเติม\"\r\nt IDYES \"ใช่\"\r\nt IDNO \"ไม่ใช่\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"ปิด\"\r\nt IDD_UPDATE_POLICY \"นโยบายการอัพเดต และการตั้งค่า\"\r\nt IDS_UPDATE_SETTINGS_GRP \"ตั้งค่า\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"ตรวจหาการอัพเดต\"\r\nt IDS_INCLUDE_BETAS_TXT \"รวมเวอร์ชันทดสอบด้วย\"\r\nt IDC_CHECK_NOW \"ตรวจสอบ\"\r\n\r\nt MSG_001 \"Rufus กำลังถูกเรียกใช้งานอยู่\"\r\nt MSG_002 \"คุณได้เปิด Rufus ไว้ก่อนหน้าแล้ว\\nกรุณาปิดหน้าต่างเก่าก่อนเรียกใช้งาน Rufus อีกครั้งหนึ่ง\"\r\nt MSG_003 \"โปรดระวัง: ข้อมูลทั้งหมดบนอุปกรณ์ '%s' จะถูกลบทิ้งทั้งหมด\\nหากต้องการดำเนินการต่อ โปรดคลิก OK แต่หากต้องการยกเลิก โปรดคลิก Cancel\"\r\nt MSG_004 \"นโยบายการอัพเดตของ Rufus\"\r\nt MSG_005 \"คุณต้องการให้ Rufus ตรวจหาการอัพเดตออนไลน์หรือไม่?\"\r\nt MSG_006 \"ปิด\"\r\nt MSG_007 \"ยกเลิก\"\r\nt MSG_008 \"ใช่\"\r\nt MSG_009 \"ไม่ใช่\"\r\nt MSG_010 \"พบข้อบกพร่อง\"\r\nt MSG_011 \"ตรวจสอบเรียบร้อย: พบ %d จุดบกพร่อง\\n  อ่านบกพร่อง %d จุด\\n  เขียนบกพร่อง %d จุด\\n  จุดเสียหาย %d จุด\"\r\nt MSG_012 \"%s\\nอ่านรายละเอียดเพิ่มเติมได้ที่:\\n%s\"\r\nt MSG_013 \"ปิดใช้งาน\"\r\nt MSG_014 \"ทุกวัน\"\r\nt MSG_015 \"สัปดาห์ละครั้ง\"\r\nt MSG_016 \"เดือนละครั้ง\"\r\nt MSG_017 \"กำหนดเอง\"\r\nt MSG_018 \"เวอร์ชันของคุณ: %d.%d (Build %d)\"\r\nt MSG_019 \"เวอร์ชันล่าสุด: %d.%d (Build %d)\"\r\nt MSG_020 \"ไบต์\"\r\nt MSG_026 \"ไบต์\"\r\nt MSG_027 \"กิโลไบต์\"\r\nt MSG_028 \"เมกะไบต์\"\r\nt MSG_029 \"ค่าเริ่มต้น\"\r\nt MSG_030 \"%s (ค่าเริ่มต้น)\"\r\nt MSG_031 \"BIOS (หรือ UEFI-CSM)\"\r\nt MSG_033 \"BIOS หรือ UEFI\"\r\nt MSG_034 \"%d รอบ\"\r\nt MSG_035 \"%d รอบ %s\"\r\nt MSG_037 \"แอปพลิเคชัน\"\r\nt MSG_038 \"ยกเลิก\"\r\nt MSG_039 \"เปิด\"\r\nt MSG_040 \"ดาวน์โหลด\"\r\nt MSG_041 \"การดำเนินการถูกยกเลิกโดยผู้ใช้\"\r\nt MSG_042 \"ความผิดพลาด\"\r\nt MSG_043 \"ผิดพลาด: %s\"\r\nt MSG_044 \"ดาวน์โหลดไฟล์\"\r\nt MSG_045 \"อุปกรณ์ USB\"\r\nt MSG_046 \"%s (ดิสก์ที่ %d) [%s]\"\r\nt MSG_047 \"พบหลายพาร์ติชัน\"\r\nt MSG_048 \"Rufus - กำลังล้างบัฟเฟอร์\"\r\nt MSG_049 \"Rufus - ยกเลิกการดำเนินการ\"\r\nt MSG_050 \"สำเร็จ\"\r\nt MSG_051 \"พบข้อบกพร่องขณะดำเนินการฟอร์แมต\"\r\nt MSG_052 \"ไม่สามารถใช้ระบบไฟล์ที่เลือกกับอุปกรณ์นี้ได้\"\r\nt MSG_053 \"ไม่สามารถเข้าถึงอุปกรณ์ได้\"\r\nt MSG_054 \"อุปกรณ์นี้มีการป้องกันการเขียน\"\r\nt MSG_055 \"อุปกรณ์นี้กำลังถูกใช้งานโดยโปรแกรมอื่น กรุณาปิดโปรแกรมที่สงสัยว่ากำลังใช้งานอุปกรณ์นี้อยู่\"\r\nt MSG_056 \"อุปกรณ์นี้ไม่สามารถใช้การฟอร์แมตแบบรวดเร็วได้\"\r\nt MSG_057 \"ไม่สามารถใช้ชื่อนี้ตั้งชื่ออุปกรณ์ได้\"\r\nt MSG_058 \"การระบุตัวอุปกรณ์ผิดพลาด\"\r\nt MSG_059 \"ขนาดของคลัสเตอร์ไม่เข้ากับอุปกรณ์\"\r\nt MSG_060 \"ขนาดพื้นที่ของอุปกรณ์ไม่ถูกต้อง\"\r\nt MSG_061 \"กรุณาเชื่อมต่ออุปกรณ์เข้ากับเครื่องคอมพิวเตอร์\"\r\nt MSG_062 \"โปรแกรมได้รับคำสั่งที่ไม่รองรับ\"\r\nt MSG_063 \"การจัดสรรหน่วยความจำผิดพลาด\"\r\nt MSG_064 \"การอ่านผิดพลาด\"\r\nt MSG_065 \"การเขียนผิดพลาด\"\r\nt MSG_066 \"การติดตั้งโปรแกรมผิดพลาด\"\r\nt MSG_067 \"ไม่สามารถเข้าถึงอุปกรณ์ได้ อุปกรณ์นี้อาจกำลังถูกใช้งานโดยโปรแกรมอื่น โปรดถอด และเชื่อมต่ออุปกรณ์ใหม่แล้วลองอีกครั้ง\"\r\nt MSG_068 \"ไม่สามารถแบ่งพาร์ติชันไดรฟ์ได้\"\r\nt MSG_069 \"ไม่สามารถคัดลอกไฟล์ลงไปยังไดรฟ์ได้\"\r\nt MSG_070 \"ยกเลิกโดยผู้ใช้\"\r\nt MSG_071 \"ไม่สามารถเริ่มต้นเธรดการทำงานได้\"\r\nt MSG_072 \"การตรวจสอบจุดบกพร่องของไดรฟ์ไม่แล้วเสร็จ\"\r\nt MSG_073 \"การตรวจสอบอิมเมจ ISO ผิดพลาด\"\r\nt MSG_074 \"การแตกไฟล์อิมเมจ ISO ผิดพลาด\"\r\nt MSG_075 \"ไม่สามารถเชื่อมต่อ Volumn ได้\"\r\nt MSG_076 \"ไม่สามารถติดตั้งไฟล์แพทช์สำหรับบูตได้\"\r\nt MSG_077 \"ตั้งอักษรประจำไดรฟ์ไม่ได้\"\r\nt MSG_078 \"ไม่สามารถเชื่อมต่อ GUID volume ได้\"\r\nt MSG_079 \"อุปกรณ์ไม่พร้อมใช้งาน\"\r\nt MSG_080 \"Rufus พบว่าขณะนี้ Windows กำลังดำเนินการเขียนไฟล์ลงบนอุปกรณ์ USB\\n\\nความเร็วขึ้นอยู่กับ USB ของคุณ ดังนั้นการดำเนินการนี้อาจใช้เวลานานโดยเฉพาะอย่างยิ่งกับไฟล์ที่มีขนาดใหญ่มากๆ\\n\\nเราแนะนำให้คุณรอให้การดำเนินการเสร็จสิ้นเพื่อป้องกันไฟล์เสียหาย อย่างไรก็ตาม หากคุณไม่ต้องการรอก็สามารถดึงอุปกรณ์ออกไปได้เลย...\"\r\nt MSG_081 \"ไม่รองรับอิมเมจไฟล์นี้\"\r\nt MSG_082 \"อิมเมจไฟล์นี้ไม่สามารถบูตได้ หรืออาจจะมีการใช้วิธีการบูตอื่นๆ ที่ Rufus ไม่รองรับ\"\r\nt MSG_083 \"แทนที่ %s?\"\r\nt MSG_084 \"ไฟล์ ISO นี้อาจมีการใช้เวอร์ชันที่ล้าสมัยของ '%s'\\nซึ่งอาจทำให้เมนูการบูตไม่สามารถแสดงผลได้ถูกต้อง\\n\\nRufus สามารถดาวน์โหลดเวอร์ชันที่ใหม่กว่าให้คุณได้:\\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n- เลือก 'No' เพื่อใช้อิมเมจไฟล์อันเดิม\\nหากไม่รู้จะเลือกวิธีใด ให้เลือก 'Yes'\\n\\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ\"\r\nt MSG_085 \"กำลังดาวน์โหลด %s\"\r\nt MSG_086 \"ยังไม่ได้เลือกอิมเมจไฟล์\"\r\nt MSG_087 \"สำหรับ %s NAND\"\r\nt MSG_088 \"อิมเมจไฟล์มีขนาดใหญ่เกินไป\"\r\nt MSG_089 \"อิมเมจไฟล์มีขนาดใหญ่กว่าอุปกรณ์\"\r\nt MSG_090 \"ไม่รองรับไฟล์ ISO นี้\"\r\nt MSG_091 \"เมื่อเลือกใช้รูปแบบ UEFI อิมเมจไฟล์ที่รองรับจะต้องเป็นแบบ EFI ด้วย กรุณาเลือก ISO ที่รองรับ EFI หรือเปลี่ยนรูปแบบเป็น BIOS แทน\"\r\nt MSG_092 \"ไม่รองรับระบบไฟล์นี้\"\r\nt MSG_093 \"คำเตือน:ไดรฟ์นี้มีหลายพาร์ติชัน!!\\n\\nซึ่งอาจรวมไปถึงพาร์ติชันที่ไม่สามารถมองเห็นได้บน Windows หากดำเนินการต่อ ข้อมูลบนพาร์ติชันดังกล่าวจะหายไปอย่างถาวร\"\r\nt MSG_094 \"พบหลายพาร์ติชัน\"\r\nt MSG_096 \"ระบบไฟล์ที่เลือกปัจจุบันไม่สามารถใช้ได้กับ ISO รูปแบบนี้ กรุณาเลือกระบบไฟล์หรือ ISO ใหม่ที่ต่างไปจากเดิม\"\r\nt MSG_097 \"'%s' สามารถใช้ได้เฉพาะกับระบบไฟล์ NTFS เท่านั้น\"\r\nt MSG_098 \"คำเตือน: คุณกำลังเลือกติดตั้ง 'Windows To Go' แต่อุปกรณ์ของคุณไม่มีค่า attribute เป็น 'FIXED' ดังนั้น Windows อาจจะค้างขณะทำการบูตได้ เพราะ Microsoft ไม่ได้ออกแบบระบบให้ทำงานบนอุปกรณ์แบบถอดได้ (ค่า attribute เป็น 'REMOVABLE')\\n\\nคุณต้องการดำเนินการต่อหรือไม่?\\n\\nหมายเหตุ: แอททริบิวต์แบบ 'FIXED/REMOVABLE' เป็นคุณสมบัติเฉพาะของอุปกรณ์ และสามารถถูกแก้ไขได้โดยเครื่องมือที่สร้างโดยผู้ผลิตเท่านั้น ซึ่งหาได้ยากมาก และไม่ถูกปล่อยให้ใช้งานโดยทั่วไป...\"\r\nt MSG_099 \"ข้อจำกัดของแต่ละระบบไฟล์\"\r\nt MSG_100 \"ไฟล์ ISO นี้ประกอบไปด้วยไฟล์ที่มีขนาดใหญ่กว่า 4 GB ซึ่งมากกว่าขนาดสูงสุดที่ระบบไฟล์แบบ FAT หรือ FAT32 จะรองรับได้\"\r\nt MSG_101 \"ไม่รองรับรูปแบบ WIM\"\r\nt MSG_102 \"ระบบปฏิบัติการของคุณไม่สามารถแตกไฟล์แบบ WIM ได้ โดยไฟล์ WIM จำเป็นที่ต้องใช้ในการสร้าง Windows 7 ให้บูตได้แบบ EFI และ Windows Vista บน USB ซึ่งแก้ไขได้โดยการติดตั้ง 7-Zip เวอร์ชันล่าสุด\\nต้องการเปิดหน้าดาวน์โหลด 7-zip หรือไม่?\"\r\nt MSG_103 \"ดาวน์โหลด %s?\"\r\nt MSG_104 \"%s หรือใหม่กว่า จำเป็นต้องมี '%s' ติดตั้งไว้\\nเนื่องจากไฟล์นี้มีขนาดใหญ่กว่า 100 KB และพบเจอได้ใน ISO: %s ซึ่งไม่ได้รวมไว้ในโปรแกรม Rufus\\n\\nRufus สามารถดาวน์โหลดไฟล์ดังกล่าวให้คุณได้:\\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n- เลือก 'No' คุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\\n\\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ\"\r\nt MSG_105 \"การยกเลิกอาจทำให้อุปกรณ์ไม่สามารถใช้การได้ !\\nหากคุณยืนยันที่จะยกเลิก คลิกที่ปุ่ม ใช่\"\r\nt MSG_106 \"กรุณาเลือกโฟลเดอร์\"\r\nt MSG_107 \"ไฟล์ทั้งหมด\"\r\nt MSG_109 \"0x%02X (ดิสก์ที่ %d)\"\r\nt MSG_110 \"MS-DOS ไม่สามารถบูตจากไดรฟ์ที่ใช้ขนาดของคลัสเตอร์ 64 kilobytes ได้\\nโปรดเปลี่ยนขนาดของคลัสเตอร์ หรือเลือกใช้ FreeDOS.\"\r\nt MSG_111 \"ไม่รองรับขนาดของคลัสเตอร์นี้\"\r\nt MSG_112 \"การฟอร์แมต UDF volume ขนาดใหญ่อาจใช้เวลานาน โดยความเร็วการฟอร์แมต USB 2.0 โดยประมาณคือ %d:%02d ซึ่งในระหว่างการฟอร์แมตแถบแสดงความคืบหน้าอาจหยุดนิ่ง โปรดรอ!\"\r\nt MSG_113 \"UDF volume ขนาดใหญ่\"\r\nt MSG_114 \"อิมเมจนี้ใช้ Syslinux %s%s แต่โปรแกรมนี้มีเฉพาะไฟล์ติดตั้งของ Syslinux %s%s \\n\\nโดยเวอร์ชันใหม่ของ Syslinux อาจไม่รองรับกับรุ่นที่ต่างกันไปไฟล์จำนวน 2 ไฟล์ต่อไปนี้จะถูกดาวน์โหลดจากอินเทอร์เน็ต ('ldlinux.sys' and 'ldlinux.bss'):\\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n- เลือก 'No' เมื่อคุณต้องการคัดลอกไฟล์ดังกล่าวด้วยตัวเอง\\n\\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และไฟล์ จะถูกเลือกใช้โดยอัตโนมัติ\"\r\nt MSG_115 \"จำเป็นต้องดาวน์โหลดไฟล์\"\r\nt MSG_116 \"อิมเมจนี้ใช้ Grub %s แต่โปรแกรมนี้มีเฉพาะไฟล์ติดตั้งของ Grub %s \\n\\nโดยเวอร์ชันใหม่ของ Grub อาจไม่รองรับกับรุ่นที่ต่างกันไป Rufus สามารถค้นหาอิมเมจของ Grub เวอร์ชันล่าสุด ('core.img') ที่เข้ากันได้กับอิมเมจไฟล์ที่คุณเลือก:\\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n- เลือก 'No' เพื่อใช้เวอร์ชันปัจจุบันที่ติดมากับ Rufus\\n-เลือก 'Cancel' เพื่อยกเลิกการดำเนินการนี้\\n\\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และไฟล์จะถูกเลือกใช้โดยอัตโนมัติหากไม่พบไฟล์ที่ใหม่กว่า ไฟล์เวอร์ชันปัจจุบันจะถูกใช้แทน\"\r\nt MSG_117 \"ตัวติดตั้ง Windows มาตรฐาน\"\r\nt MSG_119 \"คุณสมบัติไดรฟ์ขั้นสูง\"\r\nt MSG_120 \"คุณสมบัติการฟอร์แมตขั้นสูง\"\r\nt MSG_121 \"แสดง %s\"\r\nt MSG_122 \"ซ่อน %s\"\r\nt MSG_123 \"ขนาดของ Persistent partition\"\r\nt MSG_124 \"ไม่มี Persistent\"\r\nt MSG_125 \"ตั้งค่าขนาดของพาร์ติชันสำหรับ Live USB media (ตั้งขนาดเป็น 0 เพื่อปิดการทำงานของ persistent partition)\"\r\nt MSG_126 \"ตั้งขนาดของ Persistent partition\"\r\nt MSG_127 \"อย่าแสดงข้อความนี้อีก\"\r\nt MSG_128 \"ประกาศสำคัญเกี่ยวกับ %s\"\r\nt MSG_129 \"คุณพึ่งจะสร้างมีเดียที่ใช้ UEFI:NTFS bootloader โปรดจำไว้ว่า ถ้าคุณต้องการจะบูตมีเดียนี้ คุณต้องปิด Secure Boot ก่อน\\nสำหรับคำอธิบายว่าทำไมนี่จึงจำเป็นต้องทำ ให้เข้าไปคลิกที่ปุ่ม 'ข้อมูลเพิ่มเติม' ข้างล่าง\"\r\nt MSG_130 \"เลือกไฟล์อิมเมจ Windows\"\r\nt MSG_131 \"ไฟล์ ISO นี้มีไฟล์อิมเมจ Windows อยู่หลายอิมเมจ\\nโปรดเลือกอิมเมจที่คุณต้องการใช้ในการติดตั้งครั้งนี้:\"\r\nt MSG_132 \"ไดรฟ์นี้กำลังถูกใช้งานอยู่ คุณต้องการฟอร์แมตไดรฟ์นี้หรือไม่\"\r\nt MSG_133 \"Rufus ตรวจพบว่าคุณกำลังสร้าง Windows To Go จากไฟล์ ISO เวอร์ชัน 1809\\n\\nเพราะว่า *บั๊กจากทาง Microsoft* จึงทำให้ media นี้อาจจะขึ้นหน้าจอฟ้า (BSOD) ในระหว่างการบูตเข้า Windowsได้ นอกจากว่าคุณจะเปลี่ยนไฟล์ 'WppRecorder.sys' กลับไปเป็นของเวอร์ชัน 1803\\n\\nRufus ไม่สามารถแก้ไขปัญหานี้โดยอัตโนมัติได้ เนื่องจาก ไฟล์ 'WppRecorder.sys' เป็นลิขสิทธิ์ของ Microsoft ทางเราจึงไม่สามารถใส่สำเนาของไฟล์นี้ลงมาในแอปพลิเคชันนี้ได้อย่างถูกกฎหมาย...\"\r\nt MSG_134 \"เนื่องจากพาร์ติชันถูกเซ็ตเป็น MBR และ Rufus สามารถสร้างพาร์ติชันได้มากที่สุดเพียง 2 TB ซึ่งจะเหลือพื้นที่ว่าง %s\\n\\nคุณแน่ใจว่าจะทำต่อหรือไม่\"\r\nt MSG_135 \"ระบบปฏิบัติการ\"\r\nt MSG_136 \"เวอร์ชัน\"\r\nt MSG_137 \"รุ่น\"\r\nt MSG_138 \"ภาษา\"\r\nt MSG_139 \"สถาปัตยกรรม\"\r\nt MSG_140 \"ทำต่อ\"\r\nt MSG_141 \"กลับไป\"\r\nt MSG_142 \"รอสักครู่...\"\r\nt MSG_143 \"ดาวน์โหลดโดยใช้เบราว์เซอร์\"\r\nt MSG_144 \"ไม่สามารถดาวน์โหลดไฟล์ Windows ได้ เนื่องจาก Microsoft ได้ทำการปรับเว็บไซต์เพื่อป้องกันเอาไว้ - โปรดลองใหม่ในภายหลัง...\"\r\nt MSG_145 \"ต้องใช้ PowerShell 3.0 หรือใหม่กว่านั้นในการรันสคริปต์นี้\"\r\nt MSG_146 \"คุณต้องการเชื่อมต่อออนไลน์ แล้วดาวน์โหลดหรือไม่\"\r\nt MSG_148 \"กำลังเรียกใช้สคริปต์ดาวน์โหลด...\"\r\nt MSG_149 \"ดาวน์โหลดอิมเมจ ISO\"\r\nt MSG_150 \"รูปแบบของเครื่องคอมพิวเตอร์ที่คุณจะนำไดรฟ์บูตไปใช้ ซึ่งคุณจะต้องทราบว่าเครื่องเป้าหมายมีรูปแบบการบูตเป็นแบบ BIOS หรือ UEFI หากเลือกผิดรูปแบบจะส่งผลให้ไม่สามารถบูตด้วยไดรฟ์นี้ได้\"\r\nt MSG_151 \"'UEFI-CSM' หมายถึงอุปกรณ์คุณจะสามารถบูตในโหมด BIOS emulation (Legacy Mode) ภายใต้ระบบ UEFI โดยต้องไม่ใช่แบบ Native UEFI\"\r\nt MSG_152 \"'non CSM' หมายถึงอุปกรณ์คุณจะสามารถบูตในโหมด Native UEFI โดยที่ไม่ใช่ BIOS emulation หรือ Legacy Mode\"\r\nt MSG_153 \"รูปแบบการทดสอบ: 0x%02X\"\r\nt MSG_154 \"รูปแบบการทดสอบ: 0x%02X, 0x%02X\"\r\nt MSG_155 \"รูปแบบการทดสอบ: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"รูปแบบการทดสอบ: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"เลือกระบบไฟล์\"\r\nt MSG_158 \"ขนาดที่เก็บข้อมูลที่น้อยที่สุดต่อไฟล์ที่ระบบไฟล์จะจัดสรรให้\"\r\nt MSG_159 \"กรอกชื่อไดรฟ์แบบกำหนดเองในช่องนี้ ตัวอักษรสากลสามารถใช้ได้\"\r\nt MSG_160 \"เปิด/ปิดตัวเลือกขั้นสูง\"\r\nt MSG_161 \"ตรวจสอบข้อบกพร่องของอุปกรณ์โดยใช้รูปแบบการทดสอบต่างๆ\"\r\nt MSG_162 \"ไม่ต้องเลือกตัวเลือกนี้หากต้องการฟอร์แมตแบบ \\\"ช้า\\\"\"\r\nt MSG_163 \"ระบบพาร์ติชันที่จะสร้าง\"\r\nt MSG_164 \"วิธีการทำไดรฟ์บูต\"\r\nt MSG_165 \"คลิกเพื่อเลือก หรือดาวน์โหลดอิมเมจไฟล์...\"\r\nt MSG_166 \"เลือกตัวเลือกนี้เพื่อสร้างไฟล์ autorun.inf สำหรับตั้งชื่อไดรฟ์ด้วยอักขระสากล และเพิ่มไอคอนกราฟฟิคให้กับไดรฟ์\"\r\nt MSG_167 \"ติดตั้ง UEFI bootloader ซึ่งจะมีการตรวจสอบมีเดียด้วย MD5Sum\"\r\nt MSG_169 \"สร้างพาร์ติชันเพิ่มเติม และพยายามจัดพาร์ติชัน\\nวิธีนี้จะช่วยให้ BIOS รุ่นเก่าสามารถตรวจพบอุปกรณ์ได้ดีขึ้น\"\r\nt MSG_170 \"เปิดให้แสดงรายชื่อ USB Hard Drive ทั้งหมด (มีความเสี่ยง โปรดระมัดระวัง!!!)\"\r\nt MSG_171 \"กำลังเริ่มต้นฟอร์แมต\\nข้อมูลทั้งหมดบนอุปกรณ์ที่เลือกจะถูกลบทิ้ง\"\r\nt MSG_172 \"ใบรับรองดิจิทัลของการดาวน์โหลดไม่ถูกต้อง\"\r\nt MSG_173 \"คลิกเพื่อเลือกไฟล์อิมเมจ...\"\r\nt MSG_174 \"Rufus - ยูทิลิตี้การฟอร์แมต USB ที่ไว้ใจได้\"\r\nt MSG_175 \"เวอร์ชัน %d.%d (Build %d)\"\r\nt MSG_176 \"แปลไทยโดย:\\\\line\\n• Sippapas Wangsri <mailto:sippapas_w@cmu.ac.th>\\\\line\\n• Suttirak Mattayawerakiat <mailto:raksuttirak2@gmail.com>\"\r\nt MSG_177 \"รายงานข้อบกพร่อง หรือแนะนำข้อเสนอแนะได้ที่:\"\r\nt MSG_178 \"ลิขสิทธิ์เพิ่มเติม:\"\r\nt MSG_179 \"นโยบายการอัพเดต:\"\r\nt MSG_180 \"เมื่อคุณอนุญาตให้โปรแกรมตรวจหาอัพเดต ถือว่าคุณยอมรับว่าข้อมูลต่อไปนี้จะถูกส่งให้แก่เซิร์ฟเวอร์:\"\r\nt MSG_181 \"สถาปัตยกรรมและเวอร์ชันของระบบปฏิบัติการของคุณ\"\r\nt MSG_182 \"เวอร์ชันของโปรแกรมที่คุณใช้\"\r\nt MSG_183 \"IP address ของคุณ\"\r\nt MSG_184 \"เพื่อจุดประสงค์ในการจัดทำสถิติ เราอาจเก็บข้อมูลดังกล่าว \\\\b ไว้เป็นระยะเวลาหนึ่ง\\\\b0 อย่างไรก็ตาม เราไม่มีนโยบายในการเปิดเผยข้อมูลของท่านให้แก่บุคคลที่สาม\"\r\nt MSG_185 \"กระบวนการการอัพเดต:\"\r\nt MSG_186 \"Rufus ไม่ได้ติดตั้ง service ที่ทำงานในพื้นหลัง ดังนั้นการตรวจสอบอัพเดตจะเกิดขึ้นก็ต่อเมื่อมีการเปิดโปรแกรมเท่านั้น\\\\line\\nการเชื่อมต่ออินเทอร์เน็ตมีความจำเป็นที่จะทำการอัพเดต\"\r\nt MSG_187 \"อิมเมจสำหรับตัวเลือกการบูตไม่ถูกต้อง\"\r\nt MSG_188 \"อิมเมจปัจจุบันไม่ตรงกับตัวเลือกการบูตที่เลือก กรุณาเลือกอิมเมจหรือตัวเลือกการบูตใหม่\"\r\nt MSG_189 \"ไฟล์ ISO นี้ไม่รองรับกับระบบไฟล์ที่เลือก\"\r\nt MSG_190 \"ตรวจพบไดรฟ์ที่ไม่รองรับ\"\r\nt MSG_191 \"การเขียนรอบที่\"\r\nt MSG_192 \"การอ่านรอบที่\"\r\nt MSG_193 \"ดาวน์โหลด %s แล้ว\"\r\nt MSG_194 \"ไม่สามารถดาวน์โหลด %s ได้\"\r\nt MSG_195 \"กำลังใช้ไฟล์ที่ติดมาของ %s ไฟล์\"\r\nt MSG_196 \"สำคัญมาก: อุปกรณ์นี้ใช้ขนาดของเซคเตอร์ที่ไม่เป็นมาตรฐาน!!\\n\\nโดยทั่วไปไดรฟ์จะใช้ขนาดของเซคเตอร์เป็น 512 ไบต์ แต่อุปกรณ์นี้เป็น %d ไบต์หมายความว่าคุณจะไม่สามารถบูตจากอุปกรณ์นี้ได้\\nอย่างไรก็ตาม เราสามารถทดลองสร้างไดรฟ์ดังกล่าว แต่ไม่รับรองได้ว่าอุปกรณ์นั้นจะสามารถทำงานได้อย่างที่ควรเป็น\"\r\nt MSG_197 \"พบไดรฟ์ที่มีขนาดของเซคเตอร์ไม่เป็นมาตรฐาน\"\r\nt MSG_198 \"'Windows To Go' สามารถติดตั้งลงบนพาร์ติชันแบบ GPT เท่านั้นหากมีแอททริบิทต์แบบ FIXED แต่ไดรฟ์ปัจจุบันพบว่าไม่มีแอททริบิวต์แบบ FIXED\"\r\nt MSG_199 \"ฟีเจอร์นี้ไม่พร้อมใช้งานบนแพลตฟอร์มนี้\"\r\nt MSG_201 \"กำลังยกเลิก - โปรดรอสักครู่...\"\r\nt MSG_202 \"กำลังสแกนอิมเมจ...\"\r\nt MSG_203 \"การสแกนอิมเมจผิดพลาด\"\r\nt MSG_204 \"พบไฟล์ %s ที่ล้าสมัย\"\r\nt MSG_205 \"กำลังเรียกใช้อิมเมจ: %s\"\r\nt MSG_206 \"ไม่พบไฟล์ %s\"\r\nt MSG_207 \"Volume ใหม่\"\r\nt MSG_208 \"พบ %d อุปกรณ์\"\r\nt MSG_209 \"พบ %d อุปกรณ์\"\r\nt MSG_210 \"พร้อมทำงาน\"\r\nt MSG_211 \"ยกเลิกแล้ว\"\r\nt MSG_212 \"เกิดข้อผิดพลาด\"\r\nt MSG_213 \"กำลังเปิดแอปพลิเคชัน...\"\r\nt MSG_214 \"ไม่สามารถเปิดแอปพลิเคชันได้\"\r\nt MSG_215 \"เปิด %s แล้ว\"\r\nt MSG_216 \"บันทึก %s แล้ว\"\r\nt MSG_217 \"กำลังฟอร์แมต: %s\"\r\nt MSG_218 \"กำลังสร้างระบบไฟล์: แล้วเสร็จ %d จาก %d\"\r\nt MSG_219 \"ตรวจสอบระบบ NTFS: %d%%\"\r\nt MSG_220 \"กำลังฟอร์แมต (%s) - เวลาคงเหลือ %d:%02d...\"\r\nt MSG_221 \"กำลังตั้งชื่อไดรฟ์ (%s)...\"\r\nt MSG_222 \"กำลังฟอร์แมต (%s)...\"\r\nt MSG_223 \"ตรวจสอบระบบ NTFS (Checkdisk)...\"\r\nt MSG_224 \"กำลังจัดการโครงสร้าง MBR/PBR/GPT...\"\r\nt MSG_225 \"กำลังเข้าถึงดิสก์...\"\r\nt MSG_226 \"กำลังวิเคราะห์ Boot Record...\"\r\nt MSG_227 \"กำลังปิด volume ปัจจุบัน...\"\r\nt MSG_228 \"กำลังเขียนระบบ Master Boot Record...\"\r\nt MSG_229 \"กำลังเขียนระบบ Partition Boot Record...\"\r\nt MSG_230 \"กำลังคัดลอกไฟล์ DOS...\"\r\nt MSG_231 \"กำลังคัดลอกไฟล์ ISO: %s\"\r\nt MSG_232 \"ตั้งค่าการบูตระบบ Windows 7 EFI (%s)...\"\r\nt MSG_233 \"กำลังทำให้เสร็จสมบูรณ์...\"\r\nt MSG_234 \"กำลังติดตั้ง Syslinux %s...\"\r\nt MSG_235 \"พบข้อบกพร่อง: %s %d/%d - %0.2f%% (%d/%d/%d errors)\"\r\nt MSG_236 \"พบข้อบกพร่อง: กำลังทดสอบโดยรูปแบบแบบสุ่ม\"\r\nt MSG_237 \"พบข้อบกพร่อง: กำลังทดสอบโดยรูปแบบ 0x%02X\"\r\nt MSG_238 \"กำลังแบ่งพาร์ติชัน (%s)...\"\r\nt MSG_239 \"กำลังลบพาร์ติชัน (%s)...\"\r\nt MSG_240 \"ไม่สามารถตรวจความถูกต้องของไฟล์ที่ดาวน์โหลดมาได้ กรณีนี้อาจหมายถึงการตั้งค่าเครื่องของคุณผิดพลาดหรืออาจดาวน์โหลดไฟล์ที่เป็นอันตราย\\n\\nไฟล์ที่ดาวน์โหลดมาจะถูกลบทิ้ง กรุณาตรวจสอบ log file สำหรับข้อมูลเพิ่มเติม\"\r\nt MSG_241 \"กำลังดาวน์โหลด: %s\"\r\nt MSG_242 \"ไม่สามารถดาวน์โหลดไฟล์ได้\"\r\nt MSG_243 \"กำลังตรวจหาการอัพเดต Rufus...\"\r\nt MSG_244 \"การอัพเดต: ไม่สามารถเชื่อมต่ออินเทอร์เน็ต\"\r\nt MSG_245 \"การอัพเดต: ไม่สามารถหาเวอร์ชันปัจจุบันได้\"\r\nt MSG_246 \"พบ Rufus เวอร์ชันใหม่!!!\"\r\nt MSG_247 \"ไม่พบ Rufus เวอร์ชันที่ใหม่กว่า\"\r\nt MSG_248 \"Registry keys ของแอปพลิเคชันถูกลบแล้ว\"\r\nt MSG_249 \"ไม่สามารถลบ Registry Keys ของแอปพลิเคชันได้\"\r\nt MSG_250 \"เปิดใช้งาน %s แล้ว\"\r\nt MSG_251 \"ปิดใช้งาน %s แล้ว\"\r\nt MSG_252 \"ตรวจสอบขนาด\"\r\nt MSG_253 \"การตรวจหาฮาร์ดดิสก์\"\r\nt MSG_254 \"การบังคับให้ฟอร์แมตเป็น FAT32 ขนาดใหญ่\"\r\nt MSG_255 \"NoDriveTypeAutorun จะถูกลบเมื่อปิดโปรแกรม\"\r\nt MSG_256 \"การตรวจสอบไดรฟ์ปลอม\"\r\nt MSG_257 \"การรองรับ Joliet\"\r\nt MSG_258 \"การรองรับ Rock Ridge\"\r\nt MSG_259 \"การบังคับการอัพเดต\"\r\nt MSG_260 \"การบีบอัด NTFS\"\r\nt MSG_261 \"กำลังเขียนอิมเมจไฟล์: %s\"\r\nt MSG_262 \"การรองรับไฟล์ ISO\"\r\nt MSG_263 \"ใช้หน่วยของขนาดตามจริง (เช่น 1KB คือ 1024 bytes)\"\r\nt MSG_264 \"กำลังลบไดเรคทอรี่ '%s'\"\r\nt MSG_265 \"การตรวจหาดิสก์ VMWare\"\r\nt MSG_266 \"ระบบบูตคู่ UEFI/BIOS\"\r\nt MSG_267 \"กำลังใช้อิมเมจ Windows: %s\"\r\nt MSG_268 \"กำลังใช้อิมเมจ Windows...\"\r\nt MSG_269 \"เก็บบันทึกเวลา\"\r\nt MSG_270 \"ดีบัก USB\"\r\nt MSG_271 \"กำลังตรวจสอบความถูกต้องของอิมเมจ: %s\"\r\nt MSG_272 \"คำนวณความถูกต้องของอิมเมจด้วย MD5, SHA1 และ SHA256 checksums\"\r\nt MSG_273 \"เปลี่ยนภาษา\"\r\nt MSG_274 \"พบอิมเมจแบบ %s\"\r\nt MSG_275 \"อิมเมจที่คุณเลือกเป็นแบบ 'ISOHybrid' ดังนั้นจึงสามารถเขียนได้ทั้งในโหมด %s (ใช้การคัดลอกไฟล์) หรือโหมด %s (ใช้ดิสก์อิมเมจ)\\nเราแนะนำให้ใช้โหมด %s เพราะจะทำให้คุณยังสามารถได้สิทธิ์เต็มในการเข้าถึงไดรฟ์หลังจากเขียนเสร็จแล้ว\\nอย่างไรก็ตาม หากคุณพบปัญหาขณะบูต คุณสามารถลองเขียนอิมเมจนี้ใหม่อีกครั้งในโหมด %s แทน\\n\\nกรุณาเลือกรูปแบบที่คุณต้องใช้ในการเขียนอิมเมจนี้:\"\r\nt MSG_276 \"เขียนในโหมด %s (แนะนำ)\"\r\nt MSG_277 \"เขียนในโหมด %s\"\r\nt MSG_278 \"กำลังตรวจหา Process ที่ขัดแย้งกัน...\"\r\nt MSG_279 \"แบบบูตไม่ได้\"\r\nt MSG_280 \"อิมเมจไฟล์\"\r\nt MSG_281 \"%s (กรุณาเลือก)\"\r\nt MSG_282 \"การล็อค Exclusive USB Drive\"\r\nt MSG_283 \"ใบรับรองผิดพลาด\"\r\nt MSG_284 \"ไฟล์ที่ดาวน์โหลดมาไม่มีใบรับรองดิจิทัล\"\r\nt MSG_285 \"ไฟล์ที่ดาวน์โหลดมาถูกรับรองโดย '%s'.\\nซึ่งไม่ใช่การรับรองที่เรารู้จัก ซึ่งอาจจะเป็นการโจมตีได้...\\nคุณต้องการจะเปิดไฟล์นี้หรือไม่?\"\r\nt MSG_286 \"กำลังล้างไดร์ฟด้วย zero byte: %s\"\r\nt MSG_287 \"กำลังตรวจสอบไดรฟ์ที่ไม่ใช่ USB\"\r\nt MSG_288 \"ไม่มีสิทธิ์อนุญาตระดับสูง\"\r\nt MSG_289 \"แอปพลิเคชันนี้สามารถใช้งานได้เฉพาะการรันด้วยสิทธิ์อนุญาตระดับสูงเท่านั้น\"\r\nt MSG_290 \"ดรรชนีแฟ้มข้อมูล\"\r\nt MSG_291 \"การเลือกเวอร์ชัน\"\r\nt MSG_292 \"กรุณาเลือกเวอร์ชันของ Windows ที่ต้องการติดตั้ง:\"\r\nt MSG_293 \"ไม่รองรับ Windows เวอร์ชันนี้\"\r\nt MSG_294 \"เวอร์ชันของ Windows นี้ไม่ได้รับการสนับสนุนโดย Rufus อีกต่อไป\\nRufus เวอร์ชันล่าสุดที่เข้ากันได้กับแพลตฟอร์มนี้คือ v%d.%d\"\r\nt MSG_295 \"คำเตือน: เวอร์ชันที่ไม่เป็นทางการ\"\r\nt MSG_296 \"Rufus เวอร์ชันนี้ ไม่ได้ถูกพัฒนาขึ้นโดยผู้พัฒนาหลัก\\n\\nคุณต้องการเริ่มโปรแกรมหรือไม่?\"\r\nt MSG_297 \"พบไฟล์ ISO ที่ถูกตัดทอน\"\r\nt MSG_298 \"ไฟล์ ISO ที่คุณเลือกมีคุณสมบัติไม่ตรงกับที่ได้แจ้งไว้ ดังนี้ ขนาดไฟล์: ข้อมูลจำนวน %s ตัวได้หายไปจากต้นฉบับ!\\n\\nหากคุณดาวน์โหลดไฟล์นี้มาจากอินเทอร์เน็ต กรุณาดาวน์โหลดไฟล์อีกครั้ง และตรวจสอบว่าไฟล์นั้นมี MD5 หรือ SHA checksums ตรงกับเวอร์ชันทางการ\\n\\nโปรดจำไว้ว่าคุณสามารถตรวจสอบ checksum ของไฟล์ดังกล่าวได้จากโปรแกรม Rufus โดยกดปุ่ม (✓)\"\r\nt MSG_299 \"การตรวจสอบบันทึกเวลาผิดพลาด\"\r\nt MSG_300 \"Rufus ไม่สามารถยืนยันความถูกต้องของบันทึกเวลาของการอัพเดตที่เพิ่งดาวน์โหลดมาว่าใหม่กว่าเวอร์ชันที่กำลังใช้อยู่ในปัจจุบันหรือไม่\\n\\nเพื่อป้องกันความเป็นไปได้ว่านี่อาจจะเป็นการโจมตี การอัพเดตนี้จะถูกยกเลิก และลบทิ้งไป กรุณาดู Log เพื่ออ่านรายละเอียดเพิ่มเติม\"\r\nt MSG_301 \"แสดงการตั้งค่าของโปรแกรม\"\r\nt MSG_302 \"แสดงรายละเอียดของโปรแกรมนี้\"\r\nt MSG_303 \"แสดง Log\"\r\nt MSG_304 \"สร้างดิสก์อิมเมจของอุปกรณ์ที่เลือก\"\r\nt MSG_305 \"เลือกตัวเลือกนี้หากต้องการติดตั้ง Windows บนดิสก์อื่น หรือใช้งาน Windows จากไดรฟ์นี้โดยตรง (Windows To Go)\"\r\nt MSG_306 \"กำลังล้างไดรฟ์แบบรวดเร็ว: สำเร็จแล้ว: %s\"\r\nt MSG_307 \"อาจใช้เวลาสักครู่\"\r\nt MSG_308 \"การตรวจหา VHD\"\r\nt MSG_309 \"ไฟล์บีบอัด\"\r\nt MSG_310 \"ไฟล์ ISO ที่คุณเลือกใช้เป็นระบบ UEFI และมีขนาดเล็กพอที่จะเขียนเป็น EFI System Partition (ESP) การเขียนเป็น ESP แทนที่จะเป็นการเขียนเป็นพาร์ติชันแบบทั่วไปซึ่งจะใช้พื่นที่ข้อมูลไปทั้งหมด จะดีกว่าสำหรับการติดตั้งบางประเภท\\n\\nโปรดเลือกโหมดที่คุณต้องการใช้ในการเขียนอิมเมจไฟล์นี้:\"\r\nt MSG_311 \"ใช้ %s (ในหน้าต่างโปรแกรมหลัก) เพื่อเปิดการใช้งาน\"\r\nt MSG_312 \"การแฮชเพิ่มเติม (SHA-512)\"\r\nt MSG_313 \"บันทึกลง VHD\"\r\nt MSG_314 \"ตรวจสอบความถูกต้องของอิมเมจ\"\r\nt MSG_315 \"ปุ่มตั้งค่า และเพิ่มเติม\"\r\nt MSG_316 \"จำนวนรอบที่ผ่าน\"\r\nt MSG_317 \"ID ของดิสก์\"\r\nt MSG_318 \"ค่าลำดับความสำคัญเริ่มต้นของเธรด: %d\"\r\nt MSG_319 \"ละเว้นการทำ Boot Marker\"\r\nt MSG_320 \"กำลังรีเฟรชเค้าโครงพาร์ติชัน (%s)...\"\r\nt MSG_321 \"อิมเมจไฟล์ที่คุณใช้เป็นแบบ ISOHybrid แต่ผู้ผลิตไม่ได้ทำให้รองรับกับการคัดลอกไฟล์ ISO\\nนั่นทำให้โหมดการเขียนแบบ DD image writing จะถูกเรียกใช้งาน\"\r\nt MSG_322 \"ไม่สามารถเปิดหรืออ่าน '%s' ได้\"\r\nt MSG_325 \"ปรับใช้งานการปรับแต่งขั้นตอนการติดตั้ง Windows: %s\"\r\nt MSG_326 \"ปรับใช้งานการตั้งค่าของผู้ใช้...\"\r\nt MSG_327 \"โปรแกรมประสบการณ์ผู้ใช้งาน Windows\"\r\nt MSG_328 \"ต้องการปรับแต่งขั้นตอนการติดตั้ง Windows หรือไม่?\"\r\nt MSG_329 \"ยกเลิกการตรวจสอบ: แรมขนาด 4 GB ขึ้นไป, Secure Boot และ TPM 2.0\"\r\nt MSG_330 \"ยกเลิกการบังคับใช้บัญชี Microsoft\"\r\nt MSG_331 \"ยกเลิกการเก็บข้อมูลผู้ใช้ (ข้ามคำถามเกี่ยวกับความเป็นส่วนตัว)\"\r\nt MSG_332 \"ป้องกันไม่ให้ Windows To Go เข้าถึงข้อมูลดิสก์ภายใน\"\r\nt MSG_333 \"สร้างบัญชีผู้ใช้ด้วยชื่อผู้ใช้:\"\r\nt MSG_334 \"ตั้งค่าภูมิภาคให้ตรงกับค่าที่ใช้บนคอมพิวเตอร์เครื่องนี้\"\r\nt MSG_335 \"ยกเลิกการใช้ BitLocker เข้ารหัสอุปกรณ์อัตโนมัติ\"\r\nt MSG_336 \"Log แบบถาวร\"\r\nt MSG_337 \"มีความจำเป็นต้องดาวน์โหลดไฟล์ ('%s') จาก Microsoft เพื่อใช้ฟีเจอร์นี้:\\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n- เลือก 'No' เพื่อยกเลิก\\n\\nหมายเหตุ: ไฟล์ใหม่จะถูกจัดเก็บในโฟลเดอร์ปัจจุบัน และเมื่อไฟล์ '%s มีแล้ว ไฟล์จะถูกเลือกใช้โดยอัตโนมัติ\"\r\nt MSG_338 \"ตรวจพบ UEFI bootloader ที่ถูกเพิกถอน\"\r\nt MSG_339 \"Rufus ตรวจพบว่าไฟล์ ISO ที่คุณเลือกมี UEFI bootloader ที่ถูกเพิกถอน ซึ่งตุณอาจจะเจอกับ%s เมื่อ SecureBoot เปิดใช้งานบนระบบ UEFI ที่ทันสมัย\\n\\n- ถ้าคุณได้ไฟล์ ISO นี้มาจากแหล่งที่ไม่น่าเชื่อถือ คุณควรตระหนักถึงความเป็นไปได้ที่ไฟล์ดังกล่าวอาจมี UEFI malware และหลีกเลี่ยงการบูตจากอิมเมจดังกล่าว\\n- ถ้าคุณได้ไฟล์ ISO นี้มาจากแหล่งที่เชื่อถือได้ คุณควรพยายามค้นหาเวอร์ชันที่ทันสมัยกว่านี้ ซึ่งจะไม่ทำให้เกิดคำเตือนนี้\"\r\nt MSG_340 \"หน้าจอ \\\"Security Violation\\\"\"\r\nt MSG_341 \"หน้าจอ Windows Recovery (จอฟ้า; BSOD) พร้อมกับ '%s'\"\r\nt MSG_342 \"อิมเมจ VHDX ที่ถูกบีบอัด\"\r\nt MSG_343 \"อิมเมจ VHDX ที่ไม่บีบอัด\"\r\nt MSG_345 \"มีความจำเป็นต้องดาวน์โหลดข้อมูลเพิ่มเติมจาก Microsoft เพื่อใช้งานฟังก์ชั่นนี้:\\n- เลือก 'Yes' เพื่อดาวน์โหลดไฟล์ผ่านอินเทอร์เน็ต\\n- เลือก 'No' เพื่อยกเลิก\"\r\nt MSG_346 \"จำกัด Windows ให้อยู่ใน S-Mode (ไม่รองรับการยกเลิกการบังคับใช้บัญชี Microsoft)\"\r\nt MSG_347 \"โหมดผู้เชี่ยวชาญ\"\r\nt MSG_348 \"กำลังแตกไฟล์: %s\"\r\nt MSG_349 \"Rufus MBR\"\r\nt MSG_900 \"Rufus คือ โปรแกรมที่ช่วยฟอร์แมต และสร้างไดรฟ์บูต USB จาก USB keys, pendrives, memory sticks เป็นต้น\"\r\nt MSG_901 \"เว็บไซต์ทางการ: %s\"\r\nt MSG_902 \"ซอร์สโค้ด: %s\"\r\nt MSG_903 \"บันทึกการเปลี่ยนแปลง: %s\"\r\nt MSG_904 \"แอปพลิเคชันนี้ได้รับอนุญาตภายใต้เงื่อนไขของ GNU Public License (GPL) เวอร์ชัน 3\\nดูรายละเอียดได้ที่ https://www.gnu.org/licenses/gpl-3.0.html\"\r\nt MSG_910 \"ฟอร์แมต USB, แฟลชการ์ด หรือไดรฟ์เสมือน ให้อยู่ในรูปแบบของ FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"สร้าง USB ไดรฟ์บูตสำหรับระบบ FreeDOS\"\r\nt MSG_912 \"สร้าง USB ไดรฟ์บูตจากไฟล์ ISO ที่บูตได้ (เช่น ไฟล์ติดตั้ง Windows หรือ Linux เป็นต้น)\"\r\nt MSG_913 \"สร้างไดรฟ์บูตจากดิสก์อิมเมจที่บูตได้ (รองรับไฟล์ดิสก์อิมเมจที่ถูกบีบอัด)\"\r\nt MSG_914 \"สร้างไดรฟ์บูตสำหรับระบบ BIOS หรือ UEFI และ UEFI bootable NTFS\"\r\nt MSG_915 \"สร้างไดรฟ์ของ 'Windows To Go'\"\r\nt MSG_916 \"สร้างไดรฟ์ติดตั้ง Windows 11 สำหรับคอมพิวเตอร์ที่ไม่มี TPM หรือ Secure Boot\"\r\nt MSG_917 \"สร้าง Linux partition แบบ persistent\"\r\nt MSG_918 \"สร้างอิมเมจไฟล์แบบ VHD/DD จากไดรฟ์ที่เลือก\"\r\nt MSG_919 \"คำนวณรหัส MD5, SHA-1, SHA-256, SHA-512 ของไฟล์อิมเมจที่เลือก\"\r\nt MSG_920 \"ตรวจสอบจุดบกพร่อง รวมไปถึงการทดสอบแฟลชไดรฟ์ว่าเป็น \\\"ของปลอม\\\" หรือไม่\"\r\nt MSG_921 \"ดาวน์โหลดไฟล์ ISO ของ Microsoft Windows จากเว็บไซต์ทางการของ Microsoft\"\r\nt MSG_922 \"ดาวน์โหลดไฟล์ ISO ของ UEFI Shell\"\r\n\r\n#########################################################################\r\nl \"tr-TR\" \"Turkish (Türkçe)\" 0x041F\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Rufus Hakkında\"\r\nt IDC_ABOUT_LICENSE \"Lisans\"\r\nt IDOK \"Tamam\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Sürücü Özellikleri\"\r\nt IDS_DEVICE_TXT \"Aygıt\"\r\nt IDS_BOOT_SELECTION_TXT \"Önyükleme seçimi\"\r\nt IDC_SELECT \"Seç\"\r\nt IDS_IMAGE_OPTION_TXT \"Yansı Seçeneği\"\r\nt IDS_PARTITION_TYPE_TXT \"Disk bölüm düzeni\"\r\nt IDS_TARGET_SYSTEM_TXT \"Hedef sistem\"\r\nt IDC_LIST_USB_HDD \"USB Sabit Sürücüleri Listele\"\r\nt IDC_OLD_BIOS_FIXES \"Eski BIOSlar için düzeltme ekle (ekstra bölüm, hizalama vs.)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Çalışma zamanı UEFI ortam doğrulamasını etkinleştir\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Biçimlendirme Seçenekleri\"\r\nt IDS_FILE_SYSTEM_TXT \"Dosya sistemi\"\r\nt IDS_CLUSTER_SIZE_TXT \"Ayırma Birimi boyutu\"\r\nt IDS_LABEL_TXT \"Yeni birim etiketi\"\r\nt IDC_QUICK_FORMAT \"Hızlı biçimlendir\"\r\nt IDC_BAD_BLOCKS \"Hatalı bloklar için aygıtı denetle\"\r\nt IDC_EXTENDED_LABEL \"Genişletilmiş etiket ve simge dosyaları oluştur\"\r\nt IDS_STATUS_TXT \"Durum\"\r\nt IDCANCEL \"Kapat\"\r\nt IDC_START \"Başlat\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Kapat\"\r\nt IDD_LICENSE \"Rufus Lisansı\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Kapat\"\r\nt IDD_LOG \"Günlük\"\r\nt IDC_LOG_CLEAR \"Temizle\"\r\nt IDC_LOG_SAVE \"Kaydet\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Kapat\"\r\nt IDD_NEW_VERSION \"Güncellemeleri Denetle - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Yeni bir sürüm mevcut. Lütfen son sürümü indirin!\"\r\nt IDC_WEBSITE \"Web sitesine gitmek için buraya tıklayın\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Sürüm Notları\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"İndir\"\r\nt IDC_DOWNLOAD \"İndir\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Daha fazla bilgi\"\r\nt IDYES \"Evet\"\r\nt IDNO \"Hayır\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Kapat\"\r\nt IDD_UPDATE_POLICY \"Güncelleme ilkesi ve ayarlar\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Ayarlar\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Güncellemeleri denetle\"\r\nt IDS_INCLUDE_BETAS_TXT \"Beta sürümlerini içersin\"\r\nt IDC_CHECK_NOW \"Şimdi Denetle\"\r\n\r\nt MSG_001 \"Rufus'un zaten çalıştığı algılandı\"\r\nt MSG_002 \"Başka bir Rufus uygulaması çalışıyor.\\nLütfen başka bir uygulama çalıştırmak için ilkini kapatın.\"\r\nt MSG_003 \"UYARI: '%s' AYGITINDAKİ TÜM VERİ YOK EDİLECEK.\\nİşleme devam etmek için TAMAM'a tıklayın. Çıkmak için İPTAL'e tıklayın.\"\r\nt MSG_004 \"Rufus güncelleme ilkesi\"\r\nt MSG_005 \"Rufus'un uygulama güncellemelerini çevrimiçi denetlemesine izin vermek istiyor musunuz?\"\r\nt MSG_006 \"Kapat\"\r\nt MSG_007 \"Vazgeç\"\r\nt MSG_008 \"Evet\"\r\nt MSG_009 \"Hayır\"\r\nt MSG_010 \"Hatalı bloklar bulundu\"\r\nt MSG_011 \"Denetim Tamamlandı: %d hatalı blok bulundu\\n  %d okuma hatası\\n  %d yazma hatası\\n  %d hata oluşumu\"\r\nt MSG_012 \"%s\\nDaha ayrıntılı rapor burada:\\n%s\"\r\nt MSG_013 \"Devre dışı\"\r\nt MSG_014 \"Günlük\"\r\nt MSG_015 \"Haftalık\"\r\nt MSG_016 \"Aylık\"\r\nt MSG_017 \"Özel\"\r\nt MSG_018 \"Mevcut sürüm: %d.%d (Yapı %d)\"\r\nt MSG_019 \"En son sürüm: %d.%d (Yapı %d)\"\r\nt MSG_020 \"byte\"\r\nt MSG_026 \"byte\"\r\nt MSG_027 \"kilobyte\"\r\nt MSG_028 \"megabyte\"\r\nt MSG_029 \"Varsayılan\"\r\nt MSG_030 \"%s (Varsayılan)\"\r\nt MSG_031 \"BIOS (ya da UEFI-CSM)\"\r\nt MSG_032 \"UEFI (CSM yok)\"\r\nt MSG_033 \"BIOS ya da UEFI\"\r\nt MSG_034 \"%d geçiş\"\r\nt MSG_035 \"%d geçiş %s\"\r\nt MSG_036 \"ISO Yansısı\"\r\nt MSG_037 \"Uygulama\"\r\nt MSG_038 \"Vazgeç\"\r\nt MSG_039 \"Başlat\"\r\nt MSG_040 \"İndir\"\r\nt MSG_041 \"Kullanıcı tarafından işlemden vazgeçildi\"\r\nt MSG_042 \"Hata\"\r\nt MSG_043 \"Hata: %s\"\r\nt MSG_044 \"Dosya indirme\"\r\nt MSG_045 \"USB Depolama Aygıtı (Genel)\"\r\nt MSG_047 \"Çoklu Disk Birimleri\"\r\nt MSG_048 \"Rufus - Tamponlanıyor\"\r\nt MSG_049 \"Rufus - İptal\"\r\nt MSG_050 \"Başarılı.\"\r\nt MSG_051 \"Biçimlendirilirken beklenmeyen hata.\"\r\nt MSG_052 \"Seçilen dosya sistemi bu medya için kullanılamaz.\"\r\nt MSG_053 \"Aygıta erişim engellendi.\"\r\nt MSG_054 \"Medya yazma korumalı.\"\r\nt MSG_055 \"Aygıt başka bir işlem tarafından kullanılıyor. Lütfen aygıta erişilebilmesi için diğer işlemi kapatın.\"\r\nt MSG_056 \"Bu aygıt için Hızlı Biçimlendirme yapılamaz.\"\r\nt MSG_057 \"Birim etiketi geçersiz.\"\r\nt MSG_058 \"Aygıt tanıtıcısı geçersiz.\"\r\nt MSG_059 \"Seçilen ayırma boyutu bu aygıt için geçerli değil.\"\r\nt MSG_060 \"Birim boyutu geçersiz.\"\r\nt MSG_061 \"Lütfen sürücüdeki kaldırılabilir medyayı takın.\"\r\nt MSG_062 \"Destelenmeyen bir komut alındı.\"\r\nt MSG_063 \"Bellek ayırma hatası.\"\r\nt MSG_064 \"Okuma Hatası.\"\r\nt MSG_065 \"Yazma Hatası.\"\r\nt MSG_066 \"Yükleme Hatası\"\r\nt MSG_067 \"Medya açılamadı. Başka bir işlem tarafından kullanılıyor olabilir. Lütfen medyayı yeniden takın ve deneyin.\"\r\nt MSG_068 \"Sürücü bölümlenemedi.\"\r\nt MSG_069 \"Dosyalar hedef sürücüye kopyalanamadı.\"\r\nt MSG_070 \"Kullanıcı tarafından vazgeçildi.\"\r\nt MSG_071 \"İş parçacığı başlatılamadı.\"\r\nt MSG_072 \"Hatalı blokların denetimi tamamlanamadı.\"\r\nt MSG_073 \"ISO yansısı taranamadı.\"\r\nt MSG_074 \"ISO yansısı ayrıştırma hatası.\"\r\nt MSG_075 \"Birim yeniden yerleştirilemedi.\"\r\nt MSG_076 \"Açılış için dosyalar yamalanamadı/kurulamadı.\"\r\nt MSG_077 \"Sürücü harfi atanamadı.\"\r\nt MSG_078 \"GUID birimi yerleştirilemedi.\"\r\nt MSG_079 \"Aygıt hazır değil.\"\r\nt MSG_080 \"Rufus Windows'un USB aygıtını kendi işlemlerinde hala kullandığını algıladı.\\n\\nUSB aygıtınızın hızına bağlı olarak, bu işlemin tamamlanması özellikle büyük dosyalar için, uzun bir süre alabilir.\\n\\nBozulmayı önlemek için Windows'un işini bitirmesine izin vermenizi öneriyoruz. Fakat beklemekten yorulduysanız, yalnız aygıtı çıkarabilirsiniz...\"\r\nt MSG_081 \"Desteklenmeyen yansı\"\r\nt MSG_082 \"Bu yansı ya önyüklenebilir değil ya da Rufus tarafından desteklenmeyen bir önyükleme veya bir sıkıştırma yöntemi kullanıyor...\"\r\nt MSG_083 \"%s yer değiştirilsin mi?\"\r\nt MSG_084 \"Bu ISO yansısı eski bir '%s' sürümünü kullanıyor gibi görünüyor.\\nAçılış menüsü bundan dolayı düzgün görüntülenmeyebilir.\\n\\nBu durumu düzeltmek için yeni sürümü Rufus tarafından indirilebilir:\\n- İnternete bağlanıp dosyayı indirmek için 'Evet'i seçin\\n- Varolan ISO dosyasını olduğu gibi bırakmak için 'Hayır'ı seçin\\nNe yapacağınızı bilmiyorsanız, 'Evet'i seçmelisiniz.\\n\\nNot: Yeni dosya mevcut dizine indirilecek ve '%s' orada var olunca, otomatik olarak kullanılacak.\"\r\nt MSG_085 \"%s indiriliyor\"\r\nt MSG_086 \"Yansı seçilmedi\"\r\nt MSG_087 \"%s NAND için\"\r\nt MSG_088 \"Yansı boyutu çok büyük\"\r\nt MSG_089 \"Seçilen yansı boyutu hedef için çok büyük.\"\r\nt MSG_090 \"Desteklenmeyen ISO\"\r\nt MSG_091 \"EFI Hedef Türünü kullanıyorken, sadece EFI açılabilir ISO yansıları desteklenir. Lütfen bir EFI açılabilir ISO'su seçin ya da Hedef Türünü BIOS'a ayarlayın.\"\r\nt MSG_092 \"Desteklenmeyen Dosya Sistemi\"\r\nt MSG_093 \"ÖNEMLİ: BU SÜRÜCÜ ÇOKLU DİSK BÖLÜMÜ İÇERİYOR!!\\n\\nListelenmeyen ya da Windows'un göremediği disk bölümü/birimi içeriyor olabilir. İşlem yapmayı tercih ederseniz, bu disk bölümlerindeki herhangi bir veri kaybında sorumluluğu kabul etmiş olursunuz.\"\r\nt MSG_094 \"Çoklu disk bölümü algılandı\"\r\nt MSG_095 \"DD Yansısı\"\r\nt MSG_096 \"Mevcut seçili dosya sistemi bu ISO türüyle kullanılamaz. Lütfen farklı bir dosya sistemi seçin ya da farklı bir ISO kullanın.\"\r\nt MSG_097 \"'%s' sadece dosya sistemi NTFS ise uygulanabilir.\"\r\nt MSG_098 \"ÖNEMLİ: 'Windows To Go' yüklemeye çalışıyorsunuz, fakat hedef sürücünüz 'SABİT' niteliğinde bir disk değil. Bundan dolayı Windows, ön yükleme sırasında büyük olasılıkla donacaktır. Microsoft, bunu 'KALDIRILABİLİR' nitelikteki sürücüler ile çalışmak üzere tasarlamamıştır.\\n\\nYine de devam etmek istiyor musunuz?\\n\\nNot: 'SABİT/KALDIRILABİLİR' niteliği, disk üreticileri tarafından özel araçlar kullanılarak değiştirilebilen bir donanım özelliğidir. Fakat bu araçlar genellikle herkese açık olarak paylaşılmaz...\"\r\nt MSG_099 \"Dosya Sistemi Sınırlandırması\"\r\nt MSG_100 \"Bu ISO yansısı, FAT ya da FAT32 dosya sisteminin desteklediği en fazla boyut olan 4 GB'tan daha büyük bir dosya içeriyor.\"\r\nt MSG_101 \"Eksik WIM desteği\"\r\nt MSG_102 \"Platformunuz WIM arşivlerinden dosyaları ayrıştıramaz. WIM ayrıştırması EFI açılabilir Windows 7 ve Windows Vista USB sürücüleri oluşturmak için gereklidir. Bu durumu 7-Zip son sürümünü yükleyerek aşabilirsiniz.\\n7-zip indirme sayfasına gitmek istiyor musunuz?\"\r\nt MSG_103 \"%s indirilsin mi?\"\r\nt MSG_104 \"%s ya da daha üstünün yüklenebilmesi için '%s' dosyası gerekir.\\nÇünkü bu dosyanın boyutu 100 KB tan daha büyüktür ve %s ISO yansılarında mutlaka bulunur, Rufus'a gömülü değildir.\\n\\nRufus eksik dosyayı sizin için indirebilir:\\n- İnternete bağlanıp dosyayı indirmek için 'Evet'i seçin\\n- Dosyayı daha sonra sürücüye elle kopyalamak istiyorsanız 'Hayır'ı seçin\\n\\nNot: Dosya mevcut dizine indirilecek ve '%s' orda var olunca, otomatik olarak kullanılacak.\"\r\nt MSG_105 \"Vazgeçmek aygıtı KULLANILAMAZ hale getirebilir.\\nVazgeçmek istediğinize eminseniz, EVET'e tıklayın. Aksi halde HAYIR'a tıklayın.\"\r\nt MSG_106 \"Lütfen klasör seçin\"\r\nt MSG_107 \"Tüm Dosyalar\"\r\nt MSG_108 \"Rufus günlüğü\"\r\nt MSG_110 \"MS-DOS, 64 kilobyte Ayırma Birimi Boyutu kullanan bir sürücüden başlatılamaz.\\nLütfen farklı bir Ayırma Birimi Boyutu seçin ya da FreeDOS kullanın.\"\r\nt MSG_111 \"Uyumsuz Ayırma Boyutu\"\r\nt MSG_112 \"Geniş bir UDF Biriminin biçimlendirilmesi çok uzun bir süre alabilir. USB 2.0 hızında, Tahmini biçimlendirme süresi %d:%02d, İlerleme çubuğu donmuş görünüyorken. Lütfen sabırlı olun!\"\r\nt MSG_113 \"Geniş UDF birimi\"\r\nt MSG_114 \"Bu yansı Syslinux %s%s kullanıyor fakat bu uygulama yalnız Syslinux %s%s için yükleme dosyalarını içeriyor.\\n\\nSyslinux'un yeni sürümleri bir başkasıyla uyumlu olmadığından ve Rufus'un bunların tamamını içermesi mümkün olmadığından, iki ek dosyanın('ldlinux.sys' ve 'ldlinux.bss') internet üzerinden indirilmesi gerekli:\\n- İnternete bağlanıp bu dosyaları indirmek için 'Evet'i seçin\\n- İşlemden vazgeçmek için 'Hayır'ı seçin\\n\\nNot: Dosyalar mevcut uygulama dizinine indirilecek ve hazır olduğunda otomatik olarak kullanılacak.\"\r\nt MSG_115 \"İndirme gerekli\"\r\nt MSG_116 \"Bu yansı Grub %s kullanıyor fakat bu uygulama yalnız Grub %s için yükleme dosyalarını içeriyor.\\n\\nGrub 'un yeni sürümleri bir başkasıyla uyumlu olmadığından ve Rufus'un bunların tamamını içermesi mümkün olmadığından, Rufus yansısıyla eşleşen Grub'un bir yükleme dosyasını ('core.img') edinmeyi çalışacak:\\n- İnternete bağlanıp bu dosyaları indirmek için 'Evet'i seçin\\n- Rufustan varsayılan sürümü kullanmak için 'Hayır''ı seçin\\n- İşlemden vazgeçmek için 'Vazgeç'i seçin\\n\\nNot: Dosyalar mevcut uygulama dizinine indirilecek ve hazır olduğunda otomatik olarak kullanılacak. Çevrimiçi bulunanlar eşleşmiyorsa varsayılan sürüm kullanılacak.\"\r\nt MSG_117 \"Standart Windows yüklemesi\"\r\nt MSG_119 \"gelişmiş sürücü özellikleri\"\r\nt MSG_120 \"gelişmiş biçimlendirme seçenekleri\"\r\nt MSG_121 \"%sni göster\"\r\nt MSG_122 \"%sni gizle\"\r\nt MSG_123 \"Kalıcı disk bölümü boyutu\"\r\nt MSG_124 \"Kalıcı bölüm yok\"\r\nt MSG_125 \"Canlı USB ortamı için kalıcı disk bölümünün boyutunu ayarlayın. Boyutu 0 olarak ayarlamak, kalıcı bölümü devre dışı bırakır.\"\r\nt MSG_126 \"Disk bölümü boyutu birimlerini ayarlayın.\"\r\nt MSG_127 \"Bu iletiyi bir daha gösterme\"\r\nt MSG_128 \"%s hakkında önemli not\"\r\nt MSG_129 \"Az önce UEFI:NTFS önyükleyicisini kullanan bir ortam yarattınız. Lütfen, bu ortamı önyükleyebilmek için GÜVENLİ BOOT'U DEVRE DIŞI BIRAKMANIZ gerektiğini unutmayın.\\nBunun neden gerekli olduğu hakkında ayrıntılar için aşağıdaki 'Daha Fazla Bilgi' düğmesine bakın.\"\r\nt MSG_130 \"Windows yansı seçimi\"\r\nt MSG_131 \"Bu ISO birden çok Windows iyansısı içeriyor.\\nLütfen bu yükleme için kullanmak istediğiniz yansıyı seçin:\"\r\nt MSG_132 \"Başka bir program ya da işlem bu sürücüye erişiyor. Yine de biçimlendirmek ister misiniz?\"\r\nt MSG_133 \"Rufus, 1809 ISO tabanlı bir Windows To Go ortamı oluşturmaya çalıştığınızı algıladı.\\n\\nBir *MICROSOFT HATASI* nedeniyle, 'WppRecorder.sys' dosyasını 1803 sürümüyle el ile değiştirmediğiniz sürece, bu medya Windows açılışında (Ölü Mavi Ekran) çökecektir.\\n\\nAyrıca, Rufus'un bunu sizin için otomatik olarak çözememesinin nedeninin 'WppRecorder.sys' dosyasının Microsoft'un telif hakkı olan bir dosya olduğunu ve bu nedenle dosyanın yasal olarak bir kopyasını uygulamaya koyamayacağımızı unutmayın...\"\r\nt MSG_134 \"MBR, bölüm şeması için seçildiğinden, Rufus bu ortam üzerinde yalnızca 2 TB'a kadar bölüm oluşturabilir ve bu da %s disk alanını kullanılamaz duruma getirir.\\n\\nDevam etmek istediğine emin misin?\"\r\nt MSG_135 \"Sürüm\"\r\nt MSG_136 \"Yayın\"\r\nt MSG_137 \"Yapı\"\r\nt MSG_138 \"Dil\"\r\nt MSG_139 \"Mimari\"\r\nt MSG_140 \"Sürdür\"\r\nt MSG_141 \"Geri\"\r\nt MSG_142 \"Lütfen Bekleyin...\"\r\nt MSG_143 \"Web tarayıcı kullanarak indir\"\r\nt MSG_144 \"Windows ISO'larının indirilmesi, Microsoft'un web sitesini bunu engelleyecek şekilde değiştirmesi nedeniyle kullanılamıyor.\"\r\nt MSG_145 \"Bu komutu çalıştırmak için PowerShell 3.0 veya üstü gerekir.\"\r\nt MSG_146 \"Çevrimiçi olarak indirmek istiyor musunuz?\"\r\nt MSG_148 \"İndirme komutu çalıştırılıyor...\"\r\nt MSG_149 \"ISO yansısı İndir\"\r\nt MSG_150 \"Bu önyüklenebilir sürücüyü kullanmayı planladığınız bilgisayarın türü. Sürücüyü oluşturmaya başlamadan önce hedefinizin BIOS ya da UEFI türü olup olmadığını belirlemek sizin sorumluluğunuzdur. Aksi halde önyükleme yapamayabilir.\"\r\nt MSG_151 \"'UEFI-CSM', cihazın yerel UEFI modunda değil, yalnız BIOS öykünme modunda ('Legacy Mode' olarak da bilinir) önyükleme yapacağı anlamına gelir.\"\r\nt MSG_152 \"'CSM yok', aygıtın BIOS'a öykünme modunda değil de ('Legacy Mode' olarak da bilinir) yalnızca yerel UEFI modunda önyükleme yapacağı anlamına gelir.\"\r\nt MSG_153 \"Deneme Düzeni: 0x%02X\"\r\nt MSG_154 \"Deneme Düzeni: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Deneme Düzeni: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Deneme Düzeni: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Hedef Dosya Sistemini Ayarlar\"\r\nt MSG_158 \"Dosya sisteminde tutulacak en küçük veri bloğu boyutu\"\r\nt MSG_159 \"Bu alanı sürücü etiketini ayarlamak için kullanın.\\nUluslararası karakterler kabul edilir.\"\r\nt MSG_160 \"Gelişmiş seçeneklere geçiş\"\r\nt MSG_161 \"Kalıp denemesi kullanarak hatalı blokları denetle\"\r\nt MSG_162 \"\\\"Yavaş\\\" biçimlendirme yöntemini kullanmak için bu onay kutusu seçimini kaldırın\"\r\nt MSG_163 \"Bölümleri oluşturmak için kullanılacak yöntem\"\r\nt MSG_164 \"Sürücüyü açılabilir yapmak için kullanılacak yöntem\"\r\nt MSG_165 \"Yansı seçmek ya da indirmek için tıklayın...\"\r\nt MSG_166 \"Uluslararası etiketleri görüntülemek için bu onay kutusunu seçin ve aygıt simgesini belirleyin (autorun.inf oluşturur)\"\r\nt MSG_167 \"Medyanın MD5Sum dosya doğrulamasını gerçekleştirecek bir UEFI önyükleyici yükleyin\"\r\nt MSG_169 \"Ekstra gizli bir bölüm oluşturur ve bölümlerin sınırlarını hizalamaya çalışır.\\nBu işlem eski BIOSlar için açılış algılamasını geliştirir.\"\r\nt MSG_170 \"USB sabit sürücü eklerini listelemeyi etkinleştirir. SORUMLULUK SİZE AİTTİR!!!\"\r\nt MSG_171 \"Biçimlendirme işlemini başlat.\\nBu hedef üzerinde tüm veriyi yok edecek!\"\r\nt MSG_172 \"Geçersiz indirme imzası\"\r\nt MSG_173 \"Seçmek için tıklayın...\"\r\nt MSG_174 \"Rufus - Güvenilir USB Biçimlendirme Programı\"\r\nt MSG_175 \"Sürüm %d.%d (Yapı %d)\"\r\nt MSG_176 \"Türkçe Çeviri:\\\\line• Mehmetali KURAN <mailto:mehmetalikuran@gmail.com>\\\\line• İlhami TUĞRAL <mailto:ilhamitugral@gmail.com>\"\r\nt MSG_177 \"Hataları ya da geliştirme isteklerini buraya raporlayın:\"\r\nt MSG_178 \"Ek Telif Hakları:\"\r\nt MSG_179 \"Güncelleme İlkesi:\"\r\nt MSG_180 \"Programa güncellemelerini denetlemesi için izin vermeyi seçerseniz, aşağıdaki bilgilerin sunucu(lar)ımızda depolanabilmesini kabul etmiş olursunuz:\"\r\nt MSG_181 \"İşletim Sistemi mimarisi ve sürümü\"\r\nt MSG_182 \"Kullandığınız uygulamanın sürümü\"\r\nt MSG_183 \"IP Adresiniz\"\r\nt MSG_184 \"Özel kullanım istatistikleri oluşturmak amacıyla, bilgi toplamaya \\\\b en fazla bir yıl için\\\\b0  devam edebiliriz. Fakat, Üçüncü şahıslarla isteyerek herhangi bir veri paylaşılmaz.\"\r\nt MSG_185 \"Güncelleme İlerlemesi:\"\r\nt MSG_186 \"Güncelleme denetiminin sadece ana uygulama çalışırken gerçekleşmesinden dolayı, Rufus arkaplan hizmeti yüklemez ya da çalıştırmaz.\\\\line\\nGüncellemeler denetlenirken doğal olarak internet erişimi gerekir.\"\r\nt MSG_187 \"Seçilen açılış seçeneği için geçersiz yansı\"\r\nt MSG_188 \"Mevcut yansı, seçilen açılış seçeneği ile eşleşmiyor. Lütfen farklı bir yansı kullanın ya da farklı bir açılış seçeneği seçin.\"\r\nt MSG_189 \"Bu ISO yansısı, seçilen dosya sistemi ile uyumlu değil\"\r\nt MSG_190 \"Uyumsuz sürücü algılandı\"\r\nt MSG_191 \"Yazma geçişi\"\r\nt MSG_192 \"Okuma geçişi\"\r\nt MSG_193 \"%s indirildi\"\r\nt MSG_194 \"%s indirilemedi\"\r\nt MSG_195 \"%s dosyalarının gömülü sürümü kullanılıyor\"\r\nt MSG_196 \"ÖNEMLİ: BU SÜRÜCÜ STANDART OLMAYAN BİR SEKTÖR BOYUTU KULLANIYOR!\\n\\nGeleneksel sürücüler 512-byte sektör boyutu kullanır fakat bu sürücü %d-byte kullanıyor. Birçok durumda, bu demek oluyor ki bu sürücüden önyükleme yapılamayacak.\\nRufus önyüklemeli bir sürücü oluşturmayı deneyecektir fakat bunun olacağının GARANTİSİ verilemez.\"\r\nt MSG_197 \"Standart olmayan sektör boyutu algılandı\"\r\nt MSG_198 \"'Windows To Go', SABİT disk niteliği ayarlanmışsa GPT olarak bölümlendiğinde yüklenebilir. Mevcut sürücü SABİT disk olarak algılanamadı.\"\r\nt MSG_199 \"Bu özellik bu platformda mevcut değil.\"\r\nt MSG_201 \"Vazgeçiliyor - Lütfen Bekleyin...\"\r\nt MSG_202 \"Yansı taranıyor...\"\r\nt MSG_203 \"Yansı taranamadı\"\r\nt MSG_204 \"Eski %s algılandı\"\r\nt MSG_205 \"Kullanılan Yansı: %s\"\r\nt MSG_206 \"Eksik %s dosyası\"\r\nt MSG_207 \"Yeni Birim\"\r\nt MSG_208 \"%d aygıt bulundu\"\r\nt MSG_209 \"%d aygıt bulundu\"\r\nt MSG_210 \"HAZIR\"\r\nt MSG_211 \"Vazgeçildi\"\r\nt MSG_212 \"Başarısız\"\r\nt MSG_213 \"Yeni uygulama başlatılıyor...\"\r\nt MSG_214 \"Yeni uygulama başlatılamadı\"\r\nt MSG_215 \"%s Açıldı\"\r\nt MSG_216 \"%s Kaydedildi\"\r\nt MSG_217 \"Biçimlendiriliyor: %s\"\r\nt MSG_218 \"Dosya sistemi oluşturuluyor: Görev %d/%d tamamlandı\"\r\nt MSG_219 \"NTFS Düzeltme: %d%% tamamlandı\"\r\nt MSG_220 \"Biçimlendiriliyor (%s) - Tahmini Süre %d:%02d...\"\r\nt MSG_221 \"Etiket Ayarlanıyor (%s)...\"\r\nt MSG_222 \"Biçimlendiriliyor (%s)...\"\r\nt MSG_223 \"NTFS Onarımı (Checkdisk)...\"\r\nt MSG_224 \"MBR/PBR/GPT yapıları temizleniyor...\"\r\nt MSG_225 \"Disk erişimi sorgulanıyor...\"\r\nt MSG_226 \"Varolan açılış kayıtları inceleniyor...\"\r\nt MSG_227 \"Varolan birim kapatılıyor...\"\r\nt MSG_228 \"MBR Yazılıyor...\"\r\nt MSG_229 \"PBR Yazılıyor...\"\r\nt MSG_230 \"DOS Dosyaları Kopyalanıyor...\"\r\nt MSG_231 \"ISO dosyası içeriği kopyalanıyor: %s\"\r\nt MSG_232 \"Win7 EFI Açılış Kurulumu (%s)...\"\r\nt MSG_233 \"Bitiriliyor, Lütfen Bekleyin...\"\r\nt MSG_234 \"Syslinux %s Yükleniyor...\"\r\nt MSG_235 \"Hatalı Bloklar: %s %d/%d - %0.2f%% (%d/%d/%d hata)\"\r\nt MSG_236 \"Hatalı Bloklar: Rastgele kalıpla deneniyor\"\r\nt MSG_237 \"Hatalı Bloklar: 0x%02X kalıbıyla deneniyor\"\r\nt MSG_238 \"Bölümlendiriliyor (%s)...\"\r\nt MSG_239 \"Bölümler siliniyor (%s)...\"\r\nt MSG_240 \"İndirilen güncellemenin imzası doğrulanamadı. Bu, sisteminizin imza doğrulaması için yanlış yapılandırıldığı veya kötü amaçlı bir yüklemeyi gösterdiği anlamına gelebilir.\\n\\nİndirme silinecek. Lütfen daha fazla ayrıntı için günlüğü kontrol edin.\"\r\nt MSG_241 \"İndiriliyor: %s\"\r\nt MSG_242 \"Dosya indirilemedi.\"\r\nt MSG_243 \"Rufus güncellemeleri denetleniyor...\"\r\nt MSG_244 \"Güncellemeler: İnternet erişimi yok\"\r\nt MSG_245 \"Güncellemeler: Sürüm bilgisine erişilemedi\"\r\nt MSG_246 \"Rufus'un yeni sürümü mevcut!\"\r\nt MSG_247 \"Rufus'un yeni sürümü bulunamadı\"\r\nt MSG_248 \"Uygulama kayıt defteri anahtarları başarıyla silindi\"\r\nt MSG_249 \"Uygulama kayıt defteri anahtarları silinemedi\"\r\nt MSG_250 \"%s etkin\"\r\nt MSG_251 \"%s devre dışı\"\r\nt MSG_252 \"Boyut denetlemeleri\"\r\nt MSG_253 \"Sabit disk algılama\"\r\nt MSG_254 \"Geniş FAT32 biçimlendirmeye zorla\"\r\nt MSG_255 \"NoDriveTypeAutorun çıkışta silinecek\"\r\nt MSG_256 \"Sahte sürücü algılama\"\r\nt MSG_257 \"Joliet desteği\"\r\nt MSG_258 \"Rock Ridge desteği\"\r\nt MSG_259 \"Güncellemeye zorla\"\r\nt MSG_260 \"NTFS sıkıştırma\"\r\nt MSG_261 \"Yansı yazılıyor: %s\"\r\nt MSG_262 \"ISO Desteği\"\r\nt MSG_263 \"UYGUN boyutta birimleri kullanın\"\r\nt MSG_264 \"'%s' dizini siliniyor...\"\r\nt MSG_265 \"VMWare disk algılama\"\r\nt MSG_266 \"Çift UEFI/BIOS modu\"\r\nt MSG_267 \"Windows yansısı uygulanıyor: %s\"\r\nt MSG_268 \"Windows yansısı uygulanıyor...\"\r\nt MSG_269 \"Zaman damgalarını koruma\"\r\nt MSG_270 \"USB hata ayıklama\"\r\nt MSG_271 \"Yansı sağlaması hesaplanıyor: %s\"\r\nt MSG_272 \"Seçilen yansı için MD5, SHA1 ve SHA256 sağlamasını hesapla\"\r\nt MSG_273 \"Uygulama dilini değiştir\"\r\nt MSG_274 \"%s yansı algılandı\"\r\nt MSG_275 \"Seçtiğiniz yansı bir 'ISOHybrid' yansısıdır. Bu da yansının ya %s (dosya kopyalama) modunda ya da %s (disk yansısı) modunda yazılabileceği anlamına geliyor.\\nRufus %s modunun kullanılmasını önerir, Böylece yazdırmadan sonra, sürücüye her zaman tam erişim sağlanabilir.\\nAncak, Önyükleme sırasında sorunlarla karşılaşırsanız, yansıyı %s modunda yeniden yazmayı deneyebilirsiniz.\\n\\nLütfen bu yansının yazdırılmasında kullanmak istediğiniz modu seçin:\"\r\nt MSG_276 \"%s modunda yazdır (Önerilen)\"\r\nt MSG_277 \"%s modunda yazdır\"\r\nt MSG_278 \"Çakışan işlemler denetleniyor...\"\r\nt MSG_279 \"Önyüklenebilir değil\"\r\nt MSG_280 \"Disk ya da ISO yansısı\"\r\nt MSG_281 \"%s (Lütfen seçin)\"\r\nt MSG_282 \"Özel USB sürücü kilitleme\"\r\nt MSG_283 \"Geçersiz imza\"\r\nt MSG_284 \"İndirilen yürütülebilir dosyanın dijital imzası eksik.\"\r\nt MSG_285 \"İndirilen yürütülebilir dosya '%s' tarafından imzalanmış.\\nBu tanımlayabildiğimiz ve kötü niyetli etkinliğini belirtebileceğimiz bir imza değil...\\nBu dosyayı çalıştırmak istediğinize emin misiniz?\"\r\nt MSG_286 \"Sürücü sıfırlanıyor: %s\"\r\nt MSG_287 \"USB olmayan çıkarılabilir aygıtlar taranıyor\"\r\nt MSG_288 \"Yükseltilmiş ayrıcalıklar bulunamadı\"\r\nt MSG_289 \"Bu uygulama yalnız yüksek ayrıcalıklarla çalıştırılabilir\"\r\nt MSG_290 \"Dosya Dizinleme\"\r\nt MSG_291 \"Sürüm seçimi\"\r\nt MSG_292 \"Lütfen yüklemek istediğiniz Windows sürümünü seçin:\"\r\nt MSG_293 \"Desteklenmeyen Windows sürümü\"\r\nt MSG_294 \"Windows'un bu sürümü artık Rufus tarafından desteklenmiyor.\\nRufus'un bu platformla uyumlu son sürümü v%d.%d'dir.\"\r\nt MSG_295 \"Uyarı: Resmi olmayan sürüm\"\r\nt MSG_296 \"Rufus'un bu sürümü, resmi geliştirici(ler)i tarafından oluşturulmadı.\\n\\nÇalıştırmak istediğinize emin misiniz?\"\r\nt MSG_297 \"Kırpılmış ISO algılandı\"\r\nt MSG_298 \"Seçtiğiniz ISO dosyası bildirilen boyutla eşleşmiyor: Veri %s eksik!\\n\\nBu dosyayı İnternet'ten edindiyseniz, yeni bir kopyasını indirip, MD5 veya SHA değerlerinin resmi dosyalarla eşleştiğini doğrulamanız gerekir.\\n\\nRufus'daki MD5 veya SHA'yı (✓) işaretini tıklayarak hesaplayabileceğinizi unutmayın.\"\r\nt MSG_299 \"Zaman damgası doğrulama hatası\"\r\nt MSG_300 \"Rufus, indirilen güncellemenin zaman damgasının geçerli yürütülebilir dosya için olandan daha güncel olduğunu doğrulayamadı.\\n\\nPotansiyel saldırı senaryolarını önlemek için güncelleme işleminden vazgeçildi ve indirme silinecek. Daha fazla bilgi için lütfen günlüğü kontrol edin.\"\r\nt MSG_301 \"Uygulama ayarlarını göster\"\r\nt MSG_302 \"Bu uygulama hakkında bilgi göster\"\r\nt MSG_303 \"Günlüğü göster\"\r\nt MSG_304 \"Seçilen cihazın disk yansısını oluşturur\"\r\nt MSG_305 \"Windows'u başka bir diske yüklemek ya da Windows'u doğrudan bu sürücüden çalıştırmak istiyorsanız (Windows To Go), bu cihazı kullanmak isteyip istemediğinizi belirtmek için bu seçeneği kullanın.\"\r\nt MSG_306 \"Hızlı sürücü sıfırlama: %s\"\r\nt MSG_307 \"bu biraz zaman alabilir\"\r\nt MSG_308 \"VHD Algılama\"\r\nt MSG_309 \"Sıkıştırılmış arşiv\"\r\nt MSG_310 \"Seçtiğiniz ISO yansısı, UEFI kullanıyor ve EFI Sistem Bölümü (ESP) olarak yazılabilecek kadar küçük. Tüm diski kapsayan genel bir veri bölümüne yazmak yerine bir ESP'ye yazmak, bazı kurulum türleri için tercih edilebilir.\\n\\nLütfen bu yansıyı yazmak için kullanmak istediğiniz modu seçin:\"\r\nt MSG_311 \"Etkinleştirmek için %s (ana uygulama penceresinde) kullanın.\"\r\nt MSG_312 \"Ekstra Doğrulama Değerleri\"\r\nt MSG_313 \"VHD'ye kaydet\"\r\nt MSG_314 \"Yansı doğrulamayı hesaplayın\"\r\nt MSG_315 \"Çoklu düğme\"\r\nt MSG_316 \"Geçiş sayısı\"\r\nt MSG_317 \"Disk Kimliği\"\r\nt MSG_318 \"Varsayılan iş parçacığı önceliği: %d\"\r\nt MSG_319 \"Önyükleme İşaretleyicisini Yoksay\"\r\nt MSG_320 \"Bölüm düzeni yenileniyor (%s)...\"\r\nt MSG_321 \"Seçtiğiniz yansı bir ISOHybrid, ancak yansı ISO/Dosya kopyalama modu ile uyumlu hale olrak oluşturulmamış.\\nSonuç olarak, DD yansısı yazma modu uygulanacaktır.\"\r\nt MSG_322 \"'%s' açılamıyor veya okunamıyor\"\r\nt MSG_325 \"Windows özelleştirmesi uygulanıyor: %s\"\r\nt MSG_326 \"Kullanıcı seçenekleri uygulanıyor...\"\r\nt MSG_327 \"Windows Kullanıcı Deneyimi\"\r\nt MSG_328 \"Windows kurulumunu özelleştirmek istiyor musunuz?\"\r\nt MSG_329 \"4 GB+ RAM, Güvenli Önyükleme(Secure Boot) ve TPM 2.0 gereksinimini kaldırın\"\r\nt MSG_330 \"Çevrimiçi Microsoft hesabı gereksinimini kaldırın\"\r\nt MSG_331 \"Veri toplamayı devre dışı bırak (Gizlilik sorularını atla)\"\r\nt MSG_332 \"Windows To Go'nun dahili disklere erişmesini önleyin\"\r\nt MSG_333 \"Kullanıcı adı ile yerel bir hesap oluşturun:\"\r\nt MSG_334 \"Bölgesel seçenekleri bu kullanıcınınkiyle aynı değerlere ayarlayın\"\r\nt MSG_335 \"BitLocker otomatik cihaz şifrelemesini devre dışı bırakın\"\r\nt MSG_336 \"Kalıcı günlük\"\r\nt MSG_337 \"Bu özelliği kullanmak için Microsoft'tan ek bir dosyanın ('%s') indirilmesi gerekir:\\n- İnternete bağlanıp indirmek için 'Evet'i seçin\\n- İşlemden vazgeçmek için 'Hayır'ı seçin\\n\\nNot: Dosya uygulamanın dizinine indirilecek ve varsa otomatik olarak yeniden kullanılacaktır.\"\r\nt MSG_338 \"İptal edilen UEFI önyükleyici algılandı\"\r\nt MSG_339 \"Rufus, seçtiğiniz ISO'nun iptal edilmiş bir UEFI önyükleyici içerdiğini ve tamamen güncel bir UEFI sisteminde Güvenli Önyükleme etkinleştirildiğinde %s oluşturacağını algıladı.\\n\\n- Bu ISO görüntüsünü saygın olmayan bir kaynaktan aldıysanız, bunun UEFI kötü amaçlı yazılım içerme olasılığını göz önünde bulundurmalı ve bu görüntüden önyükleme yapmaktan kaçınmalısınız.\\n- Eğer güvenilir bir kaynaktan aldıysanız bu uyarıyı vermeyecek daha güncel bir versiyon bulmaya çalışmalısınız.\"\r\nt MSG_340 \"\\\"Güvenlik İhlali\\\" ekranı\"\r\nt MSG_341 \"'%s' içeren bir Windows Kurtarma Ekranı (BSOD)\"\r\nt MSG_342 \"Sıkıştırılmış VHDX Yansısı\"\r\nt MSG_343 \"Sıkıştırılmamış VHD Yansısı\"\r\nt MSG_344 \"Full Flash Update Yansısı\"\r\nt MSG_345 \"Bu işlevselliği kullanmak için Microsoft'tan bazı ek verilerin indirilmesi gerekir:\\n- İnternete bağlanıp indirmek için 'Evet'i seçin\\n- İşlemden vazgeçmek için 'Hayır'ı seçin\"\r\nt MSG_346 \"Windows'u S-Mode ile Kısıtlayın (çevrimiçi hesap atlamayla UYUMSUZ)\"\r\nt MSG_347 \"Uzman Modu\"\r\nt MSG_348 \"Arşiv dosyaları çıkarılıyor: %s\"\r\nt MSG_349 \"Rufus MBR'yi kullanın\"\r\nt MSG_900 \"Rufus, USB anahtar/bellekler, hafıza kartları vb. USB sürücüleri, biçimlendirmeye ve önyüklemeli hale getirmeye yardımcı olan bir araçtır.\"\r\nt MSG_901 \"Resmi site: %s\"\r\nt MSG_902 \"Kaynak Kodu: %s\"\r\nt MSG_903 \"Sürüm Notları %s\"\r\nt MSG_904 \"Bu uygulama, GNU Kamu Lisansı (GPL) sürüm 3'ün koşulları altında lisanslanmıştır.\\nDetaylar için https://www.gnu.org/licenses/gpl-3.0.tr.html sayfasını ziyaret edin.\"\r\nt MSG_905 \"Önyükle\"\r\nt MSG_910 \"USB, flash kart ve sanal sürücüleri FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3 olarak biçimlendirin\"\r\nt MSG_911 \"FreeDOS önyüklenebilir USB sürücüleri oluşturun\"\r\nt MSG_912 \"Önyüklenebilir ISO'lardan önyüklenebilir sürücüler oluşturun (Windows, Linux, vb.)\"\r\nt MSG_913 \"Sıkıştırılmış olanlar da dahil olmak üzere önyüklenebilir disk yansısından önyüklenebilir sürücüler oluşturun\"\r\nt MSG_914 \"UEFI önyüklenebilir NTFS dahil BIOS ya da UEFI önyüklenebilir sürücüler oluşturun\"\r\nt MSG_915 \"'Windows To Go' sürücüleri oluşturun\"\r\nt MSG_916 \"TPM ya da Güvenli Önyüklemeye sahip olmayan bilgisayarlar için Windows 11 kurulum sürücüleri oluşturun\"\r\nt MSG_917 \"Kalıcı Linux bölümleri oluşturun\"\r\nt MSG_918 \"Seçilen sürücünün VHD/DD yansılarını oluşturun\"\r\nt MSG_919 \"Seçilen yansının MD5, SHA-1, SHA-256 ve SHA-512 sağlama toplamlarını hesaplayın\"\r\nt MSG_920 \"\\\"Sahte\\\" flash sürücülerin tespiti de dahil olmak üzere hatalı blok kontrolleri gerçekleştirin\"\r\nt MSG_921 \"Resmi Microsoft Windows Retail ISO'larını indirin\"\r\nt MSG_922 \"UEFI Shell ISO'larını indirin\"\r\n\r\n#########################################################################\r\nl \"uk-UA\" \"Ukrainian (Українська)\" 0x0422\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Про Rufus\"\r\nt IDC_ABOUT_LICENSE \"Ліцензія\"\r\nt IDOK \"ОК\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Властивості диска\"\r\nt IDS_DEVICE_TXT \"Пристрій\"\r\nt IDS_BOOT_SELECTION_TXT \"Тип завантаження\"\r\nt IDC_SELECT \"Вибрати\"\r\nt IDS_IMAGE_OPTION_TXT \"Параметри образу\"\r\nt IDS_PARTITION_TYPE_TXT \"Схема розділів\"\r\nt IDS_TARGET_SYSTEM_TXT \"Цільова система\"\r\nt IDC_LIST_USB_HDD \"Список USB накопичувачів\"\r\nt IDC_OLD_BIOS_FIXES \"Додати виправлення для старих BIOS (додатковий розділ, вирівнювання, тощо)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Увімкнути перевірку носія UEFI під час виконання\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Параметри форматування\"\r\nt IDS_FILE_SYSTEM_TXT \"Файлова система\"\r\nt IDS_CLUSTER_SIZE_TXT \"Розмір кластера\"\r\nt IDS_LABEL_TXT \"Мітка тому\"\r\nt IDC_QUICK_FORMAT \"Швидке форматування\"\r\nt IDC_BAD_BLOCKS \"Перевірити пристрій на пошкоджені блоки\"\r\nt IDC_EXTENDED_LABEL \"Створити розширену мітку та значок пристрою\"\r\nt IDS_STATUS_TXT \"Стан\"\r\nt IDCANCEL \"Закрити\"\r\nt IDC_START \"Почати\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Закрити\"\r\nt IDD_LICENSE \"Ліцензія Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Закрити\"\r\nt IDD_LOG \"Журнал\"\r\nt IDC_LOG_CLEAR \"Очистити\"\r\nt IDC_LOG_SAVE \"Зберегти\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Закрити\"\r\nt IDD_NEW_VERSION \"Перевірити наявність оновлень - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Доступна нова версія. Будь ласка, завантажте останню версію!\"\r\nt IDC_WEBSITE \"Натисніть тут, щоб перейти на домашню сторінку\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Нотатки про випуск\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Завантажити\"\r\nt IDC_DOWNLOAD \"Завантажити\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Детальніше\"\r\nt IDYES \"Так\"\r\nt IDNO \"Ні\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Закрити\"\r\nt IDD_UPDATE_POLICY \"Політика оновлення та параметри\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Параметри\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Перевірити наявність оновлень\"\r\nt IDS_INCLUDE_BETAS_TXT \"Включаючи бета-версії\"\r\nt IDC_CHECK_NOW \"Перевірити зараз\"\r\n\r\nt MSG_001 \"Виявлено інший екземпляр Rufus\"\r\nt MSG_002 \"Запущено інший додаток Rufus.\\nЗакрийте перший додаток перед тим, як запустити ще один.\"\r\nt MSG_003 \"УВАГА: ВСІ ДАНІ НА ДИСКУ '%s' БУДУТЬ ЗНИЩЕНІ.\\nДля того, щоб продовжити, натисніть ОК. Для виходу натисніть Скасувати.\"\r\nt MSG_004 \"Політика оновлення Rufus\"\r\nt MSG_005 \"Чи хочете ви, щоб Rufus перевіряв оновлення автоматично?\"\r\nt MSG_006 \"Закрити\"\r\nt MSG_007 \"Скасувати\"\r\nt MSG_008 \"Так\"\r\nt MSG_009 \"Ні\"\r\nt MSG_010 \"Знайдено пошкоджені блоки\"\r\nt MSG_011 \"Перевірка завершена: %d пошкоджених блоків знайдено\\n  %d помилок читання\\n  %d помилок запису\\n  %d пошкоджених блоків\"\r\nt MSG_012 \"%s\\nБільш детальний звіт можна знайти в:\\n%s\"\r\nt MSG_013 \"Вимкнено\"\r\nt MSG_014 \"Щодня\"\r\nt MSG_015 \"Щотижня\"\r\nt MSG_016 \"Щомісяця\"\r\nt MSG_017 \"За вибором\"\r\nt MSG_018 \"Ваша версія: %d.%d (Збірка %d)\"\r\nt MSG_019 \"Остання версія: %d.%d (Збірка %d)\"\r\nt MSG_020 \"байт\"\r\nt MSG_021 \"Кб\"\r\nt MSG_022 \"Мб\"\r\nt MSG_023 \"Гб\"\r\nt MSG_024 \"Тб\"\r\nt MSG_025 \"Пб\"\r\nt MSG_026 \"байт\"\r\nt MSG_027 \"кілобайт\"\r\nt MSG_028 \"мегабайт\"\r\nt MSG_029 \"За промовчанням\"\r\nt MSG_030 \"%s (за промовчанням)\"\r\nt MSG_031 \"BIOS (чи UEFI-CSM)\"\r\nt MSG_032 \"UEFI (без CSM)\"\r\nt MSG_033 \"BIOS чи UEFI\"\r\nt MSG_034 \"%d прохід\"\r\nt MSG_035 \"%d проходів %s\"\r\nt MSG_036 \"ISO-образ\"\r\nt MSG_037 \"Додаток\"\r\nt MSG_038 \"Скасувати\"\r\nt MSG_039 \"Запустити\"\r\nt MSG_040 \"Завантажити\"\r\nt MSG_041 \"Операція скасована користувачем\"\r\nt MSG_042 \"Помилка\"\r\nt MSG_043 \"Помилка: %s\"\r\nt MSG_044 \"Завантаження файлу\"\r\nt MSG_045 \"USB-накопичувач\"\r\nt MSG_046 \"%s (Диск %d) [%s]\"\r\nt MSG_047 \"Декілька розділів\"\r\nt MSG_048 \"Rufus - Очищення буферів\"\r\nt MSG_049 \"Rufus - Скасування\"\r\nt MSG_050 \"Успішно.\"\r\nt MSG_051 \"Невідомі помилки під час форматування.\"\r\nt MSG_052 \"Неможливо використовувати вибрану файлову систему для даного пристрою.\"\r\nt MSG_053 \"Доступ до пристрою заборонений.\"\r\nt MSG_054 \"Вибраний пристрій захищений від запису.\"\r\nt MSG_055 \"Вибраний пристрій використовується іншим процесом. Будь ласка, завершіть процес перед використанням вибраного пристрою.\"\r\nt MSG_056 \"Швидке форматування недоступне для вибраного пристрою.\"\r\nt MSG_057 \"Неприпустима мітка пристрою.\"\r\nt MSG_058 \"Неприпустимий дескриптор пристрою.\"\r\nt MSG_059 \"Вибраний розмір кластеру не являється припустимим для даного пристрою.\"\r\nt MSG_060 \"Невірний розмір тому.\"\r\nt MSG_061 \"Вставте знімний носій до приводу.\"\r\nt MSG_062 \"Була отримана непідтримувана команда.\"\r\nt MSG_063 \"Помилка розподілу пам'яті.\"\r\nt MSG_064 \"Помилка читання.\"\r\nt MSG_065 \"Помилка запису.\"\r\nt MSG_066 \"Помилка встановлення\"\r\nt MSG_067 \"Неможливо зчитати носій інформації. Можливо він використовується іншим процесом. Будь ласка, витягніть носій інформації та вставте його знову.\"\r\nt MSG_068 \"Помилка при створенні розділу.\"\r\nt MSG_069 \"Неможливо скопіювати файли на вибраний пристрій.\"\r\nt MSG_070 \"Скасовано користувачем.\"\r\nt MSG_071 \"Неможливо запустити потік виконання.\"\r\nt MSG_072 \"Перевірка на пошкоджені блоки не завершена.\"\r\nt MSG_073 \"Помилка перевірки ISO-образу.\"\r\nt MSG_074 \"Помилка видобування ISO-образу.\"\r\nt MSG_075 \"Неможливо змонтувати том.\"\r\nt MSG_076 \"Неможливо пропатчити/налаштувати файли для завантаження.\"\r\nt MSG_077 \"Неможливо призначити літеру диска.\"\r\nt MSG_078 \"Неможливо змонтувати GUID-том.\"\r\nt MSG_079 \"Пристрій не готовий.\"\r\nt MSG_080 \"Rufus виявив, що Windows все ще очищає внутрішній буфер USB-накопичувача.\\n\\nВ залежності від швидкості вашого USB-пристрою, ця операція може зайняти багато часу, особливо для великих файлів.\\n\\nДочекайтесь доки Windows завершить очищення для того, щоб запобігти пошкодження пристрою. Однак, якщо ви втомились від очікування, можете просто відімкнути пристрій...\"\r\nt MSG_081 \"Непідтримуваний ISO-образ\"\r\nt MSG_082 \"Вибраний образ або незавантажувальний або використовує метод завантаження чи стиснення, який не підтримується Rufus...\"\r\nt MSG_083 \"Перемістити %s?\"\r\nt MSG_084 \"Вибраний ISO-образ використовує застарілу версію '%s'.\\nЧерез це завантажувальне меню може відображатися неправильно.\\n\\nНову версію можна завантажити за допомогою Rufus:\\n- Виберіть 'Так', щоб завантажити файл з інтернету\\n- Виберіть 'Ні', щоб не модифікувати ISO-образ\\nЯкщо ви не знаєте що робити, то виберіть 'Так'.\\n\\nФайл буде завантажений в поточну директорію, а в разі наявності '%s' - замінений автоматично.\"\r\nt MSG_085 \"Завантаженя %s\"\r\nt MSG_086 \"Виберіть образ\"\r\nt MSG_087 \"для %s NAND\"\r\nt MSG_088 \"Образ занадто великий\"\r\nt MSG_089 \"Образ занадто великий для вибраного пристрою.\"\r\nt MSG_090 \"Непідтримуваний ISO-образ\"\r\nt MSG_091 \"При використанні системного інтерфейсу UEFI підтримуються тільки завантажувальні EFI ISO-образи. Будь ласка, виберіть завантажувальний EFI ISO-образ чи змініть системний інтерфейс на BIOS.\"\r\nt MSG_092 \"Непідтримувана файлова система\"\r\nt MSG_093 \"ВАЖЛИВО: ДАНИЙ ДИСК МІСТИТЬ КІЛЬКА РОЗДІЛІВ!!\\n\\nДаний диск може включати розділи/томи, які не були перераховані або навіть видимі у Windows. Якщо ви хочете продовжити, то будете нести відповідальність за втрату даних на цих розділах.\"\r\nt MSG_094 \"Виявлено декілька розділів\"\r\nt MSG_095 \"DD-образ\"\r\nt MSG_096 \"Вибрана файлова система не може використовуватись з цим типом ISO-образу. Будь ласка, виберіть іншу файлову систему чи інший ISO-образ.\"\r\nt MSG_097 \"'%s' може використовуватись тільки з файловою системою NTFS.\"\r\nt MSG_098 \"ВАЖЛИВО: Ви намагаєтесь встановити 'Windows To Go', але ваш диск призначення не повинен бути 'ФІКСОВАНИМ'. Через це Windows, швидше за все, зависне під час завантаження, так як Microsoft не передбачав дану функцію для роботи з 'ФІКСОВАНИМИ' дисками, а тільки зі 'ЗНІМНИМИ'.\\n\\nВи все ще хочете продовжити?\\n\\nПримітка: Атрибути 'ФІКСОВАНИЙ/ЗНІМНИЙ' являються апаратними властивостями, які можуть бути змінені тільки за допомогою інструментів від виробників. Проте ці інструменти МАЙЖЕ НІКОЛИ не надаються громадськості...\"\r\nt MSG_099 \"Обмеження файлової системи\"\r\nt MSG_100 \"Цей ISO-образ містить файл розміром більш ніж 4 Гб, що неприпустимо при використанні файлової системи FAT чи FAT32.\"\r\nt MSG_101 \"Відсутня підтримка WIM\"\r\nt MSG_102 \"Ваша система не може видобувати файли з WIM-архівів, однак це необхідно для створення завантажувального USB-накопичувача з Windows 7 чи Windows Vista. Ви можете виправити це встановивши останню версію 7-Zip\\nХочете відвідати сторінку завантаження 7-zip?\"\r\nt MSG_103 \"Завантажити %s?\"\r\nt MSG_104 \"%s чи більш пізньої версії потребує наявності '%s'.\\nОскільки цей файл більший за 100 Кб, і завжди присутній в %s ISO-образах, він не був вбудований в Rufus.\\n\\nRufus може завантажити відсутній файл:\\n- Виберіть 'Так', якщо хочете завантажити даний файл\\n- Виберіть 'Ні', якщо хочете завантажити його вручну пізніше\\n\\nПримітка: Файл буде завантажений в поточну директорію. За наявності '%s', він буде перезаписаний автоматично.\"\r\nt MSG_105 \"Скасування може залишити пристрій у НЕРОБОЧОМУ стані.\\nЯкщо ви впевнені, що хочете скасувати процес, натисніть кнопку ТАК. В іншому випадку натисніть кнопку НІ.\"\r\nt MSG_106 \"Будь ласка, виберіть теку\"\r\nt MSG_107 \"Всі файли\"\r\nt MSG_108 \"Журнал Rufus\"\r\nt MSG_109 \"0x%02X (Диск %d)\"\r\nt MSG_110 \"MS-DOS не може завантажитися при використанні розміру кластера 64 Кб...\\nБудь ласка, змініть розмір кластеру чи використайте FreeDOS.\"\r\nt MSG_111 \"Несумісний розмір кластера\"\r\nt MSG_112 \"Форматування великих UDF-томів займає багато часу. На швидкості USB 2.0 приблизна тривалість форматування складе %d:%02d, протягом якої індикатор прогресу буде заморожено. Будь ласка, будьте терплячі!\"\r\nt MSG_113 \"Великий UDF-том\"\r\nt MSG_114 \"Даний образ використовує Syslinux %s%s, проте даний додаток включає в себе тільки настановні файли для Syslinux %s%s.\\n\\nТак як нові версії Syslinux несумісні одна з одною, необхідно, щоб додаткові файли ('ldlinux.sys' та 'ldlinux.bss') були завантажені з інтернету:\\n- Виберіть 'Так', щоб завантажити файли з інтернету\\n- Виберіть 'Ні', щоб скасувати операцію\\n\\nПримітка: Файли будуть завантажені в поточний каталог додатку і будуть використовуватися повторно за необхідності.\"\r\nt MSG_115 \"Необхідно завантажити\"\r\nt MSG_116 \"Даний образ використовує завантажувач Grub %s, але додаток включає тільки настановні файли для завантажувача Grub %s.\\n\\nРізні версії завантажувача Grub можуть бути несумісними одна з одною та увімкнення їх усіх не являється можливим. Rufus намагатиметься знайти потрібну версію настановного файла завантажувача Grub ('core.img'), що відповідає версії завантажувача вашого образу:\\n- Виберіть 'Так', щоб скачати завантажувальний файл з інтернету\\n- Виберіть 'Ні', щоб використовувати версію за замовчуванням із Rufus\\n- Виберіть 'Скасувати', щоб скасувати операцію\\n\\nПримітка: Файл буде завантажено в поточний каталог додатку та буде використаний повторно наступного разу. Якщо потрібна версія настановного файла не буде знайдена в інтернеті, то буде використовуватися версія за замовчуванням.\"\r\nt MSG_117 \"Стандартне встановлення Windows\"\r\nt MSG_119 \"розширені властивості диска\"\r\nt MSG_120 \"розширені властивості форматування\"\r\nt MSG_121 \"Показати %s\"\r\nt MSG_122 \"Сховати %s\"\r\nt MSG_123 \"Розмір розділу збереження\"\r\nt MSG_124 \"Деактивовано\"\r\nt MSG_125 \"Встановіть розмір розділу збереження для Live USB-накопичувача. Щоб вимкнути розділ збереження встановіть розмір 0.\"\r\nt MSG_126 \"Встановити розмір одиниць розділу.\"\r\nt MSG_127 \"Не показувати це повідомлення знову\"\r\nt MSG_128 \"Важливе повідомлення щодо %s\"\r\nt MSG_129 \"Ви тільки що створили носій, що використовує завантажувач UEFI:NTFS. Будь ласка, пам'ятайте, що для завантаження цього носія ВИ ПОВИННІ ВИМКНУТИ БЕЗПЕЧНЕ ЗАВАНТАЖЕННЯ.\\nДетальну інформацію про те, чому це необхідно ви можете побачити, натиснувши кнопку \\\"Додаткова інформація\\\" нижче.\"\r\nt MSG_130 \"Вибір образу Windows\"\r\nt MSG_131 \"Цей ISO містить декілька образів Windows.\\nБудь ласка, виберіть образ, котрий ви хочете використати для встановлення:\"\r\nt MSG_132 \"Інша програма чи процес отримують доступ до цього диска. Ви все одно бажаєте форматувати його?\"\r\nt MSG_133 \"Rufus виявив, що ви намагаєтесь створити носій Windows To Go, заснований на версії ISO 1809\\n\\nЧерез *ПОМИЛКУ MICROSOFT* цей носій буде припиняти роботу під час завантаження Windows (Синій екран смерті), доки ви вручну не перенесете файл 'WppRecorder.sys' з версії 1803.\\n\\nТакож зауважте, що Rufus не може автоматично виправити цю помилку через те, що файл 'WppRecorder.sys' захищено авторським правом Microsoft, тому ми не можемо легально вставити копію файла в додаток...\"\r\nt MSG_134 \"Через те, що для схеми розділів вибрано MBR, Rufus може створити розділ на цьому носії лише розміром до 2 Тб, що не дозволить використовувати %s дискового простору.\\n\\nВи бажаєте продовжити?\"\r\nt MSG_135 \"Версія\"\r\nt MSG_136 \"Реліз\"\r\nt MSG_137 \"Редакція\"\r\nt MSG_138 \"Мова\"\r\nt MSG_139 \"Архітектура\"\r\nt MSG_140 \"Продовжити\"\r\nt MSG_141 \"Назад\"\r\nt MSG_142 \"Будь ласка, зачекайте...\"\r\nt MSG_143 \"Завантажити використовуючи браузер\"\r\nt MSG_144 \"Неможливо завантажити: Microsoft внесла деякі зміни на свій вебсайт, щоб запобігти завантаженню образів Windows.\"\r\nt MSG_145 \"Для запуску сценарію необхідна наявність PowerShell 3.0 чи більш пізньої версії.\"\r\nt MSG_146 \"Чи хочете ви вийти в мережу та завантажити його?\"\r\nt MSG_148 \"Запуск сценарію завантаження...\"\r\nt MSG_149 \"Завантаження ISO образу\"\r\nt MSG_150 \"Тип комп'ютера, разом з яким ви хочете використовувати завантажувальний диск. Ви повинні визначити який тип інтерфейсу (BIOS чи UEFI) використовує ваш комп'ютер перед початком створення диску, оскільки неправильний вибір може спровокувати помилку завантаження.\"\r\nt MSG_151 \"'UEFI-CSM' означає, що пристрій завантажується лише в режимі емуляції BIOS (також відомому як 'Legacy Mode'), а не в рідному режимі UEFI.\"\r\nt MSG_152 \"'без CSM' означає, що пристрій завантажується лише в режимі UEFI.\"\r\nt MSG_153 \"Тестовий паттерн: 0x%02X\"\r\nt MSG_154 \"Тестовий паттерн: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Тестовий паттерн: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Тестовий паттерн: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Встановити цільову файлову систему\"\r\nt MSG_158 \"Вибір мінімального розміру кластера, що займає кожен блок даних\"\r\nt MSG_159 \"Встановлення нової мітки тому.\\nПідтримуються міжнародні символи.\"\r\nt MSG_160 \"Показати розширені властивості\"\r\nt MSG_161 \"Перевірка пристрою на наявність пошкоджених блоків за допомогою тестового паттерну\"\r\nt MSG_162 \"Швидке форматування пристрою\"\r\nt MSG_163 \"Метод створення розділів\"\r\nt MSG_164 \"Метод створення завантажувального диска\"\r\nt MSG_165 \"Натисніть, щоб вибрати образ...\"\r\nt MSG_166 \"Дозволити відображення міток з міжнародними символами та задати значок пристрою (створюється autorun.inf)\"\r\nt MSG_167 \"Встановити завантажувач UEFI, який буде виконувати перевірку MD5Sum\"\r\nt MSG_169 \"Створити додатковий прихований розділ і вирівняти межі розділів.\\nЦе допоможе покращити виявлення завантажувача в старих версіях BIOS.\"\r\nt MSG_170 \"Відображати зовнішні USB накопичувачі. ВИКОРИСТОВУЙТЕ НА СВІЙ СТРАХ І РИЗИК!!!\"\r\nt MSG_171 \"Почати форматування пристрою.\\nВсі дані на диску будуть ЗНИЩЕНІ!\"\r\nt MSG_172 \"Помилка завантаження підпису\"\r\nt MSG_173 \"Натисніть для вибору...\"\r\nt MSG_174 \"Rufus - надійна утиліта для форматування USB-накопичувачів\"\r\nt MSG_175 \"Версія %d.%d (Збірка %d)\"\r\nt MSG_176 \"Українською переклав: Великожон Костянтин <mailto:mind.converter@gmail.com>\"\r\nt MSG_177 \"Повідомити про помилку чи запропонувати покращення на веб-сайті:\"\r\nt MSG_178 \"Додаткові авторські права:\"\r\nt MSG_179 \"Політика оновлення:\"\r\nt MSG_180 \"Якщо ви дозволите цій програмі перевіряти наявність оновлень, значить ви погоджуєтесь, що наступна інформація може збиратися на наших серверах:\"\r\nt MSG_181 \"Версія та архітектура вашої операційної системи\"\r\nt MSG_182 \"Версія використовуваного додатку\"\r\nt MSG_183 \"Ваша IP-адреса\"\r\nt MSG_184 \"Для отримання статистики використання програми, ми можемо зберігати зібрану інформацію \\\\b до одного року\\\\b0. Проте, ми не будемо розкривати будь-які особисті дані третім сторонам.\"\r\nt MSG_185 \"Процес оновлення:\"\r\nt MSG_186 \"Додаток Rufus не встановлює та не запускає фонові служби, тому перевірка наявності оновлень виконується тільки тоді, коли запущений основний додаток.\\\\line\\nДля перевірки наявності оновлень необхідний доступ до інтернету.\"\r\nt MSG_187 \"Невірний образ для вибраного варіанта завантаження\"\r\nt MSG_188 \"Вибрано невірний образ для вибраного варіанта завантаження. Будь ласка, виберіть інший образ чи виберіть інший варіант завантаження.\"\r\nt MSG_189 \"Даний ISO-образ несумісний з обраною файловою системою\"\r\nt MSG_190 \"Знайдено несумісний диск\"\r\nt MSG_191 \"Прохід запису\"\r\nt MSG_192 \"Прохід читання\"\r\nt MSG_193 \"Завантажено %s\"\r\nt MSG_194 \"Неможливо завантажити %s\"\r\nt MSG_195 \"Використовувати вбудовану версію %s файлів\"\r\nt MSG_196 \"ВАЖЛИВО: ЦЕЙ ДИСК ВИКОРИСТОВУЄ НЕСТАНДАРТНИЙ РОЗМІР СЕКТОРА!\\n\\nЗазвичай диски використовують сектор розміром 512 байт, проте цей диск використовує сектор на %d байт. В більшості випадків це означає, що ви НЕ ЗМОЖЕТЕ завантажитись з цього диску.\\nRufus може спробувати створити завантажувальний диск, але НЕ ДАЄ ГАРАНТІЇ, що він буде працювати.\"\r\nt MSG_197 \"Знайдено нестандартний розмір сектора\"\r\nt MSG_198 \"'Windows To Go' може використовуватись тільки з розділом GPT диска та якщо диск являється ФІКСОВАНИМ. Вибраний диск не являється ФІКСОВАНИМ.\"\r\nt MSG_199 \"Вибрана функція недоступна на даній платформі.\"\r\nt MSG_201 \"Скасування - Будь ласка, зачекайте...\"\r\nt MSG_202 \"Сканування образа...\"\r\nt MSG_203 \"Не вдалося відсканувати образ\"\r\nt MSG_204 \"Виявлено застарілий %s\"\r\nt MSG_205 \"Використання образа: %s\"\r\nt MSG_206 \"Відсутній файл %s\"\r\nt MSG_207 \"Новий том\"\r\nt MSG_208 \"Виявлено пристрій: %d\"\r\nt MSG_209 \"Виявлено пристроїв: %d\"\r\nt MSG_210 \"Готово\"\r\nt MSG_211 \"Скасовано\"\r\nt MSG_212 \"Невдало\"\r\nt MSG_213 \"Запуск нового додатка...\"\r\nt MSG_214 \"Не вдалося запустити новий додаток\"\r\nt MSG_215 \"Відкрито %s\"\r\nt MSG_216 \"Збережено %s\"\r\nt MSG_217 \"Форматування: %s\"\r\nt MSG_218 \"Створення файлової системи: Завдання виконано на %d/%d\"\r\nt MSG_219 \"Створення NTFS області Fixup: %d%% виконано\"\r\nt MSG_220 \"Форматування (%s) - завершення через %d:%02d...\"\r\nt MSG_221 \"Встановлення мітки тому (%s)...\"\r\nt MSG_222 \"Форматування (%s)...\"\r\nt MSG_223 \"Перевірка NTFS області Fixup (Checkdisk)...\"\r\nt MSG_224 \"Очистка структури MBR/PBR/GPT...\"\r\nt MSG_225 \"Запит доступу до диска...\"\r\nt MSG_226 \"Аналіз завантажувальних записів...\"\r\nt MSG_227 \"Закриття існуючого розділу...\"\r\nt MSG_228 \"Створення головного завантажувального запису...\"\r\nt MSG_229 \"Створення завантажувального запису розділу...\"\r\nt MSG_230 \"Копіювання DOS-файлів...\"\r\nt MSG_231 \"Копіювання ISO-файлів: %s\"\r\nt MSG_232 \"Налаштування завантажувача Win7 EFI (%s)...\"\r\nt MSG_233 \"Завершення, будь ласка, чекайте...\"\r\nt MSG_234 \"Встановлення Syslinux %s...\"\r\nt MSG_235 \"Пошкоджені блоки: %s %d/%d - %0.2f%% (%d/%d/%d помилок)\"\r\nt MSG_236 \"Пошкоджені блоки: Тестування випадковим паттерном\"\r\nt MSG_237 \"Пошкоджені блоки: Тестування паттерном 0x%02X\"\r\nt MSG_238 \"Розмітка розділу (%s)...\"\r\nt MSG_239 \"Видалення розділів (%s)...\"\r\nt MSG_240 \"Підпис для завантаженого оновлення не може бути підтверджений. Це означає, що ваша система неправильно налаштована для перевірки підпису чи може бути ознакою шкідливої програми.\\n\\nЗавантаження було видалено. Будь ласка, перегляньте журнал для більш детальної інформації.\"\r\nt MSG_241 \"Завантаження: %s\"\r\nt MSG_242 \"Не вдалося завантажити файл.\"\r\nt MSG_243 \"Перевірка наявності оновлень...\"\r\nt MSG_244 \"Помилка: Необхідний доступ до інтернету\"\r\nt MSG_245 \"Оновлення: Неможливо отримати доступ до даних про версію\"\r\nt MSG_246 \"Доступна нова версія Rufus!\"\r\nt MSG_247 \"Нових версій Rufus не знайдено\"\r\nt MSG_248 \"Ключі додатку в реєстрі успішно видалені\"\r\nt MSG_249 \"Не вдалося видалити ключі додатку в реєстрі\"\r\nt MSG_250 \"%s увімкнено\"\r\nt MSG_251 \"%s вимкнено\"\r\nt MSG_252 \"Визначення розміру\"\r\nt MSG_253 \"Виявлення накопичувачів\"\r\nt MSG_254 \"Примусове форматування в розширений FAT32\"\r\nt MSG_255 \"NoDriveTypeAutorun буде видалений при виході\"\r\nt MSG_256 \"Виявлено фальшивий диск\"\r\nt MSG_257 \"Підтримка Joliet\"\r\nt MSG_258 \"Підтримка Rock Ridge\"\r\nt MSG_259 \"Примусове оновлення\"\r\nt MSG_260 \"Стиснення NTFS\"\r\nt MSG_261 \"Запис образа: %s\"\r\nt MSG_262 \"Підтримка ISO\"\r\nt MSG_263 \"Використання ПРАВИЛЬНОГО розміру одиниць\"\r\nt MSG_264 \"Видалення каталога '%s'\"\r\nt MSG_265 \"Виявлено диск VMWare\"\r\nt MSG_266 \"Подвійний режим UEFI/BIOS\"\r\nt MSG_267 \"Застосування Windows-образа: %s\"\r\nt MSG_268 \"Застосування Windows-образа...\"\r\nt MSG_269 \"Зберігати мітки часу\"\r\nt MSG_270 \"Режим USB-відлагодження\"\r\nt MSG_271 \"Обчислення контрольних сум: %s\"\r\nt MSG_272 \"Обчислити контрольні суми MD5, SHA1 та SHA256 для вибраного образа\"\r\nt MSG_273 \"Змінити мову додатка\"\r\nt MSG_274 \"Виявлено образ %s\"\r\nt MSG_275 \"Вибраний образ є образом 'ISOHybrid'. Це означає, що образ можна записати або в %s (режимі копіювання) або в %s (режимі образа диска).\\nRufus рекомендує використовувати %s режим для повного доступу до диска після запису.\\nОднак, якщо ви зіштовхнетесь з проблемами під час завантаження ви можете ще раз спробувати записати образ в %s режимі.\\n\\nБудь ласка, виберіть режим, який ви хочете використовувати для запису обраного образа:\"\r\nt MSG_276 \"Записати в %s режимі (Рекомендується)\"\r\nt MSG_277 \"Записати в %s режимі\"\r\nt MSG_278 \"Перевірка конфліктних процесів...\"\r\nt MSG_279 \"Незавантажувальний образ\"\r\nt MSG_280 \"Диск чи ISO-образ\"\r\nt MSG_281 \"%s (Будь ласка, виберіть)\"\r\nt MSG_282 \"Особливе блокування USB-накопичувача\"\r\nt MSG_283 \"Невірний підпис\"\r\nt MSG_284 \"У завантаженого файлу відсутній цифровий підпис.\"\r\nt MSG_285 \"Завантажений файл підписаний '%s'.\\nЦе не той підпис, який визнається нами, що вказує на деякі форми шкідливих дій...\\nВи впевнені, що хочете запустити цей файл?\"\r\nt MSG_286 \"Обнуління диска: %s\"\r\nt MSG_287 \"Виявлення знімних не-USB носіїв\"\r\nt MSG_288 \"Підвищені привілеї відсутні\"\r\nt MSG_289 \"Ця програма може бути запущена лише з підвищеними привілеями\"\r\nt MSG_290 \"Індексація файлів\"\r\nt MSG_291 \"Вибір версії\"\r\nt MSG_292 \"Будь ласка, виберіть версію Windows, яку ви хочете встановити:\"\r\nt MSG_293 \"Непідтримувана версія Windows\"\r\nt MSG_294 \"Ця версія Windows більше не підтримується Rufus.\\nОстання підтримувана версія, що сумісна з цією платформою: v%d.%d.\"\r\nt MSG_295 \"Увага: Неофіційна версія\"\r\nt MSG_296 \"Ця версія Rufus не була підготована її офіційним розробником.\\n\\nВи впевнені, що хочете запустити її?\"\r\nt MSG_297 \"Виявлено усічений ISO\"\r\nt MSG_298 \"Розмір вибраного файла ISO не співпадає з оголошеним розміром: %s даних відсутні!\\n\\nЯкщо ви завантажили цей файл з інтернету, вам слід завантажити нову копію файла або перевірити співпадіння контрольних сум MD5 чи SHA з офіційним файлом.\\n\\nПам'ятайте, що ви можете порівняти MD5 чи SHA в Rufus, натиснувши кнопку (✓).\"\r\nt MSG_299 \"Помилка перевірки мітки часу\"\r\nt MSG_300 \"Rufus не може підтвердити, що мітка часу для завантаженого оновлення більш пізня, ніж мітка запущеної програми.\\n\\nЩоб запобігти можливим сценаріям атаки, процес оновлення було скасовано та завантаження було видалено. Будь ласка, перегляньте журнал для більш детальної інформації.\"\r\nt MSG_301 \"Показати налаштування додатка\"\r\nt MSG_302 \"Показати інформацію про цей додаток\"\r\nt MSG_303 \"Показати журнал\"\r\nt MSG_304 \"Створити образ диска для вибраного пристрою\"\r\nt MSG_305 \"Використовуйте цей параметр, щоб вказати, чи хочете ви використовувати цей пристрій для встановлення Windows на інший диск, чи хочете запускати Windows напряму з пристрою (Windows To Go).\"\r\nt MSG_306 \"Швидке обнуління диска: %s\"\r\nt MSG_307 \"це може тривати деякий час\"\r\nt MSG_308 \"Виявлення VHD\"\r\nt MSG_309 \"Стиснутий архів\"\r\nt MSG_310 \"Вибраний ISO використовує UEFI та достатньо малий, щоб бути записаний як EFI System Partition (ESP). Запис до ESP замість запису до загального розділу, що займає весь диск, може мати переваги для деяких типів установок.\\n\\nБудь ласка, виберіть тип встановлення для даного образа:\"\r\nt MSG_311 \"Використайте %s (в головному вікні програми), щоб увімкнути.\"\r\nt MSG_312 \"Додаткові хеші (SHA512)\"\r\nt MSG_313 \"Зберегти до VHD\"\r\nt MSG_314 \"Обчислити контрольні суми образа\"\r\nt MSG_315 \"Декілька кнопок\"\r\nt MSG_316 \"Кількість проходів\"\r\nt MSG_317 \"ID диска\"\r\nt MSG_318 \"Пріоритет потоку за замовчуванням: %d\"\r\nt MSG_319 \"Ігнорувати Boot Marker\"\r\nt MSG_320 \"Оновлення макета розділу (%s)...\"\r\nt MSG_321 \"Вибраний образ має властивості ISOHybrid, проте його автор не потурбувався про сумісність з режимом копіювання ISO-файлів.\\nЯк результат, буде примусово застосовано режим запису образів DD.\"\r\nt MSG_322 \"Неможливо відкрити чи прочитати '%s'\"\r\nt MSG_325 \"Застосування налаштувань Windows: %s\"\r\nt MSG_326 \"Застосування параметрів користувача...\"\r\nt MSG_327 \"Інтерфейс користувача Windows\"\r\nt MSG_328 \"Налаштувати встановлення Windows?\"\r\nt MSG_329 \"Зняти обмеження на 4Гб+ ОЗП, Secure Boot та TPM 2.0\"\r\nt MSG_330 \"Видалити вимогу на онлайн обліковий запис Microsoft\"\r\nt MSG_331 \"Вимкнути збір даних (Пропустити питання щодо конфіденційності)\"\r\nt MSG_332 \"Обмежити Windows To Go доступ до внутрішніх дисків\"\r\nt MSG_333 \"Створити локальний обліковий запис з ім'ям:\"\r\nt MSG_334 \"Встановити регіональні параметри на такі самі, як у поточного користувача\"\r\nt MSG_335 \"Вимкнути автоматичне шифрування пристрою BitLocker\"\r\nt MSG_336 \"Постійний журнал\"\r\nt MSG_337 \"Щоб скористатися цією функцією, необхідно завантажити додатковий файл ('%s') з веб-сайту Microsoft:\\n- Виберіть 'Так' для з'єднання з інтернетом та його завантаження\\n- Виберіть 'Ні' для скасування операції\\n\\nПримітка: файл буде завантажено в каталог додатку та повторно використано за наявності.\"\r\nt MSG_338 \"Виявлено відкликаний завантажувач UEFI\"\r\nt MSG_339 \"Rufus виявив, що вибраний ISO містить відкликаний завантажувач UEFI, що буде створювати %s, коли в оновленій системі UEFI буде ввімкнено безпечне завантаження.\\n\\n- Якщо ви отримали цей образ з неперевіреного джерела, Вам слід розглянути можливість того, що він може містити зловмисне ПЗ і уникнути завантаження з нього.\\n- Якщо ви отримали цей образ з довіреного джерела, Вам слід спробувати знайти більш актуальну версію, що не буде провокувати це попередження.\"\r\nt MSG_340 \"вікно \\\"Security Violation\\\"\"\r\nt MSG_341 \"вікно Windows Recovery Screen (BSOD) з '%s'\"\r\nt MSG_342 \"Образ VHDX зі стисненням\"\r\nt MSG_343 \"Образ VHD без стиснення\"\r\nt MSG_344 \"Образ Full Flash Update\"\r\nt MSG_345 \"Для використання даного функціоналу необхідно завантажити деякі додаткові дані з сайту Microsoft:\\n- Виберіть 'Так' для з'єднання з інтернетом та завантаження даних\\n- Виберіть 'Ні' для скасування операції\"\r\nt MSG_346 \"Обмежити Windows до S-Mode (НЕСУМІСНО з обходом облікового запису)\"\r\nt MSG_347 \"Просунутий режим\"\r\nt MSG_348 \"Видобування архівованих файлів: %s\"\r\nt MSG_349 \"Використовувати Rufus MBR\"\r\nt MSG_900 \"Rufus це утиліта, яка допомагає форматувати та створювати завантажувальні флешки, картки пам'яті, тощо.\"\r\nt MSG_901 \"Офіційний сайт: %s\"\r\nt MSG_902 \"Сирцевий код: %s\"\r\nt MSG_903 \"Список змін: %s\"\r\nt MSG_904 \"Ця програма ліцензована згідно з умовами GNU Public License (GPL) version 3.\\nБільше: https://www.gnu.org/licenses/gpl-3.0.uk.html.\"\r\nt MSG_905 \"Отримати\"\r\nt MSG_910 \"Форматування USB-накопичувачів, флешок, карток пам'яті у FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Створення завантажувальних пристроїв FreeDOS\"\r\nt MSG_912 \"Створення завантажувальних пристроїв з завантажувальних образів (Windows, Linux, тощо)\"\r\nt MSG_913 \"Створення завантажувальних пристроїв з завантажувальних образів, у тому числі стиснутих\"\r\nt MSG_914 \"Створення завантажувальних пристроїв BIOS чи UEFI, включаючи завантажувальний UEFI NTFS\"\r\nt MSG_915 \"Створення пристроїв 'Windows To Go'\"\r\nt MSG_916 \"Створення інсталяційних дисків Windows 11 для ПК, які не мають TPM чи Secure Boot\"\r\nt MSG_917 \"Створення розділу збереження Linux\"\r\nt MSG_918 \"Створення образів VHD/DD з вибраних дисків\"\r\nt MSG_919 \"Обчислення контрольних сум MD5, SHA-1, SHA-256 та SHA-512 для вибраних образів\"\r\nt MSG_920 \"Перевірка дисків (включаючи фальшиві диски)\"\r\nt MSG_921 \"Завантаження офіційних образів Microsoft Windows\"\r\nt MSG_922 \"Завантаження командної оболонки UEFI ISO\"\r\n\r\n#########################################################################\r\nl \"vi-VN\" \"Vietnamese (Tiếng Việt)\" 0x042A\r\nv 4.5\r\nb \"en-US\"\r\n\r\ng IDD_ABOUTBOX\r\nt IDD_ABOUTBOX \"Thông tin về Rufus\"\r\nt IDC_ABOUT_LICENSE \"Giấy phép\"\r\n\r\ng IDD_DIALOG\r\nt IDS_DRIVE_PROPERTIES_TXT \"Thuộc tính thiết bị lưu\"\r\nt IDS_DEVICE_TXT \"Thiết bị lưu\"\r\nt IDS_BOOT_SELECTION_TXT \"Tùy chọn khởi động\"\r\nt IDC_SELECT \"Chọn\"\r\nt IDS_IMAGE_OPTION_TXT \"Tùy chọn tệp tin\"\r\nt IDS_PARTITION_TYPE_TXT \"Sơ đồ phân vùng\"\r\nt IDS_TARGET_SYSTEM_TXT \"Hệ thống khởi động\"\r\nt IDC_LIST_USB_HDD \"Liệt kê danh sách ổ USB\"\r\nt IDC_OLD_BIOS_FIXES \"Thêm các bản sửa lỗi cho BIOS cũ (phân vùng phụ, căn lề phân vùng, v.v...)\"\r\nt IDC_UEFI_MEDIA_VALIDATION \"Bật xác minh thiết bị UEFI trong thời gian chạy\"\r\nt IDS_FORMAT_OPTIONS_TXT \"Tùy chọn định dạng\"\r\nt IDS_FILE_SYSTEM_TXT \"Hệ thống tập tin\"\r\nt IDS_CLUSTER_SIZE_TXT \"Kích thước cụm\"\r\nt IDS_LABEL_TXT \"Nhãn thiết bị lưu\"\r\nt IDC_QUICK_FORMAT \"Định dạng nhanh\"\r\nt IDC_BAD_BLOCKS \"Kiểm tra lỗi khối trên thiết bị lưu trữ\"\r\nt IDC_EXTENDED_LABEL \"Tạo nhãn mở rộng và tệp tin biểu tượng\"\r\nt IDS_STATUS_TXT \"Trạng thái\"\r\nt IDCANCEL \"Đóng\"\r\nt IDC_START \"Bắt đầu\"\r\n\r\ng IDD_LICENSE\r\nt IDCANCEL \"Đóng\"\r\nt IDD_LICENSE \"Giấy phép Rufus\"\r\n\r\ng IDD_LOG\r\nt IDCANCEL \"Đóng\"\r\nt IDD_LOG \"Nhật ký\"\r\nt IDC_LOG_CLEAR \"Xoá\"\r\nt IDC_LOG_SAVE \"Lưu\"\r\n\r\ng IDD_NEW_VERSION\r\nt IDCANCEL \"Đóng\"\r\nt IDD_NEW_VERSION \"Kiểm tra cập nhật - Rufus\"\r\nt IDS_NEW_VERSION_AVAIL_TXT \"Đã có phiên bản mới hơn. Vui lòng tải phiên bản mới nhất!\"\r\nt IDC_WEBSITE \"Nhấn vào đây để truy cập website\"\r\nt IDS_NEW_VERSION_NOTES_GRP \"Ghi chú phát hành\"\r\nt IDS_NEW_VERSION_DOWNLOAD_GRP \"Tải xuống\"\r\nt IDC_DOWNLOAD \"Tải xuống\"\r\n\r\ng IDD_NOTIFICATION\r\nt IDC_MORE_INFO \"Thông tin thêm\"\r\nt IDYES \"Có\"\r\nt IDNO \"Không\"\r\n\r\ng IDD_UPDATE_POLICY\r\nt IDCANCEL \"Đóng\"\r\nt IDD_UPDATE_POLICY \"Cập nhật chính sách và thiết lập\"\r\nt IDS_UPDATE_SETTINGS_GRP \"Thiết lập\"\r\nt IDS_UPDATE_FREQUENCY_TXT \"Kiểm tra cập nhật\"\r\nt IDS_INCLUDE_BETAS_TXT \"Bao gồm bản thử nghiệm\"\r\nt IDC_CHECK_NOW \"Kiểm tra ngay\"\r\n\r\nt MSG_001 \"Đã phát hiện tiến trình chạy đồng thời\"\r\nt MSG_002 \"Ứng dụng Rufus khác đang chạy.\\nVui lòng đóng ứng dụng đầu tiên trước khi chạy một ứng dụng mới.\"\r\nt MSG_003 \"CẢNH BÁO: TẤT CẢ DỮ LIỆU TRÊN THIẾT BỊ '%s' SẼ BỊ XOÁ.\\nĐể tiếp tục tiến trình này, nhấn OK. Để thoát nhấn HUỶ.\"\r\nt MSG_004 \"Chính sách cập nhật Rufus\"\r\nt MSG_005 \"Bạn có muốn cho phép Rufus kiểm tra các bản cập nhật ứng dụng trực tuyến?\"\r\nt MSG_006 \"Đóng\"\r\nt MSG_007 \"Huỷ\"\r\nt MSG_008 \"Có\"\r\nt MSG_009 \"Không\"\r\nt MSG_010 \"Phát hiện khối hỏng\"\r\nt MSG_011 \"Kiểm tra hoàn tất: phát hiện %d khối hỏng\\n  %d lỗi đọc\\n  %d lỗi ghi\\n  %d lỗi cấu trúc\"\r\nt MSG_012 \"%s\\nMột báo cáo chi tiết hơn có thể tìm thấy trong:\\n%s\"\r\nt MSG_013 \"Đã vô hiệu\"\r\nt MSG_014 \"Hàng ngày\"\r\nt MSG_015 \"Hàng tuần\"\r\nt MSG_016 \"Hàng tháng\"\r\nt MSG_017 \"Tuỳ chỉnh\"\r\nt MSG_018 \"Phiên bản của bạn: %d.%d (Bản dựng %d)\"\r\nt MSG_019 \"Phiên bản mới nhất: %d.%d (Bản dựng %d)\"\r\nt MSG_029 \"Mặc định\"\r\nt MSG_030 \"%s (Mặc định)\"\r\nt MSG_031 \"BIOS (hoặc UEFI-CSM)\"\r\nt MSG_032 \"UEFI (không CSM)\"\r\nt MSG_033 \"BIOS hoặc UEFI\"\r\nt MSG_034 \"Đạt %d lần\"\r\nt MSG_035 \"Đã đạt %d lần %s\"\r\nt MSG_036 \"Tệp ISO\"\r\nt MSG_037 \"Ứng dụng\"\r\nt MSG_038 \"Huỷ bỏ\"\r\nt MSG_039 \"Khởi chạy\"\r\nt MSG_040 \"Tải xuống\"\r\nt MSG_041 \"Tiến trình đã bị huỷ bởi người dùng\"\r\nt MSG_042 \"Lỗi\"\r\nt MSG_043 \"Lỗi: %s\"\r\nt MSG_044 \"Tải xuống tập tin\"\r\nt MSG_045 \"Thiết bị lưu trữ USB (Cơ bản)\"\r\nt MSG_046 \"%s (Đĩa %d) [%s]\"\r\nt MSG_047 \"Đa phân vùng\"\r\nt MSG_048 \"Rufus - Đang xả bộ đệm\"\r\nt MSG_049 \"Rufus - Hủy bỏ\"\r\nt MSG_050 \"Thành công.\"\r\nt MSG_051 \"Lỗi không xác định khi đang định dạng.\"\r\nt MSG_052 \"Không thể dùng hệ thống tập tin đã chọn cho thiết bị này.\"\r\nt MSG_053 \"Truy cập tới thiết bị đã bị từ chối.\"\r\nt MSG_054 \"Thiết bị đang được bảo vệ ghi.\"\r\nt MSG_055 \"Thiết bị đang được dùng bởi tiến trình khác. Vui lòng đóng mọi tiến trình có thể đang truy cập thiết bị.\"\r\nt MSG_056 \"Định dạng nhanh không khả dụng với thiết bị này.\"\r\nt MSG_057 \"Nhãn ổ đĩa không hợp lệ.\"\r\nt MSG_058 \"Tham chiếu thiết bị không hợp lệ.\"\r\nt MSG_059 \"Kích thước cụm đã chọn không hợp lệ với thiết bị này.\"\r\nt MSG_060 \"Kích cỡ thiết bị không hợp lệ.\"\r\nt MSG_061 \"Vui lòng cắm thiết bị lưu trữ di động vào ổ.\"\r\nt MSG_062 \"Đã nhận một lệnh không được hỗ trợ.\"\r\nt MSG_063 \"Lỗi sắp xếp bộ nhớ.\"\r\nt MSG_064 \"Lỗi đọc.\"\r\nt MSG_065 \"Lỗi ghi.\"\r\nt MSG_066 \"Cài đặt thất bại\"\r\nt MSG_067 \"Không thể mở thiết bị. Có thể nó đang được tiến trình khác sử dụng. Vui lòng cắm lại thiết bị và thử lại.\"\r\nt MSG_068 \"Không thể phân vùng thiết bị.\"\r\nt MSG_069 \"Không thể sao chép tệp vào thiết bị đích.\"\r\nt MSG_070 \"Đã huỷ bởi người dùng.\"\r\nt MSG_071 \"Không thể bắt đầu luồng.\"\r\nt MSG_072 \"Kiểm tra khối hỏng chưa hoàn tất.\"\r\nt MSG_073 \"Quét tệp ISO thất bại.\"\r\nt MSG_074 \"Trích xuất tệp ISO thất bại.\"\r\nt MSG_075 \"Không thể tái gắn ổ đĩa.\"\r\nt MSG_076 \"Không thể vá/cài đặt tập tin cho việc khởi động.\"\r\nt MSG_077 \"Không thể gán ký tự ổ đĩa.\"\r\nt MSG_078 \"Không thể gắn kết phân vùng GUID.\"\r\nt MSG_079 \"Thiết bị chưa sẵn sàng.\"\r\nt MSG_080 \"Rufus đã phát hiện Windows vẫn đang xả bộ đệm bên trong thiết bị USB.\\n\\nTuỳ thuộc vào tốc độ thiết bị USB của bạn, hoạt động này có thể mất một thời gian dài để hoàn tất, đặc biệt với những tập tin lớn.\\n\\nChúng tôi khuyên rằng bạn nên để Windows kết thúc để phòng hỏng dữ liệu. Nhưng nếu bạn cảm thấy quá lâu, hãy cứ tháo thiết bị ra...\"\r\nt MSG_081 \"Tệp tin không được hỗ trợ\"\r\nt MSG_082 \"Tệp này không có khả năng khởi động hoặc sử dụng một tuỳ chọn khởi động hoặc nén không được Rufus hỗ trợ...\"\r\nt MSG_083 \"Thay thế %s?\"\r\nt MSG_084 \"Tệp ISO này có vẻ là phiên bản lỗi thời của '%s'.\\nCác menu khởi động có thể không hiện chính xác vì điều này.\\n\\nMột phiên bản mới có thể được tải xuống bởi Rufus để khắc phục vấn đề này:\\n- Chọn 'Có' để kết nối với Internet và tải tập tin xuống\\n- Chọn 'Không' để không thay đổi tập tin ISO đang có\\nNếu bạn không biết phải làm gì, bạn nên chọn 'Có'.\\n\\nGhi chú: Tập tin mới sẽ được tải xuống vào thư mục hiện tại và một khi '%s' tồn tại trong đó, nó sẽ được tự động tái sử dụng.\"\r\nt MSG_085 \"Đang tải xuống %s\"\r\nt MSG_086 \"Chưa tệp tin nào được chọn\"\r\nt MSG_087 \"cho %s NAND\"\r\nt MSG_088 \"Tệp tin quá lớn\"\r\nt MSG_089 \"Tệp tin quá lớn cho thiết bị đích đã chọn.\"\r\nt MSG_090 \"ISO không được hỗ trợ\"\r\nt MSG_091 \"Khi sử dụng kiểu hệ thống khởi động UEFI, chỉ hỗ trợ các tệp ISO có khả năng khởi động bằng EFI. Vui lòng chọn một tệp ISO có hỗ trợ EFI hoặc chuyển kiểu hệ thống khởi động sang BIOS.\"\r\nt MSG_092 \"Hệ thống tập tin không được hỗ trợ\"\r\nt MSG_093 \"QUAN TRỌNG: Ổ ĐĨA NÀY CHỨA NHIỀU PHÂN VÙNG!!\\n\\nCó thể bao gồm phân vùng/ổ đĩa không có trong danh sách hoặc không hiển thị trong Windows. Nếu bạn tiến hành, bạn sẽ phải chịu trách nhiệm về mọi tổn thất dữ liệu trên những phân vùng này.\"\r\nt MSG_094 \"Đã phát hiện nhiều phân vùng\"\r\nt MSG_095 \"Tệp tin DD\"\r\nt MSG_096 \"Không thể dùng loại ISO này với hệ thống tập tin đã chọn. Vui lòng chọn một hệ thống tập tin hoặc chọn tệp ISO khác.\"\r\nt MSG_097 \"Chỉ có thể áp dụng '%s' nếu hệ thống tập tin là NTFS.\"\r\nt MSG_098 \"QUAN TRỌNG: Bạn đang cố cài đặt Windows To Go, nhưng ổ đĩa đích của bạn không có thuộc tính “CỐ ĐỊNH” (FIXED). Do đó, Windows có thể bị treo khi khởi động, vì Microsoft không thiết kế Windows To Go để hoạt động với ổ đĩa có thuộc tính “THÁO RỜI” (REMOVABLE).\\n\\nBạn có chắc chắn muốn tiếp tục không?\\n\\nLưu ý: Thuộc tính “CỐ ĐỊNH/THÁO RỜI” là một đặc điểm phần cứng và chỉ có thể thay đổi bằng công cụ đặc biệt từ nhà sản xuất ổ đĩa. Tuy nhiên, những công cụ này HẦU NHƯ KHÔNG bao giờ được cung cấp cho người dùng phổ thông...\"\r\nt MSG_099 \"Giới hạn tập tin hệ thống\"\r\nt MSG_100 \"Tệp ISO này có chứa một tập tin lớn hơn 4 GB, lớn hơn kích thước tập tin tối đa được hệ thống FAT hoặc FAT32 cho phép.\"\r\nt MSG_101 \"Thiếu hỗ trợ WIM\"\r\nt MSG_102 \"Nền tảng của bạn không thể giải nén tệp từ lưu trữ WIM. Việc giải nén WIM là cần thiết để tạo đĩa USB khởi động Windows 7 và Windows Vista có hỗ trợ EFI. Bạn có thể khắc phục điều này bằng cách cài phiên bản mới nhất của 7-Zip.\\nBạn muốn truy cập trang tải xuống của 7-Zip?\"\r\nt MSG_103 \"Tải xuống %s?\"\r\nt MSG_104 \"%s hoặc mới hơn yêu cầu tập tin '%s' được cài đặt.\\nVì tập tin này lớn hơn 100 KB, và luôn có trong các tệp ISO %s, nó không được kèm theo trong Rufus.\\n\\nRufus có thể tải xuống tập tin còn thiếu cho bạn:\\n- Chọn 'Có' để kết nối với Internet và tải tập tin\\n- Chọn 'Không' nếu bạn muốn tự chép tập tin này trên đĩa lúc khác\\n\\nGhi chú: tập tin sẽ được tải xuống thư mục hiện tại và khi '%s' tồn tại ở đó, nó sẽ tự động được tái sử dụng.\"\r\nt MSG_105 \"Huỷ bỏ có thể làm thiết bị rơi vào trạng thái KHÔNG THỂ SỬ DỤNG.\\nNếu bạn chắc chắn muốn huỷ, chọn CÓ. Nếu không, hãy chọn KHÔNG.\"\r\nt MSG_106 \"Vui lòng chọn thư mục\"\r\nt MSG_107 \"Tất cả tập tin\"\r\nt MSG_108 \"Nhật ký Rufus\"\r\nt MSG_109 \"0x%02X (Đĩa %d)\"\r\nt MSG_110 \"MS-DOS không thể khởi động từ ổ đĩa có kích thước cụm là 64 kilobyte.\\nVui lòng thay đổi kích thước cụm hoặc sử dụng FreeDOS thay thế.\"\r\nt MSG_111 \"Kích thước cụm không tương thích\"\r\nt MSG_112 \"Định dạng ổ UDF lớn có thể mất nhiều thời gian. Với tốc độ của USB 2.0, thời gian định dạng dự kiến là %d:%02d, trong lúc này thanh tiến trình sẽ không thay đổi. Vui lòng kiên nhẫn!\"\r\nt MSG_113 \"Ổ UDF lớn\"\r\nt MSG_114 \"Tệp này dùng Syslinux %s%s nhưng ứng dụng này chỉ bao gồm tập tin cài đặt cho Syslinux %s%s.\\n\\nPhiên bản mới của Syslinux không tương thích với các phiên bản khác, và Rufus không thể kèm theo tất cả chúng, bạn phải tải xuống thêm hai tập tin từ Internet ('ldlinux.sys' và 'ldlinux.bss'):\\n- Chọn 'Có' để kết nối tới Internet và tải xuống những tập tin này\\n- Chọn 'Không' để huỷ hoạt động\\n\\nChú ý: Các tập tin sẽ được tải xuống vào thư mục ứng dụng hiện tại và sẽ được tự tái sử dụng nếu có.\"\r\nt MSG_115 \"Yêu cầu tải xuống\"\r\nt MSG_116 \"Tệp này dùng Grub %s nhưng ứng dụng này chỉ bao gồm tập tin cài đặt cho Grub %s.\\n\\nCác phiên bản khác nhau của Grub có thể không tương thích với nhau, và Rufus không thể kèm theo tất cả chúng, ứng dụng sẽ cố tìm một phiên bản tập tin cài đặt Grub ('core.img') khớp với phiên bản có trong tệp của bạn:\\n- Chọn 'Có' để kết nối tới Internet và thử tải nó xuống\\n- Chọn 'Không' để dùng phiên bản mặc định từ Rufus\\n- Chọn 'Huỷ' để bỏ qua hoạt động\\n\\nChú ý: Các tập tin sẽ được tải xuống vào thư mục ứng dụng hiện tại và sẽ được tự tái sử dụng nếu có. Nếu không tìm thấy bản trùng khớp nào trực tuyến thì phiên bản mặc định sẽ được sử dụng.\"\r\nt MSG_117 \"Cài đặt Windows tiêu chuẩn\"\r\nt MSG_119 \"thuộc tính ổ đĩa nâng cao\"\r\nt MSG_120 \"tùy chọn định dạng nâng cao\"\r\nt MSG_121 \"Hiện %s\"\r\nt MSG_122 \"Ẩn %s\"\r\nt MSG_123 \"Kích thước phân vùng cố định\"\r\nt MSG_124 \"Không cố định\"\r\nt MSG_125 \"Đặt kích thước phân vùng cố định cho live USB. Đặt kích thước là 0 để bỏ phân vùng cố định.\"\r\nt MSG_126 \"Chọn đơn vị kích thước cho phân vùng.\"\r\nt MSG_127 \"Không hiển thị lại thông báo này\"\r\nt MSG_128 \"Chú ý quan trọng về %s\"\r\nt MSG_129 \"Bạn vừa mới tạo ổ đĩa sử dung UEFI:NTFS bootloader. Hãy nhớ rằng để khởi động được đĩa này BẠN PHẢI VÔ HIỆU SECURE BOOT.\\nĐể hiểu tại sao nó quan trọng, xem trong phần 'Thông tin thêm' phía dưới.\"\r\nt MSG_130 \"Chọn file ảnh Windows\"\r\nt MSG_131 \"File ISO này chứa nhiều tệp ảnh Windows.\\nHãy chọn tệp ảnh bạn muốn sử dung cho việc cài đặt này:\"\r\nt MSG_132 \"Có một chương trình hoặc tiến trình khác đang truy cập ổ. Bạn vẫn muốn định dạng ổ đĩa?\"\r\nt MSG_133 \"Rufus nhận thấy bạn đang cố gắng tạo ổ đĩa Windows To Go dựa vào ISO phiên bản 1809.\\n\\nBởi vì một *LỖI CỦA MICROSOFT*, ổ đĩa này sẽ bị lỗi trong quá trình khởi động Windows (Màn hình xanh chết chóc), trừ khi bạn thay thế thủ công file 'WppRecorder.sys' của phiên bản 1803.\\n\\nCũng xin lưu ý rằng Rufus không thể tự động sửa lỗi này vì file 'WppRecorder.sys' thuộc bản quyền của Microsoft, vì vậy chúng tôi không thể nhúng file này vào chương trình...\"\r\nt MSG_134 \"Bởi vì MBR được chọn để định dạng phân vùng, Rufus chỉ có thể tạo phân vùng tới 2 TB cho ổ đĩa này, việc này sẽ bỏ phí %s không được sử dung.\\n\\nBạn có muốn tiếp tục?\"\r\nt MSG_135 \"Phiên bản\"\r\nt MSG_136 \"Phát hành\"\r\nt MSG_137 \"Chế bản\"\r\nt MSG_138 \"Ngôn ngữ\"\r\nt MSG_139 \"Kiến trúc\"\r\nt MSG_140 \"Tiếp tục\"\r\nt MSG_141 \"Quay lại\"\r\nt MSG_142 \"Vui lòng đợi...\"\r\nt MSG_143 \"Tải bằng trình duyệt\"\r\nt MSG_144 \"Việc tải các tệp ISO Windows không có sẵn bởi Microsoft đã chỉnh lại trang web của họ để chống lại điều này.\"\r\nt MSG_145 \"Yêu cầu phiên bản PowerShell 3.0 hoặc cao hơn để chạy đoạn mã này.\"\r\nt MSG_146 \"Bạn có muốn kết nối Internet và tải nó?\"\r\nt MSG_148 \"Đang chạy đoạn mã tải file...\"\r\nt MSG_149 \"Tải tệp tin ISO\"\r\nt MSG_150 \"Loại máy tính mà bạn định sử dung với ổ có thể khởi động này. Bạn có trách nhiệm phải tìm hiểu máy đó là kiểu BIOS hay UEFI trước khi bạn tạo ổ đĩa, bởi nó có thể bị lỗi khi khởi động.\"\r\nt MSG_151 \"'UEFI-CSM' nghĩa là thiết bị chỉ có thể boot ở chế độ giả lập BIOS (hay còn gọi là 'Legacy Mode') bên trong chế độ UEFI, và nó không phải là chế độ thuần UEFI.\"\r\nt MSG_152 \"'non CSM' nghĩa là thiết bị chỉ có thể boot ở chế độ thuần UEFI mà không phải chế độ giả lập BIOS (hay còn gọi là 'Legacy Mode')\"\r\nt MSG_153 \"Mẫu thử: 0x%02X\"\r\nt MSG_154 \"Mẫu thử: 0x%02X, 0x%02X\"\r\nt MSG_155 \"Mẫu thử: 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_156 \"Mẫu thử: 0x%02X, 0x%02X, 0x%02X, 0x%02X\"\r\nt MSG_157 \"Đặt loại hệ thống tập tin\"\r\nt MSG_158 \"Kích thước tối thiểu của khối dữ liệu sẽ chiếm dụng trong hệ thống tập tin\"\r\nt MSG_159 \"Dùng trường này để đặt tên đĩa.\\nCác ký tự quốc tế được chấp nhận.\"\r\nt MSG_160 \"Bật/tắt các tuỳ chọn nâng cao\"\r\nt MSG_161 \"Kiểm tra thiết bị tìm khối lỗi bằng mẫu kiểm tra\"\r\nt MSG_162 \"Bỏ chọn mục này để dùng cách định dạng \\\"chậm\\\"\"\r\nt MSG_163 \"Cách thức để tạo phân vùng\"\r\nt MSG_164 \"Cách thức để tạo ổ đĩa có thể khởi động\"\r\nt MSG_165 \"Nhấn để chọn hoặc tải file ảnh...\"\r\nt MSG_166 \"Chọn mục này để cho phép hiện tên ổ đĩa toàn hệ thống và đặt biểu tượng thiết bị (khởi tạo autorun.inf)\"\r\nt MSG_167 \"Cài đặt bộ khởi động UEFI, cùng với việc tiến trình xác thực MD5Sum của phương tiện\"\r\nt MSG_169 \"Tạo một phân vùng ẩn khác và thử sắp xếp ranh giới phân vùng.\\nĐiều này có thể cải thiện khả năng phát hiện khởi động cho BIOS cũ.\"\r\nt MSG_170 \"Bật hiển thị các ổ cứng gắn ngoài qua USB. TỰ CHỊU RỦI RO KHI SỬ DỤNG!!!\"\r\nt MSG_171 \"Bắt đầu hoạt động định dạng.\\nViệc này sẽ TIÊU HUỶ mọi dữ liệu trên đĩa đã chọn!\"\r\nt MSG_172 \"Chữ kí tải xuống không hợp lệ\"\r\nt MSG_173 \"Nhấn để chọn...\"\r\nt MSG_174 \"Rufus - Tiện ích Định dạng USB Đáng tin cậy\"\r\nt MSG_175 \"Phiên bản %d.%d (Bản dựng %d)\"\r\nt MSG_176 \"Bản dịch Tiếng Việt:\\\\line• thanhtai2009 <mailto:thanhtai2009@outlook.com>\\\\line• caobach <mailto:caobach@gmail.com>\\\\line• Nguyễn Quang Minh (MinhNQ101) <mailto:admin@quangminh.name.vn>\"\r\nt MSG_177 \"Báo lỗi hoặc yêu cầu cải tiến tại:\"\r\nt MSG_178 \"Các bản quyền bổ sung:\"\r\nt MSG_179 \"Chính sách cập nhật:\"\r\nt MSG_180 \"Nếu bạn chọn cho phép chương trình này kiểm tra cập nhật ứng dụng, bạn đồng ý rằng những thông tin dưới đây có thể được thu thập trên (các) máy chủ của chúng tôi:\"\r\nt MSG_181 \"Kiến trúc và phiên bản hệ điều hành của bạn\"\r\nt MSG_182 \"Phiên bản của ứng dụng bạn đang dùng\"\r\nt MSG_183 \"Địa chỉ IP của bạn\"\r\nt MSG_184 \"Vì mục đích tạo thống kê sử dụng riêng tư, chúng tôi có thể giữ thông tin đã thu thập, \\\\b tối đa một năm\\\\b0 . Tuy nhiên, chúng tôi sẽ không tiết lộ bất kỳ dữ liệu cá nhân nào cho bên thứ ba.\"\r\nt MSG_185 \"Tiến trình cập nhật:\"\r\nt MSG_186 \"Rufus không cài đặt hoặc chạy dịch vụ nền, do đó việc kiểm tra cập nhật chỉ được thực hiện khi ứng dụng chính đang chạy.\\\\line\\nQuyền truy cập Internet dĩ nhiên cần thiết khi kiểm tra cập nhật.\"\r\nt MSG_187 \"Tệp tin không hợp lệ cho tuỳ chọn khởi động đã chọn\"\r\nt MSG_188 \"Tệp tin hiện tại không hợp với tuỳ chọn khởi động đã chọn. Vui lòng chọn tệp hoặc tuỳ chọn khởi động khác.\"\r\nt MSG_189 \"Tệp ISO không tương thích với hệ thống tập tin đã chọn\"\r\nt MSG_190 \"Phát hiện ổ đĩa không tương thích\"\r\nt MSG_191 \"Ghi đã đạt\"\r\nt MSG_192 \"Đọc đã đạt\"\r\nt MSG_193 \"Đã tải xuống %s\"\r\nt MSG_194 \"Không thể tải xuống %s\"\r\nt MSG_195 \"Dùng phiên bản (các) tập tin %s được nhúng sẵn\"\r\nt MSG_196 \"QUAN TRỌNG: ĐĨA NÀY DÙNG KÍCH CỠ CUNG KHÔNG CHUẨN!\\n\\nỔ cứng thông thường dùng kích cỡ cung 512-byte nhưng ổ đĩa này lại dùng %d byte. Trong nhiều trường hợp, điều này có nghĩa bạn sẽ KHÔNG thể khởi động từ ổ đĩa này.\\nRufus có thể thử tạo một ổ đĩa khởi động, nhưng KHÔNG ĐẢM BẢO rằng nó sẽ hoạt động.\"\r\nt MSG_197 \"Phát hiện kích cỡ cung không chuẩn\"\r\nt MSG_198 \"'Windows To Go chỉ có thể được cài đặt trên ổ đĩa đã phân vùng GPT nếu nó có tập thuộc tính CỐ ĐỊNH. Ổ đĩa hiện tại không phải CỐ ĐỊNH.\"\r\nt MSG_199 \"Tính năng này không khả dụng trên nền tảng này.\"\r\nt MSG_201 \"Đang huỷ - Vui lòng chờ...\"\r\nt MSG_202 \"Đang quét tệp...\"\r\nt MSG_203 \"Không thể quét tệp\"\r\nt MSG_204 \"Đã phát hiện %s lỗi thời\"\r\nt MSG_205 \"Đang dùng tệp: %s\"\r\nt MSG_206 \"Thiếu tập tin %s\"\r\nt MSG_207 \"O_DIA_MOI\"\r\nt MSG_208 \"Phát hiện %d thiết bị\"\r\nt MSG_209 \"Phát hiện %d thiết bị\"\r\nt MSG_210 \"SẴN SÀNG\"\r\nt MSG_211 \"Đã huỷ\"\r\nt MSG_212 \"Thất bại\"\r\nt MSG_213 \"Đang khởi chạy ứng dụng mới...\"\r\nt MSG_214 \"Không thể khởi chạy ứng dụng mới\"\r\nt MSG_215 \"Đã mở %s\"\r\nt MSG_216 \"Đã lưu %s\"\r\nt MSG_217 \"Đang định dạng: %s\"\r\nt MSG_218 \"Đang tạo hệ thống tập tin: Tác vụ đã hoàn tất %d/%d\"\r\nt MSG_219 \"Sắp xếp NTFS: %d%% đã hoàn thành\"\r\nt MSG_220 \"Đang định dạng (%s) - thời gian dự kiến %d:%02d...\"\r\nt MSG_221 \"Đang đặt tên (%s)...\"\r\nt MSG_222 \"Đang định dạng (%s)...\"\r\nt MSG_223 \"Sắp xếp NTFS (Kiểm tra đĩa)...\"\r\nt MSG_224 \"Đang xoá cấu trúc MBR/PBR/GPT...\"\r\nt MSG_225 \"Đang yêu cầu truy cập đĩa...\"\r\nt MSG_226 \"Đang phân tích bản ghi khởi động đang có...\"\r\nt MSG_227 \"Đang đóng ổ đang có...\"\r\nt MSG_228 \"Đang ghi bản ghi khởi động chính...\"\r\nt MSG_229 \"Đang ghi bản ghi khởi động phân vùng...\"\r\nt MSG_230 \"Đang chép các tập tin DOS...\"\r\nt MSG_231 \"Đang chép các tập tin ISO: %s\"\r\nt MSG_232 \"Cài đặt khởi động Win7 EFI (%s)...\"\r\nt MSG_233 \"Đang hoàn thiện, vui lòng chờ...\"\r\nt MSG_234 \"Đang cài đặt Syslinux %s...\"\r\nt MSG_235 \"Khối hỏng: %s %d/%d - %0.2f%% (%d/%d/%d lỗi)\"\r\nt MSG_236 \"Khối hỏng: Kiểm tra với mẫu ngẫu nhiên\"\r\nt MSG_237 \"Khối hỏng: Kiểm tra với mẫu 0x%02X\"\r\nt MSG_238 \"Đang phân vùng (%s)...\"\r\nt MSG_239 \"Đang xoá phân vùng (%s)...\"\r\nt MSG_240 \"Chữ kí cho bản cập nhật không thể chứng thực. Lỗi này có thể do hệ thống của bạn không được cấu hình chuẩn để chứng thực chữ ký hoặc bản tải bị lỗi.\\n\\nFile tải sẽ bị xóa. Kiểm tra log để biết thêm thông tin.\"\r\nt MSG_241 \"Đang tải xuống: %s\"\r\nt MSG_242 \"Không thể tải xuống tập tin.\"\r\nt MSG_243 \"Đang kiểm tra cập nhật Rufus...\"\r\nt MSG_244 \"Cập nhật: Không thể kết nối với Internet\"\r\nt MSG_245 \"Cập nhật: Không thể truy cập dữ liệu phiên bản\"\r\nt MSG_246 \"Đã có phiên bản mới của Rufus!\"\r\nt MSG_247 \"Không tìm thấy phiên bản mới của Rufus\"\r\nt MSG_248 \"Đã xoá các khoá registry của ứng dụng thành công\"\r\nt MSG_249 \"Không thể xoá các khoá registry của ứng dụng\"\r\nt MSG_250 \"%s được kích hoạt\"\r\nt MSG_251 \"%s bị vô hiệu\"\r\nt MSG_252 \"Kiểm tra kích cỡ\"\r\nt MSG_253 \"Phát hiện đĩa cứng\"\r\nt MSG_254 \"Buộc định dạng FAT32 lớn\"\r\nt MSG_255 \"NoDriveTypeAutorun sẽ bị xoá khi thoát\"\r\nt MSG_256 \"Phát hiện ổ đĩa giả\"\r\nt MSG_257 \"Hỗ trợ Joliet\"\r\nt MSG_258 \"Hỗ trợ Rock Ridge\"\r\nt MSG_259 \"Buộc cập nhật\"\r\nt MSG_260 \"Nén NTFS\"\r\nt MSG_261 \"Ghi tệp: %s\"\r\nt MSG_262 \"Hỗ trợ ISO\"\r\nt MSG_263 \"Dùng đơn vị kích cỡ ĐÚNG\"\r\nt MSG_264 \"Đang xoá thư mục '%s'\"\r\nt MSG_265 \"Phát hiện đĩa VMWare\"\r\nt MSG_266 \"Chế độ Dual UEFI/BIOS\"\r\nt MSG_267 \"Đang áp dụng tệp Windows: %s\"\r\nt MSG_268 \"Đang áp dụng tệp Windows...\"\r\nt MSG_269 \"Giữ dấu thời gian\"\r\nt MSG_270 \"Gỡ rối USB\"\r\nt MSG_271 \"Đang tính toán kiểm tổng tệp: %s\"\r\nt MSG_272 \"Tính toán giá trị tổng kiểm tra MD5, SHA1 và SHA256 với tệp đã chọn\"\r\nt MSG_273 \"Thay đổi ngôn ngữ ứng dụng\"\r\nt MSG_274 \"Đã phát hiện tệp %s\"\r\nt MSG_275 \"Tệp bạn đã chọn là một tệp 'ISOHybrid'. Điều này có nghĩa nó có thể được ghi trong chế độ %s (chép tập tin) hoặc %s (tệp đĩa).\\nRufus khuyến cáo sử dụng chế độ %s, để bạn luôn có toàn quyền truy cập ổ đĩa sau khi ghi nó.\\nTuy nhiên, nếu bạn gặp vấn đề trong lúc khởi động, bạn có thể thử ghi lại tệp này trong chế độ %s.\\n\\nHãy chọn chế độ mà bạn muốn dùng để ghi tệp này:\"\r\nt MSG_276 \"Ghi với chế độ %s (Khuyến cáo)\"\r\nt MSG_277 \"Ghi với chế độ %s\"\r\nt MSG_278 \"Đang kiểm tra các tiến trình xung đột...\"\r\nt MSG_279 \"Không có khả năng khởi động\"\r\nt MSG_280 \"Đĩa hoặc tệp tin ISO\"\r\nt MSG_281 \"%s (Vui lòng chọn)\"\r\nt MSG_282 \"Chặn truy cập ổ USB từ chương trình khác\"\r\nt MSG_283 \"Chữ ký không hợp lệ\"\r\nt MSG_284 \"Tập tin thực thi đã tải xuống thiếu chữ ký số.\"\r\nt MSG_285 \"Tập tin thực thi đã tải xuống được ký bởi '%s'.\\nĐây không phải chữ ký số chúng tôi công nhận và có thể xác định là một dạng hoạt động nguy hiểm...\\nBạn chắc muốn chạy tập tin này?\"\r\nt MSG_286 \"Đang ghi đè giá trị 0 lên ổ: %s\"\r\nt MSG_287 \"Phát hiện ổ đĩa tháo được không phải USB\"\r\nt MSG_288 \"Thiếu quyền quản trị\"\r\nt MSG_289 \"Ứng dụng này chỉ có thể chạy với đặc quyền quản trị\"\r\nt MSG_290 \"Lập chỉ mục tập tin\"\r\nt MSG_291 \"Chọn phiên bản\"\r\nt MSG_292 \"Hãy chọn phiên bản Windows bạn muốn cài đặt:\"\r\nt MSG_293 \"Phiên bản Windows không được hỗ trợ\"\r\nt MSG_294 \"Phiên bản này của Windows không còn được Rufus hỗ trợ nữa.\\nPhiên bản cuối cùng của Rufus tương thích với nền tảng này là v%d.%d.\"\r\nt MSG_295 \"Cảnh báo: Phiên bản không chính thức\"\r\nt MSG_296 \"Phiên bản Rufus này KHÔNG PHẢI do chính tác giả tạo ra.\\n\\nBạn chắc muốn tiếp tục chạy chứ?\"\r\nt MSG_297 \"Đã phát hiện ISO bị cắt xén\"\r\nt MSG_298 \"Tập tin ISO bạn đã chọn không trùng khớp kích cỡ của nó: thiếu mất %s dữ liệu!\\n\\nnếu bạn tải tập tin này từ Internet, bạn nên tải lại một bản sao mới và xác nhận rằng mã MD5 hoặc SHA trùng khớp với bản chính thức.\\n\\nHãy nhớ rằng bạn có thể tính mã MD5 hoặc SHA trong Rufus bằng cách chọn nút (✓).\"\r\nt MSG_299 \"Lỗi xác thực dấu thời gian\"\r\nt MSG_300 \"Rufus không thể xác thực liệu dấu thời gian trên phiên bản cập nhật được tải xuống gần đây có mới hơn so với phiên bản đang chạy.\\n\\nĐể tránh nguy cơ bị tấn công tiềm ẩn, quá trình cập nhật đã bị hủy và file tải sẽ bị xóa. Hãy kiểm tra log để biết thêm thông tin.\"\r\nt MSG_301 \"Hiển thị cài đặt chương trình\"\r\nt MSG_302 \"Hiện thông tin về chương trình\"\r\nt MSG_303 \"Hiển thị log\"\r\nt MSG_304 \"Tạo file ảnh ổ đĩa từ thiết bị được chọn\"\r\nt MSG_305 \"Sử dụng tùy chọn này để chỉ thị rằng hoặc bạn muốn cài Windows lên một ổ đĩa khác, hoặc nếu bạn muốn chạy Windows trực tiếp từ thiết bị này (Windows To Go).\"\r\nt MSG_306 \"Đang ghi đè nhanh giá trị 0 lên ổ đĩa: %s\"\r\nt MSG_307 \"điều này có thể mất một thời gian\"\r\nt MSG_308 \"phát hiện VHD\"\r\nt MSG_309 \"Lưu trữ đã nén\"\r\nt MSG_310 \"ISO bạn đã chọn sử dụng UEFI và đủ nhỏ để ghi dưới dạng Phân vùng hệ thống EFI (ESP). Ghi vào một ESP, thay vì ghi vào một phân vùng dữ liệu chung chiếm toàn bộ đĩa, có thể thích hợp hơn đối với một số loại cài đặt.\\n\\nVui lòng chọn chế độ mà bạn muốn sử dụng để viết hình ảnh này:\"\r\nt MSG_311 \"Sử dụng %s (tại cửa sổ chính của phần mềm) để thực thi.\"\r\nt MSG_312 \"Các băm thêm (SHA512)\"\r\nt MSG_313 \"Lưu vào VHD\"\r\nt MSG_314 \"Đang tính tổng kiểm cùa tệp\"\r\nt MSG_315 \"Nhiều nút\"\r\nt MSG_316 \"Số lượng đã đạt\"\r\nt MSG_317 \"ID ổ đĩa\"\r\nt MSG_318 \"Mặc định thứ tự ưu tiên luồng: %d\"\r\nt MSG_319 \"Bỏ qua đánh dấu khởi động\"\r\nt MSG_320 \"Đang làm mới bố cục phân vùng (%s)...\"\r\nt MSG_321 \"Hình ảnh bạn đã chọn là một ISOHybrid, nhưng những người tạo ra nó đã không làm cho nó tương thích với chế độ sao chép ISO/Tệp.\\nDo đó, chế độ ghi hình ảnh DD sẽ được thực thi.\"\r\nt MSG_322 \"Không thể mở hoặc đọc '%s'\"\r\nt MSG_325 \"Đang áp dụng tuỳ biến Windows: %s\"\r\nt MSG_326 \"Đang áp dụng các cài đặt người dùng...\"\r\nt MSG_328 \"Tuỳ biến cài đặt Windows?\"\r\nt MSG_329 \"Loại bỏ yêu cầu 4GB+ RAM, Secure Boot và TPM 2.0\"\r\nt MSG_330 \"Loại bỏ yêu cầu tài khoản Microsoft trực tuyến\"\r\nt MSG_331 \"Loại bỏ thu thập thông tin (Bỏ qua các câu hỏi riêng tư)\"\r\nt MSG_332 \"Ngăn cản Windows To Go truy cập ổ đĩa trong\"\r\nt MSG_333 \"Tạo tài khoản nội bộ với tên người dùng:\"\r\nt MSG_334 \"Đặt các cài đặt địa phương cùng giá trị với người dùng hiện tại\"\r\nt MSG_335 \"Vô hiệu tự động mã hoá thiết bị BitLocker\"\r\nt MSG_336 \"Nhật ký lưu vĩnh viễn\"\r\nt MSG_337 \"Một tệp tin bổ sung ('%s') từ Microsoft để sử dụng tính năng này:\\n- Chọn 'Có' để kết nối tới Internet và tải nó xuống\\n- Chọn 'Không' để huỷ tiến trình\\n\\nGhi chú: Tệp tin sẽ được tải xuống tại đường dẫn của phần mềm và sẽ được tự động tái sử dụng nếu có sẵn.\"\r\nt MSG_338 \"Đã phát hiện bộ khởi động UEFI bị thu hồi\"\r\nt MSG_339 \"Rufus đã phát hiện ra rằng tệp ISO bạn đã chọn có chứa một bộ khởi động UEFI đã bị thu hồi và nó sẽ tạo ra %s, khi Secure Boot được kích hoạt trên một hệ thống UEFI được cập nhật đầy đủ và mới nhất.\\n\\n- Nếu bạn sở hữu tệp ISO này từ một nguồn không đáng tin cậy, bạn nên cân nhắc khả năng có thể chứa mã độc UEFI và tránh khởi động từ nó.\\n- Nếu bạn sở hữu từ một nguồn uy tín, bạn nên thử tìm một bản mới hơn, theo đó cảnh báo này sẽ không hiện ra.\"\r\nt MSG_340 \"một màn hình \\\"Vi phạm Bảo mật\\\"\"\r\nt MSG_341 \"một Màn hình Khôi phục Windows (BSOD) với '%s'\"\r\nt MSG_342 \"Tệp VHDX đã nén\"\r\nt MSG_343 \"Tệp VHD chưa nén\"\r\nt MSG_344 \"Ghi Đầy đủ Tệp Cập nhật\"\r\nt MSG_345 \"Một vài dữ liệu phải được tải xuống từ Microsoft để sử dụng tính năng này:\\n- Chọn 'Có' để kết nối tới Internet và tải xuống nó\\n- Chọn 'Không' để huỷ tiến trình\"\r\nt MSG_346 \"Giới hạn Windows vào S-Mode (KHÔNG TƯƠNG THÍCH với việc bỏ qua tài khoản trực tuyến)\"\r\nt MSG_347 \"Chế độ Chuyên nghiệp\"\r\nt MSG_348 \"Đang giải nén tệp lưu trữ: %s\"\r\nt MSG_349 \"Sử dụng Rufus MBR\"\r\nt MSG_350 \"Sử dụng bootloader đã được ký bởi chứng chỉ “Windows UEFI CA 2023” (TÍNH NĂNG THỬ NGHIỆM)\"\r\nt MSG_351 \"Đang kiểm tra trạng thái thu hồi của bootloader UEFI...\"\r\nt MSG_352 \"Đang kiểm tra cập nhật cơ sở dữ liệu chặn (DBX) của UEFI…\"\r\nt MSG_353 \"Đã phát hiện bản cập nhật DBX của UEFI\"\r\nt MSG_354 \"Rufus đã phát hiện phiên bản cập nhật của các tệp DBX, được dùng để kiểm tra thu hồi Secure Boot trong UEFI. Bạn có muốn tải bản cập nhật này không?\\n- Chọn “Có” để kết nối Internet và tải nội dung này.\\n- Chọn “Không” để hủy thao tác.\\n\\nLưu ý: Các tệp sẽ được tải về thư mục của ứng dụng và sẽ tự động được sử dụng lại nếu đã có sẵn.\"\r\nt MSG_900 \"Rufus là một tiện ích giúp định dạng và tạo khả năng khởi động cho các thiết bị USB, ví dụ như thẻ USB/đĩa di động, thẻ nhớ, v.v...\"\r\nt MSG_901 \"Trang web chính thức: %s\"\r\nt MSG_902 \"Mã nguồn: %s\"\r\nt MSG_903 \"Nhật ký thay đổi: %s\"\r\nt MSG_904 \"Phần mềm này đã được cấp phép dưới các điều khoản của GNU Public License (GPL) phiên bản 3.\\nXem tại https://www.gnu.org/licenses/gpl-3.0.html để biết thêm chi tiết.\"\r\nt MSG_905 \"Khởi động\"\r\nt MSG_910 \"Định dạng USB, thẻ nhớ hoặc ổ nhớ ảo với FAT/FAT32/NTFS/UDF/exFAT/ReFS/ext2/ext3\"\r\nt MSG_911 \"Tạo USB có thể khởi động với FreeDOS\"\r\nt MSG_912 \"Tạo ổ đĩa có thể khởi động từ các file ISO có thể khởi động (Windows, Linux, v.v...)\"\r\nt MSG_913 \"Tạo ổ đĩa có thể khởi động từ các tệp đĩa có thể khởi động, bao gồm cả tệp nén\"\r\nt MSG_914 \"Tạo ổ đĩa có thể khởi động với hệ thống BIOS hoặc UEFI, bao gồm cả NTFS có thể khởi động với UEFI\"\r\nt MSG_915 \"Tạo ổ đĩa 'Windows To Go'\"\r\nt MSG_916 \"Tạo ổ đĩa cài đặt Windows 11 cho các máy tính không có TPM hoặc Secure Boot\"\r\nt MSG_917 \"Tạo phân vùng Linux liên tục\"\r\nt MSG_918 \"Tạo tệp VHD/DD từ ổ đĩa đã chọn\"\r\nt MSG_919 \"Tính tổng kiểm MD5, SHA-1, SHA-256 và SHA-512 của tệp đã chọn\"\r\nt MSG_920 \"Thực hiện kiểm tra điểm lỗi, bao gồm phát hiện ổ đĩa \\\"giả\\\"\"\r\nt MSG_921 \"Tải xuống các tệp Microsoft Windows ISO bán lẻ chính thức\"\r\nt MSG_922 \"Tải xuống các tệp UEFI Shell ISO\"\r\n\r\n"
  },
  {
    "path": "res/mbr/bochsrc.bxrc",
    "content": "# configuration file generated by Bochs\nplugin_ctrl: unmapped=true, biosdev=true, speaker=true, extfpuirq=true, parallel=true, serial=true, gameport=true, iodebug=true\nconfig_interface: win32config\ndisplay_library: win32, options=\"gui_debug\"\nmemory: host=32, guest=32\nromimage: file=\"C:\\Program Files\\Bochs\\BIOS-bochs-latest\", address=0x00000000, options=none\nvgaromimage: file=\"C:\\Program Files\\Bochs\\VGABIOS-lgpl-latest\"\nboot: disk\nfloppy_bootsig_check: disabled=0\n# no floppya\n# no floppyb\nata0: enabled=true, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14\nata0-master: type=disk, path=\"C:\\Projects\\rufus\\res\\mbr\\disk.img\", mode=flat, cylinders=64, heads=10, spt=32, sect_size=512, model=\"Virtual HDD\", biosdetect=auto, translation=lba\nata0-slave: type=none\nata1: enabled=true, ioaddr1=0x170, ioaddr2=0x370, irq=15\nata1-master: type=none\nata1-slave: type=none\nata2: enabled=false\nata3: enabled=false\noptromimage1: file=none\noptromimage2: file=none\noptromimage3: file=none\noptromimage4: file=none\noptramimage1: file=none\noptramimage2: file=none\noptramimage3: file=none\noptramimage4: file=none\npci: enabled=1, chipset=i440fx\nvga: extension=vbe, update_freq=5, realtime=1\ncpu: count=1, ips=4000000, model=bx_generic, reset_on_triple_fault=1, cpuid_limit_winnt=0, ignore_bad_msrs=1, mwait_is_nop=0\ncpuid: level=6, stepping=3, model=3, family=6, vendor_string=\"GenuineIntel\", brand_string=\"              Intel(R) Pentium(R) 4 CPU        \"\ncpuid: mmx=true, apic=xapic, simd=sse2, sse4a=false, misaligned_sse=false, sep=true\ncpuid: movbe=false, adx=false, aes=false, sha=false, xsave=false, xsaveopt=false, x86_64=true\ncpuid: 1g_pages=false, pcid=false, fsgsbase=false, smep=false, smap=false, mwait=true\ncpuid: vmx=1\nprint_timestamps: enabled=0\ndebugger_log: -\nmagic_break: enabled=1\nport_e9_hack: enabled=0\nprivate_colormap: enabled=0\nclock: sync=none, time0=local, rtc_sync=0\n# no cmosimage\nlog: -\nlogprefix: %t%e%d\ndebug: action=ignore\ninfo: action=report\nerror: action=report\npanic: action=ask\nkeyboard: type=mf, serial_delay=250, paste_delay=100000, user_shortcut=none\nmouse: type=ps2, enabled=false, toggle=ctrl+mbutton\nsound: waveoutdrv=win, waveout=none, waveindrv=win, wavein=none, midioutdrv=win, midiout=none\nspeaker: enabled=true, mode=sound\nparport1: enabled=true, file=none\nparport2: enabled=false\ncom1: enabled=true, mode=null\ncom2: enabled=false\ncom3: enabled=false\ncom4: enabled=false\n"
  },
  {
    "path": "res/mbr/mbr.S",
    "content": "/********************************************************************************/\n/* Rufus - The Reliable USB Formatting Utility, bootable MBR with user prompt   */\n/*                                                                              */\n/* Copyright (c) 2012 Pete Batard <pete@akeo.ie>                                */\n/*                                                                              */\n/* This program is free software; you can redistribute it and/or modify it      */\n/* under the terms of the GNU General Public License as published by the Free   */\n/* Software Foundation, either version 3 of the License, or (at your option)    */\n/* any later version.                                                           */\n/*                                                                              */\n/* This program is distributed in the hope that it will be useful, but WITHOUT  */\n/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or        */\n/* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for    */\n/* more details.                                                                */\n/*                                                                              */\n/* You should have received a copy of the GNU General Public License along with */\n/* this program; if not, see <http://www.gnu.org/licenses/>.                    */\n/*                                                                              */\n/********************************************************************************/\n\n\n/********************************************************************************/\n/* GNU Assembler Settings:                                                      */\n/********************************************************************************/\n.intel_syntax noprefix\t# Use Intel assembler syntax (same as IDA Pro)\n.code16\t\t\t# MBR code is executed in x86 CPU real/16 bit mode\n/********************************************************************************/\n\n\n/********************************************************************************/\n/* Constants:                                                                   */\n/********************************************************************************/\nDOT_TIMEOUT   = 0x12\t# Number of RTC interrupts for ~ 1s\nDOT_NUMBER    = 0x04\t# Number of dots to be printed before timeout\nMBR_ADDR      = 0x7c00\t# Same address for both original MBR and copy\nMBR_SIZE      = 0x200\nMBR_RESERVED  = 0x1b8\t# Start of the reserved section (partition table, etc.)\nPT_MAX        = 0x04\t# Number of partition entries in the partition table\nPT_ENTRY_SIZE = 0x10\t# Size of a partition entry in the partition table\nINT_RTC       = 0x08\nINT_DSK       = 0x13\nDEBUG         = 0\t# Set to 1 to debug INT13h (shows AH and DL values)\n\n\n/********************************************************************************/\n/* MBR: this section must reside at 0x00007c00, and be exactly 512 bytes        */\n/********************************************************************************/\n.section main, \"ax\"\n.globl mbr\t\t\t# label must be declared global for the linker\nmbr:\n# We must be able to reuse the original memory location that the BIOS copied\n# the MBR to (0x00007c000), so our first task is to copy our MBR data to another\n# location, and run our code from there\n\tinc  cx\t\t\t# Register fixup\n\tdec  bx\n\tinc  bp\n\tdec  di\n\tcld\n\txor  ax, ax\n\tcli\t\t\t# Disable interrupts when fiddling with the stack\n\tmov  ss, ax\t\t# First order of the day it to set up the stack\n\tmov  sp, MBR_ADDR\t# This places the stack right before the original MBR\n\tsti\n\tmov  si, sp\t\t# While we have that value handy\n\tmov  di, sp\n\tpush ds\t\t\t# Now that we have a stack...\n\tpush es\n\tmov  ds, ax\t\t# Original MBR is in segment 0\n\tmov  bx, 0x0413\t\t# McAfee thinks we are a virus if we use 413 directly...\n\tmov  ax,ds:[bx]\n\tdec  ax\t\t\t# Remove 1KB from the RAM for our copy\n\tmov  ds:[bx],ax\n\tshl  ax, 6\t\t# Convert to segment address\n\tsub  ax, MBR_ADDR>>4\t# For convenience of disassembly, so that irrespective\n\tmov  es, ax\t\t# of the segment, our base address remains MBR_ADDR\n\tmov  cx, MBR_SIZE\t# Move our code out of the way\n\trep  movsb\n\tpush ax\t\t\t# Push the CS:IP for our retf\n\tpush offset 0f\n\tretf\n\n# ---------------------------------------------------------------------------\n\n# From this point forward, we are running the copy at the same base but different segment\n0:\tmov  ds, ax\t\t# AX = ES = CS, only DS points back to old seg => fix this\n\txor  ebx, ebx\t\t# Sector #1 in 64 bit address mode (#0)\n\tmov  es, bx\t\t# ES remains set to segment 0 from here on\n\tinc  cx\t\t\t# Sector #1 in CHS address mode (#1) (and CX = 0 from rep movsb)\n\tmov  dx, 0x0081\t\t# drive number (DL), track 0 (DH)\n\tcall read_sector\n\tjb   boot_usb\t\t# If we couldn't get data => just boot USB\n\nread_success:\n\tmov  bx, offset partition_table\n\tmov  cx, PT_MAX\n\ncheck_table:\t\t\t# check the partition table for an active (bootable) partition\n\tcmpb es:[bx], 0x00\n\tjl   found_active\t# 0x80 or greater means the partition is active\n\tjnz  invalid_table\t# anything between 0x01 and 0x7f is invalid\n\tadd  bx, PT_ENTRY_SIZE\t# next partition\n\tloop check_table\n\ninvalid_table:\n\tjmp  boot_usb\n\nfound_active:\n\tmov  si, offset prompt_string\n\tcall print_string\t# Prompt the user\n\tcall flush_keyboard\n\nset_rtc_int_vect:\t\t# Set the interrupt vector for CMOS real-time clock\n\tmov  dx, offset rtc_interrupt\n\tmov  si, offset rtc_interrupt_org\n\tcall set_int_vect\n\nwait_for_keyboard:\n\tmov  ah, 0x01\n\tint  0x16\t\t# KEYBOARD - CHECK BUFFER, DO NOT CLEAR\n\tjnz  boot_usb_rem_rtc\t# Z is clear when characters are present in the buffer\n\tmov  ah, 0x02\n\tint  0x16\t\t# KEYBOARD - GET SHIFT STATUS\n\tand  al, 0x04\t\t# AL = shift status bits\n\tjnz  boot_usb\n\tcmpb ds:counter_dot, 0x00\n\tjg   check_timeout\n\nprint_dot:\t\t\t# Every so often, we print a dot\n\tmov  si, offset dot_string\n\tcall print_string\n\tmovb ds:counter_dot, DOT_TIMEOUT\n\ncheck_timeout:\n\tcmpb ds:counter_timeout, 0x00\n\tjnz  wait_for_keyboard\n\nboot_fixed_disk:\t\t# Timeout occurred => boot second bootable disk (non USB)\n\tcall restore_rtc_vect\t# Remove our RTC override\n\tmovb ds:partition_table, 0x81\t# target we want to swap with 0x80\n\tpush 0x0080\n\nboot_drive:\n\tmov  dx, offset dsk_interrupt\t\t# Set interrupt override for int13h\n\tmov  si, offset dsk_interrupt_org\n\tcall set_int_vect\n\n\tpop  dx\t\t\t# retrieve disk index to feed BR\n\tpop  es\n\tpop  ds\n\tjmp  0:MBR_ADDR\n\n# ---------------------------------------------------------------------------\n\nboot_usb_rem_rtc:\t\t# Boot USB drive (0x80)\n\tcall restore_rtc_vect\t# Remove our RTC override\nboot_usb:\n\tcall flush_keyboard\t# Make sure the keyboard buffer is clear\n\tmov  bx, offset partition_table\n\tmov  dx, ds:[bx]\n\tpush dx\n\tmov  dl, 0x80\t\t# Override disk number, as we're not using our int yet\n\tmov  cx, ds:[bx+2]\n\tmov  ebx, ds:[bx+8]\t# Must come last since it modifies BX\n\tcall read_sector\n\tjnb  boot_drive\n\tpop  es\t\t\t# failed to read PBR from USB - exit back to BIOS\n\tpop  ds\n\tretf\n\n\n/********************************************************************************/\n/* Subroutines                                                                  */\n/********************************************************************************/\n\nread_sector:\t\t\t# Read a single sector in either CHS or LBA mode\n\t\t\t\t# EBX = LBA sector address (32 bit), CH = track\n\t\t\t\t# CL = sector,  DL = drive number, DH = head\n\tpusha\t\t\t# save all registers\n\tmov  ah, 0x41\n\tmov  bx, 0x55aa\n\tint  0x13\n\tjb   no_ext\t\t# failure to get ext\n\tcmp  bx, 0xaa55\n\tjnz  no_ext\n\ttest cx, 1\t\t# is packet access supported?\n\tjz   no_ext\n\next:\t# http://en.wikipedia.org/wiki/INT_13H#INT_13h_AH.3D42h:_Extended_Read_Sectors_From_Drive\n\tpopa\n\tpush ds\n\txor  eax, eax\n\tmov  ds, ax\t\t# We'll use the stack for DAP, which is in seg 0\n\tpush eax\t\t# bits 32-63 of sector address (set to 0)\n\tpush ebx\t\t# bits 0-31 of sector address (EBX)\n\tpush ax\t\t\t# destination segment\n\tpush MBR_ADDR\t\t# destination address\n\tinc  ax\n\tpush ax\t\t\t# number of sectors to be read (1)\n\tpush 0x0010\t\t# size of DAP struct\n\tmov  si, sp\t\t# DAP address (= stack)\n\tmov  ah, 0x42\t\t# Extended Read Sectors From Drive\n\tint  0x13\n\tlahf\n\tadd  sp,0x10\n\tsahf\n\tpop  ds\n\tret\n\nno_ext:\t# http://en.wikipedia.org/wiki/INT_13H#INT_13h_AH.3D02h:_Read_Sectors_From_Drive\n\tpopa\n\tmov  bx, MBR_ADDR\t# CL, CH, DL, DH, ES are already set\n\tmov  ax, 0x0201\n\tint  0x13\n\tret\n\n# ---------------------------------------------------------------------------\n\nset_int_vect:\t\t\t# Set the interrupt vector\n\tcli\t\t\t# SI = pointer to backup vector (must contain the interrupt #)\n\tmov  bx, ds:[si]\n\tmov  eax, es:[bx]\t# Backup the original vector (ES = 0)\n\tmov  ds:[si], eax\n\tmov  es:[bx], dx\n\tmov  es:[bx+2], cs\n\tsti\n\tret\n\n# ---------------------------------------------------------------------------\n\nrestore_rtc_vect:\t\t# Restore the interrupt vector for RTC\n\tcli\n\tmov  bx, INT_RTC*4\n\tmov  eax, ds:rtc_interrupt_org\n\tmov  es:[bx], eax\n\tsti\n\tret\n\n# ---------------------------------------------------------------------------\n\nflush_keyboard:\t\t\t# Flush the keyboard buffer\n\tmov  ah, 0x01\n\tint  0x16\t\t# KEYBOARD - CHECK BUFFER, DO NOT CLEAR\n\tjz   0f\t\t\t# Z is set if no character in buffer\n\tmov  ah, 0x00\n\tint  0x16\t\t# KEYBOARD - READ CHAR FROM BUFFER\n\tloop flush_keyboard\n0:\tret\n\n# ---------------------------------------------------------------------------\n\nprint_string:\t\t\t# Print NUL terminated string in DS:SI to console\n\tlodsb\n\tcmp  al, 0x00\n\tjz   0f\n\tmov  ah, 0x0e\n\tmov  bx, 0x0007\t\t# BH = display page, BL = foreground color\n\tint  0x10\t\t# VIDEO - WRITE CHARACTER AND ADVANCE CURSOR\n\tjmp  print_string\n0:\tret\n\n# ---------------------------------------------------------------------------\n\ndisk_swap:\t\t\t# Swap disk according to part table entry\n\tpush ax\n\tmov  al, cs:partition_table\n\tcmp  dl, 0x80\n\tjne  0f\n\tmov  dl, al\t# 0x80 -> cs:pt\n\tjmp  1f\n0:\tcmp  dl, al\t# cs:pt -> 0x80\n\tjne  1f\n\tmov  dl, 0x80\n1:\tpop ax\n\tret\n\n# ---------------------------------------------------------------------------\n\n.if DEBUG\nprint_hex:\t\t\t# Hex dump of AH,DL\n\tpusha\n\tmov  cx, 0x04\n\tmov  dh, ah\n0:\trol  dx, 0x04\n\tmov  ax, 0xe0f\n\tand  al, dl\n\tdaa\n\tadd  al, 0xF0\n\tadc  al, 0x40\n\tint  0x10\n\tloop 0b\n\tpopa\n\tret\n.endif\n\n\n/********************************************************************************/\n/* Interrupt overrides                                                          */\n/********************************************************************************/\n\n# RTC (INT 8) interrupt override\nrtc_interrupt:\n\tcli\n\tcmpb cs:counter_timeout, 0x00\n\tjz   0f\t\t\t# Don't decrement counters if timeout expired\n\tdecb cs:counter_dot\n\tdecb cs:counter_timeout\n\nrtc_interrupt_org = .+1\t\t# Same trick used by the LILO mapper\n0:\tjmp 0:INT_RTC*4\t\t# These CS:IP values will be changed at runtime\n\n# ---------------------------------------------------------------------------\n\n# DISK (INT 13h) interrupt override\ndsk_interrupt:\n\tpushf\n.if DEBUG\t\n\tcall print_hex\n.endif\n\t# Some machines (eg. IBM T43p) have a BIOS that reenters INT 13h to issue\n\t# an SCSI passthrough (AH = 50h). Therefore swapping the drive on each call\n\t# would result in failure. To ensure that the disk is only swapped once\n\t# we keep a counter, and swap only if that counter is 0.\n\t# NB: If concurrent INT 13h calls are issued, this approach will break\n\tincb cs:already_mapped\n\tjnz  0f\n\tcall disk_swap\ndsk_interrupt_org = .+1\n0:\tcall 0:INT_DSK*4\t# These CS:IP values will be changed at runtime\n\t# NB: subcommands 0x08 and 0x15 (disk props) modify DL, but they only \n\t# do so to return the number of drives => unless your computer has more\n\t# than 128 drives, disk_swap will not touch those values.\n\tpushf\t\t\t# Don't modify the returned flags\n\tdecb cs:already_mapped\n\tjns  0f\n\tcall disk_swap\n0:\tpopf\n\tretf 2\n\n\n/********************************************************************************/\n/* Data section                                                                 */\n/********************************************************************************/\n\nalready_mapped: .byte 0xff\ncounter_timeout:.byte DOT_NUMBER*DOT_TIMEOUT + 1\ncounter_dot:\t.byte DOT_TIMEOUT\n.if !DEBUG\nprompt_string:\t.string \"\\r\\nPress any key to boot from USB.\"\n.else\nprompt_string:  .string \"USB.\"\n.endif\ndot_string = \t.-2\t\t# Reuse the end of previous string\n\n\n/********************************************************************************/\n/* From offset 0x1b8, the MBR contains the partition table and signature data   */\n/********************************************************************************/\n\t\t.org MBR_RESERVED\ndisk_signature:\n\t\t.space 0x04\nfiller:\n\t\t.space 0x02\npartition_table:\n\t\t.space PT_ENTRY_SIZE * PT_MAX\nmbr_signature:\n\t\t.word 0xAA55\n"
  },
  {
    "path": "res/mbr/mbr.ld",
    "content": "OUTPUT_ARCH(i8086)\nMEMORY { MBR (rx) : org = 0x7c00 , len = 0x200 }\nSECTIONS {\n\tENTRY(mbr)\n\t.main     0x7c00        : { *(main) }\n\t.igot     0x0000        : { *(.igot.plt) }\n}\n"
  },
  {
    "path": "res/mbr/msg.S",
    "content": "﻿/********************************************************************************/\n/* MSG - A protective MBR that displays an ASCII message located in the         */\n/*       subsequent sectors.                                                     */\n/*                                                                              */\n/* Copyright (c) 2019-2022 Pete Batard <pete@akeo.ie>                           */\n/*                                                                              */\n/* This program is free software; you can redistribute it and/or modify it      */\n/* under the terms of the GNU General Public License as published by the Free   */\n/* Software Foundation, either version 3 of the License, or (at your option)    */\n/* any later version.                                                           */\n/*                                                                              */\n/* This program is distributed in the hope that it will be useful, but WITHOUT  */\n/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or        */\n/* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for    */\n/* more details.                                                                */\n/*                                                                              */\n/* You should have received a copy of the GNU General Public License along with */\n/* this program; if not, see <http://www.gnu.org/licenses/>.                    */\n/*                                                                              */\n/********************************************************************************/\n\n/********************************************************************************/\n/* GNU Assembler Settings:                                                      */\n/********************************************************************************/\n.intel_syntax noprefix\n.code16\n/********************************************************************************/\n\n/********************************************************************************/\n/* Constants:                                                                   */\n/********************************************************************************/\nMBR_ADDR      = 0x7c00\nMBR_RESERVED  = 0x1b8\t# Start of the reserved section (partition table, etc.)\nMSG_SECTOR    = 0x22\t# First sector of the message (must be after the GPT)\nNB_SECTORS    = 0x08\t# Number of sectors to read\nPT_MAX        = 0x04\t# Number of partition entries in the partition table\nPT_ENTRY_SIZE = 0x10\t# Size of a partition entry in the partition table\n\n/********************************************************************************/\n/* Reference list of colours:                                                   */\n/* You can escape these numeric values in your message text to set the colours  *\n/* for the background and foreground. For instance \"\\17HIGHLIGHT\" will display  */\n/* light grey text (0x07) over a blue (0x01) background                         */\n/********************************************************************************/\nBLACK         = 0x00\nBLUE          = 0x01\nGREEN         = 0x02\nCYAN          = 0x03\nRED           = 0x04\nMAGENTA       = 0x05\nBROWN         = 0x06\nLIGHT_GREY    = 0x07\nDARK_GREY     = 0x08\nLIGHT_BLUE    = 0x09\nLIGHT_GREEN   = 0x0a\nLIGHT_CYAN    = 0x0b\nLIGHT_RED     = 0x0c\nLIGHT_MAGENTA = 0x0d\nLIGHT_YELLOW  = 0x0e\nWHITE         = 0x0f\n\n/********************************************************************************/\n/* MBR: This section resides at 0x00007c00 and is exactly 512 bytes             */\n/********************************************************************************/\n.section main, \"ax\"\n.globl mbr\nmbr:\n//\txchg bx, bx\t\t# Uncomment to trigger Bochs magic breakpoint\n\tinc  cx\n\tdec  bx\n\tinc  bp\n\tdec  di\n\tcld\n\txor  ax, ax\n\tcli\t\t\t# Disable interrupts when fiddling with the stack\n\tmov  ss, ax\t\t# First order of the day it to set up the stack\n\tmov  sp, MBR_ADDR\t# This places the stack right before the MBR copy in RAM\n\tsti\n\tmov  ds, ax\t\t# MBR and stack reside in segment 0\n\tmov  bx, 0x0413\t\t# McAfee thinks we are a virus if we use 413 directly...\n\tmov  ax,[bx]\n\tsub  ax, NB_SECTORS / 2 # Amount of RAM we need to read the message sectors\n\tmov  [bx],ax\n\tshl  ax, 6\t\t# Convert to segment address\n\tmov  es, ax\t\t# Keep allocated RAM segment in ES\n\nclear_display:\n\tmov  ax, 0x0003\n\tint  0x10\t\t# Set Text Mode to 80x25, 16 color (setting mode also clears the screen)\n\tmov  ah, 0x02\n\tint  0x10\t\t# Set cursor pos to top left\n\nread_sectors:\t\t\t# Copy the next sectors into RAM\n\tmov  ah, 0x41\n\tmov  bx, 0x55aa\n\txor  cx, cx\n\txor  dx, dx\n\tint  0x13\n\tjb   no_ext\t\t# failure to get ext\n\tcmp  bx, 0xaa55\n\tjnz  no_ext\n\ttest cx, 1\t\t# is packet access supported?\n\tjz   no_ext\n\next:\t# http://en.wikipedia.org/wiki/INT_13H#INT_13h_AH.3D42h:_Extended_Read_Sectors_From_Drive\n\txor  eax, eax\n\tpush eax\t\t# bits 32-63 of sector address\n\tpush MSG_SECTOR # bits 0-31 of sector address\n\tpush es\t\t\t# destination segment\n\tpush eax\t\t# destination address (0)\n\tpush NB_SECTORS\t\t# number of sectors to be read\n\tpush 0x0010\t\t# size of DAP struct\n\tmov  si, sp\t\t# DAP address (= stack)\n\tmov  ah, 0x42\t\t# Extended Read Sectors From Drive\n\tint  0x13\n\tlahf\n\tadd  sp,0x10\n\tsahf\n\tjmp check_error\n\nno_ext:\t# http://en.wikipedia.org/wiki/INT_13H#INT_13h_AH.3D02h:_Read_Sectors_From_Drive\n\tmov  ax, 0x0200 + NB_SECTORS\n\tmov  cx, (MSG_SECTOR + 1)\t# Sector address (starts at 1)\n\tmov  dx, 0x0080\t\t# Drive ID\n\txor  bx, bx\t\t# Destination address in ES\n\tint  0x13\n\ncheck_error:\n\tmov  bx, 0x0007\t\t# Default text to light grey on black\n\tjc   display_err\n\ndisplay_msg:\t\t\t# Display the message\n\txor  si, si\n\tmov  ax, es\n\tmov  ds, ax\n\tcall print_msg\n\tjmp  prompt_user\n\ndisplay_err:\t\t\t# Read error -> display shorter message from this MBR\n\tmov  si, offset err_msg\n\tcall print_msg\n\nprompt_user:\n\txor  ax, ax\n\tmov  ds, ax\n\tmov  si, offset prompt_string\n\tcall print_msg\t\t# Prompt the user\n\tcall flush_keyboard\n\nwait_for_keyboard:\n\tmov  ah, 0x01\n\tint  0x16\t\t# KEYBOARD - CHECK BUFFER, DO NOT CLEAR\n\tjnz  reboot\t\t# Z is clear when characters are present in the buffer\n\tmov  ah, 0x02\n\tint  0x16\t\t# KEYBOARD - GET SHIFT STATUS\n\tand  al, 0x04\t\t# AL = shift status bits\n\tjz   wait_for_keyboard\n\nreboot:\t\t\t\t# Trigger a reboot\n\txor  ax, ax\n\tmov  ds, ax\n\tmov  ax, 0x1234\n\tmov  [0x473], ax\n\tjmp  0xffff:0000\n\n/********************************************************************************/\n/* Subroutines                                                                  */\n/********************************************************************************/\n\nflush_keyboard:\t\t\t# Flush the keyboard buffer\n\tmov  ah, 0x01\n\tint  0x16\t\t# KEYBOARD - CHECK BUFFER, DO NOT CLEAR\n\tjz   0f\t\t\t# Z is set if no character in buffer\n\tmov  ah, 0x00\n\tint  0x16\t\t# KEYBOARD - READ CHAR FROM BUFFER\n\tloop flush_keyboard\n0:\tret\n\n# ---------------------------------------------------------------------------\n\nprint_msg:\t\t\t# Print NUL terminated string in DS:SI to console\n\tlodsb\n\tcmp  al, 0x00\t\t# NUL?\n\tjz   4f\n\tcmp  al, 0x0d\t\t# Ignore CR\n\tjz   print_msg\n\tcmp  al, 0x0a\t\t# Handle LF\n\tjnz  0f\n\tpush bx\n\tmov  ah, 0x03\n\tint  0x10\t\t# Get Cursor pos\n\tinc  dh\t\t\t# Move to next line\n\tmov  dl, 0\t\t# Set column to 0\n\tmov  ah, 0x02\n\tint  0x10\t\t# Set Cursor pos\n\tpop  bx\n\tjmp  print_msg\n0:\tcmp  al, 0x5c\t\t# '\\' Escape sequence to set FG/BG color\n\tjnz  3f\n\tmov  cl, 2\n1:\tlodsb\n\tcmp  al, 0x46\n\tjg   print_msg\t\t# Invalid escape sequence\n\tsub  al, 0x30\t\t# '0'\n\tcmp  al, 0x09\n\tjle  2f\n\tsub  al, 0x07\n2:\tshl  bl, 4\n\tand  al, 0x0f\n\tor   bl, al\n\tdec  cl\n\tjnz  1b\n\tjmp  print_msg\n3:\tmov  cx, 0x0001\n\tmov  ah, 0x09\n\tint  0x10\n\tpush bx\n\txor  bx, bx\n\tmov  ah, 0x03\n\tint  0x10\n\tinc  dl\n\tmov  ah, 0x02\n\tint  0x10\n\tpop  bx\n\tjmp  print_msg\n4:\tret\n\n/********************************************************************************/\n/* Data section                                                                 */\n/********************************************************************************/\nerr_msg:\n\t\t.string \"\\r\\n             \\\\04*** ERROR: THIS MEDIA CANNOT BOOT IN LEGACY MODE ***\\\\07\\r\\n\"\nprompt_string:\n\t\t.string \"\\r\\n\\r\\n             \\\\70Please remove this media and press any key to reboot\\\\07\"\n\n/********************************************************************************/\n/* From offset 0x1b8, the MBR contains the partition table and signature data   */\n/********************************************************************************/\n\t\t.org MBR_RESERVED\ndisk_signature:\n\t\t.space 0x04\nfiller:\n\t\t.space 0x02\npartition_table:\n\t\t.space PT_ENTRY_SIZE * PT_MAX\nmbr_signature:\n\t\t.word 0xAA55\n"
  },
  {
    "path": "res/mbr/msg.txt",
    "content": "\\07             \\70 ͻ \\07\r\n             \\70                                                  \\07\r\n             \\70    \\74ERROR: BIOS/LEGACY BOOT OF UEFI-ONLY MEDIA\\70    \\07\r\n             \\70                                                  \\07\r\n             \\70 ͼ \\07\r\n\r\n             This drive was created by Rufus [\\09https://rufus.ie\\07].\r\n\r\n             It can boot in \\04UEFI mode only\\07 but you are trying to\r\n             boot it in BIOS/Legacy mode. THIS WILL NOT WORK!\r\n\r\n             To remove this message you need to do \\02ONE\\07 of the following:\r\n             o If this computer supports UEFI, go to your UEFI settings\r\n               and lower or disable the priority of \\09CSM/Legacy mode\\07.\r\n             o \\02OR\\07 Recreate the drive in Rufus and use:\r\n               * \\09Partition scheme\\07 -> \\09MBR\\07.\r\n               * \\09Target system\\07 -> \\09BIOS (...)\\07\r\n             o \\02OR\\07 Erase the whole drive in Rufus by selecting:\r\n               * \\09Boot Type\\07 -> \\09Non bootable\\07\r\n\r\n             Note: You may also see this message if you installed a new\r\n             OS and your computer is unable to boot that OS in UEFI mode."
  },
  {
    "path": "res/mbr/readme.txt",
    "content": "Rufus: The Reliable USB Formatting Utility - Custom MBR\r\n\r\n# Description\r\n\r\nThis directory contains all the resources required to create an MBR that prompts\r\nthe user for boot selection, when a second bootable device (typically bootable\r\nfixed HDD) is reported by the BIOS at 0x81.\r\n\r\nThis aims at mimicking the Microsoft Windows optical installation media feature,\r\nwhich may be necessary on for WinPE based installations.\r\n\r\nThis MBR will also masquerade a bootable USB drive booted as 0x80 by the BIOS to\r\na different ID according to the one found in its partition table entry. Eg. if\r\nthe partition table lists the disk ID for the first partition as 0x81, then it\r\nwill be swapped for 0x80.\r\n\r\nAn additional MBR (msg.S) also exists in this directory, that can be used to\r\ndisplay an ASCII message contained in the sectors following the primary GPT\r\n(LBA sectors 34 and later).\r\nThis can be used, for instance, to display a notice for media that cannot be\r\nbooted in BIOS/Legacy mode.\r\n\r\n# Compilation\r\n\r\nAny gcc suite (except possibly the X-Code one on OS-X) should be able to compile\r\nthe MBR by invoking 'make'. A 'make dis', that produces a disassembly dump is\r\nalso provided for your convenience. If you have the Bochs emulator installed, \r\nyou can also invoke 'make test' to test the MBR with Bochs.\r\n\r\n# Primer\r\n\r\nThe way this bootloader achieves the feature highlighted above is as follows:\r\n1. An attempt to read the MBR of the second bootable drive (0x81) is made\r\n   through INT_13h (in either CHS or LBA mode depending on the extensions \r\n   detected)\r\n2. If that attempts succeeds, then the partition table from the newly read MBR\r\n   is checked for an active/bootable entry.\r\n3. If such a partition is found, a prompt is displayed to the user and an RTC \r\n   timer interrupt (INT_8h) override is added so that dots are displayed at\r\n   regular interval. Then the keyboard is checked for entry.\r\n4. If the user presses a key, the first partition boot record from the USB is\r\n   read (according to the values found in the USB MBR partition table) and\r\n   executed\r\n5. If no key is pressed, then an INT_13h (disk access interrupt) override is\r\n   added to masquerade the second bootable drive (0x81) as the first one (0x80)\r\n   so that the Windows second stage installer, or any other program relying on\r\n   BIOS disk access, behave as if there was no USB drive inserted.\r\n6. In case there was a failure to read the second bootable drive's MBR, or no\r\n   active partition was detected there, the USB is booted without prompts.\r\n7. In case USB is booted, and the drive ID of first partition of the USB (which\r\n   is always assumed bootable) is read and if different from 0x80, then it is\r\n   also swapped with 0x80 in the INT_13h override.\r\n\r\n# Limitations\r\n\r\n* If you are using software RAID or a non-conventional setup, the second\r\n  bootable disk may not be accessible through the BIOS and therefore the USB\r\n  will always be booted.\r\n* Some processes (notably XP's ntdetect.com) do not seem to like gaps in the\r\n  bootable drive sequence, which means that if you set your bootable USB\r\n  partition as 0x82 or higher, and it leaves any of 0x80/0x81 free as a result\r\n  then these processes may report an error.\r\n* DOS also does not allow anything but 0x80 to be used as bootable disk. Thus\r\n  it is not possible to run MS-DOS or FreeDOS off an USB drive unless the disk\r\n  ID is 0x80 and not masqueraded."
  },
  {
    "path": "res/md5/readme.txt",
    "content": "This directory contains the uefi-md5sum bootloaders added by Rufus for media validation.\r\n\r\nSee https://github.com/pbatard/uefi-md5sum for details.\r\n"
  },
  {
    "path": "res/rufus.ini",
    "content": ";; The following is a sample INI file, as used by Rufus\n;; Whenever Rufus detects a 'rufus.ini' in the directory you launched it from\n;; (even an EMPTY ONE), it starts in portable mode, and store all its settings\n;; there, instead of the Registry.\n;; In most cases, you should never have to modify an INI file manually. But if\n;; needed, the format of the 'rufus.ini' is documented hereafter:\n\n;; The translation used by the Rufus to display its UI (RFC 1766)\nLocale = en-US\n;; Internal, to confirm R/W access to these settings\nCommCheck64 = 317570234\n;; Timestamp of the last update check\nLastUpdateCheck = 13299289810\n;; Amount of time before Rufus checks for another update (in seconds)\nUpdateCheckInterval = 86400\n;; Whether the check for updates should also include new BETA releases\nCheckForBetas = 1\n;; Use this to increase the log verbosity for the updates check (0-2)\n; VerboseUpdateCheck = 2\n;; If you are paranoid about apps writing to the registry, you can uncomment the\n;; following. It will disable the Local Group Policy calls that Rufus issues, to\n;; temporarily prevent the *annoying* notices Windows issues about new drives.\n; DisableLGP = 1\n\n;; Start with the Drive properties or Format options 'Advanced' panel displayed\n; ShowAdvancedDriveProperties = 1\n; ShowAdvancedFormatOptions = 1\n;; Display extended information duringh USB enumeration (Alt-.)\n; EnableUsbDebug = 1\n;; Don't perform a fake drive test during bad blocks check (Alt-B)\n; DisableFakeDrivesCheck = 1\n;; Allow the creation of dual UEFI+BIOS bootable drives for Windows (Alt-E)\n; EnableWindowsDualUefiBiosMode = 1\n;; Force the use of RidgeCrop's Large FAT32 format algorithm when formatting smaller drives (Alt-L)\n; ForceLargeFat32Formatting = 1\n;; Enable Windows file indexing on the newly formatted drive (Alt-Q)\n; EnableFileIndexing = 1\n;; Preserve timestamps when copying files (Alt-T)\n; PreserveTimestamps = 1\n;; Disable the whole Kibi/Gibi nonsense (Alt-U)\n; UseProperSizeUnits = 1\n;; Enable the listing of VMWare's VMDK drives when used in a virtual machine (Alt-W)\n; EnableVmdkDetection = 1\n;; Treat disk images as bootable even if they don't have a 0x55 0xAA marker at offset 0x1FE (Alt-M)\n; IgnoreBootMarker = 1\n;; Force the use of Windows' Virtual Disk Service (VDS) for formatting (Alt-V)\n; UseVds = 1\n;; Ignore specific USB devices when enumerating drives, by VID:PID, with up to 8 devices, from\n;; 'IgnoreUsb01' to 'IgnoreUsb08', being able to be provided.\n;; For instance, to prevent a USB flash drive with VID:PID 0781:5588 from being listed you would add:\n;IgnoreUsb01 = 0x7815588\n"
  },
  {
    "path": "res/scripts/SspToBar.ps1",
    "content": "#\n# SspToBar.ps1 - SkuSiPolicy.p7b revoked PE256 hashes to C byte array converter\n# Copyright © 2023 Pete Batard <pete@akeo.ie>\n# Heavily derived from https://gist.github.com/mattifestation/92e545bf1ee5b68eeb71d254cec2f78e\n# Copyright © 2016-2019 Matthew Graeber with contributions by James Forshaw\n#\n# License: BSD 3-Clause\n#\n\n# This script is generates the pe256ssp[] byte array from Rufus' db.h\n\n#region Parameters\n[cmdletbinding()]\nparam(\n\t# (Optional) The path to the .p7b to process\n\t[string]$BinaryFilePath = \"SkuSiPolicy.p7b\",\n\t# (Optional) Output the straight values\n\t[switch]$Raw = $false\n)\n#endregion\n\nAdd-Type -AssemblyName 'System.Security'\n\n$BinPath = Resolve-Path $BinaryFilePath\n$GuidLength = 0x10\n$Pe256HashLength = 0x20\n$HeaderLengthMax = 0x44\n\n# Helper function to read strings from the binary\nfunction Get-BinaryString {\n\t[OutputType('String')]\n\tparam (\n\t\t[Parameter(Mandatory)]\n\t\t[IO.BinaryReader]\n\t\t[ValidateNotNullOrEmpty()]\n\t\t$BinaryReader\n\t)\n\n\t$StringLength = $BinaryReader.ReadUInt32()\n\n\tif ($StringLength) {\n\t\t$PaddingBytes = 4 - $StringLength % 4 -band 3\n\n\t\t$StringBytes = $BinaryReader.ReadBytes($StringLength)\n\t\t$null = $BinaryReader.ReadBytes($PaddingBytes)\n\n\t\t[Text.Encoding]::Unicode.GetString($StringBytes)\n\t}\n\n\t$null = $BinaryReader.ReadInt32()\n}\n\ntry {\n\t$CIPolicyBytes = [IO.File]::ReadAllBytes($BinPath.Path)\n\n\ttry {\n\t\t$ContentType = $null\n\t\ttry {\n\t\t\t$ContentType = [Security.Cryptography.Pkcs.ContentInfo]::GetContentType($CIPolicyBytes)\n\t\t} catch { }\n\n\t\t# Check for PKCS#7 ASN.1 SignedData type\n\t\tif ($ContentType -and $ContentType.Value -eq '1.2.840.113549.1.7.2') {\n\t\t  $Cms = New-Object System.Security.Cryptography.Pkcs.SignedCms\n\t\t  $Cms.Decode($CIPolicyBytes)\n\t\t  $CIPolicyBytes = $Cms.ContentInfo.Content\n\t\t  if ($CIPolicyBytes[0] -eq 4) {\n\t\t\t$PolicySize = $CIPolicyBytes[1]\n\t\t\t$BaseIndex = 2\n\t\t\tif (($PolicySize -band 0x80) -eq 0x80) {\n\t\t\t\t$SizeCount = $PolicySize -band 0x7F\n\t\t\t\t$BaseIndex += $SizeCount\n\t\t\t\t$PolicySize = 0\n\t\t\t\tfor ($i = 0; $i -lt $SizeCount; $i++) {\n\t\t\t\t\t$PolicySize = $PolicySize -shl 8\n\t\t\t\t\t$PolicySize = $PolicySize -bor $CIPolicyBytes[2 + $i]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$CIPolicyBytes = $CIPolicyBytes[$BaseIndex..($BaseIndex + $PolicySize - 1)]\n\t\t  }\n\t\t}\n\t} catch {\n\t\tWrite-Output $_\n\t}\n\n\t$MemoryStream = New-Object -TypeName IO.MemoryStream -ArgumentList @(,$CIPolicyBytes)\n\t$BinaryReader = New-Object -TypeName System.IO.BinaryReader -ArgumentList $MemoryStream, ([Text.Encoding]::Unicode)\n} catch {\n\tthrow $_\n\treturn\n}\n\ntry {\n\t$CIPolicyFormatVersion = $BinaryReader.ReadInt32()\n\tWrite-Verbose \"Detected CI Policy Format Version $CIPolicyFormatVersion\"\n\tif ($CIPolicyFormatVersion -gt 7) {\n\t\tWrite-Warning \"CI Policy Format may be unsupported...\"\n\t}\n\n\t$PolicyTypeID = [Guid][Byte[]] $BinaryReader.ReadBytes($GuidLength)\n\tswitch ($PolicyTypeID.Guid) {\n\t\t'a244370e-44c9-4c06-b551-f6016e563076' { Write-Verbose \"Policy Type {$PolicyTypeID} => Enterprise Code Integrity Policy (SiPolicy.p7b or UpdateSiPolicy.p7b)\" }\n\t\t'2a5a0136-f09f-498e-99cc-51099011157c' { Write-Verbose \"Policy Type {$PolicyTypeID} => Windows Revoke Code Integrity Policy (RvkSiPolicy.p7b or UpdateRvkSiPolicy.p7b)\" }\n\t\t'976d12c8-cb9f-4730-be52-54600843238e' { Write-Verbose \"Policy Type {$PolicyTypeID} => SKU Code Integrity Policy (SkuSiPolicy.p7b or UpdateSkuSiPolicy.p7b)\" }\n\t\t'5951a96a-e0b5-4d3d-8fb8-3e5b61030784' { Write-Verbose \"Policy Type {$PolicyTypeID} => Windows Lockdown Code Integrity Policy (WinSiPolicy.p7b or UpdateWinSiPolicy.p7b)\" }\n\t\t'4e61c68c-97f6-430b-9cd7-9b1004706770' { Write-Verbose \"Policy Type {$PolicyTypeID} => Advanced Threat Protection Code Integrity Policy (ATPSiPolicy.p7b or UpdateATPSiPolicy.p7b)\" }\n\t\t'd2bda982-ccf6-4344-ac5b-0b44427b6816' { Write-Verbose \"Policy Type {$PolicyTypeID} => Driver Code Integrity Policy (DriverSiPolicy.p7b or UpdateDriverSiPolicy.p7b)\" }\n\t\tdefault { Write-Warning \"Policy Type {$PolicyTypeID} => Unknown Policy Type\" }\n\t}\n\n\t[Byte[]] $PlatformIDBytes = $BinaryReader.ReadBytes($GuidLength)\n\t$PlatformID = [Guid] $PlatformIDBytes\n\tWrite-Verbose \"PlatformID: {$PlatformID}\"\n\t\n\t$OptionFlags = $BinaryReader.ReadInt32()\n\tWrite-Verbose \"Policy Option Flags: 0x$($OptionFlags.ToString('X8'))\"\n\n\tif ($OptionFlags -band ([Int32]::MinValue) -ne [Int32]::MinValue) {\n\t\tthrow \"Invalid Policy Option Flags\"\n\t\treturn\n\t}\n\tif (($OptionFlags -band 0x40000000) -eq 0x40000000) {\n\t\tWrite-Warning 'Policy Option Flags indicate that the CI Policy was built from supplemental policies.'\n\t}\n\n\t$EKURuleEntryCount = $BinaryReader.ReadInt32()\n\tWrite-Verbose \"$EKURuleEntryCount EKU Rule(s)\"\n\n\t$FileRuleEntryCount = $BinaryReader.ReadInt32()\n\tWrite-Verbose \"$FileRuleEntryCount File Rule(s)\"\n\n\t$SignerRuleEntryCount = $BinaryReader.ReadInt32()\n\tWrite-Verbose \"$SignerRuleEntryCount Signer Rule(s)\"\n\n\t$SignerScenarioEntryCount = $BinaryReader.ReadInt32()\n\tWrite-Verbose \"$SignerScenarioEntryCount Signer Scenario(s)\"\n\n\t$Revis = $BinaryReader.ReadUInt16()\n\t$Build = $BinaryReader.ReadUInt16()\n\t$Minor = $BinaryReader.ReadUInt16()\n\t$Major = $BinaryReader.ReadUInt16()\n\tWrite-Verbose \"Version: $Major.$Minor.$Build.$Revis\"\n\n\t$HeaderLength = $BinaryReader.ReadInt32()\t\n\tif ($HeaderLength -ne ($HeaderLengthMax - 4)) {\n\t\tWrite-Warning \"$BinPath has an invalid header footer: 0x$($HeaderLength.ToString('x8'))\"\n\t}\n\n\tif ($EKURuleEntryCount) {\n\t\tWrite-Verbose \"Skipping EKU Rules...\"\n\t\tfor ($i = 0; $i -lt $EKURuleEntryCount; $i++) {\n\t\t\t$EkuValueLen = $BinaryReader.ReadUInt32()\n\t\t\t$PaddingBytes = 4 - $EkuValueLen % 4 -band 3\n\t\t\t$null = $BinaryReader.ReadBytes($EkuValueLen)\n\t\t\t$null = $BinaryReader.ReadBytes($PaddingBytes)\n\t\t}\n\t}\n\t\n\tif ($FileRuleEntryCount) {\n\t\tWrite-Verbose \"Processing File Rules...\"\n\t\t$HashArray = New-Object System.Collections.ArrayList\n\t\t\n\t\tfor ($i = 0; $i -lt $FileRuleEntryCount; $i++) {\n\t\t\t$FileRuleTypeValue = $BinaryReader.ReadInt32()\n\n\t\t\t$FileName = Get-BinaryString -BinaryReader $BinaryReader\n\t\t\t$Revis = $BinaryReader.ReadUInt16()\n\t\t\t$Build = $BinaryReader.ReadUInt16()\n\t\t\t$Minor = $BinaryReader.ReadUInt16()\n\t\t\t$Major = $BinaryReader.ReadUInt16()\n\n\t\t\t$HashLen = $BinaryReader.ReadUInt32()\n\t\t\tif ($HashLen) {\n\t\t\t\t$PaddingBytes = 4 - $HashLen % 4 -band 3\n\t\t\t\t$HashBytes = $BinaryReader.ReadBytes($HashLen)\n\t\t\t\t# We are only interested in the 'DENY' type (0) for PE256 hashes\n\t\t\t\tif (($FileRuleTypeValue -eq 0) -and ($HashLen -eq $Pe256HashLength)) {\n\t\t\t\t\t$HashString = ($HashBytes | ForEach-Object ToString x2) -join ''\n\t\t\t\t\t$HashArray.Add($HashString) | Out-Null\n\t\t\t\t}\n\t\t\t\t$null = $BinaryReader.ReadBytes($PaddingBytes)\n\t\t\t}\n\t\t}\n\t\t# Sort the array and remove duplicates\n\t\t$HashArray.Sort()\n\t\t$HashArray = $HashArray | Select-Object -Unique\n\t\tforeach ($HashStr in $HashArray) {\n\t\t\tif ($Raw) {\n\t\t\t\tWrite-Output $HashStr\n\t\t\t} else {\n\t\t\t\t$HashChars = $HashStr.ToCharArray()\n\t\t\t\t$Line = \"`t\"\n\t\t\t\tfor ($i = 0; $i -lt $Pe256HashLength; $i++) {\n\t\t\t\t\t$Line += \"0x\" + $HashChars[2 * $i] + $HashChars[2 * $i + 1] + \", \"\n\t\t\t\t}\n\t\t\t\tWrite-Output $Line\n\t\t\t}\n\t\t}\n\t}\n\t\n} catch {\n\t$BinaryReader.Close()\n\t$MemoryStream.Close()\n\n\tthrow $_\n\treturn\n}\n"
  },
  {
    "path": "res/scripts/loadcfg.py",
    "content": "#!/bin/env python3\n\n# PE Load Configuration section enabler for MinGW/gcc executables.\n# The PE executable should have a IMAGE_LOAD_CONFIG_DIRECTORY## section\n# in .rdata with a 16-byte IMAGE_DIRECTORY_ENTRY_MARKER marker.\n\nimport os\nimport sys\nimport pefile\n\nIMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10\nIMAGE_DIRECTORY_ENTRY_MARKER      = b\"_RUFUS_LOAD_CFG\"\n\nif len(sys.argv) < 2:\n    raise RuntimeError(\"No executable path supplied\")\n\n# Create a temp file as our source\npe_dst = sys.argv[1]\npe_src = sys.argv[1] + \".tmp\"\nos.replace(pe_dst, pe_src)\n\n# Open and parse PE\npe = pefile.PE(pe_src)\n\n# Find .rdata section\nrdata_section = next(\n    (s for s in pe.sections if s.Name.rstrip(b'\\x00') == b'.rdata'),\n    None\n)\nif not rdata_section:\n    raise RuntimeError(\".rdata section not found\")\n\n# Read the section's raw data to search for the target string\nraw_data = rdata_section.get_data()\n\n# Look for the target data in the raw section data\noffset = raw_data.find(IMAGE_DIRECTORY_ENTRY_MARKER)\nif offset == -1:\n    raise RuntimeError(\"Load Config marker not found\")\n\n# Move past our 16 bytes marker\noffset += 0x10\n# Calculate the RVA and size of the Load Config section\nload_config_rva = rdata_section.VirtualAddress + offset\nprint(f\"RVA  of Load Config: 0x{load_config_rva:X}\")\nload_config_size = pe.get_dword_at_rva(load_config_rva)\nif (load_config_size < 0x20):\n    raise RuntimeError(\"Size of Load Config section is too small\")\nprint(f\"Size of Load Config: 0x{load_config_size:X}\")\n\n# Update Load Config directory entry\npe.OPTIONAL_HEADER.DATA_DIRECTORY[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].VirtualAddress = load_config_rva\npe.OPTIONAL_HEADER.DATA_DIRECTORY[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].Size = load_config_size\n\n# Update the checksum\npe.OPTIONAL_HEADER.CheckSum = pe.generate_checksum()\n\n# Write the updated PE file and remove temp\npe.write(pe_dst)\nos.remove(pe_src)\n\n# Can be validated with `DUMPBIN /LOADCONFIG <.exe>` or `objdump -x <.exe> | grep \"Load Configuration\"`\nprint(f\"Successfully enabled Load Config section in '{pe_dst}'\")\n"
  },
  {
    "path": "res/setup/.editorconfig",
    "content": "# indicate this is the root of the project\nroot = true\n\n[*]\nindent_style = tab\nindent_size = 4\ntrim_trailing_whitespace = true\ninsert_final_newline = true\ncharset = utf-8\n"
  },
  {
    "path": "res/setup/readme.txt",
    "content": "Rufus: The Reliable USB Formatting Utility - Windows 11 Setup wrapper\r\n\r\n# Description\r\n\r\nThis small executable aims at solving the issue of Windows 11 24H2 having made the\r\nbypass requirements for in-place upgrades more difficult to enact.\r\n\r\nBasically, per https://github.com/pbatard/rufus/issues/2568#issuecomment-2387934171,\r\nand if the user chose to apply the hardware requirement bypasses in Rufus, you want\r\nto apply a set of registry key creation and deletion *before* setup.exe is run.\r\n\r\nWhile we could obviously provide a simple batch file to accomplish this, the fact\r\nthat the registry commands require elevation, combined with expectations of just\r\nbeing able double click setup.exe to upgrade makes us want to accomplish this in\r\na more user-friendly manner.\r\n\r\nOur solution then is to have Rufus rename the original 'setup.exe' to 'setup.dll'\r\ninsert a small 'setup.exe' that'll perform elevation, add the registry key, and\r\nlaunch the original setup, which is exactly what this project does.\r\n\r\nOh and it should be noted that, the issues you might see with Setup not restarting\r\nin the foreground after it updates, or not being able to launch at all for a while\r\nif you happen to cancel before starting the installation, have *NOTHING* to do with\r\nusing this setup wrapper, but come from Microsoft themselves. You can validate that\r\nthese issues exist even when running setup.exe without the wrapper...\r\n\r\n# Security considerations\r\n\r\nObviously, the fact that we \"inject\" a setup executable may leave people uncomfortable\r\nabout the possibility that we might use this as a malware vector, which is also why we\r\nmake sure that the one we sign and embed in Rufus does get built using GitHub Actions\r\nand can be validated to not have been tampered through SHA-256 validation (Since we\r\nproduce SHA-256 hashes during the build process per:\r\nhttps://github.com/pbatard/rufus/blob/master/.github/workflows/setup.yml).\r\n\r\nPer the https://github.com/pbatard/rufus/actions/runs/16191913388 GitHub Actions\r\nworkflow run, the SHA-256 for the executables (before signature was applied) were:\r\n* f8e1c7c5f1297be7a76d73567d4d82f61bb20c2e5c86d2a2f8d2e5961751d658 *./setup_x64.exe\r\n* e6ff77b859231cc58c872c7b14ce9def73244641e487bbb074d3a759bdfcbc8d *./setup_arm64.exe\r\n\r\nYou will also find the VirusTotal reports for the current signed executable at:\r\n* https://www.virustotal.com/gui/file/11df838dc69378187e1e1aaf32d34384157642d07096c6e49c1d0e7375634544/detection\r\n* https://www.virustotal.com/gui/file/14bd07f559513890a0f6565df3927392b4fe6b8e6fc3f5e832e9d69c8b7bb7eb/detection\r\n"
  },
  {
    "path": "res/setup/resource.h",
    "content": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by setup.rc\n//\n#define IDI_ICON                        101\n\n// Next default values for new objects\n//\n#ifdef APSTUDIO_INVOKED\n#ifndef APSTUDIO_READONLY_SYMBOLS\n#define _APS_NEXT_RESOURCE_VALUE        102\n#define _APS_NEXT_COMMAND_VALUE         40001\n#define _APS_NEXT_CONTROL_VALUE         1000\n#define _APS_NEXT_SYMED_VALUE           101\n#endif\n#endif\n"
  },
  {
    "path": "res/setup/setup.c",
    "content": "/*\n * Setup - Wrapper around Microsoft's setup.exe that adds registry\n *         bypasses for in-place Windows 11 upgrade.\n *\n * Copyright © 2024 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n\nstatic BOOL RegDeleteNodeRecurse(HKEY hKeyRoot, CHAR* lpSubKey)\n{\n\tCHAR* lpEnd;\n\tLONG lResult;\n\tDWORD dwSize;\n\tCHAR szName[MAX_PATH];\n\tHKEY hKey;\n\tFILETIME ftWrite;\n\n\t// First, see if we can delete the key without having to recurse.\n\tif (RegDeleteKeyA(hKeyRoot, lpSubKey) == ERROR_SUCCESS)\n\t\treturn TRUE;\n\n\tlResult = RegOpenKeyExA(hKeyRoot, lpSubKey, 0, KEY_READ, &hKey);\n\tif (lResult != ERROR_SUCCESS)\n\t\treturn (lResult == ERROR_FILE_NOT_FOUND);\n\n\t// Check for an ending slash and add one if it is missing.\n\tlpEnd = lpSubKey + strlen(lpSubKey);\n\tif (*(lpEnd - 1) != '\\\\') {\n\t\t*lpEnd++ = '\\\\';\n\t\t*lpEnd = '\\0';\n\t}\n\n\t// Enumerate the keys\n\tdwSize = MAX_PATH;\n\tif (RegEnumKeyExA(hKey, 0, szName, &dwSize, NULL, NULL, NULL, &ftWrite) == ERROR_SUCCESS) {\n\t\tdo {\n\t\t\t*lpEnd = '\\0';\n\t\t\tstrcat_s(lpSubKey, MAX_PATH, szName);\n\t\t\tif (!RegDeleteNodeRecurse(hKeyRoot, lpSubKey))\n\t\t\t\tbreak;\n\t\t\tdwSize = MAX_PATH;\n\t\t\tlResult = RegEnumKeyExA(hKey, 0, szName, &dwSize, NULL, NULL, NULL, &ftWrite);\n\t\t} while (lResult == ERROR_SUCCESS);\n\t}\n\n\t*--lpEnd = '\\0';\n\tRegCloseKey(hKey);\n\n\t// Try again to delete the key.\n\treturn (RegDeleteKeyA(hKeyRoot, lpSubKey) == ERROR_SUCCESS);\n}\n\nstatic BOOL RegDeleteNode(HKEY hKeyRoot, CHAR* lpSubKey)\n{\n\tCHAR szDelKey[MAX_PATH];\n\n\tstrcpy_s(szDelKey, MAX_PATH, lpSubKey);\n\treturn RegDeleteNodeRecurse(hKeyRoot, szDelKey);\n}\n\nstatic BOOL RegWriteKey(HKEY hKeyRoot, CHAR* lpKeyParent, CHAR* lpKeyName, DWORD dwType, LPBYTE lpData, DWORD dwDataSize)\n{\n\tBOOL r = FALSE;\n\tHKEY hRoot = NULL, hApp = NULL;\n\tDWORD dwDisp;\n\tHKEY hKey;\n\n\tif (RegCreateKeyExA(hKeyRoot, lpKeyParent, 0, NULL, 0, KEY_SET_VALUE | KEY_QUERY_VALUE, NULL, &hKey, &dwDisp) != ERROR_SUCCESS)\n\t\treturn FALSE;\n\n\tr = (RegSetValueExA(hKey, lpKeyName, 0, dwType, lpData, dwDataSize) == ERROR_SUCCESS);\n\tRegCloseKey(hKey);\n\n\treturn r;\n}\n\nint WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)\n{\n\tCHAR lpBypasses[] = \"SQ_SecureBootCapable=TRUE\\0SQ_SecureBootEnabled=TRUE\\0SQ_TpmVersion=2\\0SQ_RamMB=8192\\0\";\n\tDWORD dwUpgrade = 1, dwAttrib;\n\tSTARTUPINFOA si = { 0 };\n\tPROCESS_INFORMATION pi = { 0 };\n\tSECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };\n\tWCHAR *wc, wPath[MAX_PATH] = { 0 };\n\n\t// If invoked from a different directory, cd to where this executable resides\n\tif (GetModuleFileName(NULL, wPath, ARRAYSIZE(wPath)) != 0 && (wc = wcsrchr(wPath, L'\\\\')) != NULL) {\n\t\t*wc = L'\\0';\n\t\tSetCurrentDirectory(wPath);\n\t}\n\n\t// Make sure we have 'setup.dll' in the same directory\n\tdwAttrib = GetFileAttributesA(\"setup.dll\");\n\tif (dwAttrib == INVALID_FILE_ATTRIBUTES || dwAttrib & FILE_ATTRIBUTE_DIRECTORY)\n\t\tMessageBoxA(NULL, \"ERROR: 'setup.dll' was not found\", \"Windows setup error\", MB_OK | MB_ICONWARNING);\n\n\t// Apply the registry bypasses to enable Windows 11 24H2 in-place upgrade. Credits to:\n\t// https://forums.mydigitallife.net/threads/win-11-boot-and-upgrade-fix-kit-v5-0-released.83724/\n\tRegDeleteNode(HKEY_LOCAL_MACHINE, \"SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AppCompatFlags\\\\CompatMarkers\");\n\tRegDeleteNode(HKEY_LOCAL_MACHINE, \"SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AppCompatFlags\\\\Shared\");\n\tRegDeleteNode(HKEY_LOCAL_MACHINE, \"SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AppCompatFlags\\\\TargetVersionUpgradeExperienceIndicators\");\n\tRegWriteKey(HKEY_LOCAL_MACHINE, \"SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AppCompatFlags\\\\HwReqChk\",\n\t\t\"HwReqChkVars\", REG_MULTI_SZ, lpBypasses, sizeof(lpBypasses));\n\tRegWriteKey(HKEY_LOCAL_MACHINE, \"SYSTEM\\\\Setup\\\\MoSetup\", \"AllowUpgradesWithUnsupportedTPMOrCPU\",\n\t\tREG_DWORD, (LPBYTE)&dwUpgrade, sizeof(dwUpgrade));\n\n\t// Launch the original 'setup.exe' (that was renamed to 'setup.dll')\n\tsi.cb = sizeof(si);\n\tsi.dwFlags = STARTF_USESHOWWINDOW;\n\tsi.wShowWindow = SW_SHOWNORMAL;\n\tCreateProcessA(\"setup.dll\", lpCmdLine, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);\n\tCloseHandle(pi.hProcess);\n\tCloseHandle(pi.hThread);\n\n\treturn GetLastError();\n}\n"
  },
  {
    "path": "res/setup/setup.rc",
    "content": "// Microsoft Visual C++ generated resource script.\r\n//\r\n#include \"resource.h\"\r\n\r\n#define APSTUDIO_READONLY_SYMBOLS\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Generated from the TEXTINCLUDE 2 resource.\r\n//\r\n#ifndef _USING_V110_SDK71_\r\n#define _USING_V110_SDK71_\r\n#endif\r\n#include <windows.h>\r\n#ifndef IDC_STATIC\r\n#define IDC_STATIC -1\r\n#endif\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n#undef APSTUDIO_READONLY_SYMBOLS\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n// English (Neutral) resources\r\n\r\n#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)\r\nLANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL\r\n#pragma code_page(1252)\r\n\r\n#ifdef APSTUDIO_INVOKED\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// TEXTINCLUDE\r\n//\r\n\r\n1 TEXTINCLUDE\r\nBEGIN\r\n    \"resource.h\\0\"\r\nEND\r\n\r\n2 TEXTINCLUDE\r\nBEGIN\r\n    \"\\0\"\r\nEND\r\n\r\n3 TEXTINCLUDE\r\nBEGIN\r\n    \"\\r\\n\"\r\n    \"\\0\"\r\nEND\r\n\r\n#endif    // APSTUDIO_INVOKED\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Icon\r\n//\r\n\r\n// Icon with lowest ID value placed first to ensure application icon\r\n// remains consistent on all systems.\r\nIDI_ICON                ICON                    \"../icons/setup.ico\"\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Version\r\n//\r\n\r\nVS_VERSION_INFO VERSIONINFO\r\n FILEVERSION 1,0,0,1\r\n PRODUCTVERSION 1,0,0,1\r\n FILEFLAGSMASK 0x3fL\r\n#ifdef _DEBUG\r\n FILEFLAGS 0x1L\r\n#else\r\n FILEFLAGS 0x0L\r\n#endif\r\n FILEOS 0x40004L\r\n FILETYPE 0x1L\r\n FILESUBTYPE 0x0L\r\nBEGIN\r\n    BLOCK \"StringFileInfo\"\r\n    BEGIN\r\n        BLOCK \"000004b0\"\r\n        BEGIN\r\n            VALUE \"CompanyName\", \"Akeo Consulting\"\r\n            VALUE \"FileDescription\", \"Windows Setup Wrapper\"\r\n            VALUE \"FileVersion\", \"1.0\"\r\n            VALUE \"InternalName\", \"Setup\"\r\n            VALUE \"LegalCopyright\", \" 2024 Pete Batard (GPL v3)\"\r\n            VALUE \"LegalTrademarks\", \"https://rufus.ie/setup\"\r\n            VALUE \"OriginalFilename\", \"setup.exe\"\r\n            VALUE \"ProductName\", \"Setup\"\r\n            VALUE \"ProductVersion\", \"1.0\"\r\n        END\r\n    END\r\n    BLOCK \"VarFileInfo\"\r\n    BEGIN\r\n        VALUE \"Translation\", 0x0, 1200\r\n    END\r\nEND\r\n\r\n#endif    // English (Neutral) resources\r\n/////////////////////////////////////////////////////////////////////////////\r\n\r\n\r\n\r\n#ifndef APSTUDIO_INVOKED\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Generated from the TEXTINCLUDE 3 resource.\r\n//\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n#endif    // not APSTUDIO_INVOKED\r\n\r\n"
  },
  {
    "path": "res/setup/setup.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio Version 16\r\nVisualStudioVersion = 16.0.29926.136\r\nMinimumVisualStudioVersion = 10.0.40219.1\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"setup\", \"setup.vcxproj\", \"{6C2BED99-5A0A-42A2-AEBE-66717FA92232}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|arm64 = Debug|arm64\r\n\t\tDebug|x64 = Debug|x64\r\n\t\tDebug|x86 = Debug|x86\r\n\t\tRelease|arm64 = Release|arm64\r\n\t\tRelease|x64 = Release|x64\r\n\t\tRelease|x86 = Release|x86\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x64.Build.0 = Release|x64\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{6C2BED99-5A0A-42A2-AEBE-66717FA92232}.Release|x86.Build.0 = Release|Win32\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\n\tGlobalSection(ExtensibilityGlobals) = postSolution\r\n\t\tSolutionGuid = {7994FC0C-9D7C-4AD7-855B-C3525FD8709A}\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "res/setup/setup.vcxproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|ARM64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|ARM64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>ARM64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <VCProjectVersion>16.0</VCProjectVersion>\r\n    <ProjectGuid>{6C2BED99-5A0A-42A2-AEBE-66717FA92232}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>baseconsole</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v143</PlatformToolset>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"Shared\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"PropertySheets\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"PropertySheets\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup>\r\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">$(SolutionDir)arm64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)x86\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\</OutDir>\r\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)x64\\$(Configuration)\\$(ProjectName)\\</IntDir>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">false</LinkIncremental>\r\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(AppVersion)' != ''\">\r\n    <ClCompile>\r\n      <AdditionalOptions>/DAPP_VERSION=$(AppVersion) %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(AppFileVersion)' != ''\">\r\n    <ResourceCompile>\r\n      <AdditionalOptions>/DAPP_FILE_VERSION=$(AppFileVersion) %(AdditionalOptions)</AdditionalOptions>\r\n    </ResourceCompile>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(AppComments)' != ''\">\r\n    <ResourceCompile>\r\n      <AdditionalOptions>/DAPP_COMMENTS=\"$(AppComments)\" %(AdditionalOptions)</AdditionalOptions>\r\n    </ResourceCompile>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>\r\n      </AdditionalIncludeDirectories>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>\r\n      </AdditionalIncludeDirectories>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>\r\n      </AdditionalIncludeDirectories>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>\r\n      </AdditionalIncludeDirectories>\r\n      <Optimization>MinSpace</Optimization>\r\n      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>\r\n      </AdditionalIncludeDirectories>\r\n      <Optimization>MinSpace</Optimization>\r\n      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <AdditionalIncludeDirectories>\r\n      </AdditionalIncludeDirectories>\r\n      <Optimization>MinSpace</Optimization>\r\n      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\".\\setup.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"setup.rc\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"resource.h\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "res/setup/setup.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Resources\">\r\n      <UniqueIdentifier>{e9f75410-9e5d-4ea8-b75a-0c45bb23e331}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\".\\setup.c\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"setup.rc\">\r\n      <Filter>Resources</Filter>\r\n    </ResourceCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"resource.h\">\r\n      <Filter>Source Files</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "res/syslinux/readme.txt",
    "content": "o ldlinux_v4.[bss|sys] have been renamed from ldlinux.[bss|sys] found in syslinux-4.07/core/\r\no ldlinux_v6.[bss|sys] have been renamed from ldlinux.[bss|sys] found in syslinux-6.04-pre1/bios/core/\r\no mboot.c32 comes from syslinux-4.07/com32/mboot\r\n  http://www.kernel.org/pub/linux/utils/boot/syslinux/"
  },
  {
    "path": "res/uefi/readme.txt",
    "content": "This directory contains a flat image of the FAT UEFI:NTFS partition added by\r\nRufus for NTFS and exFAT UEFI boot support.\r\n\r\nSee https://github.com/pbatard/uefi-ntfs for more details.\r\n\r\nThis image, which can be mounted as a FAT file system or opened in 7-zip,\r\ncontains the following data:\r\n\r\no Secure Boot signed NTFS UEFI drivers, derived from ntfs-3g [1].\r\n  These drivers are the exact same as the read-only binaries from release 1.7,\r\n  except for the addition of Microsoft's Secure Boot signature.\r\n  Note that, per Microsoft's current Secure Boot signing policies, the 32-bit\r\n  ARM driver (ntfs_arm.efi) is not Secure Boot signed.\r\n\r\no Non Secure Boot signed exFAT UEFI drivers from EfiFs [2].\r\n  These drivers are the exact same as the binaries from EfiFs release 1.11 but,\r\n  because they are licensed under GPLv3, cannot be Secure Boot signed.\r\n\r\no Secure Boot signed UEFI:NTFS bootloader binaries [3].\r\n  These drivers are the exact same as the binaries from release 2.6, except for\r\n  the addition of Microsoft's Secure Boot signature.\r\n  Note that, per Microsoft's current Secure Boot signing policies, the 32-bit\r\n  ARM bootloader (bootarm.efi) is not Secure Boot signed.\r\n\r\nThe above means that, if booting an NTFS partition on an x86_32, x86_64 or ARM64\r\nsystem, Secure Boot does not need to be disabled.\r\n\r\nThe FAT partition was created on Debian GNU/Linux using the following commands:\r\n  dd if=/dev/zero of=uefi-ntfs.img bs=512 count=2048\r\n  chown 1000:100 uefi-ntfs.img\r\n  mkfs.vfat -n RUFUS_BOOT uefi-ntfs.img\r\n  mount -t vfat uefi-ntfs.img /mnt/hd -o rw,uid=1000,gid=100\r\nand then copying the relevant files.\r\n\r\n[1] https://github.com/pbatard/ntfs-3g\r\n[2] https://github.com/pbatard/efifs\r\n[3] https://github.com/pbatard/uefi-ntfs\r\n"
  },
  {
    "path": "rufus.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio Version 17\r\nVisualStudioVersion = 17.8.34330.188\r\nMinimumVisualStudioVersion = 10.0.40219.1\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"rufus\", \".vs\\rufus.vcxproj\", \"{731858A7-0303-4988-877B-9C0DD6471864}\"\r\n\tProjectSection(ProjectDependencies) = postProject\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332} = {633CFC82-E01B-4777-BDE4-DC0739804332}\r\n\tEndProjectSection\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"ms-sys\", \".vs\\ms-sys.vcxproj\", \"{2B1D078D-8EB4-4398-9CA4-23457265A7F6}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"syslinux-libfat\", \".vs\\syslinux-libfat.vcxproj\", \"{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"syslinux-libinstaller\", \".vs\\syslinux-libinstaller.vcxproj\", \"{266502AC-CD74-4581-B707-938A7D05AD7A}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"syslinux-win\", \".vs\\syslinux-win.vcxproj\", \"{7D2E9784-DDF7-4988-A887-CF099BC3B340}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libcdio-iso9660\", \".vs\\libcdio-iso9660.vcxproj\", \"{D4E80F35-2604-40AC-B436-97B052ECB572}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libcdio-udf\", \".vs\\libcdio-udf.vcxproj\", \"{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libcdio-driver\", \".vs\\libcdio-driver.vcxproj\", \"{FA1B1093-BA86-410A-B7A0-7A54C605F812}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"getopt\", \".vs\\getopt.vcxproj\", \"{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"bled\", \".vs\\bled.vcxproj\", \"{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"ext2fs\", \".vs\\ext2fs.vcxproj\", \"{B01F5886-2B39-4B66-B65C-6427135B6A02}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"wimlib\", \".vs\\wimlib.vcxproj\", \"{633CFC82-E01B-4777-BDE4-DC0739804332}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|arm = Debug|arm\r\n\t\tDebug|arm64 = Debug|arm64\r\n\t\tDebug|x64 = Debug|x64\r\n\t\tDebug|x86 = Debug|x86\r\n\t\tRelease|arm = Release|arm\r\n\t\tRelease|arm64 = Release|arm64\r\n\t\tRelease|x64 = Release|x64\r\n\t\tRelease|x86 = Release|x86\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Release|arm.Build.0 = Release|ARM\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Release|x64.Build.0 = Release|x64\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{731858A7-0303-4988-877B-9C0DD6471864}.Release|x86.Build.0 = Release|Win32\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Release|arm.Build.0 = Release|ARM\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Release|x64.Build.0 = Release|x64\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{2B1D078D-8EB4-4398-9CA4-23457265A7F6}.Release|x86.Build.0 = Release|Win32\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Release|arm.Build.0 = Release|ARM\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Release|x64.Build.0 = Release|x64\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{8390DCE0-859D-4F57-AD9C-AAEAC4D77EEF}.Release|x86.Build.0 = Release|Win32\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Release|arm.Build.0 = Release|ARM\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Release|x64.Build.0 = Release|x64\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{266502AC-CD74-4581-B707-938A7D05AD7A}.Release|x86.Build.0 = Release|Win32\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|arm.Build.0 = Release|ARM\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|x64.Build.0 = Release|x64\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|x86.Build.0 = Release|Win32\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Release|arm.Build.0 = Release|ARM\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Release|x64.Build.0 = Release|x64\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{D4E80F35-2604-40AC-B436-97B052ECB572}.Release|x86.Build.0 = Release|Win32\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Release|arm.Build.0 = Release|ARM\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Release|x64.Build.0 = Release|x64\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}.Release|x86.Build.0 = Release|Win32\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Release|arm.Build.0 = Release|ARM\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Release|x64.Build.0 = Release|x64\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{FA1B1093-BA86-410A-B7A0-7A54C605F812}.Release|x86.Build.0 = Release|Win32\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|arm.Build.0 = Release|ARM\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.Build.0 = Release|x64\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x86.Build.0 = Release|Win32\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Release|arm.Build.0 = Release|ARM\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Release|x64.Build.0 = Release|x64\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{FB6D52D4-A2F8-C358-DB85-BBCAECFDDD7D}.Release|x86.Build.0 = Release|Win32\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|arm.Build.0 = Release|ARM\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|x64.Build.0 = Release|x64\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{B01F5886-2B39-4B66-B65C-6427135B6A02}.Release|x86.Build.0 = Release|Win32\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|arm.ActiveCfg = Debug|ARM\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|arm.Build.0 = Debug|ARM\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|arm64.ActiveCfg = Debug|ARM64\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|arm64.Build.0 = Debug|ARM64\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|x86.ActiveCfg = Debug|Win32\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Debug|x86.Build.0 = Debug|Win32\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Release|arm.ActiveCfg = Release|ARM\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Release|arm.Build.0 = Release|ARM\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Release|arm64.ActiveCfg = Release|ARM64\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Release|arm64.Build.0 = Release|ARM64\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Release|x64.Build.0 = Release|x64\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Release|x86.ActiveCfg = Release|Win32\r\n\t\t{633CFC82-E01B-4777-BDE4-DC0739804332}.Release|x86.Build.0 = Release|Win32\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\n\tGlobalSection(ExtensibilityGlobals) = postSolution\r\n\t\tSolutionGuid = {CCF051E2-A27D-48B0-94ED-ADC18A40E0DB}\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "src/.editorconfig",
    "content": "# indicate this is the root of the project\nroot = true\n\n[*]\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n# Finally, having a default of UTF-8 *without* BOM got fixed in VS2017 15.3\ncharset = utf-8\n"
  },
  {
    "path": "src/Makefile.am",
    "content": "SUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller syslinux/win libcdio/iso9660 libcdio/udf libcdio/driver wimlib ../res/loc\n# As far as I can tell, the following libraries are *not* vulnerable to side-loading, so we link using their regular version:\nNONVULNERABLE_LIBS = -lole32 -lgdi32 -lshlwapi -lcomctl32 -luuid -lntdll\n# The following libraries are vulnerable (or have an unknown vulnerability status), so we link using our delay-loaded replacement:\n# See https://github.com/pbatard/rufus/issues/2272\nVULNERABLE_LIBS = -lcrypt32-delaylib -ldwmapi-delaylib -lsetupapi-delaylib -luxtheme-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib\n\nnoinst_PROGRAMS = rufus\n\nAM_V_WINDRES_0 = @echo \"  RC     $@\";$(WINDRES)\nAM_V_WINDRES_1 = $(WINDRES)\nAM_V_WINDRES_  = $(AM_V_WINDRES_$(AM_DEFAULT_VERBOSITY))\nAM_V_WINDRES   = $(AM_V_WINDRES_$(V))\n\n%_rc.o: %.rc ../res/loc/embedded.loc\n\t$(AM_V_WINDRES) $(AM_RCFLAGS) -i $< -o $@\n\nrufus_SOURCES = badblocks.c darkmode.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c localization.c \\\n\t net.c parser.c pki.c process.c cregex_compile.c cregex_parse.c cregex_vm.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c\nrufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \\\n\t-DEXT2_FLAT_INCLUDES=0 -D_RUFUS -DSOLUTION=rufus\nrufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L../.mingw\nrufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \\\n\tlibcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a wimlib/libwim.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS)\n"
  },
  {
    "path": "src/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nnoinst_PROGRAMS = rufus$(EXEEXT)\nsubdir = src\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nPROGRAMS = $(noinst_PROGRAMS)\nam_rufus_OBJECTS = rufus-badblocks.$(OBJEXT) rufus-darkmode.$(OBJEXT) \\\n\trufus-dev.$(OBJEXT) rufus-dos.$(OBJEXT) \\\n\trufus-dos_locale.$(OBJEXT) rufus-drive.$(OBJEXT) \\\n\trufus-format.$(OBJEXT) rufus-format_ext.$(OBJEXT) \\\n\trufus-format_fat32.$(OBJEXT) rufus-hash.$(OBJEXT) \\\n\trufus-icon.$(OBJEXT) rufus-iso.$(OBJEXT) \\\n\trufus-localization.$(OBJEXT) rufus-net.$(OBJEXT) \\\n\trufus-parser.$(OBJEXT) rufus-pki.$(OBJEXT) \\\n\trufus-process.$(OBJEXT) rufus-cregex_compile.$(OBJEXT) \\\n\trufus-cregex_parse.$(OBJEXT) rufus-cregex_vm.$(OBJEXT) \\\n\trufus-rufus.$(OBJEXT) rufus-smart.$(OBJEXT) \\\n\trufus-stdfn.$(OBJEXT) rufus-stdio.$(OBJEXT) \\\n\trufus-stdlg.$(OBJEXT) rufus-syslinux.$(OBJEXT) \\\n\trufus-ui.$(OBJEXT) rufus-vhd.$(OBJEXT) rufus-wue.$(OBJEXT) \\\n\trufus-xml.$(OBJEXT)\nrufus_OBJECTS = $(am_rufus_OBJECTS)\nam__DEPENDENCIES_1 =\nrufus_DEPENDENCIES = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a \\\n\tms-sys/libmssys.a syslinux/libfat/libfat.a \\\n\tsyslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \\\n\tlibcdio/iso9660/libiso9660.a libcdio/udf/libudf.a \\\n\tlibcdio/driver/libdriver.a wimlib/libwim.a \\\n\t$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)\nrufus_LINK = $(CCLD) $(rufus_CFLAGS) $(CFLAGS) $(rufus_LDFLAGS) \\\n\t$(LDFLAGS) -o $@\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp =\nam__depfiles_maybe =\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(rufus_SOURCES)\nRECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \\\n\tctags-recursive dvi-recursive html-recursive info-recursive \\\n\tinstall-data-recursive install-dvi-recursive \\\n\tinstall-exec-recursive install-html-recursive \\\n\tinstall-info-recursive install-pdf-recursive \\\n\tinstall-ps-recursive install-recursive installcheck-recursive \\\n\tinstalldirs-recursive pdf-recursive ps-recursive \\\n\ttags-recursive uninstall-recursive\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nRECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive\t\\\n  distclean-recursive maintainer-clean-recursive\nam__recursive_targets = \\\n  $(RECURSIVE_TARGETS) \\\n  $(RECURSIVE_CLEAN_TARGETS) \\\n  $(am__extra_recursive_targets)\nAM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nDIST_SUBDIRS = $(SUBDIRS)\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nSUBDIRS = ../.mingw bled ext2fs ms-sys syslinux/libfat syslinux/libinstaller syslinux/win libcdio/iso9660 libcdio/udf libcdio/driver wimlib ../res/loc\n# As far as I can tell, the following libraries are *not* vulnerable to side-loading, so we link using their regular version:\nNONVULNERABLE_LIBS = -lole32 -lgdi32 -lshlwapi -lcomctl32 -luuid -lntdll\n# The following libraries are vulnerable (or have an unknown vulnerability status), so we link using our delay-loaded replacement:\n# See https://github.com/pbatard/rufus/issues/2272\nVULNERABLE_LIBS = -lcrypt32-delaylib -ldwmapi-delaylib -lsetupapi-delaylib -luxtheme-delaylib -lversion-delaylib -lvirtdisk-delaylib -lwininet-delaylib -lwintrust-delaylib\nAM_V_WINDRES_0 = @echo \"  RC     $@\";$(WINDRES)\nAM_V_WINDRES_1 = $(WINDRES)\nAM_V_WINDRES_ = $(AM_V_WINDRES_$(AM_DEFAULT_VERBOSITY))\nAM_V_WINDRES = $(AM_V_WINDRES_$(V))\nrufus_SOURCES = badblocks.c darkmode.c dev.c dos.c dos_locale.c drive.c format.c format_ext.c format_fat32.c hash.c icon.c iso.c localization.c \\\n\t net.c parser.c pki.c process.c cregex_compile.c cregex_parse.c cregex_vm.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c ui.c vhd.c wue.c xml.c\n\nrufus_CFLAGS = -I$(srcdir)/ms-sys/inc -I$(srcdir)/syslinux/libfat -I$(srcdir)/syslinux/libinstaller -I$(srcdir)/syslinux/win -I$(srcdir)/libcdio -I$(srcdir)/wimlib -I$(srcdir)/../res $(AM_CFLAGS) \\\n\t-DEXT2_FLAT_INCLUDES=0 -D_RUFUS -DSOLUTION=rufus\n\nrufus_LDFLAGS = $(AM_LDFLAGS) -mwindows -L../.mingw\nrufus_LDADD = rufus_rc.o bled/libbled.a ext2fs/libext2fs.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \\\n\tlibcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a wimlib/libwim.a $(NONVULNERABLE_LIBS) $(VULNERABLE_LIBS)\n\nall: all-recursive\n\n.SUFFIXES:\n.SUFFIXES: .c .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps src/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstPROGRAMS:\n\t-test -z \"$(noinst_PROGRAMS)\" || rm -f $(noinst_PROGRAMS)\n\nrufus$(EXEEXT): $(rufus_OBJECTS) $(rufus_DEPENDENCIES) $(EXTRA_rufus_DEPENDENCIES) \n\t@rm -f rufus$(EXEEXT)\n\t$(AM_V_CCLD)$(rufus_LINK) $(rufus_OBJECTS) $(rufus_LDADD) $(LIBS)\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n.c.o:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\nrufus-badblocks.o: badblocks.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-badblocks.o `test -f 'badblocks.c' || echo '$(srcdir)/'`badblocks.c\n\nrufus-badblocks.obj: badblocks.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-badblocks.obj `if test -f 'badblocks.c'; then $(CYGPATH_W) 'badblocks.c'; else $(CYGPATH_W) '$(srcdir)/badblocks.c'; fi`\n\nrufus-darkmode.o: darkmode.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-darkmode.o `test -f 'darkmode.c' || echo '$(srcdir)/'`darkmode.c\n\nrufus-darkmode.obj: darkmode.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-darkmode.obj `if test -f 'darkmode.c'; then $(CYGPATH_W) 'darkmode.c'; else $(CYGPATH_W) '$(srcdir)/darkmode.c'; fi`\n\nrufus-dev.o: dev.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-dev.o `test -f 'dev.c' || echo '$(srcdir)/'`dev.c\n\nrufus-dev.obj: dev.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-dev.obj `if test -f 'dev.c'; then $(CYGPATH_W) 'dev.c'; else $(CYGPATH_W) '$(srcdir)/dev.c'; fi`\n\nrufus-dos.o: dos.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-dos.o `test -f 'dos.c' || echo '$(srcdir)/'`dos.c\n\nrufus-dos.obj: dos.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-dos.obj `if test -f 'dos.c'; then $(CYGPATH_W) 'dos.c'; else $(CYGPATH_W) '$(srcdir)/dos.c'; fi`\n\nrufus-dos_locale.o: dos_locale.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-dos_locale.o `test -f 'dos_locale.c' || echo '$(srcdir)/'`dos_locale.c\n\nrufus-dos_locale.obj: dos_locale.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-dos_locale.obj `if test -f 'dos_locale.c'; then $(CYGPATH_W) 'dos_locale.c'; else $(CYGPATH_W) '$(srcdir)/dos_locale.c'; fi`\n\nrufus-drive.o: drive.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-drive.o `test -f 'drive.c' || echo '$(srcdir)/'`drive.c\n\nrufus-drive.obj: drive.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-drive.obj `if test -f 'drive.c'; then $(CYGPATH_W) 'drive.c'; else $(CYGPATH_W) '$(srcdir)/drive.c'; fi`\n\nrufus-format.o: format.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-format.o `test -f 'format.c' || echo '$(srcdir)/'`format.c\n\nrufus-format.obj: format.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-format.obj `if test -f 'format.c'; then $(CYGPATH_W) 'format.c'; else $(CYGPATH_W) '$(srcdir)/format.c'; fi`\n\nrufus-format_ext.o: format_ext.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-format_ext.o `test -f 'format_ext.c' || echo '$(srcdir)/'`format_ext.c\n\nrufus-format_ext.obj: format_ext.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-format_ext.obj `if test -f 'format_ext.c'; then $(CYGPATH_W) 'format_ext.c'; else $(CYGPATH_W) '$(srcdir)/format_ext.c'; fi`\n\nrufus-format_fat32.o: format_fat32.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-format_fat32.o `test -f 'format_fat32.c' || echo '$(srcdir)/'`format_fat32.c\n\nrufus-format_fat32.obj: format_fat32.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-format_fat32.obj `if test -f 'format_fat32.c'; then $(CYGPATH_W) 'format_fat32.c'; else $(CYGPATH_W) '$(srcdir)/format_fat32.c'; fi`\n\nrufus-hash.o: hash.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c\n\nrufus-hash.obj: hash.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi`\n\nrufus-icon.o: icon.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-icon.o `test -f 'icon.c' || echo '$(srcdir)/'`icon.c\n\nrufus-icon.obj: icon.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-icon.obj `if test -f 'icon.c'; then $(CYGPATH_W) 'icon.c'; else $(CYGPATH_W) '$(srcdir)/icon.c'; fi`\n\nrufus-iso.o: iso.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-iso.o `test -f 'iso.c' || echo '$(srcdir)/'`iso.c\n\nrufus-iso.obj: iso.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-iso.obj `if test -f 'iso.c'; then $(CYGPATH_W) 'iso.c'; else $(CYGPATH_W) '$(srcdir)/iso.c'; fi`\n\nrufus-localization.o: localization.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-localization.o `test -f 'localization.c' || echo '$(srcdir)/'`localization.c\n\nrufus-localization.obj: localization.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-localization.obj `if test -f 'localization.c'; then $(CYGPATH_W) 'localization.c'; else $(CYGPATH_W) '$(srcdir)/localization.c'; fi`\n\nrufus-net.o: net.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-net.o `test -f 'net.c' || echo '$(srcdir)/'`net.c\n\nrufus-net.obj: net.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-net.obj `if test -f 'net.c'; then $(CYGPATH_W) 'net.c'; else $(CYGPATH_W) '$(srcdir)/net.c'; fi`\n\nrufus-parser.o: parser.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-parser.o `test -f 'parser.c' || echo '$(srcdir)/'`parser.c\n\nrufus-parser.obj: parser.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-parser.obj `if test -f 'parser.c'; then $(CYGPATH_W) 'parser.c'; else $(CYGPATH_W) '$(srcdir)/parser.c'; fi`\n\nrufus-pki.o: pki.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-pki.o `test -f 'pki.c' || echo '$(srcdir)/'`pki.c\n\nrufus-pki.obj: pki.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-pki.obj `if test -f 'pki.c'; then $(CYGPATH_W) 'pki.c'; else $(CYGPATH_W) '$(srcdir)/pki.c'; fi`\n\nrufus-process.o: process.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-process.o `test -f 'process.c' || echo '$(srcdir)/'`process.c\n\nrufus-process.obj: process.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-process.obj `if test -f 'process.c'; then $(CYGPATH_W) 'process.c'; else $(CYGPATH_W) '$(srcdir)/process.c'; fi`\n\nrufus-cregex_compile.o: cregex_compile.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_compile.o `test -f 'cregex_compile.c' || echo '$(srcdir)/'`cregex_compile.c\n\nrufus-cregex_compile.obj: cregex_compile.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_compile.obj `if test -f 'cregex_compile.c'; then $(CYGPATH_W) 'cregex_compile.c'; else $(CYGPATH_W) '$(srcdir)/cregex_compile.c'; fi`\n\nrufus-cregex_parse.o: cregex_parse.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_parse.o `test -f 'cregex_parse.c' || echo '$(srcdir)/'`cregex_parse.c\n\nrufus-cregex_parse.obj: cregex_parse.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_parse.obj `if test -f 'cregex_parse.c'; then $(CYGPATH_W) 'cregex_parse.c'; else $(CYGPATH_W) '$(srcdir)/cregex_parse.c'; fi`\n\nrufus-cregex_vm.o: cregex_vm.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_vm.o `test -f 'cregex_vm.c' || echo '$(srcdir)/'`cregex_vm.c\n\nrufus-cregex_vm.obj: cregex_vm.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-cregex_vm.obj `if test -f 'cregex_vm.c'; then $(CYGPATH_W) 'cregex_vm.c'; else $(CYGPATH_W) '$(srcdir)/cregex_vm.c'; fi`\n\nrufus-rufus.o: rufus.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-rufus.o `test -f 'rufus.c' || echo '$(srcdir)/'`rufus.c\n\nrufus-rufus.obj: rufus.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-rufus.obj `if test -f 'rufus.c'; then $(CYGPATH_W) 'rufus.c'; else $(CYGPATH_W) '$(srcdir)/rufus.c'; fi`\n\nrufus-smart.o: smart.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-smart.o `test -f 'smart.c' || echo '$(srcdir)/'`smart.c\n\nrufus-smart.obj: smart.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-smart.obj `if test -f 'smart.c'; then $(CYGPATH_W) 'smart.c'; else $(CYGPATH_W) '$(srcdir)/smart.c'; fi`\n\nrufus-stdfn.o: stdfn.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-stdfn.o `test -f 'stdfn.c' || echo '$(srcdir)/'`stdfn.c\n\nrufus-stdfn.obj: stdfn.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-stdfn.obj `if test -f 'stdfn.c'; then $(CYGPATH_W) 'stdfn.c'; else $(CYGPATH_W) '$(srcdir)/stdfn.c'; fi`\n\nrufus-stdio.o: stdio.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-stdio.o `test -f 'stdio.c' || echo '$(srcdir)/'`stdio.c\n\nrufus-stdio.obj: stdio.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-stdio.obj `if test -f 'stdio.c'; then $(CYGPATH_W) 'stdio.c'; else $(CYGPATH_W) '$(srcdir)/stdio.c'; fi`\n\nrufus-stdlg.o: stdlg.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-stdlg.o `test -f 'stdlg.c' || echo '$(srcdir)/'`stdlg.c\n\nrufus-stdlg.obj: stdlg.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-stdlg.obj `if test -f 'stdlg.c'; then $(CYGPATH_W) 'stdlg.c'; else $(CYGPATH_W) '$(srcdir)/stdlg.c'; fi`\n\nrufus-syslinux.o: syslinux.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-syslinux.o `test -f 'syslinux.c' || echo '$(srcdir)/'`syslinux.c\n\nrufus-syslinux.obj: syslinux.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-syslinux.obj `if test -f 'syslinux.c'; then $(CYGPATH_W) 'syslinux.c'; else $(CYGPATH_W) '$(srcdir)/syslinux.c'; fi`\n\nrufus-ui.o: ui.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-ui.o `test -f 'ui.c' || echo '$(srcdir)/'`ui.c\n\nrufus-ui.obj: ui.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-ui.obj `if test -f 'ui.c'; then $(CYGPATH_W) 'ui.c'; else $(CYGPATH_W) '$(srcdir)/ui.c'; fi`\n\nrufus-vhd.o: vhd.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-vhd.o `test -f 'vhd.c' || echo '$(srcdir)/'`vhd.c\n\nrufus-vhd.obj: vhd.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-vhd.obj `if test -f 'vhd.c'; then $(CYGPATH_W) 'vhd.c'; else $(CYGPATH_W) '$(srcdir)/vhd.c'; fi`\n\nrufus-wue.o: wue.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-wue.o `test -f 'wue.c' || echo '$(srcdir)/'`wue.c\n\nrufus-wue.obj: wue.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-wue.obj `if test -f 'wue.c'; then $(CYGPATH_W) 'wue.c'; else $(CYGPATH_W) '$(srcdir)/wue.c'; fi`\n\nrufus-xml.o: xml.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-xml.o `test -f 'xml.c' || echo '$(srcdir)/'`xml.c\n\nrufus-xml.obj: xml.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rufus_CFLAGS) $(CFLAGS) -c -o rufus-xml.obj `if test -f 'xml.c'; then $(CYGPATH_W) 'xml.c'; else $(CYGPATH_W) '$(srcdir)/xml.c'; fi`\n\n# This directory's subdirectories are mostly independent; you can cd\n# into them and run 'make' without going through this Makefile.\n# To change the values of 'make' variables: instead of editing Makefiles,\n# (1) if the variable is set in 'config.status', edit 'config.status'\n#     (which will cause the Makefiles to be regenerated when you run 'make');\n# (2) otherwise, pass the desired values on the 'make' command line.\n$(am__recursive_targets):\n\t@fail=; \\\n\tif $(am__make_keepgoing); then \\\n\t  failcom='fail=yes'; \\\n\telse \\\n\t  failcom='exit 1'; \\\n\tfi; \\\n\tdot_seen=no; \\\n\ttarget=`echo $@ | sed s/-recursive//`; \\\n\tcase \"$@\" in \\\n\t  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \\\n\t  *) list='$(SUBDIRS)' ;; \\\n\tesac; \\\n\tfor subdir in $$list; do \\\n\t  echo \"Making $$target in $$subdir\"; \\\n\t  if test \"$$subdir\" = \".\"; then \\\n\t    dot_seen=yes; \\\n\t    local_target=\"$$target-am\"; \\\n\t  else \\\n\t    local_target=\"$$target\"; \\\n\t  fi; \\\n\t  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \\\n\t  || eval $$failcom; \\\n\tdone; \\\n\tif test \"$$dot_seen\" = \"no\"; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) \"$$target-am\" || exit 1; \\\n\tfi; test -z \"$$fail\"\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-recursive\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\tif ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \\\n\t  include_option=--etags-include; \\\n\t  empty_fix=.; \\\n\telse \\\n\t  include_option=--include; \\\n\t  empty_fix=; \\\n\tfi; \\\n\tlist='$(SUBDIRS)'; for subdir in $$list; do \\\n\t  if test \"$$subdir\" = .; then :; else \\\n\t    test ! -f $$subdir/TAGS || \\\n\t      set \"$$@\" \"$$include_option=$$here/$$subdir/TAGS\"; \\\n\t  fi; \\\n\tdone; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-recursive\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-recursive\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\ncheck-am: all-am\ncheck: check-recursive\nall-am: Makefile $(PROGRAMS)\ninstalldirs: installdirs-recursive\ninstalldirs-am:\ninstall: install-recursive\ninstall-exec: install-exec-recursive\ninstall-data: install-data-recursive\nuninstall: uninstall-recursive\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-recursive\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-recursive\n\nclean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am\n\ndistclean: distclean-recursive\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-recursive\n\ndvi-am:\n\nhtml: html-recursive\n\nhtml-am:\n\ninfo: info-recursive\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-recursive\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-recursive\n\ninstall-html-am:\n\ninstall-info: install-info-recursive\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-recursive\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-recursive\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-recursive\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-recursive\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic\n\npdf: pdf-recursive\n\npdf-am:\n\nps: ps-recursive\n\nps-am:\n\nuninstall-am:\n\n.MAKE: $(am__recursive_targets) install-am install-strip\n\n.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \\\n\tcheck-am clean clean-generic clean-noinstPROGRAMS \\\n\tcscopelist-am ctags ctags-am distclean distclean-compile \\\n\tdistclean-generic distclean-tags dvi dvi-am html html-am info \\\n\tinfo-am install install-am install-data install-data-am \\\n\tinstall-dvi install-dvi-am install-exec install-exec-am \\\n\tinstall-html install-html-am install-info install-info-am \\\n\tinstall-man install-pdf install-pdf-am install-ps \\\n\tinstall-ps-am install-strip installcheck installcheck-am \\\n\tinstalldirs installdirs-am maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am\n\n\n%_rc.o: %.rc ../res/loc/embedded.loc\n\t$(AM_V_WINDRES) $(AM_RCFLAGS) -i $< -o $@\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "src/badblocks.c",
    "content": "/*\n * badblocks.c - Bad blocks checker\n *\n * Copyright 1992-1994 Remy Card <card@masi.ibp.fr>\n * Copyright 1995-1999 Theodore Ts'o\n * Copyright 1999 David Beattie\n * Copyright 2011-2024 Pete Batard <pete@akeo.ie>\n *\n * This file is based on the minix file system programs fsck and mkfs\n * written and copyrighted by Linus Torvalds <Linus.Torvalds@cs.helsinki.fi>\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Public License.\n * %End-Header%\n */\n\n#include <errno.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <malloc.h>\n#include <string.h>\n#include <time.h>\n#include <setjmp.h>\n#include <windows.h>\n#include <stdint.h>\n\n#include \"rufus.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n\n#include \"badblocks.h\"\n#include \"file.h\"\n\nFILE* log_fd = NULL;\nstatic const char abort_msg[] = \"Too many bad blocks, aborting test\\n\";\nstatic const char bb_prefix[] = \"Bad Blocks: \";\n\n/*\n *From e2fsprogs/lib/ext2fs/badblocks.c\n */\n\n/*\n * Badblocks list\n */\nstruct bb_struct_u64_list {\n\tint   magic;\n\tint   num;\n\tint   size;\n\tuint64_t *list;\n\tint   badblocks_flags;\n};\n\nstruct bb_struct_u64_iterate {\n\tint         magic;\n\tbb_u64_list bb;\n\tint         ptr;\n};\n\nstatic errcode_t make_u64_list(int size, int num, uint64_t *list, bb_u64_list *ret)\n{\n\tbb_u64_list bb;\n\n\tbb = calloc(1, sizeof(struct bb_struct_u64_list));\n\tif (bb == NULL)\n\t\treturn BB_ET_NO_MEMORY;\n\tbb->magic = BB_ET_MAGIC_BADBLOCKS_LIST;\n\tbb->size = size ? size : 10;\n\tbb->num = num;\n\tbb->list = malloc(sizeof(blk64_t) * bb->size);\n\tif (bb->list == NULL) {\n\t\tfree(bb);\n\t\tbb = NULL;\n\t\treturn BB_ET_NO_MEMORY;\n\t}\n\tif (list)\n\t\tmemcpy(bb->list, list, bb->size * sizeof(blk64_t));\n\telse\n\t\tmemset(bb->list, 0, bb->size * sizeof(blk64_t));\n\t*ret = bb;\n\treturn 0;\n}\n\n/*\n * This procedure creates an empty badblocks list.\n */\nstatic errcode_t bb_badblocks_list_create(bb_badblocks_list *ret, int size)\n{\n\treturn make_u64_list(size, 0, 0, (bb_badblocks_list *) ret);\n}\n\n/*\n * This procedure adds a block to a badblocks list.\n */\nstatic errcode_t bb_u64_list_add(bb_u64_list bb, uint64_t blk)\n{\n\tint\t\ti, j;\n\tuint64_t* old_bb_list = bb->list;\n\n\tBB_CHECK_MAGIC(bb, BB_ET_MAGIC_BADBLOCKS_LIST);\n\n\tif (bb->num >= bb->size) {\n\t\tbb->size += 100;\n\t\tbb->list = realloc(bb->list, bb->size * sizeof(uint64_t));\n\t\tif (bb->list == NULL) {\n\t\t\tbb->list = old_bb_list;\n\t\t\tbb->size -= 100;\n\t\t\treturn BB_ET_NO_MEMORY;\n\t\t}\n\t\t// coverity[suspicious_sizeof]\n\t\tmemset(&bb->list[bb->size-100], 0, 100 * sizeof(uint64_t));\n\t}\n\n\t/*\n\t * Add special case code for appending to the end of the list\n\t */\n\ti = bb->num-1;\n\tif ((bb->num != 0) && (bb->list[i] == blk))\n\t\treturn 0;\n\tif ((bb->num == 0) || (bb->list[i] < blk)) {\n\t\tbb->list[bb->num++] = blk;\n\t\treturn 0;\n\t}\n\n\tj = bb->num;\n\tfor (i=0; i < bb->num; i++) {\n\t\tif (bb->list[i] == blk)\n\t\t\treturn 0;\n\t\tif (bb->list[i] > blk) {\n\t\t\tj = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tfor (i=bb->num; i > j; i--)\n\t\tbb->list[i] = bb->list[i-1];\n\tbb->list[j] = blk;\n\tbb->num++;\n\treturn 0;\n}\n\nstatic errcode_t bb_badblocks_list_add(bb_badblocks_list bb, blk64_t blk)\n{\n\treturn bb_u64_list_add((bb_u64_list) bb, blk);\n}\n\n/*\n * This procedure finds a particular block is on a badblocks\n * list.\n */\nstatic int bb_u64_list_find(bb_u64_list bb, blk64_t blk)\n{\n\tint\tlow, high, mid;\n\n\tif (bb->magic != BB_ET_MAGIC_BADBLOCKS_LIST)\n\t\treturn -1;\n\n\tif (bb->num == 0)\n\t\treturn -1;\n\n\tlow = 0;\n\thigh = bb->num-1;\n\tif (blk == bb->list[low])\n\t\treturn low;\n\tif (blk == bb->list[high])\n\t\treturn high;\n\n\twhile (low < high) {\n\t\tmid = ((unsigned)low + (unsigned)high)/2;\n\t\tif (mid == low || mid == high)\n\t\t\tbreak;\n\t\tif (blk == bb->list[mid])\n\t\t\treturn mid;\n\t\tif (blk < bb->list[mid])\n\t\t\thigh = mid;\n\t\telse\n\t\t\tlow = mid;\n\t}\n\treturn -1;\n}\n\n/*\n * This procedure tests to see if a particular block is on a badblocks\n * list.\n */\nstatic int bb_u64_list_test(bb_u64_list bb, blk64_t blk)\n{\n\tif (bb_u64_list_find(bb, blk) < 0)\n\t\treturn 0;\n\telse\n\t\treturn 1;\n}\n\nstatic int bb_badblocks_list_test(bb_badblocks_list bb, blk64_t blk)\n{\n\treturn bb_u64_list_test((bb_u64_list) bb, blk);\n}\n\nstatic int bb_u64_list_iterate(bb_u64_iterate iter, blk64_t *blk)\n{\n\tbb_u64_list bb;\n\n\tif (iter->magic != BB_ET_MAGIC_BADBLOCKS_ITERATE)\n\t\treturn 0;\n\n\tbb = iter->bb;\n\n\tif (bb->magic != BB_ET_MAGIC_BADBLOCKS_LIST)\n\t\treturn 0;\n\n\tif (iter->ptr < bb->num) {\n\t\t*blk = bb->list[iter->ptr++];\n\t\treturn 1;\n\t}\n\t*blk = 0;\n\treturn 0;\n}\n\nstatic int bb_badblocks_list_iterate(bb_badblocks_iterate iter, blk64_t *blk)\n{\n\treturn bb_u64_list_iterate((bb_u64_iterate) iter, blk);\n}\n\n/*\n * from e2fsprogs/misc/badblocks.c\n */\nstatic int v_flag = 1;\t\t\t\t\t/* verbose */\nstatic int s_flag = 1;\t\t\t\t\t/* show progress of test */\nstatic int cancel_ops = 0;\t\t\t\t/* abort current operation */\nstatic int cur_pattern, nr_pattern;\nstatic int cur_op;\n/* Abort test if more than this number of bad blocks has been encountered */\nstatic unsigned int max_bb = BB_BAD_BLOCKS_THRESHOLD;\nstatic blk64_t currently_testing = 0;\nstatic blk64_t num_blocks = 0;\nstatic uint32_t num_read_errors = 0;\nstatic uint32_t num_write_errors = 0;\nstatic uint32_t num_corruption_errors = 0;\nstatic bb_badblocks_list bb_list = NULL;\nstatic blk64_t next_bad = 0;\nstatic bb_badblocks_iterate bb_iter = NULL;\n\nstatic __inline void *allocate_buffer(size_t size) {\n\treturn _mm_malloc(size, BB_SYS_PAGE_SIZE);\n}\n\nstatic __inline void free_buffer(void* p) {\n\t_mm_free(p);\n}\n\n/*\n * This routine reports a new bad block.  If the bad block has already\n * been seen before, then it returns 0; otherwise it returns 1.\n */\nstatic int bb_output (blk64_t bad, enum error_types error_type)\n{\n\terrcode_t error_code;\n\n\tif (bb_badblocks_list_test(bb_list, bad))\n\t\treturn 0;\n\n\tuprintf(\"%s%lu\\n\", bb_prefix, (unsigned long)bad);\n\tfprintf(log_fd, \"Block %lu: %s error\\n\", (unsigned long)bad, (error_type==READ_ERROR)?\"read\":\n\t\t((error_type == WRITE_ERROR)?\"write\":\"corruption\"));\n\tfflush(log_fd);\n\n\terror_code = bb_badblocks_list_add(bb_list, bad);\n\tif (error_code) {\n\t\tuprintf(\"%sError %d adding to in-memory bad block list\", bb_prefix, error_code);\n\t\treturn 0;\n\t}\n\n\t/* kludge:\n\t   increment the iteration through the bb_list if\n\t   an element was just added before the current iteration\n\t   position.  This should not cause next_bad to change. */\n\tif (bb_iter && bad < next_bad)\n\t\tbb_badblocks_list_iterate (bb_iter, &next_bad);\n\n\tif (error_type == READ_ERROR) {\n\t  num_read_errors++;\n\t} else if (error_type == WRITE_ERROR) {\n\t  num_write_errors++;\n\t} else if (error_type == CORRUPTION_ERROR) {\n\t  num_corruption_errors++;\n\t}\n\treturn 1;\n}\n\nstatic float calc_percent(unsigned long current, unsigned long total) {\n\tfloat percent = 0.0;\n\tif (total <= 0)\n\t\treturn percent;\n\tif (current >= total) {\n\t\tpercent = 100.0f;\n\t} else {\n\t\tpercent=(100.0f*(float)current/(float)total);\n\t}\n\treturn percent;\n}\n\nstatic void print_status(void)\n{\n\tfloat percent;\n\n\tpercent = calc_percent((unsigned long) currently_testing,\n\t\t\t\t\t(unsigned long) num_blocks);\n\tPrintInfo(0, MSG_235, lmprintf(MSG_191 + ((cur_op==OP_WRITE)?0:1)),\n\t\t\t\tcur_pattern, nr_pattern,\n\t\t\t\tpercent,\n\t\t\t\tnum_read_errors,\n\t\t\t\tnum_write_errors,\n\t\t\t\tnum_corruption_errors);\n\tpercent = (percent/2.0f) + ((cur_op==OP_READ)? 50.0f : 0.0f);\n\tUpdateProgress(OP_BADBLOCKS, (((cur_pattern-1)*100.0f) + percent) / nr_pattern);\n}\n\nstatic void CALLBACK alarm_intr(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)\n{\n\tif (!num_blocks)\n\t\treturn;\n\tif (ErrorStatus) {\n\t\tuprintf(\"%sInterrupting at block %\" PRIu64 \"\\n\", bb_prefix,\n\t\t\t(unsigned long long) currently_testing);\n\t\tcancel_ops = -1;\n\t}\n\tprint_status();\n}\n\nstatic void pattern_fill(unsigned char *buffer, unsigned int pattern,\n\t\t\t size_t n)\n{\n\tunsigned int\ti, nb;\n\tunsigned char\tbpattern[sizeof(pattern)], *ptr;\n\n\tif (pattern == (unsigned int) ~0) {\n\t\tPrintInfo(3500, MSG_236);\n\t\tsrand((unsigned int)GetTickCount64());\n\t\tfor (ptr = buffer; ptr < buffer + n; ptr++) {\n\t\t\t// coverity[dont_call]\n\t\t\t(*ptr) = rand() % (1 << (8 * sizeof(char)));\n\t\t}\n\t} else {\n\t\tPrintInfo(3500, MSG_237, pattern);\n\t\tbpattern[0] = 0;\n\t\tfor (i = 0; i < sizeof(bpattern); i++) {\n\t\t\tif (pattern == 0)\n\t\t\t\tbreak;\n\t\t\tbpattern[i] = pattern & 0xFF;\n\t\t\tpattern = pattern >> 8;\n\t\t}\n\t\tnb = i ? (i-1) : 0;\n\t\tfor (ptr = buffer, i = nb; ptr < buffer + n; ptr++) {\n\t\t\t*ptr = bpattern[i];\n\t\t\tif (i == 0)\n\t\t\t\ti = nb;\n\t\t\telse\n\t\t\t\ti--;\n\t\t}\n\t\tcur_pattern++;\n\t}\n}\n\n/*\n * Perform a read of a sequence of blocks; return the number of blocks\n *    successfully sequentially read.\n */\nstatic int64_t do_read (HANDLE hDrive, unsigned char * buffer, uint64_t tryout,\n\t\t\t\t\t    uint64_t block_size, blk64_t current_block)\n{\n\tint64_t got;\n\n\tif (v_flag > 1)\n\t\tprint_status();\n\n\t/* Try the read */\n\tgot = read_sectors(hDrive, block_size, current_block, tryout, buffer);\n\tif (got < 0)\n\t\tgot = 0;\n\tif (got & 511)\n\t\tuprintf(\"%sWeird value (%lld) in do_read\\n\", bb_prefix, got);\n\tgot /= block_size;\n\treturn got;\n}\n\n/*\n * Perform a write of a sequence of blocks; return the number of blocks\n *    successfully sequentially written.\n */\nstatic int64_t do_write(HANDLE hDrive, unsigned char * buffer, uint64_t tryout,\n\t\t\t\t\t    uint64_t block_size, blk64_t current_block)\n{\n\tint64_t got;\n\n\tif (v_flag > 1)\n\t\tprint_status();\n\n\t/* Try the write */\n\tgot = write_sectors(hDrive, block_size, current_block, tryout, buffer);\n\tif (got < 0)\n\t\tgot = 0;\n\tif (got & 511)\n\t\tuprintf(\"%sWeird value (%lld) in do_write\\n\", bb_prefix, got);\n\tgot /= block_size;\n\treturn got;\n}\n\nstatic unsigned int test_rw(HANDLE hDrive, blk64_t last_block, size_t block_size, blk64_t first_block,\n\t\t\t\t\t\t\tsize_t blocks_at_once, int pattern_type, int nb_passes)\n{\n\tconst unsigned int pattern[BADLOCKS_PATTERN_TYPES][BADBLOCK_PATTERN_COUNT] =\n\t\t{ BADBLOCK_PATTERN_ONE_PASS, BADBLOCK_PATTERN_TWO_PASSES, BADBLOCK_PATTERN_SLC,\n\t\t  BADCLOCK_PATTERN_MLC, BADBLOCK_PATTERN_TLC };\n\tunsigned char *buffer = NULL, *read_buffer;\n\tint i, pat_idx;\n\tunsigned int bb_count = 0;\n\tblk64_t got, tryout, recover_block = ~0, *blk_id;\n\tsize_t id_offset = 0;\n\n\tif ((pattern_type < 0) || (pattern_type >= BADLOCKS_PATTERN_TYPES)) {\n\t\tuprintf(\"%sInvalid pattern type\\n\", bb_prefix);\n\t\tcancel_ops = -1;\n\t\treturn 0;\n\t}\n\tif ((nb_passes < 1) || (nb_passes > BADBLOCK_PATTERN_COUNT)) {\n\t\tuprintf(\"%sInvalid number of passes\\n\", bb_prefix);\n\t\tcancel_ops = -1;\n\t\treturn 0;\n\t}\n\tif ((first_block * block_size > 1 * PB) || (last_block * block_size > 1 * PB)) {\n\t\tuprintf(\"%sDisk is too large\\n\", bb_prefix);\n\t\tcancel_ops = -1;\n\t\treturn 0;\n\t}\n\n\tbuffer = allocate_buffer(2 * blocks_at_once * block_size);\n\tif (!buffer) {\n\t\tuprintf(\"%sError while allocating buffers\\n\", bb_prefix);\n\t\tcancel_ops = -1;\n\t\treturn 0;\n\t}\n\tread_buffer = buffer + blocks_at_once * block_size;\n\n\tuprintf(\"%sChecking from block %lu to %lu (1 block = %s)\\n\", bb_prefix,\n\t\t(unsigned long) first_block, (unsigned long) last_block - 1,\n\t\tSizeToHumanReadable(BADBLOCK_BLOCK_SIZE, FALSE, FALSE));\n\tnr_pattern = nb_passes;\n\tcur_pattern = 0;\n\n\tfor (pat_idx = 0; pat_idx < nb_passes; pat_idx++) {\n\t\tif (cancel_ops)\n\t\t\tgoto out;\n\t\tif (detect_fakes && (pat_idx == 0)) {\n\t\t\tsrand((unsigned int)GetTickCount64());\n\t\t\tid_offset = rand() * (block_size - sizeof(blk64_t)) / RAND_MAX;\n\t\t\tuprintf(\"%sUsing offset %zu for fake device check\\n\", bb_prefix, id_offset);\n\t\t}\n\t\t// coverity[dont_call]\n\t\tpattern_fill(buffer, pattern[pattern_type][pat_idx], blocks_at_once * block_size);\n\t\tnum_blocks = last_block - 1;\n\t\tcurrently_testing = first_block;\n\t\tif (s_flag | v_flag)\n\t\t\tuprintf(\"%sWriting test pattern 0x%02X\\n\", bb_prefix, pattern[pattern_type][pat_idx]);\n\t\tcur_op = OP_WRITE;\n\t\ttryout = blocks_at_once;\n\t\twhile (currently_testing < last_block) {\n\t\t\tif (cancel_ops)\n\t\t\t\tgoto out;\n\t\t\tif (max_bb && bb_count >= max_bb) {\n\t\t\t\tif (s_flag || v_flag) {\n\t\t\t\t\tuprintf(abort_msg);\n\t\t\t\t\tfprintf(log_fd, \"%s\", abort_msg);\n\t\t\t\t\tfflush(log_fd);\n\t\t\t\t}\n\t\t\t\tcancel_ops = -1;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tif (currently_testing + tryout > last_block)\n\t\t\t\ttryout = last_block - currently_testing;\n\t\t\tif (detect_fakes && (pat_idx == 0)) {\n\t\t\t\t/* Add the block number at a fixed (random) offset during each pass to\n\t\t\t\t   allow for the detection of 'fake' media (eg. 2GB USB masquerading as 16GB) */\n\t\t\t\tfor (i=0; i<(int)blocks_at_once; i++) {\n\t\t\t\t\tblk_id = (blk64_t*)(intptr_t)(buffer + id_offset+ i*block_size);\n\t\t\t\t\t*blk_id = (blk64_t)(currently_testing + i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tgot = do_write(hDrive, buffer, tryout, block_size, currently_testing);\n\t\t\tif (v_flag > 1)\n\t\t\t\tprint_status();\n\n\t\t\tif (got == 0 && tryout == 1)\n\t\t\t\tbb_count += bb_output(currently_testing++, WRITE_ERROR);\n\t\t\tcurrently_testing += got;\n\t\t\tif (got != tryout) {\n\t\t\t\ttryout = 1;\n\t\t\t\tif (recover_block == ~0)\n\t\t\t\t\trecover_block = currently_testing -\n\t\t\t\t\t\tgot + blocks_at_once;\n\t\t\t\tcontinue;\n\t\t\t} else if (currently_testing == recover_block) {\n\t\t\t\ttryout = blocks_at_once;\n\t\t\t\trecover_block = ~0;\n\t\t\t}\n\t\t}\n\n\t\tnum_blocks = 0;\n\t\tif (s_flag | v_flag)\n\t\t\tuprintf(\"%sReading and comparing\\n\", bb_prefix);\n\t\tcur_op = OP_READ;\n\t\tnum_blocks = last_block;\n\t\tcurrently_testing = first_block;\n\n\t\ttryout = blocks_at_once;\n\t\twhile (currently_testing < last_block) {\n\t\t\tif (cancel_ops) goto out;\n\t\t\tif (max_bb && bb_count >= max_bb) {\n\t\t\t\tif (s_flag || v_flag) {\n\t\t\t\t\tuprintf(abort_msg);\n\t\t\t\t\tfprintf(log_fd, \"%s\", abort_msg);\n\t\t\t\t\tfflush(log_fd);\n\t\t\t\t}\n\t\t\t\tcancel_ops = -1;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tif (currently_testing + tryout > last_block)\n\t\t\t\ttryout = last_block - currently_testing;\n\t\t\tif (detect_fakes && (pat_idx == 0)) {\n\t\t\t\tfor (i=0; i<(int)blocks_at_once; i++) {\n\t\t\t\t\tblk_id = (blk64_t*)(intptr_t)(buffer + id_offset+ i*block_size);\n\t\t\t\t\t*blk_id = (blk64_t)(currently_testing + i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tgot = do_read(hDrive, read_buffer, tryout, block_size,\n\t\t\t\t       currently_testing);\n\t\t\tif (got == 0 && tryout == 1)\n\t\t\t\tbb_count += bb_output(currently_testing++, READ_ERROR);\n\t\t\tcurrently_testing += got;\n\t\t\tif (got != tryout) {\n\t\t\t\ttryout = 1;\n\t\t\t\tif (recover_block == ~0)\n\t\t\t\t\trecover_block = currently_testing -\n\t\t\t\t\t\tgot + blocks_at_once;\n\t\t\t\tcontinue;\n\t\t\t} else if (currently_testing == recover_block) {\n\t\t\t\ttryout = blocks_at_once;\n\t\t\t\trecover_block = ~0;\n\t\t\t}\n\t\t\tfor (i=0; i < got; i++) {\n\t\t\t\tif (memcmp(read_buffer + i * block_size,\n\t\t\t\t\t   buffer + i * block_size,\n\t\t\t\t\t   block_size)) {\n\t\t\t\t\tif_assert_fails(currently_testing * block_size < 1 * PB) \n\t\t\t\t\t\tgoto out;\n\t\t\t\t\t// coverity[overflow_const]\n\t\t\t\t\tbb_count += bb_output(currently_testing+i-got, CORRUPTION_ERROR);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (v_flag > 1)\n\t\t\t\tprint_status();\n\t\t}\n\n\t\tnum_blocks = 0;\n\t}\nout:\n\tfree_buffer(buffer);\n\treturn bb_count;\n}\n\nBOOL BadBlocks(HANDLE hPhysicalDrive, ULONGLONG disk_size, int nb_passes,\n\t\t\t   int flash_type, badblocks_report *report, FILE* fd)\n{\n\terrcode_t error_code;\n\tblk64_t last_block = disk_size / BADBLOCK_BLOCK_SIZE;\n\n\tif (report == NULL) return FALSE;\n\tnum_read_errors = 0;\n\tnum_write_errors = 0;\n\tnum_corruption_errors = 0;\n\treport->bb_count = 0;\n\tif (fd != NULL) {\n\t\tlog_fd = fd;\n\t} else {\n\t\tlog_fd = freopen(NULL, \"w\", stderr);\n\t}\n\n\terror_code = bb_badblocks_list_create(&bb_list, 0);\n\tif (error_code) {\n\t\tuprintf(\"%sError %d while creating in-memory bad blocks list\", bb_prefix, error_code);\n\t\treturn FALSE;\n\t}\n\n\tcancel_ops = 0;\n\t/* use a timer to update status every second */\n\tSetTimer(hMainDialog, TID_BADBLOCKS_UPDATE, 1000, alarm_intr);\n\treport->bb_count = test_rw(hPhysicalDrive, last_block, BADBLOCK_BLOCK_SIZE, 0, BB_BLOCKS_AT_ONCE, flash_type, nb_passes);\n\tKillTimer(hMainDialog, TID_BADBLOCKS_UPDATE);\n\tfree(bb_list->list);\n\tfree(bb_list);\n\treport->num_read_errors = num_read_errors;\n\treport->num_write_errors = num_write_errors;\n\treport->num_corruption_errors = num_corruption_errors;\n\n\tif ((cancel_ops) && (!report->bb_count))\n\t\treturn FALSE;\n\treturn TRUE;\n}\n"
  },
  {
    "path": "src/badblocks.h",
    "content": "/*\n * badblocks.c\t\t- Bad blocks checker\n *\n * Copyright (C) 1992, 1993, 1994  Remy Card <card@masi.ibp.fr>\n *                                 Laboratoire MASI, Institut Blaise Pascal\n *                                 Universite Pierre et Marie Curie (Paris VI)\n *\n * Copyright 1995, 1996, 1997, 1998, 1999 by Theodore Ts'o\n * Copyright 1999 by David Beattie\n * Copyright 2011-2024 by Pete Batard\n *\n * This file is based on the minix file system programs fsck and mkfs\n * written and copyrighted by Linus Torvalds <Linus.Torvalds@cs.helsinki.fi>\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Public\n * License.\n * %End-Header%\n */\n\n#include <windows.h>\n#include <stdint.h>\n\n#include \"ext2fs/ext2fs.h\"\n\ntypedef struct bb_struct_u64_list         *bb_badblocks_list;\ntypedef struct bb_struct_u64_iterate      *bb_badblocks_iterate;\ntypedef struct bb_struct_u64_list         *bb_u64_list;\ntypedef struct bb_struct_u64_iterate      *bb_u64_iterate;\n\n#define BB_ET_NO_MEMORY                   RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY)\n#define BB_ET_MAGIC_BADBLOCKS_LIST        RUFUS_ERROR(ERROR_OBJECT_IN_LIST)\n#define BB_ET_MAGIC_BADBLOCKS_ITERATE     RUFUS_ERROR(ERROR_INVALID_BLOCK)\n\n#define BB_CHECK_MAGIC(struct, code)      if ((struct)->magic != (code)) return (code)\n#define BB_BAD_BLOCKS_THRESHOLD           256\n#define BB_BLOCKS_AT_ONCE                 64\n#define BB_SYS_PAGE_SIZE                  4096\n\nenum error_types { READ_ERROR, WRITE_ERROR, CORRUPTION_ERROR };\nenum op_type { OP_READ, OP_WRITE };\n\n/*\n * Badblocks report\n */\ntypedef struct {\n\tuint32_t bb_count;\n\tuint32_t num_read_errors;\n\tuint32_t num_write_errors;\n\tuint32_t num_corruption_errors;\n} badblocks_report;\n\n/*\n * Shared prototypes\n */\nBOOL BadBlocks(HANDLE hPhysicalDrive, ULONGLONG disk_size, int nb_passes,\n\tint flash_type, badblocks_report *report, FILE* fd);\n"
  },
  {
    "path": "src/bled/Makefile.am",
    "content": "noinst_LIBRARIES = libbled.a\n\nlibbled_a_SOURCES = bled.c crc32.c data_align.c data_extract_all.c data_skip.c decompress_bunzip2.c \\\n  decompress_gunzip.c decompress_uncompress.c decompress_unlzma.c decompress_unxz.c decompress_unzip.c \\\n  decompress_unzstd.c decompress_vtsi.c filter_accept_all.c filter_accept_list.c filter_accept_reject_list.c \\\n  find_list_entry.c fse_decompress.c  header_list.c header_skip.c header_verbose_list.c huf_decompress.c \\\n  init_handle.c open_transformer.c seek_by_jump.c seek_by_read.c xz_dec_bcj.c xz_dec_lzma2.c xz_dec_stream.c \\\n  xxhash.c zstd_common.c zstd_decompress.c zstd_decompress_block.c zstd_ddict.c zstd_entropy_common.c \\\n  zstd_error_private.c\nlibbled_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -Wno-undef -Wno-strict-aliasing\n"
  },
  {
    "path": "src/bled/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = src/bled\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLIBRARIES = $(noinst_LIBRARIES)\nARFLAGS = cru\nAM_V_AR = $(am__v_AR_@AM_V@)\nam__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)\nam__v_AR_0 = @echo \"  AR      \" $@;\nam__v_AR_1 = \nlibbled_a_AR = $(AR) $(ARFLAGS)\nlibbled_a_LIBADD =\nam_libbled_a_OBJECTS = libbled_a-bled.$(OBJEXT) \\\n\tlibbled_a-crc32.$(OBJEXT) libbled_a-data_align.$(OBJEXT) \\\n\tlibbled_a-data_extract_all.$(OBJEXT) \\\n\tlibbled_a-data_skip.$(OBJEXT) \\\n\tlibbled_a-decompress_bunzip2.$(OBJEXT) \\\n\tlibbled_a-decompress_gunzip.$(OBJEXT) \\\n\tlibbled_a-decompress_uncompress.$(OBJEXT) \\\n\tlibbled_a-decompress_unlzma.$(OBJEXT) \\\n\tlibbled_a-decompress_unxz.$(OBJEXT) \\\n\tlibbled_a-decompress_unzip.$(OBJEXT) \\\n\tlibbled_a-decompress_unzstd.$(OBJEXT) \\\n\tlibbled_a-decompress_vtsi.$(OBJEXT) \\\n\tlibbled_a-filter_accept_all.$(OBJEXT) \\\n\tlibbled_a-filter_accept_list.$(OBJEXT) \\\n\tlibbled_a-filter_accept_reject_list.$(OBJEXT) \\\n\tlibbled_a-find_list_entry.$(OBJEXT) \\\n\tlibbled_a-fse_decompress.$(OBJEXT) \\\n\tlibbled_a-header_list.$(OBJEXT) \\\n\tlibbled_a-header_skip.$(OBJEXT) \\\n\tlibbled_a-header_verbose_list.$(OBJEXT) \\\n\tlibbled_a-huf_decompress.$(OBJEXT) \\\n\tlibbled_a-init_handle.$(OBJEXT) \\\n\tlibbled_a-open_transformer.$(OBJEXT) \\\n\tlibbled_a-seek_by_jump.$(OBJEXT) \\\n\tlibbled_a-seek_by_read.$(OBJEXT) \\\n\tlibbled_a-xz_dec_bcj.$(OBJEXT) \\\n\tlibbled_a-xz_dec_lzma2.$(OBJEXT) \\\n\tlibbled_a-xz_dec_stream.$(OBJEXT) libbled_a-xxhash.$(OBJEXT) \\\n\tlibbled_a-zstd_common.$(OBJEXT) \\\n\tlibbled_a-zstd_decompress.$(OBJEXT) \\\n\tlibbled_a-zstd_decompress_block.$(OBJEXT) \\\n\tlibbled_a-zstd_ddict.$(OBJEXT) \\\n\tlibbled_a-zstd_entropy_common.$(OBJEXT) \\\n\tlibbled_a-zstd_error_private.$(OBJEXT)\nlibbled_a_OBJECTS = $(am_libbled_a_OBJECTS)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp =\nam__depfiles_maybe =\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libbled_a_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LIBRARIES = libbled.a\nlibbled_a_SOURCES = bled.c crc32.c data_align.c data_extract_all.c data_skip.c decompress_bunzip2.c \\\n  decompress_gunzip.c decompress_uncompress.c decompress_unlzma.c decompress_unxz.c decompress_unzip.c \\\n  decompress_unzstd.c decompress_vtsi.c filter_accept_all.c filter_accept_list.c filter_accept_reject_list.c \\\n  find_list_entry.c fse_decompress.c  header_list.c header_skip.c header_verbose_list.c huf_decompress.c \\\n  init_handle.c open_transformer.c seek_by_jump.c seek_by_read.c xz_dec_bcj.c xz_dec_lzma2.c xz_dec_stream.c \\\n  xxhash.c zstd_common.c zstd_decompress.c zstd_decompress_block.c zstd_ddict.c zstd_entropy_common.c \\\n  zstd_error_private.c\n\nlibbled_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -Wno-undef -Wno-strict-aliasing\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/bled/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps src/bled/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLIBRARIES:\n\t-test -z \"$(noinst_LIBRARIES)\" || rm -f $(noinst_LIBRARIES)\n\nlibbled.a: $(libbled_a_OBJECTS) $(libbled_a_DEPENDENCIES) $(EXTRA_libbled_a_DEPENDENCIES) \n\t$(AM_V_at)-rm -f libbled.a\n\t$(AM_V_AR)$(libbled_a_AR) libbled.a $(libbled_a_OBJECTS) $(libbled_a_LIBADD)\n\t$(AM_V_at)$(RANLIB) libbled.a\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n.c.o:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\nlibbled_a-bled.o: bled.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-bled.o `test -f 'bled.c' || echo '$(srcdir)/'`bled.c\n\nlibbled_a-bled.obj: bled.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-bled.obj `if test -f 'bled.c'; then $(CYGPATH_W) 'bled.c'; else $(CYGPATH_W) '$(srcdir)/bled.c'; fi`\n\nlibbled_a-crc32.o: crc32.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-crc32.o `test -f 'crc32.c' || echo '$(srcdir)/'`crc32.c\n\nlibbled_a-crc32.obj: crc32.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-crc32.obj `if test -f 'crc32.c'; then $(CYGPATH_W) 'crc32.c'; else $(CYGPATH_W) '$(srcdir)/crc32.c'; fi`\n\nlibbled_a-data_align.o: data_align.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-data_align.o `test -f 'data_align.c' || echo '$(srcdir)/'`data_align.c\n\nlibbled_a-data_align.obj: data_align.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-data_align.obj `if test -f 'data_align.c'; then $(CYGPATH_W) 'data_align.c'; else $(CYGPATH_W) '$(srcdir)/data_align.c'; fi`\n\nlibbled_a-data_extract_all.o: data_extract_all.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-data_extract_all.o `test -f 'data_extract_all.c' || echo '$(srcdir)/'`data_extract_all.c\n\nlibbled_a-data_extract_all.obj: data_extract_all.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-data_extract_all.obj `if test -f 'data_extract_all.c'; then $(CYGPATH_W) 'data_extract_all.c'; else $(CYGPATH_W) '$(srcdir)/data_extract_all.c'; fi`\n\nlibbled_a-data_skip.o: data_skip.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-data_skip.o `test -f 'data_skip.c' || echo '$(srcdir)/'`data_skip.c\n\nlibbled_a-data_skip.obj: data_skip.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-data_skip.obj `if test -f 'data_skip.c'; then $(CYGPATH_W) 'data_skip.c'; else $(CYGPATH_W) '$(srcdir)/data_skip.c'; fi`\n\nlibbled_a-decompress_bunzip2.o: decompress_bunzip2.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_bunzip2.o `test -f 'decompress_bunzip2.c' || echo '$(srcdir)/'`decompress_bunzip2.c\n\nlibbled_a-decompress_bunzip2.obj: decompress_bunzip2.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_bunzip2.obj `if test -f 'decompress_bunzip2.c'; then $(CYGPATH_W) 'decompress_bunzip2.c'; else $(CYGPATH_W) '$(srcdir)/decompress_bunzip2.c'; fi`\n\nlibbled_a-decompress_gunzip.o: decompress_gunzip.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_gunzip.o `test -f 'decompress_gunzip.c' || echo '$(srcdir)/'`decompress_gunzip.c\n\nlibbled_a-decompress_gunzip.obj: decompress_gunzip.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_gunzip.obj `if test -f 'decompress_gunzip.c'; then $(CYGPATH_W) 'decompress_gunzip.c'; else $(CYGPATH_W) '$(srcdir)/decompress_gunzip.c'; fi`\n\nlibbled_a-decompress_uncompress.o: decompress_uncompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_uncompress.o `test -f 'decompress_uncompress.c' || echo '$(srcdir)/'`decompress_uncompress.c\n\nlibbled_a-decompress_uncompress.obj: decompress_uncompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_uncompress.obj `if test -f 'decompress_uncompress.c'; then $(CYGPATH_W) 'decompress_uncompress.c'; else $(CYGPATH_W) '$(srcdir)/decompress_uncompress.c'; fi`\n\nlibbled_a-decompress_unlzma.o: decompress_unlzma.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_unlzma.o `test -f 'decompress_unlzma.c' || echo '$(srcdir)/'`decompress_unlzma.c\n\nlibbled_a-decompress_unlzma.obj: decompress_unlzma.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_unlzma.obj `if test -f 'decompress_unlzma.c'; then $(CYGPATH_W) 'decompress_unlzma.c'; else $(CYGPATH_W) '$(srcdir)/decompress_unlzma.c'; fi`\n\nlibbled_a-decompress_unxz.o: decompress_unxz.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_unxz.o `test -f 'decompress_unxz.c' || echo '$(srcdir)/'`decompress_unxz.c\n\nlibbled_a-decompress_unxz.obj: decompress_unxz.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_unxz.obj `if test -f 'decompress_unxz.c'; then $(CYGPATH_W) 'decompress_unxz.c'; else $(CYGPATH_W) '$(srcdir)/decompress_unxz.c'; fi`\n\nlibbled_a-decompress_unzip.o: decompress_unzip.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_unzip.o `test -f 'decompress_unzip.c' || echo '$(srcdir)/'`decompress_unzip.c\n\nlibbled_a-decompress_unzip.obj: decompress_unzip.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_unzip.obj `if test -f 'decompress_unzip.c'; then $(CYGPATH_W) 'decompress_unzip.c'; else $(CYGPATH_W) '$(srcdir)/decompress_unzip.c'; fi`\n\nlibbled_a-decompress_unzstd.o: decompress_unzstd.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_unzstd.o `test -f 'decompress_unzstd.c' || echo '$(srcdir)/'`decompress_unzstd.c\n\nlibbled_a-decompress_unzstd.obj: decompress_unzstd.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_unzstd.obj `if test -f 'decompress_unzstd.c'; then $(CYGPATH_W) 'decompress_unzstd.c'; else $(CYGPATH_W) '$(srcdir)/decompress_unzstd.c'; fi`\n\nlibbled_a-decompress_vtsi.o: decompress_vtsi.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_vtsi.o `test -f 'decompress_vtsi.c' || echo '$(srcdir)/'`decompress_vtsi.c\n\nlibbled_a-decompress_vtsi.obj: decompress_vtsi.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-decompress_vtsi.obj `if test -f 'decompress_vtsi.c'; then $(CYGPATH_W) 'decompress_vtsi.c'; else $(CYGPATH_W) '$(srcdir)/decompress_vtsi.c'; fi`\n\nlibbled_a-filter_accept_all.o: filter_accept_all.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-filter_accept_all.o `test -f 'filter_accept_all.c' || echo '$(srcdir)/'`filter_accept_all.c\n\nlibbled_a-filter_accept_all.obj: filter_accept_all.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-filter_accept_all.obj `if test -f 'filter_accept_all.c'; then $(CYGPATH_W) 'filter_accept_all.c'; else $(CYGPATH_W) '$(srcdir)/filter_accept_all.c'; fi`\n\nlibbled_a-filter_accept_list.o: filter_accept_list.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-filter_accept_list.o `test -f 'filter_accept_list.c' || echo '$(srcdir)/'`filter_accept_list.c\n\nlibbled_a-filter_accept_list.obj: filter_accept_list.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-filter_accept_list.obj `if test -f 'filter_accept_list.c'; then $(CYGPATH_W) 'filter_accept_list.c'; else $(CYGPATH_W) '$(srcdir)/filter_accept_list.c'; fi`\n\nlibbled_a-filter_accept_reject_list.o: filter_accept_reject_list.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-filter_accept_reject_list.o `test -f 'filter_accept_reject_list.c' || echo '$(srcdir)/'`filter_accept_reject_list.c\n\nlibbled_a-filter_accept_reject_list.obj: filter_accept_reject_list.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-filter_accept_reject_list.obj `if test -f 'filter_accept_reject_list.c'; then $(CYGPATH_W) 'filter_accept_reject_list.c'; else $(CYGPATH_W) '$(srcdir)/filter_accept_reject_list.c'; fi`\n\nlibbled_a-find_list_entry.o: find_list_entry.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-find_list_entry.o `test -f 'find_list_entry.c' || echo '$(srcdir)/'`find_list_entry.c\n\nlibbled_a-find_list_entry.obj: find_list_entry.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-find_list_entry.obj `if test -f 'find_list_entry.c'; then $(CYGPATH_W) 'find_list_entry.c'; else $(CYGPATH_W) '$(srcdir)/find_list_entry.c'; fi`\n\nlibbled_a-fse_decompress.o: fse_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-fse_decompress.o `test -f 'fse_decompress.c' || echo '$(srcdir)/'`fse_decompress.c\n\nlibbled_a-fse_decompress.obj: fse_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-fse_decompress.obj `if test -f 'fse_decompress.c'; then $(CYGPATH_W) 'fse_decompress.c'; else $(CYGPATH_W) '$(srcdir)/fse_decompress.c'; fi`\n\nlibbled_a-header_list.o: header_list.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-header_list.o `test -f 'header_list.c' || echo '$(srcdir)/'`header_list.c\n\nlibbled_a-header_list.obj: header_list.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-header_list.obj `if test -f 'header_list.c'; then $(CYGPATH_W) 'header_list.c'; else $(CYGPATH_W) '$(srcdir)/header_list.c'; fi`\n\nlibbled_a-header_skip.o: header_skip.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-header_skip.o `test -f 'header_skip.c' || echo '$(srcdir)/'`header_skip.c\n\nlibbled_a-header_skip.obj: header_skip.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-header_skip.obj `if test -f 'header_skip.c'; then $(CYGPATH_W) 'header_skip.c'; else $(CYGPATH_W) '$(srcdir)/header_skip.c'; fi`\n\nlibbled_a-header_verbose_list.o: header_verbose_list.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-header_verbose_list.o `test -f 'header_verbose_list.c' || echo '$(srcdir)/'`header_verbose_list.c\n\nlibbled_a-header_verbose_list.obj: header_verbose_list.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-header_verbose_list.obj `if test -f 'header_verbose_list.c'; then $(CYGPATH_W) 'header_verbose_list.c'; else $(CYGPATH_W) '$(srcdir)/header_verbose_list.c'; fi`\n\nlibbled_a-huf_decompress.o: huf_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-huf_decompress.o `test -f 'huf_decompress.c' || echo '$(srcdir)/'`huf_decompress.c\n\nlibbled_a-huf_decompress.obj: huf_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-huf_decompress.obj `if test -f 'huf_decompress.c'; then $(CYGPATH_W) 'huf_decompress.c'; else $(CYGPATH_W) '$(srcdir)/huf_decompress.c'; fi`\n\nlibbled_a-init_handle.o: init_handle.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-init_handle.o `test -f 'init_handle.c' || echo '$(srcdir)/'`init_handle.c\n\nlibbled_a-init_handle.obj: init_handle.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-init_handle.obj `if test -f 'init_handle.c'; then $(CYGPATH_W) 'init_handle.c'; else $(CYGPATH_W) '$(srcdir)/init_handle.c'; fi`\n\nlibbled_a-open_transformer.o: open_transformer.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-open_transformer.o `test -f 'open_transformer.c' || echo '$(srcdir)/'`open_transformer.c\n\nlibbled_a-open_transformer.obj: open_transformer.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-open_transformer.obj `if test -f 'open_transformer.c'; then $(CYGPATH_W) 'open_transformer.c'; else $(CYGPATH_W) '$(srcdir)/open_transformer.c'; fi`\n\nlibbled_a-seek_by_jump.o: seek_by_jump.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-seek_by_jump.o `test -f 'seek_by_jump.c' || echo '$(srcdir)/'`seek_by_jump.c\n\nlibbled_a-seek_by_jump.obj: seek_by_jump.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-seek_by_jump.obj `if test -f 'seek_by_jump.c'; then $(CYGPATH_W) 'seek_by_jump.c'; else $(CYGPATH_W) '$(srcdir)/seek_by_jump.c'; fi`\n\nlibbled_a-seek_by_read.o: seek_by_read.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-seek_by_read.o `test -f 'seek_by_read.c' || echo '$(srcdir)/'`seek_by_read.c\n\nlibbled_a-seek_by_read.obj: seek_by_read.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-seek_by_read.obj `if test -f 'seek_by_read.c'; then $(CYGPATH_W) 'seek_by_read.c'; else $(CYGPATH_W) '$(srcdir)/seek_by_read.c'; fi`\n\nlibbled_a-xz_dec_bcj.o: xz_dec_bcj.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xz_dec_bcj.o `test -f 'xz_dec_bcj.c' || echo '$(srcdir)/'`xz_dec_bcj.c\n\nlibbled_a-xz_dec_bcj.obj: xz_dec_bcj.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xz_dec_bcj.obj `if test -f 'xz_dec_bcj.c'; then $(CYGPATH_W) 'xz_dec_bcj.c'; else $(CYGPATH_W) '$(srcdir)/xz_dec_bcj.c'; fi`\n\nlibbled_a-xz_dec_lzma2.o: xz_dec_lzma2.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xz_dec_lzma2.o `test -f 'xz_dec_lzma2.c' || echo '$(srcdir)/'`xz_dec_lzma2.c\n\nlibbled_a-xz_dec_lzma2.obj: xz_dec_lzma2.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xz_dec_lzma2.obj `if test -f 'xz_dec_lzma2.c'; then $(CYGPATH_W) 'xz_dec_lzma2.c'; else $(CYGPATH_W) '$(srcdir)/xz_dec_lzma2.c'; fi`\n\nlibbled_a-xz_dec_stream.o: xz_dec_stream.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xz_dec_stream.o `test -f 'xz_dec_stream.c' || echo '$(srcdir)/'`xz_dec_stream.c\n\nlibbled_a-xz_dec_stream.obj: xz_dec_stream.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xz_dec_stream.obj `if test -f 'xz_dec_stream.c'; then $(CYGPATH_W) 'xz_dec_stream.c'; else $(CYGPATH_W) '$(srcdir)/xz_dec_stream.c'; fi`\n\nlibbled_a-xxhash.o: xxhash.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xxhash.o `test -f 'xxhash.c' || echo '$(srcdir)/'`xxhash.c\n\nlibbled_a-xxhash.obj: xxhash.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-xxhash.obj `if test -f 'xxhash.c'; then $(CYGPATH_W) 'xxhash.c'; else $(CYGPATH_W) '$(srcdir)/xxhash.c'; fi`\n\nlibbled_a-zstd_common.o: zstd_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_common.o `test -f 'zstd_common.c' || echo '$(srcdir)/'`zstd_common.c\n\nlibbled_a-zstd_common.obj: zstd_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_common.obj `if test -f 'zstd_common.c'; then $(CYGPATH_W) 'zstd_common.c'; else $(CYGPATH_W) '$(srcdir)/zstd_common.c'; fi`\n\nlibbled_a-zstd_decompress.o: zstd_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_decompress.o `test -f 'zstd_decompress.c' || echo '$(srcdir)/'`zstd_decompress.c\n\nlibbled_a-zstd_decompress.obj: zstd_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_decompress.obj `if test -f 'zstd_decompress.c'; then $(CYGPATH_W) 'zstd_decompress.c'; else $(CYGPATH_W) '$(srcdir)/zstd_decompress.c'; fi`\n\nlibbled_a-zstd_decompress_block.o: zstd_decompress_block.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_decompress_block.o `test -f 'zstd_decompress_block.c' || echo '$(srcdir)/'`zstd_decompress_block.c\n\nlibbled_a-zstd_decompress_block.obj: zstd_decompress_block.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_decompress_block.obj `if test -f 'zstd_decompress_block.c'; then $(CYGPATH_W) 'zstd_decompress_block.c'; else $(CYGPATH_W) '$(srcdir)/zstd_decompress_block.c'; fi`\n\nlibbled_a-zstd_ddict.o: zstd_ddict.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_ddict.o `test -f 'zstd_ddict.c' || echo '$(srcdir)/'`zstd_ddict.c\n\nlibbled_a-zstd_ddict.obj: zstd_ddict.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_ddict.obj `if test -f 'zstd_ddict.c'; then $(CYGPATH_W) 'zstd_ddict.c'; else $(CYGPATH_W) '$(srcdir)/zstd_ddict.c'; fi`\n\nlibbled_a-zstd_entropy_common.o: zstd_entropy_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_entropy_common.o `test -f 'zstd_entropy_common.c' || echo '$(srcdir)/'`zstd_entropy_common.c\n\nlibbled_a-zstd_entropy_common.obj: zstd_entropy_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_entropy_common.obj `if test -f 'zstd_entropy_common.c'; then $(CYGPATH_W) 'zstd_entropy_common.c'; else $(CYGPATH_W) '$(srcdir)/zstd_entropy_common.c'; fi`\n\nlibbled_a-zstd_error_private.o: zstd_error_private.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_error_private.o `test -f 'zstd_error_private.c' || echo '$(srcdir)/'`zstd_error_private.c\n\nlibbled_a-zstd_error_private.obj: zstd_error_private.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbled_a_CFLAGS) $(CFLAGS) -c -o libbled_a-zstd_error_private.obj `if test -f 'zstd_error_private.c'; then $(CYGPATH_W) 'zstd_error_private.c'; else $(CYGPATH_W) '$(srcdir)/zstd_error_private.c'; fi`\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LIBRARIES)\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \\\n\tdistclean-compile distclean-generic distclean-tags dvi dvi-am \\\n\thtml html-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "src/bled/bb_archive.h",
    "content": "/* vi: set sw=4 ts=4: */\n#ifndef UNARCHIVE_H\n#define UNARCHIVE_H 1\n\nPUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN\n\nenum {\n#if BB_BIG_ENDIAN\n\tCOMPRESS_MAGIC = 0x1f9d,\n\tGZIP_MAGIC  = 0x1f8b,\n\tBZIP2_MAGIC = 256 * 'B' + 'Z',\n\t/* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */\n\t/* More info at: http://tukaani.org/xz/xz-file-format.txt */\n\tXZ_MAGIC1   = 256 * 0xfd + '7',\n\tXZ_MAGIC2   = 256 * (unsigned)(256 * (256 * 'z' + 'X') + 'Z') + 0,\n\t/* Different form: 32 bits, then 16 bits: */\n\t/* (unsigned) cast suppresses \"integer overflow in expression\" warning */\n\tXZ_MAGIC1a  = 256 * (unsigned)(256 * (256 * 0xfd + '7') + 'z') + 'X',\n\tXZ_MAGIC2a  = 256 * 'Z' + 0,\n\tZSTD_MAGIC1 = 0x28B5,\n\tZSTD_MAGIC2 = 0x2FFD,\n\tZSTD_MAGIC  = 0x28B52FFD,\n#else\n\tCOMPRESS_MAGIC = 0x9d1f,\n\tGZIP_MAGIC  = 0x8b1f,\n\tBZIP2_MAGIC = 'B' + 'Z' * 256,\n\tXZ_MAGIC1   = 0xfd + '7' * 256,\n\tXZ_MAGIC2   = 'z' + ('X' + ('Z' + 0 * 256) * 256) * 256,\n\tXZ_MAGIC1a  = 0xfd + ('7' + ('z' + 'X' * 256) * 256) * 256,\n\tXZ_MAGIC2a  = 'Z' + 0 * 256,\n\tZSTD_MAGIC1 = 0xB528,\n\tZSTD_MAGIC2 = 0xFD2F,\n\tZSTD_MAGIC  = 0xFD2FB528,\n#endif\n};\n\ntypedef struct file_header_t {\n\tchar *name;\n\tchar *link_target;\n#if ENABLE_FEATURE_TAR_UNAME_GNAME\n\tchar *tar__uname;\n\tchar *tar__gname;\n#endif\n\toff_t size;\n\tuid_t uid;\n\tgid_t gid;\n\tmode_t mode;\n\ttime_t mtime;\n\tdev_t device;\n} file_header_t;\n\nstruct hardlinks_t;\n\ntypedef struct archive_handle_t {\n\t/* Flags. 1st since it is most used member */\n\tunsigned ah_flags;\n\n\t/* The raw stream as read from disk or stdin */\n\tint src_fd;\n\n\t/* Define if the header and data component should be processed */\n\tchar FAST_FUNC (*filter)(struct archive_handle_t *);\n\t/* List of files that have been accepted */\n\tllist_t *accept;\n\t/* List of files that have been rejected */\n\tllist_t *reject;\n\t/* List of files that have successfully been worked on */\n\tllist_t *passed;\n\n\t/* Currently processed file's header */\n\tfile_header_t *file_header;\n\n\t/* List of link placeholders */\n\tllist_t *link_placeholders;\n\n\t/* Process the header component, e.g. tar -t */\n\tvoid FAST_FUNC (*action_header)(const file_header_t *);\n\n\t/* Process the data component, e.g. extract to filesystem */\n\tvoid FAST_FUNC (*action_data)(struct archive_handle_t *);\n\n\t/* Function that skips data */\n\tvoid FAST_FUNC (*seek)(int fd, off_t amount);\n\n\t/* Count processed bytes */\n\toff_t offset;\n\n\t/* Archiver specific. Can make it a union if it ever gets big */\n#if ENABLE_FEATURE_TAR_LONG_OPTIONS\n\tunsigned tar__strip_components;\n#endif\n#define PAX_NEXT_FILE 0\n#define PAX_GLOBAL    1\n#if ENABLE_TAR || ENABLE_DPKG || ENABLE_DPKG_DEB\n\tsmallint tar__end;\n# if ENABLE_FEATURE_TAR_GNU_EXTENSIONS\n\tchar* tar__longname;\n\tchar* tar__linkname;\n# endif\n# if ENABLE_FEATURE_TAR_TO_COMMAND\n\tchar* tar__to_command;\n\tconst char* tar__to_command_shell;\n# endif\n# if ENABLE_FEATURE_TAR_SELINUX\n\tchar* tar__sctx[2];\n# endif\n#endif\n#if ENABLE_CPIO || ENABLE_RPM2CPIO || ENABLE_RPM\n\tuoff_t cpio__blocks;\n\tstruct bb_uidgid_t cpio__owner;\n\tstruct hardlinks_t *cpio__hardlinks_to_create;\n\tstruct hardlinks_t *cpio__created_hardlinks;\n#endif\n#if ENABLE_DPKG || ENABLE_DPKG_DEB\n\t/* Temporary storage */\n\tchar *dpkg__buffer;\n\t/* How to process any sub archive, e.g. get_header_tar_gz */\n\tchar FAST_FUNC (*dpkg__action_data_subarchive)(struct archive_handle_t *);\n\t/* Contains the handle to a sub archive */\n\tstruct archive_handle_t *dpkg__sub_archive;\n#endif\n#if ENABLE_FEATURE_AR_CREATE\n\tconst char *ar__name;\n\tstruct archive_handle_t *ar__out;\n#endif\n#if ENABLE_FEATURE_AR_LONG_FILENAMES\n\tchar *ar__long_names;\n\tunsigned ar__long_name_size;\n#endif\n} archive_handle_t;\n/* bits in ah_flags */\n#define ARCHIVE_RESTORE_DATE        (1 << 0)\n#define ARCHIVE_CREATE_LEADING_DIRS (1 << 1)\n#define ARCHIVE_UNLINK_OLD          (1 << 2)\n#define ARCHIVE_EXTRACT_NEWER       (1 << 3)\n#define ARCHIVE_DONT_RESTORE_OWNER  (1 << 4)\n#define ARCHIVE_DONT_RESTORE_PERM   (1 << 5)\n#define ARCHIVE_NUMERIC_OWNER       (1 << 6)\n#define ARCHIVE_O_TRUNC             (1 << 7)\n#define ARCHIVE_REMEMBER_NAMES      (1 << 8)\n#if ENABLE_RPM\n#define ARCHIVE_REPLACE_VIA_RENAME  (1 << 9)\n#endif\n\n\n/* POSIX tar Header Block, from POSIX 1003.1-1990  */\n#define TAR_BLOCK_SIZE 512\n#define NAME_SIZE      100\n#define NAME_SIZE_STR \"100\"\ntypedef struct tar_header_t {     /* byte offset */\n\tchar name[NAME_SIZE];     /*   0-99 */\n\tchar mode[8];             /* 100-107 */\n\tchar uid[8];              /* 108-115 */\n\tchar gid[8];              /* 116-123 */\n\tchar size[12];            /* 124-135 */\n\tchar mtime[12];           /* 136-147 */\n\tchar chksum[8];           /* 148-155 */\n\tchar typeflag;            /* 156-156 */\n\tchar linkname[NAME_SIZE]; /* 157-256 */\n\t/* POSIX:   \"ustar\" NUL \"00\" */\n\t/* GNU tar: \"ustar  \" NUL */\n\t/* Normally it's defined as magic[6] followed by\n\t * version[2], but we put them together to save code.\n\t */\n\tchar magic[8];            /* 257-264 */\n\tchar uname[32];           /* 265-296 */\n\tchar gname[32];           /* 297-328 */\n\tchar devmajor[8];         /* 329-336 */\n\tchar devminor[8];         /* 337-344 */\n\tchar prefix[155];         /* 345-499 */\n\tchar padding[12];         /* 500-512 (pad to exactly TAR_BLOCK_SIZE) */\n} tar_header_t;\nstruct BUG_tar_header {\n\tchar c[sizeof(tar_header_t) == TAR_BLOCK_SIZE ? 1 : -1];\n};\nvoid chksum_and_xwrite_tar_header(int fd, struct tar_header_t *hp) FAST_FUNC;\n\n\nextern const char cpio_TRAILER[];\n\n\narchive_handle_t *init_handle(void) FAST_FUNC;\n\nchar filter_accept_all(archive_handle_t *archive_handle) FAST_FUNC;\nchar filter_accept_list(archive_handle_t *archive_handle) FAST_FUNC;\nchar filter_accept_list_reassign(archive_handle_t *archive_handle) FAST_FUNC;\nchar filter_accept_reject_list(archive_handle_t *archive_handle) FAST_FUNC;\n\nvoid unpack_ar_archive(archive_handle_t *ar_archive) FAST_FUNC;\n\nvoid data_skip(archive_handle_t *archive_handle) FAST_FUNC;\nvoid data_extract_all(archive_handle_t *archive_handle) FAST_FUNC;\nvoid data_extract_to_stdout(archive_handle_t *archive_handle) FAST_FUNC;\nvoid data_extract_to_command(archive_handle_t *archive_handle) FAST_FUNC;\n\nvoid header_skip(const file_header_t *file_header) FAST_FUNC;\nvoid header_list(const file_header_t *file_header) FAST_FUNC;\nvoid header_verbose_list(const file_header_t *file_header) FAST_FUNC;\n\nchar get_header_ar(archive_handle_t *archive_handle) FAST_FUNC;\nchar get_header_cpio(archive_handle_t *archive_handle) FAST_FUNC;\nchar get_header_tar(archive_handle_t *archive_handle) FAST_FUNC;\nchar get_header_tar_gz(archive_handle_t *archive_handle) FAST_FUNC;\nchar get_header_tar_bz2(archive_handle_t *archive_handle) FAST_FUNC;\nchar get_header_tar_lzma(archive_handle_t *archive_handle) FAST_FUNC;\nchar get_header_tar_xz(archive_handle_t *archive_handle) FAST_FUNC;\n\nvoid seek_by_jump(int fd, off_t amount) FAST_FUNC;\nvoid seek_by_read(int fd, off_t amount) FAST_FUNC;\n\nconst char *strip_unsafe_prefix(const char *str) FAST_FUNC;\nvoid create_or_remember_link(llist_t **link_placeholders,\n\t\tconst char *target,\n\t\tconst char *linkname,\n\t\tint hard_link) FAST_FUNC;\nvoid create_links_from_list(llist_t *list) FAST_FUNC;\n\nvoid data_align(archive_handle_t *archive_handle, unsigned boundary) FAST_FUNC;\nconst llist_t *find_list_entry(const llist_t *list, const char *filename) FAST_FUNC;\nconst llist_t *find_list_entry2(const llist_t *list, const char *filename) FAST_FUNC;\n\n/* A bit of bunzip2 internals are exposed for compressed help support: */\nchar *unpack_bz2_data(const char *packed, int packed_len, int unpacked_len) FAST_FUNC;\n\n/* Meaning and direction (input/output) of the fields are transformer-specific */\ntypedef struct transformer_state_t {\n\tint8_t   signature_skipped; /* most often referenced member */\n\n\tIF_DESKTOP(long long) int FAST_FUNC (*xformer)(struct transformer_state_t *xstate);\n\tUSE_FOR_NOMMU(const char *xformer_prog;)\n\n\t/* Source */\n\tint      src_fd;\n\t/* Output */\n\tint      dst_fd;\n\tconst char *dst_dir;            /* if non-NULL, extract to dir */\n\tchar     *dst_name;\n\tuint64_t dst_size;\n\tsize_t   mem_output_size_max;   /* if non-zero, decompress to RAM instead of fd */\n\tsize_t   mem_output_size;\n\tchar     *mem_output_buf;\n\n\tuint64_t bytes_out;\n\tuint64_t bytes_in;  /* used in unzip code only: needs to know packed size */\n\tuint32_t crc32;\n\ttime_t   mtime;     /* gunzip code may set this on exit */\n\n\tunion {             /* if we read magic, it's saved here */\n\t\tuint8_t b[8];\n\t\tuint16_t b16[4];\n\t\tuint32_t b32[2];\n\t} magic;\n} transformer_state_t;\n\nvoid init_transformer_state(transformer_state_t *xstate) FAST_FUNC;\nssize_t transformer_write(transformer_state_t *xstate, const void *buf, size_t bufsize) FAST_FUNC;\nssize_t xtransformer_write(transformer_state_t *xstate, const void *buf, size_t bufsize) FAST_FUNC;\nint check_signature16(transformer_state_t *xstate, unsigned magic16) FAST_FUNC;\n\nstatic inline int transformer_switch_file(transformer_state_t* xstate)\n{\n\tchar dst[MAX_PATH];\n\tsize_t i, last_slash = 0;\n\n\tif (xstate->dst_fd > 0) {\n\t\t_close(xstate->dst_fd);\n\t\txstate->dst_fd = -1;\n\t}\n\t_snprintf_s(dst, sizeof(dst), _TRUNCATE, \"%s/%s\", xstate->dst_dir, xstate->dst_name);\n\tfree(xstate->dst_name);\n\txstate->dst_name = NULL;\n\tfor (i = 0; i < strlen(dst); i++) {\n\t\tif (dst[i] == '/')\n\t\t\tdst[i] = '\\\\';\n\t\tif (dst[i] == '\\\\')\n\t\t\tlast_slash = i;\n\t}\n\tif (bled_switch != NULL)\n\t\tbled_switch(dst, xstate->dst_size);\n\tdst[last_slash] = 0;\n\tbb_make_directory(dst, 0, 0);\n\tdst[last_slash] = '/';\n\txstate->dst_fd = _openU(dst, _O_WRONLY | _O_CREAT | _O_TRUNC | _O_BINARY, _S_IREAD | _S_IWRITE);\n\tif (xstate->dst_fd < 0) {\n\t\tbb_error_msg(\"Could not create '%s' (errno: %d)\", dst, errno);\n\t\treturn -errno;\n\t}\n\treturn 0;\n}\n\nIF_DESKTOP(long long) int inflate_unzip(transformer_state_t *xstate) FAST_FUNC;\nIF_DESKTOP(long long) int unpack_zip_stream(transformer_state_t *xstate) FAST_FUNC;\nIF_DESKTOP(long long) int unpack_Z_stream(transformer_state_t *xstate) FAST_FUNC;\nIF_DESKTOP(long long) int unpack_gz_stream(transformer_state_t *xstate) FAST_FUNC;\nIF_DESKTOP(long long) int unpack_bz2_stream(transformer_state_t *xstate) FAST_FUNC;\nIF_DESKTOP(long long) int unpack_lzma_stream(transformer_state_t *xstate) FAST_FUNC;\nIF_DESKTOP(long long) int unpack_xz_stream(transformer_state_t *xstate) FAST_FUNC;\nIF_DESKTOP(long long) int unpack_vtsi_stream(transformer_state_t *xstate) FAST_FUNC;\nIF_DESKTOP(long long) int unpack_zstd_stream(transformer_state_t *xstate) FAST_FUNC;\n\nchar* append_ext(char *filename, const char *expected_ext) FAST_FUNC;\nint bbunpack(char **argv,\n\t\tIF_DESKTOP(long long) int FAST_FUNC (*unpacker)(transformer_state_t *xstate),\n\t\tchar* FAST_FUNC (*make_new_name)(char *filename, const char *expected_ext),\n\t\tconst char *expected_ext\n) FAST_FUNC;\n\nvoid check_errors_in_children(int signo);\n#if BB_MMU\nvoid fork_transformer(int fd,\n\tint signature_skipped,\n\tIF_DESKTOP(long long) int FAST_FUNC (*transformer)(transformer_state_t *xstate)\n) FAST_FUNC;\n#define fork_transformer_with_sig(fd, transformer, transform_prog) fork_transformer((fd), 0, (transformer))\n#define fork_transformer_with_no_sig(fd, transformer)              fork_transformer((fd), 1, (transformer))\n#else\nvoid fork_transformer(int fd, const char *transform_prog) FAST_FUNC;\n#define fork_transformer_with_sig(fd, transformer, transform_prog) fork_transformer((fd), (transform_prog))\n/* fork_transformer_with_no_sig() does not exist on NOMMU */\n#endif\n\n\nPOP_SAVED_FUNCTION_VISIBILITY\n\n#endif\n"
  },
  {
    "path": "src/bled/bled.c",
    "content": "/*\n * Bled (Base Library for Easy Decompression)\n *\n * Copyright © 2014-2024 Pete Batard <pete@akeo.ie>\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n#include \"bled.h\"\n\ntypedef long long int(*unpacker_t)(transformer_state_t *xstate);\n\n/* Globals */\nsmallint bb_got_signal;\nuint64_t bb_total_rb;\nprintf_t bled_printf = NULL;\nread_t bled_read = NULL;\nwrite_t bled_write = NULL;\nprogress_t bled_progress = NULL;\nswitch_t bled_switch = NULL;\nunsigned long* bled_cancel_request;\nstatic bool bled_initialized = 0;\njmp_buf bb_error_jmp;\nchar* bb_virtual_buf = NULL;\nsize_t bb_virtual_len = 0, bb_virtual_pos = 0;\nint bb_virtual_fd = -1;\n// ZSTD has a minimal buffer size of (1 << ZSTD_BLOCKSIZELOG_MAX) + ZSTD_blockHeaderSize = 128 KB + 3\n// So we set our bufsize to 256 KB\nuint32_t BB_BUFSIZE = 0x40000;\n\nstatic long long int unpack_none(transformer_state_t *xstate)\n{\n\tbb_error_msg(\"This compression type is not supported\");\n\treturn -1;\n}\n\nunpacker_t unpacker[BLED_COMPRESSION_MAX] = {\n\tunpack_none,\n\tunpack_zip_stream,\n\tunpack_Z_stream,\n\tunpack_gz_stream,\n\tunpack_lzma_stream,\n\tunpack_bz2_stream,\n\tunpack_xz_stream,\n\tunpack_none,\n\tunpack_vtsi_stream,\n\tunpack_zstd_stream,\n};\n\n/* Uncompress file 'src', compressed using 'type', to file 'dst' */\nint64_t bled_uncompress(const char* src, const char* dst, int type)\n{\n\ttransformer_state_t xstate;\n\tint64_t ret = -1;\n\n\tif (!bled_initialized) {\n\t\tbb_error_msg(\"The library has not been initialized\");\n\t\treturn -1;\n\t}\n\n\tbb_total_rb = 0;\n\tinit_transformer_state(&xstate);\n\txstate.src_fd = -1;\n\txstate.dst_fd = -1;\n\n\txstate.src_fd = _openU(src, _O_RDONLY | _O_BINARY, 0);\n\tif (xstate.src_fd < 0) {\n\t\tbb_error_msg(\"Could not open '%s' (errno: %d)\", src, errno);\n\t\tgoto err;\n\t}\n\n\txstate.dst_fd = _openU(dst, _O_WRONLY | _O_CREAT | _O_TRUNC | _O_BINARY, _S_IREAD | _S_IWRITE);\n\tif (xstate.dst_fd < 0) {\n\t\tbb_error_msg(\"Could not open '%s' (errno: %d)\", dst, errno);\n\t\tgoto err;\n\t}\n\n\tif ((type < 0) || (type >= BLED_COMPRESSION_MAX)) {\n\t\tbb_error_msg(\"Unsupported compression format\");\n\t\tgoto err;\n\t}\n\n\tif (setjmp(bb_error_jmp))\n\t\tgoto err;\n\n\tret = unpacker[type](&xstate);\n\nerr:\n\tfree(xstate.dst_name);\n\tif (xstate.src_fd > 0)\n\t\t_close(xstate.src_fd);\n\tif (xstate.dst_fd > 0)\n\t\t_close(xstate.dst_fd);\n\treturn ret;\n}\n\n/* Uncompress using Windows handles */\nint64_t bled_uncompress_with_handles(HANDLE hSrc, HANDLE hDst, int type)\n{\n\ttransformer_state_t xstate;\n\n\tif (!bled_initialized) {\n\t\tbb_error_msg(\"The library has not been initialized\");\n\t\treturn -1;\n\t}\n\n\tbb_total_rb = 0;\n\tinit_transformer_state(&xstate);\n\txstate.src_fd = -1;\n\txstate.dst_fd = -1;\n\n\txstate.src_fd = _open_osfhandle((intptr_t)hSrc, _O_RDONLY);\n\tif (xstate.src_fd < 0) {\n\t\tbb_error_msg(\"Could not get source descriptor (errno: %d)\", errno);\n\t\treturn -1;\n\t}\n\n\txstate.dst_fd = _open_osfhandle((intptr_t)hDst, 0);\n\tif (xstate.dst_fd < 0) {\n\t\tbb_error_msg(\"Could not get target descriptor (errno: %d)\", errno);\n\t\treturn -1;\n\t}\n\n\tif ((type < 0) || (type >= BLED_COMPRESSION_MAX)) {\n\t\tbb_error_msg(\"Unsupported compression format\");\n\t\treturn -1;\n\t}\n\n\tif (setjmp(bb_error_jmp))\n\t\treturn -1;\n\n\treturn unpacker[type](&xstate);\n}\n\n/* Uncompress file 'src', compressed using 'type', to buffer 'buf' of size 'size' */\nint64_t bled_uncompress_to_buffer(const char* src, char* buf, size_t size, int type)\n{\n\ttransformer_state_t xstate;\n\tint64_t ret = -1;\n\n\tif (!bled_initialized) {\n\t\tbb_error_msg(\"The library has not been initialized\");\n\t\treturn -1;\n\t}\n\n\tif ((src == NULL) || (buf == NULL)) {\n\t\tbb_error_msg(\"Invalid parameter\");\n\t\treturn -1;\n\t}\n\n\tbb_total_rb = 0;\n\tinit_transformer_state(&xstate);\n\txstate.src_fd = -1;\n\txstate.dst_fd = -1;\n\n\tif (src[0] == 0) {\n\t\txstate.src_fd = bb_virtual_fd;\n\t} else {\n\t\txstate.src_fd = _openU(src, _O_RDONLY | _O_BINARY, 0);\n\t}\n\tif (xstate.src_fd < 0) {\n\t\tbb_error_msg(\"Could not open '%s' (errno: %d)\", src, errno);\n\t\tgoto err;\n\t}\n\n\txstate.mem_output_buf = buf;\n\txstate.mem_output_size = 0;\n\txstate.mem_output_size_max = size;\n\n\tif ((type < 0) || (type >= BLED_COMPRESSION_MAX)) {\n\t\tbb_error_msg(\"Unsupported compression format\");\n\t\tgoto err;\n\t}\n\n\tif (setjmp(bb_error_jmp))\n\t\tgoto err;\n\n\tret = unpacker[type](&xstate);\n\nerr:\n\tfree(xstate.dst_name);\n\tif ((src[0] != 0) && (xstate.src_fd > 0))\n\t\t_close(xstate.src_fd);\n\treturn ret;\n}\n\n/* Uncompress all files from archive 'src', compressed using 'type', to destination dir 'dir' */\nint64_t bled_uncompress_to_dir(const char* src, const char* dir, int type)\n{\n\ttransformer_state_t xstate;\n\tint64_t ret = -1;\n\n\tif (!bled_initialized) {\n\t\tbb_error_msg(\"The library has not been initialized\");\n\t\treturn -1;\n\t}\n\n\tbb_total_rb = 0;\n\tinit_transformer_state(&xstate);\n\txstate.src_fd = -1;\n\txstate.dst_fd = -1;\n\n\txstate.src_fd = _openU(src, _O_RDONLY | _O_BINARY, 0);\n\tif (xstate.src_fd < 0) {\n\t\tbb_error_msg(\"Could not open '%s' (errno: %d)\", src, errno);\n\t\tgoto err;\n\t}\n\n\txstate.dst_dir = dir;\n\n\t// Only zip archives are supported for now\n\tif (type != BLED_COMPRESSION_ZIP) {\n\t\tbb_error_msg(\"This compression format is not supported for directory extraction\");\n\t\tgoto err;\n\t}\n\n\tif (setjmp(bb_error_jmp))\n\t\tgoto err;\n\n\tret = unpacker[type](&xstate);\n\nerr:\n\tfree(xstate.dst_name);\n\tif (xstate.src_fd > 0)\n\t\t_close(xstate.src_fd);\n\tif (xstate.dst_fd > 0)\n\t\t_close(xstate.dst_fd);\n\treturn ret;\n}\n\nint64_t bled_uncompress_from_buffer_to_buffer(const char* src, const size_t src_len, char* dst, size_t dst_len, int type)\n{\n\tint64_t ret;\n\n\tif (!bled_initialized) {\n\t\tbb_error_msg(\"The library has not been initialized\");\n\t\treturn -1;\n\t}\n\n\tif ((src == NULL) || (dst == NULL)) {\n\t\tbb_error_msg(\"Invalid parameter\");\n\t\treturn -1;\n\t}\n\n\tif (bb_virtual_buf != NULL) {\n\t\tbb_error_msg(\"Can not decompress more than one buffer at once\");\n\t\treturn -1;\n\t}\n\n\tbb_virtual_buf = (char*)src;\n\tbb_virtual_len = src_len;\n\tbb_virtual_pos = 0;\n\tbb_virtual_fd = 0;\n\n\tret = bled_uncompress_to_buffer(\"\", dst, dst_len, type);\n\n\tbb_virtual_buf = NULL;\n\tbb_virtual_len = 0;\n\tbb_virtual_fd = -1;\n\n\treturn ret;\n}\n\n/* Initialize the library.\n * When the parameters are not NULL or zero you can:\n * - specify the buffer size to use (must be larger than 256KB and a power of two)\n * - specify the printf-like function you want to use to output message\n *   void print_function(const char* format, ...);\n * - specify the read/write functions you want to use;\n * - specify the function you want to use to display progress, based on number of source archive bytes read\n *   void progress_function(const uint64_t read_bytes);\n * - specify the function you want to use when switching files in an archive\n *   void switch_function(const char* filename, const uint64_t filesize);\n * - point to an unsigned long variable, to be used to cancel operations when set to non zero\n */\nint bled_init(uint32_t buffer_size, printf_t print_function, read_t read_function, write_t write_function,\n\tprogress_t progress_function, switch_t switch_function, unsigned long* cancel_request)\n{\n\tif (bled_initialized)\n\t\treturn -1;\n\tBB_BUFSIZE = buffer_size;\n\t/* buffer_size must be larger than 256 KB and a power of two */\n\tif (buffer_size < 0x40000 || (buffer_size & (buffer_size - 1)) != 0) {\n\t\tif (buffer_size != 0 && print_function != NULL)\n\t\t\tprint_function(\"bled_init: invalid buffer_size, defaulting to 64 KB\");\n\t\tBB_BUFSIZE = 0x40000;\n\t}\n\tbled_printf = print_function;\n\tbled_read = read_function;\n\tbled_write = write_function;\n\tbled_progress = progress_function;\n\tbled_switch = switch_function;\n\tbled_cancel_request = cancel_request;\n\tbled_initialized = true;\n\treturn 0;\n}\n\n/* This call frees any resource used by the library */\nvoid bled_exit(void)\n{\n\tbled_printf = NULL;\n\tbled_progress = NULL;\n\tbled_switch = NULL;\n\tbled_cancel_request = NULL;\n\tif (global_crc32_table) {\n\t\tfree(global_crc32_table);\n\t\tglobal_crc32_table = NULL;\n\t}\n\tbled_initialized = false;\n}\n"
  },
  {
    "path": "src/bled/bled.h",
    "content": "/*\n * Bled (Base Library for Easy Decompression)\n *\n * Copyright © 2014-2024 Pete Batard <pete@akeo.ie>\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n\n#include <windows.h>\n#include <stdint.h>\n\n#pragma once\n\n#ifndef ARRAYSIZE\n#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))\n#endif\n\ntypedef void (*printf_t) (const char* format, ...);\ntypedef void (*progress_t) (const uint64_t read_bytes);\ntypedef int (*read_t)(int fd, void* buf, unsigned int count);\ntypedef int (*write_t)(int fd, const void* buf, unsigned int count);\ntypedef void (*switch_t)(const char* filename, const uint64_t size);\n\ntypedef enum {\n\tBLED_COMPRESSION_NONE = 0,\n\tBLED_COMPRESSION_ZIP,\t\t// .zip\n\tBLED_COMPRESSION_LZW,\t\t// .Z\n\tBLED_COMPRESSION_GZIP,\t\t// .gz\n\tBLED_COMPRESSION_LZMA,\t\t// .lzma\n\tBLED_COMPRESSION_BZIP2,\t\t// .bz2\n\tBLED_COMPRESSION_XZ,\t\t// .xz\n\tBLED_COMPRESSION_7ZIP,\t\t// .7z\n\tBLED_COMPRESSION_VTSI,\t\t// .vtsi\n\tBLED_COMPRESSION_ZSTD,\t\t// .zst\n\tBLED_COMPRESSION_MAX\n} bled_compression_type;\n\n/* Uncompress file 'src', compressed using 'type', to file 'dst' */\nint64_t bled_uncompress(const char* src, const char* dst, int type);\n\n/* Uncompress using Windows handles */\nint64_t bled_uncompress_with_handles(HANDLE hSrc, HANDLE hDst, int type);\n\n/* Uncompress file 'src', compressed using 'type', to buffer 'buf' of size 'size' */\nint64_t bled_uncompress_to_buffer(const char* src, char* buf, size_t size, int type);\n\n/* Uncompress all files from archive 'src', compressed using 'type', to destination dir 'dir' */\nint64_t bled_uncompress_to_dir(const char* src, const char* dir, int type);\n\n/* Uncompress buffer 'src' of length 'src_len' to buffer 'dst' of size 'dst_len' */\nint64_t bled_uncompress_from_buffer_to_buffer(const char* src, const size_t src_len, char* dst, size_t dst_len, int type);\n\n/* Initialize the library.\n * When the parameters are not NULL or zero you can:\n * - specify the buffer size to use (must be larger than 64KB and a power of two)\n * - specify the printf-like function you want to use to output message\n *   void print_function(const char* format, ...);\n * - specify the read/write functions you want to use;\n * - specify the function you want to use to display progress, based on number of source archive bytes read\n *   void progress_function(const uint64_t read_bytes);\n * - specify the function you want to use when switching files in an archive\n *   void switch_function(const char* filename, const uint64_t filesize);\n * - point to an unsigned long variable, to be used to cancel operations when set to non zero\n */\nint bled_init(uint32_t buffer_size, printf_t print_function, read_t read_function, write_t write_function,\n    progress_t progress_function, switch_t switch_function, unsigned long* cancel_request);\n\n/* This call frees any resource used by the library */\nvoid bled_exit(void);\n"
  },
  {
    "path": "src/bled/crc32.c",
    "content": "/*\n * GPLv2+ CRC32 implementation for busybox\n *\n * Based on crc32.c from util-linux v2.17's partx v2.17 - Public Domain\n * Adjusted for busybox' by Pete Batard <pete@akeo.ie>\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n\n#include \"libbb.h\"\n\n#if __GNUC__ >= 3\t/* 2.x has \"attribute\", but only 3.0 has \"pure */\n#define attribute(x) __attribute__(x)\n#else\n#define attribute(x)\n#endif\n\n/* Do NOT alter these */\n#define CRC_LE_BITS 8\n#define CRC_BE_BITS 8\n\n/*\n * There are multiple 16-bit CRC polynomials in common use, but this is\n * *the* standard CRC-32 polynomial, first popularized by Ethernet.\n * x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+x^0\n */\n#define CRCPOLY_LE 0xedb88320\n#define CRCPOLY_BE 0x04c11db7\n\n/* This needs to be defined somewhere */\nuint32_t *global_crc32_table;\n\nstatic void crc32init_le(uint32_t *crc32table_le)\n{\n\tunsigned i, j;\n\tuint32_t crc = 1;\n\n\tcrc32table_le[0] = 0;\n\n\tfor (i = 1 << (CRC_LE_BITS - 1); i; i >>= 1) {\n\t\t// coverity[overflow_const]\n\t\tcrc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0);\n\t\tfor (j = 0; j < 1 << CRC_LE_BITS; j += 2 * i)\n\t\t\tcrc32table_le[i + j] = crc ^ crc32table_le[j];\n\t}\n}\n\n/**\n * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32\n * @crc - seed value for computation.  ~0 for Ethernet, sometimes 0 for\n *        other uses, or the previous crc32 value if computing incrementally.\n * @p   - pointer to buffer over which CRC is run\n * @len - length of buffer @p\n * \n */\nuint32_t attribute((pure)) crc32_le(uint32_t crc, unsigned char const *p, size_t len, uint32_t *crc32table_le)\n{\n\twhile (len--) {\n# if CRC_LE_BITS == 8\n\t\tcrc = (crc >> 8) ^ crc32table_le[(crc ^ *p++) & 255];\n# elif CRC_LE_BITS == 4\n\t\tcrc ^= *p++;\n\t\tcrc = (crc >> 4) ^ crc32table_le[crc & 15];\n\t\tcrc = (crc >> 4) ^ crc32table_le[crc & 15];\n# elif CRC_LE_BITS == 2\n\t\tcrc ^= *p++;\n\t\tcrc = (crc >> 2) ^ crc32table_le[crc & 3];\n\t\tcrc = (crc >> 2) ^ crc32table_le[crc & 3];\n\t\tcrc = (crc >> 2) ^ crc32table_le[crc & 3];\n\t\tcrc = (crc >> 2) ^ crc32table_le[crc & 3];\n# endif\n\t}\n\treturn crc;\n}\n\n/**\n * crc32init_be() - allocate and initialize BE table data\n */\nstatic void crc32init_be(uint32_t *crc32table_be)\n{\n\tunsigned i, j;\n\tuint32_t crc = 0x80000000;\n\n\tfor (i = 1; i < 1 << CRC_BE_BITS; i <<= 1) {\n\t\t// coverity[overflow_const]\n\t\tcrc = (crc << 1) ^ ((crc & 0x80000000) ? CRCPOLY_BE : 0);\n\t\tfor (j = 0; j < i; j++)\n\t\t\tcrc32table_be[i + j] = crc ^ crc32table_be[j];\n\t}\n}\n\n/**\n * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32\n * @crc - seed value for computation.  ~0 for Ethernet, sometimes 0 for\n *        other uses, or the previous crc32 value if computing incrementally.\n * @p   - pointer to buffer over which CRC is run\n * @len - length of buffer @p\n * \n */\nuint32_t attribute((pure)) crc32_be(uint32_t crc, unsigned char const *p, size_t len, uint32_t *crc32table_be)\n{\n\twhile (len--) {\n# if CRC_BE_BITS == 8\n\t\tcrc = (crc << 8) ^ crc32table_be[(crc >> 24) ^ *p++];\n# elif CRC_BE_BITS == 4\n\t\tcrc ^= *p++ << 24;\n\t\tcrc = (crc << 4) ^ crc32table_be[crc >> 28];\n\t\tcrc = (crc << 4) ^ crc32table_be[crc >> 28];\n# elif CRC_BE_BITS == 2\n\t\tcrc ^= *p++ << 24;\n\t\tcrc = (crc << 2) ^ crc32table_be[crc >> 30];\n\t\tcrc = (crc << 2) ^ crc32table_be[crc >> 30];\n\t\tcrc = (crc << 2) ^ crc32table_be[crc >> 30];\n\t\tcrc = (crc << 2) ^ crc32table_be[crc >> 30];\n# endif\n\t}\n\treturn crc;\n}\n\nuint32_t* crc32_filltable(uint32_t *crc_table, int endian)\n{\n\t/* Expects the caller to do the cleanup */\n\tif (!crc_table)\n\t\tcrc_table = calloc(1 << CRC_LE_BITS, sizeof(uint32_t));\n\tif (crc_table) {\n\t\tif (endian)\n\t\t\tcrc32init_be(crc_table);\n\t\telse\n\t\t\tcrc32init_le(crc_table);\n\t}\n\treturn crc_table;\n}\n\n/*\n * A brief CRC tutorial.\n *\n * A CRC is a long-division remainder.  You add the CRC to the message,\n * and the whole thing (message+CRC) is a multiple of the given\n * CRC polynomial.  To check the CRC, you can either check that the\n * CRC matches the recomputed value, *or* you can check that the\n * remainder computed on the message+CRC is 0.  This latter approach\n * is used by a lot of hardware implementations, and is why so many\n * protocols put the end-of-frame flag after the CRC.\n *\n * It's actually the same long division you learned in school, except that\n * - We're working in binary, so the digits are only 0 and 1, and\n * - When dividing polynomials, there are no carries.  Rather than add and\n *   subtract, we just xor.  Thus, we tend to get a bit sloppy about\n *   the difference between adding and subtracting.\n *\n * A 32-bit CRC polynomial is actually 33 bits long.  But since it's\n * 33 bits long, bit 32 is always going to be set, so usually the CRC\n * is written in hex with the most significant bit omitted.  (If you're\n * familiar with the IEEE 754 floating-point format, it's the same idea.)\n *\n * Note that a CRC is computed over a string of *bits*, so you have\n * to decide on the endianness of the bits within each byte.  To get\n * the best error-detecting properties, this should correspond to the\n * order they're actually sent.  For example, standard RS-232 serial is\n * little-endian; the most significant bit (sometimes used for parity)\n * is sent last.  And when appending a CRC word to a message, you should\n * do it in the right order, matching the endianness.\n *\n * Just like with ordinary division, the remainder is always smaller than\n * the divisor (the CRC polynomial) you're dividing by.  Each step of the\n * division, you take one more digit (bit) of the dividend and append it\n * to the current remainder.  Then you figure out the appropriate multiple\n * of the divisor to subtract to being the remainder back into range.\n * In binary, it's easy - it has to be either 0 or 1, and to make the\n * XOR cancel, it's just a copy of bit 32 of the remainder.\n *\n * When computing a CRC, we don't care about the quotient, so we can\n * throw the quotient bit away, but subtract the appropriate multiple of\n * the polynomial from the remainder and we're back to where we started,\n * ready to process the next bit.\n *\n * A big-endian CRC written this way would be coded like:\n * for (i = 0; i < input_bits; i++) {\n * \tmultiple = remainder & 0x80000000 ? CRCPOLY : 0;\n * \tremainder = (remainder << 1 | next_input_bit()) ^ multiple;\n * }\n * Notice how, to get at bit 32 of the shifted remainder, we look\n * at bit 31 of the remainder *before* shifting it.\n *\n * But also notice how the next_input_bit() bits we're shifting into\n * the remainder don't actually affect any decision-making until\n * 32 bits later.  Thus, the first 32 cycles of this are pretty boring.\n * Also, to add the CRC to a message, we need a 32-bit-long hole for it at\n * the end, so we have to add 32 extra cycles shifting in zeros at the\n * end of every message,\n *\n * So the standard trick is to rearrage merging in the next_input_bit()\n * until the moment it's needed.  Then the first 32 cycles can be precomputed,\n * and merging in the final 32 zero bits to make room for the CRC can be\n * skipped entirely.\n * This changes the code to:\n * for (i = 0; i < input_bits; i++) {\n *      remainder ^= next_input_bit() << 31;\n * \tmultiple = (remainder & 0x80000000) ? CRCPOLY : 0;\n * \tremainder = (remainder << 1) ^ multiple;\n * }\n * With this optimization, the little-endian code is simpler:\n * for (i = 0; i < input_bits; i++) {\n *      remainder ^= next_input_bit();\n * \tmultiple = (remainder & 1) ? CRCPOLY : 0;\n * \tremainder = (remainder >> 1) ^ multiple;\n * }\n *\n * Note that the other details of endianness have been hidden in CRCPOLY\n * (which must be bit-reversed) and next_input_bit().\n *\n * However, as long as next_input_bit is returning the bits in a sensible\n * order, we can actually do the merging 8 or more bits at a time rather\n * than one bit at a time:\n * for (i = 0; i < input_bytes; i++) {\n * \tremainder ^= next_input_byte() << 24;\n * \tfor (j = 0; j < 8; j++) {\n * \t\tmultiple = (remainder & 0x80000000) ? CRCPOLY : 0;\n * \t\tremainder = (remainder << 1) ^ multiple;\n * \t}\n * }\n * Or in little-endian:\n * for (i = 0; i < input_bytes; i++) {\n * \tremainder ^= next_input_byte();\n * \tfor (j = 0; j < 8; j++) {\n * \t\tmultiple = (remainder & 1) ? CRCPOLY : 0;\n * \t\tremainder = (remainder << 1) ^ multiple;\n * \t}\n * }\n * If the input is a multiple of 32 bits, you can even XOR in a 32-bit\n * word at a time and increase the inner loop count to 32.\n *\n * You can also mix and match the two loop styles, for example doing the\n * bulk of a message byte-at-a-time and adding bit-at-a-time processing\n * for any fractional bytes at the end.\n *\n * The only remaining optimization is to the byte-at-a-time table method.\n * Here, rather than just shifting one bit of the remainder to decide\n * in the correct multiple to subtract, we can shift a byte at a time.\n * This produces a 40-bit (rather than a 33-bit) intermediate remainder,\n * but again the multiple of the polynomial to subtract depends only on\n * the high bits, the high 8 bits in this case.  \n *\n * The multile we need in that case is the low 32 bits of a 40-bit\n * value whose high 8 bits are given, and which is a multiple of the\n * generator polynomial.  This is simply the CRC-32 of the given\n * one-byte message.\n *\n * Two more details: normally, appending zero bits to a message which\n * is already a multiple of a polynomial produces a larger multiple of that\n * polynomial.  To enable a CRC to detect this condition, it's common to\n * invert the CRC before appending it.  This makes the remainder of the\n * message+crc come out not as zero, but some fixed non-zero value.\n *\n * The same problem applies to zero bits prepended to the message, and\n * a similar solution is used.  Instead of starting with a remainder of\n * 0, an initial remainder of all ones is used.  As long as you start\n * the same way on decoding, it doesn't make a difference.\n */\n"
  },
  {
    "path": "src/bled/data_align.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\nvoid FAST_FUNC data_align(archive_handle_t *archive_handle, unsigned boundary)\n{\n\tunsigned skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary;\n\n\tarchive_handle->seek(archive_handle->src_fd, skip_amount);\n\tarchive_handle->offset += skip_amount;\n}\n"
  },
  {
    "path": "src/bled/data_extract_all.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\nvoid FAST_FUNC data_extract_all(archive_handle_t *archive_handle)\n{\n\tfile_header_t *file_header = archive_handle->file_header;\n\tint dst_fd;\n\tint res;\n\tchar *hard_link;\n#if ENABLE_FEATURE_TAR_LONG_OPTIONS\n\tchar *dst_name;\n#else\n# define dst_name (file_header->name)\n#endif\n\n#if ENABLE_FEATURE_TAR_SELINUX\n\tchar *sctx = archive_handle->tar__sctx[PAX_NEXT_FILE];\n\tif (!sctx)\n\t\tsctx = archive_handle->tar__sctx[PAX_GLOBAL];\n\tif (sctx) { /* setfscreatecon is 4 syscalls, avoid if possible */\n\t\tsetfscreatecon(sctx);\n\t\tfree(archive_handle->tar__sctx[PAX_NEXT_FILE]);\n\t\tarchive_handle->tar__sctx[PAX_NEXT_FILE] = NULL;\n\t}\n#endif\n\n\t/* Hard links are encoded as regular files of size 0\n\t * with a nonempty link field */\n\thard_link = NULL;\n\tif (S_ISREG(file_header->mode) && file_header->size == 0)\n\t\thard_link = file_header->link_target;\n\n#if ENABLE_FEATURE_TAR_LONG_OPTIONS\n\tdst_name = file_header->name;\n\tif (archive_handle->tar__strip_components) {\n\t\tunsigned n = archive_handle->tar__strip_components;\n\t\tdo {\n\t\t\tdst_name = strchr(dst_name, '/');\n\t\t\tif (!dst_name || dst_name[1] == '\\0') {\n\t\t\t\tdata_skip(archive_handle);\n\t\t\t\tgoto ret;\n\t\t\t}\n\t\t\tdst_name++;\n\t\t\t/*\n\t\t\t * Link target is shortened only for hardlinks:\n\t\t\t * softlinks restored unchanged.\n\t\t\t */\n\t\t\tif (hard_link) {\n// GNU tar 1.26 does not check that we reached end of link name:\n// if \"dir/hardlink\" is hardlinked to \"file\",\n// tar xvf a.tar --strip-components=1 says:\n//  tar: hardlink: Cannot hard link to '': No such file or directory\n// and continues processing. We silently skip such entries.\n\t\t\t\thard_link = strchr(hard_link, '/');\n\t\t\t\tif (!hard_link || hard_link[1] == '\\0') {\n\t\t\t\t\tdata_skip(archive_handle);\n\t\t\t\t\tgoto ret;\n\t\t\t\t}\n\t\t\t\thard_link++;\n\t\t\t}\n\t\t} while (--n != 0);\n\t}\n#endif\n\n\tif (archive_handle->ah_flags & ARCHIVE_CREATE_LEADING_DIRS) {\n\t\tchar *slash = strrchr(dst_name, '/');\n\t\tif (slash) {\n\t\t\t*slash = '\\0';\n\t\t\tbb_make_directory(dst_name, -1, FILEUTILS_RECUR);\n\t\t\t*slash = '/';\n\t\t}\n\t}\n\n\tif (archive_handle->ah_flags & ARCHIVE_UNLINK_OLD) {\n\t\t/* Remove the entry if it exists */\n\t\tif (!S_ISDIR(file_header->mode)) {\n\t\t\tif (hard_link) {\n\t\t\t\t/* Ugly special case:\n\t\t\t\t * tar cf t.tar hardlink1 hardlink2 hardlink1\n\t\t\t\t * results in this tarball structure:\n\t\t\t\t * hardlink1\n\t\t\t\t * hardlink2 -> hardlink1\n\t\t\t\t * hardlink1 -> hardlink1 <== !!!\n\t\t\t\t */\n\t\t\t\tif (strcmp(hard_link, dst_name) == 0)\n\t\t\t\t\tgoto ret;\n\t\t\t}\n\t\t\t/* Proceed with deleting */\n\t\t\tif (_unlink(dst_name) == -1\n\t\t\t && errno != ENOENT\n\t\t\t) {\n\t\t\t\tbb_perror_msg_and_die(\"can't remove old file %s\",\n\t\t\t\t\t\tdst_name);\n\t\t\t}\n\t\t}\n\t}\n\telse if (archive_handle->ah_flags & ARCHIVE_EXTRACT_NEWER) {\n\t\t/* Remove the existing entry if its older than the extracted entry */\n\t\tstruct stat existing_sb;\n\t\tif (lstat(dst_name, &existing_sb) == -1) {\n\t\t\tif (errno != ENOENT) {\n\t\t\t\tbb_simple_perror_msg_and_die(\"can't stat old file\");\n\t\t\t}\n\t\t}\n\t\telse if (existing_sb.st_mtime >= file_header->mtime) {\n\t\t\tif (!S_ISDIR(file_header->mode)) {\n\t\t\t\tbb_error_msg(\"%s not created: newer or \"\n\t\t\t\t\t\"same age file exists\", dst_name);\n\t\t\t}\n\t\t\tdata_skip(archive_handle);\n\t\t\tgoto ret;\n\t\t}\n\t\telse if ((_unlink(dst_name) == -1) && (errno != EISDIR)) {\n\t\t\tbb_perror_msg_and_die(\"can't remove old file %s\",\n\t\t\t\t\tdst_name);\n\t\t}\n\t}\n\n\t/* Handle hard links separately */\n\tif (hard_link) {\n\t\tcreate_or_remember_link(&archive_handle->link_placeholders,\n\t\t\t\thard_link,\n\t\t\t\tdst_name,\n\t\t\t\t1);\n\t\t/* Hardlinks have no separate mode/ownership, skip chown/chmod */\n\t\tgoto ret;\n\t}\n\n\t/* Create the filesystem entry */\n\tswitch (file_header->mode & S_IFMT) {\n\tcase S_IFREG: {\n\t\t/* Regular file */\n#ifdef ARCHIVE_REPLACE_VIA_RENAME\n\t\tchar *dst_nameN;\n#endif\n\t\tint flags = O_WRONLY | O_CREAT | O_EXCL;\n\t\tif (archive_handle->ah_flags & ARCHIVE_O_TRUNC)\n\t\t\tflags = O_WRONLY | O_CREAT | O_TRUNC;\n#ifdef ARCHIVE_REPLACE_VIA_RENAME\n\t\tdst_nameN = dst_name;\n\t\tif (archive_handle->ah_flags & ARCHIVE_REPLACE_VIA_RENAME)\n\t\t\t/* rpm-style temp file name */\n\t\t\tdst_nameN = xasprintf(\"%s;%x\", dst_name, (int)getpid());\n#endif\n\t\tif (_sopen_s(&dst_fd, dst_name, flags, _SH_DENYNO, file_header->mode) != 0) {\n\t\t\tbb_perror_msg_and_die(\"can't open file %s\", dst_name);\n\t\t}\n\t\tbb_copyfd_exact_size(archive_handle->src_fd, dst_fd, file_header->size);\n\t\t_close(dst_fd);\n#ifdef ARCHIVE_REPLACE_VIA_RENAME\n\t\tif (archive_handle->ah_flags & ARCHIVE_REPLACE_VIA_RENAME) {\n\t\t\txrename(dst_nameN, dst_name);\n\t\t\tfree(dst_nameN);\n\t\t}\n#endif\n\t\tbreak;\n\t}\n\tcase S_IFDIR:\n//TODO: this causes problems if tarball contains a r-xr-xr-x directory:\n// we create this directory, and then fail to create files inside it\n// (if tar xf isn't run as root).\n// GNU tar works around this by chmod-ing directories *after* all files are extracted.\n\t\tres = mkdir(dst_name, file_header->mode);\n\t\tif ((res != 0)\n\t\t && (errno != EISDIR) /* btw, Linux doesn't return this */\n\t\t && (errno != EEXIST)\n\t\t) {\n\t\t\tbb_perror_msg(\"can't make dir %s\", dst_name);\n\t\t}\n\t\tbreak;\n\tcase S_IFLNK:\n\t\t/* Symlink */\n//TODO: what if file_header->link_target == NULL (say, corrupted tarball?)\n\n\t\t/* To avoid a directory traversal attack via symlinks,\n\t\t * do not restore symlinks with \"..\" components\n\t\t * or symlinks starting with \"/\", unless a magic\n\t\t * envvar is set.\n\t\t *\n\t\t * For example, consider a .tar created via:\n\t\t *  $ tar cvf bug.tar anything.txt\n\t\t *  $ ln -s /tmp symlink\n\t\t *  $ tar --append -f bug.tar symlink\n\t\t *  $ rm symlink\n\t\t *  $ mkdir symlink\n\t\t *  $ tar --append -f bug.tar symlink/evil.py\n\t\t *\n\t\t * This will result in an archive that contains:\n\t\t *  $ tar --list -f bug.tar\n\t\t *  anything.txt\n\t\t *  symlink [-> /tmp]\n\t\t *  symlink/evil.py\n\t\t *\n\t\t * Untarring bug.tar would otherwise place evil.py in '/tmp'.\n\t\t */\n\t\tcreate_or_remember_link(&archive_handle->link_placeholders,\n\t\t\t\tfile_header->link_target,\n\t\t\t\tdst_name,\n\t\t\t\t0);\n\t\tbreak;\n\tcase S_IFSOCK:\n\tcase S_IFBLK:\n\tcase S_IFCHR:\n\tcase S_IFIFO:\n\t\tres = mknod(dst_name, file_header->mode, file_header->device);\n\t\tif (res != 0) {\n\t\t\tbb_perror_msg(\"can't create node %s\", dst_name);\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tbb_simple_error_msg_and_die(\"unrecognized file type\");\n\t}\n\n\tif (!S_ISLNK(file_header->mode)) {\n\t\tif (!(archive_handle->ah_flags & ARCHIVE_DONT_RESTORE_OWNER)) {\n\t\t\tuid_t uid = file_header->uid;\n\t\t\tgid_t gid = file_header->gid;\n#if ENABLE_FEATURE_TAR_UNAME_GNAME\n\t\t\tif (!(archive_handle->ah_flags & ARCHIVE_NUMERIC_OWNER)) {\n\t\t\t\tif (file_header->tar__uname) {\n//TODO: cache last name/id pair?\n\t\t\t\t\tstruct passwd *pwd = getpwnam(file_header->tar__uname);\n\t\t\t\t\tif (pwd) uid = pwd->pw_uid;\n\t\t\t\t}\n\t\t\t\tif (file_header->tar__gname) {\n\t\t\t\t\tstruct group *grp = getgrnam(file_header->tar__gname);\n\t\t\t\t\tif (grp) gid = grp->gr_gid;\n\t\t\t\t}\n\t\t\t}\n#endif\n\t\t\t/* GNU tar 1.15.1 uses chown, not lchown */\n\t\t\tchown(file_header->name, uid, gid);\n\t\t}\n\t\t/* uclibc has no lchmod, glibc is even stranger -\n\t\t * it has lchmod which seems to do nothing!\n\t\t * so we use chmod... */\n\t\tif (!(archive_handle->ah_flags & ARCHIVE_DONT_RESTORE_PERM)) {\n\t\t\t// coverity[toctou]\n\t\t\t(void)_chmod(file_header->name, file_header->mode);\n\t\t}\n\t\tif (archive_handle->ah_flags & ARCHIVE_RESTORE_DATE) {\n\t\t\tstruct timeval64 t[2];\n\n\t\t\tt[1].tv_sec = t[0].tv_sec = file_header->mtime;\n\t\t\tt[1].tv_usec = t[0].tv_usec = 0;\n\t\t\tutimes64(dst_name, t);\n\t\t}\n\t}\n\n ret: ;\n#if ENABLE_FEATURE_TAR_SELINUX\n\tif (sctx) {\n\t\t/* reset the context after creating an entry */\n\t\tsetfscreatecon(NULL);\n\t}\n#endif\n}\n"
  },
  {
    "path": "src/bled/data_skip.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\nvoid FAST_FUNC data_skip(archive_handle_t *archive_handle)\n{\n\tarchive_handle->seek(archive_handle->src_fd, archive_handle->file_header->size);\n}\n"
  },
  {
    "path": "src/bled/decompress_bunzip2.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Small bzip2 deflate implementation, by Rob Landley (rob@landley.net).\n *\n * Based on bzip2 decompression code by Julian R Seward (jseward@acm.org),\n * which also acknowledges contributions by Mike Burrows, David Wheeler,\n * Peter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten,\n * Robert Sedgewick, and Jon L. Bentley.\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n/*\n\tSize and speed optimizations by Manuel Novoa III  (mjn3@codepoet.org).\n\n\tMore efficient reading of Huffman codes, a streamlined read_bunzip()\n\tfunction, and various other tweaks.  In (limited) tests, approximately\n\t20% faster than bzcat on x86 and about 10% faster on arm.\n\n\tNote that about 2/3 of the time is spent in read_bunzip() reversing\n\tthe Burrows-Wheeler transformation.  Much of that time is delay\n\tresulting from cache misses.\n\n\t(2010 update by vda: profiled \"bzcat <84mbyte.bz2 >/dev/null\"\n\ton x86-64 CPU with L2 > 1M: get_next_block is hotter than read_bunzip:\n\t%time seconds   calls function\n\t71.01   12.69     444 get_next_block\n\t28.65    5.12   93065 read_bunzip\n\t00.22    0.04 7736490 get_bits\n\t00.11    0.02      47 dealloc_bunzip\n\t00.00    0.00   93018 full_write\n\t...)\n\n\n\tI would ask that anyone benefiting from this work, especially those\n\tusing it in commercial products, consider making a donation to my local\n\tnon-profit hospice organization (www.hospiceacadiana.com) in the name of\n\tthe woman I loved, Toni W. Hagan, who passed away Feb. 12, 2003.\n\n\tManuel\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\n#if 0\n# define dbg(...) bb_printf(__VA_ARGS__)\n#else\n# define dbg(...) ((void)0)\n#endif\n\n/* Constants for Huffman coding */\n#define MAX_GROUPS          6\n#define GROUP_SIZE          50      /* 64 would have been more efficient */\n#define MAX_HUFCODE_BITS    20      /* Longest Huffman code allowed */\n#define MAX_SYMBOLS         258     /* 256 literals + RUNA + RUNB */\n#define SYMBOL_RUNA         0\n#define SYMBOL_RUNB         1\n\n/* Status return values */\n#define RETVAL_OK                       0\n#define RETVAL_LAST_BLOCK               (dbg(\"%d\", __LINE__), -1)\n#define RETVAL_NOT_BZIP_DATA            (dbg(\"%d\", __LINE__), -2)\n#define RETVAL_UNEXPECTED_INPUT_EOF     (dbg(\"%d\", __LINE__), -3)\n#define RETVAL_SHORT_WRITE              (dbg(\"%d\", __LINE__), -4)\n#define RETVAL_DATA_ERROR               (dbg(\"%d\", __LINE__), -5)\n#define RETVAL_OUT_OF_MEMORY            (dbg(\"%d\", __LINE__), -6)\n#define RETVAL_OBSOLETE_INPUT           (dbg(\"%d\", __LINE__), -7)\n\n/* Other housekeeping constants */\n#define IOBUF_SIZE          BB_BUFSIZE\n\n/* This is what we know about each Huffman coding group */\nstruct group_data {\n\t/* We have an extra slot at the end of limit[] for a sentinel value. */\n\tint limit[MAX_HUFCODE_BITS+1], base[MAX_HUFCODE_BITS], permute[MAX_SYMBOLS];\n\tint minLen, maxLen;\n};\n\n/* Structure holding all the housekeeping data, including IO buffers and\n * memory that persists between calls to bunzip\n * Found the most used member:\n *  cat this_file.c | sed -e 's/\"/ /g' -e \"s/'/ /g\" | xargs -n1 \\\n *  | grep 'bd->' | sed 's/^.*bd->/bd->/' | sort | $PAGER\n * and moved it (inbufBitCount) to offset 0.\n */\nstruct bunzip_data {\n\t/* I/O tracking data (file handles, buffers, positions, etc.) */\n\tunsigned inbufBitCount, inbufBits;\n\tint in_fd, out_fd, inbufCount, inbufPos /*, outbufPos*/;\n\tuint8_t *inbuf /*,*outbuf*/;\n\n\t/* State for interrupting output loop */\n\tint writeCopies, writePos, writeRunCountdown, writeCount;\n\tint writeCurrent; /* actually a uint8_t */\n\n\t/* The CRC values stored in the block header and calculated from the data */\n\tuint32_t headerCRC, totalCRC, writeCRC;\n\n\t/* Intermediate buffer and its size (in bytes) */\n\tuint32_t *dbuf;\n\tunsigned dbufSize;\n\n\t/* For I/O error handling */\n\tjmp_buf *jmpbuf;\n\n\t/* Big things go last (register-relative addressing can be larger for big offsets) */\n\tuint32_t crc32Table[256];\n\tuint8_t selectors[32768];  /* nSelectors=15 bits */\n\tstruct group_data groups[MAX_GROUPS];  /* Huffman coding tables */\n};\ntypedef struct bunzip_data bunzip_data;\n\n\n/* Return the next nnn bits of input.  All reads from the compressed input\n   are done through this function.  All reads are big endian */\nstatic unsigned get_bits(bunzip_data *bd, int bits_wanted)\n{\n\tunsigned bits = 0;\n\t/* Cache bd->inbufBitCount in a CPU register (hopefully): */\n\tint bit_count = bd->inbufBitCount;\n\n\t/* If we need to get more data from the byte buffer, do so.  (Loop getting\n\t   one byte at a time to enforce endianness and avoid unaligned access.) */\n\twhile (bit_count < bits_wanted) {\n\n\t\t/* If we need to read more data from file into byte buffer, do so */\n\t\tif (bd->inbufPos == bd->inbufCount) {\n\t\t\t/* if \"no input fd\" case: in_fd == -1, read fails, we jump */\n\t\t\tbd->inbufCount = safe_read(bd->in_fd, bd->inbuf, IOBUF_SIZE);\n\t\t\tif (bd->inbufCount <= 0)\n\t\t\t\tlongjmp(*bd->jmpbuf, RETVAL_UNEXPECTED_INPUT_EOF);\n\t\t\tbd->inbufPos = 0;\n\t\t}\n\n\t\t/* Avoid 32-bit overflow (dump bit buffer to top of output) */\n\t\tif (bit_count >= 24) {\n\t\t\tbits = bd->inbufBits & ((1U << bit_count) - 1);\n\t\t\tbits_wanted -= bit_count;\n\t\t\t// coverity[negative_shift]\n\t\t\tbits <<= bits_wanted;\n\t\t\tbit_count = 0;\n\t\t}\n\n\t\t/* Grab next 8 bits of input from buffer. */\n\t\tbd->inbufBits = (bd->inbufBits << 8) | bd->inbuf[bd->inbufPos++];\n\t\tbit_count += 8;\n\t}\n\n\t/* Calculate result */\n\tbit_count -= bits_wanted;\n\tbd->inbufBitCount = bit_count;\n\tbits |= (bd->inbufBits >> bit_count) & ((1 << bits_wanted) - 1);\n\n\treturn bits;\n}\n//#define get_bits(bd, n) (dbg(\"%d:get_bits()\", __LINE__), get_bits(bd, n))\n\n/* Unpacks the next block and sets up for the inverse Burrows-Wheeler step. */\nstatic int get_next_block(bunzip_data *bd)\n{\n\tint groupCount, selector,\n\t\ti, j, symCount, symTotal, nSelectors, byteCount[256];\n\tuint8_t uc, symToByte[256], mtfSymbol[256], *selectors;\n\tuint32_t *dbuf;\n\tunsigned origPtr, t;\n\tunsigned dbufCount, runPos;\n\tunsigned runCnt = 0; /* for compiler */\n\n\tdbuf = bd->dbuf;\n\tselectors = bd->selectors;\n\n/* In bbox, we are ok with aborting through setjmp which is set up in start_bunzip */\n#if 0\n\t/* Reset longjmp I/O error handling */\n\ti = setjmp(bd->jmpbuf);\n\tif (i) return i;\n#endif\n\n\t/* Read in header signature and CRC, then validate signature.\n\t   (last block signature means CRC is for whole file, return now) */\n\ti = get_bits(bd, 24);\n\tj = get_bits(bd, 24);\n\tbd->headerCRC = get_bits(bd, 32);\n\tif ((i == 0x177245) && (j == 0x385090))\n\t\treturn RETVAL_LAST_BLOCK;\n\tif ((i != 0x314159) || (j != 0x265359))\n\t\treturn RETVAL_NOT_BZIP_DATA;\n\n\t/* We can add support for blockRandomised if anybody complains.  There was\n\t   some code for this in busybox 1.0.0-pre3, but nobody ever noticed that\n\t   it didn't actually work. */\n\tif (get_bits(bd, 1))\n\t\treturn RETVAL_OBSOLETE_INPUT;\n\torigPtr = get_bits(bd, 24);\n\tif (origPtr > bd->dbufSize)\n\t\treturn RETVAL_DATA_ERROR;\n\n\t/* mapping table: if some byte values are never used (encoding things\n\t   like ascii text), the compression code removes the gaps to have fewer\n\t   symbols to deal with, and writes a sparse bitfield indicating which\n\t   values were present.  We make a translation table to convert the symbols\n\t   back to the corresponding bytes. */\n\tsymTotal = 0;\n\ti = 0;\n\tt = get_bits(bd, 16);\n\tdo {\n\t\tif (t & (1 << 15)) {\n\t\t\tunsigned inner_map = get_bits(bd, 16);\n\t\t\tdo {\n\t\t\t\tif (inner_map & (1 << 15))\n\t\t\t\t\tsymToByte[symTotal++] = i;\n\t\t\t\tinner_map <<= 1;\n\t\t\t\ti++;\n\t\t\t} while (i & 15);\n\t\t\ti -= 16;\n\t\t}\n\t\tt <<= 1;\n\t\ti += 16;\n\t} while (i < 256);\n\n\t/* How many different Huffman coding groups does this block use? */\n\tgroupCount = get_bits(bd, 3);\n\tif (groupCount < 2 || groupCount > MAX_GROUPS)\n\t\treturn RETVAL_DATA_ERROR;\n\n\t/* nSelectors: Every GROUP_SIZE many symbols we select a new Huffman coding\n\t   group.  Read in the group selector list, which is stored as MTF encoded\n\t   bit runs.  (MTF=Move To Front, as each value is used it's moved to the\n\t   start of the list.) */\n\tfor (i = 0; i < groupCount; i++)\n\t\tmtfSymbol[i] = i;\n\tnSelectors = get_bits(bd, 15);\n\tif (!nSelectors)\n\t\treturn RETVAL_DATA_ERROR;\n\tfor (i = 0; i < nSelectors; i++) {\n\t\tuint8_t tmp_byte;\n\t\t/* Get next value */\n\t\tint n = 0;\n\t\twhile (get_bits(bd, 1)) {\n\t\t\tn++;\n\t\t\tif (n >= groupCount)\n\t\t\t\treturn RETVAL_DATA_ERROR;\n\t\t}\n\t\t/* Decode MTF to get the next selector */\n\t\ttmp_byte = mtfSymbol[n];\n\t\twhile (--n >= 0)\n\t\t\tmtfSymbol[n + 1] = mtfSymbol[n];\n\t\tmtfSymbol[0] = selectors[i] = tmp_byte;\n\t}\n\n\t/* Read the Huffman coding tables for each group, which code for symTotal\n\t   literal symbols, plus two run symbols (RUNA, RUNB) */\n\tsymCount = symTotal + 2;\n\tfor (j = 0; j < groupCount; j++) {\n\t\tuint8_t length[MAX_SYMBOLS];\n\t\t/* 8 bits is ALMOST enough for temp[], see below */\n\t\tunsigned temp[MAX_HUFCODE_BITS+1];\n\t\tstruct group_data *hufGroup;\n\t\tint *base, *limit;\n\t\tint minLen, maxLen, pp, len_m1;\n\n\t\t/* Read Huffman code lengths for each symbol.  They're stored in\n\t\t   a way similar to mtf; record a starting value for the first symbol,\n\t\t   and an offset from the previous value for every symbol after that.\n\t\t   (Subtracting 1 before the loop and then adding it back at the end is\n\t\t   an optimization that makes the test inside the loop simpler: symbol\n\t\t   length 0 becomes negative, so an unsigned inequality catches it.) */\n\t\tlen_m1 = get_bits(bd, 5) - 1;\n\t\tfor (i = 0; i < symCount; i++) {\n\t\t\tfor (;;) {\n\t\t\t\tint two_bits;\n\t\t\t\tif ((unsigned)len_m1 > (MAX_HUFCODE_BITS-1))\n\t\t\t\t\treturn RETVAL_DATA_ERROR;\n\n\t\t\t\t/* If first bit is 0, stop.  Else second bit indicates whether\n\t\t\t\t   to increment or decrement the value.  Optimization: grab 2\n\t\t\t\t   bits and unget the second if the first was 0. */\n\t\t\t\ttwo_bits = get_bits(bd, 2);\n\t\t\t\tif (two_bits < 2) {\n\t\t\t\t\tbd->inbufBitCount++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t/* Add one if second bit 1, else subtract 1.  Avoids if/else */\n\t\t\t\tlen_m1 += (((two_bits+1) & 2) - 1);\n\t\t\t}\n\n\t\t\t/* Correct for the initial -1, to get the final symbol length */\n\t\t\tlength[i] = len_m1 + 1;\n\t\t}\n\n\t\t/* Find largest and smallest lengths in this group */\n\t\tminLen = maxLen = length[0];\n\t\tfor (i = 1; i < symCount; i++) {\n\t\t\tif (length[i] > maxLen)\n\t\t\t\tmaxLen = length[i];\n\t\t\telse if (length[i] < minLen)\n\t\t\t\tminLen = length[i];\n\t\t}\n\n\t\t/* Calculate permute[], base[], and limit[] tables from length[].\n\t\t *\n\t\t * permute[] is the lookup table for converting Huffman coded symbols\n\t\t * into decoded symbols.  base[] is the amount to subtract from the\n\t\t * value of a Huffman symbol of a given length when using permute[].\n\t\t *\n\t\t * limit[] indicates the largest numerical value a symbol with a given\n\t\t * number of bits can have.  This is how the Huffman codes can vary in\n\t\t * length: each code with a value>limit[length] needs another bit.\n\t\t */\n\t\thufGroup = bd->groups + j;\n\t\thufGroup->minLen = minLen;\n\t\thufGroup->maxLen = maxLen;\n\n\t\t/* Note that minLen can't be smaller than 1, so we adjust the base\n\t\t   and limit array pointers so we're not always wasting the first\n\t\t   entry.  We do this again when using them (during symbol decoding). */\n\t\tbase = hufGroup->base - 1;\n\t\tlimit = hufGroup->limit - 1;\n\n\t\t/* Calculate permute[].  Concurrently, initialize temp[] and limit[]. */\n\t\tpp = 0;\n\t\tfor (i = minLen; i <= maxLen; i++) {\n\t\t\tint k;\n\t\t\ttemp[i] = limit[i] = 0;\n\t\t\tfor (k = 0; k < symCount; k++)\n\t\t\t\tif (length[k] == i)\n\t\t\t\t\thufGroup->permute[pp++] = k;\n\t\t}\n\n\t\t/* Count symbols coded for at each bit length */\n\t\t/* NB: in pathological cases, temp[8] can end ip being 256.\n\t\t * That's why uint8_t is too small for temp[]. */\n\t\tfor (i = 0; i < symCount; i++)\n\t\t\ttemp[length[i]]++;\n\n\t\t/* Calculate limit[] (the largest symbol-coding value at each bit\n\t\t * length, which is (previous limit<<1)+symbols at this level), and\n\t\t * base[] (number of symbols to ignore at each bit length, which is\n\t\t * limit minus the cumulative count of symbols coded for already). */\n\t\tpp = t = 0;\n\t\tfor (i = minLen; i < maxLen;) {\n\t\t\tunsigned temp_i = temp[i];\n\n\t\t\tpp += temp_i;\n\n\t\t\t/* We read the largest possible symbol size and then unget bits\n\t\t\t   after determining how many we need, and those extra bits could\n\t\t\t   be set to anything.  (They're noise from future symbols.)  At\n\t\t\t   each level we're really only interested in the first few bits,\n\t\t\t   so here we set all the trailing to-be-ignored bits to 1 so they\n\t\t\t   don't affect the value>limit[length] comparison. */\n\t\t\tlimit[i] = (pp << (maxLen - i)) - 1;\n\t\t\tpp <<= 1;\n\t\t\tt += temp_i;\n\t\t\tbase[++i] = pp - t;\n\t\t}\n\t\tlimit[maxLen] = pp + temp[maxLen] - 1;\n\t\tlimit[maxLen+1] = INT_MAX; /* Sentinel value for reading next sym. */\n\t\tbase[minLen] = 0;\n\t}\n\n\t/* We've finished reading and digesting the block header.  Now read this\n\t   block's Huffman coded symbols from the file and undo the Huffman coding\n\t   and run length encoding, saving the result into dbuf[dbufCount++] = uc */\n\n\t/* Initialize symbol occurrence counters and symbol Move To Front table */\n\t/*memset(byteCount, 0, sizeof(byteCount)); - smaller, but slower */\n\tfor (i = 0; i < 256; i++) {\n\t\tbyteCount[i] = 0;\n\t\tmtfSymbol[i] = (uint8_t)i;\n\t}\n\n\t/* Loop through compressed symbols. */\n\n\trunPos = dbufCount = selector = 0;\n\tfor (;;) {\n\t\tstruct group_data *hufGroup;\n\t\tint *base, *limit;\n\t\tint nextSym;\n\t\tuint8_t ngrp;\n\n\t\t/* Fetch next Huffman coding group from list. */\n\t\tsymCount = GROUP_SIZE - 1;\n\t\tif (selector >= nSelectors)\n\t\t\treturn RETVAL_DATA_ERROR;\n\t\tngrp = selectors[selector++];\n\t\tif (ngrp >= groupCount) {\n\t\t\tdbg(\"%d selectors[%d]:%d groupCount:%d\",\n\t\t\t\t__LINE__, selector-1, ngrp, groupCount);\n\t\t\treturn RETVAL_DATA_ERROR;\n\t\t}\n\t\thufGroup = bd->groups + ngrp;\n\t\tbase = hufGroup->base - 1;\n\t\tlimit = hufGroup->limit - 1;\n\n continue_this_group:\n\t\t/* Read next Huffman-coded symbol. */\n\n\t\t/* Note: It is far cheaper to read maxLen bits and back up than it is\n\t\t   to read minLen bits and then add additional bit at a time, testing\n\t\t   as we go.  Because there is a trailing last block (with file CRC),\n\t\t   there is no danger of the overread causing an unexpected EOF for a\n\t\t   valid compressed file.\n\t\t */\n\t\tif (1) {\n\t\t\t/* As a further optimization, we do the read inline\n\t\t\t   (falling back to a call to get_bits if the buffer runs dry).\n\t\t\t */\n\t\t\tint new_cnt;\n\t\t\twhile ((new_cnt = bd->inbufBitCount - hufGroup->maxLen) < 0) {\n\t\t\t\t/* bd->inbufBitCount < hufGroup->maxLen */\n\t\t\t\tif (bd->inbufPos == bd->inbufCount) {\n\t\t\t\t\tnextSym = get_bits(bd, hufGroup->maxLen);\n\t\t\t\t\tgoto got_huff_bits;\n\t\t\t\t}\n\t\t\t\tbd->inbufBits = (bd->inbufBits << 8) | bd->inbuf[bd->inbufPos++];\n\t\t\t\tbd->inbufBitCount += 8;\n\t\t\t};\n\t\t\tbd->inbufBitCount = new_cnt; /* \"bd->inbufBitCount -= hufGroup->maxLen;\" */\n\t\t\tnextSym = (bd->inbufBits >> new_cnt) & ((1 << hufGroup->maxLen) - 1);\n got_huff_bits: ;\n\t\t} else { /* unoptimized equivalent */\n\t\t\tnextSym = get_bits(bd, hufGroup->maxLen);\n\t\t}\n\t\t/* Figure how many bits are in next symbol and unget extras */\n\t\ti = hufGroup->minLen;\n\t\twhile (nextSym > limit[i])\n\t\t\t++i;\n\t\tj = hufGroup->maxLen - i;\n\t\tif (j < 0)\n\t\t\treturn RETVAL_DATA_ERROR;\n\t\tbd->inbufBitCount += j;\n\n\t\t/* Huffman decode value to get nextSym (with bounds checking) */\n\t\tnextSym = (nextSym >> j) - base[i];\n\t\tif ((unsigned)nextSym >= MAX_SYMBOLS)\n\t\t\treturn RETVAL_DATA_ERROR;\n\t\tnextSym = hufGroup->permute[nextSym];\n\n\t\t/* We have now decoded the symbol, which indicates either a new literal\n\t\t   byte, or a repeated run of the most recent literal byte.  First,\n\t\t   check if nextSym indicates a repeated run, and if so loop collecting\n\t\t   how many times to repeat the last literal. */\n\t\tif ((unsigned)nextSym <= SYMBOL_RUNB) { /* RUNA or RUNB */\n\n\t\t\t/* If this is the start of a new run, zero out counter */\n\t\t\tif (runPos == 0) {\n\t\t\t\trunPos = 1;\n\t\t\t\trunCnt = 0;\n\t\t\t}\n\n\t\t\t/* Neat trick that saves 1 symbol: instead of or-ing 0 or 1 at\n\t\t\t   each bit position, add 1 or 2 instead.  For example,\n\t\t\t   1011 is 1<<0 + 1<<1 + 2<<2.  1010 is 2<<0 + 2<<1 + 1<<2.\n\t\t\t   You can make any bit pattern that way using 1 less symbol than\n\t\t\t   the basic or 0/1 method (except all bits 0, which would use no\n\t\t\t   symbols, but a run of length 0 doesn't mean anything in this\n\t\t\t   context).  Thus space is saved. */\n\t\t\trunCnt += (runPos << nextSym); /* +runPos if RUNA; +2*runPos if RUNB */\n\t\t\tif (runPos < bd->dbufSize) runPos <<= 1;\n\t\t\tgoto end_of_huffman_loop;\n\t\t}\n\n\t\t/* When we hit the first non-run symbol after a run, we now know\n\t\t   how many times to repeat the last literal, so append that many\n\t\t   copies to our buffer of decoded symbols (dbuf) now.  (The last\n\t\t   literal used is the one at the head of the mtfSymbol array.) */\n\t\tif (runPos != 0) {\n\t\t\tuint8_t tmp_byte;\n\t\t\tif (dbufCount + runCnt > bd->dbufSize) {\n\t\t\t\tdbg(\"dbufCount:%u+runCnt:%u %u > dbufSize:%u RETVAL_DATA_ERROR\",\n\t\t\t\t\t\tdbufCount, runCnt, dbufCount + runCnt, bd->dbufSize);\n\t\t\t\treturn RETVAL_DATA_ERROR;\n\t\t\t}\n\t\t\ttmp_byte = symToByte[mtfSymbol[0]];\n\t\t\tbyteCount[tmp_byte] += runCnt;\n\t\t\twhile ((int)--runCnt >= 0)\n\t\t\t\tdbuf[dbufCount++] = (uint32_t)tmp_byte;\n\t\t\trunPos = 0;\n\t\t}\n\n\t\t/* Is this the terminating symbol? */\n\t\tif (nextSym > symTotal) break;\n\n\t\t/* At this point, nextSym indicates a new literal character.  Subtract\n\t\t   one to get the position in the MTF array at which this literal is\n\t\t   currently to be found.  (Note that the result can't be -1 or 0,\n\t\t   because 0 and 1 are RUNA and RUNB.  But another instance of the\n\t\t   first symbol in the mtf array, position 0, would have been handled\n\t\t   as part of a run above.  Therefore 1 unused mtf position minus\n\t\t   2 non-literal nextSym values equals -1.) */\n\t\tif (dbufCount >= bd->dbufSize) return RETVAL_DATA_ERROR;\n\t\ti = nextSym - 1;\n\t\tuc = mtfSymbol[i];\n\n\t\t/* Adjust the MTF array.  Since we typically expect to move only a\n\t\t * small number of symbols, and are bound by 256 in any case, using\n\t\t * memmove here would typically be bigger and slower due to function\n\t\t * call overhead and other assorted setup costs. */\n\t\tdo {\n\t\t\tmtfSymbol[i] = mtfSymbol[i-1];\n\t\t} while (--i);\n\t\tmtfSymbol[0] = uc;\n\t\tuc = symToByte[uc];\n\n\t\t/* We have our literal byte.  Save it into dbuf. */\n\t\tbyteCount[uc]++;\n\t\tdbuf[dbufCount++] = (uint32_t)uc;\n\n\t\t/* Skip group initialization if we're not done with this group.  Done\n\t\t * this way to avoid compiler warning. */\n end_of_huffman_loop:\n\t\tif (--symCount >= 0) goto continue_this_group;\n\t}\n\n\t/* At this point, we've read all the Huffman-coded symbols (and repeated\n\t   runs) for this block from the input stream, and decoded them into the\n\t   intermediate buffer.  There are dbufCount many decoded bytes in dbuf[].\n\t   Now undo the Burrows-Wheeler transform on dbuf.\n\t   See http://dogma.net/markn/articles/bwt/bwt.htm\n\t */\n\n\t/* Turn byteCount into cumulative occurrence counts of 0 to n-1. */\n\tj = 0;\n\tfor (i = 0; i < 256; i++) {\n\t\tint tmp_count = j + byteCount[i];\n\t\tbyteCount[i] = j;\n\t\tj = tmp_count;\n\t}\n\n\t/* Figure out what order dbuf would be in if we sorted it. */\n\tfor (i = 0; i < (int)dbufCount; i++) {\n\t\tuint8_t tmp_byte = (uint8_t)dbuf[i];\n\t\tint tmp_count = byteCount[tmp_byte];\n\t\tdbuf[tmp_count] |= (i << 8);\n\t\tbyteCount[tmp_byte] = tmp_count + 1;\n\t}\n\n\t/* Decode first byte by hand to initialize \"previous\" byte.  Note that it\n\t   doesn't get output, and if the first three characters are identical\n\t   it doesn't qualify as a run (hence writeRunCountdown=5). */\n\tif (dbufCount) {\n\t\tuint32_t tmp;\n\t\tif ((int)origPtr >= dbufCount) return RETVAL_DATA_ERROR;\n\t\ttmp = dbuf[origPtr];\n\t\tbd->writeCurrent = (uint8_t)tmp;\n\t\tbd->writePos = (tmp >> 8);\n\t\tbd->writeRunCountdown = 5;\n\t}\n\tbd->writeCount = dbufCount;\n\n\treturn RETVAL_OK;\n}\n\n/* Undo Burrows-Wheeler transform on intermediate buffer to produce output.\n   If start_bunzip was initialized with out_fd=-1, then up to len bytes of\n   data are written to outbuf.  Return value is number of bytes written or\n   error (all errors are negative numbers).  If out_fd!=-1, outbuf and len\n   are ignored, data is written to out_fd and return is RETVAL_OK or error.\n\n   NB: read_bunzip returns < 0 on error, or the number of *unfilled* bytes\n   in outbuf. IOW: on EOF returns len (\"all bytes are not filled\"), not 0.\n   (Why? This allows to get rid of one local variable)\n*/\nstatic int read_bunzip(bunzip_data *bd, char *outbuf, int len)\n{\n\tconst uint32_t *dbuf;\n\tint pos, current, previous;\n\tuint32_t CRC;\n\n\t/* If we already have error/end indicator, return it */\n\tif (bd->writeCount < 0)\n\t\treturn bd->writeCount;\n\n\tdbuf = bd->dbuf;\n\n\t/* Register-cached state (hopefully): */\n\tpos = bd->writePos;\n\tcurrent = bd->writeCurrent;\n\tCRC = bd->writeCRC; /* small loss on x86-32 (not enough regs), win on x86-64 */\n\n\t/* We will always have pending decoded data to write into the output\n\t   buffer unless this is the very first call (in which case we haven't\n\t   Huffman-decoded a block into the intermediate buffer yet). */\n\tif (bd->writeCopies) {\n\n dec_writeCopies:\n\t\t/* Inside the loop, writeCopies means extra copies (beyond 1) */\n\t\t--bd->writeCopies;\n\n\t\t/* Loop outputting bytes */\n\t\tfor (;;) {\n\n\t\t\t/* If the output buffer is full, save cached state and return */\n\t\t\tif (--len < 0) {\n\t\t\t\t/* Unlikely branch.\n\t\t\t\t * Use of \"goto\" instead of keeping code here\n\t\t\t\t * helps compiler to realize this. */\n\t\t\t\tgoto outbuf_full;\n\t\t\t}\n\n\t\t\t/* Write next byte into output buffer, updating CRC */\n\t\t\t*outbuf++ = current;\n\t\t\tCRC = (CRC << 8) ^ bd->crc32Table[(CRC >> 24) ^ current];\n\n\t\t\t/* Loop now if we're outputting multiple copies of this byte */\n\t\t\tif (bd->writeCopies) {\n\t\t\t\t/* Unlikely branch */\n\t\t\t\t/*--bd->writeCopies;*/\n\t\t\t\t/*continue;*/\n\t\t\t\t/* Same, but (ab)using other existing --writeCopies operation\n\t\t\t\t * (and this if() compiles into just test+branch pair): */\n\t\t\t\tgoto dec_writeCopies;\n\t\t\t}\n decode_next_byte:\n\t\t\tif (--bd->writeCount < 0)\n\t\t\t\tbreak; /* input block is fully consumed, need next one */\n\n\t\t\t/* Follow sequence vector to undo Burrows-Wheeler transform */\n\t\t\tprevious = current;\n\t\t\tpos = dbuf[pos];\n\t\t\tcurrent = (uint8_t)pos;\n\t\t\tpos >>= 8;\n\n\t\t\t/* After 3 consecutive copies of the same byte, the 4th\n\t\t\t * is a repeat count.  We count down from 4 instead\n\t\t\t * of counting up because testing for non-zero is faster */\n\t\t\tif (--bd->writeRunCountdown != 0) {\n\t\t\t\tif (current != previous)\n\t\t\t\t\tbd->writeRunCountdown = 4;\n\t\t\t} else {\n\t\t\t\t/* Unlikely branch */\n\t\t\t\t/* We have a repeated run, this byte indicates the count */\n\t\t\t\tbd->writeCopies = current;\n\t\t\t\tcurrent = previous;\n\t\t\t\tbd->writeRunCountdown = 5;\n\n\t\t\t\t/* Sometimes there are just 3 bytes (run length 0) */\n\t\t\t\tif (!bd->writeCopies) goto decode_next_byte;\n\n\t\t\t\t/* Subtract the 1 copy we'd output anyway to get extras */\n\t\t\t\t--bd->writeCopies;\n\t\t\t}\n\t\t} /* for (;;) */\n\n\t\t/* Decompression of this input block completed successfully */\n\t\tbd->writeCRC = CRC = ~CRC;\n\t\tbd->totalCRC = ((bd->totalCRC << 1) | (bd->totalCRC >> 31)) ^ CRC;\n\n\t\t/* If this block had a CRC error, force file level CRC error */\n\t\tif (CRC != bd->headerCRC) {\n\t\t\tbd->totalCRC = bd->headerCRC + 1;\n\t\t\treturn RETVAL_LAST_BLOCK;\n\t\t}\n\t}\n\n\t/* Refill the intermediate buffer by Huffman-decoding next block of input */\n\t{\n\t\tint r = get_next_block(bd);\n\t\tif (r) { /* error/end */\n\t\t\tbd->writeCount = r;\n\t\t\treturn (r != RETVAL_LAST_BLOCK) ? r : len;\n\t\t}\n\t}\n\n\tCRC = ~0;\n\tpos = bd->writePos;\n\tcurrent = bd->writeCurrent;\n\tgoto decode_next_byte;\n\n outbuf_full:\n\t/* Output buffer is full, save cached state and return */\n\tbd->writePos = pos;\n\tbd->writeCurrent = current;\n\tbd->writeCRC = CRC;\n\n\tbd->writeCopies++;\n\n\treturn 0;\n}\n\n/* Allocate the structure, read file header.  If in_fd==-1, inbuf must contain\n   a complete bunzip file (len bytes long).  If in_fd!=-1, inbuf and len are\n   ignored, and data is read from file handle into temporary buffer. */\n\n/* Because bunzip2 is used for help text unpacking, and because bb_show_usage()\n   should work for NOFORK applets too, we must be extremely careful to not leak\n   any allocations! */\nstatic int FAST_FUNC start_bunzip(\n\t\tvoid *jmpbuf,\n\t\tbunzip_data **bdp,\n\t\tint in_fd,\n\t\tconst void *inbuf, int len)\n{\n\tbunzip_data *bd;\n\tunsigned i;\n\tenum {\n\t\tBZh0 = ('B' << 24) + ('Z' << 16) + ('h' << 8) + '0',\n\t\th0 = ('h' << 8) + '0',\n\t};\n\n\t/* Figure out how much data to allocate */\n\ti = sizeof(bunzip_data);\n\tif (in_fd != -1)\n\t\ti += IOBUF_SIZE;\n\n\t/* Allocate bunzip_data.  Most fields initialize to zero. */\n\tbd = *bdp = xzalloc(i);\n\tif (bd == NULL)\n\t\treturn -1;\n\n\tbd->jmpbuf = jmpbuf;\n\n\t/* Setup input buffer */\n\tbd->in_fd = in_fd;\n\tif (-1 == in_fd) {\n\t\t/* in this case, bd->inbuf is read-only */\n\t\tbd->inbuf = (void*)inbuf; /* cast away const-ness */\n\t} else {\n\t\tbd->inbuf = (uint8_t*)(bd + 1);\n\t\tmemcpy(bd->inbuf, inbuf, len);\n\t}\n\tbd->inbufCount = len;\n\n\t/* Init the CRC32 table (big endian) */\n\tcrc32_filltable(bd->crc32Table, 1);\n\n\t/* Ensure that file starts with \"BZh['1'-'9'].\" */\n\t/* Update: now caller verifies 1st two bytes, makes .gz/.bz2\n\t * integration easier */\n\t/* was: */\n\t/* i = get_bits(bd, 32); */\n\t/* if ((unsigned)(i - BZh0 - 1) >= 9) return RETVAL_NOT_BZIP_DATA; */\n\ti = get_bits(bd, 16);\n\tif ((unsigned)(i - h0 - 1) >= 9) return RETVAL_NOT_BZIP_DATA;\n\n\t/* Fourth byte (ascii '1'-'9') indicates block size in units of 100k of\n\t   uncompressed data.  Allocate intermediate buffer for block. */\n\t/* bd->dbufSize = 100000 * (i - BZh0); */\n\tbd->dbufSize = 100000 * (i - h0);\n\n\t/* Cannot use xmalloc - may leak bd in NOFORK case! */\n\tbd->dbuf = malloc_or_warn(bd->dbufSize * sizeof(bd->dbuf[0]));\n\tif (!bd->dbuf) {\n\t\tfree(bd);\n\t\txfunc_die();\n\t}\n\treturn RETVAL_OK;\n}\n\nstatic void FAST_FUNC dealloc_bunzip(bunzip_data *bd)\n{\n\tfree(bd->dbuf);\n\tfree(bd);\n}\n\n\n/* Decompress src_fd to dst_fd.  Stops at end of bzip data, not end of file. */\nIF_DESKTOP(long long) int FAST_FUNC\nunpack_bz2_stream(transformer_state_t *xstate)\n{\n\tIF_DESKTOP(long long total_written = 0;)\n\tbunzip_data *bd;\n\tchar *outbuf;\n\tint i, nwrote;\n\tunsigned len;\n\n\tif (check_signature16(xstate, BZIP2_MAGIC))\n\t\treturn -1;\n\n\toutbuf = xmalloc(IOBUF_SIZE);\n\tif (outbuf == NULL)\n\t\treturn -1;\n\tlen = 0;\n\twhile (1) { /* \"Process one BZ... stream\" loop */\n\t\tjmp_buf jmpbuf;\n\n\t\t/* Setup for I/O error handling via longjmp */\n\t\ti = setjmp(jmpbuf);\n\t\tif (i == 0)\n\t\t\ti = start_bunzip(&jmpbuf, &bd, xstate->src_fd, outbuf + 2, len);\n\n\t\tif (i == 0) {\n\t\t\twhile (1) { /* \"Produce some output bytes\" loop */\n\t\t\t\ti = read_bunzip(bd, outbuf, IOBUF_SIZE);\n\t\t\t\tif (i < 0) /* error? */\n\t\t\t\t\tbreak;\n\t\t\t\ti = IOBUF_SIZE - i; /* number of bytes produced */\n\t\t\t\tif (i == 0) /* EOF? */\n\t\t\t\t\tbreak;\n\t\t\t\tnwrote = (int)transformer_write(xstate, outbuf, i);\n\t\t\t\tif (nwrote != i) {\n\t\t\t\t\ti = (nwrote == -ENOSPC)?(int)xstate->mem_output_size_max:RETVAL_SHORT_WRITE;\n\t\t\t\t\tgoto release_mem;\n\t\t\t\t}\n\t\t\t\tIF_DESKTOP(total_written += i;)\n\t\t\t}\n\t\t}\n\n\t\tif (i != RETVAL_LAST_BLOCK\n\t\t/* Observed case when i == RETVAL_OK:\n\t\t * \"bzcat z.bz2\", where \"z.bz2\" is a bzipped zero-length file\n\t\t * (to be exact, z.bz2 is exactly these 14 bytes:\n\t\t * 42 5a 68 39 17 72 45 38 50 90 00 00 00 00).\n\t\t */\n\t\t && i != RETVAL_OK\n\t\t) {\n\t\t\tbb_error_msg(\"bunzip error %d\", i);\n\t\t\tbreak;\n\t\t}\n\t\tif (bd->headerCRC != bd->totalCRC) {\n\t\t\tbb_simple_error_msg(\"CRC error\");\n\t\t\tbreak;\n\t\t}\n\n\t\t/* Successfully unpacked one BZ stream */\n\t\ti = RETVAL_OK;\n\n\t\t/* Do we have \"BZ...\" after last processed byte?\n\t\t * pbzip2 (parallelized bzip2) produces such files.\n\t\t */\n\t\tlen = bd->inbufCount - bd->inbufPos;\n\t\tmemcpy(outbuf, &bd->inbuf[bd->inbufPos], len);\n\t\tif (len < 2) {\n\t\t\tif (safe_read(xstate->src_fd, outbuf + len, 2 - len) != 2 - len)\n\t\t\t\tbreak;\n\t\t\tlen = 2;\n\t\t}\n\t\tif (*(uint16_t*)outbuf != BZIP2_MAGIC) /* \"BZ\"? */\n\t\t\tbreak;\n\t\tdealloc_bunzip(bd);\n\t\tlen -= 2;\n\t}\n\n release_mem:\n\tdealloc_bunzip(bd);\n\tfree(outbuf);\n\n\treturn i ? i : IF_DESKTOP(total_written) + 0;\n}\n\nchar* FAST_FUNC\nunpack_bz2_data(const char *packed, int packed_len, int unpacked_len)\n{\n\tchar *outbuf = NULL;\n\tbunzip_data *bd = NULL;\n\tint i;\n\tjmp_buf jmpbuf;\n\n\t/* Setup for I/O error handling via longjmp */\n\ti = setjmp(jmpbuf);\n\tif (i == 0) {\n\t\ti = start_bunzip(&jmpbuf,\n\t\t\t&bd,\n\t\t\t/* src_fd: */ -1,\n\t\t\t/* inbuf:  */ packed,\n\t\t\t/* len:    */ packed_len\n\t\t);\n\t}\n\t/* read_bunzip can longjmp and end up here with i != 0\n\t * on read data errors! Not trivial */\n\tif (i == 0) {\n\t\t/* Cannot use xmalloc: will leak bd in NOFORK case! */\n\t\toutbuf = malloc_or_warn(unpacked_len);\n\t\tif (outbuf)\n\t\t\tread_bunzip(bd, outbuf, unpacked_len);\n\t}\n\tdealloc_bunzip(bd);\n\treturn outbuf;\n}\n\n#ifdef TESTING\n\nstatic char *const bunzip_errors[] = {\n\tNULL, \"Bad file checksum\", \"Not bzip data\",\n\t\"Unexpected input EOF\", \"Unexpected output EOF\", \"Data error\",\n\t\"Out of memory\", \"Obsolete (pre 0.9.5) bzip format not supported\"\n};\n\n/* Dumb little test thing, decompress stdin to stdout */\nint main(int argc, char **argv)\n{\n\tchar c;\n\n\tint i = unpack_bz2_stream(0, 1);\n\tif (i < 0)\n\t\tfprintf(stderr, \"%s\\n\", bunzip_errors[-i]);\n\telse if (read(STDIN_FILENO, &c, 1))\n\t\tfprintf(stderr, \"Trailing garbage ignored\\n\");\n\treturn -i;\n}\n#endif\n"
  },
  {
    "path": "src/bled/decompress_gunzip.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * gunzip implementation for busybox\n *\n * Based on GNU gzip v1.2.4 Copyright (C) 1992-1993 Jean-loup Gailly.\n *\n * Originally adjusted for busybox by Sven Rudolph <sr1@inf.tu-dresden.de>\n * based on gzip sources\n *\n * Adjusted further by Erik Andersen <andersen@codepoet.org> to support\n * files as well as stdin/stdout, and to generally behave itself wrt\n * command line handling.\n *\n * General cleanup to better adhere to the style guide and make use of standard\n * busybox functions by Glenn McGrath\n *\n * read_gz interface + associated hacking by Laurence Anderson\n *\n * Fixed huft_build() so decoding end-of-block code does not grab more bits\n * than necessary (this is required by unzip applet), added inflate_cleanup()\n * to free leaked bytebuffer memory (used in unzip.c), and some minor style\n * guide cleanups by Ed Clark\n *\n * gzip (GNU zip) -- compress files with zip algorithm and 'compress' interface\n * Copyright (C) 1992-1993 Jean-loup Gailly\n * The unzip code was written and put in the public domain by Mark Adler.\n * Portions of the lzw code are derived from the public domain 'compress'\n * written by Spencer Thomas, Joe Orost, James Woods, Jim McKie, Steve Davies,\n * Ken Turkowski, Dave Mack and Peter Jannesen.\n *\n * See the file algorithm.doc for the compression algorithms and file formats.\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\ntypedef struct huft_t {\n\tunsigned char e;\t/* number of extra bits or operation */\n\tunsigned char b;\t/* number of bits in this code or subcode */\n\tunion {\n\t\tunsigned n;\t/* literal, length base, or distance base */\n\t\t/* ^^^^^ was \"unsigned short\", but that results in larger code */\n\t\tstruct huft_t *t;\t/* pointer to next level of table */\n\t} v;\n} huft_t;\n\n/* gunzip_window size--must be a power of two, and\n * at least 32K for zip's deflate method */\n#define GUNZIP_WSIZE BB_BUFSIZE\n\nenum {\n\t/* If BMAX needs to be larger than 16, then h and x[] should be ulg. */\n\tBMAX = 16,\t/* maximum bit length of any code (16 for explode) */\n\tN_MAX = 288,\t/* maximum number of codes in any set */\n};\n\n\n/* This is somewhat complex-looking arrangement, but it allows\n * to place decompressor state either in bss or in\n * malloc'ed space simply by changing #defines below.\n * Sizes on i386:\n * text    data     bss     dec     hex\n * 5256       0     108    5364    14f4 - bss\n * 4915       0       0    4915    1333 - malloc\n */\n#define STATE_IN_BSS 0\n#define STATE_IN_MALLOC 1\n\n\ntypedef struct state_t {\n\toff_t gunzip_bytes_out; /* number of output bytes */\n\tuint32_t gunzip_crc;\n\n\tint gunzip_src_fd;\n\tunsigned gunzip_outbuf_count; /* bytes in output buffer */\n\n\tunsigned char *gunzip_window;\n\n\tuint32_t *gunzip_crc_table;\n\n\t/* bitbuffer */\n\tunsigned gunzip_bb; /* bit buffer */\n\tunsigned char gunzip_bk; /* bits in bit buffer */\n\n\t/* input (compressed) data */\n\tunsigned char *bytebuffer;      /* buffer itself */\n\toff_t to_read;\t\t\t/* compressed bytes to read (unzip only, -1 for gunzip) */\n//\tunsigned bytebuffer_max;        /* buffer size */\n\tunsigned bytebuffer_offset;     /* buffer position */\n\tunsigned bytebuffer_size;       /* how much data is there (size <= max) */\n\n\t/* private data of inflate_codes() */\n\tunsigned inflate_codes_ml; /* masks for bl and bd bits */\n\tunsigned inflate_codes_md; /* masks for bl and bd bits */\n\tunsigned inflate_codes_bb; /* bit buffer */\n\tunsigned inflate_codes_k; /* number of bits in bit buffer */\n\tunsigned inflate_codes_w; /* current gunzip_window position */\n\thuft_t *inflate_codes_tl;\n\thuft_t *inflate_codes_td;\n\tunsigned inflate_codes_bl;\n\tunsigned inflate_codes_bd;\n\tunsigned inflate_codes_nn; /* length and index for copy */\n\tunsigned inflate_codes_dd;\n\n\tsmallint resume_copy;\n\n\t/* private data of inflate_get_next_window() */\n\tsmallint method; /* method == -1 for stored, -2 for codes */\n\tsmallint need_another_block;\n\tsmallint end_reached;\n\n\t/* private data of inflate_stored() */\n\tunsigned inflate_stored_n;\n\tunsigned inflate_stored_b;\n\tunsigned inflate_stored_k;\n\tunsigned inflate_stored_w;\n\n\tconst char *error_msg;\n\tjmp_buf error_jmp;\n} state_t;\n#define gunzip_bytes_out    (S()gunzip_bytes_out   )\n#define gunzip_crc          (S()gunzip_crc         )\n#define gunzip_src_fd       (S()gunzip_src_fd      )\n#define gunzip_outbuf_count (S()gunzip_outbuf_count)\n#define gunzip_window       (S()gunzip_window      )\n#define gunzip_crc_table    (S()gunzip_crc_table   )\n#define gunzip_bb           (S()gunzip_bb          )\n#define gunzip_bk           (S()gunzip_bk          )\n#define to_read             (S()to_read            )\n// #define bytebuffer_max   (S()bytebuffer_max     )\n// Both gunzip and unzip can use constant buffer size now (16k):\n#define bytebuffer_max      BB_BUFSIZE\n#define bytebuffer          (S()bytebuffer         )\n#define bytebuffer_offset   (S()bytebuffer_offset  )\n#define bytebuffer_size     (S()bytebuffer_size    )\n#define inflate_codes_ml    (S()inflate_codes_ml   )\n#define inflate_codes_md    (S()inflate_codes_md   )\n#define inflate_codes_bb    (S()inflate_codes_bb   )\n#define inflate_codes_k     (S()inflate_codes_k    )\n#define inflate_codes_w     (S()inflate_codes_w    )\n#define inflate_codes_tl    (S()inflate_codes_tl   )\n#define inflate_codes_td    (S()inflate_codes_td   )\n#define inflate_codes_bl    (S()inflate_codes_bl   )\n#define inflate_codes_bd    (S()inflate_codes_bd   )\n#define inflate_codes_nn    (S()inflate_codes_nn   )\n#define inflate_codes_dd    (S()inflate_codes_dd   )\n#define resume_copy         (S()resume_copy        )\n#define method              (S()method             )\n#define need_another_block  (S()need_another_block )\n#define end_reached         (S()end_reached        )\n#define inflate_stored_n    (S()inflate_stored_n   )\n#define inflate_stored_b    (S()inflate_stored_b   )\n#define inflate_stored_k    (S()inflate_stored_k   )\n#define inflate_stored_w    (S()inflate_stored_w   )\n#define error_msg           (S()error_msg          )\n#define error_jmp           (S()error_jmp          )\n\n/* This is a generic part */\n#if STATE_IN_BSS /* Use global data segment */\n#define DECLARE_STATE /*nothing*/\n#define ALLOC_STATE /*nothing*/\n#define DEALLOC_STATE ((void)0)\n#define S() state.\n#define PASS_STATE /*nothing*/\n#define PASS_STATE_ONLY /*nothing*/\n#define STATE_PARAM /*nothing*/\n#define STATE_PARAM_ONLY void\nstatic state_t state;\n#endif\n\n#if STATE_IN_MALLOC /* Use malloc space */\n#define DECLARE_STATE state_t *state\n#define ALLOC_STATE (state = xzalloc(sizeof(*state)))\n#define DEALLOC_STATE free(state)\n#define S() state->\n#define PASS_STATE state,\n#define PASS_STATE_ONLY state\n#define STATE_PARAM state_t *state,\n#define STATE_PARAM_ONLY state_t *state\n#endif\n\n\nstatic const uint16_t mask_bits[] ALIGN2 = {\n\t0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,\n\t0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff\n};\n\n/* Put lengths/offsets and extra bits in a struct of arrays\n * to make calls to huft_build() have one fewer parameter.\n */\nstruct cp_ext {\n\tuint16_t cp[31];\n\tuint8_t ext[31];\n};\n/* Copy lengths and extra bits for literal codes 257..285 */\n/* note: see note #13 above about the 258 in this list. */\nstatic const struct cp_ext lit ALIGN2 = {\n\t/*257 258 259 260 261 262 263 264 265 266 267 268 269 270 271  272  273  274  275  276   277   278   279   280   281   282   283    284    285 */\n\t/*0   1   2   3   4   5   6   7   8   9   10  11  12  13   14   15   16   17   18   19    20    21    22    23    24    25    26     27     28     29  30 */\n\t{ 3,  4,  5,  6,  7,  8,  9,  10, 11, 13, 15, 17, 19, 23,  27,  31,  35,  43,  51,  59,   67,   83,   99,  115,  131,  163,  195,   227,   258,     0, 0  },\n\t{ 0,  0,  0,  0,  0,  0,  0,   0,  1,  1,  1,  1,  2,  2,   2,   2,   3,   3,   3,   3,    4,    4,    4,    4,    5,    5,    5,     5,     0,    99, 99 } /* 99 == invalid */\n};\n/* Copy offsets and extra bits for distance codes 0..29 */\nstatic const struct cp_ext dist ALIGN2 = {\n\t/*0   1   2   3   4   5   6   7   8   9   10  11  12  13   14   15   16   17   18   19    20    21    22    23    24    25    26     27     28     29 */\n\t{ 1,  2,  3,  4,  5,  7,  9,  13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 },\n\t{ 0,  0,  0,  0,  1,  1,  2,   2,  3,  3,  4,  4,  5,  5,   6,   6,   7,   7,   8,   8,    9,    9,   10,   10,   11,   11,   12,    12,    13,    13 }\n};\n\n/* Tables for deflate from PKZIP's appnote.txt. */\n/* Order of the bit length code lengths */\nstatic const uint8_t border[] ALIGN1 = {\n\t16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15\n};\n\n\n/*\n * Free the malloc'ed tables built by huft_build(), which makes a linked\n * list of the tables it made, with the links in a dummy first entry of\n * each table.\n * t: table to free\n */\n#define BAD_HUFT(p) ((uintptr_t)(p) & 1)\n#define ERR_RET     ((huft_t*)(uintptr_t)1)\nstatic void huft_free(huft_t *p)\n{\n\thuft_t *q;\n\n\t/*\n\t * If 'p' has the error bit set we have to clear it, otherwise we might run\n\t * into a segmentation fault or an invalid pointer to free(p)\n\t */\n\t//if (BAD_HUFT(p)) // commented out, since bit clearing has effect only if condition is true\n\t\tp = (huft_t*)((uintptr_t)p & ~(uintptr_t)ERR_RET);\n\n\t/* Go through linked list, freeing from the malloced (t[-1]) address. */\n\twhile (p) {\n\t\tq = (--p)->v.t;\n\t\tfree(p);\n\t\tp = q;\n\t}\n}\n\nstatic void huft_free_all(STATE_PARAM_ONLY)\n{\n\thuft_free(inflate_codes_tl);\n\thuft_free(inflate_codes_td);\n\tinflate_codes_tl = NULL;\n\tinflate_codes_td = NULL;\n}\n\nstatic void abort_unzip(STATE_PARAM_ONLY) NORETURN;\nstatic void abort_unzip(STATE_PARAM_ONLY)\n{\n\thuft_free_all(PASS_STATE_ONLY);\n\tlongjmp(error_jmp, 1);\n}\n\nstatic unsigned fill_bitbuffer(STATE_PARAM unsigned bitbuffer, unsigned *current, const unsigned required)\n{\n\twhile (*current < required) {\n\t\tif (bytebuffer_offset >= bytebuffer_size) {\n\t\t\tunsigned sz = bytebuffer_max - 4;\n\t\t\tif (to_read >= 0 && to_read < sz) /* unzip only */\n\t\t\t\tsz = (unsigned)to_read;\n\t\t\t/* Leave the first 4 bytes empty so we can always unwind the bitbuffer\n\t\t\t * to the front of the bytebuffer */\n\t\t\tbytebuffer_size = safe_read(gunzip_src_fd, &bytebuffer[4], sz);\n\t\t\tif ((int)bytebuffer_size < 1) {\n\t\t\t\terror_msg = \"unexpected end of file\";\n\t\t\t\tabort_unzip(PASS_STATE_ONLY);\n\t\t\t}\n\t\t\tif (to_read >= 0) /* unzip only */\n\t\t\t\tto_read -= bytebuffer_size;\n\t\t\tbytebuffer_size += 4;\n\t\t\tbytebuffer_offset = 4;\n\t\t}\n\t\tbitbuffer |= ((unsigned) bytebuffer[bytebuffer_offset]) << *current;\n\t\tbytebuffer_offset++;\n\t\t*current += 8;\n\t}\n\t// coverity[return_overflow]\n\treturn bitbuffer;\n}\n\n\n/* Given a list of code lengths and a maximum table size, make a set of\n * tables to decode that set of codes.\n *\n * b:\tcode lengths in bits (all assumed <= BMAX)\n * n:\tnumber of codes (assumed <= N_MAX)\n * s:\tnumber of simple-valued codes (0..s-1)\n * cp_ext->cp,ext: list of base values/extra bits for non-simple codes\n * m:\tmaximum lookup bits, returns actual\n * result: starting table\n *\n * On error, returns a value with lowest-bit set on error.\n * It can be just the value of 0x1,\n * or a valid pointer to a Huffman table, ORed with 0x1 if incompete table\n * is given: \"fixed inflate\" decoder feeds us such data.\n */\nstatic huft_t* huft_build(const unsigned *b, const unsigned n,\n\t\t\tconst unsigned s, const struct cp_ext *cp_ext,\n\t\t\tunsigned *m)\n{\n\tunsigned a;             /* counter for codes of length k */\n\tunsigned c[BMAX + 1];   /* bit length count table */\n\tunsigned eob_len;       /* length of end-of-block code (value 256) */\n\tunsigned f;             /* i repeats in table every f entries */\n\tint g;                  /* maximum code length */\n\tint htl;                /* table level */\n\tunsigned i;             /* counter, current code */\n\tunsigned j;             /* counter */\n\tint k;                  /* number of bits in current code */\n\tconst unsigned *p;      /* pointer into c[], b[], or v[] */\n\thuft_t *q;              /* points to current table */\n\thuft_t r;               /* table entry for structure assignment */\n\thuft_t *u[BMAX];        /* table stack */\n\tunsigned v[N_MAX + 1];  /* values in order of bit length. last v[] is never used */\n\tint ws[BMAX + 1];       /* bits decoded stack */\n\tint w;                  /* bits decoded */\n\tunsigned x[BMAX + 1];   /* bit offsets, then code stack */\n\tunsigned *xp;           /* pointer into x */\n\tint y;                  /* number of dummy codes added */\n\tunsigned z;             /* number of entries in current table */\n\thuft_t *result;\n\thuft_t **t;\n\n\t/* Length of EOB code, if any */\n\teob_len = n > 256 ? b[256] : BMAX;\n\n\tmemset(&r, 0, sizeof(r));\n\n\t/* Generate counts for each bit length */\n\tmemset(c, 0, sizeof(c));\n\tp = b;\n\ti = n;\n\tdo {\n\t\tc[*p]++; /* assume all entries <= BMAX */\n\t\tp++;     /* can't combine with above line (Solaris bug) */\n\t} while (--i);\n\tif (c[0] == n) {  /* null input - all zero length codes */\n\t\tq = xzalloc(3 * sizeof(*q));\n\t\t//q[0].v.t = NULL;\n\t\tq[1].e = 99;    /* invalid code marker */\n\t\tq[1].b = 1;\n\t\tq[2].e = 99;    /* invalid code marker */\n\t\tq[2].b = 1;\n\t\t*m = 1;\n\t\treturn q + 1;\n\t}\n\n\t/* Find minimum and maximum length, bound *m by those */\n\tfor (j = 1; (j <= BMAX) && (c[j] == 0); j++)\n\t\tcontinue;\n\tk = j; /* minimum code length */\n\tfor (i = BMAX; (c[i] == 0) && i; i--)\n\t\tcontinue;\n\tg = i; /* maximum code length */\n\t*m = (*m < j) ? j : ((*m > i) ? i : *m);\n\n\t/* Adjust last length count to fill out codes, if needed */\n\tfor (y = 1 << j; j < i; j++, y <<= 1) {\n\t\ty -= c[j];\n\t\tif (y < 0)\n\t\t\treturn ERR_RET; /* bad input: more codes than bits */\n\t}\n\ty -= c[i];\n\tif (y < 0)\n\t\treturn ERR_RET;\n\tc[i] += y;\n\n\t/* Generate starting offsets into the value table for each length */\n\tx[1] = j = 0;\n\tp = c + 1;\n\txp = x + 2;\n\twhile (--i) { /* note that i == g from above */\n\t\tj += *p++;\n\t\t*xp++ = j;\n\t}\n\n\t/* Make a table of values in order of bit lengths.\n\t * To detect bad input, unused v[i]'s are set to invalid value UINT_MAX.\n\t * In particular, last v[i] is never filled and must not be accessed.\n\t */\n\tmemset(v, 0xff, sizeof(v));\n\tp = b;\n\ti = 0;\n\tdo {\n\t\tj = *p++;\n\t\tif (j != 0) {\n\t\t\tv[x[j]++] = i;\n\t\t}\n\t} while (++i < n);\n\n\t/* Generate the Huffman codes and for each, make the table entries */\n\tresult = ERR_RET;\n\tt = &result;\n\tx[0] = i = 0;   /* first Huffman code is zero */\n\tp = v;          /* grab values in bit order */\n\thtl = -1;       /* no tables yet--level -1 */\n\tw = ws[0] = 0;  /* bits decoded */\n\tu[0] = NULL;    /* just to keep compilers happy */\n\tq = NULL;       /* ditto */\n\tz = 0;          /* ditto */\n\n\t/* go through the bit lengths (k already is bits in shortest code) */\n\tfor (; k <= g; k++) {\n\t\ta = c[k];\n\t\twhile (a--) {\n\t\t\t/* here i is the Huffman code of length k bits for value *p */\n\t\t\t/* make tables up to required level */\n\t\t\twhile (k > ws[htl + 1]) {\n\t\t\t\tw = ws[++htl];\n\n\t\t\t\t/* compute minimum size table less than or equal to *m bits */\n\t\t\t\tz = g - w;\n\t\t\t\tz = z > *m ? *m : z; /* upper limit on table size */\n\t\t\t\tj = k - w;\n\t\t\t\tf = 1 << j;\n\t\t\t\tif (f > a + 1) { /* try a k-w bit table */\n\t\t\t\t\t/* too few codes for k-w bit table */\n\t\t\t\t\tf -= a + 1; /* deduct codes from patterns left */\n\t\t\t\t\txp = c + k;\n\t\t\t\t\twhile (++j < z) { /* try smaller tables up to z bits */\n\t\t\t\t\t\tf <<= 1;\n\t\t\t\t\t\tif (f <= *++xp) {\n\t\t\t\t\t\t\tbreak; /* enough codes to use up j bits */\n\t\t\t\t\t\t}\n\t\t\t\t\t\tf -= *xp; /* else deduct codes from patterns */\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tj = ((w + j) > (int)eob_len && w < (int)eob_len) ? eob_len - w : j;\t/* make EOB code end at table */\n\t\t\t\tz = 1 << j;\t/* table entries for j-bit table */\n\t\t\t\tws[htl+1] = w + j;\t/* set bits decoded in stack */\n\n\t\t\t\t/* allocate and link in new table */\n\t\t\t\tq = xzalloc((z + 1) * sizeof(huft_t));\n\t\t\t\t*t = q + 1;\t/* link to list for huft_free() */\n\t\t\t\tt = &(q->v.t);\n\t\t\t\tu[htl] = ++q;\t/* table starts after link */\n\n\t\t\t\t/* connect to last table, if there is one */\n\t\t\t\tif (htl) {\n\t\t\t\t\tx[htl] = i; /* save pattern for backing up */\n\t\t\t\t\tr.b = (unsigned char) (w - ws[htl - 1]); /* bits to dump before this table */\n\t\t\t\t\tr.e = (unsigned char) (16 + j); /* bits in this table */\n\t\t\t\t\tr.v.t = q; /* pointer to this table */\n\t\t\t\t\tj = (i & ((1 << w) - 1)) >> ws[htl - 1];\n\t\t\t\t\tu[htl - 1][j] = r; /* connect to last table */\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* set up table entry in r */\n\t\t\tr.b = (unsigned char) (k - w);\n\t\t\tif (/*p >= v + n || -- redundant, caught by the second check: */\n\t\t\t\t*p == UINT_MAX /* do we access uninited v[i]? (see memset(v))*/\n\t\t\t) {\n\t\t\t\tr.e = 99; /* out of values--invalid code */\n\t\t\t} else if (*p < s) {\n\t\t\t\tr.e = (unsigned char) (*p < 256 ? 16 : 15);\t/* 256 is EOB code */\n\t\t\t\tr.v.n = (unsigned short) (*p++); /* simple code is just the value */\n\t\t\t} else {\n\t\t\t\tr.e = (unsigned char) cp_ext->ext[*p - s]; /* non-simple--look up in lists */\n\t\t\t\tr.v.n = cp_ext->cp[*p++ - s];\n\t\t\t}\n\n\t\t\t/* fill code-like entries with r */\n\t\t\tf = 1 << (k - w);\n\t\t\tfor (j = i >> w; j < z; j += f) {\n\t\t\t\tq[j] = r;\n\t\t\t}\n\n\t\t\t/* backwards increment the k-bit code i */\n\t\t\tfor (j = 1 << (k - 1); i & j; j >>= 1) {\n\t\t\t\ti ^= j;\n\t\t\t}\n\t\t\ti ^= j;\n\n\t\t\t/* backup over finished tables */\n\t\t\twhile ((i & ((1 << w) - 1)) != x[htl]) {\n\t\t\t\tw = ws[--htl];\n\t\t\t}\n\t\t}\n\t}\n\n\t/* return actual size of base table */\n\t*m = ws[1];\n\n\tif (y != 0 && g != 1) /* we were given an incomplete table */\n\t\t/* return \"result\" ORed with 1 */\n\t\treturn (void*)((uintptr_t)result | 1);\n\n\treturn result;\n}\n\n\n/*\n * inflate (decompress) the codes in a deflated (compressed) block.\n * Return an error code or zero if it all goes ok.\n *\n * tl, td: literal/length and distance decoder tables\n * bl, bd: number of bits decoded by tl[] and td[]\n */\n/* called once from inflate_block */\n\n/* map formerly local static variables to globals */\n#define ml inflate_codes_ml\n#define md inflate_codes_md\n#define bb inflate_codes_bb\n#define k  inflate_codes_k\n#define w  inflate_codes_w\n#define tl inflate_codes_tl\n#define td inflate_codes_td\n#define bl inflate_codes_bl\n#define bd inflate_codes_bd\n#define nn inflate_codes_nn\n#define dd inflate_codes_dd\nstatic void inflate_codes_setup(STATE_PARAM unsigned my_bl, unsigned my_bd)\n{\n\tbl = my_bl;\n\tbd = my_bd;\n\t/* make local copies of globals */\n\tbb = gunzip_bb;\t\t\t/* initialize bit buffer */\n\tk = gunzip_bk;\n\tw = gunzip_outbuf_count;\t/* initialize gunzip_window position */\n\t/* inflate the coded data */\n\tml = mask_bits[bl];\t\t/* precompute masks for speed */\n\tmd = mask_bits[bd];\n}\n/* called once from inflate_get_next_window */\nstatic NOINLINE int inflate_codes(STATE_PARAM_ONLY)\n{\n\tunsigned e;\t/* table entry flag/number of extra bits */\n\thuft_t *t;\t/* pointer to table entry */\n\n\tif (resume_copy)\n\t\tgoto do_copy;\n\n\twhile (1) {\t\t\t/* do until end of block */\n\t\tbb = fill_bitbuffer(PASS_STATE bb, &k, bl);\n\t\tt = tl + ((unsigned) bb & ml);\n\t\te = t->e;\n\t\tif (e > 16)\n\t\t\tdo {\n\t\t\t\tif (e == 99) {\n\t\t\t\t\tabort_unzip(PASS_STATE_ONLY);\n\t\t\t\t}\n\t\t\t\tbb >>= t->b;\n\t\t\t\tk -= t->b;\n\t\t\t\te -= 16;\n\t\t\t\tbb = fill_bitbuffer(PASS_STATE bb, &k, e);\n\t\t\t\tt = t->v.t + ((unsigned) bb & mask_bits[e]);\n\t\t\t\te = t->e;\n\t\t\t} while (e > 16);\n\t\tbb >>= t->b;\n\t\tk -= t->b;\n\t\tif (e == 16) {\t/* then it's a literal */\n\t\t\tgunzip_window[w++] = (unsigned char) t->v.n;\n\t\t\tif (w == GUNZIP_WSIZE) {\n\t\t\t\tgunzip_outbuf_count = w;\n\t\t\t\t//flush_gunzip_window();\n\t\t\t\tw = 0;\n\t\t\t\treturn 1; // We have a block to read\n\t\t\t}\n\t\t} else {\t\t/* it's an EOB or a length */\n\t\t\t/* exit if end of block */\n\t\t\tif (e == 15) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* get length of block to copy */\n\t\t\tbb = fill_bitbuffer(PASS_STATE bb, &k, e);\n\t\t\tnn = t->v.n + ((unsigned) bb & mask_bits[e]);\n\t\t\tbb >>= e;\n\t\t\tk -= e;\n\n\t\t\t/* decode distance of block to copy */\n\t\t\tbb = fill_bitbuffer(PASS_STATE bb, &k, bd);\n\t\t\tt = td + ((unsigned) bb & md);\n\t\t\te = t->e;\n\t\t\tif (e > 16)\n\t\t\t\tdo {\n\t\t\t\t\tif (e == 99) {\n\t\t\t\t\t\tabort_unzip(PASS_STATE_ONLY);\n\t\t\t\t\t}\n\t\t\t\t\tbb >>= t->b;\n\t\t\t\t\tk -= t->b;\n\t\t\t\t\te -= 16;\n\t\t\t\t\tbb = fill_bitbuffer(PASS_STATE bb, &k, e);\n\t\t\t\t\tt = t->v.t + ((unsigned) bb & mask_bits[e]);\n\t\t\t\t\te = t->e;\n\t\t\t\t} while (e > 16);\n\t\t\tbb >>= t->b;\n\t\t\tk -= t->b;\n\t\t\tbb = fill_bitbuffer(PASS_STATE bb, &k, e);\n\t\t\tdd = w - t->v.n - ((unsigned) bb & mask_bits[e]);\n\t\t\tbb >>= e;\n\t\t\tk -= e;\n\n\t\t\t/* do the copy */\n do_copy:\n\t\t\tdo {\n\t\t\t\t/* Was: nn -= (e = (e = GUNZIP_WSIZE - ((dd &= GUNZIP_WSIZE - 1) > w ? dd : w)) > nn ? nn : e); */\n\t\t\t\t/* Who wrote THAT?? rewritten as: */\n\t\t\t\tunsigned delta;\n\n\t\t\t\tdd &= GUNZIP_WSIZE - 1;\n\t\t\t\te = GUNZIP_WSIZE - (dd > w ? dd : w);\n\t\t\t\tdelta = w > dd ? w - dd : dd - w;\n\t\t\t\tif (e > nn) e = nn;\n\t\t\t\tnn -= e;\n\n\t\t\t\t/* copy to new buffer to prevent possible overwrite */\n\t\t\t\tif (delta >= e) {\n\t\t\t\t\tmemcpy(gunzip_window + w, gunzip_window + dd, e);\n\t\t\t\t\tw += e;\n\t\t\t\t\tdd += e;\n\t\t\t\t} else {\n\t\t\t\t\t/* do it slow to avoid memcpy() overlap */\n\t\t\t\t\t/* !NOMEMCPY */\n\t\t\t\t\tdo {\n\t\t\t\t\t\tgunzip_window[w++] = gunzip_window[dd++];\n\t\t\t\t\t} while (--e);\n\t\t\t\t}\n\t\t\t\tif (w == GUNZIP_WSIZE) {\n\t\t\t\t\tgunzip_outbuf_count = w;\n\t\t\t\t\tresume_copy = (nn != 0);\n\t\t\t\t\t//flush_gunzip_window();\n\t\t\t\t\tw = 0;\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t} while (nn);\n\t\t\tresume_copy = 0;\n\t\t}\n\t}\n\n\t/* restore the globals from the locals */\n\tgunzip_outbuf_count = w;\t/* restore global gunzip_window pointer */\n\tgunzip_bb = bb;\t\t\t/* restore global bit buffer */\n\tgunzip_bk = k;\n\n\t/* normally just after call to inflate_codes, but save code by putting it here */\n\t/* free the decoding tables (tl and td), return */\n\thuft_free_all(PASS_STATE_ONLY);\n\n\t/* done */\n\treturn 0;\n}\n#undef ml\n#undef md\n#undef bb\n#undef k\n#undef w\n#undef tl\n#undef td\n#undef bl\n#undef bd\n#undef nn\n#undef dd\n\n\n/* called once from inflate_block */\nstatic void inflate_stored_setup(STATE_PARAM unsigned my_n, unsigned my_b, unsigned my_k)\n{\n\tinflate_stored_n = my_n;\n\tinflate_stored_b = my_b;\n\tinflate_stored_k = my_k;\n\t/* initialize gunzip_window position */\n\tinflate_stored_w = gunzip_outbuf_count;\n}\n/* called once from inflate_get_next_window */\nstatic int inflate_stored(STATE_PARAM_ONLY)\n{\n\t/* read and output the compressed data */\n\twhile (inflate_stored_n--) {\n\t\tinflate_stored_b = fill_bitbuffer(PASS_STATE inflate_stored_b, &inflate_stored_k, 8);\n\t\tgunzip_window[inflate_stored_w++] = (unsigned char) inflate_stored_b;\n\t\tif (inflate_stored_w == GUNZIP_WSIZE) {\n\t\t\tgunzip_outbuf_count = inflate_stored_w;\n\t\t\t//flush_gunzip_window();\n\t\t\tinflate_stored_w = 0;\n\t\t\tinflate_stored_b >>= 8;\n\t\t\tinflate_stored_k -= 8;\n\t\t\treturn 1; /* We have a block */\n\t\t}\n\t\tinflate_stored_b >>= 8;\n\t\tinflate_stored_k -= 8;\n\t}\n\n\t/* restore the globals from the locals */\n\tgunzip_outbuf_count = inflate_stored_w;\t\t/* restore global gunzip_window pointer */\n\tgunzip_bb = inflate_stored_b;\t/* restore global bit buffer */\n\tgunzip_bk = inflate_stored_k;\n\treturn 0; /* Finished */\n}\n\n\n/*\n * decompress an inflated block\n * e: last block flag\n *\n * GLOBAL VARIABLES: bb, kk,\n */\n/* Return values: -1 = inflate_stored, -2 = inflate_codes */\n/* One callsite in inflate_get_next_window */\nstatic int inflate_block(STATE_PARAM smallint *e)\n{\n\tunsigned ll[286 + 30];  /* literal/length and distance code lengths */\n\tunsigned t;     /* block type */\n\tunsigned b;     /* bit buffer */\n\tunsigned k;     /* number of bits in bit buffer */\n\n\t/* make local bit buffer */\n\n\tb = gunzip_bb;\n\tk = gunzip_bk;\n\n\t/* read in last block bit */\n\tb = fill_bitbuffer(PASS_STATE b, &k, 1);\n\t*e = b & 1;\n\tb >>= 1;\n\tk -= 1;\n\n\t/* read in block type */\n\tb = fill_bitbuffer(PASS_STATE b, &k, 2);\n\tt = (unsigned) b & 3;\n\tb >>= 2;\n\tk -= 2;\n\n\t/* restore the global bit buffer */\n\tgunzip_bb = b;\n\tgunzip_bk = k;\n\n\t/* Do we see block type 1 often? Yes!\n\t * TODO: fix performance problem (see below) */\n\t//bb_error_msg(\"blktype %d\", t);\n\n\t/* inflate that block type */\n\tswitch (t) {\n\tcase 0: /* Inflate stored */\n\t{\n\t\tunsigned n;\t/* number of bytes in block */\n\t\tunsigned b_stored;\t/* bit buffer */\n\t\tunsigned k_stored;\t/* number of bits in bit buffer */\n\n\t\t/* make local copies of globals */\n\t\tb_stored = gunzip_bb;\t/* initialize bit buffer */\n\t\tk_stored = gunzip_bk;\n\n\t\t/* go to byte boundary */\n\t\tn = k_stored & 7;\n\t\tb_stored >>= n;\n\t\tk_stored -= n;\n\n\t\t/* get the length and its complement */\n\t\tb_stored = fill_bitbuffer(PASS_STATE b_stored, &k_stored, 16);\n\t\tn = ((unsigned) b_stored & 0xffff);\n\t\tb_stored >>= 16;\n\t\tk_stored -= 16;\n\n\t\tb_stored = fill_bitbuffer(PASS_STATE b_stored, &k_stored, 16);\n\t\tif (n != (unsigned) ((~b_stored) & 0xffff)) {\n\t\t\tabort_unzip(PASS_STATE_ONLY);\t/* error in compressed data */\n\t\t}\n\t\tb_stored >>= 16;\n\t\tk_stored -= 16;\n\n\t\tinflate_stored_setup(PASS_STATE n, b_stored, k_stored);\n\n\t\treturn -1;\n\t}\n\tcase 1:\n\t/* Inflate fixed\n\t * decompress an inflated type 1 (fixed Huffman codes) block. We should\n\t * either replace this with a custom decoder, or at least precompute the\n\t * Huffman tables. TODO */\n\t{\n\t\tint i;                  /* temporary variable */\n\t\tunsigned bl;            /* lookup bits for tl */\n\t\tunsigned bd;            /* lookup bits for td */\n\t\t/* gcc 4.2.1 is too dumb to reuse stackspace. Moved up... */\n\t\t//unsigned ll[288];     /* length list for huft_build */\n\n\t\t/* set up literal table */\n\t\tfor (i = 0; i < 144; i++)\n\t\t\tll[i] = 8;\n\t\tfor (; i < 256; i++)\n\t\t\tll[i] = 9;\n\t\tfor (; i < 280; i++)\n\t\t\tll[i] = 7;\n\t\tfor (; i < 288; i++) /* make a complete, but wrong code set */\n\t\t\tll[i] = 8;\n\t\tbl = 7;\n\t\tinflate_codes_tl = huft_build(ll, 288, 257, &lit, &bl);\n\t\t/* ^^^ never returns error here - we use known data */\n\n\t\t/* set up distance table */\n\t\tfor (i = 0; i < 30; i++) /* make an incomplete code set */\n\t\t\tll[i] = 5;\n\t\tbd = 5;\n\t\tinflate_codes_td = huft_build(ll, 30, 0, &dist, &bd);\n\t\t/* ^^^ does return error here! (lsb bit is set) - we gave it incomplete code set */\n\t\t/* clearing error bit: */\n\t\tinflate_codes_td = (void*)((uintptr_t)inflate_codes_td & ~(uintptr_t)1);\n\n\t\t/* set up data for inflate_codes() */\n\t\tinflate_codes_setup(PASS_STATE bl, bd);\n\n\t\t/* huft_free code moved into inflate_codes */\n\n\t\treturn -2;\n\t}\n\tcase 2: /* Inflate dynamic */\n\t{\n\t\tenum { dbits = 6 };     /* bits in base distance lookup table */\n\t\tenum { lbits = 9 };     /* bits in base literal/length lookup table */\n\n\t\thuft_t *td;             /* distance code table */\n\t\tunsigned i;             /* temporary variables */\n\t\tunsigned j;\n\t\tunsigned l;             /* last length */\n\t\tunsigned m;             /* mask for bit lengths table */\n\t\tunsigned n;             /* number of lengths to get */\n\t\tunsigned bl;            /* lookup bits for tl */\n\t\tunsigned bd;            /* lookup bits for td */\n\t\tunsigned nb;            /* number of bit length codes */\n\t\tunsigned nl;            /* number of literal/length codes */\n\t\tunsigned nd;            /* number of distance codes */\n\n\t\t//unsigned ll[286 + 30];/* literal/length and distance code lengths */\n\t\tunsigned b_dynamic;     /* bit buffer */\n\t\tunsigned k_dynamic;     /* number of bits in bit buffer */\n\n\t\t/* make local bit buffer */\n\t\tb_dynamic = gunzip_bb;\n\t\tk_dynamic = gunzip_bk;\n\n\t\t/* read in table lengths */\n\t\tb_dynamic = fill_bitbuffer(PASS_STATE b_dynamic, &k_dynamic, 5);\n\t\tnl = 257 + ((unsigned) b_dynamic & 0x1f);\t/* number of literal/length codes */\n\n\t\tb_dynamic >>= 5;\n\t\tk_dynamic -= 5;\n\t\tb_dynamic = fill_bitbuffer(PASS_STATE b_dynamic, &k_dynamic, 5);\n\t\tnd = 1 + ((unsigned) b_dynamic & 0x1f);\t/* number of distance codes */\n\n\t\tb_dynamic >>= 5;\n\t\tk_dynamic -= 5;\n\t\tb_dynamic = fill_bitbuffer(PASS_STATE b_dynamic, &k_dynamic, 4);\n\t\tnb = 4 + ((unsigned) b_dynamic & 0xf);\t/* number of bit length codes */\n\n\t\tb_dynamic >>= 4;\n\t\tk_dynamic -= 4;\n\t\tif (nl > 286 || nd > 30) {\n\t\t\tabort_unzip(PASS_STATE_ONLY);\t/* bad lengths */\n\t\t}\n\n\t\t/* read in bit-length-code lengths */\n\t\tfor (j = 0; j < nb; j++) {\n\t\t\tb_dynamic = fill_bitbuffer(PASS_STATE b_dynamic, &k_dynamic, 3);\n\t\t\tll[border[j]] = (unsigned) b_dynamic & 7;\n\t\t\tb_dynamic >>= 3;\n\t\t\tk_dynamic -= 3;\n\t\t}\n\t\tfor (; j < 19; j++)\n\t\t\tll[border[j]] = 0;\n\n\t\t/* build decoding table for trees - single level, 7 bit lookup */\n\t\tbl = 7;\n\t\tinflate_codes_tl = huft_build(ll, 19, 19, NULL, &bl);\n\t\tif (BAD_HUFT(inflate_codes_tl)) {\n\t\t\tabort_unzip(PASS_STATE_ONLY);\t/* incomplete code set */\n\t\t}\n\n\t\t/* read in literal and distance code lengths */\n\t\tn = nl + nd;\n\t\tm = mask_bits[bl];\n\t\ti = l = 0;\n\t\twhile ((unsigned) i < n) {\n\t\t\tb_dynamic = fill_bitbuffer(PASS_STATE b_dynamic, &k_dynamic, (unsigned)bl);\n\t\t\ttd = inflate_codes_tl + ((unsigned) b_dynamic & m);\n\t\t\tj = td->b;\n\t\t\tb_dynamic >>= j;\n\t\t\tk_dynamic -= j;\n\t\t\tj = td->v.n;\n\t\t\tif (j < 16) {\t/* length of code in bits (0..15) */\n\t\t\t\tll[i++] = l = j;\t/* save last length in l */\n\t\t\t} else if (j == 16) {\t/* repeat last length 3 to 6 times */\n\t\t\t\tb_dynamic = fill_bitbuffer(PASS_STATE b_dynamic, &k_dynamic, 2);\n\t\t\t\tj = 3 + ((unsigned) b_dynamic & 3);\n\t\t\t\tb_dynamic >>= 2;\n\t\t\t\tk_dynamic -= 2;\n\t\t\t\tif ((unsigned) i + j > n) {\n\t\t\t\t\tabort_unzip(PASS_STATE_ONLY); //return 1;\n\t\t\t\t}\n\t\t\t\twhile (j--) {\n\t\t\t\t\tll[i++] = l;\n\t\t\t\t}\n\t\t\t} else if (j == 17) {\t/* 3 to 10 zero length codes */\n\t\t\t\tb_dynamic = fill_bitbuffer(PASS_STATE b_dynamic, &k_dynamic, 3);\n\t\t\t\tj = 3 + ((unsigned) b_dynamic & 7);\n\t\t\t\tb_dynamic >>= 3;\n\t\t\t\tk_dynamic -= 3;\n\t\t\t\tif ((unsigned) i + j > n) {\n\t\t\t\t\tabort_unzip(PASS_STATE_ONLY); //return 1;\n\t\t\t\t}\n\t\t\t\twhile (j--) {\n\t\t\t\t\tll[i++] = 0;\n\t\t\t\t}\n\t\t\t\tl = 0;\n\t\t\t} else {\t/* j == 18: 11 to 138 zero length codes */\n\t\t\t\tb_dynamic = fill_bitbuffer(PASS_STATE b_dynamic, &k_dynamic, 7);\n\t\t\t\tj = 11 + ((unsigned) b_dynamic & 0x7f);\n\t\t\t\tb_dynamic >>= 7;\n\t\t\t\tk_dynamic -= 7;\n\t\t\t\tif ((unsigned) i + j > n) {\n\t\t\t\t\tabort_unzip(PASS_STATE_ONLY); //return 1;\n\t\t\t\t}\n\t\t\t\twhile (j--) {\n\t\t\t\t\tll[i++] = 0;\n\t\t\t\t}\n\t\t\t\tl = 0;\n\t\t\t}\n\t\t}\n\n\t\t/* free decoding table for trees */\n\t\thuft_free(inflate_codes_tl);\n\n\t\t/* restore the global bit buffer */\n\t\tgunzip_bb = b_dynamic;\n\t\tgunzip_bk = k_dynamic;\n\n\t\t/* build the decoding tables for literal/length and distance codes */\n\t\tbl = lbits;\n\t\tinflate_codes_tl = huft_build(ll, nl, 257, &lit, &bl);\n\t\tif (BAD_HUFT(inflate_codes_tl)) {\n\t\t\tabort_unzip(PASS_STATE_ONLY);\n\t\t}\n\t\tbd = dbits;\n\t\tinflate_codes_td = huft_build(ll + nl, nd, 0, &dist, &bd);\n\t\tif (BAD_HUFT(inflate_codes_td)) {\n\t\t\tabort_unzip(PASS_STATE_ONLY);\n\t\t}\n\n\t\t/* set up data for inflate_codes() */\n\t\tinflate_codes_setup(PASS_STATE bl, bd);\n\n\t\t/* huft_free code moved into inflate_codes */\n\n\t\treturn -2;\n\t}\n\tdefault:\n\t\tabort_unzip(PASS_STATE_ONLY);\n\t\treturn 0;\n\t}\n}\n\n/* Two callsites, both in inflate_get_next_window */\nstatic void calculate_gunzip_crc(STATE_PARAM_ONLY)\n{\n\tgunzip_crc = crc32_block_endian0(gunzip_crc, gunzip_window, gunzip_outbuf_count, gunzip_crc_table);\n\tgunzip_bytes_out += gunzip_outbuf_count;\n}\n\n/* One callsite in inflate_unzip_internal */\nstatic int inflate_get_next_window(STATE_PARAM_ONLY)\n{\n\tgunzip_outbuf_count = 0;\n\n\twhile (1) {\n\t\tint ret = 0;\n\n\t\tif (need_another_block) {\n\t\t\tif (end_reached) {\n\t\t\t\tcalculate_gunzip_crc(PASS_STATE_ONLY);\n\t\t\t\tend_reached = 0;\n\t\t\t\t/* NB: need_another_block is still set */\n\t\t\t\treturn 0; /* Last block */\n\t\t\t}\n\t\t\tmethod = inflate_block(PASS_STATE &end_reached);\n\t\t\tneed_another_block = 0;\n\t\t}\n\n\t\tswitch (method) {\n\t\tcase -1:\n\t\t\tret = inflate_stored(PASS_STATE_ONLY);\n\t\t\tbreak;\n\t\tcase -2:\n\t\t\tret = inflate_codes(PASS_STATE_ONLY);\n\t\t\tbreak;\n\t\tdefault: /* cannot happen */\n\t\t\tabort_unzip(PASS_STATE_ONLY);\n\t\t}\n\n\t\tif (ret == 1) {\n\t\t\tcalculate_gunzip_crc(PASS_STATE_ONLY);\n\t\t\treturn 1; /* more data left */\n\t\t}\n\t\tneed_another_block = 1; /* end of that block */\n\t}\n\t/* Doesnt get here */\n}\n\n\n/* Called from unpack_gz_stream() and inflate_unzip() */\nstatic IF_DESKTOP(long long) int\ninflate_unzip_internal(STATE_PARAM transformer_state_t *xstate)\n{\n\tIF_DESKTOP(long long) int n = 0;\n\tssize_t nwrote;\n\n\t/* Allocate all global buffers (for DYN_ALLOC option) */\n\tgunzip_window = xzalloc(GUNZIP_WSIZE);\n\tgunzip_outbuf_count = 0;\n\tgunzip_bytes_out = 0;\n\tgunzip_src_fd = xstate->src_fd;\n\n\t/* (re) initialize state */\n\tmethod = -1;\n\tneed_another_block = 1;\n\tresume_copy = 0;\n\tgunzip_bk = 0;\n\tgunzip_bb = 0;\n\n\t/* Create the crc table */\n\tgunzip_crc_table = crc32_filltable(NULL, 0);\n\tgunzip_crc = ~0;\n\n\terror_msg = \"corrupted data\";\n\tif (setjmp(error_jmp)) {\n\t\t/* Error from deep inside zip machinery */\n\t\tbb_simple_error_msg(\"%s\", error_msg);\n\t\tn = -1;\n\t\tgoto ret;\n\t}\n\n\twhile (1) {\n\t\tint r = inflate_get_next_window(PASS_STATE_ONLY);\n\t\tnwrote = transformer_write(xstate, gunzip_window, gunzip_outbuf_count);\n\t\tif (nwrote != (ssize_t)gunzip_outbuf_count) {\n\t\t\thuft_free_all(PASS_STATE_ONLY);\n\t\t\tn = (nwrote <0)?nwrote:-1;\n\t\t\tgoto ret;\n\t\t}\n#if ENABLE_DESKTOP\n\t\tlong long int v = n + nwrote;\n\t\tif (v < n) {\n\t\t\tbb_simple_error_msg(\"overflow\");\n\t\t\tn = -1;\n\t\t\tgoto ret;\n\t\t}\n\t\tn = v;\n#endif\n\t\tif (r == 0) break;\n\t}\n\n\t/* Store unused bytes in a global buffer so calling applets can access it */\n\tif (gunzip_bk >= 8) {\n\t\t/* Undo too much lookahead. The next read will be byte aligned\n\t\t * so we can discard unused bits in the last meaningful byte. */\n\t\tbytebuffer_offset--;\n\t\tbytebuffer[bytebuffer_offset] = gunzip_bb & 0xff;\n\t\tgunzip_bb >>= 8;\n\t\t// coverity[overflow_const]\n\t\tgunzip_bk -= 8;\n\t}\n ret:\n\t/* Cleanup */\n\tfree(gunzip_window);\n\tfree(gunzip_crc_table);\n\treturn n;\n}\n\n\n/* External entry points */\n\n/* For unzip */\n\nIF_DESKTOP(long long) int FAST_FUNC\ninflate_unzip(transformer_state_t *xstate)\n{\n\tIF_DESKTOP(long long) int n;\n\tDECLARE_STATE;\n\n\tALLOC_STATE;\n\tif (state == NULL)\n\t\treturn -1;\n\n\tto_read = xstate->bytes_in;\n//\tbytebuffer_max = 0x8000;\n\tbytebuffer_offset = 4;\n\tbytebuffer = xmalloc(bytebuffer_max);\n\tn = inflate_unzip_internal(PASS_STATE xstate);\n\tfree(bytebuffer);\n\n\txstate->crc32 = gunzip_crc;\n\txstate->bytes_out = gunzip_bytes_out;\n\tDEALLOC_STATE;\n\treturn n;\n}\n\n\n/* For gunzip */\n\n/* helpers first */\n\n/* Top up the input buffer with at least n bytes. */\nstatic int top_up(STATE_PARAM unsigned n)\n{\n\tint count = bytebuffer_size - bytebuffer_offset;\n\n\tif (count < (int)n) {\n\t\tmemmove(bytebuffer, &bytebuffer[bytebuffer_offset], count);\n\t\tbytebuffer_offset = 0;\n\t\tbytebuffer_size = full_read(gunzip_src_fd, &bytebuffer[count], bytebuffer_max - count);\n\t\tif ((int)bytebuffer_size < 0) {\n\t\t\tbb_simple_error_msg(bb_msg_read_error);\n\t\t\treturn 0;\n\t\t}\n\t\tbytebuffer_size += count;\n\t\tif (bytebuffer_size < n)\n\t\t\treturn 0;\n\t}\n\treturn 1;\n}\n\nstatic uint16_t buffer_read_le_u16(STATE_PARAM_ONLY)\n{\n\tuint16_t res;\n#if BB_LITTLE_ENDIAN\n\tmove_from_unaligned16(res, &bytebuffer[bytebuffer_offset]);\n#else\n\tres = bytebuffer[bytebuffer_offset];\n\tres |= bytebuffer[bytebuffer_offset + 1] << 8;\n#endif\n\tbytebuffer_offset += 2;\n\treturn res;\n}\n\nstatic uint32_t buffer_read_le_u32(STATE_PARAM_ONLY)\n{\n\tuint32_t res;\n#if BB_LITTLE_ENDIAN\n\tmove_from_unaligned32(res, &bytebuffer[bytebuffer_offset]);\n#else\n\tres = bytebuffer[bytebuffer_offset];\n\tres |= bytebuffer[bytebuffer_offset + 1] << 8;\n\tres |= bytebuffer[bytebuffer_offset + 2] << 16;\n\tres |= bytebuffer[bytebuffer_offset + 3] << 24;\n#endif\n\tbytebuffer_offset += 4;\n\treturn res;\n}\n\nstatic int check_header_gzip(STATE_PARAM transformer_state_t *xstate)\n{\n\tPRAGMA_BEGIN_PACKED\n\tunion {\n\t\tunsigned char raw[8];\n\t\tstruct {\n\t\t\tuint8_t gz_method;\n\t\t\tuint8_t flags;\n\t\t\tuint32_t mtime;\n\t\t\tuint8_t xtra_flags_UNUSED;\n\t\t\tuint8_t os_flags_UNUSED;\n\t\t} PACKED formatted;\n\t} header;\n\tPRAGMA_END_PACKED\n\n\tBUILD_BUG_ON(sizeof(header) != 8);\n\n\t/*\n\t * Rewind bytebuffer. We use the beginning because the header has 8\n\t * bytes, leaving enough for unwinding afterwards.\n\t */\n\tbytebuffer_size -= bytebuffer_offset;\n\tmemmove(bytebuffer, &bytebuffer[bytebuffer_offset], bytebuffer_size);\n\tbytebuffer_offset = 0;\n\n\tif (!top_up(PASS_STATE 8))\n\t\treturn 0;\n\tmemcpy(header.raw, &bytebuffer[bytebuffer_offset], 8);\n\tbytebuffer_offset += 8;\n\n\t/* Check the compression method */\n\tif (header.formatted.gz_method != 8) {\n\t\treturn 0;\n\t}\n\n\tif (header.formatted.flags & 0x04) {\n\t\t/* bit 2 set: extra field present */\n\t\tunsigned extra_short;\n\n\t\tif (!top_up(PASS_STATE 2))\n\t\t\treturn 0;\n\t\textra_short = buffer_read_le_u16(PASS_STATE_ONLY);\n\t\tif (!top_up(PASS_STATE extra_short))\n\t\t\treturn 0;\n\t\t/* Ignore extra field */\n\t\tbytebuffer_offset += extra_short;\n\t}\n\n\t/* Discard original name and file comment if any */\n\t/* bit 3 set: original file name present */\n\t/* bit 4 set: file comment present */\n\tif (header.formatted.flags & 0x18) {\n\t\twhile (1) {\n\t\t\tdo {\n\t\t\t\t/* None of our buffers should be larger than BB_BUFSIZE */\n\t\t\t\tif (bytebuffer_offset > BB_BUFSIZE) {\n\t\t\t\t\tbb_error_msg(\"buffer overflow\");\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (!top_up(PASS_STATE 1))\n\t\t\t\t\treturn 0;\n\t\t\t} while (bytebuffer[bytebuffer_offset++] != 0);\n\t\t\tif ((header.formatted.flags & 0x18) != 0x18)\n\t\t\t\tbreak;\n\t\t\theader.formatted.flags &= ~0x18;\n\t\t}\n\t}\n\n\txstate->mtime = SWAP_LE32(header.formatted.mtime);\n\n\t/* Read the header checksum */\n\tif (header.formatted.flags & 0x02) {\n\t\tif (!top_up(PASS_STATE 2))\n\t\t\treturn 0;\n\t\tbytebuffer_offset += 2;\n\t}\n\treturn 1;\n}\n\nIF_DESKTOP(long long) int FAST_FUNC\nunpack_gz_stream(transformer_state_t *xstate)\n{\n\tuint32_t v32;\n\tIF_DESKTOP(long long) int total, n;\n\tDECLARE_STATE;\n\n#if !ENABLE_FEATURE_SEAMLESS_Z\n\tif (check_signature16(xstate, GZIP_MAGIC))\n\t\treturn -1;\n#else\n\tif (!xstate->signature_skipped) {\n\t\tuint16_t magic2;\n\n\t\tif (full_read(xstate->src_fd, &magic2, 2) != 2) {\n bad_magic:\n\t\t\tbb_simple_error_msg(\"invalid magic\");\n\t\t\treturn -1;\n\t\t}\n\t\tif (magic2 == COMPRESS_MAGIC) {\n\t\t\txstate->signature_skipped = 2;\n\t\t\treturn unpack_Z_stream(xstate);\n\t\t}\n\t\tif (magic2 != GZIP_MAGIC)\n\t\t\tgoto bad_magic;\n\t}\n#endif\n\n\ttotal = 0;\n\n\tALLOC_STATE;\n\tif (state == NULL) {\n\t\tbb_error_msg(\"alloc error\");\n\t\treturn -1;\n\t}\n\tto_read = -1;\n\tbytebuffer = xmalloc(bytebuffer_max);\n\tif (bytebuffer == NULL) {\n\t\tbb_error_msg(\"alloc error\");\n\t\ttotal = -1;\n\t\tgoto ret;\n\t}\n\tgunzip_src_fd = xstate->src_fd;\n\n again:\n\tif (!check_header_gzip(PASS_STATE xstate)) {\n\t\tbb_simple_error_msg(\"corrupted data\");\n\t\ttotal = -1;\n\t\tgoto ret;\n\t}\n\n\tn = inflate_unzip_internal(PASS_STATE xstate);\n\tif (n < 0) {\n\t\ttotal = (n == -ENOSPC) ? xstate->mem_output_size_max : n;\n\t\tgoto ret;\n\t}\n\ttotal += n;\n\n\tif (!top_up(PASS_STATE 8)) {\n\t\tbb_simple_error_msg(\"corrupted data\");\n\t\ttotal = -1;\n\t\tgoto ret;\n\t}\n\n\t/* Validate decompression - crc */\n\tv32 = buffer_read_le_u32(PASS_STATE_ONLY);\n\tif ((~gunzip_crc) != v32) {\n\t\tbb_simple_error_msg(\"crc error\");\n\t\ttotal = -1;\n\t\tgoto ret;\n\t}\n\n\t/* Validate decompression - size */\n\tv32 = buffer_read_le_u32(PASS_STATE_ONLY);\n\tif ((uint32_t)gunzip_bytes_out != v32) {\n\t\tbb_simple_error_msg(\"incorrect length\");\n\t\ttotal = -1;\n\t}\n\n\tif (!top_up(PASS_STATE 2))\n\t\tgoto ret; /* EOF */\n\n\tif (bytebuffer[bytebuffer_offset] == 0x1f\n\t && bytebuffer[bytebuffer_offset + 1] == 0x8b\n\t) {\n\t\tbytebuffer_offset += 2;\n\t\tgoto again;\n\t}\n\t/* GNU gzip says: */\n\t/*bb_error_msg(\"decompression OK, trailing garbage ignored\");*/\n\n ret:\n\tfree(bytebuffer);\n\tDEALLOC_STATE;\n\treturn total;\n}\n"
  },
  {
    "path": "src/bled/decompress_uncompress.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * uncompress for busybox -- (c) 2002 Robert Griebl\n *\n * based on the original compress42.c source\n * (see disclaimer below)\n */\n/* (N)compress42.c - File compression ala IEEE Computer, Mar 1992.\n *\n * Authors:\n *   Spencer W. Thomas   (decvax!harpo!utah-cs!utah-gr!thomas)\n *   Jim McKie           (decvax!mcvax!jim)\n *   Steve Davies        (decvax!vax135!petsd!peora!srd)\n *   Ken Turkowski       (decvax!decwrl!turtlevax!ken)\n *   James A. Woods      (decvax!ihnp4!ames!jaw)\n *   Joe Orost           (decvax!vax135!petsd!joe)\n *   Dave Mack           (csu@alembic.acs.com)\n *   Peter Jannesen, Network Communication Systems\n *                       (peter@ncs.nl)\n *\n * marc@suse.de : a small security fix for a buffer overflow\n *\n * [... History snipped ...]\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\n\n/* Default input buffer size */\n#define IBUFSIZ         ((int)BB_BUFSIZE)\n\n/* Default output buffer size */\n#define OBUFSIZ         ((int)BB_BUFSIZE)\n\n/* Defines for third byte of header */\n#define BIT_MASK        0x1f    /* Mask for 'number of compresssion bits'       */\n                                /* Masks 0x20 and 0x40 are free.                */\n                                /* I think 0x20 should mean that there is       */\n                                /* a fourth header byte (for expansion).        */\n#define BLOCK_MODE      0x80    /* Block compression if table is full and       */\n                                /* compression rate is dropping flush tables    */\n                                /* the next two codes should not be changed lightly, as they must not   */\n                                /* lie within the contiguous general code space.                        */\n#define FIRST   257     /* first free entry */\n#define CLEAR   256     /* table clear output code */\n\n#define INIT_BITS 9     /* initial number of bits/code */\n\n\n/* machine variants which require cc -Dmachine:  pdp11, z8000, DOS */\n#define HBITS      17   /* 50% occupancy */\n#define HSIZE      (1<<HBITS)\n#define HMASK      (HSIZE-1)    /* unused */\n#define HPRIME     9941         /* unused */\n#define BITS       16\n#define BITS_STR   \"16\"\n#undef  MAXSEG_64K              /* unused */\n#define MAXCODE(n) (1L << (n))\n\n#define htabof(i)               htab[i]\n#define codetabof(i)            codetab[i]\n#define tab_prefixof(i)         codetabof(i)\n#define tab_suffixof(i)         ((unsigned char *)(htab))[i]\n#define de_stack                ((unsigned char *)&(htab[HSIZE-1]))\n#define clear_tab_prefixof()    memset(codetab, 0, 256)\n\n/*\n * Decompress stdin to stdout.  This routine adapts to the codes in the\n * file building the \"string\" table on-the-fly; requiring no table to\n * be stored in the compressed file.\n */\n\nIF_DESKTOP(long long) int FAST_FUNC\nunpack_Z_stream(transformer_state_t *xstate)\n{\n\tIF_DESKTOP(long long total_written = 0;)\n\tIF_DESKTOP(long long) int retval = -1;\n\tunsigned char *stackp;\n\tint finchar;\n\tlong oldcode;\n\tlong incode;\n\tint inbits;\n\tint posbits;\n\tint outpos;\n\tint insize;\n\tint bitmask;\n\tlong free_ent;\n\tlong maxcode;\n\tlong maxmaxcode;\n\tint n_bits;\n\tint rsize = 0;\n\tunsigned char *inbuf; /* were eating insane amounts of stack - */\n\tunsigned char *outbuf; /* bad for some embedded targets */\n\tunsigned char *htab;\n\tunsigned short *codetab;\n\n\t/* Hmm, these were statics - why?! */\n\t/* user settable max # bits/code */\n\tint maxbits; /* = BITS; */\n\t/* block compress mode -C compatible with 2.0 */\n\tint block_mode; /* = BLOCK_MODE; */\n\n\tif (check_signature16(xstate, COMPRESS_MAGIC))\n\t\treturn -1;\n\n\tinbuf = xzalloc(IBUFSIZ + 64);\n\toutbuf = xzalloc(OBUFSIZ + 2048);\n\thtab = xzalloc(HSIZE);  /* wasn't zeroed out before, maybe can xmalloc? */\n\tcodetab = xzalloc(HSIZE * sizeof(codetab[0]));\n\n\tinsize = 0;\n\n\t/* xread isn't good here, we have to return - caller may want\n\t * to do some cleanup (e.g. delete incomplete unpacked file etc) */\n\tif (full_read(xstate->src_fd, inbuf, 1) != 1) {\n\t\tbb_simple_error_msg(\"short read\");\n\t\tgoto err;\n\t}\n\n\tmaxbits = inbuf[0] & BIT_MASK;\n\tblock_mode = inbuf[0] & BLOCK_MODE;\n\tmaxmaxcode = MAXCODE(maxbits);\n\n\tif (maxbits > BITS) {\n\t\tbb_error_msg(\"compressed with %d bits, can only handle \"\n\t\t\t\tBITS_STR\" bits\", maxbits);\n\t\tgoto err;\n\t}\n\n\tn_bits = INIT_BITS;\n\tmaxcode = MAXCODE(INIT_BITS) - 1;\n\tbitmask = (1 << INIT_BITS) - 1;\n\toldcode = -1;\n\tfinchar = 0;\n\toutpos = 0;\n\tposbits = 0 << 3;\n\n\tfree_ent = ((block_mode) ? FIRST : 256);\n\n\t/* As above, initialize the first 256 entries in the table. */\n\t/*clear_tab_prefixof(); - done by xzalloc */\n\n\t{\n\t\tint i;\n\t\tfor (i = 255; i >= 0; --i)\n\t\t\ttab_suffixof(i) = (unsigned char) i;\n\t}\n\n\tdo {\n resetbuf:\n\t\t{\n\t\t\tint i;\n\t\t\tint e;\n\t\t\tint o;\n\n\t\t\to = posbits >> 3;\n\t\t\te = insize - o;\n\n\t\t\tfor (i = 0; i < e; ++i)\n\t\t\t\tinbuf[i] = inbuf[i + o];\n\n\t\t\tinsize = e;\n\t\t\tposbits = 0;\n\t\t}\n\n\t\tif (insize < (int) (IBUFSIZ + 64) - IBUFSIZ) {\n\t\t\trsize = safe_read(xstate->src_fd, inbuf + insize, IBUFSIZ);\n\t\t\tif (rsize < 0)\n\t\t\t\tbb_simple_error_msg_and_die(bb_msg_read_error);\n\t\t\tinsize += rsize;\n\t\t}\n\n\t\tinbits = ((rsize > 0) ? (insize - insize % n_bits) << 3 :\n\t\t\t\t  (insize << 3) - (n_bits - 1));\n\n\t\twhile (inbits > posbits) {\n\t\t\tlong code;\n\n\t\t\tif (free_ent > maxcode) {\n\t\t\t\tposbits =\n\t\t\t\t\t((posbits - 1) +\n\t\t\t\t\t ((n_bits << 3) -\n\t\t\t\t\t  (posbits - 1 + (n_bits << 3)) % (n_bits << 3)));\n\t\t\t\t++n_bits;\n\t\t\t\tif (n_bits == maxbits) {\n\t\t\t\t\tmaxcode = maxmaxcode;\n\t\t\t\t} else {\n\t\t\t\t\tmaxcode = MAXCODE(n_bits) - 1;\n\t\t\t\t}\n\t\t\t\tbitmask = (1 << n_bits) - 1;\n\t\t\t\tgoto resetbuf;\n\t\t\t}\n\t\t\t{\n\t\t\t\tunsigned char *p = &inbuf[posbits >> 3];\n\t\t\t\tcode = ((p[0]\n\t\t\t\t\t| ((long) (p[1]) << 8)\n\t\t\t\t\t| ((long) (p[2]) << 16)) >> (posbits & 0x7)) & bitmask;\n\t\t\t}\n\t\t\tposbits += n_bits;\n\n\t\t\tif (oldcode == -1) {\n\t\t\t\tif (code >= 256)\n\t\t\t\t\tbb_simple_error_msg_and_die(\"corrupted data\"); /* %ld\", code); */\n\t\t\t\toldcode = code;\n\t\t\t\tfinchar = (int) oldcode;\n\t\t\t\toutbuf[outpos++] = (unsigned char) finchar;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (code == CLEAR && block_mode) {\n\t\t\t\tclear_tab_prefixof();\n\t\t\t\tfree_ent = FIRST - 1;\n\t\t\t\tposbits =\n\t\t\t\t\t((posbits - 1) +\n\t\t\t\t\t ((n_bits << 3) -\n\t\t\t\t\t  (posbits - 1 + (n_bits << 3)) % (n_bits << 3)));\n\t\t\t\tn_bits = INIT_BITS;\n\t\t\t\tmaxcode = MAXCODE(INIT_BITS) - 1;\n\t\t\t\tbitmask = (1 << INIT_BITS) - 1;\n\t\t\t\tgoto resetbuf;\n\t\t\t}\n\n\t\t\tincode = code;\n\t\t\tstackp = de_stack;\n\n\t\t\t/* Special case for KwKwK string. */\n\t\t\tif (code >= free_ent) {\n\t\t\t\tif (code > free_ent) {\n/*\n\t\t\t\t\tunsigned char *p;\n\n\t\t\t\t\tposbits -= n_bits;\n\t\t\t\t\tp = &inbuf[posbits >> 3];\n\t\t\t\t\tbb_error_msg\n\t\t\t\t\t\t(\"insize:%d posbits:%d inbuf:%02X %02X %02X %02X %02X (%d)\",\n\t\t\t\t\t\tinsize, posbits, p[-1], p[0], p[1], p[2], p[3],\n\t\t\t\t\t\t(posbits & 07));\n*/\n\t\t\t\t\tbb_simple_error_msg(\"corrupted data\");\n\t\t\t\t\tgoto err;\n\t\t\t\t}\n\n\t\t\t\t*--stackp = (unsigned char) finchar;\n\t\t\t\tcode = oldcode;\n\t\t\t}\n\n\t\t\t/* Generate output characters in reverse order */\n\t\t\twhile (code >= 256) {\n\t\t\t\tif (stackp <= &htabof(0))\n\t\t\t\t\tbb_simple_error_msg_and_die(\"corrupted data\");\n\t\t\t\t*--stackp = tab_suffixof(code);\n\t\t\t\tcode = tab_prefixof(code);\n\t\t\t}\n\n\t\t\tfinchar = tab_suffixof(code);\n\t\t\t*--stackp = (unsigned char) finchar;\n\n\t\t\t/* And put them out in forward order */\n\t\t\t{\n\t\t\t\tint i;\n\n\t\t\t\ti = (int)(de_stack - stackp);\n\t\t\t\tif (outpos + i >= OBUFSIZ) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (i > OBUFSIZ - outpos) {\n\t\t\t\t\t\t\ti = OBUFSIZ - outpos;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\t\tmemcpy(outbuf + outpos, stackp, i);\n\t\t\t\t\t\t\toutpos += i;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (outpos >= OBUFSIZ) {\n\t\t\t\t\t\t\tretval = transformer_write(xstate, outbuf, outpos);\n\t\t\t\t\t\t\tif (retval != (ssize_t)outpos) {\n\t\t\t\t\t\t\t\tretval = (retval == -ENOSPC)?xstate->mem_output_size_max:-1;\n\t\t\t\t\t\t\t\tgoto err;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tIF_DESKTOP(total_written += outpos;)\n\t\t\t\t\t\t\toutpos = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstackp += i;\n\t\t\t\t\t\ti = (int)(de_stack - stackp);\n\t\t\t\t\t} while (i > 0);\n\t\t\t\t} else {\n\t\t\t\t\tmemcpy(outbuf + outpos, stackp, i);\n\t\t\t\t\toutpos += i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Generate the new entry. */\n\t\t\tif (free_ent < maxmaxcode) {\n\t\t\t\ttab_prefixof(free_ent) = (unsigned short) oldcode;\n\t\t\t\ttab_suffixof(free_ent) = (unsigned char) finchar;\n\t\t\t\tfree_ent++;\n\t\t\t}\n\n\t\t\t/* Remember previous code.  */\n\t\t\toldcode = incode;\n\t\t}\n\t} while (rsize > 0);\n\n\tif (outpos > 0) {\n\t\tretval = transformer_write(xstate, outbuf, outpos);\n\t\tif (retval != (ssize_t)outpos)\n\t\t\tretval = (retval == -ENOSPC)?xstate->mem_output_size_max:-1;\n\t\tIF_DESKTOP(total_written += outpos;)\n\t}\n\n\tretval = IF_DESKTOP(total_written) + 0;\n err:\n\tfree(inbuf);\n\tfree(outbuf);\n\tfree(htab);\n\tfree(codetab);\n\treturn retval;\n}\n"
  },
  {
    "path": "src/bled/decompress_unlzma.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Small lzma deflate implementation.\n * Copyright (C) 2006  Aurelien Jacobs <aurel@gnuage.org>\n *\n * Based on LzmaDecode.c from the LZMA SDK 4.22 (http://www.7-zip.org/)\n * Copyright (C) 1999-2005  Igor Pavlov\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\n#if 0\n# define dbg(...) bb_error_msg(__VA_ARGS__)\n#else\n# define dbg(...) ((void)0)\n#endif\n\n\n#if ENABLE_FEATURE_LZMA_FAST\n#  define speed_inline ALWAYS_INLINE\n#  define size_inline\n#else\n#  define speed_inline\n#  define size_inline ALWAYS_INLINE\n#endif\n\n\ntypedef struct {\n\tint fd;\n\tuint8_t *ptr;\n\n/* Was keeping rc on stack in unlzma and separately allocating buffer,\n * but with \"buffer 'attached to' allocated rc\" code is smaller: */\n\t/* uint8_t *buffer; */\n#define RC_BUFFER ((uint8_t*)(rc+1))\n\n\tuint8_t *buffer_end;\n\n/* Had provisions for variable buffer, but we don't need it here */\n\t/* int buffer_size; */\n#define RC_BUFFER_SIZE BB_BUFSIZE\n\n\tuint32_t code;\n\tuint32_t range;\n\tuint32_t bound;\n} rc_t;\n\n#define RC_TOP_BITS 24\n#define RC_MOVE_BITS 5\n#define RC_MODEL_TOTAL_BITS 11\n\n\n/* Called once in rc_do_normalize() */\nstatic void rc_read(rc_t *rc)\n{\n\tint buffer_size = safe_read(rc->fd, RC_BUFFER, RC_BUFFER_SIZE);\n//TODO: return -1 instead\n//This will make unlzma delete broken unpacked file on unpack errors\n\tif (buffer_size <= 0)\n\t\tbb_simple_error_msg_and_die(\"unexpected EOF\");\n\trc->buffer_end = RC_BUFFER + buffer_size;\n\trc->ptr = RC_BUFFER;\n}\n\n/* Called twice, but one callsite is in speed_inline'd rc_is_bit_1() */\nstatic void rc_do_normalize(rc_t *rc)\n{\n\tif (rc->ptr >= rc->buffer_end)\n\t\trc_read(rc);\n\trc->range <<= 8;\n\trc->code = (rc->code << 8) | *rc->ptr++;\n}\nstatic ALWAYS_INLINE void rc_normalize(rc_t *rc)\n{\n\tif (rc->range < (1 << RC_TOP_BITS)) {\n\t\trc_do_normalize(rc);\n\t}\n}\n\n/* Called once */\nstatic ALWAYS_INLINE rc_t* rc_init(int fd) /*, int buffer_size) */\n{\n\tint i;\n\trc_t *rc;\n\n\trc = xzalloc(sizeof(*rc) + RC_BUFFER_SIZE);\n\tif (rc == NULL)\n\t\treturn NULL;\n\n\trc->fd = fd;\n\t/* rc->ptr = rc->buffer_end; */\n\n\tfor (i = 0; i < 5; i++) {\n\t\trc_do_normalize(rc);\n\t}\n\trc->range = 0xffffffff;\n\treturn rc;\n}\n\n/* Called once  */\nstatic ALWAYS_INLINE void rc_free(rc_t *rc)\n{\n\tfree(rc);\n}\n\n/* rc_is_bit_1 is called 9 times */\nstatic speed_inline int rc_is_bit_1(rc_t *rc, uint16_t *p)\n{\n\trc_normalize(rc);\n\trc->bound = *p * (rc->range >> RC_MODEL_TOTAL_BITS);\n\tif (rc->code < rc->bound) {\n\t\trc->range = rc->bound;\n\t\t*p += ((1 << RC_MODEL_TOTAL_BITS) - *p) >> RC_MOVE_BITS;\n\t\treturn 0;\n\t}\n\trc->range -= rc->bound;\n\trc->code -= rc->bound;\n\t*p -= *p >> RC_MOVE_BITS;\n\treturn 1;\n}\n\n/* Called 4 times in unlzma loop */\nstatic ALWAYS_INLINE int rc_get_bit(rc_t *rc, uint16_t *p, int *symbol)\n{\n\tint ret = rc_is_bit_1(rc, p);\n\t*symbol = *symbol * 2 + ret;\n\treturn ret;\n}\n\n/* Called once */\nstatic ALWAYS_INLINE int rc_direct_bit(rc_t *rc)\n{\n\trc_normalize(rc);\n\trc->range >>= 1;\n\tif (rc->code >= rc->range) {\n\t\trc->code -= rc->range;\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n/* Called twice */\nstatic speed_inline void\nrc_bit_tree_decode(rc_t *rc, uint16_t *p, int num_levels, int *symbol)\n{\n\tint i = num_levels;\n\n\t*symbol = 1;\n\twhile (i--)\n\t\trc_get_bit(rc, p + *symbol, symbol);\n\t*symbol -= 1 << num_levels;\n}\n\nPRAGMA_BEGIN_PACKED\ntypedef struct {\n\tuint8_t pos;\n\tuint32_t dict_size;\n\tuint64_t dst_size;\n} PACKED lzma_header_t;\nPRAGMA_END_PACKED\n\n\n/* #defines will force compiler to compute/optimize each one with each usage.\n * Have heart and use enum instead. */\nenum {\n\tLZMA_BASE_SIZE = 1846,\n\tLZMA_LIT_SIZE  = 768,\n\n\tLZMA_NUM_POS_BITS_MAX = 4,\n\n\tLZMA_LEN_NUM_LOW_BITS  = 3,\n\tLZMA_LEN_NUM_MID_BITS  = 3,\n\tLZMA_LEN_NUM_HIGH_BITS = 8,\n\n\tLZMA_LEN_CHOICE     = 0,\n\tLZMA_LEN_CHOICE_2   = (LZMA_LEN_CHOICE + 1),\n\tLZMA_LEN_LOW        = (LZMA_LEN_CHOICE_2 + 1),\n\tLZMA_LEN_MID        = (LZMA_LEN_LOW \\\n\t                      + (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_LOW_BITS))),\n\tLZMA_LEN_HIGH       = (LZMA_LEN_MID \\\n\t                      + (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_MID_BITS))),\n\tLZMA_NUM_LEN_PROBS  = (LZMA_LEN_HIGH + (1 << LZMA_LEN_NUM_HIGH_BITS)),\n\n\tLZMA_NUM_STATES     = 12,\n\tLZMA_NUM_LIT_STATES = 7,\n\n\tLZMA_START_POS_MODEL_INDEX = 4,\n\tLZMA_END_POS_MODEL_INDEX   = 14,\n\tLZMA_NUM_FULL_DISTANCES    = (1 << (LZMA_END_POS_MODEL_INDEX >> 1)),\n\n\tLZMA_NUM_POS_SLOT_BITS = 6,\n\tLZMA_NUM_LEN_TO_POS_STATES = 4,\n\n\tLZMA_NUM_ALIGN_BITS = 4,\n\n\tLZMA_MATCH_MIN_LEN  = 2,\n\n\tLZMA_IS_MATCH       = 0,\n\tLZMA_IS_REP         = (LZMA_IS_MATCH + (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)),\n\tLZMA_IS_REP_G0      = (LZMA_IS_REP + LZMA_NUM_STATES),\n\tLZMA_IS_REP_G1      = (LZMA_IS_REP_G0 + LZMA_NUM_STATES),\n\tLZMA_IS_REP_G2      = (LZMA_IS_REP_G1 + LZMA_NUM_STATES),\n\tLZMA_IS_REP_0_LONG  = (LZMA_IS_REP_G2 + LZMA_NUM_STATES),\n\tLZMA_POS_SLOT       = (LZMA_IS_REP_0_LONG \\\n\t                      + (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)),\n\tLZMA_SPEC_POS       = (LZMA_POS_SLOT \\\n\t                      + (LZMA_NUM_LEN_TO_POS_STATES << LZMA_NUM_POS_SLOT_BITS)),\n\tLZMA_ALIGN          = (LZMA_SPEC_POS \\\n\t                      + LZMA_NUM_FULL_DISTANCES - LZMA_END_POS_MODEL_INDEX),\n\tLZMA_LEN_CODER      = (LZMA_ALIGN + (1 << LZMA_NUM_ALIGN_BITS)),\n\tLZMA_REP_LEN_CODER  = (LZMA_LEN_CODER + LZMA_NUM_LEN_PROBS),\n\tLZMA_LITERAL        = (LZMA_REP_LEN_CODER + LZMA_NUM_LEN_PROBS),\n};\n\n\nIF_DESKTOP(long long) int FAST_FUNC\nunpack_lzma_stream(transformer_state_t *xstate)\n{\n\tIF_DESKTOP(long long total_written = 0;)\n\tlzma_header_t header;\n\tint lc, pb, lp;\n\tuint32_t pos_state_mask;\n\tuint32_t literal_pos_mask;\n\tuint16_t *p;\n\trc_t *rc;\n\tint i;\n\tuint8_t *buffer;\n\tuint32_t buffer_size;\n\tuint8_t previous_byte = 0;\n\tsize_t buffer_pos = 0, global_pos = 0;\n\tssize_t nwrote = 0;\n\tint len = 0;\n\tint state = 0;\n\tuint32_t rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1;\n\n\tif (full_read(xstate->src_fd, &header, sizeof(header)) != sizeof(header)\n\t || header.pos >= (9 * 5 * 5)\n\t) {\n\t\tbb_simple_error_msg(\"bad lzma header\");\n\t\treturn -1;\n\t}\n\n\ti = header.pos / 9;\n\tlc = header.pos % 9;\n\tpb = i / 5;\n\tlp = i % 5;\n\tpos_state_mask = (1 << pb) - 1;\n\tliteral_pos_mask = (1 << lp) - 1;\n\n\t/* Example values from linux-3.3.4.tar.lzma:\n\t * dict_size: 64M, dst_size: 2^64-1\n\t */\n\theader.dict_size = SWAP_LE32(header.dict_size);\n\theader.dst_size = SWAP_LE64(header.dst_size);\n\n\tif (header.dict_size > 1024 * 1024 * 1024) {\n\t\tbb_simple_error_msg(\"lzma dictionary size too large\");\n\t\treturn -1;\n\t}\n\n\tif (header.dict_size == 0)\n\t\theader.dict_size++;\n\n\tbuffer_size = (uint32_t)MIN(header.dst_size, header.dict_size);\n\tbuffer = xmalloc(buffer_size);\n\n\t{\n\t\tint num_probs;\n\n\t\tnum_probs = LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp));\n\t\tp = xmalloc(num_probs * sizeof(*p));\n\t\tnum_probs += LZMA_LITERAL - LZMA_BASE_SIZE;\n\t\tfor (i = 0; i < num_probs; i++)\n\t\t\tp[i] = (1 << RC_MODEL_TOTAL_BITS) >> 1;\n\t}\n\n\trc = rc_init(xstate->src_fd); /*, RC_BUFFER_SIZE); */\n\n\twhile ((uint64_t)global_pos + buffer_pos < header.dst_size) {\n\t\tint pos_state = (buffer_pos + global_pos) & pos_state_mask;\n\t\tuintptr_t off1 = LZMA_IS_MATCH + (state << LZMA_NUM_POS_BITS_MAX) + pos_state;\n\t\tuint16_t *prob = p + off1;\n\n\t\tif (!rc_is_bit_1(rc, prob)) {\n\t\t\tstatic const char next_state[LZMA_NUM_STATES] =\n\t\t\t\t{ 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5 };\n\t\t\tint mi = 1;\n\n\t\t\tprob = (p + LZMA_LITERAL\n\t\t\t        + (LZMA_LIT_SIZE * ((((buffer_pos + global_pos) & literal_pos_mask) << lc)\n\t\t\t                            + (previous_byte >> (8 - lc))\n\t\t\t                           )\n\t\t\t          )\n\t\t\t);\n\n\t\t\tif (state >= LZMA_NUM_LIT_STATES) {\n\t\t\t\tint match_byte;\n\t\t\t\tuint32_t pos;\n\n\t\t\t\tpos = (uint32_t)(buffer_pos - rep0);\n\t\t\t\tif ((int32_t)pos < 0) {\n\t\t\t\t\tpos += header.dict_size;\n\t\t\t\t\tif ((int32_t)pos < 0)\n\t\t\t\t\t\tgoto bad;\n\t\t\t\t}\n\t\t\t\tmatch_byte = buffer[pos];\n\t\t\t\tdo {\n\t\t\t\t\tint bit;\n\n\t\t\t\t\tmatch_byte <<= 1;\n\t\t\t\t\tbit = match_byte & 0x100;\n\t\t\t\t\tbit ^= (rc_get_bit(rc, prob + 0x100 + bit + mi, &mi) << 8); /* 0x100 or 0 */\n\t\t\t\t\tif (bit)\n\t\t\t\t\t\tbreak;\n\t\t\t\t} while (mi < 0x100);\n\t\t\t}\n\t\t\twhile (mi < 0x100) {\n\t\t\t\trc_get_bit(rc, prob + mi, &mi);\n\t\t\t}\n\n\t\t\tstate = next_state[state];\n\n\t\t\tprevious_byte = (uint8_t) mi;\n#if ENABLE_FEATURE_LZMA_FAST\n one_byte1:\n\t\t\tbuffer[buffer_pos++] = previous_byte;\n\t\t\tif (buffer_pos == header.dict_size) {\n\t\t\t\tbuffer_pos = 0;\n\t\t\t\tglobal_pos += header.dict_size;\n\t\t\t\tnwrote = transformer_write(xstate, buffer, header.dict_size);\n\t\t\t\tif (nwrote != (ssize_t)header.dict_size)\n\t\t\t\t\tgoto bad;\n\t\t\t\tIF_DESKTOP(total_written += header.dict_size;)\n\t\t\t}\n#else\n\t\t\tlen = 1;\n\t\t\tgoto one_byte2;\n#endif\n\t\t} else {\n\t\t\tint num_bits;\n\t\t\tint offset;\n\t\t\tuint16_t *prob2;\n#define prob_len prob2\n\n\t\t\tprob2 = p + LZMA_IS_REP + state;\n\t\t\tif (!rc_is_bit_1(rc, prob2)) {\n\t\t\t\trep3 = rep2;\n\t\t\t\trep2 = rep1;\n\t\t\t\trep1 = rep0;\n\t\t\t\tstate = state < LZMA_NUM_LIT_STATES ? 0 : 3;\n\t\t\t\tprob2 = p + LZMA_LEN_CODER;\n\t\t\t} else {\n\t\t\t\tprob2 += LZMA_IS_REP_G0 - LZMA_IS_REP;\n\t\t\t\tif (!rc_is_bit_1(rc, prob2)) {\n\t\t\t\t\tprob2 = (p + LZMA_IS_REP_0_LONG\n\t\t\t\t\t        + (state << LZMA_NUM_POS_BITS_MAX)\n\t\t\t\t\t        + pos_state\n\t\t\t\t\t);\n\t\t\t\t\tif (!rc_is_bit_1(rc, prob2)) {\n#if ENABLE_FEATURE_LZMA_FAST\n\t\t\t\t\t\tuint32_t pos;\n\t\t\t\t\t\tstate = state < LZMA_NUM_LIT_STATES ? 9 : 11;\n\n\t\t\t\t\t\tpos = buffer_pos - rep0;\n\t\t\t\t\t\tif ((int32_t)pos < 0) {\n\t\t\t\t\t\t\tpos += header.dict_size;\n\t\t\t\t\t\t\t/* see unzip_bad_lzma_2.zip: */\n\t\t\t\t\t\t\tif (pos >= buffer_size) {\n\t\t\t\t\t\t\t\tdbg(\"%d pos:%d buffer_size:%d\", __LINE__, pos, buffer_size);\n\t\t\t\t\t\t\t\tgoto bad;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprevious_byte = buffer[pos];\n\t\t\t\t\t\tgoto one_byte1;\n#else\n\t\t\t\t\t\tstate = state < LZMA_NUM_LIT_STATES ? 9 : 11;\n\t\t\t\t\t\tlen = 1;\n\t\t\t\t\t\tgoto string;\n#endif\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tuint32_t distance;\n\n\t\t\t\t\tprob2 += LZMA_IS_REP_G1 - LZMA_IS_REP_G0;\n\t\t\t\t\tdistance = rep1;\n\t\t\t\t\tif (rc_is_bit_1(rc, prob2)) {\n\t\t\t\t\t\tprob2 += LZMA_IS_REP_G2 - LZMA_IS_REP_G1;\n\t\t\t\t\t\tdistance = rep2;\n\t\t\t\t\t\tif (rc_is_bit_1(rc, prob2)) {\n\t\t\t\t\t\t\tdistance = rep3;\n\t\t\t\t\t\t\trep3 = rep2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\trep2 = rep1;\n\t\t\t\t\t}\n\t\t\t\t\trep1 = rep0;\n\t\t\t\t\trep0 = distance;\n\t\t\t\t}\n\t\t\t\tstate = state < LZMA_NUM_LIT_STATES ? 8 : 11;\n\t\t\t\tprob2 = p + LZMA_REP_LEN_CODER;\n\t\t\t}\n\n\t\t\tprob_len = prob2 + LZMA_LEN_CHOICE;\n\t\t\tnum_bits = LZMA_LEN_NUM_LOW_BITS;\n\t\t\tif (!rc_is_bit_1(rc, prob_len)) {\n\t\t\t\tprob_len += LZMA_LEN_LOW - LZMA_LEN_CHOICE\n\t\t\t\t            + (pos_state << LZMA_LEN_NUM_LOW_BITS);\n\t\t\t\toffset = 0;\n\t\t\t} else {\n\t\t\t\tprob_len += LZMA_LEN_CHOICE_2 - LZMA_LEN_CHOICE;\n\t\t\t\tif (!rc_is_bit_1(rc, prob_len)) {\n\t\t\t\t\tprob_len += LZMA_LEN_MID - LZMA_LEN_CHOICE_2\n\t\t\t\t\t            + (pos_state << LZMA_LEN_NUM_MID_BITS);\n\t\t\t\t\toffset = 1 << LZMA_LEN_NUM_LOW_BITS;\n\t\t\t\t\tnum_bits += LZMA_LEN_NUM_MID_BITS - LZMA_LEN_NUM_LOW_BITS;\n\t\t\t\t} else {\n\t\t\t\t\tprob_len += LZMA_LEN_HIGH - LZMA_LEN_CHOICE_2;\n\t\t\t\t\toffset = ((1 << LZMA_LEN_NUM_LOW_BITS)\n\t\t\t\t\t          + (1 << LZMA_LEN_NUM_MID_BITS));\n\t\t\t\t\tnum_bits += LZMA_LEN_NUM_HIGH_BITS - LZMA_LEN_NUM_LOW_BITS;\n\t\t\t\t}\n\t\t\t}\n\t\t\trc_bit_tree_decode(rc, prob_len, num_bits, &len);\n\t\t\tlen += offset;\n\n\t\t\tif (state < 4) {\n\t\t\t\tint pos_slot;\n\t\t\t\tuintptr_t off3 = LZMA_POS_SLOT +\n\t\t\t\t\t((len < LZMA_NUM_LEN_TO_POS_STATES ? len :\tLZMA_NUM_LEN_TO_POS_STATES - 1)\n\t\t\t\t\t\t<< LZMA_NUM_POS_SLOT_BITS);\n\t\t\t\tuint16_t *prob3;\n\n\t\t\t\tstate += LZMA_NUM_LIT_STATES;\n\t\t\t\tprob3 = p + off3;\n\t\t\t\trc_bit_tree_decode(rc, prob3,\n\t\t\t\t\tLZMA_NUM_POS_SLOT_BITS, &pos_slot);\n\t\t\t\trep0 = pos_slot;\n\t\t\t\tif (pos_slot >= LZMA_START_POS_MODEL_INDEX) {\n\t\t\t\t\tint i2, mi2, num_bits2 = (pos_slot >> 1) - 1;\n\t\t\t\t\trep0 = 2 | (pos_slot & 1);\n\t\t\t\t\tif (pos_slot < LZMA_END_POS_MODEL_INDEX) {\n\t\t\t\t\t\trep0 <<= num_bits2;\n\t\t\t\t\t\tprob3 = p + LZMA_SPEC_POS + rep0 - pos_slot - 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (; num_bits2 != LZMA_NUM_ALIGN_BITS; num_bits2--)\n\t\t\t\t\t\t\trep0 = (rep0 << 1) | rc_direct_bit(rc);\n\t\t\t\t\t\trep0 <<= LZMA_NUM_ALIGN_BITS;\n\t\t\t\t\t\t// Note: (int32_t)rep0 may be < 0 here\n\t\t\t\t\t\t// (I have linux-3.3.4.tar.lzma which has it).\n\t\t\t\t\t\t// I moved the check after \"++rep0 == 0\" check below.\n\t\t\t\t\t\tprob3 = p + LZMA_ALIGN;\n\t\t\t\t\t}\n\t\t\t\t\ti2 = 1;\n\t\t\t\t\tmi2 = 1;\n\t\t\t\t\twhile (num_bits2--) {\n\t\t\t\t\t\tif (rc_get_bit(rc, prob3 + mi2, &mi2))\n\t\t\t\t\t\t\trep0 |= i2;\n\t\t\t\t\t\ti2 <<= 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trep0++;\n\t\t\t\tif ((int32_t)rep0 <= 0) {\n\t\t\t\t\tif (rep0 == 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdbg(\"%d rep0:%d\", __LINE__, rep0);\n\t\t\t\t\tgoto bad;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlen += LZMA_MATCH_MIN_LEN;\n\t\t\t/*\n\t\t\t * LZMA SDK has this optimized:\n\t\t\t * it precalculates size and copies many bytes\n\t\t\t * in a loop with simpler checks, a-la:\n\t\t\t *\tdo\n\t\t\t *\t\t*(dest) = *(dest + ofs);\n\t\t\t *\twhile (++dest != lim);\n\t\t\t * and\n\t\t\t *\tdo {\n\t\t\t *\t\tbuffer[buffer_pos++] = buffer[pos];\n\t\t\t *\t\tif (++pos == header.dict_size)\n\t\t\t *\t\t\tpos = 0;\n\t\t\t *\t} while (--cur_len != 0);\n\t\t\t * Our code is slower (more checks per byte copy):\n\t\t\t */\n IF_NOT_FEATURE_LZMA_FAST(string:)\n\t\t\tdo {\n\t\t\t\tuint32_t pos = (uint32_t)(buffer_pos - rep0);\n\t\t\t\tif ((int32_t)pos < 0) {\n\t\t\t\t\tpos += header.dict_size;\n\t\t\t\t\t/* bug 10436 has an example file where this triggers: */\n\t\t\t\t\t//if ((int32_t)pos < 0)\n\t\t\t\t\t//\tgoto bad;\n\t\t\t\t\t/* more stringent test (see unzip_bad_lzma_1.zip): */\n\t\t\t\t\tif (pos >= buffer_size)\n\t\t\t\t\t\tgoto bad;\n\t\t\t\t}\n\t\t\t\tprevious_byte = buffer[pos];\n IF_NOT_FEATURE_LZMA_FAST(one_byte2:)\n\t\t\t\tbuffer[buffer_pos++] = previous_byte;\n\t\t\t\tif (buffer_pos == header.dict_size) {\n\t\t\t\t\tbuffer_pos = 0;\n\t\t\t\t\tglobal_pos += header.dict_size;\n\t\t\t\t\tnwrote = transformer_write(xstate, buffer, header.dict_size);\n\t\t\t\t\tif (nwrote != (ssize_t)header.dict_size)\n\t\t\t\t\t\tgoto bad;\n\t\t\t\t\tIF_DESKTOP(total_written += header.dict_size;)\n\t\t\t\t}\n\t\t\t\tlen--;\n\t\t\t} while (len != 0 && buffer_pos < header.dst_size);\n\t\t\t/* FIXME: ...........^^^^^\n\t\t\t * shouldn't it be \"global_pos + buffer_pos < header.dst_size\"?\n\t\t\t * It probably should, but it is a \"do we accidentally\n\t\t\t * unpack more bytes than expected?\" check - which\n\t\t\t * never happens for well-formed compression data...\n\t\t\t */\n\t\t}\n\t}\n\n\t{\n\t\tIF_NOT_DESKTOP(int total_written = 0; /* success */)\n\t\tIF_DESKTOP(total_written += buffer_pos;)\n\t\tnwrote = transformer_write(xstate, buffer, buffer_pos);\n\t\tif (nwrote != (ssize_t)buffer_pos) {\n bad:\n\t\t\ttotal_written = (nwrote == -ENOSPC)?xstate->mem_output_size_max:-1;\n\t\t}\n\t\trc_free(rc);\n\t\tfree(p);\n\t\tfree(buffer);\n\t\treturn total_written;\n\t}\n}\n"
  },
  {
    "path": "src/bled/decompress_unxz.c",
    "content": "/*\n * unxz implementation for Bled/busybox\n *\n * Copyright © 2014-2020 Pete Batard <pete@akeo.ie>\n * Based on xz-embedded © Lasse Collin <lasse.collin@tukaani.org> - Public Domain\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\n#define XZ_EXTERN static\n#define XZ_BUFSIZE BB_BUFSIZE\n\n#include \"xz_dec_bcj.c\"\n#include \"xz_dec_lzma2.c\"\n#include \"xz_dec_stream.c\"\n\nstatic void XZ_FUNC xz_crc32_init(void)\n{\n\tif (!global_crc32_table)\n\t\tglobal_crc32_table = crc32_filltable(NULL, 0);\n}\n\nstatic uint32_t XZ_FUNC xz_crc32(const uint8_t *buf, size_t size, uint32_t crc)\n{\n\t// The XZ CRC32 is INVERTED!\n\treturn ~crc32_block_endian0(~crc, buf, size, global_crc32_table);\n}\n\nIF_DESKTOP(long long) int FAST_FUNC unpack_xz_stream(transformer_state_t *xstate)\n{\n\tIF_DESKTOP(long long) int n = 0;\n\tstruct xz_buf b;\n\tstruct xz_dec *s;\n\tenum xz_ret ret = XZ_STREAM_END;\n\tuint8_t *in = NULL, *out = NULL;\n\tssize_t nwrote;\n\n\txz_crc32_init();\n\n\t/*\n\t * Support up to 64 MiB dictionary. The actually needed memory\n\t * is allocated once the headers have been parsed.\n\t */\n\ts = xz_dec_init(XZ_DYNALLOC, 1 << 26);\n\tif (!s)\n\t\tbb_error_msg_and_err(\"memory allocation error\");\n\n\tin = xmalloc(XZ_BUFSIZE);\n\tout = xmalloc(XZ_BUFSIZE);\n\n\tb.in = in;\n\tb.in_pos = 0;\n\tb.in_size = 0;\n\tb.out = out;\n\tb.out_pos = 0;\n\tb.out_size = XZ_BUFSIZE;\n\n\twhile (true) {\n\t\tif (b.in_pos == b.in_size) {\n\t\t\tb.in_size = safe_read(xstate->src_fd, in, XZ_BUFSIZE);\n\t\t\tif ((int)b.in_size < 0)\n\t\t\t\tbb_error_msg_and_err(\"read error (errno: %d)\", errno);\n\t\t\tb.in_pos = 0;\n\t\t}\n\t\tret = xz_dec_run(s, &b);\n\n\t\tif (b.out_pos == XZ_BUFSIZE) {\n\t\t\tnwrote = transformer_write(xstate, b.out, b.out_pos);\n\t\t\tif (nwrote == -ENOSPC) {\n\t\t\t\tret = XZ_BUF_FULL;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tif (nwrote < 0) {\n\t\t\t\tret = XZ_DATA_ERROR;\n\t\t\t\tbb_error_msg_and_err(\"write error (errno: %d)\", errno);\n\t\t\t}\n\t\t\tIF_DESKTOP(n += nwrote;)\n\t\t\tb.out_pos = 0;\n\t\t}\n\n\t\tif (ret == XZ_OK)\n\t\t\tcontinue;\n\n#ifdef XZ_DEC_ANY_CHECK\n\t\tif (ret == XZ_UNSUPPORTED_CHECK) {\n//\t\t\tbb_error_msg(\"unsupported check; not verifying file integrity\");\n\t\t\tcontinue;\n\t\t}\n#endif\n\n\t\tnwrote = transformer_write(xstate, b.out, b.out_pos);\n\t\tif (nwrote == -ENOSPC) {\n\t\t\tret = XZ_BUF_FULL;\n\t\t\tgoto out;\n\t\t}\n\t\tif (nwrote < 0) {\n\t\t\tret = XZ_DATA_ERROR;\n\t\t\tbb_error_msg_and_err(\"write error (errno: %d)\", errno);\n\t\t}\n\t\tIF_DESKTOP(n += nwrote;)\n\n\t\tswitch (ret) {\n\t\tcase XZ_STREAM_END:\n\t\t\tret = XZ_OK;\n\t\t\tgoto out;\n\t\tcase XZ_MEM_ERROR:\n\t\t\tbb_error_msg_and_err(\"memory allocation error\");\n\t\tcase XZ_MEMLIMIT_ERROR:\n\t\t\tbb_error_msg_and_err(\"memory usage limit error\");\n\t\tcase XZ_FORMAT_ERROR:\n\t\t\tbb_error_msg_and_err(\"not a .xz file\");\n\t\tcase XZ_OPTIONS_ERROR:\n\t\t\tbb_error_msg_and_err(\"unsupported XZ header option\");\n\t\tcase XZ_DATA_ERROR:\n\t\t\tbb_error_msg_and_err(\"corrupted archive\");\n\t\tcase XZ_BUF_ERROR:\n\t\t\tbb_error_msg_and_err(\"corrupted buffer\");\n\t\tcase XZ_BUF_FULL:\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbb_error_msg_and_err(\"XZ decompression bug!\");\n\t\t}\n\t}\n\nout:\nerr:\n\txz_dec_end(s);\n\tfree(in);\n\tfree(out);\n\tif (ret == XZ_OK)\n\t\treturn n;\n\telse if (ret == XZ_BUF_FULL)\n\t\treturn xstate->mem_output_size_max;\n\telse\n\t\treturn -ret;\n}\n"
  },
  {
    "path": "src/bled/decompress_unzip.c",
    "content": "/*\n * unzip implementation for Bled/busybox\n *\n * Copyright © 2015-2023 Pete Batard <pete@akeo.ie>\n * Based on mini unzip implementation for busybox © Ed Clark\n * Loosely based on original busybox unzip applet © Laurence Anderson.\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\n#if 0\n# define dbg(...) bb_printf(__VA_ARGS__)\n#else\n# define dbg(...) ((void)0)\n#endif\n\nenum {\n#if BB_BIG_ENDIAN\n\tZIP_FILEHEADER_MAGIC = 0x504b0304,\n\tZIP_CDF_MAGIC        = 0x504b0102, /* CDF item */\n\tZIP_CDE_MAGIC        = 0x504b0506, /* End of CDF */\n\tZIP64_CDE_MAGIC      = 0x504b0606, /* End of Zip64 CDF */\n\tZIP_DD_MAGIC         = 0x504b0708,\n#else\n\tZIP_FILEHEADER_MAGIC = 0x04034b50,\n\tZIP_CDF_MAGIC        = 0x02014b50,\n\tZIP_CDE_MAGIC        = 0x06054b50,\n\tZIP64_CDE_MAGIC      = 0x06064b50,\n\tZIP_DD_MAGIC         = 0x08074b50,\n#endif\n};\n\n#define ZIP_HEADER_LEN 26\n\nPRAGMA_BEGIN_PACKED\ntypedef union {\n\tuint8_t raw[ZIP_HEADER_LEN];\n\tstruct {\n\t\tuint16_t version;               /* 0-1 */\n\t\tuint16_t zip_flags;             /* 2-3 */\n\t\tuint16_t method;                /* 4-5 */\n\t\tuint16_t modtime;               /* 6-7 */\n\t\tuint16_t moddate;               /* 8-9 */\n\t\tuint32_t crc32 PACKED;          /* 10-13 */\n\t\tuint32_t cmpsize PACKED;        /* 14-17 */\n\t\tuint32_t ucmpsize PACKED;       /* 18-21 */\n\t\tuint16_t filename_len;          /* 22-23 */\n\t\tuint16_t extra_len;             /* 24-25 */\n\t\t/* filename follows (not NUL terminated) */\n\t\t/* extra field follows */\n\t\t/* data follows */\n\t} fmt PACKED;\n} zip_header_t; /* PACKED - gcc 4.2.1 doesn't like it (spews warning) */\nPRAGMA_END_PACKED\n\n#define FIX_ENDIANNESS_ZIP(zip) \\\ndo { if (BB_BIG_ENDIAN) { \\\n\t(zip).fmt.method        = SWAP_LE16((zip).fmt.method      ); \\\n\t(zip).fmt.modtime       = SWAP_LE16((zip).fmt.modtime     ); \\\n\t(zip).fmt.moddate       = SWAP_LE16((zip).fmt.moddate     ); \\\n\t(zip).fmt.crc32         = SWAP_LE32((zip).fmt.crc32       ); \\\n\t(zip).fmt.cmpsize       = SWAP_LE32((zip).fmt.cmpsize     ); \\\n\t(zip).fmt.ucmpsize      = SWAP_LE32((zip).fmt.ucmpsize    ); \\\n\t(zip).fmt.filename_len  = SWAP_LE16((zip).fmt.filename_len); \\\n\t(zip).fmt.extra_len     = SWAP_LE16((zip).fmt.extra_len   ); \\\n}} while (0)\n\n#define CDF_HEADER_LEN 42\n\nPRAGMA_BEGIN_PACKED\ntypedef union {\n\tuint8_t raw[CDF_HEADER_LEN];\n\tstruct {\n\t\t/* uint32_t signature; 50 4b 01 02 */\n\t\tuint16_t version_made_by;       /* 0-1 */\n\t\tuint16_t version_needed;        /* 2-3 */\n\t\tuint16_t cdf_flags;             /* 4-5 */\n\t\tuint16_t method;                /* 6-7 */\n\t\tuint16_t modtime;               /* 8-9 */\n\t\tuint16_t moddate;               /* 10-11 */\n\t\tuint32_t crc32;                 /* 12-15 */\n\t\tuint32_t cmpsize;               /* 16-19 */\n\t\tuint32_t ucmpsize;              /* 20-23 */\n\t\tuint16_t filename_len;          /* 24-25 */\n\t\tuint16_t extra_len;             /* 26-27 */\n\t\tuint16_t file_comment_length;   /* 28-29 */\n\t\tuint16_t disk_number_start;     /* 30-31 */\n\t\tuint16_t internal_attributes;   /* 32-33 */\n\t\tuint32_t external_attributes PACKED; /* 34-37 */\n\t\tuint32_t relative_offset_of_local_header PACKED; /* 38-41 */\n\t\t/* filename follows (not NUL terminated) */\n\t\t/* extra field follows */\n\t\t/* file comment follows */\n\t} fmt PACKED;\n} cdf_header_t;\nPRAGMA_END_PACKED\n\n#define FIX_ENDIANNESS_CDF(cdf) \\\ndo { if (BB_BIG_ENDIAN) { \\\n\t(cdf).fmt.version_made_by = SWAP_LE16((cdf).fmt.version_made_by); \\\n\t(cdf).fmt.version_needed  = SWAP_LE16((cdf).fmt.version_needed ); \\\n\t(cdf).fmt.method          = SWAP_LE16((cdf).fmt.method         ); \\\n\t(cdf).fmt.modtime         = SWAP_LE16((cdf).fmt.modtime        ); \\\n\t(cdf).fmt.moddate         = SWAP_LE16((cdf).fmt.moddate        ); \\\n\t(cdf).fmt.crc32           = SWAP_LE32((cdf).fmt.crc32          ); \\\n\t(cdf).fmt.cmpsize         = SWAP_LE32((cdf).fmt.cmpsize        ); \\\n\t(cdf).fmt.ucmpsize        = SWAP_LE32((cdf).fmt.ucmpsize       ); \\\n\t(cdf).fmt.filename_len    = SWAP_LE16((cdf).fmt.filename_len   ); \\\n\t(cdf).fmt.extra_len       = SWAP_LE16((cdf).fmt.extra_len      ); \\\n\t(cdf).fmt.file_comment_length = SWAP_LE16((cdf).fmt.file_comment_length); \\\n\t(cdf).fmt.external_attributes = SWAP_LE32((cdf).fmt.external_attributes); \\\n}} while (0)\n\n#define CDE_LEN 16\n\nPRAGMA_BEGIN_PACKED\ntypedef union {\n\tuint8_t raw[CDE_LEN];\n\tstruct {\n\t\t/* uint32_t signature; 50 4b 05 06 */\n\t\tuint16_t this_disk_no;\n\t\tuint16_t disk_with_cdf_no;\n\t\tuint16_t cdf_entries_on_this_disk;\n\t\tuint16_t cdf_entries_total;\n\t\tuint32_t cdf_size;\n\t\tuint32_t cdf_offset;\n\t\t/* uint16_t archive_comment_length; */\n\t\t/* archive comment follows */\n\t} fmt PACKED;\n} cde_t;\nPRAGMA_END_PACKED\n\n#define FIX_ENDIANNESS_CDE(cde) \\\ndo { if (BB_BIG_ENDIAN) { \\\n\t(cde).fmt.cdf_offset = SWAP_LE32((cde).fmt.cdf_offset); \\\n}} while (0)\n\n/* Extra records */\n#define EXTRA_HEADER_LEN 4\n\nPRAGMA_BEGIN_PACKED\ntypedef union {\n\tuint8_t raw[EXTRA_HEADER_LEN];\n\tstruct {\n\t\tuint16_t tag;\n\t\tuint16_t length;\n\t\t/* extra record follows */\n\t} fmt PACKED;\n} extra_header_t;\nPRAGMA_END_PACKED\n\n#define FIX_ENDIANNESS_EXTRA(ext) \\\ndo { if (BB_BIG_ENDIAN) { \\\n\t(ext).fmt.tag = SWAP_LE16((ext).fmt.tag); \\\n\t(ext).fmt.length = SWAP_LE32((ext).fmt.length); \\\n}} while (0)\n\n/* ZIP64 records */\n#define ZIP64_LEN 20\n\nPRAGMA_BEGIN_PACKED\ntypedef union {\n\tuint8_t raw[ZIP64_LEN];\n\tstruct {\n\t\t/* uint16_t tag; 00 01 */\n\t\tuint16_t tag;\n\t\tuint16_t length;\n\t\tuint64_t ucmpsize PACKED;\n\t\tuint64_t cmpsize PACKED;\n\t} fmt PACKED;\n} zip64_t;\nPRAGMA_END_PACKED\n\n#define FIX_ENDIANNESS_ZIP64(z64) \\\ndo { if (BB_BIG_ENDIAN) { \\\n\t(z64).fmt.cmpsize = SWAP_LE64((z64).fmt.cmpsize); \\\n\t(z64).fmt.ucmpsize = SWAP_LE64((z64).fmt.ucmpsize); \\\n}} while (0)\n\n#define CDE64_LEN 52\n\nPRAGMA_BEGIN_PACKED\ntypedef union {\n\tuint8_t raw[CDE64_LEN];\n\tstruct {\n\t\t/* uint32_t signature; 50 4b 06 06 */\n\t\tuint64_t size PACKED;\n\t\tuint16_t version_made_by;\n\t\tuint16_t version_needed;\n\t\tuint32_t this_disk_no;\n\t\tuint32_t disk_with_cdf_no;\n\t\tuint64_t cdf_entries_on_this_disk PACKED;\n\t\tuint64_t cdf_entries_total PACKED;\n\t\tuint64_t cdf_size PACKED;\n\t\tuint64_t cdf_offset PACKED;\n\t\t/* archive comment follows */\n\t} fmt PACKED;\n} cde64_t;\nPRAGMA_END_PACKED\n\n#define FIX_ENDIANNESS_CDE64(c64) \\\ndo { if (BB_BIG_ENDIAN) { \\\n\t(c64).fmt.size = SWAP_LE64((c64).fmt.size); \\\n\t(c64).fmt.cdf_offset = SWAP_LE64((c64).fmt.cdf_offset); \\\n}} while (0)\n\ninline void BUG(void) {\n\t/* Check the offset of the last element, not the length.  This leniency\n\t * allows for poor packing, whereby the overall struct may be too long,\n\t * even though the elements are all in the right place.\n\t */\n\tBUILD_BUG_ON(\n\t\toffsetof(zip_header_t, fmt.extra_len) + 2\n\t\t\t!= ZIP_HEADER_LEN);\n\tBUILD_BUG_ON(\n\t\toffsetof(cdf_header_t, fmt.relative_offset_of_local_header) + 4\n\t\t\t!= CDF_HEADER_LEN);\n\tBUILD_BUG_ON(sizeof(cde_t) != CDE_LEN);\n\tBUILD_BUG_ON(sizeof(extra_header_t) != EXTRA_HEADER_LEN);\n\tBUILD_BUG_ON(sizeof(zip64_t) != ZIP64_LEN);\n\tBUILD_BUG_ON(sizeof(cde64_t) != CDE64_LEN);\n}\n\n/* This value means that we failed to find CDF */\n#define BAD_CDF_OFFSET ((uint32_t)0xffffffff)\n\n#if !ENABLE_FEATURE_UNZIP_CDF\n\n# define find_cdf_offset(fd) BAD_CDF_OFFSET\n\n#else\n/* Seen in the wild:\n * Self-extracting PRO2K3XP_32.exe contains 19078464 byte zip archive,\n * where CDE was nearly 48 kbytes before EOF.\n * (Surprisingly, it also apparently has *another* CDE structure\n * closer to the end, with bogus cdf_offset).\n * To make extraction work, bumped PEEK_FROM_END from 16k to 64k.\n */\n#define PEEK_FROM_END (64*1024)\n/* NB: does not preserve file position! */\nstatic uint64_t find_cdf_offset(int fd)\n{\n\tcde_t cde;\n\tcde64_t cde64;\n\tunsigned char *buf;\n\tunsigned char *p, c;\n\tuint64_t end = 0, found, size;\n\n\tsize = lseek(fd, 0, SEEK_END);\n\tif (size == (off_t) -1)\n\t\treturn BAD_CDF_OFFSET;\n\t\n\tif (size > PEEK_FROM_END)\n\t\tend = size - PEEK_FROM_END;\n\telse\n\t\tend = 0;\n\n\tsize = MIN(size, PEEK_FROM_END);\n\n\tlseek(fd, end, SEEK_SET);\n\tbuf = xzalloc((size_t)size);\n\tif (buf == NULL)\n\t\treturn 0;\t\n\tfull_read(fd, buf, (unsigned int)size);\n\n\tfound = BAD_CDF_OFFSET;\n\tp = buf;\n\twhile (p <= buf + size - CDE_LEN - 4) {\n\t\tif (*p != 'P') {\n\t\t\tp++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (*++p != 'K')\n\t\t\tcontinue;\n\t\tc = *++p;\n\t\tif (c != 5 && c != 6)\n\t\t\tcontinue;\n\t\tif (*++p != 6)\n\t\t\tcontinue;\n\t\t/* we found CDE! */\n\t\tswitch (c) {\n\t\tcase 5: /* 32-bit CDE */\n\t\t\tmemcpy(cde.raw, p + 1, CDE_LEN);\n\t\t\tdbg(\"cde.this_disk_no:%d\", cde.fmt.this_disk_no);\n\t\t\tdbg(\"cde.disk_with_cdf_no:%d\", cde.fmt.disk_with_cdf_no);\n\t\t\tdbg(\"cde.cdf_entries_on_this_disk:%d\", cde.fmt.cdf_entries_on_this_disk);\n\t\t\tdbg(\"cde.cdf_entries_total:%d\", cde.fmt.cdf_entries_total);\n\t\t\tdbg(\"cde.cdf_size:%d\", cde.fmt.cdf_size);\n\t\t\tdbg(\"cde.cdf_offset:%x\", cde.fmt.cdf_offset);\n\t\t\tFIX_ENDIANNESS_CDE(cde);\n\t\t\t/*\n\t\t\t * I've seen .ZIP files with seemingly valid CDEs\n\t\t\t * where cdf_offset points past EOF - ??\n\t\t\t * This check ignores such CDEs:\n\t\t\t */\n\t\t\tif (cde.fmt.cdf_offset != 0xffffffffL &&\n\t\t\t\tcde.fmt.cdf_offset < end + (p - buf)) {\n\t\t\t\tfound = cde.fmt.cdf_offset;\n\t\t\t\tdbg(\"Possible cdf_offset:0x%\"OFF_FMT\"x at 0x%\"OFF_FMT\"x\",\n\t\t\t\t\tfound, end + (p - 3 - buf));\n\t\t\t\tdbg(\"  cdf_offset+cdf_size:0x%\"OFF_FMT\"x\",\n\t\t\t\t\t(found + SWAP_LE32(cde.fmt.cdf_size)));\n\t\t\t\t/*\n\t\t\t\t * We do not \"break\" here because only the last CDE is valid.\n\t\t\t\t * I've seen a .zip archive which contained a .zip file,\n\t\t\t\t * uncompressed, and taking the first CDE was using\n\t\t\t\t * the CDE inside that file!\n\t\t\t\t */\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 6: /* 64-bit CDE */\n\t\t\tmemcpy(cde64.raw, p + 1, CDE64_LEN);\n\t\t\tFIX_ENDIANNESS_CDE64(cde64);\n\t\t\tdbg(\"cde64.this_disk_no:%d\", cde64.fmt.this_disk_no);\n\t\t\tdbg(\"cde64.disk_with_cdf_no:%d\", cde64.fmt.disk_with_cdf_no);\n\t\t\tdbg(\"cde64.cdf_entries_on_this_disk:%lld\", cde64.fmt.cdf_entries_on_this_disk);\n\t\t\tdbg(\"cde64.cdf_entries_total:%lld\", cde64.fmt.cdf_entries_total);\n\t\t\tdbg(\"cde64.cdf_size:%lld\", cde64.fmt.cdf_size);\n\t\t\tdbg(\"cde64.cdf_offset:%llx\", cde64.fmt.cdf_offset);\n\t\t\tif (cde64.fmt.cdf_offset < end + (p - buf)) {\n\t\t\t\tfound = cde64.fmt.cdf_offset;\n\t\t\t\tdbg(\"Possible cdf_offset:0x%\"OFF_FMT\"x at 0x%\"OFF_FMT\"x\",\n\t\t\t\t\tfound, end + (p - 3 - buf));\n\t\t\t\tdbg(\"  cdf_offset+cdf_size:0x%\"OFF_FMT\"x\",\n\t\t\t\t\t(found + SWAP_LE64(cde64.fmt.cdf_size)));\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tfree(buf);\n\tdbg(\"Found cdf_offset:0x%\"OFF_FMT\"x\", found);\n\treturn found;\n};\n\nstatic uint64_t read_next_cdf(int fd, uint64_t cdf_offset, cdf_header_t *cdf)\n{\n\tuint32_t magic;\n\n\tif (cdf_offset == BAD_CDF_OFFSET)\n\t\treturn cdf_offset;\n\n\tdbg(\"Reading CDF at 0x%\"OFF_FMT\"x\", cdf_offset);\n\tlseek(fd, cdf_offset, SEEK_SET);\n\t(void)_read(fd, &magic, 4);\n\t/* Central Directory End? Assume CDF has ended.\n\t * (more correct method is to use cde.cdf_entries_total counter)\n\t */\n\tif (magic == ZIP_CDE_MAGIC) {\n\t\tdbg(\"got ZIP_CDE_MAGIC\");\n\t\treturn 0; /* EOF */\n\t}\n\tif (magic == ZIP64_CDE_MAGIC) { /* seen in .zip with >4GB files */\n\t\tdbg(\"got ZIP64_CDE_MAGIC\");\n\t\treturn 0; /* EOF */\n\t}\n\t(void)_read(fd, cdf->raw, CDF_HEADER_LEN);\n\n\tFIX_ENDIANNESS_CDF(*cdf);\n\tdbg(\"  magic:%08x filename_len:%u extra_len:%u file_comment_length:%u\",\n\t\tmagic,\n\t\t(unsigned)cdf->fmt.filename_len,\n\t\t(unsigned)cdf->fmt.extra_len,\n\t\t(unsigned)cdf->fmt.file_comment_length\n\t);\n//TODO: require that magic == ZIP_CDF_MAGIC?\n\n\tcdf_offset += 4 + CDF_HEADER_LEN\n\t\t+ cdf->fmt.filename_len\n\t\t+ cdf->fmt.extra_len\n\t\t+ cdf->fmt.file_comment_length;\n\n\tdbg(\"Next cdf_offset 0x%\"OFF_FMT\"x\", cdf_offset);\n\treturn cdf_offset;\n};\n#endif\n\nstatic void die_if_bad_fnamesize(unsigned sz)\n{\n\tif (sz > 0xfff) /* more than 4k?! no funny business please */\n\t\tbb_simple_error_msg_and_die(\"bad archive\");\n}\n\nstatic void unzip_skip(int fd, off_t skip)\n{\n\tif (skip != 0)\n\t\tif (lseek(fd, skip, SEEK_CUR) == (off_t)-1)\n\t\t\tbb_copyfd_exact_size(fd, -1, skip);\n}\n\n/* Set the filename and process extra ZIP64 data */\nstatic void unzip_set_xstate(transformer_state_t* xstate, zip_header_t* zip)\n{\n\tuint8_t* buf = NULL;\n\tuint16_t i = 0;\n\textra_header_t* extra;\n\tzip64_t* zip64;\n\n\t/* Set the default sizes for non ZIP64 content */\n\txstate->dst_size = zip->fmt.ucmpsize;\n\txstate->bytes_in = zip->fmt.cmpsize;\n\n\t/* Set the filename */\n\tdie_if_bad_fnamesize(zip->fmt.filename_len);\n\txstate->dst_name = xzalloc(zip->fmt.filename_len + 1);\n\tif (xstate->dst_name == NULL)\n\t\tgoto err;\n\txread(xstate->src_fd, xstate->dst_name, zip->fmt.filename_len);\n\txstate->dst_name[zip->fmt.filename_len] = 0;\n\n\t/* Read the extra data */\n\tif (zip->fmt.extra_len) {\n\t\tdbg(\"Reading extra data\");\n\t\tbuf = malloc(zip->fmt.extra_len);\n\t\tif (buf == NULL)\n\t\t\tgoto err;\n\t\txread(xstate->src_fd, buf, zip->fmt.extra_len);\n\t}\n\n\t/* Process the extra records */\n\tif (zip->fmt.extra_len < EXTRA_HEADER_LEN + 1)\n\t\tgoto err;\n\tfor (i = 0; i < zip->fmt.extra_len - EXTRA_HEADER_LEN; ) {\n\t\textra = (extra_header_t*)&buf[i];\n\t\tFIX_ENDIANNESS_EXTRA(*extra);\n\t\tdbg(\"  tag:0x%04x len:%u\",\n\t\t\t(unsigned)extra->fmt.tag,\n\t\t\t(unsigned)extra->fmt.length\n\t\t);\n\t\ti += EXTRA_HEADER_LEN + extra->fmt.length;\n\t\t/* Process the ZIP64 data */\n\t\tif (extra->fmt.tag == SWAP_LE16(0x0001)) {\n\t\t\tzip64 = (zip64_t*)extra;\n\t\t\tFIX_ENDIANNESS_ZIP64(*zip64);\n\t\t\tif ((zip->fmt.cmpsize == 0xffffffffL || zip->fmt.ucmpsize == 0xffffffffL) &&\n\t\t\t\tEXTRA_HEADER_LEN + zip64->fmt.length >= ZIP64_LEN) {\n\t\t\t\tdbg(\"Actual cmpsize:0x%\"OFF_FMT\"x ucmpsize:0x%\"OFF_FMT\"x\",\n\t\t\t\t\tzip64->fmt.cmpsize,\n\t\t\t\t\tzip64->fmt.ucmpsize\n\t\t\t\t);\n\t\t\t\txstate->dst_size = zip64->fmt.ucmpsize;\n\t\t\t\txstate->bytes_in = zip64->fmt.cmpsize;\n\t\t\t}\n\t\t}\n\t}\n\nerr:\n\tfree(buf);\n}\n\nstatic IF_DESKTOP(long long) int\nunzip_extract(zip_header_t* zip, transformer_state_t* xstate)\n{\n\tIF_DESKTOP(long long) int n = -EFAULT;\n\n\tif (zip->fmt.method == 0) {\n\t\t/* Method 0 - stored (not compressed) */\n\t\tif (xstate->dst_size) {\n\t\t\tbb_copyfd_exact_size(xstate->src_fd, xstate->dst_fd, xstate->dst_size);\n\t\t}\n\t\treturn xstate->dst_size;\n\t}\n\n\tif (zip->fmt.method == 8) {\n\t\t/* Method 8 - inflate */\n\t\tn = inflate_unzip(xstate);\n\n\t\t/* Validate decompression */\n\t\tif (n >= 0) {\n\t\t\tif (zip->fmt.crc32 != (xstate->crc32 ^ 0xffffffffL)) {\n\t\t\t\tbb_simple_error_msg_and_die(\"crc error\");\n\t\t\t}\n\t\t} else if (n != -ENOSPC) {\n\t\t\tbb_simple_error_msg_and_die(\"inflate error\");\n\t\t}\n\t}\n#if ENABLE_FEATURE_UNZIP_BZIP2\n\telse if (zip->fmt.method == 12) {\n\t\t/* Tested. Unpacker reads too much, but we use CDF\n\t\t * and will seek to the correct beginning of next file.\n\t\t */\n\t\txstate->bytes_out = unpack_bz2_stream(xstate);\n\t\tif ((int64_t)xstate->bytes_out < 0)\n\t\t\tbb_simple_error_msg_and_die(\"inflate error\");\n\t}\n#endif\n#if ENABLE_FEATURE_UNZIP_LZMA\n\telse if (zip->fmt.method == 14) {\n\t\t/* Not tested yet */\n\t\txstate->bytes_out = unpack_lzma_stream(xstate);\n\t\tif ((int64_t)xstate->bytes_out < 0)\n\t\t\tbb_simple_error_msg_and_die(\"inflate error\");\n\t}\n#endif\n#if ENABLE_FEATURE_UNZIP_XZ\n\telse if (zip->fmt.method == 95) {\n\t\t/* Not tested yet */\n\t\txstate->bytes_out = unpack_xz_stream(xstate);\n\t\tif ((int64_t)xstate->bytes_out < 0)\n\t\t\tbb_simple_error_msg_and_die(\"inflate error\");\n\t}\n#endif\n\telse {\n\t\tbb_error_msg_and_die(\"unsupported method %u\", zip->fmt.method);\n\t}\n\n\t/* Validate decompression - size */\n\tif (n != -ENOSPC && xstate->dst_size != xstate->bytes_out) {\n\t\t/* Don't die. Who knows, maybe len calculation\n\t\t * was botched somewhere. After all, crc matched! */\n\t\tbb_simple_error_msg(\"bad length\");\n\t}\n\treturn n;\n}\n\n\nIF_DESKTOP(long long) int FAST_FUNC\nunpack_zip_stream(transformer_state_t *xstate)\n{\n\tIF_DESKTOP(long long) int n = -EFAULT;\n\tbool is_dir = false;\n\tuint64_t cdf_offset = find_cdf_offset(xstate->src_fd);\t/* try to seek to the end, find CDE and CDF start */\n\n\twhile (1) {\n\t\tzip_header_t zip;\n\t\tif (!ENABLE_FEATURE_UNZIP_CDF || cdf_offset == BAD_CDF_OFFSET) {\n\t\t\t/* Normally happens when input is unseekable.\n\t\t\t *\n\t\t\t * Valid ZIP file has Central Directory at the end\n\t\t\t * with central directory file headers (CDFs).\n\t\t\t * After it, there is a Central Directory End structure.\n\t\t\t * CDFs identify what files are in the ZIP and where\n\t\t\t * they are located. This allows ZIP readers to load\n\t\t\t * the list of files without reading the entire ZIP archive.\n\t\t\t * ZIP files may be appended to, only files specified in\n\t\t\t * the CD are valid. Scanning for local file headers is\n\t\t\t * not a correct algorithm.\n\t\t\t *\n\t\t\t * We try to do the above, and resort to \"linear\" reading\n\t\t\t * of ZIP file only if seek failed or CDE wasn't found.\n\t\t\t */\n\t\t\tuint32_t magic;\n\n\t\t\t/* Check magic number */\n\t\t\txread(xstate->src_fd, &magic, 4);\n\t\t\t/* CDF item? Assume there are no more files, exit */\n\t\t\tif (magic == ZIP_CDF_MAGIC) {\n\t\t\t\tdbg(\"got ZIP_CDF_MAGIC\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/* Data descriptor? It was a streaming file, go on */\n\t\t\tif (magic == ZIP_DD_MAGIC) {\n\t\t\t\tdbg(\"got ZIP_DD_MAGIC\");\n\t\t\t\t/* skip over duplicate crc32, cmpsize and ucmpsize */\n\t\t\t\tunzip_skip(xstate->src_fd, 3 * 4);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (magic != ZIP_FILEHEADER_MAGIC)\n\t\t\t\tbb_error_msg_and_die(\"invalid zip magic %08X\", (int)magic);\n\t\t\tdbg(\"got ZIP_FILEHEADER_MAGIC\");\n\n\t\t\txread(xstate->src_fd, zip.raw, ZIP_HEADER_LEN);\n\t\t\tFIX_ENDIANNESS_ZIP(zip);\n\t\t\tif (zip.fmt.zip_flags & SWAP_LE16(0x0008)) {\n\t\t\t\tbb_error_msg_and_die(\"zip flag %s is not supported\",\n\t\t\t\t\t\"8 (streaming)\");\n\t\t\t}\n\t\t}\n#if ENABLE_FEATURE_UNZIP_CDF\n\t\telse {\n\t\t\t/* cdf_offset is valid (and we know the file is seekable) */\n\t\t\tcdf_header_t cdf;\n\t\t\tcdf_offset = read_next_cdf(xstate->src_fd, cdf_offset, &cdf);\n\t\t\tif (cdf_offset == 0) /* EOF? */\n\t\t\t\tbreak;\n# if 1\n\t\t\tlseek(xstate->src_fd,\n\t\t\t\tSWAP_LE32(cdf.fmt.relative_offset_of_local_header) + 4,\n\t\t\t\tSEEK_SET);\n\t\t\txread(xstate->src_fd, zip.raw, ZIP_HEADER_LEN);\n\t\t\tFIX_ENDIANNESS_ZIP(zip);\n\t\t\tif (zip.fmt.zip_flags & SWAP_LE16(0x0008)) {\n\t\t\t\t/* 0x0008 - streaming. [u]cmpsize can be reliably gotten\n\t\t\t\t * only from Central Directory.\n\t\t\t\t */\n\t\t\t\tzip.fmt.crc32 = cdf.fmt.crc32;\n\t\t\t\tzip.fmt.cmpsize = cdf.fmt.cmpsize;\n\t\t\t\tzip.fmt.ucmpsize = cdf.fmt.ucmpsize;\n\t\t\t}\n\t\t\t/* Check for UNIX/DOS/WIN directory */\n\t\t\tis_dir = cdf.fmt.external_attributes & 0x40000010;\n// Seen in some zipfiles: central directory 9 byte extra field contains\n// a subfield with ID 0x5455 and 5 data bytes, which is a Unix-style UTC mtime.\n// Local header version:\n//  u16 0x5455 (\"UT\")\n//  u16 size (1 + 4 * n)\n//  u8  flags: bit 0:mtime is present, bit 1:atime is present, bit 2:ctime is present\n//  u32 mtime\n//  u32 atime\n//  u32 ctime\n// Central header version:\n//  u16 0x5455 (\"UT\")\n//  u16 size (5 (or 1?))\n//  u8  flags: bit 0:mtime is present, bit 1:atime is present, bit 2:ctime is present\n//  u32 mtime (CDF does not store atime/ctime)\n# else\n\t\t\t/* CDF has the same data as local header, no need to read the latter...\n\t\t\t * ...not really. An archive was seen with cdf.extra_len == 6 but\n\t\t\t * zip.extra_len == 0.\n\t\t\t */\n\t\t\tmemcpy(&zip.fmt.version,\n\t\t\t\t&cdf.fmt.version_needed, ZIP_HEADER_LEN);\n\t\t\txlseek(zip_fd,\n\t\t\t\tSWAP_LE32(cdf.fmt.relative_offset_of_local_header) + 4 + ZIP_HEADER_LEN,\n\t\t\t\tSEEK_SET);\n# endif\n\t\t}\n#endif\n\t\tif (cdf_offset == BAD_CDF_OFFSET\n\t\t\t&& (zip.fmt.zip_flags & SWAP_LE16(0x0008))\n\t\t\t) {\n\t\t\t/* If it's a streaming zip, we _require_ CDF */\n\t\t\tbb_error_msg_and_die(\"can't find file table\");\n\t\t}\n\t\tif (zip.fmt.zip_flags & SWAP_LE16(0x0001)) {\n\t\t\t/* 0x0001 - encrypted */\n\t\t\tbb_error_msg_and_die(\"zip flag %s is not supported\",\n\t\t\t\t\t\"1 (encryption)\");\n\t\t}\n\t\tdbg(\"File cmpsize:0x%x extra_len:0x%x ucmpsize:0x%x\",\n\t\t\t(unsigned)zip.fmt.cmpsize,\n\t\t\t(unsigned)zip.fmt.extra_len,\n\t\t\t(unsigned)zip.fmt.ucmpsize\n\t\t);\n\n\t\t/* Sets the file name and set the file sizes using ZIP64 if present */\n\t\tunzip_set_xstate(xstate, &zip);\n\n\t\t/* Handle multiple file switching */\n\t\tif ((!is_dir) && (xstate->dst_dir != NULL) && \n\t\t\t(transformer_switch_file(xstate) < 0)) { \n\t\t\t\tgoto err;\n\t\t}\n\n\t\tn = unzip_extract(&zip, xstate);\n\n\t\t/* Only process the first file if not extracting to a dir */\n\t\tif (xstate->dst_dir == NULL)\n\t\t\tbreak;\n\t}\n\nerr:\n\tif (n > 0)\n\t\treturn xstate->bytes_out;\n\telse if (n == -ENOSPC)\n\t\treturn xstate->mem_output_size_max;\n\telse\n\t\treturn n;\n}\n"
  },
  {
    "path": "src/bled/decompress_unzstd.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Glue for zstd decompression\n * Copyright (c) 2021 Norbert Lange <nolange79@gmail.com>\n * Copyright (c) 2024 Pete Batard <pete@akeo.ie>\n *\n * Based on compress.c from the systemd project,\n * provided by Norbert Lange <nolange79@gmail.com>.\n * Which originally was copied from the streaming_decompression.c\n * example from the zstd project, written by Yann Collet \n * \n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n#include \"zstd_deps.h\"\n#include \"zstd_internal.h\"\n\nALWAYS_INLINE static size_t roundupsize(size_t size, size_t align)\n{\n\treturn (size + align - 1U) & ~(align - 1);\n}\n\nALWAYS_INLINE static IF_DESKTOP(long long) int\nunpack_zstd_stream_inner(transformer_state_t *xstate,\n\tZSTD_DStream *dctx, void *out_buff)\n{\n\tconst U32 zstd_magic = ZSTD_MAGIC;\n\tconst size_t in_allocsize = roundupsize(ZSTD_DStreamInSize(), 1024),\n\t\tout_allocsize = roundupsize(ZSTD_DStreamOutSize(), 1024);\n\n\tIF_DESKTOP(long long int total = 0;)\n\tsize_t last_result = ZSTD_error_maxCode + 1;\n\tssize_t nwrote = 0;\n\tunsigned input_fixup;\n\tvoid *in_buff = (char *)out_buff + out_allocsize;\n\n\tmemcpy(in_buff, &zstd_magic, 4);\n\tinput_fixup = xstate->signature_skipped ? 4 : 0;\n\n\t/* This loop assumes that the input file is one or more concatenated\n\t * zstd streams. This example won't work if there is trailing non-zstd\n\t * data at the end, but streaming decompression in general handles this\n\t * case. ZSTD_decompressStream() returns 0 exactly when the frame is\n\t * completed, and doesn't consume input after the frame.\n\t */\n\tfor (;;) {\n\t\tbool has_error = false;\n\t\tZSTD_inBuffer input;\n\t\tssize_t red;\n\n\t\tred = safe_read(xstate->src_fd, (char *)in_buff + input_fixup, (unsigned int)(in_allocsize - input_fixup));\n\t\tif (red < 0) {\n\t\t\tbb_perror_msg(bb_msg_read_error);\n\t\t\treturn -1;\n\t\t}\n\t\tif (red == 0) {\n\t\t\tbreak;\n\t\t}\n\n\t\tinput.src = in_buff;\n\t\tinput.size = (size_t)red + input_fixup;\n\t\tinput.pos = 0;\n\t\tinput_fixup = 0;\n\n\t\t/* Given a valid frame, zstd won't consume the last byte of the\n\t\t * frame until it has flushed all of the decompressed data of\n\t\t * the frame. So input.pos < input.size means frame is not done\n\t\t * or there is still output available.\n\t\t */\n\t\twhile (input.pos < input.size) {\n\t\t\tZSTD_outBuffer output = { out_buff, out_allocsize, 0 };\n\t\t\t/* The return code is zero if the frame is complete, but\n\t\t\t * there may be multiple frames concatenated together.\n\t\t\t * Zstd will automatically reset the context when a\n\t\t\t * frame is complete. Still, calling ZSTD_DCtx_reset()\n\t\t\t * can be useful to reset the context to a clean state,\n\t\t\t * for instance if the last decompression call returned\n\t\t\t * an error.\n\t\t\t */\n\t\t\tlast_result = ZSTD_decompressStream(dctx, &output, &input);\n\t\t\tif (ZSTD_isError(last_result)) {\n\t\t\t\thas_error = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tnwrote = transformer_write(xstate, output.dst, output.pos);\n\t\t\tif (nwrote < 0 && nwrote != -ENOSPC) {\n\t\t\t\thas_error = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tIF_DESKTOP(total = (nwrote == -ENOSPC) ? xstate->mem_output_size_max : total + output.pos);\n\t\t}\n\t\tif (has_error)\n\t\t\tbreak;\n\t}\n\n\tif (last_result != 0) {\n\t\t/* The last return value from ZSTD_decompressStream did not end\n\t\t * on a frame, but we reached the end of the file! We assume\n\t\t * this is an error, and the input was truncated.\n\t\t */\n\t\tif (last_result == ZSTD_error_maxCode + 1) {\n\t\t\tbb_simple_error_msg(\"could not read zstd data\");\n\t\t} else {\n#if defined(ZSTD_STRIP_ERROR_STRINGS) && ZSTD_STRIP_ERROR_STRINGS == 1\n\t\t\tbb_error_msg(\"zstd decoder error: %u\", (unsigned)last_result);\n#else\n\t\t\tbb_error_msg(\"zstd decoder error: %s\", ZSTD_getErrorName(last_result));\n#endif\n\t\t}\n\t\treturn -1;\n\t}\n\n\treturn IF_DESKTOP(total) + 0;\n}\n\nIF_DESKTOP(long long) int FAST_FUNC\nunpack_zstd_stream(transformer_state_t *xstate)\n{\n\tconst size_t in_allocsize = roundupsize(ZSTD_DStreamInSize(), 1024),\n\t\t   out_allocsize = roundupsize(ZSTD_DStreamOutSize(), 1024);\n\n\tIF_DESKTOP(long long) int result;\n\tvoid *out_buff;\n\tZSTD_DStream *dctx;\n\n\tdctx = ZSTD_createDStream();\n\tif (!dctx) {\n\t\t/* should be the only possibly reason of failure */\n\t\tbb_error_msg_and_die(\"memory exhausted\");\n\t}\n\n\tout_buff = xmalloc(in_allocsize + out_allocsize);\n\n\tresult = unpack_zstd_stream_inner(xstate, dctx, out_buff);\n\tfree(out_buff);\n\tZSTD_freeDStream(dctx);\n\treturn result;\n}\n"
  },
  {
    "path": "src/bled/decompress_vtsi.c",
    "content": "/******************************************************************************\n * decompress_vtsi.c\n *\n * Copyright (c) 2021, longpanda <admin@ventoy.net>\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n *\n */\n\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\n/*\n * Structure of a Ventoy Sparse Image (VTSI) file:\n *\n +---------------------------------\n + sector 0 ~ sector N-1\n +     data area\n +---------------------------------\n + sector N ~ sector M - 1\n +     segment[0]\n +     segment[1]\n +     segment[2]\n +      .....\n +     (may be some align data (segment data aligned with 512) ...)\n +---------------------------------\n + sector M\n +     footer\n +---------------------------------\n *\n * All the integers are in little endian\n * The sector size is fixed 512 for ventoy image file.\n *\n */\n\n#define VTSI_MAGIC 0x0000594F544E4556ULL\t// \"VENTOY\\0\\0\"\n\n#pragma pack(1)\n\ntypedef struct {\n\tuint64_t disk_start_sector;\n\tuint64_t sector_num;\n\tuint64_t data_offset;\n} VTSI_SEGMENT;\n\ntypedef struct {\n\tuint64_t magic;\n\tuint16_t version_major;\n\tuint16_t version_minor;\n\tuint64_t disk_size;\n\tuint32_t disk_signature;\n\tuint32_t foot_chksum;\n\n\tuint32_t segment_num;\n\tuint32_t segment_chksum;\n\tuint64_t segment_offset;\n\n\tuint8_t  reserved[512 - 44];\n} VTSI_FOOTER;\n\n#pragma pack()\n\nextern int __static_assert__[sizeof(VTSI_FOOTER) == 512 ? 1 : -1];\n\n#define MAX_READ_BUF\t(8 * 1024 * 1024)\n\nstatic int check_vtsi_footer(VTSI_FOOTER* footer)\n{\n\tint valid = 0;\n\tuint32_t i, oldsum, calcsum;\n\n\tif (footer->magic != VTSI_MAGIC)\n\t\tbb_error_msg_and_err(\"invalid vtsi magic 0x%llX\", footer->magic);\n\n\t/* check footer checksum */\n\toldsum = footer->foot_chksum;\n\tfooter->foot_chksum = 0;\n\tfor (i = 0, calcsum = 0; i < sizeof(VTSI_FOOTER); i++)\n\t\tcalcsum += *((uint8_t*)footer + i);\n\tcalcsum = ~calcsum;\n\n\tif (calcsum != oldsum)\n\t\tbb_error_msg_and_err(\"invalid vtsi footer chksum 0x%X 0x%X\", calcsum, oldsum);\n\n\t/* check version (if the major doesn't match, we consider that a breaking change occurred) */\n\tif (footer->version_major != 1)\n\t\tbb_error_msg_and_err(\"unsupported vtsi version %d.%d\", footer->version_major, footer->version_minor);\n\n\tvalid = 1;\nerr:\n\treturn valid;\n}\n\nstatic int check_vtsi_segment(VTSI_FOOTER* footer, VTSI_SEGMENT* segment)\n{\n\tint valid = 0;\n\tuint32_t i, oldsum, calcsum;\n\n\t/* check segment checksum */\n\toldsum = footer->segment_chksum;\n\n\tfor (i = 0, calcsum = 0; i < sizeof(VTSI_SEGMENT) * footer->segment_num; i++)\n\t\tcalcsum += *((uint8_t*)segment + i);\n\tcalcsum = ~calcsum;\n\n\tif (calcsum != oldsum)\n\t\tbb_error_msg_and_err(\"invalid vtsi segment chksum 0x%X 0x%X\", calcsum, oldsum);\n\n\tvalid = 1;\nerr:\n\treturn valid;\n}\n\nIF_DESKTOP(long long) int FAST_FUNC unpack_vtsi_stream(transformer_state_t* xstate)\n{\n\tIF_DESKTOP(long long) int n = -EFAULT;\n\tlong long tot = 0;\n\toff_t src_size;\n\tint src_fd = 0;\n\tsize_t wsize = 0;\n\tssize_t retval = 0;\n\tuint64_t seg = 0;\n\tint64_t datalen = 0;\n\tuint64_t phy_offset = 0;\n\tsize_t max_buflen = MAX_READ_BUF;\n\tuint8_t* buf = NULL;\n\tVTSI_SEGMENT* segment = NULL;\n\tVTSI_SEGMENT* cur_seg = NULL;\n\tVTSI_FOOTER footer;\n\n\tif (xstate->dst_dir)\n\t\tbb_error_msg_and_err(\"decompress to dir is not supported\");\n\n\tsrc_fd = xstate->src_fd;\n\tsrc_size = lseek(src_fd, 0, SEEK_END);\n\tlseek(src_fd, src_size - sizeof(VTSI_FOOTER), SEEK_SET);\n\n\tsafe_read(src_fd, &footer, sizeof(footer));\n\tif (!check_vtsi_footer(&footer))\n\t\tgoto err;\n\n\tif (xstate->mem_output_size_max == 512)\n\t\tmax_buflen = 1024;\n\n\tsegment = xmalloc(footer.segment_num * sizeof(VTSI_SEGMENT) + max_buflen);\n\tif (!segment)\n\t\tbb_error_msg_and_err(\"Failed to alloc segment buffer %u\", footer.segment_num);\n\n\tbuf = (uint8_t*)segment + footer.segment_num * sizeof(VTSI_SEGMENT);\n\n\tlseek(src_fd, footer.segment_offset, SEEK_SET);\n\tsafe_read(src_fd, segment, footer.segment_num * sizeof(VTSI_SEGMENT));\n\n\tif (!check_vtsi_segment(&footer, segment))\n\t\tgoto err;\n\n\t/* read data */\n\tlseek(src_fd, 0, SEEK_SET);\n\tfor (seg = 0; seg < footer.segment_num; seg++) {\n\t\tcur_seg = segment + seg;\n\t\tdatalen = (int64_t)cur_seg->sector_num * 512;\n\t\tphy_offset = cur_seg->disk_start_sector * 512;\n\n\t\tif (xstate->mem_output_size_max == 0 && xstate->dst_fd >= 0)\n\t\t\tlseek(xstate->dst_fd, phy_offset, SEEK_SET);\n\n\t\twhile (datalen > 0) {\n\t\t\twsize = MIN((size_t)datalen, max_buflen);\n\t\t\tsafe_read(src_fd, buf, (unsigned int)wsize);\n\n\t\t\tretval = transformer_write(xstate, buf, wsize);\n\t\t\tif (retval != (ssize_t)wsize) {\n\t\t\t\tn = (retval == -ENOSPC) ? xstate->mem_output_size_max : -1;\n\t\t\t\tgoto err;\n\t\t\t}\n\n\t\t\ttot += retval;\n\t\t\tdatalen -= wsize;\n\t\t}\n\t}\n\n\tn = tot;\n\nerr:\n\tif (segment)\n\t\tfree(segment);\n\n\treturn n;\n}\n"
  },
  {
    "path": "src/bled/filter_accept_all.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Copyright (C) 2002 by Glenn McGrath\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\n/* Accept any non-null name, its not really a filter at all */\nchar FAST_FUNC filter_accept_all(archive_handle_t *archive_handle)\n{\n\tif (archive_handle->file_header->name)\n\t\treturn EXIT_SUCCESS;\n\treturn EXIT_FAILURE;\n}\n"
  },
  {
    "path": "src/bled/filter_accept_list.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Copyright (C) 2002 by Glenn McGrath\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\n/*\n * Accept names that are in the accept list, ignoring reject list.\n */\nchar FAST_FUNC filter_accept_list(archive_handle_t *archive_handle)\n{\n\tif (find_list_entry(archive_handle->accept, archive_handle->file_header->name))\n\t\treturn EXIT_SUCCESS;\n\treturn EXIT_FAILURE;\n}\n"
  },
  {
    "path": "src/bled/filter_accept_reject_list.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Copyright (C) 2002 by Glenn McGrath\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\n/*\n * Accept names that are in the accept list and not in the reject list\n */\nchar FAST_FUNC filter_accept_reject_list(archive_handle_t *archive_handle)\n{\n\tconst char *key;\n\tconst llist_t *reject_entry;\n\tconst llist_t *accept_entry;\n\n\tkey = archive_handle->file_header->name;\n\n\t/* If the key is in a reject list fail */\n\treject_entry = find_list_entry2(archive_handle->reject, key);\n\tif (reject_entry) {\n\t\treturn EXIT_FAILURE;\n\t}\n\n\t/* Fail if an accept list was specified and the key wasnt in there */\n\tif (archive_handle->accept) {\n\t\taccept_entry = find_list_entry2(archive_handle->accept, key);\n\t\tif (!accept_entry) {\n\t\t\treturn EXIT_FAILURE;\n\t\t}\n\t}\n\n\t/* Accepted */\n\treturn EXIT_SUCCESS;\n}\n"
  },
  {
    "path": "src/bled/find_list_entry.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Copyright (C) 2002 by Glenn McGrath\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\n/* Find a string in a shell pattern list */\nconst llist_t* FAST_FUNC find_list_entry(const llist_t *list, const char *filename)\n{\n\twhile (list) {\n\t\tif (fnmatch(list->data, filename, 0) == 0) {\n\t\t\treturn list;\n\t\t}\n\t\tlist = list->link;\n\t}\n\treturn NULL;\n}\n\n/* Same, but compares only path components present in pattern\n * (extra trailing path components in filename are assumed to match)\n */\nconst llist_t* FAST_FUNC find_list_entry2(const llist_t *list, const char *filename)\n{\n\tchar buf[PATH_MAX];\n\tint pattern_slash_cnt;\n\tconst char *c;\n\tchar *d;\n\n\twhile (list) {\n\t\tc = list->data;\n\t\tpattern_slash_cnt = 0;\n\t\twhile (*c)\n\t\t\tif (*c++ == '/') pattern_slash_cnt++;\n\t\tc = filename;\n\t\td = buf;\n\t\t/* paranoia is better than buffer overflows */\n\t\twhile (*c && d != buf + sizeof(buf)-1) {\n\t\t\tif (*c == '/' && --pattern_slash_cnt < 0)\n\t\t\t\tbreak;\n\t\t\t*d++ = *c++;\n\t\t}\n\t\t*d = '\\0';\n\t\tif (fnmatch(list->data, buf, 0) == 0) {\n\t\t\treturn list;\n\t\t}\n\t\tlist = list->link;\n\t}\n\treturn NULL;\n}\n"
  },
  {
    "path": "src/bled/fse.h",
    "content": "/* ******************************************************************\n * FSE : Finite State Entropy codec\n * Public Prototypes declaration\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * You can contact the author at :\n * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n#ifndef FSE_H\n#define FSE_H\n\n\n/*-*****************************************\n*  Dependencies\n******************************************/\n#include \"zstd_deps.h\"    /* size_t, ptrdiff_t */\n\n\n/*-*****************************************\n*  FSE_PUBLIC_API : control library symbols visibility\n******************************************/\n#if defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) && defined(__GNUC__) && (__GNUC__ >= 4)\n#  define FSE_PUBLIC_API __attribute__ ((visibility (\"default\")))\n#elif defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1)   /* Visual expected */\n#  define FSE_PUBLIC_API __declspec(dllexport)\n#elif defined(FSE_DLL_IMPORT) && (FSE_DLL_IMPORT==1)\n#  define FSE_PUBLIC_API __declspec(dllimport) /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/\n#else\n#  define FSE_PUBLIC_API\n#endif\n\n/*------   Version   ------*/\n#define FSE_VERSION_MAJOR    0\n#define FSE_VERSION_MINOR    9\n#define FSE_VERSION_RELEASE  0\n\n#define FSE_LIB_VERSION FSE_VERSION_MAJOR.FSE_VERSION_MINOR.FSE_VERSION_RELEASE\n#define FSE_QUOTE(str) #str\n#define FSE_EXPAND_AND_QUOTE(str) FSE_QUOTE(str)\n#define FSE_VERSION_STRING FSE_EXPAND_AND_QUOTE(FSE_LIB_VERSION)\n\n#define FSE_VERSION_NUMBER  (FSE_VERSION_MAJOR *100*100 + FSE_VERSION_MINOR *100 + FSE_VERSION_RELEASE)\nFSE_PUBLIC_API unsigned FSE_versionNumber(void);   /**< library version number; to be used when checking dll version */\n\n\n/*-*****************************************\n*  Tool functions\n******************************************/\nFSE_PUBLIC_API size_t FSE_compressBound(size_t size);       /* maximum compressed size */\n\n/* Error Management */\nFSE_PUBLIC_API unsigned    FSE_isError(size_t code);        /* tells if a return value is an error code */\nFSE_PUBLIC_API const char* FSE_getErrorName(size_t code);   /* provides error code string (useful for debugging) */\n\n\n/*-*****************************************\n*  FSE detailed API\n******************************************/\n/*!\nFSE_compress() does the following:\n1. count symbol occurrence from source[] into table count[] (see hist.h)\n2. normalize counters so that sum(count[]) == Power_of_2 (2^tableLog)\n3. save normalized counters to memory buffer using writeNCount()\n4. build encoding table 'CTable' from normalized counters\n5. encode the data stream using encoding table 'CTable'\n\nFSE_decompress() does the following:\n1. read normalized counters with readNCount()\n2. build decoding table 'DTable' from normalized counters\n3. decode the data stream using decoding table 'DTable'\n\nThe following API allows targeting specific sub-functions for advanced tasks.\nFor example, it's possible to compress several blocks using the same 'CTable',\nor to save and provide normalized distribution using external method.\n*/\n\n/* *** COMPRESSION *** */\n\n/*! FSE_optimalTableLog():\n    dynamically downsize 'tableLog' when conditions are met.\n    It saves CPU time, by using smaller tables, while preserving or even improving compression ratio.\n    @return : recommended tableLog (necessarily <= 'maxTableLog') */\nFSE_PUBLIC_API unsigned FSE_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue);\n\n/*! FSE_normalizeCount():\n    normalize counts so that sum(count[]) == Power_of_2 (2^tableLog)\n    'normalizedCounter' is a table of short, of minimum size (maxSymbolValue+1).\n    useLowProbCount is a boolean parameter which trades off compressed size for\n    faster header decoding. When it is set to 1, the compressed data will be slightly\n    smaller. And when it is set to 0, FSE_readNCount() and FSE_buildDTable() will be\n    faster. If you are compressing a small amount of data (< 2 KB) then useLowProbCount=0\n    is a good default, since header deserialization makes a big speed difference.\n    Otherwise, useLowProbCount=1 is a good default, since the speed difference is small.\n    @return : tableLog,\n              or an errorCode, which can be tested using FSE_isError() */\nFSE_PUBLIC_API size_t FSE_normalizeCount(short* normalizedCounter, unsigned tableLog,\n                    const unsigned* count, size_t srcSize, unsigned maxSymbolValue, unsigned useLowProbCount);\n\n/*! FSE_NCountWriteBound():\n    Provides the maximum possible size of an FSE normalized table, given 'maxSymbolValue' and 'tableLog'.\n    Typically useful for allocation purpose. */\nFSE_PUBLIC_API size_t FSE_NCountWriteBound(unsigned maxSymbolValue, unsigned tableLog);\n\n/*! FSE_writeNCount():\n    Compactly save 'normalizedCounter' into 'buffer'.\n    @return : size of the compressed table,\n              or an errorCode, which can be tested using FSE_isError(). */\nFSE_PUBLIC_API size_t FSE_writeNCount (void* buffer, size_t bufferSize,\n                                 const short* normalizedCounter,\n                                 unsigned maxSymbolValue, unsigned tableLog);\n\n/*! Constructor and Destructor of FSE_CTable.\n    Note that FSE_CTable size depends on 'tableLog' and 'maxSymbolValue' */\ntypedef unsigned FSE_CTable;   /* don't allocate that. It's only meant to be more restrictive than void* */\n\n/*! FSE_buildCTable():\n    Builds `ct`, which must be already allocated, using FSE_createCTable().\n    @return : 0, or an errorCode, which can be tested using FSE_isError() */\nFSE_PUBLIC_API size_t FSE_buildCTable(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog);\n\n/*! FSE_compress_usingCTable():\n    Compress `src` using `ct` into `dst` which must be already allocated.\n    @return : size of compressed data (<= `dstCapacity`),\n              or 0 if compressed data could not fit into `dst`,\n              or an errorCode, which can be tested using FSE_isError() */\nFSE_PUBLIC_API size_t FSE_compress_usingCTable (void* dst, size_t dstCapacity, const void* src, size_t srcSize, const FSE_CTable* ct);\n\n/*!\nTutorial :\n----------\nThe first step is to count all symbols. FSE_count() does this job very fast.\nResult will be saved into 'count', a table of unsigned int, which must be already allocated, and have 'maxSymbolValuePtr[0]+1' cells.\n'src' is a table of bytes of size 'srcSize'. All values within 'src' MUST be <= maxSymbolValuePtr[0]\nmaxSymbolValuePtr[0] will be updated, with its real value (necessarily <= original value)\nFSE_count() will return the number of occurrence of the most frequent symbol.\nThis can be used to know if there is a single symbol within 'src', and to quickly evaluate its compressibility.\nIf there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).\n\nThe next step is to normalize the frequencies.\nFSE_normalizeCount() will ensure that sum of frequencies is == 2 ^'tableLog'.\nIt also guarantees a minimum of 1 to any Symbol with frequency >= 1.\nYou can use 'tableLog'==0 to mean \"use default tableLog value\".\nIf you are unsure of which tableLog value to use, you can ask FSE_optimalTableLog(),\nwhich will provide the optimal valid tableLog given sourceSize, maxSymbolValue, and a user-defined maximum (0 means \"default\").\n\nThe result of FSE_normalizeCount() will be saved into a table,\ncalled 'normalizedCounter', which is a table of signed short.\n'normalizedCounter' must be already allocated, and have at least 'maxSymbolValue+1' cells.\nThe return value is tableLog if everything proceeded as expected.\nIt is 0 if there is a single symbol within distribution.\nIf there is an error (ex: invalid tableLog value), the function will return an ErrorCode (which can be tested using FSE_isError()).\n\n'normalizedCounter' can be saved in a compact manner to a memory area using FSE_writeNCount().\n'buffer' must be already allocated.\nFor guaranteed success, buffer size must be at least FSE_headerBound().\nThe result of the function is the number of bytes written into 'buffer'.\nIf there is an error, the function will return an ErrorCode (which can be tested using FSE_isError(); ex : buffer size too small).\n\n'normalizedCounter' can then be used to create the compression table 'CTable'.\nThe space required by 'CTable' must be already allocated, using FSE_createCTable().\nYou can then use FSE_buildCTable() to fill 'CTable'.\nIf there is an error, both functions will return an ErrorCode (which can be tested using FSE_isError()).\n\n'CTable' can then be used to compress 'src', with FSE_compress_usingCTable().\nSimilar to FSE_count(), the convention is that 'src' is assumed to be a table of char of size 'srcSize'\nThe function returns the size of compressed data (without header), necessarily <= `dstCapacity`.\nIf it returns '0', compressed data could not fit into 'dst'.\nIf there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).\n*/\n\n\n/* *** DECOMPRESSION *** */\n\n/*! FSE_readNCount():\n    Read compactly saved 'normalizedCounter' from 'rBuffer'.\n    @return : size read from 'rBuffer',\n              or an errorCode, which can be tested using FSE_isError().\n              maxSymbolValuePtr[0] and tableLogPtr[0] will also be updated with their respective values */\nFSE_PUBLIC_API size_t FSE_readNCount (short* normalizedCounter,\n                           unsigned* maxSymbolValuePtr, unsigned* tableLogPtr,\n                           const void* rBuffer, size_t rBuffSize);\n\n/*! FSE_readNCount_bmi2():\n * Same as FSE_readNCount() but pass bmi2=1 when your CPU supports BMI2 and 0 otherwise.\n */\nFSE_PUBLIC_API size_t FSE_readNCount_bmi2(short* normalizedCounter,\n                           unsigned* maxSymbolValuePtr, unsigned* tableLogPtr,\n                           const void* rBuffer, size_t rBuffSize, int bmi2);\n\ntypedef unsigned FSE_DTable;   /* don't allocate that. It's just a way to be more restrictive than void* */\n\n/*!\nTutorial :\n----------\n(Note : these functions only decompress FSE-compressed blocks.\n If block is uncompressed, use memcpy() instead\n If block is a single repeated byte, use memset() instead )\n\nThe first step is to obtain the normalized frequencies of symbols.\nThis can be performed by FSE_readNCount() if it was saved using FSE_writeNCount().\n'normalizedCounter' must be already allocated, and have at least 'maxSymbolValuePtr[0]+1' cells of signed short.\nIn practice, that means it's necessary to know 'maxSymbolValue' beforehand,\nor size the table to handle worst case situations (typically 256).\nFSE_readNCount() will provide 'tableLog' and 'maxSymbolValue'.\nThe result of FSE_readNCount() is the number of bytes read from 'rBuffer'.\nNote that 'rBufferSize' must be at least 4 bytes, even if useful information is less than that.\nIf there is an error, the function will return an error code, which can be tested using FSE_isError().\n\nThe next step is to build the decompression tables 'FSE_DTable' from 'normalizedCounter'.\nThis is performed by the function FSE_buildDTable().\nThe space required by 'FSE_DTable' must be already allocated using FSE_createDTable().\nIf there is an error, the function will return an error code, which can be tested using FSE_isError().\n\n`FSE_DTable` can then be used to decompress `cSrc`, with FSE_decompress_usingDTable().\n`cSrcSize` must be strictly correct, otherwise decompression will fail.\nFSE_decompress_usingDTable() result will tell how many bytes were regenerated (<=`dstCapacity`).\nIf there is an error, the function will return an error code, which can be tested using FSE_isError(). (ex: dst buffer too small)\n*/\n\n#endif  /* FSE_H */\n\n\n#if defined(FSE_STATIC_LINKING_ONLY) && !defined(FSE_H_FSE_STATIC_LINKING_ONLY)\n#define FSE_H_FSE_STATIC_LINKING_ONLY\n\n/* *** Dependency *** */\n#include \"fse_bitstream.h\"\n\n\n/* *****************************************\n*  Static allocation\n*******************************************/\n/* FSE buffer bounds */\n#define FSE_NCOUNTBOUND 512\n#define FSE_BLOCKBOUND(size) ((size) + ((size)>>7) + 4 /* fse states */ + sizeof(size_t) /* bitContainer */)\n#define FSE_COMPRESSBOUND(size) (FSE_NCOUNTBOUND + FSE_BLOCKBOUND(size))   /* Macro version, useful for static allocation */\n\n/* It is possible to statically allocate FSE CTable/DTable as a table of FSE_CTable/FSE_DTable using below macros */\n#define FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue)   (1 + (1<<((maxTableLog)-1)) + (((maxSymbolValue)+1)*2))\n#define FSE_DTABLE_SIZE_U32(maxTableLog)                   (1 + (1<<(maxTableLog)))\n\n/* or use the size to malloc() space directly. Pay attention to alignment restrictions though */\n#define FSE_CTABLE_SIZE(maxTableLog, maxSymbolValue)   (FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(FSE_CTable))\n#define FSE_DTABLE_SIZE(maxTableLog)                   (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))\n\n\n/* *****************************************\n *  FSE advanced API\n ***************************************** */\n\nunsigned FSE_optimalTableLog_internal(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus);\n/**< same as FSE_optimalTableLog(), which used `minus==2` */\n\nsize_t FSE_buildCTable_rle (FSE_CTable* ct, unsigned char symbolValue);\n/**< build a fake FSE_CTable, designed to compress always the same symbolValue */\n\n/* FSE_buildCTable_wksp() :\n * Same as FSE_buildCTable(), but using an externally allocated scratch buffer (`workSpace`).\n * `wkspSize` must be >= `FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog)` of `unsigned`.\n * See FSE_buildCTable_wksp() for breakdown of workspace usage.\n */\n#define FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog) (((maxSymbolValue + 2) + (1ull << (tableLog)))/2 + sizeof(U64)/sizeof(U32) /* additional 8 bytes for potential table overwrite */)\n#define FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog) (sizeof(unsigned) * FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog))\nsize_t FSE_buildCTable_wksp(FSE_CTable* ct, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);\n\n#define FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) (sizeof(short) * (maxSymbolValue + 1) + (1ULL << maxTableLog) + 8)\n#define FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) ((FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) + sizeof(unsigned) - 1) / sizeof(unsigned))\nFSE_PUBLIC_API size_t FSE_buildDTable_wksp(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize);\n/**< Same as FSE_buildDTable(), using an externally allocated `workspace` produced with `FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxSymbolValue)` */\n\n#define FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) (FSE_DTABLE_SIZE_U32(maxTableLog) + 1 + FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) + (FSE_MAX_SYMBOL_VALUE + 1) / 2 + 1)\n#define FSE_DECOMPRESS_WKSP_SIZE(maxTableLog, maxSymbolValue) (FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(unsigned))\nsize_t FSE_decompress_wksp_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize, int bmi2);\n/**< same as FSE_decompress(), using an externally allocated `workSpace` produced with `FSE_DECOMPRESS_WKSP_SIZE_U32(maxLog, maxSymbolValue)`.\n * Set bmi2 to 1 if your CPU supports BMI2 or 0 if it doesn't */\n\ntypedef enum {\n   FSE_repeat_none,  /**< Cannot use the previous table */\n   FSE_repeat_check, /**< Can use the previous table but it must be checked */\n   FSE_repeat_valid  /**< Can use the previous table and it is assumed to be valid */\n } FSE_repeat;\n\n/* *****************************************\n*  FSE symbol compression API\n*******************************************/\n/*!\n   This API consists of small unitary functions, which highly benefit from being inlined.\n   Hence their body are included in next section.\n*/\ntypedef struct {\n    ptrdiff_t   value;\n    const void* stateTable;\n    const void* symbolTT;\n    unsigned    stateLog;\n} FSE_CState_t;\n\nstatic void FSE_initCState(FSE_CState_t* CStatePtr, const FSE_CTable* ct);\n\nstatic void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* CStatePtr, unsigned symbol);\n\nstatic void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* CStatePtr);\n\n/**<\nThese functions are inner components of FSE_compress_usingCTable().\nThey allow the creation of custom streams, mixing multiple tables and bit sources.\n\nA key property to keep in mind is that encoding and decoding are done **in reverse direction**.\nSo the first symbol you will encode is the last you will decode, like a LIFO stack.\n\nYou will need a few variables to track your CStream. They are :\n\nFSE_CTable    ct;         // Provided by FSE_buildCTable()\nBIT_CStream_t bitStream;  // bitStream tracking structure\nFSE_CState_t  state;      // State tracking structure (can have several)\n\n\nThe first thing to do is to init bitStream and state.\n    size_t errorCode = BIT_initCStream(&bitStream, dstBuffer, maxDstSize);\n    FSE_initCState(&state, ct);\n\nNote that BIT_initCStream() can produce an error code, so its result should be tested, using FSE_isError();\nYou can then encode your input data, byte after byte.\nFSE_encodeSymbol() outputs a maximum of 'tableLog' bits at a time.\nRemember decoding will be done in reverse direction.\n    FSE_encodeByte(&bitStream, &state, symbol);\n\nAt any time, you can also add any bit sequence.\nNote : maximum allowed nbBits is 25, for compatibility with 32-bits decoders\n    BIT_addBits(&bitStream, bitField, nbBits);\n\nThe above methods don't commit data to memory, they just store it into local register, for speed.\nLocal register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t).\nWriting data to memory is a manual operation, performed by the flushBits function.\n    BIT_flushBits(&bitStream);\n\nYour last FSE encoding operation shall be to flush your last state value(s).\n    FSE_flushState(&bitStream, &state);\n\nFinally, you must close the bitStream.\nThe function returns the size of CStream in bytes.\nIf data couldn't fit into dstBuffer, it will return a 0 ( == not compressible)\nIf there is an error, it returns an errorCode (which can be tested using FSE_isError()).\n    size_t size = BIT_closeCStream(&bitStream);\n*/\n\n\n/* *****************************************\n*  FSE symbol decompression API\n*******************************************/\ntypedef struct {\n    size_t      state;\n    const void* table;   /* precise table may vary, depending on U16 */\n} FSE_DState_t;\n\n\nstatic void     FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt);\n\nstatic unsigned char FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);\n\nstatic unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr);\n\n/**<\nLet's now decompose FSE_decompress_usingDTable() into its unitary components.\nYou will decode FSE-encoded symbols from the bitStream,\nand also any other bitFields you put in, **in reverse order**.\n\nYou will need a few variables to track your bitStream. They are :\n\nBIT_DStream_t DStream;    // Stream context\nFSE_DState_t  DState;     // State context. Multiple ones are possible\nFSE_DTable*   DTablePtr;  // Decoding table, provided by FSE_buildDTable()\n\nThe first thing to do is to init the bitStream.\n    errorCode = BIT_initDStream(&DStream, srcBuffer, srcSize);\n\nYou should then retrieve your initial state(s)\n(in reverse flushing order if you have several ones) :\n    errorCode = FSE_initDState(&DState, &DStream, DTablePtr);\n\nYou can then decode your data, symbol after symbol.\nFor information the maximum number of bits read by FSE_decodeSymbol() is 'tableLog'.\nKeep in mind that symbols are decoded in reverse order, like a LIFO stack (last in, first out).\n    unsigned char symbol = FSE_decodeSymbol(&DState, &DStream);\n\nYou can retrieve any bitfield you eventually stored into the bitStream (in reverse order)\nNote : maximum allowed nbBits is 25, for 32-bits compatibility\n    size_t bitField = BIT_readBits(&DStream, nbBits);\n\nAll above operations only read from local register (which size depends on size_t).\nRefueling the register from memory is manually performed by the reload method.\n    endSignal = FSE_reloadDStream(&DStream);\n\nBIT_reloadDStream() result tells if there is still some more data to read from DStream.\nBIT_DStream_unfinished : there is still some data left into the DStream.\nBIT_DStream_endOfBuffer : Dstream reached end of buffer. Its container may no longer be completely filled.\nBIT_DStream_completed : Dstream reached its exact end, corresponding in general to decompression completed.\nBIT_DStream_tooFar : Dstream went too far. Decompression result is corrupted.\n\nWhen reaching end of buffer (BIT_DStream_endOfBuffer), progress slowly, notably if you decode multiple symbols per loop,\nto properly detect the exact end of stream.\nAfter each decoded symbol, check if DStream is fully consumed using this simple test :\n    BIT_reloadDStream(&DStream) >= BIT_DStream_completed\n\nWhen it's done, verify decompression is fully completed, by checking both DStream and the relevant states.\nChecking if DStream has reached its end is performed by :\n    BIT_endOfDStream(&DStream);\nCheck also the states. There might be some symbols left there, if some high probability ones (>50%) are possible.\n    FSE_endOfDState(&DState);\n*/\n\n\n/* *****************************************\n*  FSE unsafe API\n*******************************************/\nstatic unsigned char FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD);\n/* faster, but works only if nbBits is always >= 1 (otherwise, result will be corrupted) */\n\n\n/* *****************************************\n*  Implementation of inlined functions\n*******************************************/\ntypedef struct {\n    int deltaFindState;\n    U32 deltaNbBits;\n} FSE_symbolCompressionTransform; /* total 8 bytes */\n\nMEM_STATIC void FSE_initCState(FSE_CState_t* statePtr, const FSE_CTable* ct)\n{\n    const void* ptr = ct;\n    const U16* u16ptr = (const U16*) ptr;\n    const U32 tableLog = MEM_read16(ptr);\n    statePtr->value = (ptrdiff_t)1<<tableLog;\n    statePtr->stateTable = u16ptr+2;\n    statePtr->symbolTT = ct + 1 + (tableLog ? (1<<(tableLog-1)) : 1);\n    statePtr->stateLog = tableLog;\n}\n\n\n/*! FSE_initCState2() :\n*   Same as FSE_initCState(), but the first symbol to include (which will be the last to be read)\n*   uses the smallest state value possible, saving the cost of this symbol */\nMEM_STATIC void FSE_initCState2(FSE_CState_t* statePtr, const FSE_CTable* ct, U32 symbol)\n{\n    FSE_initCState(statePtr, ct);\n    {   const FSE_symbolCompressionTransform symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];\n        const U16* stateTable = (const U16*)(statePtr->stateTable);\n        U32 nbBitsOut  = (U32)((symbolTT.deltaNbBits + (1<<15)) >> 16);\n        statePtr->value = (nbBitsOut << 16) - symbolTT.deltaNbBits;\n        statePtr->value = stateTable[(statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];\n    }\n}\n\nMEM_STATIC void FSE_encodeSymbol(BIT_CStream_t* bitC, FSE_CState_t* statePtr, unsigned symbol)\n{\n    FSE_symbolCompressionTransform const symbolTT = ((const FSE_symbolCompressionTransform*)(statePtr->symbolTT))[symbol];\n    const U16* const stateTable = (const U16*)(statePtr->stateTable);\n    U32 const nbBitsOut  = (U32)((statePtr->value + symbolTT.deltaNbBits) >> 16);\n    BIT_addBits(bitC,  (size_t)statePtr->value, nbBitsOut);\n    statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];\n}\n\nMEM_STATIC void FSE_flushCState(BIT_CStream_t* bitC, const FSE_CState_t* statePtr)\n{\n    BIT_addBits(bitC, (size_t)statePtr->value, statePtr->stateLog);\n    BIT_flushBits(bitC);\n}\n\n\n/* FSE_getMaxNbBits() :\n * Approximate maximum cost of a symbol, in bits.\n * Fractional get rounded up (i.e. a symbol with a normalized frequency of 3 gives the same result as a frequency of 2)\n * note 1 : assume symbolValue is valid (<= maxSymbolValue)\n * note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits */\nMEM_STATIC U32 FSE_getMaxNbBits(const void* symbolTTPtr, U32 symbolValue)\n{\n    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;\n    return (symbolTT[symbolValue].deltaNbBits + ((1<<16)-1)) >> 16;\n}\n\n/* FSE_bitCost() :\n * Approximate symbol cost, as fractional value, using fixed-point format (accuracyLog fractional bits)\n * note 1 : assume symbolValue is valid (<= maxSymbolValue)\n * note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits */\nMEM_STATIC U32 FSE_bitCost(const void* symbolTTPtr, U32 tableLog, U32 symbolValue, U32 accuracyLog)\n{\n    const FSE_symbolCompressionTransform* symbolTT = (const FSE_symbolCompressionTransform*) symbolTTPtr;\n    U32 const minNbBits = symbolTT[symbolValue].deltaNbBits >> 16;\n    U32 const threshold = (minNbBits+1) << 16;\n    assert(tableLog < 16);\n    assert(accuracyLog < 31-tableLog);  /* ensure enough room for renormalization double shift */\n    {   U32 const tableSize = 1 << tableLog;\n        U32 const deltaFromThreshold = threshold - (symbolTT[symbolValue].deltaNbBits + tableSize);\n        U32 const normalizedDeltaFromThreshold = (deltaFromThreshold << accuracyLog) >> tableLog;   /* linear interpolation (very approximate) */\n        U32 const bitMultiplier = 1 << accuracyLog;\n        assert(symbolTT[symbolValue].deltaNbBits + tableSize <= threshold);\n        assert(normalizedDeltaFromThreshold <= bitMultiplier);\n        return (minNbBits+1)*bitMultiplier - normalizedDeltaFromThreshold;\n    }\n}\n\n\n/* ======    Decompression    ====== */\n\ntypedef struct {\n    U16 tableLog;\n    U16 fastMode;\n} FSE_DTableHeader;   /* sizeof U32 */\n\ntypedef struct\n{\n    unsigned short newState;\n    unsigned char  symbol;\n    unsigned char  nbBits;\n} FSE_decode_t;   /* size == U32 */\n\nMEM_STATIC void FSE_initDState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD, const FSE_DTable* dt)\n{\n    const void* ptr = dt;\n    const FSE_DTableHeader* const DTableH = (const FSE_DTableHeader*)ptr;\n    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);\n    BIT_reloadDStream(bitD);\n    DStatePtr->table = dt + 1;\n}\n\nMEM_STATIC BYTE FSE_peekSymbol(const FSE_DState_t* DStatePtr)\n{\n    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];\n    return DInfo.symbol;\n}\n\nMEM_STATIC void FSE_updateState(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)\n{\n    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];\n    U32 const nbBits = DInfo.nbBits;\n    size_t const lowBits = BIT_readBits(bitD, nbBits);\n    DStatePtr->state = DInfo.newState + lowBits;\n}\n\nMEM_STATIC BYTE FSE_decodeSymbol(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)\n{\n    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];\n    U32 const nbBits = DInfo.nbBits;\n    BYTE const symbol = DInfo.symbol;\n    size_t const lowBits = BIT_readBits(bitD, nbBits);\n\n    DStatePtr->state = DInfo.newState + lowBits;\n    return symbol;\n}\n\n/*! FSE_decodeSymbolFast() :\n    unsafe, only works if no symbol has a probability > 50% */\nMEM_STATIC BYTE FSE_decodeSymbolFast(FSE_DState_t* DStatePtr, BIT_DStream_t* bitD)\n{\n    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];\n    U32 const nbBits = DInfo.nbBits;\n    BYTE const symbol = DInfo.symbol;\n    size_t const lowBits = BIT_readBitsFast(bitD, nbBits);\n\n    DStatePtr->state = DInfo.newState + lowBits;\n    return symbol;\n}\n\nMEM_STATIC unsigned FSE_endOfDState(const FSE_DState_t* DStatePtr)\n{\n    return DStatePtr->state == 0;\n}\n\n\n\n#ifndef FSE_COMMONDEFS_ONLY\n\n/* **************************************************************\n*  Tuning parameters\n****************************************************************/\n/*!MEMORY_USAGE :\n*  Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.)\n*  Increasing memory usage improves compression ratio\n*  Reduced memory usage can improve speed, due to cache effect\n*  Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */\n#ifndef FSE_MAX_MEMORY_USAGE\n#  define FSE_MAX_MEMORY_USAGE 14\n#endif\n#ifndef FSE_DEFAULT_MEMORY_USAGE\n#  define FSE_DEFAULT_MEMORY_USAGE 13\n#endif\n#if (FSE_DEFAULT_MEMORY_USAGE > FSE_MAX_MEMORY_USAGE)\n#  error \"FSE_DEFAULT_MEMORY_USAGE must be <= FSE_MAX_MEMORY_USAGE\"\n#endif\n\n/*!FSE_MAX_SYMBOL_VALUE :\n*  Maximum symbol value authorized.\n*  Required for proper stack allocation */\n#ifndef FSE_MAX_SYMBOL_VALUE\n#  define FSE_MAX_SYMBOL_VALUE 255\n#endif\n\n/* **************************************************************\n*  template functions type & suffix\n****************************************************************/\n#define FSE_FUNCTION_TYPE BYTE\n#define FSE_FUNCTION_EXTENSION\n#define FSE_DECODE_TYPE FSE_decode_t\n\n\n#endif   /* !FSE_COMMONDEFS_ONLY */\n\n\n/* ***************************************************************\n*  Constants\n*****************************************************************/\n#define FSE_MAX_TABLELOG  (FSE_MAX_MEMORY_USAGE-2)\n#define FSE_MAX_TABLESIZE (1U<<FSE_MAX_TABLELOG)\n#define FSE_MAXTABLESIZE_MASK (FSE_MAX_TABLESIZE-1)\n#define FSE_DEFAULT_TABLELOG (FSE_DEFAULT_MEMORY_USAGE-2)\n#define FSE_MIN_TABLELOG 5\n\n#define FSE_TABLELOG_ABSOLUTE_MAX 15\n#if FSE_MAX_TABLELOG > FSE_TABLELOG_ABSOLUTE_MAX\n#  error \"FSE_MAX_TABLELOG > FSE_TABLELOG_ABSOLUTE_MAX is not supported\"\n#endif\n\n#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)\n\n\n#endif /* FSE_STATIC_LINKING_ONLY */\n\n\n#if defined (__cplusplus)\n}\n#endif\n"
  },
  {
    "path": "src/bled/fse_bitstream.h",
    "content": "/* ******************************************************************\n * bitstream\n * Part of FSE library\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * You can contact the author at :\n * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n#ifndef BITSTREAM_H_MODULE\n#define BITSTREAM_H_MODULE\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n/*\n*  This API consists of small unitary functions, which must be inlined for best performance.\n*  Since link-time-optimization is not available for all compilers,\n*  these functions are defined into a .h to be included.\n*/\n\n/*-****************************************\n*  Dependencies\n******************************************/\n#include \"zstd_mem.h\"            /* unaligned access routines */\n#include \"zstd_compiler.h\"       /* UNLIKELY() */\n#include \"zstd_error_private.h\"  /* error codes and messages */\n#include \"zstd_bits.h\"           /* ZSTD_highbit32 */\n\n\n/*=========================================\n*  Target specific\n=========================================*/\n#ifndef ZSTD_NO_INTRINSICS\n#  if (defined(__BMI__) || defined(__BMI2__)) && defined(__GNUC__)\n#    include <immintrin.h>   /* support for bextr (experimental)/bzhi */\n#  elif defined(__ICCARM__)\n#    include <intrinsics.h>\n#  endif\n#endif\n\n#define STREAM_ACCUMULATOR_MIN_32  25\n#define STREAM_ACCUMULATOR_MIN_64  57\n#define STREAM_ACCUMULATOR_MIN    ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64))\n\n\n/*-******************************************\n*  bitStream encoding API (write forward)\n********************************************/\n/* bitStream can mix input from multiple sources.\n * A critical property of these streams is that they encode and decode in **reverse** direction.\n * So the first bit sequence you add will be the last to be read, like a LIFO stack.\n */\ntypedef struct {\n    size_t bitContainer;\n    unsigned bitPos;\n    char*  startPtr;\n    char*  ptr;\n    char*  endPtr;\n} BIT_CStream_t;\n\nMEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC, void* dstBuffer, size_t dstCapacity);\nMEM_STATIC void   BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits);\nMEM_STATIC void   BIT_flushBits(BIT_CStream_t* bitC);\nMEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC);\n\n/* Start with initCStream, providing the size of buffer to write into.\n*  bitStream will never write outside of this buffer.\n*  `dstCapacity` must be >= sizeof(bitD->bitContainer), otherwise @return will be an error code.\n*\n*  bits are first added to a local register.\n*  Local register is size_t, hence 64-bits on 64-bits systems, or 32-bits on 32-bits systems.\n*  Writing data into memory is an explicit operation, performed by the flushBits function.\n*  Hence keep track how many bits are potentially stored into local register to avoid register overflow.\n*  After a flushBits, a maximum of 7 bits might still be stored into local register.\n*\n*  Avoid storing elements of more than 24 bits if you want compatibility with 32-bits bitstream readers.\n*\n*  Last operation is to close the bitStream.\n*  The function returns the final size of CStream in bytes.\n*  If data couldn't fit into `dstBuffer`, it will return a 0 ( == not storable)\n*/\n\n\n/*-********************************************\n*  bitStream decoding API (read backward)\n**********************************************/\ntypedef size_t BitContainerType;\ntypedef struct {\n    BitContainerType bitContainer;\n    unsigned bitsConsumed;\n    const char* ptr;\n    const char* start;\n    const char* limitPtr;\n} BIT_DStream_t;\n\ntypedef enum { BIT_DStream_unfinished = 0,  /* fully refilled */\n               BIT_DStream_endOfBuffer = 1, /* still some bits left in bitstream */\n               BIT_DStream_completed = 2,   /* bitstream entirely consumed, bit-exact */\n               BIT_DStream_overflow = 3     /* user requested more bits than present in bitstream */\n    } BIT_DStream_status;  /* result of BIT_reloadDStream() */\n\nMEM_STATIC size_t   BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize);\nMEM_STATIC size_t   BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);\nMEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);\nMEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* bitD);\n\n\n/* Start by invoking BIT_initDStream().\n*  A chunk of the bitStream is then stored into a local register.\n*  Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (BitContainerType).\n*  You can then retrieve bitFields stored into the local register, **in reverse order**.\n*  Local register is explicitly reloaded from memory by the BIT_reloadDStream() method.\n*  A reload guarantee a minimum of ((8*sizeof(bitD->bitContainer))-7) bits when its result is BIT_DStream_unfinished.\n*  Otherwise, it can be less than that, so proceed accordingly.\n*  Checking if DStream has reached its end can be performed with BIT_endOfDStream().\n*/\n\n\n/*-****************************************\n*  unsafe API\n******************************************/\nMEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits);\n/* faster, but works only if value is \"clean\", meaning all high bits above nbBits are 0 */\n\nMEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC);\n/* unsafe version; does not check buffer overflow */\n\nMEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);\n/* faster, but works only if nbBits >= 1 */\n\n/*=====    Local Constants   =====*/\nstatic const unsigned BIT_mask[] = {\n    0,          1,         3,         7,         0xF,       0x1F,\n    0x3F,       0x7F,      0xFF,      0x1FF,     0x3FF,     0x7FF,\n    0xFFF,      0x1FFF,    0x3FFF,    0x7FFF,    0xFFFF,    0x1FFFF,\n    0x3FFFF,    0x7FFFF,   0xFFFFF,   0x1FFFFF,  0x3FFFFF,  0x7FFFFF,\n    0xFFFFFF,   0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF,\n    0x3FFFFFFF, 0x7FFFFFFF}; /* up to 31 bits */\n#define BIT_MASK_SIZE (sizeof(BIT_mask) / sizeof(BIT_mask[0]))\n\n/*-**************************************************************\n*  bitStream encoding\n****************************************************************/\n/*! BIT_initCStream() :\n *  `dstCapacity` must be > sizeof(size_t)\n *  @return : 0 if success,\n *            otherwise an error code (can be tested using ERR_isError()) */\nMEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC,\n                                  void* startPtr, size_t dstCapacity)\n{\n    bitC->bitContainer = 0;\n    bitC->bitPos = 0;\n    bitC->startPtr = (char*)startPtr;\n    bitC->ptr = bitC->startPtr;\n    bitC->endPtr = bitC->startPtr + dstCapacity - sizeof(bitC->bitContainer);\n    if (dstCapacity <= sizeof(bitC->bitContainer)) return ERROR(dstSize_tooSmall);\n    return 0;\n}\n\nFORCE_INLINE_TEMPLATE size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits)\n{\n#if defined(STATIC_BMI2) && STATIC_BMI2 == 1 && !defined(ZSTD_NO_INTRINSICS)\n    return  _bzhi_u64(bitContainer, nbBits);\n#else\n    assert(nbBits < BIT_MASK_SIZE);\n    return bitContainer & BIT_mask[nbBits];\n#endif\n}\n\n/*! BIT_addBits() :\n *  can add up to 31 bits into `bitC`.\n *  Note : does not check for register overflow ! */\nMEM_STATIC void BIT_addBits(BIT_CStream_t* bitC,\n                            size_t value, unsigned nbBits)\n{\n    DEBUG_STATIC_ASSERT(BIT_MASK_SIZE == 32);\n    assert(nbBits < BIT_MASK_SIZE);\n    assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8);\n    bitC->bitContainer |= BIT_getLowerBits(value, nbBits) << bitC->bitPos;\n    bitC->bitPos += nbBits;\n}\n\n/*! BIT_addBitsFast() :\n *  works only if `value` is _clean_,\n *  meaning all high bits above nbBits are 0 */\nMEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC,\n                                size_t value, unsigned nbBits)\n{\n    assert((value>>nbBits) == 0);\n    assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8);\n    bitC->bitContainer |= value << bitC->bitPos;\n    bitC->bitPos += nbBits;\n}\n\n/*! BIT_flushBitsFast() :\n *  assumption : bitContainer has not overflowed\n *  unsafe version; does not check buffer overflow */\nMEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC)\n{\n    size_t const nbBytes = bitC->bitPos >> 3;\n    assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8);\n    assert(bitC->ptr <= bitC->endPtr);\n    MEM_writeLEST(bitC->ptr, bitC->bitContainer);\n    bitC->ptr += nbBytes;\n    bitC->bitPos &= 7;\n    bitC->bitContainer >>= nbBytes*8;\n}\n\n/*! BIT_flushBits() :\n *  assumption : bitContainer has not overflowed\n *  safe version; check for buffer overflow, and prevents it.\n *  note : does not signal buffer overflow.\n *  overflow will be revealed later on using BIT_closeCStream() */\nMEM_STATIC void BIT_flushBits(BIT_CStream_t* bitC)\n{\n    size_t const nbBytes = bitC->bitPos >> 3;\n    assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8);\n    assert(bitC->ptr <= bitC->endPtr);\n    MEM_writeLEST(bitC->ptr, bitC->bitContainer);\n    bitC->ptr += nbBytes;\n    if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr;\n    bitC->bitPos &= 7;\n    bitC->bitContainer >>= nbBytes*8;\n}\n\n/*! BIT_closeCStream() :\n *  @return : size of CStream, in bytes,\n *            or 0 if it could not fit into dstBuffer */\nMEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC)\n{\n    BIT_addBitsFast(bitC, 1, 1);   /* endMark */\n    BIT_flushBits(bitC);\n    if (bitC->ptr >= bitC->endPtr) return 0; /* overflow detected */\n    return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0);\n}\n\n\n/*-********************************************************\n*  bitStream decoding\n**********************************************************/\n/*! BIT_initDStream() :\n *  Initialize a BIT_DStream_t.\n * `bitD` : a pointer to an already allocated BIT_DStream_t structure.\n * `srcSize` must be the *exact* size of the bitStream, in bytes.\n * @return : size of stream (== srcSize), or an errorCode if a problem is detected\n */\nMEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize)\n{\n    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }\n\n    bitD->start = (const char*)srcBuffer;\n    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);\n\n    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */\n        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);\n        bitD->bitContainer = MEM_readLEST(bitD->ptr);\n        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];\n          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */\n          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }\n    } else {\n        bitD->ptr   = bitD->start;\n        bitD->bitContainer = *(const BYTE*)(bitD->start);\n        switch(srcSize)\n        {\n        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);\n                ZSTD_FALLTHROUGH;\n\n        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);\n                ZSTD_FALLTHROUGH;\n\n        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);\n                ZSTD_FALLTHROUGH;\n\n        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;\n                ZSTD_FALLTHROUGH;\n\n        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;\n                ZSTD_FALLTHROUGH;\n\n        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;\n                ZSTD_FALLTHROUGH;\n\n        default: break;\n        }\n        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];\n            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;\n            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */\n        }\n        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;\n    }\n\n    return srcSize;\n}\n\nFORCE_INLINE_TEMPLATE size_t BIT_getUpperBits(BitContainerType bitContainer, U32 const start)\n{\n    return bitContainer >> start;\n}\n\nFORCE_INLINE_TEMPLATE size_t BIT_getMiddleBits(BitContainerType bitContainer, U32 const start, U32 const nbBits)\n{\n    U32 const regMask = sizeof(bitContainer)*8 - 1;\n    /* if start > regMask, bitstream is corrupted, and result is undefined */\n    assert(nbBits < BIT_MASK_SIZE);\n    /* x86 transform & ((1 << nbBits) - 1) to bzhi instruction, it is better\n     * than accessing memory. When bmi2 instruction is not present, we consider\n     * such cpus old (pre-Haswell, 2013) and their performance is not of that\n     * importance.\n     */\n#if defined(__x86_64__) || defined(_M_X64)\n    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);\n#else\n    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];\n#endif\n}\n\n/*! BIT_lookBits() :\n *  Provides next n bits from local register.\n *  local register is not modified.\n *  On 32-bits, maxNbBits==24.\n *  On 64-bits, maxNbBits==56.\n * @return : value extracted */\nFORCE_INLINE_TEMPLATE size_t BIT_lookBits(const BIT_DStream_t*  bitD, U32 nbBits)\n{\n    /* arbitrate between double-shift and shift+mask */\n#if 1\n    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,\n     * bitstream is likely corrupted, and result is undefined */\n    return BIT_getMiddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed - nbBits, nbBits);\n#else\n    /* this code path is slower on my os-x laptop */\n    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;\n    return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask);\n#endif\n}\n\n/*! BIT_lookBitsFast() :\n *  unsafe version; only works if nbBits >= 1 */\nMEM_STATIC size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits)\n{\n    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;\n    assert(nbBits >= 1);\n    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);\n}\n\nFORCE_INLINE_TEMPLATE void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits)\n{\n    bitD->bitsConsumed += nbBits;\n}\n\n/*! BIT_readBits() :\n *  Read (consume) next n bits from local register and update.\n *  Pay attention to not read more than nbBits contained into local register.\n * @return : extracted value. */\nFORCE_INLINE_TEMPLATE size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits)\n{\n    size_t const value = BIT_lookBits(bitD, nbBits);\n    BIT_skipBits(bitD, nbBits);\n    return value;\n}\n\n/*! BIT_readBitsFast() :\n *  unsafe version; only works if nbBits >= 1 */\nMEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits)\n{\n    size_t const value = BIT_lookBitsFast(bitD, nbBits);\n    assert(nbBits >= 1);\n    BIT_skipBits(bitD, nbBits);\n    return value;\n}\n\n/*! BIT_reloadDStream_internal() :\n *  Simple variant of BIT_reloadDStream(), with two conditions:\n *  1. bitstream is valid : bitsConsumed <= sizeof(bitD->bitContainer)*8\n *  2. look window is valid after shifted down : bitD->ptr >= bitD->start\n */\nMEM_STATIC BIT_DStream_status BIT_reloadDStream_internal(BIT_DStream_t* bitD)\n{\n    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);\n    bitD->ptr -= bitD->bitsConsumed >> 3;\n    assert(bitD->ptr >= bitD->start);\n    bitD->bitsConsumed &= 7;\n    bitD->bitContainer = MEM_readLEST(bitD->ptr);\n    return BIT_DStream_unfinished;\n}\n\n/*! BIT_reloadDStreamFast() :\n *  Similar to BIT_reloadDStream(), but with two differences:\n *  1. bitsConsumed <= sizeof(bitD->bitContainer)*8 must hold!\n *  2. Returns BIT_DStream_overflow when bitD->ptr < bitD->limitPtr, at this\n *     point you must use BIT_reloadDStream() to reload.\n */\nMEM_STATIC BIT_DStream_status BIT_reloadDStreamFast(BIT_DStream_t* bitD)\n{\n    if (UNLIKELY(bitD->ptr < bitD->limitPtr))\n        return BIT_DStream_overflow;\n    return BIT_reloadDStream_internal(bitD);\n}\n\n/*! BIT_reloadDStream() :\n *  Refill `bitD` from buffer previously set in BIT_initDStream() .\n *  This function is safe, it guarantees it will not never beyond src buffer.\n * @return : status of `BIT_DStream_t` internal register.\n *           when status == BIT_DStream_unfinished, internal register is filled with at least 25 or 57 bits */\nFORCE_INLINE_TEMPLATE BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD)\n{\n    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */\n    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {\n        static const BitContainerType zeroFilled = 0;\n        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */\n        /* overflow detected, erroneous scenario or end of stream: no update */\n        return BIT_DStream_overflow;\n    }\n\n    assert(bitD->ptr >= bitD->start);\n\n    if (bitD->ptr >= bitD->limitPtr) {\n        return BIT_reloadDStream_internal(bitD);\n    }\n    if (bitD->ptr == bitD->start) {\n        /* reached end of bitStream => no update */\n        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;\n        return BIT_DStream_completed;\n    }\n    /* start < ptr < limitPtr => cautious update */\n    {   U32 nbBytes = bitD->bitsConsumed >> 3;\n        BIT_DStream_status result = BIT_DStream_unfinished;\n        if (bitD->ptr - nbBytes < bitD->start) {\n            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */\n            result = BIT_DStream_endOfBuffer;\n        }\n        bitD->ptr -= nbBytes;\n        bitD->bitsConsumed -= nbBytes*8;\n        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */\n        return result;\n    }\n}\n\n/*! BIT_endOfDStream() :\n * @return : 1 if DStream has _exactly_ reached its end (all bits consumed).\n */\nMEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* DStream)\n{\n    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));\n}\n\n#if defined (__cplusplus)\n}\n#endif\n\n#endif /* BITSTREAM_H_MODULE */\n"
  },
  {
    "path": "src/bled/fse_decompress.c",
    "content": "/* ******************************************************************\n * FSE : Finite State Entropy decoder\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *  You can contact the author at :\n *  - FSE source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *  - Public forum : https://groups.google.com/forum/#!forum/lz4c\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n\n\n/* **************************************************************\n*  Includes\n****************************************************************/\n#include \"fse_bitstream.h\"\n#include \"zstd_compiler.h\"\n#define FSE_STATIC_LINKING_ONLY\n#include \"fse.h\"\n#include \"zstd_error_private.h\"\n#include \"zstd_deps.h\"  /* ZSTD_memcpy */\n#include \"zstd_bits.h\"  /* ZSTD_highbit32 */\n\n\n/* **************************************************************\n*  Error Management\n****************************************************************/\n#define FSE_isError ERR_isError\n#define FSE_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)   /* use only *after* variable declarations */\n\n\n/* **************************************************************\n*  Templates\n****************************************************************/\n/*\n  designed to be included\n  for type-specific functions (template emulation in C)\n  Objective is to write these functions only once, for improved maintenance\n*/\n\n/* safety checks */\n#ifndef FSE_FUNCTION_EXTENSION\n#  error \"FSE_FUNCTION_EXTENSION must be defined\"\n#endif\n#ifndef FSE_FUNCTION_TYPE\n#  error \"FSE_FUNCTION_TYPE must be defined\"\n#endif\n\n/* Function names */\n#define FSE_CAT(X,Y) X##Y\n#define FSE_FUNCTION_NAME(X,Y) FSE_CAT(X,Y)\n#define FSE_TYPE_NAME(X,Y) FSE_CAT(X,Y)\n\nstatic size_t FSE_buildDTable_internal(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize)\n{\n    void* const tdPtr = dt+1;   /* because *dt is unsigned, 32-bits aligned on 32-bits */\n    FSE_DECODE_TYPE* const tableDecode = (FSE_DECODE_TYPE*) (tdPtr);\n    U16* symbolNext = (U16*)workSpace;\n    BYTE* spread = (BYTE*)(symbolNext + maxSymbolValue + 1);\n\n    U32 const maxSV1 = maxSymbolValue + 1;\n    U32 const tableSize = 1 << tableLog;\n    U32 highThreshold = tableSize-1;\n\n    /* Sanity Checks */\n    if (FSE_BUILD_DTABLE_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(maxSymbolValue_tooLarge);\n    if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);\n    if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge);\n\n    /* Init, lay down lowprob symbols */\n    {   FSE_DTableHeader DTableH;\n        DTableH.tableLog = (U16)tableLog;\n        DTableH.fastMode = 1;\n        {   S16 const largeLimit= (S16)(1 << (tableLog-1));\n            U32 s;\n            for (s=0; s<maxSV1; s++) {\n                if (normalizedCounter[s]==-1) {\n                    tableDecode[highThreshold--].symbol = (FSE_FUNCTION_TYPE)s;\n                    symbolNext[s] = 1;\n                } else {\n                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;\n                    symbolNext[s] = (U16)normalizedCounter[s];\n        }   }   }\n        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));\n    }\n\n    /* Spread symbols */\n    if (highThreshold == tableSize - 1) {\n        size_t const tableMask = tableSize-1;\n        size_t const step = FSE_TABLESTEP(tableSize);\n        /* First lay down the symbols in order.\n         * We use a uint64_t to lay down 8 bytes at a time. This reduces branch\n         * misses since small blocks generally have small table logs, so nearly\n         * all symbols have counts <= 8. We ensure we have 8 bytes at the end of\n         * our buffer to handle the over-write.\n         */\n        {   U64 const add = 0x0101010101010101ull;\n            size_t pos = 0;\n            U64 sv = 0;\n            U32 s;\n            for (s=0; s<maxSV1; ++s, sv += add) {\n                int i;\n                int const n = normalizedCounter[s];\n                MEM_write64(spread + pos, sv);\n                for (i = 8; i < n; i += 8) {\n                    MEM_write64(spread + pos + i, sv);\n                }\n                pos += (size_t)n;\n        }   }\n        /* Now we spread those positions across the table.\n         * The benefit of doing it in two stages is that we avoid the\n         * variable size inner loop, which caused lots of branch misses.\n         * Now we can run through all the positions without any branch misses.\n         * We unroll the loop twice, since that is what empirically worked best.\n         */\n        {\n            size_t position = 0;\n            size_t s;\n            size_t const unroll = 2;\n            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */\n            for (s = 0; s < (size_t)tableSize; s += unroll) {\n                size_t u;\n                for (u = 0; u < unroll; ++u) {\n                    size_t const uPosition = (position + (u * step)) & tableMask;\n                    tableDecode[uPosition].symbol = spread[s + u];\n                }\n                position = (position + (unroll * step)) & tableMask;\n            }\n            assert(position == 0);\n        }\n    } else {\n        U32 const tableMask = tableSize-1;\n        U32 const step = FSE_TABLESTEP(tableSize);\n        U32 s, position = 0;\n        for (s=0; s<maxSV1; s++) {\n            int i;\n            for (i=0; i<normalizedCounter[s]; i++) {\n                tableDecode[position].symbol = (FSE_FUNCTION_TYPE)s;\n                position = (position + step) & tableMask;\n                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */\n        }   }\n        if (position!=0) return ERROR(GENERIC);   /* position must reach all cells once, otherwise normalizedCounter is incorrect */\n    }\n\n    /* Build Decoding table */\n    {   U32 u;\n        for (u=0; u<tableSize; u++) {\n            FSE_FUNCTION_TYPE const symbol = (FSE_FUNCTION_TYPE)(tableDecode[u].symbol);\n            U32 const nextState = symbolNext[symbol]++;\n            tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) );\n            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);\n    }   }\n\n    return 0;\n}\n\nsize_t FSE_buildDTable_wksp(FSE_DTable* dt, const short* normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize)\n{\n    return FSE_buildDTable_internal(dt, normalizedCounter, maxSymbolValue, tableLog, workSpace, wkspSize);\n}\n\n\n#ifndef FSE_COMMONDEFS_ONLY\n\n/*-*******************************************************\n*  Decompression (Byte symbols)\n*********************************************************/\n\nFORCE_INLINE_TEMPLATE size_t FSE_decompress_usingDTable_generic(\n          void* dst, size_t maxDstSize,\n    const void* cSrc, size_t cSrcSize,\n    const FSE_DTable* dt, const unsigned fast)\n{\n    BYTE* const ostart = (BYTE*) dst;\n    BYTE* op = ostart;\n    BYTE* const omax = op + maxDstSize;\n    BYTE* const olimit = omax-3;\n\n    BIT_DStream_t bitD;\n    FSE_DState_t state1;\n    FSE_DState_t state2;\n\n    /* Init */\n    CHECK_F(BIT_initDStream(&bitD, cSrc, cSrcSize));\n\n    FSE_initDState(&state1, &bitD, dt);\n    FSE_initDState(&state2, &bitD, dt);\n\n    RETURN_ERROR_IF(BIT_reloadDStream(&bitD)==BIT_DStream_overflow, corruption_detected, \"\");\n\n#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)\n\n    /* 4 symbols per loop */\n    for ( ; (BIT_reloadDStream(&bitD)==BIT_DStream_unfinished) & (op<olimit) ; op+=4) {\n        op[0] = FSE_GETSYMBOL(&state1);\n\n        if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */\n            BIT_reloadDStream(&bitD);\n\n        op[1] = FSE_GETSYMBOL(&state2);\n\n        if (FSE_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */\n            { if (BIT_reloadDStream(&bitD) > BIT_DStream_unfinished) { op+=2; break; } }\n\n        op[2] = FSE_GETSYMBOL(&state1);\n\n        if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */\n            BIT_reloadDStream(&bitD);\n\n        op[3] = FSE_GETSYMBOL(&state2);\n    }\n\n    /* tail */\n    /* note : BIT_reloadDStream(&bitD) >= FSE_DStream_partiallyFilled; Ends at exactly BIT_DStream_completed */\n    while (1) {\n        if (op>(omax-2)) return ERROR(dstSize_tooSmall);\n        *op++ = FSE_GETSYMBOL(&state1);\n        if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {\n            *op++ = FSE_GETSYMBOL(&state2);\n            break;\n        }\n\n        if (op>(omax-2)) return ERROR(dstSize_tooSmall);\n        *op++ = FSE_GETSYMBOL(&state2);\n        if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {\n            *op++ = FSE_GETSYMBOL(&state1);\n            break;\n    }   }\n\n    assert(op >= ostart);\n    return (size_t)(op-ostart);\n}\n\ntypedef struct {\n    short ncount[FSE_MAX_SYMBOL_VALUE + 1];\n} FSE_DecompressWksp;\n\n\nFORCE_INLINE_TEMPLATE size_t FSE_decompress_wksp_body(\n        void* dst, size_t dstCapacity,\n        const void* cSrc, size_t cSrcSize,\n        unsigned maxLog, void* workSpace, size_t wkspSize,\n        int bmi2)\n{\n    const BYTE* const istart = (const BYTE*)cSrc;\n    const BYTE* ip = istart;\n    unsigned tableLog;\n    unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE;\n    FSE_DecompressWksp* const wksp = (FSE_DecompressWksp*)workSpace;\n    size_t const dtablePos = sizeof(FSE_DecompressWksp) / sizeof(FSE_DTable);\n    FSE_DTable* const dtable = (FSE_DTable*)workSpace + dtablePos;\n\n    FSE_STATIC_ASSERT((FSE_MAX_SYMBOL_VALUE + 1) % 2 == 0);\n    if (wkspSize < sizeof(*wksp)) return ERROR(GENERIC);\n\n    /* correct offset to dtable depends on this property */\n    FSE_STATIC_ASSERT(sizeof(FSE_DecompressWksp) % sizeof(FSE_DTable) == 0);\n\n    /* normal FSE decoding mode */\n    {   size_t const NCountLength =\n            FSE_readNCount_bmi2(wksp->ncount, &maxSymbolValue, &tableLog, istart, cSrcSize, bmi2);\n        if (FSE_isError(NCountLength)) return NCountLength;\n        if (tableLog > maxLog) return ERROR(tableLog_tooLarge);\n        assert(NCountLength <= cSrcSize);\n        ip += NCountLength;\n        cSrcSize -= NCountLength;\n    }\n\n    if (FSE_DECOMPRESS_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(tableLog_tooLarge);\n    assert(sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog) <= wkspSize);\n    workSpace = (BYTE*)workSpace + sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog);\n    wkspSize -= sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog);\n\n    CHECK_F( FSE_buildDTable_internal(dtable, wksp->ncount, maxSymbolValue, tableLog, workSpace, wkspSize) );\n\n    {\n        const void* ptr = dtable;\n        const FSE_DTableHeader* DTableH = (const FSE_DTableHeader*)ptr;\n        const U32 fastMode = DTableH->fastMode;\n\n        /* select fast mode (static) */\n        if (fastMode) return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, dtable, 1);\n        return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, dtable, 0);\n    }\n}\n\n/* Avoids the FORCE_INLINE of the _body() function. */\nstatic size_t FSE_decompress_wksp_body_default(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize)\n{\n    return FSE_decompress_wksp_body(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, 0);\n}\n\n#if DYNAMIC_BMI2\nBMI2_TARGET_ATTRIBUTE static size_t FSE_decompress_wksp_body_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize)\n{\n    return FSE_decompress_wksp_body(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, 1);\n}\n#endif\n\nsize_t FSE_decompress_wksp_bmi2(void* dst, size_t dstCapacity, const void* cSrc, size_t cSrcSize, unsigned maxLog, void* workSpace, size_t wkspSize, int bmi2)\n{\n#if DYNAMIC_BMI2\n    if (bmi2) {\n        return FSE_decompress_wksp_body_bmi2(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize);\n    }\n#endif\n    (void)bmi2;\n    return FSE_decompress_wksp_body_default(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize);\n}\n\n#endif   /* FSE_COMMONDEFS_ONLY */\n"
  },
  {
    "path": "src/bled/header_list.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\nvoid FAST_FUNC header_list(const file_header_t *file_header)\n{\n//TODO: cpio -vp DIR should output \"DIR/NAME\", not just \"NAME\" */\n\tputs(file_header->name);\n}\n"
  },
  {
    "path": "src/bled/header_skip.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\nvoid FAST_FUNC header_skip(const file_header_t *file_header UNUSED_PARAM)\n{\n}\n"
  },
  {
    "path": "src/bled/header_verbose_list.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\nvoid FAST_FUNC header_verbose_list(const file_header_t *file_header)\n{\n\tstruct tm tm_time;\n\tstruct tm *ptm = &tm_time; //localtime(&file_header->mtime);\n\n#if ENABLE_FEATURE_TAR_UNAME_GNAME\n\tchar uid[sizeof(int)*3 + 2];\n\t/*char gid[sizeof(int)*3 + 2];*/\n\tchar *user;\n\tchar *group;\n\n\tlocaltime_r(&file_header->mtime, ptm);\n\n\tuser = file_header->tar__uname;\n\tif (user == NULL) {\n\t\tsprintf(uid, \"%u\", (unsigned)file_header->uid);\n\t\tuser = uid;\n\t}\n\tgroup = file_header->tar__gname;\n\tif (group == NULL) {\n\t\t/*sprintf(gid, \"%u\", (unsigned)file_header->gid);*/\n\t\tgroup = utoa(file_header->gid);\n\t}\n\tprintf(\"%u %s/%s %9\"OFF_FMT\"u %4u-%02u-%02u %02u:%02u:%02u %s\",\n\t\tfile_header->mode,\n\t\tuser,\n\t\tgroup,\n\t\tfile_header->size,\n\t\t1900 + ptm->tm_year,\n\t\t1 + ptm->tm_mon,\n\t\tptm->tm_mday,\n\t\tptm->tm_hour,\n\t\tptm->tm_min,\n\t\tptm->tm_sec,\n\t\tfile_header->name);\n\n#else /* !FEATURE_TAR_UNAME_GNAME */\n\n\tlocaltime_r(&file_header->mtime, ptm);\n\n\tprintf(\"%u %u/%u %9\"OFF_FMT\"u %4u-%02u-%02u %02u:%02u:%02u %s\",\n\t\tfile_header->mode,\n\t\t(unsigned)file_header->uid,\n\t\t(unsigned)file_header->gid,\n\t\tfile_header->size,\n\t\t1900 + ptm->tm_year,\n\t\t1 + ptm->tm_mon,\n\t\tptm->tm_mday,\n\t\tptm->tm_hour,\n\t\tptm->tm_min,\n\t\tptm->tm_sec,\n\t\tfile_header->name);\n\n#endif /* FEATURE_TAR_UNAME_GNAME */\n\n\t/* NB: GNU tar shows \"->\" for symlinks and \"link to\" for hardlinks */\n\tif (file_header->link_target) {\n\t\tprintf(\" -> %s\", file_header->link_target);\n\t}\n\tbb_putchar('\\n');\n}\n"
  },
  {
    "path": "src/bled/huf.h",
    "content": "/* ******************************************************************\n * huff0 huffman codec,\n * part of Finite State Entropy library\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * You can contact the author at :\n * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n#ifndef HUF_H_298734234\n#define HUF_H_298734234\n\n/* *** Dependencies *** */\n#include \"zstd_deps.h\"    /* size_t */\n#include \"zstd_mem.h\"     /* U32 */\n#define FSE_STATIC_LINKING_ONLY\n#include \"fse.h\"\n\n\n/* ***   Tool functions *** */\n#define HUF_BLOCKSIZE_MAX (128 * 1024)   /**< maximum input size for a single block compressed with HUF_compress */\nsize_t HUF_compressBound(size_t size);   /**< maximum compressed size (worst case) */\n\n/* Error Management */\nunsigned    HUF_isError(size_t code);       /**< tells if a return value is an error code */\nconst char* HUF_getErrorName(size_t code);  /**< provides error code string (useful for debugging) */\n\n\n#define HUF_WORKSPACE_SIZE ((8 << 10) + 512 /* sorting scratch space */)\n#define HUF_WORKSPACE_SIZE_U64 (HUF_WORKSPACE_SIZE / sizeof(U64))\n\n/* *** Constants *** */\n#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */\n#define HUF_TABLELOG_DEFAULT  11      /* default tableLog value when none specified */\n#define HUF_SYMBOLVALUE_MAX  255\n\n#define HUF_TABLELOG_ABSOLUTEMAX  12  /* absolute limit of HUF_MAX_TABLELOG. Beyond that value, code does not work */\n#if (HUF_TABLELOG_MAX > HUF_TABLELOG_ABSOLUTEMAX)\n#  error \"HUF_TABLELOG_MAX is too large !\"\n#endif\n\n\n/* ****************************************\n*  Static allocation\n******************************************/\n/* HUF buffer bounds */\n#define HUF_CTABLEBOUND 129\n#define HUF_BLOCKBOUND(size) (size + (size>>8) + 8)   /* only true when incompressible is pre-filtered with fast heuristic */\n#define HUF_COMPRESSBOUND(size) (HUF_CTABLEBOUND + HUF_BLOCKBOUND(size))   /* Macro version, useful for static allocation */\n\n/* static allocation of HUF's Compression Table */\n/* this is a private definition, just exposed for allocation and strict aliasing purpose. never EVER access its members directly */\ntypedef size_t HUF_CElt;   /* consider it an incomplete type */\n#define HUF_CTABLE_SIZE_ST(maxSymbolValue)   ((maxSymbolValue)+2)   /* Use tables of size_t, for proper alignment */\n#define HUF_CTABLE_SIZE(maxSymbolValue)       (HUF_CTABLE_SIZE_ST(maxSymbolValue) * sizeof(size_t))\n#define HUF_CREATE_STATIC_CTABLE(name, maxSymbolValue) \\\n    HUF_CElt name[HUF_CTABLE_SIZE_ST(maxSymbolValue)] /* no final ; */\n\n/* static allocation of HUF's DTable */\ntypedef U32 HUF_DTable;\n#define HUF_DTABLE_SIZE(maxTableLog)   (1 + (1<<(maxTableLog)))\n#define HUF_CREATE_STATIC_DTABLEX1(DTable, maxTableLog) \\\n        HUF_DTable DTable[HUF_DTABLE_SIZE((maxTableLog)-1)] = { ((U32)((maxTableLog)-1) * 0x01000001) }\n#define HUF_CREATE_STATIC_DTABLEX2(DTable, maxTableLog) \\\n        HUF_DTable DTable[HUF_DTABLE_SIZE(maxTableLog)] = { ((U32)(maxTableLog) * 0x01000001) }\n\n\n/* ****************************************\n*  Advanced decompression functions\n******************************************/\n\n/**\n * Huffman flags bitset.\n * For all flags, 0 is the default value.\n */\ntypedef enum {\n    /**\n     * If compiled with DYNAMIC_BMI2: Set flag only if the CPU supports BMI2 at runtime.\n     * Otherwise: Ignored.\n     */\n    HUF_flags_bmi2 = (1 << 0),\n    /**\n     * If set: Test possible table depths to find the one that produces the smallest header + encoded size.\n     * If unset: Use heuristic to find the table depth.\n     */\n    HUF_flags_optimalDepth = (1 << 1),\n    /**\n     * If set: If the previous table can encode the input, always reuse the previous table.\n     * If unset: If the previous table can encode the input, reuse the previous table if it results in a smaller output.\n     */\n    HUF_flags_preferRepeat = (1 << 2),\n    /**\n     * If set: Sample the input and check if the sample is uncompressible, if it is then don't attempt to compress.\n     * If unset: Always histogram the entire input.\n     */\n    HUF_flags_suspectUncompressible = (1 << 3),\n    /**\n     * If set: Don't use assembly implementations\n     * If unset: Allow using assembly implementations\n     */\n    HUF_flags_disableAsm = (1 << 4),\n    /**\n     * If set: Don't use the fast decoding loop, always use the fallback decoding loop.\n     * If unset: Use the fast decoding loop when possible.\n     */\n    HUF_flags_disableFast = (1 << 5)\n} HUF_flags_e;\n\n\n/* ****************************************\n *  HUF detailed API\n * ****************************************/\n#define HUF_OPTIMAL_DEPTH_THRESHOLD ZSTD_btultra\n\n/*! HUF_compress() does the following:\n *  1. count symbol occurrence from source[] into table count[] using FSE_count() (exposed within \"fse.h\")\n *  2. (optional) refine tableLog using HUF_optimalTableLog()\n *  3. build Huffman table from count using HUF_buildCTable()\n *  4. save Huffman table to memory buffer using HUF_writeCTable()\n *  5. encode the data stream using HUF_compress4X_usingCTable()\n *\n *  The following API allows targeting specific sub-functions for advanced tasks.\n *  For example, it's possible to compress several blocks using the same 'CTable',\n *  or to save and regenerate 'CTable' using external methods.\n */\nunsigned HUF_minTableLog(unsigned symbolCardinality);\nunsigned HUF_cardinality(const unsigned* count, unsigned maxSymbolValue);\nunsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, void* workSpace,\n size_t wkspSize, HUF_CElt* table, const unsigned* count, int flags); /* table is used as scratch space for building and testing tables, not a return value */\nsize_t HUF_writeCTable_wksp(void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog, void* workspace, size_t workspaceSize);\nsize_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable, int flags);\nsize_t HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue);\nint HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue);\n\ntypedef enum {\n   HUF_repeat_none,  /**< Cannot use the previous table */\n   HUF_repeat_check, /**< Can use the previous table but it must be checked. Note : The previous table must have been constructed by HUF_compress{1, 4}X_repeat */\n   HUF_repeat_valid  /**< Can use the previous table and it is assumed to be valid */\n } HUF_repeat;\n\n/** HUF_compress4X_repeat() :\n *  Same as HUF_compress4X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none.\n *  If it uses hufTable it does not modify hufTable or repeat.\n *  If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used.\n *  If preferRepeat then the old table will always be used if valid.\n *  If suspectUncompressible then some sampling checks will be run to potentially skip huffman coding */\nsize_t HUF_compress4X_repeat(void* dst, size_t dstSize,\n                       const void* src, size_t srcSize,\n                       unsigned maxSymbolValue, unsigned tableLog,\n                       void* workSpace, size_t wkspSize,    /**< `workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE */\n                       HUF_CElt* hufTable, HUF_repeat* repeat, int flags);\n\n/** HUF_buildCTable_wksp() :\n *  Same as HUF_buildCTable(), but using externally allocated scratch buffer.\n * `workSpace` must be aligned on 4-bytes boundaries, and its size must be >= HUF_CTABLE_WORKSPACE_SIZE.\n */\n#define HUF_CTABLE_WORKSPACE_SIZE_U32 ((4 * (HUF_SYMBOLVALUE_MAX + 1)) + 192)\n#define HUF_CTABLE_WORKSPACE_SIZE (HUF_CTABLE_WORKSPACE_SIZE_U32 * sizeof(unsigned))\nsize_t HUF_buildCTable_wksp (HUF_CElt* tree,\n                       const unsigned* count, U32 maxSymbolValue, U32 maxNbBits,\n                             void* workSpace, size_t wkspSize);\n\n/*! HUF_readStats() :\n *  Read compact Huffman tree, saved by HUF_writeCTable().\n * `huffWeight` is destination buffer.\n * @return : size read from `src` , or an error Code .\n *  Note : Needed by HUF_readCTable() and HUF_readDTableXn() . */\nsize_t HUF_readStats(BYTE* huffWeight, size_t hwSize,\n                     U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr,\n                     const void* src, size_t srcSize);\n\n/*! HUF_readStats_wksp() :\n * Same as HUF_readStats() but takes an external workspace which must be\n * 4-byte aligned and its size must be >= HUF_READ_STATS_WORKSPACE_SIZE.\n * If the CPU has BMI2 support, pass bmi2=1, otherwise pass bmi2=0.\n */\n#define HUF_READ_STATS_WORKSPACE_SIZE_U32 FSE_DECOMPRESS_WKSP_SIZE_U32(6, HUF_TABLELOG_MAX-1)\n#define HUF_READ_STATS_WORKSPACE_SIZE (HUF_READ_STATS_WORKSPACE_SIZE_U32 * sizeof(unsigned))\nsize_t HUF_readStats_wksp(BYTE* huffWeight, size_t hwSize,\n                          U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr,\n                          const void* src, size_t srcSize,\n                          void* workspace, size_t wkspSize,\n                          int flags);\n\n/** HUF_readCTable() :\n *  Loading a CTable saved with HUF_writeCTable() */\nsize_t HUF_readCTable (HUF_CElt* CTable, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize, unsigned *hasZeroWeights);\n\n/** HUF_getNbBitsFromCTable() :\n *  Read nbBits from CTable symbolTable, for symbol `symbolValue` presumed <= HUF_SYMBOLVALUE_MAX\n *  Note 1 : If symbolValue > HUF_readCTableHeader(symbolTable).maxSymbolValue, returns 0\n *  Note 2 : is not inlined, as HUF_CElt definition is private\n */\nU32 HUF_getNbBitsFromCTable(const HUF_CElt* symbolTable, U32 symbolValue);\n\ntypedef struct {\n    BYTE tableLog;\n    BYTE maxSymbolValue;\n    BYTE unused[sizeof(size_t) - 2];\n} HUF_CTableHeader;\n\n/** HUF_readCTableHeader() :\n *  @returns The header from the CTable specifying the tableLog and the maxSymbolValue.\n */\nHUF_CTableHeader HUF_readCTableHeader(HUF_CElt const* ctable);\n\n/*\n * HUF_decompress() does the following:\n * 1. select the decompression algorithm (X1, X2) based on pre-computed heuristics\n * 2. build Huffman table from save, using HUF_readDTableX?()\n * 3. decode 1 or 4 segments in parallel using HUF_decompress?X?_usingDTable()\n */\n\n/** HUF_selectDecoder() :\n *  Tells which decoder is likely to decode faster,\n *  based on a set of pre-computed metrics.\n * @return : 0==HUF_decompress4X1, 1==HUF_decompress4X2 .\n *  Assumption : 0 < dstSize <= 128 KB */\nU32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize);\n\n/**\n *  The minimum workspace size for the `workSpace` used in\n *  HUF_readDTableX1_wksp() and HUF_readDTableX2_wksp().\n *\n *  The space used depends on HUF_TABLELOG_MAX, ranging from ~1500 bytes when\n *  HUF_TABLE_LOG_MAX=12 to ~1850 bytes when HUF_TABLE_LOG_MAX=15.\n *  Buffer overflow errors may potentially occur if code modifications result in\n *  a required workspace size greater than that specified in the following\n *  macro.\n */\n#define HUF_DECOMPRESS_WORKSPACE_SIZE ((2 << 10) + (1 << 9))\n#define HUF_DECOMPRESS_WORKSPACE_SIZE_U32 (HUF_DECOMPRESS_WORKSPACE_SIZE / sizeof(U32))\n\n\n/* ====================== */\n/* single stream variants */\n/* ====================== */\n\nsize_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable, int flags);\n/** HUF_compress1X_repeat() :\n *  Same as HUF_compress1X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none.\n *  If it uses hufTable it does not modify hufTable or repeat.\n *  If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used.\n *  If preferRepeat then the old table will always be used if valid.\n *  If suspectUncompressible then some sampling checks will be run to potentially skip huffman coding */\nsize_t HUF_compress1X_repeat(void* dst, size_t dstSize,\n                       const void* src, size_t srcSize,\n                       unsigned maxSymbolValue, unsigned tableLog,\n                       void* workSpace, size_t wkspSize,   /**< `workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE */\n                       HUF_CElt* hufTable, HUF_repeat* repeat, int flags);\n\nsize_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags);\n#ifndef HUF_FORCE_DECOMPRESS_X1\nsize_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags);   /**< double-symbols decoder */\n#endif\n\n/* BMI2 variants.\n * If the CPU has BMI2 support, pass bmi2=1, otherwise pass bmi2=0.\n */\nsize_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int flags);\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags);\n#endif\nsize_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int flags);\nsize_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags);\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int flags);\n#endif\n#ifndef HUF_FORCE_DECOMPRESS_X1\nsize_t HUF_readDTableX2_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int flags);\n#endif\n\n#endif   /* HUF_H_298734234 */\n\n#if defined (__cplusplus)\n}\n#endif\n"
  },
  {
    "path": "src/bled/huf_decompress.c",
    "content": "/* ******************************************************************\n * huff0 huffman decoder,\n * part of Finite State Entropy library\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *  You can contact the author at :\n *  - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n\n/* **************************************************************\n*  Dependencies\n****************************************************************/\n#include \"zstd_deps.h\"  /* ZSTD_memcpy, ZSTD_memset */\n#include \"zstd_compiler.h\"\n#include \"fse_bitstream.h\"  /* BIT_* */\n#include \"fse.h\"        /* to compress headers */\n#include \"huf.h\"\n#include \"zstd_error_private.h\"\n#include \"zstd_internal.h\"\n#include \"zstd_bits.h\"       /* ZSTD_highbit32, ZSTD_countTrailingZeros64 */\n\n/* **************************************************************\n*  Constants\n****************************************************************/\n\n#define HUF_DECODER_FAST_TABLELOG 11\n\n/* **************************************************************\n*  Macros\n****************************************************************/\n\n#ifdef HUF_DISABLE_FAST_DECODE\n# define HUF_ENABLE_FAST_DECODE 0\n#else\n# define HUF_ENABLE_FAST_DECODE 1\n#endif\n\n/* These two optional macros force the use one way or another of the two\n * Huffman decompression implementations. You can't force in both directions\n * at the same time.\n */\n#if defined(HUF_FORCE_DECOMPRESS_X1) && \\\n    defined(HUF_FORCE_DECOMPRESS_X2)\n#error \"Cannot force the use of the X1 and X2 decoders at the same time!\"\n#endif\n\n/* When DYNAMIC_BMI2 is enabled, fast decoders are only called when bmi2 is\n * supported at runtime, so we can add the BMI2 target attribute.\n * When it is disabled, we will still get BMI2 if it is enabled statically.\n */\n#if DYNAMIC_BMI2\n# define HUF_FAST_BMI2_ATTRS BMI2_TARGET_ATTRIBUTE\n#else\n# define HUF_FAST_BMI2_ATTRS\n#endif\n\n#ifdef __cplusplus\n# define HUF_EXTERN_C extern \"C\"\n#else\n# define HUF_EXTERN_C\n#endif\n#define HUF_ASM_DECL HUF_EXTERN_C\n\n#if DYNAMIC_BMI2\n# define HUF_NEED_BMI2_FUNCTION 1\n#else\n# define HUF_NEED_BMI2_FUNCTION 0\n#endif\n\n/* **************************************************************\n*  Error Management\n****************************************************************/\n#define HUF_isError ERR_isError\n\n\n/* **************************************************************\n*  Byte alignment for workSpace management\n****************************************************************/\n#define HUF_ALIGN(x, a)         HUF_ALIGN_MASK((x), (a) - 1)\n#define HUF_ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask))\n\n\n/* **************************************************************\n*  BMI2 Variant Wrappers\n****************************************************************/\ntypedef size_t (*HUF_DecompressUsingDTableFn)(void *dst, size_t dstSize,\n                                              const void *cSrc,\n                                              size_t cSrcSize,\n                                              const HUF_DTable *DTable);\n\n#if DYNAMIC_BMI2\n\n#define HUF_DGEN(fn)                                                        \\\n                                                                            \\\n    static size_t fn##_default(                                             \\\n                  void* dst,  size_t dstSize,                               \\\n            const void* cSrc, size_t cSrcSize,                              \\\n            const HUF_DTable* DTable)                                       \\\n    {                                                                       \\\n        return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable);             \\\n    }                                                                       \\\n                                                                            \\\n    static BMI2_TARGET_ATTRIBUTE size_t fn##_bmi2(                          \\\n                  void* dst,  size_t dstSize,                               \\\n            const void* cSrc, size_t cSrcSize,                              \\\n            const HUF_DTable* DTable)                                       \\\n    {                                                                       \\\n        return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable);             \\\n    }                                                                       \\\n                                                                            \\\n    static size_t fn(void* dst, size_t dstSize, void const* cSrc,           \\\n                     size_t cSrcSize, HUF_DTable const* DTable, int flags)  \\\n    {                                                                       \\\n        if (flags & HUF_flags_bmi2) {                                       \\\n            return fn##_bmi2(dst, dstSize, cSrc, cSrcSize, DTable);         \\\n        }                                                                   \\\n        return fn##_default(dst, dstSize, cSrc, cSrcSize, DTable);          \\\n    }\n\n#else\n\n#define HUF_DGEN(fn)                                                        \\\n    static size_t fn(void* dst, size_t dstSize, void const* cSrc,           \\\n                     size_t cSrcSize, HUF_DTable const* DTable, int flags)  \\\n    {                                                                       \\\n        (void)flags;                                                        \\\n        return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable);             \\\n    }\n\n#endif\n\n\n/*-***************************/\n/*  generic DTableDesc       */\n/*-***************************/\ntypedef struct { BYTE maxTableLog; BYTE tableType; BYTE tableLog; BYTE reserved; } DTableDesc;\n\nstatic DTableDesc HUF_getDTableDesc(const HUF_DTable* table)\n{\n    DTableDesc dtd;\n    ZSTD_memcpy(&dtd, table, sizeof(dtd));\n    return dtd;\n}\n\nstatic size_t HUF_initFastDStream(BYTE const* ip) {\n    BYTE const lastByte = ip[7];\n    size_t const bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;\n    size_t const value = MEM_readLEST(ip) | 1;\n    assert(bitsConsumed <= 8);\n    assert(sizeof(size_t) == 8);\n    return value << bitsConsumed;\n}\n\n\n/**\n * The input/output arguments to the Huffman fast decoding loop:\n *\n * ip [in/out] - The input pointers, must be updated to reflect what is consumed.\n * op [in/out] - The output pointers, must be updated to reflect what is written.\n * bits [in/out] - The bitstream containers, must be updated to reflect the current state.\n * dt [in] - The decoding table.\n * ilowest [in] - The beginning of the valid range of the input. Decoders may read\n *                down to this pointer. It may be below iend[0].\n * oend [in] - The end of the output stream. op[3] must not cross oend.\n * iend [in] - The end of each input stream. ip[i] may cross iend[i],\n *             as long as it is above ilowest, but that indicates corruption.\n */\ntypedef struct {\n    BYTE const* ip[4];\n    BYTE* op[4];\n    U64 bits[4];\n    void const* dt;\n    BYTE const* ilowest;\n    BYTE* oend;\n    BYTE const* iend[4];\n} HUF_DecompressFastArgs;\n\ntypedef void (*HUF_DecompressFastLoopFn)(HUF_DecompressFastArgs*);\n\n/**\n * Initializes args for the fast decoding loop.\n * @returns 1 on success\n *          0 if the fallback implementation should be used.\n *          Or an error code on failure.\n */\nstatic size_t HUF_DecompressFastArgs_init(HUF_DecompressFastArgs* args, void* dst, size_t dstSize, void const* src, size_t srcSize, const HUF_DTable* DTable)\n{\n    void const* dt = DTable + 1;\n    U32 const dtLog = HUF_getDTableDesc(DTable).tableLog;\n\n    const BYTE* const istart = (const BYTE*)src;\n\n    BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize);\n\n    /* The fast decoding loop assumes 64-bit little-endian.\n     * This condition is false on x32.\n     */\n    if (!MEM_isLittleEndian() || MEM_32bits())\n        return 0;\n\n    /* Avoid nullptr addition */\n    if (dstSize == 0)\n        return 0;\n    assert(dst != NULL);\n\n    /* strict minimum : jump table + 1 byte per stream */\n    if (srcSize < 10)\n        return ERROR(corruption_detected);\n\n    /* Must have at least 8 bytes per stream because we don't handle initializing smaller bit containers.\n     * If table log is not correct at this point, fallback to the old decoder.\n     * On small inputs we don't have enough data to trigger the fast loop, so use the old decoder.\n     */\n    if (dtLog != HUF_DECODER_FAST_TABLELOG)\n        return 0;\n\n    /* Read the jump table. */\n    {\n        size_t const length1 = MEM_readLE16(istart);\n        size_t const length2 = MEM_readLE16(istart+2);\n        size_t const length3 = MEM_readLE16(istart+4);\n        size_t const length4 = srcSize - (length1 + length2 + length3 + 6);\n        args->iend[0] = istart + 6;  /* jumpTable */\n        args->iend[1] = args->iend[0] + length1;\n        args->iend[2] = args->iend[1] + length2;\n        args->iend[3] = args->iend[2] + length3;\n\n        /* HUF_initFastDStream() requires this, and this small of an input\n         * won't benefit from the ASM loop anyways.\n         */\n        if (length1 < 8 || length2 < 8 || length3 < 8 || length4 < 8)\n            return 0;\n        if (length4 > srcSize) return ERROR(corruption_detected);   /* overflow */\n    }\n    /* ip[] contains the position that is currently loaded into bits[]. */\n    args->ip[0] = args->iend[1] - sizeof(U64);\n    args->ip[1] = args->iend[2] - sizeof(U64);\n    args->ip[2] = args->iend[3] - sizeof(U64);\n    args->ip[3] = (BYTE const*)src + srcSize - sizeof(U64);\n\n    /* op[] contains the output pointers. */\n    args->op[0] = (BYTE*)dst;\n    args->op[1] = args->op[0] + (dstSize+3)/4;\n    args->op[2] = args->op[1] + (dstSize+3)/4;\n    args->op[3] = args->op[2] + (dstSize+3)/4;\n\n    /* No point to call the ASM loop for tiny outputs. */\n    if (args->op[3] >= oend)\n        return 0;\n\n    /* bits[] is the bit container.\n        * It is read from the MSB down to the LSB.\n        * It is shifted left as it is read, and zeros are\n        * shifted in. After the lowest valid bit a 1 is\n        * set, so that CountTrailingZeros(bits[]) can be used\n        * to count how many bits we've consumed.\n        */\n    args->bits[0] = HUF_initFastDStream(args->ip[0]);\n    args->bits[1] = HUF_initFastDStream(args->ip[1]);\n    args->bits[2] = HUF_initFastDStream(args->ip[2]);\n    args->bits[3] = HUF_initFastDStream(args->ip[3]);\n\n    /* The decoders must be sure to never read beyond ilowest.\n     * This is lower than iend[0], but allowing decoders to read\n     * down to ilowest can allow an extra iteration or two in the\n     * fast loop.\n     */\n    args->ilowest = istart;\n\n    args->oend = oend;\n    args->dt = dt;\n\n    return 1;\n}\n\nstatic size_t HUF_initRemainingDStream(BIT_DStream_t* bit, HUF_DecompressFastArgs const* args, int stream, BYTE* segmentEnd)\n{\n    /* Validate that we haven't overwritten. */\n    if (args->op[stream] > segmentEnd)\n        return ERROR(corruption_detected);\n    /* Validate that we haven't read beyond iend[].\n        * Note that ip[] may be < iend[] because the MSB is\n        * the next bit to read, and we may have consumed 100%\n        * of the stream, so down to iend[i] - 8 is valid.\n        */\n    if (args->ip[stream] < args->iend[stream] - 8)\n        return ERROR(corruption_detected);\n\n    /* Construct the BIT_DStream_t. */\n    assert(sizeof(size_t) == 8);\n    bit->bitContainer = MEM_readLEST(args->ip[stream]);\n    bit->bitsConsumed = ZSTD_countTrailingZeros64(args->bits[stream]);\n    bit->start = (const char*)args->ilowest;\n    bit->limitPtr = bit->start + sizeof(size_t);\n    bit->ptr = (const char*)args->ip[stream];\n\n    return 0;\n}\n\n/* Calls X(N) for each stream 0, 1, 2, 3. */\n#define HUF_4X_FOR_EACH_STREAM(X) \\\n    do {                          \\\n        X(0);                     \\\n        X(1);                     \\\n        X(2);                     \\\n        X(3);                     \\\n    } while (0)\n\n/* Calls X(N, var) for each stream 0, 1, 2, 3. */\n#define HUF_4X_FOR_EACH_STREAM_WITH_VAR(X, var) \\\n    do {                                        \\\n        X(0, (var));                            \\\n        X(1, (var));                            \\\n        X(2, (var));                            \\\n        X(3, (var));                            \\\n    } while (0)\n\n\n#ifndef HUF_FORCE_DECOMPRESS_X2\n\n/*-***************************/\n/*  single-symbol decoding   */\n/*-***************************/\ntypedef struct { BYTE nbBits; BYTE byte; } HUF_DEltX1;   /* single-symbol decoding */\n\n/**\n * Packs 4 HUF_DEltX1 structs into a U64. This is used to lay down 4 entries at\n * a time.\n */\nstatic U64 HUF_DEltX1_set4(BYTE symbol, BYTE nbBits) {\n    U64 D4;\n    if (MEM_isLittleEndian()) {\n        D4 = (U64)((symbol << 8) + nbBits);\n    } else {\n        D4 = (U64)(symbol + (nbBits << 8));\n    }\n    assert(D4 < (1U << 16));\n    D4 *= 0x0001000100010001ULL;\n    return D4;\n}\n\n/**\n * Increase the tableLog to targetTableLog and rescales the stats.\n * If tableLog > targetTableLog this is a no-op.\n * @returns New tableLog\n */\nstatic U32 HUF_rescaleStats(BYTE* huffWeight, U32* rankVal, U32 nbSymbols, U32 tableLog, U32 targetTableLog)\n{\n    if (tableLog > targetTableLog)\n        return tableLog;\n    if (tableLog < targetTableLog) {\n        U32 const scale = targetTableLog - tableLog;\n        U32 s;\n        /* Increase the weight for all non-zero probability symbols by scale. */\n        for (s = 0; s < nbSymbols; ++s) {\n            huffWeight[s] += (BYTE)((huffWeight[s] == 0) ? 0 : scale);\n        }\n        /* Update rankVal to reflect the new weights.\n         * All weights except 0 get moved to weight + scale.\n         * Weights [1, scale] are empty.\n         */\n        for (s = targetTableLog; s > scale; --s) {\n            rankVal[s] = rankVal[s - scale];\n        }\n        for (s = scale; s > 0; --s) {\n            rankVal[s] = 0;\n        }\n    }\n    return targetTableLog;\n}\n\ntypedef struct {\n        U32 rankVal[HUF_TABLELOG_ABSOLUTEMAX + 1];\n        U32 rankStart[HUF_TABLELOG_ABSOLUTEMAX + 1];\n        U32 statsWksp[HUF_READ_STATS_WORKSPACE_SIZE_U32];\n        BYTE symbols[HUF_SYMBOLVALUE_MAX + 1];\n        BYTE huffWeight[HUF_SYMBOLVALUE_MAX + 1];\n} HUF_ReadDTableX1_Workspace;\n\nsize_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int flags)\n{\n    U32 tableLog = 0;\n    U32 nbSymbols = 0;\n    size_t iSize;\n    void* const dtPtr = DTable + 1;\n    HUF_DEltX1* const dt = (HUF_DEltX1*)dtPtr;\n    HUF_ReadDTableX1_Workspace* wksp = (HUF_ReadDTableX1_Workspace*)workSpace;\n\n    DEBUG_STATIC_ASSERT(HUF_DECOMPRESS_WORKSPACE_SIZE >= sizeof(*wksp));\n    if (sizeof(*wksp) > wkspSize) return ERROR(tableLog_tooLarge);\n\n    DEBUG_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUF_DTable));\n    /* ZSTD_memset(huffWeight, 0, sizeof(huffWeight)); */   /* is not necessary, even though some analyzer complain ... */\n\n    iSize = HUF_readStats_wksp(wksp->huffWeight, HUF_SYMBOLVALUE_MAX + 1, wksp->rankVal, &nbSymbols, &tableLog, src, srcSize, wksp->statsWksp, sizeof(wksp->statsWksp), flags);\n    if (HUF_isError(iSize)) return iSize;\n\n\n    /* Table header */\n    {   DTableDesc dtd = HUF_getDTableDesc(DTable);\n        U32 const maxTableLog = dtd.maxTableLog + 1;\n        U32 const targetTableLog = MIN(maxTableLog, HUF_DECODER_FAST_TABLELOG);\n        tableLog = HUF_rescaleStats(wksp->huffWeight, wksp->rankVal, nbSymbols, tableLog, targetTableLog);\n        if (tableLog > (U32)(dtd.maxTableLog+1)) return ERROR(tableLog_tooLarge);   /* DTable too small, Huffman tree cannot fit in */\n        dtd.tableType = 0;\n        dtd.tableLog = (BYTE)tableLog;\n        ZSTD_memcpy(DTable, &dtd, sizeof(dtd));\n    }\n\n    /* Compute symbols and rankStart given rankVal:\n     *\n     * rankVal already contains the number of values of each weight.\n     *\n     * symbols contains the symbols ordered by weight. First are the rankVal[0]\n     * weight 0 symbols, followed by the rankVal[1] weight 1 symbols, and so on.\n     * symbols[0] is filled (but unused) to avoid a branch.\n     *\n     * rankStart contains the offset where each rank belongs in the DTable.\n     * rankStart[0] is not filled because there are no entries in the table for\n     * weight 0.\n     */\n    {   int n;\n        U32 nextRankStart = 0;\n        int const unroll = 4;\n        int const nLimit = (int)nbSymbols - unroll + 1;\n        for (n=0; n<(int)tableLog+1; n++) {\n            U32 const curr = nextRankStart;\n            nextRankStart += wksp->rankVal[n];\n            wksp->rankStart[n] = curr;\n        }\n        for (n=0; n < nLimit; n += unroll) {\n            int u;\n            for (u=0; u < unroll; ++u) {\n                size_t const w = wksp->huffWeight[n+u];\n                wksp->symbols[wksp->rankStart[w]++] = (BYTE)(n+u);\n            }\n        }\n        for (; n < (int)nbSymbols; ++n) {\n            size_t const w = wksp->huffWeight[n];\n            wksp->symbols[wksp->rankStart[w]++] = (BYTE)n;\n        }\n    }\n\n    /* fill DTable\n     * We fill all entries of each weight in order.\n     * That way length is a constant for each iteration of the outer loop.\n     * We can switch based on the length to a different inner loop which is\n     * optimized for that particular case.\n     */\n    {   U32 w;\n        int symbol = wksp->rankVal[0];\n        int rankStart = 0;\n        for (w=1; w<tableLog+1; ++w) {\n            int const symbolCount = wksp->rankVal[w];\n            int const length = (1 << w) >> 1;\n            int uStart = rankStart;\n            BYTE const nbBits = (BYTE)(tableLog + 1 - w);\n            int s;\n            int u;\n            switch (length) {\n            case 1:\n                for (s=0; s<symbolCount; ++s) {\n                    HUF_DEltX1 D;\n                    D.byte = wksp->symbols[symbol + s];\n                    D.nbBits = nbBits;\n                    dt[uStart] = D;\n                    uStart += 1;\n                }\n                break;\n            case 2:\n                for (s=0; s<symbolCount; ++s) {\n                    HUF_DEltX1 D;\n                    D.byte = wksp->symbols[symbol + s];\n                    D.nbBits = nbBits;\n                    dt[uStart+0] = D;\n                    dt[uStart+1] = D;\n                    uStart += 2;\n                }\n                break;\n            case 4:\n                for (s=0; s<symbolCount; ++s) {\n                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);\n                    MEM_write64(dt + uStart, D4);\n                    uStart += 4;\n                }\n                break;\n            case 8:\n                for (s=0; s<symbolCount; ++s) {\n                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);\n                    MEM_write64(dt + uStart, D4);\n                    MEM_write64(dt + uStart + 4, D4);\n                    uStart += 8;\n                }\n                break;\n            default:\n                for (s=0; s<symbolCount; ++s) {\n                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);\n                    for (u=0; u < length; u += 16) {\n                        MEM_write64(dt + uStart + u + 0, D4);\n                        MEM_write64(dt + uStart + u + 4, D4);\n                        MEM_write64(dt + uStart + u + 8, D4);\n                        MEM_write64(dt + uStart + u + 12, D4);\n                    }\n                    assert(u == length);\n                    uStart += length;\n                }\n                break;\n            }\n            symbol += symbolCount;\n            rankStart += symbolCount * length;\n        }\n    }\n    return iSize;\n}\n\nFORCE_INLINE_TEMPLATE BYTE\nHUF_decodeSymbolX1(BIT_DStream_t* Dstream, const HUF_DEltX1* dt, const U32 dtLog)\n{\n    size_t const val = BIT_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */\n    BYTE const c = dt[val].byte;\n    BIT_skipBits(Dstream, dt[val].nbBits);\n    return c;\n}\n\n#define HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr) \\\n    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)\n\n#define HUF_DECODE_SYMBOLX1_1(ptr, DStreamPtr)      \\\n    do {                                            \\\n        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \\\n            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \\\n    } while (0)\n\n#define HUF_DECODE_SYMBOLX1_2(ptr, DStreamPtr)      \\\n    do {                                            \\\n        if (MEM_64bits())                           \\\n            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \\\n    } while (0)\n\nHINT_INLINE size_t\nHUF_decodeStreamX1(BYTE* p, BIT_DStream_t* const bitDPtr, BYTE* const pEnd, const HUF_DEltX1* const dt, const U32 dtLog)\n{\n    BYTE* const pStart = p;\n\n    /* up to 4 symbols at a time */\n    if ((pEnd - p) > 3) {\n        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-3)) {\n            HUF_DECODE_SYMBOLX1_2(p, bitDPtr);\n            HUF_DECODE_SYMBOLX1_1(p, bitDPtr);\n            HUF_DECODE_SYMBOLX1_2(p, bitDPtr);\n            HUF_DECODE_SYMBOLX1_0(p, bitDPtr);\n        }\n    } else {\n        BIT_reloadDStream(bitDPtr);\n    }\n\n    /* [0-3] symbols remaining */\n    if (MEM_32bits())\n        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd))\n            HUF_DECODE_SYMBOLX1_0(p, bitDPtr);\n\n    /* no more data to retrieve from bitstream, no need to reload */\n    while (p < pEnd)\n        HUF_DECODE_SYMBOLX1_0(p, bitDPtr);\n\n    return (size_t)(pEnd-pStart);\n}\n\nFORCE_INLINE_TEMPLATE size_t\nHUF_decompress1X1_usingDTable_internal_body(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    BYTE* op = (BYTE*)dst;\n    BYTE* const oend = ZSTD_maybeNullPtrAdd(op, dstSize);\n    const void* dtPtr = DTable + 1;\n    const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;\n    BIT_DStream_t bitD;\n    DTableDesc const dtd = HUF_getDTableDesc(DTable);\n    U32 const dtLog = dtd.tableLog;\n\n    CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) );\n\n    HUF_decodeStreamX1(op, &bitD, oend, dt, dtLog);\n\n    if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected);\n\n    return dstSize;\n}\n\n/* HUF_decompress4X1_usingDTable_internal_body():\n * Conditions :\n * @dstSize >= 6\n */\nFORCE_INLINE_TEMPLATE size_t\nHUF_decompress4X1_usingDTable_internal_body(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    /* Check */\n    if (cSrcSize < 10) return ERROR(corruption_detected);  /* strict minimum : jump table + 1 byte per stream */\n    if (dstSize < 6) return ERROR(corruption_detected);         /* stream 4-split doesn't work */\n\n    {   const BYTE* const istart = (const BYTE*) cSrc;\n        BYTE* const ostart = (BYTE*) dst;\n        BYTE* const oend = ostart + dstSize;\n        BYTE* const olimit = oend - 3;\n        const void* const dtPtr = DTable + 1;\n        const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;\n\n        /* Init */\n        BIT_DStream_t bitD1;\n        BIT_DStream_t bitD2;\n        BIT_DStream_t bitD3;\n        BIT_DStream_t bitD4;\n        size_t const length1 = MEM_readLE16(istart);\n        size_t const length2 = MEM_readLE16(istart+2);\n        size_t const length3 = MEM_readLE16(istart+4);\n        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);\n        const BYTE* const istart1 = istart + 6;  /* jumpTable */\n        const BYTE* const istart2 = istart1 + length1;\n        const BYTE* const istart3 = istart2 + length2;\n        const BYTE* const istart4 = istart3 + length3;\n        const size_t segmentSize = (dstSize+3) / 4;\n        BYTE* const opStart2 = ostart + segmentSize;\n        BYTE* const opStart3 = opStart2 + segmentSize;\n        BYTE* const opStart4 = opStart3 + segmentSize;\n        BYTE* op1 = ostart;\n        BYTE* op2 = opStart2;\n        BYTE* op3 = opStart3;\n        BYTE* op4 = opStart4;\n        DTableDesc const dtd = HUF_getDTableDesc(DTable);\n        U32 const dtLog = dtd.tableLog;\n        U32 endSignal = 1;\n\n        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */\n        if (opStart4 > oend) return ERROR(corruption_detected);      /* overflow */\n        assert(dstSize >= 6); /* validated above */\n        CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );\n        CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );\n        CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );\n        CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );\n\n        /* up to 16 symbols per loop (4 symbols per stream) in 64-bit mode */\n        if ((size_t)(oend - op4) >= sizeof(size_t)) {\n            for ( ; (endSignal) & (op4 < olimit) ; ) {\n                HUF_DECODE_SYMBOLX1_2(op1, &bitD1);\n                HUF_DECODE_SYMBOLX1_2(op2, &bitD2);\n                HUF_DECODE_SYMBOLX1_2(op3, &bitD3);\n                HUF_DECODE_SYMBOLX1_2(op4, &bitD4);\n                HUF_DECODE_SYMBOLX1_1(op1, &bitD1);\n                HUF_DECODE_SYMBOLX1_1(op2, &bitD2);\n                HUF_DECODE_SYMBOLX1_1(op3, &bitD3);\n                HUF_DECODE_SYMBOLX1_1(op4, &bitD4);\n                HUF_DECODE_SYMBOLX1_2(op1, &bitD1);\n                HUF_DECODE_SYMBOLX1_2(op2, &bitD2);\n                HUF_DECODE_SYMBOLX1_2(op3, &bitD3);\n                HUF_DECODE_SYMBOLX1_2(op4, &bitD4);\n                HUF_DECODE_SYMBOLX1_0(op1, &bitD1);\n                HUF_DECODE_SYMBOLX1_0(op2, &bitD2);\n                HUF_DECODE_SYMBOLX1_0(op3, &bitD3);\n                HUF_DECODE_SYMBOLX1_0(op4, &bitD4);\n                endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished;\n                endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished;\n                endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished;\n                endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished;\n            }\n        }\n\n        /* check corruption */\n        /* note : should not be necessary : op# advance in lock step, and we control op4.\n         *        but curiously, binary generated by gcc 7.2 & 7.3 with -mbmi2 runs faster when >=1 test is present */\n        if (op1 > opStart2) return ERROR(corruption_detected);\n        if (op2 > opStart3) return ERROR(corruption_detected);\n        if (op3 > opStart4) return ERROR(corruption_detected);\n        /* note : op4 supposed already verified within main loop */\n\n        /* finish bitStreams one by one */\n        HUF_decodeStreamX1(op1, &bitD1, opStart2, dt, dtLog);\n        HUF_decodeStreamX1(op2, &bitD2, opStart3, dt, dtLog);\n        HUF_decodeStreamX1(op3, &bitD3, opStart4, dt, dtLog);\n        HUF_decodeStreamX1(op4, &bitD4, oend,     dt, dtLog);\n\n        /* check */\n        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);\n          if (!endCheck) return ERROR(corruption_detected); }\n\n        /* decoded size */\n        return dstSize;\n    }\n}\n\n#if HUF_NEED_BMI2_FUNCTION\nstatic BMI2_TARGET_ATTRIBUTE\nsize_t HUF_decompress4X1_usingDTable_internal_bmi2(void* dst, size_t dstSize, void const* cSrc,\n                    size_t cSrcSize, HUF_DTable const* DTable) {\n    return HUF_decompress4X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable);\n}\n#endif\n\nstatic\nsize_t HUF_decompress4X1_usingDTable_internal_default(void* dst, size_t dstSize, void const* cSrc,\n                    size_t cSrcSize, HUF_DTable const* DTable) {\n    return HUF_decompress4X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable);\n}\n\n#if ZSTD_ENABLE_ASM_X86_64_BMI2\n\nHUF_ASM_DECL void HUF_decompress4X1_usingDTable_internal_fast_asm_loop(HUF_DecompressFastArgs* args) ZSTDLIB_HIDDEN;\n\n#endif\n\nstatic HUF_FAST_BMI2_ATTRS\nvoid HUF_decompress4X1_usingDTable_internal_fast_c_loop(HUF_DecompressFastArgs* args)\n{\n    U64 bits[4];\n    BYTE const* ip[4];\n    BYTE* op[4];\n    U16 const* const dtable = (U16 const*)args->dt;\n    BYTE* const oend = args->oend;\n    BYTE const* const ilowest = args->ilowest;\n\n    /* Copy the arguments to local variables */\n    ZSTD_memcpy(&bits, &args->bits, sizeof(bits));\n    ZSTD_memcpy((void*)(&ip), &args->ip, sizeof(ip));\n    ZSTD_memcpy(&op, &args->op, sizeof(op));\n\n    assert(MEM_isLittleEndian());\n    assert(!MEM_32bits());\n\n    for (;;) {\n        BYTE* olimit;\n        int stream;\n\n        /* Assert loop preconditions */\n#ifndef NDEBUG\n        for (stream = 0; stream < 4; ++stream) {\n            assert(op[stream] <= (stream == 3 ? oend : op[stream + 1]));\n            assert(ip[stream] >= ilowest);\n        }\n#endif\n        /* Compute olimit */\n        {\n            /* Each iteration produces 5 output symbols per stream */\n            size_t const oiters = (size_t)(oend - op[3]) / 5;\n            /* Each iteration consumes up to 11 bits * 5 = 55 bits < 7 bytes\n             * per stream.\n             */\n            size_t const iiters = (size_t)(ip[0] - ilowest) / 7;\n            /* We can safely run iters iterations before running bounds checks */\n            size_t const iters = MIN(oiters, iiters);\n            size_t const symbols = iters * 5;\n\n            /* We can simply check that op[3] < olimit, instead of checking all\n             * of our bounds, since we can't hit the other bounds until we've run\n             * iters iterations, which only happens when op[3] == olimit.\n             */\n            olimit = op[3] + symbols;\n\n            /* Exit fast decoding loop once we reach the end. */\n            if (op[3] == olimit)\n                break;\n\n            /* Exit the decoding loop if any input pointer has crossed the\n             * previous one. This indicates corruption, and a precondition\n             * to our loop is that ip[i] >= ip[0].\n             */\n            for (stream = 1; stream < 4; ++stream) {\n                if (ip[stream] < ip[stream - 1])\n                    goto _out;\n            }\n        }\n\n#ifndef NDEBUG\n        for (stream = 1; stream < 4; ++stream) {\n            assert(ip[stream] >= ip[stream - 1]);\n        }\n#endif\n\n#define HUF_4X1_DECODE_SYMBOL(_stream, _symbol)                 \\\n    do {                                                        \\\n        int const index = (int)(bits[(_stream)] >> 53);         \\\n        int const entry = (int)dtable[index];                   \\\n        bits[(_stream)] <<= (entry & 0x3F);                     \\\n        op[(_stream)][(_symbol)] = (BYTE)((entry >> 8) & 0xFF); \\\n    } while (0)\n\n#define HUF_4X1_RELOAD_STREAM(_stream)                              \\\n    do {                                                            \\\n        int const ctz = ZSTD_countTrailingZeros64(bits[(_stream)]); \\\n        int const nbBits = ctz & 7;                                 \\\n        int const nbBytes = ctz >> 3;                               \\\n        op[(_stream)] += 5;                                         \\\n        ip[(_stream)] -= nbBytes;                                   \\\n        bits[(_stream)] = MEM_read64(ip[(_stream)]) | 1;            \\\n        bits[(_stream)] <<= nbBits;                                 \\\n    } while (0)\n\n        /* Manually unroll the loop because compilers don't consistently\n         * unroll the inner loops, which destroys performance.\n         */\n        do {\n            /* Decode 5 symbols in each of the 4 streams */\n            HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL, 0);\n            HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL, 1);\n            HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL, 2);\n            HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL, 3);\n            HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X1_DECODE_SYMBOL, 4);\n\n            /* Reload each of the 4 the bitstreams */\n            HUF_4X_FOR_EACH_STREAM(HUF_4X1_RELOAD_STREAM);\n        } while (op[3] < olimit);\n\n#undef HUF_4X1_DECODE_SYMBOL\n#undef HUF_4X1_RELOAD_STREAM\n    }\n\n_out:\n\n    /* Save the final values of each of the state variables back to args. */\n    ZSTD_memcpy(&args->bits, &bits, sizeof(bits));\n    ZSTD_memcpy((void*)(&args->ip), &ip, sizeof(ip));\n    ZSTD_memcpy(&args->op, &op, sizeof(op));\n}\n\n/**\n * @returns @p dstSize on success (>= 6)\n *          0 if the fallback implementation should be used\n *          An error if an error occurred\n */\nstatic HUF_FAST_BMI2_ATTRS\nsize_t\nHUF_decompress4X1_usingDTable_internal_fast(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable,\n    HUF_DecompressFastLoopFn loopFn)\n{\n    void const* dt = DTable + 1;\n    BYTE const* const ilowest = (BYTE const*)cSrc;\n    BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize);\n    HUF_DecompressFastArgs args;\n    {   size_t const ret = HUF_DecompressFastArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable);\n        FORWARD_IF_ERROR(ret, \"Failed to init fast loop args\");\n        if (ret == 0)\n            return 0;\n    }\n\n    assert(args.ip[0] >= args.ilowest);\n    loopFn(&args);\n\n    /* Our loop guarantees that ip[] >= ilowest and that we haven't\n    * overwritten any op[].\n    */\n    assert(args.ip[0] >= ilowest);\n    assert(args.ip[0] >= ilowest);\n    assert(args.ip[1] >= ilowest);\n    assert(args.ip[2] >= ilowest);\n    assert(args.ip[3] >= ilowest);\n    assert(args.op[3] <= oend);\n\n    assert(ilowest == args.ilowest);\n    assert(ilowest + 6 == args.iend[0]);\n    (void)ilowest;\n\n    /* finish bit streams one by one. */\n    {   size_t const segmentSize = (dstSize+3) / 4;\n        BYTE* segmentEnd = (BYTE*)dst;\n        int i;\n        for (i = 0; i < 4; ++i) {\n            BIT_DStream_t bit;\n            if (segmentSize <= (size_t)(oend - segmentEnd))\n                segmentEnd += segmentSize;\n            else\n                segmentEnd = oend;\n            FORWARD_IF_ERROR(HUF_initRemainingDStream(&bit, &args, i, segmentEnd), \"corruption\");\n            /* Decompress and validate that we've produced exactly the expected length. */\n            args.op[i] += HUF_decodeStreamX1(args.op[i], &bit, segmentEnd, (HUF_DEltX1 const*)dt, HUF_DECODER_FAST_TABLELOG);\n            if (args.op[i] != segmentEnd) return ERROR(corruption_detected);\n        }\n    }\n\n    /* decoded size */\n    assert(dstSize != 0);\n    return dstSize;\n}\n\nHUF_DGEN(HUF_decompress1X1_usingDTable_internal)\n\nstatic size_t HUF_decompress4X1_usingDTable_internal(void* dst, size_t dstSize, void const* cSrc,\n                    size_t cSrcSize, HUF_DTable const* DTable, int flags)\n{\n    HUF_DecompressUsingDTableFn fallbackFn = HUF_decompress4X1_usingDTable_internal_default;\n    HUF_DecompressFastLoopFn loopFn = HUF_decompress4X1_usingDTable_internal_fast_c_loop;\n\n#if DYNAMIC_BMI2\n    if (flags & HUF_flags_bmi2) {\n        fallbackFn = HUF_decompress4X1_usingDTable_internal_bmi2;\n# if ZSTD_ENABLE_ASM_X86_64_BMI2\n        if (!(flags & HUF_flags_disableAsm)) {\n            loopFn = HUF_decompress4X1_usingDTable_internal_fast_asm_loop;\n        }\n# endif\n    } else {\n        return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);\n    }\n#endif\n\n#if ZSTD_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)\n    if (!(flags & HUF_flags_disableAsm)) {\n        loopFn = HUF_decompress4X1_usingDTable_internal_fast_asm_loop;\n    }\n#endif\n\n    if (HUF_ENABLE_FAST_DECODE && !(flags & HUF_flags_disableFast)) {\n        size_t const ret = HUF_decompress4X1_usingDTable_internal_fast(dst, dstSize, cSrc, cSrcSize, DTable, loopFn);\n        if (ret != 0)\n            return ret;\n    }\n    return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);\n}\n\nstatic size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,\n                                   const void* cSrc, size_t cSrcSize,\n                                   void* workSpace, size_t wkspSize, int flags)\n{\n    const BYTE* ip = (const BYTE*) cSrc;\n\n    size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize, flags);\n    if (HUF_isError(hSize)) return hSize;\n    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);\n    ip += hSize; cSrcSize -= hSize;\n\n    return HUF_decompress4X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);\n}\n\n#endif /* HUF_FORCE_DECOMPRESS_X2 */\n\n\n#ifndef HUF_FORCE_DECOMPRESS_X1\n\n/* *************************/\n/* double-symbols decoding */\n/* *************************/\n\ntypedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUF_DEltX2;  /* double-symbols decoding */\ntypedef struct { BYTE symbol; } sortedSymbol_t;\ntypedef U32 rankValCol_t[HUF_TABLELOG_MAX + 1];\ntypedef rankValCol_t rankVal_t[HUF_TABLELOG_MAX];\n\n/**\n * Constructs a HUF_DEltX2 in a U32.\n */\nstatic U32 HUF_buildDEltX2U32(U32 symbol, U32 nbBits, U32 baseSeq, int level)\n{\n    U32 seq;\n    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, sequence) == 0);\n    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, nbBits) == 2);\n    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, length) == 3);\n    DEBUG_STATIC_ASSERT(sizeof(HUF_DEltX2) == sizeof(U32));\n    if (MEM_isLittleEndian()) {\n        seq = level == 1 ? symbol : (baseSeq + (symbol << 8));\n        return seq + (nbBits << 16) + ((U32)level << 24);\n    } else {\n        seq = level == 1 ? (symbol << 8) : ((baseSeq << 8) + symbol);\n        return (seq << 16) + (nbBits << 8) + (U32)level;\n    }\n}\n\n/**\n * Constructs a HUF_DEltX2.\n */\nstatic HUF_DEltX2 HUF_buildDEltX2(U32 symbol, U32 nbBits, U32 baseSeq, int level)\n{\n    HUF_DEltX2 DElt;\n    U32 const val = HUF_buildDEltX2U32(symbol, nbBits, baseSeq, level);\n    DEBUG_STATIC_ASSERT(sizeof(DElt) == sizeof(val));\n    ZSTD_memcpy(&DElt, &val, sizeof(val));\n    return DElt;\n}\n\n/**\n * Constructs 2 HUF_DEltX2s and packs them into a U64.\n */\nstatic U64 HUF_buildDEltX2U64(U32 symbol, U32 nbBits, U16 baseSeq, int level)\n{\n    U32 DElt = HUF_buildDEltX2U32(symbol, nbBits, baseSeq, level);\n    return (U64)DElt + ((U64)DElt << 32);\n}\n\n/**\n * Fills the DTable rank with all the symbols from [begin, end) that are each\n * nbBits long.\n *\n * @param DTableRank The start of the rank in the DTable.\n * @param begin The first symbol to fill (inclusive).\n * @param end The last symbol to fill (exclusive).\n * @param nbBits Each symbol is nbBits long.\n * @param tableLog The table log.\n * @param baseSeq If level == 1 { 0 } else { the first level symbol }\n * @param level The level in the table. Must be 1 or 2.\n */\nstatic void HUF_fillDTableX2ForWeight(\n    HUF_DEltX2* DTableRank,\n    sortedSymbol_t const* begin, sortedSymbol_t const* end,\n    U32 nbBits, U32 tableLog,\n    U16 baseSeq, int const level)\n{\n    U32 const length = 1U << ((tableLog - nbBits) & 0x1F /* quiet static-analyzer */);\n    const sortedSymbol_t* ptr;\n    assert(level >= 1 && level <= 2);\n    switch (length) {\n    case 1:\n        for (ptr = begin; ptr != end; ++ptr) {\n            HUF_DEltX2 const DElt = HUF_buildDEltX2(ptr->symbol, nbBits, baseSeq, level);\n            *DTableRank++ = DElt;\n        }\n        break;\n    case 2:\n        for (ptr = begin; ptr != end; ++ptr) {\n            HUF_DEltX2 const DElt = HUF_buildDEltX2(ptr->symbol, nbBits, baseSeq, level);\n            DTableRank[0] = DElt;\n            DTableRank[1] = DElt;\n            DTableRank += 2;\n        }\n        break;\n    case 4:\n        for (ptr = begin; ptr != end; ++ptr) {\n            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);\n            ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));\n            ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));\n            DTableRank += 4;\n        }\n        break;\n    case 8:\n        for (ptr = begin; ptr != end; ++ptr) {\n            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);\n            ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));\n            ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));\n            ZSTD_memcpy(DTableRank + 4, &DEltX2, sizeof(DEltX2));\n            ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof(DEltX2));\n            DTableRank += 8;\n        }\n        break;\n    default:\n        for (ptr = begin; ptr != end; ++ptr) {\n            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);\n            HUF_DEltX2* const DTableRankEnd = DTableRank + length;\n            for (; DTableRank != DTableRankEnd; DTableRank += 8) {\n                ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));\n                ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));\n                ZSTD_memcpy(DTableRank + 4, &DEltX2, sizeof(DEltX2));\n                ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof(DEltX2));\n            }\n        }\n        break;\n    }\n}\n\n/* HUF_fillDTableX2Level2() :\n * `rankValOrigin` must be a table of at least (HUF_TABLELOG_MAX + 1) U32 */\nstatic void HUF_fillDTableX2Level2(HUF_DEltX2* DTable, U32 targetLog, const U32 consumedBits,\n                           const U32* rankVal, const int minWeight, const int maxWeight1,\n                           const sortedSymbol_t* sortedSymbols, U32 const* rankStart,\n                           U32 nbBitsBaseline, U16 baseSeq)\n{\n    /* Fill skipped values (all positions up to rankVal[minWeight]).\n     * These are positions only get a single symbol because the combined weight\n     * is too large.\n     */\n    if (minWeight>1) {\n        U32 const length = 1U << ((targetLog - consumedBits) & 0x1F /* quiet static-analyzer */);\n        U64 const DEltX2 = HUF_buildDEltX2U64(baseSeq, consumedBits, /* baseSeq */ 0, /* level */ 1);\n        int const skipSize = rankVal[minWeight];\n        assert(length > 1);\n        assert((U32)skipSize < length);\n        switch (length) {\n        case 2:\n            assert(skipSize == 1);\n            ZSTD_memcpy(DTable, &DEltX2, sizeof(DEltX2));\n            break;\n        case 4:\n            assert(skipSize <= 4);\n            ZSTD_memcpy(DTable + 0, &DEltX2, sizeof(DEltX2));\n            ZSTD_memcpy(DTable + 2, &DEltX2, sizeof(DEltX2));\n            break;\n        default:\n            {\n                int i;\n                for (i = 0; i < skipSize; i += 8) {\n                    ZSTD_memcpy(DTable + i + 0, &DEltX2, sizeof(DEltX2));\n                    ZSTD_memcpy(DTable + i + 2, &DEltX2, sizeof(DEltX2));\n                    ZSTD_memcpy(DTable + i + 4, &DEltX2, sizeof(DEltX2));\n                    ZSTD_memcpy(DTable + i + 6, &DEltX2, sizeof(DEltX2));\n                }\n            }\n        }\n    }\n\n    /* Fill each of the second level symbols by weight. */\n    {\n        int w;\n        for (w = minWeight; w < maxWeight1; ++w) {\n            int const begin = rankStart[w];\n            int const end = rankStart[w+1];\n            U32 const nbBits = nbBitsBaseline - w;\n            U32 const totalBits = nbBits + consumedBits;\n            HUF_fillDTableX2ForWeight(\n                DTable + rankVal[w],\n                sortedSymbols + begin, sortedSymbols + end,\n                totalBits, targetLog,\n                baseSeq, /* level */ 2);\n        }\n    }\n}\n\nstatic void HUF_fillDTableX2(HUF_DEltX2* DTable, const U32 targetLog,\n                           const sortedSymbol_t* sortedList,\n                           const U32* rankStart, rankValCol_t* rankValOrigin, const U32 maxWeight,\n                           const U32 nbBitsBaseline)\n{\n    U32* const rankVal = rankValOrigin[0];\n    const int scaleLog = nbBitsBaseline - targetLog;   /* note : targetLog >= srcLog, hence scaleLog <= 1 */\n    const U32 minBits  = nbBitsBaseline - maxWeight;\n    int w;\n    int const wEnd = (int)maxWeight + 1;\n\n    /* Fill DTable in order of weight. */\n    for (w = 1; w < wEnd; ++w) {\n        int const begin = (int)rankStart[w];\n        int const end = (int)rankStart[w+1];\n        U32 const nbBits = nbBitsBaseline - w;\n\n        if (targetLog-nbBits >= minBits) {\n            /* Enough room for a second symbol. */\n            int start = rankVal[w];\n            U32 const length = 1U << ((targetLog - nbBits) & 0x1F /* quiet static-analyzer */);\n            int minWeight = nbBits + scaleLog;\n            int s;\n            if (minWeight < 1) minWeight = 1;\n            /* Fill the DTable for every symbol of weight w.\n             * These symbols get at least 1 second symbol.\n             */\n            for (s = begin; s != end; ++s) {\n                HUF_fillDTableX2Level2(\n                    DTable + start, targetLog, nbBits,\n                    rankValOrigin[nbBits], minWeight, wEnd,\n                    sortedList, rankStart,\n                    nbBitsBaseline, sortedList[s].symbol);\n                start += length;\n            }\n        } else {\n            /* Only a single symbol. */\n            HUF_fillDTableX2ForWeight(\n                DTable + rankVal[w],\n                sortedList + begin, sortedList + end,\n                nbBits, targetLog,\n                /* baseSeq */ 0, /* level */ 1);\n        }\n    }\n}\n\ntypedef struct {\n    rankValCol_t rankVal[HUF_TABLELOG_MAX];\n    U32 rankStats[HUF_TABLELOG_MAX + 1];\n    U32 rankStart0[HUF_TABLELOG_MAX + 3];\n    sortedSymbol_t sortedSymbol[HUF_SYMBOLVALUE_MAX + 1];\n    BYTE weightList[HUF_SYMBOLVALUE_MAX + 1];\n    U32 calleeWksp[HUF_READ_STATS_WORKSPACE_SIZE_U32];\n} HUF_ReadDTableX2_Workspace;\n\nsize_t HUF_readDTableX2_wksp(HUF_DTable* DTable,\n                       const void* src, size_t srcSize,\n                             void* workSpace, size_t wkspSize, int flags)\n{\n    U32 tableLog, maxW, nbSymbols;\n    DTableDesc dtd = HUF_getDTableDesc(DTable);\n    U32 maxTableLog = dtd.maxTableLog;\n    size_t iSize;\n    void* dtPtr = DTable+1;   /* force compiler to avoid strict-aliasing */\n    HUF_DEltX2* const dt = (HUF_DEltX2*)dtPtr;\n    U32 *rankStart;\n\n    HUF_ReadDTableX2_Workspace* const wksp = (HUF_ReadDTableX2_Workspace*)workSpace;\n\n    if (sizeof(*wksp) > wkspSize) return ERROR(GENERIC);\n\n    rankStart = wksp->rankStart0 + 1;\n    ZSTD_memset(wksp->rankStats, 0, sizeof(wksp->rankStats));\n    ZSTD_memset(wksp->rankStart0, 0, sizeof(wksp->rankStart0));\n\n    DEBUG_STATIC_ASSERT(sizeof(HUF_DEltX2) == sizeof(HUF_DTable));   /* if compiler fails here, assertion is wrong */\n    if (maxTableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge);\n    /* ZSTD_memset(weightList, 0, sizeof(weightList)); */  /* is not necessary, even though some analyzer complain ... */\n\n    iSize = HUF_readStats_wksp(wksp->weightList, HUF_SYMBOLVALUE_MAX + 1, wksp->rankStats, &nbSymbols, &tableLog, src, srcSize, wksp->calleeWksp, sizeof(wksp->calleeWksp), flags);\n    if (HUF_isError(iSize)) return iSize;\n\n    /* check result */\n    if (tableLog > maxTableLog) return ERROR(tableLog_tooLarge);   /* DTable can't fit code depth */\n    if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG;\n\n    /* find maxWeight */\n    // coverity[underflow]\n    for (maxW = tableLog; wksp->rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */\n\n    /* Get start index of each weight */\n    {   U32 w, nextRankStart = 0;\n        for (w=1; w<maxW+1; w++) {\n            U32 curr = nextRankStart;\n            nextRankStart += wksp->rankStats[w];\n            rankStart[w] = curr;\n        }\n        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/\n        rankStart[maxW+1] = nextRankStart;\n    }\n\n    /* sort symbols by weight */\n    {   U32 s;\n        for (s=0; s<nbSymbols; s++) {\n            U32 const w = wksp->weightList[s];\n            U32 const r = rankStart[w]++;\n            wksp->sortedSymbol[r].symbol = (BYTE)s;\n        }\n        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */\n    }\n\n    /* Build rankVal */\n    {   U32* const rankVal0 = wksp->rankVal[0];\n        {   int const rescale = (maxTableLog-tableLog) - 1;   /* tableLog <= maxTableLog */\n            U32 nextRankVal = 0;\n            U32 w;\n            for (w=1; w<maxW+1; w++) {\n                U32 curr = nextRankVal;\n                nextRankVal += wksp->rankStats[w] << (w+rescale);\n                rankVal0[w] = curr;\n        }   }\n        {   U32 const minBits = tableLog+1 - maxW;\n            U32 consumed;\n            for (consumed = minBits; consumed < maxTableLog - minBits + 1; consumed++) {\n                U32* const rankValPtr = wksp->rankVal[consumed];\n                U32 w;\n                for (w = 1; w < maxW+1; w++) {\n                    rankValPtr[w] = rankVal0[w] >> consumed;\n    }   }   }   }\n\n    HUF_fillDTableX2(dt, maxTableLog,\n                   wksp->sortedSymbol,\n                   wksp->rankStart0, wksp->rankVal, maxW,\n                   tableLog+1);\n\n    dtd.tableLog = (BYTE)maxTableLog;\n    dtd.tableType = 1;\n    ZSTD_memcpy(DTable, &dtd, sizeof(dtd));\n    return iSize;\n}\n\n\nFORCE_INLINE_TEMPLATE U32\nHUF_decodeSymbolX2(void* op, BIT_DStream_t* DStream, const HUF_DEltX2* dt, const U32 dtLog)\n{\n    size_t const val = BIT_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */\n    ZSTD_memcpy(op, &dt[val].sequence, 2);\n    BIT_skipBits(DStream, dt[val].nbBits);\n    return dt[val].length;\n}\n\nFORCE_INLINE_TEMPLATE U32\nHUF_decodeLastSymbolX2(void* op, BIT_DStream_t* DStream, const HUF_DEltX2* dt, const U32 dtLog)\n{\n    size_t const val = BIT_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */\n    ZSTD_memcpy(op, &dt[val].sequence, 1);\n    if (dt[val].length==1) {\n        BIT_skipBits(DStream, dt[val].nbBits);\n    } else {\n        if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {\n            BIT_skipBits(DStream, dt[val].nbBits);\n            if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))\n                /* ugly hack; works only because it's the last symbol. Note : can't easily extract nbBits from just this symbol */\n                DStream->bitsConsumed = (sizeof(DStream->bitContainer)*8);\n        }\n    }\n    return 1;\n}\n\n#define HUF_DECODE_SYMBOLX2_0(ptr, DStreamPtr) \\\n    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)\n\n#define HUF_DECODE_SYMBOLX2_1(ptr, DStreamPtr)                     \\\n    do {                                                           \\\n        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12))                \\\n            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \\\n    } while (0)\n\n#define HUF_DECODE_SYMBOLX2_2(ptr, DStreamPtr)                     \\\n    do {                                                           \\\n        if (MEM_64bits())                                          \\\n            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \\\n    } while (0)\n\nHINT_INLINE size_t\nHUF_decodeStreamX2(BYTE* p, BIT_DStream_t* bitDPtr, BYTE* const pEnd,\n                const HUF_DEltX2* const dt, const U32 dtLog)\n{\n    BYTE* const pStart = p;\n\n    /* up to 8 symbols at a time */\n    if ((size_t)(pEnd - p) >= sizeof(bitDPtr->bitContainer)) {\n        if (dtLog <= 11 && MEM_64bits()) {\n            /* up to 10 symbols at a time */\n            while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-9)) {\n                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);\n                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);\n                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);\n                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);\n                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);\n            }\n        } else {\n            /* up to 8 symbols at a time */\n            while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-(sizeof(bitDPtr->bitContainer)-1))) {\n                HUF_DECODE_SYMBOLX2_2(p, bitDPtr);\n                HUF_DECODE_SYMBOLX2_1(p, bitDPtr);\n                HUF_DECODE_SYMBOLX2_2(p, bitDPtr);\n                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);\n            }\n        }\n    } else {\n        BIT_reloadDStream(bitDPtr);\n    }\n\n    /* closer to end : up to 2 symbols at a time */\n    if ((size_t)(pEnd - p) >= 2) {\n        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p <= pEnd-2))\n            HUF_DECODE_SYMBOLX2_0(p, bitDPtr);\n\n        while (p <= pEnd-2)\n            HUF_DECODE_SYMBOLX2_0(p, bitDPtr);   /* no need to reload : reached the end of DStream */\n    }\n\n    if (p < pEnd)\n        p += HUF_decodeLastSymbolX2(p, bitDPtr, dt, dtLog);\n\n    return p-pStart;\n}\n\nFORCE_INLINE_TEMPLATE size_t\nHUF_decompress1X2_usingDTable_internal_body(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    BIT_DStream_t bitD;\n\n    /* Init */\n    CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) );\n\n    /* decode */\n    {   BYTE* const ostart = (BYTE*) dst;\n        BYTE* const oend = ZSTD_maybeNullPtrAdd(ostart, dstSize);\n        const void* const dtPtr = DTable+1;   /* force compiler to not use strict-aliasing */\n        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;\n        DTableDesc const dtd = HUF_getDTableDesc(DTable);\n        HUF_decodeStreamX2(ostart, &bitD, oend, dt, dtd.tableLog);\n    }\n\n    /* check */\n    if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected);\n\n    /* decoded size */\n    return dstSize;\n}\n\n/* HUF_decompress4X2_usingDTable_internal_body():\n * Conditions:\n * @dstSize >= 6\n */\nFORCE_INLINE_TEMPLATE size_t\nHUF_decompress4X2_usingDTable_internal_body(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable)\n{\n    if (cSrcSize < 10) return ERROR(corruption_detected);   /* strict minimum : jump table + 1 byte per stream */\n    if (dstSize < 6) return ERROR(corruption_detected);         /* stream 4-split doesn't work */\n\n    {   const BYTE* const istart = (const BYTE*) cSrc;\n        BYTE* const ostart = (BYTE*) dst;\n        BYTE* const oend = ostart + dstSize;\n        BYTE* const olimit = oend - (sizeof(size_t)-1);\n        const void* const dtPtr = DTable+1;\n        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;\n\n        /* Init */\n        BIT_DStream_t bitD1;\n        BIT_DStream_t bitD2;\n        BIT_DStream_t bitD3;\n        BIT_DStream_t bitD4;\n        size_t const length1 = MEM_readLE16(istart);\n        size_t const length2 = MEM_readLE16(istart+2);\n        size_t const length3 = MEM_readLE16(istart+4);\n        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);\n        const BYTE* const istart1 = istart + 6;  /* jumpTable */\n        const BYTE* const istart2 = istart1 + length1;\n        const BYTE* const istart3 = istart2 + length2;\n        const BYTE* const istart4 = istart3 + length3;\n        size_t const segmentSize = (dstSize+3) / 4;\n        BYTE* const opStart2 = ostart + segmentSize;\n        BYTE* const opStart3 = opStart2 + segmentSize;\n        BYTE* const opStart4 = opStart3 + segmentSize;\n        BYTE* op1 = ostart;\n        BYTE* op2 = opStart2;\n        BYTE* op3 = opStart3;\n        BYTE* op4 = opStart4;\n        U32 endSignal = 1;\n        DTableDesc const dtd = HUF_getDTableDesc(DTable);\n        U32 const dtLog = dtd.tableLog;\n\n        if (length4 > cSrcSize) return ERROR(corruption_detected);  /* overflow */\n        if (opStart4 > oend) return ERROR(corruption_detected);     /* overflow */\n        assert(dstSize >= 6 /* validated above */);\n        CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );\n        CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );\n        CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );\n        CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );\n\n        /* 16-32 symbols per loop (4-8 symbols per stream) */\n        if ((size_t)(oend - op4) >= sizeof(size_t)) {\n            for ( ; (endSignal) & (op4 < olimit); ) {\n#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))\n                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);\n                HUF_DECODE_SYMBOLX2_1(op1, &bitD1);\n                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);\n                HUF_DECODE_SYMBOLX2_0(op1, &bitD1);\n                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);\n                HUF_DECODE_SYMBOLX2_1(op2, &bitD2);\n                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);\n                HUF_DECODE_SYMBOLX2_0(op2, &bitD2);\n                endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished;\n                endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished;\n                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);\n                HUF_DECODE_SYMBOLX2_1(op3, &bitD3);\n                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);\n                HUF_DECODE_SYMBOLX2_0(op3, &bitD3);\n                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);\n                HUF_DECODE_SYMBOLX2_1(op4, &bitD4);\n                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);\n                HUF_DECODE_SYMBOLX2_0(op4, &bitD4);\n                endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished;\n                endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished;\n#else\n                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);\n                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);\n                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);\n                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);\n                HUF_DECODE_SYMBOLX2_1(op1, &bitD1);\n                HUF_DECODE_SYMBOLX2_1(op2, &bitD2);\n                HUF_DECODE_SYMBOLX2_1(op3, &bitD3);\n                HUF_DECODE_SYMBOLX2_1(op4, &bitD4);\n                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);\n                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);\n                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);\n                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);\n                HUF_DECODE_SYMBOLX2_0(op1, &bitD1);\n                HUF_DECODE_SYMBOLX2_0(op2, &bitD2);\n                HUF_DECODE_SYMBOLX2_0(op3, &bitD3);\n                HUF_DECODE_SYMBOLX2_0(op4, &bitD4);\n                endSignal = (U32)LIKELY((U32)\n                            (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished)\n                        & (BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished)\n                        & (BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished)\n                        & (BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished));\n#endif\n            }\n        }\n\n        /* check corruption */\n        if (op1 > opStart2) return ERROR(corruption_detected);\n        if (op2 > opStart3) return ERROR(corruption_detected);\n        if (op3 > opStart4) return ERROR(corruption_detected);\n        /* note : op4 already verified within main loop */\n\n        /* finish bitStreams one by one */\n        HUF_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);\n        HUF_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);\n        HUF_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);\n        HUF_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);\n\n        /* check */\n        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);\n          if (!endCheck) return ERROR(corruption_detected); }\n\n        /* decoded size */\n        return dstSize;\n    }\n}\n\n#if HUF_NEED_BMI2_FUNCTION\nstatic BMI2_TARGET_ATTRIBUTE\nsize_t HUF_decompress4X2_usingDTable_internal_bmi2(void* dst, size_t dstSize, void const* cSrc,\n                    size_t cSrcSize, HUF_DTable const* DTable) {\n    return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable);\n}\n#endif\n\nstatic\nsize_t HUF_decompress4X2_usingDTable_internal_default(void* dst, size_t dstSize, void const* cSrc,\n                    size_t cSrcSize, HUF_DTable const* DTable) {\n    return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable);\n}\n\n#if ZSTD_ENABLE_ASM_X86_64_BMI2\n\nHUF_ASM_DECL void HUF_decompress4X2_usingDTable_internal_fast_asm_loop(HUF_DecompressFastArgs* args) ZSTDLIB_HIDDEN;\n\n#endif\n\nstatic HUF_FAST_BMI2_ATTRS\nvoid HUF_decompress4X2_usingDTable_internal_fast_c_loop(HUF_DecompressFastArgs* args)\n{\n    U64 bits[4];\n    BYTE const* ip[4];\n    BYTE* op[4];\n    BYTE* oend[4];\n    HUF_DEltX2 const* const dtable = (HUF_DEltX2 const*)args->dt;\n    BYTE const* const ilowest = args->ilowest;\n\n    /* Copy the arguments to local registers. */\n    ZSTD_memcpy(&bits, &args->bits, sizeof(bits));\n    ZSTD_memcpy((void*)(&ip), &args->ip, sizeof(ip));\n    ZSTD_memcpy(&op, &args->op, sizeof(op));\n\n    oend[0] = op[1];\n    oend[1] = op[2];\n    oend[2] = op[3];\n    oend[3] = args->oend;\n\n    assert(MEM_isLittleEndian());\n    assert(!MEM_32bits());\n\n    for (;;) {\n        BYTE* olimit;\n        int stream;\n\n        /* Assert loop preconditions */\n#ifndef NDEBUG\n        for (stream = 0; stream < 4; ++stream) {\n            assert(op[stream] <= oend[stream]);\n            assert(ip[stream] >= ilowest);\n        }\n#endif\n        /* Compute olimit */\n        {\n            /* Each loop does 5 table lookups for each of the 4 streams.\n             * Each table lookup consumes up to 11 bits of input, and produces\n             * up to 2 bytes of output.\n             */\n            /* We can consume up to 7 bytes of input per iteration per stream.\n             * We also know that each input pointer is >= ip[0]. So we can run\n             * iters loops before running out of input.\n             */\n            size_t iters = (size_t)(ip[0] - ilowest) / 7;\n            /* Each iteration can produce up to 10 bytes of output per stream.\n             * Each output stream my advance at different rates. So take the\n             * minimum number of safe iterations among all the output streams.\n             */\n            for (stream = 0; stream < 4; ++stream) {\n                size_t const oiters = (size_t)(oend[stream] - op[stream]) / 10;\n                iters = MIN(iters, oiters);\n            }\n\n            /* Each iteration produces at least 5 output symbols. So until\n             * op[3] crosses olimit, we know we haven't executed iters\n             * iterations yet. This saves us maintaining an iters counter,\n             * at the expense of computing the remaining # of iterations\n             * more frequently.\n             */\n            olimit = op[3] + (iters * 5);\n\n            /* Exit the fast decoding loop once we reach the end. */\n            if (op[3] == olimit)\n                break;\n\n            /* Exit the decoding loop if any input pointer has crossed the\n             * previous one. This indicates corruption, and a precondition\n             * to our loop is that ip[i] >= ip[0].\n             */\n            for (stream = 1; stream < 4; ++stream) {\n                if (ip[stream] < ip[stream - 1])\n                    goto _out;\n            }\n        }\n\n#ifndef NDEBUG\n        for (stream = 1; stream < 4; ++stream) {\n            assert(ip[stream] >= ip[stream - 1]);\n        }\n#endif\n\n#define HUF_4X2_DECODE_SYMBOL(_stream, _decode3)                      \\\n    do {                                                              \\\n        if ((_decode3) || (_stream) != 3) {                           \\\n            int const index = (int)(bits[(_stream)] >> 53);           \\\n            HUF_DEltX2 const entry = dtable[index];                   \\\n            MEM_write16(op[(_stream)], entry.sequence); \\\n            bits[(_stream)] <<= (entry.nbBits) & 0x3F;                \\\n            op[(_stream)] += (entry.length);                          \\\n        }                                                             \\\n    } while (0)\n\n#define HUF_4X2_RELOAD_STREAM(_stream)                                  \\\n    do {                                                                \\\n        HUF_4X2_DECODE_SYMBOL(3, 1);                                    \\\n        {                                                               \\\n            int const ctz = ZSTD_countTrailingZeros64(bits[(_stream)]); \\\n            int const nbBits = ctz & 7;                                 \\\n            int const nbBytes = ctz >> 3;                               \\\n            ip[(_stream)] -= nbBytes;                                   \\\n            bits[(_stream)] = MEM_read64(ip[(_stream)]) | 1;            \\\n            bits[(_stream)] <<= nbBits;                                 \\\n        }                                                               \\\n    } while (0)\n\n        /* Manually unroll the loop because compilers don't consistently\n         * unroll the inner loops, which destroys performance.\n         */\n        do {\n            /* Decode 5 symbols from each of the first 3 streams.\n             * The final stream will be decoded during the reload phase\n             * to reduce register pressure.\n             */\n            HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0);\n            HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0);\n            HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0);\n            HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0);\n            HUF_4X_FOR_EACH_STREAM_WITH_VAR(HUF_4X2_DECODE_SYMBOL, 0);\n\n            /* Decode one symbol from the final stream */\n            HUF_4X2_DECODE_SYMBOL(3, 1);\n\n            /* Decode 4 symbols from the final stream & reload bitstreams.\n             * The final stream is reloaded last, meaning that all 5 symbols\n             * are decoded from the final stream before it is reloaded.\n             */\n            HUF_4X_FOR_EACH_STREAM(HUF_4X2_RELOAD_STREAM);\n        } while (op[3] < olimit);\n    }\n\n#undef HUF_4X2_DECODE_SYMBOL\n#undef HUF_4X2_RELOAD_STREAM\n\n_out:\n\n    /* Save the final values of each of the state variables back to args. */\n    ZSTD_memcpy(&args->bits, &bits, sizeof(bits));\n    ZSTD_memcpy((void*)(&args->ip), &ip, sizeof(ip));\n    ZSTD_memcpy(&args->op, &op, sizeof(op));\n}\n\n\nstatic HUF_FAST_BMI2_ATTRS size_t\nHUF_decompress4X2_usingDTable_internal_fast(\n          void* dst,  size_t dstSize,\n    const void* cSrc, size_t cSrcSize,\n    const HUF_DTable* DTable,\n    HUF_DecompressFastLoopFn loopFn) {\n    void const* dt = DTable + 1;\n    const BYTE* const ilowest = (const BYTE*)cSrc;\n    BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize);\n    HUF_DecompressFastArgs args;\n    {\n        size_t const ret = HUF_DecompressFastArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable);\n        FORWARD_IF_ERROR(ret, \"Failed to init asm args\");\n        if (ret == 0)\n            return 0;\n    }\n\n    assert(args.ip[0] >= args.ilowest);\n    loopFn(&args);\n\n    /* note : op4 already verified within main loop */\n    assert(args.ip[0] >= ilowest);\n    assert(args.ip[1] >= ilowest);\n    assert(args.ip[2] >= ilowest);\n    assert(args.ip[3] >= ilowest);\n    assert(args.op[3] <= oend);\n\n    assert(ilowest == args.ilowest);\n    assert(ilowest + 6 == args.iend[0]);\n    (void)ilowest;\n\n    /* finish bitStreams one by one */\n    {\n        size_t const segmentSize = (dstSize+3) / 4;\n        BYTE* segmentEnd = (BYTE*)dst;\n        int i;\n        for (i = 0; i < 4; ++i) {\n            BIT_DStream_t bit;\n            if (segmentSize <= (size_t)(oend - segmentEnd))\n                segmentEnd += segmentSize;\n            else\n                segmentEnd = oend;\n            FORWARD_IF_ERROR(HUF_initRemainingDStream(&bit, &args, i, segmentEnd), \"corruption\");\n            args.op[i] += HUF_decodeStreamX2(args.op[i], &bit, segmentEnd, (HUF_DEltX2 const*)dt, HUF_DECODER_FAST_TABLELOG);\n            if (args.op[i] != segmentEnd)\n                return ERROR(corruption_detected);\n        }\n    }\n\n    /* decoded size */\n    return dstSize;\n}\n\nstatic size_t HUF_decompress4X2_usingDTable_internal(void* dst, size_t dstSize, void const* cSrc,\n                    size_t cSrcSize, HUF_DTable const* DTable, int flags)\n{\n    HUF_DecompressUsingDTableFn fallbackFn = HUF_decompress4X2_usingDTable_internal_default;\n    HUF_DecompressFastLoopFn loopFn = HUF_decompress4X2_usingDTable_internal_fast_c_loop;\n\n#if DYNAMIC_BMI2\n    if (flags & HUF_flags_bmi2) {\n        fallbackFn = HUF_decompress4X2_usingDTable_internal_bmi2;\n# if ZSTD_ENABLE_ASM_X86_64_BMI2\n        if (!(flags & HUF_flags_disableAsm)) {\n            loopFn = HUF_decompress4X2_usingDTable_internal_fast_asm_loop;\n        }\n# endif\n    } else {\n        return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);\n    }\n#endif\n\n#if ZSTD_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)\n    if (!(flags & HUF_flags_disableAsm)) {\n        loopFn = HUF_decompress4X2_usingDTable_internal_fast_asm_loop;\n    }\n#endif\n\n    if (HUF_ENABLE_FAST_DECODE && !(flags & HUF_flags_disableFast)) {\n        size_t const ret = HUF_decompress4X2_usingDTable_internal_fast(dst, dstSize, cSrc, cSrcSize, DTable, loopFn);\n        if (ret != 0)\n            return ret;\n    }\n    return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);\n}\n\nHUF_DGEN(HUF_decompress1X2_usingDTable_internal)\n\nsize_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* DCtx, void* dst, size_t dstSize,\n                                   const void* cSrc, size_t cSrcSize,\n                                   void* workSpace, size_t wkspSize, int flags)\n{\n    const BYTE* ip = (const BYTE*) cSrc;\n\n    size_t const hSize = HUF_readDTableX2_wksp(DCtx, cSrc, cSrcSize,\n                                               workSpace, wkspSize, flags);\n    if (HUF_isError(hSize)) return hSize;\n    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);\n    ip += hSize; cSrcSize -= hSize;\n\n    return HUF_decompress1X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, DCtx, flags);\n}\n\nstatic size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,\n                                   const void* cSrc, size_t cSrcSize,\n                                   void* workSpace, size_t wkspSize, int flags)\n{\n    const BYTE* ip = (const BYTE*) cSrc;\n\n    size_t hSize = HUF_readDTableX2_wksp(dctx, cSrc, cSrcSize,\n                                         workSpace, wkspSize, flags);\n    if (HUF_isError(hSize)) return hSize;\n    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);\n    ip += hSize; cSrcSize -= hSize;\n\n    return HUF_decompress4X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);\n}\n\n#endif /* HUF_FORCE_DECOMPRESS_X1 */\n\n\n/* ***********************************/\n/* Universal decompression selectors */\n/* ***********************************/\n\n\n#if !defined(HUF_FORCE_DECOMPRESS_X1) && !defined(HUF_FORCE_DECOMPRESS_X2)\ntypedef struct { U32 tableTime; U32 decode256Time; } algo_time_t;\nstatic const algo_time_t algoTime[16 /* Quantization */][2 /* single, double */] =\n{\n    /* single, double, quad */\n    {{0,0}, {1,1}},  /* Q==0 : impossible */\n    {{0,0}, {1,1}},  /* Q==1 : impossible */\n    {{ 150,216}, { 381,119}},   /* Q == 2 : 12-18% */\n    {{ 170,205}, { 514,112}},   /* Q == 3 : 18-25% */\n    {{ 177,199}, { 539,110}},   /* Q == 4 : 25-32% */\n    {{ 197,194}, { 644,107}},   /* Q == 5 : 32-38% */\n    {{ 221,192}, { 735,107}},   /* Q == 6 : 38-44% */\n    {{ 256,189}, { 881,106}},   /* Q == 7 : 44-50% */\n    {{ 359,188}, {1167,109}},   /* Q == 8 : 50-56% */\n    {{ 582,187}, {1570,114}},   /* Q == 9 : 56-62% */\n    {{ 688,187}, {1712,122}},   /* Q ==10 : 62-69% */\n    {{ 825,186}, {1965,136}},   /* Q ==11 : 69-75% */\n    {{ 976,185}, {2131,150}},   /* Q ==12 : 75-81% */\n    {{1180,186}, {2070,175}},   /* Q ==13 : 81-87% */\n    {{1377,185}, {1731,202}},   /* Q ==14 : 87-93% */\n    {{1412,185}, {1695,202}},   /* Q ==15 : 93-99% */\n};\n#endif\n\n/** HUF_selectDecoder() :\n *  Tells which decoder is likely to decode faster,\n *  based on a set of pre-computed metrics.\n * @return : 0==HUF_decompress4X1, 1==HUF_decompress4X2 .\n *  Assumption : 0 < dstSize <= 128 KB */\nU32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize)\n{\n    assert(dstSize > 0);\n    assert(dstSize <= 128*1024);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n    (void)dstSize;\n    (void)cSrcSize;\n    return 0;\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n    (void)dstSize;\n    (void)cSrcSize;\n    return 1;\n#else\n    /* decoder timing evaluation */\n    {   U32 const Q = (cSrcSize >= dstSize) ? 15 : (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 */\n        U32 const D256 = (U32)(dstSize >> 8);\n        U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256);\n        U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256);\n        DTime1 += DTime1 >> 5;  /* small advantage to algorithm using less memory, to reduce cache eviction */\n        return DTime1 < DTime0;\n    }\n#endif\n}\n\nsize_t HUF_decompress1X_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize,\n                                  const void* cSrc, size_t cSrcSize,\n                                  void* workSpace, size_t wkspSize, int flags)\n{\n    /* validation checks */\n    if (dstSize == 0) return ERROR(dstSize_tooSmall);\n    if (cSrcSize > dstSize) return ERROR(corruption_detected);   /* invalid */\n    if (cSrcSize == dstSize) { ZSTD_memcpy(dst, cSrc, dstSize); return dstSize; }   /* not compressed */\n    if (cSrcSize == 1) { ZSTD_memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */\n\n    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n        (void)algoNb;\n        assert(algoNb == 0);\n        return HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc,\n                                cSrcSize, workSpace, wkspSize, flags);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n        (void)algoNb;\n        assert(algoNb == 1);\n        return HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc,\n                                cSrcSize, workSpace, wkspSize, flags);\n#else\n        return algoNb ? HUF_decompress1X2_DCtx_wksp(dctx, dst, dstSize, cSrc,\n                                cSrcSize, workSpace, wkspSize, flags):\n                        HUF_decompress1X1_DCtx_wksp(dctx, dst, dstSize, cSrc,\n                                cSrcSize, workSpace, wkspSize, flags);\n#endif\n    }\n}\n\n\nsize_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int flags)\n{\n    DTableDesc const dtd = HUF_getDTableDesc(DTable);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n    (void)dtd;\n    assert(dtd.tableType == 0);\n    return HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n    (void)dtd;\n    assert(dtd.tableType == 1);\n    return HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);\n#else\n    return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags) :\n                           HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);\n#endif\n}\n\n#ifndef HUF_FORCE_DECOMPRESS_X2\nsize_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags)\n{\n    const BYTE* ip = (const BYTE*) cSrc;\n\n    size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize, flags);\n    if (HUF_isError(hSize)) return hSize;\n    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);\n    ip += hSize; cSrcSize -= hSize;\n\n    return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);\n}\n#endif\n\nsize_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int flags)\n{\n    DTableDesc const dtd = HUF_getDTableDesc(DTable);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n    (void)dtd;\n    assert(dtd.tableType == 0);\n    return HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n    (void)dtd;\n    assert(dtd.tableType == 1);\n    return HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);\n#else\n    return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags) :\n                           HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);\n#endif\n}\n\nsize_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int flags)\n{\n    /* validation checks */\n    if (dstSize == 0) return ERROR(dstSize_tooSmall);\n    if (cSrcSize == 0) return ERROR(corruption_detected);\n\n    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);\n#if defined(HUF_FORCE_DECOMPRESS_X1)\n        (void)algoNb;\n        assert(algoNb == 0);\n        return HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags);\n#elif defined(HUF_FORCE_DECOMPRESS_X2)\n        (void)algoNb;\n        assert(algoNb == 1);\n        return HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags);\n#else\n        return algoNb ? HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags) :\n                        HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags);\n#endif\n    }\n}\n"
  },
  {
    "path": "src/bled/init_handle.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\narchive_handle_t* FAST_FUNC init_handle(void)\n{\n\tarchive_handle_t *archive_handle;\n\n\t/* Initialize default values */\n\tarchive_handle = xzalloc(sizeof(archive_handle_t));\n\tif (archive_handle == NULL)\n\t\treturn NULL;\n\tarchive_handle->file_header = xzalloc(sizeof(file_header_t));\n\tarchive_handle->action_header = header_skip;\n\tarchive_handle->action_data = data_skip;\n\tarchive_handle->filter = filter_accept_all;\n\tarchive_handle->seek = seek_by_jump;\n#if ENABLE_CPIO || ENABLE_RPM2CPIO || ENABLE_RPM\n\tarchive_handle->cpio__owner.uid = (uid_t)-1L;\n\tarchive_handle->cpio__owner.gid = (gid_t)-1L;\n#endif\n\n\treturn archive_handle;\n}\n"
  },
  {
    "path": "src/bled/libbb.h",
    "content": "/*\n * Library header for busybox/Bled\n *\n * Rewritten for Bled (Base Library for Easy Decompression)\n * Copyright © 2014-2023 Pete Batard <pete@akeo.ie>\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#ifndef LIBBB_H\n#define LIBBB_H 1\n\n#ifndef _WIN32\n#error Only Windows platforms are supported\n#endif\n\n#include \"platform.h\"\n#include \"msapi_utf8.h\"\n\n#include <ctype.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <inttypes.h>\n#include <setjmp.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdarg.h>\n#include <stddef.h>\n#include <string.h>\n#include <time.h>\n#include <direct.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <io.h>\n\n#define ONE_TB                          1099511627776ULL\n\n#define ENABLE_DESKTOP                  1\n#if ENABLE_DESKTOP\n#define IF_DESKTOP(x)                   x\n#define IF_NOT_DESKTOP(x)\n#else\n#define IF_DESKTOP(x)\n#define IF_NOT_DESKTOP(x)               x\n#endif\n#define IF_NOT_FEATURE_LZMA_FAST(x)     x\n#define ENABLE_FEATURE_UNZIP_CDF        1\n#define ENABLE_FEATURE_UNZIP_BZIP2      1\n#define ENABLE_FEATURE_UNZIP_LZMA       1\n#define ENABLE_FEATURE_UNZIP_XZ         1\n#define ENABLE_FEATURE_CLEAN_UP         1\n#define uoff_t                          unsigned off_t\n#define OFF_FMT                         \"ll\"\n\n#define SEAMLESS_COMPRESSION            0\n#if (SEAMLESS_COMPRESSION)\n#define ENABLE_FEATURE_SEAMLESS_BZ2     1\n#define ENABLE_FEATURE_SEAMLESS_GZ      1\n#define ENABLE_FEATURE_SEAMLESS_LZMA    1\n#define ENABLE_FEATURE_SEAMLESS_XZ      1\n#define ENABLE_FEATURE_SEAMLESS_Z       1\n#define ENABLE_FEATURE_SEAMLESS_ZSTD    1\n#define IF_FEATURE_SEAMLESS_BZ2(x)      x\n#define IF_FEATURE_SEAMLESS_XZ(x)       x\n#define IF_FEATURE_SEAMLESS_ZSTD(x)     x\n#endif\n\n#ifndef _MODE_T_\n#define _MODE_T_\ntypedef unsigned short mode_t;\n#endif\n\n#ifndef _PID_T_\n#define _PID_T_\ntypedef int pid_t;\n#endif\n\n#ifndef _GID_T_\n#define _GID_T_\ntypedef unsigned int gid_t;\n#endif\n\n#ifndef _UID_T_\n#define _UID_T_\ntypedef unsigned int uid_t;\n#endif\n\n#ifndef MIN\n#define MIN(a, b) (((a) < (b)) ? (a) : (b))\n#endif\n\n#ifndef MAX\n#define MAX(a, b) (((a) > (b)) ? (a) : (b))\n#endif\n\n#ifndef PATH_MAX\n#define PATH_MAX MAX_PATH\n#endif\n\n#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))\n\n#ifndef get_le64\n#define get_le64(ptr) (*(const uint64_t *)(ptr))\n#endif\n\n#ifndef get_le32\n#define get_le32(ptr) (*(const uint32_t *)(ptr))\n#endif\n\n#ifndef get_le16\n#define get_le16(ptr) (*(const uint16_t *)(ptr))\n#endif\n\nextern uint32_t BB_BUFSIZE;\nextern smallint bb_got_signal;\nextern uint32_t *global_crc32_table;\nextern jmp_buf bb_error_jmp;\nextern char* bb_virtual_buf;\nextern size_t bb_virtual_len, bb_virtual_pos;\nextern int bb_virtual_fd;\n\nuint32_t* crc32_filltable(uint32_t *crc_table, int endian);\nuint32_t crc32_le(uint32_t crc, unsigned char const *p, size_t len, uint32_t *crc32table_le);\nuint32_t crc32_be(uint32_t crc, unsigned char const *p, size_t len, uint32_t *crc32table_be);\n#define crc32_block_endian0 crc32_le\n#define crc32_block_endian1 crc32_be\n\n#if defined(_MSC_VER)\n#if _FILE_OFFSET_BITS == 64\n#define stat _stat32i64\n#define lseek _lseeki64\n#else\n#define stat _stat32\n#define lseek _lseek\n#endif\n#endif\n\ntypedef struct _llist_t {\n\tstruct _llist_t *link;\n\tchar *data;\n} llist_t;\n\nstruct timeval64 {\n\tint64_t tv_sec;\n\tint32_t tv_usec;\n};\n\nextern void (*bled_printf) (const char* format, ...);\nextern void (*bled_progress) (const uint64_t processed_bytes);\nextern void (*bled_switch) (const char* filename, const uint64_t filesize);\nextern int (*bled_read)(int fd, void* buf, unsigned int count);\nextern int (*bled_write)(int fd, const void* buf, unsigned int count);\nextern unsigned long* bled_cancel_request;\n\n#define xfunc_die() longjmp(bb_error_jmp, 1)\n#define bb_printf(...) do { if (bled_printf != NULL) bled_printf(__VA_ARGS__); \\\n\telse { printf(__VA_ARGS__); putchar('\\n'); } } while(0)\n#define bb_error_msg(...) bb_printf(\"\\nError: \" __VA_ARGS__)\n#define bb_error_msg_and_die(...) do { bb_error_msg(__VA_ARGS__); xfunc_die(); } while(0)\n#define bb_error_msg_and_err(...) do { bb_error_msg(__VA_ARGS__); goto err; } while(0)\n#define bb_perror_msg bb_error_msg\n#define bb_perror_msg_and_die bb_error_msg_and_die\n#define bb_simple_error_msg bb_error_msg\n#define bb_simple_perror_msg_and_die bb_error_msg_and_die\n#define bb_simple_error_msg_and_die bb_error_msg_and_die\n#define bb_putchar putchar\n\nstatic inline void *xrealloc(void *ptr, size_t size) {\n\tvoid *ret = realloc(ptr, size);\n\tif (!ret)\n\t\tfree(ptr);\n\treturn ret;\n}\n\n#define bb_msg_read_error \"read error\"\n#define bb_msg_write_error \"write error\"\n#define bb_make_directory(path, mode, flags) SHCreateDirectoryExU(NULL, path, NULL)\n\nstatic inline int link(const char *oldpath, const char *newpath) { errno = ENOSYS; return -1; }\nstatic inline int symlink(const char *oldpath, const char *newpath) { errno = ENOSYS; return -1; }\nstatic inline int chown(const char *path, uid_t owner, gid_t group) { errno = ENOSYS; return -1; }\nstatic inline int mknod(const char *pathname, mode_t mode, dev_t dev) { errno = ENOSYS; return -1; }\nstatic inline int utimes64(const char* filename, const struct timeval64 times64[2]) { errno = ENOSYS; return -1; }\nstatic inline int fnmatch(const char *pattern, const char *string, int flags) { return PathMatchSpecA(string, pattern) ? 0 : 1; }\nstatic inline pid_t wait(int* status) { *status = 4; return -1; }\n#define wait_any_nohang wait\n\n/* This enables the display of a progress based on the number of bytes read */\nextern uint64_t bb_total_rb;\nstatic inline int full_read(int fd, void *buf, unsigned int count) {\n\tint rb;\n\n\tif (fd < 0) {\n\t\terrno = EBADF;\n\t\treturn -1;\n\t}\n\tif (buf == NULL) {\n\t\terrno = EFAULT;\n\t\treturn -1;\n\t}\n\t/* None of our r/w buffers should be larger than BB_BUFSIZE */\n\tif (count > BB_BUFSIZE) {\n\t\terrno = E2BIG;\n\t\treturn -1;\n\t}\n\tif ((bled_cancel_request != NULL) && (*bled_cancel_request != 0)) {\n\t\terrno = EINTR;\n\t\treturn -1;\n\t}\n\n\tif (fd == bb_virtual_fd) {\n\t\tif (bb_virtual_pos + count > bb_virtual_len)\n\t\t\tcount = (unsigned int)(bb_virtual_len - bb_virtual_pos);\n\t\tmemcpy(buf, &bb_virtual_buf[bb_virtual_pos], count);\n\t\tbb_virtual_pos += count;\n\t\trb = (int)count;\n\t} else {\n\t\trb = (bled_read != NULL) ? bled_read(fd, buf, count) : _read(fd, buf, count);\n\t}\n\tif (rb > 0) {\n\t\tbb_total_rb += rb;\n\t\tif (bled_progress != NULL)\n\t\t\tbled_progress(bb_total_rb);\n\t}\n\treturn rb;\n}\n\nstatic inline int full_write(int fd, const void* buffer, unsigned int count)\n{\n\t/* None of our r/w buffers should be larger than BB_BUFSIZE */\n\tif (count > BB_BUFSIZE) {\n\t\terrno = E2BIG;\n\t\treturn -1;\n\t}\n\n\treturn (bled_write != NULL) ? bled_write(fd, buffer, count) : _write(fd, buffer, count);\n}\n\nstatic inline void bb_copyfd_exact_size(int fd1, int fd2, off_t size)\n{\n\toff_t rb = 0;\n\tuint8_t* buf = NULL;\n\n\tif (fd1 < 0 || fd2 < 0)\n\t\tbb_error_msg_and_die(\"invalid fd\");\n\n\t/* Enforce a 1 TB limit to keep Coverity happy */\n\tif (size > ONE_TB)\n\t\tbb_error_msg_and_die(\"too large\");\n\n\tbuf = malloc(BB_BUFSIZE);\n\tif (buf == NULL)\n\t\tbb_error_msg_and_die(\"out of memory\");\n\n\twhile (rb < size) {\n\t\tint r, w;\n\t\tr = full_read(fd1, buf, (unsigned int)MIN(size - rb, BB_BUFSIZE));\n\t\tif (r < 0) {\n\t\t\tfree(buf);\n\t\t\tbb_error_msg_and_die(\"read error\");\n\t\t}\n\t\tif (r == 0) {\n\t\t\tbb_error_msg(\"short read\");\n\t\t\tbreak;\n\t\t}\n\t\tw = full_write(fd2, buf, r);\n\t\tif (w < 0) {\n\t\t\tfree(buf);\n\t\t\tbb_error_msg_and_die(\"write error\");\n\t\t}\n\t\tif (w != r) {\n\t\t\tbb_error_msg(\"short write\");\n\t\t\tbreak;\n\t\t}\n\t\trb += r;\n\t}\n\tfree(buf);\n}\n\nstatic inline struct tm *localtime_r(const time_t *timep, struct tm *result) {\n\tif (localtime_s(result, timep) != 0)\n\t\tresult = NULL;\n\treturn result;\n}\n\n#define safe_read full_read\n#define lstat stat\n#define xmalloc malloc\n#define xzalloc(x) calloc(x, 1)\n#define malloc_or_warn malloc\n#define mkdir(x, y) _mkdirU(x)\nstruct fd_pair { int rd; int wr; };\nvoid xpipe(int filedes[2]) FAST_FUNC;\n#define xpiped_pair(pair) xpipe(&((pair).rd))\n#define xpipe(filedes) _pipe(filedes, 0x1000, _O_BINARY)\n#define xlseek lseek\n#define xread safe_read\nstatic inline void xmove_fd(int from, int to)\n{\n\tif (from != to) {\n\t\t(void)_dup2(from, to);\n\t\t_close(from);\n\t}\n}\n\n#if defined(_MSC_VER)\n#define _S_IFBLK 0x3000\n\n#define S_IFMT   _S_IFMT\n#define S_IFDIR  _S_IFDIR\n#define S_IFCHR  _S_IFCHR\n#define S_IFIFO  _S_IFIFO\n#define S_IFREG  _S_IFREG\n#define S_IREAD  _S_IREAD\n#define S_IWRITE _S_IWRITE\n#define S_IEXEC  _S_IEXEC\n#define S_IFBLK  _S_IFBLK\n\n#define S_ISDIR(m)  (((m) & _S_IFMT) == _S_IFDIR)\n#define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO)\n#define S_ISCHR(m)  (((m) & _S_IFMT) == _S_IFCHR)\n#define S_ISBLK(m)  (((m) & _S_IFMT) == _S_IFBLK)\n#define S_ISREG(m)  (((m) & _S_IFMT) == _S_IFREG)\n\n#define O_RDONLY _O_RDONLY\n#define O_WRONLY _O_WRONLY\n#define O_RDWR   _O_RDWR\n#define O_APPEND _O_APPEND\n\n#define O_CREAT _O_CREAT\n#define O_TRUNC _O_TRUNC\n#define O_EXCL  _O_EXCL\n#endif\n\n/* MinGW doesn't know these */\n#define _S_IFLNK    0xA000\n#define _S_IFSOCK   0xC000\n#define S_IFLNK     _S_IFLNK\n#define S_IFSOCK    _S_IFSOCK\n#define S_ISLNK(m)  (((m) & _S_IFMT) == _S_IFLNK)\n#define S_ISSOCK(m) (((m) & _S_IFMT) == _S_IFSOCK)\n\n#endif\n"
  },
  {
    "path": "src/bled/open_transformer.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\nvoid FAST_FUNC init_transformer_state(transformer_state_t *xstate)\n{\n\tmemset(xstate, 0, sizeof(*xstate));\n}\n\nint FAST_FUNC check_signature16(transformer_state_t *xstate, unsigned magic16)\n{\n\tif (!xstate->signature_skipped) {\n\t\tuint16_t magic2;\n\t\tif (full_read(xstate->src_fd, &magic2, 2) != 2 || magic2 != magic16) {\n\t\t\tbb_error_msg(\"invalid magic\");\n\t\t\treturn -1;\n\t\t}\n\t\txstate->signature_skipped = 2;\n\t}\n\treturn 0;\n}\n\nssize_t FAST_FUNC transformer_write(transformer_state_t *xstate, const void *buf, size_t bufsize)\n{\n\tssize_t nwrote;\n\n\tif (xstate->mem_output_size_max != 0) {\n\t\tsize_t pos = xstate->mem_output_size;\n\t\tnwrote = bufsize;\n\t\tif ((pos + bufsize) > xstate->mem_output_size_max) {\n\t\t\tbufsize = xstate->mem_output_size_max - pos;\n\t\t\t// Use ENOSPC as an indicator that our buffer is full\n\t\t\tnwrote = -ENOSPC;\n\t\t}\n\t\tmemcpy(xstate->mem_output_buf + pos, buf, bufsize);\n\t\txstate->mem_output_size += bufsize;\n\t} else {\n\t\tnwrote = full_write(xstate->dst_fd, buf, (unsigned int)bufsize);\n\t\tif (nwrote != (ssize_t)bufsize) {\n\t\t\tif (nwrote < 0)\n\t\t\t\tbb_perror_msg(\"write error: %d\", (int)nwrote);\n\t\t\telse\n\t\t\t\tbb_perror_msg(\"write error: %d bytes written but %d expected\", (int)nwrote, (int)bufsize);\n\t\t\tnwrote = -1;\n\t\t\tgoto ret;\n\t\t}\n\t}\n ret:\n\treturn nwrote;\n}\n\nssize_t FAST_FUNC xtransformer_write(transformer_state_t *xstate, const void *buf, size_t bufsize)\n{\n\tssize_t nwrote = transformer_write(xstate, buf, bufsize);\n\tif (nwrote != (ssize_t)bufsize) {\n\t\txfunc_die();\n\t}\n\treturn nwrote;\n}\n\nvoid check_errors_in_children(int signo)\n{\n\tint status;\n\n\tif (!signo) {\n\t\t/* block waiting for any child */\n\t\tif (wait(&status) < 0)\n//FIXME: check EINTR?\n\t\t\treturn; /* probably there are no children */\n\t\tgoto check_status;\n\t}\n\n\t/* Wait for any child without blocking */\n\tfor (;;) {\n\t\tif (wait_any_nohang(&status) < 0)\n//FIXME: check EINTR?\n\t\t\t/* wait failed?! I'm confused... */\n\t\t\treturn;\n check_status:\n\t\t/*if (WIFEXITED(status) && WEXITSTATUS(status) == 0)*/\n\t\t/* On Linux, the above can be checked simply as: */\n\t\tif (status == 0)\n\t\t\t/* this child exited with 0 */\n\t\t\tcontinue;\n\t\t/* Cannot happen:\n\t\tif (!WIFSIGNALED(status) && !WIFEXITED(status)) ???;\n\t\t */\n\t\tbb_got_signal = 1;\n\t}\n}\n\n#if SEAMLESS_COMPRESSION\n\n/* transformer(), more than meets the eye */\n#if BB_MMU\nvoid FAST_FUNC fork_transformer(int fd,\n\tint signature_skipped,\n\tIF_DESKTOP(long long) int FAST_FUNC (*transformer)(transformer_state_t *xstate)\n)\n#else\nvoid FAST_FUNC fork_transformer(int fd, const char *transform_prog)\n#endif\n{\n\tstruct fd_pair fd_pipe;\n\tint pid;\n\n\txpiped_pair(fd_pipe);\n\tpid = BB_MMU ? xfork() : xvfork();\n\tif (pid == 0) {\n\t\t/* Child */\n\t\t_close(fd_pipe.rd); /* we don't want to read from the parent */\n\t\t// FIXME: error check?\n#if BB_MMU\n\t\t{\n\t\t\tIF_DESKTOP(long long) int r;\n\t\t\ttransformer_state_t xstate;\n\t\t\tinit_transformer_state(&xstate);\n\t\t\txstate.signature_skipped = signature_skipped;\n\t\t\txstate.src_fd = fd;\n\t\t\txstate.dst_fd = fd_pipe.wr;\n\t\t\tr = transformer(&xstate);\n\t\t\tif (ENABLE_FEATURE_CLEAN_UP) {\n\t\t\t\t_close(fd_pipe.wr); /* send EOF */\n\t\t\t\t_close(fd);\n\t\t\t}\n\t\t\t/* must be _exit! bug was actually seen here */\n\t\t\t_exit(/*error if:*/ r < 0);\n\t\t}\n#else\n\t\t{\n\t\t\tchar *argv[4];\n\t\t\txmove_fd(fd, 0);\n\t\t\txmove_fd(fd_pipe.wr, 1);\n\t\t\targv[0] = (char*)transform_prog;\n\t\t\targv[1] = (char*)\"-cf\";\n\t\t\targv[2] = (char*)\"-\";\n\t\t\targv[3] = NULL;\n\t\t\tBB_EXECVP(transform_prog, argv);\n\t\t\tbb_perror_msg_and_die(\"can't execute '%s'\", transform_prog);\n\t\t}\n#endif\n\t\t/* notreached */\n\t}\n\n\t/* parent process */\n\t_close(fd_pipe.wr); /* don't want to write to the child */\n\txmove_fd(fd_pipe.rd, fd);\n}\n\n/* Used by e.g. rpm which gives us a fd without filename,\n * thus we can't guess the format from filename's extension.\n */\nstatic transformer_state_t *setup_transformer_on_fd(int fd, int fail_if_not_compressed)\n{\n\ttransformer_state_t *xstate;\n\n\txstate = xzalloc(sizeof(*xstate));\n\txstate->src_fd = fd;\n\n\t/* .gz and .bz2 both have 2-byte signature, and their\n\t * unpack_XXX_stream wants this header skipped. */\n\txstate->signature_skipped = 2;\n\txread(fd, xstate->magic.b16, 2);\n\tif (ENABLE_FEATURE_SEAMLESS_GZ\n\t && xstate->magic.b16[0] == GZIP_MAGIC\n\t) {\n\t\txstate->xformer = unpack_gz_stream;\n\t\tUSE_FOR_NOMMU(xstate->xformer_prog = \"gunzip\";)\n\t\tgoto found_magic;\n\t}\n\tif (ENABLE_FEATURE_SEAMLESS_Z\n\t && xstate->magic.b16[0] == COMPRESS_MAGIC\n\t) {\n\t\txstate->xformer = unpack_Z_stream;\n\t\tUSE_FOR_NOMMU(xstate->xformer_prog = \"uncompress\";)\n\t\tgoto found_magic;\n\t}\n\tif (ENABLE_FEATURE_SEAMLESS_BZ2\n\t && xstate->magic.b16[0] == BZIP2_MAGIC\n\t) {\n\t\txstate->xformer = unpack_bz2_stream;\n\t\tUSE_FOR_NOMMU(xstate->xformer_prog = \"bunzip2\";)\n\t\tgoto found_magic;\n\t}\n\tif (ENABLE_FEATURE_SEAMLESS_XZ\n\t && xstate->magic.b16[0] == XZ_MAGIC1\n\t) {\n\t\tuint32_t v32;\n\t\txstate->signature_skipped = 6;\n\t\txread(fd, &xstate->magic.b16[1], 4);\n\t\tmove_from_unaligned32(v32, &xstate->magic.b16[1]);\n\t\tif (v32 == XZ_MAGIC2) {\n\t\t\txstate->xformer = unpack_xz_stream;\n\t\t\tUSE_FOR_NOMMU(xstate->xformer_prog = \"unxz\";)\n\t\t\tgoto found_magic;\n\t\t}\n\t}\n\tif (ENABLE_FEATURE_SEAMLESS_ZSTD\n\t && xstate->magic.b16[0] == ZSTD_MAGIC1\n\t) {\n\t\tuint16_t v16;\n\t\txstate->signature_skipped = 4;\n\t\txread(fd, &xstate->magic.b16[1], 2);\n\t\tmove_from_unaligned16(v16, &xstate->magic.b16[1]);\n\t\tif (v16 == ZSTD_MAGIC2) {\n\t\t\txstate->xformer = unpack_zstd_stream;\n\t\t\tUSE_FOR_NOMMU(xstate->xformer_prog = \"unzstd\";)\n\t\t\tgoto found_magic;\n\t\t}\n\t}\n\n\t/* No known magic seen */\n\tif (fail_if_not_compressed)\n\t\tbb_error_msg_and_die(\"no gzip\"\n\t\t\tIF_FEATURE_SEAMLESS_BZ2(\"/bzip2\")\n\t\t\tIF_FEATURE_SEAMLESS_XZ(\"/xz\")\n\t\t\tIF_FEATURE_SEAMLESS_ZSTD(\"/zstd\")\n\t\t\t\" magic\");\n\n\t/* Some callers expect this function to \"consume\" fd\n\t * even if data is not compressed. In this case,\n\t * we return a state with trivial transformer.\n\t */\n//\tUSE_FOR_MMU(xstate->xformer = copy_stream;)\n//\tUSE_FOR_NOMMU(xstate->xformer_prog = \"cat\";)\n\n found_magic:\n\treturn xstate;\n}\n\nstatic void fork_transformer_and_free(transformer_state_t *xstate)\n{\n# if BB_MMU\n\tfork_transformer_with_no_sig(xstate->src_fd, xstate->xformer);\n# else\n\t/* NOMMU version of fork_transformer execs\n\t * an external unzipper that wants\n\t * file position at the start of the file.\n\t */\n\txlseek(xstate->src_fd, - xstate->signature_skipped, SEEK_CUR);\n\txstate->signature_skipped = 0;\n\tfork_transformer_with_sig(xstate->src_fd, xstate->xformer, xstate->xformer_prog);\n# endif\n\tfree(xstate);\n}\n\n/* Used by e.g. rpm which gives us a fd without filename,\n * thus we can't guess the format from filename's extension.\n */\nint FAST_FUNC setup_unzip_on_fd(int fd, int fail_if_not_compressed)\n{\n\ttransformer_state_t *xstate = setup_transformer_on_fd(fd, fail_if_not_compressed);\n\n\tif (!xstate || !xstate->xformer) {\n\t\tfree(xstate);\n\t\treturn 1;\n\t}\n\n\tfork_transformer_and_free(xstate);\n\treturn 0;\n}\n#if ENABLE_FEATURE_SEAMLESS_LZMA\n/* ...and custom version for LZMA */\nvoid FAST_FUNC setup_lzma_on_fd(int fd)\n{\n\ttransformer_state_t *xstate = xzalloc(sizeof(*xstate));\n\txstate->src_fd = fd;\n\txstate->xformer = unpack_lzma_stream;\n\tUSE_FOR_NOMMU(xstate->xformer_prog = \"unlzma\";)\n\tfork_transformer_and_free(xstate);\n}\n#endif\n\nstatic transformer_state_t *open_transformer(const char *fname, int fail_if_not_compressed)\n{\n\ttransformer_state_t *xstate;\n\tint fd;\n\n\tfd = _open(fname, O_RDONLY);\n\tif (fd < 0)\n\t\treturn NULL;\n\n\tif (ENABLE_FEATURE_SEAMLESS_LZMA) {\n\t\t/* .lzma has no header/signature, can only detect it by extension */\n\t\tchar *sfx = strrchr(fname, '.');\n\t\tif (sfx && strcmp(sfx+1, \"lzma\") == 0) {\n\t\t\txstate = xzalloc(sizeof(*xstate));\n\t\t\txstate->src_fd = fd;\n\t\t\txstate->xformer = unpack_lzma_stream;\n\t\t\tUSE_FOR_NOMMU(xstate->xformer_prog = \"unlzma\";)\n\t\t\treturn xstate;\n\t\t}\n\t}\n\n\txstate = setup_transformer_on_fd(fd, fail_if_not_compressed);\n\n\treturn xstate;\n}\n\nint FAST_FUNC open_zipped(const char *fname, int fail_if_not_compressed)\n{\n\tint fd;\n\ttransformer_state_t *xstate;\n\n\txstate = open_transformer(fname, fail_if_not_compressed);\n\tif (!xstate)\n\t\treturn -1;\n\n\tfd = xstate->src_fd;\n# if BB_MMU\n\tif (xstate->xformer) {\n\t\tfork_transformer_with_no_sig(fd, xstate->xformer);\n\t} else {\n\t\t/* the file is not compressed */\n\t\txlseek(fd, - xstate->signature_skipped, SEEK_CUR);\n\t\txstate->signature_skipped = 0;\n\t}\n# else\n\t/* NOMMU can't avoid the seek :( */\n\txlseek(fd, - xstate->signature_skipped, SEEK_CUR);\n\txstate->signature_skipped = 0;\n\tif (xstate->xformer) {\n\t\tfork_transformer_with_sig(fd, xstate->xformer, xstate->xformer_prog);\n\t} /* else: the file is not compressed */\n# endif\n\n\tfree(xstate);\n\treturn fd;\n}\n\nvoid* FAST_FUNC xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p)\n{\n# if 1\n\ttransformer_state_t *xstate;\n\tchar *image;\n\n\txstate = open_transformer(fname, /*fail_if_not_compressed:*/ 0);\n\tif (!xstate) /* file open error */\n\t\treturn NULL;\n\n\timage = NULL;\n\tif (xstate->xformer) {\n\t\t/* In-memory decompression */\n\t\txstate->mem_output_size_max = maxsz_p ? *maxsz_p : (size_t)(INT_MAX - 4095);\n\t\txstate->xformer(xstate);\n\t\tif (xstate->mem_output_buf) {\n\t\t\timage = xstate->mem_output_buf;\n\t\t\tif (maxsz_p)\n\t\t\t\t*maxsz_p = xstate->mem_output_size;\n\t\t}\n\t} else {\n\t\t/* File is not compressed.\n\t\t * We already read first few bytes, account for that.\n\t\t * Example where it happens:\n\t\t * \"modinfo MODULE.ko\" (not compressed)\n\t\t *   open(\"MODULE.ko\", O_RDONLY|O_LARGEFILE) = 4\n\t\t *   read(4, \"\\177E\", 2)                     = 2\n\t\t *   fstat64(4, ...)\n\t\t *   mmap(...)\n\t\t *   read(4, \"LF\\2\\1\\1\\0\\0\\0\\0\"...\n\t\t * ...and we avoided seeking on the fd! :)\n\t\t */\n\t\timage = xmalloc_read_with_initial_buf(\n\t\t\txstate->src_fd,\n\t\t\tmaxsz_p,\n\t\t\txmemdup(&xstate->magic, xstate->signature_skipped),\n\t\t\txstate->signature_skipped\n\t\t);\n\t\txstate->signature_skipped = 0;\n\t}\n\n\tif (!image)\n\t\tbb_perror_msg(\"read error from '%s'\", fname);\n\t_close(xstate->src_fd);\n\tfree(xstate);\n\treturn image;\n# else\n\t/* This version forks a subprocess - much more expensive */\n\tint fd;\n\tchar *image;\n\n\tfd = open_zipped(fname, /*fail_if_not_compressed:*/ 0);\n\tif (fd < 0)\n\t\treturn NULL;\n\n\timage = xmalloc_read(fd, maxsz_p);\n\tif (!image)\n\t\tbb_perror_msg(\"read error from '%s'\", fname);\n\tclose(fd);\n\treturn image;\n# endif\n}\n\n#endif /* SEAMLESS_COMPRESSION */\n"
  },
  {
    "path": "src/bled/platform.h",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Copyright 2006, Bernhard Reutner-Fischer\n *\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#ifndef BB_PLATFORM_H\n#define BB_PLATFORM_H 1\n\n\n/* Convenience macros to test the version of gcc. */\n#undef __GNUC_PREREQ\n#if defined __GNUC__ && defined __GNUC_MINOR__\n# define __GNUC_PREREQ(maj, min) \\\n\t\t((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))\n#else\n# define __GNUC_PREREQ(maj, min) 0\n#endif\n\n/* __restrict is known in EGCS 1.2 and above. */\n#if !__GNUC_PREREQ(2,92)\n# ifndef __restrict\n#  define __restrict\n# endif\n#endif\n\n#if !__GNUC_PREREQ(2,7)\n# ifndef __attribute__\n#  define __attribute__(x)\n# endif\n#endif\n\n#undef inline\n#if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L\n/* it's a keyword */\n#elif __GNUC_PREREQ(2,7)\n# define inline __inline__\n#elif defined(_MSC_VER)\n#define inline __inline\n#else\n# define inline\n#endif\n\n#ifndef __const\n# define __const const\n#endif\n\n#define UNUSED_PARAM __attribute__ ((__unused__))\n#define NORETURN __attribute__ ((__noreturn__))\n/* \"The malloc attribute is used to tell the compiler that a function\n * may be treated as if any non-NULL pointer it returns cannot alias\n * any other pointer valid when the function returns. This will often\n * improve optimization. Standard functions with this property include\n * malloc and calloc. realloc-like functions have this property as long\n * as the old pointer is never referred to (including comparing it\n * to the new pointer) after the function returns a non-NULL value.\"\n */\n#if defined(__GNUC__)\n#define RETURNS_MALLOC __attribute__ ((malloc))\n#define PACKED __attribute__ ((__packed__))\n#define ALIGNED(m) __attribute__ ((__aligned__(m)))\n#define PRAGMA_BEGIN_PACKED\n#define PRAGMA_END_PACKED\n#elif defined(_MSC_VER)\n#define RETURNS_MALLOC\n#define PACKED\n#define ALIGNED(m) __declspec(align(m))\n#define PRAGMA_BEGIN_PACKED __pragma(pack(push, 1))\n#define PRAGMA_END_PACKED   __pragma(pack(pop))\n#endif\n\n/* __NO_INLINE__: some gcc's do not honor inlining! :( */\n#if __GNUC_PREREQ(3,0) && !defined(__NO_INLINE__)\n# define ALWAYS_INLINE __attribute__ ((always_inline)) inline\n/* I've seen a toolchain where I needed __noinline__ instead of noinline */\n# define NOINLINE      __attribute__((__noinline__))\n# if !ENABLE_WERROR\n#  define DEPRECATED __attribute__ ((__deprecated__))\n#  define UNUSED_PARAM_RESULT __attribute__ ((warn_unused_result))\n# else\n#  define DEPRECATED\n#  define UNUSED_PARAM_RESULT\n# endif\n#else\n# define ALWAYS_INLINE inline\n# define NOINLINE\n# define DEPRECATED\n# define UNUSED_PARAM_RESULT\n#endif\n\n/* used by unit test machinery to run registration functions before calling main() */\n#define INIT_FUNC __attribute__ ((constructor))\n\n/* -fwhole-program makes all symbols local. The attribute externally_visible\n * forces a symbol global.  */\n#if __GNUC_PREREQ(4,1)\n# define EXTERNALLY_VISIBLE __attribute__(( visibility(\"default\") ))\n//__attribute__ ((__externally_visible__))\n#else\n# define EXTERNALLY_VISIBLE\n#endif\n\n/* At 4.4 gcc become much more anal about this, need to use \"aliased\" types */\n#if __GNUC_PREREQ(4,4)\n# define FIX_ALIASING __attribute__((__may_alias__))\n#else\n# define FIX_ALIASING\n#endif\n\n/* We use __extension__ in some places to suppress -pedantic warnings\n * about GCC extensions.  This feature didn't work properly before\n * gcc 2.8.  */\n#if !__GNUC_PREREQ(2,8)\n# ifndef __extension__\n#  define __extension__\n# endif\n#endif\n\n/* FAST_FUNC is a qualifier which (possibly) makes function call faster\n * and/or smaller by using modified ABI. It is usually only needed\n * on non-static, busybox internal functions. Recent versions of gcc\n * optimize statics automatically. FAST_FUNC on static is required\n * only if you need to match a function pointer's type */\n#if __GNUC_PREREQ(3,0) && !defined(__MINGW32__) && defined(i386) /* || defined(__x86_64__)? */\n/* stdcall makes callee to pop arguments from stack, not caller */\n# define FAST_FUNC __attribute__((regparm(3),stdcall))\n/* #elif ... - add your favorite arch today! */\n#else\n# define FAST_FUNC\n#endif\n\n/* Make all declarations hidden (-fvisibility flag only affects definitions) */\n/* (don't include system headers after this until corresponding pop!) */\n#if __GNUC_PREREQ(4,1) && !defined(__CYGWIN__)\n# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN _Pragma(\"GCC visibility push(hidden)\")\n# define POP_SAVED_FUNCTION_VISIBILITY              _Pragma(\"GCC visibility pop\")\n#else\n# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN\n# define POP_SAVED_FUNCTION_VISIBILITY\n#endif\n\n/* gcc-2.95 had no va_copy but only __va_copy. */\n#if !__GNUC_PREREQ(3,0)\n# include <stdarg.h>\n# if !defined va_copy && defined __va_copy\n#  define va_copy(d,s) __va_copy((d),(s))\n# endif\n#endif\n\n\n/* ---- Endian Detection ------------------------------------ */\n\n#include <limits.h>\n#if defined(__digital__) && defined(__unix__)\n# include <sex.h>\n#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \\\n   || defined(__APPLE__)\n# include <sys/resource.h>  /* rlimit */\n# include <machine/endian.h>\n# define bswap_64 __bswap64\n# define bswap_32 __bswap32\n# define bswap_16 __bswap16\n#elif defined(_MSC_VER) || defined(__MINGW32__)\n#include <stdint.h>\n#ifndef bswap_16\nstatic __inline uint16_t bswap_16(uint16_t x)\n{\n\tx = (x>>8) | (x<<8);\n\treturn x;\n}\n#endif\n\n#ifndef bswap_32\nstatic __inline uint32_t bswap_32(uint32_t x)\n{\n\tx = ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);\n\tx = (x>>16) | (x<<16);\n\treturn x;\n}\n#endif\n\n#ifndef bswap_64\nstatic __inline uint64_t bswap_64(uint64_t x)\n{\n\tunion {\n\t\tuint64_t ll;\n\t\tuint32_t l[2];\n\t} w, r;\n\tw.ll = x;\n\tr.l[0] = bswap_32(w.l[1]);\n\tr.l[1] = bswap_32(w.l[0]);\n\treturn r.ll;\n}\n#endif\n\n#else\n# include <byteswap.h>\n# include <endian.h>\n#endif\n\n#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN\n# define BB_BIG_ENDIAN 1\n# define BB_LITTLE_ENDIAN 0\n#elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN\n# define BB_BIG_ENDIAN 0\n# define BB_LITTLE_ENDIAN 1\n#elif defined(_BYTE_ORDER) && _BYTE_ORDER == _BIG_ENDIAN\n# define BB_BIG_ENDIAN 1\n# define BB_LITTLE_ENDIAN 0\n#elif defined(_BYTE_ORDER) && _BYTE_ORDER == _LITTLE_ENDIAN\n# define BB_BIG_ENDIAN 0\n# define BB_LITTLE_ENDIAN 1\n#elif defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN\n# define BB_BIG_ENDIAN 1\n# define BB_LITTLE_ENDIAN 0\n#elif defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN\n# define BB_BIG_ENDIAN 0\n# define BB_LITTLE_ENDIAN 1\n#elif defined(__386__) || defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM) || (defined(_M_ARM64))\n# define BB_BIG_ENDIAN 0\n# define BB_LITTLE_ENDIAN 1\n#else\n# error \"Can't determine endianness\"\n#endif\n\n#if ULONG_MAX > 0xffffffff\n# define bb_bswap_64(x) bswap_64(x)\n#endif\n\n/* SWAP_LEnn means \"convert CPU<->little_endian by swapping bytes\" */\n#if BB_BIG_ENDIAN\n# define SWAP_BE16(x) (x)\n# define SWAP_BE32(x) (x)\n# define SWAP_BE64(x) (x)\n# define SWAP_LE16(x) bswap_16(x)\n# define SWAP_LE32(x) bswap_32(x)\n# define SWAP_LE64(x) bb_bswap_64(x)\n# define IF_BIG_ENDIAN(...) __VA_ARGS__\n# define IF_LITTLE_ENDIAN(...)\n#else\n# define SWAP_BE16(x) bswap_16(x)\n# define SWAP_BE32(x) bswap_32(x)\n# define SWAP_BE64(x) bb_bswap_64(x)\n# define SWAP_LE16(x) (x)\n# define SWAP_LE32(x) (x)\n# define SWAP_LE64(x) (x)\n# define IF_BIG_ENDIAN(...)\n# define IF_LITTLE_ENDIAN(...) __VA_ARGS__\n#endif\n\n\n/* ---- Unaligned access ------------------------------------ */\n\n#include <stdint.h>\ntypedef int      bb__aliased_int      FIX_ALIASING;\ntypedef long     bb__aliased_long     FIX_ALIASING;\ntypedef uint16_t bb__aliased_uint16_t FIX_ALIASING;\ntypedef uint32_t bb__aliased_uint32_t FIX_ALIASING;\ntypedef uint64_t bb__aliased_uint64_t FIX_ALIASING;\n\n/* NB: unaligned parameter should be a pointer, aligned one -\n * a lvalue. This makes it more likely to not swap them by mistake\n */\n#if defined(i386) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) || defined(__powerpc__)\n# define BB_UNALIGNED_MEMACCESS_OK 1\n# define move_from_unaligned_int(v, intp)  ((v) = *(bb__aliased_int*)(intp))\n# define move_from_unaligned_long(v, longp) ((v) = *(bb__aliased_long*)(longp))\n# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p))\n# define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p))\n# define move_to_unaligned16(u16p, v)   (*(bb__aliased_uint16_t*)(u16p) = (v))\n# define move_to_unaligned32(u32p, v)   (*(bb__aliased_uint32_t*)(u32p) = (v))\n/* #elif ... - add your favorite arch today! */\n#else\n# define BB_UNALIGNED_MEMACCESS_OK 0\n/* performs reasonably well (gcc usually inlines memcpy here) */\n# define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int)))\n# define move_from_unaligned_long(v, longp) (memcpy(&(v), (longp), sizeof(long)))\n# define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2))\n# define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4))\n# define move_to_unaligned16(u16p, v) do { \\\n\tuint16_t __t = (v); \\\n\tmemcpy((u16p), &__t, 2); \\\n} while (0)\n# define move_to_unaligned32(u32p, v) do { \\\n\tuint32_t __t = (v); \\\n\tmemcpy((u32p), &__t, 4); \\\n} while (0)\n#endif\n\n\n/* ---- Size-saving \"small\" ints (arch-dependent) ----------- */\n\n#if defined(__386__) || defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) || defined(__mips__) || defined(__cris__)\n/* add other arches which benefit from this... */\ntypedef signed char smallint;\ntypedef unsigned char smalluint;\n#else\n/* for arches where byte accesses generate larger code: */\ntypedef int smallint;\ntypedef unsigned smalluint;\n#endif\n\n/* ISO C Standard:  7.16  Boolean type and values  <stdbool.h> */\n#if (defined __digital__ && defined __unix__)\n/* old system without (proper) C99 support */\n# define bool smalluint\n#else\n/* modern system, so use it */\n# include <stdbool.h>\n#endif\n\n\n/*----- Kernel versioning ------------------------------------*/\n\n#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))\n\n#ifdef __UCLIBC__\n# define UCLIBC_VERSION KERNEL_VERSION(__UCLIBC_MAJOR__, __UCLIBC_MINOR__, __UCLIBC_SUBLEVEL__)\n#else\n# define UCLIBC_VERSION 0\n#endif\n\n\n/* ---- Miscellaneous --------------------------------------- */\n\n#if defined __GLIBC__ \\\n || defined __UCLIBC__ \\\n || defined __dietlibc__ \\\n || defined __BIONIC__ \\\n || defined _NEWLIB_VERSION\n# include <features.h>\n#endif\n\n/* Define bb_setpgrp */\n#if defined(__digital__) && defined(__unix__)\n/* use legacy setpgrp(pid_t, pid_t) for now.  move to platform.c */\n# define bb_setpgrp() do { pid_t __me = getpid(); setpgrp(__me, __me); } while (0)\n#else\n# define bb_setpgrp() setpgrp()\n#endif\n\n/* Useful for defeating gcc's alignment of \"char message[]\"-like data */\n#if !defined(__s390__)\n    /* on s390[x], non-word-aligned data accesses require larger code */\n# define ALIGN1 __attribute__((aligned(1)))\n# define ALIGN2 __attribute__((aligned(2)))\n# define ALIGN4 __attribute__((aligned(4)))\n#else\n/* Arches which MUST have 2 or 4 byte alignment for everything are here */\n# define ALIGN1\n# define ALIGN2\n# define ALIGN4\n#endif\n\n/*\n * For 0.9.29 and svn, __ARCH_USE_MMU__ indicates no-mmu reliably.\n * For earlier versions there is no reliable way to check if we are building\n * for a mmu-less system.\n */\n#if ENABLE_NOMMU || \\\n    (defined __UCLIBC__ && \\\n     UCLIBC_VERSION > KERNEL_VERSION(0, 9, 28) && \\\n     !defined __ARCH_USE_MMU__)\n# define BB_MMU 0\n# define USE_FOR_NOMMU(...) __VA_ARGS__\n# define USE_FOR_MMU(...)\n#else\n# define BB_MMU 1\n# define USE_FOR_NOMMU(...)\n# define USE_FOR_MMU(...) __VA_ARGS__\n#endif\n\n#if defined(__digital__) && defined(__unix__)\n# include <standards.h>\n# include <inttypes.h>\n# define PRIu32 \"u\"\n# if !defined ADJ_OFFSET_SINGLESHOT && defined MOD_CLKA && defined MOD_OFFSET\n#  define ADJ_OFFSET_SINGLESHOT (MOD_CLKA | MOD_OFFSET)\n# endif\n# if !defined ADJ_FREQUENCY && defined MOD_FREQUENCY\n#  define ADJ_FREQUENCY MOD_FREQUENCY\n# endif\n# if !defined ADJ_TIMECONST && defined MOD_TIMECONST\n#  define ADJ_TIMECONST MOD_TIMECONST\n# endif\n# if !defined ADJ_TICK && defined MOD_CLKB\n#  define ADJ_TICK MOD_CLKB\n# endif\n#endif\n\n#if defined(__CYGWIN__)\n# define MAXSYMLINKS SYMLOOP_MAX\n#endif\n\n#if defined(ANDROID) || defined(__ANDROID__)\n# define BB_ADDITIONAL_PATH \":/system/sbin:/system/bin:/system/xbin\"\n# define SYS_ioprio_set __NR_ioprio_set\n# define SYS_ioprio_get __NR_ioprio_get\n#endif\n\n\n/* ---- Who misses what? ------------------------------------ */\n\n/* Assume all these functions and header files exist by default.\n * Platforms where it is not true will #undef them below.\n */\n#define HAVE_CLEARENV 1\n#define HAVE_FDATASYNC 1\n#define HAVE_DPRINTF 1\n#define HAVE_MEMRCHR 1\n#define HAVE_MKDTEMP 1\n#define HAVE_TTYNAME_R 1\n#define HAVE_PTSNAME_R 1\n#define HAVE_SETBIT 1\n#define HAVE_SIGHANDLER_T 1\n#define HAVE_STPCPY 1\n#define HAVE_MEMPCPY 1\n#define HAVE_STRCASESTR 1\n#define HAVE_STRCHRNUL 1\n#define HAVE_STRSEP 1\n#define HAVE_STRSIGNAL 1\n#define HAVE_STRVERSCMP 1\n#define HAVE_VASPRINTF 1\n#define HAVE_USLEEP 1\n#define HAVE_UNLOCKED_STDIO 1\n#define HAVE_UNLOCKED_LINE_OPS 1\n#define HAVE_GETLINE 1\n#define HAVE_XTABS 1\n#define HAVE_MNTENT_H 1\n#define HAVE_NET_ETHERNET_H 1\n#define HAVE_SYS_STATFS_H 1\n\n#if defined(__UCLIBC__)\n# if UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32)\n#  undef HAVE_STRVERSCMP\n# endif\n# if UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 30)\n#  ifndef __UCLIBC_SUSV3_LEGACY__\n#   undef HAVE_USLEEP\n#  endif\n# endif\n#endif\n\n#if defined(__WATCOMC__)\n# undef HAVE_DPRINTF\n# undef HAVE_GETLINE\n# undef HAVE_MEMRCHR\n# undef HAVE_MKDTEMP\n# undef HAVE_SETBIT\n# undef HAVE_STPCPY\n# undef HAVE_STRCASESTR\n# undef HAVE_STRCHRNUL\n# undef HAVE_STRSEP\n# undef HAVE_STRSIGNAL\n# undef HAVE_STRVERSCMP\n# undef HAVE_VASPRINTF\n# undef HAVE_UNLOCKED_STDIO\n# undef HAVE_UNLOCKED_LINE_OPS\n# undef HAVE_NET_ETHERNET_H\n#endif\n\n#if defined(_MSC_VER)\n/* We need to define ssize_t before the getline declaration below (copy/paste from MinGW) */\n#ifndef _SSIZE_T_DEFINED\n#define _SSIZE_T_DEFINED\n#undef ssize_t\n#ifdef _WIN64\n  typedef __int64 ssize_t;\n#else\n  typedef int ssize_t;\n#endif\n#endif\n# undef HAVE_GETLINE\n# undef HAVE_MEMRCHR\n# undef HAVE_MKDTEMP\n# undef HAVE_MNTENT_H\n# undef HAVE_SETBIT\n# undef HAVE_STPCPY\n# undef HAVE_STRCASESTR\n# undef HAVE_STRCHRNUL\n# undef HAVE_STRSEP\n# undef HAVE_STRSIGNAL\n# undef HAVE_STRVERSCMP\n# undef HAVE_SYS_STATFS_H\n# undef HAVE_VASPRINTF\n# undef HAVE_UNLOCKED_STDIO\n# undef HAVE_UNLOCKED_LINE_OPS\n# undef HAVE_NET_ETHERNET_H\n#endif\n\n#if defined(__CYGWIN__)\n# undef HAVE_CLEARENV\n# undef HAVE_FDPRINTF\n# undef HAVE_MEMRCHR\n# undef HAVE_PTSNAME_R\n# undef HAVE_STRVERSCMP\n# undef HAVE_UNLOCKED_LINE_OPS\n#endif\n\n/* These BSD-derived OSes share many similarities */\n#if (defined __digital__ && defined __unix__) \\\n || defined __APPLE__ \\\n || defined __OpenBSD__ || defined __NetBSD__\n# undef HAVE_CLEARENV\n# undef HAVE_FDATASYNC\n# undef HAVE_GETLINE\n# undef HAVE_MNTENT_H\n# undef HAVE_PTSNAME_R\n# undef HAVE_SYS_STATFS_H\n# undef HAVE_SIGHANDLER_T\n# undef HAVE_STRVERSCMP\n# undef HAVE_XTABS\n# undef HAVE_DPRINTF\n# undef HAVE_UNLOCKED_STDIO\n# undef HAVE_UNLOCKED_LINE_OPS\n#endif\n\n#if defined(__dietlibc__)\n# undef HAVE_STRCHRNUL\n#endif\n\n#if defined(__APPLE__)\n# undef HAVE_STRCHRNUL\n#endif\n\n#if defined(__FreeBSD__)\n/* users say mempcpy is not present in FreeBSD 9.x */\n# undef HAVE_MEMPCPY\n# undef HAVE_CLEARENV\n# undef HAVE_FDATASYNC\n# undef HAVE_MNTENT_H\n# undef HAVE_PTSNAME_R\n# undef HAVE_SYS_STATFS_H\n# undef HAVE_SIGHANDLER_T\n# undef HAVE_STRVERSCMP\n# undef HAVE_XTABS\n# undef HAVE_UNLOCKED_LINE_OPS\n# include <osreldate.h>\n# if __FreeBSD_version < 1000029\n#  undef HAVE_STRCHRNUL /* FreeBSD added strchrnul() between 1000028 and 1000029 */\n# endif\n#endif\n\n#if defined(__NetBSD__)\n# define HAVE_GETLINE 1  /* Recent NetBSD versions have getline() */\n#endif\n\n#if defined(__digital__) && defined(__unix__)\n# undef HAVE_STPCPY\n#endif\n\n#if defined(ANDROID) || defined(__ANDROID__)\n# if __ANDROID_API__ < 8\n#  undef HAVE_DPRINTF\n# else\n#  define dprintf fdprintf\n# endif\n# if __ANDROID_API__ < 21\n#  undef HAVE_TTYNAME_R\n#  undef HAVE_GETLINE\n#  undef HAVE_STPCPY\n# endif\n# undef HAVE_MEMPCPY\n# undef HAVE_STRCHRNUL\n# undef HAVE_STRVERSCMP\n# undef HAVE_UNLOCKED_LINE_OPS\n# undef HAVE_NET_ETHERNET_H\n#endif\n\n/*\n * Now, define prototypes for all the functions defined in platform.c\n * These must come after all the HAVE_* macros are defined (or not)\n */\n\n#ifndef HAVE_DPRINTF\nextern int dprintf(int fd, const char *format, ...);\n#endif\n\n#ifndef HAVE_MEMRCHR\nextern void *memrchr(const void *s, int c, size_t n) FAST_FUNC;\n#endif\n\n#ifndef HAVE_MKDTEMP\nextern char *mkdtemp(char *template) FAST_FUNC;\n#endif\n\n#ifndef HAVE_TTYNAME_R\n#define ttyname_r bb_ttyname_r\nextern int ttyname_r(int fd, char *buf, size_t buflen);\n#endif\n\n#ifndef HAVE_SETBIT\n# define setbit(a, b)  ((a)[(b) >> 3] |= 1 << ((b) & 7))\n# define clrbit(a, b)  ((a)[(b) >> 3] &= ~(1 << ((b) & 7)))\n#endif\n\n#ifndef HAVE_SIGHANDLER_T\ntypedef void (*sighandler_t)(int);\n#endif\n\n#ifndef HAVE_STPCPY\nextern char *stpcpy(char *p, const char *to_add) FAST_FUNC;\n#endif\n\n#ifndef HAVE_MEMPCPY\n#include <string.h>\n/* In case we are wrong about !HAVE_MEMPCPY, and toolchain _does_ have\n * mempcpy(), avoid colliding with it:\n */\n#define mempcpy bb__mempcpy\nstatic ALWAYS_INLINE void *mempcpy(void *dest, const void *src, size_t len)\n{\n\treturn memcpy(dest, src, len) + len;\n}\n#endif\n\n#ifndef HAVE_STRCASESTR\nextern char *strcasestr(const char *s, const char *pattern) FAST_FUNC;\n#endif\n\n#ifndef HAVE_STRCHRNUL\nextern char *strchrnul(const char *s, int c) FAST_FUNC;\n#endif\n\n#ifndef HAVE_STRSEP\nextern char *strsep(char **stringp, const char *delim) FAST_FUNC;\n#endif\n\n#ifndef HAVE_STRSIGNAL\n/* Not exactly the same: instead of \"Stopped\" it shows \"STOP\" etc */\n# define strsignal(sig) get_signame(sig)\n#endif\n\n#ifndef HAVE_USLEEP\nextern int usleep(unsigned) FAST_FUNC;\n#endif\n\n#ifndef HAVE_VASPRINTF\nextern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC;\n#endif\n\n#ifndef HAVE_GETLINE\n# include <stdio.h> /* for FILE */\n# include <sys/types.h> /* size_t */\nextern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC;\n#endif\n\n#endif\n"
  },
  {
    "path": "src/bled/seek_by_jump.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\nvoid FAST_FUNC seek_by_jump(int fd, off_t amount)\n{\n\tif (amount\n\t && lseek(fd, amount, SEEK_CUR) == (off_t) -1\n\t) {\n\t\tif (errno == ESPIPE)\n\t\t\tseek_by_read(fd, amount);\n\t\telse\n\t\t\tbb_perror_msg_and_die(\"seek failure\");\n\t}\n}\n"
  },
  {
    "path": "src/bled/seek_by_read.c",
    "content": "/* vi: set sw=4 ts=4: */\n/*\n * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n */\n#include \"libbb.h\"\n#include \"bb_archive.h\"\n\n/*  If we are reading through a pipe, or from stdin then we can't lseek,\n *  we must read and discard the data to skip over it.\n */\nvoid FAST_FUNC seek_by_read(int fd, off_t amount)\n{\n\tif (amount)\n\t\tbb_copyfd_exact_size(fd, -1, amount);\n}\n"
  },
  {
    "path": "src/bled/xxhash.c",
    "content": "/*\n * xxHash - Extremely Fast Hash algorithm\n * Copyright (c) Yann Collet - Meta Platforms, Inc\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/*\n * xxhash.c instantiates functions defined in xxhash.h\n */\n\n#define XXH_STATIC_LINKING_ONLY /* access advanced declarations */\n#define XXH_IMPLEMENTATION      /* access definitions */\n\n#include \"xxhash.h\"\n"
  },
  {
    "path": "src/bled/xxhash.h",
    "content": "/*\n * xxHash - Extremely Fast Hash algorithm\n * Header File\n * Copyright (c) Yann Collet - Meta Platforms, Inc\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/* Local adaptations for Zstandard */\n\n#ifndef XXH_NO_XXH3\n# define XXH_NO_XXH3\n#endif\n\n#ifndef XXH_NAMESPACE\n# define XXH_NAMESPACE ZSTD_\n#endif\n\n/*!\n * @mainpage xxHash\n *\n * xxHash is an extremely fast non-cryptographic hash algorithm, working at RAM speed\n * limits.\n *\n * It is proposed in four flavors, in three families:\n * 1. @ref XXH32_family\n *   - Classic 32-bit hash function. Simple, compact, and runs on almost all\n *     32-bit and 64-bit systems.\n * 2. @ref XXH64_family\n *   - Classic 64-bit adaptation of XXH32. Just as simple, and runs well on most\n *     64-bit systems (but _not_ 32-bit systems).\n * 3. @ref XXH3_family\n *   - Modern 64-bit and 128-bit hash function family which features improved\n *     strength and performance across the board, especially on smaller data.\n *     It benefits greatly from SIMD and 64-bit without requiring it.\n *\n * Benchmarks\n * ---\n * The reference system uses an Intel i7-9700K CPU, and runs Ubuntu x64 20.04.\n * The open source benchmark program is compiled with clang v10.0 using -O3 flag.\n *\n * | Hash Name            | ISA ext | Width | Large Data Speed | Small Data Velocity |\n * | -------------------- | ------- | ----: | ---------------: | ------------------: |\n * | XXH3_64bits()        | @b AVX2 |    64 |        59.4 GB/s |               133.1 |\n * | MeowHash             | AES-NI  |   128 |        58.2 GB/s |                52.5 |\n * | XXH3_128bits()       | @b AVX2 |   128 |        57.9 GB/s |               118.1 |\n * | CLHash               | PCLMUL  |    64 |        37.1 GB/s |                58.1 |\n * | XXH3_64bits()        | @b SSE2 |    64 |        31.5 GB/s |               133.1 |\n * | XXH3_128bits()       | @b SSE2 |   128 |        29.6 GB/s |               118.1 |\n * | RAM sequential read  |         |   N/A |        28.0 GB/s |                 N/A |\n * | ahash                | AES-NI  |    64 |        22.5 GB/s |               107.2 |\n * | City64               |         |    64 |        22.0 GB/s |                76.6 |\n * | T1ha2                |         |    64 |        22.0 GB/s |                99.0 |\n * | City128              |         |   128 |        21.7 GB/s |                57.7 |\n * | FarmHash             | AES-NI  |    64 |        21.3 GB/s |                71.9 |\n * | XXH64()              |         |    64 |        19.4 GB/s |                71.0 |\n * | SpookyHash           |         |    64 |        19.3 GB/s |                53.2 |\n * | Mum                  |         |    64 |        18.0 GB/s |                67.0 |\n * | CRC32C               | SSE4.2  |    32 |        13.0 GB/s |                57.9 |\n * | XXH32()              |         |    32 |         9.7 GB/s |                71.9 |\n * | City32               |         |    32 |         9.1 GB/s |                66.0 |\n * | Blake3*              | @b AVX2 |   256 |         4.4 GB/s |                 8.1 |\n * | Murmur3              |         |    32 |         3.9 GB/s |                56.1 |\n * | SipHash*             |         |    64 |         3.0 GB/s |                43.2 |\n * | Blake3*              | @b SSE2 |   256 |         2.4 GB/s |                 8.1 |\n * | HighwayHash          |         |    64 |         1.4 GB/s |                 6.0 |\n * | FNV64                |         |    64 |         1.2 GB/s |                62.7 |\n * | Blake2*              |         |   256 |         1.1 GB/s |                 5.1 |\n * | SHA1*                |         |   160 |         0.8 GB/s |                 5.6 |\n * | MD5*                 |         |   128 |         0.6 GB/s |                 7.8 |\n * @note\n *   - Hashes which require a specific ISA extension are noted. SSE2 is also noted,\n *     even though it is mandatory on x64.\n *   - Hashes with an asterisk are cryptographic. Note that MD5 is non-cryptographic\n *     by modern standards.\n *   - Small data velocity is a rough average of algorithm's efficiency for small\n *     data. For more accurate information, see the wiki.\n *   - More benchmarks and strength tests are found on the wiki:\n *         https://github.com/Cyan4973/xxHash/wiki\n *\n * Usage\n * ------\n * All xxHash variants use a similar API. Changing the algorithm is a trivial\n * substitution.\n *\n * @pre\n *    For functions which take an input and length parameter, the following\n *    requirements are assumed:\n *    - The range from [`input`, `input + length`) is valid, readable memory.\n *      - The only exception is if the `length` is `0`, `input` may be `NULL`.\n *    - For C++, the objects must have the *TriviallyCopyable* property, as the\n *      functions access bytes directly as if it was an array of `unsigned char`.\n *\n * @anchor single_shot_example\n * **Single Shot**\n *\n * These functions are stateless functions which hash a contiguous block of memory,\n * immediately returning the result. They are the easiest and usually the fastest\n * option.\n *\n * XXH32(), XXH64(), XXH3_64bits(), XXH3_128bits()\n *\n * @code{.c}\n *   #include <string.h>\n *   #include \"xxhash.h\"\n *\n *   // Example for a function which hashes a null terminated string with XXH32().\n *   XXH32_hash_t hash_string(const char* string, XXH32_hash_t seed)\n *   {\n *       // NULL pointers are only valid if the length is zero\n *       size_t length = (string == NULL) ? 0 : strlen(string);\n *       return XXH32(string, length, seed);\n *   }\n * @endcode\n *\n *\n * @anchor streaming_example\n * **Streaming**\n *\n * These groups of functions allow incremental hashing of unknown size, even\n * more than what would fit in a size_t.\n *\n * XXH32_reset(), XXH64_reset(), XXH3_64bits_reset(), XXH3_128bits_reset()\n *\n * @code{.c}\n *   #include <stdio.h>\n *   #include <assert.h>\n *   #include \"xxhash.h\"\n *   // Example for a function which hashes a FILE incrementally with XXH3_64bits().\n *   XXH64_hash_t hashFile(FILE* f)\n *   {\n *       // Allocate a state struct. Do not just use malloc() or new.\n *       XXH3_state_t* state = XXH3_createState();\n *       assert(state != NULL && \"Out of memory!\");\n *       // Reset the state to start a new hashing session.\n *       XXH3_64bits_reset(state);\n *       char buffer[4096];\n *       size_t count;\n *       // Read the file in chunks\n *       while ((count = fread(buffer, 1, sizeof(buffer), f)) != 0) {\n *           // Run update() as many times as necessary to process the data\n *           XXH3_64bits_update(state, buffer, count);\n *       }\n *       // Retrieve the finalized hash. This will not change the state.\n *       XXH64_hash_t result = XXH3_64bits_digest(state);\n *       // Free the state. Do not use free().\n *       XXH3_freeState(state);\n *       return result;\n *   }\n * @endcode\n *\n * Streaming functions generate the xxHash value from an incremental input.\n * This method is slower than single-call functions, due to state management.\n * For small inputs, prefer `XXH32()` and `XXH64()`, which are better optimized.\n *\n * An XXH state must first be allocated using `XXH*_createState()`.\n *\n * Start a new hash by initializing the state with a seed using `XXH*_reset()`.\n *\n * Then, feed the hash state by calling `XXH*_update()` as many times as necessary.\n *\n * The function returns an error code, with 0 meaning OK, and any other value\n * meaning there is an error.\n *\n * Finally, a hash value can be produced anytime, by using `XXH*_digest()`.\n * This function returns the nn-bits hash as an int or long long.\n *\n * It's still possible to continue inserting input into the hash state after a\n * digest, and generate new hash values later on by invoking `XXH*_digest()`.\n *\n * When done, release the state using `XXH*_freeState()`.\n *\n *\n * @anchor canonical_representation_example\n * **Canonical Representation**\n *\n * The default return values from XXH functions are unsigned 32, 64 and 128 bit\n * integers.\n * This the simplest and fastest format for further post-processing.\n *\n * However, this leaves open the question of what is the order on the byte level,\n * since little and big endian conventions will store the same number differently.\n *\n * The canonical representation settles this issue by mandating big-endian\n * convention, the same convention as human-readable numbers (large digits first).\n *\n * When writing hash values to storage, sending them over a network, or printing\n * them, it's highly recommended to use the canonical representation to ensure\n * portability across a wider range of systems, present and future.\n *\n * The following functions allow transformation of hash values to and from\n * canonical format.\n *\n * XXH32_canonicalFromHash(), XXH32_hashFromCanonical(),\n * XXH64_canonicalFromHash(), XXH64_hashFromCanonical(),\n * XXH128_canonicalFromHash(), XXH128_hashFromCanonical(),\n *\n * @code{.c}\n *   #include <stdio.h>\n *   #include \"xxhash.h\"\n *\n *   // Example for a function which prints XXH32_hash_t in human readable format\n *   void printXxh32(XXH32_hash_t hash)\n *   {\n *       XXH32_canonical_t cano;\n *       XXH32_canonicalFromHash(&cano, hash);\n *       size_t i;\n *       for(i = 0; i < sizeof(cano.digest); ++i) {\n *           printf(\"%02x\", cano.digest[i]);\n *       }\n *       printf(\"\\n\");\n *   }\n *\n *   // Example for a function which converts XXH32_canonical_t to XXH32_hash_t\n *   XXH32_hash_t convertCanonicalToXxh32(XXH32_canonical_t cano)\n *   {\n *       XXH32_hash_t hash = XXH32_hashFromCanonical(&cano);\n *       return hash;\n *   }\n * @endcode\n *\n *\n * @file xxhash.h\n * xxHash prototypes and implementation\n */\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n/* ****************************\n *  INLINE mode\n ******************************/\n/*!\n * @defgroup public Public API\n * Contains details on the public xxHash functions.\n * @{\n */\n#ifdef XXH_DOXYGEN\n/*!\n * @brief Gives access to internal state declaration, required for static allocation.\n *\n * Incompatible with dynamic linking, due to risks of ABI changes.\n *\n * Usage:\n * @code{.c}\n *     #define XXH_STATIC_LINKING_ONLY\n *     #include \"xxhash.h\"\n * @endcode\n */\n#  define XXH_STATIC_LINKING_ONLY\n/* Do not undef XXH_STATIC_LINKING_ONLY for Doxygen */\n\n/*!\n * @brief Gives access to internal definitions.\n *\n * Usage:\n * @code{.c}\n *     #define XXH_STATIC_LINKING_ONLY\n *     #define XXH_IMPLEMENTATION\n *     #include \"xxhash.h\"\n * @endcode\n */\n#  define XXH_IMPLEMENTATION\n/* Do not undef XXH_IMPLEMENTATION for Doxygen */\n\n/*!\n * @brief Exposes the implementation and marks all functions as `inline`.\n *\n * Use these build macros to inline xxhash into the target unit.\n * Inlining improves performance on small inputs, especially when the length is\n * expressed as a compile-time constant:\n *\n *  https://fastcompression.blogspot.com/2018/03/xxhash-for-small-keys-impressive-power.html\n *\n * It also keeps xxHash symbols private to the unit, so they are not exported.\n *\n * Usage:\n * @code{.c}\n *     #define XXH_INLINE_ALL\n *     #include \"xxhash.h\"\n * @endcode\n * Do not compile and link xxhash.o as a separate object, as it is not useful.\n */\n#  define XXH_INLINE_ALL\n#  undef XXH_INLINE_ALL\n/*!\n * @brief Exposes the implementation without marking functions as inline.\n */\n#  define XXH_PRIVATE_API\n#  undef XXH_PRIVATE_API\n/*!\n * @brief Emulate a namespace by transparently prefixing all symbols.\n *\n * If you want to include _and expose_ xxHash functions from within your own\n * library, but also want to avoid symbol collisions with other libraries which\n * may also include xxHash, you can use @ref XXH_NAMESPACE to automatically prefix\n * any public symbol from xxhash library with the value of @ref XXH_NAMESPACE\n * (therefore, avoid empty or numeric values).\n *\n * Note that no change is required within the calling program as long as it\n * includes `xxhash.h`: Regular symbol names will be automatically translated\n * by this header.\n */\n#  define XXH_NAMESPACE /* YOUR NAME HERE */\n#  undef XXH_NAMESPACE\n#endif\n\n#if (defined(XXH_INLINE_ALL) || defined(XXH_PRIVATE_API)) \\\n    && !defined(XXH_INLINE_ALL_31684351384)\n   /* this section should be traversed only once */\n#  define XXH_INLINE_ALL_31684351384\n   /* give access to the advanced API, required to compile implementations */\n#  undef XXH_STATIC_LINKING_ONLY   /* avoid macro redef */\n#  define XXH_STATIC_LINKING_ONLY\n   /* make all functions private */\n#  undef XXH_PUBLIC_API\n#  if defined(__GNUC__)\n#    define XXH_PUBLIC_API static __inline __attribute__((unused))\n#  elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)\n#    define XXH_PUBLIC_API static inline\n#  elif defined(_MSC_VER)\n#    define XXH_PUBLIC_API static __inline\n#  else\n     /* note: this version may generate warnings for unused static functions */\n#    define XXH_PUBLIC_API static\n#  endif\n\n   /*\n    * This part deals with the special case where a unit wants to inline xxHash,\n    * but \"xxhash.h\" has previously been included without XXH_INLINE_ALL,\n    * such as part of some previously included *.h header file.\n    * Without further action, the new include would just be ignored,\n    * and functions would effectively _not_ be inlined (silent failure).\n    * The following macros solve this situation by prefixing all inlined names,\n    * avoiding naming collision with previous inclusions.\n    */\n   /* Before that, we unconditionally #undef all symbols,\n    * in case they were already defined with XXH_NAMESPACE.\n    * They will then be redefined for XXH_INLINE_ALL\n    */\n#  undef XXH_versionNumber\n    /* XXH32 */\n#  undef XXH32\n#  undef XXH32_createState\n#  undef XXH32_freeState\n#  undef XXH32_reset\n#  undef XXH32_update\n#  undef XXH32_digest\n#  undef XXH32_copyState\n#  undef XXH32_canonicalFromHash\n#  undef XXH32_hashFromCanonical\n    /* XXH64 */\n#  undef XXH64\n#  undef XXH64_createState\n#  undef XXH64_freeState\n#  undef XXH64_reset\n#  undef XXH64_update\n#  undef XXH64_digest\n#  undef XXH64_copyState\n#  undef XXH64_canonicalFromHash\n#  undef XXH64_hashFromCanonical\n    /* XXH3_64bits */\n#  undef XXH3_64bits\n#  undef XXH3_64bits_withSecret\n#  undef XXH3_64bits_withSeed\n#  undef XXH3_64bits_withSecretandSeed\n#  undef XXH3_createState\n#  undef XXH3_freeState\n#  undef XXH3_copyState\n#  undef XXH3_64bits_reset\n#  undef XXH3_64bits_reset_withSeed\n#  undef XXH3_64bits_reset_withSecret\n#  undef XXH3_64bits_update\n#  undef XXH3_64bits_digest\n#  undef XXH3_generateSecret\n    /* XXH3_128bits */\n#  undef XXH128\n#  undef XXH3_128bits\n#  undef XXH3_128bits_withSeed\n#  undef XXH3_128bits_withSecret\n#  undef XXH3_128bits_reset\n#  undef XXH3_128bits_reset_withSeed\n#  undef XXH3_128bits_reset_withSecret\n#  undef XXH3_128bits_reset_withSecretandSeed\n#  undef XXH3_128bits_update\n#  undef XXH3_128bits_digest\n#  undef XXH128_isEqual\n#  undef XXH128_cmp\n#  undef XXH128_canonicalFromHash\n#  undef XXH128_hashFromCanonical\n    /* Finally, free the namespace itself */\n#  undef XXH_NAMESPACE\n\n    /* employ the namespace for XXH_INLINE_ALL */\n#  define XXH_NAMESPACE XXH_INLINE_\n   /*\n    * Some identifiers (enums, type names) are not symbols,\n    * but they must nonetheless be renamed to avoid redeclaration.\n    * Alternative solution: do not redeclare them.\n    * However, this requires some #ifdefs, and has a more dispersed impact.\n    * Meanwhile, renaming can be achieved in a single place.\n    */\n#  define XXH_IPREF(Id)   XXH_NAMESPACE ## Id\n#  define XXH_OK XXH_IPREF(XXH_OK)\n#  define XXH_ERROR XXH_IPREF(XXH_ERROR)\n#  define XXH_errorcode XXH_IPREF(XXH_errorcode)\n#  define XXH32_canonical_t  XXH_IPREF(XXH32_canonical_t)\n#  define XXH64_canonical_t  XXH_IPREF(XXH64_canonical_t)\n#  define XXH128_canonical_t XXH_IPREF(XXH128_canonical_t)\n#  define XXH32_state_s XXH_IPREF(XXH32_state_s)\n#  define XXH32_state_t XXH_IPREF(XXH32_state_t)\n#  define XXH64_state_s XXH_IPREF(XXH64_state_s)\n#  define XXH64_state_t XXH_IPREF(XXH64_state_t)\n#  define XXH3_state_s  XXH_IPREF(XXH3_state_s)\n#  define XXH3_state_t  XXH_IPREF(XXH3_state_t)\n#  define XXH128_hash_t XXH_IPREF(XXH128_hash_t)\n   /* Ensure the header is parsed again, even if it was previously included */\n#  undef XXHASH_H_5627135585666179\n#  undef XXHASH_H_STATIC_13879238742\n#endif /* XXH_INLINE_ALL || XXH_PRIVATE_API */\n\n/* ****************************************************************\n *  Stable API\n *****************************************************************/\n#ifndef XXHASH_H_5627135585666179\n#define XXHASH_H_5627135585666179 1\n\n/*! @brief Marks a global symbol. */\n#if !defined(XXH_INLINE_ALL) && !defined(XXH_PRIVATE_API)\n#  if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT))\n#    ifdef XXH_EXPORT\n#      define XXH_PUBLIC_API __declspec(dllexport)\n#    elif XXH_IMPORT\n#      define XXH_PUBLIC_API __declspec(dllimport)\n#    endif\n#  else\n#    define XXH_PUBLIC_API   /* do nothing */\n#  endif\n#endif\n\n#ifdef XXH_NAMESPACE\n#  define XXH_CAT(A,B) A##B\n#  define XXH_NAME2(A,B) XXH_CAT(A,B)\n#  define XXH_versionNumber XXH_NAME2(XXH_NAMESPACE, XXH_versionNumber)\n/* XXH32 */\n#  define XXH32 XXH_NAME2(XXH_NAMESPACE, XXH32)\n#  define XXH32_createState XXH_NAME2(XXH_NAMESPACE, XXH32_createState)\n#  define XXH32_freeState XXH_NAME2(XXH_NAMESPACE, XXH32_freeState)\n#  define XXH32_reset XXH_NAME2(XXH_NAMESPACE, XXH32_reset)\n#  define XXH32_update XXH_NAME2(XXH_NAMESPACE, XXH32_update)\n#  define XXH32_digest XXH_NAME2(XXH_NAMESPACE, XXH32_digest)\n#  define XXH32_copyState XXH_NAME2(XXH_NAMESPACE, XXH32_copyState)\n#  define XXH32_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH32_canonicalFromHash)\n#  define XXH32_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH32_hashFromCanonical)\n/* XXH64 */\n#  define XXH64 XXH_NAME2(XXH_NAMESPACE, XXH64)\n#  define XXH64_createState XXH_NAME2(XXH_NAMESPACE, XXH64_createState)\n#  define XXH64_freeState XXH_NAME2(XXH_NAMESPACE, XXH64_freeState)\n#  define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)\n#  define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update)\n#  define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest)\n#  define XXH64_copyState XXH_NAME2(XXH_NAMESPACE, XXH64_copyState)\n#  define XXH64_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash)\n#  define XXH64_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH64_hashFromCanonical)\n/* XXH3_64bits */\n#  define XXH3_64bits XXH_NAME2(XXH_NAMESPACE, XXH3_64bits)\n#  define XXH3_64bits_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecret)\n#  define XXH3_64bits_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSeed)\n#  define XXH3_64bits_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecretandSeed)\n#  define XXH3_createState XXH_NAME2(XXH_NAMESPACE, XXH3_createState)\n#  define XXH3_freeState XXH_NAME2(XXH_NAMESPACE, XXH3_freeState)\n#  define XXH3_copyState XXH_NAME2(XXH_NAMESPACE, XXH3_copyState)\n#  define XXH3_64bits_reset XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset)\n#  define XXH3_64bits_reset_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSeed)\n#  define XXH3_64bits_reset_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecret)\n#  define XXH3_64bits_reset_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecretandSeed)\n#  define XXH3_64bits_update XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_update)\n#  define XXH3_64bits_digest XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_digest)\n#  define XXH3_generateSecret XXH_NAME2(XXH_NAMESPACE, XXH3_generateSecret)\n#  define XXH3_generateSecret_fromSeed XXH_NAME2(XXH_NAMESPACE, XXH3_generateSecret_fromSeed)\n/* XXH3_128bits */\n#  define XXH128 XXH_NAME2(XXH_NAMESPACE, XXH128)\n#  define XXH3_128bits XXH_NAME2(XXH_NAMESPACE, XXH3_128bits)\n#  define XXH3_128bits_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSeed)\n#  define XXH3_128bits_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSecret)\n#  define XXH3_128bits_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSecretandSeed)\n#  define XXH3_128bits_reset XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset)\n#  define XXH3_128bits_reset_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSeed)\n#  define XXH3_128bits_reset_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSecret)\n#  define XXH3_128bits_reset_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSecretandSeed)\n#  define XXH3_128bits_update XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_update)\n#  define XXH3_128bits_digest XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_digest)\n#  define XXH128_isEqual XXH_NAME2(XXH_NAMESPACE, XXH128_isEqual)\n#  define XXH128_cmp     XXH_NAME2(XXH_NAMESPACE, XXH128_cmp)\n#  define XXH128_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH128_canonicalFromHash)\n#  define XXH128_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH128_hashFromCanonical)\n#endif\n\n\n/* *************************************\n*  Compiler specifics\n***************************************/\n\n/* specific declaration modes for Windows */\n#if !defined(XXH_INLINE_ALL) && !defined(XXH_PRIVATE_API)\n#  if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT))\n#    ifdef XXH_EXPORT\n#      define XXH_PUBLIC_API __declspec(dllexport)\n#    elif XXH_IMPORT\n#      define XXH_PUBLIC_API __declspec(dllimport)\n#    endif\n#  else\n#    define XXH_PUBLIC_API   /* do nothing */\n#  endif\n#endif\n\n#if defined (__GNUC__)\n# define XXH_CONSTF  __attribute__((const))\n# define XXH_PUREF   __attribute__((pure))\n# define XXH_MALLOCF __attribute__((malloc))\n#else\n# define XXH_CONSTF  /* disable */\n# define XXH_PUREF\n# define XXH_MALLOCF\n#endif\n\n/* *************************************\n*  Version\n***************************************/\n#define XXH_VERSION_MAJOR    0\n#define XXH_VERSION_MINOR    8\n#define XXH_VERSION_RELEASE  2\n/*! @brief Version number, encoded as two digits each */\n#define XXH_VERSION_NUMBER  (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE)\n\n/*!\n * @brief Obtains the xxHash version.\n *\n * This is mostly useful when xxHash is compiled as a shared library,\n * since the returned value comes from the library, as opposed to header file.\n *\n * @return @ref XXH_VERSION_NUMBER of the invoked library.\n */\nXXH_PUBLIC_API XXH_CONSTF unsigned XXH_versionNumber (void);\n\n\n/* ****************************\n*  Common basic types\n******************************/\n#include <stddef.h>   /* size_t */\n/*!\n * @brief Exit code for the streaming API.\n */\ntypedef enum {\n    XXH_OK = 0, /*!< OK */\n    XXH_ERROR   /*!< Error */\n} XXH_errorcode;\n\n\n/*-**********************************************************************\n*  32-bit hash\n************************************************************************/\n#if defined(XXH_DOXYGEN) /* Don't show <stdint.h> include */\n/*!\n * @brief An unsigned 32-bit integer.\n *\n * Not necessarily defined to `uint32_t` but functionally equivalent.\n */\ntypedef uint32_t XXH32_hash_t;\n\n#elif !defined (__VMS) \\\n  && (defined (__cplusplus) \\\n  || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )\n#   ifdef _AIX\n#     include <inttypes.h>\n#   else\n#     include <stdint.h>\n#   endif\n    typedef uint32_t XXH32_hash_t;\n\n#else\n#   include <limits.h>\n#   if UINT_MAX == 0xFFFFFFFFUL\n      typedef unsigned int XXH32_hash_t;\n#   elif ULONG_MAX == 0xFFFFFFFFUL\n      typedef unsigned long XXH32_hash_t;\n#   else\n#     error \"unsupported platform: need a 32-bit type\"\n#   endif\n#endif\n\n/*!\n * @}\n *\n * @defgroup XXH32_family XXH32 family\n * @ingroup public\n * Contains functions used in the classic 32-bit xxHash algorithm.\n *\n * @note\n *   XXH32 is useful for older platforms, with no or poor 64-bit performance.\n *   Note that the @ref XXH3_family provides competitive speed for both 32-bit\n *   and 64-bit systems, and offers true 64/128 bit hash results.\n *\n * @see @ref XXH64_family, @ref XXH3_family : Other xxHash families\n * @see @ref XXH32_impl for implementation details\n * @{\n */\n\n/*!\n * @brief Calculates the 32-bit hash of @p input using xxHash32.\n *\n * @param input The block of data to be hashed, at least @p length bytes in size.\n * @param length The length of @p input, in bytes.\n * @param seed The 32-bit seed to alter the hash's output predictably.\n *\n * @pre\n *   The memory between @p input and @p input + @p length must be valid,\n *   readable, contiguous memory. However, if @p length is `0`, @p input may be\n *   `NULL`. In C++, this also must be *TriviallyCopyable*.\n *\n * @return The calculated 32-bit xxHash32 value.\n *\n * @see @ref single_shot_example \"Single Shot Example\" for an example.\n */\nXXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32 (const void* input, size_t length, XXH32_hash_t seed);\n\n#ifndef XXH_NO_STREAM\n/*!\n * @typedef struct XXH32_state_s XXH32_state_t\n * @brief The opaque state struct for the XXH32 streaming API.\n *\n * @see XXH32_state_s for details.\n */\ntypedef struct XXH32_state_s XXH32_state_t;\n\n/*!\n * @brief Allocates an @ref XXH32_state_t.\n *\n * @return An allocated pointer of @ref XXH32_state_t on success.\n * @return `NULL` on failure.\n *\n * @note Must be freed with XXH32_freeState().\n */\nXXH_PUBLIC_API XXH_MALLOCF XXH32_state_t* XXH32_createState(void);\n/*!\n * @brief Frees an @ref XXH32_state_t.\n *\n * @param statePtr A pointer to an @ref XXH32_state_t allocated with @ref XXH32_createState().\n *\n * @return @ref XXH_OK.\n *\n * @note @p statePtr must be allocated with XXH32_createState().\n *\n */\nXXH_PUBLIC_API XXH_errorcode  XXH32_freeState(XXH32_state_t* statePtr);\n/*!\n * @brief Copies one @ref XXH32_state_t to another.\n *\n * @param dst_state The state to copy to.\n * @param src_state The state to copy from.\n * @pre\n *   @p dst_state and @p src_state must not be `NULL` and must not overlap.\n */\nXXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dst_state, const XXH32_state_t* src_state);\n\n/*!\n * @brief Resets an @ref XXH32_state_t to begin a new hash.\n *\n * @param statePtr The state struct to reset.\n * @param seed The 32-bit seed to alter the hash result predictably.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @note This function resets and seeds a state. Call it before @ref XXH32_update().\n */\nXXH_PUBLIC_API XXH_errorcode XXH32_reset  (XXH32_state_t* statePtr, XXH32_hash_t seed);\n\n/*!\n * @brief Consumes a block of @p input to an @ref XXH32_state_t.\n *\n * @param statePtr The state struct to update.\n * @param input The block of data to be hashed, at least @p length bytes in size.\n * @param length The length of @p input, in bytes.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n * @pre\n *   The memory between @p input and @p input + @p length must be valid,\n *   readable, contiguous memory. However, if @p length is `0`, @p input may be\n *   `NULL`. In C++, this also must be *TriviallyCopyable*.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @note Call this to incrementally consume blocks of data.\n */\nXXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);\n\n/*!\n * @brief Returns the calculated hash value from an @ref XXH32_state_t.\n *\n * @param statePtr The state struct to calculate the hash from.\n *\n * @pre\n *  @p statePtr must not be `NULL`.\n *\n * @return The calculated 32-bit xxHash32 value from that state.\n *\n * @note\n *   Calling XXH32_digest() will not affect @p statePtr, so you can update,\n *   digest, and update again.\n */\nXXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr);\n#endif /* !XXH_NO_STREAM */\n\n/*******   Canonical representation   *******/\n\n/*!\n * @brief Canonical (big endian) representation of @ref XXH32_hash_t.\n */\ntypedef struct {\n    unsigned char digest[4]; /*!< Hash bytes, big endian */\n} XXH32_canonical_t;\n\n/*!\n * @brief Converts an @ref XXH32_hash_t to a big endian @ref XXH32_canonical_t.\n *\n * @param dst  The @ref XXH32_canonical_t pointer to be stored to.\n * @param hash The @ref XXH32_hash_t to be converted.\n *\n * @pre\n *   @p dst must not be `NULL`.\n *\n * @see @ref canonical_representation_example \"Canonical Representation Example\"\n */\nXXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash);\n\n/*!\n * @brief Converts an @ref XXH32_canonical_t to a native @ref XXH32_hash_t.\n *\n * @param src The @ref XXH32_canonical_t to convert.\n *\n * @pre\n *   @p src must not be `NULL`.\n *\n * @return The converted hash.\n *\n * @see @ref canonical_representation_example \"Canonical Representation Example\"\n */\nXXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src);\n\n\n/*! @cond Doxygen ignores this part */\n#ifdef __has_attribute\n# define XXH_HAS_ATTRIBUTE(x) __has_attribute(x)\n#else\n# define XXH_HAS_ATTRIBUTE(x) 0\n#endif\n/*! @endcond */\n\n/*! @cond Doxygen ignores this part */\n/*\n * C23 __STDC_VERSION__ number hasn't been specified yet. For now\n * leave as `201711L` (C17 + 1).\n * TODO: Update to correct value when its been specified.\n */\n#define XXH_C23_VN 201711L\n/*! @endcond */\n\n/*! @cond Doxygen ignores this part */\n/* C-language Attributes are added in C23. */\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= XXH_C23_VN) && defined(__has_c_attribute)\n# define XXH_HAS_C_ATTRIBUTE(x) __has_c_attribute(x)\n#else\n# define XXH_HAS_C_ATTRIBUTE(x) 0\n#endif\n/*! @endcond */\n\n/*! @cond Doxygen ignores this part */\n#if defined(__cplusplus) && defined(__has_cpp_attribute)\n# define XXH_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)\n#else\n# define XXH_HAS_CPP_ATTRIBUTE(x) 0\n#endif\n/*! @endcond */\n\n/*! @cond Doxygen ignores this part */\n/*\n * Define XXH_FALLTHROUGH macro for annotating switch case with the 'fallthrough' attribute\n * introduced in CPP17 and C23.\n * CPP17 : https://en.cppreference.com/w/cpp/language/attributes/fallthrough\n * C23   : https://en.cppreference.com/w/c/language/attributes/fallthrough\n */\n#if XXH_HAS_C_ATTRIBUTE(fallthrough) || XXH_HAS_CPP_ATTRIBUTE(fallthrough)\n# define XXH_FALLTHROUGH [[fallthrough]]\n#elif XXH_HAS_ATTRIBUTE(__fallthrough__)\n# define XXH_FALLTHROUGH __attribute__ ((__fallthrough__))\n#else\n# define XXH_FALLTHROUGH /* fallthrough */\n#endif\n/*! @endcond */\n\n/*! @cond Doxygen ignores this part */\n/*\n * Define XXH_NOESCAPE for annotated pointers in public API.\n * https://clang.llvm.org/docs/AttributeReference.html#noescape\n * As of writing this, only supported by clang.\n */\n#if XXH_HAS_ATTRIBUTE(noescape)\n# define XXH_NOESCAPE __attribute__((noescape))\n#else\n# define XXH_NOESCAPE\n#endif\n/*! @endcond */\n\n\n/*!\n * @}\n * @ingroup public\n * @{\n */\n\n#ifndef XXH_NO_LONG_LONG\n/*-**********************************************************************\n*  64-bit hash\n************************************************************************/\n#if defined(XXH_DOXYGEN) /* don't include <stdint.h> */\n/*!\n * @brief An unsigned 64-bit integer.\n *\n * Not necessarily defined to `uint64_t` but functionally equivalent.\n */\ntypedef uint64_t XXH64_hash_t;\n#elif !defined (__VMS) \\\n  && (defined (__cplusplus) \\\n  || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )\n#   ifdef _AIX\n#     include <inttypes.h>\n#   else\n#     include <stdint.h>\n#   endif\n   typedef uint64_t XXH64_hash_t;\n#else\n#  include <limits.h>\n#  if defined(__LP64__) && ULONG_MAX == 0xFFFFFFFFFFFFFFFFULL\n     /* LP64 ABI says uint64_t is unsigned long */\n     typedef unsigned long XXH64_hash_t;\n#  else\n     /* the following type must have a width of 64-bit */\n     typedef unsigned long long XXH64_hash_t;\n#  endif\n#endif\n\n/*!\n * @}\n *\n * @defgroup XXH64_family XXH64 family\n * @ingroup public\n * @{\n * Contains functions used in the classic 64-bit xxHash algorithm.\n *\n * @note\n *   XXH3 provides competitive speed for both 32-bit and 64-bit systems,\n *   and offers true 64/128 bit hash results.\n *   It provides better speed for systems with vector processing capabilities.\n */\n\n/*!\n * @brief Calculates the 64-bit hash of @p input using xxHash64.\n *\n * @param input The block of data to be hashed, at least @p length bytes in size.\n * @param length The length of @p input, in bytes.\n * @param seed The 64-bit seed to alter the hash's output predictably.\n *\n * @pre\n *   The memory between @p input and @p input + @p length must be valid,\n *   readable, contiguous memory. However, if @p length is `0`, @p input may be\n *   `NULL`. In C++, this also must be *TriviallyCopyable*.\n *\n * @return The calculated 64-bit xxHash64 value.\n *\n * @see @ref single_shot_example \"Single Shot Example\" for an example.\n */\nXXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64(XXH_NOESCAPE const void* input, size_t length, XXH64_hash_t seed);\n\n/*******   Streaming   *******/\n#ifndef XXH_NO_STREAM\n/*!\n * @brief The opaque state struct for the XXH64 streaming API.\n *\n * @see XXH64_state_s for details.\n */\ntypedef struct XXH64_state_s XXH64_state_t;   /* incomplete type */\n\n/*!\n * @brief Allocates an @ref XXH64_state_t.\n *\n * @return An allocated pointer of @ref XXH64_state_t on success.\n * @return `NULL` on failure.\n *\n * @note Must be freed with XXH64_freeState().\n */\nXXH_PUBLIC_API XXH_MALLOCF XXH64_state_t* XXH64_createState(void);\n\n/*!\n * @brief Frees an @ref XXH64_state_t.\n *\n * @param statePtr A pointer to an @ref XXH64_state_t allocated with @ref XXH64_createState().\n *\n * @return @ref XXH_OK.\n *\n * @note @p statePtr must be allocated with XXH64_createState().\n */\nXXH_PUBLIC_API XXH_errorcode  XXH64_freeState(XXH64_state_t* statePtr);\n\n/*!\n * @brief Copies one @ref XXH64_state_t to another.\n *\n * @param dst_state The state to copy to.\n * @param src_state The state to copy from.\n * @pre\n *   @p dst_state and @p src_state must not be `NULL` and must not overlap.\n */\nXXH_PUBLIC_API void XXH64_copyState(XXH_NOESCAPE XXH64_state_t* dst_state, const XXH64_state_t* src_state);\n\n/*!\n * @brief Resets an @ref XXH64_state_t to begin a new hash.\n *\n * @param statePtr The state struct to reset.\n * @param seed The 64-bit seed to alter the hash result predictably.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @note This function resets and seeds a state. Call it before @ref XXH64_update().\n */\nXXH_PUBLIC_API XXH_errorcode XXH64_reset  (XXH_NOESCAPE XXH64_state_t* statePtr, XXH64_hash_t seed);\n\n/*!\n * @brief Consumes a block of @p input to an @ref XXH64_state_t.\n *\n * @param statePtr The state struct to update.\n * @param input The block of data to be hashed, at least @p length bytes in size.\n * @param length The length of @p input, in bytes.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n * @pre\n *   The memory between @p input and @p input + @p length must be valid,\n *   readable, contiguous memory. However, if @p length is `0`, @p input may be\n *   `NULL`. In C++, this also must be *TriviallyCopyable*.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @note Call this to incrementally consume blocks of data.\n */\nXXH_PUBLIC_API XXH_errorcode XXH64_update (XXH_NOESCAPE XXH64_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length);\n\n/*!\n * @brief Returns the calculated hash value from an @ref XXH64_state_t.\n *\n * @param statePtr The state struct to calculate the hash from.\n *\n * @pre\n *  @p statePtr must not be `NULL`.\n *\n * @return The calculated 64-bit xxHash64 value from that state.\n *\n * @note\n *   Calling XXH64_digest() will not affect @p statePtr, so you can update,\n *   digest, and update again.\n */\nXXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64_digest (XXH_NOESCAPE const XXH64_state_t* statePtr);\n#endif /* !XXH_NO_STREAM */\n/*******   Canonical representation   *******/\n\n/*!\n * @brief Canonical (big endian) representation of @ref XXH64_hash_t.\n */\ntypedef struct { unsigned char digest[sizeof(XXH64_hash_t)]; } XXH64_canonical_t;\n\n/*!\n * @brief Converts an @ref XXH64_hash_t to a big endian @ref XXH64_canonical_t.\n *\n * @param dst The @ref XXH64_canonical_t pointer to be stored to.\n * @param hash The @ref XXH64_hash_t to be converted.\n *\n * @pre\n *   @p dst must not be `NULL`.\n *\n * @see @ref canonical_representation_example \"Canonical Representation Example\"\n */\nXXH_PUBLIC_API void XXH64_canonicalFromHash(XXH_NOESCAPE XXH64_canonical_t* dst, XXH64_hash_t hash);\n\n/*!\n * @brief Converts an @ref XXH64_canonical_t to a native @ref XXH64_hash_t.\n *\n * @param src The @ref XXH64_canonical_t to convert.\n *\n * @pre\n *   @p src must not be `NULL`.\n *\n * @return The converted hash.\n *\n * @see @ref canonical_representation_example \"Canonical Representation Example\"\n */\nXXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const XXH64_canonical_t* src);\n\n#ifndef XXH_NO_XXH3\n\n/*!\n * @}\n * ************************************************************************\n * @defgroup XXH3_family XXH3 family\n * @ingroup public\n * @{\n *\n * XXH3 is a more recent hash algorithm featuring:\n *  - Improved speed for both small and large inputs\n *  - True 64-bit and 128-bit outputs\n *  - SIMD acceleration\n *  - Improved 32-bit viability\n *\n * Speed analysis methodology is explained here:\n *\n *    https://fastcompression.blogspot.com/2019/03/presenting-xxh3.html\n *\n * Compared to XXH64, expect XXH3 to run approximately\n * ~2x faster on large inputs and >3x faster on small ones,\n * exact differences vary depending on platform.\n *\n * XXH3's speed benefits greatly from SIMD and 64-bit arithmetic,\n * but does not require it.\n * Most 32-bit and 64-bit targets that can run XXH32 smoothly can run XXH3\n * at competitive speeds, even without vector support. Further details are\n * explained in the implementation.\n *\n * XXH3 has a fast scalar implementation, but it also includes accelerated SIMD\n * implementations for many common platforms:\n *   - AVX512\n *   - AVX2\n *   - SSE2\n *   - ARM NEON\n *   - WebAssembly SIMD128\n *   - POWER8 VSX\n *   - s390x ZVector\n * This can be controlled via the @ref XXH_VECTOR macro, but it automatically\n * selects the best version according to predefined macros. For the x86 family, an\n * automatic runtime dispatcher is included separately in @ref xxh_x86dispatch.c.\n *\n * XXH3 implementation is portable:\n * it has a generic C90 formulation that can be compiled on any platform,\n * all implementations generate exactly the same hash value on all platforms.\n * Starting from v0.8.0, it's also labelled \"stable\", meaning that\n * any future version will also generate the same hash value.\n *\n * XXH3 offers 2 variants, _64bits and _128bits.\n *\n * When only 64 bits are needed, prefer invoking the _64bits variant, as it\n * reduces the amount of mixing, resulting in faster speed on small inputs.\n * It's also generally simpler to manipulate a scalar return type than a struct.\n *\n * The API supports one-shot hashing, streaming mode, and custom secrets.\n */\n/*-**********************************************************************\n*  XXH3 64-bit variant\n************************************************************************/\n\n/*!\n * @brief Calculates 64-bit unseeded variant of XXH3 hash of @p input.\n *\n * @param input  The block of data to be hashed, at least @p length bytes in size.\n * @param length The length of @p input, in bytes.\n *\n * @pre\n *   The memory between @p input and @p input + @p length must be valid,\n *   readable, contiguous memory. However, if @p length is `0`, @p input may be\n *   `NULL`. In C++, this also must be *TriviallyCopyable*.\n *\n * @return The calculated 64-bit XXH3 hash value.\n *\n * @note\n *   This is equivalent to @ref XXH3_64bits_withSeed() with a seed of `0`, however\n *   it may have slightly better performance due to constant propagation of the\n *   defaults.\n *\n * @see\n *    XXH3_64bits_withSeed(), XXH3_64bits_withSecret(): other seeding variants\n * @see @ref single_shot_example \"Single Shot Example\" for an example.\n */\nXXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits(XXH_NOESCAPE const void* input, size_t length);\n\n/*!\n * @brief Calculates 64-bit seeded variant of XXH3 hash of @p input.\n *\n * @param input  The block of data to be hashed, at least @p length bytes in size.\n * @param length The length of @p input, in bytes.\n * @param seed   The 64-bit seed to alter the hash result predictably.\n *\n * @pre\n *   The memory between @p input and @p input + @p length must be valid,\n *   readable, contiguous memory. However, if @p length is `0`, @p input may be\n *   `NULL`. In C++, this also must be *TriviallyCopyable*.\n *\n * @return The calculated 64-bit XXH3 hash value.\n *\n * @note\n *    seed == 0 produces the same results as @ref XXH3_64bits().\n *\n * This variant generates a custom secret on the fly based on default secret\n * altered using the @p seed value.\n *\n * While this operation is decently fast, note that it's not completely free.\n *\n * @see @ref single_shot_example \"Single Shot Example\" for an example.\n */\nXXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits_withSeed(XXH_NOESCAPE const void* input, size_t length, XXH64_hash_t seed);\n\n/*!\n * The bare minimum size for a custom secret.\n *\n * @see\n *  XXH3_64bits_withSecret(), XXH3_64bits_reset_withSecret(),\n *  XXH3_128bits_withSecret(), XXH3_128bits_reset_withSecret().\n */\n#define XXH3_SECRET_SIZE_MIN 136\n\n/*!\n * @brief Calculates 64-bit variant of XXH3 with a custom \"secret\".\n *\n * @param data       The block of data to be hashed, at least @p len bytes in size.\n * @param len        The length of @p data, in bytes.\n * @param secret     The secret data.\n * @param secretSize The length of @p secret, in bytes.\n *\n * @return The calculated 64-bit XXH3 hash value.\n *\n * @pre\n *   The memory between @p data and @p data + @p len must be valid,\n *   readable, contiguous memory. However, if @p length is `0`, @p data may be\n *   `NULL`. In C++, this also must be *TriviallyCopyable*.\n *\n * It's possible to provide any blob of bytes as a \"secret\" to generate the hash.\n * This makes it more difficult for an external actor to prepare an intentional collision.\n * The main condition is that @p secretSize *must* be large enough (>= @ref XXH3_SECRET_SIZE_MIN).\n * However, the quality of the secret impacts the dispersion of the hash algorithm.\n * Therefore, the secret _must_ look like a bunch of random bytes.\n * Avoid \"trivial\" or structured data such as repeated sequences or a text document.\n * Whenever in doubt about the \"randomness\" of the blob of bytes,\n * consider employing @ref XXH3_generateSecret() instead (see below).\n * It will generate a proper high entropy secret derived from the blob of bytes.\n * Another advantage of using XXH3_generateSecret() is that\n * it guarantees that all bits within the initial blob of bytes\n * will impact every bit of the output.\n * This is not necessarily the case when using the blob of bytes directly\n * because, when hashing _small_ inputs, only a portion of the secret is employed.\n *\n * @see @ref single_shot_example \"Single Shot Example\" for an example.\n */\nXXH_PUBLIC_API XXH_PUREF XXH64_hash_t XXH3_64bits_withSecret(XXH_NOESCAPE const void* data, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize);\n\n\n/*******   Streaming   *******/\n#ifndef XXH_NO_STREAM\n/*\n * Streaming requires state maintenance.\n * This operation costs memory and CPU.\n * As a consequence, streaming is slower than one-shot hashing.\n * For better performance, prefer one-shot functions whenever applicable.\n */\n\n/*!\n * @brief The opaque state struct for the XXH3 streaming API.\n *\n * @see XXH3_state_s for details.\n */\ntypedef struct XXH3_state_s XXH3_state_t;\nXXH_PUBLIC_API XXH_MALLOCF XXH3_state_t* XXH3_createState(void);\nXXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr);\n\n/*!\n * @brief Copies one @ref XXH3_state_t to another.\n *\n * @param dst_state The state to copy to.\n * @param src_state The state to copy from.\n * @pre\n *   @p dst_state and @p src_state must not be `NULL` and must not overlap.\n */\nXXH_PUBLIC_API void XXH3_copyState(XXH_NOESCAPE XXH3_state_t* dst_state, XXH_NOESCAPE const XXH3_state_t* src_state);\n\n/*!\n * @brief Resets an @ref XXH3_state_t to begin a new hash.\n *\n * @param statePtr The state struct to reset.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @note\n *   - This function resets `statePtr` and generate a secret with default parameters.\n *   - Call this function before @ref XXH3_64bits_update().\n *   - Digest will be equivalent to `XXH3_64bits()`.\n *\n */\nXXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr);\n\n/*!\n * @brief Resets an @ref XXH3_state_t with 64-bit seed to begin a new hash.\n *\n * @param statePtr The state struct to reset.\n * @param seed     The 64-bit seed to alter the hash result predictably.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @note\n *   - This function resets `statePtr` and generate a secret from `seed`.\n *   - Call this function before @ref XXH3_64bits_update().\n *   - Digest will be equivalent to `XXH3_64bits_withSeed()`.\n *\n */\nXXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed);\n\n/*!\n * @brief Resets an @ref XXH3_state_t with secret data to begin a new hash.\n *\n * @param statePtr The state struct to reset.\n * @param secret     The secret data.\n * @param secretSize The length of @p secret, in bytes.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @note\n *   `secret` is referenced, it _must outlive_ the hash streaming session.\n *\n * Similar to one-shot API, `secretSize` must be >= @ref XXH3_SECRET_SIZE_MIN,\n * and the quality of produced hash values depends on secret's entropy\n * (secret's content should look like a bunch of random bytes).\n * When in doubt about the randomness of a candidate `secret`,\n * consider employing `XXH3_generateSecret()` instead (see below).\n */\nXXH_PUBLIC_API XXH_errorcode XXH3_64bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize);\n\n/*!\n * @brief Consumes a block of @p input to an @ref XXH3_state_t.\n *\n * @param statePtr The state struct to update.\n * @param input The block of data to be hashed, at least @p length bytes in size.\n * @param length The length of @p input, in bytes.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n * @pre\n *   The memory between @p input and @p input + @p length must be valid,\n *   readable, contiguous memory. However, if @p length is `0`, @p input may be\n *   `NULL`. In C++, this also must be *TriviallyCopyable*.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @note Call this to incrementally consume blocks of data.\n */\nXXH_PUBLIC_API XXH_errorcode XXH3_64bits_update (XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length);\n\n/*!\n * @brief Returns the calculated XXH3 64-bit hash value from an @ref XXH3_state_t.\n *\n * @param statePtr The state struct to calculate the hash from.\n *\n * @pre\n *  @p statePtr must not be `NULL`.\n *\n * @return The calculated XXH3 64-bit hash value from that state.\n *\n * @note\n *   Calling XXH3_64bits_digest() will not affect @p statePtr, so you can update,\n *   digest, and update again.\n */\nXXH_PUBLIC_API XXH_PUREF XXH64_hash_t  XXH3_64bits_digest (XXH_NOESCAPE const XXH3_state_t* statePtr);\n#endif /* !XXH_NO_STREAM */\n\n/* note : canonical representation of XXH3 is the same as XXH64\n * since they both produce XXH64_hash_t values */\n\n\n/*-**********************************************************************\n*  XXH3 128-bit variant\n************************************************************************/\n\n/*!\n * @brief The return value from 128-bit hashes.\n *\n * Stored in little endian order, although the fields themselves are in native\n * endianness.\n */\ntypedef struct {\n    XXH64_hash_t low64;   /*!< `value & 0xFFFFFFFFFFFFFFFF` */\n    XXH64_hash_t high64;  /*!< `value >> 64` */\n} XXH128_hash_t;\n\n/*!\n * @brief Calculates 128-bit unseeded variant of XXH3 of @p data.\n *\n * @param data The block of data to be hashed, at least @p length bytes in size.\n * @param len  The length of @p data, in bytes.\n *\n * @return The calculated 128-bit variant of XXH3 value.\n *\n * The 128-bit variant of XXH3 has more strength, but it has a bit of overhead\n * for shorter inputs.\n *\n * This is equivalent to @ref XXH3_128bits_withSeed() with a seed of `0`, however\n * it may have slightly better performance due to constant propagation of the\n * defaults.\n *\n * @see XXH3_128bits_withSeed(), XXH3_128bits_withSecret(): other seeding variants\n * @see @ref single_shot_example \"Single Shot Example\" for an example.\n */\nXXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits(XXH_NOESCAPE const void* data, size_t len);\n/*! @brief Calculates 128-bit seeded variant of XXH3 hash of @p data.\n *\n * @param data The block of data to be hashed, at least @p length bytes in size.\n * @param len  The length of @p data, in bytes.\n * @param seed The 64-bit seed to alter the hash result predictably.\n *\n * @return The calculated 128-bit variant of XXH3 value.\n *\n * @note\n *    seed == 0 produces the same results as @ref XXH3_64bits().\n *\n * This variant generates a custom secret on the fly based on default secret\n * altered using the @p seed value.\n *\n * While this operation is decently fast, note that it's not completely free.\n *\n * @see XXH3_128bits(), XXH3_128bits_withSecret(): other seeding variants\n * @see @ref single_shot_example \"Single Shot Example\" for an example.\n */\nXXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits_withSeed(XXH_NOESCAPE const void* data, size_t len, XXH64_hash_t seed);\n/*!\n * @brief Calculates 128-bit variant of XXH3 with a custom \"secret\".\n *\n * @param data       The block of data to be hashed, at least @p len bytes in size.\n * @param len        The length of @p data, in bytes.\n * @param secret     The secret data.\n * @param secretSize The length of @p secret, in bytes.\n *\n * @return The calculated 128-bit variant of XXH3 value.\n *\n * It's possible to provide any blob of bytes as a \"secret\" to generate the hash.\n * This makes it more difficult for an external actor to prepare an intentional collision.\n * The main condition is that @p secretSize *must* be large enough (>= @ref XXH3_SECRET_SIZE_MIN).\n * However, the quality of the secret impacts the dispersion of the hash algorithm.\n * Therefore, the secret _must_ look like a bunch of random bytes.\n * Avoid \"trivial\" or structured data such as repeated sequences or a text document.\n * Whenever in doubt about the \"randomness\" of the blob of bytes,\n * consider employing @ref XXH3_generateSecret() instead (see below).\n * It will generate a proper high entropy secret derived from the blob of bytes.\n * Another advantage of using XXH3_generateSecret() is that\n * it guarantees that all bits within the initial blob of bytes\n * will impact every bit of the output.\n * This is not necessarily the case when using the blob of bytes directly\n * because, when hashing _small_ inputs, only a portion of the secret is employed.\n *\n * @see @ref single_shot_example \"Single Shot Example\" for an example.\n */\nXXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits_withSecret(XXH_NOESCAPE const void* data, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize);\n\n/*******   Streaming   *******/\n#ifndef XXH_NO_STREAM\n/*\n * Streaming requires state maintenance.\n * This operation costs memory and CPU.\n * As a consequence, streaming is slower than one-shot hashing.\n * For better performance, prefer one-shot functions whenever applicable.\n *\n * XXH3_128bits uses the same XXH3_state_t as XXH3_64bits().\n * Use already declared XXH3_createState() and XXH3_freeState().\n *\n * All reset and streaming functions have same meaning as their 64-bit counterpart.\n */\n\n/*!\n * @brief Resets an @ref XXH3_state_t to begin a new hash.\n *\n * @param statePtr The state struct to reset.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @note\n *   - This function resets `statePtr` and generate a secret with default parameters.\n *   - Call it before @ref XXH3_128bits_update().\n *   - Digest will be equivalent to `XXH3_128bits()`.\n */\nXXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr);\n\n/*!\n * @brief Resets an @ref XXH3_state_t with 64-bit seed to begin a new hash.\n *\n * @param statePtr The state struct to reset.\n * @param seed     The 64-bit seed to alter the hash result predictably.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @note\n *   - This function resets `statePtr` and generate a secret from `seed`.\n *   - Call it before @ref XXH3_128bits_update().\n *   - Digest will be equivalent to `XXH3_128bits_withSeed()`.\n */\nXXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed);\n/*!\n * @brief Resets an @ref XXH3_state_t with secret data to begin a new hash.\n *\n * @param statePtr   The state struct to reset.\n * @param secret     The secret data.\n * @param secretSize The length of @p secret, in bytes.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * `secret` is referenced, it _must outlive_ the hash streaming session.\n * Similar to one-shot API, `secretSize` must be >= @ref XXH3_SECRET_SIZE_MIN,\n * and the quality of produced hash values depends on secret's entropy\n * (secret's content should look like a bunch of random bytes).\n * When in doubt about the randomness of a candidate `secret`,\n * consider employing `XXH3_generateSecret()` instead (see below).\n */\nXXH_PUBLIC_API XXH_errorcode XXH3_128bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize);\n\n/*!\n * @brief Consumes a block of @p input to an @ref XXH3_state_t.\n *\n * Call this to incrementally consume blocks of data.\n *\n * @param statePtr The state struct to update.\n * @param input The block of data to be hashed, at least @p length bytes in size.\n * @param length The length of @p input, in bytes.\n *\n * @pre\n *   @p statePtr must not be `NULL`.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @note\n *   The memory between @p input and @p input + @p length must be valid,\n *   readable, contiguous memory. However, if @p length is `0`, @p input may be\n *   `NULL`. In C++, this also must be *TriviallyCopyable*.\n *\n */\nXXH_PUBLIC_API XXH_errorcode XXH3_128bits_update (XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* input, size_t length);\n\n/*!\n * @brief Returns the calculated XXH3 128-bit hash value from an @ref XXH3_state_t.\n *\n * @param statePtr The state struct to calculate the hash from.\n *\n * @pre\n *  @p statePtr must not be `NULL`.\n *\n * @return The calculated XXH3 128-bit hash value from that state.\n *\n * @note\n *   Calling XXH3_128bits_digest() will not affect @p statePtr, so you can update,\n *   digest, and update again.\n *\n */\nXXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH3_128bits_digest (XXH_NOESCAPE const XXH3_state_t* statePtr);\n#endif /* !XXH_NO_STREAM */\n\n/* Following helper functions make it possible to compare XXH128_hast_t values.\n * Since XXH128_hash_t is a structure, this capability is not offered by the language.\n * Note: For better performance, these functions can be inlined using XXH_INLINE_ALL */\n\n/*!\n * @brief Check equality of two XXH128_hash_t values\n *\n * @param h1 The 128-bit hash value.\n * @param h2 Another 128-bit hash value.\n *\n * @return `1` if `h1` and `h2` are equal.\n * @return `0` if they are not.\n */\nXXH_PUBLIC_API XXH_PUREF int XXH128_isEqual(XXH128_hash_t h1, XXH128_hash_t h2);\n\n/*!\n * @brief Compares two @ref XXH128_hash_t\n *\n * This comparator is compatible with stdlib's `qsort()`/`bsearch()`.\n *\n * @param h128_1 Left-hand side value\n * @param h128_2 Right-hand side value\n *\n * @return >0 if @p h128_1  > @p h128_2\n * @return =0 if @p h128_1 == @p h128_2\n * @return <0 if @p h128_1  < @p h128_2\n */\nXXH_PUBLIC_API XXH_PUREF int XXH128_cmp(XXH_NOESCAPE const void* h128_1, XXH_NOESCAPE const void* h128_2);\n\n\n/*******   Canonical representation   *******/\ntypedef struct { unsigned char digest[sizeof(XXH128_hash_t)]; } XXH128_canonical_t;\n\n\n/*!\n * @brief Converts an @ref XXH128_hash_t to a big endian @ref XXH128_canonical_t.\n *\n * @param dst  The @ref XXH128_canonical_t pointer to be stored to.\n * @param hash The @ref XXH128_hash_t to be converted.\n *\n * @pre\n *   @p dst must not be `NULL`.\n * @see @ref canonical_representation_example \"Canonical Representation Example\"\n */\nXXH_PUBLIC_API void XXH128_canonicalFromHash(XXH_NOESCAPE XXH128_canonical_t* dst, XXH128_hash_t hash);\n\n/*!\n * @brief Converts an @ref XXH128_canonical_t to a native @ref XXH128_hash_t.\n *\n * @param src The @ref XXH128_canonical_t to convert.\n *\n * @pre\n *   @p src must not be `NULL`.\n *\n * @return The converted hash.\n * @see @ref canonical_representation_example \"Canonical Representation Example\"\n */\nXXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH128_hashFromCanonical(XXH_NOESCAPE const XXH128_canonical_t* src);\n\n\n#endif  /* !XXH_NO_XXH3 */\n#endif  /* XXH_NO_LONG_LONG */\n\n/*!\n * @}\n */\n#endif /* XXHASH_H_5627135585666179 */\n\n\n\n#if defined(XXH_STATIC_LINKING_ONLY) && !defined(XXHASH_H_STATIC_13879238742)\n#define XXHASH_H_STATIC_13879238742\n/* ****************************************************************************\n * This section contains declarations which are not guaranteed to remain stable.\n * They may change in future versions, becoming incompatible with a different\n * version of the library.\n * These declarations should only be used with static linking.\n * Never use them in association with dynamic linking!\n ***************************************************************************** */\n\n/*\n * These definitions are only present to allow static allocation\n * of XXH states, on stack or in a struct, for example.\n * Never **ever** access their members directly.\n */\n\n/*!\n * @internal\n * @brief Structure for XXH32 streaming API.\n *\n * @note This is only defined when @ref XXH_STATIC_LINKING_ONLY,\n * @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined. Otherwise it is\n * an opaque type. This allows fields to safely be changed.\n *\n * Typedef'd to @ref XXH32_state_t.\n * Do not access the members of this struct directly.\n * @see XXH64_state_s, XXH3_state_s\n */\nstruct XXH32_state_s {\n   XXH32_hash_t total_len_32; /*!< Total length hashed, modulo 2^32 */\n   XXH32_hash_t large_len;    /*!< Whether the hash is >= 16 (handles @ref total_len_32 overflow) */\n   XXH32_hash_t v[4];         /*!< Accumulator lanes */\n   XXH32_hash_t mem32[4];     /*!< Internal buffer for partial reads. Treated as unsigned char[16]. */\n   XXH32_hash_t memsize;      /*!< Amount of data in @ref mem32 */\n   XXH32_hash_t reserved;     /*!< Reserved field. Do not read nor write to it. */\n};   /* typedef'd to XXH32_state_t */\n\n\n#ifndef XXH_NO_LONG_LONG  /* defined when there is no 64-bit support */\n\n/*!\n * @internal\n * @brief Structure for XXH64 streaming API.\n *\n * @note This is only defined when @ref XXH_STATIC_LINKING_ONLY,\n * @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined. Otherwise it is\n * an opaque type. This allows fields to safely be changed.\n *\n * Typedef'd to @ref XXH64_state_t.\n * Do not access the members of this struct directly.\n * @see XXH32_state_s, XXH3_state_s\n */\nstruct XXH64_state_s {\n   XXH64_hash_t total_len;    /*!< Total length hashed. This is always 64-bit. */\n   XXH64_hash_t v[4];         /*!< Accumulator lanes */\n   XXH64_hash_t mem64[4];     /*!< Internal buffer for partial reads. Treated as unsigned char[32]. */\n   XXH32_hash_t memsize;      /*!< Amount of data in @ref mem64 */\n   XXH32_hash_t reserved32;   /*!< Reserved field, needed for padding anyways*/\n   XXH64_hash_t reserved64;   /*!< Reserved field. Do not read or write to it. */\n};   /* typedef'd to XXH64_state_t */\n\n#ifndef XXH_NO_XXH3\n\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* >= C11 */\n#  include <stdalign.h>\n#  define XXH_ALIGN(n)      alignas(n)\n#elif defined(__cplusplus) && (__cplusplus >= 201103L) /* >= C++11 */\n/* In C++ alignas() is a keyword */\n#  define XXH_ALIGN(n)      alignas(n)\n#elif defined(__GNUC__)\n#  define XXH_ALIGN(n)      __attribute__ ((aligned(n)))\n#elif defined(_MSC_VER)\n#  define XXH_ALIGN(n)      __declspec(align(n))\n#else\n#  define XXH_ALIGN(n)   /* disabled */\n#endif\n\n/* Old GCC versions only accept the attribute after the type in structures. */\n#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L))   /* C11+ */ \\\n    && ! (defined(__cplusplus) && (__cplusplus >= 201103L)) /* >= C++11 */ \\\n    && defined(__GNUC__)\n#   define XXH_ALIGN_MEMBER(align, type) type XXH_ALIGN(align)\n#else\n#   define XXH_ALIGN_MEMBER(align, type) XXH_ALIGN(align) type\n#endif\n\n/*!\n * @brief The size of the internal XXH3 buffer.\n *\n * This is the optimal update size for incremental hashing.\n *\n * @see XXH3_64b_update(), XXH3_128b_update().\n */\n#define XXH3_INTERNALBUFFER_SIZE 256\n\n/*!\n * @internal\n * @brief Default size of the secret buffer (and @ref XXH3_kSecret).\n *\n * This is the size used in @ref XXH3_kSecret and the seeded functions.\n *\n * Not to be confused with @ref XXH3_SECRET_SIZE_MIN.\n */\n#define XXH3_SECRET_DEFAULT_SIZE 192\n\n/*!\n * @internal\n * @brief Structure for XXH3 streaming API.\n *\n * @note This is only defined when @ref XXH_STATIC_LINKING_ONLY,\n * @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined.\n * Otherwise it is an opaque type.\n * Never use this definition in combination with dynamic library.\n * This allows fields to safely be changed in the future.\n *\n * @note ** This structure has a strict alignment requirement of 64 bytes!! **\n * Do not allocate this with `malloc()` or `new`,\n * it will not be sufficiently aligned.\n * Use @ref XXH3_createState() and @ref XXH3_freeState(), or stack allocation.\n *\n * Typedef'd to @ref XXH3_state_t.\n * Do never access the members of this struct directly.\n *\n * @see XXH3_INITSTATE() for stack initialization.\n * @see XXH3_createState(), XXH3_freeState().\n * @see XXH32_state_s, XXH64_state_s\n */\nstruct XXH3_state_s {\n   XXH_ALIGN_MEMBER(64, XXH64_hash_t acc[8]);\n       /*!< The 8 accumulators. See @ref XXH32_state_s::v and @ref XXH64_state_s::v */\n   XXH_ALIGN_MEMBER(64, unsigned char customSecret[XXH3_SECRET_DEFAULT_SIZE]);\n       /*!< Used to store a custom secret generated from a seed. */\n   XXH_ALIGN_MEMBER(64, unsigned char buffer[XXH3_INTERNALBUFFER_SIZE]);\n       /*!< The internal buffer. @see XXH32_state_s::mem32 */\n   XXH32_hash_t bufferedSize;\n       /*!< The amount of memory in @ref buffer, @see XXH32_state_s::memsize */\n   XXH32_hash_t useSeed;\n       /*!< Reserved field. Needed for padding on 64-bit. */\n   size_t nbStripesSoFar;\n       /*!< Number or stripes processed. */\n   XXH64_hash_t totalLen;\n       /*!< Total length hashed. 64-bit even on 32-bit targets. */\n   size_t nbStripesPerBlock;\n       /*!< Number of stripes per block. */\n   size_t secretLimit;\n       /*!< Size of @ref customSecret or @ref extSecret */\n   XXH64_hash_t seed;\n       /*!< Seed for _withSeed variants. Must be zero otherwise, @see XXH3_INITSTATE() */\n   XXH64_hash_t reserved64;\n       /*!< Reserved field. */\n   const unsigned char* extSecret;\n       /*!< Reference to an external secret for the _withSecret variants, NULL\n        *   for other variants. */\n   /* note: there may be some padding at the end due to alignment on 64 bytes */\n}; /* typedef'd to XXH3_state_t */\n\n#undef XXH_ALIGN_MEMBER\n\n/*!\n * @brief Initializes a stack-allocated `XXH3_state_s`.\n *\n * When the @ref XXH3_state_t structure is merely emplaced on stack,\n * it should be initialized with XXH3_INITSTATE() or a memset()\n * in case its first reset uses XXH3_NNbits_reset_withSeed().\n * This init can be omitted if the first reset uses default or _withSecret mode.\n * This operation isn't necessary when the state is created with XXH3_createState().\n * Note that this doesn't prepare the state for a streaming operation,\n * it's still necessary to use XXH3_NNbits_reset*() afterwards.\n */\n#define XXH3_INITSTATE(XXH3_state_ptr)                       \\\n    do {                                                     \\\n        XXH3_state_t* tmp_xxh3_state_ptr = (XXH3_state_ptr); \\\n        tmp_xxh3_state_ptr->seed = 0;                        \\\n        tmp_xxh3_state_ptr->extSecret = NULL;                \\\n    } while(0)\n\n\n/*!\n * @brief Calculates the 128-bit hash of @p data using XXH3.\n *\n * @param data The block of data to be hashed, at least @p len bytes in size.\n * @param len  The length of @p data, in bytes.\n * @param seed The 64-bit seed to alter the hash's output predictably.\n *\n * @pre\n *   The memory between @p data and @p data + @p len must be valid,\n *   readable, contiguous memory. However, if @p len is `0`, @p data may be\n *   `NULL`. In C++, this also must be *TriviallyCopyable*.\n *\n * @return The calculated 128-bit XXH3 value.\n *\n * @see @ref single_shot_example \"Single Shot Example\" for an example.\n */\nXXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH128(XXH_NOESCAPE const void* data, size_t len, XXH64_hash_t seed);\n\n\n/* ===   Experimental API   === */\n/* Symbols defined below must be considered tied to a specific library version. */\n\n/*!\n * @brief Derive a high-entropy secret from any user-defined content, named customSeed.\n *\n * @param secretBuffer    A writable buffer for derived high-entropy secret data.\n * @param secretSize      Size of secretBuffer, in bytes.  Must be >= XXH3_SECRET_DEFAULT_SIZE.\n * @param customSeed      A user-defined content.\n * @param customSeedSize  Size of customSeed, in bytes.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * The generated secret can be used in combination with `*_withSecret()` functions.\n * The `_withSecret()` variants are useful to provide a higher level of protection\n * than 64-bit seed, as it becomes much more difficult for an external actor to\n * guess how to impact the calculation logic.\n *\n * The function accepts as input a custom seed of any length and any content,\n * and derives from it a high-entropy secret of length @p secretSize into an\n * already allocated buffer @p secretBuffer.\n *\n * The generated secret can then be used with any `*_withSecret()` variant.\n * The functions @ref XXH3_128bits_withSecret(), @ref XXH3_64bits_withSecret(),\n * @ref XXH3_128bits_reset_withSecret() and @ref XXH3_64bits_reset_withSecret()\n * are part of this list. They all accept a `secret` parameter\n * which must be large enough for implementation reasons (>= @ref XXH3_SECRET_SIZE_MIN)\n * _and_ feature very high entropy (consist of random-looking bytes).\n * These conditions can be a high bar to meet, so @ref XXH3_generateSecret() can\n * be employed to ensure proper quality.\n *\n * @p customSeed can be anything. It can have any size, even small ones,\n * and its content can be anything, even \"poor entropy\" sources such as a bunch\n * of zeroes. The resulting `secret` will nonetheless provide all required qualities.\n *\n * @pre\n *   - @p secretSize must be >= @ref XXH3_SECRET_SIZE_MIN\n *   - When @p customSeedSize > 0, supplying NULL as customSeed is undefined behavior.\n *\n * Example code:\n * @code{.c}\n *    #include <stdio.h>\n *    #include <stdlib.h>\n *    #include <string.h>\n *    #define XXH_STATIC_LINKING_ONLY // expose unstable API\n *    #include \"xxhash.h\"\n *    // Hashes argv[2] using the entropy from argv[1].\n *    int main(int argc, char* argv[])\n *    {\n *        char secret[XXH3_SECRET_SIZE_MIN];\n *        if (argv != 3) { return 1; }\n *        XXH3_generateSecret(secret, sizeof(secret), argv[1], strlen(argv[1]));\n *        XXH64_hash_t h = XXH3_64bits_withSecret(\n *             argv[2], strlen(argv[2]),\n *             secret, sizeof(secret)\n *        );\n *        printf(\"%016llx\\n\", (unsigned long long) h);\n *    }\n * @endcode\n */\nXXH_PUBLIC_API XXH_errorcode XXH3_generateSecret(XXH_NOESCAPE void* secretBuffer, size_t secretSize, XXH_NOESCAPE const void* customSeed, size_t customSeedSize);\n\n/*!\n * @brief Generate the same secret as the _withSeed() variants.\n *\n * @param secretBuffer A writable buffer of @ref XXH3_SECRET_SIZE_MIN bytes\n * @param seed         The 64-bit seed to alter the hash result predictably.\n *\n * The generated secret can be used in combination with\n *`*_withSecret()` and `_withSecretandSeed()` variants.\n *\n * Example C++ `std::string` hash class:\n * @code{.cpp}\n *    #include <string>\n *    #define XXH_STATIC_LINKING_ONLY // expose unstable API\n *    #include \"xxhash.h\"\n *    // Slow, seeds each time\n *    class HashSlow {\n *        XXH64_hash_t seed;\n *    public:\n *        HashSlow(XXH64_hash_t s) : seed{s} {}\n *        size_t operator()(const std::string& x) const {\n *            return size_t{XXH3_64bits_withSeed(x.c_str(), x.length(), seed)};\n *        }\n *    };\n *    // Fast, caches the seeded secret for future uses.\n *    class HashFast {\n *        unsigned char secret[XXH3_SECRET_SIZE_MIN];\n *    public:\n *        HashFast(XXH64_hash_t s) {\n *            XXH3_generateSecret_fromSeed(secret, seed);\n *        }\n *        size_t operator()(const std::string& x) const {\n *            return size_t{\n *                XXH3_64bits_withSecret(x.c_str(), x.length(), secret, sizeof(secret))\n *            };\n *        }\n *    };\n * @endcode\n */\nXXH_PUBLIC_API void XXH3_generateSecret_fromSeed(XXH_NOESCAPE void* secretBuffer, XXH64_hash_t seed);\n\n/*!\n * @brief Calculates 64/128-bit seeded variant of XXH3 hash of @p data.\n *\n * @param data       The block of data to be hashed, at least @p len bytes in size.\n * @param len        The length of @p data, in bytes.\n * @param secret     The secret data.\n * @param secretSize The length of @p secret, in bytes.\n * @param seed       The 64-bit seed to alter the hash result predictably.\n *\n * These variants generate hash values using either\n * @p seed for \"short\" keys (< @ref XXH3_MIDSIZE_MAX = 240 bytes)\n * or @p secret for \"large\" keys (>= @ref XXH3_MIDSIZE_MAX).\n *\n * This generally benefits speed, compared to `_withSeed()` or `_withSecret()`.\n * `_withSeed()` has to generate the secret on the fly for \"large\" keys.\n * It's fast, but can be perceptible for \"not so large\" keys (< 1 KB).\n * `_withSecret()` has to generate the masks on the fly for \"small\" keys,\n * which requires more instructions than _withSeed() variants.\n * Therefore, _withSecretandSeed variant combines the best of both worlds.\n *\n * When @p secret has been generated by XXH3_generateSecret_fromSeed(),\n * this variant produces *exactly* the same results as `_withSeed()` variant,\n * hence offering only a pure speed benefit on \"large\" input,\n * by skipping the need to regenerate the secret for every large input.\n *\n * Another usage scenario is to hash the secret to a 64-bit hash value,\n * for example with XXH3_64bits(), which then becomes the seed,\n * and then employ both the seed and the secret in _withSecretandSeed().\n * On top of speed, an added benefit is that each bit in the secret\n * has a 50% chance to swap each bit in the output, via its impact to the seed.\n *\n * This is not guaranteed when using the secret directly in \"small data\" scenarios,\n * because only portions of the secret are employed for small data.\n */\nXXH_PUBLIC_API XXH_PUREF XXH64_hash_t\nXXH3_64bits_withSecretandSeed(XXH_NOESCAPE const void* data, size_t len,\n                              XXH_NOESCAPE const void* secret, size_t secretSize,\n                              XXH64_hash_t seed);\n/*!\n * @brief Calculates 128-bit seeded variant of XXH3 hash of @p data.\n *\n * @param input      The block of data to be hashed, at least @p len bytes in size.\n * @param length     The length of @p data, in bytes.\n * @param secret     The secret data.\n * @param secretSize The length of @p secret, in bytes.\n * @param seed64     The 64-bit seed to alter the hash result predictably.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @see XXH3_64bits_withSecretandSeed()\n */\nXXH_PUBLIC_API XXH_PUREF XXH128_hash_t\nXXH3_128bits_withSecretandSeed(XXH_NOESCAPE const void* input, size_t length,\n                               XXH_NOESCAPE const void* secret, size_t secretSize,\n                               XXH64_hash_t seed64);\n#ifndef XXH_NO_STREAM\n/*!\n * @brief Resets an @ref XXH3_state_t with secret data to begin a new hash.\n *\n * @param statePtr   A pointer to an @ref XXH3_state_t allocated with @ref XXH3_createState().\n * @param secret     The secret data.\n * @param secretSize The length of @p secret, in bytes.\n * @param seed64     The 64-bit seed to alter the hash result predictably.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @see XXH3_64bits_withSecretandSeed()\n */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_64bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr,\n                                    XXH_NOESCAPE const void* secret, size_t secretSize,\n                                    XXH64_hash_t seed64);\n/*!\n * @brief Resets an @ref XXH3_state_t with secret data to begin a new hash.\n *\n * @param statePtr   A pointer to an @ref XXH3_state_t allocated with @ref XXH3_createState().\n * @param secret     The secret data.\n * @param secretSize The length of @p secret, in bytes.\n * @param seed64     The 64-bit seed to alter the hash result predictably.\n *\n * @return @ref XXH_OK on success.\n * @return @ref XXH_ERROR on failure.\n *\n * @see XXH3_64bits_withSecretandSeed()\n */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_128bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr,\n                                     XXH_NOESCAPE const void* secret, size_t secretSize,\n                                     XXH64_hash_t seed64);\n#endif /* !XXH_NO_STREAM */\n\n#endif  /* !XXH_NO_XXH3 */\n#endif  /* XXH_NO_LONG_LONG */\n#if defined(XXH_INLINE_ALL) || defined(XXH_PRIVATE_API)\n#  define XXH_IMPLEMENTATION\n#endif\n\n#endif  /* defined(XXH_STATIC_LINKING_ONLY) && !defined(XXHASH_H_STATIC_13879238742) */\n\n\n/* ======================================================================== */\n/* ======================================================================== */\n/* ======================================================================== */\n\n\n/*-**********************************************************************\n * xxHash implementation\n *-**********************************************************************\n * xxHash's implementation used to be hosted inside xxhash.c.\n *\n * However, inlining requires implementation to be visible to the compiler,\n * hence be included alongside the header.\n * Previously, implementation was hosted inside xxhash.c,\n * which was then #included when inlining was activated.\n * This construction created issues with a few build and install systems,\n * as it required xxhash.c to be stored in /include directory.\n *\n * xxHash implementation is now directly integrated within xxhash.h.\n * As a consequence, xxhash.c is no longer needed in /include.\n *\n * xxhash.c is still available and is still useful.\n * In a \"normal\" setup, when xxhash is not inlined,\n * xxhash.h only exposes the prototypes and public symbols,\n * while xxhash.c can be built into an object file xxhash.o\n * which can then be linked into the final binary.\n ************************************************************************/\n\n#if ( defined(XXH_INLINE_ALL) || defined(XXH_PRIVATE_API) \\\n   || defined(XXH_IMPLEMENTATION) ) && !defined(XXH_IMPLEM_13a8737387)\n#  define XXH_IMPLEM_13a8737387\n\n/* *************************************\n*  Tuning parameters\n***************************************/\n\n/*!\n * @defgroup tuning Tuning parameters\n * @{\n *\n * Various macros to control xxHash's behavior.\n */\n#ifdef XXH_DOXYGEN\n/*!\n * @brief Define this to disable 64-bit code.\n *\n * Useful if only using the @ref XXH32_family and you have a strict C90 compiler.\n */\n#  define XXH_NO_LONG_LONG\n#  undef XXH_NO_LONG_LONG /* don't actually */\n/*!\n * @brief Controls how unaligned memory is accessed.\n *\n * By default, access to unaligned memory is controlled by `memcpy()`, which is\n * safe and portable.\n *\n * Unfortunately, on some target/compiler combinations, the generated assembly\n * is sub-optimal.\n *\n * The below switch allow selection of a different access method\n * in the search for improved performance.\n *\n * @par Possible options:\n *\n *  - `XXH_FORCE_MEMORY_ACCESS=0` (default): `memcpy`\n *   @par\n *     Use `memcpy()`. Safe and portable. Note that most modern compilers will\n *     eliminate the function call and treat it as an unaligned access.\n *\n *  - `XXH_FORCE_MEMORY_ACCESS=1`: `__attribute__((aligned(1)))`\n *   @par\n *     Depends on compiler extensions and is therefore not portable.\n *     This method is safe _if_ your compiler supports it,\n *     and *generally* as fast or faster than `memcpy`.\n *\n *  - `XXH_FORCE_MEMORY_ACCESS=2`: Direct cast\n *  @par\n *     Casts directly and dereferences. This method doesn't depend on the\n *     compiler, but it violates the C standard as it directly dereferences an\n *     unaligned pointer. It can generate buggy code on targets which do not\n *     support unaligned memory accesses, but in some circumstances, it's the\n *     only known way to get the most performance.\n *\n *  - `XXH_FORCE_MEMORY_ACCESS=3`: Byteshift\n *  @par\n *     Also portable. This can generate the best code on old compilers which don't\n *     inline small `memcpy()` calls, and it might also be faster on big-endian\n *     systems which lack a native byteswap instruction. However, some compilers\n *     will emit literal byteshifts even if the target supports unaligned access.\n *\n *\n * @warning\n *   Methods 1 and 2 rely on implementation-defined behavior. Use these with\n *   care, as what works on one compiler/platform/optimization level may cause\n *   another to read garbage data or even crash.\n *\n * See https://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html for details.\n *\n * Prefer these methods in priority order (0 > 3 > 1 > 2)\n */\n#  define XXH_FORCE_MEMORY_ACCESS 0\n\n/*!\n * @def XXH_SIZE_OPT\n * @brief Controls how much xxHash optimizes for size.\n *\n * xxHash, when compiled, tends to result in a rather large binary size. This\n * is mostly due to heavy usage to forced inlining and constant folding of the\n * @ref XXH3_family to increase performance.\n *\n * However, some developers prefer size over speed. This option can\n * significantly reduce the size of the generated code. When using the `-Os`\n * or `-Oz` options on GCC or Clang, this is defined to 1 by default,\n * otherwise it is defined to 0.\n *\n * Most of these size optimizations can be controlled manually.\n *\n * This is a number from 0-2.\n *  - `XXH_SIZE_OPT` == 0: Default. xxHash makes no size optimizations. Speed\n *    comes first.\n *  - `XXH_SIZE_OPT` == 1: Default for `-Os` and `-Oz`. xxHash is more\n *    conservative and disables hacks that increase code size. It implies the\n *    options @ref XXH_NO_INLINE_HINTS == 1, @ref XXH_FORCE_ALIGN_CHECK == 0,\n *    and @ref XXH3_NEON_LANES == 8 if they are not already defined.\n *  - `XXH_SIZE_OPT` == 2: xxHash tries to make itself as small as possible.\n *    Performance may cry. For example, the single shot functions just use the\n *    streaming API.\n */\n#  define XXH_SIZE_OPT 0\n\n/*!\n * @def XXH_FORCE_ALIGN_CHECK\n * @brief If defined to non-zero, adds a special path for aligned inputs (XXH32()\n * and XXH64() only).\n *\n * This is an important performance trick for architectures without decent\n * unaligned memory access performance.\n *\n * It checks for input alignment, and when conditions are met, uses a \"fast\n * path\" employing direct 32-bit/64-bit reads, resulting in _dramatically\n * faster_ read speed.\n *\n * The check costs one initial branch per hash, which is generally negligible,\n * but not zero.\n *\n * Moreover, it's not useful to generate an additional code path if memory\n * access uses the same instruction for both aligned and unaligned\n * addresses (e.g. x86 and aarch64).\n *\n * In these cases, the alignment check can be removed by setting this macro to 0.\n * Then the code will always use unaligned memory access.\n * Align check is automatically disabled on x86, x64, ARM64, and some ARM chips\n * which are platforms known to offer good unaligned memory accesses performance.\n *\n * It is also disabled by default when @ref XXH_SIZE_OPT >= 1.\n *\n * This option does not affect XXH3 (only XXH32 and XXH64).\n */\n#  define XXH_FORCE_ALIGN_CHECK 0\n\n/*!\n * @def XXH_NO_INLINE_HINTS\n * @brief When non-zero, sets all functions to `static`.\n *\n * By default, xxHash tries to force the compiler to inline almost all internal\n * functions.\n *\n * This can usually improve performance due to reduced jumping and improved\n * constant folding, but significantly increases the size of the binary which\n * might not be favorable.\n *\n * Additionally, sometimes the forced inlining can be detrimental to performance,\n * depending on the architecture.\n *\n * XXH_NO_INLINE_HINTS marks all internal functions as static, giving the\n * compiler full control on whether to inline or not.\n *\n * When not optimizing (-O0), using `-fno-inline` with GCC or Clang, or if\n * @ref XXH_SIZE_OPT >= 1, this will automatically be defined.\n */\n#  define XXH_NO_INLINE_HINTS 0\n\n/*!\n * @def XXH3_INLINE_SECRET\n * @brief Determines whether to inline the XXH3 withSecret code.\n *\n * When the secret size is known, the compiler can improve the performance\n * of XXH3_64bits_withSecret() and XXH3_128bits_withSecret().\n *\n * However, if the secret size is not known, it doesn't have any benefit. This\n * happens when xxHash is compiled into a global symbol. Therefore, if\n * @ref XXH_INLINE_ALL is *not* defined, this will be defined to 0.\n *\n * Additionally, this defaults to 0 on GCC 12+, which has an issue with function pointers\n * that are *sometimes* force inline on -Og, and it is impossible to automatically\n * detect this optimization level.\n */\n#  define XXH3_INLINE_SECRET 0\n\n/*!\n * @def XXH32_ENDJMP\n * @brief Whether to use a jump for `XXH32_finalize`.\n *\n * For performance, `XXH32_finalize` uses multiple branches in the finalizer.\n * This is generally preferable for performance,\n * but depending on exact architecture, a jmp may be preferable.\n *\n * This setting is only possibly making a difference for very small inputs.\n */\n#  define XXH32_ENDJMP 0\n\n/*!\n * @internal\n * @brief Redefines old internal names.\n *\n * For compatibility with code that uses xxHash's internals before the names\n * were changed to improve namespacing. There is no other reason to use this.\n */\n#  define XXH_OLD_NAMES\n#  undef XXH_OLD_NAMES /* don't actually use, it is ugly. */\n\n/*!\n * @def XXH_NO_STREAM\n * @brief Disables the streaming API.\n *\n * When xxHash is not inlined and the streaming functions are not used, disabling\n * the streaming functions can improve code size significantly, especially with\n * the @ref XXH3_family which tends to make constant folded copies of itself.\n */\n#  define XXH_NO_STREAM\n#  undef XXH_NO_STREAM /* don't actually */\n#endif /* XXH_DOXYGEN */\n/*!\n * @}\n */\n\n#ifndef XXH_FORCE_MEMORY_ACCESS   /* can be defined externally, on command line for example */\n   /* prefer __packed__ structures (method 1) for GCC\n    * < ARMv7 with unaligned access (e.g. Raspbian armhf) still uses byte shifting, so we use memcpy\n    * which for some reason does unaligned loads. */\n#  if defined(__GNUC__) && !(defined(__ARM_ARCH) && __ARM_ARCH < 7 && defined(__ARM_FEATURE_UNALIGNED))\n#    define XXH_FORCE_MEMORY_ACCESS 1\n#  endif\n#endif\n\n#ifndef XXH_SIZE_OPT\n   /* default to 1 for -Os or -Oz */\n#  if (defined(__GNUC__) || defined(__clang__)) && defined(__OPTIMIZE_SIZE__)\n#    define XXH_SIZE_OPT 1\n#  else\n#    define XXH_SIZE_OPT 0\n#  endif\n#endif\n\n#ifndef XXH_FORCE_ALIGN_CHECK  /* can be defined externally */\n   /* don't check on sizeopt, x86, aarch64, or arm when unaligned access is available */\n#  if XXH_SIZE_OPT >= 1 || \\\n      defined(__i386)  || defined(__x86_64__) || defined(__aarch64__) || defined(__ARM_FEATURE_UNALIGNED) \\\n   || defined(_M_IX86) || defined(_M_X64)     || defined(_M_ARM64)    || defined(_M_ARM) /* visual */\n#    define XXH_FORCE_ALIGN_CHECK 0\n#  else\n#    define XXH_FORCE_ALIGN_CHECK 1\n#  endif\n#endif\n\n#ifndef XXH_NO_INLINE_HINTS\n#  if XXH_SIZE_OPT >= 1 || defined(__NO_INLINE__)  /* -O0, -fno-inline */\n#    define XXH_NO_INLINE_HINTS 1\n#  else\n#    define XXH_NO_INLINE_HINTS 0\n#  endif\n#endif\n\n#ifndef XXH3_INLINE_SECRET\n#  if (defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 12) \\\n     || !defined(XXH_INLINE_ALL)\n#    define XXH3_INLINE_SECRET 0\n#  else\n#    define XXH3_INLINE_SECRET 1\n#  endif\n#endif\n\n#ifndef XXH32_ENDJMP\n/* generally preferable for performance */\n#  define XXH32_ENDJMP 0\n#endif\n\n/*!\n * @defgroup impl Implementation\n * @{\n */\n\n\n/* *************************************\n*  Includes & Memory related functions\n***************************************/\n#if defined(XXH_NO_STREAM)\n/* nothing */\n#elif defined(XXH_NO_STDLIB)\n\n/* When requesting to disable any mention of stdlib,\n * the library loses the ability to invoked malloc / free.\n * In practice, it means that functions like `XXH*_createState()`\n * will always fail, and return NULL.\n * This flag is useful in situations where\n * xxhash.h is integrated into some kernel, embedded or limited environment\n * without access to dynamic allocation.\n */\n\nstatic XXH_CONSTF void* XXH_malloc(size_t s) { (void)s; return NULL; }\nstatic void XXH_free(void* p) { (void)p; }\n\n#else\n\n/*\n * Modify the local functions below should you wish to use\n * different memory routines for malloc() and free()\n */\n#include <stdlib.h>\n\n/*!\n * @internal\n * @brief Modify this function to use a different routine than malloc().\n */\nstatic XXH_MALLOCF void* XXH_malloc(size_t s) { return malloc(s); }\n\n/*!\n * @internal\n * @brief Modify this function to use a different routine than free().\n */\nstatic void XXH_free(void* p) { free(p); }\n\n#endif  /* XXH_NO_STDLIB */\n\n#include <string.h>\n\n/*!\n * @internal\n * @brief Modify this function to use a different routine than memcpy().\n */\nstatic void* XXH_memcpy(void* dest, const void* src, size_t size)\n{\n    return memcpy(dest,src,size);\n}\n\n#include <limits.h>   /* ULLONG_MAX */\n\n\n/* *************************************\n*  Compiler Specific Options\n***************************************/\n#ifdef _MSC_VER /* Visual Studio warning fix */\n#  pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */\n#endif\n\n#if XXH_NO_INLINE_HINTS  /* disable inlining hints */\n#  if defined(__GNUC__) || defined(__clang__)\n#    define XXH_FORCE_INLINE static __attribute__((unused))\n#  else\n#    define XXH_FORCE_INLINE static\n#  endif\n#  define XXH_NO_INLINE static\n/* enable inlining hints */\n#elif defined(__GNUC__) || defined(__clang__)\n#  define XXH_FORCE_INLINE static __inline__ __attribute__((always_inline, unused))\n#  define XXH_NO_INLINE static __attribute__((noinline))\n#elif defined(_MSC_VER)  /* Visual Studio */\n#  define XXH_FORCE_INLINE static __forceinline\n#  define XXH_NO_INLINE static __declspec(noinline)\n#elif defined (__cplusplus) \\\n  || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))   /* C99 */\n#  define XXH_FORCE_INLINE static inline\n#  define XXH_NO_INLINE static\n#else\n#  define XXH_FORCE_INLINE static\n#  define XXH_NO_INLINE static\n#endif\n\n#if XXH3_INLINE_SECRET\n#  define XXH3_WITH_SECRET_INLINE XXH_FORCE_INLINE\n#else\n#  define XXH3_WITH_SECRET_INLINE XXH_NO_INLINE\n#endif\n\n\n/* *************************************\n*  Debug\n***************************************/\n/*!\n * @ingroup tuning\n * @def XXH_DEBUGLEVEL\n * @brief Sets the debugging level.\n *\n * XXH_DEBUGLEVEL is expected to be defined externally, typically via the\n * compiler's command line options. The value must be a number.\n */\n#ifndef XXH_DEBUGLEVEL\n#  ifdef DEBUGLEVEL /* backwards compat */\n#    define XXH_DEBUGLEVEL DEBUGLEVEL\n#  else\n#    define XXH_DEBUGLEVEL 0\n#  endif\n#endif\n\n#if (XXH_DEBUGLEVEL>=1)\n#  include <assert.h>   /* note: can still be disabled with NDEBUG */\n#  define XXH_ASSERT(c)   assert(c)\n#else\n#  if defined(__INTEL_COMPILER)\n#    define XXH_ASSERT(c)   XXH_ASSUME((unsigned char) (c))\n#  else\n#    define XXH_ASSERT(c)   XXH_ASSUME(c)\n#  endif\n#endif\n\n/* note: use after variable declarations */\n#ifndef XXH_STATIC_ASSERT\n#  if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)    /* C11 */\n#    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); } while(0)\n#  elif defined(__cplusplus) && (__cplusplus >= 201103L)            /* C++11 */\n#    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0)\n#  else\n#    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { struct xxh_sa { char x[(c) ? 1 : -1]; }; } while(0)\n#  endif\n#  define XXH_STATIC_ASSERT(c) XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)\n#endif\n\n/*!\n * @internal\n * @def XXH_COMPILER_GUARD(var)\n * @brief Used to prevent unwanted optimizations for @p var.\n *\n * It uses an empty GCC inline assembly statement with a register constraint\n * which forces @p var into a general purpose register (eg eax, ebx, ecx\n * on x86) and marks it as modified.\n *\n * This is used in a few places to avoid unwanted autovectorization (e.g.\n * XXH32_round()). All vectorization we want is explicit via intrinsics,\n * and _usually_ isn't wanted elsewhere.\n *\n * We also use it to prevent unwanted constant folding for AArch64 in\n * XXH3_initCustomSecret_scalar().\n */\n#if defined(__GNUC__) || defined(__clang__)\n#  define XXH_COMPILER_GUARD(var) __asm__(\"\" : \"+r\" (var))\n#else\n#  define XXH_COMPILER_GUARD(var) ((void)0)\n#endif\n\n/* Specifically for NEON vectors which use the \"w\" constraint, on\n * Clang. */\n#if defined(__clang__) && defined(__ARM_ARCH) && !defined(__wasm__)\n#  define XXH_COMPILER_GUARD_CLANG_NEON(var) __asm__(\"\" : \"+w\" (var))\n#else\n#  define XXH_COMPILER_GUARD_CLANG_NEON(var) ((void)0)\n#endif\n\n/* *************************************\n*  Basic Types\n***************************************/\n#if !defined (__VMS) \\\n && (defined (__cplusplus) \\\n || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )\n# ifdef _AIX\n#   include <inttypes.h>\n# else\n#   include <stdint.h>\n# endif\n  typedef uint8_t xxh_u8;\n#else\n  typedef unsigned char xxh_u8;\n#endif\ntypedef XXH32_hash_t xxh_u32;\n\n#ifdef XXH_OLD_NAMES\n#  warning \"XXH_OLD_NAMES is planned to be removed starting v0.9. If the program depends on it, consider moving away from it by employing newer type names directly\"\n#  define BYTE xxh_u8\n#  define U8   xxh_u8\n#  define U32  xxh_u32\n#endif\n\n/* ***   Memory access   *** */\n\n/*!\n * @internal\n * @fn xxh_u32 XXH_read32(const void* ptr)\n * @brief Reads an unaligned 32-bit integer from @p ptr in native endianness.\n *\n * Affected by @ref XXH_FORCE_MEMORY_ACCESS.\n *\n * @param ptr The pointer to read from.\n * @return The 32-bit native endian integer from the bytes at @p ptr.\n */\n\n/*!\n * @internal\n * @fn xxh_u32 XXH_readLE32(const void* ptr)\n * @brief Reads an unaligned 32-bit little endian integer from @p ptr.\n *\n * Affected by @ref XXH_FORCE_MEMORY_ACCESS.\n *\n * @param ptr The pointer to read from.\n * @return The 32-bit little endian integer from the bytes at @p ptr.\n */\n\n/*!\n * @internal\n * @fn xxh_u32 XXH_readBE32(const void* ptr)\n * @brief Reads an unaligned 32-bit big endian integer from @p ptr.\n *\n * Affected by @ref XXH_FORCE_MEMORY_ACCESS.\n *\n * @param ptr The pointer to read from.\n * @return The 32-bit big endian integer from the bytes at @p ptr.\n */\n\n/*!\n * @internal\n * @fn xxh_u32 XXH_readLE32_align(const void* ptr, XXH_alignment align)\n * @brief Like @ref XXH_readLE32(), but has an option for aligned reads.\n *\n * Affected by @ref XXH_FORCE_MEMORY_ACCESS.\n * Note that when @ref XXH_FORCE_ALIGN_CHECK == 0, the @p align parameter is\n * always @ref XXH_alignment::XXH_unaligned.\n *\n * @param ptr The pointer to read from.\n * @param align Whether @p ptr is aligned.\n * @pre\n *   If @p align == @ref XXH_alignment::XXH_aligned, @p ptr must be 4 byte\n *   aligned.\n * @return The 32-bit little endian integer from the bytes at @p ptr.\n */\n\n#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==3))\n/*\n * Manual byteshift. Best for old compilers which don't inline memcpy.\n * We actually directly use XXH_readLE32 and XXH_readBE32.\n */\n#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2))\n\n/*\n * Force direct memory access. Only works on CPU which support unaligned memory\n * access in hardware.\n */\nstatic xxh_u32 XXH_read32(const void* memPtr) { return *(const xxh_u32*) memPtr; }\n\n#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1))\n\n/*\n * __attribute__((aligned(1))) is supported by gcc and clang. Originally the\n * documentation claimed that it only increased the alignment, but actually it\n * can decrease it on gcc, clang, and icc:\n * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69502,\n * https://gcc.godbolt.org/z/xYez1j67Y.\n */\n#ifdef XXH_OLD_NAMES\ntypedef union { xxh_u32 u32; } __attribute__((packed)) unalign;\n#endif\nstatic xxh_u32 XXH_read32(const void* ptr)\n{\n    typedef __attribute__((aligned(1))) xxh_u32 xxh_unalign32;\n    return *((const xxh_unalign32*)ptr);\n}\n\n#else\n\n/*\n * Portable and safe solution. Generally efficient.\n * see: https://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html\n */\nstatic xxh_u32 XXH_read32(const void* memPtr)\n{\n    xxh_u32 val;\n    XXH_memcpy(&val, memPtr, sizeof(val));\n    return val;\n}\n\n#endif   /* XXH_FORCE_DIRECT_MEMORY_ACCESS */\n\n\n/* ***   Endianness   *** */\n\n/*!\n * @ingroup tuning\n * @def XXH_CPU_LITTLE_ENDIAN\n * @brief Whether the target is little endian.\n *\n * Defined to 1 if the target is little endian, or 0 if it is big endian.\n * It can be defined externally, for example on the compiler command line.\n *\n * If it is not defined,\n * a runtime check (which is usually constant folded) is used instead.\n *\n * @note\n *   This is not necessarily defined to an integer constant.\n *\n * @see XXH_isLittleEndian() for the runtime check.\n */\n#ifndef XXH_CPU_LITTLE_ENDIAN\n/*\n * Try to detect endianness automatically, to avoid the nonstandard behavior\n * in `XXH_isLittleEndian()`\n */\n#  if defined(_WIN32) /* Windows is always little endian */ \\\n     || defined(__LITTLE_ENDIAN__) \\\n     || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)\n#    define XXH_CPU_LITTLE_ENDIAN 1\n#  elif defined(__BIG_ENDIAN__) \\\n     || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)\n#    define XXH_CPU_LITTLE_ENDIAN 0\n#  else\n/*!\n * @internal\n * @brief Runtime check for @ref XXH_CPU_LITTLE_ENDIAN.\n *\n * Most compilers will constant fold this.\n */\nstatic int XXH_isLittleEndian(void)\n{\n    /*\n     * Portable and well-defined behavior.\n     * Don't use static: it is detrimental to performance.\n     */\n    const union { xxh_u32 u; xxh_u8 c[4]; } one = { 1 };\n    return one.c[0];\n}\n#   define XXH_CPU_LITTLE_ENDIAN   XXH_isLittleEndian()\n#  endif\n#endif\n\n\n\n\n/* ****************************************\n*  Compiler-specific Functions and Macros\n******************************************/\n#define XXH_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)\n\n#ifdef __has_builtin\n#  define XXH_HAS_BUILTIN(x) __has_builtin(x)\n#else\n#  define XXH_HAS_BUILTIN(x) 0\n#endif\n\n\n\n/*\n * C23 and future versions have standard \"unreachable()\".\n * Once it has been implemented reliably we can add it as an\n * additional case:\n *\n * ```\n * #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= XXH_C23_VN)\n * #  include <stddef.h>\n * #  ifdef unreachable\n * #    define XXH_UNREACHABLE() unreachable()\n * #  endif\n * #endif\n * ```\n *\n * Note C++23 also has std::unreachable() which can be detected\n * as follows:\n * ```\n * #if defined(__cpp_lib_unreachable) && (__cpp_lib_unreachable >= 202202L)\n * #  include <utility>\n * #  define XXH_UNREACHABLE() std::unreachable()\n * #endif\n * ```\n * NB: `__cpp_lib_unreachable` is defined in the `<version>` header.\n * We don't use that as including `<utility>` in `extern \"C\"` blocks\n * doesn't work on GCC12\n */\n\n#if XXH_HAS_BUILTIN(__builtin_unreachable)\n#  define XXH_UNREACHABLE() __builtin_unreachable()\n\n#elif defined(_MSC_VER)\n#  define XXH_UNREACHABLE() __assume(0)\n\n#else\n#  define XXH_UNREACHABLE()\n#endif\n\n#if XXH_HAS_BUILTIN(__builtin_assume)\n#  define XXH_ASSUME(c) __builtin_assume(c)\n#else\n#  define XXH_ASSUME(c) if (!(c)) { XXH_UNREACHABLE(); }\n#endif\n\n/*!\n * @internal\n * @def XXH_rotl32(x,r)\n * @brief 32-bit rotate left.\n *\n * @param x The 32-bit integer to be rotated.\n * @param r The number of bits to rotate.\n * @pre\n *   @p r > 0 && @p r < 32\n * @note\n *   @p x and @p r may be evaluated multiple times.\n * @return The rotated result.\n */\n#if !defined(NO_CLANG_BUILTIN) && XXH_HAS_BUILTIN(__builtin_rotateleft32) \\\n                               && XXH_HAS_BUILTIN(__builtin_rotateleft64)\n#  define XXH_rotl32 __builtin_rotateleft32\n#  define XXH_rotl64 __builtin_rotateleft64\n/* Note: although _rotl exists for minGW (GCC under windows), performance seems poor */\n#elif defined(_MSC_VER)\n#  define XXH_rotl32(x,r) _rotl(x,r)\n#  define XXH_rotl64(x,r) _rotl64(x,r)\n#else\n#  define XXH_rotl32(x,r) (((x) << (r)) | ((x) >> (32 - (r))))\n#  define XXH_rotl64(x,r) (((x) << (r)) | ((x) >> (64 - (r))))\n#endif\n\n/*!\n * @internal\n * @fn xxh_u32 XXH_swap32(xxh_u32 x)\n * @brief A 32-bit byteswap.\n *\n * @param x The 32-bit integer to byteswap.\n * @return @p x, byteswapped.\n */\n#if defined(_MSC_VER)     /* Visual Studio */\n#  define XXH_swap32 _byteswap_ulong\n#elif XXH_GCC_VERSION >= 403\n#  define XXH_swap32 __builtin_bswap32\n#else\nstatic xxh_u32 XXH_swap32 (xxh_u32 x)\n{\n    return  ((x << 24) & 0xff000000 ) |\n            ((x <<  8) & 0x00ff0000 ) |\n            ((x >>  8) & 0x0000ff00 ) |\n            ((x >> 24) & 0x000000ff );\n}\n#endif\n\n\n/* ***************************\n*  Memory reads\n*****************************/\n\n/*!\n * @internal\n * @brief Enum to indicate whether a pointer is aligned.\n */\ntypedef enum {\n    XXH_aligned,  /*!< Aligned */\n    XXH_unaligned /*!< Possibly unaligned */\n} XXH_alignment;\n\n/*\n * XXH_FORCE_MEMORY_ACCESS==3 is an endian-independent byteshift load.\n *\n * This is ideal for older compilers which don't inline memcpy.\n */\n#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==3))\n\nXXH_FORCE_INLINE xxh_u32 XXH_readLE32(const void* memPtr)\n{\n    const xxh_u8* bytePtr = (const xxh_u8 *)memPtr;\n    return bytePtr[0]\n         | ((xxh_u32)bytePtr[1] << 8)\n         | ((xxh_u32)bytePtr[2] << 16)\n         | ((xxh_u32)bytePtr[3] << 24);\n}\n\nXXH_FORCE_INLINE xxh_u32 XXH_readBE32(const void* memPtr)\n{\n    const xxh_u8* bytePtr = (const xxh_u8 *)memPtr;\n    return bytePtr[3]\n         | ((xxh_u32)bytePtr[2] << 8)\n         | ((xxh_u32)bytePtr[1] << 16)\n         | ((xxh_u32)bytePtr[0] << 24);\n}\n\n#else\nXXH_FORCE_INLINE xxh_u32 XXH_readLE32(const void* ptr)\n{\n    return XXH_CPU_LITTLE_ENDIAN ? XXH_read32(ptr) : XXH_swap32(XXH_read32(ptr));\n}\n\nstatic xxh_u32 XXH_readBE32(const void* ptr)\n{\n    return XXH_CPU_LITTLE_ENDIAN ? XXH_swap32(XXH_read32(ptr)) : XXH_read32(ptr);\n}\n#endif\n\nXXH_FORCE_INLINE xxh_u32\nXXH_readLE32_align(const void* ptr, XXH_alignment align)\n{\n    if (align==XXH_unaligned) {\n        return XXH_readLE32(ptr);\n    } else {\n        return XXH_CPU_LITTLE_ENDIAN ? *(const xxh_u32*)ptr : XXH_swap32(*(const xxh_u32*)ptr);\n    }\n}\n\n\n/* *************************************\n*  Misc\n***************************************/\n/*! @ingroup public */\nXXH_PUBLIC_API unsigned XXH_versionNumber (void) { return XXH_VERSION_NUMBER; }\n\n\n/* *******************************************************************\n*  32-bit hash functions\n*********************************************************************/\n/*!\n * @}\n * @defgroup XXH32_impl XXH32 implementation\n * @ingroup impl\n *\n * Details on the XXH32 implementation.\n * @{\n */\n /* #define instead of static const, to be used as initializers */\n#define XXH_PRIME32_1  0x9E3779B1U  /*!< 0b10011110001101110111100110110001 */\n#define XXH_PRIME32_2  0x85EBCA77U  /*!< 0b10000101111010111100101001110111 */\n#define XXH_PRIME32_3  0xC2B2AE3DU  /*!< 0b11000010101100101010111000111101 */\n#define XXH_PRIME32_4  0x27D4EB2FU  /*!< 0b00100111110101001110101100101111 */\n#define XXH_PRIME32_5  0x165667B1U  /*!< 0b00010110010101100110011110110001 */\n\n#ifdef XXH_OLD_NAMES\n#  define PRIME32_1 XXH_PRIME32_1\n#  define PRIME32_2 XXH_PRIME32_2\n#  define PRIME32_3 XXH_PRIME32_3\n#  define PRIME32_4 XXH_PRIME32_4\n#  define PRIME32_5 XXH_PRIME32_5\n#endif\n\n/*!\n * @internal\n * @brief Normal stripe processing routine.\n *\n * This shuffles the bits so that any bit from @p input impacts several bits in\n * @p acc.\n *\n * @param acc The accumulator lane.\n * @param input The stripe of input to mix.\n * @return The mixed accumulator lane.\n */\nstatic xxh_u32 XXH32_round(xxh_u32 acc, xxh_u32 input)\n{\n    acc += input * XXH_PRIME32_2;\n    acc  = XXH_rotl32(acc, 13);\n    acc *= XXH_PRIME32_1;\n#if (defined(__SSE4_1__) || defined(__aarch64__) || defined(__wasm_simd128__)) && !defined(XXH_ENABLE_AUTOVECTORIZE)\n    /*\n     * UGLY HACK:\n     * A compiler fence is the only thing that prevents GCC and Clang from\n     * autovectorizing the XXH32 loop (pragmas and attributes don't work for some\n     * reason) without globally disabling SSE4.1.\n     *\n     * The reason we want to avoid vectorization is because despite working on\n     * 4 integers at a time, there are multiple factors slowing XXH32 down on\n     * SSE4:\n     * - There's a ridiculous amount of lag from pmulld (10 cycles of latency on\n     *   newer chips!) making it slightly slower to multiply four integers at\n     *   once compared to four integers independently. Even when pmulld was\n     *   fastest, Sandy/Ivy Bridge, it is still not worth it to go into SSE\n     *   just to multiply unless doing a long operation.\n     *\n     * - Four instructions are required to rotate,\n     *      movqda tmp,  v // not required with VEX encoding\n     *      pslld  tmp, 13 // tmp <<= 13\n     *      psrld  v,   19 // x >>= 19\n     *      por    v,  tmp // x |= tmp\n     *   compared to one for scalar:\n     *      roll   v, 13    // reliably fast across the board\n     *      shldl  v, v, 13 // Sandy Bridge and later prefer this for some reason\n     *\n     * - Instruction level parallelism is actually more beneficial here because\n     *   the SIMD actually serializes this operation: While v1 is rotating, v2\n     *   can load data, while v3 can multiply. SSE forces them to operate\n     *   together.\n     *\n     * This is also enabled on AArch64, as Clang is *very aggressive* in vectorizing\n     * the loop. NEON is only faster on the A53, and with the newer cores, it is less\n     * than half the speed.\n     *\n     * Additionally, this is used on WASM SIMD128 because it JITs to the same\n     * SIMD instructions and has the same issue.\n     */\n    XXH_COMPILER_GUARD(acc);\n#endif\n    return acc;\n}\n\n/*!\n * @internal\n * @brief Mixes all bits to finalize the hash.\n *\n * The final mix ensures that all input bits have a chance to impact any bit in\n * the output digest, resulting in an unbiased distribution.\n *\n * @param hash The hash to avalanche.\n * @return The avalanched hash.\n */\nstatic xxh_u32 XXH32_avalanche(xxh_u32 hash)\n{\n    hash ^= hash >> 15;\n    hash *= XXH_PRIME32_2;\n    hash ^= hash >> 13;\n    hash *= XXH_PRIME32_3;\n    hash ^= hash >> 16;\n    return hash;\n}\n\n#define XXH_get32bits(p) XXH_readLE32_align(p, align)\n\n/*!\n * @internal\n * @brief Processes the last 0-15 bytes of @p ptr.\n *\n * There may be up to 15 bytes remaining to consume from the input.\n * This final stage will digest them to ensure that all input bytes are present\n * in the final mix.\n *\n * @param hash The hash to finalize.\n * @param ptr The pointer to the remaining input.\n * @param len The remaining length, modulo 16.\n * @param align Whether @p ptr is aligned.\n * @return The finalized hash.\n * @see XXH64_finalize().\n */\nstatic XXH_PUREF xxh_u32\nXXH32_finalize(xxh_u32 hash, const xxh_u8* ptr, size_t len, XXH_alignment align)\n{\n#define XXH_PROCESS1 do {                             \\\n    hash += (*ptr++) * XXH_PRIME32_5;                 \\\n    hash = XXH_rotl32(hash, 11) * XXH_PRIME32_1;      \\\n} while (0)\n\n#define XXH_PROCESS4 do {                             \\\n    hash += XXH_get32bits(ptr) * XXH_PRIME32_3;       \\\n    ptr += 4;                                         \\\n    hash  = XXH_rotl32(hash, 17) * XXH_PRIME32_4;     \\\n} while (0)\n\n    if (ptr==NULL) XXH_ASSERT(len == 0);\n\n    /* Compact rerolled version; generally faster */\n    if (!XXH32_ENDJMP) {\n        len &= 15;\n        while (len >= 4) {\n            XXH_PROCESS4;\n            len -= 4;\n        }\n        while (len > 0) {\n            XXH_PROCESS1;\n            --len;\n        }\n        return XXH32_avalanche(hash);\n    } else {\n         switch(len&15) /* or switch(bEnd - p) */ {\n           case 12:      XXH_PROCESS4;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 8:       XXH_PROCESS4;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 4:       XXH_PROCESS4;\n                         return XXH32_avalanche(hash);\n\n           case 13:      XXH_PROCESS4;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 9:       XXH_PROCESS4;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 5:       XXH_PROCESS4;\n                         XXH_PROCESS1;\n                         return XXH32_avalanche(hash);\n\n           case 14:      XXH_PROCESS4;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 10:      XXH_PROCESS4;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 6:       XXH_PROCESS4;\n                         XXH_PROCESS1;\n                         XXH_PROCESS1;\n                         return XXH32_avalanche(hash);\n\n           case 15:      XXH_PROCESS4;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 11:      XXH_PROCESS4;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 7:       XXH_PROCESS4;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 3:       XXH_PROCESS1;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 2:       XXH_PROCESS1;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 1:       XXH_PROCESS1;\n                         XXH_FALLTHROUGH;  /* fallthrough */\n           case 0:       return XXH32_avalanche(hash);\n        }\n        XXH_ASSERT(0);\n        return hash;   /* reaching this point is deemed impossible */\n    }\n}\n\n#ifdef XXH_OLD_NAMES\n#  define PROCESS1 XXH_PROCESS1\n#  define PROCESS4 XXH_PROCESS4\n#else\n#  undef XXH_PROCESS1\n#  undef XXH_PROCESS4\n#endif\n\n/*!\n * @internal\n * @brief The implementation for @ref XXH32().\n *\n * @param input , len , seed Directly passed from @ref XXH32().\n * @param align Whether @p input is aligned.\n * @return The calculated hash.\n */\nXXH_FORCE_INLINE XXH_PUREF xxh_u32\nXXH32_endian_align(const xxh_u8* input, size_t len, xxh_u32 seed, XXH_alignment align)\n{\n    xxh_u32 h32;\n\n    if (input==NULL) XXH_ASSERT(len == 0);\n\n    if (len>=16) {\n        const xxh_u8* const bEnd = input + len;\n        const xxh_u8* const limit = bEnd - 15;\n        xxh_u32 v1 = seed + XXH_PRIME32_1 + XXH_PRIME32_2;\n        xxh_u32 v2 = seed + XXH_PRIME32_2;\n        xxh_u32 v3 = seed + 0;\n        xxh_u32 v4 = seed - XXH_PRIME32_1;\n\n        do {\n            v1 = XXH32_round(v1, XXH_get32bits(input)); input += 4;\n            v2 = XXH32_round(v2, XXH_get32bits(input)); input += 4;\n            v3 = XXH32_round(v3, XXH_get32bits(input)); input += 4;\n            v4 = XXH32_round(v4, XXH_get32bits(input)); input += 4;\n        } while (input < limit);\n\n        h32 = XXH_rotl32(v1, 1)  + XXH_rotl32(v2, 7)\n            + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);\n    } else {\n        h32  = seed + XXH_PRIME32_5;\n    }\n\n    h32 += (xxh_u32)len;\n\n    return XXH32_finalize(h32, input, len&15, align);\n}\n\n/*! @ingroup XXH32_family */\nXXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t len, XXH32_hash_t seed)\n{\n#if !defined(XXH_NO_STREAM) && XXH_SIZE_OPT >= 2\n    /* Simple version, good for code maintenance, but unfortunately slow for small inputs */\n    XXH32_state_t state;\n    XXH32_reset(&state, seed);\n    XXH32_update(&state, (const xxh_u8*)input, len);\n    return XXH32_digest(&state);\n#else\n    if (XXH_FORCE_ALIGN_CHECK) {\n        if ((((size_t)input) & 3) == 0) {   /* Input is 4-bytes aligned, leverage the speed benefit */\n            return XXH32_endian_align((const xxh_u8*)input, len, seed, XXH_aligned);\n    }   }\n\n    return XXH32_endian_align((const xxh_u8*)input, len, seed, XXH_unaligned);\n#endif\n}\n\n\n\n/*******   Hash streaming   *******/\n#ifndef XXH_NO_STREAM\n/*! @ingroup XXH32_family */\nXXH_PUBLIC_API XXH32_state_t* XXH32_createState(void)\n{\n    return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t));\n}\n/*! @ingroup XXH32_family */\nXXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr)\n{\n    XXH_free(statePtr);\n    return XXH_OK;\n}\n\n/*! @ingroup XXH32_family */\nXXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dstState, const XXH32_state_t* srcState)\n{\n    XXH_memcpy(dstState, srcState, sizeof(*dstState));\n}\n\n/*! @ingroup XXH32_family */\nXXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, XXH32_hash_t seed)\n{\n    XXH_ASSERT(statePtr != NULL);\n    memset(statePtr, 0, sizeof(*statePtr));\n    statePtr->v[0] = seed + XXH_PRIME32_1 + XXH_PRIME32_2;\n    statePtr->v[1] = seed + XXH_PRIME32_2;\n    statePtr->v[2] = seed + 0;\n    statePtr->v[3] = seed - XXH_PRIME32_1;\n    return XXH_OK;\n}\n\n\n/*! @ingroup XXH32_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH32_update(XXH32_state_t* state, const void* input, size_t len)\n{\n    if (input==NULL) {\n        XXH_ASSERT(len == 0);\n        return XXH_OK;\n    }\n\n    {   const xxh_u8* p = (const xxh_u8*)input;\n        const xxh_u8* const bEnd = p + len;\n\n        state->total_len_32 += (XXH32_hash_t)len;\n        state->large_len |= (XXH32_hash_t)((len>=16) | (state->total_len_32>=16));\n\n        if (state->memsize + len < 16)  {   /* fill in tmp buffer */\n            XXH_memcpy((xxh_u8*)(state->mem32) + state->memsize, input, len);\n            state->memsize += (XXH32_hash_t)len;\n            return XXH_OK;\n        }\n\n        if (state->memsize) {   /* some data left from previous update */\n            XXH_memcpy((xxh_u8*)(state->mem32) + state->memsize, input, 16-state->memsize);\n            {   const xxh_u32* p32 = state->mem32;\n                state->v[0] = XXH32_round(state->v[0], XXH_readLE32(p32)); p32++;\n                state->v[1] = XXH32_round(state->v[1], XXH_readLE32(p32)); p32++;\n                state->v[2] = XXH32_round(state->v[2], XXH_readLE32(p32)); p32++;\n                state->v[3] = XXH32_round(state->v[3], XXH_readLE32(p32));\n            }\n            p += 16-state->memsize;\n            state->memsize = 0;\n        }\n\n        if (p <= bEnd-16) {\n            const xxh_u8* const limit = bEnd - 16;\n\n            do {\n                state->v[0] = XXH32_round(state->v[0], XXH_readLE32(p)); p+=4;\n                state->v[1] = XXH32_round(state->v[1], XXH_readLE32(p)); p+=4;\n                state->v[2] = XXH32_round(state->v[2], XXH_readLE32(p)); p+=4;\n                state->v[3] = XXH32_round(state->v[3], XXH_readLE32(p)); p+=4;\n            } while (p<=limit);\n\n        }\n\n        if (p < bEnd) {\n            XXH_memcpy(state->mem32, p, (size_t)(bEnd-p));\n            state->memsize = (unsigned)(bEnd-p);\n        }\n    }\n\n    return XXH_OK;\n}\n\n\n/*! @ingroup XXH32_family */\nXXH_PUBLIC_API XXH32_hash_t XXH32_digest(const XXH32_state_t* state)\n{\n    xxh_u32 h32;\n\n    if (state->large_len) {\n        h32 = XXH_rotl32(state->v[0], 1)\n            + XXH_rotl32(state->v[1], 7)\n            + XXH_rotl32(state->v[2], 12)\n            + XXH_rotl32(state->v[3], 18);\n    } else {\n        h32 = state->v[2] /* == seed */ + XXH_PRIME32_5;\n    }\n\n    h32 += state->total_len_32;\n\n    return XXH32_finalize(h32, (const xxh_u8*)state->mem32, state->memsize, XXH_aligned);\n}\n#endif /* !XXH_NO_STREAM */\n\n/*******   Canonical representation   *******/\n\n/*! @ingroup XXH32_family */\nXXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash)\n{\n    XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t));\n    if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap32(hash);\n    XXH_memcpy(dst, &hash, sizeof(*dst));\n}\n/*! @ingroup XXH32_family */\nXXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src)\n{\n    return XXH_readBE32(src);\n}\n\n\n#ifndef XXH_NO_LONG_LONG\n\n/* *******************************************************************\n*  64-bit hash functions\n*********************************************************************/\n/*!\n * @}\n * @ingroup impl\n * @{\n */\n/*******   Memory access   *******/\n\ntypedef XXH64_hash_t xxh_u64;\n\n#ifdef XXH_OLD_NAMES\n#  define U64 xxh_u64\n#endif\n\n#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==3))\n/*\n * Manual byteshift. Best for old compilers which don't inline memcpy.\n * We actually directly use XXH_readLE64 and XXH_readBE64.\n */\n#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2))\n\n/* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */\nstatic xxh_u64 XXH_read64(const void* memPtr)\n{\n    return *(const xxh_u64*) memPtr;\n}\n\n#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1))\n\n/*\n * __attribute__((aligned(1))) is supported by gcc and clang. Originally the\n * documentation claimed that it only increased the alignment, but actually it\n * can decrease it on gcc, clang, and icc:\n * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69502,\n * https://gcc.godbolt.org/z/xYez1j67Y.\n */\n#ifdef XXH_OLD_NAMES\ntypedef union { xxh_u32 u32; xxh_u64 u64; } __attribute__((packed)) unalign64;\n#endif\nstatic xxh_u64 XXH_read64(const void* ptr)\n{\n    typedef __attribute__((aligned(1))) xxh_u64 xxh_unalign64;\n    return *((const xxh_unalign64*)ptr);\n}\n\n#else\n\n/*\n * Portable and safe solution. Generally efficient.\n * see: https://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html\n */\nstatic xxh_u64 XXH_read64(const void* memPtr)\n{\n    xxh_u64 val;\n    XXH_memcpy(&val, memPtr, sizeof(val));\n    return val;\n}\n\n#endif   /* XXH_FORCE_DIRECT_MEMORY_ACCESS */\n\n#if defined(_MSC_VER)     /* Visual Studio */\n#  define XXH_swap64 _byteswap_uint64\n#elif XXH_GCC_VERSION >= 403\n#  define XXH_swap64 __builtin_bswap64\n#else\nstatic xxh_u64 XXH_swap64(xxh_u64 x)\n{\n    return  ((x << 56) & 0xff00000000000000ULL) |\n            ((x << 40) & 0x00ff000000000000ULL) |\n            ((x << 24) & 0x0000ff0000000000ULL) |\n            ((x << 8)  & 0x000000ff00000000ULL) |\n            ((x >> 8)  & 0x00000000ff000000ULL) |\n            ((x >> 24) & 0x0000000000ff0000ULL) |\n            ((x >> 40) & 0x000000000000ff00ULL) |\n            ((x >> 56) & 0x00000000000000ffULL);\n}\n#endif\n\n\n/* XXH_FORCE_MEMORY_ACCESS==3 is an endian-independent byteshift load. */\n#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==3))\n\nXXH_FORCE_INLINE xxh_u64 XXH_readLE64(const void* memPtr)\n{\n    const xxh_u8* bytePtr = (const xxh_u8 *)memPtr;\n    return bytePtr[0]\n         | ((xxh_u64)bytePtr[1] << 8)\n         | ((xxh_u64)bytePtr[2] << 16)\n         | ((xxh_u64)bytePtr[3] << 24)\n         | ((xxh_u64)bytePtr[4] << 32)\n         | ((xxh_u64)bytePtr[5] << 40)\n         | ((xxh_u64)bytePtr[6] << 48)\n         | ((xxh_u64)bytePtr[7] << 56);\n}\n\nXXH_FORCE_INLINE xxh_u64 XXH_readBE64(const void* memPtr)\n{\n    const xxh_u8* bytePtr = (const xxh_u8 *)memPtr;\n    return bytePtr[7]\n         | ((xxh_u64)bytePtr[6] << 8)\n         | ((xxh_u64)bytePtr[5] << 16)\n         | ((xxh_u64)bytePtr[4] << 24)\n         | ((xxh_u64)bytePtr[3] << 32)\n         | ((xxh_u64)bytePtr[2] << 40)\n         | ((xxh_u64)bytePtr[1] << 48)\n         | ((xxh_u64)bytePtr[0] << 56);\n}\n\n#else\nXXH_FORCE_INLINE xxh_u64 XXH_readLE64(const void* ptr)\n{\n    return XXH_CPU_LITTLE_ENDIAN ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr));\n}\n\nstatic xxh_u64 XXH_readBE64(const void* ptr)\n{\n    return XXH_CPU_LITTLE_ENDIAN ? XXH_swap64(XXH_read64(ptr)) : XXH_read64(ptr);\n}\n#endif\n\nXXH_FORCE_INLINE xxh_u64\nXXH_readLE64_align(const void* ptr, XXH_alignment align)\n{\n    if (align==XXH_unaligned)\n        return XXH_readLE64(ptr);\n    else\n        return XXH_CPU_LITTLE_ENDIAN ? *(const xxh_u64*)ptr : XXH_swap64(*(const xxh_u64*)ptr);\n}\n\n\n/*******   xxh64   *******/\n/*!\n * @}\n * @defgroup XXH64_impl XXH64 implementation\n * @ingroup impl\n *\n * Details on the XXH64 implementation.\n * @{\n */\n/* #define rather that static const, to be used as initializers */\n#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */\n#define XXH_PRIME64_2  0xC2B2AE3D27D4EB4FULL  /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */\n#define XXH_PRIME64_3  0x165667B19E3779F9ULL  /*!< 0b0001011001010110011001111011000110011110001101110111100111111001 */\n#define XXH_PRIME64_4  0x85EBCA77C2B2AE63ULL  /*!< 0b1000010111101011110010100111011111000010101100101010111001100011 */\n#define XXH_PRIME64_5  0x27D4EB2F165667C5ULL  /*!< 0b0010011111010100111010110010111100010110010101100110011111000101 */\n\n#ifdef XXH_OLD_NAMES\n#  define PRIME64_1 XXH_PRIME64_1\n#  define PRIME64_2 XXH_PRIME64_2\n#  define PRIME64_3 XXH_PRIME64_3\n#  define PRIME64_4 XXH_PRIME64_4\n#  define PRIME64_5 XXH_PRIME64_5\n#endif\n\n/*! @copydoc XXH32_round */\nstatic xxh_u64 XXH64_round(xxh_u64 acc, xxh_u64 input)\n{\n    acc += input * XXH_PRIME64_2;\n    acc  = XXH_rotl64(acc, 31);\n    acc *= XXH_PRIME64_1;\n#if (defined(__AVX512F__)) && !defined(XXH_ENABLE_AUTOVECTORIZE)\n    /*\n     * DISABLE AUTOVECTORIZATION:\n     * A compiler fence is used to prevent GCC and Clang from\n     * autovectorizing the XXH64 loop (pragmas and attributes don't work for some\n     * reason) without globally disabling AVX512.\n     *\n     * Autovectorization of XXH64 tends to be detrimental,\n     * though the exact outcome may change depending on exact cpu and compiler version.\n     * For information, it has been reported as detrimental for Skylake-X,\n     * but possibly beneficial for Zen4.\n     *\n     * The default is to disable auto-vectorization,\n     * but you can select to enable it instead using `XXH_ENABLE_AUTOVECTORIZE` build variable.\n     */\n    XXH_COMPILER_GUARD(acc);\n#endif\n    return acc;\n}\n\nstatic xxh_u64 XXH64_mergeRound(xxh_u64 acc, xxh_u64 val)\n{\n    val  = XXH64_round(0, val);\n    acc ^= val;\n    acc  = acc * XXH_PRIME64_1 + XXH_PRIME64_4;\n    return acc;\n}\n\n/*! @copydoc XXH32_avalanche */\nstatic xxh_u64 XXH64_avalanche(xxh_u64 hash)\n{\n    hash ^= hash >> 33;\n    hash *= XXH_PRIME64_2;\n    hash ^= hash >> 29;\n    hash *= XXH_PRIME64_3;\n    hash ^= hash >> 32;\n    return hash;\n}\n\n\n#define XXH_get64bits(p) XXH_readLE64_align(p, align)\n\n/*!\n * @internal\n * @brief Processes the last 0-31 bytes of @p ptr.\n *\n * There may be up to 31 bytes remaining to consume from the input.\n * This final stage will digest them to ensure that all input bytes are present\n * in the final mix.\n *\n * @param hash The hash to finalize.\n * @param ptr The pointer to the remaining input.\n * @param len The remaining length, modulo 32.\n * @param align Whether @p ptr is aligned.\n * @return The finalized hash\n * @see XXH32_finalize().\n */\nstatic XXH_PUREF xxh_u64\nXXH64_finalize(xxh_u64 hash, const xxh_u8* ptr, size_t len, XXH_alignment align)\n{\n    if (ptr==NULL) XXH_ASSERT(len == 0);\n    len &= 31;\n    while (len >= 8) {\n        xxh_u64 const k1 = XXH64_round(0, XXH_get64bits(ptr));\n        ptr += 8;\n        hash ^= k1;\n        hash  = XXH_rotl64(hash,27) * XXH_PRIME64_1 + XXH_PRIME64_4;\n        len -= 8;\n    }\n    if (len >= 4) {\n        hash ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1;\n        ptr += 4;\n        hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3;\n        // coverity[overflow_const]\n        len -= 4;\n    }\n    while (len > 0) {\n        hash ^= (*ptr++) * XXH_PRIME64_5;\n        hash = XXH_rotl64(hash, 11) * XXH_PRIME64_1;\n        --len;\n    }\n    return  XXH64_avalanche(hash);\n}\n\n#ifdef XXH_OLD_NAMES\n#  define PROCESS1_64 XXH_PROCESS1_64\n#  define PROCESS4_64 XXH_PROCESS4_64\n#  define PROCESS8_64 XXH_PROCESS8_64\n#else\n#  undef XXH_PROCESS1_64\n#  undef XXH_PROCESS4_64\n#  undef XXH_PROCESS8_64\n#endif\n\n/*!\n * @internal\n * @brief The implementation for @ref XXH64().\n *\n * @param input , len , seed Directly passed from @ref XXH64().\n * @param align Whether @p input is aligned.\n * @return The calculated hash.\n */\nXXH_FORCE_INLINE XXH_PUREF xxh_u64\nXXH64_endian_align(const xxh_u8* input, size_t len, xxh_u64 seed, XXH_alignment align)\n{\n    xxh_u64 h64;\n    if (input==NULL) XXH_ASSERT(len == 0);\n\n    if (len>=32) {\n        const xxh_u8* const bEnd = input + len;\n        const xxh_u8* const limit = bEnd - 31;\n        xxh_u64 v1 = seed + XXH_PRIME64_1 + XXH_PRIME64_2;\n        xxh_u64 v2 = seed + XXH_PRIME64_2;\n        xxh_u64 v3 = seed + 0;\n        xxh_u64 v4 = seed - XXH_PRIME64_1;\n\n        do {\n            v1 = XXH64_round(v1, XXH_get64bits(input)); input+=8;\n            v2 = XXH64_round(v2, XXH_get64bits(input)); input+=8;\n            v3 = XXH64_round(v3, XXH_get64bits(input)); input+=8;\n            v4 = XXH64_round(v4, XXH_get64bits(input)); input+=8;\n        } while (input<limit);\n\n        h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18);\n        h64 = XXH64_mergeRound(h64, v1);\n        h64 = XXH64_mergeRound(h64, v2);\n        h64 = XXH64_mergeRound(h64, v3);\n        h64 = XXH64_mergeRound(h64, v4);\n\n    } else {\n        h64  = seed + XXH_PRIME64_5;\n    }\n\n    h64 += (xxh_u64) len;\n\n    return XXH64_finalize(h64, input, len, align);\n}\n\n\n/*! @ingroup XXH64_family */\nXXH_PUBLIC_API XXH64_hash_t XXH64 (XXH_NOESCAPE const void* input, size_t len, XXH64_hash_t seed)\n{\n#if !defined(XXH_NO_STREAM) && XXH_SIZE_OPT >= 2\n    /* Simple version, good for code maintenance, but unfortunately slow for small inputs */\n    XXH64_state_t state;\n    XXH64_reset(&state, seed);\n    XXH64_update(&state, (const xxh_u8*)input, len);\n    return XXH64_digest(&state);\n#else\n    if (XXH_FORCE_ALIGN_CHECK) {\n        if ((((size_t)input) & 7)==0) {  /* Input is aligned, let's leverage the speed advantage */\n            return XXH64_endian_align((const xxh_u8*)input, len, seed, XXH_aligned);\n    }   }\n\n    return XXH64_endian_align((const xxh_u8*)input, len, seed, XXH_unaligned);\n\n#endif\n}\n\n/*******   Hash Streaming   *******/\n#ifndef XXH_NO_STREAM\n/*! @ingroup XXH64_family*/\nXXH_PUBLIC_API XXH64_state_t* XXH64_createState(void)\n{\n    return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t));\n}\n/*! @ingroup XXH64_family */\nXXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr)\n{\n    XXH_free(statePtr);\n    return XXH_OK;\n}\n\n/*! @ingroup XXH64_family */\nXXH_PUBLIC_API void XXH64_copyState(XXH_NOESCAPE XXH64_state_t* dstState, const XXH64_state_t* srcState)\n{\n    XXH_memcpy(dstState, srcState, sizeof(*dstState));\n}\n\n/*! @ingroup XXH64_family */\nXXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH_NOESCAPE XXH64_state_t* statePtr, XXH64_hash_t seed)\n{\n    XXH_ASSERT(statePtr != NULL);\n    memset(statePtr, 0, sizeof(*statePtr));\n    statePtr->v[0] = seed + XXH_PRIME64_1 + XXH_PRIME64_2;\n    statePtr->v[1] = seed + XXH_PRIME64_2;\n    statePtr->v[2] = seed + 0;\n    statePtr->v[3] = seed - XXH_PRIME64_1;\n    return XXH_OK;\n}\n\n/*! @ingroup XXH64_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH64_update (XXH_NOESCAPE XXH64_state_t* state, XXH_NOESCAPE const void* input, size_t len)\n{\n    if (input==NULL) {\n        XXH_ASSERT(len == 0);\n        return XXH_OK;\n    }\n\n    {   const xxh_u8* p = (const xxh_u8*)input;\n        const xxh_u8* const bEnd = p + len;\n\n        state->total_len += len;\n\n        if (state->memsize + len < 32) {  /* fill in tmp buffer */\n            XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, len);\n            state->memsize += (xxh_u32)len;\n            return XXH_OK;\n        }\n\n        if (state->memsize) {   /* tmp buffer is full */\n            XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, 32-state->memsize);\n            state->v[0] = XXH64_round(state->v[0], XXH_readLE64(state->mem64+0));\n            state->v[1] = XXH64_round(state->v[1], XXH_readLE64(state->mem64+1));\n            state->v[2] = XXH64_round(state->v[2], XXH_readLE64(state->mem64+2));\n            state->v[3] = XXH64_round(state->v[3], XXH_readLE64(state->mem64+3));\n            p += 32 - state->memsize;\n            state->memsize = 0;\n        }\n\n        if (p+32 <= bEnd) {\n            const xxh_u8* const limit = bEnd - 32;\n\n            do {\n                state->v[0] = XXH64_round(state->v[0], XXH_readLE64(p)); p+=8;\n                state->v[1] = XXH64_round(state->v[1], XXH_readLE64(p)); p+=8;\n                state->v[2] = XXH64_round(state->v[2], XXH_readLE64(p)); p+=8;\n                state->v[3] = XXH64_round(state->v[3], XXH_readLE64(p)); p+=8;\n            } while (p<=limit);\n\n        }\n\n        if (p < bEnd) {\n            XXH_memcpy(state->mem64, p, (size_t)(bEnd-p));\n            state->memsize = (unsigned)(bEnd-p);\n        }\n    }\n\n    return XXH_OK;\n}\n\n\n/*! @ingroup XXH64_family */\nXXH_PUBLIC_API XXH64_hash_t XXH64_digest(XXH_NOESCAPE const XXH64_state_t* state)\n{\n    xxh_u64 h64;\n\n    if (state->total_len >= 32) {\n        h64 = XXH_rotl64(state->v[0], 1) + XXH_rotl64(state->v[1], 7) + XXH_rotl64(state->v[2], 12) + XXH_rotl64(state->v[3], 18);\n        h64 = XXH64_mergeRound(h64, state->v[0]);\n        h64 = XXH64_mergeRound(h64, state->v[1]);\n        h64 = XXH64_mergeRound(h64, state->v[2]);\n        h64 = XXH64_mergeRound(h64, state->v[3]);\n    } else {\n        h64  = state->v[2] /*seed*/ + XXH_PRIME64_5;\n    }\n\n    h64 += (xxh_u64) state->total_len;\n\n    return XXH64_finalize(h64, (const xxh_u8*)state->mem64, (size_t)state->total_len, XXH_aligned);\n}\n#endif /* !XXH_NO_STREAM */\n\n/******* Canonical representation   *******/\n\n/*! @ingroup XXH64_family */\nXXH_PUBLIC_API void XXH64_canonicalFromHash(XXH_NOESCAPE XXH64_canonical_t* dst, XXH64_hash_t hash)\n{\n    XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t));\n    if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap64(hash);\n    XXH_memcpy(dst, &hash, sizeof(*dst));\n}\n\n/*! @ingroup XXH64_family */\nXXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const XXH64_canonical_t* src)\n{\n    return XXH_readBE64(src);\n}\n\n#ifndef XXH_NO_XXH3\n\n/* *********************************************************************\n*  XXH3\n*  New generation hash designed for speed on small keys and vectorization\n************************************************************************ */\n/*!\n * @}\n * @defgroup XXH3_impl XXH3 implementation\n * @ingroup impl\n * @{\n */\n\n/* ===   Compiler specifics   === */\n\n#if ((defined(sun) || defined(__sun)) && __cplusplus) /* Solaris includes __STDC_VERSION__ with C++. Tested with GCC 5.5 */\n#  define XXH_RESTRICT   /* disable */\n#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L   /* >= C99 */\n#  define XXH_RESTRICT   restrict\n#elif (defined (__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) \\\n   || (defined (__clang__)) \\\n   || (defined (_MSC_VER) && (_MSC_VER >= 1400)) \\\n   || (defined (__INTEL_COMPILER) && (__INTEL_COMPILER >= 1300))\n/*\n * There are a LOT more compilers that recognize __restrict but this\n * covers the major ones.\n */\n#  define XXH_RESTRICT   __restrict\n#else\n#  define XXH_RESTRICT   /* disable */\n#endif\n\n#if (defined(__GNUC__) && (__GNUC__ >= 3))  \\\n  || (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 800)) \\\n  || defined(__clang__)\n#    define XXH_likely(x) __builtin_expect(x, 1)\n#    define XXH_unlikely(x) __builtin_expect(x, 0)\n#else\n#    define XXH_likely(x) (x)\n#    define XXH_unlikely(x) (x)\n#endif\n\n#ifndef XXH_HAS_INCLUDE\n#  ifdef __has_include\n/*\n * Not defined as XXH_HAS_INCLUDE(x) (function-like) because\n * this causes segfaults in Apple Clang 4.2 (on Mac OS X 10.7 Lion)\n */\n#    define XXH_HAS_INCLUDE __has_include\n#  else\n#    define XXH_HAS_INCLUDE(x) 0\n#  endif\n#endif\n\n#if defined(__GNUC__) || defined(__clang__)\n#  if defined(__ARM_FEATURE_SVE)\n#    include <arm_sve.h>\n#  endif\n#  if defined(__ARM_NEON__) || defined(__ARM_NEON) \\\n   || (defined(_M_ARM) && _M_ARM >= 7) \\\n   || defined(_M_ARM64) || defined(_M_ARM64EC) \\\n   || (defined(__wasm_simd128__) && XXH_HAS_INCLUDE(<arm_neon.h>)) /* WASM SIMD128 via SIMDe */\n#    define inline __inline__  /* circumvent a clang bug */\n#    include <arm_neon.h>\n#    undef inline\n#  elif defined(__AVX2__)\n#    include <immintrin.h>\n#  elif defined(__SSE2__)\n#    include <emmintrin.h>\n#  endif\n#endif\n\n#if defined(_MSC_VER)\n#  include <intrin.h>\n#endif\n\n/*\n * One goal of XXH3 is to make it fast on both 32-bit and 64-bit, while\n * remaining a true 64-bit/128-bit hash function.\n *\n * This is done by prioritizing a subset of 64-bit operations that can be\n * emulated without too many steps on the average 32-bit machine.\n *\n * For example, these two lines seem similar, and run equally fast on 64-bit:\n *\n *   xxh_u64 x;\n *   x ^= (x >> 47); // good\n *   x ^= (x >> 13); // bad\n *\n * However, to a 32-bit machine, there is a major difference.\n *\n * x ^= (x >> 47) looks like this:\n *\n *   x.lo ^= (x.hi >> (47 - 32));\n *\n * while x ^= (x >> 13) looks like this:\n *\n *   // note: funnel shifts are not usually cheap.\n *   x.lo ^= (x.lo >> 13) | (x.hi << (32 - 13));\n *   x.hi ^= (x.hi >> 13);\n *\n * The first one is significantly faster than the second, simply because the\n * shift is larger than 32. This means:\n *  - All the bits we need are in the upper 32 bits, so we can ignore the lower\n *    32 bits in the shift.\n *  - The shift result will always fit in the lower 32 bits, and therefore,\n *    we can ignore the upper 32 bits in the xor.\n *\n * Thanks to this optimization, XXH3 only requires these features to be efficient:\n *\n *  - Usable unaligned access\n *  - A 32-bit or 64-bit ALU\n *      - If 32-bit, a decent ADC instruction\n *  - A 32 or 64-bit multiply with a 64-bit result\n *  - For the 128-bit variant, a decent byteswap helps short inputs.\n *\n * The first two are already required by XXH32, and almost all 32-bit and 64-bit\n * platforms which can run XXH32 can run XXH3 efficiently.\n *\n * Thumb-1, the classic 16-bit only subset of ARM's instruction set, is one\n * notable exception.\n *\n * First of all, Thumb-1 lacks support for the UMULL instruction which\n * performs the important long multiply. This means numerous __aeabi_lmul\n * calls.\n *\n * Second of all, the 8 functional registers are just not enough.\n * Setup for __aeabi_lmul, byteshift loads, pointers, and all arithmetic need\n * Lo registers, and this shuffling results in thousands more MOVs than A32.\n *\n * A32 and T32 don't have this limitation. They can access all 14 registers,\n * do a 32->64 multiply with UMULL, and the flexible operand allowing free\n * shifts is helpful, too.\n *\n * Therefore, we do a quick sanity check.\n *\n * If compiling Thumb-1 for a target which supports ARM instructions, we will\n * emit a warning, as it is not a \"sane\" platform to compile for.\n *\n * Usually, if this happens, it is because of an accident and you probably need\n * to specify -march, as you likely meant to compile for a newer architecture.\n *\n * Credit: large sections of the vectorial and asm source code paths\n *         have been contributed by @easyaspi314\n */\n#if defined(__thumb__) && !defined(__thumb2__) && defined(__ARM_ARCH_ISA_ARM)\n#   warning \"XXH3 is highly inefficient without ARM or Thumb-2.\"\n#endif\n\n/* ==========================================\n * Vectorization detection\n * ========================================== */\n\n#ifdef XXH_DOXYGEN\n/*!\n * @ingroup tuning\n * @brief Overrides the vectorization implementation chosen for XXH3.\n *\n * Can be defined to 0 to disable SIMD or any of the values mentioned in\n * @ref XXH_VECTOR_TYPE.\n *\n * If this is not defined, it uses predefined macros to determine the best\n * implementation.\n */\n#  define XXH_VECTOR XXH_SCALAR\n/*!\n * @ingroup tuning\n * @brief Possible values for @ref XXH_VECTOR.\n *\n * Note that these are actually implemented as macros.\n *\n * If this is not defined, it is detected automatically.\n * internal macro XXH_X86DISPATCH overrides this.\n */\nenum XXH_VECTOR_TYPE /* fake enum */ {\n    XXH_SCALAR = 0,  /*!< Portable scalar version */\n    XXH_SSE2   = 1,  /*!<\n                      * SSE2 for Pentium 4, Opteron, all x86_64.\n                      *\n                      * @note SSE2 is also guaranteed on Windows 10, macOS, and\n                      * Android x86.\n                      */\n    XXH_AVX2   = 2,  /*!< AVX2 for Haswell and Bulldozer */\n    XXH_AVX512 = 3,  /*!< AVX512 for Skylake and Icelake */\n    XXH_NEON   = 4,  /*!<\n                       * NEON for most ARMv7-A, all AArch64, and WASM SIMD128\n                       * via the SIMDeverywhere polyfill provided with the\n                       * Emscripten SDK.\n                       */\n    XXH_VSX    = 5,  /*!< VSX and ZVector for POWER8/z13 (64-bit) */\n    XXH_SVE    = 6,  /*!< SVE for some ARMv8-A and ARMv9-A */\n};\n/*!\n * @ingroup tuning\n * @brief Selects the minimum alignment for XXH3's accumulators.\n *\n * When using SIMD, this should match the alignment required for said vector\n * type, so, for example, 32 for AVX2.\n *\n * Default: Auto detected.\n */\n#  define XXH_ACC_ALIGN 8\n#endif\n\n/* Actual definition */\n#ifndef XXH_DOXYGEN\n#  define XXH_SCALAR 0\n#  define XXH_SSE2   1\n#  define XXH_AVX2   2\n#  define XXH_AVX512 3\n#  define XXH_NEON   4\n#  define XXH_VSX    5\n#  define XXH_SVE    6\n#endif\n\n#ifndef XXH_VECTOR    /* can be defined on command line */\n#  if defined(__ARM_FEATURE_SVE)\n#    define XXH_VECTOR XXH_SVE\n#  elif ( \\\n        defined(__ARM_NEON__) || defined(__ARM_NEON) /* gcc */ \\\n     || defined(_M_ARM) || defined(_M_ARM64) || defined(_M_ARM64EC) /* msvc */ \\\n     || (defined(__wasm_simd128__) && XXH_HAS_INCLUDE(<arm_neon.h>)) /* wasm simd128 via SIMDe */ \\\n   ) && ( \\\n        defined(_WIN32) || defined(__LITTLE_ENDIAN__) /* little endian only */ \\\n    || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) \\\n   )\n#    define XXH_VECTOR XXH_NEON\n#  elif defined(__AVX512F__)\n#    define XXH_VECTOR XXH_AVX512\n#  elif defined(__AVX2__)\n#    define XXH_VECTOR XXH_AVX2\n#  elif defined(__SSE2__) || defined(_M_AMD64) || defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP == 2))\n#    define XXH_VECTOR XXH_SSE2\n#  elif (defined(__PPC64__) && defined(__POWER8_VECTOR__)) \\\n     || (defined(__s390x__) && defined(__VEC__)) \\\n     && defined(__GNUC__) /* TODO: IBM XL */\n#    define XXH_VECTOR XXH_VSX\n#  else\n#    define XXH_VECTOR XXH_SCALAR\n#  endif\n#endif\n\n/* __ARM_FEATURE_SVE is only supported by GCC & Clang. */\n#if (XXH_VECTOR == XXH_SVE) && !defined(__ARM_FEATURE_SVE)\n#  ifdef _MSC_VER\n#    pragma warning(once : 4606)\n#  else\n#    warning \"__ARM_FEATURE_SVE isn't supported. Use SCALAR instead.\"\n#  endif\n#  undef XXH_VECTOR\n#  define XXH_VECTOR XXH_SCALAR\n#endif\n\n/*\n * Controls the alignment of the accumulator,\n * for compatibility with aligned vector loads, which are usually faster.\n */\n#ifndef XXH_ACC_ALIGN\n#  if defined(XXH_X86DISPATCH)\n#     define XXH_ACC_ALIGN 64  /* for compatibility with avx512 */\n#  elif XXH_VECTOR == XXH_SCALAR  /* scalar */\n#     define XXH_ACC_ALIGN 8\n#  elif XXH_VECTOR == XXH_SSE2  /* sse2 */\n#     define XXH_ACC_ALIGN 16\n#  elif XXH_VECTOR == XXH_AVX2  /* avx2 */\n#     define XXH_ACC_ALIGN 32\n#  elif XXH_VECTOR == XXH_NEON  /* neon */\n#     define XXH_ACC_ALIGN 16\n#  elif XXH_VECTOR == XXH_VSX   /* vsx */\n#     define XXH_ACC_ALIGN 16\n#  elif XXH_VECTOR == XXH_AVX512  /* avx512 */\n#     define XXH_ACC_ALIGN 64\n#  elif XXH_VECTOR == XXH_SVE   /* sve */\n#     define XXH_ACC_ALIGN 64\n#  endif\n#endif\n\n#if defined(XXH_X86DISPATCH) || XXH_VECTOR == XXH_SSE2 \\\n    || XXH_VECTOR == XXH_AVX2 || XXH_VECTOR == XXH_AVX512\n#  define XXH_SEC_ALIGN XXH_ACC_ALIGN\n#elif XXH_VECTOR == XXH_SVE\n#  define XXH_SEC_ALIGN XXH_ACC_ALIGN\n#else\n#  define XXH_SEC_ALIGN 8\n#endif\n\n#if defined(__GNUC__) || defined(__clang__)\n#  define XXH_ALIASING __attribute__((may_alias))\n#else\n#  define XXH_ALIASING /* nothing */\n#endif\n\n/*\n * UGLY HACK:\n * GCC usually generates the best code with -O3 for xxHash.\n *\n * However, when targeting AVX2, it is overzealous in its unrolling resulting\n * in code roughly 3/4 the speed of Clang.\n *\n * There are other issues, such as GCC splitting _mm256_loadu_si256 into\n * _mm_loadu_si128 + _mm256_inserti128_si256. This is an optimization which\n * only applies to Sandy and Ivy Bridge... which don't even support AVX2.\n *\n * That is why when compiling the AVX2 version, it is recommended to use either\n *   -O2 -mavx2 -march=haswell\n * or\n *   -O2 -mavx2 -mno-avx256-split-unaligned-load\n * for decent performance, or to use Clang instead.\n *\n * Fortunately, we can control the first one with a pragma that forces GCC into\n * -O2, but the other one we can't control without \"failed to inline always\n * inline function due to target mismatch\" warnings.\n */\n#if XXH_VECTOR == XXH_AVX2 /* AVX2 */ \\\n  && defined(__GNUC__) && !defined(__clang__) /* GCC, not Clang */ \\\n  && defined(__OPTIMIZE__) && XXH_SIZE_OPT <= 0 /* respect -O0 and -Os */\n#  pragma GCC push_options\n#  pragma GCC optimize(\"-O2\")\n#endif\n\n#if XXH_VECTOR == XXH_NEON\n\n/*\n * UGLY HACK: While AArch64 GCC on Linux does not seem to care, on macOS, GCC -O3\n * optimizes out the entire hashLong loop because of the aliasing violation.\n *\n * However, GCC is also inefficient at load-store optimization with vld1q/vst1q,\n * so the only option is to mark it as aliasing.\n */\ntypedef uint64x2_t xxh_aliasing_uint64x2_t XXH_ALIASING;\n\n/*!\n * @internal\n * @brief `vld1q_u64` but faster and alignment-safe.\n *\n * On AArch64, unaligned access is always safe, but on ARMv7-a, it is only\n * *conditionally* safe (`vld1` has an alignment bit like `movdq[ua]` in x86).\n *\n * GCC for AArch64 sees `vld1q_u8` as an intrinsic instead of a load, so it\n * prohibits load-store optimizations. Therefore, a direct dereference is used.\n *\n * Otherwise, `vld1q_u8` is used with `vreinterpretq_u8_u64` to do a safe\n * unaligned load.\n */\n#if defined(__aarch64__) && defined(__GNUC__) && !defined(__clang__)\nXXH_FORCE_INLINE uint64x2_t XXH_vld1q_u64(void const* ptr) /* silence -Wcast-align */\n{\n    return *(xxh_aliasing_uint64x2_t const *)ptr;\n}\n#else\nXXH_FORCE_INLINE uint64x2_t XXH_vld1q_u64(void const* ptr)\n{\n    return vreinterpretq_u64_u8(vld1q_u8((uint8_t const*)ptr));\n}\n#endif\n\n/*!\n * @internal\n * @brief `vmlal_u32` on low and high halves of a vector.\n *\n * This is a workaround for AArch64 GCC < 11 which implemented arm_neon.h with\n * inline assembly and were therefore incapable of merging the `vget_{low, high}_u32`\n * with `vmlal_u32`.\n */\n#if defined(__aarch64__) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 11\nXXH_FORCE_INLINE uint64x2_t\nXXH_vmlal_low_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs)\n{\n    /* Inline assembly is the only way */\n    __asm__(\"umlal   %0.2d, %1.2s, %2.2s\" : \"+w\" (acc) : \"w\" (lhs), \"w\" (rhs));\n    return acc;\n}\nXXH_FORCE_INLINE uint64x2_t\nXXH_vmlal_high_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs)\n{\n    /* This intrinsic works as expected */\n    return vmlal_high_u32(acc, lhs, rhs);\n}\n#else\n/* Portable intrinsic versions */\nXXH_FORCE_INLINE uint64x2_t\nXXH_vmlal_low_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs)\n{\n    return vmlal_u32(acc, vget_low_u32(lhs), vget_low_u32(rhs));\n}\n/*! @copydoc XXH_vmlal_low_u32\n * Assume the compiler converts this to vmlal_high_u32 on aarch64 */\nXXH_FORCE_INLINE uint64x2_t\nXXH_vmlal_high_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs)\n{\n    return vmlal_u32(acc, vget_high_u32(lhs), vget_high_u32(rhs));\n}\n#endif\n\n/*!\n * @ingroup tuning\n * @brief Controls the NEON to scalar ratio for XXH3\n *\n * This can be set to 2, 4, 6, or 8.\n *\n * ARM Cortex CPUs are _very_ sensitive to how their pipelines are used.\n *\n * For example, the Cortex-A73 can dispatch 3 micro-ops per cycle, but only 2 of those\n * can be NEON. If you are only using NEON instructions, you are only using 2/3 of the CPU\n * bandwidth.\n *\n * This is even more noticeable on the more advanced cores like the Cortex-A76 which\n * can dispatch 8 micro-ops per cycle, but still only 2 NEON micro-ops at once.\n *\n * Therefore, to make the most out of the pipeline, it is beneficial to run 6 NEON lanes\n * and 2 scalar lanes, which is chosen by default.\n *\n * This does not apply to Apple processors or 32-bit processors, which run better with\n * full NEON. These will default to 8. Additionally, size-optimized builds run 8 lanes.\n *\n * This change benefits CPUs with large micro-op buffers without negatively affecting\n * most other CPUs:\n *\n *  | Chipset               | Dispatch type       | NEON only | 6:2 hybrid | Diff. |\n *  |:----------------------|:--------------------|----------:|-----------:|------:|\n *  | Snapdragon 730 (A76)  | 2 NEON/8 micro-ops  |  8.8 GB/s |  10.1 GB/s |  ~16% |\n *  | Snapdragon 835 (A73)  | 2 NEON/3 micro-ops  |  5.1 GB/s |   5.3 GB/s |   ~5% |\n *  | Marvell PXA1928 (A53) | In-order dual-issue |  1.9 GB/s |   1.9 GB/s |    0% |\n *  | Apple M1              | 4 NEON/8 micro-ops  | 37.3 GB/s |  36.1 GB/s |  ~-3% |\n *\n * It also seems to fix some bad codegen on GCC, making it almost as fast as clang.\n *\n * When using WASM SIMD128, if this is 2 or 6, SIMDe will scalarize 2 of the lanes meaning\n * it effectively becomes worse 4.\n *\n * @see XXH3_accumulate_512_neon()\n */\n# ifndef XXH3_NEON_LANES\n#  if (defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) || defined(_M_ARM64EC)) \\\n   && !defined(__APPLE__) && XXH_SIZE_OPT <= 0\n#   define XXH3_NEON_LANES 6\n#  else\n#   define XXH3_NEON_LANES XXH_ACC_NB\n#  endif\n# endif\n#endif  /* XXH_VECTOR == XXH_NEON */\n\n/*\n * VSX and Z Vector helpers.\n *\n * This is very messy, and any pull requests to clean this up are welcome.\n *\n * There are a lot of problems with supporting VSX and s390x, due to\n * inconsistent intrinsics, spotty coverage, and multiple endiannesses.\n */\n#if XXH_VECTOR == XXH_VSX\n/* Annoyingly, these headers _may_ define three macros: `bool`, `vector`,\n * and `pixel`. This is a problem for obvious reasons.\n *\n * These keywords are unnecessary; the spec literally says they are\n * equivalent to `__bool`, `__vector`, and `__pixel` and may be undef'd\n * after including the header.\n *\n * We use pragma push_macro/pop_macro to keep the namespace clean. */\n#  pragma push_macro(\"bool\")\n#  pragma push_macro(\"vector\")\n#  pragma push_macro(\"pixel\")\n/* silence potential macro redefined warnings */\n#  undef bool\n#  undef vector\n#  undef pixel\n\n#  if defined(__s390x__)\n#    include <s390intrin.h>\n#  else\n#    include <altivec.h>\n#  endif\n\n/* Restore the original macro values, if applicable. */\n#  pragma pop_macro(\"pixel\")\n#  pragma pop_macro(\"vector\")\n#  pragma pop_macro(\"bool\")\n\ntypedef __vector unsigned long long xxh_u64x2;\ntypedef __vector unsigned char xxh_u8x16;\ntypedef __vector unsigned xxh_u32x4;\n\n/*\n * UGLY HACK: Similar to aarch64 macOS GCC, s390x GCC has the same aliasing issue.\n */\ntypedef xxh_u64x2 xxh_aliasing_u64x2 XXH_ALIASING;\n\n# ifndef XXH_VSX_BE\n#  if defined(__BIG_ENDIAN__) \\\n  || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)\n#    define XXH_VSX_BE 1\n#  elif defined(__VEC_ELEMENT_REG_ORDER__) && __VEC_ELEMENT_REG_ORDER__ == __ORDER_BIG_ENDIAN__\n#    warning \"-maltivec=be is not recommended. Please use native endianness.\"\n#    define XXH_VSX_BE 1\n#  else\n#    define XXH_VSX_BE 0\n#  endif\n# endif /* !defined(XXH_VSX_BE) */\n\n# if XXH_VSX_BE\n#  if defined(__POWER9_VECTOR__) || (defined(__clang__) && defined(__s390x__))\n#    define XXH_vec_revb vec_revb\n#  else\n/*!\n * A polyfill for POWER9's vec_revb().\n */\nXXH_FORCE_INLINE xxh_u64x2 XXH_vec_revb(xxh_u64x2 val)\n{\n    xxh_u8x16 const vByteSwap = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00,\n                                  0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08 };\n    return vec_perm(val, val, vByteSwap);\n}\n#  endif\n# endif /* XXH_VSX_BE */\n\n/*!\n * Performs an unaligned vector load and byte swaps it on big endian.\n */\nXXH_FORCE_INLINE xxh_u64x2 XXH_vec_loadu(const void *ptr)\n{\n    xxh_u64x2 ret;\n    XXH_memcpy(&ret, ptr, sizeof(xxh_u64x2));\n# if XXH_VSX_BE\n    ret = XXH_vec_revb(ret);\n# endif\n    return ret;\n}\n\n/*\n * vec_mulo and vec_mule are very problematic intrinsics on PowerPC\n *\n * These intrinsics weren't added until GCC 8, despite existing for a while,\n * and they are endian dependent. Also, their meaning swap depending on version.\n * */\n# if defined(__s390x__)\n /* s390x is always big endian, no issue on this platform */\n#  define XXH_vec_mulo vec_mulo\n#  define XXH_vec_mule vec_mule\n# elif defined(__clang__) && XXH_HAS_BUILTIN(__builtin_altivec_vmuleuw) && !defined(__ibmxl__)\n/* Clang has a better way to control this, we can just use the builtin which doesn't swap. */\n /* The IBM XL Compiler (which defined __clang__) only implements the vec_* operations */\n#  define XXH_vec_mulo __builtin_altivec_vmulouw\n#  define XXH_vec_mule __builtin_altivec_vmuleuw\n# else\n/* gcc needs inline assembly */\n/* Adapted from https://github.com/google/highwayhash/blob/master/highwayhash/hh_vsx.h. */\nXXH_FORCE_INLINE xxh_u64x2 XXH_vec_mulo(xxh_u32x4 a, xxh_u32x4 b)\n{\n    xxh_u64x2 result;\n    __asm__(\"vmulouw %0, %1, %2\" : \"=v\" (result) : \"v\" (a), \"v\" (b));\n    return result;\n}\nXXH_FORCE_INLINE xxh_u64x2 XXH_vec_mule(xxh_u32x4 a, xxh_u32x4 b)\n{\n    xxh_u64x2 result;\n    __asm__(\"vmuleuw %0, %1, %2\" : \"=v\" (result) : \"v\" (a), \"v\" (b));\n    return result;\n}\n# endif /* XXH_vec_mulo, XXH_vec_mule */\n#endif /* XXH_VECTOR == XXH_VSX */\n\n#if XXH_VECTOR == XXH_SVE\n#define ACCRND(acc, offset) \\\ndo { \\\n    svuint64_t input_vec = svld1_u64(mask, xinput + offset);         \\\n    svuint64_t secret_vec = svld1_u64(mask, xsecret + offset);       \\\n    svuint64_t mixed = sveor_u64_x(mask, secret_vec, input_vec);     \\\n    svuint64_t swapped = svtbl_u64(input_vec, kSwap);                \\\n    svuint64_t mixed_lo = svextw_u64_x(mask, mixed);                 \\\n    svuint64_t mixed_hi = svlsr_n_u64_x(mask, mixed, 32);            \\\n    svuint64_t mul = svmad_u64_x(mask, mixed_lo, mixed_hi, swapped); \\\n    acc = svadd_u64_x(mask, acc, mul);                               \\\n} while (0)\n#endif /* XXH_VECTOR == XXH_SVE */\n\n/* prefetch\n * can be disabled, by declaring XXH_NO_PREFETCH build macro */\n#if defined(XXH_NO_PREFETCH)\n#  define XXH_PREFETCH(ptr)  (void)(ptr)  /* disabled */\n#else\n#  if XXH_SIZE_OPT >= 1\n#    define XXH_PREFETCH(ptr) (void)(ptr)\n#  elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86))  /* _mm_prefetch() not defined outside of x86/x64 */\n#    include <mmintrin.h>   /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */\n#    define XXH_PREFETCH(ptr)  _mm_prefetch((const char*)(ptr), _MM_HINT_T0)\n#  elif defined(__GNUC__) && ( (__GNUC__ >= 4) || ( (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1) ) )\n#    define XXH_PREFETCH(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)\n#  else\n#    define XXH_PREFETCH(ptr) (void)(ptr)  /* disabled */\n#  endif\n#endif  /* XXH_NO_PREFETCH */\n\n\n/* ==========================================\n * XXH3 default settings\n * ========================================== */\n\n#define XXH_SECRET_DEFAULT_SIZE 192   /* minimum XXH3_SECRET_SIZE_MIN */\n\n#if (XXH_SECRET_DEFAULT_SIZE < XXH3_SECRET_SIZE_MIN)\n#  error \"default keyset is not large enough\"\n#endif\n\n/*! Pseudorandom secret taken directly from FARSH. */\nXXH_ALIGN(64) static const xxh_u8 XXH3_kSecret[XXH_SECRET_DEFAULT_SIZE] = {\n    0xb8, 0xfe, 0x6c, 0x39, 0x23, 0xa4, 0x4b, 0xbe, 0x7c, 0x01, 0x81, 0x2c, 0xf7, 0x21, 0xad, 0x1c,\n    0xde, 0xd4, 0x6d, 0xe9, 0x83, 0x90, 0x97, 0xdb, 0x72, 0x40, 0xa4, 0xa4, 0xb7, 0xb3, 0x67, 0x1f,\n    0xcb, 0x79, 0xe6, 0x4e, 0xcc, 0xc0, 0xe5, 0x78, 0x82, 0x5a, 0xd0, 0x7d, 0xcc, 0xff, 0x72, 0x21,\n    0xb8, 0x08, 0x46, 0x74, 0xf7, 0x43, 0x24, 0x8e, 0xe0, 0x35, 0x90, 0xe6, 0x81, 0x3a, 0x26, 0x4c,\n    0x3c, 0x28, 0x52, 0xbb, 0x91, 0xc3, 0x00, 0xcb, 0x88, 0xd0, 0x65, 0x8b, 0x1b, 0x53, 0x2e, 0xa3,\n    0x71, 0x64, 0x48, 0x97, 0xa2, 0x0d, 0xf9, 0x4e, 0x38, 0x19, 0xef, 0x46, 0xa9, 0xde, 0xac, 0xd8,\n    0xa8, 0xfa, 0x76, 0x3f, 0xe3, 0x9c, 0x34, 0x3f, 0xf9, 0xdc, 0xbb, 0xc7, 0xc7, 0x0b, 0x4f, 0x1d,\n    0x8a, 0x51, 0xe0, 0x4b, 0xcd, 0xb4, 0x59, 0x31, 0xc8, 0x9f, 0x7e, 0xc9, 0xd9, 0x78, 0x73, 0x64,\n    0xea, 0xc5, 0xac, 0x83, 0x34, 0xd3, 0xeb, 0xc3, 0xc5, 0x81, 0xa0, 0xff, 0xfa, 0x13, 0x63, 0xeb,\n    0x17, 0x0d, 0xdd, 0x51, 0xb7, 0xf0, 0xda, 0x49, 0xd3, 0x16, 0x55, 0x26, 0x29, 0xd4, 0x68, 0x9e,\n    0x2b, 0x16, 0xbe, 0x58, 0x7d, 0x47, 0xa1, 0xfc, 0x8f, 0xf8, 0xb8, 0xd1, 0x7a, 0xd0, 0x31, 0xce,\n    0x45, 0xcb, 0x3a, 0x8f, 0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b, 0x40, 0x7e,\n};\n\nstatic const xxh_u64 PRIME_MX1 = 0x165667919E3779F9ULL;  /*!< 0b0001011001010110011001111001000110011110001101110111100111111001 */\nstatic const xxh_u64 PRIME_MX2 = 0x9FB21C651E98DF25ULL;  /*!< 0b1001111110110010000111000110010100011110100110001101111100100101 */\n\n#ifdef XXH_OLD_NAMES\n#  define kSecret XXH3_kSecret\n#endif\n\n#ifdef XXH_DOXYGEN\n/*!\n * @brief Calculates a 32-bit to 64-bit long multiply.\n *\n * Implemented as a macro.\n *\n * Wraps `__emulu` on MSVC x86 because it tends to call `__allmul` when it doesn't\n * need to (but it shouldn't need to anyways, it is about 7 instructions to do\n * a 64x64 multiply...). Since we know that this will _always_ emit `MULL`, we\n * use that instead of the normal method.\n *\n * If you are compiling for platforms like Thumb-1 and don't have a better option,\n * you may also want to write your own long multiply routine here.\n *\n * @param x, y Numbers to be multiplied\n * @return 64-bit product of the low 32 bits of @p x and @p y.\n */\nXXH_FORCE_INLINE xxh_u64\nXXH_mult32to64(xxh_u64 x, xxh_u64 y)\n{\n   return (x & 0xFFFFFFFF) * (y & 0xFFFFFFFF);\n}\n#elif defined(_MSC_VER) && defined(_M_IX86)\n#    define XXH_mult32to64(x, y) __emulu((unsigned)(x), (unsigned)(y))\n#else\n/*\n * Downcast + upcast is usually better than masking on older compilers like\n * GCC 4.2 (especially 32-bit ones), all without affecting newer compilers.\n *\n * The other method, (x & 0xFFFFFFFF) * (y & 0xFFFFFFFF), will AND both operands\n * and perform a full 64x64 multiply -- entirely redundant on 32-bit.\n */\n#    define XXH_mult32to64(x, y) ((xxh_u64)(xxh_u32)(x) * (xxh_u64)(xxh_u32)(y))\n#endif\n\n/*!\n * @brief Calculates a 64->128-bit long multiply.\n *\n * Uses `__uint128_t` and `_umul128` if available, otherwise uses a scalar\n * version.\n *\n * @param lhs , rhs The 64-bit integers to be multiplied\n * @return The 128-bit result represented in an @ref XXH128_hash_t.\n */\nstatic XXH128_hash_t\nXXH_mult64to128(xxh_u64 lhs, xxh_u64 rhs)\n{\n    /*\n     * GCC/Clang __uint128_t method.\n     *\n     * On most 64-bit targets, GCC and Clang define a __uint128_t type.\n     * This is usually the best way as it usually uses a native long 64-bit\n     * multiply, such as MULQ on x86_64 or MUL + UMULH on aarch64.\n     *\n     * Usually.\n     *\n     * Despite being a 32-bit platform, Clang (and emscripten) define this type\n     * despite not having the arithmetic for it. This results in a laggy\n     * compiler builtin call which calculates a full 128-bit multiply.\n     * In that case it is best to use the portable one.\n     * https://github.com/Cyan4973/xxHash/issues/211#issuecomment-515575677\n     */\n#if (defined(__GNUC__) || defined(__clang__)) && !defined(__wasm__) \\\n    && defined(__SIZEOF_INT128__) \\\n    || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 128)\n\n    __uint128_t const product = (__uint128_t)lhs * (__uint128_t)rhs;\n    XXH128_hash_t r128;\n    r128.low64  = (xxh_u64)(product);\n    r128.high64 = (xxh_u64)(product >> 64);\n    return r128;\n\n    /*\n     * MSVC for x64's _umul128 method.\n     *\n     * xxh_u64 _umul128(xxh_u64 Multiplier, xxh_u64 Multiplicand, xxh_u64 *HighProduct);\n     *\n     * This compiles to single operand MUL on x64.\n     */\n#elif (defined(_M_X64) || defined(_M_IA64)) && !defined(_M_ARM64EC)\n\n#ifndef _MSC_VER\n#   pragma intrinsic(_umul128)\n#endif\n    xxh_u64 product_high;\n    xxh_u64 const product_low = _umul128(lhs, rhs, &product_high);\n    XXH128_hash_t r128;\n    r128.low64  = product_low;\n    r128.high64 = product_high;\n    return r128;\n\n    /*\n     * MSVC for ARM64's __umulh method.\n     *\n     * This compiles to the same MUL + UMULH as GCC/Clang's __uint128_t method.\n     */\n#elif defined(_M_ARM64) || defined(_M_ARM64EC)\n\n#ifndef _MSC_VER\n#   pragma intrinsic(__umulh)\n#endif\n    XXH128_hash_t r128;\n    r128.low64  = lhs * rhs;\n    r128.high64 = __umulh(lhs, rhs);\n    return r128;\n\n#else\n    /*\n     * Portable scalar method. Optimized for 32-bit and 64-bit ALUs.\n     *\n     * This is a fast and simple grade school multiply, which is shown below\n     * with base 10 arithmetic instead of base 0x100000000.\n     *\n     *           9 3 // D2 lhs = 93\n     *         x 7 5 // D2 rhs = 75\n     *     ----------\n     *           1 5 // D2 lo_lo = (93 % 10) * (75 % 10) = 15\n     *         4 5 | // D2 hi_lo = (93 / 10) * (75 % 10) = 45\n     *         2 1 | // D2 lo_hi = (93 % 10) * (75 / 10) = 21\n     *     + 6 3 | | // D2 hi_hi = (93 / 10) * (75 / 10) = 63\n     *     ---------\n     *         2 7 | // D2 cross = (15 / 10) + (45 % 10) + 21 = 27\n     *     + 6 7 | | // D2 upper = (27 / 10) + (45 / 10) + 63 = 67\n     *     ---------\n     *       6 9 7 5 // D4 res = (27 * 10) + (15 % 10) + (67 * 100) = 6975\n     *\n     * The reasons for adding the products like this are:\n     *  1. It avoids manual carry tracking. Just like how\n     *     (9 * 9) + 9 + 9 = 99, the same applies with this for UINT64_MAX.\n     *     This avoids a lot of complexity.\n     *\n     *  2. It hints for, and on Clang, compiles to, the powerful UMAAL\n     *     instruction available in ARM's Digital Signal Processing extension\n     *     in 32-bit ARMv6 and later, which is shown below:\n     *\n     *         void UMAAL(xxh_u32 *RdLo, xxh_u32 *RdHi, xxh_u32 Rn, xxh_u32 Rm)\n     *         {\n     *             xxh_u64 product = (xxh_u64)*RdLo * (xxh_u64)*RdHi + Rn + Rm;\n     *             *RdLo = (xxh_u32)(product & 0xFFFFFFFF);\n     *             *RdHi = (xxh_u32)(product >> 32);\n     *         }\n     *\n     *     This instruction was designed for efficient long multiplication, and\n     *     allows this to be calculated in only 4 instructions at speeds\n     *     comparable to some 64-bit ALUs.\n     *\n     *  3. It isn't terrible on other platforms. Usually this will be a couple\n     *     of 32-bit ADD/ADCs.\n     */\n\n    /* First calculate all of the cross products. */\n    xxh_u64 const lo_lo = XXH_mult32to64(lhs & 0xFFFFFFFF, rhs & 0xFFFFFFFF);\n    xxh_u64 const hi_lo = XXH_mult32to64(lhs >> 32,        rhs & 0xFFFFFFFF);\n    xxh_u64 const lo_hi = XXH_mult32to64(lhs & 0xFFFFFFFF, rhs >> 32);\n    xxh_u64 const hi_hi = XXH_mult32to64(lhs >> 32,        rhs >> 32);\n\n    /* Now add the products together. These will never overflow. */\n    xxh_u64 const cross = (lo_lo >> 32) + (hi_lo & 0xFFFFFFFF) + lo_hi;\n    xxh_u64 const upper = (hi_lo >> 32) + (cross >> 32)        + hi_hi;\n    xxh_u64 const lower = (cross << 32) | (lo_lo & 0xFFFFFFFF);\n\n    XXH128_hash_t r128;\n    r128.low64  = lower;\n    r128.high64 = upper;\n    return r128;\n#endif\n}\n\n/*!\n * @brief Calculates a 64-bit to 128-bit multiply, then XOR folds it.\n *\n * The reason for the separate function is to prevent passing too many structs\n * around by value. This will hopefully inline the multiply, but we don't force it.\n *\n * @param lhs , rhs The 64-bit integers to multiply\n * @return The low 64 bits of the product XOR'd by the high 64 bits.\n * @see XXH_mult64to128()\n */\nstatic xxh_u64\nXXH3_mul128_fold64(xxh_u64 lhs, xxh_u64 rhs)\n{\n    XXH128_hash_t product = XXH_mult64to128(lhs, rhs);\n    return product.low64 ^ product.high64;\n}\n\n/*! Seems to produce slightly better code on GCC for some reason. */\nXXH_FORCE_INLINE XXH_CONSTF xxh_u64 XXH_xorshift64(xxh_u64 v64, int shift)\n{\n    XXH_ASSERT(0 <= shift && shift < 64);\n    return v64 ^ (v64 >> shift);\n}\n\n/*\n * This is a fast avalanche stage,\n * suitable when input bits are already partially mixed\n */\nstatic XXH64_hash_t XXH3_avalanche(xxh_u64 h64)\n{\n    h64 = XXH_xorshift64(h64, 37);\n    h64 *= PRIME_MX1;\n    h64 = XXH_xorshift64(h64, 32);\n    return h64;\n}\n\n/*\n * This is a stronger avalanche,\n * inspired by Pelle Evensen's rrmxmx\n * preferable when input has not been previously mixed\n */\nstatic XXH64_hash_t XXH3_rrmxmx(xxh_u64 h64, xxh_u64 len)\n{\n    /* this mix is inspired by Pelle Evensen's rrmxmx */\n    h64 ^= XXH_rotl64(h64, 49) ^ XXH_rotl64(h64, 24);\n    h64 *= PRIME_MX2;\n    h64 ^= (h64 >> 35) + len ;\n    h64 *= PRIME_MX2;\n    return XXH_xorshift64(h64, 28);\n}\n\n\n/* ==========================================\n * Short keys\n * ==========================================\n * One of the shortcomings of XXH32 and XXH64 was that their performance was\n * sub-optimal on short lengths. It used an iterative algorithm which strongly\n * favored lengths that were a multiple of 4 or 8.\n *\n * Instead of iterating over individual inputs, we use a set of single shot\n * functions which piece together a range of lengths and operate in constant time.\n *\n * Additionally, the number of multiplies has been significantly reduced. This\n * reduces latency, especially when emulating 64-bit multiplies on 32-bit.\n *\n * Depending on the platform, this may or may not be faster than XXH32, but it\n * is almost guaranteed to be faster than XXH64.\n */\n\n/*\n * At very short lengths, there isn't enough input to fully hide secrets, or use\n * the entire secret.\n *\n * There is also only a limited amount of mixing we can do before significantly\n * impacting performance.\n *\n * Therefore, we use different sections of the secret and always mix two secret\n * samples with an XOR. This should have no effect on performance on the\n * seedless or withSeed variants because everything _should_ be constant folded\n * by modern compilers.\n *\n * The XOR mixing hides individual parts of the secret and increases entropy.\n *\n * This adds an extra layer of strength for custom secrets.\n */\nXXH_FORCE_INLINE XXH_PUREF XXH64_hash_t\nXXH3_len_1to3_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)\n{\n    XXH_ASSERT(input != NULL);\n    XXH_ASSERT(1 <= len && len <= 3);\n    XXH_ASSERT(secret != NULL);\n    /*\n     * len = 1: combined = { input[0], 0x01, input[0], input[0] }\n     * len = 2: combined = { input[1], 0x02, input[0], input[1] }\n     * len = 3: combined = { input[2], 0x03, input[0], input[1] }\n     */\n    {   xxh_u8  const c1 = input[0];\n        xxh_u8  const c2 = input[len >> 1];\n        xxh_u8  const c3 = input[len - 1];\n        xxh_u32 const combined = ((xxh_u32)c1 << 16) | ((xxh_u32)c2  << 24)\n                               | ((xxh_u32)c3 <<  0) | ((xxh_u32)len << 8);\n        xxh_u64 const bitflip = (XXH_readLE32(secret) ^ XXH_readLE32(secret+4)) + seed;\n        xxh_u64 const keyed = (xxh_u64)combined ^ bitflip;\n        return XXH64_avalanche(keyed);\n    }\n}\n\nXXH_FORCE_INLINE XXH_PUREF XXH64_hash_t\nXXH3_len_4to8_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)\n{\n    XXH_ASSERT(input != NULL);\n    XXH_ASSERT(secret != NULL);\n    XXH_ASSERT(4 <= len && len <= 8);\n    seed ^= (xxh_u64)XXH_swap32((xxh_u32)seed) << 32;\n    {   xxh_u32 const input1 = XXH_readLE32(input);\n        xxh_u32 const input2 = XXH_readLE32(input + len - 4);\n        xxh_u64 const bitflip = (XXH_readLE64(secret+8) ^ XXH_readLE64(secret+16)) - seed;\n        xxh_u64 const input64 = input2 + (((xxh_u64)input1) << 32);\n        xxh_u64 const keyed = input64 ^ bitflip;\n        return XXH3_rrmxmx(keyed, len);\n    }\n}\n\nXXH_FORCE_INLINE XXH_PUREF XXH64_hash_t\nXXH3_len_9to16_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)\n{\n    XXH_ASSERT(input != NULL);\n    XXH_ASSERT(secret != NULL);\n    XXH_ASSERT(9 <= len && len <= 16);\n    {   xxh_u64 const bitflip1 = (XXH_readLE64(secret+24) ^ XXH_readLE64(secret+32)) + seed;\n        xxh_u64 const bitflip2 = (XXH_readLE64(secret+40) ^ XXH_readLE64(secret+48)) - seed;\n        xxh_u64 const input_lo = XXH_readLE64(input)           ^ bitflip1;\n        xxh_u64 const input_hi = XXH_readLE64(input + len - 8) ^ bitflip2;\n        xxh_u64 const acc = len\n                          + XXH_swap64(input_lo) + input_hi\n                          + XXH3_mul128_fold64(input_lo, input_hi);\n        return XXH3_avalanche(acc);\n    }\n}\n\nXXH_FORCE_INLINE XXH_PUREF XXH64_hash_t\nXXH3_len_0to16_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)\n{\n    XXH_ASSERT(len <= 16);\n    {   if (XXH_likely(len >  8)) return XXH3_len_9to16_64b(input, len, secret, seed);\n        if (XXH_likely(len >= 4)) return XXH3_len_4to8_64b(input, len, secret, seed);\n        if (len) return XXH3_len_1to3_64b(input, len, secret, seed);\n        return XXH64_avalanche(seed ^ (XXH_readLE64(secret+56) ^ XXH_readLE64(secret+64)));\n    }\n}\n\n/*\n * DISCLAIMER: There are known *seed-dependent* multicollisions here due to\n * multiplication by zero, affecting hashes of lengths 17 to 240.\n *\n * However, they are very unlikely.\n *\n * Keep this in mind when using the unseeded XXH3_64bits() variant: As with all\n * unseeded non-cryptographic hashes, it does not attempt to defend itself\n * against specially crafted inputs, only random inputs.\n *\n * Compared to classic UMAC where a 1 in 2^31 chance of 4 consecutive bytes\n * cancelling out the secret is taken an arbitrary number of times (addressed\n * in XXH3_accumulate_512), this collision is very unlikely with random inputs\n * and/or proper seeding:\n *\n * This only has a 1 in 2^63 chance of 8 consecutive bytes cancelling out, in a\n * function that is only called up to 16 times per hash with up to 240 bytes of\n * input.\n *\n * This is not too bad for a non-cryptographic hash function, especially with\n * only 64 bit outputs.\n *\n * The 128-bit variant (which trades some speed for strength) is NOT affected\n * by this, although it is always a good idea to use a proper seed if you care\n * about strength.\n */\nXXH_FORCE_INLINE xxh_u64 XXH3_mix16B(const xxh_u8* XXH_RESTRICT input,\n                                     const xxh_u8* XXH_RESTRICT secret, xxh_u64 seed64)\n{\n#if defined(__GNUC__) && !defined(__clang__) /* GCC, not Clang */ \\\n  && defined(__i386__) && defined(__SSE2__)  /* x86 + SSE2 */ \\\n  && !defined(XXH_ENABLE_AUTOVECTORIZE)      /* Define to disable like XXH32 hack */\n    /*\n     * UGLY HACK:\n     * GCC for x86 tends to autovectorize the 128-bit multiply, resulting in\n     * slower code.\n     *\n     * By forcing seed64 into a register, we disrupt the cost model and\n     * cause it to scalarize. See `XXH32_round()`\n     *\n     * FIXME: Clang's output is still _much_ faster -- On an AMD Ryzen 3600,\n     * XXH3_64bits @ len=240 runs at 4.6 GB/s with Clang 9, but 3.3 GB/s on\n     * GCC 9.2, despite both emitting scalar code.\n     *\n     * GCC generates much better scalar code than Clang for the rest of XXH3,\n     * which is why finding a more optimal codepath is an interest.\n     */\n    XXH_COMPILER_GUARD(seed64);\n#endif\n    {   xxh_u64 const input_lo = XXH_readLE64(input);\n        xxh_u64 const input_hi = XXH_readLE64(input+8);\n        return XXH3_mul128_fold64(\n            input_lo ^ (XXH_readLE64(secret)   + seed64),\n            input_hi ^ (XXH_readLE64(secret+8) - seed64)\n        );\n    }\n}\n\n/* For mid range keys, XXH3 uses a Mum-hash variant. */\nXXH_FORCE_INLINE XXH_PUREF XXH64_hash_t\nXXH3_len_17to128_64b(const xxh_u8* XXH_RESTRICT input, size_t len,\n                     const xxh_u8* XXH_RESTRICT secret, size_t secretSize,\n                     XXH64_hash_t seed)\n{\n    XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize;\n    XXH_ASSERT(16 < len && len <= 128);\n\n    {   xxh_u64 acc = len * XXH_PRIME64_1;\n#if XXH_SIZE_OPT >= 1\n        /* Smaller and cleaner, but slightly slower. */\n        unsigned int i = (unsigned int)(len - 1) / 32;\n        do {\n            acc += XXH3_mix16B(input+16 * i, secret+32*i, seed);\n            acc += XXH3_mix16B(input+len-16*(i+1), secret+32*i+16, seed);\n        } while (i-- != 0);\n#else\n        if (len > 32) {\n            if (len > 64) {\n                if (len > 96) {\n                    acc += XXH3_mix16B(input+48, secret+96, seed);\n                    acc += XXH3_mix16B(input+len-64, secret+112, seed);\n                }\n                acc += XXH3_mix16B(input+32, secret+64, seed);\n                acc += XXH3_mix16B(input+len-48, secret+80, seed);\n            }\n            acc += XXH3_mix16B(input+16, secret+32, seed);\n            acc += XXH3_mix16B(input+len-32, secret+48, seed);\n        }\n        acc += XXH3_mix16B(input+0, secret+0, seed);\n        acc += XXH3_mix16B(input+len-16, secret+16, seed);\n#endif\n        return XXH3_avalanche(acc);\n    }\n}\n\n/*!\n * @brief Maximum size of \"short\" key in bytes.\n */\n#define XXH3_MIDSIZE_MAX 240\n\nXXH_NO_INLINE XXH_PUREF XXH64_hash_t\nXXH3_len_129to240_64b(const xxh_u8* XXH_RESTRICT input, size_t len,\n                      const xxh_u8* XXH_RESTRICT secret, size_t secretSize,\n                      XXH64_hash_t seed)\n{\n    XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize;\n    XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX);\n\n    #define XXH3_MIDSIZE_STARTOFFSET 3\n    #define XXH3_MIDSIZE_LASTOFFSET  17\n\n    {   xxh_u64 acc = len * XXH_PRIME64_1;\n        xxh_u64 acc_end;\n        unsigned int const nbRounds = (unsigned int)len / 16;\n        unsigned int i;\n        XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX);\n        for (i=0; i<8; i++) {\n            acc += XXH3_mix16B(input+(16*i), secret+(16*i), seed);\n        }\n        /* last bytes */\n        acc_end = XXH3_mix16B(input + len - 16, secret + XXH3_SECRET_SIZE_MIN - XXH3_MIDSIZE_LASTOFFSET, seed);\n        XXH_ASSERT(nbRounds >= 8);\n        acc = XXH3_avalanche(acc);\n#if defined(__clang__)                                /* Clang */ \\\n    && (defined(__ARM_NEON) || defined(__ARM_NEON__)) /* NEON */ \\\n    && !defined(XXH_ENABLE_AUTOVECTORIZE)             /* Define to disable */\n        /*\n         * UGLY HACK:\n         * Clang for ARMv7-A tries to vectorize this loop, similar to GCC x86.\n         * In everywhere else, it uses scalar code.\n         *\n         * For 64->128-bit multiplies, even if the NEON was 100% optimal, it\n         * would still be slower than UMAAL (see XXH_mult64to128).\n         *\n         * Unfortunately, Clang doesn't handle the long multiplies properly and\n         * converts them to the nonexistent \"vmulq_u64\" intrinsic, which is then\n         * scalarized into an ugly mess of VMOV.32 instructions.\n         *\n         * This mess is difficult to avoid without turning autovectorization\n         * off completely, but they are usually relatively minor and/or not\n         * worth it to fix.\n         *\n         * This loop is the easiest to fix, as unlike XXH32, this pragma\n         * _actually works_ because it is a loop vectorization instead of an\n         * SLP vectorization.\n         */\n        #pragma clang loop vectorize(disable)\n#endif\n        for (i=8 ; i < nbRounds; i++) {\n            /*\n             * Prevents clang for unrolling the acc loop and interleaving with this one.\n             */\n            XXH_COMPILER_GUARD(acc);\n            acc_end += XXH3_mix16B(input+(16*i), secret+(16*(i-8)) + XXH3_MIDSIZE_STARTOFFSET, seed);\n        }\n        return XXH3_avalanche(acc + acc_end);\n    }\n}\n\n\n/* =======     Long Keys     ======= */\n\n#define XXH_STRIPE_LEN 64\n#define XXH_SECRET_CONSUME_RATE 8   /* nb of secret bytes consumed at each accumulation */\n#define XXH_ACC_NB (XXH_STRIPE_LEN / sizeof(xxh_u64))\n\n#ifdef XXH_OLD_NAMES\n#  define STRIPE_LEN XXH_STRIPE_LEN\n#  define ACC_NB XXH_ACC_NB\n#endif\n\n#ifndef XXH_PREFETCH_DIST\n#  ifdef __clang__\n#    define XXH_PREFETCH_DIST 320\n#  else\n#    if (XXH_VECTOR == XXH_AVX512)\n#      define XXH_PREFETCH_DIST 512\n#    else\n#      define XXH_PREFETCH_DIST 384\n#    endif\n#  endif  /* __clang__ */\n#endif  /* XXH_PREFETCH_DIST */\n\n/*\n * These macros are to generate an XXH3_accumulate() function.\n * The two arguments select the name suffix and target attribute.\n *\n * The name of this symbol is XXH3_accumulate_<name>() and it calls\n * XXH3_accumulate_512_<name>().\n *\n * It may be useful to hand implement this function if the compiler fails to\n * optimize the inline function.\n */\n#define XXH3_ACCUMULATE_TEMPLATE(name)                      \\\nvoid                                                        \\\nXXH3_accumulate_##name(xxh_u64* XXH_RESTRICT acc,           \\\n                       const xxh_u8* XXH_RESTRICT input,    \\\n                       const xxh_u8* XXH_RESTRICT secret,   \\\n                       size_t nbStripes)                    \\\n{                                                           \\\n    size_t n;                                               \\\n    for (n = 0; n < nbStripes; n++ ) {                      \\\n        const xxh_u8* const in = input + n*XXH_STRIPE_LEN;  \\\n        XXH_PREFETCH(in + XXH_PREFETCH_DIST);               \\\n        XXH3_accumulate_512_##name(                         \\\n                 acc,                                       \\\n                 in,                                        \\\n                 secret + n*XXH_SECRET_CONSUME_RATE);       \\\n    }                                                       \\\n}\n\n\nXXH_FORCE_INLINE void XXH_writeLE64(void* dst, xxh_u64 v64)\n{\n    if (!XXH_CPU_LITTLE_ENDIAN) v64 = XXH_swap64(v64);\n    XXH_memcpy(dst, &v64, sizeof(v64));\n}\n\n/* Several intrinsic functions below are supposed to accept __int64 as argument,\n * as documented in https://software.intel.com/sites/landingpage/IntrinsicsGuide/ .\n * However, several environments do not define __int64 type,\n * requiring a workaround.\n */\n#if !defined (__VMS) \\\n  && (defined (__cplusplus) \\\n  || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )\n    typedef int64_t xxh_i64;\n#else\n    /* the following type must have a width of 64-bit */\n    typedef long long xxh_i64;\n#endif\n\n\n/*\n * XXH3_accumulate_512 is the tightest loop for long inputs, and it is the most optimized.\n *\n * It is a hardened version of UMAC, based off of FARSH's implementation.\n *\n * This was chosen because it adapts quite well to 32-bit, 64-bit, and SIMD\n * implementations, and it is ridiculously fast.\n *\n * We harden it by mixing the original input to the accumulators as well as the product.\n *\n * This means that in the (relatively likely) case of a multiply by zero, the\n * original input is preserved.\n *\n * On 128-bit inputs, we swap 64-bit pairs when we add the input to improve\n * cross-pollination, as otherwise the upper and lower halves would be\n * essentially independent.\n *\n * This doesn't matter on 64-bit hashes since they all get merged together in\n * the end, so we skip the extra step.\n *\n * Both XXH3_64bits and XXH3_128bits use this subroutine.\n */\n\n#if (XXH_VECTOR == XXH_AVX512) \\\n     || (defined(XXH_DISPATCH_AVX512) && XXH_DISPATCH_AVX512 != 0)\n\n#ifndef XXH_TARGET_AVX512\n# define XXH_TARGET_AVX512  /* disable attribute target */\n#endif\n\nXXH_FORCE_INLINE XXH_TARGET_AVX512 void\nXXH3_accumulate_512_avx512(void* XXH_RESTRICT acc,\n                     const void* XXH_RESTRICT input,\n                     const void* XXH_RESTRICT secret)\n{\n    __m512i* const xacc = (__m512i *) acc;\n    XXH_ASSERT((((size_t)acc) & 63) == 0);\n    XXH_STATIC_ASSERT(XXH_STRIPE_LEN == sizeof(__m512i));\n\n    {\n        /* data_vec    = input[0]; */\n        __m512i const data_vec    = _mm512_loadu_si512   (input);\n        /* key_vec     = secret[0]; */\n        __m512i const key_vec     = _mm512_loadu_si512   (secret);\n        /* data_key    = data_vec ^ key_vec; */\n        __m512i const data_key    = _mm512_xor_si512     (data_vec, key_vec);\n        /* data_key_lo = data_key >> 32; */\n        __m512i const data_key_lo = _mm512_srli_epi64 (data_key, 32);\n        /* product     = (data_key & 0xffffffff) * (data_key_lo & 0xffffffff); */\n        __m512i const product     = _mm512_mul_epu32     (data_key, data_key_lo);\n        /* xacc[0] += swap(data_vec); */\n        __m512i const data_swap = _mm512_shuffle_epi32(data_vec, (_MM_PERM_ENUM)_MM_SHUFFLE(1, 0, 3, 2));\n        __m512i const sum       = _mm512_add_epi64(*xacc, data_swap);\n        /* xacc[0] += product; */\n        *xacc = _mm512_add_epi64(product, sum);\n    }\n}\nXXH_FORCE_INLINE XXH_TARGET_AVX512 XXH3_ACCUMULATE_TEMPLATE(avx512)\n\n/*\n * XXH3_scrambleAcc: Scrambles the accumulators to improve mixing.\n *\n * Multiplication isn't perfect, as explained by Google in HighwayHash:\n *\n *  // Multiplication mixes/scrambles bytes 0-7 of the 64-bit result to\n *  // varying degrees. In descending order of goodness, bytes\n *  // 3 4 2 5 1 6 0 7 have quality 228 224 164 160 100 96 36 32.\n *  // As expected, the upper and lower bytes are much worse.\n *\n * Source: https://github.com/google/highwayhash/blob/0aaf66b/highwayhash/hh_avx2.h#L291\n *\n * Since our algorithm uses a pseudorandom secret to add some variance into the\n * mix, we don't need to (or want to) mix as often or as much as HighwayHash does.\n *\n * This isn't as tight as XXH3_accumulate, but still written in SIMD to avoid\n * extraction.\n *\n * Both XXH3_64bits and XXH3_128bits use this subroutine.\n */\n\nXXH_FORCE_INLINE XXH_TARGET_AVX512 void\nXXH3_scrambleAcc_avx512(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)\n{\n    XXH_ASSERT((((size_t)acc) & 63) == 0);\n    XXH_STATIC_ASSERT(XXH_STRIPE_LEN == sizeof(__m512i));\n    {   __m512i* const xacc = (__m512i*) acc;\n        const __m512i prime32 = _mm512_set1_epi32((int)XXH_PRIME32_1);\n\n        /* xacc[0] ^= (xacc[0] >> 47) */\n        __m512i const acc_vec     = *xacc;\n        __m512i const shifted     = _mm512_srli_epi64    (acc_vec, 47);\n        /* xacc[0] ^= secret; */\n        __m512i const key_vec     = _mm512_loadu_si512   (secret);\n        __m512i const data_key    = _mm512_ternarylogic_epi32(key_vec, acc_vec, shifted, 0x96 /* key_vec ^ acc_vec ^ shifted */);\n\n        /* xacc[0] *= XXH_PRIME32_1; */\n        __m512i const data_key_hi = _mm512_srli_epi64 (data_key, 32);\n        __m512i const prod_lo     = _mm512_mul_epu32     (data_key, prime32);\n        __m512i const prod_hi     = _mm512_mul_epu32     (data_key_hi, prime32);\n        *xacc = _mm512_add_epi64(prod_lo, _mm512_slli_epi64(prod_hi, 32));\n    }\n}\n\nXXH_FORCE_INLINE XXH_TARGET_AVX512 void\nXXH3_initCustomSecret_avx512(void* XXH_RESTRICT customSecret, xxh_u64 seed64)\n{\n    XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 63) == 0);\n    XXH_STATIC_ASSERT(XXH_SEC_ALIGN == 64);\n    XXH_ASSERT(((size_t)customSecret & 63) == 0);\n    (void)(&XXH_writeLE64);\n    {   int const nbRounds = XXH_SECRET_DEFAULT_SIZE / sizeof(__m512i);\n        __m512i const seed_pos = _mm512_set1_epi64((xxh_i64)seed64);\n        __m512i const seed     = _mm512_mask_sub_epi64(seed_pos, 0xAA, _mm512_set1_epi8(0), seed_pos);\n\n        const __m512i* const src  = (const __m512i*) ((const void*) XXH3_kSecret);\n              __m512i* const dest = (      __m512i*) customSecret;\n        int i;\n        XXH_ASSERT(((size_t)src & 63) == 0); /* control alignment */\n        XXH_ASSERT(((size_t)dest & 63) == 0);\n        for (i=0; i < nbRounds; ++i) {\n            dest[i] = _mm512_add_epi64(_mm512_load_si512(src + i), seed);\n    }   }\n}\n\n#endif\n\n#if (XXH_VECTOR == XXH_AVX2) \\\n    || (defined(XXH_DISPATCH_AVX2) && XXH_DISPATCH_AVX2 != 0)\n\n#ifndef XXH_TARGET_AVX2\n# define XXH_TARGET_AVX2  /* disable attribute target */\n#endif\n\nXXH_FORCE_INLINE XXH_TARGET_AVX2 void\nXXH3_accumulate_512_avx2( void* XXH_RESTRICT acc,\n                    const void* XXH_RESTRICT input,\n                    const void* XXH_RESTRICT secret)\n{\n    XXH_ASSERT((((size_t)acc) & 31) == 0);\n    {   __m256i* const xacc    =       (__m256i *) acc;\n        /* Unaligned. This is mainly for pointer arithmetic, and because\n         * _mm256_loadu_si256 requires  a const __m256i * pointer for some reason. */\n        const         __m256i* const xinput  = (const __m256i *) input;\n        /* Unaligned. This is mainly for pointer arithmetic, and because\n         * _mm256_loadu_si256 requires a const __m256i * pointer for some reason. */\n        const         __m256i* const xsecret = (const __m256i *) secret;\n\n        size_t i;\n        for (i=0; i < XXH_STRIPE_LEN/sizeof(__m256i); i++) {\n            /* data_vec    = xinput[i]; */\n            __m256i const data_vec    = _mm256_loadu_si256    (xinput+i);\n            /* key_vec     = xsecret[i]; */\n            __m256i const key_vec     = _mm256_loadu_si256   (xsecret+i);\n            /* data_key    = data_vec ^ key_vec; */\n            __m256i const data_key    = _mm256_xor_si256     (data_vec, key_vec);\n            /* data_key_lo = data_key >> 32; */\n            __m256i const data_key_lo = _mm256_srli_epi64 (data_key, 32);\n            /* product     = (data_key & 0xffffffff) * (data_key_lo & 0xffffffff); */\n            __m256i const product     = _mm256_mul_epu32     (data_key, data_key_lo);\n            /* xacc[i] += swap(data_vec); */\n            __m256i const data_swap = _mm256_shuffle_epi32(data_vec, _MM_SHUFFLE(1, 0, 3, 2));\n            __m256i const sum       = _mm256_add_epi64(xacc[i], data_swap);\n            /* xacc[i] += product; */\n            xacc[i] = _mm256_add_epi64(product, sum);\n    }   }\n}\nXXH_FORCE_INLINE XXH_TARGET_AVX2 XXH3_ACCUMULATE_TEMPLATE(avx2)\n\nXXH_FORCE_INLINE XXH_TARGET_AVX2 void\nXXH3_scrambleAcc_avx2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)\n{\n    XXH_ASSERT((((size_t)acc) & 31) == 0);\n    {   __m256i* const xacc = (__m256i*) acc;\n        /* Unaligned. This is mainly for pointer arithmetic, and because\n         * _mm256_loadu_si256 requires a const __m256i * pointer for some reason. */\n        const         __m256i* const xsecret = (const __m256i *) secret;\n        const __m256i prime32 = _mm256_set1_epi32((int)XXH_PRIME32_1);\n\n        size_t i;\n        for (i=0; i < XXH_STRIPE_LEN/sizeof(__m256i); i++) {\n            /* xacc[i] ^= (xacc[i] >> 47) */\n            __m256i const acc_vec     = xacc[i];\n            __m256i const shifted     = _mm256_srli_epi64    (acc_vec, 47);\n            __m256i const data_vec    = _mm256_xor_si256     (acc_vec, shifted);\n            /* xacc[i] ^= xsecret; */\n            __m256i const key_vec     = _mm256_loadu_si256   (xsecret+i);\n            __m256i const data_key    = _mm256_xor_si256     (data_vec, key_vec);\n\n            /* xacc[i] *= XXH_PRIME32_1; */\n            __m256i const data_key_hi = _mm256_srli_epi64 (data_key, 32);\n            __m256i const prod_lo     = _mm256_mul_epu32     (data_key, prime32);\n            __m256i const prod_hi     = _mm256_mul_epu32     (data_key_hi, prime32);\n            xacc[i] = _mm256_add_epi64(prod_lo, _mm256_slli_epi64(prod_hi, 32));\n        }\n    }\n}\n\nXXH_FORCE_INLINE XXH_TARGET_AVX2 void XXH3_initCustomSecret_avx2(void* XXH_RESTRICT customSecret, xxh_u64 seed64)\n{\n    XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 31) == 0);\n    XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE / sizeof(__m256i)) == 6);\n    XXH_STATIC_ASSERT(XXH_SEC_ALIGN <= 64);\n    (void)(&XXH_writeLE64);\n    XXH_PREFETCH(customSecret);\n    {   __m256i const seed = _mm256_set_epi64x((xxh_i64)(0U - seed64), (xxh_i64)seed64, (xxh_i64)(0U - seed64), (xxh_i64)seed64);\n\n        const __m256i* const src  = (const __m256i*) ((const void*) XXH3_kSecret);\n              __m256i*       dest = (      __m256i*) customSecret;\n\n#       if defined(__GNUC__) || defined(__clang__)\n        /*\n         * On GCC & Clang, marking 'dest' as modified will cause the compiler:\n         *   - do not extract the secret from sse registers in the internal loop\n         *   - use less common registers, and avoid pushing these reg into stack\n         */\n        XXH_COMPILER_GUARD(dest);\n#       endif\n        XXH_ASSERT(((size_t)src & 31) == 0); /* control alignment */\n        XXH_ASSERT(((size_t)dest & 31) == 0);\n\n        /* GCC -O2 need unroll loop manually */\n        dest[0] = _mm256_add_epi64(_mm256_load_si256(src+0), seed);\n        dest[1] = _mm256_add_epi64(_mm256_load_si256(src+1), seed);\n        dest[2] = _mm256_add_epi64(_mm256_load_si256(src+2), seed);\n        dest[3] = _mm256_add_epi64(_mm256_load_si256(src+3), seed);\n        dest[4] = _mm256_add_epi64(_mm256_load_si256(src+4), seed);\n        dest[5] = _mm256_add_epi64(_mm256_load_si256(src+5), seed);\n    }\n}\n\n#endif\n\n/* x86dispatch always generates SSE2 */\n#if (XXH_VECTOR == XXH_SSE2) || defined(XXH_X86DISPATCH)\n\n#ifndef XXH_TARGET_SSE2\n# define XXH_TARGET_SSE2  /* disable attribute target */\n#endif\n\nXXH_FORCE_INLINE XXH_TARGET_SSE2 void\nXXH3_accumulate_512_sse2( void* XXH_RESTRICT acc,\n                    const void* XXH_RESTRICT input,\n                    const void* XXH_RESTRICT secret)\n{\n    /* SSE2 is just a half-scale version of the AVX2 version. */\n    XXH_ASSERT((((size_t)acc) & 15) == 0);\n    {   __m128i* const xacc    =       (__m128i *) acc;\n        /* Unaligned. This is mainly for pointer arithmetic, and because\n         * _mm_loadu_si128 requires a const __m128i * pointer for some reason. */\n        const         __m128i* const xinput  = (const __m128i *) input;\n        /* Unaligned. This is mainly for pointer arithmetic, and because\n         * _mm_loadu_si128 requires a const __m128i * pointer for some reason. */\n        const         __m128i* const xsecret = (const __m128i *) secret;\n\n        size_t i;\n        for (i=0; i < XXH_STRIPE_LEN/sizeof(__m128i); i++) {\n            /* data_vec    = xinput[i]; */\n            __m128i const data_vec    = _mm_loadu_si128   (xinput+i);\n            /* key_vec     = xsecret[i]; */\n            __m128i const key_vec     = _mm_loadu_si128   (xsecret+i);\n            /* data_key    = data_vec ^ key_vec; */\n            __m128i const data_key    = _mm_xor_si128     (data_vec, key_vec);\n            /* data_key_lo = data_key >> 32; */\n            __m128i const data_key_lo = _mm_shuffle_epi32 (data_key, _MM_SHUFFLE(0, 3, 0, 1));\n            /* product     = (data_key & 0xffffffff) * (data_key_lo & 0xffffffff); */\n            __m128i const product     = _mm_mul_epu32     (data_key, data_key_lo);\n            /* xacc[i] += swap(data_vec); */\n            __m128i const data_swap = _mm_shuffle_epi32(data_vec, _MM_SHUFFLE(1,0,3,2));\n            __m128i const sum       = _mm_add_epi64(xacc[i], data_swap);\n            /* xacc[i] += product; */\n            xacc[i] = _mm_add_epi64(product, sum);\n    }   }\n}\nXXH_FORCE_INLINE XXH_TARGET_SSE2 XXH3_ACCUMULATE_TEMPLATE(sse2)\n\nXXH_FORCE_INLINE XXH_TARGET_SSE2 void\nXXH3_scrambleAcc_sse2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)\n{\n    XXH_ASSERT((((size_t)acc) & 15) == 0);\n    {   __m128i* const xacc = (__m128i*) acc;\n        /* Unaligned. This is mainly for pointer arithmetic, and because\n         * _mm_loadu_si128 requires a const __m128i * pointer for some reason. */\n        const         __m128i* const xsecret = (const __m128i *) secret;\n        const __m128i prime32 = _mm_set1_epi32((int)XXH_PRIME32_1);\n\n        size_t i;\n        for (i=0; i < XXH_STRIPE_LEN/sizeof(__m128i); i++) {\n            /* xacc[i] ^= (xacc[i] >> 47) */\n            __m128i const acc_vec     = xacc[i];\n            __m128i const shifted     = _mm_srli_epi64    (acc_vec, 47);\n            __m128i const data_vec    = _mm_xor_si128     (acc_vec, shifted);\n            /* xacc[i] ^= xsecret[i]; */\n            __m128i const key_vec     = _mm_loadu_si128   (xsecret+i);\n            __m128i const data_key    = _mm_xor_si128     (data_vec, key_vec);\n\n            /* xacc[i] *= XXH_PRIME32_1; */\n            __m128i const data_key_hi = _mm_shuffle_epi32 (data_key, _MM_SHUFFLE(0, 3, 0, 1));\n            __m128i const prod_lo     = _mm_mul_epu32     (data_key, prime32);\n            __m128i const prod_hi     = _mm_mul_epu32     (data_key_hi, prime32);\n            xacc[i] = _mm_add_epi64(prod_lo, _mm_slli_epi64(prod_hi, 32));\n        }\n    }\n}\n\nXXH_FORCE_INLINE XXH_TARGET_SSE2 void XXH3_initCustomSecret_sse2(void* XXH_RESTRICT customSecret, xxh_u64 seed64)\n{\n    XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 15) == 0);\n    (void)(&XXH_writeLE64);\n    {   int const nbRounds = XXH_SECRET_DEFAULT_SIZE / sizeof(__m128i);\n\n#       if defined(_MSC_VER) && defined(_M_IX86) && _MSC_VER < 1900\n        /* MSVC 32bit mode does not support _mm_set_epi64x before 2015 */\n        XXH_ALIGN(16) const xxh_i64 seed64x2[2] = { (xxh_i64)seed64, (xxh_i64)(0U - seed64) };\n        __m128i const seed = _mm_load_si128((__m128i const*)seed64x2);\n#       else\n        __m128i const seed = _mm_set_epi64x((xxh_i64)(0U - seed64), (xxh_i64)seed64);\n#       endif\n        int i;\n\n        const void* const src16 = XXH3_kSecret;\n        __m128i* dst16 = (__m128i*) customSecret;\n#       if defined(__GNUC__) || defined(__clang__)\n        /*\n         * On GCC & Clang, marking 'dest' as modified will cause the compiler:\n         *   - do not extract the secret from sse registers in the internal loop\n         *   - use less common registers, and avoid pushing these reg into stack\n         */\n        XXH_COMPILER_GUARD(dst16);\n#       endif\n        XXH_ASSERT(((size_t)src16 & 15) == 0); /* control alignment */\n        XXH_ASSERT(((size_t)dst16 & 15) == 0);\n\n        for (i=0; i < nbRounds; ++i) {\n            dst16[i] = _mm_add_epi64(_mm_load_si128((const __m128i *)src16+i), seed);\n    }   }\n}\n\n#endif\n\n#if (XXH_VECTOR == XXH_NEON)\n\n/* forward declarations for the scalar routines */\nXXH_FORCE_INLINE void\nXXH3_scalarRound(void* XXH_RESTRICT acc, void const* XXH_RESTRICT input,\n                 void const* XXH_RESTRICT secret, size_t lane);\n\nXXH_FORCE_INLINE void\nXXH3_scalarScrambleRound(void* XXH_RESTRICT acc,\n                         void const* XXH_RESTRICT secret, size_t lane);\n\n/*!\n * @internal\n * @brief The bulk processing loop for NEON and WASM SIMD128.\n *\n * The NEON code path is actually partially scalar when running on AArch64. This\n * is to optimize the pipelining and can have up to 15% speedup depending on the\n * CPU, and it also mitigates some GCC codegen issues.\n *\n * @see XXH3_NEON_LANES for configuring this and details about this optimization.\n *\n * NEON's 32-bit to 64-bit long multiply takes a half vector of 32-bit\n * integers instead of the other platforms which mask full 64-bit vectors,\n * so the setup is more complicated than just shifting right.\n *\n * Additionally, there is an optimization for 4 lanes at once noted below.\n *\n * Since, as stated, the most optimal amount of lanes for Cortexes is 6,\n * there needs to be *three* versions of the accumulate operation used\n * for the remaining 2 lanes.\n *\n * WASM's SIMD128 uses SIMDe's arm_neon.h polyfill because the intrinsics overlap\n * nearly perfectly.\n */\n\nXXH_FORCE_INLINE void\nXXH3_accumulate_512_neon( void* XXH_RESTRICT acc,\n                    const void* XXH_RESTRICT input,\n                    const void* XXH_RESTRICT secret)\n{\n    XXH_ASSERT((((size_t)acc) & 15) == 0);\n    XXH_STATIC_ASSERT(XXH3_NEON_LANES > 0 && XXH3_NEON_LANES <= XXH_ACC_NB && XXH3_NEON_LANES % 2 == 0);\n    {   /* GCC for darwin arm64 does not like aliasing here */\n        xxh_aliasing_uint64x2_t* const xacc = (xxh_aliasing_uint64x2_t*) acc;\n        /* We don't use a uint32x4_t pointer because it causes bus errors on ARMv7. */\n        uint8_t const* xinput = (const uint8_t *) input;\n        uint8_t const* xsecret  = (const uint8_t *) secret;\n\n        size_t i;\n#ifdef __wasm_simd128__\n        /*\n         * On WASM SIMD128, Clang emits direct address loads when XXH3_kSecret\n         * is constant propagated, which results in it converting it to this\n         * inside the loop:\n         *\n         *    a = v128.load(XXH3_kSecret +  0 + $secret_offset, offset = 0)\n         *    b = v128.load(XXH3_kSecret + 16 + $secret_offset, offset = 0)\n         *    ...\n         *\n         * This requires a full 32-bit address immediate (and therefore a 6 byte\n         * instruction) as well as an add for each offset.\n         *\n         * Putting an asm guard prevents it from folding (at the cost of losing\n         * the alignment hint), and uses the free offset in `v128.load` instead\n         * of adding secret_offset each time which overall reduces code size by\n         * about a kilobyte and improves performance.\n         */\n        XXH_COMPILER_GUARD(xsecret);\n#endif\n        /* Scalar lanes use the normal scalarRound routine */\n        for (i = XXH3_NEON_LANES; i < XXH_ACC_NB; i++) {\n            XXH3_scalarRound(acc, input, secret, i);\n        }\n        i = 0;\n        /* 4 NEON lanes at a time. */\n        for (; i+1 < XXH3_NEON_LANES / 2; i+=2) {\n            /* data_vec = xinput[i]; */\n            uint64x2_t data_vec_1 = XXH_vld1q_u64(xinput  + (i * 16));\n            uint64x2_t data_vec_2 = XXH_vld1q_u64(xinput  + ((i+1) * 16));\n            /* key_vec  = xsecret[i];  */\n            uint64x2_t key_vec_1  = XXH_vld1q_u64(xsecret + (i * 16));\n            uint64x2_t key_vec_2  = XXH_vld1q_u64(xsecret + ((i+1) * 16));\n            /* data_swap = swap(data_vec) */\n            uint64x2_t data_swap_1 = vextq_u64(data_vec_1, data_vec_1, 1);\n            uint64x2_t data_swap_2 = vextq_u64(data_vec_2, data_vec_2, 1);\n            /* data_key = data_vec ^ key_vec; */\n            uint64x2_t data_key_1 = veorq_u64(data_vec_1, key_vec_1);\n            uint64x2_t data_key_2 = veorq_u64(data_vec_2, key_vec_2);\n\n            /*\n             * If we reinterpret the 64x2 vectors as 32x4 vectors, we can use a\n             * de-interleave operation for 4 lanes in 1 step with `vuzpq_u32` to\n             * get one vector with the low 32 bits of each lane, and one vector\n             * with the high 32 bits of each lane.\n             *\n             * The intrinsic returns a double vector because the original ARMv7-a\n             * instruction modified both arguments in place. AArch64 and SIMD128 emit\n             * two instructions from this intrinsic.\n             *\n             *  [ dk11L | dk11H | dk12L | dk12H ] -> [ dk11L | dk12L | dk21L | dk22L ]\n             *  [ dk21L | dk21H | dk22L | dk22H ] -> [ dk11H | dk12H | dk21H | dk22H ]\n             */\n            uint32x4x2_t unzipped = vuzpq_u32(\n                vreinterpretq_u32_u64(data_key_1),\n                vreinterpretq_u32_u64(data_key_2)\n            );\n            /* data_key_lo = data_key & 0xFFFFFFFF */\n            uint32x4_t data_key_lo = unzipped.val[0];\n            /* data_key_hi = data_key >> 32 */\n            uint32x4_t data_key_hi = unzipped.val[1];\n            /*\n             * Then, we can split the vectors horizontally and multiply which, as for most\n             * widening intrinsics, have a variant that works on both high half vectors\n             * for free on AArch64. A similar instruction is available on SIMD128.\n             *\n             * sum = data_swap + (u64x2) data_key_lo * (u64x2) data_key_hi\n             */\n            uint64x2_t sum_1 = XXH_vmlal_low_u32(data_swap_1, data_key_lo, data_key_hi);\n            uint64x2_t sum_2 = XXH_vmlal_high_u32(data_swap_2, data_key_lo, data_key_hi);\n            /*\n             * Clang reorders\n             *    a += b * c;     // umlal   swap.2d, dkl.2s, dkh.2s\n             *    c += a;         // add     acc.2d, acc.2d, swap.2d\n             * to\n             *    c += a;         // add     acc.2d, acc.2d, swap.2d\n             *    c += b * c;     // umlal   acc.2d, dkl.2s, dkh.2s\n             *\n             * While it would make sense in theory since the addition is faster,\n             * for reasons likely related to umlal being limited to certain NEON\n             * pipelines, this is worse. A compiler guard fixes this.\n             */\n            XXH_COMPILER_GUARD_CLANG_NEON(sum_1);\n            XXH_COMPILER_GUARD_CLANG_NEON(sum_2);\n            /* xacc[i] = acc_vec + sum; */\n            xacc[i]   = vaddq_u64(xacc[i], sum_1);\n            xacc[i+1] = vaddq_u64(xacc[i+1], sum_2);\n        }\n        /* Operate on the remaining NEON lanes 2 at a time. */\n        for (; i < XXH3_NEON_LANES / 2; i++) {\n            /* data_vec = xinput[i]; */\n            uint64x2_t data_vec = XXH_vld1q_u64(xinput  + (i * 16));\n            /* key_vec  = xsecret[i];  */\n            uint64x2_t key_vec  = XXH_vld1q_u64(xsecret + (i * 16));\n            /* acc_vec_2 = swap(data_vec) */\n            uint64x2_t data_swap = vextq_u64(data_vec, data_vec, 1);\n            /* data_key = data_vec ^ key_vec; */\n            uint64x2_t data_key = veorq_u64(data_vec, key_vec);\n            /* For two lanes, just use VMOVN and VSHRN. */\n            /* data_key_lo = data_key & 0xFFFFFFFF; */\n            uint32x2_t data_key_lo = vmovn_u64(data_key);\n            /* data_key_hi = data_key >> 32; */\n            uint32x2_t data_key_hi = vshrn_n_u64(data_key, 32);\n            /* sum = data_swap + (u64x2) data_key_lo * (u64x2) data_key_hi; */\n            uint64x2_t sum = vmlal_u32(data_swap, data_key_lo, data_key_hi);\n            /* Same Clang workaround as before */\n            XXH_COMPILER_GUARD_CLANG_NEON(sum);\n            /* xacc[i] = acc_vec + sum; */\n            xacc[i] = vaddq_u64 (xacc[i], sum);\n        }\n    }\n}\nXXH_FORCE_INLINE XXH3_ACCUMULATE_TEMPLATE(neon)\n\nXXH_FORCE_INLINE void\nXXH3_scrambleAcc_neon(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)\n{\n    XXH_ASSERT((((size_t)acc) & 15) == 0);\n\n    {   xxh_aliasing_uint64x2_t* xacc       = (xxh_aliasing_uint64x2_t*) acc;\n        uint8_t const* xsecret = (uint8_t const*) secret;\n\n        size_t i;\n        /* WASM uses operator overloads and doesn't need these. */\n#ifndef __wasm_simd128__\n        /* { prime32_1, prime32_1 } */\n        uint32x2_t const kPrimeLo = vdup_n_u32(XXH_PRIME32_1);\n        /* { 0, prime32_1, 0, prime32_1 } */\n        uint32x4_t const kPrimeHi = vreinterpretq_u32_u64(vdupq_n_u64((xxh_u64)XXH_PRIME32_1 << 32));\n#endif\n\n        /* AArch64 uses both scalar and neon at the same time */\n        for (i = XXH3_NEON_LANES; i < XXH_ACC_NB; i++) {\n            XXH3_scalarScrambleRound(acc, secret, i);\n        }\n        for (i=0; i < XXH3_NEON_LANES / 2; i++) {\n            /* xacc[i] ^= (xacc[i] >> 47); */\n            uint64x2_t acc_vec  = xacc[i];\n            uint64x2_t shifted  = vshrq_n_u64(acc_vec, 47);\n            uint64x2_t data_vec = veorq_u64(acc_vec, shifted);\n\n            /* xacc[i] ^= xsecret[i]; */\n            uint64x2_t key_vec  = XXH_vld1q_u64(xsecret + (i * 16));\n            uint64x2_t data_key = veorq_u64(data_vec, key_vec);\n            /* xacc[i] *= XXH_PRIME32_1 */\n#ifdef __wasm_simd128__\n            /* SIMD128 has multiply by u64x2, use it instead of expanding and scalarizing */\n            xacc[i] = data_key * XXH_PRIME32_1;\n#else\n            /*\n             * Expanded version with portable NEON intrinsics\n             *\n             *    lo(x) * lo(y) + (hi(x) * lo(y) << 32)\n             *\n             * prod_hi = hi(data_key) * lo(prime) << 32\n             *\n             * Since we only need 32 bits of this multiply a trick can be used, reinterpreting the vector\n             * as a uint32x4_t and multiplying by { 0, prime, 0, prime } to cancel out the unwanted bits\n             * and avoid the shift.\n             */\n            uint32x4_t prod_hi = vmulq_u32 (vreinterpretq_u32_u64(data_key), kPrimeHi);\n            /* Extract low bits for vmlal_u32  */\n            uint32x2_t data_key_lo = vmovn_u64(data_key);\n            /* xacc[i] = prod_hi + lo(data_key) * XXH_PRIME32_1; */\n            xacc[i] = vmlal_u32(vreinterpretq_u64_u32(prod_hi), data_key_lo, kPrimeLo);\n#endif\n        }\n    }\n}\n#endif\n\n#if (XXH_VECTOR == XXH_VSX)\n\nXXH_FORCE_INLINE void\nXXH3_accumulate_512_vsx(  void* XXH_RESTRICT acc,\n                    const void* XXH_RESTRICT input,\n                    const void* XXH_RESTRICT secret)\n{\n    /* presumed aligned */\n    xxh_aliasing_u64x2* const xacc = (xxh_aliasing_u64x2*) acc;\n    xxh_u8 const* const xinput   = (xxh_u8 const*) input;   /* no alignment restriction */\n    xxh_u8 const* const xsecret  = (xxh_u8 const*) secret;    /* no alignment restriction */\n    xxh_u64x2 const v32 = { 32, 32 };\n    size_t i;\n    for (i = 0; i < XXH_STRIPE_LEN / sizeof(xxh_u64x2); i++) {\n        /* data_vec = xinput[i]; */\n        xxh_u64x2 const data_vec = XXH_vec_loadu(xinput + 16*i);\n        /* key_vec = xsecret[i]; */\n        xxh_u64x2 const key_vec  = XXH_vec_loadu(xsecret + 16*i);\n        xxh_u64x2 const data_key = data_vec ^ key_vec;\n        /* shuffled = (data_key << 32) | (data_key >> 32); */\n        xxh_u32x4 const shuffled = (xxh_u32x4)vec_rl(data_key, v32);\n        /* product = ((xxh_u64x2)data_key & 0xFFFFFFFF) * ((xxh_u64x2)shuffled & 0xFFFFFFFF); */\n        xxh_u64x2 const product  = XXH_vec_mulo((xxh_u32x4)data_key, shuffled);\n        /* acc_vec = xacc[i]; */\n        xxh_u64x2 acc_vec        = xacc[i];\n        acc_vec += product;\n\n        /* swap high and low halves */\n#ifdef __s390x__\n        acc_vec += vec_permi(data_vec, data_vec, 2);\n#else\n        acc_vec += vec_xxpermdi(data_vec, data_vec, 2);\n#endif\n        xacc[i] = acc_vec;\n    }\n}\nXXH_FORCE_INLINE XXH3_ACCUMULATE_TEMPLATE(vsx)\n\nXXH_FORCE_INLINE void\nXXH3_scrambleAcc_vsx(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)\n{\n    XXH_ASSERT((((size_t)acc) & 15) == 0);\n\n    {   xxh_aliasing_u64x2* const xacc = (xxh_aliasing_u64x2*) acc;\n        const xxh_u8* const xsecret = (const xxh_u8*) secret;\n        /* constants */\n        xxh_u64x2 const v32  = { 32, 32 };\n        xxh_u64x2 const v47 = { 47, 47 };\n        xxh_u32x4 const prime = { XXH_PRIME32_1, XXH_PRIME32_1, XXH_PRIME32_1, XXH_PRIME32_1 };\n        size_t i;\n        for (i = 0; i < XXH_STRIPE_LEN / sizeof(xxh_u64x2); i++) {\n            /* xacc[i] ^= (xacc[i] >> 47); */\n            xxh_u64x2 const acc_vec  = xacc[i];\n            xxh_u64x2 const data_vec = acc_vec ^ (acc_vec >> v47);\n\n            /* xacc[i] ^= xsecret[i]; */\n            xxh_u64x2 const key_vec  = XXH_vec_loadu(xsecret + 16*i);\n            xxh_u64x2 const data_key = data_vec ^ key_vec;\n\n            /* xacc[i] *= XXH_PRIME32_1 */\n            /* prod_lo = ((xxh_u64x2)data_key & 0xFFFFFFFF) * ((xxh_u64x2)prime & 0xFFFFFFFF);  */\n            xxh_u64x2 const prod_even  = XXH_vec_mule((xxh_u32x4)data_key, prime);\n            /* prod_hi = ((xxh_u64x2)data_key >> 32) * ((xxh_u64x2)prime >> 32);  */\n            xxh_u64x2 const prod_odd  = XXH_vec_mulo((xxh_u32x4)data_key, prime);\n            xacc[i] = prod_odd + (prod_even << v32);\n    }   }\n}\n\n#endif\n\n#if (XXH_VECTOR == XXH_SVE)\n\nXXH_FORCE_INLINE void\nXXH3_accumulate_512_sve( void* XXH_RESTRICT acc,\n                   const void* XXH_RESTRICT input,\n                   const void* XXH_RESTRICT secret)\n{\n    uint64_t *xacc = (uint64_t *)acc;\n    const uint64_t *xinput = (const uint64_t *)(const void *)input;\n    const uint64_t *xsecret = (const uint64_t *)(const void *)secret;\n    svuint64_t kSwap = sveor_n_u64_z(svptrue_b64(), svindex_u64(0, 1), 1);\n    uint64_t element_count = svcntd();\n    if (element_count >= 8) {\n        svbool_t mask = svptrue_pat_b64(SV_VL8);\n        svuint64_t vacc = svld1_u64(mask, xacc);\n        ACCRND(vacc, 0);\n        svst1_u64(mask, xacc, vacc);\n    } else if (element_count == 2) {   /* sve128 */\n        svbool_t mask = svptrue_pat_b64(SV_VL2);\n        svuint64_t acc0 = svld1_u64(mask, xacc + 0);\n        svuint64_t acc1 = svld1_u64(mask, xacc + 2);\n        svuint64_t acc2 = svld1_u64(mask, xacc + 4);\n        svuint64_t acc3 = svld1_u64(mask, xacc + 6);\n        ACCRND(acc0, 0);\n        ACCRND(acc1, 2);\n        ACCRND(acc2, 4);\n        ACCRND(acc3, 6);\n        svst1_u64(mask, xacc + 0, acc0);\n        svst1_u64(mask, xacc + 2, acc1);\n        svst1_u64(mask, xacc + 4, acc2);\n        svst1_u64(mask, xacc + 6, acc3);\n    } else {\n        svbool_t mask = svptrue_pat_b64(SV_VL4);\n        svuint64_t acc0 = svld1_u64(mask, xacc + 0);\n        svuint64_t acc1 = svld1_u64(mask, xacc + 4);\n        ACCRND(acc0, 0);\n        ACCRND(acc1, 4);\n        svst1_u64(mask, xacc + 0, acc0);\n        svst1_u64(mask, xacc + 4, acc1);\n    }\n}\n\nXXH_FORCE_INLINE void\nXXH3_accumulate_sve(xxh_u64* XXH_RESTRICT acc,\n               const xxh_u8* XXH_RESTRICT input,\n               const xxh_u8* XXH_RESTRICT secret,\n               size_t nbStripes)\n{\n    if (nbStripes != 0) {\n        uint64_t *xacc = (uint64_t *)acc;\n        const uint64_t *xinput = (const uint64_t *)(const void *)input;\n        const uint64_t *xsecret = (const uint64_t *)(const void *)secret;\n        svuint64_t kSwap = sveor_n_u64_z(svptrue_b64(), svindex_u64(0, 1), 1);\n        uint64_t element_count = svcntd();\n        if (element_count >= 8) {\n            svbool_t mask = svptrue_pat_b64(SV_VL8);\n            svuint64_t vacc = svld1_u64(mask, xacc + 0);\n            do {\n                /* svprfd(svbool_t, void *, enum svfprop); */\n                svprfd(mask, xinput + 128, SV_PLDL1STRM);\n                ACCRND(vacc, 0);\n                xinput += 8;\n                xsecret += 1;\n                nbStripes--;\n           } while (nbStripes != 0);\n\n           svst1_u64(mask, xacc + 0, vacc);\n        } else if (element_count == 2) { /* sve128 */\n            svbool_t mask = svptrue_pat_b64(SV_VL2);\n            svuint64_t acc0 = svld1_u64(mask, xacc + 0);\n            svuint64_t acc1 = svld1_u64(mask, xacc + 2);\n            svuint64_t acc2 = svld1_u64(mask, xacc + 4);\n            svuint64_t acc3 = svld1_u64(mask, xacc + 6);\n            do {\n                svprfd(mask, xinput + 128, SV_PLDL1STRM);\n                ACCRND(acc0, 0);\n                ACCRND(acc1, 2);\n                ACCRND(acc2, 4);\n                ACCRND(acc3, 6);\n                xinput += 8;\n                xsecret += 1;\n                nbStripes--;\n           } while (nbStripes != 0);\n\n           svst1_u64(mask, xacc + 0, acc0);\n           svst1_u64(mask, xacc + 2, acc1);\n           svst1_u64(mask, xacc + 4, acc2);\n           svst1_u64(mask, xacc + 6, acc3);\n        } else {\n            svbool_t mask = svptrue_pat_b64(SV_VL4);\n            svuint64_t acc0 = svld1_u64(mask, xacc + 0);\n            svuint64_t acc1 = svld1_u64(mask, xacc + 4);\n            do {\n                svprfd(mask, xinput + 128, SV_PLDL1STRM);\n                ACCRND(acc0, 0);\n                ACCRND(acc1, 4);\n                xinput += 8;\n                xsecret += 1;\n                nbStripes--;\n           } while (nbStripes != 0);\n\n           svst1_u64(mask, xacc + 0, acc0);\n           svst1_u64(mask, xacc + 4, acc1);\n       }\n    }\n}\n\n#endif\n\n/* scalar variants - universal */\n\n#if defined(__aarch64__) && (defined(__GNUC__) || defined(__clang__))\n/*\n * In XXH3_scalarRound(), GCC and Clang have a similar codegen issue, where they\n * emit an excess mask and a full 64-bit multiply-add (MADD X-form).\n *\n * While this might not seem like much, as AArch64 is a 64-bit architecture, only\n * big Cortex designs have a full 64-bit multiplier.\n *\n * On the little cores, the smaller 32-bit multiplier is used, and full 64-bit\n * multiplies expand to 2-3 multiplies in microcode. This has a major penalty\n * of up to 4 latency cycles and 2 stall cycles in the multiply pipeline.\n *\n * Thankfully, AArch64 still provides the 32-bit long multiply-add (UMADDL) which does\n * not have this penalty and does the mask automatically.\n */\nXXH_FORCE_INLINE xxh_u64\nXXH_mult32to64_add64(xxh_u64 lhs, xxh_u64 rhs, xxh_u64 acc)\n{\n    xxh_u64 ret;\n    /* note: %x = 64-bit register, %w = 32-bit register */\n    __asm__(\"umaddl %x0, %w1, %w2, %x3\" : \"=r\" (ret) : \"r\" (lhs), \"r\" (rhs), \"r\" (acc));\n    return ret;\n}\n#else\nXXH_FORCE_INLINE xxh_u64\nXXH_mult32to64_add64(xxh_u64 lhs, xxh_u64 rhs, xxh_u64 acc)\n{\n    return XXH_mult32to64((xxh_u32)lhs, (xxh_u32)rhs) + acc;\n}\n#endif\n\n/*!\n * @internal\n * @brief Scalar round for @ref XXH3_accumulate_512_scalar().\n *\n * This is extracted to its own function because the NEON path uses a combination\n * of NEON and scalar.\n */\nXXH_FORCE_INLINE void\nXXH3_scalarRound(void* XXH_RESTRICT acc,\n                 void const* XXH_RESTRICT input,\n                 void const* XXH_RESTRICT secret,\n                 size_t lane)\n{\n    xxh_u64* xacc = (xxh_u64*) acc;\n    xxh_u8 const* xinput  = (xxh_u8 const*) input;\n    xxh_u8 const* xsecret = (xxh_u8 const*) secret;\n    XXH_ASSERT(lane < XXH_ACC_NB);\n    XXH_ASSERT(((size_t)acc & (XXH_ACC_ALIGN-1)) == 0);\n    {\n        xxh_u64 const data_val = XXH_readLE64(xinput + lane * 8);\n        xxh_u64 const data_key = data_val ^ XXH_readLE64(xsecret + lane * 8);\n        xacc[lane ^ 1] += data_val; /* swap adjacent lanes */\n        xacc[lane] = XXH_mult32to64_add64(data_key /* & 0xFFFFFFFF */, data_key >> 32, xacc[lane]);\n    }\n}\n\n/*!\n * @internal\n * @brief Processes a 64 byte block of data using the scalar path.\n */\nXXH_FORCE_INLINE void\nXXH3_accumulate_512_scalar(void* XXH_RESTRICT acc,\n                     const void* XXH_RESTRICT input,\n                     const void* XXH_RESTRICT secret)\n{\n    size_t i;\n    /* ARM GCC refuses to unroll this loop, resulting in a 24% slowdown on ARMv6. */\n#if defined(__GNUC__) && !defined(__clang__) \\\n  && (defined(__arm__) || defined(__thumb2__)) \\\n  && defined(__ARM_FEATURE_UNALIGNED) /* no unaligned access just wastes bytes */ \\\n  && XXH_SIZE_OPT <= 0\n#  pragma GCC unroll 8\n#endif\n    for (i=0; i < XXH_ACC_NB; i++) {\n        XXH3_scalarRound(acc, input, secret, i);\n    }\n}\nXXH_FORCE_INLINE XXH3_ACCUMULATE_TEMPLATE(scalar)\n\n/*!\n * @internal\n * @brief Scalar scramble step for @ref XXH3_scrambleAcc_scalar().\n *\n * This is extracted to its own function because the NEON path uses a combination\n * of NEON and scalar.\n */\nXXH_FORCE_INLINE void\nXXH3_scalarScrambleRound(void* XXH_RESTRICT acc,\n                         void const* XXH_RESTRICT secret,\n                         size_t lane)\n{\n    xxh_u64* const xacc = (xxh_u64*) acc;   /* presumed aligned */\n    const xxh_u8* const xsecret = (const xxh_u8*) secret;   /* no alignment restriction */\n    XXH_ASSERT((((size_t)acc) & (XXH_ACC_ALIGN-1)) == 0);\n    XXH_ASSERT(lane < XXH_ACC_NB);\n    {\n        xxh_u64 const key64 = XXH_readLE64(xsecret + lane * 8);\n        xxh_u64 acc64 = xacc[lane];\n        acc64 = XXH_xorshift64(acc64, 47);\n        acc64 ^= key64;\n        acc64 *= XXH_PRIME32_1;\n        xacc[lane] = acc64;\n    }\n}\n\n/*!\n * @internal\n * @brief Scrambles the accumulators after a large chunk has been read\n */\nXXH_FORCE_INLINE void\nXXH3_scrambleAcc_scalar(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)\n{\n    size_t i;\n    for (i=0; i < XXH_ACC_NB; i++) {\n        XXH3_scalarScrambleRound(acc, secret, i);\n    }\n}\n\nXXH_FORCE_INLINE void\nXXH3_initCustomSecret_scalar(void* XXH_RESTRICT customSecret, xxh_u64 seed64)\n{\n    /*\n     * We need a separate pointer for the hack below,\n     * which requires a non-const pointer.\n     * Any decent compiler will optimize this out otherwise.\n     */\n    const xxh_u8* kSecretPtr = XXH3_kSecret;\n    XXH_STATIC_ASSERT((XXH_SECRET_DEFAULT_SIZE & 15) == 0);\n\n#if defined(__GNUC__) && defined(__aarch64__)\n    /*\n     * UGLY HACK:\n     * GCC and Clang generate a bunch of MOV/MOVK pairs for aarch64, and they are\n     * placed sequentially, in order, at the top of the unrolled loop.\n     *\n     * While MOVK is great for generating constants (2 cycles for a 64-bit\n     * constant compared to 4 cycles for LDR), it fights for bandwidth with\n     * the arithmetic instructions.\n     *\n     *   I   L   S\n     * MOVK\n     * MOVK\n     * MOVK\n     * MOVK\n     * ADD\n     * SUB      STR\n     *          STR\n     * By forcing loads from memory (as the asm line causes the compiler to assume\n     * that XXH3_kSecretPtr has been changed), the pipelines are used more\n     * efficiently:\n     *   I   L   S\n     *      LDR\n     *  ADD LDR\n     *  SUB     STR\n     *          STR\n     *\n     * See XXH3_NEON_LANES for details on the pipsline.\n     *\n     * XXH3_64bits_withSeed, len == 256, Snapdragon 835\n     *   without hack: 2654.4 MB/s\n     *   with hack:    3202.9 MB/s\n     */\n    XXH_COMPILER_GUARD(kSecretPtr);\n#endif\n    {   int const nbRounds = XXH_SECRET_DEFAULT_SIZE / 16;\n        int i;\n        for (i=0; i < nbRounds; i++) {\n            /*\n             * The asm hack causes the compiler to assume that kSecretPtr aliases with\n             * customSecret, and on aarch64, this prevented LDP from merging two\n             * loads together for free. Putting the loads together before the stores\n             * properly generates LDP.\n             */\n            xxh_u64 lo = XXH_readLE64(kSecretPtr + 16*i)     + seed64;\n            xxh_u64 hi = XXH_readLE64(kSecretPtr + 16*i + 8) - seed64;\n            XXH_writeLE64((xxh_u8*)customSecret + 16*i,     lo);\n            XXH_writeLE64((xxh_u8*)customSecret + 16*i + 8, hi);\n    }   }\n}\n\n\ntypedef void (*XXH3_f_accumulate)(xxh_u64* XXH_RESTRICT, const xxh_u8* XXH_RESTRICT, const xxh_u8* XXH_RESTRICT, size_t);\ntypedef void (*XXH3_f_scrambleAcc)(void* XXH_RESTRICT, const void*);\ntypedef void (*XXH3_f_initCustomSecret)(void* XXH_RESTRICT, xxh_u64);\n\n\n#if (XXH_VECTOR == XXH_AVX512)\n\n#define XXH3_accumulate_512 XXH3_accumulate_512_avx512\n#define XXH3_accumulate     XXH3_accumulate_avx512\n#define XXH3_scrambleAcc    XXH3_scrambleAcc_avx512\n#define XXH3_initCustomSecret XXH3_initCustomSecret_avx512\n\n#elif (XXH_VECTOR == XXH_AVX2)\n\n#define XXH3_accumulate_512 XXH3_accumulate_512_avx2\n#define XXH3_accumulate     XXH3_accumulate_avx2\n#define XXH3_scrambleAcc    XXH3_scrambleAcc_avx2\n#define XXH3_initCustomSecret XXH3_initCustomSecret_avx2\n\n#elif (XXH_VECTOR == XXH_SSE2)\n\n#define XXH3_accumulate_512 XXH3_accumulate_512_sse2\n#define XXH3_accumulate     XXH3_accumulate_sse2\n#define XXH3_scrambleAcc    XXH3_scrambleAcc_sse2\n#define XXH3_initCustomSecret XXH3_initCustomSecret_sse2\n\n#elif (XXH_VECTOR == XXH_NEON)\n\n#define XXH3_accumulate_512 XXH3_accumulate_512_neon\n#define XXH3_accumulate     XXH3_accumulate_neon\n#define XXH3_scrambleAcc    XXH3_scrambleAcc_neon\n#define XXH3_initCustomSecret XXH3_initCustomSecret_scalar\n\n#elif (XXH_VECTOR == XXH_VSX)\n\n#define XXH3_accumulate_512 XXH3_accumulate_512_vsx\n#define XXH3_accumulate     XXH3_accumulate_vsx\n#define XXH3_scrambleAcc    XXH3_scrambleAcc_vsx\n#define XXH3_initCustomSecret XXH3_initCustomSecret_scalar\n\n#elif (XXH_VECTOR == XXH_SVE)\n#define XXH3_accumulate_512 XXH3_accumulate_512_sve\n#define XXH3_accumulate     XXH3_accumulate_sve\n#define XXH3_scrambleAcc    XXH3_scrambleAcc_scalar\n#define XXH3_initCustomSecret XXH3_initCustomSecret_scalar\n\n#else /* scalar */\n\n#define XXH3_accumulate_512 XXH3_accumulate_512_scalar\n#define XXH3_accumulate     XXH3_accumulate_scalar\n#define XXH3_scrambleAcc    XXH3_scrambleAcc_scalar\n#define XXH3_initCustomSecret XXH3_initCustomSecret_scalar\n\n#endif\n\n#if XXH_SIZE_OPT >= 1 /* don't do SIMD for initialization */\n#  undef XXH3_initCustomSecret\n#  define XXH3_initCustomSecret XXH3_initCustomSecret_scalar\n#endif\n\nXXH_FORCE_INLINE void\nXXH3_hashLong_internal_loop(xxh_u64* XXH_RESTRICT acc,\n                      const xxh_u8* XXH_RESTRICT input, size_t len,\n                      const xxh_u8* XXH_RESTRICT secret, size_t secretSize,\n                            XXH3_f_accumulate f_acc,\n                            XXH3_f_scrambleAcc f_scramble)\n{\n    size_t const nbStripesPerBlock = (secretSize - XXH_STRIPE_LEN) / XXH_SECRET_CONSUME_RATE;\n    size_t const block_len = XXH_STRIPE_LEN * nbStripesPerBlock;\n    size_t const nb_blocks = (len - 1) / block_len;\n\n    size_t n;\n\n    XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN);\n\n    for (n = 0; n < nb_blocks; n++) {\n        f_acc(acc, input + n*block_len, secret, nbStripesPerBlock);\n        f_scramble(acc, secret + secretSize - XXH_STRIPE_LEN);\n    }\n\n    /* last partial block */\n    XXH_ASSERT(len > XXH_STRIPE_LEN);\n    {   size_t const nbStripes = ((len - 1) - (block_len * nb_blocks)) / XXH_STRIPE_LEN;\n        XXH_ASSERT(nbStripes <= (secretSize / XXH_SECRET_CONSUME_RATE));\n        f_acc(acc, input + nb_blocks*block_len, secret, nbStripes);\n\n        /* last stripe */\n        {   const xxh_u8* const p = input + len - XXH_STRIPE_LEN;\n#define XXH_SECRET_LASTACC_START 7  /* not aligned on 8, last secret is different from acc & scrambler */\n            XXH3_accumulate_512(acc, p, secret + secretSize - XXH_STRIPE_LEN - XXH_SECRET_LASTACC_START);\n    }   }\n}\n\nXXH_FORCE_INLINE xxh_u64\nXXH3_mix2Accs(const xxh_u64* XXH_RESTRICT acc, const xxh_u8* XXH_RESTRICT secret)\n{\n    return XXH3_mul128_fold64(\n               acc[0] ^ XXH_readLE64(secret),\n               acc[1] ^ XXH_readLE64(secret+8) );\n}\n\nstatic XXH64_hash_t\nXXH3_mergeAccs(const xxh_u64* XXH_RESTRICT acc, const xxh_u8* XXH_RESTRICT secret, xxh_u64 start)\n{\n    xxh_u64 result64 = start;\n    size_t i = 0;\n\n    for (i = 0; i < 4; i++) {\n        result64 += XXH3_mix2Accs(acc+2*i, secret + 16*i);\n#if defined(__clang__)                                /* Clang */ \\\n    && (defined(__arm__) || defined(__thumb__))       /* ARMv7 */ \\\n    && (defined(__ARM_NEON) || defined(__ARM_NEON__)) /* NEON */  \\\n    && !defined(XXH_ENABLE_AUTOVECTORIZE)             /* Define to disable */\n        /*\n         * UGLY HACK:\n         * Prevent autovectorization on Clang ARMv7-a. Exact same problem as\n         * the one in XXH3_len_129to240_64b. Speeds up shorter keys > 240b.\n         * XXH3_64bits, len == 256, Snapdragon 835:\n         *   without hack: 2063.7 MB/s\n         *   with hack:    2560.7 MB/s\n         */\n        XXH_COMPILER_GUARD(result64);\n#endif\n    }\n\n    return XXH3_avalanche(result64);\n}\n\n#define XXH3_INIT_ACC { XXH_PRIME32_3, XXH_PRIME64_1, XXH_PRIME64_2, XXH_PRIME64_3, \\\n                        XXH_PRIME64_4, XXH_PRIME32_2, XXH_PRIME64_5, XXH_PRIME32_1 }\n\nXXH_FORCE_INLINE XXH64_hash_t\nXXH3_hashLong_64b_internal(const void* XXH_RESTRICT input, size_t len,\n                           const void* XXH_RESTRICT secret, size_t secretSize,\n                           XXH3_f_accumulate f_acc,\n                           XXH3_f_scrambleAcc f_scramble)\n{\n    XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[XXH_ACC_NB] = XXH3_INIT_ACC;\n\n    XXH3_hashLong_internal_loop(acc, (const xxh_u8*)input, len, (const xxh_u8*)secret, secretSize, f_acc, f_scramble);\n\n    /* converge into final hash */\n    XXH_STATIC_ASSERT(sizeof(acc) == 64);\n    /* do not align on 8, so that the secret is different from the accumulator */\n#define XXH_SECRET_MERGEACCS_START 11\n    XXH_ASSERT(secretSize >= sizeof(acc) + XXH_SECRET_MERGEACCS_START);\n    return XXH3_mergeAccs(acc, (const xxh_u8*)secret + XXH_SECRET_MERGEACCS_START, (xxh_u64)len * XXH_PRIME64_1);\n}\n\n/*\n * It's important for performance to transmit secret's size (when it's static)\n * so that the compiler can properly optimize the vectorized loop.\n * This makes a big performance difference for \"medium\" keys (<1 KB) when using AVX instruction set.\n * When the secret size is unknown, or on GCC 12 where the mix of NO_INLINE and FORCE_INLINE\n * breaks -Og, this is XXH_NO_INLINE.\n */\nXXH3_WITH_SECRET_INLINE XXH64_hash_t\nXXH3_hashLong_64b_withSecret(const void* XXH_RESTRICT input, size_t len,\n                             XXH64_hash_t seed64, const xxh_u8* XXH_RESTRICT secret, size_t secretLen)\n{\n    (void)seed64;\n    return XXH3_hashLong_64b_internal(input, len, secret, secretLen, XXH3_accumulate, XXH3_scrambleAcc);\n}\n\n/*\n * It's preferable for performance that XXH3_hashLong is not inlined,\n * as it results in a smaller function for small data, easier to the instruction cache.\n * Note that inside this no_inline function, we do inline the internal loop,\n * and provide a statically defined secret size to allow optimization of vector loop.\n */\nXXH_NO_INLINE XXH_PUREF XXH64_hash_t\nXXH3_hashLong_64b_default(const void* XXH_RESTRICT input, size_t len,\n                          XXH64_hash_t seed64, const xxh_u8* XXH_RESTRICT secret, size_t secretLen)\n{\n    (void)seed64; (void)secret; (void)secretLen;\n    return XXH3_hashLong_64b_internal(input, len, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_accumulate, XXH3_scrambleAcc);\n}\n\n/*\n * XXH3_hashLong_64b_withSeed():\n * Generate a custom key based on alteration of default XXH3_kSecret with the seed,\n * and then use this key for long mode hashing.\n *\n * This operation is decently fast but nonetheless costs a little bit of time.\n * Try to avoid it whenever possible (typically when seed==0).\n *\n * It's important for performance that XXH3_hashLong is not inlined. Not sure\n * why (uop cache maybe?), but the difference is large and easily measurable.\n */\nXXH_FORCE_INLINE XXH64_hash_t\nXXH3_hashLong_64b_withSeed_internal(const void* input, size_t len,\n                                    XXH64_hash_t seed,\n                                    XXH3_f_accumulate f_acc,\n                                    XXH3_f_scrambleAcc f_scramble,\n                                    XXH3_f_initCustomSecret f_initSec)\n{\n#if XXH_SIZE_OPT <= 0\n    if (seed == 0)\n        return XXH3_hashLong_64b_internal(input, len,\n                                          XXH3_kSecret, sizeof(XXH3_kSecret),\n                                          f_acc, f_scramble);\n#endif\n    {   XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE];\n        f_initSec(secret, seed);\n        return XXH3_hashLong_64b_internal(input, len, secret, sizeof(secret),\n                                          f_acc, f_scramble);\n    }\n}\n\n/*\n * It's important for performance that XXH3_hashLong is not inlined.\n */\nXXH_NO_INLINE XXH64_hash_t\nXXH3_hashLong_64b_withSeed(const void* XXH_RESTRICT input, size_t len,\n                           XXH64_hash_t seed, const xxh_u8* XXH_RESTRICT secret, size_t secretLen)\n{\n    (void)secret; (void)secretLen;\n    return XXH3_hashLong_64b_withSeed_internal(input, len, seed,\n                XXH3_accumulate, XXH3_scrambleAcc, XXH3_initCustomSecret);\n}\n\n\ntypedef XXH64_hash_t (*XXH3_hashLong64_f)(const void* XXH_RESTRICT, size_t,\n                                          XXH64_hash_t, const xxh_u8* XXH_RESTRICT, size_t);\n\nXXH_FORCE_INLINE XXH64_hash_t\nXXH3_64bits_internal(const void* XXH_RESTRICT input, size_t len,\n                     XXH64_hash_t seed64, const void* XXH_RESTRICT secret, size_t secretLen,\n                     XXH3_hashLong64_f f_hashLong)\n{\n    XXH_ASSERT(secretLen >= XXH3_SECRET_SIZE_MIN);\n    /*\n     * If an action is to be taken if `secretLen` condition is not respected,\n     * it should be done here.\n     * For now, it's a contract pre-condition.\n     * Adding a check and a branch here would cost performance at every hash.\n     * Also, note that function signature doesn't offer room to return an error.\n     */\n    if (len <= 16)\n        return XXH3_len_0to16_64b((const xxh_u8*)input, len, (const xxh_u8*)secret, seed64);\n    if (len <= 128)\n        return XXH3_len_17to128_64b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64);\n    if (len <= XXH3_MIDSIZE_MAX)\n        return XXH3_len_129to240_64b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64);\n    return f_hashLong(input, len, seed64, (const xxh_u8*)secret, secretLen);\n}\n\n\n/* ===   Public entry point   === */\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH64_hash_t XXH3_64bits(XXH_NOESCAPE const void* input, size_t length)\n{\n    return XXH3_64bits_internal(input, length, 0, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_default);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH64_hash_t\nXXH3_64bits_withSecret(XXH_NOESCAPE const void* input, size_t length, XXH_NOESCAPE const void* secret, size_t secretSize)\n{\n    return XXH3_64bits_internal(input, length, 0, secret, secretSize, XXH3_hashLong_64b_withSecret);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH64_hash_t\nXXH3_64bits_withSeed(XXH_NOESCAPE const void* input, size_t length, XXH64_hash_t seed)\n{\n    return XXH3_64bits_internal(input, length, seed, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_withSeed);\n}\n\nXXH_PUBLIC_API XXH64_hash_t\nXXH3_64bits_withSecretandSeed(XXH_NOESCAPE const void* input, size_t length, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed)\n{\n    if (length <= XXH3_MIDSIZE_MAX)\n        return XXH3_64bits_internal(input, length, seed, XXH3_kSecret, sizeof(XXH3_kSecret), NULL);\n    return XXH3_hashLong_64b_withSecret(input, length, seed, (const xxh_u8*)secret, secretSize);\n}\n\n\n/* ===   XXH3 streaming   === */\n#ifndef XXH_NO_STREAM\n/*\n * Malloc's a pointer that is always aligned to align.\n *\n * This must be freed with `XXH_alignedFree()`.\n *\n * malloc typically guarantees 16 byte alignment on 64-bit systems and 8 byte\n * alignment on 32-bit. This isn't enough for the 32 byte aligned loads in AVX2\n * or on 32-bit, the 16 byte aligned loads in SSE2 and NEON.\n *\n * This underalignment previously caused a rather obvious crash which went\n * completely unnoticed due to XXH3_createState() not actually being tested.\n * Credit to RedSpah for noticing this bug.\n *\n * The alignment is done manually: Functions like posix_memalign or _mm_malloc\n * are avoided: To maintain portability, we would have to write a fallback\n * like this anyways, and besides, testing for the existence of library\n * functions without relying on external build tools is impossible.\n *\n * The method is simple: Overallocate, manually align, and store the offset\n * to the original behind the returned pointer.\n *\n * Align must be a power of 2 and 8 <= align <= 128.\n */\nstatic XXH_MALLOCF void* XXH_alignedMalloc(size_t s, size_t align)\n{\n    XXH_ASSERT(align <= 128 && align >= 8); /* range check */\n    XXH_ASSERT((align & (align-1)) == 0);   /* power of 2 */\n    XXH_ASSERT(s != 0 && s < (s + align));  /* empty/overflow */\n    {   /* Overallocate to make room for manual realignment and an offset byte */\n        xxh_u8* base = (xxh_u8*)XXH_malloc(s + align);\n        if (base != NULL) {\n            /*\n             * Get the offset needed to align this pointer.\n             *\n             * Even if the returned pointer is aligned, there will always be\n             * at least one byte to store the offset to the original pointer.\n             */\n            size_t offset = align - ((size_t)base & (align - 1)); /* base % align */\n            /* Add the offset for the now-aligned pointer */\n            xxh_u8* ptr = base + offset;\n\n            XXH_ASSERT((size_t)ptr % align == 0);\n\n            /* Store the offset immediately before the returned pointer. */\n            ptr[-1] = (xxh_u8)offset;\n            return ptr;\n        }\n        return NULL;\n    }\n}\n/*\n * Frees an aligned pointer allocated by XXH_alignedMalloc(). Don't pass\n * normal malloc'd pointers, XXH_alignedMalloc has a specific data layout.\n */\nstatic void XXH_alignedFree(void* p)\n{\n    if (p != NULL) {\n        xxh_u8* ptr = (xxh_u8*)p;\n        /* Get the offset byte we added in XXH_malloc. */\n        xxh_u8 offset = ptr[-1];\n        /* Free the original malloc'd pointer */\n        xxh_u8* base = ptr - offset;\n        XXH_free(base);\n    }\n}\n/*! @ingroup XXH3_family */\n/*!\n * @brief Allocate an @ref XXH3_state_t.\n *\n * @return An allocated pointer of @ref XXH3_state_t on success.\n * @return `NULL` on failure.\n *\n * @note Must be freed with XXH3_freeState().\n */\nXXH_PUBLIC_API XXH3_state_t* XXH3_createState(void)\n{\n    XXH3_state_t* const state = (XXH3_state_t*)XXH_alignedMalloc(sizeof(XXH3_state_t), 64);\n    if (state==NULL) return NULL;\n    XXH3_INITSTATE(state);\n    return state;\n}\n\n/*! @ingroup XXH3_family */\n/*!\n * @brief Frees an @ref XXH3_state_t.\n *\n * @param statePtr A pointer to an @ref XXH3_state_t allocated with @ref XXH3_createState().\n *\n * @return @ref XXH_OK.\n *\n * @note Must be allocated with XXH3_createState().\n */\nXXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr)\n{\n    XXH_alignedFree(statePtr);\n    return XXH_OK;\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API void\nXXH3_copyState(XXH_NOESCAPE XXH3_state_t* dst_state, XXH_NOESCAPE const XXH3_state_t* src_state)\n{\n    XXH_memcpy(dst_state, src_state, sizeof(*dst_state));\n}\n\nstatic void\nXXH3_reset_internal(XXH3_state_t* statePtr,\n                    XXH64_hash_t seed,\n                    const void* secret, size_t secretSize)\n{\n    size_t const initStart = offsetof(XXH3_state_t, bufferedSize);\n    size_t const initLength = offsetof(XXH3_state_t, nbStripesPerBlock) - initStart;\n    XXH_ASSERT(offsetof(XXH3_state_t, nbStripesPerBlock) > initStart);\n    XXH_ASSERT(statePtr != NULL);\n    /* set members from bufferedSize to nbStripesPerBlock (excluded) to 0 */\n    memset((char*)statePtr + initStart, 0, initLength);\n    statePtr->acc[0] = XXH_PRIME32_3;\n    statePtr->acc[1] = XXH_PRIME64_1;\n    statePtr->acc[2] = XXH_PRIME64_2;\n    statePtr->acc[3] = XXH_PRIME64_3;\n    statePtr->acc[4] = XXH_PRIME64_4;\n    statePtr->acc[5] = XXH_PRIME32_2;\n    statePtr->acc[6] = XXH_PRIME64_5;\n    statePtr->acc[7] = XXH_PRIME32_1;\n    statePtr->seed = seed;\n    statePtr->useSeed = (seed != 0);\n    statePtr->extSecret = (const unsigned char*)secret;\n    XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN);\n    statePtr->secretLimit = secretSize - XXH_STRIPE_LEN;\n    statePtr->nbStripesPerBlock = statePtr->secretLimit / XXH_SECRET_CONSUME_RATE;\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_64bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr)\n{\n    if (statePtr == NULL) return XXH_ERROR;\n    XXH3_reset_internal(statePtr, 0, XXH3_kSecret, XXH_SECRET_DEFAULT_SIZE);\n    return XXH_OK;\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_64bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize)\n{\n    if (statePtr == NULL) return XXH_ERROR;\n    XXH3_reset_internal(statePtr, 0, secret, secretSize);\n    if (secret == NULL) return XXH_ERROR;\n    if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR;\n    return XXH_OK;\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_64bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed)\n{\n    if (statePtr == NULL) return XXH_ERROR;\n    if (seed==0) return XXH3_64bits_reset(statePtr);\n    if ((seed != statePtr->seed) || (statePtr->extSecret != NULL))\n        XXH3_initCustomSecret(statePtr->customSecret, seed);\n    XXH3_reset_internal(statePtr, seed, NULL, XXH_SECRET_DEFAULT_SIZE);\n    return XXH_OK;\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_64bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed64)\n{\n    if (statePtr == NULL) return XXH_ERROR;\n    if (secret == NULL) return XXH_ERROR;\n    if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR;\n    XXH3_reset_internal(statePtr, seed64, secret, secretSize);\n    statePtr->useSeed = 1; /* always, even if seed64==0 */\n    return XXH_OK;\n}\n\n/*!\n * @internal\n * @brief Processes a large input for XXH3_update() and XXH3_digest_long().\n *\n * Unlike XXH3_hashLong_internal_loop(), this can process data that overlaps a block.\n *\n * @param acc                Pointer to the 8 accumulator lanes\n * @param nbStripesSoFarPtr  In/out pointer to the number of leftover stripes in the block*\n * @param nbStripesPerBlock  Number of stripes in a block\n * @param input              Input pointer\n * @param nbStripes          Number of stripes to process\n * @param secret             Secret pointer\n * @param secretLimit        Offset of the last block in @p secret\n * @param f_acc              Pointer to an XXH3_accumulate implementation\n * @param f_scramble         Pointer to an XXH3_scrambleAcc implementation\n * @return                   Pointer past the end of @p input after processing\n */\nXXH_FORCE_INLINE const xxh_u8 *\nXXH3_consumeStripes(xxh_u64* XXH_RESTRICT acc,\n                    size_t* XXH_RESTRICT nbStripesSoFarPtr, size_t nbStripesPerBlock,\n                    const xxh_u8* XXH_RESTRICT input, size_t nbStripes,\n                    const xxh_u8* XXH_RESTRICT secret, size_t secretLimit,\n                    XXH3_f_accumulate f_acc,\n                    XXH3_f_scrambleAcc f_scramble)\n{\n    const xxh_u8* initialSecret = secret + *nbStripesSoFarPtr * XXH_SECRET_CONSUME_RATE;\n    /* Process full blocks */\n    if (nbStripes >= (nbStripesPerBlock - *nbStripesSoFarPtr)) {\n        /* Process the initial partial block... */\n        size_t nbStripesThisIter = nbStripesPerBlock - *nbStripesSoFarPtr;\n\n        do {\n            /* Accumulate and scramble */\n            f_acc(acc, input, initialSecret, nbStripesThisIter);\n            f_scramble(acc, secret + secretLimit);\n            input += nbStripesThisIter * XXH_STRIPE_LEN;\n            nbStripes -= nbStripesThisIter;\n            /* Then continue the loop with the full block size */\n            nbStripesThisIter = nbStripesPerBlock;\n            initialSecret = secret;\n        } while (nbStripes >= nbStripesPerBlock);\n        *nbStripesSoFarPtr = 0;\n    }\n    /* Process a partial block */\n    if (nbStripes > 0) {\n        f_acc(acc, input, initialSecret, nbStripes);\n        input += nbStripes * XXH_STRIPE_LEN;\n        *nbStripesSoFarPtr += nbStripes;\n    }\n    /* Return end pointer */\n    return input;\n}\n\n#ifndef XXH3_STREAM_USE_STACK\n# if XXH_SIZE_OPT <= 0 && !defined(__clang__) /* clang doesn't need additional stack space */\n#   define XXH3_STREAM_USE_STACK 1\n# endif\n#endif\n/*\n * Both XXH3_64bits_update and XXH3_128bits_update use this routine.\n */\nXXH_FORCE_INLINE XXH_errorcode\nXXH3_update(XXH3_state_t* XXH_RESTRICT const state,\n            const xxh_u8* XXH_RESTRICT input, size_t len,\n            XXH3_f_accumulate f_acc,\n            XXH3_f_scrambleAcc f_scramble)\n{\n    if (input==NULL) {\n        XXH_ASSERT(len == 0);\n        return XXH_OK;\n    }\n\n    XXH_ASSERT(state != NULL);\n    {   const xxh_u8* const bEnd = input + len;\n        const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extSecret;\n#if defined(XXH3_STREAM_USE_STACK) && XXH3_STREAM_USE_STACK >= 1\n        /* For some reason, gcc and MSVC seem to suffer greatly\n         * when operating accumulators directly into state.\n         * Operating into stack space seems to enable proper optimization.\n         * clang, on the other hand, doesn't seem to need this trick */\n        XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[8];\n        XXH_memcpy(acc, state->acc, sizeof(acc));\n#else\n        xxh_u64* XXH_RESTRICT const acc = state->acc;\n#endif\n        state->totalLen += len;\n        XXH_ASSERT(state->bufferedSize <= XXH3_INTERNALBUFFER_SIZE);\n\n        /* small input : just fill in tmp buffer */\n        if (len <= XXH3_INTERNALBUFFER_SIZE - state->bufferedSize) {\n            XXH_memcpy(state->buffer + state->bufferedSize, input, len);\n            state->bufferedSize += (XXH32_hash_t)len;\n            return XXH_OK;\n        }\n\n        /* total input is now > XXH3_INTERNALBUFFER_SIZE */\n        #define XXH3_INTERNALBUFFER_STRIPES (XXH3_INTERNALBUFFER_SIZE / XXH_STRIPE_LEN)\n        XXH_STATIC_ASSERT(XXH3_INTERNALBUFFER_SIZE % XXH_STRIPE_LEN == 0);   /* clean multiple */\n\n        /*\n         * Internal buffer is partially filled (always, except at beginning)\n         * Complete it, then consume it.\n         */\n        if (state->bufferedSize) {\n            size_t const loadSize = XXH3_INTERNALBUFFER_SIZE - state->bufferedSize;\n            XXH_memcpy(state->buffer + state->bufferedSize, input, loadSize);\n            input += loadSize;\n            XXH3_consumeStripes(acc,\n                               &state->nbStripesSoFar, state->nbStripesPerBlock,\n                                state->buffer, XXH3_INTERNALBUFFER_STRIPES,\n                                secret, state->secretLimit,\n                                f_acc, f_scramble);\n            state->bufferedSize = 0;\n        }\n        XXH_ASSERT(input < bEnd);\n        if (bEnd - input > XXH3_INTERNALBUFFER_SIZE) {\n            size_t nbStripes = (size_t)(bEnd - 1 - input) / XXH_STRIPE_LEN;\n            input = XXH3_consumeStripes(acc,\n                                       &state->nbStripesSoFar, state->nbStripesPerBlock,\n                                       input, nbStripes,\n                                       secret, state->secretLimit,\n                                       f_acc, f_scramble);\n            XXH_memcpy(state->buffer + sizeof(state->buffer) - XXH_STRIPE_LEN, input - XXH_STRIPE_LEN, XXH_STRIPE_LEN);\n\n        }\n        /* Some remaining input (always) : buffer it */\n        XXH_ASSERT(input < bEnd);\n        XXH_ASSERT(bEnd - input <= XXH3_INTERNALBUFFER_SIZE);\n        XXH_ASSERT(state->bufferedSize == 0);\n        XXH_memcpy(state->buffer, input, (size_t)(bEnd-input));\n        state->bufferedSize = (XXH32_hash_t)(bEnd-input);\n#if defined(XXH3_STREAM_USE_STACK) && XXH3_STREAM_USE_STACK >= 1\n        /* save stack accumulators into state */\n        XXH_memcpy(state->acc, acc, sizeof(acc));\n#endif\n    }\n\n    return XXH_OK;\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_64bits_update(XXH_NOESCAPE XXH3_state_t* state, XXH_NOESCAPE const void* input, size_t len)\n{\n    return XXH3_update(state, (const xxh_u8*)input, len,\n                       XXH3_accumulate, XXH3_scrambleAcc);\n}\n\n\nXXH_FORCE_INLINE void\nXXH3_digest_long (XXH64_hash_t* acc,\n                  const XXH3_state_t* state,\n                  const unsigned char* secret)\n{\n    xxh_u8 lastStripe[XXH_STRIPE_LEN];\n    const xxh_u8* lastStripePtr;\n\n    /*\n     * Digest on a local copy. This way, the state remains unaltered, and it can\n     * continue ingesting more input afterwards.\n     */\n    XXH_memcpy(acc, state->acc, sizeof(state->acc));\n    if (state->bufferedSize >= XXH_STRIPE_LEN) {\n        /* Consume remaining stripes then point to remaining data in buffer */\n        size_t const nbStripes = (state->bufferedSize - 1) / XXH_STRIPE_LEN;\n        size_t nbStripesSoFar = state->nbStripesSoFar;\n        XXH3_consumeStripes(acc,\n                           &nbStripesSoFar, state->nbStripesPerBlock,\n                            state->buffer, nbStripes,\n                            secret, state->secretLimit,\n                            XXH3_accumulate, XXH3_scrambleAcc);\n        lastStripePtr = state->buffer + state->bufferedSize - XXH_STRIPE_LEN;\n    } else {  /* bufferedSize < XXH_STRIPE_LEN */\n        /* Copy to temp buffer */\n        size_t const catchupSize = XXH_STRIPE_LEN - state->bufferedSize;\n        XXH_ASSERT(state->bufferedSize > 0);  /* there is always some input buffered */\n        XXH_memcpy(lastStripe, state->buffer + sizeof(state->buffer) - catchupSize, catchupSize);\n        XXH_memcpy(lastStripe + catchupSize, state->buffer, state->bufferedSize);\n        lastStripePtr = lastStripe;\n    }\n    /* Last stripe */\n    XXH3_accumulate_512(acc,\n                        lastStripePtr,\n                        secret + state->secretLimit - XXH_SECRET_LASTACC_START);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (XXH_NOESCAPE const XXH3_state_t* state)\n{\n    const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extSecret;\n    if (state->totalLen > XXH3_MIDSIZE_MAX) {\n        XXH_ALIGN(XXH_ACC_ALIGN) XXH64_hash_t acc[XXH_ACC_NB];\n        XXH3_digest_long(acc, state, secret);\n        return XXH3_mergeAccs(acc,\n                              secret + XXH_SECRET_MERGEACCS_START,\n                              (xxh_u64)state->totalLen * XXH_PRIME64_1);\n    }\n    /* totalLen <= XXH3_MIDSIZE_MAX: digesting a short input */\n    if (state->useSeed)\n        return XXH3_64bits_withSeed(state->buffer, (size_t)state->totalLen, state->seed);\n    return XXH3_64bits_withSecret(state->buffer, (size_t)(state->totalLen),\n                                  secret, state->secretLimit + XXH_STRIPE_LEN);\n}\n#endif /* !XXH_NO_STREAM */\n\n\n/* ==========================================\n * XXH3 128 bits (a.k.a XXH128)\n * ==========================================\n * XXH3's 128-bit variant has better mixing and strength than the 64-bit variant,\n * even without counting the significantly larger output size.\n *\n * For example, extra steps are taken to avoid the seed-dependent collisions\n * in 17-240 byte inputs (See XXH3_mix16B and XXH128_mix32B).\n *\n * This strength naturally comes at the cost of some speed, especially on short\n * lengths. Note that longer hashes are about as fast as the 64-bit version\n * due to it using only a slight modification of the 64-bit loop.\n *\n * XXH128 is also more oriented towards 64-bit machines. It is still extremely\n * fast for a _128-bit_ hash on 32-bit (it usually clears XXH64).\n */\n\nXXH_FORCE_INLINE XXH_PUREF XXH128_hash_t\nXXH3_len_1to3_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)\n{\n    /* A doubled version of 1to3_64b with different constants. */\n    XXH_ASSERT(input != NULL);\n    XXH_ASSERT(1 <= len && len <= 3);\n    XXH_ASSERT(secret != NULL);\n    /*\n     * len = 1: combinedl = { input[0], 0x01, input[0], input[0] }\n     * len = 2: combinedl = { input[1], 0x02, input[0], input[1] }\n     * len = 3: combinedl = { input[2], 0x03, input[0], input[1] }\n     */\n    {   xxh_u8 const c1 = input[0];\n        xxh_u8 const c2 = input[len >> 1];\n        xxh_u8 const c3 = input[len - 1];\n        xxh_u32 const combinedl = ((xxh_u32)c1 <<16) | ((xxh_u32)c2 << 24)\n                                | ((xxh_u32)c3 << 0) | ((xxh_u32)len << 8);\n        xxh_u32 const combinedh = XXH_rotl32(XXH_swap32(combinedl), 13);\n        xxh_u64 const bitflipl = (XXH_readLE32(secret) ^ XXH_readLE32(secret+4)) + seed;\n        xxh_u64 const bitfliph = (XXH_readLE32(secret+8) ^ XXH_readLE32(secret+12)) - seed;\n        xxh_u64 const keyed_lo = (xxh_u64)combinedl ^ bitflipl;\n        xxh_u64 const keyed_hi = (xxh_u64)combinedh ^ bitfliph;\n        XXH128_hash_t h128;\n        h128.low64  = XXH64_avalanche(keyed_lo);\n        h128.high64 = XXH64_avalanche(keyed_hi);\n        return h128;\n    }\n}\n\nXXH_FORCE_INLINE XXH_PUREF XXH128_hash_t\nXXH3_len_4to8_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)\n{\n    XXH_ASSERT(input != NULL);\n    XXH_ASSERT(secret != NULL);\n    XXH_ASSERT(4 <= len && len <= 8);\n    seed ^= (xxh_u64)XXH_swap32((xxh_u32)seed) << 32;\n    {   xxh_u32 const input_lo = XXH_readLE32(input);\n        xxh_u32 const input_hi = XXH_readLE32(input + len - 4);\n        xxh_u64 const input_64 = input_lo + ((xxh_u64)input_hi << 32);\n        xxh_u64 const bitflip = (XXH_readLE64(secret+16) ^ XXH_readLE64(secret+24)) + seed;\n        xxh_u64 const keyed = input_64 ^ bitflip;\n\n        /* Shift len to the left to ensure it is even, this avoids even multiplies. */\n        XXH128_hash_t m128 = XXH_mult64to128(keyed, XXH_PRIME64_1 + (len << 2));\n\n        m128.high64 += (m128.low64 << 1);\n        m128.low64  ^= (m128.high64 >> 3);\n\n        m128.low64   = XXH_xorshift64(m128.low64, 35);\n        m128.low64  *= PRIME_MX2;\n        m128.low64   = XXH_xorshift64(m128.low64, 28);\n        m128.high64  = XXH3_avalanche(m128.high64);\n        return m128;\n    }\n}\n\nXXH_FORCE_INLINE XXH_PUREF XXH128_hash_t\nXXH3_len_9to16_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)\n{\n    XXH_ASSERT(input != NULL);\n    XXH_ASSERT(secret != NULL);\n    XXH_ASSERT(9 <= len && len <= 16);\n    {   xxh_u64 const bitflipl = (XXH_readLE64(secret+32) ^ XXH_readLE64(secret+40)) - seed;\n        xxh_u64 const bitfliph = (XXH_readLE64(secret+48) ^ XXH_readLE64(secret+56)) + seed;\n        xxh_u64 const input_lo = XXH_readLE64(input);\n        xxh_u64       input_hi = XXH_readLE64(input + len - 8);\n        XXH128_hash_t m128 = XXH_mult64to128(input_lo ^ input_hi ^ bitflipl, XXH_PRIME64_1);\n        /*\n         * Put len in the middle of m128 to ensure that the length gets mixed to\n         * both the low and high bits in the 128x64 multiply below.\n         */\n        m128.low64 += (xxh_u64)(len - 1) << 54;\n        input_hi   ^= bitfliph;\n        /*\n         * Add the high 32 bits of input_hi to the high 32 bits of m128, then\n         * add the long product of the low 32 bits of input_hi and XXH_PRIME32_2 to\n         * the high 64 bits of m128.\n         *\n         * The best approach to this operation is different on 32-bit and 64-bit.\n         */\n        if (sizeof(void *) < sizeof(xxh_u64)) { /* 32-bit */\n            /*\n             * 32-bit optimized version, which is more readable.\n             *\n             * On 32-bit, it removes an ADC and delays a dependency between the two\n             * halves of m128.high64, but it generates an extra mask on 64-bit.\n             */\n            m128.high64 += (input_hi & 0xFFFFFFFF00000000ULL) + XXH_mult32to64((xxh_u32)input_hi, XXH_PRIME32_2);\n        } else {\n            /*\n             * 64-bit optimized (albeit more confusing) version.\n             *\n             * Uses some properties of addition and multiplication to remove the mask:\n             *\n             * Let:\n             *    a = input_hi.lo = (input_hi & 0x00000000FFFFFFFF)\n             *    b = input_hi.hi = (input_hi & 0xFFFFFFFF00000000)\n             *    c = XXH_PRIME32_2\n             *\n             *    a + (b * c)\n             * Inverse Property: x + y - x == y\n             *    a + (b * (1 + c - 1))\n             * Distributive Property: x * (y + z) == (x * y) + (x * z)\n             *    a + (b * 1) + (b * (c - 1))\n             * Identity Property: x * 1 == x\n             *    a + b + (b * (c - 1))\n             *\n             * Substitute a, b, and c:\n             *    input_hi.hi + input_hi.lo + ((xxh_u64)input_hi.lo * (XXH_PRIME32_2 - 1))\n             *\n             * Since input_hi.hi + input_hi.lo == input_hi, we get this:\n             *    input_hi + ((xxh_u64)input_hi.lo * (XXH_PRIME32_2 - 1))\n             */\n            m128.high64 += input_hi + XXH_mult32to64((xxh_u32)input_hi, XXH_PRIME32_2 - 1);\n        }\n        /* m128 ^= XXH_swap64(m128 >> 64); */\n        m128.low64  ^= XXH_swap64(m128.high64);\n\n        {   /* 128x64 multiply: h128 = m128 * XXH_PRIME64_2; */\n            XXH128_hash_t h128 = XXH_mult64to128(m128.low64, XXH_PRIME64_2);\n            h128.high64 += m128.high64 * XXH_PRIME64_2;\n\n            h128.low64   = XXH3_avalanche(h128.low64);\n            h128.high64  = XXH3_avalanche(h128.high64);\n            return h128;\n    }   }\n}\n\n/*\n * Assumption: `secret` size is >= XXH3_SECRET_SIZE_MIN\n */\nXXH_FORCE_INLINE XXH_PUREF XXH128_hash_t\nXXH3_len_0to16_128b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_hash_t seed)\n{\n    XXH_ASSERT(len <= 16);\n    {   if (len > 8) return XXH3_len_9to16_128b(input, len, secret, seed);\n        if (len >= 4) return XXH3_len_4to8_128b(input, len, secret, seed);\n        if (len) return XXH3_len_1to3_128b(input, len, secret, seed);\n        {   XXH128_hash_t h128;\n            xxh_u64 const bitflipl = XXH_readLE64(secret+64) ^ XXH_readLE64(secret+72);\n            xxh_u64 const bitfliph = XXH_readLE64(secret+80) ^ XXH_readLE64(secret+88);\n            h128.low64 = XXH64_avalanche(seed ^ bitflipl);\n            h128.high64 = XXH64_avalanche( seed ^ bitfliph);\n            return h128;\n    }   }\n}\n\n/*\n * A bit slower than XXH3_mix16B, but handles multiply by zero better.\n */\nXXH_FORCE_INLINE XXH128_hash_t\nXXH128_mix32B(XXH128_hash_t acc, const xxh_u8* input_1, const xxh_u8* input_2,\n              const xxh_u8* secret, XXH64_hash_t seed)\n{\n    acc.low64  += XXH3_mix16B (input_1, secret+0, seed);\n    acc.low64  ^= XXH_readLE64(input_2) + XXH_readLE64(input_2 + 8);\n    acc.high64 += XXH3_mix16B (input_2, secret+16, seed);\n    acc.high64 ^= XXH_readLE64(input_1) + XXH_readLE64(input_1 + 8);\n    return acc;\n}\n\n\nXXH_FORCE_INLINE XXH_PUREF XXH128_hash_t\nXXH3_len_17to128_128b(const xxh_u8* XXH_RESTRICT input, size_t len,\n                      const xxh_u8* XXH_RESTRICT secret, size_t secretSize,\n                      XXH64_hash_t seed)\n{\n    XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize;\n    XXH_ASSERT(16 < len && len <= 128);\n\n    {   XXH128_hash_t acc;\n        acc.low64 = len * XXH_PRIME64_1;\n        acc.high64 = 0;\n\n#if XXH_SIZE_OPT >= 1\n        {\n            /* Smaller, but slightly slower. */\n            unsigned int i = (unsigned int)(len - 1) / 32;\n            do {\n                acc = XXH128_mix32B(acc, input+16*i, input+len-16*(i+1), secret+32*i, seed);\n            } while (i-- != 0);\n        }\n#else\n        if (len > 32) {\n            if (len > 64) {\n                if (len > 96) {\n                    acc = XXH128_mix32B(acc, input+48, input+len-64, secret+96, seed);\n                }\n                acc = XXH128_mix32B(acc, input+32, input+len-48, secret+64, seed);\n            }\n            acc = XXH128_mix32B(acc, input+16, input+len-32, secret+32, seed);\n        }\n        acc = XXH128_mix32B(acc, input, input+len-16, secret, seed);\n#endif\n        {   XXH128_hash_t h128;\n            h128.low64  = acc.low64 + acc.high64;\n            h128.high64 = (acc.low64    * XXH_PRIME64_1)\n                        + (acc.high64   * XXH_PRIME64_4)\n                        + ((len - seed) * XXH_PRIME64_2);\n            h128.low64  = XXH3_avalanche(h128.low64);\n            h128.high64 = (XXH64_hash_t)0 - XXH3_avalanche(h128.high64);\n            return h128;\n        }\n    }\n}\n\nXXH_NO_INLINE XXH_PUREF XXH128_hash_t\nXXH3_len_129to240_128b(const xxh_u8* XXH_RESTRICT input, size_t len,\n                       const xxh_u8* XXH_RESTRICT secret, size_t secretSize,\n                       XXH64_hash_t seed)\n{\n    XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN); (void)secretSize;\n    XXH_ASSERT(128 < len && len <= XXH3_MIDSIZE_MAX);\n\n    {   XXH128_hash_t acc;\n        unsigned i;\n        acc.low64 = len * XXH_PRIME64_1;\n        acc.high64 = 0;\n        /*\n         *  We set as `i` as offset + 32. We do this so that unchanged\n         * `len` can be used as upper bound. This reaches a sweet spot\n         * where both x86 and aarch64 get simple agen and good codegen\n         * for the loop.\n         */\n        for (i = 32; i < 160; i += 32) {\n            acc = XXH128_mix32B(acc,\n                                input  + i - 32,\n                                input  + i - 16,\n                                secret + i - 32,\n                                seed);\n        }\n        acc.low64 = XXH3_avalanche(acc.low64);\n        acc.high64 = XXH3_avalanche(acc.high64);\n        /*\n         * NB: `i <= len` will duplicate the last 32-bytes if\n         * len % 32 was zero. This is an unfortunate necessity to keep\n         * the hash result stable.\n         */\n        for (i=160; i <= len; i += 32) {\n            acc = XXH128_mix32B(acc,\n                                input + i - 32,\n                                input + i - 16,\n                                secret + XXH3_MIDSIZE_STARTOFFSET + i - 160,\n                                seed);\n        }\n        /* last bytes */\n        acc = XXH128_mix32B(acc,\n                            input + len - 16,\n                            input + len - 32,\n                            secret + XXH3_SECRET_SIZE_MIN - XXH3_MIDSIZE_LASTOFFSET - 16,\n                            (XXH64_hash_t)0 - seed);\n\n        {   XXH128_hash_t h128;\n            h128.low64  = acc.low64 + acc.high64;\n            h128.high64 = (acc.low64    * XXH_PRIME64_1)\n                        + (acc.high64   * XXH_PRIME64_4)\n                        + ((len - seed) * XXH_PRIME64_2);\n            h128.low64  = XXH3_avalanche(h128.low64);\n            h128.high64 = (XXH64_hash_t)0 - XXH3_avalanche(h128.high64);\n            return h128;\n        }\n    }\n}\n\nXXH_FORCE_INLINE XXH128_hash_t\nXXH3_hashLong_128b_internal(const void* XXH_RESTRICT input, size_t len,\n                            const xxh_u8* XXH_RESTRICT secret, size_t secretSize,\n                            XXH3_f_accumulate f_acc,\n                            XXH3_f_scrambleAcc f_scramble)\n{\n    XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[XXH_ACC_NB] = XXH3_INIT_ACC;\n\n    XXH3_hashLong_internal_loop(acc, (const xxh_u8*)input, len, secret, secretSize, f_acc, f_scramble);\n\n    /* converge into final hash */\n    XXH_STATIC_ASSERT(sizeof(acc) == 64);\n    XXH_ASSERT(secretSize >= sizeof(acc) + XXH_SECRET_MERGEACCS_START);\n    {   XXH128_hash_t h128;\n        h128.low64  = XXH3_mergeAccs(acc,\n                                     secret + XXH_SECRET_MERGEACCS_START,\n                                     (xxh_u64)len * XXH_PRIME64_1);\n        h128.high64 = XXH3_mergeAccs(acc,\n                                     secret + secretSize\n                                            - sizeof(acc) - XXH_SECRET_MERGEACCS_START,\n                                     ~((xxh_u64)len * XXH_PRIME64_2));\n        return h128;\n    }\n}\n\n/*\n * It's important for performance that XXH3_hashLong() is not inlined.\n */\nXXH_NO_INLINE XXH_PUREF XXH128_hash_t\nXXH3_hashLong_128b_default(const void* XXH_RESTRICT input, size_t len,\n                           XXH64_hash_t seed64,\n                           const void* XXH_RESTRICT secret, size_t secretLen)\n{\n    (void)seed64; (void)secret; (void)secretLen;\n    return XXH3_hashLong_128b_internal(input, len, XXH3_kSecret, sizeof(XXH3_kSecret),\n                                       XXH3_accumulate, XXH3_scrambleAcc);\n}\n\n/*\n * It's important for performance to pass @p secretLen (when it's static)\n * to the compiler, so that it can properly optimize the vectorized loop.\n *\n * When the secret size is unknown, or on GCC 12 where the mix of NO_INLINE and FORCE_INLINE\n * breaks -Og, this is XXH_NO_INLINE.\n */\nXXH3_WITH_SECRET_INLINE XXH128_hash_t\nXXH3_hashLong_128b_withSecret(const void* XXH_RESTRICT input, size_t len,\n                              XXH64_hash_t seed64,\n                              const void* XXH_RESTRICT secret, size_t secretLen)\n{\n    (void)seed64;\n    return XXH3_hashLong_128b_internal(input, len, (const xxh_u8*)secret, secretLen,\n                                       XXH3_accumulate, XXH3_scrambleAcc);\n}\n\nXXH_FORCE_INLINE XXH128_hash_t\nXXH3_hashLong_128b_withSeed_internal(const void* XXH_RESTRICT input, size_t len,\n                                XXH64_hash_t seed64,\n                                XXH3_f_accumulate f_acc,\n                                XXH3_f_scrambleAcc f_scramble,\n                                XXH3_f_initCustomSecret f_initSec)\n{\n    if (seed64 == 0)\n        return XXH3_hashLong_128b_internal(input, len,\n                                           XXH3_kSecret, sizeof(XXH3_kSecret),\n                                           f_acc, f_scramble);\n    {   XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE];\n        f_initSec(secret, seed64);\n        return XXH3_hashLong_128b_internal(input, len, (const xxh_u8*)secret, sizeof(secret),\n                                           f_acc, f_scramble);\n    }\n}\n\n/*\n * It's important for performance that XXH3_hashLong is not inlined.\n */\nXXH_NO_INLINE XXH128_hash_t\nXXH3_hashLong_128b_withSeed(const void* input, size_t len,\n                            XXH64_hash_t seed64, const void* XXH_RESTRICT secret, size_t secretLen)\n{\n    (void)secret; (void)secretLen;\n    return XXH3_hashLong_128b_withSeed_internal(input, len, seed64,\n                XXH3_accumulate, XXH3_scrambleAcc, XXH3_initCustomSecret);\n}\n\ntypedef XXH128_hash_t (*XXH3_hashLong128_f)(const void* XXH_RESTRICT, size_t,\n                                            XXH64_hash_t, const void* XXH_RESTRICT, size_t);\n\nXXH_FORCE_INLINE XXH128_hash_t\nXXH3_128bits_internal(const void* input, size_t len,\n                      XXH64_hash_t seed64, const void* XXH_RESTRICT secret, size_t secretLen,\n                      XXH3_hashLong128_f f_hl128)\n{\n    XXH_ASSERT(secretLen >= XXH3_SECRET_SIZE_MIN);\n    /*\n     * If an action is to be taken if `secret` conditions are not respected,\n     * it should be done here.\n     * For now, it's a contract pre-condition.\n     * Adding a check and a branch here would cost performance at every hash.\n     */\n    if (len <= 16)\n        return XXH3_len_0to16_128b((const xxh_u8*)input, len, (const xxh_u8*)secret, seed64);\n    if (len <= 128)\n        return XXH3_len_17to128_128b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64);\n    if (len <= XXH3_MIDSIZE_MAX)\n        return XXH3_len_129to240_128b((const xxh_u8*)input, len, (const xxh_u8*)secret, secretLen, seed64);\n    return f_hl128(input, len, seed64, secret, secretLen);\n}\n\n\n/* ===   Public XXH128 API   === */\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH128_hash_t XXH3_128bits(XXH_NOESCAPE const void* input, size_t len)\n{\n    return XXH3_128bits_internal(input, len, 0,\n                                 XXH3_kSecret, sizeof(XXH3_kSecret),\n                                 XXH3_hashLong_128b_default);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH128_hash_t\nXXH3_128bits_withSecret(XXH_NOESCAPE const void* input, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize)\n{\n    return XXH3_128bits_internal(input, len, 0,\n                                 (const xxh_u8*)secret, secretSize,\n                                 XXH3_hashLong_128b_withSecret);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH128_hash_t\nXXH3_128bits_withSeed(XXH_NOESCAPE const void* input, size_t len, XXH64_hash_t seed)\n{\n    return XXH3_128bits_internal(input, len, seed,\n                                 XXH3_kSecret, sizeof(XXH3_kSecret),\n                                 XXH3_hashLong_128b_withSeed);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH128_hash_t\nXXH3_128bits_withSecretandSeed(XXH_NOESCAPE const void* input, size_t len, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed)\n{\n    if (len <= XXH3_MIDSIZE_MAX)\n        return XXH3_128bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), NULL);\n    return XXH3_hashLong_128b_withSecret(input, len, seed, secret, secretSize);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH128_hash_t\nXXH128(XXH_NOESCAPE const void* input, size_t len, XXH64_hash_t seed)\n{\n    return XXH3_128bits_withSeed(input, len, seed);\n}\n\n\n/* ===   XXH3 128-bit streaming   === */\n#ifndef XXH_NO_STREAM\n/*\n * All initialization and update functions are identical to 64-bit streaming variant.\n * The only difference is the finalization routine.\n */\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_128bits_reset(XXH_NOESCAPE XXH3_state_t* statePtr)\n{\n    return XXH3_64bits_reset(statePtr);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_128bits_reset_withSecret(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize)\n{\n    return XXH3_64bits_reset_withSecret(statePtr, secret, secretSize);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_128bits_reset_withSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH64_hash_t seed)\n{\n    return XXH3_64bits_reset_withSeed(statePtr, seed);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_128bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr, XXH_NOESCAPE const void* secret, size_t secretSize, XXH64_hash_t seed)\n{\n    return XXH3_64bits_reset_withSecretandSeed(statePtr, secret, secretSize, seed);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_128bits_update(XXH_NOESCAPE XXH3_state_t* state, XXH_NOESCAPE const void* input, size_t len)\n{\n    return XXH3_64bits_update(state, input, len);\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH128_hash_t XXH3_128bits_digest (XXH_NOESCAPE const XXH3_state_t* state)\n{\n    const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extSecret;\n    if (state->totalLen > XXH3_MIDSIZE_MAX) {\n        XXH_ALIGN(XXH_ACC_ALIGN) XXH64_hash_t acc[XXH_ACC_NB];\n        XXH3_digest_long(acc, state, secret);\n        XXH_ASSERT(state->secretLimit + XXH_STRIPE_LEN >= sizeof(acc) + XXH_SECRET_MERGEACCS_START);\n        {   XXH128_hash_t h128;\n            h128.low64  = XXH3_mergeAccs(acc,\n                                         secret + XXH_SECRET_MERGEACCS_START,\n                                         (xxh_u64)state->totalLen * XXH_PRIME64_1);\n            h128.high64 = XXH3_mergeAccs(acc,\n                                         secret + state->secretLimit + XXH_STRIPE_LEN\n                                                - sizeof(acc) - XXH_SECRET_MERGEACCS_START,\n                                         ~((xxh_u64)state->totalLen * XXH_PRIME64_2));\n            return h128;\n        }\n    }\n    /* len <= XXH3_MIDSIZE_MAX : short code */\n    if (state->seed)\n        return XXH3_128bits_withSeed(state->buffer, (size_t)state->totalLen, state->seed);\n    return XXH3_128bits_withSecret(state->buffer, (size_t)(state->totalLen),\n                                   secret, state->secretLimit + XXH_STRIPE_LEN);\n}\n#endif /* !XXH_NO_STREAM */\n/* 128-bit utility functions */\n\n#include <string.h>   /* memcmp, memcpy */\n\n/* return : 1 is equal, 0 if different */\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API int XXH128_isEqual(XXH128_hash_t h1, XXH128_hash_t h2)\n{\n    /* note : XXH128_hash_t is compact, it has no padding byte */\n    return !(memcmp(&h1, &h2, sizeof(h1)));\n}\n\n/* This prototype is compatible with stdlib's qsort().\n * @return : >0 if *h128_1  > *h128_2\n *           <0 if *h128_1  < *h128_2\n *           =0 if *h128_1 == *h128_2  */\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API int XXH128_cmp(XXH_NOESCAPE const void* h128_1, XXH_NOESCAPE const void* h128_2)\n{\n    XXH128_hash_t const h1 = *(const XXH128_hash_t*)h128_1;\n    XXH128_hash_t const h2 = *(const XXH128_hash_t*)h128_2;\n    int const hcmp = (h1.high64 > h2.high64) - (h2.high64 > h1.high64);\n    /* note : bets that, in most cases, hash values are different */\n    if (hcmp) return hcmp;\n    return (h1.low64 > h2.low64) - (h2.low64 > h1.low64);\n}\n\n\n/*======   Canonical representation   ======*/\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API void\nXXH128_canonicalFromHash(XXH_NOESCAPE XXH128_canonical_t* dst, XXH128_hash_t hash)\n{\n    XXH_STATIC_ASSERT(sizeof(XXH128_canonical_t) == sizeof(XXH128_hash_t));\n    if (XXH_CPU_LITTLE_ENDIAN) {\n        hash.high64 = XXH_swap64(hash.high64);\n        hash.low64  = XXH_swap64(hash.low64);\n    }\n    XXH_memcpy(dst, &hash.high64, sizeof(hash.high64));\n    XXH_memcpy((char*)dst + sizeof(hash.high64), &hash.low64, sizeof(hash.low64));\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH128_hash_t\nXXH128_hashFromCanonical(XXH_NOESCAPE const XXH128_canonical_t* src)\n{\n    XXH128_hash_t h;\n    h.high64 = XXH_readBE64(src);\n    h.low64  = XXH_readBE64(src->digest + 8);\n    return h;\n}\n\n\n\n/* ==========================================\n * Secret generators\n * ==========================================\n */\n#define XXH_MIN(x, y) (((x) > (y)) ? (y) : (x))\n\nXXH_FORCE_INLINE void XXH3_combine16(void* dst, XXH128_hash_t h128)\n{\n    XXH_writeLE64( dst, XXH_readLE64(dst) ^ h128.low64 );\n    XXH_writeLE64( (char*)dst+8, XXH_readLE64((char*)dst+8) ^ h128.high64 );\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API XXH_errorcode\nXXH3_generateSecret(XXH_NOESCAPE void* secretBuffer, size_t secretSize, XXH_NOESCAPE const void* customSeed, size_t customSeedSize)\n{\n#if (XXH_DEBUGLEVEL >= 1)\n    XXH_ASSERT(secretBuffer != NULL);\n    XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN);\n#else\n    /* production mode, assert() are disabled */\n    if (secretBuffer == NULL) return XXH_ERROR;\n    if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR;\n#endif\n\n    if (customSeedSize == 0) {\n        customSeed = XXH3_kSecret;\n        customSeedSize = XXH_SECRET_DEFAULT_SIZE;\n    }\n#if (XXH_DEBUGLEVEL >= 1)\n    XXH_ASSERT(customSeed != NULL);\n#else\n    if (customSeed == NULL) return XXH_ERROR;\n#endif\n\n    /* Fill secretBuffer with a copy of customSeed - repeat as needed */\n    {   size_t pos = 0;\n        while (pos < secretSize) {\n            size_t const toCopy = XXH_MIN((secretSize - pos), customSeedSize);\n            memcpy((char*)secretBuffer + pos, customSeed, toCopy);\n            pos += toCopy;\n    }   }\n\n    {   size_t const nbSeg16 = secretSize / 16;\n        size_t n;\n        XXH128_canonical_t scrambler;\n        XXH128_canonicalFromHash(&scrambler, XXH128(customSeed, customSeedSize, 0));\n        for (n=0; n<nbSeg16; n++) {\n            XXH128_hash_t const h128 = XXH128(&scrambler, sizeof(scrambler), n);\n            XXH3_combine16((char*)secretBuffer + n*16, h128);\n        }\n        /* last segment */\n        XXH3_combine16((char*)secretBuffer + secretSize - 16, XXH128_hashFromCanonical(&scrambler));\n    }\n    return XXH_OK;\n}\n\n/*! @ingroup XXH3_family */\nXXH_PUBLIC_API void\nXXH3_generateSecret_fromSeed(XXH_NOESCAPE void* secretBuffer, XXH64_hash_t seed)\n{\n    XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE];\n    XXH3_initCustomSecret(secret, seed);\n    XXH_ASSERT(secretBuffer != NULL);\n    memcpy(secretBuffer, secret, XXH_SECRET_DEFAULT_SIZE);\n}\n\n\n\n/* Pop our optimization override from above */\n#if XXH_VECTOR == XXH_AVX2 /* AVX2 */ \\\n  && defined(__GNUC__) && !defined(__clang__) /* GCC, not Clang */ \\\n  && defined(__OPTIMIZE__) && XXH_SIZE_OPT <= 0 /* respect -O0 and -Os */\n#  pragma GCC pop_options\n#endif\n\n#endif  /* XXH_NO_LONG_LONG */\n\n#endif  /* XXH_NO_XXH3 */\n\n/*!\n * @}\n */\n#endif  /* XXH_IMPLEMENTATION */\n\n\n#if defined (__cplusplus)\n} /* extern \"C\" */\n#endif\n"
  },
  {
    "path": "src/bled/xz.h",
    "content": "/*\n * XZ decompressor\n *\n * Authors: Lasse Collin <lasse.collin@tukaani.org>\n *          Igor Pavlov <http://7-zip.org/>\n *\n * This file has been put into the public domain.\n * You can do whatever you want with this file.\n */\n\n#ifndef XZ_H\n#define XZ_H\n\n#ifdef __KERNEL__\n#\tinclude <linux/stddef.h>\n#\tinclude <linux/types.h>\n#else\n#\tinclude <stddef.h>\n#\tinclude <stdint.h>\n#endif\n\n#include \"platform.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* In Linux, this is used to make extern functions static when needed. */\n#ifndef XZ_EXTERN\n#\tdefine XZ_EXTERN extern\n#endif\n\n/* In Linux, this is used to mark the functions with __init when needed. */\n#ifndef XZ_FUNC\n#\tdefine XZ_FUNC\n#endif\n\n/**\n * enum xz_mode - Operation mode\n *\n * @XZ_SINGLE:              Single-call mode. This uses less RAM than\n *                          than multi-call modes, because the LZMA2\n *                          dictionary doesn't need to be allocated as\n *                          part of the decoder state. All required data\n *                          structures are allocated at initialization,\n *                          so xz_dec_run() cannot return XZ_MEM_ERROR.\n * @XZ_PREALLOC:            Multi-call mode with preallocated LZMA2\n *                          dictionary buffer. All data structures are\n *                          allocated at initialization, so xz_dec_run()\n *                          cannot return XZ_MEM_ERROR.\n * @XZ_DYNALLOC:            Multi-call mode. The LZMA2 dictionary is\n *                          allocated once the required size has been\n *                          parsed from the stream headers. If the\n *                          allocation fails, xz_dec_run() will return\n *                          XZ_MEM_ERROR.\n *\n * It is possible to enable support only for a subset of the above\n * modes at compile time by defining XZ_DEC_SINGLE, XZ_DEC_PREALLOC,\n * or XZ_DEC_DYNALLOC. The xz_dec kernel module is always compiled\n * with support for all operation modes, but the preboot code may\n * be built with fewer features to minimize code size.\n */\nenum xz_mode {\n\tXZ_SINGLE,\n\tXZ_PREALLOC,\n\tXZ_DYNALLOC\n};\n\n/**\n * enum xz_ret - Return codes\n * @XZ_OK:                  Everything is OK so far. More input or more\n *                          output space is required to continue. This\n *                          return code is possible only in multi-call mode\n *                          (XZ_PREALLOC or XZ_DYNALLOC).\n * @XZ_STREAM_END:          Operation finished successfully.\n * @XZ_UNSUPPORTED_CHECK:   Integrity check type is not supported. Decoding\n *                          is still possible in multi-call mode by simply\n *                          calling xz_dec_run() again.\n *                          Note that this return value is used only if\n *                          XZ_DEC_ANY_CHECK was defined at build time,\n *                          which is not used in the kernel. Unsupported\n *                          check types return XZ_OPTIONS_ERROR if\n *                          XZ_DEC_ANY_CHECK was not defined at build time.\n * @XZ_MEM_ERROR:           Allocating memory failed. This return code is\n *                          possible only if the decoder was initialized\n *                          with XZ_DYNALLOC. The amount of memory that was\n *                          tried to be allocated was no more than the\n *                          dict_max argument given to xz_dec_init().\n * @XZ_MEMLIMIT_ERROR:      A bigger LZMA2 dictionary would be needed than\n *                          allowed by the dict_max argument given to\n *                          xz_dec_init(). This return value is possible\n *                          only in multi-call mode (XZ_PREALLOC or\n *                          XZ_DYNALLOC); the single-call mode (XZ_SINGLE)\n *                          ignores the dict_max argument.\n * @XZ_FORMAT_ERROR:        File format was not recognized (wrong magic\n *                          bytes).\n * @XZ_OPTIONS_ERROR:       This implementation doesn't support the requested\n *                          compression options. In the decoder this means\n *                          that the header CRC32 matches, but the header\n *                          itself specifies something that we don't support.\n * @XZ_DATA_ERROR:          Compressed data is corrupt.\n * @XZ_BUF_ERROR:           Cannot make any progress. Details are slightly\n *                          different between multi-call and single-call\n *                          mode; more information below.\n *\n * In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls\n * to XZ code cannot consume any input and cannot produce any new output.\n * This happens when there is no new input available, or the output buffer\n * is full while at least one output byte is still pending. Assuming your\n * code is not buggy, you can get this error only when decoding a compressed\n * stream that is truncated or otherwise corrupt.\n *\n * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer\n * is too small or the compressed input is corrupt in a way that makes the\n * decoder produce more output than the caller expected. When it is\n * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR\n * is used instead of XZ_BUF_ERROR.\n */\nenum xz_ret {\n\tXZ_OK,\n\tXZ_STREAM_END,\n\tXZ_UNSUPPORTED_CHECK,\n\tXZ_MEM_ERROR,\n\tXZ_MEMLIMIT_ERROR,\n\tXZ_FORMAT_ERROR,\n\tXZ_OPTIONS_ERROR,\n\tXZ_DATA_ERROR,\n\tXZ_BUF_ERROR,\n\tXZ_BUF_FULL\n};\n\n/**\n * struct xz_buf - Passing input and output buffers to XZ code\n * @in:         Beginning of the input buffer. This may be NULL if and only\n *              if in_pos is equal to in_size.\n * @in_pos:     Current position in the input buffer. This must not exceed\n *              in_size.\n * @in_size:    Size of the input buffer\n * @out:        Beginning of the output buffer. This may be NULL if and only\n *              if out_pos is equal to out_size.\n * @out_pos:    Current position in the output buffer. This must not exceed\n *              out_size.\n * @out_size:   Size of the output buffer\n *\n * Only the contents of the output buffer from out[out_pos] onward, and\n * the variables in_pos and out_pos are modified by the XZ code.\n */\nstruct xz_buf {\n\tconst uint8_t *in;\n\tsize_t in_pos;\n\tsize_t in_size;\n\n\tuint8_t *out;\n\tsize_t out_pos;\n\tsize_t out_size;\n};\n\n/**\n * struct xz_dec - Opaque type to hold the XZ decoder state\n */\nstruct xz_dec;\n\n/**\n * xz_dec_init() - Allocate and initialize a XZ decoder state\n * @mode:       Operation mode\n * @dict_max:   Maximum size of the LZMA2 dictionary (history buffer) for\n *              multi-call decoding. This is ignored in single-call mode\n *              (mode == XZ_SINGLE). LZMA2 dictionary is always 2^n bytes\n *              or 2^n + 2^(n-1) bytes (the latter sizes are less common\n *              in practice), so other values for dict_max don't make sense.\n *              In the kernel, dictionary sizes of 64 KiB, 128 KiB, 256 KiB,\n *              512 KiB, and 1 MiB are probably the only reasonable values,\n *              except for kernel and initramfs images where a bigger\n *              dictionary can be fine and useful.\n *\n * Single-call mode (XZ_SINGLE): xz_dec_run() decodes the whole stream at\n * once. The caller must provide enough output space or the decoding will\n * fail. The output space is used as the dictionary buffer, which is why\n * there is no need to allocate the dictionary as part of the decoder's\n * internal state.\n *\n * Because the output buffer is used as the workspace, streams encoded using\n * a big dictionary are not a problem in single-call mode. It is enough that\n * the output buffer is big enough to hold the actual uncompressed data; it\n * can be smaller than the dictionary size stored in the stream headers.\n *\n * Multi-call mode with preallocated dictionary (XZ_PREALLOC): dict_max bytes\n * of memory is preallocated for the LZMA2 dictionary. This way there is no\n * risk that xz_dec_run() could run out of memory, since xz_dec_run() will\n * never allocate any memory. Instead, if the preallocated dictionary is too\n * small for decoding the given input stream, xz_dec_run() will return\n * XZ_MEMLIMIT_ERROR. Thus, it is important to know what kind of data will be\n * decoded to avoid allocating excessive amount of memory for the dictionary.\n *\n * Multi-call mode with dynamically allocated dictionary (XZ_DYNALLOC):\n * dict_max specifies the maximum allowed dictionary size that xz_dec_run()\n * may allocate once it has parsed the dictionary size from the stream\n * headers. This way excessive allocations can be avoided while still\n * limiting the maximum memory usage to a sane value to prevent running the\n * system out of memory when decompressing streams from untrusted sources.\n *\n * On success, xz_dec_init() returns a pointer to struct xz_dec, which is\n * ready to be used with xz_dec_run(). If memory allocation fails,\n * xz_dec_init() returns NULL.\n */\nXZ_EXTERN struct xz_dec * XZ_FUNC xz_dec_init(\n\t\tenum xz_mode mode, uint32_t dict_max);\n\n/**\n * xz_dec_run() - Run the XZ decoder\n * @s:          Decoder state allocated using xz_dec_init()\n * @b:          Input and output buffers\n *\n * The possible return values depend on build options and operation mode.\n * See enum xz_ret for details.\n *\n * Note that if an error occurs in single-call mode (return value is not\n * XZ_STREAM_END), b->in_pos and b->out_pos are not modified and the\n * contents of the output buffer from b->out[b->out_pos] onward are\n * undefined. This is true even after XZ_BUF_ERROR, because with some filter\n * chains, there may be a second pass over the output buffer, and this pass\n * cannot be properly done if the output buffer is truncated. Thus, you\n * cannot give the single-call decoder a too small buffer and then expect to\n * get that amount valid data from the beginning of the stream. You must use\n * the multi-call decoder if you don't want to uncompress the whole stream.\n */\nXZ_EXTERN enum xz_ret XZ_FUNC xz_dec_run(struct xz_dec *s, struct xz_buf *b);\n\n/**\n * xz_dec_reset() - Reset an already allocated decoder state\n * @s:          Decoder state allocated using xz_dec_init()\n *\n * This function can be used to reset the multi-call decoder state without\n * freeing and reallocating memory with xz_dec_end() and xz_dec_init().\n *\n * In single-call mode, xz_dec_reset() is always called in the beginning of\n * xz_dec_run(). Thus, explicit call to xz_dec_reset() is useful only in\n * multi-call mode.\n */\nXZ_EXTERN void XZ_FUNC xz_dec_reset(struct xz_dec *s);\n\n/**\n * xz_dec_end() - Free the memory allocated for the decoder state\n * @s:          Decoder state allocated using xz_dec_init(). If s is NULL,\n *              this function does nothing.\n */\nXZ_EXTERN void XZ_FUNC xz_dec_end(struct xz_dec *s);\n\n/*\n * Standalone build (userspace build or in-kernel build for boot time use)\n * needs a CRC32 implementation. For normal in-kernel use, kernel's own\n * CRC32 module is used instead, and users of this module don't need to\n * care about the functions below.\n */\n#ifndef XZ_INTERNAL_CRC32\n#\tifdef __KERNEL__\n#\t\tdefine XZ_INTERNAL_CRC32 0\n#\telse\n#\t\tdefine XZ_INTERNAL_CRC32 1\n#\tendif\n#endif\n\n#if XZ_INTERNAL_CRC32\n/*\n * This must be called before any other xz_* function to initialize\n * the CRC32 lookup table.\n */\nXZ_EXTERN void XZ_FUNC xz_crc32_init(void);\n\n/*\n * Update CRC32 value using the polynomial from IEEE-802.3. To start a new\n * calculation, the third argument must be zero. To continue the calculation,\n * the previously returned value is passed as the third argument.\n */\nXZ_EXTERN uint32_t XZ_FUNC xz_crc32(\n\t\tconst uint8_t *buf, size_t size, uint32_t crc);\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "src/bled/xz_config.h",
    "content": "/*\n * Private includes and definitions for userspace use of XZ Embedded\n *\n * Author: Lasse Collin <lasse.collin@tukaani.org>\n *\n * This file has been put into the public domain.\n * You can do whatever you want with this file.\n */\n\n#ifndef XZ_CONFIG_H\n#define XZ_CONFIG_H\n\n// We get XZ_OPTIONS_ERROR in xz_dec_stream if this is not defined\n#define XZ_DEC_ANY_CHECK\n\n/* Uncomment as needed to enable BCJ filter decoders. */\n#if defined(_M_AMD64) || defined(__x86_64__) || defined(_M_IX86) || defined(__i386__)\n#define XZ_DEC_X86\n#endif\n/* #define XZ_DEC_POWERPC */\n/* #define XZ_DEC_IA64 */\n#if defined (_M_ARM) || defined(__arm__) || defined (_M_ARM64) || defined(__aarch64__)\n#define XZ_DEC_ARM\n#endif\n/* #define XZ_DEC_ARMTHUMB */\n/* #define XZ_DEC_SPARC */\n\n#include <stdbool.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"xz.h\"\n\n#define kmalloc(size, flags) malloc(size)\n#define kfree(ptr) free(ptr)\n#define vmalloc(size) malloc(size)\n#define vfree(ptr) free(ptr)\n\n#define memeq(a, b, size) (memcmp(a, b, size) == 0)\n#define memzero(buf, size) memset(buf, 0, size)\n\n#undef min\n#undef min_t\n#define min(x, y) ((x) < (y) ? (x) : (y))\n#define min_t(type, x, y) min(x, y)\n\n/*\n * Some functions have been marked with __always_inline to keep the\n * performance reasonable even when the compiler is optimizing for\n * small code size. You may be able to save a few bytes by #defining\n * __always_inline to plain inline, but don't complain if the code\n * becomes slow.\n *\n * NOTE: System headers on GNU/Linux may #define this macro already,\n * so if you want to change it, you need to #undef it first.\n */\n#ifndef __always_inline\n#\tifdef __GNUC__\n#\t\tdefine __always_inline \\\n\t\t\tinline __attribute__((__always_inline__))\n#\telse\n#\t\tdefine __always_inline inline\n#\tendif\n#endif\n\n/*\n * Some functions are marked to never be inlined to reduce stack usage.\n * If you don't care about stack usage, you may want to modify this so\n * that noinline_for_stack is #defined to be empty even when using GCC.\n * Doing so may save a few bytes in binary size.\n */\n#ifndef noinline_for_stack\n#\tifdef __GNUC__\n#\t\tdefine noinline_for_stack __attribute__((__noinline__))\n#\telse\n#\t\tdefine noinline_for_stack\n#\tendif\n#endif\n\n/* Inline functions to access unaligned unsigned 32-bit integers */\n#ifndef get_unaligned_le32\nstatic inline uint32_t XZ_FUNC get_unaligned_le32(const uint8_t *buf)\n{\n\treturn (uint32_t)buf[0]\n\t\t\t| ((uint32_t)buf[1] << 8)\n\t\t\t| ((uint32_t)buf[2] << 16)\n\t\t\t| ((uint32_t)buf[3] << 24);\n}\n#endif\n\n#ifndef get_unaligned_be32\nstatic inline uint32_t XZ_FUNC get_unaligned_be32(const uint8_t *buf)\n{\n\treturn (uint32_t)(buf[0] << 24)\n\t\t\t| ((uint32_t)buf[1] << 16)\n\t\t\t| ((uint32_t)buf[2] << 8)\n\t\t\t| (uint32_t)buf[3];\n}\n#endif\n\n#ifndef put_unaligned_le32\nstatic inline void XZ_FUNC put_unaligned_le32(uint32_t val, uint8_t *buf)\n{\n\tbuf[0] = (uint8_t)val;\n\tbuf[1] = (uint8_t)(val >> 8);\n\tbuf[2] = (uint8_t)(val >> 16);\n\tbuf[3] = (uint8_t)(val >> 24);\n}\n#endif\n\n#ifndef put_unaligned_be32\nstatic inline void XZ_FUNC put_unaligned_be32(uint32_t val, uint8_t *buf)\n{\n\tbuf[0] = (uint8_t)(val >> 24);\n\tbuf[1] = (uint8_t)(val >> 16);\n\tbuf[2] = (uint8_t)(val >> 8);\n\tbuf[3] = (uint8_t)val;\n}\n#endif\n\n/*\n * Use get_unaligned_le32() also for aligned access for simplicity. On\n * little endian systems, #define get_le32(ptr) (*(const uint32_t *)(ptr))\n * could save a few bytes in code size.\n */\n#ifndef get_le32\n#\tdefine get_le32 get_unaligned_le32\n#endif\n\n#endif\n"
  },
  {
    "path": "src/bled/xz_dec_bcj.c",
    "content": "/*\n * Branch/Call/Jump (BCJ) filter decoders\n *\n * Authors: Lasse Collin <lasse.collin@tukaani.org>\n *          Igor Pavlov <http://7-zip.org/>\n *\n * This file has been put into the public domain.\n * You can do whatever you want with this file.\n */\n\n#include \"xz_private.h\"\n\n/*\n * The rest of the file is inside this ifdef. It makes things a little more\n * convenient when building without support for any BCJ filters.\n */\n#ifdef XZ_DEC_BCJ\n\nstruct xz_dec_bcj {\n\t/* Type of the BCJ filter being used */\n\tenum {\n\t\tBCJ_X86 = 4,        /* x86 or x86-64 */\n\t\tBCJ_POWERPC = 5,    /* Big endian only */\n\t\tBCJ_IA64 = 6,       /* Big or little endian */\n\t\tBCJ_ARM = 7,        /* Little endian only */\n\t\tBCJ_ARMTHUMB = 8,   /* Little endian only */\n\t\tBCJ_SPARC = 9       /* Big or little endian */\n\t} type;\n\n\t/*\n\t * Return value of the next filter in the chain. We need to preserve\n\t * this information across calls, because we must not call the next\n\t * filter anymore once it has returned XZ_STREAM_END.\n\t */\n\tenum xz_ret ret;\n\n\t/* True if we are operating in single-call mode. */\n\tbool single_call;\n\n\t/*\n\t * Absolute position relative to the beginning of the uncompressed\n\t * data (in a single .xz Block). We care only about the lowest 32\n\t * bits so this doesn't need to be uint64_t even with big files.\n\t */\n\tuint32_t pos;\n\n\t/* x86 filter state */\n\tuint32_t x86_prev_mask;\n\n\t/* Temporary space to hold the variables from struct xz_buf */\n\tuint8_t *out;\n\tsize_t out_pos;\n\tsize_t out_size;\n\n\tstruct {\n\t\t/* Amount of already filtered data in the beginning of buf */\n\t\tsize_t filtered;\n\n\t\t/* Total amount of data currently stored in buf  */\n\t\tsize_t size;\n\n\t\t/*\n\t\t * Buffer to hold a mix of filtered and unfiltered data. This\n\t\t * needs to be big enough to hold Alignment + 2 * Look-ahead:\n\t\t *\n\t\t * Type         Alignment   Look-ahead\n\t\t * x86              1           4\n\t\t * PowerPC          4           0\n\t\t * IA-64           16           0\n\t\t * ARM              4           0\n\t\t * ARM-Thumb        2           2\n\t\t * SPARC            4           0\n\t\t */\n\t\tuint8_t buf[16];\n\t} temp;\n};\n\n#ifdef XZ_DEC_X86\n/*\n * This is used to test the most significant byte of a memory address\n * in an x86 instruction.\n */\nstatic inline int bcj_x86_test_msbyte(uint8_t b)\n{\n\treturn b == 0x00 || b == 0xFF;\n}\n\nstatic noinline_for_stack size_t XZ_FUNC bcj_x86(\n\t\tstruct xz_dec_bcj *s, uint8_t *buf, size_t size)\n{\n\tstatic const bool mask_to_allowed_status[8]\n\t\t= { true, true, true, false, true, false, false, false };\n\n\tstatic const uint8_t mask_to_bit_num[8] = { 0, 1, 2, 2, 3, 3, 3, 3 };\n\n\tsize_t i;\n\tsize_t prev_pos = (size_t)-1;\n\tuint32_t prev_mask = s->x86_prev_mask;\n\tuint32_t src;\n\tuint32_t dest;\n\tuint32_t j;\n\tuint8_t b;\n\n\tif (size <= 4)\n\t\treturn 0;\n\n\tsize -= 4;\n\tfor (i = 0; i < size; ++i) {\n\t\tif ((buf[i] & 0xFE) != 0xE8)\n\t\t\tcontinue;\n\n\t\t// coverity[overflow_const]\n\t\tprev_pos = i - prev_pos;\n\t\tif (prev_pos > 3) {\n\t\t\tprev_mask = 0;\n\t\t} else {\n\t\t\tprev_mask = (prev_mask << (prev_pos - 1)) & 7;\n\t\t\tif (prev_mask != 0) {\n\t\t\t\tb = buf[i + 4 - mask_to_bit_num[prev_mask]];\n\t\t\t\tif (!mask_to_allowed_status[prev_mask]\n\t\t\t\t\t\t|| bcj_x86_test_msbyte(b)) {\n\t\t\t\t\tprev_pos = i;\n\t\t\t\t\tprev_mask = (prev_mask << 1) | 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprev_pos = i;\n\n\t\tif (bcj_x86_test_msbyte(buf[i + 4])) {\n\t\t\tsrc = get_unaligned_le32(buf + i + 1);\n\t\t\twhile (true) {\n\t\t\t\tdest = src - (s->pos + (uint32_t)i + 5);\n\t\t\t\tif (prev_mask == 0)\n\t\t\t\t\tbreak;\n\n\t\t\t\tj = mask_to_bit_num[prev_mask] * 8;\n\t\t\t\tb = (uint8_t)(dest >> (24 - j));\n\t\t\t\tif (!bcj_x86_test_msbyte(b))\n\t\t\t\t\tbreak;\n\n\t\t\t\tsrc = dest ^ (((uint32_t)1 << (32 - j)) - 1);\n\t\t\t}\n\n\t\t\tdest &= 0x01FFFFFF;\n\t\t\tdest |= (uint32_t)0 - (dest & 0x01000000);\n\t\t\tput_unaligned_le32(dest, buf + i + 1);\n\t\t\ti += 4;\n\t\t} else {\n\t\t\tprev_mask = (prev_mask << 1) | 1;\n\t\t}\n\t}\n\n\tprev_pos = i - prev_pos;\n\ts->x86_prev_mask = prev_pos > 3 ? 0 : prev_mask << (prev_pos - 1);\n\treturn i;\n}\n#endif\n\n#ifdef XZ_DEC_POWERPC\nstatic noinline_for_stack size_t XZ_FUNC bcj_powerpc(\n\t\tstruct xz_dec_bcj *s, uint8_t *buf, size_t size)\n{\n\tsize_t i;\n\tuint32_t instr;\n\n\tfor (i = 0; i + 4 <= size; i += 4) {\n\t\tinstr = get_unaligned_be32(buf + i);\n\t\tif ((instr & 0xFC000003) == 0x48000001) {\n\t\t\tinstr &= 0x03FFFFFC;\n\t\t\tinstr -= s->pos + (uint32_t)i;\n\t\t\tinstr &= 0x03FFFFFC;\n\t\t\tinstr |= 0x48000001;\n\t\t\tput_unaligned_be32(instr, buf + i);\n\t\t}\n\t}\n\n\treturn i;\n}\n#endif\n\n#ifdef XZ_DEC_IA64\nstatic noinline_for_stack size_t XZ_FUNC bcj_ia64(\n\t\tstruct xz_dec_bcj *s, uint8_t *buf, size_t size)\n{\n\tstatic const uint8_t branch_table[32] = {\n\t\t0, 0, 0, 0, 0, 0, 0, 0,\n\t\t0, 0, 0, 0, 0, 0, 0, 0,\n\t\t4, 4, 6, 6, 0, 0, 7, 7,\n\t\t4, 4, 0, 0, 4, 4, 0, 0\n\t};\n\n\t/*\n\t * The local variables take a little bit stack space, but it's less\n\t * than what LZMA2 decoder takes, so it doesn't make sense to reduce\n\t * stack usage here without doing that for the LZMA2 decoder too.\n\t */\n\n\t/* Loop counters */\n\tsize_t i;\n\tsize_t j;\n\n\t/* Instruction slot (0, 1, or 2) in the 128-bit instruction word */\n\tuint32_t slot;\n\n\t/* Bitwise offset of the instruction indicated by slot */\n\tuint32_t bit_pos;\n\n\t/* bit_pos split into byte and bit parts */\n\tuint32_t byte_pos;\n\tuint32_t bit_res;\n\n\t/* Address part of an instruction */\n\tuint32_t addr;\n\n\t/* Mask used to detect which instructions to convert */\n\tuint32_t mask;\n\n\t/* 41-bit instruction stored somewhere in the lowest 48 bits */\n\tuint64_t instr;\n\n\t/* Instruction normalized with bit_res for easier manipulation */\n\tuint64_t norm;\n\n\tfor (i = 0; i + 16 <= size; i += 16) {\n\t\tmask = branch_table[buf[i] & 0x1F];\n\t\tfor (slot = 0, bit_pos = 5; slot < 3; ++slot, bit_pos += 41) {\n\t\t\tif (((mask >> slot) & 1) == 0)\n\t\t\t\tcontinue;\n\n\t\t\tbyte_pos = bit_pos >> 3;\n\t\t\tbit_res = bit_pos & 7;\n\t\t\tinstr = 0;\n\t\t\tfor (j = 0; j < 6; ++j)\n\t\t\t\tinstr |= (uint64_t)(buf[i + j + byte_pos])\n\t\t\t\t\t\t<< (8 * j);\n\n\t\t\tnorm = instr >> bit_res;\n\n\t\t\tif (((norm >> 37) & 0x0F) == 0x05\n\t\t\t\t\t&& ((norm >> 9) & 0x07) == 0) {\n\t\t\t\taddr = (norm >> 13) & 0x0FFFFF;\n\t\t\t\taddr |= ((uint32_t)(norm >> 36) & 1) << 20;\n\t\t\t\taddr <<= 4;\n\t\t\t\taddr -= s->pos + (uint32_t)i;\n\t\t\t\taddr >>= 4;\n\n\t\t\t\tnorm &= ~((uint64_t)0x8FFFFF << 13);\n\t\t\t\tnorm |= (uint64_t)(addr & 0x0FFFFF) << 13;\n\t\t\t\tnorm |= (uint64_t)(addr & 0x100000)\n\t\t\t\t\t\t<< (36 - 20);\n\n\t\t\t\tinstr &= (1 << bit_res) - 1;\n\t\t\t\tinstr |= norm << bit_res;\n\n\t\t\t\tfor (j = 0; j < 6; j++)\n\t\t\t\t\tbuf[i + j + byte_pos]\n\t\t\t\t\t\t= (uint8_t)(instr >> (8 * j));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn i;\n}\n#endif\n\n#ifdef XZ_DEC_ARM\nstatic noinline_for_stack size_t XZ_FUNC bcj_arm(\n\t\tstruct xz_dec_bcj *s, uint8_t *buf, size_t size)\n{\n\tsize_t i;\n\tuint32_t addr;\n\n\tfor (i = 0; i + 4 <= size; i += 4) {\n\t\tif (buf[i + 3] == 0xEB) {\n\t\t\taddr = (uint32_t)buf[i] | ((uint32_t)buf[i + 1] << 8)\n\t\t\t\t\t| ((uint32_t)buf[i + 2] << 16);\n\t\t\taddr <<= 2;\n\t\t\taddr -= s->pos + (uint32_t)i + 8;\n\t\t\taddr >>= 2;\n\t\t\tbuf[i] = (uint8_t)addr;\n\t\t\tbuf[i + 1] = (uint8_t)(addr >> 8);\n\t\t\tbuf[i + 2] = (uint8_t)(addr >> 16);\n\t\t}\n\t}\n\n\treturn i;\n}\n#endif\n\n#ifdef XZ_DEC_ARMTHUMB\nstatic noinline_for_stack size_t XZ_FUNC bcj_armthumb(\n\t\tstruct xz_dec_bcj *s, uint8_t *buf, size_t size)\n{\n\tsize_t i;\n\tuint32_t addr;\n\n\tfor (i = 0; i + 4 <= size; i += 2) {\n\t\tif ((buf[i + 1] & 0xF8) == 0xF0\n\t\t\t\t&& (buf[i + 3] & 0xF8) == 0xF8) {\n\t\t\taddr = (((uint32_t)buf[i + 1] & 0x07) << 19)\n\t\t\t\t\t| ((uint32_t)buf[i] << 11)\n\t\t\t\t\t| (((uint32_t)buf[i + 3] & 0x07) << 8)\n\t\t\t\t\t| (uint32_t)buf[i + 2];\n\t\t\taddr <<= 1;\n\t\t\taddr -= s->pos + (uint32_t)i + 4;\n\t\t\taddr >>= 1;\n\t\t\tbuf[i + 1] = (uint8_t)(0xF0 | ((addr >> 19) & 0x07));\n\t\t\tbuf[i] = (uint8_t)(addr >> 11);\n\t\t\tbuf[i + 3] = (uint8_t)(0xF8 | ((addr >> 8) & 0x07));\n\t\t\tbuf[i + 2] = (uint8_t)addr;\n\t\t\ti += 2;\n\t\t}\n\t}\n\n\treturn i;\n}\n#endif\n\n#ifdef XZ_DEC_SPARC\nstatic noinline_for_stack size_t XZ_FUNC bcj_sparc(\n\t\tstruct xz_dec_bcj *s, uint8_t *buf, size_t size)\n{\n\tsize_t i;\n\tuint32_t instr;\n\n\tfor (i = 0; i + 4 <= size; i += 4) {\n\t\tinstr = get_unaligned_be32(buf + i);\n\t\tif ((instr >> 22) == 0x100 || (instr >> 22) == 0x1FF) {\n\t\t\tinstr <<= 2;\n\t\t\tinstr -= s->pos + (uint32_t)i;\n\t\t\tinstr >>= 2;\n\t\t\tinstr = ((uint32_t)0x40000000 - (instr & 0x400000))\n\t\t\t\t\t| 0x40000000 | (instr & 0x3FFFFF);\n\t\t\tput_unaligned_be32(instr, buf + i);\n\t\t}\n\t}\n\n\treturn i;\n}\n#endif\n\n/*\n * Apply the selected BCJ filter. Update *pos and s->pos to match the amount\n * of data that got filtered.\n *\n * NOTE: This is implemented as a switch statement to avoid using function\n * pointers, which could be problematic in the kernel boot code, which must\n * avoid pointers to static data (at least on x86).\n */\nstatic void XZ_FUNC bcj_apply(struct xz_dec_bcj *s,\n\t\tuint8_t *buf, size_t *pos, size_t size)\n{\n\tsize_t filtered;\n\n\tbuf += *pos;\n\tsize -= *pos;\n\n\tswitch (s->type) {\n#ifdef XZ_DEC_X86\n\tcase BCJ_X86:\n\t\tfiltered = bcj_x86(s, buf, size);\n\t\tbreak;\n#endif\n#ifdef XZ_DEC_POWERPC\n\tcase BCJ_POWERPC:\n\t\tfiltered = bcj_powerpc(s, buf, size);\n\t\tbreak;\n#endif\n#ifdef XZ_DEC_IA64\n\tcase BCJ_IA64:\n\t\tfiltered = bcj_ia64(s, buf, size);\n\t\tbreak;\n#endif\n#ifdef XZ_DEC_ARM\n\tcase BCJ_ARM:\n\t\tfiltered = bcj_arm(s, buf, size);\n\t\tbreak;\n#endif\n#ifdef XZ_DEC_ARMTHUMB\n\tcase BCJ_ARMTHUMB:\n\t\tfiltered = bcj_armthumb(s, buf, size);\n\t\tbreak;\n#endif\n#ifdef XZ_DEC_SPARC\n\tcase BCJ_SPARC:\n\t\tfiltered = bcj_sparc(s, buf, size);\n\t\tbreak;\n#endif\n\tdefault:\n\t\t/* Never reached but silence compiler warnings. */\n\t\tfiltered = 0;\n\t\tbreak;\n\t}\n\n\t*pos += filtered;\n\ts->pos += (uint32_t)filtered;\n}\n\n/*\n * Flush pending filtered data from temp to the output buffer.\n * Move the remaining mixture of possibly filtered and unfiltered\n * data to the beginning of temp.\n */\nstatic void XZ_FUNC bcj_flush(struct xz_dec_bcj *s, struct xz_buf *b)\n{\n\tsize_t copy_size;\n\n\tcopy_size = min_t(size_t, s->temp.filtered, b->out_size - b->out_pos);\n\tmemcpy(b->out + b->out_pos, s->temp.buf, copy_size);\n\tb->out_pos += copy_size;\n\n\ts->temp.filtered -= copy_size;\n\ts->temp.size -= copy_size;\n\tmemmove(s->temp.buf, s->temp.buf + copy_size, s->temp.size);\n}\n\n/*\n * The BCJ filter functions are primitive in sense that they process the\n * data in chunks of 1-16 bytes. To hide this issue, this function does\n * some buffering.\n */\nXZ_EXTERN enum xz_ret XZ_FUNC xz_dec_bcj_run(struct xz_dec_bcj *s,\n\t\tstruct xz_dec_lzma2 *lzma2, struct xz_buf *b)\n{\n\tsize_t out_start;\n\n\t/*\n\t * Flush pending already filtered data to the output buffer. Return\n\t * immediatelly if we couldn't flush everything, or if the next\n\t * filter in the chain had already returned XZ_STREAM_END.\n\t */\n\tif (s->temp.filtered > 0) {\n\t\tbcj_flush(s, b);\n\t\tif (s->temp.filtered > 0)\n\t\t\treturn XZ_OK;\n\n\t\tif (s->ret == XZ_STREAM_END)\n\t\t\treturn XZ_STREAM_END;\n\t}\n\n\t/*\n\t * If we have more output space than what is currently pending in\n\t * temp, copy the unfiltered data from temp to the output buffer\n\t * and try to fill the output buffer by decoding more data from the\n\t * next filter in the chain. Apply the BCJ filter on the new data\n\t * in the output buffer. If everything cannot be filtered, copy it\n\t * to temp and rewind the output buffer position accordingly.\n\t *\n\t * This needs to be always run when temp.size == 0 to handle a special\n\t * case where the output buffer is full and the next filter has no\n\t * more output coming but hasn't returned XZ_STREAM_END yet.\n\t */\n\tif (s->temp.size < b->out_size - b->out_pos || s->temp.size == 0) {\n\t\tout_start = b->out_pos;\n\t\tmemcpy(b->out + b->out_pos, s->temp.buf, s->temp.size);\n\t\tb->out_pos += s->temp.size;\n\n\t\ts->ret = xz_dec_lzma2_run(lzma2, b);\n\t\tif (s->ret != XZ_STREAM_END\n\t\t\t\t&& (s->ret != XZ_OK || s->single_call))\n\t\t\treturn s->ret;\n\n\t\tbcj_apply(s, b->out, &out_start, b->out_pos);\n\n\t\t/*\n\t\t * As an exception, if the next filter returned XZ_STREAM_END,\n\t\t * we can do that too, since the last few bytes that remain\n\t\t * unfiltered are meant to remain unfiltered.\n\t\t */\n\t\tif (s->ret == XZ_STREAM_END)\n\t\t\treturn XZ_STREAM_END;\n\n\t\ts->temp.size = b->out_pos - out_start;\n\t\tb->out_pos -= s->temp.size;\n\t\tmemcpy(s->temp.buf, b->out + b->out_pos, s->temp.size);\n\n\t\t/*\n\t\t * If there wasn't enough input to the next filter to fill\n\t\t * the output buffer with unfiltered data, there's no point\n\t\t * to try decoding more data to temp.\n\t\t */\n\t\tif (b->out_pos + s->temp.size < b->out_size)\n\t\t\treturn XZ_OK;\n\t}\n\n\t/*\n\t * We have unfiltered data in temp. If the output buffer isn't full\n\t * yet, try to fill the temp buffer by decoding more data from the\n\t * next filter. Apply the BCJ filter on temp. Then we hopefully can\n\t * fill the actual output buffer by copying filtered data from temp.\n\t * A mix of filtered and unfiltered data may be left in temp; it will\n\t * be taken care on the next call to this function.\n\t */\n\tif (b->out_pos < b->out_size) {\n\t\t/* Make b->out{,_pos,_size} temporarily point to s->temp. */\n\t\ts->out = b->out;\n\t\ts->out_pos = b->out_pos;\n\t\ts->out_size = b->out_size;\n\t\tb->out = s->temp.buf;\n\t\tb->out_pos = s->temp.size;\n\t\tb->out_size = sizeof(s->temp.buf);\n\n\t\ts->ret = xz_dec_lzma2_run(lzma2, b);\n\n\t\ts->temp.size = b->out_pos;\n\t\tb->out = s->out;\n\t\tb->out_pos = s->out_pos;\n\t\tb->out_size = s->out_size;\n\n\t\tif (s->ret != XZ_OK && s->ret != XZ_STREAM_END)\n\t\t\treturn s->ret;\n\n\t\tbcj_apply(s, s->temp.buf, &s->temp.filtered, s->temp.size);\n\n\t\t/*\n\t\t * If the next filter returned XZ_STREAM_END, we mark that\n\t\t * everything is filtered, since the last unfiltered bytes\n\t\t * of the stream are meant to be left as is.\n\t\t */\n\t\tif (s->ret == XZ_STREAM_END)\n\t\t\ts->temp.filtered = s->temp.size;\n\n\t\tbcj_flush(s, b);\n\t\tif (s->temp.filtered > 0)\n\t\t\treturn XZ_OK;\n\t}\n\n\treturn s->ret;\n}\n\nXZ_EXTERN struct xz_dec_bcj * XZ_FUNC xz_dec_bcj_create(bool single_call)\n{\n\tstruct xz_dec_bcj *s = kmalloc(sizeof(*s), GFP_KERNEL);\n\tif (s != NULL)\n\t\ts->single_call = single_call;\n\n\treturn s;\n}\n\nXZ_EXTERN enum xz_ret XZ_FUNC xz_dec_bcj_reset(\n\t\tstruct xz_dec_bcj *s, uint8_t id)\n{\n\tswitch (id) {\n#ifdef XZ_DEC_X86\n\tcase BCJ_X86:\n#endif\n#ifdef XZ_DEC_POWERPC\n\tcase BCJ_POWERPC:\n#endif\n#ifdef XZ_DEC_IA64\n\tcase BCJ_IA64:\n#endif\n#ifdef XZ_DEC_ARM\n\tcase BCJ_ARM:\n#endif\n#ifdef XZ_DEC_ARMTHUMB\n\tcase BCJ_ARMTHUMB:\n#endif\n#ifdef XZ_DEC_SPARC\n\tcase BCJ_SPARC:\n#endif\n\t\tbreak;\n\n\tdefault:\n\t\t/* Unsupported Filter ID */\n\t\treturn XZ_OPTIONS_ERROR;\n\t}\n\n\ts->type = id;\n\ts->ret = XZ_OK;\n\ts->pos = 0;\n\ts->x86_prev_mask = 0;\n\ts->temp.filtered = 0;\n\ts->temp.size = 0;\n\n\treturn XZ_OK;\n}\n\n#endif\n"
  },
  {
    "path": "src/bled/xz_dec_lzma2.c",
    "content": "/*\n * LZMA2 decoder\n *\n * Authors: Lasse Collin <lasse.collin@tukaani.org>\n *          Igor Pavlov <http://7-zip.org/>\n *\n * This file has been put into the public domain.\n * You can do whatever you want with this file.\n */\n\n#include \"xz_private.h\"\n#include \"xz_lzma2.h\"\n\n/*\n * Range decoder initialization eats the first five bytes of each LZMA chunk.\n */\n#define RC_INIT_BYTES 5\n\n/*\n * Minimum number of usable input buffer to safely decode one LZMA symbol.\n * The worst case is that we decode 22 bits using probabilities and 26\n * direct bits. This may decode at maximum of 20 bytes of input. However,\n * lzma_main() does an extra normalization before returning, thus we\n * need to put 21 here.\n */\n#define LZMA_IN_REQUIRED 21\n\n/*\n * Dictionary (history buffer)\n *\n * These are always true:\n *    start <= pos <= full <= end\n *    pos <= limit <= end\n *\n * In multi-call mode, also these are true:\n *    end == size\n *    size <= size_max\n *    allocated <= size\n *\n * Most of these variables are size_t to support single-call mode,\n * in which the dictionary variables address the actual output\n * buffer directly.\n */\nstruct dictionary {\n\t/* Beginning of the history buffer */\n\tuint8_t *buf;\n\n\t/* Old position in buf (before decoding more data) */\n\tsize_t start;\n\n\t/* Position in buf */\n\tsize_t pos;\n\n\t/*\n\t * How full dictionary is. This is used to detect corrupt input that\n\t * would read beyond the beginning of the uncompressed stream.\n\t */\n\tsize_t full;\n\n\t/* Write limit; we don't write to buf[limit] or later bytes. */\n\tsize_t limit;\n\n\t/*\n\t * End of the dictionary buffer. In multi-call mode, this is\n\t * the same as the dictionary size. In single-call mode, this\n\t * indicates the size of the output buffer.\n\t */\n\tsize_t end;\n\n\t/*\n\t * Size of the dictionary as specified in Block Header. This is used\n\t * together with \"full\" to detect corrupt input that would make us\n\t * read beyond the beginning of the uncompressed stream.\n\t */\n\tuint32_t size;\n\n\t/*\n\t * Maximum allowed dictionary size in multi-call mode.\n\t * This is ignored in single-call mode.\n\t */\n\tuint32_t size_max;\n\n\t/*\n\t * Amount of memory currently allocated for the dictionary.\n\t * This is used only with XZ_DYNALLOC. (With XZ_PREALLOC,\n\t * size_max is always the same as the allocated size.)\n\t */\n\tuint32_t allocated;\n\n\t/* Operation mode */\n\tenum xz_mode mode;\n};\n\n/* Range decoder */\nstruct rc_dec {\n\tuint32_t range;\n\tuint32_t code;\n\n\t/*\n\t * Number of initializing bytes remaining to be read\n\t * by rc_read_init().\n\t */\n\tuint32_t init_bytes_left;\n\n\t/*\n\t * Buffer from which we read our input. It can be either\n\t * temp.buf or the caller-provided input buffer.\n\t */\n\tconst uint8_t *in;\n\tsize_t in_pos;\n\tsize_t in_limit;\n};\n\n/* Probabilities for a length decoder. */\nstruct lzma_len_dec {\n\t/* Probability of match length being at least 10 */\n\tuint16_t choice;\n\n\t/* Probability of match length being at least 18 */\n\tuint16_t choice2;\n\n\t/* Probabilities for match lengths 2-9 */\n\tuint16_t low[POS_STATES_MAX][LEN_LOW_SYMBOLS];\n\n\t/* Probabilities for match lengths 10-17 */\n\tuint16_t mid[POS_STATES_MAX][LEN_MID_SYMBOLS];\n\n\t/* Probabilities for match lengths 18-273 */\n\tuint16_t high[LEN_HIGH_SYMBOLS];\n};\n\nstruct lzma_dec {\n\t/* Distances of latest four matches */\n\tuint32_t rep0;\n\tuint32_t rep1;\n\tuint32_t rep2;\n\tuint32_t rep3;\n\n\t/* Types of the most recently seen LZMA symbols */\n\tenum lzma_state state;\n\n\t/*\n\t * Length of a match. This is updated so that dict_repeat can\n\t * be called again to finish repeating the whole match.\n\t */\n\tuint32_t len;\n\n\t/*\n\t * LZMA properties or related bit masks (number of literal\n\t * context bits, a mask dervied from the number of literal\n\t * position bits, and a mask dervied from the number\n\t * position bits)\n\t */\n\tuint32_t lc;\n\tuint32_t literal_pos_mask; /* (1 << lp) - 1 */\n\tuint32_t pos_mask;         /* (1 << pb) - 1 */\n\n\t/* If 1, it's a match. Otherwise it's a single 8-bit literal. */\n\tuint16_t is_match[STATES][POS_STATES_MAX];\n\n\t/* If 1, it's a repeated match. The distance is one of rep0 .. rep3. */\n\tuint16_t is_rep[STATES];\n\n\t/*\n\t * If 0, distance of a repeated match is rep0.\n\t * Otherwise check is_rep1.\n\t */\n\tuint16_t is_rep0[STATES];\n\n\t/*\n\t * If 0, distance of a repeated match is rep1.\n\t * Otherwise check is_rep2.\n\t */\n\tuint16_t is_rep1[STATES];\n\n\t/* If 0, distance of a repeated match is rep2. Otherwise it is rep3. */\n\tuint16_t is_rep2[STATES];\n\n\t/*\n\t * If 1, the repeated match has length of one byte. Otherwise\n\t * the length is decoded from rep_len_decoder.\n\t */\n\tuint16_t is_rep0_long[STATES][POS_STATES_MAX];\n\n\t/*\n\t * Probability tree for the highest two bits of the match\n\t * distance. There is a separate probability tree for match\n\t * lengths of 2 (i.e. MATCH_LEN_MIN), 3, 4, and [5, 273].\n\t */\n\tuint16_t dist_slot[DIST_STATES][DIST_SLOTS];\n\n\t/*\n\t * Probility trees for additional bits for match distance\n\t * when the distance is in the range [4, 127].\n\t */\n\tuint16_t dist_special[FULL_DISTANCES - DIST_MODEL_END];\n\n\t/*\n\t * Probability tree for the lowest four bits of a match\n\t * distance that is equal to or greater than 128.\n\t */\n\tuint16_t dist_align[ALIGN_SIZE];\n\n\t/* Length of a normal match */\n\tstruct lzma_len_dec match_len_dec;\n\n\t/* Length of a repeated match */\n\tstruct lzma_len_dec rep_len_dec;\n\n\t/* Probabilities of literals */\n\tuint16_t literal[LITERAL_CODERS_MAX][LITERAL_CODER_SIZE];\n};\n\nstruct lzma2_dec {\n\t/* Position in xz_dec_lzma2_run(). */\n\tenum lzma2_seq {\n\t\tSEQ_CONTROL,\n\t\tSEQ_UNCOMPRESSED_1,\n\t\tSEQ_UNCOMPRESSED_2,\n\t\tSEQ_COMPRESSED_0,\n\t\tSEQ_COMPRESSED_1,\n\t\tSEQ_PROPERTIES,\n\t\tSEQ_LZMA_PREPARE,\n\t\tSEQ_LZMA_RUN,\n\t\tSEQ_COPY\n\t} sequence;\n\n\t/* Next position after decoding the compressed size of the chunk. */\n\tenum lzma2_seq next_sequence;\n\n\t/* Uncompressed size of LZMA chunk (2 MiB at maximum) */\n\tuint32_t uncompressed;\n\n\t/*\n\t * Compressed size of LZMA chunk or compressed/uncompressed\n\t * size of uncompressed chunk (64 KiB at maximum)\n\t */\n\tuint32_t compressed;\n\n\t/*\n\t * True if dictionary reset is needed. This is false before\n\t * the first chunk (LZMA or uncompressed).\n\t */\n\tbool need_dict_reset;\n\n\t/*\n\t * True if new LZMA properties are needed. This is false\n\t * before the first LZMA chunk.\n\t */\n\tbool need_props;\n};\n\nstruct xz_dec_lzma2 {\n\t/*\n\t * The order below is important on x86 to reduce code size and\n\t * it shouldn't hurt on other platforms. Everything up to and\n\t * including lzma.pos_mask are in the first 128 bytes on x86-32,\n\t * which allows using smaller instructions to access those\n\t * variables. On x86-64, fewer variables fit into the first 128\n\t * bytes, but this is still the best order without sacrificing\n\t * the readability by splitting the structures.\n\t */\n\tstruct rc_dec rc;\n\tstruct dictionary dict;\n\tstruct lzma2_dec lzma2;\n\tstruct lzma_dec lzma;\n\n\t/*\n\t * Temporary buffer which holds small number of input bytes between\n\t * decoder calls. See lzma2_lzma() for details.\n\t */\n\tstruct {\n\t\tuint32_t size;\n\t\tuint8_t buf[3 * LZMA_IN_REQUIRED];\n\t} temp;\n};\n\n/**************\n * Dictionary *\n **************/\n\n/*\n * Reset the dictionary state. When in single-call mode, set up the beginning\n * of the dictionary to point to the actual output buffer.\n */\nstatic void XZ_FUNC dict_reset(struct dictionary *dict, struct xz_buf *b)\n{\n\tif (DEC_IS_SINGLE(dict->mode)) {\n\t\tdict->buf = b->out + b->out_pos;\n\t\tdict->end = b->out_size - b->out_pos;\n\t}\n\n\tdict->start = 0;\n\tdict->pos = 0;\n\tdict->limit = 0;\n\tdict->full = 0;\n}\n\n/* Set dictionary write limit */\nstatic void XZ_FUNC dict_limit(struct dictionary *dict, size_t out_max)\n{\n\tif (dict->end - dict->pos <= out_max)\n\t\tdict->limit = dict->end;\n\telse\n\t\tdict->limit = dict->pos + out_max;\n}\n\n/* Return true if at least one byte can be written into the dictionary. */\nstatic __always_inline bool XZ_FUNC dict_has_space(const struct dictionary *dict)\n{\n\treturn dict->pos < dict->limit;\n}\n\n/*\n * Get a byte from the dictionary at the given distance. The distance is\n * assumed to valid, or as a special case, zero when the dictionary is\n * still empty. This special case is needed for single-call decoding to\n * avoid writing a '\\0' to the end of the destination buffer.\n */\nstatic __always_inline uint32_t XZ_FUNC dict_get(\n\t\tconst struct dictionary *dict, uint32_t dist)\n{\n\tsize_t offset = dict->pos - dist - 1;\n\n\tif (dist >= dict->pos)\n\t\toffset += dict->end;\n\n\treturn dict->full > 0 ? dict->buf[offset] : 0;\n}\n\n/*\n * Put one byte into the dictionary. It is assumed that there is space for it.\n */\nstatic inline void XZ_FUNC dict_put(struct dictionary *dict, uint8_t byte)\n{\n\tdict->buf[dict->pos++] = byte;\n\n\tif (dict->full < dict->pos)\n\t\tdict->full = dict->pos;\n}\n\n/*\n * Repeat given number of bytes from the given distance. If the distance is\n * invalid, false is returned. On success, true is returned and *len is\n * updated to indicate how many bytes were left to be repeated.\n */\nstatic bool XZ_FUNC dict_repeat(\n\t\tstruct dictionary *dict, uint32_t *len, uint32_t dist)\n{\n\tsize_t back;\n\tuint32_t left;\n\n\tif (dist >= dict->full || dist >= dict->size)\n\t\treturn false;\n\n\tleft = (uint32_t)min_t(size_t, dict->limit - dict->pos, *len);\n\t*len -= left;\n\n\tback = dict->pos - dist - 1;\n\tif (dist >= dict->pos)\n\t\tback += dict->end;\n\n\tdo {\n\t\tdict->buf[dict->pos++] = dict->buf[back++];\n\t\tif (back == dict->end)\n\t\t\tback = 0;\n\t} while (--left > 0);\n\n\tif (dict->full < dict->pos)\n\t\tdict->full = dict->pos;\n\n\treturn true;\n}\n\n/* Copy uncompressed data as is from input to dictionary and output buffers. */\nstatic void XZ_FUNC dict_uncompressed(\n\t\tstruct dictionary *dict, struct xz_buf *b, uint32_t *left)\n{\n\tsize_t copy_size;\n\n\twhile (*left > 0 && b->in_pos < b->in_size\n\t\t\t&& b->out_pos < b->out_size) {\n\t\tcopy_size = min(b->in_size - b->in_pos,\n\t\t\t\tb->out_size - b->out_pos);\n\t\tif (copy_size > dict->end - dict->pos)\n\t\t\tcopy_size = dict->end - dict->pos;\n\t\tif (copy_size > *left)\n\t\t\tcopy_size = *left;\n\n\t\t*left -= (uint32_t)copy_size;\n\n\t\tmemcpy(dict->buf + dict->pos, b->in + b->in_pos, copy_size);\n\t\tdict->pos += copy_size;\n\n\t\tif (dict->full < dict->pos)\n\t\t\tdict->full = dict->pos;\n\n\t\tif (DEC_IS_MULTI(dict->mode)) {\n\t\t\tif (dict->pos == dict->end)\n\t\t\t\tdict->pos = 0;\n\n\t\t\tmemcpy(b->out + b->out_pos, b->in + b->in_pos,\n\t\t\t\t\tcopy_size);\n\t\t}\n\n\t\tdict->start = dict->pos;\n\n\t\tb->out_pos += copy_size;\n\t\tb->in_pos += copy_size;\n\t}\n}\n\n/*\n * Flush pending data from dictionary to b->out. It is assumed that there is\n * enough space in b->out. This is guaranteed because caller uses dict_limit()\n * before decoding data into the dictionary.\n */\nstatic uint32_t XZ_FUNC dict_flush(struct dictionary *dict, struct xz_buf *b)\n{\n\tsize_t copy_size = dict->pos - dict->start;\n\n\tif (DEC_IS_MULTI(dict->mode)) {\n\t\tif (dict->pos == dict->end)\n\t\t\tdict->pos = 0;\n\n\t\tmemcpy(b->out + b->out_pos, dict->buf + dict->start,\n\t\t\t\tcopy_size);\n\t}\n\n\tdict->start = dict->pos;\n\tb->out_pos += copy_size;\n\treturn (uint32_t)copy_size;\n}\n\n/*****************\n * Range decoder *\n *****************/\n\n/* Reset the range decoder. */\nstatic void XZ_FUNC rc_reset(struct rc_dec *rc)\n{\n\trc->range = (uint32_t)-1;\n\trc->code = 0;\n\trc->init_bytes_left = RC_INIT_BYTES;\n}\n\n/*\n * Read the first five initial bytes into rc->code if they haven't been\n * read already. (Yes, the first byte gets completely ignored.)\n */\nstatic bool XZ_FUNC rc_read_init(struct rc_dec *rc, struct xz_buf *b)\n{\n\twhile (rc->init_bytes_left > 0) {\n\t\tif (b->in_pos == b->in_size)\n\t\t\treturn false;\n\n\t\trc->code = (rc->code << 8) + b->in[b->in_pos++];\n\t\t--rc->init_bytes_left;\n\t}\n\n\treturn true;\n}\n\n/* Return true if there may not be enough input for the next decoding loop. */\nstatic inline bool XZ_FUNC rc_limit_exceeded(const struct rc_dec *rc)\n{\n\treturn rc->in_pos > rc->in_limit;\n}\n\n/*\n * Return true if it is possible (from point of view of range decoder) that\n * we have reached the end of the LZMA chunk.\n */\nstatic inline bool XZ_FUNC rc_is_finished(const struct rc_dec *rc)\n{\n\treturn rc->code == 0;\n}\n\n/* Read the next input byte if needed. */\nstatic __always_inline void XZ_FUNC rc_normalize(struct rc_dec *rc)\n{\n\tif (rc->range < RC_TOP_VALUE) {\n\t\trc->range <<= RC_SHIFT_BITS;\n\t\trc->code = (rc->code << RC_SHIFT_BITS) + rc->in[rc->in_pos++];\n\t}\n}\n\n/*\n * Decode one bit. In some versions, this function has been split in three\n * functions so that the compiler is supposed to be able to more easily avoid\n * an extra branch. In this particular version of the LZMA decoder, this\n * doesn't seem to be a good idea (tested with GCC 3.3.6, 3.4.6, and 4.3.3\n * on x86). Using a non-split version results in nicer looking code too.\n *\n * NOTE: This must return an int. Do not make it return a bool or the speed\n * of the code generated by GCC 3.x decreases 10-15 %. (GCC 4.3 doesn't care,\n * and it generates 10-20 % faster code than GCC 3.x from this file anyway.)\n */\nstatic __always_inline int XZ_FUNC rc_bit(struct rc_dec *rc, uint16_t *prob)\n{\n\tuint32_t bound;\n\tint bit;\n\n\trc_normalize(rc);\n\tbound = (rc->range >> RC_BIT_MODEL_TOTAL_BITS) * *prob;\n\tif (rc->code < bound) {\n\t\trc->range = bound;\n\t\t*prob += (RC_BIT_MODEL_TOTAL - *prob) >> RC_MOVE_BITS;\n\t\tbit = 0;\n\t} else {\n\t\trc->range -= bound;\n\t\trc->code -= bound;\n\t\t*prob -= *prob >> RC_MOVE_BITS;\n\t\tbit = 1;\n\t}\n\n\treturn bit;\n}\n\n/* Decode a bittree starting from the most significant bit. */\nstatic __always_inline uint32_t XZ_FUNC rc_bittree(\n\t\tstruct rc_dec *rc, uint16_t *probs, uint32_t limit)\n{\n\tuint32_t symbol = 1;\n\n\tdo {\n\t\tif (rc_bit(rc, &probs[symbol]))\n\t\t\tsymbol = (symbol << 1) + 1;\n\t\telse\n\t\t\tsymbol <<= 1;\n\t} while (symbol < limit);\n\n\treturn symbol;\n}\n\n/* Decode a bittree starting from the least significant bit. */\nstatic __always_inline void XZ_FUNC rc_bittree_reverse(struct rc_dec *rc,\n\t\tuint16_t *probs, uint32_t *dest, uint32_t limit)\n{\n\tuint32_t symbol = 1;\n\tuint32_t i = 0;\n\n\tdo {\n\t\tif (rc_bit(rc, &probs[symbol])) {\n\t\t\tsymbol = (symbol << 1) + 1;\n\t\t\t*dest += 1 << i;\n\t\t} else {\n\t\t\tsymbol <<= 1;\n\t\t}\n\t} while (++i < limit);\n}\n\n/* Decode direct bits (fixed fifty-fifty probability) */\nstatic inline void XZ_FUNC rc_direct(\n\t\tstruct rc_dec *rc, uint32_t *dest, uint32_t limit)\n{\n\tuint32_t mask;\n\n\tdo {\n\t\trc_normalize(rc);\n\t\trc->range >>= 1;\n\t\trc->code -= rc->range;\n\t\tmask = (uint32_t)0 - (rc->code >> 31);\n\t\trc->code += rc->range & mask;\n\t\t*dest = (*dest << 1) + (mask + 1);\n\t} while (--limit > 0);\n}\n\n/********\n * LZMA *\n ********/\n\n/* Get pointer to literal coder probability array. */\nstatic uint16_t * XZ_FUNC lzma_literal_probs(struct xz_dec_lzma2 *s)\n{\n\tuint32_t prev_byte = dict_get(&s->dict, 0);\n\tuint32_t low = prev_byte >> (8 - s->lzma.lc);\n\tuint32_t high = (s->dict.pos & s->lzma.literal_pos_mask) << s->lzma.lc;\n\treturn s->lzma.literal[low + high];\n}\n\n/* Decode a literal (one 8-bit byte) */\nstatic void XZ_FUNC lzma_literal(struct xz_dec_lzma2 *s)\n{\n\tuint16_t *probs;\n\tuint32_t symbol;\n\tuint32_t match_byte;\n\tuint32_t match_bit;\n\tuint32_t offset;\n\tuint32_t i;\n\n\tprobs = lzma_literal_probs(s);\n\n\tif (lzma_state_is_literal(s->lzma.state)) {\n\t\tsymbol = rc_bittree(&s->rc, probs, 0x100);\n\t} else {\n\t\tsymbol = 1;\n\t\tmatch_byte = dict_get(&s->dict, s->lzma.rep0) << 1;\n\t\toffset = 0x100;\n\n\t\tdo {\n\t\t\tmatch_bit = match_byte & offset;\n\t\t\tmatch_byte <<= 1;\n\t\t\ti = offset + match_bit + symbol;\n\n\t\t\tif (rc_bit(&s->rc, &probs[i])) {\n\t\t\t\tsymbol = (symbol << 1) + 1;\n\t\t\t\toffset &= match_bit;\n\t\t\t} else {\n\t\t\t\tsymbol <<= 1;\n\t\t\t\toffset &= ~match_bit;\n\t\t\t}\n\t\t} while (symbol < 0x100);\n\t}\n\n\tdict_put(&s->dict, (uint8_t)symbol);\n\tlzma_state_literal(&s->lzma.state);\n}\n\n/* Decode the length of the match into s->lzma.len. */\nstatic void XZ_FUNC lzma_len(struct xz_dec_lzma2 *s, struct lzma_len_dec *l,\n\t\tuint32_t pos_state)\n{\n\tuint16_t *probs;\n\tuint32_t limit;\n\n\tif (!rc_bit(&s->rc, &l->choice)) {\n\t\tprobs = l->low[pos_state];\n\t\tlimit = LEN_LOW_SYMBOLS;\n\t\ts->lzma.len = MATCH_LEN_MIN;\n\t} else {\n\t\tif (!rc_bit(&s->rc, &l->choice2)) {\n\t\t\tprobs = l->mid[pos_state];\n\t\t\tlimit = LEN_MID_SYMBOLS;\n\t\t\ts->lzma.len = MATCH_LEN_MIN + LEN_LOW_SYMBOLS;\n\t\t} else {\n\t\t\tprobs = l->high;\n\t\t\tlimit = LEN_HIGH_SYMBOLS;\n\t\t\ts->lzma.len = MATCH_LEN_MIN + LEN_LOW_SYMBOLS\n\t\t\t\t\t+ LEN_MID_SYMBOLS;\n\t\t}\n\t}\n\n\t// coverity[overflow_const]\n\ts->lzma.len += rc_bittree(&s->rc, probs, limit) - limit;\n}\n\n/* Decode a match. The distance will be stored in s->lzma.rep0. */\nstatic void XZ_FUNC lzma_match(struct xz_dec_lzma2 *s, uint32_t pos_state)\n{\n\tuint16_t *probs;\n\tuint32_t dist_slot;\n\tuint32_t limit;\n\n\tlzma_state_match(&s->lzma.state);\n\n\ts->lzma.rep3 = s->lzma.rep2;\n\ts->lzma.rep2 = s->lzma.rep1;\n\ts->lzma.rep1 = s->lzma.rep0;\n\n\tlzma_len(s, &s->lzma.match_len_dec, pos_state);\n\n\tprobs = s->lzma.dist_slot[lzma_get_dist_state(s->lzma.len)];\n\tdist_slot = rc_bittree(&s->rc, probs, DIST_SLOTS) - DIST_SLOTS;\n\n\tif (dist_slot < DIST_MODEL_START) {\n\t\ts->lzma.rep0 = dist_slot;\n\t} else {\n\t\tlimit = (dist_slot >> 1) - 1;\n\t\ts->lzma.rep0 = 2 + (dist_slot & 1);\n\n\t\tif (dist_slot < DIST_MODEL_END) {\n\t\t\ts->lzma.rep0 <<= limit;\n\t\t\tprobs = s->lzma.dist_special + s->lzma.rep0\n\t\t\t\t\t- dist_slot - 1;\n\t\t\trc_bittree_reverse(&s->rc, probs,\n\t\t\t\t\t&s->lzma.rep0, limit);\n\t\t} else {\n\t\t\trc_direct(&s->rc, &s->lzma.rep0, limit - ALIGN_BITS);\n\t\t\ts->lzma.rep0 <<= ALIGN_BITS;\n\t\t\trc_bittree_reverse(&s->rc, s->lzma.dist_align,\n\t\t\t\t\t&s->lzma.rep0, ALIGN_BITS);\n\t\t}\n\t}\n}\n\n/*\n * Decode a repeated match. The distance is one of the four most recently\n * seen matches. The distance will be stored in s->lzma.rep0.\n */\nstatic void XZ_FUNC lzma_rep_match(struct xz_dec_lzma2 *s, uint32_t pos_state)\n{\n\tuint32_t tmp;\n\n\tif (!rc_bit(&s->rc, &s->lzma.is_rep0[s->lzma.state])) {\n\t\tif (!rc_bit(&s->rc, &s->lzma.is_rep0_long[\n\t\t\t\ts->lzma.state][pos_state])) {\n\t\t\tlzma_state_short_rep(&s->lzma.state);\n\t\t\ts->lzma.len = 1;\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\tif (!rc_bit(&s->rc, &s->lzma.is_rep1[s->lzma.state])) {\n\t\t\ttmp = s->lzma.rep1;\n\t\t} else {\n\t\t\tif (!rc_bit(&s->rc, &s->lzma.is_rep2[s->lzma.state])) {\n\t\t\t\ttmp = s->lzma.rep2;\n\t\t\t} else {\n\t\t\t\ttmp = s->lzma.rep3;\n\t\t\t\ts->lzma.rep3 = s->lzma.rep2;\n\t\t\t}\n\n\t\t\ts->lzma.rep2 = s->lzma.rep1;\n\t\t}\n\n\t\ts->lzma.rep1 = s->lzma.rep0;\n\t\ts->lzma.rep0 = tmp;\n\t}\n\n\tlzma_state_long_rep(&s->lzma.state);\n\tlzma_len(s, &s->lzma.rep_len_dec, pos_state);\n}\n\n/* LZMA decoder core */\nstatic bool XZ_FUNC lzma_main(struct xz_dec_lzma2 *s)\n{\n\tuint32_t pos_state;\n\n\t/*\n\t * If the dictionary was reached during the previous call, try to\n\t * finish the possibly pending repeat in the dictionary.\n\t */\n\tif (dict_has_space(&s->dict) && s->lzma.len > 0)\n\t\tdict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0);\n\n\t/*\n\t * Decode more LZMA symbols. One iteration may consume up to\n\t * LZMA_IN_REQUIRED - 1 bytes.\n\t */\n\twhile (dict_has_space(&s->dict) && !rc_limit_exceeded(&s->rc)) {\n\t\tpos_state = s->dict.pos & s->lzma.pos_mask;\n\n\t\tif (!rc_bit(&s->rc, &s->lzma.is_match[\n\t\t\t\ts->lzma.state][pos_state])) {\n\t\t\tlzma_literal(s);\n\t\t} else {\n\t\t\tif (rc_bit(&s->rc, &s->lzma.is_rep[s->lzma.state]))\n\t\t\t\tlzma_rep_match(s, pos_state);\n\t\t\telse\n\t\t\t\tlzma_match(s, pos_state);\n\n\t\t\tif (!dict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0))\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t/*\n\t * Having the range decoder always normalized when we are outside\n\t * this function makes it easier to correctly handle end of the chunk.\n\t */\n\trc_normalize(&s->rc);\n\n\treturn true;\n}\n\n/*\n * Reset the LZMA decoder and range decoder state. Dictionary is nore reset\n * here, because LZMA state may be reset without resetting the dictionary.\n */\nstatic void XZ_FUNC lzma_reset(struct xz_dec_lzma2 *s)\n{\n\tuint16_t *probs;\n\tsize_t i;\n\n\ts->lzma.state = STATE_LIT_LIT;\n\ts->lzma.rep0 = 0;\n\ts->lzma.rep1 = 0;\n\ts->lzma.rep2 = 0;\n\ts->lzma.rep3 = 0;\n\n\t/*\n\t * All probabilities are initialized to the same value. This hack\n\t * makes the code smaller by avoiding a separate loop for each\n\t * probability array.\n\t *\n\t * This could be optimized so that only that part of literal\n\t * probabilities that are actually required. In the common case\n\t * we would write 12 KiB less.\n\t */\n\tprobs = s->lzma.is_match[0];\n\tfor (i = 0; i < PROBS_TOTAL; ++i)\n\t\t// coverity[overrun-local]\n\t\tprobs[i] = RC_BIT_MODEL_TOTAL / 2;\n\n\trc_reset(&s->rc);\n}\n\n/*\n * Decode and validate LZMA properties (lc/lp/pb) and calculate the bit masks\n * from the decoded lp and pb values. On success, the LZMA decoder state is\n * reset and true is returned.\n */\nstatic bool XZ_FUNC lzma_props(struct xz_dec_lzma2 *s, uint8_t props)\n{\n\tif (props > (4 * 5 + 4) * 9 + 8)\n\t\treturn false;\n\n\ts->lzma.pos_mask = 0;\n\twhile (props >= 9 * 5) {\n\t\tprops -= 9 * 5;\n\t\t++s->lzma.pos_mask;\n\t}\n\n\ts->lzma.pos_mask = (1 << s->lzma.pos_mask) - 1;\n\n\ts->lzma.literal_pos_mask = 0;\n\twhile (props >= 9) {\n\t\tprops -= 9;\n\t\t++s->lzma.literal_pos_mask;\n\t}\n\n\ts->lzma.lc = props;\n\n\tif (s->lzma.lc + s->lzma.literal_pos_mask > 4)\n\t\treturn false;\n\n\ts->lzma.literal_pos_mask = (1 << s->lzma.literal_pos_mask) - 1;\n\n\tlzma_reset(s);\n\n\treturn true;\n}\n\n/*********\n * LZMA2 *\n *********/\n\n/*\n * The LZMA decoder assumes that if the input limit (s->rc.in_limit) hasn't\n * been exceeded, it is safe to read up to LZMA_IN_REQUIRED bytes. This\n * wrapper function takes care of making the LZMA decoder's assumption safe.\n *\n * As long as there is plenty of input left to be decoded in the current LZMA\n * chunk, we decode directly from the caller-supplied input buffer until\n * there's LZMA_IN_REQUIRED bytes left. Those remaining bytes are copied into\n * s->temp.buf, which (hopefully) gets filled on the next call to this\n * function. We decode a few bytes from the temporary buffer so that we can\n * continue decoding from the caller-supplied input buffer again.\n */\nstatic bool XZ_FUNC lzma2_lzma(struct xz_dec_lzma2 *s, struct xz_buf *b)\n{\n\tsize_t in_avail;\n\tuint32_t tmp;\n\n\tin_avail = b->in_size - b->in_pos;\n\tif (s->temp.size > 0 || s->lzma2.compressed == 0) {\n\t\ttmp = 2 * LZMA_IN_REQUIRED - s->temp.size;\n\t\tif (tmp > s->lzma2.compressed - s->temp.size)\n\t\t\ttmp = s->lzma2.compressed - s->temp.size;\n\t\tif (tmp > in_avail)\n\t\t\ttmp = (uint32_t)in_avail;\n\n\t\tmemcpy(s->temp.buf + s->temp.size, b->in + b->in_pos, tmp);\n\n\t\tif (s->temp.size + tmp == s->lzma2.compressed) {\n\t\t\tmemzero(s->temp.buf + s->temp.size + tmp,\n\t\t\t\t\tsizeof(s->temp.buf)\n\t\t\t\t\t\t- s->temp.size - tmp);\n\t\t\ts->rc.in_limit = s->temp.size + tmp;\n\t\t} else if (s->temp.size + tmp < LZMA_IN_REQUIRED) {\n\t\t\ts->temp.size += tmp;\n\t\t\tb->in_pos += tmp;\n\t\t\treturn true;\n\t\t} else {\n\t\t\ts->rc.in_limit = s->temp.size + tmp - LZMA_IN_REQUIRED;\n\t\t}\n\n\t\ts->rc.in = s->temp.buf;\n\t\ts->rc.in_pos = 0;\n\n\t\tif (!lzma_main(s) || s->rc.in_pos > s->temp.size + tmp)\n\t\t\treturn false;\n\n\t\ts->lzma2.compressed -= (uint32_t)s->rc.in_pos;\n\n\t\tif (s->rc.in_pos < s->temp.size) {\n\t\t\ts->temp.size -= (uint32_t)s->rc.in_pos;\n\t\t\tmemmove(s->temp.buf, s->temp.buf + s->rc.in_pos,\n\t\t\t\t\ts->temp.size);\n\t\t\treturn true;\n\t\t}\n\n\t\tb->in_pos += s->rc.in_pos - s->temp.size;\n\t\ts->temp.size = 0;\n\t}\n\n\tin_avail = b->in_size - b->in_pos;\n\tif (in_avail >= LZMA_IN_REQUIRED) {\n\t\ts->rc.in = b->in;\n\t\ts->rc.in_pos = b->in_pos;\n\n\t\tif (in_avail >= s->lzma2.compressed + LZMA_IN_REQUIRED)\n\t\t\ts->rc.in_limit = b->in_pos + s->lzma2.compressed;\n\t\telse\n\t\t\ts->rc.in_limit = b->in_size - LZMA_IN_REQUIRED;\n\n\t\tif (!lzma_main(s))\n\t\t\treturn false;\n\n\t\tin_avail = s->rc.in_pos - b->in_pos;\n\t\tif (in_avail > s->lzma2.compressed)\n\t\t\treturn false;\n\n\t\ts->lzma2.compressed -= (uint32_t)in_avail;\n\t\tb->in_pos = s->rc.in_pos;\n\t}\n\n\tin_avail = b->in_size - b->in_pos;\n\tif (in_avail < LZMA_IN_REQUIRED) {\n\t\tif (in_avail > s->lzma2.compressed)\n\t\t\tin_avail = s->lzma2.compressed;\n\n\t\tmemcpy(s->temp.buf, b->in + b->in_pos, in_avail);\n\t\ts->temp.size = (uint32_t)in_avail;\n\t\tb->in_pos += in_avail;\n\t}\n\n\treturn true;\n}\n\n/*\n * Take care of the LZMA2 control layer, and forward the job of actual LZMA\n * decoding or copying of uncompressed chunks to other functions.\n */\nXZ_EXTERN NOINLINE enum xz_ret XZ_FUNC xz_dec_lzma2_run(\n\t\tstruct xz_dec_lzma2 *s, struct xz_buf *b)\n{\n\tuint32_t tmp;\n\n\twhile (b->in_pos < b->in_size || s->lzma2.sequence == SEQ_LZMA_RUN) {\n\t\tswitch (s->lzma2.sequence) {\n\t\tcase SEQ_CONTROL:\n\t\t\t/*\n\t\t\t * LZMA2 control byte\n\t\t\t *\n\t\t\t * Exact values:\n\t\t\t *   0x00   End marker\n\t\t\t *   0x01   Dictionary reset followed by\n\t\t\t *          an uncompressed chunk\n\t\t\t *   0x02   Uncompressed chunk (no dictionary reset)\n\t\t\t *\n\t\t\t * Highest three bits (s->control & 0xE0):\n\t\t\t *   0xE0   Dictionary reset, new properties and state\n\t\t\t *          reset, followed by LZMA compressed chunk\n\t\t\t *   0xC0   New properties and state reset, followed\n\t\t\t *          by LZMA compressed chunk (no dictionary\n\t\t\t *          reset)\n\t\t\t *   0xA0   State reset using old properties,\n\t\t\t *          followed by LZMA compressed chunk (no\n\t\t\t *          dictionary reset)\n\t\t\t *   0x80   LZMA chunk (no dictionary or state reset)\n\t\t\t *\n\t\t\t * For LZMA compressed chunks, the lowest five bits\n\t\t\t * (s->control & 1F) are the highest bits of the\n\t\t\t * uncompressed size (bits 16-20).\n\t\t\t *\n\t\t\t * A new LZMA2 stream must begin with a dictionary\n\t\t\t * reset. The first LZMA chunk must set new\n\t\t\t * properties and reset the LZMA state.\n\t\t\t *\n\t\t\t * Values that don't match anything described above\n\t\t\t * are invalid and we return XZ_DATA_ERROR.\n\t\t\t */\n\t\t\ttmp = b->in[b->in_pos++];\n\n\t\t\tif (tmp == 0x00)\n\t\t\t\treturn XZ_STREAM_END;\n\n\t\t\tif (tmp >= 0xE0 || tmp == 0x01) {\n\t\t\t\ts->lzma2.need_props = true;\n\t\t\t\ts->lzma2.need_dict_reset = false;\n\t\t\t\tdict_reset(&s->dict, b);\n\t\t\t} else if (s->lzma2.need_dict_reset) {\n\t\t\t\treturn XZ_DATA_ERROR;\n\t\t\t}\n\n\t\t\tif (tmp >= 0x80) {\n\t\t\t\ts->lzma2.uncompressed = (tmp & 0x1F) << 16;\n\t\t\t\ts->lzma2.sequence = SEQ_UNCOMPRESSED_1;\n\n\t\t\t\tif (tmp >= 0xC0) {\n\t\t\t\t\t/*\n\t\t\t\t\t * When there are new properties,\n\t\t\t\t\t * state reset is done at\n\t\t\t\t\t * SEQ_PROPERTIES.\n\t\t\t\t\t */\n\t\t\t\t\ts->lzma2.need_props = false;\n\t\t\t\t\ts->lzma2.next_sequence\n\t\t\t\t\t\t\t= SEQ_PROPERTIES;\n\t\t\t\t} else if (s->lzma2.need_props) {\n\t\t\t\t\treturn XZ_DATA_ERROR;\n\t\t\t\t} else {\n\t\t\t\t\ts->lzma2.next_sequence\n\t\t\t\t\t\t\t= SEQ_LZMA_PREPARE;\n\t\t\t\t\tif (tmp >= 0xA0)\n\t\t\t\t\t\tlzma_reset(s);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (tmp > 0x02)\n\t\t\t\t\treturn XZ_DATA_ERROR;\n\n\t\t\t\ts->lzma2.sequence = SEQ_COMPRESSED_0;\n\t\t\t\ts->lzma2.next_sequence = SEQ_COPY;\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase SEQ_UNCOMPRESSED_1:\n\t\t\ts->lzma2.uncompressed\n\t\t\t\t\t+= (uint32_t)b->in[b->in_pos++] << 8;\n\t\t\ts->lzma2.sequence = SEQ_UNCOMPRESSED_2;\n\t\t\tbreak;\n\n\t\tcase SEQ_UNCOMPRESSED_2:\n\t\t\ts->lzma2.uncompressed\n\t\t\t\t\t+= (uint32_t)b->in[b->in_pos++] + 1;\n\t\t\ts->lzma2.sequence = SEQ_COMPRESSED_0;\n\t\t\tbreak;\n\n\t\tcase SEQ_COMPRESSED_0:\n\t\t\ts->lzma2.compressed\n\t\t\t\t\t= (uint32_t)b->in[b->in_pos++] << 8;\n\t\t\ts->lzma2.sequence = SEQ_COMPRESSED_1;\n\t\t\tbreak;\n\n\t\tcase SEQ_COMPRESSED_1:\n\t\t\ts->lzma2.compressed\n\t\t\t\t\t+= (uint32_t)b->in[b->in_pos++] + 1;\n\t\t\ts->lzma2.sequence = s->lzma2.next_sequence;\n\t\t\tbreak;\n\n\t\tcase SEQ_PROPERTIES:\n\t\t\tif (!lzma_props(s, b->in[b->in_pos++]))\n\t\t\t\treturn XZ_DATA_ERROR;\n\n\t\t\ts->lzma2.sequence = SEQ_LZMA_PREPARE;\n\t\t\t// Fall through\n\n\t\tcase SEQ_LZMA_PREPARE:\n\t\t\tif (s->lzma2.compressed < RC_INIT_BYTES)\n\t\t\t\treturn XZ_DATA_ERROR;\n\n\t\t\tif (!rc_read_init(&s->rc, b))\n\t\t\t\treturn XZ_OK;\n\n\t\t\ts->lzma2.compressed -= RC_INIT_BYTES;\n\t\t\ts->lzma2.sequence = SEQ_LZMA_RUN;\n\t\t\t// Fall through\n\n\t\tcase SEQ_LZMA_RUN:\n\t\t\t/*\n\t\t\t * Set dictionary limit to indicate how much we want\n\t\t\t * to be encoded at maximum. Decode new data into the\n\t\t\t * dictionary. Flush the new data from dictionary to\n\t\t\t * b->out. Check if we finished decoding this chunk.\n\t\t\t * In case the dictionary got full but we didn't fill\n\t\t\t * the output buffer yet, we may run this loop\n\t\t\t * multiple times without changing s->lzma2.sequence.\n\t\t\t */\n\t\t\tdict_limit(&s->dict, min_t(size_t,\n\t\t\t\t\tb->out_size - b->out_pos,\n\t\t\t\t\ts->lzma2.uncompressed));\n\t\t\tif (!lzma2_lzma(s, b))\n\t\t\t\treturn XZ_DATA_ERROR;\n\n\t\t\ts->lzma2.uncompressed -= dict_flush(&s->dict, b);\n\n\t\t\tif (s->lzma2.uncompressed == 0) {\n\t\t\t\tif (s->lzma2.compressed > 0 || s->lzma.len > 0\n\t\t\t\t\t\t|| !rc_is_finished(&s->rc))\n\t\t\t\t\treturn XZ_DATA_ERROR;\n\n\t\t\t\trc_reset(&s->rc);\n\t\t\t\ts->lzma2.sequence = SEQ_CONTROL;\n\t\t\t} else if (b->out_pos == b->out_size\n\t\t\t\t\t|| (b->in_pos == b->in_size\n\t\t\t\t\t\t&& s->temp.size\n\t\t\t\t\t\t< s->lzma2.compressed)) {\n\t\t\t\treturn XZ_OK;\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase SEQ_COPY:\n\t\t\tdict_uncompressed(&s->dict, b, &s->lzma2.compressed);\n\t\t\tif (s->lzma2.compressed > 0)\n\t\t\t\treturn XZ_OK;\n\n\t\t\ts->lzma2.sequence = SEQ_CONTROL;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn XZ_OK;\n}\n\nXZ_EXTERN struct xz_dec_lzma2 * XZ_FUNC xz_dec_lzma2_create(\n\t\tenum xz_mode mode, uint32_t dict_max)\n{\n\tstruct xz_dec_lzma2 *s = kmalloc(sizeof(*s), GFP_KERNEL);\n\tif (s == NULL)\n\t\treturn NULL;\n\n\ts->dict.mode = mode;\n\ts->dict.size_max = dict_max;\n\n\tif (DEC_IS_PREALLOC(mode)) {\n\t\ts->dict.buf = vmalloc(dict_max);\n\t\tif (s->dict.buf == NULL) {\n\t\t\tkfree(s);\n\t\t\treturn NULL;\n\t\t}\n\t} else if (DEC_IS_DYNALLOC(mode)) {\n\t\ts->dict.buf = NULL;\n\t\ts->dict.allocated = 0;\n\t}\n\n\treturn s;\n}\n\nXZ_EXTERN enum xz_ret XZ_FUNC xz_dec_lzma2_reset(\n\t\tstruct xz_dec_lzma2 *s, uint8_t props)\n{\n\t/* This limits dictionary size to 3 GiB to keep parsing simpler. */\n\tif (props > 39)\n\t\treturn XZ_OPTIONS_ERROR;\n\n\ts->dict.size = 2 + (props & 1);\n\ts->dict.size <<= (props >> 1) + 11;\n\n\tif (DEC_IS_MULTI(s->dict.mode)) {\n\t\tif (s->dict.size > s->dict.size_max)\n\t\t\treturn XZ_MEMLIMIT_ERROR;\n\n\t\ts->dict.end = s->dict.size;\n\n\t\tif (DEC_IS_DYNALLOC(s->dict.mode)) {\n\t\t\tif (s->dict.allocated < s->dict.size) {\n\t\t\t\tvfree(s->dict.buf);\n\t\t\t\ts->dict.buf = vmalloc(s->dict.size);\n\t\t\t\tif (s->dict.buf == NULL) {\n\t\t\t\t\ts->dict.allocated = 0;\n\t\t\t\t\treturn XZ_MEM_ERROR;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\ts->lzma.len = 0;\n\n\ts->lzma2.sequence = SEQ_CONTROL;\n\ts->lzma2.need_dict_reset = true;\n\n\ts->temp.size = 0;\n\n\treturn XZ_OK;\n}\n\nXZ_EXTERN void XZ_FUNC xz_dec_lzma2_end(struct xz_dec_lzma2 *s)\n{\n\tif (DEC_IS_MULTI(s->dict.mode))\n\t\tvfree(s->dict.buf);\n\n\tkfree(s);\n}\n"
  },
  {
    "path": "src/bled/xz_dec_stream.c",
    "content": "/*\n * .xz Stream decoder\n *\n * Author: Lasse Collin <lasse.collin@tukaani.org>\n *\n * This file has been put into the public domain.\n * You can do whatever you want with this file.\n */\n\n#include \"xz_private.h\"\n#include \"xz_stream.h\"\n\n/* Hash used to validate the Index field */\nstruct xz_dec_hash {\n\tvli_type unpadded;\n\tvli_type uncompressed;\n\tuint32_t crc32;\n};\n\nstruct xz_dec {\n\t/* Position in dec_main() */\n\tenum {\n\t\tSEQ_STREAM_HEADER,\n\t\tSEQ_BLOCK_START,\n\t\tSEQ_BLOCK_HEADER,\n\t\tSEQ_BLOCK_UNCOMPRESS,\n\t\tSEQ_BLOCK_PADDING,\n\t\tSEQ_BLOCK_CHECK,\n\t\tSEQ_INDEX,\n\t\tSEQ_INDEX_PADDING,\n\t\tSEQ_INDEX_CRC32,\n\t\tSEQ_STREAM_FOOTER\n\t} sequence;\n\n\t/* Position in variable-length integers and Check fields */\n\tuint32_t pos;\n\n\t/* Variable-length integer decoded by dec_vli() */\n\tvli_type vli;\n\n\t/* Saved in_pos and out_pos */\n\tsize_t in_start;\n\tsize_t out_start;\n\n\t/* CRC32 value in Block or Index */\n\tuint32_t crc32;\n\n\t/* Type of the integrity check calculated from uncompressed data */\n\tenum xz_check check_type;\n\n\t/* Operation mode */\n\tenum xz_mode mode;\n\n\t/*\n\t * True if the next call to xz_dec_run() is allowed to return\n\t * XZ_BUF_ERROR.\n\t */\n\tbool allow_buf_error;\n\n\t/* Information stored in Block Header */\n\tstruct {\n\t\t/*\n\t\t * Value stored in the Compressed Size field, or\n\t\t * VLI_UNKNOWN if Compressed Size is not present.\n\t\t */\n\t\tvli_type compressed;\n\n\t\t/*\n\t\t * Value stored in the Uncompressed Size field, or\n\t\t * VLI_UNKNOWN if Uncompressed Size is not present.\n\t\t */\n\t\tvli_type uncompressed;\n\n\t\t/* Size of the Block Header field */\n\t\tuint32_t size;\n\t} block_header;\n\n\t/* Information collected when decoding Blocks */\n\tstruct {\n\t\t/* Observed compressed size of the current Block */\n\t\tvli_type compressed;\n\n\t\t/* Observed uncompressed size of the current Block */\n\t\tvli_type uncompressed;\n\n\t\t/* Number of Blocks decoded so far */\n\t\tvli_type count;\n\n\t\t/*\n\t\t * Hash calculated from the Block sizes. This is used to\n\t\t * validate the Index field.\n\t\t */\n\t\tstruct xz_dec_hash hash;\n\t} block;\n\n\t/* Variables needed when verifying the Index field */\n\tstruct {\n\t\t/* Position in dec_index() */\n\t\tenum {\n\t\t\tSEQ_INDEX_COUNT,\n\t\t\tSEQ_INDEX_UNPADDED,\n\t\t\tSEQ_INDEX_UNCOMPRESSED\n\t\t} sequence;\n\n\t\t/* Size of the Index in bytes */\n\t\tvli_type size;\n\n\t\t/* Number of Records (matches block.count in valid files) */\n\t\tvli_type count;\n\n\t\t/*\n\t\t * Hash calculated from the Records (matches block.hash in\n\t\t * valid files).\n\t\t */\n\t\tstruct xz_dec_hash hash;\n\t} index;\n\n\t/*\n\t * Temporary buffer needed to hold Stream Header, Block Header,\n\t * and Stream Footer. The Block Header is the biggest (1 KiB)\n\t * so we reserve space according to that. buf[] has to be aligned\n\t * to a multiple of four bytes; the size_t variables before it\n\t * should guarantee this.\n\t */\n\tstruct {\n\t\tsize_t pos;\n\t\tsize_t size;\n\t\tuint8_t buf[1024];\n\t} temp;\n\n\tstruct xz_dec_lzma2 *lzma2;\n\n#ifdef XZ_DEC_BCJ\n\tstruct xz_dec_bcj *bcj;\n\tbool bcj_active;\n#endif\n};\n\n#ifdef XZ_DEC_ANY_CHECK\n/* Sizes of the Check field with different Check IDs */\nstatic const uint8_t check_sizes[16] = {\n\t0,\n\t4, 4, 4,\n\t8, 8, 8,\n\t16, 16, 16,\n\t32, 32, 32,\n\t64, 64, 64\n};\n#endif\n\n/*\n * Fill s->temp by copying data starting from b->in[b->in_pos]. Caller\n * must have set s->temp.pos to indicate how much data we are supposed\n * to copy into s->temp.buf. Return true once s->temp.pos has reached\n * s->temp.size.\n */\nstatic bool XZ_FUNC fill_temp(struct xz_dec *s, struct xz_buf *b)\n{\n\tsize_t copy_size = min_t(size_t,\n\t\t\tb->in_size - b->in_pos, s->temp.size - s->temp.pos);\n\n\tmemcpy(s->temp.buf + s->temp.pos, b->in + b->in_pos, copy_size);\n\tb->in_pos += copy_size;\n\ts->temp.pos += copy_size;\n\n\tif (s->temp.pos == s->temp.size) {\n\t\ts->temp.pos = 0;\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/* Decode a variable-length integer (little-endian base-128 encoding) */\nstatic enum xz_ret XZ_FUNC dec_vli(struct xz_dec *s,\n\t\tconst uint8_t *in, size_t *in_pos, size_t in_size)\n{\n\tuint8_t byte;\n\n\tif (s->pos == 0)\n\t\ts->vli = 0;\n\n\twhile (*in_pos < in_size) {\n\t\tbyte = in[*in_pos];\n\t\t++*in_pos;\n\n\t\ts->vli |= (vli_type)(byte & 0x7F) << s->pos;\n\n\t\tif ((byte & 0x80) == 0) {\n\t\t\t/* Don't allow non-minimal encodings. */\n\t\t\tif (byte == 0 && s->pos != 0)\n\t\t\t\treturn XZ_DATA_ERROR;\n\n\t\t\ts->pos = 0;\n\t\t\treturn XZ_STREAM_END;\n\t\t}\n\n\t\ts->pos += 7;\n\t\tif (s->pos == 7 * VLI_BYTES_MAX)\n\t\t\treturn XZ_DATA_ERROR;\n\t}\n\n\treturn XZ_OK;\n}\n\n/*\n * Decode the Compressed Data field from a Block. Update and validate\n * the observed compressed and uncompressed sizes of the Block so that\n * they don't exceed the values possibly stored in the Block Header\n * (validation assumes that no integer overflow occurs, since vli_type\n * is normally uint64_t). Update the CRC32 if presence of the CRC32\n * field was indicated in Stream Header.\n *\n * Once the decoding is finished, validate that the observed sizes match\n * the sizes possibly stored in the Block Header. Update the hash and\n * Block count, which are later used to validate the Index field.\n */\nstatic enum xz_ret XZ_FUNC dec_block(struct xz_dec *s, struct xz_buf *b)\n{\n\tenum xz_ret ret;\n\n\ts->in_start = b->in_pos;\n\ts->out_start = b->out_pos;\n\n#ifdef XZ_DEC_BCJ\n\tif (s->bcj_active)\n\t\tret = xz_dec_bcj_run(s->bcj, s->lzma2, b);\n\telse\n#endif\n\t\tret = xz_dec_lzma2_run(s->lzma2, b);\n\n\ts->block.compressed += b->in_pos - s->in_start;\n\ts->block.uncompressed += b->out_pos - s->out_start;\n\n\t/*\n\t * There is no need to separately check for VLI_UNKNOWN, since\n\t * the observed sizes are always smaller than VLI_UNKNOWN.\n\t */\n\tif (s->block.compressed > s->block_header.compressed\n\t\t\t|| s->block.uncompressed\n\t\t\t\t> s->block_header.uncompressed)\n\t\treturn XZ_DATA_ERROR;\n\n\tif (s->check_type == XZ_CHECK_CRC32)\n\t\ts->crc32 = xz_crc32(b->out + s->out_start,\n\t\t\t\tb->out_pos - s->out_start, s->crc32);\n\n\tif (ret == XZ_STREAM_END) {\n\t\tif (s->block_header.compressed != VLI_UNKNOWN\n\t\t\t\t&& s->block_header.compressed\n\t\t\t\t\t!= s->block.compressed)\n\t\t\treturn XZ_DATA_ERROR;\n\n\t\tif (s->block_header.uncompressed != VLI_UNKNOWN\n\t\t\t\t&& s->block_header.uncompressed\n\t\t\t\t\t!= s->block.uncompressed)\n\t\t\treturn XZ_DATA_ERROR;\n\n\t\ts->block.hash.unpadded += s->block_header.size\n\t\t\t\t+ s->block.compressed;\n\n#ifdef XZ_DEC_ANY_CHECK\n\t\ts->block.hash.unpadded += check_sizes[s->check_type];\n#else\n\t\tif (s->check_type == XZ_CHECK_CRC32)\n\t\t\ts->block.hash.unpadded += 4;\n#endif\n\n\t\ts->block.hash.uncompressed += s->block.uncompressed;\n\t\ts->block.hash.crc32 = xz_crc32(\n\t\t\t\t(const uint8_t *)&s->block.hash,\n\t\t\t\tsizeof(s->block.hash), s->block.hash.crc32);\n\n\t\t++s->block.count;\n\t}\n\n\treturn ret;\n}\n\n/* Update the Index size and the CRC32 value. */\nstatic void XZ_FUNC index_update(struct xz_dec *s, const struct xz_buf *b)\n{\n\tsize_t in_used = b->in_pos - s->in_start;\n\ts->index.size += in_used;\n\ts->crc32 = xz_crc32(b->in + s->in_start, in_used, s->crc32);\n}\n\n/*\n * Decode the Number of Records, Unpadded Size, and Uncompressed Size\n * fields from the Index field. That is, Index Padding and CRC32 are not\n * decoded by this function.\n *\n * This can return XZ_OK (more input needed), XZ_STREAM_END (everything\n * successfully decoded), or XZ_DATA_ERROR (input is corrupt).\n */\nstatic enum xz_ret XZ_FUNC dec_index(struct xz_dec *s, struct xz_buf *b)\n{\n\tenum xz_ret ret;\n\n\tdo {\n\t\tret = dec_vli(s, b->in, &b->in_pos, b->in_size);\n\t\tif (ret != XZ_STREAM_END) {\n\t\t\tindex_update(s, b);\n\t\t\treturn ret;\n\t\t}\n\n\t\tswitch (s->index.sequence) {\n\t\tcase SEQ_INDEX_COUNT:\n\t\t\ts->index.count = s->vli;\n\n\t\t\t/*\n\t\t\t * Validate that the Number of Records field\n\t\t\t * indicates the same number of Records as\n\t\t\t * there were Blocks in the Stream.\n\t\t\t */\n\t\t\tif (s->index.count != s->block.count)\n\t\t\t\treturn XZ_DATA_ERROR;\n\n\t\t\ts->index.sequence = SEQ_INDEX_UNPADDED;\n\t\t\tbreak;\n\n\t\tcase SEQ_INDEX_UNPADDED:\n\t\t\ts->index.hash.unpadded += s->vli;\n\t\t\ts->index.sequence = SEQ_INDEX_UNCOMPRESSED;\n\t\t\tbreak;\n\n\t\tcase SEQ_INDEX_UNCOMPRESSED:\n\t\t\ts->index.hash.uncompressed += s->vli;\n\t\t\ts->index.hash.crc32 = xz_crc32(\n\t\t\t\t\t(const uint8_t *)&s->index.hash,\n\t\t\t\t\tsizeof(s->index.hash),\n\t\t\t\t\ts->index.hash.crc32);\n\t\t\t--s->index.count;\n\t\t\ts->index.sequence = SEQ_INDEX_UNPADDED;\n\t\t\tbreak;\n\t\t}\n\t} while (s->index.count > 0);\n\n\treturn XZ_STREAM_END;\n}\n\n/*\n * Validate that the next four input bytes match the value of s->crc32.\n * s->pos must be zero when starting to validate the first byte.\n */\nstatic enum xz_ret XZ_FUNC crc32_validate(struct xz_dec *s, struct xz_buf *b)\n{\n\tdo {\n\t\tif (b->in_pos == b->in_size)\n\t\t\treturn XZ_OK;\n\n\t\tif (((s->crc32 >> s->pos) & 0xFF) != b->in[b->in_pos++])\n\t\t\treturn XZ_DATA_ERROR;\n\n\t\ts->pos += 8;\n\t} while (s->pos < 32);\n\n\ts->crc32 = 0;\n\ts->pos = 0;\n\n\treturn XZ_STREAM_END;\n}\n\n#ifdef XZ_DEC_ANY_CHECK\n/*\n * Skip over the Check field when the Check ID is not supported.\n * Returns true once the whole Check field has been skipped over.\n */\nstatic bool XZ_FUNC check_skip(struct xz_dec *s, struct xz_buf *b)\n{\n\twhile (s->check_type < 16 && s->pos < check_sizes[s->check_type]) {\n\t\tif (b->in_pos == b->in_size)\n\t\t\treturn false;\n\n\t\t++b->in_pos;\n\t\t++s->pos;\n\t}\n\n\ts->pos = 0;\n\n\treturn true;\n}\n#endif\n\n/* Decode the Stream Header field (the first 12 bytes of the .xz Stream). */\nstatic enum xz_ret XZ_FUNC dec_stream_header(struct xz_dec *s)\n{\n\tif (!memeq(s->temp.buf, HEADER_MAGIC, HEADER_MAGIC_SIZE))\n\t\treturn XZ_FORMAT_ERROR;\n\n\tif (xz_crc32(s->temp.buf + HEADER_MAGIC_SIZE, 2, 0)\n\t\t\t!= get_le32(s->temp.buf + HEADER_MAGIC_SIZE + 2))\n\t\treturn XZ_DATA_ERROR;\n\n\tif (s->temp.buf[HEADER_MAGIC_SIZE] != 0)\n\t\treturn XZ_OPTIONS_ERROR;\n\n\t/*\n\t * Of integrity checks, we support only none (Check ID = 0) and\n\t * CRC32 (Check ID = 1). However, if XZ_DEC_ANY_CHECK is defined,\n\t * we will accept other check types too, but then the check won't\n\t * be verified and a warning (XZ_UNSUPPORTED_CHECK) will be given.\n\t */\n\ts->check_type = s->temp.buf[HEADER_MAGIC_SIZE + 1];\n\n#ifdef XZ_DEC_ANY_CHECK\n\tif (s->check_type > XZ_CHECK_MAX)\n\t\treturn XZ_OPTIONS_ERROR;\n\n\tif (s->check_type > XZ_CHECK_CRC32)\n\t\treturn XZ_UNSUPPORTED_CHECK;\n#else\n\tif (s->check_type > XZ_CHECK_CRC32)\n\t\treturn XZ_OPTIONS_ERROR;\n#endif\n\n\treturn XZ_OK;\n}\n\n/* Decode the Stream Footer field (the last 12 bytes of the .xz Stream) */\nstatic enum xz_ret XZ_FUNC dec_stream_footer(struct xz_dec *s)\n{\n\tif (!memeq(s->temp.buf + 10, FOOTER_MAGIC, FOOTER_MAGIC_SIZE))\n\t\treturn XZ_DATA_ERROR;\n\n\tif (xz_crc32(s->temp.buf + 4, 6, 0) != get_le32(s->temp.buf))\n\t\treturn XZ_DATA_ERROR;\n\n\t/*\n\t * Validate Backward Size. Note that we never added the size of the\n\t * Index CRC32 field to s->index.size, thus we use s->index.size / 4\n\t * instead of s->index.size / 4 - 1.\n\t */\n\tif ((s->index.size >> 2) != get_le32(s->temp.buf + 4))\n\t\treturn XZ_DATA_ERROR;\n\n\tif (s->temp.buf[8] != 0 || s->temp.buf[9] != s->check_type)\n\t\treturn XZ_DATA_ERROR;\n\n\t/*\n\t * Use XZ_STREAM_END instead of XZ_OK to be more convenient\n\t * for the caller.\n\t */\n\treturn XZ_STREAM_END;\n}\n\n/* Decode the Block Header and initialize the filter chain. */\nstatic enum xz_ret XZ_FUNC dec_block_header(struct xz_dec *s)\n{\n\tenum xz_ret ret;\n\n\t/*\n\t * Validate the CRC32. We know that the temp buffer is at least\n\t * eight bytes so this is safe.\n\t */\n\ts->temp.size -= 4;\n\tif (xz_crc32(s->temp.buf, s->temp.size, 0)\n\t\t\t!= get_le32(s->temp.buf + s->temp.size))\n\t\treturn XZ_DATA_ERROR;\n\n\ts->temp.pos = 2;\n\n\t/*\n\t * Catch unsupported Block Flags. We support only one or two filters\n\t * in the chain, so we catch that with the same test.\n\t */\n#ifdef XZ_DEC_BCJ\n\tif (s->temp.buf[1] & 0x3E)\n#else\n\tif (s->temp.buf[1] & 0x3F)\n#endif\n\t\treturn XZ_OPTIONS_ERROR;\n\n\t/* Compressed Size */\n\tif (s->temp.buf[1] & 0x40) {\n\t\tif (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)\n\t\t\t\t\t!= XZ_STREAM_END)\n\t\t\treturn XZ_DATA_ERROR;\n\n\t\ts->block_header.compressed = s->vli;\n\t} else {\n\t\ts->block_header.compressed = VLI_UNKNOWN;\n\t}\n\n\t/* Uncompressed Size */\n\tif (s->temp.buf[1] & 0x80) {\n\t\tif (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)\n\t\t\t\t!= XZ_STREAM_END)\n\t\t\treturn XZ_DATA_ERROR;\n\n\t\ts->block_header.uncompressed = s->vli;\n\t} else {\n\t\ts->block_header.uncompressed = VLI_UNKNOWN;\n\t}\n\n#ifdef XZ_DEC_BCJ\n\t/* If there are two filters, the first one must be a BCJ filter. */\n\ts->bcj_active = s->temp.buf[1] & 0x01;\n\tif (s->bcj_active) {\n\t\tif (s->temp.size - s->temp.pos < 2)\n\t\t\treturn XZ_OPTIONS_ERROR;\n\n\t\tret = xz_dec_bcj_reset(s->bcj, s->temp.buf[s->temp.pos++]);\n\t\tif (ret != XZ_OK)\n\t\t\treturn ret;\n\n\t\t/*\n\t\t * We don't support custom start offset,\n\t\t * so Size of Properties must be zero.\n\t\t */\n\t\tif (s->temp.buf[s->temp.pos++] != 0x00)\n\t\t\treturn XZ_OPTIONS_ERROR;\n\t}\n#endif\n\n\t/* Valid Filter Flags always take at least two bytes. */\n\tif (s->temp.size - s->temp.pos < 2)\n\t\treturn XZ_DATA_ERROR;\n\n\t/* Filter ID = LZMA2 */\n\tif (s->temp.buf[s->temp.pos++] != 0x21)\n\t\treturn XZ_OPTIONS_ERROR;\n\n\t/* Size of Properties = 1-byte Filter Properties */\n\tif (s->temp.buf[s->temp.pos++] != 0x01)\n\t\treturn XZ_OPTIONS_ERROR;\n\n\t/* Filter Properties contains LZMA2 dictionary size. */\n\tif (s->temp.size - s->temp.pos < 1)\n\t\treturn XZ_DATA_ERROR;\n\n\tret = xz_dec_lzma2_reset(s->lzma2, s->temp.buf[s->temp.pos++]);\n\tif (ret != XZ_OK)\n\t\treturn ret;\n\n\t/* The rest must be Header Padding. */\n\twhile (s->temp.pos < s->temp.size)\n\t\tif (s->temp.buf[s->temp.pos++] != 0x00)\n\t\t\treturn XZ_OPTIONS_ERROR;\n\n\ts->temp.pos = 0;\n\ts->block.compressed = 0;\n\ts->block.uncompressed = 0;\n\n\treturn XZ_OK;\n}\n\nstatic NOINLINE enum xz_ret XZ_FUNC dec_main(struct xz_dec *s, struct xz_buf *b)\n{\n\tenum xz_ret ret;\n\n\t/*\n\t * Store the start position for the case when we are in the middle\n\t * of the Index field.\n\t */\n\ts->in_start = b->in_pos;\n\n\twhile (true) {\n\t\tswitch (s->sequence) {\n\t\tcase SEQ_STREAM_HEADER:\n\t\t\t/*\n\t\t\t * Stream Header is copied to s->temp, and then\n\t\t\t * decoded from there. This way if the caller\n\t\t\t * gives us only little input at a time, we can\n\t\t\t * still keep the Stream Header decoding code\n\t\t\t * simple. Similar approach is used in many places\n\t\t\t * in this file.\n\t\t\t */\n\t\t\tif (!fill_temp(s, b))\n\t\t\t\treturn XZ_OK;\n\n\t\t\t/*\n\t\t\t * If dec_stream_header() returns\n\t\t\t * XZ_UNSUPPORTED_CHECK, it is still possible\n\t\t\t * to continue decoding if working in multi-call\n\t\t\t * mode. Thus, update s->sequence before calling\n\t\t\t * dec_stream_header().\n\t\t\t */\n\t\t\ts->sequence = SEQ_BLOCK_START;\n\n\t\t\tret = dec_stream_header(s);\n\t\t\tif (ret != XZ_OK)\n\t\t\t\treturn ret;\n\n\t\tcase SEQ_BLOCK_START:\n\t\t\t/* We need one byte of input to continue. */\n\t\t\tif (b->in_pos == b->in_size)\n\t\t\t\treturn XZ_OK;\n\n\t\t\t/* See if this is the beginning of the Index field. */\n\t\t\tif (b->in[b->in_pos] == 0) {\n\t\t\t\ts->in_start = b->in_pos++;\n\t\t\t\ts->sequence = SEQ_INDEX;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Calculate the size of the Block Header and\n\t\t\t * prepare to decode it.\n\t\t\t */\n\t\t\ts->block_header.size\n\t\t\t\t= ((uint32_t)b->in[b->in_pos] + 1) * 4;\n\n\t\t\ts->temp.size = s->block_header.size;\n\t\t\ts->temp.pos = 0;\n\t\t\ts->sequence = SEQ_BLOCK_HEADER;\n\n\t\tcase SEQ_BLOCK_HEADER:\n\t\t\tif (!fill_temp(s, b))\n\t\t\t\treturn XZ_OK;\n\n\t\t\tret = dec_block_header(s);\n\t\t\tif (ret != XZ_OK)\n\t\t\t\treturn ret;\n\n\t\t\ts->sequence = SEQ_BLOCK_UNCOMPRESS;\n\n\t\tcase SEQ_BLOCK_UNCOMPRESS:\n\t\t\tret = dec_block(s, b);\n\t\t\tif (ret != XZ_STREAM_END)\n\t\t\t\treturn ret;\n\n\t\t\ts->sequence = SEQ_BLOCK_PADDING;\n\n\t\tcase SEQ_BLOCK_PADDING:\n\t\t\t/*\n\t\t\t * Size of Compressed Data + Block Padding\n\t\t\t * must be a multiple of four. We don't need\n\t\t\t * s->block.compressed for anything else\n\t\t\t * anymore, so we use it here to test the size\n\t\t\t * of the Block Padding field.\n\t\t\t */\n\t\t\twhile (s->block.compressed & 3) {\n\t\t\t\tif (b->in_pos == b->in_size)\n\t\t\t\t\treturn XZ_OK;\n\n\t\t\t\tif (b->in[b->in_pos++] != 0)\n\t\t\t\t\treturn XZ_DATA_ERROR;\n\n\t\t\t\t++s->block.compressed;\n\t\t\t}\n\n\t\t\ts->sequence = SEQ_BLOCK_CHECK;\n\n\t\tcase SEQ_BLOCK_CHECK:\n\t\t\tif (s->check_type == XZ_CHECK_CRC32) {\n\t\t\t\tret = crc32_validate(s, b);\n\t\t\t\tif (ret != XZ_STREAM_END)\n\t\t\t\t\treturn ret;\n\t\t\t}\n#ifdef XZ_DEC_ANY_CHECK\n\t\t\telse if (!check_skip(s, b)) {\n\t\t\t\treturn XZ_OK;\n\t\t\t}\n#endif\n\n\t\t\ts->sequence = SEQ_BLOCK_START;\n\t\t\tbreak;\n\n\t\tcase SEQ_INDEX:\n\t\t\tret = dec_index(s, b);\n\t\t\tif (ret != XZ_STREAM_END)\n\t\t\t\treturn ret;\n\n\t\t\ts->sequence = SEQ_INDEX_PADDING;\n\n\t\tcase SEQ_INDEX_PADDING:\n\t\t\twhile ((s->index.size + (b->in_pos - s->in_start))\n\t\t\t\t\t& 3) {\n\t\t\t\tif (b->in_pos == b->in_size) {\n\t\t\t\t\tindex_update(s, b);\n\t\t\t\t\treturn XZ_OK;\n\t\t\t\t}\n\n\t\t\t\tif (b->in[b->in_pos++] != 0)\n\t\t\t\t\treturn XZ_DATA_ERROR;\n\t\t\t}\n\n\t\t\t/* Finish the CRC32 value and Index size. */\n\t\t\tindex_update(s, b);\n\n\t\t\t/* Compare the hashes to validate the Index field. */\n\t\t\tif (!memeq(&s->block.hash, &s->index.hash,\n\t\t\t\t\tsizeof(s->block.hash)))\n\t\t\t\treturn XZ_DATA_ERROR;\n\n\t\t\ts->sequence = SEQ_INDEX_CRC32;\n\n\t\tcase SEQ_INDEX_CRC32:\n\t\t\tret = crc32_validate(s, b);\n\t\t\tif (ret != XZ_STREAM_END)\n\t\t\t\treturn ret;\n\n\t\t\ts->temp.size = STREAM_HEADER_SIZE;\n\t\t\ts->sequence = SEQ_STREAM_FOOTER;\n\n\t\tcase SEQ_STREAM_FOOTER:\n\t\t\tif (!fill_temp(s, b))\n\t\t\t\treturn XZ_OK;\n\n\t\t\treturn dec_stream_footer(s);\n\t\t}\n\t}\n\n\t/* Never reached */\n}\n\n/*\n * xz_dec_run() is a wrapper for dec_main() to handle some special cases in\n * multi-call and single-call decoding.\n *\n * In multi-call mode, we must return XZ_BUF_ERROR when it seems clear that we\n * are not going to make any progress anymore. This is to prevent the caller\n * from calling us infinitely when the input file is truncated or otherwise\n * corrupt. Since zlib-style API allows that the caller fills the input buffer\n * only when the decoder doesn't produce any new output, we have to be careful\n * to avoid returning XZ_BUF_ERROR too easily: XZ_BUF_ERROR is returned only\n * after the second consecutive call to xz_dec_run() that makes no progress.\n *\n * In single-call mode, if we couldn't decode everything and no error\n * occurred, either the input is truncated or the output buffer is too small.\n * Since we know that the last input byte never produces any output, we know\n * that if all the input was consumed and decoding wasn't finished, the file\n * must be corrupt. Otherwise the output buffer has to be too small or the\n * file is corrupt in a way that decoding it produces too big output.\n *\n * If single-call decoding fails, we reset b->in_pos and b->out_pos back to\n * their original values. This is because with some filter chains there won't\n * be any valid uncompressed data in the output buffer unless the decoding\n * actually succeeds (that's the price to pay of using the output buffer as\n * the workspace).\n */\nXZ_EXTERN enum xz_ret XZ_FUNC xz_dec_run(struct xz_dec *s, struct xz_buf *b)\n{\n\tsize_t in_start;\n\tsize_t out_start;\n\tenum xz_ret ret;\n\n\tif (DEC_IS_SINGLE(s->mode))\n\t\txz_dec_reset(s);\n\n\tin_start = b->in_pos;\n\tout_start = b->out_pos;\n\tret = dec_main(s, b);\n\n\tif (DEC_IS_SINGLE(s->mode)) {\n\t\tif (ret == XZ_OK)\n\t\t\tret = b->in_pos == b->in_size\n\t\t\t\t\t? XZ_DATA_ERROR : XZ_BUF_ERROR;\n\n\t\tif (ret != XZ_STREAM_END) {\n\t\t\tb->in_pos = in_start;\n\t\t\tb->out_pos = out_start;\n\t\t}\n\t} else if (ret == XZ_OK && in_start == b->in_pos\n\t\t\t&& out_start == b->out_pos) {\n\t\tif (s->allow_buf_error)\n\t\t\tret = XZ_BUF_ERROR;\n\n\t\ts->allow_buf_error = true;\n\t} else {\n\t\ts->allow_buf_error = false;\n\t}\n\n\treturn ret;\n}\n\nXZ_EXTERN struct xz_dec * XZ_FUNC xz_dec_init(\n\t\tenum xz_mode mode, uint32_t dict_max)\n{\n\tstruct xz_dec *s = kmalloc(sizeof(*s), GFP_KERNEL);\n\tif (s == NULL)\n\t\treturn NULL;\n\n\ts->mode = mode;\n\n#ifdef XZ_DEC_BCJ\n\ts->bcj = xz_dec_bcj_create(DEC_IS_SINGLE(mode));\n\tif (s->bcj == NULL)\n\t\tgoto error_bcj;\n#endif\n\n\ts->lzma2 = xz_dec_lzma2_create(mode, dict_max);\n\tif (s->lzma2 == NULL)\n\t\tgoto error_lzma2;\n\n\txz_dec_reset(s);\n\treturn s;\n\nerror_lzma2:\n#ifdef XZ_DEC_BCJ\n\txz_dec_bcj_end(s->bcj);\nerror_bcj:\n#endif\n\tkfree(s);\n\treturn NULL;\n}\n\nXZ_EXTERN void XZ_FUNC xz_dec_reset(struct xz_dec *s)\n{\n\ts->sequence = SEQ_STREAM_HEADER;\n\ts->allow_buf_error = false;\n\ts->pos = 0;\n\ts->crc32 = 0;\n\tmemzero(&s->block, sizeof(s->block));\n\tmemzero(&s->index, sizeof(s->index));\n\ts->temp.pos = 0;\n\ts->temp.size = STREAM_HEADER_SIZE;\n}\n\nXZ_EXTERN void XZ_FUNC xz_dec_end(struct xz_dec *s)\n{\n\tif (s != NULL) {\n\t\txz_dec_lzma2_end(s->lzma2);\n#ifdef XZ_DEC_BCJ\n\t\txz_dec_bcj_end(s->bcj);\n#endif\n\t\tkfree(s);\n\t}\n}\n"
  },
  {
    "path": "src/bled/xz_lzma2.h",
    "content": "/*\n * LZMA2 definitions\n *\n * Authors: Lasse Collin <lasse.collin@tukaani.org>\n *          Igor Pavlov <http://7-zip.org/>\n *\n * This file has been put into the public domain.\n * You can do whatever you want with this file.\n */\n\n#ifndef XZ_LZMA2_H\n#define XZ_LZMA2_H\n\n/* Range coder constants */\n#define RC_SHIFT_BITS 8\n#define RC_TOP_BITS 24\n#define RC_TOP_VALUE (1 << RC_TOP_BITS)\n#define RC_BIT_MODEL_TOTAL_BITS 11\n#define RC_BIT_MODEL_TOTAL (1 << RC_BIT_MODEL_TOTAL_BITS)\n#define RC_MOVE_BITS 5\n\n/*\n * Maximum number of position states. A position state is the lowest pb\n * number of bits of the current uncompressed offset. In some places there\n * are different sets of probabilities for different position states.\n */\n#define POS_STATES_MAX (1 << 4)\n\n/*\n * This enum is used to track which LZMA symbols have occurred most recently\n * and in which order. This information is used to predict the next symbol.\n *\n * Symbols:\n *  - Literal: One 8-bit byte\n *  - Match: Repeat a chunk of data at some distance\n *  - Long repeat: Multi-byte match at a recently seen distance\n *  - Short repeat: One-byte repeat at a recently seen distance\n *\n * The symbol names are in from STATE_oldest_older_previous. REP means\n * either short or long repeated match, and NONLIT means any non-literal.\n */\nenum lzma_state {\n\tSTATE_LIT_LIT,\n\tSTATE_MATCH_LIT_LIT,\n\tSTATE_REP_LIT_LIT,\n\tSTATE_SHORTREP_LIT_LIT,\n\tSTATE_MATCH_LIT,\n\tSTATE_REP_LIT,\n\tSTATE_SHORTREP_LIT,\n\tSTATE_LIT_MATCH,\n\tSTATE_LIT_LONGREP,\n\tSTATE_LIT_SHORTREP,\n\tSTATE_NONLIT_MATCH,\n\tSTATE_NONLIT_REP\n};\n\n/* Total number of states */\n#define STATES 12\n\n/* The lowest 7 states indicate that the previous state was a literal. */\n#define LIT_STATES 7\n\n/* Indicate that the latest symbol was a literal. */\nstatic inline void XZ_FUNC lzma_state_literal(enum lzma_state *state)\n{\n\tif (*state <= STATE_SHORTREP_LIT_LIT)\n\t\t*state = STATE_LIT_LIT;\n\telse if (*state <= STATE_LIT_SHORTREP)\n\t\t*state -= 3;\n\telse\n\t\t*state -= 6;\n}\n\n/* Indicate that the latest symbol was a match. */\nstatic inline void XZ_FUNC lzma_state_match(enum lzma_state *state)\n{\n\t*state = *state < LIT_STATES ? STATE_LIT_MATCH : STATE_NONLIT_MATCH;\n}\n\n/* Indicate that the latest state was a long repeated match. */\nstatic inline void XZ_FUNC lzma_state_long_rep(enum lzma_state *state)\n{\n\t*state = *state < LIT_STATES ? STATE_LIT_LONGREP : STATE_NONLIT_REP;\n}\n\n/* Indicate that the latest symbol was a short match. */\nstatic inline void XZ_FUNC lzma_state_short_rep(enum lzma_state *state)\n{\n\t*state = *state < LIT_STATES ? STATE_LIT_SHORTREP : STATE_NONLIT_REP;\n}\n\n/* Test if the previous symbol was a literal. */\nstatic inline bool XZ_FUNC lzma_state_is_literal(enum lzma_state state)\n{\n\treturn state < LIT_STATES;\n}\n\n/* Each literal coder is divided in three sections:\n *   - 0x001-0x0FF: Without match byte\n *   - 0x101-0x1FF: With match byte; match bit is 0\n *   - 0x201-0x2FF: With match byte; match bit is 1\n *\n * Match byte is used when the previous LZMA symbol was something else than\n * a literal (that is, it was some kind of match).\n */\n#define LITERAL_CODER_SIZE 0x300\n\n/* Maximum number of literal coders */\n#define LITERAL_CODERS_MAX (1 << 4)\n\n/* Minimum length of a match is two bytes. */\n#define MATCH_LEN_MIN 2\n\n/* Match length is encoded with 4, 5, or 10 bits.\n *\n * Length   Bits\n *  2-9      4 = Choice=0 + 3 bits\n * 10-17     5 = Choice=1 + Choice2=0 + 3 bits\n * 18-273   10 = Choice=1 + Choice2=1 + 8 bits\n */\n#define LEN_LOW_BITS 3\n#define LEN_LOW_SYMBOLS (1 << LEN_LOW_BITS)\n#define LEN_MID_BITS 3\n#define LEN_MID_SYMBOLS (1 << LEN_MID_BITS)\n#define LEN_HIGH_BITS 8\n#define LEN_HIGH_SYMBOLS (1 << LEN_HIGH_BITS)\n#define LEN_SYMBOLS (LEN_LOW_SYMBOLS + LEN_MID_SYMBOLS + LEN_HIGH_SYMBOLS)\n\n/*\n * Maximum length of a match is 273 which is a result of the encoding\n * described above.\n */\n#define MATCH_LEN_MAX (MATCH_LEN_MIN + LEN_SYMBOLS - 1)\n\n/*\n * Different sets of probabilities are used for match distances that have\n * very short match length: Lengths of 2, 3, and 4 bytes have a separate\n * set of probabilities for each length. The matches with longer length\n * use a shared set of probabilities.\n */\n#define DIST_STATES 4\n\n/*\n * Get the index of the appropriate probability array for decoding\n * the distance slot.\n */\nstatic inline uint32_t XZ_FUNC lzma_get_dist_state(uint32_t len)\n{\n\treturn len < DIST_STATES + MATCH_LEN_MIN\n\t\t\t? len - MATCH_LEN_MIN : DIST_STATES - 1;\n}\n\n/*\n * The highest two bits of a 32-bit match distance are encoded using six bits.\n * This six-bit value is called a distance slot. This way encoding a 32-bit\n * value takes 6-36 bits, larger values taking more bits.\n */\n#define DIST_SLOT_BITS 6\n#define DIST_SLOTS (1 << DIST_SLOT_BITS)\n\n/* Match distances up to 127 are fully encoded using probabilities. Since\n * the highest two bits (distance slot) are always encoded using six bits,\n * the distances 0-3 don't need any additional bits to encode, since the\n * distance slot itself is the same as the actual distance. DIST_MODEL_START\n * indicates the first distance slot where at least one additional bit is\n * needed.\n */\n#define DIST_MODEL_START 4\n\n/*\n * Match distances greater than 127 are encoded in three pieces:\n *   - distance slot: the highest two bits\n *   - direct bits: 2-26 bits below the highest two bits\n *   - alignment bits: four lowest bits\n *\n * Direct bits don't use any probabilities.\n *\n * The distance slot value of 14 is for distances 128-191.\n */\n#define DIST_MODEL_END 14\n\n/* Distance slots that indicate a distance <= 127. */\n#define FULL_DISTANCES_BITS (DIST_MODEL_END / 2)\n#define FULL_DISTANCES (1 << FULL_DISTANCES_BITS)\n\n/*\n * For match distances greater than 127, only the highest two bits and the\n * lowest four bits (alignment) is encoded using probabilities.\n */\n#define ALIGN_BITS 4\n#define ALIGN_SIZE (1 << ALIGN_BITS)\n#define ALIGN_MASK (ALIGN_SIZE - 1)\n\n/* Total number of all probability variables */\n#define PROBS_TOTAL (1846 + LITERAL_CODERS_MAX * LITERAL_CODER_SIZE)\n\n/*\n * LZMA remembers the four most recent match distances. Reusing these\n * distances tends to take less space than re-encoding the actual\n * distance value.\n */\n#define REPS 4\n\n#endif\n"
  },
  {
    "path": "src/bled/xz_private.h",
    "content": "/*\n * Private includes and definitions\n *\n * Author: Lasse Collin <lasse.collin@tukaani.org>\n *\n * This file has been put into the public domain.\n * You can do whatever you want with this file.\n */\n\n#ifndef XZ_PRIVATE_H\n#define XZ_PRIVATE_H\n\n#ifdef __KERNEL__\n\t/* XZ_PREBOOT may be defined only via decompress_unxz.c. */\n#\tifndef XZ_PREBOOT\n#\t\tinclude <linux/slab.h>\n#\t\tinclude <linux/vmalloc.h>\n#\t\tinclude <linux/string.h>\n#\t\tdefine memeq(a, b, size) (memcmp(a, b, size) == 0)\n#\t\tdefine memzero(buf, size) memset(buf, 0, size)\n#\tendif\n#\tinclude <asm/byteorder.h>\n#\tinclude <asm/unaligned.h>\n#\tdefine get_le32(p) le32_to_cpup((const uint32_t *)(p))\n\t/* XZ_IGNORE_KCONFIG may be defined only via decompress_unxz.c. */\n#\tifndef XZ_IGNORE_KCONFIG\n#\t\tifdef CONFIG_XZ_DEC_X86\n#\t\t\tdefine XZ_DEC_X86\n#\t\tendif\n#\t\tifdef CONFIG_XZ_DEC_POWERPC\n#\t\t\tdefine XZ_DEC_POWERPC\n#\t\tendif\n#\t\tifdef CONFIG_XZ_DEC_IA64\n#\t\t\tdefine XZ_DEC_IA64\n#\t\tendif\n#\t\tifdef CONFIG_XZ_DEC_ARM\n#\t\t\tdefine XZ_DEC_ARM\n#\t\tendif\n#\t\tifdef CONFIG_XZ_DEC_ARMTHUMB\n#\t\t\tdefine XZ_DEC_ARMTHUMB\n#\t\tendif\n#\t\tifdef CONFIG_XZ_DEC_SPARC\n#\t\t\tdefine XZ_DEC_SPARC\n#\t\tendif\n#\tendif\n#\tinclude <linux/xz.h>\n#else\n\t/*\n\t * For userspace builds, use a separate header to define the required\n\t * macros and functions. This makes it easier to adapt the code into\n\t * different environments and avoids clutter in the Linux kernel tree.\n\t */\n#\tinclude \"xz_config.h\"\n#endif\n\n/* If no specific decoding mode is requested, enable support for all modes. */\n#if !defined(XZ_DEC_SINGLE) && !defined(XZ_DEC_PREALLOC) \\\n\t\t&& !defined(XZ_DEC_DYNALLOC)\n#\tdefine XZ_DEC_SINGLE\n#\tdefine XZ_DEC_PREALLOC\n#\tdefine XZ_DEC_DYNALLOC\n#endif\n\n/*\n * The DEC_IS_foo(mode) macros are used in \"if\" statements. If only some\n * of the supported modes are enabled, these macros will evaluate to true or\n * false at compile time and thus allow the compiler to omit unneeded code.\n */\n#ifdef XZ_DEC_SINGLE\n#\tdefine DEC_IS_SINGLE(mode) ((mode) == XZ_SINGLE)\n#else\n#\tdefine DEC_IS_SINGLE(mode) (false)\n#endif\n\n#ifdef XZ_DEC_PREALLOC\n#\tdefine DEC_IS_PREALLOC(mode) ((mode) == XZ_PREALLOC)\n#else\n#\tdefine DEC_IS_PREALLOC(mode) (false)\n#endif\n\n#ifdef XZ_DEC_DYNALLOC\n#\tdefine DEC_IS_DYNALLOC(mode) ((mode) == XZ_DYNALLOC)\n#else\n#\tdefine DEC_IS_DYNALLOC(mode) (false)\n#endif\n\n#if !defined(XZ_DEC_SINGLE)\n#\tdefine DEC_IS_MULTI(mode) (true)\n#elif defined(XZ_DEC_PREALLOC) || defined(XZ_DEC_DYNALLOC)\n#\tdefine DEC_IS_MULTI(mode) ((mode) != XZ_SINGLE)\n#else\n#\tdefine DEC_IS_MULTI(mode) (false)\n#endif\n\n/*\n * If any of the BCJ filter decoders are wanted, define XZ_DEC_BCJ.\n * XZ_DEC_BCJ is used to enable generic support for BCJ decoders.\n */\n#ifndef XZ_DEC_BCJ\n#\tif defined(XZ_DEC_X86) || defined(XZ_DEC_POWERPC) \\\n\t\t\t|| defined(XZ_DEC_IA64) || defined(XZ_DEC_ARM) \\\n\t\t\t|| defined(XZ_DEC_ARM) || defined(XZ_DEC_ARMTHUMB) \\\n\t\t\t|| defined(XZ_DEC_SPARC)\n#\t\tdefine XZ_DEC_BCJ\n#\tendif\n#endif\n\n/*\n * Allocate memory for LZMA2 decoder. xz_dec_lzma2_reset() must be used\n * before calling xz_dec_lzma2_run().\n */\nXZ_EXTERN struct xz_dec_lzma2 * XZ_FUNC xz_dec_lzma2_create(\n\t\tenum xz_mode mode, uint32_t dict_max);\n\n/*\n * Decode the LZMA2 properties (one byte) and reset the decoder. Return\n * XZ_OK on success, XZ_MEMLIMIT_ERROR if the preallocated dictionary is not\n * big enough, and XZ_OPTIONS_ERROR if props indicates something that this\n * decoder doesn't support.\n */\nXZ_EXTERN enum xz_ret XZ_FUNC xz_dec_lzma2_reset(\n\t\tstruct xz_dec_lzma2 *s, uint8_t props);\n\n/* Decode raw LZMA2 stream from b->in to b->out. */\nXZ_EXTERN enum xz_ret XZ_FUNC xz_dec_lzma2_run(\n\t\tstruct xz_dec_lzma2 *s, struct xz_buf *b);\n\n/* Free the memory allocated for the LZMA2 decoder. */\nXZ_EXTERN void XZ_FUNC xz_dec_lzma2_end(struct xz_dec_lzma2 *s);\n\n#ifdef XZ_DEC_BCJ\n/*\n * Allocate memory for BCJ decoders. xz_dec_bcj_reset() must be used before\n * calling xz_dec_bcj_run().\n */\nXZ_EXTERN struct xz_dec_bcj * XZ_FUNC xz_dec_bcj_create(bool single_call);\n\n/*\n * Decode the Filter ID of a BCJ filter. This implementation doesn't\n * support custom start offsets, so no decoding of Filter Properties\n * is needed. Returns XZ_OK if the given Filter ID is supported.\n * Otherwise XZ_OPTIONS_ERROR is returned.\n */\nXZ_EXTERN enum xz_ret XZ_FUNC xz_dec_bcj_reset(\n\t\tstruct xz_dec_bcj *s, uint8_t id);\n\n/*\n * Decode raw BCJ + LZMA2 stream. This must be used only if there actually is\n * a BCJ filter in the chain. If the chain has only LZMA2, xz_dec_lzma2_run()\n * must be called directly.\n */\nXZ_EXTERN enum xz_ret XZ_FUNC xz_dec_bcj_run(struct xz_dec_bcj *s,\n\t\tstruct xz_dec_lzma2 *lzma2, struct xz_buf *b);\n\n/* Free the memory allocated for the BCJ filters. */\n#define xz_dec_bcj_end(s) kfree(s)\n#endif\n\n#endif\n"
  },
  {
    "path": "src/bled/xz_stream.h",
    "content": "/*\n * Definitions for handling the .xz file format\n *\n * Author: Lasse Collin <lasse.collin@tukaani.org>\n *\n * This file has been put into the public domain.\n * You can do whatever you want with this file.\n */\n\n#ifndef XZ_STREAM_H\n#define XZ_STREAM_H\n\n#if defined(__KERNEL__) && !XZ_INTERNAL_CRC32\n#\tinclude <linux/crc32.h>\n#\tundef crc32\n#\tdefine xz_crc32(buf, size, crc) \\\n\t\t(~crc32_le(~(uint32_t)(crc), buf, size))\n#endif\n\n/*\n * See the .xz file format specification at\n * http://tukaani.org/xz/xz-file-format.txt\n * to understand the container format.\n */\n\n#define STREAM_HEADER_SIZE 12\n\n#define HEADER_MAGIC \"\\xFD\" \"7zXZ\"\n#define HEADER_MAGIC_SIZE 6\n\n#define FOOTER_MAGIC \"YZ\"\n#define FOOTER_MAGIC_SIZE 2\n\n/*\n * Variable-length integer can hold a 63-bit unsigned integer or a special\n * value indicating that the value is unknown.\n *\n * Experimental: vli_type can be defined to uint32_t to save a few bytes\n * in code size (no effect on speed). Doing so limits the uncompressed and\n * compressed size of the file to less than 256 MiB and may also weaken\n * error detection slightly.\n */\ntypedef uint64_t vli_type;\n\n#define VLI_MAX ((vli_type)-1 / 2)\n#define VLI_UNKNOWN ((vli_type)-1)\n\n/* Maximum encoded size of a VLI */\n#define VLI_BYTES_MAX (sizeof(vli_type) * 8 / 7)\n\n/* Integrity Check types */\nenum xz_check {\n\tXZ_CHECK_NONE = 0,\n\tXZ_CHECK_CRC32 = 1,\n\tXZ_CHECK_CRC64 = 4,\n\tXZ_CHECK_SHA256 = 10\n};\n\n/* Maximum possible Check ID */\n#define XZ_CHECK_MAX 15\n\n#endif\n"
  },
  {
    "path": "src/bled/zstd.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n#ifndef ZSTD_H_235446\n#define ZSTD_H_235446\n\n/* ======   Dependencies   ======*/\n#include <stddef.h>   /* size_t */\n#include \"zstd_config.h\"\n\n/* =====   ZSTDLIB_API : control library symbols visibility   ===== */\n#ifndef ZSTDLIB_VISIBLE\n   /* Backwards compatibility with old macro name */\n#  ifdef ZSTDLIB_VISIBILITY\n#    define ZSTDLIB_VISIBLE ZSTDLIB_VISIBILITY\n#  elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)\n#    define ZSTDLIB_VISIBLE __attribute__ ((visibility (\"default\")))\n#  else\n#    define ZSTDLIB_VISIBLE\n#  endif\n#endif\n\n#ifndef ZSTDLIB_HIDDEN\n#  if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)\n#    define ZSTDLIB_HIDDEN __attribute__ ((visibility (\"hidden\")))\n#  else\n#    define ZSTDLIB_HIDDEN\n#  endif\n#endif\n\n#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)\n#  define ZSTDLIB_API __declspec(dllexport) ZSTDLIB_VISIBLE\n#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)\n#  define ZSTDLIB_API __declspec(dllimport) ZSTDLIB_VISIBLE /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/\n#else\n#  define ZSTDLIB_API ZSTDLIB_VISIBLE\n#endif\n\n/* Deprecation warnings :\n * Should these warnings be a problem, it is generally possible to disable them,\n * typically with -Wno-deprecated-declarations for gcc or _CRT_SECURE_NO_WARNINGS in Visual.\n * Otherwise, it's also possible to define ZSTD_DISABLE_DEPRECATE_WARNINGS.\n */\n#ifdef ZSTD_DISABLE_DEPRECATE_WARNINGS\n#  define ZSTD_DEPRECATED(message) /* disable deprecation warnings */\n#else\n#  if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */\n#    define ZSTD_DEPRECATED(message) [[deprecated(message)]]\n#  elif (defined(GNUC) && (GNUC > 4 || (GNUC == 4 && GNUC_MINOR >= 5))) || defined(__clang__) || defined(__IAR_SYSTEMS_ICC__)\n#    define ZSTD_DEPRECATED(message) __attribute__((deprecated(message)))\n#  elif defined(__GNUC__) && (__GNUC__ >= 3)\n#    define ZSTD_DEPRECATED(message) __attribute__((deprecated))\n#  elif defined(_MSC_VER)\n#    define ZSTD_DEPRECATED(message) __declspec(deprecated(message))\n#  else\n#    pragma message(\"WARNING: You need to implement ZSTD_DEPRECATED for this compiler\")\n#    define ZSTD_DEPRECATED(message)\n#  endif\n#endif /* ZSTD_DISABLE_DEPRECATE_WARNINGS */\n\n\n/*******************************************************************************\n  Introduction\n\n  zstd, short for Zstandard, is a fast lossless compression algorithm, targeting\n  real-time compression scenarios at zlib-level and better compression ratios.\n  The zstd compression library provides in-memory compression and decompression\n  functions.\n\n  The library supports regular compression levels from 1 up to ZSTD_maxCLevel(),\n  which is currently 22. Levels >= 20, labeled `--ultra`, should be used with\n  caution, as they require more memory. The library also offers negative\n  compression levels, which extend the range of speed vs. ratio preferences.\n  The lower the level, the faster the speed (at the cost of compression).\n\n  Compression can be done in:\n    - a single step (described as Simple API)\n    - a single step, reusing a context (described as Explicit context)\n    - unbounded multiple steps (described as Streaming compression)\n\n  The compression ratio achievable on small data can be highly improved using\n  a dictionary. Dictionary compression can be performed in:\n    - a single step (described as Simple dictionary API)\n    - a single step, reusing a dictionary (described as Bulk-processing\n      dictionary API)\n\n  Advanced experimental functions can be accessed using\n  `#define ZSTD_STATIC_LINKING_ONLY` before including zstd.h.\n\n  Advanced experimental APIs should never be used with a dynamically-linked\n  library. They are not \"stable\"; their definitions or signatures may change in\n  the future. Only static linking is allowed.\n*******************************************************************************/\n\n/*------   Version   ------*/\n#define ZSTD_VERSION_MAJOR    1\n#define ZSTD_VERSION_MINOR    5\n#define ZSTD_VERSION_RELEASE  7\n#define ZSTD_VERSION_NUMBER  (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)\n\n/*! ZSTD_versionNumber() :\n *  Return runtime library version, the value is (MAJOR*100*100 + MINOR*100 + RELEASE). */\nZSTDLIB_API unsigned ZSTD_versionNumber(void);\n\n#define ZSTD_LIB_VERSION ZSTD_VERSION_MAJOR.ZSTD_VERSION_MINOR.ZSTD_VERSION_RELEASE\n#define ZSTD_QUOTE(str) #str\n#define ZSTD_EXPAND_AND_QUOTE(str) ZSTD_QUOTE(str)\n#define ZSTD_VERSION_STRING ZSTD_EXPAND_AND_QUOTE(ZSTD_LIB_VERSION)\n\n/*! ZSTD_versionString() :\n *  Return runtime library version, like \"1.4.5\". Requires v1.3.0+. */\nZSTDLIB_API const char* ZSTD_versionString(void);\n\n/* *************************************\n *  Default constant\n ***************************************/\n#ifndef ZSTD_CLEVEL_DEFAULT\n#  define ZSTD_CLEVEL_DEFAULT 3\n#endif\n\n/* *************************************\n *  Constants\n ***************************************/\n\n/* All magic numbers are supposed read/written to/from files/memory using little-endian convention */\n#define ZSTD_MAGICNUMBER            0xFD2FB528    /* valid since v0.8.0 */\n#define ZSTD_MAGIC_DICTIONARY       0xEC30A437    /* valid since v0.7.0 */\n#define ZSTD_MAGIC_SKIPPABLE_START  0x184D2A50    /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */\n#define ZSTD_MAGIC_SKIPPABLE_MASK   0xFFFFFFF0\n\n#define ZSTD_BLOCKSIZELOG_MAX  17\n#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)\n\n\n/***************************************\n*  Simple Core API\n***************************************/\n/*! ZSTD_compress() :\n *  Compresses `src` content as a single zstd compressed frame into already allocated `dst`.\n *  NOTE: Providing `dstCapacity >= ZSTD_compressBound(srcSize)` guarantees that zstd will have\n *        enough space to successfully compress the data.\n *  @return : compressed size written into `dst` (<= `dstCapacity),\n *            or an error code if it fails (which can be tested using ZSTD_isError()). */\nZSTDLIB_API size_t ZSTD_compress( void* dst, size_t dstCapacity,\n                            const void* src, size_t srcSize,\n                                  int compressionLevel);\n\n/*! ZSTD_decompress() :\n * `compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames.\n *  Multiple compressed frames can be decompressed at once with this method.\n *  The result will be the concatenation of all decompressed frames, back to back.\n * `dstCapacity` is an upper bound of originalSize to regenerate.\n *  First frame's decompressed size can be extracted using ZSTD_getFrameContentSize().\n *  If maximum upper bound isn't known, prefer using streaming mode to decompress data.\n * @return : the number of bytes decompressed into `dst` (<= `dstCapacity`),\n *           or an errorCode if it fails (which can be tested using ZSTD_isError()). */\nZSTDLIB_API size_t ZSTD_decompress( void* dst, size_t dstCapacity,\n                              const void* src, size_t compressedSize);\n\n\n/*======  Decompression helper functions  ======*/\n\n/*! ZSTD_getFrameContentSize() : requires v1.3.0+\n * `src` should point to the start of a ZSTD encoded frame.\n * `srcSize` must be at least as large as the frame header.\n *           hint : any size >= `ZSTD_frameHeaderSize_max` is large enough.\n * @return : - decompressed size of `src` frame content, if known\n *           - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined\n *           - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small)\n *  note 1 : a 0 return value means the frame is valid but \"empty\".\n *  note 2 : decompressed size is an optional field, it may not be present (typically in streaming mode).\n *           When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size.\n *           In which case, it's necessary to use streaming mode to decompress data.\n *           Optionally, application can rely on some implicit limit,\n *           as ZSTD_decompress() only needs an upper bound of decompressed size.\n *           (For example, data could be necessarily cut into blocks <= 16 KB).\n *  note 3 : decompressed size is always present when compression is completed using single-pass functions,\n *           such as ZSTD_compress(), ZSTD_compressCCtx() ZSTD_compress_usingDict() or ZSTD_compress_usingCDict().\n *  note 4 : decompressed size can be very large (64-bits value),\n *           potentially larger than what local system can handle as a single memory segment.\n *           In which case, it's necessary to use streaming mode to decompress data.\n *  note 5 : If source is untrusted, decompressed size could be wrong or intentionally modified.\n *           Always ensure return value fits within application's authorized limits.\n *           Each application can set its own limits.\n *  note 6 : This function replaces ZSTD_getDecompressedSize() */\n#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)\n#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)\nZSTDLIB_API unsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize);\n\n/*! ZSTD_getDecompressedSize() :\n *  NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize().\n *  Both functions work the same way, but ZSTD_getDecompressedSize() blends\n *  \"empty\", \"unknown\" and \"error\" results to the same return value (0),\n *  while ZSTD_getFrameContentSize() gives them separate return values.\n * @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise. */\nZSTD_DEPRECATED(\"Replaced by ZSTD_getFrameContentSize\")\nZSTDLIB_API\nunsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);\n\n/*! ZSTD_findFrameCompressedSize() : Requires v1.4.0+\n * `src` should point to the start of a ZSTD frame or skippable frame.\n * `srcSize` must be >= first frame size\n * @return : the compressed size of the first frame starting at `src`,\n *           suitable to pass as `srcSize` to `ZSTD_decompress` or similar,\n *        or an error code if input is invalid */\nZSTDLIB_API size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);\n\n\n/*======  Compression helper functions  ======*/\n\n/*! ZSTD_compressBound() :\n * maximum compressed size in worst case single-pass scenario.\n * When invoking `ZSTD_compress()`, or any other one-pass compression function,\n * it's recommended to provide @dstCapacity >= ZSTD_compressBound(srcSize)\n * as it eliminates one potential failure scenario,\n * aka not enough room in dst buffer to write the compressed frame.\n * Note : ZSTD_compressBound() itself can fail, if @srcSize > ZSTD_MAX_INPUT_SIZE .\n *        In which case, ZSTD_compressBound() will return an error code\n *        which can be tested using ZSTD_isError().\n *\n * ZSTD_COMPRESSBOUND() :\n * same as ZSTD_compressBound(), but as a macro.\n * It can be used to produce constants, which can be useful for static allocation,\n * for example to size a static array on stack.\n * Will produce constant value 0 if srcSize is too large.\n */\n#define ZSTD_MAX_INPUT_SIZE ((sizeof(size_t)==8) ? 0xFF00FF00FF00FF00ULL : 0xFF00FF00U)\n#define ZSTD_COMPRESSBOUND(srcSize)   (((size_t)(srcSize) >= ZSTD_MAX_INPUT_SIZE) ? 0 : (srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0))  /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */\nZSTDLIB_API size_t ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case single-pass scenario */\n\n\n/*======  Error helper functions  ======*/\n#include \"zstd_errors.h\" /* list of errors */\n/* ZSTD_isError() :\n * Most ZSTD_* functions returning a size_t value can be tested for error,\n * using ZSTD_isError().\n * @return 1 if error, 0 otherwise\n */\nZSTDLIB_API unsigned     ZSTD_isError(size_t result);      /*!< tells if a `size_t` function result is an error code */\nZSTDLIB_API ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult); /* convert a result into an error code, which can be compared to error enum list */\nZSTDLIB_API const char*  ZSTD_getErrorName(size_t result); /*!< provides readable string from a function result */\nZSTDLIB_API int          ZSTD_minCLevel(void);             /*!< minimum negative compression level allowed, requires v1.4.0+ */\nZSTDLIB_API int          ZSTD_maxCLevel(void);             /*!< maximum compression level available */\nZSTDLIB_API int          ZSTD_defaultCLevel(void);         /*!< default compression level, specified by ZSTD_CLEVEL_DEFAULT, requires v1.5.0+ */\n\n\n/***************************************\n*  Explicit context\n***************************************/\n/*= Compression context\n *  When compressing many times,\n *  it is recommended to allocate a compression context just once,\n *  and reuse it for each successive compression operation.\n *  This will make the workload easier for system's memory.\n *  Note : re-using context is just a speed / resource optimization.\n *         It doesn't change the compression ratio, which remains identical.\n *  Note 2: For parallel execution in multi-threaded environments,\n *         use one different context per thread .\n */\ntypedef struct ZSTD_CCtx_s ZSTD_CCtx;\nZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx(void);\nZSTDLIB_API size_t     ZSTD_freeCCtx(ZSTD_CCtx* cctx);  /* compatible with NULL pointer */\n\n/*! ZSTD_compressCCtx() :\n *  Same as ZSTD_compress(), using an explicit ZSTD_CCtx.\n *  Important : in order to mirror `ZSTD_compress()` behavior,\n *  this function compresses at the requested compression level,\n *  __ignoring any other advanced parameter__ .\n *  If any advanced parameter was set using the advanced API,\n *  they will all be reset. Only @compressionLevel remains.\n */\nZSTDLIB_API size_t ZSTD_compressCCtx(ZSTD_CCtx* cctx,\n                                     void* dst, size_t dstCapacity,\n                               const void* src, size_t srcSize,\n                                     int compressionLevel);\n\n/*= Decompression context\n *  When decompressing many times,\n *  it is recommended to allocate a context only once,\n *  and reuse it for each successive compression operation.\n *  This will make workload friendlier for system's memory.\n *  Use one context per thread for parallel execution. */\ntypedef struct ZSTD_DCtx_s ZSTD_DCtx;\nZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx(void);\nZSTDLIB_API size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);  /* accept NULL pointer */\n\n/*! ZSTD_decompressDCtx() :\n *  Same as ZSTD_decompress(),\n *  requires an allocated ZSTD_DCtx.\n *  Compatible with sticky parameters (see below).\n */\nZSTDLIB_API size_t ZSTD_decompressDCtx(ZSTD_DCtx* dctx,\n                                       void* dst, size_t dstCapacity,\n                                 const void* src, size_t srcSize);\n\n\n/*********************************************\n*  Advanced compression API (Requires v1.4.0+)\n**********************************************/\n\n/* API design :\n *   Parameters are pushed one by one into an existing context,\n *   using ZSTD_CCtx_set*() functions.\n *   Pushed parameters are sticky : they are valid for next compressed frame, and any subsequent frame.\n *   \"sticky\" parameters are applicable to `ZSTD_compress2()` and `ZSTD_compressStream*()` !\n *   __They do not apply to one-shot variants such as ZSTD_compressCCtx()__ .\n *\n *   It's possible to reset all parameters to \"default\" using ZSTD_CCtx_reset().\n *\n *   This API supersedes all other \"advanced\" API entry points in the experimental section.\n *   In the future, we expect to remove API entry points from experimental which are redundant with this API.\n */\n\n\n/* Compression strategies, listed from fastest to strongest */\ntypedef enum { ZSTD_fast=1,\n               ZSTD_dfast=2,\n               ZSTD_greedy=3,\n               ZSTD_lazy=4,\n               ZSTD_lazy2=5,\n               ZSTD_btlazy2=6,\n               ZSTD_btopt=7,\n               ZSTD_btultra=8,\n               ZSTD_btultra2=9\n               /* note : new strategies _might_ be added in the future.\n                         Only the order (from fast to strong) is guaranteed */\n} ZSTD_strategy;\n\ntypedef enum {\n\n    /* compression parameters\n     * Note: When compressing with a ZSTD_CDict these parameters are superseded\n     * by the parameters used to construct the ZSTD_CDict.\n     * See ZSTD_CCtx_refCDict() for more info (superseded-by-cdict). */\n    ZSTD_c_compressionLevel=100, /* Set compression parameters according to pre-defined cLevel table.\n                              * Note that exact compression parameters are dynamically determined,\n                              * depending on both compression level and srcSize (when known).\n                              * Default level is ZSTD_CLEVEL_DEFAULT==3.\n                              * Special: value 0 means default, which is controlled by ZSTD_CLEVEL_DEFAULT.\n                              * Note 1 : it's possible to pass a negative compression level.\n                              * Note 2 : setting a level does not automatically set all other compression parameters\n                              *   to default. Setting this will however eventually dynamically impact the compression\n                              *   parameters which have not been manually set. The manually set\n                              *   ones will 'stick'. */\n    /* Advanced compression parameters :\n     * It's possible to pin down compression parameters to some specific values.\n     * In which case, these values are no longer dynamically selected by the compressor */\n    ZSTD_c_windowLog=101,    /* Maximum allowed back-reference distance, expressed as power of 2.\n                              * This will set a memory budget for streaming decompression,\n                              * with larger values requiring more memory\n                              * and typically compressing more.\n                              * Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX.\n                              * Special: value 0 means \"use default windowLog\".\n                              * Note: Using a windowLog greater than ZSTD_WINDOWLOG_LIMIT_DEFAULT\n                              *       requires explicitly allowing such size at streaming decompression stage. */\n    ZSTD_c_hashLog=102,      /* Size of the initial probe table, as a power of 2.\n                              * Resulting memory usage is (1 << (hashLog+2)).\n                              * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX.\n                              * Larger tables improve compression ratio of strategies <= dFast,\n                              * and improve speed of strategies > dFast.\n                              * Special: value 0 means \"use default hashLog\". */\n    ZSTD_c_chainLog=103,     /* Size of the multi-probe search table, as a power of 2.\n                              * Resulting memory usage is (1 << (chainLog+2)).\n                              * Must be clamped between ZSTD_CHAINLOG_MIN and ZSTD_CHAINLOG_MAX.\n                              * Larger tables result in better and slower compression.\n                              * This parameter is useless for \"fast\" strategy.\n                              * It's still useful when using \"dfast\" strategy,\n                              * in which case it defines a secondary probe table.\n                              * Special: value 0 means \"use default chainLog\". */\n    ZSTD_c_searchLog=104,    /* Number of search attempts, as a power of 2.\n                              * More attempts result in better and slower compression.\n                              * This parameter is useless for \"fast\" and \"dFast\" strategies.\n                              * Special: value 0 means \"use default searchLog\". */\n    ZSTD_c_minMatch=105,     /* Minimum size of searched matches.\n                              * Note that Zstandard can still find matches of smaller size,\n                              * it just tweaks its search algorithm to look for this size and larger.\n                              * Larger values increase compression and decompression speed, but decrease ratio.\n                              * Must be clamped between ZSTD_MINMATCH_MIN and ZSTD_MINMATCH_MAX.\n                              * Note that currently, for all strategies < btopt, effective minimum is 4.\n                              *                    , for all strategies > fast, effective maximum is 6.\n                              * Special: value 0 means \"use default minMatchLength\". */\n    ZSTD_c_targetLength=106, /* Impact of this field depends on strategy.\n                              * For strategies btopt, btultra & btultra2:\n                              *     Length of Match considered \"good enough\" to stop search.\n                              *     Larger values make compression stronger, and slower.\n                              * For strategy fast:\n                              *     Distance between match sampling.\n                              *     Larger values make compression faster, and weaker.\n                              * Special: value 0 means \"use default targetLength\". */\n    ZSTD_c_strategy=107,     /* See ZSTD_strategy enum definition.\n                              * The higher the value of selected strategy, the more complex it is,\n                              * resulting in stronger and slower compression.\n                              * Special: value 0 means \"use default strategy\". */\n\n    ZSTD_c_targetCBlockSize=130, /* v1.5.6+\n                                  * Attempts to fit compressed block size into approximately targetCBlockSize.\n                                  * Bound by ZSTD_TARGETCBLOCKSIZE_MIN and ZSTD_TARGETCBLOCKSIZE_MAX.\n                                  * Note that it's not a guarantee, just a convergence target (default:0).\n                                  * No target when targetCBlockSize == 0.\n                                  * This is helpful in low bandwidth streaming environments to improve end-to-end latency,\n                                  * when a client can make use of partial documents (a prominent example being Chrome).\n                                  * Note: this parameter is stable since v1.5.6.\n                                  * It was present as an experimental parameter in earlier versions,\n                                  * but it's not recommended using it with earlier library versions\n                                  * due to massive performance regressions.\n                                  */\n    /* LDM mode parameters */\n    ZSTD_c_enableLongDistanceMatching=160, /* Enable long distance matching.\n                                     * This parameter is designed to improve compression ratio\n                                     * for large inputs, by finding large matches at long distance.\n                                     * It increases memory usage and window size.\n                                     * Note: enabling this parameter increases default ZSTD_c_windowLog to 128 MB\n                                     * except when expressly set to a different value.\n                                     * Note: will be enabled by default if ZSTD_c_windowLog >= 128 MB and\n                                     * compression strategy >= ZSTD_btopt (== compression level 16+) */\n    ZSTD_c_ldmHashLog=161,   /* Size of the table for long distance matching, as a power of 2.\n                              * Larger values increase memory usage and compression ratio,\n                              * but decrease compression speed.\n                              * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX\n                              * default: windowlog - 7.\n                              * Special: value 0 means \"automatically determine hashlog\". */\n    ZSTD_c_ldmMinMatch=162,  /* Minimum match size for long distance matcher.\n                              * Larger/too small values usually decrease compression ratio.\n                              * Must be clamped between ZSTD_LDM_MINMATCH_MIN and ZSTD_LDM_MINMATCH_MAX.\n                              * Special: value 0 means \"use default value\" (default: 64). */\n    ZSTD_c_ldmBucketSizeLog=163, /* Log size of each bucket in the LDM hash table for collision resolution.\n                              * Larger values improve collision resolution but decrease compression speed.\n                              * The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX.\n                              * Special: value 0 means \"use default value\" (default: 3). */\n    ZSTD_c_ldmHashRateLog=164, /* Frequency of inserting/looking up entries into the LDM hash table.\n                              * Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).\n                              * Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.\n                              * Larger values improve compression speed.\n                              * Deviating far from default value will likely result in a compression ratio decrease.\n                              * Special: value 0 means \"automatically determine hashRateLog\". */\n\n    /* frame parameters */\n    ZSTD_c_contentSizeFlag=200, /* Content size will be written into frame header _whenever known_ (default:1)\n                              * Content size must be known at the beginning of compression.\n                              * This is automatically the case when using ZSTD_compress2(),\n                              * For streaming scenarios, content size must be provided with ZSTD_CCtx_setPledgedSrcSize() */\n    ZSTD_c_checksumFlag=201, /* A 32-bits checksum of content is written at end of frame (default:0) */\n    ZSTD_c_dictIDFlag=202,   /* When applicable, dictionary's ID is written into frame header (default:1) */\n\n    /* multi-threading parameters */\n    /* These parameters are only active if multi-threading is enabled (compiled with build macro ZSTD_MULTITHREAD).\n     * Otherwise, trying to set any other value than default (0) will be a no-op and return an error.\n     * In a situation where it's unknown if the linked library supports multi-threading or not,\n     * setting ZSTD_c_nbWorkers to any value >= 1 and consulting the return value provides a quick way to check this property.\n     */\n    ZSTD_c_nbWorkers=400,    /* Select how many threads will be spawned to compress in parallel.\n                              * When nbWorkers >= 1, triggers asynchronous mode when invoking ZSTD_compressStream*() :\n                              * ZSTD_compressStream*() consumes input and flush output if possible, but immediately gives back control to caller,\n                              * while compression is performed in parallel, within worker thread(s).\n                              * (note : a strong exception to this rule is when first invocation of ZSTD_compressStream2() sets ZSTD_e_end :\n                              *  in which case, ZSTD_compressStream2() delegates to ZSTD_compress2(), which is always a blocking call).\n                              * More workers improve speed, but also increase memory usage.\n                              * Default value is `0`, aka \"single-threaded mode\" : no worker is spawned,\n                              * compression is performed inside Caller's thread, and all invocations are blocking */\n    ZSTD_c_jobSize=401,      /* Size of a compression job. This value is enforced only when nbWorkers >= 1.\n                              * Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads.\n                              * 0 means default, which is dynamically determined based on compression parameters.\n                              * Job size must be a minimum of overlap size, or ZSTDMT_JOBSIZE_MIN (= 512 KB), whichever is largest.\n                              * The minimum size is automatically and transparently enforced. */\n    ZSTD_c_overlapLog=402,   /* Control the overlap size, as a fraction of window size.\n                              * The overlap size is an amount of data reloaded from previous job at the beginning of a new job.\n                              * It helps preserve compression ratio, while each job is compressed in parallel.\n                              * This value is enforced only when nbWorkers >= 1.\n                              * Larger values increase compression ratio, but decrease speed.\n                              * Possible values range from 0 to 9 :\n                              * - 0 means \"default\" : value will be determined by the library, depending on strategy\n                              * - 1 means \"no overlap\"\n                              * - 9 means \"full overlap\", using a full window size.\n                              * Each intermediate rank increases/decreases load size by a factor 2 :\n                              * 9: full window;  8: w/2;  7: w/4;  6: w/8;  5:w/16;  4: w/32;  3:w/64;  2:w/128;  1:no overlap;  0:default\n                              * default value varies between 6 and 9, depending on strategy */\n\n    /* note : additional experimental parameters are also available\n     * within the experimental section of the API.\n     * At the time of this writing, they include :\n     * ZSTD_c_rsyncable\n     * ZSTD_c_format\n     * ZSTD_c_forceMaxWindow\n     * ZSTD_c_forceAttachDict\n     * ZSTD_c_literalCompressionMode\n     * ZSTD_c_srcSizeHint\n     * ZSTD_c_enableDedicatedDictSearch\n     * ZSTD_c_stableInBuffer\n     * ZSTD_c_stableOutBuffer\n     * ZSTD_c_blockDelimiters\n     * ZSTD_c_validateSequences\n     * ZSTD_c_blockSplitterLevel\n     * ZSTD_c_splitAfterSequences\n     * ZSTD_c_useRowMatchFinder\n     * ZSTD_c_prefetchCDictTables\n     * ZSTD_c_enableSeqProducerFallback\n     * ZSTD_c_maxBlockSize\n     * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.\n     * note : never ever use experimentalParam? names directly;\n     *        also, the enums values themselves are unstable and can still change.\n     */\n     ZSTD_c_experimentalParam1=500,\n     ZSTD_c_experimentalParam2=10,\n     ZSTD_c_experimentalParam3=1000,\n     ZSTD_c_experimentalParam4=1001,\n     ZSTD_c_experimentalParam5=1002,\n     /* was ZSTD_c_experimentalParam6=1003; is now ZSTD_c_targetCBlockSize */\n     ZSTD_c_experimentalParam7=1004,\n     ZSTD_c_experimentalParam8=1005,\n     ZSTD_c_experimentalParam9=1006,\n     ZSTD_c_experimentalParam10=1007,\n     ZSTD_c_experimentalParam11=1008,\n     ZSTD_c_experimentalParam12=1009,\n     ZSTD_c_experimentalParam13=1010,\n     ZSTD_c_experimentalParam14=1011,\n     ZSTD_c_experimentalParam15=1012,\n     ZSTD_c_experimentalParam16=1013,\n     ZSTD_c_experimentalParam17=1014,\n     ZSTD_c_experimentalParam18=1015,\n     ZSTD_c_experimentalParam19=1016,\n     ZSTD_c_experimentalParam20=1017\n} ZSTD_cParameter;\n\ntypedef struct {\n    size_t error;\n    int lowerBound;\n    int upperBound;\n} ZSTD_bounds;\n\n/*! ZSTD_cParam_getBounds() :\n *  All parameters must belong to an interval with lower and upper bounds,\n *  otherwise they will either trigger an error or be automatically clamped.\n * @return : a structure, ZSTD_bounds, which contains\n *         - an error status field, which must be tested using ZSTD_isError()\n *         - lower and upper bounds, both inclusive\n */\nZSTDLIB_API ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter cParam);\n\n/*! ZSTD_CCtx_setParameter() :\n *  Set one compression parameter, selected by enum ZSTD_cParameter.\n *  All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds().\n *  Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter).\n *  Setting a parameter is generally only possible during frame initialization (before starting compression).\n *  Exception : when using multi-threading mode (nbWorkers >= 1),\n *              the following parameters can be updated _during_ compression (within same frame):\n *              => compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy.\n *              new parameters will be active for next job only (after a flush()).\n * @return : an error code (which can be tested using ZSTD_isError()).\n */\nZSTDLIB_API size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value);\n\n/*! ZSTD_CCtx_setPledgedSrcSize() :\n *  Total input data size to be compressed as a single frame.\n *  Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag.\n *  This value will also be controlled at end of frame, and trigger an error if not respected.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame.\n *           In order to mean \"unknown content size\", pass constant ZSTD_CONTENTSIZE_UNKNOWN.\n *           ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame.\n *  Note 2 : pledgedSrcSize is only valid once, for the next frame.\n *           It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN.\n *  Note 3 : Whenever all input data is provided and consumed in a single round,\n *           for example with ZSTD_compress2(),\n *           or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end),\n *           this value is automatically overridden by srcSize instead.\n */\nZSTDLIB_API size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize);\n\ntypedef enum {\n    ZSTD_reset_session_only = 1,\n    ZSTD_reset_parameters = 2,\n    ZSTD_reset_session_and_parameters = 3\n} ZSTD_ResetDirective;\n\n/*! ZSTD_CCtx_reset() :\n *  There are 2 different things that can be reset, independently or jointly :\n *  - The session : will stop compressing current frame, and make CCtx ready to start a new one.\n *                  Useful after an error, or to interrupt any ongoing compression.\n *                  Any internal data not yet flushed is cancelled.\n *                  Compression parameters and dictionary remain unchanged.\n *                  They will be used to compress next frame.\n *                  Resetting session never fails.\n *  - The parameters : changes all parameters back to \"default\".\n *                  This also removes any reference to any dictionary or external sequence producer.\n *                  Parameters can only be changed between 2 sessions (i.e. no compression is currently ongoing)\n *                  otherwise the reset fails, and function returns an error value (which can be tested using ZSTD_isError())\n *  - Both : similar to resetting the session, followed by resetting parameters.\n */\nZSTDLIB_API size_t ZSTD_CCtx_reset(ZSTD_CCtx* cctx, ZSTD_ResetDirective reset);\n\n/*! ZSTD_compress2() :\n *  Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API.\n *  (note that this entry point doesn't even expose a compression level parameter).\n *  ZSTD_compress2() always starts a new frame.\n *  Should cctx hold data from a previously unfinished frame, everything about it is forgotten.\n *  - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()\n *  - The function is always blocking, returns when compression is completed.\n *  NOTE: Providing `dstCapacity >= ZSTD_compressBound(srcSize)` guarantees that zstd will have\n *        enough space to successfully compress the data, though it is possible it fails for other reasons.\n * @return : compressed size written into `dst` (<= `dstCapacity),\n *           or an error code if it fails (which can be tested using ZSTD_isError()).\n */\nZSTDLIB_API size_t ZSTD_compress2( ZSTD_CCtx* cctx,\n                                   void* dst, size_t dstCapacity,\n                             const void* src, size_t srcSize);\n\n\n/***********************************************\n*  Advanced decompression API (Requires v1.4.0+)\n************************************************/\n\n/* The advanced API pushes parameters one by one into an existing DCtx context.\n * Parameters are sticky, and remain valid for all following frames\n * using the same DCtx context.\n * It's possible to reset parameters to default values using ZSTD_DCtx_reset().\n * Note : This API is compatible with existing ZSTD_decompressDCtx() and ZSTD_decompressStream().\n *        Therefore, no new decompression function is necessary.\n */\n\ntypedef enum {\n\n    ZSTD_d_windowLogMax=100, /* Select a size limit (in power of 2) beyond which\n                              * the streaming API will refuse to allocate memory buffer\n                              * in order to protect the host from unreasonable memory requirements.\n                              * This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode.\n                              * By default, a decompression context accepts window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT).\n                              * Special: value 0 means \"use default maximum windowLog\". */\n\n    /* note : additional experimental parameters are also available\n     * within the experimental section of the API.\n     * At the time of this writing, they include :\n     * ZSTD_d_format\n     * ZSTD_d_stableOutBuffer\n     * ZSTD_d_forceIgnoreChecksum\n     * ZSTD_d_refMultipleDDicts\n     * ZSTD_d_disableHuffmanAssembly\n     * ZSTD_d_maxBlockSize\n     * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.\n     * note : never ever use experimentalParam? names directly\n     */\n     ZSTD_d_experimentalParam1=1000,\n     ZSTD_d_experimentalParam2=1001,\n     ZSTD_d_experimentalParam3=1002,\n     ZSTD_d_experimentalParam4=1003,\n     ZSTD_d_experimentalParam5=1004,\n     ZSTD_d_experimentalParam6=1005\n\n} ZSTD_dParameter;\n\n/*! ZSTD_dParam_getBounds() :\n *  All parameters must belong to an interval with lower and upper bounds,\n *  otherwise they will either trigger an error or be automatically clamped.\n * @return : a structure, ZSTD_bounds, which contains\n *         - an error status field, which must be tested using ZSTD_isError()\n *         - both lower and upper bounds, inclusive\n */\nZSTDLIB_API ZSTD_bounds ZSTD_dParam_getBounds(ZSTD_dParameter dParam);\n\n/*! ZSTD_DCtx_setParameter() :\n *  Set one compression parameter, selected by enum ZSTD_dParameter.\n *  All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds().\n *  Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter).\n *  Setting a parameter is only possible during frame initialization (before starting decompression).\n * @return : 0, or an error code (which can be tested using ZSTD_isError()).\n */\nZSTDLIB_API size_t ZSTD_DCtx_setParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, int value);\n\n/*! ZSTD_DCtx_reset() :\n *  Return a DCtx to clean state.\n *  Session and parameters can be reset jointly or separately.\n *  Parameters can only be reset when no active frame is being decompressed.\n * @return : 0, or an error code, which can be tested with ZSTD_isError()\n */\nZSTDLIB_API size_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset);\n\n\n/****************************\n*  Streaming\n****************************/\n\ntypedef struct ZSTD_inBuffer_s {\n  const void* src;    /**< start of input buffer */\n  size_t size;        /**< size of input buffer */\n  size_t pos;         /**< position where reading stopped. Will be updated. Necessarily 0 <= pos <= size */\n} ZSTD_inBuffer;\n\ntypedef struct ZSTD_outBuffer_s {\n  void*  dst;         /**< start of output buffer */\n  size_t size;        /**< size of output buffer */\n  size_t pos;         /**< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size */\n} ZSTD_outBuffer;\n\n\n\n/*-***********************************************************************\n*  Streaming compression - HowTo\n*\n*  A ZSTD_CStream object is required to track streaming operation.\n*  Use ZSTD_createCStream() and ZSTD_freeCStream() to create/release resources.\n*  ZSTD_CStream objects can be reused multiple times on consecutive compression operations.\n*  It is recommended to reuse ZSTD_CStream since it will play nicer with system's memory, by re-using already allocated memory.\n*\n*  For parallel execution, use one separate ZSTD_CStream per thread.\n*\n*  note : since v1.3.0, ZSTD_CStream and ZSTD_CCtx are the same thing.\n*\n*  Parameters are sticky : when starting a new compression on the same context,\n*  it will reuse the same sticky parameters as previous compression session.\n*  When in doubt, it's recommended to fully initialize the context before usage.\n*  Use ZSTD_CCtx_reset() to reset the context and ZSTD_CCtx_setParameter(),\n*  ZSTD_CCtx_setPledgedSrcSize(), or ZSTD_CCtx_loadDictionary() and friends to\n*  set more specific parameters, the pledged source size, or load a dictionary.\n*\n*  Use ZSTD_compressStream2() with ZSTD_e_continue as many times as necessary to\n*  consume input stream. The function will automatically update both `pos`\n*  fields within `input` and `output`.\n*  Note that the function may not consume the entire input, for example, because\n*  the output buffer is already full, in which case `input.pos < input.size`.\n*  The caller must check if input has been entirely consumed.\n*  If not, the caller must make some room to receive more compressed data,\n*  and then present again remaining input data.\n*  note: ZSTD_e_continue is guaranteed to make some forward progress when called,\n*        but doesn't guarantee maximal forward progress. This is especially relevant\n*        when compressing with multiple threads. The call won't block if it can\n*        consume some input, but if it can't it will wait for some, but not all,\n*        output to be flushed.\n* @return : provides a minimum amount of data remaining to be flushed from internal buffers\n*           or an error code, which can be tested using ZSTD_isError().\n*\n*  At any moment, it's possible to flush whatever data might remain stuck within internal buffer,\n*  using ZSTD_compressStream2() with ZSTD_e_flush. `output->pos` will be updated.\n*  Note that, if `output->size` is too small, a single invocation with ZSTD_e_flush might not be enough (return code > 0).\n*  In which case, make some room to receive more compressed data, and call again ZSTD_compressStream2() with ZSTD_e_flush.\n*  You must continue calling ZSTD_compressStream2() with ZSTD_e_flush until it returns 0, at which point you can change the\n*  operation.\n*  note: ZSTD_e_flush will flush as much output as possible, meaning when compressing with multiple threads, it will\n*        block until the flush is complete or the output buffer is full.\n*  @return : 0 if internal buffers are entirely flushed,\n*            >0 if some data still present within internal buffer (the value is minimal estimation of remaining size),\n*            or an error code, which can be tested using ZSTD_isError().\n*\n*  Calling ZSTD_compressStream2() with ZSTD_e_end instructs to finish a frame.\n*  It will perform a flush and write frame epilogue.\n*  The epilogue is required for decoders to consider a frame completed.\n*  flush operation is the same, and follows same rules as calling ZSTD_compressStream2() with ZSTD_e_flush.\n*  You must continue calling ZSTD_compressStream2() with ZSTD_e_end until it returns 0, at which point you are free to\n*  start a new frame.\n*  note: ZSTD_e_end will flush as much output as possible, meaning when compressing with multiple threads, it will\n*        block until the flush is complete or the output buffer is full.\n*  @return : 0 if frame fully completed and fully flushed,\n*            >0 if some data still present within internal buffer (the value is minimal estimation of remaining size),\n*            or an error code, which can be tested using ZSTD_isError().\n*\n* *******************************************************************/\n\ntypedef ZSTD_CCtx ZSTD_CStream;  /**< CCtx and CStream are now effectively same object (>= v1.3.0) */\n                                 /* Continue to distinguish them for compatibility with older versions <= v1.2.0 */\n/*===== ZSTD_CStream management functions =====*/\nZSTDLIB_API ZSTD_CStream* ZSTD_createCStream(void);\nZSTDLIB_API size_t ZSTD_freeCStream(ZSTD_CStream* zcs);  /* accept NULL pointer */\n\n/*===== Streaming compression functions =====*/\ntypedef enum {\n    ZSTD_e_continue=0, /* collect more data, encoder decides when to output compressed result, for optimal compression ratio */\n    ZSTD_e_flush=1,    /* flush any data provided so far,\n                        * it creates (at least) one new block, that can be decoded immediately on reception;\n                        * frame will continue: any future data can still reference previously compressed data, improving compression.\n                        * note : multithreaded compression will block to flush as much output as possible. */\n    ZSTD_e_end=2       /* flush any remaining data _and_ close current frame.\n                        * note that frame is only closed after compressed data is fully flushed (return value == 0).\n                        * After that point, any additional data starts a new frame.\n                        * note : each frame is independent (does not reference any content from previous frame).\n                        : note : multithreaded compression will block to flush as much output as possible. */\n} ZSTD_EndDirective;\n\n/*! ZSTD_compressStream2() : Requires v1.4.0+\n *  Behaves about the same as ZSTD_compressStream, with additional control on end directive.\n *  - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()\n *  - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode)\n *  - output->pos must be <= dstCapacity, input->pos must be <= srcSize\n *  - output->pos and input->pos will be updated. They are guaranteed to remain below their respective limit.\n *  - endOp must be a valid directive\n *  - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller.\n *  - When nbWorkers>=1, function is non-blocking : it copies a portion of input, distributes jobs to internal worker threads, flush to output whatever is available,\n *                                                  and then immediately returns, just indicating that there is some data remaining to be flushed.\n *                                                  The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte.\n *  - Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, the function delegates to ZSTD_compress2() which is always blocking.\n *  - @return provides a minimum amount of data remaining to be flushed from internal buffers\n *            or an error code, which can be tested using ZSTD_isError().\n *            if @return != 0, flush is not fully completed, there is still some data left within internal buffers.\n *            This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers.\n *            For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed.\n *  - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),\n *            only ZSTD_e_end or ZSTD_e_flush operations are allowed.\n *            Before starting a new compression job, or changing compression parameters,\n *            it is required to fully flush internal buffers.\n *  - note: if an operation ends with an error, it may leave @cctx in an undefined state.\n *          Therefore, it's UB to invoke ZSTD_compressStream2() of ZSTD_compressStream() on such a state.\n *          In order to be re-employed after an error, a state must be reset,\n *          which can be done explicitly (ZSTD_CCtx_reset()),\n *          or is sometimes implied by methods starting a new compression job (ZSTD_initCStream(), ZSTD_compressCCtx())\n */\nZSTDLIB_API size_t ZSTD_compressStream2( ZSTD_CCtx* cctx,\n                                         ZSTD_outBuffer* output,\n                                         ZSTD_inBuffer* input,\n                                         ZSTD_EndDirective endOp);\n\n\n/* These buffer sizes are softly recommended.\n * They are not required : ZSTD_compressStream*() happily accepts any buffer size, for both input and output.\n * Respecting the recommended size just makes it a bit easier for ZSTD_compressStream*(),\n * reducing the amount of memory shuffling and buffering, resulting in minor performance savings.\n *\n * However, note that these recommendations are from the perspective of a C caller program.\n * If the streaming interface is invoked from some other language,\n * especially managed ones such as Java or Go, through a foreign function interface such as jni or cgo,\n * a major performance rule is to reduce crossing such interface to an absolute minimum.\n * It's not rare that performance ends being spent more into the interface, rather than compression itself.\n * In which cases, prefer using large buffers, as large as practical,\n * for both input and output, to reduce the nb of roundtrips.\n */\nZSTDLIB_API size_t ZSTD_CStreamInSize(void);    /**< recommended size for input buffer */\nZSTDLIB_API size_t ZSTD_CStreamOutSize(void);   /**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block. */\n\n\n/* *****************************************************************************\n * This following is a legacy streaming API, available since v1.0+ .\n * It can be replaced by ZSTD_CCtx_reset() and ZSTD_compressStream2().\n * It is redundant, but remains fully supported.\n ******************************************************************************/\n\n/*!\n * Equivalent to:\n *\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)\n *     ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);\n *\n * Note that ZSTD_initCStream() clears any previously set dictionary. Use the new API\n * to compress with a dictionary.\n */\nZSTDLIB_API size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);\n/*!\n * Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue).\n * NOTE: The return value is different. ZSTD_compressStream() returns a hint for\n * the next read size (if non-zero and not an error). ZSTD_compressStream2()\n * returns the minimum nb of bytes left to flush (if non-zero and not an error).\n */\nZSTDLIB_API size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);\n/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush). */\nZSTDLIB_API size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);\n/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end). */\nZSTDLIB_API size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);\n\n\n/*-***************************************************************************\n*  Streaming decompression - HowTo\n*\n*  A ZSTD_DStream object is required to track streaming operations.\n*  Use ZSTD_createDStream() and ZSTD_freeDStream() to create/release resources.\n*  ZSTD_DStream objects can be re-employed multiple times.\n*\n*  Use ZSTD_initDStream() to start a new decompression operation.\n* @return : recommended first input size\n*  Alternatively, use advanced API to set specific properties.\n*\n*  Use ZSTD_decompressStream() repetitively to consume your input.\n*  The function will update both `pos` fields.\n*  If `input.pos < input.size`, some input has not been consumed.\n*  It's up to the caller to present again remaining data.\n*\n*  The function tries to flush all data decoded immediately, respecting output buffer size.\n*  If `output.pos < output.size`, decoder has flushed everything it could.\n*\n*  However, when `output.pos == output.size`, it's more difficult to know.\n*  If @return > 0, the frame is not complete, meaning\n*  either there is still some data left to flush within internal buffers,\n*  or there is more input to read to complete the frame (or both).\n*  In which case, call ZSTD_decompressStream() again to flush whatever remains in the buffer.\n*  Note : with no additional input provided, amount of data flushed is necessarily <= ZSTD_BLOCKSIZE_MAX.\n* @return : 0 when a frame is completely decoded and fully flushed,\n*        or an error code, which can be tested using ZSTD_isError(),\n*        or any other value > 0, which means there is still some decoding or flushing to do to complete current frame :\n*                                the return value is a suggested next input size (just a hint for better latency)\n*                                that will never request more than the remaining content of the compressed frame.\n* *******************************************************************************/\n\ntypedef ZSTD_DCtx ZSTD_DStream;  /**< DCtx and DStream are now effectively same object (>= v1.3.0) */\n                                 /* For compatibility with versions <= v1.2.0, prefer differentiating them. */\n/*===== ZSTD_DStream management functions =====*/\nZSTDLIB_API ZSTD_DStream* ZSTD_createDStream(void);\nZSTDLIB_API size_t ZSTD_freeDStream(ZSTD_DStream* zds);  /* accept NULL pointer */\n\n/*===== Streaming decompression functions =====*/\n\n/*! ZSTD_initDStream() :\n * Initialize/reset DStream state for new decompression operation.\n * Call before new decompression operation using same DStream.\n *\n * Note : This function is redundant with the advanced API and equivalent to:\n *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);\n *     ZSTD_DCtx_refDDict(zds, NULL);\n */\nZSTDLIB_API size_t ZSTD_initDStream(ZSTD_DStream* zds);\n\n/*! ZSTD_decompressStream() :\n * Streaming decompression function.\n * Call repetitively to consume full input updating it as necessary.\n * Function will update both input and output `pos` fields exposing current state via these fields:\n * - `input.pos < input.size`, some input remaining and caller should provide remaining input\n *   on the next call.\n * - `output.pos < output.size`, decoder flushed internal output buffer.\n * - `output.pos == output.size`, unflushed data potentially present in the internal buffers,\n *   check ZSTD_decompressStream() @return value,\n *   if > 0, invoke it again to flush remaining data to output.\n * Note : with no additional input, amount of data flushed <= ZSTD_BLOCKSIZE_MAX.\n *\n * @return : 0 when a frame is completely decoded and fully flushed,\n *           or an error code, which can be tested using ZSTD_isError(),\n *           or any other value > 0, which means there is some decoding or flushing to do to complete current frame.\n *\n * Note: when an operation returns with an error code, the @zds state may be left in undefined state.\n *       It's UB to invoke `ZSTD_decompressStream()` on such a state.\n *       In order to re-use such a state, it must be first reset,\n *       which can be done explicitly (`ZSTD_DCtx_reset()`),\n *       or is implied for operations starting some new decompression job (`ZSTD_initDStream`, `ZSTD_decompressDCtx()`, `ZSTD_decompress_usingDict()`)\n */\nZSTDLIB_API size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);\n\nZSTDLIB_API size_t ZSTD_DStreamInSize(void);    /*!< recommended size for input buffer */\nZSTDLIB_API size_t ZSTD_DStreamOutSize(void);   /*!< recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances. */\n\n\n/**************************\n*  Simple dictionary API\n***************************/\n/*! ZSTD_compress_usingDict() :\n *  Compression at an explicit compression level using a Dictionary.\n *  A dictionary can be any arbitrary data segment (also called a prefix),\n *  or a buffer with specified information (see zdict.h).\n *  Note : This function loads the dictionary, resulting in significant startup delay.\n *         It's intended for a dictionary used only once.\n *  Note 2 : When `dict == NULL || dictSize < 8` no dictionary is used. */\nZSTDLIB_API size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx,\n                                           void* dst, size_t dstCapacity,\n                                     const void* src, size_t srcSize,\n                                     const void* dict,size_t dictSize,\n                                           int compressionLevel);\n\n/*! ZSTD_decompress_usingDict() :\n *  Decompression using a known Dictionary.\n *  Dictionary must be identical to the one used during compression.\n *  Note : This function loads the dictionary, resulting in significant startup delay.\n *         It's intended for a dictionary used only once.\n *  Note : When `dict == NULL || dictSize < 8` no dictionary is used. */\nZSTDLIB_API size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,\n                                             void* dst, size_t dstCapacity,\n                                       const void* src, size_t srcSize,\n                                       const void* dict,size_t dictSize);\n\n\n/***********************************\n *  Bulk processing dictionary API\n **********************************/\ntypedef struct ZSTD_CDict_s ZSTD_CDict;\n\n/*! ZSTD_createCDict() :\n *  When compressing multiple messages or blocks using the same dictionary,\n *  it's recommended to digest the dictionary only once, since it's a costly operation.\n *  ZSTD_createCDict() will create a state from digesting a dictionary.\n *  The resulting state can be used for future compression operations with very limited startup cost.\n *  ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only.\n * @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict.\n *  Note 1 : Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate @dictBuffer content.\n *  Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer,\n *      in which case the only thing that it transports is the @compressionLevel.\n *      This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively,\n *      expecting a ZSTD_CDict parameter with any data, including those without a known dictionary. */\nZSTDLIB_API ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,\n                                         int compressionLevel);\n\n/*! ZSTD_freeCDict() :\n *  Function frees memory allocated by ZSTD_createCDict().\n *  If a NULL pointer is passed, no operation is performed. */\nZSTDLIB_API size_t      ZSTD_freeCDict(ZSTD_CDict* CDict);\n\n/*! ZSTD_compress_usingCDict() :\n *  Compression using a digested Dictionary.\n *  Recommended when same dictionary is used multiple times.\n *  Note : compression level is _decided at dictionary creation time_,\n *     and frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no) */\nZSTDLIB_API size_t ZSTD_compress_usingCDict(ZSTD_CCtx* cctx,\n                                            void* dst, size_t dstCapacity,\n                                      const void* src, size_t srcSize,\n                                      const ZSTD_CDict* cdict);\n\n\ntypedef struct ZSTD_DDict_s ZSTD_DDict;\n\n/*! ZSTD_createDDict() :\n *  Create a digested dictionary, ready to start decompression operation without startup delay.\n *  dictBuffer can be released after DDict creation, as its content is copied inside DDict. */\nZSTDLIB_API ZSTD_DDict* ZSTD_createDDict(const void* dictBuffer, size_t dictSize);\n\n/*! ZSTD_freeDDict() :\n *  Function frees memory allocated with ZSTD_createDDict()\n *  If a NULL pointer is passed, no operation is performed. */\nZSTDLIB_API size_t      ZSTD_freeDDict(ZSTD_DDict* ddict);\n\n/*! ZSTD_decompress_usingDDict() :\n *  Decompression using a digested Dictionary.\n *  Recommended when same dictionary is used multiple times. */\nZSTDLIB_API size_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,\n                                              void* dst, size_t dstCapacity,\n                                        const void* src, size_t srcSize,\n                                        const ZSTD_DDict* ddict);\n\n\n/********************************\n *  Dictionary helper functions\n *******************************/\n\n/*! ZSTD_getDictID_fromDict() : Requires v1.4.0+\n *  Provides the dictID stored within dictionary.\n *  if @return == 0, the dictionary is not conformant with Zstandard specification.\n *  It can still be loaded, but as a content-only dictionary. */\nZSTDLIB_API unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);\n\n/*! ZSTD_getDictID_fromCDict() : Requires v1.5.0+\n *  Provides the dictID of the dictionary loaded into `cdict`.\n *  If @return == 0, the dictionary is not conformant to Zstandard specification, or empty.\n *  Non-conformant dictionaries can still be loaded, but as content-only dictionaries. */\nZSTDLIB_API unsigned ZSTD_getDictID_fromCDict(const ZSTD_CDict* cdict);\n\n/*! ZSTD_getDictID_fromDDict() : Requires v1.4.0+\n *  Provides the dictID of the dictionary loaded into `ddict`.\n *  If @return == 0, the dictionary is not conformant to Zstandard specification, or empty.\n *  Non-conformant dictionaries can still be loaded, but as content-only dictionaries. */\nZSTDLIB_API unsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict);\n\n/*! ZSTD_getDictID_fromFrame() : Requires v1.4.0+\n *  Provides the dictID required to decompressed the frame stored within `src`.\n *  If @return == 0, the dictID could not be decoded.\n *  This could for one of the following reasons :\n *  - The frame does not require a dictionary to be decoded (most common case).\n *  - The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden piece of information.\n *    Note : this use case also happens when using a non-conformant dictionary.\n *  - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`).\n *  - This is not a Zstandard frame.\n *  When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code. */\nZSTDLIB_API unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize);\n\n\n/*******************************************************************************\n * Advanced dictionary and prefix API (Requires v1.4.0+)\n *\n * This API allows dictionaries to be used with ZSTD_compress2(),\n * ZSTD_compressStream2(), and ZSTD_decompressDCtx().\n * Dictionaries are sticky, they remain valid when same context is reused,\n * they only reset when the context is reset\n * with ZSTD_reset_parameters or ZSTD_reset_session_and_parameters.\n * In contrast, Prefixes are single-use.\n ******************************************************************************/\n\n\n/*! ZSTD_CCtx_loadDictionary() : Requires v1.4.0+\n *  Create an internal CDict from `dict` buffer.\n *  Decompression will have to use same dictionary.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary,\n *           meaning \"return to no-dictionary mode\".\n *  Note 1 : Dictionary is sticky, it will be used for all future compressed frames,\n *           until parameters are reset, a new dictionary is loaded, or the dictionary\n *           is explicitly invalidated by loading a NULL dictionary.\n *  Note 2 : Loading a dictionary involves building tables.\n *           It's also a CPU consuming operation, with non-negligible impact on latency.\n *           Tables are dependent on compression parameters, and for this reason,\n *           compression parameters can no longer be changed after loading a dictionary.\n *  Note 3 :`dict` content will be copied internally.\n *           Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead.\n *           In such a case, dictionary buffer must outlive its users.\n *  Note 4 : Use ZSTD_CCtx_loadDictionary_advanced()\n *           to precisely select how dictionary content must be interpreted.\n *  Note 5 : This method does not benefit from LDM (long distance mode).\n *           If you want to employ LDM on some large dictionary content,\n *           prefer employing ZSTD_CCtx_refPrefix() described below.\n */\nZSTDLIB_API size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);\n\n/*! ZSTD_CCtx_refCDict() : Requires v1.4.0+\n *  Reference a prepared dictionary, to be used for all future compressed frames.\n *  Note that compression parameters are enforced from within CDict,\n *  and supersede any compression parameter previously set within CCtx.\n *  The parameters ignored are labelled as \"superseded-by-cdict\" in the ZSTD_cParameter enum docs.\n *  The ignored parameters will be used again if the CCtx is returned to no-dictionary mode.\n *  The dictionary will remain valid for future compressed frames using same CCtx.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Special : Referencing a NULL CDict means \"return to no-dictionary mode\".\n *  Note 1 : Currently, only one dictionary can be managed.\n *           Referencing a new dictionary effectively \"discards\" any previous one.\n *  Note 2 : CDict is just referenced, its lifetime must outlive its usage within CCtx. */\nZSTDLIB_API size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);\n\n/*! ZSTD_CCtx_refPrefix() : Requires v1.4.0+\n *  Reference a prefix (single-usage dictionary) for next compressed frame.\n *  A prefix is **only used once**. Tables are discarded at end of frame (ZSTD_e_end).\n *  Decompression will need same prefix to properly regenerate data.\n *  Compressing with a prefix is similar in outcome as performing a diff and compressing it,\n *  but performs much faster, especially during decompression (compression speed is tunable with compression level).\n *  This method is compatible with LDM (long distance mode).\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary\n *  Note 1 : Prefix buffer is referenced. It **must** outlive compression.\n *           Its content must remain unmodified during compression.\n *  Note 2 : If the intention is to diff some large src data blob with some prior version of itself,\n *           ensure that the window size is large enough to contain the entire source.\n *           See ZSTD_c_windowLog.\n *  Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters.\n *           It's a CPU consuming operation, with non-negligible impact on latency.\n *           If there is a need to use the same prefix multiple times, consider loadDictionary instead.\n *  Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent).\n *           Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation. */\nZSTDLIB_API size_t ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx,\n                                 const void* prefix, size_t prefixSize);\n\n/*! ZSTD_DCtx_loadDictionary() : Requires v1.4.0+\n *  Create an internal DDict from dict buffer, to be used to decompress all future frames.\n *  The dictionary remains valid for all future frames, until explicitly invalidated, or\n *  a new dictionary is loaded.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary,\n *            meaning \"return to no-dictionary mode\".\n *  Note 1 : Loading a dictionary involves building tables,\n *           which has a non-negligible impact on CPU usage and latency.\n *           It's recommended to \"load once, use many times\", to amortize the cost\n *  Note 2 :`dict` content will be copied internally, so `dict` can be released after loading.\n *           Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead.\n *  Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of\n *           how dictionary content is loaded and interpreted.\n */\nZSTDLIB_API size_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);\n\n/*! ZSTD_DCtx_refDDict() : Requires v1.4.0+\n *  Reference a prepared dictionary, to be used to decompress next frames.\n *  The dictionary remains active for decompression of future frames using same DCtx.\n *\n *  If called with ZSTD_d_refMultipleDDicts enabled, repeated calls of this function\n *  will store the DDict references in a table, and the DDict used for decompression\n *  will be determined at decompression time, as per the dict ID in the frame.\n *  The memory for the table is allocated on the first call to refDDict, and can be\n *  freed with ZSTD_freeDCtx().\n *\n *  If called with ZSTD_d_refMultipleDDicts disabled (the default), only one dictionary\n *  will be managed, and referencing a dictionary effectively \"discards\" any previous one.\n *\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Special: referencing a NULL DDict means \"return to no-dictionary mode\".\n *  Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx.\n */\nZSTDLIB_API size_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);\n\n/*! ZSTD_DCtx_refPrefix() : Requires v1.4.0+\n *  Reference a prefix (single-usage dictionary) to decompress next frame.\n *  This is the reverse operation of ZSTD_CCtx_refPrefix(),\n *  and must use the same prefix as the one used during compression.\n *  Prefix is **only used once**. Reference is discarded at end of frame.\n *  End of frame is reached when ZSTD_decompressStream() returns 0.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n *  Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary\n *  Note 2 : Prefix buffer is referenced. It **must** outlive decompression.\n *           Prefix buffer must remain unmodified up to the end of frame,\n *           reached when ZSTD_decompressStream() returns 0.\n *  Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent).\n *           Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section)\n *  Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost.\n *           A full dictionary is more costly, as it requires building tables.\n */\nZSTDLIB_API size_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx,\n                                 const void* prefix, size_t prefixSize);\n\n/* ===   Memory management   === */\n\n/*! ZSTD_sizeof_*() : Requires v1.4.0+\n *  These functions give the _current_ memory usage of selected object.\n *  Note that object memory usage can evolve (increase or decrease) over time. */\nZSTDLIB_API size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);\nZSTDLIB_API size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);\nZSTDLIB_API size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);\nZSTDLIB_API size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);\nZSTDLIB_API size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);\nZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);\n\n#endif  /* ZSTD_H_235446 */\n\n\n/* **************************************************************************************\n *   ADVANCED AND EXPERIMENTAL FUNCTIONS\n ****************************************************************************************\n * The definitions in the following section are considered experimental.\n * They are provided for advanced scenarios.\n * They should never be used with a dynamic library, as prototypes may change in the future.\n * Use them only in association with static linking.\n * ***************************************************************************************/\n\n#if defined(ZSTD_STATIC_LINKING_ONLY) && !defined(ZSTD_H_ZSTD_STATIC_LINKING_ONLY)\n#define ZSTD_H_ZSTD_STATIC_LINKING_ONLY\n\n#include <limits.h>   /* INT_MAX */\n\n/* This can be overridden externally to hide static symbols. */\n#ifndef ZSTDLIB_STATIC_API\n#  if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)\n#    define ZSTDLIB_STATIC_API __declspec(dllexport) ZSTDLIB_VISIBLE\n#  elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)\n#    define ZSTDLIB_STATIC_API __declspec(dllimport) ZSTDLIB_VISIBLE\n#  else\n#    define ZSTDLIB_STATIC_API ZSTDLIB_VISIBLE\n#  endif\n#endif\n\n/****************************************************************************************\n *   experimental API (static linking only)\n ****************************************************************************************\n * The following symbols and constants\n * are not planned to join \"stable API\" status in the near future.\n * They can still change in future versions.\n * Some of them are planned to remain in the static_only section indefinitely.\n * Some of them might be removed in the future (especially when redundant with existing stable functions)\n * ***************************************************************************************/\n\n#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1)   /* minimum input size required to query frame header size */\n#define ZSTD_FRAMEHEADERSIZE_MIN(format)    ((format) == ZSTD_f_zstd1 ? 6 : 2)\n#define ZSTD_FRAMEHEADERSIZE_MAX   18   /* can be useful for static allocation */\n#define ZSTD_SKIPPABLEHEADERSIZE    8\n\n/* compression parameter bounds */\n#define ZSTD_WINDOWLOG_MAX_32    30\n#define ZSTD_WINDOWLOG_MAX_64    31\n#define ZSTD_WINDOWLOG_MAX     ((int)(sizeof(size_t) == 4 ? ZSTD_WINDOWLOG_MAX_32 : ZSTD_WINDOWLOG_MAX_64))\n#define ZSTD_WINDOWLOG_MIN       10\n#define ZSTD_HASHLOG_MAX       ((ZSTD_WINDOWLOG_MAX < 30) ? ZSTD_WINDOWLOG_MAX : 30)\n#define ZSTD_HASHLOG_MIN          6\n#define ZSTD_CHAINLOG_MAX_32     29\n#define ZSTD_CHAINLOG_MAX_64     30\n#define ZSTD_CHAINLOG_MAX      ((int)(sizeof(size_t) == 4 ? ZSTD_CHAINLOG_MAX_32 : ZSTD_CHAINLOG_MAX_64))\n#define ZSTD_CHAINLOG_MIN        ZSTD_HASHLOG_MIN\n#define ZSTD_SEARCHLOG_MAX      (ZSTD_WINDOWLOG_MAX-1)\n#define ZSTD_SEARCHLOG_MIN        1\n#define ZSTD_MINMATCH_MAX         7   /* only for ZSTD_fast, other strategies are limited to 6 */\n#define ZSTD_MINMATCH_MIN         3   /* only for ZSTD_btopt+, faster strategies are limited to 4 */\n#define ZSTD_TARGETLENGTH_MAX    ZSTD_BLOCKSIZE_MAX\n#define ZSTD_TARGETLENGTH_MIN     0   /* note : comparing this constant to an unsigned results in a tautological test */\n#define ZSTD_STRATEGY_MIN        ZSTD_fast\n#define ZSTD_STRATEGY_MAX        ZSTD_btultra2\n#define ZSTD_BLOCKSIZE_MAX_MIN (1 << 10) /* The minimum valid max blocksize. Maximum blocksizes smaller than this make compressBound() inaccurate. */\n\n\n#define ZSTD_OVERLAPLOG_MIN       0\n#define ZSTD_OVERLAPLOG_MAX       9\n\n#define ZSTD_WINDOWLOG_LIMIT_DEFAULT 27   /* by default, the streaming decoder will refuse any frame\n                                           * requiring larger than (1<<ZSTD_WINDOWLOG_LIMIT_DEFAULT) window size,\n                                           * to preserve host's memory from unreasonable requirements.\n                                           * This limit can be overridden using ZSTD_DCtx_setParameter(,ZSTD_d_windowLogMax,).\n                                           * The limit does not apply for one-pass decoders (such as ZSTD_decompress()), since no additional memory is allocated */\n\n\n/* LDM parameter bounds */\n#define ZSTD_LDM_HASHLOG_MIN      ZSTD_HASHLOG_MIN\n#define ZSTD_LDM_HASHLOG_MAX      ZSTD_HASHLOG_MAX\n#define ZSTD_LDM_MINMATCH_MIN        4\n#define ZSTD_LDM_MINMATCH_MAX     4096\n#define ZSTD_LDM_BUCKETSIZELOG_MIN   1\n#define ZSTD_LDM_BUCKETSIZELOG_MAX   8\n#define ZSTD_LDM_HASHRATELOG_MIN     0\n#define ZSTD_LDM_HASHRATELOG_MAX (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN)\n\n/* Advanced parameter bounds */\n#define ZSTD_TARGETCBLOCKSIZE_MIN   1340 /* suitable to fit into an ethernet / wifi / 4G transport frame */\n#define ZSTD_TARGETCBLOCKSIZE_MAX   ZSTD_BLOCKSIZE_MAX\n#define ZSTD_SRCSIZEHINT_MIN        0\n#define ZSTD_SRCSIZEHINT_MAX        INT_MAX\n\n\n/* ---  Advanced types  --- */\n\ntypedef struct ZSTD_CCtx_params_s ZSTD_CCtx_params;\n\ntypedef struct {\n    unsigned int offset;      /* The offset of the match. (NOT the same as the offset code)\n                               * If offset == 0 and matchLength == 0, this sequence represents the last\n                               * literals in the block of litLength size.\n                               */\n\n    unsigned int litLength;   /* Literal length of the sequence. */\n    unsigned int matchLength; /* Match length of the sequence. */\n\n                              /* Note: Users of this API may provide a sequence with matchLength == litLength == offset == 0.\n                               * In this case, we will treat the sequence as a marker for a block boundary.\n                               */\n\n    unsigned int rep;         /* Represents which repeat offset is represented by the field 'offset'.\n                               * Ranges from [0, 3].\n                               *\n                               * Repeat offsets are essentially previous offsets from previous sequences sorted in\n                               * recency order. For more detail, see doc/zstd_compression_format.md\n                               *\n                               * If rep == 0, then 'offset' does not contain a repeat offset.\n                               * If rep > 0:\n                               *  If litLength != 0:\n                               *      rep == 1 --> offset == repeat_offset_1\n                               *      rep == 2 --> offset == repeat_offset_2\n                               *      rep == 3 --> offset == repeat_offset_3\n                               *  If litLength == 0:\n                               *      rep == 1 --> offset == repeat_offset_2\n                               *      rep == 2 --> offset == repeat_offset_3\n                               *      rep == 3 --> offset == repeat_offset_1 - 1\n                               *\n                               * Note: This field is optional. ZSTD_generateSequences() will calculate the value of\n                               * 'rep', but repeat offsets do not necessarily need to be calculated from an external\n                               * sequence provider's perspective. For example, ZSTD_compressSequences() does not\n                               * use this 'rep' field at all (as of now).\n                               */\n} ZSTD_Sequence;\n\ntypedef struct {\n    unsigned windowLog;       /**< largest match distance : larger == more compression, more memory needed during decompression */\n    unsigned chainLog;        /**< fully searched segment : larger == more compression, slower, more memory (useless for fast) */\n    unsigned hashLog;         /**< dispatch table : larger == faster, more memory */\n    unsigned searchLog;       /**< nb of searches : larger == more compression, slower */\n    unsigned minMatch;        /**< match length searched : larger == faster decompression, sometimes less compression */\n    unsigned targetLength;    /**< acceptable match size for optimal parser (only) : larger == more compression, slower */\n    ZSTD_strategy strategy;   /**< see ZSTD_strategy definition above */\n} ZSTD_compressionParameters;\n\ntypedef struct {\n    int contentSizeFlag; /**< 1: content size will be in frame header (when known) */\n    int checksumFlag;    /**< 1: generate a 32-bits checksum using XXH64 algorithm at end of frame, for error detection */\n    int noDictIDFlag;    /**< 1: no dictID will be saved into frame header (dictID is only useful for dictionary compression) */\n} ZSTD_frameParameters;\n\ntypedef struct {\n    ZSTD_compressionParameters cParams;\n    ZSTD_frameParameters fParams;\n} ZSTD_parameters;\n\ntypedef enum {\n    ZSTD_dct_auto = 0,       /* dictionary is \"full\" when starting with ZSTD_MAGIC_DICTIONARY, otherwise it is \"rawContent\" */\n    ZSTD_dct_rawContent = 1, /* ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY */\n    ZSTD_dct_fullDict = 2    /* refuses to load a dictionary if it does not respect Zstandard's specification, starting with ZSTD_MAGIC_DICTIONARY */\n} ZSTD_dictContentType_e;\n\ntypedef enum {\n    ZSTD_dlm_byCopy = 0,  /**< Copy dictionary content internally */\n    ZSTD_dlm_byRef = 1    /**< Reference dictionary content -- the dictionary buffer must outlive its users. */\n} ZSTD_dictLoadMethod_e;\n\ntypedef enum {\n    ZSTD_f_zstd1 = 0,           /* zstd frame format, specified in zstd_compression_format.md (default) */\n    ZSTD_f_zstd1_magicless = 1  /* Variant of zstd frame format, without initial 4-bytes magic number.\n                                 * Useful to save 4 bytes per generated frame.\n                                 * Decoder cannot recognise automatically this format, requiring this instruction. */\n} ZSTD_format_e;\n\ntypedef enum {\n    /* Note: this enum controls ZSTD_d_forceIgnoreChecksum */\n    ZSTD_d_validateChecksum = 0,\n    ZSTD_d_ignoreChecksum = 1\n} ZSTD_forceIgnoreChecksum_e;\n\ntypedef enum {\n    /* Note: this enum controls ZSTD_d_refMultipleDDicts */\n    ZSTD_rmd_refSingleDDict = 0,\n    ZSTD_rmd_refMultipleDDicts = 1\n} ZSTD_refMultipleDDicts_e;\n\ntypedef enum {\n    /* Note: this enum and the behavior it controls are effectively internal\n     * implementation details of the compressor. They are expected to continue\n     * to evolve and should be considered only in the context of extremely\n     * advanced performance tuning.\n     *\n     * Zstd currently supports the use of a CDict in three ways:\n     *\n     * - The contents of the CDict can be copied into the working context. This\n     *   means that the compression can search both the dictionary and input\n     *   while operating on a single set of internal tables. This makes\n     *   the compression faster per-byte of input. However, the initial copy of\n     *   the CDict's tables incurs a fixed cost at the beginning of the\n     *   compression. For small compressions (< 8 KB), that copy can dominate\n     *   the cost of the compression.\n     *\n     * - The CDict's tables can be used in-place. In this model, compression is\n     *   slower per input byte, because the compressor has to search two sets of\n     *   tables. However, this model incurs no start-up cost (as long as the\n     *   working context's tables can be reused). For small inputs, this can be\n     *   faster than copying the CDict's tables.\n     *\n     * - The CDict's tables are not used at all, and instead we use the working\n     *   context alone to reload the dictionary and use params based on the source\n     *   size. See ZSTD_compress_insertDictionary() and ZSTD_compress_usingDict().\n     *   This method is effective when the dictionary sizes are very small relative\n     *   to the input size, and the input size is fairly large to begin with.\n     *\n     * Zstd has a simple internal heuristic that selects which strategy to use\n     * at the beginning of a compression. However, if experimentation shows that\n     * Zstd is making poor choices, it is possible to override that choice with\n     * this enum.\n     */\n    ZSTD_dictDefaultAttach = 0, /* Use the default heuristic. */\n    ZSTD_dictForceAttach   = 1, /* Never copy the dictionary. */\n    ZSTD_dictForceCopy     = 2, /* Always copy the dictionary. */\n    ZSTD_dictForceLoad     = 3  /* Always reload the dictionary */\n} ZSTD_dictAttachPref_e;\n\ntypedef enum {\n  ZSTD_lcm_auto = 0,          /**< Automatically determine the compression mode based on the compression level.\n                               *   Negative compression levels will be uncompressed, and positive compression\n                               *   levels will be compressed. */\n  ZSTD_lcm_huffman = 1,       /**< Always attempt Huffman compression. Uncompressed literals will still be\n                               *   emitted if Huffman compression is not profitable. */\n  ZSTD_lcm_uncompressed = 2   /**< Always emit uncompressed literals. */\n} ZSTD_literalCompressionMode_e;\n\ntypedef enum {\n  /* Note: This enum controls features which are conditionally beneficial. Zstd typically will make a final\n   * decision on whether or not to enable the feature (ZSTD_ps_auto), but setting the switch to ZSTD_ps_enable\n   * or ZSTD_ps_disable allow for a force enable/disable the feature.\n   */\n  ZSTD_ps_auto = 0,         /* Let the library automatically determine whether the feature shall be enabled */\n  ZSTD_ps_enable = 1,       /* Force-enable the feature */\n  ZSTD_ps_disable = 2       /* Do not use the feature */\n} ZSTD_paramSwitch_e;\n\n/***************************************\n*  Frame header and size functions\n***************************************/\n\n/*! ZSTD_findDecompressedSize() :\n *  `src` should point to the start of a series of ZSTD encoded and/or skippable frames\n *  `srcSize` must be the _exact_ size of this series\n *       (i.e. there should be a frame boundary at `src + srcSize`)\n *  @return : - decompressed size of all data in all successive frames\n *            - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN\n *            - if an error occurred: ZSTD_CONTENTSIZE_ERROR\n *\n *   note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode.\n *            When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size.\n *            In which case, it's necessary to use streaming mode to decompress data.\n *   note 2 : decompressed size is always present when compression is done with ZSTD_compress()\n *   note 3 : decompressed size can be very large (64-bits value),\n *            potentially larger than what local system can handle as a single memory segment.\n *            In which case, it's necessary to use streaming mode to decompress data.\n *   note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified.\n *            Always ensure result fits within application's authorized limits.\n *            Each application can set its own limits.\n *   note 5 : ZSTD_findDecompressedSize handles multiple frames, and so it must traverse the input to\n *            read each contained frame header.  This is fast as most of the data is skipped,\n *            however it does mean that all frame data must be present and valid. */\nZSTDLIB_STATIC_API unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);\n\n/*! ZSTD_decompressBound() :\n *  `src` should point to the start of a series of ZSTD encoded and/or skippable frames\n *  `srcSize` must be the _exact_ size of this series\n *       (i.e. there should be a frame boundary at `src + srcSize`)\n *  @return : - upper-bound for the decompressed size of all data in all successive frames\n *            - if an error occurred: ZSTD_CONTENTSIZE_ERROR\n *\n *  note 1  : an error can occur if `src` contains an invalid or incorrectly formatted frame.\n *  note 2  : the upper-bound is exact when the decompressed size field is available in every ZSTD encoded frame of `src`.\n *            in this case, `ZSTD_findDecompressedSize` and `ZSTD_decompressBound` return the same value.\n *  note 3  : when the decompressed size field isn't available, the upper-bound for that frame is calculated by:\n *              upper-bound = # blocks * min(128 KB, Window_Size)\n */\nZSTDLIB_STATIC_API unsigned long long ZSTD_decompressBound(const void* src, size_t srcSize);\n\n/*! ZSTD_frameHeaderSize() :\n *  srcSize must be >= ZSTD_FRAMEHEADERSIZE_PREFIX.\n * @return : size of the Frame Header,\n *           or an error code (if srcSize is too small) */\nZSTDLIB_STATIC_API size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);\n\ntypedef enum { ZSTD_frame, ZSTD_skippableFrame } ZSTD_frameType_e;\ntypedef struct {\n    unsigned long long frameContentSize; /* if == ZSTD_CONTENTSIZE_UNKNOWN, it means this field is not available. 0 means \"empty\" */\n    unsigned long long windowSize;       /* can be very large, up to <= frameContentSize */\n    unsigned blockSizeMax;\n    ZSTD_frameType_e frameType;          /* if == ZSTD_skippableFrame, frameContentSize is the size of skippable content */\n    unsigned headerSize;\n    unsigned dictID;\n    unsigned checksumFlag;\n    unsigned _reserved1;\n    unsigned _reserved2;\n} ZSTD_frameHeader;\n\n/*! ZSTD_getFrameHeader() :\n *  decode Frame Header, or requires larger `srcSize`.\n * @return : 0, `zfhPtr` is correctly filled,\n *          >0, `srcSize` is too small, value is wanted `srcSize` amount,\n *           or an error code, which can be tested using ZSTD_isError() */\nZSTDLIB_STATIC_API size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);   /**< doesn't consume input */\n/*! ZSTD_getFrameHeader_advanced() :\n *  same as ZSTD_getFrameHeader(),\n *  with added capability to select a format (like ZSTD_f_zstd1_magicless) */\nZSTDLIB_STATIC_API size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format);\n\n/*! ZSTD_decompressionMargin() :\n * Zstd supports in-place decompression, where the input and output buffers overlap.\n * In this case, the output buffer must be at least (Margin + Output_Size) bytes large,\n * and the input buffer must be at the end of the output buffer.\n *\n *  _______________________ Output Buffer ________________________\n * |                                                              |\n * |                                        ____ Input Buffer ____|\n * |                                       |                      |\n * v                                       v                      v\n * |---------------------------------------|-----------|----------|\n * ^                                                   ^          ^\n * |___________________ Output_Size ___________________|_ Margin _|\n *\n * NOTE: See also ZSTD_DECOMPRESSION_MARGIN().\n * NOTE: This applies only to single-pass decompression through ZSTD_decompress() or\n * ZSTD_decompressDCtx().\n * NOTE: This function supports multi-frame input.\n *\n * @param src The compressed frame(s)\n * @param srcSize The size of the compressed frame(s)\n * @returns The decompression margin or an error that can be checked with ZSTD_isError().\n */\nZSTDLIB_STATIC_API size_t ZSTD_decompressionMargin(const void* src, size_t srcSize);\n\n/*! ZSTD_DECOMPRESS_MARGIN() :\n * Similar to ZSTD_decompressionMargin(), but instead of computing the margin from\n * the compressed frame, compute it from the original size and the blockSizeLog.\n * See ZSTD_decompressionMargin() for details.\n *\n * WARNING: This macro does not support multi-frame input, the input must be a single\n * zstd frame. If you need that support use the function, or implement it yourself.\n *\n * @param originalSize The original uncompressed size of the data.\n * @param blockSize    The block size == MIN(windowSize, ZSTD_BLOCKSIZE_MAX).\n *                     Unless you explicitly set the windowLog smaller than\n *                     ZSTD_BLOCKSIZELOG_MAX you can just use ZSTD_BLOCKSIZE_MAX.\n */\n#define ZSTD_DECOMPRESSION_MARGIN(originalSize, blockSize) ((size_t)(                                              \\\n        ZSTD_FRAMEHEADERSIZE_MAX                                                              /* Frame header */ + \\\n        4                                                                                         /* checksum */ + \\\n        ((originalSize) == 0 ? 0 : 3 * (((originalSize) + (blockSize) - 1) / blockSize)) /* 3 bytes per block */ + \\\n        (blockSize)                                                                    /* One block of margin */   \\\n    ))\n\ntypedef enum {\n  ZSTD_sf_noBlockDelimiters = 0,         /* Representation of ZSTD_Sequence has no block delimiters, sequences only */\n  ZSTD_sf_explicitBlockDelimiters = 1    /* Representation of ZSTD_Sequence contains explicit block delimiters */\n} ZSTD_sequenceFormat_e;\n\n/*! ZSTD_sequenceBound() :\n * `srcSize` : size of the input buffer\n *  @return : upper-bound for the number of sequences that can be generated\n *            from a buffer of srcSize bytes\n *\n *  note : returns number of sequences - to get bytes, multiply by sizeof(ZSTD_Sequence).\n */\nZSTDLIB_STATIC_API size_t ZSTD_sequenceBound(size_t srcSize);\n\n/*! ZSTD_generateSequences() :\n * WARNING: This function is meant for debugging and informational purposes ONLY!\n * Its implementation is flawed, and it will be deleted in a future version.\n * It is not guaranteed to succeed, as there are several cases where it will give\n * up and fail. You should NOT use this function in production code.\n *\n * This function is deprecated, and will be removed in a future version.\n *\n * Generate sequences using ZSTD_compress2(), given a source buffer.\n *\n * @param zc The compression context to be used for ZSTD_compress2(). Set any\n *           compression parameters you need on this context.\n * @param outSeqs The output sequences buffer of size @p outSeqsSize\n * @param outSeqsSize The size of the output sequences buffer.\n *                    ZSTD_sequenceBound(srcSize) is an upper bound on the number\n *                    of sequences that can be generated.\n * @param src The source buffer to generate sequences from of size @p srcSize.\n * @param srcSize The size of the source buffer.\n *\n * Each block will end with a dummy sequence\n * with offset == 0, matchLength == 0, and litLength == length of last literals.\n * litLength may be == 0, and if so, then the sequence of (of: 0 ml: 0 ll: 0)\n * simply acts as a block delimiter.\n *\n * @returns The number of sequences generated, necessarily less than\n *          ZSTD_sequenceBound(srcSize), or an error code that can be checked\n *          with ZSTD_isError().\n */\nZSTD_DEPRECATED(\"For debugging only, will be replaced by ZSTD_extractSequences()\")\nZSTDLIB_STATIC_API size_t\nZSTD_generateSequences(ZSTD_CCtx* zc,\n                       ZSTD_Sequence* outSeqs, size_t outSeqsSize,\n                       const void* src, size_t srcSize);\n\n/*! ZSTD_mergeBlockDelimiters() :\n * Given an array of ZSTD_Sequence, remove all sequences that represent block delimiters/last literals\n * by merging them into the literals of the next sequence.\n *\n * As such, the final generated result has no explicit representation of block boundaries,\n * and the final last literals segment is not represented in the sequences.\n *\n * The output of this function can be fed into ZSTD_compressSequences() with CCtx\n * setting of ZSTD_c_blockDelimiters as ZSTD_sf_noBlockDelimiters\n * @return : number of sequences left after merging\n */\nZSTDLIB_STATIC_API size_t ZSTD_mergeBlockDelimiters(ZSTD_Sequence* sequences, size_t seqsSize);\n\n/*! ZSTD_compressSequences() :\n * Compress an array of ZSTD_Sequence, associated with @src buffer, into dst.\n * @src contains the entire input (not just the literals).\n * If @srcSize > sum(sequence.length), the remaining bytes are considered all literals\n * If a dictionary is included, then the cctx should reference the dict. (see: ZSTD_CCtx_refCDict(), ZSTD_CCtx_loadDictionary(), etc.)\n * The entire source is compressed into a single frame.\n *\n * The compression behavior changes based on cctx params. In particular:\n *    If ZSTD_c_blockDelimiters == ZSTD_sf_noBlockDelimiters, the array of ZSTD_Sequence is expected to contain\n *    no block delimiters (defined in ZSTD_Sequence). Block boundaries are roughly determined based on\n *    the block size derived from the cctx, and sequences may be split. This is the default setting.\n *\n *    If ZSTD_c_blockDelimiters == ZSTD_sf_explicitBlockDelimiters, the array of ZSTD_Sequence is expected to contain\n *    block delimiters (defined in ZSTD_Sequence). Behavior is undefined if no block delimiters are provided.\n *\n *    If ZSTD_c_validateSequences == 0, this function will blindly accept the sequences provided. Invalid sequences cause undefined\n *    behavior. If ZSTD_c_validateSequences == 1, then if sequence is invalid (see doc/zstd_compression_format.md for\n *    specifics regarding offset/matchlength requirements) then the function will bail out and return an error.\n *\n *    In addition to the two adjustable experimental params, there are other important cctx params.\n *    - ZSTD_c_minMatch MUST be set as less than or equal to the smallest match generated by the match finder. It has a minimum value of ZSTD_MINMATCH_MIN.\n *    - ZSTD_c_compressionLevel accordingly adjusts the strength of the entropy coder, as it would in typical compression.\n *    - ZSTD_c_windowLog affects offset validation: this function will return an error at higher debug levels if a provided offset\n *      is larger than what the spec allows for a given window log and dictionary (if present). See: doc/zstd_compression_format.md\n *\n * Note: Repcodes are, as of now, always re-calculated within this function, so ZSTD_Sequence::rep is unused.\n * Note 2: Once we integrate ability to ingest repcodes, the explicit block delims mode must respect those repcodes exactly,\n *         and cannot emit an RLE block that disagrees with the repcode history\n * @return : final compressed size, or a ZSTD error code.\n */\nZSTDLIB_STATIC_API size_t\nZSTD_compressSequences( ZSTD_CCtx* cctx, void* dst, size_t dstSize,\n                        const ZSTD_Sequence* inSeqs, size_t inSeqsSize,\n                        const void* src, size_t srcSize);\n\n\n/*! ZSTD_writeSkippableFrame() :\n * Generates a zstd skippable frame containing data given by src, and writes it to dst buffer.\n *\n * Skippable frames begin with a 4-byte magic number. There are 16 possible choices of magic number,\n * ranging from ZSTD_MAGIC_SKIPPABLE_START to ZSTD_MAGIC_SKIPPABLE_START+15.\n * As such, the parameter magicVariant controls the exact skippable frame magic number variant used, so\n * the magic number used will be ZSTD_MAGIC_SKIPPABLE_START + magicVariant.\n *\n * Returns an error if destination buffer is not large enough, if the source size is not representable\n * with a 4-byte unsigned int, or if the parameter magicVariant is greater than 15 (and therefore invalid).\n *\n * @return : number of bytes written or a ZSTD error.\n */\nZSTDLIB_STATIC_API size_t ZSTD_writeSkippableFrame(void* dst, size_t dstCapacity,\n                                            const void* src, size_t srcSize, unsigned magicVariant);\n\n/*! ZSTD_readSkippableFrame() :\n * Retrieves a zstd skippable frame containing data given by src, and writes it to dst buffer.\n *\n * The parameter magicVariant will receive the magicVariant that was supplied when the frame was written,\n * i.e. magicNumber - ZSTD_MAGIC_SKIPPABLE_START.  This can be NULL if the caller is not interested\n * in the magicVariant.\n *\n * Returns an error if destination buffer is not large enough, or if the frame is not skippable.\n *\n * @return : number of bytes written or a ZSTD error.\n */\nZSTDLIB_API size_t ZSTD_readSkippableFrame(void* dst, size_t dstCapacity, unsigned* magicVariant,\n                                            const void* src, size_t srcSize);\n\n/*! ZSTD_isSkippableFrame() :\n *  Tells if the content of `buffer` starts with a valid Frame Identifier for a skippable frame.\n */\nZSTDLIB_API unsigned ZSTD_isSkippableFrame(const void* buffer, size_t size);\n\n\n\n/***************************************\n*  Memory management\n***************************************/\n\n/*! ZSTD_estimate*() :\n *  These functions make it possible to estimate memory usage\n *  of a future {D,C}Ctx, before its creation.\n *  This is useful in combination with ZSTD_initStatic(),\n *  which makes it possible to employ a static buffer for ZSTD_CCtx* state.\n *\n *  ZSTD_estimateCCtxSize() will provide a memory budget large enough\n *  to compress data of any size using one-shot compression ZSTD_compressCCtx() or ZSTD_compress2()\n *  associated with any compression level up to max specified one.\n *  The estimate will assume the input may be arbitrarily large,\n *  which is the worst case.\n *\n *  Note that the size estimation is specific for one-shot compression,\n *  it is not valid for streaming (see ZSTD_estimateCStreamSize*())\n *  nor other potential ways of using a ZSTD_CCtx* state.\n *\n *  When srcSize can be bound by a known and rather \"small\" value,\n *  this knowledge can be used to provide a tighter budget estimation\n *  because the ZSTD_CCtx* state will need less memory for small inputs.\n *  This tighter estimation can be provided by employing more advanced functions\n *  ZSTD_estimateCCtxSize_usingCParams(), which can be used in tandem with ZSTD_getCParams(),\n *  and ZSTD_estimateCCtxSize_usingCCtxParams(), which can be used in tandem with ZSTD_CCtxParams_setParameter().\n *  Both can be used to estimate memory using custom compression parameters and arbitrary srcSize limits.\n *\n *  Note : only single-threaded compression is supported.\n *  ZSTD_estimateCCtxSize_usingCCtxParams() will return an error code if ZSTD_c_nbWorkers is >= 1.\n */\nZSTDLIB_STATIC_API size_t ZSTD_estimateCCtxSize(int maxCompressionLevel);\nZSTDLIB_STATIC_API size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams);\nZSTDLIB_STATIC_API size_t ZSTD_estimateCCtxSize_usingCCtxParams(const ZSTD_CCtx_params* params);\nZSTDLIB_STATIC_API size_t ZSTD_estimateDCtxSize(void);\n\n/*! ZSTD_estimateCStreamSize() :\n *  ZSTD_estimateCStreamSize() will provide a memory budget large enough for streaming compression\n *  using any compression level up to the max specified one.\n *  It will also consider src size to be arbitrarily \"large\", which is a worst case scenario.\n *  If srcSize is known to always be small, ZSTD_estimateCStreamSize_usingCParams() can provide a tighter estimation.\n *  ZSTD_estimateCStreamSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel.\n *  ZSTD_estimateCStreamSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParams_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_c_nbWorkers is >= 1.\n *  Note : CStream size estimation is only correct for single-threaded compression.\n *  ZSTD_estimateCStreamSize_usingCCtxParams() will return an error code if ZSTD_c_nbWorkers is >= 1.\n *  Note 2 : ZSTD_estimateCStreamSize* functions are not compatible with the Block-Level Sequence Producer API at this time.\n *  Size estimates assume that no external sequence producer is registered.\n *\n *  ZSTD_DStream memory budget depends on frame's window Size.\n *  This information can be passed manually, using ZSTD_estimateDStreamSize,\n *  or deducted from a valid frame Header, using ZSTD_estimateDStreamSize_fromFrame();\n *  Any frame requesting a window size larger than max specified one will be rejected.\n *  Note : if streaming is init with function ZSTD_init?Stream_usingDict(),\n *         an internal ?Dict will be created, which additional size is not estimated here.\n *         In this case, get total size by adding ZSTD_estimate?DictSize\n */\nZSTDLIB_STATIC_API size_t ZSTD_estimateCStreamSize(int maxCompressionLevel);\nZSTDLIB_STATIC_API size_t ZSTD_estimateCStreamSize_usingCParams(ZSTD_compressionParameters cParams);\nZSTDLIB_STATIC_API size_t ZSTD_estimateCStreamSize_usingCCtxParams(const ZSTD_CCtx_params* params);\nZSTDLIB_STATIC_API size_t ZSTD_estimateDStreamSize(size_t maxWindowSize);\nZSTDLIB_STATIC_API size_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize);\n\n/*! ZSTD_estimate?DictSize() :\n *  ZSTD_estimateCDictSize() will bet that src size is relatively \"small\", and content is copied, like ZSTD_createCDict().\n *  ZSTD_estimateCDictSize_advanced() makes it possible to control compression parameters precisely, like ZSTD_createCDict_advanced().\n *  Note : dictionaries created by reference (`ZSTD_dlm_byRef`) are logically smaller.\n */\nZSTDLIB_STATIC_API size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel);\nZSTDLIB_STATIC_API size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, ZSTD_dictLoadMethod_e dictLoadMethod);\nZSTDLIB_STATIC_API size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod);\n\n/*! ZSTD_initStatic*() :\n *  Initialize an object using a pre-allocated fixed-size buffer.\n *  workspace: The memory area to emplace the object into.\n *             Provided pointer *must be 8-bytes aligned*.\n *             Buffer must outlive object.\n *  workspaceSize: Use ZSTD_estimate*Size() to determine\n *                 how large workspace must be to support target scenario.\n * @return : pointer to object (same address as workspace, just different type),\n *           or NULL if error (size too small, incorrect alignment, etc.)\n *  Note : zstd will never resize nor malloc() when using a static buffer.\n *         If the object requires more memory than available,\n *         zstd will just error out (typically ZSTD_error_memory_allocation).\n *  Note 2 : there is no corresponding \"free\" function.\n *           Since workspace is allocated externally, it must be freed externally too.\n *  Note 3 : cParams : use ZSTD_getCParams() to convert a compression level\n *           into its associated cParams.\n *  Limitation 1 : currently not compatible with internal dictionary creation, triggered by\n *                 ZSTD_CCtx_loadDictionary(), ZSTD_initCStream_usingDict() or ZSTD_initDStream_usingDict().\n *  Limitation 2 : static cctx currently not compatible with multi-threading.\n *  Limitation 3 : static dctx is incompatible with legacy support.\n */\nZSTDLIB_STATIC_API ZSTD_CCtx*    ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize);\nZSTDLIB_STATIC_API ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticCCtx() */\n\nZSTDLIB_STATIC_API ZSTD_DCtx*    ZSTD_initStaticDCtx(void* workspace, size_t workspaceSize);\nZSTDLIB_STATIC_API ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticDCtx() */\n\nZSTDLIB_STATIC_API const ZSTD_CDict* ZSTD_initStaticCDict(\n                                        void* workspace, size_t workspaceSize,\n                                        const void* dict, size_t dictSize,\n                                        ZSTD_dictLoadMethod_e dictLoadMethod,\n                                        ZSTD_dictContentType_e dictContentType,\n                                        ZSTD_compressionParameters cParams);\n\nZSTDLIB_STATIC_API const ZSTD_DDict* ZSTD_initStaticDDict(\n                                        void* workspace, size_t workspaceSize,\n                                        const void* dict, size_t dictSize,\n                                        ZSTD_dictLoadMethod_e dictLoadMethod,\n                                        ZSTD_dictContentType_e dictContentType);\n\n\n/*! Custom memory allocation :\n *  These prototypes make it possible to pass your own allocation/free functions.\n *  ZSTD_customMem is provided at creation time, using ZSTD_create*_advanced() variants listed below.\n *  All allocation/free operations will be completed using these custom variants instead of regular <stdlib.h> ones.\n */\ntypedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);\ntypedef void  (*ZSTD_freeFunction) (void* opaque, void* address);\ntypedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;\nstatic\n#ifdef __GNUC__\n__attribute__((__unused__))\n#endif\n\n#if defined(__clang__) && __clang_major__ >= 5\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wzero-as-null-pointer-constant\"\n#endif\nZSTD_customMem const ZSTD_defaultCMem = { NULL, NULL, NULL };  /**< this constant defers to stdlib's functions */\n#if defined(__clang__) && __clang_major__ >= 5\n#pragma clang diagnostic pop\n#endif\n\nMEM_STATIC void* ZSTD_customMalloc(size_t size, ZSTD_customMem customMem)\n{\n    if (customMem.customAlloc)\n        return customMem.customAlloc(customMem.opaque, size);\n    return ZSTD_malloc(size);\n}\n\nMEM_STATIC void* ZSTD_customCalloc(size_t size, ZSTD_customMem customMem)\n{\n    if (customMem.customAlloc) {\n        /* calloc implemented as malloc+memset;\n         * not as efficient as calloc, but next best guess for custom malloc */\n        void* const ptr = customMem.customAlloc(customMem.opaque, size);\n        ZSTD_memset(ptr, 0, size);\n        return ptr;\n    }\n    return ZSTD_calloc(1, size);\n}\n\nMEM_STATIC void ZSTD_customFree(void* ptr, ZSTD_customMem customMem)\n{\n    if (ptr != NULL) {\n        if (customMem.customFree)\n            customMem.customFree(customMem.opaque, ptr);\n        else\n            ZSTD_free(ptr);\n    }\n}\n\nZSTDLIB_STATIC_API ZSTD_CCtx*    ZSTD_createCCtx_advanced(ZSTD_customMem customMem);\nZSTDLIB_STATIC_API ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);\nZSTDLIB_STATIC_API ZSTD_DCtx*    ZSTD_createDCtx_advanced(ZSTD_customMem customMem);\nZSTDLIB_STATIC_API ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);\n\nZSTDLIB_STATIC_API ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize,\n                                                  ZSTD_dictLoadMethod_e dictLoadMethod,\n                                                  ZSTD_dictContentType_e dictContentType,\n                                                  ZSTD_compressionParameters cParams,\n                                                  ZSTD_customMem customMem);\n\n/*! Thread pool :\n *  These prototypes make it possible to share a thread pool among multiple compression contexts.\n *  This can limit resources for applications with multiple threads where each one uses\n *  a threaded compression mode (via ZSTD_c_nbWorkers parameter).\n *  ZSTD_createThreadPool creates a new thread pool with a given number of threads.\n *  Note that the lifetime of such pool must exist while being used.\n *  ZSTD_CCtx_refThreadPool assigns a thread pool to a context (use NULL argument value\n *  to use an internal thread pool).\n *  ZSTD_freeThreadPool frees a thread pool, accepts NULL pointer.\n */\ntypedef struct POOL_ctx_s ZSTD_threadPool;\nZSTDLIB_STATIC_API ZSTD_threadPool* ZSTD_createThreadPool(size_t numThreads);\nZSTDLIB_STATIC_API void ZSTD_freeThreadPool (ZSTD_threadPool* pool);  /* accept NULL pointer */\nZSTDLIB_STATIC_API size_t ZSTD_CCtx_refThreadPool(ZSTD_CCtx* cctx, ZSTD_threadPool* pool);\n\n\n/*\n * This API is temporary and is expected to change or disappear in the future!\n */\nZSTDLIB_STATIC_API ZSTD_CDict* ZSTD_createCDict_advanced2(\n    const void* dict, size_t dictSize,\n    ZSTD_dictLoadMethod_e dictLoadMethod,\n    ZSTD_dictContentType_e dictContentType,\n    const ZSTD_CCtx_params* cctxParams,\n    ZSTD_customMem customMem);\n\nZSTDLIB_STATIC_API ZSTD_DDict* ZSTD_createDDict_advanced(\n    const void* dict, size_t dictSize,\n    ZSTD_dictLoadMethod_e dictLoadMethod,\n    ZSTD_dictContentType_e dictContentType,\n    ZSTD_customMem customMem);\n\n\n/***************************************\n*  Advanced compression functions\n***************************************/\n\n/*! ZSTD_createCDict_byReference() :\n *  Create a digested dictionary for compression\n *  Dictionary content is just referenced, not duplicated.\n *  As a consequence, `dictBuffer` **must** outlive CDict,\n *  and its content must remain unmodified throughout the lifetime of CDict.\n *  note: equivalent to ZSTD_createCDict_advanced(), with dictLoadMethod==ZSTD_dlm_byRef */\nZSTDLIB_STATIC_API ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel);\n\n/*! ZSTD_getCParams() :\n * @return ZSTD_compressionParameters structure for a selected compression level and estimated srcSize.\n * `estimatedSrcSize` value is optional, select 0 if not known */\nZSTDLIB_STATIC_API ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);\n\n/*! ZSTD_getParams() :\n *  same as ZSTD_getCParams(), but @return a full `ZSTD_parameters` object instead of sub-component `ZSTD_compressionParameters`.\n *  All fields of `ZSTD_frameParameters` are set to default : contentSize=1, checksum=0, noDictID=0 */\nZSTDLIB_STATIC_API ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);\n\n/*! ZSTD_checkCParams() :\n *  Ensure param values remain within authorized range.\n * @return 0 on success, or an error code (can be checked with ZSTD_isError()) */\nZSTDLIB_STATIC_API size_t ZSTD_checkCParams(ZSTD_compressionParameters params);\n\n/*! ZSTD_adjustCParams() :\n *  optimize params for a given `srcSize` and `dictSize`.\n * `srcSize` can be unknown, in which case use ZSTD_CONTENTSIZE_UNKNOWN.\n * `dictSize` must be `0` when there is no dictionary.\n *  cPar can be invalid : all parameters will be clamped within valid range in the @return struct.\n *  This function never fails (wide contract) */\nZSTDLIB_STATIC_API ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize);\n\n/*! ZSTD_CCtx_setCParams() :\n *  Set all parameters provided within @p cparams into the working @p cctx.\n *  Note : if modifying parameters during compression (MT mode only),\n *         note that changes to the .windowLog parameter will be ignored.\n * @return 0 on success, or an error code (can be checked with ZSTD_isError()).\n *         On failure, no parameters are updated.\n */\nZSTDLIB_STATIC_API size_t ZSTD_CCtx_setCParams(ZSTD_CCtx* cctx, ZSTD_compressionParameters cparams);\n\n/*! ZSTD_CCtx_setFParams() :\n *  Set all parameters provided within @p fparams into the working @p cctx.\n * @return 0 on success, or an error code (can be checked with ZSTD_isError()).\n */\nZSTDLIB_STATIC_API size_t ZSTD_CCtx_setFParams(ZSTD_CCtx* cctx, ZSTD_frameParameters fparams);\n\n/*! ZSTD_CCtx_setParams() :\n *  Set all parameters provided within @p params into the working @p cctx.\n * @return 0 on success, or an error code (can be checked with ZSTD_isError()).\n */\nZSTDLIB_STATIC_API size_t ZSTD_CCtx_setParams(ZSTD_CCtx* cctx, ZSTD_parameters params);\n\n/*! ZSTD_compress_advanced() :\n *  Note : this function is now DEPRECATED.\n *         It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_setParameter() and other parameter setters.\n *  This prototype will generate compilation warnings. */\nZSTD_DEPRECATED(\"use ZSTD_compress2\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_compress_advanced(ZSTD_CCtx* cctx,\n                              void* dst, size_t dstCapacity,\n                        const void* src, size_t srcSize,\n                        const void* dict,size_t dictSize,\n                              ZSTD_parameters params);\n\n/*! ZSTD_compress_usingCDict_advanced() :\n *  Note : this function is now DEPRECATED.\n *         It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_loadDictionary() and other parameter setters.\n *  This prototype will generate compilation warnings. */\nZSTD_DEPRECATED(\"use ZSTD_compress2 with ZSTD_CCtx_loadDictionary\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_compress_usingCDict_advanced(ZSTD_CCtx* cctx,\n                                              void* dst, size_t dstCapacity,\n                                        const void* src, size_t srcSize,\n                                        const ZSTD_CDict* cdict,\n                                              ZSTD_frameParameters fParams);\n\n\n/*! ZSTD_CCtx_loadDictionary_byReference() :\n *  Same as ZSTD_CCtx_loadDictionary(), but dictionary content is referenced, instead of being copied into CCtx.\n *  It saves some memory, but also requires that `dict` outlives its usage within `cctx` */\nZSTDLIB_STATIC_API size_t ZSTD_CCtx_loadDictionary_byReference(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);\n\n/*! ZSTD_CCtx_loadDictionary_advanced() :\n *  Same as ZSTD_CCtx_loadDictionary(), but gives finer control over\n *  how to load the dictionary (by copy ? by reference ?)\n *  and how to interpret it (automatic ? force raw mode ? full mode only ?) */\nZSTDLIB_STATIC_API size_t ZSTD_CCtx_loadDictionary_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType);\n\n/*! ZSTD_CCtx_refPrefix_advanced() :\n *  Same as ZSTD_CCtx_refPrefix(), but gives finer control over\n *  how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?) */\nZSTDLIB_STATIC_API size_t ZSTD_CCtx_refPrefix_advanced(ZSTD_CCtx* cctx, const void* prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType);\n\n/* ===   experimental parameters   === */\n/* these parameters can be used with ZSTD_setParameter()\n * they are not guaranteed to remain supported in the future */\n\n /* Enables rsyncable mode,\n  * which makes compressed files more rsync friendly\n  * by adding periodic synchronization points to the compressed data.\n  * The target average block size is ZSTD_c_jobSize / 2.\n  * It's possible to modify the job size to increase or decrease\n  * the granularity of the synchronization point.\n  * Once the jobSize is smaller than the window size,\n  * it will result in compression ratio degradation.\n  * NOTE 1: rsyncable mode only works when multithreading is enabled.\n  * NOTE 2: rsyncable performs poorly in combination with long range mode,\n  * since it will decrease the effectiveness of synchronization points,\n  * though mileage may vary.\n  * NOTE 3: Rsyncable mode limits maximum compression speed to ~400 MB/s.\n  * If the selected compression level is already running significantly slower,\n  * the overall speed won't be significantly impacted.\n  */\n #define ZSTD_c_rsyncable ZSTD_c_experimentalParam1\n\n/* Select a compression format.\n * The value must be of type ZSTD_format_e.\n * See ZSTD_format_e enum definition for details */\n#define ZSTD_c_format ZSTD_c_experimentalParam2\n\n/* Force back-reference distances to remain < windowSize,\n * even when referencing into Dictionary content (default:0) */\n#define ZSTD_c_forceMaxWindow ZSTD_c_experimentalParam3\n\n/* Controls whether the contents of a CDict\n * are used in place, or copied into the working context.\n * Accepts values from the ZSTD_dictAttachPref_e enum.\n * See the comments on that enum for an explanation of the feature. */\n#define ZSTD_c_forceAttachDict ZSTD_c_experimentalParam4\n\n/* Controlled with ZSTD_paramSwitch_e enum.\n * Default is ZSTD_ps_auto.\n * Set to ZSTD_ps_disable to never compress literals.\n * Set to ZSTD_ps_enable to always compress literals. (Note: uncompressed literals\n * may still be emitted if huffman is not beneficial to use.)\n *\n * By default, in ZSTD_ps_auto, the library will decide at runtime whether to use\n * literals compression based on the compression parameters - specifically,\n * negative compression levels do not use literal compression.\n */\n#define ZSTD_c_literalCompressionMode ZSTD_c_experimentalParam5\n\n/* User's best guess of source size.\n * Hint is not valid when srcSizeHint == 0.\n * There is no guarantee that hint is close to actual source size,\n * but compression ratio may regress significantly if guess considerably underestimates */\n#define ZSTD_c_srcSizeHint ZSTD_c_experimentalParam7\n\n/* Controls whether the new and experimental \"dedicated dictionary search\n * structure\" can be used. This feature is still rough around the edges, be\n * prepared for surprising behavior!\n *\n * How to use it:\n *\n * When using a CDict, whether to use this feature or not is controlled at\n * CDict creation, and it must be set in a CCtxParams set passed into that\n * construction (via ZSTD_createCDict_advanced2()). A compression will then\n * use the feature or not based on how the CDict was constructed; the value of\n * this param, set in the CCtx, will have no effect.\n *\n * However, when a dictionary buffer is passed into a CCtx, such as via\n * ZSTD_CCtx_loadDictionary(), this param can be set on the CCtx to control\n * whether the CDict that is created internally can use the feature or not.\n *\n * What it does:\n *\n * Normally, the internal data structures of the CDict are analogous to what\n * would be stored in a CCtx after compressing the contents of a dictionary.\n * To an approximation, a compression using a dictionary can then use those\n * data structures to simply continue what is effectively a streaming\n * compression where the simulated compression of the dictionary left off.\n * Which is to say, the search structures in the CDict are normally the same\n * format as in the CCtx.\n *\n * It is possible to do better, since the CDict is not like a CCtx: the search\n * structures are written once during CDict creation, and then are only read\n * after that, while the search structures in the CCtx are both read and\n * written as the compression goes along. This means we can choose a search\n * structure for the dictionary that is read-optimized.\n *\n * This feature enables the use of that different structure.\n *\n * Note that some of the members of the ZSTD_compressionParameters struct have\n * different semantics and constraints in the dedicated search structure. It is\n * highly recommended that you simply set a compression level in the CCtxParams\n * you pass into the CDict creation call, and avoid messing with the cParams\n * directly.\n *\n * Effects:\n *\n * This will only have any effect when the selected ZSTD_strategy\n * implementation supports this feature. Currently, that's limited to\n * ZSTD_greedy, ZSTD_lazy, and ZSTD_lazy2.\n *\n * Note that this means that the CDict tables can no longer be copied into the\n * CCtx, so the dict attachment mode ZSTD_dictForceCopy will no longer be\n * usable. The dictionary can only be attached or reloaded.\n *\n * In general, you should expect compression to be faster--sometimes very much\n * so--and CDict creation to be slightly slower. Eventually, we will probably\n * make this mode the default.\n */\n#define ZSTD_c_enableDedicatedDictSearch ZSTD_c_experimentalParam8\n\n/* ZSTD_c_stableInBuffer\n * Experimental parameter.\n * Default is 0 == disabled. Set to 1 to enable.\n *\n * Tells the compressor that input data presented with ZSTD_inBuffer\n * will ALWAYS be the same between calls.\n * Technically, the @src pointer must never be changed,\n * and the @pos field can only be updated by zstd.\n * However, it's possible to increase the @size field,\n * allowing scenarios where more data can be appended after compressions starts.\n * These conditions are checked by the compressor,\n * and compression will fail if they are not respected.\n * Also, data in the ZSTD_inBuffer within the range [src, src + pos)\n * MUST not be modified during compression or it will result in data corruption.\n *\n * When this flag is enabled zstd won't allocate an input window buffer,\n * because the user guarantees it can reference the ZSTD_inBuffer until\n * the frame is complete. But, it will still allocate an output buffer\n * large enough to fit a block (see ZSTD_c_stableOutBuffer). This will also\n * avoid the memcpy() from the input buffer to the input window buffer.\n *\n * NOTE: So long as the ZSTD_inBuffer always points to valid memory, using\n * this flag is ALWAYS memory safe, and will never access out-of-bounds\n * memory. However, compression WILL fail if conditions are not respected.\n *\n * WARNING: The data in the ZSTD_inBuffer in the range [src, src + pos) MUST\n * not be modified during compression or it will result in data corruption.\n * This is because zstd needs to reference data in the ZSTD_inBuffer to find\n * matches. Normally zstd maintains its own window buffer for this purpose,\n * but passing this flag tells zstd to rely on user provided buffer instead.\n */\n#define ZSTD_c_stableInBuffer ZSTD_c_experimentalParam9\n\n/* ZSTD_c_stableOutBuffer\n * Experimental parameter.\n * Default is 0 == disabled. Set to 1 to enable.\n *\n * Tells he compressor that the ZSTD_outBuffer will not be resized between\n * calls. Specifically: (out.size - out.pos) will never grow. This gives the\n * compressor the freedom to say: If the compressed data doesn't fit in the\n * output buffer then return ZSTD_error_dstSizeTooSmall. This allows us to\n * always decompress directly into the output buffer, instead of decompressing\n * into an internal buffer and copying to the output buffer.\n *\n * When this flag is enabled zstd won't allocate an output buffer, because\n * it can write directly to the ZSTD_outBuffer. It will still allocate the\n * input window buffer (see ZSTD_c_stableInBuffer).\n *\n * Zstd will check that (out.size - out.pos) never grows and return an error\n * if it does. While not strictly necessary, this should prevent surprises.\n */\n#define ZSTD_c_stableOutBuffer ZSTD_c_experimentalParam10\n\n/* ZSTD_c_blockDelimiters\n * Default is 0 == ZSTD_sf_noBlockDelimiters.\n *\n * For use with sequence compression API: ZSTD_compressSequences().\n *\n * Designates whether or not the given array of ZSTD_Sequence contains block delimiters\n * and last literals, which are defined as sequences with offset == 0 and matchLength == 0.\n * See the definition of ZSTD_Sequence for more specifics.\n */\n#define ZSTD_c_blockDelimiters ZSTD_c_experimentalParam11\n\n/* ZSTD_c_validateSequences\n * Default is 0 == disabled. Set to 1 to enable sequence validation.\n *\n * For use with sequence compression API: ZSTD_compressSequences().\n * Designates whether or not we validate sequences provided to ZSTD_compressSequences()\n * during function execution.\n *\n * Without validation, providing a sequence that does not conform to the zstd spec will cause\n * undefined behavior, and may produce a corrupted block.\n *\n * With validation enabled, if sequence is invalid (see doc/zstd_compression_format.md for\n * specifics regarding offset/matchlength requirements) then the function will bail out and\n * return an error.\n *\n */\n#define ZSTD_c_validateSequences ZSTD_c_experimentalParam12\n\n/* ZSTD_c_blockSplitterLevel\n * note: this parameter only influences the first splitter stage,\n *       which is active before producing the sequences.\n *       ZSTD_c_splitAfterSequences controls the next splitter stage,\n *       which is active after sequence production.\n *       Note that both can be combined.\n * Allowed values are between 0 and ZSTD_BLOCKSPLITTER_LEVEL_MAX included.\n * 0 means \"auto\", which will select a value depending on current ZSTD_c_strategy.\n * 1 means no splitting.\n * Then, values from 2 to 6 are sorted in increasing cpu load order.\n *\n * Note that currently the first block is never split,\n * to ensure expansion guarantees in presence of incompressible data.\n */\n#define ZSTD_BLOCKSPLITTER_LEVEL_MAX 6\n#define ZSTD_c_blockSplitterLevel ZSTD_c_experimentalParam20\n\n/* ZSTD_c_splitAfterSequences\n * This is a stronger splitter algorithm,\n * based on actual sequences previously produced by the selected parser.\n * It's also slower, and as a consequence, mostly used for high compression levels.\n * While the post-splitter does overlap with the pre-splitter,\n * both can nonetheless be combined,\n * notably with ZSTD_c_blockSplitterLevel at ZSTD_BLOCKSPLITTER_LEVEL_MAX,\n * resulting in higher compression ratio than just one of them.\n *\n * Default is ZSTD_ps_auto.\n * Set to ZSTD_ps_disable to never use block splitter.\n * Set to ZSTD_ps_enable to always use block splitter.\n *\n * By default, in ZSTD_ps_auto, the library will decide at runtime whether to use\n * block splitting based on the compression parameters.\n */\n#define ZSTD_c_splitAfterSequences ZSTD_c_experimentalParam13\n\n/* ZSTD_c_useRowMatchFinder\n * Controlled with ZSTD_paramSwitch_e enum.\n * Default is ZSTD_ps_auto.\n * Set to ZSTD_ps_disable to never use row-based matchfinder.\n * Set to ZSTD_ps_enable to force usage of row-based matchfinder.\n *\n * By default, in ZSTD_ps_auto, the library will decide at runtime whether to use\n * the row-based matchfinder based on support for SIMD instructions and the window log.\n * Note that this only pertains to compression strategies: greedy, lazy, and lazy2\n */\n#define ZSTD_c_useRowMatchFinder ZSTD_c_experimentalParam14\n\n/* ZSTD_c_deterministicRefPrefix\n * Default is 0 == disabled. Set to 1 to enable.\n *\n * Zstd produces different results for prefix compression when the prefix is\n * directly adjacent to the data about to be compressed vs. when it isn't.\n * This is because zstd detects that the two buffers are contiguous and it can\n * use a more efficient match finding algorithm. However, this produces different\n * results than when the two buffers are non-contiguous. This flag forces zstd\n * to always load the prefix in non-contiguous mode, even if it happens to be\n * adjacent to the data, to guarantee determinism.\n *\n * If you really care about determinism when using a dictionary or prefix,\n * like when doing delta compression, you should select this option. It comes\n * at a speed penalty of about ~2.5% if the dictionary and data happened to be\n * contiguous, and is free if they weren't contiguous. We don't expect that\n * intentionally making the dictionary and data contiguous will be worth the\n * cost to memcpy() the data.\n */\n#define ZSTD_c_deterministicRefPrefix ZSTD_c_experimentalParam15\n\n/* ZSTD_c_prefetchCDictTables\n * Controlled with ZSTD_paramSwitch_e enum. Default is ZSTD_ps_auto.\n *\n * In some situations, zstd uses CDict tables in-place rather than copying them\n * into the working context. (See docs on ZSTD_dictAttachPref_e above for details).\n * In such situations, compression speed is seriously impacted when CDict tables are\n * \"cold\" (outside CPU cache). This parameter instructs zstd to prefetch CDict tables\n * when they are used in-place.\n *\n * For sufficiently small inputs, the cost of the prefetch will outweigh the benefit.\n * For sufficiently large inputs, zstd will by default memcpy() CDict tables\n * into the working context, so there is no need to prefetch. This parameter is\n * targeted at a middle range of input sizes, where a prefetch is cheap enough to be\n * useful but memcpy() is too expensive. The exact range of input sizes where this\n * makes sense is best determined by careful experimentation.\n *\n * Note: for this parameter, ZSTD_ps_auto is currently equivalent to ZSTD_ps_disable,\n * but in the future zstd may conditionally enable this feature via an auto-detection\n * heuristic for cold CDicts.\n * Use ZSTD_ps_disable to opt out of prefetching under any circumstances.\n */\n#define ZSTD_c_prefetchCDictTables ZSTD_c_experimentalParam16\n\n/* ZSTD_c_enableSeqProducerFallback\n * Allowed values are 0 (disable) and 1 (enable). The default setting is 0.\n *\n * Controls whether zstd will fall back to an internal sequence producer if an\n * external sequence producer is registered and returns an error code. This fallback\n * is block-by-block: the internal sequence producer will only be called for blocks\n * where the external sequence producer returns an error code. Fallback parsing will\n * follow any other cParam settings, such as compression level, the same as in a\n * normal (fully-internal) compression operation.\n *\n * The user is strongly encouraged to read the full Block-Level Sequence Producer API\n * documentation (below) before setting this parameter. */\n#define ZSTD_c_enableSeqProducerFallback ZSTD_c_experimentalParam17\n\n/* ZSTD_c_maxBlockSize\n * Allowed values are between 1KB and ZSTD_BLOCKSIZE_MAX (128KB).\n * The default is ZSTD_BLOCKSIZE_MAX, and setting to 0 will set to the default.\n *\n * This parameter can be used to set an upper bound on the blocksize\n * that overrides the default ZSTD_BLOCKSIZE_MAX. It cannot be used to set upper\n * bounds greater than ZSTD_BLOCKSIZE_MAX or bounds lower than 1KB (will make\n * compressBound() inaccurate). Only currently meant to be used for testing.\n */\n#define ZSTD_c_maxBlockSize ZSTD_c_experimentalParam18\n\n/* ZSTD_c_searchForExternalRepcodes\n * This parameter affects how zstd parses external sequences, such as sequences\n * provided through the compressSequences() API or from an external block-level\n * sequence producer.\n *\n * If set to ZSTD_ps_enable, the library will check for repeated offsets in\n * external sequences, even if those repcodes are not explicitly indicated in\n * the \"rep\" field. Note that this is the only way to exploit repcode matches\n * while using compressSequences() or an external sequence producer, since zstd\n * currently ignores the \"rep\" field of external sequences.\n *\n * If set to ZSTD_ps_disable, the library will not exploit repeated offsets in\n * external sequences, regardless of whether the \"rep\" field has been set. This\n * reduces sequence compression overhead by about 25% while sacrificing some\n * compression ratio.\n *\n * The default value is ZSTD_ps_auto, for which the library will enable/disable\n * based on compression level.\n *\n * Note: for now, this param only has an effect if ZSTD_c_blockDelimiters is\n * set to ZSTD_sf_explicitBlockDelimiters. That may change in the future.\n */\n#define ZSTD_c_searchForExternalRepcodes ZSTD_c_experimentalParam19\n\n\n/*! ZSTD_CCtx_getParameter() :\n *  Get the requested compression parameter value, selected by enum ZSTD_cParameter,\n *  and store it into int* value.\n * @return : 0, or an error code (which can be tested with ZSTD_isError()).\n */\nZSTDLIB_STATIC_API size_t ZSTD_CCtx_getParameter(const ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value);\n\n\n/*! ZSTD_CCtx_params :\n *  Quick howto :\n *  - ZSTD_createCCtxParams() : Create a ZSTD_CCtx_params structure\n *  - ZSTD_CCtxParams_setParameter() : Push parameters one by one into\n *                                     an existing ZSTD_CCtx_params structure.\n *                                     This is similar to\n *                                     ZSTD_CCtx_setParameter().\n *  - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to\n *                                    an existing CCtx.\n *                                    These parameters will be applied to\n *                                    all subsequent frames.\n *  - ZSTD_compressStream2() : Do compression using the CCtx.\n *  - ZSTD_freeCCtxParams() : Free the memory, accept NULL pointer.\n *\n *  This can be used with ZSTD_estimateCCtxSize_advanced_usingCCtxParams()\n *  for static allocation of CCtx for single-threaded compression.\n */\nZSTDLIB_STATIC_API ZSTD_CCtx_params* ZSTD_createCCtxParams(void);\nZSTDLIB_STATIC_API size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params);  /* accept NULL pointer */\n\n/*! ZSTD_CCtxParams_reset() :\n *  Reset params to default values.\n */\nZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_reset(ZSTD_CCtx_params* params);\n\n/*! ZSTD_CCtxParams_init() :\n *  Initializes the compression parameters of cctxParams according to\n *  compression level. All other parameters are reset to their default values.\n */\nZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_init(ZSTD_CCtx_params* cctxParams, int compressionLevel);\n\n/*! ZSTD_CCtxParams_init_advanced() :\n *  Initializes the compression and frame parameters of cctxParams according to\n *  params. All other parameters are reset to their default values.\n */\nZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params);\n\n/*! ZSTD_CCtxParams_setParameter() : Requires v1.4.0+\n *  Similar to ZSTD_CCtx_setParameter.\n *  Set one compression parameter, selected by enum ZSTD_cParameter.\n *  Parameters must be applied to a ZSTD_CCtx using\n *  ZSTD_CCtx_setParametersUsingCCtxParams().\n * @result : a code representing success or failure (which can be tested with\n *           ZSTD_isError()).\n */\nZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, int value);\n\n/*! ZSTD_CCtxParams_getParameter() :\n * Similar to ZSTD_CCtx_getParameter.\n * Get the requested value of one compression parameter, selected by enum ZSTD_cParameter.\n * @result : 0, or an error code (which can be tested with ZSTD_isError()).\n */\nZSTDLIB_STATIC_API size_t ZSTD_CCtxParams_getParameter(const ZSTD_CCtx_params* params, ZSTD_cParameter param, int* value);\n\n/*! ZSTD_CCtx_setParametersUsingCCtxParams() :\n *  Apply a set of ZSTD_CCtx_params to the compression context.\n *  This can be done even after compression is started,\n *    if nbWorkers==0, this will have no impact until a new compression is started.\n *    if nbWorkers>=1, new parameters will be picked up at next job,\n *       with a few restrictions (windowLog, pledgedSrcSize, nbWorkers, jobSize, and overlapLog are not updated).\n */\nZSTDLIB_STATIC_API size_t ZSTD_CCtx_setParametersUsingCCtxParams(\n        ZSTD_CCtx* cctx, const ZSTD_CCtx_params* params);\n\n/*! ZSTD_compressStream2_simpleArgs() :\n *  Same as ZSTD_compressStream2(),\n *  but using only integral types as arguments.\n *  This variant might be helpful for binders from dynamic languages\n *  which have troubles handling structures containing memory pointers.\n */\nZSTDLIB_STATIC_API size_t ZSTD_compressStream2_simpleArgs (\n                            ZSTD_CCtx* cctx,\n                            void* dst, size_t dstCapacity, size_t* dstPos,\n                      const void* src, size_t srcSize, size_t* srcPos,\n                            ZSTD_EndDirective endOp);\n\n\n/***************************************\n*  Advanced decompression functions\n***************************************/\n\n/*! ZSTD_isFrame() :\n *  Tells if the content of `buffer` starts with a valid Frame Identifier.\n *  Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0.\n *  Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled.\n *  Note 3 : Skippable Frame Identifiers are considered valid. */\nZSTDLIB_STATIC_API unsigned ZSTD_isFrame(const void* buffer, size_t size);\n\n/*! ZSTD_createDDict_byReference() :\n *  Create a digested dictionary, ready to start decompression operation without startup delay.\n *  Dictionary content is referenced, and therefore stays in dictBuffer.\n *  It is important that dictBuffer outlives DDict,\n *  it must remain read accessible throughout the lifetime of DDict */\nZSTDLIB_STATIC_API ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize);\n\n/*! ZSTD_DCtx_loadDictionary_byReference() :\n *  Same as ZSTD_DCtx_loadDictionary(),\n *  but references `dict` content instead of copying it into `dctx`.\n *  This saves memory if `dict` remains around.,\n *  However, it's imperative that `dict` remains accessible (and unmodified) while being used, so it must outlive decompression. */\nZSTDLIB_STATIC_API size_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);\n\n/*! ZSTD_DCtx_loadDictionary_advanced() :\n *  Same as ZSTD_DCtx_loadDictionary(),\n *  but gives direct control over\n *  how to load the dictionary (by copy ? by reference ?)\n *  and how to interpret it (automatic ? force raw mode ? full mode only ?). */\nZSTDLIB_STATIC_API size_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx, const void* dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType);\n\n/*! ZSTD_DCtx_refPrefix_advanced() :\n *  Same as ZSTD_DCtx_refPrefix(), but gives finer control over\n *  how to interpret prefix content (automatic ? force raw mode (default) ? full mode only ?) */\nZSTDLIB_STATIC_API size_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType);\n\n/*! ZSTD_DCtx_setMaxWindowSize() :\n *  Refuses allocating internal buffers for frames requiring a window size larger than provided limit.\n *  This protects a decoder context from reserving too much memory for itself (potential attack scenario).\n *  This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode.\n *  By default, a decompression context accepts all window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT)\n * @return : 0, or an error code (which can be tested using ZSTD_isError()).\n */\nZSTDLIB_STATIC_API size_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize);\n\n/*! ZSTD_DCtx_getParameter() :\n *  Get the requested decompression parameter value, selected by enum ZSTD_dParameter,\n *  and store it into int* value.\n * @return : 0, or an error code (which can be tested with ZSTD_isError()).\n */\nZSTDLIB_STATIC_API size_t ZSTD_DCtx_getParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, int* value);\n\n/* ZSTD_d_format\n * experimental parameter,\n * allowing selection between ZSTD_format_e input compression formats\n */\n#define ZSTD_d_format ZSTD_d_experimentalParam1\n/* ZSTD_d_stableOutBuffer\n * Experimental parameter.\n * Default is 0 == disabled. Set to 1 to enable.\n *\n * Tells the decompressor that the ZSTD_outBuffer will ALWAYS be the same\n * between calls, except for the modifications that zstd makes to pos (the\n * caller must not modify pos). This is checked by the decompressor, and\n * decompression will fail if it ever changes. Therefore the ZSTD_outBuffer\n * MUST be large enough to fit the entire decompressed frame. This will be\n * checked when the frame content size is known. The data in the ZSTD_outBuffer\n * in the range [dst, dst + pos) MUST not be modified during decompression\n * or you will get data corruption.\n *\n * When this flag is enabled zstd won't allocate an output buffer, because\n * it can write directly to the ZSTD_outBuffer, but it will still allocate\n * an input buffer large enough to fit any compressed block. This will also\n * avoid the memcpy() from the internal output buffer to the ZSTD_outBuffer.\n * If you need to avoid the input buffer allocation use the buffer-less\n * streaming API.\n *\n * NOTE: So long as the ZSTD_outBuffer always points to valid memory, using\n * this flag is ALWAYS memory safe, and will never access out-of-bounds\n * memory. However, decompression WILL fail if you violate the preconditions.\n *\n * WARNING: The data in the ZSTD_outBuffer in the range [dst, dst + pos) MUST\n * not be modified during decompression or you will get data corruption. This\n * is because zstd needs to reference data in the ZSTD_outBuffer to regenerate\n * matches. Normally zstd maintains its own buffer for this purpose, but passing\n * this flag tells zstd to use the user provided buffer.\n */\n#define ZSTD_d_stableOutBuffer ZSTD_d_experimentalParam2\n\n/* ZSTD_d_forceIgnoreChecksum\n * Experimental parameter.\n * Default is 0 == disabled. Set to 1 to enable\n *\n * Tells the decompressor to skip checksum validation during decompression, regardless\n * of whether checksumming was specified during compression. This offers some\n * slight performance benefits, and may be useful for debugging.\n * Param has values of type ZSTD_forceIgnoreChecksum_e\n */\n#define ZSTD_d_forceIgnoreChecksum ZSTD_d_experimentalParam3\n\n/* ZSTD_d_refMultipleDDicts\n * Experimental parameter.\n * Default is 0 == disabled. Set to 1 to enable\n *\n * If enabled and dctx is allocated on the heap, then additional memory will be allocated\n * to store references to multiple ZSTD_DDict. That is, multiple calls of ZSTD_refDDict()\n * using a given ZSTD_DCtx, rather than overwriting the previous DDict reference, will instead\n * store all references. At decompression time, the appropriate dictID is selected\n * from the set of DDicts based on the dictID in the frame.\n *\n * Usage is simply calling ZSTD_refDDict() on multiple dict buffers.\n *\n * Param has values of byte ZSTD_refMultipleDDicts_e\n *\n * WARNING: Enabling this parameter and calling ZSTD_DCtx_refDDict(), will trigger memory\n * allocation for the hash table. ZSTD_freeDCtx() also frees this memory.\n * Memory is allocated as per ZSTD_DCtx::customMem.\n *\n * Although this function allocates memory for the table, the user is still responsible for\n * memory management of the underlying ZSTD_DDict* themselves.\n */\n#define ZSTD_d_refMultipleDDicts ZSTD_d_experimentalParam4\n\n/* ZSTD_d_disableHuffmanAssembly\n * Set to 1 to disable the Huffman assembly implementation.\n * The default value is 0, which allows zstd to use the Huffman assembly\n * implementation if available.\n *\n * This parameter can be used to disable Huffman assembly at runtime.\n * If you want to disable it at compile time you can define the macro\n * ZSTD_DISABLE_ASM.\n */\n#define ZSTD_d_disableHuffmanAssembly ZSTD_d_experimentalParam5\n\n/* ZSTD_d_maxBlockSize\n * Allowed values are between 1KB and ZSTD_BLOCKSIZE_MAX (128KB).\n * The default is ZSTD_BLOCKSIZE_MAX, and setting to 0 will set to the default.\n *\n * Forces the decompressor to reject blocks whose content size is\n * larger than the configured maxBlockSize. When maxBlockSize is\n * larger than the windowSize, the windowSize is used instead.\n * This saves memory on the decoder when you know all blocks are small.\n *\n * This option is typically used in conjunction with ZSTD_c_maxBlockSize.\n *\n * WARNING: This causes the decoder to reject otherwise valid frames\n * that have block sizes larger than the configured maxBlockSize.\n */\n#define ZSTD_d_maxBlockSize ZSTD_d_experimentalParam6\n\n\n/*! ZSTD_DCtx_setFormat() :\n *  This function is REDUNDANT. Prefer ZSTD_DCtx_setParameter().\n *  Instruct the decoder context about what kind of data to decode next.\n *  This instruction is mandatory to decode data without a fully-formed header,\n *  such ZSTD_f_zstd1_magicless for example.\n * @return : 0, or an error code (which can be tested using ZSTD_isError()). */\nZSTD_DEPRECATED(\"use ZSTD_DCtx_setParameter() instead\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format);\n\n/*! ZSTD_decompressStream_simpleArgs() :\n *  Same as ZSTD_decompressStream(),\n *  but using only integral types as arguments.\n *  This can be helpful for binders from dynamic languages\n *  which have troubles handling structures containing memory pointers.\n */\nZSTDLIB_STATIC_API size_t ZSTD_decompressStream_simpleArgs (\n                            ZSTD_DCtx* dctx,\n                            void* dst, size_t dstCapacity, size_t* dstPos,\n                      const void* src, size_t srcSize, size_t* srcPos);\n\n\n/********************************************************************\n*  Advanced streaming functions\n*  Warning : most of these functions are now redundant with the Advanced API.\n*  Once Advanced API reaches \"stable\" status,\n*  redundant functions will be deprecated, and then at some point removed.\n********************************************************************/\n\n/*=====   Advanced Streaming compression functions  =====*/\n\n/*! ZSTD_initCStream_srcSize() :\n * This function is DEPRECATED, and equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)\n *     ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);\n *     ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);\n *\n * pledgedSrcSize must be correct. If it is not known at init time, use\n * ZSTD_CONTENTSIZE_UNKNOWN. Note that, for compatibility with older programs,\n * \"0\" also disables frame content size field. It may be enabled in the future.\n * This prototype will generate compilation warnings.\n */\nZSTD_DEPRECATED(\"use ZSTD_CCtx_reset, see zstd.h for detailed instructions\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs,\n                         int compressionLevel,\n                         unsigned long long pledgedSrcSize);\n\n/*! ZSTD_initCStream_usingDict() :\n * This function is DEPRECATED, and is equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);\n *     ZSTD_CCtx_loadDictionary(zcs, dict, dictSize);\n *\n * Creates of an internal CDict (incompatible with static CCtx), except if\n * dict == NULL or dictSize < 8, in which case no dict is used.\n * Note: dict is loaded with ZSTD_dct_auto (treated as a full zstd dictionary if\n * it begins with ZSTD_MAGIC_DICTIONARY, else as raw content) and ZSTD_dlm_byCopy.\n * This prototype will generate compilation warnings.\n */\nZSTD_DEPRECATED(\"use ZSTD_CCtx_reset, see zstd.h for detailed instructions\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs,\n                     const void* dict, size_t dictSize,\n                           int compressionLevel);\n\n/*! ZSTD_initCStream_advanced() :\n * This function is DEPRECATED, and is equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_setParams(zcs, params);\n *     ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);\n *     ZSTD_CCtx_loadDictionary(zcs, dict, dictSize);\n *\n * dict is loaded with ZSTD_dct_auto and ZSTD_dlm_byCopy.\n * pledgedSrcSize must be correct.\n * If srcSize is not known at init time, use value ZSTD_CONTENTSIZE_UNKNOWN.\n * This prototype will generate compilation warnings.\n */\nZSTD_DEPRECATED(\"use ZSTD_CCtx_reset, see zstd.h for detailed instructions\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs,\n                    const void* dict, size_t dictSize,\n                          ZSTD_parameters params,\n                          unsigned long long pledgedSrcSize);\n\n/*! ZSTD_initCStream_usingCDict() :\n * This function is DEPRECATED, and equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_refCDict(zcs, cdict);\n *\n * note : cdict will just be referenced, and must outlive compression session\n * This prototype will generate compilation warnings.\n */\nZSTD_DEPRECATED(\"use ZSTD_CCtx_reset and ZSTD_CCtx_refCDict, see zstd.h for detailed instructions\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);\n\n/*! ZSTD_initCStream_usingCDict_advanced() :\n *   This function is DEPRECATED, and is equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_setFParams(zcs, fParams);\n *     ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);\n *     ZSTD_CCtx_refCDict(zcs, cdict);\n *\n * same as ZSTD_initCStream_usingCDict(), with control over frame parameters.\n * pledgedSrcSize must be correct. If srcSize is not known at init time, use\n * value ZSTD_CONTENTSIZE_UNKNOWN.\n * This prototype will generate compilation warnings.\n */\nZSTD_DEPRECATED(\"use ZSTD_CCtx_reset and ZSTD_CCtx_refCDict, see zstd.h for detailed instructions\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs,\n                               const ZSTD_CDict* cdict,\n                                     ZSTD_frameParameters fParams,\n                                     unsigned long long pledgedSrcSize);\n\n/*! ZSTD_resetCStream() :\n * This function is DEPRECATED, and is equivalent to:\n *     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);\n *     ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize);\n * Note: ZSTD_resetCStream() interprets pledgedSrcSize == 0 as ZSTD_CONTENTSIZE_UNKNOWN, but\n *       ZSTD_CCtx_setPledgedSrcSize() does not do the same, so ZSTD_CONTENTSIZE_UNKNOWN must be\n *       explicitly specified.\n *\n *  start a new frame, using same parameters from previous frame.\n *  This is typically useful to skip dictionary loading stage, since it will reuse it in-place.\n *  Note that zcs must be init at least once before using ZSTD_resetCStream().\n *  If pledgedSrcSize is not known at reset time, use macro ZSTD_CONTENTSIZE_UNKNOWN.\n *  If pledgedSrcSize > 0, its value must be correct, as it will be written in header, and controlled at the end.\n *  For the time being, pledgedSrcSize==0 is interpreted as \"srcSize unknown\" for compatibility with older programs,\n *  but it will change to mean \"empty\" in future version, so use macro ZSTD_CONTENTSIZE_UNKNOWN instead.\n * @return : 0, or an error code (which can be tested using ZSTD_isError())\n *  This prototype will generate compilation warnings.\n */\nZSTD_DEPRECATED(\"use ZSTD_CCtx_reset, see zstd.h for detailed instructions\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);\n\n\ntypedef struct {\n    unsigned long long ingested;   /* nb input bytes read and buffered */\n    unsigned long long consumed;   /* nb input bytes actually compressed */\n    unsigned long long produced;   /* nb of compressed bytes generated and buffered */\n    unsigned long long flushed;    /* nb of compressed bytes flushed : not provided; can be tracked from caller side */\n    unsigned currentJobID;         /* MT only : latest started job nb */\n    unsigned nbActiveWorkers;      /* MT only : nb of workers actively compressing at probe time */\n} ZSTD_frameProgression;\n\n/* ZSTD_getFrameProgression() :\n * tells how much data has been ingested (read from input)\n * consumed (input actually compressed) and produced (output) for current frame.\n * Note : (ingested - consumed) is amount of input data buffered internally, not yet compressed.\n * Aggregates progression inside active worker threads.\n */\nZSTDLIB_STATIC_API ZSTD_frameProgression ZSTD_getFrameProgression(const ZSTD_CCtx* cctx);\n\n/*! ZSTD_toFlushNow() :\n *  Tell how many bytes are ready to be flushed immediately.\n *  Useful for multithreading scenarios (nbWorkers >= 1).\n *  Probe the oldest active job, defined as oldest job not yet entirely flushed,\n *  and check its output buffer.\n * @return : amount of data stored in oldest job and ready to be flushed immediately.\n *  if @return == 0, it means either :\n *  + there is no active job (could be checked with ZSTD_frameProgression()), or\n *  + oldest job is still actively compressing data,\n *    but everything it has produced has also been flushed so far,\n *    therefore flush speed is limited by production speed of oldest job\n *    irrespective of the speed of concurrent (and newer) jobs.\n */\nZSTDLIB_STATIC_API size_t ZSTD_toFlushNow(ZSTD_CCtx* cctx);\n\n\n/*=====   Advanced Streaming decompression functions  =====*/\n\n/*!\n * This function is deprecated, and is equivalent to:\n *\n *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);\n *     ZSTD_DCtx_loadDictionary(zds, dict, dictSize);\n *\n * note: no dictionary will be used if dict == NULL or dictSize < 8\n */\nZSTD_DEPRECATED(\"use ZSTD_DCtx_reset + ZSTD_DCtx_loadDictionary, see zstd.h for detailed instructions\")\nZSTDLIB_STATIC_API size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize);\n\n/*!\n * This function is deprecated, and is equivalent to:\n *\n *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);\n *     ZSTD_DCtx_refDDict(zds, ddict);\n *\n * note : ddict is referenced, it must outlive decompression session\n */\nZSTD_DEPRECATED(\"use ZSTD_DCtx_reset + ZSTD_DCtx_refDDict, see zstd.h for detailed instructions\")\nZSTDLIB_STATIC_API size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);\n\n/*!\n * This function is deprecated, and is equivalent to:\n *\n *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);\n *\n * reuse decompression parameters from previous init; saves dictionary loading\n */\nZSTD_DEPRECATED(\"use ZSTD_DCtx_reset, see zstd.h for detailed instructions\")\nZSTDLIB_STATIC_API size_t ZSTD_resetDStream(ZSTD_DStream* zds);\n\n\n/* ********************* BLOCK-LEVEL SEQUENCE PRODUCER API *********************\n *\n * *** OVERVIEW ***\n * The Block-Level Sequence Producer API allows users to provide their own custom\n * sequence producer which libzstd invokes to process each block. The produced list\n * of sequences (literals and matches) is then post-processed by libzstd to produce\n * valid compressed blocks.\n *\n * This block-level offload API is a more granular complement of the existing\n * frame-level offload API compressSequences() (introduced in v1.5.1). It offers\n * an easier migration story for applications already integrated with libzstd: the\n * user application continues to invoke the same compression functions\n * ZSTD_compress2() or ZSTD_compressStream2() as usual, and transparently benefits\n * from the specific advantages of the external sequence producer. For example,\n * the sequence producer could be tuned to take advantage of known characteristics\n * of the input, to offer better speed / ratio, or could leverage hardware\n * acceleration not available within libzstd itself.\n *\n * See contrib/externalSequenceProducer for an example program employing the\n * Block-Level Sequence Producer API.\n *\n * *** USAGE ***\n * The user is responsible for implementing a function of type\n * ZSTD_sequenceProducer_F. For each block, zstd will pass the following\n * arguments to the user-provided function:\n *\n *   - sequenceProducerState: a pointer to a user-managed state for the sequence\n *     producer.\n *\n *   - outSeqs, outSeqsCapacity: an output buffer for the sequence producer.\n *     outSeqsCapacity is guaranteed >= ZSTD_sequenceBound(srcSize). The memory\n *     backing outSeqs is managed by the CCtx.\n *\n *   - src, srcSize: an input buffer for the sequence producer to parse.\n *     srcSize is guaranteed to be <= ZSTD_BLOCKSIZE_MAX.\n *\n *   - dict, dictSize: a history buffer, which may be empty, which the sequence\n *     producer may reference as it parses the src buffer. Currently, zstd will\n *     always pass dictSize == 0 into external sequence producers, but this will\n *     change in the future.\n *\n *   - compressionLevel: a signed integer representing the zstd compression level\n *     set by the user for the current operation. The sequence producer may choose\n *     to use this information to change its compression strategy and speed/ratio\n *     tradeoff. Note: the compression level does not reflect zstd parameters set\n *     through the advanced API.\n *\n *   - windowSize: a size_t representing the maximum allowed offset for external\n *     sequences. Note that sequence offsets are sometimes allowed to exceed the\n *     windowSize if a dictionary is present, see doc/zstd_compression_format.md\n *     for details.\n *\n * The user-provided function shall return a size_t representing the number of\n * sequences written to outSeqs. This return value will be treated as an error\n * code if it is greater than outSeqsCapacity. The return value must be non-zero\n * if srcSize is non-zero. The ZSTD_SEQUENCE_PRODUCER_ERROR macro is provided\n * for convenience, but any value greater than outSeqsCapacity will be treated as\n * an error code.\n *\n * If the user-provided function does not return an error code, the sequences\n * written to outSeqs must be a valid parse of the src buffer. Data corruption may\n * occur if the parse is not valid. A parse is defined to be valid if the\n * following conditions hold:\n *   - The sum of matchLengths and literalLengths must equal srcSize.\n *   - All sequences in the parse, except for the final sequence, must have\n *     matchLength >= ZSTD_MINMATCH_MIN. The final sequence must have\n *     matchLength >= ZSTD_MINMATCH_MIN or matchLength == 0.\n *   - All offsets must respect the windowSize parameter as specified in\n *     doc/zstd_compression_format.md.\n *   - If the final sequence has matchLength == 0, it must also have offset == 0.\n *\n * zstd will only validate these conditions (and fail compression if they do not\n * hold) if the ZSTD_c_validateSequences cParam is enabled. Note that sequence\n * validation has a performance cost.\n *\n * If the user-provided function returns an error, zstd will either fall back\n * to an internal sequence producer or fail the compression operation. The user can\n * choose between the two behaviors by setting the ZSTD_c_enableSeqProducerFallback\n * cParam. Fallback compression will follow any other cParam settings, such as\n * compression level, the same as in a normal compression operation.\n *\n * The user shall instruct zstd to use a particular ZSTD_sequenceProducer_F\n * function by calling\n *         ZSTD_registerSequenceProducer(cctx,\n *                                       sequenceProducerState,\n *                                       sequenceProducer)\n * This setting will persist until the next parameter reset of the CCtx.\n *\n * The sequenceProducerState must be initialized by the user before calling\n * ZSTD_registerSequenceProducer(). The user is responsible for destroying the\n * sequenceProducerState.\n *\n * *** LIMITATIONS ***\n * This API is compatible with all zstd compression APIs which respect advanced parameters.\n * However, there are three limitations:\n *\n * First, the ZSTD_c_enableLongDistanceMatching cParam is not currently supported.\n * COMPRESSION WILL FAIL if it is enabled and the user tries to compress with a block-level\n * external sequence producer.\n *   - Note that ZSTD_c_enableLongDistanceMatching is auto-enabled by default in some\n *     cases (see its documentation for details). Users must explicitly set\n *     ZSTD_c_enableLongDistanceMatching to ZSTD_ps_disable in such cases if an external\n *     sequence producer is registered.\n *   - As of this writing, ZSTD_c_enableLongDistanceMatching is disabled by default\n *     whenever ZSTD_c_windowLog < 128MB, but that's subject to change. Users should\n *     check the docs on ZSTD_c_enableLongDistanceMatching whenever the Block-Level Sequence\n *     Producer API is used in conjunction with advanced settings (like ZSTD_c_windowLog).\n *\n * Second, history buffers are not currently supported. Concretely, zstd will always pass\n * dictSize == 0 to the external sequence producer (for now). This has two implications:\n *   - Dictionaries are not currently supported. Compression will *not* fail if the user\n *     references a dictionary, but the dictionary won't have any effect.\n *   - Stream history is not currently supported. All advanced compression APIs, including\n *     streaming APIs, work with external sequence producers, but each block is treated as\n *     an independent chunk without history from previous blocks.\n *\n * Third, multi-threading within a single compression is not currently supported. In other words,\n * COMPRESSION WILL FAIL if ZSTD_c_nbWorkers > 0 and an external sequence producer is registered.\n * Multi-threading across compressions is fine: simply create one CCtx per thread.\n *\n * Long-term, we plan to overcome all three limitations. There is no technical blocker to\n * overcoming them. It is purely a question of engineering effort.\n */\n\n#define ZSTD_SEQUENCE_PRODUCER_ERROR ((size_t)(-1))\n\ntypedef size_t (*ZSTD_sequenceProducer_F) (\n  void* sequenceProducerState,\n  ZSTD_Sequence* outSeqs, size_t outSeqsCapacity,\n  const void* src, size_t srcSize,\n  const void* dict, size_t dictSize,\n  int compressionLevel,\n  size_t windowSize\n);\n\n/*! ZSTD_registerSequenceProducer() :\n * Instruct zstd to use a block-level external sequence producer function.\n *\n * The sequenceProducerState must be initialized by the caller, and the caller is\n * responsible for managing its lifetime. This parameter is sticky across\n * compressions. It will remain set until the user explicitly resets compression\n * parameters.\n *\n * Sequence producer registration is considered to be an \"advanced parameter\",\n * part of the \"advanced API\". This means it will only have an effect on compression\n * APIs which respect advanced parameters, such as compress2() and compressStream2().\n * Older compression APIs such as compressCCtx(), which predate the introduction of\n * \"advanced parameters\", will ignore any external sequence producer setting.\n *\n * The sequence producer can be \"cleared\" by registering a NULL function pointer. This\n * removes all limitations described above in the \"LIMITATIONS\" section of the API docs.\n *\n * The user is strongly encouraged to read the full API documentation (above) before\n * calling this function. */\nZSTDLIB_STATIC_API void\nZSTD_registerSequenceProducer(\n  ZSTD_CCtx* cctx,\n  void* sequenceProducerState,\n  ZSTD_sequenceProducer_F sequenceProducer\n);\n\n/*! ZSTD_CCtxParams_registerSequenceProducer() :\n * Same as ZSTD_registerSequenceProducer(), but operates on ZSTD_CCtx_params.\n * This is used for accurate size estimation with ZSTD_estimateCCtxSize_usingCCtxParams(),\n * which is needed when creating a ZSTD_CCtx with ZSTD_initStaticCCtx().\n *\n * If you are using the external sequence producer API in a scenario where ZSTD_initStaticCCtx()\n * is required, then this function is for you. Otherwise, you probably don't need it.\n *\n * See tests/zstreamtest.c for example usage. */\nZSTDLIB_STATIC_API void\nZSTD_CCtxParams_registerSequenceProducer(\n  ZSTD_CCtx_params* params,\n  void* sequenceProducerState,\n  ZSTD_sequenceProducer_F sequenceProducer\n);\n\n\n/*********************************************************************\n*  Buffer-less and synchronous inner streaming functions (DEPRECATED)\n*\n*  This API is deprecated, and will be removed in a future version.\n*  It allows streaming (de)compression with user allocated buffers.\n*  However, it is hard to use, and not as well tested as the rest of\n*  our API.\n*\n*  Please use the normal streaming API instead: ZSTD_compressStream2,\n*  and ZSTD_decompressStream.\n*  If there is functionality that you need, but it doesn't provide,\n*  please open an issue on our GitHub.\n********************************************************************* */\n\n/**\n  Buffer-less streaming compression (synchronous mode)\n\n  A ZSTD_CCtx object is required to track streaming operations.\n  Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource.\n  ZSTD_CCtx object can be reused multiple times within successive compression operations.\n\n  Start by initializing a context.\n  Use ZSTD_compressBegin(), or ZSTD_compressBegin_usingDict() for dictionary compression.\n\n  Then, consume your input using ZSTD_compressContinue().\n  There are some important considerations to keep in mind when using this advanced function :\n  - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffers only.\n  - Interface is synchronous : input is consumed entirely and produces 1+ compressed blocks.\n  - Caller must ensure there is enough space in `dst` to store compressed data under worst case scenario.\n    Worst case evaluation is provided by ZSTD_compressBound().\n    ZSTD_compressContinue() doesn't guarantee recover after a failed compression.\n  - ZSTD_compressContinue() presumes prior input ***is still accessible and unmodified*** (up to maximum distance size, see WindowLog).\n    It remembers all previous contiguous blocks, plus one separated memory segment (which can itself consists of multiple contiguous blocks)\n  - ZSTD_compressContinue() detects that prior input has been overwritten when `src` buffer overlaps.\n    In which case, it will \"discard\" the relevant memory section from its history.\n\n  Finish a frame with ZSTD_compressEnd(), which will write the last block(s) and optional checksum.\n  It's possible to use srcSize==0, in which case, it will write a final empty block to end the frame.\n  Without last block mark, frames are considered unfinished (hence corrupted) by compliant decoders.\n\n  `ZSTD_CCtx` object can be reused (ZSTD_compressBegin()) to compress again.\n*/\n\n/*=====   Buffer-less streaming compression functions  =====*/\nZSTD_DEPRECATED(\"The buffer-less API is deprecated in favor of the normal streaming API. See docs.\")\nZSTDLIB_STATIC_API size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel);\nZSTD_DEPRECATED(\"The buffer-less API is deprecated in favor of the normal streaming API. See docs.\")\nZSTDLIB_STATIC_API size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel);\nZSTD_DEPRECATED(\"The buffer-less API is deprecated in favor of the normal streaming API. See docs.\")\nZSTDLIB_STATIC_API size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict); /**< note: fails if cdict==NULL */\n\nZSTD_DEPRECATED(\"This function will likely be removed in a future release. It is misleading and has very limited utility.\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize); /**<  note: if pledgedSrcSize is not known, use ZSTD_CONTENTSIZE_UNKNOWN */\n\nZSTD_DEPRECATED(\"The buffer-less API is deprecated in favor of the normal streaming API. See docs.\")\nZSTDLIB_STATIC_API size_t ZSTD_compressContinue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);\nZSTD_DEPRECATED(\"The buffer-less API is deprecated in favor of the normal streaming API. See docs.\")\nZSTDLIB_STATIC_API size_t ZSTD_compressEnd(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);\n\n/* The ZSTD_compressBegin_advanced() and ZSTD_compressBegin_usingCDict_advanced() are now DEPRECATED and will generate a compiler warning */\nZSTD_DEPRECATED(\"use advanced API to access custom parameters\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize : If srcSize is not known at init time, use ZSTD_CONTENTSIZE_UNKNOWN */\nZSTD_DEPRECATED(\"use advanced API to access custom parameters\")\nZSTDLIB_STATIC_API\nsize_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize);   /* compression parameters are already set within cdict. pledgedSrcSize must be correct. If srcSize is not known, use macro ZSTD_CONTENTSIZE_UNKNOWN */\n/**\n  Buffer-less streaming decompression (synchronous mode)\n\n  A ZSTD_DCtx object is required to track streaming operations.\n  Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it.\n  A ZSTD_DCtx object can be reused multiple times.\n\n  First typical operation is to retrieve frame parameters, using ZSTD_getFrameHeader().\n  Frame header is extracted from the beginning of compressed frame, so providing only the frame's beginning is enough.\n  Data fragment must be large enough to ensure successful decoding.\n `ZSTD_frameHeaderSize_max` bytes is guaranteed to always be large enough.\n  result  : 0 : successful decoding, the `ZSTD_frameHeader` structure is correctly filled.\n           >0 : `srcSize` is too small, please provide at least result bytes on next attempt.\n           errorCode, which can be tested using ZSTD_isError().\n\n  It fills a ZSTD_frameHeader structure with important information to correctly decode the frame,\n  such as the dictionary ID, content size, or maximum back-reference distance (`windowSize`).\n  Note that these values could be wrong, either because of data corruption, or because a 3rd party deliberately spoofs false information.\n  As a consequence, check that values remain within valid application range.\n  For example, do not allocate memory blindly, check that `windowSize` is within expectation.\n  Each application can set its own limits, depending on local restrictions.\n  For extended interoperability, it is recommended to support `windowSize` of at least 8 MB.\n\n  ZSTD_decompressContinue() needs previous data blocks during decompression, up to `windowSize` bytes.\n  ZSTD_decompressContinue() is very sensitive to contiguity,\n  if 2 blocks don't follow each other, make sure that either the compressor breaks contiguity at the same place,\n  or that previous contiguous segment is large enough to properly handle maximum back-reference distance.\n  There are multiple ways to guarantee this condition.\n\n  The most memory efficient way is to use a round buffer of sufficient size.\n  Sufficient size is determined by invoking ZSTD_decodingBufferSize_min(),\n  which can return an error code if required value is too large for current system (in 32-bits mode).\n  In a round buffer methodology, ZSTD_decompressContinue() decompresses each block next to previous one,\n  up to the moment there is not enough room left in the buffer to guarantee decoding another full block,\n  which maximum size is provided in `ZSTD_frameHeader` structure, field `blockSizeMax`.\n  At which point, decoding can resume from the beginning of the buffer.\n  Note that already decoded data stored in the buffer should be flushed before being overwritten.\n\n  There are alternatives possible, for example using two or more buffers of size `windowSize` each, though they consume more memory.\n\n  Finally, if you control the compression process, you can also ignore all buffer size rules,\n  as long as the encoder and decoder progress in \"lock-step\",\n  aka use exactly the same buffer sizes, break contiguity at the same place, etc.\n\n  Once buffers are setup, start decompression, with ZSTD_decompressBegin().\n  If decompression requires a dictionary, use ZSTD_decompressBegin_usingDict() or ZSTD_decompressBegin_usingDDict().\n\n  Then use ZSTD_nextSrcSizeToDecompress() and ZSTD_decompressContinue() alternatively.\n  ZSTD_nextSrcSizeToDecompress() tells how many bytes to provide as 'srcSize' to ZSTD_decompressContinue().\n  ZSTD_decompressContinue() requires this _exact_ amount of bytes, or it will fail.\n\n  result of ZSTD_decompressContinue() is the number of bytes regenerated within 'dst' (necessarily <= dstCapacity).\n  It can be zero : it just means ZSTD_decompressContinue() has decoded some metadata item.\n  It can also be an error code, which can be tested with ZSTD_isError().\n\n  A frame is fully decoded when ZSTD_nextSrcSizeToDecompress() returns zero.\n  Context can then be reset to start a new decompression.\n\n  Note : it's possible to know if next input to present is a header or a block, using ZSTD_nextInputType().\n  This information is not required to properly decode a frame.\n\n  == Special case : skippable frames ==\n\n  Skippable frames allow integration of user-defined data into a flow of concatenated frames.\n  Skippable frames will be ignored (skipped) by decompressor.\n  The format of skippable frames is as follows :\n  a) Skippable frame ID - 4 Bytes, Little endian format, any value from 0x184D2A50 to 0x184D2A5F\n  b) Frame Size - 4 Bytes, Little endian format, unsigned 32-bits\n  c) Frame Content - any content (User Data) of length equal to Frame Size\n  For skippable frames ZSTD_getFrameHeader() returns zfhPtr->frameType==ZSTD_skippableFrame.\n  For skippable frames ZSTD_decompressContinue() always returns 0 : it only skips the content.\n*/\n\n/*=====   Buffer-less streaming decompression functions  =====*/\n\nZSTDLIB_STATIC_API size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize);  /**< when frame content size is not known, pass in frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN */\n\nZSTDLIB_STATIC_API size_t ZSTD_decompressBegin(ZSTD_DCtx* dctx);\nZSTDLIB_STATIC_API size_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize);\nZSTDLIB_STATIC_API size_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);\n\nZSTDLIB_STATIC_API size_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx);\nZSTDLIB_STATIC_API size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);\n\n/* misc */\nZSTD_DEPRECATED(\"This function will likely be removed in the next minor release. It is misleading and has very limited utility.\")\nZSTDLIB_STATIC_API void   ZSTD_copyDCtx(ZSTD_DCtx* dctx, const ZSTD_DCtx* preparedDCtx);\ntypedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;\nZSTDLIB_STATIC_API ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx);\n\n\n\n\n/* ========================================= */\n/**       Block level API (DEPRECATED)       */\n/* ========================================= */\n\n/*!\n\n    This API is deprecated in favor of the regular compression API.\n    You can get the frame header down to 2 bytes by setting:\n      - ZSTD_c_format = ZSTD_f_zstd1_magicless\n      - ZSTD_c_contentSizeFlag = 0\n      - ZSTD_c_checksumFlag = 0\n      - ZSTD_c_dictIDFlag = 0\n\n    This API is not as well tested as our normal API, so we recommend not using it.\n    We will be removing it in a future version. If the normal API doesn't provide\n    the functionality you need, please open a GitHub issue.\n\n    Block functions produce and decode raw zstd blocks, without frame metadata.\n    Frame metadata cost is typically ~12 bytes, which can be non-negligible for very small blocks (< 100 bytes).\n    But users will have to take in charge needed metadata to regenerate data, such as compressed and content sizes.\n\n    A few rules to respect :\n    - Compressing and decompressing require a context structure\n      + Use ZSTD_createCCtx() and ZSTD_createDCtx()\n    - It is necessary to init context before starting\n      + compression : any ZSTD_compressBegin*() variant, including with dictionary\n      + decompression : any ZSTD_decompressBegin*() variant, including with dictionary\n    - Block size is limited, it must be <= ZSTD_getBlockSize() <= ZSTD_BLOCKSIZE_MAX == 128 KB\n      + If input is larger than a block size, it's necessary to split input data into multiple blocks\n      + For inputs larger than a single block, consider using regular ZSTD_compress() instead.\n        Frame metadata is not that costly, and quickly becomes negligible as source size grows larger than a block.\n    - When a block is considered not compressible enough, ZSTD_compressBlock() result will be 0 (zero) !\n      ===> In which case, nothing is produced into `dst` !\n      + User __must__ test for such outcome and deal directly with uncompressed data\n      + A block cannot be declared incompressible if ZSTD_compressBlock() return value was != 0.\n        Doing so would mess up with statistics history, leading to potential data corruption.\n      + ZSTD_decompressBlock() _doesn't accept uncompressed data as input_ !!\n      + In case of multiple successive blocks, should some of them be uncompressed,\n        decoder must be informed of their existence in order to follow proper history.\n        Use ZSTD_insertBlock() for such a case.\n*/\n\n/*=====   Raw zstd block functions  =====*/\nZSTD_DEPRECATED(\"The block API is deprecated in favor of the normal compression API. See docs.\")\nZSTDLIB_STATIC_API size_t ZSTD_getBlockSize   (const ZSTD_CCtx* cctx);\nZSTD_DEPRECATED(\"The block API is deprecated in favor of the normal compression API. See docs.\")\nZSTDLIB_STATIC_API size_t ZSTD_compressBlock  (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);\nZSTD_DEPRECATED(\"The block API is deprecated in favor of the normal compression API. See docs.\")\nZSTDLIB_STATIC_API size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);\nZSTD_DEPRECATED(\"The block API is deprecated in favor of the normal compression API. See docs.\")\nZSTDLIB_STATIC_API size_t ZSTD_insertBlock    (ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize);  /**< insert uncompressed block into `dctx` history. Useful for multi-blocks decompression. */\n\n#endif   /* ZSTD_H_ZSTD_STATIC_LINKING_ONLY */\n\n#if defined (__cplusplus)\n}\n#endif\n"
  },
  {
    "path": "src/bled/zstd_bits.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n#ifndef ZSTD_BITS_H\n#define ZSTD_BITS_H\n\n#include \"zstd_mem.h\"\n\nMEM_STATIC unsigned ZSTD_countTrailingZeros32_fallback(U32 val)\n{\n    assert(val != 0);\n    {\n        static const U32 DeBruijnBytePos[32] = {0, 1, 28, 2, 29, 14, 24, 3,\n                                                30, 22, 20, 15, 25, 17, 4, 8,\n                                                31, 27, 13, 23, 21, 19, 16, 7,\n                                                26, 12, 18, 6, 11, 5, 10, 9};\n        return DeBruijnBytePos[((U32) ((val & -(S32) val) * 0x077CB531U)) >> 27];\n    }\n}\n\nMEM_STATIC unsigned ZSTD_countTrailingZeros32(U32 val)\n{\n    assert(val != 0);\n#   if defined(_MSC_VER)\n#       if STATIC_BMI2 == 1\n            return (unsigned)_tzcnt_u32(val);\n#       else\n            if (val != 0) {\n                unsigned long r;\n                _BitScanForward(&r, val);\n                return (unsigned)r;\n            } else {\n                /* Should not reach this code path */\n                __assume(0);\n            }\n#       endif\n#   elif defined(__GNUC__) && (__GNUC__ >= 4)\n        return (unsigned)__builtin_ctz(val);\n#   elif defined(__ICCARM__)\n        return (unsigned)__builtin_ctz(val);\n#   else\n        return ZSTD_countTrailingZeros32_fallback(val);\n#   endif\n}\n\nMEM_STATIC unsigned ZSTD_countLeadingZeros32_fallback(U32 val) {\n    assert(val != 0);\n    {\n        static const U32 DeBruijnClz[32] = {0, 9, 1, 10, 13, 21, 2, 29,\n                                            11, 14, 16, 18, 22, 25, 3, 30,\n                                            8, 12, 20, 28, 15, 17, 24, 7,\n                                            19, 27, 23, 6, 26, 5, 4, 31};\n        val |= val >> 1;\n        val |= val >> 2;\n        val |= val >> 4;\n        val |= val >> 8;\n        val |= val >> 16;\n        return 31 - DeBruijnClz[(val * 0x07C4ACDDU) >> 27];\n    }\n}\n\nMEM_STATIC unsigned ZSTD_countLeadingZeros32(U32 val)\n{\n    assert(val != 0);\n#   if defined(_MSC_VER)\n#       if STATIC_BMI2 == 1\n            return (unsigned)_lzcnt_u32(val);\n#       else\n            if (val != 0) {\n                unsigned long r;\n                _BitScanReverse(&r, val);\n                return (unsigned)(31 - r);\n            } else {\n                /* Should not reach this code path */\n                __assume(0);\n            }\n#       endif\n#   elif defined(__GNUC__) && (__GNUC__ >= 4)\n        return (unsigned)__builtin_clz(val);\n#   elif defined(__ICCARM__)\n        return (unsigned)__builtin_clz(val);\n#   else\n        return ZSTD_countLeadingZeros32_fallback(val);\n#   endif\n}\n\nMEM_STATIC unsigned ZSTD_countTrailingZeros64(U64 val)\n{\n    assert(val != 0);\n#   if defined(_MSC_VER) && defined(_WIN64)\n#       if STATIC_BMI2 == 1\n            return (unsigned)_tzcnt_u64(val);\n#       else\n            if (val != 0) {\n                unsigned long r;\n                _BitScanForward64(&r, val);\n                return (unsigned)r;\n            } else {\n                /* Should not reach this code path */\n                __assume(0);\n            }\n#       endif\n#   elif defined(__GNUC__) && (__GNUC__ >= 4) && defined(__LP64__)\n        return (unsigned)__builtin_ctzll(val);\n#   elif defined(__ICCARM__)\n        return (unsigned)__builtin_ctzll(val);\n#   else\n        {\n            U32 mostSignificantWord = (U32)(val >> 32);\n            U32 leastSignificantWord = (U32)val;\n            if (leastSignificantWord == 0) {\n                return 32 + ZSTD_countTrailingZeros32(mostSignificantWord);\n            } else {\n                return ZSTD_countTrailingZeros32(leastSignificantWord);\n            }\n        }\n#   endif\n}\n\nMEM_STATIC unsigned ZSTD_countLeadingZeros64(U64 val)\n{\n    assert(val != 0);\n#   if defined(_MSC_VER) && defined(_WIN64)\n#       if STATIC_BMI2 == 1\n            return (unsigned)_lzcnt_u64(val);\n#       else\n            if (val != 0) {\n                unsigned long r;\n                _BitScanReverse64(&r, val);\n                return (unsigned)(63 - r);\n            } else {\n                /* Should not reach this code path */\n                __assume(0);\n            }\n#       endif\n#   elif defined(__GNUC__) && (__GNUC__ >= 4)\n        return (unsigned)(__builtin_clzll(val));\n#   elif defined(__ICCARM__)\n        return (unsigned)(__builtin_clzll(val));\n#   else\n        {\n            U32 mostSignificantWord = (U32)(val >> 32);\n            U32 leastSignificantWord = (U32)val;\n            if (mostSignificantWord == 0) {\n                return 32 + ZSTD_countLeadingZeros32(leastSignificantWord);\n            } else {\n                return ZSTD_countLeadingZeros32(mostSignificantWord);\n            }\n        }\n#   endif\n}\n\nMEM_STATIC unsigned ZSTD_NbCommonBytes(size_t val)\n{\n    if (MEM_isLittleEndian()) {\n        if (MEM_64bits()) {\n            return ZSTD_countTrailingZeros64((U64)val) >> 3;\n        } else {\n            return ZSTD_countTrailingZeros32((U32)val) >> 3;\n        }\n    } else {  /* Big Endian CPU */\n        if (MEM_64bits()) {\n            return ZSTD_countLeadingZeros64((U64)val) >> 3;\n        } else {\n            return ZSTD_countLeadingZeros32((U32)val) >> 3;\n        }\n    }\n}\n\nMEM_STATIC unsigned ZSTD_highbit32(U32 val)   /* compress, dictBuilder, decodeCorpus */\n{\n    assert(val != 0);\n    return 31 - ZSTD_countLeadingZeros32(val);\n}\n\n/* ZSTD_rotateRight_*():\n * Rotates a bitfield to the right by \"count\" bits.\n * https://en.wikipedia.org/w/index.php?title=Circular_shift&oldid=991635599#Implementing_circular_shifts\n */\nMEM_STATIC\nU64 ZSTD_rotateRight_U64(U64 const value, U32 count) {\n    assert(count < 64);\n    count &= 0x3F; /* for fickle pattern recognition */\n    return (value >> count) | (U64)(value << ((0U - count) & 0x3F));\n}\n\nMEM_STATIC\nU32 ZSTD_rotateRight_U32(U32 const value, U32 count) {\n    assert(count < 32);\n    count &= 0x1F; /* for fickle pattern recognition */\n    return (value >> count) | (U32)(value << ((0U - count) & 0x1F));\n}\n\nMEM_STATIC\nU16 ZSTD_rotateRight_U16(U16 const value, U32 count) {\n    assert(count < 16);\n    count &= 0x0F; /* for fickle pattern recognition */\n    return (value >> count) | (U16)(value << ((0U - count) & 0x0F));\n}\n\n#endif /* ZSTD_BITS_H */\n"
  },
  {
    "path": "src/bled/zstd_common.c",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n\n\n/*-*************************************\n*  Dependencies\n***************************************/\n#define ZSTD_DEPS_NEED_MALLOC\n#include \"zstd_error_private.h\"\n#include \"zstd_internal.h\"\n\n\n/*-****************************************\n*  Version\n******************************************/\nunsigned ZSTD_versionNumber(void) { return ZSTD_VERSION_NUMBER; }\n\nconst char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }\n\n\n/*-****************************************\n*  ZSTD Error Management\n******************************************/\n#undef ZSTD_isError   /* defined within zstd_internal.h */\n/*! ZSTD_isError() :\n *  tells if a return value is an error code\n *  symbol is required for external callers */\nunsigned ZSTD_isError(size_t code) { return ERR_isError(code); }\n\n/*! ZSTD_getErrorName() :\n *  provides error code string from function result (useful for debugging) */\nconst char* ZSTD_getErrorName(size_t code) { return ERR_getErrorName(code); }\n\n/*! ZSTD_getError() :\n *  convert a `size_t` function result into a proper ZSTD_errorCode enum */\nZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); }\n\n/*! ZSTD_getErrorString() :\n *  provides error code string from enum */\nconst char* ZSTD_getErrorString(ZSTD_ErrorCode code) { return ERR_getErrorString(code); }\n"
  },
  {
    "path": "src/bled/zstd_compiler.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n#ifndef ZSTD_COMPILER_H\n#define ZSTD_COMPILER_H\n\n#include <stddef.h>\n#include \"zstd_deps.h\"\n\n/*-*******************************************************\n*  Compiler specifics\n*********************************************************/\n/* force inlining */\n\n#if !defined(ZSTD_NO_INLINE)\n#if (defined(__GNUC__) && !defined(__STRICT_ANSI__)) || defined(__cplusplus) || defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L   /* C99 */\n#  define INLINE_KEYWORD inline\n#else\n#  define INLINE_KEYWORD\n#endif\n\n#if defined(__GNUC__) || defined(__IAR_SYSTEMS_ICC__)\n#  define FORCE_INLINE_ATTR __attribute__((always_inline))\n#elif defined(_MSC_VER)\n#  define FORCE_INLINE_ATTR __forceinline\n#else\n#  define FORCE_INLINE_ATTR\n#endif\n\n#else\n\n#define INLINE_KEYWORD\n#define FORCE_INLINE_ATTR\n\n#endif\n\n/**\n  On MSVC qsort requires that functions passed into it use the __cdecl calling conversion(CC).\n  This explicitly marks such functions as __cdecl so that the code will still compile\n  if a CC other than __cdecl has been made the default.\n*/\n#if  defined(_MSC_VER)\n#  define WIN_CDECL __cdecl\n#else\n#  define WIN_CDECL\n#endif\n\n/* UNUSED_ATTR tells the compiler it is okay if the function is unused. */\n#if defined(__GNUC__) || defined(__IAR_SYSTEMS_ICC__)\n#  define UNUSED_ATTR __attribute__((unused))\n#else\n#  define UNUSED_ATTR\n#endif\n\n/**\n * FORCE_INLINE_TEMPLATE is used to define C \"templates\", which take constant\n * parameters. They must be inlined for the compiler to eliminate the constant\n * branches.\n */\n#define FORCE_INLINE_TEMPLATE static INLINE_KEYWORD FORCE_INLINE_ATTR UNUSED_ATTR\n/**\n * HINT_INLINE is used to help the compiler generate better code. It is *not*\n * used for \"templates\", so it can be tweaked based on the compilers\n * performance.\n *\n * gcc-4.8 and gcc-4.9 have been shown to benefit from leaving off the\n * always_inline attribute.\n *\n * clang up to 5.0.0 (trunk) benefit tremendously from the always_inline\n * attribute.\n */\n#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8 && __GNUC__ < 5\n#  define HINT_INLINE static INLINE_KEYWORD\n#else\n#  define HINT_INLINE FORCE_INLINE_TEMPLATE\n#endif\n\n/* \"soft\" inline :\n * The compiler is free to select if it's a good idea to inline or not.\n * The main objective is to silence compiler warnings\n * when a defined function in included but not used.\n *\n * Note : this macro is prefixed `MEM_` because it used to be provided by `mem.h` unit.\n * Updating the prefix is probably preferable, but requires a fairly large codemod,\n * since this name is used everywhere.\n */\n#ifndef MEM_STATIC  /* already defined in Linux Kernel mem.h */\n#if defined(__GNUC__)\n#  define MEM_STATIC static __inline UNUSED_ATTR\n#elif defined(__IAR_SYSTEMS_ICC__)\n#  define MEM_STATIC static inline UNUSED_ATTR\n#elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)\n#  define MEM_STATIC static inline\n#elif defined(_MSC_VER)\n#  define MEM_STATIC static __inline\n#else\n#  define MEM_STATIC static  /* this version may generate warnings for unused static functions; disable the relevant warning */\n#endif\n#endif\n\n/* force no inlining */\n#ifdef _MSC_VER\n#  define FORCE_NOINLINE static __declspec(noinline)\n#else\n#  if defined(__GNUC__) || defined(__IAR_SYSTEMS_ICC__)\n#    define FORCE_NOINLINE static __attribute__((__noinline__))\n#  else\n#    define FORCE_NOINLINE static\n#  endif\n#endif\n\n\n/* target attribute */\n#if defined(__GNUC__) || defined(__IAR_SYSTEMS_ICC__)\n#  define TARGET_ATTRIBUTE(target) __attribute__((__target__(target)))\n#else\n#  define TARGET_ATTRIBUTE(target)\n#endif\n\n/* Target attribute for BMI2 dynamic dispatch.\n * Enable lzcnt, bmi, and bmi2.\n * We test for bmi1 & bmi2. lzcnt is included in bmi1.\n */\n#define BMI2_TARGET_ATTRIBUTE TARGET_ATTRIBUTE(\"lzcnt,bmi,bmi2\")\n\n/* prefetch\n * can be disabled, by declaring NO_PREFETCH build macro */\n#if defined(NO_PREFETCH)\n#  define PREFETCH_L1(ptr)  do { (void)(ptr); } while (0)  /* disabled */\n#  define PREFETCH_L2(ptr)  do { (void)(ptr); } while (0)  /* disabled */\n#else\n#  if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86)) && !defined(_M_ARM64EC)  /* _mm_prefetch() is not defined outside of x86/x64 */\n#    include <mmintrin.h>   /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */\n#    define PREFETCH_L1(ptr)  _mm_prefetch((const char*)(ptr), _MM_HINT_T0)\n#    define PREFETCH_L2(ptr)  _mm_prefetch((const char*)(ptr), _MM_HINT_T1)\n#  elif defined(__GNUC__) && ( (__GNUC__ >= 4) || ( (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1) ) )\n#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)\n#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)\n#  elif defined(__aarch64__)\n#    define PREFETCH_L1(ptr)  do { __asm__ __volatile__(\"prfm pldl1keep, %0\" ::\"Q\"(*(ptr))); } while (0)\n#    define PREFETCH_L2(ptr)  do { __asm__ __volatile__(\"prfm pldl2keep, %0\" ::\"Q\"(*(ptr))); } while (0)\n#  else\n#    define PREFETCH_L1(ptr) do { (void)(ptr); } while (0)  /* disabled */\n#    define PREFETCH_L2(ptr) do { (void)(ptr); } while (0)  /* disabled */\n#  endif\n#endif  /* NO_PREFETCH */\n\n#define CACHELINE_SIZE 64\n\n#define PREFETCH_AREA(p, s)                              \\\n    do {                                                 \\\n        const char* const _ptr = (const char*)(p);       \\\n        size_t const _size = (size_t)(s);                \\\n        size_t _pos;                                     \\\n        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \\\n            PREFETCH_L2(_ptr + _pos);                    \\\n        }                                                \\\n    } while (0)\n\n/* vectorization\n * older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax,\n * and some compilers, like Intel ICC and MCST LCC, do not support it at all. */\n#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && !defined(__LCC__)\n#  if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5)\n#    define DONT_VECTORIZE __attribute__((optimize(\"no-tree-vectorize\")))\n#  else\n#    define DONT_VECTORIZE _Pragma(\"GCC optimize(\\\"no-tree-vectorize\\\")\")\n#  endif\n#else\n#  define DONT_VECTORIZE\n#endif\n\n/* Tell the compiler that a branch is likely or unlikely.\n * Only use these macros if it causes the compiler to generate better code.\n * If you can remove a LIKELY/UNLIKELY annotation without speed changes in gcc\n * and clang, please do.\n */\n#if defined(__GNUC__)\n#define LIKELY(x) (__builtin_expect((x), 1))\n#define UNLIKELY(x) (__builtin_expect((x), 0))\n#else\n#define LIKELY(x) (x)\n#define UNLIKELY(x) (x)\n#endif\n\n#if 0 || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))\n#  define ZSTD_UNREACHABLE do { assert(0), __builtin_unreachable(); } while (0)\n#else\n#  define ZSTD_UNREACHABLE do { assert(0); } while (0)\n#endif\n\n/* disable warnings */\n#ifdef _MSC_VER    /* Visual Studio */\n#  include <intrin.h>                    /* For Visual 2005 */\n#  pragma warning(disable : 4100)        /* disable: C4100: unreferenced formal parameter */\n#  pragma warning(disable : 4127)        /* disable: C4127: conditional expression is constant */\n#  pragma warning(disable : 4204)        /* disable: C4204: non-constant aggregate initializer */\n#  pragma warning(disable : 4214)        /* disable: C4214: non-int bitfields */\n#  pragma warning(disable : 4324)        /* disable: C4324: padded structure */\n#endif\n\n/*Like DYNAMIC_BMI2 but for compile time determination of BMI2 support*/\n#ifndef STATIC_BMI2\n#  if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86))\n#    ifdef __AVX2__  //MSVC does not have a BMI2 specific flag, but every CPU that supports AVX2 also supports BMI2\n#       define STATIC_BMI2 1\n#    endif\n#  elif defined(__BMI2__) && defined(__x86_64__) && defined(__GNUC__)\n#    define STATIC_BMI2 1\n#  endif\n#endif\n\n#ifndef STATIC_BMI2\n    #define STATIC_BMI2 0\n#endif\n\n/* compile time determination of SIMD support */\n#if !defined(ZSTD_NO_INTRINSICS)\n#  if defined(__SSE2__) || defined(_M_AMD64) || (defined (_M_IX86) && defined(_M_IX86_FP) && (_M_IX86_FP >= 2))\n#    define ZSTD_ARCH_X86_SSE2\n#  endif\n#  if defined(__ARM_NEON) || defined(_M_ARM64)\n#    define ZSTD_ARCH_ARM_NEON\n#  endif\n#\n#  if defined(ZSTD_ARCH_X86_SSE2)\n#    include <emmintrin.h>\n#  elif defined(ZSTD_ARCH_ARM_NEON)\n#    include <arm_neon.h>\n#  endif\n#endif\n\n/* C-language Attributes are added in C23. */\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201710L) && defined(__has_c_attribute)\n# define ZSTD_HAS_C_ATTRIBUTE(x) __has_c_attribute(x)\n#else\n# define ZSTD_HAS_C_ATTRIBUTE(x) 0\n#endif\n\n/* Only use C++ attributes in C++. Some compilers report support for C++\n * attributes when compiling with C.\n */\n#if defined(__cplusplus) && defined(__has_cpp_attribute)\n# define ZSTD_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)\n#else\n# define ZSTD_HAS_CPP_ATTRIBUTE(x) 0\n#endif\n\n/* Define ZSTD_FALLTHROUGH macro for annotating switch case with the 'fallthrough' attribute.\n * - C23: https://en.cppreference.com/w/c/language/attributes/fallthrough\n * - CPP17: https://en.cppreference.com/w/cpp/language/attributes/fallthrough\n * - Else: __attribute__((__fallthrough__))\n */\n#ifndef ZSTD_FALLTHROUGH\n# if ZSTD_HAS_C_ATTRIBUTE(fallthrough)\n#  define ZSTD_FALLTHROUGH [[fallthrough]]\n# elif ZSTD_HAS_CPP_ATTRIBUTE(fallthrough)\n#  define ZSTD_FALLTHROUGH [[fallthrough]]\n# elif __has_attribute(__fallthrough__)\n/* Leading semicolon is to satisfy gcc-11 with -pedantic. Without the semicolon\n * gcc complains about: a label can only be part of a statement and a declaration is not a statement.\n */\n#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))\n# else\n#  define ZSTD_FALLTHROUGH\n# endif\n#endif\n\n/*-**************************************************************\n*  Alignment check\n*****************************************************************/\n\n/* @return 1 if @u is a 2^n value, 0 otherwise\n * useful to check a value is valid for alignment restrictions */\nMEM_STATIC int ZSTD_isPower2(size_t u) {\n    return (u & (u-1)) == 0;\n}\n\n/* this test was initially positioned in mem.h,\n * but this file is removed (or replaced) for linux kernel\n * so it's now hosted in compiler.h,\n * which remains valid for both user & kernel spaces.\n */\n\n#ifndef ZSTD_ALIGNOF\n# if defined(__GNUC__) || defined(_MSC_VER)\n/* covers gcc, clang & MSVC */\n/* note : this section must come first, before C11,\n * due to a limitation in the kernel source generator */\n#  define ZSTD_ALIGNOF(T) __alignof(T)\n\n# elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)\n/* C11 support */\n#  include <stdalign.h>\n#  define ZSTD_ALIGNOF(T) alignof(T)\n\n# else\n/* No known support for alignof() - imperfect backup */\n#  define ZSTD_ALIGNOF(T) (sizeof(void*) < sizeof(T) ? sizeof(void*) : sizeof(T))\n\n# endif\n#endif /* ZSTD_ALIGNOF */\n\n/*-**************************************************************\n*  Sanitizer\n*****************************************************************/\n\n/**\n * Zstd relies on pointer overflow in its decompressor.\n * We add this attribute to functions that rely on pointer overflow.\n */\n#ifndef ZSTD_ALLOW_POINTER_OVERFLOW_ATTR\n#  if __has_attribute(no_sanitize)\n#    if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 8\n       /* gcc < 8 only has signed-integer-overlow which triggers on pointer overflow */\n#      define ZSTD_ALLOW_POINTER_OVERFLOW_ATTR __attribute__((no_sanitize(\"signed-integer-overflow\")))\n#    else\n       /* older versions of clang [3.7, 5.0) will warn that pointer-overflow is ignored. */\n#      define ZSTD_ALLOW_POINTER_OVERFLOW_ATTR __attribute__((no_sanitize(\"pointer-overflow\")))\n#    endif\n#  else\n#    define ZSTD_ALLOW_POINTER_OVERFLOW_ATTR\n#  endif\n#endif\n\n/**\n * Helper function to perform a wrapped pointer difference without triggering\n * UBSAN.\n *\n * @returns lhs - rhs with wrapping\n */\nMEM_STATIC\nZSTD_ALLOW_POINTER_OVERFLOW_ATTR\nptrdiff_t ZSTD_wrappedPtrDiff(unsigned char const* lhs, unsigned char const* rhs)\n{\n    return lhs - rhs;\n}\n\n/**\n * Helper function to perform a wrapped pointer add without triggering UBSAN.\n *\n * @return ptr + add with wrapping\n */\nMEM_STATIC\nZSTD_ALLOW_POINTER_OVERFLOW_ATTR\nunsigned char const* ZSTD_wrappedPtrAdd(unsigned char const* ptr, ptrdiff_t add)\n{\n    return ptr + add;\n}\n\n/**\n * Helper function to perform a wrapped pointer subtraction without triggering\n * UBSAN.\n *\n * @return ptr - sub with wrapping\n */\nMEM_STATIC\nZSTD_ALLOW_POINTER_OVERFLOW_ATTR\nunsigned char const* ZSTD_wrappedPtrSub(unsigned char const* ptr, ptrdiff_t sub)\n{\n    return ptr - sub;\n}\n\n/**\n * Helper function to add to a pointer that works around C's undefined behavior\n * of adding 0 to NULL.\n *\n * @returns `ptr + add` except it defines `NULL + 0 == NULL`.\n */\nMEM_STATIC\nunsigned char* ZSTD_maybeNullPtrAdd(unsigned char* ptr, ptrdiff_t add)\n{\n    return add > 0 ? ptr + add : ptr;\n}\n\n/* Issue #3240 reports an ASAN failure on an llvm-mingw build. Out of an\n * abundance of caution, disable our custom poisoning on mingw. */\n#ifdef __MINGW32__\n#ifndef ZSTD_ASAN_DONT_POISON_WORKSPACE\n#define ZSTD_ASAN_DONT_POISON_WORKSPACE 1\n#endif\n#ifndef ZSTD_MSAN_DONT_POISON_WORKSPACE\n#define ZSTD_MSAN_DONT_POISON_WORKSPACE 1\n#endif\n#endif\n\n#if ZSTD_MEMORY_SANITIZER && !defined(ZSTD_MSAN_DONT_POISON_WORKSPACE)\n/* Not all platforms that support msan provide sanitizers/msan_interface.h.\n * We therefore declare the functions we need ourselves, rather than trying to\n * include the header file... */\n#include <stddef.h>  /* size_t */\n#define ZSTD_DEPS_NEED_STDINT\n#include \"zstd_deps.h\"  /* intptr_t */\n\n/* Make memory region fully initialized (without changing its contents). */\nvoid __msan_unpoison(const volatile void *a, size_t size);\n\n/* Make memory region fully uninitialized (without changing its contents).\n   This is a legacy interface that does not update origin information. Use\n   __msan_allocated_memory() instead. */\nvoid __msan_poison(const volatile void *a, size_t size);\n\n/* Returns the offset of the first (at least partially) poisoned byte in the\n   memory range, or -1 if the whole range is good. */\nintptr_t __msan_test_shadow(const volatile void *x, size_t size);\n\n/* Print shadow and origin for the memory range to stderr in a human-readable\n   format. */\nvoid __msan_print_shadow(const volatile void *x, size_t size);\n#endif\n\n#if ZSTD_ADDRESS_SANITIZER && !defined(ZSTD_ASAN_DONT_POISON_WORKSPACE)\n/* Not all platforms that support asan provide sanitizers/asan_interface.h.\n * We therefore declare the functions we need ourselves, rather than trying to\n * include the header file... */\n#include <stddef.h>  /* size_t */\n\n/**\n * Marks a memory region (<c>[addr, addr+size)</c>) as unaddressable.\n *\n * This memory must be previously allocated by your program. Instrumented\n * code is forbidden from accessing addresses in this region until it is\n * unpoisoned. This function is not guaranteed to poison the entire region -\n * it could poison only a subregion of <c>[addr, addr+size)</c> due to ASan\n * alignment restrictions.\n *\n * \\note This function is not thread-safe because no two threads can poison or\n * unpoison memory in the same memory region simultaneously.\n *\n * \\param addr Start of memory region.\n * \\param size Size of memory region. */\nvoid __asan_poison_memory_region(void const volatile *addr, size_t size);\n\n/**\n * Marks a memory region (<c>[addr, addr+size)</c>) as addressable.\n *\n * This memory must be previously allocated by your program. Accessing\n * addresses in this region is allowed until this region is poisoned again.\n * This function could unpoison a super-region of <c>[addr, addr+size)</c> due\n * to ASan alignment restrictions.\n *\n * \\note This function is not thread-safe because no two threads can\n * poison or unpoison memory in the same memory region simultaneously.\n *\n * \\param addr Start of memory region.\n * \\param size Size of memory region. */\nvoid __asan_unpoison_memory_region(void const volatile *addr, size_t size);\n#endif\n\n#endif /* ZSTD_COMPILER_H */\n"
  },
  {
    "path": "src/bled/zstd_config.h",
    "content": "#ifndef ZSTD_CONFIG\n#define ZSTD_CONFIG\n\n#define ZSTD_DEBUGLEVEL                 0\n#define ZSTD_LEGACY_SUPPORT             0\n#define ZSTD_LIB_DEPRECATED             0\n#define ZSTD_NO_UNUSED_FUNCTIONS        1\n#define ZSTD_STRIP_ERROR_STRINGS        0\n#define ZSTD_TRACE                      0\n#define ZSTD_DECOMPRESS_DICTIONARY      0\n#define ZSTD_DECOMPRESS_MULTIFRAME      0\n#define ZSTD_NO_TRACE                   1\n\n#if CONFIG_FEATURE_ZSTD_SMALL >= 9\n#define ZSTD_NO_INLINE 1\n#endif\n\n#if CONFIG_FEATURE_ZSTD_SMALL >= 7\n#define HUF_FORCE_DECOMPRESS_X1 1\n#define ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT 1\n#elif CONFIG_FEATURE_ZSTD_SMALL >= 5\n#define HUF_FORCE_DECOMPRESS_X1 1\n#endif\n\n#if CONFIG_FEATURE_ZSTD_SMALL <= 7\n/* doesnt blow up code too much, -O3 is horrible */\n#ifdef __GNUC__\n#pragma GCC optimize (\"O2\")\n#endif\n#endif\n\n#if CONFIG_FEATURE_ZSTD_SMALL > 0\n/* no dynamic detection of bmi2 instruction,\n * prefer using CFLAGS setting to -march=haswell or similar */\n# if !defined(__BMI2__)\n#  define DYNAMIC_BMI2 0\n# endif\n#endif\n\n#ifdef __GNUC__\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wunused-function\"\n#endif\n\n#ifndef __has_attribute\n#define __has_attribute(x) 0\n#endif\n#ifndef __has_builtin\n#define __has_builtin(x) 0\n#endif\n#ifndef __has_feature\n#define __has_feature(x) 0\n#endif\n\n/* Include zstd_deps.h first with all the options we need enabled. */\n#define ZSTD_DEPS_NEED_MALLOC\n#define ZSTD_DEPS_NEED_MATH64\n#define ZSTD_DEPS_NEED_STDINT\n\n#endif\n"
  },
  {
    "path": "src/bled/zstd_cpu.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n#ifndef ZSTD_COMMON_CPU_H\n#define ZSTD_COMMON_CPU_H\n\n/**\n * Implementation taken from folly/CpuId.h\n * https://github.com/facebook/folly/blob/master/folly/CpuId.h\n */\n\n#include \"zstd_mem.h\"\n\n#ifdef _MSC_VER\n#include <intrin.h>\n#endif\n\ntypedef struct {\n    U32 f1c;\n    U32 f1d;\n    U32 f7b;\n    U32 f7c;\n} ZSTD_cpuid_t;\n\nMEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) {\n    U32 f1c = 0;\n    U32 f1d = 0;\n    U32 f7b = 0;\n    U32 f7c = 0;\n#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86))\n#if !defined(__clang__) || __clang_major__ >= 16\n    int reg[4];\n    __cpuid((int*)reg, 0);\n    {\n        int const n = reg[0];\n        if (n >= 1) {\n            __cpuid((int*)reg, 1);\n            f1c = (U32)reg[2];\n            f1d = (U32)reg[3];\n        }\n        if (n >= 7) {\n            __cpuidex((int*)reg, 7, 0);\n            f7b = (U32)reg[1];\n            f7c = (U32)reg[2];\n        }\n    }\n#else\n    /* Clang compiler has a bug (fixed in https://reviews.llvm.org/D101338) in\n     * which the `__cpuid` intrinsic does not save and restore `rbx` as it needs\n     * to due to being a reserved register. So in that case, do the `cpuid`\n     * ourselves. Clang supports inline assembly anyway.\n     */\n    U32 n;\n    __asm__(\n        \"pushq %%rbx\\n\\t\"\n        \"cpuid\\n\\t\"\n        \"popq %%rbx\\n\\t\"\n        : \"=a\"(n)\n        : \"a\"(0)\n        : \"rcx\", \"rdx\");\n    if (n >= 1) {\n      U32 f1a;\n      __asm__(\n          \"pushq %%rbx\\n\\t\"\n          \"cpuid\\n\\t\"\n          \"popq %%rbx\\n\\t\"\n          : \"=a\"(f1a), \"=c\"(f1c), \"=d\"(f1d)\n          : \"a\"(1)\n          :);\n    }\n    if (n >= 7) {\n      __asm__(\n          \"pushq %%rbx\\n\\t\"\n          \"cpuid\\n\\t\"\n          \"movq %%rbx, %%rax\\n\\t\"\n          \"popq %%rbx\"\n          : \"=a\"(f7b), \"=c\"(f7c)\n          : \"a\"(7), \"c\"(0)\n          : \"rdx\");\n    }\n#endif\n#elif defined(__i386__) && defined(__PIC__) && !defined(__clang__) && defined(__GNUC__)\n    /* The following block like the normal cpuid branch below, but gcc\n     * reserves ebx for use of its pic register so we must specially\n     * handle the save and restore to avoid clobbering the register\n     */\n    U32 n;\n    __asm__(\n        \"pushl %%ebx\\n\\t\"\n        \"cpuid\\n\\t\"\n        \"popl %%ebx\\n\\t\"\n        : \"=a\"(n)\n        : \"a\"(0)\n        : \"ecx\", \"edx\");\n    if (n >= 1) {\n      U32 f1a;\n      __asm__(\n          \"pushl %%ebx\\n\\t\"\n          \"cpuid\\n\\t\"\n          \"popl %%ebx\\n\\t\"\n          : \"=a\"(f1a), \"=c\"(f1c), \"=d\"(f1d)\n          : \"a\"(1));\n    }\n    if (n >= 7) {\n      __asm__(\n          \"pushl %%ebx\\n\\t\"\n          \"cpuid\\n\\t\"\n          \"movl %%ebx, %%eax\\n\\t\"\n          \"popl %%ebx\"\n          : \"=a\"(f7b), \"=c\"(f7c)\n          : \"a\"(7), \"c\"(0)\n          : \"edx\");\n    }\n#elif defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86)\n    U32 n;\n    __asm__(\"cpuid\" : \"=a\"(n) : \"a\"(0) : \"ebx\", \"ecx\", \"edx\");\n    if (n >= 1) {\n      U32 f1a;\n      __asm__(\"cpuid\" : \"=a\"(f1a), \"=c\"(f1c), \"=d\"(f1d) : \"a\"(1) : \"ebx\");\n    }\n    if (n >= 7) {\n      U32 f7a;\n      __asm__(\"cpuid\"\n              : \"=a\"(f7a), \"=b\"(f7b), \"=c\"(f7c)\n              : \"a\"(7), \"c\"(0)\n              : \"edx\");\n    }\n#endif\n    {\n        ZSTD_cpuid_t cpuid;\n        cpuid.f1c = f1c;\n        cpuid.f1d = f1d;\n        cpuid.f7b = f7b;\n        cpuid.f7c = f7c;\n        return cpuid;\n    }\n}\n\n#define X(name, r, bit)                                                        \\\n  MEM_STATIC int ZSTD_cpuid_##name(ZSTD_cpuid_t const cpuid) {                 \\\n    return ((cpuid.r) & (1U << bit)) != 0;                                     \\\n  }\n\n/* cpuid(1): Processor Info and Feature Bits. */\n#define C(name, bit) X(name, f1c, bit)\n  C(sse3, 0)\n  C(pclmuldq, 1)\n  C(dtes64, 2)\n  C(monitor, 3)\n  C(dscpl, 4)\n  C(vmx, 5)\n  C(smx, 6)\n  C(eist, 7)\n  C(tm2, 8)\n  C(ssse3, 9)\n  C(cnxtid, 10)\n  C(fma, 12)\n  C(cx16, 13)\n  C(xtpr, 14)\n  C(pdcm, 15)\n  C(pcid, 17)\n  C(dca, 18)\n  C(sse41, 19)\n  C(sse42, 20)\n  C(x2apic, 21)\n  C(movbe, 22)\n  C(popcnt, 23)\n  C(tscdeadline, 24)\n  C(aes, 25)\n  C(xsave, 26)\n  C(osxsave, 27)\n  C(avx, 28)\n  C(f16c, 29)\n  C(rdrand, 30)\n#undef C\n#define D(name, bit) X(name, f1d, bit)\n  D(fpu, 0)\n  D(vme, 1)\n  D(de, 2)\n  D(pse, 3)\n  D(tsc, 4)\n  D(msr, 5)\n  D(pae, 6)\n  D(mce, 7)\n  D(cx8, 8)\n  D(apic, 9)\n  D(sep, 11)\n  D(mtrr, 12)\n  D(pge, 13)\n  D(mca, 14)\n  D(cmov, 15)\n  D(pat, 16)\n  D(pse36, 17)\n  D(psn, 18)\n  D(clfsh, 19)\n  D(ds, 21)\n  D(acpi, 22)\n  D(mmx, 23)\n  D(fxsr, 24)\n  D(sse, 25)\n  D(sse2, 26)\n  D(ss, 27)\n  D(htt, 28)\n  D(tm, 29)\n  D(pbe, 31)\n#undef D\n\n/* cpuid(7): Extended Features. */\n#define B(name, bit) X(name, f7b, bit)\n  B(bmi1, 3)\n  B(hle, 4)\n  B(avx2, 5)\n  B(smep, 7)\n  B(bmi2, 8)\n  B(erms, 9)\n  B(invpcid, 10)\n  B(rtm, 11)\n  B(mpx, 14)\n  B(avx512f, 16)\n  B(avx512dq, 17)\n  B(rdseed, 18)\n  B(adx, 19)\n  B(smap, 20)\n  B(avx512ifma, 21)\n  B(pcommit, 22)\n  B(clflushopt, 23)\n  B(clwb, 24)\n  B(avx512pf, 26)\n  B(avx512er, 27)\n  B(avx512cd, 28)\n  B(sha, 29)\n  B(avx512bw, 30)\n  B(avx512vl, 31)\n#undef B\n#define C(name, bit) X(name, f7c, bit)\n  C(prefetchwt1, 0)\n  C(avx512vbmi, 1)\n#undef C\n\n#undef X\n\n#endif /* ZSTD_COMMON_CPU_H */\n"
  },
  {
    "path": "src/bled/zstd_ddict.c",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/* zstd_ddict.c :\n * concentrates all logic that needs to know the internals of ZSTD_DDict object */\n\n/*-*******************************************************\n*  Dependencies\n*********************************************************/\n//#include \"../common/allocations.h\"  /* ZSTD_customMalloc, ZSTD_customFree */\n#include \"zstd_deps.h\"   /* ZSTD_memcpy, ZSTD_memmove, ZSTD_memset */\n#include \"zstd_cpu.h\"         /* bmi2 */\n#include \"zstd_mem.h\"         /* low level memory routines */\n#define FSE_STATIC_LINKING_ONLY\n#include \"fse.h\"\n#include \"huf.h\"\n#include \"zstd_decompress_internal.h\"\n#include \"zstd_ddict.h\"\n\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)\n#  include \"../legacy/zstd_legacy.h\"\n#endif\n\n\n\n/*-*******************************************************\n*  Types\n*********************************************************/\nstruct ZSTD_DDict_s {\n    void* dictBuffer;\n    const void* dictContent;\n    size_t dictSize;\n    ZSTD_entropyDTables_t entropy;\n    U32 dictID;\n    U32 entropyPresent;\n    ZSTD_customMem cMem;\n};  /* typedef'd to ZSTD_DDict within \"zstd.h\" */\n\nconst void* ZSTD_DDict_dictContent(const ZSTD_DDict* ddict)\n{\n    assert(ddict != NULL);\n    return ddict->dictContent;\n}\n\nsize_t ZSTD_DDict_dictSize(const ZSTD_DDict* ddict)\n{\n    assert(ddict != NULL);\n    return ddict->dictSize;\n}\n\nvoid ZSTD_copyDDictParameters(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict)\n{\n    DEBUGLOG(4, \"ZSTD_copyDDictParameters\");\n    assert(dctx != NULL);\n    assert(ddict != NULL);\n    dctx->dictID = ddict->dictID;\n    dctx->prefixStart = ddict->dictContent;\n    dctx->virtualStart = ddict->dictContent;\n    dctx->dictEnd = (const BYTE*)ddict->dictContent + ddict->dictSize;\n    dctx->previousDstEnd = dctx->dictEnd;\n#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n    dctx->dictContentBeginForFuzzing = dctx->prefixStart;\n    dctx->dictContentEndForFuzzing = dctx->previousDstEnd;\n#endif\n    if (ddict->entropyPresent) {\n        dctx->litEntropy = 1;\n        dctx->fseEntropy = 1;\n        dctx->LLTptr = ddict->entropy.LLTable;\n        dctx->MLTptr = ddict->entropy.MLTable;\n        dctx->OFTptr = ddict->entropy.OFTable;\n        dctx->HUFptr = ddict->entropy.hufTable;\n        dctx->entropy.rep[0] = ddict->entropy.rep[0];\n        dctx->entropy.rep[1] = ddict->entropy.rep[1];\n        dctx->entropy.rep[2] = ddict->entropy.rep[2];\n    } else {\n        dctx->litEntropy = 0;\n        dctx->fseEntropy = 0;\n    }\n}\n\n\nstatic size_t\nZSTD_loadEntropy_intoDDict(ZSTD_DDict* ddict,\n                           ZSTD_dictContentType_e dictContentType)\n{\n    ddict->dictID = 0;\n    ddict->entropyPresent = 0;\n    if (dictContentType == ZSTD_dct_rawContent) return 0;\n\n    if (ddict->dictSize < 8) {\n        if (dictContentType == ZSTD_dct_fullDict)\n            return ERROR(dictionary_corrupted);   /* only accept specified dictionaries */\n        return 0;   /* pure content mode */\n    }\n    {   U32 const magic = MEM_readLE32(ddict->dictContent);\n        if (magic != ZSTD_MAGIC_DICTIONARY) {\n            if (dictContentType == ZSTD_dct_fullDict)\n                return ERROR(dictionary_corrupted);   /* only accept specified dictionaries */\n            return 0;   /* pure content mode */\n        }\n    }\n    ddict->dictID = MEM_readLE32((const char*)ddict->dictContent + ZSTD_FRAMEIDSIZE);\n\n    /* load entropy tables */\n    RETURN_ERROR_IF(ZSTD_isError(ZSTD_loadDEntropy(\n            &ddict->entropy, ddict->dictContent, ddict->dictSize)),\n        dictionary_corrupted, \"\");\n    ddict->entropyPresent = 1;\n    return 0;\n}\n\n\nstatic size_t ZSTD_initDDict_internal(ZSTD_DDict* ddict,\n                                      const void* dict, size_t dictSize,\n                                      ZSTD_dictLoadMethod_e dictLoadMethod,\n                                      ZSTD_dictContentType_e dictContentType)\n{\n    if ((dictLoadMethod == ZSTD_dlm_byRef) || (!dict) || (!dictSize)) {\n        ddict->dictBuffer = NULL;\n        ddict->dictContent = dict;\n        if (!dict) dictSize = 0;\n    } else {\n        void* const internalBuffer = ZSTD_customMalloc(dictSize, ddict->cMem);\n        ddict->dictBuffer = internalBuffer;\n        ddict->dictContent = internalBuffer;\n        if (!internalBuffer) return ERROR(memory_allocation);\n        ZSTD_memcpy(internalBuffer, dict, dictSize);\n    }\n    ddict->dictSize = dictSize;\n    ddict->entropy.hufTable[0] = (HUF_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);  /* cover both little and big endian */\n\n    /* parse dictionary content */\n    FORWARD_IF_ERROR( ZSTD_loadEntropy_intoDDict(ddict, dictContentType) , \"\");\n\n    return 0;\n}\n\nZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,\n                                      ZSTD_dictLoadMethod_e dictLoadMethod,\n                                      ZSTD_dictContentType_e dictContentType,\n                                      ZSTD_customMem customMem)\n{\n    if ((!customMem.customAlloc) ^ (!customMem.customFree)) return NULL;\n\n    {   ZSTD_DDict* const ddict = (ZSTD_DDict*) ZSTD_customMalloc(sizeof(ZSTD_DDict), customMem);\n        if (ddict == NULL) return NULL;\n        ddict->cMem = customMem;\n        {   size_t const initResult = ZSTD_initDDict_internal(ddict,\n                                            dict, dictSize,\n                                            dictLoadMethod, dictContentType);\n            if (ZSTD_isError(initResult)) {\n                ZSTD_freeDDict(ddict);\n                return NULL;\n        }   }\n        return ddict;\n    }\n}\n\n/*! ZSTD_createDDict() :\n*   Create a digested dictionary, to start decompression without startup delay.\n*   `dict` content is copied inside DDict.\n*   Consequently, `dict` can be released after `ZSTD_DDict` creation */\nZSTD_DDict* ZSTD_createDDict(const void* dict, size_t dictSize)\n{\n    ZSTD_customMem const allocator = { NULL, NULL, NULL };\n    return ZSTD_createDDict_advanced(dict, dictSize, ZSTD_dlm_byCopy, ZSTD_dct_auto, allocator);\n}\n\n/*! ZSTD_createDDict_byReference() :\n *  Create a digested dictionary, to start decompression without startup delay.\n *  Dictionary content is simply referenced, it will be accessed during decompression.\n *  Warning : dictBuffer must outlive DDict (DDict must be freed before dictBuffer) */\nZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize)\n{\n    ZSTD_customMem const allocator = { NULL, NULL, NULL };\n    return ZSTD_createDDict_advanced(dictBuffer, dictSize, ZSTD_dlm_byRef, ZSTD_dct_auto, allocator);\n}\n\n\nconst ZSTD_DDict* ZSTD_initStaticDDict(\n                                void* sBuffer, size_t sBufferSize,\n                                const void* dict, size_t dictSize,\n                                ZSTD_dictLoadMethod_e dictLoadMethod,\n                                ZSTD_dictContentType_e dictContentType)\n{\n    size_t const neededSpace = sizeof(ZSTD_DDict)\n                             + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize);\n    ZSTD_DDict* const ddict = (ZSTD_DDict*)sBuffer;\n    assert(sBuffer != NULL);\n    assert(dict != NULL);\n    if ((size_t)sBuffer & 7) return NULL;   /* 8-aligned */\n    if (sBufferSize < neededSpace) return NULL;\n    if (dictLoadMethod == ZSTD_dlm_byCopy) {\n        ZSTD_memcpy(ddict+1, dict, dictSize);  /* local copy */\n        dict = ddict+1;\n    }\n    if (ZSTD_isError( ZSTD_initDDict_internal(ddict,\n                                              dict, dictSize,\n                                              ZSTD_dlm_byRef, dictContentType) ))\n        return NULL;\n    return ddict;\n}\n\n\nsize_t ZSTD_freeDDict(ZSTD_DDict* ddict)\n{\n    if (ddict==NULL) return 0;   /* support free on NULL */\n    {   ZSTD_customMem const cMem = ddict->cMem;\n        ZSTD_customFree(ddict->dictBuffer, cMem);\n        ZSTD_customFree(ddict, cMem);\n        return 0;\n    }\n}\n\n/*! ZSTD_estimateDDictSize() :\n *  Estimate amount of memory that will be needed to create a dictionary for decompression.\n *  Note : dictionary created by reference using ZSTD_dlm_byRef are smaller */\nsize_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod)\n{\n    return sizeof(ZSTD_DDict) + (dictLoadMethod == ZSTD_dlm_byRef ? 0 : dictSize);\n}\n\nsize_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict)\n{\n    if (ddict==NULL) return 0;   /* support sizeof on NULL */\n    return sizeof(*ddict) + (ddict->dictBuffer ? ddict->dictSize : 0) ;\n}\n\n/*! ZSTD_getDictID_fromDDict() :\n *  Provides the dictID of the dictionary loaded into `ddict`.\n *  If @return == 0, the dictionary is not conformant to Zstandard specification, or empty.\n *  Non-conformant dictionaries can still be loaded, but as content-only dictionaries. */\nunsigned ZSTD_getDictID_fromDDict(const ZSTD_DDict* ddict)\n{\n    if (ddict==NULL) return 0;\n    return ddict->dictID;\n}\n"
  },
  {
    "path": "src/bled/zstd_ddict.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n\n#ifndef ZSTD_DDICT_H\n#define ZSTD_DDICT_H\n\n/*-*******************************************************\n *  Dependencies\n *********************************************************/\n#include \"zstd_deps.h\"   /* size_t */\n#include \"zstd.h\"        /* ZSTD_DDict, and several public functions */\n\n\n/*-*******************************************************\n *  Interface\n *********************************************************/\n\n/* note: several prototypes are already published in `zstd.h` :\n * ZSTD_createDDict()\n * ZSTD_createDDict_byReference()\n * ZSTD_createDDict_advanced()\n * ZSTD_freeDDict()\n * ZSTD_initStaticDDict()\n * ZSTD_sizeof_DDict()\n * ZSTD_estimateDDictSize()\n * ZSTD_getDictID_fromDict()\n */\n\nconst void* ZSTD_DDict_dictContent(const ZSTD_DDict* ddict);\nsize_t ZSTD_DDict_dictSize(const ZSTD_DDict* ddict);\n\nvoid ZSTD_copyDDictParameters(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict);\n\n\n\n#endif /* ZSTD_DDICT_H */\n"
  },
  {
    "path": "src/bled/zstd_decompress.c",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n\n/* ***************************************************************\n*  Tuning parameters\n*****************************************************************/\n/*!\n * HEAPMODE :\n * Select how default decompression function ZSTD_decompress() allocates its context,\n * on stack (0), or into heap (1, default; requires malloc()).\n * Note that functions with explicit context such as ZSTD_decompressDCtx() are unaffected.\n */\n#ifndef ZSTD_HEAPMODE\n#  define ZSTD_HEAPMODE 1\n#endif\n\n/*!\n*  LEGACY_SUPPORT :\n*  if set to 1+, ZSTD_decompress() can decode older formats (v0.1+)\n*/\n#ifndef ZSTD_LEGACY_SUPPORT\n#  define ZSTD_LEGACY_SUPPORT 0\n#endif\n\n/*!\n *  MAXWINDOWSIZE_DEFAULT :\n *  maximum window size accepted by DStream __by default__.\n *  Frames requiring more memory will be rejected.\n *  It's possible to set a different limit using ZSTD_DCtx_setMaxWindowSize().\n */\n#ifndef ZSTD_MAXWINDOWSIZE_DEFAULT\n#  define ZSTD_MAXWINDOWSIZE_DEFAULT (((U32)1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + 1)\n#endif\n\n/*!\n *  NO_FORWARD_PROGRESS_MAX :\n *  maximum allowed nb of calls to ZSTD_decompressStream()\n *  without any forward progress\n *  (defined as: no byte read from input, and no byte flushed to output)\n *  before triggering an error.\n */\n#ifndef ZSTD_NO_FORWARD_PROGRESS_MAX\n#  define ZSTD_NO_FORWARD_PROGRESS_MAX 16\n#endif\n\n\n/*-*******************************************************\n*  Dependencies\n*********************************************************/\n#include \"zstd_deps.h\"   /* ZSTD_memcpy, ZSTD_memmove, ZSTD_memset */\n#include \"zstd_error_private.h\"\n#include \"zstd_internal.h\"  /* blockProperties_t */\n#include \"zstd_mem.h\"         /* low level memory routines */\n#include \"zstd_bits.h\"  /* ZSTD_highbit32 */\n#define FSE_STATIC_LINKING_ONLY\n#include \"fse.h\"\n#include \"huf.h\"\n#include \"xxhash.h\" /* XXH64_reset, XXH64_update, XXH64_digest, XXH64 */\n#include \"zstd_decompress_internal.h\"   /* ZSTD_DCtx */\n#include \"zstd_ddict.h\"  /* ZSTD_DDictDictContent */\n#include \"zstd_decompress_block.h\"   /* ZSTD_decompressBlock_internal */\n\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)\n#  include \"../legacy/zstd_legacy.h\"\n#endif\n\n/*************************************\n * Multiple DDicts Hashset internals *\n *************************************/\n\n#define DDICT_HASHSET_MAX_LOAD_FACTOR_COUNT_MULT 4\n#define DDICT_HASHSET_MAX_LOAD_FACTOR_SIZE_MULT 3  /* These two constants represent SIZE_MULT/COUNT_MULT load factor without using a float.\n                                                    * Currently, that means a 0.75 load factor.\n                                                    * So, if count * COUNT_MULT / size * SIZE_MULT != 0, then we've exceeded\n                                                    * the load factor of the ddict hash set.\n                                                    */\n\n#define DDICT_HASHSET_TABLE_BASE_SIZE 64\n#define DDICT_HASHSET_RESIZE_FACTOR 2\n\n/* Hash function to determine starting position of dict insertion within the table\n * Returns an index between [0, hashSet->ddictPtrTableSize]\n */\nstatic size_t ZSTD_DDictHashSet_getIndex(const ZSTD_DDictHashSet* hashSet, U32 dictID) {\n    const U64 hash = XXH64(&dictID, sizeof(U32), 0);\n    /* DDict ptr table size is a multiple of 2, use size - 1 as mask to get index within [0, hashSet->ddictPtrTableSize) */\n    return hash & (hashSet->ddictPtrTableSize - 1);\n}\n\n/* Adds DDict to a hashset without resizing it.\n * If inserting a DDict with a dictID that already exists in the set, replaces the one in the set.\n * Returns 0 if successful, or a zstd error code if something went wrong.\n */\nstatic size_t ZSTD_DDictHashSet_emplaceDDict(ZSTD_DDictHashSet* hashSet, const ZSTD_DDict* ddict) {\n    const U32 dictID = ZSTD_getDictID_fromDDict(ddict);\n    size_t idx = ZSTD_DDictHashSet_getIndex(hashSet, dictID);\n    const size_t idxRangeMask = hashSet->ddictPtrTableSize - 1;\n    RETURN_ERROR_IF(hashSet->ddictPtrCount == hashSet->ddictPtrTableSize, GENERIC, \"Hash set is full!\");\n    DEBUGLOG(4, \"Hashed index: for dictID: %u is %zu\", dictID, idx);\n    while (hashSet->ddictPtrTable[idx] != NULL) {\n        /* Replace existing ddict if inserting ddict with same dictID */\n        if (ZSTD_getDictID_fromDDict(hashSet->ddictPtrTable[idx]) == dictID) {\n            DEBUGLOG(4, \"DictID already exists, replacing rather than adding\");\n            hashSet->ddictPtrTable[idx] = ddict;\n            return 0;\n        }\n        idx &= idxRangeMask;\n        idx++;\n    }\n    DEBUGLOG(4, \"Final idx after probing for dictID %u is: %zu\", dictID, idx);\n    hashSet->ddictPtrTable[idx] = ddict;\n    hashSet->ddictPtrCount++;\n    return 0;\n}\n\n/* Expands hash table by factor of DDICT_HASHSET_RESIZE_FACTOR and\n * rehashes all values, allocates new table, frees old table.\n * Returns 0 on success, otherwise a zstd error code.\n */\nstatic size_t ZSTD_DDictHashSet_expand(ZSTD_DDictHashSet* hashSet, ZSTD_customMem customMem) {\n    size_t newTableSize = hashSet->ddictPtrTableSize * DDICT_HASHSET_RESIZE_FACTOR;\n    const ZSTD_DDict** newTable = (const ZSTD_DDict**)ZSTD_customCalloc(sizeof(ZSTD_DDict*) * newTableSize, customMem);\n    const ZSTD_DDict** oldTable = hashSet->ddictPtrTable;\n    size_t oldTableSize = hashSet->ddictPtrTableSize;\n    size_t i;\n\n    DEBUGLOG(4, \"Expanding DDict hash table! Old size: %zu new size: %zu\", oldTableSize, newTableSize);\n    RETURN_ERROR_IF(!newTable, memory_allocation, \"Expanded hashset allocation failed!\");\n    hashSet->ddictPtrTable = newTable;\n    hashSet->ddictPtrTableSize = newTableSize;\n    hashSet->ddictPtrCount = 0;\n    for (i = 0; i < oldTableSize; ++i) {\n        if (oldTable[i] != NULL) {\n            FORWARD_IF_ERROR(ZSTD_DDictHashSet_emplaceDDict(hashSet, oldTable[i]), \"\");\n        }\n    }\n    ZSTD_customFree((void*)oldTable, customMem);\n    DEBUGLOG(4, \"Finished re-hash\");\n    return 0;\n}\n\n/* Fetches a DDict with the given dictID\n * Returns the ZSTD_DDict* with the requested dictID. If it doesn't exist, then returns NULL.\n */\nstatic const ZSTD_DDict* ZSTD_DDictHashSet_getDDict(ZSTD_DDictHashSet* hashSet, U32 dictID) {\n    size_t idx = ZSTD_DDictHashSet_getIndex(hashSet, dictID);\n    const size_t idxRangeMask = hashSet->ddictPtrTableSize - 1;\n    DEBUGLOG(4, \"Hashed index: for dictID: %u is %zu\", dictID, idx);\n    for (;;) {\n        size_t currDictID = ZSTD_getDictID_fromDDict(hashSet->ddictPtrTable[idx]);\n        if (currDictID == dictID || currDictID == 0) {\n            /* currDictID == 0 implies a NULL ddict entry */\n            break;\n        } else {\n            idx &= idxRangeMask;    /* Goes to start of table when we reach the end */\n            idx++;\n        }\n    }\n    DEBUGLOG(4, \"Final idx after probing for dictID %u is: %zu\", dictID, idx);\n    return hashSet->ddictPtrTable[idx];\n}\n\n/* Allocates space for and returns a ddict hash set\n * The hash set's ZSTD_DDict* table has all values automatically set to NULL to begin with.\n * Returns NULL if allocation failed.\n */\nstatic ZSTD_DDictHashSet* ZSTD_createDDictHashSet(ZSTD_customMem customMem) {\n    ZSTD_DDictHashSet* ret = (ZSTD_DDictHashSet*)ZSTD_customMalloc(sizeof(ZSTD_DDictHashSet), customMem);\n    DEBUGLOG(4, \"Allocating new hash set\");\n    if (!ret)\n        return NULL;\n    ret->ddictPtrTable = (const ZSTD_DDict**)ZSTD_customCalloc(DDICT_HASHSET_TABLE_BASE_SIZE * sizeof(ZSTD_DDict*), customMem);\n    if (!ret->ddictPtrTable) {\n        ZSTD_customFree(ret, customMem);\n        return NULL;\n    }\n    ret->ddictPtrTableSize = DDICT_HASHSET_TABLE_BASE_SIZE;\n    ret->ddictPtrCount = 0;\n    return ret;\n}\n\n/* Frees the table of ZSTD_DDict* within a hashset, then frees the hashset itself.\n * Note: The ZSTD_DDict* within the table are NOT freed.\n */\nstatic void ZSTD_freeDDictHashSet(ZSTD_DDictHashSet* hashSet, ZSTD_customMem customMem) {\n    DEBUGLOG(4, \"Freeing ddict hash set\");\n    if (hashSet && hashSet->ddictPtrTable) {\n        ZSTD_customFree((void*)hashSet->ddictPtrTable, customMem);\n    }\n    if (hashSet) {\n        ZSTD_customFree(hashSet, customMem);\n    }\n}\n\n/* Public function: Adds a DDict into the ZSTD_DDictHashSet, possibly triggering a resize of the hash set.\n * Returns 0 on success, or a ZSTD error.\n */\nstatic size_t ZSTD_DDictHashSet_addDDict(ZSTD_DDictHashSet* hashSet, const ZSTD_DDict* ddict, ZSTD_customMem customMem) {\n    DEBUGLOG(4, \"Adding dict ID: %u to hashset with - Count: %zu Tablesize: %zu\", ZSTD_getDictID_fromDDict(ddict), hashSet->ddictPtrCount, hashSet->ddictPtrTableSize);\n    if (hashSet->ddictPtrCount * DDICT_HASHSET_MAX_LOAD_FACTOR_COUNT_MULT / hashSet->ddictPtrTableSize * DDICT_HASHSET_MAX_LOAD_FACTOR_SIZE_MULT != 0) {\n        FORWARD_IF_ERROR(ZSTD_DDictHashSet_expand(hashSet, customMem), \"\");\n    }\n    FORWARD_IF_ERROR(ZSTD_DDictHashSet_emplaceDDict(hashSet, ddict), \"\");\n    return 0;\n}\n\n/*-*************************************************************\n*   Context management\n***************************************************************/\nsize_t ZSTD_sizeof_DCtx (const ZSTD_DCtx* dctx)\n{\n    if (dctx==NULL) return 0;   /* support sizeof NULL */\n    return sizeof(*dctx)\n           + ZSTD_sizeof_DDict(dctx->ddictLocal)\n           + dctx->inBuffSize + dctx->outBuffSize;\n}\n\nsize_t ZSTD_estimateDCtxSize(void) { return sizeof(ZSTD_DCtx); }\n\n\nstatic size_t ZSTD_startingInputLength(ZSTD_format_e format)\n{\n    size_t const startingInputLength = ZSTD_FRAMEHEADERSIZE_PREFIX(format);\n    /* only supports formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless */\n    assert( (format == ZSTD_f_zstd1) || (format == ZSTD_f_zstd1_magicless) );\n    return startingInputLength;\n}\n\nstatic void ZSTD_DCtx_resetParameters(ZSTD_DCtx* dctx)\n{\n    assert(dctx->streamStage == zdss_init);\n    dctx->format = ZSTD_f_zstd1;\n    dctx->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT;\n    dctx->outBufferMode = ZSTD_bm_buffered;\n    dctx->forceIgnoreChecksum = ZSTD_d_validateChecksum;\n    dctx->refMultipleDDicts = ZSTD_rmd_refSingleDDict;\n    dctx->disableHufAsm = 0;\n    dctx->maxBlockSizeParam = 0;\n}\n\nstatic void ZSTD_initDCtx_internal(ZSTD_DCtx* dctx)\n{\n    dctx->staticSize  = 0;\n    dctx->ddict       = NULL;\n    dctx->ddictLocal  = NULL;\n    dctx->dictEnd     = NULL;\n    dctx->ddictIsCold = 0;\n    dctx->dictUses = ZSTD_dont_use;\n    dctx->inBuff      = NULL;\n    dctx->inBuffSize  = 0;\n    dctx->outBuffSize = 0;\n    dctx->streamStage = zdss_init;\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)\n    dctx->legacyContext = NULL;\n    dctx->previousLegacyVersion = 0;\n#endif\n    dctx->noForwardProgress = 0;\n    dctx->oversizedDuration = 0;\n    dctx->isFrameDecompression = 1;\n#if DYNAMIC_BMI2\n    dctx->bmi2 = ZSTD_cpuSupportsBmi2();\n#endif\n    dctx->ddictSet = NULL;\n    ZSTD_DCtx_resetParameters(dctx);\n#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n    dctx->dictContentEndForFuzzing = NULL;\n#endif\n}\n\nZSTD_DCtx* ZSTD_initStaticDCtx(void *workspace, size_t workspaceSize)\n{\n    ZSTD_DCtx* const dctx = (ZSTD_DCtx*) workspace;\n\n    if ((size_t)workspace & 7) return NULL;  /* 8-aligned */\n    if (workspaceSize < sizeof(ZSTD_DCtx)) return NULL;  /* minimum size */\n\n    ZSTD_initDCtx_internal(dctx);\n    dctx->staticSize = workspaceSize;\n    dctx->inBuff = (char*)(dctx+1);\n    return dctx;\n}\n\nstatic ZSTD_DCtx* ZSTD_createDCtx_internal(ZSTD_customMem customMem) {\n    if ((!customMem.customAlloc) ^ (!customMem.customFree)) return NULL;\n\n    {   ZSTD_DCtx* const dctx = (ZSTD_DCtx*)ZSTD_customMalloc(sizeof(*dctx), customMem);\n        if (!dctx) return NULL;\n        dctx->customMem = customMem;\n        ZSTD_initDCtx_internal(dctx);\n        return dctx;\n    }\n}\n\nZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem)\n{\n    return ZSTD_createDCtx_internal(customMem);\n}\n\nZSTD_DCtx* ZSTD_createDCtx(void)\n{\n    DEBUGLOG(3, \"ZSTD_createDCtx\");\n    return ZSTD_createDCtx_internal(ZSTD_defaultCMem);\n}\n\nstatic void ZSTD_clearDict(ZSTD_DCtx* dctx)\n{\n    ZSTD_freeDDict(dctx->ddictLocal);\n    dctx->ddictLocal = NULL;\n    dctx->ddict = NULL;\n    dctx->dictUses = ZSTD_dont_use;\n}\n\nsize_t ZSTD_freeDCtx(ZSTD_DCtx* dctx)\n{\n    if (dctx==NULL) return 0;   /* support free on NULL */\n    RETURN_ERROR_IF(dctx->staticSize, memory_allocation, \"not compatible with static DCtx\");\n    {   ZSTD_customMem const cMem = dctx->customMem;\n        ZSTD_clearDict(dctx);\n        ZSTD_customFree(dctx->inBuff, cMem);\n        dctx->inBuff = NULL;\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)\n        if (dctx->legacyContext)\n            ZSTD_freeLegacyStreamContext(dctx->legacyContext, dctx->previousLegacyVersion);\n#endif\n        if (dctx->ddictSet) {\n            ZSTD_freeDDictHashSet(dctx->ddictSet, cMem);\n            dctx->ddictSet = NULL;\n        }\n        ZSTD_customFree(dctx, cMem);\n        return 0;\n    }\n}\n\n/* no longer useful */\nvoid ZSTD_copyDCtx(ZSTD_DCtx* dstDCtx, const ZSTD_DCtx* srcDCtx)\n{\n    size_t const toCopy = (size_t)((char*)(&dstDCtx->inBuff) - (char*)dstDCtx);\n    ZSTD_memcpy(dstDCtx, srcDCtx, toCopy);  /* no need to copy workspace */\n}\n\n/* Given a dctx with a digested frame params, re-selects the correct ZSTD_DDict based on\n * the requested dict ID from the frame. If there exists a reference to the correct ZSTD_DDict, then\n * accordingly sets the ddict to be used to decompress the frame.\n *\n * If no DDict is found, then no action is taken, and the ZSTD_DCtx::ddict remains as-is.\n *\n * ZSTD_d_refMultipleDDicts must be enabled for this function to be called.\n */\nstatic void ZSTD_DCtx_selectFrameDDict(ZSTD_DCtx* dctx) {\n    assert(dctx->refMultipleDDicts && dctx->ddictSet);\n    DEBUGLOG(4, \"Adjusting DDict based on requested dict ID from frame\");\n    if (dctx->ddict) {\n        const ZSTD_DDict* frameDDict = ZSTD_DDictHashSet_getDDict(dctx->ddictSet, dctx->fParams.dictID);\n        if (frameDDict) {\n            DEBUGLOG(4, \"DDict found!\");\n            ZSTD_clearDict(dctx);\n            dctx->dictID = dctx->fParams.dictID;\n            dctx->ddict = frameDDict;\n            dctx->dictUses = ZSTD_use_indefinitely;\n        }\n    }\n}\n\n\n/*-*************************************************************\n *   Frame header decoding\n ***************************************************************/\n\n/*! ZSTD_isFrame() :\n *  Tells if the content of `buffer` starts with a valid Frame Identifier.\n *  Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0.\n *  Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled.\n *  Note 3 : Skippable Frame Identifiers are considered valid. */\nunsigned ZSTD_isFrame(const void* buffer, size_t size)\n{\n    if (size < ZSTD_FRAMEIDSIZE) return 0;\n    {   U32 const magic = MEM_readLE32(buffer);\n        if (magic == ZSTD_MAGICNUMBER) return 1;\n        if ((magic & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) return 1;\n    }\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)\n    if (ZSTD_isLegacy(buffer, size)) return 1;\n#endif\n    return 0;\n}\n\n/*! ZSTD_isSkippableFrame() :\n *  Tells if the content of `buffer` starts with a valid Frame Identifier for a skippable frame.\n *  Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0.\n */\nunsigned ZSTD_isSkippableFrame(const void* buffer, size_t size)\n{\n    if (size < ZSTD_FRAMEIDSIZE) return 0;\n    {   U32 const magic = MEM_readLE32(buffer);\n        if ((magic & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) return 1;\n    }\n    return 0;\n}\n\n/** ZSTD_frameHeaderSize_internal() :\n *  srcSize must be large enough to reach header size fields.\n *  note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless.\n * @return : size of the Frame Header\n *           or an error code, which can be tested with ZSTD_isError() */\nstatic size_t ZSTD_frameHeaderSize_internal(const void* src, size_t srcSize, ZSTD_format_e format)\n{\n    size_t const minInputSize = ZSTD_startingInputLength(format);\n    RETURN_ERROR_IF(srcSize < minInputSize, srcSize_wrong, \"\");\n\n    {   BYTE const fhd = ((const BYTE*)src)[minInputSize-1];\n        U32 const dictID= fhd & 3;\n        U32 const singleSegment = (fhd >> 5) & 1;\n        U32 const fcsId = fhd >> 6;\n        return minInputSize + !singleSegment\n             + ZSTD_did_fieldSize[dictID] + ZSTD_fcs_fieldSize[fcsId]\n             + (singleSegment && !fcsId);\n    }\n}\n\n/** ZSTD_frameHeaderSize() :\n *  srcSize must be >= ZSTD_frameHeaderSize_prefix.\n * @return : size of the Frame Header,\n *           or an error code (if srcSize is too small) */\nsize_t ZSTD_frameHeaderSize(const void* src, size_t srcSize)\n{\n    return ZSTD_frameHeaderSize_internal(src, srcSize, ZSTD_f_zstd1);\n}\n\n\n/** ZSTD_getFrameHeader_advanced() :\n *  decode Frame Header, or require larger `srcSize`.\n *  note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless\n * @return : 0, `zfhPtr` is correctly filled,\n *          >0, `srcSize` is too small, value is wanted `srcSize` amount,\n**           or an error code, which can be tested using ZSTD_isError() */\nsize_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format)\n{\n    const BYTE* ip = (const BYTE*)src;\n    size_t const minInputSize = ZSTD_startingInputLength(format);\n\n    DEBUGLOG(5, \"ZSTD_getFrameHeader_advanced: minInputSize = %zu, srcSize = %zu\", minInputSize, srcSize);\n\n    if (srcSize > 0) {\n        /* note : technically could be considered an assert(), since it's an invalid entry */\n        RETURN_ERROR_IF(src==NULL, GENERIC, \"invalid parameter : src==NULL, but srcSize>0\");\n    }\n    if (srcSize < minInputSize) {\n        if (srcSize > 0 && format != ZSTD_f_zstd1_magicless) {\n            /* when receiving less than @minInputSize bytes,\n             * control these bytes at least correspond to a supported magic number\n             * in order to error out early if they don't.\n            **/\n            size_t const toCopy = MIN(4, srcSize);\n            unsigned char hbuf[4]; MEM_writeLE32(hbuf, ZSTD_MAGICNUMBER);\n            assert(src != NULL);\n            ZSTD_memcpy(hbuf, src, toCopy);\n            if ( MEM_readLE32(hbuf) != ZSTD_MAGICNUMBER ) {\n                /* not a zstd frame : let's check if it's a skippable frame */\n                MEM_writeLE32(hbuf, ZSTD_MAGIC_SKIPPABLE_START);\n                ZSTD_memcpy(hbuf, src, toCopy);\n                if ((MEM_readLE32(hbuf) & ZSTD_MAGIC_SKIPPABLE_MASK) != ZSTD_MAGIC_SKIPPABLE_START) {\n                    RETURN_ERROR(prefix_unknown,\n                                \"first bytes don't correspond to any supported magic number\");\n        }   }   }\n        return minInputSize;\n    }\n\n    ZSTD_memset(zfhPtr, 0, sizeof(*zfhPtr));   /* not strictly necessary, but static analyzers may not understand that zfhPtr will be read only if return value is zero, since they are 2 different signals */\n    if ( (format != ZSTD_f_zstd1_magicless)\n      && (MEM_readLE32(src) != ZSTD_MAGICNUMBER) ) {\n        if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {\n            /* skippable frame */\n            if (srcSize < ZSTD_SKIPPABLEHEADERSIZE)\n                return ZSTD_SKIPPABLEHEADERSIZE; /* magic number + frame length */\n            ZSTD_memset(zfhPtr, 0, sizeof(*zfhPtr));\n            zfhPtr->frameContentSize = MEM_readLE32((const char *)src + ZSTD_FRAMEIDSIZE);\n            zfhPtr->frameType = ZSTD_skippableFrame;\n            return 0;\n        }\n        RETURN_ERROR(prefix_unknown, \"\");\n    }\n\n    /* ensure there is enough `srcSize` to fully read/decode frame header */\n    {   size_t const fhsize = ZSTD_frameHeaderSize_internal(src, srcSize, format);\n        if (srcSize < fhsize) return fhsize;\n        zfhPtr->headerSize = (U32)fhsize;\n    }\n\n    {   BYTE const fhdByte = ip[minInputSize-1];\n        size_t pos = minInputSize;\n        U32 const dictIDSizeCode = fhdByte&3;\n        U32 const checksumFlag = (fhdByte>>2)&1;\n        U32 const singleSegment = (fhdByte>>5)&1;\n        U32 const fcsID = fhdByte>>6;\n        U64 windowSize = 0;\n        U32 dictID = 0;\n        U64 frameContentSize = ZSTD_CONTENTSIZE_UNKNOWN;\n        RETURN_ERROR_IF((fhdByte & 0x08) != 0, frameParameter_unsupported,\n                        \"reserved bits, must be zero\");\n\n        if (!singleSegment) {\n            BYTE const wlByte = ip[pos++];\n            U32 const windowLog = (wlByte >> 3) + ZSTD_WINDOWLOG_ABSOLUTEMIN;\n            RETURN_ERROR_IF(windowLog > ZSTD_WINDOWLOG_MAX, frameParameter_windowTooLarge, \"\");\n            windowSize = (1ULL << windowLog);\n            windowSize += (windowSize >> 3) * (wlByte&7);\n        }\n        switch(dictIDSizeCode)\n        {\n            default:\n                assert(0);  /* impossible */\n                ZSTD_FALLTHROUGH;\n            case 0 : break;\n            case 1 : dictID = ip[pos]; pos++; break;\n            case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;\n            case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;\n        }\n        switch(fcsID)\n        {\n            default:\n                assert(0);  /* impossible */\n                ZSTD_FALLTHROUGH;\n            case 0 : if (singleSegment) frameContentSize = ip[pos]; break;\n            case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;\n            case 2 : frameContentSize = MEM_readLE32(ip+pos); break;\n            case 3 : frameContentSize = MEM_readLE64(ip+pos); break;\n        }\n        if (singleSegment) windowSize = frameContentSize;\n\n        zfhPtr->frameType = ZSTD_frame;\n        zfhPtr->frameContentSize = frameContentSize;\n        zfhPtr->windowSize = windowSize;\n        zfhPtr->blockSizeMax = (unsigned) MIN(windowSize, ZSTD_BLOCKSIZE_MAX);\n        zfhPtr->dictID = dictID;\n        zfhPtr->checksumFlag = checksumFlag;\n    }\n    return 0;\n}\n\n/** ZSTD_getFrameHeader() :\n *  decode Frame Header, or require larger `srcSize`.\n *  note : this function does not consume input, it only reads it.\n * @return : 0, `zfhPtr` is correctly filled,\n *          >0, `srcSize` is too small, value is wanted `srcSize` amount,\n *           or an error code, which can be tested using ZSTD_isError() */\nsize_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize)\n{\n    return ZSTD_getFrameHeader_advanced(zfhPtr, src, srcSize, ZSTD_f_zstd1);\n}\n\n/** ZSTD_getFrameContentSize() :\n *  compatible with legacy mode\n * @return : decompressed size of the single frame pointed to be `src` if known, otherwise\n *         - ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined\n *         - ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small) */\nunsigned long long ZSTD_getFrameContentSize(const void *src, size_t srcSize)\n{\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)\n    if (ZSTD_isLegacy(src, srcSize)) {\n        unsigned long long const ret = ZSTD_getDecompressedSize_legacy(src, srcSize);\n        return ret == 0 ? ZSTD_CONTENTSIZE_UNKNOWN : ret;\n    }\n#endif\n    {   ZSTD_frameHeader zfh;\n        if (ZSTD_getFrameHeader(&zfh, src, srcSize) != 0)\n            return ZSTD_CONTENTSIZE_ERROR;\n        if (zfh.frameType == ZSTD_skippableFrame) {\n            return 0;\n        } else {\n            return zfh.frameContentSize;\n    }   }\n}\n\nstatic size_t readSkippableFrameSize(void const* src, size_t srcSize)\n{\n    size_t const skippableHeaderSize = ZSTD_SKIPPABLEHEADERSIZE;\n    U32 sizeU32;\n\n    RETURN_ERROR_IF(srcSize < ZSTD_SKIPPABLEHEADERSIZE, srcSize_wrong, \"\");\n\n    sizeU32 = MEM_readLE32((BYTE const*)src + ZSTD_FRAMEIDSIZE);\n    RETURN_ERROR_IF((U32)(sizeU32 + ZSTD_SKIPPABLEHEADERSIZE) < sizeU32,\n                    frameParameter_unsupported, \"\");\n    {   size_t const skippableSize = skippableHeaderSize + sizeU32;\n        RETURN_ERROR_IF(skippableSize > srcSize, srcSize_wrong, \"\");\n        return skippableSize;\n    }\n}\n\n/*! ZSTD_readSkippableFrame() :\n * Retrieves content of a skippable frame, and writes it to dst buffer.\n *\n * The parameter magicVariant will receive the magicVariant that was supplied when the frame was written,\n * i.e. magicNumber - ZSTD_MAGIC_SKIPPABLE_START.  This can be NULL if the caller is not interested\n * in the magicVariant.\n *\n * Returns an error if destination buffer is not large enough, or if this is not a valid skippable frame.\n *\n * @return : number of bytes written or a ZSTD error.\n */\nsize_t ZSTD_readSkippableFrame(void* dst, size_t dstCapacity,\n                               unsigned* magicVariant,  /* optional, can be NULL */\n                         const void* src, size_t srcSize)\n{\n    RETURN_ERROR_IF(srcSize < ZSTD_SKIPPABLEHEADERSIZE, srcSize_wrong, \"\");\n\n    {   U32 const magicNumber = MEM_readLE32(src);\n        size_t skippableFrameSize = readSkippableFrameSize(src, srcSize);\n        size_t skippableContentSize = skippableFrameSize - ZSTD_SKIPPABLEHEADERSIZE;\n\n        /* check input validity */\n        RETURN_ERROR_IF(!ZSTD_isSkippableFrame(src, srcSize), frameParameter_unsupported, \"\");\n        RETURN_ERROR_IF(skippableFrameSize < ZSTD_SKIPPABLEHEADERSIZE || skippableFrameSize > srcSize, srcSize_wrong, \"\");\n        RETURN_ERROR_IF(skippableContentSize > dstCapacity, dstSize_tooSmall, \"\");\n\n        /* deliver payload */\n        if (skippableContentSize > 0  && dst != NULL)\n            ZSTD_memcpy(dst, (const BYTE *)src + ZSTD_SKIPPABLEHEADERSIZE, skippableContentSize);\n        if (magicVariant != NULL)\n            *magicVariant = magicNumber - ZSTD_MAGIC_SKIPPABLE_START;\n        return skippableContentSize;\n    }\n}\n\n/** ZSTD_findDecompressedSize() :\n *  `srcSize` must be the exact length of some number of ZSTD compressed and/or\n *      skippable frames\n *  note: compatible with legacy mode\n * @return : decompressed size of the frames contained */\nunsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize)\n{\n    unsigned long long totalDstSize = 0;\n\n    while (srcSize >= ZSTD_startingInputLength(ZSTD_f_zstd1)) {\n        U32 const magicNumber = MEM_readLE32(src);\n\n        if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {\n            size_t const skippableSize = readSkippableFrameSize(src, srcSize);\n            if (ZSTD_isError(skippableSize)) return ZSTD_CONTENTSIZE_ERROR;\n            assert(skippableSize <= srcSize);\n\n            src = (const BYTE *)src + skippableSize;\n            srcSize -= skippableSize;\n            continue;\n        }\n\n        {   unsigned long long const fcs = ZSTD_getFrameContentSize(src, srcSize);\n            if (fcs >= ZSTD_CONTENTSIZE_ERROR) return fcs;\n\n            if (totalDstSize + fcs < totalDstSize)\n                return ZSTD_CONTENTSIZE_ERROR; /* check for overflow */\n            totalDstSize += fcs;\n        }\n        /* skip to next frame */\n        {   size_t const frameSrcSize = ZSTD_findFrameCompressedSize(src, srcSize);\n            if (ZSTD_isError(frameSrcSize)) return ZSTD_CONTENTSIZE_ERROR;\n            assert(frameSrcSize <= srcSize);\n\n            src = (const BYTE *)src + frameSrcSize;\n            srcSize -= frameSrcSize;\n        }\n    }  /* while (srcSize >= ZSTD_frameHeaderSize_prefix) */\n\n    if (srcSize) return ZSTD_CONTENTSIZE_ERROR;\n\n    return totalDstSize;\n}\n\n/** ZSTD_getDecompressedSize() :\n *  compatible with legacy mode\n * @return : decompressed size if known, 0 otherwise\n             note : 0 can mean any of the following :\n                   - frame content is empty\n                   - decompressed size field is not present in frame header\n                   - frame header unknown / not supported\n                   - frame header not complete (`srcSize` too small) */\nunsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize)\n{\n    unsigned long long const ret = ZSTD_getFrameContentSize(src, srcSize);\n    ZSTD_STATIC_ASSERT(ZSTD_CONTENTSIZE_ERROR < ZSTD_CONTENTSIZE_UNKNOWN);\n    return (ret >= ZSTD_CONTENTSIZE_ERROR) ? 0 : ret;\n}\n\n\n/** ZSTD_decodeFrameHeader() :\n * `headerSize` must be the size provided by ZSTD_frameHeaderSize().\n * If multiple DDict references are enabled, also will choose the correct DDict to use.\n * @return : 0 if success, or an error code, which can be tested using ZSTD_isError() */\nstatic size_t ZSTD_decodeFrameHeader(ZSTD_DCtx* dctx, const void* src, size_t headerSize)\n{\n    size_t const result = ZSTD_getFrameHeader_advanced(&(dctx->fParams), src, headerSize, dctx->format);\n    if (ZSTD_isError(result)) return result;    /* invalid header */\n    RETURN_ERROR_IF(result>0, srcSize_wrong, \"headerSize too small\");\n\n    /* Reference DDict requested by frame if dctx references multiple ddicts */\n    if (dctx->refMultipleDDicts == ZSTD_rmd_refMultipleDDicts && dctx->ddictSet) {\n        ZSTD_DCtx_selectFrameDDict(dctx);\n    }\n\n#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n    /* Skip the dictID check in fuzzing mode, because it makes the search\n     * harder.\n     */\n    RETURN_ERROR_IF(dctx->fParams.dictID && (dctx->dictID != dctx->fParams.dictID),\n                    dictionary_wrong, \"\");\n#endif\n    dctx->validateChecksum = (dctx->fParams.checksumFlag && !dctx->forceIgnoreChecksum) ? 1 : 0;\n    if (dctx->validateChecksum) XXH64_reset(&dctx->xxhState, 0);\n    dctx->processedCSize += headerSize;\n    return 0;\n}\n\nstatic ZSTD_frameSizeInfo ZSTD_errorFrameSizeInfo(size_t ret)\n{\n    ZSTD_frameSizeInfo frameSizeInfo;\n    frameSizeInfo.nbBlocks = 0;\n    frameSizeInfo.compressedSize = ret;\n    frameSizeInfo.decompressedBound = ZSTD_CONTENTSIZE_ERROR;\n    return frameSizeInfo;\n}\n\nstatic ZSTD_frameSizeInfo ZSTD_findFrameSizeInfo(const void* src, size_t srcSize, ZSTD_format_e format)\n{\n    ZSTD_frameSizeInfo frameSizeInfo;\n    ZSTD_memset(&frameSizeInfo, 0, sizeof(ZSTD_frameSizeInfo));\n\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)\n    if (format == ZSTD_f_zstd1 && ZSTD_isLegacy(src, srcSize))\n        return ZSTD_findFrameSizeInfoLegacy(src, srcSize);\n#endif\n\n    if (format == ZSTD_f_zstd1 && (srcSize >= ZSTD_SKIPPABLEHEADERSIZE)\n        && (MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {\n        frameSizeInfo.compressedSize = readSkippableFrameSize(src, srcSize);\n        assert(ZSTD_isError(frameSizeInfo.compressedSize) ||\n               frameSizeInfo.compressedSize <= srcSize);\n        return frameSizeInfo;\n    } else {\n        const BYTE* ip = (const BYTE*)src;\n        const BYTE* const ipstart = ip;\n        size_t remainingSize = srcSize;\n        size_t nbBlocks = 0;\n        ZSTD_frameHeader zfh;\n\n        /* Extract Frame Header */\n        {   size_t const ret = ZSTD_getFrameHeader_advanced(&zfh, src, srcSize, format);\n            if (ZSTD_isError(ret))\n                return ZSTD_errorFrameSizeInfo(ret);\n            if (ret > 0)\n                return ZSTD_errorFrameSizeInfo(ERROR(srcSize_wrong));\n        }\n\n        ip += zfh.headerSize;\n        remainingSize -= zfh.headerSize;\n\n        /* Iterate over each block */\n        while (1) {\n            blockProperties_t blockProperties;\n            size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSize, &blockProperties);\n            if (ZSTD_isError(cBlockSize))\n                return ZSTD_errorFrameSizeInfo(cBlockSize);\n\n            if (ZSTD_blockHeaderSize + cBlockSize > remainingSize)\n                return ZSTD_errorFrameSizeInfo(ERROR(srcSize_wrong));\n\n            ip += ZSTD_blockHeaderSize + cBlockSize;\n            remainingSize -= ZSTD_blockHeaderSize + cBlockSize;\n            nbBlocks++;\n\n            if (blockProperties.lastBlock) break;\n        }\n\n        /* Final frame content checksum */\n        if (zfh.checksumFlag) {\n            if (remainingSize < 4)\n                return ZSTD_errorFrameSizeInfo(ERROR(srcSize_wrong));\n            ip += 4;\n        }\n\n        frameSizeInfo.nbBlocks = nbBlocks;\n        frameSizeInfo.compressedSize = (size_t)(ip - ipstart);\n        frameSizeInfo.decompressedBound = (zfh.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN)\n                                        ? zfh.frameContentSize\n                                        : (unsigned long long)nbBlocks * zfh.blockSizeMax;\n        return frameSizeInfo;\n    }\n}\n\nstatic size_t ZSTD_findFrameCompressedSize_advanced(const void *src, size_t srcSize, ZSTD_format_e format) {\n    ZSTD_frameSizeInfo const frameSizeInfo = ZSTD_findFrameSizeInfo(src, srcSize, format);\n    return frameSizeInfo.compressedSize;\n}\n\n/** ZSTD_findFrameCompressedSize() :\n * See docs in zstd.h\n * Note: compatible with legacy mode */\nsize_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize)\n{\n    return ZSTD_findFrameCompressedSize_advanced(src, srcSize, ZSTD_f_zstd1);\n}\n\n/** ZSTD_decompressBound() :\n *  compatible with legacy mode\n *  `src` must point to the start of a ZSTD frame or a skippable frame\n *  `srcSize` must be at least as large as the frame contained\n *  @return : the maximum decompressed size of the compressed source\n */\nunsigned long long ZSTD_decompressBound(const void* src, size_t srcSize)\n{\n    unsigned long long bound = 0;\n    /* Iterate over each frame */\n    while (srcSize > 0) {\n        ZSTD_frameSizeInfo const frameSizeInfo = ZSTD_findFrameSizeInfo(src, srcSize, ZSTD_f_zstd1);\n        size_t const compressedSize = frameSizeInfo.compressedSize;\n        unsigned long long const decompressedBound = frameSizeInfo.decompressedBound;\n        if (ZSTD_isError(compressedSize) || decompressedBound == ZSTD_CONTENTSIZE_ERROR)\n            return ZSTD_CONTENTSIZE_ERROR;\n        assert(srcSize >= compressedSize);\n        src = (const BYTE*)src + compressedSize;\n        srcSize -= compressedSize;\n        bound += decompressedBound;\n    }\n    return bound;\n}\n\nsize_t ZSTD_decompressionMargin(void const* src, size_t srcSize)\n{\n    size_t margin = 0;\n    unsigned maxBlockSize = 0;\n\n    /* Iterate over each frame */\n    while (srcSize > 0) {\n        ZSTD_frameSizeInfo const frameSizeInfo = ZSTD_findFrameSizeInfo(src, srcSize, ZSTD_f_zstd1);\n        size_t const compressedSize = frameSizeInfo.compressedSize;\n        unsigned long long const decompressedBound = frameSizeInfo.decompressedBound;\n        ZSTD_frameHeader zfh;\n\n        FORWARD_IF_ERROR(ZSTD_getFrameHeader(&zfh, src, srcSize), \"\");\n        if (ZSTD_isError(compressedSize) || decompressedBound == ZSTD_CONTENTSIZE_ERROR)\n            return ERROR(corruption_detected);\n\n        if (zfh.frameType == ZSTD_frame) {\n            /* Add the frame header to our margin */\n            margin += zfh.headerSize;\n            /* Add the checksum to our margin */\n            margin += zfh.checksumFlag ? 4 : 0;\n            /* Add 3 bytes per block */\n            margin += 3 * frameSizeInfo.nbBlocks;\n\n            /* Compute the max block size */\n            maxBlockSize = MAX(maxBlockSize, zfh.blockSizeMax);\n        } else {\n            assert(zfh.frameType == ZSTD_skippableFrame);\n            /* Add the entire skippable frame size to our margin. */\n            margin += compressedSize;\n        }\n\n        assert(srcSize >= compressedSize);\n        src = (const BYTE*)src + compressedSize;\n        srcSize -= compressedSize;\n    }\n\n    /* Add the max block size back to the margin. */\n    margin += maxBlockSize;\n\n    return margin;\n}\n\n/*-*************************************************************\n *   Frame decoding\n ***************************************************************/\n\n/** ZSTD_insertBlock() :\n *  insert `src` block into `dctx` history. Useful to track uncompressed blocks. */\nsize_t ZSTD_insertBlock(ZSTD_DCtx* dctx, const void* blockStart, size_t blockSize)\n{\n    DEBUGLOG(5, \"ZSTD_insertBlock: %u bytes\", (unsigned)blockSize);\n    ZSTD_checkContinuity(dctx, blockStart, blockSize);\n    dctx->previousDstEnd = (const char*)blockStart + blockSize;\n    return blockSize;\n}\n\n\nstatic size_t ZSTD_copyRawBlock(void* dst, size_t dstCapacity,\n                          const void* src, size_t srcSize)\n{\n    DEBUGLOG(5, \"ZSTD_copyRawBlock\");\n    RETURN_ERROR_IF(srcSize > dstCapacity, dstSize_tooSmall, \"\");\n    if (dst == NULL) {\n        if (srcSize == 0) return 0;\n        RETURN_ERROR(dstBuffer_null, \"\");\n    }\n    ZSTD_memmove(dst, src, srcSize);\n    return srcSize;\n}\n\nstatic size_t ZSTD_setRleBlock(void* dst, size_t dstCapacity,\n                               BYTE b,\n                               size_t regenSize)\n{\n    RETURN_ERROR_IF(regenSize > dstCapacity, dstSize_tooSmall, \"\");\n    if (dst == NULL) {\n        if (regenSize == 0) return 0;\n        RETURN_ERROR(dstBuffer_null, \"\");\n    }\n    ZSTD_memset(dst, b, regenSize);\n    return regenSize;\n}\n\nstatic void ZSTD_DCtx_trace_end(ZSTD_DCtx const* dctx, U64 uncompressedSize, U64 compressedSize, unsigned streaming)\n{\n#if ZSTD_TRACE\n    if (dctx->traceCtx && ZSTD_trace_decompress_end != NULL) {\n        ZSTD_Trace trace;\n        ZSTD_memset(&trace, 0, sizeof(trace));\n        trace.version = ZSTD_VERSION_NUMBER;\n        trace.streaming = streaming;\n        if (dctx->ddict) {\n            trace.dictionaryID = ZSTD_getDictID_fromDDict(dctx->ddict);\n            trace.dictionarySize = ZSTD_DDict_dictSize(dctx->ddict);\n            trace.dictionaryIsCold = dctx->ddictIsCold;\n        }\n        trace.uncompressedSize = (size_t)uncompressedSize;\n        trace.compressedSize = (size_t)compressedSize;\n        trace.dctx = dctx;\n        ZSTD_trace_decompress_end(dctx->traceCtx, &trace);\n    }\n#else\n    (void)dctx;\n    (void)uncompressedSize;\n    (void)compressedSize;\n    (void)streaming;\n#endif\n}\n\n\n/*! ZSTD_decompressFrame() :\n * @dctx must be properly initialized\n *  will update *srcPtr and *srcSizePtr,\n *  to make *srcPtr progress by one frame. */\nstatic size_t ZSTD_decompressFrame(ZSTD_DCtx* dctx,\n                                   void* dst, size_t dstCapacity,\n                             const void** srcPtr, size_t *srcSizePtr)\n{\n    const BYTE* const istart = (const BYTE*)(*srcPtr);\n    const BYTE* ip = istart;\n    BYTE* const ostart = (BYTE*)dst;\n    BYTE* const oend = dstCapacity != 0 ? ostart + dstCapacity : ostart;\n    BYTE* op = ostart;\n    size_t remainingSrcSize = *srcSizePtr;\n\n    DEBUGLOG(4, \"ZSTD_decompressFrame (srcSize:%i)\", (int)*srcSizePtr);\n\n    /* check */\n    RETURN_ERROR_IF(\n        remainingSrcSize < ZSTD_FRAMEHEADERSIZE_MIN(dctx->format)+ZSTD_blockHeaderSize,\n        srcSize_wrong, \"\");\n\n    /* Frame Header */\n    {   size_t const frameHeaderSize = ZSTD_frameHeaderSize_internal(\n                ip, ZSTD_FRAMEHEADERSIZE_PREFIX(dctx->format), dctx->format);\n        if (ZSTD_isError(frameHeaderSize)) return frameHeaderSize;\n        RETURN_ERROR_IF(remainingSrcSize < frameHeaderSize+ZSTD_blockHeaderSize,\n                        srcSize_wrong, \"\");\n        FORWARD_IF_ERROR( ZSTD_decodeFrameHeader(dctx, ip, frameHeaderSize) , \"\");\n        ip += frameHeaderSize; remainingSrcSize -= frameHeaderSize;\n    }\n\n    /* Shrink the blockSizeMax if enabled */\n    if (dctx->maxBlockSizeParam != 0)\n        dctx->fParams.blockSizeMax = MIN(dctx->fParams.blockSizeMax, (unsigned)dctx->maxBlockSizeParam);\n\n    /* Loop on each block */\n    while (1) {\n        BYTE* oBlockEnd = oend;\n        size_t decodedSize;\n        blockProperties_t blockProperties;\n        size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSrcSize, &blockProperties);\n        if (ZSTD_isError(cBlockSize)) return cBlockSize;\n\n        ip += ZSTD_blockHeaderSize;\n        remainingSrcSize -= ZSTD_blockHeaderSize;\n        RETURN_ERROR_IF(cBlockSize > remainingSrcSize, srcSize_wrong, \"\");\n\n        if (ip >= op && ip < oBlockEnd) {\n            /* We are decompressing in-place. Limit the output pointer so that we\n             * don't overwrite the block that we are currently reading. This will\n             * fail decompression if the input & output pointers aren't spaced\n             * far enough apart.\n             *\n             * This is important to set, even when the pointers are far enough\n             * apart, because ZSTD_decompressBlock_internal() can decide to store\n             * literals in the output buffer, after the block it is decompressing.\n             * Since we don't want anything to overwrite our input, we have to tell\n             * ZSTD_decompressBlock_internal to never write past ip.\n             *\n             * See ZSTD_allocateLiteralsBuffer() for reference.\n             */\n            oBlockEnd = op + (ip - op);\n        }\n\n        switch(blockProperties.blockType)\n        {\n        case bt_compressed:\n            assert(dctx->isFrameDecompression == 1);\n            decodedSize = ZSTD_decompressBlock_internal(dctx, op, (size_t)(oBlockEnd-op), ip, cBlockSize, not_streaming);\n            break;\n        case bt_raw :\n            /* Use oend instead of oBlockEnd because this function is safe to overlap. It uses memmove. */\n            decodedSize = ZSTD_copyRawBlock(op, (size_t)(oend-op), ip, cBlockSize);\n            break;\n        case bt_rle :\n            decodedSize = ZSTD_setRleBlock(op, (size_t)(oBlockEnd-op), *ip, blockProperties.origSize);\n            break;\n        case bt_reserved :\n        default:\n            RETURN_ERROR(corruption_detected, \"invalid block type\");\n        }\n        FORWARD_IF_ERROR(decodedSize, \"Block decompression failure\");\n        DEBUGLOG(5, \"Decompressed block of dSize = %u\", (unsigned)decodedSize);\n        if (dctx->validateChecksum) {\n            XXH64_update(&dctx->xxhState, op, decodedSize);\n        }\n        if (decodedSize) /* support dst = NULL,0 */ {\n            op += decodedSize;\n        }\n        assert(ip != NULL);\n        ip += cBlockSize;\n        remainingSrcSize -= cBlockSize;\n        if (blockProperties.lastBlock) break;\n    }\n\n    if (dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN) {\n        RETURN_ERROR_IF((U64)(op-ostart) != dctx->fParams.frameContentSize,\n                        corruption_detected, \"\");\n    }\n    if (dctx->fParams.checksumFlag) { /* Frame content checksum verification */\n        RETURN_ERROR_IF(remainingSrcSize<4, checksum_wrong, \"\");\n        if (!dctx->forceIgnoreChecksum) {\n            U32 const checkCalc = (U32)XXH64_digest(&dctx->xxhState);\n            U32 checkRead;\n            checkRead = MEM_readLE32(ip);\n            RETURN_ERROR_IF(checkRead != checkCalc, checksum_wrong, \"\");\n        }\n        ip += 4;\n        remainingSrcSize -= 4;\n    }\n    ZSTD_DCtx_trace_end(dctx, (U64)(op-ostart), (U64)(ip-istart), /* streaming */ 0);\n    /* Allow caller to get size read */\n    DEBUGLOG(4, \"ZSTD_decompressFrame: decompressed frame of size %i, consuming %i bytes of input\", (int)(op-ostart), (int)(ip - (const BYTE*)*srcPtr));\n    *srcPtr = ip;\n    *srcSizePtr = remainingSrcSize;\n    return (size_t)(op-ostart);\n}\n\nstatic\nZSTD_ALLOW_POINTER_OVERFLOW_ATTR\nsize_t ZSTD_decompressMultiFrame(ZSTD_DCtx* dctx,\n                                        void* dst, size_t dstCapacity,\n                                  const void* src, size_t srcSize,\n                                  const void* dict, size_t dictSize,\n                                  const ZSTD_DDict* ddict)\n{\n    void* const dststart = dst;\n    int moreThan1Frame = 0;\n\n    DEBUGLOG(5, \"ZSTD_decompressMultiFrame\");\n    assert(dict==NULL || ddict==NULL);  /* either dict or ddict set, not both */\n\n    if (ddict) {\n        dict = ZSTD_DDict_dictContent(ddict);\n        dictSize = ZSTD_DDict_dictSize(ddict);\n    }\n\n    while (srcSize >= ZSTD_startingInputLength(dctx->format)) {\n\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)\n        if (dctx->format == ZSTD_f_zstd1 && ZSTD_isLegacy(src, srcSize)) {\n            size_t decodedSize;\n            size_t const frameSize = ZSTD_findFrameCompressedSizeLegacy(src, srcSize);\n            if (ZSTD_isError(frameSize)) return frameSize;\n            RETURN_ERROR_IF(dctx->staticSize, memory_allocation,\n                \"legacy support is not compatible with static dctx\");\n\n            decodedSize = ZSTD_decompressLegacy(dst, dstCapacity, src, frameSize, dict, dictSize);\n            if (ZSTD_isError(decodedSize)) return decodedSize;\n\n            {\n                unsigned long long const expectedSize = ZSTD_getFrameContentSize(src, srcSize);\n                RETURN_ERROR_IF(expectedSize == ZSTD_CONTENTSIZE_ERROR, corruption_detected, \"Corrupted frame header!\");\n                if (expectedSize != ZSTD_CONTENTSIZE_UNKNOWN) {\n                    RETURN_ERROR_IF(expectedSize != decodedSize, corruption_detected,\n                        \"Frame header size does not match decoded size!\");\n                }\n            }\n\n            assert(decodedSize <= dstCapacity);\n            dst = (BYTE*)dst + decodedSize;\n            dstCapacity -= decodedSize;\n\n            src = (const BYTE*)src + frameSize;\n            srcSize -= frameSize;\n\n            continue;\n        }\n#endif\n\n        if (dctx->format == ZSTD_f_zstd1 && srcSize >= 4) {\n            U32 const magicNumber = MEM_readLE32(src);\n            DEBUGLOG(5, \"reading magic number %08X\", (unsigned)magicNumber);\n            if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {\n                /* skippable frame detected : skip it */\n                size_t const skippableSize = readSkippableFrameSize(src, srcSize);\n                FORWARD_IF_ERROR(skippableSize, \"invalid skippable frame\");\n                assert(skippableSize <= srcSize);\n\n                src = (const BYTE *)src + skippableSize;\n                srcSize -= skippableSize;\n                continue; /* check next frame */\n        }   }\n\n        if (ddict) {\n            /* we were called from ZSTD_decompress_usingDDict */\n            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDDict(dctx, ddict), \"\");\n        } else {\n            /* this will initialize correctly with no dict if dict == NULL, so\n             * use this in all cases but ddict */\n            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDict(dctx, dict, dictSize), \"\");\n        }\n        ZSTD_checkContinuity(dctx, dst, dstCapacity);\n\n        {   const size_t res = ZSTD_decompressFrame(dctx, dst, dstCapacity,\n                                                    &src, &srcSize);\n            RETURN_ERROR_IF(\n                (ZSTD_getErrorCode(res) == ZSTD_error_prefix_unknown)\n             && (moreThan1Frame==1),\n                srcSize_wrong,\n                \"At least one frame successfully completed, \"\n                \"but following bytes are garbage: \"\n                \"it's more likely to be a srcSize error, \"\n                \"specifying more input bytes than size of frame(s). \"\n                \"Note: one could be unlucky, it might be a corruption error instead, \"\n                \"happening right at the place where we expect zstd magic bytes. \"\n                \"But this is _much_ less likely than a srcSize field error.\");\n            if (ZSTD_isError(res)) return res;\n            assert(res <= dstCapacity);\n            if (res != 0)\n                dst = (BYTE*)dst + res;\n            dstCapacity -= res;\n        }\n        moreThan1Frame = 1;\n    }  /* while (srcSize >= ZSTD_frameHeaderSize_prefix) */\n\n    RETURN_ERROR_IF(srcSize, srcSize_wrong, \"input not entirely consumed\");\n\n    return (size_t)((BYTE*)dst - (BYTE*)dststart);\n}\n\nsize_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,\n                                 void* dst, size_t dstCapacity,\n                           const void* src, size_t srcSize,\n                           const void* dict, size_t dictSize)\n{\n    return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize, dict, dictSize, NULL);\n}\n\n\nstatic ZSTD_DDict const* ZSTD_getDDict(ZSTD_DCtx* dctx)\n{\n    switch (dctx->dictUses) {\n    default:\n        assert(0 /* Impossible */);\n        ZSTD_FALLTHROUGH;\n    case ZSTD_dont_use:\n        ZSTD_clearDict(dctx);\n        return NULL;\n    case ZSTD_use_indefinitely:\n        return dctx->ddict;\n    case ZSTD_use_once:\n        dctx->dictUses = ZSTD_dont_use;\n        return dctx->ddict;\n    }\n}\n\nsize_t ZSTD_decompressDCtx(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize)\n{\n    return ZSTD_decompress_usingDDict(dctx, dst, dstCapacity, src, srcSize, ZSTD_getDDict(dctx));\n}\n\n\nsize_t ZSTD_decompress(void* dst, size_t dstCapacity, const void* src, size_t srcSize)\n{\n#if defined(ZSTD_HEAPMODE) && (ZSTD_HEAPMODE>=1)\n    size_t regenSize;\n    ZSTD_DCtx* const dctx =  ZSTD_createDCtx_internal(ZSTD_defaultCMem);\n    RETURN_ERROR_IF(dctx==NULL, memory_allocation, \"NULL pointer!\");\n    regenSize = ZSTD_decompressDCtx(dctx, dst, dstCapacity, src, srcSize);\n    ZSTD_freeDCtx(dctx);\n    return regenSize;\n#else   /* stack mode */\n    ZSTD_DCtx dctx;\n    ZSTD_initDCtx_internal(&dctx);\n    return ZSTD_decompressDCtx(&dctx, dst, dstCapacity, src, srcSize);\n#endif\n}\n\n\n/*-**************************************\n*   Advanced Streaming Decompression API\n*   Bufferless and synchronous\n****************************************/\nsize_t ZSTD_nextSrcSizeToDecompress(ZSTD_DCtx* dctx) { return dctx->expected; }\n\n/**\n * Similar to ZSTD_nextSrcSizeToDecompress(), but when a block input can be streamed, we\n * allow taking a partial block as the input. Currently only raw uncompressed blocks can\n * be streamed.\n *\n * For blocks that can be streamed, this allows us to reduce the latency until we produce\n * output, and avoid copying the input.\n *\n * @param inputSize - The total amount of input that the caller currently has.\n */\nstatic size_t ZSTD_nextSrcSizeToDecompressWithInputSize(ZSTD_DCtx* dctx, size_t inputSize) {\n    if (!(dctx->stage == ZSTDds_decompressBlock || dctx->stage == ZSTDds_decompressLastBlock))\n        return dctx->expected;\n    if (dctx->bType != bt_raw)\n        return dctx->expected;\n    return BOUNDED(1, inputSize, dctx->expected);\n}\n\nZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx) {\n    switch(dctx->stage)\n    {\n    default:   /* should not happen */\n        assert(0);\n        ZSTD_FALLTHROUGH;\n    case ZSTDds_getFrameHeaderSize:\n        ZSTD_FALLTHROUGH;\n    case ZSTDds_decodeFrameHeader:\n        return ZSTDnit_frameHeader;\n    case ZSTDds_decodeBlockHeader:\n        return ZSTDnit_blockHeader;\n    case ZSTDds_decompressBlock:\n        return ZSTDnit_block;\n    case ZSTDds_decompressLastBlock:\n        return ZSTDnit_lastBlock;\n    case ZSTDds_checkChecksum:\n        return ZSTDnit_checksum;\n    case ZSTDds_decodeSkippableHeader:\n        ZSTD_FALLTHROUGH;\n    case ZSTDds_skipFrame:\n        return ZSTDnit_skippableFrame;\n    }\n}\n\nstatic int ZSTD_isSkipFrame(ZSTD_DCtx* dctx) { return dctx->stage == ZSTDds_skipFrame; }\n\n/** ZSTD_decompressContinue() :\n *  srcSize : must be the exact nb of bytes expected (see ZSTD_nextSrcSizeToDecompress())\n *  @return : nb of bytes generated into `dst` (necessarily <= `dstCapacity)\n *            or an error code, which can be tested using ZSTD_isError() */\nsize_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize)\n{\n    DEBUGLOG(5, \"ZSTD_decompressContinue (srcSize:%u)\", (unsigned)srcSize);\n    /* Sanity check */\n    RETURN_ERROR_IF(srcSize != ZSTD_nextSrcSizeToDecompressWithInputSize(dctx, srcSize), srcSize_wrong, \"not allowed\");\n    ZSTD_checkContinuity(dctx, dst, dstCapacity);\n\n    dctx->processedCSize += srcSize;\n\n    switch (dctx->stage)\n    {\n    case ZSTDds_getFrameHeaderSize :\n        assert(src != NULL);\n        if (dctx->format == ZSTD_f_zstd1) {  /* allows header */\n            assert(srcSize >= ZSTD_FRAMEIDSIZE);  /* to read skippable magic number */\n            if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {        /* skippable frame */\n                ZSTD_memcpy(dctx->headerBuffer, src, srcSize);\n                dctx->expected = ZSTD_SKIPPABLEHEADERSIZE - srcSize;  /* remaining to load to get full skippable frame header */\n                dctx->stage = ZSTDds_decodeSkippableHeader;\n                return 0;\n        }   }\n        dctx->headerSize = ZSTD_frameHeaderSize_internal(src, srcSize, dctx->format);\n        if (ZSTD_isError(dctx->headerSize)) return dctx->headerSize;\n        ZSTD_memcpy(dctx->headerBuffer, src, srcSize);\n        dctx->expected = dctx->headerSize - srcSize;\n        dctx->stage = ZSTDds_decodeFrameHeader;\n        return 0;\n\n    case ZSTDds_decodeFrameHeader:\n        assert(src != NULL);\n        ZSTD_memcpy(dctx->headerBuffer + (dctx->headerSize - srcSize), src, srcSize);\n        FORWARD_IF_ERROR(ZSTD_decodeFrameHeader(dctx, dctx->headerBuffer, dctx->headerSize), \"\");\n        dctx->expected = ZSTD_blockHeaderSize;\n        dctx->stage = ZSTDds_decodeBlockHeader;\n        return 0;\n\n    case ZSTDds_decodeBlockHeader:\n        {   blockProperties_t bp;\n            size_t const cBlockSize = ZSTD_getcBlockSize(src, ZSTD_blockHeaderSize, &bp);\n            if (ZSTD_isError(cBlockSize)) return cBlockSize;\n            RETURN_ERROR_IF(cBlockSize > dctx->fParams.blockSizeMax, corruption_detected, \"Block Size Exceeds Maximum\");\n            dctx->expected = cBlockSize;\n            dctx->bType = bp.blockType;\n            dctx->rleSize = bp.origSize;\n            if (cBlockSize) {\n                dctx->stage = bp.lastBlock ? ZSTDds_decompressLastBlock : ZSTDds_decompressBlock;\n                return 0;\n            }\n            /* empty block */\n            if (bp.lastBlock) {\n                if (dctx->fParams.checksumFlag) {\n                    dctx->expected = 4;\n                    dctx->stage = ZSTDds_checkChecksum;\n                } else {\n                    dctx->expected = 0; /* end of frame */\n                    dctx->stage = ZSTDds_getFrameHeaderSize;\n                }\n            } else {\n                dctx->expected = ZSTD_blockHeaderSize;  /* jump to next header */\n                dctx->stage = ZSTDds_decodeBlockHeader;\n            }\n            return 0;\n        }\n\n    case ZSTDds_decompressLastBlock:\n    case ZSTDds_decompressBlock:\n        DEBUGLOG(5, \"ZSTD_decompressContinue: case ZSTDds_decompressBlock\");\n        {   size_t rSize;\n            switch(dctx->bType)\n            {\n            case bt_compressed:\n                DEBUGLOG(5, \"ZSTD_decompressContinue: case bt_compressed\");\n                assert(dctx->isFrameDecompression == 1);\n                rSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, is_streaming);\n                dctx->expected = 0;  /* Streaming not supported */\n                break;\n            case bt_raw :\n                assert(srcSize <= dctx->expected);\n                rSize = ZSTD_copyRawBlock(dst, dstCapacity, src, srcSize);\n                FORWARD_IF_ERROR(rSize, \"ZSTD_copyRawBlock failed\");\n                assert(rSize == srcSize);\n                dctx->expected -= rSize;\n                break;\n            case bt_rle :\n                rSize = ZSTD_setRleBlock(dst, dstCapacity, *(const BYTE*)src, dctx->rleSize);\n                dctx->expected = 0;  /* Streaming not supported */\n                break;\n            case bt_reserved :   /* should never happen */\n            default:\n                RETURN_ERROR(corruption_detected, \"invalid block type\");\n            }\n            FORWARD_IF_ERROR(rSize, \"\");\n            RETURN_ERROR_IF(rSize > dctx->fParams.blockSizeMax, corruption_detected, \"Decompressed Block Size Exceeds Maximum\");\n            DEBUGLOG(5, \"ZSTD_decompressContinue: decoded size from block : %u\", (unsigned)rSize);\n            dctx->decodedSize += rSize;\n            if (dctx->validateChecksum) XXH64_update(&dctx->xxhState, dst, rSize);\n            dctx->previousDstEnd = (char*)dst + rSize;\n\n            /* Stay on the same stage until we are finished streaming the block. */\n            if (dctx->expected > 0) {\n                return rSize;\n            }\n\n            if (dctx->stage == ZSTDds_decompressLastBlock) {   /* end of frame */\n                DEBUGLOG(4, \"ZSTD_decompressContinue: decoded size from frame : %u\", (unsigned)dctx->decodedSize);\n                RETURN_ERROR_IF(\n                    dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN\n                 && dctx->decodedSize != dctx->fParams.frameContentSize,\n                    corruption_detected, \"\");\n                if (dctx->fParams.checksumFlag) {  /* another round for frame checksum */\n                    dctx->expected = 4;\n                    dctx->stage = ZSTDds_checkChecksum;\n                } else {\n                    ZSTD_DCtx_trace_end(dctx, dctx->decodedSize, dctx->processedCSize, /* streaming */ 1);\n                    dctx->expected = 0;   /* ends here */\n                    dctx->stage = ZSTDds_getFrameHeaderSize;\n                }\n            } else {\n                dctx->stage = ZSTDds_decodeBlockHeader;\n                dctx->expected = ZSTD_blockHeaderSize;\n            }\n            return rSize;\n        }\n\n    case ZSTDds_checkChecksum:\n        assert(srcSize == 4);  /* guaranteed by dctx->expected */\n        {\n            if (dctx->validateChecksum) {\n                U32 const h32 = (U32)XXH64_digest(&dctx->xxhState);\n                U32 const check32 = MEM_readLE32(src);\n                DEBUGLOG(4, \"ZSTD_decompressContinue: checksum : calculated %08X :: %08X read\", (unsigned)h32, (unsigned)check32);\n                RETURN_ERROR_IF(check32 != h32, checksum_wrong, \"\");\n            }\n            ZSTD_DCtx_trace_end(dctx, dctx->decodedSize, dctx->processedCSize, /* streaming */ 1);\n            dctx->expected = 0;\n            dctx->stage = ZSTDds_getFrameHeaderSize;\n            return 0;\n        }\n\n    case ZSTDds_decodeSkippableHeader:\n        assert(src != NULL);\n        assert(srcSize <= ZSTD_SKIPPABLEHEADERSIZE);\n        assert(dctx->format != ZSTD_f_zstd1_magicless);\n        ZSTD_memcpy(dctx->headerBuffer + (ZSTD_SKIPPABLEHEADERSIZE - srcSize), src, srcSize);   /* complete skippable header */\n        dctx->expected = MEM_readLE32(dctx->headerBuffer + ZSTD_FRAMEIDSIZE);   /* note : dctx->expected can grow seriously large, beyond local buffer size */\n        dctx->stage = ZSTDds_skipFrame;\n        return 0;\n\n    case ZSTDds_skipFrame:\n        dctx->expected = 0;\n        dctx->stage = ZSTDds_getFrameHeaderSize;\n        return 0;\n\n    default:\n        assert(0);   /* impossible */\n        RETURN_ERROR(GENERIC, \"impossible to reach\");   /* some compilers require default to do something */\n    }\n}\n\n\nstatic size_t ZSTD_refDictContent(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)\n{\n    dctx->dictEnd = dctx->previousDstEnd;\n    dctx->virtualStart = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));\n    dctx->prefixStart = dict;\n    dctx->previousDstEnd = (const char*)dict + dictSize;\n#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n    dctx->dictContentBeginForFuzzing = dctx->prefixStart;\n    dctx->dictContentEndForFuzzing = dctx->previousDstEnd;\n#endif\n    return 0;\n}\n\n/*! ZSTD_loadDEntropy() :\n *  dict : must point at beginning of a valid zstd dictionary.\n * @return : size of entropy tables read */\nsize_t\nZSTD_loadDEntropy(ZSTD_entropyDTables_t* entropy,\n                  const void* const dict, size_t const dictSize)\n{\n    const BYTE* dictPtr = (const BYTE*)dict;\n    const BYTE* const dictEnd = dictPtr + dictSize;\n\n    RETURN_ERROR_IF(dictSize <= 8, dictionary_corrupted, \"dict is too small\");\n    assert(MEM_readLE32(dict) == ZSTD_MAGIC_DICTIONARY);   /* dict must be valid */\n    dictPtr += 8;   /* skip header = magic + dictID */\n\n    ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, OFTable) == offsetof(ZSTD_entropyDTables_t, LLTable) + sizeof(entropy->LLTable));\n    ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, MLTable) == offsetof(ZSTD_entropyDTables_t, OFTable) + sizeof(entropy->OFTable));\n    ZSTD_STATIC_ASSERT(sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable) >= HUF_DECOMPRESS_WORKSPACE_SIZE);\n    {   void* const workspace = &entropy->LLTable;   /* use fse tables as temporary workspace; implies fse tables are grouped together */\n        size_t const workspaceSize = sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable);\n#ifdef HUF_FORCE_DECOMPRESS_X1\n        /* in minimal huffman, we always use X1 variants */\n        size_t const hSize = HUF_readDTableX1_wksp(entropy->hufTable,\n                                                dictPtr, dictEnd - dictPtr,\n                                                workspace, workspaceSize, /* flags */ 0);\n#else\n        size_t const hSize = HUF_readDTableX2_wksp(entropy->hufTable,\n                                                dictPtr, (size_t)(dictEnd - dictPtr),\n                                                workspace, workspaceSize, /* flags */ 0);\n#endif\n        RETURN_ERROR_IF(HUF_isError(hSize), dictionary_corrupted, \"\");\n        dictPtr += hSize;\n    }\n\n    {   short offcodeNCount[MaxOff+1];\n        unsigned offcodeMaxValue = MaxOff, offcodeLog;\n        size_t const offcodeHeaderSize = FSE_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dictPtr, (size_t)(dictEnd-dictPtr));\n        RETURN_ERROR_IF(FSE_isError(offcodeHeaderSize), dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(offcodeMaxValue > MaxOff, dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(offcodeLog > OffFSELog, dictionary_corrupted, \"\");\n        ZSTD_buildFSETable( entropy->OFTable,\n                            offcodeNCount, offcodeMaxValue,\n                            OF_base, OF_bits,\n                            offcodeLog,\n                            entropy->workspace, sizeof(entropy->workspace),\n                            /* bmi2 */0);\n        dictPtr += offcodeHeaderSize;\n    }\n\n    {   short matchlengthNCount[MaxML+1];\n        unsigned matchlengthMaxValue = MaxML, matchlengthLog;\n        size_t const matchlengthHeaderSize = FSE_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dictPtr, (size_t)(dictEnd-dictPtr));\n        RETURN_ERROR_IF(FSE_isError(matchlengthHeaderSize), dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(matchlengthMaxValue > MaxML, dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(matchlengthLog > MLFSELog, dictionary_corrupted, \"\");\n        ZSTD_buildFSETable( entropy->MLTable,\n                            matchlengthNCount, matchlengthMaxValue,\n                            ML_base, ML_bits,\n                            matchlengthLog,\n                            entropy->workspace, sizeof(entropy->workspace),\n                            /* bmi2 */ 0);\n        dictPtr += matchlengthHeaderSize;\n    }\n\n    {   short litlengthNCount[MaxLL+1];\n        unsigned litlengthMaxValue = MaxLL, litlengthLog;\n        size_t const litlengthHeaderSize = FSE_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dictPtr, (size_t)(dictEnd-dictPtr));\n        RETURN_ERROR_IF(FSE_isError(litlengthHeaderSize), dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(litlengthMaxValue > MaxLL, dictionary_corrupted, \"\");\n        RETURN_ERROR_IF(litlengthLog > LLFSELog, dictionary_corrupted, \"\");\n        ZSTD_buildFSETable( entropy->LLTable,\n                            litlengthNCount, litlengthMaxValue,\n                            LL_base, LL_bits,\n                            litlengthLog,\n                            entropy->workspace, sizeof(entropy->workspace),\n                            /* bmi2 */ 0);\n        dictPtr += litlengthHeaderSize;\n    }\n\n    RETURN_ERROR_IF(dictPtr+12 > dictEnd, dictionary_corrupted, \"\");\n    {   int i;\n        size_t const dictContentSize = (size_t)(dictEnd - (dictPtr+12));\n        for (i=0; i<3; i++) {\n            U32 const rep = MEM_readLE32(dictPtr); dictPtr += 4;\n            RETURN_ERROR_IF(rep==0 || rep > dictContentSize,\n                            dictionary_corrupted, \"\");\n            entropy->rep[i] = rep;\n    }   }\n\n    return (size_t)(dictPtr - (const BYTE*)dict);\n}\n\nstatic size_t ZSTD_decompress_insertDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)\n{\n    if (dictSize < 8) return ZSTD_refDictContent(dctx, dict, dictSize);\n    {   U32 const magic = MEM_readLE32(dict);\n        if (magic != ZSTD_MAGIC_DICTIONARY) {\n            return ZSTD_refDictContent(dctx, dict, dictSize);   /* pure content mode */\n    }   }\n    dctx->dictID = MEM_readLE32((const char*)dict + ZSTD_FRAMEIDSIZE);\n\n    /* load entropy tables */\n    {   size_t const eSize = ZSTD_loadDEntropy(&dctx->entropy, dict, dictSize);\n        RETURN_ERROR_IF(ZSTD_isError(eSize), dictionary_corrupted, \"\");\n        dict = (const char*)dict + eSize;\n        dictSize -= eSize;\n    }\n    dctx->litEntropy = dctx->fseEntropy = 1;\n\n    /* reference dictionary content */\n    return ZSTD_refDictContent(dctx, dict, dictSize);\n}\n\nsize_t ZSTD_decompressBegin(ZSTD_DCtx* dctx)\n{\n    assert(dctx != NULL);\n#if ZSTD_TRACE\n    dctx->traceCtx = (ZSTD_trace_decompress_begin != NULL) ? ZSTD_trace_decompress_begin(dctx) : 0;\n#endif\n    dctx->expected = ZSTD_startingInputLength(dctx->format);  /* dctx->format must be properly set */\n    dctx->stage = ZSTDds_getFrameHeaderSize;\n    dctx->processedCSize = 0;\n    dctx->decodedSize = 0;\n    dctx->previousDstEnd = NULL;\n    dctx->prefixStart = NULL;\n    dctx->virtualStart = NULL;\n    dctx->dictEnd = NULL;\n    dctx->entropy.hufTable[0] = (HUF_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);  /* cover both little and big endian */\n    dctx->litEntropy = dctx->fseEntropy = 0;\n    dctx->dictID = 0;\n    dctx->bType = bt_reserved;\n    dctx->isFrameDecompression = 1;\n    ZSTD_STATIC_ASSERT(sizeof(dctx->entropy.rep) == sizeof(repStartValue));\n    ZSTD_memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue));  /* initial repcodes */\n    dctx->LLTptr = dctx->entropy.LLTable;\n    dctx->MLTptr = dctx->entropy.MLTable;\n    dctx->OFTptr = dctx->entropy.OFTable;\n    dctx->HUFptr = dctx->entropy.hufTable;\n    return 0;\n}\n\nsize_t ZSTD_decompressBegin_usingDict(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)\n{\n    FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , \"\");\n    if (dict && dictSize)\n        RETURN_ERROR_IF(\n            ZSTD_isError(ZSTD_decompress_insertDictionary(dctx, dict, dictSize)),\n            dictionary_corrupted, \"\");\n    return 0;\n}\n\n\n/* ======   ZSTD_DDict   ====== */\n\nsize_t ZSTD_decompressBegin_usingDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict)\n{\n    DEBUGLOG(4, \"ZSTD_decompressBegin_usingDDict\");\n    assert(dctx != NULL);\n    if (ddict) {\n        const char* const dictStart = (const char*)ZSTD_DDict_dictContent(ddict);\n        size_t const dictSize = ZSTD_DDict_dictSize(ddict);\n        const void* const dictEnd = dictStart + dictSize;\n        dctx->ddictIsCold = (dctx->dictEnd != dictEnd);\n        DEBUGLOG(4, \"DDict is %s\",\n                    dctx->ddictIsCold ? \"~cold~\" : \"hot!\");\n    }\n    FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , \"\");\n    if (ddict) {   /* NULL ddict is equivalent to no dictionary */\n        ZSTD_copyDDictParameters(dctx, ddict);\n    }\n    return 0;\n}\n\n/*! ZSTD_getDictID_fromDict() :\n *  Provides the dictID stored within dictionary.\n *  if @return == 0, the dictionary is not conformant with Zstandard specification.\n *  It can still be loaded, but as a content-only dictionary. */\nunsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize)\n{\n    if (dictSize < 8) return 0;\n    if (MEM_readLE32(dict) != ZSTD_MAGIC_DICTIONARY) return 0;\n    return MEM_readLE32((const char*)dict + ZSTD_FRAMEIDSIZE);\n}\n\n/*! ZSTD_getDictID_fromFrame() :\n *  Provides the dictID required to decompress frame stored within `src`.\n *  If @return == 0, the dictID could not be decoded.\n *  This could for one of the following reasons :\n *  - The frame does not require a dictionary (most common case).\n *  - The frame was built with dictID intentionally removed.\n *    Needed dictionary is a hidden piece of information.\n *    Note : this use case also happens when using a non-conformant dictionary.\n *  - `srcSize` is too small, and as a result, frame header could not be decoded.\n *    Note : possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`.\n *  - This is not a Zstandard frame.\n *  When identifying the exact failure cause, it's possible to use\n *  ZSTD_getFrameHeader(), which will provide a more precise error code. */\nunsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize)\n{\n    ZSTD_frameHeader zfp = { 0, 0, 0, ZSTD_frame, 0, 0, 0, 0, 0 };\n    size_t const hError = ZSTD_getFrameHeader(&zfp, src, srcSize);\n    if (ZSTD_isError(hError)) return 0;\n    return zfp.dictID;\n}\n\n\n/*! ZSTD_decompress_usingDDict() :\n*   Decompression using a pre-digested Dictionary\n*   Use dictionary without significant overhead. */\nsize_t ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx,\n                                  void* dst, size_t dstCapacity,\n                            const void* src, size_t srcSize,\n                            const ZSTD_DDict* ddict)\n{\n    /* pass content and size in case legacy frames are encountered */\n    return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize,\n                                     NULL, 0,\n                                     ddict);\n}\n\n\n/*=====================================\n*   Streaming decompression\n*====================================*/\n\nZSTD_DStream* ZSTD_createDStream(void)\n{\n    DEBUGLOG(3, \"ZSTD_createDStream\");\n    return ZSTD_createDCtx_internal(ZSTD_defaultCMem);\n}\n\nZSTD_DStream* ZSTD_initStaticDStream(void *workspace, size_t workspaceSize)\n{\n    return ZSTD_initStaticDCtx(workspace, workspaceSize);\n}\n\nZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem)\n{\n    return ZSTD_createDCtx_internal(customMem);\n}\n\nsize_t ZSTD_freeDStream(ZSTD_DStream* zds)\n{\n    return ZSTD_freeDCtx(zds);\n}\n\n\n/* ***  Initialization  *** */\n\nsize_t ZSTD_DStreamInSize(void)  { return ZSTD_BLOCKSIZE_MAX + ZSTD_blockHeaderSize; }\nsize_t ZSTD_DStreamOutSize(void) { return ZSTD_BLOCKSIZE_MAX; }\n\nsize_t ZSTD_DCtx_loadDictionary_advanced(ZSTD_DCtx* dctx,\n                                   const void* dict, size_t dictSize,\n                                         ZSTD_dictLoadMethod_e dictLoadMethod,\n                                         ZSTD_dictContentType_e dictContentType)\n{\n    RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, \"\");\n    ZSTD_clearDict(dctx);\n    if (dict && dictSize != 0) {\n        dctx->ddictLocal = ZSTD_createDDict_advanced(dict, dictSize, dictLoadMethod, dictContentType, dctx->customMem);\n        RETURN_ERROR_IF(dctx->ddictLocal == NULL, memory_allocation, \"NULL pointer!\");\n        dctx->ddict = dctx->ddictLocal;\n        dctx->dictUses = ZSTD_use_indefinitely;\n    }\n    return 0;\n}\n\nsize_t ZSTD_DCtx_loadDictionary_byReference(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)\n{\n    return ZSTD_DCtx_loadDictionary_advanced(dctx, dict, dictSize, ZSTD_dlm_byRef, ZSTD_dct_auto);\n}\n\nsize_t ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, const void* dict, size_t dictSize)\n{\n    return ZSTD_DCtx_loadDictionary_advanced(dctx, dict, dictSize, ZSTD_dlm_byCopy, ZSTD_dct_auto);\n}\n\nsize_t ZSTD_DCtx_refPrefix_advanced(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType)\n{\n    FORWARD_IF_ERROR(ZSTD_DCtx_loadDictionary_advanced(dctx, prefix, prefixSize, ZSTD_dlm_byRef, dictContentType), \"\");\n    dctx->dictUses = ZSTD_use_once;\n    return 0;\n}\n\nsize_t ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx, const void* prefix, size_t prefixSize)\n{\n    return ZSTD_DCtx_refPrefix_advanced(dctx, prefix, prefixSize, ZSTD_dct_rawContent);\n}\n\n\n/* ZSTD_initDStream_usingDict() :\n * return : expected size, aka ZSTD_startingInputLength().\n * this function cannot fail */\nsize_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize)\n{\n    DEBUGLOG(4, \"ZSTD_initDStream_usingDict\");\n    FORWARD_IF_ERROR( ZSTD_DCtx_reset(zds, ZSTD_reset_session_only) , \"\");\n    FORWARD_IF_ERROR( ZSTD_DCtx_loadDictionary(zds, dict, dictSize) , \"\");\n    return ZSTD_startingInputLength(zds->format);\n}\n\n/* note : this variant can't fail */\nsize_t ZSTD_initDStream(ZSTD_DStream* zds)\n{\n    DEBUGLOG(4, \"ZSTD_initDStream\");\n    FORWARD_IF_ERROR(ZSTD_DCtx_reset(zds, ZSTD_reset_session_only), \"\");\n    FORWARD_IF_ERROR(ZSTD_DCtx_refDDict(zds, NULL), \"\");\n    return ZSTD_startingInputLength(zds->format);\n}\n\n/* ZSTD_initDStream_usingDDict() :\n * ddict will just be referenced, and must outlive decompression session\n * this function cannot fail */\nsize_t ZSTD_initDStream_usingDDict(ZSTD_DStream* dctx, const ZSTD_DDict* ddict)\n{\n    DEBUGLOG(4, \"ZSTD_initDStream_usingDDict\");\n    FORWARD_IF_ERROR( ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only) , \"\");\n    FORWARD_IF_ERROR( ZSTD_DCtx_refDDict(dctx, ddict) , \"\");\n    return ZSTD_startingInputLength(dctx->format);\n}\n\n/* ZSTD_resetDStream() :\n * return : expected size, aka ZSTD_startingInputLength().\n * this function cannot fail */\nsize_t ZSTD_resetDStream(ZSTD_DStream* dctx)\n{\n    DEBUGLOG(4, \"ZSTD_resetDStream\");\n    FORWARD_IF_ERROR(ZSTD_DCtx_reset(dctx, ZSTD_reset_session_only), \"\");\n    return ZSTD_startingInputLength(dctx->format);\n}\n\n\nsize_t ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, const ZSTD_DDict* ddict)\n{\n    RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, \"\");\n    ZSTD_clearDict(dctx);\n    if (ddict) {\n        dctx->ddict = ddict;\n        dctx->dictUses = ZSTD_use_indefinitely;\n        if (dctx->refMultipleDDicts == ZSTD_rmd_refMultipleDDicts) {\n            if (dctx->ddictSet == NULL) {\n                dctx->ddictSet = ZSTD_createDDictHashSet(dctx->customMem);\n                if (!dctx->ddictSet) {\n                    RETURN_ERROR(memory_allocation, \"Failed to allocate memory for hash set!\");\n                }\n            }\n            assert(!dctx->staticSize);  /* Impossible: ddictSet cannot have been allocated if static dctx */\n            FORWARD_IF_ERROR(ZSTD_DDictHashSet_addDDict(dctx->ddictSet, ddict, dctx->customMem), \"\");\n        }\n    }\n    return 0;\n}\n\n/* ZSTD_DCtx_setMaxWindowSize() :\n * note : no direct equivalence in ZSTD_DCtx_setParameter,\n * since this version sets windowSize, and the other sets windowLog */\nsize_t ZSTD_DCtx_setMaxWindowSize(ZSTD_DCtx* dctx, size_t maxWindowSize)\n{\n    ZSTD_bounds const bounds = ZSTD_dParam_getBounds(ZSTD_d_windowLogMax);\n    size_t const min = (size_t)1 << bounds.lowerBound;\n    size_t const max = (size_t)1 << bounds.upperBound;\n    RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, \"\");\n    RETURN_ERROR_IF(maxWindowSize < min, parameter_outOfBound, \"\");\n    RETURN_ERROR_IF(maxWindowSize > max, parameter_outOfBound, \"\");\n    dctx->maxWindowSize = maxWindowSize;\n    return 0;\n}\n\nsize_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format)\n{\n    return ZSTD_DCtx_setParameter(dctx, ZSTD_d_format, (int)format);\n}\n\nZSTD_bounds ZSTD_dParam_getBounds(ZSTD_dParameter dParam)\n{\n    ZSTD_bounds bounds = { 0, 0, 0 };\n    switch(dParam) {\n        case ZSTD_d_windowLogMax:\n            bounds.lowerBound = ZSTD_WINDOWLOG_ABSOLUTEMIN;\n            bounds.upperBound = ZSTD_WINDOWLOG_MAX;\n            return bounds;\n        case ZSTD_d_format:\n            bounds.lowerBound = (int)ZSTD_f_zstd1;\n            bounds.upperBound = (int)ZSTD_f_zstd1_magicless;\n            ZSTD_STATIC_ASSERT(ZSTD_f_zstd1 < ZSTD_f_zstd1_magicless);\n            return bounds;\n        case ZSTD_d_stableOutBuffer:\n            bounds.lowerBound = (int)ZSTD_bm_buffered;\n            bounds.upperBound = (int)ZSTD_bm_stable;\n            return bounds;\n        case ZSTD_d_forceIgnoreChecksum:\n            bounds.lowerBound = (int)ZSTD_d_validateChecksum;\n            bounds.upperBound = (int)ZSTD_d_ignoreChecksum;\n            return bounds;\n        case ZSTD_d_refMultipleDDicts:\n            bounds.lowerBound = (int)ZSTD_rmd_refSingleDDict;\n            bounds.upperBound = (int)ZSTD_rmd_refMultipleDDicts;\n            return bounds;\n        case ZSTD_d_disableHuffmanAssembly:\n            bounds.lowerBound = 0;\n            bounds.upperBound = 1;\n            return bounds;\n        case ZSTD_d_maxBlockSize:\n            bounds.lowerBound = ZSTD_BLOCKSIZE_MAX_MIN;\n            bounds.upperBound = ZSTD_BLOCKSIZE_MAX;\n            return bounds;\n\n        default:;\n    }\n    bounds.error = ERROR(parameter_unsupported);\n    return bounds;\n}\n\n/* ZSTD_dParam_withinBounds:\n * @return 1 if value is within dParam bounds,\n * 0 otherwise */\nstatic int ZSTD_dParam_withinBounds(ZSTD_dParameter dParam, int value)\n{\n    ZSTD_bounds const bounds = ZSTD_dParam_getBounds(dParam);\n    if (ZSTD_isError(bounds.error)) return 0;\n    if (value < bounds.lowerBound) return 0;\n    if (value > bounds.upperBound) return 0;\n    return 1;\n}\n\n#define CHECK_DBOUNDS(p,v) {                \\\n    RETURN_ERROR_IF(!ZSTD_dParam_withinBounds(p, v), parameter_outOfBound, \"\"); \\\n}\n\nsize_t ZSTD_DCtx_getParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, int* value)\n{\n    switch (param) {\n        case ZSTD_d_windowLogMax:\n            *value = (int)ZSTD_highbit32((U32)dctx->maxWindowSize);\n            return 0;\n        case ZSTD_d_format:\n            *value = (int)dctx->format;\n            return 0;\n        case ZSTD_d_stableOutBuffer:\n            *value = (int)dctx->outBufferMode;\n            return 0;\n        case ZSTD_d_forceIgnoreChecksum:\n            *value = (int)dctx->forceIgnoreChecksum;\n            return 0;\n        case ZSTD_d_refMultipleDDicts:\n            *value = (int)dctx->refMultipleDDicts;\n            return 0;\n        case ZSTD_d_disableHuffmanAssembly:\n            *value = (int)dctx->disableHufAsm;\n            return 0;\n        case ZSTD_d_maxBlockSize:\n            *value = dctx->maxBlockSizeParam;\n            return 0;\n        default:;\n    }\n    RETURN_ERROR(parameter_unsupported, \"\");\n}\n\nsize_t ZSTD_DCtx_setParameter(ZSTD_DCtx* dctx, ZSTD_dParameter dParam, int value)\n{\n    RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, \"\");\n    switch(dParam) {\n        case ZSTD_d_windowLogMax:\n            if (value == 0) value = ZSTD_WINDOWLOG_LIMIT_DEFAULT;\n            CHECK_DBOUNDS(ZSTD_d_windowLogMax, value);\n            dctx->maxWindowSize = ((size_t)1) << value;\n            return 0;\n        case ZSTD_d_format:\n            CHECK_DBOUNDS(ZSTD_d_format, value);\n            dctx->format = (ZSTD_format_e)value;\n            return 0;\n        case ZSTD_d_stableOutBuffer:\n            CHECK_DBOUNDS(ZSTD_d_stableOutBuffer, value);\n            dctx->outBufferMode = (ZSTD_bufferMode_e)value;\n            return 0;\n        case ZSTD_d_forceIgnoreChecksum:\n            CHECK_DBOUNDS(ZSTD_d_forceIgnoreChecksum, value);\n            dctx->forceIgnoreChecksum = (ZSTD_forceIgnoreChecksum_e)value;\n            return 0;\n        case ZSTD_d_refMultipleDDicts:\n            CHECK_DBOUNDS(ZSTD_d_refMultipleDDicts, value);\n            if (dctx->staticSize != 0) {\n                RETURN_ERROR(parameter_unsupported, \"Static dctx does not support multiple DDicts!\");\n            }\n            dctx->refMultipleDDicts = (ZSTD_refMultipleDDicts_e)value;\n            return 0;\n        case ZSTD_d_disableHuffmanAssembly:\n            CHECK_DBOUNDS(ZSTD_d_disableHuffmanAssembly, value);\n            dctx->disableHufAsm = value != 0;\n            return 0;\n        case ZSTD_d_maxBlockSize:\n            if (value != 0) CHECK_DBOUNDS(ZSTD_d_maxBlockSize, value);\n            dctx->maxBlockSizeParam = value;\n            return 0;\n        default:;\n    }\n    RETURN_ERROR(parameter_unsupported, \"\");\n}\n\nsize_t ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset)\n{\n    if ( (reset == ZSTD_reset_session_only)\n      || (reset == ZSTD_reset_session_and_parameters) ) {\n        dctx->streamStage = zdss_init;\n        dctx->noForwardProgress = 0;\n        dctx->isFrameDecompression = 1;\n    }\n    if ( (reset == ZSTD_reset_parameters)\n      || (reset == ZSTD_reset_session_and_parameters) ) {\n        RETURN_ERROR_IF(dctx->streamStage != zdss_init, stage_wrong, \"\");\n        ZSTD_clearDict(dctx);\n        ZSTD_DCtx_resetParameters(dctx);\n    }\n    return 0;\n}\n\n\nsize_t ZSTD_sizeof_DStream(const ZSTD_DStream* dctx)\n{\n    return ZSTD_sizeof_DCtx(dctx);\n}\n\nstatic size_t ZSTD_decodingBufferSize_internal(unsigned long long windowSize, unsigned long long frameContentSize, size_t blockSizeMax)\n{\n    size_t const blockSize = MIN((size_t)MIN(windowSize, ZSTD_BLOCKSIZE_MAX), blockSizeMax);\n    /* We need blockSize + WILDCOPY_OVERLENGTH worth of buffer so that if a block\n     * ends at windowSize + WILDCOPY_OVERLENGTH + 1 bytes, we can start writing\n     * the block at the beginning of the output buffer, and maintain a full window.\n     *\n     * We need another blockSize worth of buffer so that we can store split\n     * literals at the end of the block without overwriting the extDict window.\n     */\n    unsigned long long const neededRBSize = windowSize + (blockSize * 2) + (WILDCOPY_OVERLENGTH * 2);\n    unsigned long long const neededSize = MIN(frameContentSize, neededRBSize);\n    size_t const minRBSize = (size_t) neededSize;\n    RETURN_ERROR_IF((unsigned long long)minRBSize != neededSize,\n                    frameParameter_windowTooLarge, \"\");\n    return minRBSize;\n}\n\nsize_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize)\n{\n    return ZSTD_decodingBufferSize_internal(windowSize, frameContentSize, ZSTD_BLOCKSIZE_MAX);\n}\n\nsize_t ZSTD_estimateDStreamSize(size_t windowSize)\n{\n    size_t const blockSize = MIN(windowSize, ZSTD_BLOCKSIZE_MAX);\n    size_t const inBuffSize = blockSize;  /* no block can be larger */\n    size_t const outBuffSize = ZSTD_decodingBufferSize_min(windowSize, ZSTD_CONTENTSIZE_UNKNOWN);\n    return ZSTD_estimateDCtxSize() + inBuffSize + outBuffSize;\n}\n\nsize_t ZSTD_estimateDStreamSize_fromFrame(const void* src, size_t srcSize)\n{\n    U32 const windowSizeMax = 1U << ZSTD_WINDOWLOG_MAX;   /* note : should be user-selectable, but requires an additional parameter (or a dctx) */\n    ZSTD_frameHeader zfh;\n    size_t const err = ZSTD_getFrameHeader(&zfh, src, srcSize);\n    if (ZSTD_isError(err)) return err;\n    RETURN_ERROR_IF(err>0, srcSize_wrong, \"\");\n    RETURN_ERROR_IF(zfh.windowSize > windowSizeMax,\n                    frameParameter_windowTooLarge, \"\");\n    return ZSTD_estimateDStreamSize((size_t)zfh.windowSize);\n}\n\n\n/* *****   Decompression   ***** */\n\nstatic int ZSTD_DCtx_isOverflow(ZSTD_DStream* zds, size_t const neededInBuffSize, size_t const neededOutBuffSize)\n{\n    return (zds->inBuffSize + zds->outBuffSize) >= (neededInBuffSize + neededOutBuffSize) * ZSTD_WORKSPACETOOLARGE_FACTOR;\n}\n\nstatic void ZSTD_DCtx_updateOversizedDuration(ZSTD_DStream* zds, size_t const neededInBuffSize, size_t const neededOutBuffSize)\n{\n    if (ZSTD_DCtx_isOverflow(zds, neededInBuffSize, neededOutBuffSize))\n        zds->oversizedDuration++;\n    else\n        zds->oversizedDuration = 0;\n}\n\nstatic int ZSTD_DCtx_isOversizedTooLong(ZSTD_DStream* zds)\n{\n    return zds->oversizedDuration >= ZSTD_WORKSPACETOOLARGE_MAXDURATION;\n}\n\n/* Checks that the output buffer hasn't changed if ZSTD_obm_stable is used. */\nstatic size_t ZSTD_checkOutBuffer(ZSTD_DStream const* zds, ZSTD_outBuffer const* output)\n{\n    ZSTD_outBuffer const expect = zds->expectedOutBuffer;\n    /* No requirement when ZSTD_obm_stable is not enabled. */\n    if (zds->outBufferMode != ZSTD_bm_stable)\n        return 0;\n    /* Any buffer is allowed in zdss_init, this must be the same for every other call until\n     * the context is reset.\n     */\n    if (zds->streamStage == zdss_init)\n        return 0;\n    /* The buffer must match our expectation exactly. */\n    if (expect.dst == output->dst && expect.pos == output->pos && expect.size == output->size)\n        return 0;\n    RETURN_ERROR(dstBuffer_wrong, \"ZSTD_d_stableOutBuffer enabled but output differs!\");\n}\n\n/* Calls ZSTD_decompressContinue() with the right parameters for ZSTD_decompressStream()\n * and updates the stage and the output buffer state. This call is extracted so it can be\n * used both when reading directly from the ZSTD_inBuffer, and in buffered input mode.\n * NOTE: You must break after calling this function since the streamStage is modified.\n */\nstatic size_t ZSTD_decompressContinueStream(\n            ZSTD_DStream* zds, char** op, char* oend,\n            void const* src, size_t srcSize) {\n    int const isSkipFrame = ZSTD_isSkipFrame(zds);\n    if (zds->outBufferMode == ZSTD_bm_buffered) {\n        size_t const dstSize = isSkipFrame ? 0 : zds->outBuffSize - zds->outStart;\n        size_t const decodedSize = ZSTD_decompressContinue(zds,\n                zds->outBuff + zds->outStart, dstSize, src, srcSize);\n        FORWARD_IF_ERROR(decodedSize, \"\");\n        if (!decodedSize && !isSkipFrame) {\n            zds->streamStage = zdss_read;\n        } else {\n            zds->outEnd = zds->outStart + decodedSize;\n            zds->streamStage = zdss_flush;\n        }\n    } else {\n        /* Write directly into the output buffer */\n        size_t const dstSize = isSkipFrame ? 0 : (size_t)(oend - *op);\n        size_t const decodedSize = ZSTD_decompressContinue(zds, *op, dstSize, src, srcSize);\n        FORWARD_IF_ERROR(decodedSize, \"\");\n        *op += decodedSize;\n        /* Flushing is not needed. */\n        zds->streamStage = zdss_read;\n        assert(*op <= oend);\n        assert(zds->outBufferMode == ZSTD_bm_stable);\n    }\n    return 0;\n}\n\nsize_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input)\n{\n    const char* const src = (const char*)input->src;\n    const char* const istart = input->pos != 0 ? src + input->pos : src;\n    const char* const iend = input->size != 0 ? src + input->size : src;\n    const char* ip = istart;\n    char* const dst = (char*)output->dst;\n    char* const ostart = output->pos != 0 ? dst + output->pos : dst;\n    char* const oend = output->size != 0 ? dst + output->size : dst;\n    char* op = ostart;\n    U32 someMoreWork = 1;\n\n    DEBUGLOG(5, \"ZSTD_decompressStream\");\n    RETURN_ERROR_IF(\n        input->pos > input->size,\n        srcSize_wrong,\n        \"forbidden. in: pos: %u   vs size: %u\",\n        (U32)input->pos, (U32)input->size);\n    RETURN_ERROR_IF(\n        output->pos > output->size,\n        dstSize_tooSmall,\n        \"forbidden. out: pos: %u   vs size: %u\",\n        (U32)output->pos, (U32)output->size);\n    DEBUGLOG(5, \"input size : %u\", (U32)(input->size - input->pos));\n    FORWARD_IF_ERROR(ZSTD_checkOutBuffer(zds, output), \"\");\n\n    while (someMoreWork) {\n        switch(zds->streamStage)\n        {\n        case zdss_init :\n            DEBUGLOG(5, \"stage zdss_init => transparent reset \");\n            zds->streamStage = zdss_loadHeader;\n            zds->lhSize = zds->inPos = zds->outStart = zds->outEnd = 0;\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)\n            zds->legacyVersion = 0;\n#endif\n            zds->hostageByte = 0;\n            zds->expectedOutBuffer = *output;\n            ZSTD_FALLTHROUGH;\n\n        case zdss_loadHeader :\n            DEBUGLOG(5, \"stage zdss_loadHeader (srcSize : %u)\", (U32)(iend - ip));\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)\n            if (zds->legacyVersion) {\n                RETURN_ERROR_IF(zds->staticSize, memory_allocation,\n                    \"legacy support is incompatible with static dctx\");\n                {   size_t const hint = ZSTD_decompressLegacyStream(zds->legacyContext, zds->legacyVersion, output, input);\n                    if (hint==0) zds->streamStage = zdss_init;\n                    return hint;\n            }   }\n#endif\n            {   size_t const hSize = ZSTD_getFrameHeader_advanced(&zds->fParams, zds->headerBuffer, zds->lhSize, zds->format);\n                if (zds->refMultipleDDicts && zds->ddictSet) {\n                    ZSTD_DCtx_selectFrameDDict(zds);\n                }\n                if (ZSTD_isError(hSize)) {\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)\n                    U32 const legacyVersion = ZSTD_isLegacy(istart, iend-istart);\n                    if (legacyVersion) {\n                        ZSTD_DDict const* const ddict = ZSTD_getDDict(zds);\n                        const void* const dict = ddict ? ZSTD_DDict_dictContent(ddict) : NULL;\n                        size_t const dictSize = ddict ? ZSTD_DDict_dictSize(ddict) : 0;\n                        DEBUGLOG(5, \"ZSTD_decompressStream: detected legacy version v0.%u\", legacyVersion);\n                        RETURN_ERROR_IF(zds->staticSize, memory_allocation,\n                            \"legacy support is incompatible with static dctx\");\n                        FORWARD_IF_ERROR(ZSTD_initLegacyStream(&zds->legacyContext,\n                                    zds->previousLegacyVersion, legacyVersion,\n                                    dict, dictSize), \"\");\n                        zds->legacyVersion = zds->previousLegacyVersion = legacyVersion;\n                        {   size_t const hint = ZSTD_decompressLegacyStream(zds->legacyContext, legacyVersion, output, input);\n                            if (hint==0) zds->streamStage = zdss_init;   /* or stay in stage zdss_loadHeader */\n                            return hint;\n                    }   }\n#endif\n                    return hSize;   /* error */\n                }\n                if (hSize != 0) {   /* need more input */\n                    size_t const toLoad = hSize - zds->lhSize;   /* if hSize!=0, hSize > zds->lhSize */\n                    size_t const remainingInput = (size_t)(iend-ip);\n                    assert(iend >= ip);\n                    if (toLoad > remainingInput) {   /* not enough input to load full header */\n                        if (remainingInput > 0) {\n                            ZSTD_memcpy(zds->headerBuffer + zds->lhSize, ip, remainingInput);\n                            zds->lhSize += remainingInput;\n                        }\n                        input->pos = input->size;\n                        /* check first few bytes */\n                        FORWARD_IF_ERROR(\n                            ZSTD_getFrameHeader_advanced(&zds->fParams, zds->headerBuffer, zds->lhSize, zds->format),\n                            \"First few bytes detected incorrect\" );\n                        /* return hint input size */\n                        return (MAX((size_t)ZSTD_FRAMEHEADERSIZE_MIN(zds->format), hSize) - zds->lhSize) + ZSTD_blockHeaderSize;   /* remaining header bytes + next block header */\n                    }\n                    assert(ip != NULL);\n                    ZSTD_memcpy(zds->headerBuffer + zds->lhSize, ip, toLoad); zds->lhSize = hSize; ip += toLoad;\n                    break;\n            }   }\n\n            /* check for single-pass mode opportunity */\n            if (zds->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN\n                && zds->fParams.frameType != ZSTD_skippableFrame\n                && (U64)(size_t)(oend-op) >= zds->fParams.frameContentSize) {\n                size_t const cSize = ZSTD_findFrameCompressedSize_advanced(istart, (size_t)(iend-istart), zds->format);\n                if (cSize <= (size_t)(iend-istart)) {\n                    /* shortcut : using single-pass mode */\n                    size_t const decompressedSize = ZSTD_decompress_usingDDict(zds, op, (size_t)(oend-op), istart, cSize, ZSTD_getDDict(zds));\n                    if (ZSTD_isError(decompressedSize)) return decompressedSize;\n                    DEBUGLOG(4, \"shortcut to single-pass ZSTD_decompress_usingDDict()\");\n                    assert(istart != NULL);\n                    ip = istart + cSize;\n                    op = op ? op + decompressedSize : op; /* can occur if frameContentSize = 0 (empty frame) */\n                    zds->expected = 0;\n                    zds->streamStage = zdss_init;\n                    someMoreWork = 0;\n                    break;\n            }   }\n\n            /* Check output buffer is large enough for ZSTD_odm_stable. */\n            if (zds->outBufferMode == ZSTD_bm_stable\n                && zds->fParams.frameType != ZSTD_skippableFrame\n                && zds->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN\n                && (U64)(size_t)(oend-op) < zds->fParams.frameContentSize) {\n                RETURN_ERROR(dstSize_tooSmall, \"ZSTD_obm_stable passed but ZSTD_outBuffer is too small\");\n            }\n\n            /* Consume header (see ZSTDds_decodeFrameHeader) */\n            DEBUGLOG(4, \"Consume header\");\n            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDDict(zds, ZSTD_getDDict(zds)), \"\");\n\n            if (zds->format == ZSTD_f_zstd1\n                && (MEM_readLE32(zds->headerBuffer) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {  /* skippable frame */\n                zds->expected = MEM_readLE32(zds->headerBuffer + ZSTD_FRAMEIDSIZE);\n                zds->stage = ZSTDds_skipFrame;\n            } else {\n                FORWARD_IF_ERROR(ZSTD_decodeFrameHeader(zds, zds->headerBuffer, zds->lhSize), \"\");\n                zds->expected = ZSTD_blockHeaderSize;\n                zds->stage = ZSTDds_decodeBlockHeader;\n            }\n\n            /* control buffer memory usage */\n            DEBUGLOG(4, \"Control max memory usage (%u KB <= max %u KB)\",\n                        (U32)(zds->fParams.windowSize >>10),\n                        (U32)(zds->maxWindowSize >> 10) );\n            zds->fParams.windowSize = MAX(zds->fParams.windowSize, 1U << ZSTD_WINDOWLOG_ABSOLUTEMIN);\n            RETURN_ERROR_IF(zds->fParams.windowSize > zds->maxWindowSize,\n                            frameParameter_windowTooLarge, \"\");\n            if (zds->maxBlockSizeParam != 0)\n                zds->fParams.blockSizeMax = MIN(zds->fParams.blockSizeMax, (unsigned)zds->maxBlockSizeParam);\n\n            /* Adapt buffer sizes to frame header instructions */\n            {   size_t const neededInBuffSize = MAX(zds->fParams.blockSizeMax, 4 /* frame checksum */);\n                size_t const neededOutBuffSize = zds->outBufferMode == ZSTD_bm_buffered\n                        ? ZSTD_decodingBufferSize_internal(zds->fParams.windowSize, zds->fParams.frameContentSize, zds->fParams.blockSizeMax)\n                        : 0;\n\n                ZSTD_DCtx_updateOversizedDuration(zds, neededInBuffSize, neededOutBuffSize);\n\n                {   int const tooSmall = (zds->inBuffSize < neededInBuffSize) || (zds->outBuffSize < neededOutBuffSize);\n                    int const tooLarge = ZSTD_DCtx_isOversizedTooLong(zds);\n\n                    if (tooSmall || tooLarge) {\n                        size_t const bufferSize = neededInBuffSize + neededOutBuffSize;\n                        DEBUGLOG(4, \"inBuff  : from %u to %u\",\n                                    (U32)zds->inBuffSize, (U32)neededInBuffSize);\n                        DEBUGLOG(4, \"outBuff : from %u to %u\",\n                                    (U32)zds->outBuffSize, (U32)neededOutBuffSize);\n                        if (zds->staticSize) {  /* static DCtx */\n                            DEBUGLOG(4, \"staticSize : %u\", (U32)zds->staticSize);\n                            assert(zds->staticSize >= sizeof(ZSTD_DCtx));  /* controlled at init */\n                            RETURN_ERROR_IF(\n                                bufferSize > zds->staticSize - sizeof(ZSTD_DCtx),\n                                memory_allocation, \"\");\n                        } else {\n                            ZSTD_customFree(zds->inBuff, zds->customMem);\n                            zds->inBuffSize = 0;\n                            zds->outBuffSize = 0;\n                            zds->inBuff = (char*)ZSTD_customMalloc(bufferSize, zds->customMem);\n                            RETURN_ERROR_IF(zds->inBuff == NULL, memory_allocation, \"\");\n                        }\n                        zds->inBuffSize = neededInBuffSize;\n                        zds->outBuff = zds->inBuff + zds->inBuffSize;\n                        zds->outBuffSize = neededOutBuffSize;\n            }   }   }\n            zds->streamStage = zdss_read;\n            ZSTD_FALLTHROUGH;\n\n        case zdss_read:\n            DEBUGLOG(5, \"stage zdss_read\");\n            {   size_t const neededInSize = ZSTD_nextSrcSizeToDecompressWithInputSize(zds, (size_t)(iend - ip));\n                DEBUGLOG(5, \"neededInSize = %u\", (U32)neededInSize);\n                if (neededInSize==0) {  /* end of frame */\n                    zds->streamStage = zdss_init;\n                    someMoreWork = 0;\n                    break;\n                }\n                if ((size_t)(iend-ip) >= neededInSize) {  /* decode directly from src */\n                    FORWARD_IF_ERROR(ZSTD_decompressContinueStream(zds, &op, oend, ip, neededInSize), \"\");\n                    assert(ip != NULL);\n                    ip += neededInSize;\n                    /* Function modifies the stage so we must break */\n                    break;\n            }   }\n            if (ip==iend) { someMoreWork = 0; break; }   /* no more input */\n            zds->streamStage = zdss_load;\n            ZSTD_FALLTHROUGH;\n\n        case zdss_load:\n            {   size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds);\n                size_t const toLoad = neededInSize - zds->inPos;\n                int const isSkipFrame = ZSTD_isSkipFrame(zds);\n                size_t loadedSize;\n                /* At this point we shouldn't be decompressing a block that we can stream. */\n                assert(neededInSize == ZSTD_nextSrcSizeToDecompressWithInputSize(zds, (size_t)(iend - ip)));\n                if (isSkipFrame) {\n                    loadedSize = MIN(toLoad, (size_t)(iend-ip));\n                } else {\n                    RETURN_ERROR_IF(toLoad > zds->inBuffSize - zds->inPos,\n                                    corruption_detected,\n                                    \"should never happen\");\n                    loadedSize = ZSTD_limitCopy(zds->inBuff + zds->inPos, toLoad, ip, (size_t)(iend-ip));\n                }\n                if (loadedSize != 0) {\n                    /* ip may be NULL */\n                    ip += loadedSize;\n                    zds->inPos += loadedSize;\n                }\n                if (loadedSize < toLoad) { someMoreWork = 0; break; }   /* not enough input, wait for more */\n\n                /* decode loaded input */\n                zds->inPos = 0;   /* input is consumed */\n                FORWARD_IF_ERROR(ZSTD_decompressContinueStream(zds, &op, oend, zds->inBuff, neededInSize), \"\");\n                /* Function modifies the stage so we must break */\n                break;\n            }\n        case zdss_flush:\n            {\n                size_t const toFlushSize = zds->outEnd - zds->outStart;\n                size_t const flushedSize = ZSTD_limitCopy(op, (size_t)(oend-op), zds->outBuff + zds->outStart, toFlushSize);\n\n                op = op ? op + flushedSize : op;\n\n                zds->outStart += flushedSize;\n                if (flushedSize == toFlushSize) {  /* flush completed */\n                    zds->streamStage = zdss_read;\n                    if ( (zds->outBuffSize < zds->fParams.frameContentSize)\n                        && (zds->outStart + zds->fParams.blockSizeMax > zds->outBuffSize) ) {\n                        DEBUGLOG(5, \"restart filling outBuff from beginning (left:%i, needed:%u)\",\n                                (int)(zds->outBuffSize - zds->outStart),\n                                (U32)zds->fParams.blockSizeMax);\n                        zds->outStart = zds->outEnd = 0;\n                    }\n                    break;\n            }   }\n            /* cannot complete flush */\n            someMoreWork = 0;\n            break;\n\n        default:\n            assert(0);    /* impossible */\n            RETURN_ERROR(GENERIC, \"impossible to reach\");   /* some compilers require default to do something */\n    }   }\n\n    /* result */\n    input->pos = (size_t)(ip - (const char*)(input->src));\n    output->pos = (size_t)(op - (char*)(output->dst));\n\n    /* Update the expected output buffer for ZSTD_obm_stable. */\n    zds->expectedOutBuffer = *output;\n\n    if ((ip==istart) && (op==ostart)) {  /* no forward progress */\n        zds->noForwardProgress ++;\n        if (zds->noForwardProgress >= ZSTD_NO_FORWARD_PROGRESS_MAX) {\n            RETURN_ERROR_IF(op==oend, noForwardProgress_destFull, \"\");\n            RETURN_ERROR_IF(ip==iend, noForwardProgress_inputEmpty, \"\");\n            assert(0);\n        }\n    } else {\n        zds->noForwardProgress = 0;\n    }\n    {   size_t nextSrcSizeHint = ZSTD_nextSrcSizeToDecompress(zds);\n        if (!nextSrcSizeHint) {   /* frame fully decoded */\n            if (zds->outEnd == zds->outStart) {  /* output fully flushed */\n                if (zds->hostageByte) {\n                    if (input->pos >= input->size) {\n                        /* can't release hostage (not present) */\n                        zds->streamStage = zdss_read;\n                        return 1;\n                    }\n                    input->pos++;  /* release hostage */\n                }   /* zds->hostageByte */\n                return 0;\n            }  /* zds->outEnd == zds->outStart */\n            if (!zds->hostageByte) { /* output not fully flushed; keep last byte as hostage; will be released when all output is flushed */\n                input->pos--;   /* note : pos > 0, otherwise, impossible to finish reading last block */\n                zds->hostageByte=1;\n            }\n            return 1;\n        }  /* nextSrcSizeHint==0 */\n        nextSrcSizeHint += ZSTD_blockHeaderSize * (ZSTD_nextInputType(zds) == ZSTDnit_block);   /* preload header of next block */\n        assert(zds->inPos <= nextSrcSizeHint);\n        nextSrcSizeHint -= zds->inPos;   /* part already loaded*/\n        return nextSrcSizeHint;\n    }\n}\n\nsize_t ZSTD_decompressStream_simpleArgs (\n                            ZSTD_DCtx* dctx,\n                            void* dst, size_t dstCapacity, size_t* dstPos,\n                      const void* src, size_t srcSize, size_t* srcPos)\n{\n    ZSTD_outBuffer output;\n    ZSTD_inBuffer  input;\n    output.dst = dst;\n    output.size = dstCapacity;\n    output.pos = *dstPos;\n    input.src = src;\n    input.size = srcSize;\n    input.pos = *srcPos;\n    {   size_t const cErr = ZSTD_decompressStream(dctx, &output, &input);\n        *dstPos = output.pos;\n        *srcPos = input.pos;\n        return cErr;\n    }\n}\n"
  },
  {
    "path": "src/bled/zstd_decompress_block.c",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/* zstd_decompress_block :\n * this module takes care of decompressing _compressed_ block */\n\n/*-*******************************************************\n*  Dependencies\n*********************************************************/\n#include \"zstd_deps.h\"        /* ZSTD_memcpy, ZSTD_memmove, ZSTD_memset */\n#include \"zstd_compiler.h\"    /* prefetch */\n#include \"zstd_cpu.h\"         /* bmi2 */\n#include \"zstd_mem.h\"         /* low level memory routines */\n#define FSE_STATIC_LINKING_ONLY\n#include \"fse.h\"\n#define HUF_STATIC_LINKING_ONLY\n#include \"huf.h\"\n#include \"zstd_internal.h\"\n#include \"zstd_decompress_internal.h\"   /* ZSTD_DCtx */\n#include \"zstd_ddict.h\"       /* ZSTD_DDictDictContent */\n#include \"zstd_decompress_block.h\"\n#include \"zstd_bits.h\"        /* ZSTD_highbit32 */\n\n/*_*******************************************************\n*  Macros\n**********************************************************/\n\n/* These two optional macros force the use one way or another of the two\n * ZSTD_decompressSequences implementations. You can't force in both directions\n * at the same time.\n */\n#if defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \\\n    defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)\n#error \"Cannot force the use of the short and the long ZSTD_decompressSequences variants!\"\n#endif\n\n\n/*_*******************************************************\n*  Memory operations\n**********************************************************/\nstatic void ZSTD_copy4(void* dst, const void* src) { ZSTD_memcpy(dst, src, 4); }\n\n\n/*-*************************************************************\n *   Block decoding\n ***************************************************************/\n\nstatic size_t ZSTD_blockSizeMax(ZSTD_DCtx const* dctx)\n{\n    size_t const blockSizeMax = dctx->isFrameDecompression ? dctx->fParams.blockSizeMax : ZSTD_BLOCKSIZE_MAX;\n    assert(blockSizeMax <= ZSTD_BLOCKSIZE_MAX);\n    return blockSizeMax;\n}\n\n/*! ZSTD_getcBlockSize() :\n *  Provides the size of compressed block from block header `src` */\nsize_t ZSTD_getcBlockSize(const void* src, size_t srcSize,\n                          blockProperties_t* bpPtr)\n{\n    RETURN_ERROR_IF(srcSize < ZSTD_blockHeaderSize, srcSize_wrong, \"\");\n\n    {   U32 const cBlockHeader = MEM_readLE24(src);\n        U32 const cSize = cBlockHeader >> 3;\n        bpPtr->lastBlock = cBlockHeader & 1;\n        bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3);\n        bpPtr->origSize = cSize;   /* only useful for RLE */\n        if (bpPtr->blockType == bt_rle) return 1;\n        RETURN_ERROR_IF(bpPtr->blockType == bt_reserved, corruption_detected, \"\");\n        return cSize;\n    }\n}\n\n/* Allocate buffer for literals, either overlapping current dst, or split between dst and litExtraBuffer, or stored entirely within litExtraBuffer */\nstatic void ZSTD_allocateLiteralsBuffer(ZSTD_DCtx* dctx, void* const dst, const size_t dstCapacity, const size_t litSize,\n    const streaming_operation streaming, const size_t expectedWriteSize, const unsigned splitImmediately)\n{\n    size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);\n    assert(litSize <= blockSizeMax);\n    assert(dctx->isFrameDecompression || streaming == not_streaming);\n    assert(expectedWriteSize <= blockSizeMax);\n    if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {\n        /* If we aren't streaming, we can just put the literals after the output\n         * of the current block. We don't need to worry about overwriting the\n         * extDict of our window, because it doesn't exist.\n         * So if we have space after the end of the block, just put it there.\n         */\n        dctx->litBuffer = (BYTE*)dst + blockSizeMax + WILDCOPY_OVERLENGTH;\n        dctx->litBufferEnd = dctx->litBuffer + litSize;\n        dctx->litBufferLocation = ZSTD_in_dst;\n    } else if (litSize <= ZSTD_LITBUFFEREXTRASIZE) {\n        /* Literals fit entirely within the extra buffer, put them there to avoid\n         * having to split the literals.\n         */\n        dctx->litBuffer = dctx->litExtraBuffer;\n        dctx->litBufferEnd = dctx->litBuffer + litSize;\n        dctx->litBufferLocation = ZSTD_not_in_dst;\n    } else {\n        assert(blockSizeMax > ZSTD_LITBUFFEREXTRASIZE);\n        /* Literals must be split between the output block and the extra lit\n         * buffer. We fill the extra lit buffer with the tail of the literals,\n         * and put the rest of the literals at the end of the block, with\n         * WILDCOPY_OVERLENGTH of buffer room to allow for overreads.\n         * This MUST not write more than our maxBlockSize beyond dst, because in\n         * streaming mode, that could overwrite part of our extDict window.\n         */\n        if (splitImmediately) {\n            /* won't fit in litExtraBuffer, so it will be split between end of dst and extra buffer */\n            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;\n            dctx->litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE;\n        } else {\n            /* initially this will be stored entirely in dst during huffman decoding, it will partially be shifted to litExtraBuffer after */\n            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize;\n            dctx->litBufferEnd = (BYTE*)dst + expectedWriteSize;\n        }\n        dctx->litBufferLocation = ZSTD_split;\n        assert(dctx->litBufferEnd <= (BYTE*)dst + expectedWriteSize);\n    }\n}\n\n/*! ZSTD_decodeLiteralsBlock() :\n * Where it is possible to do so without being stomped by the output during decompression, the literals block will be stored\n * in the dstBuffer.  If there is room to do so, it will be stored in full in the excess dst space after where the current\n * block will be output.  Otherwise it will be stored at the end of the current dst blockspace, with a small portion being\n * stored in dctx->litExtraBuffer to help keep it \"ahead\" of the current output write.\n *\n * @return : nb of bytes read from src (< srcSize )\n *  note : symbol not declared but exposed for fullbench */\nstatic size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,\n                          const void* src, size_t srcSize,   /* note : srcSize < BLOCKSIZE */\n                          void* dst, size_t dstCapacity, const streaming_operation streaming)\n{\n    DEBUGLOG(5, \"ZSTD_decodeLiteralsBlock\");\n    RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected, \"\");\n\n    {   const BYTE* const istart = (const BYTE*) src;\n        symbolEncodingType_e const litEncType = (symbolEncodingType_e)(istart[0] & 3);\n        size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);\n\n        switch(litEncType)\n        {\n        case set_repeat:\n            DEBUGLOG(5, \"set_repeat flag : re-using stats from previous compressed literals block\");\n            RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted, \"\");\n            ZSTD_FALLTHROUGH;\n\n        case set_compressed:\n            RETURN_ERROR_IF(srcSize < 5, corruption_detected, \"srcSize >= MIN_CBLOCK_SIZE == 2; here we need up to 5 for case 3\");\n            {   size_t lhSize, litSize, litCSize;\n                U32 singleStream=0;\n                U32 const lhlCode = (istart[0] >> 2) & 3;\n                U32 const lhc = MEM_readLE32(istart);\n                size_t hufSuccess;\n                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);\n                int const flags = 0\n                    | (ZSTD_DCtx_get_bmi2(dctx) ? HUF_flags_bmi2 : 0)\n                    | (dctx->disableHufAsm ? HUF_flags_disableAsm : 0);\n                switch(lhlCode)\n                {\n                case 0: case 1: default:   /* note : default is impossible, since lhlCode into [0..3] */\n                    /* 2 - 2 - 10 - 10 */\n                    singleStream = !lhlCode;\n                    lhSize = 3;\n                    litSize  = (lhc >> 4) & 0x3FF;\n                    litCSize = (lhc >> 14) & 0x3FF;\n                    break;\n                case 2:\n                    /* 2 - 2 - 14 - 14 */\n                    lhSize = 4;\n                    litSize  = (lhc >> 4) & 0x3FFF;\n                    litCSize = lhc >> 18;\n                    break;\n                case 3:\n                    /* 2 - 2 - 18 - 18 */\n                    lhSize = 5;\n                    litSize  = (lhc >> 4) & 0x3FFFF;\n                    litCSize = (lhc >> 22) + ((size_t)istart[4] << 10);\n                    break;\n                }\n                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, \"NULL not handled\");\n                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, \"\");\n                if (!singleStream)\n                    RETURN_ERROR_IF(litSize < MIN_LITERALS_FOR_4_STREAMS, literals_headerWrong,\n                        \"Not enough literals (%zu) for the 4-streams mode (min %u)\",\n                        litSize, MIN_LITERALS_FOR_4_STREAMS);\n                RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, \"\");\n                RETURN_ERROR_IF(expectedWriteSize < litSize , dstSize_tooSmall, \"\");\n                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 0);\n\n                /* prefetch huffman table if cold */\n                if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) {\n                    PREFETCH_AREA(dctx->HUFptr, sizeof(dctx->entropy.hufTable));\n                }\n\n                if (litEncType==set_repeat) {\n                    if (singleStream) {\n                        hufSuccess = HUF_decompress1X_usingDTable(\n                            dctx->litBuffer, litSize, istart+lhSize, litCSize,\n                            dctx->HUFptr, flags);\n                    } else {\n                        assert(litSize >= MIN_LITERALS_FOR_4_STREAMS);\n                        hufSuccess = HUF_decompress4X_usingDTable(\n                            dctx->litBuffer, litSize, istart+lhSize, litCSize,\n                            dctx->HUFptr, flags);\n                    }\n                } else {\n                    if (singleStream) {\n#if defined(HUF_FORCE_DECOMPRESS_X2)\n                        hufSuccess = HUF_decompress1X_DCtx_wksp(\n                            dctx->entropy.hufTable, dctx->litBuffer, litSize,\n                            istart+lhSize, litCSize, dctx->workspace,\n                            sizeof(dctx->workspace), flags);\n#else\n                        hufSuccess = HUF_decompress1X1_DCtx_wksp(\n                            dctx->entropy.hufTable, dctx->litBuffer, litSize,\n                            istart+lhSize, litCSize, dctx->workspace,\n                            sizeof(dctx->workspace), flags);\n#endif\n                    } else {\n                        hufSuccess = HUF_decompress4X_hufOnly_wksp(\n                            dctx->entropy.hufTable, dctx->litBuffer, litSize,\n                            istart+lhSize, litCSize, dctx->workspace,\n                            sizeof(dctx->workspace), flags);\n                    }\n                }\n                if (dctx->litBufferLocation == ZSTD_split)\n                {\n                    assert(litSize > ZSTD_LITBUFFEREXTRASIZE);\n                    ZSTD_memcpy(dctx->litExtraBuffer, dctx->litBufferEnd - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE);\n                    ZSTD_memmove(dctx->litBuffer + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH, dctx->litBuffer, litSize - ZSTD_LITBUFFEREXTRASIZE);\n                    dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;\n                    dctx->litBufferEnd -= WILDCOPY_OVERLENGTH;\n                    assert(dctx->litBufferEnd <= (BYTE*)dst + blockSizeMax);\n                }\n\n                RETURN_ERROR_IF(HUF_isError(hufSuccess), corruption_detected, \"\");\n\n                dctx->litPtr = dctx->litBuffer;\n                dctx->litSize = litSize;\n                dctx->litEntropy = 1;\n                if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable;\n                return litCSize + lhSize;\n            }\n\n        case set_basic:\n            {   size_t litSize, lhSize;\n                U32 const lhlCode = ((istart[0]) >> 2) & 3;\n                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);\n                switch(lhlCode)\n                {\n                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */\n                    lhSize = 1;\n                    litSize = istart[0] >> 3;\n                    break;\n                case 1:\n                    lhSize = 2;\n                    litSize = MEM_readLE16(istart) >> 4;\n                    break;\n                case 3:\n                    lhSize = 3;\n                    RETURN_ERROR_IF(srcSize<3, corruption_detected, \"srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize = 3\");\n                    litSize = MEM_readLE24(istart) >> 4;\n                    break;\n                }\n\n                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, \"NULL not handled\");\n                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, \"\");\n                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, \"\");\n                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);\n                if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */\n                    RETURN_ERROR_IF(litSize+lhSize > srcSize, corruption_detected, \"\");\n                    if (dctx->litBufferLocation == ZSTD_split)\n                    {\n                        ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize - ZSTD_LITBUFFEREXTRASIZE);\n                        ZSTD_memcpy(dctx->litExtraBuffer, istart + lhSize + litSize - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE);\n                    }\n                    else\n                    {\n                        ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize);\n                    }\n                    dctx->litPtr = dctx->litBuffer;\n                    dctx->litSize = litSize;\n                    return lhSize+litSize;\n                }\n                /* direct reference into compressed stream */\n                dctx->litPtr = istart+lhSize;\n                dctx->litSize = litSize;\n                dctx->litBufferEnd = dctx->litPtr + litSize;\n                dctx->litBufferLocation = ZSTD_not_in_dst;\n                return lhSize+litSize;\n            }\n\n        case set_rle:\n            {   U32 const lhlCode = ((istart[0]) >> 2) & 3;\n                size_t litSize, lhSize;\n                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);\n                switch(lhlCode)\n                {\n                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */\n                    lhSize = 1;\n                    litSize = istart[0] >> 3;\n                    break;\n                case 1:\n                    lhSize = 2;\n                    RETURN_ERROR_IF(srcSize<3, corruption_detected, \"srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 3\");\n                    litSize = MEM_readLE16(istart) >> 4;\n                    break;\n                case 3:\n                    lhSize = 3;\n                    RETURN_ERROR_IF(srcSize<4, corruption_detected, \"srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 4\");\n                    litSize = MEM_readLE24(istart) >> 4;\n                    break;\n                }\n                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, \"NULL not handled\");\n                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, \"\");\n                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, \"\");\n                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);\n                if (dctx->litBufferLocation == ZSTD_split)\n                {\n                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize - ZSTD_LITBUFFEREXTRASIZE);\n                    ZSTD_memset(dctx->litExtraBuffer, istart[lhSize], ZSTD_LITBUFFEREXTRASIZE);\n                }\n                else\n                {\n                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize);\n                }\n                dctx->litPtr = dctx->litBuffer;\n                dctx->litSize = litSize;\n                return lhSize+1;\n            }\n        default:\n            RETURN_ERROR(corruption_detected, \"impossible\");\n        }\n    }\n}\n\n/* Hidden declaration for fullbench */\nsize_t ZSTD_decodeLiteralsBlock_wrapper(ZSTD_DCtx* dctx,\n                          const void* src, size_t srcSize,\n                          void* dst, size_t dstCapacity);\nsize_t ZSTD_decodeLiteralsBlock_wrapper(ZSTD_DCtx* dctx,\n                          const void* src, size_t srcSize,\n                          void* dst, size_t dstCapacity)\n{\n    dctx->isFrameDecompression = 0;\n    return ZSTD_decodeLiteralsBlock(dctx, src, srcSize, dst, dstCapacity, not_streaming);\n}\n\n/* Default FSE distribution tables.\n * These are pre-calculated FSE decoding tables using default distributions as defined in specification :\n * https://github.com/facebook/zstd/blob/release/doc/zstd_compression_format.md#default-distributions\n * They were generated programmatically with following method :\n * - start from default distributions, present in /lib/common/zstd_internal.h\n * - generate tables normally, using ZSTD_buildFSETable()\n * - printout the content of tables\n * - prettify output, report below, test with fuzzer to ensure it's correct */\n\n/* Default FSE distribution table for Literal Lengths */\nstatic const ZSTD_seqSymbol LL_defaultDTable[(1<<LL_DEFAULTNORMLOG)+1] = {\n     {  1,  1,  1, LL_DEFAULTNORMLOG},  /* header : fastMode, tableLog */\n     /* nextState, nbAddBits, nbBits, baseVal */\n     {  0,  0,  4,    0},  { 16,  0,  4,    0},\n     { 32,  0,  5,    1},  {  0,  0,  5,    3},\n     {  0,  0,  5,    4},  {  0,  0,  5,    6},\n     {  0,  0,  5,    7},  {  0,  0,  5,    9},\n     {  0,  0,  5,   10},  {  0,  0,  5,   12},\n     {  0,  0,  6,   14},  {  0,  1,  5,   16},\n     {  0,  1,  5,   20},  {  0,  1,  5,   22},\n     {  0,  2,  5,   28},  {  0,  3,  5,   32},\n     {  0,  4,  5,   48},  { 32,  6,  5,   64},\n     {  0,  7,  5,  128},  {  0,  8,  6,  256},\n     {  0, 10,  6, 1024},  {  0, 12,  6, 4096},\n     { 32,  0,  4,    0},  {  0,  0,  4,    1},\n     {  0,  0,  5,    2},  { 32,  0,  5,    4},\n     {  0,  0,  5,    5},  { 32,  0,  5,    7},\n     {  0,  0,  5,    8},  { 32,  0,  5,   10},\n     {  0,  0,  5,   11},  {  0,  0,  6,   13},\n     { 32,  1,  5,   16},  {  0,  1,  5,   18},\n     { 32,  1,  5,   22},  {  0,  2,  5,   24},\n     { 32,  3,  5,   32},  {  0,  3,  5,   40},\n     {  0,  6,  4,   64},  { 16,  6,  4,   64},\n     { 32,  7,  5,  128},  {  0,  9,  6,  512},\n     {  0, 11,  6, 2048},  { 48,  0,  4,    0},\n     { 16,  0,  4,    1},  { 32,  0,  5,    2},\n     { 32,  0,  5,    3},  { 32,  0,  5,    5},\n     { 32,  0,  5,    6},  { 32,  0,  5,    8},\n     { 32,  0,  5,    9},  { 32,  0,  5,   11},\n     { 32,  0,  5,   12},  {  0,  0,  6,   15},\n     { 32,  1,  5,   18},  { 32,  1,  5,   20},\n     { 32,  2,  5,   24},  { 32,  2,  5,   28},\n     { 32,  3,  5,   40},  { 32,  4,  5,   48},\n     {  0, 16,  6,65536},  {  0, 15,  6,32768},\n     {  0, 14,  6,16384},  {  0, 13,  6, 8192},\n};   /* LL_defaultDTable */\n\n/* Default FSE distribution table for Offset Codes */\nstatic const ZSTD_seqSymbol OF_defaultDTable[(1<<OF_DEFAULTNORMLOG)+1] = {\n    {  1,  1,  1, OF_DEFAULTNORMLOG},  /* header : fastMode, tableLog */\n    /* nextState, nbAddBits, nbBits, baseVal */\n    {  0,  0,  5,    0},     {  0,  6,  4,   61},\n    {  0,  9,  5,  509},     {  0, 15,  5,32765},\n    {  0, 21,  5,2097149},   {  0,  3,  5,    5},\n    {  0,  7,  4,  125},     {  0, 12,  5, 4093},\n    {  0, 18,  5,262141},    {  0, 23,  5,8388605},\n    {  0,  5,  5,   29},     {  0,  8,  4,  253},\n    {  0, 14,  5,16381},     {  0, 20,  5,1048573},\n    {  0,  2,  5,    1},     { 16,  7,  4,  125},\n    {  0, 11,  5, 2045},     {  0, 17,  5,131069},\n    {  0, 22,  5,4194301},   {  0,  4,  5,   13},\n    { 16,  8,  4,  253},     {  0, 13,  5, 8189},\n    {  0, 19,  5,524285},    {  0,  1,  5,    1},\n    { 16,  6,  4,   61},     {  0, 10,  5, 1021},\n    {  0, 16,  5,65533},     {  0, 28,  5,268435453},\n    {  0, 27,  5,134217725}, {  0, 26,  5,67108861},\n    {  0, 25,  5,33554429},  {  0, 24,  5,16777213},\n};   /* OF_defaultDTable */\n\n\n/* Default FSE distribution table for Match Lengths */\nstatic const ZSTD_seqSymbol ML_defaultDTable[(1<<ML_DEFAULTNORMLOG)+1] = {\n    {  1,  1,  1, ML_DEFAULTNORMLOG},  /* header : fastMode, tableLog */\n    /* nextState, nbAddBits, nbBits, baseVal */\n    {  0,  0,  6,    3},  {  0,  0,  4,    4},\n    { 32,  0,  5,    5},  {  0,  0,  5,    6},\n    {  0,  0,  5,    8},  {  0,  0,  5,    9},\n    {  0,  0,  5,   11},  {  0,  0,  6,   13},\n    {  0,  0,  6,   16},  {  0,  0,  6,   19},\n    {  0,  0,  6,   22},  {  0,  0,  6,   25},\n    {  0,  0,  6,   28},  {  0,  0,  6,   31},\n    {  0,  0,  6,   34},  {  0,  1,  6,   37},\n    {  0,  1,  6,   41},  {  0,  2,  6,   47},\n    {  0,  3,  6,   59},  {  0,  4,  6,   83},\n    {  0,  7,  6,  131},  {  0,  9,  6,  515},\n    { 16,  0,  4,    4},  {  0,  0,  4,    5},\n    { 32,  0,  5,    6},  {  0,  0,  5,    7},\n    { 32,  0,  5,    9},  {  0,  0,  5,   10},\n    {  0,  0,  6,   12},  {  0,  0,  6,   15},\n    {  0,  0,  6,   18},  {  0,  0,  6,   21},\n    {  0,  0,  6,   24},  {  0,  0,  6,   27},\n    {  0,  0,  6,   30},  {  0,  0,  6,   33},\n    {  0,  1,  6,   35},  {  0,  1,  6,   39},\n    {  0,  2,  6,   43},  {  0,  3,  6,   51},\n    {  0,  4,  6,   67},  {  0,  5,  6,   99},\n    {  0,  8,  6,  259},  { 32,  0,  4,    4},\n    { 48,  0,  4,    4},  { 16,  0,  4,    5},\n    { 32,  0,  5,    7},  { 32,  0,  5,    8},\n    { 32,  0,  5,   10},  { 32,  0,  5,   11},\n    {  0,  0,  6,   14},  {  0,  0,  6,   17},\n    {  0,  0,  6,   20},  {  0,  0,  6,   23},\n    {  0,  0,  6,   26},  {  0,  0,  6,   29},\n    {  0,  0,  6,   32},  {  0, 16,  6,65539},\n    {  0, 15,  6,32771},  {  0, 14,  6,16387},\n    {  0, 13,  6, 8195},  {  0, 12,  6, 4099},\n    {  0, 11,  6, 2051},  {  0, 10,  6, 1027},\n};   /* ML_defaultDTable */\n\n\nstatic void ZSTD_buildSeqTable_rle(ZSTD_seqSymbol* dt, U32 baseValue, U8 nbAddBits)\n{\n    void* ptr = dt;\n    ZSTD_seqSymbol_header* const DTableH = (ZSTD_seqSymbol_header*)ptr;\n    ZSTD_seqSymbol* const cell = dt + 1;\n\n    DTableH->tableLog = 0;\n    DTableH->fastMode = 0;\n\n    cell->nbBits = 0;\n    cell->nextState = 0;\n    assert(nbAddBits < 255);\n    cell->nbAdditionalBits = nbAddBits;\n    cell->baseValue = baseValue;\n}\n\n\n/* ZSTD_buildFSETable() :\n * generate FSE decoding table for one symbol (ll, ml or off)\n * cannot fail if input is valid =>\n * all inputs are presumed validated at this stage */\nFORCE_INLINE_TEMPLATE\nvoid ZSTD_buildFSETable_body(ZSTD_seqSymbol* dt,\n            const short* normalizedCounter, unsigned maxSymbolValue,\n            const U32* baseValue, const U8* nbAdditionalBits,\n            unsigned tableLog, void* wksp, size_t wkspSize)\n{\n    ZSTD_seqSymbol* const tableDecode = dt+1;\n    U32 const maxSV1 = maxSymbolValue + 1;\n    U32 const tableSize = 1 << tableLog;\n\n    U16* symbolNext = (U16*)wksp;\n    BYTE* spread = (BYTE*)(symbolNext + MaxSeq + 1);\n    U32 highThreshold = tableSize - 1;\n\n\n    /* Sanity Checks */\n    assert(maxSymbolValue <= MaxSeq);\n    assert(tableLog <= MaxFSELog);\n    assert(wkspSize >= ZSTD_BUILD_FSE_TABLE_WKSP_SIZE);\n    (void)wkspSize;\n    /* Init, lay down lowprob symbols */\n    {   ZSTD_seqSymbol_header DTableH;\n        DTableH.tableLog = tableLog;\n        DTableH.fastMode = 1;\n        {   S16 const largeLimit= (S16)(1 << (tableLog-1));\n            U32 s;\n            for (s=0; s<maxSV1; s++) {\n                if (normalizedCounter[s]==-1) {\n                    tableDecode[highThreshold--].baseValue = s;\n                    symbolNext[s] = 1;\n                } else {\n                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;\n                    assert(normalizedCounter[s]>=0);\n                    symbolNext[s] = (U16)normalizedCounter[s];\n        }   }   }\n        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));\n    }\n\n    /* Spread symbols */\n    assert(tableSize <= 512);\n    /* Specialized symbol spreading for the case when there are\n     * no low probability (-1 count) symbols. When compressing\n     * small blocks we avoid low probability symbols to hit this\n     * case, since header decoding speed matters more.\n     */\n    if (highThreshold == tableSize - 1) {\n        size_t const tableMask = tableSize-1;\n        size_t const step = FSE_TABLESTEP(tableSize);\n        /* First lay down the symbols in order.\n         * We use a uint64_t to lay down 8 bytes at a time. This reduces branch\n         * misses since small blocks generally have small table logs, so nearly\n         * all symbols have counts <= 8. We ensure we have 8 bytes at the end of\n         * our buffer to handle the over-write.\n         */\n        {\n            U64 const add = 0x0101010101010101ull;\n            size_t pos = 0;\n            U64 sv = 0;\n            U32 s;\n            for (s=0; s<maxSV1; ++s, sv += add) {\n                int i;\n                int const n = normalizedCounter[s];\n                MEM_write64(spread + pos, sv);\n                for (i = 8; i < n; i += 8) {\n                    MEM_write64(spread + pos + i, sv);\n                }\n                assert(n>=0);\n                pos += (size_t)n;\n            }\n        }\n        /* Now we spread those positions across the table.\n         * The benefit of doing it in two stages is that we avoid the\n         * variable size inner loop, which caused lots of branch misses.\n         * Now we can run through all the positions without any branch misses.\n         * We unroll the loop twice, since that is what empirically worked best.\n         */\n        {\n            size_t position = 0;\n            size_t s;\n            size_t const unroll = 2;\n            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */\n            for (s = 0; s < (size_t)tableSize; s += unroll) {\n                size_t u;\n                for (u = 0; u < unroll; ++u) {\n                    size_t const uPosition = (position + (u * step)) & tableMask;\n                    tableDecode[uPosition].baseValue = spread[s + u];\n                }\n                position = (position + (unroll * step)) & tableMask;\n            }\n            assert(position == 0);\n        }\n    } else {\n        U32 const tableMask = tableSize-1;\n        U32 const step = FSE_TABLESTEP(tableSize);\n        U32 s, position = 0;\n        for (s=0; s<maxSV1; s++) {\n            int i;\n            int const n = normalizedCounter[s];\n            for (i=0; i<n; i++) {\n                tableDecode[position].baseValue = s;\n                position = (position + step) & tableMask;\n                while (UNLIKELY(position > highThreshold)) position = (position + step) & tableMask;   /* lowprob area */\n        }   }\n        assert(position == 0); /* position must reach all cells once, otherwise normalizedCounter is incorrect */\n    }\n\n    /* Build Decoding table */\n    {\n        U32 u;\n        for (u=0; u<tableSize; u++) {\n            U32 const symbol = tableDecode[u].baseValue;\n            U32 const nextState = symbolNext[symbol]++;\n            tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) );\n            tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);\n            assert(nbAdditionalBits[symbol] < 255);\n            tableDecode[u].nbAdditionalBits = nbAdditionalBits[symbol];\n            tableDecode[u].baseValue = baseValue[symbol];\n        }\n    }\n}\n\n/* Avoids the FORCE_INLINE of the _body() function. */\nstatic void ZSTD_buildFSETable_body_default(ZSTD_seqSymbol* dt,\n            const short* normalizedCounter, unsigned maxSymbolValue,\n            const U32* baseValue, const U8* nbAdditionalBits,\n            unsigned tableLog, void* wksp, size_t wkspSize)\n{\n    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,\n            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);\n}\n\n#if DYNAMIC_BMI2\nBMI2_TARGET_ATTRIBUTE static void ZSTD_buildFSETable_body_bmi2(ZSTD_seqSymbol* dt,\n            const short* normalizedCounter, unsigned maxSymbolValue,\n            const U32* baseValue, const U8* nbAdditionalBits,\n            unsigned tableLog, void* wksp, size_t wkspSize)\n{\n    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,\n            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);\n}\n#endif\n\nvoid ZSTD_buildFSETable(ZSTD_seqSymbol* dt,\n            const short* normalizedCounter, unsigned maxSymbolValue,\n            const U32* baseValue, const U8* nbAdditionalBits,\n            unsigned tableLog, void* wksp, size_t wkspSize, int bmi2)\n{\n#if DYNAMIC_BMI2\n    if (bmi2) {\n        ZSTD_buildFSETable_body_bmi2(dt, normalizedCounter, maxSymbolValue,\n                baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);\n        return;\n    }\n#endif\n    (void)bmi2;\n    ZSTD_buildFSETable_body_default(dt, normalizedCounter, maxSymbolValue,\n            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);\n}\n\n\n/*! ZSTD_buildSeqTable() :\n * @return : nb bytes read from src,\n *           or an error code if it fails */\nstatic size_t ZSTD_buildSeqTable(ZSTD_seqSymbol* DTableSpace, const ZSTD_seqSymbol** DTablePtr,\n                                 symbolEncodingType_e type, unsigned max, U32 maxLog,\n                                 const void* src, size_t srcSize,\n                                 const U32* baseValue, const U8* nbAdditionalBits,\n                                 const ZSTD_seqSymbol* defaultTable, U32 flagRepeatTable,\n                                 int ddictIsCold, int nbSeq, U32* wksp, size_t wkspSize,\n                                 int bmi2)\n{\n    switch(type)\n    {\n    case set_rle :\n        RETURN_ERROR_IF(!srcSize, srcSize_wrong, \"\");\n        RETURN_ERROR_IF((*(const BYTE*)src) > max, corruption_detected, \"\");\n        {   U32 const symbol = *(const BYTE*)src;\n            U32 const baseline = baseValue[symbol];\n            U8 const nbBits = nbAdditionalBits[symbol];\n            ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits);\n        }\n        *DTablePtr = DTableSpace;\n        return 1;\n    case set_basic :\n        *DTablePtr = defaultTable;\n        return 0;\n    case set_repeat:\n        RETURN_ERROR_IF(!flagRepeatTable, corruption_detected, \"\");\n        /* prefetch FSE table if used */\n        if (ddictIsCold && (nbSeq > 24 /* heuristic */)) {\n            const void* const pStart = *DTablePtr;\n            size_t const pSize = sizeof(ZSTD_seqSymbol) * (SEQSYMBOL_TABLE_SIZE(maxLog));\n            PREFETCH_AREA(pStart, pSize);\n        }\n        return 0;\n    case set_compressed :\n        {   unsigned tableLog;\n            S16 norm[MaxSeq+1];\n            size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize);\n            RETURN_ERROR_IF(FSE_isError(headerSize), corruption_detected, \"\");\n            RETURN_ERROR_IF(tableLog > maxLog, corruption_detected, \"\");\n            ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog, wksp, wkspSize, bmi2);\n            *DTablePtr = DTableSpace;\n            return headerSize;\n        }\n    default :\n        assert(0);\n        RETURN_ERROR(GENERIC, \"impossible\");\n    }\n}\n\nsize_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr,\n                             const void* src, size_t srcSize)\n{\n    const BYTE* const istart = (const BYTE*)src;\n    const BYTE* const iend = istart + srcSize;\n    const BYTE* ip = istart;\n    int nbSeq;\n    DEBUGLOG(5, \"ZSTD_decodeSeqHeaders\");\n\n    /* check */\n    RETURN_ERROR_IF(srcSize < MIN_SEQUENCES_SIZE, srcSize_wrong, \"\");\n\n    /* SeqHead */\n    nbSeq = *ip++;\n    if (nbSeq > 0x7F) {\n        if (nbSeq == 0xFF) {\n            RETURN_ERROR_IF(ip+2 > iend, srcSize_wrong, \"\");\n            nbSeq = MEM_readLE16(ip) + LONGNBSEQ;\n            ip+=2;\n        } else {\n            RETURN_ERROR_IF(ip >= iend, srcSize_wrong, \"\");\n            nbSeq = ((nbSeq-0x80)<<8) + *ip++;\n        }\n    }\n    *nbSeqPtr = nbSeq;\n\n    if (nbSeq == 0) {\n        /* No sequence : section ends immediately */\n        RETURN_ERROR_IF(ip != iend, corruption_detected,\n            \"extraneous data present in the Sequences section\");\n        return (size_t)(ip - istart);\n    }\n\n    /* FSE table descriptors */\n    RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong, \"\"); /* minimum possible size: 1 byte for symbol encoding types */\n    RETURN_ERROR_IF(*ip & 3, corruption_detected, \"\"); /* The last field, Reserved, must be all-zeroes. */\n    {   symbolEncodingType_e const LLtype = (symbolEncodingType_e)(*ip >> 6);\n        symbolEncodingType_e const OFtype = (symbolEncodingType_e)((*ip >> 4) & 3);\n        symbolEncodingType_e const MLtype = (symbolEncodingType_e)((*ip >> 2) & 3);\n        ip++;\n\n        /* Build DTables */\n        {   size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr,\n                                                      LLtype, MaxLL, LLFSELog,\n                                                      ip, iend-ip,\n                                                      LL_base, LL_bits,\n                                                      LL_defaultDTable, dctx->fseEntropy,\n                                                      dctx->ddictIsCold, nbSeq,\n                                                      dctx->workspace, sizeof(dctx->workspace),\n                                                      ZSTD_DCtx_get_bmi2(dctx));\n            RETURN_ERROR_IF(ZSTD_isError(llhSize), corruption_detected, \"ZSTD_buildSeqTable failed\");\n            ip += llhSize;\n        }\n\n        {   size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr,\n                                                      OFtype, MaxOff, OffFSELog,\n                                                      ip, iend-ip,\n                                                      OF_base, OF_bits,\n                                                      OF_defaultDTable, dctx->fseEntropy,\n                                                      dctx->ddictIsCold, nbSeq,\n                                                      dctx->workspace, sizeof(dctx->workspace),\n                                                      ZSTD_DCtx_get_bmi2(dctx));\n            RETURN_ERROR_IF(ZSTD_isError(ofhSize), corruption_detected, \"ZSTD_buildSeqTable failed\");\n            ip += ofhSize;\n        }\n\n        {   size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr,\n                                                      MLtype, MaxML, MLFSELog,\n                                                      ip, iend-ip,\n                                                      ML_base, ML_bits,\n                                                      ML_defaultDTable, dctx->fseEntropy,\n                                                      dctx->ddictIsCold, nbSeq,\n                                                      dctx->workspace, sizeof(dctx->workspace),\n                                                      ZSTD_DCtx_get_bmi2(dctx));\n            RETURN_ERROR_IF(ZSTD_isError(mlhSize), corruption_detected, \"ZSTD_buildSeqTable failed\");\n            ip += mlhSize;\n        }\n    }\n\n    return ip-istart;\n}\n\n\ntypedef struct {\n    size_t litLength;\n    size_t matchLength;\n    size_t offset;\n} seq_t;\n\ntypedef struct {\n    size_t state;\n    const ZSTD_seqSymbol* table;\n} ZSTD_fseState;\n\ntypedef struct {\n    BIT_DStream_t DStream;\n    ZSTD_fseState stateLL;\n    ZSTD_fseState stateOffb;\n    ZSTD_fseState stateML;\n    size_t prevOffset[ZSTD_REP_NUM];\n} seqState_t;\n\n/*! ZSTD_overlapCopy8() :\n *  Copies 8 bytes from ip to op and updates op and ip where ip <= op.\n *  If the offset is < 8 then the offset is spread to at least 8 bytes.\n *\n *  Precondition: *ip <= *op\n *  Postcondition: *op - *op >= 8\n */\nHINT_INLINE void ZSTD_overlapCopy8(BYTE** op, BYTE const** ip, size_t offset) {\n    assert(*ip <= *op);\n    if (offset < 8) {\n        /* close range match, overlap */\n        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */\n        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */\n        int const sub2 = dec64table[offset];\n        (*op)[0] = (*ip)[0];\n        (*op)[1] = (*ip)[1];\n        (*op)[2] = (*ip)[2];\n        (*op)[3] = (*ip)[3];\n        *ip += dec32table[offset];\n        ZSTD_copy4(*op+4, *ip);\n        *ip -= sub2;\n    } else {\n        ZSTD_copy8(*op, *ip);\n    }\n    *ip += 8;\n    *op += 8;\n    assert(*op - *ip >= 8);\n}\n\n/*! ZSTD_safecopy() :\n *  Specialized version of memcpy() that is allowed to READ up to WILDCOPY_OVERLENGTH past the input buffer\n *  and write up to 16 bytes past oend_w (op >= oend_w is allowed).\n *  This function is only called in the uncommon case where the sequence is near the end of the block. It\n *  should be fast for a single long sequence, but can be slow for several short sequences.\n *\n *  @param ovtype controls the overlap detection\n *         - ZSTD_no_overlap: The source and destination are guaranteed to be at least WILDCOPY_VECLEN bytes apart.\n *         - ZSTD_overlap_src_before_dst: The src and dst may overlap and may be any distance apart.\n *           The src buffer must be before the dst buffer.\n */\nstatic void ZSTD_safecopy(BYTE* op, const BYTE* const oend_w, BYTE const* ip, ptrdiff_t length, ZSTD_overlap_e ovtype) {\n    ptrdiff_t const diff = op - ip;\n    BYTE* const oend = op + length;\n\n    assert((ovtype == ZSTD_no_overlap && (diff <= -8 || diff >= 8 || op >= oend_w)) ||\n           (ovtype == ZSTD_overlap_src_before_dst && diff >= 0));\n\n    if (length < 8) {\n        /* Handle short lengths. */\n        while (op < oend) *op++ = *ip++;\n        return;\n    }\n    if (ovtype == ZSTD_overlap_src_before_dst) {\n        /* Copy 8 bytes and ensure the offset >= 8 when there can be overlap. */\n        assert(length >= 8);\n        ZSTD_overlapCopy8(&op, &ip, diff);\n        length -= 8;\n        assert(op - ip >= 8);\n        assert(op <= oend);\n    }\n\n    if (oend <= oend_w) {\n        /* No risk of overwrite. */\n        ZSTD_wildcopy(op, ip, length, ovtype);\n        return;\n    }\n    if (op <= oend_w) {\n        /* Wildcopy until we get close to the end. */\n        assert(oend > oend_w);\n        ZSTD_wildcopy(op, ip, oend_w - op, ovtype);\n        ip += oend_w - op;\n        op += oend_w - op;\n    }\n    /* Handle the leftovers. */\n    while (op < oend) *op++ = *ip++;\n}\n\n/* ZSTD_safecopyDstBeforeSrc():\n * This version allows overlap with dst before src, or handles the non-overlap case with dst after src\n * Kept separate from more common ZSTD_safecopy case to avoid performance impact to the safecopy common case */\nstatic void ZSTD_safecopyDstBeforeSrc(BYTE* op, const BYTE* ip, ptrdiff_t length) {\n    ptrdiff_t const diff = op - ip;\n    BYTE* const oend = op + length;\n\n    if (length < 8 || diff > -8) {\n        /* Handle short lengths, close overlaps, and dst not before src. */\n        while (op < oend) *op++ = *ip++;\n        return;\n    }\n\n    if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) {\n        ZSTD_wildcopy(op, ip, oend - WILDCOPY_OVERLENGTH - op, ZSTD_no_overlap);\n        ip += oend - WILDCOPY_OVERLENGTH - op;\n        op += oend - WILDCOPY_OVERLENGTH - op;\n    }\n\n    /* Handle the leftovers. */\n    while (op < oend) *op++ = *ip++;\n}\n\n/* ZSTD_execSequenceEnd():\n * This version handles cases that are near the end of the output buffer. It requires\n * more careful checks to make sure there is no overflow. By separating out these hard\n * and unlikely cases, we can speed up the common cases.\n *\n * NOTE: This function needs to be fast for a single long sequence, but doesn't need\n * to be optimized for many small sequences, since those fall into ZSTD_execSequence().\n */\nFORCE_NOINLINE\nZSTD_ALLOW_POINTER_OVERFLOW_ATTR\nsize_t ZSTD_execSequenceEnd(BYTE* op,\n    BYTE* const oend, seq_t sequence,\n    const BYTE** litPtr, const BYTE* const litLimit,\n    const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd)\n{\n    BYTE* const oLitEnd = op + sequence.litLength;\n    size_t const sequenceLength = sequence.litLength + sequence.matchLength;\n    const BYTE* const iLitEnd = *litPtr + sequence.litLength;\n    const BYTE* match = oLitEnd - sequence.offset;\n    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;\n\n    /* bounds checks : careful of address space overflow in 32-bit mode */\n    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, \"last match must fit within dstBuffer\");\n    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, \"try to read beyond literal buffer\");\n    assert(op < op + sequenceLength);\n    assert(oLitEnd < op + sequenceLength);\n\n    /* copy literals */\n    ZSTD_safecopy(op, oend_w, *litPtr, sequence.litLength, ZSTD_no_overlap);\n    op = oLitEnd;\n    *litPtr = iLitEnd;\n\n    /* copy Match */\n    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {\n        /* offset beyond prefix */\n        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, \"\");\n        match = dictEnd - (prefixStart - match);\n        if (match + sequence.matchLength <= dictEnd) {\n            ZSTD_memmove(oLitEnd, match, sequence.matchLength);\n            return sequenceLength;\n        }\n        /* span extDict & currentPrefixSegment */\n        {   size_t const length1 = dictEnd - match;\n        ZSTD_memmove(oLitEnd, match, length1);\n        op = oLitEnd + length1;\n        sequence.matchLength -= length1;\n        match = prefixStart;\n        }\n    }\n    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);\n    return sequenceLength;\n}\n\n/* ZSTD_execSequenceEndSplitLitBuffer():\n * This version is intended to be used during instances where the litBuffer is still split.  It is kept separate to avoid performance impact for the good case.\n */\nFORCE_NOINLINE\nZSTD_ALLOW_POINTER_OVERFLOW_ATTR\nsize_t ZSTD_execSequenceEndSplitLitBuffer(BYTE* op,\n    BYTE* const oend, const BYTE* const oend_w, seq_t sequence,\n    const BYTE** litPtr, const BYTE* const litLimit,\n    const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd)\n{\n    BYTE* const oLitEnd = op + sequence.litLength;\n    size_t const sequenceLength = sequence.litLength + sequence.matchLength;\n    const BYTE* const iLitEnd = *litPtr + sequence.litLength;\n    const BYTE* match = oLitEnd - sequence.offset;\n\n\n    /* bounds checks : careful of address space overflow in 32-bit mode */\n    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, \"last match must fit within dstBuffer\");\n    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, \"try to read beyond literal buffer\");\n    assert(op < op + sequenceLength);\n    assert(oLitEnd < op + sequenceLength);\n\n    /* copy literals */\n    RETURN_ERROR_IF(op > *litPtr && op < *litPtr + sequence.litLength, dstSize_tooSmall, \"output should not catch up to and overwrite literal buffer\");\n    ZSTD_safecopyDstBeforeSrc(op, *litPtr, sequence.litLength);\n    op = oLitEnd;\n    *litPtr = iLitEnd;\n\n    /* copy Match */\n    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {\n        /* offset beyond prefix */\n        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, \"\");\n        match = dictEnd - (prefixStart - match);\n        if (match + sequence.matchLength <= dictEnd) {\n            ZSTD_memmove(oLitEnd, match, sequence.matchLength);\n            return sequenceLength;\n        }\n        /* span extDict & currentPrefixSegment */\n        {   size_t const length1 = dictEnd - match;\n        ZSTD_memmove(oLitEnd, match, length1);\n        op = oLitEnd + length1;\n        sequence.matchLength -= length1;\n        match = prefixStart;\n        }\n    }\n    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);\n    return sequenceLength;\n}\n\nHINT_INLINE\nZSTD_ALLOW_POINTER_OVERFLOW_ATTR\nsize_t ZSTD_execSequence(BYTE* op,\n    BYTE* const oend, seq_t sequence,\n    const BYTE** litPtr, const BYTE* const litLimit,\n    const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd)\n{\n    BYTE* const oLitEnd = op + sequence.litLength;\n    size_t const sequenceLength = sequence.litLength + sequence.matchLength;\n    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */\n    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;   /* risk : address space underflow on oend=NULL */\n    const BYTE* const iLitEnd = *litPtr + sequence.litLength;\n    const BYTE* match = oLitEnd - sequence.offset;\n\n    assert(op != NULL /* Precondition */);\n    assert(oend_w < oend /* No underflow */);\n\n#if defined(__aarch64__)\n    /* prefetch sequence starting from match that will be used for copy later */\n    PREFETCH_L1(match);\n#endif\n    /* Handle edge cases in a slow path:\n     *   - Read beyond end of literals\n     *   - Match end is within WILDCOPY_OVERLIMIT of oend\n     *   - 32-bit mode and the match length overflows\n     */\n    if (UNLIKELY(\n        iLitEnd > litLimit ||\n        oMatchEnd > oend_w ||\n        (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))\n        return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);\n\n    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */\n    assert(op <= oLitEnd /* No overflow */);\n    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);\n    assert(oMatchEnd <= oend /* No underflow */);\n    assert(iLitEnd <= litLimit /* Literal length is in bounds */);\n    assert(oLitEnd <= oend_w /* Can wildcopy literals */);\n    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);\n\n    /* Copy Literals:\n     * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9.\n     * We likely don't need the full 32-byte wildcopy.\n     */\n    assert(WILDCOPY_OVERLENGTH >= 16);\n    ZSTD_copy16(op, (*litPtr));\n    if (UNLIKELY(sequence.litLength > 16)) {\n        ZSTD_wildcopy(op + 16, (*litPtr) + 16, sequence.litLength - 16, ZSTD_no_overlap);\n    }\n    op = oLitEnd;\n    *litPtr = iLitEnd;   /* update for next sequence */\n\n    /* Copy Match */\n    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {\n        /* offset beyond prefix -> go into extDict */\n        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, \"\");\n        match = dictEnd + (match - prefixStart);\n        if (match + sequence.matchLength <= dictEnd) {\n            ZSTD_memmove(oLitEnd, match, sequence.matchLength);\n            return sequenceLength;\n        }\n        /* span extDict & currentPrefixSegment */\n        {   size_t const length1 = dictEnd - match;\n        ZSTD_memmove(oLitEnd, match, length1);\n        op = oLitEnd + length1;\n        sequence.matchLength -= length1;\n        match = prefixStart;\n        }\n    }\n    /* Match within prefix of 1 or more bytes */\n    assert(op <= oMatchEnd);\n    assert(oMatchEnd <= oend_w);\n    assert(match >= prefixStart);\n    assert(sequence.matchLength >= 1);\n\n    /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy\n     * without overlap checking.\n     */\n    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {\n        /* We bet on a full wildcopy for matches, since we expect matches to be\n         * longer than literals (in general). In silesia, ~10% of matches are longer\n         * than 16 bytes.\n         */\n        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);\n        return sequenceLength;\n    }\n    assert(sequence.offset < WILDCOPY_VECLEN);\n\n    /* Copy 8 bytes and spread the offset to be >= 8. */\n    ZSTD_overlapCopy8(&op, &match, sequence.offset);\n\n    /* If the match length is > 8 bytes, then continue with the wildcopy. */\n    if (sequence.matchLength > 8) {\n        assert(op < oMatchEnd);\n        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength - 8, ZSTD_overlap_src_before_dst);\n    }\n    return sequenceLength;\n}\n\nHINT_INLINE\nZSTD_ALLOW_POINTER_OVERFLOW_ATTR\nsize_t ZSTD_execSequenceSplitLitBuffer(BYTE* op,\n    BYTE* const oend, const BYTE* const oend_w, seq_t sequence,\n    const BYTE** litPtr, const BYTE* const litLimit,\n    const BYTE* const prefixStart, const BYTE* const virtualStart, const BYTE* const dictEnd)\n{\n    BYTE* const oLitEnd = op + sequence.litLength;\n    size_t const sequenceLength = sequence.litLength + sequence.matchLength;\n    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */\n    const BYTE* const iLitEnd = *litPtr + sequence.litLength;\n    const BYTE* match = oLitEnd - sequence.offset;\n\n    assert(op != NULL /* Precondition */);\n    assert(oend_w < oend /* No underflow */);\n    /* Handle edge cases in a slow path:\n     *   - Read beyond end of literals\n     *   - Match end is within WILDCOPY_OVERLIMIT of oend\n     *   - 32-bit mode and the match length overflows\n     */\n    if (UNLIKELY(\n            iLitEnd > litLimit ||\n            oMatchEnd > oend_w ||\n            (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))\n        return ZSTD_execSequenceEndSplitLitBuffer(op, oend, oend_w, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);\n\n    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */\n    assert(op <= oLitEnd /* No overflow */);\n    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);\n    assert(oMatchEnd <= oend /* No underflow */);\n    assert(iLitEnd <= litLimit /* Literal length is in bounds */);\n    assert(oLitEnd <= oend_w /* Can wildcopy literals */);\n    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);\n\n    /* Copy Literals:\n     * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9.\n     * We likely don't need the full 32-byte wildcopy.\n     */\n    assert(WILDCOPY_OVERLENGTH >= 16);\n    ZSTD_copy16(op, (*litPtr));\n    if (UNLIKELY(sequence.litLength > 16)) {\n        ZSTD_wildcopy(op+16, (*litPtr)+16, sequence.litLength-16, ZSTD_no_overlap);\n    }\n    op = oLitEnd;\n    *litPtr = iLitEnd;   /* update for next sequence */\n\n    /* Copy Match */\n    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {\n        /* offset beyond prefix -> go into extDict */\n        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, \"\");\n        match = dictEnd + (match - prefixStart);\n        if (match + sequence.matchLength <= dictEnd) {\n            ZSTD_memmove(oLitEnd, match, sequence.matchLength);\n            return sequenceLength;\n        }\n        /* span extDict & currentPrefixSegment */\n        {   size_t const length1 = dictEnd - match;\n            ZSTD_memmove(oLitEnd, match, length1);\n            op = oLitEnd + length1;\n            sequence.matchLength -= length1;\n            match = prefixStart;\n    }   }\n    /* Match within prefix of 1 or more bytes */\n    assert(op <= oMatchEnd);\n    assert(oMatchEnd <= oend_w);\n    assert(match >= prefixStart);\n    assert(sequence.matchLength >= 1);\n\n    /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy\n     * without overlap checking.\n     */\n    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {\n        /* We bet on a full wildcopy for matches, since we expect matches to be\n         * longer than literals (in general). In silesia, ~10% of matches are longer\n         * than 16 bytes.\n         */\n        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);\n        return sequenceLength;\n    }\n    assert(sequence.offset < WILDCOPY_VECLEN);\n\n    /* Copy 8 bytes and spread the offset to be >= 8. */\n    ZSTD_overlapCopy8(&op, &match, sequence.offset);\n\n    /* If the match length is > 8 bytes, then continue with the wildcopy. */\n    if (sequence.matchLength > 8) {\n        assert(op < oMatchEnd);\n        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst);\n    }\n    return sequenceLength;\n}\n\n\nstatic void\nZSTD_initFseState(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD, const ZSTD_seqSymbol* dt)\n{\n    const void* ptr = dt;\n    const ZSTD_seqSymbol_header* const DTableH = (const ZSTD_seqSymbol_header*)ptr;\n    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);\n    DEBUGLOG(6, \"ZSTD_initFseState : val=%u using %u bits\",\n                (U32)DStatePtr->state, DTableH->tableLog);\n    BIT_reloadDStream(bitD);\n    DStatePtr->table = dt + 1;\n}\n\nFORCE_INLINE_TEMPLATE void\nZSTD_updateFseStateWithDInfo(ZSTD_fseState* DStatePtr, BIT_DStream_t* bitD, U16 nextState, U32 nbBits)\n{\n    size_t const lowBits = BIT_readBits(bitD, nbBits);\n    DStatePtr->state = nextState + lowBits;\n}\n\n/* We need to add at most (ZSTD_WINDOWLOG_MAX_32 - 1) bits to read the maximum\n * offset bits. But we can only read at most STREAM_ACCUMULATOR_MIN_32\n * bits before reloading. This value is the maximum number of bytes we read\n * after reloading when we are decoding long offsets.\n */\n#define LONG_OFFSETS_MAX_EXTRA_BITS_32                       \\\n    (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \\\n        ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \\\n        : 0)\n\ntypedef enum { ZSTD_lo_isRegularOffset, ZSTD_lo_isLongOffset=1 } ZSTD_longOffset_e;\n\n/**\n * ZSTD_decodeSequence():\n * @p longOffsets : tells the decoder to reload more bit while decoding large offsets\n *                  only used in 32-bit mode\n * @return : Sequence (litL + matchL + offset)\n */\nFORCE_INLINE_TEMPLATE seq_t\nZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets, const int isLastSeq)\n{\n    seq_t seq;\n    /*\n     * ZSTD_seqSymbol is a 64 bits wide structure.\n     * It can be loaded in one operation\n     * and its fields extracted by simply shifting or bit-extracting on aarch64.\n     * GCC doesn't recognize this and generates more unnecessary ldr/ldrb/ldrh\n     * operations that cause performance drop. This can be avoided by using this\n     * ZSTD_memcpy hack.\n     */\n#if defined(__aarch64__) && (defined(__GNUC__) && !defined(__clang__))\n    ZSTD_seqSymbol llDInfoS, mlDInfoS, ofDInfoS;\n    ZSTD_seqSymbol* const llDInfo = &llDInfoS;\n    ZSTD_seqSymbol* const mlDInfo = &mlDInfoS;\n    ZSTD_seqSymbol* const ofDInfo = &ofDInfoS;\n    ZSTD_memcpy(llDInfo, seqState->stateLL.table + seqState->stateLL.state, sizeof(ZSTD_seqSymbol));\n    ZSTD_memcpy(mlDInfo, seqState->stateML.table + seqState->stateML.state, sizeof(ZSTD_seqSymbol));\n    ZSTD_memcpy(ofDInfo, seqState->stateOffb.table + seqState->stateOffb.state, sizeof(ZSTD_seqSymbol));\n#else\n    const ZSTD_seqSymbol* const llDInfo = seqState->stateLL.table + seqState->stateLL.state;\n    const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state;\n    const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state;\n#endif\n    seq.matchLength = mlDInfo->baseValue;\n    seq.litLength = llDInfo->baseValue;\n    {   U32 const ofBase = ofDInfo->baseValue;\n        BYTE const llBits = llDInfo->nbAdditionalBits;\n        BYTE const mlBits = mlDInfo->nbAdditionalBits;\n        BYTE const ofBits = ofDInfo->nbAdditionalBits;\n        BYTE const totalBits = llBits+mlBits+ofBits;\n\n        U16 const llNext = llDInfo->nextState;\n        U16 const mlNext = mlDInfo->nextState;\n        U16 const ofNext = ofDInfo->nextState;\n        U32 const llnbBits = llDInfo->nbBits;\n        U32 const mlnbBits = mlDInfo->nbBits;\n        U32 const ofnbBits = ofDInfo->nbBits;\n\n        assert(llBits <= MaxLLBits);\n        assert(mlBits <= MaxMLBits);\n        assert(ofBits <= MaxOff);\n        /*\n         * As gcc has better branch and block analyzers, sometimes it is only\n         * valuable to mark likeliness for clang, it gives around 3-4% of\n         * performance.\n         */\n\n        /* sequence */\n        {   size_t offset;\n            if (ofBits > 1) {\n                ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1);\n                ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5);\n                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 > LONG_OFFSETS_MAX_EXTRA_BITS_32);\n                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 - LONG_OFFSETS_MAX_EXTRA_BITS_32 >= MaxMLBits);\n                if (MEM_32bits() && longOffsets && (ofBits >= STREAM_ACCUMULATOR_MIN_32)) {\n                    /* Always read extra bits, this keeps the logic simple,\n                     * avoids branches, and avoids accidentally reading 0 bits.\n                     */\n                    U32 const extraBits = LONG_OFFSETS_MAX_EXTRA_BITS_32;\n                    offset = ofBase + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits);\n                    BIT_reloadDStream(&seqState->DStream);\n                    offset += BIT_readBitsFast(&seqState->DStream, extraBits);\n                } else {\n                    offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/);   /* <=  (ZSTD_WINDOWLOG_MAX-1) bits */\n                    if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);\n                }\n                seqState->prevOffset[2] = seqState->prevOffset[1];\n                seqState->prevOffset[1] = seqState->prevOffset[0];\n                seqState->prevOffset[0] = offset;\n            } else {\n                U32 const ll0 = (llDInfo->baseValue == 0);\n                if (LIKELY((ofBits == 0))) {\n                    offset = seqState->prevOffset[ll0];\n                    seqState->prevOffset[1] = seqState->prevOffset[!ll0];\n                    seqState->prevOffset[0] = offset;\n                } else {\n                    offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1);\n                    {   size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];\n                        temp -= !temp; /* 0 is not valid: input corrupted => force offset to -1 => corruption detected at execSequence */\n                        if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];\n                        seqState->prevOffset[1] = seqState->prevOffset[0];\n                        seqState->prevOffset[0] = offset = temp;\n            }   }   }\n            seq.offset = offset;\n        }\n\n        if (mlBits > 0)\n            seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/);\n\n        if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32))\n            BIT_reloadDStream(&seqState->DStream);\n        if (MEM_64bits() && UNLIKELY(totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog)))\n            BIT_reloadDStream(&seqState->DStream);\n        /* Ensure there are enough bits to read the rest of data in 64-bit mode. */\n        ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64);\n\n        if (llBits > 0)\n            seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/);\n\n        if (MEM_32bits())\n            BIT_reloadDStream(&seqState->DStream);\n\n        DEBUGLOG(6, \"seq: litL=%u, matchL=%u, offset=%u\",\n                    (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);\n\n        if (!isLastSeq) {\n            /* don't update FSE state for last Sequence */\n            ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits);    /* <=  9 bits */\n            ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits);    /* <=  9 bits */\n            if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);    /* <= 18 bits */\n            ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits);  /* <=  8 bits */\n            BIT_reloadDStream(&seqState->DStream);\n        }\n    }\n\n    return seq;\n}\n\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n#if DEBUGLEVEL >= 1\nstatic int ZSTD_dictionaryIsActive(ZSTD_DCtx const* dctx, BYTE const* prefixStart, BYTE const* oLitEnd)\n{\n    size_t const windowSize = dctx->fParams.windowSize;\n    /* No dictionary used. */\n    if (dctx->dictContentEndForFuzzing == NULL) return 0;\n    /* Dictionary is our prefix. */\n    if (prefixStart == dctx->dictContentBeginForFuzzing) return 1;\n    /* Dictionary is not our ext-dict. */\n    if (dctx->dictEnd != dctx->dictContentEndForFuzzing) return 0;\n    /* Dictionary is not within our window size. */\n    if ((size_t)(oLitEnd - prefixStart) >= windowSize) return 0;\n    /* Dictionary is active. */\n    return 1;\n}\n#endif\n\nstatic void ZSTD_assertValidSequence(\n        ZSTD_DCtx const* dctx,\n        BYTE const* op, BYTE const* oend,\n        seq_t const seq,\n        BYTE const* prefixStart, BYTE const* virtualStart)\n{\n#if DEBUGLEVEL >= 1\n    if (dctx->isFrameDecompression) {\n        size_t const windowSize = dctx->fParams.windowSize;\n        size_t const sequenceSize = seq.litLength + seq.matchLength;\n        BYTE const* const oLitEnd = op + seq.litLength;\n        DEBUGLOG(6, \"Checking sequence: litL=%u matchL=%u offset=%u\",\n                (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);\n        assert(op <= oend);\n        assert((size_t)(oend - op) >= sequenceSize);\n        assert(sequenceSize <= ZSTD_blockSizeMax(dctx));\n        if (ZSTD_dictionaryIsActive(dctx, prefixStart, oLitEnd)) {\n            size_t const dictSize = (size_t)((char const*)dctx->dictContentEndForFuzzing - (char const*)dctx->dictContentBeginForFuzzing);\n            /* Offset must be within the dictionary. */\n            assert(seq.offset <= (size_t)(oLitEnd - virtualStart));\n            assert(seq.offset <= windowSize + dictSize);\n        } else {\n            /* Offset must be within our window. */\n            assert(seq.offset <= windowSize);\n        }\n    }\n#else\n    (void)dctx, (void)op, (void)oend, (void)seq, (void)prefixStart, (void)virtualStart;\n#endif\n}\n#endif\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG\n\n\nFORCE_INLINE_TEMPLATE size_t\nDONT_VECTORIZE\nZSTD_decompressSequences_bodySplitLitBuffer( ZSTD_DCtx* dctx,\n                               void* dst, size_t maxDstSize,\n                         const void* seqStart, size_t seqSize, int nbSeq,\n                         const ZSTD_longOffset_e isLongOffset)\n{\n    const BYTE* ip = (const BYTE*)seqStart;\n    const BYTE* const iend = ip + seqSize;\n    BYTE* const ostart = (BYTE*)dst;\n    BYTE* const oend = ZSTD_maybeNullPtrAdd(ostart, maxDstSize);\n    BYTE* op = ostart;\n    const BYTE* litPtr = dctx->litPtr;\n    const BYTE* litBufferEnd = dctx->litBufferEnd;\n    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);\n    const BYTE* const vBase = (const BYTE*) (dctx->virtualStart);\n    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);\n    DEBUGLOG(5, \"ZSTD_decompressSequences_bodySplitLitBuffer (%i seqs)\", nbSeq);\n\n    /* Literals are split between internal buffer & output buffer */\n    if (nbSeq) {\n        seqState_t seqState;\n        dctx->fseEntropy = 1;\n        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }\n        RETURN_ERROR_IF(\n            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),\n            corruption_detected, \"\");\n        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);\n        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);\n        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);\n        assert(dst != NULL);\n\n        ZSTD_STATIC_ASSERT(\n                BIT_DStream_unfinished < BIT_DStream_completed &&\n                BIT_DStream_endOfBuffer < BIT_DStream_completed &&\n                BIT_DStream_completed < BIT_DStream_overflow);\n\n        /* decompress without overrunning litPtr begins */\n        {   seq_t sequence = {0,0,0};  /* some static analyzer believe that @sequence is not initialized (it necessarily is, since for(;;) loop as at least one iteration) */\n            /* Align the decompression loop to 32 + 16 bytes.\n                *\n                * zstd compiled with gcc-9 on an Intel i9-9900k shows 10% decompression\n                * speed swings based on the alignment of the decompression loop. This\n                * performance swing is caused by parts of the decompression loop falling\n                * out of the DSB. The entire decompression loop should fit in the DSB,\n                * when it can't we get much worse performance. You can measure if you've\n                * hit the good case or the bad case with this perf command for some\n                * compressed file test.zst:\n                *\n                *   perf stat -e cycles -e instructions -e idq.all_dsb_cycles_any_uops \\\n                *             -e idq.all_mite_cycles_any_uops -- ./zstd -tq test.zst\n                *\n                * If you see most cycles served out of the MITE you've hit the bad case.\n                * If you see most cycles served out of the DSB you've hit the good case.\n                * If it is pretty even then you may be in an okay case.\n                *\n                * This issue has been reproduced on the following CPUs:\n                *   - Kabylake: Macbook Pro (15-inch, 2019) 2.4 GHz Intel Core i9\n                *               Use Instruments->Counters to get DSB/MITE cycles.\n                *               I never got performance swings, but I was able to\n                *               go from the good case of mostly DSB to half of the\n                *               cycles served from MITE.\n                *   - Coffeelake: Intel i9-9900k\n                *   - Coffeelake: Intel i7-9700k\n                *\n                * I haven't been able to reproduce the instability or DSB misses on any\n                * of the following CPUS:\n                *   - Haswell\n                *   - Broadwell: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GH\n                *   - Skylake\n                *\n                * Alignment is done for each of the three major decompression loops:\n                *   - ZSTD_decompressSequences_bodySplitLitBuffer - presplit section of the literal buffer\n                *   - ZSTD_decompressSequences_bodySplitLitBuffer - postsplit section of the literal buffer\n                *   - ZSTD_decompressSequences_body\n                * Alignment choices are made to minimize large swings on bad cases and influence on performance\n                * from changes external to this code, rather than to overoptimize on the current commit.\n                *\n                * If you are seeing performance stability this script can help test.\n                * It tests on 4 commits in zstd where I saw performance change.\n                *\n                *   https://gist.github.com/terrelln/9889fc06a423fd5ca6e99351564473f4\n                */\n#if defined(__GNUC__) && defined(__x86_64__)\n            __asm__(\".p2align 6\");\n#  if __GNUC__ >= 7\n\t    /* good for gcc-7, gcc-9, and gcc-11 */\n            __asm__(\"nop\");\n            __asm__(\".p2align 5\");\n            __asm__(\"nop\");\n            __asm__(\".p2align 4\");\n#    if __GNUC__ == 8 || __GNUC__ == 10\n\t    /* good for gcc-8 and gcc-10 */\n            __asm__(\"nop\");\n            __asm__(\".p2align 3\");\n#    endif\n#  endif\n#endif\n\n            /* Handle the initial state where litBuffer is currently split between dst and litExtraBuffer */\n            for ( ; nbSeq; nbSeq--) {\n                sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);\n                if (litPtr + sequence.litLength > dctx->litBufferEnd) break;\n                {   size_t const oneSeqSize = ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence.litLength - WILDCOPY_OVERLENGTH, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n                    assert(!ZSTD_isError(oneSeqSize));\n                    ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);\n#endif\n                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))\n                        return oneSeqSize;\n                    DEBUGLOG(6, \"regenerated sequence size : %u\", (U32)oneSeqSize);\n                    op += oneSeqSize;\n            }   }\n            DEBUGLOG(6, \"reached: (litPtr + sequence.litLength > dctx->litBufferEnd)\");\n\n            /* If there are more sequences, they will need to read literals from litExtraBuffer; copy over the remainder from dst and update litPtr and litEnd */\n            if (nbSeq > 0) {\n                const size_t leftoverLit = dctx->litBufferEnd - litPtr;\n                DEBUGLOG(6, \"There are %i sequences left, and %zu/%zu literals left in buffer\", nbSeq, leftoverLit, sequence.litLength);\n                if (leftoverLit) {\n                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, \"remaining lit must fit within dstBuffer\");\n                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);\n                    sequence.litLength -= leftoverLit;\n                    op += leftoverLit;\n                }\n                litPtr = dctx->litExtraBuffer;\n                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;\n                dctx->litBufferLocation = ZSTD_not_in_dst;\n                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n                    assert(!ZSTD_isError(oneSeqSize));\n                    ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);\n#endif\n                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))\n                        return oneSeqSize;\n                    DEBUGLOG(6, \"regenerated sequence size : %u\", (U32)oneSeqSize);\n                    op += oneSeqSize;\n                }\n                nbSeq--;\n            }\n        }\n\n        if (nbSeq > 0) {\n            /* there is remaining lit from extra buffer */\n\n#if defined(__GNUC__) && defined(__x86_64__)\n            __asm__(\".p2align 6\");\n            __asm__(\"nop\");\n#  if __GNUC__ != 7\n            /* worse for gcc-7 better for gcc-8, gcc-9, and gcc-10 and clang */\n            __asm__(\".p2align 4\");\n            __asm__(\"nop\");\n            __asm__(\".p2align 3\");\n#  elif __GNUC__ >= 11\n            __asm__(\".p2align 3\");\n#  else\n            __asm__(\".p2align 5\");\n            __asm__(\"nop\");\n            __asm__(\".p2align 3\");\n#  endif\n#endif\n\n            for ( ; nbSeq ; nbSeq--) {\n                seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);\n                size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n                assert(!ZSTD_isError(oneSeqSize));\n                ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);\n#endif\n                if (UNLIKELY(ZSTD_isError(oneSeqSize)))\n                    return oneSeqSize;\n                DEBUGLOG(6, \"regenerated sequence size : %u\", (U32)oneSeqSize);\n                op += oneSeqSize;\n            }\n        }\n\n        /* check if reached exact end */\n        DEBUGLOG(5, \"ZSTD_decompressSequences_bodySplitLitBuffer: after decode loop, remaining nbSeq : %i\", nbSeq);\n        RETURN_ERROR_IF(nbSeq, corruption_detected, \"\");\n        DEBUGLOG(5, \"bitStream : start=%p, ptr=%p, bitsConsumed=%u\", seqState.DStream.start, seqState.DStream.ptr, seqState.DStream.bitsConsumed);\n        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, \"\");\n        /* save reps for next block */\n        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }\n    }\n\n    /* last literal segment */\n    if (dctx->litBufferLocation == ZSTD_split) {\n        /* split hasn't been reached yet, first get dst then copy litExtraBuffer */\n        size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);\n        DEBUGLOG(6, \"copy last literals from segment : %u\", (U32)lastLLSize);\n        RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, \"\");\n        if (op != NULL) {\n            ZSTD_memmove(op, litPtr, lastLLSize);\n            op += lastLLSize;\n        }\n        litPtr = dctx->litExtraBuffer;\n        litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;\n        dctx->litBufferLocation = ZSTD_not_in_dst;\n    }\n    /* copy last literals from internal buffer */\n    {   size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);\n        DEBUGLOG(6, \"copy last literals from internal buffer : %u\", (U32)lastLLSize);\n        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, \"\");\n        if (op != NULL) {\n            ZSTD_memcpy(op, litPtr, lastLLSize);\n            op += lastLLSize;\n    }   }\n\n    DEBUGLOG(6, \"decoded block of size %u bytes\", (U32)(op - ostart));\n    return (size_t)(op - ostart);\n}\n\nFORCE_INLINE_TEMPLATE size_t\nDONT_VECTORIZE\nZSTD_decompressSequences_body(ZSTD_DCtx* dctx,\n    void* dst, size_t maxDstSize,\n    const void* seqStart, size_t seqSize, int nbSeq,\n    const ZSTD_longOffset_e isLongOffset)\n{\n    const BYTE* ip = (const BYTE*)seqStart;\n    const BYTE* const iend = ip + seqSize;\n    BYTE* const ostart = (BYTE*)dst;\n    BYTE* const oend = dctx->litBufferLocation == ZSTD_not_in_dst ? ZSTD_maybeNullPtrAdd(ostart, maxDstSize) : dctx->litBuffer;\n    BYTE* op = ostart;\n    const BYTE* litPtr = dctx->litPtr;\n    const BYTE* const litEnd = litPtr + dctx->litSize;\n    const BYTE* const prefixStart = (const BYTE*)(dctx->prefixStart);\n    const BYTE* const vBase = (const BYTE*)(dctx->virtualStart);\n    const BYTE* const dictEnd = (const BYTE*)(dctx->dictEnd);\n    DEBUGLOG(5, \"ZSTD_decompressSequences_body: nbSeq = %d\", nbSeq);\n\n    /* Regen sequences */\n    if (nbSeq) {\n        seqState_t seqState;\n        dctx->fseEntropy = 1;\n        { U32 i; for (i = 0; i < ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }\n        RETURN_ERROR_IF(\n            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend - ip)),\n            corruption_detected, \"\");\n        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);\n        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);\n        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);\n        assert(dst != NULL);\n\n#if defined(__GNUC__) && defined(__x86_64__)\n            __asm__(\".p2align 6\");\n            __asm__(\"nop\");\n#  if __GNUC__ >= 7\n            __asm__(\".p2align 5\");\n            __asm__(\"nop\");\n            __asm__(\".p2align 3\");\n#  else\n            __asm__(\".p2align 4\");\n            __asm__(\"nop\");\n            __asm__(\".p2align 3\");\n#  endif\n#endif\n\n        for ( ; nbSeq ; nbSeq--) {\n            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);\n            size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litEnd, prefixStart, vBase, dictEnd);\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n            assert(!ZSTD_isError(oneSeqSize));\n            ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);\n#endif\n            if (UNLIKELY(ZSTD_isError(oneSeqSize)))\n                return oneSeqSize;\n            DEBUGLOG(6, \"regenerated sequence size : %u\", (U32)oneSeqSize);\n            op += oneSeqSize;\n        }\n\n        /* check if reached exact end */\n        assert(nbSeq == 0);\n        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, \"\");\n        /* save reps for next block */\n        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }\n    }\n\n    /* last literal segment */\n    {   size_t const lastLLSize = (size_t)(litEnd - litPtr);\n        DEBUGLOG(6, \"copy last literals : %u\", (U32)lastLLSize);\n        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, \"\");\n        if (op != NULL) {\n            ZSTD_memcpy(op, litPtr, lastLLSize);\n            op += lastLLSize;\n    }   }\n\n    DEBUGLOG(6, \"decoded block of size %u bytes\", (U32)(op - ostart));\n    return (size_t)(op - ostart);\n}\n\nstatic size_t\nZSTD_decompressSequences_default(ZSTD_DCtx* dctx,\n                                 void* dst, size_t maxDstSize,\n                           const void* seqStart, size_t seqSize, int nbSeq,\n                           const ZSTD_longOffset_e isLongOffset)\n{\n    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n}\n\nstatic size_t\nZSTD_decompressSequencesSplitLitBuffer_default(ZSTD_DCtx* dctx,\n                                               void* dst, size_t maxDstSize,\n                                         const void* seqStart, size_t seqSize, int nbSeq,\n                                         const ZSTD_longOffset_e isLongOffset)\n{\n    return ZSTD_decompressSequences_bodySplitLitBuffer(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT\n\nFORCE_INLINE_TEMPLATE\n\nsize_t ZSTD_prefetchMatch(size_t prefetchPos, seq_t const sequence,\n                   const BYTE* const prefixStart, const BYTE* const dictEnd)\n{\n    prefetchPos += sequence.litLength;\n    {   const BYTE* const matchBase = (sequence.offset > prefetchPos) ? dictEnd : prefixStart;\n        /* note : this operation can overflow when seq.offset is really too large, which can only happen when input is corrupted.\n         * No consequence though : memory address is only used for prefetching, not for dereferencing */\n        const BYTE* const match = ZSTD_wrappedPtrSub(ZSTD_wrappedPtrAdd(matchBase, prefetchPos), sequence.offset);\n        PREFETCH_L1(match); PREFETCH_L1(match+CACHELINE_SIZE);   /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */\n    }\n    return prefetchPos + sequence.matchLength;\n}\n\n/* This decoding function employs prefetching\n * to reduce latency impact of cache misses.\n * It's generally employed when block contains a significant portion of long-distance matches\n * or when coupled with a \"cold\" dictionary */\nFORCE_INLINE_TEMPLATE size_t\nZSTD_decompressSequencesLong_body(\n                               ZSTD_DCtx* dctx,\n                               void* dst, size_t maxDstSize,\n                         const void* seqStart, size_t seqSize, int nbSeq,\n                         const ZSTD_longOffset_e isLongOffset)\n{\n    const BYTE* ip = (const BYTE*)seqStart;\n    const BYTE* const iend = ip + seqSize;\n    BYTE* const ostart = (BYTE*)dst;\n    BYTE* const oend = dctx->litBufferLocation == ZSTD_in_dst ? dctx->litBuffer : ZSTD_maybeNullPtrAdd(ostart, maxDstSize);\n    BYTE* op = ostart;\n    const BYTE* litPtr = dctx->litPtr;\n    const BYTE* litBufferEnd = dctx->litBufferEnd;\n    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);\n    const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart);\n    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);\n\n    /* Regen sequences */\n    if (nbSeq) {\n#define STORED_SEQS 8\n#define STORED_SEQS_MASK (STORED_SEQS-1)\n#define ADVANCED_SEQS STORED_SEQS\n        seq_t sequences[STORED_SEQS];\n        int const seqAdvance = MIN(nbSeq, ADVANCED_SEQS);\n        seqState_t seqState;\n        int seqNb;\n        size_t prefetchPos = (size_t)(op-prefixStart); /* track position relative to prefixStart */\n\n        dctx->fseEntropy = 1;\n        { int i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }\n        assert(dst != NULL);\n        assert(iend >= ip);\n        RETURN_ERROR_IF(\n            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),\n            corruption_detected, \"\");\n        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);\n        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);\n        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);\n\n        /* prepare in advance */\n        for (seqNb=0; seqNb<seqAdvance; seqNb++) {\n            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);\n            prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);\n            sequences[seqNb] = sequence;\n        }\n\n        /* decompress without stomping litBuffer */\n        for (; seqNb < nbSeq; seqNb++) {\n            seq_t sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);\n\n            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {\n                /* lit buffer is reaching split point, empty out the first buffer and transition to litExtraBuffer */\n                const size_t leftoverLit = dctx->litBufferEnd - litPtr;\n                if (leftoverLit)\n                {\n                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, \"remaining lit must fit within dstBuffer\");\n                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);\n                    sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;\n                    op += leftoverLit;\n                }\n                litPtr = dctx->litExtraBuffer;\n                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;\n                dctx->litBufferLocation = ZSTD_not_in_dst;\n                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n                    assert(!ZSTD_isError(oneSeqSize));\n                    ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart);\n#endif\n                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;\n\n                    prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);\n                    sequences[seqNb & STORED_SEQS_MASK] = sequence;\n                    op += oneSeqSize;\n            }   }\n            else\n            {\n                /* lit buffer is either wholly contained in first or second split, or not split at all*/\n                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?\n                    ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :\n                    ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n                assert(!ZSTD_isError(oneSeqSize));\n                ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart);\n#endif\n                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;\n\n                prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);\n                sequences[seqNb & STORED_SEQS_MASK] = sequence;\n                op += oneSeqSize;\n            }\n        }\n        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, \"\");\n\n        /* finish queue */\n        seqNb -= seqAdvance;\n        for ( ; seqNb<nbSeq ; seqNb++) {\n            seq_t *sequence = &(sequences[seqNb&STORED_SEQS_MASK]);\n            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequence->litLength > dctx->litBufferEnd) {\n                const size_t leftoverLit = dctx->litBufferEnd - litPtr;\n                if (leftoverLit) {\n                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, \"remaining lit must fit within dstBuffer\");\n                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);\n                    sequence->litLength -= leftoverLit;\n                    op += leftoverLit;\n                }\n                litPtr = dctx->litExtraBuffer;\n                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;\n                dctx->litBufferLocation = ZSTD_not_in_dst;\n                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n                    assert(!ZSTD_isError(oneSeqSize));\n                    ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart);\n#endif\n                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;\n                    op += oneSeqSize;\n                }\n            }\n            else\n            {\n                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?\n                    ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence->litLength - WILDCOPY_OVERLENGTH, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :\n                    ZSTD_execSequence(op, oend, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);\n#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)\n                assert(!ZSTD_isError(oneSeqSize));\n                ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart);\n#endif\n                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;\n                op += oneSeqSize;\n            }\n        }\n\n        /* save reps for next block */\n        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }\n    }\n\n    /* last literal segment */\n    if (dctx->litBufferLocation == ZSTD_split) { /* first deplete literal buffer in dst, then copy litExtraBuffer */\n        size_t const lastLLSize = litBufferEnd - litPtr;\n        RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, \"\");\n        if (op != NULL) {\n            ZSTD_memmove(op, litPtr, lastLLSize);\n            op += lastLLSize;\n        }\n        litPtr = dctx->litExtraBuffer;\n        litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;\n    }\n    {   size_t const lastLLSize = litBufferEnd - litPtr;\n        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, \"\");\n        if (op != NULL) {\n            ZSTD_memmove(op, litPtr, lastLLSize);\n            op += lastLLSize;\n        }\n    }\n\n    return (size_t)(op - ostart);\n}\n\nstatic size_t\nZSTD_decompressSequencesLong_default(ZSTD_DCtx* dctx,\n                                 void* dst, size_t maxDstSize,\n                           const void* seqStart, size_t seqSize, int nbSeq,\n                           const ZSTD_longOffset_e isLongOffset)\n{\n    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */\n\n\n\n#if DYNAMIC_BMI2\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG\nstatic BMI2_TARGET_ATTRIBUTE size_t\nDONT_VECTORIZE\nZSTD_decompressSequences_bmi2(ZSTD_DCtx* dctx,\n                                 void* dst, size_t maxDstSize,\n                           const void* seqStart, size_t seqSize, int nbSeq,\n                           const ZSTD_longOffset_e isLongOffset)\n{\n    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n}\nstatic BMI2_TARGET_ATTRIBUTE size_t\nDONT_VECTORIZE\nZSTD_decompressSequencesSplitLitBuffer_bmi2(ZSTD_DCtx* dctx,\n                                 void* dst, size_t maxDstSize,\n                           const void* seqStart, size_t seqSize, int nbSeq,\n                           const ZSTD_longOffset_e isLongOffset)\n{\n    return ZSTD_decompressSequences_bodySplitLitBuffer(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT\nstatic BMI2_TARGET_ATTRIBUTE size_t\nZSTD_decompressSequencesLong_bmi2(ZSTD_DCtx* dctx,\n                                 void* dst, size_t maxDstSize,\n                           const void* seqStart, size_t seqSize, int nbSeq,\n                           const ZSTD_longOffset_e isLongOffset)\n{\n    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */\n\n#endif /* DYNAMIC_BMI2 */\n\ntypedef size_t (*ZSTD_decompressSequences_t)(\n                            ZSTD_DCtx* dctx,\n                            void* dst, size_t maxDstSize,\n                            const void* seqStart, size_t seqSize, int nbSeq,\n                            const ZSTD_longOffset_e isLongOffset);\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG\nstatic size_t\nZSTD_decompressSequences(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize,\n                   const void* seqStart, size_t seqSize, int nbSeq,\n                   const ZSTD_longOffset_e isLongOffset)\n{\n    DEBUGLOG(5, \"ZSTD_decompressSequences\");\n#if DYNAMIC_BMI2\n    if (ZSTD_DCtx_get_bmi2(dctx)) {\n        return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n    }\n#endif\n    return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n}\nstatic size_t\nZSTD_decompressSequencesSplitLitBuffer(ZSTD_DCtx* dctx, void* dst, size_t maxDstSize,\n                                 const void* seqStart, size_t seqSize, int nbSeq,\n                                 const ZSTD_longOffset_e isLongOffset)\n{\n    DEBUGLOG(5, \"ZSTD_decompressSequencesSplitLitBuffer\");\n#if DYNAMIC_BMI2\n    if (ZSTD_DCtx_get_bmi2(dctx)) {\n        return ZSTD_decompressSequencesSplitLitBuffer_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n    }\n#endif\n    return ZSTD_decompressSequencesSplitLitBuffer_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG */\n\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT\n/* ZSTD_decompressSequencesLong() :\n * decompression function triggered when a minimum share of offsets is considered \"long\",\n * aka out of cache.\n * note : \"long\" definition seems overloaded here, sometimes meaning \"wider than bitstream register\", and sometimes meaning \"farther than memory cache distance\".\n * This function will try to mitigate main memory latency through the use of prefetching */\nstatic size_t\nZSTD_decompressSequencesLong(ZSTD_DCtx* dctx,\n                             void* dst, size_t maxDstSize,\n                             const void* seqStart, size_t seqSize, int nbSeq,\n                             const ZSTD_longOffset_e isLongOffset)\n{\n    DEBUGLOG(5, \"ZSTD_decompressSequencesLong\");\n#if DYNAMIC_BMI2\n    if (ZSTD_DCtx_get_bmi2(dctx)) {\n        return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n    }\n#endif\n  return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);\n}\n#endif /* ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT */\n\n\n/**\n * @returns The total size of the history referenceable by zstd, including\n * both the prefix and the extDict. At @p op any offset larger than this\n * is invalid.\n */\nstatic size_t ZSTD_totalHistorySize(BYTE* op, BYTE const* virtualStart)\n{\n    return (size_t)(op - virtualStart);\n}\n\ntypedef struct {\n    unsigned longOffsetShare;\n    unsigned maxNbAdditionalBits;\n} ZSTD_OffsetInfo;\n\n/* ZSTD_getOffsetInfo() :\n * condition : offTable must be valid\n * @return : \"share\" of long offsets (arbitrarily defined as > (1<<23))\n *           compared to maximum possible of (1<<OffFSELog),\n *           as well as the maximum number additional bits required.\n */\nstatic ZSTD_OffsetInfo\nZSTD_getOffsetInfo(const ZSTD_seqSymbol* offTable, int nbSeq)\n{\n    ZSTD_OffsetInfo info = {0, 0};\n    /* If nbSeq == 0, then the offTable is uninitialized, but we have\n     * no sequences, so both values should be 0.\n     */\n    if (nbSeq != 0) {\n        const void* ptr = offTable;\n        U32 const tableLog = ((const ZSTD_seqSymbol_header*)ptr)[0].tableLog;\n        const ZSTD_seqSymbol* table = offTable + 1;\n        U32 const max = 1 << tableLog;\n        U32 u;\n        DEBUGLOG(5, \"ZSTD_getLongOffsetsShare: (tableLog=%u)\", tableLog);\n\n        assert(max <= (1 << OffFSELog));  /* max not too large */\n        for (u=0; u<max; u++) {\n            info.maxNbAdditionalBits = MAX(info.maxNbAdditionalBits, table[u].nbAdditionalBits);\n            if (table[u].nbAdditionalBits > 22) info.longOffsetShare += 1;\n        }\n\n        assert(tableLog <= OffFSELog);\n        info.longOffsetShare <<= (OffFSELog - tableLog);  /* scale to OffFSELog */\n    }\n\n    return info;\n}\n\n/**\n * @returns The maximum offset we can decode in one read of our bitstream, without\n * reloading more bits in the middle of the offset bits read. Any offsets larger\n * than this must use the long offset decoder.\n */\nstatic size_t ZSTD_maxShortOffset(void)\n{\n    if (MEM_64bits()) {\n        /* We can decode any offset without reloading bits.\n         * This might change if the max window size grows.\n         */\n        ZSTD_STATIC_ASSERT(ZSTD_WINDOWLOG_MAX <= 31);\n        return (size_t)-1;\n    } else {\n        /* The maximum offBase is (1 << (STREAM_ACCUMULATOR_MIN + 1)) - 1.\n         * This offBase would require STREAM_ACCUMULATOR_MIN extra bits.\n         * Then we have to subtract ZSTD_REP_NUM to get the maximum possible offset.\n         */\n        size_t const maxOffbase = ((size_t)1 << (STREAM_ACCUMULATOR_MIN + 1)) - 1;\n        size_t const maxOffset = maxOffbase - ZSTD_REP_NUM;\n        assert(ZSTD_highbit32((U32)maxOffbase) == STREAM_ACCUMULATOR_MIN);\n        return maxOffset;\n    }\n}\n\nsize_t\nZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,\n                              void* dst, size_t dstCapacity,\n                        const void* src, size_t srcSize, const streaming_operation streaming)\n{   /* blockType == blockCompressed */\n    const BYTE* ip = (const BYTE*)src;\n    DEBUGLOG(5, \"ZSTD_decompressBlock_internal (cSize : %u)\", (unsigned)srcSize);\n\n    /* Note : the wording of the specification\n     * allows compressed block to be sized exactly ZSTD_blockSizeMax(dctx).\n     * This generally does not happen, as it makes little sense,\n     * since an uncompressed block would feature same size and have no decompression cost.\n     * Also, note that decoder from reference libzstd before < v1.5.4\n     * would consider this edge case as an error.\n     * As a consequence, avoid generating compressed blocks of size ZSTD_blockSizeMax(dctx)\n     * for broader compatibility with the deployed ecosystem of zstd decoders */\n    RETURN_ERROR_IF(srcSize > ZSTD_blockSizeMax(dctx), srcSize_wrong, \"\");\n\n    /* Decode literals section */\n    {   size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize, dst, dstCapacity, streaming);\n        DEBUGLOG(5, \"ZSTD_decodeLiteralsBlock : cSize=%u, nbLiterals=%zu\", (U32)litCSize, dctx->litSize);\n        if (ZSTD_isError(litCSize)) return litCSize;\n        ip += litCSize;\n        srcSize -= litCSize;\n    }\n\n    /* Build Decoding Tables */\n    {\n        /* Compute the maximum block size, which must also work when !frame and fParams are unset.\n         * Additionally, take the min with dstCapacity to ensure that the totalHistorySize fits in a size_t.\n         */\n        size_t const blockSizeMax = MIN(dstCapacity, ZSTD_blockSizeMax(dctx));\n        size_t const totalHistorySize = ZSTD_totalHistorySize(ZSTD_maybeNullPtrAdd((BYTE*)dst, blockSizeMax), (BYTE const*)dctx->virtualStart);\n        /* isLongOffset must be true if there are long offsets.\n         * Offsets are long if they are larger than ZSTD_maxShortOffset().\n         * We don't expect that to be the case in 64-bit mode.\n         *\n         * We check here to see if our history is large enough to allow long offsets.\n         * If it isn't, then we can't possible have (valid) long offsets. If the offset\n         * is invalid, then it is okay to read it incorrectly.\n         *\n         * If isLongOffsets is true, then we will later check our decoding table to see\n         * if it is even possible to generate long offsets.\n         */\n        ZSTD_longOffset_e isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (totalHistorySize > ZSTD_maxShortOffset()));\n        /* These macros control at build-time which decompressor implementation\n         * we use. If neither is defined, we do some inspection and dispatch at\n         * runtime.\n         */\n#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \\\n    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)\n        int usePrefetchDecoder = dctx->ddictIsCold;\n#else\n        /* Set to 1 to avoid computing offset info if we don't need to.\n         * Otherwise this value is ignored.\n         */\n        int usePrefetchDecoder = 1;\n#endif\n        int nbSeq;\n        size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, srcSize);\n        if (ZSTD_isError(seqHSize)) return seqHSize;\n        ip += seqHSize;\n        srcSize -= seqHSize;\n\n        RETURN_ERROR_IF((dst == NULL || dstCapacity == 0) && nbSeq > 0, dstSize_tooSmall, \"NULL not handled\");\n        RETURN_ERROR_IF(MEM_64bits() && sizeof(size_t) == sizeof(void*) && (size_t)(-1) - (size_t)dst < (size_t)(1 << 20), dstSize_tooSmall,\n                \"invalid dst\");\n\n        /* If we could potentially have long offsets, or we might want to use the prefetch decoder,\n         * compute information about the share of long offsets, and the maximum nbAdditionalBits.\n         * NOTE: could probably use a larger nbSeq limit\n         */\n        if (isLongOffset || (!usePrefetchDecoder && (totalHistorySize > (1u << 24)) && (nbSeq > 8))) {\n            ZSTD_OffsetInfo const info = ZSTD_getOffsetInfo(dctx->OFTptr, nbSeq);\n            if (isLongOffset && info.maxNbAdditionalBits <= STREAM_ACCUMULATOR_MIN) {\n                /* If isLongOffset, but the maximum number of additional bits that we see in our table is small\n                 * enough, then we know it is impossible to have too long an offset in this block, so we can\n                 * use the regular offset decoder.\n                 */\n                isLongOffset = ZSTD_lo_isRegularOffset;\n            }\n            if (!usePrefetchDecoder) {\n                U32 const minShare = MEM_64bits() ? 7 : 20; /* heuristic values, correspond to 2.73% and 7.81% */\n                usePrefetchDecoder = (info.longOffsetShare >= minShare);\n            }\n        }\n\n        dctx->ddictIsCold = 0;\n\n#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \\\n    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)\n        if (usePrefetchDecoder) {\n#else\n        (void)usePrefetchDecoder;\n        {\n#endif\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT\n            return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);\n#endif\n        }\n\n#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG\n        /* else */\n        if (dctx->litBufferLocation == ZSTD_split)\n            return ZSTD_decompressSequencesSplitLitBuffer(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);\n        else\n            return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);\n#endif\n    }\n}\n\n\nZSTD_ALLOW_POINTER_OVERFLOW_ATTR\nvoid ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst, size_t dstSize)\n{\n    if (dst != dctx->previousDstEnd && dstSize > 0) {   /* not contiguous */\n        dctx->dictEnd = dctx->previousDstEnd;\n        dctx->virtualStart = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));\n        dctx->prefixStart = dst;\n        dctx->previousDstEnd = dst;\n    }\n}\n\n\nsize_t ZSTD_decompressBlock_deprecated(ZSTD_DCtx* dctx,\n                                       void* dst, size_t dstCapacity,\n                                 const void* src, size_t srcSize)\n{\n    size_t dSize;\n    dctx->isFrameDecompression = 0;\n    ZSTD_checkContinuity(dctx, dst, dstCapacity);\n    dSize = ZSTD_decompressBlock_internal(dctx, dst, dstCapacity, src, srcSize, not_streaming);\n    FORWARD_IF_ERROR(dSize, \"\");\n    dctx->previousDstEnd = (char*)dst + dSize;\n    return dSize;\n}\n\n\n/* NOTE: Must just wrap ZSTD_decompressBlock_deprecated() */\nsize_t ZSTD_decompressBlock(ZSTD_DCtx* dctx,\n                            void* dst, size_t dstCapacity,\n                      const void* src, size_t srcSize)\n{\n    return ZSTD_decompressBlock_deprecated(dctx, dst, dstCapacity, src, srcSize);\n}\n"
  },
  {
    "path": "src/bled/zstd_decompress_block.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n\n#ifndef ZSTD_DEC_BLOCK_H\n#define ZSTD_DEC_BLOCK_H\n\n/*-*******************************************************\n *  Dependencies\n *********************************************************/\n#include \"zstd_deps.h\"      /* size_t */\n#include \"zstd.h\"           /* DCtx, and some public functions */\n#include \"zstd_internal.h\"  /* blockProperties_t, and some public functions */\n#include \"zstd_decompress_internal.h\"  /* ZSTD_seqSymbol */\n\n\n/* ===   Prototypes   === */\n\n/* note: prototypes already published within `zstd.h` :\n * ZSTD_decompressBlock()\n */\n\n/* note: prototypes already published within `zstd_internal.h` :\n * ZSTD_getcBlockSize()\n * ZSTD_decodeSeqHeaders()\n */\n\n\n /* Streaming state is used to inform allocation of the literal buffer */\ntypedef enum {\n    not_streaming = 0,\n    is_streaming = 1\n} streaming_operation;\n\n/* ZSTD_decompressBlock_internal() :\n * decompress block, starting at `src`,\n * into destination buffer `dst`.\n * @return : decompressed block size,\n *           or an error code (which can be tested using ZSTD_isError())\n */\nsize_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,\n                               void* dst, size_t dstCapacity,\n                         const void* src, size_t srcSize, const streaming_operation streaming);\n\n/* ZSTD_buildFSETable() :\n * generate FSE decoding table for one symbol (ll, ml or off)\n * this function must be called with valid parameters only\n * (dt is large enough, normalizedCounter distribution total is a power of 2, max is within range, etc.)\n * in which case it cannot fail.\n * The workspace must be 4-byte aligned and at least ZSTD_BUILD_FSE_TABLE_WKSP_SIZE bytes, which is\n * defined in zstd_decompress_internal.h.\n * Internal use only.\n */\nvoid ZSTD_buildFSETable(ZSTD_seqSymbol* dt,\n             const short* normalizedCounter, unsigned maxSymbolValue,\n             const U32* baseValue, const U8* nbAdditionalBits,\n                   unsigned tableLog, void* wksp, size_t wkspSize,\n                   int bmi2);\n\n/* Internal definition of ZSTD_decompressBlock() to avoid deprecation warnings. */\nsize_t ZSTD_decompressBlock_deprecated(ZSTD_DCtx* dctx,\n                            void* dst, size_t dstCapacity,\n                      const void* src, size_t srcSize);\n\n\n#endif /* ZSTD_DEC_BLOCK_H */\n"
  },
  {
    "path": "src/bled/zstd_decompress_internal.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n\n/* zstd_decompress_internal:\n * objects and definitions shared within lib/decompress modules */\n\n #ifndef ZSTD_DECOMPRESS_INTERNAL_H\n #define ZSTD_DECOMPRESS_INTERNAL_H\n\n\n/*-*******************************************************\n *  Dependencies\n *********************************************************/\n#include \"zstd_mem.h\"        /* BYTE, U16, U32 */\n#include \"zstd_internal.h\"   /* constants : MaxLL, MaxML, MaxOff, LLFSELog, etc. */\n\n\n\n/*-*******************************************************\n *  Constants\n *********************************************************/\nstatic UNUSED_ATTR const U32 LL_base[MaxLL+1] = {\n                 0,    1,    2,     3,     4,     5,     6,      7,\n                 8,    9,   10,    11,    12,    13,    14,     15,\n                16,   18,   20,    22,    24,    28,    32,     40,\n                48,   64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,\n                0x2000, 0x4000, 0x8000, 0x10000 };\n\nstatic UNUSED_ATTR const U32 OF_base[MaxOff+1] = {\n                 0,        1,       1,       5,     0xD,     0x1D,     0x3D,     0x7D,\n                 0xFD,   0x1FD,   0x3FD,   0x7FD,   0xFFD,   0x1FFD,   0x3FFD,   0x7FFD,\n                 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD,\n                 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD, 0x1FFFFFFD, 0x3FFFFFFD, 0x7FFFFFFD };\n\nstatic UNUSED_ATTR const U8 OF_bits[MaxOff+1] = {\n                     0,  1,  2,  3,  4,  5,  6,  7,\n                     8,  9, 10, 11, 12, 13, 14, 15,\n                    16, 17, 18, 19, 20, 21, 22, 23,\n                    24, 25, 26, 27, 28, 29, 30, 31 };\n\nstatic UNUSED_ATTR const U32 ML_base[MaxML+1] = {\n                     3,  4,  5,    6,     7,     8,     9,    10,\n                    11, 12, 13,   14,    15,    16,    17,    18,\n                    19, 20, 21,   22,    23,    24,    25,    26,\n                    27, 28, 29,   30,    31,    32,    33,    34,\n                    35, 37, 39,   41,    43,    47,    51,    59,\n                    67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803,\n                    0x1003, 0x2003, 0x4003, 0x8003, 0x10003 };\n\n\n/*-*******************************************************\n *  Decompression types\n *********************************************************/\n typedef struct {\n     U32 fastMode;\n     U32 tableLog;\n } ZSTD_seqSymbol_header;\n\n typedef struct {\n     U16  nextState;\n     BYTE nbAdditionalBits;\n     BYTE nbBits;\n     U32  baseValue;\n } ZSTD_seqSymbol;\n\n #define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))\n\n#define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE (sizeof(S16) * (MaxSeq + 1) + (1u << MaxFSELog) + sizeof(U64))\n#define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE_U32 ((ZSTD_BUILD_FSE_TABLE_WKSP_SIZE + sizeof(U32) - 1) / sizeof(U32))\n#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12\n\ntypedef struct {\n    ZSTD_seqSymbol LLTable[SEQSYMBOL_TABLE_SIZE(LLFSELog)];    /* Note : Space reserved for FSE Tables */\n    ZSTD_seqSymbol OFTable[SEQSYMBOL_TABLE_SIZE(OffFSELog)];   /* is also used as temporary workspace while building hufTable during DDict creation */\n    ZSTD_seqSymbol MLTable[SEQSYMBOL_TABLE_SIZE(MLFSELog)];    /* and therefore must be at least HUF_DECOMPRESS_WORKSPACE_SIZE large */\n    HUF_DTable hufTable[HUF_DTABLE_SIZE(ZSTD_HUFFDTABLE_CAPACITY_LOG)];  /* can accommodate HUF_decompress4X */\n    U32 rep[ZSTD_REP_NUM];\n    U32 workspace[ZSTD_BUILD_FSE_TABLE_WKSP_SIZE_U32];\n} ZSTD_entropyDTables_t;\n\ntypedef enum { ZSTDds_getFrameHeaderSize, ZSTDds_decodeFrameHeader,\n               ZSTDds_decodeBlockHeader, ZSTDds_decompressBlock,\n               ZSTDds_decompressLastBlock, ZSTDds_checkChecksum,\n               ZSTDds_decodeSkippableHeader, ZSTDds_skipFrame } ZSTD_dStage;\n\ntypedef enum { zdss_init=0, zdss_loadHeader,\n               zdss_read, zdss_load, zdss_flush } ZSTD_dStreamStage;\n\ntypedef enum {\n    ZSTD_use_indefinitely = -1,  /* Use the dictionary indefinitely */\n    ZSTD_dont_use = 0,           /* Do not use the dictionary (if one exists free it) */\n    ZSTD_use_once = 1            /* Use the dictionary once and set to ZSTD_dont_use */\n} ZSTD_dictUses_e;\n\n/* Hashset for storing references to multiple ZSTD_DDict within ZSTD_DCtx */\ntypedef struct {\n    const ZSTD_DDict** ddictPtrTable;\n    size_t ddictPtrTableSize;\n    size_t ddictPtrCount;\n} ZSTD_DDictHashSet;\n\n#ifndef ZSTD_DECODER_INTERNAL_BUFFER\n#  define ZSTD_DECODER_INTERNAL_BUFFER  (1 << 16)\n#endif\n\n#define ZSTD_LBMIN 64\n#define ZSTD_LBMAX (128 << 10)\n\n/* extra buffer, compensates when dst is not large enough to store litBuffer */\n#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)\n\ntypedef enum {\n    ZSTD_not_in_dst = 0,  /* Stored entirely within litExtraBuffer */\n    ZSTD_in_dst = 1,           /* Stored entirely within dst (in memory after current output write) */\n    ZSTD_split = 2            /* Split between litExtraBuffer and dst */\n} ZSTD_litLocation_e;\n\nstruct ZSTD_DCtx_s\n{\n    const ZSTD_seqSymbol* LLTptr;\n    const ZSTD_seqSymbol* MLTptr;\n    const ZSTD_seqSymbol* OFTptr;\n    const HUF_DTable* HUFptr;\n    ZSTD_entropyDTables_t entropy;\n    U32 workspace[HUF_DECOMPRESS_WORKSPACE_SIZE_U32];   /* space needed when building huffman tables */\n    const void* previousDstEnd;   /* detect continuity */\n    const void* prefixStart;      /* start of current segment */\n    const void* virtualStart;     /* virtual start of previous segment if it was just before current one */\n    const void* dictEnd;          /* end of previous segment */\n    size_t expected;\n    ZSTD_frameHeader fParams;\n    U64 processedCSize;\n    U64 decodedSize;\n    blockType_e bType;            /* used in ZSTD_decompressContinue(), store blockType between block header decoding and block decompression stages */\n    ZSTD_dStage stage;\n    U32 litEntropy;\n    U32 fseEntropy;\n    XXH64_state_t xxhState;\n    size_t headerSize;\n    ZSTD_format_e format;\n    ZSTD_forceIgnoreChecksum_e forceIgnoreChecksum;   /* User specified: if == 1, will ignore checksums in compressed frame. Default == 0 */\n    U32 validateChecksum;         /* if == 1, will validate checksum. Is == 1 if (fParams.checksumFlag == 1) and (forceIgnoreChecksum == 0). */\n    const BYTE* litPtr;\n    ZSTD_customMem customMem;\n    size_t litSize;\n    size_t rleSize;\n    size_t staticSize;\n    int isFrameDecompression;\n#if DYNAMIC_BMI2 != 0\n    int bmi2;                     /* == 1 if the CPU supports BMI2 and 0 otherwise. CPU support is determined dynamically once per context lifetime. */\n#endif\n\n    /* dictionary */\n    ZSTD_DDict* ddictLocal;\n    const ZSTD_DDict* ddict;     /* set by ZSTD_initDStream_usingDDict(), or ZSTD_DCtx_refDDict() */\n    U32 dictID;\n    int ddictIsCold;             /* if == 1 : dictionary is \"new\" for working context, and presumed \"cold\" (not in cpu cache) */\n    ZSTD_dictUses_e dictUses;\n    ZSTD_DDictHashSet* ddictSet;                    /* Hash set for multiple ddicts */\n    ZSTD_refMultipleDDicts_e refMultipleDDicts;     /* User specified: if == 1, will allow references to multiple DDicts. Default == 0 (disabled) */\n    int disableHufAsm;\n    int maxBlockSizeParam;\n\n    /* streaming */\n    ZSTD_dStreamStage streamStage;\n    char*  inBuff;\n    size_t inBuffSize;\n    size_t inPos;\n    size_t maxWindowSize;\n    char*  outBuff;\n    size_t outBuffSize;\n    size_t outStart;\n    size_t outEnd;\n    size_t lhSize;\n#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)\n    void* legacyContext;\n    U32 previousLegacyVersion;\n    U32 legacyVersion;\n#endif\n    U32 hostageByte;\n    int noForwardProgress;\n    ZSTD_bufferMode_e outBufferMode;\n    ZSTD_outBuffer expectedOutBuffer;\n\n    /* workspace */\n    BYTE* litBuffer;\n    const BYTE* litBufferEnd;\n    ZSTD_litLocation_e litBufferLocation;\n    BYTE litExtraBuffer[ZSTD_LITBUFFEREXTRASIZE + WILDCOPY_OVERLENGTH]; /* literal buffer can be split between storage within dst and within this scratch buffer */\n    BYTE headerBuffer[ZSTD_FRAMEHEADERSIZE_MAX];\n\n    size_t oversizedDuration;\n\n#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION\n    void const* dictContentBeginForFuzzing;\n    void const* dictContentEndForFuzzing;\n#endif\n\n    /* Tracing */\n#if ZSTD_TRACE\n    ZSTD_TraceCtx traceCtx;\n#endif\n};  /* typedef'd to ZSTD_DCtx within \"zstd.h\" */\n\nMEM_STATIC int ZSTD_DCtx_get_bmi2(const struct ZSTD_DCtx_s *dctx) {\n#if DYNAMIC_BMI2 != 0\n\treturn dctx->bmi2;\n#else\n    (void)dctx;\n\treturn 0;\n#endif\n}\n\n/*-*******************************************************\n *  Shared internal functions\n *********************************************************/\n\n/*! ZSTD_loadDEntropy() :\n *  dict : must point at beginning of a valid zstd dictionary.\n * @return : size of dictionary header (size of magic number + dict ID + entropy tables) */\nsize_t ZSTD_loadDEntropy(ZSTD_entropyDTables_t* entropy,\n                   const void* const dict, size_t const dictSize);\n\n/*! ZSTD_checkContinuity() :\n *  check if next `dst` follows previous position, where decompression ended.\n *  If yes, do nothing (continue on current segment).\n *  If not, classify previous segment as \"external dictionary\", and start a new segment.\n *  This function cannot fail. */\nvoid ZSTD_checkContinuity(ZSTD_DCtx* dctx, const void* dst, size_t dstSize);\n\n\n#endif /* ZSTD_DECOMPRESS_INTERNAL_H */\n"
  },
  {
    "path": "src/bled/zstd_deps.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/* This file provides common libc dependencies that zstd requires.\n * The purpose is to allow replacing this file with a custom implementation\n * to compile zstd without libc support.\n */\n\n/* Need:\n * NULL\n * INT_MAX\n * UINT_MAX\n * ZSTD_memcpy()\n * ZSTD_memset()\n * ZSTD_memmove()\n */\n#ifndef ZSTD_DEPS_COMMON\n#define ZSTD_DEPS_COMMON\n\n/* Even though we use qsort_r only for the dictionary builder, the macro\n * _GNU_SOURCE has to be declared *before* the inclusion of any standard\n * header and the script 'combine.sh' combines the whole zstd source code\n * in a single file.\n */\n#if defined(__linux) || defined(__linux__) || defined(linux) || defined(__gnu_linux__) || \\\n    defined(__CYGWIN__) || defined(__MSYS__)\n#if !defined(_GNU_SOURCE) && !defined(__ANDROID__) /* NDK doesn't ship qsort_r(). */\n#define _GNU_SOURCE\n#endif\n#endif\n\n#include <limits.h>\n#include <stddef.h>\n#include <string.h>\n#include <crtdefs.h>\n#include \"zstd_config.h\"\n\n#if defined(__GNUC__) && __GNUC__ >= 4\n# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))\n# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))\n# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))\n#else\n# define ZSTD_memcpy(d,s,l) memcpy((d),(s),(l))\n# define ZSTD_memmove(d,s,l) memmove((d),(s),(l))\n# define ZSTD_memset(p,v,l) memset((p),(v),(l))\n#endif\n\n#endif /* ZSTD_DEPS_COMMON */\n\n/* Need:\n * ZSTD_malloc()\n * ZSTD_free()\n * ZSTD_calloc()\n */\n#ifdef ZSTD_DEPS_NEED_MALLOC\n#ifndef ZSTD_DEPS_MALLOC\n#define ZSTD_DEPS_MALLOC\n\n#include <stdlib.h>\n\n#define ZSTD_malloc(s) malloc(s)\n#define ZSTD_calloc(n,s) calloc((n), (s))\n#define ZSTD_free(p) free((p))\n\n#endif /* ZSTD_DEPS_MALLOC */\n#endif /* ZSTD_DEPS_NEED_MALLOC */\n\n/*\n * Provides 64-bit math support.\n * Need:\n * U64 ZSTD_div64(U64 dividend, U32 divisor)\n */\n#ifdef ZSTD_DEPS_NEED_MATH64\n#ifndef ZSTD_DEPS_MATH64\n#define ZSTD_DEPS_MATH64\n\n#define ZSTD_div64(dividend, divisor) ((dividend) / (divisor))\n\n#endif /* ZSTD_DEPS_MATH64 */\n#endif /* ZSTD_DEPS_NEED_MATH64 */\n\n/* Need:\n * assert()\n */\n#ifdef ZSTD_DEPS_NEED_ASSERT\n#ifndef ZSTD_DEPS_ASSERT\n#define ZSTD_DEPS_ASSERT\n\n#include <assert.h>\n\n#endif /* ZSTD_DEPS_ASSERT */\n\n#else\n\n#ifndef assert\n#define assert(condition) ((void)0)\n#endif\n\n#endif /* ZSTD_DEPS_NEED_ASSERT */\n\n/* Need:\n * ZSTD_DEBUG_PRINT()\n */\n#ifdef ZSTD_DEPS_NEED_IO\n#ifndef ZSTD_DEPS_IO\n#define ZSTD_DEPS_IO\n\n#include <stdio.h>\n#define ZSTD_DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)\n\n#endif /* ZSTD_DEPS_IO */\n#endif /* ZSTD_DEPS_NEED_IO */\n\n/* Only requested when <stdint.h> is known to be present.\n * Need:\n * intptr_t\n */\n#ifdef ZSTD_DEPS_NEED_STDINT\n#ifndef ZSTD_DEPS_STDINT\n#define ZSTD_DEPS_STDINT\n\n#include <stdint.h>\n\n#endif /* ZSTD_DEPS_STDINT */\n#endif /* ZSTD_DEPS_NEED_STDINT */\n\n#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])\n\n#include \"libbb.h\"\n\n#if (DEBUGLEVEL >= 1)\n#define RAWLOG(l, ...)         { if (l <= ZSTD_DEBUGLEVEL) bb_printf(__VA_ARGS__); }\n#define DEBUGLOG(l, ...)       { if (l <= ZSTD_DEBUGLEVEL) bb_printf(__VA_ARGS__); }\n#else\n#define RAWLOG(l, ...)         do { } while (0)\n#define DEBUGLOG(l, ...)       do { } while (0)\n#endif\n"
  },
  {
    "path": "src/bled/zstd_entropy_common.c",
    "content": "/* ******************************************************************\n * Common functions of New Generation Entropy library\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n *  You can contact the author at :\n *  - FSE+HUF source repository : https://github.com/Cyan4973/FiniteStateEntropy\n *  - Public forum : https://groups.google.com/forum/#!forum/lz4c\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n****************************************************************** */\n\n/* *************************************\n*  Dependencies\n***************************************/\n#include \"zstd_mem.h\"\n#include \"zstd_error_private.h\"  /* ERR_*, ERROR */\n#define FSE_STATIC_LINKING_ONLY  /* FSE_MIN_TABLELOG */\n#include \"fse.h\"\n#include \"huf.h\"\n#include \"zstd_bits.h\"           /* ZSDT_highbit32, ZSTD_countTrailingZeros32 */\n\n\n/*===   Version   ===*/\nunsigned FSE_versionNumber(void) { return FSE_VERSION_NUMBER; }\n\n\n/*===   Error Management   ===*/\nunsigned FSE_isError(size_t code) { return ERR_isError(code); }\nconst char* FSE_getErrorName(size_t code) { return ERR_getErrorName(code); }\n\nunsigned HUF_isError(size_t code) { return ERR_isError(code); }\nconst char* HUF_getErrorName(size_t code) { return ERR_getErrorName(code); }\n\n\n/*-**************************************************************\n*  FSE NCount encoding-decoding\n****************************************************************/\nFORCE_INLINE_TEMPLATE\nsize_t FSE_readNCount_body(short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,\n                           const void* headerBuffer, size_t hbSize)\n{\n    const BYTE* const istart = (const BYTE*) headerBuffer;\n    const BYTE* const iend = istart + hbSize;\n    const BYTE* ip = istart;\n    int nbBits;\n    int remaining;\n    int threshold;\n    U32 bitStream;\n    int bitCount;\n    unsigned charnum = 0;\n    unsigned const maxSV1 = *maxSVPtr + 1;\n    int previous0 = 0;\n\n    if (hbSize < 8) {\n        /* This function only works when hbSize >= 8 */\n        char buffer[8] = {0};\n        ZSTD_memcpy(buffer, headerBuffer, hbSize);\n        {   size_t const countSize = FSE_readNCount(normalizedCounter, maxSVPtr, tableLogPtr,\n                                                    buffer, sizeof(buffer));\n            if (FSE_isError(countSize)) return countSize;\n            if (countSize > hbSize) return ERROR(corruption_detected);\n            return countSize;\n    }   }\n    assert(hbSize >= 8);\n\n    /* init */\n    ZSTD_memset(normalizedCounter, 0, (*maxSVPtr+1) * sizeof(normalizedCounter[0]));   /* all symbols not present in NCount have a frequency of 0 */\n    bitStream = MEM_readLE32(ip);\n    nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG;   /* extract tableLog */\n    if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);\n    bitStream >>= 4;\n    bitCount = 4;\n    *tableLogPtr = nbBits;\n    remaining = (1<<nbBits)+1;\n    threshold = 1<<nbBits;\n    nbBits++;\n\n    for (;;) {\n        if (previous0) {\n            /* Count the number of repeats. Each time the\n             * 2-bit repeat code is 0b11 there is another\n             * repeat.\n             * Avoid UB by setting the high bit to 1.\n             */\n            int repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;\n            while (repeats >= 12) {\n                charnum += 3 * 12;\n                if (LIKELY(ip <= iend-7)) {\n                    ip += 3;\n                } else {\n                    bitCount -= (int)(8 * (iend - 7 - ip));\n                    bitCount &= 31;\n                    ip = iend - 4;\n                }\n                bitStream = MEM_readLE32(ip) >> bitCount;\n                repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;\n            }\n            charnum += 3 * repeats;\n            bitStream >>= 2 * repeats;\n            bitCount += 2 * repeats;\n\n            /* Add the final repeat which isn't 0b11. */\n            assert((bitStream & 3) < 3);\n            charnum += bitStream & 3;\n            bitCount += 2;\n\n            /* This is an error, but break and return an error\n             * at the end, because returning out of a loop makes\n             * it harder for the compiler to optimize.\n             */\n            if (charnum >= maxSV1) break;\n\n            /* We don't need to set the normalized count to 0\n             * because we already memset the whole buffer to 0.\n             */\n\n            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {\n                assert((bitCount >> 3) <= 3); /* For first condition to work */\n                ip += bitCount>>3;\n                bitCount &= 7;\n            } else {\n                bitCount -= (int)(8 * (iend - 4 - ip));\n                bitCount &= 31;\n                ip = iend - 4;\n            }\n            bitStream = MEM_readLE32(ip) >> bitCount;\n        }\n        {\n            int const max = (2*threshold-1) - remaining;\n            int count;\n\n            if ((bitStream & (threshold-1)) < (U32)max) {\n                count = bitStream & (threshold-1);\n                bitCount += nbBits-1;\n            } else {\n                count = bitStream & (2*threshold-1);\n                if (count >= threshold) count -= max;\n                bitCount += nbBits;\n            }\n\n            count--;   /* extra accuracy */\n            /* When it matters (small blocks), this is a\n             * predictable branch, because we don't use -1.\n             */\n            if (count >= 0) {\n                remaining -= count;\n            } else {\n                assert(count == -1);\n                remaining += count;\n            }\n            normalizedCounter[charnum++] = (short)count;\n            previous0 = !count;\n\n            assert(threshold > 1);\n            if (remaining < threshold) {\n                /* This branch can be folded into the\n                 * threshold update condition because we\n                 * know that threshold > 1.\n                 */\n                if (remaining <= 1) break;\n                nbBits = ZSTD_highbit32(remaining) + 1;\n                threshold = 1 << (nbBits - 1);\n            }\n            if (charnum >= maxSV1) break;\n\n            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {\n                ip += bitCount>>3;\n                bitCount &= 7;\n            } else {\n                bitCount -= (int)(8 * (iend - 4 - ip));\n                bitCount &= 31;\n                ip = iend - 4;\n            }\n            bitStream = MEM_readLE32(ip) >> bitCount;\n    }   }\n    if (remaining != 1) return ERROR(corruption_detected);\n    /* Only possible when there are too many zeros. */\n    if (charnum > maxSV1) return ERROR(maxSymbolValue_tooSmall);\n    if (bitCount > 32) return ERROR(corruption_detected);\n    *maxSVPtr = charnum-1;\n\n    ip += (bitCount+7)>>3;\n    return ip-istart;\n}\n\n/* Avoids the FORCE_INLINE of the _body() function. */\nstatic size_t FSE_readNCount_body_default(\n        short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,\n        const void* headerBuffer, size_t hbSize)\n{\n    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);\n}\n\n#if DYNAMIC_BMI2\nBMI2_TARGET_ATTRIBUTE static size_t FSE_readNCount_body_bmi2(\n        short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,\n        const void* headerBuffer, size_t hbSize)\n{\n    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);\n}\n#endif\n\nsize_t FSE_readNCount_bmi2(\n        short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,\n        const void* headerBuffer, size_t hbSize, int bmi2)\n{\n#if DYNAMIC_BMI2\n    if (bmi2) {\n        return FSE_readNCount_body_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);\n    }\n#endif\n    (void)bmi2;\n    return FSE_readNCount_body_default(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);\n}\n\nsize_t FSE_readNCount(\n        short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,\n        const void* headerBuffer, size_t hbSize)\n{\n    return FSE_readNCount_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize, /* bmi2 */ 0);\n}\n\n\n/*! HUF_readStats() :\n    Read compact Huffman tree, saved by HUF_writeCTable().\n    `huffWeight` is destination buffer.\n    `rankStats` is assumed to be a table of at least HUF_TABLELOG_MAX U32.\n    @return : size read from `src` , or an error Code .\n    Note : Needed by HUF_readCTable() and HUF_readDTableX?() .\n*/\nsize_t HUF_readStats(BYTE* huffWeight, size_t hwSize, U32* rankStats,\n                     U32* nbSymbolsPtr, U32* tableLogPtr,\n                     const void* src, size_t srcSize)\n{\n    U32 wksp[HUF_READ_STATS_WORKSPACE_SIZE_U32];\n    return HUF_readStats_wksp(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, wksp, sizeof(wksp), /* flags */ 0);\n}\n\nFORCE_INLINE_TEMPLATE size_t\nHUF_readStats_body(BYTE* huffWeight, size_t hwSize, U32* rankStats,\n                   U32* nbSymbolsPtr, U32* tableLogPtr,\n                   const void* src, size_t srcSize,\n                   void* workSpace, size_t wkspSize,\n                   int bmi2)\n{\n    U32 weightTotal;\n    const BYTE* ip = (const BYTE*) src;\n    size_t iSize;\n    size_t oSize;\n\n    if (!srcSize) return ERROR(srcSize_wrong);\n    iSize = ip[0];\n    /* ZSTD_memset(huffWeight, 0, hwSize);   *//* is not necessary, even though some analyzer complain ... */\n\n    if (iSize >= 128) {  /* special header */\n        oSize = iSize - 127;\n        iSize = ((oSize+1)/2);\n        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);\n        if (oSize >= hwSize) return ERROR(corruption_detected);\n        ip += 1;\n        {   U32 n;\n            for (n=0; n<oSize; n+=2) {\n                huffWeight[n]   = ip[n/2] >> 4;\n                huffWeight[n+1] = ip[n/2] & 15;\n    }   }   }\n    else  {   /* header compressed with FSE (normal case) */\n        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);\n        /* max (hwSize-1) values decoded, as last one is implied */\n        oSize = FSE_decompress_wksp_bmi2(huffWeight, hwSize-1, ip+1, iSize, 6, workSpace, wkspSize, bmi2);\n        if (FSE_isError(oSize)) return oSize;\n    }\n\n    /* collect weight stats */\n    ZSTD_memset(rankStats, 0, (HUF_TABLELOG_MAX + 1) * sizeof(U32));\n    weightTotal = 0;\n    {   U32 n; for (n=0; n<oSize; n++) {\n            if (huffWeight[n] > HUF_TABLELOG_MAX) return ERROR(corruption_detected);\n            rankStats[huffWeight[n]]++;\n            weightTotal += (1 << huffWeight[n]) >> 1;\n    }   }\n    if (weightTotal == 0) return ERROR(corruption_detected);\n\n    /* get last non-null symbol weight (implied, total must be 2^n) */\n    {   U32 const tableLog = ZSTD_highbit32(weightTotal) + 1;\n        if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected);\n        *tableLogPtr = tableLog;\n        /* determine last weight */\n        {   U32 const total = 1 << tableLog;\n            U32 const rest = total - weightTotal;\n            U32 const verif = 1 << ZSTD_highbit32(rest);\n            U32 const lastWeight = ZSTD_highbit32(rest) + 1;\n            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */\n            huffWeight[oSize] = (BYTE)lastWeight;\n            rankStats[lastWeight]++;\n    }   }\n\n    /* check tree construction validity */\n    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */\n\n    /* results */\n    *nbSymbolsPtr = (U32)(oSize+1);\n    return iSize+1;\n}\n\n/* Avoids the FORCE_INLINE of the _body() function. */\nstatic size_t HUF_readStats_body_default(BYTE* huffWeight, size_t hwSize, U32* rankStats,\n                     U32* nbSymbolsPtr, U32* tableLogPtr,\n                     const void* src, size_t srcSize,\n                     void* workSpace, size_t wkspSize)\n{\n    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 0);\n}\n\n#if DYNAMIC_BMI2\nstatic BMI2_TARGET_ATTRIBUTE size_t HUF_readStats_body_bmi2(BYTE* huffWeight, size_t hwSize, U32* rankStats,\n                     U32* nbSymbolsPtr, U32* tableLogPtr,\n                     const void* src, size_t srcSize,\n                     void* workSpace, size_t wkspSize)\n{\n    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 1);\n}\n#endif\n\nsize_t HUF_readStats_wksp(BYTE* huffWeight, size_t hwSize, U32* rankStats,\n                     U32* nbSymbolsPtr, U32* tableLogPtr,\n                     const void* src, size_t srcSize,\n                     void* workSpace, size_t wkspSize,\n                     int flags)\n{\n#if DYNAMIC_BMI2\n    if (flags & HUF_flags_bmi2) {\n        return HUF_readStats_body_bmi2(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);\n    }\n#endif\n    (void)flags;\n    return HUF_readStats_body_default(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);\n}\n"
  },
  {
    "path": "src/bled/zstd_error_private.c",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/* The purpose of this file is to have a single list of error strings embedded in binary */\n\n#include \"zstd_error_private.h\"\n\nconst char* ERR_getErrorString(ERR_enum code)\n{\n#ifdef ZSTD_STRIP_ERROR_STRINGS\n    (void)code;\n    return \"Error strings stripped\";\n#else\n    static const char* const notErrorCode = \"Unspecified error code\";\n    switch( code )\n    {\n    case PREFIX(no_error): return \"No error detected\";\n    case PREFIX(GENERIC):  return \"Error (generic)\";\n    case PREFIX(prefix_unknown): return \"Unknown frame descriptor\";\n    case PREFIX(version_unsupported): return \"Version not supported\";\n    case PREFIX(frameParameter_unsupported): return \"Unsupported frame parameter\";\n    case PREFIX(frameParameter_windowTooLarge): return \"Frame requires too much memory for decoding\";\n    case PREFIX(corruption_detected): return \"Data corruption detected\";\n    case PREFIX(checksum_wrong): return \"Restored data doesn't match checksum\";\n    case PREFIX(literals_headerWrong): return \"Header of Literals' block doesn't respect format specification\";\n    case PREFIX(parameter_unsupported): return \"Unsupported parameter\";\n    case PREFIX(parameter_combination_unsupported): return \"Unsupported combination of parameters\";\n    case PREFIX(parameter_outOfBound): return \"Parameter is out of bound\";\n    case PREFIX(init_missing): return \"Context should be init first\";\n    case PREFIX(memory_allocation): return \"Allocation error : not enough memory\";\n    case PREFIX(workSpace_tooSmall): return \"workSpace buffer is not large enough\";\n    case PREFIX(stage_wrong): return \"Operation not authorized at current processing stage\";\n    case PREFIX(tableLog_tooLarge): return \"tableLog requires too much memory : unsupported\";\n    case PREFIX(maxSymbolValue_tooLarge): return \"Unsupported max Symbol Value : too large\";\n    case PREFIX(maxSymbolValue_tooSmall): return \"Specified maxSymbolValue is too small\";\n    case PREFIX(stabilityCondition_notRespected): return \"pledged buffer stability condition is not respected\";\n    case PREFIX(dictionary_corrupted): return \"Dictionary is corrupted\";\n    case PREFIX(dictionary_wrong): return \"Dictionary mismatch\";\n    case PREFIX(dictionaryCreation_failed): return \"Cannot create Dictionary from provided samples\";\n    case PREFIX(dstSize_tooSmall): return \"Destination buffer is too small\";\n    case PREFIX(srcSize_wrong): return \"Src size is incorrect\";\n    case PREFIX(dstBuffer_null): return \"Operation on NULL destination buffer\";\n    case PREFIX(noForwardProgress_destFull): return \"Operation made no progress over multiple calls, due to output buffer being full\";\n    case PREFIX(noForwardProgress_inputEmpty): return \"Operation made no progress over multiple calls, due to input being empty\";\n        /* following error codes are not stable and may be removed or changed in a future version */\n    case PREFIX(frameIndex_tooLarge): return \"Frame index is too large\";\n    case PREFIX(seekableIO): return \"An I/O error occurred when reading/seeking\";\n    case PREFIX(dstBuffer_wrong): return \"Destination buffer is wrong\";\n    case PREFIX(srcBuffer_wrong): return \"Source buffer is wrong\";\n    case PREFIX(sequenceProducer_failed): return \"Block-level external sequence producer returned an error code\";\n    case PREFIX(externalSequences_invalid): return \"External sequences are not valid\";\n    case PREFIX(maxCode):\n    default: return notErrorCode;\n    }\n#endif\n}\n"
  },
  {
    "path": "src/bled/zstd_error_private.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n/* Note : this module is expected to remain private, do not expose it */\n\n#ifndef ERROR_H_MODULE\n#define ERROR_H_MODULE\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n\n/* ****************************************\n*  Dependencies\n******************************************/\n#include \"zstd_errors.h\"     /* enum list */\n#include \"zstd_compiler.h\"\n#include \"zstd_deps.h\"       /* size_t */\n\n\n/* ****************************************\n*  Compiler-specific\n******************************************/\n#if defined(__GNUC__)\n#  define ERR_STATIC static __attribute__((unused))\n#elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)\n#  define ERR_STATIC static inline\n#elif defined(_MSC_VER)\n#  define ERR_STATIC static __inline\n#else\n#  define ERR_STATIC static  /* this version may generate warnings for unused static functions; disable the relevant warning */\n#endif\n\n\n/*-****************************************\n*  Customization (error_public.h)\n******************************************/\ntypedef ZSTD_ErrorCode ERR_enum;\n#define PREFIX(name) ZSTD_error_##name\n\n\n/*-****************************************\n*  Error codes handling\n******************************************/\n#undef ERROR   /* already defined on Visual Studio */\n#define ERROR(name) ZSTD_ERROR(name)\n#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))\n\nERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }\n\nERR_STATIC ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); }\n\n/* check and forward error code */\n#define CHECK_V_F(e, f)     \\\n    size_t const e = f;     \\\n    do {                    \\\n        if (ERR_isError(e)) \\\n            return e;       \\\n    } while (0)\n#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)\n\n\n/*-****************************************\n*  Error Strings\n******************************************/\n\nconst char* ERR_getErrorString(ERR_enum code);   /* error_private.c */\n\nERR_STATIC const char* ERR_getErrorName(size_t code)\n{\n    return ERR_getErrorString(ERR_getErrorCode(code));\n}\n\n/**\n * Ignore: this is an internal helper.\n *\n * This is a helper function to help force C99-correctness during compilation.\n * Under strict compilation modes, variadic macro arguments can't be empty.\n * However, variadic function arguments can be. Using a function therefore lets\n * us statically check that at least one (string) argument was passed,\n * independent of the compilation flags.\n */\nstatic INLINE_KEYWORD UNUSED_ATTR\nvoid _force_has_format_string(const char *format, ...) {\n  (void)format;\n}\n\n/**\n * Ignore: this is an internal helper.\n *\n * We want to force this function invocation to be syntactically correct, but\n * we don't want to force runtime evaluation of its arguments.\n */\n#define _FORCE_HAS_FORMAT_STRING(...)              \\\n    do {                                           \\\n        if (0) {                                   \\\n            _force_has_format_string(__VA_ARGS__); \\\n        }                                          \\\n    } while (0)\n\n#define ERR_QUOTE(str) #str\n\n/**\n * Return the specified error if the condition evaluates to true.\n *\n * In debug modes, prints additional information.\n * In order to do that (particularly, printing the conditional that failed),\n * this can't just wrap RETURN_ERROR().\n */\n#define RETURN_ERROR_IF(cond, err, ...)                                        \\\n    do {                                                                       \\\n        if (cond) {                                                            \\\n            RAWLOG(3, \"%s:%d: ERROR!: check %s failed, returning %s\",          \\\n                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \\\n            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \\\n            RAWLOG(3, \": \" __VA_ARGS__);                                       \\\n            RAWLOG(3, \"\\n\");                                                   \\\n            return ERROR(err);                                                 \\\n        }                                                                      \\\n    } while (0)\n\n/**\n * Unconditionally return the specified error.\n *\n * In debug modes, prints additional information.\n */\n#define RETURN_ERROR(err, ...)                                               \\\n    do {                                                                     \\\n        RAWLOG(3, \"%s:%d: ERROR!: unconditional check failed, returning %s\", \\\n              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \\\n        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \\\n        RAWLOG(3, \": \" __VA_ARGS__);                                         \\\n        RAWLOG(3, \"\\n\");                                                     \\\n        return ERROR(err);                                                   \\\n    } while(0)\n\n/**\n * If the provided expression evaluates to an error code, returns that error code.\n *\n * In debug modes, prints additional information.\n */\n#define FORWARD_IF_ERROR(err, ...)                                                 \\\n    do {                                                                           \\\n        size_t const err_code = (err);                                             \\\n        if (ERR_isError(err_code)) {                                               \\\n            RAWLOG(3, \"%s:%d: ERROR!: forwarding error in %s: %s\",                 \\\n                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \\\n            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \\\n            RAWLOG(3, \": \" __VA_ARGS__);                                           \\\n            RAWLOG(3, \"\\n\");                                                       \\\n            return err_code;                                                       \\\n        }                                                                          \\\n    } while(0)\n\n#if defined (__cplusplus)\n}\n#endif\n\n#endif /* ERROR_H_MODULE */\n"
  },
  {
    "path": "src/bled/zstd_errors.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n#ifndef ZSTD_ERRORS_H_398273423\n#define ZSTD_ERRORS_H_398273423\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n/* =====   ZSTDERRORLIB_API : control library symbols visibility   ===== */\n#ifndef ZSTDERRORLIB_VISIBLE\n   /* Backwards compatibility with old macro name */\n#  ifdef ZSTDERRORLIB_VISIBILITY\n#    define ZSTDERRORLIB_VISIBLE ZSTDERRORLIB_VISIBILITY\n#  elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)\n#    define ZSTDERRORLIB_VISIBLE __attribute__ ((visibility (\"default\")))\n#  else\n#    define ZSTDERRORLIB_VISIBLE\n#  endif\n#endif\n\n#ifndef ZSTDERRORLIB_HIDDEN\n#  if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)\n#    define ZSTDERRORLIB_HIDDEN __attribute__ ((visibility (\"hidden\")))\n#  else\n#    define ZSTDERRORLIB_HIDDEN\n#  endif\n#endif\n\n#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1)\n#  define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBLE\n#elif defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)\n#  define ZSTDERRORLIB_API __declspec(dllimport) ZSTDERRORLIB_VISIBLE /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/\n#else\n#  define ZSTDERRORLIB_API ZSTDERRORLIB_VISIBLE\n#endif\n\n/*-*********************************************\n *  Error codes list\n *-*********************************************\n *  Error codes _values_ are pinned down since v1.3.1 only.\n *  Therefore, don't rely on values if you may link to any version < v1.3.1.\n *\n *  Only values < 100 are considered stable.\n *\n *  note 1 : this API shall be used with static linking only.\n *           dynamic linking is not yet officially supported.\n *  note 2 : Prefer relying on the enum than on its value whenever possible\n *           This is the only supported way to use the error list < v1.3.1\n *  note 3 : ZSTD_isError() is always correct, whatever the library version.\n **********************************************/\ntypedef enum {\n  ZSTD_error_no_error = 0,\n  ZSTD_error_GENERIC  = 1,\n  ZSTD_error_prefix_unknown                = 10,\n  ZSTD_error_version_unsupported           = 12,\n  ZSTD_error_frameParameter_unsupported    = 14,\n  ZSTD_error_frameParameter_windowTooLarge = 16,\n  ZSTD_error_corruption_detected = 20,\n  ZSTD_error_checksum_wrong      = 22,\n  ZSTD_error_literals_headerWrong = 24,\n  ZSTD_error_dictionary_corrupted      = 30,\n  ZSTD_error_dictionary_wrong          = 32,\n  ZSTD_error_dictionaryCreation_failed = 34,\n  ZSTD_error_parameter_unsupported   = 40,\n  ZSTD_error_parameter_combination_unsupported = 41,\n  ZSTD_error_parameter_outOfBound    = 42,\n  ZSTD_error_tableLog_tooLarge       = 44,\n  ZSTD_error_maxSymbolValue_tooLarge = 46,\n  ZSTD_error_maxSymbolValue_tooSmall = 48,\n  ZSTD_error_stabilityCondition_notRespected = 50,\n  ZSTD_error_stage_wrong       = 60,\n  ZSTD_error_init_missing      = 62,\n  ZSTD_error_memory_allocation = 64,\n  ZSTD_error_workSpace_tooSmall= 66,\n  ZSTD_error_dstSize_tooSmall = 70,\n  ZSTD_error_srcSize_wrong    = 72,\n  ZSTD_error_dstBuffer_null   = 74,\n  ZSTD_error_noForwardProgress_destFull = 80,\n  ZSTD_error_noForwardProgress_inputEmpty = 82,\n  /* following error codes are __NOT STABLE__, they can be removed or changed in future versions */\n  ZSTD_error_frameIndex_tooLarge = 100,\n  ZSTD_error_seekableIO          = 102,\n  ZSTD_error_dstBuffer_wrong     = 104,\n  ZSTD_error_srcBuffer_wrong     = 105,\n  ZSTD_error_sequenceProducer_failed = 106,\n  ZSTD_error_externalSequences_invalid = 107,\n  ZSTD_error_maxCode = 120  /* never EVER use this value directly, it can change in future versions! Use ZSTD_isError() instead */\n} ZSTD_ErrorCode;\n\nZSTDERRORLIB_API const char* ZSTD_getErrorString(ZSTD_ErrorCode code);   /**< Same as ZSTD_getErrorName, but using a `ZSTD_ErrorCode` enum argument */\n\n\n#if defined (__cplusplus)\n}\n#endif\n\n#endif /* ZSTD_ERRORS_H_398273423 */\n"
  },
  {
    "path": "src/bled/zstd_internal.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n#ifndef ZSTD_CCOMMON_H_MODULE\n#define ZSTD_CCOMMON_H_MODULE\n\n/* this module contains definitions which must be identical\n * across compression, decompression and dictBuilder.\n * It also contains a few functions useful to at least 2 of them\n * and which benefit from being inlined */\n\n/*-*************************************\n*  Dependencies\n***************************************/\n#include \"zstd_compiler.h\"\n#include \"zstd_cpu.h\"\n#include \"zstd_mem.h\"\n#include \"zstd_error_private.h\"\n#define ZSTD_STATIC_LINKING_ONLY\n#include \"zstd.h\"\n#define FSE_STATIC_LINKING_ONLY\n#include \"fse.h\"\n#include \"huf.h\"\n#ifndef XXH_STATIC_LINKING_ONLY\n#  define XXH_STATIC_LINKING_ONLY  /* XXH64_state_t */\n#endif\n#include \"xxhash.h\"                /* XXH_reset, update, digest */\n#ifndef ZSTD_NO_TRACE\n#  include \"zstd_trace.h\"\n#else\n#  define ZSTD_TRACE 0\n#endif\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n/* ---- static assert (debug) --- */\n#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)\n#define ZSTD_isError ERR_isError   /* for inlining */\n#define FSE_isError  ERR_isError\n#define HUF_isError  ERR_isError\n\n\n/*-*************************************\n*  shared macros\n***************************************/\n#undef MIN\n#undef MAX\n#define MIN(a,b) ((a)<(b) ? (a) : (b))\n#define MAX(a,b) ((a)>(b) ? (a) : (b))\n#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))\n\n\n/*-*************************************\n*  Common constants\n***************************************/\n#define ZSTD_OPT_NUM    (1<<12)\n\n#define ZSTD_REP_NUM      3                 /* number of repcodes */\nstatic UNUSED_ATTR const U32 repStartValue[ZSTD_REP_NUM] = { 1, 4, 8 };\n\n#define KB *(1 <<10)\n#define MB *(1 <<20)\n#define GB *(1U<<30)\n\n#define BIT7 128\n#define BIT6  64\n#define BIT5  32\n#define BIT4  16\n#define BIT1   2\n#define BIT0   1\n\n#define ZSTD_WINDOWLOG_ABSOLUTEMIN 10\nstatic UNUSED_ATTR const size_t ZSTD_fcs_fieldSize[4] = { 0, 2, 4, 8 };\nstatic UNUSED_ATTR const size_t ZSTD_did_fieldSize[4] = { 0, 1, 2, 4 };\n\n#define ZSTD_FRAMEIDSIZE 4   /* magic number size */\n\n#define ZSTD_BLOCKHEADERSIZE 3   /* C standard doesn't allow `static const` variable to be init using another `static const` variable */\nstatic UNUSED_ATTR const size_t ZSTD_blockHeaderSize = ZSTD_BLOCKHEADERSIZE;\ntypedef enum { bt_raw, bt_rle, bt_compressed, bt_reserved } blockType_e;\n\n#define ZSTD_FRAMECHECKSUMSIZE 4\n\n#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */\n#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */)   /* for a non-null block */\n#define MIN_LITERALS_FOR_4_STREAMS 6\n\ntypedef enum { set_basic, set_rle, set_compressed, set_repeat } symbolEncodingType_e;\n\n#define LONGNBSEQ 0x7F00\n\n#define MINMATCH 3\n\n#define Litbits  8\n#define LitHufLog 11\n#define MaxLit ((1<<Litbits) - 1)\n#define MaxML   52\n#define MaxLL   35\n#define DefaultMaxOff 28\n#define MaxOff  31\n#define MaxSeq MAX(MaxLL, MaxML)   /* Assumption : MaxOff < MaxLL,MaxML */\n#define MLFSELog    9\n#define LLFSELog    9\n#define OffFSELog   8\n#define MaxFSELog  MAX(MAX(MLFSELog, LLFSELog), OffFSELog)\n#define MaxMLBits 16\n#define MaxLLBits 16\n\n#define ZSTD_MAX_HUF_HEADER_SIZE 128 /* header + <= 127 byte tree description */\n/* Each table cannot take more than #symbols * FSELog bits */\n#define ZSTD_MAX_FSE_HEADERS_SIZE (((MaxML + 1) * MLFSELog + (MaxLL + 1) * LLFSELog + (MaxOff + 1) * OffFSELog + 7) / 8)\n\nstatic UNUSED_ATTR const U8 LL_bits[MaxLL+1] = {\n     0, 0, 0, 0, 0, 0, 0, 0,\n     0, 0, 0, 0, 0, 0, 0, 0,\n     1, 1, 1, 1, 2, 2, 3, 3,\n     4, 6, 7, 8, 9,10,11,12,\n    13,14,15,16\n};\nstatic UNUSED_ATTR const S16 LL_defaultNorm[MaxLL+1] = {\n     4, 3, 2, 2, 2, 2, 2, 2,\n     2, 2, 2, 2, 2, 1, 1, 1,\n     2, 2, 2, 2, 2, 2, 2, 2,\n     2, 3, 2, 1, 1, 1, 1, 1,\n    -1,-1,-1,-1\n};\n#define LL_DEFAULTNORMLOG 6  /* for static allocation */\nstatic UNUSED_ATTR const U32 LL_defaultNormLog = LL_DEFAULTNORMLOG;\n\nstatic UNUSED_ATTR const U8 ML_bits[MaxML+1] = {\n     0, 0, 0, 0, 0, 0, 0, 0,\n     0, 0, 0, 0, 0, 0, 0, 0,\n     0, 0, 0, 0, 0, 0, 0, 0,\n     0, 0, 0, 0, 0, 0, 0, 0,\n     1, 1, 1, 1, 2, 2, 3, 3,\n     4, 4, 5, 7, 8, 9,10,11,\n    12,13,14,15,16\n};\nstatic UNUSED_ATTR const S16 ML_defaultNorm[MaxML+1] = {\n     1, 4, 3, 2, 2, 2, 2, 2,\n     2, 1, 1, 1, 1, 1, 1, 1,\n     1, 1, 1, 1, 1, 1, 1, 1,\n     1, 1, 1, 1, 1, 1, 1, 1,\n     1, 1, 1, 1, 1, 1, 1, 1,\n     1, 1, 1, 1, 1, 1,-1,-1,\n    -1,-1,-1,-1,-1\n};\n#define ML_DEFAULTNORMLOG 6  /* for static allocation */\nstatic UNUSED_ATTR const U32 ML_defaultNormLog = ML_DEFAULTNORMLOG;\n\nstatic UNUSED_ATTR const S16 OF_defaultNorm[DefaultMaxOff+1] = {\n     1, 1, 1, 1, 1, 1, 2, 2,\n     2, 1, 1, 1, 1, 1, 1, 1,\n     1, 1, 1, 1, 1, 1, 1, 1,\n    -1,-1,-1,-1,-1\n};\n#define OF_DEFAULTNORMLOG 5  /* for static allocation */\nstatic UNUSED_ATTR const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG;\n\n\n/*-*******************************************\n*  Shared functions to include for inlining\n*********************************************/\nstatic void ZSTD_copy8(void* dst, const void* src) {\n#if defined(ZSTD_ARCH_ARM_NEON)\n    vst1_u8((uint8_t*)dst, vld1_u8((const uint8_t*)src));\n#else\n    ZSTD_memcpy(dst, src, 8);\n#endif\n}\n#define COPY8(d,s) do { ZSTD_copy8(d,s); d+=8; s+=8; } while (0)\n\n/* Need to use memmove here since the literal buffer can now be located within\n   the dst buffer. In circumstances where the op \"catches up\" to where the\n   literal buffer is, there can be partial overlaps in this call on the final\n   copy if the literal is being shifted by less than 16 bytes. */\nstatic void ZSTD_copy16(void* dst, const void* src) {\n#if defined(ZSTD_ARCH_ARM_NEON)\n    vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src));\n#elif defined(ZSTD_ARCH_X86_SSE2)\n    _mm_storeu_si128((__m128i*)dst, _mm_loadu_si128((const __m128i*)src));\n#elif defined(__clang__)\n    ZSTD_memmove(dst, src, 16);\n#else\n    /* ZSTD_memmove is not inlined properly by gcc */\n    BYTE copy16_buf[16];\n    ZSTD_memcpy(copy16_buf, src, 16);\n    ZSTD_memcpy(dst, copy16_buf, 16);\n#endif\n}\n#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0)\n\n#define WILDCOPY_OVERLENGTH 32\n#define WILDCOPY_VECLEN 16\n\ntypedef enum {\n    ZSTD_no_overlap,\n    ZSTD_overlap_src_before_dst\n    /*  ZSTD_overlap_dst_before_src, */\n} ZSTD_overlap_e;\n\n/*! ZSTD_wildcopy() :\n *  Custom version of ZSTD_memcpy(), can over read/write up to WILDCOPY_OVERLENGTH bytes (if length==0)\n *  @param ovtype controls the overlap detection\n *         - ZSTD_no_overlap: The source and destination are guaranteed to be at least WILDCOPY_VECLEN bytes apart.\n *         - ZSTD_overlap_src_before_dst: The src and dst may overlap, but they MUST be at least 8 bytes apart.\n *           The src buffer must be before the dst buffer.\n */\nMEM_STATIC FORCE_INLINE_ATTR\nvoid ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e const ovtype)\n{\n    ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src;\n    const BYTE* ip = (const BYTE*)src;\n    BYTE* op = (BYTE*)dst;\n    BYTE* const oend = op + length;\n\n    if (ovtype == ZSTD_overlap_src_before_dst && diff < WILDCOPY_VECLEN) {\n        /* Handle short offset copies. */\n        do {\n            COPY8(op, ip);\n        } while (op < oend);\n    } else {\n        assert(diff >= WILDCOPY_VECLEN || diff <= -WILDCOPY_VECLEN);\n        /* Separate out the first COPY16() call because the copy length is\n         * almost certain to be short, so the branches have different\n         * probabilities. Since it is almost certain to be short, only do\n         * one COPY16() in the first call. Then, do two calls per loop since\n         * at that point it is more likely to have a high trip count.\n         */\n        ZSTD_copy16(op, ip);\n        if (16 >= length) return;\n        op += 16;\n        ip += 16;\n        do {\n            COPY16(op, ip);\n            COPY16(op, ip);\n        }\n        while (op < oend);\n    }\n}\n\nMEM_STATIC size_t ZSTD_limitCopy(void* dst, size_t dstCapacity, const void* src, size_t srcSize)\n{\n    size_t const length = MIN(dstCapacity, srcSize);\n    if (length > 0) {\n        ZSTD_memcpy(dst, src, length);\n    }\n    return length;\n}\n\n/* define \"workspace is too large\" as this number of times larger than needed */\n#define ZSTD_WORKSPACETOOLARGE_FACTOR 3\n\n/* when workspace is continuously too large\n * during at least this number of times,\n * context's memory usage is considered wasteful,\n * because it's sized to handle a worst case scenario which rarely happens.\n * In which case, resize it down to free some memory */\n#define ZSTD_WORKSPACETOOLARGE_MAXDURATION 128\n\n/* Controls whether the input/output buffer is buffered or stable. */\ntypedef enum {\n    ZSTD_bm_buffered = 0,  /* Buffer the input/output */\n    ZSTD_bm_stable = 1     /* ZSTD_inBuffer/ZSTD_outBuffer is stable */\n} ZSTD_bufferMode_e;\n\n\n/*-*******************************************\n*  Private declarations\n*********************************************/\ntypedef struct seqDef_s {\n    U32 offBase;   /* offBase == Offset + ZSTD_REP_NUM, or repcode 1,2,3 */\n    U16 litLength;\n    U16 mlBase;    /* mlBase == matchLength - MINMATCH */\n} seqDef;\n\n/* Controls whether seqStore has a single \"long\" litLength or matchLength. See seqStore_t. */\ntypedef enum {\n    ZSTD_llt_none = 0,             /* no longLengthType */\n    ZSTD_llt_literalLength = 1,    /* represents a long literal */\n    ZSTD_llt_matchLength = 2       /* represents a long match */\n} ZSTD_longLengthType_e;\n\ntypedef struct {\n    seqDef* sequencesStart;\n    seqDef* sequences;      /* ptr to end of sequences */\n    BYTE*  litStart;\n    BYTE*  lit;             /* ptr to end of literals */\n    BYTE*  llCode;\n    BYTE*  mlCode;\n    BYTE*  ofCode;\n    size_t maxNbSeq;\n    size_t maxNbLit;\n\n    /* longLengthPos and longLengthType to allow us to represent either a single litLength or matchLength\n     * in the seqStore that has a value larger than U16 (if it exists). To do so, we increment\n     * the existing value of the litLength or matchLength by 0x10000.\n     */\n    ZSTD_longLengthType_e longLengthType;\n    U32                   longLengthPos;  /* Index of the sequence to apply long length modification to */\n} seqStore_t;\n\ntypedef struct {\n    U32 litLength;\n    U32 matchLength;\n} ZSTD_sequenceLength;\n\n/**\n * Returns the ZSTD_sequenceLength for the given sequences. It handles the decoding of long sequences\n * indicated by longLengthPos and longLengthType, and adds MINMATCH back to matchLength.\n */\nMEM_STATIC ZSTD_sequenceLength ZSTD_getSequenceLength(seqStore_t const* seqStore, seqDef const* seq)\n{\n    ZSTD_sequenceLength seqLen;\n    seqLen.litLength = seq->litLength;\n    seqLen.matchLength = seq->mlBase + MINMATCH;\n    if (seqStore->longLengthPos == (U32)(seq - seqStore->sequencesStart)) {\n        if (seqStore->longLengthType == ZSTD_llt_literalLength) {\n            seqLen.litLength += 0x10000;\n        }\n        if (seqStore->longLengthType == ZSTD_llt_matchLength) {\n            seqLen.matchLength += 0x10000;\n        }\n    }\n    return seqLen;\n}\n\n/**\n * Contains the compressed frame size and an upper-bound for the decompressed frame size.\n * Note: before using `compressedSize`, check for errors using ZSTD_isError().\n *       similarly, before using `decompressedBound`, check for errors using:\n *          `decompressedBound != ZSTD_CONTENTSIZE_ERROR`\n */\ntypedef struct {\n    size_t nbBlocks;\n    size_t compressedSize;\n    unsigned long long decompressedBound;\n} ZSTD_frameSizeInfo;   /* decompress & legacy */\n\nconst seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx);   /* compress & dictBuilder */\nint ZSTD_seqToCodes(const seqStore_t* seqStorePtr);   /* compress, dictBuilder, decodeCorpus (shouldn't get its definition from here) */\n\n\n/* ZSTD_invalidateRepCodes() :\n * ensures next compression will not use repcodes from previous block.\n * Note : only works with regular variant;\n *        do not use with extDict variant ! */\nvoid ZSTD_invalidateRepCodes(ZSTD_CCtx* cctx);   /* zstdmt, adaptive_compression (shouldn't get this definition from here) */\n\n\ntypedef struct {\n    blockType_e blockType;\n    U32 lastBlock;\n    U32 origSize;\n} blockProperties_t;   /* declared here for decompress and fullbench */\n\n/*! ZSTD_getcBlockSize() :\n *  Provides the size of compressed block from block header `src` */\n/*  Used by: decompress, fullbench */\nsize_t ZSTD_getcBlockSize(const void* src, size_t srcSize,\n                          blockProperties_t* bpPtr);\n\n/*! ZSTD_decodeSeqHeaders() :\n *  decode sequence header from src */\n/*  Used by: zstd_decompress_block, fullbench */\nsize_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr,\n                       const void* src, size_t srcSize);\n\n/**\n * @returns true iff the CPU supports dynamic BMI2 dispatch.\n */\nMEM_STATIC int ZSTD_cpuSupportsBmi2(void)\n{\n    ZSTD_cpuid_t cpuid = ZSTD_cpuid();\n    return ZSTD_cpuid_bmi1(cpuid) && ZSTD_cpuid_bmi2(cpuid);\n}\n\n#if defined (__cplusplus)\n}\n#endif\n\n#endif   /* ZSTD_CCOMMON_H_MODULE */\n"
  },
  {
    "path": "src/bled/zstd_mem.h",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n * All rights reserved.\n *\n * This source code is licensed under both the BSD-style license (found in the\n * LICENSE file in the root directory of this source tree) and the GPLv2 (found\n * in the COPYING file in the root directory of this source tree).\n * You may select, at your option, one of the above-listed licenses.\n */\n\n#ifndef MEM_H_MODULE\n#define MEM_H_MODULE\n\n#if defined (__cplusplus)\nextern \"C\" {\n#endif\n\n/*-****************************************\n*  Dependencies\n******************************************/\n#include <stddef.h>  /* size_t, ptrdiff_t */\n#include \"zstd_compiler.h\"  /* __has_builtin */\n#include \"zstd_deps.h\"  /* ZSTD_memcpy */\n\n\n/*-****************************************\n*  Compiler specifics\n******************************************/\n#if defined(_MSC_VER)   /* Visual Studio */\n#   include <stdlib.h>  /* _byteswap_ulong */\n#   include <intrin.h>  /* _byteswap_* */\n#elif defined(__ICCARM__)\n#   include <intrinsics.h>\n#endif\n\n/*-**************************************************************\n*  Basic Types\n*****************************************************************/\n#if  !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )\n#  if defined(_AIX)\n#    include <inttypes.h>\n#  else\n#    include <stdint.h> /* intptr_t */\n#  endif\n  typedef   uint8_t BYTE;\n  typedef   uint8_t U8;\n  typedef    int8_t S8;\n  typedef  uint16_t U16;\n  typedef   int16_t S16;\n  typedef  uint32_t U32;\n  typedef   int32_t S32;\n  typedef  uint64_t U64;\n  typedef   int64_t S64;\n#else\n# include <limits.h>\n#if CHAR_BIT != 8\n#  error \"this implementation requires char to be exactly 8-bit type\"\n#endif\n  typedef unsigned char      BYTE;\n  typedef unsigned char      U8;\n  typedef   signed char      S8;\n#if USHRT_MAX != 65535\n#  error \"this implementation requires short to be exactly 16-bit type\"\n#endif\n  typedef unsigned short      U16;\n  typedef   signed short      S16;\n#if UINT_MAX != 4294967295\n#  error \"this implementation requires int to be exactly 32-bit type\"\n#endif\n  typedef unsigned int        U32;\n  typedef   signed int        S32;\n/* note : there are no limits defined for long long type in C90.\n * limits exist in C99, however, in such case, <stdint.h> is preferred */\n  typedef unsigned long long  U64;\n  typedef   signed long long  S64;\n#endif\n\n\n/*-**************************************************************\n*  Memory I/O API\n*****************************************************************/\n/*=== Static platform detection ===*/\nMEM_STATIC unsigned MEM_32bits(void);\nMEM_STATIC unsigned MEM_64bits(void);\nMEM_STATIC unsigned MEM_isLittleEndian(void);\n\n/*=== Native unaligned read/write ===*/\nMEM_STATIC U16 MEM_read16(const void* memPtr);\nMEM_STATIC U32 MEM_read32(const void* memPtr);\nMEM_STATIC U64 MEM_read64(const void* memPtr);\nMEM_STATIC size_t MEM_readST(const void* memPtr);\n\nMEM_STATIC void MEM_write16(void* memPtr, U16 value);\nMEM_STATIC void MEM_write32(void* memPtr, U32 value);\nMEM_STATIC void MEM_write64(void* memPtr, U64 value);\n\n/*=== Little endian unaligned read/write ===*/\nMEM_STATIC U16 MEM_readLE16(const void* memPtr);\nMEM_STATIC U32 MEM_readLE24(const void* memPtr);\nMEM_STATIC U32 MEM_readLE32(const void* memPtr);\nMEM_STATIC U64 MEM_readLE64(const void* memPtr);\nMEM_STATIC size_t MEM_readLEST(const void* memPtr);\n\nMEM_STATIC void MEM_writeLE16(void* memPtr, U16 val);\nMEM_STATIC void MEM_writeLE24(void* memPtr, U32 val);\nMEM_STATIC void MEM_writeLE32(void* memPtr, U32 val32);\nMEM_STATIC void MEM_writeLE64(void* memPtr, U64 val64);\nMEM_STATIC void MEM_writeLEST(void* memPtr, size_t val);\n\n/*=== Big endian unaligned read/write ===*/\nMEM_STATIC U32 MEM_readBE32(const void* memPtr);\nMEM_STATIC U64 MEM_readBE64(const void* memPtr);\nMEM_STATIC size_t MEM_readBEST(const void* memPtr);\n\nMEM_STATIC void MEM_writeBE32(void* memPtr, U32 val32);\nMEM_STATIC void MEM_writeBE64(void* memPtr, U64 val64);\nMEM_STATIC void MEM_writeBEST(void* memPtr, size_t val);\n\n/*=== Byteswap ===*/\nMEM_STATIC U32 MEM_swap32(U32 in);\nMEM_STATIC U64 MEM_swap64(U64 in);\nMEM_STATIC size_t MEM_swapST(size_t in);\n\n\n/*-**************************************************************\n*  Memory I/O Implementation\n*****************************************************************/\n/* MEM_FORCE_MEMORY_ACCESS : For accessing unaligned memory:\n * Method 0 : always use `memcpy()`. Safe and portable.\n * Method 1 : Use compiler extension to set unaligned access.\n * Method 2 : direct access. This method is portable but violate C standard.\n *            It can generate buggy code on targets depending on alignment.\n * Default  : method 1 if supported, else method 0\n */\n#ifndef MEM_FORCE_MEMORY_ACCESS   /* can be defined externally, on command line for example */\n#  ifdef __GNUC__\n#    define MEM_FORCE_MEMORY_ACCESS 1\n#  endif\n#endif\n\nMEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }\nMEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }\n\nMEM_STATIC unsigned MEM_isLittleEndian(void)\n{\n#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)\n    return 1;\n#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)\n    return 0;\n#elif defined(__clang__) && __LITTLE_ENDIAN__\n    return 1;\n#elif defined(__clang__) && __BIG_ENDIAN__\n    return 0;\n#elif defined(_MSC_VER) && (_M_AMD64 || _M_IX86)\n    return 1;\n#elif defined(__DMC__) && defined(_M_IX86)\n    return 1;\n#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__\n    return 1;\n#else\n    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */\n    return one.c[0];\n#endif\n}\n\n#if defined(MEM_FORCE_MEMORY_ACCESS) && (MEM_FORCE_MEMORY_ACCESS==2)\n\n/* violates C standard, by lying on structure alignment.\nOnly use if no other choice to achieve best performance on target platform */\nMEM_STATIC U16 MEM_read16(const void* memPtr) { return *(const U16*) memPtr; }\nMEM_STATIC U32 MEM_read32(const void* memPtr) { return *(const U32*) memPtr; }\nMEM_STATIC U64 MEM_read64(const void* memPtr) { return *(const U64*) memPtr; }\nMEM_STATIC size_t MEM_readST(const void* memPtr) { return *(const size_t*) memPtr; }\n\nMEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(U16*)memPtr = value; }\nMEM_STATIC void MEM_write32(void* memPtr, U32 value) { *(U32*)memPtr = value; }\nMEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(U64*)memPtr = value; }\n\n#elif defined(MEM_FORCE_MEMORY_ACCESS) && (MEM_FORCE_MEMORY_ACCESS==1)\n\ntypedef __attribute__((aligned(1))) U16 unalign16;\ntypedef __attribute__((aligned(1))) U32 unalign32;\ntypedef __attribute__((aligned(1))) U64 unalign64;\ntypedef __attribute__((aligned(1))) size_t unalignArch;\n\nMEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }\nMEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }\nMEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }\nMEM_STATIC size_t MEM_readST(const void* ptr) { return *(const unalignArch*)ptr; }\n\nMEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(unalign16*)memPtr = value; }\nMEM_STATIC void MEM_write32(void* memPtr, U32 value) { *(unalign32*)memPtr = value; }\nMEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }\n\n#else\n\n/* default method, safe and standard.\n   can sometimes prove slower */\n\nMEM_STATIC U16 MEM_read16(const void* memPtr)\n{\n    U16 val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val;\n}\n\nMEM_STATIC U32 MEM_read32(const void* memPtr)\n{\n    U32 val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val;\n}\n\nMEM_STATIC U64 MEM_read64(const void* memPtr)\n{\n    U64 val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val;\n}\n\nMEM_STATIC size_t MEM_readST(const void* memPtr)\n{\n    size_t val; ZSTD_memcpy(&val, memPtr, sizeof(val)); return val;\n}\n\nMEM_STATIC void MEM_write16(void* memPtr, U16 value)\n{\n    ZSTD_memcpy(memPtr, &value, sizeof(value));\n}\n\nMEM_STATIC void MEM_write32(void* memPtr, U32 value)\n{\n    ZSTD_memcpy(memPtr, &value, sizeof(value));\n}\n\nMEM_STATIC void MEM_write64(void* memPtr, U64 value)\n{\n    ZSTD_memcpy(memPtr, &value, sizeof(value));\n}\n\n#endif /* MEM_FORCE_MEMORY_ACCESS */\n\nMEM_STATIC U32 MEM_swap32_fallback(U32 in)\n{\n    return  ((in << 24) & 0xff000000 ) |\n            ((in <<  8) & 0x00ff0000 ) |\n            ((in >>  8) & 0x0000ff00 ) |\n            ((in >> 24) & 0x000000ff );\n}\n\nMEM_STATIC U32 MEM_swap32(U32 in)\n{\n#if defined(_MSC_VER)     /* Visual Studio */\n    return _byteswap_ulong(in);\n#elif (defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) \\\n  || (defined(__clang__) && __has_builtin(__builtin_bswap32))\n    return __builtin_bswap32(in);\n#elif defined(__ICCARM__)\n    return __REV(in);\n#else\n    return MEM_swap32_fallback(in);\n#endif\n}\n\nMEM_STATIC U64 MEM_swap64_fallback(U64 in)\n{\n     return  ((in << 56) & 0xff00000000000000ULL) |\n            ((in << 40) & 0x00ff000000000000ULL) |\n            ((in << 24) & 0x0000ff0000000000ULL) |\n            ((in << 8)  & 0x000000ff00000000ULL) |\n            ((in >> 8)  & 0x00000000ff000000ULL) |\n            ((in >> 24) & 0x0000000000ff0000ULL) |\n            ((in >> 40) & 0x000000000000ff00ULL) |\n            ((in >> 56) & 0x00000000000000ffULL);\n}\n\nMEM_STATIC U64 MEM_swap64(U64 in)\n{\n#if defined(_MSC_VER)     /* Visual Studio */\n    return _byteswap_uint64(in);\n#elif (defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)) \\\n  || (defined(__clang__) && __has_builtin(__builtin_bswap64))\n    return __builtin_bswap64(in);\n#else\n    return MEM_swap64_fallback(in);\n#endif\n}\n\nMEM_STATIC size_t MEM_swapST(size_t in)\n{\n    if (MEM_32bits())\n        return (size_t)MEM_swap32((U32)in);\n    else\n        return (size_t)MEM_swap64((U64)in);\n}\n\n/*=== Little endian r/w ===*/\n\nMEM_STATIC U16 MEM_readLE16(const void* memPtr)\n{\n    if (MEM_isLittleEndian())\n        return MEM_read16(memPtr);\n    else {\n        const BYTE* p = (const BYTE*)memPtr;\n        return (U16)(p[0] + (p[1]<<8));\n    }\n}\n\nMEM_STATIC void MEM_writeLE16(void* memPtr, U16 val)\n{\n    if (MEM_isLittleEndian()) {\n        MEM_write16(memPtr, val);\n    } else {\n        BYTE* p = (BYTE*)memPtr;\n        p[0] = (BYTE)val;\n        p[1] = (BYTE)(val>>8);\n    }\n}\n\nMEM_STATIC U32 MEM_readLE24(const void* memPtr)\n{\n    return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16);\n}\n\nMEM_STATIC void MEM_writeLE24(void* memPtr, U32 val)\n{\n    MEM_writeLE16(memPtr, (U16)val);\n    ((BYTE*)memPtr)[2] = (BYTE)(val>>16);\n}\n\nMEM_STATIC U32 MEM_readLE32(const void* memPtr)\n{\n    if (MEM_isLittleEndian())\n        return MEM_read32(memPtr);\n    else\n        return MEM_swap32(MEM_read32(memPtr));\n}\n\nMEM_STATIC void MEM_writeLE32(void* memPtr, U32 val32)\n{\n    if (MEM_isLittleEndian())\n        MEM_write32(memPtr, val32);\n    else\n        MEM_write32(memPtr, MEM_swap32(val32));\n}\n\nMEM_STATIC U64 MEM_readLE64(const void* memPtr)\n{\n    if (MEM_isLittleEndian())\n        return MEM_read64(memPtr);\n    else\n        return MEM_swap64(MEM_read64(memPtr));\n}\n\nMEM_STATIC void MEM_writeLE64(void* memPtr, U64 val64)\n{\n    if (MEM_isLittleEndian())\n        MEM_write64(memPtr, val64);\n    else\n        MEM_write64(memPtr, MEM_swap64(val64));\n}\n\nMEM_STATIC size_t MEM_readLEST(const void* memPtr)\n{\n    if (MEM_32bits())\n        return (size_t)MEM_readLE32(memPtr);\n    else\n        return (size_t)MEM_readLE64(memPtr);\n}\n\nMEM_STATIC void MEM_writeLEST(void* memPtr, size_t val)\n{\n    if (MEM_32bits())\n        MEM_writeLE32(memPtr, (U32)val);\n    else\n        MEM_writeLE64(memPtr, (U64)val);\n}\n\n/*=== Big endian r/w ===*/\n\nMEM_STATIC U32 MEM_readBE32(const void* memPtr)\n{\n    if (MEM_isLittleEndian())\n        return MEM_swap32(MEM_read32(memPtr));\n    else\n        return MEM_read32(memPtr);\n}\n\nMEM_STATIC void MEM_writeBE32(void* memPtr, U32 val32)\n{\n    if (MEM_isLittleEndian())\n        MEM_write32(memPtr, MEM_swap32(val32));\n    else\n        MEM_write32(memPtr, val32);\n}\n\nMEM_STATIC U64 MEM_readBE64(const void* memPtr)\n{\n    if (MEM_isLittleEndian())\n        return MEM_swap64(MEM_read64(memPtr));\n    else\n        return MEM_read64(memPtr);\n}\n\nMEM_STATIC void MEM_writeBE64(void* memPtr, U64 val64)\n{\n    if (MEM_isLittleEndian())\n        MEM_write64(memPtr, MEM_swap64(val64));\n    else\n        MEM_write64(memPtr, val64);\n}\n\nMEM_STATIC size_t MEM_readBEST(const void* memPtr)\n{\n    if (MEM_32bits())\n        return (size_t)MEM_readBE32(memPtr);\n    else\n        return (size_t)MEM_readBE64(memPtr);\n}\n\nMEM_STATIC void MEM_writeBEST(void* memPtr, size_t val)\n{\n    if (MEM_32bits())\n        MEM_writeBE32(memPtr, (U32)val);\n    else\n        MEM_writeBE64(memPtr, (U64)val);\n}\n\n/* code only tested on 32 and 64 bits systems */\nMEM_STATIC void MEM_check(void) { DEBUG_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); }\n\n#if defined (__cplusplus)\n}\n#endif\n\n#endif /* MEM_H_MODULE */\n"
  },
  {
    "path": "src/cregex.h",
    "content": "#ifndef CREGEX_H\n#define CREGEX_H\n\n#define REGEX_VM_MAX_MATCHES 64\n\ntypedef enum {\n    REGEX_NODE_TYPE_EPSILON = 0,\n    /* Characters */\n    REGEX_NODE_TYPE_CHARACTER,\n    REGEX_NODE_TYPE_ANY_CHARACTER,\n    REGEX_NODE_TYPE_CHARACTER_CLASS,\n    REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED,\n    /* Composites */\n    REGEX_NODE_TYPE_CONCATENATION,\n    REGEX_NODE_TYPE_ALTERNATION,\n    /* Quantifiers */\n    REGEX_NODE_TYPE_QUANTIFIER,\n    /* Anchors */\n    REGEX_NODE_TYPE_ANCHOR_BEGIN,\n    REGEX_NODE_TYPE_ANCHOR_END,\n    /* Captures */\n    REGEX_NODE_TYPE_CAPTURE\n} cregex_node_type;\n\ntypedef struct cregex_node {\n    cregex_node_type type;\n    union {\n        /* REGEX_NODE_TYPE_CHARACTER */\n        struct {\n            int ch;\n        };\n        /* REGEX_NODE_TYPE_CHARACTER_CLASS,\n         * REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED\n         */\n        struct {\n            const char *from, *to;\n        };\n        /* REGEX_NODE_TYPE_QUANTIFIER */\n        struct {\n            int nmin, nmax, greedy;\n            struct cregex_node *quantified;\n        };\n        /* REGEX_NODE_TYPE_CONCATENATION,\n         * REGEX_NODE_TYPE_ALTERNATION\n         */\n        struct {\n            struct cregex_node *left, *right;\n        };\n        /* REGEX_NODE_TYPE_CAPTURE */\n        struct {\n            struct cregex_node *captured;\n        };\n    };\n} cregex_node_t;\n\ntypedef enum {\n    REGEX_PROGRAM_OPCODE_MATCH = 0,\n    /* Characters */\n    REGEX_PROGRAM_OPCODE_CHARACTER,\n    REGEX_PROGRAM_OPCODE_ANY_CHARACTER,\n    REGEX_PROGRAM_OPCODE_CHARACTER_CLASS,\n    REGEX_PROGRAM_OPCODE_CHARACTER_CLASS_NEGATED,\n    /* Control-flow */\n    REGEX_PROGRAM_OPCODE_SPLIT,\n    REGEX_PROGRAM_OPCODE_JUMP,\n    /* Assertions */\n    REGEX_PROGRAM_OPCODE_ASSERT_BEGIN,\n    REGEX_PROGRAM_OPCODE_ASSERT_END,\n    /* Saving */\n    REGEX_PROGRAM_OPCODE_SAVE\n} cregex_program_opcode_t;\n\n#include <limits.h>\n\ntypedef char cregex_char_class[(UCHAR_MAX + CHAR_BIT - 1) / CHAR_BIT];\n\nstatic inline int cregex_char_class_contains(const cregex_char_class klass,\n                                             int ch)\n{\n    return klass[ch / CHAR_BIT] & (1 << ch % CHAR_BIT);\n}\n\nstatic inline int cregex_char_class_add(cregex_char_class klass, int ch)\n{\n    klass[ch / CHAR_BIT] |= 1 << (ch % CHAR_BIT);\n    return ch;\n}\n\ntypedef struct cregex_program_instr {\n    cregex_program_opcode_t opcode;\n    union {\n        /* REGEX_PROGRAM_OPCODE_CHARACTER */\n        struct {\n            int ch;\n        };\n        /* REGEX_PROGRAM_OPCODE_CHARACTER_CLASS,\n         * REGEX_PROGRAM_OPCODE_CHARACTER_CLASS_NEGATED\n         */\n        struct {\n            cregex_char_class klass;\n        };\n        /* REGEX_PROGRAM_OPCODE_SPLIT */\n        struct {\n            struct cregex_program_instr *first, *second;\n        };\n        /* REGEX_PROGRAM_OPCODE_JUMP */\n        struct {\n            struct cregex_program_instr *target;\n        };\n        /* REGEX_PROGRAM_OPCODE_SAVE */\n        struct {\n            int save;\n        };\n    };\n} cregex_program_instr_t;\n\ntypedef struct {\n    int ninstructions;\n    cregex_program_instr_t instructions[];\n} cregex_program_t;\n\n/* Run program on string */\nint cregex_program_run(const cregex_program_t *program,\n                       const char *string,\n                       const char **matches,\n                       int nmatches);\n\n/* Compile a parsed pattern */\ncregex_program_t *cregex_compile_node(const cregex_node_t *root);\n\n/* Free a compiled program */\nvoid cregex_compile_free(cregex_program_t *program);\n\n/* Parse a pattern */\ncregex_node_t *cregex_parse(const char *pattern);\n\n/* Free a parsed pattern */\nvoid cregex_parse_free(cregex_node_t *root);\n\n#endif\n"
  },
  {
    "path": "src/cregex_compile.c",
    "content": "#include <stdbool.h>\n#include <stdlib.h>\n\n#include \"cregex.h\"\n\ntypedef struct {\n    cregex_program_instr_t *pc;\n    int ncaptures;\n} regex_compile_context;\n\nstatic int count_instructions(const cregex_node_t *node)\n{\n    switch (node->type) {\n    case REGEX_NODE_TYPE_EPSILON:\n        return 0;\n\n    /* Characters */\n    case REGEX_NODE_TYPE_CHARACTER:\n    case REGEX_NODE_TYPE_ANY_CHARACTER:\n    case REGEX_NODE_TYPE_CHARACTER_CLASS:\n    case REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED:\n        return 1;\n\n    /* Composites */\n    case REGEX_NODE_TYPE_CONCATENATION:\n        return count_instructions(node->left) + count_instructions(node->right);\n    case REGEX_NODE_TYPE_ALTERNATION:\n        return 2 + count_instructions(node->left) +\n               count_instructions(node->right);\n\n    /* Quantifiers */\n    case REGEX_NODE_TYPE_QUANTIFIER: {\n        int num = count_instructions(node->quantified);\n        if (node->nmax >= node->nmin)\n            return node->nmin * num + (node->nmax - node->nmin) * (num + 1);\n        return 1 + (node->nmin ? node->nmin * num : num + 1);\n    }\n\n    /* Anchors */\n    case REGEX_NODE_TYPE_ANCHOR_BEGIN:\n    case REGEX_NODE_TYPE_ANCHOR_END:\n        return 1;\n\n    /* Captures */\n    case REGEX_NODE_TYPE_CAPTURE:\n        return 2 + count_instructions(node->captured);\n    }\n\n    /* should not reach here */\n    return 0;\n}\n\nstatic bool node_is_anchored(const cregex_node_t *node)\n{\n    switch (node->type) {\n    case REGEX_NODE_TYPE_EPSILON:\n        return false;\n\n    /* Characters */\n    case REGEX_NODE_TYPE_CHARACTER:\n    case REGEX_NODE_TYPE_ANY_CHARACTER:\n    case REGEX_NODE_TYPE_CHARACTER_CLASS:\n    case REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED:\n        return false;\n\n    /* Composites */\n    case REGEX_NODE_TYPE_CONCATENATION:\n        return node_is_anchored(node->left);\n    case REGEX_NODE_TYPE_ALTERNATION:\n        return node_is_anchored(node->left) && node_is_anchored(node->right);\n\n    /* Quantifiers */\n    case REGEX_NODE_TYPE_QUANTIFIER:\n        return node_is_anchored(node->quantified);\n\n    /* Anchors */\n    case REGEX_NODE_TYPE_ANCHOR_BEGIN:\n        return true;\n    case REGEX_NODE_TYPE_ANCHOR_END:\n        return false;\n\n    /* Captures */\n    case REGEX_NODE_TYPE_CAPTURE:\n        return node_is_anchored(node->captured);\n    }\n\n    /* should not reach here */\n    return false;\n}\n\nstatic inline cregex_program_instr_t *emit(\n    regex_compile_context *context,\n    const cregex_program_instr_t *instruction)\n{\n    *context->pc = *instruction;\n    return context->pc++;\n}\n\nstatic cregex_program_instr_t *compile_char_class(\n    const cregex_node_t *node,\n    cregex_program_instr_t *instruction)\n{\n    const char *sp = node->from;\n\n    for (;;) {\n        int ch = *sp++;\n        switch (ch) {\n        case ']':\n            if (sp - 1 == node->from)\n                goto CHARACTER;\n            return instruction;\n        case '\\\\':\n            ch = *sp++;\n            /* fall-through */\n        default:\n        CHARACTER:\n            if (*sp == '-' && sp[1] != ']') {\n                for (; ch <= sp[1]; ++ch)\n                    cregex_char_class_add(instruction->klass, ch);\n                sp += 2;\n            } else {\n                cregex_char_class_add(instruction->klass, ch);\n            }\n            break;\n        }\n    }\n}\n\nstatic cregex_program_instr_t *compile_context(regex_compile_context *context,\n                                               const cregex_node_t *node)\n{\n    cregex_program_instr_t *bottom = context->pc, *split, *jump;\n    int ncaptures = context->ncaptures, capture;\n\n    switch (node->type) {\n    case REGEX_NODE_TYPE_EPSILON:\n        break;\n\n    /* Characters */\n    case REGEX_NODE_TYPE_CHARACTER:\n        emit(context,\n             &(cregex_program_instr_t){.opcode = REGEX_PROGRAM_OPCODE_CHARACTER,\n                                       .ch = node->ch});\n        break;\n    case REGEX_NODE_TYPE_ANY_CHARACTER:\n        emit(context, &(cregex_program_instr_t){\n                          .opcode = REGEX_PROGRAM_OPCODE_ANY_CHARACTER});\n        break;\n    case REGEX_NODE_TYPE_CHARACTER_CLASS:\n        compile_char_class(\n            node,\n            emit(context, &(cregex_program_instr_t){\n                              .opcode = REGEX_PROGRAM_OPCODE_CHARACTER_CLASS}));\n        break;\n    case REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED:\n        compile_char_class(\n            node,\n            emit(context,\n                 &(cregex_program_instr_t){\n                     .opcode = REGEX_PROGRAM_OPCODE_CHARACTER_CLASS_NEGATED}));\n        break;\n\n    /* Composites */\n    case REGEX_NODE_TYPE_CONCATENATION:\n        compile_context(context, node->left);\n        compile_context(context, node->right);\n        break;\n    case REGEX_NODE_TYPE_ALTERNATION:\n        split = emit(context, &(cregex_program_instr_t){\n                                  .opcode = REGEX_PROGRAM_OPCODE_SPLIT});\n        split->first = compile_context(context, node->left);\n        jump = emit(context, &(cregex_program_instr_t){\n                                 .opcode = REGEX_PROGRAM_OPCODE_JUMP});\n        split->second = compile_context(context, node->right);\n        jump->target = context->pc;\n        break;\n\n    /* Quantifiers */\n    case REGEX_NODE_TYPE_QUANTIFIER: {\n        cregex_program_instr_t *last = NULL;\n        for (int i = 0; i < node->nmin; ++i) {\n            context->ncaptures = ncaptures;\n            last = compile_context(context, node->quantified);\n        }\n        if (node->nmax > node->nmin) {\n            for (int i = 0; i < node->nmax - node->nmin; ++i) {\n                context->ncaptures = ncaptures;\n                split =\n                    emit(context, &(cregex_program_instr_t){\n                                      .opcode = REGEX_PROGRAM_OPCODE_SPLIT});\n                split->first = compile_context(context, node->quantified);\n                split->second = context->pc;\n                if (!node->greedy) {\n                    cregex_program_instr_t *swap = split->first;\n                    split->first = split->second;\n                    split->second = swap;\n                }\n            }\n        } else if (node->nmax == -1) {\n            split = emit(context, &(cregex_program_instr_t){\n                                      .opcode = REGEX_PROGRAM_OPCODE_SPLIT});\n            if (node->nmin == 0) {\n                split->first = compile_context(context, node->quantified);\n                jump = emit(context, &(cregex_program_instr_t){\n                                         .opcode = REGEX_PROGRAM_OPCODE_JUMP});\n                split->second = context->pc;\n                jump->target = split;\n            } else {\n                split->first = last;\n                split->second = context->pc;\n            }\n            if (!node->greedy) {\n                cregex_program_instr_t *swap = split->first;\n                split->first = split->second;\n                split->second = swap;\n            }\n        }\n        break;\n    }\n\n    /* Anchors */\n    case REGEX_NODE_TYPE_ANCHOR_BEGIN:\n        emit(context, &(cregex_program_instr_t){\n                          .opcode = REGEX_PROGRAM_OPCODE_ASSERT_BEGIN});\n        break;\n    case REGEX_NODE_TYPE_ANCHOR_END:\n        emit(context, &(cregex_program_instr_t){\n                          .opcode = REGEX_PROGRAM_OPCODE_ASSERT_END});\n        break;\n\n    /* Captures */\n    case REGEX_NODE_TYPE_CAPTURE:\n        capture = context->ncaptures++ * 2;\n        emit(context,\n             &(cregex_program_instr_t){.opcode = REGEX_PROGRAM_OPCODE_SAVE,\n                                       .save = capture});\n        compile_context(context, node->captured);\n        emit(context,\n             &(cregex_program_instr_t){.opcode = REGEX_PROGRAM_OPCODE_SAVE,\n                                       .save = capture + 1});\n        break;\n    }\n\n    return bottom;\n}\n\n/* Compile a parsed pattern (using a previously allocated program with at least\n * estimate_instructions(root) instructions).\n */\n#if defined __GNUC__\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wdangling-pointer\"\n#endif\nstatic cregex_program_t *compile_node_with_program(const cregex_node_t *root,\n                                                   cregex_program_t *program)\n{\n    /* Silence a MinGW warning about dangling pointers */\n    static cregex_node_t* _root;\n    /* add capture node for entire match */\n    root = &(cregex_node_t){.type = REGEX_NODE_TYPE_CAPTURE,\n                            .captured = (cregex_node_t *) root};\n\n    /* add .*? unless pattern starts with ^ */\n    if (!node_is_anchored(root)) {\n        _root = &(cregex_node_t){\n            .type = REGEX_NODE_TYPE_CONCATENATION,\n            .left =\n                &(cregex_node_t){\n                    .type = REGEX_NODE_TYPE_QUANTIFIER,\n                    .nmin = 0,\n                    .nmax = -1,\n                    .greedy = 0,\n                    .quantified = &(\n                        cregex_node_t){.type = REGEX_NODE_TYPE_ANY_CHARACTER}},\n            .right = (cregex_node_t *) root};\n        root = _root;\n     }\n\n    /* compile */\n    regex_compile_context *context =\n        &(regex_compile_context){.pc = program->instructions, .ncaptures = 0};\n    compile_context(context, root);\n\n    /* emit final match instruction */\n    emit(context,\n         &(cregex_program_instr_t){.opcode = REGEX_PROGRAM_OPCODE_MATCH});\n\n    /* set total number of instructions */\n    program->ninstructions = (int)(context->pc - program->instructions);\n\n    return program;\n}\n#if defined __GNUC__\n#pragma GCC diagnostic pop\n#endif\n\n/* Upper bound of number of instructions required to compile parsed pattern. */\nstatic int estimate_instructions(const cregex_node_t *root)\n{\n    return count_instructions(root)\n           /* .*? is added unless pattern starts with ^,\n            * save instructions are added for beginning and end of match,\n            * a final match instruction is added to the end of the program\n            */\n           + !node_is_anchored(root) * 3 + 2 + 1;\n}\n\ncregex_program_t *cregex_compile_node(const cregex_node_t *root)\n{\n    size_t size = sizeof(cregex_program_t) +\n                  sizeof(cregex_program_instr_t) * estimate_instructions(root);\n    cregex_program_t *program;\n\n    if (!(program = malloc(size)))\n        return NULL;\n\n    if (!compile_node_with_program(root, program)) {\n        free(program);\n        return NULL;\n    }\n\n    return program;\n}\n\n/* Free a compiled program */\nvoid cregex_compile_free(cregex_program_t *program)\n{\n    free(program);\n}\n"
  },
  {
    "path": "src/cregex_parse.c",
    "content": "#include <assert.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"cregex.h\"\n\ntypedef struct {\n    const char *sp;\n    cregex_node_t *stack, *output;\n} regex_parse_context;\n\n/* Shunting-yard algorithm\n * See https://en.wikipedia.org/wiki/Shunting-yard_algorithm\n */\n\nstatic inline cregex_node_t *push(regex_parse_context *context,\n                                  const cregex_node_t *node)\n{\n    assert(context->stack <= context->output);\n    *context->stack = *node;\n    return context->stack++;\n}\n\nstatic inline cregex_node_t *drop(regex_parse_context *context)\n{\n    return --context->stack;\n}\n\nstatic inline cregex_node_t *consume(regex_parse_context *context)\n{\n    *--context->output = *--context->stack;\n    return context->output;\n}\n\nstatic inline cregex_node_t *concatenate(regex_parse_context *context,\n                                         const cregex_node_t *bottom)\n{\n    if (context->stack == bottom)\n        push(context, &(cregex_node_t){.type = REGEX_NODE_TYPE_EPSILON});\n    else {\n        while (context->stack - 1 > bottom) {\n            cregex_node_t *right = consume(context);\n            cregex_node_t *left = consume(context);\n            push(context,\n                 &(cregex_node_t){.type = REGEX_NODE_TYPE_CONCATENATION,\n                                  .left = left,\n                                  .right = right});\n        }\n    }\n    return context->stack - 1;\n}\n\nstatic cregex_node_t *parse_char_class(regex_parse_context *context)\n{\n    cregex_node_type type =\n        (*context->sp == '^')\n            ? (++context->sp, REGEX_NODE_TYPE_CHARACTER_CLASS_NEGATED)\n            : REGEX_NODE_TYPE_CHARACTER_CLASS;\n    const char *from = context->sp;\n\n    for (;;) {\n        int ch = *context->sp++;\n        switch (ch) {\n        case '\\0':\n            /* premature end of character class */\n            return NULL;\n        case ']':\n            if (context->sp - 1 == from)\n                goto CHARACTER;\n            return push(context,\n                        &(cregex_node_t){\n                            .type = type, .from = from, .to = context->sp - 1});\n        case '\\\\':\n            ch = *context->sp++;\n            /* fall-through */\n        default:\n        CHARACTER:\n            if (*context->sp == '-' && context->sp[1] != ']') {\n                if (context->sp[1] < ch)\n                    /* empty range in character class */\n                    return NULL;\n                context->sp += 2;\n            }\n            break;\n        }\n    }\n}\n\nstatic cregex_node_t *parse_interval(regex_parse_context *context)\n{\n    const char *from = context->sp;\n    int nmin, nmax;\n\n    for (nmin = 0; *context->sp >= '0' && *context->sp <= '9'; ++context->sp)\n        nmin = (nmin * 10) + (*context->sp - '0');\n\n    if (*context->sp == ',') {\n        ++context->sp;\n        if (*from != ',' && *context->sp == '}')\n            nmax = -1;\n        else {\n            for (nmax = 0; *context->sp >= '0' && *context->sp <= '9';\n                 ++context->sp)\n                nmax = (nmax * 10) + (*context->sp - '0');\n            if (*(context->sp - 1) == ',' || *context->sp != '}' ||\n                nmax < nmin) {\n                context->sp = from;\n                return NULL;\n            }\n        }\n    } else if (*from != '}' && *context->sp == '}') {\n        nmax = nmin;\n    } else {\n        context->sp = from;\n        return NULL;\n    }\n\n    ++context->sp;\n    return push(context,\n                &(cregex_node_t){\n                    .type = REGEX_NODE_TYPE_QUANTIFIER,\n                    .nmin = nmin,\n                    .nmax = nmax,\n                    .greedy = (*context->sp == '?') ? (++context->sp, 0) : 1,\n                    .quantified = consume(context)});\n}\n\nstatic cregex_node_t *parse_context(regex_parse_context *context, int depth)\n{\n    cregex_node_t *bottom = context->stack;\n\n    for (;;) {\n        int ch = *context->sp++;\n        switch (ch) {\n        /* Characters */\n        case '\\\\':\n            ch = *context->sp++;\n            /* fall-through */\n        default:\n        CHARACTER:\n            push(context,\n                 &(cregex_node_t){.type = REGEX_NODE_TYPE_CHARACTER, .ch = ch});\n            break;\n        case '.':\n            push(context,\n                 &(cregex_node_t){.type = REGEX_NODE_TYPE_ANY_CHARACTER});\n            break;\n        case '[':\n            if (!parse_char_class(context))\n                return NULL;\n            break;\n\n        /* Composites */\n        case '|': {\n            cregex_node_t *left = concatenate(context, bottom), *right;\n            if (!(right = parse_context(context, depth)))\n                return NULL;\n            if (left->type == REGEX_NODE_TYPE_EPSILON &&\n                right->type == left->type) {\n                drop(context);\n            } else if (left->type == REGEX_NODE_TYPE_EPSILON) {\n                right = consume(context);\n                drop(context);\n                push(context,\n                     &(cregex_node_t){.type = REGEX_NODE_TYPE_QUANTIFIER,\n                                      .nmin = 0,\n                                      .nmax = 1,\n                                      .greedy = 1,\n                                      .quantified = right});\n            } else if (right->type == REGEX_NODE_TYPE_EPSILON) {\n                drop(context);\n                left = consume(context);\n                push(context,\n                     &(cregex_node_t){.type = REGEX_NODE_TYPE_QUANTIFIER,\n                                      .nmin = 0,\n                                      .nmax = 1,\n                                      .greedy = 1,\n                                      .quantified = left});\n            } else {\n                right = consume(context);\n                left = consume(context);\n                push(context,\n                     &(cregex_node_t){.type = REGEX_NODE_TYPE_ALTERNATION,\n                                      .left = left,\n                                      .right = right});\n            }\n            return bottom;\n        }\n\n#define QUANTIFIER(ch, min, max)                                           \\\n    case ch:                                                               \\\n        if (context->stack == bottom)                                      \\\n            goto CHARACTER;                                                \\\n        push(context,                                                      \\\n             &(cregex_node_t){                                             \\\n                 .type = REGEX_NODE_TYPE_QUANTIFIER,                       \\\n                 .nmin = min,                                              \\\n                 .nmax = max,                                              \\\n                 .greedy = (*context->sp == '?') ? (++context->sp, 0) : 1, \\\n                 .quantified = consume(context)});                         \\\n        break\n\n            /* clang-format off */\n        /* Quantifiers */\n        QUANTIFIER('?', 0, 1);\n        QUANTIFIER('*', 0, -1);\n        QUANTIFIER('+', 1, -1);\n            /* clang-format on */\n#undef QUANTIFIER\n\n        case '{':\n            if ((context->stack == bottom) || !parse_interval(context))\n                goto CHARACTER;\n            break;\n\n        /* Anchors */\n        case '^':\n            push(context,\n                 &(cregex_node_t){.type = REGEX_NODE_TYPE_ANCHOR_BEGIN});\n            break;\n        case '$':\n            push(context, &(cregex_node_t){.type = REGEX_NODE_TYPE_ANCHOR_END});\n            break;\n\n        /* Captures */\n        case '(':\n            if (!parse_context(context, depth + 1))\n                return NULL;\n            push(context, &(cregex_node_t){.type = REGEX_NODE_TYPE_CAPTURE,\n                                           .captured = consume(context)});\n            break;\n        case ')':\n            if (depth > 0)\n                return concatenate(context, bottom);\n            /* unmatched close parenthesis */\n            return NULL;\n\n        /* End of string */\n        case '\\0':\n            if (depth == 0)\n                return concatenate(context, bottom);\n            /* unmatched open parenthesis */\n            return NULL;\n        }\n    }\n}\n\nstatic inline int estimate_nodes(const char *pattern)\n{\n    return (int)strlen(pattern) * 2;\n}\n\n/* Parse a pattern (using a previously allocated buffer of at least\n * estimate_nodes(pattern) nodes).\n */\nstatic cregex_node_t *parse_with_nodes(const char *pattern,\n                                       cregex_node_t *nodes)\n{\n    regex_parse_context *context =\n        &(regex_parse_context){.sp = pattern,\n                               .stack = nodes,\n                               .output = nodes + estimate_nodes(pattern)};\n    return parse_context(context, 0);\n}\n\ncregex_node_t *cregex_parse(const char *pattern)\n{\n    size_t size = sizeof(cregex_node_t) * estimate_nodes(pattern);\n    cregex_node_t* nodes;\n\n    nodes = malloc(size);\n    if (!nodes)\n        return NULL;\n\n    if (!parse_with_nodes(pattern, nodes)) {\n        free(nodes);\n        return NULL;\n    }\n\n    return nodes;\n}\n\nvoid cregex_parse_free(cregex_node_t *root)\n{\n    free(root);\n}\n"
  },
  {
    "path": "src/cregex_vm.c",
    "content": "#include <stdlib.h>\n#include <string.h>\n\n#include \"cregex.h\"\n\n/* The VM executes one or more threads, each running a regular expression\n * program, which is just a list of regular expression instructions. Each\n * thread maintains two registers while it runs: a program counter (PC) and\n * a string pointer (SP).\n */\ntypedef struct {\n    int visited;\n    const cregex_program_instr_t *pc;\n    const char *matches[REGEX_VM_MAX_MATCHES];\n} vm_thread;\n\n/* Run program on string */\nstatic int vm_run(const cregex_program_t *program,\n                  const char *string,\n                  const char **matches,\n                  int nmatches);\n\n/* Run program on string (using a previously allocated buffer of at least\n * vm_estimate_threads(program) threads)\n */\nstatic int vm_run_with_threads(const cregex_program_t *program,\n                               const char *string,\n                               const char **matches,\n                               int nmatches,\n                               vm_thread *threads);\n\ntypedef struct {\n    int nthreads;\n    vm_thread *threads;\n} vm_thread_list;\n\nstatic void vm_add_thread(vm_thread_list *list,\n                          const cregex_program_t *program,\n                          const cregex_program_instr_t *pc,\n                          const char *string,\n                          const char *sp,\n                          const char **matches,\n                          int nmatches)\n{\n    if (list->threads[pc - program->instructions].visited == sp - string + 1)\n        return;\n    list->threads[pc - program->instructions].visited = (int)(sp - string + 1);\n\n    switch (pc->opcode) {\n    case REGEX_PROGRAM_OPCODE_MATCH:\n        /* fall-through */\n\n    /* Characters */\n    case REGEX_PROGRAM_OPCODE_CHARACTER:\n    case REGEX_PROGRAM_OPCODE_ANY_CHARACTER:\n    case REGEX_PROGRAM_OPCODE_CHARACTER_CLASS:\n    case REGEX_PROGRAM_OPCODE_CHARACTER_CLASS_NEGATED:\n        list->threads[list->nthreads].pc = pc;\n        memcpy((void*)list->threads[list->nthreads].matches, matches,\n               sizeof(matches[0]) * ((nmatches <= REGEX_VM_MAX_MATCHES)\n                                         ? nmatches\n                                         : REGEX_VM_MAX_MATCHES));\n        ++list->nthreads;\n        break;\n\n    /* Control-flow */\n    case REGEX_PROGRAM_OPCODE_SPLIT:\n        vm_add_thread(list, program, pc->first, string, sp, matches, nmatches);\n        vm_add_thread(list, program, pc->second, string, sp, matches, nmatches);\n        break;\n    case REGEX_PROGRAM_OPCODE_JUMP:\n        vm_add_thread(list, program, pc->target, string, sp, matches, nmatches);\n        break;\n\n    /* Assertions */\n    case REGEX_PROGRAM_OPCODE_ASSERT_BEGIN:\n        if (sp == string)\n            vm_add_thread(list, program, pc + 1, string, sp, matches, nmatches);\n        break;\n    case REGEX_PROGRAM_OPCODE_ASSERT_END:\n        if (!*sp)\n            vm_add_thread(list, program, pc + 1, string, sp, matches, nmatches);\n        break;\n\n    /* Saving */\n    case REGEX_PROGRAM_OPCODE_SAVE:\n        if (pc->save < nmatches && pc->save < REGEX_VM_MAX_MATCHES) {\n            const char *saved = matches[pc->save];\n            matches[pc->save] = sp;\n            vm_add_thread(list, program, pc + 1, string, sp, matches, nmatches);\n            matches[pc->save] = saved;\n        } else {\n            vm_add_thread(list, program, pc + 1, string, sp, matches, nmatches);\n        }\n        break;\n    }\n}\n\n/* Upper bound of number of threads required to run program */\nstatic int vm_estimate_threads(const cregex_program_t *program)\n{\n    return program->ninstructions * 2;\n}\n\nstatic int vm_run(const cregex_program_t *program,\n                  const char *string,\n                  const char **matches,\n                  int nmatches)\n{\n    size_t size = sizeof(vm_thread) * vm_estimate_threads(program);\n    vm_thread *threads;\n    int matched;\n\n    if (!(threads = malloc(size)))\n        return -1;\n\n    matched = vm_run_with_threads(program, string, matches, nmatches, threads);\n    free(threads);\n    return matched;\n}\n\nstatic int vm_run_with_threads(const cregex_program_t *program,\n                               const char *string,\n                               const char **matches,\n                               int nmatches,\n                               vm_thread *threads)\n{\n    vm_thread_list *current =\n        &(vm_thread_list){.nthreads = 0, .threads = threads};\n    vm_thread_list *next = &(vm_thread_list){\n        .nthreads = 0, .threads = threads + program->ninstructions};\n    int matched = 0;\n\n    memset(matches, 0, sizeof(char*) * nmatches);\n    memset(threads, 0, sizeof(vm_thread) * program->ninstructions * 2);\n\n    vm_add_thread(current, program, program->instructions, string, string,\n                  matches, nmatches);\n\n    for (const char *sp = string;; ++sp) {\n        for (int i = 0; i < current->nthreads; ++i) {\n            vm_thread *thread = current->threads + i;\n            switch (thread->pc->opcode) {\n            case REGEX_PROGRAM_OPCODE_MATCH:\n                matched = 1;\n                current->nthreads = 0;\n                memcpy(matches, thread->matches,\n                       sizeof(matches[0]) * ((nmatches <= REGEX_VM_MAX_MATCHES)\n                                                 ? nmatches\n                                                 : REGEX_VM_MAX_MATCHES));\n                continue;\n\n            /* Characters */\n            case REGEX_PROGRAM_OPCODE_CHARACTER:\n                if (*sp == thread->pc->ch)\n                    break;\n                continue;\n            case REGEX_PROGRAM_OPCODE_ANY_CHARACTER:\n                if (*sp)\n                    break;\n                continue;\n            case REGEX_PROGRAM_OPCODE_CHARACTER_CLASS:\n                if (cregex_char_class_contains(thread->pc->klass, *sp))\n                    break;\n                continue;\n            case REGEX_PROGRAM_OPCODE_CHARACTER_CLASS_NEGATED:\n                if (!cregex_char_class_contains(thread->pc->klass, *sp))\n                    break;\n                continue;\n\n            /* Control-flow */\n            case REGEX_PROGRAM_OPCODE_SPLIT:\n            case REGEX_PROGRAM_OPCODE_JUMP:\n                /* fall-through */\n\n            /* Assertions */\n            case REGEX_PROGRAM_OPCODE_ASSERT_BEGIN:\n            case REGEX_PROGRAM_OPCODE_ASSERT_END:\n                /* fall-through */\n\n            /* Saving */\n            case REGEX_PROGRAM_OPCODE_SAVE:\n                /* handled in vm_add_thread() */\n                abort();\n            }\n\n            vm_add_thread(next, program, thread->pc + 1, string, sp + 1,\n                          thread->matches, nmatches);\n        }\n\n        /* swap current and next thread list */\n        vm_thread_list *swap = current;\n        current = next;\n        next = swap;\n        next->nthreads = 0;\n\n        /* done if no more threads are running or end of string reached */\n        if (current->nthreads == 0 || !*sp)\n            break;\n    }\n\n    return matched;\n}\n\nint cregex_program_run(const cregex_program_t *program,\n                       const char *string,\n                       const char **matches,\n                       int nmatches)\n{\n    return vm_run(program, string, matches, nmatches);\n}\n"
  },
  {
    "path": "src/darkmode.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Dark mode UI implementation\n * Copyright © 2025 ozone10\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <dwmapi.h>\n#include <richedit.h>\n#include <uxtheme.h>\n#include <versionhelpers.h>\n#include <vssym32.h>\n#include <math.h>\n\n#include \"rufus.h\"\n#include \"ui.h\"\n#include \"settings.h\"\n#include \"darkmode.h\"\n\nPF_TYPE_DECL(WINAPI, BOOL, AllowDarkModeForWindow, (HWND, BOOL));\nPF_TYPE_DECL(WINAPI, PreferredAppMode, SetPreferredAppMode, (PreferredAppMode));\nPF_TYPE_DECL(WINAPI, VOID, FlushMenuThemes, (VOID));\nPF_TYPE_DECL(WINAPI, BOOL, SetWindowCompositionAttribute, (HWND, WINDOWCOMPOSITIONATTRIBDATA*));\n\nBOOL is_darkmode_enabled = FALSE;\n\nstatic COLORREF color_accent = TOOLBAR_ICON_COLOR;\n\nstatic inline BOOL IsAtLeastWin10Build(DWORD buildNumber)\n{\n\tOSVERSIONINFOEXW osvi = { 0 };\n\n\tif (!IsWindows10OrGreater())\n\t\treturn FALSE;\n\n\tosvi.dwOSVersionInfoSize = sizeof(osvi);\n\tosvi.dwBuildNumber = buildNumber;\n\n\treturn VerifyVersionInfoW(&osvi, VER_BUILDNUMBER, VerSetConditionMask(0, VER_BUILDNUMBER, VER_GREATER_EQUAL));\n}\n\nstatic inline BOOL IsAtLeastWin10(void)\n{\n\treturn IsAtLeastWin10Build(WIN10_1809);\n}\n\nstatic inline BOOL IsAtLeastWin11(void)\n{\n\treturn IsAtLeastWin10Build(WIN11_21H2);\n}\n\nstatic inline BOOL IsHighContrast(void)\n{\n\tHIGHCONTRASTW highContrast = { 0 };\n\n\thighContrast.cbSize = sizeof(HIGHCONTRASTW);\n\tif (SystemParametersInfoW(SPI_GETHIGHCONTRAST, sizeof(HIGHCONTRASTW), &highContrast, FALSE))\n\t\treturn (highContrast.dwFlags & HCF_HIGHCONTRASTON) == HCF_HIGHCONTRASTON;\n\treturn FALSE;\n}\n\nBOOL GetDarkModeFromRegistry(void)\n{\n\tDWORD data = 0, size = sizeof(data);\n\n\tif (!IsAtLeastWin10() || IsHighContrast())\n\t\treturn FALSE;\n\n\t// 0 = follow system, 1 = dark mode always, anything else = light mode always\n\tswitch (ReadSetting32(SETTING_DARK_MODE)) {\n\tcase 0:\n\t\tif (RegGetValueA(HKEY_CURRENT_USER, \"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Themes\\\\Personalize\",\n\t\t\t\"AppsUseLightTheme\", RRF_RT_REG_DWORD, NULL, &data, &size) == ERROR_SUCCESS)\n\t\t\t// Dark mode is 0, light mode is 1\n\t\t\treturn (data == 0);\n\t\treturn FALSE;\n\tcase 1:\n\t\treturn TRUE;\n\tdefault:\n\t\treturn FALSE;\n\t}\n}\n\nvoid InitDarkMode(HWND hWnd)\n{\n\tif (!IsAtLeastWin10() || IsHighContrast())\n\t\tgoto out;\n\n\tPF_INIT_ID_OR_OUT(AllowDarkModeForWindow, UxTheme, 133);\n\tPF_INIT_ID_OR_OUT(SetPreferredAppMode, UxTheme, 135);\n\tPF_INIT_ID_OR_OUT(FlushMenuThemes, UxTheme, 136);\n\n\tpfAllowDarkModeForWindow(hWnd, is_darkmode_enabled);\n\tpfSetPreferredAppMode(is_darkmode_enabled ? AppModeForceDark : AppModeForceLight);\n\tpfFlushMenuThemes();\n\treturn;\n\nout:\n\tis_darkmode_enabled = FALSE;\n}\n\nvoid SetDarkTitleBar(HWND hWnd)\n{\n\tif (IsAtLeastWin11()) {\n\t\tDwmSetWindowAttribute(hWnd, DWMWA_USE_IMMERSIVE_DARK_MODE, &is_darkmode_enabled, sizeof(is_darkmode_enabled));\n\t\treturn;\n\t}\n\tif (IsAtLeastWin10Build(WIN10_1903)) {\n\t\tPF_INIT_OR_OUT(SetWindowCompositionAttribute, user32);\n\t\tWINDOWCOMPOSITIONATTRIBDATA data = { WCA_USEDARKMODECOLORS, &is_darkmode_enabled, sizeof(is_darkmode_enabled) };\n\t\tpfSetWindowCompositionAttribute(hWnd, &data);\n\t\treturn;\n\t}\n\t// only for Windows 10 1809 build 17763\n\tif (IsAtLeastWin10()) {\n\t\tSetPropW(hWnd, L\"UseImmersiveDarkModeColors\", (HANDLE)(intptr_t)is_darkmode_enabled);\n\t\treturn;\n\t}\n\nout:\n\tis_darkmode_enabled = FALSE;\n}\n\nvoid SetDarkTheme(HWND hWnd)\n{\n\tSetWindowTheme(hWnd, is_darkmode_enabled ? L\"DarkMode_Explorer\" : NULL, NULL);\n}\n\n/*\n * Accent color functions\n */\n// Adapted from https://stackoverflow.com/a/56678483\nstatic double LinearValue(double color_channel)\n{\n\tcolor_channel /= 255.0;\n\tif (color_channel <= 0.04045)\n\t\treturn color_channel / 12.92;\n\treturn pow((color_channel + 0.055) / 1.055, 2.4);\n}\n\nstatic double CalculatePerceivedLightness(COLORREF clr)\n{\n\tdouble r, g, b, luminance, lightness;\n\n\tr = LinearValue((double)GetRValue(clr));\n\tg = LinearValue((double)GetGValue(clr));\n\tb = LinearValue((double)GetBValue(clr));\n\tluminance = (0.2126 * r) + (0.7152 * g) + (0.0722 * b);\n\tlightness = (luminance <= 216.0 / 24389.0) ?\n\t\t(luminance * 24389.0 / 27.0) :\n\t\t((pow(luminance, 1.0 / 3.0) * 116.0) - 16.0);\n\treturn lightness;\n}\n\nBOOL InitAccentColor(void)\n{\n\tconst double lightnessTreshold = 50.0 - 4.0;\n\tBOOL opaque = TRUE;\n\n\tif (SUCCEEDED(DwmGetColorizationColor(&color_accent, &opaque))) {\n\t\tcolor_accent = RGB(GetBValue(color_accent), GetGValue(color_accent), GetRValue(color_accent));\n\t\t// Check if accent color is too dark\n\t\tif (CalculatePerceivedLightness(color_accent) < lightnessTreshold) {\n\t\t\tcolor_accent = DARKMODE_TOOLBAR_ICON_COLOR;\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}\n\tcolor_accent = TOOLBAR_ICON_COLOR;\n\treturn FALSE;\n}\n\n// Rufus uses monocolour icons, so changing colour is easy\nBOOL ChangeIconColor(HICON* hIcon, COLORREF new_color)\n{\n\tHDC hdcScreen = NULL, hdcBitmap = NULL;\n\tHBITMAP hbm = NULL;\n\tBITMAP bmp = { 0 };\n\tICONINFO ii;\n\tHICON hIconNew = NULL;\n\tRGBQUAD* pixels = NULL;\n\n\tif (!*hIcon || !is_darkmode_enabled)\n\t\treturn FALSE;\n\n\tif (new_color == 0)\n\t\tnew_color = color_accent;\n\n\thdcBitmap = CreateCompatibleDC(NULL);\n\thdcScreen = GetDC(NULL);\n\tif (hdcScreen) {\n\t\tif (hdcBitmap) {\n\t\t\tif (GetIconInfo(*hIcon, &ii) && GetObject(ii.hbmColor, sizeof(BITMAP), &bmp)) {\n\t\t\t\tBITMAPINFO bmi = { 0 };\n\t\t\t\tbmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);\n\t\t\t\tbmi.bmiHeader.biWidth = bmp.bmWidth;\n\t\t\t\tbmi.bmiHeader.biHeight = -bmp.bmHeight;\n\t\t\t\tbmi.bmiHeader.biPlanes = 1;\n\t\t\t\tbmi.bmiHeader.biBitCount = 32;\n\t\t\t\tbmi.bmiHeader.biCompression = BI_RGB;\n\n\t\t\t\tpixels = (RGBQUAD*)malloc((size_t)bmp.bmWidth * bmp.bmHeight * sizeof(RGBQUAD));\n\t\t\t\tif (pixels && GetDIBits(hdcBitmap, ii.hbmColor, 0, bmp.bmHeight, pixels, &bmi, DIB_RGB_COLORS)) {\n\t\t\t\t\tfor (int i = 0; i < bmp.bmWidth * bmp.bmHeight; i++) {\n\t\t\t\t\t\tif (pixels[i].rgbReserved != 0) {\n\t\t\t\t\t\t\tpixels[i].rgbRed = GetRValue(new_color);\n\t\t\t\t\t\t\tpixels[i].rgbGreen = GetGValue(new_color);\n\t\t\t\t\t\t\tpixels[i].rgbBlue = GetBValue(new_color);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\thbm = CreateCompatibleBitmap(hdcScreen, bmp.bmWidth, bmp.bmHeight);\n\t\t\t\t\tif (hbm != NULL) {\n\t\t\t\t\t\tSetDIBits(hdcBitmap, hbm, 0, bmp.bmHeight, pixels, &bmi, DIB_RGB_COLORS);\n\t\t\t\t\t\tif (ii.hbmColor != NULL)\n\t\t\t\t\t\t\tDeleteObject(ii.hbmColor);\n\t\t\t\t\t\tii.hbmColor = hbm;\n\t\t\t\t\t\thIconNew = CreateIconIndirect(&ii);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsafe_free(pixels);\n\t\t\t\t\t\tDeleteObject(ii.hbmColor);\n\t\t\t\t\t\tDeleteObject(ii.hbmMask);\n\t\t\t\t\t\tDeleteDC(hdcBitmap);\n\t\t\t\t\t\tReleaseDC(NULL, hdcScreen);\n\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsafe_free(pixels);\n\t\t\t\tsafe_delete_object(hbm);\n\t\t\t\tDeleteObject(ii.hbmColor);\n\t\t\t\tDeleteObject(ii.hbmMask);\n\t\t\t}\n\t\t}\n\t\tReleaseDC(NULL, hdcScreen);\n\t}\n\n\tif (hdcBitmap != NULL)\n\t\tDeleteDC(hdcBitmap);\n\n\tif (hIconNew == NULL)\n\t\treturn FALSE;\n\tDestroyIcon(*hIcon);\n\t*hIcon = hIconNew;\n\n\treturn TRUE;\n}\n\n/*\n * Dark mode custom colors\n */\nstatic ThemeResources theme_resources = {\n\tNULL, NULL, NULL, NULL, NULL, NULL\n};\n\nstatic HBRUSH GetDlgBackgroundBrush(void)\n{\n\tif (theme_resources.hbrBackground == NULL)\n\t\ttheme_resources.hbrBackground = CreateSolidBrush(DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR);\n\treturn theme_resources.hbrBackground;\n}\n\nstatic HBRUSH GetCtrlBackgroundBrush(void)\n{\n\tif (theme_resources.hbrBackgroundControl == NULL)\n\t\ttheme_resources.hbrBackgroundControl = CreateSolidBrush(DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR);\n\treturn theme_resources.hbrBackgroundControl;\n}\n\nstatic HBRUSH GetHotBackgroundBrush(void)\n{\n\tif (theme_resources.hbrBackgroundHot == NULL)\n\t\ttheme_resources.hbrBackgroundHot = CreateSolidBrush(DARKMODE_HOT_CONTROL_BACKGROUND_COLOR);\n\treturn theme_resources.hbrBackgroundHot;\n}\n\nstatic HBRUSH GetEdgeBrush(void)\n{\n\tif (theme_resources.hbrEdge == NULL)\n\t\ttheme_resources.hbrEdge = CreateSolidBrush(DARKMODE_NORMAL_CONTROL_EDGE_COLOR);\n\treturn theme_resources.hbrEdge;\n}\n\nstatic HPEN GetEdgePen(void)\n{\n\tif (theme_resources.hpnEdge == NULL)\n\t\ttheme_resources.hpnEdge = CreatePen(PS_SOLID, 1, DARKMODE_NORMAL_CONTROL_EDGE_COLOR);\n\treturn theme_resources.hpnEdge;\n}\nstatic HPEN GetHotEdgePen(void)\n{\n\tif (theme_resources.hpnEdgeHot == NULL)\n\t\ttheme_resources.hpnEdgeHot = CreatePen(PS_SOLID, 1, DARKMODE_HOT_CONTROL_EDGE_COLOR);\n\treturn theme_resources.hpnEdgeHot;\n}\n\nvoid DestroyDarkModeGDIObjects(void)\n{\n\tsafe_delete_object(theme_resources.hbrBackground);\n\tsafe_delete_object(theme_resources.hbrBackgroundControl);\n\tsafe_delete_object(theme_resources.hbrBackgroundHot);\n\tsafe_delete_object(theme_resources.hbrEdge);\n\tsafe_delete_object(theme_resources.hpnEdge);\n\tsafe_delete_object(theme_resources.hpnEdgeHot);\n}\n\n/*\n * Paint round rect helpers\n */\nstatic void PaintRoundRect(HDC hdc, const RECT rect, HPEN hpen, HBRUSH hBrush, int width, int height)\n{\n\tHBRUSH holdBrush = (HBRUSH)SelectObject(hdc, hBrush);\n\tHPEN holdPen = (HPEN)SelectObject(hdc, hpen);\n\n\tRoundRect(hdc, rect.left, rect.top, rect.right, rect.bottom, width, height);\n\tSelectObject(hdc, holdBrush);\n\tSelectObject(hdc, holdPen);\n}\n\nstatic void PaintRoundFrameRect(HDC hdc, const RECT rect, HPEN hpen, int width, int height)\n{\n\tPaintRoundRect(hdc, rect, hpen, GetStockObject(NULL_BRUSH), width, height);\n}\n\n/*\n * Button section, checkbox, radio, and groupbox style buttons\n */\nstatic void RenderButton(HWND hWnd, HDC hdc, HTHEME hTheme, int iPartID, int iStateID)\n{\n\tHFONT hFont = NULL, hOldFont;\n\tBOOL created_font = FALSE;\n\tLOGFONT lf;\n\tRECT rcClient = { 0 }, rcText = { 0 }, rcBackground, rcFocus;\n\tWCHAR buffer[MAX_PATH] = { '\\0' };\n\tSIZE szBox = { 0 };\n\tLONG_PTR nStyle = GetWindowLongPtr(hWnd, GWL_STYLE);\n\tDWORD flags, ui_state;\n\tDTTOPTS dtto = { 0 };\n\n\tconst BOOL isMultiline = (nStyle & BS_MULTILINE) == BS_MULTILINE;\n\tconst BOOL isTop = (nStyle & BS_TOP) == BS_TOP;\n\tconst BOOL isBottom = (nStyle & BS_BOTTOM) == BS_BOTTOM;\n\tconst BOOL isCenter = (nStyle & BS_CENTER) == BS_CENTER;\n\tconst BOOL isRight = (nStyle & BS_RIGHT) == BS_RIGHT;\n\tconst BOOL isVCenter = (nStyle & BS_VCENTER) == BS_VCENTER;\n\n\tif (SUCCEEDED(GetThemeFont(hTheme, hdc, iPartID, iStateID, TMT_FONT, &lf))) {\n\t\thFont = CreateFontIndirect(&lf);\n\t\tcreated_font = TRUE;\n\t}\n\tif (!hFont)\n\t\thFont = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0);\n\thOldFont = (HFONT)SelectObject(hdc, hFont);\n\n\tflags = DT_LEFT | (isMultiline ? DT_WORDBREAK : DT_SINGLELINE);\n\tif (isCenter)\n\t\tflags |= DT_CENTER;\n\telse if (isRight)\n\t\tflags |= DT_RIGHT;\n\tif (isVCenter || (!isMultiline && !isBottom && !isTop))\n\t\tflags |= DT_VCENTER;\n\telse if (isBottom)\n\t\tflags |= DT_BOTTOM;\n\n\tui_state = (DWORD)SendMessage(hWnd, WM_QUERYUISTATE, 0, 0);\n\tif ((ui_state & UISF_HIDEACCEL) == UISF_HIDEACCEL)\n\t\tflags |= DT_HIDEPREFIX;\n\n\tGetClientRect(hWnd, &rcClient);\n\tGetWindowText(hWnd, buffer, _countof(buffer));\n\tGetThemePartSize(hTheme, hdc, iPartID, iStateID, NULL, TS_DRAW, &szBox);\n\tGetThemeBackgroundContentRect(hTheme, hdc, iPartID, iStateID, &rcClient, &rcText);\n\trcBackground = rcClient;\n\tif (!isMultiline)\n\t\trcBackground.top += (rcText.bottom - rcText.top - szBox.cy) / 2;\n\trcBackground.bottom = rcBackground.top + szBox.cy;\n\trcBackground.right = rcBackground.left + szBox.cx;\n\trcText.left = rcBackground.right + 3;\n\n\tDrawThemeParentBackground(hWnd, hdc, &rcClient);\n\tDrawThemeBackground(hTheme, hdc, iPartID, iStateID, &rcBackground, NULL);\n\n\tdtto.dwSize = sizeof(DTTOPTS);\n\tdtto.dwFlags = DTT_TEXTCOLOR;\n\tdtto.crText = !IsWindowEnabled(hWnd) ? DARKMODE_DISABLED_TEXT_COLOR : DARKMODE_NORMAL_TEXT_COLOR;\n\n\t// coverity[negative_returns]\n\tDrawThemeTextEx(hTheme, hdc, iPartID, iStateID, buffer, -1, flags, &rcText, &dtto);\n\n\tif (((SendMessage(hWnd, BM_GETSTATE, 0, 0) & BST_FOCUS) == BST_FOCUS) && ((ui_state & UISF_HIDEFOCUS) != UISF_HIDEFOCUS)) {\n\t\tdtto.dwFlags |= DTT_CALCRECT;\n\t\t// coverity[negative_returns]\n\t\tDrawThemeTextEx(hTheme, hdc, iPartID, iStateID, buffer, -1, flags | DT_CALCRECT, &rcText, &dtto);\n\t\trcFocus = rcText;\n\t\trcFocus.bottom++;\n\t\trcFocus.left--;\n\t\trcFocus.right++;\n\t\tDrawFocusRect(hdc, &rcFocus);\n\t}\n\n\tSelectObject(hdc, hOldFont);\n\tif (created_font)\n\t\tDeleteObject(hFont);\n}\n\nstatic void PaintButton(HWND hWnd, HDC hdc, ButtonData* pButtonData)\n{\n\tconst DWORD state = (DWORD)SendMessage(hWnd, BM_GETSTATE, 0, 0);\n\tint part_id = BP_CHECKBOX, state_id = RBS_UNCHECKEDNORMAL;\n\tBP_ANIMATIONPARAMS anim_params = { 0 };\n\tHANIMATIONBUFFER anim_buffer;\n\tRECT rcClient = { 0 };\n\tHDC hdcFrom = NULL, hdcTo = NULL;\n\n\tswitch (GetWindowLongPtr(hWnd, GWL_STYLE) & BS_TYPEMASK) {\n\tcase BS_CHECKBOX:\n\tcase BS_AUTOCHECKBOX:\n\tcase BS_3STATE:\n\tcase BS_AUTO3STATE:\n\t\tpart_id = BP_CHECKBOX;\n\t\tbreak;\n\tcase BS_RADIOBUTTON:\n\tcase BS_AUTORADIOBUTTON:\n\t\tpart_id = BP_RADIOBUTTON;\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\t// States of BP_CHECKBOX and BP_RADIOBUTTON are the same\n\tif (!IsWindowEnabled(hWnd))\n\t\tstate_id = RBS_UNCHECKEDDISABLED;\n\telse if (state & BST_PUSHED)\n\t\tstate_id = RBS_UNCHECKEDPRESSED;\n\telse if (state & BST_HOT)\n\t\tstate_id = RBS_UNCHECKEDHOT;\n\tif (state & BST_CHECKED)\n\t\tstate_id += 4;\n\tif (BufferedPaintRenderAnimation(hWnd, hdc))\n\t\treturn;\n\n\tanim_params.cbSize = sizeof(BP_ANIMATIONPARAMS);\n\tanim_params.style = BPAS_LINEAR;\n\tif (state_id != pButtonData->iStateID)\n\t\tGetThemeTransitionDuration(pButtonData->hTheme, part_id, pButtonData->iStateID, state_id, TMT_TRANSITIONDURATIONS, &anim_params.dwDuration);\n\n\tGetClientRect(hWnd, &rcClient);\n\tanim_buffer = BeginBufferedAnimation(hWnd, hdc, &rcClient, BPBF_COMPATIBLEBITMAP, NULL, &anim_params, &hdcFrom, &hdcTo);\n\tif (anim_buffer != NULL) {\n\t\tif (hdcFrom != NULL)\n\t\t\tRenderButton(hWnd, hdcFrom, pButtonData->hTheme, part_id, pButtonData->iStateID);\n\t\tif (hdcTo != NULL)\n\t\t\tRenderButton(hWnd, hdcTo, pButtonData->hTheme, part_id, state_id);\n\t\tpButtonData->iStateID = state_id;\n\t\tEndBufferedAnimation(anim_buffer, TRUE);\n\t} else {\n\t\tRenderButton(hWnd, hdc, pButtonData->hTheme, part_id, state_id);\n\t\tpButtonData->iStateID = state_id;\n\t}\n}\n\nstatic LRESULT CALLBACK ButtonSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,\n\tUINT_PTR uIdSubclass, DWORD_PTR dwRefData)\n{\n\tButtonData* data = (ButtonData*)dwRefData;\n\n\tswitch (uMsg) {\n\tcase WM_NCDESTROY:\n\t\tRemoveWindowSubclass(hWnd, ButtonSubclass, uIdSubclass);\n\t\tif (data->hTheme != NULL)\n\t\t\tCloseThemeData(data->hTheme);\n\t\tfree(data);\n\t\tbreak;\n\n\tcase WM_ERASEBKGND:\n\t\tif (data->hTheme == NULL)\n\t\t\tdata->hTheme = OpenThemeData(hWnd, VSCLASS_BUTTON);\n\t\tif (data->hTheme != NULL)\n\t\t\treturn TRUE;\n\t\tbreak;\n\n\tcase WM_PRINTCLIENT:\n\tcase WM_PAINT:\n\t\tPAINTSTRUCT ps = { 0 };\n\t\tHDC hdc = (HDC)wParam;\n\t\tif (data->hTheme == NULL) {\n\t\t\tdata->hTheme = OpenThemeData(hWnd, VSCLASS_BUTTON);\n\t\t\tif (data->hTheme == NULL)\n\t\t\t\tbreak;\n\t\t}\n\t\tif (hdc == NULL)\n\t\t\thdc = BeginPaint(hWnd, &ps);\n\t\tPaintButton(hWnd, hdc, data);\n\t\tif (ps.hdc != NULL)\n\t\t\tEndPaint(hWnd, &ps);\n\t\treturn 0;\n\n\tcase WM_THEMECHANGED:\n\t\tif (data->hTheme != NULL)\n\t\t\tCloseThemeData(data->hTheme);\n\t\tbreak;\n\n\tcase WM_SIZE:\n\tcase WM_DESTROY:\n\t\tBufferedPaintStopAllAnimations(hWnd);\n\t\tbreak;\n\n\tcase WM_ENABLE:\n\t\t// Skip the button's normal WindowProc so it won't redraw out of WM_PAINT\n\t\tLRESULT lr = DefWindowProc(hWnd, uMsg, wParam, lParam);\n\t\tInvalidateRect(hWnd, NULL, FALSE);\n\t\treturn lr;\n\n\tcase WM_UPDATEUISTATE:\n\t\tif (HIWORD(wParam) & (UISF_HIDEACCEL | UISF_HIDEFOCUS))\n\t\t\tInvalidateRect(hWnd, NULL, FALSE);\n\t\tbreak;\n\t}\n\treturn DefSubclassProc(hWnd, uMsg, wParam, lParam);\n}\n\nstatic void SubclassButtonControl(HWND hWnd)\n{\n\tvoid* data = NULL;\n\n\tif (GetWindowSubclass(hWnd, ButtonSubclass, (UINT_PTR)ButtonSubclassID, NULL))\n\t\treturn;\n\n\tdata = calloc(1, sizeof(ButtonData));\n\tSetWindowSubclass(hWnd, ButtonSubclass, (UINT_PTR)ButtonSubclassID, (DWORD_PTR)data);\n}\n\nstatic void PaintGroupbox(HWND hWnd, HDC hdc, ButtonData buttonData)\n{\n\tconst int iStateID = IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED;\n\tconst BOOL centered = (GetWindowLongPtr(hWnd, GWL_STYLE) & BS_CENTER) == BS_CENTER;\n\tBOOL font_created = FALSE;\n\tHFONT hFont = NULL, hOldFont;\n\tLOGFONT lf;\n\tWCHAR buffer[MAX_PATH] = { '\\0' };\n\tSIZE szText = { 0 };\n\tRECT rcClient = { 0 }, rcText, rcBackground, rcContent;\n\n\tif (SUCCEEDED(GetThemeFont(buttonData.hTheme, hdc, BP_GROUPBOX, iStateID, TMT_FONT, &lf))) {\n\t\thFont = CreateFontIndirect(&lf);\n\t\tfont_created = TRUE;\n\t}\n\tif (hFont == NULL) {\n\t\thFont = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0);\n\t\tfont_created = FALSE;\n\t}\n\thOldFont = (HFONT)SelectObject(hdc, hFont);\n\tGetWindowText(hWnd, buffer, _countof(buffer));\n\tGetClientRect(hWnd, &rcClient);\n\trcClient.bottom -= 1;\n\trcText = rcClient; rcBackground = rcClient;\n\n\tif (buffer[0]) {\n\t\tGetTextExtentPoint32(hdc, buffer, (int)wcslen(buffer), &szText);\n\t\trcBackground.top += szText.cy / 2;\n\t\trcText.left += centered ? ((rcClient.right - rcClient.left - szText.cx) / 2) : 7;\n\t\trcText.bottom = rcText.top + szText.cy;\n\t\trcText.right = rcText.left + szText.cx + 4;\n\t\tExcludeClipRect(hdc, rcText.left, rcText.top, rcText.right, rcText.bottom);\n\t} else {\n\t\tGetTextExtentPoint32(hdc, L\"M\", 1, &szText);\n\t\trcBackground.top += szText.cy / 2;\n\t}\n\trcContent = rcBackground;\n\n\tGetThemeBackgroundContentRect(buttonData.hTheme, hdc, BP_GROUPBOX, iStateID, &rcBackground, &rcContent);\n\tExcludeClipRect(hdc, rcContent.left, rcContent.top, rcContent.right, rcContent.bottom);\n\tPaintRoundFrameRect(hdc, rcBackground, GetEdgePen(), 0, 0);\n\tSelectClipRgn(hdc, NULL);\n\n\tif (buffer[0]) {\n\t\tDTTOPTS dtto = { 0 };\n\t\tDWORD flags = centered ? DT_CENTER : DT_LEFT;\n\t\tInflateRect(&rcText, -2, 0);\n\t\tdtto.dwSize = sizeof(DTTOPTS);\n\t\tdtto.dwFlags = DTT_TEXTCOLOR;\n\t\tdtto.crText = IsWindowEnabled(hWnd) ? DARKMODE_NORMAL_TEXT_COLOR : DARKMODE_DISABLED_TEXT_COLOR;\n\t\tif (SendMessage(hWnd, WM_QUERYUISTATE, 0, 0) != (LRESULT)NULL)\n\t\t\tflags |= DT_HIDEPREFIX;\n\t\t// coverity[negative_returns]\n\t\tDrawThemeTextEx(buttonData.hTheme, hdc, BP_GROUPBOX, iStateID, buffer, -1, flags | DT_SINGLELINE, &rcText, &dtto);\n\t}\n\n\tSelectObject(hdc, hOldFont);\n\tif (font_created)\n\t\tDeleteObject(hFont);\n}\n\nstatic LRESULT CALLBACK GroupboxSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,\n\tUINT_PTR uIdSubclass, DWORD_PTR dwRefData)\n{\n\tButtonData* data = (ButtonData*)dwRefData;\n\n\tswitch (uMsg) {\n\tcase WM_NCDESTROY:\n\t\tRemoveWindowSubclass(hWnd, ButtonSubclass, uIdSubclass);\n\t\tif (data->hTheme != NULL)\n\t\t\tCloseThemeData(data->hTheme);\n\t\tfree(data);\n\t\tbreak;\n\n\tcase WM_ERASEBKGND:\n\t\tif (data->hTheme == NULL)\n\t\t\tdata->hTheme = OpenThemeData(hWnd, VSCLASS_BUTTON);\n\t\tif (data->hTheme != NULL)\n\t\t\treturn TRUE;\n\t\tbreak;\n\n\tcase WM_PRINTCLIENT:\n\tcase WM_PAINT:\n\t\tPAINTSTRUCT ps = { 0 };\n\t\tHDC hdc = (HDC)wParam;\n\t\tif (data->hTheme == NULL) {\n\t\t\tdata->hTheme = OpenThemeData(hWnd, VSCLASS_BUTTON);\n\t\t\tif (data->hTheme == NULL)\n\t\t\t\tbreak;\n\t\t}\n\t\tif (hdc == NULL)\n\t\t\thdc = BeginPaint(hWnd, &ps);\n\t\tPaintGroupbox(hWnd, hdc, *data);\n\t\tif (ps.hdc != NULL)\n\t\t\tEndPaint(hWnd, &ps);\n\t\treturn 0;\n\n\tcase WM_THEMECHANGED:\n\t\tif (data->hTheme != NULL)\n\t\t\tCloseThemeData(data->hTheme);\n\t\tbreak;\n\n\tcase WM_ENABLE:\n\t\tRedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE);\n\t\tbreak;\n\t}\n\treturn DefSubclassProc(hWnd, uMsg, wParam, lParam);\n}\n\nstatic void SubclassGroupboxControl(HWND hWnd)\n{\n\tvoid* data = NULL;\n\n\tif (GetWindowSubclass(hWnd, GroupboxSubclass, (UINT_PTR)GroupboxSubclassID, NULL))\n\t\treturn;\n\n\tdata = calloc(1, sizeof(ButtonData));\n\tSetWindowSubclass(hWnd, GroupboxSubclass, (UINT_PTR)GroupboxSubclassID, (DWORD_PTR)data);\n}\n\n/*\n * Toolbar section\n */\nstatic LRESULT DarkToolBarNotifyCustomDraw(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n{\n\tLPNMTBCUSTOMDRAW lpnmtbcd = (LPNMTBCUSTOMDRAW)lParam;\n\tstatic int roundness = 0;\n\n\tswitch (lpnmtbcd->nmcd.dwDrawStage) {\n\tcase CDDS_PREPAINT:\n\t\tif (IsAtLeastWin11())\n\t\t\troundness = 5;\n\t\tFillRect(lpnmtbcd->nmcd.hdc, &lpnmtbcd->nmcd.rc, GetDlgBackgroundBrush());\n\t\treturn CDRF_NOTIFYITEMDRAW;\n\n\tcase CDDS_ITEMPREPAINT:\n\t\tLRESULT lr = TBCDRF_USECDCOLORS;\n\t\tlpnmtbcd->hbrMonoDither = GetDlgBackgroundBrush();\n\t\tlpnmtbcd->hbrLines = GetEdgeBrush();\n\t\tlpnmtbcd->hpenLines = GetEdgePen();\n\t\tlpnmtbcd->clrText = DARKMODE_NORMAL_TEXT_COLOR;\n\t\tlpnmtbcd->clrTextHighlight = DARKMODE_NORMAL_TEXT_COLOR;\n\t\tlpnmtbcd->clrBtnFace = DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR;\n\t\tlpnmtbcd->clrBtnHighlight = DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR;\n\t\tlpnmtbcd->clrHighlightHotTrack = DARKMODE_HOT_CONTROL_BACKGROUND_COLOR;\n\t\tlpnmtbcd->nStringBkMode = TRANSPARENT;\n\t\tlpnmtbcd->nHLStringBkMode = TRANSPARENT;\n\t\tif ((lpnmtbcd->nmcd.uItemState & CDIS_HOT) == CDIS_HOT) {\n\t\t\tPaintRoundRect(lpnmtbcd->nmcd.hdc, lpnmtbcd->nmcd.rc, GetHotEdgePen(), GetHotBackgroundBrush(), roundness, roundness);\n\t\t\tlpnmtbcd->nmcd.uItemState &= ~(CDIS_CHECKED | CDIS_HOT);\n\t\t} else if ((lpnmtbcd->nmcd.uItemState & CDIS_CHECKED) == CDIS_CHECKED) {\n\t\t\tPaintRoundRect(lpnmtbcd->nmcd.hdc, lpnmtbcd->nmcd.rc, GetEdgePen(), GetCtrlBackgroundBrush(), roundness, roundness);\n\t\t\tlpnmtbcd->nmcd.uItemState &= ~CDIS_CHECKED;\n\t\t}\n\t\tif ((lpnmtbcd->nmcd.uItemState & CDIS_SELECTED) == CDIS_SELECTED)\n\t\t\tlr |= TBCDRF_NOBACKGROUND;\n\t\treturn lr;\n\n\tdefault:\n\t\tbreak;\n\t}\n\treturn DefSubclassProc(hWnd, uMsg, wParam, lParam);\n}\n\nstatic LRESULT DarkTrackBarNotifyCustomDraw(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\n{\n\tLPNMCUSTOMDRAW lpnmcd = (LPNMCUSTOMDRAW)lParam;\n\n\tswitch (lpnmcd->dwDrawStage) {\n\tcase CDDS_PREPAINT:\n\t\treturn CDRF_NOTIFYITEMDRAW;\n\n\tcase CDDS_ITEMPREPAINT:\n\t\tswitch (lpnmcd->dwItemSpec) {\n\t\tcase TBCD_THUMB:\n\t\t\tif ((lpnmcd->uItemState & CDIS_SELECTED) == CDIS_SELECTED) {\n\t\t\t\tFillRect(lpnmcd->hdc, &lpnmcd->rc, GetCtrlBackgroundBrush());\n\t\t\t\treturn CDRF_SKIPDEFAULT;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase TBCD_CHANNEL:\n\t\t\tif (!IsWindowEnabled(lpnmcd->hdr.hwndFrom)) {\n\t\t\t\tFillRect(lpnmcd->hdc, &lpnmcd->rc, GetDlgBackgroundBrush());\n\t\t\t\tPaintRoundFrameRect(lpnmcd->hdc, lpnmcd->rc, GetEdgePen(), 0, 0);\n\t\t\t} else {\n\t\t\t\tFillRect(lpnmcd->hdc, &lpnmcd->rc, GetCtrlBackgroundBrush());\n\t\t\t}\n\t\t\treturn CDRF_SKIPDEFAULT;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n\t}\n\treturn DefSubclassProc(hWnd, uMsg, wParam, lParam);\n}\n\nstatic LRESULT CALLBACK WindowNotifySubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,\n\tUINT_PTR uIdSubclass, DWORD_PTR dwRefData)\n{\n\t(void)dwRefData;\n\n\tswitch (uMsg) {\n\tcase WM_NCDESTROY:\n\t\tRemoveWindowSubclass(hWnd, WindowNotifySubclass, uIdSubclass);\n\t\tbreak;\n\n\tcase WM_NOTIFY:\n\t\tLPNMHDR lpnmhdr = (LPNMHDR)lParam;\n\t\tWCHAR str[32] = { 0 };\n\t\tGetClassName(lpnmhdr->hwndFrom, str, ARRAYSIZE(str));\n\n\t\tswitch (lpnmhdr->code) {\n\t\tcase NM_CUSTOMDRAW:\n\t\t\tif (_wcsicmp(str, TOOLBARCLASSNAME) == 0)\n\t\t\t\treturn DarkToolBarNotifyCustomDraw(hWnd, uMsg, wParam, lParam);\n\t\t\tif (_wcsicmp(str, TRACKBAR_CLASS) == 0)\n\t\t\t\treturn DarkTrackBarNotifyCustomDraw(hWnd, uMsg, wParam, lParam);\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\t}\n\treturn DefSubclassProc(hWnd, uMsg, wParam, lParam);\n}\n\nvoid SubclassNotifyCustomDraw(HWND hWnd)\n{\n\tif (!GetWindowSubclass(hWnd, WindowNotifySubclass, (UINT_PTR)WindowNotifySubclassID, NULL))\n\t\tSetWindowSubclass(hWnd, WindowNotifySubclass, (UINT_PTR)WindowNotifySubclassID, 0);\n}\n\n/*\n * Status bar section\n */\nstatic void PaintStatusBar(HWND hWnd, HDC hdc, StatusBarData statusBarData)\n{\n\tconst int last_div = (int)SendMessage(hWnd, SB_GETPARTS, 0, 0) - 1;\n\tBorders borders = { 0 };\n\tRECT rcClient = { 0 }, rcPart = { 0 }, rcIntersect = { 0 };\n\tHPEN hOldPen = (HPEN)SelectObject(hdc, GetEdgePen());\n\tHFONT hOldFont = (HFONT)SelectObject(hdc, statusBarData.hFont);\n\tLRESULT r1, r2;\n\tLPWSTR buffer;\n\tDWORD text_len;\n\tUINT id;\n\n\tSendMessage(hWnd, SB_GETBORDERS, 0, (LPARAM)&borders);\n\tSetBkMode(hdc, TRANSPARENT);\n\tSetTextColor(hdc, DARKMODE_NORMAL_TEXT_COLOR);\n\tGetClientRect(hWnd, &rcClient);\n\tFillRect(hdc, &rcClient, GetDlgBackgroundBrush());\n\n\tfor (int i = 0; i <= last_div; i++) {\n\t\tSendMessage(hWnd, SB_GETRECT, i, (LPARAM)&rcPart);\n\t\tif (!IntersectRect(&rcIntersect, &rcPart, &rcClient))\n\t\t\tcontinue;\n\t\tif (i < last_div) {\n\t\t\tPOINT edges[] = {\n\t\t\t\t{ rcPart.right - borders.between, rcPart.top + 1 },\n\t\t\t\t{ rcPart.right - borders.between, rcPart.bottom - 3 }\n\t\t\t};\n\t\t\tPolyline(hdc, edges, _countof(edges));\n\t\t}\n\n\t\trcPart.left += borders.between;\n\t\trcPart.right -= borders.vertical;\n\n\t\tr1 = SendMessage(hWnd, SB_GETTEXTLENGTH, i, 0);\n\t\ttext_len = LOWORD(r1);\n\t\tbuffer = (LPWSTR)calloc((size_t)text_len + 1, sizeof(WCHAR));\n\t\tr2 = SendMessage(hWnd, SB_GETTEXT, i, (LPARAM)buffer);\n\t\tif (text_len == 0 && (HIWORD(r1) & SBT_OWNERDRAW)) {\n\t\t\tid = GetDlgCtrlID(hWnd);\n\t\t\tDRAWITEMSTRUCT dis = { 0, 0, (UINT)i, ODA_DRAWENTIRE, id, hWnd, hdc, rcPart, (ULONG_PTR)r2 };\n\t\t\tSendMessage(GetParent(hWnd), WM_DRAWITEM, id, (LPARAM)&dis);\n\t\t} else if (buffer != NULL) {\n\t\t\tDrawText(hdc, buffer, (int)text_len, &rcPart, DT_SINGLELINE | DT_VCENTER | DT_LEFT);\n\t\t}\n\t\tfree(buffer);\n\t}\n\n\tPOINT horizontal_edge[] = { { rcClient.left, rcClient.top }, { rcClient.right, rcClient.top } };\n\tPolyline(hdc, horizontal_edge, _countof(horizontal_edge));\n\n\tSelectObject(hdc, hOldFont);\n\tSelectObject(hdc, hOldPen);\n}\n\nstatic LRESULT CALLBACK StatusBarSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,\n\tUINT_PTR uIdSubclass, DWORD_PTR dwRefData)\n{\n\tStatusBarData* data = (StatusBarData*)dwRefData;\n\n\tswitch (uMsg) {\n\tcase WM_NCDESTROY:\n\t\tRemoveWindowSubclass(hWnd, StatusBarSubclass, uIdSubclass);\n\t\tif (data->hFont != NULL) {\n\t\t\tDeleteObject(data->hFont);\n\t\t\tdata->hFont = NULL;\n\t\t}\n\t\tfree(data);\n\t\tbreak;\n\n\tcase WM_ERASEBKGND:\n\t\treturn TRUE;\n\n\tcase WM_PAINT:\n\t\tPAINTSTRUCT ps;\n\t\tHDC hdc = BeginPaint(hWnd, &ps);\n\t\tPaintStatusBar(hWnd, hdc, *data);\n\t\tEndPaint(hWnd, &ps);\n\t\treturn 0;\n\n\tcase WM_THEMECHANGED:\n\t\tNONCLIENTMETRICS ncm = { 0 };\n\t\tncm.cbSize = sizeof(NONCLIENTMETRICS);\n\t\tif (data->hFont != NULL) {\n\t\t\tDeleteObject(data->hFont);\n\t\t\tdata->hFont = NULL;\n\t\t}\n\t\tif (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0))\n\t\t\tdata->hFont = CreateFontIndirect(&ncm.lfStatusFont);\n\t\treturn 0;\n\t}\n\treturn DefSubclassProc(hWnd, uMsg, wParam, lParam);\n}\n\nvoid SubclassStatusBar(HWND hWnd)\n{\n\tStatusBarData* data = NULL;\n\tNONCLIENTMETRICS ncm = { 0 };\n\tncm.cbSize = sizeof(NONCLIENTMETRICS);\n\n\tif (!is_darkmode_enabled || GetWindowSubclass(hWnd, StatusBarSubclass, (UINT_PTR)StatusBarSubclassID, NULL))\n\t\treturn;\n\n\tdata = (StatusBarData*)malloc(sizeof(StatusBarData));\n\tif (data == NULL)\n\t\treturn;\n\tif (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0))\n\t\tdata->hFont = CreateFontIndirect(&ncm.lfStatusFont);\n\tSetWindowSubclass(hWnd, StatusBarSubclass, (UINT_PTR)StatusBarSubclassID, (DWORD_PTR)data);\n}\n\n/*\n * Progress bar section\n */\nstatic void GetProgressBarRects(HWND hWnd, RECT* rcEmpty, RECT* rcFilled)\n{\n\tconst int pos = (int)SendMessage(hWnd, PBM_GETPOS, 0, 0);\n\tPBRANGE range = { 0, 0 };\n\tSendMessage(hWnd, PBM_GETRANGE, TRUE, (LPARAM)&range);\n\tconst int min = range.iLow;\n\tconst int cur_pos = pos - min;\n\n\tif (cur_pos != 0) {\n\t\tint totalWidth = rcEmpty->right - rcEmpty->left;\n\t\trcFilled->left = rcEmpty->left;\n\t\trcFilled->top = rcEmpty->top;\n\t\trcFilled->bottom = rcEmpty->bottom;\n\t\tif (range.iHigh - min != 0)\n\t\t\trcFilled->right = rcEmpty->left + (int)((double)(cur_pos) / (range.iHigh - min) * totalWidth);\n\t\telse\n\t\t\trcFilled->right = rcEmpty->right;\n\t\trcEmpty->left = rcFilled->right; // To avoid painting under filled part\n\t}\n}\n\nstatic void PaintProgressBar(HWND hWnd, HDC hdc, ProgressBarData progressBarData)\n{\n\tRECT rcClient = { 0 }, rcFill = { 0 };\n\n\tGetClientRect(hWnd, &rcClient);\n\tPaintRoundFrameRect(hdc, rcClient, GetEdgePen(), 0, 0);\n\tInflateRect(&rcClient, -1, -1);\n\trcClient.left = 1;\n\tGetProgressBarRects(hWnd, &rcClient, &rcFill);\n\tDrawThemeBackground(progressBarData.hTheme, hdc, PP_FILL, progressBarData.iStateID, &rcFill, NULL);\n\tFillRect(hdc, &rcClient, GetCtrlBackgroundBrush());\n}\n\nstatic LRESULT CALLBACK ProgressBarSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,\n\tUINT_PTR uIdSubclass, DWORD_PTR dwRefData)\n{\n\tProgressBarData* data = (ProgressBarData*)dwRefData;\n\n\tswitch (uMsg) {\n\tcase WM_NCDESTROY:\n\t\tRemoveWindowSubclass(hWnd, ProgressBarSubclass, uIdSubclass);\n\t\tif (data->hTheme != NULL)\n\t\t\tCloseThemeData(data->hTheme);\n\t\tfree(data);\n\t\tbreak;\n\n\tcase WM_ERASEBKGND:\n\t\tif (data->hTheme == NULL)\n\t\t\tdata->hTheme = OpenThemeData(hWnd, VSCLASS_PROGRESS);\n\t\tif (data->hTheme != NULL)\n\t\t\treturn TRUE;\n\t\tbreak;\n\n\tcase WM_PAINT:\n\t\tPAINTSTRUCT ps;\n\t\tHDC hdc;\n\t\tif (data->hTheme == NULL) {\n\t\t\tdata->hTheme = OpenThemeData(hWnd, VSCLASS_PROGRESS);\n\t\t\tif (data->hTheme == NULL)\n\t\t\t\tbreak;\n\t\t}\n\t\thdc = BeginPaint(hWnd, &ps);\n\t\tPaintProgressBar(hWnd, hdc, *data);\n\t\tEndPaint(hWnd, &ps);\n\t\treturn 0;\n\n\tcase WM_THEMECHANGED:\n\t\tif (data->hTheme != NULL)\n\t\t\tCloseThemeData(data->hTheme);\n\t\tbreak;\n\n\tcase PBM_SETSTATE:\n\t\tswitch (wParam) {\n\t\tcase PBST_NORMAL:\n\t\t\tdata->iStateID = PBFS_NORMAL; // Green\n\t\t\tbreak;\n\t\tcase PBST_ERROR:\n\t\t\tdata->iStateID = PBFS_ERROR; // Red\n\t\t\tbreak;\n\t\tcase PBST_PAUSED:\n\t\t\tdata->iStateID = PBFS_PAUSED; // Yellow\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\t}\n\treturn DefSubclassProc(hWnd, uMsg, wParam, lParam);\n}\n\nvoid SubclassProgressBarControl(HWND hWnd)\n{\n\tvoid* data = NULL;\n\n\tif (!is_darkmode_enabled || GetWindowSubclass(hWnd, ProgressBarSubclass, (UINT_PTR)ProgressBarSubclassID, NULL))\n\t\treturn;\n\n\tdata = calloc(1, sizeof(ProgressBarData));\n\tSetWindowSubclass(hWnd, ProgressBarSubclass, (UINT_PTR)ProgressBarSubclassID, (DWORD_PTR)data);\n}\n\n/*\n * Static text section\n */\nstatic LRESULT CALLBACK StaticTextSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,\n\tUINT_PTR uIdSubclass, DWORD_PTR dwRefData)\n{\n\tStaticTextData* data = (StaticTextData*)dwRefData;\n\n\tswitch (uMsg) {\n\tcase WM_NCDESTROY:\n\t\tRemoveWindowSubclass(hWnd, StaticTextSubclass, uIdSubclass);\n\t\tfree(data);\n\t\tbreak;\n\n\tcase WM_ENABLE:\n\t\tRECT rcClient = { 0 };\n\t\tconst LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE);\n\t\tdata->disabled = (wParam == FALSE);\n\t\tif (data->disabled)\n\t\t\tSetWindowLongPtr(hWnd, GWL_STYLE, style & ~WS_DISABLED);\n\t\tGetClientRect(hWnd, &rcClient);\n\t\tMapWindowPoints(hWnd, GetParent(hWnd), (LPPOINT)&rcClient, 2);\n\t\tRedrawWindow(GetParent(hWnd), &rcClient, NULL, RDW_INVALIDATE | RDW_UPDATENOW);\n\t\tif (data->disabled)\n\t\t\tSetWindowLongPtr(hWnd, GWL_STYLE, style | WS_DISABLED);\n\t\treturn 0;\n\t}\n\treturn DefSubclassProc(hWnd, uMsg, wParam, lParam);\n}\n\nstatic void SubclassStaticText(HWND hWnd)\n{\n\tvoid* data = NULL;\n\n\tif (GetWindowSubclass(hWnd, StaticTextSubclass, (UINT_PTR)StaticTextSubclassID, NULL))\n\t\treturn;\n\n\tdata = calloc(1, sizeof(StaticTextData));\n\tSetWindowSubclass(hWnd, StaticTextSubclass, (UINT_PTR)StaticTextSubclassID, (DWORD_PTR)data);\n}\n\n/*\n * Ctl color messages section\n */\nstatic LRESULT OnCtlColorDlg(HDC hdc)\n{\n\tSetTextColor(hdc, DARKMODE_NORMAL_TEXT_COLOR);\n\tSetBkColor(hdc, DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR);\n\treturn (LRESULT)GetDlgBackgroundBrush();\n}\n\nstatic LRESULT OnCtlColorStatic(WPARAM wParam, LPARAM lParam)\n{\n\tHDC hdc = (HDC)wParam;\n\tHWND hWnd = (HWND)lParam;\n\tWCHAR str[32] = { 0 };\n\n\tGetClassName(hWnd, str, ARRAYSIZE(str));\n\tif (_wcsicmp(str, WC_STATIC) == 0) {\n\t\tif ((GetWindowLongPtr(hWnd, GWL_STYLE) & SS_NOTIFY) == SS_NOTIFY) {\n\t\t\tDWORD_PTR dwRefData = 0;\n\t\t\tCOLORREF cText = color_accent;\n\t\t\tif (GetWindowSubclass(hWnd, StaticTextSubclass, (UINT_PTR)StaticTextSubclassID, &dwRefData)) {\n\t\t\t\tif (((StaticTextData*)dwRefData)->disabled)\n\t\t\t\t\tcText = DARKMODE_DISABLED_TEXT_COLOR;\n\t\t\t}\n\t\t\tSetTextColor(hdc, cText);\n\t\t\tSetBkColor(hdc, DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR);\n\t\t\treturn (LRESULT)GetDlgBackgroundBrush();\n\t\t}\n\t}\n\t// Read-only WC_EDIT\n\treturn OnCtlColorDlg(hdc);\n}\n\nstatic LRESULT OnCtlColorCtrl(HDC hdc)\n{\n\tSetTextColor(hdc, DARKMODE_NORMAL_TEXT_COLOR);\n\tSetBkColor(hdc, DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR);\n\treturn (LRESULT)GetCtrlBackgroundBrush();\n}\n\nstatic INT_PTR OnCtlColorListbox(WPARAM wParam, LPARAM lParam)\n{\n\tHDC hdc = (HDC)wParam;\n\tHWND hWnd = (HWND)lParam;\n\tconst LONG_PTR nStyle = GetWindowLongPtr(hWnd, GWL_STYLE);\n\tBOOL isComboBox = (nStyle & LBS_COMBOBOX) == LBS_COMBOBOX;\n\n\tif ((!isComboBox || !is_darkmode_enabled) && IsWindowEnabled(hWnd))\n\t\treturn (INT_PTR)OnCtlColorCtrl(hdc);\n\n\treturn (INT_PTR)OnCtlColorDlg(hdc);\n}\n\nstatic LRESULT CALLBACK WindowCtlColorSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,\n\tUINT_PTR uIdSubclass, DWORD_PTR dwRefData)\n{\n\t(void)dwRefData;\n\n\tswitch (uMsg) {\n\tcase WM_NCDESTROY:\n\t\tRemoveWindowSubclass(hWnd, WindowCtlColorSubclass, uIdSubclass);\n\t\tbreak;\n\tcase WM_CTLCOLOREDIT:\n\t\treturn OnCtlColorCtrl((HDC)wParam);\n\tcase WM_CTLCOLORLISTBOX:\n\t\treturn OnCtlColorListbox(wParam, lParam);\n\tcase WM_CTLCOLORDLG:\n\t\treturn OnCtlColorDlg((HDC)wParam);\n\tcase WM_CTLCOLORSTATIC:\n\t\treturn OnCtlColorStatic(wParam, lParam);\n\tcase WM_PRINTCLIENT:\n\t\treturn TRUE;\n\t}\n\treturn DefSubclassProc(hWnd, uMsg, wParam, lParam);\n}\n\nvoid SubclassCtlColor(HWND hWnd)\n{\n\tif (!GetWindowSubclass(hWnd, WindowCtlColorSubclass, (UINT_PTR)WindowCtlColorSubclassID, NULL))\n\t\tSetWindowSubclass(hWnd, WindowCtlColorSubclass, (UINT_PTR)WindowCtlColorSubclassID, 0);\n}\n\n/*\n * Dark mode for child controls\n */\nstatic BOOL CALLBACK DarkModeForChildCallback(HWND hWnd, LPARAM lParam)\n{\n\t(void)lParam;\n\tWCHAR str[32] = { 0 };\n\tGetClassName(hWnd, str, ARRAYSIZE(str));\n\n\tif (_wcsicmp(str, WC_STATIC) == 0) {\n\t\tif ((GetWindowLongPtr(hWnd, GWL_STYLE) & SS_NOTIFY) == SS_NOTIFY)\n\t\t\tSubclassStaticText(hWnd);\n\t} else if (_wcsicmp(str, WC_BUTTON) == 0) {\n\t\tswitch (GetWindowLongPtr(hWnd, GWL_STYLE) & BS_TYPEMASK) {\n\t\tcase BS_CHECKBOX:\n\t\tcase BS_AUTOCHECKBOX:\n\t\tcase BS_3STATE:\n\t\tcase BS_AUTO3STATE:\n\t\tcase BS_RADIOBUTTON:\n\t\tcase BS_AUTORADIOBUTTON:\n\t\t\tif (IsAtLeastWin11())\n\t\t\t\tSetDarkTheme(hWnd);\n\t\t\tSubclassButtonControl(hWnd);\n\t\t\tbreak;\n\n\t\tcase BS_GROUPBOX:\n\t\t\tSubclassGroupboxControl(hWnd);\n\t\t\tbreak;\n\n\t\tcase BS_PUSHBUTTON:\n\t\tcase BS_DEFPUSHBUTTON:\n\t\tcase BS_SPLITBUTTON:\n\t\tcase BS_DEFSPLITBUTTON:\n\t\t\tSetDarkTheme(hWnd);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t} else if (_wcsicmp(str, WC_COMBOBOX) == 0) {\n\t\tSetWindowTheme(hWnd, L\"DarkMode_CFD\", NULL);\n\t} else if (_wcsicmp(str, TOOLBARCLASSNAME) == 0) {\n\t\tHWND hTips = (HWND)SendMessage(hWnd, TB_GETTOOLTIPS, 0, 0);\n\t\tif (hTips != NULL) {\n\t\t\tSetDarkTheme(hTips);\n\t\t}\n\t} else if (_wcsicmp(str, WC_EDIT) == 0) {\n\t\tconst LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE);\n\t\tconst LONG_PTR ex_style = GetWindowLongPtr(hWnd, GWL_EXSTYLE);\n\t\tif (((style & WS_VSCROLL) == WS_VSCROLL) || ((style & WS_HSCROLL) == WS_HSCROLL)) {\n\t\t\tSetWindowLongPtr(hWnd, GWL_STYLE, style | WS_BORDER);\n\t\t\tSetWindowLongPtr(hWnd, GWL_EXSTYLE, ex_style & ~WS_EX_CLIENTEDGE);\n\t\t\tSetDarkTheme(hWnd);\n\t\t} else {\n\t\t\tSetWindowTheme(hWnd, L\"DarkMode_CFD\", NULL);\n\t\t}\n\t} else if (_wcsicmp(str, RICHEDIT_CLASS) == 0) {\n\t\tconst LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE);\n\t\tconst LONG_PTR ex_style = GetWindowLongPtr(hWnd, GWL_EXSTYLE);\n\t\tconst BOOL has_static_edge = (ex_style & WS_EX_STATICEDGE) == WS_EX_STATICEDGE;\n\t\tCHARFORMATW cf = { 0 };\n\t\tcf.cbSize = sizeof(CHARFORMATW);\n\t\tcf.dwMask = CFM_COLOR;\n\t\tcf.crTextColor = DARKMODE_NORMAL_TEXT_COLOR;\n\t\tSendMessage(hWnd, EM_SETBKGNDCOLOR, 0, (LPARAM)(has_static_edge ?\n\t\t\tDARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR : DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR));\n\t\tSendMessage(hWnd, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf);\n\t\tSetWindowLongPtr(hWnd, GWL_STYLE, style | WS_BORDER);\n\t\tSetWindowLongPtr(hWnd, GWL_EXSTYLE, ex_style & ~WS_EX_STATICEDGE);\n\t\tSetWindowTheme(hWnd, NULL, L\"DarkMode_Explorer::ScrollBar\");\n\t}\n\n\treturn TRUE;\n}\n\nvoid SetDarkModeForChild(HWND hParent)\n{\n\tif (is_darkmode_enabled)\n\t\tEnumChildWindows(hParent, DarkModeForChildCallback, (LPARAM)NULL);\n}\n"
  },
  {
    "path": "src/darkmode.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Dark mode UI implementation\n * Copyright © 2025 ozone10\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#pragma once\n\n#include <windows.h>\n#include <uxtheme.h>\n\nextern BOOL is_darkmode_enabled;\n\ntypedef enum _WindowsBuild {\n\tWIN10_1809 = 17763, // first build to support dark mode\n\tWIN10_1903 = 18362,\n\tWIN10_22H2 = 19045,\n\tWIN11_21H2 = 22000,\n} WindowsBuild;\n\ntypedef enum _SubclassID {\n\tButtonSubclassID = 42,\n\tGroupboxSubclassID,\n\tWindowNotifySubclassID,\n\tStatusBarSubclassID,\n\tProgressBarSubclassID,\n\tStaticTextSubclassID,\n\tWindowCtlColorSubclassID\n} SubclassID;\n\ntypedef enum _PreferredAppMode {\n\tAppModeDefault,\n\tAppModeAllowDark,\n\tAppModeForceDark,\n\tAppModeForceLight,\n} PreferredAppMode;\n\ntypedef enum _WINDOWCOMPOSITIONATTRIB {\n\tWCA_UNDEFINED = 0,\n\tWCA_NCRENDERING_ENABLED = 1,\n\tWCA_NCRENDERING_POLICY = 2,\n\tWCA_TRANSITIONS_FORCEDISABLED = 3,\n\tWCA_ALLOW_NCPAINT = 4,\n\tWCA_CAPTION_BUTTON_BOUNDS = 5,\n\tWCA_NONCLIENT_RTL_LAYOUT = 6,\n\tWCA_FORCE_ICONIC_REPRESENTATION = 7,\n\tWCA_EXTENDED_FRAME_BOUNDS = 8,\n\tWCA_HAS_ICONIC_BITMAP = 9,\n\tWCA_THEME_ATTRIBUTES = 10,\n\tWCA_NCRENDERING_EXILED = 11,\n\tWCA_NCADORNMENTINFO = 12,\n\tWCA_EXCLUDED_FROM_LIVEPREVIEW = 13,\n\tWCA_VIDEO_OVERLAY_ACTIVE = 14,\n\tWCA_FORCE_ACTIVEWINDOW_APPEARANCE = 15,\n\tWCA_DISALLOW_PEEK = 16,\n\tWCA_CLOAK = 17,\n\tWCA_CLOAKED = 18,\n\tWCA_ACCENT_POLICY = 19,\n\tWCA_FREEZE_REPRESENTATION = 20,\n\tWCA_EVER_UNCLOAKED = 21,\n\tWCA_VISUAL_OWNER = 22,\n\tWCA_HOLOGRAPHIC = 23,\n\tWCA_EXCLUDED_FROM_DDA = 24,\n\tWCA_PASSIVEUPDATEMODE = 25,\n\tWCA_USEDARKMODECOLORS = 26,\n\tWCA_LAST = 27\n} WINDOWCOMPOSITIONATTRIB;\n\ntypedef struct _WINDOWCOMPOSITIONATTRIBDATA {\n\tWINDOWCOMPOSITIONATTRIB Attrib;\n\tPVOID pvData;\n\tSIZE_T cbData;\n} WINDOWCOMPOSITIONATTRIBDATA;\n\ntypedef struct {\n\tHBRUSH hbrBackground;\n\tHBRUSH hbrBackgroundControl;\n\tHBRUSH hbrBackgroundHot;\n\tHBRUSH hbrEdge;\n\tHPEN hpnEdge;\n\tHPEN hpnEdgeHot;\n} ThemeResources;\n\ntypedef struct {\n\tHTHEME hTheme;\n\tint iStateID;\n} ButtonData;\n\ntypedef struct {\n\tHFONT hFont;\n} StatusBarData;\n\ntypedef struct {\n\tHTHEME hTheme;\n\tint iStateID;\n} ProgressBarData;\n\ntypedef struct {\n\tBOOL disabled;\n} StaticTextData;\n\ntypedef struct {\n\tint horizontal;\n\tint vertical;\n\tint between;\n} Borders;\n\nBOOL GetDarkModeFromRegistry(void);\nvoid InitDarkMode(HWND hWnd);\nvoid SetDarkTitleBar(HWND hWnd);\nvoid SetDarkTheme(HWND hWnd);\nBOOL InitAccentColor(void);\nBOOL ChangeIconColor(HICON* hIcon, COLORREF newColor);\nvoid DestroyDarkModeGDIObjects(void);\nvoid SubclassCtlColor(HWND hWnd);\nvoid SubclassNotifyCustomDraw(HWND hWnd);\nvoid SubclassStatusBar(HWND hWnd);\nvoid SubclassProgressBarControl(HWND hWnd);\nvoid SetDarkModeForChild(HWND hParent);\n\nstatic __inline void SetDarkModeForDlg(HWND hWnd)\n{\n\tif (is_darkmode_enabled) {\n\t\tSetDarkTitleBar(hWnd);\n\t\tSubclassCtlColor(hWnd);\n\t}\n}\n\nstatic __inline void InitAndSetDarkModeForMainDlg(HWND hWnd)\n{\n\tis_darkmode_enabled = GetDarkModeFromRegistry();\n\tif (is_darkmode_enabled) {\n\t\tInitDarkMode(hWnd);\n\t\tInitAccentColor();\n\t\tSetDarkModeForDlg(hWnd);\n\t\tSubclassNotifyCustomDraw(hWnd);\n\t}\n}\n"
  },
  {
    "path": "src/db.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * DB of the known SHA256 hash values for Rufus downloadable content (GRUB, Syslinux, etc.)\n * as well other data for UEFI revoked content (SBAT, certs).\n * Copyright © 2016-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <stdint.h>\n#pragma once\n\n/*\n * NB: Table data was generated from the https://github.com/pbatard/rufus-web/tree/gh-pages/files/\n * directory using the https://github.com/pbatard/rufus-web/blob/gh-pages/files/gendb.sh script.\n */\nstatic uint8_t sha256db[] = {\n\t0x01, 0x21, 0x98, 0x20, 0xd9, 0x1c, 0x28, 0x7b, 0x35, 0x28, 0x06, 0xf1, 0xb6, 0xa8, 0x0d, 0x4a, 0x8a, 0xf4, 0x5c, 0xf5, 0x04, 0x83, 0xed, 0x6b, 0xe0, 0xc6, 0x0e, 0x7a, 0x66, 0x9c, 0x67, 0x87, // syslinux-6.04/pre2/ldlinux.bss\n\t0x0a, 0xd1, 0x3c, 0x2a, 0xb9, 0xd1, 0xcc, 0x66, 0x73, 0x70, 0xc4, 0x34, 0xf3, 0xe2, 0xa0, 0x54, 0x1c, 0xb8, 0x37, 0xdb, 0x72, 0x3e, 0x19, 0xae, 0x81, 0xc8, 0xee, 0x0b, 0xbe, 0x10, 0xdc, 0xe0, // grub-2.06@e67a551a-nonstandard/core.img\n\t0x11, 0x0c, 0x50, 0x1b, 0xfa, 0x9e, 0x72, 0xa8, 0x8c, 0xdb, 0xb8, 0xba, 0x11, 0xe1, 0xf0, 0x76, 0x1a, 0xec, 0x28, 0xbf, 0x04, 0x44, 0x67, 0xff, 0x38, 0x2c, 0x06, 0x95, 0xd5, 0x1f, 0x8a, 0x83, // grub-2.04-nonstandard/core.img\n\t0x12, 0xbd, 0x22, 0xd2, 0xb3, 0x69, 0x56, 0x0f, 0x89, 0xb8, 0x50, 0x7e, 0x7e, 0x74, 0xeb, 0xc5, 0xea, 0x44, 0x91, 0x48, 0x75, 0xf0, 0xa4, 0xcb, 0x1e, 0xa6, 0xfb, 0x4e, 0xc9, 0x89, 0x58, 0x17, // syslinux-6.03/pre6/ldlinux.sys\n\t0x15, 0x5f, 0x36, 0x7b, 0xb1, 0x30, 0xfe, 0x05, 0x5c, 0x79, 0x9f, 0x88, 0xb3, 0xc0, 0xc1, 0xa0, 0x0a, 0x18, 0x05, 0x78, 0x22, 0x69, 0xcf, 0x7e, 0x54, 0xaa, 0x61, 0xbd, 0xe3, 0x8e, 0x05, 0x92, // syslinux-6.03/pre3/ldlinux.bss\n\t0x15, 0x90, 0x28, 0x95, 0x48, 0x7c, 0x08, 0x4c, 0x8f, 0x57, 0x46, 0x66, 0xc3, 0x1e, 0x7f, 0xa3, 0x99, 0xd0, 0x5b, 0x83, 0x1f, 0xd6, 0x1c, 0x1e, 0x3c, 0x3e, 0xee, 0x69, 0xd6, 0x57, 0x69, 0x24, // grub-2.12/core.img\n\t0x19, 0xba, 0x57, 0x32, 0x9b, 0xe7, 0x45, 0xce, 0xae, 0x46, 0x35, 0x4c, 0x5d, 0x41, 0x1b, 0x7d, 0x8e, 0xfe, 0xc6, 0x80, 0x2c, 0xfd, 0x7f, 0x6f, 0xee, 0x98, 0x6d, 0xf4, 0xb7, 0x63, 0xf6, 0xfe, // grub4dos-0.4.6a/grldr\n\t0x1c, 0xb7, 0x8b, 0x98, 0xbc, 0xd6, 0x76, 0x7b, 0x01, 0x44, 0xf5, 0x00, 0xaf, 0x81, 0xef, 0x4f, 0x3c, 0x54, 0xea, 0xaf, 0xe3, 0xc9, 0x4e, 0x1f, 0xd6, 0x24, 0x68, 0x41, 0x4e, 0x98, 0x92, 0x25, // syslinux-6.03/pre20/ldlinux.bss\n\t0x1c, 0xc6, 0x32, 0x21, 0xfd, 0xf4, 0x46, 0xfc, 0xda, 0xc6, 0xc0, 0x56, 0x35, 0x79, 0x54, 0xc1, 0x5b, 0x61, 0x75, 0xca, 0x1b, 0xc2, 0xa4, 0x9f, 0x85, 0x52, 0xec, 0xca, 0x28, 0xac, 0x3e, 0x51, // syslinux-6.02/ldlinux.bss\n\t0x22, 0x96, 0x82, 0xac, 0x61, 0xb8, 0x8b, 0x11, 0x25, 0xfc, 0xd7, 0xe6, 0x9f, 0x4e, 0x7f, 0x46, 0x7f, 0x68, 0xc5, 0x14, 0x9e, 0xb9, 0x37, 0x1a, 0x98, 0xd8, 0xf2, 0x78, 0x41, 0x40, 0xad, 0x88, // syslinux-5.00/ldlinux.sys\n\t0x25, 0xd1, 0x38, 0xf3, 0x8b, 0x17, 0x35, 0x79, 0x3e, 0xee, 0x89, 0x19, 0xa3, 0xa0, 0xe5, 0xc9, 0x97, 0x9d, 0x2f, 0xac, 0xc0, 0xb5, 0x70, 0x74, 0x24, 0xe8, 0x04, 0x98, 0x1d, 0x25, 0xf9, 0xc9, // syslinux-6.03/pre10/ldlinux.sys\n\t0x28, 0xf8, 0x1d, 0xd8, 0x72, 0x0e, 0x6e, 0xfd, 0xc5, 0x30, 0x44, 0xf6, 0xf9, 0xa6, 0xc2, 0x8b, 0x6b, 0x89, 0x54, 0x23, 0xfb, 0x4c, 0xbc, 0x2d, 0xa2, 0xfb, 0xd6, 0x29, 0x70, 0xd6, 0xd1, 0xd6, // grub-2.06-nonstandard/core.img\n\t0x29, 0xcd, 0xfc, 0x24, 0x0d, 0x08, 0xe4, 0xd6, 0x42, 0x0d, 0x1f, 0x05, 0x7a, 0x0e, 0xb0, 0xb1, 0x07, 0x88, 0x91, 0x65, 0xa8, 0xeb, 0x16, 0x3c, 0x31, 0x72, 0xaa, 0xfc, 0xee, 0x02, 0xac, 0xdd, // grub-2.06~rc1/core.img\n\t0x2b, 0x07, 0x20, 0x67, 0xf9, 0xcd, 0x6e, 0x8c, 0x62, 0xe7, 0x82, 0xdc, 0x4a, 0xe2, 0x3b, 0x19, 0x2d, 0xe6, 0x28, 0xe7, 0x67, 0x0c, 0x84, 0x68, 0xed, 0x38, 0x0d, 0x36, 0x4a, 0xa7, 0x0b, 0xf1, // grub-2.06/core.img\n\t0x2b, 0x31, 0x7b, 0x12, 0xab, 0xff, 0x49, 0x66, 0x48, 0x78, 0xdf, 0xe0, 0xb5, 0x00, 0xb8, 0x50, 0x0f, 0x93, 0xf1, 0xd5, 0xe4, 0xd5, 0x28, 0x45, 0x95, 0xcc, 0x2c, 0x15, 0x6c, 0x74, 0x4f, 0x79, // grub-2.02~beta3/core.img\n\t0x2d, 0x99, 0x55, 0x09, 0xd0, 0xd6, 0xcd, 0xf7, 0x6e, 0xd5, 0x9f, 0x46, 0x53, 0xf1, 0xcb, 0xe1, 0xc9, 0xe6, 0x24, 0xe1, 0xaf, 0xa8, 0xf7, 0x8e, 0xc2, 0x45, 0x5b, 0x24, 0x53, 0x4b, 0x87, 0x76, // syslinux-6.03/pre13/ldlinux.bss\n\t0x2e, 0x3e, 0xf6, 0x65, 0x1e, 0x59, 0x85, 0x20, 0x26, 0xc5, 0x74, 0xde, 0x52, 0x65, 0xf6, 0x8e, 0x24, 0xf8, 0xe6, 0x27, 0xc5, 0x53, 0xce, 0x8d, 0x32, 0x7c, 0xa7, 0xe0, 0xb4, 0x96, 0x70, 0xa1, // grub4dos-0.4.5c/grldr\n\t0x31, 0x17, 0x97, 0x0e, 0x89, 0xe2, 0xab, 0xd6, 0x7e, 0x29, 0x26, 0x63, 0xf3, 0xe2, 0xcf, 0xa7, 0xc3, 0xfe, 0xe8, 0x7a, 0x87, 0x0a, 0xb9, 0x20, 0xc8, 0xa1, 0x74, 0xff, 0x5d, 0xfb, 0xfe, 0x8e, // syslinux-6.03/pre20/ldlinux.sys\n\t0x33, 0x02, 0x03, 0xb6, 0x29, 0x5e, 0x7c, 0x60, 0x72, 0x5f, 0x07, 0xc0, 0x92, 0x15, 0xd1, 0x75, 0xaa, 0x09, 0x23, 0xee, 0xd5, 0x5a, 0xec, 0xb5, 0x72, 0x77, 0x76, 0x4d, 0x6b, 0xdc, 0xf1, 0x31, // syslinux-6.03/pre19/ldlinux.sys\n\t0x34, 0x08, 0x54, 0xee, 0x4f, 0x7f, 0x10, 0xaa, 0x63, 0x38, 0xba, 0xeb, 0xa4, 0xdd, 0xd1, 0xca, 0x9c, 0xbd, 0x15, 0x6f, 0x04, 0x86, 0x69, 0x66, 0x6c, 0x92, 0xe4, 0x85, 0x47, 0x6e, 0xe9, 0x41, // syslinux-6.03/pre4/ldlinux.sys\n\t0x34, 0x1b, 0x76, 0x83, 0x3c, 0xc6, 0x1c, 0x1c, 0xd0, 0xde, 0x84, 0x2c, 0xcb, 0xfe, 0x38, 0x4f, 0x0b, 0x21, 0xb1, 0x10, 0x0e, 0xaa, 0x74, 0xf9, 0x5f, 0x07, 0x21, 0x72, 0x4f, 0x00, 0x6f, 0x74, // syslinux-6.03/pre4/ldlinux.bss\n\t0x37, 0x9f, 0x06, 0xfe, 0xee, 0x22, 0xf0, 0xd5, 0x8f, 0xf9, 0x9b, 0xb3, 0x47, 0xf9, 0x9e, 0x0a, 0x1a, 0x23, 0xaf, 0x03, 0x1e, 0x35, 0x13, 0x02, 0xd2, 0xf7, 0x63, 0x55, 0xc9, 0xc7, 0x90, 0xb2, // syslinux-5.11/ldlinux.c32\n\t0x38, 0x48, 0x38, 0xcf, 0x85, 0x08, 0x18, 0x04, 0x0a, 0xf2, 0xb3, 0xd8, 0x71, 0x38, 0xb4, 0x49, 0x12, 0xb0, 0x0d, 0x4f, 0x17, 0xb1, 0xba, 0x41, 0xbd, 0x06, 0x1a, 0xf4, 0x6d, 0x56, 0x61, 0x62, // syslinux-6.01/ldlinux.c32\n\t0x39, 0xde, 0x1f, 0x87, 0x08, 0xef, 0xd8, 0x88, 0x56, 0x91, 0x68, 0x5e, 0xfc, 0x59, 0x45, 0x48, 0xdf, 0x29, 0xfb, 0x20, 0x0b, 0xc1, 0x56, 0x7f, 0x1b, 0xd7, 0xcf, 0xce, 0x6f, 0x95, 0x55, 0xe0, // syslinux-6.03/pre7/ldlinux.sys\n\t0x3c, 0x39, 0x1b, 0x51, 0x04, 0xec, 0xdb, 0x65, 0x33, 0x01, 0xd2, 0xe2, 0x20, 0x0a, 0x6d, 0xab, 0xc0, 0xdb, 0x59, 0xd8, 0x80, 0x7b, 0xe9, 0x47, 0x99, 0x51, 0xbe, 0x18, 0x61, 0x53, 0x20, 0xad, // syslinux-6.03/pre11/ldlinux.sys\n\t0x3d, 0x3c, 0xba, 0x34, 0x12, 0xe1, 0xba, 0xf6, 0x01, 0xaf, 0xbb, 0x6d, 0xf0, 0x09, 0x75, 0xa0, 0x8c, 0xc0, 0xad, 0x7c, 0x62, 0xfd, 0x50, 0x15, 0x87, 0x08, 0xeb, 0x4c, 0x8c, 0x3d, 0x95, 0x55, // syslinux-5.02/ldlinux.bss\n\t0x3d, 0x6b, 0x9d, 0xb7, 0x62, 0xa9, 0x19, 0x01, 0x00, 0xea, 0xbf, 0x3e, 0x13, 0x43, 0xb7, 0xa4, 0x09, 0xc6, 0x77, 0xea, 0x21, 0x04, 0x6f, 0xe0, 0xff, 0xbe, 0x7f, 0xe7, 0xb0, 0xdc, 0xb8, 0x95, // syslinux-6.04/pre2/ldlinux.sys\n\t0x3f, 0x12, 0x06, 0xe0, 0xcc, 0x45, 0xdb, 0xe1, 0x80, 0xe7, 0x3a, 0xda, 0xeb, 0x22, 0x1b, 0xfc, 0x7d, 0x5a, 0x80, 0x00, 0x95, 0x73, 0x85, 0x49, 0x39, 0x03, 0x79, 0xd7, 0xd0, 0x28, 0x2a, 0xc3, // syslinux-6.03/ldlinux.sys\n\t0x40, 0xe7, 0x8e, 0x0b, 0x92, 0xb9, 0x80, 0x60, 0xbf, 0x28, 0x9b, 0xa6, 0xab, 0x68, 0x22, 0x5b, 0x61, 0xe2, 0x5e, 0x08, 0x9e, 0xd5, 0xa6, 0x16, 0x94, 0xc5, 0x19, 0x17, 0x92, 0x5f, 0x3e, 0x8d, // syslinux-6.03/pre7/ldlinux.bss\n\t0x40, 0xe7, 0x99, 0x43, 0xac, 0x71, 0xde, 0xf1, 0xc0, 0x35, 0x5a, 0xec, 0x71, 0xb4, 0xf7, 0x8d, 0xcf, 0x19, 0x20, 0x4a, 0x97, 0xe9, 0x7e, 0x0f, 0x34, 0x17, 0x50, 0x65, 0x32, 0xc9, 0x02, 0x76, // syslinux-6.03/pre16/ldlinux.bss\n\t0x42, 0x23, 0x03, 0x86, 0x6d, 0xa1, 0xf2, 0xaf, 0x28, 0x25, 0x92, 0x29, 0x17, 0x21, 0xc7, 0x61, 0x23, 0xcf, 0xe9, 0x84, 0x05, 0xb7, 0x60, 0x2a, 0xc7, 0xe3, 0xe9, 0x5b, 0xf3, 0xcb, 0xd4, 0xba, // syslinux-6.00/ldlinux.c32\n\t0x46, 0x48, 0xe8, 0x13, 0xd7, 0x54, 0x20, 0x39, 0x4e, 0xe6, 0x35, 0xd2, 0xa4, 0x78, 0x44, 0xeb, 0xdc, 0xc9, 0x98, 0xd3, 0x45, 0x8f, 0x95, 0xf9, 0x50, 0x80, 0x50, 0x9b, 0x88, 0x80, 0x44, 0x4a, // syslinux-6.03/pre17/ldlinux.sys\n\t0x47, 0x0c, 0x04, 0x6d, 0xe8, 0x53, 0x5d, 0x46, 0x0e, 0x05, 0x63, 0x99, 0xa8, 0x89, 0x28, 0x0b, 0x25, 0x55, 0xf2, 0xb7, 0xbf, 0x89, 0x84, 0x9a, 0x7f, 0x27, 0xa4, 0x32, 0x72, 0xb5, 0x3f, 0x12, // syslinux-6.01/ldlinux.sys\n\t0x4d, 0xee, 0xc3, 0x47, 0xb0, 0xa3, 0x18, 0x46, 0x09, 0x42, 0xb2, 0xeb, 0x3e, 0xd1, 0x75, 0xcf, 0x3f, 0x8c, 0x3e, 0x8c, 0xe4, 0x3b, 0x14, 0xfc, 0x8e, 0x8f, 0x8c, 0x51, 0xcb, 0xa5, 0x5a, 0xdb, // syslinux-5.02/ldlinux.c32\n\t0x4e, 0xfb, 0x8f, 0xde, 0xb9, 0xe1, 0xe2, 0xa2, 0xc3, 0xf0, 0x11, 0xca, 0x77, 0x3b, 0x95, 0xf4, 0xb9, 0x7f, 0xbc, 0x7f, 0x3d, 0x40, 0x4d, 0x7c, 0x60, 0xf3, 0x4a, 0x61, 0x43, 0x44, 0x7e, 0x7f, // syslinux-5.01/ldlinux.c32\n\t0x50, 0xca, 0xe9, 0x94, 0x79, 0x68, 0xdf, 0xa6, 0xd7, 0x11, 0xcd, 0xb0, 0x7d, 0x84, 0xf2, 0x56, 0x78, 0xd6, 0x69, 0xbf, 0xb0, 0x29, 0xaa, 0x56, 0xa1, 0x04, 0x55, 0xb0, 0xcd, 0x06, 0xca, 0xd2, // syslinux-6.03/pre3/ldlinux.sys\n\t0x52, 0x0b, 0x46, 0x87, 0x46, 0x22, 0xb5, 0xa6, 0x57, 0x83, 0xdb, 0x7c, 0x12, 0x42, 0x53, 0x2d, 0x13, 0x7f, 0x95, 0xfe, 0xbf, 0x4d, 0xf9, 0xc2, 0x7e, 0x67, 0x94, 0x3a, 0x21, 0x27, 0xf6, 0x08, // syslinux-5.01/ldlinux.sys\n\t0x52, 0x80, 0x86, 0xed, 0x16, 0xf4, 0x93, 0xb9, 0x04, 0xf0, 0x75, 0xd1, 0xe9, 0xd8, 0xcb, 0x8a, 0x2e, 0xdc, 0xb4, 0x37, 0x40, 0x30, 0x51, 0xd8, 0x79, 0x40, 0x08, 0x9a, 0x16, 0xed, 0x4d, 0x33, // grub-2.06@e67a551a/core.img\n\t0x54, 0x4b, 0x3e, 0x86, 0xfc, 0xa2, 0x7a, 0x12, 0xf4, 0x81, 0xfd, 0x32, 0x53, 0x57, 0x1c, 0xc5, 0xe6, 0x1a, 0x19, 0xed, 0x9a, 0x43, 0xbc, 0x12, 0xa8, 0x07, 0x6d, 0x90, 0x8f, 0x98, 0x39, 0x6f, // syslinux-6.03/pre2/ldlinux.sys\n\t0x55, 0xb9, 0x27, 0xd2, 0x17, 0xe8, 0x83, 0xd9, 0xe1, 0x58, 0xc9, 0x51, 0x80, 0xb1, 0xba, 0x79, 0x97, 0x3a, 0xd3, 0xd9, 0x44, 0xc2, 0xc6, 0xa1, 0xed, 0x49, 0x5c, 0xd3, 0xef, 0xc3, 0x54, 0x1c, // syslinux-5.11/ldlinux.bss\n\t0x56, 0x7a, 0x32, 0x6a, 0x20, 0x9a, 0xe8, 0x69, 0x9a, 0x7d, 0xb5, 0xc0, 0xa4, 0x34, 0x52, 0x71, 0x05, 0x1e, 0x0a, 0x84, 0x03, 0xae, 0x21, 0x13, 0xd9, 0xd0, 0x12, 0xc4, 0x8d, 0x99, 0xa4, 0x13, // syslinux-6.03/pre12/ldlinux.sys\n\t0x57, 0x45, 0x0a, 0xf8, 0xa4, 0xe0, 0x06, 0x71, 0x11, 0x46, 0xaa, 0x53, 0x1f, 0xe5, 0x59, 0x8f, 0x9e, 0x92, 0xe7, 0x3d, 0x6c, 0xea, 0x93, 0x06, 0x02, 0x13, 0xa3, 0x08, 0xce, 0x76, 0x11, 0x29, // syslinux-6.03/pre19/ldlinux.bss\n\t0x5b, 0xf5, 0xb8, 0x10, 0xa4, 0x4a, 0x27, 0xd8, 0x72, 0xae, 0x50, 0x68, 0xa4, 0xc0, 0x06, 0x93, 0xcb, 0xa2, 0x41, 0xd7, 0x96, 0x51, 0x07, 0xfb, 0x20, 0xd0, 0x18, 0x17, 0x92, 0x36, 0x16, 0x81, // syslinux-6.03/pre1/ldlinux.sys\n\t0x5c, 0x42, 0x3b, 0xc0, 0xc6, 0xb9, 0xc4, 0x12, 0x0f, 0x33, 0x7c, 0x5a, 0xf9, 0x3d, 0xcf, 0xc2, 0xfa, 0x2b, 0xc0, 0xe3, 0x8f, 0xd9, 0x4e, 0x8a, 0x6b, 0x0a, 0x1f, 0x16, 0x1a, 0x88, 0x29, 0x92, // grub-2.03/core.img\n\t0x5c, 0xef, 0x9a, 0xd0, 0xd0, 0xca, 0x04, 0x09, 0x72, 0x62, 0x24, 0x16, 0x86, 0xc6, 0xc3, 0xa7, 0x30, 0x6a, 0xb9, 0xb9, 0xcd, 0xf2, 0x4b, 0x9d, 0x4e, 0xe3, 0xb1, 0x6a, 0xf0, 0x1a, 0x5a, 0xf2, // syslinux-6.03/ldlinux.c32\n\t0x5e, 0xd2, 0x81, 0xa6, 0x95, 0xbe, 0x85, 0x95, 0x64, 0x02, 0xb2, 0x30, 0x51, 0x2c, 0x49, 0x96, 0x4a, 0x46, 0x24, 0xc9, 0xd7, 0x55, 0xcd, 0x1c, 0xda, 0xa7, 0x37, 0x6c, 0x2f, 0x7f, 0x41, 0xb9, // syslinux-6.03/pre16/ldlinux.sys\n\t0x67, 0x64, 0x0d, 0x11, 0xfe, 0x80, 0x78, 0x17, 0x57, 0x0e, 0xf1, 0x6d, 0xeb, 0xe8, 0x21, 0xb5, 0xd3, 0x93, 0x51, 0x78, 0x3a, 0x5f, 0xa7, 0x61, 0x7b, 0xa2, 0x55, 0x30, 0xec, 0x4d, 0xd8, 0x77, // syslinux-6.03/pre6/ldlinux.bss\n\t0x68, 0x40, 0xb3, 0xda, 0xf8, 0x6d, 0xba, 0x9f, 0x8e, 0x64, 0x22, 0xdb, 0x59, 0x54, 0x67, 0x64, 0xe3, 0xb1, 0x44, 0x61, 0x9a, 0x70, 0xb5, 0xac, 0x27, 0x88, 0x50, 0x5e, 0xdb, 0xc6, 0x17, 0x6c, // grub-2.02~beta2/core.img\n\t0x6a, 0xbc, 0xdc, 0x80, 0x3a, 0x30, 0x85, 0xea, 0x5f, 0x9d, 0xa1, 0xb4, 0x3e, 0xdb, 0x2e, 0xad, 0xa2, 0x75, 0x36, 0x0d, 0xb8, 0x11, 0xc9, 0xac, 0xf5, 0x9a, 0x55, 0x5f, 0x67, 0x7b, 0x2d, 0x8b, // syslinux-6.03/pre12/ldlinux.bss\n\t0x73, 0xb6, 0x27, 0x67, 0xa1, 0x62, 0x00, 0xb9, 0xaf, 0x19, 0x3a, 0x7d, 0x5c, 0x94, 0xe9, 0xc2, 0x94, 0xc6, 0xdb, 0xb6, 0xd5, 0xb1, 0x7c, 0x15, 0x03, 0x8c, 0x9f, 0x31, 0x73, 0xc9, 0xa7, 0xbc, // syslinux-6.04/ldlinux.sys\n\t0x75, 0x6f, 0x89, 0x25, 0x23, 0xc6, 0x8d, 0x27, 0x32, 0x28, 0x8b, 0x5a, 0xd4, 0x2d, 0x7d, 0xc7, 0x4e, 0xa7, 0xa7, 0x08, 0x9b, 0x04, 0x2b, 0x12, 0x5f, 0x5d, 0x74, 0x7f, 0xf3, 0x20, 0xa0, 0x77, // syslinux-4.07/vesamenu.c32\n\t0x76, 0xd1, 0x2b, 0x17, 0xfd, 0x05, 0xd3, 0x10, 0xb0, 0x5d, 0x00, 0xa8, 0x38, 0x77, 0x06, 0xc5, 0xce, 0x35, 0xd4, 0xb0, 0x50, 0xf2, 0x23, 0x9d, 0x15, 0xd3, 0xc9, 0xac, 0x92, 0xc5, 0xdd, 0xbc, // grub-2.06-nonstandard-gdie/core.img\n\t0x77, 0x9a, 0x5e, 0xbd, 0x69, 0xd3, 0x28, 0x5e, 0xb9, 0xed, 0x4a, 0xc7, 0xc0, 0x4d, 0x2d, 0x15, 0xcb, 0xa1, 0x8a, 0x1f, 0x97, 0xc7, 0xc4, 0xbe, 0x62, 0x48, 0x93, 0xa9, 0xe1, 0xb0, 0x89, 0x2e, // syslinux-6.03/pre9/ldlinux.sys\n\t0x78, 0x64, 0x8e, 0xf0, 0xc5, 0x00, 0x41, 0x75, 0xb9, 0xa8, 0xea, 0x33, 0x30, 0x14, 0xea, 0x02, 0xc9, 0x17, 0xf8, 0x23, 0xe7, 0x7a, 0x3e, 0xc9, 0xac, 0xd9, 0xd2, 0x2b, 0x46, 0x02, 0xf3, 0x6d, // syslinux-6.03/pre13/ldlinux.sys\n\t0x7d, 0xa9, 0xc5, 0x21, 0x76, 0xb8, 0xaf, 0x01, 0x64, 0xea, 0x39, 0x21, 0x22, 0x44, 0xb1, 0x0a, 0xa0, 0xc7, 0x97, 0xe7, 0x65, 0xbb, 0x6b, 0x92, 0x69, 0xb5, 0x8b, 0xc9, 0xe5, 0x0a, 0x9f, 0x18, // syslinux-5.01/ldlinux.bss\n\t0x82, 0x11, 0xfa, 0xe8, 0xaf, 0xf0, 0x23, 0x3f, 0x05, 0xa8, 0xb7, 0x8c, 0x58, 0x15, 0x25, 0xe2, 0x81, 0xac, 0x98, 0x23, 0x54, 0xa8, 0xc4, 0x3b, 0xb4, 0x96, 0x5e, 0x61, 0xdc, 0x98, 0xb4, 0x62, // syslinux-6.03/pre8/ldlinux.bss\n\t0x83, 0x57, 0xaa, 0xd3, 0x6a, 0xec, 0x68, 0x21, 0xcb, 0xf2, 0x17, 0x4d, 0xb5, 0xd2, 0x09, 0xef, 0x2c, 0xd2, 0x62, 0x88, 0x12, 0x39, 0xeb, 0xc3, 0xf4, 0xc1, 0xcf, 0x55, 0xab, 0x10, 0xee, 0x55, // grub-2.12~rc1/core.img\n\t0x83, 0x9b, 0xd0, 0x8a, 0xcb, 0x68, 0x47, 0xd6, 0x55, 0x07, 0xf1, 0x4e, 0x7a, 0x55, 0x6e, 0x91, 0xe6, 0x12, 0x9c, 0x47, 0x86, 0x3f, 0x7d, 0x61, 0xe2, 0xce, 0x6d, 0xb7, 0x8d, 0xf3, 0xd2, 0x3f, // syslinux-6.03/pre9/ldlinux.bss\n\t0x87, 0xaa, 0x91, 0xf8, 0x7f, 0xba, 0x5f, 0x31, 0x79, 0x43, 0x08, 0xda, 0xa4, 0xa4, 0x8d, 0xad, 0x6c, 0xf6, 0xfa, 0x34, 0x26, 0x4d, 0x66, 0xb8, 0x84, 0xb8, 0xb9, 0xdc, 0x96, 0x42, 0xed, 0x86, // syslinux-5.02/ldlinux.sys\n\t0x88, 0x14, 0xe5, 0x76, 0xab, 0xc1, 0xaa, 0x44, 0xdd, 0xe9, 0x43, 0xb0, 0xca, 0xae, 0xe8, 0x33, 0xa5, 0x81, 0x01, 0x42, 0x61, 0x4a, 0xde, 0xeb, 0x4c, 0xc7, 0x25, 0xe7, 0x8a, 0x50, 0x45, 0xb7, // syslinux-6.03/ldlinux.bss\n\t0x8b, 0x93, 0x7e, 0x5e, 0x8b, 0xae, 0x5a, 0xf8, 0xc8, 0x95, 0x63, 0xc0, 0x0e, 0x9c, 0xaf, 0xc6, 0xcd, 0x7c, 0x2c, 0x80, 0x8a, 0xda, 0x7b, 0xf4, 0xad, 0x51, 0x08, 0xda, 0x3e, 0x51, 0xcd, 0x70, // grub-2.00-22/core.img\n\t0x8e, 0xc8, 0x42, 0x06, 0x94, 0x4c, 0xd4, 0x3d, 0xf6, 0xba, 0x83, 0x63, 0xc0, 0x81, 0xe4, 0xa0, 0x82, 0x9e, 0x71, 0x9a, 0xbf, 0x5a, 0x46, 0x6d, 0x7c, 0x81, 0x0c, 0x2f, 0x5b, 0x6d, 0x13, 0x75, // syslinux-6.03/pre5/ldlinux.sys\n\t0x95, 0x8d, 0x10, 0xbb, 0x87, 0x28, 0xcc, 0x1f, 0xf1, 0x6a, 0x12, 0xee, 0x6a, 0x60, 0x62, 0x40, 0xa6, 0xb7, 0x4d, 0xab, 0xa0, 0x2b, 0x8c, 0xb8, 0xed, 0x2a, 0xe8, 0x1c, 0x2f, 0xb2, 0x5b, 0x97, // syslinux-6.00/ldlinux.bss\n\t0x9a, 0x0b, 0xc4, 0x1b, 0xd7, 0x95, 0xed, 0xb0, 0x83, 0x0f, 0x1c, 0xc4, 0x82, 0x4b, 0xfa, 0x9d, 0xe0, 0x9d, 0x68, 0x63, 0x92, 0x09, 0x4f, 0x5a, 0xe7, 0xfb, 0xac, 0xfb, 0xb0, 0x17, 0x9d, 0xa6, // syslinux-6.03/pre1/ldlinux.bss\n\t0x9a, 0x2c, 0x94, 0x67, 0x04, 0x01, 0x7f, 0xa8, 0xdc, 0x4e, 0x03, 0xa8, 0xa5, 0x8d, 0x75, 0x4d, 0x2d, 0x16, 0x07, 0xc2, 0xd2, 0xcd, 0x74, 0xf0, 0xe2, 0x92, 0x01, 0x33, 0xf1, 0x19, 0x28, 0x09, // grub-2.14/core.img\n\t0x9b, 0xcc, 0x65, 0x92, 0xa7, 0xba, 0x7e, 0x73, 0x38, 0xf4, 0xbb, 0xba, 0x27, 0xc6, 0x30, 0x16, 0xb9, 0x5e, 0xcb, 0x1e, 0xc6, 0x8c, 0x0b, 0xe9, 0xb6, 0x99, 0xb2, 0xea, 0x69, 0xcb, 0xab, 0xb2, // syslinux-5.00/ldlinux.c32\n\t0xa2, 0xa8, 0x76, 0x93, 0x71, 0xeb, 0x57, 0xc5, 0xe7, 0x9b, 0x3c, 0xea, 0x4a, 0x91, 0x12, 0x75, 0xaf, 0x47, 0x43, 0xf1, 0x0f, 0x42, 0x0e, 0xd6, 0xd2, 0x6e, 0x4e, 0xec, 0x5c, 0x86, 0x50, 0x59, // grub4dos-0.4.6a/grldr.mbr\n\t0xa6, 0x82, 0x43, 0xa0, 0xf2, 0xe5, 0x90, 0xb8, 0x14, 0x02, 0xd6, 0xfa, 0x62, 0xd4, 0xfd, 0x30, 0x94, 0x8c, 0x00, 0x3d, 0xa1, 0x2b, 0xfe, 0xeb, 0x69, 0xba, 0x20, 0x34, 0x17, 0x27, 0x09, 0x4c, // syslinux-6.03/pre14/ldlinux.sys\n\t0xa9, 0x4a, 0x99, 0xe6, 0xde, 0x68, 0x81, 0x44, 0x49, 0x2b, 0x38, 0xdb, 0xee, 0x09, 0xde, 0x07, 0x30, 0xe3, 0x2e, 0x1c, 0xfd, 0x0a, 0xb2, 0x54, 0x99, 0x22, 0xff, 0xa8, 0x04, 0x01, 0xad, 0x49, // syslinux-6.03/pre2/ldlinux.bss\n\t0xa9, 0x95, 0x68, 0x57, 0x9c, 0xd2, 0x51, 0xaf, 0xf1, 0x34, 0xfc, 0xaa, 0xa8, 0x09, 0x91, 0x60, 0x5e, 0x8f, 0xb1, 0x19, 0x74, 0x51, 0xf7, 0x51, 0xaa, 0x4d, 0x6c, 0x84, 0xbf, 0x65, 0xf4, 0xe3, // syslinux-6.03/pre15/ldlinux.sys\n\t0xaa, 0x18, 0x1a, 0x4e, 0xb2, 0xab, 0xb0, 0xfb, 0xbc, 0x17, 0xc4, 0xc8, 0x5a, 0x17, 0xa0, 0x0b, 0x15, 0x52, 0x4d, 0x7f, 0x2b, 0x0b, 0xea, 0xd4, 0xf8, 0x74, 0x2e, 0x70, 0xa3, 0x3a, 0xfa, 0xf8, // grub-2.04/core.img\n\t0xad, 0x18, 0x82, 0x0e, 0xcd, 0xe8, 0x74, 0xc7, 0x19, 0x10, 0xbd, 0x24, 0xf3, 0x03, 0x55, 0x17, 0x61, 0x03, 0xd0, 0x21, 0x78, 0x9c, 0xc0, 0x0b, 0xd4, 0x13, 0xd8, 0x0f, 0x5b, 0x02, 0x59, 0xf4, // grub-2.06@e67a551a-nonstandard-gdie/core.img\n\t0xb1, 0x97, 0x91, 0x33, 0xa4, 0x5e, 0x29, 0x4f, 0x54, 0xee, 0xd0, 0xbd, 0x92, 0xb7, 0xf2, 0xb9, 0xa3, 0xd2, 0x26, 0x45, 0xae, 0x28, 0x20, 0x0e, 0x4a, 0xd8, 0xfd, 0x98, 0xaf, 0x24, 0x1a, 0x07, // grub-2.05/core.img\n\t0xb2, 0xf0, 0xde, 0x2e, 0x01, 0xa7, 0xe3, 0x4d, 0x96, 0xa9, 0x76, 0x36, 0x43, 0x05, 0xd3, 0x9f, 0xf8, 0x49, 0xd5, 0x0a, 0xd1, 0x3a, 0xd1, 0xf8, 0xa8, 0xb4, 0x41, 0x1d, 0x1d, 0x53, 0x4e, 0x88, // syslinux-5.10/ldlinux.bss\n\t0xb3, 0xa8, 0xf2, 0x12, 0x89, 0x1c, 0xd2, 0x6e, 0x1a, 0xb4, 0x4a, 0xa8, 0x59, 0x8f, 0x6e, 0x64, 0xc6, 0x83, 0x19, 0x8d, 0x43, 0x00, 0x27, 0x54, 0xec, 0xbd, 0x8a, 0x78, 0xf2, 0xd0, 0xc0, 0x0b, // syslinux-6.03/pre8/ldlinux.sys\n\t0xb3, 0xdc, 0x31, 0x79, 0xf6, 0x2b, 0x20, 0x51, 0xc9, 0x43, 0xe5, 0x2e, 0xeb, 0xf2, 0x29, 0x8a, 0xa4, 0x7e, 0x7c, 0x0a, 0x97, 0x78, 0xe8, 0x62, 0x77, 0xa7, 0x48, 0x2a, 0x27, 0x0a, 0x7a, 0x8e, // syslinux-6.01/ldlinux.bss\n\t0xb4, 0x6a, 0xf2, 0x09, 0x19, 0xe9, 0xf2, 0x1f, 0xa1, 0x52, 0x37, 0x5d, 0xda, 0xc4, 0x58, 0x87, 0x08, 0xc1, 0x22, 0xb3, 0x65, 0x7f, 0x09, 0x01, 0x31, 0x4e, 0x83, 0x45, 0x49, 0xa9, 0x6c, 0xe7, // syslinux-4.07/menu.c32\n\t0xbc, 0x3f, 0xb7, 0x6d, 0xbc, 0xd6, 0x32, 0x37, 0xc3, 0x68, 0x8d, 0x3b, 0x55, 0x3c, 0x99, 0x41, 0x0e, 0x8f, 0xb3, 0x9e, 0x52, 0x00, 0x9d, 0xdc, 0xeb, 0xb8, 0x8e, 0xe7, 0xd2, 0x5a, 0xec, 0xa8, // grub-2.03.5/core.img\n\t0xbf, 0x05, 0x9b, 0x7f, 0x9d, 0xc5, 0x1d, 0x08, 0xb7, 0xa9, 0x36, 0x81, 0xcc, 0xc7, 0x82, 0xdc, 0x46, 0x4e, 0x43, 0xe6, 0x0d, 0xa4, 0xfb, 0xb6, 0xa1, 0xf5, 0x62, 0xea, 0x0e, 0x2d, 0xd3, 0x1a, // grub-2.14~rc1/core.img\n\t0xbf, 0xf9, 0xc5, 0x89, 0x59, 0x70, 0x4d, 0x1e, 0xbe, 0x25, 0xb4, 0x43, 0xc8, 0x92, 0x3a, 0x42, 0xed, 0x89, 0xaf, 0x8b, 0xd2, 0x92, 0xe7, 0xd7, 0xcb, 0xeb, 0xca, 0xcc, 0xc0, 0x7c, 0xc7, 0x19, // syslinux-5.11/ldlinux.sys\n\t0xc3, 0x3b, 0x31, 0x5f, 0xec, 0xe4, 0xad, 0xc4, 0xc3, 0xb2, 0x75, 0x13, 0x22, 0x84, 0x66, 0xe4, 0x44, 0x99, 0xcd, 0xa7, 0xfd, 0x63, 0x97, 0xc5, 0xab, 0xe0, 0xf8, 0xce, 0x4f, 0xe3, 0x45, 0x39, // syslinux-5.10/ldlinux.c32\n\t0xcc, 0x40, 0xba, 0x03, 0x49, 0x78, 0x2c, 0xb4, 0xc9, 0x02, 0x1e, 0x54, 0xdc, 0xc0, 0xa4, 0x54, 0x0c, 0x3a, 0x8b, 0x96, 0x08, 0x8b, 0x3a, 0x56, 0x48, 0x67, 0x19, 0x26, 0xef, 0x44, 0xd2, 0xf0, // syslinux-6.04/ldlinux.bss\n\t0xcd, 0x08, 0xf4, 0x81, 0xfb, 0x0c, 0xda, 0x19, 0xe1, 0x78, 0x6d, 0x43, 0x8d, 0x5c, 0x13, 0x93, 0xf7, 0xbf, 0xf3, 0x81, 0x31, 0x44, 0x4a, 0x0a, 0x5e, 0x54, 0xc1, 0x04, 0xed, 0x1d, 0x4d, 0xad, // syslinux-6.03/pre10/ldlinux.bss\n\t0xd0, 0x15, 0x48, 0xaf, 0x46, 0xf6, 0x4f, 0xed, 0x16, 0x69, 0xa5, 0x6e, 0x69, 0x31, 0x56, 0xb5, 0xde, 0x39, 0xd6, 0xbf, 0xa8, 0x6e, 0x9e, 0x07, 0x13, 0x1d, 0x70, 0x06, 0x3c, 0x56, 0x3d, 0xd0, // grub4dos-0.4.5c/grldr.mbr\n\t0xd2, 0xc6, 0x93, 0x8d, 0xae, 0x5a, 0xd7, 0x16, 0x0e, 0x9e, 0x6c, 0x61, 0xef, 0x46, 0xb7, 0xfd, 0x14, 0x6e, 0x30, 0xc0, 0x3f, 0xdc, 0x8f, 0x5c, 0x6d, 0xbd, 0xeb, 0x86, 0x22, 0xc8, 0xa7, 0xbd, // syslinux-5.00/ldlinux.bss\n\t0xd3, 0x47, 0x2c, 0x02, 0x26, 0x3a, 0xcf, 0x9c, 0xd1, 0xda, 0x5d, 0xb5, 0x1e, 0x26, 0x3c, 0x54, 0x84, 0xba, 0xd1, 0x3e, 0xa6, 0x86, 0x18, 0xc4, 0x03, 0xd9, 0xcb, 0x01, 0xca, 0x07, 0x0a, 0xee, // syslinux-6.04/ldlinux.c32\n\t0xd5, 0x50, 0x39, 0xef, 0xb6, 0x8d, 0x6e, 0xec, 0xde, 0x68, 0x61, 0xc9, 0x0b, 0xa9, 0xb7, 0x99, 0x44, 0xd1, 0xaa, 0x8b, 0xc3, 0xd6, 0x01, 0xfb, 0x80, 0xfd, 0x08, 0x7b, 0xc6, 0x13, 0x63, 0xf8, // syslinux-6.02/ldlinux.sys\n\t0xd9, 0x1c, 0xbd, 0xf9, 0x01, 0x79, 0x5e, 0x98, 0x19, 0x84, 0x9c, 0x75, 0x3e, 0xa5, 0x3a, 0xd8, 0x59, 0xc6, 0xf2, 0x5d, 0x59, 0x17, 0xa6, 0x75, 0x92, 0x58, 0x3f, 0xd6, 0x5e, 0x6d, 0x00, 0xf0, // syslinux-6.03/pre18/ldlinux.bss\n\t0xda, 0xa3, 0x06, 0xa9, 0x97, 0x0e, 0x37, 0x7d, 0xb4, 0x4c, 0xe7, 0xfa, 0xd8, 0xdd, 0x01, 0xe9, 0xe8, 0x53, 0xc6, 0x8b, 0x1e, 0x3d, 0x84, 0xf3, 0x2a, 0xaf, 0x42, 0x24, 0x6f, 0x77, 0xae, 0x3d, // grub-2.02/core.img\n\t0xe7, 0x87, 0x08, 0xc7, 0x2c, 0x49, 0x8e, 0xcc, 0x14, 0x9e, 0x30, 0xf0, 0xa9, 0x85, 0xd3, 0x73, 0xa3, 0x00, 0xad, 0x5c, 0xf7, 0xd2, 0x88, 0xc7, 0x7d, 0xe8, 0x05, 0x5e, 0x25, 0x66, 0x28, 0x1f, // syslinux-6.03/pre18/ldlinux.sys\n\t0xe9, 0x00, 0x3a, 0x56, 0x28, 0x43, 0xa3, 0x7b, 0xec, 0x4b, 0xef, 0xd4, 0xbb, 0x71, 0xfe, 0x3c, 0x5e, 0x6a, 0x50, 0x4d, 0x0b, 0x99, 0x36, 0xaf, 0xb6, 0x9e, 0xdc, 0x37, 0x2f, 0x7c, 0x41, 0xef, // syslinux-6.03/pre14/ldlinux.bss\n\t0xec, 0x31, 0xc2, 0xb7, 0xba, 0x09, 0xee, 0x69, 0xee, 0xf8, 0x55, 0x31, 0xe2, 0xc2, 0x4f, 0x22, 0x4a, 0xf7, 0xd9, 0x4a, 0x72, 0x25, 0xb2, 0x6f, 0x4f, 0x57, 0xf7, 0x70, 0x5e, 0x7d, 0xda, 0x1a, // syslinux-5.10/ldlinux.sys\n\t0xec, 0x94, 0x7e, 0x1c, 0x1e, 0x3f, 0xbe, 0xca, 0x4f, 0x55, 0x6d, 0x7a, 0x1a, 0x41, 0x15, 0x60, 0x89, 0x41, 0xf5, 0x48, 0x35, 0xe0, 0x7e, 0x8e, 0x89, 0xf7, 0x02, 0x85, 0x3d, 0xb7, 0xae, 0x2a, // syslinux-6.03/pre15/ldlinux.bss\n\t0xec, 0xfd, 0xbc, 0x3f, 0x4f, 0x2e, 0x4d, 0x99, 0x16, 0x9c, 0xdd, 0xfb, 0x15, 0x2d, 0x92, 0x4d, 0x7d, 0xe6, 0x8a, 0xb6, 0x7f, 0x4d, 0x12, 0x54, 0x40, 0xfa, 0xbc, 0x9f, 0x00, 0x46, 0xd5, 0xbc, // syslinux-6.03/pre5/ldlinux.bss\n\t0xee, 0xed, 0xc0, 0x4c, 0x13, 0x73, 0xb5, 0xc4, 0x04, 0x4d, 0x1f, 0xde, 0x0d, 0x2f, 0xb8, 0xe2, 0x8c, 0x74, 0xb1, 0x02, 0x9c, 0x99, 0xed, 0x67, 0x0a, 0x15, 0x98, 0x3f, 0x18, 0xa0, 0x4d, 0x36, // syslinux-6.02/ldlinux.c32\n\t0xf5, 0x40, 0x26, 0x1c, 0x09, 0x7d, 0xbd, 0x8a, 0x8a, 0x12, 0x9b, 0x68, 0x99, 0x5f, 0x33, 0xab, 0xe7, 0x1c, 0x29, 0x40, 0xf8, 0x87, 0xc6, 0x68, 0x9b, 0xf8, 0xdc, 0x3f, 0x1a, 0xcf, 0x0b, 0x44, // syslinux-6.03/pre17/ldlinux.bss\n\t0xfb, 0x0a, 0x23, 0xca, 0x4d, 0x22, 0xfd, 0xd2, 0xad, 0x4e, 0xfa, 0x1b, 0x21, 0x08, 0xb6, 0x60, 0xd2, 0xff, 0xa3, 0xf2, 0xfb, 0xdd, 0x25, 0x32, 0xdc, 0xf1, 0x3f, 0x49, 0x33, 0x28, 0x46, 0x7b, // syslinux-6.03/pre11/ldlinux.bss\n\t0xfb, 0x49, 0xfd, 0x45, 0x8c, 0xaf, 0x47, 0x5a, 0x16, 0x05, 0x5e, 0x4a, 0x75, 0x5a, 0xc3, 0xe3, 0x95, 0x52, 0xf4, 0xe9, 0x6c, 0xa2, 0x0d, 0xea, 0x53, 0xf5, 0xc4, 0x09, 0x2b, 0x68, 0xfd, 0x4f, // syslinux-6.00/ldlinux.sys\n};\n\n/*\n * Contains the SHA-1 thumbprints of the issuer certificate of the official\n * Secure Boot signing authority (i.e. Microsoft).\n */\nstatic const char db_sb_active_txt[] =\n\t// 'Microsoft Windows Production PCA 2011'\n\t\"580a6f4cc4e4b669b9ebdc1b2b3e087b80d0678d\\n\"\n\t// 'Microsoft Corporation UEFI CA 2011'\n\t\"46def63b5ce61cf8ba0de2e6639c1019d0ed14f3\\n\"\n\t// 'Windows UEFI CA 2023'\n\t\"45a0fa32604773c82433c3b7d59e7466b3ac0c67\\n\"\n\t// 'Microsoft UEFI CA 2023'\n\t\"b5eeb4a6706048073f0ed296e7f580a790b59eaa\";\n\n/*\n * Contains the SHA-1 thumbprints of certificates that are being revoked by DBX.\n * This only includes the 'Microsoft Windows Production PCA 2011' for now.\n */\nstatic const char db_sb_revoked_txt[] =\n\t\"580a6f4cc4e4b669b9ebdc1b2b3e087b80d0678d\";\n\n/*\n * Extended SBATLevel.txt that merges Linux SBAT with Microsoft's SVN\n * See https://github.com/pbatard/rufus/issues/2244#issuecomment-2243661539\n * Use as fallback when https://rufus.ie/sbat_level.txt cannot be accessed.\n */\nstatic const char db_sbat_level_txt[] =\n\t\"sbat,1,2025051000\\n\"\n\t\"shim,4\\n\"\n\t\"grub,5\\n\"\n\t\"grub.proxmox,2\\n\"\n\t\"BOOTMGRSECURITYVERSIONNUMBER,0x70000\";\n"
  },
  {
    "path": "src/dev.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Device detection and enumeration\n * Copyright © 2014-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <windowsx.h>\n#include <stdio.h>\n#include <malloc.h>\n#include <string.h>\n#include <stdint.h>\n#include <inttypes.h>\n#include <commctrl.h>\n#include <setupapi.h>\n#include <cfg.h>\n#include <assert.h>\n\n#include \"rufus.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"settings.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n\n#include \"drive.h\"\n#include \"dev.h\"\n\nextern RUFUS_DRIVE rufus_drive[MAX_DRIVES];\nextern BOOL enable_HDDs, enable_VHDs, use_fake_units, enable_vmdk, usb_debug;\nextern BOOL list_non_usb_removable_drives, its_a_me_mario;\n\n/*\n * Get the VID, PID and current device speed\n */\nstatic BOOL GetUSBProperties(char* parent_path, char* device_id, usb_device_props* props)\n{\n\tBOOL r = FALSE;\n\tCONFIGRET cr;\n\tHANDLE handle = INVALID_HANDLE_VALUE;\n\tDWORD size;\n\tDEVINST device_inst;\n\tUSB_NODE_CONNECTION_INFORMATION_EX conn_info;\n\tUSB_NODE_CONNECTION_INFORMATION_EX_V2 conn_info_v2;\n\n\tif ((parent_path == NULL) || (device_id == NULL) || (props == NULL))\n\t\tgoto out;\n\n\tcr = CM_Locate_DevNodeA(&device_inst, device_id, 0);\n\tif (cr != CR_SUCCESS) {\n\t\tuprintf(\"Could not get device instance handle for '%s': CR error %d\", device_id, cr);\n\t\tgoto out;\n\t}\n\n\tprops->port = 0;\n\tsize = sizeof(props->port);\n\tcr = CM_Get_DevNode_Registry_PropertyA(device_inst, CM_DRP_ADDRESS, NULL, (PVOID)&props->port, &size, 0);\n\tif (cr != CR_SUCCESS) {\n\t\tuprintf(\"Could not get port for '%s': CR error %d\", device_id, cr);\n\t\tgoto out;\n\t}\n\n\thandle = CreateFileA(parent_path, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);\n\tif (handle == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Could not open hub %s: %s\", parent_path, WindowsErrorString());\n\t\tgoto out;\n\t}\n\tsize = sizeof(conn_info);\n\tmemset(&conn_info, 0, size);\n\tconn_info.ConnectionIndex = (ULONG)props->port;\n\t// coverity[tainted_data_argument]\n\tif (!DeviceIoControl(handle, IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX, &conn_info, size, &conn_info, size, &size, NULL)) {\n\t\tuprintf(\"Could not get node connection information for '%s': %s\", device_id, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t// Some poorly written proprietary Windows 7 USB 3.0 controller drivers (<cough>ASMedia<cough>)\n\t// have a screwed up implementation of IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX that succeeds\n\t// but returns zeroed data => Add a workaround so that we don't lose our VID:PID...\n\tif ((conn_info.DeviceDescriptor.idVendor != 0) || (conn_info.DeviceDescriptor.idProduct != 0)) {\n\t\tprops->vid = conn_info.DeviceDescriptor.idVendor;\n\t\tprops->pid = conn_info.DeviceDescriptor.idProduct;\n\t\tprops->speed = conn_info.Speed + 1;\n\t\tr = TRUE;\n\t}\n\n\t// The USB speed report of modern Windows is a complete mess\n\tsize = sizeof(conn_info_v2);\n\tmemset(&conn_info_v2, 0, size);\n\tconn_info_v2.ConnectionIndex = (ULONG)props->port;\n\tconn_info_v2.Length = size;\n\tconn_info_v2.SupportedUsbProtocols.Usb300 = 1;\n\tif (!DeviceIoControl(handle, IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX_V2, &conn_info_v2, size, &conn_info_v2, size, &size, NULL)) {\n\t\tuprintf(\"Could not get node connection information (V2) for device '%s': %s\", device_id, WindowsErrorString());\n\t} else if (conn_info_v2.Flags.DeviceIsOperatingAtSuperSpeedPlusOrHigher) {\n\t\tprops->speed = USB_SPEED_SUPER_PLUS;\n\t} else if (conn_info_v2.Flags.DeviceIsOperatingAtSuperSpeedOrHigher) {\n\t\tprops->speed = USB_SPEED_SUPER;\n\t} else if (conn_info_v2.Flags.DeviceIsSuperSpeedPlusCapableOrHigher) {\n\t\tprops->lower_speed = 2;\n\t} else if (conn_info_v2.Flags.DeviceIsSuperSpeedCapableOrHigher) {\n\t\tprops->lower_speed = 1;\n\t}\n\nout:\n\tsafe_closehandle(handle);\n\treturn r;\n}\n\n/*\n * Cycle the USB port of the selected device\n */\nBOOL CyclePort(int index)\n{\n\tstatic uint64_t LastReset = 0;\n\tBOOL r = FALSE;\n\tHANDLE handle = INVALID_HANDLE_VALUE;\n\tDWORD size;\n\tUSB_CYCLE_PORT_PARAMS cycle_port;\n\n\tif_assert_fails(index < MAX_DRIVES)\n\t\treturn -1;\n\t// Wait at least 10 secs between resets\n\tif (GetTickCount64() < LastReset + 10000ULL) {\n\t\tuprintf(\"You must wait at least 10 seconds before trying to reset a device\");\n\t\treturn FALSE;\n\t}\n\n\tif (rufus_drive[index].hub == NULL) {\n\t\tuprintf(\"The device you are trying to reset does not appear to be a USB device...\");\n\t\treturn FALSE;\n\t}\n\n\tLastReset = GetTickCount64();\n\n\thandle = CreateFileA(rufus_drive[index].hub, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);\n\tif (handle == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Could not open %s: %s\", rufus_drive[index].hub, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tsize = sizeof(cycle_port);\n\tmemset(&cycle_port, 0, size);\n\tcycle_port.ConnectionIndex = rufus_drive[index].port;\n\tuprintf(\"Cycling port %d (reset) on %s\", rufus_drive[index].port, rufus_drive[index].hub);\n\t// As per https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/usbioctl/ni-usbioctl-ioctl_usb_hub_cycle_port\n\t// IOCTL_USB_HUB_CYCLE_PORT is not supported on Windows 7, Windows Vista, and Windows Server 2008\n\tif (!DeviceIoControl(handle, IOCTL_USB_HUB_CYCLE_PORT, &cycle_port, size, &cycle_port, size, &size, NULL)) {\n\t\tuprintf(\"  Failed to cycle port: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\tuprintf(\"Please wait for the device to re-appear...\");\n\tr = TRUE;\n\nout:\n\tsafe_closehandle(handle);\n\treturn r;\n}\n\n/*\n * Forces a refresh by disabling and then re-enabling the device using SetupAPI.\n * Returns the Windows error code from the operation.\n * Note: In some circumstances, this may leave the device disabled after re-plug or reboot...\n */\nint CycleDevice(int index)\n{\n\tBOOL found = FALSE, disabled = FALSE;\n\tchar device_instance_id[MAX_PATH];\n\tDWORD i, size, ret = ERROR_DEV_NOT_EXIST;\n\tLONG dev_status, problem_code;\n\tHDEVINFO dev_info;\n\tSP_DEVINFO_DATA dev_info_data;\n\tSP_PROPCHANGE_PARAMS propchange_params;\n\n\tif_assert_fails(index < MAX_DRIVES)\n\t\treturn ERROR_INVALID_DRIVE;\n\tif ((index < 0) || (safe_strlen(rufus_drive[index].id) < 8))\n\t\treturn ERROR_INVALID_PARAMETER;\n\n\t// Need DIGCF_ALLCLASSES else disabled devices won't be listed.\n\tdev_info = SetupDiGetClassDevsA(&GUID_DEVINTERFACE_DISK, NULL, NULL, DIGCF_PRESENT | DIGCF_ALLCLASSES);\n\tif (dev_info == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Could not get classes for device cycling: %s\", WindowsErrorString());\n\t\treturn ERROR_PATH_NOT_FOUND;\n\t}\n\n\tdev_info_data.cbSize = sizeof(SP_DEVINFO_DATA);\n\tfor (i = 0; SetupDiEnumDeviceInfo(dev_info, i, &dev_info_data); i++) {\n\t\tmemset(device_instance_id, 0, sizeof(device_instance_id));\n\t\tsize = sizeof(device_instance_id);\n\n\t\tif (!SetupDiGetDeviceInstanceIdA(dev_info, &dev_info_data, device_instance_id, size, &size)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (safe_strcmp(rufus_drive[index].id, device_instance_id) != 0)\n\t\t\tcontinue;\n\n\t\tfound = TRUE;\n\n\t\t// Detect if the device is already disabled\n\t\tif (CM_Get_DevNode_Status(&dev_status, &problem_code, dev_info_data.DevInst, 0) == CR_SUCCESS)\n\t\t\tdisabled = (dev_status & DN_HAS_PROBLEM) && (problem_code == CM_PROB_DISABLED);\n\n\t\t// Disable the device\n\t\tif (!disabled) {\n\t\t\tmemset(&propchange_params, 0, sizeof(propchange_params));\n\t\t\tpropchange_params.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);\n\t\t\tpropchange_params.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE;\n\t\t\tpropchange_params.Scope = DICS_FLAG_CONFIGSPECIFIC;\n\t\t\tpropchange_params.StateChange = DICS_DISABLE;\n\n\t\t\tif (!SetupDiSetClassInstallParams(dev_info, &dev_info_data,\n\t\t\t\t(SP_CLASSINSTALL_HEADER*)&propchange_params, sizeof(propchange_params))) {\n\t\t\t\tuprintf(\"Could not cycle device (D1): %s\", WindowsErrorString());\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (!SetupDiChangeState(dev_info, &dev_info_data)) {\n\t\t\t\tuprintf(\"Could not cycle device (D2): %s\", WindowsErrorString());\n\t\t\t\t// If we failed to actually change the status, we must revert the properties\n\t\t\t\tret = ERROR_OPERATION_ABORTED;\n\t\t\t}\n\t\t\tSleep(250);\n\t\t}\n\n\t\t// Re-enable the device\n\t\tmemset(&propchange_params, 0, sizeof(propchange_params));\n\t\tpropchange_params.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);\n\t\tpropchange_params.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE;\n\t\tpropchange_params.Scope = DICS_FLAG_CONFIGSPECIFIC;\n\t\tpropchange_params.StateChange = DICS_ENABLE;\n\t\tif (!SetupDiSetClassInstallParams(dev_info, &dev_info_data,\n\t\t\t(SP_CLASSINSTALL_HEADER*)&propchange_params, sizeof(propchange_params))) {\n\t\t\tuprintf(\"Could not cycle device (E1): %s\", WindowsErrorString());\n\t\t\tret = ERROR_OPERATION_ABORTED;\n\t\t}\n\t\tif (ret == ERROR_OPERATION_ABORTED)\n\t\t\tbreak;\n\t\tif (!SetupDiChangeState(dev_info, &dev_info_data)) {\n\t\t\tuprintf(\"Could not cycle device (E2): %s\", WindowsErrorString());\n\t\t\tret = ERROR_GEN_FAILURE;\n\t\t} else {\n\t\t\tret = ERROR_SUCCESS;\n\t\t}\n\n\t\t// This is great: The MS APIs may let you believe that disabling and reenabling was\n\t\t// successful, but leave the device in an actual disabled state... So we can end up\n\t\t// with zombie devices, that are effectively disabled, but that Windows still sees\n\t\t// as enabled... So we need to detect this.\n\t\tif (CM_Get_DevNode_Status(&dev_status, &problem_code, dev_info_data.DevInst, 0) == CR_SUCCESS) {\n\t\t\tdisabled = (dev_status & DN_HAS_PROBLEM) && (problem_code == CM_PROB_DISABLED);\n\t\t\tif (disabled)\n\t\t\t\tret = ERROR_DEVICE_REINITIALIZATION_NEEDED;\n\t\t}\n\t\tbreak;\n\t}\n\n\tSetupDiDestroyDeviceInfoList(dev_info);\n\tif (!found)\n\t\tuprintf(\"Could not find a device to cycle!\");\n\treturn ret;\n}\n\nstatic __inline BOOL IsVHD(const char* buffer)\n{\n\tint i;\n\t// List of the Hardware IDs of the VHD devices we know\n\tconst char* vhd_name[] = {\n\t\t\"Arsenal_________Virtual_\",\n\t\t\"KernSafeVirtual_________\",\n\t\t\"Msft____Virtual_Disk____\",\n\t\t\"BHYVE__________SATA_DISK\",\n\t\t\"VMware__VMware_Virtual_S\"\t// Enabled through a cheat mode, as this lists primary disks on VMWare instances\n\t};\n\n\tif (buffer == NULL || buffer[0] == '\\0')\n\t\treturn FALSE;\n\tfor (i = 0; i < (int)(ARRAYSIZE(vhd_name) - (enable_vmdk ? 0 : 1)); i++)\n\t\tif (safe_strstr(buffer, vhd_name[i]) != NULL)\n\t\t\treturn TRUE;\n\treturn FALSE;\n}\n\nstatic __inline BOOL IsRemovable(const char* buffer)\n{\n\tswitch (*((DWORD*)buffer)) {\n\tcase CM_REMOVAL_POLICY_EXPECT_SURPRISE_REMOVAL:\n\tcase CM_REMOVAL_POLICY_EXPECT_ORDERLY_REMOVAL:\n\t\treturn TRUE;\n\tdefault:\n\t\treturn FALSE;\n\t}\n}\n\nstatic __inline void ToUpper(char* str)\n{\n\tsize_t i;\n\tfor (i = 0; i < safe_strlen(str); i++)\n\t\tstr[i] = (char)toupper(str[i]);\n}\n\nBOOL GetOpticalMedia(IMG_SAVE* img_save)\n{\n\tstatic char str[MAX_PATH];\n\tstatic char label[33];\n\tint k;\n\tBYTE geometry[256], *buffer = NULL;\n\tPDISK_GEOMETRY_EX DiskGeometry = (PDISK_GEOMETRY_EX)(void*)geometry;\n\tDWORD i, j, size, datatype;\n\tHDEVINFO dev_info = NULL;\n\tSP_DEVINFO_DATA dev_info_data;\n\tSP_DEVICE_INTERFACE_DATA devint_data;\n\tPSP_DEVICE_INTERFACE_DETAIL_DATA_A devint_detail_data;\n\tHANDLE hDrive = INVALID_HANDLE_VALUE;\n\tLARGE_INTEGER li;\n\n\tdev_info = SetupDiGetClassDevsA(&GUID_DEVINTERFACE_CDROM, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);\n\tif (dev_info == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"SetupDiGetClassDevs (Interface) failed: %s\", WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\tdev_info_data.cbSize = sizeof(dev_info_data);\n\tfor (i = 0; SetupDiEnumDeviceInfo(dev_info, i, &dev_info_data); i++) {\n\t\tmemset(str, 0, sizeof(str));\n\t\tif (!SetupDiGetDeviceRegistryPropertyU(dev_info, &dev_info_data, SPDRP_FRIENDLYNAME,\n\t\t\t&datatype, (LPBYTE)str, sizeof(str), &size)) {\n\t\t\tuprintf(\"SetupDiGetDeviceRegistryProperty (Friendly Name) failed: %s\", WindowsErrorString());\n\t\t\tstatic_strcpy(str, \"Generic Optical Drive\");\n\t\t}\n\t\tuprintf(\"Found '%s' optical device\", str);\n\t\tdevint_data.cbSize = sizeof(devint_data);\n\t\tdevint_detail_data = NULL;\n\t\tfor (j = 0; ; j++) {\n\t\t\tsafe_closehandle(hDrive);\n\t\t\tsafe_free(devint_detail_data);\n\t\t\tsafe_free(buffer);\n\n\t\t\tif (!SetupDiEnumDeviceInterfaces(dev_info, &dev_info_data, &GUID_DEVINTERFACE_CDROM, j, &devint_data)) {\n\t\t\t\tif (GetLastError() != ERROR_NO_MORE_ITEMS) {\n\t\t\t\t\tuprintf(\"SetupDiEnumDeviceInterfaces failed: %s\", WindowsErrorString());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (!SetupDiGetDeviceInterfaceDetailA(dev_info, &devint_data, NULL, 0, &size, NULL)) {\n\t\t\t\tif (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {\n\t\t\t\t\tdevint_detail_data = (PSP_DEVICE_INTERFACE_DETAIL_DATA_A)calloc(1, size);\n\t\t\t\t\tif (devint_detail_data == NULL) {\n\t\t\t\t\t\tuprintf(\"Unable to allocate data for SP_DEVICE_INTERFACE_DETAIL_DATA\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdevint_detail_data->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A);\n\t\t\t\t} else {\n\t\t\t\t\tuprintf(\"SetupDiGetDeviceInterfaceDetail (dummy) failed: %s\", WindowsErrorString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (devint_detail_data == NULL) {\n\t\t\t\tuprintf(\"SetupDiGetDeviceInterfaceDetail (dummy) - no data was allocated\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!SetupDiGetDeviceInterfaceDetailA(dev_info, &devint_data, devint_detail_data, size, &size, NULL)) {\n\t\t\t\tuprintf(\"SetupDiGetDeviceInterfaceDetail (actual) failed: %s\", WindowsErrorString());\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get the size of the inserted media (if any)\n\t\t\thDrive = CreateFileA(devint_detail_data->DevicePath, GENERIC_READ,\n\t\t\t\tFILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);\n\t\t\tif (hDrive == INVALID_HANDLE_VALUE)\n\t\t\t\tcontinue;\n\t\t\tif (!DeviceIoControl(hDrive, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, geometry, sizeof(geometry), &size, NULL))\n\t\t\t\tcontinue;\n\t\t\t// Rewritable media usually has a one sector\n\t\t\tif (DiskGeometry->DiskSize.QuadPart <= 4096)\n\t\t\t\tcontinue;\n\t\t\t// Read the label directly, since it's a massive PITA to get it from Windows\n\t\t\tli.QuadPart = 0x8000LL;\n\t\t\tbuffer = malloc(2048);\n\t\t\tif ((buffer != NULL) && (SetFilePointerEx(hDrive, li, NULL, FILE_BEGIN)) &&\n\t\t\t\tReadFile(hDrive, buffer, 2048, &size, NULL) && (size == 2048)) {\n\t\t\t\tmemcpy(label, &buffer[0x28], sizeof(label) - 1);\n\t\t\t\tlabel[sizeof(label) - 1] = 0;\n\t\t\t\tfor (k = (int)strlen(label) - 1; (k >= 0) && (label[k] == 0x20); k--)\n\t\t\t\t\tlabel[k] = 0;\n\t\t\t\timg_save->Label = label;\n\t\t\t}\n\t\t\tstatic_strcpy(str, devint_detail_data->DevicePath);\n\t\t\timg_save->DevicePath = str;\n\t\t\timg_save->DeviceSize = DiskGeometry->DiskSize.QuadPart;\n\t\t\tsafe_closehandle(hDrive);\n\t\t\tsafe_free(devint_detail_data);\n\t\t\tsafe_free(buffer);\n\t\t\treturn TRUE;\n\t\t}\n\t}\n\treturn FALSE;\n}\n\n/* For debugging user reports of HDDs vs UFDs */\n//#define FORCED_DEVICE\n#ifdef FORCED_DEVICE\n#define FORCED_VID 0x0781\n#define FORCED_PID 0x55A9\n#define FORCED_NAME \" USB  SanDisk 3.2Gen1 UAS Device\"\n#endif\n\nvoid ClearDrives(void)\n{\n\tint i;\n\tfor (i = 0; i < MAX_DRIVES && rufus_drive[i].size != 0; i++) {\n\t\tfree(rufus_drive[i].id);\n\t\tfree(rufus_drive[i].name);\n\t\tfree(rufus_drive[i].display_name);\n\t\tfree(rufus_drive[i].label);\n\t\tfree(rufus_drive[i].hub);\n\t}\n\tmemset(rufus_drive, 0, sizeof(rufus_drive));\n}\n\n/*\n * Refresh the list of USB devices\n */\nBOOL GetDevices(DWORD devnum)\n{\n\t// List of USB storage drivers we know - list may be incomplete!\n\tconst char* usbstor_name[] = {\n\t\t// Standard MS USB storage driver\n\t\t\"USBSTOR\",\n\t\t// USB card readers, with proprietary drivers (Realtek,etc...)\n\t\t// Mostly \"guessed\" from http://www.carrona.org/dvrref.php\n\t\t\"RTSUER\", \"CMIUCR\", \"EUCR\",\n\t\t// UASP Drivers *MUST* be listed after this, starting with \"UASPSTOR\"\n\t\t// (which is Microsoft's native UASP driver for Windows 8 and later)\n\t\t// as we use \"UASPSTOR\" as a delimiter\n\t\t\"UASPSTOR\", \"VUSBSTOR\", \"ETRONSTOR\", \"ASUSSTPT\"\n\t};\n\t// These are the generic (non USB) storage enumerators we also test\n\tconst char* genstor_name[] = {\n\t\t// Generic storage drivers (Careful now!)\n\t\t\"SCSI\", // \"STORAGE\",\t// \"STORAGE\" is used by 'Storage Spaces\" and stuff => DANGEROUS!\n\t\t// Non-USB card reader drivers - This list *MUST* start with \"SD\" (delimiter)\n\t\t// See http://itdoc.hitachi.co.jp/manuals/3021/30213B5200e/DMDS0094.HTM\n\t\t// Also  http://www.carrona.org/dvrref.php. NB: All members from this list should have\n\t\t// been reported as enumerators by Rufus, when Enum Debug is enabled.\n\t\t\"SD\", \"PCISTOR\", \"RTSOR\", \"JMCR\", \"JMCF\", \"RIMMPTSK\", \"RIMSPTSK\", \"RISD\", \"RIXDPTSK\",\n\t\t\"TI21SONY\", \"ESD7SK\", \"ESM7SK\", \"O2MD\", \"O2SD\", \"VIACR\", \"GLREADER\"\n\t};\n\t// Oh, and we also have card devices (e.g. 'SCSI\\DiskO2Micro_SD_...') under the SCSI enumerator...\n\tconst char* scsi_disk_prefix = \"SCSI\\\\Disk\";\n\tconst char* scsi_card_name[] = {\n\t\t\"_SD_\", \"_SDHC_\", \"_SDXC_\", \"_MMC_\", \"_MS_\", \"_MSPro_\", \"_xDPicture_\", \"_O2Media_\"\n\t};\n\tconst char* usb_speed_name[USB_SPEED_MAX] = { \"USB\", \"USB 1.0\", \"USB 1.1\", \"USB 2.0\", \"USB 3.0\", \"USB 3.1\" };\n\tconst char* windows_sandbox_vhd_label = \"PortableBaseLayer\";\n\tconst char* bitdefender_label = \"Bitdefender Partition\";\n\t// Hash table and String Array used to match a Device ID with the parent hub's Device Interface Path\n\thtab_table htab_devid = HTAB_EMPTY;\n\tStrArray dev_if_path = { 0 };\n\tchar letter_name[] = \" (?:)\";\n\tchar drive_name[] = \"?:\\\\\";\n\tchar setting_name[32];\n\tchar uefi_togo_check[] = \"?:\\\\EFI\\\\Rufus\\\\ntfs_x64.efi\";\n\tchar scsi_card_name_copy[16];\n\tBOOL r = FALSE, found = FALSE, post_backslash;\n\tHDEVINFO dev_info = NULL;\n\tSP_DEVINFO_DATA dev_info_data;\n\tSP_DEVICE_INTERFACE_DATA devint_data;\n\tPSP_DEVICE_INTERFACE_DETAIL_DATA_A devint_detail_data;\n\tDEVINST parent_inst, grandparent_inst, device_inst;\n\tDWORD size, i, j, k, l, data_type, drive_index;\n\tDWORD uasp_start = ARRAYSIZE(usbstor_name), card_start = ARRAYSIZE(genstor_name);\n\tULONG list_size[ARRAYSIZE(usbstor_name)] = { 0 }, list_start[ARRAYSIZE(usbstor_name)] = { 0 }, full_list_size, ulFlags;\n\tHANDLE hDrive;\n\tLONG maxwidth = 0;\n\tint s, u, v, score, drive_number, remove_drive, num_drives = 0;\n\tchar drive_letters[27], *device_id, *devid_list = NULL, display_msg[128];\n\tchar *p, *label, *display_name, buffer[4 * KB], str[MAX_PATH], device_instance_id[MAX_PATH], *method_str, *hub_path;\n\tuint32_t ignore_vid_pid[MAX_IGNORE_USB];\n\tuint64_t drive_size = 0;\n\tusb_device_props props;\n\n\tIGNORE_RETVAL(ComboBox_ResetContent(hDeviceList));\n\tClearDrives();\n\tStrArrayCreate(&dev_if_path, 128);\n\t// Add a dummy for string index zero, as this is what non matching hashes will point to\n\tStrArrayAdd(&dev_if_path, \"\", TRUE);\n\n\tdevice_id = (char*)malloc(MAX_PATH);\n\tif (device_id == NULL)\n\t\tgoto out;\n\n\t// Build a hash table associating a CM Device ID of a USB device with the SetupDI Device Interface Path\n\t// of its parent hub - this is needed to retrieve the device speed\n\tdev_info = SetupDiGetClassDevsA(&GUID_DEVINTERFACE_USB_HUB, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);\n\tif (dev_info != INVALID_HANDLE_VALUE) {\n\t\tif (htab_create(DEVID_HTAB_SIZE, &htab_devid)) {\n\t\t\tdev_info_data.cbSize = sizeof(dev_info_data);\n\t\t\tfor (i=0; SetupDiEnumDeviceInfo(dev_info, i, &dev_info_data); i++) {\n\t\t\t\tuuprintf(\"Processing Hub %d:\", i + 1);\n\t\t\t\tdevint_detail_data = NULL;\n\t\t\t\tdevint_data.cbSize = sizeof(devint_data);\n\t\t\t\t// Only care about the first interface (MemberIndex 0)\n\t\t\t\tif ( (SetupDiEnumDeviceInterfaces(dev_info, &dev_info_data, &GUID_DEVINTERFACE_USB_HUB, 0, &devint_data))\n\t\t\t\t  && (!SetupDiGetDeviceInterfaceDetailA(dev_info, &devint_data, NULL, 0, &size, NULL))\n\t\t\t\t  && (GetLastError() == ERROR_INSUFFICIENT_BUFFER)\n\t\t\t\t  && ((devint_detail_data = (PSP_DEVICE_INTERFACE_DETAIL_DATA_A)calloc(1, size)) != NULL) ) {\n\t\t\t\t\tdevint_detail_data->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A);\n\t\t\t\t\tif (SetupDiGetDeviceInterfaceDetailA(dev_info, &devint_data, devint_detail_data, size, &size, NULL)) {\n\n\t\t\t\t\t\t// Find the Device IDs for all the children of this hub\n\t\t\t\t\t\tif (CM_Get_Child(&device_inst, dev_info_data.DevInst, 0) == CR_SUCCESS) {\n\t\t\t\t\t\t\tdevice_id[0] = 0;\n\t\t\t\t\t\t\ts = StrArrayAdd(&dev_if_path, devint_detail_data->DevicePath, TRUE);\n\t\t\t\t\t\t\tuuprintf(\"  Hub[%d] = '%s'\", s, devint_detail_data->DevicePath);\n\t\t\t\t\t\t\tif ((s>= 0) && (CM_Get_Device_IDA(device_inst, device_id, MAX_PATH, 0) == CR_SUCCESS)) {\n\t\t\t\t\t\t\t\tToUpper(device_id);\n\t\t\t\t\t\t\t\tif ((k = htab_hash(device_id, &htab_devid)) != 0) {\n\t\t\t\t\t\t\t\t\thtab_devid.table[k].data = (void*)(uintptr_t)s;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tuuprintf(\"  Found ID[%03d]: %s\", k, device_id);\n\t\t\t\t\t\t\t\twhile (CM_Get_Sibling(&device_inst, device_inst, 0) == CR_SUCCESS) {\n\t\t\t\t\t\t\t\t\tdevice_id[0] = 0;\n\t\t\t\t\t\t\t\t\tif (CM_Get_Device_IDA(device_inst, device_id, MAX_PATH, 0) == CR_SUCCESS) {\n\t\t\t\t\t\t\t\t\t\tToUpper(device_id);\n\t\t\t\t\t\t\t\t\t\tif ((k = htab_hash(device_id, &htab_devid)) != 0) {\n\t\t\t\t\t\t\t\t\t\t\thtab_devid.table[k].data = (void*)(uintptr_t)s;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tuuprintf(\"  Found ID[%03d]: %s\", k, device_id);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfree(devint_detail_data);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSetupDiDestroyDeviceInfoList(dev_info);\n\t}\n\tfree(device_id);\n\n\t// Build a single list of Device IDs from all the storage enumerators we know of\n\tfull_list_size = 0;\n\tulFlags = CM_GETIDLIST_FILTER_SERVICE | CM_GETIDLIST_FILTER_PRESENT;\n\tfor (s = 0; s < ARRAYSIZE(usbstor_name); s++) {\n\t\t// Get a list of device IDs for all USB storage devices\n\t\t// This will be used to find if a device is UASP\n\t\t// Also compute the uasp_start index\n\t\tif (strcmp(usbstor_name[s], \"UASPSTOR\") == 0)\n\t\t\tuasp_start = s;\n\t\tif (CM_Get_Device_ID_List_SizeA(&list_size[s], usbstor_name[s], ulFlags) != CR_SUCCESS)\n\t\t\tlist_size[s] = 0;\n\t\tif (list_size[s] != 0)\n\t\t\tfull_list_size += list_size[s]-1;\t// remove extra NUL terminator\n\t}\n\t// Compute the card_start index\n\tfor (s = 0; s < ARRAYSIZE(genstor_name); s++) {\n\t\tif (strcmp(genstor_name[s], \"SD\") == 0)\n\t\t\tcard_start = s;\n\t}\n\n\t// Build the list of USB devices we may want to ignore\n\tfor (s = 0; s < ARRAYSIZE(ignore_vid_pid); s++) {\n\t\tstatic_sprintf(setting_name, \"IgnoreUsb%02d\", s + 1);\n\t\tignore_vid_pid[s] = ReadSetting32(setting_name);\n\t}\n\n\t// Better safe than sorry. And yeah, we could have used arrays of\n\t// arrays to avoid this, but it's more readable this way.\n\tif_assert_fails((uasp_start > 0) && (uasp_start < ARRAYSIZE(usbstor_name)))\n\t\tgoto out;\n\tif_assert_fails((card_start > 0) && (card_start < ARRAYSIZE(genstor_name)))\n\t\tgoto out;\n\n\tdevid_list = NULL;\n\tif (full_list_size != 0) {\n\t\tfull_list_size += 1;\t// add extra NUL terminator\n\t\tdevid_list = (char*)malloc(full_list_size);\n\t\tif (devid_list == NULL) {\n\t\t\tuprintf(\"Could not allocate Device ID list\");\n\t\t\tgoto out;\n\t\t}\n\t\tfor (s = 0, i = 0; s < ARRAYSIZE(usbstor_name); s++) {\n\t\t\tlist_start[s] = i;\n\t\t\tif (list_size[s] > 1) {\n\t\t\t\tif (CM_Get_Device_ID_ListA(usbstor_name[s], &devid_list[i], list_size[s], ulFlags) != CR_SUCCESS)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (usb_debug) {\n\t\t\t\t\tuprintf(\"Processing IDs belonging to '%s':\", usbstor_name[s]);\n\t\t\t\t\tfor (device_id = &devid_list[i]; *device_id != 0; device_id += strlen(device_id) + 1)\n\t\t\t\t\t\tuprintf(\"  %s\", device_id);\n\t\t\t\t}\n\t\t\t\t// The list_size is sometimes larger than required thus we need to find the real end\n\t\t\t\tfor (i += list_size[s]; i > 2; i--) {\n\t\t\t\t\tif ((devid_list[i-2] != '\\0') && (devid_list[i-1] == '\\0') && (devid_list[i] == '\\0'))\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Now use SetupDi to enumerate all our disk storage devices\n\tdev_info = SetupDiGetClassDevsA(&GUID_DEVINTERFACE_DISK, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);\n\tif (dev_info == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"SetupDiGetClassDevs (Interface) failed: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\tdev_info_data.cbSize = sizeof(dev_info_data);\n\tfor (i = 0; num_drives < MAX_DRIVES && SetupDiEnumDeviceInfo(dev_info, i, &dev_info_data); i++) {\n\t\tmemset(buffer, 0, sizeof(buffer));\n\t\tmemset(&props, 0, sizeof(props));\n\t\tprops.vid = -1; props.pid = -1;\n\t\tmethod_str = \"\";\n\t\thub_path = NULL;\n\t\tif (!SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_ENUMERATOR_NAME,\n\t\t\t\t&data_type, (LPBYTE)buffer, sizeof(buffer), &size)) {\n\t\t\tuprintf(\"SetupDiGetDeviceRegistryProperty (Enumerator Name) failed: %s\", WindowsErrorString());\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (j = 0; j < ARRAYSIZE(usbstor_name); j++) {\n\t\t\tif (safe_stricmp(buffer, usbstor_name[0]) == 0) {\n\t\t\t\tprops.is_USB = TRUE;\n\t\t\t\tif ((j != 0) && (j < uasp_start))\n\t\t\t\t\tprops.is_CARD = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// UASP drives are listed under SCSI, and we also have non USB card readers to populate\n\t\tfor (j = 0; j < ARRAYSIZE(genstor_name); j++) {\n\t\t\tif (safe_stricmp(buffer, genstor_name[j]) == 0) {\n\t\t\t\tprops.is_SCSI = TRUE;\n\t\t\t\tif (j >= card_start)\n\t\t\t\t\tprops.is_CARD = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tuuprintf(\"Processing '%s' device:\", buffer);\n\t\tif ((!props.is_USB) && (!props.is_SCSI)) {\n\t\t\tuuprintf(\"  Unsupported or disabled by policy\");\n\t\t\tcontinue;\n\t\t}\n\n\t\t// We can't use the friendly name to find if a drive is a VHD, as friendly name string gets translated\n\t\t// according to your locale, so we poke the Hardware ID\n\t\tmemset(buffer, 0, sizeof(buffer));\n\t\tr = SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_HARDWAREID,\n\t\t\t&data_type, (LPBYTE)buffer, sizeof(buffer), &size);\n\t\t// We should always be able to get a Hardware ID for disk devices, so report an error in debug if we don't\n\t\tif (!r && usb_debug)\n\t\t\tuprintf(\"  Error: %s\", WindowsErrorString());\n\t\tprops.is_VHD = IsVHD(buffer);\n\t\tif (!props.is_VHD)\n\t\t// Additional detection for SCSI card readers\n\t\tif ((!props.is_CARD) && (safe_strnicmp(buffer, scsi_disk_prefix, sizeof(scsi_disk_prefix)-1) == 0)) {\n\t\t\tfor (j = 0; j < ARRAYSIZE(scsi_card_name); j++) {\n\t\t\t\tstatic_strcpy(scsi_card_name_copy, scsi_card_name[j]);\n\t\t\t\tif (safe_strstr(buffer, scsi_card_name_copy) != NULL) {\n\t\t\t\t\tprops.is_CARD = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// Also test for \"_SD&\" instead of \"_SD_\" and so on to allow for devices like\n\t\t\t\t// \"SCSI\\DiskRicoh_Storage_SD&REV_3.0\" to be detected.\n\t\t\t\tif_assert_fails(strlen(scsi_card_name_copy) > 1)\n\t\t\t\t\tcontinue;\n\t\t\t\tscsi_card_name_copy[strlen(scsi_card_name_copy) - 1] = '&';\n\t\t\t\tif (safe_strstr(buffer, scsi_card_name_copy) != NULL) {\n\t\t\t\t\tprops.is_CARD = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tuuprintf(\"  Hardware ID: '%s'\", buffer);\n\n\t\t// Keep track of the Device Instance ID, which we'll need to \"reset\" the device\n\t\tif (!SetupDiGetDeviceInstanceIdA(dev_info, &dev_info_data, device_instance_id,\n\t\t\tsizeof(device_instance_id), &size)) {\n\t\t\tuprintf(\"SetupDiGetDeviceInstanceId failed: %s\", WindowsErrorString());\n\t\t\tstrcpy(device_instance_id, \"<N/A>\");\n\t\t}\n\n\t\tmemset(buffer, 0, sizeof(buffer));\n\t\tprops.is_Removable = SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_REMOVAL_POLICY,\n\t\t\t&data_type, (LPBYTE)buffer, sizeof(buffer), &size) && IsRemovable(buffer);\n\n\t\tmemset(buffer, 0, sizeof(buffer));\n\t\tif (!SetupDiGetDeviceRegistryPropertyU(dev_info, &dev_info_data, SPDRP_FRIENDLYNAME,\n\t\t\t\t&data_type, (LPBYTE)buffer, sizeof(buffer), &size)) {\n\t\t\tuprintf(\"SetupDiGetDeviceRegistryProperty (Friendly Name) failed: %s\", WindowsErrorString());\n\t\t\t// We can afford a failure on this call - just replace the name with \"USB Storage Device (Generic)\"\n\t\t\tstatic_strcpy(buffer, lmprintf(MSG_045));\n\t\t} else if ((!props.is_VHD) && (devid_list != NULL)) {\n\t\t\t// Get the properties of the device. We could avoid doing this lookup every time by keeping\n\t\t\t// a lookup table, but there shouldn't be that many USB storage devices connected...\n\t\t\t// NB: Each of these Device IDs should have a child, from which we get the Device Instance match.\n\t\t\tfor (device_id = devid_list; *device_id != 0; device_id += strlen(device_id) + 1) {\n\t\t\t\tif (CM_Locate_DevNodeA(&parent_inst, device_id, 0) != CR_SUCCESS) {\n\t\t\t\t\tuuprintf(\"Could not locate device node for '%s'\", device_id);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (CM_Get_Child(&device_inst, parent_inst, 0) != CR_SUCCESS) {\n\t\t\t\t\tuuprintf(\"Could not get children of '%s'\", device_id);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (device_inst != dev_info_data.DevInst) {\n\t\t\t\t\t// Try the siblings\n\t\t\t\t\twhile (CM_Get_Sibling(&device_inst, device_inst, 0) == CR_SUCCESS) {\n\t\t\t\t\t\tif (device_inst == dev_info_data.DevInst) {\n\t\t\t\t\t\t\tuuprintf(\"NOTE: Matched instance from sibling for '%s'\", device_id);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (device_inst != dev_info_data.DevInst)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tpost_backslash = FALSE;\n\t\t\t\tmethod_str = \"\";\n\n\t\t\t\t// If we're not dealing with the USBSTOR part of our list, then this is an UASP device\n\t\t\t\tprops.is_UASP = ((((uintptr_t)device_id) + 2) >= ((uintptr_t)devid_list) + list_start[uasp_start]);\n\t\t\t\t// Now get the properties of the device, and its Device ID, which we need to populate the properties\n\t\t\t\tToUpper(device_id);\n\t\t\t\tj = htab_hash(device_id, &htab_devid);\n\t\t\t\tuuprintf(\"  Matched with ID[%03d]: %s\", j, device_id);\n\n\t\t\t\t// Try to parse the current device_id string for VID:PID\n\t\t\t\t// We'll use that if we can't get anything better\n\t\t\t\tfor (k = 0, l = 0; (k < strlen(device_id)) && (l < 2); k++) {\n\t\t\t\t\t// The ID is in the form USB_VENDOR_BUSID\\VID_xxxx&PID_xxxx\\...\n\t\t\t\t\tif (device_id[k] == '\\\\')\n\t\t\t\t\t\tpost_backslash = TRUE;\n\t\t\t\t\tif (!post_backslash)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (device_id[k] == '_') {\n\t\t\t\t\t\tprops.pid = (uint16_t)strtoul(&device_id[k + 1], &p, 16);\n\t\t\t\t\t\tif (p != &device_id[k + 5]) {\n\t\t\t\t\t\t\tuuprintf(\"  WARNING: Could not read PID:VID from string\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (l++ == 0)\n\t\t\t\t\t\t\tprops.vid = props.pid;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (props.vid != -1 && props.pid != -1)\n\t\t\t\t\tmethod_str = \"[ID]\";\n\n\t\t\t\t// If the hash didn't match a populated string in dev_if_path[] (htab_devid.table[j].data > 0),\n\t\t\t\t// we might have an extra vendor driver in between (e.g. \"ASUS USB 3.0 Boost Storage Driver\"\n\t\t\t\t// for UASP devices in ASUS \"Turbo Mode\" or \"Apple Mobile Device USB Driver\" for iPods)\n\t\t\t\t// so try to see if we can match the grandparent.\n\t\t\t\tif ( ((uintptr_t)htab_devid.table[j].data == 0)\n\t\t\t\t\t&& (CM_Get_Parent(&grandparent_inst, parent_inst, 0) == CR_SUCCESS)\n\t\t\t\t\t&& (CM_Get_Device_IDA(grandparent_inst, str, MAX_PATH, 0) == CR_SUCCESS) ) {\n\t\t\t\t\tdevice_id = str;\n\t\t\t\t\tmethod_str = \"[GP]\";\n\t\t\t\t\tToUpper(device_id);\n\t\t\t\t\tj = htab_hash(device_id, &htab_devid);\n\t\t\t\t\tuuprintf(\"  Matched with (GP) ID[%03d]: %s\", j, device_id);\n\t\t\t\t}\n\t\t\t\tif ((uintptr_t)htab_devid.table[j].data > 0) {\n\t\t\t\t\tuuprintf(\"  Matched with Hub[%llu]: '%s'\", (uintptr_t)htab_devid.table[j].data,\n\t\t\t\t\t\t\tdev_if_path.String[(uintptr_t)htab_devid.table[j].data]);\n\t\t\t\t\tif (GetUSBProperties(dev_if_path.String[(uintptr_t)htab_devid.table[j].data], device_id, &props)) {\n\t\t\t\t\t\tmethod_str = \"\";\n\t\t\t\t\t\thub_path = dev_if_path.String[(uintptr_t)htab_devid.table[j].data];\n\t\t\t\t\t}\n#ifdef FORCED_DEVICE\n\t\t\t\t\tprops.vid = FORCED_VID;\n\t\t\t\t\tprops.pid = FORCED_PID;\n\t\t\t\t\tstatic_strcpy(buffer, FORCED_NAME);\n#endif\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Windows has the bad habit of appending \"SCSI Disk Device\" to the description\n\t\t// of UAS devices, which of course screws up detection of device that actually\n\t\t// describe themselves as SCSI-like disks, so replace that with \"UAS Device\".\n\t\tif (props.is_UASP) {\n\t\t\tconst char scsi_disk_device_str[] = \"SCSI Disk Device\";\n\t\t\tconst char uas_device_str[] = \"UAS Device\";\n\t\t\tchar* marker = strstr(buffer, scsi_disk_device_str);\n\t\t\tif (marker != NULL && marker[sizeof(scsi_disk_device_str)] == 0)\n\t\t\t\tmemcpy(marker, uas_device_str, sizeof(uas_device_str));\n\t\t}\n\t\tif (props.is_VHD) {\n\t\t\tuprintf(\"Found VHD device '%s'\", buffer);\n\t\t} else if ((props.is_CARD) && ((!props.is_USB) || ((props.vid == 0) && (props.pid == 0)))) {\n\t\t\tuprintf(\"Found card reader device '%s'\", buffer);\n\t\t} else if ((!props.is_USB) && (!props.is_UASP) && (props.is_Removable)) {\n\t\t\tif (!list_non_usb_removable_drives) {\n\t\t\t\tuprintf(\"Found non-USB removable device '%s' => Eliminated\", buffer);\n\t\t\t\tuuprintf(\"If you *REALLY* need, you can enable listing of this device with <Ctrl><Alt><F>\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tuprintf(\"Found non-USB removable device '%s'\", buffer);\n\t\t} else {\n\t\t\tif (props.vid == -1 || props.pid == -1) {\n\t\t\t\tif (!props.is_USB) {\n\t\t\t\t\t// If we have a non removable SCSI drive and couldn't get a VID:PID,\n\t\t\t\t\t// we are most likely dealing with a system drive => eliminate it!\n\t\t\t\t\tuuprintf(\"Found non-USB non-removable device '%s' => Eliminated\", buffer);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstatic_strcpy(str, \"????:????\");\t// Couldn't figure VID:PID\n\t\t\t} else {\n\t\t\t\tstatic_sprintf(str, \"%04X:%04X\", props.vid, props.pid);\n\t\t\t\t// I *REALLY* don't want to erase the devices below by accident.\n\t\t\t\tif (its_a_me_mario) {\n\t\t\t\t\tif ((props.vid == 0x0525) && (props.pid == 0x622b))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif ((props.vid == 0x0781) && (props.pid == 0x75a0))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif ((props.vid == 0x10d6) && (props.pid == 0x1101))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Also ignore USB devices that have been specifically flagged by the user\n\t\t\t\tfor (s = 0; s < ARRAYSIZE(ignore_vid_pid); s++) {\n\t\t\t\t\tif (ignore_vid_pid[s] != 0 && (props.vid == (ignore_vid_pid[s] >> 16)) &&\n\t\t\t\t\t\t(props.pid == (ignore_vid_pid[s] & 0xffff))) {\n\t\t\t\t\t\tuprintf(\"Ignoring '%s' (%s), per user settings\", buffer, str);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (s < ARRAYSIZE(ignore_vid_pid))\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (props.speed >= USB_SPEED_MAX)\n\t\t\t\tprops.speed = 0;\n\t\t\tuprintf(\"Found %s%s%s device '%s' (%s) %s\", props.is_UASP ? \"UAS (\" : \"\",\n\t\t\t\tusb_speed_name[props.speed], props.is_UASP ? \")\" : \"\", buffer, str, method_str);\n\t\t\tif (props.lower_speed)\n\t\t\t\tuprintf(\"NOTE: This device is a USB 3.%c device operating at lower speed...\", '0' + props.lower_speed - 1);\n\t\t}\n\t\tdevint_data.cbSize = sizeof(devint_data);\n\t\tdevint_detail_data = NULL;\n\t\tfor (j = 0; ; j++) {\n\t\t\tsafe_free(devint_detail_data);\n\n\t\t\tif (!SetupDiEnumDeviceInterfaces(dev_info, &dev_info_data, &GUID_DEVINTERFACE_DISK, j, &devint_data)) {\n\t\t\t\tif(GetLastError() != ERROR_NO_MORE_ITEMS) {\n\t\t\t\t\tuprintf(\"SetupDiEnumDeviceInterfaces failed: %s\", WindowsErrorString());\n\t\t\t\t} else {\n\t\t\t\t\tuprintf(\"A device was eliminated because it didn't report itself as a disk\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (!SetupDiGetDeviceInterfaceDetailA(dev_info, &devint_data, NULL, 0, &size, NULL)) {\n\t\t\t\tif(GetLastError() == ERROR_INSUFFICIENT_BUFFER) {\n\t\t\t\t\tdevint_detail_data = (PSP_DEVICE_INTERFACE_DETAIL_DATA_A)calloc(1, size);\n\t\t\t\t\tif (devint_detail_data == NULL) {\n\t\t\t\t\t\tuprintf(\"Unable to allocate data for SP_DEVICE_INTERFACE_DETAIL_DATA\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdevint_detail_data->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A);\n\t\t\t\t} else {\n\t\t\t\t\tuprintf(\"SetupDiGetDeviceInterfaceDetail (dummy) failed: %s\", WindowsErrorString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (devint_detail_data == NULL) {\n\t\t\t\tuprintf(\"SetupDiGetDeviceInterfaceDetail (dummy) - no data was allocated\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(!SetupDiGetDeviceInterfaceDetailA(dev_info, &devint_data, devint_detail_data, size, &size, NULL)) {\n\t\t\t\tuprintf(\"SetupDiGetDeviceInterfaceDetail (actual) failed: %s\", WindowsErrorString());\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\thDrive = CreateFileWithTimeout(devint_detail_data->DevicePath, GENERIC_READ|GENERIC_WRITE,\n\t\t\t\tFILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL, 3000);\n\t\t\tif(hDrive == INVALID_HANDLE_VALUE) {\n\t\t\t\tuprintf(\"Could not open '%s': %s\", devint_detail_data->DevicePath, WindowsErrorString());\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdrive_number = GetDriveNumber(hDrive, devint_detail_data->DevicePath);\n\t\t\tCloseHandle(hDrive);\n\t\t\tif (drive_number < 0)\n\t\t\t\tcontinue;\n\n\t\t\tdrive_index = drive_number + DRIVE_INDEX_MIN;\n\t\t\tif (!IsMediaPresent(drive_index)) {\n\t\t\t\tuprintf(\"Device eliminated because it appears to contain no media\");\n\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdrive_size = GetDriveSize(drive_index);\n\t\t\tif (drive_size < MIN_DRIVE_SIZE) {\n\t\t\t\tuprintf(\"Device eliminated because it is smaller than %s\", SizeToHumanReadable(MIN_DRIVE_SIZE, FALSE, FALSE));\n\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (GetDriveLabel(drive_index, drive_letters, &label, FALSE)) {\n\t\t\t\tif ((props.is_SCSI) && (!props.is_UASP) && (!props.is_VHD)) {\n\t\t\t\t\tif (!props.is_Removable) {\n\t\t\t\t\t\t// Non removables should have been eliminated above, but since we\n\t\t\t\t\t\t// are potentially dealing with system drives, better safe than sorry\n\t\t\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (!list_non_usb_removable_drives) {\n\t\t\t\t\t\t// Go over the mounted partitions and find if GetDriveType() says they are\n\t\t\t\t\t\t// removable. If they are not removable, don't allow the drive to be listed\n\t\t\t\t\t\tfor (p = drive_letters; *p; p++) {\n\t\t\t\t\t\t\tdrive_name[0] = *p;\n\t\t\t\t\t\t\tif (GetDriveTypeA(drive_name) != DRIVE_REMOVABLE)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (*p) {\n\t\t\t\t\t\t\tuprintf(\"Device eliminated because it contains a mounted partition that is set as non-removable\");\n\t\t\t\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ((!enable_HDDs) && (!props.is_VHD) && (!props.is_CARD) &&\n\t\t\t\t\t((score = IsHDD(drive_index, (uint16_t)props.vid, (uint16_t)props.pid, buffer)) > 0)) {\n\t\t\t\t\tuprintf(\"Device eliminated because it was detected as a Hard Drive or SSD (score %d > 0)\", score);\n\t\t\t\t\tif (!list_non_usb_removable_drives)\n\t\t\t\t\t\tuprintf(\"If this device is not a Hard Drive or SSD, please e-mail the author of this application\");\n\t\t\t\t\tuprintf(\"NOTE: You can enable the listing of Hard Drives under 'advanced drive properties'\");\n\t\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\t\tbreak;\n\t\t\t\t} else if ((!enable_HDDs) && (props.is_CARD) && (drive_size > MAX_DEFAULT_LIST_CARD_SIZE)) {\n\t\t\t\t\tuprintf(\"Device eliminated because it was detected as a card larger than %s\",\n\t\t\t\t\t\tSizeToHumanReadable(MAX_DEFAULT_LIST_CARD_SIZE, FALSE, FALSE));\n\t\t\t\t\tuprintf(\"To use such a card, check 'List USB Hard Drives' under 'advanced drive properties'\");\n\t\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (props.is_VHD && IsMsDevDrive(drive_index)) {\n\t\t\t\t\tuprintf(\"Device eliminated because it was detected as a Microsoft Dev Drive\");\n\t\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (IsFilteredDrive(drive_index)) {\n\t\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// Windows 10 19H1 mounts a 'PortableBaseLayer' for its Windows Sandbox feature => unlist those\n\t\t\t\tif (safe_strcmp(label, windows_sandbox_vhd_label) == 0) {\n\t\t\t\t\tuprintf(\"Device eliminated because it is a Windows Sandbox VHD\");\n\t\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// Bitdefender now uses a special 32 MB VHD\n\t\t\t\tif (props.is_VHD && safe_strcmp(label, bitdefender_label) == 0 && GetDriveSize(drive_index) <= 32 * MB) {\n\t\t\t\t\tuprintf(\"Device eliminated because it is a Bitdefender VHD\");\n\t\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (props.is_VHD && (!enable_VHDs)) {\n\t\t\t\t\tuprintf(\"Device eliminated because listing of VHDs is disabled (Alt-G)\");\n\t\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// The empty string is returned for drives that don't have any volumes assigned\n\t\t\t\tif (drive_letters[0] == 0) {\n\t\t\t\t\tdisplay_name = lmprintf(MSG_046, label, drive_number,\n\t\t\t\t\t\tSizeToHumanReadable(drive_size, FALSE, use_fake_units));\n\t\t\t\t} else {\n\t\t\t\t\t// Find the UEFI:TOGO partition(s) (and eliminate them form our listing)\n\t\t\t\t\tfor (k = 0; drive_letters[k]; k++) {\n\t\t\t\t\t\tuefi_togo_check[0] = drive_letters[k];\n\t\t\t\t\t\tif (PathFileExistsA(uefi_togo_check)) {\n\t\t\t\t\t\t\tfor (l=k; drive_letters[l]; l++)\n\t\t\t\t\t\t\t\tdrive_letters[l] = drive_letters[l+1];\n\t\t\t\t\t\t\tk--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// We have multiple volumes assigned to the same device (multiple partitions)\n\t\t\t\t\t// If that is the case, use \"Multiple Volumes\" instead of the label\n\t\t\t\t\tstatic_strcpy(display_msg, (((drive_letters[0] != 0) && (drive_letters[1] != 0))?\n\t\t\t\t\t\tlmprintf(MSG_047):label));\n\t\t\t\t\tfor (k=0, remove_drive=0; drive_letters[k] && (!remove_drive); k++) {\n\t\t\t\t\t\t// Append all the drive letters we detected\n\t\t\t\t\t\tletter_name[2] = drive_letters[k];\n\t\t\t\t\t\tif (right_to_left_mode)\n\t\t\t\t\t\t\tstatic_strcat(display_msg, RIGHT_TO_LEFT_MARK);\n\t\t\t\t\t\tstatic_strcat(display_msg, letter_name);\n\t\t\t\t\t\tif (drive_letters[k] == (PathGetDriveNumberU(app_dir) + 'A'))\n\t\t\t\t\t\t\tremove_drive = 1;\n\t\t\t\t\t\tif (drive_letters[k] == (PathGetDriveNumberU(system_dir) + 'A'))\n\t\t\t\t\t\t\tremove_drive = 2;\n\t\t\t\t\t}\n\t\t\t\t\t// Make sure that we don't list any drive that should not be listed\n\t\t\t\t\tif (remove_drive) {\n\t\t\t\t\t\tuprintf(\"Removing %c: from the list: This is the %s!\", toupper(drive_letters[--k]),\n\t\t\t\t\t\t\t(remove_drive==1)?\"disk from which \" APPLICATION_NAME \" is running\":\"system disk\");\n\t\t\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsafe_sprintf(&display_msg[strlen(display_msg)], sizeof(display_msg) - strlen(display_msg) - 1,\n\t\t\t\t\t\t\"%s [%s]\", (right_to_left_mode) ? RIGHT_TO_LEFT_MARK : \"\",\n\t\t\t\t\t\tSizeToHumanReadable(drive_size, FALSE, use_fake_units));\n\t\t\t\t\tdisplay_name = display_msg;\n\t\t\t\t}\n\n\t\t\t\trufus_drive[num_drives].index = drive_index;\n\t\t\t\trufus_drive[num_drives].id = safe_strdup(device_instance_id);\n\t\t\t\trufus_drive[num_drives].name = safe_strdup(buffer);\n\t\t\t\trufus_drive[num_drives].display_name = safe_strdup(display_name);\n\t\t\t\trufus_drive[num_drives].label = safe_strdup(label);\n\t\t\t\trufus_drive[num_drives].size = drive_size;\n\t\t\t\tif_assert_fails(rufus_drive[num_drives].size != 0)\n\t\t\t\t\tbreak;\n\t\t\t\tif (hub_path != NULL) {\n\t\t\t\t\trufus_drive[num_drives].hub = safe_strdup(hub_path);\n\t\t\t\t\trufus_drive[num_drives].port = props.port;\n\t\t\t\t}\n\t\t\t\tnum_drives++;\n\t\t\t\tif (num_drives >= MAX_DRIVES)\n\t\t\t\t\tuprintf(\"WARNING: Found more than %d drives - ignoring remaining ones...\", MAX_DRIVES);\n\t\t\t\tsafe_free(devint_detail_data);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tSetupDiDestroyDeviceInfoList(dev_info);\n\n\t// Reorder the drives by increasing size, using the \"selection sort\" algorithm\n\tfor (u = 0; u < num_drives - 1; u++) {\n\t\tuint64_t min_drive_size = rufus_drive[u].size;\n\t\tint min_index = u;\n\t\tfor (v = u + 1; v < num_drives; v++) {\n\t\t\tif (rufus_drive[v].size < min_drive_size) {\n\t\t\t\tmin_drive_size = rufus_drive[v].size;\n\t\t\t\tmin_index = v;\n\t\t\t}\n\t\t}\n\t\tif (min_index != u) {\n\t\t\tRUFUS_DRIVE tmp;\n\t\t\tmemcpy(&tmp, &rufus_drive[u], sizeof(RUFUS_DRIVE));\n\t\t\tmemcpy(&rufus_drive[u], &rufus_drive[min_index], sizeof(RUFUS_DRIVE));\n\t\t\tmemcpy(&rufus_drive[min_index], &tmp, sizeof(RUFUS_DRIVE));\n\t\t}\n\t}\n\n\t// Now populate the drive combo box\n\t// NB: The combo box must have the UNSORTED attribute for indexes to remain the ones we assign\n\tfor (u = 0; u < num_drives; u++) {\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hDeviceList, ComboBox_AddStringU(hDeviceList, rufus_drive[u].display_name), rufus_drive[u].index));\n\t\tmaxwidth = max(maxwidth, GetEntryWidth(hDeviceList, rufus_drive[u].display_name));\n\t}\n\t// Adjust the Dropdown width to the maximum text size\n\tSendMessage(hDeviceList, CB_SETDROPPEDWIDTH, (WPARAM)maxwidth, 0);\n\n\tif (devnum >= DRIVE_INDEX_MIN) {\n\t\tfor (i = 0; i < ComboBox_GetCount(hDeviceList); i++) {\n\t\t\tif ((DWORD)ComboBox_GetItemData(hDeviceList, i) == devnum) {\n\t\t\t\tfound = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (!found)\n\t\ti = 0;\n\tIGNORE_RETVAL(ComboBox_SetCurSel(hDeviceList, i));\n\tSendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE<<16) | IDC_DEVICE, 0);\n\tr = TRUE;\n\nout:\n\t// Set 'Start' as the selected button, so that tab selection works\n\tSendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hMainDialog, IDC_START), TRUE);\n\tsafe_free(devid_list);\n\tStrArrayDestroy(&dev_if_path);\n\thtab_destroy(&htab_devid);\n\treturn r;\n}\n"
  },
  {
    "path": "src/dev.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Device detection and enumeration\n * Copyright © 2014-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <windows.h>\n#include <cfgmgr32.h>\n\n#define USB_SPEED_UNKNOWN\t\t\t0\n#define USB_SPEED_LOW\t\t\t\t1\n#define USB_SPEED_FULL\t\t\t\t2\n#define USB_SPEED_HIGH\t\t\t\t3\n#define USB_SPEED_SUPER\t\t\t\t4\n#define USB_SPEED_SUPER_PLUS\t\t5\n#define USB_SPEED_MAX\t\t\t\t6\n\n/* List of the properties we are interested in */\ntypedef struct usb_device_props {\n\tint32_t  vid;\n\tint32_t  pid;\n\tuint32_t  speed;\n\tuint32_t  lower_speed;\n\tuint32_t  port;\n\tBOOLEAN   is_USB;\n\tBOOLEAN   is_SCSI;\n\tBOOLEAN   is_CARD;\n\tBOOLEAN   is_UASP;\n\tBOOLEAN   is_VHD;\n\tBOOLEAN   is_Removable;\n} usb_device_props;\n\n/*\n * Windows DDK API definitions. Most of it copied from MinGW's includes\n */\ntypedef enum USB_CONNECTION_STATUS {\n\tNoDeviceConnected,\n\tDeviceConnected,\n\tDeviceFailedEnumeration,\n\tDeviceGeneralFailure,\n\tDeviceCausedOvercurrent,\n\tDeviceNotEnoughPower,\n\tDeviceNotEnoughBandwidth,\n\tDeviceHubNestedTooDeeply,\n\tDeviceInLegacyHub\n} USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS;\n\ntypedef enum USB_HUB_NODE {\n\tUsbHub,\n\tUsbMIParent\n} USB_HUB_NODE;\n\n#define USB_HUB_CYCLE_PORT                        273\n#define USB_GET_NODE_CONNECTION_INFORMATION_EX    274\n#define USB_GET_NODE_CONNECTION_INFORMATION_EX_V2 279\n\n#define IOCTL_USB_HUB_CYCLE_PORT \\\n  CTL_CODE(FILE_DEVICE_UNKNOWN, USB_HUB_CYCLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS)\n#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX \\\n  CTL_CODE(FILE_DEVICE_UNKNOWN, USB_GET_NODE_CONNECTION_INFORMATION_EX, METHOD_BUFFERED, FILE_ANY_ACCESS)\n#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX_V2 \\\n  CTL_CODE(FILE_DEVICE_UNKNOWN, USB_GET_NODE_CONNECTION_INFORMATION_EX_V2, METHOD_BUFFERED, FILE_ANY_ACCESS)\n\n/* Most of the structures below need to be packed */\n#pragma pack(push, 1)\n\ntypedef struct _USB_DEVICE_DESCRIPTOR {\n\tUCHAR  bLength;\n\tUCHAR  bDescriptorType;\n\tUSHORT bcdUSB;\n\tUCHAR  bDeviceClass;\n\tUCHAR  bDeviceSubClass;\n\tUCHAR  bDeviceProtocol;\n\tUCHAR  bMaxPacketSize0;\n\tUSHORT idVendor;\n\tUSHORT idProduct;\n\tUSHORT bcdDevice;\n\tUCHAR  iManufacturer;\n\tUCHAR  iProduct;\n\tUCHAR  iSerialNumber;\n\tUCHAR  bNumConfigurations;\n} USB_DEVICE_DESCRIPTOR, *PUSB_DEVICE_DESCRIPTOR;\n\ntypedef struct USB_NODE_CONNECTION_INFORMATION_EX {\n\tULONG ConnectionIndex;\n\tUSB_DEVICE_DESCRIPTOR DeviceDescriptor;\n\tUCHAR CurrentConfigurationValue;\n\tUCHAR Speed;\n\tBOOLEAN DeviceIsHub;\n\tUSHORT DeviceAddress;\n\tULONG NumberOfOpenPipes;\n\tUSB_CONNECTION_STATUS ConnectionStatus;\n//\tUSB_PIPE_INFO PipeList[0];\n} USB_NODE_CONNECTION_INFORMATION_EX, *PUSB_NODE_CONNECTION_INFORMATION_EX;\n\ntypedef union _USB_PROTOCOLS {\n\tULONG  ul;\n\tstruct {\n\t\tULONG Usb110:1;\n\t\tULONG Usb200:1;\n\t\tULONG Usb300:1;\n\t\tULONG ReservedMBZ:29;\n\t};\n} USB_PROTOCOLS, *PUSB_PROTOCOLS;\n\ntypedef union _USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS {\n\tULONG ul;\n\tstruct {\n\t\tULONG DeviceIsOperatingAtSuperSpeedOrHigher:1;\n\t\tULONG DeviceIsSuperSpeedCapableOrHigher:1;\n\t\tULONG DeviceIsOperatingAtSuperSpeedPlusOrHigher : 1;\n\t\tULONG DeviceIsSuperSpeedPlusCapableOrHigher : 1;\n\t\tULONG ReservedMBZ:28;\n\t};\n} USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS, *PUSB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS;\n\ntypedef struct _USB_NODE_CONNECTION_INFORMATION_EX_V2 {\n\tULONG ConnectionIndex;\n\tULONG Length;\n\tUSB_PROTOCOLS SupportedUsbProtocols;\n\tUSB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS Flags;\n} USB_NODE_CONNECTION_INFORMATION_EX_V2, *PUSB_NODE_CONNECTION_INFORMATION_EX_V2;\n\ntypedef struct {\n\tULONG ConnectionIndex;\n\tULONG StatusReturned;\n} USB_CYCLE_PORT_PARAMS;\n\n#pragma pack(pop)\n\nconst GUID GUID_DEVINTERFACE_USB_HUB =\n\t{ 0xf18a0e88L, 0xc30c, 0x11d0, {0x88, 0x15, 0x00, 0xa0, 0xc9, 0x06, 0xbe, 0xd8} };\n\n#define DEVID_HTAB_SIZE\t\t257\n"
  },
  {
    "path": "src/dos.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * DOS boot file extraction, from the FAT12 floppy image in diskcopy.dll\n * (MS WinME DOS) or from the embedded FreeDOS resource files\n * Copyright © 2011-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <windowsx.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"rufus.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n\n#include \"dos.h\"\n\nstatic BYTE* DiskImage = NULL;\nstatic DWORD DiskImageSize;\n\n/*\n * FAT time conversion, from ReactOS' time.c\n */\n#define TICKSPERMIN        600000000\n#define TICKSPERSEC        10000000\n#define TICKSPERMSEC       10000\n#define SECSPERDAY         86400\n#define SECSPERHOUR        3600\n#define SECSPERMIN         60\n#define MINSPERHOUR        60\n#define HOURSPERDAY        24\n#define EPOCHWEEKDAY       1\n#define DAYSPERWEEK        7\n#define EPOCHYEAR          1601\n#define DAYSPERNORMALYEAR  365\n#define DAYSPERLEAPYEAR    366\n#define MONSPERYEAR        12\n\ntypedef struct _TIME_FIELDS {\n\tshort Year;\n\tshort Month;\n\tshort Day;\n\tshort Hour;\n\tshort Minute;\n\tshort Second;\n\tshort Milliseconds;\n} TIME_FIELDS, *PTIME_FIELDS;\n\n#define ARGUMENT_PRESENT(ArgumentPointer) \\\n\t((CHAR*)((ULONG_PTR)(ArgumentPointer)) != (CHAR*)NULL)\n\nstatic const UCHAR MonthLengths[2][MONSPERYEAR] =\n{\n\t{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },\n\t{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }\n};\n\nstatic __inline int IsLeapYear(int Year)\n{\n\treturn Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) ? 1 : 0;\n}\n\nstatic int DaysSinceEpoch(int Year)\n{\n\tint Days;\n\tYear--; /* Don't include a leap day from the current year */\n\tDays = Year * DAYSPERNORMALYEAR + Year / 4 - Year / 100 + Year / 400;\n\tDays -= (EPOCHYEAR - 1) * DAYSPERNORMALYEAR + (EPOCHYEAR - 1) / 4 - (EPOCHYEAR - 1) / 100 + (EPOCHYEAR - 1) / 400;\n\treturn Days;\n}\n\nstatic BOOLEAN RtlTimeFieldsToTime(PTIME_FIELDS TimeFields, PLARGE_INTEGER Time)\n{\n\tint CurMonth;\n\tTIME_FIELDS IntTimeFields;\n\n\tmemcpy(&IntTimeFields,\n\t\tTimeFields,\n\t\tsizeof(TIME_FIELDS));\n\n\tif (TimeFields->Milliseconds < 0 || TimeFields->Milliseconds > 999 ||\n\t\tTimeFields->Second < 0 || TimeFields->Second > 59 ||\n\t\tTimeFields->Minute < 0 || TimeFields->Minute > 59 ||\n\t\tTimeFields->Hour < 0 || TimeFields->Hour > 23 ||\n\t\tTimeFields->Month < 1 || TimeFields->Month > 12 ||\n\t\tTimeFields->Day < 1 ||\n\t\tTimeFields->Day >\n\t\tMonthLengths[IsLeapYear(TimeFields->Year)][TimeFields->Month - 1] ||\n\t\tTimeFields->Year < 1601) {\n\t\treturn FALSE;\n\t}\n\n\t/* Compute the time */\n\tTime->QuadPart = DaysSinceEpoch(IntTimeFields.Year);\n\tfor (CurMonth = 1; CurMonth < IntTimeFields.Month; CurMonth++) {\n\t\tTime->QuadPart += MonthLengths[IsLeapYear(IntTimeFields.Year)][CurMonth - 1];\n\t}\n\tTime->QuadPart += IntTimeFields.Day - 1;\n\tTime->QuadPart *= SECSPERDAY;\n\tTime->QuadPart += IntTimeFields.Hour * SECSPERHOUR + IntTimeFields.Minute * SECSPERMIN +\n\t\tIntTimeFields.Second;\n\tTime->QuadPart *= TICKSPERSEC;\n\tTime->QuadPart += IntTimeFields.Milliseconds * TICKSPERMSEC;\n\n\treturn TRUE;\n}\n\nstatic void FatDateTimeToSystemTime(PLARGE_INTEGER SystemTime, PFAT_DATETIME FatDateTime, UCHAR TenMs OPTIONAL)\n{\n\tTIME_FIELDS TimeFields;\n\n\t/* Setup time fields */\n\tTimeFields.Year = FatDateTime->Date.Year + 1980;\n\tTimeFields.Month = FatDateTime->Date.Month;\n\tTimeFields.Day = FatDateTime->Date.Day;\n\tTimeFields.Hour = FatDateTime->Time.Hour;\n\tTimeFields.Minute = FatDateTime->Time.Minute;\n\tTimeFields.Second = (FatDateTime->Time.DoubleSeconds << 1);\n\n\t/* Adjust up to 10 milliseconds\n\t* if the parameter was supplied\n\t*/\n\tif (ARGUMENT_PRESENT(TenMs)) {\n\t\tTimeFields.Second += TenMs / 100;\n\t\tTimeFields.Milliseconds = (TenMs % 100) * 10;\n\t} else {\n\t\tTimeFields.Milliseconds = 0;\n\t}\n\n\t/* Fix seconds value that might get beyond the bound */\n\tif (TimeFields.Second > 59)\n\t\tTimeFields.Second = 0;\n\n\t/* Perform conversion to system time if possible */\n\tif (!RtlTimeFieldsToTime(&TimeFields, SystemTime)) {\n\t\t/* Set to default time if conversion failed */\n\t\tSystemTime->QuadPart = 0;\n\t}\n}\n\n/* http://www.multiboot.ru/msdos8.htm & http://en.wikipedia.org/wiki/Windows_Me#Real_mode_DOS\n * COMMAND.COM and IO.SYS from diskcopy.dll are from the WinME crippled version\n * that removed real mode DOS => they must be patched:\n * IO.SYS            000003AA          75 -> EB\n * COMMAND.COM       00006510          75 -> EB\n */\nstatic BOOL Patch_COMMAND_COM(size_t filestart, size_t filesize)\n{\n\tconst BYTE expected[8] = { 0x15, 0x80, 0xFA, 0x03, 0x75, 0x10, 0xB8, 0x0E };\n\n\tuprintf(\"Patching COMMAND.COM...\");\n\tif (filesize != 93040) {\n\t\tuprintf(\"  unexpected file size\");\n\t\treturn FALSE;\n\t}\n\tif (memcmp(&DiskImage[filestart+0x650c], expected, sizeof(expected)) != 0) {\n\t\tuprintf(\"  unexpected binary data\");\n\t\treturn FALSE;\n\t}\n\tDiskImage[filestart+0x6510] = 0xeb;\n\treturn TRUE;\n}\n\nstatic BOOL Patch_IO_SYS(size_t filestart, size_t filesize)\n{\n\tconst BYTE expected[8] = { 0xFA, 0x80, 0x75, 0x09, 0x8D, 0xB6, 0x99, 0x00 };\n\n\tuprintf(\"Patching IO.SYS...\");\n\tif (filesize != 116736) {\n\t\tuprintf(\"  unexpected file size\");\n\t\treturn FALSE;\n\t}\n\tif (memcmp(&DiskImage[filestart+0x3a8], expected, sizeof(expected)) != 0) {\n\t\tuprintf(\"  unexpected binary data\");\n\t\treturn FALSE;\n\t}\n\tDiskImage[filestart+0x3aa] = 0xeb;\n\treturn TRUE;\n}\n\n/* Extract the file identified by FAT RootDir index 'entry' to 'path' */\nstatic BOOL ExtractFAT(int entry, const char* path)\n{\n\tHANDLE hFile;\n\tDWORD Size;\n\tchar filename[MAX_PATH];\n\tsize_t i, pos, fnamepos;\n\tsize_t filestart, filesize;\n\tFAT_DATETIME LastAccessTime;\n\tLARGE_INTEGER liCreationTime, liLastAccessTime, liLastWriteTime;\n\tFILETIME ftCreationTime, ftLastAccessTime, ftLastWriteTime;\n\tPDIR_ENTRY dir_entry = (PDIR_ENTRY)&DiskImage[FAT12_ROOTDIR_OFFSET + entry*FAT_BYTES_PER_DIRENT];\n\n\tif ((path == NULL) || ((safe_strlen(path) + 14) > sizeof(filename))) {\n\t\tuprintf(\"invalid path supplied for MS-DOS FAT extraction\");\n\t\treturn FALSE;\n\t}\n\tstatic_strcpy(filename, path);\n\tpos = strlen(path);\n\tfnamepos = pos;\n\n\tfor(i=0; i<8; i++) {\n\t\tif (dir_entry->FileName[i] == ' ')\n\t\t\tbreak;\n\t\tfilename[pos++] = dir_entry->FileName[i];\n\t}\n\tfilename[pos++] = '.';\n\tfor (i=8; i<11; i++) {\n\t\tif (dir_entry->FileName[i] == ' ')\n\t\t\tbreak;\n\t\tfilename[pos++] = dir_entry->FileName[i];\n\t}\n\tfilename[pos] = 0;\n\tfilestart = (dir_entry->FirstCluster + FAT12_CLUSTER_OFFSET)*FAT12_CLUSTER_SIZE;\n\tfilesize = dir_entry->FileSize;\n\tif ((filestart + filesize) > DiskImageSize) {\n\t\tuprintf(\"FAT File %s would be out of bounds: %zX, %zX\", filename, filestart, filesize);\n\t\tuprintf(\"%X, %X\", dir_entry->FirstCluster, dir_entry->FileSize);\n\t\treturn FALSE;\n\t}\n\n\t/* WinME DOS files need to be patched */\n\tif (strcmp(&filename[fnamepos], \"COMMAND.COM\") == 0) {\n\t\tPatch_COMMAND_COM(filestart, filesize);\n\t} else if (strcmp(&filename[fnamepos], \"IO.SYS\") == 0) {\n\t\tPatch_IO_SYS(filestart, filesize);\n\t}\n\n\t/* Create a file, using the same attributes as found in the FAT */\n\thFile = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ,\n\t\tNULL, CREATE_ALWAYS, dir_entry->Attributes, NULL);\n\tif (hFile == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Unable to create file '%s': %s.\", filename, WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\n\tif (!WriteFileWithRetry(hFile, &DiskImage[filestart], (DWORD)filesize, &Size, WRITE_RETRIES)) {\n\t\tuprintf(\"Could not write file '%s': %s.\", filename, WindowsErrorString());\n\t\tsafe_closehandle(hFile);\n\t\treturn FALSE;\n\t}\n\n\t/* Restore timestamps from FAT */\n\tFatDateTimeToSystemTime(&liCreationTime, &dir_entry->CreationDateTime, dir_entry->CreationTimeTenMs);\n\tftCreationTime.dwHighDateTime = liCreationTime.HighPart;\n\tftCreationTime.dwLowDateTime = liCreationTime.LowPart;\n\tLastAccessTime.Value = 0;\n\tLastAccessTime.Date = dir_entry->LastAccessDate;\n\tFatDateTimeToSystemTime(&liLastAccessTime, &LastAccessTime, 0);\n\tftLastAccessTime.dwHighDateTime = liLastAccessTime.HighPart;\n\tftLastAccessTime.dwLowDateTime = liLastAccessTime.LowPart;\n\tFatDateTimeToSystemTime(&liLastWriteTime, &dir_entry->LastWriteDateTime, 0);\n\tftLastWriteTime.dwHighDateTime = liLastWriteTime.HighPart;\n\tftLastWriteTime.dwLowDateTime = liLastWriteTime.LowPart;\n\tif (!SetFileTime(hFile, &ftCreationTime, &ftLastAccessTime, &ftLastWriteTime)) {\n\t\tuprintf(\"Could not set timestamps: %s\\n\", WindowsErrorString());\n\t}\n\n\tsafe_closehandle(hFile);\n\tuprintf(\"Successfully wrote '%s' (%zu bytes)\", filename, filesize);\n\n\treturn TRUE;\n}\n\n/* Extract the MS-DOS files contained in the FAT12 1.4MB floppy\n   image included as resource \"BINFILE\" in diskcopy.dll */\nstatic BOOL ExtractMSDOS(const char* path)\n{\n\tint i, j;\n\tBOOL r = FALSE;\n\tDWORD size = DISKCOPY_SIZE;\n\tHANDLE dll_handle = INVALID_HANDLE_VALUE;\n\tuint8_t* diskcopy_buffer;\n\tchar locale_path[MAX_PATH];\n\tchar diskcopy_dll_path[MAX_PATH];\n\tchar* extractlist[] = { \"MSDOS   SYS\", \"COMMAND COM\", \"IO      SYS\", \"MODE    COM\",\n\t\t\"KEYB    COM\", \"KEYBOARDSYS\", \"KEYBRD2 SYS\", \"KEYBRD3 SYS\", \"KEYBRD4 SYS\",\n\t\t\"DISPLAY SYS\", \"EGA     CPI\", \"EGA2    CPI\", \"EGA3    CPI\" };\n\n\tif (path == NULL || (diskcopy_buffer = malloc(DISKCOPY_SIZE)) == NULL)\n\t\treturn FALSE;\n\n\t// There should be a diskcopy.dll in the user's AppData directory.\n\t// Since we're working with a known copy of diskcopy.dll, just load it in memory\n\t// (after locking and validating it) and point to the known disk image resource buffer.\n\tstatic_sprintf(diskcopy_dll_path, \"%s\\\\%s\\\\diskcopy.dll\", app_data_dir, FILES_DIR);\n\tdll_handle = CreateFileU(diskcopy_dll_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n\tif (dll_handle == INVALID_HANDLE_VALUE || !ReadFile(dll_handle, diskcopy_buffer, size, &size, NULL) ||\n\t\tsize != DISKCOPY_SIZE || !BufferMatchesHash(diskcopy_buffer, size, DISKCOPY_HASH)) {\n\t\tuprintf(\"'diskcopy.dll' was either not found or is invalid\");\n\t\tgoto out;\n\t}\n\tDiskImage = &diskcopy_buffer[DISKCOPY_IMAGE_OFFSET];\n\tDiskImageSize = DISKCOPY_IMAGE_SIZE;\n\n\t// Reduce the visible mess by placing all the locale files into a subdir\n\tstatic_strcpy(locale_path, path);\n\tstatic_strcat(locale_path, \"LOCALE\\\\\");\n\tCreateDirectoryA(locale_path, NULL);\n\n\tfor (i = 0, r = TRUE; r && i < FAT_FN_DIR_ENTRY_LAST; i++) {\n\t\tif (DiskImage[FAT12_ROOTDIR_OFFSET + i * FAT_BYTES_PER_DIRENT] == FAT_DIRENT_DELETED)\n\t\t\tcontinue;\n\t\tfor (j = 0; r && j < ARRAYSIZE(extractlist); j++) {\n\t\t\tif (memcmp(extractlist[j], &DiskImage[FAT12_ROOTDIR_OFFSET + i * FAT_BYTES_PER_DIRENT], 8 + 3) == 0) {\n\t\t\t\tr = ExtractFAT(i, (j < 3) ? path : locale_path);\n\t\t\t\tif ((j == 2) || (j == 7) || (j == 12))\n\t\t\t\t\tUpdateProgress(OP_FILE_COPY, -1.0f);\n\t\t\t}\n\t\t}\n\t}\n\tif (r)\n\t\tr = SetDOSLocale(path, FALSE);\n\nout:\n\tsafe_closehandle(dll_handle);\n\tsafe_free(diskcopy_buffer);\n\treturn r;\n}\n\n/* Extract the FreeDOS files embedded in the app */\nBOOL ExtractFreeDOS(const char* path)\n{\n\tconst char* res_name[] = { \"COMMAND.COM\", \"KERNEL.SYS\", \"DISPLAY.EXE\", \"KEYB.EXE\",\n\t\t\"MODE.COM\", \"KEYBOARD.SYS\", \"KEYBRD2.SYS\", \"KEYBRD3.SYS\", \"KEYBRD4.SYS\", \"EGA.CPX\",\n\t\t\"EGA2.CPX\", \"EGA3.CPX\", \"EGA4.CPX\", \"EGA5.CPX\", \"EGA6.CPX\",\n\t\t\"EGA7.CPX\", \"EGA8.CPX\", \"EGA9.CPX\", \"EGA10.CPX\", \"EGA11.CPX\",\n\t\t\"EGA12.CPX\", \"EGA13.CPX\", \"EGA14.CPX\", \"EGA15.CPX\", \"EGA16.CPX\",\n\t\t\"EGA17.CPX\", \"EGA18.CPX\" };\n\tconst int res_id[ARRAYSIZE(res_name)] = { IDR_FD_COMMAND_COM, IDR_FD_KERNEL_SYS, IDR_FD_DISPLAY_EXE, IDR_FD_KEYB_EXE,\n\t\tIDR_FD_MODE_COM, IDR_FD_KB1_SYS, IDR_FD_KB2_SYS, IDR_FD_KB3_SYS, IDR_FD_KB4_SYS, IDR_FD_EGA1_CPX,\n\t\tIDR_FD_EGA2_CPX, IDR_FD_EGA3_CPX, IDR_FD_EGA4_CPX, IDR_FD_EGA5_CPX, IDR_FD_EGA6_CPX,\n\t\tIDR_FD_EGA7_CPX, IDR_FD_EGA8_CPX, IDR_FD_EGA9_CPX, IDR_FD_EGA10_CPX, IDR_FD_EGA11_CPX,\n\t\tIDR_FD_EGA12_CPX, IDR_FD_EGA13_CPX, IDR_FD_EGA14_CPX, IDR_FD_EGA15_CPX, IDR_FD_EGA16_CPX,\n\t\tIDR_FD_EGA17_CPX, IDR_FD_EGA18_CPX };\n\tchar filename[MAX_PATH], locale_path[MAX_PATH];\n\tBYTE* res_data;\n\tDWORD res_size;\n\tHANDLE hFile;\n\tint i;\n\n\tif ((path == NULL) || ((safe_strlen(path) + 14) > sizeof(filename))) {\n\t\tuprintf(\"invalid path supplied for FreeDOS extraction\");\n\t\treturn FALSE;\n\t}\n\n\t// Reduce the visible mess by placing all the locale files into a subdir\n\tstatic_strcpy(locale_path, path);\n\tstatic_strcat(locale_path, \"LOCALE\\\\\");\n\tCreateDirectoryA(locale_path, NULL);\n\n\tfor (i = 0; i < ARRAYSIZE(res_name); i++) {\n\t\tres_data = (BYTE*)GetResource(hMainInstance, MAKEINTRESOURCEA(res_id[i]), _RT_RCDATA, res_name[i], &res_size, FALSE);\n\n\t\tstatic_strcpy(filename, ((i<2) ? path : locale_path));\n\t\tstatic_strcat(filename, res_name[i]);\n\n\t\thFile = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, NULL,\n\t\t\tCREATE_ALWAYS, (i<2)?(FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM):FILE_ATTRIBUTE_NORMAL, NULL);\n\t\tif ((hFile == NULL) || (hFile == INVALID_HANDLE_VALUE)) {\n\t\t\tuprintf(\"Unable to create file '%s': %s.\", filename, WindowsErrorString());\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif (!WriteFileWithRetry(hFile, res_data, res_size, NULL, WRITE_RETRIES)) {\n\t\t\tuprintf(\"Could not write file '%s': %s.\", filename, WindowsErrorString());\n\t\t\tsafe_closehandle(hFile);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// We don't restore timestamps for FreeDOS, as there's no metadata in the files,\n\t\t// thus we would need to have a separate header with each file's timestamps\n\n\t\tsafe_closehandle(hFile);\n\t\tuprintf(\"Successfully wrote '%s' (%d bytes)\", filename, res_size);\n\n\t\tif ((i == 4) || (i == 10) || (i == 16) || (i == 22) || (i == ARRAYSIZE(res_name)-1))\n\t\t\tUpdateProgress(OP_FILE_COPY, -1.0f);\n\t}\n\n\treturn SetDOSLocale(path, TRUE);\n}\n\nBOOL ExtractDOS(const char* path)\n{\n\tswitch(ComboBox_GetCurItemData(hBootType)) {\n\tcase BT_MSDOS:\n\t\treturn ExtractMSDOS(path);\n\tcase BT_FREEDOS:\n\t\treturn ExtractFreeDOS(path);\n\t}\n\treturn FALSE;\n}\n"
  },
  {
    "path": "src/dos.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * MS-DOS boot file extraction, from the FAT12 floppy image in diskcopy.dll\n * Copyright © 2011-2013 Pete Batard <pete@akeo.ie>\n * \n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* http://www.c-jump.com/CIS24/Slides/FAT/lecture.html\n   Ideally, we'd read the following from the FAT Boot Sector, but we have\n   a pretty good idea of what they are for a 1.44 MB floppy image */\n#define FAT12_ROOTDIR_OFFSET        0x2600\n#define FAT12_CLUSTER_SIZE          0x200\t// = sector size\n#define FAT12_DATA_START            0x4200\n#define FAT12_CLUSTER_OFFSET        ((FAT12_DATA_START/FAT12_CLUSTER_SIZE)-2)\t// First cluster in data area is #2\n\n/* \n * Lifted from ReactOS:\n * http://reactos-mirror.googlecode.com/svn/trunk/reactos/drivers/filesystems/fastfat_new/fat.h\n */\n\n#pragma pack(push, 1)\t// You *DO* want packed structs here\n\n//\n//  Directory Structure:\n//\ntypedef struct _FAT_TIME\n{\n    union {\n        struct {\n            USHORT DoubleSeconds : 5;\n            USHORT Minute : 6;\n            USHORT Hour : 5;\n        };\n        USHORT Value;\n    };\n} FAT_TIME, *PFAT_TIME;\n//\n//\n//\ntypedef struct _FAT_DATE {\n    union {\n        struct {\n            USHORT Day : 5;\n            USHORT Month : 4;\n            /* Relative to 1980 */\n            USHORT Year : 7;\n        };\n        USHORT Value;\n    };\n} FAT_DATE, *PFAT_DATE;\n//\n//\n//\ntypedef struct _FAT_DATETIME {\n    union {\n        struct {\n            FAT_TIME    Time;\n            FAT_DATE    Date;\n        };\n        ULONG Value;\n    };\n} FAT_DATETIME, *PFAT_DATETIME;\n//\n//\n//\ntypedef struct _DIR_ENTRY\n{\n    UCHAR FileName[11];\n    UCHAR Attributes;\n    UCHAR Case;\n    UCHAR CreationTimeTenMs;\n    FAT_DATETIME CreationDateTime;\n    FAT_DATE LastAccessDate;\n    union {\n        USHORT ExtendedAttributes;\n        USHORT FirstClusterOfFileHi;\n    };\n    FAT_DATETIME LastWriteDateTime;\n    USHORT FirstCluster;\n    ULONG FileSize;\n} DIR_ENTRY, *PDIR_ENTRY;\n//  sizeof = 0x020\n\ntypedef struct _LONG_FILE_NAME_ENTRY {\n    UCHAR SeqNum;\n    UCHAR NameA[10];\n    UCHAR Attributes;\n    UCHAR Type;\n    UCHAR Checksum;\n    USHORT NameB[6];\n    USHORT Reserved;\n    USHORT NameC[2];\n} LONG_FILE_NAME_ENTRY, *PLONG_FILE_NAME_ENTRY;\n//  sizeof = 0x020\n\n#pragma pack(pop)\n\n#define FAT_LFN_NAME_LENGTH \\\n    (RTL_FIELD_SIZE(LONG_FILE_NAME_ENTRY, NameA) \\\n        + RTL_FIELD_SIZE(LONG_FILE_NAME_ENTRY, NameB) \\\n        + RTL_FIELD_SIZE(LONG_FILE_NAME_ENTRY, NameC))\n\n#define FAT_FN_DIR_ENTRY_LAST       0x40\n#define FAT_FN_MAX_DIR_ENTIES       0x14\n\n#define FAT_BYTES_PER_DIRENT        0x20\n#define FAT_BYTES_PER_DIRENT_LOG    0x05\n#define FAT_DIRENT_NEVER_USED       0x00\n#define FAT_DIRENT_REALLY_0E5       0x05\n#define FAT_DIRENT_DIRECTORY_ALIAS  0x2e\n#define FAT_DIRENT_DELETED          0xe5\n\n#define FAT_CASE_LOWER_BASE\t        0x08\n#define FAT_CASE_LOWER_EXT \t        0x10\n\n#define FAT_DIRENT_ATTR_READ_ONLY        0x01\n#define FAT_DIRENT_ATTR_HIDDEN           0x02\n#define FAT_DIRENT_ATTR_SYSTEM           0x04\n#define FAT_DIRENT_ATTR_VOLUME_ID        0x08\n#define FAT_DIRENT_ATTR_DIRECTORY        0x10\n#define FAT_DIRENT_ATTR_ARCHIVE          0x20\n#define FAT_DIRENT_ATTR_DEVICE           0x40\n#define FAT_DIRENT_ATTR_LFN              (FAT_DIRENT_ATTR_READ_ONLY | \\\n                                          FAT_DIRENT_ATTR_HIDDEN |    \\\n                                          FAT_DIRENT_ATTR_SYSTEM |    \\\n                                          FAT_DIRENT_ATTR_VOLUME_ID)\n\nextern BOOL SetDOSLocale(const char* path, BOOL bFreeDOS);\n"
  },
  {
    "path": "src/dos_locale.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * DOS keyboard locale setup\n * Copyright © 2011-2024 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <stdio.h>\n#include <string.h>\n#include <assert.h>\n\n#include \"rufus.h\"\n\n#if defined(_MSC_VER)\n// We have a bunch of \\xCD characters in this file that MS doesn't like\n#pragma warning(disable: 4819)\n#endif\n\n/*\n * Note: if you want a book that can be used as a keyboards and codepages bible, I\n * would recommend the \"OS/2 Warp Server for e-business - Keyboards and Codepages\".\n * See http://www.borgendale.com/keyboard.pdf\n */\n\n/* WinME DOS keyboard 2 letter codes & supported keyboard ID(s), as retrieved\n * from the Millennium disk image in diskcopy.dll on a Windows 7 system\n *\n *\tKEYBOARD.SYS\n *\t\tGR 129*\n *\t\tSP 172\n *\t\tPO 163*\n *\t\tFR 120*, 189*\n *\t\tDK 159*\n *\t\tSG 000*\n *\t\tIT 141*, 142*\n *\t\tUK 166*, 168*\n *\t\tSF 150*\n *\t\tBE 120*\n *\t\tNL 143*\n *\t\tNO 155*\n *\t\tCF 058*\n *\t\tSV 153*\n *\t\tSU 153\n *\t\tLA 171*\n *\t\tBR 274*\n *\t\tPL 214*\n *\t\tCZ 243*\n *\t\tSL 245*\n *\t\tYU 234*\n *\t\tHU 208*\n *\t\tUS/XX 103*\n *\t\tJP defines ID:194 but points to SP entry\n *\n *\tKEYBRD2.SYS\n *\t\tGR 129*\n *\t\tRU 441\n *\t\tIT 141*, 142*\n *\t\tUK 166*, 168*\n *\t\tNO 155*\n *\t\tCF 058*\n *\t\tSV 153*\n *\t\tSU 153\n *\t\tBR 274*, 275*\n *\t\tBG 442*\n *\t\tPL 214*\n *\t\tCZ 243*\n *\t\tSL 245*\n *\t\tYU 234*\n *\t\tYC 118\n *\t\tHU 208*\n *\t\tRO 333\n *\t\tIS 161*\n *\t\tTR 179*, 440*\n *\t\tGK 319*\n *\t\tUS/XX 103*\n *\n *\tKEYBRD3.SYS\n *\t\tGR 129*\n *\t\tSP 172*\n *\t\tFR 189*\n *\t\tDK 159*\n *\t\tSG 000*\n *\t\tIT 141*\n *\t\tUK 166*\n *\t\tSF 150*\n *\t\tBE 120*\n *\t\tNL 143*\n *\t\tSV 153*\n *\t\tSU 153\n *\t\tPL 214*\n *\t\tCZ 243*\n *\t\tSL 245*\n *\t\tYU 234*\n *\t\tHU 208*\n *\t\tRU 091*, 092*, 093*, 341*\n *\t\tUR 094*, 095*, 096*\n *\t\tBL 097*, 098*, 099*\n *\t\tUS/XX 103*\n *\t\tJP defines ID:194 but points to SP entry\n *\n *\tKEYBRD4.SYS\n *\t\tGK 101*, 319*, 220*\n *\t\tPL 214*\n *\t\tET 425*\n *\t\tHE 400*\n *\t\tAR 401*, 402*, 403*\n *\t\tUS/XX 103*\n */\n\n/*\n * The following lists the keyboard code that are supported in each\n * of the WinMe DOS KEYBOARD.SYS, KEYBRD2.SYS, ...\n */\nstatic const char* ms_kb1[] = {\n\t\"be\", \"br\", \"cf\", \"cz\", \"dk\", \"fr\", \"gr\", \"hu\", \"it\", \"la\",\n\t\"nl\", \"no\", \"pl\", \"po\", \"sf\", \"sg\", \"sl\", \"sp\", \"su\", \"sv\",\n\t\"uk\", \"us\", \"yu\" };\nstatic const char* ms_kb2[] = {\n\t\"bg\", \"br\", \"cf\", \"cz\", \"gk\", \"gr\", \"hu\", \"is\", \"it\", \"no\",\n\t\"pl\", \"ro\", \"ru\", \"sl\", \"su\", \"sv\", \"tr\", \"uk\", \"us\", \"yc\",\n\t\"yu\" };\nstatic const char* ms_kb3[] = {\n\t\"be\", \"bl\", \"cz\", \"dk\", \"fr\", \"gr\", \"hu\", \"it\", \"nl\", \"pl\",\n\t\"ru\", \"sf\", \"sg\", \"sl\", \"sp\", \"su\", \"sv\", \"uk\", \"ur\", \"us\",\n\t\"yu\" };\nstatic const char* ms_kb4[] = {\n\t\"ar\", \"et\", \"gk\", \"he\", \"pl\", \"us\" };\n\n/*\n * The following lists the keyboard code that are supported in each\n * of the FreeDOS DOS KEYBOARD.SYS, KEYBRD2.SYS, ...\n */\nstatic const char* fd_kb1[] = {\n\t\"be\", \"br\", \"cf\", \"co\", \"cz\", \"dk\", \"dv\", \"fr\", \"gr\", \"hu\",\n\t\"it\", \"jp\", \"la\", \"lh\", \"nl\", \"no\", \"pl\", \"po\", \"rh\", \"sf\",\n\t\"sg\", \"sk\", \"sp\", \"su\", \"sv\", \"uk\", \"us\", \"yu\" };\nstatic const char* fd_kb2[] = {\n\t\"bg\", \"ce\", \"gk\", \"is\", \"ro\", \"ru\", \"rx\", \"tr\", \"tt\", \"yc\" };\nstatic const char* fd_kb3[] = {\n\t\"az\", \"bl\", \"et\", \"fo\", \"hy\", \"il\", \"ka\", \"kk\", \"ky\", \"lt\",\n\t\"lv\", \"mk\", \"mn\", \"mt\", \"ph\", \"sq\", \"tj\", \"tm\", \"ur\", \"uz\",\n\t\"vi\" };\nstatic const char* fd_kb4[] = {\n\t\"ar\", \"bn\", \"bx\", \"fx\", \"ix\", \"kx\", \"ne\", \"ng\", \"px\", \"sx\",\n\t\"ux\" };\n\ntypedef struct {\n\tconst char* name;\n\tULONG default_cp;\n} kb_default;\n\nstatic kb_default kbdrv_data[] = {\n\t{ \"keyboard.sys\", 437 },\n\t{ \"keybrd2.sys\", 850 },\n\t{ \"keybrd3.sys\", 850 },\n\t{ \"keybrd4.sys\", 853 }\n};\n\ntypedef struct {\n\tsize_t size;\n\tconst char** list;\n} kb_list;\n\nstatic kb_list ms_kb_list[] = {\n\t{ ARRAYSIZE(ms_kb1), ms_kb1 },\n\t{ ARRAYSIZE(ms_kb2), ms_kb2 },\n\t{ ARRAYSIZE(ms_kb3), ms_kb3 },\n\t{ ARRAYSIZE(ms_kb4), ms_kb4 }\n};\n\nstatic kb_list fd_kb_list[] = {\n\t{ ARRAYSIZE(fd_kb1), fd_kb1 },\n\t{ ARRAYSIZE(fd_kb2), fd_kb2 },\n\t{ ARRAYSIZE(fd_kb3), fd_kb3 },\n\t{ ARRAYSIZE(fd_kb4), fd_kb4 }\n};\n\nstatic int ms_get_kbdrv(const char* kb)\n{\n\tunsigned int i, j;\n\tfor (i = 0; i<ARRAYSIZE(ms_kb_list); i++) {\n\t\tfor (j = 0; j < ms_kb_list[i].size; j++) {\n\t\t\tif (safe_strcmp(ms_kb_list[i].list[j], kb) == 0) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}\n\nstatic int fd_get_kbdrv(const char* kb)\n{\n\tunsigned int i, j;\n\tfor (i = 0; i < ARRAYSIZE(fd_kb_list); i++) {\n\t\tfor (j = 0; j < fd_kb_list[i].size; j++) {\n\t\t\tif (safe_strcmp(fd_kb_list[i].list[j], kb) == 0) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}\n\n/*\n * We display human readable descriptions of the locale in the menu\n * As real estate might be limited, keep it short\n */\nstatic const char* kb_hr_list[][2] = {\n\t{\"ar\", \"Arabic\"},\t\t\t// Left enabled, but doesn't seem to work in FreeDOS\n\t{\"bg\", \"Bulgarian\"},\n\t{\"ch\", \"Chinese\"},\n\t{\"cz\", \"Czech\"},\n\t{\"dk\", \"Danish\"},\n\t{\"gr\", \"German\"},\n\t{\"sg\", \"Swiss-German\"},\n\t{\"gk\", \"Greek\"},\n\t{\"us\", \"US-English\"},\n\t{\"uk\", \"UK-English\"},\n\t{\"cf\", \"CA-French\"},\n\t{\"dv\", \"US-Dvorak\"},\n\t{\"lh\", \"US-Dvorak (LH)\"},\n\t{\"rh\", \"US-Dvorak (RH)\"},\n\t{\"sp\", \"Spanish\"},\n\t{\"la\", \"Latin-American\"},\n\t{\"su\", \"Finnish\"},\n\t{\"fr\", \"French\"},\n\t{\"be\", \"Belgian-French\"},\n\t{\"sf\", \"Swiss-French\"},\n\t{\"il\", \"Hebrew\"},\n\t{\"hu\", \"Hungarian\"},\n\t{\"is\", \"Icelandic\"},\n\t{\"it\", \"Italian\"},\n\t{\"jp\", \"Japanese\"},\n//\t{\"ko\", \"Korean\"},\t\t\t// Unsupported by FreeDOS\n\t{\"nl\", \"Dutch\"},\n\t{\"no\", \"Norwegian\"},\n\t{\"pl\", \"Polish\"},\n\t{\"br\", \"Brazilian\"},\n\t{\"po\", \"Portuguese\"},\n\t{\"ro\", \"Romanian\"},\n\t{\"ru\", \"Russian\"},\n\t{\"yu\", \"YU-Latin\"},\n\t{\"yc\", \"YU-Cyrillic\"},\n\t{\"sl\", \"Slovak\"},\n\t{\"sq\", \"Albanian\"},\n\t{\"sv\", \"Swedish\"},\n\t{\"tr\", \"Turkish\"},\n\t{\"ur\", \"Ukrainian\"},\n\t{\"bl\", \"Belarusian\"},\n\t{\"et\", \"Estonian\"},\n\t{\"lv\", \"Latvian\"},\n\t{\"lt\", \"Lithuanian\"},\n\t{\"tj\", \"Tajik\"},\n//\t{\"fa\", \"Persian\"};\t\t\t// Unsupported by FreeDOS\n\t{\"vi\", \"Vietnamese\"},\n\t{\"hy\", \"Armenian\"},\n\t{\"az\", \"Azeri\"},\n\t{\"mk\", \"Macedonian\"},\n\t{\"ka\", \"Georgian\"},\n\t{\"fo\", \"Faeroese\"},\n\t{\"mt\", \"Maltese\"},\n\t{\"kk\", \"Kazakh\"},\n\t{\"ky\", \"Kyrgyz\"},\n\t{\"uz\", \"Uzbek\"},\n\t{\"tm\", \"Turkmen\"},\n\t{\"tt\", \"Tatar\"},\n};\n\nstatic const char* kb_to_hr(const char* kb)\n{\n\tint i;\n\tfor (i = 0; i < ARRAYSIZE(kb_hr_list); i++) {\n\t\tif (safe_strcmp(kb, kb_hr_list[i][0]) == 0) {\n\t\t\treturn kb_hr_list[i][1];\n\t\t}\n\t}\n\t// Should never happen, so let's try to get some attention here\n\tassert(i < ARRAYSIZE(kb_hr_list));\n\treturn NULL;\n}\n\ntypedef struct {\n\tULONG cp;\n\tconst char* name;\n} cp_list;\n\n// From FreeDOS CPX pack as well as\n// http://msdn.microsoft.com/en-us/library/dd317756.aspx\nstatic cp_list cp_hr_list[] = {\n\t{ 113, \"Lat-Yugoslavian\"},\n\t{ 437, \"US-English\"},\n\t{ 667, \"Polish\"},\n\t{ 668, \"Polish (Alt)\"},\n\t{ 708, \"Arabic (708)\"},\n\t{ 709, \"Arabic (709)\"},\n\t{ 710, \"Arabic (710)\"},\n\t{ 720, \"Arabic (DOS)\"},\n\t{ 737, \"Greek (DOS)\"},\n\t{ 770, \"Baltic\"},\n\t{ 771, \"Cyr-Russian (KBL)\"},\n\t{ 772, \"Cyr-Russian\"},\n\t{ 773, \"Baltic Rim (Old)\"},\n\t{ 774, \"Lithuanian\"},\n\t{ 775, \"Baltic Rim\"},\n\t{ 777, \"Acc-Lithuanian (Old)\"},\n\t{ 778, \"Acc-Lithuanian\"},\n\t{ 790, \"Mazovian-Polish\"},\n\t{ 808, \"Cyr-Russian (Euro)\"},\n\t{ 848, \"Cyr-Ukrainian (Euro)\"},\n\t{ 849, \"Cyr-Belarusian (Euro)\"},\n\t{ 850, \"Western-European\"},\n\t{ 851, \"Greek\"},\n\t{ 852, \"Central-European\"},\n\t{ 853, \"Southern-European\"},\n\t{ 855, \"Cyr-South-Slavic\"},\n\t{ 856, \"Hebrew II\"},\n\t{ 857, \"Turkish\"},\n\t{ 858, \"Western-European (Euro)\"},\n\t{ 859, \"Western-European (Alt)\"},\n\t{ 860, \"Portuguese\"},\n\t{ 861, \"Icelandic\"},\n\t{ 862, \"Hebrew\"},\n\t{ 863, \"Canadian-French\"},\n\t{ 864, \"Arabic\"},\n\t{ 865, \"Nordic\"},\n\t{ 866, \"Cyr-Russian\"},\n\t{ 867, \"Czech Kamenicky\"},\n\t{ 869, \"Modern Greek\"},\n\t{ 872, \"Cyr-South-Slavic (Euro)\"},\n\t{ 874, \"Thai\"},\n\t{ 895, \"Czech Kamenicky (Alt)\"},\n\t{ 899, \"Armenian\"},\n\t{ 932, \"Japanese\"},\n\t{ 936, \"Chinese (Simplified)\"},\n\t{ 949, \"Korean\"},\n\t{ 950, \"Chinese (Traditional)\"},\n\t{ 991, \"Mazovian-Polish (Zloty)\"},\n\t{ 1116, \"Estonian\"},\n\t{ 1117, \"Latvian\"},\n\t{ 1118, \"Lithuanian\"},\n\t{ 1119, \"Cyr-Russian (Alt)\"},\n\t{ 1125, \"Cyr-Ukrainian\"},\n\t{ 1131, \"Cyr-Belarusian\"},\n\t{ 1250, \"Central European\"},\n\t{ 1251, \"Cyrillic\"},\n\t{ 1252, \"Western European\"},\n\t{ 1253, \"Greek\"},\n\t{ 1254, \"Turkish\"},\n\t{ 1255, \"Hebrew\"},\n\t{ 1256, \"Arabic\"},\n\t{ 1257, \"Baltic\"},\n\t{ 1258, \"Vietnamese\"},\n\t{ 1361, \"Korean\"},\n\t{ 3012, \"Cyr-Latvian\"},\n\t{ 3021, \"Cyr-Bulgarian\"},\n\t{ 3845, \"Hungarian\"},\n\t{ 3846, \"Turkish\"},\n\t{ 3848, \"Brazilian (ABICOMP)\"},\n\t{ 30000, \"Saami\"},\n\t{ 30001, \"Celtic\"},\n\t{ 30002, \"Cyr-Tajik\"},\n\t{ 30003, \"Latin American\"},\n\t{ 30004, \"Greenlandic\"},\n\t{ 30005, \"Nigerian\"},\n\t{ 30006, \"Vietnamese\"},\n\t{ 30007, \"Latin\"},\n\t{ 30008, \"Cyr-Ossetian\"},\n\t{ 30009, \"Romani\"},\n\t{ 30010, \"Cyr-Moldovan\"},\n\t{ 30011, \"Cyr-Chechen\"},\n\t{ 30012, \"Cyr-Siberian\"},\n\t{ 30013, \"Cyr-Turkic\"},\n\t{ 30014, \"Cyr-Finno-Ugric\"},\n\t{ 30015, \"Cyr-Khanty\"},\n\t{ 30016, \"Cyr-Mansi\"},\n\t{ 30017, \"Cyr-Northwestern\"},\n\t{ 30018, \"Lat-Tatar\"},\n\t{ 30019, \"Lat-Chechen\"},\n\t{ 30020, \"Low-Saxon and Frisian\"},\n\t{ 30021, \"Oceanian\"},\n\t{ 30022, \"First Nations\"},\n\t{ 30023, \"Southern African\"},\n\t{ 30024, \"North & East African\"},\n\t{ 30025, \"Western African\"},\n\t{ 30026, \"Central African\"},\n\t{ 30027, \"Beninese\"},\n\t{ 30028, \"Nigerian (Alt)\"},\n\t{ 30029, \"Mexican\"},\n\t{ 30030, \"Mexican (Alt)\"},\n\t{ 30031, \"Northern-European\"},\n\t{ 30032, \"Nordic\"},\n\t{ 30033, \"Crimean-Tatar (Hryvnia)\"},\n\t{ 30034, \"Cherokee\"},\n\t{ 30039, \"Cyr-Ukrainian (Hryvnia)\"},\n\t{ 30040, \"Cyr-Russian (Hryvnia)\"},\n\t{ 58152, \"Cyr-Kazakh (Euro)\"},\n\t{ 58210, \"Cyr-Azeri\"},\n\t{ 58335, \"Kashubian\"},\n\t{ 59234, \"Cyr-Tatar\"},\n\t{ 59829, \"Georgian\"},\n\t{ 60258, \"Lat-Azeri\"},\n\t{ 60853, \"Georgian (Alt)\"},\n\t{ 62306, \"Cyr-Uzbek\"},\n\t{ 65001, \"Unicode (UTF-8)\" }\n};\n\nstatic const char* cp_to_hr(ULONG cp)\n{\n\tint i;\n\tfor (i = 0; i < ARRAYSIZE(cp_hr_list); i++) {\n\t\tif (cp_hr_list[i].cp == cp) {\n\t\t\treturn cp_hr_list[i].name;\n\t\t}\n\t}\n\t// Should never happen, so this oughta get some attention\n\tassert(i < ARRAYSIZE(cp_hr_list));\n\treturn NULL;\n}\n\n// http://blogs.msdn.com/b/michkap/archive/2004/12/05/275231.aspx\nstatic const char* get_kb(void)\n{\n\tunsigned int kbid;\n\tchar kbid_str[KL_NAMELENGTH];\n\tint pass;\n\n\t// Count on Microsoft to add convolution to a simple operation.\n\t// We use GetKeyboardLayout() because it returns an HKL, which for instance\n\t// doesn't tell us if the *LAYOUT* is Dvorak or something else. For that we\n\t// need an KLID which GetKeyboardLayoutNameA() does return ...but only as a\n\t// string of an hex value...\n\tGetKeyboardLayoutNameA(kbid_str);\n\tif (sscanf(kbid_str, \"%x\", &kbid) <= 0) {\n\t\tuprintf(\"Could not scan keyboard layout name - defaulting to US\");\n\t\tkbid = 0x00000409;\n\t}\n\tuprintf(\"Windows KBID 0x%08x\\n\", kbid);\n\n\tfor (pass = 0; pass < 3; pass++) {\n\t\t// Some of these return values are defined in\n\t\t// HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Keyboard Layout\\DosKeybCodes\n\t\t// Others are picked up in FreeDOS official keyboard layouts, v3.0\n\t\t// Note: keyboard values are meant to start at 0x400. The cases below 0x400 are added\n\t\t// to attempt to figure out a \"best match\" in case we couldn't find a supported keyboard\n\t\t// by using the one most relevant to the language being spoken. Also we intentionally\n\t\t// group keyboards that shouldn't be together\n\n\t\t// Note: these cases are mostly organized first by (kbid & 0x3ff) and then by\n\t\t// ascending order for same (kbid & 0x3ff)\n\t\tswitch(kbid) {\n\t\tcase 0x00000001:\n\t\tcase 0x00010401: // Arabic (102)\n\t\tcase 0x00020401: // Arabic (102) AZERTY\n\t\t\treturn \"ar\";\n\t\tcase 0x00000002:\n\t\tcase 0x00000402: // Bulgarian (Typewriter)\n\t\tcase 0x00010402: // Bulgarian (Latin)\n\t\tcase 0x00020402: // Bulgarian (Phonetic)\n\t\tcase 0x00030402: // Bulgarian\n\t\tcase 0x00040402: // Bulgarian (Phonetic Traditional)\n\t\t\treturn \"bg\";\n\t\tcase 0x00000004:\n\t\tcase 0x00000404: // Chinese (Traditional) - US Keyboard\n\t\tcase 0x00000804: // Chinese (Simplified) - US Keyboard\n\t\tcase 0x00000c04: // Chinese (Traditional, Hong Kong) - US Keyboard\n\t\tcase 0x00001004: // Chinese (Simplified, Singapore) - US Keyboard\n\t\tcase 0x00001404: // Chinese (Traditional, Macao) - US Keyboard\n\t\t\treturn \"ch\";\n\t\tcase 0x00000005:\n\t\tcase 0x00000405: // Czech\n\t\tcase 0x00010405: // Czech (QWERTY)\n\t\tcase 0x00020405: // Czech Programmers\n\t\t\treturn \"cz\";\n\t\tcase 0x00000006:\n\t\tcase 0x00000406: // Danish\n\t\t\treturn \"dk\";\n\t\tcase 0x00000007:\n\t\tcase 0x00000407: // German\n\t\tcase 0x00010407: // German (IBM)\n\t\t\treturn \"gr\";\n\t\tcase 0x00000807: // Swiss German\n\t\t\treturn \"sg\";\n\t\tcase 0x00000008:\n\t\tcase 0x00000408: // Greek\n\t\tcase 0x00010408: // Greek (220)\n\t\tcase 0x00020408: // Greek (319)\n\t\tcase 0x00030408: // Greek (220) Latin\n\t\tcase 0x00040408: // Greek (319) Latin\n\t\tcase 0x00050408: // Greek Latin\n\t\tcase 0x00060408: // Greek Polytonic\n\t\t\treturn \"gk\";\n\t\tcase 0x00000009:\n\t\tcase 0x00000409: // US\n\t\tcase 0x00020409: // United States-International\n\t\tcase 0x00050409: // US English Table for IBM Arabic 238_L\n\t\t\treturn \"us\";\n\t\tcase 0x00000809: // United Kingdom\n\t\tcase 0x00000452: // United Kingdom Extended (Welsh)\n\t\tcase 0x00001809: // Irish\n\t\tcase 0x00011809: // Gaelic\n\t\t\treturn \"uk\";\n\t\tcase 0x00000c0c: // Canadian French (Legacy)\n\t\tcase 0x00001009: // Canadian French\n\t\tcase 0x00011009: // Canadian Multilingual Standard\n\t\t\treturn \"cf\";\n\t\tcase 0x00010409: // United States-Dvorak\n\t\t\treturn \"dv\";\n\t\tcase 0x00030409: // United States-Dvorak for left hand\n\t\t\treturn \"lh\";\n\t\tcase 0x00040409: // United States-Dvorak for right hand\n\t\t\treturn \"rh\";\n\t\tcase 0x0000000a:\n\t\tcase 0x0000040a: // Spanish\n\t\tcase 0x0001040a: // Spanish Variation\n\t\t\treturn \"sp\";\n\t\tcase 0x0000080a: // Latin American\n\t\t\treturn \"la\";\n\t\tcase 0x0000000b:\n\t\tcase 0x0000040b: // Finnish\n\t\tcase 0x0001083b: // Finnish with Sami\n\t\t\treturn \"su\";\n\t\tcase 0x0000000c:\n\t\tcase 0x0000040c: // French\n\t\tcase 0x0000046e: // Luxembourgish\n\t\t\treturn \"fr\";\n\t\tcase 0x0000080c: // Belgian French\n\t\tcase 0x0001080c: // Belgian (Comma)\n\t\t\treturn \"be\";\n\t\tcase 0x0000100c: // Swiss French\n\t\t\treturn \"sf\";\n\t\tcase 0x0000000d:\n\t\tcase 0x0000040d: // Hebrew\n\t\t\treturn \"il\";\n\t\tcase 0x0000000e:\n\t\tcase 0x0000040e: // Hungarian\n\t\tcase 0x0001040e: // Hungarian 101-key\n\t\t\treturn \"hu\";\n\t\tcase 0x0000000f:\n\t\tcase 0x0000040f: // Icelandic\n\t\t\treturn \"is\";\n\t\tcase 0x00000010:\n\t\tcase 0x00000410: // Italian\n\t\tcase 0x00010410: // Italian (142)\n\t\t\treturn \"it\";\n\t\tcase 0x00000011:\n\t\tcase 0x00000411: // Japanese\n\t\t\treturn \"jp\";\n\t//\tcase 0x00000012:\n\t//\tcase 0x00000412: // Korean\n\t//\t\treturn \"ko\";\t// NOT IMPLEMENTED IN FREEDOS?\n\t\tcase 0x00000013:\n\t\tcase 0x00000413: // Dutch\n\t\tcase 0x00000813: // Belgian (Period)\n\t\t\treturn \"nl\";\n\t\tcase 0x00000014:\n\t\tcase 0x00000414: // Norwegian\n\t\tcase 0x0000043b: // Norwegian with Sami\n\t\tcase 0x0001043b: // Sami Extended Norway\n\t\t\treturn \"no\";\n\t\tcase 0x00000015:\n\t\tcase 0x00010415: // Polish (214)\n\t\tcase 0x00000415: // Polish (Programmers)\n\t\t\treturn \"pl\";\n\t\tcase 0x00000016:\n\t\tcase 0x00000416: // Portuguese (Brazilian ABNT)\n\t\tcase 0x00010416: // Portuguese (Brazilian ABNT2)\n\t\t\treturn \"br\";\n\t\tcase 0x00000816: // Portuguese (Portugal)\n\t\t\treturn \"po\";\n\t\tcase 0x00000018:\n\t\tcase 0x00000418: // Romanian (Legacy)\n\t\tcase 0x00010418: // Romanian (Standard)\n\t\tcase 0x00020418: // Romanian (Programmers)\n\t\t\treturn \"ro\";\n\t\tcase 0x00000019:\n\t\tcase 0x00000419: // Russian\n\t\tcase 0x00010419: // Russian (Typewriter)\n\t\t\treturn \"ru\";\n\t\tcase 0x0000001a:\n\t\tcase 0x0000041a: // Croatian\n\t\tcase 0x0000081a: // Serbian (Latin)\n\t\tcase 0x00000024:\n\t\tcase 0x00000424: // Slovenian\n\t\t\treturn \"yu\";\n\t\tcase 0x00000c1a: // Serbian (Cyrillic)\n\t\tcase 0x0000201a: // Bosnian (Cyrillic)\n\t\t\treturn \"yc\";\n\t\tcase 0x0000001b:\n\t\tcase 0x0000041b: // Slovak\n\t\tcase 0x0001041b: // Slovak (QWERTY)\n\t\t\treturn \"sl\";\n\t\tcase 0x0000001c:\n\t\tcase 0x0000041c: // Albanian\n\t\t\treturn \"sq\";\n\t\tcase 0x0000001d:\n\t\tcase 0x0000041d: // Swedish\n\t\tcase 0x0000083b: // Swedish with Sami\n\t\t\treturn \"sv\";\n\t\tcase 0x0000001f:\n\t\tcase 0x0000041f: // Turkish Q\n\t\tcase 0x0001041f: // Turkish F\n\t\t\treturn \"tr\";\n\t\tcase 0x00000022:\n\t\tcase 0x00000422: // Ukrainian\n\t\tcase 0x00020422: // Ukrainian (Enhanced)\n\t\t\treturn \"ur\";\n\t\tcase 0x00000023:\n\t\tcase 0x00000423: // Belarusian\n\t\t\treturn \"bl\";\n\t\tcase 0x00000025:\n\t\tcase 0x00000425: // Estonian\n\t\t\treturn \"et\";\n\t\tcase 0x00000026:\n\t\tcase 0x00000426: // Latvian\n\t\tcase 0x00010426: // Latvian (QWERTY)\n\t\t\treturn \"lv\";\n\t\tcase 0x00000027:\n\t\tcase 0x00000427: // Lithuanian IBM\n\t\tcase 0x00010427: // Lithuanian\n\t\tcase 0x00020427: // Lithuanian Standard\n\t\t\treturn \"lt\";\n\t\tcase 0x00000028:\n\t\tcase 0x00000428: // Tajik\n\t\t\treturn \"tj\";\n\t//\tcase 0x00000029:\n\t//\tcase 0x00000429: // Persian\n\t//\t\treturn \"fa\";\t// NOT IMPLEMENTED IN FREEDOS?\n\t\tcase 0x0000002a:\n\t\tcase 0x0000042a: // Vietnamese\n\t\t\treturn \"vi\";\n\t\tcase 0x0000002b:\n\t\tcase 0x0000042b: // Armenian Eastern\n\t\tcase 0x0001042b: // Armenian Western\n\t\t\treturn \"hy\";\n\t\tcase 0x0000002c:\n\t\tcase 0x0000042c: // Azeri Latin\n\t\tcase 0x0000082c: // Azeri Cyrillic\n\t\t\treturn \"az\";\n\t\tcase 0x0000002f:\n\t\tcase 0x0000042f: // Macedonian (FYROM)\n\t\tcase 0x0001042f: // Macedonian (FYROM) - Standard\n\t\t\treturn \"mk\";\n\t\tcase 0x00000037:\n\t\tcase 0x00000437: // Georgian\n\t\tcase 0x00010437: // Georgian (QWERTY)\n\t\tcase 0x00020437: // Georgian (Ergonomic)\n\t\t\treturn \"ka\";\n\t\tcase 0x00000038:\n\t\tcase 0x00000438: // Faeroese\n\t\t\treturn \"fo\";\n\t\tcase 0x0000003a:\n\t\tcase 0x0000043a: // Maltese 47-Key\n\t\tcase 0x0001043a: // Maltese 48-Key\n\t\t\treturn \"mt\";\n\t\tcase 0x0000003f:\n\t\tcase 0x0000043f: // Kazakh\n\t\t\treturn \"kk\";\n\t\tcase 0x00000040:\n\t\tcase 0x00000440: // Kyrgyz Cyrillic\n\t\t\treturn \"ky\";\n\t\tcase 0x00000043:\n\t\tcase 0x00000843: // Uzbek Cyrillic\n\t\t\treturn \"uz\";\n\t\tcase 0x00000042:\n\t\tcase 0x00000442: // Turkmen\n\t\t\treturn \"tm\";\n\t\tcase 0x00000044:\n\t\tcase 0x00000444: // Tatar\n\t\t\treturn \"tt\";\n\n\t// Below are more Windows 7 listed keyboards that were left out\n\t#if 0\n\t\tcase 0x0000041e: // Thai Kedmanee\n\t\tcase 0x0001041e: // Thai Pattachote\n\t\tcase 0x0002041e: // Thai Kedmanee (non-ShiftLock)\n\t\tcase 0x0003041e: // Thai Pattachote (non-ShiftLock)\n\t\tcase 0x00000420: // Urdu\n\t\tcase 0x0000042e: // Sorbian Standard (Legacy)\n\t\tcase 0x0001042e: // Sorbian Extended\n\t\tcase 0x0002042e: // Sorbian Standard\n\t\tcase 0x00000432: // Setswana\n\t\tcase 0x00000439: // Devanagari - INSCRIPT#\n\t\tcase 0x00010439: // Hindi Traditional\n\t\tcase 0x0002083b: // Sami Extended Finland-Sweden\n\t\tcase 0x00000445: // Bengali\n\t\tcase 0x00010445: // Bengali - INSCRIPT (Legacy)\n\t\tcase 0x00020445: // Bengali - INSCRIPT\n\t\tcase 0x00000446: // Punjabi\n\t\tcase 0x00000447: // Gujarati\n\t\tcase 0x00000448: // Oriya\n\t\tcase 0x00000449: // Tamil\n\t\tcase 0x0000044a: // Telugu\n\t\tcase 0x0000044b: // Kannada\n\t\tcase 0x0000044c: // Malayalam\n\t\tcase 0x0000044d: // Assamese - INSCRIPT\n\t\tcase 0x0000044e: // Marathi\n\t\tcase 0x00000450: // Mongolian Cyrillic\n\t\tcase 0x00000451: // Tibetan\n\t\tcase 0x00000850: // Mongolian (Mongolian Script)\n\t\tcase 0x0000085d: // Inuktitut - Latin\n\t\tcase 0x0001045d: // Inuktitut - Naqittaut\n\t\tcase 0x00000453: // Khmer\n\t\tcase 0x00000454: // Lao\n\t\tcase 0x0000045a: // Syriac\n\t\tcase 0x0001045a: // Syriac Phonetic\n\t\tcase 0x0000045b: // Sinhala\n\t\tcase 0x0001045b: // Sinhala - Wij 9\n\t\tcase 0x00000461: // Nepali\n\t\tcase 0x00000463: // Pashto (Afghanistan)\n\t\tcase 0x00000465: // Divehi Phonetic\n\t\tcase 0x00010465: // Divehi Typewriter\n\t\tcase 0x00000468: // Hausa\n\t\tcase 0x0000046a: // Yoruba\n\t\tcase 0x0000046c: // Sesotho sa Leboa\n\t\tcase 0x0000046d: // Bashkir\n\t\tcase 0x0000046f: // Greenlandic\n\t\tcase 0x00000470: // Igbo\n\t\tcase 0x00000480: // Uyghur (Legacy)\n\t\tcase 0x00010480: // Uyghur\n\t\tcase 0x00000481: // Maori\n\t\tcase 0x00000485: // Yakut\n\t\tcase 0x00000488: // Wolof\n\t#endif\n\t\tdefault:\n\t\t\tif (pass == 0) {\n\t\t\t\t// If we didn't get a match 1st time around, try to match\n\t\t\t\t// the primary language of the keyboard\n\t\t\t\tkbid = PRIMARYLANGID(kbid);\n\t\t\t} else if (pass == 1) {\n\t\t\t\t// If we still didn't get a match, use the system's primary language\n\t\t\t\tkbid = PRIMARYLANGID(GetSystemDefaultLangID());\n\t\t\t\tuprintf(\"Unable to match KBID, trying LangID 0x%04x\", kbid);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tuprintf(\"Unable to match KBID and LangID - defaulting to US\");\n\treturn \"us\";\n}\n\n/*\n * From WinME DOS\n *\n *\tEGA.CPI:\n *\t\t0x01B5\t437 (United States)\n *\t\t0x0352\t850 (Latin 1)\n *\t\t0x0354\t852 (Latin 2)\n *\t\t0x035C\t860 (Portuguese)\n *\t\t0x035F\t863 (French Canadian)\n *\t\t0x0361\t865 (Nordic)\n *\n *\tEGA2.CPI:\n *\t\t0x0352\t850 (Latin 1)\n *\t\t0x0354\t852 (Latin 2)\n *\t\t0x0359\t857 (Turkish)\n *\t\t0x035D\t861 (Icelandic)\n *\t\t0x0365\t869 (Greek)\n *\t\t0x02E1\t737 (Greek II)\n *\n *\tEGA3.CPI:\n *\t\t0x01B5\t437 (United States)\n *\t\t0x0307\t775 (Baltic)\n *\t\t0x0352\t850 (Latin 1)\n *\t\t0x0354\t852 (Latin 2)\n *\t\t0x0357\t855 (Cyrillic I)\n *\t\t0x0362\t866 (Cyrillic II)\n */\n\n\n// Pick the EGA to use according to the DOS target codepage (see above)\nstatic const char* ms_get_ega(ULONG cp)\n{\n\tswitch(cp) {\n\tcase   437: // United States\n\tcase   850: // Latin-1 (Western European)\n\tcase   852: // Latin-2 (Central European)\n\tcase   860: // Portuguese\n\tcase   863: // French Canadian\n\tcase   865: // Nordic\n\t\treturn \"ega.cpi\";\n\n//\tcase   850: // Latin-1 (Western European)\n//\tcase   852: // Latin-2 (Central European)\n\tcase   857: // Turkish\n\tcase   861: // Icelandic\n\tcase   869: // Greek\n\tcase   737: // Greek II\n\t\treturn \"ega2.cpi\";\n\n//\tcase   437: // United States\n\tcase   775: // Baltic\n//\tcase   850: // Latin-1 (Western European)\n//\tcase   852: // Latin-2 (Central European)\n\tcase   855: // Cyrillic I\n\tcase   866: // Cyrillic II\n\t\treturn \"ega3.cpi\";\n\n\tdefault:\n\t\treturn NULL;\n\t}\n}\n\n// Pick the EGA to use according to the DOS target codepage (from CPIDOS' Codepage.txt)\nstatic const char* fd_get_ega(ULONG cp)\n{\n\tswitch(cp) {\n\tcase   437: // United States\n\tcase   850: // Latin-1 (Western European)\n\tcase   852: // Latin-2 (Central European)\n\tcase   853: // Latin-3 (Southern European)\n\tcase   857: // Latin-5\n\tcase   858: // Latin-1 with Euro\n\t\treturn \"ega.cpx\";\n\tcase   775: // Latin-7 (Baltic Rim)\n\tcase   859: // Latin-9\n\tcase  1116: // Estonian\n\tcase  1117: // Latvian\n\tcase  1118: // Lithuanian\n\tcase  1119: // Cyrillic Russian and Lithuanian (*)\n\t\treturn \"ega2.cpx\";\n\tcase   771: // Cyrillic Russian and Lithuanian (KBL)\n\tcase   772: // Cyrillic Russian and Lithuanian\n\tcase   808: // Cyrillic Russian with Euro\n\tcase   855: // Cyrillic South Slavic\n\tcase   866: // Cyrillic Russian\n\tcase   872: // Cyrillic South Slavic with Euro\n\t\treturn \"ega3.cpx\";\n\tcase   848: // Cyrillic Ukrainian with Euro\n\tcase   849: // Cyrillic Belarusian with Euro\n\tcase  1125: // Cyrillic Ukrainian\n\tcase  1131: // Cyrillic Belarusian\n\tcase  3012: // Cyrillic Russian and Latvian (\"RusLat\")\n\tcase 30010: // Cyrillic Gagauz and Moldovan\n\t\treturn \"ega4.cpx\";\n\tcase   113: // Yugoslavian Latin\n\tcase   737: // Greek-2\n\tcase   851: // Greek (old codepage)\n//\tcase   852: // Latin-2\n//\tcase   858: // Multilingual Latin-1 with Euro\n\tcase   869: // Greek\n\t\treturn \"ega5.cpx\";\n\tcase   899: // Armenian\n\tcase 30008: // Cyrillic Abkhaz and Ossetian\n\tcase 58210: // Cyrillic Russian and Azeri\n\tcase 59829: // Georgian\n\tcase 60258: // Cyrillic Russian and Latin Azeri\n\tcase 60853: // Georgian with capital letters\n\t\treturn \"ega6.cpx\";\n\tcase 30011: // Cyrillic Russian Southern District\n\tcase 30013: // Cyrillic Volga District: // Turkic languages\n\tcase 30014: // Cyrillic Volga District: // Finno-ugric languages\n\tcase 30017: // Cyrillic Northwestern District\n\tcase 30018: // Cyrillic Russian and Latin Tatar\n\tcase 30019: // Cyrillic Russian and Latin Chechen\n\t\treturn \"ega7.cpx\";\n\tcase   770: // Baltic\n\tcase   773: // Latin-7 (old standard)\n\tcase   774: // Lithuanian\n//\tcase   775: // Latin-7\n\tcase   777: // Accented Lithuanian (old)\n\tcase   778: // Accented Lithuanian\n\t\treturn \"ega8.cpx\";\n//\tcase   858: // Latin-1 with Euro\n\tcase   860: // Portuguese\n\tcase   861: // Icelandic\n\tcase   863: // Canadian French\n\tcase   865: // Nordic\n\tcase   867: // Czech Kamenicky\n\t\treturn \"ega9.cpx\";\n\tcase   667: // Polish\n\tcase   668: // Polish (polish letters on cp852 codepoints)\n\tcase   790: // Polish Mazovia\n//\tcase   852: // Latin-2\n\tcase   991: // Polish Mazovia with Zloty sign\n\tcase  3845: // Hungarian\n\t\treturn \"ega10.cpx\";\n//\tcase   858: // Latin-1 with Euro\n\tcase 30000: // Saami\n\tcase 30001: // Celtic\n\tcase 30004: // Greenlandic\n\tcase 30007: // Latin\n\tcase 30009: // Romani\n\t\treturn \"ega11.cpx\";\n//\tcase   852: // Latin-2\n//\tcase   858: // Latin-1 with Euro\n\tcase 30003: // Latin American\n\tcase 30029: // Mexican\n\tcase 30030: // Mexican II\n\tcase 58335: // Kashubian\n\t\treturn \"ega12\";\n//\tcase   852: // Latin-2\n\tcase   895: // Czech Kamenicky\n\tcase 30002: // Cyrillic Tajik\n\tcase 58152: // Cyrillic Kazakh with Euro\n\tcase 59234: // Cyrillic Tatar\n\tcase 62306: // Cyrillic Uzbek\n\t\treturn \"ega13.cpx\";\n\tcase 30006: // Vietnamese\n\tcase 30012: // Cyrillic Russian Siberian and Far Eastern Districts\n\tcase 30015: // Cyrillic Khanty\n\tcase 30016: // Cyrillic Mansi\n\tcase 30020: // Low saxon and frisian\n\tcase 30021: // Oceania\n\t\treturn \"ega14.cpx\";\n\tcase 30023: // Southern Africa\n\tcase 30024: // Northern and Eastern Africa\n\tcase 30025: // Western Africa\n\tcase 30026: // Central Africa\n\tcase 30027: // Beninese\n\tcase 30028: // Nigerian II\n\t\treturn \"ega15.cpx\";\n//\tcase   858: // Latin-1 with Euro\n\tcase  3021: // Cyrillic MIK Bulgarian\n\tcase 30005: // Nigerian\n\tcase 30022: // Canadian First Nations\n\tcase 30031: // Latin-4 (Northern European)\n\tcase 30032: // Latin-6\n\t\treturn \"ega16.cpx\";\n\tcase   862: // Hebrew\n\tcase   864: // Arabic\n\tcase 30034: // Cherokee\n\tcase 30033: // Crimean Tatar with Hryvnia\n\tcase 30039: // Cyrillic Ukrainian with Hryvnia\n\tcase 30040: // Cyrillic Russian with Hryvnia\n\t\treturn \"ega17.cpx\";\n\tcase   856: // Hebrew II\n\tcase  3846: // Turkish\n\tcase  3848: // Brazilian ABICOMP\n\t\treturn \"ega18.cpx\";\n\tdefault:\n\t\treturn NULL;\n\t}\n}\n\n// Transliteration of the codepage (to add currency symbol, etc - FreeDOS only)\nstatic ULONG fd_upgrade_cp(ULONG cp)\n{\n\tswitch(cp) {\n\tcase   850: // Latin-1 (Western European)\n\t\treturn 858; // Latin-1 with Euro\n\tdefault:\n\t\treturn cp;\n\t}\n}\n\n// Don't bother about setting up the country or multiple codepages\nBOOL SetDOSLocale(const char* path, BOOL bFreeDOS)\n{\n\tFILE* fd;\n\tchar filename[MAX_PATH];\n\tULONG cp;\n\tUINT actual_cp;\n\tconst char *kb;\n\tint kbdrv;\n\tconst char* egadrv;\n\n\t// First handle the codepage\n\tkb = get_kb();\n\t// We have a keyboard ID, but that doesn't mean it's supported\n\tkbdrv = bFreeDOS ? fd_get_kbdrv(kb) : ms_get_kbdrv(kb);\n\tif (kbdrv < 0) {\n\t\tuprintf(\"Keyboard id '%s' is not supported - falling back to 'us'\", kb);\n\t\tkb = \"us\";\n\t\tkbdrv = bFreeDOS ? fd_get_kbdrv(kb) : ms_get_kbdrv(kb);\t// Always succeeds\n\t}\n\tassert(kbdrv >= 0);\n\tuprintf(\"Will use DOS keyboard '%s' [%s]\", kb, kb_to_hr(kb));\n\n\t// Now get a codepage\n\tcp = GetOEMCP();\n\tif (cp == 65001) {\n\t\t// GetOEMCP() may return UTF-8 for the codepage (65001),\n\t\t// in which case we need to find the actual system OEM cp.\n\t\tif (GetLocaleInfoA(GetUserDefaultUILanguage(), LOCALE_IDEFAULTCODEPAGE | LOCALE_RETURN_NUMBER,\n\t\t\t(char*)&actual_cp, sizeof(actual_cp)))\n\t\t\tcp = actual_cp;\n\t}\n\tegadrv = bFreeDOS ? fd_get_ega(cp) : ms_get_ega(cp);\n\tif (egadrv == NULL) {\n\t\t// We need to use the fallback CP from the keyboard we got above, as 437 is not always available\n\t\tuprintf(\"Unable to find an EGA file with codepage %d [%s]\", cp, cp_to_hr(cp));\n\t\tcp = kbdrv_data[kbdrv].default_cp;\n\t\tegadrv =  bFreeDOS ? \"ega.cpx\" : \"ega.cpi\";\n\t} else if (bFreeDOS) {\n\t\tcp = fd_upgrade_cp(cp);\n\t}\n\tuprintf(\"Will use codepage %d [%s]\", cp, cp_to_hr(cp));\n\n\tif ((cp == 437) && (strcmp(kb, \"us\") == 0)) {\n\t\t// Nothing much to do if US/US - just notify in autoexec.bat\n\t\tstatic_strcpy(filename, path);\n\t\tstatic_strcat(filename, \"\\\\AUTOEXEC.BAT\");\n\t\tfd = fopen(filename, \"w+\");\n\t\tif (fd == NULL) {\n\t\t\tuprintf(\"Unable to create 'AUTOEXEC.BAT': %s\", WindowsErrorString());\n\t\t\treturn FALSE;\n\t\t}\n\t\tfprintf(fd, \"@echo off\\n\");\n\t\tfprintf(fd, \"set PATH=.;\\\\;\\\\LOCALE\\n\");\n\t\tfprintf(fd, \"echo Using %s keyboard with %s codepage [%d]\\n\", kb_to_hr(\"us\"), cp_to_hr(437), 437);\n\t\tfclose(fd);\n\t\tuprintf(\"Successfully wrote 'AUTOEXEC.BAT'\");\n\t\treturn TRUE;\n\t}\n\n\t// CONFIG.SYS\n\tstatic_strcpy(filename, path);\n\tstatic_strcat(filename, \"\\\\CONFIG.SYS\");\n\tfd = fopen(filename, \"w+\");\n\tif (fd == NULL) {\n\t\tuprintf(\"Unable to create 'CONFIG.SYS': %s.\", WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\tif (bFreeDOS) {\n\t\tfprintf(fd, \"!MENUCOLOR=7,0\\nMENU\\nMENU   FreeDOS Language Selection Menu\\n\");\n\t\tfprintf(fd, \"MENU   \\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\"\n\t\t\t\"\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\xCD\\nMENU\\n\");\n\t} else {\n\t\tfprintf(fd, \"[MENU]\\n\");\n\t}\n\tfprintf(fd, \"MENUDEFAULT=1,5\\n\");\n\t// Menu item max: 70 characters\n\tfprintf(fd, \"%s1%c Use %s keyboard with %s codepage [%d]\\n\",\n\t\tbFreeDOS?\"MENU \":\"MENUITEM=\", bFreeDOS?')':',', kb_to_hr(kb), cp_to_hr(cp), (int)cp);\n\tfprintf(fd, \"%s2%c Use %s keyboard with %s codepage [%d]\\n\",\n\t\tbFreeDOS?\"MENU \":\"MENUITEM=\", bFreeDOS?')':',', kb_to_hr(\"us\"), cp_to_hr(437), 437);\n\tfprintf(fd, \"%s\", bFreeDOS?\"MENU\\n12?\\n\":\"[1]\\ndevice=\\\\locale\\\\display.sys con=(ega,,1)\\n[2]\\n\");\n\tfclose(fd);\n\tuprintf(\"Successfully wrote 'CONFIG.SYS'\");\n\n\t// AUTOEXEC.BAT\n\tstatic_strcpy(filename, path);\n\tstatic_strcat(filename, \"\\\\AUTOEXEC.BAT\");\n\tfd = fopen(filename, \"w+\");\n\tif (fd == NULL) {\n\t\tuprintf(\"Unable to create 'AUTOEXEC.BAT': %s\", WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\tfprintf(fd, \"@echo off\\n\");\n\tfprintf(fd, \"set PATH=.;\\\\;\\\\LOCALE\\n\");\n\tif (bFreeDOS)\n\t\tfprintf(fd, \"display con=(ega,,1)\\n\");\n\tfprintf(fd, \"GOTO %%CONFIG%%\\n\");\n\tfprintf(fd, \":1\\n\");\n\tfprintf(fd, \"mode con codepage prepare=((%d) \\\\locale\\\\%s) > NUL\\n\", (int)cp, egadrv);\n\tfprintf(fd, \"mode con codepage select=%d > NUL\\n\", (int)cp);\n\tfprintf(fd, \"keyb %s,,\\\\locale\\\\%s\\n\", kb, kbdrv_data[kbdrv].name);\n\tfprintf(fd, \":2\\n\");\n\tfclose(fd);\n\tuprintf(\"Successfully wrote 'AUTOEXEC.BAT'\");\n\n\treturn TRUE;\n}\n"
  },
  {
    "path": "src/drive.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Drive access function calls\n * Copyright © 2011-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <windowsx.h>\n#include <stdio.h>\n#include <string.h>\n#include <ctype.h>\n#include <assert.h>\n#if !defined(__MINGW32__)\n#include <initguid.h>\n#include <vds.h>\n#endif\n\n#include \"rufus.h\"\n#include \"ntdll.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"settings.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n\n#include \"file.h\"\n#include \"drive.h\"\n#include \"mbr_types.h\"\n#include \"gpt_types.h\"\n#include \"br.h\"\n#include \"fat16.h\"\n#include \"fat32.h\"\n#include \"ntfs.h\"\n\n#define GLOBALROOT_NAME \"\\\\\\\\?\\\\GLOBALROOT\"\nconst char* sfd_name = \"Super Floppy Disk\";\nconst char* groot_name = GLOBALROOT_NAME;\nconst size_t groot_len = sizeof(GLOBALROOT_NAME) - 1;\n\n\n#if defined(__MINGW32__)\nconst IID CLSID_VdsLoader = { 0x9c38ed61, 0xd565, 0x4728, { 0xae, 0xee, 0xc8, 0x09, 0x52, 0xf0, 0xec, 0xde } };\nconst IID IID_IVdsServiceLoader = { 0xe0393303, 0x90d4, 0x4a97, { 0xab, 0x71, 0xe9, 0xb6, 0x71, 0xee, 0x27, 0x29 } };\nconst IID IID_IVdsProvider = { 0x10c5e575, 0x7984, 0x4e81, { 0xa5, 0x6b, 0x43, 0x1f, 0x5f, 0x92, 0xae, 0x42 } };\nconst IID IID_IVdsSwProvider = { 0x9aa58360, 0xce33, 0x4f92, { 0xb6, 0x58, 0xed, 0x24, 0xb1, 0x44, 0x25, 0xb8 } };\nconst IID IID_IVdsPack = { 0x3b69d7f5, 0x9d94, 0x4648, { 0x91, 0xca, 0x79, 0x93, 0x9b, 0xa2, 0x63, 0xbf } };\nconst IID IID_IVdsDisk = { 0x07e5c822, 0xf00c, 0x47a1, { 0x8f, 0xce, 0xb2, 0x44, 0xda, 0x56, 0xfd, 0x06 } };\nconst IID IID_IVdsAdvancedDisk = { 0x6e6f6b40, 0x977c, 0x4069, { 0xbd, 0xdd, 0xac, 0x71, 0x00, 0x59, 0xf8, 0xc0 } };\nconst IID IID_IVdsVolume = { 0x88306BB2, 0xE71F, 0x478C, { 0x86, 0xA2, 0x79, 0xDA, 0x20, 0x0A, 0x0F, 0x11} };\nconst IID IID_IVdsVolumeMF3 = { 0x6788FAF9, 0x214E, 0x4B85, { 0xBA, 0x59, 0x26, 0x69, 0x53, 0x61, 0x6E, 0x09 } };\n#endif\n\n#ifndef PERSISTENT_VOLUME_STATE_DEV_VOLUME\n#define PERSISTENT_VOLUME_STATE_DEV_VOLUME (0x00002000)\n#endif\n\n/*\n * Globals\n */\nRUFUS_DRIVE_INFO SelectedDrive;\nextern BOOL write_as_esp;\nextern windows_version_t WindowsVersion;\nint partition_index[PI_MAX];\nuint64_t persistence_size = 0;\n\n/*\n * The following methods get or set the AutoMount setting (which is different from AutoRun)\n * Rufus needs AutoMount to be set as the format process may fail for fixed drives otherwise.\n * See https://github.com/pbatard/rufus/issues/386.\n *\n * Reverse engineering diskpart and mountvol indicates that the former uses the IVdsService\n * ClearFlags()/SetFlags() to set VDS_SVF_AUTO_MOUNT_OFF whereas mountvol on uses\n * IOCTL_MOUNTMGR_SET_AUTO_MOUNT on \"\\\\\\\\.\\\\MountPointManager\".\n * As the latter is MUCH simpler this is what we'll use too\n */\nBOOL SetAutoMount(BOOL enable)\n{\n\tHANDLE hMountMgr;\n\tBOOL ret = FALSE;\n\n\thMountMgr = CreateFileA(MOUNTMGR_DOS_DEVICE_NAME, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n\tif (hMountMgr == INVALID_HANDLE_VALUE)\n\t\treturn FALSE;\n\tret = DeviceIoControl(hMountMgr, IOCTL_MOUNTMGR_SET_AUTO_MOUNT, &enable, sizeof(enable), NULL, 0, NULL, NULL);\n\tCloseHandle(hMountMgr);\n\treturn ret;\n}\n\nBOOL GetAutoMount(BOOL* enabled)\n{\n\tHANDLE hMountMgr;\n\tDWORD size;\n\tBOOL ret = FALSE;\n\n\tif (enabled == NULL)\n\t\treturn FALSE;\n\thMountMgr = CreateFileA(MOUNTMGR_DOS_DEVICE_NAME, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n\tif (hMountMgr == INVALID_HANDLE_VALUE)\n\t\treturn FALSE;\n\tret = DeviceIoControl(hMountMgr, IOCTL_MOUNTMGR_QUERY_AUTO_MOUNT, NULL, 0, enabled, sizeof(*enabled), &size, NULL);\n\tCloseHandle(hMountMgr);\n\treturn ret;\n}\n\n/*\n * Working with drive indexes quite risky (left unchecked,inadvertently passing 0 as\n * index would return a handle to C:, which we might then proceed to unknowingly\n * clear the MBR of!), so we mitigate the risk by forcing our indexes to belong to\n * the specific range [DRIVE_INDEX_MIN; DRIVE_INDEX_MAX].\n */\n#define CheckDriveIndex(DriveIndex) do {                                            \\\n\tif ((int)DriveIndex < 0) goto out;                                              \\\n\tassert((DriveIndex >= DRIVE_INDEX_MIN) && (DriveIndex <= DRIVE_INDEX_MAX));     \\\n\tif ((DriveIndex < DRIVE_INDEX_MIN) || (DriveIndex > DRIVE_INDEX_MAX)) goto out; \\\n\tDriveIndex -= DRIVE_INDEX_MIN; } while (0)\n\n/*\n * Open a drive or volume with optional write and lock access\n * Return INVALID_HANDLE_VALUE (/!\\ which is DIFFERENT from NULL /!\\) on failure.\n */\nstatic HANDLE GetHandle(char* Path, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWriteShare)\n{\n\tint i;\n\tBYTE access_mask = 0;\n\tuint64_t EndTime;\n\tHANDLE hDrive = INVALID_HANDLE_VALUE;\n\tchar DevPath[MAX_PATH];\n\n\tif ((safe_strlen(Path) < 5) || (Path[0] != '\\\\') || (Path[1] != '\\\\') || (Path[3] != '\\\\'))\n\t\tgoto out;\n\n\t// Resolve a device path, so that we can look for that handle in case of access issues.\n\tif (safe_strncmp(Path, groot_name, groot_len) == 0)\n\t\tstatic_strcpy(DevPath, &Path[groot_len]);\n\telse if (QueryDosDeviceA(&Path[4], DevPath, sizeof(DevPath)) == 0)\n\t\tstrcpy(DevPath, \"???\");\n\n\tfor (i = 0; i < DRIVE_ACCESS_RETRIES; i++) {\n\t\t// Try without FILE_SHARE_WRITE (unless specifically requested) so that\n\t\t// we won't be bothered by the OS or other apps when we set up our data.\n\t\t// However this means we might have to wait for an access gap...\n\t\t// We keep FILE_SHARE_READ though, as this shouldn't hurt us any, and is\n\t\t// required for enumeration.\n\t\thDrive = CreateFileA(Path, GENERIC_READ|(bWriteAccess?GENERIC_WRITE:0),\n\t\t\tFILE_SHARE_READ|(bWriteShare?FILE_SHARE_WRITE:0),\n\t\t\tNULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n\t\tif (hDrive != INVALID_HANDLE_VALUE)\n\t\t\tbreak;\n\t\tif ((GetLastError() != ERROR_SHARING_VIOLATION) && (GetLastError() != ERROR_ACCESS_DENIED))\n\t\t\tbreak;\n\t\tif (i == 0) {\n\t\t\tuprintf(\"Notice: Volume Device Path is %s\", DevPath);\n\t\t\tuprintf(\"Waiting for access on %s...\", Path);\n\t\t} else if (!bWriteShare && (i > DRIVE_ACCESS_RETRIES/3)) {\n\t\t\t// If we can't seem to get a hold of the drive for some time, try to enable FILE_SHARE_WRITE...\n\t\t\tuprintf(\"WARNING: Could not obtain exclusive rights. Retrying with write sharing enabled...\");\n\t\t\tbWriteShare = TRUE;\n\t\t\t// Try to report the process that is locking the drive\n\t\t\taccess_mask = GetProcessSearch(SEARCH_PROCESS_TIMEOUT, 0x07, FALSE);\n\t\t}\n\t\tSleep(DRIVE_ACCESS_TIMEOUT / DRIVE_ACCESS_RETRIES);\n\t}\n\tif (hDrive == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Could not open %s: %s\", Path, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tif (bWriteAccess) {\n\t\tuprintf(\"Opened %s for %s write access\", Path, bWriteShare?\"shared\":\"exclusive\");\n\t}\n\n\tif (bLockDrive) {\n\t\tif (DeviceIoControl(hDrive, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, NULL, NULL)) {\n\t\t\tuprintf(\"I/O boundary checks disabled\");\n\t\t}\n\n\t\tEndTime = GetTickCount64() + DRIVE_ACCESS_TIMEOUT;\n\t\tdo {\n\t\t\tif (DeviceIoControl(hDrive, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, NULL, NULL))\n\t\t\t\tgoto out;\n\t\t\tif (IS_ERROR(ErrorStatus))\t// User cancel\n\t\t\t\tbreak;\n\t\t\tSleep(DRIVE_ACCESS_TIMEOUT / DRIVE_ACCESS_RETRIES);\n\t\t} while (GetTickCount64() < EndTime);\n\t\t// If we reached this section, either we didn't manage to get a lock or the user cancelled\n\t\tuprintf(\"Could not lock access to %s: %s\", Path, WindowsErrorString());\n\t\t// See if we can report the processes are accessing the drive\n\t\tif (!IS_ERROR(ErrorStatus) && (access_mask == 0))\n\t\t\taccess_mask = GetProcessSearch(SEARCH_PROCESS_TIMEOUT, 0x07, FALSE);\n\t\t// Try to continue if the only access rights we saw were for read-only\n\t\tif ((access_mask & 0x07) != 0x01)\n\t\t\tsafe_closehandle(hDrive);\n\t}\n\nout:\n\treturn hDrive;\n}\n\n/*\n * Return the path to access the physical drive, or NULL on error.\n * The string is allocated and must be freed (to ensure concurrent access)\n */\nchar* GetPhysicalName(DWORD DriveIndex)\n{\n\tBOOL success = FALSE;\n\tchar physical_name[24];\n\n\tCheckDriveIndex(DriveIndex);\n\tstatic_sprintf(physical_name, \"\\\\\\\\.\\\\PhysicalDrive%lu\", DriveIndex);\n\tsuccess = TRUE;\nout:\n\treturn (success)?safe_strdup(physical_name):NULL;\n}\n\n/*\n * Return a handle to the physical drive identified by DriveIndex\n */\nHANDLE GetPhysicalHandle(DWORD DriveIndex, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWriteShare)\n{\n\tHANDLE hPhysical = INVALID_HANDLE_VALUE;\n\tchar* PhysicalPath = GetPhysicalName(DriveIndex);\n\thPhysical = GetHandle(PhysicalPath, bLockDrive, bWriteAccess, bWriteShare);\n\tsafe_free(PhysicalPath);\n\treturn hPhysical;\n}\n\n/*\n * Return the GUID volume name for the disk and partition specified, or NULL if not found.\n * See http://msdn.microsoft.com/en-us/library/cc542456.aspx\n * If PartitionOffset is 0, the offset is ignored and the first partition found is returned.\n * The returned string is allocated and must be freed.\n */\nchar* GetLogicalName(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bKeepTrailingBackslash, BOOL bSilent)\n{\n\tstatic const char* ignore_device[] = { \"\\\\Device\\\\CdRom\", \"\\\\Device\\\\Floppy\" };\n\tstatic const char* volume_start = \"\\\\\\\\?\\\\\";\n\tchar *ret = NULL, volume_name[MAX_PATH], path[MAX_PATH];\n\tBOOL r, bPrintHeader = TRUE;\n\tHANDLE hDrive = INVALID_HANDLE_VALUE, hVolume = INVALID_HANDLE_VALUE;\n\tVOLUME_DISK_EXTENTS_REDEF DiskExtents;\n\tDWORD size = 0;\n\tUINT drive_type;\n\tStrArray found_name;\n\tuint64_t found_offset[MAX_PARTITIONS] = { 0 };\n\tuint32_t i, j;\n\tsize_t len;\n\n\tStrArrayCreate(&found_name, MAX_PARTITIONS);\n\tCheckDriveIndex(DriveIndex);\n\n\tfor (i = 0; hDrive == INVALID_HANDLE_VALUE; i++) {\n\t\tif (i == 0) {\n\t\t\thVolume = FindFirstVolumeA(volume_name, sizeof(volume_name));\n\t\t\tif (hVolume == INVALID_HANDLE_VALUE) {\n\t\t\t\tsuprintf(\"Could not access first GUID volume: %s\", WindowsErrorString());\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else {\n\t\t\tif (!FindNextVolumeA(hVolume, volume_name, sizeof(volume_name))) {\n\t\t\t\tif (GetLastError() != ERROR_NO_MORE_FILES) {\n\t\t\t\t\tsuprintf(\"Could not access next GUID volume: %s\", WindowsErrorString());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Sanity checks\n\t\tlen = safe_strlen(volume_name);\n\t\tif_assert_fails(len > 4)\n\t\t\tcontinue;\n\t\tif_assert_fails(safe_strnicmp(volume_name, volume_start, 4) == 0)\n\t\t\tcontinue;\n\t\tif_assert_fails(volume_name[len - 1] == '\\\\')\n\t\t\tcontinue;\n\n\t\tdrive_type = GetDriveTypeA(volume_name);\n\t\tif ((drive_type != DRIVE_REMOVABLE) && (drive_type != DRIVE_FIXED))\n\t\t\tcontinue;\n\n\t\tvolume_name[len-1] = 0;\n\n\t\tif (QueryDosDeviceA(&volume_name[4], path, sizeof(path)) == 0) {\n\t\t\tsuprintf(\"Failed to get device path for GUID volume '%s': %s\", volume_name, WindowsErrorString());\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (j=0; (j<ARRAYSIZE(ignore_device)) &&\n\t\t\t(_strnicmp(path, ignore_device[j], safe_strlen(ignore_device[j])) != 0); j++);\n\t\tif (j < ARRAYSIZE(ignore_device)) {\n\t\t\tsuprintf(\"Skipping GUID volume for '%s'\", path);\n\t\t\tcontinue;\n\t\t}\n\n\t\thDrive = CreateFileWithTimeout(volume_name, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,\n\t\t\tNULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL, 3000);\n\t\tif (hDrive == INVALID_HANDLE_VALUE) {\n\t\t\tsuprintf(\"Could not open GUID volume '%s': %s\", volume_name, WindowsErrorString());\n\t\t\tcontinue;\n\t\t}\n\n\t\tr = DeviceIoControl(hDrive, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, NULL, 0, &DiskExtents, sizeof(DiskExtents), &size, NULL);\n\t\tif ((!r) || (size == 0)) {\n\t\t\tsuprintf(\"Could not get Disk Extents: %s\", r ? \"(empty data)\" : WindowsErrorString());\n\t\t\tsafe_closehandle(hDrive);\n\t\t\tcontinue;\n\t\t}\n\t\tsafe_closehandle(hDrive);\n\t\tif (DiskExtents.NumberOfDiskExtents == 0) {\n\t\t\tsuprintf(\"Ignoring volume '%s' because it has no extents...\", volume_name);\n\t\t\tcontinue;\n\t\t}\n\t\tif (DiskExtents.NumberOfDiskExtents != 1) {\n\t\t\t// If we have more than one extent for a volume, it means that someone\n\t\t\t// is using RAID-1 or something => Stay well away from such a volume!\n\t\t\tsuprintf(\"Ignoring volume '%s' because it has more than one extent (RAID?)...\", volume_name);\n\t\t\tcontinue;\n\t\t}\n\t\tif (DiskExtents.Extents[0].DiskNumber != DriveIndex)\n\t\t\t// Not on our disk\n\t\t\tcontinue;\n\n\t\tif (found_name.Index == MAX_PARTITIONS) {\n\t\t\tuprintf(\"Error: Trying to process a disk with more than %d partitions!\", MAX_PARTITIONS);\n\t\t\tgoto out;\n\t\t}\n\n\t\tif (bKeepTrailingBackslash)\n\t\t\tvolume_name[len - 1] = '\\\\';\n\t\tfound_offset[found_name.Index] = DiskExtents.Extents[0].StartingOffset.QuadPart;\n\t\tStrArrayAdd(&found_name, volume_name, TRUE);\n\t\tif (!bSilent) {\n\t\t\tif (bPrintHeader) {\n\t\t\t\tbPrintHeader = FALSE;\n\t\t\t\tuuprintf(\"Windows volumes from this device:\");\n\t\t\t}\n\t\t\tuuprintf(\"● %s @%lld\", volume_name, DiskExtents.Extents[0].StartingOffset.QuadPart);\n\t\t}\n\t}\n\n\tif (found_name.Index == 0)\n\t\tgoto out;\n\n\t// Now process all the volumes we found, and try to match one with our partition offset\n\tfor (i = 0; (i < found_name.Index) && (PartitionOffset != 0) && (PartitionOffset != found_offset[i]); i++);\n\n\tif (i < found_name.Index) {\n\t\tret = safe_strdup(found_name.String[i]);\n\t} else {\n\t\t// NB: We need to re-add DRIVE_INDEX_MIN for this call since CheckDriveIndex() subtracted it\n\t\tret = AltGetLogicalName(DriveIndex + DRIVE_INDEX_MIN, PartitionOffset, bKeepTrailingBackslash, bSilent);\n\t\tif ((ret != NULL) && (strchr(ret, ' ') != NULL))\n\t\t\tuprintf(\"WARNING: Using physical device to access partition data\");\n\t}\n\nout:\n\tif (hVolume != INVALID_HANDLE_VALUE)\n\t\tFindVolumeClose(hVolume);\n\tStrArrayDestroy(&found_name);\n\treturn ret;\n}\n\n/*\n * Alternative version of the above, needed because some volumes, such as ESPs, are not listed\n * by Windows, be it with VDS or other APIs.\n * For these, we return the \"\\\\?\\GLOBALROOT\\Device\\HarddiskVolume#\" identifier that matches\n * our \"Harddisk#Partition#\", as reported by QueryDosDevice().\n * The returned string is allocated and must be freed.\n*/\nchar* AltGetLogicalName(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bKeepTrailingBackslash, BOOL bSilent)\n{\n\tBOOL matching_drive = (DriveIndex == SelectedDrive.DeviceNumber);\n\tDWORD i;\n\tchar *ret = NULL, volume_name[MAX_PATH], path[64];\n\n\tCheckDriveIndex(DriveIndex);\n\n\t// Match the offset to a partition index\n\tif (PartitionOffset == 0) {\n\t\ti = 0;\n\t} else if (matching_drive) {\n\t\tfor (i = 0; (i < MAX_PARTITIONS) && (PartitionOffset != SelectedDrive.Partition[i].Offset); i++);\n\t\tif (i >= MAX_PARTITIONS) {\n\t\t\tsuprintf(\"Error: Could not find a partition at offset %lld on this disk\", PartitionOffset);\n\t\t\tgoto out;\n\t\t}\n\t} else {\n\t\tsuprintf(\"Error: Searching for a partition on a non matching disk\");\n\t\tgoto out;\n\t}\n\tstatic_sprintf(path, \"Harddisk%luPartition%lu\", DriveIndex, i + 1);\n\tstatic_strcpy(volume_name, groot_name);\n\tif (!QueryDosDeviceA(path, &volume_name[groot_len], (DWORD)(MAX_PATH - groot_len)) || (strlen(volume_name) < 20)) {\n\t\tsuprintf(\"Could not find a DOS volume name for '%s': %s\", path, WindowsErrorString());\n\t\tgoto out;\n\t} else if (bKeepTrailingBackslash) {\n\t\tstatic_strcat(volume_name, \"\\\\\");\n\t}\n\tret = safe_strdup(volume_name);\n\nout:\n\treturn ret;\n}\n\n/*\n * Custom volume name for extfs formatting (that includes partition offset and partition size)\n * so that these can be created and accessed on pre 1703 versions of Windows.\n */\nchar* GetExtPartitionName(DWORD DriveIndex, uint64_t PartitionOffset)\n{\n\tDWORD i;\n\tchar* ret = NULL, volume_name[MAX_PATH];\n\n\t// Can't operate if we're not on the selected drive\n\tif (DriveIndex != SelectedDrive.DeviceNumber)\n\t\tgoto out;\n\tCheckDriveIndex(DriveIndex);\n\tfor (i = 0; (i < MAX_PARTITIONS) && (PartitionOffset != SelectedDrive.Partition[i].Offset); i++);\n\tif (i >= MAX_PARTITIONS)\n\t\tgoto out;\n\tstatic_sprintf(volume_name, \"\\\\\\\\.\\\\PhysicalDrive%lu %I64u %I64u\", DriveIndex,\n\t\tSelectedDrive.Partition[i].Offset, SelectedDrive.Partition[i].Size);\n\tret = safe_strdup(volume_name);\nout:\n\treturn ret;\n}\n\nstatic const char* VdsErrorString(HRESULT hr) {\n\tSetLastError(hr);\n\treturn WindowsErrorString();\n}\n\n/*\n * Per https://docs.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-cocreateinstance\n * and even though we aren't a UWP app, Windows Store prevents the ability to use of VDS when the\n * Store version of Rufus is running (the call to IVdsServiceLoader_LoadService() will return\n * E_ACCESSDENIED).\n */\nBOOL IsVdsAvailable(BOOL bSilent)\n{\n\tHRESULT hr = S_FALSE;\n\tIVdsService* pService = NULL;\n\tIVdsServiceLoader* pLoader = NULL;\n\n\t// Initialize COM\n\tIGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));\n\tIGNORE_RETVAL(CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_CONNECT,\n\t\tRPC_C_IMP_LEVEL_IMPERSONATE, NULL, 0, NULL));\n\n\t// Create a VDS Loader Instance\n\thr = CoCreateInstance(&CLSID_VdsLoader, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,\n\t\t&IID_IVdsServiceLoader, (void**)&pLoader);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"Notice: Disabling VDS (Could not create VDS Loader Instance: %s)\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\thr = IVdsServiceLoader_LoadService(pLoader, L\"\", &pService);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"Notice: Disabling VDS (Could not load VDS Service: %s)\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\nout:\n\tif (pService != NULL)\n\t\tIVdsService_Release(pService);\n\tif (pLoader != NULL)\n\t\tIVdsServiceLoader_Release(pLoader);\n\tVDS_SET_ERROR(hr);\n\treturn (hr == S_OK);\n}\n\n/*\n * Call on VDS to refresh the drive layout\n */\nBOOL RefreshLayout(DWORD DriveIndex)\n{\n\tHRESULT hr = S_FALSE;\n\twchar_t wPhysicalName[24];\n\tIVdsServiceLoader* pLoader = NULL;\n\tIVdsService* pService = NULL;\n\tIEnumVdsObject *pEnum;\n\n\tCheckDriveIndex(DriveIndex);\n\twnsprintf(wPhysicalName, ARRAYSIZE(wPhysicalName), L\"\\\\\\\\?\\\\PhysicalDrive%lu\", DriveIndex);\n\n\t// Initialize COM\n\tIGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));\n\tIGNORE_RETVAL(CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_CONNECT,\n\t\tRPC_C_IMP_LEVEL_IMPERSONATE, NULL, 0, NULL));\n\n\t// Create a VDS Loader Instance\n\thr = CoCreateInstance(&CLSID_VdsLoader, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,\n\t\t&IID_IVdsServiceLoader, (void **)&pLoader);\n\tif (hr != S_OK) {\n\t\tuprintf(\"Could not create VDS Loader Instance: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Load the VDS Service\n\thr = IVdsServiceLoader_LoadService(pLoader, L\"\", &pService);\n\tif (hr != S_OK) {\n\t\tuprintf(\"Could not load VDS Service: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Wait for the Service to become ready if needed\n\thr = IVdsService_WaitForServiceReady(pService);\n\tif (hr != S_OK) {\n\t\tuprintf(\"VDS Service is not ready: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Query the VDS Service Providers\n\thr = IVdsService_QueryProviders(pService, VDS_QUERY_SOFTWARE_PROVIDERS, &pEnum);\n\tif (hr != S_OK) {\n\t\tuprintf(\"Could not query VDS Service Providers: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Remove mountpoints\n\thr = IVdsService_CleanupObsoleteMountPoints(pService);\n\tif (hr != S_OK) {\n\t\tuprintf(\"Could not clean up VDS mountpoints: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Invoke layout refresh\n\thr = IVdsService_Refresh(pService);\n\tif (hr != S_OK) {\n\t\tuprintf(\"Could not refresh VDS layout: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Force re-enum\n\thr = IVdsService_Reenumerate(pService);\n\tif (hr != S_OK) {\n\t\tuprintf(\"Could not refresh VDS layout: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\nout:\n\tif (pService != NULL)\n\t\tIVdsService_Release(pService);\n\tif (pLoader != NULL)\n\t\tIVdsServiceLoader_Release(pLoader);\n\tVDS_SET_ERROR(hr);\n\treturn (hr == S_OK);\n}\n\n/*\n * Generic call to instantiate a VDS Disk Interface. Mostly copied from:\n * https://social.msdn.microsoft.com/Forums/vstudio/en-US/b90482ae-4e44-4b08-8731-81915030b32a/createpartition-using-vds-interface-throw-error-enointerface-dcom?forum=vcgeneral\n * See also: https://docs.microsoft.com/en-us/windows/win32/vds/working-with-enumeration-objects\n */\nstatic BOOL GetVdsDiskInterface(DWORD DriveIndex, const IID* InterfaceIID, void** pInterfaceInstance, BOOL bSilent)\n{\n\tHRESULT hr = S_FALSE;\n\tULONG ulFetched;\n\twchar_t wPhysicalName[24];\n\tIVdsServiceLoader* pLoader;\n\tIVdsService* pService;\n\tIEnumVdsObject* pEnum;\n\tIUnknown* pUnk;\n\n\t*pInterfaceInstance = NULL;\n\tCheckDriveIndex(DriveIndex);\n\twnsprintf(wPhysicalName, ARRAYSIZE(wPhysicalName), L\"\\\\\\\\?\\\\PhysicalDrive%lu\", DriveIndex);\n\n\t// Initialize COM\n\tIGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));\n\tIGNORE_RETVAL(CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_CONNECT,\n\t\tRPC_C_IMP_LEVEL_IMPERSONATE, NULL, 0, NULL));\n\n\t// Create a VDS Loader Instance\n\thr = CoCreateInstance(&CLSID_VdsLoader, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,\n\t\t&IID_IVdsServiceLoader, (void**)&pLoader);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"Could not create VDS Loader Instance: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Load the VDS Service\n\thr = IVdsServiceLoader_LoadService(pLoader, L\"\", &pService);\n\tIVdsServiceLoader_Release(pLoader);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"Could not load VDS Service: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Wait for the Service to become ready if needed\n\thr = IVdsService_WaitForServiceReady(pService);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"VDS Service is not ready: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Query the VDS Service Providers\n\thr = IVdsService_QueryProviders(pService, VDS_QUERY_SOFTWARE_PROVIDERS, &pEnum);\n\tIVdsService_Release(pService);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"Could not query VDS Service Providers: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\twhile (IEnumVdsObject_Next(pEnum, 1, &pUnk, &ulFetched) == S_OK) {\n\t\tIVdsProvider* pProvider;\n\t\tIVdsSwProvider* pSwProvider;\n\t\tIEnumVdsObject* pEnumPack;\n\t\tIUnknown* pPackUnk;\n\n\t\t// Get VDS Provider\n\t\thr = IUnknown_QueryInterface(pUnk, &IID_IVdsProvider, (void**)&pProvider);\n\t\tIUnknown_Release(pUnk);\n\t\tif (hr != S_OK) {\n\t\t\tsuprintf(\"Could not get VDS Provider: %s\", VdsErrorString(hr));\n\t\t\tbreak;\n\t\t}\n\n\t\t// Get VDS Software Provider\n\t\thr = IVdsSwProvider_QueryInterface(pProvider, &IID_IVdsSwProvider, (void**)&pSwProvider);\n\t\tIVdsProvider_Release(pProvider);\n\t\tif (hr != S_OK) {\n\t\t\tsuprintf(\"Could not get VDS Software Provider: %s\", VdsErrorString(hr));\n\t\t\tbreak;\n\t\t}\n\n\t\t// Get VDS Software Provider Packs\n\t\thr = IVdsSwProvider_QueryPacks(pSwProvider, &pEnumPack);\n\t\tIVdsSwProvider_Release(pSwProvider);\n\t\tif (hr != S_OK) {\n\t\t\tsuprintf(\"Could not get VDS Software Provider Packs: %s\", VdsErrorString(hr));\n\t\t\tbreak;\n\t\t}\n\n\t\t// Enumerate Provider Packs\n\t\twhile (IEnumVdsObject_Next(pEnumPack, 1, &pPackUnk, &ulFetched) == S_OK) {\n\t\t\tIVdsPack* pPack;\n\t\t\tIEnumVdsObject* pEnumDisk;\n\t\t\tIUnknown* pDiskUnk;\n\n\t\t\thr = IUnknown_QueryInterface(pPackUnk, &IID_IVdsPack, (void**)&pPack);\n\t\t\tIUnknown_Release(pPackUnk);\n\t\t\tif (hr != S_OK) {\n\t\t\t\tsuprintf(\"Could not query VDS Software Provider Pack: %s\", VdsErrorString(hr));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Use the pack interface to access the disks\n\t\t\thr = IVdsPack_QueryDisks(pPack, &pEnumDisk);\n\t\t\tIVdsPack_Release(pPack);\n\t\t\tif (hr != S_OK) {\n\t\t\t\tsuprintf(\"Could not query VDS disks: %s\", VdsErrorString(hr));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// List disks\n\t\t\twhile (IEnumVdsObject_Next(pEnumDisk, 1, &pDiskUnk, &ulFetched) == S_OK) {\n\t\t\t\tBOOL r;\n\t\t\t\tVDS_DISK_PROP prop;\n\t\t\t\tIVdsDisk* pDisk;\n\n\t\t\t\t// Get the disk interface.\n\t\t\t\thr = IUnknown_QueryInterface(pDiskUnk, &IID_IVdsDisk, (void**)&pDisk);\n\t\t\t\tIUnknown_Release(pDiskUnk);\n\t\t\t\tif (hr != S_OK) {\n\t\t\t\t\tsuprintf(\"Could not query VDS Disk Interface: %s\", VdsErrorString(hr));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Get the disk properties\n\t\t\t\thr = IVdsDisk_GetProperties(pDisk, &prop);\n\t\t\t\tif ((hr != S_OK) && (hr != VDS_S_PROPERTIES_INCOMPLETE)) {\n\t\t\t\t\tIVdsDisk_Release(pDisk);\n\t\t\t\t\tsuprintf(\"Could not query VDS Disk Properties: %s\", VdsErrorString(hr));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\thr = S_OK;\n\n\t\t\t\t// Check if we are on the target disk. Note that prop.pwszName can be NULL on failed disks.\n\t\t\t\tr = (prop.pwszName != NULL) && (_wcsicmp(wPhysicalName, prop.pwszName) == 0);\n\t\t\t\tCoTaskMemFree(prop.pwszName);\t// NB: Per MS docs, CoTaskMemFree() accepts NULL.\n\t\t\t\tif (!r) {\n\t\t\t\t\tIVdsDisk_Release(pDisk);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Instantiate the requested VDS disk interface\n\t\t\t\thr = IVdsDisk_QueryInterface(pDisk, InterfaceIID, pInterfaceInstance);\n\t\t\t\tIVdsDisk_Release(pDisk);\n\t\t\t\tif (hr != S_OK)\n\t\t\t\t\tsuprintf(\"Could not access the requested Disk interface: %s\", VdsErrorString(hr));\n\n\t\t\t\t// With the interface found, we should be able to return\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tIEnumVdsObject_Release(pEnumDisk);\n\t\t}\n\t\tIEnumVdsObject_Release(pEnumPack);\n\t}\n\tIEnumVdsObject_Release(pEnum);\n\nout:\n\tVDS_SET_ERROR(hr);\n\treturn (hr == S_OK);\n}\n\n/*\n * Invoke IVdsService::Refresh() and/or IVdsService::Reenumerate() to force a\n * rescan of the VDS disks. This can become necessary after writing an image\n * such as Ubuntu 20.10, as Windows may \"lose\" the active disk otherwise...\n */\nBOOL VdsRescan(DWORD dwRescanType, DWORD dwSleepTime, BOOL bSilent)\n{\n\tBOOL ret = TRUE;\n\tHRESULT hr = S_FALSE;\n\tIVdsServiceLoader* pLoader;\n\tIVdsService* pService;\n\n\tIGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));\n\tIGNORE_RETVAL(CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_CONNECT,\n\t\tRPC_C_IMP_LEVEL_IMPERSONATE, NULL, 0, NULL));\n\n\thr = CoCreateInstance(&CLSID_VdsLoader, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,\n\t\t&IID_IVdsServiceLoader, (void**)&pLoader);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"Could not create VDS Loader Instance: %s\", VdsErrorString(hr));\n\t\treturn FALSE;\n\t}\n\n\thr = IVdsServiceLoader_LoadService(pLoader, L\"\", &pService);\n\tIVdsServiceLoader_Release(pLoader);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"Could not load VDS Service: %s\", VdsErrorString(hr));\n\t\treturn FALSE;\n\t}\n\n\thr = IVdsService_WaitForServiceReady(pService);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"VDS Service is not ready: %s\", VdsErrorString(hr));\n\t\treturn FALSE;\n\t}\n\n\t// https://docs.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdsservice-refresh\n\t// This method synchronizes the disk layout to the layout known to the disk driver.\n\t// It does not force the driver to read the layout from the disk.\n\t// Additionally, this method refreshes the view of all objects in the VDS cache.\n\tif (dwRescanType & VDS_RESCAN_REFRESH) {\n\t\thr = IVdsService_Refresh(pService);\n\t\tif (hr != S_OK) {\n\t\t\tsuprintf(\"VDS Refresh failed: %s\", VdsErrorString(hr));\n\t\t\tret = FALSE;\n\t\t}\n\t}\n\n\t// https://docs.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdsservice-reenumerate\n\t// This method returns immediately after a bus rescan request is issued.\n\t// The operation might be incomplete when the method returns.\n\tif (dwRescanType & VDS_RESCAN_REENUMERATE) {\n\t\thr = IVdsService_Reenumerate(pService);\n\t\tif (hr != S_OK) {\n\t\t\tsuprintf(\"VDS Re-enumeration failed: %s\", VdsErrorString(hr));\n\t\t\tret = FALSE;\n\t\t}\n\t}\n\n\tif (dwSleepTime != 0)\n\t\tSleep(dwSleepTime);\n\n\treturn ret;\n}\n\n/*\n * Delete one partition at offset PartitionOffset, or all partitions if the offset is 0.\n */\nBOOL DeletePartition(DWORD DriveIndex, ULONGLONG PartitionOffset, BOOL bSilent)\n{\n\tHRESULT hr = S_FALSE;\n\tVDS_PARTITION_PROP* prop_array = NULL;\n\tLONG i, prop_array_size;\n\tIVdsAdvancedDisk *pAdvancedDisk = NULL;\n\n\tif (!GetVdsDiskInterface(DriveIndex, &IID_IVdsAdvancedDisk, (void**)&pAdvancedDisk, bSilent))\n\t\treturn FALSE;\n\tif (pAdvancedDisk == NULL) {\n\t\tsuprintf(\"Looks like Windows has \\\"lost\\\" our disk - Forcing a VDS rescan...\");\n\t\tVdsRescan(VDS_RESCAN_REFRESH | VDS_RESCAN_REENUMERATE, 1000, bSilent);\n\t\tif (!GetVdsDiskInterface(DriveIndex, &IID_IVdsAdvancedDisk, (void**)&pAdvancedDisk, bSilent) ||\n\t\t\t(pAdvancedDisk == NULL)) {\n\t\t\tsuprintf(\"Could not locate disk - Aborting.\");\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\n\t// Query the partition data, so we can get the start offset, which we need for deletion\n\thr = IVdsAdvancedDisk_QueryPartitions(pAdvancedDisk, &prop_array, &prop_array_size);\n\tif (hr == S_OK) {\n\t\tsuprintf(\"Deleting partition%s:\", (PartitionOffset == 0) ? \"s\" : \"\");\n\t\t// Now go through each partition\n\t\tfor (i = 0; i < prop_array_size; i++) {\n\t\t\tif ((PartitionOffset != 0) && (prop_array[i].ullOffset != PartitionOffset))\n\t\t\t\tcontinue;\n\t\t\tsuprintf(\"● Partition %d (offset: %lld, size: %s)\", prop_array[i].ulPartitionNumber,\n\t\t\t\tprop_array[i].ullOffset, SizeToHumanReadable(prop_array[i].ullSize, FALSE, FALSE));\n\t\t\thr = IVdsAdvancedDisk_DeletePartition(pAdvancedDisk, prop_array[i].ullOffset, TRUE, TRUE);\n\t\t\tif (hr != S_OK)\n\t\t\t\tsuprintf(\"Could not delete partition: %s\", VdsErrorString(hr));\n\t\t}\n\t} else {\n\t\tsuprintf(\"No partition to delete on disk\");\n\t\thr = S_OK;\n\t}\n\tCoTaskMemFree(prop_array);\n\tIVdsAdvancedDisk_Release(pAdvancedDisk);\n\tVDS_SET_ERROR(hr);\n\treturn (hr == S_OK);\n}\n\n/*\n * Count on Microsoft for *COMPLETELY CRIPPLING* an API when allegedly upgrading it...\n * As illustrated when you do so with diskpart (which uses VDS behind the scenes), VDS\n * simply *DOES NOT* list all the volumes that the system can see, especially compared\n * to what mountvol (which uses FindFirstVolume()/FindNextVolume()) and other APIs do.\n * Also for reference, if you want to list volumes through WMI in PowerShell:\n * Get-WmiObject win32_volume | Format-Table -Property DeviceID,Name,Label,Capacity\n */\nBOOL ListVdsVolumes(BOOL bSilent)\n{\n\tHRESULT hr = S_FALSE;\n\tULONG ulFetched;\n\tIVdsServiceLoader* pLoader;\n\tIVdsService* pService;\n\tIEnumVdsObject* pEnum;\n\tIUnknown* pUnk;\n\n\t// Initialize COM\n\tIGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));\n\tIGNORE_RETVAL(CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_CONNECT,\n\t\tRPC_C_IMP_LEVEL_IMPERSONATE, NULL, 0, NULL));\n\n\t// Create a VDS Loader Instance\n\thr = CoCreateInstance(&CLSID_VdsLoader, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,\n\t\t&IID_IVdsServiceLoader, (void**)&pLoader);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"Could not create VDS Loader Instance: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Load the VDS Service\n\thr = IVdsServiceLoader_LoadService(pLoader, L\"\", &pService);\n\tIVdsServiceLoader_Release(pLoader);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"Could not load VDS Service: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Wait for the Service to become ready if needed\n\thr = IVdsService_WaitForServiceReady(pService);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"VDS Service is not ready: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\t// Query the VDS Service Providers\n\thr = IVdsService_QueryProviders(pService, VDS_QUERY_SOFTWARE_PROVIDERS, &pEnum);\n\tIVdsService_Release(pService);\n\tif (hr != S_OK) {\n\t\tsuprintf(\"Could not query VDS Service Providers: %s\", VdsErrorString(hr));\n\t\tgoto out;\n\t}\n\n\twhile (IEnumVdsObject_Next(pEnum, 1, &pUnk, &ulFetched) == S_OK) {\n\t\tIVdsProvider* pProvider;\n\t\tIVdsSwProvider* pSwProvider;\n\t\tIEnumVdsObject* pEnumPack;\n\t\tIUnknown* pPackUnk;\n\n\t\t// Get VDS Provider\n\t\thr = IUnknown_QueryInterface(pUnk, &IID_IVdsProvider, (void**)&pProvider);\n\t\tIUnknown_Release(pUnk);\n\t\tif (hr != S_OK) {\n\t\t\tsuprintf(\"Could not get VDS Provider: %s\", VdsErrorString(hr));\n\t\t\tbreak;\n\t\t}\n\n\t\t// Get VDS Software Provider\n\t\thr = IVdsSwProvider_QueryInterface(pProvider, &IID_IVdsSwProvider, (void**)&pSwProvider);\n\t\tIVdsProvider_Release(pProvider);\n\t\tif (hr != S_OK) {\n\t\t\tsuprintf(\"Could not get VDS Software Provider: %s\", VdsErrorString(hr));\n\t\t\tbreak;\n\t\t}\n\n\t\t// Get VDS Software Provider Packs\n\t\thr = IVdsSwProvider_QueryPacks(pSwProvider, &pEnumPack);\n\t\tIVdsSwProvider_Release(pSwProvider);\n\t\tif (hr != S_OK) {\n\t\t\tsuprintf(\"Could not get VDS Software Provider Packs: %s\", VdsErrorString(hr));\n\t\t\tbreak;\n\t\t}\n\n\t\t// Enumerate Provider Packs\n\t\twhile (IEnumVdsObject_Next(pEnumPack, 1, &pPackUnk, &ulFetched) == S_OK) {\n\t\t\tIVdsPack* pPack;\n\t\t\tIEnumVdsObject* pEnumVolume;\n\t\t\tIUnknown* pVolumeUnk;\n\n\t\t\thr = IUnknown_QueryInterface(pPackUnk, &IID_IVdsPack, (void**)&pPack);\n\t\t\tIUnknown_Release(pPackUnk);\n\t\t\tif (hr != S_OK) {\n\t\t\t\tsuprintf(\"Could not query VDS Software Provider Pack: %s\", VdsErrorString(hr));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Use the pack interface to access the disks\n\t\t\thr = IVdsPack_QueryVolumes(pPack, &pEnumVolume);\n\t\t\tif (hr != S_OK) {\n\t\t\t\tsuprintf(\"Could not query VDS volumes: %s\", VdsErrorString(hr));\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// List volumes\n\t\t\twhile (IEnumVdsObject_Next(pEnumVolume, 1, &pVolumeUnk, &ulFetched) == S_OK) {\n\t\t\t\tIVdsVolume* pVolume;\n\t\t\t\tIVdsVolumeMF3* pVolumeMF3;\n\t\t\t\tVDS_VOLUME_PROP prop;\n\t\t\t\tLPWSTR* wszPathArray;\n\t\t\t\tULONG i, ulNumberOfPaths;\n\n\t\t\t\t// Get the volume interface.\n\t\t\t\thr = IUnknown_QueryInterface(pVolumeUnk, &IID_IVdsVolume, (void**)&pVolume);\n\t\t\t\tif (hr != S_OK) {\n\t\t\t\t\tsuprintf(\"Could not query VDS Volume Interface: %s\", VdsErrorString(hr));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Get the volume properties\n\t\t\t\thr = IVdsVolume_GetProperties(pVolume, &prop);\n\t\t\t\tif ((hr != S_OK) && (hr != VDS_S_PROPERTIES_INCOMPLETE)) {\n\t\t\t\t\tsuprintf(\"Could not query VDS Volume Properties: %s\", VdsErrorString(hr));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tuprintf(\"FOUND VOLUME: '%S'\", prop.pwszName);\n\t\t\t\tCoTaskMemFree(prop.pwszName);\n\t\t\t\tIVdsVolume_Release(pVolume);\n\n\t\t\t\t// Get the volume MF3 interface.\n\t\t\t\thr = IUnknown_QueryInterface(pVolumeUnk, &IID_IVdsVolumeMF3, (void**)&pVolumeMF3);\n\t\t\t\tif (hr != S_OK) {\n\t\t\t\t\tsuprintf(\"Could not query VDS VolumeMF3 Interface: %s\", VdsErrorString(hr));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Get the volume properties\n\t\t\t\thr = IVdsVolumeMF3_QueryVolumeGuidPathnames(pVolumeMF3, &wszPathArray, &ulNumberOfPaths);\n\t\t\t\tif ((hr != S_OK) && (hr != VDS_S_PROPERTIES_INCOMPLETE)) {\n\t\t\t\t\tsuprintf(\"Could not query VDS VolumeMF3 GUID PathNames: %s\", VdsErrorString(hr));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\thr = S_OK;\n\n\t\t\t\tfor (i = 0; i < ulNumberOfPaths; i++)\n\t\t\t\t\tuprintf(\"  VOL GUID: '%S'\", wszPathArray[i]);\n\t\t\t\tCoTaskMemFree(wszPathArray);\n\t\t\t\tIVdsVolume_Release(pVolumeMF3);\n\t\t\t\tIUnknown_Release(pVolumeUnk);\n\t\t\t}\n\t\t\tIEnumVdsObject_Release(pEnumVolume);\n\t\t}\n\t\tIEnumVdsObject_Release(pEnumPack);\n\t}\n\tIEnumVdsObject_Release(pEnum);\n\nout:\n\tVDS_SET_ERROR(hr);\n\treturn (hr == S_OK);\n}\n\n/* Wait for a logical drive to reappear - Used when a drive has just been repartitioned */\nBOOL WaitForLogical(DWORD DriveIndex, uint64_t PartitionOffset)\n{\n\tuint64_t EndTime;\n\tchar* LogicalPath = NULL;\n\n\t// GetLogicalName() calls may be slow, so use the system time to\n\t// make sure we don't spend more than DRIVE_ACCESS_TIMEOUT in wait.\n\tEndTime = GetTickCount64() + DRIVE_ACCESS_TIMEOUT;\n\tdo {\n\t\tLogicalPath = GetLogicalName(DriveIndex, PartitionOffset, FALSE, TRUE);\n\t\t// Need to filter out GlobalRoot devices as we don't want to wait on those\n\t\tif ((LogicalPath != NULL) && (strncmp(LogicalPath, groot_name, groot_len) != 0)) {\n\t\t\tfree(LogicalPath);\n\t\t\treturn TRUE;\n\t\t}\n\t\tfree(LogicalPath);\n\t\tif (IS_ERROR(ErrorStatus))\t// User cancel\n\t\t\treturn FALSE;\n\t\tSleep(DRIVE_ACCESS_TIMEOUT / DRIVE_ACCESS_RETRIES);\n\t} while (GetTickCount64() < EndTime);\n\tuprintf(\"Timeout while waiting for logical drive\");\n\treturn FALSE;\n}\n\n/*\n * Obtain a handle to the volume identified by DriveIndex + PartitionIndex\n * Returns INVALID_HANDLE_VALUE on error or NULL if no logical path exists (typical\n * of unpartitioned drives)\n */\nHANDLE GetLogicalHandle(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWriteShare)\n{\n\tHANDLE hLogical = INVALID_HANDLE_VALUE;\n\tchar* LogicalPath = GetLogicalName(DriveIndex, PartitionOffset, FALSE, FALSE);\n\n\tif (LogicalPath == NULL) {\n\t\tuprintf(\"No logical drive found (unpartitioned?)\");\n\t\treturn NULL;\n\t}\n\n\thLogical = GetHandle(LogicalPath, bLockDrive, bWriteAccess, bWriteShare);\n\tfree(LogicalPath);\n\treturn hLogical;\n}\n\n/* Alternate version of the above, for ESPs */\nHANDLE AltGetLogicalHandle(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWriteShare)\n{\n\tHANDLE hLogical = INVALID_HANDLE_VALUE;\n\tchar* LogicalPath = AltGetLogicalName(DriveIndex, PartitionOffset, FALSE, FALSE);\n\n\tif (LogicalPath == NULL) {\n\t\tuprintf(\"No logical drive found\");\n\t\treturn NULL;\n\t}\n\n\thLogical = GetHandle(LogicalPath, bLockDrive, bWriteAccess, bWriteShare);\n\tfree(LogicalPath);\n\treturn hLogical;\n}\n\n/*\n * Who would have thought that Microsoft would make it so unbelievably hard to\n * get the frickin' device number for a drive? You have to use TWO different\n * methods to have a chance to get it!\n */\nint GetDriveNumber(HANDLE hDrive, char* path)\n{\n\tSTORAGE_DEVICE_NUMBER_REDEF DeviceNumber;\n\tVOLUME_DISK_EXTENTS_REDEF DiskExtents;\n\tDWORD size = 0;\n\tBOOL s;\n\tint r = -1;\n\n\tif (!DeviceIoControl(hDrive, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, NULL, 0, &DiskExtents, sizeof(DiskExtents), &size, NULL) ||\n\t\t(size <= 0) || (DiskExtents.NumberOfDiskExtents < 1)) {\n\t\t// DiskExtents are NO_GO (which is the case for external USB HDDs...)\n\t\ts = DeviceIoControl(hDrive, IOCTL_STORAGE_GET_DEVICE_NUMBER, NULL, 0, &DeviceNumber, sizeof(DeviceNumber), &size, NULL);\n\t\tif ((!s) || (size == 0)) {\n\t\t\tuuprintf(\"Could not get device number for device %s %s\", path, s ? \"(empty data)\" : WindowsErrorString());\n\t\t\treturn -1;\n\t\t}\n\t\tr = (int)DeviceNumber.DeviceNumber;\n\t} else if (DiskExtents.NumberOfDiskExtents >= 2) {\n\t\tuprintf(\"Ignoring drive '%s' as it spans multiple disks (RAID?)\", path);\n\t\treturn -1;\n\t} else {\n\t\tr = (int)DiskExtents.Extents[0].DiskNumber;\n\t}\n\tif (r >= MAX_DRIVES) {\n\t\tuprintf(\"Device Number for device %s is too big (%d) - ignoring device\", path, r);\n\t\tuprintf(\"NOTE: This may be due to an excess of Virtual Drives, such as hidden ones created by the XBox PC app\");\n\t\treturn -1;\n\t}\n\treturn r;\n}\n\n/*\n * Returns the drive letters for all volumes located on the drive identified by DriveIndex,\n * as well as the drive type. This is used as base for the 2 function calls that follow.\n */\nstatic BOOL _GetDriveLettersAndType(DWORD DriveIndex, char* drive_letters, UINT* drive_type)\n{\n\tDWORD size;\n\tBOOL r = FALSE;\n\tHANDLE hDrive = INVALID_HANDLE_VALUE, hPhysical = INVALID_HANDLE_VALUE;\n\tUINT _drive_type;\n\tIO_STATUS_BLOCK io_status_block;\n\tFILE_FS_DEVICE_INFORMATION file_fs_device_info = { 0 };\n\tBYTE geometry[256] = { 0 };\n\tPDISK_GEOMETRY_EX DiskGeometry = (PDISK_GEOMETRY_EX)(void*)geometry;\n\tint i = 0, drives_found = 0, drive_number;\n\tchar *drive, drives[26*4 + 1];\t/* \"D:\\\", \"E:\\\", etc., plus one NUL */\n\tchar logical_drive[] = \"\\\\\\\\.\\\\#:\";\n\n\tif (drive_letters != NULL)\n\t\tdrive_letters[0] = 0;\n\tif (drive_type != NULL)\n\t\t*drive_type = DRIVE_UNKNOWN;\n\tCheckDriveIndex(DriveIndex);\n\n\t// This call is weird... The buffer needs to have an extra NUL, but you're\n\t// supposed to provide the size without the extra NUL. And the returned size\n\t// does not include the NUL either *EXCEPT* if your buffer is too small...\n\t// But then again, this doesn't hold true if you have a 105 byte buffer and\n\t// pass a 4*26=104 size, as the the call will return 105 (i.e. *FAILURE*)\n\t// instead of 104 as it should => screw Microsoft: We'll include the NUL\n\t// always, as each drive string is at least 4 chars long anyway.\n\tsize = GetLogicalDriveStringsA(sizeof(drives), drives);\n\tif (size == 0) {\n\t\tuprintf(\"GetLogicalDriveStrings failed: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\tif (size > sizeof(drives)) {\n\t\tuprintf(\"GetLogicalDriveStrings: Buffer too small (required %lu vs. %zu)\", size, sizeof(drives));\n\t\tgoto out;\n\t}\n\n\tr = TRUE;\t// Required to detect drives that don't have volumes assigned\n\tfor (drive = drives ;*drive; drive += safe_strlen(drive) + 1) {\n\t\tif (!isalpha(*drive))\n\t\t\tcontinue;\n\t\t*drive = (char)toupper((int)*drive);\n\n\t\t// IOCTL_STORAGE_GET_DEVICE_NUMBER's STORAGE_DEVICE_NUMBER.DeviceNumber is\n\t\t// not unique! An HDD, a DVD and probably other drives can have the same\n\t\t// value there => Use GetDriveType() to filter out unwanted devices.\n\t\t// See https://github.com/pbatard/rufus/issues/32#issuecomment-3785956\n\t\t_drive_type = GetDriveTypeA(drive);\n\n\t\tif ((_drive_type != DRIVE_REMOVABLE) && (_drive_type != DRIVE_FIXED))\n\t\t\tcontinue;\n\n\t\tstatic_sprintf(logical_drive, \"\\\\\\\\.\\\\%c:\", toupper(drive[0]));\n\t\t// This call appears to freeze on some systems and we don't want to spend more\n\t\t// time than needed waiting for unresponsive drives, so use a 3 seconds timeout.\n\t\thDrive = CreateFileWithTimeout(logical_drive, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,\n\t\t\t\tNULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL, 3000);\n\t\tif (hDrive == INVALID_HANDLE_VALUE) {\n\t\t\tif (GetLastError() == WAIT_TIMEOUT)\n\t\t\t\tuprintf(\"WARNING: Time-out while trying to query drive %c\", toupper(drive[0]));\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Eliminate floppy drives\n\t\tif ((NtQueryVolumeInformationFile(hDrive, &io_status_block, &file_fs_device_info,\n\t\t\t\tsizeof(file_fs_device_info), FileFsDeviceInformation) == NO_ERROR) &&\n\t\t\t(file_fs_device_info.Characteristics & FILE_FLOPPY_DISKETTE) ) {\n\t\t\t\tcontinue;\n\t\t}\n\n\t\tdrive_number = GetDriveNumber(hDrive, logical_drive);\n\t\tsafe_closehandle(hDrive);\n\t\tif (drive_number == DriveIndex) {\n\t\t\tr = TRUE;\n\t\t\tdrives_found++;\n\t\t\tif (drive_letters != NULL)\n\t\t\t\tdrive_letters[i++] = *drive;\n\t\t\t// The drive type should be the same for all volumes, so we can overwrite\n\t\t\tif (drive_type != NULL)\n\t\t\t\t*drive_type = _drive_type;\n\t\t}\n\t}\n\n\t// Devices that don't have mounted partitions require special\n\t// handling to determine if they are fixed or removable.\n\tif ((drives_found == 0) && (drive_type != NULL)) {\n\t\thPhysical = GetPhysicalHandle(DriveIndex + DRIVE_INDEX_MIN, FALSE, FALSE, FALSE);\n\t\tr = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, geometry, sizeof(geometry), &size, NULL);\n\t\tsafe_closehandle(hPhysical);\n\t\tif (r && size > 0) {\n\t\t\tif (DiskGeometry->Geometry.MediaType == FixedMedia)\n\t\t\t\t*drive_type = DRIVE_FIXED;\n\t\t\telse if (DiskGeometry->Geometry.MediaType == RemovableMedia)\n\t\t\t\t*drive_type = DRIVE_REMOVABLE;\n\t\t}\n\t}\n\nout:\n\tif (drive_letters != NULL)\n\t\tdrive_letters[i] = 0;\n\treturn r;\n}\n\n// Could have used a #define, but this is clearer\nBOOL GetDriveLetters(DWORD DriveIndex, char* drive_letters)\n{\n\treturn _GetDriveLettersAndType(DriveIndex, drive_letters, NULL);\n}\n\n// There's already a GetDriveType in the Windows API\nUINT GetDriveTypeFromIndex(DWORD DriveIndex)\n{\n\tUINT drive_type;\n\t_GetDriveLettersAndType(DriveIndex, NULL, &drive_type);\n\treturn drive_type;\n}\n\nBOOL IsSourceImageLocatedOnTargetDrive(DWORD DriveIndex)\n{\n\tsize_t i;\n\tchar drive_letters[27] = { 0 };\n\n\tif (boot_type != BT_IMAGE || !GetDriveLetters(DriveIndex, drive_letters) || drive_letters[0] == 0)\n\t\treturn FALSE;\n\n\tfor (i = 0; i < strlen(drive_letters); i++)\n\t\tif ((PathGetDriveNumberU(image_path) + 'A') == drive_letters[i])\n\t\t\treturn TRUE;\n\n\treturn FALSE;\n}\n\n// Removes all drive letters associated with the specific drive, and return\n// either the first or last letter that was removed, according to bReturnLast.\nchar RemoveDriveLetters(DWORD DriveIndex, BOOL bReturnLast, BOOL bSilent)\n{\n\tint i, len;\n\tchar drive_letters[27] = { 0 }, drive_name[4] = \"#:\\\\\";\n\n\tif (!GetDriveLetters(DriveIndex, drive_letters)) {\n\t\tsuprintf(\"Failed to get a drive letter\");\n\t\treturn 0;\n\t}\n\tif (drive_letters[0] == 0) {\n\t\tsuprintf(\"No drive letter was assigned...\");\n\t\treturn GetUnusedDriveLetter();\n\t}\n\tlen = (int)strlen(drive_letters);\n\tif (len == 0)\n\t\treturn 0;\n\n\t// Unmount all mounted volumes that belong to this drive\n\tfor (i = 0; i < len; i++) {\n\t\t// Check that the current image isn't located on a drive we are trying to dismount\n\t\tif ((boot_type == BT_IMAGE) && (drive_letters[i] == (PathGetDriveNumberU(image_path) + 'A'))) {\n\t\t\tif ((PathGetDriveNumberU(image_path) + 'A') == drive_letters[i]) {\n\t\t\t\tsuprintf(\"ABORTED: Cannot use an image that is located on the target drive!\");\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\tdrive_name[0] = drive_letters[i];\n\t\t// DefineDosDevice() cannot have a trailing backslash...\n\t\tdrive_name[2] = 0;\n\t\tDefineDosDeviceA(DDD_REMOVE_DEFINITION, drive_name, NULL);\n\t\t// ... but DeleteVolumeMountPoint() requires one. Go figure...\n\t\tdrive_name[2] = '\\\\';\n\t\tif (!DeleteVolumeMountPointA(drive_name))\n\t\t\tsuprintf(\"Failed to delete mountpoint %s: %s\", drive_name, WindowsErrorString());\n\t}\n\treturn drive_letters[bReturnLast ? (len - 1) : 0];\n}\n\n/*\n * Return the next unused drive letter from the system or NUL on error.\n */\nchar GetUnusedDriveLetter(void)\n{\n\tDWORD size;\n\tchar drive_letter, *drive, drives[26*4 + 1];\t/* \"D:\\\", \"E:\\\", etc., plus one NUL */\n\n\tsize = GetLogicalDriveStringsA(sizeof(drives), drives);\n\tif (size == 0) {\n\t\tuprintf(\"GetLogicalDriveStrings failed: %s\", WindowsErrorString());\n\t\treturn 0;\n\t}\n\tif (size > sizeof(drives)) {\n\t\tuprintf(\"GetLogicalDriveStrings: Buffer too small (required %lu vs. %zu)\", size, sizeof(drives));\n\t\treturn 0;\n\t}\n\n\tfor (drive_letter = 'C'; drive_letter <= 'Z'; drive_letter++) {\n\t\tfor (drive = drives ; *drive; drive += safe_strlen(drive) + 1) {\n\t\t\tif (!isalpha(*drive))\n\t\t\t\tcontinue;\n\t\t\tif (drive_letter == (char)toupper((int)*drive))\n\t\t\t\tbreak;\n\t\t}\n\t\tif (!*drive)\n\t\t\tbreak;\n\t}\n\n\treturn (drive_letter > 'Z') ? 0 : drive_letter;\n}\n\nBOOL IsDriveLetterInUse(const char drive_letter)\n{\n\tDWORD size;\n\tchar *drive, drives[26 * 4 + 1];\n\n\tsize = GetLogicalDriveStringsA(sizeof(drives), drives);\n\tif (size == 0) {\n\t\tuprintf(\"GetLogicalDriveStrings failed: %s\", WindowsErrorString());\n\t\treturn TRUE;\n\t}\n\tif (size > sizeof(drives)) {\n\t\tuprintf(\"GetLogicalDriveStrings: Buffer too small (required %lu vs. %zu)\", size, sizeof(drives));\n\t\treturn TRUE;\n\t}\n\n\tfor (drive = drives; *drive; drive += safe_strlen(drive) + 1) {\n\t\tif (drive_letter == (char)toupper((int)*drive))\n\t\t\treturn TRUE;\n\t}\n\n\treturn FALSE;\n}\n\n/*\n * Return the drive letter and volume label\n * If the drive doesn't have a volume assigned, space is returned for the letter\n */\nBOOL GetDriveLabel(DWORD DriveIndex, char* letters, char** label, BOOL bSilent)\n{\n\tHANDLE hPhysical;\n\tDWORD error;\n\tstatic char VolumeLabel[MAX_PATH + 1] = { 0 };\n\tchar DrivePath[] = \"#:\\\\\", AutorunPath[] = \"#:\\\\autorun.inf\", *AutorunLabel = NULL;\n\tWCHAR VolumeName[MAX_PATH + 1] = { 0 }, FileSystemName[64];\n\tDWORD VolumeSerialNumber, MaximumComponentLength, FileSystemFlags;\n\n\t*label = STR_NO_LABEL;\n\n\tif (!GetDriveLetters(DriveIndex, letters))\n\t\treturn FALSE;\n\tif (letters[0] == 0) {\n\t\t// Even if we don't have a letter, try to obtain the label of the first partition\n\t\tHANDLE h = GetLogicalHandle(DriveIndex, 0, FALSE, FALSE, FALSE);\n\t\tif (GetVolumeInformationByHandleW(h, VolumeName, 64, &VolumeSerialNumber,\n\t\t\t&MaximumComponentLength, &FileSystemFlags, FileSystemName, 64)) {\n\t\t\twchar_to_utf8_no_alloc(VolumeName, VolumeLabel, sizeof(VolumeLabel));\n\t\t\t*label = (VolumeLabel[0] != 0) ? VolumeLabel : STR_NO_LABEL;\n\t\t}\n\t\tsafe_closehandle(h);\n\t\t// Drive without volume assigned - always enabled\n\t\treturn TRUE;\n\t}\n\t// We only care about an autorun.inf if we have a single volume\n\tAutorunPath[0] = letters[0];\n\tDrivePath[0] = letters[0];\n\n\t// Try to read an extended label from autorun first. Fallback to regular label if not found.\n\t// In the case of card readers with no card, users can get an annoying popup asking them\n\t// to insert media. Use IOCTL_STORAGE_CHECK_VERIFY to prevent this\n\thPhysical = GetPhysicalHandle(DriveIndex, FALSE, FALSE, TRUE);\n\tif (DeviceIoControl(hPhysical, IOCTL_STORAGE_CHECK_VERIFY, NULL, 0, NULL, 0, NULL, NULL))\n\t\tAutorunLabel = get_token_data_file(\"label\", AutorunPath);\n\telse if (GetLastError() == ERROR_NOT_READY)\n\t\tsuprintf(\"Ignoring 'autorun.inf' label for drive %c: No media\", toupper(letters[0]));\n\tsafe_closehandle(hPhysical);\n\tif (AutorunLabel != NULL) {\n\t\tsuprintf(\"Using 'autorun.inf' label for drive %c: '%s'\", toupper(letters[0]), AutorunLabel);\n\t\tstatic_strcpy(VolumeLabel, AutorunLabel);\n\t\tsafe_free(AutorunLabel);\n\t\t*label = VolumeLabel;\n\t} else if (GetVolumeInformationU(DrivePath, VolumeLabel, ARRAYSIZE(VolumeLabel),\n\t\tNULL, NULL, NULL, NULL, 0) && (VolumeLabel[0] != 0)) {\n\t\t*label = VolumeLabel;\n\t} else {\n\t\t// Might be an extfs label\n\t\terror = GetLastError();\n\t\t*label = (char*)GetExtFsLabel(DriveIndex, 0);\n\t\tif (*label == NULL) {\n\t\t\tSetLastError(error);\n\t\t\tif (error != ERROR_UNRECOGNIZED_VOLUME)\n\t\t\t\tduprintf(\"Failed to read label: %s\", WindowsErrorString());\n\t\t\t*label = STR_NO_LABEL;\n\t\t}\n\t}\n\treturn TRUE;\n}\n\n/*\n * Return the drive size\n */\nuint64_t GetDriveSize(DWORD DriveIndex)\n{\n\tBOOL r;\n\tHANDLE hPhysical;\n\tDWORD size;\n\tBYTE geometry[256];\n\tPDISK_GEOMETRY_EX DiskGeometry = (PDISK_GEOMETRY_EX)(void*)geometry;\n\n\thPhysical = GetPhysicalHandle(DriveIndex, FALSE, FALSE, TRUE);\n\tif (hPhysical == INVALID_HANDLE_VALUE)\n\t\treturn FALSE;\n\n\tr = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, geometry, sizeof(geometry), &size, NULL);\n\tsafe_closehandle(hPhysical);\n\tif (!r || size <= 0)\n\t\treturn 0;\n\treturn DiskGeometry->DiskSize.QuadPart;\n}\n\n/*\n * GET_DRIVE_GEOMETRY is used to tell if there is an actual media\n */\nBOOL IsMediaPresent(DWORD DriveIndex)\n{\n\tBOOL r;\n\tHANDLE hPhysical;\n\tDWORD size;\n\tBYTE geometry[128];\n\n\thPhysical = GetPhysicalHandle(DriveIndex, FALSE, FALSE, TRUE);\n\tr = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, geometry, sizeof(geometry), &size, NULL) && (size > 0);\n\tsafe_closehandle(hPhysical);\n\treturn r;\n}\n\nconst struct {int (*fn)(FILE *fp); char* str;} known_mbr[] = {\n\t{ is_dos_mbr, \"DOS/NT/95A\" },\n\t{ is_dos_f2_mbr, \"DOS/NT/95A (F2)\" },\n\t{ is_95b_mbr, \"Windows 95B/98/98SE/ME\" },\n\t{ is_2000_mbr, \"Windows 2000/XP/2003\" },\n\t{ is_vista_mbr, \"Windows Vista\" },\n\t{ is_win7_mbr, \"Windows 7\" },\n\t{ is_rufus_mbr, \"Rufus\" },\n\t{ is_syslinux_mbr, \"Syslinux\" },\n\t{ is_reactos_mbr, \"ReactOS\" },\n\t{ is_kolibrios_mbr, \"KolibriOS\" },\n\t{ is_grub4dos_mbr, \"Grub4DOS\" },\n\t{ is_grub2_mbr, \"Grub 2.0\" },\n\t{ is_zero_mbr_not_including_disk_signature_or_copy_protect, \"Zeroed\" },\n};\n\n// Returns TRUE if the drive seems bootable, FALSE otherwise\nBOOL AnalyzeMBR(HANDLE hPhysicalDrive, const char* TargetName, BOOL bSilent)\n{\n\tFAKE_FD fake_fd = { 0 };\n\tFILE* fp = (FILE*)&fake_fd;\n\tint i;\n\n\tfake_fd._handle = (char*)hPhysicalDrive;\n\tset_bytes_per_sector(SelectedDrive.SectorSize);\n\n\tif (!is_br(fp)) {\n\t\tsuprintf(\"%s does not have a Boot Marker\", TargetName);\n\t\treturn FALSE;\n\t}\n\tfor (i=0; i<ARRAYSIZE(known_mbr); i++) {\n\t\tif (known_mbr[i].fn(fp)) {\n\t\t\tsuprintf(\"%s has a %s Master Boot Record\", TargetName, known_mbr[i].str);\n\t\t\treturn TRUE;\n\t\t}\n\t}\n\n\tsuprintf(\"%s has an unknown Master Boot Record\", TargetName);\n\treturn TRUE;\n}\n\nconst struct {int (*fn)(FILE *fp); char* str;} known_pbr[] = {\n\t{ entire_fat_16_br_matches, \"FAT16 DOS\" },\n\t{ entire_fat_16_fd_br_matches, \"FAT16 FreeDOS\" },\n\t{ entire_fat_16_ros_br_matches, \"FAT16 ReactOS\" },\n\t{ entire_fat_32_br_matches, \"FAT32 DOS\" },\n\t{ entire_fat_32_nt_br_matches, \"FAT32 NT\" },\n\t{ entire_fat_32_fd_br_matches, \"FAT32 FreeDOS\" },\n\t{ entire_fat_32_ros_br_matches, \"FAT32 ReactOS\" },\n\t{ entire_fat_32_kos_br_matches, \"FAT32 KolibriOS\" },\n};\n\nBOOL AnalyzePBR(HANDLE hLogicalVolume)\n{\n\tconst char* pbr_name = \"Partition Boot Record\";\n\tFAKE_FD fake_fd = { 0 };\n\tFILE* fp = (FILE*)&fake_fd;\n\tint i;\n\n\tfake_fd._handle = (char*)hLogicalVolume;\n\tset_bytes_per_sector(SelectedDrive.SectorSize);\n\n\tif (!is_br(fp)) {\n\t\tuprintf(\"Volume does not have an x86 %s\", pbr_name);\n\t\treturn FALSE;\n\t}\n\n\tif (is_fat_16_br(fp) || is_fat_32_br(fp)) {\n\t\tfor (i=0; i<ARRAYSIZE(known_pbr); i++) {\n\t\t\tif (known_pbr[i].fn(fp)) {\n\t\t\t\tuprintf(\"Drive has a %s %s\", known_pbr[i].str, pbr_name);\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\tuprintf(\"Volume has an unknown FAT16 or FAT32 %s\", pbr_name);\n\t} else {\n\t\tuprintf(\"Volume has an unknown %s\", pbr_name);\n\t}\n\treturn TRUE;\n}\n\n/*\n * This call returns the offset of the first ESP partition found\n * on the relevant drive, or 0ULL if no ESP was found.\n */\nuint64_t GetEspOffset(DWORD DriveIndex)\n{\n\tuint64_t ret = 0ULL;\n\tBOOL r;\n\tHANDLE hPhysical;\n\tDWORD size, i;\n\tBYTE layout[4096] = { 0 };\n\tPDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout;\n\n\thPhysical = GetPhysicalHandle(DriveIndex, FALSE, TRUE, TRUE);\n\tif (hPhysical == INVALID_HANDLE_VALUE)\n\t\treturn FALSE;\n\n\tr = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, layout, sizeof(layout), &size, NULL);\n\tif (!r || size <= 0) {\n\t\tuprintf(\"Could not get layout for drive 0x%02x: %s\", DriveIndex, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tfor (i = 0; i < DriveLayout->PartitionCount; i++) {\n\t\tif (((DriveLayout->PartitionStyle == PARTITION_STYLE_MBR) && (DriveLayout->PartitionEntry[i].Mbr.PartitionType == 0xef)) ||\n\t\t\t((DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) && CompareGUID(&DriveLayout->PartitionEntry[i].Gpt.PartitionType, &PARTITION_GENERIC_ESP))) {\n\t\t\tret = DriveLayout->PartitionEntry[i].StartingOffset.QuadPart;\n\t\t\tbreak;\n\t\t}\n\t}\n\nout:\n\tsafe_closehandle(hPhysical);\n\treturn ret;\n}\n\nstatic BOOL StoreEspInfo(GUID* guid)\n{\n\tuint8_t j;\n\tchar key_name[2][16], *str;\n\t// Look for an empty slot and use that if available\n\tfor (j = 1; j <= MAX_ESP_TOGGLE; j++) {\n\t\tstatic_sprintf(key_name[0], \"ToggleEsp%02u\", j);\n\t\tstr = ReadSettingStr(key_name[0]);\n\t\tif ((str == NULL) || (str[0] == 0))\n\t\t\treturn WriteSettingStr(key_name[0], GuidToString(guid, TRUE));\n\t}\n\t// All slots are used => Move every key down and add to last slot\n\t// NB: No, we don't care that the slot we remove may not be the oldest.\n\tfor (j = 1; j < MAX_ESP_TOGGLE; j++) {\n\t\tstatic_sprintf(key_name[0], \"ToggleEsp%02u\", j);\n\t\tstatic_sprintf(key_name[1], \"ToggleEsp%02u\", j + 1);\n\t\tWriteSettingStr(key_name[0], ReadSettingStr(key_name[1]));\n\t}\n\treturn WriteSettingStr(key_name[1], GuidToString(guid, TRUE));\n}\n\nstatic GUID GetEspGuid(uint8_t index)\n{\n\tchar key_name[16];\n\n\tstatic_sprintf(key_name, \"ToggleEsp%02u\", index);\n\treturn StringToGuid(ReadSettingStr(key_name));\n}\n\nstatic BOOL ClearEspInfo(uint8_t index)\n{\n\tchar key_name[16];\n\tstatic_sprintf(key_name, \"ToggleEsp%02u\", index);\n\treturn WriteSettingStr(key_name, \"\");\n}\n\n/*\n * This calls changes the type of a GPT ESP back and forth to Basic Data.\n * Needed because Windows 10 doesn't mount ESPs by default, and also\n * doesn't let usermode apps (such as File Explorer) access mounted ESPs.\n */\nBOOL ToggleEsp(DWORD DriveIndex, uint64_t PartitionOffset)\n{\n\tchar *volume_name, mount_point[] = DEFAULT_ESP_MOUNT_POINT;\n\tint i, j, esp_index = -1;\n\tBOOL r, ret = FALSE, delete_data = FALSE;\n\tHANDLE hPhysical;\n\tDWORD dl_size, size, offset;\n\tBYTE layout[4096] = { 0 }, buf[512];\n\tGUID *guid = NULL, stored_guid = { 0 }, mbr_guid;\n\tPDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout;\n\ttypedef struct {\n\t\tconst uint8_t mbr_type;\n\t\tconst uint8_t magic[8];\n\t} fat_mbr_type;\n\tconst fat_mbr_type fat_mbr_types[] = {\n\t\t{ 0x0b, { 'F', 'A', 'T', ' ', ' ', ' ', ' ', ' ' } },\n\t\t{ 0x01, { 'F', 'A', 'T', '1', '2', ' ', ' ', ' ' } },\n\t\t{ 0x0e, { 'F', 'A', 'T', '1', '6', ' ', ' ', ' ' } },\n\t\t{ 0x0c, { 'F', 'A', 'T', '3', '2', ' ', ' ', ' ' } },\n\t};\n\n\tif ((PartitionOffset == 0) && (WindowsVersion.Version < WINDOWS_10)) {\n\t\tuprintf(\"ESP toggling is only available for Windows 10 or later\");\n\t\treturn FALSE;\n\t}\n\n\thPhysical = GetPhysicalHandle(DriveIndex, FALSE, TRUE, TRUE);\n\tif (hPhysical == INVALID_HANDLE_VALUE)\n\t\treturn FALSE;\n\n\tr = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, layout, sizeof(layout), &dl_size, NULL);\n\tif (!r || dl_size <= 0) {\n\t\tuprintf(\"Could not get layout for drive 0x%02x: %s\", DriveIndex, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tif (PartitionOffset == 0) {\n\t\t// See if the current drive contains an ESP\n\t\tfor (i = 0; i < (int)DriveLayout->PartitionCount; i++) {\n\t\t\tif (((DriveLayout->PartitionStyle == PARTITION_STYLE_MBR) && (DriveLayout->PartitionEntry[i].Mbr.PartitionType == 0xef)) ||\n\t\t\t\t((DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) && CompareGUID(&DriveLayout->PartitionEntry[i].Gpt.PartitionType, &PARTITION_GENERIC_ESP))) {\n\t\t\t\tesp_index = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (esp_index >= 0) {\n\t\t\t// ESP -> Basic Data\n\t\t\tif (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) {\n\t\t\t\tuprintf(\"ESP name: '%S'\", DriveLayout->PartitionEntry[esp_index].Gpt.Name);\n\t\t\t\tguid = &DriveLayout->PartitionEntry[esp_index].Gpt.PartitionId;\n\t\t\t} else {\n\t\t\t\t// For MBR we create a GUID from the disk signature and the offset\n\t\t\t\tmbr_guid.Data1 = DriveLayout->Mbr.Signature;\n\t\t\t\tmbr_guid.Data2 = 0; mbr_guid.Data3 = 0;\n\t\t\t\t*((uint64_t*)&mbr_guid.Data4) = DriveLayout->PartitionEntry[i].StartingOffset.QuadPart;\n\t\t\t\tguid = &mbr_guid;\n\t\t\t}\n\t\t\tif (!StoreEspInfo(guid)) {\n\t\t\t\tuprintf(\"ESP toggling data could not be stored\");\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tif (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) {\n\t\t\t\tDriveLayout->PartitionEntry[esp_index].Gpt.PartitionType = PARTITION_MICROSOFT_DATA;\n\t\t\t} else if (DriveLayout->PartitionStyle == PARTITION_STYLE_MBR) {\n\t\t\t\t// Default to FAT32 (non LBA) if we can't determine anything better\n\t\t\t\tDriveLayout->PartitionEntry[esp_index].Mbr.PartitionType = 0x0b;\n\t\t\t\t// Now detect if we're dealing with FAT12/16/32\n\t\t\t\tif (SetFilePointerEx(hPhysical, DriveLayout->PartitionEntry[esp_index].StartingOffset, NULL, FILE_BEGIN) &&\n\t\t\t\t\tReadFile(hPhysical, buf, 512, &size, NULL) && size == 512) {\n\t\t\t\t\tfor (offset = 0x36; offset <= 0x52; offset += 0x1c) {\n\t\t\t\t\t\tfor (i = 0; i < ARRAYSIZE(fat_mbr_types); i++) {\n\t\t\t\t\t\t\tif (memcmp(&buf[offset], fat_mbr_types[i].magic, 8) == 0) {\n\t\t\t\t\t\t\t\tDriveLayout->PartitionEntry[esp_index].Mbr.PartitionType = fat_mbr_types[i].mbr_type;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Basic Data -> ESP\n\t\t\tfor (i = 1; i <= MAX_ESP_TOGGLE && esp_index < 0; i++) {\n\t\t\t\tstored_guid = GetEspGuid((uint8_t)i);\n\t\t\t\tif (!CompareGUID(&stored_guid, &GUID_NULL)) {\n\t\t\t\t\tfor (j = 0; j < (int)DriveLayout->PartitionCount && esp_index < 0; j++) {\n\t\t\t\t\t\tif (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT) {\n\t\t\t\t\t\t\tguid = &DriveLayout->PartitionEntry[j].Gpt.PartitionId;\n\t\t\t\t\t\t} else if (DriveLayout->PartitionStyle == PARTITION_STYLE_MBR) {\n\t\t\t\t\t\t\tmbr_guid.Data1 = DriveLayout->Mbr.Signature;\n\t\t\t\t\t\t\tmbr_guid.Data2 = 0; mbr_guid.Data3 = 0;\n\t\t\t\t\t\t\t*((uint64_t*)&mbr_guid.Data4) = DriveLayout->PartitionEntry[j].StartingOffset.QuadPart;\n\t\t\t\t\t\t\tguid = &mbr_guid;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (CompareGUID(&stored_guid, guid)) {\n\t\t\t\t\t\t\tesp_index = j;\n\t\t\t\t\t\t\tdelete_data = TRUE;\n\t\t\t\t\t\t\tif (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT)\n\t\t\t\t\t\t\t\tDriveLayout->PartitionEntry[esp_index].Gpt.PartitionType = PARTITION_GENERIC_ESP;\n\t\t\t\t\t\t\telse if (DriveLayout->PartitionStyle == PARTITION_STYLE_MBR)\n\t\t\t\t\t\t\t\tDriveLayout->PartitionEntry[esp_index].Mbr.PartitionType = 0xef;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (i = 0; i < (int)DriveLayout->PartitionCount; i++) {\n\t\t\tif (DriveLayout->PartitionEntry[i].StartingOffset.QuadPart == PartitionOffset) {\n\t\t\t\tesp_index = i;\n\t\t\t\tif (DriveLayout->PartitionStyle == PARTITION_STYLE_GPT)\n\t\t\t\t\tDriveLayout->PartitionEntry[esp_index].Gpt.PartitionType = PARTITION_GENERIC_ESP;\n\t\t\t\telse if (DriveLayout->PartitionStyle == PARTITION_STYLE_MBR)\n\t\t\t\t\tDriveLayout->PartitionEntry[esp_index].Mbr.PartitionType = 0xef;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (esp_index < 0) {\n\t\tuprintf(\"No partition to toggle\");\n\t\tgoto out;\n\t}\n\n\tDriveLayout->PartitionEntry[esp_index].RewritePartition = TRUE;\t// Just in case\n\tr = DeviceIoControl(hPhysical, IOCTL_DISK_SET_DRIVE_LAYOUT_EX, (BYTE*)DriveLayout, dl_size, NULL, 0, NULL, NULL);\n\tif (!r) {\n\t\tuprintf(\"Could not set drive layout: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\tRefreshDriveLayout(hPhysical);\n\tif (PartitionOffset == 0) {\n\t\tif (delete_data) {\n\t\t\t// We successfully reverted ESP from Basic Data -> Delete stored ESP info\n\t\t\tClearEspInfo((uint8_t)j);\n\t\t} else if (!IsDriveLetterInUse(*mount_point)) {\n\t\t\t// We successfully switched ESP to Basic Data -> Try to mount it\n\t\t\tvolume_name = GetLogicalName(DriveIndex, DriveLayout->PartitionEntry[esp_index].StartingOffset.QuadPart, TRUE, FALSE);\n\t\t\tIGNORE_RETVAL(MountVolume(mount_point, volume_name));\n\t\t\tfree(volume_name);\n\t\t}\n\t}\n\tret = TRUE;\n\nout:\n\tsafe_closehandle(hPhysical);\n\treturn ret;\n}\n\n// This is a crude attempt at detecting file systems through their superblock magic.\n// Note that we only attempt to detect the file systems that Rufus can format as\n// well as a couple other maintsream ones.\nconst char* GetFsName(HANDLE hPhysical, LARGE_INTEGER StartingOffset)\n{\n\ttypedef struct {\n\t\tconst char* name;\n\t\tconst uint8_t magic[8];\n\t} win_fs_type;\n\tconst win_fs_type win_fs_types[] = {\n\t\t{ \"exFAT\", { 'E', 'X', 'F', 'A', 'T', ' ', ' ', ' ' } },\n\t\t{ \"NTFS\", { 'N', 'T', 'F', 'S', ' ', ' ', ' ', ' ' } },\n\t\t{ \"ReFS\", { 'R', 'e', 'F', 'S', 0, 0, 0, 0 } }\n\t};\n\tconst win_fs_type fat_fs_types[] = {\n\t\t{ \"FAT\", { 'F', 'A', 'T', ' ', ' ', ' ', ' ', ' ' } },\n\t\t{ \"FAT12\", { 'F', 'A', 'T', '1', '2', ' ', ' ', ' ' } },\n\t\t{ \"FAT16\", { 'F', 'A', 'T', '1', '6', ' ', ' ', ' ' } },\n\t\t{ \"FAT32\", { 'F', 'A', 'T', '3', '2', ' ', ' ', ' ' } },\n\t};\n\tconst uint32_t ext_feature[3][3] = {\n\t\t// feature_compat\n\t\t{ 0x0000017B, 0x00000004, 0x00000E00 },\n\t\t// feature_ro_compat\n\t\t{ 0x00000003, 0x00000000, 0x00008FF8 },\n\t\t// feature_incompat\n\t\t{ 0x00000013, 0x0000004C, 0x0003F780 }\n\t};\n\tconst char* ext_names[] = { \"ext\", \"ext2\", \"ext3\", \"ext4\" };\n\tconst char* ret = \"(Unrecognized)\";\n\tDWORD i, j, offset, size, sector_size = 512;\n\tuint8_t* buf = calloc(sector_size, 1);\n\tif (buf == NULL)\n\t\tgoto out;\n\n\t// 1. Try to detect ISO9660/FAT/exFAT/NTFS/ReFS through the 512 bytes superblock at offset 0\n\tif (!SetFilePointerEx(hPhysical, StartingOffset, NULL, FILE_BEGIN))\n\t\tgoto out;\n\tif (!ReadFile(hPhysical, buf, sector_size, &size, NULL) || size != sector_size)\n\t\tgoto out;\n\tif (strncmp(\"CD001\", &buf[0x01], 5) == 0) {\n\t\tret = \"ISO9660\";\n\t\tgoto out;\n\t}\n\n\t// The beginning of a superblock for FAT/exFAT/NTFS/ReFS is pretty much always the same:\n\t// There are 3 bytes potentially used for a jump instruction, and then are 8 bytes of\n\t// OEM Name which, even if *not* technically correct, we are going to assume hold an\n\t// immutable file system magic for exFAT/NTFS/ReFS (but not for FAT, see below).\n\tfor (i = 0; i < ARRAYSIZE(win_fs_types); i++)\n\t\tif (memcmp(&buf[0x03], win_fs_types[i].magic, 8) == 0)\n\t\t\tbreak;\n\tif (i < ARRAYSIZE(win_fs_types)) {\n\t\tret = win_fs_types[i].name;\n\t\tgoto out;\n\t}\n\n\t// For FAT, because the OEM Name may actually be set to something else than what we\n\t// expect, we poke the FAT12/16 Extended BIOS Parameter Block:\n\t// https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#Extended_BIOS_Parameter_Block\n\t// or FAT32 Extended BIOS Parameter Block:\n\t// https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#FAT32_Extended_BIOS_Parameter_Block\n\tfor (offset = 0x36; offset <= 0x52; offset += 0x1C) {\n\t\tfor (i = 0; i < ARRAYSIZE(fat_fs_types); i++)\n\t\t\tif (memcmp(&buf[offset], fat_fs_types[i].magic, 8) == 0)\n\t\t\t\tbreak;\n\t\tif (i < ARRAYSIZE(fat_fs_types)) {\n\t\t\tret = fat_fs_types[i].name;\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\t// 2. Try to detect Apple AFS/HFS/HFS+ through the 512 bytes superblock at either offset 0 or 1024\n\t// \"NXSB\" at offset 0x20 => APFS\n\tif (strncmp(\"NXSB\", &buf[0x20], 4) == 0) {\n\t\tret = \"APFS\";\n\t\tgoto out;\n\t}\n\t// Switch to offset 1024\n\tmemset(buf, 0, sector_size);\n\tStartingOffset.QuadPart += 0x0400ULL;\n\tif (!SetFilePointerEx(hPhysical, StartingOffset, NULL, FILE_BEGIN))\n\t\tgoto out;\n\tif (!ReadFile(hPhysical, buf, sector_size, &size, NULL) || size != sector_size)\n\t\tgoto out;\n\t// \"HX\" or \"H+\" at offset 0x00 => HFS/HFS+\n\tif (buf[0] == 'H' && (buf[1] == 'X' || buf[1] == '+')) {\n\t\tret = \"HFS/HFS+\";\n\t\tgoto out;\n\t}\n\n\t// 3. Try to detect ext2/ext3/ext4 through the 512 bytes superblock at offset 1024\n\t// We're already at the right offset\n\tif (!SetFilePointerEx(hPhysical, StartingOffset, NULL, FILE_BEGIN))\n\t\tgoto out;\n\tif (!ReadFile(hPhysical, buf, sector_size, &size, NULL) || size != sector_size)\n\t\tgoto out;\n\tif (buf[0x38] == 0x53 && buf[0x39] == 0xEF) {\n\t\tuint32_t rev = 0;\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\tuint32_t feature = *((uint32_t*)&buf[0x5C + 4 * i]);\n\t\t\tfor (j = 0; j < 3; j++) {\n\t\t\t\tif (feature & ext_feature[i][j] && rev <= j)\n\t\t\t\t\trev = j + 1;\n\t\t\t}\n\t\t}\n\t\tassert(rev < ARRAYSIZE(ext_names));\n\t\tif (rev < ARRAYSIZE(ext_names))\n\t\t\tret = ext_names[rev];\n\t\tgoto out;\n\t}\n\n\t// 4. Try to detect UDF through by looking for a \"BEA01\\0\" string at offset 0xC001\n\t// NB: This is not thorough UDF detection but good enough for our purpose.\n\t// For the full specs see: http://www.osta.org/specs/pdf/udf260.pdf\n\tmemset(buf, 0, sector_size);\n\tStartingOffset.QuadPart += 0x8000ULL - 0x0400ULL;\n\tif (!SetFilePointerEx(hPhysical, StartingOffset, NULL, FILE_BEGIN))\n\t\tgoto out;\n\tif (!ReadFile(hPhysical, buf, sector_size, &size, NULL) || size != sector_size)\n\t\tgoto out;\n\tif (strncmp(\"BEA01\", &buf[1], 5) == 0) {\n\t\tret = \"UDF\";\n\t\tgoto out;\n\t}\n\nout:\n\tfree(buf);\n\treturn ret;\n}\n\n/*\n * Fill the drive properties (size, FS, etc)\n * Returns TRUE if the drive has a partition that can be mounted in Windows, FALSE otherwise\n */\nBOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSystemNameSize, BOOL bSilent)\n{\n\t// MBR partition types that can be mounted in Windows\n\tconst uint8_t mbr_mountable[] = { 0x01, 0x04, 0x06, 0x07, 0x0b, 0x0c, 0x0e, 0xef };\n\tBOOL r, ret = FALSE, isUefiNtfs;\n\tHANDLE hPhysical;\n\tDWORD size, i, j, super_floppy_disk = FALSE;\n\tBYTE geometry[256] = {0}, layout[4096] = {0}, part_type;\n\tPDISK_GEOMETRY_EX DiskGeometry = (PDISK_GEOMETRY_EX)(void*)geometry;\n\tPDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout;\n\tchar *volume_name, *buf;\n\n\tif (FileSystemName == NULL)\n\t\treturn FALSE;\n\n\tSelectedDrive.nPartitions = 0;\n\tmemset(SelectedDrive.Partition, 0, sizeof(SelectedDrive.Partition));\n\t// Populate the filesystem data\n\tFileSystemName[0] = 0;\n\tvolume_name = GetLogicalName(DriveIndex, 0, TRUE, FALSE);\n\tif ((volume_name == NULL) || (!GetVolumeInformationA(volume_name, NULL, 0, NULL, NULL, NULL, FileSystemName, FileSystemNameSize))) {\n\t\tsuprintf(\"No volume information for drive 0x%02x\", DriveIndex);\n\t}\n\tsafe_free(volume_name);\n\n\thPhysical = GetPhysicalHandle(DriveIndex, FALSE, FALSE, TRUE);\n\tif (hPhysical == INVALID_HANDLE_VALUE)\n\t\treturn FALSE;\n\n\tr = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, geometry, sizeof(geometry), &size, NULL);\n\tif (!r || size <= 0) {\n\t\tsuprintf(\"Could not get geometry for drive 0x%02x: %s\", DriveIndex, WindowsErrorString());\n\t\tsafe_closehandle(hPhysical);\n\t\treturn FALSE;\n\t}\n\tSelectedDrive.DiskSize = DiskGeometry->DiskSize.QuadPart;\n\tSelectedDrive.SectorSize = DiskGeometry->Geometry.BytesPerSector;\n\tSelectedDrive.FirstDataSector = MAXDWORD;\n\tif (SelectedDrive.SectorSize < 512) {\n\t\tsuprintf(\"WARNING: Drive 0x%02x reports a sector size of %d - Correcting to 512 bytes.\",\n\t\t\tDriveIndex, SelectedDrive.SectorSize);\n\t\tSelectedDrive.SectorSize = 512;\n\t}\n\tSelectedDrive.SectorsPerTrack = DiskGeometry->Geometry.SectorsPerTrack;\n\tSelectedDrive.MediaType = DiskGeometry->Geometry.MediaType;\n\n\tsuprintf(\"Disk type: %s, Disk size: %s, Sector size: %d bytes\",\n\t\t(SelectedDrive.MediaType == FixedMedia) ? \"FIXED\" : \"Removable\",\n\t\tSizeToHumanReadable(SelectedDrive.DiskSize, FALSE, FALSE), SelectedDrive.SectorSize);\n\tsuprintf(\"Cylinders: %\" PRIi64 \", Tracks per cylinder: %d, Sectors per track: %d\",\n\t\tDiskGeometry->Geometry.Cylinders.QuadPart, DiskGeometry->Geometry.TracksPerCylinder, DiskGeometry->Geometry.SectorsPerTrack);\n\tassert(SelectedDrive.SectorSize != 0);\n\n\tr = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, layout, sizeof(layout), &size, NULL );\n\tif (!r || size <= 0) {\n\t\tsuprintf(\"Could not get layout for drive 0x%02x: %s\", DriveIndex, WindowsErrorString());\n\t\tsafe_closehandle(hPhysical);\n\t\treturn FALSE;\n\t}\n\n\tswitch (DriveLayout->PartitionStyle) {\n\tcase PARTITION_STYLE_MBR:\n\t\tSelectedDrive.PartitionStyle = PARTITION_STYLE_MBR;\n\t\tfor (i = 0; i < DriveLayout->PartitionCount; i++) {\n\t\t\tif (DriveLayout->PartitionEntry[i].Mbr.PartitionType != PARTITION_ENTRY_UNUSED) {\n\t\t\t\tSelectedDrive.nPartitions++;\n\t\t\t}\n\t\t}\n\t\t// Detect drives that are using the whole disk as a single partition\n\t\tif ((DriveLayout->PartitionEntry[0].Mbr.PartitionType != PARTITION_ENTRY_UNUSED) &&\n\t\t\t(DriveLayout->PartitionEntry[0].StartingOffset.QuadPart == 0LL)) {\n\t\t\tsuprintf(\"Partition type: SFD (%s) or unpartitioned\", sfd_name);\n\t\t\tsuper_floppy_disk = TRUE;\n\t\t} else {\n\t\t\tsuprintf(\"Partition type: MBR, NB Partitions: %d\", SelectedDrive.nPartitions);\n\t\t\tSelectedDrive.has_mbr_uefi_marker = (DriveLayout->Mbr.Signature == MBR_UEFI_MARKER);\n\t\t\tsuprintf(\"Disk ID: 0x%08X %s\", DriveLayout->Mbr.Signature, SelectedDrive.has_mbr_uefi_marker?\"(UEFI target)\":\"\");\n\t\t\tAnalyzeMBR(hPhysical, \"Drive\", bSilent);\n\t\t}\n\t\tfor (i = 0; i < DriveLayout->PartitionCount; i++) {\n\t\t\tisUefiNtfs = FALSE;\n\t\t\tif (DriveLayout->PartitionEntry[i].Mbr.PartitionType != PARTITION_ENTRY_UNUSED) {\n\t\t\t\tpart_type = DriveLayout->PartitionEntry[i].Mbr.PartitionType;\n\t\t\t\t// Microsoft will have to explain why they completely ignore the actual MBR partition\n\t\t\t\t// type for zeroed drive (which *IS* 0x00) and fill in Small FAT16 instead (0x04).\n\t\t\t\t// This means that if we detect a Small FAT16 \"partition\", that \"starts\" at offset 0\n\t\t\t\t// and that is larger than 16 MB, our drive is actually unpartitioned. \n\t\t\t\tif (part_type == 0x04 && super_floppy_disk && SelectedDrive.DiskSize > 16 * MB)\n\t\t\t\t\tbreak;\n\t\t\t\tif (part_type == 0xef) {\n\t\t\t\t\t// Check the FAT label to see if we're dealing with an UEFI_NTFS partition\n\t\t\t\t\tbuf = calloc(SelectedDrive.SectorSize, 1);\n\t\t\t\t\tif (buf != NULL) {\n\t\t\t\t\t\tif (SetFilePointerEx(hPhysical, DriveLayout->PartitionEntry[i].StartingOffset, NULL, FILE_BEGIN) &&\n\t\t\t\t\t\t\tReadFile(hPhysical, buf, SelectedDrive.SectorSize, &size, NULL)) {\n\t\t\t\t\t\t\tisUefiNtfs = (strncmp(&buf[0x2B], \"UEFI_NTFS\", 9) == 0) || (strncmp(&buf[0x2B], \"RUFUS_BOOT\", 10) == 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfree(buf);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsuprintf(\"Partition %d%s:\", i + (super_floppy_disk ? 0 : 1), isUefiNtfs ? \" (UEFI:NTFS)\" : \"\");\n\t\t\t\tfor (j = 0; j < ARRAYSIZE(mbr_mountable); j++) {\n\t\t\t\t\tif (part_type == mbr_mountable[j]) {\n\t\t\t\t\t\tret = TRUE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (i < MAX_PARTITIONS) {\n\t\t\t\t\tSelectedDrive.Partition[i].Offset = DriveLayout->PartitionEntry[i].StartingOffset.QuadPart;\n\t\t\t\t\tSelectedDrive.Partition[i].Size = DriveLayout->PartitionEntry[i].PartitionLength.QuadPart;\n\t\t\t\t}\n\t\t\t\tsuprintf(\"  Type: %s (0x%02x)\\r\\n  Detected File System: %s\\r\\n\"\n\t\t\t\t\t\"  Size: %s (%lld bytes)\\r\\n  Start Sector: %lld, Boot: %s\",\n\t\t\t\t\t((part_type == 0x07 || super_floppy_disk) && (FileSystemName[0] != 0)) ?\n\t\t\t\t\tFileSystemName : GetMBRPartitionType(part_type), super_floppy_disk ? 0: part_type,\n\t\t\t\t\tGetFsName(hPhysical, DriveLayout->PartitionEntry[i].StartingOffset),\n\t\t\t\t\tSizeToHumanReadable(DriveLayout->PartitionEntry[i].PartitionLength.QuadPart, TRUE, FALSE),\n\t\t\t\t\tDriveLayout->PartitionEntry[i].PartitionLength.QuadPart,\n\t\t\t\t\tDriveLayout->PartitionEntry[i].StartingOffset.QuadPart / SelectedDrive.SectorSize,\n\t\t\t\t\tDriveLayout->PartitionEntry[i].Mbr.BootIndicator ? \"Yes\" : \"No\");\n\t\t\t\t// suprintf(\"  GUID: %s\", GuidToString(&DriveLayout->PartitionEntry[i].Mbr.PartitionId));\n\t\t\t\tSelectedDrive.FirstDataSector = min(SelectedDrive.FirstDataSector,\n\t\t\t\t\t(DWORD)(DriveLayout->PartitionEntry[i].StartingOffset.QuadPart / SelectedDrive.SectorSize));\n\t\t\t\tif ((part_type == RUFUS_EXTRA_PARTITION_TYPE) || (isUefiNtfs))\n\t\t\t\t\t// This is a partition Rufus created => we can safely ignore it\n\t\t\t\t\t--SelectedDrive.nPartitions;\n\t\t\t\tif (part_type == 0xee)\t// Flag a protective MBR for non GPT platforms (XP)\n\t\t\t\t\tSelectedDrive.has_protective_mbr = TRUE;\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tcase PARTITION_STYLE_GPT:\n\t\tSelectedDrive.PartitionStyle = PARTITION_STYLE_GPT;\n\t\tsuprintf(\"Partition type: GPT, NB Partitions: %d\", DriveLayout->PartitionCount);\n\t\tsuprintf(\"Disk GUID: %s\", GuidToString(&DriveLayout->Gpt.DiskId, TRUE));\n\t\tsuprintf(\"Max parts: %d, Start Offset: %\" PRIi64 \", Usable = %\" PRIi64 \" bytes\",\n\t\t\tDriveLayout->Gpt.MaxPartitionCount, DriveLayout->Gpt.StartingUsableOffset.QuadPart, DriveLayout->Gpt.UsableLength.QuadPart);\n\t\tfor (i = 0; i < DriveLayout->PartitionCount; i++) {\n\t\t\tif (i < MAX_PARTITIONS) {\n\t\t\t\tSelectedDrive.Partition[i].Offset = DriveLayout->PartitionEntry[i].StartingOffset.QuadPart;\n\t\t\t\tSelectedDrive.Partition[i].Size = DriveLayout->PartitionEntry[i].PartitionLength.QuadPart;\n\t\t\t\twcscpy(SelectedDrive.Partition[i].Name, DriveLayout->PartitionEntry[i].Gpt.Name);\n\t\t\t}\n\t\t\tSelectedDrive.nPartitions++;\n\t\t\tisUefiNtfs = (wcscmp(DriveLayout->PartitionEntry[i].Gpt.Name, L\"UEFI:NTFS\") == 0);\n\t\t\tsuprintf(\"Partition %d%s:\\r\\n  Type: %s\", i + 1, isUefiNtfs ? \" (UEFI:NTFS)\" : \"\",\n\t\t\t\tGetGPTPartitionType(&DriveLayout->PartitionEntry[i].Gpt.PartitionType));\n\t\t\tif (DriveLayout->PartitionEntry[i].Gpt.Name[0] != 0)\n\t\t\t\tsuprintf(\"  Name: '%S'\", DriveLayout->PartitionEntry[i].Gpt.Name);\n\t\t\tsuprintf(\"  Detected File System: %s\", GetFsName(hPhysical, DriveLayout->PartitionEntry[i].StartingOffset));\n\t\t\tsuprintf(\"  ID: %s\\r\\n  Size: %s (%\" PRIi64 \" bytes)\\r\\n  Start Sector: %\" PRIi64 \", Attributes: 0x%016\" PRIX64,\n\t\t\t\tGuidToString(&DriveLayout->PartitionEntry[i].Gpt.PartitionId, TRUE),\n\t\t\t\tSizeToHumanReadable(DriveLayout->PartitionEntry[i].PartitionLength.QuadPart, TRUE, FALSE),\n\t\t\t\tDriveLayout->PartitionEntry[i].PartitionLength.QuadPart,\n\t\t\t\tDriveLayout->PartitionEntry[i].StartingOffset.QuadPart / SelectedDrive.SectorSize,\n\t\t\t\tDriveLayout->PartitionEntry[i].Gpt.Attributes);\n\t\t\tSelectedDrive.FirstDataSector = min(SelectedDrive.FirstDataSector,\n\t\t\t\t(DWORD)(DriveLayout->PartitionEntry[i].StartingOffset.QuadPart / SelectedDrive.SectorSize));\n\t\t\t// Don't register the partitions that we don't care about destroying\n\t\t\tif ( isUefiNtfs ||\n\t\t\t\t (CompareGUID(&DriveLayout->PartitionEntry[i].Gpt.PartitionType, &PARTITION_MICROSOFT_RESERVED)) ||\n\t\t\t\t (CompareGUID(&DriveLayout->PartitionEntry[i].Gpt.PartitionType, &PARTITION_GENERIC_ESP)) )\n\t\t\t\t--SelectedDrive.nPartitions;\n\t\t\tif (CompareGUID(&DriveLayout->PartitionEntry[i].Gpt.PartitionType, &PARTITION_MICROSOFT_DATA))\n\t\t\t\tret = TRUE;\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tSelectedDrive.PartitionStyle = PARTITION_STYLE_MBR;\n\t\tsuprintf(\"Partition type: RAW\");\n\t\tbreak;\n\t}\n#if defined(__GNUC__)\n#pragma GCC diagnostic warning \"-Warray-bounds\"\n#endif\n\tsafe_closehandle(hPhysical);\n\n\treturn ret;\n}\n\n/*\n * Flush file data\n */\nstatic BOOL FlushDrive(char drive_letter)\n{\n\tHANDLE hDrive = INVALID_HANDLE_VALUE;\n\tBOOL r = FALSE;\n\tchar logical_drive[] = \"\\\\\\\\.\\\\#:\";\n\n\tlogical_drive[4] = drive_letter;\n\thDrive = CreateFileA(logical_drive, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,\n\t\tNULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n\tif (hDrive == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Failed to open %c: for flushing: %s\", toupper(drive_letter), WindowsErrorString());\n\t\tgoto out;\n\t}\n\tr = FlushFileBuffers(hDrive);\n\tif (r == FALSE)\n\t\tuprintf(\"Failed to flush %c: %s\", toupper(drive_letter), WindowsErrorString());\n\nout:\n\tsafe_closehandle(hDrive);\n\treturn r;\n}\n\n/*\n * Unmount of volume using the DISMOUNT_VOLUME ioctl\n */\nBOOL UnmountVolume(HANDLE hDrive)\n{\n\tif (!DeviceIoControl(hDrive, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, NULL, NULL)) {\n\t\tuprintf(\"Could not unmount drive: %s\", WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\treturn TRUE;\n}\n\n/*\n * Mount the volume identified by drive_guid to mountpoint drive_name.\n * If volume_name is already mounted, but with a different letter than the\n * one requested then drive_name is updated to use that letter.\n */\nBOOL MountVolume(char* drive_name, char *volume_name)\n{\n\tchar mounted_guid[52], dos_name[] = \"?:\";\n#if defined(WINDOWS_IS_NOT_BUGGY)\n\tchar mounted_letter[27] = { 0 };\n\tDWORD size;\n#endif\n\n\tif ((drive_name == NULL) || (volume_name == NULL) || (drive_name[0] == '?')) {\n\t\tSetLastError(ERROR_INVALID_PARAMETER);\n\t\treturn FALSE;\n\t}\n\n\t// If we are working with a \"\\\\?\\GLOBALROOT\" device, SetVolumeMountPoint()\n\t// is useless, so try with DefineDosDevice() instead.\n\tif (_strnicmp(volume_name, groot_name, groot_len) == 0) {\n\t\tdos_name[0] = drive_name[0];\n\t\t// Microsoft will also have to explain why \"In no case is a trailing backslash allowed\" [1] in\n\t\t// DefineDosDevice(), instead of just checking if the driver parameter is \"X:\\\" and remove the\n\t\t// backslash from a copy of the parameter in the bloody API call. *THIS* really tells a lot\n\t\t// about the level of thought and foresight that actually goes into the Windows APIs...\n\t\t// [1] https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-definedosdevicew\n\t\tif (!DefineDosDeviceA(DDD_RAW_TARGET_PATH | DDD_NO_BROADCAST_SYSTEM, dos_name, &volume_name[14])) {\n\t\t\tuprintf(\"Could not mount %s as %c:\", volume_name, toupper(drive_name[0]));\n\t\t\treturn FALSE;\n\t\t}\n\t\tuprintf(\"%s was successfully mounted as %c:\", volume_name, toupper(drive_name[0]));\n\t\treturn TRUE;\n\t}\n\n\t// Great: Windows has a *MAJOR BUG* whereas, in some circumstances, GetVolumePathNamesForVolumeName()\n\t// can return the *WRONG* drive letter. And yes, we validated that this is *NOT* an issue like stack\n\t// or buffer corruption and whatnot. It *IS* a Windows bug. So just drop the idea of updating the\n\t// drive letter if already mounted and use the passed target always.\n#if defined(WINDOWS_IS_NOT_BUGGY)\n\t// Windows may already have the volume mounted but under a different letter.\n\t// If that is the case, update drive_name to that letter.\n\tif ( (GetVolumePathNamesForVolumeNameA(volume_name, mounted_letter, sizeof(mounted_letter), &size))\n\t  && (size > 1) && (mounted_letter[0] != drive_name[0]) ) {\n\t\tuprintf(\"%s is already mounted as %c: instead of %c: - Will now use this target instead...\",\n\t\t\tvolume_name, toupper(mounted_letter[0]), toupper(drive_name[0]));\n\t\tdrive_name[0] = mounted_letter[0];\n\t\treturn TRUE;\n\t}\n#endif\n\n\tif (!SetVolumeMountPointA(drive_name, volume_name)) {\n\t\tif (GetLastError() == ERROR_DIR_NOT_EMPTY) {\n\t\t\tif (!GetVolumeNameForVolumeMountPointA(drive_name, mounted_guid, sizeof(mounted_guid))) {\n\t\t\t\tuprintf(\"%s is already mounted, but volume GUID could not be checked: %s\",\n\t\t\t\t\tdrive_name, WindowsErrorString());\n\t\t\t} else if (safe_strcmp(volume_name, mounted_guid) != 0) {\n\t\t\t\tuprintf(\"%s is mounted, but volume GUID doesn't match:\\r\\n  expected %s, got %s\",\n\t\t\t\t\tdrive_name, volume_name, mounted_guid);\n\t\t\t} else {\n\t\t\t\tduprintf(\"%s is already mounted as %c:\", volume_name, toupper(drive_name[0]));\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\tuprintf(\"Retrying after dismount...\");\n\t\t\tif (!DeleteVolumeMountPointA(drive_name))\n\t\t\t\tuprintf(\"WARNING: Could not delete volume mountpoint '%s': %s\", drive_name, WindowsErrorString());\n\t\t\tif (SetVolumeMountPointA(drive_name, volume_name))\n\t\t\t\treturn TRUE;\n\t\t\tif ((GetLastError() == ERROR_DIR_NOT_EMPTY) &&\n\t\t\t\tGetVolumeNameForVolumeMountPointA(drive_name, mounted_guid, sizeof(mounted_guid)) &&\n\t\t\t\t(safe_strcmp(volume_name, mounted_guid) == 0)) {\n\t\t\t\tuprintf(\"%s was remounted as %c: (second time lucky!)\", volume_name, toupper(drive_name[0]));\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}\n\treturn TRUE;\n}\n\n/*\n * Alternate version of MountVolume required for ESP's, since Windows (including VDS) does\n * *NOT* provide any means of mounting these volume but through DefineDosDevice(). Also\n * note that bcdboot is very finicky about what it may or may not handle, even if the\n * mount was successful (e.g. '\\Device\\HarddiskVolume###' vs 'Device\\HarddiskVolume###').\n * Returned string is static (no concurrency) and must not be freed.\n */\nchar* AltMountVolume(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bSilent)\n{\n\tchar* ret = NULL, *volume_name = NULL;\n\tstatic char mounted_drive[] = \"?:\";\n\n\tmounted_drive[0] = GetUnusedDriveLetter();\n\tif (mounted_drive[0] == 0) {\n\t\tsuprintf(\"Could not find an unused drive letter\");\n\t\tgoto out;\n\t}\n\t// Can't use a regular volume GUID for ESPs...\n\tvolume_name = AltGetLogicalName(DriveIndex, PartitionOffset, FALSE, FALSE);\n\tif ((volume_name == NULL) || (strncmp(volume_name, groot_name, groot_len) != 0)) {\n\t\tsuprintf(\"Unexpected volume name: '%s'\", volume_name);\n\t\tgoto out;\n\t}\n\n\tsuprintf(\"Mounting '%s' as '%s'\", &volume_name[14], mounted_drive);\n\t// bcdboot doesn't like it if you forget the starting '\\'\n\tif (!DefineDosDeviceA(DDD_RAW_TARGET_PATH | DDD_NO_BROADCAST_SYSTEM, mounted_drive, &volume_name[14])) {\n\t\tsuprintf(\"Mount operation failed: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\tret = mounted_drive;\n\nout:\n\tfree(volume_name);\n\treturn ret;\n}\n\n/*\n * Unmount a volume that was mounted by AltmountVolume()\n */\nBOOL AltUnmountVolume(const char* drive_name, BOOL bSilent)\n{\n\tif (drive_name == NULL)\n\t\treturn FALSE;\n\tif (!DefineDosDeviceA(DDD_REMOVE_DEFINITION | DDD_NO_BROADCAST_SYSTEM, drive_name, NULL)) {\n\t\tsuprintf(\"Could not unmount '%s': %s\", drive_name, WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\tsuprintf(\"Successfully unmounted '%s'\", drive_name);\n\treturn TRUE;\n}\n\n/*\n * Issue a complete remount of the volume.\n * Note that drive_name *may* be altered when the volume gets remounted.\n */\nBOOL RemountVolume(char* drive_name, BOOL bSilent)\n{\n\tchar volume_name[51];\n\n\t// UDF requires a sync/flush, and it's also a good idea for other FS's\n\tFlushDrive(drive_name[0]);\n\tif (GetVolumeNameForVolumeMountPointA(drive_name, volume_name, sizeof(volume_name))) {\n\t\tif (MountVolume(drive_name, volume_name)) {\n\t\t\tsuprintf(\"Successfully remounted %s as %c:\", volume_name, toupper(drive_name[0]));\n\t\t} else {\n\t\t\tsuprintf(\"Could not remount %s as %c: %s\", volume_name, toupper(drive_name[0]), WindowsErrorString());\n\t\t\t// This will leave the drive inaccessible and must be flagged as an error\n\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_REMOUNT_VOLUME));\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\treturn TRUE;\n}\n\n/*\n * Zero the first 'size' bytes of a partition. This is needed because we haven't found a way to\n * properly reset Windows's cached view of a drive partitioning short of cycling the USB port\n * (especially IOCTL_DISK_UPDATE_PROPERTIES is *USELESS*), and therefore the OS will try to\n * read the file system data at an old location, even if the partition has just been deleted.\n */\nstatic BOOL ClearPartition(HANDLE hDrive, uint64_t offset, DWORD size)\n{\n\tBOOL r = FALSE;\n\tuint8_t* buffer = calloc(size, 1);\n\tLARGE_INTEGER li_offset;\n\n\tif (buffer == NULL)\n\t\treturn FALSE;\n\n\tli_offset.QuadPart = offset;\n\tif (!SetFilePointerEx(hDrive, li_offset, NULL, FILE_BEGIN)) {\n\t\tfree(buffer);\n\t\treturn FALSE;\n\t}\n\n\tr = WriteFileWithRetry(hDrive, buffer, size, &size, WRITE_RETRIES);\n\tfree(buffer);\n\treturn r;\n}\n\n/*\n * Create a partition table\n * See http://technet.microsoft.com/en-us/library/cc739412.aspx for some background info\n * NB: if you modify the MBR outside of using the Windows API, Windows still uses the cached\n * copy it got from the last IOCTL, and ignores your changes until you replug the drive\n * or issue an IOCTL_DISK_UPDATE_PROPERTIES.\n */\nBOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL mbr_uefi_marker, uint8_t extra_partitions)\n{\n\tconst char* PartitionTypeName[] = { \"MBR\", \"GPT\", \"SFD\" };\n\tconst LONGLONG bytes_per_track = ((LONGLONG)SelectedDrive.SectorsPerTrack) * SelectedDrive.SectorSize;\n\tconst DWORD size_to_clear = MAX_SECTORS_TO_CLEAR * SelectedDrive.SectorSize;\n\tuint8_t* buffer;\n\tuint64_t last_offset = SelectedDrive.DiskSize;\n\tsize_t uefi_ntfs_size = 0;\n\tDWORD pi = 0, mi, i, size, bufsize;\n\tCREATE_DISK CreateDisk = { PARTITION_STYLE_RAW, { { 0 } } };\n\tDRIVE_LAYOUT_INFORMATION_EX4 DriveLayoutEx = { 0 };\n\t// Go for a 260 MB sized ESP by default to keep everyone happy, including 4K sector users:\n\t// https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-uefigpt-based-hard-drive-partitions\n\t// and folks using MacOS: https://github.com/pbatard/rufus/issues/979\n\tLONGLONG esp_size = 260 * MB;\n\tLONGLONG ClusterSize = (LONGLONG)ComboBox_GetCurItemData(hClusterSize);\n\n\tPrintInfoDebug(0, MSG_238, PartitionTypeName[partition_style]);\n\n\tif (ClusterSize == 0)\n\t\tClusterSize = 0x200;\n\n\tif (partition_style == PARTITION_STYLE_SFD)\n\t\t// Nothing to do\n\t\treturn TRUE;\n\n\tif (extra_partitions & XP_UEFI_NTFS) {\n\t\tuefi_ntfs_size = GetResourceSize(hMainInstance, MAKEINTRESOURCEA(IDR_UEFI_NTFS), _RT_RCDATA, \"uefi-ntfs.img\");\n\t\tif (uefi_ntfs_size == 0) {\n\t\t\tuprintf(\"Could not access embedded 'uefi-ntfs.img'\");\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\n\tmemset(partition_index, 0, sizeof(partition_index));\n\tmemset(SelectedDrive.Partition, 0, sizeof(SelectedDrive.Partition));\n\n\t// Compute the starting offset of the first partition\n\tif ((partition_style == PARTITION_STYLE_GPT) || (!IsChecked(IDC_OLD_BIOS_FIXES))) {\n\t\t// Go with the MS 1 MB wastage at the beginning...\n\t\tSelectedDrive.Partition[pi].Offset = 1 * MB;\n\t} else {\n\t\t// Some folks appear to think that 'Fixes for old BIOSes' is some kind of magic\n\t\t// wand and are adamant to try to apply them when creating *MODERN* VHD drives.\n\t\t// This, however, wrecks havok on MS' internal format calls because, as opposed\n\t\t// to what is the case for regular drives, VHDs require each cluster block to\n\t\t// be aligned to the cluster size, and that may not be the case with the stupid\n\t\t// CHS sizes that IBM imparted upon us. Long story short, we now align to a\n\t\t// cylinder size that is itself aligned to the cluster size.\n\t\t// If this actually breaks old systems, please send your complaints to IBM.\n\t\tSelectedDrive.Partition[pi].Offset = CEILING_ALIGN(bytes_per_track, ClusterSize);\n\t\t// GRUB2 no longer fits in the usual 31½ KB that the above computation provides\n\t\t// so just unconditionally double that size and get on with it.\n\t\tSelectedDrive.Partition[pi].Offset *= 2;\n\t}\n\n\t// Having the ESP up front may help (and is the Microsoft recommended way) but this\n\t// is only achievable if we can mount more than one partition at once, which means\n\t// either fixed drive or Windows 10 1703 or later.\n\tif (((SelectedDrive.MediaType == FixedMedia) || (WindowsVersion.BuildNumber > 15000)) &&\n\t\t(extra_partitions & XP_ESP)) {\n\t\tassert(partition_style == PARTITION_STYLE_GPT);\n\t\tpartition_index[PI_ESP] = pi;\n\t\twcscpy(SelectedDrive.Partition[pi].Name, L\"EFI System Partition\");\n\t\tSelectedDrive.Partition[pi].Size = esp_size;\n\t\tSelectedDrive.Partition[pi + 1].Offset = SelectedDrive.Partition[pi].Offset + SelectedDrive.Partition[pi].Size;\n\t\t// Align next partition to track and cluster\n\t\tSelectedDrive.Partition[pi + 1].Offset = CEILING_ALIGN(SelectedDrive.Partition[pi + 1].Offset, bytes_per_track);\n\t\tif (ClusterSize % SelectedDrive.SectorSize == 0)\n\t\t\tSelectedDrive.Partition[pi + 1].Offset = FLOOR_ALIGN(SelectedDrive.Partition[pi + 1].Offset, ClusterSize);\n\t\tassert(SelectedDrive.Partition[pi + 1].Offset >= SelectedDrive.Partition[pi].Offset + SelectedDrive.Partition[pi].Size);\n\t\tpi++;\n\t\t// Clear the extra partition we processed\n\t\textra_partitions &= ~(XP_ESP);\n\t}\n\n\t// If required, set the MSR partition (GPT only - must be created before the data part)\n\tif (extra_partitions & XP_MSR) {\n\t\tassert(partition_style == PARTITION_STYLE_GPT);\n\t\twcscpy(SelectedDrive.Partition[pi].Name, L\"Microsoft Reserved Partition\");\n\t\tSelectedDrive.Partition[pi].Size = 128 * MB;\n\t\tSelectedDrive.Partition[pi + 1].Offset = SelectedDrive.Partition[pi].Offset + SelectedDrive.Partition[pi].Size;\n\t\tSelectedDrive.Partition[pi + 1].Offset = CEILING_ALIGN(SelectedDrive.Partition[pi + 1].Offset, bytes_per_track);\n\t\tif (ClusterSize % SelectedDrive.SectorSize == 0)\n\t\t\tSelectedDrive.Partition[pi + 1].Offset = FLOOR_ALIGN(SelectedDrive.Partition[pi + 1].Offset, ClusterSize);\n\t\tassert(SelectedDrive.Partition[pi + 1].Offset >= SelectedDrive.Partition[pi].Offset + SelectedDrive.Partition[pi].Size);\n\t\tpi++;\n\t\textra_partitions &= ~(XP_MSR);\n\t}\n\n\t// Reserve an entry for the main partition\n\tpartition_index[PI_MAIN] = pi++;\n\t// Shorthand for the main index.\n\tmi = partition_index[PI_MAIN];\n\twcscpy(SelectedDrive.Partition[mi].Name, write_as_esp ? L\"EFI System Partition\" : L\"Main Data Partition\");\n\n\tif (extra_partitions) {\n\t\t// Adjust the size according to extra partitions (which we always align to a track)\n\t\t// TODO: Should we align these to cluster as well?\n\t\tif (extra_partitions & XP_PERSISTENCE) {\n\t\t\tassert(persistence_size != 0);\n\t\t\tpartition_index[PI_CASPER] = pi;\n\t\t\twcscpy(SelectedDrive.Partition[pi].Name, L\"Linux Persistence\");\n\t\t\tSelectedDrive.Partition[pi++].Size = CEILING_ALIGN(persistence_size, bytes_per_track);\n\t\t}\n\t\tif (extra_partitions & XP_ESP) {\n\t\t\tpartition_index[PI_ESP] = pi;\n\t\t\twcscpy(SelectedDrive.Partition[pi].Name, L\"EFI System Partition\");\n\t\t\tSelectedDrive.Partition[pi++].Size = CEILING_ALIGN(esp_size, bytes_per_track);\n\t\t} else if (extra_partitions & XP_UEFI_NTFS) {\n\t\t\tpartition_index[PI_UEFI_NTFS] = pi;\n\t\t\twcscpy(SelectedDrive.Partition[pi].Name, L\"UEFI:NTFS\");\n\t\t\tSelectedDrive.Partition[pi++].Size = CEILING_ALIGN(uefi_ntfs_size, bytes_per_track);\n\t\t} else if (extra_partitions & XP_COMPAT) {\n\t\t\twcscpy(SelectedDrive.Partition[pi].Name, L\"BIOS Compatibility\");\n\t\t\tSelectedDrive.Partition[pi++].Size = bytes_per_track;\t// One track for the extra partition\n\t\t}\n\t}\n\tassert(pi <= MAX_PARTITIONS);\n\tif (pi > MAX_PARTITIONS)\n\t\treturn FALSE;\n\n\t// Compute the offsets of the extra partitions (which we always align to a track)\n\tlast_offset = SelectedDrive.DiskSize;\n\tif (partition_style == PARTITION_STYLE_GPT)\n\t\tlast_offset -= 33ULL * SelectedDrive.SectorSize;\n\tfor (i = pi - 1; i > mi; i--) {\n\t\tassert(SelectedDrive.Partition[i].Size < last_offset);\n\t\tSelectedDrive.Partition[i].Offset = FLOOR_ALIGN(last_offset - SelectedDrive.Partition[i].Size, bytes_per_track);\n\t\tlast_offset = SelectedDrive.Partition[i].Offset;\n\t}\n\n\t// With the above, Compute the main partition size (which we align to a track)\n\tassert(last_offset > SelectedDrive.Partition[mi].Offset);\n\tSelectedDrive.Partition[mi].Size = FLOOR_ALIGN(last_offset - SelectedDrive.Partition[mi].Offset, bytes_per_track);\n\t// Try to make sure that the main partition size is a multiple of the cluster size\n\t// This can be especially important when trying to capture an NTFS partition as FFU, as, when\n\t// the NTFS partition is aligned to cluster size, the FFU capture parses the NTFS allocated\n\t// map to only record clusters that are in use, whereas, if not aligned, the FFU capture uses\n\t// a full sector by sector scan of the NTFS partition and records any non-zero garbage, which\n\t// may include garbage leftover data from a previous reformat...\n\tif (ClusterSize % SelectedDrive.SectorSize == 0)\n\t\tSelectedDrive.Partition[mi].Size = FLOOR_ALIGN(SelectedDrive.Partition[mi].Size, ClusterSize);\n\tif (SelectedDrive.Partition[mi].Size <= 0) {\n\t\tuprintf(\"Error: Invalid %S size\", SelectedDrive.Partition[mi].Name);\n\t\treturn FALSE;\n\t}\n\n\t// Build the DriveLayoutEx table\n\tfor (i = 0; i < pi; i++) {\n\t\tuprintf(\"● Creating %S%s (offset: %lld, size: %s)\", SelectedDrive.Partition[i].Name,\n\t\t\t(wcsstr(SelectedDrive.Partition[i].Name, L\"Partition\") == NULL) ? \" Partition\" : \"\",\n\t\t\tSelectedDrive.Partition[i].Offset,\n\t\t\tSizeToHumanReadable(SelectedDrive.Partition[i].Size, TRUE, FALSE));\n\t\t// Zero the first sectors of the partition to avoid file system caching issues\n\t\tif (!ClearPartition(hDrive, SelectedDrive.Partition[i].Offset,\n\t\t\t(DWORD)MIN(size_to_clear, SelectedDrive.Partition[i].Size)))\n\t\t\tuprintf(\"Could not zero %S: %s\", SelectedDrive.Partition[i].Name, WindowsErrorString());\n\t\tDriveLayoutEx.PartitionEntry[i].PartitionStyle = partition_style;\n\t\tDriveLayoutEx.PartitionEntry[i].StartingOffset.QuadPart = SelectedDrive.Partition[i].Offset;\n\t\tDriveLayoutEx.PartitionEntry[i].PartitionLength.QuadPart = SelectedDrive.Partition[i].Size;\n\t\tDriveLayoutEx.PartitionEntry[i].PartitionNumber = i + 1;\n\t\tDriveLayoutEx.PartitionEntry[i].RewritePartition = TRUE;\n\t\tif (partition_style == PARTITION_STYLE_MBR) {\n\t\t\tif (i == mi) {\n\t\t\t\tDriveLayoutEx.PartitionEntry[i].Mbr.BootIndicator = (boot_type != BT_NON_BOOTABLE);\n\t\t\t\tswitch (file_system) {\n\t\t\t\tcase FS_FAT16:\n\t\t\t\t\tDriveLayoutEx.PartitionEntry[i].Mbr.PartitionType = 0x0e;\t// FAT16 LBA\n\t\t\t\t\tbreak;\n\t\t\t\tcase FS_NTFS:\n\t\t\t\tcase FS_EXFAT:\n\t\t\t\tcase FS_UDF:\n\t\t\t\tcase FS_REFS:\n\t\t\t\t\tDriveLayoutEx.PartitionEntry[i].Mbr.PartitionType = 0x07;\n\t\t\t\t\tbreak;\n\t\t\t\tcase FS_EXT2:\n\t\t\t\tcase FS_EXT3:\n\t\t\t\tcase FS_EXT4:\n\t\t\t\t\tDriveLayoutEx.PartitionEntry[i].Mbr.PartitionType = 0x83;\n\t\t\t\t\tbreak;\n\t\t\t\tcase FS_FAT32:\n\t\t\t\t\tDriveLayoutEx.PartitionEntry[i].Mbr.PartitionType = 0x0c;\t// FAT32 LBA\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tuprintf(\"Unsupported file system\");\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// May override the the type of main partition if write_as_esp is active\n\t\t\tif ((wcscmp(SelectedDrive.Partition[i].Name, L\"EFI System Partition\") == 0) ||\n\t\t\t\t(wcscmp(SelectedDrive.Partition[i].Name, L\"UEFI:NTFS\") == 0))\n\t\t\t\t// UEFI:NTFS as an MBR ESP somehow seems to be okay, but we may want\n\t\t\t\t// to switch to type 0x01 (FAT21) if people report issues.\n\t\t\t\tDriveLayoutEx.PartitionEntry[i].Mbr.PartitionType = 0xef;\n\t\t\telse if (wcscmp(SelectedDrive.Partition[i].Name, L\"Linux Persistence\") == 0)\n\t\t\t\tDriveLayoutEx.PartitionEntry[i].Mbr.PartitionType = 0x83;\n\t\t\telse if (wcscmp(SelectedDrive.Partition[i].Name, L\"BIOS Compatibility\") == 0)\n\t\t\t\tDriveLayoutEx.PartitionEntry[i].Mbr.PartitionType = RUFUS_EXTRA_PARTITION_TYPE;\n\t\t} else {\n\t\t\tassert(partition_style == PARTITION_STYLE_GPT);\n\t\t\tif (wcscmp(SelectedDrive.Partition[i].Name, L\"UEFI:NTFS\") == 0) {\n\t\t\t\t// Boy do you *NOT* want the ESP of a GPT bootable drive to be declared as ESP,\n\t\t\t\t// lest the Microsoft Windows installer errors out at \"Copying Windows Files\"\n\t\t\t\t// because it just can't handle 2 ESPs on one system. The horror! The horror!\n\t\t\t\tDriveLayoutEx.PartitionEntry[i].Gpt.PartitionType = PARTITION_MICROSOFT_DATA;\n\t\t\t\t// Prevent a drive letter from being assigned to the UEFI:NTFS partition\n\t\t\t\tDriveLayoutEx.PartitionEntry[i].Gpt.Attributes = GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER;\n#if !defined(_DEBUG)\n\t\t\t\t// Also make the partition read-only for release versions\n\t\t\t\tDriveLayoutEx.PartitionEntry[i].Gpt.Attributes += GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY;\n#endif\n\t\t\t} else if (wcscmp(SelectedDrive.Partition[i].Name, L\"EFI System Partition\") == 0)\n\t\t\t\tDriveLayoutEx.PartitionEntry[i].Gpt.PartitionType = PARTITION_GENERIC_ESP;\n\t\t\telse if (wcscmp(SelectedDrive.Partition[i].Name, L\"Linux Persistence\") == 0)\n\t\t\t\tDriveLayoutEx.PartitionEntry[i].Gpt.PartitionType = PARTITION_LINUX_DATA;\n\t\t\telse if (wcscmp(SelectedDrive.Partition[i].Name, L\"Microsoft Reserved Partition\") == 0)\n\t\t\t\tDriveLayoutEx.PartitionEntry[i].Gpt.PartitionType = PARTITION_MICROSOFT_RESERVED;\n\t\t\telse\n\t\t\t\tDriveLayoutEx.PartitionEntry[i].Gpt.PartitionType = PARTITION_MICROSOFT_DATA;\n\t\t\tIGNORE_RETVAL(CoCreateGuid(&DriveLayoutEx.PartitionEntry[i].Gpt.PartitionId));\n\t\t\twcscpy(DriveLayoutEx.PartitionEntry[i].Gpt.Name, SelectedDrive.Partition[i].Name);\n\t\t}\n\t}\n\n\t// We need to write the UEFI:NTFS partition before we refresh the disk\n\tif (extra_partitions & XP_UEFI_NTFS) {\n\t\tLARGE_INTEGER li;\n\t\tuprintf(\"Writing UEFI:NTFS data...\");\n\t\tli.QuadPart = SelectedDrive.Partition[partition_index[PI_UEFI_NTFS]].Offset;\n\t\tif (!SetFilePointerEx(hDrive, li, NULL, FILE_BEGIN)) {\n\t\t\tuprintf(\"  Could not set position\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tbuffer = GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_UEFI_NTFS), _RT_RCDATA,\n\t\t\t\"uefi-ntfs.img\", &bufsize, FALSE);\n\t\tif (buffer == NULL) {\n\t\t\tuprintf(\"  Could not access source image\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(!WriteFileWithRetry(hDrive, buffer, bufsize, NULL, WRITE_RETRIES)) {\n\t\t\tuprintf(\"  Write error: %s\", WindowsErrorString());\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\n\tswitch (partition_style) {\n\tcase PARTITION_STYLE_MBR:\n\t\tCreateDisk.PartitionStyle = PARTITION_STYLE_MBR;\n\t\t// If MBR+UEFI is selected, write an UEFI marker in lieu of the regular MBR signature.\n\t\t// This helps us reselect the partition scheme option that was used when creating the\n\t\t// drive in Rufus. As far as I can tell, Windows doesn't care much if this signature\n\t\t// isn't unique for USB drives.\n\t\tCreateDisk.Mbr.Signature = mbr_uefi_marker ? MBR_UEFI_MARKER : (DWORD)GetTickCount64();\n\n\t\tDriveLayoutEx.PartitionStyle = PARTITION_STYLE_MBR;\n\t\tDriveLayoutEx.PartitionCount = 4;\t// Must be multiple of 4 for MBR\n\t\tDriveLayoutEx.Type.Mbr.Signature = CreateDisk.Mbr.Signature;\n\t\t// TODO: CHS fixup (32 sectors/track) through a cheat mode, if requested\n\t\t// NB: disk geometry is computed by BIOS & co. by finding a match between LBA and CHS value of first partition\n\t\t//     ms-sys's write_partition_number_of_heads() and write_partition_start_sector_number() can be used if needed\n\t\tbreak;\n\tcase PARTITION_STYLE_GPT:\n\t\t// TODO: (HOW?!?!?) As per MSDN: \"When specifying a GUID partition table (GPT) as the PARTITION_STYLE of the CREATE_DISK\n\t\t// structure, an application should wait for the MSR partition arrival before sending the IOCTL_DISK_SET_DRIVE_LAYOUT_EX\n\t\t// control code. For more information about device notification, see RegisterDeviceNotification.\"\n\n\t\tCreateDisk.PartitionStyle = PARTITION_STYLE_GPT;\n\t\tIGNORE_RETVAL(CoCreateGuid(&CreateDisk.Gpt.DiskId));\n\t\tCreateDisk.Gpt.MaxPartitionCount = MAX_PARTITIONS;\n\n\t\tDriveLayoutEx.PartitionStyle = PARTITION_STYLE_GPT;\n\t\tDriveLayoutEx.PartitionCount = pi;\n\t\t// At the very least, a GPT disk has 34 reserved sectors at the beginning and 33 at the end.\n\t\tDriveLayoutEx.Type.Gpt.StartingUsableOffset.QuadPart = 34 * SelectedDrive.SectorSize;\n\t\tDriveLayoutEx.Type.Gpt.UsableLength.QuadPart = SelectedDrive.DiskSize - (34 + 33) * SelectedDrive.SectorSize;\n\t\tDriveLayoutEx.Type.Gpt.MaxPartitionCount = MAX_PARTITIONS;\n\t\tDriveLayoutEx.Type.Gpt.DiskId = CreateDisk.Gpt.DiskId;\n\t\tbreak;\n\t}\n\n\t// If you don't call IOCTL_DISK_CREATE_DISK, the IOCTL_DISK_SET_DRIVE_LAYOUT_EX call will fail\n\tsize = sizeof(CreateDisk);\n\tif (!DeviceIoControl(hDrive, IOCTL_DISK_CREATE_DISK, (BYTE*)&CreateDisk, size, NULL, 0, NULL, NULL)) {\n\t\tuprintf(\"Could not reset disk: %s\", WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\n\t// \"The goggles, they do nothing!\"\n\tRefreshDriveLayout(hDrive);\n\n\tsize = sizeof(DriveLayoutEx) - ((partition_style == PARTITION_STYLE_GPT) ?\n\t\t((MAX_PARTITIONS - pi) * sizeof(PARTITION_INFORMATION_EX)) : 0);\n\t// The DRIVE_LAYOUT_INFORMATION_EX used by Microsoft, with its 1-sized array, is designed to overrun...\n\t// coverity[overrun-buffer-arg]\n\tif (!DeviceIoControl(hDrive, IOCTL_DISK_SET_DRIVE_LAYOUT_EX, (BYTE*)&DriveLayoutEx, size, NULL, 0, NULL, NULL)) {\n\t\tuprintf(\"Could not set drive layout: %s\", WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\n\tif (!RefreshDriveLayout(hDrive))\n\t\treturn FALSE;\n\n\treturn TRUE;\n}\n\nBOOL RefreshDriveLayout(HANDLE hDrive)\n{\n\tBOOL r;\n\n\t// Diskpart does call the following IOCTL this after updating the partition table, so we do too\n\tr = DeviceIoControl(hDrive, IOCTL_DISK_UPDATE_PROPERTIES, NULL, 0, NULL, 0, NULL, NULL);\n\tif (!r)\n\t\tuprintf(\"Could not refresh drive layout: %s\", WindowsErrorString());\n\treturn r;\n}\n\n/* Initialize disk for partitioning */\nBOOL InitializeDisk(HANDLE hDrive)\n{\n\tBOOL r;\n\tCREATE_DISK CreateDisk = {PARTITION_STYLE_RAW, {{0}}};\n\n\tuprintf(\"Initializing disk...\");\n\n\tr = DeviceIoControl(hDrive, IOCTL_DISK_CREATE_DISK, (BYTE*)&CreateDisk, sizeof(CreateDisk), NULL, 0, NULL, NULL);\n\tif (!r) {\n\t\tuprintf(\"Could not delete drive layout: %s\", WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\n\tr = DeviceIoControl(hDrive, IOCTL_DISK_UPDATE_PROPERTIES, NULL, 0, NULL, 0, NULL, NULL);\n\tif (!r) {\n\t\tuprintf(\"Could not refresh drive layout: %s\", WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\n\treturn TRUE;\n}\n\n/*\n * Convert MBR or GPT partition types to their human readable forms\n */\nconst char* GetMBRPartitionType(const uint8_t type)\n{\n\tint i;\n\tfor (i = 0; (i < ARRAYSIZE(mbr_type)) && (mbr_type[i].type != type); i++);\n\treturn (i < ARRAYSIZE(mbr_type)) ? mbr_type[i].name : \"Unknown\";\n}\n\nconst char* GetGPTPartitionType(const GUID* guid)\n{\n\tconst char* desc = gpt_type_desc(guid);\n\treturn desc != NULL ? desc : GuidToString(guid, TRUE);\n}\n\n/*\n * Detect Microsoft Dev Drives. See https://learn.microsoft.com/en-us/windows/dev-drive/.\n */\nBOOL IsMsDevDrive(DWORD DriveIndex)\n{\n\tBOOL ret = FALSE;\n\tDWORD size = 0;\n\tHANDLE hLogical = INVALID_HANDLE_VALUE;\n\tFILE_FS_PERSISTENT_VOLUME_INFORMATION data = { 0 };\n\n\thLogical = GetLogicalHandle(DriveIndex, 0, FALSE, FALSE, FALSE);\n\tif (hLogical == INVALID_HANDLE_VALUE)\n\t\tgoto out;\n\n\tdata.FlagMask = PERSISTENT_VOLUME_STATE_DEV_VOLUME;\n\tdata.Version = 1;\n\n\tif (!DeviceIoControl(hLogical, FSCTL_QUERY_PERSISTENT_VOLUME_STATE, &data, sizeof(data),\n\t\t&data, sizeof(data), &size, NULL))\n\t\tgoto out;\n\n\tret = data.VolumeFlags & PERSISTENT_VOLUME_STATE_DEV_VOLUME;\n\nout:\n\tsafe_closehandle(hLogical);\n\treturn ret;\n}\n\n/*\n * Detect filtered drives, that have been added by users through the registry\n * entries IgnoreDisk01 - IgnoreDisk08. These entries must contain *decorated*\n * string GUIDs that match the GPT Disk GUID of the drive to filter out, as\n * reported by Rufus, such as \"{F333EC2E-25C9-488D-A7FC-9147C2367623}\".\n */\nBOOL IsFilteredDrive(DWORD DriveIndex)\n{\n\tchar setting_name[32];\n\tDWORD i, size = 0;\n\tBOOL r, ret = FALSE;\n\tHANDLE hPhysical = INVALID_HANDLE_VALUE;\n\tBYTE layout[4096] = { 0 };\n\tPDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout;\n\tGUID DiskGuid;\n\n\thPhysical = GetPhysicalHandle(DriveIndex, FALSE, FALSE, TRUE);\n\tif (hPhysical == INVALID_HANDLE_VALUE)\n\t\tgoto out;\n\n\tr = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, layout, sizeof(layout), &size, NULL);\n\tif (!r || size <= 0)\n\t\tgoto out;\n\n\t// Only works for GPT drives\n\tif (DriveLayout->PartitionStyle != PARTITION_STYLE_GPT)\n\t\tgoto out;\n\tfor (i = 1; i <= MAX_IGNORE_USB; i++) {\n\t\tstatic_sprintf(setting_name, \"IgnoreDisk%02d\", i);\n\t\tDiskGuid = StringToGuid(ReadSettingStr(setting_name));\n\t\tif (CompareGUID(&DriveLayout->Gpt.DiskId, &DiskGuid)) {\n\t\t\tuprintf(\"Device eliminated because it matches Disk GUID %s\", GuidToString(&DiskGuid, TRUE));\n\t\t\tret = TRUE;\n\t\t\tgoto out;\n\t\t}\n\t}\n\nout:\n\tsafe_closehandle(hPhysical);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/drive.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Drive access function calls\n * Copyright © 2011-2025 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <windows.h>\n#include <stdint.h>\n#include <winioctl.h>   // for DISK_GEOMETRY\n#include <winternl.h>\n\n#pragma once\n\n#define RUFUS_EXTRA_PARTITION_TYPE          0xea\n#define MOUNTMGRCONTROLTYPE                 ((ULONG)'m')\n#define MOUNTMGR_DOS_DEVICE_NAME            \"\\\\\\\\.\\\\MountPointManager\"\n#define IOCTL_MOUNTMGR_QUERY_AUTO_MOUNT     \\\n\tCTL_CODE(MOUNTMGRCONTROLTYPE, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)\n#define IOCTL_MOUNTMGR_SET_AUTO_MOUNT       \\\n\tCTL_CODE(MOUNTMGRCONTROLTYPE, 16, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)\n\n#define XP_MSR                              0x01\n#define XP_ESP                              0x02\n#define XP_UEFI_NTFS                        0x04\n#define XP_COMPAT                           0x08\n#define XP_PERSISTENCE                      0x10\n\n#define PI_MAIN                             0\n#define PI_ESP                              1\n#define PI_CASPER                           2\n#define PI_UEFI_NTFS                        3\n#define PI_MAX                              4\n\n// The following should match VDS_FSOF_FLAGS as much as possible\n#define FP_FORCE                            0x00000001\n#define FP_QUICK                            0x00000002\n#define FP_COMPRESSION                      0x00000004\n#define FP_DUPLICATE_METADATA               0x00000008\n#define FP_LARGE_FAT32                      0x00010000\n#define FP_NO_BOOT                          0x00020000\n#define FP_CREATE_PERSISTENCE_CONF          0x00040000\n#define FP_NO_PROGRESS                      0x00080000\n\n#define FILE_FLOPPY_DISKETTE                0x00000004\n\n#define VDS_RESCAN_REFRESH                  0x00000001\n#define VDS_RESCAN_REENUMERATE              0x00000002\n\n#define VDS_SET_ERROR(hr) do { if (hr != S_OK) { SetLastError((DWORD)hr); ErrorStatus = RUFUS_ERROR(ERROR_GEN_FAILURE); } } while(0)\n\n/* We need a redef of these MS structure */\ntypedef struct {\n\tDWORD DeviceType;\n\tULONG DeviceNumber;\n\tULONG PartitionNumber;\n} STORAGE_DEVICE_NUMBER_REDEF;\n\ntypedef struct {\n\tDWORD NumberOfDiskExtents;\n\t// The one from MS uses ANYSIZE_ARRAY, which can lead to all kind of problems\n\tDISK_EXTENT Extents[8];\n} VOLUME_DISK_EXTENTS_REDEF;\n\n#if !defined(__MINGW32__)\ntypedef struct _FILE_FS_DEVICE_INFORMATION {\n\tDEVICE_TYPE DeviceType;\n\tULONG Characteristics;\n} FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION;\n#else\n/*\n * MinGW is currently missing most of the VDS COM stuff.\n * Oh, and MinGW's vds.h is screwed up unless you define the following:\n */\n#define VDS_LUN_INFORMATION void\n#define __vdslun_h__\n#include <vds.h>\ntypedef interface IVdsServiceLoader IVdsServiceLoader;\ntypedef interface IVdsService IVdsService;\ntypedef interface IVdsProvider IVdsProvider;\ntypedef interface IVdsSwProvider IVdsSwProvider;\ntypedef interface IEnumVdsObject IEnumVdsObject;\ntypedef interface IVdsPack IVdsPack;\ntypedef interface IVdsDisk IVdsDisk;\ntypedef interface IVdsAdvancedDisk IVdsAdvancedDisk;\ntypedef interface IVdsAdviseSink IVdsAdviseSink;\ntypedef interface IVdsAsync IVdsAsync;\ntypedef interface IVdsVolume IVdsVolume;\ntypedef interface IVdsVolumeMF3 IVdsVolumeMF3;\n\nextern const IID CLSID_VdsLoader;\nextern const IID IID_IVdsServiceLoader;\nextern const IID IID_IVdsProvider;\nextern const IID IID_IVdsSwProvider;\nextern const IID IID_IVdsPack;\nextern const IID IID_IVdsDisk;\nextern const IID IID_IVdsAdvancedDisk;\nextern const IID IID_IVdsVolume;\nextern const IID IID_IVdsVolumeMF3;\n\n#ifndef VDS_S_PROPERTIES_INCOMPLETE\n#define VDS_S_PROPERTIES_INCOMPLETE ((HRESULT)0x00042715L)\n#endif\n#ifndef VDS_E_OPERATION_PENDING\n#define VDS_E_OPERATION_PENDING ((HRESULT)0x80042409L)\n#endif\n\ntypedef struct IVdsServiceLoaderVtbl {\n\tHRESULT(STDMETHODCALLTYPE *QueryInterface)(__RPC__in IVdsServiceLoader *This, __RPC__in REFIID riid, _COM_Outptr_ void **ppvObject);\n\tULONG(STDMETHODCALLTYPE *AddRef)(__RPC__in IVdsServiceLoader *This);\n\tULONG(STDMETHODCALLTYPE *Release)(__RPC__in IVdsServiceLoader *This);\n\tHRESULT(STDMETHODCALLTYPE *LoadService)(__RPC__in IVdsServiceLoader *This, __RPC__in_opt_string LPWSTR pwszMachineName, __RPC__deref_out_opt IVdsService **ppService);\n} IVdsServiceLoaderVtbl;\ninterface IVdsServiceLoader {\n\tCONST_VTBL struct IVdsServiceLoaderVtbl *lpVtbl;\n};\n\ntypedef struct IVdsServiceVtbl {\n\tHRESULT(STDMETHODCALLTYPE *QueryInterface)(__RPC__in IVdsService *This, __RPC__in REFIID riid, _COM_Outptr_ void **ppvObject);\n\tULONG(STDMETHODCALLTYPE *AddRef)(__RPC__in IVdsService *This);\n\tULONG(STDMETHODCALLTYPE *Release)(__RPC__in IVdsService *This);\n\tHRESULT(STDMETHODCALLTYPE *IsServiceReady)(__RPC__in IVdsService *This);\n\tHRESULT(STDMETHODCALLTYPE *WaitForServiceReady)(__RPC__in IVdsService *This);\n\tHRESULT(STDMETHODCALLTYPE *GetProperties)(__RPC__in IVdsService *This, __RPC__out VDS_SERVICE_PROP *pServiceProp);\n\tHRESULT(STDMETHODCALLTYPE *QueryProviders)(__RPC__in IVdsService *This, DWORD masks, __RPC__deref_out_opt IEnumVdsObject **ppEnum);\n\tHRESULT(STDMETHODCALLTYPE *QueryMaskedDisks)(__RPC__in IVdsService *This, __RPC__deref_out_opt IEnumVdsObject **ppEnum);\n\tHRESULT(STDMETHODCALLTYPE *QueryUnallocatedDisks)(__RPC__in IVdsService *This, __RPC__deref_out_opt IEnumVdsObject **ppEnum);\n\tHRESULT(STDMETHODCALLTYPE *GetObject)(__RPC__in IVdsService *This, VDS_OBJECT_ID ObjectId, VDS_OBJECT_TYPE type, __RPC__deref_out_opt IUnknown **ppObjectUnk);\n\tHRESULT(STDMETHODCALLTYPE *QueryDriveLetters)(__RPC__in IVdsService *This, WCHAR wcFirstLetter, DWORD count, __RPC__out_ecount_full(count) VDS_DRIVE_LETTER_PROP *pDriveLetterPropArray);\n\tHRESULT(STDMETHODCALLTYPE *QueryFileSystemTypes)(__RPC__in IVdsService *This, __RPC__deref_out_ecount_full_opt(*plNumberOfFileSystems) VDS_FILE_SYSTEM_TYPE_PROP **ppFileSystemTypeProps, __RPC__out LONG *plNumberOfFileSystems);\n\tHRESULT(STDMETHODCALLTYPE *Reenumerate)(__RPC__in IVdsService *This);\n\tHRESULT(STDMETHODCALLTYPE *Refresh)(__RPC__in IVdsService *This);\n\tHRESULT(STDMETHODCALLTYPE *CleanupObsoleteMountPoints)(__RPC__in IVdsService *This);\n\tHRESULT(STDMETHODCALLTYPE *Advise)(__RPC__in IVdsService *This, __RPC__in_opt IVdsAdviseSink *pSink, __RPC__out DWORD *pdwCookie);\n\tHRESULT(STDMETHODCALLTYPE *Unadvise)(__RPC__in IVdsService *This, DWORD dwCookie);\n\tHRESULT(STDMETHODCALLTYPE *Reboot)(__RPC__in IVdsService *This);\n\tHRESULT(STDMETHODCALLTYPE *SetFlags)(__RPC__in IVdsService *This, ULONG ulFlags);\n\tHRESULT(STDMETHODCALLTYPE *ClearFlags)(__RPC__in IVdsService *This, ULONG ulFlags);\n} IVdsServiceVtbl;\ninterface IVdsService {\n\tCONST_VTBL struct IVdsServiceVtbl *lpVtbl;\n};\n\ntypedef struct IEnumVdsObjectVtbl {\n\tHRESULT(STDMETHODCALLTYPE *QueryInterface)(__RPC__in IEnumVdsObject *This, __RPC__in REFIID riid, _COM_Outptr_ void **ppvObject);\n\tULONG(STDMETHODCALLTYPE *AddRef)(__RPC__in IEnumVdsObject *This);\n\tULONG(STDMETHODCALLTYPE *Release)(__RPC__in IEnumVdsObject *This);\n\tHRESULT(STDMETHODCALLTYPE *Next)(__RPC__in IEnumVdsObject *This, ULONG celt, __RPC__out_ecount_part(celt, *pcFetched) IUnknown **ppObjectArray, __RPC__out ULONG *pcFetched);\n\tHRESULT(STDMETHODCALLTYPE *Skip)(__RPC__in IEnumVdsObject *This, ULONG celt);\n\tHRESULT(STDMETHODCALLTYPE *Reset)(__RPC__in IEnumVdsObject *This);\n\tHRESULT(STDMETHODCALLTYPE *Clone)(__RPC__in IEnumVdsObject *This, __RPC__deref_out_opt IEnumVdsObject **ppEnum);\n} IEnumVdsObjectVtbl;\ninterface IEnumVdsObject {\n\tCONST_VTBL struct IEnumVdsObjectVtbl *lpVtbl;\n};\n\ntypedef struct IVdsProviderVtbl {\n\tHRESULT(STDMETHODCALLTYPE *QueryInterface)(__RPC__in IVdsProvider *This, __RPC__in REFIID riid, _COM_Outptr_ void **ppvObject);\n\tULONG(STDMETHODCALLTYPE *AddRef)(__RPC__in IVdsProvider *This);\n\tULONG(STDMETHODCALLTYPE *Release)(__RPC__in IVdsProvider *This);\n\tHRESULT(STDMETHODCALLTYPE *GetProperties)(__RPC__in IVdsProvider *This, __RPC__out VDS_PROVIDER_PROP *pProviderProp);\n} IVdsProviderVtbl;\ninterface IVdsProvider {\n\tCONST_VTBL struct IVdsProviderVtbl *lpVtbl;\n};\n\ntypedef struct IVdsSwProviderVtbl {\n\tHRESULT(STDMETHODCALLTYPE *QueryInterface)(__RPC__in IVdsSwProvider *This, __RPC__in REFIID riid, _COM_Outptr_ void **ppvObject);\n\tULONG(STDMETHODCALLTYPE *AddRef)(__RPC__in IVdsSwProvider *This);\n\tULONG(STDMETHODCALLTYPE *Release)(__RPC__in IVdsSwProvider *This);\n\tHRESULT(STDMETHODCALLTYPE *QueryPacks)(__RPC__in IVdsSwProvider *This, __RPC__deref_out_opt IEnumVdsObject **ppEnum);\n\tHRESULT(STDMETHODCALLTYPE *CreatePack)(__RPC__in IVdsSwProvider *This, __RPC__deref_out_opt IVdsPack **ppPack);\n} IVdsSwProviderVtbl;\ninterface IVdsSwProvider {\n\tCONST_VTBL struct IVdsSwProviderVtbl *lpVtbl;\n};\n\ntypedef struct IVdsPackVtbl {\n\tHRESULT(STDMETHODCALLTYPE *QueryInterface)(__RPC__in IVdsPack *This, __RPC__in REFIID riid, _COM_Outptr_ void **ppvObject);\n\tULONG(STDMETHODCALLTYPE *AddRef)(__RPC__in IVdsPack *This);\n\tULONG(STDMETHODCALLTYPE *Release)(__RPC__in IVdsPack *This);\n\tHRESULT(STDMETHODCALLTYPE *GetProperties)(__RPC__in IVdsPack *This, __RPC__out VDS_PACK_PROP *pPackProp);\n\tHRESULT(STDMETHODCALLTYPE *GetProvider)(__RPC__in IVdsPack *This, __RPC__deref_out_opt IVdsProvider **ppProvider);\n\tHRESULT(STDMETHODCALLTYPE *QueryVolumes)(__RPC__in IVdsPack *This, __RPC__deref_out_opt IEnumVdsObject **ppEnum);\n\tHRESULT(STDMETHODCALLTYPE *QueryDisks)(__RPC__in IVdsPack *This, __RPC__deref_out_opt IEnumVdsObject **ppEnum);\n\tHRESULT(STDMETHODCALLTYPE *CreateVolume)(__RPC__in IVdsPack *This, VDS_VOLUME_TYPE type, __RPC__in_ecount_full(lNumberOfDisks) VDS_INPUT_DISK *pInputDiskArray, LONG lNumberOfDisks, ULONG ulStripeSize, __RPC__deref_out_opt IVdsAsync **ppAsync);\n\tHRESULT(STDMETHODCALLTYPE *AddDisk)(__RPC__in IVdsPack *This, VDS_OBJECT_ID DiskId, VDS_PARTITION_STYLE PartitionStyle, BOOL bAsHotSpare);\n\tHRESULT(STDMETHODCALLTYPE *MigrateDisks)(__RPC__in IVdsPack *This, __RPC__in_ecount_full(lNumberOfDisks) VDS_OBJECT_ID *pDiskArray, LONG lNumberOfDisks, VDS_OBJECT_ID TargetPack, BOOL bForce, BOOL bQueryOnly, __RPC__out_ecount_full(lNumberOfDisks) HRESULT *pResults, __RPC__out BOOL *pbRebootNeeded);\n\tHRESULT(STDMETHODCALLTYPE *ReplaceDisk)(__RPC__in IVdsPack *This, VDS_OBJECT_ID OldDiskId, VDS_OBJECT_ID NewDiskId, __RPC__deref_out_opt IVdsAsync **ppAsync);\n\tHRESULT(STDMETHODCALLTYPE *RemoveMissingDisk)(__RPC__in IVdsPack *This, VDS_OBJECT_ID DiskId);\n\tHRESULT(STDMETHODCALLTYPE *Recover)(__RPC__in IVdsPack *This, __RPC__deref_out_opt IVdsAsync **ppAsync);\n} IVdsPackVtbl;\ninterface IVdsPack {\n\tCONST_VTBL struct IVdsPackVtbl *lpVtbl;\n};\n\ntypedef struct IVdsDiskVtbl {\n\tHRESULT(STDMETHODCALLTYPE *QueryInterface)(__RPC__in IVdsDisk *This, __RPC__in REFIID riid, _COM_Outptr_ void **ppvObject);\n\tULONG(STDMETHODCALLTYPE *AddRef)(__RPC__in IVdsDisk *This);\n\tULONG(STDMETHODCALLTYPE *Release)(__RPC__in IVdsDisk *This);\n\tHRESULT(STDMETHODCALLTYPE *GetProperties)(__RPC__in IVdsDisk *This, __RPC__out VDS_DISK_PROP *pDiskProperties);\n\tHRESULT(STDMETHODCALLTYPE *GetPack)(__RPC__in IVdsDisk *This, __RPC__deref_out_opt IVdsPack **ppPack);\n\tHRESULT(STDMETHODCALLTYPE *GetIdentificationData)(__RPC__in IVdsDisk *This, __RPC__out VDS_LUN_INFORMATION *pLunInfo);\n\tHRESULT(STDMETHODCALLTYPE *QueryExtents)(__RPC__in IVdsDisk *This, __RPC__deref_out_ecount_full_opt(*plNumberOfExtents) VDS_DISK_EXTENT **ppExtentArray, __RPC__out LONG *plNumberOfExtents);\n\tHRESULT(STDMETHODCALLTYPE *ConvertStyle)(__RPC__in IVdsDisk *This, VDS_PARTITION_STYLE NewStyle);\n\tHRESULT(STDMETHODCALLTYPE *SetFlags)(__RPC__in IVdsDisk *This, ULONG ulFlags);\n\tHRESULT(STDMETHODCALLTYPE *ClearFlags)(__RPC__in IVdsDisk *This, ULONG ulFlags);\n} IVdsDiskVtbl;\ninterface IVdsDisk {\n\tCONST_VTBL struct IVdsDiskVtbl *lpVtbl;\n};\n\ntypedef struct IVdsAdvancedDiskVtbl {\n\tHRESULT(STDMETHODCALLTYPE *QueryInterface)(__RPC__in IVdsAdvancedDisk *This, __RPC__in REFIID riid, _COM_Outptr_ void **ppvObject);\n\tULONG(STDMETHODCALLTYPE *AddRef)(__RPC__in IVdsAdvancedDisk *This);\n\tULONG(STDMETHODCALLTYPE *Release)(__RPC__in IVdsAdvancedDisk *This);\n\tHRESULT(STDMETHODCALLTYPE *GetPartitionProperties)(__RPC__in IVdsAdvancedDisk *This, ULONGLONG ullOffset, __RPC__out VDS_PARTITION_PROP *pPartitionProp);\n\tHRESULT(STDMETHODCALLTYPE *QueryPartitions)(__RPC__in IVdsAdvancedDisk *This, __RPC__deref_out_ecount_full_opt(*plNumberOfPartitions) VDS_PARTITION_PROP **ppPartitionPropArray, __RPC__out LONG *plNumberOfPartitions);\n\tHRESULT(STDMETHODCALLTYPE *CreatePartition)(__RPC__in IVdsAdvancedDisk *This, ULONGLONG ullOffset, ULONGLONG ullSize, __RPC__in CREATE_PARTITION_PARAMETERS *para, __RPC__deref_out_opt IVdsAsync **ppAsync);\n\tHRESULT(STDMETHODCALLTYPE *DeletePartition)(__RPC__in IVdsAdvancedDisk *This, ULONGLONG ullOffset, BOOL bForce, BOOL bForceProtected);\n\tHRESULT(STDMETHODCALLTYPE *ChangeAttributes)(__RPC__in IVdsAdvancedDisk *This, ULONGLONG ullOffset, __RPC__in CHANGE_ATTRIBUTES_PARAMETERS *para);\n\tHRESULT(STDMETHODCALLTYPE *AssignDriveLetter)(__RPC__in IVdsAdvancedDisk *This, ULONGLONG ullOffset, WCHAR wcLetter);\n\tHRESULT(STDMETHODCALLTYPE *DeleteDriveLetter)(__RPC__in IVdsAdvancedDisk *This, ULONGLONG ullOffset, WCHAR wcLetter);\n\tHRESULT(STDMETHODCALLTYPE *GetDriveLetter)(__RPC__in IVdsAdvancedDisk *This, ULONGLONG ullOffset, __RPC__out WCHAR *pwcLetter);\n\tHRESULT(STDMETHODCALLTYPE *FormatPartition)(__RPC__in IVdsAdvancedDisk *This, ULONGLONG ullOffset, VDS_FILE_SYSTEM_TYPE type, __RPC__in_string LPWSTR pwszLabel, DWORD dwUnitAllocationSize, BOOL bForce, BOOL bQuickFormat, BOOL bEnableCompression, __RPC__deref_out_opt IVdsAsync **ppAsync);\n\tHRESULT(STDMETHODCALLTYPE *Clean)(__RPC__in IVdsAdvancedDisk *This, BOOL bForce, BOOL bForceOEM, BOOL bFullClean, __RPC__deref_out_opt IVdsAsync **ppAsync);\n} IVdsAdvancedDiskVtbl;\ninterface IVdsAdvancedDisk {\n\tCONST_VTBL struct IVdsAdvancedDiskVtbl *lpVtbl;\n};\n\ntypedef struct IVdsVolumeVtbl {\n\tHRESULT (STDMETHODCALLTYPE *QueryInterface)(__RPC__in IVdsVolume *This, __RPC__in REFIID riid, _COM_Outptr_  void **ppvObject);\n\tULONG (STDMETHODCALLTYPE *AddRef)(__RPC__in IVdsVolume *This);\n\tULONG (STDMETHODCALLTYPE *Release)(__RPC__in IVdsVolume *This);\n\tHRESULT (STDMETHODCALLTYPE *GetProperties)(__RPC__in IVdsVolume *This, __RPC__out VDS_VOLUME_PROP *pVolumeProperties);\n\tHRESULT (STDMETHODCALLTYPE *GetPack)(__RPC__in IVdsVolume *This, __RPC__deref_out_opt IVdsPack **ppPack);\n\tHRESULT (STDMETHODCALLTYPE *QueryPlexes)(__RPC__in IVdsVolume *This, __RPC__deref_out_opt IEnumVdsObject **ppEnum);\n\tHRESULT (STDMETHODCALLTYPE *Extend)(__RPC__in IVdsVolume *This, __RPC__in_ecount_full_opt(lNumberOfDisks) VDS_INPUT_DISK *pInputDiskArray, LONG lNumberOfDisks, __RPC__deref_out_opt IVdsAsync **ppAsync);\n\tHRESULT (STDMETHODCALLTYPE *Shrink)(__RPC__in IVdsVolume *This, ULONGLONG ullNumberOfBytesToRemove, __RPC__deref_out_opt IVdsAsync **ppAsync);\n\tHRESULT (STDMETHODCALLTYPE *AddPlex)(__RPC__in IVdsVolume *This, VDS_OBJECT_ID VolumeId,__RPC__deref_out_opt IVdsAsync **ppAsync);\n\tHRESULT (STDMETHODCALLTYPE *BreakPlex)(__RPC__in IVdsVolume *This, VDS_OBJECT_ID plexId, __RPC__deref_out_opt IVdsAsync **ppAsync);\n\tHRESULT (STDMETHODCALLTYPE *RemovePlex)(__RPC__in IVdsVolume *This, VDS_OBJECT_ID plexId, __RPC__deref_out_opt IVdsAsync **ppAsync);\n\tHRESULT (STDMETHODCALLTYPE *Delete)(__RPC__in IVdsVolume *This, BOOL bForce);\n\tHRESULT (STDMETHODCALLTYPE *SetFlags)(__RPC__in IVdsVolume *This, ULONG ulFlags, BOOL bRevertOnClose);\n\tHRESULT (STDMETHODCALLTYPE *ClearFlags)(__RPC__in IVdsVolume *This, ULONG ulFlags);\n} IVdsVolumeVtbl;\ninterface IVdsVolume {\n\tCONST_VTBL struct IVdsVolumeVtbl *lpVtbl;\n};\n\ntypedef struct IVdsVolumeMF3Vtbl {\n\tHRESULT (STDMETHODCALLTYPE *QueryInterface)(__RPC__in IVdsVolumeMF3 *This, __RPC__in REFIID riid, _COM_Outptr_ void **ppvObject);\n\tULONG (STDMETHODCALLTYPE *AddRef)(__RPC__in IVdsVolumeMF3 *This);\n\tULONG (STDMETHODCALLTYPE *Release)(__RPC__in IVdsVolumeMF3 *This);\n\tHRESULT (STDMETHODCALLTYPE *QueryVolumeGuidPathnames)(__RPC__in IVdsVolumeMF3 *This, __RPC__deref_out_ecount_full_opt_string(*pulNumberOfPaths) LPWSTR **pwszPathArray, __RPC__out ULONG *pulNumberOfPaths);\n\tHRESULT (STDMETHODCALLTYPE *FormatEx2)(__RPC__in IVdsVolumeMF3 *This, __RPC__in_opt_string LPWSTR pwszFileSystemTypeName, USHORT usFileSystemRevision, ULONG ulDesiredUnitAllocationSize, __RPC__in_opt_string LPWSTR pwszLabel, DWORD Options, __RPC__deref_out_opt IVdsAsync **ppAsync);\n\tHRESULT (STDMETHODCALLTYPE *OfflineVolume)(__RPC__in IVdsVolumeMF3 *This);\n} IVdsVolumeMF3Vtbl;\ninterface IVdsVolumeMF3 {\n\tCONST_VTBL struct IVdsVolumeMF3Vtbl *lpVtbl;\n};\n\ntypedef struct IVdsAsyncVtbl {\n\tHRESULT (STDMETHODCALLTYPE *QueryInterface)(__RPC__in IVdsAsync *This, __RPC__in REFIID riid, _COM_Outptr_ void **ppvObject);\n\tULONG (STDMETHODCALLTYPE *AddRef)(__RPC__in IVdsAsync *This);\n\tULONG (STDMETHODCALLTYPE *Release)(__RPC__in IVdsAsync *This);\n\tHRESULT (STDMETHODCALLTYPE *Cancel)(__RPC__in IVdsAsync *This);\n\tHRESULT (STDMETHODCALLTYPE *Wait)(__RPC__in IVdsAsync *This, __RPC__out HRESULT *pHrResult, __RPC__out VDS_ASYNC_OUTPUT *pAsyncOut);\n\tHRESULT (STDMETHODCALLTYPE *QueryStatus)(__RPC__in IVdsAsync *This, __RPC__out HRESULT *pHrResult, __RPC__out ULONG *pulPercentCompleted);\n} IVdsAsyncVtbl;\ninterface IVdsAsync {\n\tCONST_VTBL struct IVdsAsyncVtbl *lpVtbl;\n};\n\n#define IVdsServiceLoader_LoadService(This, pwszMachineName, ppService) (This)->lpVtbl->LoadService(This, pwszMachineName, ppService)\n#define IVdsServiceLoader_Release(This) (This)->lpVtbl->Release(This)\n#define IVdsService_QueryProviders(This, masks, ppEnum) (This)->lpVtbl->QueryProviders(This, masks, ppEnum)\n#define IVdsService_WaitForServiceReady(This) ((This)->lpVtbl->WaitForServiceReady(This))\n#define IVdsService_CleanupObsoleteMountPoints(This) ((This)->lpVtbl->CleanupObsoleteMountPoints(This))\n#define IVdsService_Refresh(This) ((This)->lpVtbl->Refresh(This))\n#define IVdsService_Reenumerate(This) ((This)->lpVtbl->Reenumerate(This))\n#define IVdsService_Release(This) (This)->lpVtbl->Release(This)\n#define IVdsSwProvider_QueryInterface(This, riid, ppvObject) (This)->lpVtbl->QueryInterface(This, riid, ppvObject)\n#define IVdsProvider_Release(This) (This)->lpVtbl->Release(This)\n#define IVdsSwProvider_QueryPacks(This, ppEnum) (This)->lpVtbl->QueryPacks(This, ppEnum)\n#define IVdsSwProvider_Release(This) (This)->lpVtbl->Release(This)\n#define IVdsPack_QueryDisks(This, ppEnum) (This)->lpVtbl->QueryDisks(This, ppEnum)\n#define IVdsPack_Release(This) (This)->lpVtbl->Release(This)\n#define IVdsDisk_GetProperties(This, pDiskProperties) (This)->lpVtbl->GetProperties(This, pDiskProperties)\n#define IVdsDisk_Release(This) (This)->lpVtbl->Release(This)\n#define IVdsDisk_QueryInterface(This, riid, ppvObject) (This)->lpVtbl->QueryInterface(This, riid, ppvObject)\n#define IVdsAdvancedDisk_QueryPartitions(This, ppPartitionPropArray, plNumberOfPartitions) (This)->lpVtbl->QueryPartitions(This, ppPartitionPropArray, plNumberOfPartitions)\n#define IVdsAdvancedDisk_DeletePartition(This, ullOffset, bForce, bForceProtected) (This)->lpVtbl->DeletePartition(This, ullOffset, bForce, bForceProtected)\n#define IVdsAdvancedDisk_Clean(This, bForce, bForceOEM, bFullClean, ppAsync) (This)->lpVtbl->Clean(This, bForce, bForceOEM, bFullClean, ppAsync)\n#define IVdsAdvancedDisk_Release(This) (This)->lpVtbl->Release(This)\n#define IEnumVdsObject_Next(This, celt, ppObjectArray, pcFetched) (This)->lpVtbl->Next(This, celt, ppObjectArray, pcFetched)\n#define IEnumVdsObject_Release(This) (This)->lpVtbl->Release(This)\n#define IVdsPack_QueryVolumes(This, ppEnum) (This)->lpVtbl->QueryVolumes(This, ppEnum)\n#define IVdsVolume_QueryInterface(This, riid, ppvObject) (This)->lpVtbl->QueryInterface(This, riid, ppvObject)\n#define IVdsVolume_Release(This) (This)->lpVtbl->Release(This)\n#define IVdsVolumeMF3_QueryVolumeGuidPathnames(This, pwszPathArray, pulNumberOfPaths) (This)->lpVtbl->QueryVolumeGuidPathnames(This,pwszPathArray,pulNumberOfPaths)\n#define IVdsVolumeMF3_FormatEx2(This, pwszFileSystemTypeName, usFileSystemRevision, ulDesiredUnitAllocationSize, pwszLabel, Options, ppAsync) (This)->lpVtbl->FormatEx2(This, pwszFileSystemTypeName, usFileSystemRevision, ulDesiredUnitAllocationSize, pwszLabel, Options, ppAsync)\n#define IVdsVolumeMF3_Release(This) (This)->lpVtbl->Release(This)\n#define IVdsVolume_GetProperties(This, pVolumeProperties) (This)->lpVtbl->GetProperties(This,pVolumeProperties)\n#define IVdsAsync_Cancel(This) (This)->lpVtbl->Cancel(This)\n#define IVdsAsync_QueryStatus(This,pHrResult,pulPercentCompleted) (This)->lpVtbl->QueryStatus(This,pHrResult,pulPercentCompleted)\n#define IVdsAsync_Wait(This,pHrResult,pAsyncOut) (This)->lpVtbl->Wait(This,pHrResult,pAsyncOut)\n#define IVdsAsync_Release(This) (This)->lpVtbl->Release(This)\n#endif\n\n/* MinGW is unhappy about accessing partitions beside the first unless we redef */\ntypedef struct _DRIVE_LAYOUT_INFORMATION_EX4 {\n\tDWORD PartitionStyle;\n\tDWORD PartitionCount;\n\tunion {\n\t\tDRIVE_LAYOUT_INFORMATION_MBR Mbr;\n\t\tDRIVE_LAYOUT_INFORMATION_GPT Gpt;\n\t} Type;\n\tPARTITION_INFORMATION_EX PartitionEntry[MAX_PARTITIONS];\n} DRIVE_LAYOUT_INFORMATION_EX4, *PDRIVE_LAYOUT_INFORMATION_EX4;\n\nstatic __inline BOOL UnlockDrive(HANDLE hDrive) {\n\treturn DeviceIoControl(hDrive, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL, 0, NULL, NULL);\n}\n#define safe_unlockclose(h) do {if ((h != INVALID_HANDLE_VALUE) && (h != NULL)) {UnlockDrive(h); CloseHandle(h); h = INVALID_HANDLE_VALUE;}} while(0)\n\n/* Current drive info */\ntypedef struct {\n\tLONGLONG DiskSize;\n\tDWORD DeviceNumber;\n\tDWORD SectorsPerTrack;\n\tDWORD SectorSize;\n\tDWORD FirstDataSector;\n\tMEDIA_TYPE MediaType;\n\tint PartitionStyle;\n\tint nPartitions;\t// number of partitions we actually care about\n\tstruct {\n\t\twchar_t Name[36];\n\t\tuint64_t Offset;\n\t\tuint64_t Size;\n\t} Partition[MAX_PARTITIONS];\n\tint FSType;\n\tchar proposed_label[16];\n\tBOOL has_protective_mbr;\n\tBOOL has_mbr_uefi_marker;\n\tstruct {\n\t\tULONG Allowed;\n\t\tULONG Default;\n\t} ClusterSize[FS_MAX];\n} RUFUS_DRIVE_INFO;\nextern RUFUS_DRIVE_INFO SelectedDrive;\nextern int partition_index[PI_MAX];\n\nBOOL SetAutoMount(BOOL enable);\nBOOL GetAutoMount(BOOL* enabled);\nchar* GetPhysicalName(DWORD DriveIndex);\nBOOL DeletePartition(DWORD DriveIndex, ULONGLONG PartitionOffset, BOOL bSilent);\nBOOL IsVdsAvailable(BOOL bSilent);\nBOOL ListVdsVolumes(BOOL bSilent);\nBOOL VdsRescan(DWORD dwRescanType, DWORD dwSleepTime, BOOL bSilent);\nHANDLE GetPhysicalHandle(DWORD DriveIndex, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWriteShare);\nchar* GetLogicalName(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bKeepTrailingBackslash, BOOL bSilent);\nchar* AltGetLogicalName(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bKeepTrailingBackslash, BOOL bSilent);\nchar* GetExtPartitionName(DWORD DriveIndex, uint64_t PartitionOffset);\nBOOL WaitForLogical(DWORD DriveIndex, uint64_t PartitionOffset);\nHANDLE GetLogicalHandle(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWriteShare);\nHANDLE AltGetLogicalHandle(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWriteShare);\nint GetDriveNumber(HANDLE hDrive, char* path);\nBOOL GetDriveLetters(DWORD DriveIndex, char* drive_letters);\nUINT GetDriveTypeFromIndex(DWORD DriveIndex);\nchar GetUnusedDriveLetter(void);\nBOOL IsDriveLetterInUse(const char drive_letter);\nBOOL IsSourceImageLocatedOnTargetDrive(DWORD DriveIndex);\nchar RemoveDriveLetters(DWORD DriveIndex, BOOL bUseLast, BOOL bSilent);\nBOOL GetDriveLabel(DWORD DriveIndex, char* letters, char** label, BOOL bSilent);\nuint64_t GetDriveSize(DWORD DriveIndex);\nBOOL IsMediaPresent(DWORD DriveIndex);\nBOOL AnalyzeMBR(HANDLE hPhysicalDrive, const char* TargetName, BOOL bSilent);\nBOOL AnalyzePBR(HANDLE hLogicalVolume);\nBOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSystemNameSize, BOOL bSilent);\nBOOL UnmountVolume(HANDLE hDrive);\nBOOL MountVolume(char* drive_name, char *drive_guid);\nBOOL AltUnmountVolume(const char* drive_name, BOOL bSilent);\nchar* AltMountVolume(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bSilent);\nBOOL RemountVolume(char* drive_name, BOOL bSilent);\nBOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL mbr_uefi_marker, uint8_t extra_partitions);\nBOOL InitializeDisk(HANDLE hDrive);\nBOOL RefreshDriveLayout(HANDLE hDrive);\nconst char* GetMBRPartitionType(const uint8_t type);\nconst char* GetGPTPartitionType(const GUID* guid);\nconst char* GetExtFsLabel(DWORD DriveIndex, uint64_t PartitionOffset);\nvoid ClearDrives(void);\nBOOL GetDevices(DWORD devnum);\nBOOL CyclePort(int index);\nint CycleDevice(int index);\nBOOL RefreshLayout(DWORD DriveIndex);\nBOOL GetOpticalMedia(IMG_SAVE* img_save);\nuint64_t GetEspOffset(DWORD DriveIndex);\nBOOL ToggleEsp(DWORD DriveIndex, uint64_t PartitionOffset);\nBOOL IsMsDevDrive(DWORD DriveIndex);\nBOOL IsFilteredDrive(DWORD DriveIndex);\n"
  },
  {
    "path": "src/efi.h",
    "content": "/*\n* Rufus: The Reliable USB Formatting Utility\n* UEFI constants and structs\n* Copyright © 2025 Pete Batard <pete@akeo.ie>\n*\n* This program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU General Public License as published by\n* the Free Software Foundation, either version 3 of the License, or\n* (at your option) any later version.\n*\n* This program is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n* GNU General Public License for more details.\n*\n* You should have received a copy of the GNU General Public License\n* along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n#include <basetsd.h>\n#include <guiddef.h>\n\n#pragma pack(1)\n\ntypedef struct {\n\tUINT16  Year;\n\tUINT8   Month;\n\tUINT8   Day;\n\tUINT8   Hour;\n\tUINT8   Minute;\n\tUINT8   Second;\n\tUINT8   Pad1;\n\tUINT32  Nanosecond;\n\tINT16   TimeZone;\n\tUINT8   Daylight;\n\tUINT8   Pad2;\n} EFI_TIME;\n\ntypedef struct _WIN_CERTIFICATE {\n\tUINT32  dwLength;\n\tUINT16  wRevision;\n\tUINT16  wCertificateType;\n} WIN_CERTIFICATE;\n\ntypedef struct _WIN_CERTIFICATE_UEFI_GUID {\n\tWIN_CERTIFICATE   Hdr;\n\tGUID              CertType;\n\tUINT8             CertData[1];\n} WIN_CERTIFICATE_UEFI_GUID;\n\ntypedef struct {\n\tEFI_TIME                     TimeStamp;\n\tWIN_CERTIFICATE_UEFI_GUID    AuthInfo;\n} EFI_VARIABLE_AUTHENTICATION_2;\n\ntypedef struct {\n\tGUID        SignatureOwner;\n\tUINT8       SignatureData[1];\n} EFI_SIGNATURE_DATA;\n\ntypedef struct {\n\tGUID        SignatureType;\n\tUINT32      SignatureListSize;\n\tUINT32      SignatureHeaderSize;\n\tUINT32      SignatureSize;\n} EFI_SIGNATURE_LIST;\n\n#pragma pack()\n\nconst GUID EFI_CERT_SHA256_GUID = { 0xc1c41626, 0x504c, 0x4092, { 0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28 } };\n"
  },
  {
    "path": "src/ext2fs/.editorconfig",
    "content": "[*]\nindent_style = tab\ntab_width = 8\n"
  },
  {
    "path": "src/ext2fs/LICENSE.txt",
    "content": "\t\t  GNU LIBRARY GENERAL PUBLIC LICENSE\r\n\t\t       Version 2, June 1991\r\n\r\n Copyright (C) 1991 Free Software Foundation, Inc.\r\n    \t\t    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA\r\n Everyone is permitted to copy and distribute verbatim copies\r\n of this license document, but changing it is not allowed.\r\n\r\n[This is the first released version of the library GPL.  It is\r\n numbered 2 because it goes with version 2 of the ordinary GPL.]\r\n\r\n\t\t\t    Preamble\r\n\r\n  The licenses for most software are designed to take away your\r\nfreedom to share and change it.  By contrast, the GNU General Public\r\nLicenses are intended to guarantee your freedom to share and change\r\nfree software--to make sure the software is free for all its users.\r\n\r\n  This license, the Library General Public License, applies to some\r\nspecially designated Free Software Foundation software, and to any\r\nother libraries whose authors decide to use it.  You can use it for\r\nyour libraries, too.\r\n\r\n  When we speak of free software, we are referring to freedom, not\r\nprice.  Our General Public Licenses are designed to make sure that you\r\nhave the freedom to distribute copies of free software (and charge for\r\nthis service if you wish), that you receive source code or can get it\r\nif you want it, that you can change the software or use pieces of it\r\nin new free programs; and that you know you can do these things.\r\n\r\n  To protect your rights, we need to make restrictions that forbid\r\nanyone to deny you these rights or to ask you to surrender the rights.\r\nThese restrictions translate to certain responsibilities for you if\r\nyou distribute copies of the library, or if you modify it.\r\n\r\n  For example, if you distribute copies of the library, whether gratis\r\nor for a fee, you must give the recipients all the rights that we gave\r\nyou.  You must make sure that they, too, receive or can get the source\r\ncode.  If you link a program with the library, you must provide\r\ncomplete object files to the recipients so that they can relink them\r\nwith the library, after making changes to the library and recompiling\r\nit.  And you must show them these terms so they know their rights.\r\n\r\n  Our method of protecting your rights has two steps: (1) copyright\r\nthe library, and (2) offer you this license which gives you legal\r\npermission to copy, distribute and/or modify the library.\r\n\r\n  Also, for each distributor's protection, we want to make certain\r\nthat everyone understands that there is no warranty for this free\r\nlibrary.  If the library is modified by someone else and passed on, we\r\nwant its recipients to know that what they have is not the original\r\nversion, so that any problems introduced by others will not reflect on\r\nthe original authors' reputations.\r\n\f\r\n  Finally, any free program is threatened constantly by software\r\npatents.  We wish to avoid the danger that companies distributing free\r\nsoftware will individually obtain patent licenses, thus in effect\r\ntransforming the program into proprietary software.  To prevent this,\r\nwe have made it clear that any patent must be licensed for everyone's\r\nfree use or not licensed at all.\r\n\r\n  Most GNU software, including some libraries, is covered by the ordinary\r\nGNU General Public License, which was designed for utility programs.  This\r\nlicense, the GNU Library General Public License, applies to certain\r\ndesignated libraries.  This license is quite different from the ordinary\r\none; be sure to read it in full, and don't assume that anything in it is\r\nthe same as in the ordinary license.\r\n\r\n  The reason we have a separate public license for some libraries is that\r\nthey blur the distinction we usually make between modifying or adding to a\r\nprogram and simply using it.  Linking a program with a library, without\r\nchanging the library, is in some sense simply using the library, and is\r\nanalogous to running a utility program or application program.  However, in\r\na textual and legal sense, the linked executable is a combined work, a\r\nderivative of the original library, and the ordinary General Public License\r\ntreats it as such.\r\n\r\n  Because of this blurred distinction, using the ordinary General\r\nPublic License for libraries did not effectively promote software\r\nsharing, because most developers did not use the libraries.  We\r\nconcluded that weaker conditions might promote sharing better.\r\n\r\n  However, unrestricted linking of non-free programs would deprive the\r\nusers of those programs of all benefit from the free status of the\r\nlibraries themselves.  This Library General Public License is intended to\r\npermit developers of non-free programs to use free libraries, while\r\npreserving your freedom as a user of such programs to change the free\r\nlibraries that are incorporated in them.  (We have not seen how to achieve\r\nthis as regards changes in header files, but we have achieved it as regards\r\nchanges in the actual functions of the Library.)  The hope is that this\r\nwill lead to faster development of free libraries.\r\n\r\n  The precise terms and conditions for copying, distribution and\r\nmodification follow.  Pay close attention to the difference between a\r\n\"work based on the library\" and a \"work that uses the library\".  The\r\nformer contains code derived from the library, while the latter only\r\nworks together with the library.\r\n\r\n  Note that it is possible for a library to be covered by the ordinary\r\nGeneral Public License rather than by this special one.\r\n\f\r\n\t\t  GNU LIBRARY GENERAL PUBLIC LICENSE\r\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r\n\r\n  0. This License Agreement applies to any software library which\r\ncontains a notice placed by the copyright holder or other authorized\r\nparty saying it may be distributed under the terms of this Library\r\nGeneral Public License (also called \"this License\").  Each licensee is\r\naddressed as \"you\".\r\n\r\n  A \"library\" means a collection of software functions and/or data\r\nprepared so as to be conveniently linked with application programs\r\n(which use some of those functions and data) to form executables.\r\n\r\n  The \"Library\", below, refers to any such software library or work\r\nwhich has been distributed under these terms.  A \"work based on the\r\nLibrary\" means either the Library or any derivative work under\r\ncopyright law: that is to say, a work containing the Library or a\r\nportion of it, either verbatim or with modifications and/or translated\r\nstraightforwardly into another language.  (Hereinafter, translation is\r\nincluded without limitation in the term \"modification\".)\r\n\r\n  \"Source code\" for a work means the preferred form of the work for\r\nmaking modifications to it.  For a library, complete source code means\r\nall the source code for all modules it contains, plus any associated\r\ninterface definition files, plus the scripts used to control compilation\r\nand installation of the library.\r\n\r\n  Activities other than copying, distribution and modification are not\r\ncovered by this License; they are outside its scope.  The act of\r\nrunning a program using the Library is not restricted, and output from\r\nsuch a program is covered only if its contents constitute a work based\r\non the Library (independent of the use of the Library in a tool for\r\nwriting it).  Whether that is true depends on what the Library does\r\nand what the program that uses the Library does.\r\n\r\n  1. You may copy and distribute verbatim copies of the Library's\r\ncomplete source code as you receive it, in any medium, provided that\r\nyou conspicuously and appropriately publish on each copy an\r\nappropriate copyright notice and disclaimer of warranty; keep intact\r\nall the notices that refer to this License and to the absence of any\r\nwarranty; and distribute a copy of this License along with the\r\nLibrary.\r\n\r\n  You may charge a fee for the physical act of transferring a copy,\r\nand you may at your option offer warranty protection in exchange for a\r\nfee.\r\n\f\r\n  2. You may modify your copy or copies of the Library or any portion\r\nof it, thus forming a work based on the Library, and copy and\r\ndistribute such modifications or work under the terms of Section 1\r\nabove, provided that you also meet all of these conditions:\r\n\r\n    a) The modified work must itself be a software library.\r\n\r\n    b) You must cause the files modified to carry prominent notices\r\n    stating that you changed the files and the date of any change.\r\n\r\n    c) You must cause the whole of the work to be licensed at no\r\n    charge to all third parties under the terms of this License.\r\n\r\n    d) If a facility in the modified Library refers to a function or a\r\n    table of data to be supplied by an application program that uses\r\n    the facility, other than as an argument passed when the facility\r\n    is invoked, then you must make a good faith effort to ensure that,\r\n    in the event an application does not supply such function or\r\n    table, the facility still operates, and performs whatever part of\r\n    its purpose remains meaningful.\r\n\r\n    (For example, a function in a library to compute square roots has\r\n    a purpose that is entirely well-defined independent of the\r\n    application.  Therefore, Subsection 2d requires that any\r\n    application-supplied function or table used by this function must\r\n    be optional: if the application does not supply it, the square\r\n    root function must still compute square roots.)\r\n\r\nThese requirements apply to the modified work as a whole.  If\r\nidentifiable sections of that work are not derived from the Library,\r\nand can be reasonably considered independent and separate works in\r\nthemselves, then this License, and its terms, do not apply to those\r\nsections when you distribute them as separate works.  But when you\r\ndistribute the same sections as part of a whole which is a work based\r\non the Library, the distribution of the whole must be on the terms of\r\nthis License, whose permissions for other licensees extend to the\r\nentire whole, and thus to each and every part regardless of who wrote\r\nit.\r\n\r\nThus, it is not the intent of this section to claim rights or contest\r\nyour rights to work written entirely by you; rather, the intent is to\r\nexercise the right to control the distribution of derivative or\r\ncollective works based on the Library.\r\n\r\nIn addition, mere aggregation of another work not based on the Library\r\nwith the Library (or with a work based on the Library) on a volume of\r\na storage or distribution medium does not bring the other work under\r\nthe scope of this License.\r\n\r\n  3. You may opt to apply the terms of the ordinary GNU General Public\r\nLicense instead of this License to a given copy of the Library.  To do\r\nthis, you must alter all the notices that refer to this License, so\r\nthat they refer to the ordinary GNU General Public License, version 2,\r\ninstead of to this License.  (If a newer version than version 2 of the\r\nordinary GNU General Public License has appeared, then you can specify\r\nthat version instead if you wish.)  Do not make any other change in\r\nthese notices.\r\n\f\r\n  Once this change is made in a given copy, it is irreversible for\r\nthat copy, so the ordinary GNU General Public License applies to all\r\nsubsequent copies and derivative works made from that copy.\r\n\r\n  This option is useful when you wish to copy part of the code of\r\nthe Library into a program that is not a library.\r\n\r\n  4. You may copy and distribute the Library (or a portion or\r\nderivative of it, under Section 2) in object code or executable form\r\nunder the terms of Sections 1 and 2 above provided that you accompany\r\nit with the complete corresponding machine-readable source code, which\r\nmust be distributed under the terms of Sections 1 and 2 above on a\r\nmedium customarily used for software interchange.\r\n\r\n  If distribution of object code is made by offering access to copy\r\nfrom a designated place, then offering equivalent access to copy the\r\nsource code from the same place satisfies the requirement to\r\ndistribute the source code, even though third parties are not\r\ncompelled to copy the source along with the object code.\r\n\r\n  5. A program that contains no derivative of any portion of the\r\nLibrary, but is designed to work with the Library by being compiled or\r\nlinked with it, is called a \"work that uses the Library\".  Such a\r\nwork, in isolation, is not a derivative work of the Library, and\r\ntherefore falls outside the scope of this License.\r\n\r\n  However, linking a \"work that uses the Library\" with the Library\r\ncreates an executable that is a derivative of the Library (because it\r\ncontains portions of the Library), rather than a \"work that uses the\r\nlibrary\".  The executable is therefore covered by this License.\r\nSection 6 states terms for distribution of such executables.\r\n\r\n  When a \"work that uses the Library\" uses material from a header file\r\nthat is part of the Library, the object code for the work may be a\r\nderivative work of the Library even though the source code is not.\r\nWhether this is true is especially significant if the work can be\r\nlinked without the Library, or if the work is itself a library.  The\r\nthreshold for this to be true is not precisely defined by law.\r\n\r\n  If such an object file uses only numerical parameters, data\r\nstructure layouts and accessors, and small macros and small inline\r\nfunctions (ten lines or less in length), then the use of the object\r\nfile is unrestricted, regardless of whether it is legally a derivative\r\nwork.  (Executables containing this object code plus portions of the\r\nLibrary will still fall under Section 6.)\r\n\r\n  Otherwise, if the work is a derivative of the Library, you may\r\ndistribute the object code for the work under the terms of Section 6.\r\nAny executables containing that work also fall under Section 6,\r\nwhether or not they are linked directly with the Library itself.\r\n\f\r\n  6. As an exception to the Sections above, you may also compile or\r\nlink a \"work that uses the Library\" with the Library to produce a\r\nwork containing portions of the Library, and distribute that work\r\nunder terms of your choice, provided that the terms permit\r\nmodification of the work for the customer's own use and reverse\r\nengineering for debugging such modifications.\r\n\r\n  You must give prominent notice with each copy of the work that the\r\nLibrary is used in it and that the Library and its use are covered by\r\nthis License.  You must supply a copy of this License.  If the work\r\nduring execution displays copyright notices, you must include the\r\ncopyright notice for the Library among them, as well as a reference\r\ndirecting the user to the copy of this License.  Also, you must do one\r\nof these things:\r\n\r\n    a) Accompany the work with the complete corresponding\r\n    machine-readable source code for the Library including whatever\r\n    changes were used in the work (which must be distributed under\r\n    Sections 1 and 2 above); and, if the work is an executable linked\r\n    with the Library, with the complete machine-readable \"work that\r\n    uses the Library\", as object code and/or source code, so that the\r\n    user can modify the Library and then relink to produce a modified\r\n    executable containing the modified Library.  (It is understood\r\n    that the user who changes the contents of definitions files in the\r\n    Library will not necessarily be able to recompile the application\r\n    to use the modified definitions.)\r\n\r\n    b) Accompany the work with a written offer, valid for at\r\n    least three years, to give the same user the materials\r\n    specified in Subsection 6a, above, for a charge no more\r\n    than the cost of performing this distribution.\r\n\r\n    c) If distribution of the work is made by offering access to copy\r\n    from a designated place, offer equivalent access to copy the above\r\n    specified materials from the same place.\r\n\r\n    d) Verify that the user has already received a copy of these\r\n    materials or that you have already sent this user a copy.\r\n\r\n  For an executable, the required form of the \"work that uses the\r\nLibrary\" must include any data and utility programs needed for\r\nreproducing the executable from it.  However, as a special exception,\r\nthe source code distributed need not include anything that is normally\r\ndistributed (in either source or binary form) with the major\r\ncomponents (compiler, kernel, and so on) of the operating system on\r\nwhich the executable runs, unless that component itself accompanies\r\nthe executable.\r\n\r\n  It may happen that this requirement contradicts the license\r\nrestrictions of other proprietary libraries that do not normally\r\naccompany the operating system.  Such a contradiction means you cannot\r\nuse both them and the Library together in an executable that you\r\ndistribute.\r\n\f\r\n  7. You may place library facilities that are a work based on the\r\nLibrary side-by-side in a single library together with other library\r\nfacilities not covered by this License, and distribute such a combined\r\nlibrary, provided that the separate distribution of the work based on\r\nthe Library and of the other library facilities is otherwise\r\npermitted, and provided that you do these two things:\r\n\r\n    a) Accompany the combined library with a copy of the same work\r\n    based on the Library, uncombined with any other library\r\n    facilities.  This must be distributed under the terms of the\r\n    Sections above.\r\n\r\n    b) Give prominent notice with the combined library of the fact\r\n    that part of it is a work based on the Library, and explaining\r\n    where to find the accompanying uncombined form of the same work.\r\n\r\n  8. You may not copy, modify, sublicense, link with, or distribute\r\nthe Library except as expressly provided under this License.  Any\r\nattempt otherwise to copy, modify, sublicense, link with, or\r\ndistribute the Library is void, and will automatically terminate your\r\nrights under this License.  However, parties who have received copies,\r\nor rights, from you under this License will not have their licenses\r\nterminated so long as such parties remain in full compliance.\r\n\r\n  9. You are not required to accept this License, since you have not\r\nsigned it.  However, nothing else grants you permission to modify or\r\ndistribute the Library or its derivative works.  These actions are\r\nprohibited by law if you do not accept this License.  Therefore, by\r\nmodifying or distributing the Library (or any work based on the\r\nLibrary), you indicate your acceptance of this License to do so, and\r\nall its terms and conditions for copying, distributing or modifying\r\nthe Library or works based on it.\r\n\r\n  10. Each time you redistribute the Library (or any work based on the\r\nLibrary), the recipient automatically receives a license from the\r\noriginal licensor to copy, distribute, link with or modify the Library\r\nsubject to these terms and conditions.  You may not impose any further\r\nrestrictions on the recipients' exercise of the rights granted herein.\r\nYou are not responsible for enforcing compliance by third parties to\r\nthis License.\r\n\f\r\n  11. If, as a consequence of a court judgment or allegation of patent\r\ninfringement or for any other reason (not limited to patent issues),\r\nconditions are imposed on you (whether by court order, agreement or\r\notherwise) that contradict the conditions of this License, they do not\r\nexcuse you from the conditions of this License.  If you cannot\r\ndistribute so as to satisfy simultaneously your obligations under this\r\nLicense and any other pertinent obligations, then as a consequence you\r\nmay not distribute the Library at all.  For example, if a patent\r\nlicense would not permit royalty-free redistribution of the Library by\r\nall those who receive copies directly or indirectly through you, then\r\nthe only way you could satisfy both it and this License would be to\r\nrefrain entirely from distribution of the Library.\r\n\r\nIf any portion of this section is held invalid or unenforceable under any\r\nparticular circumstance, the balance of the section is intended to apply,\r\nand the section as a whole is intended to apply in other circumstances.\r\n\r\nIt is not the purpose of this section to induce you to infringe any\r\npatents or other property right claims or to contest validity of any\r\nsuch claims; this section has the sole purpose of protecting the\r\nintegrity of the free software distribution system which is\r\nimplemented by public license practices.  Many people have made\r\ngenerous contributions to the wide range of software distributed\r\nthrough that system in reliance on consistent application of that\r\nsystem; it is up to the author/donor to decide if he or she is willing\r\nto distribute software through any other system and a licensee cannot\r\nimpose that choice.\r\n\r\nThis section is intended to make thoroughly clear what is believed to\r\nbe a consequence of the rest of this License.\r\n\r\n  12. If the distribution and/or use of the Library is restricted in\r\ncertain countries either by patents or by copyrighted interfaces, the\r\noriginal copyright holder who places the Library under this License may add\r\nan explicit geographical distribution limitation excluding those countries,\r\nso that distribution is permitted only in or among countries not thus\r\nexcluded.  In such case, this License incorporates the limitation as if\r\nwritten in the body of this License.\r\n\r\n  13. The Free Software Foundation may publish revised and/or new\r\nversions of the Library General Public License from time to time.\r\nSuch new versions will be similar in spirit to the present version,\r\nbut may differ in detail to address new problems or concerns.\r\n\r\nEach version is given a distinguishing version number.  If the Library\r\nspecifies a version number of this License which applies to it and\r\n\"any later version\", you have the option of following the terms and\r\nconditions either of that version or of any later version published by\r\nthe Free Software Foundation.  If the Library does not specify a\r\nlicense version number, you may choose any version ever published by\r\nthe Free Software Foundation.\r\n\f\r\n  14. If you wish to incorporate parts of the Library into other free\r\nprograms whose distribution conditions are incompatible with these,\r\nwrite to the author to ask for permission.  For software which is\r\ncopyrighted by the Free Software Foundation, write to the Free\r\nSoftware Foundation; we sometimes make exceptions for this.  Our\r\ndecision will be guided by the two goals of preserving the free status\r\nof all derivatives of our free software and of promoting the sharing\r\nand reuse of software generally.\r\n\r\n\t\t\t    NO WARRANTY\r\n\r\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\r\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r\n\r\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r\nDAMAGES.\r\n\r\n\t\t     END OF TERMS AND CONDITIONS\r\n\f\r\n           How to Apply These Terms to Your New Libraries\r\n\r\n  If you develop a new library, and you want it to be of the greatest\r\npossible use to the public, we recommend making it free software that\r\neveryone can redistribute and change.  You can do so by permitting\r\nredistribution under these terms (or, alternatively, under the terms of the\r\nordinary General Public License).\r\n\r\n  To apply these terms, attach the following notices to the library.  It is\r\nsafest to attach them to the start of each source file to most effectively\r\nconvey the exclusion of warranty; and each file should have at least the\r\n\"copyright\" line and a pointer to where the full notice is found.\r\n\r\n    <one line to give the library's name and a brief idea of what it does.>\r\n    Copyright (C) <year>  <name of author>\r\n\r\n    This library is free software; you can redistribute it and/or\r\n    modify it under the terms of the GNU Library General Public\r\n    License as published by the Free Software Foundation; either\r\n    version 2 of the License, or (at your option) any later version.\r\n\r\n    This library is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r\n    Library General Public License for more details.\r\n\r\n    You should have received a copy of the GNU Library General Public\r\n    License along with this library; if not, write to the Free Software\r\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA\r\n\r\nAlso add information on how to contact you by electronic and paper mail.\r\n\r\nYou should also get your employer (if you work as a programmer) or your\r\nschool, if any, to sign a \"copyright disclaimer\" for the library, if\r\nnecessary.  Here is a sample; alter the names:\r\n\r\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\r\n  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r\n\r\n  <signature of Ty Coon>, 1 April 1990\r\n  Ty Coon, President of Vice\r\n\r\nThat's all there is to it!\r\n"
  },
  {
    "path": "src/ext2fs/Makefile.am",
    "content": "noinst_LIBRARIES = libext2fs.a\n\nlibext2fs_a_SOURCES = alloc.c alloc_sb.c alloc_stats.c alloc_tables.c badblocks.c bb_inode.c bitmaps.c   \\\n\tbitops.c blkmap64_ba.c blkmap64_rb.c blknum.c block.c bmap.c closefs.c crc16.c crc32c.c          \\\n\tcsum.c dirblock.c dirhash.c dir_iterate.c extent.c ext_attr.c extent.c fallocate.c fileio.c      \\\n\tfreefs.c gen_bitmap.c gen_bitmap64.c get_num_dirs.c hashmap.c i_block.c ind_block.c initialize.c \\\n\tinline.c inline_data.c inode.c io_manager.c link.c lookup.c mkdir.c mkjournal.c namei.c mmp.c    \\\n\tnewdir.c nt_io.c openfs.c punch.c rbtree.c read_bb.c rw_bitmaps.c sha512.c symlink.c valid_blk.c\n\nlibext2fs_a_CFLAGS = $(AM_CFLAGS) -DEXT2_FLAT_INCLUDES=0 -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/.. -Wno-undef -Wno-strict-aliasing -Wno-shadow\n"
  },
  {
    "path": "src/ext2fs/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = src/ext2fs\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLIBRARIES = $(noinst_LIBRARIES)\nARFLAGS = cru\nAM_V_AR = $(am__v_AR_@AM_V@)\nam__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)\nam__v_AR_0 = @echo \"  AR      \" $@;\nam__v_AR_1 = \nlibext2fs_a_AR = $(AR) $(ARFLAGS)\nlibext2fs_a_LIBADD =\nam_libext2fs_a_OBJECTS = libext2fs_a-alloc.$(OBJEXT) \\\n\tlibext2fs_a-alloc_sb.$(OBJEXT) \\\n\tlibext2fs_a-alloc_stats.$(OBJEXT) \\\n\tlibext2fs_a-alloc_tables.$(OBJEXT) \\\n\tlibext2fs_a-badblocks.$(OBJEXT) libext2fs_a-bb_inode.$(OBJEXT) \\\n\tlibext2fs_a-bitmaps.$(OBJEXT) libext2fs_a-bitops.$(OBJEXT) \\\n\tlibext2fs_a-blkmap64_ba.$(OBJEXT) \\\n\tlibext2fs_a-blkmap64_rb.$(OBJEXT) libext2fs_a-blknum.$(OBJEXT) \\\n\tlibext2fs_a-block.$(OBJEXT) libext2fs_a-bmap.$(OBJEXT) \\\n\tlibext2fs_a-closefs.$(OBJEXT) libext2fs_a-crc16.$(OBJEXT) \\\n\tlibext2fs_a-crc32c.$(OBJEXT) libext2fs_a-csum.$(OBJEXT) \\\n\tlibext2fs_a-dirblock.$(OBJEXT) libext2fs_a-dirhash.$(OBJEXT) \\\n\tlibext2fs_a-dir_iterate.$(OBJEXT) libext2fs_a-extent.$(OBJEXT) \\\n\tlibext2fs_a-ext_attr.$(OBJEXT) libext2fs_a-extent.$(OBJEXT) \\\n\tlibext2fs_a-fallocate.$(OBJEXT) libext2fs_a-fileio.$(OBJEXT) \\\n\tlibext2fs_a-freefs.$(OBJEXT) libext2fs_a-gen_bitmap.$(OBJEXT) \\\n\tlibext2fs_a-gen_bitmap64.$(OBJEXT) \\\n\tlibext2fs_a-get_num_dirs.$(OBJEXT) \\\n\tlibext2fs_a-hashmap.$(OBJEXT) libext2fs_a-i_block.$(OBJEXT) \\\n\tlibext2fs_a-ind_block.$(OBJEXT) \\\n\tlibext2fs_a-initialize.$(OBJEXT) libext2fs_a-inline.$(OBJEXT) \\\n\tlibext2fs_a-inline_data.$(OBJEXT) libext2fs_a-inode.$(OBJEXT) \\\n\tlibext2fs_a-io_manager.$(OBJEXT) libext2fs_a-link.$(OBJEXT) \\\n\tlibext2fs_a-lookup.$(OBJEXT) libext2fs_a-mkdir.$(OBJEXT) \\\n\tlibext2fs_a-mkjournal.$(OBJEXT) libext2fs_a-namei.$(OBJEXT) \\\n\tlibext2fs_a-mmp.$(OBJEXT) libext2fs_a-newdir.$(OBJEXT) \\\n\tlibext2fs_a-nt_io.$(OBJEXT) libext2fs_a-openfs.$(OBJEXT) \\\n\tlibext2fs_a-punch.$(OBJEXT) libext2fs_a-rbtree.$(OBJEXT) \\\n\tlibext2fs_a-read_bb.$(OBJEXT) libext2fs_a-rw_bitmaps.$(OBJEXT) \\\n\tlibext2fs_a-sha512.$(OBJEXT) libext2fs_a-symlink.$(OBJEXT) \\\n\tlibext2fs_a-valid_blk.$(OBJEXT)\nlibext2fs_a_OBJECTS = $(am_libext2fs_a_OBJECTS)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp =\nam__depfiles_maybe =\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libext2fs_a_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LIBRARIES = libext2fs.a\nlibext2fs_a_SOURCES = alloc.c alloc_sb.c alloc_stats.c alloc_tables.c badblocks.c bb_inode.c bitmaps.c   \\\n\tbitops.c blkmap64_ba.c blkmap64_rb.c blknum.c block.c bmap.c closefs.c crc16.c crc32c.c          \\\n\tcsum.c dirblock.c dirhash.c dir_iterate.c extent.c ext_attr.c extent.c fallocate.c fileio.c      \\\n\tfreefs.c gen_bitmap.c gen_bitmap64.c get_num_dirs.c hashmap.c i_block.c ind_block.c initialize.c \\\n\tinline.c inline_data.c inode.c io_manager.c link.c lookup.c mkdir.c mkjournal.c namei.c mmp.c    \\\n\tnewdir.c nt_io.c openfs.c punch.c rbtree.c read_bb.c rw_bitmaps.c sha512.c symlink.c valid_blk.c\n\nlibext2fs_a_CFLAGS = $(AM_CFLAGS) -DEXT2_FLAT_INCLUDES=0 -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/.. -Wno-undef -Wno-strict-aliasing -Wno-shadow\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/ext2fs/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps src/ext2fs/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLIBRARIES:\n\t-test -z \"$(noinst_LIBRARIES)\" || rm -f $(noinst_LIBRARIES)\n\nlibext2fs.a: $(libext2fs_a_OBJECTS) $(libext2fs_a_DEPENDENCIES) $(EXTRA_libext2fs_a_DEPENDENCIES) \n\t$(AM_V_at)-rm -f libext2fs.a\n\t$(AM_V_AR)$(libext2fs_a_AR) libext2fs.a $(libext2fs_a_OBJECTS) $(libext2fs_a_LIBADD)\n\t$(AM_V_at)$(RANLIB) libext2fs.a\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n.c.o:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\nlibext2fs_a-alloc.o: alloc.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-alloc.o `test -f 'alloc.c' || echo '$(srcdir)/'`alloc.c\n\nlibext2fs_a-alloc.obj: alloc.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-alloc.obj `if test -f 'alloc.c'; then $(CYGPATH_W) 'alloc.c'; else $(CYGPATH_W) '$(srcdir)/alloc.c'; fi`\n\nlibext2fs_a-alloc_sb.o: alloc_sb.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-alloc_sb.o `test -f 'alloc_sb.c' || echo '$(srcdir)/'`alloc_sb.c\n\nlibext2fs_a-alloc_sb.obj: alloc_sb.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-alloc_sb.obj `if test -f 'alloc_sb.c'; then $(CYGPATH_W) 'alloc_sb.c'; else $(CYGPATH_W) '$(srcdir)/alloc_sb.c'; fi`\n\nlibext2fs_a-alloc_stats.o: alloc_stats.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-alloc_stats.o `test -f 'alloc_stats.c' || echo '$(srcdir)/'`alloc_stats.c\n\nlibext2fs_a-alloc_stats.obj: alloc_stats.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-alloc_stats.obj `if test -f 'alloc_stats.c'; then $(CYGPATH_W) 'alloc_stats.c'; else $(CYGPATH_W) '$(srcdir)/alloc_stats.c'; fi`\n\nlibext2fs_a-alloc_tables.o: alloc_tables.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-alloc_tables.o `test -f 'alloc_tables.c' || echo '$(srcdir)/'`alloc_tables.c\n\nlibext2fs_a-alloc_tables.obj: alloc_tables.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-alloc_tables.obj `if test -f 'alloc_tables.c'; then $(CYGPATH_W) 'alloc_tables.c'; else $(CYGPATH_W) '$(srcdir)/alloc_tables.c'; fi`\n\nlibext2fs_a-badblocks.o: badblocks.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-badblocks.o `test -f 'badblocks.c' || echo '$(srcdir)/'`badblocks.c\n\nlibext2fs_a-badblocks.obj: badblocks.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-badblocks.obj `if test -f 'badblocks.c'; then $(CYGPATH_W) 'badblocks.c'; else $(CYGPATH_W) '$(srcdir)/badblocks.c'; fi`\n\nlibext2fs_a-bb_inode.o: bb_inode.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-bb_inode.o `test -f 'bb_inode.c' || echo '$(srcdir)/'`bb_inode.c\n\nlibext2fs_a-bb_inode.obj: bb_inode.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-bb_inode.obj `if test -f 'bb_inode.c'; then $(CYGPATH_W) 'bb_inode.c'; else $(CYGPATH_W) '$(srcdir)/bb_inode.c'; fi`\n\nlibext2fs_a-bitmaps.o: bitmaps.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-bitmaps.o `test -f 'bitmaps.c' || echo '$(srcdir)/'`bitmaps.c\n\nlibext2fs_a-bitmaps.obj: bitmaps.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-bitmaps.obj `if test -f 'bitmaps.c'; then $(CYGPATH_W) 'bitmaps.c'; else $(CYGPATH_W) '$(srcdir)/bitmaps.c'; fi`\n\nlibext2fs_a-bitops.o: bitops.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-bitops.o `test -f 'bitops.c' || echo '$(srcdir)/'`bitops.c\n\nlibext2fs_a-bitops.obj: bitops.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-bitops.obj `if test -f 'bitops.c'; then $(CYGPATH_W) 'bitops.c'; else $(CYGPATH_W) '$(srcdir)/bitops.c'; fi`\n\nlibext2fs_a-blkmap64_ba.o: blkmap64_ba.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-blkmap64_ba.o `test -f 'blkmap64_ba.c' || echo '$(srcdir)/'`blkmap64_ba.c\n\nlibext2fs_a-blkmap64_ba.obj: blkmap64_ba.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-blkmap64_ba.obj `if test -f 'blkmap64_ba.c'; then $(CYGPATH_W) 'blkmap64_ba.c'; else $(CYGPATH_W) '$(srcdir)/blkmap64_ba.c'; fi`\n\nlibext2fs_a-blkmap64_rb.o: blkmap64_rb.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-blkmap64_rb.o `test -f 'blkmap64_rb.c' || echo '$(srcdir)/'`blkmap64_rb.c\n\nlibext2fs_a-blkmap64_rb.obj: blkmap64_rb.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-blkmap64_rb.obj `if test -f 'blkmap64_rb.c'; then $(CYGPATH_W) 'blkmap64_rb.c'; else $(CYGPATH_W) '$(srcdir)/blkmap64_rb.c'; fi`\n\nlibext2fs_a-blknum.o: blknum.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-blknum.o `test -f 'blknum.c' || echo '$(srcdir)/'`blknum.c\n\nlibext2fs_a-blknum.obj: blknum.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-blknum.obj `if test -f 'blknum.c'; then $(CYGPATH_W) 'blknum.c'; else $(CYGPATH_W) '$(srcdir)/blknum.c'; fi`\n\nlibext2fs_a-block.o: block.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-block.o `test -f 'block.c' || echo '$(srcdir)/'`block.c\n\nlibext2fs_a-block.obj: block.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-block.obj `if test -f 'block.c'; then $(CYGPATH_W) 'block.c'; else $(CYGPATH_W) '$(srcdir)/block.c'; fi`\n\nlibext2fs_a-bmap.o: bmap.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-bmap.o `test -f 'bmap.c' || echo '$(srcdir)/'`bmap.c\n\nlibext2fs_a-bmap.obj: bmap.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-bmap.obj `if test -f 'bmap.c'; then $(CYGPATH_W) 'bmap.c'; else $(CYGPATH_W) '$(srcdir)/bmap.c'; fi`\n\nlibext2fs_a-closefs.o: closefs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-closefs.o `test -f 'closefs.c' || echo '$(srcdir)/'`closefs.c\n\nlibext2fs_a-closefs.obj: closefs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-closefs.obj `if test -f 'closefs.c'; then $(CYGPATH_W) 'closefs.c'; else $(CYGPATH_W) '$(srcdir)/closefs.c'; fi`\n\nlibext2fs_a-crc16.o: crc16.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-crc16.o `test -f 'crc16.c' || echo '$(srcdir)/'`crc16.c\n\nlibext2fs_a-crc16.obj: crc16.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-crc16.obj `if test -f 'crc16.c'; then $(CYGPATH_W) 'crc16.c'; else $(CYGPATH_W) '$(srcdir)/crc16.c'; fi`\n\nlibext2fs_a-crc32c.o: crc32c.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-crc32c.o `test -f 'crc32c.c' || echo '$(srcdir)/'`crc32c.c\n\nlibext2fs_a-crc32c.obj: crc32c.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-crc32c.obj `if test -f 'crc32c.c'; then $(CYGPATH_W) 'crc32c.c'; else $(CYGPATH_W) '$(srcdir)/crc32c.c'; fi`\n\nlibext2fs_a-csum.o: csum.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-csum.o `test -f 'csum.c' || echo '$(srcdir)/'`csum.c\n\nlibext2fs_a-csum.obj: csum.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-csum.obj `if test -f 'csum.c'; then $(CYGPATH_W) 'csum.c'; else $(CYGPATH_W) '$(srcdir)/csum.c'; fi`\n\nlibext2fs_a-dirblock.o: dirblock.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-dirblock.o `test -f 'dirblock.c' || echo '$(srcdir)/'`dirblock.c\n\nlibext2fs_a-dirblock.obj: dirblock.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-dirblock.obj `if test -f 'dirblock.c'; then $(CYGPATH_W) 'dirblock.c'; else $(CYGPATH_W) '$(srcdir)/dirblock.c'; fi`\n\nlibext2fs_a-dirhash.o: dirhash.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-dirhash.o `test -f 'dirhash.c' || echo '$(srcdir)/'`dirhash.c\n\nlibext2fs_a-dirhash.obj: dirhash.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-dirhash.obj `if test -f 'dirhash.c'; then $(CYGPATH_W) 'dirhash.c'; else $(CYGPATH_W) '$(srcdir)/dirhash.c'; fi`\n\nlibext2fs_a-dir_iterate.o: dir_iterate.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-dir_iterate.o `test -f 'dir_iterate.c' || echo '$(srcdir)/'`dir_iterate.c\n\nlibext2fs_a-dir_iterate.obj: dir_iterate.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-dir_iterate.obj `if test -f 'dir_iterate.c'; then $(CYGPATH_W) 'dir_iterate.c'; else $(CYGPATH_W) '$(srcdir)/dir_iterate.c'; fi`\n\nlibext2fs_a-extent.o: extent.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-extent.o `test -f 'extent.c' || echo '$(srcdir)/'`extent.c\n\nlibext2fs_a-extent.obj: extent.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-extent.obj `if test -f 'extent.c'; then $(CYGPATH_W) 'extent.c'; else $(CYGPATH_W) '$(srcdir)/extent.c'; fi`\n\nlibext2fs_a-ext_attr.o: ext_attr.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-ext_attr.o `test -f 'ext_attr.c' || echo '$(srcdir)/'`ext_attr.c\n\nlibext2fs_a-ext_attr.obj: ext_attr.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-ext_attr.obj `if test -f 'ext_attr.c'; then $(CYGPATH_W) 'ext_attr.c'; else $(CYGPATH_W) '$(srcdir)/ext_attr.c'; fi`\n\nlibext2fs_a-fallocate.o: fallocate.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-fallocate.o `test -f 'fallocate.c' || echo '$(srcdir)/'`fallocate.c\n\nlibext2fs_a-fallocate.obj: fallocate.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-fallocate.obj `if test -f 'fallocate.c'; then $(CYGPATH_W) 'fallocate.c'; else $(CYGPATH_W) '$(srcdir)/fallocate.c'; fi`\n\nlibext2fs_a-fileio.o: fileio.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-fileio.o `test -f 'fileio.c' || echo '$(srcdir)/'`fileio.c\n\nlibext2fs_a-fileio.obj: fileio.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-fileio.obj `if test -f 'fileio.c'; then $(CYGPATH_W) 'fileio.c'; else $(CYGPATH_W) '$(srcdir)/fileio.c'; fi`\n\nlibext2fs_a-freefs.o: freefs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-freefs.o `test -f 'freefs.c' || echo '$(srcdir)/'`freefs.c\n\nlibext2fs_a-freefs.obj: freefs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-freefs.obj `if test -f 'freefs.c'; then $(CYGPATH_W) 'freefs.c'; else $(CYGPATH_W) '$(srcdir)/freefs.c'; fi`\n\nlibext2fs_a-gen_bitmap.o: gen_bitmap.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-gen_bitmap.o `test -f 'gen_bitmap.c' || echo '$(srcdir)/'`gen_bitmap.c\n\nlibext2fs_a-gen_bitmap.obj: gen_bitmap.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-gen_bitmap.obj `if test -f 'gen_bitmap.c'; then $(CYGPATH_W) 'gen_bitmap.c'; else $(CYGPATH_W) '$(srcdir)/gen_bitmap.c'; fi`\n\nlibext2fs_a-gen_bitmap64.o: gen_bitmap64.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-gen_bitmap64.o `test -f 'gen_bitmap64.c' || echo '$(srcdir)/'`gen_bitmap64.c\n\nlibext2fs_a-gen_bitmap64.obj: gen_bitmap64.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-gen_bitmap64.obj `if test -f 'gen_bitmap64.c'; then $(CYGPATH_W) 'gen_bitmap64.c'; else $(CYGPATH_W) '$(srcdir)/gen_bitmap64.c'; fi`\n\nlibext2fs_a-get_num_dirs.o: get_num_dirs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-get_num_dirs.o `test -f 'get_num_dirs.c' || echo '$(srcdir)/'`get_num_dirs.c\n\nlibext2fs_a-get_num_dirs.obj: get_num_dirs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-get_num_dirs.obj `if test -f 'get_num_dirs.c'; then $(CYGPATH_W) 'get_num_dirs.c'; else $(CYGPATH_W) '$(srcdir)/get_num_dirs.c'; fi`\n\nlibext2fs_a-hashmap.o: hashmap.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-hashmap.o `test -f 'hashmap.c' || echo '$(srcdir)/'`hashmap.c\n\nlibext2fs_a-hashmap.obj: hashmap.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-hashmap.obj `if test -f 'hashmap.c'; then $(CYGPATH_W) 'hashmap.c'; else $(CYGPATH_W) '$(srcdir)/hashmap.c'; fi`\n\nlibext2fs_a-i_block.o: i_block.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-i_block.o `test -f 'i_block.c' || echo '$(srcdir)/'`i_block.c\n\nlibext2fs_a-i_block.obj: i_block.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-i_block.obj `if test -f 'i_block.c'; then $(CYGPATH_W) 'i_block.c'; else $(CYGPATH_W) '$(srcdir)/i_block.c'; fi`\n\nlibext2fs_a-ind_block.o: ind_block.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-ind_block.o `test -f 'ind_block.c' || echo '$(srcdir)/'`ind_block.c\n\nlibext2fs_a-ind_block.obj: ind_block.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-ind_block.obj `if test -f 'ind_block.c'; then $(CYGPATH_W) 'ind_block.c'; else $(CYGPATH_W) '$(srcdir)/ind_block.c'; fi`\n\nlibext2fs_a-initialize.o: initialize.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-initialize.o `test -f 'initialize.c' || echo '$(srcdir)/'`initialize.c\n\nlibext2fs_a-initialize.obj: initialize.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-initialize.obj `if test -f 'initialize.c'; then $(CYGPATH_W) 'initialize.c'; else $(CYGPATH_W) '$(srcdir)/initialize.c'; fi`\n\nlibext2fs_a-inline.o: inline.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-inline.o `test -f 'inline.c' || echo '$(srcdir)/'`inline.c\n\nlibext2fs_a-inline.obj: inline.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-inline.obj `if test -f 'inline.c'; then $(CYGPATH_W) 'inline.c'; else $(CYGPATH_W) '$(srcdir)/inline.c'; fi`\n\nlibext2fs_a-inline_data.o: inline_data.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-inline_data.o `test -f 'inline_data.c' || echo '$(srcdir)/'`inline_data.c\n\nlibext2fs_a-inline_data.obj: inline_data.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-inline_data.obj `if test -f 'inline_data.c'; then $(CYGPATH_W) 'inline_data.c'; else $(CYGPATH_W) '$(srcdir)/inline_data.c'; fi`\n\nlibext2fs_a-inode.o: inode.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-inode.o `test -f 'inode.c' || echo '$(srcdir)/'`inode.c\n\nlibext2fs_a-inode.obj: inode.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-inode.obj `if test -f 'inode.c'; then $(CYGPATH_W) 'inode.c'; else $(CYGPATH_W) '$(srcdir)/inode.c'; fi`\n\nlibext2fs_a-io_manager.o: io_manager.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-io_manager.o `test -f 'io_manager.c' || echo '$(srcdir)/'`io_manager.c\n\nlibext2fs_a-io_manager.obj: io_manager.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-io_manager.obj `if test -f 'io_manager.c'; then $(CYGPATH_W) 'io_manager.c'; else $(CYGPATH_W) '$(srcdir)/io_manager.c'; fi`\n\nlibext2fs_a-link.o: link.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-link.o `test -f 'link.c' || echo '$(srcdir)/'`link.c\n\nlibext2fs_a-link.obj: link.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-link.obj `if test -f 'link.c'; then $(CYGPATH_W) 'link.c'; else $(CYGPATH_W) '$(srcdir)/link.c'; fi`\n\nlibext2fs_a-lookup.o: lookup.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-lookup.o `test -f 'lookup.c' || echo '$(srcdir)/'`lookup.c\n\nlibext2fs_a-lookup.obj: lookup.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-lookup.obj `if test -f 'lookup.c'; then $(CYGPATH_W) 'lookup.c'; else $(CYGPATH_W) '$(srcdir)/lookup.c'; fi`\n\nlibext2fs_a-mkdir.o: mkdir.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-mkdir.o `test -f 'mkdir.c' || echo '$(srcdir)/'`mkdir.c\n\nlibext2fs_a-mkdir.obj: mkdir.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-mkdir.obj `if test -f 'mkdir.c'; then $(CYGPATH_W) 'mkdir.c'; else $(CYGPATH_W) '$(srcdir)/mkdir.c'; fi`\n\nlibext2fs_a-mkjournal.o: mkjournal.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-mkjournal.o `test -f 'mkjournal.c' || echo '$(srcdir)/'`mkjournal.c\n\nlibext2fs_a-mkjournal.obj: mkjournal.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-mkjournal.obj `if test -f 'mkjournal.c'; then $(CYGPATH_W) 'mkjournal.c'; else $(CYGPATH_W) '$(srcdir)/mkjournal.c'; fi`\n\nlibext2fs_a-namei.o: namei.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-namei.o `test -f 'namei.c' || echo '$(srcdir)/'`namei.c\n\nlibext2fs_a-namei.obj: namei.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-namei.obj `if test -f 'namei.c'; then $(CYGPATH_W) 'namei.c'; else $(CYGPATH_W) '$(srcdir)/namei.c'; fi`\n\nlibext2fs_a-mmp.o: mmp.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-mmp.o `test -f 'mmp.c' || echo '$(srcdir)/'`mmp.c\n\nlibext2fs_a-mmp.obj: mmp.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-mmp.obj `if test -f 'mmp.c'; then $(CYGPATH_W) 'mmp.c'; else $(CYGPATH_W) '$(srcdir)/mmp.c'; fi`\n\nlibext2fs_a-newdir.o: newdir.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-newdir.o `test -f 'newdir.c' || echo '$(srcdir)/'`newdir.c\n\nlibext2fs_a-newdir.obj: newdir.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-newdir.obj `if test -f 'newdir.c'; then $(CYGPATH_W) 'newdir.c'; else $(CYGPATH_W) '$(srcdir)/newdir.c'; fi`\n\nlibext2fs_a-nt_io.o: nt_io.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-nt_io.o `test -f 'nt_io.c' || echo '$(srcdir)/'`nt_io.c\n\nlibext2fs_a-nt_io.obj: nt_io.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-nt_io.obj `if test -f 'nt_io.c'; then $(CYGPATH_W) 'nt_io.c'; else $(CYGPATH_W) '$(srcdir)/nt_io.c'; fi`\n\nlibext2fs_a-openfs.o: openfs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-openfs.o `test -f 'openfs.c' || echo '$(srcdir)/'`openfs.c\n\nlibext2fs_a-openfs.obj: openfs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-openfs.obj `if test -f 'openfs.c'; then $(CYGPATH_W) 'openfs.c'; else $(CYGPATH_W) '$(srcdir)/openfs.c'; fi`\n\nlibext2fs_a-punch.o: punch.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-punch.o `test -f 'punch.c' || echo '$(srcdir)/'`punch.c\n\nlibext2fs_a-punch.obj: punch.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-punch.obj `if test -f 'punch.c'; then $(CYGPATH_W) 'punch.c'; else $(CYGPATH_W) '$(srcdir)/punch.c'; fi`\n\nlibext2fs_a-rbtree.o: rbtree.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-rbtree.o `test -f 'rbtree.c' || echo '$(srcdir)/'`rbtree.c\n\nlibext2fs_a-rbtree.obj: rbtree.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-rbtree.obj `if test -f 'rbtree.c'; then $(CYGPATH_W) 'rbtree.c'; else $(CYGPATH_W) '$(srcdir)/rbtree.c'; fi`\n\nlibext2fs_a-read_bb.o: read_bb.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-read_bb.o `test -f 'read_bb.c' || echo '$(srcdir)/'`read_bb.c\n\nlibext2fs_a-read_bb.obj: read_bb.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-read_bb.obj `if test -f 'read_bb.c'; then $(CYGPATH_W) 'read_bb.c'; else $(CYGPATH_W) '$(srcdir)/read_bb.c'; fi`\n\nlibext2fs_a-rw_bitmaps.o: rw_bitmaps.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-rw_bitmaps.o `test -f 'rw_bitmaps.c' || echo '$(srcdir)/'`rw_bitmaps.c\n\nlibext2fs_a-rw_bitmaps.obj: rw_bitmaps.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-rw_bitmaps.obj `if test -f 'rw_bitmaps.c'; then $(CYGPATH_W) 'rw_bitmaps.c'; else $(CYGPATH_W) '$(srcdir)/rw_bitmaps.c'; fi`\n\nlibext2fs_a-sha512.o: sha512.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-sha512.o `test -f 'sha512.c' || echo '$(srcdir)/'`sha512.c\n\nlibext2fs_a-sha512.obj: sha512.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-sha512.obj `if test -f 'sha512.c'; then $(CYGPATH_W) 'sha512.c'; else $(CYGPATH_W) '$(srcdir)/sha512.c'; fi`\n\nlibext2fs_a-symlink.o: symlink.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-symlink.o `test -f 'symlink.c' || echo '$(srcdir)/'`symlink.c\n\nlibext2fs_a-symlink.obj: symlink.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-symlink.obj `if test -f 'symlink.c'; then $(CYGPATH_W) 'symlink.c'; else $(CYGPATH_W) '$(srcdir)/symlink.c'; fi`\n\nlibext2fs_a-valid_blk.o: valid_blk.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-valid_blk.o `test -f 'valid_blk.c' || echo '$(srcdir)/'`valid_blk.c\n\nlibext2fs_a-valid_blk.obj: valid_blk.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libext2fs_a_CFLAGS) $(CFLAGS) -c -o libext2fs_a-valid_blk.obj `if test -f 'valid_blk.c'; then $(CYGPATH_W) 'valid_blk.c'; else $(CYGPATH_W) '$(srcdir)/valid_blk.c'; fi`\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LIBRARIES)\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \\\n\tdistclean-compile distclean-generic distclean-tags dvi dvi-am \\\n\thtml html-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "src/ext2fs/alloc.c",
    "content": "/*\n * alloc.c --- allocate new inodes, blocks for ext2fs\n *\n * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <time.h>\n#include <string.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\n#ifndef min\n#define min(a, b) ((a) < (b) ? (a) : (b))\n#endif\n\n#undef DEBUG\n\n#ifdef DEBUG\n# define dbg_printf(f, a...)  do {printf(f, ## a); fflush(stdout); } while (0)\n#else\n# define dbg_printf(f, ...)\n#endif\n\n/*\n * Clear the uninit block bitmap flag if necessary\n */\nvoid ext2fs_clear_block_uninit(ext2_filsys fs, dgrp_t group)\n{\n\tif (group >= fs->group_desc_count ||\n\t    !ext2fs_has_group_desc_csum(fs) ||\n\t    !(ext2fs_bg_flags_test(fs, group, EXT2_BG_BLOCK_UNINIT)))\n\t\treturn;\n\n\t/* uninit block bitmaps are now initialized in read_bitmaps() */\n\n\text2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT);\n\text2fs_group_desc_csum_set(fs, group);\n\text2fs_mark_super_dirty(fs);\n\text2fs_mark_bb_dirty(fs);\n}\n\n/*\n * Check for uninit inode bitmaps and deal with them appropriately\n */\nstatic void check_inode_uninit(ext2_filsys fs, ext2fs_inode_bitmap map,\n\t\t\t  dgrp_t group)\n{\n\text2_ino_t\ti, ino;\n\n\tif (group >= fs->group_desc_count ||\n\t    !ext2fs_has_group_desc_csum(fs) ||\n\t    !(ext2fs_bg_flags_test(fs, group, EXT2_BG_INODE_UNINIT)))\n\t\treturn;\n\n\tino = (group * fs->super->s_inodes_per_group) + 1;\n\tfor (i=0; i < fs->super->s_inodes_per_group; i++, ino++)\n\t\text2fs_fast_unmark_inode_bitmap2(map, ino);\n\n\text2fs_bg_flags_clear(fs, group, EXT2_BG_INODE_UNINIT);\n\t/* Mimics what the kernel does */\n\text2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT);\n\text2fs_group_desc_csum_set(fs, group);\n\text2fs_mark_ib_dirty(fs);\n\text2fs_mark_super_dirty(fs);\n}\n\n/*\n * Right now, just search forward from the parent directory's block\n * group to find the next free inode.\n *\n * Should have a special policy for directories.\n */\nerrcode_t ext2fs_new_inode(ext2_filsys fs, ext2_ino_t dir,\n\t\t\t   int mode EXT2FS_ATTR((unused)),\n\t\t\t   ext2fs_inode_bitmap map, ext2_ino_t *ret)\n{\n\text2_ino_t\tstart_inode = 0;\n\text2_ino_t\ti, ino_in_group, upto, first_zero;\n\terrcode_t\tretval;\n\tdgrp_t\t\tgroup;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif (!map)\n\t\tmap = fs->inode_map;\n\tif (!map)\n\t\treturn EXT2_ET_NO_INODE_BITMAP;\n\n\tif (dir > 0) {\n\t\tgroup = (dir - 1) / EXT2_INODES_PER_GROUP(fs->super);\n\t\tstart_inode = (group * EXT2_INODES_PER_GROUP(fs->super)) + 1;\n\t}\n\tif (start_inode < EXT2_FIRST_INODE(fs->super))\n\t\tstart_inode = EXT2_FIRST_INODE(fs->super);\n\tif (start_inode > fs->super->s_inodes_count)\n\t\treturn EXT2_ET_INODE_ALLOC_FAIL;\n\ti = start_inode;\n\tdo {\n\t\tino_in_group = (i - 1) % EXT2_INODES_PER_GROUP(fs->super);\n\t\tgroup = (i - 1) / EXT2_INODES_PER_GROUP(fs->super);\n\n\t\tcheck_inode_uninit(fs, map, group);\n\t\tupto = i + (EXT2_INODES_PER_GROUP(fs->super) - ino_in_group);\n\t\tif (i < start_inode && upto >= start_inode)\n\t\t\tupto = start_inode - 1;\n\t\tif (upto > fs->super->s_inodes_count)\n\t\t\tupto = fs->super->s_inodes_count;\n\n\t\tretval = ext2fs_find_first_zero_inode_bitmap2(map, i, upto,\n\t\t\t\t\t\t\t      &first_zero);\n\t\tif (retval == 0) {\n\t\t\ti = first_zero;\n\t\t\tbreak;\n\t\t}\n\t\tif (retval != ENOENT)\n\t\t\treturn EXT2_ET_INODE_ALLOC_FAIL;\n\t\ti = upto + 1;\n\t\tif (i > fs->super->s_inodes_count)\n\t\t\ti = EXT2_FIRST_INODE(fs->super);\n\t} while (i != start_inode);\n\n\tif (ext2fs_test_inode_bitmap2(map, i))\n\t\treturn EXT2_ET_INODE_ALLOC_FAIL;\n\t*ret = i;\n\treturn 0;\n}\n\n/*\n * Stupid algorithm --- we now just search forward starting from the\n * goal.  Should put in a smarter one someday....\n */\nerrcode_t ext2fs_new_block3(ext2_filsys fs, blk64_t goal,\n\t\t\t    ext2fs_block_bitmap map, blk64_t *ret,\n\t\t\t    struct blk_alloc_ctx *ctx)\n{\n\terrcode_t retval;\n\tblk64_t\tb = 0;\n\terrcode_t (*gab)(ext2_filsys fs, blk64_t goal, blk64_t *ret);\n\terrcode_t (*gab2)(ext2_filsys, blk64_t, blk64_t *,\n\t\t\t  struct blk_alloc_ctx *);\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif (!map) {\n\t\t/*\n\t\t * In case there are clients out there whose get_alloc_block\n\t\t * handlers call ext2fs_new_block2 with a NULL block map,\n\t\t * temporarily swap out the function pointer so that we don't\n\t\t * end up in an infinite loop.\n\t\t */\n\t\tif (fs->get_alloc_block2) {\n\t\t\tgab2 = fs->get_alloc_block2;\n\t\t\tfs->get_alloc_block2 = NULL;\n\t\t\tretval = gab2(fs, goal, &b, ctx);\n\t\t\tfs->get_alloc_block2 = gab2;\n\t\t\tgoto allocated;\n\t\t} else if (fs->get_alloc_block) {\n\t\t\tgab = fs->get_alloc_block;\n\t\t\tfs->get_alloc_block = NULL;\n\t\t\tretval = gab(fs, goal, &b);\n\t\t\tfs->get_alloc_block = gab;\n\t\t\tgoto allocated;\n\t\t}\n\t}\n\tif (!map)\n\t\tmap = fs->block_map;\n\tif (!map)\n\t\treturn EXT2_ET_NO_BLOCK_BITMAP;\n\tif (!goal || (goal >= ext2fs_blocks_count(fs->super)))\n\t\tgoal = fs->super->s_first_data_block;\n\tgoal &= ~EXT2FS_CLUSTER_MASK(fs);\n\n\tretval = ext2fs_find_first_zero_block_bitmap2(map,\n\t\t\tgoal, ext2fs_blocks_count(fs->super) - 1, &b);\n\tif ((retval == ENOENT) && (goal != fs->super->s_first_data_block))\n\t\tretval = ext2fs_find_first_zero_block_bitmap2(map,\n\t\t\tfs->super->s_first_data_block, goal - 1, &b);\nallocated:\n\tif (retval == ENOENT)\n\t\treturn EXT2_ET_BLOCK_ALLOC_FAIL;\n\tif (retval)\n\t\treturn retval;\n\n\text2fs_clear_block_uninit(fs, ext2fs_group_of_blk2(fs, b));\n\t*ret = b;\n\treturn 0;\n}\n\nerrcode_t ext2fs_new_block2(ext2_filsys fs, blk64_t goal,\n\t\t\t   ext2fs_block_bitmap map, blk64_t *ret)\n{\n\treturn ext2fs_new_block3(fs, goal, map, ret, NULL);\n}\n\nerrcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal,\n\t\t\t   ext2fs_block_bitmap map, blk_t *ret)\n{\n\terrcode_t retval;\n\tblk64_t val;\n\tretval = ext2fs_new_block2(fs, goal, map, &val);\n\tif (!retval)\n\t\t*ret = (blk_t) val;\n\treturn retval;\n}\n\n/*\n * This function zeros out the allocated block, and updates all of the\n * appropriate filesystem records.\n */\nerrcode_t ext2fs_alloc_block3(ext2_filsys fs, blk64_t goal, char *block_buf,\n\t\t\t      blk64_t *ret, struct blk_alloc_ctx *ctx)\n{\n\terrcode_t\tretval;\n\tblk64_t\t\tblock;\n\n\tif (fs->get_alloc_block2) {\n\t\tretval = (fs->get_alloc_block2)(fs, goal, &block, ctx);\n\t\tif (retval)\n\t\t\tgoto fail;\n\t} else if (fs->get_alloc_block) {\n\t\tretval = (fs->get_alloc_block)(fs, goal, &block);\n\t\tif (retval)\n\t\t\tgoto fail;\n\t} else {\n\t\tif (!fs->block_map) {\n\t\t\tretval = ext2fs_read_block_bitmap(fs);\n\t\t\tif (retval)\n\t\t\t\tgoto fail;\n\t\t}\n\n\t\tretval = ext2fs_new_block3(fs, goal, 0, &block, ctx);\n\t\tif (retval)\n\t\t\tgoto fail;\n\t}\n\n\tif (block_buf) {\n\t\tmemset(block_buf, 0, fs->blocksize);\n\t\tretval = io_channel_write_blk64(fs->io, block, 1, block_buf);\n\t} else\n\t\tretval = ext2fs_zero_blocks2(fs, block, 1, NULL, NULL);\n\tif (retval)\n\t\tgoto fail;\n\n\text2fs_block_alloc_stats2(fs, block, +1);\n\t*ret = block;\n\nfail:\n\treturn retval;\n}\n\nerrcode_t ext2fs_alloc_block2(ext2_filsys fs, blk64_t goal,\n\t\t\t     char *block_buf, blk64_t *ret)\n{\n\treturn ext2fs_alloc_block3(fs, goal, block_buf, ret, NULL);\n}\n\nerrcode_t ext2fs_alloc_block(ext2_filsys fs, blk_t goal,\n\t\t\t     char *block_buf, blk_t *ret)\n{\n\terrcode_t retval;\n\tblk64_t ret64, goal64 = goal;\n\tretval = ext2fs_alloc_block3(fs, goal64, block_buf, &ret64, NULL);\n\tif (!retval)\n\t\t*ret = (blk_t)ret64;\n        return retval;\n}\n\nerrcode_t ext2fs_get_free_blocks2(ext2_filsys fs, blk64_t start, blk64_t finish,\n\t\t\t\t int num, ext2fs_block_bitmap map, blk64_t *ret)\n{\n\tblk64_t\tb = start;\n\tint\tc_ratio;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif (!map)\n\t\tmap = fs->block_map;\n\tif (!map)\n\t\treturn EXT2_ET_NO_BLOCK_BITMAP;\n\tif (!b)\n\t\tb = fs->super->s_first_data_block;\n\tif (!finish)\n\t\tfinish = start;\n\tif (!num)\n\t\tnum = 1;\n\tc_ratio = 1 << ext2fs_get_bitmap_granularity(map);\n\tb &= ~((blk64_t)c_ratio - 1);\n\tfinish &= ~((blk64_t)c_ratio - 1);\n\tdo {\n\t\tif (b + num - 1 >= ext2fs_blocks_count(fs->super)) {\n\t\t\tif (finish > start)\n\t\t\t\treturn EXT2_ET_BLOCK_ALLOC_FAIL;\n\t\t\tb = fs->super->s_first_data_block;\n\t\t}\n\t\tif (ext2fs_fast_test_block_bitmap_range2(map, b, num)) {\n\t\t\t*ret = b;\n\t\t\treturn 0;\n\t\t}\n\t\tb += c_ratio;\n\t} while (b != finish);\n\treturn EXT2_ET_BLOCK_ALLOC_FAIL;\n}\n\nerrcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start, blk_t finish,\n\t\t\t\t int num, ext2fs_block_bitmap map, blk_t *ret)\n{\n\terrcode_t retval;\n\tblk64_t val;\n\tretval = ext2fs_get_free_blocks2(fs, start, finish, num, map, &val);\n\tif(!retval)\n\t\t*ret = (blk_t) val;\n\treturn retval;\n}\n\nvoid ext2fs_set_alloc_block_callback(ext2_filsys fs,\n\t\t\t\t     errcode_t (*func)(ext2_filsys fs,\n\t\t\t\t\t\t       blk64_t goal,\n\t\t\t\t\t\t       blk64_t *ret),\n\t\t\t\t     errcode_t (**old)(ext2_filsys fs,\n\t\t\t\t\t\t       blk64_t goal,\n\t\t\t\t\t\t       blk64_t *ret))\n{\n\tif (!fs || fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS)\n\t\treturn;\n\n\tif (old)\n\t\t*old = fs->get_alloc_block;\n\n\tfs->get_alloc_block = func;\n}\n\nblk64_t ext2fs_find_inode_goal(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t       struct ext2_inode *inode, blk64_t lblk)\n{\n\tdgrp_t\t\t\tgroup;\n\t__u8\t\t\tlog_flex;\n\tstruct ext2fs_extent\textent;\n\text2_extent_handle_t\thandle = NULL;\n\terrcode_t\t\terr;\n\n\t/* Make sure data stored in inode->i_block is neither fast symlink nor\n\t * inline data.\n\t */\n\tif (inode == NULL || ext2fs_is_fast_symlink(inode) ||\n\t    inode->i_flags & EXT4_INLINE_DATA_FL)\n\t\tgoto no_blocks;\n\n\tif (inode->i_flags & EXT4_EXTENTS_FL) {\n\t\terr = ext2fs_extent_open2(fs, ino, inode, &handle);\n\t\tif (err)\n\t\t\tgoto no_blocks;\n\t\terr = ext2fs_extent_goto2(handle, 0, lblk);\n\t\tif (err)\n\t\t\tgoto no_blocks;\n\t\terr = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT, &extent);\n\t\tif (err)\n\t\t\tgoto no_blocks;\n\t\text2fs_extent_free(handle);\n\t\treturn extent.e_pblk + (lblk - extent.e_lblk);\n\t}\n\n\t/* block mapped file; see if block zero is mapped? */\n\tif (inode->i_block[0])\n\t\treturn inode->i_block[0];\n\nno_blocks:\n\text2fs_extent_free(handle);\n\tlog_flex = fs->super->s_log_groups_per_flex;\n\tgroup = ext2fs_group_of_ino(fs, ino);\n\tif (log_flex)\n\t\tgroup = group & ~((1 << (log_flex)) - 1);\n\treturn ext2fs_group_first_block2(fs, group);\n}\n\n/*\n * Starting at _goal_, scan around the filesystem to find a run of free blocks\n * that's at least _len_ blocks long.  Possible flags:\n * - EXT2_NEWRANGE_EXACT_GOAL: The range of blocks must start at _goal_.\n * - EXT2_NEWRANGE_MIN_LENGTH: do not return a allocation shorter than _len_.\n * - EXT2_NEWRANGE_ZERO_BLOCKS: Zero blocks pblk to pblk+plen before returning.\n *\n * The starting block is returned in _pblk_ and the length is returned via\n * _plen_.  The blocks are not marked in the bitmap; the caller must mark\n * however much of the returned run they actually use, hopefully via\n * ext2fs_block_alloc_stats_range().\n *\n * This function can return a range that is longer than what was requested.\n */\nerrcode_t ext2fs_new_range(ext2_filsys fs, int flags, blk64_t goal,\n\t\t\t   blk64_t len, ext2fs_block_bitmap map, blk64_t *pblk,\n\t\t\t   blk64_t *plen)\n{\n\terrcode_t retval;\n\tblk64_t start, end, b;\n\tint looped = 0;\n\tblk64_t max_blocks = ext2fs_blocks_count(fs->super);\n\terrcode_t (*nrf)(ext2_filsys fs, int flags, blk64_t goal,\n\t\t\t blk64_t len, blk64_t *pblk, blk64_t *plen);\n\n\tdbg_printf(\"%s: flags=0x%x goal=%llu len=%llu\\n\", __func__, flags,\n\t\t   goal, len);\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\tif (len == 0 || (flags & ~EXT2_NEWRANGE_ALL_FLAGS))\n\t\treturn EXT2_ET_INVALID_ARGUMENT;\n\n\tif (!map && fs->new_range) {\n\t\t/*\n\t\t * In case there are clients out there whose new_range\n\t\t * handlers call ext2fs_new_range with a NULL block map,\n\t\t * temporarily swap out the function pointer so that we don't\n\t\t * end up in an infinite loop.\n\t\t */\n\t\tnrf = fs->new_range;\n\t\tfs->new_range = NULL;\n\t\tretval = nrf(fs, flags, goal, len, pblk, plen);\n\t\tfs->new_range = nrf;\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tstart = *pblk;\n\t\tend = *pblk + *plen;\n\t\tgoto allocated;\n\t}\n\tif (!map)\n\t\tmap = fs->block_map;\n\tif (!map)\n\t\treturn EXT2_ET_NO_BLOCK_BITMAP;\n\tif (!goal || goal >= ext2fs_blocks_count(fs->super))\n\t\tgoal = fs->super->s_first_data_block;\n\n\tstart = goal;\n\twhile (!looped || start <= goal) {\n\t\tretval = ext2fs_find_first_zero_block_bitmap2(map, start,\n\t\t\t\t\t\t\t      max_blocks - 1,\n\t\t\t\t\t\t\t      &start);\n\t\tif (retval == ENOENT) {\n\t\t\t/*\n\t\t\t * If there are no free blocks beyond the starting\n\t\t\t * point, try scanning the whole filesystem, unless the\n\t\t\t * user told us only to allocate from _goal_, or if\n\t\t\t * we're already scanning the whole filesystem.\n\t\t\t */\n\t\t\tif (flags & EXT2_NEWRANGE_FIXED_GOAL ||\n\t\t\t    start == fs->super->s_first_data_block)\n\t\t\t\tgoto fail;\n\t\t\tstart = fs->super->s_first_data_block;\n\t\t\tcontinue;\n\t\t} else if (retval)\n\t\t\tgoto errout;\n\n\t\tif (flags & EXT2_NEWRANGE_FIXED_GOAL && start != goal)\n\t\t\tgoto fail;\n\n\t\tb = min(start + len - 1, max_blocks - 1);\n\t\tretval =  ext2fs_find_first_set_block_bitmap2(map, start, b,\n\t\t\t\t\t\t\t      &end);\n\t\tif (retval == ENOENT)\n\t\t\tend = b + 1;\n\t\telse if (retval)\n\t\t\tgoto errout;\n\n\t\tif (!(flags & EXT2_NEWRANGE_MIN_LENGTH) ||\n\t\t    (end - start) >= len) {\n\t\t\t/* Success! */\n\t\t\t*pblk = start;\n\t\t\t*plen = end - start;\n\t\t\tdbg_printf(\"%s: new_range goal=%llu--%llu \"\n\t\t\t\t   \"blk=%llu--%llu %llu\\n\",\n\t\t\t\t   __func__, goal, goal + len - 1,\n\t\t\t\t   *pblk, *pblk + *plen - 1, *plen);\nallocated:\n\t\t\tfor (b = start; b < end;\n\t\t\t     b += fs->super->s_blocks_per_group)\n\t\t\t\text2fs_clear_block_uninit(fs,\n\t\t\t\t\t\text2fs_group_of_blk2(fs, b));\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (flags & EXT2_NEWRANGE_FIXED_GOAL)\n\t\t\tgoto fail;\n\t\tstart = end;\n\t\tif (start >= max_blocks) {\n\t\t\tif (looped)\n\t\t\t\tgoto fail;\n\t\t\tlooped = 1;\n\t\t\tstart = fs->super->s_first_data_block;\n\t\t}\n\t}\n\nfail:\n\tretval = EXT2_ET_BLOCK_ALLOC_FAIL;\nerrout:\n\treturn retval;\n}\n\nvoid ext2fs_set_new_range_callback(ext2_filsys fs,\n\terrcode_t (*func)(ext2_filsys fs, int flags, blk64_t goal,\n\t\t\t       blk64_t len, blk64_t *pblk, blk64_t *plen),\n\terrcode_t (**old)(ext2_filsys fs, int flags, blk64_t goal,\n\t\t\t       blk64_t len, blk64_t *pblk, blk64_t *plen))\n{\n\tif (!fs || fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS)\n\t\treturn;\n\n\tif (old)\n\t\t*old = fs->new_range;\n\n\tfs->new_range = func;\n}\n\nerrcode_t ext2fs_alloc_range(ext2_filsys fs, int flags, blk64_t goal,\n\t\t\t     blk_t len, blk64_t *ret)\n{\n\tint newr_flags = EXT2_NEWRANGE_MIN_LENGTH;\n\terrcode_t retval;\n\tblk64_t plen;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\tif (len == 0 || (flags & ~EXT2_ALLOCRANGE_ALL_FLAGS))\n\t\treturn EXT2_ET_INVALID_ARGUMENT;\n\n\tif (flags & EXT2_ALLOCRANGE_FIXED_GOAL)\n\t\tnewr_flags |= EXT2_NEWRANGE_FIXED_GOAL;\n\n\tretval = ext2fs_new_range(fs, newr_flags, goal, len, NULL, ret, &plen);\n\tif (retval)\n\t\treturn retval;\n\n\tif (plen < len)\n\t\treturn EXT2_ET_BLOCK_ALLOC_FAIL;\n\n\tif (flags & EXT2_ALLOCRANGE_ZERO_BLOCKS) {\n\t\tretval = ext2fs_zero_blocks2(fs, *ret, len, NULL, NULL);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\n\text2fs_block_alloc_stats_range(fs, *ret, len, +1);\n\treturn retval;\n}\n"
  },
  {
    "path": "src/ext2fs/alloc_sb.c",
    "content": "/*\n * alloc_sb.c --- Allocate the superblock and block group descriptors for a\n * newly initialized filesystem.  Used by mke2fs when initializing a filesystem\n *\n * Copyright (C) 1994, 1995, 1996, 2003 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\n/*\n * This function reserves the superblock and block group descriptors\n * for a given block group.  It currently returns the number of free\n * blocks assuming that inode table and allocation bitmaps will be in\n * the group.  This is not necessarily the case when the flex_bg\n * feature is enabled, so callers should take care!  It was only\n * really intended for use by mke2fs, and even there it's not that\n * useful.  In the future, when we redo this function for 64-bit block\n * numbers, we should probably return the number of blocks used by the\n * super block and group descriptors instead.\n *\n * See also the comment for ext2fs_super_and_bgd_loc()\n */\nint ext2fs_reserve_super_and_bgd(ext2_filsys fs,\n\t\t\t\t dgrp_t group,\n\t\t\t\t ext2fs_block_bitmap bmap)\n{\n\tblk64_t\tsuper_blk, old_desc_blk, new_desc_blk;\n\tblk_t\tused_blks;\n\tint\told_desc_blocks, num_blocks;\n\n\text2fs_super_and_bgd_loc2(fs, group, &super_blk,\n\t\t\t\t  &old_desc_blk, &new_desc_blk, &used_blks);\n\n\tif (ext2fs_has_feature_meta_bg(fs->super))\n\t\told_desc_blocks = fs->super->s_first_meta_bg;\n\telse\n\t\told_desc_blocks =\n\t\t\tfs->desc_blocks + fs->super->s_reserved_gdt_blocks;\n\n\tif (super_blk || (group == 0))\n\t\text2fs_mark_block_bitmap2(bmap, super_blk);\n\tif ((group == 0) && (fs->blocksize == 1024) &&\n\t    EXT2FS_CLUSTER_RATIO(fs) > 1)\n\t\text2fs_mark_block_bitmap2(bmap, 0);\n\n\tif (old_desc_blk) {\n\t\tnum_blocks = old_desc_blocks;\n\t\tif (old_desc_blk + num_blocks >= ext2fs_blocks_count(fs->super))\n\t\t\tnum_blocks = ext2fs_blocks_count(fs->super) -\n\t\t\t\told_desc_blk;\n\t\text2fs_mark_block_bitmap_range2(bmap, old_desc_blk, num_blocks);\n\t}\n\tif (new_desc_blk)\n\t\text2fs_mark_block_bitmap2(bmap, new_desc_blk);\n\n\tnum_blocks = ext2fs_group_blocks_count(fs, group);\n\tnum_blocks -= 2 + fs->inode_blocks_per_group + used_blks;\n\n\treturn num_blocks  ;\n}\n"
  },
  {
    "path": "src/ext2fs/alloc_stats.c",
    "content": "/*\n * alloc_stats.c --- Update allocation statistics for ext2fs\n *\n * Copyright (C) 2001 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\nvoid ext2fs_inode_alloc_stats2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t       int inuse, int isdir)\n{\n\tint\tgroup = ext2fs_group_of_ino(fs, ino);\n\n\tif (ino > fs->super->s_inodes_count) {\n#ifndef OMIT_COM_ERR\n\t\tcom_err(\"ext2fs_inode_alloc_stats2\", 0,\n\t\t\t\"Illegal inode number: %lu\", (unsigned long) ino);\n#endif\n\t\treturn;\n\t}\n\tif (inuse > 0)\n\t\text2fs_mark_inode_bitmap2(fs->inode_map, ino);\n\telse\n\t\text2fs_unmark_inode_bitmap2(fs->inode_map, ino);\n\text2fs_bg_free_inodes_count_set(fs, group, ext2fs_bg_free_inodes_count(fs, group) - inuse);\n\tif (isdir)\n\t\text2fs_bg_used_dirs_count_set(fs, group, ext2fs_bg_used_dirs_count(fs, group) + inuse);\n\n\t/* We don't strictly need to be clearing the uninit flag if inuse < 0\n\t * (i.e. freeing inodes) but it also means something is bad. */\n\text2fs_bg_flags_clear(fs, group, EXT2_BG_INODE_UNINIT);\n\tif (ext2fs_has_group_desc_csum(fs)) {\n\t\text2_ino_t first_unused_inode =\tfs->super->s_inodes_per_group -\n\t\t\text2fs_bg_itable_unused(fs, group) +\n\t\t\tgroup * fs->super->s_inodes_per_group + 1;\n\n\t\tif (ino >= first_unused_inode)\n\t\t\text2fs_bg_itable_unused_set(fs, group, group * fs->super->s_inodes_per_group + fs->super->s_inodes_per_group - ino);\n\t\text2fs_group_desc_csum_set(fs, group);\n\t}\n\n\tfs->super->s_free_inodes_count -= inuse;\n\text2fs_mark_super_dirty(fs);\n\text2fs_mark_ib_dirty(fs);\n}\n\nvoid ext2fs_inode_alloc_stats(ext2_filsys fs, ext2_ino_t ino, int inuse)\n{\n\text2fs_inode_alloc_stats2(fs, ino, inuse, 0);\n}\n\nvoid ext2fs_block_alloc_stats2(ext2_filsys fs, blk64_t blk, int inuse)\n{\n\tint\tgroup = ext2fs_group_of_blk2(fs, blk);\n\n\tif (blk >= ext2fs_blocks_count(fs->super)) {\n#ifndef OMIT_COM_ERR\n\t\tcom_err(\"ext2fs_block_alloc_stats\", 0,\n\t\t\t\"Illegal block number: %lu\", (unsigned long) blk);\n#endif\n\t\treturn;\n\t}\n\tif (inuse > 0)\n\t\text2fs_mark_block_bitmap2(fs->block_map, blk);\n\telse\n\t\text2fs_unmark_block_bitmap2(fs->block_map, blk);\n\text2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group) - inuse);\n\text2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT);\n\text2fs_group_desc_csum_set(fs, group);\n\n\text2fs_free_blocks_count_add(fs->super,\n\t\t\t     -inuse * (blk64_t) EXT2FS_CLUSTER_RATIO(fs));\n\text2fs_mark_super_dirty(fs);\n\text2fs_mark_bb_dirty(fs);\n\tif (fs->block_alloc_stats)\n\t\t(fs->block_alloc_stats)(fs, (blk64_t) blk, inuse);\n}\n\nvoid ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse)\n{\n\text2fs_block_alloc_stats2(fs, blk, inuse);\n}\n\nvoid ext2fs_set_block_alloc_stats_callback(ext2_filsys fs,\n\t\t\t\t\t   void (*func)(ext2_filsys fs,\n\t\t\t\t\t\t\tblk64_t blk,\n\t\t\t\t\t\t\tint inuse),\n\t\t\t\t\t   void (**old)(ext2_filsys fs,\n\t\t\t\t\t\t\tblk64_t blk,\n\t\t\t\t\t\t\tint inuse))\n{\n\tif (!fs || fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS)\n\t\treturn;\n\tif (old)\n\t\t*old = fs->block_alloc_stats;\n\n\tfs->block_alloc_stats = func;\n}\n\nvoid ext2fs_block_alloc_stats_range(ext2_filsys fs, blk64_t blk,\n\t\t\t\t    blk_t num, int inuse)\n{\n#ifndef OMIT_COM_ERR\n\tif (blk + num > ext2fs_blocks_count(fs->super)) {\n\t\tcom_err(\"ext2fs_block_alloc_stats_range\", 0,\n\t\t\t\"Illegal block range: %llu (%u) \",\n\t\t\t(unsigned long long) blk, num);\n\t\treturn;\n\t}\n#endif\n\tif (inuse == 0)\n\t\treturn;\n\tif (inuse > 0) {\n\t\text2fs_mark_block_bitmap_range2(fs->block_map, blk, num);\n\t\tinuse = 1;\n\t} else {\n\t\text2fs_unmark_block_bitmap_range2(fs->block_map, blk, num);\n\t\tinuse = -1;\n\t}\n\twhile (num) {\n\t\tint group = ext2fs_group_of_blk2(fs, blk);\n\t\tblk64_t last_blk = ext2fs_group_last_block2(fs, group);\n\t\tblk64_t n = num;\n\n\t\tif (blk + num > last_blk)\n\t\t\tn = last_blk - blk + 1;\n\n\t\text2fs_bg_free_blocks_count_set(fs, group,\n\t\t\text2fs_bg_free_blocks_count(fs, group) -\n\t\t\tinuse*n/EXT2FS_CLUSTER_RATIO(fs));\n\t\text2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT);\n\t\text2fs_group_desc_csum_set(fs, group);\n\t\text2fs_free_blocks_count_add(fs->super, -inuse * (blk64_t) n);\n\t\tblk += n;\n\t\tnum -= n;\n\t}\n\text2fs_mark_super_dirty(fs);\n\text2fs_mark_bb_dirty(fs);\n\tif (fs->block_alloc_stats_range)\n\t\t(fs->block_alloc_stats_range)(fs, blk, num, inuse);\n}\n\nvoid ext2fs_set_block_alloc_stats_range_callback(ext2_filsys fs,\n\tvoid (*func)(ext2_filsys fs, blk64_t blk,\n\t\t\t\t    blk_t num, int inuse),\n\tvoid (**old)(ext2_filsys fs, blk64_t blk,\n\t\t\t\t    blk_t num, int inuse))\n{\n\tif (!fs || fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS)\n\t\treturn;\n\tif (old)\n\t\t*old = fs->block_alloc_stats_range;\n\n\tfs->block_alloc_stats_range = func;\n}\n"
  },
  {
    "path": "src/ext2fs/alloc_tables.c",
    "content": "/*\n * alloc_tables.c --- Allocate tables for a newly initialized\n * filesystem.  Used by mke2fs when initializing a filesystem\n *\n * Copyright (C) 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n#include \"ext2fsP.h\"\n\n/*\n * This routine searches for free blocks that can allocate a full\n * group of bitmaps or inode tables for a flexbg group.  Returns the\n * block number with a correct offset were the bitmaps and inode\n * tables can be allocated continuously and in order.\n */\nstatic blk64_t flexbg_offset(ext2_filsys fs, dgrp_t group, blk64_t start_blk,\n\t\t\t     ext2fs_block_bitmap bmap, int rem_grp,\n\t\t\t     int elem_size)\n{\n\tint\t\tflexbg, flexbg_size, size;\n\tblk64_t\t\tlast_blk, first_free = 0;\n\tdgrp_t\t       \tlast_grp;\n\n\tflexbg_size = 1 << fs->super->s_log_groups_per_flex;\n\tflexbg = group / flexbg_size;\n\tsize = rem_grp * elem_size;\n\n\tif (size > (int) (fs->super->s_blocks_per_group / 4))\n\t\tsize = (int) fs->super->s_blocks_per_group / 4;\n\n\t/*\n\t * Don't do a long search if the previous block search is still valid,\n\t * but skip minor obstructions such as group descriptor backups.\n\t */\n\tif (start_blk && start_blk < ext2fs_blocks_count(fs->super) &&\n\t    ext2fs_get_free_blocks2(fs, start_blk, start_blk + size, elem_size,\n\t\t\t\t    bmap, &first_free) == 0)\n\t\treturn first_free;\n\n\tstart_blk = ext2fs_group_first_block2(fs, flexbg_size * flexbg);\n\tlast_grp = group | (flexbg_size - 1);\n\tif (last_grp > fs->group_desc_count-1)\n\t\tlast_grp = fs->group_desc_count-1;\n\tlast_blk = ext2fs_group_last_block2(fs, last_grp);\n\n\t/* Find the first available block */\n\tif (ext2fs_get_free_blocks2(fs, start_blk, last_blk, size,\n\t\t\t\t    bmap, &first_free) == 0)\n\t\treturn first_free;\n\n\tif (ext2fs_get_free_blocks2(fs, start_blk, last_blk, elem_size,\n\t\t\t\t   bmap, &first_free) == 0)\n\t\treturn first_free;\n\n\tif (ext2fs_get_free_blocks2(fs, 0, last_blk, elem_size, bmap,\n\t\t\t\t    &first_free) == 0)\n\t\treturn first_free;\n\n\treturn first_free;\n}\n\nerrcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group,\n\t\t\t\t      ext2fs_block_bitmap bmap)\n{\n\terrcode_t\tretval;\n\tblk64_t\t\tgroup_blk, start_blk, last_blk, new_blk;\n\tdgrp_t\t\tlast_grp = 0;\n\tint\t\trem_grps = 0, flexbg_size = 0, table_offset = 0;\n\n\tgroup_blk = ext2fs_group_first_block2(fs, group);\n\tlast_blk = ext2fs_group_last_block2(fs, group);\n\n\tif (!bmap)\n\t\tbmap = fs->block_map;\n\n\tif (ext2fs_has_feature_flex_bg(fs->super) &&\n\t    fs->super->s_log_groups_per_flex) {\n\t\tflexbg_size = 1 << fs->super->s_log_groups_per_flex;\n\t\tlast_grp = group | (flexbg_size - 1);\n\t\tif (last_grp > fs->group_desc_count-1)\n\t\t\tlast_grp = fs->group_desc_count-1;\n\t\trem_grps = last_grp - group + 1;\n\t}\n\n\t/*\n\t * Allocate the block and inode bitmaps, if necessary\n\t */\n\tif (fs->stride && !flexbg_size) {\n\t\tretval = ext2fs_get_free_blocks2(fs, group_blk, last_blk,\n\t\t\t\t\t\t 1, bmap, &start_blk);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tstart_blk += fs->inode_blocks_per_group;\n\t\tstart_blk += (((blk64_t)fs->stride * group) %\n\t\t\t      (last_blk - start_blk + 1));\n\t\tif (start_blk >= last_blk)\n\t\t\tstart_blk = group_blk;\n\t} else\n\t\tstart_blk = group_blk;\n\n\tif (flexbg_size) {\n\t\tblk64_t prev_block = 0;\n\n\t\ttable_offset = flexbg_size;\n\t\tif (group % flexbg_size)\n\t\t\tprev_block = ext2fs_block_bitmap_loc(fs, group - 1) + 1;\n\t\telse if (last_grp == fs->group_desc_count-1) {\n\t\t\t/*\n\t\t\t * If we are allocating for the last flex_bg\n\t\t\t * keep the metadata tables contiguous\n\t\t\t */\n\t\t\ttable_offset = last_grp & (flexbg_size - 1);\n\t\t\tif (table_offset == 0)\n\t\t\t\ttable_offset = flexbg_size;\n\t\t\telse\n\t\t\t\ttable_offset++;\n\t\t}\n\t\t/* FIXME: Take backup group descriptor blocks into account\n\t\t * if the flexbg allocations will grow to overlap them... */\n\t\tstart_blk = flexbg_offset(fs, group, prev_block, bmap,\n\t\t\t\t\t  rem_grps, 1);\n\t\tlast_blk = ext2fs_group_last_block2(fs, last_grp);\n\t}\n\n\tif (!ext2fs_block_bitmap_loc(fs, group)) {\n\t\tretval = ext2fs_get_free_blocks2(fs, start_blk, last_blk,\n\t\t\t\t\t\t 1, bmap, &new_blk);\n\t\tif (retval == EXT2_ET_BLOCK_ALLOC_FAIL)\n\t\t\tretval = ext2fs_get_free_blocks2(fs, group_blk,\n\t\t\t\t\tlast_blk, 1, bmap, &new_blk);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\text2fs_mark_block_bitmap2(bmap, new_blk);\n\t\text2fs_block_bitmap_loc_set(fs, group, new_blk);\n\t\tif (flexbg_size) {\n\t\t\tdgrp_t gr = ext2fs_group_of_blk2(fs, new_blk);\n\t\t\text2fs_bg_free_blocks_count_set(fs, gr, ext2fs_bg_free_blocks_count(fs, gr) - 1);\n\t\t\text2fs_free_blocks_count_add(fs->super, -1);\n\t\t\text2fs_bg_flags_clear(fs, gr, EXT2_BG_BLOCK_UNINIT);\n\t\t\text2fs_group_desc_csum_set(fs, gr);\n\t\t}\n\t}\n\n\tif (flexbg_size) {\n\t\tblk64_t prev_block = 0;\n\t\tif (group % flexbg_size)\n\t\t\tprev_block = ext2fs_inode_bitmap_loc(fs, group - 1) + 1;\n\t\telse\n\t\t\tprev_block = ext2fs_block_bitmap_loc(fs, group) +\n\t\t\t\ttable_offset;\n\t\t/* FIXME: Take backup group descriptor blocks into account\n\t\t * if the flexbg allocations will grow to overlap them... */\n\t\tstart_blk = flexbg_offset(fs, group, prev_block, bmap,\n\t\t\t\t\t  rem_grps, 1);\n\t\tlast_blk = ext2fs_group_last_block2(fs, last_grp);\n\t}\n\n\tif (!ext2fs_inode_bitmap_loc(fs, group)) {\n\t\tretval = ext2fs_get_free_blocks2(fs, start_blk, last_blk,\n\t\t\t\t\t\t 1, bmap, &new_blk);\n\t\tif (retval == EXT2_ET_BLOCK_ALLOC_FAIL)\n\t\t\tretval = ext2fs_get_free_blocks2(fs, group_blk,\n\t\t\t\t\t last_blk, 1, bmap, &new_blk);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\text2fs_mark_block_bitmap2(bmap, new_blk);\n\t\text2fs_inode_bitmap_loc_set(fs, group, new_blk);\n\t\tif (flexbg_size) {\n\t\t\tdgrp_t gr = ext2fs_group_of_blk2(fs, new_blk);\n\t\t\text2fs_bg_free_blocks_count_set(fs, gr, ext2fs_bg_free_blocks_count(fs, gr) - 1);\n\t\t\text2fs_free_blocks_count_add(fs->super, -1);\n\t\t\text2fs_bg_flags_clear(fs, gr, EXT2_BG_BLOCK_UNINIT);\n\t\t\text2fs_group_desc_csum_set(fs, gr);\n\t\t}\n\t}\n\n\t/*\n\t * Allocate the inode table\n\t */\n\tif (flexbg_size) {\n\t\tblk64_t prev_block = 0;\n\n\t\tif (group % flexbg_size)\n\t\t\tprev_block = ext2fs_inode_table_loc(fs, group - 1) +\n\t\t\t\tfs->inode_blocks_per_group;\n\t\telse\n\t\t\tprev_block = ext2fs_inode_bitmap_loc(fs, group) +\n\t\t\t\ttable_offset;\n\n\t\t/* FIXME: Take backup group descriptor blocks into account\n\t\t * if the flexbg allocations will grow to overlap them... */\n\t\tgroup_blk = flexbg_offset(fs, group, prev_block, bmap,\n\t\t\t\t\t  rem_grps, fs->inode_blocks_per_group);\n\t\tlast_blk = ext2fs_group_last_block2(fs, last_grp);\n\t}\n\n\tif (!ext2fs_inode_table_loc(fs, group)) {\n\t\tretval = ext2fs_get_free_blocks2(fs, group_blk, last_blk,\n\t\t\t\t\t\tfs->inode_blocks_per_group,\n\t\t\t\t\t\tbmap, &new_blk);\n\t\tif (retval)\n\t\t\treturn retval;\n\n\t\text2fs_mark_block_bitmap_range2(bmap,\n\t\t\tnew_blk, fs->inode_blocks_per_group);\n\t\tif (flexbg_size) {\n\t\t\tblk64_t num, blk;\n\t\t\tnum = fs->inode_blocks_per_group;\n\t\t\tblk = new_blk;\n\t\t\twhile (num) {\n\t\t\t\tint gr = ext2fs_group_of_blk2(fs, blk);\n\t\t\t\tlast_blk = ext2fs_group_last_block2(fs, gr);\n\t\t\t\tblk64_t n = num;\n\n\t\t\t\tif (blk + num > last_blk)\n\t\t\t\t\tn = last_blk - blk + 1;\n\n\t\t\t\text2fs_bg_free_blocks_count_set(fs, gr,\n\t\t\t\t\text2fs_bg_free_blocks_count(fs, gr) -\n\t\t\t\t\tn/EXT2FS_CLUSTER_RATIO(fs));\n\t\t\t\text2fs_bg_flags_clear(fs, gr,\n\t\t\t\t\tEXT2_BG_BLOCK_UNINIT);\n\t\t\t\text2fs_group_desc_csum_set(fs, gr);\n\t\t\t\text2fs_free_blocks_count_add(fs->super, -n);\n\t\t\t\tblk += n;\n\t\t\t\tnum -= n;\n\t\t\t}\n\t\t}\n\t\text2fs_inode_table_loc_set(fs, group, new_blk);\n\t}\n\text2fs_group_desc_csum_set(fs, group);\n\treturn 0;\n}\n\nerrcode_t ext2fs_allocate_tables(ext2_filsys fs)\n{\n\terrcode_t\tretval;\n\tdgrp_t\t\ti;\n\tstruct ext2fs_numeric_progress_struct progress;\n\n\tif (fs->progress_ops && fs->progress_ops->init)\n\t\t(fs->progress_ops->init)(fs, &progress, NULL,\n\t\t\t\t\t fs->group_desc_count);\n\n\tfor (i = 0; i < fs->group_desc_count; i++) {\n\t\tif (fs->progress_ops && fs->progress_ops->update)\n\t\t\t(fs->progress_ops->update)(fs, &progress, i);\n\t\tretval = ext2fs_allocate_group_table(fs, i, fs->block_map);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\tif (fs->progress_ops && fs->progress_ops->close)\n\t\t(fs->progress_ops->close)(fs, &progress, NULL);\n\treturn 0;\n}\n\n"
  },
  {
    "path": "src/ext2fs/badblocks.c",
    "content": "/*\n * badblocks.c --- routines to manipulate the bad block structure\n *\n * Copyright (C) 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n\n/*\n * Helper function for making a badblocks list\n */\nstatic errcode_t make_u32_list(int size, int num, __u32 *list,\n\t\t\t       ext2_u32_list *ret)\n{\n\text2_u32_list\tbb;\n\terrcode_t\tretval;\n\n\tretval = ext2fs_get_mem(sizeof(struct ext2_struct_u32_list), &bb);\n\tif (retval)\n\t\treturn retval;\n\tmemset(bb, 0, sizeof(struct ext2_struct_u32_list));\n\tbb->magic = EXT2_ET_MAGIC_BADBLOCKS_LIST;\n\tbb->size = size ? size : 10;\n\tbb->num = num;\n\tretval = ext2fs_get_array(bb->size, sizeof(blk_t), &bb->list);\n\tif (retval) {\n\t\text2fs_free_mem(&bb);\n\t\treturn retval;\n\t}\n\tif (list)\n\t\tmemcpy(bb->list, list, bb->size * sizeof(blk_t));\n\telse\n\t\tmemset(bb->list, 0, bb->size * sizeof(blk_t));\n\t*ret = bb;\n\treturn 0;\n}\n\n\n/*\n * This procedure creates an empty u32 list.\n */\nerrcode_t ext2fs_u32_list_create(ext2_u32_list *ret, int size)\n{\n\treturn make_u32_list(size, 0, 0, ret);\n}\n\n/*\n * This procedure creates an empty badblocks list.\n */\nerrcode_t ext2fs_badblocks_list_create(ext2_badblocks_list *ret, int size)\n{\n\treturn make_u32_list(size, 0, 0, (ext2_badblocks_list *) ret);\n}\n\n\n/*\n * This procedure copies a badblocks list\n */\nerrcode_t ext2fs_u32_copy(ext2_u32_list src, ext2_u32_list *dest)\n{\n\terrcode_t\tretval;\n\n\tretval = make_u32_list(src->size, src->num, src->list, dest);\n\tif (retval)\n\t\treturn retval;\n\t(*dest)->badblocks_flags = src->badblocks_flags;\n\treturn 0;\n}\n\nerrcode_t ext2fs_badblocks_copy(ext2_badblocks_list src,\n\t\t\t\text2_badblocks_list *dest)\n{\n\treturn ext2fs_u32_copy((ext2_u32_list) src,\n\t\t\t       (ext2_u32_list *) dest);\n}\n\n/*\n * This procedure frees a badblocks list.\n *\n * (note: moved to closefs.c)\n */\n\n\n/*\n * This procedure adds a block to a badblocks list.\n */\nerrcode_t ext2fs_u32_list_add(ext2_u32_list bb, __u32 blk)\n{\n\terrcode_t\tretval;\n\tint\t\ti, j;\n\tunsigned long\told_size;\n\n\tEXT2_CHECK_MAGIC(bb, EXT2_ET_MAGIC_BADBLOCKS_LIST);\n\n\tif (bb->num >= bb->size) {\n\t\told_size = bb->size * sizeof(__u32);\n\t\tbb->size += 100;\n\t\tretval = ext2fs_resize_mem(old_size, bb->size * sizeof(__u32),\n\t\t\t\t\t   &bb->list);\n\t\tif (retval) {\n\t\t\tbb->size -= 100;\n\t\t\treturn retval;\n\t\t}\n\t}\n\n\t/*\n\t * Add special case code for appending to the end of the list\n\t */\n\ti = bb->num-1;\n\tif ((bb->num != 0) && (bb->list[i] == blk))\n\t\treturn 0;\n\tif ((bb->num == 0) || (bb->list[i] < blk)) {\n\t\tbb->list[bb->num++] = blk;\n\t\treturn 0;\n\t}\n\n\tj = bb->num;\n\tfor (i=0; i < bb->num; i++) {\n\t\tif (bb->list[i] == blk)\n\t\t\treturn 0;\n\t\tif (bb->list[i] > blk) {\n\t\t\tj = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tfor (i=bb->num; i > j; i--)\n\t\tbb->list[i] = bb->list[i-1];\n\tbb->list[j] = blk;\n\tbb->num++;\n\treturn 0;\n}\n\nerrcode_t ext2fs_badblocks_list_add(ext2_badblocks_list bb, blk_t blk)\n{\n\treturn ext2fs_u32_list_add((ext2_u32_list) bb, (__u32) blk);\n}\n\n/*\n * This procedure finds a particular block is on a badblocks\n * list.\n */\nint ext2fs_u32_list_find(ext2_u32_list bb, __u32 blk)\n{\n\tint\tlow, high, mid;\n\n\tif (bb->magic != EXT2_ET_MAGIC_BADBLOCKS_LIST)\n\t\treturn -1;\n\n\tif (bb->num == 0)\n\t\treturn -1;\n\n\tlow = 0;\n\thigh = bb->num-1;\n\tif (blk == bb->list[low])\n\t\treturn low;\n\tif (blk == bb->list[high])\n\t\treturn high;\n\n\twhile (low < high) {\n\t\tmid = ((unsigned)low + (unsigned)high)/2;\n\t\tif (mid == low || mid == high)\n\t\t\tbreak;\n\t\tif (blk == bb->list[mid])\n\t\t\treturn mid;\n\t\tif (blk < bb->list[mid])\n\t\t\thigh = mid;\n\t\telse\n\t\t\tlow = mid;\n\t}\n\treturn -1;\n}\n\n/*\n * This procedure tests to see if a particular block is on a badblocks\n * list.\n */\nint ext2fs_u32_list_test(ext2_u32_list bb, __u32 blk)\n{\n\tif (ext2fs_u32_list_find(bb, blk) < 0)\n\t\treturn 0;\n\telse\n\t\treturn 1;\n}\n\nint ext2fs_badblocks_list_test(ext2_badblocks_list bb, blk_t blk)\n{\n\treturn ext2fs_u32_list_test((ext2_u32_list) bb, (__u32) blk);\n}\n\n\n/*\n * Remove a block from the badblock list\n */\nint ext2fs_u32_list_del(ext2_u32_list bb, __u32 blk)\n{\n\tint\tremloc, i;\n\n\tif (bb->num == 0)\n\t\treturn -1;\n\n\tremloc = ext2fs_u32_list_find(bb, blk);\n\tif (remloc < 0)\n\t\treturn -1;\n\n\tfor (i = remloc ; i < bb->num-1; i++)\n\t\tbb->list[i] = bb->list[i+1];\n\tbb->num--;\n\treturn 0;\n}\n\nvoid ext2fs_badblocks_list_del(ext2_u32_list bb, __u32 blk)\n{\n\text2fs_u32_list_del(bb, blk);\n}\n\nerrcode_t ext2fs_u32_list_iterate_begin(ext2_u32_list bb,\n\t\t\t\t\text2_u32_iterate *ret)\n{\n\text2_u32_iterate iter;\n\terrcode_t\t\tretval;\n\n\tEXT2_CHECK_MAGIC(bb, EXT2_ET_MAGIC_BADBLOCKS_LIST);\n\n\tretval = ext2fs_get_mem(sizeof(struct ext2_struct_u32_iterate), &iter);\n\tif (retval)\n\t\treturn retval;\n\n\titer->magic = EXT2_ET_MAGIC_BADBLOCKS_ITERATE;\n\titer->bb = bb;\n\titer->ptr = 0;\n\t*ret = iter;\n\treturn 0;\n}\n\nerrcode_t ext2fs_badblocks_list_iterate_begin(ext2_badblocks_list bb,\n\t\t\t\t\t      ext2_badblocks_iterate *ret)\n{\n\treturn ext2fs_u32_list_iterate_begin((ext2_u32_list) bb,\n\t\t\t\t\t      (ext2_u32_iterate *) ret);\n}\n\n\nint ext2fs_u32_list_iterate(ext2_u32_iterate iter, __u32 *blk)\n{\n\text2_u32_list\tbb;\n\n\tif (iter->magic != EXT2_ET_MAGIC_BADBLOCKS_ITERATE)\n\t\treturn 0;\n\n\tbb = iter->bb;\n\n\tif (bb->magic != EXT2_ET_MAGIC_BADBLOCKS_LIST)\n\t\treturn 0;\n\n\tif (iter->ptr < bb->num) {\n\t\t*blk = bb->list[iter->ptr++];\n\t\treturn 1;\n\t}\n\t*blk = 0;\n\treturn 0;\n}\n\nint ext2fs_badblocks_list_iterate(ext2_badblocks_iterate iter, blk_t *blk)\n{\n\treturn ext2fs_u32_list_iterate((ext2_u32_iterate) iter,\n\t\t\t\t       (__u32 *) blk);\n}\n\n\nvoid ext2fs_u32_list_iterate_end(ext2_u32_iterate iter)\n{\n\tif (!iter || (iter->magic != EXT2_ET_MAGIC_BADBLOCKS_ITERATE))\n\t\treturn;\n\n\titer->bb = 0;\n\text2fs_free_mem(&iter);\n}\n\nvoid ext2fs_badblocks_list_iterate_end(ext2_badblocks_iterate iter)\n{\n\text2fs_u32_list_iterate_end((ext2_u32_iterate) iter);\n}\n\n\nint ext2fs_u32_list_equal(ext2_u32_list bb1, ext2_u32_list bb2)\n{\n\tEXT2_CHECK_MAGIC(bb1, EXT2_ET_MAGIC_BADBLOCKS_LIST);\n\tEXT2_CHECK_MAGIC(bb2, EXT2_ET_MAGIC_BADBLOCKS_LIST);\n\n\tif (bb1->num != bb2->num)\n\t\treturn 0;\n\n\tif (memcmp(bb1->list, bb2->list, bb1->num * sizeof(blk_t)) != 0)\n\t\treturn 0;\n\treturn 1;\n}\n\nint ext2fs_badblocks_equal(ext2_badblocks_list bb1, ext2_badblocks_list bb2)\n{\n\treturn ext2fs_u32_list_equal((ext2_u32_list) bb1,\n\t\t\t\t     (ext2_u32_list) bb2);\n}\n\nint ext2fs_u32_list_count(ext2_u32_list bb)\n{\n\treturn bb->num;\n}\n"
  },
  {
    "path": "src/ext2fs/bb_inode.c",
    "content": "/*\n * bb_inode.c --- routines to update the bad block inode.\n *\n * WARNING: This routine modifies a lot of state in the filesystem; if\n * this routine returns an error, the bad block inode may be in an\n * inconsistent state.\n *\n * Copyright (C) 1994, 1995 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\nstruct set_badblock_record {\n\text2_badblocks_iterate\tbb_iter;\n\tint\t\tbad_block_count;\n\tblk_t\t\t*ind_blocks;\n\tint\t\tmax_ind_blocks;\n\tint\t\tind_blocks_size;\n\tint\t\tind_blocks_ptr;\n\tchar\t\t*block_buf;\n\terrcode_t\terr;\n};\n\nstatic int set_bad_block_proc(ext2_filsys fs, blk_t *block_nr,\n\t\t\t      e2_blkcnt_t blockcnt,\n\t\t\t      blk_t ref_block, int ref_offset,\n\t\t\t      void *priv_data);\nstatic int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr,\n\t\t\t\te2_blkcnt_t blockcnt,\n\t\t\t\tblk_t ref_block, int ref_offset,\n\t\t\t\tvoid *priv_data);\n\n/*\n * Given a bad blocks bitmap, update the bad blocks inode to reflect\n * the map.\n */\nerrcode_t ext2fs_update_bb_inode(ext2_filsys fs, ext2_badblocks_list bb_list)\n{\n\terrcode_t\t\t\tretval;\n\tstruct set_badblock_record \trec;\n\tstruct ext2_inode\t\tinode;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif (!fs->block_map)\n\t\treturn EXT2_ET_NO_BLOCK_BITMAP;\n\n\tmemset(&rec, 0, sizeof(rec));\n\trec.max_ind_blocks = 10;\n\tretval = ext2fs_get_array(rec.max_ind_blocks, sizeof(blk_t),\n\t\t\t\t&rec.ind_blocks);\n\tif (retval)\n\t\treturn retval;\n\tmemset(rec.ind_blocks, 0, rec.max_ind_blocks * sizeof(blk_t));\n\tretval = ext2fs_get_mem(fs->blocksize, &rec.block_buf);\n\tif (retval)\n\t\tgoto cleanup;\n\tmemset(rec.block_buf, 0, fs->blocksize);\n\trec.err = 0;\n\n\t/*\n\t * First clear the old bad blocks (while saving the indirect blocks)\n\t */\n\tretval = ext2fs_block_iterate2(fs, EXT2_BAD_INO,\n\t\t\t\t       BLOCK_FLAG_DEPTH_TRAVERSE, 0,\n\t\t\t\t       clear_bad_block_proc, &rec);\n\tif (retval)\n\t\tgoto cleanup;\n\tif (rec.err) {\n\t\tretval = rec.err;\n\t\tgoto cleanup;\n\t}\n\n\t/*\n\t * Now set the bad blocks!\n\t *\n\t * First, mark the bad blocks as used.  This prevents a bad\n\t * block from being used as an indirect block for the bad\n\t * block inode (!).\n\t */\n\tif (bb_list) {\n\t\tretval = ext2fs_badblocks_list_iterate_begin(bb_list,\n\t\t\t\t\t\t\t     &rec.bb_iter);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t\tretval = ext2fs_block_iterate2(fs, EXT2_BAD_INO,\n\t\t\t\t\t       BLOCK_FLAG_APPEND, 0,\n\t\t\t\t\t       set_bad_block_proc, &rec);\n\t\text2fs_badblocks_list_iterate_end(rec.bb_iter);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t\tif (rec.err) {\n\t\t\tretval = rec.err;\n\t\t\tgoto cleanup;\n\t\t}\n\t}\n\n\t/*\n\t * Update the bad block inode's mod time and block count\n\t * field.\n\t */\n\tretval = ext2fs_read_inode(fs, EXT2_BAD_INO, &inode);\n\tif (retval)\n\t\tgoto cleanup;\n\n\tinode.i_atime = inode.i_mtime = fs->now ? fs->now : time(0);\n\tif (!inode.i_ctime)\n\t\tinode.i_ctime = fs->now ? fs->now : time(0);\n\text2fs_iblk_set(fs, &inode, rec.bad_block_count);\n\tretval = ext2fs_inode_size_set(fs, &inode,\n\t\t\t\t       (ext2_off64_t)rec.bad_block_count * fs->blocksize);\n\tif (retval)\n\t\tgoto cleanup;\n\n\tretval = ext2fs_write_inode(fs, EXT2_BAD_INO, &inode);\n\tif (retval)\n\t\tgoto cleanup;\n\ncleanup:\n\text2fs_free_mem(&rec.ind_blocks);\n\text2fs_free_mem(&rec.block_buf);\n\treturn retval;\n}\n\n/*\n * Helper function for update_bb_inode()\n *\n * Clear the bad blocks in the bad block inode, while saving the\n * indirect blocks.\n */\n#ifdef __TURBOC__\n #pragma argsused\n#endif\nstatic int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr,\n\t\t\t\te2_blkcnt_t blockcnt,\n\t\t\t\tblk_t ref_block EXT2FS_ATTR((unused)),\n\t\t\t\tint ref_offset EXT2FS_ATTR((unused)),\n\t\t\t\tvoid *priv_data)\n{\n\tstruct set_badblock_record *rec = (struct set_badblock_record *)\n\t\tpriv_data;\n\terrcode_t\tretval;\n\tunsigned long \told_size;\n\n\tif (!*block_nr)\n\t\treturn 0;\n\n\t/*\n\t * If the block number is outrageous, clear it and ignore it.\n\t */\n\tif (*block_nr >= ext2fs_blocks_count(fs->super) ||\n\t    *block_nr < fs->super->s_first_data_block) {\n\t\t*block_nr = 0;\n\t\treturn BLOCK_CHANGED;\n\t}\n\n\tif (blockcnt < 0) {\n\t\tif (rec->ind_blocks_size >= rec->max_ind_blocks) {\n\t\t\told_size = rec->max_ind_blocks * sizeof(blk_t);\n\t\t\trec->max_ind_blocks += 10;\n\t\t\tretval = ext2fs_resize_mem(old_size,\n\t\t\t\t   rec->max_ind_blocks * sizeof(blk_t),\n\t\t\t\t   &rec->ind_blocks);\n\t\t\tif (retval) {\n\t\t\t\trec->max_ind_blocks -= 10;\n\t\t\t\trec->err = retval;\n\t\t\t\treturn BLOCK_ABORT;\n\t\t\t}\n\t\t}\n\t\trec->ind_blocks[rec->ind_blocks_size++] = *block_nr;\n\t}\n\n\t/*\n\t * Mark the block as unused, and update accounting information\n\t */\n\text2fs_block_alloc_stats2(fs, *block_nr, -1);\n\n\t*block_nr = 0;\n\treturn BLOCK_CHANGED;\n}\n\n\n/*\n * Helper function for update_bb_inode()\n *\n * Set the block list in the bad block inode, using the supplied bitmap.\n */\n#ifdef __TURBOC__\n #pragma argsused\n#endif\nstatic int set_bad_block_proc(ext2_filsys fs, blk_t *block_nr,\n\t\t\t      e2_blkcnt_t blockcnt,\n\t\t\t      blk_t ref_block EXT2FS_ATTR((unused)),\n\t\t\t      int ref_offset EXT2FS_ATTR((unused)),\n\t\t\t      void *priv_data)\n{\n\tstruct set_badblock_record *rec = (struct set_badblock_record *)\n\t\tpriv_data;\n\terrcode_t\tretval;\n\tblk_t\t\tblk;\n\n\tif (blockcnt >= 0) {\n\t\t/*\n\t\t * Get the next bad block.\n\t\t */\n\t\tif (!ext2fs_badblocks_list_iterate(rec->bb_iter, &blk))\n\t\t\treturn BLOCK_ABORT;\n\t\trec->bad_block_count++;\n\t} else {\n\t\t/*\n\t\t * An indirect block; fetch a block from the\n\t\t * previously used indirect block list.  The block\n\t\t * most be not marked as used; if so, get another one.\n\t\t * If we run out of reserved indirect blocks, allocate\n\t\t * a new one.\n\t\t */\n\tretry:\n\t\tif (rec->ind_blocks_ptr < rec->ind_blocks_size) {\n\t\t\tblk = rec->ind_blocks[rec->ind_blocks_ptr++];\n\t\t\tif (ext2fs_test_block_bitmap2(fs->block_map, blk))\n\t\t\t\tgoto retry;\n\t\t} else {\n\t\t\tretval = ext2fs_new_block(fs, 0, 0, &blk);\n\t\t\tif (retval) {\n\t\t\t\trec->err = retval;\n\t\t\t\treturn BLOCK_ABORT;\n\t\t\t}\n\t\t}\n\t\tretval = io_channel_write_blk64(fs->io, blk, 1, rec->block_buf);\n\t\tif (retval) {\n\t\t\trec->err = retval;\n\t\t\treturn BLOCK_ABORT;\n\t\t}\n\t}\n\n\t/*\n\t * Update block counts\n\t */\n\text2fs_block_alloc_stats2(fs, blk, +1);\n\n\t*block_nr = blk;\n\treturn BLOCK_CHANGED;\n}\n\n\n\n\n\n\n"
  },
  {
    "path": "src/ext2fs/bitmaps.c",
    "content": "/*\n * bitmaps.c --- routines to read, write, and manipulate the inode and\n * block bitmaps.\n *\n * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n#include \"ext2fsP.h\"\n#include \"bmap64.h\"\n\nvoid ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap)\n{\n\text2fs_free_generic_bmap(bitmap);\n}\n\nvoid ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap)\n{\n\text2fs_free_generic_bmap(bitmap);\n}\n\nerrcode_t ext2fs_copy_bitmap(ext2fs_generic_bitmap src,\n\t\t\t     ext2fs_generic_bitmap *dest)\n{\n\treturn (ext2fs_copy_generic_bmap(src, dest));\n}\nvoid ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map)\n{\n\text2fs_set_generic_bmap_padding(map);\n}\n\nerrcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs,\n\t\t\t\t       const char *descr,\n\t\t\t\t       ext2fs_inode_bitmap *ret)\n{\n\t__u64\t\tstart, end, real_end;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tfs->write_bitmaps = ext2fs_write_bitmaps;\n\n\tstart = 1;\n\tend = fs->super->s_inodes_count;\n\treal_end = ((__u64)EXT2_INODES_PER_GROUP(fs->super) * fs->group_desc_count);\n\n\t/* Are we permitted to use new-style bitmaps? */\n\tif (fs->flags & EXT2_FLAG_64BITS)\n\t\treturn (ext2fs_alloc_generic_bmap(fs,\n\t\t\t\tEXT2_ET_MAGIC_INODE_BITMAP64,\n\t\t\t\tfs->default_bitmap_type,\n\t\t\t\tstart, end, real_end, descr, ret));\n\n\t/* Otherwise, check to see if the file system is small enough\n\t * to use old-style 32-bit bitmaps */\n\tif ((end > ~0U) || (real_end > ~0U))\n\t\treturn EXT2_ET_CANT_USE_LEGACY_BITMAPS;\n\n\treturn (ext2fs_make_generic_bitmap(EXT2_ET_MAGIC_INODE_BITMAP, fs,\n\t\t\t\t\t start, end, real_end,\n\t\t\t\t\t descr, 0,\n\t\t\t\t\t (ext2fs_generic_bitmap *) ret));\n}\n\nerrcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs,\n\t\t\t\t       const char *descr,\n\t\t\t\t       ext2fs_block_bitmap *ret)\n{\n\t__u64\t\tstart, end, real_end;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tfs->write_bitmaps = ext2fs_write_bitmaps;\n\n\tstart = EXT2FS_B2C(fs, fs->super->s_first_data_block);\n\tend = EXT2FS_B2C(fs, ext2fs_blocks_count(fs->super)-1);\n\treal_end = ((__u64) EXT2_CLUSTERS_PER_GROUP(fs->super)\n\t\t    * (__u64) fs->group_desc_count)-1 + start;\n\n\tif (fs->flags & EXT2_FLAG_64BITS)\n\t\treturn (ext2fs_alloc_generic_bmap(fs,\n\t\t\t\tEXT2_ET_MAGIC_BLOCK_BITMAP64,\n\t\t\t\tfs->default_bitmap_type,\n\t\t\t\tstart, end, real_end, descr, ret));\n\n\tif ((end > ~0U) || (real_end > ~0U))\n\t\treturn EXT2_ET_CANT_USE_LEGACY_BITMAPS;\n\n\treturn (ext2fs_make_generic_bitmap(EXT2_ET_MAGIC_BLOCK_BITMAP, fs,\n\t\t\t\t\t   start, end, real_end,\n\t\t\t\t\t   descr, 0,\n\t\t\t\t\t   (ext2fs_generic_bitmap *) ret));\n}\n\n/*\n * ext2fs_allocate_block_bitmap() really allocates a per-cluster\n * bitmap for backwards compatibility.  This function allocates a\n * block bitmap which is truly per-block, even if clusters/bigalloc\n * are enabled.  mke2fs and e2fsck need this for tracking the\n * allocation of the file system metadata blocks.\n */\nerrcode_t ext2fs_allocate_subcluster_bitmap(ext2_filsys fs,\n\t\t\t\t\t    const char *descr,\n\t\t\t\t\t    ext2fs_block_bitmap *ret)\n{\n\t__u64\t\t\tstart, end, real_end;\n\text2fs_generic_bitmap\tbmap;\n\text2fs_generic_bitmap_64 bmap64;\n\terrcode_t\t\tretval;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tfs->write_bitmaps = ext2fs_write_bitmaps;\n\n\tif (!fs->cluster_ratio_bits)\n\t\treturn ext2fs_allocate_block_bitmap(fs, descr, ret);\n\n\tif ((fs->flags & EXT2_FLAG_64BITS) == 0)\n\t\treturn EXT2_ET_CANT_USE_LEGACY_BITMAPS;\n\n\tstart = fs->super->s_first_data_block;\n\tend = ext2fs_blocks_count(fs->super)-1;\n\treal_end = ((__u64) EXT2_BLOCKS_PER_GROUP(fs->super)\n\t\t    * (__u64) fs->group_desc_count)-1 + start;\n\n\tretval = ext2fs_alloc_generic_bmap(fs, EXT2_ET_MAGIC_BLOCK_BITMAP64,\n\t\t\t\t\t   fs->default_bitmap_type, start,\n\t\t\t\t\t   end, real_end, descr, &bmap);\n\tif (retval)\n\t\treturn retval;\n\tbmap64 = (ext2fs_generic_bitmap_64) bmap;\n\tbmap64->cluster_bits = 0;\n\t*ret = bmap;\n\treturn 0;\n}\n\nint ext2fs_get_bitmap_granularity(ext2fs_block_bitmap bitmap)\n{\n\text2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) bitmap;\n\n\tif (!EXT2FS_IS_64_BITMAP(bmap))\n\t\treturn 0;\n\n\treturn bmap->cluster_bits;\n}\n\nerrcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\text2_ino_t end, ext2_ino_t *oend)\n{\n\t__u64 tmp_oend;\n\tint retval;\n\n\tretval = ext2fs_fudge_generic_bmap_end((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t       EXT2_ET_FUDGE_INODE_BITMAP_END,\n\t\t\t\t\t       end, &tmp_oend);\n\tif (oend)\n\t\t*oend = tmp_oend;\n\treturn retval;\n}\n\nerrcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap,\n\t\t\t\t\tblk_t end, blk_t *oend)\n{\n\treturn (ext2fs_fudge_generic_bitmap_end(bitmap,\n\t\t\t\t\t\tEXT2_ET_MAGIC_BLOCK_BITMAP,\n\t\t\t\t\t\tEXT2_ET_FUDGE_BLOCK_BITMAP_END,\n\t\t\t\t\t\tend, oend));\n}\n\nerrcode_t ext2fs_fudge_block_bitmap_end2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t blk64_t end, blk64_t *oend)\n{\n\treturn (ext2fs_fudge_generic_bmap_end(bitmap,\n\t\t\t\t\t      EXT2_ET_FUDGE_BLOCK_BITMAP_END,\n\t\t\t\t\t      end, oend));\n}\n\nvoid ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap)\n{\n\text2fs_clear_generic_bmap(bitmap);\n}\n\nvoid ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap)\n{\n\text2fs_clear_generic_bmap(bitmap);\n}\n\nerrcode_t ext2fs_resize_inode_bitmap(__u32 new_end, __u32 new_real_end,\n\t\t\t\t     ext2fs_inode_bitmap bmap)\n{\n\treturn (ext2fs_resize_generic_bitmap(EXT2_ET_MAGIC_INODE_BITMAP,\n\t\t\t\t\t     new_end, new_real_end, bmap));\n}\n\nerrcode_t ext2fs_resize_inode_bitmap2(__u64 new_end, __u64 new_real_end,\n\t\t\t\t      ext2fs_inode_bitmap bmap)\n{\n\treturn (ext2fs_resize_generic_bmap(bmap, new_end, new_real_end));\n}\n\nerrcode_t ext2fs_resize_block_bitmap(__u32 new_end, __u32 new_real_end,\n\t\t\t\t     ext2fs_block_bitmap bmap)\n{\n\treturn (ext2fs_resize_generic_bitmap(EXT2_ET_MAGIC_BLOCK_BITMAP,\n\t\t\t\t\t     new_end, new_real_end, bmap));\n}\n\nerrcode_t ext2fs_resize_block_bitmap2(__u64 new_end, __u64 new_real_end,\n\t\t\t\t      ext2fs_block_bitmap bmap)\n{\n\treturn (ext2fs_resize_generic_bmap(bmap, new_end, new_real_end));\n}\n\nerrcode_t ext2fs_compare_block_bitmap(ext2fs_block_bitmap bm1,\n\t\t\t\t      ext2fs_block_bitmap bm2)\n{\n\treturn (ext2fs_compare_generic_bmap(EXT2_ET_NEQ_BLOCK_BITMAP,\n\t\t\t\t\t    bm1, bm2));\n}\n\nerrcode_t ext2fs_compare_inode_bitmap(ext2fs_inode_bitmap bm1,\n\t\t\t\t      ext2fs_inode_bitmap bm2)\n{\n\treturn (ext2fs_compare_generic_bmap(EXT2_ET_NEQ_INODE_BITMAP,\n\t\t\t\t\t    bm1, bm2));\n}\n\nerrcode_t ext2fs_set_inode_bitmap_range(ext2fs_inode_bitmap bmap,\n\t\t\t\t\text2_ino_t start, unsigned int num,\n\t\t\t\t\tvoid *in)\n{\n\treturn (ext2fs_set_generic_bitmap_range(bmap,\n\t\t\t\t\t\tEXT2_ET_MAGIC_INODE_BITMAP,\n\t\t\t\t\t\tstart, num, in));\n}\n\nerrcode_t ext2fs_set_inode_bitmap_range2(ext2fs_inode_bitmap bmap,\n\t\t\t\t\t __u64 start, size_t num,\n\t\t\t\t\t void *in)\n{\n\treturn (ext2fs_set_generic_bmap_range(bmap, start, num, in));\n}\n\nerrcode_t ext2fs_get_inode_bitmap_range(ext2fs_inode_bitmap bmap,\n\t\t\t\t\text2_ino_t start, unsigned int num,\n\t\t\t\t\tvoid *out)\n{\n\treturn (ext2fs_get_generic_bitmap_range(bmap,\n\t\t\t\t\t\tEXT2_ET_MAGIC_INODE_BITMAP,\n\t\t\t\t\t\tstart, num, out));\n}\n\nerrcode_t ext2fs_get_inode_bitmap_range2(ext2fs_inode_bitmap bmap,\n\t\t\t\t\t __u64 start, size_t num,\n\t\t\t\t\t void *out)\n{\n\treturn (ext2fs_get_generic_bmap_range(bmap, start, num, out));\n}\n\nerrcode_t ext2fs_set_block_bitmap_range(ext2fs_block_bitmap bmap,\n\t\t\t\t\tblk_t start, unsigned int num,\n\t\t\t\t\tvoid *in)\n{\n\treturn (ext2fs_set_generic_bitmap_range(bmap,\n\t\t\t\t\t\tEXT2_ET_MAGIC_BLOCK_BITMAP,\n\t\t\t\t\t\tstart, num, in));\n}\n\nerrcode_t ext2fs_set_block_bitmap_range2(ext2fs_block_bitmap bmap,\n\t\t\t\t\t blk64_t start, size_t num,\n\t\t\t\t\t void *in)\n{\n\treturn (ext2fs_set_generic_bmap_range(bmap, start, num, in));\n}\n\nerrcode_t ext2fs_get_block_bitmap_range(ext2fs_block_bitmap bmap,\n\t\t\t\t\tblk_t start, unsigned int num,\n\t\t\t\t\tvoid *out)\n{\n\treturn (ext2fs_get_generic_bitmap_range(bmap,\n\t\t\t\t\t\tEXT2_ET_MAGIC_BLOCK_BITMAP,\n\t\t\t\t\t\tstart, num, out));\n}\n\nerrcode_t ext2fs_get_block_bitmap_range2(ext2fs_block_bitmap bmap,\n\t\t\t\t\t blk64_t start, size_t num,\n\t\t\t\t\t void *out)\n{\n\treturn (ext2fs_get_generic_bmap_range(bmap, start, num, out));\n}\n"
  },
  {
    "path": "src/ext2fs/bitops.c",
    "content": "/*\n * bitops.c --- Bitmap frobbing code.  See bitops.h for the inlined\n * \troutines.\n *\n * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\n#ifndef _EXT2_HAVE_ASM_BITOPS_\n\n/*\n * For the benefit of those who are trying to port Linux to another\n * architecture, here are some C-language equivalents.  You should\n * recode these in the native assembly language, if at all possible.\n *\n * C language equivalents written by Theodore Ts'o, 9/26/92.\n * Modified by Pete A. Zaitcev 7/14/95 to be portable to big endian\n * systems, as well as non-32 bit systems.\n */\n\nint ext2fs_set_bit(unsigned int nr,void * addr)\n{\n\tint\t\tmask, retval;\n\tunsigned char\t*ADDR = (unsigned char *) addr;\n\n\tADDR += nr >> 3;\n\tmask = 1 << (nr & 0x07);\n\tretval = mask & *ADDR;\n\t*ADDR |= mask;\n\treturn retval;\n}\n\nint ext2fs_clear_bit(unsigned int nr, void * addr)\n{\n\tint\t\tmask, retval;\n\tunsigned char\t*ADDR = (unsigned char *) addr;\n\n\tADDR += nr >> 3;\n\tmask = 1 << (nr & 0x07);\n\tretval = mask & *ADDR;\n\t*ADDR &= ~mask;\n\treturn retval;\n}\n\nint ext2fs_test_bit(unsigned int nr, const void * addr)\n{\n\tint\t\t\tmask;\n\tconst unsigned char\t*ADDR = (const unsigned char *) addr;\n\n\tADDR += nr >> 3;\n\tmask = 1 << (nr & 0x07);\n\treturn (mask & *ADDR);\n}\n\n#endif\t/* !_EXT2_HAVE_ASM_BITOPS_ */\n\nvoid ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg,\n\t\t\tconst char *description)\n{\n#ifndef OMIT_COM_ERR\n\tif (description)\n\t\tcom_err(0, errcode, \"#%lu for %s\", arg, description);\n\telse\n\t\tcom_err(0, errcode, \"#%lu\", arg);\n#endif\n}\n\n/*\n * C-only 64 bit ops.\n */\n\nint ext2fs_set_bit64(__u64 nr, void * addr)\n{\n\tint\t\tmask, retval;\n\tunsigned char\t*ADDR = (unsigned char *) addr;\n\n\tADDR += nr >> 3;\n\tmask = 1 << (nr & 0x07);\n\tretval = mask & *ADDR;\n\t*ADDR |= mask;\n\treturn retval;\n}\n\nint ext2fs_clear_bit64(__u64 nr, void * addr)\n{\n\tint\t\tmask, retval;\n\tunsigned char\t*ADDR = (unsigned char *) addr;\n\n\tADDR += nr >> 3;\n\tmask = 1 << (nr & 0x07);\n\tretval = mask & *ADDR;\n\t*ADDR &= ~mask;\n\treturn retval;\n}\n\nint ext2fs_test_bit64(__u64 nr, const void * addr)\n{\n\tint\t\t\tmask;\n\tconst unsigned char\t*ADDR = (const unsigned char *) addr;\n\n\tADDR += nr >> 3;\n\tmask = 1 << (nr & 0x07);\n\treturn (mask & *ADDR);\n}\n\nstatic unsigned int popcount8(unsigned int w)\n{\n\tunsigned int res = w - ((w >> 1) & 0x55);\n\tres = (res & 0x33) + ((res >> 2) & 0x33);\n\treturn (res + (res >> 4)) & 0x0F;\n}\n\nstatic unsigned int popcount32(unsigned int w)\n{\n\tunsigned int res = w - ((w >> 1) & 0x55555555);\n\tres = (res & 0x33333333) + ((res >> 2) & 0x33333333);\n\tres = (res + (res >> 4)) & 0x0F0F0F0F;\n\tres = res + (res >> 8);\n\treturn (res + (res >> 16)) & 0x000000FF;\n}\n\nunsigned int ext2fs_bitcount(const void *addr, unsigned int nbytes)\n{\n\tconst unsigned char *cp = addr;\n\tconst __u32 *p;\n\tunsigned int res = 0;\n\n\twhile (((((uintptr_t) cp) & 3) != 0) && (nbytes > 0)) {\n\t\tres += popcount8(*cp++);\n\t\tnbytes--;\n\t}\n\tp = (const __u32 *) cp;\n\n\twhile (nbytes > 4) {\n\t\tres += popcount32(*p++);\n\t\tnbytes -= 4;\n\t}\n\tcp = (const unsigned char *) p;\n\n\twhile (nbytes > 0) {\n\t\tres += popcount8(*cp++);\n\t\tnbytes--;\n\t}\n\treturn res;\n}\n"
  },
  {
    "path": "src/ext2fs/bitops.h",
    "content": "/*\n * bitops.h --- Bitmap frobbing code.  The byte swapping routines are\n * \talso included here.\n *\n * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#ifdef WORDS_BIGENDIAN\n#define ext2fs_cpu_to_le64(x) ((__force __le64)ext2fs_swab64((__u64)(x)))\n#define ext2fs_le64_to_cpu(x) ext2fs_swab64((__force __u64)(__le64)(x))\n#define ext2fs_cpu_to_le32(x) ((__force __le32)ext2fs_swab32((__u32)(x)))\n#define ext2fs_le32_to_cpu(x) ext2fs_swab32((__force __u32)(__le32)(x))\n#define ext2fs_cpu_to_le16(x) ((__force __le16)ext2fs_swab16((__u16)(x)))\n#define ext2fs_le16_to_cpu(x) ext2fs_swab16((__force __u16)(__le16)(x))\n\n#define ext2fs_cpu_to_be64(x) ((__force __be64)(__u64)(x))\n#define ext2fs_be64_to_cpu(x) ((__force __u64)(__be64)(x))\n#define ext2fs_cpu_to_be32(x) ((__force __be32)(__u32)(x))\n#define ext2fs_be32_to_cpu(x) ((__force __u32)(__be32)(x))\n#define ext2fs_cpu_to_be16(x) ((__force __be16)(__u16)(x))\n#define ext2fs_be16_to_cpu(x) ((__force __u16)(__be16)(x))\n#else\n#define ext2fs_cpu_to_le64(x) ((__force __le64)(__u64)(x))\n#define ext2fs_le64_to_cpu(x) ((__force __u64)(__le64)(x))\n#define ext2fs_cpu_to_le32(x) ((__force __le32)(__u32)(x))\n#define ext2fs_le32_to_cpu(x) ((__force __u32)(__le32)(x))\n#define ext2fs_cpu_to_le16(x) ((__force __le16)(__u16)(x))\n#define ext2fs_le16_to_cpu(x) ((__force __u16)(__le16)(x))\n\n#define ext2fs_cpu_to_be64(x) ((__force __be64)ext2fs_swab64((__u64)(x)))\n#define ext2fs_be64_to_cpu(x) ext2fs_swab64((__force __u64)(__be64)(x))\n#define ext2fs_cpu_to_be32(x) ((__force __be32)ext2fs_swab32((__u32)(x)))\n#define ext2fs_be32_to_cpu(x) ext2fs_swab32((__force __u32)(__be32)(x))\n#define ext2fs_cpu_to_be16(x) ((__force __be16)ext2fs_swab16((__u16)(x)))\n#define ext2fs_be16_to_cpu(x) ext2fs_swab16((__force __u16)(__be16)(x))\n#endif\n\n/*\n * EXT2FS bitmap manipulation routines.\n */\n\n/* Support for sending warning messages from the inline subroutines */\nextern const char *ext2fs_block_string;\nextern const char *ext2fs_inode_string;\nextern const char *ext2fs_mark_string;\nextern const char *ext2fs_unmark_string;\nextern const char *ext2fs_test_string;\nextern void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg,\n\t\t\t       const char *description);\nextern void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap,\n\t\t\t\tint code, unsigned long arg);\n\n#ifdef NO_INLINE_FUNCS\nextern void ext2fs_fast_set_bit(unsigned int nr,void * addr);\nextern void ext2fs_fast_clear_bit(unsigned int nr, void * addr);\nextern void ext2fs_fast_set_bit64(__u64 nr,void * addr);\nextern void ext2fs_fast_clear_bit64(__u64 nr, void * addr);\nextern __u16 ext2fs_swab16(__u16 val);\nextern __u32 ext2fs_swab32(__u32 val);\nextern __u64 ext2fs_swab64(__u64 val);\n\nextern int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);\nextern int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,\n\t\t\t\t       blk_t block);\nextern int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);\n\nextern int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);\nextern int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,\n\t\t\t\t       ext2_ino_t inode);\nextern int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ext2_ino_t inode);\n\nextern void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t  blk_t block);\nextern void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t    blk_t block);\nextern int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t blk_t block);\n\nextern void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t  ext2_ino_t inode);\nextern void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t    ext2_ino_t inode);\nextern int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t ext2_ino_t inode);\nextern blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap);\nextern ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap);\nextern blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap);\nextern ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap);\n\nextern void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\tblk_t block, int num);\nextern void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t  blk_t block, int num);\nextern int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t       blk_t block, int num);\n#endif\n\n/* These functions routines moved to gen_bitmap.c */\nextern void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t   blk_t block, int num);\nextern void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t     blk_t block, int num);\nextern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t  blk_t block, int num);\nextern int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t  ext2_ino_t inode, int num);\nextern int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t __u32 bitno);\nextern int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t   blk_t bitno);\nextern int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t      blk_t bitno);\nextern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t  blk_t block, int num);\nextern void ext2fs_set_bitmap_padding(ext2fs_generic_bitmap map);\nextern __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap);\nextern __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap);\n\n/* 64-bit versions */\n\n#ifdef NO_INLINE_FUNCS\nextern int ext2fs_mark_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t     blk64_t block);\nextern int ext2fs_unmark_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t       blk64_t block);\nextern int ext2fs_test_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t     blk64_t block);\n\nextern int ext2fs_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t     ext2_ino_t inode);\nextern int ext2fs_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t       ext2_ino_t inode);\nextern int ext2fs_test_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t     ext2_ino_t inode);\n\nextern void ext2fs_fast_mark_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t   blk64_t block);\nextern void ext2fs_fast_unmark_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t     blk64_t block);\nextern int ext2fs_fast_test_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t  blk64_t block);\n\nextern void ext2fs_fast_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t   ext2_ino_t inode);\nextern void ext2fs_fast_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t    ext2_ino_t inode);\nextern int ext2fs_fast_test_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t  ext2_ino_t inode);\nextern errcode_t ext2fs_find_first_zero_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t      blk64_t start,\n\t\t\t\t\t\t      blk64_t end,\n\t\t\t\t\t\t      blk64_t *out);\nextern errcode_t ext2fs_find_first_zero_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t\t      ext2_ino_t start,\n\t\t\t\t\t\t      ext2_ino_t end,\n\t\t\t\t\t\t      ext2_ino_t *out);\nextern errcode_t ext2fs_find_first_set_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t     blk64_t start,\n\t\t\t\t\t\t     blk64_t end,\n\t\t\t\t\t\t     blk64_t *out);\nextern errcode_t ext2fs_find_first_set_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t\t      ext2_ino_t start,\n\t\t\t\t\t\t      ext2_ino_t end,\n\t\t\t\t\t\t      ext2_ino_t *out);\nextern blk64_t ext2fs_get_block_bitmap_start2(ext2fs_block_bitmap bitmap);\nextern ext2_ino_t ext2fs_get_inode_bitmap_start2(ext2fs_inode_bitmap bitmap);\nextern blk64_t ext2fs_get_block_bitmap_end2(ext2fs_block_bitmap bitmap);\nextern ext2_ino_t ext2fs_get_inode_bitmap_end2(ext2fs_inode_bitmap bitmap);\n\nextern int ext2fs_fast_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\tblk64_t block,\n\t\t\t\t\t\tunsigned int num);\nextern void ext2fs_fast_mark_block_bitmap_range2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t blk64_t block,\n\t\t\t\t\t\t unsigned int num);\nextern void ext2fs_fast_unmark_block_bitmap_range2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t   blk64_t block,\n\t\t\t\t\t\t   unsigned int num);\n#endif\n\n/* These routines moved to gen_bitmap64.c */\nextern void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap bitmap);\nextern errcode_t ext2fs_compare_generic_bmap(errcode_t neq,\n\t\t\t\t\t     ext2fs_generic_bitmap bm1,\n\t\t\t\t\t     ext2fs_generic_bitmap bm2);\nextern void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap bmap);\nextern int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t    blk64_t bitno);\nextern int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t      blk64_t bitno);\nextern int ext2fs_test_generic_bmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t    blk64_t bitno);\nextern int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t   blk64_t block, unsigned int num);\nextern __u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap bitmap);\nextern __u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap bitmap);\nextern int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t   blk64_t block, unsigned int num);\nextern void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t    blk64_t block, unsigned int num);\nextern void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t      blk64_t block, unsigned int num);\nextern errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t\t     __u64 start, __u64 end,\n\t\t\t\t\t\t     __u64 *out);\nextern errcode_t ext2fs_find_first_set_generic_bmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t\t    __u64 start, __u64 end,\n\t\t\t\t\t\t    __u64 *out);\n\n/*\n * The inline routines themselves...\n *\n * If NO_INLINE_FUNCS is defined, then we won't try to do inline\n * functions at all; they will be included as normal functions in\n * inline.c\n */\n#ifdef NO_INLINE_FUNCS\n#if (defined(__GNUC__) && (defined(__i386__) || defined(__i486__) || \\\n\t\t\t   defined(__i586__)))\n\t/* This prevents bitops.c from trying to include the C */\n\t/* function version of these functions */\n#define _EXT2_HAVE_ASM_BITOPS_\n#endif\n#endif /* NO_INLINE_FUNCS */\n\n#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))\n#ifdef INCLUDE_INLINE_FUNCS\n#if (__STDC_VERSION__ >= 199901L)\n#define _INLINE_ extern inline\n#else\n#define _INLINE_ inline\n#endif\n#else /* !INCLUDE_INLINE FUNCS */\n#if (__STDC_VERSION__ >= 199901L)\n#define _INLINE_ inline\n#else /* not C99 */\n#ifdef __GNUC__\n#define _INLINE_ extern __inline__\n#else\t\t\t\t/* For Watcom C */\n#define _INLINE_ extern inline\n#endif /* __GNUC__ */\n#endif /* __STDC_VERSION__ >= 199901L */\n#endif /* INCLUDE_INLINE_FUNCS */\n\n/*\n * Fast bit set/clear functions that doesn't need to return the\n * previous bit value.\n */\n\n_INLINE_ void ext2fs_fast_set_bit(unsigned int nr,void * addr)\n{\n\tunsigned char\t*ADDR = (unsigned char *) addr;\n\n\tADDR += nr >> 3;\n\t*ADDR |= (unsigned char) (1 << (nr & 0x07));\n}\n\n_INLINE_ void ext2fs_fast_clear_bit(unsigned int nr, void * addr)\n{\n\tunsigned char\t*ADDR = (unsigned char *) addr;\n\n\tADDR += nr >> 3;\n\t*ADDR &= (unsigned char) ~(1 << (nr & 0x07));\n}\n\n\n_INLINE_ void ext2fs_fast_set_bit64(__u64 nr, void * addr)\n{\n\tunsigned char\t*ADDR = (unsigned char *) addr;\n\n\tADDR += nr >> 3;\n\t*ADDR |= (unsigned char) (1 << (nr & 0x07));\n}\n\n_INLINE_ void ext2fs_fast_clear_bit64(__u64 nr, void * addr)\n{\n\tunsigned char\t*ADDR = (unsigned char *) addr;\n\n\tADDR += nr >> 3;\n\t*ADDR &= (unsigned char) ~(1 << (nr & 0x07));\n}\n\n\n#if ((defined __GNUC__) && !defined(_EXT2_USE_C_VERSIONS_) && \\\n     (defined(__i386__) || defined(__i486__) || defined(__i586__)))\n\n#define _EXT2_HAVE_ASM_BITOPS_\n#define _EXT2_HAVE_ASM_SWAB_\n\n/*\n * These are done by inline assembly for speed reasons.....\n *\n * All bitoperations return 0 if the bit was cleared before the\n * operation and != 0 if it was not.  Bit 0 is the LSB of addr; bit 32\n * is the LSB of (addr+1).\n */\n\n/*\n * Some hacks to defeat gcc over-optimizations..\n */\nstruct __dummy_h { unsigned long a[100]; };\n#define EXT2FS_ADDR (*(struct __dummy_h *) addr)\n#define EXT2FS_CONST_ADDR (*(const struct __dummy_h *) addr)\n\n_INLINE_ int ext2fs_set_bit(unsigned int nr, void * addr)\n{\n\tint oldbit;\n\n\taddr = (void *) (((unsigned char *) addr) + (nr >> 3));\n\t__asm__ __volatile__(\"btsl %2,%1\\n\\tsbbl %0,%0\"\n\t\t:\"=r\" (oldbit),\"+m\" (EXT2FS_ADDR)\n\t\t:\"r\" (nr & 7));\n\treturn oldbit;\n}\n\n_INLINE_ int ext2fs_clear_bit(unsigned int nr, void * addr)\n{\n\tint oldbit;\n\n\taddr = (void *) (((unsigned char *) addr) + (nr >> 3));\n\t__asm__ __volatile__(\"btrl %2,%1\\n\\tsbbl %0,%0\"\n\t\t:\"=r\" (oldbit),\"+m\" (EXT2FS_ADDR)\n\t\t:\"r\" (nr & 7));\n\treturn oldbit;\n}\n\n_INLINE_ int ext2fs_test_bit(unsigned int nr, const void * addr)\n{\n\tint oldbit;\n\n\taddr = (const void *) (((const unsigned char *) addr) + (nr >> 3));\n\t__asm__ __volatile__(\"btl %2,%1\\n\\tsbbl %0,%0\"\n\t\t:\"=r\" (oldbit)\n\t\t:\"m\" (EXT2FS_CONST_ADDR),\"r\" (nr & 7));\n\treturn oldbit;\n}\n\n_INLINE_ __u32 ext2fs_swab32(__u32 val)\n{\n#ifdef EXT2FS_REQUIRE_486\n\t__asm__(\"bswap %0\" : \"=r\" (val) : \"0\" (val));\n#else\n\t__asm__(\"xchgb %b0,%h0\\n\\t\"\t/* swap lower bytes\t*/\n\t\t\"rorl $16,%0\\n\\t\"\t/* swap words\t\t*/\n\t\t\"xchgb %b0,%h0\"\t\t/* swap higher bytes\t*/\n\t\t:\"=q\" (val)\n\t\t: \"0\" (val));\n#endif\n\treturn val;\n}\n\n_INLINE_ __u16 ext2fs_swab16(__u16 val)\n{\n\t__asm__(\"xchgb %b0,%h0\"\t\t/* swap bytes\t\t*/ \\\n\t\t: \"=q\" (val) \\\n\t\t:  \"0\" (val)); \\\n\t\treturn val;\n}\n\n#undef EXT2FS_ADDR\n\n#endif\t/* i386 */\n\n\n#if !defined(_EXT2_HAVE_ASM_SWAB_)\n\n_INLINE_ __u16 ext2fs_swab16(__u16 val)\n{\n\treturn (val >> 8) | (__u16) (val << 8);\n}\n\n_INLINE_ __u32 ext2fs_swab32(__u32 val)\n{\n\treturn ((val>>24) | ((val>>8)&0xFF00) |\n\t\t((val<<8)&0xFF0000) | (val<<24));\n}\n\n#endif /* !_EXT2_HAVE_ASM_SWAB */\n\n_INLINE_ __u64 ext2fs_swab64(__u64 val)\n{\n\treturn (ext2fs_swab32((__u32) (val >> 32)) |\n\t\t(((__u64)ext2fs_swab32(val & 0xFFFFFFFFUL)) << 32));\n}\n\n_INLINE_ int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap,\n\t\t\t\t       blk_t block)\n{\n\treturn ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t  block);\n}\n\n_INLINE_ int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t blk_t block)\n{\n\treturn ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t    block);\n}\n\n_INLINE_ int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap,\n\t\t\t\t       blk_t block)\n{\n\treturn ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t  block);\n}\n\n_INLINE_ int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,\n\t\t\t\t       ext2_ino_t inode)\n{\n\treturn ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t  inode);\n}\n\n_INLINE_ int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t ext2_ino_t inode)\n{\n\treturn ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t     inode);\n}\n\n_INLINE_ int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap,\n\t\t\t\t       ext2_ino_t inode)\n{\n\treturn ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t  inode);\n}\n\n_INLINE_ void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t    blk_t block)\n{\n\text2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, block);\n}\n\n_INLINE_ void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t      blk_t block)\n{\n\text2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, block);\n}\n\n_INLINE_ int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t    blk_t block)\n{\n\treturn ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t  block);\n}\n\n_INLINE_ void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t    ext2_ino_t inode)\n{\n\text2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap, inode);\n}\n\n_INLINE_ void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t      ext2_ino_t inode)\n{\n\text2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap, inode);\n}\n\n_INLINE_ int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t   ext2_ino_t inode)\n{\n\treturn ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t  inode);\n}\n\n_INLINE_ blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap)\n{\n\treturn ext2fs_get_generic_bitmap_start((ext2fs_generic_bitmap) bitmap);\n}\n\n_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap)\n{\n\treturn ext2fs_get_generic_bitmap_start((ext2fs_generic_bitmap) bitmap);\n}\n\n_INLINE_ blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap)\n{\n\treturn ext2fs_get_generic_bitmap_end((ext2fs_generic_bitmap) bitmap);\n}\n\n_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap)\n{\n\treturn ext2fs_get_generic_bitmap_end((ext2fs_generic_bitmap) bitmap);\n}\n\n_INLINE_ int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t blk_t block, int num)\n{\n\treturn ext2fs_test_block_bitmap_range(bitmap, block, num);\n}\n\n_INLINE_ void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t  blk_t block, int num)\n{\n\text2fs_mark_block_bitmap_range(bitmap, block, num);\n}\n\n_INLINE_ void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t    blk_t block, int num)\n{\n\text2fs_unmark_block_bitmap_range(bitmap, block, num);\n}\n\n/* 64-bit versions */\n\n_INLINE_ int ext2fs_mark_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t       blk64_t block)\n{\n\treturn ext2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\tblock);\n}\n\n_INLINE_ int ext2fs_unmark_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t blk64_t block)\n{\n\treturn ext2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap, block);\n}\n\n_INLINE_ int ext2fs_test_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t       blk64_t block)\n{\n\treturn ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\tblock);\n}\n\n_INLINE_ int ext2fs_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t       ext2_ino_t inode)\n{\n\treturn ext2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\tinode);\n}\n\n_INLINE_ int ext2fs_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t ext2_ino_t inode)\n{\n\treturn ext2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t  inode);\n}\n\n_INLINE_ int ext2fs_test_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t       ext2_ino_t inode)\n{\n\treturn ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\tinode);\n}\n\n_INLINE_ void ext2fs_fast_mark_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t     blk64_t block)\n{\n\text2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap, block);\n}\n\n_INLINE_ void ext2fs_fast_unmark_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t       blk64_t block)\n{\n\text2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap, block);\n}\n\n_INLINE_ int ext2fs_fast_test_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t    blk64_t block)\n{\n\treturn ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\tblock);\n}\n\n_INLINE_ void ext2fs_fast_mark_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t     ext2_ino_t inode)\n{\n\text2fs_mark_generic_bmap((ext2fs_generic_bitmap) bitmap, inode);\n}\n\n_INLINE_ void ext2fs_fast_unmark_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t       ext2_ino_t inode)\n{\n\text2fs_unmark_generic_bmap((ext2fs_generic_bitmap) bitmap, inode);\n}\n\n_INLINE_ int ext2fs_fast_test_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t    ext2_ino_t inode)\n{\n\treturn ext2fs_test_generic_bmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\tinode);\n}\n\n_INLINE_ errcode_t ext2fs_find_first_zero_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t\tblk64_t start,\n\t\t\t\t\t\t\tblk64_t end,\n\t\t\t\t\t\t\tblk64_t *out)\n{\n\t__u64 o;\n\terrcode_t rv;\n\n\trv = ext2fs_find_first_zero_generic_bmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t\t start, end, &o);\n\tif (!rv)\n\t\t*out = o;\n\treturn rv;\n}\n\n_INLINE_ errcode_t ext2fs_find_first_zero_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t\t\text2_ino_t start,\n\t\t\t\t\t\t\text2_ino_t end,\n\t\t\t\t\t\t\text2_ino_t *out)\n{\n\t__u64 o;\n\terrcode_t rv;\n\n\trv = ext2fs_find_first_zero_generic_bmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t\t start, end, &o);\n\tif (!rv)\n\t\t*out = (ext2_ino_t) o;\n\treturn rv;\n}\n\n_INLINE_ errcode_t ext2fs_find_first_set_block_bitmap2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t       blk64_t start,\n\t\t\t\t\t\t       blk64_t end,\n\t\t\t\t\t\t       blk64_t *out)\n{\n\t__u64 o;\n\terrcode_t rv;\n\n\trv = ext2fs_find_first_set_generic_bmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t\tstart, end, &o);\n\tif (!rv)\n\t\t*out = o;\n\treturn rv;\n}\n\n_INLINE_ errcode_t ext2fs_find_first_set_inode_bitmap2(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t\t       ext2_ino_t start,\n\t\t\t\t\t\t       ext2_ino_t end,\n\t\t\t\t\t\t       ext2_ino_t *out)\n{\n\t__u64 o;\n\terrcode_t rv;\n\n\trv = ext2fs_find_first_set_generic_bmap((ext2fs_generic_bitmap) bitmap,\n\t\t\t\t\t\tstart, end, &o);\n\tif (!rv)\n\t\t*out = (ext2_ino_t) o;\n\treturn rv;\n}\n\n_INLINE_ blk64_t ext2fs_get_block_bitmap_start2(ext2fs_block_bitmap bitmap)\n{\n\treturn ext2fs_get_generic_bmap_start((ext2fs_generic_bitmap) bitmap);\n}\n\n_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_start2(ext2fs_inode_bitmap bitmap)\n{\n\treturn (ext2_ino_t) ext2fs_get_generic_bmap_start((ext2fs_generic_bitmap) bitmap);\n}\n\n_INLINE_ blk64_t ext2fs_get_block_bitmap_end2(ext2fs_block_bitmap bitmap)\n{\n\treturn ext2fs_get_generic_bmap_end((ext2fs_generic_bitmap) bitmap);\n}\n\n_INLINE_ ext2_ino_t ext2fs_get_inode_bitmap_end2(ext2fs_inode_bitmap bitmap)\n{\n\treturn (ext2_ino_t) ext2fs_get_generic_bmap_end((ext2fs_generic_bitmap) bitmap);\n}\n\n_INLINE_ int ext2fs_fast_test_block_bitmap_range2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t  blk64_t block,\n\t\t\t\t\t\t  unsigned int num)\n{\n\treturn ext2fs_test_block_bitmap_range2(bitmap, block, num);\n}\n\n_INLINE_ void ext2fs_fast_mark_block_bitmap_range2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t   blk64_t block,\n\t\t\t\t\t\t   unsigned int num)\n{\n\text2fs_mark_block_bitmap_range2(bitmap, block, num);\n}\n\n_INLINE_ void ext2fs_fast_unmark_block_bitmap_range2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t\t     blk64_t block,\n\t\t\t\t\t\t     unsigned int num)\n{\n\text2fs_unmark_block_bitmap_range2(bitmap, block, num);\n}\n\n#undef _INLINE_\n#endif\n\n#ifndef _EXT2_HAVE_ASM_BITOPS_\nextern int ext2fs_set_bit(unsigned int nr,void * addr);\nextern int ext2fs_clear_bit(unsigned int nr, void * addr);\nextern int ext2fs_test_bit(unsigned int nr, const void * addr);\n#endif\n\nextern int ext2fs_set_bit64(__u64 nr,void * addr);\nextern int ext2fs_clear_bit64(__u64 nr, void * addr);\nextern int ext2fs_test_bit64(__u64 nr, const void * addr);\nextern unsigned int ext2fs_bitcount(const void *addr, unsigned int nbytes);\n"
  },
  {
    "path": "src/ext2fs/blkmap64_ba.c",
    "content": "/*\n * blkmap64_ba.c --- Simple bitarray implementation for bitmaps\n *\n * Copyright (C) 2008 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Public\n * License.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n#include \"bmap64.h\"\n\n/*\n * Private data for bit array implementation of bitmap ops.\n * Currently, this is just a pointer to our big flat hunk of memory,\n * exactly equivalent to the old-skool char * bitmap member.\n */\n\nstruct ext2fs_ba_private_struct {\n\tchar *bitarray;\n};\n\ntypedef struct ext2fs_ba_private_struct *ext2fs_ba_private;\n\nstatic errcode_t ba_alloc_private_data (ext2fs_generic_bitmap_64 bitmap)\n{\n\text2fs_ba_private bp;\n\terrcode_t\tretval;\n\tsize_t\t\tsize;\n\n\t/*\n\t * Since we only have the one pointer, we could just shove our\n\t * private data in the void *private field itself, but then\n\t * we'd have to do a fair bit of rewriting if we ever added a\n\t * field.  I'm agnostic.\n\t */\n\tretval = ext2fs_get_mem(sizeof (ext2fs_ba_private), &bp);\n\tif (retval)\n\t\treturn retval;\n\n\tsize = (size_t) (((bitmap->real_end - bitmap->start) / 8) + 1);\n\n\tretval = ext2fs_get_mem(size, &bp->bitarray);\n\tif (retval) {\n\t\text2fs_free_mem(&bp);\n\t\tbp = 0;\n\t\treturn retval;\n\t}\n\tbitmap->private = (void *) bp;\n\treturn 0;\n}\n\nstatic errcode_t ba_new_bmap(ext2_filsys fs EXT2FS_ATTR((unused)),\n\t\t\t     ext2fs_generic_bitmap_64 bitmap)\n{\n\text2fs_ba_private bp;\n\terrcode_t\tretval;\n\tsize_t\t\tsize;\n\n\tretval = ba_alloc_private_data (bitmap);\n\tif (retval)\n\t\treturn retval;\n\n\tbp = (ext2fs_ba_private) bitmap->private;\n\tsize = (size_t) (((bitmap->real_end - bitmap->start) / 8) + 1);\n\tmemset(bp->bitarray, 0, size);\n\n\treturn 0;\n}\n\nstatic void ba_free_bmap(ext2fs_generic_bitmap_64 bitmap)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;\n\n\tif (!bp)\n\t\treturn;\n\n\tif (bp->bitarray) {\n\t\text2fs_free_mem (&bp->bitarray);\n\t\tbp->bitarray = 0;\n\t}\n\text2fs_free_mem (&bp);\n\tbp = 0;\n}\n\nstatic errcode_t ba_copy_bmap(ext2fs_generic_bitmap_64 src,\n\t\t\t      ext2fs_generic_bitmap_64 dest)\n{\n\text2fs_ba_private src_bp = (ext2fs_ba_private) src->private;\n\text2fs_ba_private dest_bp;\n\terrcode_t retval;\n\tsize_t size;\n\n\tretval = ba_alloc_private_data (dest);\n\tif (retval)\n\t\treturn retval;\n\n\tdest_bp = (ext2fs_ba_private) dest->private;\n\n\tsize = (size_t) (((src->real_end - src->start) / 8) + 1);\n\tmemcpy (dest_bp->bitarray, src_bp->bitarray, size);\n\n\treturn 0;\n}\n\nstatic errcode_t ba_resize_bmap(ext2fs_generic_bitmap_64 bmap,\n\t\t\t\t__u64 new_end, __u64 new_real_end)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private) bmap->private;\n\terrcode_t\tretval;\n\tsize_t\t\tsize, new_size;\n\t__u64\t\tbitno;\n\n\t/*\n\t * If we're expanding the bitmap, make sure all of the new\n\t * parts of the bitmap are zero.\n\t */\n\tif (new_end > bmap->end) {\n\t\tbitno = bmap->real_end;\n\t\tif (bitno > new_end)\n\t\t\tbitno = new_end;\n\t\tfor (; bitno > bmap->end; bitno--)\n\t\t\text2fs_clear_bit64(bitno - bmap->start, bp->bitarray);\n\t}\n\tif (new_real_end == bmap->real_end) {\n\t\tbmap->end = new_end;\n\t\treturn 0;\n\t}\n\n\tsize = ((bmap->real_end - bmap->start) / 8) + 1;\n\tnew_size = ((new_real_end - bmap->start) / 8) + 1;\n\n\tif (size != new_size) {\n\t\tretval = ext2fs_resize_mem(size, new_size, &bp->bitarray);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\tif (new_size > size)\n\t\tmemset(bp->bitarray + size, 0, new_size - size);\n\n\tbmap->end = new_end;\n\tbmap->real_end = new_real_end;\n\treturn 0;\n\n}\n\nstatic int ba_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;\n\tblk64_t bitno = (blk64_t) arg;\n\n\treturn ext2fs_set_bit64(bitno - bitmap->start, bp->bitarray);\n}\n\nstatic int ba_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;\n\tblk64_t bitno = (blk64_t) arg;\n\n\treturn ext2fs_clear_bit64(bitno - bitmap->start, bp->bitarray);\n}\n\nstatic int ba_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;\n\tblk64_t bitno = (blk64_t) arg;\n\n\treturn ext2fs_test_bit64(bitno - bitmap->start, bp->bitarray);\n}\n\nstatic void ba_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,\n\t\t\t\tunsigned int num)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;\n\tblk64_t bitno = (blk64_t) arg;\n\tunsigned int i;\n\n\tfor (i = 0; i < num; i++)\n\t\text2fs_fast_set_bit64(bitno + i - bitmap->start, bp->bitarray);\n}\n\nstatic void ba_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,\n\t\t\t\t  unsigned int num)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;\n\tblk64_t bitno = (blk64_t) arg;\n\tunsigned int i;\n\n\tfor (i = 0; i < num; i++)\n\t\text2fs_fast_clear_bit64(bitno + i - bitmap->start, bp->bitarray);\n}\n\nstatic int ba_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t     __u64 start, unsigned int len)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;\n\t__u64 start_byte, len_byte = len >> 3;\n\tunsigned int start_bit, len_bit = len % 8;\n\tunsigned int first_bit = 0;\n\tunsigned int last_bit  = 0;\n\tint mark_count = 0;\n\tint mark_bit = 0;\n\tint i;\n\tconst char *ADDR;\n\n\tADDR = bp->bitarray;\n\tstart -= bitmap->start;\n\tstart_byte = start >> 3;\n\tstart_bit = start % 8;\n\n\tif (start_bit != 0) {\n\t\t/*\n\t\t * The compared start block number or start inode number\n\t\t * is not the first bit in a byte.\n\t\t */\n\t\tmark_count = 8 - start_bit;\n\t\tif (len < 8 - start_bit) {\n\t\t\tmark_count = (int)len;\n\t\t\tmark_bit = len + start_bit - 1;\n\t\t} else\n\t\t\tmark_bit = 7;\n\n\t\tfor (i = mark_count; i > 0; i--, mark_bit--)\n\t\t\tfirst_bit |= 1 << mark_bit;\n\n\t\t/*\n\t\t * Compare blocks or inodes in the first byte.\n\t\t * If there is any marked bit, this function returns 0.\n\t\t */\n\t\tif (first_bit & ADDR[start_byte])\n\t\t\treturn 0;\n\t\telse if (len <= 8 - start_bit)\n\t\t\treturn 1;\n\n\t\tstart_byte++;\n\t\tlen_bit = (len - mark_count) % 8;\n\t\tlen_byte = (len - mark_count) >> 3;\n\t}\n\n\t/*\n\t * The compared start block number or start inode number is\n\t * the first bit in a byte.\n\t */\n\tif (len_bit != 0) {\n\t\t/*\n\t\t * The compared end block number or end inode number is\n\t\t * not the last bit in a byte.\n\t\t */\n\t\tfor (mark_bit = len_bit - 1; mark_bit >= 0; mark_bit--)\n\t\t\tlast_bit |= 1 << mark_bit;\n\n\t\t/*\n\t\t * Compare blocks or inodes in the last byte.\n\t\t * If there is any marked bit, this function returns 0.\n\t\t */\n\t\tif (last_bit & ADDR[start_byte + len_byte])\n\t\t\treturn 0;\n\t\telse if (len_byte == 0)\n\t\t\treturn 1;\n\t}\n\n\t/* Check whether all bytes are 0 */\n\treturn ext2fs_mem_is_zero(ADDR + start_byte, len_byte);\n}\n\n\nstatic errcode_t ba_set_bmap_range(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t     __u64 start, size_t num, void *in)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;\n\n\tmemcpy (bp->bitarray + (start >> 3), in, (num + 7) >> 3);\n\n\treturn 0;\n}\n\nstatic errcode_t ba_get_bmap_range(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t     __u64 start, size_t num, void *out)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;\n\n\tmemcpy (out, bp->bitarray + (start >> 3), (num + 7) >> 3);\n\n\treturn 0;\n}\n\nstatic void ba_clear_bmap(ext2fs_generic_bitmap_64 bitmap)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private) bitmap->private;\n\n\tmemset(bp->bitarray, 0,\n\t       (size_t) (((bitmap->real_end - bitmap->start) / 8) + 1));\n}\n\n#ifdef ENABLE_BMAP_STATS\nstatic void ba_print_stats(ext2fs_generic_bitmap_64 bitmap)\n{\n\tfprintf(stderr, \"%16llu Bytes used by bitarray\\n\",\n\t\t((bitmap->real_end - bitmap->start) >> 3) + 1 +\n\t\tsizeof(struct ext2fs_ba_private_struct));\n}\n#else\nstatic void ba_print_stats(ext2fs_generic_bitmap_64 bitmap EXT2FS_ATTR((unused)))\n{\n}\n#endif\n\n/* Find the first zero bit between start and end, inclusive. */\nstatic errcode_t ba_find_first_zero(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t    __u64 start, __u64 end, __u64 *out)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private)bitmap->private;\n\tunsigned long bitpos = start - bitmap->start;\n\tunsigned long count = end - start + 1;\n\tint byte_found = 0; /* whether a != 0xff byte has been found */\n\tconst unsigned char *pos;\n\tunsigned long max_loop_count, i;\n\n\t/* scan bits until we hit a byte boundary */\n\twhile ((bitpos & 0x7) != 0 && count > 0) {\n\t\tif (!ext2fs_test_bit64(bitpos, bp->bitarray)) {\n\t\t\t*out = bitpos + bitmap->start;\n\t\t\treturn 0;\n\t\t}\n\t\tbitpos++;\n\t\tcount--;\n\t}\n\n\tif (!count)\n\t\treturn ENOENT;\n\n\tpos = ((unsigned char *)bp->bitarray) + (bitpos >> 3);\n\t/* scan bytes until 8-byte (64-bit) aligned */\n\twhile (count >= 8 && (((uintptr_t)pos) & 0x07)) {\n\t\tif (*pos != 0xff) {\n\t\t\tbyte_found = 1;\n\t\t\tbreak;\n\t\t}\n\t\tpos++;\n\t\tcount -= 8;\n\t\tbitpos += 8;\n\t}\n\n\tif (!byte_found) {\n\t\tmax_loop_count = count >> 6; /* 8-byte blocks */\n\t\ti = max_loop_count;\n\t\twhile (i) {\n\t\t\tif (*((const __u64 *)pos) != ((__u64)-1))\n\t\t\t\tbreak;\n\t\t\tpos += 8;\n\t\t\ti--;\n\t\t}\n\t\tcount -= 64 * (max_loop_count - i);\n\t\tbitpos += 64 * (max_loop_count - i);\n\n\t\tmax_loop_count = count >> 3;\n\t\ti = max_loop_count;\n\t\twhile (i) {\n\t\t\tif (*pos != 0xff) {\n\t\t\t\tbyte_found = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpos++;\n\t\t\ti--;\n\t\t}\n\t\tcount -= 8 * (max_loop_count - i);\n\t\tbitpos += 8 * (max_loop_count - i);\n\t}\n\n\t/* Here either count < 8 or byte_found == 1. */\n\twhile (count-- > 0) {\n\t\tif (!ext2fs_test_bit64(bitpos, bp->bitarray)) {\n\t\t\t*out = bitpos + bitmap->start;\n\t\t\treturn 0;\n\t\t}\n\t\tbitpos++;\n\t}\n\n\treturn ENOENT;\n}\n\n/* Find the first one bit between start and end, inclusive. */\nstatic errcode_t ba_find_first_set(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t    __u64 start, __u64 end, __u64 *out)\n{\n\text2fs_ba_private bp = (ext2fs_ba_private)bitmap->private;\n\tunsigned long bitpos = start - bitmap->start;\n\tunsigned long count = end - start + 1;\n\tint byte_found = 0; /* whether a != 0xff byte has been found */\n\tconst unsigned char *pos;\n\tunsigned long max_loop_count, i;\n\n\t/* scan bits until we hit a byte boundary */\n\twhile ((bitpos & 0x7) != 0 && count > 0) {\n\t\tif (ext2fs_test_bit64(bitpos, bp->bitarray)) {\n\t\t\t*out = bitpos + bitmap->start;\n\t\t\treturn 0;\n\t\t}\n\t\tbitpos++;\n\t\tcount--;\n\t}\n\n\tif (!count)\n\t\treturn ENOENT;\n\n\tpos = ((unsigned char *)bp->bitarray) + (bitpos >> 3);\n\t/* scan bytes until 8-byte (64-bit) aligned */\n\twhile (count >= 8 && (((uintptr_t)pos) & 0x07)) {\n\t\tif (*pos != 0) {\n\t\t\tbyte_found = 1;\n\t\t\tbreak;\n\t\t}\n\t\tpos++;\n\t\tcount -= 8;\n\t\tbitpos += 8;\n\t}\n\n\tif (!byte_found) {\n\t\tmax_loop_count = count >> 6; /* 8-byte blocks */\n\t\ti = max_loop_count;\n\t\twhile (i) {\n\t\t\tif (*((const __u64 *)pos) != 0)\n\t\t\t\tbreak;\n\t\t\tpos += 8;\n\t\t\ti--;\n\t\t}\n\t\tcount -= 64 * (max_loop_count - i);\n\t\tbitpos += 64 * (max_loop_count - i);\n\n\t\tmax_loop_count = count >> 3;\n\t\ti = max_loop_count;\n\t\twhile (i) {\n\t\t\tif (*pos != 0) {\n\t\t\t\tbyte_found = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpos++;\n\t\t\ti--;\n\t\t}\n\t\tcount -= 8 * (max_loop_count - i);\n\t\tbitpos += 8 * (max_loop_count - i);\n\t}\n\n\t/* Here either count < 8 or byte_found == 1. */\n\twhile (count-- > 0) {\n\t\tif (ext2fs_test_bit64(bitpos, bp->bitarray)) {\n\t\t\t*out = bitpos + bitmap->start;\n\t\t\treturn 0;\n\t\t}\n\t\tbitpos++;\n\t}\n\n\treturn ENOENT;\n}\n\nstruct ext2_bitmap_ops ext2fs_blkmap64_bitarray = {\n\t.type = EXT2FS_BMAP64_BITARRAY,\n\t.new_bmap = ba_new_bmap,\n\t.free_bmap = ba_free_bmap,\n\t.copy_bmap = ba_copy_bmap,\n\t.resize_bmap = ba_resize_bmap,\n\t.mark_bmap = ba_mark_bmap,\n\t.unmark_bmap = ba_unmark_bmap,\n\t.test_bmap = ba_test_bmap,\n\t.test_clear_bmap_extent = ba_test_clear_bmap_extent,\n\t.mark_bmap_extent = ba_mark_bmap_extent,\n\t.unmark_bmap_extent = ba_unmark_bmap_extent,\n\t.set_bmap_range = ba_set_bmap_range,\n\t.get_bmap_range = ba_get_bmap_range,\n\t.clear_bmap = ba_clear_bmap,\n\t.print_stats = ba_print_stats,\n\t.find_first_zero = ba_find_first_zero,\n\t.find_first_set = ba_find_first_set\n};\n"
  },
  {
    "path": "src/ext2fs/blkmap64_rb.c",
    "content": "/*\n * blkmap64_rb.c --- Simple rb-tree implementation for bitmaps\n *\n * (C)2010 Red Hat, Inc., Lukas Czerner <lczerner@redhat.com>\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Public\n * License.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#if HAVE_LINUX_TYPES_H\n#include <linux/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n#include \"bmap64.h\"\n#include \"rbtree.h\"\n\n#include <limits.h>\n\nstruct bmap_rb_extent {\n\tstruct rb_node node;\n\t__u64 start;\n\t__u64 count;\n};\n\nstruct ext2fs_rb_private {\n\tstruct rb_root root;\n\tstruct bmap_rb_extent *wcursor;\n\tstruct bmap_rb_extent *rcursor;\n\tstruct bmap_rb_extent *rcursor_next;\n#ifdef ENABLE_BMAP_STATS_OPS\n\t__u64 mark_hit;\n\t__u64 test_hit;\n#endif\n};\n\ninline static struct bmap_rb_extent *node_to_extent(struct rb_node *node)\n{\n\t/*\n\t * This depends on the fact the struct rb_node is at the\n\t * beginning of the bmap_rb_extent structure.  We use this\n\t * instead of the ext2fs_rb_entry macro because it causes gcc\n\t * -Wall to generate a huge amount of noise.\n\t */\n\treturn (struct bmap_rb_extent *) node;\n}\n\nstatic int rb_insert_extent(__u64 start, __u64 count,\n\t\t\t    struct ext2fs_rb_private *);\nstatic void rb_get_new_extent(struct bmap_rb_extent **, __u64, __u64);\n\n/* #define DEBUG_RB */\n\n#ifdef DEBUG_RB\nstatic void print_tree(struct rb_root *root)\n{\n\tstruct rb_node *node = NULL;\n\tstruct bmap_rb_extent *ext;\n\n\tfprintf(stderr, \"\\t\\t\\t=================================\\n\");\n\tnode = ext2fs_rb_first(root);\n\tfor (node = ext2fs_rb_first(root); node != NULL; \n\t     node = ext2fs_rb_next(node)) {\n\t\text = node_to_extent(node);\n\t\tfprintf(stderr, \"\\t\\t\\t--> (%llu -> %llu)\\n\",\n\t\t\text->start, ext->start + ext->count);\n\t}\n\tfprintf(stderr, \"\\t\\t\\t=================================\\n\");\n}\n\nstatic void check_tree(struct rb_root *root, const char *msg)\n{\n\tstruct rb_node *node;\n\tstruct bmap_rb_extent *ext, *old = NULL;\n\n\tfor (node = ext2fs_rb_first(root); node;\n\t     node = ext2fs_rb_next(node)) {\n\t\text = node_to_extent(node);\n\t\tif (ext->count == 0) {\n\t\t\tfprintf(stderr, \"Tree Error: count is zero\\n\");\n\t\t\tfprintf(stderr, \"extent: %llu -> %llu (%llu)\\n\",\n\t\t\t\text->start, ext->start + ext->count,\n\t\t\t\text->count);\n\t\t\tgoto err_out;\n\t\t}\n\t\tif (ext->start + ext->count < ext->start) {\n\t\t\tfprintf(stderr,\n\t\t\t\t\"Tree Error: start or count is crazy\\n\");\n\t\t\tfprintf(stderr, \"extent: %llu -> %llu (%llu)\\n\",\n\t\t\t\text->start, ext->start + ext->count,\n\t\t\t\text->count);\n\t\t\tgoto err_out;\n\t\t}\n\n\t\tif (old) {\n\t\t\tif (old->start > ext->start) {\n\t\t\t\tfprintf(stderr, \"Tree Error: start is crazy\\n\");\n\t\t\t\tfprintf(stderr, \"extent: %llu -> %llu (%llu)\\n\",\n\t\t\t\t\told->start, old->start + old->count,\n\t\t\t\t\told->count);\n\t\t\t\tfprintf(stderr,\n\t\t\t\t\t\"extent next: %llu -> %llu (%llu)\\n\",\n\t\t\t\t\text->start, ext->start + ext->count,\n\t\t\t\t\text->count);\n\t\t\t\tgoto err_out;\n\t\t\t}\n\t\t\tif ((old->start + old->count) >= ext->start) {\n\t\t\t\tfprintf(stderr,\n\t\t\t\t\t\"Tree Error: extent is crazy\\n\");\n\t\t\t\tfprintf(stderr, \"extent: %llu -> %llu (%llu)\\n\",\n\t\t\t\t\told->start, old->start + old->count,\n\t\t\t\t\told->count);\n\t\t\t\tfprintf(stderr,\n\t\t\t\t\t\"extent next: %llu -> %llu (%llu)\\n\",\n\t\t\t\t\text->start, ext->start + ext->count,\n\t\t\t\t\text->count);\n\t\t\t\tgoto err_out;\n\t\t\t}\n\t\t}\n\t\told = ext;\n\t}\n\treturn;\n\nerr_out:\n\tfprintf(stderr, \"%s\\n\", msg);\n\tprint_tree(root);\n\texit(1);\n}\n#else\n#define check_tree(root, msg) do {} while (0)\n#define print_tree(root) do {} while (0)\n#endif\n\nstatic void rb_get_new_extent(struct bmap_rb_extent **ext, __u64 start,\n\t\t\t     __u64 count)\n{\n\tstruct bmap_rb_extent *new_ext;\n\tint retval;\n\n\tretval = ext2fs_get_mem(sizeof (struct bmap_rb_extent),\n\t\t\t\t&new_ext);\n\tif (retval)\n\t\tabort();\n\n\tnew_ext->start = start;\n\tnew_ext->count = count;\n\t*ext = new_ext;\n}\n\ninline\nstatic void rb_free_extent(struct ext2fs_rb_private *bp,\n\t\t\t   struct bmap_rb_extent *ext)\n{\n\tif (bp->wcursor == ext)\n\t\tbp->wcursor = NULL;\n\tif (bp->rcursor == ext)\n\t\tbp->rcursor = NULL;\n\tif (bp->rcursor_next == ext)\n\t\tbp->rcursor_next = NULL;\n\text2fs_free_mem(&ext);\n}\n\nstatic errcode_t rb_alloc_private_data (ext2fs_generic_bitmap_64 bitmap)\n{\n\tstruct ext2fs_rb_private *bp;\n\terrcode_t\tretval;\n\n\tretval = ext2fs_get_mem(sizeof (struct ext2fs_rb_private), &bp);\n\tif (retval)\n\t\treturn retval;\n\n\tbp->root = RB_ROOT;\n\tbp->rcursor = NULL;\n\tbp->rcursor_next = NULL;\n\tbp->wcursor = NULL;\n\n#ifdef ENABLE_BMAP_STATS_OPS\n\tbp->test_hit = 0;\n\tbp->mark_hit = 0;\n#endif\n\n\tbitmap->private = (void *) bp;\n\treturn 0;\n}\n\nstatic errcode_t rb_new_bmap(ext2_filsys fs EXT2FS_ATTR((unused)),\n\t\t\t     ext2fs_generic_bitmap_64 bitmap)\n{\n\terrcode_t\tretval;\n\n\tretval = rb_alloc_private_data (bitmap);\n\tif (retval)\n\t\treturn retval;\n\n\treturn 0;\n}\n\nstatic void rb_free_tree(struct rb_root *root)\n{\n\tstruct bmap_rb_extent *ext;\n\tstruct rb_node *node, *next;\n\n\tfor (node = ext2fs_rb_first(root); node; node = next) {\n\t\tnext = ext2fs_rb_next(node);\n\t\text = node_to_extent(node);\n\t\text2fs_rb_erase(node, root);\n\t\text2fs_free_mem(&ext);\n\t}\n}\n\nstatic void rb_free_bmap(ext2fs_generic_bitmap_64 bitmap)\n{\n\tstruct ext2fs_rb_private *bp;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\n\trb_free_tree(&bp->root);\n\text2fs_free_mem(&bp);\n\tbp = 0;\n}\n\nstatic errcode_t rb_copy_bmap(ext2fs_generic_bitmap_64 src,\n\t\t\t      ext2fs_generic_bitmap_64 dest)\n{\n\tstruct ext2fs_rb_private *src_bp, *dest_bp;\n\tstruct bmap_rb_extent *src_ext, *dest_ext;\n\tstruct rb_node *dest_node, *src_node, *dest_last, **n;\n\terrcode_t retval = 0;\n\n\tretval = rb_alloc_private_data (dest);\n\tif (retval)\n\t\treturn retval;\n\n\tsrc_bp = (struct ext2fs_rb_private *) src->private;\n\tdest_bp = (struct ext2fs_rb_private *) dest->private;\n\tsrc_bp->rcursor = NULL;\n\tdest_bp->rcursor = NULL;\n\n\tsrc_node = ext2fs_rb_first(&src_bp->root);\n\twhile (src_node) {\n\t\tsrc_ext = node_to_extent(src_node);\n\t\tretval = ext2fs_get_mem(sizeof (struct bmap_rb_extent),\n\t\t\t\t\t&dest_ext);\n\t\tif (retval)\n\t\t\tbreak;\n\n\t\tmemcpy(dest_ext, src_ext, sizeof(struct bmap_rb_extent));\n\n\t\tdest_node = &dest_ext->node;\n\t\tn = &dest_bp->root.rb_node;\n\n\t\tdest_last = NULL;\n\t\tif (*n) {\n\t\t\tdest_last = ext2fs_rb_last(&dest_bp->root);\n\t\t\tn = &(dest_last)->rb_right;\n\t\t}\n\n\t\text2fs_rb_link_node(dest_node, dest_last, n);\n\t\text2fs_rb_insert_color(dest_node, &dest_bp->root);\n\n\t\tsrc_node = ext2fs_rb_next(src_node);\n\t}\n\n\treturn retval;\n}\n\nstatic void rb_truncate(__u64 new_max, struct rb_root *root)\n{\n\tstruct bmap_rb_extent *ext;\n\tstruct rb_node *node;\n\n\tnode = ext2fs_rb_last(root);\n\twhile (node) {\n\t\text = node_to_extent(node);\n\n\t\tif ((ext->start + ext->count - 1) <= new_max)\n\t\t\tbreak;\n\t\telse if (ext->start > new_max) {\n\t\t\text2fs_rb_erase(node, root);\n\t\t\text2fs_free_mem(&ext);\n\t\t\tnode = ext2fs_rb_last(root);\n\t\t\tcontinue;\n\t\t} else\n\t\t\text->count = new_max - ext->start + 1;\n\t}\n}\n\nstatic errcode_t rb_resize_bmap(ext2fs_generic_bitmap_64 bmap,\n\t\t\t\t__u64 new_end, __u64 new_real_end)\n{\n\tstruct ext2fs_rb_private *bp;\n\n\tbp = (struct ext2fs_rb_private *) bmap->private;\n\tbp->rcursor = NULL;\n\tbp->wcursor = NULL;\n\n\trb_truncate(((new_end < bmap->end) ? new_end : bmap->end) - bmap->start,\n\t\t    &bp->root);\n\n\tbmap->end = new_end;\n\tbmap->real_end = new_real_end;\n\n\tif (bmap->end < bmap->real_end)\n\t\trb_insert_extent(bmap->end + 1 - bmap->start,\n\t\t\t\t bmap->real_end - bmap->end, bp);\n\treturn 0;\n\n}\n\ninline static int\nrb_test_bit(struct ext2fs_rb_private *bp, __u64 bit)\n{\n\tstruct bmap_rb_extent *rcursor, *next_ext = NULL;\n\tstruct rb_node *parent = NULL, *next;\n\tstruct rb_node **n = &bp->root.rb_node;\n\tstruct bmap_rb_extent *ext;\n\n\trcursor = bp->rcursor;\n\tif (!rcursor)\n\t\tgoto search_tree;\n\n\tif (bit >= rcursor->start && bit < rcursor->start + rcursor->count) {\n#ifdef ENABLE_BMAP_STATS_OPS\n\t\tbp->test_hit++;\n#endif\n\t\treturn 1;\n\t}\n\n\tnext_ext = bp->rcursor_next;\n\tif (!next_ext) {\n\t\tnext = ext2fs_rb_next(&rcursor->node);\n\t\tif (next)\n\t\t\tnext_ext = node_to_extent(next);\n\t\tbp->rcursor_next = next_ext;\n\t}\n\tif (next_ext) {\n\t\tif ((bit >= rcursor->start + rcursor->count) &&\n\t\t    (bit < next_ext->start)) {\n#ifdef BMAP_STATS_OPS\n\t\t\tbp->test_hit++;\n#endif\n\t\t\treturn 0;\n\t\t}\n\t}\n\tbp->rcursor = NULL;\n\tbp->rcursor_next = NULL;\n\n\trcursor = bp->wcursor;\n\tif (!rcursor)\n\t\tgoto search_tree;\n\n\tif (bit >= rcursor->start && bit < rcursor->start + rcursor->count)\n\t\treturn 1;\n\nsearch_tree:\n\n\twhile (*n) {\n\t\tparent = *n;\n\t\text = node_to_extent(parent);\n\t\tif (bit < ext->start)\n\t\t\tn = &(*n)->rb_left;\n\t\telse if (bit >= (ext->start + ext->count))\n\t\t\tn = &(*n)->rb_right;\n\t\telse {\n\t\t\tbp->rcursor = ext;\n\t\t\tbp->rcursor_next = NULL;\n\t\t\treturn 1;\n\t\t}\n\t}\n\treturn 0;\n}\n\nstatic int rb_insert_extent(__u64 start, __u64 count,\n\t\t\t    struct ext2fs_rb_private *bp)\n{\n\tstruct rb_root *root = &bp->root;\n\tstruct rb_node *parent = NULL, **n = &root->rb_node;\n\tstruct rb_node *new_node, *node, *next;\n\tstruct bmap_rb_extent *new_ext;\n\tstruct bmap_rb_extent *ext;\n\tint retval = 0;\n\n\tif (count == 0)\n\t\treturn 0;\n\n\tbp->rcursor_next = NULL;\n\text = bp->wcursor;\n\tif (ext) {\n\t\tif (start >= ext->start &&\n\t\t    start <= (ext->start + ext->count)) {\n#ifdef ENABLE_BMAP_STATS_OPS\n\t\t\tbp->mark_hit++;\n#endif\n\t\t\tgoto got_extent;\n\t\t}\n\t}\n\n\twhile (*n) {\n\t\tparent = *n;\n\t\text = node_to_extent(parent);\n\n\t\tif (start < ext->start) {\n\t\t\tn = &(*n)->rb_left;\n\t\t} else if (start > (ext->start + ext->count)) {\n\t\t\tn = &(*n)->rb_right;\n\t\t} else {\ngot_extent:\n\t\t\tif ((start + count) <= (ext->start + ext->count))\n\t\t\t\treturn 1;\n\n\t\t\tif ((ext->start + ext->count) == start)\n\t\t\t\tretval = 0;\n\t\t\telse\n\t\t\t\tretval = 1;\n\n\t\t\tcount += (start - ext->start);\n\t\t\tstart = ext->start;\n\t\t\tnew_ext = ext;\n\t\t\tnew_node = &ext->node;\n\n\t\t\tgoto skip_insert;\n\t\t}\n\t}\n\n\trb_get_new_extent(&new_ext, start, count);\n\n\tnew_node = &new_ext->node;\n\text2fs_rb_link_node(new_node, parent, n);\n\text2fs_rb_insert_color(new_node, root);\n\tbp->wcursor = new_ext;\n\n\tnode = ext2fs_rb_prev(new_node);\n\tif (node) {\n\t\text = node_to_extent(node);\n\t\tif ((ext->start + ext->count) == start) {\n\t\t\tstart = ext->start;\n\t\t\tcount += ext->count;\n\t\t\text2fs_rb_erase(node, root);\n\t\t\trb_free_extent(bp, ext);\n\t\t}\n\t}\n\nskip_insert:\n\t/* See if we can merge extent to the right */\n\tfor (node = ext2fs_rb_next(new_node); node != NULL; node = next) {\n\t\tnext = ext2fs_rb_next(node);\n\t\text = node_to_extent(node);\n\n\t\tif ((ext->start + ext->count) <= start)\n\t\t\tcontinue;\n\n\t\t/* No more merging */\n\t\tif ((start + count) < ext->start)\n\t\t\tbreak;\n\n\t\t/* ext is embedded in new_ext interval */\n\t\tif ((start + count) >= (ext->start + ext->count)) {\n\t\t\text2fs_rb_erase(node, root);\n\t\t\trb_free_extent(bp, ext);\n\t\t\tcontinue;\n\t\t} else {\n\t\t/* merge ext with new_ext */\n\t\t\tcount += ((ext->start + ext->count) -\n\t\t\t\t  (start + count));\n\t\t\text2fs_rb_erase(node, root);\n\t\t\trb_free_extent(bp, ext);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tnew_ext->start = start;\n\tnew_ext->count = count;\n\n\treturn retval;\n}\n\nstatic int rb_remove_extent(__u64 start, __u64 count,\n\t\t\t    struct ext2fs_rb_private *bp)\n{\n\tstruct rb_root *root = &bp->root;\n\tstruct rb_node *parent = NULL, **n = &root->rb_node;\n\tstruct rb_node *node;\n\tstruct bmap_rb_extent *ext;\n\t__u64 new_start, new_count;\n\tint retval = 0;\n\n\tif (ext2fs_rb_empty_root(root))\n\t\treturn 0;\n\n\twhile (*n) {\n\t\tparent = *n;\n\t\text = node_to_extent(parent);\n\t\tif (start < ext->start) {\n\t\t\tn = &(*n)->rb_left;\n\t\t\tcontinue;\n\t\t} else if (start >= (ext->start + ext->count)) {\n\t\t\tn = &(*n)->rb_right;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ((start > ext->start) &&\n\t\t    (start + count) < (ext->start + ext->count)) {\n\t\t\t/* We have to split extent into two */\n\t\t\tnew_start = start + count;\n\t\t\tnew_count = (ext->start + ext->count) - new_start;\n\n\t\t\text->count = start - ext->start;\n\n\t\t\trb_insert_extent(new_start, new_count, bp);\n\t\t\treturn 1;\n\t\t}\n\n\t\tif ((start + count) >= (ext->start + ext->count)) {\n\t\t\text->count = start - ext->start;\n\t\t\tretval = 1;\n\t\t}\n\n\t\tif (0 == ext->count) {\n\t\t\tparent = ext2fs_rb_next(&ext->node);\n\t\t\text2fs_rb_erase(&ext->node, root);\n\t\t\trb_free_extent(bp, ext);\n\t\t\tbreak;\n\t\t}\n\n\t\tif (start == ext->start) {\n\t\t\text->start += count;\n\t\t\text->count -= count;\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\t/* See if we should delete or truncate extent on the right */\n\tfor (; parent != NULL; parent = node) {\n\t\tnode = ext2fs_rb_next(parent);\n\t\text = node_to_extent(parent);\n\t\tif ((ext->start + ext->count) <= start)\n\t\t\tcontinue;\n\n\t\t/* No more extents to be removed/truncated */\n\t\tif ((start + count) < ext->start)\n\t\t\tbreak;\n\n\t\t/* The entire extent is within the region to be removed */\n\t\tif ((start + count) >= (ext->start + ext->count)) {\n\t\t\text2fs_rb_erase(parent, root);\n\t\t\trb_free_extent(bp, ext);\n\t\t\tretval = 1;\n\t\t\tcontinue;\n\t\t} else {\n\t\t\t/* modify the last extent in region to be removed */\n\t\t\text->count -= ((start + count) - ext->start);\n\t\t\text->start = start + count;\n\t\t\tretval = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn retval;\n}\n\nstatic int rb_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)\n{\n\tstruct ext2fs_rb_private *bp;\n\tint retval;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\targ -= bitmap->start;\n\n\tretval = rb_insert_extent(arg, 1, bp);\n\tcheck_tree(&bp->root, __func__);\n\treturn retval;\n}\n\nstatic int rb_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)\n{\n\tstruct ext2fs_rb_private *bp;\n\tint retval;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\targ -= bitmap->start;\n\n\tretval = rb_remove_extent(arg, 1, bp);\n\tcheck_tree(&bp->root, __func__);\n\n\treturn retval;\n}\n\ninline\nstatic int rb_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg)\n{\n\tstruct ext2fs_rb_private *bp;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\targ -= bitmap->start;\n\n\treturn rb_test_bit(bp, arg);\n}\n\nstatic void rb_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,\n\t\t\t\tunsigned int num)\n{\n\tstruct ext2fs_rb_private *bp;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\targ -= bitmap->start;\n\n\trb_insert_extent(arg, num, bp);\n\tcheck_tree(&bp->root, __func__);\n}\n\nstatic void rb_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg,\n\t\t\t\t  unsigned int num)\n{\n\tstruct ext2fs_rb_private *bp;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\targ -= bitmap->start;\n\n\trb_remove_extent(arg, num, bp);\n\tcheck_tree(&bp->root, __func__);\n}\n\nstatic int rb_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t     __u64 start, unsigned int len)\n{\n\tstruct rb_node *parent = NULL, **n;\n\tstruct rb_node *node, *next;\n\tstruct ext2fs_rb_private *bp;\n\tstruct bmap_rb_extent *ext;\n\tint retval = 1;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\tn = &bp->root.rb_node;\n\tstart -= bitmap->start;\n\n\tif (len == 0 || ext2fs_rb_empty_root(&bp->root))\n\t\treturn 1;\n\n\t/*\n\t * If we find nothing, we should examine whole extent, but\n\t * when we find match, the extent is not clean, thus be return\n\t * false.\n\t */\n\twhile (*n) {\n\t\tparent = *n;\n\t\text = node_to_extent(parent);\n\t\tif (start < ext->start) {\n\t\t\tn = &(*n)->rb_left;\n\t\t} else if (start >= (ext->start + ext->count)) {\n\t\t\tn = &(*n)->rb_right;\n\t\t} else {\n\t\t\t/*\n\t\t\t * We found extent int the tree -> extent is not\n\t\t\t * clean\n\t\t\t */\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tnode = parent;\n\twhile (node) {\n\t\tnext = ext2fs_rb_next(node);\n\t\text = node_to_extent(node);\n\t\tnode = next;\n\n\t\tif ((ext->start + ext->count) <= start)\n\t\t\tcontinue;\n\n\t\t/* No more merging */\n\t\tif ((start + len) <= ext->start)\n\t\t\tbreak;\n\n\t\tretval = 0;\n\t\tbreak;\n\t}\n\treturn retval;\n}\n\nstatic errcode_t rb_set_bmap_range(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t     __u64 start, size_t num, void *in)\n{\n\tstruct ext2fs_rb_private *bp;\n\tunsigned char *cp = in;\n\tsize_t i;\n\tint first_set = -1;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\n\tfor (i = 0; i < num; i++) {\n\t\tif ((i & 7) == 0) {\n\t\t\tunsigned char c = cp[i/8];\n\t\t\tif (c == 0xFF) {\n\t\t\t\tif (first_set == -1)\n\t\t\t\t\tfirst_set = i;\n\t\t\t\ti += 7;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ((c == 0x00) && (first_set == -1)) {\n\t\t\t\ti += 7;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (ext2fs_test_bit(i, in)) {\n\t\t\tif (first_set == -1)\n\t\t\t\tfirst_set = i;\n\t\t\tcontinue;\n\t\t}\n\t\tif (first_set == -1)\n\t\t\tcontinue;\n\n\t\trb_insert_extent(start + first_set - bitmap->start,\n\t\t\t\t (__u64)i - first_set, bp);\n\t\tcheck_tree(&bp->root, __func__);\n\t\tfirst_set = -1;\n\t}\n\tif (first_set != -1) {\n\t\trb_insert_extent(start + first_set - bitmap->start,\n\t\t\t\t (__u64)num - first_set, bp);\n\t\tcheck_tree(&bp->root, __func__);\n\t}\n\n\treturn 0;\n}\n\nstatic errcode_t rb_get_bmap_range(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t     __u64 start, size_t num, void *out)\n{\n\n\tstruct rb_node *parent = NULL, *next, **n;\n\tstruct ext2fs_rb_private *bp;\n\tstruct bmap_rb_extent *ext;\n\t__u64 count, pos;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\tn = &bp->root.rb_node;\n\tstart -= bitmap->start;\n\n\tif (ext2fs_rb_empty_root(&bp->root))\n\t\treturn 0;\n\n\twhile (*n) {\n\t\tparent = *n;\n\t\text = node_to_extent(parent);\n\t\tif (start < ext->start) {\n\t\t\tn = &(*n)->rb_left;\n\t\t} else if (start >= (ext->start + ext->count)) {\n\t\t\tn = &(*n)->rb_right;\n\t\t} else\n\t\t\tbreak;\n\t}\n\n\tmemset(out, 0, (num + 7) >> 3);\n\n\tfor (; parent != NULL; parent = next) {\n\t\tnext = ext2fs_rb_next(parent);\n\t\text = node_to_extent(parent);\n\n\t\tpos = ext->start;\n\t\tcount = ext->count;\n\t\tif (pos >= start + num)\n\t\t\tbreak;\n\t\tif (pos < start) {\n\t\t\tif (pos + count <  start)\n\t\t\t\tcontinue;\n\t\t\tcount -= start - pos;\n\t\t\tpos = start;\n\t\t}\n\t\tif (pos + count > start + num)\n\t\t\tcount = start + num - pos;\n\n\t\twhile (count > 0) {\n\t\t\tif ((count >= 8) &&\n\t\t\t    ((pos - start) % 8) == 0) {\n\t\t\t\tint nbytes = count >> 3;\n\t\t\t\tint offset = (pos - start) >> 3;\n\n\t\t\t\tmemset(((char *) out) + offset, 0xFF, nbytes);\n\t\t\t\tpos += (__u64)nbytes << 3;\n\t\t\t\tcount -= (__u64)nbytes << 3;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\text2fs_fast_set_bit64((pos - start), out);\n\t\t\tpos++;\n\t\t\tcount--;\n\t\t}\n\t}\n\treturn 0;\n}\n\nstatic void rb_clear_bmap(ext2fs_generic_bitmap_64 bitmap)\n{\n\tstruct ext2fs_rb_private *bp;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\n\trb_free_tree(&bp->root);\n\tbp->rcursor = NULL;\n\tbp->rcursor_next = NULL;\n\tbp->wcursor = NULL;\n\tcheck_tree(&bp->root, __func__);\n}\n\nstatic errcode_t rb_find_first_zero(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t   __u64 start, __u64 end, __u64 *out)\n{\n\tstruct rb_node *parent = NULL, **n;\n\tstruct ext2fs_rb_private *bp;\n\tstruct bmap_rb_extent *ext;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\tn = &bp->root.rb_node;\n\tstart -= bitmap->start;\n\tend -= bitmap->start;\n\n\tif (start > end)\n\t\treturn EINVAL;\n\n\tif (ext2fs_rb_empty_root(&bp->root))\n\t\treturn ENOENT;\n\n\twhile (*n) {\n\t\tparent = *n;\n\t\text = node_to_extent(parent);\n\t\tif (start < ext->start) {\n\t\t\tn = &(*n)->rb_left;\n\t\t} else if (start >= (ext->start + ext->count)) {\n\t\t\tn = &(*n)->rb_right;\n\t\t} else if (ext->start + ext->count <= end) {\n\t\t\t*out = ext->start + ext->count + bitmap->start;\n\t\t\treturn 0;\n\t\t} else\n\t\t\treturn ENOENT;\n\t}\n\n\t*out = start + bitmap->start;\n\treturn 0;\n}\n\nstatic errcode_t rb_find_first_set(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t   __u64 start, __u64 end, __u64 *out)\n{\n\tstruct rb_node *parent = NULL, **n;\n\tstruct rb_node *node;\n\tstruct ext2fs_rb_private *bp;\n\tstruct bmap_rb_extent *ext;\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\tn = &bp->root.rb_node;\n\tstart -= bitmap->start;\n\tend -= bitmap->start;\n\n\tif (start > end)\n\t\treturn EINVAL;\n\n\tif (ext2fs_rb_empty_root(&bp->root))\n\t\treturn ENOENT;\n\n\twhile (*n) {\n\t\tparent = *n;\n\t\text = node_to_extent(parent);\n\t\tif (start < ext->start) {\n\t\t\tn = &(*n)->rb_left;\n\t\t} else if (start >= (ext->start + ext->count)) {\n\t\t\tn = &(*n)->rb_right;\n\t\t} else {\n\t\t\t/* The start bit is set */\n\t\t\t*out = start + bitmap->start;\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tnode = parent;\n\text = node_to_extent(node);\n\tif (ext->start < start) {\n\t\tnode = ext2fs_rb_next(node);\n\t\tif (node == NULL)\n\t\t\treturn ENOENT;\n\t\text = node_to_extent(node);\n\t}\n\tif (ext->start <= end) {\n\t\t*out = ext->start + bitmap->start;\n\t\treturn 0;\n\t}\n\treturn ENOENT;\n}\n\n#ifdef ENABLE_BMAP_STATS\nstatic void rb_print_stats(ext2fs_generic_bitmap_64 bitmap)\n{\n\tstruct ext2fs_rb_private *bp;\n\tstruct rb_node *node = NULL;\n\tstruct bmap_rb_extent *ext;\n\t__u64 count = 0;\n\t__u64 max_size = 0;\n\t__u64 min_size = ULONG_MAX;\n\t__u64 size = 0, avg_size = 0;\n\tdouble eff;\n#ifdef ENABLE_BMAP_STATS_OPS\n\t__u64 mark_all, test_all;\n\tdouble m_hit = 0.0, t_hit = 0.0;\n#endif\n\n\tbp = (struct ext2fs_rb_private *) bitmap->private;\n\n\tfor (node = ext2fs_rb_first(&bp->root); node != NULL;\n\t     node = ext2fs_rb_next(node)) {\n\t\text = node_to_extent(node);\n\t\tcount++;\n\t\tif (ext->count > max_size)\n\t\t\tmax_size = ext->count;\n\t\tif (ext->count < min_size)\n\t\t\tmin_size = ext->count;\n\t\tsize += ext->count;\n\t}\n\n\tif (count)\n\t\tavg_size = size / count;\n\tif (min_size == ULONG_MAX)\n\t\tmin_size = 0;\n\teff = (double)((count * sizeof(struct bmap_rb_extent)) << 3) /\n\t      (bitmap->real_end - bitmap->start);\n#ifdef ENABLE_BMAP_STATS_OPS\n\tmark_all = bitmap->stats.mark_count + bitmap->stats.mark_ext_count;\n\ttest_all = bitmap->stats.test_count + bitmap->stats.test_ext_count;\n\tif (mark_all)\n\t\tm_hit = ((double)bp->mark_hit / mark_all) * 100;\n\tif (test_all)\n\t\tt_hit = ((double)bp->test_hit / test_all) * 100;\n\n\tfprintf(stderr, \"%16llu cache hits on test (%.2f%%)\\n\"\n\t\t\"%16llu cache hits on mark (%.2f%%)\\n\",\n\t\tbp->test_hit, t_hit, bp->mark_hit, m_hit);\n#endif\n\tfprintf(stderr, \"%16llu extents (%llu bytes)\\n\",\n\t\tcount, ((count * sizeof(struct bmap_rb_extent)) +\n\t\t\tsizeof(struct ext2fs_rb_private)));\n \tfprintf(stderr, \"%16llu bits minimum size\\n\",\n\t\tmin_size);\n\tfprintf(stderr, \"%16llu bits maximum size\\n\"\n\t\t\"%16llu bits average size\\n\",\n\t\tmax_size, avg_size);\n\tfprintf(stderr, \"%16llu bits set in bitmap (out of %llu)\\n\", size,\n\t\tbitmap->real_end - bitmap->start);\n\tfprintf(stderr,\n\t\t\"%16.4lf memory / bitmap bit memory ratio (bitarray = 1)\\n\",\n\t\teff);\n}\n#else\nstatic void rb_print_stats(ext2fs_generic_bitmap_64 bitmap EXT2FS_ATTR((unused)))\n{\n}\n#endif\n\nstruct ext2_bitmap_ops ext2fs_blkmap64_rbtree = {\n\t.type = EXT2FS_BMAP64_RBTREE,\n\t.new_bmap = rb_new_bmap,\n\t.free_bmap = rb_free_bmap,\n\t.copy_bmap = rb_copy_bmap,\n\t.resize_bmap = rb_resize_bmap,\n\t.mark_bmap = rb_mark_bmap,\n\t.unmark_bmap = rb_unmark_bmap,\n\t.test_bmap = rb_test_bmap,\n\t.test_clear_bmap_extent = rb_test_clear_bmap_extent,\n\t.mark_bmap_extent = rb_mark_bmap_extent,\n\t.unmark_bmap_extent = rb_unmark_bmap_extent,\n\t.set_bmap_range = rb_set_bmap_range,\n\t.get_bmap_range = rb_get_bmap_range,\n\t.clear_bmap = rb_clear_bmap,\n\t.print_stats = rb_print_stats,\n\t.find_first_zero = rb_find_first_zero,\n\t.find_first_set = rb_find_first_set,\n};\n"
  },
  {
    "path": "src/ext2fs/blknum.c",
    "content": "/*\n * blknum.c --- Functions to handle blk64_t and high/low 64-bit block\n * number.\n *\n * Copyright IBM Corporation, 2007\n * Author Jose R. Santos <jrs@us.ibm.com>\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Public\n * License.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include \"ext2fs.h\"\n\n/*\n * Return the group # of a block\n */\ndgrp_t ext2fs_group_of_blk2(ext2_filsys fs, blk64_t blk)\n{\n\treturn (blk - fs->super->s_first_data_block) /\n\t\tfs->super->s_blocks_per_group;\n}\n\n/*\n * Return the first block (inclusive) in a group\n */\nblk64_t ext2fs_group_first_block2(ext2_filsys fs, dgrp_t group)\n{\n\treturn fs->super->s_first_data_block +\n\t\tEXT2_GROUPS_TO_BLOCKS(fs->super, group);\n}\n\n/*\n * Return the last block (inclusive) in a group\n */\nblk64_t ext2fs_group_last_block2(ext2_filsys fs, dgrp_t group)\n{\n\treturn (group == fs->group_desc_count - 1 ?\n\t\text2fs_blocks_count(fs->super) - 1 :\n\t\text2fs_group_first_block2(fs, group) +\n\t\t\t(fs->super->s_blocks_per_group - 1));\n}\n\n/*\n * Return the number of blocks in a group\n */\nint ext2fs_group_blocks_count(ext2_filsys fs, dgrp_t group)\n{\n\tint num_blocks;\n\n\tif (group == fs->group_desc_count - 1) {\n\t\tnum_blocks = (ext2fs_blocks_count(fs->super) -\n\t\t\t\tfs->super->s_first_data_block) %\n\t\t\t      fs->super->s_blocks_per_group;\n\t\tif (!num_blocks)\n\t\t\tnum_blocks = fs->super->s_blocks_per_group;\n\t} else\n\t\tnum_blocks = fs->super->s_blocks_per_group;\n\n\treturn num_blocks;\n}\n\n/*\n * Return the inode data block count\n */\nblk64_t ext2fs_inode_data_blocks2(ext2_filsys fs,\n\t\t\t\t\tstruct ext2_inode *inode)\n{\n\treturn (inode->i_blocks |\n\t\t(ext2fs_has_feature_huge_file(fs->super) ?\n\t\t (__u64) inode->osd2.linux2.l_i_blocks_hi << 32 : 0)) -\n\t\t(inode->i_file_acl ? EXT2_CLUSTER_SIZE(fs->super) >> 9 : 0);\n}\n\n/*\n * Return the inode i_blocks count\n */\nblk64_t ext2fs_inode_i_blocks(ext2_filsys fs,\n\t\t\t\t\tstruct ext2_inode *inode)\n{\n\treturn (inode->i_blocks |\n\t\t(ext2fs_has_feature_huge_file(fs->super) ?\n\t\t (__u64)inode->osd2.linux2.l_i_blocks_hi << 32 : 0));\n}\n\n/*\n * Return the inode i_blocks in stat (512 byte) units\n */\nblk64_t ext2fs_get_stat_i_blocks(ext2_filsys fs,\n\t\t\t\t struct ext2_inode *inode)\n{\n\tblk64_t\tret = inode->i_blocks;\n\n\tif (ext2fs_has_feature_huge_file(fs->super)) {\n\t\tret += ((long long) inode->osd2.linux2.l_i_blocks_hi) << 32;\n\t\tif (inode->i_flags & EXT4_HUGE_FILE_FL)\n\t\t\tret *= (fs->blocksize / 512);\n\t}\n\treturn ret;\n}\n\n/*\n * Return the fs block count\n */\nblk64_t ext2fs_blocks_count(struct ext2_super_block *super)\n{\n\treturn super->s_blocks_count |\n\t\t(ext2fs_has_feature_64bit(super) ?\n\t\t(__u64) super->s_blocks_count_hi << 32 : 0);\n}\n\n/*\n * Set the fs block count\n */\nvoid ext2fs_blocks_count_set(struct ext2_super_block *super, blk64_t blk)\n{\n\tsuper->s_blocks_count = blk;\n\tif (ext2fs_has_feature_64bit(super))\n\t\tsuper->s_blocks_count_hi = (__u64) blk >> 32;\n}\n\n/*\n * Add to the current fs block count\n */\nvoid ext2fs_blocks_count_add(struct ext2_super_block *super, blk64_t blk)\n{\n\tblk64_t tmp;\n\ttmp = ext2fs_blocks_count(super) + blk;\n\text2fs_blocks_count_set(super, tmp);\n}\n\n/*\n * Return the fs reserved block count\n */\nblk64_t ext2fs_r_blocks_count(struct ext2_super_block *super)\n{\n\treturn super->s_r_blocks_count |\n\t\t(ext2fs_has_feature_64bit(super) ?\n\t\t(__u64) super->s_r_blocks_count_hi << 32 : 0);\n}\n\n/*\n * Set the fs reserved block count\n */\nvoid ext2fs_r_blocks_count_set(struct ext2_super_block *super, blk64_t blk)\n{\n\tsuper->s_r_blocks_count = blk;\n\tif (ext2fs_has_feature_64bit(super))\n\t\tsuper->s_r_blocks_count_hi = (__u64) blk >> 32;\n}\n\n/*\n * Add to the current reserved fs block count\n */\nvoid ext2fs_r_blocks_count_add(struct ext2_super_block *super, blk64_t blk)\n{\n\tblk64_t tmp;\n\ttmp = ext2fs_r_blocks_count(super) + blk;\n\text2fs_r_blocks_count_set(super, tmp);\n}\n\n/*\n * Return the fs free block count\n */\nblk64_t ext2fs_free_blocks_count(struct ext2_super_block *super)\n{\n\treturn super->s_free_blocks_count |\n\t\t(ext2fs_has_feature_64bit(super) ?\n\t\t(__u64) super->s_free_blocks_hi << 32 : 0);\n}\n\n/*\n * Set the fs free block count\n */\nvoid ext2fs_free_blocks_count_set(struct ext2_super_block *super, blk64_t blk)\n{\n\tsuper->s_free_blocks_count = blk;\n\tif (ext2fs_has_feature_64bit(super))\n\t\tsuper->s_free_blocks_hi = (__u64) blk >> 32;\n}\n\n/*\n * Add to the current free fs block count\n */\nvoid ext2fs_free_blocks_count_add(struct ext2_super_block *super, blk64_t blk)\n{\n\tblk64_t tmp;\n\ttmp = ext2fs_free_blocks_count(super) + blk;\n\text2fs_free_blocks_count_set(super, tmp);\n}\n\n/*\n * Get a pointer to a block group descriptor.  We need the explicit\n * pointer to the group desc for code that swaps block group\n * descriptors before writing them out, as it wants to make a copy and\n * do the swap there.\n */\nstruct ext2_group_desc *ext2fs_group_desc(ext2_filsys fs,\n\t\t\t\t\t  struct opaque_ext2_group_desc *gdp,\n\t\t\t\t\t  dgrp_t group)\n{\n\tstruct ext2_group_desc *ret_gdp;\n\terrcode_t\tretval;\n\tstatic char\t*buf = 0;\n\tstatic int\tbufsize = 0;\n\tblk64_t\t\tblk;\n\tint\t\tdesc_size = EXT2_DESC_SIZE(fs->super) & ~7;\n\tint\t\tdesc_per_blk = EXT2_DESC_PER_BLOCK(fs->super);\n\n\tif (group > fs->group_desc_count)\n\t\treturn NULL;\n\tif (gdp)\n\t\treturn (struct ext2_group_desc *)((char *)gdp +\n\t\t\t\t\t\t  group * desc_size);\n\t/*\n\t * If fs->group_desc wasn't read in when the file system was\n\t * opened, then read it on demand here.\n\t */\n\tif (bufsize < fs->blocksize)\n\t\text2fs_free_mem(&buf);\n\tif (!buf) {\n\t\tretval = ext2fs_get_mem(fs->blocksize, &buf);\n\t\tif (retval)\n\t\t\treturn NULL;\n\t\tbufsize = fs->blocksize;\n\t}\n\tblk = ext2fs_descriptor_block_loc2(fs, fs->super->s_first_data_block,\n\t\t\t\t\t   group / desc_per_blk);\n\tretval = io_channel_read_blk(fs->io, blk, 1, buf);\n\tif (retval)\n\t\treturn NULL;\n\tret_gdp = (struct ext2_group_desc *)\n\t\t(buf + ((group % desc_per_blk) * desc_size));\n#ifdef WORDS_BIGENDIAN\n\text2fs_swap_group_desc2(fs, ret_gdp);\n#endif\n\treturn ret_gdp;\n}\n\n/* Do the same but as an ext4 group desc for internal use here */\nstatic struct ext4_group_desc *ext4fs_group_desc(ext2_filsys fs,\n\t\t\t\t\t  struct opaque_ext2_group_desc *gdp,\n\t\t\t\t\t  dgrp_t group)\n{\n\treturn (struct ext4_group_desc *)ext2fs_group_desc(fs, gdp, group);\n}\n\n/*\n * Return the block bitmap checksum of a group\n */\n__u32 ext2fs_block_bitmap_checksum(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\t__u32 csum;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tcsum = gdp->bg_block_bitmap_csum_lo;\n\tif (EXT2_DESC_SIZE(fs->super) >= EXT4_BG_BLOCK_BITMAP_CSUM_HI_LOCATION)\n\t\tcsum |= ((__u32)gdp->bg_block_bitmap_csum_hi << 16);\n\treturn csum;\n}\n\n/*\n * Return the block bitmap block of a group\n */\nblk64_t ext2fs_block_bitmap_loc(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\treturn gdp->bg_block_bitmap |\n\t\t(ext2fs_has_feature_64bit(fs->super) ?\n\t\t (__u64)gdp->bg_block_bitmap_hi << 32 : 0);\n}\n\n/*\n * Set the block bitmap block of a group\n */\nvoid ext2fs_block_bitmap_loc_set(ext2_filsys fs, dgrp_t group, blk64_t blk)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tgdp->bg_block_bitmap = blk;\n\tif (ext2fs_has_feature_64bit(fs->super))\n\t\tgdp->bg_block_bitmap_hi = (__u64) blk >> 32;\n}\n\n/*\n * Return the inode bitmap checksum of a group\n */\n__u32 ext2fs_inode_bitmap_checksum(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\t__u32 csum;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tcsum = gdp->bg_inode_bitmap_csum_lo;\n\tif (EXT2_DESC_SIZE(fs->super) >= EXT4_BG_INODE_BITMAP_CSUM_HI_END)\n\t\tcsum |= ((__u32)gdp->bg_inode_bitmap_csum_hi << 16);\n\treturn csum;\n}\n\n/*\n * Return the inode bitmap block of a group\n */\nblk64_t ext2fs_inode_bitmap_loc(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\treturn gdp->bg_inode_bitmap |\n\t\t(ext2fs_has_feature_64bit(fs->super) ?\n\t\t (__u64) gdp->bg_inode_bitmap_hi << 32 : 0);\n}\n\n/*\n * Set the inode bitmap block of a group\n */\nvoid ext2fs_inode_bitmap_loc_set(ext2_filsys fs, dgrp_t group, blk64_t blk)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tgdp->bg_inode_bitmap = blk;\n\tif (ext2fs_has_feature_64bit(fs->super))\n\t\tgdp->bg_inode_bitmap_hi = (__u64) blk >> 32;\n}\n\n/*\n * Return the inode table block of a group\n */\nblk64_t ext2fs_inode_table_loc(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\treturn gdp->bg_inode_table |\n\t\t(ext2fs_has_feature_64bit(fs->super) ?\n\t\t (__u64) gdp->bg_inode_table_hi << 32 : 0);\n}\n\n/*\n * Set the inode table block of a group\n */\nvoid ext2fs_inode_table_loc_set(ext2_filsys fs, dgrp_t group, blk64_t blk)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tgdp->bg_inode_table = blk;\n\tif (ext2fs_has_feature_64bit(fs->super))\n\t\tgdp->bg_inode_table_hi = (__u64) blk >> 32;\n}\n\n/*\n * Return the free blocks count of a group\n */\n__u32 ext2fs_bg_free_blocks_count(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\treturn gdp->bg_free_blocks_count |\n\t\t(ext2fs_has_feature_64bit(fs->super) ?\n\t\t (__u32) gdp->bg_free_blocks_count_hi << 16 : 0);\n}\n\n/*\n * Set the free blocks count of a group\n */\nvoid ext2fs_bg_free_blocks_count_set(ext2_filsys fs, dgrp_t group, __u32 n)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tgdp->bg_free_blocks_count = n;\n\n\tif (ext2fs_has_feature_64bit(fs->super))\n\t\tgdp->bg_free_blocks_count_hi = (__u32) n >> 16;\n}\n\n/*\n * Return the free inodes count of a group\n */\n__u32 ext2fs_bg_free_inodes_count(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\treturn gdp->bg_free_inodes_count |\n\t\t(ext2fs_has_feature_64bit(fs->super) ?\n\t\t (__u32) gdp->bg_free_inodes_count_hi << 16 : 0);\n}\n\n/*\n * Set the free inodes count of a group\n */\nvoid ext2fs_bg_free_inodes_count_set(ext2_filsys fs, dgrp_t group, __u32 n)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tgdp->bg_free_inodes_count = n;\n\tif (ext2fs_has_feature_64bit(fs->super))\n\t\tgdp->bg_free_inodes_count_hi = (__u32) n >> 16;\n}\n\n/*\n * Return the used dirs count of a group\n */\n__u32 ext2fs_bg_used_dirs_count(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\treturn gdp->bg_used_dirs_count |\n\t\t(ext2fs_has_feature_64bit(fs->super) ?\n\t\t (__u32) gdp->bg_used_dirs_count_hi << 16 : 0);\n}\n\n/*\n * Set the used dirs count of a group\n */\nvoid ext2fs_bg_used_dirs_count_set(ext2_filsys fs, dgrp_t group, __u32 n)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tgdp->bg_used_dirs_count = n;\n\tif (ext2fs_has_feature_64bit(fs->super))\n\t\tgdp->bg_used_dirs_count_hi = (__u32) n >> 16;\n}\n\n/*\n * Return the unused inodes count of a group\n */\n__u32 ext2fs_bg_itable_unused(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\treturn gdp->bg_itable_unused |\n\t\t(ext2fs_has_feature_64bit(fs->super) ?\n\t\t (__u32) gdp->bg_itable_unused_hi << 16 : 0);\n}\n\n/*\n * Set the unused inodes count of a group\n */\nvoid ext2fs_bg_itable_unused_set(ext2_filsys fs, dgrp_t group, __u32 n)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tgdp->bg_itable_unused = n;\n\tif (ext2fs_has_feature_64bit(fs->super))\n\t\tgdp->bg_itable_unused_hi = (__u32) n >> 16;\n}\n\n/*\n * Get the flags for this block group\n */\n__u16 ext2fs_bg_flags(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\treturn gdp->bg_flags;\n}\n\n/*\n * Zero out the flags for this block group\n */\nvoid ext2fs_bg_flags_zap(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tgdp->bg_flags = 0;\n\treturn;\n}\n\n/*\n * Get the value of a particular flag for this block group\n */\nint ext2fs_bg_flags_test(ext2_filsys fs, dgrp_t group, __u16 bg_flag)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\treturn gdp->bg_flags & bg_flag;\n}\n\n/*\n * Set a flag or set of flags for this block group\n */\nvoid ext2fs_bg_flags_set(ext2_filsys fs, dgrp_t group, __u16 bg_flags)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tgdp->bg_flags |= bg_flags;\n\treturn;\n}\n\n/*\n * Clear a flag or set of flags for this block group\n */\nvoid ext2fs_bg_flags_clear(ext2_filsys fs, dgrp_t group, __u16 bg_flags)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tgdp->bg_flags &= ~bg_flags;\n\treturn;\n}\n\n/*\n * Get the checksum for this block group\n */\n__u16 ext2fs_bg_checksum(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\treturn gdp->bg_checksum;\n}\n\n/*\n * Set the checksum for this block group to a previously calculated value\n */\nvoid ext2fs_bg_checksum_set(ext2_filsys fs, dgrp_t group, __u16 checksum)\n{\n\tstruct ext4_group_desc *gdp;\n\n\tgdp = ext4fs_group_desc(fs, fs->group_desc, group);\n\tgdp->bg_checksum = checksum;\n\treturn;\n}\n\n/*\n * Get the acl block of a file\n */\nblk64_t ext2fs_file_acl_block(ext2_filsys fs, const struct ext2_inode *inode)\n{\n\tblk64_t\tblk = inode->i_file_acl;\n\n\tif (fs && ext2fs_has_feature_64bit(fs->super))\n\t\tblk |= ((__u64) inode->osd2.linux2.l_i_file_acl_high) << 32;\n\treturn blk;\n}\n\n/*\n * Set the acl block of a file\n */\nvoid ext2fs_file_acl_block_set(ext2_filsys fs, struct ext2_inode *inode,\n\t\t\t       blk64_t blk)\n{\n\tinode->i_file_acl = blk;\n\tif (fs && ext2fs_has_feature_64bit(fs->super))\n\t\tinode->osd2.linux2.l_i_file_acl_high = (__u64) blk >> 32;\n}\n\n/*\n * Set the size of the inode\n */\nerrcode_t ext2fs_inode_size_set(ext2_filsys fs, struct ext2_inode *inode,\n\t\t\t\text2_off64_t size)\n{\n\t/* Only regular files get to be larger than 4GB */\n\tif (!LINUX_S_ISREG(inode->i_mode) && (size >> 32))\n\t\treturn EXT2_ET_FILE_TOO_BIG;\n\n\t/* If we're writing a large file, set the large_file flag */\n\tif (LINUX_S_ISREG(inode->i_mode) &&\n\t    ext2fs_needs_large_file_feature(size) &&\n\t    (!ext2fs_has_feature_large_file(fs->super) ||\n\t     fs->super->s_rev_level == EXT2_GOOD_OLD_REV)) {\n\t\text2fs_set_feature_large_file(fs->super);\n\t\text2fs_update_dynamic_rev(fs);\n\t\text2fs_mark_super_dirty(fs);\n\t}\n\n\tinode->i_size = size & 0xffffffff;\n\tinode->i_size_high = (size >> 32);\n\n\treturn 0;\n}\n\n"
  },
  {
    "path": "src/ext2fs/block.c",
    "content": "/*\n * block.c --- iterate over all blocks in an inode\n *\n * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\nstruct block_context {\n\text2_filsys\tfs;\n\tint (*func)(ext2_filsys\tfs,\n\t\t    blk64_t\t*blocknr,\n\t\t    e2_blkcnt_t\tbcount,\n\t\t    blk64_t\tref_blk,\n\t\t    int\t\tref_offset,\n\t\t    void\t*priv_data);\n\te2_blkcnt_t\tbcount;\n\tint\t\tbsize;\n\tint\t\tflags;\n\terrcode_t\terrcode;\n\tchar\t*ind_buf;\n\tchar\t*dind_buf;\n\tchar\t*tind_buf;\n\tvoid\t*priv_data;\n};\n\n#define check_for_ro_violation_return(ctx, ret)\t\t\t\t\\\n\tdo {\t\t\t\t\t\t\t\t\\\n\t\tif (((ctx)->flags & BLOCK_FLAG_READ_ONLY) &&\t\t\\\n\t\t    ((ret) & BLOCK_CHANGED)) {\t\t\t\t\\\n\t\t\t(ctx)->errcode = EXT2_ET_RO_BLOCK_ITERATE;\t\\\n\t\t\tret |= BLOCK_ABORT | BLOCK_ERROR;\t\t\\\n\t\t\treturn ret;\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t} while (0)\n\n#define check_for_ro_violation_goto(ctx, ret, label)\t\t\t\\\n\tdo {\t\t\t\t\t\t\t\t\\\n\t\tif (((ctx)->flags & BLOCK_FLAG_READ_ONLY) &&\t\t\\\n\t\t    ((ret) & BLOCK_CHANGED)) {\t\t\t\t\\\n\t\t\t(ctx)->errcode = EXT2_ET_RO_BLOCK_ITERATE;\t\\\n\t\t\tret |= BLOCK_ABORT | BLOCK_ERROR;\t\t\\\n\t\t\tgoto label;\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t} while (0)\n\nstatic int block_iterate_ind(blk_t *ind_block, blk_t ref_block,\n\t\t\t     int ref_offset, struct block_context *ctx)\n{\n\tint\tret = 0, changed = 0;\n\tint\ti, flags, limit, offset;\n\tblk_t\t*block_nr;\n\tblk64_t\tblk64;\n\n\tlimit = ctx->fs->blocksize >> 2;\n\tif (!(ctx->flags & BLOCK_FLAG_DEPTH_TRAVERSE) &&\n\t    !(ctx->flags & BLOCK_FLAG_DATA_ONLY)) {\n\t\tblk64 = *ind_block;\n\t\tret = (*ctx->func)(ctx->fs, &blk64,\n\t\t\t\t   BLOCK_COUNT_IND, ref_block,\n\t\t\t\t   ref_offset, ctx->priv_data);\n\t\t*ind_block = blk64;\n\t}\n\tcheck_for_ro_violation_return(ctx, ret);\n\tif (!*ind_block || (ret & BLOCK_ABORT)) {\n\t\tctx->bcount += limit;\n\t\treturn ret;\n\t}\n\tif (*ind_block >= ext2fs_blocks_count(ctx->fs->super) ||\n\t    *ind_block < ctx->fs->super->s_first_data_block) {\n\t\tctx->errcode = EXT2_ET_BAD_IND_BLOCK;\n\t\tret |= BLOCK_ERROR;\n\t\treturn ret;\n\t}\n\tctx->errcode = ext2fs_read_ind_block(ctx->fs, *ind_block,\n\t\t\t\t\t     ctx->ind_buf);\n\tif (ctx->errcode) {\n\t\tret |= BLOCK_ERROR;\n\t\treturn ret;\n\t}\n\n\tblock_nr = (blk_t *) ctx->ind_buf;\n\toffset = 0;\n\tif (ctx->flags & BLOCK_FLAG_APPEND) {\n\t\tfor (i = 0; i < limit; i++, ctx->bcount++, block_nr++) {\n\t\t\tblk64 = *block_nr;\n\t\t\tflags = (*ctx->func)(ctx->fs, &blk64, ctx->bcount,\n\t\t\t\t\t     *ind_block, offset,\n\t\t\t\t\t     ctx->priv_data);\n\t\t\t*block_nr = blk64;\n\t\t\tchanged\t|= flags;\n\t\t\tif (flags & BLOCK_ABORT) {\n\t\t\t\tret |= BLOCK_ABORT;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\toffset += sizeof(blk_t);\n\t\t}\n\t} else {\n\t\tfor (i = 0; i < limit; i++, ctx->bcount++, block_nr++) {\n\t\t\tif (*block_nr == 0)\n\t\t\t\tgoto skip_sparse;\n\t\t\tblk64 = *block_nr;\n\t\t\tflags = (*ctx->func)(ctx->fs, &blk64, ctx->bcount,\n\t\t\t\t\t     *ind_block, offset,\n\t\t\t\t\t     ctx->priv_data);\n\t\t\t*block_nr = blk64;\n\t\t\tchanged\t|= flags;\n\t\t\tif (flags & BLOCK_ABORT) {\n\t\t\t\tret |= BLOCK_ABORT;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tskip_sparse:\n\t\t\toffset += sizeof(blk_t);\n\t\t}\n\t}\n\tcheck_for_ro_violation_return(ctx, changed);\n\tif (changed & BLOCK_CHANGED) {\n\t\tctx->errcode = ext2fs_write_ind_block(ctx->fs, *ind_block,\n\t\t\t\t\t\t      ctx->ind_buf);\n\t\tif (ctx->errcode)\n\t\t\tret |= BLOCK_ERROR | BLOCK_ABORT;\n\t}\n\tif ((ctx->flags & BLOCK_FLAG_DEPTH_TRAVERSE) &&\n\t    !(ctx->flags & BLOCK_FLAG_DATA_ONLY) &&\n\t    !(ret & BLOCK_ABORT)) {\n\t\tblk64 = *ind_block;\n\t\tret |= (*ctx->func)(ctx->fs, &blk64,\n\t\t\t\t    BLOCK_COUNT_IND, ref_block,\n\t\t\t\t    ref_offset, ctx->priv_data);\n\t\t*ind_block = blk64;\n\t}\n\tcheck_for_ro_violation_return(ctx, ret);\n\treturn ret;\n}\n\nstatic int block_iterate_dind(blk_t *dind_block, blk_t ref_block,\n\t\t\t      int ref_offset, struct block_context *ctx)\n{\n\tint\tret = 0, changed = 0;\n\tint\ti, flags, limit, offset;\n\tblk_t\t*block_nr;\n\tblk64_t\tblk64;\n\n\tlimit = ctx->fs->blocksize >> 2;\n\tif (!(ctx->flags & (BLOCK_FLAG_DEPTH_TRAVERSE |\n\t\t\t    BLOCK_FLAG_DATA_ONLY))) {\n\t\tblk64 = *dind_block;\n\t\tret = (*ctx->func)(ctx->fs, &blk64,\n\t\t\t\t   BLOCK_COUNT_DIND, ref_block,\n\t\t\t\t   ref_offset, ctx->priv_data);\n\t\t*dind_block = blk64;\n\t}\n\tcheck_for_ro_violation_return(ctx, ret);\n\tif (!*dind_block || (ret & BLOCK_ABORT)) {\n\t\tctx->bcount += (e2_blkcnt_t)limit * limit;\n\t\treturn ret;\n\t}\n\tif (*dind_block >= ext2fs_blocks_count(ctx->fs->super) ||\n\t    *dind_block < ctx->fs->super->s_first_data_block) {\n\t\tctx->errcode = EXT2_ET_BAD_DIND_BLOCK;\n\t\tret |= BLOCK_ERROR;\n\t\treturn ret;\n\t}\n\tctx->errcode = ext2fs_read_ind_block(ctx->fs, *dind_block,\n\t\t\t\t\t     ctx->dind_buf);\n\tif (ctx->errcode) {\n\t\tret |= BLOCK_ERROR;\n\t\treturn ret;\n\t}\n\n\tblock_nr = (blk_t *) ctx->dind_buf;\n\toffset = 0;\n\tif (ctx->flags & BLOCK_FLAG_APPEND) {\n\t\tfor (i = 0; i < limit; i++, block_nr++) {\n\t\t\tflags = block_iterate_ind(block_nr,\n\t\t\t\t\t\t  *dind_block, offset,\n\t\t\t\t\t\t  ctx);\n\t\t\tchanged |= flags;\n\t\t\tif (flags & (BLOCK_ABORT | BLOCK_ERROR)) {\n\t\t\t\tret |= flags & (BLOCK_ABORT | BLOCK_ERROR);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\toffset += sizeof(blk_t);\n\t\t}\n\t} else {\n\t\tfor (i = 0; i < limit; i++, block_nr++) {\n\t\t\tif (*block_nr == 0) {\n\t\t\t\tctx->bcount += limit;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tflags = block_iterate_ind(block_nr,\n\t\t\t\t\t\t  *dind_block, offset,\n\t\t\t\t\t\t  ctx);\n\t\t\tchanged |= flags;\n\t\t\tif (flags & (BLOCK_ABORT | BLOCK_ERROR)) {\n\t\t\t\tret |= flags & (BLOCK_ABORT | BLOCK_ERROR);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\toffset += sizeof(blk_t);\n\t\t}\n\t}\n\tcheck_for_ro_violation_return(ctx, changed);\n\tif (changed & BLOCK_CHANGED) {\n\t\tctx->errcode = ext2fs_write_ind_block(ctx->fs, *dind_block,\n\t\t\t\t\t\t      ctx->dind_buf);\n\t\tif (ctx->errcode)\n\t\t\tret |= BLOCK_ERROR | BLOCK_ABORT;\n\t}\n\tif ((ctx->flags & BLOCK_FLAG_DEPTH_TRAVERSE) &&\n\t    !(ctx->flags & BLOCK_FLAG_DATA_ONLY) &&\n\t    !(ret & BLOCK_ABORT)) {\n\t\tblk64 = *dind_block;\n\t\tret |= (*ctx->func)(ctx->fs, &blk64,\n\t\t\t\t    BLOCK_COUNT_DIND, ref_block,\n\t\t\t\t    ref_offset, ctx->priv_data);\n\t\t*dind_block = blk64;\n\t}\n\tcheck_for_ro_violation_return(ctx, ret);\n\treturn ret;\n}\n\nstatic int block_iterate_tind(blk_t *tind_block, blk_t ref_block,\n\t\t\t      int ref_offset, struct block_context *ctx)\n{\n\tint\tret = 0, changed = 0;\n\tint\ti, flags, limit, offset;\n\tblk_t\t*block_nr;\n\tblk64_t\tblk64;\n\n\tlimit = ctx->fs->blocksize >> 2;\n\tif (!(ctx->flags & (BLOCK_FLAG_DEPTH_TRAVERSE |\n\t\t\t    BLOCK_FLAG_DATA_ONLY))) {\n\t\tblk64 = *tind_block;\n\t\tret = (*ctx->func)(ctx->fs, &blk64,\n\t\t\t\t   BLOCK_COUNT_TIND, ref_block,\n\t\t\t\t   ref_offset, ctx->priv_data);\n\t\t*tind_block = blk64;\n\t}\n\tcheck_for_ro_violation_return(ctx, ret);\n\tif (!*tind_block || (ret & BLOCK_ABORT)) {\n\t\tctx->bcount += ((unsigned long long) limit)*limit*limit;\n\t\treturn ret;\n\t}\n\tif (*tind_block >= ext2fs_blocks_count(ctx->fs->super) ||\n\t    *tind_block < ctx->fs->super->s_first_data_block) {\n\t\tctx->errcode = EXT2_ET_BAD_TIND_BLOCK;\n\t\tret |= BLOCK_ERROR;\n\t\treturn ret;\n\t}\n\tctx->errcode = ext2fs_read_ind_block(ctx->fs, *tind_block,\n\t\t\t\t\t     ctx->tind_buf);\n\tif (ctx->errcode) {\n\t\tret |= BLOCK_ERROR;\n\t\treturn ret;\n\t}\n\n\tblock_nr = (blk_t *) ctx->tind_buf;\n\toffset = 0;\n\tif (ctx->flags & BLOCK_FLAG_APPEND) {\n\t\tfor (i = 0; i < limit; i++, block_nr++) {\n\t\t\tflags = block_iterate_dind(block_nr,\n\t\t\t\t\t\t   *tind_block,\n\t\t\t\t\t\t   offset, ctx);\n\t\t\tchanged |= flags;\n\t\t\tif (flags & (BLOCK_ABORT | BLOCK_ERROR)) {\n\t\t\t\tret |= flags & (BLOCK_ABORT | BLOCK_ERROR);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\toffset += sizeof(blk_t);\n\t\t}\n\t} else {\n\t\tfor (i = 0; i < limit; i++, block_nr++) {\n\t\t\tif (*block_nr == 0) {\n\t\t\t\tctx->bcount += (e2_blkcnt_t)limit * limit;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tflags = block_iterate_dind(block_nr,\n\t\t\t\t\t\t   *tind_block,\n\t\t\t\t\t\t   offset, ctx);\n\t\t\tchanged |= flags;\n\t\t\tif (flags & (BLOCK_ABORT | BLOCK_ERROR)) {\n\t\t\t\tret |= flags & (BLOCK_ABORT | BLOCK_ERROR);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\toffset += sizeof(blk_t);\n\t\t}\n\t}\n\tcheck_for_ro_violation_return(ctx, changed);\n\tif (changed & BLOCK_CHANGED) {\n\t\tctx->errcode = ext2fs_write_ind_block(ctx->fs, *tind_block,\n\t\t\t\t\t\t      ctx->tind_buf);\n\t\tif (ctx->errcode)\n\t\t\tret |= BLOCK_ERROR | BLOCK_ABORT;\n\t}\n\tif ((ctx->flags & BLOCK_FLAG_DEPTH_TRAVERSE) &&\n\t    !(ctx->flags & BLOCK_FLAG_DATA_ONLY) &&\n\t    !(ret & BLOCK_ABORT)) {\n\t\tblk64 = *tind_block;\n\t\tret |= (*ctx->func)(ctx->fs, &blk64,\n\t\t\t\t    BLOCK_COUNT_TIND, ref_block,\n\t\t\t\t    ref_offset, ctx->priv_data);\n\t\t*tind_block = blk64;\n\t}\n\tcheck_for_ro_violation_return(ctx, ret);\n\treturn ret;\n}\n\nerrcode_t ext2fs_block_iterate3(ext2_filsys fs,\n\t\t\t\text2_ino_t ino,\n\t\t\t\tint\tflags,\n\t\t\t\tchar *block_buf,\n\t\t\t\tint (*func)(ext2_filsys fs,\n\t\t\t\t\t    blk64_t\t*blocknr,\n\t\t\t\t\t    e2_blkcnt_t\tblockcnt,\n\t\t\t\t\t    blk64_t\tref_blk,\n\t\t\t\t\t    int\t\tref_offset,\n\t\t\t\t\t    void\t*priv_data),\n\t\t\t\tvoid *priv_data)\n{\n\tint\ti;\n\tint\tr, ret = 0;\n\tstruct ext2_inode inode;\n\terrcode_t\tretval;\n\tstruct block_context ctx;\n\tint\tlimit;\n\tblk64_t\tblk64;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tctx.errcode = ext2fs_read_inode(fs, ino, &inode);\n\tif (ctx.errcode)\n\t\treturn ctx.errcode;\n\n\t/*\n\t * An inode with inline data has no blocks over which to\n\t * iterate, so return an error code indicating this fact.\n\t */\n\tif (inode.i_flags & EXT4_INLINE_DATA_FL)\n\t\treturn EXT2_ET_INLINE_DATA_CANT_ITERATE;\n\n\t/*\n\t * Check to see if we need to limit large files\n\t */\n\tif (flags & BLOCK_FLAG_NO_LARGE) {\n\t\tif (!LINUX_S_ISDIR(inode.i_mode) &&\n\t\t    (inode.i_size_high != 0))\n\t\t\treturn EXT2_ET_FILE_TOO_BIG;\n\t}\n\n\tlimit = fs->blocksize >> 2;\n\n\tctx.fs = fs;\n\tctx.func = func;\n\tctx.priv_data = priv_data;\n\tctx.flags = flags;\n\tctx.bcount = 0;\n\tif (block_buf) {\n\t\tctx.ind_buf = block_buf;\n\t} else {\n\t\tretval = ext2fs_get_array(3, fs->blocksize, &ctx.ind_buf);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\tctx.dind_buf = ctx.ind_buf + fs->blocksize;\n\tctx.tind_buf = ctx.dind_buf + fs->blocksize;\n\n\t/*\n\t * Iterate over the HURD translator block (if present)\n\t */\n\tif ((fs->super->s_creator_os == EXT2_OS_HURD) &&\n\t    !(flags & BLOCK_FLAG_DATA_ONLY)) {\n\t\tif (inode.osd1.hurd1.h_i_translator) {\n\t\t\tblk64 = inode.osd1.hurd1.h_i_translator;\n\t\t\tret |= (*ctx.func)(fs, &blk64,\n\t\t\t\t\t   BLOCK_COUNT_TRANSLATOR,\n\t\t\t\t\t   0, 0, priv_data);\n\t\t\tinode.osd1.hurd1.h_i_translator = (blk_t) blk64;\n\t\t\tif (ret & BLOCK_ABORT)\n\t\t\t\tgoto abort_exit;\n\t\t\tcheck_for_ro_violation_goto(&ctx, ret, abort_exit);\n\t\t}\n\t}\n\n\tif (inode.i_flags & EXT4_EXTENTS_FL) {\n\t\text2_extent_handle_t\thandle;\n\t\tstruct ext2fs_extent\textent, next;\n\t\te2_blkcnt_t\t\tblockcnt = 0;\n\t\tblk64_t\t\t\tblk, new_blk;\n\t\tint\t\t\top = EXT2_EXTENT_ROOT;\n\t\tint\t\t\tuninit;\n\t\tunsigned int\t\tj;\n\n\t\tctx.errcode = ext2fs_extent_open2(fs, ino, &inode, &handle);\n\t\tif (ctx.errcode)\n\t\t\tgoto abort_exit;\n\n\t\twhile (1) {\n\t\t\tif (op == EXT2_EXTENT_CURRENT)\n\t\t\t\tctx.errcode = 0;\n\t\t\telse\n\t\t\t\tctx.errcode = ext2fs_extent_get(handle, op,\n\t\t\t\t\t\t\t\t&extent);\n\t\t\tif (ctx.errcode) {\n\t\t\t\tif (ctx.errcode != EXT2_ET_EXTENT_NO_NEXT)\n\t\t\t\t\tbreak;\n\t\t\t\tctx.errcode = 0;\n\t\t\t\tif (!(flags & BLOCK_FLAG_APPEND))\n\t\t\t\t\tbreak;\n\t\t\tnext_block_set:\n\t\t\t\tblk = 0;\n\t\t\t\tr = (*ctx.func)(fs, &blk, blockcnt,\n\t\t\t\t\t\t0, 0, priv_data);\n\t\t\t\tret |= r;\n\t\t\t\tcheck_for_ro_violation_goto(&ctx, ret,\n\t\t\t\t\t\t\t    extent_done);\n\t\t\t\tif (r & BLOCK_CHANGED) {\n\t\t\t\t\tctx.errcode =\n\t\t\t\t\t\text2fs_extent_set_bmap(handle,\n\t\t\t\t\t\t       (blk64_t) blockcnt++,\n\t\t\t\t\t\t       (blk64_t) blk, 0);\n\t\t\t\t\tif (ctx.errcode || (ret & BLOCK_ABORT))\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (blk)\n\t\t\t\t\t\tgoto next_block_set;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\top = EXT2_EXTENT_NEXT;\n\t\t\tblk = extent.e_pblk;\n\t\t\tif (!(extent.e_flags & EXT2_EXTENT_FLAGS_LEAF)) {\n\t\t\t\tif (ctx.flags & BLOCK_FLAG_DATA_ONLY)\n\t\t\t\t\tcontinue;\n\t\t\t\tif ((!(extent.e_flags &\n\t\t\t\t       EXT2_EXTENT_FLAGS_SECOND_VISIT) &&\n\t\t\t\t     !(ctx.flags & BLOCK_FLAG_DEPTH_TRAVERSE)) ||\n\t\t\t\t    ((extent.e_flags &\n\t\t\t\t      EXT2_EXTENT_FLAGS_SECOND_VISIT) &&\n\t\t\t\t     (ctx.flags & BLOCK_FLAG_DEPTH_TRAVERSE))) {\n\t\t\t\t\tret |= (*ctx.func)(fs, &blk,\n\t\t\t\t\t\t\t   -1, 0, 0, priv_data);\n\t\t\t\t\tif (ret & BLOCK_CHANGED) {\n\t\t\t\t\t\textent.e_pblk = blk;\n\t\t\t\t\t\tctx.errcode =\n\t\t\t\text2fs_extent_replace(handle, 0, &extent);\n\t\t\t\t\t\tif (ctx.errcode)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (ret & BLOCK_ABORT)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tuninit = 0;\n\t\t\tif (extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\t\t\tuninit = EXT2_EXTENT_SET_BMAP_UNINIT;\n\n\t\t\t/* \n\t\t\t * Get the next extent before we start messing\n\t\t\t * with the current extent\n\t\t\t */\n\t\t\tretval = ext2fs_extent_get(handle, op, &next);\n\n#if 0\n\t\t\tprintf(\"lblk %llu pblk %llu len %d blockcnt %llu\\n\",\n\t\t\t       extent.e_lblk, extent.e_pblk,\n\t\t\t       extent.e_len, blockcnt);\n#endif\n\t\t\tif (extent.e_lblk + extent.e_len <= (blk64_t) blockcnt)\n\t\t\t\tcontinue;\n\t\t\tif (extent.e_lblk > (blk64_t) blockcnt)\n\t\t\t\tblockcnt = extent.e_lblk;\n\t\t\tj = blockcnt - extent.e_lblk;\n\t\t\tblk += j;\n\t\t\tfor (blockcnt = extent.e_lblk, j = 0;\n\t\t\t     j < extent.e_len;\n\t\t\t     blk++, blockcnt++, j++) {\n\t\t\t\tnew_blk = blk;\n\t\t\t\tr = (*ctx.func)(fs, &new_blk, blockcnt,\n\t\t\t\t\t\t0, 0, priv_data);\n\t\t\t\tret |= r;\n\t\t\t\tcheck_for_ro_violation_goto(&ctx, ret,\n\t\t\t\t\t\t\t    extent_done);\n\t\t\t\tif (r & BLOCK_CHANGED) {\n\t\t\t\t\tctx.errcode =\n\t\t\t\t\t\text2fs_extent_set_bmap(handle,\n\t\t\t\t\t\t       (blk64_t) blockcnt,\n\t\t\t\t\t\t       new_blk, uninit);\n\t\t\t\t\tif (ctx.errcode)\n\t\t\t\t\t\tgoto extent_done;\n\t\t\t\t}\n\t\t\t\tif (ret & BLOCK_ABORT)\n\t\t\t\t\tgoto extent_done;\n\t\t\t}\n\t\t\tif (retval == 0) {\n\t\t\t\textent = next;\n\t\t\t\top = EXT2_EXTENT_CURRENT;\n\t\t\t}\n\t\t}\n\n\textent_done:\n\t\text2fs_extent_free(handle);\n\t\tret |= BLOCK_ERROR; /* ctx.errcode is always valid here */\n\t\tgoto errout;\n\t}\n\n\t/*\n\t * Iterate over normal data blocks\n\t */\n\tfor (i = 0; i < EXT2_NDIR_BLOCKS ; i++, ctx.bcount++) {\n\t\tif (inode.i_block[i] || (flags & BLOCK_FLAG_APPEND)) {\n\t\t\tblk64 = inode.i_block[i];\n\t\t\tret |= (*ctx.func)(fs, &blk64, ctx.bcount, 0, i, \n\t\t\t\t\t   priv_data);\n\t\t\tinode.i_block[i] = (blk_t) blk64;\n\t\t\tif (ret & BLOCK_ABORT)\n\t\t\t\tgoto abort_exit;\n\t\t}\n\t}\n\tcheck_for_ro_violation_goto(&ctx, ret, abort_exit);\n\tif (inode.i_block[EXT2_IND_BLOCK] || (flags & BLOCK_FLAG_APPEND)) {\n\t\tret |= block_iterate_ind(&inode.i_block[EXT2_IND_BLOCK], \n\t\t\t\t\t 0, EXT2_IND_BLOCK, &ctx);\n\t\tif (ret & BLOCK_ABORT)\n\t\t\tgoto abort_exit;\n\t} else\n\t\tctx.bcount += limit;\n\tif (inode.i_block[EXT2_DIND_BLOCK] || (flags & BLOCK_FLAG_APPEND)) {\n\t\tret |= block_iterate_dind(&inode.i_block[EXT2_DIND_BLOCK],\n\t\t\t\t\t  0, EXT2_DIND_BLOCK, &ctx);\n\t\tif (ret & BLOCK_ABORT)\n\t\t\tgoto abort_exit;\n\t} else\n\t\tctx.bcount += (e2_blkcnt_t)limit * limit;\n\tif (inode.i_block[EXT2_TIND_BLOCK] || (flags & BLOCK_FLAG_APPEND)) {\n\t\tret |= block_iterate_tind(&inode.i_block[EXT2_TIND_BLOCK],\n\t\t\t\t\t  0, EXT2_TIND_BLOCK, &ctx);\n\t\tif (ret & BLOCK_ABORT)\n\t\t\tgoto abort_exit;\n\t}\n\nabort_exit:\n\tif (ret & BLOCK_CHANGED) {\n\t\tretval = ext2fs_write_inode(fs, ino, &inode);\n\t\tif (retval) {\n\t\t\tret |= BLOCK_ERROR;\n\t\t\tctx.errcode = retval;\n\t\t}\n\t}\nerrout:\n\tif (!block_buf)\n\t\text2fs_free_mem(&ctx.ind_buf);\n\n\treturn (ret & BLOCK_ERROR) ? ctx.errcode : 0;\n}\n\n/*\n * Emulate the old ext2fs_block_iterate function!\n */\n\nstruct xlate64 {\n\tint (*func)(ext2_filsys fs,\n\t\t    blk_t\t*blocknr,\n\t\t    e2_blkcnt_t\tblockcnt,\n\t\t    blk_t\tref_blk,\n\t\t    int\t\tref_offset,\n\t\t    void\t*priv_data);\n\tvoid *real_private;\n};\n\nstatic int xlate64_func(ext2_filsys fs, blk64_t\t*blocknr,\n\t\t\te2_blkcnt_t blockcnt, blk64_t ref_blk,\n\t\t\tint ref_offset, void *priv_data)\n{\n\tstruct xlate64 *xl = (struct xlate64 *) priv_data;\n\tint\t\tret;\n\tblk_t\t\tblock32 = *blocknr;\n\t\n\tret = (*xl->func)(fs, &block32, blockcnt, (blk_t) ref_blk, ref_offset,\n\t\t\t     xl->real_private);\n\t*blocknr = block32;\n\treturn ret;\n}\n\nerrcode_t ext2fs_block_iterate2(ext2_filsys fs,\n\t\t\t\text2_ino_t ino,\n\t\t\t\tint\tflags,\n\t\t\t\tchar *block_buf,\n\t\t\t\tint (*func)(ext2_filsys fs,\n\t\t\t\t\t    blk_t\t*blocknr,\n\t\t\t\t\t    e2_blkcnt_t\tblockcnt,\n\t\t\t\t\t    blk_t\tref_blk,\n\t\t\t\t\t    int\t\tref_offset,\n\t\t\t\t\t    void\t*priv_data),\n\t\t\t\tvoid *priv_data)\n{\n\tstruct xlate64 xl;\n\n\txl.real_private = priv_data;\n\txl.func = func;\n\n\treturn ext2fs_block_iterate3(fs, ino, flags, block_buf, \n\t\t\t\t     xlate64_func, &xl);\n}\n\n\nstruct xlate {\n\tint (*func)(ext2_filsys\tfs,\n\t\t    blk_t\t*blocknr,\n\t\t    int\t\tbcount,\n\t\t    void\t*priv_data);\n\tvoid *real_private;\n};\n\n#ifdef __TURBOC__\n #pragma argsused\n#endif\nstatic int xlate_func(ext2_filsys fs, blk_t *blocknr, e2_blkcnt_t blockcnt,\n\t\t      blk_t ref_block EXT2FS_ATTR((unused)),\n\t\t      int ref_offset EXT2FS_ATTR((unused)),\n\t\t      void *priv_data)\n{\n\tstruct xlate *xl = (struct xlate *) priv_data;\n\n\treturn (*xl->func)(fs, blocknr, (int) blockcnt, xl->real_private);\n}\n\nerrcode_t ext2fs_block_iterate(ext2_filsys fs,\n\t\t\t       ext2_ino_t ino,\n\t\t\t       int\tflags,\n\t\t\t       char *block_buf,\n\t\t\t       int (*func)(ext2_filsys fs,\n\t\t\t\t\t   blk_t\t*blocknr,\n\t\t\t\t\t   int\tblockcnt,\n\t\t\t\t\t   void\t*priv_data),\n\t\t\t       void *priv_data)\n{\n\tstruct xlate xl;\n\n\txl.real_private = priv_data;\n\txl.func = func;\n\n\treturn ext2fs_block_iterate2(fs, ino, BLOCK_FLAG_NO_LARGE | flags,\n\t\t\t\t     block_buf, xlate_func, &xl);\n}\n\n"
  },
  {
    "path": "src/ext2fs/bmap.c",
    "content": "/*\n * bmap.c --- logical to physical block mapping\n *\n * Copyright (C) 1997 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <errno.h>\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n\n#if defined(__GNUC__) && !defined(NO_INLINE_FUNCS)\n#define _BMAP_INLINE_\t__inline__\n#else\n#define _BMAP_INLINE_\n#endif\n\nextern errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t     struct ext2_inode *inode,\n\t\t\t     char *block_buf, int bmap_flags,\n\t\t\t     blk_t block, blk_t *phys_blk);\n\n#define inode_bmap(inode, nr) ((inode)->i_block[(nr)])\n\nstatic _BMAP_INLINE_ errcode_t block_ind_bmap(ext2_filsys fs, int flags,\n\t\t\t\t\t      blk_t ind, char *block_buf,\n\t\t\t\t\t      int *blocks_alloc,\n\t\t\t\t\t      blk_t nr, blk_t *ret_blk)\n{\n\terrcode_t\tretval;\n\tblk_t\t\tb;\n\n\tif (!ind) {\n\t\tif (flags & BMAP_SET)\n\t\t\treturn EXT2_ET_SET_BMAP_NO_IND;\n\t\t*ret_blk = 0;\n\t\treturn 0;\n\t}\n\tretval = io_channel_read_blk(fs->io, ind, 1, block_buf);\n\tif (retval)\n\t\treturn retval;\n\n\tif (flags & BMAP_SET) {\n\t\tb = *ret_blk;\n#ifdef WORDS_BIGENDIAN\n\t\tb = ext2fs_swab32(b);\n#endif\n\t\t((blk_t *) block_buf)[nr] = b;\n\t\treturn io_channel_write_blk(fs->io, ind, 1, block_buf);\n\t}\n\n\tb = ((blk_t *) block_buf)[nr];\n\n#ifdef WORDS_BIGENDIAN\n\tb = ext2fs_swab32(b);\n#endif\n\n\tif (!b && (flags & BMAP_ALLOC)) {\n\t\tb = nr ? ext2fs_le32_to_cpu(((blk_t *)block_buf)[nr - 1]) : ind;\n\t\tretval = ext2fs_alloc_block(fs, b,\n\t\t\t\t\t    block_buf + fs->blocksize, &b);\n\t\tif (retval)\n\t\t\treturn retval;\n\n#ifdef WORDS_BIGENDIAN\n\t\t((blk_t *) block_buf)[nr] = ext2fs_swab32(b);\n#else\n\t\t((blk_t *) block_buf)[nr] = b;\n#endif\n\n\t\tretval = io_channel_write_blk(fs->io, ind, 1, block_buf);\n\t\tif (retval)\n\t\t\treturn retval;\n\n\t\t(*blocks_alloc)++;\n\t}\n\n\t*ret_blk = b;\n\treturn 0;\n}\n\nstatic _BMAP_INLINE_ errcode_t block_dind_bmap(ext2_filsys fs, int flags,\n\t\t\t\t\t       blk_t dind, char *block_buf,\n\t\t\t\t\t       int *blocks_alloc,\n\t\t\t\t\t       blk_t nr, blk_t *ret_blk)\n{\n\tblk_t\t\tb = 0;\n\terrcode_t\tretval;\n\tblk_t\t\taddr_per_block;\n\n\taddr_per_block = (blk_t) fs->blocksize >> 2;\n\n\tretval = block_ind_bmap(fs, flags & ~BMAP_SET, dind, block_buf,\n\t\t\t\tblocks_alloc, nr / addr_per_block, &b);\n\tif (retval)\n\t\treturn retval;\n\tretval = block_ind_bmap(fs, flags, b, block_buf, blocks_alloc,\n\t\t\t\tnr % addr_per_block, ret_blk);\n\treturn retval;\n}\n\nstatic _BMAP_INLINE_ errcode_t block_tind_bmap(ext2_filsys fs, int flags,\n\t\t\t\t\t       blk_t tind, char *block_buf,\n\t\t\t\t\t       int *blocks_alloc,\n\t\t\t\t\t       blk_t nr, blk_t *ret_blk)\n{\n\tblk_t\t\tb = 0;\n\terrcode_t\tretval;\n\tblk_t\t\taddr_per_block;\n\n\taddr_per_block = (blk_t) fs->blocksize >> 2;\n\n\tretval = block_dind_bmap(fs, flags & ~BMAP_SET, tind, block_buf,\n\t\t\t\t blocks_alloc, nr / addr_per_block, &b);\n\tif (retval)\n\t\treturn retval;\n\tretval = block_ind_bmap(fs, flags, b, block_buf, blocks_alloc,\n\t\t\t\tnr % addr_per_block, ret_blk);\n\treturn retval;\n}\n\nstatic errcode_t extent_bmap(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t     struct ext2_inode *inode,\n\t\t\t     ext2_extent_handle_t handle,\n\t\t\t     char *block_buf, int bmap_flags, blk64_t block,\n\t\t\t     int *ret_flags, int *blocks_alloc,\n\t\t\t     blk64_t *phys_blk);\n\nstatic errcode_t implied_cluster_alloc(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t       struct ext2_inode *inode,\n\t\t\t\t       ext2_extent_handle_t handle,\n\t\t\t\t       blk64_t lblk, blk64_t *phys_blk)\n{\n\tblk64_t\tbase_block, pblock = 0;\n\tint i;\n\n\tif (!ext2fs_has_feature_bigalloc(fs->super))\n\t\treturn 0;\n\n\tbase_block = lblk & ~EXT2FS_CLUSTER_MASK(fs);\n\t/*\n\t * Except for the logical block (lblk) that was passed in, search all\n\t * blocks in this logical cluster for a mapping to a physical cluster.\n\t * If any such map exists, calculate the physical block that maps to\n\t * the logical block and return that.\n\t *\n\t * The old code wouldn't even look if (block % cluster_ratio) == 0;\n\t * this is incorrect if we're allocating blocks in reverse order.\n\t */\n\tfor (i = 0; i < EXT2FS_CLUSTER_RATIO(fs); i++) {\n\t\tif (base_block + i == lblk)\n\t\t\tcontinue;\n\t\textent_bmap(fs, ino, inode, handle, 0, 0,\n\t\t\t    base_block + i, 0, 0, &pblock);\n\t\tif (pblock)\n\t\t\tbreak;\n\t}\n\tif (pblock == 0)\n\t\treturn 0;\n\t*phys_blk = pblock - i + (lblk - base_block);\n\treturn 0;\n}\n\n/* Try to map a logical block to an already-allocated physical cluster. */\nerrcode_t ext2fs_map_cluster_block(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t   struct ext2_inode *inode, blk64_t lblk,\n\t\t\t\t   blk64_t *pblk)\n{\n\text2_extent_handle_t handle;\n\terrcode_t retval;\n\n\t/* Need bigalloc and extents to be enabled */\n\t*pblk = 0;\n\tif (!ext2fs_has_feature_bigalloc(fs->super) ||\n\t    !(inode->i_flags & EXT4_EXTENTS_FL))\n\t\treturn 0;\n\n\tretval = ext2fs_extent_open2(fs, ino, inode, &handle);\n\tif (retval)\n\t\tgoto out;\n\n\tretval = implied_cluster_alloc(fs, ino, inode, handle, lblk, pblk);\n\tif (retval)\n\t\tgoto out2;\n\nout2:\n\text2fs_extent_free(handle);\nout:\n\treturn retval;\n}\n\nstatic errcode_t extent_bmap(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t     struct ext2_inode *inode,\n\t\t\t     ext2_extent_handle_t handle,\n\t\t\t     char *block_buf, int bmap_flags, blk64_t block,\n\t\t\t     int *ret_flags, int *blocks_alloc,\n\t\t\t     blk64_t *phys_blk)\n{\n\tstruct blk_alloc_ctx\talloc_ctx;\n\tstruct ext2fs_extent\textent;\n\tunsigned int\t\toffset;\n\terrcode_t\t\tretval = 0;\n\tblk64_t\t\t\tblk64 = 0;\n\tint\t\t\talloc = 0;\n\tint\t\t\tset_flags;\n\n\tset_flags = bmap_flags & BMAP_UNINIT ? EXT2_EXTENT_SET_BMAP_UNINIT : 0;\n\n\tif (bmap_flags & BMAP_SET) {\n\t\tretval = ext2fs_extent_set_bmap(handle, block,\n\t\t\t\t\t\t*phys_blk, set_flags);\n\t\treturn retval;\n\t}\n\tretval = ext2fs_extent_goto(handle, block);\n\tif (retval) {\n\t\t/* If the extent is not found, return phys_blk = 0 */\n\t\tif (retval == EXT2_ET_EXTENT_NOT_FOUND) {\n\t\t\textent.e_lblk = block;\n\t\t\tgoto got_block;\n\t\t}\n\t\treturn retval;\n\t}\n\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT, &extent);\n\tif (retval)\n\t\treturn retval;\n\toffset = block - extent.e_lblk;\n\tif (block >= extent.e_lblk && (offset <= extent.e_len)) {\n\t\t*phys_blk = extent.e_pblk + offset;\n\t\tif (ret_flags && extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\t\t*ret_flags |= BMAP_RET_UNINIT;\n\t}\ngot_block:\n\tif ((*phys_blk == 0) && (bmap_flags & BMAP_ALLOC)) {\n\t\timplied_cluster_alloc(fs, ino, inode, handle, block, &blk64);\n\t\tif (blk64)\n\t\t\tgoto set_extent;\n\t\tretval = extent_bmap(fs, ino, inode, handle, block_buf,\n\t\t\t\t     0, block-1, 0, blocks_alloc, &blk64);\n\t\tif (retval)\n\t\t\tblk64 = ext2fs_find_inode_goal(fs, ino, inode, block);\n\t\talloc_ctx.ino = ino;\n\t\talloc_ctx.inode = inode;\n\t\talloc_ctx.lblk = extent.e_lblk;\n\t\talloc_ctx.flags = BLOCK_ALLOC_DATA;\n\t\tretval = ext2fs_alloc_block3(fs, blk64, block_buf, &blk64,\n\t\t\t\t\t     &alloc_ctx);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tblk64 &= ~EXT2FS_CLUSTER_MASK(fs);\n\t\tblk64 += EXT2FS_CLUSTER_MASK(fs) & block;\n\t\talloc++;\n\tset_extent:\n\t\tretval = ext2fs_extent_set_bmap(handle, block,\n\t\t\t\t\t\tblk64, set_flags);\n\t\tif (retval) {\n\t\t\text2fs_block_alloc_stats2(fs, blk64, -1);\n\t\t\treturn retval;\n\t\t}\n\t\t/* Update inode after setting extent */\n\t\tretval = ext2fs_read_inode(fs, ino, inode);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\t*blocks_alloc += alloc;\n\t\t*phys_blk = blk64;\n\t}\n\treturn 0;\n}\n\nint ext2fs_file_block_offset_too_big(ext2_filsys fs,\n\t\t\t\t     struct ext2_inode *inode,\n\t\t\t\t     blk64_t offset)\n{\n\tblk64_t addr_per_block, max_map_block;\n\n\t/* Kernel seems to cut us off at 4294967294 blocks */\n\tif (offset >= (1ULL << 32) - 1)\n\t\treturn 1;\n\n\tif (inode->i_flags & EXT4_EXTENTS_FL)\n\t\treturn 0;\n\n\taddr_per_block = fs->blocksize >> 2;\n\tmax_map_block = addr_per_block;\n\tmax_map_block += addr_per_block * addr_per_block;\n\tmax_map_block += addr_per_block * addr_per_block * addr_per_block;\n\tmax_map_block += 12;\n\n\treturn offset >= max_map_block;\n}\n\nerrcode_t ext2fs_bmap2(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,\n\t\t       char *block_buf, int bmap_flags, blk64_t block,\n\t\t       int *ret_flags, blk64_t *phys_blk)\n{\n\tstruct ext2_inode inode_buf;\n\text2_extent_handle_t handle = 0;\n\tblk_t addr_per_block;\n\tblk_t\tb, blk32;\n\tblk64_t b64;\n\tchar\t*buf = 0;\n\terrcode_t\tretval = 0;\n\tint\t\tblocks_alloc = 0, inode_dirty = 0;\n\tstruct blk_alloc_ctx alloc_ctx = {\n\t\t.ino\t= ino,\n\t\t.inode\t= inode,\n\t\t.lblk\t= 0,\n\t\t.flags\t= BLOCK_ALLOC_DATA,\n\t};\n\n\tif (!(bmap_flags & BMAP_SET))\n\t\t*phys_blk = 0;\n\n\tif (ret_flags)\n\t\t*ret_flags = 0;\n\n\t/* Read inode structure if necessary */\n\tif (!inode) {\n\t\tretval = ext2fs_read_inode(fs, ino, &inode_buf);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tinode = &inode_buf;\n\t}\n\taddr_per_block = (blk_t) fs->blocksize >> 2;\n\n\tif (ext2fs_file_block_offset_too_big(fs, inode, block))\n\t\treturn EXT2_ET_FILE_TOO_BIG;\n\n\t/*\n\t * If an inode has inline data, that means that it doesn't have\n\t * any blocks and we shouldn't map any blocks for it.\n\t */\n\tif (inode->i_flags & EXT4_INLINE_DATA_FL)\n\t\treturn EXT2_ET_INLINE_DATA_NO_BLOCK;\n\n\tif (!block_buf) {\n\t\tretval = ext2fs_get_array(2, fs->blocksize, &buf);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tblock_buf = buf;\n\t}\n\n\tif (inode->i_flags & EXT4_EXTENTS_FL) {\n\t\tretval = ext2fs_extent_open2(fs, ino, inode, &handle);\n\t\tif (retval)\n\t\t\tgoto done;\n\t\tretval = extent_bmap(fs, ino, inode, handle, block_buf,\n\t\t\t\t     bmap_flags, block, ret_flags,\n\t\t\t\t     &blocks_alloc, phys_blk);\n\t\tgoto done;\n\t}\n\n\tif (block < EXT2_NDIR_BLOCKS) {\n\t\tif (bmap_flags & BMAP_SET) {\n\t\t\tb = *phys_blk;\n\t\t\tinode_bmap(inode, block) = b;\n\t\t\tinode_dirty++;\n\t\t\tgoto done;\n\t\t}\n\n\t\t*phys_blk = inode_bmap(inode, block);\n\t\tb = block ? inode_bmap(inode, block - 1) :\n\t\t\t    ext2fs_find_inode_goal(fs, ino, inode, block);\n\n\t\tif ((*phys_blk == 0) && (bmap_flags & BMAP_ALLOC)) {\n\t\t\tb64 = b;\n\t\t\tretval = ext2fs_alloc_block3(fs, b64, block_buf, &b64,\n\t\t\t\t\t\t     &alloc_ctx);\n\t\t\tb = b64;\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t\tinode_bmap(inode, block) = b;\n\t\t\tblocks_alloc++;\n\t\t\t*phys_blk = b;\n\t\t}\n\t\tgoto done;\n\t}\n\n\t/* Indirect block */\n\tblock -= EXT2_NDIR_BLOCKS;\n\tblk32 = *phys_blk;\n\tif (block < addr_per_block) {\n\t\tb = inode_bmap(inode, EXT2_IND_BLOCK);\n\t\tif (!b) {\n\t\t\tif (!(bmap_flags & BMAP_ALLOC)) {\n\t\t\t\tif (bmap_flags & BMAP_SET)\n\t\t\t\t\tretval = EXT2_ET_SET_BMAP_NO_IND;\n\t\t\t\tgoto done;\n\t\t\t}\n\n\t\t\tb = inode_bmap(inode, EXT2_IND_BLOCK-1);\n\t\t\tb64 = b;\n\t\t\tretval = ext2fs_alloc_block3(fs, b64, block_buf, &b64,\n\t\t\t\t\t\t     &alloc_ctx);\n\t\t\tb = b64;\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t\tinode_bmap(inode, EXT2_IND_BLOCK) = b;\n\t\t\tblocks_alloc++;\n\t\t}\n\t\tretval = block_ind_bmap(fs, bmap_flags, b, block_buf,\n\t\t\t\t\t&blocks_alloc, block, &blk32);\n\t\tif (retval == 0)\n\t\t\t*phys_blk = blk32;\n\t\tgoto done;\n\t}\n\n\t/* Doubly indirect block  */\n\tblock -= addr_per_block;\n\tif (block < (blk64_t)addr_per_block * addr_per_block) {\n\t\tb = inode_bmap(inode, EXT2_DIND_BLOCK);\n\t\tif (!b) {\n\t\t\tif (!(bmap_flags & BMAP_ALLOC)) {\n\t\t\t\tif (bmap_flags & BMAP_SET)\n\t\t\t\t\tretval = EXT2_ET_SET_BMAP_NO_IND;\n\t\t\t\tgoto done;\n\t\t\t}\n\n\t\t\tb = inode_bmap(inode, EXT2_IND_BLOCK);\n\t\t\tb64 = b;\n\t\t\tretval = ext2fs_alloc_block3(fs, b64, block_buf, &b64,\n\t\t\t\t\t\t     &alloc_ctx);\n\t\t\tb = b64;\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t\tinode_bmap(inode, EXT2_DIND_BLOCK) = b;\n\t\t\tblocks_alloc++;\n\t\t}\n\t\tretval = block_dind_bmap(fs, bmap_flags, b, block_buf,\n\t\t\t\t\t &blocks_alloc, block, &blk32);\n\t\tif (retval == 0)\n\t\t\t*phys_blk = blk32;\n\t\tgoto done;\n\t}\n\n\t/* Triply indirect block */\n\tblock -= (blk64_t)addr_per_block * addr_per_block;\n\tb = inode_bmap(inode, EXT2_TIND_BLOCK);\n\tif (!b) {\n\t\tif (!(bmap_flags & BMAP_ALLOC)) {\n\t\t\tif (bmap_flags & BMAP_SET)\n\t\t\t\tretval = EXT2_ET_SET_BMAP_NO_IND;\n\t\t\tgoto done;\n\t\t}\n\n\t\tb = inode_bmap(inode, EXT2_DIND_BLOCK);\n\t\tb64 = b;\n\t\tretval = ext2fs_alloc_block3(fs, b64, block_buf, &b64,\n\t\t\t\t\t     &alloc_ctx);\n\t\tb = b64;\n\t\tif (retval)\n\t\t\tgoto done;\n\t\tinode_bmap(inode, EXT2_TIND_BLOCK) = b;\n\t\tblocks_alloc++;\n\t}\n\tretval = block_tind_bmap(fs, bmap_flags, b, block_buf,\n\t\t\t\t &blocks_alloc, block, &blk32);\n\tif (retval == 0)\n\t\t*phys_blk = blk32;\ndone:\n\tif (*phys_blk && retval == 0 && (bmap_flags & BMAP_ZERO))\n\t\tretval = ext2fs_zero_blocks2(fs, *phys_blk, 1, NULL, NULL);\n\tif (buf)\n\t\text2fs_free_mem(&buf);\n\tif (handle)\n\t\text2fs_extent_free(handle);\n\tif ((retval == 0) && (blocks_alloc || inode_dirty)) {\n\t\text2fs_iblk_add_blocks(fs, inode, blocks_alloc);\n\t\tretval = ext2fs_write_inode(fs, ino, inode);\n\t}\n\treturn retval;\n}\n\nerrcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,\n\t\t      char *block_buf, int bmap_flags, blk_t block,\n\t\t      blk_t *phys_blk)\n{\n\terrcode_t ret;\n\tblk64_t\tret_blk = *phys_blk;\n\n\tret = ext2fs_bmap2(fs, ino, inode, block_buf, bmap_flags, block,\n\t\t\t    0, &ret_blk);\n\tif (ret)\n\t\treturn ret;\n\tif (ret_blk >= ((long long) 1 << 32))\n\t\treturn EOVERFLOW;\n\t*phys_blk = ret_blk;\n\treturn 0;\n}\n"
  },
  {
    "path": "src/ext2fs/bmap64.h",
    "content": "/*\n * bmap64.h --- 64-bit bitmap structure\n *\n * Copyright (C) 2007, 2008 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Public\n * License.\n * %End-Header%\n */\n\nstruct ext2_bmap_statistics {\n\tint\t\ttype;\n\tstruct timeval\tcreated;\n\n#ifdef ENABLE_BMAP_STATS_OPS\n\tunsigned long\tcopy_count;\n\tunsigned long\tresize_count;\n\tunsigned long\tmark_count;\n\tunsigned long\tunmark_count;\n\tunsigned long\ttest_count;\n\tunsigned long\tmark_ext_count;\n\tunsigned long\tunmark_ext_count;\n\tunsigned long\ttest_ext_count;\n\tunsigned long\tset_range_count;\n\tunsigned long\tget_range_count;\n\tunsigned long\tclear_count;\n\n\tblk64_t\t\tlast_marked;\n\tblk64_t\t\tlast_tested;\n\tblk64_t\t\tmark_back;\n\tblk64_t\t\ttest_back;\n\n\tunsigned long\tmark_seq;\n\tunsigned long\ttest_seq;\n#endif /* ENABLE_BMAP_STATS_OPS */\n};\n\n\nstruct ext2fs_struct_generic_bitmap_64 {\n\terrcode_t\t\tmagic;\n\text2_filsys \t\tfs;\n\tstruct ext2_bitmap_ops\t*bitmap_ops;\n\tint\t\t\tflags;\n\t__u64\t\t\tstart, end;\n\t__u64\t\t\treal_end;\n\tint\t\t\tcluster_bits;\n\tchar\t\t\t*description;\n\tvoid\t\t\t*private;\n\terrcode_t\t\tbase_error_code;\n#ifdef ENABLE_BMAP_STATS\n\tstruct ext2_bmap_statistics\tstats;\n#endif\n};\n\ntypedef struct ext2fs_struct_generic_bitmap_64 *ext2fs_generic_bitmap_64;\n\n#define EXT2FS_IS_32_BITMAP(bmap) \\\n\t(((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP) || \\\n\t ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP) || \\\n\t ((bmap)->magic == EXT2_ET_MAGIC_INODE_BITMAP))\n\n#define EXT2FS_IS_64_BITMAP(bmap) \\\n\t(((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP64) || \\\n\t ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP64) || \\\n\t ((bmap)->magic == EXT2_ET_MAGIC_INODE_BITMAP64))\n\nstruct ext2_bitmap_ops {\n\tint\ttype;\n\t/* Generic bmap operators */\n\terrcode_t (*new_bmap)(ext2_filsys fs, ext2fs_generic_bitmap_64 bmap);\n\tvoid\t(*free_bmap)(ext2fs_generic_bitmap_64 bitmap);\n\terrcode_t (*copy_bmap)(ext2fs_generic_bitmap_64 src,\n\t\t\t     ext2fs_generic_bitmap_64 dest);\n\terrcode_t (*resize_bmap)(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t       __u64 new_end,\n\t\t\t       __u64 new_real_end);\n\t/* bit set/test operators */\n\tint\t(*mark_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg);\n\tint\t(*unmark_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg);\n\tint\t(*test_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg);\n\tvoid\t(*mark_bmap_extent)(ext2fs_generic_bitmap_64 bitmap, __u64 arg,\n\t\t\t\t    unsigned int num);\n\tvoid\t(*unmark_bmap_extent)(ext2fs_generic_bitmap_64 bitmap, __u64 arg,\n\t\t\t\t      unsigned int num);\n\tint\t(*test_clear_bmap_extent)(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t\t  __u64 arg, unsigned int num);\n\terrcode_t (*set_bmap_range)(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t    __u64 start, size_t num, void *in);\n\terrcode_t (*get_bmap_range)(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t    __u64 start, size_t num, void *out);\n\tvoid (*clear_bmap)(ext2fs_generic_bitmap_64 bitmap);\n\tvoid (*print_stats)(ext2fs_generic_bitmap_64);\n\n\t/* Find the first zero bit between start and end, inclusive.\n\t * May be NULL, in which case a generic function is used. */\n\terrcode_t (*find_first_zero)(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t     __u64 start, __u64 end, __u64 *out);\n\t/* Find the first set bit between start and end, inclusive.\n\t * May be NULL, in which case a generic function is used. */\n\terrcode_t (*find_first_set)(ext2fs_generic_bitmap_64 bitmap,\n\t\t\t\t    __u64 start, __u64 end, __u64 *out);\n};\n\nextern struct ext2_bitmap_ops ext2fs_blkmap64_bitarray;\nextern struct ext2_bitmap_ops ext2fs_blkmap64_rbtree;\n"
  },
  {
    "path": "src/ext2fs/closefs.c",
    "content": "/*\n * closefs.c --- close an ext2 filesystem\n *\n * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <time.h>\n#include <string.h>\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n\nstatic int test_root(unsigned int a, unsigned int b)\n{\n\twhile (1) {\n\t\tif (a < b)\n\t\t\treturn 0;\n\t\tif (a == b)\n\t\t\treturn 1;\n\t\tif (a % b)\n\t\t\treturn 0;\n\t\ta = a / b;\n\t}\n}\n\nint ext2fs_bg_has_super(ext2_filsys fs, dgrp_t group)\n{\n\tif (group == 0)\n\t\treturn 1;\n\tif (ext2fs_has_feature_sparse_super2(fs->super)) {\n\t\tif (group == fs->super->s_backup_bgs[0] ||\n\t\t    group == fs->super->s_backup_bgs[1])\n\t\t\treturn 1;\n\t\treturn 0;\n\t}\n\tif ((group <= 1) || !ext2fs_has_feature_sparse_super(fs->super))\n\t\treturn 1;\n\tif (!(group & 1))\n\t\treturn 0;\n\tif (test_root(group, 3) || (test_root(group, 5)) ||\n\t    test_root(group, 7))\n\t\treturn 1;\n\n\treturn 0;\n}\n\n/*\n * ext2fs_super_and_bgd_loc2()\n * @fs:\t\t\text2 fs pointer\n * @group\t\tgiven block group\n * @ret_super_blk:\tif !NULL, returns super block location\n * @ret_old_desc_blk:\tif !NULL, returns location of the old block\n *\t\t\tgroup descriptor\n * @ret_new_desc_blk:\tif !NULL, returns location of meta_bg block\n *\t\t\tgroup descriptor\n * @ret_used_blks:\tif !NULL, returns number of blocks used by\n *\t\t\tsuper block and group_descriptors.\n *\n * Returns errcode_t of 0\n */\nerrcode_t ext2fs_super_and_bgd_loc2(ext2_filsys fs,\n\t\t\t\t\t   dgrp_t group,\n\t\t\t\t\t   blk64_t *ret_super_blk,\n\t\t\t\t\t   blk64_t *ret_old_desc_blk,\n\t\t\t\t\t   blk64_t *ret_new_desc_blk,\n\t\t\t\t\t   blk_t *ret_used_blks)\n{\n\tblk64_t\tgroup_block, super_blk = 0, old_desc_blk = 0, new_desc_blk = 0;\n\tunsigned int meta_bg, meta_bg_size;\n\tblk_t\tnumblocks = 0;\n\tblk64_t old_desc_blocks;\n\tint\thas_super;\n\n\tgroup_block = ext2fs_group_first_block2(fs, group);\n\tif (group_block == 0 && fs->blocksize == 1024)\n\t\tgroup_block = 1; /* Deal with 1024 blocksize && bigalloc */\n\n\tif (ext2fs_has_feature_meta_bg(fs->super))\n\t\told_desc_blocks = fs->super->s_first_meta_bg;\n\telse\n\t\told_desc_blocks =\n\t\t\t(blk64_t)fs->desc_blocks + fs->super->s_reserved_gdt_blocks;\n\n\thas_super = ext2fs_bg_has_super(fs, group);\n\n\tif (has_super) {\n\t\tsuper_blk = group_block;\n\t\tnumblocks++;\n\t}\n\tmeta_bg_size = EXT2_DESC_PER_BLOCK(fs->super);\n\tmeta_bg = group / meta_bg_size;\n\n\tif (!ext2fs_has_feature_meta_bg(fs->super) ||\n\t    (meta_bg < fs->super->s_first_meta_bg)) {\n\t\tif (has_super) {\n\t\t\told_desc_blk = group_block + 1;\n\t\t\tnumblocks += old_desc_blocks;\n\t\t}\n\t} else {\n\t\tif (((group % meta_bg_size) == 0) ||\n\t\t    ((group % meta_bg_size) == 1) ||\n\t\t    ((group % meta_bg_size) == (meta_bg_size-1))) {\n\t\t\tif (has_super)\n\t\t\t\thas_super = 1;\n\t\t\tnew_desc_blk = group_block + has_super;\n\t\t\tnumblocks++;\n\t\t}\n\t}\n\n\tif (ret_super_blk)\n\t\t*ret_super_blk = super_blk;\n\tif (ret_old_desc_blk)\n\t\t*ret_old_desc_blk = old_desc_blk;\n\tif (ret_new_desc_blk)\n\t\t*ret_new_desc_blk = new_desc_blk;\n\tif (ret_used_blks)\n\t\t*ret_used_blks = numblocks;\n\n\treturn 0;\n}\n\n/*\n * This function returns the location of the superblock, block group\n * descriptors for a given block group.  It currently returns the\n * number of free blocks assuming that inode table and allocation\n * bitmaps will be in the group.  This is not necessarily the case\n * when the flex_bg feature is enabled, so callers should take care!\n * It was only really intended for use by mke2fs, and even there it's\n * not that useful.\n *\n * The ext2fs_super_and_bgd_loc2() function is 64-bit block number\n * capable and returns the number of blocks used by super block and\n * group descriptors.\n */\nint ext2fs_super_and_bgd_loc(ext2_filsys fs,\n\t\t\t     dgrp_t group,\n\t\t\t     blk_t *ret_super_blk,\n\t\t\t     blk_t *ret_old_desc_blk,\n\t\t\t     blk_t *ret_new_desc_blk,\n\t\t\t     int *ret_meta_bg)\n{\n\tblk64_t ret_super_blk2;\n\tblk64_t ret_old_desc_blk2;\n\tblk64_t ret_new_desc_blk2;\n\tblk_t ret_used_blks;\n\tblk_t numblocks;\n\tunsigned int meta_bg_size;\n\n\text2fs_super_and_bgd_loc2(fs, group, &ret_super_blk2,\n\t\t\t\t\t&ret_old_desc_blk2,\n\t\t\t\t\t&ret_new_desc_blk2,\n\t\t\t\t\t&ret_used_blks);\n\n\tnumblocks = ext2fs_group_blocks_count(fs, group);\n\n\tif (ret_super_blk)\n\t\t*ret_super_blk = (blk_t)ret_super_blk2;\n\tif (ret_old_desc_blk)\n\t\t*ret_old_desc_blk = (blk_t)ret_old_desc_blk2;\n\tif (ret_new_desc_blk)\n\t\t*ret_new_desc_blk = (blk_t)ret_new_desc_blk2;\n\tif (ret_meta_bg) {\n\t\tmeta_bg_size = EXT2_DESC_PER_BLOCK(fs->super);\n\t\t*ret_meta_bg = group / meta_bg_size;\n\t}\n\n\tnumblocks -= 2 + fs->inode_blocks_per_group + ret_used_blks;\n\n\treturn numblocks;\n}\n\n/*\n * This function forces out the primary superblock.  We need to only\n * write out those fields which we have changed, since if the\n * filesystem is mounted, it may have changed some of the other\n * fields.\n *\n * It takes as input a superblock which has already been byte swapped\n * (if necessary).\n *\n */\nstatic errcode_t write_primary_superblock(ext2_filsys fs,\n\t\t\t\t\t  struct ext2_super_block *super)\n{\n\t__u16\t\t*old_super, *new_super;\n\tint\t\tcheck_idx, write_idx, size;\n\terrcode_t\tretval;\n\n\tif (!fs->io->manager->write_byte || !fs->orig_super) {\n\tfallback:\n\t\tio_channel_set_blksize(fs->io, SUPERBLOCK_OFFSET);\n\t\tretval = io_channel_write_blk64(fs->io, 1, -SUPERBLOCK_SIZE,\n\t\t\t\t\t      super);\n\t\tio_channel_set_blksize(fs->io, fs->blocksize);\n\t\treturn retval;\n\t}\n\n\told_super = (__u16 *) fs->orig_super;\n\tnew_super = (__u16 *) super;\n\n\tfor (check_idx = 0; check_idx < SUPERBLOCK_SIZE/2; check_idx++) {\n\t\tif (old_super[check_idx] == new_super[check_idx])\n\t\t\tcontinue;\n\t\twrite_idx = check_idx;\n\t\tfor (check_idx++; check_idx < SUPERBLOCK_SIZE/2; check_idx++)\n\t\t\tif (old_super[check_idx] == new_super[check_idx])\n\t\t\t\tbreak;\n\t\tsize = 2 * (check_idx - write_idx);\n#if 0\n\t\tprintf(\"Writing %d bytes starting at %d\\n\",\n\t\t       size, write_idx*2);\n#endif\n\t\tretval = io_channel_write_byte(fs->io,\n\t\t\t       SUPERBLOCK_OFFSET + (2 * write_idx), size,\n\t\t\t\t\t       new_super + write_idx);\n\t\tif (retval == EXT2_ET_UNIMPLEMENTED)\n\t\t\tgoto fallback;\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\tmemcpy(fs->orig_super, super, SUPERBLOCK_SIZE);\n\treturn 0;\n}\n\n\n/*\n * Updates the revision to EXT2_DYNAMIC_REV\n */\nvoid ext2fs_update_dynamic_rev(ext2_filsys fs)\n{\n\tstruct ext2_super_block *sb = fs->super;\n\n\tif (sb->s_rev_level > EXT2_GOOD_OLD_REV)\n\t\treturn;\n\n\tsb->s_rev_level = EXT2_DYNAMIC_REV;\n\tsb->s_first_ino = EXT2_GOOD_OLD_FIRST_INO;\n\tsb->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE;\n\t/* s_uuid is handled by e2fsck already */\n\t/* other fields should be left alone */\n}\n\nstatic errcode_t write_backup_super(ext2_filsys fs, dgrp_t group,\n\t\t\t\t    blk64_t group_block,\n\t\t\t\t    struct ext2_super_block *super_shadow)\n{\n\terrcode_t retval;\n\tdgrp_t\tsgrp = group;\n\n\tif (sgrp > ((1 << 16) - 1))\n\t\tsgrp = (1 << 16) - 1;\n\n\tsuper_shadow->s_block_group_nr = ext2fs_cpu_to_le16(sgrp);\n\n\tretval = ext2fs_superblock_csum_set(fs, super_shadow);\n\tif (retval)\n\t\treturn retval;\n\n\treturn io_channel_write_blk64(fs->io, group_block, -SUPERBLOCK_SIZE,\n\t\t\t\t    super_shadow);\n}\n\nerrcode_t ext2fs_flush(ext2_filsys fs)\n{\n\treturn ext2fs_flush2(fs, 0);\n}\n\nerrcode_t ext2fs_flush2(ext2_filsys fs, int flags)\n{\n\tdgrp_t\t\ti;\n\terrcode_t\tretval;\n\tunsigned long\tfs_state;\n\t__u32\t\tfeature_incompat;\n\tstruct ext2_super_block *super_shadow = 0;\n\tstruct opaque_ext2_group_desc *group_shadow = 0;\n#ifdef WORDS_BIGENDIAN\n\tstruct ext2_group_desc *gdp;\n\tdgrp_t\t\tj;\n#endif\n\tchar\t*group_ptr;\n\tblk64_t\told_desc_blocks;\n\tstruct ext2fs_numeric_progress_struct progress;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif ((fs->flags & EXT2_FLAG_SUPER_ONLY) == 0 &&\n\t    !ext2fs_has_feature_journal_dev(fs->super) &&\n\t    fs->group_desc == NULL)\n\t\treturn EXT2_ET_NO_GDESC;\n\n\tfs_state = fs->super->s_state;\n\tfeature_incompat = fs->super->s_feature_incompat;\n\n\tfs->super->s_wtime = fs->now ? fs->now : time(NULL);\n\tfs->super->s_block_group_nr = 0;\n\n\t/*\n\t * If the write_bitmaps() function is present, call it to\n\t * flush the bitmaps.  This is done this way so that a simple\n\t * program that doesn't mess with the bitmaps doesn't need to\n\t * drag in the bitmaps.c code.\n\t *\n\t * Bitmap checksums live in the group descriptor, so the\n\t * bitmaps need to be written before the descriptors.\n\t */\n\tif (fs->write_bitmaps) {\n\t\tretval = fs->write_bitmaps(fs);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t}\n\n\t/*\n\t * Set the state of the FS to be non-valid.  (The state has\n\t * already been backed up earlier, and will be restored after\n\t * we write out the backup superblocks.)\n\t */\n\tfs->super->s_state &= ~EXT2_VALID_FS;\n\text2fs_clear_feature_journal_needs_recovery(fs->super);\n\n\t/* Byte swap the superblock and the group descriptors if necessary */\n#ifdef WORDS_BIGENDIAN\n\tretval = EXT2_ET_NO_MEMORY;\n\tretval = ext2fs_get_mem(SUPERBLOCK_SIZE, &super_shadow);\n\tif (retval)\n\t\tgoto errout;\n\tmemcpy(super_shadow, fs->super, sizeof(struct ext2_super_block));\n\text2fs_swap_super(super_shadow);\n\n\tif (((fs->flags & EXT2_FLAG_SUPER_ONLY) == 0) &&\n\t    !ext2fs_has_feature_journal_dev(fs->super)) {\n\t\tretval = ext2fs_get_array(fs->desc_blocks, fs->blocksize,\n\t\t\t\t\t  &group_shadow);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t\tmemcpy(group_shadow, fs->group_desc, (size_t) fs->blocksize *\n\t\t       fs->desc_blocks);\n\n\t\tfor (j = 0; j < fs->group_desc_count; j++) {\n\t\t\tgdp = ext2fs_group_desc(fs, group_shadow, j);\n\t\t\text2fs_swap_group_desc2(fs, gdp);\n\t\t}\n\t}\n#else\n\tsuper_shadow = fs->super;\n\tgroup_shadow = fs->group_desc;\n#endif\n\n\t/*\n\t * If this is an external journal device, don't write out the\n\t * block group descriptors or any of the backup superblocks\n\t */\n\tif (ext2fs_has_feature_journal_dev(fs->super))\n\t\tgoto write_primary_superblock_only;\n\n\t/*\n\t * Write out the master group descriptors, and the backup\n\t * superblocks and group descriptors.\n\t */\n\tgroup_ptr = (char *) group_shadow;\n\tif (ext2fs_has_feature_meta_bg(fs->super)) {\n\t\told_desc_blocks = fs->super->s_first_meta_bg;\n\t\tif (old_desc_blocks > fs->desc_blocks)\n\t\t\told_desc_blocks = fs->desc_blocks;\n\t} else\n\t\told_desc_blocks = fs->desc_blocks;\n\n\tif (fs->progress_ops && fs->progress_ops->init)\n\t\t(fs->progress_ops->init)(fs, &progress, NULL,\n\t\t\t\t\t fs->group_desc_count);\n\n\n\tfor (i = 0; i < fs->group_desc_count; i++) {\n\t\tblk64_t\tsuper_blk, old_desc_blk, new_desc_blk;\n\n\t\tif (fs->progress_ops && fs->progress_ops->update)\n\t\t\t(fs->progress_ops->update)(fs, &progress, i);\n\t\text2fs_super_and_bgd_loc2(fs, i, &super_blk, &old_desc_blk,\n\t\t\t\t\t &new_desc_blk, 0);\n\n\t\tif (!(fs->flags & EXT2_FLAG_MASTER_SB_ONLY) &&i && super_blk) {\n\t\t\tretval = write_backup_super(fs, i, super_blk,\n\t\t\t\t\t\t    super_shadow);\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\t\t}\n\t\tif (fs->flags & EXT2_FLAG_SUPER_ONLY)\n\t\t\tcontinue;\n\t\tif ((old_desc_blk) &&\n\t\t    (!(fs->flags & EXT2_FLAG_MASTER_SB_ONLY) || (i == 0))) {\n\t\t\tretval = io_channel_write_blk64(fs->io,\n\t\t\t      old_desc_blk, old_desc_blocks, group_ptr);\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\t\t}\n\t\tif (new_desc_blk) {\n\t\t\tint meta_bg = i / EXT2_DESC_PER_BLOCK(fs->super);\n\n\t\t\tretval = io_channel_write_blk64(fs->io, new_desc_blk,\n\t\t\t\t1, group_ptr + (meta_bg*fs->blocksize));\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\t\t}\n\t}\n\n\tif (fs->progress_ops && fs->progress_ops->close)\n\t\t(fs->progress_ops->close)(fs, &progress, NULL);\n\nwrite_primary_superblock_only:\n\t/*\n\t * Write out master superblock.  This has to be done\n\t * separately, since it is located at a fixed location\n\t * (SUPERBLOCK_OFFSET).  We flush all other pending changes\n\t * out to disk first, just to avoid a race condition with an\n\t * insy-tinsy window....\n\t */\n\n\tfs->super->s_block_group_nr = 0;\n\tfs->super->s_state = fs_state;\n\tfs->super->s_feature_incompat = feature_incompat;\n#ifdef WORDS_BIGENDIAN\n\t*super_shadow = *fs->super;\n\text2fs_swap_super(super_shadow);\n#endif\n\n\tretval = ext2fs_superblock_csum_set(fs, super_shadow);\n\tif (retval)\n\t\treturn retval;\n\n\tif (!(flags & EXT2_FLAG_FLUSH_NO_SYNC)) {\n\t\tretval = io_channel_flush(fs->io);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t}\n\tretval = write_primary_superblock(fs, super_shadow);\n\tif (retval)\n\t\tgoto errout;\n\n\tfs->flags &= ~EXT2_FLAG_DIRTY;\n\n\tif (!(flags & EXT2_FLAG_FLUSH_NO_SYNC)) {\n\t\tretval = io_channel_flush(fs->io);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t}\nerrout:\n\tfs->super->s_state = fs_state;\n#ifdef WORDS_BIGENDIAN\n\tif (super_shadow)\n\t\text2fs_free_mem(&super_shadow);\n\tif (group_shadow)\n\t\text2fs_free_mem(&group_shadow);\n#endif\n\treturn retval;\n}\n\nerrcode_t ext2fs_close_free(ext2_filsys *fs_ptr)\n{\n\terrcode_t ret;\n\text2_filsys fs = *fs_ptr;\n\n\tret = ext2fs_close2(fs, 0);\n\tif (ret)\n\t\text2fs_free(fs);\n\t*fs_ptr = NULL;\n\treturn ret;\n}\n\nerrcode_t ext2fs_close(ext2_filsys fs)\n{\n\treturn ext2fs_close2(fs, 0);\n}\n\nerrcode_t ext2fs_close2(ext2_filsys fs, int flags)\n{\n\terrcode_t\tretval;\n\tint\t\tmeta_blks;\n\tio_stats stats = 0;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif (fs->write_bitmaps) {\n\t\tretval = fs->write_bitmaps(fs);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\tif (fs->super->s_kbytes_written &&\n\t    fs->io->manager->get_stats)\n\t\tfs->io->manager->get_stats(fs->io, &stats);\n\tif (stats && stats->bytes_written && (fs->flags & EXT2_FLAG_RW)) {\n\t\tfs->super->s_kbytes_written += stats->bytes_written >> 10;\n\t\tmeta_blks = fs->desc_blocks + 1;\n\t\tif (!(fs->flags & EXT2_FLAG_SUPER_ONLY))\n\t\t\tfs->super->s_kbytes_written += meta_blks /\n\t\t\t\t(fs->blocksize / 1024);\n\t\tif ((fs->flags & EXT2_FLAG_DIRTY) == 0)\n\t\t\tfs->flags |= EXT2_FLAG_SUPER_ONLY | EXT2_FLAG_DIRTY;\n\t}\n\tif (fs->flags & EXT2_FLAG_DIRTY) {\n\t\tretval = ext2fs_flush2(fs, flags);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\n\tretval = ext2fs_mmp_stop(fs);\n\tif (retval)\n\t\treturn retval;\n\n\text2fs_free(fs);\n\treturn 0;\n}\n\n"
  },
  {
    "path": "src/ext2fs/com_err.h",
    "content": "/*\n * Header file for common error description library.\n *\n * Copyright 1988, Student Information Processing Board of the\n * Massachusetts Institute of Technology.\n *\n * For copyright and distribution info, see the documentation supplied\n * with this package.\n */\n\n#if !defined(__COM_ERR_H) && !defined(__COM_ERR_H__)\n\n#ifdef __GNUC__\n#define COM_ERR_ATTR(x) __attribute__(x)\n#else\n#define COM_ERR_ATTR(x)\n#endif\n\n#include <stddef.h>\n#include <stdarg.h>\n\ntypedef long errcode_t;\n\nstruct error_table {\n\tchar const * const * msgs;\n\tlong base;\n\tint n_msgs;\n};\nstruct et_list;\n\n/* For use with Rufus */\nextern void uprintf(const char *format, ...);\n#define VA_ARGS(...) , ##__VA_ARGS__\n#define com_err(src, err, fmt, ...) uprintf(\"%s: [%08X] \" # fmt, src?src:\"ext2fs\", err - EXT2_ET_BASE VA_ARGS(__VA_ARGS__))\n\nextern char const *error_message (long);\nextern void (*com_err_hook) (const char *, long, const char *, va_list);\nextern void (*set_com_err_hook (void (*) (const char *, long,\n\t\t\t\t\t  const char *, va_list)))\n\t(const char *, long, const char *, va_list);\nextern void (*reset_com_err_hook (void)) (const char *, long,\n\t\t\t\t\t  const char *, va_list);\nextern int init_error_table(const char * const *msgs, long base, int count);\nextern char *(*set_com_err_gettext (char *(*) (const char *)))\n\t(const char *);\n\nextern errcode_t add_error_table(const struct error_table * et);\nextern errcode_t remove_error_table(const struct error_table * et);\nextern void add_to_error_table(struct et_list *new_table);\n\n/* Provided for Heimdall compatibility */\nextern const char *com_right(struct et_list *list, long code);\nextern const char *com_right_r(struct et_list *list, long code, char *str, size_t len);\nextern void initialize_error_table_r(struct et_list **list,\n\t\t\t\t     const char **messages,\n\t\t\t\t     int num_errors,\n\t\t\t\t     long base);\nextern void free_error_table(struct et_list *et);\n\n/* Provided for compatibility with other com_err libraries */\nextern int et_list_lock(void);\nextern int et_list_unlock(void);\n\n#define __COM_ERR_H\n#define __COM_ERR_H__\n#endif /* !defined(__COM_ERR_H) && !defined(__COM_ERR_H__)*/\n"
  },
  {
    "path": "src/ext2fs/config.h",
    "content": "#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n/* Define to 1 if you have `alloca', as a function or macro. */\n#define HAVE_ALLOCA 1\n\n/* Define to 1 if you have the `asprintf' function. */\n#define HAVE_ASPRINTF 1\n\n/* Define to 1 if the compiler understands __builtin_expect. */\n#define HAVE_BUILTIN_EXPECT 1\n\n/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you\n   don't. */\n#define HAVE_DECL_FEOF_UNLOCKED 0\n\n/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if\n   you don't. */\n#define HAVE_DECL_FGETS_UNLOCKED 0\n\n/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you\n   don't. */\n#define HAVE_DECL_GETC_UNLOCKED 0\n\n/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you\n   don't. */\n#define HAVE_DECL__SNPRINTF 1\n\n/* Define to 1 if you have the declaration of `_snwprintf', and to 0 if you\n   don't. */\n#define HAVE_DECL__SNWPRINTF 1\n\n/* Define to 1 if you have the `fwprintf' function. */\n#define HAVE_FWPRINTF 1\n\n/* Define to 1 if you have the `getcwd' function. */\n#define HAVE_GETCWD 1\n\n/* Define to 1 if you have the `getpagesize' function. */\n#define HAVE_GETPAGESIZE 1\n\n/* Define if you have the iconv() function and it works. */\n#define HAVE_ICONV 1\n\n/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */\n#define HAVE_INTMAX_T 1\n\n/* Define to 1 if the system has the type `intptr_t'. */\n#define HAVE_INTPTR_T 1\n\n/* Define to 1 if you have the <inttypes.h> header file. */\n#define HAVE_INTTYPES_H 1\n\n/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and\n   declares uintmax_t. */\n#define HAVE_INTTYPES_H_WITH_UINTMAX 1\n\n/* Define to 1 if you have the <limits.h> header file. */\n#define HAVE_LIMITS_H 1\n\n/* Define to 1 if the system has the type 'long long int'. */\n#define HAVE_LONG_LONG_INT 1\n\n/* Define to 1 if lseek64 declared in unistd.h */\n#define HAVE_LSEEK64_PROTOTYPE 1\n\n/* Define to 1 if you have the `mbrtowc' function. */\n#define HAVE_MBRTOWC 1\n\n/* Define to 1 if you have the <memory.h> header file. */\n#define HAVE_MEMORY_H 1\n\n/* Define to 1 if you have the `mempcpy' function. */\n#define HAVE_MEMPCPY 1\n\n/* Define to 1 if you have the <pthread.h> header file. */\n#define HAVE_PTHREAD_H 1\n\n/* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */\n#define HAVE_PTHREAD_MUTEX_RECURSIVE 1\n\n/* Define if the POSIX multithreading library has read/write locks. */\n#define HAVE_PTHREAD_RWLOCK 1\n\n/* Define to 1 if you have the `putenv' function. */\n#define HAVE_PUTENV 1\n\n/* Define to 1 if dirent has d_reclen */\n#define HAVE_RECLEN_DIRENT 1\n\n/* Define to 1 if you have the `setlocale' function. */\n#define HAVE_SETLOCALE 1\n\n/* Define to 1 if you have the `snprintf' function. */\n#define HAVE_SNPRINTF 1\n\n/* Define to 1 if you have the <stddef.h> header file. */\n#define HAVE_STDDEF_H 1\n\n/* Define to 1 if you have the <stdint.h> header file. */\n#define HAVE_STDINT_H 1\n\n/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares\n   uintmax_t. */\n#define HAVE_STDINT_H_WITH_UINTMAX 1\n\n/* Define to 1 if you have the <stdlib.h> header file. */\n#define HAVE_STDLIB_H 1\n\n/* Define to 1 if you have the `strcasecmp' function. */\n#define HAVE_STRCASECMP 1\n\n/* Define to 1 if you have the `strdup' function. */\n#define HAVE_STRDUP 1\n\n/* Define to 1 if you have the <strings.h> header file. */\n#define HAVE_STRINGS_H 1\n\n/* Define to 1 if you have the <string.h> header file. */\n#define HAVE_STRING_H 1\n\n/* Define to 1 if you have the `strnlen' function. */\n#define HAVE_STRNLEN 1\n\n/* Define to 1 if you have the `strtoul' function. */\n#define HAVE_STRTOUL 1\n\n/* Define to 1 if you have the <sys/param.h> header file. */\n#define HAVE_SYS_PARAM_H 1\n\n/* Define to 1 if you have the <sys/stat.h> header file. */\n#define HAVE_SYS_STAT_H 1\n\n/* Define to 1 if you have the <sys/types.h> header file. */\n#define HAVE_SYS_TYPES_H 1\n\n/* Define to 1 if you have the `tsearch' function. */\n#define HAVE_TSEARCH 1\n\n/* Define to 1 if ssize_t declared */\n#define HAVE_TYPE_SSIZE_T 1\n\n/* Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>. */\n#define HAVE_UINTMAX_T 1\n\n/* Define to 1 if you have the <unistd.h> header file. */\n#define HAVE_UNISTD_H 1\n\n/* Define to 1 if the system has the type 'unsigned long long int'. */\n#define HAVE_UNSIGNED_LONG_LONG_INT 1\n\n/* Define to 1 or 0, depending whether the compiler supports simple visibility\n   declarations. */\n#define HAVE_VISIBILITY 1\n\n/* Define to 1 if you have the `vprintf' function. */\n#define HAVE_VPRINTF 1\n\n/* Define if you have the 'wchar_t' type. */\n#define HAVE_WCHAR_T 1\n\n/* Define to 1 if you have the `wcrtomb' function. */\n#define HAVE_WCRTOMB 1\n\n/* Define to 1 if you have the `wcslen' function. */\n#define HAVE_WCSLEN 1\n\n/* Define to 1 if you have the `wcsnlen' function. */\n#define HAVE_WCSNLEN 1\n\n/* Define if you have the 'wint_t' type. */\n#define HAVE_WINT_T 1\n\n/* Define if you have 'winsock.h'. */\n#define HAVE_WINSOCK_H 1\n\n/* Define to 1 if O_NOATIME works. */\n#define HAVE_WORKING_O_NOATIME 0\n\n/* Define to 1 if O_NOFOLLOW works. */\n#define HAVE_WORKING_O_NOFOLLOW 0\n\n/* Define as const if the declaration of iconv() needs const. */\n#define ICONV_CONST \n\n/* Define if integer division by zero raises signal SIGFPE. */\n#define INTDIV0_RAISES_SIGFPE 1\n\n/* The size of `int', as computed by sizeof. */\n#define SIZEOF_INT 4\n\n/* The size of `long', as computed by sizeof. */\n#define SIZEOF_LONG 4\n\n/* The size of `long long', as computed by sizeof. */\n#define SIZEOF_LONG_LONG 8\n\n/* The size of `short', as computed by sizeof. */\n#define SIZEOF_SHORT 2\n\n/* Define to 1 if you have the ANSI C header files. */\n#define STDC_HEADERS 1\n\n/* Enable GNU extensions on systems that have them.  */\n#ifndef _GNU_SOURCE\n# define _GNU_SOURCE 1\n#endif\n\n/* Define if the native Windows multithreading API can be used. */\n/* #undef USE_WINDOWS_THREADS */\n#define USE_WINDOWS_THREADS 1\n\n\n/* Please see the Gnulib manual for how to use these macros.\n\n   Suppress extern inline with HP-UX cc, as it appears to be broken; see\n   <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.\n\n   Suppress extern inline with Sun C in standards-conformance mode, as it\n   mishandles inline functions that call each other.  E.g., for 'inline void f\n   (void) { } inline void g (void) { f (); }', c99 incorrectly complains\n   'reference to static identifier \"f\" in extern inline function'.\n   This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.\n\n   Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))\n   on configurations that mistakenly use 'static inline' to implement\n   functions or macros in standard C headers like <ctype.h>.  For example,\n   if isdigit is mistakenly implemented via a static inline function,\n   a program containing an extern inline function that calls isdigit\n   may not work since the C standard prohibits extern inline functions\n   from calling static functions.  This bug is known to occur on:\n\n     OS X 10.8 and earlier; see:\n     http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html\n\n     DragonFly; see\n     http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log\n\n     FreeBSD; see:\n     http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html\n\n   OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and\n   for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.\n   Assume DragonFly and FreeBSD will be similar.  */\n#if (((defined __APPLE__ && defined __MACH__) \\\n      || defined __DragonFly__ || defined __FreeBSD__) \\\n     && (defined __header_inline \\\n         ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \\\n            && ! defined __clang__) \\\n         : ((! defined _DONT_USE_CTYPE_INLINE_ \\\n             && (defined __GNUC__ || defined __cplusplus)) \\\n            || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \\\n                && defined __GNUC__ && ! defined __cplusplus))))\n# define _GL_EXTERN_INLINE_STDHEADER_BUG\n#endif\n#if ((__GNUC__ \\\n      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \\\n      : (199901L <= __STDC_VERSION__ \\\n         && !defined __HP_cc \\\n         && !defined __PGI \\\n         && !(defined __SUNPRO_C && __STDC__))) \\\n     && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)\n# define _GL_INLINE inline\n# define _GL_EXTERN_INLINE extern inline\n# define _GL_EXTERN_INLINE_IN_USE\n#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \\\n       && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)\n# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__\n   /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */\n#  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))\n# else\n#  define _GL_INLINE extern inline\n# endif\n# define _GL_EXTERN_INLINE extern\n# define _GL_EXTERN_INLINE_IN_USE\n#else\n# define _GL_INLINE static _GL_UNUSED\n# define _GL_EXTERN_INLINE static _GL_UNUSED\n#endif\n\n/* In GCC 4.6 (inclusive) to 5.1 (exclusive),\n   suppress bogus \"no previous prototype for 'FOO'\"\n   and \"no previous declaration for 'FOO'\" diagnostics,\n   when FOO is an inline function in the header; see\n   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and\n   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>.  */\n#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__\n# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__\n#  define _GL_INLINE_HEADER_CONST_PRAGMA\n# else\n#  define _GL_INLINE_HEADER_CONST_PRAGMA \\\n     _Pragma (\"GCC diagnostic ignored \\\"-Wsuggest-attribute=const\\\"\")\n# endif\n# define _GL_INLINE_HEADER_BEGIN \\\n    _Pragma (\"GCC diagnostic push\") \\\n    _Pragma (\"GCC diagnostic ignored \\\"-Wmissing-prototypes\\\"\") \\\n    _Pragma (\"GCC diagnostic ignored \\\"-Wmissing-declarations\\\"\") \\\n    _GL_INLINE_HEADER_CONST_PRAGMA\n# define _GL_INLINE_HEADER_END \\\n    _Pragma (\"GCC diagnostic pop\")\n#else\n# define _GL_INLINE_HEADER_BEGIN\n# define _GL_INLINE_HEADER_END\n#endif\n\n/* Define as a marker that can be attached to declarations that might not\n    be used.  This helps to reduce warnings, such as from\n    GCC -Wunused-parameter.  */\n#ifndef _GL_UNUSED\n# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)\n#  define _GL_UNUSED __attribute__ ((__unused__))\n# else\n#  define _GL_UNUSED\n# endif\n#endif\n\n/* The __pure__ attribute was added in gcc 2.96.  */\n#ifndef _GL_ATTRIBUTE_PURE\n# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)\n#  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))\n# else\n#  define _GL_ATTRIBUTE_PURE /* empty */\n# endif\n#endif\n\n#ifdef _MSC_VER\n#define __attribute__(x)\n#endif\n\n#define __libc_lock_t                   gl_lock_t\n#define __libc_lock_define              gl_lock_define\n#define __libc_lock_define_initialized  gl_lock_define_initialized\n#define __libc_lock_init                gl_lock_init\n#define __libc_lock_lock                gl_lock_lock\n#define __libc_lock_unlock              gl_lock_unlock\n#define __libc_lock_recursive_t                   gl_recursive_lock_t\n#define __libc_lock_define_recursive              gl_recursive_lock_define\n#define __libc_lock_define_initialized_recursive  gl_recursive_lock_define_initialized\n#define __libc_lock_init_recursive                gl_recursive_lock_init\n#define __libc_lock_lock_recursive                gl_recursive_lock_lock\n#define __libc_lock_unlock_recursive              gl_recursive_lock_unlock\n#define glthread_in_use  libintl_thread_in_use\n#define glthread_lock_init_func     libintl_lock_init_func\n#define glthread_lock_lock_func     libintl_lock_lock_func\n#define glthread_lock_unlock_func   libintl_lock_unlock_func\n#define glthread_lock_destroy_func  libintl_lock_destroy_func\n#define glthread_rwlock_init_multithreaded     libintl_rwlock_init_multithreaded\n#define glthread_rwlock_init_func              libintl_rwlock_init_func\n#define glthread_rwlock_rdlock_multithreaded   libintl_rwlock_rdlock_multithreaded\n#define glthread_rwlock_rdlock_func            libintl_rwlock_rdlock_func\n#define glthread_rwlock_wrlock_multithreaded   libintl_rwlock_wrlock_multithreaded\n#define glthread_rwlock_wrlock_func            libintl_rwlock_wrlock_func\n#define glthread_rwlock_unlock_multithreaded   libintl_rwlock_unlock_multithreaded\n#define glthread_rwlock_unlock_func            libintl_rwlock_unlock_func\n#define glthread_rwlock_destroy_multithreaded  libintl_rwlock_destroy_multithreaded\n#define glthread_rwlock_destroy_func           libintl_rwlock_destroy_func\n#define glthread_recursive_lock_init_multithreaded     libintl_recursive_lock_init_multithreaded\n#define glthread_recursive_lock_init_func              libintl_recursive_lock_init_func\n#define glthread_recursive_lock_lock_multithreaded     libintl_recursive_lock_lock_multithreaded\n#define glthread_recursive_lock_lock_func              libintl_recursive_lock_lock_func\n#define glthread_recursive_lock_unlock_multithreaded   libintl_recursive_lock_unlock_multithreaded\n#define glthread_recursive_lock_unlock_func            libintl_recursive_lock_unlock_func\n#define glthread_recursive_lock_destroy_multithreaded  libintl_recursive_lock_destroy_multithreaded\n#define glthread_recursive_lock_destroy_func           libintl_recursive_lock_destroy_func\n#define glthread_once_func            libintl_once_func\n#define glthread_once_singlethreaded  libintl_once_singlethreaded\n#define glthread_once_multithreaded   libintl_once_multithreaded\n"
  },
  {
    "path": "src/ext2fs/crc16.c",
    "content": "/*\n *      crc16.c\n *\n * This source code is licensed under the GNU General Public License,\n * Version 2. See the file COPYING for more details.\n */\n\n#include \"config.h\"\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#include <ext2fs/ext2_types.h>\n\n#include \"crc16.h\"\n\n/** CRC table for the CRC-16. The poly is 0x8005 (x16 + x15 + x2 + 1) */\nstatic __u16 const crc16_table[256] = {\n\t0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,\n\t0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,\n\t0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40,\n\t0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841,\n\t0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40,\n\t0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41,\n\t0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641,\n\t0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040,\n\t0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240,\n\t0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441,\n\t0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41,\n\t0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840,\n\t0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41,\n\t0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40,\n\t0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640,\n\t0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041,\n\t0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240,\n\t0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441,\n\t0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41,\n\t0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840,\n\t0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41,\n\t0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40,\n\t0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640,\n\t0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041,\n\t0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241,\n\t0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440,\n\t0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40,\n\t0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841,\n\t0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40,\n\t0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41,\n\t0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641,\n\t0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040\n};\n\n/**\n * Compute the CRC-16 for the data buffer\n *\n * @param crc     previous CRC value\n * @param buffer  data pointer\n * @param len     number of bytes in the buffer\n * @return        the updated CRC value\n */\ncrc16_t ext2fs_crc16(crc16_t crc, const void *buffer, unsigned int len)\n{\n\tconst unsigned char *cp = buffer;\n\n\twhile (len--)\n\t\t/*\n\t\t * for an unknown reason, PPC treats __u16 as signed\n\t\t * and keeps doing sign extension on the value.\n\t\t * Instead, use only the low 16 bits of an unsigned\n\t\t * int for holding the CRC value to avoid this.\n\t\t */\n\t\tcrc = (((crc >> 8) & 0xffU) ^\n\t\t       crc16_table[(crc ^ *cp++) & 0xffU]) & 0x0000ffffU;\n\treturn crc;\n}\n"
  },
  {
    "path": "src/ext2fs/crc16.h",
    "content": "/*\n *\tcrc16.h - CRC-16 routine\n *\n * Implements the standard CRC-16:\n *   Width 16\n *   Poly  0x8005 (x16 + x15 + x2 + 1)\n *   Init  0\n *\n * Copyright (c) 2005 Ben Gardner <bgardner@wabtec.com>\n *\n * This source code is licensed under the GNU General Public License,\n * Version 2. See the file COPYING for more details.\n */\n\n#ifndef __CRC16_H\n#define __CRC16_H\n\n/* for an unknown reason, PPC treats __u16 as signed and keeps doing sign\n * extension on the value.  Instead, use only the low 16 bits of an\n * unsigned int for holding the CRC value to avoid this.\n */\ntypedef unsigned int crc16_t;\n\nextern crc16_t ext2fs_crc16(crc16_t crc, const void *buffer, unsigned int len);\n\n#endif /* __CRC16_H */\n"
  },
  {
    "path": "src/ext2fs/crc32c.c",
    "content": "/*\n * crc32c.c\n *\n * August 26, 2011 Darrick J. Wong <djwong at us.ibm.com>\n * Reuse Bob Pearson's slice-by-8 implementation for e2fsprogs.\n *\n * July 20, 2011 Bob Pearson <rpearson at systemfabricworks.com>\n * added slice by 8 algorithm to the existing conventional and\n * slice by 4 algorithms.\n *\n * Oct 15, 2000 Matt Domsch <Matt_Domsch@dell.com>\n * Nicer crc32 functions/docs submitted by linux@horizon.com.  Thanks!\n * Code was from the public domain, copyright abandoned.  Code was\n * subsequently included in the kernel, thus was re-licensed under the\n * GNU GPL v2.\n *\n * Oct 12, 2000 Matt Domsch <Matt_Domsch@dell.com>\n * Same crc32 function was used in 5 other places in the kernel.\n * I made one version, and deleted the others.\n * There are various incantations of crc32().  Some use a seed of 0 or ~0.\n * Some xor at the end with ~0.  The generic crc32() function takes\n * seed as an argument, and doesn't xor at the end.  Then individual\n * users can do whatever they need.\n *   drivers/net/smc9194.c uses seed ~0, doesn't xor with ~0.\n *   fs/jffs2 uses seed 0, doesn't xor with ~0.\n *   fs/partitions/efi.c uses seed ~0, xor's with ~0.\n *\n * This source code is licensed under the GNU General Public License,\n * Version 2.  See the file COPYING for more details.\n */\n#include \"config.h\"\n#include <stdint.h>\n#include <stdlib.h>\n#include <stdio.h>\n#ifndef min\n#define min(x, y)\t\t((x) > (y) ? (y) : (x))\n#endif\n#define __ALIGN_KERNEL_MASK(x, mask)\t(((x) + (mask)) & ~(mask))\n#define __ALIGN_KERNEL(x, a)\t__ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)\n#define ALIGN(x, a)\t\t__ALIGN_KERNEL((x), (a))\n#define PTR_ALIGN(p, a)\t\t((__typeof__(p))ALIGN((unsigned long)(p), (a)))\n#include \"crc32c_defs.h\"\n\n#include \"ext2fs.h\"\n#ifdef WORDS_BIGENDIAN\n#define __constant_cpu_to_le32(x) ___constant_swab32((x))\n#define __constant_cpu_to_be32(x) (x)\n#define __be32_to_cpu(x) (x)\n#define __cpu_to_be32(x) (x)\n#define __cpu_to_le32(x) (ext2fs_cpu_to_le32((x)))\n#define __le32_to_cpu(x) (ext2fs_le32_to_cpu((x)))\n#else\n#define __constant_cpu_to_le32(x) (x)\n#define __constant_cpu_to_be32(x) ___constant_swab32((x))\n#define __be32_to_cpu(x) (ext2fs_be32_to_cpu((x)))\n#define __cpu_to_be32(x) (ext2fs_cpu_to_be32((x)))\n#define __cpu_to_le32(x) (x)\n#define __le32_to_cpu(x) (x)\n#endif\n\n#if CRC_LE_BITS > 8\n# define tole(x) __constant_cpu_to_le32(x)\n#else\n# define tole(x) (x)\n#endif\n\n#if CRC_BE_BITS > 8\n# define tobe(x) __constant_cpu_to_be32(x)\n#else\n# define tobe(x) (x)\n#endif\n\n#include \"crc32c_table.h\"\n\n#if CRC_LE_BITS > 8 || CRC_BE_BITS > 8\n\n/* implements slicing-by-4 or slicing-by-8 algorithm */\nstatic inline uint32_t\ncrc32_body(uint32_t crc, unsigned char const *buf, size_t len,\n\t   const uint32_t (*tab)[256])\n{\n# ifndef WORDS_BIGENDIAN\n#  define DO_CRC(x) (crc = t0[(crc ^ (x)) & 255] ^ (crc >> 8))\n#  define DO_CRC4 (t3[(q) & 255] ^ t2[(q >> 8) & 255] ^ \\\n\t\t   t1[(q >> 16) & 255] ^ t0[(q >> 24) & 255])\n#  define DO_CRC8 (t7[(q) & 255] ^ t6[(q >> 8) & 255] ^ \\\n\t\t   t5[(q >> 16) & 255] ^ t4[(q >> 24) & 255])\n# else\n#  define DO_CRC(x) (crc = t0[((crc >> 24) ^ (x)) & 255] ^ (crc << 8))\n#  define DO_CRC4 (t0[(q) & 255] ^ t1[(q >> 8) & 255] ^ \\\n\t\t   t2[(q >> 16) & 255] ^ t3[(q >> 24) & 255])\n#  define DO_CRC8 (t4[(q) & 255] ^ t5[(q >> 8) & 255] ^ \\\n\t\t   t6[(q >> 16) & 255] ^ t7[(q >> 24) & 255])\n# endif\n\tconst uint32_t *b;\n\tsize_t rem_len;\n\tconst uint32_t *t0 = tab[0], *t1 = tab[1], *t2 = tab[2], *t3 = tab[3];\n\tconst uint32_t *t4 = tab[4], *t5 = tab[5], *t6 = tab[6], *t7 = tab[7];\n\tuint32_t q;\n\n\t/* Align it */\n\tif (unlikely((uintptr_t)buf & 3 && len)) {\n\t\tdo {\n\t\t\tDO_CRC(*buf++);\n\t\t} while ((--len) && ((uintptr_t)buf)&3);\n\t}\n\n# if CRC_LE_BITS == 32\n\trem_len = len & 3;\n\tlen = len >> 2;\n# else\n\trem_len = len & 7;\n\tlen = len >> 3;\n# endif\n\n\tb = (const uint32_t *)buf;\n\tfor (--b; len; --len) {\n\t\tq = crc ^ *++b; /* use pre increment for speed */\n# if CRC_LE_BITS == 32\n\t\tcrc = DO_CRC4;\n# else\n\t\tcrc = DO_CRC8;\n\t\tq = *++b;\n\t\tcrc ^= DO_CRC4;\n# endif\n\t}\n\tlen = rem_len;\n\t/* And the last few bytes */\n\tif (len) {\n\t\tconst uint8_t *p = (const uint8_t *)(b + 1) - 1;\n\t\tdo {\n\t\t\tDO_CRC(*++p); /* use pre increment for speed */\n\t\t} while (--len);\n\t}\n\treturn crc;\n#undef DO_CRC\n#undef DO_CRC4\n#undef DO_CRC8\n}\n#endif\n\n/**\n * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32\n * @crc: seed value for computation.  ~0 for Ethernet, sometimes 0 for\n *\tother uses, or the previous crc32 value if computing incrementally.\n * @p: pointer to buffer over which CRC is run\n * @len: length of buffer @p\n */\nstatic inline uint32_t crc32_le_generic(uint32_t crc, unsigned char const *p,\n\t\t\t\t\tsize_t len, const uint32_t (*tab)[256],\n\t\t\t\t\tuint32_t polynomial EXT2FS_ATTR((unused)))\n{\n#if CRC_LE_BITS == 1\n\tint i;\n\twhile (len--) {\n\t\tcrc ^= *p++;\n\t\tfor (i = 0; i < 8; i++)\n\t\t\tcrc = (crc >> 1) ^ ((crc & 1) ? polynomial : 0);\n\t}\n# elif CRC_LE_BITS == 2\n\twhile (len--) {\n\t\tcrc ^= *p++;\n\t\tcrc = (crc >> 2) ^ tab[0][crc & 3];\n\t\tcrc = (crc >> 2) ^ tab[0][crc & 3];\n\t\tcrc = (crc >> 2) ^ tab[0][crc & 3];\n\t\tcrc = (crc >> 2) ^ tab[0][crc & 3];\n\t}\n# elif CRC_LE_BITS == 4\n\twhile (len--) {\n\t\tcrc ^= *p++;\n\t\tcrc = (crc >> 4) ^ tab[0][crc & 15];\n\t\tcrc = (crc >> 4) ^ tab[0][crc & 15];\n\t}\n# elif CRC_LE_BITS == 8\n\t/* aka Sarwate algorithm */\n\twhile (len--) {\n\t\tcrc ^= *p++;\n\t\tcrc = (crc >> 8) ^ tab[0][crc & 255];\n\t}\n# else\n\tcrc = __cpu_to_le32(crc);\n\tcrc = crc32_body(crc, p, len, tab);\n\tcrc = __le32_to_cpu(crc);\n#endif\n\treturn crc;\n}\n\nuint32_t ext2fs_crc32c_le(uint32_t crc, unsigned char const *p, size_t len)\n{\n\treturn crc32_le_generic(crc, p, len, crc32ctable_le, CRC32C_POLY_LE);\n}\n\n/**\n * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32\n * @crc: seed value for computation.  ~0 for Ethernet, sometimes 0 for\n *\tother uses, or the previous crc32 value if computing incrementally.\n * @p: pointer to buffer over which CRC is run\n * @len: length of buffer @p\n */\nstatic inline uint32_t crc32_be_generic(uint32_t crc, unsigned char const *p,\n\t\t\t\t\tsize_t len, const uint32_t (*tab)[256],\n\t\t\t\t\tuint32_t polynomial EXT2FS_ATTR((unused)))\n{\n#if CRC_BE_BITS == 1\n\tint i;\n\twhile (len--) {\n\t\tcrc ^= *p++ << 24;\n\t\tfor (i = 0; i < 8; i++)\n\t\t\tcrc =\n\t\t\t    (crc << 1) ^ ((crc & 0x80000000) ? polynomial :\n\t\t\t\t\t  0);\n\t}\n# elif CRC_BE_BITS == 2\n\twhile (len--) {\n\t\tcrc ^= *p++ << 24;\n\t\tcrc = (crc << 2) ^ tab[0][crc >> 30];\n\t\tcrc = (crc << 2) ^ tab[0][crc >> 30];\n\t\tcrc = (crc << 2) ^ tab[0][crc >> 30];\n\t\tcrc = (crc << 2) ^ tab[0][crc >> 30];\n\t}\n# elif CRC_BE_BITS == 4\n\twhile (len--) {\n\t\tcrc ^= *p++ << 24;\n\t\tcrc = (crc << 4) ^ tab[0][crc >> 28];\n\t\tcrc = (crc << 4) ^ tab[0][crc >> 28];\n\t}\n# elif CRC_BE_BITS == 8\n\twhile (len--) {\n\t\tcrc ^= *p++ << 24;\n\t\tcrc = (crc << 8) ^ tab[0][crc >> 24];\n\t}\n# else\n\tcrc = __cpu_to_be32(crc);\n\tcrc = crc32_body(crc, p, len, tab);\n\tcrc = __be32_to_cpu(crc);\n# endif\n\treturn crc;\n}\n\nuint32_t ext2fs_crc32_be(uint32_t crc, unsigned char const *p, size_t len)\n{\n\treturn crc32_be_generic(crc, p, len, crc32table_be, CRCPOLY_BE);\n}\n\n#ifdef UNITTEST\nstatic uint8_t test_buf[] = {\n\t0xd9, 0xd7, 0x6a, 0x13, 0x3a, 0xb1, 0x05, 0x48,\n\t0xda, 0xad, 0x14, 0xbd, 0x03, 0x3a, 0x58, 0x5e,\n\t0x6e, 0xd1, 0x56, 0xc9, 0x2e, 0xc4, 0xcb, 0x6b,\n\t0xe8, 0x77, 0x52, 0x37, 0x4e, 0x0f, 0x55, 0xd2,\n\t0x12, 0x65, 0x90, 0xc2, 0x41, 0x49, 0x81, 0x01,\n\t0xf5, 0x01, 0xeb, 0x2d, 0x78, 0x74, 0x23, 0x5d,\n\t0x84, 0x5c, 0x81, 0x92, 0x21, 0xe9, 0x8d, 0x1d,\n\t0x89, 0xf2, 0x4a, 0xac, 0xdd, 0xf9, 0xaf, 0xee,\n\t0x44, 0xe7, 0x6e, 0xed, 0xfb, 0xd8, 0x89, 0x0e,\n\t0x96, 0x62, 0xcd, 0xa4, 0x4b, 0xa9, 0xe5, 0x45,\n\t0xb1, 0x29, 0x9b, 0x0f, 0xfc, 0xbd, 0x83, 0xab,\n\t0xa8, 0x54, 0x96, 0x44, 0x2c, 0x7f, 0xbb, 0xe7,\n\t0x52, 0x29, 0x08, 0xee, 0x14, 0xc5, 0xc2, 0xec,\n\t0x5a, 0xeb, 0x40, 0x40, 0xea, 0xd1, 0x3d, 0x15,\n\t0x73, 0xaa, 0x8c, 0x73, 0xfc, 0xf2, 0x2b, 0x49,\n\t0x0b, 0x13, 0x96, 0xd9, 0x8e, 0x4b, 0xbc, 0xe0,\n\t0xf4, 0xd2, 0xe0, 0x2e, 0x7a, 0xf0, 0x5d, 0x1f,\n\t0xd2, 0x92, 0x97, 0xe0, 0xaa, 0x59, 0xab, 0xc9,\n\t0x5c, 0xa6, 0x51, 0x1a, 0xe3, 0xd6, 0x06, 0xb9,\n\t0xae, 0xb8, 0x76, 0x36, 0x79, 0x37, 0x52, 0xf6,\n\t0x34, 0xaf, 0x27, 0x19, 0xe1, 0xc0, 0x2b, 0xdd,\n\t0x01, 0x15, 0xcd, 0xce, 0x44, 0xf6, 0x4c, 0x18,\n\t0x92, 0x69, 0xbe, 0x8a, 0x76, 0x23, 0x52, 0x13,\n\t0x3f, 0xf9, 0xe0, 0xf5, 0x06, 0x28, 0x7c, 0xc7,\n\t0xf3, 0x42, 0x0f, 0xdd, 0x40, 0x33, 0xf7, 0x99,\n\t0xe2, 0xad, 0x26, 0xd9, 0x53, 0x10, 0x72, 0x0c,\n\t0x4e, 0x43, 0x4c, 0x61, 0xfe, 0xd9, 0xc1, 0x16,\n\t0xa1, 0x93, 0xca, 0x3c, 0x75, 0x7f, 0x07, 0x7a,\n\t0x65, 0xb3, 0x53, 0x2a, 0x52, 0x00, 0xa0, 0x62,\n\t0xe0, 0xa3, 0x1f, 0xad, 0xd7, 0xbb, 0xc0, 0x83,\n\t0x5d, 0x54, 0x87, 0x5f, 0xc8, 0x2f, 0xc8, 0xbf,\n\t0x69, 0x04, 0x91, 0xc8, 0xa6, 0x1d, 0x4d, 0x46,\n\t0x91, 0xfc, 0x26, 0xf4, 0x16, 0xd1, 0xa4, 0xbf,\n\t0x5c, 0xa2, 0x6c, 0xdd, 0xb4, 0x40, 0xf2, 0x2e,\n\t0xa2, 0xad, 0xf7, 0xf4, 0xa5, 0x8a, 0x3e, 0x23,\n\t0x64, 0x08, 0xc8, 0xa1, 0xa0, 0xf0, 0x5d, 0x70,\n\t0xd2, 0x77, 0xfd, 0xc8, 0x50, 0x83, 0x0f, 0xd6,\n\t0x2b, 0xe4, 0x1f, 0x52, 0x34, 0x33, 0x68, 0xfd,\n\t0x92, 0xbe, 0x9f, 0x97, 0x6b, 0x8d, 0x81, 0x91,\n\t0x0f, 0xef, 0x65, 0xc8, 0x0d, 0x15, 0x01, 0x77,\n\t0x58, 0xb2, 0xf4, 0x1b, 0x06, 0x7e, 0xf5, 0xca,\n\t0x15, 0x2e, 0x38, 0xd8, 0x81, 0x1c, 0x1c, 0xa0,\n\t0xb6, 0x13, 0x6a, 0x2b, 0x71, 0x34, 0x52, 0xd7,\n\t0x1d, 0xbd, 0x37, 0x59, 0xbc, 0x86, 0x25, 0x2b,\n\t0xa8, 0x93, 0xce, 0x1a, 0x03, 0x16, 0xfe, 0x01,\n\t0x57, 0x99, 0x24, 0x25, 0x2c, 0xb3, 0xab, 0x1e,\n\t0x2d, 0x65, 0x20, 0x89, 0x17, 0x02, 0x0e, 0x0a,\n\t0xf5, 0x1e, 0xc7, 0xff, 0x1f, 0x61, 0xa9, 0x54,\n\t0x18, 0xd4, 0xba, 0x50, 0x57, 0x02, 0xa1, 0xab,\n\t0x22, 0x2e, 0x07, 0xea, 0xa9, 0xa3, 0x83, 0x4f,\n\t0x27, 0xf5, 0xc5, 0xee, 0x3c, 0x3b, 0x10, 0xad,\n\t0x32, 0x2b, 0x1c, 0x03, 0xcb, 0xaf, 0x98, 0x83,\n\t0x54, 0xc3, 0x68, 0x63, 0xd4, 0xe0, 0x0e, 0x3c,\n\t0x1a, 0x4e, 0xc0, 0x81, 0xd0, 0xe8, 0x6a, 0x62,\n\t0x6b, 0x3e, 0x6f, 0xc4, 0xc6, 0x33, 0x4e, 0x26,\n\t0x21, 0xf5, 0x04, 0xdf, 0xfa, 0xce, 0x45, 0xaf,\n\t0xdc, 0x5e, 0x1b, 0xad, 0x93, 0xca, 0xf5, 0xcf,\n\t0xd7, 0xee, 0x0c, 0x5c, 0x5e, 0xb4, 0xf0, 0x92,\n\t0xd2, 0xf2, 0xf0, 0xa9, 0x1e, 0xab, 0x80, 0x68,\n\t0x46, 0xef, 0xcc, 0x26, 0x0c, 0x5c, 0xdd, 0x4e,\n\t0x83, 0xb8, 0xb9, 0x53, 0x6e, 0xf8, 0x93, 0x38,\n\t0x67, 0xa4, 0x41, 0x87, 0x72, 0xe7, 0x7e, 0x86,\n\t0xc9, 0x49, 0x00, 0x33, 0xb1, 0x38, 0x6c, 0x71,\n\t0xd7, 0x1d, 0x8e, 0x61, 0x01, 0xb6, 0x57, 0xa9,\n\t0xf1, 0xac, 0x15, 0xc2, 0x83, 0x77, 0xca, 0x64,\n\t0xca, 0x7b, 0x6c, 0xa1, 0x10, 0x1b, 0x13, 0xd0,\n\t0xd3, 0x9e, 0x9e, 0x10, 0x70, 0xc8, 0x1a, 0xbb,\n\t0x3f, 0x19, 0x86, 0xab, 0x01, 0x0e, 0xea, 0x34,\n\t0x22, 0xea, 0xe2, 0x15, 0xb7, 0xed, 0x21, 0x21,\n\t0x75, 0xa5, 0xe7, 0x08, 0xa1, 0x38, 0xe0, 0x91,\n\t0x05, 0x60, 0xea, 0xa7, 0x50, 0x27, 0x18, 0x07,\n\t0x9d, 0xe0, 0x18, 0x2b, 0xd4, 0x07, 0x59, 0x00,\n\t0xe6, 0x45, 0x18, 0x2a, 0x30, 0x6e, 0xf3, 0xb4,\n\t0xd0, 0xef, 0xa6, 0x5b, 0x71, 0xa2, 0x5a, 0x3b,\n\t0x89, 0x4c, 0xaf, 0x3f, 0xcb, 0x9f, 0x03, 0xfb,\n\t0x43, 0x7c, 0x6b, 0xd3, 0x6a, 0xea, 0xce, 0x4a,\n\t0x5f, 0x64, 0xb5, 0x62, 0xda, 0x5d, 0x27, 0xb7,\n\t0xb8, 0x11, 0xca, 0x33, 0x30, 0xec, 0x70, 0xf0,\n\t0x1b, 0x03, 0x50, 0xff, 0x5e, 0xa6, 0x08, 0xde,\n\t0x37, 0x70, 0xc0, 0x81, 0x55, 0x60, 0x17, 0xa1,\n\t0x85, 0xae, 0x26, 0x44, 0xe4, 0x67, 0x3c, 0x91,\n\t0xfd, 0xc4, 0x3d, 0x97, 0x72, 0x23, 0xf3, 0x3c,\n\t0x8f, 0xe0, 0xe2, 0xf2, 0x09, 0x96, 0x10, 0x67,\n\t0xb5, 0xfe, 0xff, 0x3d, 0x4a, 0xc8, 0x62, 0x11,\n\t0xa5, 0x98, 0xc1, 0x2d, 0x40, 0x82, 0x88, 0x8b,\n\t0xe5, 0xb0, 0x75, 0xbf, 0x2f, 0xa8, 0x6a, 0x55,\n\t0x49, 0x2e, 0x9c, 0x29, 0xd2, 0x7c, 0xbf, 0xf3,\n\t0xaa, 0x3a, 0x16, 0x4a, 0xa4, 0x15, 0xf3, 0x48,\n\t0xde, 0x38, 0x13, 0x44, 0x26, 0x02, 0xe6, 0xe9,\n\t0xa8, 0x24, 0x89, 0xb5, 0x43, 0x95, 0xe4, 0x4c,\n\t0xc3, 0xa0, 0xdf, 0xcc, 0x42, 0xf8, 0x8d, 0xb0,\n\t0x3b, 0xea, 0x10, 0xb7, 0xe1, 0x40, 0x54, 0xb9,\n\t0xa3, 0x2d, 0xfb, 0xb4, 0x91, 0xc0, 0x3e, 0x94,\n\t0xf1, 0xa1, 0x3c, 0xbe, 0xef, 0xb8, 0x70, 0x55,\n\t0x0a, 0x26, 0x93, 0xbf, 0xe6, 0x21, 0x92, 0x32,\n\t0x3c, 0x39, 0x27, 0x6a, 0x23, 0x48, 0x02, 0x35,\n\t0x3c, 0xd4, 0xcc, 0x04, 0xc0, 0x4e, 0xa7, 0x02,\n\t0x63, 0x37, 0xc2, 0xb8, 0x56, 0x1d, 0x57, 0x57,\n\t0x42, 0x04, 0x8d, 0xee, 0xcf, 0x8b, 0xc9, 0xc3,\n\t0xba, 0x3b, 0x15, 0xd7, 0xaf, 0xbf, 0x9e, 0xcd,\n\t0x44, 0xcf, 0xf0, 0x00, 0xb7, 0x3a, 0xfc, 0xa8,\n\t0x12, 0xab, 0x3a, 0x62, 0x01, 0x21, 0x46, 0xe9,\n\t0x1e, 0x48, 0x37, 0xfc, 0x13, 0x4d, 0xf6, 0x2a,\n\t0x72, 0x40, 0x75, 0x38, 0x71, 0xf2, 0x17, 0x20,\n\t0x2c, 0xdd, 0xc0, 0x49, 0xbc, 0x63, 0x33, 0xea,\n\t0x06, 0x75, 0x41, 0xe7, 0x5c, 0x1f, 0xfb, 0xf9,\n\t0x68, 0x83, 0xc2, 0x5a, 0x4a, 0x1e, 0x61, 0x08,\n\t0x57, 0xf3, 0x00, 0xba, 0x77, 0x92, 0x63, 0xa5,\n\t0xb7, 0xfe, 0x97, 0x22, 0xda, 0x5e, 0xd3, 0xaf,\n\t0xbc, 0x89, 0x0d, 0x4c, 0x37, 0xa9, 0x27, 0x4a,\n\t0x7f, 0xdb, 0x81, 0x39, 0x11, 0x86, 0x12, 0xf9,\n\t0x10, 0x50, 0xe4, 0xdb, 0x72, 0xf9, 0xae, 0x10,\n\t0x7c, 0xed, 0x50, 0x5c, 0x61, 0xeb, 0x42, 0x1e,\n\t0xa4, 0xf4, 0xf0, 0xfa, 0x45, 0x4d, 0x95, 0x2b,\n\t0xd4, 0x67, 0x4a, 0xe3, 0x8a, 0x15, 0x55, 0x92,\n\t0x77, 0x64, 0x8c, 0x51, 0x38, 0xf9, 0x26, 0x3e,\n\t0x68, 0xe2, 0xac, 0xbb, 0x64, 0x77, 0xe2, 0x82,\n\t0xa4, 0x42, 0x41, 0x38, 0xa0, 0xf0, 0xc9, 0xd8,\n\t0x6c, 0xe0, 0xef, 0x4c, 0xda, 0xb4, 0x92, 0xef,\n\t0x1b, 0xe3, 0x9b, 0xc1, 0x44, 0x3c, 0xb9, 0xb7,\n\t0x39, 0xac, 0x5c, 0x32, 0x39, 0xb4, 0x21, 0x85,\n\t0x93, 0xbc, 0xf2, 0x51, 0x43, 0xb7, 0xae, 0x1e,\n\t0x61, 0x9c, 0x38, 0x9c, 0xaa, 0xff, 0xde, 0xfc,\n\t0xbf, 0x85, 0xef, 0x17, 0x34, 0x36, 0x71, 0x5f,\n\t0x04, 0x16, 0xa6, 0x9e, 0xfd, 0x3a, 0x03, 0xd8,\n\t0xbf, 0x71, 0x70, 0x20, 0x8f, 0x7c, 0xfb, 0xff,\n\t0x61, 0xe0, 0xe2, 0x60, 0xa7, 0xb1, 0xc0, 0xe0,\n\t0xd9, 0x3f, 0xdc, 0x8d, 0x4a, 0xa4, 0x52, 0x61,\n\t0xaf, 0x9d, 0xdf, 0x8a, 0x0d, 0x41, 0xc0, 0x25,\n\t0x68, 0x12, 0x7b, 0xd5, 0xc7, 0xdb, 0x68, 0x70,\n\t0x2d, 0x7d, 0x95, 0x12, 0x03, 0x23, 0x0c, 0xe8,\n\t0x14, 0x41, 0x11, 0x28, 0xec, 0x9d, 0xd3, 0x28,\n\t0x77, 0x7a, 0x3c, 0x93, 0x8e, 0x5c, 0x7e, 0xb3,\n\t0x42, 0x9a, 0x18, 0x25, 0x93, 0xc8, 0xea, 0x43,\n\t0x1b, 0xbe, 0xd5, 0x27, 0xf1, 0xd4, 0xe0, 0x1e,\n\t0xce, 0xc7, 0xc7, 0x2c, 0x25, 0x35, 0x58, 0xb8,\n\t0x6c, 0xf3, 0xa2, 0xad, 0xe7, 0x58, 0x49, 0x47,\n\t0xf7, 0xca, 0xde, 0x8b, 0x81, 0xb7, 0x75, 0xf4,\n\t0x95, 0xa7, 0x5c, 0xc3, 0x2c, 0x0e, 0x1c, 0x52,\n\t0x9a, 0xc3, 0x2a, 0x00, 0x21, 0xa7, 0x51, 0x6b,\n\t0xf0, 0x05, 0x87, 0x8c, 0x42, 0x1b, 0xc3, 0x2e,\n\t0xa3, 0x76, 0x22, 0xd5, 0x7f, 0x56, 0x10, 0xef,\n\t0x98, 0x85, 0x65, 0x86, 0x71, 0x87, 0xd2, 0x8c,\n\t0xc0, 0x47, 0x20, 0xe8, 0xb5, 0x1c, 0xe3, 0xdd,\n\t0x3c, 0x5c, 0x03, 0xbb, 0x0e, 0x97, 0x3b, 0xe1,\n\t0x56, 0x9a, 0xd5, 0x0a, 0x63, 0xd5, 0x33, 0xaf,\n\t0x36, 0xca, 0xcf, 0x8f, 0x00, 0x28, 0xa3, 0x45,\n\t0xb8, 0xcd, 0xde, 0x73, 0xd4, 0xfa, 0x2d, 0x6f,\n\t0xdb, 0x93, 0xaa, 0xdd, 0x7f, 0xd2, 0x22, 0x9c,\n\t0x96, 0x48, 0x1e, 0xa8, 0x63, 0xbe, 0xbc, 0x0d,\n\t0x14, 0x3c, 0x2e, 0x11, 0x1f, 0xd2, 0xf4, 0x57,\n\t0xb3, 0x47, 0xf8, 0xa6, 0x1b, 0xc3, 0xa7, 0x95,\n\t0x2d, 0xd4, 0xca, 0xb8, 0x0d, 0xfb, 0x06, 0x85,\n\t0xda, 0x63, 0xf0, 0x3e, 0x9d, 0x5e, 0xee, 0xce,\n\t0xed, 0x74, 0x1d, 0x2c, 0x97, 0x3f, 0x71, 0x95,\n\t0x12, 0x03, 0xc5, 0x92, 0x46, 0x84, 0x1b, 0x07,\n\t0xe6, 0xb4, 0x1d, 0x3a, 0xf1, 0x89, 0x90, 0x50,\n\t0x10, 0x29, 0x34, 0xc0, 0x90, 0xbe, 0x4a, 0xa9,\n\t0x0d, 0xb0, 0x7b, 0xfb, 0x35, 0xee, 0x4e, 0x34,\n\t0xec, 0x5a, 0x58, 0xbc, 0xb8, 0xda, 0x38, 0x88,\n\t0x8c, 0x74, 0x1e, 0xc9, 0xab, 0x78, 0x2e, 0x2a,\n\t0x17, 0x8a, 0x43, 0x3d, 0xa1, 0x2a, 0x41, 0xb5,\n\t0xd6, 0xe8, 0x5b, 0xc5, 0x4a, 0x1c, 0x3c, 0x9f,\n\t0x8d, 0x3a, 0x69, 0x88, 0xf8, 0x80, 0xd2, 0x11,\n\t0xfc, 0x7e, 0x80, 0x8e, 0x7f, 0x85, 0x64, 0x9c,\n\t0x46, 0x58, 0xc8, 0x48, 0x98, 0x4b, 0xf5, 0x73,\n\t0x3f, 0x49, 0xce, 0x53, 0x2c, 0xd5, 0xfc, 0x33,\n\t0xf1, 0x6f, 0xd8, 0xe9, 0x2e, 0x70, 0x2e, 0xdc,\n\t0xe5, 0x43, 0x80, 0x38, 0xf2, 0x87, 0xed, 0x85,\n\t0xe4, 0x3e, 0x45, 0x14, 0x20, 0xcf, 0xa0, 0x61,\n\t0x4f, 0xe8, 0xd7, 0x5b, 0xb3, 0x0d, 0x0e, 0x4e,\n\t0x4d, 0xce, 0xbe, 0xba, 0xaa, 0x90, 0x09, 0xcb,\n\t0x4b, 0x5d, 0x08, 0xff, 0x52, 0xd5, 0x23, 0xbc,\n\t0xad, 0x8d, 0xd3, 0x06, 0x4a, 0xa0, 0x51, 0x56,\n\t0xa7, 0xd8, 0x33, 0xab, 0xbc, 0xd0, 0xdf, 0x92,\n\t0x87, 0x20, 0x2d, 0x7b, 0x5e, 0xfa, 0x30, 0xa7,\n\t0x06, 0x06, 0xe5, 0x4f, 0x2c, 0xb5, 0x61, 0xd7,\n\t0x54, 0xd3, 0xdf, 0xd0, 0x0a, 0xb0, 0x06, 0xce,\n\t0xf6, 0x86, 0xb7, 0x8e, 0xaa, 0x7b, 0x78, 0xd5,\n\t0xb9, 0xeb, 0x07, 0xac, 0x5f, 0xc5, 0xd2, 0x8c,\n\t0x40, 0xe0, 0x7f, 0x98, 0xd4, 0xe5, 0x4b, 0xca,\n\t0xfb, 0x47, 0xef, 0xef, 0xb9, 0x4d, 0x6d, 0x8f,\n\t0x82, 0x68, 0x74, 0x84, 0xe0, 0x0a, 0x93, 0x0f,\n\t0xb2, 0x01, 0xa9, 0x9f, 0x68, 0x6a, 0xe8, 0xf7,\n\t0xfb, 0x0b, 0xde, 0x17, 0xe0, 0x30, 0x38, 0x51,\n\t0xbc, 0x07, 0xb8, 0x2c, 0x91, 0x0f, 0xc1, 0x0e,\n\t0xa6, 0xf9, 0xf0, 0xd5, 0x48, 0x76, 0x8a, 0xde,\n\t0x74, 0xe3, 0x30, 0x65, 0x56, 0xb3, 0x5c, 0xe2,\n\t0x89, 0x8d, 0xda, 0x80, 0xad, 0x0f, 0x22, 0xfb,\n\t0x24, 0x1d, 0x16, 0xdd, 0x34, 0x4b, 0x90, 0x58,\n\t0x4e, 0x0c, 0x13, 0x28, 0xcf, 0x1d, 0xa4, 0xaa,\n\t0xb7, 0xf3, 0xb1, 0x66, 0xad, 0x3b, 0xcf, 0x79,\n\t0x12, 0x04, 0xd7, 0x79, 0xd9, 0x5f, 0xdf, 0x89,\n\t0xb2, 0x5b, 0xa7, 0x9a, 0x26, 0x1e, 0x67, 0x46,\n\t0x7c, 0x66, 0x95, 0x67, 0xe6, 0x45, 0x8b, 0x1f,\n\t0x65, 0x79, 0x9f, 0x6d, 0x11, 0x81, 0x17, 0x0d,\n\t0x11, 0xb0, 0x5c, 0xb4, 0xc7, 0x27, 0x87, 0xab,\n\t0x5d, 0x0a, 0x18, 0xae, 0x4e, 0x06, 0xa3, 0x3d,\n\t0xc7, 0xb0, 0x22, 0xba, 0x03, 0xa4, 0x0f, 0xe5,\n\t0x1c, 0x72, 0x2a, 0x04, 0xce, 0x83, 0xe9, 0xf3,\n\t0xd7, 0xc9, 0x67, 0x6c, 0x1e, 0x6b, 0x3c, 0x9b,\n\t0x0b, 0x5e, 0x6a, 0xa6, 0x79, 0x0a, 0xf1, 0xbe,\n\t0xd7, 0xb4, 0x6f, 0x45, 0x1e, 0xfb, 0x78, 0x97,\n\t0xaf, 0x34, 0x76, 0x95, 0x52, 0xf7, 0x3d, 0x5d,\n\t0x07, 0x28, 0x57, 0x9c, 0x4a, 0x0f, 0xcf, 0x0b,\n\t0x1b, 0xc4, 0xc2, 0x72, 0xd7, 0x72, 0x38, 0x9b,\n\t0xea, 0xeb, 0xee, 0xae, 0x34, 0xc8, 0x01, 0xd7,\n\t0xa5, 0xe3, 0xce, 0x41, 0xad, 0x02, 0x60, 0x23,\n\t0x18, 0x36, 0xba, 0x17, 0xfa, 0xcf, 0xe4, 0xda,\n\t0xdc, 0xfc, 0x82, 0xdc, 0x7c, 0x11, 0xf4, 0xb8,\n\t0x52, 0x5d, 0xf7, 0x2f, 0xc8, 0xfe, 0x4a, 0xe6,\n\t0xb9, 0xaf, 0x4b, 0x17, 0x18, 0x91, 0xc2, 0xfe,\n\t0xd7, 0x3a, 0x77, 0x0c, 0xa0, 0x43, 0x9c, 0x6f,\n\t0x13, 0x06, 0xbe, 0x6e, 0xe0, 0x1a, 0x3c, 0xf3,\n\t0xf5, 0xcc, 0x78, 0xfb, 0x5d, 0xd5, 0xda, 0xb7,\n\t0x58, 0xea, 0x86, 0x42, 0x6b, 0x32, 0xff, 0xb2,\n\t0xe2, 0xee, 0x03, 0x1f, 0xf4, 0xef, 0xdb, 0x53,\n\t0x79, 0xd5, 0x4e, 0xaf, 0x60, 0x8e, 0x02, 0xc2,\n\t0xcc, 0x39, 0x97, 0x7b, 0xfd, 0xa1, 0xf8, 0x7a,\n\t0x26, 0xe8, 0x55, 0xd6, 0xa4, 0x8b, 0xa0, 0x1b,\n\t0x2d, 0x63, 0xaa, 0x73, 0x71, 0x6e, 0xbf, 0x8b,\n\t0x3b, 0xe3, 0x1b, 0x0d, 0xbb, 0x2e, 0x44, 0x09,\n\t0x64, 0xac, 0xc7, 0x9e, 0xb5, 0xc6, 0x77, 0xb0,\n\t0x79, 0xb3, 0xaa, 0xfc, 0x67, 0x57, 0x9a, 0x50,\n\t0x81, 0x37, 0x14, 0x7c, 0xd7, 0xa0, 0xd4, 0x6a,\n\t0x79, 0x84, 0x51, 0x0e, 0x95, 0x0a, 0x30, 0xa3,\n\t0x60, 0x55, 0x48, 0x05, 0x16, 0xae, 0x43, 0x90,\n\t0xdc, 0x8e, 0x09, 0xbe, 0x79, 0xf6, 0x90, 0x74,\n\t0xf8, 0x20, 0x96, 0x4d, 0xa7, 0xf5, 0x1a, 0x2b,\n\t0xc7, 0x15, 0x9d, 0x18, 0xf7, 0x94, 0x87, 0xf7,\n\t0xf4, 0xfb, 0x0d, 0x61, 0xb6, 0xd7, 0xbe, 0x10,\n\t0x8e, 0x47, 0x3c, 0x10, 0x44, 0x90, 0x52, 0x21,\n\t0x83, 0xc0, 0xf5, 0x99, 0xaa, 0xbc, 0xf6, 0x55,\n\t0xae, 0xf5, 0xb2, 0xa4, 0xcd, 0x4d, 0xb9, 0x38,\n\t0x6c, 0xbc, 0x80, 0xc3, 0xad, 0xf4, 0x46, 0x31,\n\t0x01, 0x58, 0x2d, 0x88, 0x57, 0xc3, 0x23, 0xd1,\n\t0x64, 0xc9, 0xa3, 0x21, 0x6b, 0x8b, 0x8a, 0x23,\n\t0x2c, 0x4f, 0xa9, 0xcd, 0x67, 0xfa, 0x77, 0xad,\n\t0xa3, 0x16, 0xa2, 0xe5, 0x19, 0x14, 0x70, 0x41,\n\t0x5b, 0xda, 0x14, 0xde, 0xe3, 0xe5, 0xc1, 0x15,\n\t0xb4, 0x77, 0xa4, 0x9b, 0xb8, 0xb1, 0x28, 0x51,\n\t0x30, 0xb4, 0xf1, 0xf3, 0xf8, 0x6d, 0xd0, 0xc3,\n\t0x8c, 0x4c, 0x76, 0xb0, 0x9a, 0xdf, 0xc8, 0xbe,\n\t0xf8, 0x4a, 0x61, 0x6e, 0x3e, 0xd6, 0x3c, 0xe8,\n\t0xde, 0x56, 0xa0, 0x9c, 0x25, 0xbe, 0xce, 0x93,\n\t0x1f, 0x88, 0xfb, 0x9a, 0x1a, 0xe2, 0xff, 0x88,\n\t0xad, 0x10, 0xcb, 0x6c, 0xd6, 0xe7, 0x39, 0x0b,\n\t0xe5, 0x1a, 0x06, 0x05, 0x64, 0x5b, 0x0a, 0xdf,\n\t0x22, 0x58, 0xd7, 0xfb, 0x88, 0x12, 0xdd, 0xb7,\n\t0x52, 0x3a, 0xc9, 0xbf, 0x49, 0xdf, 0x8c, 0x87,\n\t0x9f, 0x84, 0xb5, 0x0a, 0xf6, 0x00, 0x52, 0xae,\n\t0x67, 0x12, 0x1a, 0x8c, 0x71, 0x15, 0xf5, 0xa1,\n\t0x13, 0x39, 0xf0, 0x91, 0x7e, 0x88, 0x7c, 0xb3,\n\t0x95, 0x50, 0x02, 0xa6, 0x63, 0xb5, 0x64, 0xfb,\n\t0x90, 0x87, 0x61, 0xe2, 0x27, 0xaf, 0x11, 0x0c,\n\t0x73, 0x83, 0xef, 0xa9, 0x28, 0xfe, 0xc8, 0x85,\n\t0x1a, 0x3a, 0xde, 0xf2, 0xe5, 0x25, 0x64, 0x6d,\n\t0xaa, 0x41, 0x4c, 0x80, 0x2e, 0x84, 0xff, 0xc1,\n\t0xc0, 0x54, 0x0c, 0x29, 0x1b, 0xa3, 0x07, 0x7c,\n\t0x33, 0x4c, 0x10, 0xf6, 0x6f, 0x79, 0xdf, 0xd3,\n\t0xf0, 0x24, 0x57, 0xf1, 0x60, 0xe1, 0xf0, 0xbd,\n\t0xc4, 0x1f, 0xf4, 0x67, 0xd2, 0xd3, 0xcc, 0x6a,\n\t0x07, 0x72, 0x44, 0x16, 0x85, 0x46, 0xd0, 0x73,\n\t0x87, 0xa9, 0xc7, 0x2f, 0xd1, 0xf5, 0xec, 0xe3,\n\t0x28, 0xa3, 0x93, 0x4f, 0xd7, 0x76, 0xc1, 0x3c,\n\t0x0d, 0x13, 0x33, 0xcf, 0x5b, 0xbd, 0x6a, 0x52,\n\t0x4e, 0xee, 0xc8, 0x5e, 0xa1, 0x58, 0x4a, 0x08,\n\t0x81, 0xd9, 0x23, 0xcc, 0xfb, 0x1c, 0xb2, 0xd8,\n\t0xa3, 0xe4, 0x53, 0xfe, 0xf4, 0x4b, 0x48, 0xc1,\n\t0x20, 0xa4, 0x97, 0xf8, 0x38, 0xa3, 0x69, 0xc1,\n\t0x11, 0xf0, 0xa1, 0x3b, 0xa9, 0x9a, 0x12, 0x61,\n\t0xe8, 0x8d, 0x99, 0x44, 0x3f, 0x94, 0x72, 0x82,\n\t0x19, 0x96, 0x62, 0xb0, 0xa6, 0x64, 0x05, 0x19,\n\t0x8f, 0xd6, 0x5d, 0x05, 0xbf, 0x79, 0x9e, 0x9d,\n\t0xe4, 0x93, 0x4c, 0xad, 0x61, 0x8c, 0x18, 0xda,\n\t0xb6, 0x2e, 0xb3, 0xca, 0x14, 0x4d, 0x53, 0xa4,\n\t0x97, 0x27, 0x10, 0x56, 0xa2, 0x67, 0x5a, 0x5a,\n\t0x5e, 0x13, 0xc0, 0xdb, 0xa7, 0x9f, 0x45, 0x5b,\n\t0xeb, 0x1a, 0x14, 0x0c, 0x8c, 0x38, 0x5e, 0x77,\n\t0x9a, 0xec, 0x75, 0x68, 0x93, 0x65, 0x02, 0x9c,\n\t0xfb, 0x62, 0x60, 0x49, 0xdd, 0xb2, 0x2a, 0x67,\n\t0x86, 0xe3, 0x8a, 0x7d, 0x8c, 0x46, 0x78, 0x81,\n\t0x60, 0x69, 0xf2, 0x3f, 0x74, 0x11, 0x35, 0xff,\n\t0x77, 0xa3, 0x66, 0x20, 0xfc, 0x98, 0x4a, 0x35,\n\t0x7a, 0x52, 0xe4, 0x90, 0x13, 0x80, 0xb9, 0xa6,\n\t0x73, 0x7a, 0x7d, 0x66, 0x6e, 0x6b, 0xb6, 0x43,\n\t0x10, 0xd5, 0x91, 0x2b, 0x66, 0xdd, 0x89, 0x87,\n\t0xe3, 0x8c, 0x58, 0x53, 0x2f, 0x40, 0x74, 0x45,\n\t0x1b, 0x77, 0x7a, 0xa4, 0x44, 0x19, 0x78, 0xba,\n\t0x87, 0x10, 0x41, 0x31, 0x32, 0x5f, 0x87, 0x68,\n\t0xde, 0x43, 0x4a, 0xef, 0x33, 0xb3, 0x11, 0x83,\n\t0xa9, 0xc2, 0x6f, 0x8d, 0x34, 0xe2, 0x95, 0x84,\n\t0x3a, 0x4f, 0x6f, 0x8c, 0x31, 0x1d, 0xb6, 0xf5,\n\t0x95, 0x0d, 0x01, 0x11, 0x20, 0xdf, 0x72, 0xf3,\n\t0x3f, 0x9a, 0x33, 0xaa, 0xb1, 0x06, 0x6a, 0x63,\n\t0x47, 0x91, 0x01, 0xdf, 0xb3, 0x54, 0x36, 0xfd,\n\t0x06, 0x2d, 0xb8, 0x08, 0xe3, 0xd3, 0x65, 0xac,\n\t0x66, 0x03, 0xee, 0xa4, 0x63, 0xbd, 0xd4, 0xce,\n\t0xbd, 0x79, 0xa7, 0x48, 0x38, 0xc5, 0x7d, 0xb5,\n\t0x71, 0x9a, 0x3c, 0x11, 0x7c, 0x6c, 0xe2, 0x54,\n\t0x02, 0x5d, 0x42, 0xab, 0x25, 0x93, 0x66, 0x01,\n\t0x37, 0x78, 0x35, 0x4a, 0x8c, 0x19, 0x4d, 0x00,\n\t0x75, 0x4f, 0xcc, 0xc0, 0x26, 0x82, 0xc1, 0x35,\n\t0x8c, 0xc7, 0xc2, 0x59, 0x01, 0x3e, 0x98, 0x22,\n\t0x88, 0x9c, 0x90, 0x75, 0x05, 0x33, 0x07, 0xb9,\n\t0x39, 0x81, 0x38, 0x58, 0x10, 0x29, 0xcf, 0xc8,\n\t0x98, 0xb2, 0x03, 0xd7, 0x5b, 0xb3, 0x18, 0xba,\n\t0x34, 0x0c, 0x9f, 0xab, 0xd7, 0xed, 0x29, 0x82,\n\t0x41, 0xe0, 0x20, 0x97, 0x57, 0x92, 0xb2, 0xb8,\n\t0x10, 0x2d, 0x0b, 0xa2, 0xc5, 0x8f, 0x90, 0x6f,\n\t0xed, 0x12, 0x56, 0x25, 0xbe, 0xfd, 0x75, 0xf7,\n\t0xb6, 0xf8, 0x40, 0x67, 0x39, 0x11, 0xfa, 0x15,\n\t0xae, 0x6a, 0x54, 0x5f, 0x32, 0x2b, 0xf8, 0x48,\n\t0x55, 0xbe, 0x86, 0x2f, 0x69, 0x48, 0x5b, 0x5d,\n\t0x4d, 0xb7, 0x35, 0xaa, 0xb6, 0x91, 0x88, 0x19,\n\t0x96, 0x1c, 0x68, 0xf6, 0x85, 0x9e, 0xb3, 0xb2,\n\t0xa3, 0x32, 0xd4, 0x52, 0x70, 0xb7, 0x62, 0xe3,\n\t0x14, 0xb6, 0x78, 0x5f, 0x1b, 0x1d, 0x04, 0x9c,\n\t0x26, 0x0c, 0x33, 0x94, 0xb1, 0x97, 0x08, 0xdb,\n\t0x0b, 0x39, 0x29, 0xd4, 0xbc, 0x6d, 0xdf, 0x02,\n\t0xc6, 0x99, 0xab, 0x99, 0x32, 0xe5, 0xce, 0x51,\n\t0x4f, 0xae, 0xb8, 0x8b, 0xe0, 0xaf, 0x07, 0xc4,\n\t0xf9, 0x41, 0x7c, 0x59, 0xa0, 0xac, 0x74, 0x4d,\n\t0x7e, 0x43, 0x77, 0x9c, 0x06, 0x49, 0x79, 0x8a,\n\t0x14, 0x73, 0x93, 0xa8, 0x5b, 0x1b, 0x34, 0x29,\n\t0x78, 0x04, 0x2f, 0xd7, 0x1f, 0x13, 0x90, 0xe0,\n\t0xdd, 0x3b, 0x42, 0x6b, 0x79, 0x6e, 0x52, 0xc7,\n\t0x0f, 0x38, 0xda, 0x01, 0x2c, 0x8d, 0xe6, 0x94,\n\t0x5d, 0x59, 0x27, 0x1d, 0x10, 0x4e, 0x11, 0x36,\n\t0xfb, 0x53, 0x16, 0x05, 0x25, 0xf2, 0x64, 0xd8,\n\t0xf9, 0xcd, 0x5c, 0xfe, 0xb4, 0x18, 0x44, 0x80,\n\t0x10, 0xbc, 0x3d, 0xf3, 0x1d, 0x5a, 0xf0, 0xc1,\n\t0xc3, 0x55, 0xff, 0x41, 0x3e, 0xe3, 0xef, 0x44,\n\t0xb2, 0xc0, 0x01, 0x18, 0xa2, 0x49, 0x88, 0x78,\n\t0x0d, 0x4c, 0xc8, 0x73, 0xcf, 0x30, 0x85, 0x3a,\n\t0x88, 0x90, 0x01, 0xcf, 0x69, 0x53, 0xa3, 0x18,\n\t0x3f, 0xd6, 0xe7, 0x94, 0x14, 0xa7, 0xae, 0xcd,\n\t0x6f, 0x11, 0x72, 0xfe, 0x2b, 0xb0, 0x81, 0x53,\n\t0xea, 0x67, 0xd6, 0xe4, 0xca, 0x42, 0xa0, 0xf9,\n\t0xb1, 0xd4, 0xb5, 0x3b, 0xc9, 0xf0, 0x36, 0xc1,\n\t0x1c, 0xf4, 0xb1, 0xf6, 0x84, 0xd0, 0x86, 0x6c,\n\t0x76, 0x9a, 0x03, 0xc2, 0xb6, 0x2e, 0x9a, 0x46,\n\t0xf5, 0x5f, 0x2c, 0x38, 0xac, 0xad, 0x6f, 0x2e,\n\t0x7a, 0x18, 0x2d, 0x22, 0x95, 0x5e, 0x5e, 0xc9,\n\t0x7a, 0x0a, 0x56, 0xe1, 0xc7, 0x15, 0xfd, 0xbf,\n\t0xff, 0xf7, 0x7e, 0x85, 0x20, 0xa9, 0x8a, 0x9c,\n\t0xa9, 0x7d, 0xe8, 0xed, 0xfc, 0x7f, 0xbb, 0xf0,\n\t0x05, 0x3f, 0xce, 0x4f, 0x4c, 0xee, 0xa4, 0xa0,\n\t0xcc, 0x9c, 0x62, 0x1e, 0xd6, 0xd0, 0x30, 0x37,\n\t0xb8, 0x98, 0x56, 0x1d, 0xaa, 0xd6, 0x5e, 0x73,\n\t0x12, 0xe4, 0x88, 0x82, 0x48, 0x64, 0x06, 0xd7,\n\t0x2a, 0x31, 0x50, 0x7b, 0x10, 0x17, 0xb8, 0x4c,\n\t0x5a, 0x8d, 0xf1, 0xfc, 0xf1, 0x33, 0x3b, 0x98,\n\t0x42, 0x18, 0x5b, 0x35, 0x78, 0xca, 0x8e, 0x41,\n\t0x52, 0xae, 0x6d, 0xe1, 0xa2, 0x9d, 0x5b, 0xbd,\n\t0xf3, 0x5f, 0x49, 0xc1, 0x27, 0x06, 0xc1, 0xaf,\n\t0xc0, 0xa3, 0x9d, 0xf3, 0x1c, 0x8e, 0x90, 0x8a,\n\t0xb0, 0x69, 0xb0, 0xc5, 0x11, 0x0c, 0x91, 0x14,\n\t0x1f, 0x5e, 0x10, 0xe1, 0x1d, 0x14, 0x30, 0x54,\n\t0x1e, 0x17, 0x3d, 0x31, 0x7b, 0xbf, 0x2f, 0x9d,\n\t0x6d, 0x63, 0x32, 0xf0, 0x9d, 0x9f, 0x95, 0x3d,\n\t0x0b, 0xd2, 0x4d, 0x10, 0xe2, 0x3f, 0x67, 0x69,\n\t0x43, 0x9a, 0x4a, 0x2c, 0x54, 0x71, 0xa8, 0xa0,\n\t0x9e, 0x9f, 0x10, 0xaf, 0x1b, 0xce, 0x99, 0xe3,\n\t0x25, 0x32, 0x10, 0x54, 0x80, 0xfe, 0xda, 0x57,\n\t0xd0, 0xb2, 0x92, 0x7f, 0xbb, 0x5f, 0xe7, 0x4d,\n\t0x1b, 0x3d, 0x46, 0x4d, 0xe4, 0x4c, 0xd6, 0xaf,\n\t0x1a, 0x32, 0x12, 0x40, 0xb8, 0x84, 0x8e, 0xe4,\n\t0x80, 0xce, 0x7e, 0xc1, 0x13, 0x8b, 0xb0, 0xb7,\n\t0x6f, 0x24, 0xba, 0x85, 0x50, 0x83, 0xc3, 0xcf,\n\t0x19, 0xb3, 0xf0, 0xc7, 0xee, 0x68, 0xbe, 0x9e,\n\t0x6d, 0xb9, 0xfb, 0xd5, 0x29, 0xce, 0x82, 0xcd,\n\t0x69, 0x16, 0x68, 0x6b, 0x6a, 0xf4, 0x02, 0x32,\n\t0xce, 0x60, 0x37, 0x0c, 0xb9, 0x38, 0x92, 0x9c,\n\t0x42, 0xa9, 0x0b, 0x53, 0x96, 0xfe, 0x39, 0xc1,\n\t0x24, 0x65, 0x9b, 0xcd, 0xe7, 0x8d, 0x36, 0x07,\n\t0x9f, 0x1d, 0x35, 0x8e, 0xdc, 0x4c, 0xb5, 0x68,\n\t0xc5, 0xfd, 0x44, 0x19, 0xf2, 0x6c, 0x59, 0x1c,\n\t0xb1, 0x0b, 0x35, 0x48, 0x86, 0x1a, 0x05, 0x22,\n\t0x03, 0x0c, 0x0c, 0xa2, 0x92, 0x90, 0x35, 0xfb,\n\t0x37, 0x94, 0xc7, 0x15, 0x84, 0xae, 0xe8, 0x05,\n\t0xa0, 0xf7, 0x30, 0x11, 0x5c, 0xe4, 0x5d, 0x3e,\n\t0x12, 0x54, 0x80, 0x54, 0x6b, 0x09, 0x8c, 0xce,\n\t0x80, 0x5e, 0xa7, 0xc8, 0x6a, 0x0c, 0x56, 0xe1,\n\t0x18, 0x7d, 0xc9, 0x39, 0xc1, 0xef, 0xe3, 0x25,\n\t0xa0, 0x8b, 0x2f, 0x60, 0x3a, 0x43, 0x39, 0xa6,\n\t0x28, 0x28, 0x7b, 0x4c, 0x77, 0xd4, 0x49, 0x61,\n\t0x46, 0xe9, 0x1b, 0x45, 0xd6, 0xb1, 0x56, 0xe1,\n\t0x7d, 0x34, 0xcd, 0x06, 0xb6, 0x67, 0x8d, 0x7d,\n\t0x7a, 0xe2, 0xbe, 0x68, 0x35, 0xa6, 0x78, 0xe5,\n\t0x47, 0x48, 0xb7, 0xc7, 0xde, 0xcd, 0xc9, 0x05,\n\t0xb4, 0xe7, 0x50, 0x48, 0xe1, 0x4b, 0xfe, 0x76,\n\t0x77, 0xc6, 0xf7, 0x5f, 0xcb, 0xc2, 0xa8, 0xd7,\n\t0xd6, 0x8a, 0xe5, 0x49, 0xd9, 0xca, 0x45, 0xf4,\n\t0xda, 0xcd, 0x33, 0xd1, 0x59, 0x2d, 0x9e, 0xc1,\n\t0x5c, 0xe6, 0x01, 0x18, 0xb8, 0xf0, 0x5e, 0xb1,\n\t0x69, 0x95, 0x2f, 0x02, 0x2a, 0xe7, 0x4a, 0xd7,\n\t0xd1, 0xc3, 0xd5, 0x6f, 0x15, 0xc8, 0xdc, 0x29,\n\t0xde, 0xb9, 0x3f, 0x8b, 0xa6, 0xbc, 0xdd, 0x25,\n\t0x84, 0x35, 0x3c, 0x90, 0x2d, 0xc2, 0x1e, 0x98,\n\t0x8a, 0x50, 0x09, 0x77, 0x42, 0xe9, 0x35, 0x8a,\n\t0x7c, 0x97, 0xbf, 0xe8, 0xbf, 0x56, 0xd0, 0x8b,\n\t0x65, 0xd3, 0xaf, 0x1e, 0x05, 0x94, 0xfa, 0xac,\n\t0xa8, 0x2b, 0x28, 0xcb, 0x37, 0x3e, 0xe8, 0xbb,\n\t0x66, 0x3a, 0xed, 0xb2, 0x48, 0x10, 0x0f, 0x3a,\n\t0x5a, 0xc5, 0xdb, 0x26, 0x0e, 0xaa, 0x5e, 0x69,\n\t0x15, 0xd6, 0x81, 0xae, 0xbd, 0xe6, 0x03, 0xf1,\n\t0xf6, 0x37, 0xc8, 0xde, 0x70, 0x1f, 0x64, 0xb9,\n\t0x5e, 0xbf, 0x2e, 0x4f, 0xb1, 0xea, 0xa0, 0x17,\n\t0xe6, 0x7c, 0xf9, 0x2f, 0x1e, 0xd8, 0x58, 0xde,\n\t0xa7, 0xf0, 0x46, 0x52, 0x95, 0xdf, 0xa4, 0x96,\n\t0xd0, 0xc4, 0x97, 0x2b, 0x95, 0xcd, 0x5e, 0x40,\n\t0x23, 0x5c, 0x10, 0xee, 0xba, 0x72, 0x9b, 0xcf,\n\t0x0b, 0xe8, 0x18, 0x3a, 0x70, 0xd2, 0x5e, 0x07,\n\t0x68, 0x93, 0xef, 0x4a, 0x5b, 0x8d, 0x72, 0x41,\n\t0x4e, 0xea, 0x33, 0x6a, 0x0a, 0x5e, 0xfb, 0x02,\n\t0x3f, 0xd4, 0xed, 0x5b, 0xe0, 0x42, 0x84, 0xd4,\n\t0xaa, 0x85, 0xdc, 0x5b, 0x67, 0xee, 0x71, 0x67,\n\t0xba, 0x8e, 0xd2, 0xbe, 0x61, 0xdf, 0x5a, 0x26,\n\t0xb9, 0xf0, 0x77, 0x81, 0x53, 0x24, 0x16, 0xcb,\n\t0x8c, 0xb8, 0x06, 0x6e, 0x68, 0xda, 0xc8, 0x2d,\n\t0x17, 0x54, 0xdb, 0x46, 0xcb, 0xfd, 0x1f, 0x3d,\n\t0x94, 0x81, 0x09, 0x4b, 0xfa, 0xb1, 0x46, 0xd9,\n\t0x11, 0xa3, 0xb7, 0x31, 0x9c, 0xd2, 0x38, 0xd6,\n\t0xba, 0x3d, 0xa3, 0x74, 0xd8, 0xf1, 0x24, 0xe8,\n\t0x9c, 0xcb, 0x1d, 0xf9, 0x4a, 0xf7, 0xc8, 0x4b,\n\t0xfe, 0x97, 0x7c, 0xa1, 0x02, 0xeb, 0x40, 0xc3,\n\t0x89, 0x71, 0x01, 0xcd, 0x33, 0x2a, 0xc2, 0x82,\n\t0xce, 0x62, 0x8d, 0x53, 0x7c, 0xdf, 0xce, 0xd7,\n\t0xf5, 0xa8, 0x4f, 0xf2, 0xf2, 0x2e, 0xc1, 0xeb,\n\t0x97, 0x99, 0x37, 0x3c, 0x53, 0xa6, 0xb4, 0x46,\n\t0x05, 0x64, 0x92, 0x87, 0x08, 0x3c, 0x23, 0x4b,\n\t0x9d, 0x67, 0x18, 0xf9, 0xe2, 0x0b, 0x1c, 0x39,\n\t0xd3, 0x87, 0x70, 0xc0, 0xb9, 0x1e, 0x52, 0x0a,\n\t0x0f, 0x48, 0xe2, 0xe7, 0x51, 0x72, 0x94, 0xf7,\n\t0xa3, 0xdc, 0xe5, 0x66, 0x33, 0x39, 0x54, 0x06,\n\t0x55, 0x93, 0x30, 0xf9, 0x5e, 0x76, 0x8f, 0xe0,\n\t0x59, 0x4d, 0x0d, 0xa7, 0xf5, 0xbe, 0xdb, 0x20,\n\t0xad, 0x0d, 0x76, 0x88, 0x5f, 0x9c, 0x7c, 0x75,\n\t0x2f, 0x2a, 0x0b, 0x79, 0x6e, 0xd3, 0xe2, 0x66,\n\t0xf5, 0x4a, 0x2d, 0x87, 0x87, 0x49, 0x84, 0x17,\n\t0xa2, 0x62, 0x4c, 0xbb, 0xe4, 0x6e, 0x98, 0x10,\n\t0xc9, 0xfb, 0x8a, 0x04, 0x68, 0x8d, 0x22, 0x66,\n\t0xad, 0xea, 0x2a, 0xc9, 0x97, 0x2d, 0x3c, 0xbc,\n\t0xd0, 0x77, 0x5f, 0xe6, 0xb8, 0x7f, 0xe6, 0xf6,\n\t0x39, 0xbf, 0x56, 0x0e, 0x26, 0x6d, 0xc5, 0x3e,\n\t0x53, 0x19, 0xd6, 0xb4, 0x57, 0x36, 0xa3, 0xc6,\n\t0xd3, 0x3d, 0x66, 0x79, 0x30, 0x5c, 0x14, 0x0c,\n\t0x0f, 0x3e, 0x96, 0xae, 0x90, 0x97, 0xab, 0x0d,\n\t0x9f, 0xc3, 0xe7, 0x66, 0x3e, 0xe0, 0x31, 0x43,\n\t0x4b, 0x01, 0xb3, 0x0e, 0x9e, 0x8c, 0x82, 0x4a,\n\t0x8c, 0xc7, 0x79, 0x85, 0xdf, 0x75, 0x0d, 0xb4,\n\t0x2b, 0x03, 0x14, 0xef, 0x72, 0x58, 0xfd, 0x64,\n\t0xc8, 0xe3, 0x0d, 0x9a, 0x14, 0x6f, 0x76, 0xf9,\n\t0x46, 0xd1, 0xd2, 0x81, 0xb3, 0x16, 0x6e, 0xc7,\n\t0x76, 0x82, 0xce, 0xf4, 0xee, 0x33, 0x00, 0xe6,\n\t0x77, 0xc4, 0xad, 0x4f, 0x06, 0xa7, 0x48, 0x80,\n\t0x9e, 0x21, 0x66, 0xca, 0x75, 0x69, 0x57, 0xcb,\n\t0xf0, 0x67, 0x6a, 0xaa, 0x8f, 0x88, 0x14, 0xbd,\n\t0x65, 0x62, 0xe2, 0xad, 0xcc, 0x22, 0x88, 0x7b,\n\t0x94, 0xbd, 0x0e, 0xcd, 0xb6, 0x69, 0xa2, 0xcb,\n\t0x7d, 0x57, 0x5c, 0xb4, 0x92, 0x80, 0x13, 0x99,\n\t0x84, 0xf3, 0x79, 0x0a, 0x2d, 0x70, 0xa4, 0xe0,\n\t0xde, 0xc6, 0x32, 0xb0, 0x8a, 0x62, 0xb5, 0xcf,\n\t0xfa, 0x5e, 0x5a, 0x92, 0x32, 0x7d, 0x34, 0x07,\n\t0xb5, 0x52, 0x3a, 0xb5, 0x7d, 0x0f, 0xa1, 0xba,\n\t0x56, 0xd0, 0x07, 0x76, 0x11, 0xf2, 0xc3, 0x33,\n\t0x9d, 0xbd, 0x12, 0x35, 0x5e, 0xf7, 0x05, 0x88,\n\t0x76, 0x94, 0xa6, 0xbf, 0xed, 0xb8, 0xa4, 0xa2,\n\t0x0c, 0xbe, 0x0f, 0x6a, 0xaf, 0xf3, 0x1b, 0x33,\n\t0x4a, 0xb7, 0x68, 0x3f, 0xbe, 0x95, 0x13, 0x97,\n\t0x0f, 0x15, 0x17, 0x1b, 0x23, 0xaa, 0x08, 0x78,\n\t0xa6, 0x5b, 0x08, 0xa2, 0x9d, 0x03, 0xa8, 0xa7,\n\t0x39, 0xdc, 0xbc, 0x9a, 0x85, 0xf5, 0xe5, 0x55,\n\t0x59, 0x3c, 0xef, 0xf9, 0x3f, 0x22, 0x8e, 0xf8,\n\t0xd8, 0x3e, 0x02, 0x0b, 0xd8, 0x78, 0x4b, 0x15,\n\t0x7f, 0xaa, 0x2c, 0xff, 0xbe, 0x77, 0x33, 0xc7,\n\t0x6a, 0x12, 0xaa, 0xa4, 0xbe, 0xc0, 0x3b, 0xcb,\n\t0x13, 0x9d, 0x9c, 0x5a, 0x9f, 0x8a, 0x57, 0x36,\n\t0x4f, 0x02, 0x5a, 0xf8, 0x1d, 0x97, 0x77, 0x43,\n\t0xc8, 0xa5, 0xb7, 0x9b, 0x10, 0x98, 0xfd, 0x58,\n\t0xbf, 0x42, 0xf6, 0xbf, 0xff, 0x6c, 0x40, 0x18,\n\t0x18, 0xdf, 0xac, 0x57, 0x71, 0xea, 0xcc, 0x8e,\n\t0xfd, 0xfe, 0x10, 0xfb, 0xb9, 0xfe, 0xbc, 0x9a,\n\t0x9c, 0x27, 0xe4, 0x10, 0x15, 0x94, 0x41, 0xa1,\n\t0xcc, 0xf6, 0x25, 0x49, 0x4f, 0x96, 0xc1, 0x8c,\n\t0x9e, 0x3e, 0x18, 0x29, 0x49, 0x92, 0xe7, 0xfe,\n\t0x22, 0xff, 0xed, 0x02, 0x16, 0x90, 0xef, 0xac,\n\t0xec, 0x95, 0x1d, 0x5b, 0x94, 0x9c, 0xf6, 0x7c,\n\t0x1b, 0x5a, 0x9d, 0xb0, 0x9b, 0x05, 0x36, 0xbf,\n\t0xef, 0xec, 0x63, 0x35, 0x40, 0x24, 0x45, 0x40,\n\t0x30, 0x1a, 0x9b, 0x90, 0xc3, 0xc2, 0xf7, 0x37,\n\t0xfb, 0x08, 0x8e, 0x48, 0x19, 0x48, 0xed, 0xa8,\n\t0xa8, 0x04, 0x6f, 0xd0, 0x33, 0xe9, 0xb8, 0x8d,\n\t0xe7, 0x1e, 0x5c, 0x47, 0x74, 0xc0, 0x66, 0x30,\n\t0x4e, 0xa7, 0x86, 0x73, 0xf1, 0xe5, 0x78, 0xa6,\n\t0xe0, 0xc1, 0xda, 0x13, 0x72, 0x07, 0x85, 0x34,\n\t0x63, 0x95, 0x49, 0x30, 0x4b, 0x9d, 0x03, 0xf1,\n\t0x7a, 0x6b, 0x91, 0xa2, 0x85, 0x41, 0xf9, 0x4a,\n\t0xd6, 0xff, 0xff, 0x86, 0xf7, 0xf0, 0xce, 0xb9,\n\t0x07, 0xf1, 0x88, 0x04, 0x33, 0xaa, 0xeb, 0x54,\n\t0xb2, 0x1c, 0x8e, 0x2e, 0x7b, 0x04, 0xa8, 0xcc,\n\t0x2c, 0x7a, 0xb3, 0xad, 0x1a, 0x89, 0x38, 0x89,\n\t0xd7, 0x11, 0x3a, 0x8c, 0xcf, 0xe3, 0xc5, 0xba,\n\t0xb0, 0xcc, 0xc4, 0xe3, 0x33, 0xf3, 0x18, 0xba,\n\t0xec, 0x56, 0xd9, 0x1c, 0x40, 0x70, 0x0d, 0x4e,\n\t0x97, 0x01, 0x23, 0xf3, 0x5a, 0xdc, 0xbf, 0x68,\n\t0x93, 0xc2, 0x1d, 0x8a, 0x96, 0xb7, 0xac, 0x18,\n\t0x6f, 0xf7, 0x84, 0x71, 0x0d, 0x3d, 0xf8, 0xba,\n\t0xdf, 0xb6, 0x89, 0x1d, 0x78, 0x19, 0xf2, 0x59,\n\t0xe9, 0x15, 0x55, 0x29, 0x73, 0x50, 0x59, 0x14,\n\t0x02, 0x21, 0x16, 0x8f, 0x0f, 0xdf, 0xa5, 0xf0,\n};\n\nstatic struct crc_test {\n\tuint32_t crc;\t\t/* random starting crc */\n\tuint32_t start;\t\t/* random offset in buf */\n\tuint32_t length;\t/* random length of test */\n\tuint32_t crc32c_le;\t/* expected crc32c_le result */\n\tuint32_t crc32_be;\t/* expected crc32_be result */\n} test[] = {\n\t{0xffffffff, 0x00000000, 0x00001000, 0x13934bef, 0xd8ddcdc3},\n\t{0xfe7328ea, 0x00000763, 0x00000717, 0xed2c0d70, 0xc863aef8},\n\t{0x4c40684e, 0x00000721, 0x0000011e, 0xd7f46ccc, 0x173a11c4},\n\t{0x6b487f90, 0x00000264, 0x000007bc, 0x759e9939, 0xd6307c56},\n\t{0x9f5810db, 0x00000afa, 0x00000255, 0x2685197f, 0x2e5c9201},\n\t{0xb15c4755, 0x00000d5b, 0x000002a4, 0xd8fadcb5, 0xf682c4be},\n\t{0x06518253, 0x00000ffb, 0x00000004, 0xabee2433, 0x3d8abdf9},\n\t{0xd9e71c55, 0x00000a2a, 0x00000259, 0x96682af2, 0x47b4d26c},\n\t{0x0c1ae843, 0x00000ce4, 0x0000031b, 0x7b637c43, 0x62b47e8b},\n\t{0xec3cd517, 0x000002ff, 0x00000566, 0x5d719a77, 0xff5bc5b7},\n\t{0x77828e95, 0x0000067f, 0x0000038f, 0x43ee5b6c, 0x1a0cfacd},\n\t{0xec87b4e3, 0x00000d1c, 0x000002e3, 0x2ddd2eee, 0x275118a7},\n\t{0x412158bb, 0x00000eee, 0x00000111, 0x67b38ba2, 0xa74ecff5},\n\t{0x2e52de3e, 0x00000c4a, 0x000003b5, 0xbcc5d61d, 0xbd800707},\n\t{0x6ddaae8b, 0x00000d99, 0x00000266, 0x8b535544, 0xecbde1a1},\n\t{0x049b6cb1, 0x000009c5, 0x000000b0, 0xfc22cabc, 0xfb78eb9f},\n\t{0x77d4b954, 0x0000028a, 0x000007fa, 0x71d00923, 0x8c116f85},\n\t{0x5e192355, 0x00000ac1, 0x000001fa, 0xb966b81a, 0x5aa17bbe},\n\t{0x7d80b71d, 0x00000213, 0x000001e0, 0x2bba371a, 0xb5906aa6},\n\t{0x01f6f1e4, 0x000001d6, 0x00000395, 0xb7e8a647, 0x3ad112b1},\n\t{0x1dfabb13, 0x00000e14, 0x000001eb, 0x53917fba, 0xbaee0339},\n\t{0xb00a4449, 0x00000bf6, 0x00000409, 0xedecb577, 0x6f3a3979},\n\t{0x7ecd3981, 0x0000083f, 0x0000016b, 0xefef62b9, 0xe3e52eed},\n\t{0xf8f330d2, 0x000004be, 0x00000757, 0x9357c9f3, 0x0835bc1b},\n\t{0x03c38af2, 0x00000d23, 0x000002dc, 0x360fa8c0, 0x2ca885e6},\n\t{0x687bb79b, 0x00000f3d, 0x000000c2, 0x448d3be2, 0x79be2f78},\n\t{0x6710f550, 0x000009e9, 0x00000603, 0xdbfd1998, 0x1d25f627},\n\t{0x873171d1, 0x00000787, 0x000004d5, 0xab7f1b62, 0xa76a5656},\n\t{0x373b1314, 0x00000f0f, 0x000000f0, 0x184098ab, 0xba273974},\n\t{0x90fad9cd, 0x00000ead, 0x00000152, 0x23ce52ff, 0xb7bc958c},\n\t{0x19676fe7, 0x0000007d, 0x0000070d, 0xf8a76f1e, 0xf882b644},\n\t{0x89facd45, 0x000005f3, 0x00000473, 0x4331a006, 0xe9dc1396},\n\t{0x6f173747, 0x00000fc3, 0x0000003c, 0xb012f08e, 0xc6b888ee},\n\t{0x4b44a106, 0x0000075a, 0x0000008b, 0xf6f7ac38, 0x60cd2b74},\n\t{0xb620ad06, 0x00000774, 0x0000017e, 0xd34558e6, 0x3a0a615b},\n\t{0x976f21e9, 0x000008d7, 0x0000034a, 0xe533aa3a, 0xa99e60be},\n\t{0x687628c0, 0x000006c5, 0x0000061b, 0x3a840b15, 0x9bfcaef2},\n\t{0xe24ac108, 0x00000cd0, 0x0000032f, 0x51010ae8, 0x20958672},\n\t{0x361c44a3, 0x00000304, 0x00000719, 0xfd7bd481, 0xd70ff2b2},\n\t{0xd93ff95e, 0x00000db7, 0x0000008e, 0xcfbbc304, 0xad716acd},\n\t{0xed752d12, 0x00000883, 0x00000091, 0x65a6c868, 0x95c71c7b},\n\t{0xb4ff4b54, 0x000003d3, 0x000001c1, 0xf82597e7, 0x44b7f99b},\n\t{0x111b520f, 0x00000708, 0x000000eb, 0xc3e109f3, 0x71bc01ee},\n\t{0x62c806f2, 0x00000ba3, 0x0000045c, 0x874d3a72, 0xc539b753},\n\t{0x40d97470, 0x000005e1, 0x0000058d, 0x87a9684f, 0xea6073a5},\n\t{0x4312179c, 0x00000056, 0x0000070e, 0x809a00f5, 0x209aea3b},\n\t{0x13d5f84c, 0x00000a2d, 0x00000104, 0xf3d27578, 0xe087a8b6},\n\t{0x1f302cb2, 0x00000151, 0x00000014, 0x1e162693, 0x95e4b90e},\n\t{0xe491db24, 0x00000600, 0x000006f6, 0x7ff09615, 0x77611523},\n\t{0xf9a98069, 0x000002ba, 0x000002ad, 0x01af7387, 0xea925faa},\n\t{0xe9c477ad, 0x0000015f, 0x00000778, 0x6facf9a0, 0x1130f736},\n\t{0x353f32b2, 0x0000087c, 0x00000783, 0x6cc964ea, 0x32459994},\n\t{0x78e1b24f, 0x00000650, 0x000006a8, 0xb3bb7c27, 0x5a632f78},\n\t{0x61aa400e, 0x00000049, 0x00000254, 0xb8cd1681, 0xdf2652d5},\n\t{0xb84b10b0, 0x00000f73, 0x0000008c, 0x406a6450, 0x3619d31b},\n\t{0x9fa99c9c, 0x00000a7c, 0x000004d7, 0xfb3d21b4, 0xea31c743},\n\t{0x3fc9ebe3, 0x00000cd9, 0x000000d6, 0x43803f9c, 0x1f76a809},\n\t{0x529879cd, 0x000002f2, 0x00000595, 0x78b4c6a6, 0x63b9b93f},\n\t{0x3a933019, 0x00000516, 0x00000266, 0xdcb45436, 0x8f99c98c},\n\t{0x887b4977, 0x00000227, 0x0000038d, 0xc5f7c3d9, 0xaf5e3091},\n\t{0x770745de, 0x000008c6, 0x00000739, 0xf69145e8, 0x53d0dce1},\n\t{0x28be3b47, 0x00000c46, 0x0000032b, 0x764c028f, 0x106d0905},\n\t{0x5013a050, 0x00000cf6, 0x00000309, 0xea8fe164, 0x62180b57},\n\t{0x2ec4c9ba, 0x000006e8, 0x0000078d, 0xa35557a9, 0xf44430a4},\n\t{0xa9f950c9, 0x00000d33, 0x000002cc, 0x41ea8618, 0x587b4eb3},\n\t{0x5b520229, 0x000007b2, 0x00000484, 0x44569f1f, 0x92406c32},\n\t{0xd8dcbbfc, 0x0000002f, 0x0000048c, 0xdb88ab8b, 0x13bfe70e},\n\t{0x25529792, 0x00000d1d, 0x000002e2, 0x20cda404, 0x19d3b4e4},\n\t{0x9f3f6d71, 0x00000238, 0x0000079a, 0x0720443e, 0x3c107021},\n\t{0x64121215, 0x000007ff, 0x0000038f, 0x6aacff2c, 0xb82fdc3e},\n\t{0xfb6cdde0, 0x00000ef8, 0x00000107, 0xbd43a0f1, 0xab0d3c1d},\n\t{0x221c9d6f, 0x000007b6, 0x0000014f, 0xb67f834b, 0x1371ad05},\n\t{0x030e1de4, 0x00000836, 0x000004b4, 0x0d67d26a, 0xe2e72df1},\n\t{0xb56fa6cf, 0x00000c07, 0x000003f8, 0x60601ac1, 0x039de73e},\n\t{0xb55c89f5, 0x0000098e, 0x000001d4, 0x2400efbe, 0xfe39a2bb},\n\t{0x5e90b6d5, 0x0000070b, 0x000003ea, 0x3bb5d6ea, 0xf0f794a0},\n\t{0x2a7045ae, 0x00000961, 0x00000633, 0xfca89e4b, 0xe66ce41c},\n\t{0x8b374ea9, 0x000006ba, 0x00000780, 0xbce036ed, 0x4cb28ef7},\n\t{0x8bd90bc9, 0x00000562, 0x00000369, 0xcb26a24b, 0x40236d1d},\n\t{0x5b1b1762, 0x000000fd, 0x0000051a, 0x33cdda07, 0xc32e420a},\n\t{0xa4153555, 0x0000058f, 0x000005c7, 0xbe50eeca, 0x83a67f35},\n\t{0x0be1f931, 0x00000651, 0x00000672, 0x95a25753, 0x88f1aac1},\n\t{0xb7e78618, 0x00000a7f, 0x000002bb, 0xe06bcc1c, 0x74274f66},\n\t{0x4a9bc41b, 0x00000e51, 0x000001ae, 0x709e8d2c, 0x54eff534},\n\t{0xfc359d13, 0x00000440, 0x000002f8, 0x0a58451f, 0x55e9363f},\n\t{0x5aa48619, 0x000006d1, 0x00000284, 0x928ead83, 0x31041c06},\n\t{0xa609afa8, 0x0000053e, 0x00000272, 0xb048c141, 0x4704efba},\n\t{0x3f108afb, 0x00000949, 0x00000150, 0x9a6bb5bc, 0x4e4430c8},\n\t{0x79bec2d3, 0x000008ed, 0x00000712, 0x32692d57, 0x11d52a7b},\n\t{0x9429e067, 0x00000bc3, 0x0000043c, 0x5295ceff, 0x04640f4d},\n\t{0xae58b96a, 0x0000082d, 0x000007d2, 0xc2a681ba, 0xf7ca4a2c},\n\t{0x95df24be, 0x00000985, 0x000004c1, 0x3a287765, 0x2c4af003},\n\t{0x5e94976f, 0x00000596, 0x000004ed, 0xff00c489, 0x5ae11687},\n\t{0xf5e5f1de, 0x00000d31, 0x000002ce, 0x35f28e91, 0x30d47957},\n\t{0xa2c219cf, 0x00000a3c, 0x00000374, 0x707d21eb, 0x2a14a255},\n\t{0xf21b6ceb, 0x00000919, 0x00000135, 0x0847fb8b, 0xcb8d3b93},\n\t{0xaa988728, 0x00000787, 0x00000771, 0x885aeaa4, 0x6531b509},\n\t{0xaa5dfaac, 0x000003e5, 0x0000051b, 0x52c48ab7, 0xe43cc5e9},\n\t{0x0a053968, 0x00000d2a, 0x000002d5, 0x7a90256d, 0x8004765c},\n\t{0x1421dc20, 0x00000eef, 0x00000110, 0x97d6da24, 0x1378f6ff},\n\t{0xb47c2166, 0x00000a6a, 0x00000209, 0xcfd6cc52, 0x676e14a5},\n\t{0x77dd1955, 0x000000de, 0x00000266, 0xba74bcaa, 0xc71b429c},\n\t{0x68a03cc2, 0x0000082f, 0x000007b0, 0x752bd5d8, 0x19ed14aa},\n\t{0x0226b0a3, 0x00000a5f, 0x000005a0, 0x82de4970, 0xf654d3ed},\n\t{0x637bf3b1, 0x00000d93, 0x0000026c, 0x5c7115cb, 0x3cccb57e},\n\t{0x3b120edf, 0x00000c13, 0x000003ec, 0x80d7d20f, 0x92132798},\n\t{0xe2456780, 0x000002eb, 0x00000641, 0xc0a5d289, 0x6160c87a},\n\t{0x9b2e7125, 0x00000c0c, 0x000003f3, 0xcc15f57e, 0x6f00f637},\n\t{0x153033ef, 0x00000787, 0x000006b6, 0x3cde443b, 0xb46caa6e},\n\t{0x18458b3f, 0x0000066c, 0x00000561, 0x9a2bd8c6, 0xb6c29121},\n\t{0x4ff9d4b9, 0x00000c8f, 0x0000033a, 0xd0ee6d6d, 0xc81cf380},\n\t{0xdf84b5d9, 0x00000802, 0x0000029a, 0xdab0d74a, 0xb2464559},\n\t{0x81ee15df, 0x000003ce, 0x00000725, 0x9942e2de, 0x4ccf571b},\n\t{0x5c768e04, 0x00000afd, 0x00000160, 0x36110831, 0xae0b305a},\n\t{0xe5e18094, 0x00000b4b, 0x000000a0, 0xffa3e4a7, 0x6c8a4f09},\n\t{0xed7263b6, 0x00000d0d, 0x000002f2, 0xb0006a35, 0x7e04af8c},\n\t{0x5bfde7d7, 0x000006fb, 0x00000554, 0xa4193b76, 0xb3a91d12},\n\t{0x67f4a743, 0x00000b85, 0x0000047a, 0xf05c8d8f, 0xfb472fdf},\n\t{0xf13bdf22, 0x00000ff7, 0x00000008, 0x816351eb, 0xf347f235},\n\t{0x08ecc608, 0x00000d5d, 0x00000098, 0x90492772, 0x0b7f1521},\n\t{0x296f52ba, 0x000004f9, 0x00000788, 0x5e5a4896, 0x1cc67088},\n\t{0xbe4624c2, 0x00000427, 0x000004ef, 0xcd267b94, 0x550caefd},\n\t{0x906f7c7c, 0x00000a05, 0x0000003f, 0x03fcfc33, 0x9ed82a02},\n\t{0x8f7b323e, 0x00000458, 0x000004c7, 0xcd4969c8, 0x633c38a8},\n\t{0x88d6593d, 0x00000597, 0x000005b5, 0xf199cd3b, 0x0491452f},\n\t{0x978a7768, 0x00000268, 0x000001d3, 0xb28c95bd, 0x1a42fe61},\n\t{0x857a621e, 0x000007a7, 0x000003a8, 0xf4bf84ab, 0xcd0694c6},\n\t{0xb0e121ef, 0x000005be, 0x00000644, 0x28747c14, 0xf0510c72},\n\t{0, 0, 0, 0, 0},\n};\n\nstatic int test_crc32c(void)\n{\n\tstruct crc_test *t = test;\n\tint failures = 0;\n\n\twhile (t->length) {\n\t\tuint32_t be, le;\n\t\tle = ext2fs_crc32c_le(t->crc, test_buf + t->start, t->length);\n\t\tbe = ext2fs_crc32_be(t->crc, test_buf + t->start, t->length);\n\t\tif (le != t->crc32c_le) {\n\t\t\tprintf(\"Test %d LE fails, %x != %x\\n\",\n\t\t\t       (int) (t - test), le, t->crc32c_le);\n\t\t\tfailures++;\n\t\t}\n\t\tif (be != t->crc32_be) {\n\t\t\tprintf(\"Test %d BE fails, %x != %x\\n\",\n\t\t\t       (int) (t - test), be, t->crc32_be);\n\t\t\tfailures++;\n\t\t}\n\t\tt++;\n\t}\n\n\treturn failures;\n}\n\nint main(int argc, char *argv[])\n{\n\tint ret;\n\n\tret = test_crc32c();\n\tif (!ret)\n\t\tprintf(\"No failures.\\n\");\n\n\treturn ret;\n}\n#endif /* UNITTEST */\n"
  },
  {
    "path": "src/ext2fs/crc32c_defs.h",
    "content": "/*\n * There are multiple 16-bit CRC polynomials in common use, but this is\n * *the* standard CRC-32 polynomial, first popularized by Ethernet.\n * x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+x^0\n */\n#define CRCPOLY_LE 0xedb88320\n#define CRCPOLY_BE 0x04c11db7\n\n/*\n * This is the CRC32c polynomial, as outlined by Castagnoli.\n * x^32+x^28+x^27+x^26+x^25+x^23+x^22+x^20+x^19+x^18+x^14+x^13+x^11+x^10+x^9+\n * x^8+x^6+x^0\n */\n#define CRC32C_POLY_LE 0x82F63B78\n#define CRC32C_POLY_BE 0x1EDC6F41\n\n/* How many bits at a time to use.  Valid values are 1, 2, 4, 8, 32 and 64. */\n/* For less performance-sensitive, use 4 */\n#ifndef CRC_LE_BITS\n# define CRC_LE_BITS 64\n#endif\n#ifndef CRC_BE_BITS\n# define CRC_BE_BITS 64\n#endif\n\n/*\n * Little-endian CRC computation.  Used with serial bit streams sent\n * lsbit-first.  Be sure to use cpu_to_le32() to append the computed CRC.\n */\n#if CRC_LE_BITS > 64 || CRC_LE_BITS < 1 || CRC_LE_BITS == 16 || \\\n\tCRC_LE_BITS & CRC_LE_BITS-1\n# error \"CRC_LE_BITS must be one of {1, 2, 4, 8, 32, 64}\"\n#endif\n\n/*\n * Big-endian CRC computation.  Used with serial bit streams sent\n * msbit-first.  Be sure to use cpu_to_be32() to append the computed CRC.\n */\n#if CRC_BE_BITS > 64 || CRC_BE_BITS < 1 || CRC_BE_BITS == 16 || \\\n\tCRC_BE_BITS & CRC_BE_BITS-1\n# error \"CRC_BE_BITS must be one of {1, 2, 4, 8, 32, 64}\"\n#endif\n\n\n#define ___constant_swab32(x) \\\n\t((uint32_t)( \\\n\t\t(((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \\\n\t\t(((uint32_t)(x) & (uint32_t)0x0000ff00UL) <<  8) | \\\n\t\t(((uint32_t)(x) & (uint32_t)0x00ff0000UL) >>  8) | \\\n\t\t(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))\n\n\n#if (__GNUC__ >= 3)\n#define likely(x)\t__builtin_expect(!!(x), 1)\n#define unlikely(x)\t__builtin_expect(!!(x), 0)\n#else\n#define likely(x)\t(x)\n#define unlikely(x)\t(x)\n#endif\n"
  },
  {
    "path": "src/ext2fs/crc32c_table.h",
    "content": "/* this file is generated - do not edit */\n\nstatic const uint32_t crc32table_be[8][256] = {{\n\ttobe(0x00000000L), tobe(0x04c11db7L), tobe(0x09823b6eL), tobe(0x0d4326d9L),\n\ttobe(0x130476dcL), tobe(0x17c56b6bL), tobe(0x1a864db2L), tobe(0x1e475005L),\n\ttobe(0x2608edb8L), tobe(0x22c9f00fL), tobe(0x2f8ad6d6L), tobe(0x2b4bcb61L),\n\ttobe(0x350c9b64L), tobe(0x31cd86d3L), tobe(0x3c8ea00aL), tobe(0x384fbdbdL),\n\ttobe(0x4c11db70L), tobe(0x48d0c6c7L), tobe(0x4593e01eL), tobe(0x4152fda9L),\n\ttobe(0x5f15adacL), tobe(0x5bd4b01bL), tobe(0x569796c2L), tobe(0x52568b75L),\n\ttobe(0x6a1936c8L), tobe(0x6ed82b7fL), tobe(0x639b0da6L), tobe(0x675a1011L),\n\ttobe(0x791d4014L), tobe(0x7ddc5da3L), tobe(0x709f7b7aL), tobe(0x745e66cdL),\n\ttobe(0x9823b6e0L), tobe(0x9ce2ab57L), tobe(0x91a18d8eL), tobe(0x95609039L),\n\ttobe(0x8b27c03cL), tobe(0x8fe6dd8bL), tobe(0x82a5fb52L), tobe(0x8664e6e5L),\n\ttobe(0xbe2b5b58L), tobe(0xbaea46efL), tobe(0xb7a96036L), tobe(0xb3687d81L),\n\ttobe(0xad2f2d84L), tobe(0xa9ee3033L), tobe(0xa4ad16eaL), tobe(0xa06c0b5dL),\n\ttobe(0xd4326d90L), tobe(0xd0f37027L), tobe(0xddb056feL), tobe(0xd9714b49L),\n\ttobe(0xc7361b4cL), tobe(0xc3f706fbL), tobe(0xceb42022L), tobe(0xca753d95L),\n\ttobe(0xf23a8028L), tobe(0xf6fb9d9fL), tobe(0xfbb8bb46L), tobe(0xff79a6f1L),\n\ttobe(0xe13ef6f4L), tobe(0xe5ffeb43L), tobe(0xe8bccd9aL), tobe(0xec7dd02dL),\n\ttobe(0x34867077L), tobe(0x30476dc0L), tobe(0x3d044b19L), tobe(0x39c556aeL),\n\ttobe(0x278206abL), tobe(0x23431b1cL), tobe(0x2e003dc5L), tobe(0x2ac12072L),\n\ttobe(0x128e9dcfL), tobe(0x164f8078L), tobe(0x1b0ca6a1L), tobe(0x1fcdbb16L),\n\ttobe(0x018aeb13L), tobe(0x054bf6a4L), tobe(0x0808d07dL), tobe(0x0cc9cdcaL),\n\ttobe(0x7897ab07L), tobe(0x7c56b6b0L), tobe(0x71159069L), tobe(0x75d48ddeL),\n\ttobe(0x6b93dddbL), tobe(0x6f52c06cL), tobe(0x6211e6b5L), tobe(0x66d0fb02L),\n\ttobe(0x5e9f46bfL), tobe(0x5a5e5b08L), tobe(0x571d7dd1L), tobe(0x53dc6066L),\n\ttobe(0x4d9b3063L), tobe(0x495a2dd4L), tobe(0x44190b0dL), tobe(0x40d816baL),\n\ttobe(0xaca5c697L), tobe(0xa864db20L), tobe(0xa527fdf9L), tobe(0xa1e6e04eL),\n\ttobe(0xbfa1b04bL), tobe(0xbb60adfcL), tobe(0xb6238b25L), tobe(0xb2e29692L),\n\ttobe(0x8aad2b2fL), tobe(0x8e6c3698L), tobe(0x832f1041L), tobe(0x87ee0df6L),\n\ttobe(0x99a95df3L), tobe(0x9d684044L), tobe(0x902b669dL), tobe(0x94ea7b2aL),\n\ttobe(0xe0b41de7L), tobe(0xe4750050L), tobe(0xe9362689L), tobe(0xedf73b3eL),\n\ttobe(0xf3b06b3bL), tobe(0xf771768cL), tobe(0xfa325055L), tobe(0xfef34de2L),\n\ttobe(0xc6bcf05fL), tobe(0xc27dede8L), tobe(0xcf3ecb31L), tobe(0xcbffd686L),\n\ttobe(0xd5b88683L), tobe(0xd1799b34L), tobe(0xdc3abdedL), tobe(0xd8fba05aL),\n\ttobe(0x690ce0eeL), tobe(0x6dcdfd59L), tobe(0x608edb80L), tobe(0x644fc637L),\n\ttobe(0x7a089632L), tobe(0x7ec98b85L), tobe(0x738aad5cL), tobe(0x774bb0ebL),\n\ttobe(0x4f040d56L), tobe(0x4bc510e1L), tobe(0x46863638L), tobe(0x42472b8fL),\n\ttobe(0x5c007b8aL), tobe(0x58c1663dL), tobe(0x558240e4L), tobe(0x51435d53L),\n\ttobe(0x251d3b9eL), tobe(0x21dc2629L), tobe(0x2c9f00f0L), tobe(0x285e1d47L),\n\ttobe(0x36194d42L), tobe(0x32d850f5L), tobe(0x3f9b762cL), tobe(0x3b5a6b9bL),\n\ttobe(0x0315d626L), tobe(0x07d4cb91L), tobe(0x0a97ed48L), tobe(0x0e56f0ffL),\n\ttobe(0x1011a0faL), tobe(0x14d0bd4dL), tobe(0x19939b94L), tobe(0x1d528623L),\n\ttobe(0xf12f560eL), tobe(0xf5ee4bb9L), tobe(0xf8ad6d60L), tobe(0xfc6c70d7L),\n\ttobe(0xe22b20d2L), tobe(0xe6ea3d65L), tobe(0xeba91bbcL), tobe(0xef68060bL),\n\ttobe(0xd727bbb6L), tobe(0xd3e6a601L), tobe(0xdea580d8L), tobe(0xda649d6fL),\n\ttobe(0xc423cd6aL), tobe(0xc0e2d0ddL), tobe(0xcda1f604L), tobe(0xc960ebb3L),\n\ttobe(0xbd3e8d7eL), tobe(0xb9ff90c9L), tobe(0xb4bcb610L), tobe(0xb07daba7L),\n\ttobe(0xae3afba2L), tobe(0xaafbe615L), tobe(0xa7b8c0ccL), tobe(0xa379dd7bL),\n\ttobe(0x9b3660c6L), tobe(0x9ff77d71L), tobe(0x92b45ba8L), tobe(0x9675461fL),\n\ttobe(0x8832161aL), tobe(0x8cf30badL), tobe(0x81b02d74L), tobe(0x857130c3L),\n\ttobe(0x5d8a9099L), tobe(0x594b8d2eL), tobe(0x5408abf7L), tobe(0x50c9b640L),\n\ttobe(0x4e8ee645L), tobe(0x4a4ffbf2L), tobe(0x470cdd2bL), tobe(0x43cdc09cL),\n\ttobe(0x7b827d21L), tobe(0x7f436096L), tobe(0x7200464fL), tobe(0x76c15bf8L),\n\ttobe(0x68860bfdL), tobe(0x6c47164aL), tobe(0x61043093L), tobe(0x65c52d24L),\n\ttobe(0x119b4be9L), tobe(0x155a565eL), tobe(0x18197087L), tobe(0x1cd86d30L),\n\ttobe(0x029f3d35L), tobe(0x065e2082L), tobe(0x0b1d065bL), tobe(0x0fdc1becL),\n\ttobe(0x3793a651L), tobe(0x3352bbe6L), tobe(0x3e119d3fL), tobe(0x3ad08088L),\n\ttobe(0x2497d08dL), tobe(0x2056cd3aL), tobe(0x2d15ebe3L), tobe(0x29d4f654L),\n\ttobe(0xc5a92679L), tobe(0xc1683bceL), tobe(0xcc2b1d17L), tobe(0xc8ea00a0L),\n\ttobe(0xd6ad50a5L), tobe(0xd26c4d12L), tobe(0xdf2f6bcbL), tobe(0xdbee767cL),\n\ttobe(0xe3a1cbc1L), tobe(0xe760d676L), tobe(0xea23f0afL), tobe(0xeee2ed18L),\n\ttobe(0xf0a5bd1dL), tobe(0xf464a0aaL), tobe(0xf9278673L), tobe(0xfde69bc4L),\n\ttobe(0x89b8fd09L), tobe(0x8d79e0beL), tobe(0x803ac667L), tobe(0x84fbdbd0L),\n\ttobe(0x9abc8bd5L), tobe(0x9e7d9662L), tobe(0x933eb0bbL), tobe(0x97ffad0cL),\n\ttobe(0xafb010b1L), tobe(0xab710d06L), tobe(0xa6322bdfL), tobe(0xa2f33668L),\n\ttobe(0xbcb4666dL), tobe(0xb8757bdaL), tobe(0xb5365d03L), tobe(0xb1f740b4L)},\n\t{\n\ttobe(0x00000000L), tobe(0xd219c1dcL), tobe(0xa0f29e0fL), tobe(0x72eb5fd3L),\n\ttobe(0x452421a9L), tobe(0x973de075L), tobe(0xe5d6bfa6L), tobe(0x37cf7e7aL),\n\ttobe(0x8a484352L), tobe(0x5851828eL), tobe(0x2abadd5dL), tobe(0xf8a31c81L),\n\ttobe(0xcf6c62fbL), tobe(0x1d75a327L), tobe(0x6f9efcf4L), tobe(0xbd873d28L),\n\ttobe(0x10519b13L), tobe(0xc2485acfL), tobe(0xb0a3051cL), tobe(0x62bac4c0L),\n\ttobe(0x5575babaL), tobe(0x876c7b66L), tobe(0xf58724b5L), tobe(0x279ee569L),\n\ttobe(0x9a19d841L), tobe(0x4800199dL), tobe(0x3aeb464eL), tobe(0xe8f28792L),\n\ttobe(0xdf3df9e8L), tobe(0x0d243834L), tobe(0x7fcf67e7L), tobe(0xadd6a63bL),\n\ttobe(0x20a33626L), tobe(0xf2baf7faL), tobe(0x8051a829L), tobe(0x524869f5L),\n\ttobe(0x6587178fL), tobe(0xb79ed653L), tobe(0xc5758980L), tobe(0x176c485cL),\n\ttobe(0xaaeb7574L), tobe(0x78f2b4a8L), tobe(0x0a19eb7bL), tobe(0xd8002aa7L),\n\ttobe(0xefcf54ddL), tobe(0x3dd69501L), tobe(0x4f3dcad2L), tobe(0x9d240b0eL),\n\ttobe(0x30f2ad35L), tobe(0xe2eb6ce9L), tobe(0x9000333aL), tobe(0x4219f2e6L),\n\ttobe(0x75d68c9cL), tobe(0xa7cf4d40L), tobe(0xd5241293L), tobe(0x073dd34fL),\n\ttobe(0xbabaee67L), tobe(0x68a32fbbL), tobe(0x1a487068L), tobe(0xc851b1b4L),\n\ttobe(0xff9ecfceL), tobe(0x2d870e12L), tobe(0x5f6c51c1L), tobe(0x8d75901dL),\n\ttobe(0x41466c4cL), tobe(0x935fad90L), tobe(0xe1b4f243L), tobe(0x33ad339fL),\n\ttobe(0x04624de5L), tobe(0xd67b8c39L), tobe(0xa490d3eaL), tobe(0x76891236L),\n\ttobe(0xcb0e2f1eL), tobe(0x1917eec2L), tobe(0x6bfcb111L), tobe(0xb9e570cdL),\n\ttobe(0x8e2a0eb7L), tobe(0x5c33cf6bL), tobe(0x2ed890b8L), tobe(0xfcc15164L),\n\ttobe(0x5117f75fL), tobe(0x830e3683L), tobe(0xf1e56950L), tobe(0x23fca88cL),\n\ttobe(0x1433d6f6L), tobe(0xc62a172aL), tobe(0xb4c148f9L), tobe(0x66d88925L),\n\ttobe(0xdb5fb40dL), tobe(0x094675d1L), tobe(0x7bad2a02L), tobe(0xa9b4ebdeL),\n\ttobe(0x9e7b95a4L), tobe(0x4c625478L), tobe(0x3e890babL), tobe(0xec90ca77L),\n\ttobe(0x61e55a6aL), tobe(0xb3fc9bb6L), tobe(0xc117c465L), tobe(0x130e05b9L),\n\ttobe(0x24c17bc3L), tobe(0xf6d8ba1fL), tobe(0x8433e5ccL), tobe(0x562a2410L),\n\ttobe(0xebad1938L), tobe(0x39b4d8e4L), tobe(0x4b5f8737L), tobe(0x994646ebL),\n\ttobe(0xae893891L), tobe(0x7c90f94dL), tobe(0x0e7ba69eL), tobe(0xdc626742L),\n\ttobe(0x71b4c179L), tobe(0xa3ad00a5L), tobe(0xd1465f76L), tobe(0x035f9eaaL),\n\ttobe(0x3490e0d0L), tobe(0xe689210cL), tobe(0x94627edfL), tobe(0x467bbf03L),\n\ttobe(0xfbfc822bL), tobe(0x29e543f7L), tobe(0x5b0e1c24L), tobe(0x8917ddf8L),\n\ttobe(0xbed8a382L), tobe(0x6cc1625eL), tobe(0x1e2a3d8dL), tobe(0xcc33fc51L),\n\ttobe(0x828cd898L), tobe(0x50951944L), tobe(0x227e4697L), tobe(0xf067874bL),\n\ttobe(0xc7a8f931L), tobe(0x15b138edL), tobe(0x675a673eL), tobe(0xb543a6e2L),\n\ttobe(0x08c49bcaL), tobe(0xdadd5a16L), tobe(0xa83605c5L), tobe(0x7a2fc419L),\n\ttobe(0x4de0ba63L), tobe(0x9ff97bbfL), tobe(0xed12246cL), tobe(0x3f0be5b0L),\n\ttobe(0x92dd438bL), tobe(0x40c48257L), tobe(0x322fdd84L), tobe(0xe0361c58L),\n\ttobe(0xd7f96222L), tobe(0x05e0a3feL), tobe(0x770bfc2dL), tobe(0xa5123df1L),\n\ttobe(0x189500d9L), tobe(0xca8cc105L), tobe(0xb8679ed6L), tobe(0x6a7e5f0aL),\n\ttobe(0x5db12170L), tobe(0x8fa8e0acL), tobe(0xfd43bf7fL), tobe(0x2f5a7ea3L),\n\ttobe(0xa22feebeL), tobe(0x70362f62L), tobe(0x02dd70b1L), tobe(0xd0c4b16dL),\n\ttobe(0xe70bcf17L), tobe(0x35120ecbL), tobe(0x47f95118L), tobe(0x95e090c4L),\n\ttobe(0x2867adecL), tobe(0xfa7e6c30L), tobe(0x889533e3L), tobe(0x5a8cf23fL),\n\ttobe(0x6d438c45L), tobe(0xbf5a4d99L), tobe(0xcdb1124aL), tobe(0x1fa8d396L),\n\ttobe(0xb27e75adL), tobe(0x6067b471L), tobe(0x128ceba2L), tobe(0xc0952a7eL),\n\ttobe(0xf75a5404L), tobe(0x254395d8L), tobe(0x57a8ca0bL), tobe(0x85b10bd7L),\n\ttobe(0x383636ffL), tobe(0xea2ff723L), tobe(0x98c4a8f0L), tobe(0x4add692cL),\n\ttobe(0x7d121756L), tobe(0xaf0bd68aL), tobe(0xdde08959L), tobe(0x0ff94885L),\n\ttobe(0xc3cab4d4L), tobe(0x11d37508L), tobe(0x63382adbL), tobe(0xb121eb07L),\n\ttobe(0x86ee957dL), tobe(0x54f754a1L), tobe(0x261c0b72L), tobe(0xf405caaeL),\n\ttobe(0x4982f786L), tobe(0x9b9b365aL), tobe(0xe9706989L), tobe(0x3b69a855L),\n\ttobe(0x0ca6d62fL), tobe(0xdebf17f3L), tobe(0xac544820L), tobe(0x7e4d89fcL),\n\ttobe(0xd39b2fc7L), tobe(0x0182ee1bL), tobe(0x7369b1c8L), tobe(0xa1707014L),\n\ttobe(0x96bf0e6eL), tobe(0x44a6cfb2L), tobe(0x364d9061L), tobe(0xe45451bdL),\n\ttobe(0x59d36c95L), tobe(0x8bcaad49L), tobe(0xf921f29aL), tobe(0x2b383346L),\n\ttobe(0x1cf74d3cL), tobe(0xceee8ce0L), tobe(0xbc05d333L), tobe(0x6e1c12efL),\n\ttobe(0xe36982f2L), tobe(0x3170432eL), tobe(0x439b1cfdL), tobe(0x9182dd21L),\n\ttobe(0xa64da35bL), tobe(0x74546287L), tobe(0x06bf3d54L), tobe(0xd4a6fc88L),\n\ttobe(0x6921c1a0L), tobe(0xbb38007cL), tobe(0xc9d35fafL), tobe(0x1bca9e73L),\n\ttobe(0x2c05e009L), tobe(0xfe1c21d5L), tobe(0x8cf77e06L), tobe(0x5eeebfdaL),\n\ttobe(0xf33819e1L), tobe(0x2121d83dL), tobe(0x53ca87eeL), tobe(0x81d34632L),\n\ttobe(0xb61c3848L), tobe(0x6405f994L), tobe(0x16eea647L), tobe(0xc4f7679bL),\n\ttobe(0x79705ab3L), tobe(0xab699b6fL), tobe(0xd982c4bcL), tobe(0x0b9b0560L),\n\ttobe(0x3c547b1aL), tobe(0xee4dbac6L), tobe(0x9ca6e515L), tobe(0x4ebf24c9L)},\n\t{\n\ttobe(0x00000000L), tobe(0x01d8ac87L), tobe(0x03b1590eL), tobe(0x0269f589L),\n\ttobe(0x0762b21cL), tobe(0x06ba1e9bL), tobe(0x04d3eb12L), tobe(0x050b4795L),\n\ttobe(0x0ec56438L), tobe(0x0f1dc8bfL), tobe(0x0d743d36L), tobe(0x0cac91b1L),\n\ttobe(0x09a7d624L), tobe(0x087f7aa3L), tobe(0x0a168f2aL), tobe(0x0bce23adL),\n\ttobe(0x1d8ac870L), tobe(0x1c5264f7L), tobe(0x1e3b917eL), tobe(0x1fe33df9L),\n\ttobe(0x1ae87a6cL), tobe(0x1b30d6ebL), tobe(0x19592362L), tobe(0x18818fe5L),\n\ttobe(0x134fac48L), tobe(0x129700cfL), tobe(0x10fef546L), tobe(0x112659c1L),\n\ttobe(0x142d1e54L), tobe(0x15f5b2d3L), tobe(0x179c475aL), tobe(0x1644ebddL),\n\ttobe(0x3b1590e0L), tobe(0x3acd3c67L), tobe(0x38a4c9eeL), tobe(0x397c6569L),\n\ttobe(0x3c7722fcL), tobe(0x3daf8e7bL), tobe(0x3fc67bf2L), tobe(0x3e1ed775L),\n\ttobe(0x35d0f4d8L), tobe(0x3408585fL), tobe(0x3661add6L), tobe(0x37b90151L),\n\ttobe(0x32b246c4L), tobe(0x336aea43L), tobe(0x31031fcaL), tobe(0x30dbb34dL),\n\ttobe(0x269f5890L), tobe(0x2747f417L), tobe(0x252e019eL), tobe(0x24f6ad19L),\n\ttobe(0x21fdea8cL), tobe(0x2025460bL), tobe(0x224cb382L), tobe(0x23941f05L),\n\ttobe(0x285a3ca8L), tobe(0x2982902fL), tobe(0x2beb65a6L), tobe(0x2a33c921L),\n\ttobe(0x2f388eb4L), tobe(0x2ee02233L), tobe(0x2c89d7baL), tobe(0x2d517b3dL),\n\ttobe(0x762b21c0L), tobe(0x77f38d47L), tobe(0x759a78ceL), tobe(0x7442d449L),\n\ttobe(0x714993dcL), tobe(0x70913f5bL), tobe(0x72f8cad2L), tobe(0x73206655L),\n\ttobe(0x78ee45f8L), tobe(0x7936e97fL), tobe(0x7b5f1cf6L), tobe(0x7a87b071L),\n\ttobe(0x7f8cf7e4L), tobe(0x7e545b63L), tobe(0x7c3daeeaL), tobe(0x7de5026dL),\n\ttobe(0x6ba1e9b0L), tobe(0x6a794537L), tobe(0x6810b0beL), tobe(0x69c81c39L),\n\ttobe(0x6cc35bacL), tobe(0x6d1bf72bL), tobe(0x6f7202a2L), tobe(0x6eaaae25L),\n\ttobe(0x65648d88L), tobe(0x64bc210fL), tobe(0x66d5d486L), tobe(0x670d7801L),\n\ttobe(0x62063f94L), tobe(0x63de9313L), tobe(0x61b7669aL), tobe(0x606fca1dL),\n\ttobe(0x4d3eb120L), tobe(0x4ce61da7L), tobe(0x4e8fe82eL), tobe(0x4f5744a9L),\n\ttobe(0x4a5c033cL), tobe(0x4b84afbbL), tobe(0x49ed5a32L), tobe(0x4835f6b5L),\n\ttobe(0x43fbd518L), tobe(0x4223799fL), tobe(0x404a8c16L), tobe(0x41922091L),\n\ttobe(0x44996704L), tobe(0x4541cb83L), tobe(0x47283e0aL), tobe(0x46f0928dL),\n\ttobe(0x50b47950L), tobe(0x516cd5d7L), tobe(0x5305205eL), tobe(0x52dd8cd9L),\n\ttobe(0x57d6cb4cL), tobe(0x560e67cbL), tobe(0x54679242L), tobe(0x55bf3ec5L),\n\ttobe(0x5e711d68L), tobe(0x5fa9b1efL), tobe(0x5dc04466L), tobe(0x5c18e8e1L),\n\ttobe(0x5913af74L), tobe(0x58cb03f3L), tobe(0x5aa2f67aL), tobe(0x5b7a5afdL),\n\ttobe(0xec564380L), tobe(0xed8eef07L), tobe(0xefe71a8eL), tobe(0xee3fb609L),\n\ttobe(0xeb34f19cL), tobe(0xeaec5d1bL), tobe(0xe885a892L), tobe(0xe95d0415L),\n\ttobe(0xe29327b8L), tobe(0xe34b8b3fL), tobe(0xe1227eb6L), tobe(0xe0fad231L),\n\ttobe(0xe5f195a4L), tobe(0xe4293923L), tobe(0xe640ccaaL), tobe(0xe798602dL),\n\ttobe(0xf1dc8bf0L), tobe(0xf0042777L), tobe(0xf26dd2feL), tobe(0xf3b57e79L),\n\ttobe(0xf6be39ecL), tobe(0xf766956bL), tobe(0xf50f60e2L), tobe(0xf4d7cc65L),\n\ttobe(0xff19efc8L), tobe(0xfec1434fL), tobe(0xfca8b6c6L), tobe(0xfd701a41L),\n\ttobe(0xf87b5dd4L), tobe(0xf9a3f153L), tobe(0xfbca04daL), tobe(0xfa12a85dL),\n\ttobe(0xd743d360L), tobe(0xd69b7fe7L), tobe(0xd4f28a6eL), tobe(0xd52a26e9L),\n\ttobe(0xd021617cL), tobe(0xd1f9cdfbL), tobe(0xd3903872L), tobe(0xd24894f5L),\n\ttobe(0xd986b758L), tobe(0xd85e1bdfL), tobe(0xda37ee56L), tobe(0xdbef42d1L),\n\ttobe(0xdee40544L), tobe(0xdf3ca9c3L), tobe(0xdd555c4aL), tobe(0xdc8df0cdL),\n\ttobe(0xcac91b10L), tobe(0xcb11b797L), tobe(0xc978421eL), tobe(0xc8a0ee99L),\n\ttobe(0xcdaba90cL), tobe(0xcc73058bL), tobe(0xce1af002L), tobe(0xcfc25c85L),\n\ttobe(0xc40c7f28L), tobe(0xc5d4d3afL), tobe(0xc7bd2626L), tobe(0xc6658aa1L),\n\ttobe(0xc36ecd34L), tobe(0xc2b661b3L), tobe(0xc0df943aL), tobe(0xc10738bdL),\n\ttobe(0x9a7d6240L), tobe(0x9ba5cec7L), tobe(0x99cc3b4eL), tobe(0x981497c9L),\n\ttobe(0x9d1fd05cL), tobe(0x9cc77cdbL), tobe(0x9eae8952L), tobe(0x9f7625d5L),\n\ttobe(0x94b80678L), tobe(0x9560aaffL), tobe(0x97095f76L), tobe(0x96d1f3f1L),\n\ttobe(0x93dab464L), tobe(0x920218e3L), tobe(0x906bed6aL), tobe(0x91b341edL),\n\ttobe(0x87f7aa30L), tobe(0x862f06b7L), tobe(0x8446f33eL), tobe(0x859e5fb9L),\n\ttobe(0x8095182cL), tobe(0x814db4abL), tobe(0x83244122L), tobe(0x82fceda5L),\n\ttobe(0x8932ce08L), tobe(0x88ea628fL), tobe(0x8a839706L), tobe(0x8b5b3b81L),\n\ttobe(0x8e507c14L), tobe(0x8f88d093L), tobe(0x8de1251aL), tobe(0x8c39899dL),\n\ttobe(0xa168f2a0L), tobe(0xa0b05e27L), tobe(0xa2d9abaeL), tobe(0xa3010729L),\n\ttobe(0xa60a40bcL), tobe(0xa7d2ec3bL), tobe(0xa5bb19b2L), tobe(0xa463b535L),\n\ttobe(0xafad9698L), tobe(0xae753a1fL), tobe(0xac1ccf96L), tobe(0xadc46311L),\n\ttobe(0xa8cf2484L), tobe(0xa9178803L), tobe(0xab7e7d8aL), tobe(0xaaa6d10dL),\n\ttobe(0xbce23ad0L), tobe(0xbd3a9657L), tobe(0xbf5363deL), tobe(0xbe8bcf59L),\n\ttobe(0xbb8088ccL), tobe(0xba58244bL), tobe(0xb831d1c2L), tobe(0xb9e97d45L),\n\ttobe(0xb2275ee8L), tobe(0xb3fff26fL), tobe(0xb19607e6L), tobe(0xb04eab61L),\n\ttobe(0xb545ecf4L), tobe(0xb49d4073L), tobe(0xb6f4b5faL), tobe(0xb72c197dL)},\n\t{\n\ttobe(0x00000000L), tobe(0xdc6d9ab7L), tobe(0xbc1a28d9L), tobe(0x6077b26eL),\n\ttobe(0x7cf54c05L), tobe(0xa098d6b2L), tobe(0xc0ef64dcL), tobe(0x1c82fe6bL),\n\ttobe(0xf9ea980aL), tobe(0x258702bdL), tobe(0x45f0b0d3L), tobe(0x999d2a64L),\n\ttobe(0x851fd40fL), tobe(0x59724eb8L), tobe(0x3905fcd6L), tobe(0xe5686661L),\n\ttobe(0xf7142da3L), tobe(0x2b79b714L), tobe(0x4b0e057aL), tobe(0x97639fcdL),\n\ttobe(0x8be161a6L), tobe(0x578cfb11L), tobe(0x37fb497fL), tobe(0xeb96d3c8L),\n\ttobe(0x0efeb5a9L), tobe(0xd2932f1eL), tobe(0xb2e49d70L), tobe(0x6e8907c7L),\n\ttobe(0x720bf9acL), tobe(0xae66631bL), tobe(0xce11d175L), tobe(0x127c4bc2L),\n\ttobe(0xeae946f1L), tobe(0x3684dc46L), tobe(0x56f36e28L), tobe(0x8a9ef49fL),\n\ttobe(0x961c0af4L), tobe(0x4a719043L), tobe(0x2a06222dL), tobe(0xf66bb89aL),\n\ttobe(0x1303defbL), tobe(0xcf6e444cL), tobe(0xaf19f622L), tobe(0x73746c95L),\n\ttobe(0x6ff692feL), tobe(0xb39b0849L), tobe(0xd3ecba27L), tobe(0x0f812090L),\n\ttobe(0x1dfd6b52L), tobe(0xc190f1e5L), tobe(0xa1e7438bL), tobe(0x7d8ad93cL),\n\ttobe(0x61082757L), tobe(0xbd65bde0L), tobe(0xdd120f8eL), tobe(0x017f9539L),\n\ttobe(0xe417f358L), tobe(0x387a69efL), tobe(0x580ddb81L), tobe(0x84604136L),\n\ttobe(0x98e2bf5dL), tobe(0x448f25eaL), tobe(0x24f89784L), tobe(0xf8950d33L),\n\ttobe(0xd1139055L), tobe(0x0d7e0ae2L), tobe(0x6d09b88cL), tobe(0xb164223bL),\n\ttobe(0xade6dc50L), tobe(0x718b46e7L), tobe(0x11fcf489L), tobe(0xcd916e3eL),\n\ttobe(0x28f9085fL), tobe(0xf49492e8L), tobe(0x94e32086L), tobe(0x488eba31L),\n\ttobe(0x540c445aL), tobe(0x8861deedL), tobe(0xe8166c83L), tobe(0x347bf634L),\n\ttobe(0x2607bdf6L), tobe(0xfa6a2741L), tobe(0x9a1d952fL), tobe(0x46700f98L),\n\ttobe(0x5af2f1f3L), tobe(0x869f6b44L), tobe(0xe6e8d92aL), tobe(0x3a85439dL),\n\ttobe(0xdfed25fcL), tobe(0x0380bf4bL), tobe(0x63f70d25L), tobe(0xbf9a9792L),\n\ttobe(0xa31869f9L), tobe(0x7f75f34eL), tobe(0x1f024120L), tobe(0xc36fdb97L),\n\ttobe(0x3bfad6a4L), tobe(0xe7974c13L), tobe(0x87e0fe7dL), tobe(0x5b8d64caL),\n\ttobe(0x470f9aa1L), tobe(0x9b620016L), tobe(0xfb15b278L), tobe(0x277828cfL),\n\ttobe(0xc2104eaeL), tobe(0x1e7dd419L), tobe(0x7e0a6677L), tobe(0xa267fcc0L),\n\ttobe(0xbee502abL), tobe(0x6288981cL), tobe(0x02ff2a72L), tobe(0xde92b0c5L),\n\ttobe(0xcceefb07L), tobe(0x108361b0L), tobe(0x70f4d3deL), tobe(0xac994969L),\n\ttobe(0xb01bb702L), tobe(0x6c762db5L), tobe(0x0c019fdbL), tobe(0xd06c056cL),\n\ttobe(0x3504630dL), tobe(0xe969f9baL), tobe(0x891e4bd4L), tobe(0x5573d163L),\n\ttobe(0x49f12f08L), tobe(0x959cb5bfL), tobe(0xf5eb07d1L), tobe(0x29869d66L),\n\ttobe(0xa6e63d1dL), tobe(0x7a8ba7aaL), tobe(0x1afc15c4L), tobe(0xc6918f73L),\n\ttobe(0xda137118L), tobe(0x067eebafL), tobe(0x660959c1L), tobe(0xba64c376L),\n\ttobe(0x5f0ca517L), tobe(0x83613fa0L), tobe(0xe3168dceL), tobe(0x3f7b1779L),\n\ttobe(0x23f9e912L), tobe(0xff9473a5L), tobe(0x9fe3c1cbL), tobe(0x438e5b7cL),\n\ttobe(0x51f210beL), tobe(0x8d9f8a09L), tobe(0xede83867L), tobe(0x3185a2d0L),\n\ttobe(0x2d075cbbL), tobe(0xf16ac60cL), tobe(0x911d7462L), tobe(0x4d70eed5L),\n\ttobe(0xa81888b4L), tobe(0x74751203L), tobe(0x1402a06dL), tobe(0xc86f3adaL),\n\ttobe(0xd4edc4b1L), tobe(0x08805e06L), tobe(0x68f7ec68L), tobe(0xb49a76dfL),\n\ttobe(0x4c0f7becL), tobe(0x9062e15bL), tobe(0xf0155335L), tobe(0x2c78c982L),\n\ttobe(0x30fa37e9L), tobe(0xec97ad5eL), tobe(0x8ce01f30L), tobe(0x508d8587L),\n\ttobe(0xb5e5e3e6L), tobe(0x69887951L), tobe(0x09ffcb3fL), tobe(0xd5925188L),\n\ttobe(0xc910afe3L), tobe(0x157d3554L), tobe(0x750a873aL), tobe(0xa9671d8dL),\n\ttobe(0xbb1b564fL), tobe(0x6776ccf8L), tobe(0x07017e96L), tobe(0xdb6ce421L),\n\ttobe(0xc7ee1a4aL), tobe(0x1b8380fdL), tobe(0x7bf43293L), tobe(0xa799a824L),\n\ttobe(0x42f1ce45L), tobe(0x9e9c54f2L), tobe(0xfeebe69cL), tobe(0x22867c2bL),\n\ttobe(0x3e048240L), tobe(0xe26918f7L), tobe(0x821eaa99L), tobe(0x5e73302eL),\n\ttobe(0x77f5ad48L), tobe(0xab9837ffL), tobe(0xcbef8591L), tobe(0x17821f26L),\n\ttobe(0x0b00e14dL), tobe(0xd76d7bfaL), tobe(0xb71ac994L), tobe(0x6b775323L),\n\ttobe(0x8e1f3542L), tobe(0x5272aff5L), tobe(0x32051d9bL), tobe(0xee68872cL),\n\ttobe(0xf2ea7947L), tobe(0x2e87e3f0L), tobe(0x4ef0519eL), tobe(0x929dcb29L),\n\ttobe(0x80e180ebL), tobe(0x5c8c1a5cL), tobe(0x3cfba832L), tobe(0xe0963285L),\n\ttobe(0xfc14cceeL), tobe(0x20795659L), tobe(0x400ee437L), tobe(0x9c637e80L),\n\ttobe(0x790b18e1L), tobe(0xa5668256L), tobe(0xc5113038L), tobe(0x197caa8fL),\n\ttobe(0x05fe54e4L), tobe(0xd993ce53L), tobe(0xb9e47c3dL), tobe(0x6589e68aL),\n\ttobe(0x9d1cebb9L), tobe(0x4171710eL), tobe(0x2106c360L), tobe(0xfd6b59d7L),\n\ttobe(0xe1e9a7bcL), tobe(0x3d843d0bL), tobe(0x5df38f65L), tobe(0x819e15d2L),\n\ttobe(0x64f673b3L), tobe(0xb89be904L), tobe(0xd8ec5b6aL), tobe(0x0481c1ddL),\n\ttobe(0x18033fb6L), tobe(0xc46ea501L), tobe(0xa419176fL), tobe(0x78748dd8L),\n\ttobe(0x6a08c61aL), tobe(0xb6655cadL), tobe(0xd612eec3L), tobe(0x0a7f7474L),\n\ttobe(0x16fd8a1fL), tobe(0xca9010a8L), tobe(0xaae7a2c6L), tobe(0x768a3871L),\n\ttobe(0x93e25e10L), tobe(0x4f8fc4a7L), tobe(0x2ff876c9L), tobe(0xf395ec7eL),\n\ttobe(0xef171215L), tobe(0x337a88a2L), tobe(0x530d3accL), tobe(0x8f60a07bL)},\n\t{\n\ttobe(0x00000000L), tobe(0x490d678dL), tobe(0x921acf1aL), tobe(0xdb17a897L),\n\ttobe(0x20f48383L), tobe(0x69f9e40eL), tobe(0xb2ee4c99L), tobe(0xfbe32b14L),\n\ttobe(0x41e90706L), tobe(0x08e4608bL), tobe(0xd3f3c81cL), tobe(0x9afeaf91L),\n\ttobe(0x611d8485L), tobe(0x2810e308L), tobe(0xf3074b9fL), tobe(0xba0a2c12L),\n\ttobe(0x83d20e0cL), tobe(0xcadf6981L), tobe(0x11c8c116L), tobe(0x58c5a69bL),\n\ttobe(0xa3268d8fL), tobe(0xea2bea02L), tobe(0x313c4295L), tobe(0x78312518L),\n\ttobe(0xc23b090aL), tobe(0x8b366e87L), tobe(0x5021c610L), tobe(0x192ca19dL),\n\ttobe(0xe2cf8a89L), tobe(0xabc2ed04L), tobe(0x70d54593L), tobe(0x39d8221eL),\n\ttobe(0x036501afL), tobe(0x4a686622L), tobe(0x917fceb5L), tobe(0xd872a938L),\n\ttobe(0x2391822cL), tobe(0x6a9ce5a1L), tobe(0xb18b4d36L), tobe(0xf8862abbL),\n\ttobe(0x428c06a9L), tobe(0x0b816124L), tobe(0xd096c9b3L), tobe(0x999bae3eL),\n\ttobe(0x6278852aL), tobe(0x2b75e2a7L), tobe(0xf0624a30L), tobe(0xb96f2dbdL),\n\ttobe(0x80b70fa3L), tobe(0xc9ba682eL), tobe(0x12adc0b9L), tobe(0x5ba0a734L),\n\ttobe(0xa0438c20L), tobe(0xe94eebadL), tobe(0x3259433aL), tobe(0x7b5424b7L),\n\ttobe(0xc15e08a5L), tobe(0x88536f28L), tobe(0x5344c7bfL), tobe(0x1a49a032L),\n\ttobe(0xe1aa8b26L), tobe(0xa8a7ecabL), tobe(0x73b0443cL), tobe(0x3abd23b1L),\n\ttobe(0x06ca035eL), tobe(0x4fc764d3L), tobe(0x94d0cc44L), tobe(0xddddabc9L),\n\ttobe(0x263e80ddL), tobe(0x6f33e750L), tobe(0xb4244fc7L), tobe(0xfd29284aL),\n\ttobe(0x47230458L), tobe(0x0e2e63d5L), tobe(0xd539cb42L), tobe(0x9c34accfL),\n\ttobe(0x67d787dbL), tobe(0x2edae056L), tobe(0xf5cd48c1L), tobe(0xbcc02f4cL),\n\ttobe(0x85180d52L), tobe(0xcc156adfL), tobe(0x1702c248L), tobe(0x5e0fa5c5L),\n\ttobe(0xa5ec8ed1L), tobe(0xece1e95cL), tobe(0x37f641cbL), tobe(0x7efb2646L),\n\ttobe(0xc4f10a54L), tobe(0x8dfc6dd9L), tobe(0x56ebc54eL), tobe(0x1fe6a2c3L),\n\ttobe(0xe40589d7L), tobe(0xad08ee5aL), tobe(0x761f46cdL), tobe(0x3f122140L),\n\ttobe(0x05af02f1L), tobe(0x4ca2657cL), tobe(0x97b5cdebL), tobe(0xdeb8aa66L),\n\ttobe(0x255b8172L), tobe(0x6c56e6ffL), tobe(0xb7414e68L), tobe(0xfe4c29e5L),\n\ttobe(0x444605f7L), tobe(0x0d4b627aL), tobe(0xd65ccaedL), tobe(0x9f51ad60L),\n\ttobe(0x64b28674L), tobe(0x2dbfe1f9L), tobe(0xf6a8496eL), tobe(0xbfa52ee3L),\n\ttobe(0x867d0cfdL), tobe(0xcf706b70L), tobe(0x1467c3e7L), tobe(0x5d6aa46aL),\n\ttobe(0xa6898f7eL), tobe(0xef84e8f3L), tobe(0x34934064L), tobe(0x7d9e27e9L),\n\ttobe(0xc7940bfbL), tobe(0x8e996c76L), tobe(0x558ec4e1L), tobe(0x1c83a36cL),\n\ttobe(0xe7608878L), tobe(0xae6deff5L), tobe(0x757a4762L), tobe(0x3c7720efL),\n\ttobe(0x0d9406bcL), tobe(0x44996131L), tobe(0x9f8ec9a6L), tobe(0xd683ae2bL),\n\ttobe(0x2d60853fL), tobe(0x646de2b2L), tobe(0xbf7a4a25L), tobe(0xf6772da8L),\n\ttobe(0x4c7d01baL), tobe(0x05706637L), tobe(0xde67cea0L), tobe(0x976aa92dL),\n\ttobe(0x6c898239L), tobe(0x2584e5b4L), tobe(0xfe934d23L), tobe(0xb79e2aaeL),\n\ttobe(0x8e4608b0L), tobe(0xc74b6f3dL), tobe(0x1c5cc7aaL), tobe(0x5551a027L),\n\ttobe(0xaeb28b33L), tobe(0xe7bfecbeL), tobe(0x3ca84429L), tobe(0x75a523a4L),\n\ttobe(0xcfaf0fb6L), tobe(0x86a2683bL), tobe(0x5db5c0acL), tobe(0x14b8a721L),\n\ttobe(0xef5b8c35L), tobe(0xa656ebb8L), tobe(0x7d41432fL), tobe(0x344c24a2L),\n\ttobe(0x0ef10713L), tobe(0x47fc609eL), tobe(0x9cebc809L), tobe(0xd5e6af84L),\n\ttobe(0x2e058490L), tobe(0x6708e31dL), tobe(0xbc1f4b8aL), tobe(0xf5122c07L),\n\ttobe(0x4f180015L), tobe(0x06156798L), tobe(0xdd02cf0fL), tobe(0x940fa882L),\n\ttobe(0x6fec8396L), tobe(0x26e1e41bL), tobe(0xfdf64c8cL), tobe(0xb4fb2b01L),\n\ttobe(0x8d23091fL), tobe(0xc42e6e92L), tobe(0x1f39c605L), tobe(0x5634a188L),\n\ttobe(0xadd78a9cL), tobe(0xe4daed11L), tobe(0x3fcd4586L), tobe(0x76c0220bL),\n\ttobe(0xccca0e19L), tobe(0x85c76994L), tobe(0x5ed0c103L), tobe(0x17dda68eL),\n\ttobe(0xec3e8d9aL), tobe(0xa533ea17L), tobe(0x7e244280L), tobe(0x3729250dL),\n\ttobe(0x0b5e05e2L), tobe(0x4253626fL), tobe(0x9944caf8L), tobe(0xd049ad75L),\n\ttobe(0x2baa8661L), tobe(0x62a7e1ecL), tobe(0xb9b0497bL), tobe(0xf0bd2ef6L),\n\ttobe(0x4ab702e4L), tobe(0x03ba6569L), tobe(0xd8adcdfeL), tobe(0x91a0aa73L),\n\ttobe(0x6a438167L), tobe(0x234ee6eaL), tobe(0xf8594e7dL), tobe(0xb15429f0L),\n\ttobe(0x888c0beeL), tobe(0xc1816c63L), tobe(0x1a96c4f4L), tobe(0x539ba379L),\n\ttobe(0xa878886dL), tobe(0xe175efe0L), tobe(0x3a624777L), tobe(0x736f20faL),\n\ttobe(0xc9650ce8L), tobe(0x80686b65L), tobe(0x5b7fc3f2L), tobe(0x1272a47fL),\n\ttobe(0xe9918f6bL), tobe(0xa09ce8e6L), tobe(0x7b8b4071L), tobe(0x328627fcL),\n\ttobe(0x083b044dL), tobe(0x413663c0L), tobe(0x9a21cb57L), tobe(0xd32cacdaL),\n\ttobe(0x28cf87ceL), tobe(0x61c2e043L), tobe(0xbad548d4L), tobe(0xf3d82f59L),\n\ttobe(0x49d2034bL), tobe(0x00df64c6L), tobe(0xdbc8cc51L), tobe(0x92c5abdcL),\n\ttobe(0x692680c8L), tobe(0x202be745L), tobe(0xfb3c4fd2L), tobe(0xb231285fL),\n\ttobe(0x8be90a41L), tobe(0xc2e46dccL), tobe(0x19f3c55bL), tobe(0x50fea2d6L),\n\ttobe(0xab1d89c2L), tobe(0xe210ee4fL), tobe(0x390746d8L), tobe(0x700a2155L),\n\ttobe(0xca000d47L), tobe(0x830d6acaL), tobe(0x581ac25dL), tobe(0x1117a5d0L),\n\ttobe(0xeaf48ec4L), tobe(0xa3f9e949L), tobe(0x78ee41deL), tobe(0x31e32653L)},\n\t{\n\ttobe(0x00000000L), tobe(0x1b280d78L), tobe(0x36501af0L), tobe(0x2d781788L),\n\ttobe(0x6ca035e0L), tobe(0x77883898L), tobe(0x5af02f10L), tobe(0x41d82268L),\n\ttobe(0xd9406bc0L), tobe(0xc26866b8L), tobe(0xef107130L), tobe(0xf4387c48L),\n\ttobe(0xb5e05e20L), tobe(0xaec85358L), tobe(0x83b044d0L), tobe(0x989849a8L),\n\ttobe(0xb641ca37L), tobe(0xad69c74fL), tobe(0x8011d0c7L), tobe(0x9b39ddbfL),\n\ttobe(0xdae1ffd7L), tobe(0xc1c9f2afL), tobe(0xecb1e527L), tobe(0xf799e85fL),\n\ttobe(0x6f01a1f7L), tobe(0x7429ac8fL), tobe(0x5951bb07L), tobe(0x4279b67fL),\n\ttobe(0x03a19417L), tobe(0x1889996fL), tobe(0x35f18ee7L), tobe(0x2ed9839fL),\n\ttobe(0x684289d9L), tobe(0x736a84a1L), tobe(0x5e129329L), tobe(0x453a9e51L),\n\ttobe(0x04e2bc39L), tobe(0x1fcab141L), tobe(0x32b2a6c9L), tobe(0x299aabb1L),\n\ttobe(0xb102e219L), tobe(0xaa2aef61L), tobe(0x8752f8e9L), tobe(0x9c7af591L),\n\ttobe(0xdda2d7f9L), tobe(0xc68ada81L), tobe(0xebf2cd09L), tobe(0xf0dac071L),\n\ttobe(0xde0343eeL), tobe(0xc52b4e96L), tobe(0xe853591eL), tobe(0xf37b5466L),\n\ttobe(0xb2a3760eL), tobe(0xa98b7b76L), tobe(0x84f36cfeL), tobe(0x9fdb6186L),\n\ttobe(0x0743282eL), tobe(0x1c6b2556L), tobe(0x311332deL), tobe(0x2a3b3fa6L),\n\ttobe(0x6be31dceL), tobe(0x70cb10b6L), tobe(0x5db3073eL), tobe(0x469b0a46L),\n\ttobe(0xd08513b2L), tobe(0xcbad1ecaL), tobe(0xe6d50942L), tobe(0xfdfd043aL),\n\ttobe(0xbc252652L), tobe(0xa70d2b2aL), tobe(0x8a753ca2L), tobe(0x915d31daL),\n\ttobe(0x09c57872L), tobe(0x12ed750aL), tobe(0x3f956282L), tobe(0x24bd6ffaL),\n\ttobe(0x65654d92L), tobe(0x7e4d40eaL), tobe(0x53355762L), tobe(0x481d5a1aL),\n\ttobe(0x66c4d985L), tobe(0x7decd4fdL), tobe(0x5094c375L), tobe(0x4bbcce0dL),\n\ttobe(0x0a64ec65L), tobe(0x114ce11dL), tobe(0x3c34f695L), tobe(0x271cfbedL),\n\ttobe(0xbf84b245L), tobe(0xa4acbf3dL), tobe(0x89d4a8b5L), tobe(0x92fca5cdL),\n\ttobe(0xd32487a5L), tobe(0xc80c8addL), tobe(0xe5749d55L), tobe(0xfe5c902dL),\n\ttobe(0xb8c79a6bL), tobe(0xa3ef9713L), tobe(0x8e97809bL), tobe(0x95bf8de3L),\n\ttobe(0xd467af8bL), tobe(0xcf4fa2f3L), tobe(0xe237b57bL), tobe(0xf91fb803L),\n\ttobe(0x6187f1abL), tobe(0x7aaffcd3L), tobe(0x57d7eb5bL), tobe(0x4cffe623L),\n\ttobe(0x0d27c44bL), tobe(0x160fc933L), tobe(0x3b77debbL), tobe(0x205fd3c3L),\n\ttobe(0x0e86505cL), tobe(0x15ae5d24L), tobe(0x38d64aacL), tobe(0x23fe47d4L),\n\ttobe(0x622665bcL), tobe(0x790e68c4L), tobe(0x54767f4cL), tobe(0x4f5e7234L),\n\ttobe(0xd7c63b9cL), tobe(0xccee36e4L), tobe(0xe196216cL), tobe(0xfabe2c14L),\n\ttobe(0xbb660e7cL), tobe(0xa04e0304L), tobe(0x8d36148cL), tobe(0x961e19f4L),\n\ttobe(0xa5cb3ad3L), tobe(0xbee337abL), tobe(0x939b2023L), tobe(0x88b32d5bL),\n\ttobe(0xc96b0f33L), tobe(0xd243024bL), tobe(0xff3b15c3L), tobe(0xe41318bbL),\n\ttobe(0x7c8b5113L), tobe(0x67a35c6bL), tobe(0x4adb4be3L), tobe(0x51f3469bL),\n\ttobe(0x102b64f3L), tobe(0x0b03698bL), tobe(0x267b7e03L), tobe(0x3d53737bL),\n\ttobe(0x138af0e4L), tobe(0x08a2fd9cL), tobe(0x25daea14L), tobe(0x3ef2e76cL),\n\ttobe(0x7f2ac504L), tobe(0x6402c87cL), tobe(0x497adff4L), tobe(0x5252d28cL),\n\ttobe(0xcaca9b24L), tobe(0xd1e2965cL), tobe(0xfc9a81d4L), tobe(0xe7b28cacL),\n\ttobe(0xa66aaec4L), tobe(0xbd42a3bcL), tobe(0x903ab434L), tobe(0x8b12b94cL),\n\ttobe(0xcd89b30aL), tobe(0xd6a1be72L), tobe(0xfbd9a9faL), tobe(0xe0f1a482L),\n\ttobe(0xa12986eaL), tobe(0xba018b92L), tobe(0x97799c1aL), tobe(0x8c519162L),\n\ttobe(0x14c9d8caL), tobe(0x0fe1d5b2L), tobe(0x2299c23aL), tobe(0x39b1cf42L),\n\ttobe(0x7869ed2aL), tobe(0x6341e052L), tobe(0x4e39f7daL), tobe(0x5511faa2L),\n\ttobe(0x7bc8793dL), tobe(0x60e07445L), tobe(0x4d9863cdL), tobe(0x56b06eb5L),\n\ttobe(0x17684cddL), tobe(0x0c4041a5L), tobe(0x2138562dL), tobe(0x3a105b55L),\n\ttobe(0xa28812fdL), tobe(0xb9a01f85L), tobe(0x94d8080dL), tobe(0x8ff00575L),\n\ttobe(0xce28271dL), tobe(0xd5002a65L), tobe(0xf8783dedL), tobe(0xe3503095L),\n\ttobe(0x754e2961L), tobe(0x6e662419L), tobe(0x431e3391L), tobe(0x58363ee9L),\n\ttobe(0x19ee1c81L), tobe(0x02c611f9L), tobe(0x2fbe0671L), tobe(0x34960b09L),\n\ttobe(0xac0e42a1L), tobe(0xb7264fd9L), tobe(0x9a5e5851L), tobe(0x81765529L),\n\ttobe(0xc0ae7741L), tobe(0xdb867a39L), tobe(0xf6fe6db1L), tobe(0xedd660c9L),\n\ttobe(0xc30fe356L), tobe(0xd827ee2eL), tobe(0xf55ff9a6L), tobe(0xee77f4deL),\n\ttobe(0xafafd6b6L), tobe(0xb487dbceL), tobe(0x99ffcc46L), tobe(0x82d7c13eL),\n\ttobe(0x1a4f8896L), tobe(0x016785eeL), tobe(0x2c1f9266L), tobe(0x37379f1eL),\n\ttobe(0x76efbd76L), tobe(0x6dc7b00eL), tobe(0x40bfa786L), tobe(0x5b97aafeL),\n\ttobe(0x1d0ca0b8L), tobe(0x0624adc0L), tobe(0x2b5cba48L), tobe(0x3074b730L),\n\ttobe(0x71ac9558L), tobe(0x6a849820L), tobe(0x47fc8fa8L), tobe(0x5cd482d0L),\n\ttobe(0xc44ccb78L), tobe(0xdf64c600L), tobe(0xf21cd188L), tobe(0xe934dcf0L),\n\ttobe(0xa8ecfe98L), tobe(0xb3c4f3e0L), tobe(0x9ebce468L), tobe(0x8594e910L),\n\ttobe(0xab4d6a8fL), tobe(0xb06567f7L), tobe(0x9d1d707fL), tobe(0x86357d07L),\n\ttobe(0xc7ed5f6fL), tobe(0xdcc55217L), tobe(0xf1bd459fL), tobe(0xea9548e7L),\n\ttobe(0x720d014fL), tobe(0x69250c37L), tobe(0x445d1bbfL), tobe(0x5f7516c7L),\n\ttobe(0x1ead34afL), tobe(0x058539d7L), tobe(0x28fd2e5fL), tobe(0x33d52327L)},\n\t{\n\ttobe(0x00000000L), tobe(0x4f576811L), tobe(0x9eaed022L), tobe(0xd1f9b833L),\n\ttobe(0x399cbdf3L), tobe(0x76cbd5e2L), tobe(0xa7326dd1L), tobe(0xe86505c0L),\n\ttobe(0x73397be6L), tobe(0x3c6e13f7L), tobe(0xed97abc4L), tobe(0xa2c0c3d5L),\n\ttobe(0x4aa5c615L), tobe(0x05f2ae04L), tobe(0xd40b1637L), tobe(0x9b5c7e26L),\n\ttobe(0xe672f7ccL), tobe(0xa9259fddL), tobe(0x78dc27eeL), tobe(0x378b4fffL),\n\ttobe(0xdfee4a3fL), tobe(0x90b9222eL), tobe(0x41409a1dL), tobe(0x0e17f20cL),\n\ttobe(0x954b8c2aL), tobe(0xda1ce43bL), tobe(0x0be55c08L), tobe(0x44b23419L),\n\ttobe(0xacd731d9L), tobe(0xe38059c8L), tobe(0x3279e1fbL), tobe(0x7d2e89eaL),\n\ttobe(0xc824f22fL), tobe(0x87739a3eL), tobe(0x568a220dL), tobe(0x19dd4a1cL),\n\ttobe(0xf1b84fdcL), tobe(0xbeef27cdL), tobe(0x6f169ffeL), tobe(0x2041f7efL),\n\ttobe(0xbb1d89c9L), tobe(0xf44ae1d8L), tobe(0x25b359ebL), tobe(0x6ae431faL),\n\ttobe(0x8281343aL), tobe(0xcdd65c2bL), tobe(0x1c2fe418L), tobe(0x53788c09L),\n\ttobe(0x2e5605e3L), tobe(0x61016df2L), tobe(0xb0f8d5c1L), tobe(0xffafbdd0L),\n\ttobe(0x17cab810L), tobe(0x589dd001L), tobe(0x89646832L), tobe(0xc6330023L),\n\ttobe(0x5d6f7e05L), tobe(0x12381614L), tobe(0xc3c1ae27L), tobe(0x8c96c636L),\n\ttobe(0x64f3c3f6L), tobe(0x2ba4abe7L), tobe(0xfa5d13d4L), tobe(0xb50a7bc5L),\n\ttobe(0x9488f9e9L), tobe(0xdbdf91f8L), tobe(0x0a2629cbL), tobe(0x457141daL),\n\ttobe(0xad14441aL), tobe(0xe2432c0bL), tobe(0x33ba9438L), tobe(0x7cedfc29L),\n\ttobe(0xe7b1820fL), tobe(0xa8e6ea1eL), tobe(0x791f522dL), tobe(0x36483a3cL),\n\ttobe(0xde2d3ffcL), tobe(0x917a57edL), tobe(0x4083efdeL), tobe(0x0fd487cfL),\n\ttobe(0x72fa0e25L), tobe(0x3dad6634L), tobe(0xec54de07L), tobe(0xa303b616L),\n\ttobe(0x4b66b3d6L), tobe(0x0431dbc7L), tobe(0xd5c863f4L), tobe(0x9a9f0be5L),\n\ttobe(0x01c375c3L), tobe(0x4e941dd2L), tobe(0x9f6da5e1L), tobe(0xd03acdf0L),\n\ttobe(0x385fc830L), tobe(0x7708a021L), tobe(0xa6f11812L), tobe(0xe9a67003L),\n\ttobe(0x5cac0bc6L), tobe(0x13fb63d7L), tobe(0xc202dbe4L), tobe(0x8d55b3f5L),\n\ttobe(0x6530b635L), tobe(0x2a67de24L), tobe(0xfb9e6617L), tobe(0xb4c90e06L),\n\ttobe(0x2f957020L), tobe(0x60c21831L), tobe(0xb13ba002L), tobe(0xfe6cc813L),\n\ttobe(0x1609cdd3L), tobe(0x595ea5c2L), tobe(0x88a71df1L), tobe(0xc7f075e0L),\n\ttobe(0xbadefc0aL), tobe(0xf589941bL), tobe(0x24702c28L), tobe(0x6b274439L),\n\ttobe(0x834241f9L), tobe(0xcc1529e8L), tobe(0x1dec91dbL), tobe(0x52bbf9caL),\n\ttobe(0xc9e787ecL), tobe(0x86b0effdL), tobe(0x574957ceL), tobe(0x181e3fdfL),\n\ttobe(0xf07b3a1fL), tobe(0xbf2c520eL), tobe(0x6ed5ea3dL), tobe(0x2182822cL),\n\ttobe(0x2dd0ee65L), tobe(0x62878674L), tobe(0xb37e3e47L), tobe(0xfc295656L),\n\ttobe(0x144c5396L), tobe(0x5b1b3b87L), tobe(0x8ae283b4L), tobe(0xc5b5eba5L),\n\ttobe(0x5ee99583L), tobe(0x11befd92L), tobe(0xc04745a1L), tobe(0x8f102db0L),\n\ttobe(0x67752870L), tobe(0x28224061L), tobe(0xf9dbf852L), tobe(0xb68c9043L),\n\ttobe(0xcba219a9L), tobe(0x84f571b8L), tobe(0x550cc98bL), tobe(0x1a5ba19aL),\n\ttobe(0xf23ea45aL), tobe(0xbd69cc4bL), tobe(0x6c907478L), tobe(0x23c71c69L),\n\ttobe(0xb89b624fL), tobe(0xf7cc0a5eL), tobe(0x2635b26dL), tobe(0x6962da7cL),\n\ttobe(0x8107dfbcL), tobe(0xce50b7adL), tobe(0x1fa90f9eL), tobe(0x50fe678fL),\n\ttobe(0xe5f41c4aL), tobe(0xaaa3745bL), tobe(0x7b5acc68L), tobe(0x340da479L),\n\ttobe(0xdc68a1b9L), tobe(0x933fc9a8L), tobe(0x42c6719bL), tobe(0x0d91198aL),\n\ttobe(0x96cd67acL), tobe(0xd99a0fbdL), tobe(0x0863b78eL), tobe(0x4734df9fL),\n\ttobe(0xaf51da5fL), tobe(0xe006b24eL), tobe(0x31ff0a7dL), tobe(0x7ea8626cL),\n\ttobe(0x0386eb86L), tobe(0x4cd18397L), tobe(0x9d283ba4L), tobe(0xd27f53b5L),\n\ttobe(0x3a1a5675L), tobe(0x754d3e64L), tobe(0xa4b48657L), tobe(0xebe3ee46L),\n\ttobe(0x70bf9060L), tobe(0x3fe8f871L), tobe(0xee114042L), tobe(0xa1462853L),\n\ttobe(0x49232d93L), tobe(0x06744582L), tobe(0xd78dfdb1L), tobe(0x98da95a0L),\n\ttobe(0xb958178cL), tobe(0xf60f7f9dL), tobe(0x27f6c7aeL), tobe(0x68a1afbfL),\n\ttobe(0x80c4aa7fL), tobe(0xcf93c26eL), tobe(0x1e6a7a5dL), tobe(0x513d124cL),\n\ttobe(0xca616c6aL), tobe(0x8536047bL), tobe(0x54cfbc48L), tobe(0x1b98d459L),\n\ttobe(0xf3fdd199L), tobe(0xbcaab988L), tobe(0x6d5301bbL), tobe(0x220469aaL),\n\ttobe(0x5f2ae040L), tobe(0x107d8851L), tobe(0xc1843062L), tobe(0x8ed35873L),\n\ttobe(0x66b65db3L), tobe(0x29e135a2L), tobe(0xf8188d91L), tobe(0xb74fe580L),\n\ttobe(0x2c139ba6L), tobe(0x6344f3b7L), tobe(0xb2bd4b84L), tobe(0xfdea2395L),\n\ttobe(0x158f2655L), tobe(0x5ad84e44L), tobe(0x8b21f677L), tobe(0xc4769e66L),\n\ttobe(0x717ce5a3L), tobe(0x3e2b8db2L), tobe(0xefd23581L), tobe(0xa0855d90L),\n\ttobe(0x48e05850L), tobe(0x07b73041L), tobe(0xd64e8872L), tobe(0x9919e063L),\n\ttobe(0x02459e45L), tobe(0x4d12f654L), tobe(0x9ceb4e67L), tobe(0xd3bc2676L),\n\ttobe(0x3bd923b6L), tobe(0x748e4ba7L), tobe(0xa577f394L), tobe(0xea209b85L),\n\ttobe(0x970e126fL), tobe(0xd8597a7eL), tobe(0x09a0c24dL), tobe(0x46f7aa5cL),\n\ttobe(0xae92af9cL), tobe(0xe1c5c78dL), tobe(0x303c7fbeL), tobe(0x7f6b17afL),\n\ttobe(0xe4376989L), tobe(0xab600198L), tobe(0x7a99b9abL), tobe(0x35ced1baL),\n\ttobe(0xddabd47aL), tobe(0x92fcbc6bL), tobe(0x43050458L), tobe(0x0c526c49L)},\n\t{\n\ttobe(0x00000000L), tobe(0x5ba1dccaL), tobe(0xb743b994L), tobe(0xece2655eL),\n\ttobe(0x6a466e9fL), tobe(0x31e7b255L), tobe(0xdd05d70bL), tobe(0x86a40bc1L),\n\ttobe(0xd48cdd3eL), tobe(0x8f2d01f4L), tobe(0x63cf64aaL), tobe(0x386eb860L),\n\ttobe(0xbecab3a1L), tobe(0xe56b6f6bL), tobe(0x09890a35L), tobe(0x5228d6ffL),\n\ttobe(0xadd8a7cbL), tobe(0xf6797b01L), tobe(0x1a9b1e5fL), tobe(0x413ac295L),\n\ttobe(0xc79ec954L), tobe(0x9c3f159eL), tobe(0x70dd70c0L), tobe(0x2b7cac0aL),\n\ttobe(0x79547af5L), tobe(0x22f5a63fL), tobe(0xce17c361L), tobe(0x95b61fabL),\n\ttobe(0x1312146aL), tobe(0x48b3c8a0L), tobe(0xa451adfeL), tobe(0xfff07134L),\n\ttobe(0x5f705221L), tobe(0x04d18eebL), tobe(0xe833ebb5L), tobe(0xb392377fL),\n\ttobe(0x35363cbeL), tobe(0x6e97e074L), tobe(0x8275852aL), tobe(0xd9d459e0L),\n\ttobe(0x8bfc8f1fL), tobe(0xd05d53d5L), tobe(0x3cbf368bL), tobe(0x671eea41L),\n\ttobe(0xe1bae180L), tobe(0xba1b3d4aL), tobe(0x56f95814L), tobe(0x0d5884deL),\n\ttobe(0xf2a8f5eaL), tobe(0xa9092920L), tobe(0x45eb4c7eL), tobe(0x1e4a90b4L),\n\ttobe(0x98ee9b75L), tobe(0xc34f47bfL), tobe(0x2fad22e1L), tobe(0x740cfe2bL),\n\ttobe(0x262428d4L), tobe(0x7d85f41eL), tobe(0x91679140L), tobe(0xcac64d8aL),\n\ttobe(0x4c62464bL), tobe(0x17c39a81L), tobe(0xfb21ffdfL), tobe(0xa0802315L),\n\ttobe(0xbee0a442L), tobe(0xe5417888L), tobe(0x09a31dd6L), tobe(0x5202c11cL),\n\ttobe(0xd4a6caddL), tobe(0x8f071617L), tobe(0x63e57349L), tobe(0x3844af83L),\n\ttobe(0x6a6c797cL), tobe(0x31cda5b6L), tobe(0xdd2fc0e8L), tobe(0x868e1c22L),\n\ttobe(0x002a17e3L), tobe(0x5b8bcb29L), tobe(0xb769ae77L), tobe(0xecc872bdL),\n\ttobe(0x13380389L), tobe(0x4899df43L), tobe(0xa47bba1dL), tobe(0xffda66d7L),\n\ttobe(0x797e6d16L), tobe(0x22dfb1dcL), tobe(0xce3dd482L), tobe(0x959c0848L),\n\ttobe(0xc7b4deb7L), tobe(0x9c15027dL), tobe(0x70f76723L), tobe(0x2b56bbe9L),\n\ttobe(0xadf2b028L), tobe(0xf6536ce2L), tobe(0x1ab109bcL), tobe(0x4110d576L),\n\ttobe(0xe190f663L), tobe(0xba312aa9L), tobe(0x56d34ff7L), tobe(0x0d72933dL),\n\ttobe(0x8bd698fcL), tobe(0xd0774436L), tobe(0x3c952168L), tobe(0x6734fda2L),\n\ttobe(0x351c2b5dL), tobe(0x6ebdf797L), tobe(0x825f92c9L), tobe(0xd9fe4e03L),\n\ttobe(0x5f5a45c2L), tobe(0x04fb9908L), tobe(0xe819fc56L), tobe(0xb3b8209cL),\n\ttobe(0x4c4851a8L), tobe(0x17e98d62L), tobe(0xfb0be83cL), tobe(0xa0aa34f6L),\n\ttobe(0x260e3f37L), tobe(0x7dafe3fdL), tobe(0x914d86a3L), tobe(0xcaec5a69L),\n\ttobe(0x98c48c96L), tobe(0xc365505cL), tobe(0x2f873502L), tobe(0x7426e9c8L),\n\ttobe(0xf282e209L), tobe(0xa9233ec3L), tobe(0x45c15b9dL), tobe(0x1e608757L),\n\ttobe(0x79005533L), tobe(0x22a189f9L), tobe(0xce43eca7L), tobe(0x95e2306dL),\n\ttobe(0x13463bacL), tobe(0x48e7e766L), tobe(0xa4058238L), tobe(0xffa45ef2L),\n\ttobe(0xad8c880dL), tobe(0xf62d54c7L), tobe(0x1acf3199L), tobe(0x416eed53L),\n\ttobe(0xc7cae692L), tobe(0x9c6b3a58L), tobe(0x70895f06L), tobe(0x2b2883ccL),\n\ttobe(0xd4d8f2f8L), tobe(0x8f792e32L), tobe(0x639b4b6cL), tobe(0x383a97a6L),\n\ttobe(0xbe9e9c67L), tobe(0xe53f40adL), tobe(0x09dd25f3L), tobe(0x527cf939L),\n\ttobe(0x00542fc6L), tobe(0x5bf5f30cL), tobe(0xb7179652L), tobe(0xecb64a98L),\n\ttobe(0x6a124159L), tobe(0x31b39d93L), tobe(0xdd51f8cdL), tobe(0x86f02407L),\n\ttobe(0x26700712L), tobe(0x7dd1dbd8L), tobe(0x9133be86L), tobe(0xca92624cL),\n\ttobe(0x4c36698dL), tobe(0x1797b547L), tobe(0xfb75d019L), tobe(0xa0d40cd3L),\n\ttobe(0xf2fcda2cL), tobe(0xa95d06e6L), tobe(0x45bf63b8L), tobe(0x1e1ebf72L),\n\ttobe(0x98bab4b3L), tobe(0xc31b6879L), tobe(0x2ff90d27L), tobe(0x7458d1edL),\n\ttobe(0x8ba8a0d9L), tobe(0xd0097c13L), tobe(0x3ceb194dL), tobe(0x674ac587L),\n\ttobe(0xe1eece46L), tobe(0xba4f128cL), tobe(0x56ad77d2L), tobe(0x0d0cab18L),\n\ttobe(0x5f247de7L), tobe(0x0485a12dL), tobe(0xe867c473L), tobe(0xb3c618b9L),\n\ttobe(0x35621378L), tobe(0x6ec3cfb2L), tobe(0x8221aaecL), tobe(0xd9807626L),\n\ttobe(0xc7e0f171L), tobe(0x9c412dbbL), tobe(0x70a348e5L), tobe(0x2b02942fL),\n\ttobe(0xada69feeL), tobe(0xf6074324L), tobe(0x1ae5267aL), tobe(0x4144fab0L),\n\ttobe(0x136c2c4fL), tobe(0x48cdf085L), tobe(0xa42f95dbL), tobe(0xff8e4911L),\n\ttobe(0x792a42d0L), tobe(0x228b9e1aL), tobe(0xce69fb44L), tobe(0x95c8278eL),\n\ttobe(0x6a3856baL), tobe(0x31998a70L), tobe(0xdd7bef2eL), tobe(0x86da33e4L),\n\ttobe(0x007e3825L), tobe(0x5bdfe4efL), tobe(0xb73d81b1L), tobe(0xec9c5d7bL),\n\ttobe(0xbeb48b84L), tobe(0xe515574eL), tobe(0x09f73210L), tobe(0x5256eedaL),\n\ttobe(0xd4f2e51bL), tobe(0x8f5339d1L), tobe(0x63b15c8fL), tobe(0x38108045L),\n\ttobe(0x9890a350L), tobe(0xc3317f9aL), tobe(0x2fd31ac4L), tobe(0x7472c60eL),\n\ttobe(0xf2d6cdcfL), tobe(0xa9771105L), tobe(0x4595745bL), tobe(0x1e34a891L),\n\ttobe(0x4c1c7e6eL), tobe(0x17bda2a4L), tobe(0xfb5fc7faL), tobe(0xa0fe1b30L),\n\ttobe(0x265a10f1L), tobe(0x7dfbcc3bL), tobe(0x9119a965L), tobe(0xcab875afL),\n\ttobe(0x3548049bL), tobe(0x6ee9d851L), tobe(0x820bbd0fL), tobe(0xd9aa61c5L),\n\ttobe(0x5f0e6a04L), tobe(0x04afb6ceL), tobe(0xe84dd390L), tobe(0xb3ec0f5aL),\n\ttobe(0xe1c4d9a5L), tobe(0xba65056fL), tobe(0x56876031L), tobe(0x0d26bcfbL),\n\ttobe(0x8b82b73aL), tobe(0xd0236bf0L), tobe(0x3cc10eaeL), tobe(0x6760d264L)},\n\t};\n\tstatic const uint32_t crc32ctable_le[8][256] = {{\n\ttole(0x00000000L), tole(0xf26b8303L), tole(0xe13b70f7L), tole(0x1350f3f4L),\n\ttole(0xc79a971fL), tole(0x35f1141cL), tole(0x26a1e7e8L), tole(0xd4ca64ebL),\n\ttole(0x8ad958cfL), tole(0x78b2dbccL), tole(0x6be22838L), tole(0x9989ab3bL),\n\ttole(0x4d43cfd0L), tole(0xbf284cd3L), tole(0xac78bf27L), tole(0x5e133c24L),\n\ttole(0x105ec76fL), tole(0xe235446cL), tole(0xf165b798L), tole(0x030e349bL),\n\ttole(0xd7c45070L), tole(0x25afd373L), tole(0x36ff2087L), tole(0xc494a384L),\n\ttole(0x9a879fa0L), tole(0x68ec1ca3L), tole(0x7bbcef57L), tole(0x89d76c54L),\n\ttole(0x5d1d08bfL), tole(0xaf768bbcL), tole(0xbc267848L), tole(0x4e4dfb4bL),\n\ttole(0x20bd8edeL), tole(0xd2d60dddL), tole(0xc186fe29L), tole(0x33ed7d2aL),\n\ttole(0xe72719c1L), tole(0x154c9ac2L), tole(0x061c6936L), tole(0xf477ea35L),\n\ttole(0xaa64d611L), tole(0x580f5512L), tole(0x4b5fa6e6L), tole(0xb93425e5L),\n\ttole(0x6dfe410eL), tole(0x9f95c20dL), tole(0x8cc531f9L), tole(0x7eaeb2faL),\n\ttole(0x30e349b1L), tole(0xc288cab2L), tole(0xd1d83946L), tole(0x23b3ba45L),\n\ttole(0xf779deaeL), tole(0x05125dadL), tole(0x1642ae59L), tole(0xe4292d5aL),\n\ttole(0xba3a117eL), tole(0x4851927dL), tole(0x5b016189L), tole(0xa96ae28aL),\n\ttole(0x7da08661L), tole(0x8fcb0562L), tole(0x9c9bf696L), tole(0x6ef07595L),\n\ttole(0x417b1dbcL), tole(0xb3109ebfL), tole(0xa0406d4bL), tole(0x522bee48L),\n\ttole(0x86e18aa3L), tole(0x748a09a0L), tole(0x67dafa54L), tole(0x95b17957L),\n\ttole(0xcba24573L), tole(0x39c9c670L), tole(0x2a993584L), tole(0xd8f2b687L),\n\ttole(0x0c38d26cL), tole(0xfe53516fL), tole(0xed03a29bL), tole(0x1f682198L),\n\ttole(0x5125dad3L), tole(0xa34e59d0L), tole(0xb01eaa24L), tole(0x42752927L),\n\ttole(0x96bf4dccL), tole(0x64d4cecfL), tole(0x77843d3bL), tole(0x85efbe38L),\n\ttole(0xdbfc821cL), tole(0x2997011fL), tole(0x3ac7f2ebL), tole(0xc8ac71e8L),\n\ttole(0x1c661503L), tole(0xee0d9600L), tole(0xfd5d65f4L), tole(0x0f36e6f7L),\n\ttole(0x61c69362L), tole(0x93ad1061L), tole(0x80fde395L), tole(0x72966096L),\n\ttole(0xa65c047dL), tole(0x5437877eL), tole(0x4767748aL), tole(0xb50cf789L),\n\ttole(0xeb1fcbadL), tole(0x197448aeL), tole(0x0a24bb5aL), tole(0xf84f3859L),\n\ttole(0x2c855cb2L), tole(0xdeeedfb1L), tole(0xcdbe2c45L), tole(0x3fd5af46L),\n\ttole(0x7198540dL), tole(0x83f3d70eL), tole(0x90a324faL), tole(0x62c8a7f9L),\n\ttole(0xb602c312L), tole(0x44694011L), tole(0x5739b3e5L), tole(0xa55230e6L),\n\ttole(0xfb410cc2L), tole(0x092a8fc1L), tole(0x1a7a7c35L), tole(0xe811ff36L),\n\ttole(0x3cdb9bddL), tole(0xceb018deL), tole(0xdde0eb2aL), tole(0x2f8b6829L),\n\ttole(0x82f63b78L), tole(0x709db87bL), tole(0x63cd4b8fL), tole(0x91a6c88cL),\n\ttole(0x456cac67L), tole(0xb7072f64L), tole(0xa457dc90L), tole(0x563c5f93L),\n\ttole(0x082f63b7L), tole(0xfa44e0b4L), tole(0xe9141340L), tole(0x1b7f9043L),\n\ttole(0xcfb5f4a8L), tole(0x3dde77abL), tole(0x2e8e845fL), tole(0xdce5075cL),\n\ttole(0x92a8fc17L), tole(0x60c37f14L), tole(0x73938ce0L), tole(0x81f80fe3L),\n\ttole(0x55326b08L), tole(0xa759e80bL), tole(0xb4091bffL), tole(0x466298fcL),\n\ttole(0x1871a4d8L), tole(0xea1a27dbL), tole(0xf94ad42fL), tole(0x0b21572cL),\n\ttole(0xdfeb33c7L), tole(0x2d80b0c4L), tole(0x3ed04330L), tole(0xccbbc033L),\n\ttole(0xa24bb5a6L), tole(0x502036a5L), tole(0x4370c551L), tole(0xb11b4652L),\n\ttole(0x65d122b9L), tole(0x97baa1baL), tole(0x84ea524eL), tole(0x7681d14dL),\n\ttole(0x2892ed69L), tole(0xdaf96e6aL), tole(0xc9a99d9eL), tole(0x3bc21e9dL),\n\ttole(0xef087a76L), tole(0x1d63f975L), tole(0x0e330a81L), tole(0xfc588982L),\n\ttole(0xb21572c9L), tole(0x407ef1caL), tole(0x532e023eL), tole(0xa145813dL),\n\ttole(0x758fe5d6L), tole(0x87e466d5L), tole(0x94b49521L), tole(0x66df1622L),\n\ttole(0x38cc2a06L), tole(0xcaa7a905L), tole(0xd9f75af1L), tole(0x2b9cd9f2L),\n\ttole(0xff56bd19L), tole(0x0d3d3e1aL), tole(0x1e6dcdeeL), tole(0xec064eedL),\n\ttole(0xc38d26c4L), tole(0x31e6a5c7L), tole(0x22b65633L), tole(0xd0ddd530L),\n\ttole(0x0417b1dbL), tole(0xf67c32d8L), tole(0xe52cc12cL), tole(0x1747422fL),\n\ttole(0x49547e0bL), tole(0xbb3ffd08L), tole(0xa86f0efcL), tole(0x5a048dffL),\n\ttole(0x8ecee914L), tole(0x7ca56a17L), tole(0x6ff599e3L), tole(0x9d9e1ae0L),\n\ttole(0xd3d3e1abL), tole(0x21b862a8L), tole(0x32e8915cL), tole(0xc083125fL),\n\ttole(0x144976b4L), tole(0xe622f5b7L), tole(0xf5720643L), tole(0x07198540L),\n\ttole(0x590ab964L), tole(0xab613a67L), tole(0xb831c993L), tole(0x4a5a4a90L),\n\ttole(0x9e902e7bL), tole(0x6cfbad78L), tole(0x7fab5e8cL), tole(0x8dc0dd8fL),\n\ttole(0xe330a81aL), tole(0x115b2b19L), tole(0x020bd8edL), tole(0xf0605beeL),\n\ttole(0x24aa3f05L), tole(0xd6c1bc06L), tole(0xc5914ff2L), tole(0x37faccf1L),\n\ttole(0x69e9f0d5L), tole(0x9b8273d6L), tole(0x88d28022L), tole(0x7ab90321L),\n\ttole(0xae7367caL), tole(0x5c18e4c9L), tole(0x4f48173dL), tole(0xbd23943eL),\n\ttole(0xf36e6f75L), tole(0x0105ec76L), tole(0x12551f82L), tole(0xe03e9c81L),\n\ttole(0x34f4f86aL), tole(0xc69f7b69L), tole(0xd5cf889dL), tole(0x27a40b9eL),\n\ttole(0x79b737baL), tole(0x8bdcb4b9L), tole(0x988c474dL), tole(0x6ae7c44eL),\n\ttole(0xbe2da0a5L), tole(0x4c4623a6L), tole(0x5f16d052L), tole(0xad7d5351L)},\n\t{\n\ttole(0x00000000L), tole(0x13a29877L), tole(0x274530eeL), tole(0x34e7a899L),\n\ttole(0x4e8a61dcL), tole(0x5d28f9abL), tole(0x69cf5132L), tole(0x7a6dc945L),\n\ttole(0x9d14c3b8L), tole(0x8eb65bcfL), tole(0xba51f356L), tole(0xa9f36b21L),\n\ttole(0xd39ea264L), tole(0xc03c3a13L), tole(0xf4db928aL), tole(0xe7790afdL),\n\ttole(0x3fc5f181L), tole(0x2c6769f6L), tole(0x1880c16fL), tole(0x0b225918L),\n\ttole(0x714f905dL), tole(0x62ed082aL), tole(0x560aa0b3L), tole(0x45a838c4L),\n\ttole(0xa2d13239L), tole(0xb173aa4eL), tole(0x859402d7L), tole(0x96369aa0L),\n\ttole(0xec5b53e5L), tole(0xfff9cb92L), tole(0xcb1e630bL), tole(0xd8bcfb7cL),\n\ttole(0x7f8be302L), tole(0x6c297b75L), tole(0x58ced3ecL), tole(0x4b6c4b9bL),\n\ttole(0x310182deL), tole(0x22a31aa9L), tole(0x1644b230L), tole(0x05e62a47L),\n\ttole(0xe29f20baL), tole(0xf13db8cdL), tole(0xc5da1054L), tole(0xd6788823L),\n\ttole(0xac154166L), tole(0xbfb7d911L), tole(0x8b507188L), tole(0x98f2e9ffL),\n\ttole(0x404e1283L), tole(0x53ec8af4L), tole(0x670b226dL), tole(0x74a9ba1aL),\n\ttole(0x0ec4735fL), tole(0x1d66eb28L), tole(0x298143b1L), tole(0x3a23dbc6L),\n\ttole(0xdd5ad13bL), tole(0xcef8494cL), tole(0xfa1fe1d5L), tole(0xe9bd79a2L),\n\ttole(0x93d0b0e7L), tole(0x80722890L), tole(0xb4958009L), tole(0xa737187eL),\n\ttole(0xff17c604L), tole(0xecb55e73L), tole(0xd852f6eaL), tole(0xcbf06e9dL),\n\ttole(0xb19da7d8L), tole(0xa23f3fafL), tole(0x96d89736L), tole(0x857a0f41L),\n\ttole(0x620305bcL), tole(0x71a19dcbL), tole(0x45463552L), tole(0x56e4ad25L),\n\ttole(0x2c896460L), tole(0x3f2bfc17L), tole(0x0bcc548eL), tole(0x186eccf9L),\n\ttole(0xc0d23785L), tole(0xd370aff2L), tole(0xe797076bL), tole(0xf4359f1cL),\n\ttole(0x8e585659L), tole(0x9dface2eL), tole(0xa91d66b7L), tole(0xbabffec0L),\n\ttole(0x5dc6f43dL), tole(0x4e646c4aL), tole(0x7a83c4d3L), tole(0x69215ca4L),\n\ttole(0x134c95e1L), tole(0x00ee0d96L), tole(0x3409a50fL), tole(0x27ab3d78L),\n\ttole(0x809c2506L), tole(0x933ebd71L), tole(0xa7d915e8L), tole(0xb47b8d9fL),\n\ttole(0xce1644daL), tole(0xddb4dcadL), tole(0xe9537434L), tole(0xfaf1ec43L),\n\ttole(0x1d88e6beL), tole(0x0e2a7ec9L), tole(0x3acdd650L), tole(0x296f4e27L),\n\ttole(0x53028762L), tole(0x40a01f15L), tole(0x7447b78cL), tole(0x67e52ffbL),\n\ttole(0xbf59d487L), tole(0xacfb4cf0L), tole(0x981ce469L), tole(0x8bbe7c1eL),\n\ttole(0xf1d3b55bL), tole(0xe2712d2cL), tole(0xd69685b5L), tole(0xc5341dc2L),\n\ttole(0x224d173fL), tole(0x31ef8f48L), tole(0x050827d1L), tole(0x16aabfa6L),\n\ttole(0x6cc776e3L), tole(0x7f65ee94L), tole(0x4b82460dL), tole(0x5820de7aL),\n\ttole(0xfbc3faf9L), tole(0xe861628eL), tole(0xdc86ca17L), tole(0xcf245260L),\n\ttole(0xb5499b25L), tole(0xa6eb0352L), tole(0x920cabcbL), tole(0x81ae33bcL),\n\ttole(0x66d73941L), tole(0x7575a136L), tole(0x419209afL), tole(0x523091d8L),\n\ttole(0x285d589dL), tole(0x3bffc0eaL), tole(0x0f186873L), tole(0x1cbaf004L),\n\ttole(0xc4060b78L), tole(0xd7a4930fL), tole(0xe3433b96L), tole(0xf0e1a3e1L),\n\ttole(0x8a8c6aa4L), tole(0x992ef2d3L), tole(0xadc95a4aL), tole(0xbe6bc23dL),\n\ttole(0x5912c8c0L), tole(0x4ab050b7L), tole(0x7e57f82eL), tole(0x6df56059L),\n\ttole(0x1798a91cL), tole(0x043a316bL), tole(0x30dd99f2L), tole(0x237f0185L),\n\ttole(0x844819fbL), tole(0x97ea818cL), tole(0xa30d2915L), tole(0xb0afb162L),\n\ttole(0xcac27827L), tole(0xd960e050L), tole(0xed8748c9L), tole(0xfe25d0beL),\n\ttole(0x195cda43L), tole(0x0afe4234L), tole(0x3e19eaadL), tole(0x2dbb72daL),\n\ttole(0x57d6bb9fL), tole(0x447423e8L), tole(0x70938b71L), tole(0x63311306L),\n\ttole(0xbb8de87aL), tole(0xa82f700dL), tole(0x9cc8d894L), tole(0x8f6a40e3L),\n\ttole(0xf50789a6L), tole(0xe6a511d1L), tole(0xd242b948L), tole(0xc1e0213fL),\n\ttole(0x26992bc2L), tole(0x353bb3b5L), tole(0x01dc1b2cL), tole(0x127e835bL),\n\ttole(0x68134a1eL), tole(0x7bb1d269L), tole(0x4f567af0L), tole(0x5cf4e287L),\n\ttole(0x04d43cfdL), tole(0x1776a48aL), tole(0x23910c13L), tole(0x30339464L),\n\ttole(0x4a5e5d21L), tole(0x59fcc556L), tole(0x6d1b6dcfL), tole(0x7eb9f5b8L),\n\ttole(0x99c0ff45L), tole(0x8a626732L), tole(0xbe85cfabL), tole(0xad2757dcL),\n\ttole(0xd74a9e99L), tole(0xc4e806eeL), tole(0xf00fae77L), tole(0xe3ad3600L),\n\ttole(0x3b11cd7cL), tole(0x28b3550bL), tole(0x1c54fd92L), tole(0x0ff665e5L),\n\ttole(0x759baca0L), tole(0x663934d7L), tole(0x52de9c4eL), tole(0x417c0439L),\n\ttole(0xa6050ec4L), tole(0xb5a796b3L), tole(0x81403e2aL), tole(0x92e2a65dL),\n\ttole(0xe88f6f18L), tole(0xfb2df76fL), tole(0xcfca5ff6L), tole(0xdc68c781L),\n\ttole(0x7b5fdfffL), tole(0x68fd4788L), tole(0x5c1aef11L), tole(0x4fb87766L),\n\ttole(0x35d5be23L), tole(0x26772654L), tole(0x12908ecdL), tole(0x013216baL),\n\ttole(0xe64b1c47L), tole(0xf5e98430L), tole(0xc10e2ca9L), tole(0xd2acb4deL),\n\ttole(0xa8c17d9bL), tole(0xbb63e5ecL), tole(0x8f844d75L), tole(0x9c26d502L),\n\ttole(0x449a2e7eL), tole(0x5738b609L), tole(0x63df1e90L), tole(0x707d86e7L),\n\ttole(0x0a104fa2L), tole(0x19b2d7d5L), tole(0x2d557f4cL), tole(0x3ef7e73bL),\n\ttole(0xd98eedc6L), tole(0xca2c75b1L), tole(0xfecbdd28L), tole(0xed69455fL),\n\ttole(0x97048c1aL), tole(0x84a6146dL), tole(0xb041bcf4L), tole(0xa3e32483L)},\n\t{\n\ttole(0x00000000L), tole(0xa541927eL), tole(0x4f6f520dL), tole(0xea2ec073L),\n\ttole(0x9edea41aL), tole(0x3b9f3664L), tole(0xd1b1f617L), tole(0x74f06469L),\n\ttole(0x38513ec5L), tole(0x9d10acbbL), tole(0x773e6cc8L), tole(0xd27ffeb6L),\n\ttole(0xa68f9adfL), tole(0x03ce08a1L), tole(0xe9e0c8d2L), tole(0x4ca15aacL),\n\ttole(0x70a27d8aL), tole(0xd5e3eff4L), tole(0x3fcd2f87L), tole(0x9a8cbdf9L),\n\ttole(0xee7cd990L), tole(0x4b3d4beeL), tole(0xa1138b9dL), tole(0x045219e3L),\n\ttole(0x48f3434fL), tole(0xedb2d131L), tole(0x079c1142L), tole(0xa2dd833cL),\n\ttole(0xd62de755L), tole(0x736c752bL), tole(0x9942b558L), tole(0x3c032726L),\n\ttole(0xe144fb14L), tole(0x4405696aL), tole(0xae2ba919L), tole(0x0b6a3b67L),\n\ttole(0x7f9a5f0eL), tole(0xdadbcd70L), tole(0x30f50d03L), tole(0x95b49f7dL),\n\ttole(0xd915c5d1L), tole(0x7c5457afL), tole(0x967a97dcL), tole(0x333b05a2L),\n\ttole(0x47cb61cbL), tole(0xe28af3b5L), tole(0x08a433c6L), tole(0xade5a1b8L),\n\ttole(0x91e6869eL), tole(0x34a714e0L), tole(0xde89d493L), tole(0x7bc846edL),\n\ttole(0x0f382284L), tole(0xaa79b0faL), tole(0x40577089L), tole(0xe516e2f7L),\n\ttole(0xa9b7b85bL), tole(0x0cf62a25L), tole(0xe6d8ea56L), tole(0x43997828L),\n\ttole(0x37691c41L), tole(0x92288e3fL), tole(0x78064e4cL), tole(0xdd47dc32L),\n\ttole(0xc76580d9L), tole(0x622412a7L), tole(0x880ad2d4L), tole(0x2d4b40aaL),\n\ttole(0x59bb24c3L), tole(0xfcfab6bdL), tole(0x16d476ceL), tole(0xb395e4b0L),\n\ttole(0xff34be1cL), tole(0x5a752c62L), tole(0xb05bec11L), tole(0x151a7e6fL),\n\ttole(0x61ea1a06L), tole(0xc4ab8878L), tole(0x2e85480bL), tole(0x8bc4da75L),\n\ttole(0xb7c7fd53L), tole(0x12866f2dL), tole(0xf8a8af5eL), tole(0x5de93d20L),\n\ttole(0x29195949L), tole(0x8c58cb37L), tole(0x66760b44L), tole(0xc337993aL),\n\ttole(0x8f96c396L), tole(0x2ad751e8L), tole(0xc0f9919bL), tole(0x65b803e5L),\n\ttole(0x1148678cL), tole(0xb409f5f2L), tole(0x5e273581L), tole(0xfb66a7ffL),\n\ttole(0x26217bcdL), tole(0x8360e9b3L), tole(0x694e29c0L), tole(0xcc0fbbbeL),\n\ttole(0xb8ffdfd7L), tole(0x1dbe4da9L), tole(0xf7908ddaL), tole(0x52d11fa4L),\n\ttole(0x1e704508L), tole(0xbb31d776L), tole(0x511f1705L), tole(0xf45e857bL),\n\ttole(0x80aee112L), tole(0x25ef736cL), tole(0xcfc1b31fL), tole(0x6a802161L),\n\ttole(0x56830647L), tole(0xf3c29439L), tole(0x19ec544aL), tole(0xbcadc634L),\n\ttole(0xc85da25dL), tole(0x6d1c3023L), tole(0x8732f050L), tole(0x2273622eL),\n\ttole(0x6ed23882L), tole(0xcb93aafcL), tole(0x21bd6a8fL), tole(0x84fcf8f1L),\n\ttole(0xf00c9c98L), tole(0x554d0ee6L), tole(0xbf63ce95L), tole(0x1a225cebL),\n\ttole(0x8b277743L), tole(0x2e66e53dL), tole(0xc448254eL), tole(0x6109b730L),\n\ttole(0x15f9d359L), tole(0xb0b84127L), tole(0x5a968154L), tole(0xffd7132aL),\n\ttole(0xb3764986L), tole(0x1637dbf8L), tole(0xfc191b8bL), tole(0x595889f5L),\n\ttole(0x2da8ed9cL), tole(0x88e97fe2L), tole(0x62c7bf91L), tole(0xc7862defL),\n\ttole(0xfb850ac9L), tole(0x5ec498b7L), tole(0xb4ea58c4L), tole(0x11abcabaL),\n\ttole(0x655baed3L), tole(0xc01a3cadL), tole(0x2a34fcdeL), tole(0x8f756ea0L),\n\ttole(0xc3d4340cL), tole(0x6695a672L), tole(0x8cbb6601L), tole(0x29faf47fL),\n\ttole(0x5d0a9016L), tole(0xf84b0268L), tole(0x1265c21bL), tole(0xb7245065L),\n\ttole(0x6a638c57L), tole(0xcf221e29L), tole(0x250cde5aL), tole(0x804d4c24L),\n\ttole(0xf4bd284dL), tole(0x51fcba33L), tole(0xbbd27a40L), tole(0x1e93e83eL),\n\ttole(0x5232b292L), tole(0xf77320ecL), tole(0x1d5de09fL), tole(0xb81c72e1L),\n\ttole(0xccec1688L), tole(0x69ad84f6L), tole(0x83834485L), tole(0x26c2d6fbL),\n\ttole(0x1ac1f1ddL), tole(0xbf8063a3L), tole(0x55aea3d0L), tole(0xf0ef31aeL),\n\ttole(0x841f55c7L), tole(0x215ec7b9L), tole(0xcb7007caL), tole(0x6e3195b4L),\n\ttole(0x2290cf18L), tole(0x87d15d66L), tole(0x6dff9d15L), tole(0xc8be0f6bL),\n\ttole(0xbc4e6b02L), tole(0x190ff97cL), tole(0xf321390fL), tole(0x5660ab71L),\n\ttole(0x4c42f79aL), tole(0xe90365e4L), tole(0x032da597L), tole(0xa66c37e9L),\n\ttole(0xd29c5380L), tole(0x77ddc1feL), tole(0x9df3018dL), tole(0x38b293f3L),\n\ttole(0x7413c95fL), tole(0xd1525b21L), tole(0x3b7c9b52L), tole(0x9e3d092cL),\n\ttole(0xeacd6d45L), tole(0x4f8cff3bL), tole(0xa5a23f48L), tole(0x00e3ad36L),\n\ttole(0x3ce08a10L), tole(0x99a1186eL), tole(0x738fd81dL), tole(0xd6ce4a63L),\n\ttole(0xa23e2e0aL), tole(0x077fbc74L), tole(0xed517c07L), tole(0x4810ee79L),\n\ttole(0x04b1b4d5L), tole(0xa1f026abL), tole(0x4bdee6d8L), tole(0xee9f74a6L),\n\ttole(0x9a6f10cfL), tole(0x3f2e82b1L), tole(0xd50042c2L), tole(0x7041d0bcL),\n\ttole(0xad060c8eL), tole(0x08479ef0L), tole(0xe2695e83L), tole(0x4728ccfdL),\n\ttole(0x33d8a894L), tole(0x96993aeaL), tole(0x7cb7fa99L), tole(0xd9f668e7L),\n\ttole(0x9557324bL), tole(0x3016a035L), tole(0xda386046L), tole(0x7f79f238L),\n\ttole(0x0b899651L), tole(0xaec8042fL), tole(0x44e6c45cL), tole(0xe1a75622L),\n\ttole(0xdda47104L), tole(0x78e5e37aL), tole(0x92cb2309L), tole(0x378ab177L),\n\ttole(0x437ad51eL), tole(0xe63b4760L), tole(0x0c158713L), tole(0xa954156dL),\n\ttole(0xe5f54fc1L), tole(0x40b4ddbfL), tole(0xaa9a1dccL), tole(0x0fdb8fb2L),\n\ttole(0x7b2bebdbL), tole(0xde6a79a5L), tole(0x3444b9d6L), tole(0x91052ba8L)},\n\t{\n\ttole(0x00000000L), tole(0xdd45aab8L), tole(0xbf672381L), tole(0x62228939L),\n\ttole(0x7b2231f3L), tole(0xa6679b4bL), tole(0xc4451272L), tole(0x1900b8caL),\n\ttole(0xf64463e6L), tole(0x2b01c95eL), tole(0x49234067L), tole(0x9466eadfL),\n\ttole(0x8d665215L), tole(0x5023f8adL), tole(0x32017194L), tole(0xef44db2cL),\n\ttole(0xe964b13dL), tole(0x34211b85L), tole(0x560392bcL), tole(0x8b463804L),\n\ttole(0x924680ceL), tole(0x4f032a76L), tole(0x2d21a34fL), tole(0xf06409f7L),\n\ttole(0x1f20d2dbL), tole(0xc2657863L), tole(0xa047f15aL), tole(0x7d025be2L),\n\ttole(0x6402e328L), tole(0xb9474990L), tole(0xdb65c0a9L), tole(0x06206a11L),\n\ttole(0xd725148bL), tole(0x0a60be33L), tole(0x6842370aL), tole(0xb5079db2L),\n\ttole(0xac072578L), tole(0x71428fc0L), tole(0x136006f9L), tole(0xce25ac41L),\n\ttole(0x2161776dL), tole(0xfc24ddd5L), tole(0x9e0654ecL), tole(0x4343fe54L),\n\ttole(0x5a43469eL), tole(0x8706ec26L), tole(0xe524651fL), tole(0x3861cfa7L),\n\ttole(0x3e41a5b6L), tole(0xe3040f0eL), tole(0x81268637L), tole(0x5c632c8fL),\n\ttole(0x45639445L), tole(0x98263efdL), tole(0xfa04b7c4L), tole(0x27411d7cL),\n\ttole(0xc805c650L), tole(0x15406ce8L), tole(0x7762e5d1L), tole(0xaa274f69L),\n\ttole(0xb327f7a3L), tole(0x6e625d1bL), tole(0x0c40d422L), tole(0xd1057e9aL),\n\ttole(0xaba65fe7L), tole(0x76e3f55fL), tole(0x14c17c66L), tole(0xc984d6deL),\n\ttole(0xd0846e14L), tole(0x0dc1c4acL), tole(0x6fe34d95L), tole(0xb2a6e72dL),\n\ttole(0x5de23c01L), tole(0x80a796b9L), tole(0xe2851f80L), tole(0x3fc0b538L),\n\ttole(0x26c00df2L), tole(0xfb85a74aL), tole(0x99a72e73L), tole(0x44e284cbL),\n\ttole(0x42c2eedaL), tole(0x9f874462L), tole(0xfda5cd5bL), tole(0x20e067e3L),\n\ttole(0x39e0df29L), tole(0xe4a57591L), tole(0x8687fca8L), tole(0x5bc25610L),\n\ttole(0xb4868d3cL), tole(0x69c32784L), tole(0x0be1aebdL), tole(0xd6a40405L),\n\ttole(0xcfa4bccfL), tole(0x12e11677L), tole(0x70c39f4eL), tole(0xad8635f6L),\n\ttole(0x7c834b6cL), tole(0xa1c6e1d4L), tole(0xc3e468edL), tole(0x1ea1c255L),\n\ttole(0x07a17a9fL), tole(0xdae4d027L), tole(0xb8c6591eL), tole(0x6583f3a6L),\n\ttole(0x8ac7288aL), tole(0x57828232L), tole(0x35a00b0bL), tole(0xe8e5a1b3L),\n\ttole(0xf1e51979L), tole(0x2ca0b3c1L), tole(0x4e823af8L), tole(0x93c79040L),\n\ttole(0x95e7fa51L), tole(0x48a250e9L), tole(0x2a80d9d0L), tole(0xf7c57368L),\n\ttole(0xeec5cba2L), tole(0x3380611aL), tole(0x51a2e823L), tole(0x8ce7429bL),\n\ttole(0x63a399b7L), tole(0xbee6330fL), tole(0xdcc4ba36L), tole(0x0181108eL),\n\ttole(0x1881a844L), tole(0xc5c402fcL), tole(0xa7e68bc5L), tole(0x7aa3217dL),\n\ttole(0x52a0c93fL), tole(0x8fe56387L), tole(0xedc7eabeL), tole(0x30824006L),\n\ttole(0x2982f8ccL), tole(0xf4c75274L), tole(0x96e5db4dL), tole(0x4ba071f5L),\n\ttole(0xa4e4aad9L), tole(0x79a10061L), tole(0x1b838958L), tole(0xc6c623e0L),\n\ttole(0xdfc69b2aL), tole(0x02833192L), tole(0x60a1b8abL), tole(0xbde41213L),\n\ttole(0xbbc47802L), tole(0x6681d2baL), tole(0x04a35b83L), tole(0xd9e6f13bL),\n\ttole(0xc0e649f1L), tole(0x1da3e349L), tole(0x7f816a70L), tole(0xa2c4c0c8L),\n\ttole(0x4d801be4L), tole(0x90c5b15cL), tole(0xf2e73865L), tole(0x2fa292ddL),\n\ttole(0x36a22a17L), tole(0xebe780afL), tole(0x89c50996L), tole(0x5480a32eL),\n\ttole(0x8585ddb4L), tole(0x58c0770cL), tole(0x3ae2fe35L), tole(0xe7a7548dL),\n\ttole(0xfea7ec47L), tole(0x23e246ffL), tole(0x41c0cfc6L), tole(0x9c85657eL),\n\ttole(0x73c1be52L), tole(0xae8414eaL), tole(0xcca69dd3L), tole(0x11e3376bL),\n\ttole(0x08e38fa1L), tole(0xd5a62519L), tole(0xb784ac20L), tole(0x6ac10698L),\n\ttole(0x6ce16c89L), tole(0xb1a4c631L), tole(0xd3864f08L), tole(0x0ec3e5b0L),\n\ttole(0x17c35d7aL), tole(0xca86f7c2L), tole(0xa8a47efbL), tole(0x75e1d443L),\n\ttole(0x9aa50f6fL), tole(0x47e0a5d7L), tole(0x25c22ceeL), tole(0xf8878656L),\n\ttole(0xe1873e9cL), tole(0x3cc29424L), tole(0x5ee01d1dL), tole(0x83a5b7a5L),\n\ttole(0xf90696d8L), tole(0x24433c60L), tole(0x4661b559L), tole(0x9b241fe1L),\n\ttole(0x8224a72bL), tole(0x5f610d93L), tole(0x3d4384aaL), tole(0xe0062e12L),\n\ttole(0x0f42f53eL), tole(0xd2075f86L), tole(0xb025d6bfL), tole(0x6d607c07L),\n\ttole(0x7460c4cdL), tole(0xa9256e75L), tole(0xcb07e74cL), tole(0x16424df4L),\n\ttole(0x106227e5L), tole(0xcd278d5dL), tole(0xaf050464L), tole(0x7240aedcL),\n\ttole(0x6b401616L), tole(0xb605bcaeL), tole(0xd4273597L), tole(0x09629f2fL),\n\ttole(0xe6264403L), tole(0x3b63eebbL), tole(0x59416782L), tole(0x8404cd3aL),\n\ttole(0x9d0475f0L), tole(0x4041df48L), tole(0x22635671L), tole(0xff26fcc9L),\n\ttole(0x2e238253L), tole(0xf36628ebL), tole(0x9144a1d2L), tole(0x4c010b6aL),\n\ttole(0x5501b3a0L), tole(0x88441918L), tole(0xea669021L), tole(0x37233a99L),\n\ttole(0xd867e1b5L), tole(0x05224b0dL), tole(0x6700c234L), tole(0xba45688cL),\n\ttole(0xa345d046L), tole(0x7e007afeL), tole(0x1c22f3c7L), tole(0xc167597fL),\n\ttole(0xc747336eL), tole(0x1a0299d6L), tole(0x782010efL), tole(0xa565ba57L),\n\ttole(0xbc65029dL), tole(0x6120a825L), tole(0x0302211cL), tole(0xde478ba4L),\n\ttole(0x31035088L), tole(0xec46fa30L), tole(0x8e647309L), tole(0x5321d9b1L),\n\ttole(0x4a21617bL), tole(0x9764cbc3L), tole(0xf54642faL), tole(0x2803e842L)},\n\t{\n\ttole(0x00000000L), tole(0x38116facL), tole(0x7022df58L), tole(0x4833b0f4L),\n\ttole(0xe045beb0L), tole(0xd854d11cL), tole(0x906761e8L), tole(0xa8760e44L),\n\ttole(0xc5670b91L), tole(0xfd76643dL), tole(0xb545d4c9L), tole(0x8d54bb65L),\n\ttole(0x2522b521L), tole(0x1d33da8dL), tole(0x55006a79L), tole(0x6d1105d5L),\n\ttole(0x8f2261d3L), tole(0xb7330e7fL), tole(0xff00be8bL), tole(0xc711d127L),\n\ttole(0x6f67df63L), tole(0x5776b0cfL), tole(0x1f45003bL), tole(0x27546f97L),\n\ttole(0x4a456a42L), tole(0x725405eeL), tole(0x3a67b51aL), tole(0x0276dab6L),\n\ttole(0xaa00d4f2L), tole(0x9211bb5eL), tole(0xda220baaL), tole(0xe2336406L),\n\ttole(0x1ba8b557L), tole(0x23b9dafbL), tole(0x6b8a6a0fL), tole(0x539b05a3L),\n\ttole(0xfbed0be7L), tole(0xc3fc644bL), tole(0x8bcfd4bfL), tole(0xb3debb13L),\n\ttole(0xdecfbec6L), tole(0xe6ded16aL), tole(0xaeed619eL), tole(0x96fc0e32L),\n\ttole(0x3e8a0076L), tole(0x069b6fdaL), tole(0x4ea8df2eL), tole(0x76b9b082L),\n\ttole(0x948ad484L), tole(0xac9bbb28L), tole(0xe4a80bdcL), tole(0xdcb96470L),\n\ttole(0x74cf6a34L), tole(0x4cde0598L), tole(0x04edb56cL), tole(0x3cfcdac0L),\n\ttole(0x51eddf15L), tole(0x69fcb0b9L), tole(0x21cf004dL), tole(0x19de6fe1L),\n\ttole(0xb1a861a5L), tole(0x89b90e09L), tole(0xc18abefdL), tole(0xf99bd151L),\n\ttole(0x37516aaeL), tole(0x0f400502L), tole(0x4773b5f6L), tole(0x7f62da5aL),\n\ttole(0xd714d41eL), tole(0xef05bbb2L), tole(0xa7360b46L), tole(0x9f2764eaL),\n\ttole(0xf236613fL), tole(0xca270e93L), tole(0x8214be67L), tole(0xba05d1cbL),\n\ttole(0x1273df8fL), tole(0x2a62b023L), tole(0x625100d7L), tole(0x5a406f7bL),\n\ttole(0xb8730b7dL), tole(0x806264d1L), tole(0xc851d425L), tole(0xf040bb89L),\n\ttole(0x5836b5cdL), tole(0x6027da61L), tole(0x28146a95L), tole(0x10050539L),\n\ttole(0x7d1400ecL), tole(0x45056f40L), tole(0x0d36dfb4L), tole(0x3527b018L),\n\ttole(0x9d51be5cL), tole(0xa540d1f0L), tole(0xed736104L), tole(0xd5620ea8L),\n\ttole(0x2cf9dff9L), tole(0x14e8b055L), tole(0x5cdb00a1L), tole(0x64ca6f0dL),\n\ttole(0xccbc6149L), tole(0xf4ad0ee5L), tole(0xbc9ebe11L), tole(0x848fd1bdL),\n\ttole(0xe99ed468L), tole(0xd18fbbc4L), tole(0x99bc0b30L), tole(0xa1ad649cL),\n\ttole(0x09db6ad8L), tole(0x31ca0574L), tole(0x79f9b580L), tole(0x41e8da2cL),\n\ttole(0xa3dbbe2aL), tole(0x9bcad186L), tole(0xd3f96172L), tole(0xebe80edeL),\n\ttole(0x439e009aL), tole(0x7b8f6f36L), tole(0x33bcdfc2L), tole(0x0badb06eL),\n\ttole(0x66bcb5bbL), tole(0x5eadda17L), tole(0x169e6ae3L), tole(0x2e8f054fL),\n\ttole(0x86f90b0bL), tole(0xbee864a7L), tole(0xf6dbd453L), tole(0xcecabbffL),\n\ttole(0x6ea2d55cL), tole(0x56b3baf0L), tole(0x1e800a04L), tole(0x269165a8L),\n\ttole(0x8ee76becL), tole(0xb6f60440L), tole(0xfec5b4b4L), tole(0xc6d4db18L),\n\ttole(0xabc5decdL), tole(0x93d4b161L), tole(0xdbe70195L), tole(0xe3f66e39L),\n\ttole(0x4b80607dL), tole(0x73910fd1L), tole(0x3ba2bf25L), tole(0x03b3d089L),\n\ttole(0xe180b48fL), tole(0xd991db23L), tole(0x91a26bd7L), tole(0xa9b3047bL),\n\ttole(0x01c50a3fL), tole(0x39d46593L), tole(0x71e7d567L), tole(0x49f6bacbL),\n\ttole(0x24e7bf1eL), tole(0x1cf6d0b2L), tole(0x54c56046L), tole(0x6cd40feaL),\n\ttole(0xc4a201aeL), tole(0xfcb36e02L), tole(0xb480def6L), tole(0x8c91b15aL),\n\ttole(0x750a600bL), tole(0x4d1b0fa7L), tole(0x0528bf53L), tole(0x3d39d0ffL),\n\ttole(0x954fdebbL), tole(0xad5eb117L), tole(0xe56d01e3L), tole(0xdd7c6e4fL),\n\ttole(0xb06d6b9aL), tole(0x887c0436L), tole(0xc04fb4c2L), tole(0xf85edb6eL),\n\ttole(0x5028d52aL), tole(0x6839ba86L), tole(0x200a0a72L), tole(0x181b65deL),\n\ttole(0xfa2801d8L), tole(0xc2396e74L), tole(0x8a0ade80L), tole(0xb21bb12cL),\n\ttole(0x1a6dbf68L), tole(0x227cd0c4L), tole(0x6a4f6030L), tole(0x525e0f9cL),\n\ttole(0x3f4f0a49L), tole(0x075e65e5L), tole(0x4f6dd511L), tole(0x777cbabdL),\n\ttole(0xdf0ab4f9L), tole(0xe71bdb55L), tole(0xaf286ba1L), tole(0x9739040dL),\n\ttole(0x59f3bff2L), tole(0x61e2d05eL), tole(0x29d160aaL), tole(0x11c00f06L),\n\ttole(0xb9b60142L), tole(0x81a76eeeL), tole(0xc994de1aL), tole(0xf185b1b6L),\n\ttole(0x9c94b463L), tole(0xa485dbcfL), tole(0xecb66b3bL), tole(0xd4a70497L),\n\ttole(0x7cd10ad3L), tole(0x44c0657fL), tole(0x0cf3d58bL), tole(0x34e2ba27L),\n\ttole(0xd6d1de21L), tole(0xeec0b18dL), tole(0xa6f30179L), tole(0x9ee26ed5L),\n\ttole(0x36946091L), tole(0x0e850f3dL), tole(0x46b6bfc9L), tole(0x7ea7d065L),\n\ttole(0x13b6d5b0L), tole(0x2ba7ba1cL), tole(0x63940ae8L), tole(0x5b856544L),\n\ttole(0xf3f36b00L), tole(0xcbe204acL), tole(0x83d1b458L), tole(0xbbc0dbf4L),\n\ttole(0x425b0aa5L), tole(0x7a4a6509L), tole(0x3279d5fdL), tole(0x0a68ba51L),\n\ttole(0xa21eb415L), tole(0x9a0fdbb9L), tole(0xd23c6b4dL), tole(0xea2d04e1L),\n\ttole(0x873c0134L), tole(0xbf2d6e98L), tole(0xf71ede6cL), tole(0xcf0fb1c0L),\n\ttole(0x6779bf84L), tole(0x5f68d028L), tole(0x175b60dcL), tole(0x2f4a0f70L),\n\ttole(0xcd796b76L), tole(0xf56804daL), tole(0xbd5bb42eL), tole(0x854adb82L),\n\ttole(0x2d3cd5c6L), tole(0x152dba6aL), tole(0x5d1e0a9eL), tole(0x650f6532L),\n\ttole(0x081e60e7L), tole(0x300f0f4bL), tole(0x783cbfbfL), tole(0x402dd013L),\n\ttole(0xe85bde57L), tole(0xd04ab1fbL), tole(0x9879010fL), tole(0xa0686ea3L)},\n\t{\n\ttole(0x00000000L), tole(0xef306b19L), tole(0xdb8ca0c3L), tole(0x34bccbdaL),\n\ttole(0xb2f53777L), tole(0x5dc55c6eL), tole(0x697997b4L), tole(0x8649fcadL),\n\ttole(0x6006181fL), tole(0x8f367306L), tole(0xbb8ab8dcL), tole(0x54bad3c5L),\n\ttole(0xd2f32f68L), tole(0x3dc34471L), tole(0x097f8fabL), tole(0xe64fe4b2L),\n\ttole(0xc00c303eL), tole(0x2f3c5b27L), tole(0x1b8090fdL), tole(0xf4b0fbe4L),\n\ttole(0x72f90749L), tole(0x9dc96c50L), tole(0xa975a78aL), tole(0x4645cc93L),\n\ttole(0xa00a2821L), tole(0x4f3a4338L), tole(0x7b8688e2L), tole(0x94b6e3fbL),\n\ttole(0x12ff1f56L), tole(0xfdcf744fL), tole(0xc973bf95L), tole(0x2643d48cL),\n\ttole(0x85f4168dL), tole(0x6ac47d94L), tole(0x5e78b64eL), tole(0xb148dd57L),\n\ttole(0x370121faL), tole(0xd8314ae3L), tole(0xec8d8139L), tole(0x03bdea20L),\n\ttole(0xe5f20e92L), tole(0x0ac2658bL), tole(0x3e7eae51L), tole(0xd14ec548L),\n\ttole(0x570739e5L), tole(0xb83752fcL), tole(0x8c8b9926L), tole(0x63bbf23fL),\n\ttole(0x45f826b3L), tole(0xaac84daaL), tole(0x9e748670L), tole(0x7144ed69L),\n\ttole(0xf70d11c4L), tole(0x183d7addL), tole(0x2c81b107L), tole(0xc3b1da1eL),\n\ttole(0x25fe3eacL), tole(0xcace55b5L), tole(0xfe729e6fL), tole(0x1142f576L),\n\ttole(0x970b09dbL), tole(0x783b62c2L), tole(0x4c87a918L), tole(0xa3b7c201L),\n\ttole(0x0e045bebL), tole(0xe13430f2L), tole(0xd588fb28L), tole(0x3ab89031L),\n\ttole(0xbcf16c9cL), tole(0x53c10785L), tole(0x677dcc5fL), tole(0x884da746L),\n\ttole(0x6e0243f4L), tole(0x813228edL), tole(0xb58ee337L), tole(0x5abe882eL),\n\ttole(0xdcf77483L), tole(0x33c71f9aL), tole(0x077bd440L), tole(0xe84bbf59L),\n\ttole(0xce086bd5L), tole(0x213800ccL), tole(0x1584cb16L), tole(0xfab4a00fL),\n\ttole(0x7cfd5ca2L), tole(0x93cd37bbL), tole(0xa771fc61L), tole(0x48419778L),\n\ttole(0xae0e73caL), tole(0x413e18d3L), tole(0x7582d309L), tole(0x9ab2b810L),\n\ttole(0x1cfb44bdL), tole(0xf3cb2fa4L), tole(0xc777e47eL), tole(0x28478f67L),\n\ttole(0x8bf04d66L), tole(0x64c0267fL), tole(0x507ceda5L), tole(0xbf4c86bcL),\n\ttole(0x39057a11L), tole(0xd6351108L), tole(0xe289dad2L), tole(0x0db9b1cbL),\n\ttole(0xebf65579L), tole(0x04c63e60L), tole(0x307af5baL), tole(0xdf4a9ea3L),\n\ttole(0x5903620eL), tole(0xb6330917L), tole(0x828fc2cdL), tole(0x6dbfa9d4L),\n\ttole(0x4bfc7d58L), tole(0xa4cc1641L), tole(0x9070dd9bL), tole(0x7f40b682L),\n\ttole(0xf9094a2fL), tole(0x16392136L), tole(0x2285eaecL), tole(0xcdb581f5L),\n\ttole(0x2bfa6547L), tole(0xc4ca0e5eL), tole(0xf076c584L), tole(0x1f46ae9dL),\n\ttole(0x990f5230L), tole(0x763f3929L), tole(0x4283f2f3L), tole(0xadb399eaL),\n\ttole(0x1c08b7d6L), tole(0xf338dccfL), tole(0xc7841715L), tole(0x28b47c0cL),\n\ttole(0xaefd80a1L), tole(0x41cdebb8L), tole(0x75712062L), tole(0x9a414b7bL),\n\ttole(0x7c0eafc9L), tole(0x933ec4d0L), tole(0xa7820f0aL), tole(0x48b26413L),\n\ttole(0xcefb98beL), tole(0x21cbf3a7L), tole(0x1577387dL), tole(0xfa475364L),\n\ttole(0xdc0487e8L), tole(0x3334ecf1L), tole(0x0788272bL), tole(0xe8b84c32L),\n\ttole(0x6ef1b09fL), tole(0x81c1db86L), tole(0xb57d105cL), tole(0x5a4d7b45L),\n\ttole(0xbc029ff7L), tole(0x5332f4eeL), tole(0x678e3f34L), tole(0x88be542dL),\n\ttole(0x0ef7a880L), tole(0xe1c7c399L), tole(0xd57b0843L), tole(0x3a4b635aL),\n\ttole(0x99fca15bL), tole(0x76ccca42L), tole(0x42700198L), tole(0xad406a81L),\n\ttole(0x2b09962cL), tole(0xc439fd35L), tole(0xf08536efL), tole(0x1fb55df6L),\n\ttole(0xf9fab944L), tole(0x16cad25dL), tole(0x22761987L), tole(0xcd46729eL),\n\ttole(0x4b0f8e33L), tole(0xa43fe52aL), tole(0x90832ef0L), tole(0x7fb345e9L),\n\ttole(0x59f09165L), tole(0xb6c0fa7cL), tole(0x827c31a6L), tole(0x6d4c5abfL),\n\ttole(0xeb05a612L), tole(0x0435cd0bL), tole(0x308906d1L), tole(0xdfb96dc8L),\n\ttole(0x39f6897aL), tole(0xd6c6e263L), tole(0xe27a29b9L), tole(0x0d4a42a0L),\n\ttole(0x8b03be0dL), tole(0x6433d514L), tole(0x508f1eceL), tole(0xbfbf75d7L),\n\ttole(0x120cec3dL), tole(0xfd3c8724L), tole(0xc9804cfeL), tole(0x26b027e7L),\n\ttole(0xa0f9db4aL), tole(0x4fc9b053L), tole(0x7b757b89L), tole(0x94451090L),\n\ttole(0x720af422L), tole(0x9d3a9f3bL), tole(0xa98654e1L), tole(0x46b63ff8L),\n\ttole(0xc0ffc355L), tole(0x2fcfa84cL), tole(0x1b736396L), tole(0xf443088fL),\n\ttole(0xd200dc03L), tole(0x3d30b71aL), tole(0x098c7cc0L), tole(0xe6bc17d9L),\n\ttole(0x60f5eb74L), tole(0x8fc5806dL), tole(0xbb794bb7L), tole(0x544920aeL),\n\ttole(0xb206c41cL), tole(0x5d36af05L), tole(0x698a64dfL), tole(0x86ba0fc6L),\n\ttole(0x00f3f36bL), tole(0xefc39872L), tole(0xdb7f53a8L), tole(0x344f38b1L),\n\ttole(0x97f8fab0L), tole(0x78c891a9L), tole(0x4c745a73L), tole(0xa344316aL),\n\ttole(0x250dcdc7L), tole(0xca3da6deL), tole(0xfe816d04L), tole(0x11b1061dL),\n\ttole(0xf7fee2afL), tole(0x18ce89b6L), tole(0x2c72426cL), tole(0xc3422975L),\n\ttole(0x450bd5d8L), tole(0xaa3bbec1L), tole(0x9e87751bL), tole(0x71b71e02L),\n\ttole(0x57f4ca8eL), tole(0xb8c4a197L), tole(0x8c786a4dL), tole(0x63480154L),\n\ttole(0xe501fdf9L), tole(0x0a3196e0L), tole(0x3e8d5d3aL), tole(0xd1bd3623L),\n\ttole(0x37f2d291L), tole(0xd8c2b988L), tole(0xec7e7252L), tole(0x034e194bL),\n\ttole(0x8507e5e6L), tole(0x6a378effL), tole(0x5e8b4525L), tole(0xb1bb2e3cL)},\n\t{\n\ttole(0x00000000L), tole(0x68032cc8L), tole(0xd0065990L), tole(0xb8057558L),\n\ttole(0xa5e0c5d1L), tole(0xcde3e919L), tole(0x75e69c41L), tole(0x1de5b089L),\n\ttole(0x4e2dfd53L), tole(0x262ed19bL), tole(0x9e2ba4c3L), tole(0xf628880bL),\n\ttole(0xebcd3882L), tole(0x83ce144aL), tole(0x3bcb6112L), tole(0x53c84ddaL),\n\ttole(0x9c5bfaa6L), tole(0xf458d66eL), tole(0x4c5da336L), tole(0x245e8ffeL),\n\ttole(0x39bb3f77L), tole(0x51b813bfL), tole(0xe9bd66e7L), tole(0x81be4a2fL),\n\ttole(0xd27607f5L), tole(0xba752b3dL), tole(0x02705e65L), tole(0x6a7372adL),\n\ttole(0x7796c224L), tole(0x1f95eeecL), tole(0xa7909bb4L), tole(0xcf93b77cL),\n\ttole(0x3d5b83bdL), tole(0x5558af75L), tole(0xed5dda2dL), tole(0x855ef6e5L),\n\ttole(0x98bb466cL), tole(0xf0b86aa4L), tole(0x48bd1ffcL), tole(0x20be3334L),\n\ttole(0x73767eeeL), tole(0x1b755226L), tole(0xa370277eL), tole(0xcb730bb6L),\n\ttole(0xd696bb3fL), tole(0xbe9597f7L), tole(0x0690e2afL), tole(0x6e93ce67L),\n\ttole(0xa100791bL), tole(0xc90355d3L), tole(0x7106208bL), tole(0x19050c43L),\n\ttole(0x04e0bccaL), tole(0x6ce39002L), tole(0xd4e6e55aL), tole(0xbce5c992L),\n\ttole(0xef2d8448L), tole(0x872ea880L), tole(0x3f2bddd8L), tole(0x5728f110L),\n\ttole(0x4acd4199L), tole(0x22ce6d51L), tole(0x9acb1809L), tole(0xf2c834c1L),\n\ttole(0x7ab7077aL), tole(0x12b42bb2L), tole(0xaab15eeaL), tole(0xc2b27222L),\n\ttole(0xdf57c2abL), tole(0xb754ee63L), tole(0x0f519b3bL), tole(0x6752b7f3L),\n\ttole(0x349afa29L), tole(0x5c99d6e1L), tole(0xe49ca3b9L), tole(0x8c9f8f71L),\n\ttole(0x917a3ff8L), tole(0xf9791330L), tole(0x417c6668L), tole(0x297f4aa0L),\n\ttole(0xe6ecfddcL), tole(0x8eefd114L), tole(0x36eaa44cL), tole(0x5ee98884L),\n\ttole(0x430c380dL), tole(0x2b0f14c5L), tole(0x930a619dL), tole(0xfb094d55L),\n\ttole(0xa8c1008fL), tole(0xc0c22c47L), tole(0x78c7591fL), tole(0x10c475d7L),\n\ttole(0x0d21c55eL), tole(0x6522e996L), tole(0xdd279cceL), tole(0xb524b006L),\n\ttole(0x47ec84c7L), tole(0x2fefa80fL), tole(0x97eadd57L), tole(0xffe9f19fL),\n\ttole(0xe20c4116L), tole(0x8a0f6ddeL), tole(0x320a1886L), tole(0x5a09344eL),\n\ttole(0x09c17994L), tole(0x61c2555cL), tole(0xd9c72004L), tole(0xb1c40cccL),\n\ttole(0xac21bc45L), tole(0xc422908dL), tole(0x7c27e5d5L), tole(0x1424c91dL),\n\ttole(0xdbb77e61L), tole(0xb3b452a9L), tole(0x0bb127f1L), tole(0x63b20b39L),\n\ttole(0x7e57bbb0L), tole(0x16549778L), tole(0xae51e220L), tole(0xc652cee8L),\n\ttole(0x959a8332L), tole(0xfd99affaL), tole(0x459cdaa2L), tole(0x2d9ff66aL),\n\ttole(0x307a46e3L), tole(0x58796a2bL), tole(0xe07c1f73L), tole(0x887f33bbL),\n\ttole(0xf56e0ef4L), tole(0x9d6d223cL), tole(0x25685764L), tole(0x4d6b7bacL),\n\ttole(0x508ecb25L), tole(0x388de7edL), tole(0x808892b5L), tole(0xe88bbe7dL),\n\ttole(0xbb43f3a7L), tole(0xd340df6fL), tole(0x6b45aa37L), tole(0x034686ffL),\n\ttole(0x1ea33676L), tole(0x76a01abeL), tole(0xcea56fe6L), tole(0xa6a6432eL),\n\ttole(0x6935f452L), tole(0x0136d89aL), tole(0xb933adc2L), tole(0xd130810aL),\n\ttole(0xccd53183L), tole(0xa4d61d4bL), tole(0x1cd36813L), tole(0x74d044dbL),\n\ttole(0x27180901L), tole(0x4f1b25c9L), tole(0xf71e5091L), tole(0x9f1d7c59L),\n\ttole(0x82f8ccd0L), tole(0xeafbe018L), tole(0x52fe9540L), tole(0x3afdb988L),\n\ttole(0xc8358d49L), tole(0xa036a181L), tole(0x1833d4d9L), tole(0x7030f811L),\n\ttole(0x6dd54898L), tole(0x05d66450L), tole(0xbdd31108L), tole(0xd5d03dc0L),\n\ttole(0x8618701aL), tole(0xee1b5cd2L), tole(0x561e298aL), tole(0x3e1d0542L),\n\ttole(0x23f8b5cbL), tole(0x4bfb9903L), tole(0xf3feec5bL), tole(0x9bfdc093L),\n\ttole(0x546e77efL), tole(0x3c6d5b27L), tole(0x84682e7fL), tole(0xec6b02b7L),\n\ttole(0xf18eb23eL), tole(0x998d9ef6L), tole(0x2188ebaeL), tole(0x498bc766L),\n\ttole(0x1a438abcL), tole(0x7240a674L), tole(0xca45d32cL), tole(0xa246ffe4L),\n\ttole(0xbfa34f6dL), tole(0xd7a063a5L), tole(0x6fa516fdL), tole(0x07a63a35L),\n\ttole(0x8fd9098eL), tole(0xe7da2546L), tole(0x5fdf501eL), tole(0x37dc7cd6L),\n\ttole(0x2a39cc5fL), tole(0x423ae097L), tole(0xfa3f95cfL), tole(0x923cb907L),\n\ttole(0xc1f4f4ddL), tole(0xa9f7d815L), tole(0x11f2ad4dL), tole(0x79f18185L),\n\ttole(0x6414310cL), tole(0x0c171dc4L), tole(0xb412689cL), tole(0xdc114454L),\n\ttole(0x1382f328L), tole(0x7b81dfe0L), tole(0xc384aab8L), tole(0xab878670L),\n\ttole(0xb66236f9L), tole(0xde611a31L), tole(0x66646f69L), tole(0x0e6743a1L),\n\ttole(0x5daf0e7bL), tole(0x35ac22b3L), tole(0x8da957ebL), tole(0xe5aa7b23L),\n\ttole(0xf84fcbaaL), tole(0x904ce762L), tole(0x2849923aL), tole(0x404abef2L),\n\ttole(0xb2828a33L), tole(0xda81a6fbL), tole(0x6284d3a3L), tole(0x0a87ff6bL),\n\ttole(0x17624fe2L), tole(0x7f61632aL), tole(0xc7641672L), tole(0xaf673abaL),\n\ttole(0xfcaf7760L), tole(0x94ac5ba8L), tole(0x2ca92ef0L), tole(0x44aa0238L),\n\ttole(0x594fb2b1L), tole(0x314c9e79L), tole(0x8949eb21L), tole(0xe14ac7e9L),\n\ttole(0x2ed97095L), tole(0x46da5c5dL), tole(0xfedf2905L), tole(0x96dc05cdL),\n\ttole(0x8b39b544L), tole(0xe33a998cL), tole(0x5b3fecd4L), tole(0x333cc01cL),\n\ttole(0x60f48dc6L), tole(0x08f7a10eL), tole(0xb0f2d456L), tole(0xd8f1f89eL),\n\ttole(0xc5144817L), tole(0xad1764dfL), tole(0x15121187L), tole(0x7d113d4fL)},\n\t{\n\ttole(0x00000000L), tole(0x493c7d27L), tole(0x9278fa4eL), tole(0xdb448769L),\n\ttole(0x211d826dL), tole(0x6821ff4aL), tole(0xb3657823L), tole(0xfa590504L),\n\ttole(0x423b04daL), tole(0x0b0779fdL), tole(0xd043fe94L), tole(0x997f83b3L),\n\ttole(0x632686b7L), tole(0x2a1afb90L), tole(0xf15e7cf9L), tole(0xb86201deL),\n\ttole(0x847609b4L), tole(0xcd4a7493L), tole(0x160ef3faL), tole(0x5f328eddL),\n\ttole(0xa56b8bd9L), tole(0xec57f6feL), tole(0x37137197L), tole(0x7e2f0cb0L),\n\ttole(0xc64d0d6eL), tole(0x8f717049L), tole(0x5435f720L), tole(0x1d098a07L),\n\ttole(0xe7508f03L), tole(0xae6cf224L), tole(0x7528754dL), tole(0x3c14086aL),\n\ttole(0x0d006599L), tole(0x443c18beL), tole(0x9f789fd7L), tole(0xd644e2f0L),\n\ttole(0x2c1de7f4L), tole(0x65219ad3L), tole(0xbe651dbaL), tole(0xf759609dL),\n\ttole(0x4f3b6143L), tole(0x06071c64L), tole(0xdd439b0dL), tole(0x947fe62aL),\n\ttole(0x6e26e32eL), tole(0x271a9e09L), tole(0xfc5e1960L), tole(0xb5626447L),\n\ttole(0x89766c2dL), tole(0xc04a110aL), tole(0x1b0e9663L), tole(0x5232eb44L),\n\ttole(0xa86bee40L), tole(0xe1579367L), tole(0x3a13140eL), tole(0x732f6929L),\n\ttole(0xcb4d68f7L), tole(0x827115d0L), tole(0x593592b9L), tole(0x1009ef9eL),\n\ttole(0xea50ea9aL), tole(0xa36c97bdL), tole(0x782810d4L), tole(0x31146df3L),\n\ttole(0x1a00cb32L), tole(0x533cb615L), tole(0x8878317cL), tole(0xc1444c5bL),\n\ttole(0x3b1d495fL), tole(0x72213478L), tole(0xa965b311L), tole(0xe059ce36L),\n\ttole(0x583bcfe8L), tole(0x1107b2cfL), tole(0xca4335a6L), tole(0x837f4881L),\n\ttole(0x79264d85L), tole(0x301a30a2L), tole(0xeb5eb7cbL), tole(0xa262caecL),\n\ttole(0x9e76c286L), tole(0xd74abfa1L), tole(0x0c0e38c8L), tole(0x453245efL),\n\ttole(0xbf6b40ebL), tole(0xf6573dccL), tole(0x2d13baa5L), tole(0x642fc782L),\n\ttole(0xdc4dc65cL), tole(0x9571bb7bL), tole(0x4e353c12L), tole(0x07094135L),\n\ttole(0xfd504431L), tole(0xb46c3916L), tole(0x6f28be7fL), tole(0x2614c358L),\n\ttole(0x1700aeabL), tole(0x5e3cd38cL), tole(0x857854e5L), tole(0xcc4429c2L),\n\ttole(0x361d2cc6L), tole(0x7f2151e1L), tole(0xa465d688L), tole(0xed59abafL),\n\ttole(0x553baa71L), tole(0x1c07d756L), tole(0xc743503fL), tole(0x8e7f2d18L),\n\ttole(0x7426281cL), tole(0x3d1a553bL), tole(0xe65ed252L), tole(0xaf62af75L),\n\ttole(0x9376a71fL), tole(0xda4ada38L), tole(0x010e5d51L), tole(0x48322076L),\n\ttole(0xb26b2572L), tole(0xfb575855L), tole(0x2013df3cL), tole(0x692fa21bL),\n\ttole(0xd14da3c5L), tole(0x9871dee2L), tole(0x4335598bL), tole(0x0a0924acL),\n\ttole(0xf05021a8L), tole(0xb96c5c8fL), tole(0x6228dbe6L), tole(0x2b14a6c1L),\n\ttole(0x34019664L), tole(0x7d3deb43L), tole(0xa6796c2aL), tole(0xef45110dL),\n\ttole(0x151c1409L), tole(0x5c20692eL), tole(0x8764ee47L), tole(0xce589360L),\n\ttole(0x763a92beL), tole(0x3f06ef99L), tole(0xe44268f0L), tole(0xad7e15d7L),\n\ttole(0x572710d3L), tole(0x1e1b6df4L), tole(0xc55fea9dL), tole(0x8c6397baL),\n\ttole(0xb0779fd0L), tole(0xf94be2f7L), tole(0x220f659eL), tole(0x6b3318b9L),\n\ttole(0x916a1dbdL), tole(0xd856609aL), tole(0x0312e7f3L), tole(0x4a2e9ad4L),\n\ttole(0xf24c9b0aL), tole(0xbb70e62dL), tole(0x60346144L), tole(0x29081c63L),\n\ttole(0xd3511967L), tole(0x9a6d6440L), tole(0x4129e329L), tole(0x08159e0eL),\n\ttole(0x3901f3fdL), tole(0x703d8edaL), tole(0xab7909b3L), tole(0xe2457494L),\n\ttole(0x181c7190L), tole(0x51200cb7L), tole(0x8a648bdeL), tole(0xc358f6f9L),\n\ttole(0x7b3af727L), tole(0x32068a00L), tole(0xe9420d69L), tole(0xa07e704eL),\n\ttole(0x5a27754aL), tole(0x131b086dL), tole(0xc85f8f04L), tole(0x8163f223L),\n\ttole(0xbd77fa49L), tole(0xf44b876eL), tole(0x2f0f0007L), tole(0x66337d20L),\n\ttole(0x9c6a7824L), tole(0xd5560503L), tole(0x0e12826aL), tole(0x472eff4dL),\n\ttole(0xff4cfe93L), tole(0xb67083b4L), tole(0x6d3404ddL), tole(0x240879faL),\n\ttole(0xde517cfeL), tole(0x976d01d9L), tole(0x4c2986b0L), tole(0x0515fb97L),\n\ttole(0x2e015d56L), tole(0x673d2071L), tole(0xbc79a718L), tole(0xf545da3fL),\n\ttole(0x0f1cdf3bL), tole(0x4620a21cL), tole(0x9d642575L), tole(0xd4585852L),\n\ttole(0x6c3a598cL), tole(0x250624abL), tole(0xfe42a3c2L), tole(0xb77edee5L),\n\ttole(0x4d27dbe1L), tole(0x041ba6c6L), tole(0xdf5f21afL), tole(0x96635c88L),\n\ttole(0xaa7754e2L), tole(0xe34b29c5L), tole(0x380faeacL), tole(0x7133d38bL),\n\ttole(0x8b6ad68fL), tole(0xc256aba8L), tole(0x19122cc1L), tole(0x502e51e6L),\n\ttole(0xe84c5038L), tole(0xa1702d1fL), tole(0x7a34aa76L), tole(0x3308d751L),\n\ttole(0xc951d255L), tole(0x806daf72L), tole(0x5b29281bL), tole(0x1215553cL),\n\ttole(0x230138cfL), tole(0x6a3d45e8L), tole(0xb179c281L), tole(0xf845bfa6L),\n\ttole(0x021cbaa2L), tole(0x4b20c785L), tole(0x906440ecL), tole(0xd9583dcbL),\n\ttole(0x613a3c15L), tole(0x28064132L), tole(0xf342c65bL), tole(0xba7ebb7cL),\n\ttole(0x4027be78L), tole(0x091bc35fL), tole(0xd25f4436L), tole(0x9b633911L),\n\ttole(0xa777317bL), tole(0xee4b4c5cL), tole(0x350fcb35L), tole(0x7c33b612L),\n\ttole(0x866ab316L), tole(0xcf56ce31L), tole(0x14124958L), tole(0x5d2e347fL),\n\ttole(0xe54c35a1L), tole(0xac704886L), tole(0x7734cfefL), tole(0x3e08b2c8L),\n\ttole(0xc451b7ccL), tole(0x8d6dcaebL), tole(0x56294d82L), tole(0x1f1530a5L)},\n};\n"
  },
  {
    "path": "src/ext2fs/csum.c",
    "content": "/*\n * csum.c --- checksumming of ext3 structures\n *\n * Copyright (C) 2006 Cluster File Systems, Inc.\n * Copyright (C) 2006, 2007 by Andreas Dilger <adilger@clusterfs.com>\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n#include \"crc16.h\"\n#include <assert.h>\n\n#ifndef offsetof\n#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)\n#endif\n\n#ifdef DEBUG\n#define STATIC\n#else\n#define STATIC static\n#endif\n\nvoid ext2fs_init_csum_seed(ext2_filsys fs)\n{\n\tif (ext2fs_has_feature_csum_seed(fs->super))\n\t\tfs->csum_seed = fs->super->s_checksum_seed;\n\telse if (ext2fs_has_feature_metadata_csum(fs->super) ||\n\t\t ext2fs_has_feature_ea_inode(fs->super))\n\t\tfs->csum_seed = ext2fs_crc32c_le(~0, fs->super->s_uuid,\n\t\t\t\t\t\t sizeof(fs->super->s_uuid));\n}\n\nstatic __u32 ext2fs_mmp_csum(ext2_filsys fs, struct mmp_struct *mmp)\n{\n\tint offset = offsetof(struct mmp_struct, mmp_checksum);\n\n\treturn ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)mmp, offset);\n}\n\nint ext2fs_mmp_csum_verify(ext2_filsys fs, struct mmp_struct *mmp)\n{\n\t__u32 calculated;\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 1;\n\n\tcalculated = ext2fs_mmp_csum(fs, mmp);\n\n\treturn ext2fs_le32_to_cpu(mmp->mmp_checksum) == calculated;\n}\n\nerrcode_t ext2fs_mmp_csum_set(ext2_filsys fs, struct mmp_struct *mmp)\n{\n\t__u32 crc;\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 0;\n\n\tcrc = ext2fs_mmp_csum(fs, mmp);\n\tmmp->mmp_checksum = ext2fs_cpu_to_le32(crc);\n\n\treturn 0;\n}\n\nint ext2fs_verify_csum_type(ext2_filsys fs, struct ext2_super_block *sb)\n{\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 1;\n\n\treturn sb->s_checksum_type == EXT2_CRC32C_CHKSUM;\n}\n\nstatic __u32 ext2fs_superblock_csum(ext2_filsys fs EXT2FS_ATTR((unused)),\n\t\t\t\t    struct ext2_super_block *sb)\n{\n\tint offset = offsetof(struct ext2_super_block, s_checksum);\n\n\treturn ext2fs_crc32c_le(~0, (unsigned char *)sb, offset);\n}\n\n/* NOTE: The input to this function MUST be in LE order */\nint ext2fs_superblock_csum_verify(ext2_filsys fs, struct ext2_super_block *sb)\n{\n\t__u32 flag, calculated;\n\n\tif (fs->flags & EXT2_FLAG_SWAP_BYTES)\n\t\tflag = EXT4_FEATURE_RO_COMPAT_METADATA_CSUM;\n\telse\n\t\tflag = ext2fs_cpu_to_le32(EXT4_FEATURE_RO_COMPAT_METADATA_CSUM);\n\n\tif (!EXT2_HAS_RO_COMPAT_FEATURE(fs->super, flag))\n\t\treturn 1;\n\n\tcalculated = ext2fs_superblock_csum(fs, sb);\n\n\treturn ext2fs_le32_to_cpu(sb->s_checksum) == calculated;\n}\n\n/* NOTE: The input to this function MUST be in LE order */\nerrcode_t ext2fs_superblock_csum_set(ext2_filsys fs,\n\t\t\t\t     struct ext2_super_block *sb)\n{\n\t__u32 flag, crc;\n\n\tif (fs->flags & EXT2_FLAG_SWAP_BYTES)\n\t\tflag = EXT4_FEATURE_RO_COMPAT_METADATA_CSUM;\n\telse\n\t\tflag = ext2fs_cpu_to_le32(EXT4_FEATURE_RO_COMPAT_METADATA_CSUM);\n\n\tif (!EXT2_HAS_RO_COMPAT_FEATURE(fs->super, flag))\n\t\treturn 0;\n\n\tcrc = ext2fs_superblock_csum(fs, sb);\n\tsb->s_checksum = ext2fs_cpu_to_le32(crc);\n\n\treturn 0;\n}\n\nstatic errcode_t ext2fs_ext_attr_block_csum(ext2_filsys fs,\n\t\t\t\t\t    ext2_ino_t inum EXT2FS_ATTR((unused)),\n\t\t\t\t\t    blk64_t block,\n\t\t\t\t\t    struct ext2_ext_attr_header *hdr,\n\t\t\t\t\t    __u32 *crc)\n{\n\tchar *buf = (char *)hdr;\n\t__u32 old_crc = hdr->h_checksum;\n\n\thdr->h_checksum = 0;\n\tblock = ext2fs_cpu_to_le64(block);\n\t*crc = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)&block,\n\t\t\t\tsizeof(block));\n\t*crc = ext2fs_crc32c_le(*crc, (unsigned char *)buf, fs->blocksize);\n\thdr->h_checksum = old_crc;\n\n\treturn 0;\n}\n\nint ext2fs_ext_attr_block_csum_verify(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t      blk64_t block,\n\t\t\t\t      struct ext2_ext_attr_header *hdr)\n{\n\t__u32 calculated;\n\terrcode_t retval;\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 1;\n\n\tretval = ext2fs_ext_attr_block_csum(fs, inum, block, hdr, &calculated);\n\tif (retval)\n\t\treturn 0;\n\n\treturn ext2fs_le32_to_cpu(hdr->h_checksum) == calculated;\n}\n\nerrcode_t ext2fs_ext_attr_block_csum_set(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t\t blk64_t block,\n\t\t\t\t\t struct ext2_ext_attr_header *hdr)\n{\n\terrcode_t retval;\n\t__u32 crc;\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 0;\n\n\tretval = ext2fs_ext_attr_block_csum(fs, inum, block, hdr, &crc);\n\tif (retval)\n\t\treturn retval;\n\thdr->h_checksum = ext2fs_cpu_to_le32(crc);\n\treturn 0;\n}\n\nstatic __u16 do_nothing16(__u16 x)\n{\n\treturn x;\n}\n\nstatic __u16 disk_to_host16(__u16 x)\n{\n\treturn ext2fs_le16_to_cpu(x);\n}\n\nstatic errcode_t __get_dx_countlimit(ext2_filsys fs,\n\t\t\t\t     struct ext2_dir_entry *dirent,\n\t\t\t\t     struct ext2_dx_countlimit **cc,\n\t\t\t\t     int *offset,\n\t\t\t\t     int need_swab)\n{\n\tstruct ext2_dir_entry *dp;\n\tstruct ext2_dx_root_info *root;\n\tstruct ext2_dx_countlimit *c;\n\tint count_offset, max_sane_entries;\n\tunsigned int rec_len;\n\t__u16 (*translate)(__u16) = (need_swab ? disk_to_host16 : do_nothing16);\n\n\trec_len = translate(dirent->rec_len);\n\n\tif (rec_len == fs->blocksize && translate(dirent->name_len) == 0)\n\t\tcount_offset = 8;\n\telse if (rec_len == 12) {\n\t\tdp = (struct ext2_dir_entry *)(((char *)dirent) + rec_len);\n\t\trec_len = translate(dp->rec_len);\n\t\tif (rec_len != fs->blocksize - 12)\n\t\t\treturn EXT2_ET_DB_NOT_FOUND;\n\t\troot = (struct ext2_dx_root_info *)(((char *)dp + 12));\n\t\tif (root->reserved_zero ||\n\t\t    root->info_length != sizeof(struct ext2_dx_root_info))\n\t\t\treturn EXT2_ET_DB_NOT_FOUND;\n\t\tcount_offset = 32;\n\t} else\n\t\treturn EXT2_ET_DB_NOT_FOUND;\n\n\tc = (struct ext2_dx_countlimit *)(((char *)dirent) + count_offset);\n\tmax_sane_entries = (fs->blocksize - count_offset) /\n\t\t\t   sizeof(struct ext2_dx_entry);\n\tif (ext2fs_le16_to_cpu(c->limit) > max_sane_entries ||\n\t    ext2fs_le16_to_cpu(c->count) > max_sane_entries)\n\t\treturn EXT2_ET_DIR_NO_SPACE_FOR_CSUM;\n\n\tif (offset)\n\t\t*offset = count_offset;\n\tif (cc)\n\t\t*cc = c;\n\n\treturn 0;\n}\n\nerrcode_t ext2fs_get_dx_countlimit(ext2_filsys fs,\n\t\t\t\t   struct ext2_dir_entry *dirent,\n\t\t\t\t   struct ext2_dx_countlimit **cc,\n\t\t\t\t   int *offset)\n{\n\treturn __get_dx_countlimit(fs, dirent, cc, offset, 0);\n}\n\nvoid ext2fs_initialize_dirent_tail(ext2_filsys fs,\n\t\t\t\t   struct ext2_dir_entry_tail *t)\n{\n\tmemset(t, 0, sizeof(struct ext2_dir_entry_tail));\n\text2fs_set_rec_len(fs, sizeof(struct ext2_dir_entry_tail),\n\t\t\t   (struct ext2_dir_entry *)t);\n\tt->det_reserved_name_len = EXT2_DIR_NAME_LEN_CSUM;\n}\n\nstatic errcode_t __get_dirent_tail(ext2_filsys fs,\n\t\t\t\t   struct ext2_dir_entry *dirent,\n\t\t\t\t   struct ext2_dir_entry_tail **tt,\n\t\t\t\t   int need_swab)\n{\n\tstruct ext2_dir_entry *d;\n\tvoid *top;\n\tstruct ext2_dir_entry_tail *t;\n\tunsigned int rec_len;\n\terrcode_t retval = 0;\n\t__u16 (*translate)(__u16) = (need_swab ? disk_to_host16 : do_nothing16);\n\n\td = dirent;\n\ttop = EXT2_DIRENT_TAIL(dirent, fs->blocksize);\n\n\twhile ((void *) d < top) {\n\t\trec_len = translate(d->rec_len);\n\t\tif ((rec_len < 8) || (rec_len & 0x03))\n\t\t\treturn EXT2_ET_DIR_CORRUPTED;\n\t\td = (struct ext2_dir_entry *)(((char *)d) + rec_len);\n\t}\n\n\tif ((char *)d > ((char *)dirent + fs->blocksize))\n\t\t\treturn EXT2_ET_DIR_CORRUPTED;\n\tif (d != top)\n\t\treturn EXT2_ET_DIR_NO_SPACE_FOR_CSUM;\n\n\tt = (struct ext2_dir_entry_tail *)d;\n\tif (t->det_reserved_zero1 ||\n\t    translate(t->det_rec_len) != sizeof(struct ext2_dir_entry_tail) ||\n\t    translate(t->det_reserved_name_len) != EXT2_DIR_NAME_LEN_CSUM)\n\t\treturn EXT2_ET_DIR_NO_SPACE_FOR_CSUM;\n\n\tif (tt)\n\t\t*tt = t;\n\treturn retval;\n}\n\nint ext2fs_dirent_has_tail(ext2_filsys fs, struct ext2_dir_entry *dirent)\n{\n\treturn __get_dirent_tail(fs, dirent, NULL, 0) !=\n\t\tEXT2_ET_DIR_NO_SPACE_FOR_CSUM;\n}\n\nstatic errcode_t ext2fs_dirent_csum(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t    struct ext2_dir_entry *dirent, __u32 *crc,\n\t\t\t\t    int size)\n{\n\terrcode_t retval;\n\tchar *buf = (char *)dirent;\n\t__u32 gen;\n\tstruct ext2_inode inode;\n\n\tretval = ext2fs_read_inode(fs, inum, &inode);\n\tif (retval)\n\t\treturn retval;\n\n\tinum = ext2fs_cpu_to_le32(inum);\n\tgen = ext2fs_cpu_to_le32(inode.i_generation);\n\t*crc = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)&inum,\n\t\t\t\tsizeof(inum));\n\t*crc = ext2fs_crc32c_le(*crc, (unsigned char *)&gen, sizeof(gen));\n\t*crc = ext2fs_crc32c_le(*crc, (unsigned char *)buf, size);\n\n\treturn 0;\n}\n\nint ext2fs_dirent_csum_verify(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t      struct ext2_dir_entry *dirent)\n{\n\terrcode_t retval;\n\t__u32 calculated;\n\tstruct ext2_dir_entry_tail *t;\n\n\tretval = __get_dirent_tail(fs, dirent, &t, 1);\n\tif (retval)\n\t\treturn 1;\n\n\t/*\n\t * The checksum field is overlaid with the dirent->name field\n\t * so the swapfs.c functions won't change the endianness.\n\t */\n\tretval = ext2fs_dirent_csum(fs, inum, dirent, &calculated,\n\t\t\t\t    (char *)t - (char *)dirent);\n\tif (retval)\n\t\treturn 0;\n\treturn ext2fs_le32_to_cpu(t->det_checksum) == calculated;\n}\n\nstatic errcode_t ext2fs_dirent_csum_set(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t\tstruct ext2_dir_entry *dirent)\n{\n\terrcode_t retval;\n\t__u32 crc;\n\tstruct ext2_dir_entry_tail *t;\n\n\tretval = __get_dirent_tail(fs, dirent, &t, 1);\n\tif (retval)\n\t\treturn retval;\n\n\t/* swapfs.c functions don't change the checksum endianness */\n\tretval = ext2fs_dirent_csum(fs, inum, dirent, &crc,\n\t\t\t\t    (char *)t - (char *)dirent);\n\tif (retval)\n\t\treturn retval;\n\tt->det_checksum = ext2fs_cpu_to_le32(crc);\n\treturn 0;\n}\n\nerrcode_t ext2fs_dx_csum(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t struct ext2_dir_entry *dirent,\n\t\t\t __u32 *crc, struct ext2_dx_tail **ret_t)\n{\n\terrcode_t retval;\n\tchar *buf = (char *)dirent;\n\tint size;\n\t__u32 gen, dummy_csum = 0;\n\tstruct ext2_inode inode;\n\tstruct ext2_dx_tail *t;\n\tstruct ext2_dx_countlimit *c;\n\tint count_offset, limit, count;\n\n\tretval = __get_dx_countlimit(fs, dirent, &c, &count_offset, 1);\n\tif (retval)\n\t\treturn retval;\n\tlimit = ext2fs_le16_to_cpu(c->limit);\n\tcount = ext2fs_le16_to_cpu(c->count);\n\tif (count_offset + (limit * sizeof(struct ext2_dx_entry)) >\n\t    fs->blocksize - sizeof(struct ext2_dx_tail))\n\t\treturn EXT2_ET_DIR_NO_SPACE_FOR_CSUM;\n\t/* htree structs are accessed in LE order */\n\tt = (struct ext2_dx_tail *)(((struct ext2_dx_entry *)c) + limit);\n\n\tsize = count_offset + (count * sizeof(struct ext2_dx_entry));\n\n\tretval = ext2fs_read_inode(fs, inum, &inode);\n\tif (retval)\n\t\treturn retval;\n\n\tinum = ext2fs_cpu_to_le32(inum);\n\tgen = ext2fs_cpu_to_le32(inode.i_generation);\n\t*crc = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)&inum,\n\t\t\t\tsizeof(inum));\n\t*crc = ext2fs_crc32c_le(*crc, (unsigned char *)&gen, sizeof(gen));\n\t*crc = ext2fs_crc32c_le(*crc, (unsigned char *)buf, size);\n\t*crc = ext2fs_crc32c_le(*crc, (unsigned char *)t, 4);\n\t*crc = ext2fs_crc32c_le(*crc, (unsigned char *)&dummy_csum, 4);\n\n\tif (ret_t)\n\t\t*ret_t = t;\n\treturn 0;\n}\n\nstatic int ext2fs_dx_csum_verify(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t struct ext2_dir_entry *dirent)\n{\n\t__u32 calculated;\n\terrcode_t retval;\n\tstruct ext2_dx_tail *t;\n\n\tretval = ext2fs_dx_csum(fs, inum, dirent, &calculated, &t);\n\tif (retval)\n\t\treturn 0;\n\n\treturn ext2fs_le32_to_cpu(t->dt_checksum) == calculated;\n}\n\nstatic errcode_t ext2fs_dx_csum_set(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t    struct ext2_dir_entry *dirent)\n{\n\t__u32 crc;\n\terrcode_t retval = 0;\n\tstruct ext2_dx_tail *t;\n\n\tretval = ext2fs_dx_csum(fs, inum, dirent, &crc, &t);\n\tif (retval)\n\t\treturn retval;\n\tt->dt_checksum = ext2fs_cpu_to_le32(crc);\n\treturn retval;\n}\n\nint ext2fs_dir_block_csum_verify(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t struct ext2_dir_entry *dirent)\n{\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 1;\n\n\tif (__get_dirent_tail(fs, dirent, NULL, 1) == 0)\n\t\treturn ext2fs_dirent_csum_verify(fs, inum, dirent);\n\tif (__get_dx_countlimit(fs, dirent, NULL, NULL, 1) == 0)\n\t\treturn ext2fs_dx_csum_verify(fs, inum, dirent);\n\n\treturn 0;\n}\n\nerrcode_t ext2fs_dir_block_csum_set(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t    struct ext2_dir_entry *dirent)\n{\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 0;\n\n\tif (__get_dirent_tail(fs, dirent, NULL, 1) == 0)\n\t\treturn ext2fs_dirent_csum_set(fs, inum, dirent);\n\tif (__get_dx_countlimit(fs, dirent, NULL, NULL, 1) == 0)\n\t\treturn ext2fs_dx_csum_set(fs, inum, dirent);\n\n\tif (fs->flags & EXT2_FLAG_IGNORE_CSUM_ERRORS)\n\t\treturn 0;\n\treturn EXT2_ET_DIR_NO_SPACE_FOR_CSUM;\n}\n\n#define EXT3_EXTENT_TAIL_OFFSET(hdr)\t(sizeof(struct ext3_extent_header) + \\\n\t(sizeof(struct ext3_extent) * ext2fs_le16_to_cpu((hdr)->eh_max)))\n\nstatic struct ext3_extent_tail *get_extent_tail(struct ext3_extent_header *h)\n{\n\treturn (struct ext3_extent_tail *)(((char *)h) +\n\t\t\t\t\t   EXT3_EXTENT_TAIL_OFFSET(h));\n}\n\nstatic errcode_t ext2fs_extent_block_csum(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t\t  struct ext3_extent_header *eh,\n\t\t\t\t\t  __u32 *crc)\n{\n\tint size;\n\t__u32 gen;\n\terrcode_t retval;\n\tstruct ext2_inode inode;\n\n\tsize = EXT3_EXTENT_TAIL_OFFSET(eh) + offsetof(struct ext3_extent_tail,\n\t\t\t\t\t\t      et_checksum);\n\n\tretval = ext2fs_read_inode(fs, inum, &inode);\n\tif (retval)\n\t\treturn retval;\n\tinum = ext2fs_cpu_to_le32(inum);\n\tgen = ext2fs_cpu_to_le32(inode.i_generation);\n\t*crc = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)&inum,\n\t\t\t\tsizeof(inum));\n\t*crc = ext2fs_crc32c_le(*crc, (unsigned char *)&gen, sizeof(gen));\n\t*crc = ext2fs_crc32c_le(*crc, (unsigned char *)eh, size);\n\n\treturn 0;\n}\n\nint ext2fs_extent_block_csum_verify(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t    struct ext3_extent_header *eh)\n{\n\terrcode_t retval;\n\t__u32 provided, calculated;\n\tstruct ext3_extent_tail *t = get_extent_tail(eh);\n\n\t/*\n\t * The extent tree structures are accessed in LE order, so we must\n\t * swap the checksum bytes here.\n\t */\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 1;\n\n\tprovided = ext2fs_le32_to_cpu(t->et_checksum);\n\tretval = ext2fs_extent_block_csum(fs, inum, eh, &calculated);\n\tif (retval)\n\t\treturn 0;\n\n\treturn provided == calculated;\n}\n\nerrcode_t ext2fs_extent_block_csum_set(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t       struct ext3_extent_header *eh)\n{\n\terrcode_t retval;\n\t__u32 crc;\n\tstruct ext3_extent_tail *t = get_extent_tail(eh);\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 0;\n\n\t/*\n\t * The extent tree structures are accessed in LE order, so we must\n\t * swap the checksum bytes here.\n\t */\n\tretval = ext2fs_extent_block_csum(fs, inum, eh, &crc);\n\tif (retval)\n\t\treturn retval;\n\tt->et_checksum = ext2fs_cpu_to_le32(crc);\n\treturn retval;\n}\n\nint ext2fs_inode_bitmap_csum_verify(ext2_filsys fs, dgrp_t group,\n\t\t\t\t    char *bitmap, int size)\n{\n\tstruct ext4_group_desc *gdp = (struct ext4_group_desc *)\n\t\t\text2fs_group_desc(fs, fs->group_desc, group);\n\t__u32 provided, calculated;\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 1;\n\tprovided = gdp->bg_inode_bitmap_csum_lo;\n\tcalculated = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)bitmap,\n\t\t\t\t      size);\n\tif (EXT2_DESC_SIZE(fs->super) >= EXT4_BG_INODE_BITMAP_CSUM_HI_END)\n\t\tprovided |= (__u32)gdp->bg_inode_bitmap_csum_hi << 16;\n\telse\n\t\tcalculated &= 0xFFFF;\n\n\treturn provided == calculated;\n}\n\nerrcode_t ext2fs_inode_bitmap_csum_set(ext2_filsys fs, dgrp_t group,\n\t\t\t\t       char *bitmap, int size)\n{\n\t__u32 crc;\n\tstruct ext4_group_desc *gdp = (struct ext4_group_desc *)\n\t\t\text2fs_group_desc(fs, fs->group_desc, group);\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 0;\n\n\tcrc = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)bitmap, size);\n\tgdp->bg_inode_bitmap_csum_lo = crc & 0xFFFF;\n\tif (EXT2_DESC_SIZE(fs->super) >= EXT4_BG_INODE_BITMAP_CSUM_HI_END)\n\t\tgdp->bg_inode_bitmap_csum_hi = crc >> 16;\n\n\treturn 0;\n}\n\nint ext2fs_block_bitmap_csum_verify(ext2_filsys fs, dgrp_t group,\n\t\t\t\t    char *bitmap, int size)\n{\n\tstruct ext4_group_desc *gdp = (struct ext4_group_desc *)\n\t\t\text2fs_group_desc(fs, fs->group_desc, group);\n\t__u32 provided, calculated;\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 1;\n\tprovided = gdp->bg_block_bitmap_csum_lo;\n\tcalculated = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)bitmap,\n\t\t\t\t      size);\n\tif (EXT2_DESC_SIZE(fs->super) >= EXT4_BG_BLOCK_BITMAP_CSUM_HI_LOCATION)\n\t\tprovided |= (__u32)gdp->bg_block_bitmap_csum_hi << 16;\n\telse\n\t\tcalculated &= 0xFFFF;\n\n\treturn provided == calculated;\n}\n\nerrcode_t ext2fs_block_bitmap_csum_set(ext2_filsys fs, dgrp_t group,\n\t\t\t\t       char *bitmap, int size)\n{\n\t__u32 crc;\n\tstruct ext4_group_desc *gdp = (struct ext4_group_desc *)\n\t\t\text2fs_group_desc(fs, fs->group_desc, group);\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 0;\n\n\tcrc = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)bitmap, size);\n\tgdp->bg_block_bitmap_csum_lo = crc & 0xFFFF;\n\tif (EXT2_DESC_SIZE(fs->super) >= EXT4_BG_BLOCK_BITMAP_CSUM_HI_LOCATION)\n\t\tgdp->bg_block_bitmap_csum_hi = crc >> 16;\n\n\treturn 0;\n}\n\nstatic errcode_t ext2fs_inode_csum(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t       struct ext2_inode_large *inode,\n\t\t\t       __u32 *crc, int has_hi)\n{\n\t__u32 gen;\n\tstruct ext2_inode_large *desc = inode;\n\tsize_t size = EXT2_INODE_SIZE(fs->super);\n\t__u16 old_lo;\n\t__u16 old_hi = 0;\n\n\told_lo = inode->i_checksum_lo;\n\tinode->i_checksum_lo = 0;\n\tif (has_hi) {\n\t\told_hi = inode->i_checksum_hi;\n\t\tinode->i_checksum_hi = 0;\n\t}\n\n\tinum = ext2fs_cpu_to_le32(inum);\n\tgen = inode->i_generation;\n\t*crc = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)&inum,\n\t\t\t\tsizeof(inum));\n\t*crc = ext2fs_crc32c_le(*crc, (unsigned char *)&gen, sizeof(gen));\n\t*crc = ext2fs_crc32c_le(*crc, (unsigned char *)desc, size);\n\n\tinode->i_checksum_lo = old_lo;\n\tif (has_hi)\n\t\tinode->i_checksum_hi = old_hi;\n\treturn 0;\n}\n\nint ext2fs_inode_csum_verify(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t     struct ext2_inode_large *inode)\n{\n\terrcode_t retval;\n\t__u32 provided, calculated;\n\tunsigned int i, has_hi;\n\tchar *cp;\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 1;\n\n\thas_hi = (EXT2_INODE_SIZE(fs->super) > EXT2_GOOD_OLD_INODE_SIZE &&\n\t\t  inode->i_extra_isize >= EXT4_INODE_CSUM_HI_EXTRA_END);\n\n\tprovided = ext2fs_le16_to_cpu(inode->i_checksum_lo);\n\tretval = ext2fs_inode_csum(fs, inum, inode, &calculated, has_hi);\n\tif (retval)\n\t\treturn 0;\n\tif (has_hi) {\n\t\t__u32 hi = ext2fs_le16_to_cpu(inode->i_checksum_hi);\n\t\tprovided |= hi << 16;\n\t} else\n\t\tcalculated &= 0xFFFF;\n\n\tif (provided == calculated)\n\t\treturn 1;\n\n\t/*\n\t * If the checksum didn't match, it's possible it was due to\n\t * the inode being all zero's.  It's unlikely this is the\n\t * case, but it can happen.  So check for it here.  (We only\n\t * check the base inode since that's good enough, and it's not\n\t * worth the bother to figure out how much of the extended\n\t * inode, if any, is present.)\n\t */\n\tfor (cp = (char *) inode, i = 0;\n\t     i < sizeof(struct ext2_inode);\n\t     cp++, i++)\n\t\tif (*cp)\n\t\t\treturn 0;\n\treturn 1;\t\t/* Inode must have been all zero's */\n}\n\nerrcode_t ext2fs_inode_csum_set(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t   struct ext2_inode_large *inode)\n{\n\terrcode_t retval;\n\t__u32 crc;\n\tint has_hi;\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super))\n\t\treturn 0;\n\n\thas_hi = (EXT2_INODE_SIZE(fs->super) > EXT2_GOOD_OLD_INODE_SIZE &&\n\t\t  inode->i_extra_isize >= EXT4_INODE_CSUM_HI_EXTRA_END);\n\n\tretval = ext2fs_inode_csum(fs, inum, inode, &crc, has_hi);\n\tif (retval)\n\t\treturn retval;\n\tinode->i_checksum_lo = ext2fs_cpu_to_le16(crc & 0xFFFF);\n\tif (has_hi)\n\t\tinode->i_checksum_hi = ext2fs_cpu_to_le16(crc >> 16);\n\treturn 0;\n}\n\n__u16 ext2fs_group_desc_csum(ext2_filsys fs, dgrp_t group)\n{\n\tstruct ext2_group_desc *desc = ext2fs_group_desc(fs, fs->group_desc,\n\t\t\t\t\t\t\t group);\n\tsize_t offset, size = EXT2_DESC_SIZE(fs->super);\n\t__u16 crc = 0;\n#ifdef WORDS_BIGENDIAN\n\tstruct ext4_group_desc swabdesc;\n\tsize_t save_size = size;\n\tconst size_t ext4_bg_size = sizeof(struct ext4_group_desc);\n\tstruct ext2_group_desc *save_desc = desc;\n\n\t/* Have to swab back to little-endian to do the checksum */\n\tif (size > ext4_bg_size)\n\t\tsize = ext4_bg_size;\n\tmemcpy(&swabdesc, desc, size);\n\text2fs_swap_group_desc2(fs, (struct ext2_group_desc *) &swabdesc);\n\tdesc = (struct ext2_group_desc *) &swabdesc;\n\tgroup = ext2fs_swab32(group);\n#endif\n\n\tif (ext2fs_has_feature_metadata_csum(fs->super)) {\n\t\t/* new metadata csum code */\n\t\t__u16 old_crc;\n\t\t__u32 crc32;\n\n\t\told_crc = desc->bg_checksum;\n\t\tdesc->bg_checksum = 0;\n\t\tcrc32 = ext2fs_crc32c_le(fs->csum_seed, (unsigned char *)&group,\n\t\t\t\t\t sizeof(group));\n\t\tcrc32 = ext2fs_crc32c_le(crc32, (unsigned char *)desc,\n\t\t\t\t\t size);\n\t\tdesc->bg_checksum = old_crc;\n#ifdef WORDS_BIGENDIAN\n\t\tif (save_size > ext4_bg_size)\n\t\t\tcrc32 = ext2fs_crc32c_le(crc32,\n\t\t\t\t     (unsigned char *)save_desc + ext4_bg_size,\n\t                             save_size - ext4_bg_size);\n#endif\n\t\tcrc = crc32 & 0xFFFF;\n\t\tgoto out;\n\t}\n\n\t/* old crc16 code */\n\toffset = offsetof(struct ext2_group_desc, bg_checksum);\n\tcrc = ext2fs_crc16(~0, fs->super->s_uuid,\n\t\t\t   sizeof(fs->super->s_uuid));\n\tcrc = ext2fs_crc16(crc, &group, sizeof(group));\n\tcrc = ext2fs_crc16(crc, desc, offset);\n\toffset += sizeof(desc->bg_checksum); /* skip checksum */\n\t/* for checksum of struct ext4_group_desc do the rest...*/\n\tif (offset < size) {\n\t\tcrc = ext2fs_crc16(crc, (char *)desc + offset,\n\t\t\t\t   size - offset);\n\t}\n#ifdef WORDS_BIGENDIAN\n\t/*\n\t * If the size of the bg descriptor is greater than 64\n\t * bytes, which is the size of the traditional ext4 bg\n\t * descriptor, checksum the rest of the descriptor here\n\t */\n\tif (save_size > ext4_bg_size)\n\t\tcrc = ext2fs_crc16(crc, (char *)save_desc + ext4_bg_size,\n\t\t\t\t   save_size - ext4_bg_size);\n#endif\n\nout:\n\treturn crc;\n}\n\nint ext2fs_group_desc_csum_verify(ext2_filsys fs, dgrp_t group)\n{\n\tif (ext2fs_has_group_desc_csum(fs) &&\n\t    (ext2fs_bg_checksum(fs, group) !=\n\t     ext2fs_group_desc_csum(fs, group)))\n\t\treturn 0;\n\n\treturn 1;\n}\n\nvoid ext2fs_group_desc_csum_set(ext2_filsys fs, dgrp_t group)\n{\n\tif (!ext2fs_has_group_desc_csum(fs))\n\t\treturn;\n\n\t/* ext2fs_bg_checksum_set() sets the actual checksum field but\n\t * does not calculate the checksum itself. */\n\text2fs_bg_checksum_set(fs, group, ext2fs_group_desc_csum(fs, group));\n}\n\nstatic __u32 find_last_inode_ingrp(ext2fs_inode_bitmap bitmap,\n\t\t\t\t   __u32 inodes_per_grp, dgrp_t grp_no)\n{\n\text2_ino_t i, start_ino, end_ino;\n\n\tstart_ino = grp_no * inodes_per_grp + 1;\n\tend_ino = start_ino + inodes_per_grp - 1;\n\n\tfor (i = end_ino; i >= start_ino; i--) {\n\t\tif (ext2fs_fast_test_inode_bitmap2(bitmap, i))\n\t\t\treturn i - start_ino + 1;\n\t}\n\treturn inodes_per_grp;\n}\n\n/* update the bitmap flags, set the itable high watermark, and calculate\n * checksums for the group descriptors */\nerrcode_t ext2fs_set_gdt_csum(ext2_filsys fs)\n{\n\tstruct ext2_super_block *sb = fs->super;\n\tint dirty = 0;\n\tdgrp_t i;\n\n\tif (!fs->inode_map)\n\t\treturn EXT2_ET_NO_INODE_BITMAP;\n\n\tif (!ext2fs_has_group_desc_csum(fs))\n\t\treturn 0;\n\n\tfor (i = 0; i < fs->group_desc_count; i++) {\n\t\t__u32 old_csum = ext2fs_bg_checksum(fs, i);\n\t\t__u32 old_unused = ext2fs_bg_itable_unused(fs, i);\n\t\t__u32 old_flags = ext2fs_bg_flags(fs, i);\n\t\t__u32 old_free_inodes_count = ext2fs_bg_free_inodes_count(fs, i);\n\t\t__u32 old_free_blocks_count = ext2fs_bg_free_blocks_count(fs, i);\n\n\t\tif (old_free_blocks_count == sb->s_blocks_per_group &&\n\t\t    i != fs->group_desc_count - 1)\n\t\t\text2fs_bg_flags_set(fs, i, EXT2_BG_BLOCK_UNINIT);\n\n\t\tif (old_free_inodes_count == sb->s_inodes_per_group) {\n\t\t\text2fs_bg_flags_set(fs, i, EXT2_BG_INODE_UNINIT);\n\t\t\text2fs_bg_itable_unused_set(fs, i, sb->s_inodes_per_group);\n\t\t} else {\n\t\t\tint unused =\n\t\t\t\tsb->s_inodes_per_group -\n\t\t\t\tfind_last_inode_ingrp(fs->inode_map,\n\t\t\t\t\t\t      sb->s_inodes_per_group, i);\n\n\t\t\text2fs_bg_flags_clear(fs, i, EXT2_BG_INODE_UNINIT);\n\t\t\text2fs_bg_itable_unused_set(fs, i, unused);\n\t\t}\n\n\t\text2fs_group_desc_csum_set(fs, i);\n\t\tif (old_flags != ext2fs_bg_flags(fs, i))\n\t\t\tdirty = 1;\n\t\tif (old_unused != ext2fs_bg_itable_unused(fs, i))\n\t\t\tdirty = 1;\n\t\tif (old_csum != ext2fs_bg_checksum(fs, i))\n\t\t\tdirty = 1;\n\t}\n\tif (dirty)\n\t\text2fs_mark_super_dirty(fs);\n\treturn 0;\n}\n\n#ifdef DEBUG\n#include \"e2p/e2p.h\"\n\nvoid print_csum(const char *msg, ext2_filsys fs, dgrp_t group)\n{\n\t__u16 crc1, crc2, crc3;\n\tdgrp_t swabgroup;\n\tstruct ext2_group_desc *desc = ext2fs_group_desc(fs, fs->group_desc,\n\t\t\t\t\t\t\t group);\n\tsize_t size = EXT2_DESC_SIZE(fs->super);\n\tstruct ext2_super_block *sb = fs->super;\n\tint offset = offsetof(struct ext2_group_desc, bg_checksum);\n#ifdef WORDS_BIGENDIAN\n\tstruct ext4_group_desc swabdesc;\n\tstruct ext2_group_desc *save_desc = desc;\n\tconst size_t ext4_bg_size = sizeof(struct ext4_group_desc);\n\tsize_t save_size = size;\n#endif\n\n#ifdef WORDS_BIGENDIAN\n\t/* Have to swab back to little-endian to do the checksum */\n\tif (size > ext4_bg_size)\n\t\tsize = ext4_bg_size;\n\tmemcpy(&swabdesc, desc, size);\n\text2fs_swap_group_desc2(fs, (struct ext2_group_desc *) &swabdesc);\n\tdesc = (struct ext2_group_desc *) &swabdesc;\n\n\tswabgroup = ext2fs_swab32(group);\n#else\n\tswabgroup = group;\n#endif\n\n\tcrc1 = ext2fs_crc16(~0, sb->s_uuid, sizeof(fs->super->s_uuid));\n\tcrc2 = ext2fs_crc16(crc1, &swabgroup, sizeof(swabgroup));\n\tcrc3 = ext2fs_crc16(crc2, desc, offset);\n\toffset += sizeof(desc->bg_checksum); /* skip checksum */\n\t/* for checksum of struct ext4_group_desc do the rest...*/\n\tif (offset < size)\n\t\tcrc3 = ext2fs_crc16(crc3, (char *)desc + offset, size - offset);\n#ifdef WORDS_BIGENDIAN\n\tif (save_size > ext4_bg_size)\n\t\tcrc3 = ext2fs_crc16(crc3, (char *)save_desc + ext4_bg_size,\n\t\t\t\t    save_size - ext4_bg_size);\n#endif\n\n\tprintf(\"%s UUID %s=%04x, grp %u=%04x: %04x=%04x\\n\",\n\t       msg, e2p_uuid2str(sb->s_uuid), crc1, group, crc2, crc3,\n\t       ext2fs_group_desc_csum(fs, group));\n}\n\nunsigned char sb_uuid[16] = { 0x4f, 0x25, 0xe8, 0xcf, 0xe7, 0x97, 0x48, 0x23,\n\t\t\t      0xbe, 0xfa, 0xa7, 0x88, 0x4b, 0xae, 0xec, 0xdb };\n\nint main(int argc, char **argv)\n{\n\tstruct ext2_super_block param;\n\terrcode_t\t\tretval;\n\text2_filsys\t\tfs;\n\tint\t\t\ti;\n\t__u16 csum1, csum2, csum_known = 0xd3a4;\n\n\tmemset(&param, 0, sizeof(param));\n\text2fs_blocks_count_set(&param, 32768);\n#if 0\n\tparam.s_feature_incompat |= EXT4_FEATURE_INCOMPAT_64BIT;\n\tparam.s_desc_size = 128;\n\tcsum_known = 0x5b6e;\n#endif\n\n\tretval = ext2fs_initialize(\"test fs\", EXT2_FLAG_64BITS, &param,\n\t\t\t\t   test_io_manager, &fs);\n\tif (retval) {\n\t\tcom_err(\"setup\", retval,\n\t\t\t\"While initializing filesystem\");\n\t\texit(1);\n\t}\n\tmemcpy(fs->super->s_uuid, sb_uuid, 16);\n\tfs->super->s_feature_ro_compat = EXT4_FEATURE_RO_COMPAT_GDT_CSUM;\n\n\tfor (i=0; i < fs->group_desc_count; i++) {\n\t\text2fs_block_bitmap_loc_set(fs, i, 124);\n\t\text2fs_inode_bitmap_loc_set(fs, i, 125);\n\t\text2fs_inode_table_loc_set(fs, i, 126);\n\t\text2fs_bg_free_blocks_count_set(fs, i, 31119);\n\t\text2fs_bg_free_inodes_count_set(fs, i, 15701);\n\t\text2fs_bg_used_dirs_count_set(fs, i, 2);\n\t\text2fs_bg_flags_zap(fs, i);\n\t};\n\n\tcsum1 = ext2fs_group_desc_csum(fs, 0);\n\tprint_csum(\"csum0000\", fs, 0);\n\n\tif (csum1 != csum_known) {\n\t\tprintf(\"checksum for group 0 should be %04x\\n\", csum_known);\n\t\texit(1);\n\t}\n\tcsum2 = ext2fs_group_desc_csum(fs, 1);\n\tprint_csum(\"csum0001\", fs, 1);\n\tif (csum1 == csum2) {\n\t\tprintf(\"checksums for different groups shouldn't match\\n\");\n\t\texit(1);\n\t}\n\tcsum2 = ext2fs_group_desc_csum(fs, 2);\n\tprint_csum(\"csumffff\", fs, 2);\n\tif (csum1 == csum2) {\n\t\tprintf(\"checksums for different groups shouldn't match\\n\");\n\t\texit(1);\n\t}\n\text2fs_bg_checksum_set(fs, 0, csum1);\n\tcsum2 = ext2fs_group_desc_csum(fs, 0);\n\tprint_csum(\"csum_set\", fs, 0);\n\tif (csum1 != csum2) {\n\t\tprintf(\"checksums should not depend on checksum field\\n\");\n\t\texit(1);\n\t}\n\tif (!ext2fs_group_desc_csum_verify(fs, 0)) {\n\t\tprintf(\"checksums should verify against gd_checksum\\n\");\n\t\texit(1);\n\t}\n\tmemset(fs->super->s_uuid, 0x30, sizeof(fs->super->s_uuid));\n\tprint_csum(\"new_uuid\", fs, 0);\n\tif (ext2fs_group_desc_csum_verify(fs, 0) != 0) {\n\t\tprintf(\"checksums for different filesystems shouldn't match\\n\");\n\t\texit(1);\n\t}\n\tcsum1 = ext2fs_group_desc_csum(fs, 0);\n\text2fs_bg_checksum_set(fs, 0, csum1);\n\tprint_csum(\"csum_new\", fs, 0);\n\text2fs_bg_free_blocks_count_set(fs, 0, 1);\n\tcsum2 = ext2fs_group_desc_csum(fs, 0);\n\tprint_csum(\"csum_blk\", fs, 0);\n\tif (csum1 == csum2) {\n\t\tprintf(\"checksums for different data shouldn't match\\n\");\n\t\texit(1);\n\t}\n\text2fs_free(fs);\n\n\treturn 0;\n}\n#endif\n"
  },
  {
    "path": "src/ext2fs/dir_iterate.c",
    "content": "/*\n * dir_iterate.c --- ext2fs directory iteration operations\n *\n * Copyright (C) 1993, 1994, 1994, 1995, 1996, 1997 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#if HAVE_ERRNO_H\n#include <errno.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n\n#define EXT4_MAX_REC_LEN\t\t((1<<16)-1)\n\nerrcode_t ext2fs_get_rec_len(ext2_filsys fs,\n\t\t\t     struct ext2_dir_entry *dirent,\n\t\t\t     unsigned int *rec_len)\n{\n\tunsigned int len = dirent->rec_len;\n\n\tif (fs->blocksize < 65536)\n\t\t*rec_len = len;\n\telse if (len == EXT4_MAX_REC_LEN || len == 0)\n\t\t*rec_len = fs->blocksize;\n\telse \n\t\t*rec_len = (len & 65532) | ((len & 3) << 16);\n\treturn 0;\n}\n\nerrcode_t ext2fs_set_rec_len(ext2_filsys fs,\n\t\t\t     unsigned int len,\n\t\t\t     struct ext2_dir_entry *dirent)\n{\n\tif ((len > fs->blocksize) || (fs->blocksize > (1 << 18)) || (len & 3))\n\t\treturn EINVAL;\n\tif (len < 65536) {\n\t\tdirent->rec_len = len;\n\t\treturn 0;\n\t}\n\tif (len == fs->blocksize) {\n\t\tif (fs->blocksize == 65536)\n\t\t\tdirent->rec_len = EXT4_MAX_REC_LEN;\n\t\telse \n\t\t\tdirent->rec_len = 0;\n\t} else\n\t\tdirent->rec_len = (len & 65532) | ((len >> 16) & 3);\n\treturn 0;\n}\n\n/*\n * This function checks to see whether or not a potential deleted\n * directory entry looks valid.  What we do is check the deleted entry\n * and each successive entry to make sure that they all look valid and\n * that the last deleted entry ends at the beginning of the next\n * undeleted entry.  Returns 1 if the deleted entry looks valid, zero\n * if not valid.\n */\nstatic int ext2fs_validate_entry(ext2_filsys fs, char *buf,\n\t\t\t\t unsigned int offset,\n\t\t\t\t unsigned int final_offset)\n{\n\tstruct ext2_dir_entry *dirent;\n\tunsigned int rec_len;\n#define DIRENT_MIN_LENGTH 12\n\n\twhile ((offset < final_offset) &&\n\t       (offset <= fs->blocksize - DIRENT_MIN_LENGTH)) {\n\t\tdirent = (struct ext2_dir_entry *)(buf + offset);\n\t\tif (ext2fs_get_rec_len(fs, dirent, &rec_len))\n\t\t\treturn 0;\n\t\toffset += rec_len;\n\t\tif ((rec_len < 8) ||\n\t\t    ((rec_len % 4) != 0) ||\n\t\t    ((ext2fs_dirent_name_len(dirent)+8) > (int) rec_len))\n\t\t\treturn 0;\n\t}\n\treturn (offset == final_offset);\n}\n\nerrcode_t ext2fs_dir_iterate2(ext2_filsys fs,\n\t\t\t      ext2_ino_t dir,\n\t\t\t      int flags,\n\t\t\t      char *block_buf,\n\t\t\t      int (*func)(ext2_ino_t\tdir,\n\t\t\t\t\t  int\t\tentry,\n\t\t\t\t\t  struct ext2_dir_entry *dirent,\n\t\t\t\t\t  int\toffset,\n\t\t\t\t\t  int\tblocksize,\n\t\t\t\t\t  char\t*buf,\n\t\t\t\t\t  void\t*priv_data),\n\t\t\t      void *priv_data)\n{\n\tstruct\t\tdir_context\tctx;\n\terrcode_t\tretval;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tretval = ext2fs_check_directory(fs, dir);\n\tif (retval)\n\t\treturn retval;\n\n\tctx.dir = dir;\n\tctx.flags = flags;\n\tif (block_buf)\n\t\tctx.buf = block_buf;\n\telse {\n\t\tretval = ext2fs_get_mem(fs->blocksize, &ctx.buf);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\tctx.func = func;\n\tctx.priv_data = priv_data;\n\tctx.errcode = 0;\n\tretval = ext2fs_block_iterate3(fs, dir, BLOCK_FLAG_READ_ONLY, 0,\n\t\t\t\t       ext2fs_process_dir_block, &ctx);\n\tif (!block_buf)\n\t\text2fs_free_mem(&ctx.buf);\n\tif (retval == EXT2_ET_INLINE_DATA_CANT_ITERATE) {\n\t\t(void) ext2fs_inline_data_dir_iterate(fs, dir, &ctx);\n\t\tretval = 0;\n\t}\n\tif (retval)\n\t\treturn retval;\n\treturn ctx.errcode;\n}\n\nstruct xlate {\n\tint (*func)(struct ext2_dir_entry *dirent,\n\t\t    int\t\toffset,\n\t\t    int\t\tblocksize,\n\t\t    char\t*buf,\n\t\t    void\t*priv_data);\n\tvoid *real_private;\n};\n\nstatic int xlate_func(ext2_ino_t dir EXT2FS_ATTR((unused)),\n\t\t      int entry EXT2FS_ATTR((unused)),\n\t\t      struct ext2_dir_entry *dirent, int offset,\n\t\t      int blocksize, char *buf, void *priv_data)\n{\n\tstruct xlate *xl = (struct xlate *) priv_data;\n\n\treturn (*xl->func)(dirent, offset, blocksize, buf, xl->real_private);\n}\n\nerrcode_t ext2fs_dir_iterate(ext2_filsys fs,\n\t\t\t     ext2_ino_t dir,\n\t\t\t     int flags,\n\t\t\t     char *block_buf,\n\t\t\t     int (*func)(struct ext2_dir_entry *dirent,\n\t\t\t\t\t int\toffset,\n\t\t\t\t\t int\tblocksize,\n\t\t\t\t\t char\t*buf,\n\t\t\t\t\t void\t*priv_data),\n\t\t\t     void *priv_data)\n{\n\tstruct xlate xl;\n\n\txl.real_private = priv_data;\n\txl.func = func;\n\n\treturn ext2fs_dir_iterate2(fs, dir, flags, block_buf,\n\t\t\t\t   xlate_func, &xl);\n}\n\n\n/*\n * Helper function which is private to this module.  Used by\n * ext2fs_dir_iterate() and ext2fs_dblist_dir_iterate()\n */\nint ext2fs_process_dir_block(ext2_filsys fs,\n\t\t\t     blk64_t\t*blocknr,\n\t\t\t     e2_blkcnt_t blockcnt,\n\t\t\t     blk64_t\tref_block EXT2FS_ATTR((unused)),\n\t\t\t     int\tref_offset EXT2FS_ATTR((unused)),\n\t\t\t     void\t*priv_data)\n{\n\tstruct dir_context *ctx = (struct dir_context *) priv_data;\n\tunsigned int\toffset = 0;\n\tunsigned int\tnext_real_entry = 0;\n\tint\t\tret = 0;\n\tint\t\tchanged = 0;\n\tint\t\tdo_abort = 0;\n\tunsigned int\trec_len, size, buflen;\n\tint\t\tentry;\n\tstruct ext2_dir_entry *dirent;\n\tint\t\tcsum_size = 0;\n\tint\t\tinline_data;\n\terrcode_t\tretval = 0;\n\n\tif (blockcnt < 0)\n\t\treturn 0;\n\n\tentry = blockcnt ? DIRENT_OTHER_FILE : DIRENT_DOT_FILE;\n\n\t/* If a dir has inline data, we don't need to read block */\n\tinline_data = !!(ctx->flags & DIRENT_FLAG_INCLUDE_INLINE_DATA);\n\tif (!inline_data) {\n\t\tctx->errcode = ext2fs_read_dir_block4(fs, *blocknr, ctx->buf, 0,\n\t\t\t\t\t\t      ctx->dir);\n\t\tif (ctx->errcode)\n\t\t\treturn BLOCK_ABORT;\n\t\t/* If we handle a normal dir, we traverse the entire block */\n\t\tbuflen = fs->blocksize;\n\t} else {\n\t\tbuflen = ctx->buflen;\n\t}\n\n\tif (ext2fs_has_feature_metadata_csum(fs->super))\n\t\tcsum_size = sizeof(struct ext2_dir_entry_tail);\n\n\twhile (offset < buflen - 8) {\n\t\tdirent = (struct ext2_dir_entry *) (ctx->buf + offset);\n\t\tif (ext2fs_get_rec_len(fs, dirent, &rec_len))\n\t\t\treturn BLOCK_ABORT;\n\t\tif (((offset + rec_len) > buflen) ||\n\t\t    (rec_len < 8) ||\n\t\t    ((rec_len % 4) != 0) ||\n\t\t    ((ext2fs_dirent_name_len(dirent)+8) > (int) rec_len)) {\n\t\t\tctx->errcode = EXT2_ET_DIR_CORRUPTED;\n\t\t\treturn BLOCK_ABORT;\n\t\t}\n\t\tif (!dirent->inode) {\n\t\t\t/*\n\t\t\t * We just need to check metadata_csum when this\n\t\t\t * dir hasn't inline data.  That means that 'buflen'\n\t\t\t * should be blocksize.\n\t\t\t */\n\t\t\tif (!inline_data &&\n\t\t\t    (offset == buflen - csum_size) &&\n\t\t\t    (dirent->rec_len == csum_size) &&\n\t\t\t    (dirent->name_len == EXT2_DIR_NAME_LEN_CSUM)) {\n\t\t\t\tif (!(ctx->flags & DIRENT_FLAG_INCLUDE_CSUM))\n\t\t\t\t\tgoto next;\n\t\t\t\tentry = DIRENT_CHECKSUM;\n\t\t\t} else if (!(ctx->flags & DIRENT_FLAG_INCLUDE_EMPTY))\n\t\t\t\tgoto next;\n\t\t}\n\n\t\tret = (ctx->func)(ctx->dir,\n\t\t\t\t  (next_real_entry > offset) ?\n\t\t\t\t  DIRENT_DELETED_FILE : entry,\n\t\t\t\t  dirent, offset,\n\t\t\t\t  buflen, ctx->buf,\n\t\t\t\t  ctx->priv_data);\n\t\tif (entry < DIRENT_OTHER_FILE)\n\t\t\tentry++;\n\n\t\tif (ret & DIRENT_CHANGED) {\n\t\t\tif (ext2fs_get_rec_len(fs, dirent, &rec_len))\n\t\t\t\treturn BLOCK_ABORT;\n\t\t\tchanged++;\n\t\t}\n\t\tif (ret & DIRENT_ABORT) {\n\t\t\tdo_abort++;\n\t\t\tbreak;\n\t\t}\nnext:\n \t\tif (next_real_entry == offset)\n\t\t\tnext_real_entry += rec_len;\n\n \t\tif (ctx->flags & DIRENT_FLAG_INCLUDE_REMOVED) {\n\t\t\tsize = (ext2fs_dirent_name_len(dirent) + 11) & ~3;\n\n\t\t\tif (rec_len != size)  {\n\t\t\t\tunsigned int final_offset;\n\n\t\t\t\tfinal_offset = offset + rec_len;\n\t\t\t\toffset += size;\n\t\t\t\twhile (offset < final_offset &&\n\t\t\t\t       !ext2fs_validate_entry(fs, ctx->buf,\n\t\t\t\t\t\t\t      offset,\n\t\t\t\t\t\t\t      final_offset))\n\t\t\t\t\toffset += 4;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\toffset += rec_len;\n\t}\n\n\tif (changed) {\n\t\tif (!inline_data) {\n\t\t\tctx->errcode = ext2fs_write_dir_block4(fs, *blocknr,\n\t\t\t\t\t\t\t       ctx->buf,\n\t\t\t\t\t\t\t       0, ctx->dir);\n\t\t\tif (ctx->errcode)\n\t\t\t\treturn BLOCK_ABORT;\n\t\t} else {\n\t\t\t/*\n\t\t\t * return BLOCK_INLINE_DATA_CHANGED to notify caller\n\t\t\t * that inline data has been changed.\n\t\t\t */\n\t\t\tretval = BLOCK_INLINE_DATA_CHANGED;\n\t\t}\n\t}\n\tif (do_abort)\n\t\treturn retval | BLOCK_ABORT;\n\treturn retval;\n}\n"
  },
  {
    "path": "src/ext2fs/dirblock.c",
    "content": "/*\n * dirblock.c --- directory block routines.\n *\n * Copyright (C) 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <string.h>\n#include <time.h>\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\nerrcode_t ext2fs_read_dir_block4(ext2_filsys fs, blk64_t block,\n\t\t\t\t void *buf, int flags EXT2FS_ATTR((unused)),\n\t\t\t\t ext2_ino_t ino)\n{\n\terrcode_t\tretval;\n\tint\t\tcorrupt = 0;\n\n\tretval = io_channel_read_blk64(fs->io, block, 1, buf);\n\tif (retval)\n\t\treturn retval;\n\n\tif (!(fs->flags & EXT2_FLAG_IGNORE_CSUM_ERRORS) &&\n\t    !ext2fs_dir_block_csum_verify(fs, ino,\n\t\t\t\t\t  (struct ext2_dir_entry *)buf))\n\t\tcorrupt = 1;\n\n#ifdef WORDS_BIGENDIAN\n\tretval = ext2fs_dirent_swab_in(fs, buf, flags);\n#endif\n\tif (!retval && corrupt)\n\t\tretval = EXT2_ET_DIR_CSUM_INVALID;\n\treturn retval;\n}\n\nerrcode_t ext2fs_read_dir_block3(ext2_filsys fs, blk64_t block,\n\t\t\t\t void *buf, int flags EXT2FS_ATTR((unused)))\n{\n\treturn ext2fs_read_dir_block4(fs, block, buf, flags, 0);\n}\n\nerrcode_t ext2fs_read_dir_block2(ext2_filsys fs, blk_t block,\n\t\t\t\t void *buf, int flags EXT2FS_ATTR((unused)))\n{\n\treturn ext2fs_read_dir_block3(fs, block, buf, flags);\n}\n\nerrcode_t ext2fs_read_dir_block(ext2_filsys fs, blk_t block,\n\t\t\t\t void *buf)\n{\n\treturn ext2fs_read_dir_block3(fs, block, buf, 0);\n}\n\n\nerrcode_t ext2fs_write_dir_block4(ext2_filsys fs, blk64_t block,\n\t\t\t\t  void *inbuf, int flags EXT2FS_ATTR((unused)),\n\t\t\t\t  ext2_ino_t ino)\n{\n\terrcode_t\tretval;\n\tchar\t\t*buf = inbuf;\n\n#ifdef WORDS_BIGENDIAN\n\tretval = ext2fs_get_mem(fs->blocksize, &buf);\n\tif (retval)\n\t\treturn retval;\n\tmemcpy(buf, inbuf, fs->blocksize);\n\tretval = ext2fs_dirent_swab_out(fs, buf, flags);\n\tif (retval)\n\t\treturn retval;\n#endif\n\tretval = ext2fs_dir_block_csum_set(fs, ino,\n\t\t\t\t\t   (struct ext2_dir_entry *)buf);\n\tif (retval)\n\t\tgoto out;\n\n\tretval = io_channel_write_blk64(fs->io, block, 1, buf);\n\nout:\n#ifdef WORDS_BIGENDIAN\n\text2fs_free_mem(&buf);\n#endif\n\treturn retval;\n}\n\nerrcode_t ext2fs_write_dir_block3(ext2_filsys fs, blk64_t block,\n\t\t\t\t  void *inbuf, int flags EXT2FS_ATTR((unused)))\n{\n\treturn ext2fs_write_dir_block4(fs, block, inbuf, flags, 0);\n}\n\nerrcode_t ext2fs_write_dir_block2(ext2_filsys fs, blk_t block,\n\t\t\t\t void *inbuf, int flags EXT2FS_ATTR((unused)))\n{\n\treturn ext2fs_write_dir_block3(fs, block, inbuf, flags);\n}\n\nerrcode_t ext2fs_write_dir_block(ext2_filsys fs, blk_t block,\n\t\t\t\t void *inbuf)\n{\n\treturn ext2fs_write_dir_block3(fs, block, inbuf, 0);\n}\n\n"
  },
  {
    "path": "src/ext2fs/dirhash.c",
    "content": "/*\n * dirhash.c -- Calculate the hash of a directory entry\n *\n * Copyright (c) 2001  Daniel Phillips\n *\n * Copyright (c) 2002 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#include <limits.h>\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n#include \"ext2fsP.h\"\n\n#ifndef PATH_MAX\n#define PATH_MAX 4096\n#endif\n\n/*\n * Keyed 32-bit hash function using TEA in a Davis-Meyer function\n *   H0 = Key\n *   Hi = E Mi(Hi-1) + Hi-1\n *\n * (see Applied Cryptography, 2nd edition, p448).\n *\n * Jeremy Fitzhardinge <jeremy@zip.com.au> 1998\n *\n * This code is made available under the terms of the GPL\n */\n#define DELTA 0x9E3779B9\n\nstatic void TEA_transform(__u32 buf[4], __u32 const in[])\n{\n\t__u32\tsum = 0;\n\t__u32\tb0 = buf[0], b1 = buf[1];\n\t__u32\ta = in[0], b = in[1], c = in[2], d = in[3];\n\tint\tn = 16;\n\n\tdo {\n\t\t// coverity[overflow_const]\n\t\tsum += DELTA;\n\t\tb0 += ((b1 << 4)+a) ^ (b1+sum) ^ ((b1 >> 5)+b);\n\t\tb1 += ((b0 << 4)+c) ^ (b0+sum) ^ ((b0 >> 5)+d);\n\t} while(--n);\n\n\tbuf[0] += b0;\n\tbuf[1] += b1;\n}\n\n/* F, G and H are basic MD4 functions: selection, majority, parity */\n#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))\n#define G(x, y, z) (((x) & (y)) + (((x) ^ (y)) & (z)))\n#define H(x, y, z) ((x) ^ (y) ^ (z))\n\n/*\n * The generic round function.  The application is so specific that\n * we don't bother protecting all the arguments with parens, as is generally\n * good macro practice, in favor of extra legibility.\n * Rotation is separate from addition to prevent recomputation\n */\n#define ROUND(f, a, b, c, d, x, s)\t\\\n\t(a += f(b, c, d) + x, a = (a << s) | (a >> (32-s)))\n#define K1 0\n#define K2 013240474631UL\n#define K3 015666365641UL\n\n/*\n * Basic cut-down MD4 transform.  Returns only 32 bits of result.\n */\nstatic void halfMD4Transform (__u32 buf[4], __u32 const in[])\n{\n\t__u32\ta = buf[0], b = buf[1], c = buf[2], d = buf[3];\n\n\t/* Round 1 */\n\tROUND(F, a, b, c, d, in[0] + K1,  3);\n\tROUND(F, d, a, b, c, in[1] + K1,  7);\n\tROUND(F, c, d, a, b, in[2] + K1, 11);\n\tROUND(F, b, c, d, a, in[3] + K1, 19);\n\tROUND(F, a, b, c, d, in[4] + K1,  3);\n\tROUND(F, d, a, b, c, in[5] + K1,  7);\n\tROUND(F, c, d, a, b, in[6] + K1, 11);\n\tROUND(F, b, c, d, a, in[7] + K1, 19);\n\n\t/* Round 2 */\n\tROUND(G, a, b, c, d, in[1] + K2,  3);\n\tROUND(G, d, a, b, c, in[3] + K2,  5);\n\tROUND(G, c, d, a, b, in[5] + K2,  9);\n\tROUND(G, b, c, d, a, in[7] + K2, 13);\n\tROUND(G, a, b, c, d, in[0] + K2,  3);\n\tROUND(G, d, a, b, c, in[2] + K2,  5);\n\tROUND(G, c, d, a, b, in[4] + K2,  9);\n\tROUND(G, b, c, d, a, in[6] + K2, 13);\n\n\t/* Round 3 */\n\tROUND(H, a, b, c, d, in[3] + K3,  3);\n\tROUND(H, d, a, b, c, in[7] + K3,  9);\n\tROUND(H, c, d, a, b, in[2] + K3, 11);\n\tROUND(H, b, c, d, a, in[6] + K3, 15);\n\tROUND(H, a, b, c, d, in[1] + K3,  3);\n\tROUND(H, d, a, b, c, in[5] + K3,  9);\n\tROUND(H, c, d, a, b, in[0] + K3, 11);\n\tROUND(H, b, c, d, a, in[4] + K3, 15);\n\n\tbuf[0] += a;\n\tbuf[1] += b;\n\tbuf[2] += c;\n\tbuf[3] += d;\n}\n\n#undef ROUND\n#undef F\n#undef G\n#undef H\n#undef K1\n#undef K2\n#undef K3\n\n/* The old legacy hash */\nstatic ext2_dirhash_t dx_hack_hash (const char *name, int len,\n\t\t\t\t    int unsigned_flag)\n{\n\t__u32 hash, hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9;\n\tconst unsigned char *ucp = (const unsigned char *) name;\n\tconst signed char *scp = (const signed char *) name;\n\tint c;\n\n\twhile (len--) {\n\t\tif (unsigned_flag)\n\t\t\tc = (int) *ucp++;\n\t\telse\n\t\t\tc = (int) *scp++;\n\t\thash = hash1 + (hash0 ^ (c * 7152373));\n\n\t\tif (hash & 0x80000000) hash -= 0x7fffffff;\n\t\thash1 = hash0;\n\t\thash0 = hash;\n\t}\n\treturn (hash0 << 1);\n}\n\nstatic void str2hashbuf(const char *msg, int len, __u32 *buf, int num,\n\t\t\tint unsigned_flag)\n{\n\t__u32\tpad, val;\n\tint\ti, c;\n\tconst unsigned char *ucp = (const unsigned char *) msg;\n\tconst signed char *scp = (const signed char *) msg;\n\n\tpad = (__u32)len | ((__u32)len << 8);\n\tpad |= pad << 16;\n\n\tval = pad;\n\tif (len > num*4)\n\t\tlen = num * 4;\n\tfor (i=0; i < len; i++) {\n\t\tif (unsigned_flag)\n\t\t\tc = (int) ucp[i];\n\t\telse\n\t\t\tc = (int) scp[i];\n\n\t\tval = c + (val << 8);\n\t\tif ((i % 4) == 3) {\n\t\t\t*buf++ = val;\n\t\t\tval = pad;\n\t\t\tnum--;\n\t\t}\n\t}\n\tif (--num >= 0)\n\t\t*buf++ = val;\n\twhile (--num >= 0)\n\t\t*buf++ = pad;\n}\n\n/*\n * Returns the hash of a filename.  If len is 0 and name is NULL, then\n * this function can be used to test whether or not a hash version is\n * supported.\n *\n * The seed is an 4 longword (32 bits) \"secret\" which can be used to\n * uniquify a hash.  If the seed is all zero's, then some default seed\n * may be used.\n *\n * A particular hash version specifies whether or not the seed is\n * represented, and whether or not the returned hash is 32 bits or 64\n * bits.  32 bit hashes will return 0 for the minor hash.\n *\n * This function doesn't do any normalization or casefolding of the\n * input string.  To take charset encoding into account, use\n * ext2fs_dirhash2.\n *\n */\nerrcode_t ext2fs_dirhash(int version, const char *name, int len,\n\t\t\t const __u32 *seed,\n\t\t\t ext2_dirhash_t *ret_hash,\n\t\t\t ext2_dirhash_t *ret_minor_hash)\n{\n\t__u32\thash;\n\t__u32\tminor_hash = 0;\n\tconst char\t*p;\n\tint\t\ti;\n\t__u32 \t\tin[8], buf[4];\n\tint\t\tunsigned_flag = 0;\n\n\t/* Initialize the default seed for the hash checksum functions */\n\tbuf[0] = 0x67452301;\n\tbuf[1] = 0xefcdab89;\n\tbuf[2] = 0x98badcfe;\n\tbuf[3] = 0x10325476;\n\n\t/* Check to see if the seed is all zero's */\n\tif (seed) {\n\t\tfor (i=0; i < 4; i++) {\n\t\t\tif (seed[i])\n\t\t\t\tbreak;\n\t\t}\n\t\tif (i < 4)\n\t\t\tmemcpy(buf, seed, sizeof(buf));\n\t}\n\n\tswitch (version) {\n\tcase EXT2_HASH_LEGACY_UNSIGNED:\n\t\tunsigned_flag++;\n\t\t/* fallthrough */\n\tcase EXT2_HASH_LEGACY:\n\t\thash = dx_hack_hash(name, len, unsigned_flag);\n\t\tbreak;\n\tcase EXT2_HASH_HALF_MD4_UNSIGNED:\n\t\tunsigned_flag++;\n\t\t/* fallthrough */\n\tcase EXT2_HASH_HALF_MD4:\n\t\tp = name;\n\t\twhile (len > 0) {\n\t\t\tstr2hashbuf(p, len, in, 8, unsigned_flag);\n\t\t\thalfMD4Transform(buf, in);\n\t\t\tlen -= 32;\n\t\t\tp += 32;\n\t\t}\n\t\tminor_hash = buf[2];\n\t\thash = buf[1];\n\t\tbreak;\n\tcase EXT2_HASH_TEA_UNSIGNED:\n\t\tunsigned_flag++;\n\t\t/* fallthrough */\n\tcase EXT2_HASH_TEA:\n\t\tp = name;\n\t\twhile (len > 0) {\n\t\t\tstr2hashbuf(p, len, in, 4, unsigned_flag);\n\t\t\tTEA_transform(buf, in);\n\t\t\tlen -= 16;\n\t\t\tp += 16;\n\t\t}\n\t\thash = buf[0];\n\t\tminor_hash = buf[1];\n\t\tbreak;\n\tdefault:\n\t\t*ret_hash = 0;\n\t\treturn EXT2_ET_DIRHASH_UNSUPP;\n\t}\n\t*ret_hash = hash & ~1;\n\tif (ret_minor_hash)\n\t\t*ret_minor_hash = minor_hash;\n\treturn 0;\n}\n\n/*\n * Returns the hash of a filename considering normalization and\n * casefolding.  This is a wrapper around ext2fs_dirhash with string\n * encoding support based on the nls_table and the flags. Check\n * ext2fs_dirhash for documentation on the input and output parameters.\n */\nerrcode_t ext2fs_dirhash2(int version, const char *name, int len,\n\t\t\t  const struct ext2fs_nls_table *charset,\n\t\t\t  int hash_flags, const __u32 *seed,\n\t\t\t  ext2_dirhash_t *ret_hash,\n\t\t\t  ext2_dirhash_t *ret_minor_hash)\n{\n\terrcode_t r;\n\tint dlen;\n\n\tif (len && charset && (hash_flags & EXT4_CASEFOLD_FL)) {\n\t\tchar buff[PATH_MAX];\n\n\t\tdlen = charset->ops->casefold(charset,\n\t\t\t      (const unsigned char *) name, len,\n\t\t\t      (unsigned char *) buff, sizeof(buff));\n\t\tif (dlen < 0) {\n\t\t\tif (dlen == -EINVAL)\n\t\t\t\tgoto opaque_seq;\n\n\t\t\treturn dlen;\n\t\t}\n\t\tr = ext2fs_dirhash(version, buff, dlen, seed, ret_hash,\n\t\t\t\t   ret_minor_hash);\n\t\treturn r;\n\t}\n\nopaque_seq:\n\treturn ext2fs_dirhash(version, name, len, seed, ret_hash,\n\t\t\t      ret_minor_hash);\n}\n"
  },
  {
    "path": "src/ext2fs/e2image.h",
    "content": "/*\n * e2image.h --- header file describing the ext2 image format\n *\n * Copyright (C) 2000 Theodore Ts'o.\n *\n * Note: this uses the POSIX IO interfaces, unlike most of the other\n * functions in this library.  So sue me.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\nstruct ext2_image_hdr {\n\t__u32\tmagic_number;\t/* This must be EXT2_ET_MAGIC_E2IMAGE */\n\tchar\tmagic_descriptor[16]; /* \"Ext2 Image 1.0\", w/ null padding */\n\tchar\tfs_hostname[64];/* Hostname of machine of image */\n\tchar\tfs_netaddr[32];\t/* Network address */\n\t__u32\tfs_netaddr_type;/* 0 = IPV4, 1 = IPV6, etc. */\n\t__u32\tfs_device;\t/* Device number of image */\n\tchar\tfs_device_name[64]; /* Device name */\n\tchar\tfs_uuid[16];\t/* UUID of filesystem */\n\t__u32\tfs_blocksize;\t/* Block size of the filesystem */\n\t__u32\tfs_reserved[8];\n\n\t__u32\timage_device;\t/* Device number of image file */\n\t__u32\timage_inode;\t/* Inode number of image file */\n\t__u32\timage_time;\t/* Time of image creation */\n\t__u32\timage_reserved[8];\n\n\t__u32\toffset_super;\t/* Byte offset of the sb and descriptors */\n\t__u32\toffset_inode;\t/* Byte offset of the inode table  */\n\t__u32\toffset_inodemap; /* Byte offset of the inode bitmaps */\n\t__u32\toffset_blockmap; /* Byte offset of the inode bitmaps */\n\t__u32\toffset_reserved[8];\n};\n"
  },
  {
    "path": "src/ext2fs/ext2_err.h",
    "content": "/*\n * ext2_err.h:\n * This file is automatically generated; please do not edit it.\n */\n\n#include \"com_err.h\"\n\n#define EXT2_ET_BASE                             (2133571328L)\n#define EXT2_ET_MAGIC_EXT2FS_FILSYS              (2133571329L)\n#define EXT2_ET_MAGIC_BADBLOCKS_LIST             (2133571330L)\n#define EXT2_ET_MAGIC_BADBLOCKS_ITERATE          (2133571331L)\n#define EXT2_ET_MAGIC_INODE_SCAN                 (2133571332L)\n#define EXT2_ET_MAGIC_IO_CHANNEL                 (2133571333L)\n#define EXT2_ET_MAGIC_UNIX_IO_CHANNEL            (2133571334L)\n#define EXT2_ET_MAGIC_IO_MANAGER                 (2133571335L)\n#define EXT2_ET_MAGIC_BLOCK_BITMAP               (2133571336L)\n#define EXT2_ET_MAGIC_INODE_BITMAP               (2133571337L)\n#define EXT2_ET_MAGIC_GENERIC_BITMAP             (2133571338L)\n#define EXT2_ET_MAGIC_TEST_IO_CHANNEL            (2133571339L)\n#define EXT2_ET_MAGIC_DBLIST                     (2133571340L)\n#define EXT2_ET_MAGIC_ICOUNT                     (2133571341L)\n#define EXT2_ET_MAGIC_PQ_IO_CHANNEL              (2133571342L)\n#define EXT2_ET_MAGIC_EXT2_FILE                  (2133571343L)\n#define EXT2_ET_MAGIC_E2IMAGE                    (2133571344L)\n#define EXT2_ET_MAGIC_INODE_IO_CHANNEL           (2133571345L)\n#define EXT2_ET_MAGIC_EXTENT_HANDLE              (2133571346L)\n#define EXT2_ET_BAD_MAGIC                        (2133571347L)\n#define EXT2_ET_REV_TOO_HIGH                     (2133571348L)\n#define EXT2_ET_RO_FILSYS                        (2133571349L)\n#define EXT2_ET_GDESC_READ                       (2133571350L)\n#define EXT2_ET_GDESC_WRITE                      (2133571351L)\n#define EXT2_ET_GDESC_BAD_BLOCK_MAP              (2133571352L)\n#define EXT2_ET_GDESC_BAD_INODE_MAP              (2133571353L)\n#define EXT2_ET_GDESC_BAD_INODE_TABLE            (2133571354L)\n#define EXT2_ET_INODE_BITMAP_WRITE               (2133571355L)\n#define EXT2_ET_INODE_BITMAP_READ                (2133571356L)\n#define EXT2_ET_BLOCK_BITMAP_WRITE               (2133571357L)\n#define EXT2_ET_BLOCK_BITMAP_READ                (2133571358L)\n#define EXT2_ET_INODE_TABLE_WRITE                (2133571359L)\n#define EXT2_ET_INODE_TABLE_READ                 (2133571360L)\n#define EXT2_ET_NEXT_INODE_READ                  (2133571361L)\n#define EXT2_ET_UNEXPECTED_BLOCK_SIZE            (2133571362L)\n#define EXT2_ET_DIR_CORRUPTED                    (2133571363L)\n#define EXT2_ET_SHORT_READ                       (2133571364L)\n#define EXT2_ET_SHORT_WRITE                      (2133571365L)\n#define EXT2_ET_DIR_NO_SPACE                     (2133571366L)\n#define EXT2_ET_NO_INODE_BITMAP                  (2133571367L)\n#define EXT2_ET_NO_BLOCK_BITMAP                  (2133571368L)\n#define EXT2_ET_BAD_INODE_NUM                    (2133571369L)\n#define EXT2_ET_BAD_BLOCK_NUM                    (2133571370L)\n#define EXT2_ET_EXPAND_DIR_ERR                   (2133571371L)\n#define EXT2_ET_TOOSMALL                         (2133571372L)\n#define EXT2_ET_BAD_BLOCK_MARK                   (2133571373L)\n#define EXT2_ET_BAD_BLOCK_UNMARK                 (2133571374L)\n#define EXT2_ET_BAD_BLOCK_TEST                   (2133571375L)\n#define EXT2_ET_BAD_INODE_MARK                   (2133571376L)\n#define EXT2_ET_BAD_INODE_UNMARK                 (2133571377L)\n#define EXT2_ET_BAD_INODE_TEST                   (2133571378L)\n#define EXT2_ET_FUDGE_BLOCK_BITMAP_END           (2133571379L)\n#define EXT2_ET_FUDGE_INODE_BITMAP_END           (2133571380L)\n#define EXT2_ET_BAD_IND_BLOCK                    (2133571381L)\n#define EXT2_ET_BAD_DIND_BLOCK                   (2133571382L)\n#define EXT2_ET_BAD_TIND_BLOCK                   (2133571383L)\n#define EXT2_ET_NEQ_BLOCK_BITMAP                 (2133571384L)\n#define EXT2_ET_NEQ_INODE_BITMAP                 (2133571385L)\n#define EXT2_ET_BAD_DEVICE_NAME                  (2133571386L)\n#define EXT2_ET_MISSING_INODE_TABLE              (2133571387L)\n#define EXT2_ET_CORRUPT_SUPERBLOCK               (2133571388L)\n#define EXT2_ET_BAD_GENERIC_MARK                 (2133571389L)\n#define EXT2_ET_BAD_GENERIC_UNMARK               (2133571390L)\n#define EXT2_ET_BAD_GENERIC_TEST                 (2133571391L)\n#define EXT2_ET_SYMLINK_LOOP                     (2133571392L)\n#define EXT2_ET_CALLBACK_NOTHANDLED              (2133571393L)\n#define EXT2_ET_BAD_BLOCK_IN_INODE_TABLE         (2133571394L)\n#define EXT2_ET_UNSUPP_FEATURE                   (2133571395L)\n#define EXT2_ET_RO_UNSUPP_FEATURE                (2133571396L)\n#define EXT2_ET_LLSEEK_FAILED                    (2133571397L)\n#define EXT2_ET_NO_MEMORY                        (2133571398L)\n#define EXT2_ET_INVALID_ARGUMENT                 (2133571399L)\n#define EXT2_ET_BLOCK_ALLOC_FAIL                 (2133571400L)\n#define EXT2_ET_INODE_ALLOC_FAIL                 (2133571401L)\n#define EXT2_ET_NO_DIRECTORY                     (2133571402L)\n#define EXT2_ET_TOO_MANY_REFS                    (2133571403L)\n#define EXT2_ET_FILE_NOT_FOUND                   (2133571404L)\n#define EXT2_ET_FILE_RO                          (2133571405L)\n#define EXT2_ET_DB_NOT_FOUND                     (2133571406L)\n#define EXT2_ET_DIR_EXISTS                       (2133571407L)\n#define EXT2_ET_UNIMPLEMENTED                    (2133571408L)\n#define EXT2_ET_CANCEL_REQUESTED                 (2133571409L)\n#define EXT2_ET_FILE_TOO_BIG                     (2133571410L)\n#define EXT2_ET_JOURNAL_NOT_BLOCK                (2133571411L)\n#define EXT2_ET_NO_JOURNAL_SB                    (2133571412L)\n#define EXT2_ET_JOURNAL_TOO_SMALL                (2133571413L)\n#define EXT2_ET_JOURNAL_UNSUPP_VERSION           (2133571414L)\n#define EXT2_ET_LOAD_EXT_JOURNAL                 (2133571415L)\n#define EXT2_ET_NO_JOURNAL                       (2133571416L)\n#define EXT2_ET_DIRHASH_UNSUPP                   (2133571417L)\n#define EXT2_ET_BAD_EA_BLOCK_NUM                 (2133571418L)\n#define EXT2_ET_TOO_MANY_INODES                  (2133571419L)\n#define EXT2_ET_NOT_IMAGE_FILE                   (2133571420L)\n#define EXT2_ET_RES_GDT_BLOCKS                   (2133571421L)\n#define EXT2_ET_RESIZE_INODE_CORRUPT             (2133571422L)\n#define EXT2_ET_SET_BMAP_NO_IND                  (2133571423L)\n#define EXT2_ET_TDB_SUCCESS                      (2133571424L)\n#define EXT2_ET_TDB_ERR_CORRUPT                  (2133571425L)\n#define EXT2_ET_TDB_ERR_IO                       (2133571426L)\n#define EXT2_ET_TDB_ERR_LOCK                     (2133571427L)\n#define EXT2_ET_TDB_ERR_OOM                      (2133571428L)\n#define EXT2_ET_TDB_ERR_EXISTS                   (2133571429L)\n#define EXT2_ET_TDB_ERR_NOLOCK                   (2133571430L)\n#define EXT2_ET_TDB_ERR_EINVAL                   (2133571431L)\n#define EXT2_ET_TDB_ERR_NOEXIST                  (2133571432L)\n#define EXT2_ET_TDB_ERR_RDONLY                   (2133571433L)\n#define EXT2_ET_DBLIST_EMPTY                     (2133571434L)\n#define EXT2_ET_RO_BLOCK_ITERATE                 (2133571435L)\n#define EXT2_ET_MAGIC_EXTENT_PATH                (2133571436L)\n#define EXT2_ET_MAGIC_GENERIC_BITMAP64           (2133571437L)\n#define EXT2_ET_MAGIC_BLOCK_BITMAP64             (2133571438L)\n#define EXT2_ET_MAGIC_INODE_BITMAP64             (2133571439L)\n#define EXT2_ET_MAGIC_RESERVED_13                (2133571440L)\n#define EXT2_ET_MAGIC_RESERVED_14                (2133571441L)\n#define EXT2_ET_MAGIC_RESERVED_15                (2133571442L)\n#define EXT2_ET_MAGIC_RESERVED_16                (2133571443L)\n#define EXT2_ET_MAGIC_RESERVED_17                (2133571444L)\n#define EXT2_ET_MAGIC_RESERVED_18                (2133571445L)\n#define EXT2_ET_MAGIC_RESERVED_19                (2133571446L)\n#define EXT2_ET_EXTENT_HEADER_BAD                (2133571447L)\n#define EXT2_ET_EXTENT_INDEX_BAD                 (2133571448L)\n#define EXT2_ET_EXTENT_LEAF_BAD                  (2133571449L)\n#define EXT2_ET_EXTENT_NO_SPACE                  (2133571450L)\n#define EXT2_ET_INODE_NOT_EXTENT                 (2133571451L)\n#define EXT2_ET_EXTENT_NO_NEXT                   (2133571452L)\n#define EXT2_ET_EXTENT_NO_PREV                   (2133571453L)\n#define EXT2_ET_EXTENT_NO_UP                     (2133571454L)\n#define EXT2_ET_EXTENT_NO_DOWN                   (2133571455L)\n#define EXT2_ET_NO_CURRENT_NODE                  (2133571456L)\n#define EXT2_ET_OP_NOT_SUPPORTED                 (2133571457L)\n#define EXT2_ET_CANT_INSERT_EXTENT               (2133571458L)\n#define EXT2_ET_CANT_SPLIT_EXTENT                (2133571459L)\n#define EXT2_ET_EXTENT_NOT_FOUND                 (2133571460L)\n#define EXT2_ET_EXTENT_NOT_SUPPORTED             (2133571461L)\n#define EXT2_ET_EXTENT_INVALID_LENGTH            (2133571462L)\n#define EXT2_ET_IO_CHANNEL_NO_SUPPORT_64         (2133571463L)\n#define EXT2_ET_NO_MTAB_FILE                     (2133571464L)\n#define EXT2_ET_CANT_USE_LEGACY_BITMAPS          (2133571465L)\n#define EXT2_ET_MMP_MAGIC_INVALID                (2133571466L)\n#define EXT2_ET_MMP_FAILED                       (2133571467L)\n#define EXT2_ET_MMP_FSCK_ON                      (2133571468L)\n#define EXT2_ET_MMP_BAD_BLOCK                    (2133571469L)\n#define EXT2_ET_MMP_UNKNOWN_SEQ                  (2133571470L)\n#define EXT2_ET_MMP_CHANGE_ABORT                 (2133571471L)\n#define EXT2_ET_MMP_OPEN_DIRECT                  (2133571472L)\n#define EXT2_ET_BAD_DESC_SIZE                    (2133571473L)\n#define EXT2_ET_INODE_CSUM_INVALID               (2133571474L)\n#define EXT2_ET_INODE_BITMAP_CSUM_INVALID        (2133571475L)\n#define EXT2_ET_EXTENT_CSUM_INVALID              (2133571476L)\n#define EXT2_ET_DIR_NO_SPACE_FOR_CSUM            (2133571477L)\n#define EXT2_ET_DIR_CSUM_INVALID                 (2133571478L)\n#define EXT2_ET_EXT_ATTR_CSUM_INVALID            (2133571479L)\n#define EXT2_ET_SB_CSUM_INVALID                  (2133571480L)\n#define EXT2_ET_UNKNOWN_CSUM                     (2133571481L)\n#define EXT2_ET_MMP_CSUM_INVALID                 (2133571482L)\n#define EXT2_ET_FILE_EXISTS                      (2133571483L)\n#define EXT2_ET_BLOCK_BITMAP_CSUM_INVALID        (2133571484L)\n#define EXT2_ET_INLINE_DATA_CANT_ITERATE         (2133571485L)\n#define EXT2_ET_EA_BAD_NAME_LEN                  (2133571486L)\n#define EXT2_ET_EA_BAD_VALUE_SIZE                (2133571487L)\n#define EXT2_ET_BAD_EA_HASH                      (2133571488L)\n#define EXT2_ET_BAD_EA_HEADER                    (2133571489L)\n#define EXT2_ET_EA_KEY_NOT_FOUND                 (2133571490L)\n#define EXT2_ET_EA_NO_SPACE                      (2133571491L)\n#define EXT2_ET_MISSING_EA_FEATURE               (2133571492L)\n#define EXT2_ET_NO_INLINE_DATA                   (2133571493L)\n#define EXT2_ET_INLINE_DATA_NO_BLOCK             (2133571494L)\n#define EXT2_ET_INLINE_DATA_NO_SPACE             (2133571495L)\n#define EXT2_ET_MAGIC_EA_HANDLE                  (2133571496L)\n#define EXT2_ET_INODE_IS_GARBAGE                 (2133571497L)\n#define EXT2_ET_EA_BAD_VALUE_OFFSET              (2133571498L)\n#define EXT2_ET_JOURNAL_FLAGS_WRONG              (2133571499L)\n#define EXT2_ET_UNDO_FILE_CORRUPT                (2133571500L)\n#define EXT2_ET_UNDO_FILE_WRONG                  (2133571501L)\n#define EXT2_ET_FILESYSTEM_CORRUPTED             (2133571502L)\n#define EXT2_ET_BAD_CRC                          (2133571503L)\n#define EXT2_ET_CORRUPT_JOURNAL_SB               (2133571504L)\n#define EXT2_ET_INODE_CORRUPTED                  (2133571505L)\n#define EXT2_ET_EA_INODE_CORRUPTED               (2133571506L)\n#define EXT2_ET_NO_GDESC                         (2133571507L)\nextern const struct error_table et_ext2_error_table;\nextern void initialize_ext2_error_table(void);\n\n/* For compatibility with Heimdal */\nextern void initialize_ext2_error_table_r(struct et_list **list);\n\n#define ERROR_TABLE_BASE_ext2 (2133571328L)\n\n/* for compatibility with older versions... */\n#define init_ext2_err_tbl initialize_ext2_error_table\n#define ext2_err_base ERROR_TABLE_BASE_ext2\n"
  },
  {
    "path": "src/ext2fs/ext2_ext_attr.h",
    "content": "/*\n  File: linux/ext2_ext_attr.h\n\n  On-disk format of extended attributes for the ext2 filesystem.\n\n  (C) 2000 Andreas Gruenbacher, <a.gruenbacher@computer.org>\n*/\n\n#ifndef _EXT2_EXT_ATTR_H\n#define _EXT2_EXT_ATTR_H\n/* Magic value in attribute blocks */\n#define EXT2_EXT_ATTR_MAGIC_v1\t\t0xEA010000\n#define EXT2_EXT_ATTR_MAGIC\t\t0xEA020000\n\n/* Maximum number of references to one attribute block */\n#define EXT2_EXT_ATTR_REFCOUNT_MAX\t1024\n\nstruct ext2_ext_attr_header {\n\t__u32\th_magic;\t/* magic number for identification */\n\t__u32\th_refcount;\t/* reference count */\n\t__u32\th_blocks;\t/* number of disk blocks used */\n\t__u32\th_hash;\t\t/* hash value of all attributes */\n\t__u32\th_checksum;\t/* crc32c(uuid+id+xattrs) */\n\t\t\t\t/* id = inum if refcount = 1, else blknum */\n\t__u32\th_reserved[3];\t/* zero right now */\n};\n\nstruct ext2_ext_attr_entry {\n\t__u8\te_name_len;\t/* length of name */\n\t__u8\te_name_index;\t/* attribute name index */\n\t__u16\te_value_offs;\t/* offset in disk block of value */\n\t__u32\te_value_inum;\t/* inode in which the value is stored */\n\t__u32\te_value_size;\t/* size of attribute value */\n\t__u32\te_hash;\t\t/* hash value of name and value */\n#if 0\n\tchar\te_name[0];\t/* attribute name */\n#endif\n};\n\n#define EXT2_EXT_ATTR_PAD_BITS\t\t2\n#define EXT2_EXT_ATTR_PAD\t\t((unsigned) 1<<EXT2_EXT_ATTR_PAD_BITS)\n#define EXT2_EXT_ATTR_ROUND\t\t(EXT2_EXT_ATTR_PAD-1)\n#define EXT2_EXT_ATTR_LEN(name_len) \\\n\t(((name_len) + EXT2_EXT_ATTR_ROUND + \\\n\tsizeof(struct ext2_ext_attr_entry)) & ~EXT2_EXT_ATTR_ROUND)\n#define EXT2_EXT_ATTR_NEXT(entry) \\\n\t( (struct ext2_ext_attr_entry *)( \\\n\t  (char *)(entry) + EXT2_EXT_ATTR_LEN((entry)->e_name_len)) )\n#define EXT2_EXT_ATTR_SIZE(size) \\\n\t(((size) + EXT2_EXT_ATTR_ROUND) & ~EXT2_EXT_ATTR_ROUND)\n#define EXT2_EXT_IS_LAST_ENTRY(entry) (*((__u32 *)(entry)) == 0UL)\n#define EXT2_EXT_ATTR_NAME(entry) \\\n\t(((char *) (entry)) + sizeof(struct ext2_ext_attr_entry))\n#define EXT2_XATTR_LEN(name_len) \\\n\t(((name_len) + EXT2_EXT_ATTR_ROUND + \\\n\tsizeof(struct ext2_xattr_entry)) & ~EXT2_EXT_ATTR_ROUND)\n#define EXT2_XATTR_SIZE(size) \\\n\t(((size) + EXT2_EXT_ATTR_ROUND) & ~EXT2_EXT_ATTR_ROUND)\n\n#ifdef __KERNEL__\n# ifdef CONFIG_EXT2_FS_EXT_ATTR\nextern int ext2_get_ext_attr(struct inode *, const char *, char *, size_t, int);\nextern int ext2_set_ext_attr(struct inode *, const char *, char *, size_t, int);\nextern void ext2_ext_attr_free_inode(struct inode *inode);\nextern void ext2_ext_attr_put_super(struct super_block *sb);\nextern int ext2_ext_attr_init(void);\nextern void ext2_ext_attr_done(void);\n# else\n#  define ext2_get_ext_attr NULL\n#  define ext2_set_ext_attr NULL\n# endif\n#endif  /* __KERNEL__ */\n#endif  /* _EXT2_EXT_ATTR_H */\n"
  },
  {
    "path": "src/ext2fs/ext2_fs.h",
    "content": "/*\n *  linux/include/linux/ext2_fs.h\n *\n * Copyright (C) 1992, 1993, 1994, 1995\n * Remy Card (card@masi.ibp.fr)\n * Laboratoire MASI - Institut Blaise Pascal\n * Universite Pierre et Marie Curie (Paris VI)\n *\n *  from\n *\n *  linux/include/linux/minix_fs.h\n *\n *  Copyright (C) 1991, 1992  Linus Torvalds\n */\n\n#ifndef _LINUX_EXT2_FS_H\n#define _LINUX_EXT2_FS_H\n\n#include <ext2fs/ext2_types.h>\t\t/* Changed from linux/types.h */\n\n#if defined(__GNUC__) || defined(__clang__)\n# ifdef __MINGW32__\n /* gcc 4.7 miscompiles packed structures in MS-bitfield mode */\n#  define EXT2FS_PACKME\n#  define EXT2FS_PACKED __attribute__((packed,gcc_struct))\n# else\n#  define EXT2FS_PACKME\n#  define EXT2FS_PACKED __attribute__((packed))\n# endif\n#elif defined(_MSC_VER)\n# define EXT2FS_PACKME __pragma(pack(push, 1))\n# define EXT2FS_PACKED __pragma(pack(pop))\n#else\n# error \"EXT2FS_PACKED is not defined for this compiler\"\n#endif\n\n#ifndef __GNUC_PREREQ\n#if defined(__GNUC__) && defined(__GNUC_MINOR__)\n#define __GNUC_PREREQ(maj, min) \\\n\t((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))\n#else\n#define __GNUC_PREREQ(maj, min) 0\n#endif\n#endif\n\n/*\n * The second extended filesystem constants/structures\n */\n\n/*\n * Define EXT2FS_DEBUG to produce debug messages\n */\n#undef EXT2FS_DEBUG\n\n/*\n * Define EXT2_PREALLOCATE to preallocate data blocks for expanding files\n */\n#define EXT2_PREALLOCATE\n#define EXT2_DEFAULT_PREALLOC_BLOCKS\t8\n\n/*\n * The second extended file system version\n */\n#define EXT2FS_DATE\t\t\"95/08/09\"\n#define EXT2FS_VERSION\t\t\"0.5b\"\n\n/*\n * Special inode numbers\n */\n#define EXT2_BAD_INO\t\t 1\t/* Bad blocks inode */\n#define EXT2_ROOT_INO\t\t 2\t/* Root inode */\n#define EXT4_USR_QUOTA_INO\t 3\t/* User quota inode */\n#define EXT4_GRP_QUOTA_INO\t 4\t/* Group quota inode */\n#define EXT2_BOOT_LOADER_INO\t 5\t/* Boot loader inode */\n#define EXT2_UNDEL_DIR_INO\t 6\t/* Undelete directory inode */\n#define EXT2_RESIZE_INO\t\t 7\t/* Reserved group descriptors inode */\n#define EXT2_JOURNAL_INO\t 8\t/* Journal inode */\n#define EXT2_EXCLUDE_INO\t 9\t/* The \"exclude\" inode, for snapshots */\n#define EXT4_REPLICA_INO\t10\t/* Used by non-upstream feature */\n\n/* First non-reserved inode for old ext2 filesystems */\n#define EXT2_GOOD_OLD_FIRST_INO\t11\n\n/*\n * The second extended file system magic number\n */\n#define EXT2_SUPER_MAGIC\t0xEF53\n\n#ifdef __KERNEL__\n#define EXT2_SB(sb)\t(&((sb)->u.ext2_sb))\n#else\n/* Assume that user mode programs are passing in an ext2fs superblock, not\n * a kernel struct super_block.  This will allow us to call the feature-test\n * macros from user land. */\n#define EXT2_SB(sb)\t(sb)\n#endif\n\n/*\n * Maximal count of links to a file\n */\n#define EXT2_LINK_MAX\t\t65000\n\n/*\n * Macro-instructions used to manage several block sizes\n */\n#define EXT2_MIN_BLOCK_LOG_SIZE\t\t10\t/* 1024 */\n#define EXT2_MAX_BLOCK_LOG_SIZE\t\t16\t/* 65536 */\n#define EXT2_MIN_BLOCK_SIZE\t(1 << EXT2_MIN_BLOCK_LOG_SIZE)\n#define EXT2_MAX_BLOCK_SIZE\t(1 << EXT2_MAX_BLOCK_LOG_SIZE)\n#ifdef __KERNEL__\n#define EXT2_BLOCK_SIZE(s)\t((s)->s_blocksize)\n#define EXT2_BLOCK_SIZE_BITS(s)\t((s)->s_blocksize_bits)\n#define EXT2_ADDR_PER_BLOCK_BITS(s)\t(EXT2_SB(s)->addr_per_block_bits)\n#define EXT2_INODE_SIZE(s)\t(EXT2_SB(s)->s_inode_size)\n#define EXT2_FIRST_INO(s)\t(EXT2_SB(s)->s_first_ino)\n#else\n#define EXT2_BLOCK_SIZE(s)\t(EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size)\n#define EXT2_BLOCK_SIZE_BITS(s)\t((s)->s_log_block_size + 10)\n#define EXT2_INODE_SIZE(s)\t(((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \\\n\t\t\t\t EXT2_GOOD_OLD_INODE_SIZE : (s)->s_inode_size)\n#define EXT2_FIRST_INO(s)\t(((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \\\n\t\t\t\t EXT2_GOOD_OLD_FIRST_INO : (s)->s_first_ino)\n#endif\n#define EXT2_ADDR_PER_BLOCK(s)\t(EXT2_BLOCK_SIZE(s) / sizeof(__u32))\n\n/*\n * Macro-instructions used to manage allocation clusters\n */\n#define EXT2_MIN_CLUSTER_LOG_SIZE\tEXT2_MIN_BLOCK_LOG_SIZE\n#define EXT2_MAX_CLUSTER_LOG_SIZE\t29\t/* 512MB  */\n#define EXT2_MIN_CLUSTER_SIZE\t\tEXT2_MIN_BLOCK_SIZE\n#define EXT2_MAX_CLUSTER_SIZE\t\t(1 << EXT2_MAX_CLUSTER_LOG_SIZE)\n#define EXT2_CLUSTER_SIZE(s)\t\t(EXT2_MIN_BLOCK_SIZE << \\\n\t\t\t\t\t\t(s)->s_log_cluster_size)\n#define EXT2_CLUSTER_SIZE_BITS(s)\t((s)->s_log_cluster_size + 10)\n\n/*\n * Macro-instructions used to manage fragments\n *\n * Note: for backwards compatibility only, for the dump program.\n * Ext2/3/4 will never support fragments....\n */\n#define EXT2_MIN_FRAG_SIZE              EXT2_MIN_BLOCK_SIZE\n#define EXT2_MAX_FRAG_SIZE              EXT2_MAX_BLOCK_SIZE\n#define EXT2_MIN_FRAG_LOG_SIZE          EXT2_MIN_BLOCK_LOG_SIZE\n#define EXT2_FRAG_SIZE(s)\t\tEXT2_BLOCK_SIZE(s)\n#define EXT2_FRAGS_PER_BLOCK(s)\t\t1\n\n/*\n * ACL structures\n */\nstruct ext2_acl_header\t/* Header of Access Control Lists */\n{\n\t__u32\taclh_size;\n\t__u32\taclh_file_count;\n\t__u32\taclh_acle_count;\n\t__u32\taclh_first_acle;\n};\n\nstruct ext2_acl_entry\t/* Access Control List Entry */\n{\n\t__u32\tacle_size;\n\t__u16\tacle_perms;\t/* Access permissions */\n\t__u16\tacle_type;\t/* Type of entry */\n\t__u16\tacle_tag;\t/* User or group identity */\n\t__u16\tacle_pad1;\n\t__u32\tacle_next;\t/* Pointer on next entry for the */\n\t\t\t\t\t/* same inode or on next free entry */\n};\n\n/*\n * Structure of a blocks group descriptor\n */\nstruct ext2_group_desc\n{\n\t__u32\tbg_block_bitmap;\t/* Blocks bitmap block */\n\t__u32\tbg_inode_bitmap;\t/* Inodes bitmap block */\n\t__u32\tbg_inode_table;\t\t/* Inodes table block */\n\t__u16\tbg_free_blocks_count;\t/* Free blocks count */\n\t__u16\tbg_free_inodes_count;\t/* Free inodes count */\n\t__u16\tbg_used_dirs_count;\t/* Directories count */\n\t__u16\tbg_flags;\n\t__u32\tbg_exclude_bitmap_lo;\t/* Exclude bitmap for snapshots */\n\t__u16\tbg_block_bitmap_csum_lo;/* crc32c(s_uuid+grp_num+bitmap) LSB */\n\t__u16\tbg_inode_bitmap_csum_lo;/* crc32c(s_uuid+grp_num+bitmap) LSB */\n\t__u16\tbg_itable_unused;\t/* Unused inodes count */\n\t__u16\tbg_checksum;\t\t/* crc16(s_uuid+group_num+group_desc)*/\n};\n\n/*\n * Structure of a blocks group descriptor\n */\nstruct ext4_group_desc\n{\n\t__u32\tbg_block_bitmap;\t/* Blocks bitmap block */\n\t__u32\tbg_inode_bitmap;\t/* Inodes bitmap block */\n\t__u32\tbg_inode_table;\t\t/* Inodes table block */\n\t__u16\tbg_free_blocks_count;\t/* Free blocks count */\n\t__u16\tbg_free_inodes_count;\t/* Free inodes count */\n\t__u16\tbg_used_dirs_count;\t/* Directories count */\n\t__u16\tbg_flags;\t\t/* EXT4_BG_flags (INODE_UNINIT, etc) */\n\t__u32\tbg_exclude_bitmap_lo;\t/* Exclude bitmap for snapshots */\n\t__u16\tbg_block_bitmap_csum_lo;/* crc32c(s_uuid+grp_num+bitmap) LSB */\n\t__u16\tbg_inode_bitmap_csum_lo;/* crc32c(s_uuid+grp_num+bitmap) LSB */\n\t__u16\tbg_itable_unused;\t/* Unused inodes count */\n\t__u16\tbg_checksum;\t\t/* crc16(sb_uuid+group+desc) */\n\t__u32\tbg_block_bitmap_hi;\t/* Blocks bitmap block MSB */\n\t__u32\tbg_inode_bitmap_hi;\t/* Inodes bitmap block MSB */\n\t__u32\tbg_inode_table_hi;\t/* Inodes table block MSB */\n\t__u16\tbg_free_blocks_count_hi;/* Free blocks count MSB */\n\t__u16\tbg_free_inodes_count_hi;/* Free inodes count MSB */\n\t__u16\tbg_used_dirs_count_hi;\t/* Directories count MSB */\n\t__u16\tbg_itable_unused_hi;\t/* Unused inodes count MSB */\n\t__u32\tbg_exclude_bitmap_hi;\t/* Exclude bitmap block MSB */\n\t__u16\tbg_block_bitmap_csum_hi;/* crc32c(s_uuid+grp_num+bitmap) MSB */\n\t__u16\tbg_inode_bitmap_csum_hi;/* crc32c(s_uuid+grp_num+bitmap) MSB */\n\t__u32\tbg_reserved;\n};\n\n#define EXT4_BG_INODE_BITMAP_CSUM_HI_END\t\\\n\t(offsetof(struct ext4_group_desc, bg_inode_bitmap_csum_hi) + \\\n\t sizeof(__u16))\n#define EXT4_BG_BLOCK_BITMAP_CSUM_HI_LOCATION\t\\\n\t(offsetof(struct ext4_group_desc, bg_block_bitmap_csum_hi) + \\\n\t sizeof(__u16))\n\n#define EXT2_BG_INODE_UNINIT\t0x0001 /* Inode table/bitmap not initialized */\n#define EXT2_BG_BLOCK_UNINIT\t0x0002 /* Block bitmap not initialized */\n#define EXT2_BG_INODE_ZEROED\t0x0004 /* On-disk itable initialized to zero */\n\n/*\n * Data structures used by the directory indexing feature\n *\n * Note: all of the multibyte integer fields are little endian.\n */\n\n/*\n * Note: dx_root_info is laid out so that if it should somehow get\n * overlaid by a dirent the two low bits of the hash version will be\n * zero.  Therefore, the hash version mod 4 should never be 0.\n * Sincerely, the paranoia department.\n */\nstruct ext2_dx_root_info {\n\t__u32 reserved_zero;\n\t__u8 hash_version; /* 0 now, 1 at release */\n\t__u8 info_length; /* 8 */\n\t__u8 indirect_levels;\n\t__u8 unused_flags;\n};\n\n#define EXT2_HASH_LEGACY\t\t0\n#define EXT2_HASH_HALF_MD4\t\t1\n#define EXT2_HASH_TEA\t\t\t2\n#define EXT2_HASH_LEGACY_UNSIGNED\t3 /* reserved for userspace lib */\n#define EXT2_HASH_HALF_MD4_UNSIGNED\t4 /* reserved for userspace lib */\n#define EXT2_HASH_TEA_UNSIGNED\t\t5 /* reserved for userspace lib */\n\n#define EXT2_HASH_FLAG_INCOMPAT\t0x1\n\n#define EXT4_DX_BLOCK_MASK 0x0fffffff\n\nstruct ext2_dx_entry {\n\t__le32 hash;\n\t__le32 block;\n};\n\nstruct ext2_dx_countlimit {\n\t__le16 limit;\n\t__le16 count;\n};\n\n/*\n * This goes at the end of each htree block.\n */\nstruct ext2_dx_tail {\n\t__le32 dt_reserved;\n\t__le32 dt_checksum;\t/* crc32c(uuid+inum+dxblock) */\n};\n\n/*\n * Macro-instructions used to manage group descriptors\n */\n#define EXT2_MIN_DESC_SIZE             32\n#define EXT2_MIN_DESC_SIZE_64BIT       64\n#define EXT2_MAX_DESC_SIZE             EXT2_MIN_BLOCK_SIZE\n#define EXT2_DESC_SIZE(s)                                                \\\n       ((EXT2_SB(s)->s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) ? \\\n\t(s)->s_desc_size : EXT2_MIN_DESC_SIZE)\n\n#define EXT2_BLOCKS_PER_GROUP(s)\t(EXT2_SB(s)->s_blocks_per_group)\n#define EXT2_INODES_PER_GROUP(s)\t(EXT2_SB(s)->s_inodes_per_group)\n#define EXT2_CLUSTERS_PER_GROUP(s)\t(EXT2_SB(s)->s_clusters_per_group)\n#define EXT2_INODES_PER_BLOCK(s)\t(EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s))\n/* limits imposed by 16-bit value gd_free_{blocks,inode}_count */\n#define EXT2_MAX_BLOCKS_PER_GROUP(s)\t((((unsigned) 1 << 16) - 8) *\t\\\n\t\t\t\t\t (EXT2_CLUSTER_SIZE(s) / \\\n\t\t\t\t\t  EXT2_BLOCK_SIZE(s)))\n#define EXT2_MAX_CLUSTERS_PER_GROUP(s)\t(((unsigned) 1 << 16) - 8)\n#define EXT2_MAX_INODES_PER_GROUP(s)\t(((unsigned) 1 << 16) - \\\n\t\t\t\t\t EXT2_INODES_PER_BLOCK(s))\n#ifdef __KERNEL__\n#define EXT2_DESC_PER_BLOCK(s)\t\t(EXT2_SB(s)->s_desc_per_block)\n#define EXT2_DESC_PER_BLOCK_BITS(s)\t(EXT2_SB(s)->s_desc_per_block_bits)\n#else\n#define EXT2_DESC_PER_BLOCK(s)\t\t(EXT2_BLOCK_SIZE(s) / EXT2_DESC_SIZE(s))\n#endif\n\n#define EXT2_GROUPS_TO_BLOCKS(s, g)   ((blk64_t) EXT2_BLOCKS_PER_GROUP(s) * \\\n\t\t\t\t       (g))\n#define EXT2_GROUPS_TO_CLUSTERS(s, g) ((blk64_t) EXT2_CLUSTERS_PER_GROUP(s) * \\\n\t\t\t\t       (g))\n\n/*\n * Constants relative to the data blocks\n */\n#define EXT2_NDIR_BLOCKS\t\t12\n#define EXT2_IND_BLOCK\t\t\tEXT2_NDIR_BLOCKS\n#define EXT2_DIND_BLOCK\t\t\t(EXT2_IND_BLOCK + 1)\n#define EXT2_TIND_BLOCK\t\t\t(EXT2_DIND_BLOCK + 1)\n#define EXT2_N_BLOCKS\t\t\t(EXT2_TIND_BLOCK + 1)\n\n/*\n * Inode flags\n */\n#define EXT2_SECRM_FL\t\t\t0x00000001 /* Secure deletion */\n#define EXT2_UNRM_FL\t\t\t0x00000002 /* Undelete */\n#define EXT2_COMPR_FL\t\t\t0x00000004 /* Compress file */\n#define EXT2_SYNC_FL\t\t\t0x00000008 /* Synchronous updates */\n#define EXT2_IMMUTABLE_FL\t\t0x00000010 /* Immutable file */\n#define EXT2_APPEND_FL\t\t\t0x00000020 /* writes to file may only append */\n#define EXT2_NODUMP_FL\t\t\t0x00000040 /* do not dump file */\n#define EXT2_NOATIME_FL\t\t\t0x00000080 /* do not update atime */\n/* Reserved for compression usage... */\n#define EXT2_DIRTY_FL\t\t\t0x00000100\n#define EXT2_COMPRBLK_FL\t\t0x00000200 /* One or more compressed clusters */\n#define EXT2_NOCOMPR_FL\t\t\t0x00000400 /* Access raw compressed data */\n\t/* nb: was previously EXT2_ECOMPR_FL */\n#define EXT4_ENCRYPT_FL\t\t\t0x00000800 /* encrypted inode */\n/* End compression flags --- maybe not all used */\n#define EXT2_BTREE_FL\t\t\t0x00001000 /* btree format dir */\n#define EXT2_INDEX_FL\t\t\t0x00001000 /* hash-indexed directory */\n#define EXT2_IMAGIC_FL\t\t\t0x00002000\n#define EXT3_JOURNAL_DATA_FL\t\t0x00004000 /* file data should be journaled */\n#define EXT2_NOTAIL_FL\t\t\t0x00008000 /* file tail should not be merged */\n#define EXT2_DIRSYNC_FL \t\t0x00010000 /* Synchronous directory modifications */\n#define EXT2_TOPDIR_FL\t\t\t0x00020000 /* Top of directory hierarchies*/\n#define EXT4_HUGE_FILE_FL               0x00040000 /* Set to each huge file */\n#define EXT4_EXTENTS_FL \t\t0x00080000 /* Inode uses extents */\n#define EXT4_VERITY_FL\t\t\t0x00100000 /* Verity protected inode */\n#define EXT4_EA_INODE_FL\t        0x00200000 /* Inode used for large EA */\n/* EXT4_EOFBLOCKS_FL 0x00400000 was here */\n#define FS_NOCOW_FL\t\t\t0x00800000 /* Do not cow file */\n#define EXT4_SNAPFILE_FL\t\t0x01000000  /* Inode is a snapshot */\n#define FS_DAX_FL\t\t\t0x02000000 /* Inode is DAX */\n#define EXT4_SNAPFILE_DELETED_FL\t0x04000000  /* Snapshot is being deleted */\n#define EXT4_SNAPFILE_SHRUNK_FL\t\t0x08000000  /* Snapshot shrink has completed */\n#define EXT4_INLINE_DATA_FL\t\t0x10000000 /* Inode has inline data */\n#define EXT4_PROJINHERIT_FL\t\t0x20000000 /* Create with parents projid */\n#define EXT4_CASEFOLD_FL\t\t0x40000000 /* Casefolded file */\n#define EXT2_RESERVED_FL\t\t0x80000000 /* reserved for ext2 lib */\n\n#define EXT2_FL_USER_VISIBLE\t\t0x604BDFFF /* User visible flags */\n#define EXT2_FL_USER_MODIFIABLE\t\t0x604B80FF /* User modifiable flags */\n\n/*\n * ioctl commands\n */\n\n/* Used for online resize */\nstruct ext2_new_group_input {\n\t__u32 group;\t\t/* Group number for this data */\n\t__u32 block_bitmap;\t/* Absolute block number of block bitmap */\n\t__u32 inode_bitmap;\t/* Absolute block number of inode bitmap */\n\t__u32 inode_table;\t/* Absolute block number of inode table start */\n\t__u32 blocks_count;\t/* Total number of blocks in this group */\n\t__u16 reserved_blocks;\t/* Number of reserved blocks in this group */\n\t__u16 unused;\t\t/* Number of reserved GDT blocks in group */\n};\n\nstruct ext4_new_group_input {\n\t__u32 group;\t\t/* Group number for this data */\n\t__u64 block_bitmap;\t/* Absolute block number of block bitmap */\n\t__u64 inode_bitmap;\t/* Absolute block number of inode bitmap */\n\t__u64 inode_table;\t/* Absolute block number of inode table start */\n\t__u32 blocks_count;\t/* Total number of blocks in this group */\n\t__u16 reserved_blocks;\t/* Number of reserved blocks in this group */\n\t__u16 unused;\n};\n\n#ifdef __GNU__\t\t\t/* Needed for the Hurd */\n#define _IOT_ext2_new_group_input _IOT (_IOTS(__u32), 5, _IOTS(__u16), 2, 0, 0)\n#endif\n\n#define EXT2_IOC_GETFLAGS\t\t_IOR('f', 1, long)\n#define EXT2_IOC_SETFLAGS\t\t_IOW('f', 2, long)\n#define EXT2_IOC_GETVERSION\t\t_IOR('v', 1, long)\n#define EXT2_IOC_SETVERSION\t\t_IOW('v', 2, long)\n#define EXT2_IOC_GETVERSION_NEW\t\t_IOR('f', 3, long)\n#define EXT2_IOC_SETVERSION_NEW\t\t_IOW('f', 4, long)\n#define EXT2_IOC_GROUP_EXTEND\t\t_IOW('f', 7, unsigned long)\n#define EXT2_IOC_GROUP_ADD\t\t_IOW('f', 8,struct ext2_new_group_input)\n#define EXT4_IOC_GROUP_ADD\t\t_IOW('f', 8,struct ext4_new_group_input)\n#define EXT4_IOC_RESIZE_FS\t\t_IOW('f', 16, __u64)\n\n/*\n * Structure of an inode on the disk\n */\nstruct ext2_inode {\n/*00*/\t__u16\ti_mode;\t\t/* File mode */\n\t__u16\ti_uid;\t\t/* Low 16 bits of Owner Uid */\n\t__u32\ti_size;\t\t/* Size in bytes */\n\t__u32\ti_atime;\t/* Access time */\n\t__u32\ti_ctime;\t/* Inode change time */\n/*10*/\t__u32\ti_mtime;\t/* Modification time */\n\t__u32\ti_dtime;\t/* Deletion Time */\n\t__u16\ti_gid;\t\t/* Low 16 bits of Group Id */\n\t__u16\ti_links_count;\t/* Links count */\n\t__u32\ti_blocks;\t/* Blocks count */\n/*20*/\t__u32\ti_flags;\t/* File flags */\n\tunion {\n\t\tstruct {\n\t\t\t__u32\tl_i_version; /* was l_i_reserved1 */\n\t\t} linux1;\n\t\tstruct {\n\t\t\t__u32  h_i_translator;\n\t\t} hurd1;\n\t} osd1;\t\t\t\t/* OS dependent 1 */\n/*28*/\t__u32\ti_block[EXT2_N_BLOCKS];/* Pointers to blocks */\n/*64*/\t__u32\ti_generation;\t/* File version (for NFS) */\n\t__u32\ti_file_acl;\t/* File ACL */\n\t__u32\ti_size_high;\n/*70*/\t__u32\ti_faddr;\t/* Fragment address */\n\tunion {\n\t\tstruct {\n\t\t\t__u16\tl_i_blocks_hi;\n\t\t\t__u16\tl_i_file_acl_high;\n\t\t\t__u16\tl_i_uid_high;\t/* these 2 fields    */\n\t\t\t__u16\tl_i_gid_high;\t/* were reserved2[0] */\n\t\t\t__u16\tl_i_checksum_lo; /* crc32c(uuid+inum+inode) */\n\t\t\t__u16\tl_i_reserved;\n\t\t} linux2;\n\t\tstruct {\n\t\t\t__u8\th_i_frag;\t/* Fragment number */\n\t\t\t__u8\th_i_fsize;\t/* Fragment size */\n\t\t\t__u16\th_i_mode_high;\n\t\t\t__u16\th_i_uid_high;\n\t\t\t__u16\th_i_gid_high;\n\t\t\t__u32\th_i_author;\n\t\t} hurd2;\n\t} osd2;\t\t\t\t/* OS dependent 2 */\n};\n\n/*\n * Permanent part of an large inode on the disk\n */\nstruct ext2_inode_large {\n/*00*/\t__u16\ti_mode;\t\t/* File mode */\n\t__u16\ti_uid;\t\t/* Low 16 bits of Owner Uid */\n\t__u32\ti_size;\t\t/* Size in bytes */\n\t__u32\ti_atime;\t/* Access time */\n\t__u32\ti_ctime;\t/* Inode Change time */\n/*10*/\t__u32\ti_mtime;\t/* Modification time */\n\t__u32\ti_dtime;\t/* Deletion Time */\n\t__u16\ti_gid;\t\t/* Low 16 bits of Group Id */\n\t__u16\ti_links_count;\t/* Links count */\n\t__u32\ti_blocks;\t/* Blocks count */\n/*20*/\t__u32\ti_flags;\t/* File flags */\n\tunion {\n\t\tstruct {\n\t\t\t__u32\tl_i_version; /* was l_i_reserved1 */\n\t\t} linux1;\n\t\tstruct {\n\t\t\t__u32  h_i_translator;\n\t\t} hurd1;\n\t} osd1;\t\t\t\t/* OS dependent 1 */\n/*28*/\t__u32\ti_block[EXT2_N_BLOCKS];/* Pointers to blocks */\n/*64*/\t__u32\ti_generation;\t/* File version (for NFS) */\n\t__u32\ti_file_acl;\t/* File ACL */\n\t__u32\ti_size_high;\n/*70*/\t__u32\ti_faddr;\t/* Fragment address */\n\tunion {\n\t\tstruct {\n\t\t\t__u16\tl_i_blocks_hi;\n\t\t\t__u16\tl_i_file_acl_high;\n\t\t\t__u16\tl_i_uid_high;\t/* these 2 fields    */\n\t\t\t__u16\tl_i_gid_high;\t/* were reserved2[0] */\n\t\t\t__u16\tl_i_checksum_lo; /* crc32c(uuid+inum+inode) */\n\t\t\t__u16\tl_i_reserved;\n\t\t} linux2;\n\t\tstruct {\n\t\t\t__u8\th_i_frag;\t/* Fragment number */\n\t\t\t__u8\th_i_fsize;\t/* Fragment size */\n\t\t\t__u16\th_i_mode_high;\n\t\t\t__u16\th_i_uid_high;\n\t\t\t__u16\th_i_gid_high;\n\t\t\t__u32\th_i_author;\n\t\t} hurd2;\n\t} osd2;\t\t\t\t/* OS dependent 2 */\n/*80*/\t__u16\ti_extra_isize;\n\t__u16\ti_checksum_hi;\t/* crc32c(uuid+inum+inode) */\n\t__u32\ti_ctime_extra;\t/* extra Change time (nsec << 2 | epoch) */\n\t__u32\ti_mtime_extra;\t/* extra Modification time (nsec << 2 | epoch) */\n\t__u32\ti_atime_extra;\t/* extra Access time (nsec << 2 | epoch) */\n/*90*/\t__u32\ti_crtime;\t/* File creation time */\n\t__u32\ti_crtime_extra;\t/* extra File creation time (nsec << 2 | epoch)*/\n\t__u32\ti_version_hi;\t/* high 32 bits for 64-bit version */\n/*9c*/\t__u32   i_projid;       /* Project ID */\n};\n\n#define EXT4_INODE_CSUM_HI_EXTRA_END\t\\\n\t(offsetof(struct ext2_inode_large, i_checksum_hi) + sizeof(__u16) - \\\n\t EXT2_GOOD_OLD_INODE_SIZE)\n\n#define EXT4_EPOCH_BITS 2\n#define EXT4_EPOCH_MASK ((1 << EXT4_EPOCH_BITS) - 1)\n\n#define i_checksum_lo\tosd2.linux2.l_i_checksum_lo\n\n#define inode_includes(size, field)\t\t\t\\\n       (size >= (sizeof(((struct ext2_inode_large *)0)->field) + \\\n                 offsetof(struct ext2_inode_large, field)))\n\n#if defined(__KERNEL__) || defined(__linux__)\n#define i_reserved1\tosd1.linux1.l_i_reserved1\n#define i_frag\t\tosd2.linux2.l_i_frag\n#define i_fsize\t\tosd2.linux2.l_i_fsize\n#define i_uid_low\ti_uid\n#define i_gid_low\ti_gid\n#define i_uid_high\tosd2.linux2.l_i_uid_high\n#define i_gid_high\tosd2.linux2.l_i_gid_high\n#else\n#if defined(__GNU__)\n\n#define i_translator\tosd1.hurd1.h_i_translator\n#define i_frag\t\tosd2.hurd2.h_i_frag;\n#define i_fsize\t\tosd2.hurd2.h_i_fsize;\n#define i_uid_high\tosd2.hurd2.h_i_uid_high\n#define i_gid_high\tosd2.hurd2.h_i_gid_high\n#define i_author\tosd2.hurd2.h_i_author\n\n#endif  /* __GNU__ */\n#endif\t/* defined(__KERNEL__) || defined(__linux__) */\n\n#define inode_uid(inode)\t((inode).i_uid | (inode).osd2.linux2.l_i_uid_high << 16)\n#define inode_gid(inode)\t((inode).i_gid | (inode).osd2.linux2.l_i_gid_high << 16)\n#define inode_projid(inode)\t((inode).i_projid)\n#define ext2fs_set_i_uid_high(inode,x) ((inode).osd2.linux2.l_i_uid_high = (x))\n#define ext2fs_set_i_gid_high(inode,x) ((inode).osd2.linux2.l_i_gid_high = (x))\n\nstatic inline\nstruct ext2_inode *EXT2_INODE(struct ext2_inode_large *large_inode)\n{\n\treturn (struct ext2_inode *) large_inode;\n}\n\n/*\n * File system states\n */\n#define EXT2_VALID_FS\t\t\t0x0001\t/* Unmounted cleanly */\n#define EXT2_ERROR_FS\t\t\t0x0002\t/* Errors detected */\n#define EXT3_ORPHAN_FS\t\t\t0x0004\t/* Orphans being recovered */\n\n/*\n * Misc. filesystem flags\n */\n#define EXT2_FLAGS_SIGNED_HASH\t\t0x0001  /* Signed dirhash in use */\n#define EXT2_FLAGS_UNSIGNED_HASH\t0x0002  /* Unsigned dirhash in use */\n#define EXT2_FLAGS_TEST_FILESYS\t\t0x0004\t/* OK for use on development code */\n#define EXT2_FLAGS_IS_SNAPSHOT\t\t0x0010\t/* This is a snapshot image */\n#define EXT2_FLAGS_FIX_SNAPSHOT\t\t0x0020\t/* Snapshot inodes corrupted */\n#define EXT2_FLAGS_FIX_EXCLUDE\t\t0x0040\t/* Exclude bitmaps corrupted */\n\n/*\n * Mount flags\n */\n#define EXT2_MOUNT_CHECK\t\t0x0001\t/* Do mount-time checks */\n#define EXT2_MOUNT_GRPID\t\t0x0004\t/* Create files with directory's group */\n#define EXT2_MOUNT_DEBUG\t\t0x0008\t/* Some debugging messages */\n#define EXT2_MOUNT_ERRORS_CONT\t\t0x0010\t/* Continue on errors */\n#define EXT2_MOUNT_ERRORS_RO\t\t0x0020\t/* Remount fs ro on errors */\n#define EXT2_MOUNT_ERRORS_PANIC\t\t0x0040\t/* Panic on errors */\n#define EXT2_MOUNT_MINIX_DF\t\t0x0080\t/* Mimics the Minix statfs */\n#define EXT2_MOUNT_NO_UID32\t\t0x0200  /* Disable 32-bit UIDs */\n\n#define clear_opt(o, opt)\t\to &= ~EXT2_MOUNT_##opt\n#define set_opt(o, opt)\t\t\to |= EXT2_MOUNT_##opt\n#define test_opt(sb, opt)\t\t(EXT2_SB(sb)->s_mount_opt & \\\n\t\t\t\t\t EXT2_MOUNT_##opt)\n/*\n * Maximal mount counts between two filesystem checks\n */\n#define EXT2_DFL_MAX_MNT_COUNT\t\t20\t/* Allow 20 mounts */\n#define EXT2_DFL_CHECKINTERVAL\t\t0\t/* Don't use interval check */\n\n/*\n * Behaviour when detecting errors\n */\n#define EXT2_ERRORS_CONTINUE\t\t1\t/* Continue execution */\n#define EXT2_ERRORS_RO\t\t\t2\t/* Remount fs read-only */\n#define EXT2_ERRORS_PANIC\t\t3\t/* Panic */\n#define EXT2_ERRORS_DEFAULT\t\tEXT2_ERRORS_CONTINUE\n\n#if (__GNUC__ >= 4)\n#define ext4_offsetof(TYPE,MEMBER) __builtin_offsetof(TYPE,MEMBER)\n#else\n#define ext4_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)\n#endif\n\n/* Metadata checksum algorithms */\n#define EXT2_CRC32C_CHKSUM\t\t1\n\n/* Encryption algorithms, key size and key reference len */\n#define EXT4_ENCRYPTION_MODE_INVALID\t\t0\n#define EXT4_ENCRYPTION_MODE_AES_256_XTS\t1\n#define EXT4_ENCRYPTION_MODE_AES_256_GCM\t2\n#define EXT4_ENCRYPTION_MODE_AES_256_CBC\t3\n#define EXT4_ENCRYPTION_MODE_AES_256_CTS\t4\n\n#define EXT4_AES_256_XTS_KEY_SIZE\t\t64\n#define EXT4_AES_256_GCM_KEY_SIZE\t\t32\n#define EXT4_AES_256_CBC_KEY_SIZE\t\t32\n#define EXT4_AES_256_CTS_KEY_SIZE\t\t32\n#define EXT4_MAX_KEY_SIZE\t\t\t64\n\n#define EXT4_KEY_DESCRIPTOR_SIZE\t\t8\n#define EXT4_CRYPTO_BLOCK_SIZE\t\t\t16\n\n/* Password derivation constants */\n#define EXT4_MAX_PASSPHRASE_SIZE\t\t1024\n#define EXT4_MAX_SALT_SIZE\t\t\t256\n#define EXT4_PBKDF2_ITERATIONS\t\t\t0xFFFF\n\n#define EXT2_LABEL_LEN\t\t\t\t16\n\n/*\n * Policy provided via an ioctl on the topmost directory. This\n * structure is also in the kernel.\n */\nEXT2FS_PACKME struct ext4_encryption_policy {\n  char version;\n  char contents_encryption_mode;\n  char filenames_encryption_mode;\n  char flags;\n  char master_key_descriptor[EXT4_KEY_DESCRIPTOR_SIZE];\n} EXT2FS_PACKED;\n\nEXT2FS_PACKME struct ext4_encryption_key {\n        __u32 mode;\n        char raw[EXT4_MAX_KEY_SIZE];\n        __u32 size;\n} EXT2FS_PACKED;\n\n/*\n * Structure of the super block\n */\nstruct ext2_super_block {\n/*000*/\t__u32\ts_inodes_count;\t\t/* Inodes count */\n\t__u32\ts_blocks_count;\t\t/* Blocks count */\n\t__u32\ts_r_blocks_count;\t/* Reserved blocks count */\n\t__u32\ts_free_blocks_count;\t/* Free blocks count */\n/*010*/\t__u32\ts_free_inodes_count;\t/* Free inodes count */\n\t__u32\ts_first_data_block;\t/* First Data Block */\n\t__u32\ts_log_block_size;\t/* Block size */\n\t__u32\ts_log_cluster_size;\t/* Allocation cluster size */\n/*020*/\t__u32\ts_blocks_per_group;\t/* # Blocks per group */\n\t__u32\ts_clusters_per_group;\t/* # Fragments per group */\n\t__u32\ts_inodes_per_group;\t/* # Inodes per group */\n\t__u32\ts_mtime;\t\t/* Mount time */\n/*030*/\t__u32\ts_wtime;\t\t/* Write time */\n\t__u16\ts_mnt_count;\t\t/* Mount count */\n\t__s16\ts_max_mnt_count;\t/* Maximal mount count */\n\t__u16\ts_magic;\t\t/* Magic signature */\n\t__u16\ts_state;\t\t/* File system state */\n\t__u16\ts_errors;\t\t/* Behaviour when detecting errors */\n\t__u16\ts_minor_rev_level;\t/* minor revision level */\n/*040*/\t__u32\ts_lastcheck;\t\t/* time of last check */\n\t__u32\ts_checkinterval;\t/* max. time between checks */\n\t__u32\ts_creator_os;\t\t/* OS */\n\t__u32\ts_rev_level;\t\t/* Revision level */\n/*050*/\t__u16\ts_def_resuid;\t\t/* Default uid for reserved blocks */\n\t__u16\ts_def_resgid;\t\t/* Default gid for reserved blocks */\n\t/*\n\t * These fields are for EXT2_DYNAMIC_REV superblocks only.\n\t *\n\t * Note: the difference between the compatible feature set and\n\t * the incompatible feature set is that if there is a bit set\n\t * in the incompatible feature set that the kernel doesn't\n\t * know about, it should refuse to mount the filesystem.\n\t *\n\t * e2fsck's requirements are more strict; if it doesn't know\n\t * about a feature in either the compatible or incompatible\n\t * feature set, it must abort and not try to meddle with\n\t * things it doesn't understand...\n\t */\n\t__u32\ts_first_ino;\t\t/* First non-reserved inode */\n\t__u16   s_inode_size;\t\t/* size of inode structure */\n\t__u16\ts_block_group_nr;\t/* block group # of this superblock */\n\t__u32\ts_feature_compat;\t/* compatible feature set */\n/*060*/\t__u32\ts_feature_incompat;\t/* incompatible feature set */\n\t__u32\ts_feature_ro_compat;\t/* readonly-compatible feature set */\n/*068*/\t__u8\ts_uuid[16];\t\t/* 128-bit uuid for volume */\n/*078*/\t__u8\ts_volume_name[EXT2_LABEL_LEN];\t/* volume name, no NUL? */\n/*088*/\t__u8\ts_last_mounted[64];\t/* directory last mounted on, no NUL? */\n/*0c8*/\t__u32\ts_algorithm_usage_bitmap; /* For compression */\n\t/*\n\t * Performance hints.  Directory preallocation should only\n\t * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on.\n\t */\n\t__u8\ts_prealloc_blocks;\t/* Nr of blocks to try to preallocate*/\n\t__u8\ts_prealloc_dir_blocks;\t/* Nr to preallocate for dirs */\n\t__u16\ts_reserved_gdt_blocks;\t/* Per group table for online growth */\n\t/*\n\t * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set.\n\t */\n/*0d0*/\t__u8\ts_journal_uuid[16];\t/* uuid of journal superblock */\n/*0e0*/\t__u32\ts_journal_inum;\t\t/* inode number of journal file */\n\t__u32\ts_journal_dev;\t\t/* device number of journal file */\n\t__u32\ts_last_orphan;\t\t/* start of list of inodes to delete */\n/*0ec*/\t__u32\ts_hash_seed[4];\t\t/* HTREE hash seed */\n/*0fc*/\t__u8\ts_def_hash_version;\t/* Default hash version to use */\n\t__u8\ts_jnl_backup_type;\t/* Default type of journal backup */\n\t__u16\ts_desc_size;\t\t/* Group desc. size: INCOMPAT_64BIT */\n/*100*/\t__u32\ts_default_mount_opts;\t/* default EXT2_MOUNT_* flags used */\n\t__u32\ts_first_meta_bg;\t/* First metablock group */\n\t__u32\ts_mkfs_time;\t\t/* When the filesystem was created */\n/*10c*/\t__u32\ts_jnl_blocks[17];\t/* Backup of the journal inode */\n/*150*/\t__u32\ts_blocks_count_hi;\t/* Blocks count high 32bits */\n\t__u32\ts_r_blocks_count_hi;\t/* Reserved blocks count high 32 bits*/\n\t__u32\ts_free_blocks_hi;\t/* Free blocks count */\n\t__u16\ts_min_extra_isize;\t/* All inodes have at least # bytes */\n\t__u16\ts_want_extra_isize;\t/* New inodes should reserve # bytes */\n/*160*/\t__u32\ts_flags;\t\t/* Miscellaneous flags */\n\t__u16\ts_raid_stride;\t\t/* RAID stride in blocks */\n\t__u16\ts_mmp_update_interval;  /* # seconds to wait in MMP checking */\n\t__u64\ts_mmp_block;\t\t/* Block for multi-mount protection */\n/*170*/\t__u32\ts_raid_stripe_width;\t/* blocks on all data disks (N*stride)*/\n\t__u8\ts_log_groups_per_flex;\t/* FLEX_BG group size */\n\t__u8\ts_checksum_type;\t/* metadata checksum algorithm */\n\t__u8\ts_encryption_level;\t/* versioning level for encryption */\n\t__u8\ts_reserved_pad;\t\t/* Padding to next 32bits */\n\t__u64\ts_kbytes_written;\t/* nr of lifetime kilobytes written */\n/*180*/\t__u32\ts_snapshot_inum;\t/* Inode number of active snapshot */\n\t__u32\ts_snapshot_id;\t\t/* sequential ID of active snapshot */\n\t__u64\ts_snapshot_r_blocks_count; /* active snapshot reserved blocks */\n/*190*/\t__u32\ts_snapshot_list;\t/* inode number of disk snapshot list */\n#define EXT4_S_ERR_START ext4_offsetof(struct ext2_super_block, s_error_count)\n\t__u32\ts_error_count;\t\t/* number of fs errors */\n\t__u32\ts_first_error_time;\t/* first time an error happened */\n\t__u32\ts_first_error_ino;\t/* inode involved in first error */\n/*1a0*/\t__u64\ts_first_error_block;\t/* block involved in first error */\n\t__u8\ts_first_error_func[32];\t/* function where error hit, no NUL? */\n/*1c8*/\t__u32\ts_first_error_line;\t/* line number where error happened */\n\t__u32\ts_last_error_time;\t/* most recent time of an error */\n/*1d0*/\t__u32\ts_last_error_ino;\t/* inode involved in last error */\n\t__u32\ts_last_error_line;\t/* line number where error happened */\n\t__u64\ts_last_error_block;\t/* block involved of last error */\n/*1e0*/\t__u8\ts_last_error_func[32];\t/* function where error hit, no NUL? */\n#define EXT4_S_ERR_END ext4_offsetof(struct ext2_super_block, s_mount_opts)\n/*200*/\t__u8\ts_mount_opts[64];\t/* default mount options, no NUL? */\n/*240*/\t__u32\ts_usr_quota_inum;\t/* inode number of user quota file */\n\t__u32\ts_grp_quota_inum;\t/* inode number of group quota file */\n\t__u32\ts_overhead_clusters;\t/* overhead blocks/clusters in fs */\n/*24c*/\t__u32\ts_backup_bgs[2];\t/* If sparse_super2 enabled */\n/*254*/\t__u8\ts_encrypt_algos[4];\t/* Encryption algorithms in use  */\n/*258*/\t__u8\ts_encrypt_pw_salt[16];\t/* Salt used for string2key algorithm */\n/*268*/\t__le32\ts_lpf_ino;\t\t/* Location of the lost+found inode */\n\t__le32  s_prj_quota_inum;\t/* inode for tracking project quota */\n/*270*/\t__le32\ts_checksum_seed;\t/* crc32c(orig_uuid) if csum_seed set */\n/*274*/\t__u8\ts_wtime_hi;\n\t__u8\ts_mtime_hi;\n\t__u8\ts_mkfs_time_hi;\n\t__u8\ts_lastcheck_hi;\n\t__u8\ts_first_error_time_hi;\n\t__u8\ts_last_error_time_hi;\n\t__u8\ts_first_error_errcode;\n\t__u8    s_last_error_errcode;\n/*27c*/ __le16\ts_encoding;\t\t/* Filename charset encoding */\n\t__le16\ts_encoding_flags;\t/* Filename charset encoding flags */\n\t__le32\ts_reserved[95];\t\t/* Padding to the end of the block */\n/*3fc*/\t__u32\ts_checksum;\t\t/* crc32c(superblock) */\n};\n\n#define EXT4_S_ERR_LEN (EXT4_S_ERR_END - EXT4_S_ERR_START)\n#define EXT2_LEN_STR(buf) (int)sizeof(buf), (char *)buf\n\n/*\n * Codes for operating systems\n */\n#define EXT2_OS_LINUX\t\t0\n#define EXT2_OS_HURD\t\t1\n#define EXT2_OBSO_OS_MASIX\t2\n#define EXT2_OS_FREEBSD\t\t3\n#define EXT2_OS_LITES\t\t4\n#define EXT2_OS_WINDOWS\t\t5\n#define EXT2_OS_MACOS\t\t6\n\n/*\n * Revision levels\n */\n#define EXT2_GOOD_OLD_REV\t0\t/* The good old (original) format */\n#define EXT2_DYNAMIC_REV\t1\t/* V2 format w/ dynamic inode sizes */\n\n#define EXT2_CURRENT_REV\tEXT2_GOOD_OLD_REV\n#define EXT2_MAX_SUPP_REV\tEXT2_DYNAMIC_REV\n\n#define EXT2_GOOD_OLD_INODE_SIZE 128\n\n/*\n * Journal inode backup types\n */\n#define EXT3_JNL_BACKUP_BLOCKS\t1\n\n/*\n * Feature set definitions\n */\n\n#define EXT2_HAS_COMPAT_FEATURE(sb,mask)\t\t\t\\\n\t( EXT2_SB(sb)->s_feature_compat & (mask) )\n#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask)\t\t\t\\\n\t( EXT2_SB(sb)->s_feature_ro_compat & (mask) )\n#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask)\t\t\t\\\n\t( EXT2_SB(sb)->s_feature_incompat & (mask) )\n\n#define EXT2_FEATURE_COMPAT_DIR_PREALLOC\t0x0001\n#define EXT2_FEATURE_COMPAT_IMAGIC_INODES\t0x0002\n#define EXT3_FEATURE_COMPAT_HAS_JOURNAL\t\t0x0004\n#define EXT2_FEATURE_COMPAT_EXT_ATTR\t\t0x0008\n#define EXT2_FEATURE_COMPAT_RESIZE_INODE\t0x0010\n#define EXT2_FEATURE_COMPAT_DIR_INDEX\t\t0x0020\n#define EXT2_FEATURE_COMPAT_LAZY_BG\t\t0x0040\n/* #define EXT2_FEATURE_COMPAT_EXCLUDE_INODE\t0x0080 not used, legacy */\n#define EXT2_FEATURE_COMPAT_EXCLUDE_BITMAP\t0x0100\n#define EXT4_FEATURE_COMPAT_SPARSE_SUPER2\t0x0200\n#define EXT4_FEATURE_COMPAT_FAST_COMMIT\t\t0x0400\n#define EXT4_FEATURE_COMPAT_STABLE_INODES\t0x0800\n\n\n#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER\t0x0001\n#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE\t0x0002\n/* #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR\t0x0004 not used */\n#define EXT4_FEATURE_RO_COMPAT_HUGE_FILE\t0x0008\n#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM\t\t0x0010\n#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK\t0x0020\n#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE\t0x0040\n#define EXT4_FEATURE_RO_COMPAT_HAS_SNAPSHOT\t0x0080\n#define EXT4_FEATURE_RO_COMPAT_QUOTA\t\t0x0100\n#define EXT4_FEATURE_RO_COMPAT_BIGALLOC\t\t0x0200\n/*\n * METADATA_CSUM implies GDT_CSUM.  When METADATA_CSUM is set, group\n * descriptor checksums use the same algorithm as all other data\n * structures' checksums.\n */\n#define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM\t0x0400\n#define EXT4_FEATURE_RO_COMPAT_REPLICA\t\t0x0800\n#define EXT4_FEATURE_RO_COMPAT_READONLY\t\t0x1000\n#define EXT4_FEATURE_RO_COMPAT_PROJECT\t\t0x2000 /* Project quota */\n#define EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS\t0x4000\n#define EXT4_FEATURE_RO_COMPAT_VERITY\t\t0x8000\n\n#define EXT2_FEATURE_INCOMPAT_COMPRESSION\t0x0001\n#define EXT2_FEATURE_INCOMPAT_FILETYPE\t\t0x0002\n#define EXT3_FEATURE_INCOMPAT_RECOVER\t\t0x0004 /* Needs recovery */\n#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV\t0x0008 /* Journal device */\n#define EXT2_FEATURE_INCOMPAT_META_BG\t\t0x0010\n#define EXT3_FEATURE_INCOMPAT_EXTENTS\t\t0x0040\n#define EXT4_FEATURE_INCOMPAT_64BIT\t\t0x0080\n#define EXT4_FEATURE_INCOMPAT_MMP\t\t0x0100\n#define EXT4_FEATURE_INCOMPAT_FLEX_BG\t\t0x0200\n#define EXT4_FEATURE_INCOMPAT_EA_INODE\t\t0x0400\n#define EXT4_FEATURE_INCOMPAT_DIRDATA\t\t0x1000\n#define EXT4_FEATURE_INCOMPAT_CSUM_SEED\t\t0x2000\n#define EXT4_FEATURE_INCOMPAT_LARGEDIR\t\t0x4000 /* >2GB or 3-lvl htree */\n#define EXT4_FEATURE_INCOMPAT_INLINE_DATA\t0x8000 /* data in inode */\n#define EXT4_FEATURE_INCOMPAT_ENCRYPT\t\t0x10000\n#define EXT4_FEATURE_INCOMPAT_CASEFOLD\t\t0x20000\n\n#define EXT4_FEATURE_COMPAT_FUNCS(name, ver, flagname) \\\nstatic inline int ext2fs_has_feature_##name(struct ext2_super_block *sb) \\\n{ \\\n\treturn ((EXT2_SB(sb)->s_feature_compat & \\\n\t\t EXT##ver##_FEATURE_COMPAT_##flagname) != 0); \\\n} \\\nstatic inline void ext2fs_set_feature_##name(struct ext2_super_block *sb) \\\n{ \\\n\tEXT2_SB(sb)->s_feature_compat |= \\\n\t\tEXT##ver##_FEATURE_COMPAT_##flagname; \\\n} \\\nstatic inline void ext2fs_clear_feature_##name(struct ext2_super_block *sb) \\\n{ \\\n\tEXT2_SB(sb)->s_feature_compat &= \\\n\t\t~EXT##ver##_FEATURE_COMPAT_##flagname; \\\n}\n\n#define EXT4_FEATURE_RO_COMPAT_FUNCS(name, ver, flagname) \\\nstatic inline int ext2fs_has_feature_##name(struct ext2_super_block *sb) \\\n{ \\\n\treturn ((EXT2_SB(sb)->s_feature_ro_compat & \\\n\t\t EXT##ver##_FEATURE_RO_COMPAT_##flagname) != 0); \\\n} \\\nstatic inline void ext2fs_set_feature_##name(struct ext2_super_block *sb) \\\n{ \\\n\tEXT2_SB(sb)->s_feature_ro_compat |= \\\n\t\tEXT##ver##_FEATURE_RO_COMPAT_##flagname; \\\n} \\\nstatic inline void ext2fs_clear_feature_##name(struct ext2_super_block *sb) \\\n{ \\\n\tEXT2_SB(sb)->s_feature_ro_compat &= \\\n\t\t~EXT##ver##_FEATURE_RO_COMPAT_##flagname; \\\n}\n\n#define EXT4_FEATURE_INCOMPAT_FUNCS(name, ver, flagname) \\\nstatic inline int ext2fs_has_feature_##name(struct ext2_super_block *sb) \\\n{ \\\n\treturn ((EXT2_SB(sb)->s_feature_incompat & \\\n\t\t EXT##ver##_FEATURE_INCOMPAT_##flagname) != 0); \\\n} \\\nstatic inline void ext2fs_set_feature_##name(struct ext2_super_block *sb) \\\n{ \\\n\tEXT2_SB(sb)->s_feature_incompat |= \\\n\t\tEXT##ver##_FEATURE_INCOMPAT_##flagname; \\\n} \\\nstatic inline void ext2fs_clear_feature_##name(struct ext2_super_block *sb) \\\n{ \\\n\tEXT2_SB(sb)->s_feature_incompat &= \\\n\t\t~EXT##ver##_FEATURE_INCOMPAT_##flagname; \\\n}\n\nEXT4_FEATURE_COMPAT_FUNCS(dir_prealloc,\t\t2, DIR_PREALLOC)\nEXT4_FEATURE_COMPAT_FUNCS(imagic_inodes,\t2, IMAGIC_INODES)\nEXT4_FEATURE_COMPAT_FUNCS(journal,\t\t3, HAS_JOURNAL)\nEXT4_FEATURE_COMPAT_FUNCS(xattr,\t\t2, EXT_ATTR)\nEXT4_FEATURE_COMPAT_FUNCS(resize_inode,\t\t2, RESIZE_INODE)\nEXT4_FEATURE_COMPAT_FUNCS(dir_index,\t\t2, DIR_INDEX)\nEXT4_FEATURE_COMPAT_FUNCS(lazy_bg,\t\t2, LAZY_BG)\nEXT4_FEATURE_COMPAT_FUNCS(exclude_bitmap,\t2, EXCLUDE_BITMAP)\nEXT4_FEATURE_COMPAT_FUNCS(sparse_super2,\t4, SPARSE_SUPER2)\nEXT4_FEATURE_COMPAT_FUNCS(fast_commit,\t\t4, FAST_COMMIT)\nEXT4_FEATURE_COMPAT_FUNCS(stable_inodes,\t4, STABLE_INODES)\n\nEXT4_FEATURE_RO_COMPAT_FUNCS(sparse_super,\t2, SPARSE_SUPER)\nEXT4_FEATURE_RO_COMPAT_FUNCS(large_file,\t2, LARGE_FILE)\nEXT4_FEATURE_RO_COMPAT_FUNCS(huge_file,\t\t4, HUGE_FILE)\nEXT4_FEATURE_RO_COMPAT_FUNCS(gdt_csum,\t\t4, GDT_CSUM)\nEXT4_FEATURE_RO_COMPAT_FUNCS(dir_nlink,\t\t4, DIR_NLINK)\nEXT4_FEATURE_RO_COMPAT_FUNCS(extra_isize,\t4, EXTRA_ISIZE)\nEXT4_FEATURE_RO_COMPAT_FUNCS(has_snapshot,\t4, HAS_SNAPSHOT)\nEXT4_FEATURE_RO_COMPAT_FUNCS(quota,\t\t4, QUOTA)\nEXT4_FEATURE_RO_COMPAT_FUNCS(bigalloc,\t\t4, BIGALLOC)\nEXT4_FEATURE_RO_COMPAT_FUNCS(metadata_csum,\t4, METADATA_CSUM)\nEXT4_FEATURE_RO_COMPAT_FUNCS(replica,\t\t4, REPLICA)\nEXT4_FEATURE_RO_COMPAT_FUNCS(readonly,\t\t4, READONLY)\nEXT4_FEATURE_RO_COMPAT_FUNCS(project,\t\t4, PROJECT)\nEXT4_FEATURE_RO_COMPAT_FUNCS(shared_blocks,\t4, SHARED_BLOCKS)\nEXT4_FEATURE_RO_COMPAT_FUNCS(verity,\t\t4, VERITY)\n\nEXT4_FEATURE_INCOMPAT_FUNCS(compression,\t2, COMPRESSION)\nEXT4_FEATURE_INCOMPAT_FUNCS(filetype,\t\t2, FILETYPE)\nEXT4_FEATURE_INCOMPAT_FUNCS(journal_needs_recovery,\t3, RECOVER)\nEXT4_FEATURE_INCOMPAT_FUNCS(journal_dev,\t3, JOURNAL_DEV)\nEXT4_FEATURE_INCOMPAT_FUNCS(meta_bg,\t\t2, META_BG)\nEXT4_FEATURE_INCOMPAT_FUNCS(extents,\t\t3, EXTENTS)\nEXT4_FEATURE_INCOMPAT_FUNCS(64bit,\t\t4, 64BIT)\nEXT4_FEATURE_INCOMPAT_FUNCS(mmp,\t\t4, MMP)\nEXT4_FEATURE_INCOMPAT_FUNCS(flex_bg,\t\t4, FLEX_BG)\nEXT4_FEATURE_INCOMPAT_FUNCS(ea_inode,\t\t4, EA_INODE)\nEXT4_FEATURE_INCOMPAT_FUNCS(dirdata,\t\t4, DIRDATA)\nEXT4_FEATURE_INCOMPAT_FUNCS(csum_seed,\t\t4, CSUM_SEED)\nEXT4_FEATURE_INCOMPAT_FUNCS(largedir,\t\t4, LARGEDIR)\nEXT4_FEATURE_INCOMPAT_FUNCS(inline_data,\t4, INLINE_DATA)\nEXT4_FEATURE_INCOMPAT_FUNCS(encrypt,\t\t4, ENCRYPT)\nEXT4_FEATURE_INCOMPAT_FUNCS(casefold,\t\t4, CASEFOLD)\n\n#define EXT2_FEATURE_COMPAT_SUPP\t0\n#define EXT2_FEATURE_INCOMPAT_SUPP    (EXT2_FEATURE_INCOMPAT_FILETYPE| \\\n\t\t\t\t       EXT4_FEATURE_INCOMPAT_MMP| \\\n\t\t\t\t       EXT4_FEATURE_INCOMPAT_LARGEDIR| \\\n\t\t\t\t       EXT4_FEATURE_INCOMPAT_EA_INODE)\n#define EXT2_FEATURE_RO_COMPAT_SUPP\t(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \\\n\t\t\t\t\t EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_DIR_NLINK| \\\n\t\t\t\t\t EXT2_FEATURE_RO_COMPAT_BTREE_DIR| \\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_VERITY)\n\n/*\n * Default values for user and/or group using reserved blocks\n */\n#define EXT2_DEF_RESUID\t\t0\n#define EXT2_DEF_RESGID\t\t0\n\n/*\n * Default mount options\n */\n#define EXT2_DEFM_DEBUG\t\t0x0001\n#define EXT2_DEFM_BSDGROUPS\t0x0002\n#define EXT2_DEFM_XATTR_USER\t0x0004\n#define EXT2_DEFM_ACL\t\t0x0008\n#define EXT2_DEFM_UID16\t\t0x0010\n#define EXT3_DEFM_JMODE\t\t0x0060\n#define EXT3_DEFM_JMODE_DATA\t0x0020\n#define EXT3_DEFM_JMODE_ORDERED\t0x0040\n#define EXT3_DEFM_JMODE_WBACK\t0x0060\n#define EXT4_DEFM_NOBARRIER\t0x0100\n#define EXT4_DEFM_BLOCK_VALIDITY 0x0200\n#define EXT4_DEFM_DISCARD\t0x0400\n#define EXT4_DEFM_NODELALLOC\t0x0800\n\n/*\n * Structure of a directory entry\n */\n#define EXT2_NAME_LEN 255\n\nstruct ext2_dir_entry {\n\t__u32\tinode;\t\t\t/* Inode number */\n\t__u16\trec_len;\t\t/* Directory entry length */\n\t__u16\tname_len;\t\t/* Name length */\n\tchar\tname[EXT2_NAME_LEN];\t/* File name */\n};\n\n/*\n * The new version of the directory entry.  Since EXT2 structures are\n * stored in intel byte order, and the name_len field could never be\n * bigger than 255 chars, it's safe to reclaim the extra byte for the\n * file_type field.\n *\n * This structure is deprecated due to endian issues. Please use struct\n * ext2_dir_entry and accessor functions\n *   ext2fs_dirent_name_len\n *   ext2fs_dirent_set_name_len\n *   ext2fs_dirent_file_type\n *   ext2fs_dirent_set_file_type\n * to get and set name_len and file_type fields.\n */\nstruct ext2_dir_entry_2 {\n\t__u32\tinode;\t\t\t/* Inode number */\n\t__u16\trec_len;\t\t/* Directory entry length */\n\t__u8\tname_len;\t\t/* Name length */\n\t__u8\tfile_type;\n\tchar\tname[EXT2_NAME_LEN];\t/* File name */\n};\n\n/*\n * This is a bogus directory entry at the end of each leaf block that\n * records checksums.\n */\nstruct ext2_dir_entry_tail {\n\t__u32\tdet_reserved_zero1;\t/* Pretend to be unused */\n\t__u16\tdet_rec_len;\t\t/* 12 */\n\t__u16\tdet_reserved_name_len;\t/* 0xDE00, fake namelen/filetype */\n\t__u32\tdet_checksum;\t\t/* crc32c(uuid+inode+dirent) */\n};\n\n/*\n * Ext2 directory file types.  Only the low 3 bits are used.  The\n * other bits are reserved for now.\n */\n#define EXT2_FT_UNKNOWN\t\t0\n#define EXT2_FT_REG_FILE\t1\n#define EXT2_FT_DIR\t\t2\n#define EXT2_FT_CHRDEV\t\t3\n#define EXT2_FT_BLKDEV\t\t4\n#define EXT2_FT_FIFO\t\t5\n#define EXT2_FT_SOCK\t\t6\n#define EXT2_FT_SYMLINK\t\t7\n\n#define EXT2_FT_MAX\t\t8\n\n/*\n * Annoyingly, e2fsprogs always swab16s ext2_dir_entry.name_len, so we\n * have to build ext2_dir_entry_tail with that assumption too.  This\n * constant helps to build the dir_entry_tail to look like it has an\n * \"invalid\" file type.\n */\n#define EXT2_DIR_NAME_LEN_CSUM\t0xDE00\n\n/*\n * EXT2_DIR_PAD defines the directory entries boundaries\n *\n * NOTE: It must be a multiple of 4\n */\n#define EXT2_DIR_ENTRY_HEADER_LEN\t8\n#define EXT2_DIR_PAD\t\t\t4\n#define EXT2_DIR_ROUND\t\t\t(EXT2_DIR_PAD - 1)\n#define EXT2_DIR_REC_LEN(name_len)\t(((name_len) + \\\n\t\t\t\t\t  EXT2_DIR_ENTRY_HEADER_LEN + \\\n\t\t\t\t\t  EXT2_DIR_ROUND) & \\\n\t\t\t\t\t ~EXT2_DIR_ROUND)\n\n/*\n * Constants for ext4's extended time encoding\n */\n#define EXT4_EPOCH_BITS 2\n#define EXT4_EPOCH_MASK ((1 << EXT4_EPOCH_BITS) - 1)\n#define EXT4_NSEC_MASK  (~0UL << EXT4_EPOCH_BITS)\n\n/*\n * This structure is used for multiple mount protection. It is written\n * into the block number saved in the s_mmp_block field in the superblock.\n * Programs that check MMP should assume that if SEQ_FSCK (or any unknown\n * code above SEQ_MAX) is present then it is NOT safe to use the filesystem,\n * regardless of how old the timestamp is.\n *\n * The timestamp in the MMP structure will be updated by e2fsck at some\n * arbitrary intervals (start of passes, after every few groups of inodes\n * in pass1 and pass1b).  There is no guarantee that e2fsck is updating\n * the MMP block in a timely manner, and the updates it does are purely\n * for the convenience of the sysadmin and not for automatic validation.\n *\n * Note: Only the mmp_seq value is used to determine whether the MMP block\n *\tis being updated.  The mmp_time, mmp_nodename, and mmp_bdevname\n *\tfields are only for informational purposes for the administrator,\n *\tdue to clock skew between nodes and hostname HA service takeover.\n */\n#define EXT4_MMP_MAGIC     0x004D4D50U /* ASCII for MMP */\n#define EXT4_MMP_SEQ_CLEAN 0xFF4D4D50U /* mmp_seq value for clean unmount */\n#define EXT4_MMP_SEQ_FSCK  0xE24D4D50U /* mmp_seq value when being fscked */\n#define EXT4_MMP_SEQ_MAX   0xE24D4D4FU /* maximum valid mmp_seq value */\n\n/* Not endian-annotated; it's swapped at read/write time */\nstruct mmp_struct {\n\t__u32\tmmp_magic;\t\t/* Magic number for MMP */\n\t__u32\tmmp_seq;\t\t/* Sequence no. updated periodically */\n\t__u64\tmmp_time;\t\t/* Time last updated (seconds) */\n\t__u8\tmmp_nodename[64];\t/* Node updating MMP block, no NUL? */\n\t__u8\tmmp_bdevname[32];\t/* Bdev updating MMP block, no NUL? */\n\t__u16\tmmp_check_interval;\t/* Changed mmp_check_interval */\n\t__u16\tmmp_pad1;\n\t__u32\tmmp_pad2[226];\n\t__u32\tmmp_checksum;\t\t/* crc32c(uuid+mmp_block) */\n};\n\n/*\n * Default interval for MMP update in seconds.\n */\n#define EXT4_MMP_UPDATE_INTERVAL\t5\n\n/*\n * Maximum interval for MMP update in seconds.\n */\n#define EXT4_MMP_MAX_UPDATE_INTERVAL\t300\n\n/*\n * Minimum interval for MMP checking in seconds.\n */\n#define EXT4_MMP_MIN_CHECK_INTERVAL     5\n\n/*\n * Minimum size of inline data.\n */\n#define EXT4_MIN_INLINE_DATA_SIZE\t((sizeof(__u32) * EXT2_N_BLOCKS))\n\n/*\n * Size of a parent inode in inline data directory.\n */\n#define EXT4_INLINE_DATA_DOTDOT_SIZE\t(4)\n\n#define EXT4_ENC_UTF8_12_1\t1\n\n#define EXT4_ENC_STRICT_MODE_FL\t\t\t(1 << 0) /* Reject invalid sequences */\n\n#endif\t/* _LINUX_EXT2_FS_H */\n"
  },
  {
    "path": "src/ext2fs/ext2_io.h",
    "content": "/*\n * io.h --- the I/O manager abstraction\n *\n * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#ifndef _EXT2FS_EXT2_IO_H\n#define _EXT2FS_EXT2_IO_H\n\n#include <ext2fs/ext2_types.h>\n\n/*\n * ext2_loff_t is defined here since unix_io.c needs it.\n */\n#if defined(__GNUC__) || defined(HAS_LONG_LONG)\ntypedef long long\text2_loff_t;\n#else\ntypedef long\t\text2_loff_t;\n#endif\n\n/* llseek.c */\next2_loff_t ext2fs_llseek (int, ext2_loff_t, int);\n\ntypedef struct struct_io_manager *io_manager;\ntypedef struct struct_io_channel *io_channel;\ntypedef struct struct_io_stats *io_stats;\n\n#define CHANNEL_FLAGS_WRITETHROUGH\t0x01\n#define CHANNEL_FLAGS_DISCARD_ZEROES\t0x02\n#define CHANNEL_FLAGS_BLOCK_DEVICE\t0x04\n\n#define io_channel_discard_zeroes_data(i) (i->flags & CHANNEL_FLAGS_DISCARD_ZEROES)\n\nstruct struct_io_channel {\n\terrcode_t\tmagic;\n\tio_manager\tmanager;\n\tchar\t\t*name;\n\tint\t\tblock_size;\n\terrcode_t\t(*read_error)(io_channel channel,\n\t\t\t\t      unsigned long block,\n\t\t\t\t      int count,\n\t\t\t\t      void *data,\n\t\t\t\t      size_t size,\n\t\t\t\t      int actual_bytes_read,\n\t\t\t\t      errcode_t\terror);\n\terrcode_t\t(*write_error)(io_channel channel,\n\t\t\t\t       unsigned long block,\n\t\t\t\t       int count,\n\t\t\t\t       const void *data,\n\t\t\t\t       size_t size,\n\t\t\t\t       int actual_bytes_written,\n\t\t\t\t       errcode_t error);\n\tint\t\trefcount;\n\tint\t\tflags;\n\tlong\t\treserved[14];\n\tvoid\t\t*private_data;\n\tvoid\t\t*app_data;\n\tint\t\talign;\n};\n\nstruct struct_io_stats {\n\tint\t\t\tnum_fields;\n\tint\t\t\treserved;\n\tunsigned long long\tbytes_read;\n\tunsigned long long\tbytes_written;\n};\n\nstruct struct_io_manager {\n\terrcode_t magic;\n\tconst char *name;\n\terrcode_t (*open)(const char *name, int flags, io_channel *channel);\n\terrcode_t (*close)(io_channel channel);\n\terrcode_t (*set_blksize)(io_channel channel, int blksize);\n\terrcode_t (*read_blk)(io_channel channel, unsigned long block,\n\t\t\t      int count, void *data);\n\terrcode_t (*write_blk)(io_channel channel, unsigned long block,\n\t\t\t       int count, const void *data);\n\terrcode_t (*flush)(io_channel channel);\n\terrcode_t (*write_byte)(io_channel channel, unsigned long offset,\n\t\t\t\tint count, const void *data);\n\terrcode_t (*set_option)(io_channel channel, const char *option,\n\t\t\t\tconst char *arg);\n\terrcode_t (*get_stats)(io_channel channel, io_stats *io_stats);\n\terrcode_t (*read_blk64)(io_channel channel, unsigned long long block,\n\t\t\t\t\tint count, void *data);\n\terrcode_t (*write_blk64)(io_channel channel, unsigned long long block,\n\t\t\t\t\tint count, const void *data);\n\terrcode_t (*discard)(io_channel channel, unsigned long long block,\n\t\t\t     unsigned long long count);\n\terrcode_t (*cache_readahead)(io_channel channel,\n\t\t\t\t     unsigned long long block,\n\t\t\t\t     unsigned long long count);\n\terrcode_t (*zeroout)(io_channel channel, unsigned long long block,\n\t\t\t     unsigned long long count);\n\tlong\treserved[14];\n};\n\n#define IO_FLAG_RW\t\t0x0001\n#define IO_FLAG_EXCLUSIVE\t0x0002\n#define IO_FLAG_DIRECT_IO\t0x0004\n#define IO_FLAG_FORCE_BOUNCE\t0x0008\n\n/*\n * Convenience functions....\n */\n#define io_channel_close(c) \t\t((c)->manager->close((c)))\n#define io_channel_set_blksize(c,s)\t((c)->manager->set_blksize((c),s))\n#define io_channel_read_blk(c,b,n,d)\t((c)->manager->read_blk((c),b,n,d))\n#define io_channel_write_blk(c,b,n,d)\t((c)->manager->write_blk((c),b,n,d))\n#define io_channel_flush(c) \t\t((c)->manager->flush((c)))\n#define io_channel_bumpcount(c)\t\t((c)->refcount++)\n\n/* io_manager.c */\nextern errcode_t io_channel_set_options(io_channel channel,\n\t\t\t\t\tconst char *options);\nextern errcode_t io_channel_write_byte(io_channel channel,\n\t\t\t\t       unsigned long offset,\n\t\t\t\t       int count, const void *data);\nextern errcode_t io_channel_read_blk64(io_channel channel,\n\t\t\t\t       unsigned long long block,\n\t\t\t\t       int count, void *data);\nextern errcode_t io_channel_write_blk64(io_channel channel,\n\t\t\t\t\tunsigned long long block,\n\t\t\t\t\tint count, const void *data);\nextern errcode_t io_channel_discard(io_channel channel,\n\t\t\t\t    unsigned long long block,\n\t\t\t\t    unsigned long long count);\nextern errcode_t io_channel_zeroout(io_channel channel,\n\t\t\t\t    unsigned long long block,\n\t\t\t\t    unsigned long long count);\nextern errcode_t io_channel_alloc_buf(io_channel channel,\n\t\t\t\t      int count, void *ptr);\nextern errcode_t io_channel_cache_readahead(io_channel io,\n\t\t\t\t\t    unsigned long long block,\n\t\t\t\t\t    unsigned long long count);\n\n/* unix_io.c */\nextern io_manager unix_io_manager;\nextern io_manager unixfd_io_manager;\n\n/* sparse_io.c */\nextern io_manager sparse_io_manager;\nextern io_manager sparsefd_io_manager;\n\n/* undo_io.c */\nextern io_manager undo_io_manager;\nextern errcode_t set_undo_io_backing_manager(io_manager manager);\nextern errcode_t set_undo_io_backup_file(char *file_name);\n\n/* test_io.c */\nextern io_manager test_io_manager, test_io_backing_manager;\nextern void (*test_io_cb_read_blk)\n\t(unsigned long block, int count, errcode_t err);\nextern void (*test_io_cb_write_blk)\n\t(unsigned long block, int count, errcode_t err);\nextern void (*test_io_cb_read_blk64)\n\t(unsigned long long block, int count, errcode_t err);\nextern void (*test_io_cb_write_blk64)\n\t(unsigned long long block, int count, errcode_t err);\nextern void (*test_io_cb_set_blksize)\n\t(int blksize, errcode_t err);\n\n#endif /* _EXT2FS_EXT2_IO_H */\n\n"
  },
  {
    "path": "src/ext2fs/ext2_types.h",
    "content": "/*\n * If linux/types.h is already been included, assume it has defined\n * everything we need.  (cross fingers)  Other header files may have\n * also defined the types that we need.\n */\n#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \\\n\t!defined(_EXT2_TYPES_H))\n#define _EXT2_TYPES_H\n\n#include <stdint.h>\n\n#ifndef HAVE___U8\n#define HAVE___U8\ntypedef uint8_t __u8;\n#endif /* HAVE___U8 */\n\n#ifndef HAVE___S8\n#define HAVE___S8\ntypedef int8_t __s8;\n#endif /* HAVE___S8 */\n\n#ifndef HAVE___U16\n#define HAVE___U16\ntypedef uint16_t __u16;\n#endif /* HAVE___U16 */\n\n#ifndef HAVE___S16\n#define HAVE___S16\ntypedef int16_t __s16;\n#endif /* HAVE___S16 */\n\n#ifndef HAVE___U32\n#define HAVE___U32\ntypedef uint32_t __u32;\n#endif /* HAVE___U32 */\n\n#ifndef HAVE___S32\n#define HAVE___S32\ntypedef int32_t __s32;\n#endif /* HAVE___S32 */\n\n#ifndef HAVE___U64\n#define HAVE___U64\ntypedef uint64_t __u64;\n#endif /* HAVE___U64 */\n\n#ifndef HAVE___S64\n#define HAVE___S64\ntypedef int64_t __s64;\n#endif /* HAVE___S64 */\n\n#undef __S8_TYPEDEF\n#undef __U8_TYPEDEF\n#undef __S16_TYPEDEF\n#undef __U16_TYPEDEF\n#undef __S32_TYPEDEF\n#undef __U32_TYPEDEF\n#undef __S64_TYPEDEF\n#undef __U64_TYPEDEF\n\n#endif /* _*_TYPES_H */\n\n/* endian checking stuff */\n#ifndef EXT2_ENDIAN_H_\n#define EXT2_ENDIAN_H_\n\n#ifdef __CHECKER__\n# ifndef __bitwise\n#  define __bitwise\t\t__attribute__((bitwise))\n# endif\n#define __force\t\t\t__attribute__((force))\n#else\n# ifndef __bitwise\n#  define __bitwise\n# endif\n#define __force\n#endif\n\ntypedef __u16\t__bitwise\t__le16;\ntypedef __u32\t__bitwise\t__le32;\ntypedef __u64\t__bitwise\t__le64;\ntypedef __u16\t__bitwise\t__be16;\ntypedef __u32\t__bitwise\t__be32;\ntypedef __u64\t__bitwise\t__be64;\n\n#endif /* EXT2_ENDIAN_H_ */\n\n/* These defines are needed for the public ext2fs.h header file */\n#define HAVE_SYS_TYPES_H 1\n#undef WORDS_BIGENDIAN\n"
  },
  {
    "path": "src/ext2fs/ext2fs.h",
    "content": "/*\n * ext2fs.h --- ext2fs\n *\n * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#ifndef _EXT2FS_EXT2FS_H\n#define _EXT2FS_EXT2FS_H\n\n#ifdef __GNUC__\n#define EXT2FS_ATTR(x) __attribute__(x)\n#else\n#define EXT2FS_ATTR(x)\n#endif\n\n#ifdef CONFIG_TDB\n#define EXT2FS_NO_TDB_UNUSED\n#else\n#define EXT2FS_NO_TDB_UNUSED\tEXT2FS_ATTR((unused))\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Non-GNU C compilers won't necessarily understand inline\n */\n#if (!defined(__GNUC__) && !defined(__WATCOMC__) && !defined(_MSC_VER))\n#define NO_INLINE_FUNCS\n#endif\n\n/*\n * Where the master copy of the superblock is located, and how big\n * superblocks are supposed to be.  We define SUPERBLOCK_SIZE because\n * the size of the superblock structure is not necessarily trustworthy\n * (some versions have the padding set up so that the superblock is\n * 1032 bytes long).\n */\n#define SUPERBLOCK_OFFSET\t1024\n#define SUPERBLOCK_SIZE\t\t1024\n\n#define UUID_STR_SIZE 37\n\n/*\n * The last ext2fs revision level that this version of the library is\n * able to support.\n */\n#define EXT2_LIB_CURRENT_REV\tEXT2_DYNAMIC_REV\n\n#ifdef HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <time.h>\n#include <errno.h>\n#include <unistd.h>\n\n#ifdef EXT2_FLAT_INCLUDES\n#include \"ext2_types.h\"\n#include \"ext2_fs.h\"\n#include \"ext3_extents.h\"\n#else\n#include <ext2fs/ext2_types.h>\n#include <ext2fs/ext2_fs.h>\n#include <ext2fs/ext3_extents.h>\n#endif /* EXT2_FLAT_INCLUDES */\n\ntypedef __u32 __bitwise\t\text2_ino_t;\ntypedef __u32 __bitwise\t\tblk_t;\ntypedef __u64 __bitwise\t\tblk64_t;\ntypedef __u32 __bitwise\t\tdgrp_t;\ntypedef __u32 __bitwise\t\text2_off_t;\ntypedef __u64 __bitwise\t\text2_off64_t;\ntypedef __s64 __bitwise\t\te2_blkcnt_t;\ntypedef __u32 __bitwise\t\text2_dirhash_t;\n\n#ifdef EXT2_FLAT_INCLUDES\n#include \"com_err.h\"\n#include \"ext2_io.h\"\n#include \"ext2_err.h\"\n#include \"ext2_ext_attr.h\"\n#else\n#include <ext2fs/com_err.h>\n#include <ext2fs/ext2_io.h>\n#include <ext2fs/ext2_err.h>\n#include <ext2fs/ext2_ext_attr.h>\n#endif\n\n#include \"hashmap.h\"\n\n#define EXT2_QSORT_TYPE int\n\ntypedef struct struct_ext2_filsys *ext2_filsys;\n\n#define EXT2FS_MARK_ERROR \t0\n#define EXT2FS_UNMARK_ERROR \t1\n#define EXT2FS_TEST_ERROR\t2\n\nstruct ext2fs_struct_generic_bitmap_base {\n\terrcode_t\t\tmagic;\n\text2_filsys \t\tfs;\n};\n\ntypedef struct ext2fs_struct_generic_bitmap_base *ext2fs_generic_bitmap;\ntypedef struct ext2fs_struct_generic_bitmap_base *ext2fs_inode_bitmap;\ntypedef struct ext2fs_struct_generic_bitmap_base *ext2fs_block_bitmap;\n\n#define EXT2_FIRST_INODE(s)\tEXT2_FIRST_INO(s)\n\n\n/*\n * Badblocks list definitions\n */\n\ntypedef struct ext2_struct_u32_list *ext2_badblocks_list;\ntypedef struct ext2_struct_u32_iterate *ext2_badblocks_iterate;\n\ntypedef struct ext2_struct_u32_list *ext2_u32_list;\ntypedef struct ext2_struct_u32_iterate *ext2_u32_iterate;\n\n/* old */\ntypedef struct ext2_struct_u32_list *badblocks_list;\ntypedef struct ext2_struct_u32_iterate *badblocks_iterate;\n\n#define BADBLOCKS_FLAG_DIRTY\t1\n\n/*\n * ext2_dblist structure and abstractions (see dblist.c)\n */\nstruct ext2_db_entry2 {\n\text2_ino_t\tino;\n\tblk64_t\tblk;\n\te2_blkcnt_t\tblockcnt;\n};\n\n/* Ye Olde 32-bit version */\nstruct ext2_db_entry {\n\text2_ino_t\tino;\n\tblk_t\tblk;\n\tint\tblockcnt;\n};\n\ntypedef struct ext2_struct_dblist *ext2_dblist;\n\n#define DBLIST_ABORT\t1\n\n/*\n * ext2_fileio definitions\n */\n\n#define EXT2_FILE_WRITE\t\t0x0001\n#define EXT2_FILE_CREATE\t0x0002\n\n#define EXT2_FILE_MASK\t\t0x00FF\n\n#define EXT2_FILE_BUF_DIRTY\t0x4000\n#define EXT2_FILE_BUF_VALID\t0x2000\n\ntypedef struct ext2_file *ext2_file_t;\n\n#define EXT2_SEEK_SET\t0\n#define EXT2_SEEK_CUR\t1\n#define EXT2_SEEK_END\t2\n\n/*\n * Flags for the ext2_filsys structure and for ext2fs_open()\n */\n#define EXT2_FLAG_RW\t\t\t0x01\n#define EXT2_FLAG_CHANGED\t\t0x02\n#define EXT2_FLAG_DIRTY\t\t\t0x04\n#define EXT2_FLAG_VALID\t\t\t0x08\n#define EXT2_FLAG_IB_DIRTY\t\t0x10\n#define EXT2_FLAG_BB_DIRTY\t\t0x20\n#define EXT2_FLAG_SWAP_BYTES\t\t0x40\n#define EXT2_FLAG_SWAP_BYTES_READ\t0x80\n#define EXT2_FLAG_SWAP_BYTES_WRITE\t0x100\n#define EXT2_FLAG_MASTER_SB_ONLY\t0x200\n#define EXT2_FLAG_FORCE\t\t\t0x400\n#define EXT2_FLAG_SUPER_ONLY\t\t0x800\n#define EXT2_FLAG_JOURNAL_DEV_OK\t0x1000\n#define EXT2_FLAG_IMAGE_FILE\t\t0x2000\n#define EXT2_FLAG_EXCLUSIVE\t\t0x4000\n#define EXT2_FLAG_SOFTSUPP_FEATURES\t0x8000\n#define EXT2_FLAG_NOFREE_ON_ERROR\t0x10000\n#define EXT2_FLAG_64BITS\t\t0x20000\n#define EXT2_FLAG_PRINT_PROGRESS\t0x40000\n#define EXT2_FLAG_DIRECT_IO\t\t0x80000\n#define EXT2_FLAG_SKIP_MMP\t\t0x100000\n#define EXT2_FLAG_IGNORE_CSUM_ERRORS\t0x200000\n#define EXT2_FLAG_SHARE_DUP\t\t0x400000\n#define EXT2_FLAG_IGNORE_SB_ERRORS\t0x800000\n#define EXT2_FLAG_BBITMAP_TAIL_PROBLEM\t0x1000000\n#define EXT2_FLAG_IBITMAP_TAIL_PROBLEM\t0x2000000\n\n/*\n * Special flag in the ext2 inode i_flag field that means that this is\n * a new inode.  (So that ext2_write_inode() can clear extra fields.)\n */\n#define EXT2_NEW_INODE_FL\t0x80000000\n\n/*\n * Flags for mkjournal\n */\n#define EXT2_MKJOURNAL_V1_SUPER\t0x0000001 /* create V1 superblock (deprecated) */\n#define EXT2_MKJOURNAL_LAZYINIT\t0x0000002 /* don't zero journal inode before use*/\n#define EXT2_MKJOURNAL_NO_MNT_CHECK 0x0000004 /* don't check mount status */\n\nstruct blk_alloc_ctx;\nstruct opaque_ext2_group_desc;\n\nstruct struct_ext2_filsys {\n\terrcode_t\t\t\tmagic;\n\tio_channel\t\t\tio;\n\tint\t\t\t\tflags;\n\tchar *\t\t\t\tdevice_name;\n\tstruct ext2_super_block\t* \tsuper;\n\tunsigned int\t\t\tblocksize;\n\tint\t\t\t\tfragsize;\n\tdgrp_t\t\t\t\tgroup_desc_count;\n\tunsigned long\t\t\tdesc_blocks;\n\tstruct opaque_ext2_group_desc *\tgroup_desc;\n\tunsigned int\t\t\tinode_blocks_per_group;\n\text2fs_inode_bitmap\t\tinode_map;\n\text2fs_block_bitmap\t\tblock_map;\n\t/* XXX FIXME-64: not 64-bit safe, but not used? */\n\terrcode_t (*get_blocks)(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks);\n\terrcode_t (*check_directory)(ext2_filsys fs, ext2_ino_t ino);\n\terrcode_t (*write_bitmaps)(ext2_filsys fs);\n\terrcode_t (*read_inode)(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\tstruct ext2_inode *inode);\n\terrcode_t (*write_inode)(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\tstruct ext2_inode *inode);\n\text2_badblocks_list\t\tbadblocks;\n\text2_dblist\t\t\tdblist;\n\t__u32\t\t\t\tstride;\t/* for mke2fs */\n\tstruct ext2_super_block *\torig_super;\n\tstruct ext2_image_hdr *\t\timage_header;\n\t__u32\t\t\t\tumask;\n\ttime_t\t\t\t\tnow;\n\tint\t\t\t\tcluster_ratio_bits;\n\t__u16\t\t\t\tdefault_bitmap_type;\n\t__u16\t\t\t\tpad;\n\t/*\n\t * Reserved for future expansion\n\t */\n\t__u32\t\t\t\treserved[5];\n\n\t/*\n\t * Reserved for the use of the calling application.\n\t */\n\tvoid *\t\t\t\tpriv_data;\n\n\t/*\n\t * Inode cache\n\t */\n\tstruct ext2_inode_cache\t\t*icache;\n\tio_channel\t\t\timage_io;\n\n\t/*\n\t * More callback functions\n\t */\n\terrcode_t (*get_alloc_block)(ext2_filsys fs, blk64_t goal,\n\t\t\t\t     blk64_t *ret);\n\terrcode_t (*get_alloc_block2)(ext2_filsys fs, blk64_t goal,\n\t\t\t\t      blk64_t *ret, struct blk_alloc_ctx *ctx);\n\tvoid (*block_alloc_stats)(ext2_filsys fs, blk64_t blk, int inuse);\n\n\t/*\n\t * Buffers for Multiple mount protection(MMP) block.\n\t */\n\tvoid *mmp_buf;\n\tvoid *mmp_cmp;\n\tint mmp_fd;\n\n\t/*\n\t * Time at which e2fsck last updated the MMP block.\n\t */\n\tlong mmp_last_written;\n\n\t/* progress operation functions */\n\tstruct ext2fs_progress_ops *progress_ops;\n\n\t/* Precomputed FS UUID checksum for seeding other checksums */\n\t__u32 csum_seed;\n\n\tio_channel\t\t\tjournal_io;\n\tchar\t\t\t\t*journal_name;\n\n\t/* New block range allocation hooks */\n\terrcode_t (*new_range)(ext2_filsys fs, int flags, blk64_t goal,\n\t\t\t       blk64_t len, blk64_t *pblk, blk64_t *plen);\n\tvoid (*block_alloc_stats_range)(ext2_filsys fs, blk64_t blk, blk_t num,\n\t\t\t\t\tint inuse);\n\n\t/* hashmap for SHA of data blocks */\n\tstruct ext2fs_hashmap* block_sha_map;\n\n\tconst struct ext2fs_nls_table *encoding;\n};\n\n#if EXT2_FLAT_INCLUDES\n#include \"e2_bitops.h\"\n#else\n#include <ext2fs/bitops.h>\n#endif\n\n/*\n * 64-bit bitmap backend types\n */\n#define EXT2FS_BMAP64_BITARRAY\t1\n#define EXT2FS_BMAP64_RBTREE\t2\n#define EXT2FS_BMAP64_AUTODIR\t3\n\n/*\n * Return flags for the block iterator functions\n */\n#define BLOCK_CHANGED\t\t\t1\n#define BLOCK_ABORT\t\t\t2\n#define BLOCK_ERROR\t\t\t4\n#define BLOCK_INLINE_DATA_CHANGED\t8\n\n/*\n * Block interate flags\n *\n * BLOCK_FLAG_APPEND, or BLOCK_FLAG_HOLE, indicates that the interator\n * function should be called on blocks where the block number is zero.\n * This is used by ext2fs_expand_dir() to be able to add a new block\n * to an inode.  It can also be used for programs that want to be able\n * to deal with files that contain \"holes\".\n *\n * BLOCK_FLAG_DEPTH_TRAVERSE indicates that the iterator function for\n * the indirect, doubly indirect, etc. blocks should be called after\n * all of the blocks contained in the indirect blocks are processed.\n * This is useful if you are going to be deallocating blocks from an\n * inode.\n *\n * BLOCK_FLAG_DATA_ONLY indicates that the iterator function should be\n * called for data blocks only.\n *\n * BLOCK_FLAG_READ_ONLY is a promise by the caller that it will not\n * modify returned block number.\n *\n * BLOCK_FLAG_NO_LARGE is for internal use only.  It informs\n * ext2fs_block_iterate2 that large files won't be accepted.\n */\n#define BLOCK_FLAG_APPEND\t1\n#define BLOCK_FLAG_HOLE\t\t1\n#define BLOCK_FLAG_DEPTH_TRAVERSE\t2\n#define BLOCK_FLAG_DATA_ONLY\t4\n#define BLOCK_FLAG_READ_ONLY\t8\n\n#define BLOCK_FLAG_NO_LARGE\t0x1000\n\n/*\n * Magic \"block count\" return values for the block iterator function.\n */\n#define BLOCK_COUNT_IND\t\t(-1)\n#define BLOCK_COUNT_DIND\t(-2)\n#define BLOCK_COUNT_TIND\t(-3)\n#define BLOCK_COUNT_TRANSLATOR\t(-4)\n\n#define BLOCK_ALLOC_UNKNOWN\t0\n#define BLOCK_ALLOC_DATA\t1\n#define BLOCK_ALLOC_METADATA\t2\n\nstruct blk_alloc_ctx {\n\text2_ino_t\t\tino;\n\tstruct ext2_inode\t*inode;\n\tblk64_t\t\t\tlblk;\n\tint\t\t\tflags;\n};\n\n#if 0\n/*\n * Flags for ext2fs_move_blocks\n */\n#define EXT2_BMOVE_GET_DBLIST\t0x0001\n#define EXT2_BMOVE_DEBUG\t0x0002\n#endif\n\n/*\n * Generic (non-filesystem layout specific) extents structure\n */\n\n#define EXT2_EXTENT_FLAGS_LEAF\t\t0x0001\n#define EXT2_EXTENT_FLAGS_UNINIT\t0x0002\n#define EXT2_EXTENT_FLAGS_SECOND_VISIT\t0x0004\n\nstruct ext2fs_extent {\n\tblk64_t\te_pblk;\t\t/* first physical block */\n\tblk64_t\te_lblk;\t\t/* first logical block extent covers */\n\t__u32\te_len;\t\t/* number of blocks covered by extent */\n\t__u32\te_flags;\t/* extent flags */\n};\n\ntypedef struct ext2_extent_handle *ext2_extent_handle_t;\ntypedef struct ext2_extent_path *ext2_extent_path_t;\n\n/*\n * Flags used by ext2fs_extent_get()\n */\n#define EXT2_EXTENT_CURRENT\t0x0000\n#define EXT2_EXTENT_MOVE_MASK\t0x000F\n#define EXT2_EXTENT_ROOT\t0x0001\n#define EXT2_EXTENT_LAST_LEAF\t0x0002\n#define EXT2_EXTENT_FIRST_SIB\t0x0003\n#define EXT2_EXTENT_LAST_SIB\t0x0004\n#define EXT2_EXTENT_NEXT_SIB\t0x0005\n#define EXT2_EXTENT_PREV_SIB\t0x0006\n#define EXT2_EXTENT_NEXT_LEAF\t0x0007\n#define EXT2_EXTENT_PREV_LEAF\t0x0008\n#define EXT2_EXTENT_NEXT\t0x0009\n#define EXT2_EXTENT_PREV\t0x000A\n#define EXT2_EXTENT_UP\t\t0x000B\n#define EXT2_EXTENT_DOWN\t0x000C\n#define EXT2_EXTENT_DOWN_AND_LAST 0x000D\n\n/*\n * Flags used by ext2fs_extent_insert()\n */\n#define EXT2_EXTENT_INSERT_AFTER\t0x0001 /* insert after handle loc'n */\n#define EXT2_EXTENT_INSERT_NOSPLIT\t0x0002 /* insert may not cause split */\n\n/*\n * Flags used by ext2fs_extent_delete()\n */\n#define EXT2_EXTENT_DELETE_KEEP_EMPTY\t0x001 /* keep node if last extent gone */\n\n/*\n * Flags used by ext2fs_extent_set_bmap()\n */\n#define EXT2_EXTENT_SET_BMAP_UNINIT\t0x0001\n\n/*\n * Data structure returned by ext2fs_extent_get_info()\n */\nstruct ext2_extent_info {\n\tint\t\tcurr_entry;\n\tint\t\tcurr_level;\n\tint\t\tnum_entries;\n\tint\t\tmax_entries;\n\tint\t\tmax_depth;\n\tint\t\tbytes_avail;\n\tblk64_t\t\tmax_lblk;\n\tblk64_t\t\tmax_pblk;\n\t__u32\t\tmax_len;\n\t__u32\t\tmax_uninit_len;\n};\n\n/*\n * Flags for directory block reading and writing functions\n */\n#define EXT2_DIRBLOCK_V2_STRUCT\t0x0001\n\n/*\n * Return flags for the directory iterator functions\n */\n#define DIRENT_CHANGED\t1\n#define DIRENT_ABORT\t2\n#define DIRENT_ERROR\t3\n\n/*\n * Directory iterator flags\n */\n\n#define DIRENT_FLAG_INCLUDE_EMPTY\t1\n#define DIRENT_FLAG_INCLUDE_REMOVED\t2\n#define DIRENT_FLAG_INCLUDE_CSUM\t4\n#define DIRENT_FLAG_INCLUDE_INLINE_DATA 8\n\n#define DIRENT_DOT_FILE\t\t1\n#define DIRENT_DOT_DOT_FILE\t2\n#define DIRENT_OTHER_FILE\t3\n#define DIRENT_DELETED_FILE\t4\n#define DIRENT_CHECKSUM\t\t5\n\n/*\n * Inode scan definitions\n */\ntypedef struct ext2_struct_inode_scan *ext2_inode_scan;\n\n/*\n * ext2fs_scan flags\n */\n#define EXT2_SF_CHK_BADBLOCKS\t0x0001\n#define EXT2_SF_BAD_INODE_BLK\t0x0002\n#define EXT2_SF_BAD_EXTRA_BYTES\t0x0004\n#define EXT2_SF_SKIP_MISSING_ITABLE\t0x0008\n#define EXT2_SF_DO_LAZY\t\t0x0010\n#define EXT2_SF_WARN_GARBAGE_INODES\t0x0020\n\n/*\n * ext2fs_check_if_mounted flags\n */\n#define EXT2_MF_MOUNTED\t\t1\n#define EXT2_MF_ISROOT\t\t2\n#define EXT2_MF_READONLY\t4\n#define EXT2_MF_SWAP\t\t8\n#define EXT2_MF_BUSY\t\t16\n\n/*\n * Ext2/linux mode flags.  We define them here so that we don't need\n * to depend on the OS's sys/stat.h, since we may be compiling on a\n * non-Linux system.\n */\n#define LINUX_S_IFMT  00170000\n#define LINUX_S_IFSOCK 0140000\n#define LINUX_S_IFLNK\t 0120000\n#define LINUX_S_IFREG  0100000\n#define LINUX_S_IFBLK  0060000\n#define LINUX_S_IFDIR  0040000\n#define LINUX_S_IFCHR  0020000\n#define LINUX_S_IFIFO  0010000\n#define LINUX_S_ISUID  0004000\n#define LINUX_S_ISGID  0002000\n#define LINUX_S_ISVTX  0001000\n\n#define LINUX_S_IRWXU 00700\n#define LINUX_S_IRUSR 00400\n#define LINUX_S_IWUSR 00200\n#define LINUX_S_IXUSR 00100\n\n#define LINUX_S_IRWXG 00070\n#define LINUX_S_IRGRP 00040\n#define LINUX_S_IWGRP 00020\n#define LINUX_S_IXGRP 00010\n\n#define LINUX_S_IRWXO 00007\n#define LINUX_S_IROTH 00004\n#define LINUX_S_IWOTH 00002\n#define LINUX_S_IXOTH 00001\n\n#define LINUX_S_ISLNK(m)\t(((m) & LINUX_S_IFMT) == LINUX_S_IFLNK)\n#define LINUX_S_ISREG(m)\t(((m) & LINUX_S_IFMT) == LINUX_S_IFREG)\n#define LINUX_S_ISDIR(m)\t(((m) & LINUX_S_IFMT) == LINUX_S_IFDIR)\n#define LINUX_S_ISCHR(m)\t(((m) & LINUX_S_IFMT) == LINUX_S_IFCHR)\n#define LINUX_S_ISBLK(m)\t(((m) & LINUX_S_IFMT) == LINUX_S_IFBLK)\n#define LINUX_S_ISFIFO(m)\t(((m) & LINUX_S_IFMT) == LINUX_S_IFIFO)\n#define LINUX_S_ISSOCK(m)\t(((m) & LINUX_S_IFMT) == LINUX_S_IFSOCK)\n\n/*\n * ext2 size of an inode\n */\n#define EXT2_I_SIZE(i)\t((i)->i_size | ((__u64) (i)->i_size_high << 32))\n\n/*\n * ext2_icount_t abstraction\n */\n#define EXT2_ICOUNT_OPT_INCREMENT\t0x01\n#define EXT2_ICOUNT_OPT_FULLMAP\t\t0x02\n\ntypedef struct ext2_icount *ext2_icount_t;\n\n/*\n * Flags for ext2fs_bmap\n */\n#define BMAP_ALLOC\t0x0001\n#define BMAP_SET\t0x0002\n#define BMAP_UNINIT\t0x0004\n#define BMAP_ZERO\t0x0008\n\n/*\n * Returned flags from ext2fs_bmap\n */\n#define BMAP_RET_UNINIT\t0x0001\n\n/*\n * Flags for ext2fs_read_inode2\n */\n#define READ_INODE_NOCSUM\t0x0001\n\n/*\n * Flags for ext2fs_write_inode2\n */\n#define WRITE_INODE_NOCSUM\t0x0001\n\n/*\n * Flags for imager.c functions\n */\n#define IMAGER_FLAG_INODEMAP\t1\n#define IMAGER_FLAG_SPARSEWRITE\t2\n\n/*\n * For checking structure magic numbers...\n */\n\n#define EXT2_CHECK_MAGIC(struct, code) \\\n\t  if (!(struct) || (struct)->magic != (code)) return (code)\n\n/*\n * Features supported by this version of the library\n */\n#define EXT2_LIB_FEATURE_COMPAT_SUPP\t(EXT2_FEATURE_COMPAT_DIR_PREALLOC|\\\n\t\t\t\t\t EXT2_FEATURE_COMPAT_IMAGIC_INODES|\\\n\t\t\t\t\t EXT3_FEATURE_COMPAT_HAS_JOURNAL|\\\n\t\t\t\t\t EXT2_FEATURE_COMPAT_RESIZE_INODE|\\\n\t\t\t\t\t EXT2_FEATURE_COMPAT_DIR_INDEX|\\\n\t\t\t\t\t EXT2_FEATURE_COMPAT_EXT_ATTR|\\\n\t\t\t\t\t EXT4_FEATURE_COMPAT_SPARSE_SUPER2|\\\n\t\t\t\t\t EXT4_FEATURE_COMPAT_FAST_COMMIT|\\\n\t\t\t\t\t EXT4_FEATURE_COMPAT_STABLE_INODES)\n\n#ifdef CONFIG_MMP\n#define EXT4_LIB_INCOMPAT_MMP\t\tEXT4_FEATURE_INCOMPAT_MMP\n#else\n#define EXT4_LIB_INCOMPAT_MMP\t\t(0)\n#endif\n\n#define EXT2_LIB_FEATURE_INCOMPAT_SUPP\t(EXT2_FEATURE_INCOMPAT_FILETYPE|\\\n\t\t\t\t\t EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|\\\n\t\t\t\t\t EXT2_FEATURE_INCOMPAT_META_BG|\\\n\t\t\t\t\t EXT3_FEATURE_INCOMPAT_RECOVER|\\\n\t\t\t\t\t EXT3_FEATURE_INCOMPAT_EXTENTS|\\\n\t\t\t\t\t EXT4_FEATURE_INCOMPAT_FLEX_BG|\\\n\t\t\t\t\t EXT4_FEATURE_INCOMPAT_EA_INODE|\\\n\t\t\t\t\t EXT4_LIB_INCOMPAT_MMP|\\\n\t\t\t\t\t EXT4_FEATURE_INCOMPAT_64BIT|\\\n\t\t\t\t\t EXT4_FEATURE_INCOMPAT_INLINE_DATA|\\\n\t\t\t\t\t EXT4_FEATURE_INCOMPAT_ENCRYPT|\\\n\t\t\t\t\t EXT4_FEATURE_INCOMPAT_CASEFOLD|\\\n\t\t\t\t\t EXT4_FEATURE_INCOMPAT_CSUM_SEED|\\\n\t\t\t\t\t EXT4_FEATURE_INCOMPAT_LARGEDIR)\n\n#define EXT2_LIB_FEATURE_RO_COMPAT_SUPP\t(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER|\\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_HUGE_FILE|\\\n\t\t\t\t\t EXT2_FEATURE_RO_COMPAT_LARGE_FILE|\\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_DIR_NLINK|\\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE|\\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_GDT_CSUM|\\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_BIGALLOC|\\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_QUOTA|\\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_METADATA_CSUM|\\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_READONLY |\\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_PROJECT |\\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS |\\\n\t\t\t\t\t EXT4_FEATURE_RO_COMPAT_VERITY)\n\n/*\n * These features are only allowed if EXT2_FLAG_SOFTSUPP_FEATURES is passed\n * to ext2fs_openfs()\n */\n#define EXT2_LIB_SOFTSUPP_INCOMPAT\t(0)\n#define EXT2_LIB_SOFTSUPP_RO_COMPAT\t(EXT4_FEATURE_RO_COMPAT_REPLICA)\n\n\n/* Translate a block number to a cluster number */\n#define EXT2FS_CLUSTER_RATIO(fs)\t(1ULL << (fs)->cluster_ratio_bits)\n#define EXT2FS_CLUSTER_MASK(fs)\t\t(EXT2FS_CLUSTER_RATIO(fs) - 1)\n#define EXT2FS_B2C(fs, blk)\t\t((blk) >> (fs)->cluster_ratio_bits)\n/* Translate a cluster number to a block number */\n#define EXT2FS_C2B(fs, cluster)\t\t((cluster) << (fs)->cluster_ratio_bits)\n/* Translate # of blks to # of clusters */\n#define EXT2FS_NUM_B2C(fs, blks)\t(((blks) + EXT2FS_CLUSTER_MASK(fs)) >> \\\n\t\t\t\t\t (fs)->cluster_ratio_bits)\n\n#if defined(HAVE_FSTAT64) && !defined(__OSX_AVAILABLE_BUT_DEPRECATED)\ntypedef struct stat64 ext2fs_struct_stat;\n#else\ntypedef struct stat ext2fs_struct_stat;\n#endif\n\n/*\n * For ext2fs_close2() and ext2fs_flush2(), this flag allows you to\n * avoid the fsync call.\n */\n#define EXT2_FLAG_FLUSH_NO_SYNC          1\n\n/*\n * Modify and iterate extended attributes\n */\nstruct ext2_xattr_handle;\n#define XATTR_ABORT\t1\n#define XATTR_CHANGED\t2\n\n/*\n * function prototypes\n */\nstatic inline int ext2fs_has_group_desc_csum(ext2_filsys fs)\n{\n\treturn ext2fs_has_feature_metadata_csum(fs->super) ||\n\t       ext2fs_has_feature_gdt_csum(fs->super);\n}\n\n/* The LARGE_FILE feature should be set if we have stored files 2GB+ in size */\nstatic inline int ext2fs_needs_large_file_feature(unsigned long long file_size)\n{\n\treturn file_size >= 0x80000000ULL;\n}\n\n/* alloc.c */\nextern void ext2fs_clear_block_uninit(ext2_filsys fs, dgrp_t group);\nextern errcode_t ext2fs_new_inode(ext2_filsys fs, ext2_ino_t dir, int mode,\n\t\t\t\t  ext2fs_inode_bitmap map, ext2_ino_t *ret);\nextern errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal,\n\t\t\t\t  ext2fs_block_bitmap map, blk_t *ret);\nextern errcode_t ext2fs_new_block2(ext2_filsys fs, blk64_t goal,\n\t\t\t\t   ext2fs_block_bitmap map, blk64_t *ret);\nextern errcode_t ext2fs_new_block3(ext2_filsys fs, blk64_t goal,\n\t\t\t\t   ext2fs_block_bitmap map, blk64_t *ret,\n\t\t\t\t   struct blk_alloc_ctx *ctx);\nextern errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start,\n\t\t\t\t\tblk_t finish, int num,\n\t\t\t\t\text2fs_block_bitmap map,\n\t\t\t\t\tblk_t *ret);\nextern errcode_t ext2fs_get_free_blocks2(ext2_filsys fs, blk64_t start,\n\t\t\t\t\t blk64_t finish, int num,\n\t\t\t\t\t ext2fs_block_bitmap map,\n\t\t\t\t\t blk64_t *ret);\nextern errcode_t ext2fs_alloc_block(ext2_filsys fs, blk_t goal,\n\t\t\t\t    char *block_buf, blk_t *ret);\nextern errcode_t ext2fs_alloc_block2(ext2_filsys fs, blk64_t goal,\n\t\t\t\t     char *block_buf, blk64_t *ret);\nextern errcode_t ext2fs_alloc_block3(ext2_filsys fs, blk64_t goal,\n\t\t\t\t     char *block_buf, blk64_t *ret,\n\t\t\t\t     struct blk_alloc_ctx *ctx);\n\nextern void ext2fs_set_alloc_block_callback(ext2_filsys fs,\n\t\t\t\t\t    errcode_t (*func)(ext2_filsys fs,\n\t\t\t\t\t\t\t      blk64_t goal,\n\t\t\t\t\t\t\t      blk64_t *ret),\n\t\t\t\t\t    errcode_t (**old)(ext2_filsys fs,\n\t\t\t\t\t\t\t      blk64_t goal,\n\t\t\t\t\t\t\t      blk64_t *ret));\nblk64_t ext2fs_find_inode_goal(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t       struct ext2_inode *inode, blk64_t lblk);\nextern void ext2fs_set_new_range_callback(ext2_filsys fs,\n\terrcode_t (*func)(ext2_filsys fs, int flags, blk64_t goal,\n\t\t\t       blk64_t len, blk64_t *pblk, blk64_t *plen),\n\terrcode_t (**old)(ext2_filsys fs, int flags, blk64_t goal,\n\t\t\t       blk64_t len, blk64_t *pblk, blk64_t *plen));\nextern void ext2fs_set_block_alloc_stats_range_callback(ext2_filsys fs,\n\tvoid (*func)(ext2_filsys fs, blk64_t blk,\n\t\t\t\t    blk_t num, int inuse),\n\tvoid (**old)(ext2_filsys fs, blk64_t blk,\n\t\t\t\t    blk_t num, int inuse));\n#define EXT2_NEWRANGE_FIXED_GOAL\t(0x1)\n#define EXT2_NEWRANGE_MIN_LENGTH\t(0x2)\n#define EXT2_NEWRANGE_ALL_FLAGS\t\t(0x3)\nerrcode_t ext2fs_new_range(ext2_filsys fs, int flags, blk64_t goal,\n\t\t\t   blk64_t len, ext2fs_block_bitmap map, blk64_t *pblk,\n\t\t\t   blk64_t *plen);\n#define EXT2_ALLOCRANGE_FIXED_GOAL\t(0x1)\n#define EXT2_ALLOCRANGE_ZERO_BLOCKS\t(0x2)\n#define EXT2_ALLOCRANGE_ALL_FLAGS\t(0x3)\nerrcode_t ext2fs_alloc_range(ext2_filsys fs, int flags, blk64_t goal,\n\t\t\t     blk_t len, blk64_t *ret);\n\n/* alloc_sb.c */\nextern int ext2fs_reserve_super_and_bgd(ext2_filsys fs,\n\t\t\t\t\tdgrp_t group,\n\t\t\t\t\text2fs_block_bitmap bmap);\nextern void ext2fs_set_block_alloc_stats_callback(ext2_filsys fs,\n\t\t\t\t\t\t  void (*func)(ext2_filsys fs,\n\t\t\t\t\t\t\t       blk64_t blk,\n\t\t\t\t\t\t\t       int inuse),\n\t\t\t\t\t\t  void (**old)(ext2_filsys fs,\n\t\t\t\t\t\t\t       blk64_t blk,\n\t\t\t\t\t\t\t       int inuse));\n\n/* alloc_stats.c */\nvoid ext2fs_inode_alloc_stats(ext2_filsys fs, ext2_ino_t ino, int inuse);\nvoid ext2fs_inode_alloc_stats2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t       int inuse, int isdir);\nvoid ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse);\nvoid ext2fs_block_alloc_stats2(ext2_filsys fs, blk64_t blk, int inuse);\nvoid ext2fs_block_alloc_stats_range(ext2_filsys fs, blk64_t blk,\n\t\t\t\t    blk_t num, int inuse);\n\n/* alloc_tables.c */\nextern errcode_t ext2fs_allocate_tables(ext2_filsys fs);\nextern errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group,\n\t\t\t\t\t     ext2fs_block_bitmap bmap);\n\n/* badblocks.c */\nextern errcode_t ext2fs_u32_list_create(ext2_u32_list *ret, int size);\nextern errcode_t ext2fs_u32_list_add(ext2_u32_list bb, __u32 blk);\nextern int ext2fs_u32_list_find(ext2_u32_list bb, __u32 blk);\nextern int ext2fs_u32_list_test(ext2_u32_list bb, blk_t blk);\nextern errcode_t ext2fs_u32_list_iterate_begin(ext2_u32_list bb,\n\t\t\t\t\t       ext2_u32_iterate *ret);\nextern int ext2fs_u32_list_iterate(ext2_u32_iterate iter, blk_t *blk);\nextern void ext2fs_u32_list_iterate_end(ext2_u32_iterate iter);\nextern errcode_t ext2fs_u32_copy(ext2_u32_list src, ext2_u32_list *dest);\nextern int ext2fs_u32_list_equal(ext2_u32_list bb1, ext2_u32_list bb2);\n\nextern errcode_t ext2fs_badblocks_list_create(ext2_badblocks_list *ret,\n\t\t\t\t\t    int size);\nextern errcode_t ext2fs_badblocks_list_add(ext2_badblocks_list bb,\n\t\t\t\t\t   blk_t blk);\nextern int ext2fs_badblocks_list_test(ext2_badblocks_list bb,\n\t\t\t\t    blk_t blk);\nextern int ext2fs_u32_list_del(ext2_u32_list bb, __u32 blk);\nextern void ext2fs_badblocks_list_del(ext2_u32_list bb, __u32 blk);\nextern errcode_t\n\text2fs_badblocks_list_iterate_begin(ext2_badblocks_list bb,\n\t\t\t\t\t    ext2_badblocks_iterate *ret);\nextern int ext2fs_badblocks_list_iterate(ext2_badblocks_iterate iter,\n\t\t\t\t\t blk_t *blk);\nextern void ext2fs_badblocks_list_iterate_end(ext2_badblocks_iterate iter);\nextern errcode_t ext2fs_badblocks_copy(ext2_badblocks_list src,\n\t\t\t\t       ext2_badblocks_list *dest);\nextern int ext2fs_badblocks_equal(ext2_badblocks_list bb1,\n\t\t\t\t  ext2_badblocks_list bb2);\nextern int ext2fs_u32_list_count(ext2_u32_list bb);\n\n/* bb_compat */\nextern errcode_t badblocks_list_create(badblocks_list *ret, int size);\nextern errcode_t badblocks_list_add(badblocks_list bb, blk_t blk);\nextern int badblocks_list_test(badblocks_list bb, blk_t blk);\nextern errcode_t badblocks_list_iterate_begin(badblocks_list bb,\n\t\t\t\t\t      badblocks_iterate *ret);\nextern int badblocks_list_iterate(badblocks_iterate iter, blk_t *blk);\nextern void badblocks_list_iterate_end(badblocks_iterate iter);\nextern void badblocks_list_free(badblocks_list bb);\n\n/* bb_inode.c */\nextern errcode_t ext2fs_update_bb_inode(ext2_filsys fs,\n\t\t\t\t\text2_badblocks_list bb_list);\n\n/* bitmaps.c */\nextern void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap);\nextern void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap);\nextern errcode_t ext2fs_copy_bitmap(ext2fs_generic_bitmap src,\n\t\t\t\t    ext2fs_generic_bitmap *dest);\nextern errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs);\nextern errcode_t ext2fs_write_block_bitmap (ext2_filsys fs);\nextern errcode_t ext2fs_read_inode_bitmap (ext2_filsys fs);\nextern errcode_t ext2fs_read_block_bitmap(ext2_filsys fs);\nextern errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs,\n\t\t\t\t\t      const char *descr,\n\t\t\t\t\t      ext2fs_block_bitmap *ret);\nextern errcode_t ext2fs_allocate_subcluster_bitmap(ext2_filsys fs,\n\t\t\t\t\t\t   const char *descr,\n\t\t\t\t\t\t   ext2fs_block_bitmap *ret);\nextern int ext2fs_get_bitmap_granularity(ext2fs_block_bitmap bitmap);\nextern errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs,\n\t\t\t\t\t      const char *descr,\n\t\t\t\t\t      ext2fs_inode_bitmap *ret);\nextern errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t       ext2_ino_t end, ext2_ino_t *oend);\nextern errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t       blk_t end, blk_t *oend);\nextern errcode_t ext2fs_fudge_block_bitmap_end2(ext2fs_block_bitmap bitmap,\n\t\t\t\t\t blk64_t end, blk64_t *oend);\nextern void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap);\nextern void ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap);\nextern errcode_t ext2fs_read_bitmaps(ext2_filsys fs);\nextern errcode_t ext2fs_write_bitmaps(ext2_filsys fs);\nextern errcode_t ext2fs_resize_inode_bitmap(__u32 new_end, __u32 new_real_end,\n\t\t\t\t\t    ext2fs_inode_bitmap bmap);\nextern errcode_t ext2fs_resize_inode_bitmap2(__u64 new_end,\n\t\t\t\t\t     __u64 new_real_end,\n\t\t\t\t\t     ext2fs_inode_bitmap bmap);\nextern errcode_t ext2fs_resize_block_bitmap(__u32 new_end, __u32 new_real_end,\n\t\t\t\t\t    ext2fs_block_bitmap bmap);\nextern errcode_t ext2fs_resize_block_bitmap2(__u64 new_end,\n\t\t\t\t\t     __u64 new_real_end,\n\t\t\t\t\t     ext2fs_block_bitmap bmap);\nextern errcode_t ext2fs_compare_block_bitmap(ext2fs_block_bitmap bm1,\n\t\t\t\t\t     ext2fs_block_bitmap bm2);\nextern errcode_t ext2fs_compare_inode_bitmap(ext2fs_inode_bitmap bm1,\n\t\t\t\t\t     ext2fs_inode_bitmap bm2);\nextern errcode_t ext2fs_set_inode_bitmap_range(ext2fs_inode_bitmap bmap,\n\t\t\t\t\text2_ino_t start, unsigned int num,\n\t\t\t\t\tvoid *in);\nextern errcode_t ext2fs_set_inode_bitmap_range2(ext2fs_inode_bitmap bmap,\n\t\t\t\t\t __u64 start, size_t num,\n\t\t\t\t\t void *in);\nextern errcode_t ext2fs_get_inode_bitmap_range(ext2fs_inode_bitmap bmap,\n\t\t\t\t\text2_ino_t start, unsigned int num,\n\t\t\t\t\tvoid *out);\nextern errcode_t ext2fs_get_inode_bitmap_range2(ext2fs_inode_bitmap bmap,\n\t\t\t\t\t __u64 start, size_t num,\n\t\t\t\t\t void *out);\nextern errcode_t ext2fs_set_block_bitmap_range(ext2fs_block_bitmap bmap,\n\t\t\t\t\tblk_t start, unsigned int num,\n\t\t\t\t\tvoid *in);\nextern errcode_t ext2fs_set_block_bitmap_range2(ext2fs_block_bitmap bmap,\n\t\t\t\t\t blk64_t start, size_t num,\n\t\t\t\t\t void *in);\nextern errcode_t ext2fs_get_block_bitmap_range(ext2fs_block_bitmap bmap,\n\t\t\t\t\tblk_t start, unsigned int num,\n\t\t\t\t\tvoid *out);\nextern errcode_t ext2fs_get_block_bitmap_range2(ext2fs_block_bitmap bmap,\n\t\t\t\t\t blk64_t start, size_t num,\n\t\t\t\t\t void *out);\n\n/* blknum.c */\nextern __u32 ext2fs_inode_bitmap_checksum(ext2_filsys fs, dgrp_t group);\nextern __u32 ext2fs_block_bitmap_checksum(ext2_filsys fs, dgrp_t group);\nextern dgrp_t ext2fs_group_of_blk2(ext2_filsys fs, blk64_t);\nextern blk64_t ext2fs_group_first_block2(ext2_filsys fs, dgrp_t group);\nextern blk64_t ext2fs_group_last_block2(ext2_filsys fs, dgrp_t group);\nextern int ext2fs_group_blocks_count(ext2_filsys fs, dgrp_t group);\nextern blk64_t ext2fs_inode_data_blocks2(ext2_filsys fs,\n\t\t\t\t\t struct ext2_inode *inode);\nextern blk64_t ext2fs_inode_i_blocks(ext2_filsys fs,\n\t\t\t\t     struct ext2_inode *inode);\nextern blk64_t ext2fs_get_stat_i_blocks(ext2_filsys fs,\n\t\t\t\t\tstruct ext2_inode *inode);\nextern blk64_t ext2fs_blocks_count(struct ext2_super_block *super);\nextern void ext2fs_blocks_count_set(struct ext2_super_block *super,\n\t\t\t\t    blk64_t blk);\nextern void ext2fs_blocks_count_add(struct ext2_super_block *super,\n\t\t\t\t    blk64_t blk);\nextern blk64_t ext2fs_r_blocks_count(struct ext2_super_block *super);\nextern void ext2fs_r_blocks_count_set(struct ext2_super_block *super,\n\t\t\t\t      blk64_t blk);\nextern void ext2fs_r_blocks_count_add(struct ext2_super_block *super,\n\t\t\t\t      blk64_t blk);\nextern blk64_t ext2fs_free_blocks_count(struct ext2_super_block *super);\nextern void ext2fs_free_blocks_count_set(struct ext2_super_block *super,\n\t\t\t\t\t blk64_t blk);\nextern void ext2fs_free_blocks_count_add(struct ext2_super_block *super,\n\t\t\t\t\t blk64_t blk);\n/* Block group descriptor accessor functions */\nextern struct ext2_group_desc *ext2fs_group_desc(ext2_filsys fs,\n\t\t\t\t\t  struct opaque_ext2_group_desc *gdp,\n\t\t\t\t\t  dgrp_t group);\nextern blk64_t ext2fs_block_bitmap_csum(ext2_filsys fs, dgrp_t group);\nextern blk64_t ext2fs_block_bitmap_loc(ext2_filsys fs, dgrp_t group);\nextern void ext2fs_block_bitmap_loc_set(ext2_filsys fs, dgrp_t group,\n\t\t\t\t\tblk64_t blk);\nextern __u32 ext2fs_inode_bitmap_csum(ext2_filsys fs, dgrp_t group);\nextern blk64_t ext2fs_inode_bitmap_loc(ext2_filsys fs, dgrp_t group);\nextern void ext2fs_inode_bitmap_loc_set(ext2_filsys fs, dgrp_t group,\n\t\t\t\t\tblk64_t blk);\nextern blk64_t ext2fs_inode_table_loc(ext2_filsys fs, dgrp_t group);\nextern void ext2fs_inode_table_loc_set(ext2_filsys fs, dgrp_t group,\n\t\t\t\t       blk64_t blk);\nextern __u32 ext2fs_bg_free_blocks_count(ext2_filsys fs, dgrp_t group);\nextern void ext2fs_bg_free_blocks_count_set(ext2_filsys fs, dgrp_t group,\n\t\t\t\t\t __u32 n);\nextern __u32 ext2fs_bg_free_inodes_count(ext2_filsys fs, dgrp_t group);\nextern void ext2fs_bg_free_inodes_count_set(ext2_filsys fs, dgrp_t group,\n\t\t\t\t\t __u32 n);\nextern __u32 ext2fs_bg_used_dirs_count(ext2_filsys fs, dgrp_t group);\nextern void ext2fs_bg_used_dirs_count_set(ext2_filsys fs, dgrp_t group,\n\t\t\t\t       __u32 n);\nextern __u32 ext2fs_bg_itable_unused(ext2_filsys fs, dgrp_t group);\nextern void ext2fs_bg_itable_unused_set(ext2_filsys fs, dgrp_t group,\n\t\t\t\t     __u32 n);\nextern __u16 ext2fs_bg_flags(ext2_filsys fs, dgrp_t group);\nextern void ext2fs_bg_flags_zap(ext2_filsys fs, dgrp_t group);\nextern int ext2fs_bg_flags_test(ext2_filsys fs, dgrp_t group, __u16 bg_flag);\nextern void ext2fs_bg_flags_set(ext2_filsys fs, dgrp_t group, __u16 bg_flags);\nextern void ext2fs_bg_flags_clear(ext2_filsys fs, dgrp_t group, __u16 bg_flags);\nextern __u16 ext2fs_bg_checksum(ext2_filsys fs, dgrp_t group);\nextern void ext2fs_bg_checksum_set(ext2_filsys fs, dgrp_t group, __u16 checksum);\nextern blk64_t ext2fs_file_acl_block(ext2_filsys fs,\n\t\t\t\t     const struct ext2_inode *inode);\nextern void ext2fs_file_acl_block_set(ext2_filsys fs,\n\t\t\t\t      struct ext2_inode *inode, blk64_t blk);\nextern errcode_t ext2fs_inode_size_set(ext2_filsys fs, struct ext2_inode *inode,\n\t\t\t\t       ext2_off64_t size);\n\n/* block.c */\nextern errcode_t ext2fs_block_iterate(ext2_filsys fs,\n\t\t\t\t      ext2_ino_t\tino,\n\t\t\t\t      int\tflags,\n\t\t\t\t      char *block_buf,\n\t\t\t\t      int (*func)(ext2_filsys fs,\n\t\t\t\t\t\t  blk_t\t*blocknr,\n\t\t\t\t\t\t  int\tblockcnt,\n\t\t\t\t\t\t  void\t*priv_data),\n\t\t\t\t      void *priv_data);\nerrcode_t ext2fs_block_iterate2(ext2_filsys fs,\n\t\t\t\text2_ino_t\tino,\n\t\t\t\tint\tflags,\n\t\t\t\tchar *block_buf,\n\t\t\t\tint (*func)(ext2_filsys fs,\n\t\t\t\t\t    blk_t\t*blocknr,\n\t\t\t\t\t    e2_blkcnt_t\tblockcnt,\n\t\t\t\t\t    blk_t\tref_blk,\n\t\t\t\t\t    int\t\tref_offset,\n\t\t\t\t\t    void\t*priv_data),\n\t\t\t\tvoid *priv_data);\nerrcode_t ext2fs_block_iterate3(ext2_filsys fs,\n\t\t\t\text2_ino_t ino,\n\t\t\t\tint\tflags,\n\t\t\t\tchar *block_buf,\n\t\t\t\tint (*func)(ext2_filsys fs,\n\t\t\t\t\t    blk64_t\t*blocknr,\n\t\t\t\t\t    e2_blkcnt_t\tblockcnt,\n\t\t\t\t\t    blk64_t\tref_blk,\n\t\t\t\t\t    int\t\tref_offset,\n\t\t\t\t\t    void\t*priv_data),\n\t\t\t\tvoid *priv_data);\n\n/* bmap.c */\nextern errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t     struct ext2_inode *inode,\n\t\t\t     char *block_buf, int bmap_flags,\n\t\t\t     blk_t block, blk_t *phys_blk);\nextern errcode_t ext2fs_bmap2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t      struct ext2_inode *inode,\n\t\t\t      char *block_buf, int bmap_flags, blk64_t block,\n\t\t\t      int *ret_flags, blk64_t *phys_blk);\nerrcode_t ext2fs_map_cluster_block(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t   struct ext2_inode *inode, blk64_t lblk,\n\t\t\t\t   blk64_t *pblk);\n\n#if 0\n/* bmove.c */\nextern errcode_t ext2fs_move_blocks(ext2_filsys fs,\n\t\t\t\t    ext2fs_block_bitmap reserve,\n\t\t\t\t    ext2fs_block_bitmap alloc_map,\n\t\t\t\t    int flags);\n#endif\n\n/* check_desc.c */\nextern errcode_t ext2fs_check_desc(ext2_filsys fs);\n\n/* closefs.c */\nextern errcode_t ext2fs_close(ext2_filsys fs);\nextern errcode_t ext2fs_close2(ext2_filsys fs, int flags);\nextern errcode_t ext2fs_close_free(ext2_filsys *fs);\nextern errcode_t ext2fs_flush(ext2_filsys fs);\nextern errcode_t ext2fs_flush2(ext2_filsys fs, int flags);\nextern int ext2fs_bg_has_super(ext2_filsys fs, dgrp_t group_block);\nextern errcode_t ext2fs_super_and_bgd_loc2(ext2_filsys fs,\n\t\t\t\t    dgrp_t group,\n\t\t\t\t    blk64_t *ret_super_blk,\n\t\t\t\t    blk64_t *ret_old_desc_blk,\n\t\t\t\t    blk64_t *ret_new_desc_blk,\n\t\t\t\t    blk_t *ret_used_blks);\nextern int ext2fs_super_and_bgd_loc(ext2_filsys fs,\n\t\t\t\t    dgrp_t group,\n\t\t\t\t    blk_t *ret_super_blk,\n\t\t\t\t    blk_t *ret_old_desc_blk,\n\t\t\t\t    blk_t *ret_new_desc_blk,\n\t\t\t\t    int *ret_meta_bg);\nextern void ext2fs_update_dynamic_rev(ext2_filsys fs);\n\n/* crc32c.c */\nextern __u32 ext2fs_crc32_be(__u32 crc, unsigned char const *p, size_t len);\nextern __u32 ext2fs_crc32c_le(__u32 crc, unsigned char const *p, size_t len);\n\n/* csum.c */\nextern void ext2fs_init_csum_seed(ext2_filsys fs);\nextern errcode_t ext2fs_mmp_csum_set(ext2_filsys fs, struct mmp_struct *mmp);\nextern int ext2fs_mmp_csum_verify(ext2_filsys, struct mmp_struct *mmp);\nextern int ext2fs_verify_csum_type(ext2_filsys fs, struct ext2_super_block *sb);\nextern errcode_t ext2fs_superblock_csum_set(ext2_filsys fs,\n\t\t\t\t\t    struct ext2_super_block *sb);\nextern int ext2fs_superblock_csum_verify(ext2_filsys fs,\n\t\t\t\t\t struct ext2_super_block *sb);\nextern errcode_t ext2fs_ext_attr_block_csum_set(ext2_filsys fs,\n\t\t\t\t\text2_ino_t inum, blk64_t block,\n\t\t\t\t\tstruct ext2_ext_attr_header *hdr);\nextern int ext2fs_ext_attr_block_csum_verify(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t\t     blk64_t block,\n\t\t\t\t\t     struct ext2_ext_attr_header *hdr);\n#define EXT2_DIRENT_TAIL(block, blocksize) \\\n\t((struct ext2_dir_entry_tail *)(((char *)(block)) + \\\n\t(blocksize) - sizeof(struct ext2_dir_entry_tail)))\n\nextern void ext2fs_initialize_dirent_tail(ext2_filsys fs,\n\t\t\t\t\t  struct ext2_dir_entry_tail *t);\nextern int ext2fs_dirent_has_tail(ext2_filsys fs,\n\t\t\t\t  struct ext2_dir_entry *dirent);\nextern int ext2fs_dirent_csum_verify(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t     struct ext2_dir_entry *dirent);\nextern int ext2fs_dir_block_csum_verify(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t\tstruct ext2_dir_entry *dirent);\nextern errcode_t ext2fs_dir_block_csum_set(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t\t   struct ext2_dir_entry *dirent);\nextern errcode_t ext2fs_get_dx_countlimit(ext2_filsys fs,\n\t\t\t\t\t  struct ext2_dir_entry *dirent,\n\t\t\t\t\t  struct ext2_dx_countlimit **cc,\n\t\t\t\t\t  int *offset);\nextern errcode_t ext2fs_dx_csum(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\tstruct ext2_dir_entry *dirent,\n\t\t\t\t__u32 *crc, struct ext2_dx_tail **ret_t);\nextern errcode_t ext2fs_extent_block_csum_set(ext2_filsys fs,\n\t\t\t\t\t      ext2_ino_t inum,\n\t\t\t\t\t      struct ext3_extent_header *eh);\nextern int ext2fs_extent_block_csum_verify(ext2_filsys fs,\n\t\t\t\t\t   ext2_ino_t inum,\n\t\t\t\t\t   struct ext3_extent_header *eh);\nextern errcode_t ext2fs_block_bitmap_csum_set(ext2_filsys fs, dgrp_t group,\n\t\t\t\t\t      char *bitmap, int size);\nextern int ext2fs_block_bitmap_csum_verify(ext2_filsys fs, dgrp_t group,\n\t\t\t\t\t   char *bitmap, int size);\nextern errcode_t ext2fs_inode_bitmap_csum_set(ext2_filsys fs, dgrp_t group,\n\t\t\t\t\t      char *bitmap, int size);\nextern int ext2fs_inode_bitmap_csum_verify(ext2_filsys fs, dgrp_t group,\n\t\t\t\t\t   char *bitmap, int size);\nextern errcode_t ext2fs_inode_csum_set(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t       struct ext2_inode_large *inode);\nextern int ext2fs_inode_csum_verify(ext2_filsys fs, ext2_ino_t inum,\n\t\t\t\t    struct ext2_inode_large *inode);\nextern void ext2fs_group_desc_csum_set(ext2_filsys fs, dgrp_t group);\nextern int ext2fs_group_desc_csum_verify(ext2_filsys fs, dgrp_t group);\nextern errcode_t ext2fs_set_gdt_csum(ext2_filsys fs);\nextern __u16 ext2fs_group_desc_csum(ext2_filsys fs, dgrp_t group);\n\n/* dblist.c */\nextern errcode_t ext2fs_init_dblist(ext2_filsys fs, ext2_dblist *ret_dblist);\nextern errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ext2_ino_t ino,\n\t\t\t\t      blk_t blk, int blockcnt);\nextern errcode_t ext2fs_add_dir_block2(ext2_dblist dblist, ext2_ino_t ino,\n\t\t\t\t       blk64_t blk, e2_blkcnt_t blockcnt);\nextern void ext2fs_dblist_sort(ext2_dblist dblist,\n\t\t\t       EXT2_QSORT_TYPE (*sortfunc)(const void *,\n\t\t\t\t\t\t\t   const void *));\nextern void ext2fs_dblist_sort2(ext2_dblist dblist,\n\t\t\t\tEXT2_QSORT_TYPE (*sortfunc)(const void *,\n\t\t\t\t\t\t\t    const void *));\nextern errcode_t ext2fs_dblist_iterate(ext2_dblist dblist,\n\tint (*func)(ext2_filsys fs, struct ext2_db_entry *db_info,\n\t\t    void\t*priv_data),\n\tvoid *priv_data);\nextern errcode_t ext2fs_dblist_iterate2(ext2_dblist dblist,\n\tint (*func)(ext2_filsys fs, struct ext2_db_entry2 *db_info,\n\t\t    void\t*priv_data),\n\tvoid *priv_data);\nextern errcode_t ext2fs_dblist_iterate3(ext2_dblist dblist,\n\tint (*func)(ext2_filsys fs, struct ext2_db_entry2 *db_info,\n\t\t    void\t*priv_data),\n\tunsigned long long start,\n\tunsigned long long count,\n\tvoid *priv_data);\nextern errcode_t ext2fs_set_dir_block(ext2_dblist dblist, ext2_ino_t ino,\n\t\t\t\t      blk_t blk, int blockcnt);\nextern errcode_t ext2fs_set_dir_block2(ext2_dblist dblist, ext2_ino_t ino,\n\t\t\t\t       blk64_t blk, e2_blkcnt_t blockcnt);\nextern errcode_t ext2fs_copy_dblist(ext2_dblist src,\n\t\t\t\t    ext2_dblist *dest);\nextern int ext2fs_dblist_count(ext2_dblist dblist);\nextern blk64_t ext2fs_dblist_count2(ext2_dblist dblist);\nextern errcode_t ext2fs_dblist_get_last(ext2_dblist dblist,\n\t\t\t\t\tstruct ext2_db_entry **entry);\nextern errcode_t ext2fs_dblist_get_last2(ext2_dblist dblist,\n\t\t\t\t\tstruct ext2_db_entry2 **entry);\nextern errcode_t ext2fs_dblist_drop_last(ext2_dblist dblist);\n\n/* dblist_dir.c */\nextern errcode_t\n\text2fs_dblist_dir_iterate(ext2_dblist dblist,\n\t\t\t\t  int\tflags,\n\t\t\t\t  char\t*block_buf,\n\t\t\t\t  int (*func)(ext2_ino_t\tdir,\n\t\t\t\t\t      int\t\tentry,\n\t\t\t\t\t      struct ext2_dir_entry *dirent,\n\t\t\t\t\t      int\toffset,\n\t\t\t\t\t      int\tblocksize,\n\t\t\t\t\t      char\t*buf,\n\t\t\t\t\t      void\t*priv_data),\n\t\t\t\t  void *priv_data);\n\n#if 0\n/* digest_encode.c */\n#define EXT2FS_DIGEST_SIZE EXT2FS_SHA256_LENGTH\nextern int ext2fs_digest_encode(const char *src, int len, char *dst);\nextern int ext2fs_digest_decode(const char *src, int len, char *dst);\n#endif\n\n/* dirblock.c */\nextern errcode_t ext2fs_read_dir_block(ext2_filsys fs, blk_t block,\n\t\t\t\t       void *buf);\nextern errcode_t ext2fs_read_dir_block2(ext2_filsys fs, blk_t block,\n\t\t\t\t\tvoid *buf, int flags);\nextern errcode_t ext2fs_read_dir_block3(ext2_filsys fs, blk64_t block,\n\t\t\t\t\tvoid *buf, int flags);\nextern errcode_t ext2fs_read_dir_block4(ext2_filsys fs, blk64_t block,\n\t\t\t\t\tvoid *buf, int flags, ext2_ino_t ino);\nextern errcode_t ext2fs_write_dir_block(ext2_filsys fs, blk_t block,\n\t\t\t\t\tvoid *buf);\nextern errcode_t ext2fs_write_dir_block2(ext2_filsys fs, blk_t block,\n\t\t\t\t\t void *buf, int flags);\nextern errcode_t ext2fs_write_dir_block3(ext2_filsys fs, blk64_t block,\n\t\t\t\t\t void *buf, int flags);\nextern errcode_t ext2fs_write_dir_block4(ext2_filsys fs, blk64_t block,\n\t\t\t\t\t void *buf, int flags, ext2_ino_t ino);\n\n/* dirhash.c */\nextern errcode_t ext2fs_dirhash(int version, const char *name, int len,\n\t\t\t\tconst __u32 *seed,\n\t\t\t\text2_dirhash_t *ret_hash,\n\t\t\t\text2_dirhash_t *ret_minor_hash);\n\nextern errcode_t ext2fs_dirhash2(int version, const char *name, int len,\n\t\t\t\t const struct ext2fs_nls_table *charset,\n\t\t\t\t int hash_flags,\n\t\t\t\t const __u32 *seed,\n\t\t\t\t ext2_dirhash_t *ret_hash,\n\t\t\t\t ext2_dirhash_t *ret_minor_hash);\n\n/* dir_iterate.c */\nextern errcode_t ext2fs_get_rec_len(ext2_filsys fs,\n\t\t\t\t    struct ext2_dir_entry *dirent,\n\t\t\t\t    unsigned int *rec_len);\nextern errcode_t ext2fs_set_rec_len(ext2_filsys fs,\n\t\t\t\t    unsigned int len,\n\t\t\t\t    struct ext2_dir_entry *dirent);\nextern errcode_t ext2fs_dir_iterate(ext2_filsys fs,\n\t\t\t      ext2_ino_t dir,\n\t\t\t      int flags,\n\t\t\t      char *block_buf,\n\t\t\t      int (*func)(struct ext2_dir_entry *dirent,\n\t\t\t\t\t  int\toffset,\n\t\t\t\t\t  int\tblocksize,\n\t\t\t\t\t  char\t*buf,\n\t\t\t\t\t  void\t*priv_data),\n\t\t\t      void *priv_data);\nextern errcode_t ext2fs_dir_iterate2(ext2_filsys fs,\n\t\t\t      ext2_ino_t dir,\n\t\t\t      int flags,\n\t\t\t      char *block_buf,\n\t\t\t      int (*func)(ext2_ino_t\tdir,\n\t\t\t\t\t  int\tentry,\n\t\t\t\t\t  struct ext2_dir_entry *dirent,\n\t\t\t\t\t  int\toffset,\n\t\t\t\t\t  int\tblocksize,\n\t\t\t\t\t  char\t*buf,\n\t\t\t\t\t  void\t*priv_data),\n\t\t\t      void *priv_data);\n\n/* dupfs.c */\nextern errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest);\n\n/* expanddir.c */\nextern errcode_t ext2fs_expand_dir(ext2_filsys fs, ext2_ino_t dir);\n\n/* ext_attr.c */\nextern __u32 ext2fs_ext_attr_hash_entry(struct ext2_ext_attr_entry *entry,\n\t\t\t\t\tvoid *data);\nextern errcode_t ext2fs_ext_attr_hash_entry2(ext2_filsys fs,\n\t\t\t\t\t     struct ext2_ext_attr_entry *entry,\n\t\t\t\t\t     void *data, __u32 *hash);\nextern errcode_t ext2fs_read_ext_attr(ext2_filsys fs, blk_t block, void *buf);\nextern errcode_t ext2fs_read_ext_attr2(ext2_filsys fs, blk64_t block,\n\t\t\t\t       void *buf);\nextern errcode_t ext2fs_read_ext_attr3(ext2_filsys fs, blk64_t block,\n\t\t\t\t       void *buf, ext2_ino_t inum);\nextern errcode_t ext2fs_write_ext_attr(ext2_filsys fs, blk_t block,\n\t\t\t\t       void *buf);\nextern errcode_t ext2fs_write_ext_attr2(ext2_filsys fs, blk64_t block,\n\t\t\t\t       void *buf);\nextern errcode_t ext2fs_write_ext_attr3(ext2_filsys fs, blk64_t block,\n\t\t\t\t       void *buf, ext2_ino_t inum);\nextern errcode_t ext2fs_adjust_ea_refcount(ext2_filsys fs, blk_t blk,\n\t\t\t\t\t   char *block_buf,\n\t\t\t\t\t   int adjust, __u32 *newcount);\nextern errcode_t ext2fs_adjust_ea_refcount2(ext2_filsys fs, blk64_t blk,\n\t\t\t\t\t   char *block_buf,\n\t\t\t\t\t   int adjust, __u32 *newcount);\nextern errcode_t ext2fs_adjust_ea_refcount3(ext2_filsys fs, blk64_t blk,\n\t\t\t\t\t   char *block_buf,\n\t\t\t\t\t   int adjust, __u32 *newcount,\n\t\t\t\t\t   ext2_ino_t inum);\nerrcode_t ext2fs_xattrs_write(struct ext2_xattr_handle *handle);\nerrcode_t ext2fs_xattrs_read(struct ext2_xattr_handle *handle);\nerrcode_t ext2fs_xattrs_iterate(struct ext2_xattr_handle *h,\n\t\t\t\tint (*func)(char *name, char *value,\n\t\t\t\t\t    size_t value_len, void *data),\n\t\t\t\tvoid *data);\nerrcode_t ext2fs_xattr_get(struct ext2_xattr_handle *h, const char *key,\n\t\t\t   void **value, size_t *value_len);\nerrcode_t ext2fs_xattr_set(struct ext2_xattr_handle *handle,\n\t\t\t   const char *key,\n\t\t\t   const void *value,\n\t\t\t   size_t value_len);\nerrcode_t ext2fs_xattr_remove(struct ext2_xattr_handle *handle,\n\t\t\t      const char *key);\nerrcode_t ext2fs_xattrs_open(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t     struct ext2_xattr_handle **handle);\nerrcode_t ext2fs_xattrs_close(struct ext2_xattr_handle **handle);\nerrcode_t ext2fs_free_ext_attr(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t       struct ext2_inode_large *inode);\nerrcode_t ext2fs_xattrs_count(struct ext2_xattr_handle *handle, size_t *count);\nerrcode_t ext2fs_xattr_inode_max_size(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t      size_t *size);\n#define XATTR_HANDLE_FLAG_RAW\t0x0001\nerrcode_t ext2fs_xattrs_flags(struct ext2_xattr_handle *handle,\n\t\t\t      unsigned int *new_flags, unsigned int *old_flags);\nextern void ext2fs_ext_attr_block_rehash(struct ext2_ext_attr_header *header,\n\t\t\t\t\t struct ext2_ext_attr_entry *end);\nextern __u32 ext2fs_get_ea_inode_hash(struct ext2_inode *inode);\nextern void ext2fs_set_ea_inode_hash(struct ext2_inode *inode, __u32 hash);\nextern __u64 ext2fs_get_ea_inode_ref(struct ext2_inode *inode);\nextern void ext2fs_set_ea_inode_ref(struct ext2_inode *inode, __u64 ref_count);\n\n/* extent.c */\nextern errcode_t ext2fs_extent_header_verify(void *ptr, int size);\nextern errcode_t ext2fs_extent_open(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t    ext2_extent_handle_t *handle);\nextern errcode_t ext2fs_extent_open2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\tstruct ext2_inode *inode,\n\t\t\t\t\text2_extent_handle_t *ret_handle);\nextern void ext2fs_extent_free(ext2_extent_handle_t handle);\nextern errcode_t ext2fs_extent_get(ext2_extent_handle_t handle,\n\t\t\t\t   int flags, struct ext2fs_extent *extent);\nextern errcode_t ext2fs_extent_node_split(ext2_extent_handle_t handle);\nextern errcode_t ext2fs_extent_replace(ext2_extent_handle_t handle, int flags,\n\t\t\t\t       struct ext2fs_extent *extent);\nextern errcode_t ext2fs_extent_insert(ext2_extent_handle_t handle, int flags,\n\t\t\t\t      struct ext2fs_extent *extent);\nextern errcode_t ext2fs_extent_set_bmap(ext2_extent_handle_t handle,\n\t\t\t\t\tblk64_t logical, blk64_t physical,\n\t\t\t\t\tint flags);\nextern errcode_t ext2fs_extent_delete(ext2_extent_handle_t handle, int flags);\nextern errcode_t ext2fs_extent_get_info(ext2_extent_handle_t handle,\n\t\t\t\t\tstruct ext2_extent_info *info);\nextern errcode_t ext2fs_extent_goto(ext2_extent_handle_t handle,\n\t\t\t\t    blk64_t blk);\nextern errcode_t ext2fs_extent_goto2(ext2_extent_handle_t handle,\n\t\t\t\t     int leaf_level, blk64_t blk);\nextern errcode_t ext2fs_extent_fix_parents(ext2_extent_handle_t handle);\nextern size_t ext2fs_max_extent_depth(ext2_extent_handle_t handle);\nextern errcode_t ext2fs_fix_extents_checksums(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\t      struct ext2_inode *inode);\n\n/* fallocate.c */\n#define EXT2_FALLOCATE_ZERO_BLOCKS\t(0x1)\n#define EXT2_FALLOCATE_FORCE_INIT\t(0x2)\n#define EXT2_FALLOCATE_FORCE_UNINIT\t(0x4)\n#define EXT2_FALLOCATE_INIT_BEYOND_EOF\t(0x8)\n#define EXT2_FALLOCATE_ALL_FLAGS\t(0xF)\nerrcode_t ext2fs_fallocate(ext2_filsys fs, int flags, ext2_ino_t ino,\n\t\t\t   struct ext2_inode *inode, blk64_t goal,\n\t\t\t   blk64_t start, blk64_t len);\n\n/* fileio.c */\nextern errcode_t ext2fs_file_open2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t   struct ext2_inode *inode,\n\t\t\t\t   int flags, ext2_file_t *ret);\nextern errcode_t ext2fs_file_open(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t  int flags, ext2_file_t *ret);\nextern ext2_filsys ext2fs_file_get_fs(ext2_file_t file);\nstruct ext2_inode *ext2fs_file_get_inode(ext2_file_t file);\nextern ext2_ino_t ext2fs_file_get_inode_num(ext2_file_t file);\nextern errcode_t ext2fs_file_close(ext2_file_t file);\nextern errcode_t ext2fs_file_flush(ext2_file_t file);\nextern errcode_t ext2fs_file_read(ext2_file_t file, void *buf,\n\t\t\t\t  unsigned int wanted, unsigned int *got);\nextern errcode_t ext2fs_file_write(ext2_file_t file, const void *buf,\n\t\t\t\t   unsigned int nbytes, unsigned int *written);\nextern errcode_t ext2fs_file_llseek(ext2_file_t file, __u64 offset,\n\t\t\t\t   int whence, __u64 *ret_pos);\nextern errcode_t ext2fs_file_lseek(ext2_file_t file, ext2_off_t offset,\n\t\t\t\t   int whence, ext2_off_t *ret_pos);\nerrcode_t ext2fs_file_get_lsize(ext2_file_t file, __u64 *ret_size);\nextern ext2_off_t ext2fs_file_get_size(ext2_file_t file);\nextern errcode_t ext2fs_file_set_size(ext2_file_t file, ext2_off_t size);\nextern errcode_t ext2fs_file_set_size2(ext2_file_t file, ext2_off64_t size);\n\n/* finddev.c */\nextern char *ext2fs_find_block_device(dev_t device);\n\n/* flushb.c */\nextern errcode_t ext2fs_sync_device(int fd, int flushb);\n\n/* freefs.c */\nextern void ext2fs_free(ext2_filsys fs);\nextern void ext2fs_free_dblist(ext2_dblist dblist);\nextern void ext2fs_badblocks_list_free(ext2_badblocks_list bb);\nextern void ext2fs_u32_list_free(ext2_u32_list bb);\n\n/* gen_bitmap.c */\nextern void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap);\nextern errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs,\n\t\t\t\t\t    __u32 start, __u32 end,\n\t\t\t\t\t    __u32 real_end,\n\t\t\t\t\t    const char *descr, char *init_map,\n\t\t\t\t\t    ext2fs_generic_bitmap *ret);\nextern errcode_t ext2fs_allocate_generic_bitmap(__u32 start,\n\t\t\t\t\t\t__u32 end,\n\t\t\t\t\t\t__u32 real_end,\n\t\t\t\t\t\tconst char *descr,\n\t\t\t\t\t\text2fs_generic_bitmap *ret);\nextern errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap src,\n\t\t\t\t\t    ext2fs_generic_bitmap *dest);\nextern void ext2fs_clear_generic_bitmap(ext2fs_generic_bitmap bitmap);\nextern errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap bitmap,\n\t\t\t\t\t\t errcode_t magic,\n\t\t\t\t\t\t errcode_t neq,\n\t\t\t\t\t\t ext2_ino_t end,\n\t\t\t\t\t\t ext2_ino_t *oend);\nextern void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap map);\nextern errcode_t ext2fs_resize_generic_bitmap(errcode_t magic,\n\t\t\t\t\t      __u32 new_end,\n\t\t\t\t\t      __u32 new_real_end,\n\t\t\t\t\t      ext2fs_generic_bitmap bmap);\nextern errcode_t ext2fs_compare_generic_bitmap(errcode_t magic, errcode_t neq,\n\t\t\t\t\t       ext2fs_generic_bitmap bm1,\n\t\t\t\t\t       ext2fs_generic_bitmap bm2);\nextern errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap bmap,\n\t\t\t\t\t\t errcode_t magic,\n\t\t\t\t\t\t __u32 start, __u32 num,\n\t\t\t\t\t\t void *out);\nextern errcode_t ext2fs_set_generic_bitmap_range(ext2fs_generic_bitmap bmap,\n\t\t\t\t\t\t errcode_t magic,\n\t\t\t\t\t\t __u32 start, __u32 num,\n\t\t\t\t\t\t void *in);\nextern errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t\t       __u32 start, __u32 end,\n\t\t\t\t\t\t       __u32 *out);\nextern errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t\t       __u32 start, __u32 end,\n\t\t\t\t\t\t       __u32 *out);\n\n/* gen_bitmap64.c */\nvoid ext2fs_free_generic_bmap(ext2fs_generic_bitmap bmap);\nerrcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic,\n\t\t\t\t    int type, __u64 start, __u64 end,\n\t\t\t\t    __u64 real_end,\n\t\t\t\t    const char *descr,\n\t\t\t\t    ext2fs_generic_bitmap *ret);\nerrcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap src,\n\t\t\t\t   ext2fs_generic_bitmap *dest);\nvoid ext2fs_clear_generic_bmap(ext2fs_generic_bitmap bitmap);\nerrcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\terrcode_t neq,\n\t\t\t\t\t__u64 end, __u64 *oend);\nvoid ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap bmap);\nerrcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap bmap,\n\t\t\t\t     __u64 new_end,\n\t\t\t\t     __u64 new_real_end);\nerrcode_t ext2fs_compare_generic_bmap(errcode_t neq,\n\t\t\t\t      ext2fs_generic_bitmap bm1,\n\t\t\t\t      ext2fs_generic_bitmap bm2);\nerrcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap bmap,\n\t\t\t\t\t__u64 start, unsigned int num,\n\t\t\t\t\tvoid *out);\nerrcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap bmap,\n\t\t\t\t\t__u64 start, unsigned int num,\n\t\t\t\t\tvoid *in);\nerrcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs,\n\t\t\t\t\t   ext2fs_block_bitmap *bitmap);\nerrcode_t ext2fs_count_used_clusters(ext2_filsys fs, blk64_t start,\n\t\t\t\t     blk64_t end, blk64_t *out);\n\n/* get_num_dirs.c */\nextern errcode_t ext2fs_get_num_dirs(ext2_filsys fs, ext2_ino_t *ret_num_dirs);\n\n/* getsize.c */\nextern errcode_t ext2fs_get_device_size(const char *file, int blocksize,\n\t\t\t\t\tblk_t *retblocks);\nextern errcode_t ext2fs_get_device_size2(const char *file, int blocksize,\n\t\t\t\t\tblk64_t *retblocks);\n\n/* getsectsize.c */\nextern int ext2fs_get_dio_alignment(int fd);\nerrcode_t ext2fs_get_device_sectsize(const char *file, int *sectsize);\nerrcode_t ext2fs_get_device_phys_sectsize(const char *file, int *sectsize);\n\n/* i_block.c */\nerrcode_t ext2fs_iblk_add_blocks(ext2_filsys fs, struct ext2_inode *inode,\n\t\t\t\t blk64_t num_blocks);\nerrcode_t ext2fs_iblk_sub_blocks(ext2_filsys fs, struct ext2_inode *inode,\n\t\t\t\t blk64_t num_blocks);\nerrcode_t ext2fs_iblk_set(ext2_filsys fs, struct ext2_inode *inode, blk64_t b);\n\n/* imager.c */\nextern errcode_t ext2fs_image_inode_write(ext2_filsys fs, int fd, int flags);\nextern errcode_t ext2fs_image_inode_read(ext2_filsys fs, int fd, int flags);\nextern errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd, int flags);\nextern errcode_t ext2fs_image_super_read(ext2_filsys fs, int fd, int flags);\nextern errcode_t ext2fs_image_bitmap_write(ext2_filsys fs, int fd, int flags);\nextern errcode_t ext2fs_image_bitmap_read(ext2_filsys fs, int fd, int flags);\n\n/* ind_block.c */\nerrcode_t ext2fs_read_ind_block(ext2_filsys fs, blk_t blk, void *buf);\nerrcode_t ext2fs_write_ind_block(ext2_filsys fs, blk_t blk, void *buf);\n\n/* initialize.c */\nextern errcode_t ext2fs_initialize(const char *name, int flags,\n\t\t\t\t   struct ext2_super_block *param,\n\t\t\t\t   io_manager manager, ext2_filsys *ret_fs);\n\n/* icount.c */\nextern void ext2fs_free_icount(ext2_icount_t icount);\nextern errcode_t ext2fs_create_icount_tdb(ext2_filsys fs, char *tdb_dir,\n\t\t\t\t\t  int flags, ext2_icount_t *ret);\nextern errcode_t ext2fs_create_icount2(ext2_filsys fs, int flags,\n\t\t\t\t       unsigned int size,\n\t\t\t\t       ext2_icount_t hint, ext2_icount_t *ret);\nextern errcode_t ext2fs_create_icount(ext2_filsys fs, int flags,\n\t\t\t\t      unsigned int size,\n\t\t\t\t      ext2_icount_t *ret);\nextern errcode_t ext2fs_icount_fetch(ext2_icount_t icount, ext2_ino_t ino,\n\t\t\t\t     __u16 *ret);\nextern errcode_t ext2fs_icount_increment(ext2_icount_t icount, ext2_ino_t ino,\n\t\t\t\t\t __u16 *ret);\nextern errcode_t ext2fs_icount_decrement(ext2_icount_t icount, ext2_ino_t ino,\n\t\t\t\t\t __u16 *ret);\nextern errcode_t ext2fs_icount_store(ext2_icount_t icount, ext2_ino_t ino,\n\t\t\t\t     __u16 count);\nextern ext2_ino_t ext2fs_get_icount_size(ext2_icount_t icount);\nerrcode_t ext2fs_icount_validate(ext2_icount_t icount, FILE *);\n\n/* inline.c */\n\nextern errcode_t ext2fs_get_memalign(unsigned long size,\n\t\t\t\t     unsigned long align, void *ptr);\n\n/* inline_data.c */\nextern errcode_t ext2fs_inline_data_init(ext2_filsys fs, ext2_ino_t ino);\nextern errcode_t ext2fs_inline_data_size(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\t size_t *size);\nextern errcode_t ext2fs_inline_data_get(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\tstruct ext2_inode *inode,\n\t\t\t\t\tvoid *buf, size_t *size);\nextern errcode_t ext2fs_inline_data_set(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\tstruct ext2_inode *inode,\n\t\t\t\t\tvoid *buf, size_t size);\n\n/* inode.c */\nextern errcode_t ext2fs_create_inode_cache(ext2_filsys fs,\n\t\t\t\t\t   unsigned int cache_size);\nextern void ext2fs_free_inode_cache(struct ext2_inode_cache *icache);\nextern errcode_t ext2fs_flush_icache(ext2_filsys fs);\nextern errcode_t ext2fs_get_next_inode_full(ext2_inode_scan scan,\n\t\t\t\t\t    ext2_ino_t *ino,\n\t\t\t\t\t    struct ext2_inode *inode,\n\t\t\t\t\t    int bufsize);\n#define EXT2_INODE_SCAN_DEFAULT_BUFFER_BLOCKS\t8\nextern errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks,\n\t\t\t\t  ext2_inode_scan *ret_scan);\nextern void ext2fs_close_inode_scan(ext2_inode_scan scan);\nextern errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ext2_ino_t *ino,\n\t\t\t       struct ext2_inode *inode);\nextern errcode_t ext2fs_inode_scan_goto_blockgroup(ext2_inode_scan scan,\n\t\t\t\t\t\t   int\tgroup);\nextern void ext2fs_set_inode_callback\n\t(ext2_inode_scan scan,\n\t errcode_t (*done_group)(ext2_filsys fs,\n\t\t\t\t ext2_inode_scan scan,\n\t\t\t\t dgrp_t group,\n\t\t\t\t void * priv_data),\n\t void *done_group_data);\nextern int ext2fs_inode_scan_flags(ext2_inode_scan scan, int set_flags,\n\t\t\t\t   int clear_flags);\nextern errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\tstruct ext2_inode * inode,\n\t\t\t\t\tint bufsize);\nextern errcode_t ext2fs_read_inode(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t    struct ext2_inode * inode);\nextern errcode_t ext2fs_read_inode2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t    struct ext2_inode * inode,\n\t\t\t\t    int bufsize, int flags);\nextern errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\t struct ext2_inode * inode,\n\t\t\t\t\t int bufsize);\nextern errcode_t ext2fs_write_inode(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t    struct ext2_inode * inode);\nextern errcode_t ext2fs_write_inode2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t     struct ext2_inode * inode,\n\t\t\t\t     int bufsize, int flags);\nextern errcode_t ext2fs_write_new_inode(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t    struct ext2_inode * inode);\nextern errcode_t ext2fs_get_blocks(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks);\nextern errcode_t ext2fs_check_directory(ext2_filsys fs, ext2_ino_t ino);\n\n/* inode_io.c */\nextern io_manager inode_io_manager;\nextern errcode_t ext2fs_inode_io_intern(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\tchar **name);\nextern errcode_t ext2fs_inode_io_intern2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\t struct ext2_inode *inode,\n\t\t\t\t\t char **name);\n\n/* ismounted.c */\nextern errcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags);\nextern errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags,\n\t\t\t\t\t  char *mtpt, int mtlen);\n\n/* punch.c */\n/*\n * NOTE: This function removes from an inode the blocks \"start\", \"end\", and\n * every block in between.\n */\nextern errcode_t ext2fs_punch(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t      struct ext2_inode *inode,\n\t\t\t      char *block_buf, blk64_t start,\n\t\t\t      blk64_t end);\n\n/* namei.c */\nextern errcode_t ext2fs_lookup(ext2_filsys fs, ext2_ino_t dir, const char *name,\n\t\t\t int namelen, char *buf, ext2_ino_t *inode);\nextern errcode_t ext2fs_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,\n\t\t\tconst char *name, ext2_ino_t *inode);\nerrcode_t ext2fs_namei_follow(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,\n\t\t\t      const char *name, ext2_ino_t *inode);\nextern errcode_t ext2fs_follow_link(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,\n\t\t\text2_ino_t inode, ext2_ino_t *res_inode);\n\n/* native.c */\nint ext2fs_native_flag(void);\n\n/* newdir.c */\nextern errcode_t ext2fs_new_dir_block(ext2_filsys fs, ext2_ino_t dir_ino,\n\t\t\t\text2_ino_t parent_ino, char **block);\nextern errcode_t ext2fs_new_dir_inline_data(ext2_filsys fs, ext2_ino_t dir_ino,\n\t\t\t\text2_ino_t parent_ino, __u32 *iblock);\n\n/* nls_utf8.c */\nextern const struct ext2fs_nls_table *ext2fs_load_nls_table(int encoding);\n\n/* mkdir.c */\nextern errcode_t ext2fs_mkdir(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t inum,\n\t\t\t      const char *name);\n\n/* mkjournal.c */\nextern errcode_t ext2fs_zero_blocks(ext2_filsys fs, blk_t blk, int num,\n\t\t\t\t    blk_t *ret_blk, int *ret_count);\nextern errcode_t ext2fs_zero_blocks2(ext2_filsys fs, blk64_t blk, int num,\n\t\t\t\t     blk64_t *ret_blk, int *ret_count);\nextern errcode_t ext2fs_create_journal_superblock(ext2_filsys fs,\n\t\t\t\t\t\t  __u32 num_blocks, int flags,\n\t\t\t\t\t\t  char  **ret_jsb);\nextern errcode_t ext2fs_add_journal_device(ext2_filsys fs,\n\t\t\t\t\t   ext2_filsys journal_dev);\nextern errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t num_blocks,\n\t\t\t\t\t  int flags);\nextern errcode_t ext2fs_add_journal_inode2(ext2_filsys fs, blk_t num_blocks,\n\t\t\t\t\t   blk64_t goal, int flags);\nextern int ext2fs_default_journal_size(__u64 num_blocks);\nextern int ext2fs_journal_sb_start(int blocksize);\n\n/* openfs.c */\nextern errcode_t ext2fs_open(const char *name, int flags, int superblock,\n\t\t\t     unsigned int block_size, io_manager manager,\n\t\t\t     ext2_filsys *ret_fs);\nextern errcode_t ext2fs_open2(const char *name, const char *io_options,\n\t\t\t      int flags, int superblock,\n\t\t\t      unsigned int block_size, io_manager manager,\n\t\t\t      ext2_filsys *ret_fs);\n/*\n * The dgrp_t argument to these two functions is not actually a group number\n * but a block number offset within a group table!  Convert with the formula\n * (group_number / groups_per_block).\n */\nextern blk64_t ext2fs_descriptor_block_loc2(ext2_filsys fs,\n\t\t\t\t\tblk64_t group_block, dgrp_t i);\nextern blk_t ext2fs_descriptor_block_loc(ext2_filsys fs, blk_t group_block,\n\t\t\t\t\t dgrp_t i);\nerrcode_t ext2fs_get_data_io(ext2_filsys fs, io_channel *old_io);\nerrcode_t ext2fs_set_data_io(ext2_filsys fs, io_channel new_io);\nerrcode_t ext2fs_rewrite_to_io(ext2_filsys fs, io_channel new_io);\n\n/* get_pathname.c */\nextern errcode_t ext2fs_get_pathname(ext2_filsys fs, ext2_ino_t dir, ext2_ino_t ino,\n\t\t\t       char **name);\n\n/* link.c */\nerrcode_t ext2fs_link(ext2_filsys fs, ext2_ino_t dir, const char *name,\n\t\t      ext2_ino_t ino, int flags);\nerrcode_t ext2fs_unlink(ext2_filsys fs, ext2_ino_t dir, const char *name,\n\t\t\text2_ino_t ino, int flags);\n\n/* symlink.c */\nerrcode_t ext2fs_symlink(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t ino,\n\t\t\t const char *name, const char *target);\nint ext2fs_is_fast_symlink(struct ext2_inode *inode);\n\n/* mmp.c */\nerrcode_t ext2fs_mmp_read(ext2_filsys fs, blk64_t mmp_blk, void *buf);\nerrcode_t ext2fs_mmp_write(ext2_filsys fs, blk64_t mmp_blk, void *buf);\nerrcode_t ext2fs_mmp_clear(ext2_filsys fs);\nerrcode_t ext2fs_mmp_init(ext2_filsys fs);\nerrcode_t ext2fs_mmp_start(ext2_filsys fs);\nerrcode_t ext2fs_mmp_update(ext2_filsys fs);\nerrcode_t ext2fs_mmp_update2(ext2_filsys fs, int immediately);\nerrcode_t ext2fs_mmp_stop(ext2_filsys fs);\nunsigned ext2fs_mmp_new_seq(void);\n\n/* read_bb.c */\nextern errcode_t ext2fs_read_bb_inode(ext2_filsys fs,\n\t\t\t\t      ext2_badblocks_list *bb_list);\n\n/* read_bb_file.c */\nextern errcode_t ext2fs_read_bb_FILE2(ext2_filsys fs, FILE *f,\n\t\t\t\t      ext2_badblocks_list *bb_list,\n\t\t\t\t      void *priv_data,\n\t\t\t\t      void (*invalid)(ext2_filsys fs,\n\t\t\t\t\t\t      blk_t blk,\n\t\t\t\t\t\t      char *badstr,\n\t\t\t\t\t\t      void *priv_data));\nextern errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f,\n\t\t\t\t     ext2_badblocks_list *bb_list,\n\t\t\t\t     void (*invalid)(ext2_filsys fs,\n\t\t\t\t\t\t     blk_t blk));\n\n/* res_gdt.c */\nextern errcode_t ext2fs_create_resize_inode(ext2_filsys fs);\n\n/*sha256.c */\n#define EXT2FS_SHA256_LENGTH 32\n#if 0\nextern void ext2fs_sha256(const unsigned char *in, unsigned long in_size,\n\t\t   unsigned char out[EXT2FS_SHA256_LENGTH]);\n#endif\n\n/* sha512.c */\n#define EXT2FS_SHA512_LENGTH 64\nextern void ext2fs_sha512(const unsigned char *in, unsigned long in_size,\n\t\t\t  unsigned char out[EXT2FS_SHA512_LENGTH]);\n\n/* swapfs.c */\nextern errcode_t ext2fs_dirent_swab_in2(ext2_filsys fs, char *buf, size_t size,\n\t\t\t\t\tint flags);\nextern errcode_t ext2fs_dirent_swab_in(ext2_filsys fs, char *buf, int flags);\nextern errcode_t ext2fs_dirent_swab_out2(ext2_filsys fs, char *buf, size_t size,\n\t\t\t\t\t int flags);\nextern errcode_t ext2fs_dirent_swab_out(ext2_filsys fs, char *buf, int flags);\nextern void ext2fs_swap_ext_attr(char *to, char *from, int bufsize,\n\t\t\t\t int has_header);\nextern void ext2fs_swap_ext_attr_header(struct ext2_ext_attr_header *to_header,\n\t\t\t\t\tstruct ext2_ext_attr_header *from_hdr);\nextern void ext2fs_swap_ext_attr_entry(struct ext2_ext_attr_entry *to_entry,\n\t\t\t\t       struct ext2_ext_attr_entry *from_entry);\nextern void ext2fs_swap_super(struct ext2_super_block * super);\nextern void ext2fs_swap_group_desc(struct ext2_group_desc *gdp);\nextern void ext2fs_swap_group_desc2(ext2_filsys, struct ext2_group_desc *gdp);\nextern void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t,\n\t\t\t\t   struct ext2_inode_large *f, int hostorder,\n\t\t\t\t   int bufsize);\nextern void ext2fs_swap_inode(ext2_filsys fs,struct ext2_inode *t,\n\t\t\t      struct ext2_inode *f, int hostorder);\nextern void ext2fs_swap_mmp(struct mmp_struct *mmp);\n\n/* unix_io.c */\nextern int ext2fs_open_file(const char *pathname, int flags, mode_t mode);\nextern int ext2fs_stat(const char *path, ext2fs_struct_stat *buf);\nextern int ext2fs_fstat(int fd, ext2fs_struct_stat *buf);\n\n/* valid_blk.c */\nextern int ext2fs_inode_has_valid_blocks(struct ext2_inode *inode);\nextern int ext2fs_inode_has_valid_blocks2(ext2_filsys fs,\n\t\t\t\t\t  struct ext2_inode *inode);\n\n/* version.c */\nextern int ext2fs_parse_version_string(const char *ver_string);\nextern int ext2fs_get_library_version(const char **ver_string,\n\t\t\t\t      const char **date_string);\n\n/* write_bb_file.c */\nextern errcode_t ext2fs_write_bb_FILE(ext2_badblocks_list bb_list,\n\t\t\t\t      unsigned int flags,\n\t\t\t\t      FILE *f);\n\n/* Rufus addtional */\nextern errcode_t ext2fs_print_progress(int64_t cur, int64_t max);\n\n/* inline functions */\n#ifdef NO_INLINE_FUNCS\nextern errcode_t ext2fs_get_mem(unsigned long size, void *ptr);\nextern errcode_t ext2fs_get_memzero(unsigned long size, void *ptr);\nextern errcode_t ext2fs_get_array(unsigned long count,\n\t\t\t\t  unsigned long size, void *ptr);\nextern errcode_t ext2fs_get_arrayzero(unsigned long count,\n\t\t\t\t      unsigned long size, void *ptr);\nextern errcode_t ext2fs_free_mem(void *ptr);\nextern errcode_t ext2fs_resize_mem(unsigned long old_size,\n\t\t\t\t   unsigned long size, void *ptr);\nextern errcode_t ext2fs_resize_array(unsigned long old_count, unsigned long count,\n\t\t\t\t     unsigned long size, void *ptr);\nextern void ext2fs_mark_super_dirty(ext2_filsys fs);\nextern void ext2fs_mark_changed(ext2_filsys fs);\nextern int ext2fs_test_changed(ext2_filsys fs);\nextern void ext2fs_mark_valid(ext2_filsys fs);\nextern void ext2fs_unmark_valid(ext2_filsys fs);\nextern int ext2fs_test_valid(ext2_filsys fs);\nextern void ext2fs_mark_ib_dirty(ext2_filsys fs);\nextern void ext2fs_mark_bb_dirty(ext2_filsys fs);\nextern int ext2fs_test_ib_dirty(ext2_filsys fs);\nextern int ext2fs_test_bb_dirty(ext2_filsys fs);\nextern dgrp_t ext2fs_group_of_blk(ext2_filsys fs, blk_t blk);\nextern dgrp_t ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino);\nextern blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group);\nextern blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group);\nextern blk_t ext2fs_inode_data_blocks(ext2_filsys fs,\n\t\t\t\t      struct ext2_inode *inode);\nextern int ext2fs_htree_intnode_maxrecs(ext2_filsys fs, int blocks);\nextern unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b);\nextern __u64 ext2fs_div64_ceil(__u64 a, __u64 b);\nextern int ext2fs_dirent_name_len(const struct ext2_dir_entry *entry);\nextern void ext2fs_dirent_set_name_len(struct ext2_dir_entry *entry, int len);\nextern int ext2fs_dirent_file_type(const struct ext2_dir_entry *entry);\nextern void ext2fs_dirent_set_file_type(struct ext2_dir_entry *entry, int type);\nextern struct ext2_inode *ext2fs_inode(struct ext2_inode_large * large_inode);\nextern const struct ext2_inode *ext2fs_const_inode(const struct ext2_inode_large * large_inode);\n\n#endif\n\n/*\n * The actual inlined functions definitions themselves...\n *\n * If NO_INLINE_FUNCS is defined, then we won't try to do inline\n * functions at all!\n */\n#if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))\n#ifdef INCLUDE_INLINE_FUNCS\n#ifdef _MSC_VER\n#define _INLINE_ __inline\n#else\n#define _INLINE_ extern\n#endif\n#else\n#if (__STDC_VERSION__ >= 199901L)\n#define _INLINE_ inline\n#else\n#ifdef __GNUC__\n#define _INLINE_ extern __inline__\n#elif defined(_MSC_VER)\n#define _INLINE_ extern __inline\n#else\t\t\t\t/* For Watcom C */\n#define _INLINE_ extern inline\n#endif /* __GNUC__ */\n#endif /* __STDC_VERSION__ >= 199901L */\n#endif\n\n#ifndef EXT2_CUSTOM_MEMORY_ROUTINES\n#include <string.h>\n/*\n *  Allocate memory.  The 'ptr' arg must point to a pointer.\n */\n_INLINE_ errcode_t ext2fs_get_mem(unsigned long size, void *ptr)\n{\n\tvoid *pp;\n\n\tpp = malloc(size);\n\tif (!pp)\n\t\treturn EXT2_ET_NO_MEMORY;\n\tmemcpy(ptr, &pp, sizeof (pp));\n\treturn 0;\n}\n\n_INLINE_ errcode_t ext2fs_get_memzero(unsigned long size, void *ptr)\n{\n\tvoid *pp;\n\n\tpp = malloc(size);\n\tif (!pp)\n\t\treturn EXT2_ET_NO_MEMORY;\n\tmemset(pp, 0, size);\n\tmemcpy(ptr, &pp, sizeof(pp));\n\treturn 0;\n}\n\n_INLINE_ errcode_t ext2fs_get_array(unsigned long count, unsigned long size,\n\t\t\t\t    void *ptr)\n{\n\tif (count && (~0UL)/count < size)\n\t\treturn EXT2_ET_NO_MEMORY;\n\treturn ext2fs_get_mem(count*size, ptr);\n}\n\n_INLINE_ errcode_t ext2fs_get_arrayzero(unsigned long count,\n\t\t\t\t\tunsigned long size, void *ptr)\n{\n\tvoid *pp;\n\n\tif (count && (~0UL)/count < size)\n\t\treturn EXT2_ET_NO_MEMORY;\n\tpp = calloc(count, size);\n\tif (!pp)\n\t\treturn EXT2_ET_NO_MEMORY;\n\tmemcpy(ptr, &pp, sizeof(pp));\n\treturn 0;\n}\n\n/*\n * Free memory.  The 'ptr' arg must point to a pointer.\n */\n_INLINE_ errcode_t ext2fs_free_mem(void *ptr)\n{\n\tvoid *p;\n\n\tmemcpy(&p, ptr, sizeof(p));\n\tfree(p);\n\tp = 0;\n\tmemcpy(ptr, &p, sizeof(p));\n\treturn 0;\n}\n\n/*\n *  Resize memory.  The 'ptr' arg must point to a pointer.\n */\n_INLINE_ errcode_t ext2fs_resize_mem(unsigned long EXT2FS_ATTR((unused)) old_size,\n\t\t\t\t     unsigned long size, void *ptr)\n{\n\tvoid *p, *old_p;\n\n\t/* Use \"memcpy\" for pointer assignments here to avoid problems\n\t * with C99 strict type aliasing rules. */\n\tmemcpy(&p, ptr, sizeof(p));\n\told_p = p;\n\tp = realloc(p, size);\n\tif (!p) {\n\t\tfree(old_p);\n\t\treturn EXT2_ET_NO_MEMORY;\n\t}\n\tmemcpy(ptr, &p, sizeof(p));\n\treturn 0;\n}\n\n/*\n *  Resize array.  The 'ptr' arg must point to a pointer.\n */\n_INLINE_ errcode_t ext2fs_resize_array(unsigned long size,\n\t\t\t\t       unsigned long old_count,\n\t\t\t\t       unsigned long count, void *ptr)\n{\n\tunsigned long old_size;\n\terrcode_t retval;\n\n\tif (count && (~0UL)/count < size)\n\t\treturn EXT2_ET_NO_MEMORY;\n\n\tsize *= count;\n\told_size = size * old_count;\n\tretval = ext2fs_resize_mem(old_size, size, ptr);\n\tif (retval)\n\t\treturn retval;\n\n\tif (size > old_size) {\n\t\tvoid *p;\n\n\t\tmemcpy(&p, ptr, sizeof(p));\n\t\tmemset((char *)p + old_size, 0, size - old_size);\n\t\tmemcpy(ptr, &p, sizeof(p));\n\t}\n\n\treturn 0;\n}\n#endif\t/* Custom memory routines */\n\n/*\n * Mark a filesystem superblock as dirty\n */\n_INLINE_ void ext2fs_mark_super_dirty(ext2_filsys fs)\n{\n\tfs->flags |= EXT2_FLAG_DIRTY | EXT2_FLAG_CHANGED;\n}\n\n/*\n * Mark a filesystem as changed\n */\n_INLINE_ void ext2fs_mark_changed(ext2_filsys fs)\n{\n\tfs->flags |= EXT2_FLAG_CHANGED;\n}\n\n/*\n * Check to see if a filesystem has changed\n */\n_INLINE_ int ext2fs_test_changed(ext2_filsys fs)\n{\n\treturn (fs->flags & EXT2_FLAG_CHANGED);\n}\n\n/*\n * Mark a filesystem as valid\n */\n_INLINE_ void ext2fs_mark_valid(ext2_filsys fs)\n{\n\tfs->flags |= EXT2_FLAG_VALID;\n}\n\n/*\n * Mark a filesystem as NOT valid\n */\n_INLINE_ void ext2fs_unmark_valid(ext2_filsys fs)\n{\n\tfs->flags &= ~EXT2_FLAG_VALID;\n}\n\n/*\n * Check to see if a filesystem is valid\n */\n_INLINE_ int ext2fs_test_valid(ext2_filsys fs)\n{\n\treturn (fs->flags & EXT2_FLAG_VALID);\n}\n\n/*\n * Mark the inode bitmap as dirty\n */\n_INLINE_ void ext2fs_mark_ib_dirty(ext2_filsys fs)\n{\n\tfs->flags |= EXT2_FLAG_IB_DIRTY | EXT2_FLAG_CHANGED;\n}\n\n/*\n * Mark the block bitmap as dirty\n */\n_INLINE_ void ext2fs_mark_bb_dirty(ext2_filsys fs)\n{\n\tfs->flags |= EXT2_FLAG_BB_DIRTY | EXT2_FLAG_CHANGED;\n}\n\n/*\n * Check to see if a filesystem's inode bitmap is dirty\n */\n_INLINE_ int ext2fs_test_ib_dirty(ext2_filsys fs)\n{\n\treturn (fs->flags & EXT2_FLAG_IB_DIRTY);\n}\n\n/*\n * Check to see if a filesystem's block bitmap is dirty\n */\n_INLINE_ int ext2fs_test_bb_dirty(ext2_filsys fs)\n{\n\treturn (fs->flags & EXT2_FLAG_BB_DIRTY);\n}\n\n/*\n * Return the group # of a block\n */\n_INLINE_ dgrp_t ext2fs_group_of_blk(ext2_filsys fs, blk_t blk)\n{\n\treturn ext2fs_group_of_blk2(fs, blk);\n}\n/*\n * Return the group # of an inode number\n */\n_INLINE_ dgrp_t ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino)\n{\n\treturn (ino - 1) / fs->super->s_inodes_per_group;\n}\n\n/*\n * Return the first block (inclusive) in a group\n */\n_INLINE_ blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group)\n{\n\treturn (blk_t) ext2fs_group_first_block2(fs, group);\n}\n\n/*\n * Return the last block (inclusive) in a group\n */\n_INLINE_ blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group)\n{\n\treturn (blk_t) ext2fs_group_last_block2(fs, group);\n}\n\n_INLINE_ blk_t ext2fs_inode_data_blocks(ext2_filsys fs,\n\t\t\t\t\tstruct ext2_inode *inode)\n{\n\treturn (blk_t) ext2fs_inode_data_blocks2(fs, inode);\n}\n\n_INLINE_ int ext2fs_htree_intnode_maxrecs(ext2_filsys fs, int blocks)\n{\n\tint csum_size = 0;\n\n\tif ((EXT2_SB(fs->super)->s_feature_ro_compat &\n\t     EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) != 0)\n\t\tcsum_size = sizeof(struct ext2_dx_tail);\n\treturn blocks * ((fs->blocksize - (8 + csum_size)) /\n\t\t\t\t\t\tsizeof(struct ext2_dx_entry));\n}\n\n/*\n * This is an efficient, overflow safe way of calculating ceil((1.0 * a) / b)\n */\n_INLINE_ unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b)\n{\n\tif (!a)\n\t\treturn 0;\n\treturn ((a - 1) / b) + 1;\n}\n\n_INLINE_ __u64 ext2fs_div64_ceil(__u64 a, __u64 b)\n{\n\tif (!a)\n\t\treturn 0;\n\treturn ((a - 1) / b) + 1;\n}\n\n_INLINE_ int ext2fs_dirent_name_len(const struct ext2_dir_entry *entry)\n{\n\treturn entry->name_len & 0xff;\n}\n\n_INLINE_ void ext2fs_dirent_set_name_len(struct ext2_dir_entry *entry, int len)\n{\n\tentry->name_len = (entry->name_len & 0xff00) | (len & 0xff);\n}\n\n_INLINE_ int ext2fs_dirent_file_type(const struct ext2_dir_entry *entry)\n{\n\treturn entry->name_len >> 8;\n}\n\n_INLINE_ void ext2fs_dirent_set_file_type(struct ext2_dir_entry *entry, int type)\n{\n\tentry->name_len = (entry->name_len & 0xff) | (type << 8);\n}\n\n_INLINE_ struct ext2_inode *ext2fs_inode(struct ext2_inode_large * large_inode)\n{\n\t/* It is always safe to convert large inode to a small inode */\n\treturn (struct ext2_inode *) large_inode;\n}\n\n_INLINE_ const struct ext2_inode *\next2fs_const_inode(const struct ext2_inode_large * large_inode)\n{\n\t/* It is always safe to convert large inode to a small inode */\n\treturn (const struct ext2_inode *) large_inode;\n}\n\n#undef _INLINE_\n#endif\n\n/* htree levels for ext4 */\n#define EXT4_HTREE_LEVEL_COMPAT 2\n#define EXT4_HTREE_LEVEL\t3\n\nstatic inline unsigned int ext2_dir_htree_level(ext2_filsys fs)\n{\n\tif (ext2fs_has_feature_largedir(fs->super))\n\t\treturn EXT4_HTREE_LEVEL;\n\n\treturn EXT4_HTREE_LEVEL_COMPAT;\n}\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* _EXT2FS_EXT2FS_H */\n"
  },
  {
    "path": "src/ext2fs/ext2fsP.h",
    "content": "/*\n * ext2fsP.h --- private header file for ext2 library\n *\n * Copyright (C) 1997 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n\n#include \"ext2fs.h\"\n\n#define EXT2FS_MAX_NESTED_LINKS  8\n\nstatic inline int ext2fsP_is_disk_device(mode_t mode)\n{\n#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)\n\treturn S_ISBLK(mode) || S_ISCHR(mode);\n#else\n\treturn S_ISBLK(mode);\n#endif\n}\n\n/*\n * Badblocks list\n */\nstruct ext2_struct_u32_list {\n\tint\tmagic;\n\tint\tnum;\n\tint\tsize;\n\t__u32\t*list;\n\tint\tbadblocks_flags;\n};\n\nstruct ext2_struct_u32_iterate {\n\tint\t\t\tmagic;\n\text2_u32_list\t\tbb;\n\tint\t\t\tptr;\n};\n\n\n/*\n * Directory block iterator definition\n */\nstruct ext2_struct_dblist {\n\tint\t\t\tmagic;\n\text2_filsys\t\tfs;\n\tunsigned long long\tsize;\n\tunsigned long long\tcount;\n\tint\t\t\tsorted;\n\tstruct ext2_db_entry2 *\tlist;\n};\n\n/*\n * For directory iterators\n */\nstruct dir_context {\n\text2_ino_t\t\tdir;\n\tint\t\tflags;\n\tchar\t\t*buf;\n\tunsigned int\tbuflen;\n\tint (*func)(ext2_ino_t\tdir,\n\t\t    int\tentry,\n\t\t    struct ext2_dir_entry *dirent,\n\t\t    int\toffset,\n\t\t    int\tblocksize,\n\t\t    char\t*buf,\n\t\t    void\t*priv_data);\n\tvoid\t\t*priv_data;\n\terrcode_t\terrcode;\n};\n\n/*\n * Inode cache structure\n */\nstruct ext2_inode_cache {\n\tvoid *\t\t\t\tbuffer;\n\tblk64_t\t\t\t\tbuffer_blk;\n\tint\t\t\t\tcache_last;\n\tunsigned int\t\t\tcache_size;\n\tint\t\t\t\trefcount;\n\tstruct ext2_inode_cache_ent\t*cache;\n};\n\nstruct ext2_inode_cache_ent {\n\text2_ino_t\t\tino;\n\tstruct ext2_inode\t*inode;\n};\n\n/*\n * NLS defintions\n */\nstruct ext2fs_nls_table {\n\tint version;\n\tconst struct ext2fs_nls_ops *ops;\n};\n\nstruct ext2fs_nls_ops {\n\tint (*casefold)(const struct ext2fs_nls_table *charset,\n\t\t\tconst unsigned char *str, size_t len,\n\t\t\tunsigned char *dest, size_t dlen);\n};\n\n/* Function prototypes */\n\nextern int ext2fs_process_dir_block(ext2_filsys  \tfs,\n\t\t\t\t    blk64_t\t\t*blocknr,\n\t\t\t\t    e2_blkcnt_t\t\tblockcnt,\n\t\t\t\t    blk64_t\t\tref_block,\n\t\t\t\t    int\t\t\tref_offset,\n\t\t\t\t    void\t\t*priv_data);\n\nextern errcode_t ext2fs_inline_data_ea_remove(ext2_filsys fs, ext2_ino_t ino);\nextern errcode_t ext2fs_inline_data_expand(ext2_filsys fs, ext2_ino_t ino);\nextern int ext2fs_inline_data_dir_iterate(ext2_filsys fs,\n\t\t\t\t\t  ext2_ino_t ino,\n\t\t\t\t\t  void *priv_data);\n\n/* Generic numeric progress meter */\n\nstruct ext2fs_numeric_progress_struct {\n\t__u64\t\tmax;\n\tint\t\tlog_max;\n\tint\t\tskip_progress;\n};\n\n/*\n * progress callback functions\n */\nstruct ext2fs_progress_ops {\n\tvoid (*init)(ext2_filsys fs,\n\t\t     struct ext2fs_numeric_progress_struct * progress,\n\t\t     const char *label, __u64 max);\n\tvoid (*update)(ext2_filsys fs,\n\t\t       struct ext2fs_numeric_progress_struct * progress,\n\t\t       __u64 val);\n\tvoid (*close)(ext2_filsys fs,\n\t\t      struct ext2fs_numeric_progress_struct * progress,\n\t\t      const char *message);\n};\n\nextern struct ext2fs_progress_ops ext2fs_numeric_progress_ops;\n\nextern void ext2fs_numeric_progress_init(ext2_filsys fs,\n\t\t\t\t\t struct ext2fs_numeric_progress_struct * progress,\n\t\t\t\t\t const char *label, __u64 max);\nextern void ext2fs_numeric_progress_update(ext2_filsys fs,\n\t\t\t\t\t   struct ext2fs_numeric_progress_struct * progress,\n\t\t\t\t\t   __u64 val);\nextern void ext2fs_numeric_progress_close(ext2_filsys fs,\n\t\t\t\t\t  struct ext2fs_numeric_progress_struct * progress,\n\t\t\t\t\t  const char *message);\n\n/*\n * 64-bit bitmap support\n */\n\nextern errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic,\n\t\t\t\t\t   int type, __u64 start, __u64 end,\n\t\t\t\t\t   __u64 real_end,\n\t\t\t\t\t   const char * description,\n\t\t\t\t\t   ext2fs_generic_bitmap *bmap);\n\nextern void ext2fs_free_generic_bmap(ext2fs_generic_bitmap bmap);\n\nextern errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap src,\n\t\t\t\t\t  ext2fs_generic_bitmap *dest);\n\nextern errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap bmap,\n\t\t\t\t\t    __u64 new_end,\n\t\t\t\t\t    __u64 new_real_end);\nextern errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t       errcode_t neq,\n\t\t\t\t\t       __u64 end, __u64 *oend);\nextern int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t    __u64 arg);\nextern int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t      __u64 arg);\nextern int ext2fs_test_generic_bmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t    __u64 arg);\nextern errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t       __u64 start, unsigned int num,\n\t\t\t\t\t       void *in);\nextern errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t       __u64 start, unsigned int num,\n\t\t\t\t\t       void *out);\nextern void ext2fs_warn_bitmap32(ext2fs_generic_bitmap bitmap,const char *func);\n\nextern int ext2fs_mem_is_zero(const char *mem, size_t len);\n\nextern int ext2fs_file_block_offset_too_big(ext2_filsys fs,\n\t\t\t\t\t    struct ext2_inode *inode,\n\t\t\t\t\t    blk64_t offset);\n\n/* atexit support */\ntypedef void (*ext2_exit_fn)(void *);\nerrcode_t ext2fs_add_exit_fn(ext2_exit_fn fn, void *data);\nerrcode_t ext2fs_remove_exit_fn(ext2_exit_fn fn, void *data);\n\n#define EXT2FS_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2*!!(cond)]))\n"
  },
  {
    "path": "src/ext2fs/ext3_extents.h",
    "content": "/*\n * Copyright (c) 2003,2004 Cluster File Systems, Inc, info@clusterfs.com\n * Written by Alex Tomas <alex@clusterfs.com>\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#ifndef _LINUX_EXT3_EXTENTS\n#define _LINUX_EXT3_EXTENTS\n\n/*\n * ext3_inode has i_block array (total 60 bytes)\n * first 4 bytes are used to store:\n *  - tree depth (0 mean there is no tree yet. all extents in the inode)\n *  - number of alive extents in the inode\n */\n\n/*\n * This is extent tail on-disk structure.\n * All other extent structures are 12 bytes long.  It turns out that\n * block_size % 12 >= 4 for at least all powers of 2 greater than 512, which\n * covers all valid ext4 block sizes.  Therefore, this tail structure can be\n * crammed into the end of the block without having to rebalance the tree.\n */\nstruct ext3_extent_tail {\n\t__le32\tet_checksum;\t/* crc32c(uuid+inum+extent_block) */\n};\n\n/*\n * this is extent on-disk structure\n * it's used at the bottom of the tree\n */\nstruct ext3_extent {\n\t__le32\tee_block;\t/* first logical block extent covers */\n\t__le16\tee_len;\t\t/* number of blocks covered by extent */\n\t__le16\tee_start_hi;\t/* high 16 bits of physical block */\n\t__le32\tee_start;\t/* low 32 bigs of physical block */\n};\n\n/*\n * this is index on-disk structure\n * it's used at all the levels, but the bottom\n */\nstruct ext3_extent_idx {\n\t__le32\tei_block;\t/* index covers logical blocks from 'block' */\n\t__le32\tei_leaf;\t/* pointer to the physical block of the next *\n\t\t\t\t * level. leaf or next index could bet here */\n\t__le16\tei_leaf_hi;\t/* high 16 bits of physical block */\n\t__le16\tei_unused;\n};\n\n/*\n * each block (leaves and indexes), even inode-stored has header\n */\nstruct ext3_extent_header {\n\t__le16\teh_magic;\t/* probably will support different formats */\n\t__le16\teh_entries;\t/* number of valid entries */\n\t__le16\teh_max;\t\t/* capacity of store in entries */\n\t__le16\teh_depth;\t/* has tree real underlying blocks? */\n\t__le32\teh_generation;\t/* generation of the tree */\n};\n\n#define EXT3_EXT_MAGIC\t\t0xf30a\n\n/*\n * array of ext3_ext_path contains path to some extent\n * creation/lookup routines use it for traversal/splitting/etc\n * truncate uses it to simulate recursive walking\n */\nstruct ext3_ext_path {\n\t__u32\t\t\t\tp_block;\n\t__u16\t\t\t\tp_depth;\n\tstruct ext3_extent\t\t*p_ext;\n\tstruct ext3_extent_idx\t\t*p_idx;\n\tstruct ext3_extent_header\t*p_hdr;\n\tstruct buffer_head\t\t*p_bh;\n};\n\n/*\n * EXT_INIT_MAX_LEN is the maximum number of blocks we can have in an\n * initialized extent. This is 2^15 and not (2^16 - 1), since we use the\n * MSB of ee_len field in the extent datastructure to signify if this\n * particular extent is an initialized extent or an uninitialized (i.e.\n * preallocated).\n * EXT_UNINIT_MAX_LEN is the maximum number of blocks we can have in an\n * uninitialized extent.\n * If ee_len is <= 0x8000, it is an initialized extent. Otherwise, it is an\n * uninitialized one. In other words, if MSB of ee_len is set, it is an\n * uninitialized extent with only one special scenario when ee_len = 0x8000.\n * In this case we can not have an uninitialized extent of zero length and\n * thus we make it as a special case of initialized extent with 0x8000 length.\n * This way we get better extent-to-group alignment for initialized extents.\n * Hence, the maximum number of blocks we can have in an *initialized*\n * extent is 2^15 (32768) and in an *uninitialized* extent is 2^15-1 (32767).\n */\n#define EXT_INIT_MAX_LEN\t(1UL << 15)\n#define EXT_UNINIT_MAX_LEN\t(EXT_INIT_MAX_LEN - 1)\n#define EXT_MAX_EXTENT_LBLK\t(((__u64) 1 << 32) - 1)\n#define EXT_MAX_EXTENT_PBLK\t(((__u64) 1 << 48) - 1)\n\n#define EXT_FIRST_EXTENT(__hdr__) \\\n\t((struct ext3_extent *) (((char *) (__hdr__)) +\t\t\\\n\t\t\t\t sizeof(struct ext3_extent_header)))\n#define EXT_FIRST_INDEX(__hdr__) \\\n\t((struct ext3_extent_idx *) (((char *) (__hdr__)) +\t\\\n\t\t\t\t     sizeof(struct ext3_extent_header)))\n#define EXT_HAS_FREE_INDEX(__path__) \\\n\t(ext2fs_le16_to_cpu((__path__)->p_hdr->eh_entries) < \\\n\t ext2fs_le16_to_cpu((__path__)->p_hdr->eh_max))\n#define EXT_LAST_EXTENT(__hdr__) \\\n\t(EXT_FIRST_EXTENT((__hdr__)) + \\\n\text2fs_le16_to_cpu((__hdr__)->eh_entries) - 1)\n#define EXT_LAST_INDEX(__hdr__) \\\n\t(EXT_FIRST_INDEX((__hdr__)) + \\\n\text2fs_le16_to_cpu((__hdr__)->eh_entries) - 1)\n#define EXT_MAX_EXTENT(__hdr__) \\\n\t(EXT_FIRST_EXTENT((__hdr__)) + \\\n\text2fs_le16_to_cpu((__hdr__)->eh_max) - 1)\n#define EXT_MAX_INDEX(__hdr__) \\\n\t(EXT_FIRST_INDEX((__hdr__)) + \\\n\text2fs_le16_to_cpu((__hdr__)->eh_max) - 1)\n\n#endif /* _LINUX_EXT3_EXTENTS */\n\n"
  },
  {
    "path": "src/ext2fs/ext4_acl.h",
    "content": "/*\n * Ext4's on-disk acl format.  From linux/fs/ext4/acl.h\n */\n\n#define EXT4_ACL_VERSION        0x0001\n\n/* 23.2.5 acl_tag_t values */\n\n#define ACL_UNDEFINED_TAG\t(0x00)\n#define ACL_USER_OBJ\t\t(0x01)\n#define ACL_USER\t\t(0x02)\n#define ACL_GROUP_OBJ\t\t(0x04)\n#define ACL_GROUP\t\t(0x08)\n#define ACL_MASK\t\t(0x10)\n#define ACL_OTHER\t\t(0x20)\n\n/* 23.3.6 acl_type_t values */\n\n#define ACL_TYPE_ACCESS\t\t(0x8000)\n#define ACL_TYPE_DEFAULT\t(0x4000)\n\n/* 23.2.7 ACL qualifier constants */\n\n#define ACL_UNDEFINED_ID\t((id_t)-1)\n\ntypedef struct {\n        __le16          e_tag;\n        __le16          e_perm;\n        __le32          e_id;\n } ext4_acl_entry;\n \ntypedef struct {\n        __le16          e_tag;\n        __le16          e_perm;\n} ext4_acl_entry_short;\n\ntypedef struct {\n         __le32          a_version;\n} ext4_acl_header;\n\n\n/* Supported ACL a_version fields */\n #define POSIX_ACL_XATTR_VERSION 0x0002\n\ntypedef struct {\n        __le16                  e_tag;\n        __le16                  e_perm;\n        __le32                  e_id;\n} posix_acl_xattr_entry;\n\ntypedef struct {\n        __le32                  a_version;\n#if __GNUC_PREREQ (4, 8)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wpedantic\"\n#endif\n        posix_acl_xattr_entry   a_entries[0];\n#if __GNUC_PREREQ (4, 8)\n#pragma GCC diagnostic pop\n#endif\n} posix_acl_xattr_header;\n\n"
  },
  {
    "path": "src/ext2fs/ext_attr.c",
    "content": "/*\n * ext_attr.c --- extended attribute blocks\n *\n * Copyright (C) 2001 Andreas Gruenbacher, <a.gruenbacher@computer.org>\n *\n * Copyright (C) 2002 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <string.h>\n#include <time.h>\n\n#include \"ext2_fs.h\"\n#include \"ext2_ext_attr.h\"\n#include \"ext4_acl.h\"\n\n#include \"ext2fs.h\"\n\nstatic errcode_t read_ea_inode_hash(ext2_filsys fs, ext2_ino_t ino, __u32 *hash)\n{\n\tstruct ext2_inode inode;\n\terrcode_t retval;\n\n\tretval = ext2fs_read_inode(fs, ino, &inode);\n\tif (retval)\n\t\treturn retval;\n\t*hash = ext2fs_get_ea_inode_hash(&inode);\n\treturn 0;\n}\n\n#define NAME_HASH_SHIFT 5\n#define VALUE_HASH_SHIFT 16\n\n/*\n * ext2_xattr_hash_entry()\n *\n * Compute the hash of an extended attribute.\n */\n__u32 ext2fs_ext_attr_hash_entry(struct ext2_ext_attr_entry *entry, void *data)\n{\n\t__u32 hash = 0;\n\tchar *name = ((char *) entry) + sizeof(struct ext2_ext_attr_entry);\n\tint n;\n\n\tfor (n = 0; n < entry->e_name_len; n++) {\n\t\thash = (hash << NAME_HASH_SHIFT) ^\n\t\t       (hash >> (8*sizeof(hash) - NAME_HASH_SHIFT)) ^\n\t\t       *name++;\n\t}\n\n\t/* The hash needs to be calculated on the data in little-endian. */\n\tif (entry->e_value_inum == 0 && entry->e_value_size != 0) {\n\t\t__u32 *value = (__u32 *)data;\n\t\tfor (n = (entry->e_value_size + EXT2_EXT_ATTR_ROUND) >>\n\t\t\t EXT2_EXT_ATTR_PAD_BITS; n; n--) {\n\t\t\thash = (hash << VALUE_HASH_SHIFT) ^\n\t\t\t       (hash >> (8*sizeof(hash) - VALUE_HASH_SHIFT)) ^\n\t\t\t       ext2fs_le32_to_cpu(*value++);\n\t\t}\n\t}\n\n\treturn hash;\n}\n\n/*\n * ext2fs_ext_attr_hash_entry2()\n *\n * Compute the hash of an extended attribute.\n * This version of the function supports hashing entries that reference\n * external inodes (ea_inode feature).\n */\nerrcode_t ext2fs_ext_attr_hash_entry2(ext2_filsys fs,\n\t\t\t\t      struct ext2_ext_attr_entry *entry,\n\t\t\t\t      void *data, __u32 *hash)\n{\n\t*hash = ext2fs_ext_attr_hash_entry(entry, data);\n\n\tif (entry->e_value_inum) {\n\t\t__u32 ea_inode_hash;\n\t\terrcode_t retval;\n\n\t\tretval = read_ea_inode_hash(fs, entry->e_value_inum,\n\t\t\t\t\t    &ea_inode_hash);\n\t\tif (retval)\n\t\t\treturn retval;\n\n\t\t*hash = (*hash << VALUE_HASH_SHIFT) ^\n\t\t\t(*hash >> (8*sizeof(*hash) - VALUE_HASH_SHIFT)) ^\n\t\t\tea_inode_hash;\n\t}\n\treturn 0;\n}\n\n#undef NAME_HASH_SHIFT\n#undef VALUE_HASH_SHIFT\n\n#define BLOCK_HASH_SHIFT 16\n\n/* Mirrors ext4_xattr_rehash() implementation in kernel. */\nvoid ext2fs_ext_attr_block_rehash(struct ext2_ext_attr_header *header,\n\t\t\t\t  struct ext2_ext_attr_entry *end)\n{\n\tstruct ext2_ext_attr_entry *here;\n\t__u32 hash = 0;\n\n\there = (struct ext2_ext_attr_entry *)(header+1);\n\twhile (here < end && !EXT2_EXT_IS_LAST_ENTRY(here)) {\n\t\tif (!here->e_hash) {\n\t\t\t/* Block is not shared if an entry's hash value == 0 */\n\t\t\thash = 0;\n\t\t\tbreak;\n\t\t}\n\t\thash = (hash << BLOCK_HASH_SHIFT) ^\n\t\t       (hash >> (8*sizeof(hash) - BLOCK_HASH_SHIFT)) ^\n\t\t       here->e_hash;\n\t\there = EXT2_EXT_ATTR_NEXT(here);\n\t}\n\theader->h_hash = hash;\n}\n\n#undef BLOCK_HASH_SHIFT\n\n__u32 ext2fs_get_ea_inode_hash(struct ext2_inode *inode)\n{\n\treturn inode->i_atime;\n}\n\nvoid ext2fs_set_ea_inode_hash(struct ext2_inode *inode, __u32 hash)\n{\n\tinode->i_atime = hash;\n}\n\n__u64 ext2fs_get_ea_inode_ref(struct ext2_inode *inode)\n{\n\treturn ((__u64)inode->i_ctime << 32) | inode->osd1.linux1.l_i_version;\n}\n\nvoid ext2fs_set_ea_inode_ref(struct ext2_inode *inode, __u64 ref_count)\n{\n\tinode->i_ctime = (__u32)(ref_count >> 32);\n\tinode->osd1.linux1.l_i_version = (__u32)ref_count;\n}\n\nstatic errcode_t check_ext_attr_header(struct ext2_ext_attr_header *header)\n{\n\tif ((header->h_magic != EXT2_EXT_ATTR_MAGIC_v1 &&\n\t     header->h_magic != EXT2_EXT_ATTR_MAGIC) ||\n\t    header->h_blocks != 1)\n\t\treturn EXT2_ET_BAD_EA_HEADER;\n\n\treturn 0;\n}\n\nerrcode_t ext2fs_read_ext_attr3(ext2_filsys fs, blk64_t block, void *buf,\n\t\t\t\text2_ino_t inum)\n{\n\tint\t\tcsum_failed = 0;\n\terrcode_t\tretval;\n\n\tretval = io_channel_read_blk64(fs->io, block, 1, buf);\n\tif (retval)\n\t\treturn retval;\n\n\tif (!(fs->flags & EXT2_FLAG_IGNORE_CSUM_ERRORS) &&\n\t    !ext2fs_ext_attr_block_csum_verify(fs, inum, block, buf))\n\t\tcsum_failed = 1;\n\n#ifdef WORDS_BIGENDIAN\n\text2fs_swap_ext_attr(buf, buf, fs->blocksize, 1);\n#endif\n\n\tretval = check_ext_attr_header(buf);\n\tif (retval == 0 && csum_failed)\n\t\tretval = EXT2_ET_EXT_ATTR_CSUM_INVALID;\n\n\treturn retval;\n}\n\nerrcode_t ext2fs_read_ext_attr2(ext2_filsys fs, blk64_t block, void *buf)\n{\n\treturn ext2fs_read_ext_attr3(fs, block, buf, 0);\n}\n\nerrcode_t ext2fs_read_ext_attr(ext2_filsys fs, blk_t block, void *buf)\n{\n\treturn ext2fs_read_ext_attr2(fs, block, buf);\n}\n\nerrcode_t ext2fs_write_ext_attr3(ext2_filsys fs, blk64_t block, void *inbuf,\n\t\t\t\t ext2_ino_t inum)\n{\n\terrcode_t\tretval;\n\tchar\t\t*write_buf;\n\n#ifdef WORDS_BIGENDIAN\n\tretval = ext2fs_get_mem(fs->blocksize, &write_buf);\n\tif (retval)\n\t\treturn retval;\n\text2fs_swap_ext_attr(write_buf, inbuf, fs->blocksize, 1);\n#else\n\twrite_buf = (char *) inbuf;\n#endif\n\n\tretval = ext2fs_ext_attr_block_csum_set(fs, inum, block,\n\t\t\t(struct ext2_ext_attr_header *)write_buf);\n\tif (retval)\n\t\treturn retval;\n\n\tretval = io_channel_write_blk64(fs->io, block, 1, write_buf);\n#ifdef WORDS_BIGENDIAN\n\text2fs_free_mem(&write_buf);\n#endif\n\tif (!retval)\n\t\text2fs_mark_changed(fs);\n\treturn retval;\n}\n\nerrcode_t ext2fs_write_ext_attr2(ext2_filsys fs, blk64_t block, void *inbuf)\n{\n\treturn ext2fs_write_ext_attr3(fs, block, inbuf, 0);\n}\n\nerrcode_t ext2fs_write_ext_attr(ext2_filsys fs, blk_t block, void *inbuf)\n{\n\treturn ext2fs_write_ext_attr2(fs, block, inbuf);\n}\n\n/*\n * This function adjusts the reference count of the EA block.\n */\nerrcode_t ext2fs_adjust_ea_refcount3(ext2_filsys fs, blk64_t blk,\n\t\t\t\t    char *block_buf, int adjust,\n\t\t\t\t    __u32 *newcount, ext2_ino_t inum)\n{\n\terrcode_t\tretval;\n\tstruct ext2_ext_attr_header *header;\n\tchar\t*buf = 0;\n\n\tif ((blk >= ext2fs_blocks_count(fs->super)) ||\n\t    (blk < fs->super->s_first_data_block))\n\t\treturn EXT2_ET_BAD_EA_BLOCK_NUM;\n\n\tif (!block_buf) {\n\t\tretval = ext2fs_get_mem(fs->blocksize, &buf);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tblock_buf = buf;\n\t}\n\n\tretval = ext2fs_read_ext_attr3(fs, blk, block_buf, inum);\n\tif (retval)\n\t\tgoto errout;\n\n\theader = (struct ext2_ext_attr_header *) block_buf;\n\theader->h_refcount += adjust;\n\tif (newcount)\n\t\t*newcount = header->h_refcount;\n\n\tretval = ext2fs_write_ext_attr3(fs, blk, block_buf, inum);\n\tif (retval)\n\t\tgoto errout;\n\nerrout:\n\tif (buf)\n\t\text2fs_free_mem(&buf);\n\treturn retval;\n}\n\nerrcode_t ext2fs_adjust_ea_refcount2(ext2_filsys fs, blk64_t blk,\n\t\t\t\t    char *block_buf, int adjust,\n\t\t\t\t    __u32 *newcount)\n{\n\treturn ext2fs_adjust_ea_refcount3(fs, blk, block_buf, adjust,\n\t\t\t\t\t  newcount, 0);\n}\n\nerrcode_t ext2fs_adjust_ea_refcount(ext2_filsys fs, blk_t blk,\n\t\t\t\t\tchar *block_buf, int adjust,\n\t\t\t\t\t__u32 *newcount)\n{\n\treturn ext2fs_adjust_ea_refcount2(fs, blk, block_buf, adjust,\n\t\t\t\t\t  newcount);\n}\n\n/* Manipulate the contents of extended attribute regions */\nstruct ext2_xattr {\n\tchar *name;\n\tvoid *value;\n\tunsigned int value_len;\n\text2_ino_t ea_ino;\n};\n\nstruct ext2_xattr_handle {\n\terrcode_t magic;\n\text2_filsys fs;\n\tstruct ext2_xattr *attrs;\n\tint capacity;\n\tint count;\n\tint ibody_count;\n\text2_ino_t ino;\n\tunsigned int flags;\n};\n\nstatic errcode_t ext2fs_xattrs_expand(struct ext2_xattr_handle *h,\n\t\t\t\t      unsigned int expandby)\n{\n\tstruct ext2_xattr *new_attrs;\n\terrcode_t err;\n\n\terr = ext2fs_get_arrayzero(h->capacity + expandby,\n\t\t\t\t   sizeof(struct ext2_xattr), &new_attrs);\n\tif (err)\n\t\treturn err;\n\n\tmemcpy(new_attrs, h->attrs, h->capacity * sizeof(struct ext2_xattr));\n\text2fs_free_mem(&h->attrs);\n\th->capacity += expandby;\n\th->attrs = new_attrs;\n\n\treturn 0;\n}\n\nstruct ea_name_index {\n\tint index;\n\tconst char *name;\n};\n\n/* Keep these names sorted in order of decreasing specificity. */\nstatic struct ea_name_index ea_names[] = {\n\t{3, \"system.posix_acl_default\"},\n\t{2, \"system.posix_acl_access\"},\n\t{8, \"system.richacl\"},\n\t{6, \"security.\"},\n\t{4, \"trusted.\"},\n\t{7, \"system.\"},\n\t{1, \"user.\"},\n\t{0, NULL},\n};\n\nstatic const char *find_ea_prefix(int index)\n{\n\tstruct ea_name_index *e;\n\n\tfor (e = ea_names; e->name; e++)\n\t\tif (e->index == index)\n\t\t\treturn e->name;\n\n\treturn NULL;\n}\n\nstatic int find_ea_index(const char *fullname, const char **name, int *index)\n{\n\tstruct ea_name_index *e;\n\n\tfor (e = ea_names; e->name; e++) {\n\t\tif (strncmp(fullname, e->name, strlen(e->name)) == 0) {\n\t\t\t*name = fullname + strlen(e->name);\n\t\t\t*index = e->index;\n\t\t\treturn 1;\n\t\t}\n\t}\n\treturn 0;\n}\n\nerrcode_t ext2fs_free_ext_attr(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t       struct ext2_inode_large *inode)\n{\n\tstruct ext2_ext_attr_header *header;\n\tvoid *block_buf = NULL;\n\tblk64_t blk;\n\terrcode_t err;\n\tstruct ext2_inode_large i;\n\n\t/* Read inode? */\n\tif (inode == NULL) {\n\t\terr = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&i,\n\t\t\t\t\t     sizeof(struct ext2_inode_large));\n\t\tif (err)\n\t\t\treturn err;\n\t\tinode = &i;\n\t}\n\n\t/* Do we already have an EA block? */\n\tblk = ext2fs_file_acl_block(fs, (struct ext2_inode *)inode);\n\tif (blk == 0)\n\t\treturn 0;\n\n\t/* Find block, zero it, write back */\n\tif ((blk < fs->super->s_first_data_block) ||\n\t    (blk >= ext2fs_blocks_count(fs->super))) {\n\t\terr = EXT2_ET_BAD_EA_BLOCK_NUM;\n\t\tgoto out;\n\t}\n\n\terr = ext2fs_get_mem(fs->blocksize, &block_buf);\n\tif (err)\n\t\tgoto out;\n\n\terr = ext2fs_read_ext_attr3(fs, blk, block_buf, ino);\n\tif (err)\n\t\tgoto out2;\n\n\t/* We only know how to deal with v2 EA blocks */\n\theader = (struct ext2_ext_attr_header *) block_buf;\n\tif (header->h_magic != EXT2_EXT_ATTR_MAGIC) {\n\t\terr = EXT2_ET_BAD_EA_HEADER;\n\t\tgoto out2;\n\t}\n\n\theader->h_refcount--;\n\terr = ext2fs_write_ext_attr3(fs, blk, block_buf, ino);\n\tif (err)\n\t\tgoto out2;\n\n\t/* Erase link to block */\n\text2fs_file_acl_block_set(fs, (struct ext2_inode *)inode, 0);\n\tif (header->h_refcount == 0)\n\t\text2fs_block_alloc_stats2(fs, blk, -1);\n\terr = ext2fs_iblk_sub_blocks(fs, (struct ext2_inode *)inode, 1);\n\tif (err)\n\t\tgoto out2;\n\n\t/* Write inode? */\n\tif (inode == &i) {\n\t\terr = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&i,\n\t\t\t\t\t      sizeof(struct ext2_inode_large));\n\t\tif (err)\n\t\t\tgoto out2;\n\t}\n\nout2:\n\text2fs_free_mem(&block_buf);\nout:\n\treturn err;\n}\n\nstatic errcode_t prep_ea_block_for_write(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\t struct ext2_inode_large *inode)\n{\n\tstruct ext2_ext_attr_header *header;\n\tvoid *block_buf = NULL;\n\tblk64_t blk, goal;\n\terrcode_t err;\n\n\t/* Do we already have an EA block? */\n\tblk = ext2fs_file_acl_block(fs, (struct ext2_inode *)inode);\n\tif (blk != 0) {\n\t\tif ((blk < fs->super->s_first_data_block) ||\n\t\t    (blk >= ext2fs_blocks_count(fs->super))) {\n\t\t\terr = EXT2_ET_BAD_EA_BLOCK_NUM;\n\t\t\tgoto out;\n\t\t}\n\n\t\terr = ext2fs_get_mem(fs->blocksize, &block_buf);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\terr = ext2fs_read_ext_attr3(fs, blk, block_buf, ino);\n\t\tif (err)\n\t\t\tgoto out2;\n\n\t\t/* We only know how to deal with v2 EA blocks */\n\t\theader = (struct ext2_ext_attr_header *) block_buf;\n\t\tif (header->h_magic != EXT2_EXT_ATTR_MAGIC) {\n\t\t\terr = EXT2_ET_BAD_EA_HEADER;\n\t\t\tgoto out2;\n\t\t}\n\n\t\t/* Single-user block.  We're done here. */\n\t\tif (header->h_refcount == 1)\n\t\t\tgoto out2;\n\n\t\t/* We need to CoW the block. */\n\t\theader->h_refcount--;\n\t\terr = ext2fs_write_ext_attr3(fs, blk, block_buf, ino);\n\t\tif (err)\n\t\t\tgoto out2;\n\t} else {\n\t\t/* No block, we must increment i_blocks */\n\t\terr = ext2fs_iblk_add_blocks(fs, (struct ext2_inode *)inode,\n\t\t\t\t\t     1);\n\t\tif (err)\n\t\t\tgoto out;\n\t}\n\n\t/* Allocate a block */\n\tgoal = ext2fs_find_inode_goal(fs, ino, (struct ext2_inode *)inode, 0);\n\terr = ext2fs_alloc_block2(fs, goal, NULL, &blk);\n\tif (err)\n\t\tgoto out2;\n\text2fs_file_acl_block_set(fs, (struct ext2_inode *)inode, blk);\nout2:\n\tif (block_buf)\n\t\text2fs_free_mem(&block_buf);\nout:\n\treturn err;\n}\n\n\nstatic inline int\nposix_acl_xattr_count(size_t size)\n{\n        if (size < sizeof(posix_acl_xattr_header))\n                return -1;\n        size -= sizeof(posix_acl_xattr_header);\n        if (size % sizeof(posix_acl_xattr_entry))\n                return -1;\n        return size / sizeof(posix_acl_xattr_entry);\n}\n\n/*\n * The lgetxattr function returns data formatted in the POSIX extended\n * attribute format.  The on-disk format uses a more compact encoding.\n * See the ext4_acl_to_disk in fs/ext4/acl.c.\n */\nstatic errcode_t convert_posix_acl_to_disk_buffer(const void *value, size_t size,\n\t\t\t\t\t\t  void *out_buf, size_t *size_out)\n{\n\tconst posix_acl_xattr_header *header =\n\t\t(const posix_acl_xattr_header*) value;\n\tconst posix_acl_xattr_entry *end, *entry =\n\t\t(const posix_acl_xattr_entry *)(header+1);\n\text4_acl_header *ext_acl;\n\tsize_t s;\n\tchar *e;\n\n\tint count;\n\n\tif (!value)\n\t\treturn EINVAL;\n\tif (size < sizeof(posix_acl_xattr_header))\n\t\treturn ENOMEM;\n\tif (header->a_version != ext2fs_cpu_to_le32(POSIX_ACL_XATTR_VERSION))\n\t\treturn EINVAL;\n\n\tcount = posix_acl_xattr_count(size);\n\text_acl = out_buf;\n\text_acl->a_version = ext2fs_cpu_to_le32(EXT4_ACL_VERSION);\n\n\tif (count <= 0)\n\t\treturn EINVAL;\n\n\te = (char *) out_buf + sizeof(ext4_acl_header);\n\ts = sizeof(ext4_acl_header);\n\tfor (end = entry + count; entry != end;entry++) {\n\t\text4_acl_entry *disk_entry = (ext4_acl_entry*) e;\n\t\tdisk_entry->e_tag = ext2fs_cpu_to_le16(entry->e_tag);\n\t\tdisk_entry->e_perm = ext2fs_cpu_to_le16(entry->e_perm);\n\n\t\tswitch(entry->e_tag) {\n\t\t\tcase ACL_USER_OBJ:\n\t\t\tcase ACL_GROUP_OBJ:\n\t\t\tcase ACL_MASK:\n\t\t\tcase ACL_OTHER:\n\t\t\t\te += sizeof(ext4_acl_entry_short);\n\t\t\t\ts += sizeof(ext4_acl_entry_short);\n\t\t\t\tbreak;\n\t\t\tcase ACL_USER:\n\t\t\tcase ACL_GROUP:\n\t\t\t\tdisk_entry->e_id =  ext2fs_cpu_to_le32(entry->e_id);\n\t\t\t\te += sizeof(ext4_acl_entry);\n\t\t\t\ts += sizeof(ext4_acl_entry);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t*size_out = s;\n\treturn 0;\n}\n\nstatic errcode_t convert_disk_buffer_to_posix_acl(const void *value, size_t size,\n\t\t\t\t\t\t  void **out_buf, size_t *size_out)\n{\n\tposix_acl_xattr_header *header;\n\tposix_acl_xattr_entry *entry;\n\tconst ext4_acl_header *ext_acl = (const ext4_acl_header *) value;\n\terrcode_t err;\n\tconst char *cp;\n\tchar *out;\n\n\tif ((!value) ||\n\t    (size < sizeof(ext4_acl_header)) ||\n\t    (ext_acl->a_version != ext2fs_cpu_to_le32(EXT4_ACL_VERSION)))\n\t\treturn EINVAL;\n\n\terr = ext2fs_get_mem(size * 2, &out);\n\tif (err)\n\t\treturn err;\n\n\theader = (posix_acl_xattr_header *) out;\n\theader->a_version = ext2fs_cpu_to_le32(POSIX_ACL_XATTR_VERSION);\n\tentry = (posix_acl_xattr_entry *) (out + sizeof(posix_acl_xattr_header));\n\n\tcp = (const char *) value + sizeof(ext4_acl_header);\n\tsize -= sizeof(ext4_acl_header);\n\n\twhile (size > 0) {\n\t\tconst ext4_acl_entry *disk_entry = (const ext4_acl_entry *) cp;\n\n\t\tentry->e_tag = ext2fs_le16_to_cpu(disk_entry->e_tag);\n\t\tentry->e_perm = ext2fs_le16_to_cpu(disk_entry->e_perm);\n\n\t\tswitch(entry->e_tag) {\n\t\t\tcase ACL_USER_OBJ:\n\t\t\tcase ACL_GROUP_OBJ:\n\t\t\tcase ACL_MASK:\n\t\t\tcase ACL_OTHER:\n\t\t\t\tentry->e_id = 0;\n\t\t\t\tcp += sizeof(ext4_acl_entry_short);\n\t\t\t\tsize -= sizeof(ext4_acl_entry_short);\n\t\t\t\tbreak;\n\t\t\tcase ACL_USER:\n\t\t\tcase ACL_GROUP:\n\t\t\t\tentry->e_id = ext2fs_le32_to_cpu(disk_entry->e_id);\n\t\t\t\tcp += sizeof(ext4_acl_entry);\n\t\t\t\tsize -= sizeof(ext4_acl_entry);\n\t\t\t\tbreak;\n\t\tdefault:\n\t\t\text2fs_free_mem(&out);\n\t\t\treturn EINVAL;\n\t\t\tbreak;\n\t\t}\n\t\tentry++;\n\t}\n\t*out_buf = out;\n\t*size_out = ((char *) entry - out);\n\treturn 0;\n}\n\nstatic errcode_t\nwrite_xattrs_to_buffer(ext2_filsys fs, struct ext2_xattr *attrs, int count,\n\t\t       void *entries_start, unsigned int storage_size,\n\t\t       unsigned int value_offset_correction, int write_hash)\n{\n\tstruct ext2_xattr *x;\n\tstruct ext2_ext_attr_entry *e = entries_start;\n\tchar *end = (char *) entries_start + storage_size;\n\tconst char *shortname;\n\tunsigned int value_size;\n\tint idx, ret;\n\terrcode_t err;\n\n\tmemset(entries_start, 0, storage_size);\n\tfor (x = attrs; x < attrs + count; x++) {\n\t\t/* Calculate index and shortname position */\n\t\tshortname = x->name;\n\t\tret = find_ea_index(x->name, &shortname, &idx);\n\n\t\tvalue_size = ((x->value_len + EXT2_EXT_ATTR_PAD - 1) /\n\t\t\t      EXT2_EXT_ATTR_PAD) * EXT2_EXT_ATTR_PAD;\n\n\t\t/* Fill out e appropriately */\n\t\te->e_name_len = strlen(shortname);\n\t\te->e_name_index = (ret ? idx : 0);\n\n\t\te->e_value_size = x->value_len;\n\t\te->e_value_inum = x->ea_ino;\n\n\t\t/* Store name */\n\t\tmemcpy((char *)e + sizeof(*e), shortname, e->e_name_len);\n\t\tif (x->ea_ino) {\n\t\t\te->e_value_offs = 0;\n\t\t} else {\n\t\t\tend -= value_size;\n\t\t\te->e_value_offs = end - (char *) entries_start +\n\t\t\t\t\t\tvalue_offset_correction;\n\t\t\tmemcpy(end, x->value, e->e_value_size);\n\t\t}\n\n\t\tif (write_hash || x->ea_ino) {\n\t\t\terr = ext2fs_ext_attr_hash_entry2(fs, e,\n\t\t\t\t\t\t\t  x->ea_ino ? 0 : end,\n\t\t\t\t\t\t\t  &e->e_hash);\n\t\t\tif (err)\n\t\t\t\treturn err;\n\t\t} else\n\t\t\te->e_hash = 0;\n\n\t\te = EXT2_EXT_ATTR_NEXT(e);\n\t\t*(__u32 *)e = 0;\n\t}\n\treturn 0;\n}\n\nerrcode_t ext2fs_xattrs_write(struct ext2_xattr_handle *handle)\n{\n\text2_filsys fs = handle->fs;\n\tconst unsigned int inode_size = EXT2_INODE_SIZE(fs->super);\n\tstruct ext2_inode_large *inode;\n\tchar *start, *block_buf = NULL;\n\tstruct ext2_ext_attr_header *header;\n\t__u32 ea_inode_magic;\n\tblk64_t blk;\n\tunsigned int storage_size;\n\tunsigned int i;\n\terrcode_t err;\n\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EA_HANDLE);\n\ti = inode_size;\n\tif (i < sizeof(*inode))\n\t\ti = sizeof(*inode);\n\terr = ext2fs_get_memzero(i, &inode);\n\tif (err)\n\t\treturn err;\n\n\terr = ext2fs_read_inode_full(fs, handle->ino, EXT2_INODE(inode),\n\t\t\t\t     inode_size);\n\tif (err)\n\t\tgoto out;\n\n\t/* If extra_isize isn't set, we need to set it now */\n\tif (inode->i_extra_isize == 0 &&\n\t    inode_size > EXT2_GOOD_OLD_INODE_SIZE) {\n\t\tchar *p = (char *)inode;\n\t\tsize_t extra = fs->super->s_want_extra_isize;\n\n\t\tif (extra == 0)\n\t\t\textra = sizeof(__u32);\n\t\tmemset(p + EXT2_GOOD_OLD_INODE_SIZE, 0, extra);\n\t\tinode->i_extra_isize = extra;\n\t}\n\tif (inode->i_extra_isize & 3) {\n\t\terr = EXT2_ET_INODE_CORRUPTED;\n\t\tgoto out;\n\t}\n\n\t/* Does the inode have space for EA? */\n\tif (inode->i_extra_isize < sizeof(inode->i_extra_isize) ||\n\t    inode_size <= EXT2_GOOD_OLD_INODE_SIZE + inode->i_extra_isize +\n\t\t\t\t\t\t\t\tsizeof(__u32))\n\t\tgoto write_ea_block;\n\n\t/* Write the inode EA */\n\tea_inode_magic = EXT2_EXT_ATTR_MAGIC;\n\tmemcpy(((char *) inode) + EXT2_GOOD_OLD_INODE_SIZE +\n\t       inode->i_extra_isize, &ea_inode_magic, sizeof(__u32));\n\tstorage_size = inode_size - EXT2_GOOD_OLD_INODE_SIZE -\n\t\t\t\tinode->i_extra_isize - sizeof(__u32);\n\tstart = ((char *) inode) + EXT2_GOOD_OLD_INODE_SIZE +\n\t\t\t\tinode->i_extra_isize + sizeof(__u32);\n\n\terr = write_xattrs_to_buffer(fs, handle->attrs, handle->ibody_count,\n\t\t\t\t     start, storage_size, 0, 0);\n\tif (err)\n\t\tgoto out;\nwrite_ea_block:\n\t/* Are we done? */\n\tif (handle->ibody_count == handle->count &&\n\t    !ext2fs_file_acl_block(fs, EXT2_INODE(inode)))\n\t\tgoto skip_ea_block;\n\n\t/* Write the EA block */\n\terr = ext2fs_get_memzero(fs->blocksize, &block_buf);\n\tif (err)\n\t\tgoto out;\n\n\tstorage_size = fs->blocksize - sizeof(struct ext2_ext_attr_header);\n\tstart = block_buf + sizeof(struct ext2_ext_attr_header);\n\n\terr = write_xattrs_to_buffer(fs, handle->attrs + handle->ibody_count,\n\t\t\t\t     handle->count - handle->ibody_count, start,\n\t\t\t\t     storage_size, start - block_buf, 1);\n\tif (err)\n\t\tgoto out2;\n\n\t/* Write a header on the EA block */\n\theader = (struct ext2_ext_attr_header *) block_buf;\n\theader->h_magic = EXT2_EXT_ATTR_MAGIC;\n\theader->h_refcount = 1;\n\theader->h_blocks = 1;\n\n\t/* Get a new block for writing */\n\terr = prep_ea_block_for_write(fs, handle->ino, inode);\n\tif (err)\n\t\tgoto out2;\n\n\t/* Finally, write the new EA block */\n\tblk = ext2fs_file_acl_block(fs, EXT2_INODE(inode));\n\terr = ext2fs_write_ext_attr3(fs, blk, block_buf, handle->ino);\n\tif (err)\n\t\tgoto out2;\n\nskip_ea_block:\n\tblk = ext2fs_file_acl_block(fs, (struct ext2_inode *)inode);\n\tif (!block_buf && blk) {\n\t\t/* xattrs shrunk, free the block */\n\t\terr = ext2fs_free_ext_attr(fs, handle->ino, inode);\n\t\tif (err)\n\t\t\tgoto out;\n\t}\n\n\t/* Write the inode */\n\terr = ext2fs_write_inode_full(fs, handle->ino, EXT2_INODE(inode),\n\t\t\t\t      inode_size);\n\tif (err)\n\t\tgoto out2;\n\nout2:\n\text2fs_free_mem(&block_buf);\nout:\n\text2fs_free_mem(&inode);\n\treturn err;\n}\n\nstatic errcode_t read_xattrs_from_buffer(struct ext2_xattr_handle *handle,\n\t\t\t\t\t struct ext2_inode_large *inode,\n\t\t\t\t\t struct ext2_ext_attr_entry *entries,\n\t\t\t\t\t unsigned int storage_size,\n\t\t\t\t\t char *value_start)\n{\n\tstruct ext2_xattr *x;\n\tstruct ext2_ext_attr_entry *entry, *end;\n\tconst char *prefix;\n\tunsigned int remain, prefix_len;\n\terrcode_t err;\n\tunsigned int values_size = storage_size +\n\t\t\t((char *)entries - value_start);\n\n\t/* find the end */\n\tend = entries;\n\tremain = storage_size;\n\twhile (remain >= sizeof(struct ext2_ext_attr_entry) &&\n\t       !EXT2_EXT_IS_LAST_ENTRY(end)) {\n\n\t\t/* header eats this space */\n\t\tremain -= sizeof(struct ext2_ext_attr_entry);\n\n\t\t/* is attribute name valid? */\n\t\tif (EXT2_EXT_ATTR_SIZE(end->e_name_len) > remain)\n\t\t\treturn EXT2_ET_EA_BAD_NAME_LEN;\n\n\t\t/* attribute len eats this space */\n\t\tremain -= EXT2_EXT_ATTR_SIZE(end->e_name_len);\n\t\tend = EXT2_EXT_ATTR_NEXT(end);\n\t}\n\n\tentry = entries;\n\tremain = storage_size;\n\twhile (remain >= sizeof(struct ext2_ext_attr_entry) &&\n\t       !EXT2_EXT_IS_LAST_ENTRY(entry)) {\n\n\t\t/* Allocate space for more attrs? */\n\t\tif (handle->count == handle->capacity) {\n\t\t\terr = ext2fs_xattrs_expand(handle, 4);\n\t\t\tif (err)\n\t\t\t\treturn err;\n\t\t}\n\n\t\tx = handle->attrs + handle->count;\n\n\t\t/* header eats this space */\n\t\tremain -= sizeof(struct ext2_ext_attr_entry);\n\n\t\t/* attribute len eats this space */\n\t\tremain -= EXT2_EXT_ATTR_SIZE(entry->e_name_len);\n\n\t\t/* Extract name */\n\t\tprefix = find_ea_prefix(entry->e_name_index);\n\t\tprefix_len = (prefix ? strlen(prefix) : 0);\n\t\terr = ext2fs_get_memzero(entry->e_name_len + prefix_len + 1,\n\t\t\t\t\t &x->name);\n\t\tif (err)\n\t\t\treturn err;\n\t\tif (prefix)\n\t\t\tmemcpy(x->name, prefix, prefix_len);\n\t\tif (entry->e_name_len)\n\t\t\tmemcpy(x->name + prefix_len,\n\t\t\t       (char *)entry + sizeof(*entry),\n\t\t\t       entry->e_name_len);\n\n\t\t/* Check & copy value */\n\t\tif (!ext2fs_has_feature_ea_inode(handle->fs->super) &&\n\t\t    entry->e_value_inum != 0)\n\t\t\treturn EXT2_ET_BAD_EA_BLOCK_NUM;\n\n\t\tif (entry->e_value_inum == 0) {\n\t\t\tif (entry->e_value_size > remain)\n\t\t\t\treturn EXT2_ET_EA_BAD_VALUE_SIZE;\n\n\t\t\tif (entry->e_value_offs + entry->e_value_size > values_size)\n\t\t\t\treturn EXT2_ET_EA_BAD_VALUE_OFFSET;\n\n\t\t\tif (entry->e_value_size > 0 &&\n\t\t\t    value_start + entry->e_value_offs <\n\t\t\t    (char *)end + sizeof(__u32))\n\t\t\t\treturn EXT2_ET_EA_BAD_VALUE_OFFSET;\n\n\t\t\tremain -= entry->e_value_size;\n\n\t\t\terr = ext2fs_get_mem(entry->e_value_size, &x->value);\n\t\t\tif (err)\n\t\t\t\treturn err;\n\t\t\tmemcpy(x->value, value_start + entry->e_value_offs,\n\t\t\t       entry->e_value_size);\n\t\t} else {\n\t\t\tstruct ext2_inode *ea_inode;\n\t\t\text2_file_t ea_file;\n\n\t\t\tif (entry->e_value_offs != 0)\n\t\t\t\treturn EXT2_ET_EA_BAD_VALUE_OFFSET;\n\n\t\t\tif (entry->e_value_size > (64 * 1024))\n\t\t\t\treturn EXT2_ET_EA_BAD_VALUE_SIZE;\n\n\t\t\terr = ext2fs_get_mem(entry->e_value_size, &x->value);\n\t\t\tif (err)\n\t\t\t\treturn err;\n\n\t\t\terr = ext2fs_file_open(handle->fs, entry->e_value_inum,\n\t\t\t\t\t       0, &ea_file);\n\t\t\tif (err)\n\t\t\t\treturn err;\n\n\t\t\tea_inode = ext2fs_file_get_inode(ea_file);\n\t\t\tif ((ea_inode->i_flags & EXT4_INLINE_DATA_FL) ||\n\t\t\t    !(ea_inode->i_flags & EXT4_EA_INODE_FL) ||\n\t\t\t    ea_inode->i_links_count == 0)\n\t\t\t\terr = EXT2_ET_EA_INODE_CORRUPTED;\n\t\t\telse if (ext2fs_file_get_size(ea_file) !=\n\t\t\t    entry->e_value_size)\n\t\t\t\terr = EXT2_ET_EA_BAD_VALUE_SIZE;\n\t\t\telse\n\t\t\t\terr = ext2fs_file_read(ea_file, x->value,\n\t\t\t\t\t\t       entry->e_value_size, 0);\n\t\t\text2fs_file_close(ea_file);\n\t\t\tif (err)\n\t\t\t\treturn err;\n\t\t}\n\n\t\tx->ea_ino = entry->e_value_inum;\n\t\tx->value_len = entry->e_value_size;\n\n\t\t/* e_hash may be 0 in older inode's ea */\n\t\tif (entry->e_hash != 0) {\n\t\t\t__u32 hash;\n\t\t\tvoid *data = (entry->e_value_inum != 0) ?\n\t\t\t\t\t0 : value_start + entry->e_value_offs;\n\n\t\t\terr = ext2fs_ext_attr_hash_entry2(handle->fs, entry,\n\t\t\t\t\t\t\t  data, &hash);\n\t\t\tif (err)\n\t\t\t\treturn err;\n\t\t\tif (entry->e_hash != hash) {\n\t\t\t\tstruct ext2_inode child;\n\n\t\t\t\t/* Check whether this is an old Lustre-style\n\t\t\t\t * ea_inode reference.\n\t\t\t\t */\n\t\t\t\terr = ext2fs_read_inode(handle->fs,\n\t\t\t\t\t\t\tentry->e_value_inum,\n\t\t\t\t\t\t\t&child);\n\t\t\t\tif (err)\n\t\t\t\t\treturn err;\n\t\t\t\tif (child.i_mtime != handle->ino ||\n\t\t\t\t    child.i_generation != inode->i_generation)\n\t\t\t\t\treturn EXT2_ET_BAD_EA_HASH;\n\t\t\t}\n\t\t}\n\n\t\thandle->count++;\n\t\tentry = EXT2_EXT_ATTR_NEXT(entry);\n\t}\n\n\treturn 0;\n}\n\nstatic void xattrs_free_keys(struct ext2_xattr_handle *h)\n{\n\tstruct ext2_xattr *a = h->attrs;\n\tint i;\n\n\tfor (i = 0; i < h->capacity; i++) {\n\t\tif (a[i].name)\n\t\t\text2fs_free_mem(&a[i].name);\n\t\tif (a[i].value)\n\t\t\text2fs_free_mem(&a[i].value);\n\t}\n\th->count = 0;\n\th->ibody_count = 0;\n}\n\nerrcode_t ext2fs_xattrs_read(struct ext2_xattr_handle *handle)\n{\n\tstruct ext2_inode_large *inode;\n\tstruct ext2_ext_attr_header *header;\n\t__u32 ea_inode_magic;\n\tunsigned int storage_size;\n\tchar *start, *block_buf = NULL;\n\tblk64_t blk;\n\tsize_t i;\n\terrcode_t err;\n\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EA_HANDLE);\n\ti = EXT2_INODE_SIZE(handle->fs->super);\n\tif (i < sizeof(*inode))\n\t\ti = sizeof(*inode);\n\terr = ext2fs_get_memzero(i, &inode);\n\tif (err)\n\t\treturn err;\n\n\terr = ext2fs_read_inode_full(handle->fs, handle->ino,\n\t\t\t\t     (struct ext2_inode *)inode,\n\t\t\t\t     EXT2_INODE_SIZE(handle->fs->super));\n\tif (err)\n\t\tgoto out;\n\n\txattrs_free_keys(handle);\n\n\t/* Does the inode have space for EA? */\n\tif (inode->i_extra_isize < sizeof(inode->i_extra_isize) ||\n\t    EXT2_INODE_SIZE(handle->fs->super) <= EXT2_GOOD_OLD_INODE_SIZE +\n\t\t\t\t\t\t  inode->i_extra_isize +\n\t\t\t\t\t\t  sizeof(__u32))\n\t\tgoto read_ea_block;\n\tif (inode->i_extra_isize & 3) {\n\t\terr = EXT2_ET_INODE_CORRUPTED;\n\t\tgoto out;\n\t}\n\n\t/* Look for EA in the inode */\n\tmemcpy(&ea_inode_magic, ((char *) inode) + EXT2_GOOD_OLD_INODE_SIZE +\n\t       inode->i_extra_isize, sizeof(__u32));\n\tif (ea_inode_magic == EXT2_EXT_ATTR_MAGIC) {\n\t\tstorage_size = EXT2_INODE_SIZE(handle->fs->super) -\n\t\t\tEXT2_GOOD_OLD_INODE_SIZE - inode->i_extra_isize -\n\t\t\tsizeof(__u32);\n\t\tstart = ((char *) inode) + EXT2_GOOD_OLD_INODE_SIZE +\n\t\t\tinode->i_extra_isize + sizeof(__u32);\n\n\t\terr = read_xattrs_from_buffer(handle, inode,\n\t\t\t\t\t(struct ext2_ext_attr_entry *) start,\n\t\t\t\t\tstorage_size, start);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\thandle->ibody_count = handle->count;\n\t}\n\nread_ea_block:\n\t/* Look for EA in a separate EA block */\n\tblk = ext2fs_file_acl_block(handle->fs, (struct ext2_inode *)inode);\n\tif (blk != 0) {\n\t\tif ((blk < handle->fs->super->s_first_data_block) ||\n\t\t    (blk >= ext2fs_blocks_count(handle->fs->super))) {\n\t\t\terr = EXT2_ET_BAD_EA_BLOCK_NUM;\n\t\t\tgoto out;\n\t\t}\n\n\t\terr = ext2fs_get_mem(handle->fs->blocksize, &block_buf);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\terr = ext2fs_read_ext_attr3(handle->fs, blk, block_buf,\n\t\t\t\t\t    handle->ino);\n\t\tif (err)\n\t\t\tgoto out3;\n\n\t\t/* We only know how to deal with v2 EA blocks */\n\t\theader = (struct ext2_ext_attr_header *) block_buf;\n\t\tif (header->h_magic != EXT2_EXT_ATTR_MAGIC) {\n\t\t\terr = EXT2_ET_BAD_EA_HEADER;\n\t\t\tgoto out3;\n\t\t}\n\n\t\t/* Read EAs */\n\t\tstorage_size = handle->fs->blocksize -\n\t\t\tsizeof(struct ext2_ext_attr_header);\n\t\tstart = block_buf + sizeof(struct ext2_ext_attr_header);\n\t\terr = read_xattrs_from_buffer(handle, inode,\n\t\t\t\t\t(struct ext2_ext_attr_entry *) start,\n\t\t\t\t\tstorage_size, block_buf);\n\t\tif (err)\n\t\t\tgoto out3;\n\n\t\text2fs_free_mem(&block_buf);\n\t}\n\n\text2fs_free_mem(&block_buf);\n\text2fs_free_mem(&inode);\n\treturn 0;\n\nout3:\n\text2fs_free_mem(&block_buf);\nout:\n\text2fs_free_mem(&inode);\n\treturn err;\n}\n\nerrcode_t ext2fs_xattrs_iterate(struct ext2_xattr_handle *h,\n\t\t\t\tint (*func)(char *name, char *value,\n\t\t\t\t\t    size_t value_len, void *data),\n\t\t\t\tvoid *data)\n{\n\tstruct ext2_xattr *x;\n\tint dirty = 0;\n\tint ret;\n\n\tEXT2_CHECK_MAGIC(h, EXT2_ET_MAGIC_EA_HANDLE);\n\tfor (x = h->attrs; x < h->attrs + h->count; x++) {\n\t\tret = func(x->name, x->value, x->value_len, data);\n\t\tif (ret & XATTR_CHANGED)\n\t\t\tdirty = 1;\n\t\tif (ret & XATTR_ABORT)\n\t\t\tbreak;\n\t}\n\n\tif (dirty)\n\t\treturn ext2fs_xattrs_write(h);\n\treturn 0;\n}\n\nerrcode_t ext2fs_xattr_get(struct ext2_xattr_handle *h, const char *key,\n\t\t\t   void **value, size_t *value_len)\n{\n\tstruct ext2_xattr *x;\n\tchar *val;\n\terrcode_t err;\n\n\tEXT2_CHECK_MAGIC(h, EXT2_ET_MAGIC_EA_HANDLE);\n\tfor (x = h->attrs; x < h->attrs + h->count; x++) {\n\t\tif (strcmp(x->name, key))\n\t\t\tcontinue;\n\n\t\tif (!(h->flags & XATTR_HANDLE_FLAG_RAW) &&\n\t\t    ((strcmp(key, \"system.posix_acl_default\") == 0) ||\n\t\t     (strcmp(key, \"system.posix_acl_access\") == 0))) {\n\t\t\terr = convert_disk_buffer_to_posix_acl(x->value, x->value_len,\n\t\t\t\t\t\t\t       value, value_len);\n\t\t\treturn err;\n\t\t} else {\n\t\t\terr = ext2fs_get_mem(x->value_len, &val);\n\t\t\tif (err)\n\t\t\t\treturn err;\n\t\t\tmemcpy(val, x->value, x->value_len);\n\t\t\t*value = val;\n\t\t\t*value_len = x->value_len;\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\treturn EXT2_ET_EA_KEY_NOT_FOUND;\n}\n\nerrcode_t ext2fs_xattr_inode_max_size(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t      size_t *size)\n{\n\tstruct ext2_ext_attr_entry *entry;\n\tstruct ext2_inode_large *inode;\n\t__u32 ea_inode_magic;\n\tunsigned int minoff;\n\tchar *start;\n\tsize_t i;\n\terrcode_t err;\n\n\ti = EXT2_INODE_SIZE(fs->super);\n\tif (i < sizeof(*inode))\n\t\ti = sizeof(*inode);\n\terr = ext2fs_get_memzero(i, &inode);\n\tif (err)\n\t\treturn err;\n\n\terr = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)inode,\n\t\t\t\t     EXT2_INODE_SIZE(fs->super));\n\tif (err)\n\t\tgoto out;\n\n\t/* Does the inode have size for EA? */\n\tif (EXT2_INODE_SIZE(fs->super) <= EXT2_GOOD_OLD_INODE_SIZE +\n\t\t\t\t\t\t  inode->i_extra_isize +\n\t\t\t\t\t\t  sizeof(__u32)) {\n\t\terr = EXT2_ET_INLINE_DATA_NO_SPACE;\n\t\tgoto out;\n\t}\n\n\tminoff = EXT2_INODE_SIZE(fs->super) - sizeof(*inode) - sizeof(__u32);\n\tmemcpy(&ea_inode_magic, ((char *) inode) + EXT2_GOOD_OLD_INODE_SIZE +\n\t       inode->i_extra_isize, sizeof(__u32));\n\tif (ea_inode_magic == EXT2_EXT_ATTR_MAGIC) {\n\t\t/* has xattrs.  calculate the size */\n\t\tstart= ((char *) inode) + EXT2_GOOD_OLD_INODE_SIZE +\n\t\t\tinode->i_extra_isize + sizeof(__u32);\n\t\tentry = (struct ext2_ext_attr_entry *) start;\n\t\twhile (!EXT2_EXT_IS_LAST_ENTRY(entry)) {\n\t\t\tif (!entry->e_value_inum && entry->e_value_size) {\n\t\t\t\tunsigned int offs = entry->e_value_offs;\n\t\t\t\tif (offs < minoff)\n\t\t\t\t\tminoff = offs;\n\t\t\t}\n\t\t\tentry = EXT2_EXT_ATTR_NEXT(entry);\n\t\t}\n\t\t*size = minoff - ((char *)entry - (char *)start) - sizeof(__u32);\n\t} else {\n\t\t/* no xattr.  return a maximum size */\n\t\t*size = EXT2_EXT_ATTR_SIZE(minoff -\n\t\t\t\t\t   EXT2_EXT_ATTR_LEN(strlen(\"data\")) -\n\t\t\t\t\t   EXT2_EXT_ATTR_ROUND - sizeof(__u32));\n\t}\n\nout:\n\text2fs_free_mem(&inode);\n\treturn err;\n}\n\nstatic errcode_t xattr_create_ea_inode(ext2_filsys fs, const void *value,\n\t\t\t\t       size_t value_len, ext2_ino_t *ea_ino)\n{\n\tstruct ext2_inode inode;\n\text2_ino_t ino;\n\text2_file_t file;\n\t__u32 hash;\n\terrcode_t ret;\n\n\tret = ext2fs_new_inode(fs, 0, 0, 0, &ino);\n\tif (ret)\n\t\treturn ret;\n\n\tmemset(&inode, 0, sizeof(inode));\n\tinode.i_flags |= EXT4_EA_INODE_FL;\n\tif (ext2fs_has_feature_extents(fs->super))\n\t\tinode.i_flags |= EXT4_EXTENTS_FL;\n\tinode.i_size = 0;\n\tinode.i_mode = LINUX_S_IFREG | 0600;\n\tinode.i_links_count = 1;\n\tret = ext2fs_write_new_inode(fs, ino, &inode);\n\tif (ret)\n\t\treturn ret;\n\t/*\n\t * ref_count and hash utilize inode's i_*time fields.\n\t * ext2fs_write_new_inode() call above initializes these fields with\n\t * current time. That's why ref count and hash updates are done\n\t * separately below.\n\t */\n\text2fs_set_ea_inode_ref(&inode, 1);\n\thash = ext2fs_crc32c_le(fs->csum_seed, value, value_len);\n\text2fs_set_ea_inode_hash(&inode, hash);\n\n\tret = ext2fs_write_inode(fs, ino, &inode);\n\tif (ret)\n\t\treturn ret;\n\n\tret = ext2fs_file_open(fs, ino, EXT2_FILE_WRITE, &file);\n\tif (ret)\n\t\treturn ret;\n\tret = ext2fs_file_write(file, value, value_len, NULL);\n\text2fs_file_close(file);\n\tif (ret)\n\t\treturn ret;\n\n\text2fs_inode_alloc_stats2(fs, ino, 1 /* inuse */, 0 /* isdir */);\n\n\t*ea_ino = ino;\n\treturn 0;\n}\n\nstatic errcode_t xattr_inode_dec_ref(ext2_filsys fs, ext2_ino_t ino)\n{\n\tstruct ext2_inode_large inode;\n\t__u64 ref_count;\n\terrcode_t ret;\n\n\tret = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode,\n\t\t\t\t     sizeof(inode));\n\tif (ret)\n\t\tgoto out;\n\n\tref_count = ext2fs_get_ea_inode_ref(EXT2_INODE(&inode));\n\tref_count--;\n\text2fs_set_ea_inode_ref(EXT2_INODE(&inode), ref_count);\n\n\tif (ref_count)\n\t\tgoto write_out;\n\n\tinode.i_links_count = 0;\n\tinode.i_dtime = fs->now ? fs->now : time(0);\n\n\tret = ext2fs_free_ext_attr(fs, ino, &inode);\n\tif (ret)\n\t\tgoto write_out;\n\n\tif (ext2fs_inode_has_valid_blocks2(fs, (struct ext2_inode *)&inode)) {\n\t\tret = ext2fs_punch(fs, ino, (struct ext2_inode *)&inode, NULL,\n\t\t\t\t   0, ~0ULL);\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\n\text2fs_inode_alloc_stats2(fs, ino, -1 /* inuse */, 0 /* is_dir */);\n\nwrite_out:\n\tret = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode,\n\t\t\t\t      sizeof(inode));\nout:\n\treturn ret;\n}\n\nstatic errcode_t xattr_update_entry(ext2_filsys fs, struct ext2_xattr *x,\n\t\t\t\t    const char *name, const void *value,\n\t\t\t\t    size_t value_len, int in_inode)\n{\n\text2_ino_t ea_ino = 0;\n\tvoid *new_value = NULL;\n\tchar *new_name = NULL;\n\tint name_len;\n\terrcode_t ret;\n\n\tif (!x->name) {\n\t\tname_len = strlen(name);\n\t\tret = ext2fs_get_mem(name_len + 1, &new_name);\n\t\tif (ret)\n\t\t\tgoto fail;\n\t\tmemcpy(new_name, name, name_len + 1);\n\t}\n\n\tret = ext2fs_get_mem(value_len, &new_value);\n\tif (ret)\n\t\tgoto fail;\n\tmemcpy(new_value, value, value_len);\n\n\tif (in_inode) {\n\t\tret = xattr_create_ea_inode(fs, value, value_len, &ea_ino);\n\t\tif (ret)\n\t\t\tgoto fail;\n\t}\n\n\tif (x->ea_ino) {\n\t\tret = xattr_inode_dec_ref(fs, x->ea_ino);\n\t\tif (ret)\n\t\t\tgoto fail;\n\t}\n\n\tif (!x->name)\n\t\tx->name = new_name;\n\n\tif (x->value)\n\t\text2fs_free_mem(&x->value);\n\tx->value = new_value;\n\tx->value_len = value_len;\n\tx->ea_ino = ea_ino;\n\treturn 0;\nfail:\n\tif (new_name)\n\t\text2fs_free_mem(&new_name);\n\tif (new_value)\n\t\text2fs_free_mem(&new_value);\n\tif (ea_ino)\n\t\txattr_inode_dec_ref(fs, ea_ino);\n\treturn ret;\n}\n\nstatic int xattr_find_position(struct ext2_xattr *attrs, int count,\n\t\t\t       const char *name)\n{\n\tstruct ext2_xattr *x;\n\tint i;\n\tconst char *shortname, *x_shortname;\n\tint name_idx, x_name_idx;\n\tint shortname_len, x_shortname_len;\n\n\tfind_ea_index(name, &shortname, &name_idx);\n\tshortname_len = strlen(shortname);\n\n\tfor (i = 0, x = attrs; i < count; i++, x++) {\n\t\tfind_ea_index(x->name, &x_shortname, &x_name_idx);\n\t\tif (name_idx < x_name_idx)\n\t\t\tbreak;\n\t\tif (name_idx > x_name_idx)\n\t\t\tcontinue;\n\n\t\tx_shortname_len = strlen(x_shortname);\n\t\tif (shortname_len < x_shortname_len)\n\t\t\tbreak;\n\t\tif (shortname_len > x_shortname_len)\n\t\t\tcontinue;\n\n\t\tif (memcmp(shortname, x_shortname, shortname_len) <= 0)\n\t\t\tbreak;\n\t}\n\treturn i;\n}\n\nstatic errcode_t xattr_array_update(struct ext2_xattr_handle *h,\n\t\t\t\t    const char *name,\n\t\t\t\t    const void *value, size_t value_len,\n\t\t\t\t    int ibody_free, int block_free,\n\t\t\t\t    int old_idx, int in_inode)\n{\n\tstruct ext2_xattr tmp;\n\tint add_to_ibody;\n\tint needed;\n\tint name_len, name_idx;\n\tconst char *shortname;\n\tint new_idx;\n\tint ret;\n\n\tfind_ea_index(name, &shortname, &name_idx);\n\tname_len = strlen(shortname);\n\n\tneeded = EXT2_EXT_ATTR_LEN(name_len);\n\tif (!in_inode)\n\t\tneeded += EXT2_EXT_ATTR_SIZE(value_len);\n\n\tif (old_idx >= 0 && old_idx < h->ibody_count) {\n\t\tibody_free += EXT2_EXT_ATTR_LEN(name_len);\n\t\tif (!h->attrs[old_idx].ea_ino)\n\t\t\tibody_free += EXT2_EXT_ATTR_SIZE(\n\t\t\t\t\t\th->attrs[old_idx].value_len);\n\t}\n\n\tif (needed <= ibody_free) {\n\t\tif (old_idx < 0) {\n\t\t\tnew_idx = h->ibody_count;\n\t\t\tadd_to_ibody = 1;\n\t\t\tgoto add_new;\n\t\t}\n\n\t\t/* Update the existing entry. */\n\t\tret = xattr_update_entry(h->fs, &h->attrs[old_idx], name,\n\t\t\t\t\t value, value_len, in_inode);\n\t\tif (ret)\n\t\t\treturn ret;\n\t\tif (h->ibody_count <= old_idx) {\n\t\t\t/* Move entry from block to the end of ibody. */\n\t\t\ttmp = h->attrs[old_idx];\n\t\t\tmemmove(h->attrs + h->ibody_count + 1,\n\t\t\t\th->attrs + h->ibody_count,\n\t\t\t\t(old_idx - h->ibody_count) * sizeof(*h->attrs));\n\t\t\th->attrs[h->ibody_count] = tmp;\n\t\t\th->ibody_count++;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tif (old_idx >= 0 && h->ibody_count <= old_idx) {\n\t\tblock_free += EXT2_EXT_ATTR_LEN(name_len);\n\t\tif (!h->attrs[old_idx].ea_ino)\n\t\t\tblock_free +=\n\t\t\t\tEXT2_EXT_ATTR_SIZE(h->attrs[old_idx].value_len);\n\t}\n\n\tif (needed > block_free)\n\t\treturn EXT2_ET_EA_NO_SPACE;\n\n\tif (old_idx >= 0) {\n\t\t/* Update the existing entry. */\n\t\tret = xattr_update_entry(h->fs, &h->attrs[old_idx], name,\n\t\t\t\t\t value, value_len, in_inode);\n\t\tif (ret)\n\t\t\treturn ret;\n\t\tif (old_idx < h->ibody_count) {\n\t\t\t/*\n\t\t\t * Move entry from ibody to the block. Note that\n\t\t\t * entries in the block are sorted.\n\t\t\t */\n\t\t\tnew_idx = xattr_find_position(h->attrs + h->ibody_count,\n\t\t\t\th->count - h->ibody_count, name);\n\t\t\tnew_idx += h->ibody_count - 1;\n\t\t\ttmp = h->attrs[old_idx];\n\t\t\tmemmove(h->attrs + old_idx, h->attrs + old_idx + 1,\n\t\t\t\t(new_idx - old_idx) * sizeof(*h->attrs));\n\t\t\th->attrs[new_idx] = tmp;\n\t\t\th->ibody_count--;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tnew_idx = xattr_find_position(h->attrs + h->ibody_count,\n\t\t\t\t      h->count - h->ibody_count, name);\n\tnew_idx += h->ibody_count;\n\tadd_to_ibody = 0;\n\nadd_new:\n\tif (h->count == h->capacity) {\n\t\tret = ext2fs_xattrs_expand(h, 4);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tret = xattr_update_entry(h->fs, &h->attrs[h->count], name, value,\n\t\t\t\t value_len, in_inode);\n\tif (ret)\n\t\treturn ret;\n\n\ttmp = h->attrs[h->count];\n\tmemmove(h->attrs + new_idx + 1, h->attrs + new_idx,\n\t\t(h->count - new_idx)*sizeof(*h->attrs));\n\th->attrs[new_idx] = tmp;\n\tif (add_to_ibody)\n\t\th->ibody_count++;\n\th->count++;\n\treturn 0;\n}\n\nstatic int space_used(struct ext2_xattr *attrs, int count)\n{\n\tint total = 0;\n\tstruct ext2_xattr *x;\n\tconst char *shortname;\n\tint i, len, name_idx;\n\n\tfor (i = 0, x = attrs; i < count; i++, x++) {\n\t\tfind_ea_index(x->name, &shortname, &name_idx);\n\t\tlen = strlen(shortname);\n\t\ttotal += EXT2_EXT_ATTR_LEN(len);\n\t\tif (!x->ea_ino)\n\t\t\ttotal += EXT2_EXT_ATTR_SIZE(x->value_len);\n\t}\n\treturn total;\n}\n\n/*\n * The minimum size of EA value when you start storing it in an external inode\n * size of block - size of header - size of 1 entry - 4 null bytes\n */\n#define EXT4_XATTR_MIN_LARGE_EA_SIZE(b)\t\\\n\t((b) - EXT2_EXT_ATTR_LEN(3) - sizeof(struct ext2_ext_attr_header) - 4)\n\nerrcode_t ext2fs_xattr_set(struct ext2_xattr_handle *h,\n\t\t\t   const char *name,\n\t\t\t   const void *value,\n\t\t\t   size_t value_len)\n{\n\text2_filsys fs = h->fs;\n\tconst int inode_size = EXT2_INODE_SIZE(fs->super);\n\tstruct ext2_inode_large *inode = NULL;\n\tstruct ext2_xattr *x;\n\tchar *new_value;\n\tint ibody_free, block_free;\n\tint in_inode = 0;\n\tint old_idx = -1;\n\tint extra_isize;\n\terrcode_t ret;\n\n\tEXT2_CHECK_MAGIC(h, EXT2_ET_MAGIC_EA_HANDLE);\n\n\tret = ext2fs_get_mem(value_len, &new_value);\n\tif (ret)\n\t\treturn ret;\n\tif (!(h->flags & XATTR_HANDLE_FLAG_RAW) &&\n\t    ((strcmp(name, \"system.posix_acl_default\") == 0) ||\n\t     (strcmp(name, \"system.posix_acl_access\") == 0))) {\n\t\tret = convert_posix_acl_to_disk_buffer(value, value_len,\n\t\t\t\t\t\t       new_value, &value_len);\n\t\tif (ret)\n\t\t\tgoto out;\n\t} else if (value_len)\n\t\tmemcpy(new_value, value, value_len);\n\n\t/* Imitate kernel behavior by skipping update if value is the same. */\n\tfor (x = h->attrs; x < h->attrs + h->count; x++) {\n\t\tif (!strcmp(x->name, name)) {\n\t\t\tif (!x->ea_ino && x->value_len == value_len &&\n\t\t\t    (!value_len ||\n\t\t\t     !memcmp(x->value, new_value, value_len))) {\n\t\t\t\tret = 0;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\told_idx = x - h->attrs;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tret = ext2fs_get_memzero(inode_size, &inode);\n\tif (ret)\n\t\tgoto out;\n\tret = ext2fs_read_inode_full(fs, h->ino,\n\t\t\t\t     (struct ext2_inode *)inode,\n\t\t\t\t     inode_size);\n\tif (ret)\n\t\tgoto out;\n\tif (inode_size > EXT2_GOOD_OLD_INODE_SIZE) {\n\t\textra_isize = inode->i_extra_isize;\n\t\tif (extra_isize == 0) {\n\t\t\textra_isize = fs->super->s_want_extra_isize;\n\t\t\tif (extra_isize == 0)\n\t\t\t\textra_isize = sizeof(__u32);\n\t\t}\n\t\tibody_free = inode_size - EXT2_GOOD_OLD_INODE_SIZE;\n\t\tibody_free -= extra_isize;\n\t\t/* Extended attribute magic and final null entry. */\n\t\tibody_free -= sizeof(__u32) * 2;\n\t\tibody_free -= space_used(h->attrs, h->ibody_count);\n\t} else\n\t\tibody_free = 0;\n\n\t/* Inline data can only go to ibody. */\n\tif (strcmp(name, \"system.data\") == 0) {\n\t\tif (h->ibody_count <= old_idx) {\n\t\t\tret = EXT2_ET_FILESYSTEM_CORRUPTED;\n\t\t\tgoto out;\n\t\t}\n\t\tret = xattr_array_update(h, name, new_value, value_len,\n\t\t\t\t\t ibody_free,\n\t\t\t\t\t 0 /* block_free */, old_idx,\n\t\t\t\t\t 0 /* in_inode */);\n\t\tif (ret)\n\t\t\tgoto out;\n\t\tgoto write_out;\n\t}\n\n\tblock_free = fs->blocksize;\n\tblock_free -= sizeof(struct ext2_ext_attr_header);\n\t/* Final null entry. */\n\tblock_free -= sizeof(__u32);\n\tblock_free -= space_used(h->attrs + h->ibody_count,\n\t\t\t\t h->count - h->ibody_count);\n\n\tif (ext2fs_has_feature_ea_inode(fs->super) &&\n\t    value_len > EXT4_XATTR_MIN_LARGE_EA_SIZE(fs->blocksize))\n\t\tin_inode = 1;\n\n\tret = xattr_array_update(h, name, new_value, value_len, ibody_free,\n\t\t\t\t block_free, old_idx, in_inode);\n\tif (ret == EXT2_ET_EA_NO_SPACE && !in_inode &&\n\t    ext2fs_has_feature_ea_inode(fs->super))\n\t\tret = xattr_array_update(h, name, new_value, value_len,\n\t\t\tibody_free, block_free, old_idx, 1 /* in_inode */);\n\tif (ret)\n\t\tgoto out;\n\nwrite_out:\n\tret = ext2fs_xattrs_write(h);\nout:\n\tif (inode)\n\t\text2fs_free_mem(&inode);\n\text2fs_free_mem(&new_value);\n\treturn ret;\n}\n\nerrcode_t ext2fs_xattr_remove(struct ext2_xattr_handle *handle,\n\t\t\t      const char *key)\n{\n\tstruct ext2_xattr *x;\n\tstruct ext2_xattr *end = handle->attrs + handle->count;\n\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EA_HANDLE);\n\tfor (x = handle->attrs; x < end; x++) {\n\t\tif (strcmp(x->name, key) == 0) {\n\t\t\text2fs_free_mem(&x->name);\n\t\t\text2fs_free_mem(&x->value);\n\t\t\tif (x->ea_ino)\n\t\t\t\txattr_inode_dec_ref(handle->fs, x->ea_ino);\n\t\t\tmemmove(x, x + 1, (end - x - 1)*sizeof(*x));\n\t\t\tmemset(end - 1, 0, sizeof(*end));\n\t\t\tif (x < handle->attrs + handle->ibody_count)\n\t\t\t\thandle->ibody_count--;\n\t\t\thandle->count--;\n\t\t\treturn ext2fs_xattrs_write(handle);\n\t\t}\n\t}\n\n\t/* no key found, success! */\n\treturn 0;\n}\n\nerrcode_t ext2fs_xattrs_open(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t     struct ext2_xattr_handle **handle)\n{\n\tstruct ext2_xattr_handle *h;\n\terrcode_t err;\n\n\tif (!ext2fs_has_feature_xattr(fs->super) &&\n\t    !ext2fs_has_feature_inline_data(fs->super))\n\t\treturn EXT2_ET_MISSING_EA_FEATURE;\n\n\terr = ext2fs_get_memzero(sizeof(*h), &h);\n\tif (err)\n\t\treturn err;\n\n\th->magic = EXT2_ET_MAGIC_EA_HANDLE;\n\th->capacity = 4;\n\terr = ext2fs_get_arrayzero(h->capacity, sizeof(struct ext2_xattr),\n\t\t\t\t   &h->attrs);\n\tif (err) {\n\t\text2fs_free_mem(&h);\n\t\treturn err;\n\t}\n\th->count = 0;\n\th->ino = ino;\n\th->fs = fs;\n\t*handle = h;\n\treturn 0;\n}\n\nerrcode_t ext2fs_xattrs_close(struct ext2_xattr_handle **handle)\n{\n\tstruct ext2_xattr_handle *h = *handle;\n\n\tEXT2_CHECK_MAGIC(h, EXT2_ET_MAGIC_EA_HANDLE);\n\txattrs_free_keys(h);\n\text2fs_free_mem(&h->attrs);\n\text2fs_free_mem(handle);\n\treturn 0;\n}\n\nerrcode_t ext2fs_xattrs_count(struct ext2_xattr_handle *handle, size_t *count)\n{\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EA_HANDLE);\n\t*count = handle->count;\n\treturn 0;\n}\n\nerrcode_t ext2fs_xattrs_flags(struct ext2_xattr_handle *handle,\n\t\t\t      unsigned int *new_flags, unsigned int *old_flags)\n{\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EA_HANDLE);\n\tif (old_flags)\n\t\t*old_flags = handle->flags;\n\tif (new_flags)\n\t\thandle->flags = *new_flags;\n\treturn 0;\n}\n"
  },
  {
    "path": "src/ext2fs/extent.c",
    "content": "/*\n * extent.c --- routines to implement extents support\n *\n * Copyright (C) 2007 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#if HAVE_ERRNO_H\n#include <errno.h>\n#endif\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n#include \"e2image.h\"\n\n#undef DEBUG\n\n/*\n * Definitions to be dropped in lib/ext2fs/ext2fs.h\n */\n\n/*\n * Private definitions\n */\n\nstruct extent_path {\n\tchar\t\t*buf;\n\tint\t\tentries;\n\tint\t\tmax_entries;\n\tint\t\tleft;\n\tint\t\tvisit_num;\n\tint\t\tflags;\n\tblk64_t\t\tend_blk;\n\tvoid\t\t*curr;\n};\n\n\nstruct ext2_extent_handle {\n\terrcode_t\t\tmagic;\n\text2_filsys\t\tfs;\n\text2_ino_t \t\tino;\n\tstruct ext2_inode\t*inode;\n\tstruct ext2_inode\tinodebuf;\n\tint\t\t\ttype;\n\tint\t\t\tlevel;\n\tint\t\t\tmax_depth;\n\tint\t\t\tmax_paths;\n\tstruct extent_path\t*path;\n};\n\nstruct ext2_extent_path {\n\terrcode_t\t\tmagic;\n\tint\t\t\tleaf_height;\n\tblk64_t\t\t\tlblk;\n};\n\n/*\n *  Useful Debugging stuff\n */\n\n#ifdef DEBUG\nstatic void dbg_show_header(struct ext3_extent_header *eh)\n{\n\tprintf(\"header: magic=%x entries=%u max=%u depth=%u generation=%u\\n\",\n\t\t\text2fs_le16_to_cpu(eh->eh_magic),\n\t\t\text2fs_le16_to_cpu(eh->eh_entries),\n\t\t\text2fs_le16_to_cpu(eh->eh_max),\n\t\t\text2fs_le16_to_cpu(eh->eh_depth),\n\t\t\text2fs_le32_to_cpu(eh->eh_generation));\n}\n\nstatic void dbg_show_index(struct ext3_extent_idx *ix)\n{\n\tprintf(\"index: block=%u leaf=%u leaf_hi=%u unused=%u\\n\",\n\t\t\text2fs_le32_to_cpu(ix->ei_block),\n\t\t\text2fs_le32_to_cpu(ix->ei_leaf),\n\t\t\text2fs_le16_to_cpu(ix->ei_leaf_hi),\n\t\t\text2fs_le16_to_cpu(ix->ei_unused));\n}\n\nstatic void dbg_show_extent(struct ext3_extent *ex)\n{\n\tprintf(\"extent: block=%u-%u len=%u start=%u start_hi=%u\\n\",\n\t\t\text2fs_le32_to_cpu(ex->ee_block),\n\t\t\text2fs_le32_to_cpu(ex->ee_block) +\n\t\t\text2fs_le16_to_cpu(ex->ee_len) - 1,\n\t\t\text2fs_le16_to_cpu(ex->ee_len),\n\t\t\text2fs_le32_to_cpu(ex->ee_start),\n\t\t\text2fs_le16_to_cpu(ex->ee_start_hi));\n}\n\nstatic void dbg_print_extent(char *desc, struct ext2fs_extent *extent)\n{\n\tif (desc)\n\t\tprintf(\"%s: \", desc);\n\tprintf(\"extent: lblk %llu--%llu, len %u, pblk %llu, flags: \",\n\t       extent->e_lblk, extent->e_lblk + extent->e_len - 1,\n\t       extent->e_len, extent->e_pblk);\n\tif (extent->e_flags & EXT2_EXTENT_FLAGS_LEAF)\n\t\tfputs(\"LEAF \", stdout);\n\tif (extent->e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\tfputs(\"UNINIT \", stdout);\n\tif (extent->e_flags & EXT2_EXTENT_FLAGS_SECOND_VISIT)\n\t\tfputs(\"2ND_VISIT \", stdout);\n\tif (!extent->e_flags)\n\t\tfputs(\"(none)\", stdout);\n\tfputc('\\n', stdout);\n\n}\n\nstatic void dump_path(const char *tag, struct ext2_extent_handle *handle,\n\t\t      struct extent_path *path)\n{\n\tstruct extent_path *ppp = path;\n\tprintf(\"%s: level=%d\\n\", tag, handle->level);\n\n\tdo {\n\t\tprintf(\"%s: path=%ld buf=%p entries=%d max_entries=%d left=%d \"\n\t\t       \"visit_num=%d flags=0x%x end_blk=%llu curr=%p(%ld)\\n\",\n\t\t       tag, (ppp - handle->path), ppp->buf, ppp->entries,\n\t\t       ppp->max_entries, ppp->left, ppp->visit_num, ppp->flags,\n\t\t       ppp->end_blk, ppp->curr, ppp->curr - (void *)ppp->buf);\n\t\tprintf(\"  \");\n\t\tdbg_show_header((struct ext3_extent_header *)ppp->buf);\n\t\tif (ppp->curr) {\n\t\t\tprintf(\"  \");\n\t\t\tdbg_show_index(ppp->curr);\n\t\t\tprintf(\"  \");\n\t\t\tdbg_show_extent(ppp->curr);\n\t\t}\n\t\tppp--;\n\t} while (ppp >= handle->path);\n\tfflush(stdout);\n\n\treturn;\n}\n\n#else\n#define dbg_show_header(eh) do { } while (0)\n#define dbg_show_index(ix) do { } while (0)\n#define dbg_show_extent(ex) do { } while (0)\n#define dbg_print_extent(desc, ex) do { } while (0)\n#define dump_path(tag, handle, path) do { } while (0)\n#endif\n\n/*\n * Verify the extent header as being sane\n */\nerrcode_t ext2fs_extent_header_verify(void *ptr, int size)\n{\n\tint eh_max, entry_size;\n\tstruct ext3_extent_header *eh = ptr;\n\n\tdbg_show_header(eh);\n\tif (ext2fs_le16_to_cpu(eh->eh_magic) != EXT3_EXT_MAGIC)\n\t\treturn EXT2_ET_EXTENT_HEADER_BAD;\n\tif (ext2fs_le16_to_cpu(eh->eh_entries) > ext2fs_le16_to_cpu(eh->eh_max))\n\t\treturn EXT2_ET_EXTENT_HEADER_BAD;\n\tif (eh->eh_depth == 0)\n\t\tentry_size = sizeof(struct ext3_extent);\n\telse\n\t\tentry_size = sizeof(struct ext3_extent_idx);\n\n\teh_max = (size - sizeof(*eh)) / entry_size;\n\t/* Allow two extent-sized items at the end of the block, for\n\t * ext4_extent_tail with checksum in the future. */\n\tif ((ext2fs_le16_to_cpu(eh->eh_max) > eh_max) ||\n\t    (ext2fs_le16_to_cpu(eh->eh_max) < (eh_max - 2)))\n\t\treturn EXT2_ET_EXTENT_HEADER_BAD;\n\n\treturn 0;\n}\n\n\n/*\n * Begin functions to handle an inode's extent information\n */\nvoid ext2fs_extent_free(ext2_extent_handle_t handle)\n{\n\tint\t\t\ti;\n\n\tif (!handle)\n\t\treturn;\n\n\tif (handle->path) {\n\t\tfor (i = 1; i < handle->max_paths; i++) {\n\t\t\tif (handle->path[i].buf)\n\t\t\t\text2fs_free_mem(&handle->path[i].buf);\n\t\t}\n\t\text2fs_free_mem(&handle->path);\n\t}\n\text2fs_free_mem(&handle);\n}\n\nerrcode_t ext2fs_extent_open(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t    ext2_extent_handle_t *ret_handle)\n{\n\treturn ext2fs_extent_open2(fs, ino, NULL, ret_handle);\n}\n\nerrcode_t ext2fs_extent_open2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t    struct ext2_inode *inode,\n\t\t\t\t    ext2_extent_handle_t *ret_handle)\n{\n\tstruct ext2_extent_handle\t*handle;\n\terrcode_t\t\t\tretval;\n\tint\t\t\t\ti;\n\tstruct ext3_extent_header\t*eh;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif (!inode)\n\t\tif ((ino == 0) || (ino > fs->super->s_inodes_count))\n\t\t\treturn EXT2_ET_BAD_INODE_NUM;\n\n\tretval = ext2fs_get_mem(sizeof(struct ext2_extent_handle), &handle);\n\tif (retval)\n\t\treturn retval;\n\tmemset(handle, 0, sizeof(struct ext2_extent_handle));\n\n\thandle->ino = ino;\n\thandle->fs = fs;\n\n\tif (inode) {\n\t\thandle->inode = inode;\n\t} else {\n\t\thandle->inode = &handle->inodebuf;\n\t\tretval = ext2fs_read_inode(fs, ino, handle->inode);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t}\n\n\teh = (struct ext3_extent_header *) &handle->inode->i_block[0];\n\n\tfor (i=0; i < EXT2_N_BLOCKS; i++)\n\t\tif (handle->inode->i_block[i])\n\t\t\tbreak;\n\tif (i >= EXT2_N_BLOCKS) {\n\t\teh->eh_magic = ext2fs_cpu_to_le16(EXT3_EXT_MAGIC);\n\t\teh->eh_depth = 0;\n\t\teh->eh_entries = 0;\n\t\ti = (sizeof(handle->inode->i_block) - sizeof(*eh)) /\n\t\t\tsizeof(struct ext3_extent);\n\t\teh->eh_max = ext2fs_cpu_to_le16(i);\n\t\thandle->inode->i_flags |= EXT4_EXTENTS_FL;\n\t}\n\n\tif (!(handle->inode->i_flags & EXT4_EXTENTS_FL)) {\n\t\tretval = EXT2_ET_INODE_NOT_EXTENT;\n\t\tgoto errout;\n\t}\n\n\tretval = ext2fs_extent_header_verify(eh, sizeof(handle->inode->i_block));\n\tif (retval)\n\t\tgoto errout;\n\n\thandle->max_depth = ext2fs_le16_to_cpu(eh->eh_depth);\n\thandle->type = ext2fs_le16_to_cpu(eh->eh_magic);\n\n\thandle->max_paths = handle->max_depth + 1;\n\tretval = ext2fs_get_memzero(handle->max_paths *\n\t\t\t\t    sizeof(struct extent_path),\n\t\t\t\t    &handle->path);\n\thandle->path[0].buf = (char *) handle->inode->i_block;\n\n\thandle->path[0].left = handle->path[0].entries =\n\t\text2fs_le16_to_cpu(eh->eh_entries);\n\thandle->path[0].max_entries = ext2fs_le16_to_cpu(eh->eh_max);\n\thandle->path[0].curr = 0;\n\thandle->path[0].end_blk =\n\t\t(EXT2_I_SIZE(handle->inode) + fs->blocksize - 1) >>\n\t\t EXT2_BLOCK_SIZE_BITS(fs->super);\n\thandle->path[0].visit_num = 1;\n\thandle->level = 0;\n\thandle->magic = EXT2_ET_MAGIC_EXTENT_HANDLE;\n\n\t*ret_handle = handle;\n\treturn 0;\n\nerrout:\n\text2fs_extent_free(handle);\n\treturn retval;\n}\n\n/*\n * This function is responsible for (optionally) moving through the\n * extent tree and then returning the current extent\n */\nerrcode_t ext2fs_extent_get(ext2_extent_handle_t handle,\n\t\t\t    int flags, struct ext2fs_extent *extent)\n{\n\tstruct extent_path\t*path, *newpath;\n\tstruct ext3_extent_header\t*eh;\n\tstruct ext3_extent_idx\t\t*ix = 0;\n\tstruct ext3_extent\t\t*ex;\n\terrcode_t\t\t\tretval;\n\tblk64_t\t\t\t\tblk;\n\tblk64_t\t\t\t\tend_blk;\n\tint\t\t\t\torig_op, op;\n\tint\t\t\t\tfailed_csum = 0;\n\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EXTENT_HANDLE);\n\n\tif (!handle->path)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n\torig_op = op = flags & EXT2_EXTENT_MOVE_MASK;\n\nretry:\n\tpath = handle->path + handle->level;\n\tif ((orig_op == EXT2_EXTENT_NEXT) ||\n\t    (orig_op == EXT2_EXTENT_NEXT_LEAF)) {\n\t\tif (handle->level < handle->max_depth) {\n\t\t\t/* interior node */\n\t\t\tif (path->visit_num == 0) {\n\t\t\t\tpath->visit_num++;\n\t\t\t\top = EXT2_EXTENT_DOWN;\n\t\t\t} else if (path->left > 0)\n\t\t\t\top = EXT2_EXTENT_NEXT_SIB;\n\t\t\telse if (handle->level > 0)\n\t\t\t\top = EXT2_EXTENT_UP;\n\t\t\telse\n\t\t\t\treturn EXT2_ET_EXTENT_NO_NEXT;\n\t\t} else {\n\t\t\t/* leaf node */\n\t\t\tif (path->left > 0)\n\t\t\t\top = EXT2_EXTENT_NEXT_SIB;\n\t\t\telse if (handle->level > 0)\n\t\t\t\top = EXT2_EXTENT_UP;\n\t\t\telse\n\t\t\t\treturn EXT2_ET_EXTENT_NO_NEXT;\n\t\t}\n\t\tif (op != EXT2_EXTENT_NEXT_SIB) {\n#ifdef DEBUG_GET_EXTENT\n\t\t\tprintf(\"<<<< OP = %s\\n\",\n\t\t\t       (op == EXT2_EXTENT_DOWN) ? \"down\" :\n\t\t\t       ((op == EXT2_EXTENT_UP) ? \"up\" : \"unknown\"));\n#endif\n\t\t}\n\t}\n\n\tif ((orig_op == EXT2_EXTENT_PREV) ||\n\t    (orig_op == EXT2_EXTENT_PREV_LEAF)) {\n\t\tif (handle->level < handle->max_depth) {\n\t\t\t/* interior node */\n\t\t\tif (path->visit_num > 0 ) {\n\t\t\t\t/* path->visit_num = 0; */\n\t\t\t\top = EXT2_EXTENT_DOWN_AND_LAST;\n\t\t\t} else if (path->left < path->entries-1)\n\t\t\t\top = EXT2_EXTENT_PREV_SIB;\n\t\t\telse if (handle->level > 0)\n\t\t\t\top = EXT2_EXTENT_UP;\n\t\t\telse\n\t\t\t\treturn EXT2_ET_EXTENT_NO_PREV;\n\t\t} else {\n\t\t\t/* leaf node */\n\t\t\tif (path->left < path->entries-1)\n\t\t\t\top = EXT2_EXTENT_PREV_SIB;\n\t\t\telse if (handle->level > 0)\n\t\t\t\top = EXT2_EXTENT_UP;\n\t\t\telse\n\t\t\t\treturn EXT2_ET_EXTENT_NO_PREV;\n\t\t}\n\t\tif (op != EXT2_EXTENT_PREV_SIB) {\n#ifdef DEBUG_GET_EXTENT\n\t\t\tprintf(\"<<<< OP = %s\\n\",\n\t\t\t       (op == EXT2_EXTENT_DOWN_AND_LAST) ? \"down/last\" :\n\t\t\t       ((op == EXT2_EXTENT_UP) ? \"up\" : \"unknown\"));\n#endif\n\t\t}\n\t}\n\n\tif (orig_op == EXT2_EXTENT_LAST_LEAF) {\n\t\tif ((handle->level < handle->max_depth) &&\n\t\t    (path->left == 0))\n\t\t\top = EXT2_EXTENT_DOWN;\n\t\telse\n\t\t\top = EXT2_EXTENT_LAST_SIB;\n#ifdef DEBUG_GET_EXTENT\n\t\tprintf(\"<<<< OP = %s\\n\",\n\t\t\t   (op == EXT2_EXTENT_DOWN) ? \"down\" : \"last_sib\");\n#endif\n\t}\n\n\tswitch (op) {\n\tcase EXT2_EXTENT_CURRENT:\n\t\tix = path->curr;\n\t\tbreak;\n\tcase EXT2_EXTENT_ROOT:\n\t\thandle->level = 0;\n\t\tpath = handle->path + handle->level;\n\t\t/* fallthrough */\n\tcase EXT2_EXTENT_FIRST_SIB:\n\t\tpath->left = path->entries;\n\t\tpath->curr = 0;\n\t\t/* fallthrough */\n\tcase EXT2_EXTENT_NEXT_SIB:\n\t\tif (path->left <= 0)\n\t\t\treturn EXT2_ET_EXTENT_NO_NEXT;\n\t\tif (path->curr) {\n\t\t\tix = path->curr;\n\t\t\tix++;\n\t\t} else {\n\t\t\teh = (struct ext3_extent_header *) path->buf;\n\t\t\tix = EXT_FIRST_INDEX(eh);\n\t\t}\n\t\tpath->left--;\n\t\tpath->curr = ix;\n\t\tpath->visit_num = 0;\n\t\tbreak;\n\tcase EXT2_EXTENT_PREV_SIB:\n\t\tif (!path->curr ||\n\t\t    path->left+1 >= path->entries)\n\t\t\treturn EXT2_ET_EXTENT_NO_PREV;\n\t\tix = path->curr;\n\t\tix--;\n\t\tpath->curr = ix;\n\t\tpath->left++;\n\t\tif (handle->level < handle->max_depth)\n\t\t\tpath->visit_num = 1;\n\t\tbreak;\n\tcase EXT2_EXTENT_LAST_SIB:\n\t\teh = (struct ext3_extent_header *) path->buf;\n\t\tpath->curr = EXT_LAST_EXTENT(eh);\n\t\tix = path->curr;\n\t\tpath->left = 0;\n\t\tpath->visit_num = 0;\n\t\tbreak;\n\tcase EXT2_EXTENT_UP:\n\t\tif (handle->level <= 0)\n\t\t\treturn EXT2_ET_EXTENT_NO_UP;\n\t\thandle->level--;\n\t\tpath--;\n\t\tix = path->curr;\n\t\tif ((orig_op == EXT2_EXTENT_PREV) ||\n\t\t    (orig_op == EXT2_EXTENT_PREV_LEAF))\n\t\t\tpath->visit_num = 0;\n\t\tbreak;\n\tcase EXT2_EXTENT_DOWN:\n\tcase EXT2_EXTENT_DOWN_AND_LAST:\n\t\tif (!path->curr ||(handle->level >= handle->max_depth))\n\t\t\treturn EXT2_ET_EXTENT_NO_DOWN;\n\n\t\tix = path->curr;\n\t\tnewpath = path + 1;\n\t\tif (!newpath->buf) {\n\t\t\tretval = ext2fs_get_mem(handle->fs->blocksize,\n\t\t\t\t\t\t&newpath->buf);\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\t\t}\n\t\tblk = ext2fs_le32_to_cpu(ix->ei_leaf) +\n\t\t\t((__u64) ext2fs_le16_to_cpu(ix->ei_leaf_hi) << 32);\n\t\tif ((handle->fs->flags & EXT2_FLAG_IMAGE_FILE) &&\n\t\t    (handle->fs->io != handle->fs->image_io))\n\t\t\tmemset(newpath->buf, 0, handle->fs->blocksize);\n\t\telse {\n\t\t\tretval = io_channel_read_blk64(handle->fs->io,\n\t\t\t\t\t\t     blk, 1, newpath->buf);\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\t\t}\n\t\thandle->level++;\n\n\t\teh = (struct ext3_extent_header *) newpath->buf;\n\n\t\tretval = ext2fs_extent_header_verify(eh, handle->fs->blocksize);\n\t\tif (retval) {\n\t\t\thandle->level--;\n\t\t\treturn retval;\n\t\t}\n\n\t\tif (!(handle->fs->flags & EXT2_FLAG_IGNORE_CSUM_ERRORS) &&\n\t\t    !ext2fs_extent_block_csum_verify(handle->fs, handle->ino,\n\t\t\t\t\t\t     eh))\n\t\t\tfailed_csum = 1;\n\n\t\tnewpath->left = newpath->entries =\n\t\t\text2fs_le16_to_cpu(eh->eh_entries);\n\t\tnewpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max);\n\n\t\tif (path->left > 0) {\n\t\t\tix++;\n\t\t\tnewpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block);\n\t\t} else\n\t\t\tnewpath->end_blk = path->end_blk;\n\n\t\tpath = newpath;\n\t\tif (op == EXT2_EXTENT_DOWN) {\n\t\t\tix = EXT_FIRST_INDEX((struct ext3_extent_header *) eh);\n\t\t\tpath->curr = ix;\n\t\t\tpath->left = path->entries - 1;\n\t\t\tpath->visit_num = 0;\n\t\t} else {\n\t\t\tix = EXT_LAST_INDEX((struct ext3_extent_header *) eh);\n\t\t\tpath->curr = ix;\n\t\t\tpath->left = 0;\n\t\t\tif (handle->level < handle->max_depth)\n\t\t\t\tpath->visit_num = 1;\n\t\t}\n#ifdef DEBUG_GET_EXTENT\n\t\tprintf(\"Down to level %d/%d, end_blk=%llu\\n\",\n\t\t\t   handle->level, handle->max_depth,\n\t\t\t   path->end_blk);\n#endif\n\t\tbreak;\n\tdefault:\n\t\treturn EXT2_ET_OP_NOT_SUPPORTED;\n\t}\n\n\tif (!ix)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n\textent->e_flags = 0;\n#ifdef DEBUG_GET_EXTENT\n\tprintf(\"(Left %d)\\n\", path->left);\n#endif\n\n\tif (handle->level == handle->max_depth) {\n\t\tex = (struct ext3_extent *) ix;\n\n\t\textent->e_pblk = ext2fs_le32_to_cpu(ex->ee_start) +\n\t\t\t((__u64) ext2fs_le16_to_cpu(ex->ee_start_hi) << 32);\n\t\textent->e_lblk = ext2fs_le32_to_cpu(ex->ee_block);\n\t\textent->e_len = ext2fs_le16_to_cpu(ex->ee_len);\n\t\textent->e_flags |= EXT2_EXTENT_FLAGS_LEAF;\n\t\tif (extent->e_len > EXT_INIT_MAX_LEN) {\n\t\t\textent->e_len -= EXT_INIT_MAX_LEN;\n\t\t\textent->e_flags |= EXT2_EXTENT_FLAGS_UNINIT;\n\t\t}\n\t} else {\n\t\textent->e_pblk = ext2fs_le32_to_cpu(ix->ei_leaf) +\n\t\t\t((__u64) ext2fs_le16_to_cpu(ix->ei_leaf_hi) << 32);\n\t\textent->e_lblk = ext2fs_le32_to_cpu(ix->ei_block);\n\t\tif (path->left > 0) {\n\t\t\tix++;\n\t\t\tend_blk = ext2fs_le32_to_cpu(ix->ei_block);\n\t\t} else\n\t\t\tend_blk = path->end_blk;\n\n\t\textent->e_len = end_blk - extent->e_lblk;\n\t}\n\tif (path->visit_num)\n\t\textent->e_flags |= EXT2_EXTENT_FLAGS_SECOND_VISIT;\n\n\tif (((orig_op == EXT2_EXTENT_NEXT_LEAF) ||\n\t     (orig_op == EXT2_EXTENT_PREV_LEAF)) &&\n\t    (handle->level != handle->max_depth))\n\t\tgoto retry;\n\n\tif ((orig_op == EXT2_EXTENT_LAST_LEAF) &&\n\t    ((handle->level != handle->max_depth) ||\n\t     (path->left != 0)))\n\t\tgoto retry;\n\n\tif (failed_csum)\n\t\treturn EXT2_ET_EXTENT_CSUM_INVALID;\n\n\treturn 0;\n}\n\nstatic errcode_t update_path(ext2_extent_handle_t handle)\n{\n\tblk64_t\t\t\t\tblk;\n\terrcode_t\t\t\tretval;\n\tstruct ext3_extent_idx\t\t*ix;\n\tstruct ext3_extent_header\t*eh;\n\n\tif (handle->level == 0) {\n\t\tretval = ext2fs_write_inode(handle->fs, handle->ino,\n\t\t\t\t\t    handle->inode);\n\t} else {\n\t\tix = handle->path[handle->level - 1].curr;\n\t\tblk = ext2fs_le32_to_cpu(ix->ei_leaf) +\n\t\t\t((__u64) ext2fs_le16_to_cpu(ix->ei_leaf_hi) << 32);\n\n\t\t/* then update the checksum */\n\t\teh = (struct ext3_extent_header *)\n\t\t\t\thandle->path[handle->level].buf;\n\t\tretval = ext2fs_extent_block_csum_set(handle->fs, handle->ino,\n\t\t\t\t\t\t      eh);\n\t\tif (retval)\n\t\t\treturn retval;\n\n\t\tretval = io_channel_write_blk64(handle->fs->io,\n\t\t\t\t      blk, 1, handle->path[handle->level].buf);\n\t}\n\treturn retval;\n}\n\n#if 0\nerrcode_t ext2fs_extent_save_path(ext2_extent_handle_t handle,\n\t\t\t\t  ext2_extent_path_t *ret_path)\n{\n\text2_extent_path_t\tsave_path;\n\tstruct ext2fs_extent\textent;\n\tstruct ext2_extent_info\tinfo;\n\terrcode_t\t\tretval;\n\n\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT, &extent);\n\tif (retval)\n\t\treturn retval;\n\n\tretval = ext2fs_extent_get_info(handle, &info);\n\tif (retval)\n\t\treturn retval;\n\n\tretval = ext2fs_get_mem(sizeof(struct ext2_extent_path), &save_path);\n\tif (retval)\n\t\treturn retval;\n\tmemset(save_path, 0, sizeof(struct ext2_extent_path));\n\n\tsave_path->magic = EXT2_ET_MAGIC_EXTENT_PATH;\n\tsave_path->leaf_height = info.max_depth - info.curr_level - 1;\n\tsave_path->lblk = extent.e_lblk;\n\n\t*ret_path = save_path;\n\treturn 0;\n}\n\nerrcode_t ext2fs_extent_free_path(ext2_extent_path_t path)\n{\n\tEXT2_CHECK_MAGIC(path, EXT2_ET_MAGIC_EXTENT_PATH);\n\n\text2fs_free_mem(&path);\n\treturn 0;\n}\n#endif\n\n/*\n * Go to the node at leaf_level which contains logical block blk.\n *\n * leaf_level is height from the leaf node level, i.e.\n * leaf_level 0 is at leaf node, leaf_level 1 is 1 above etc.\n *\n * If \"blk\" has no mapping (hole) then handle is left at last\n * extent before blk.\n */\nerrcode_t ext2fs_extent_goto2(ext2_extent_handle_t handle,\n\t\t\t      int leaf_level, blk64_t blk)\n{\n\tstruct ext2fs_extent\textent;\n\terrcode_t\t\tretval;\n\n\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_ROOT, &extent);\n\tif (retval) {\n\t\tif (retval == EXT2_ET_EXTENT_NO_NEXT)\n\t\t\tretval = EXT2_ET_EXTENT_NOT_FOUND;\n\t\treturn retval;\n\t}\n\n\tif (leaf_level > handle->max_depth) {\n#ifdef DEBUG\n\t\tprintf(\"leaf level %d greater than tree depth %d\\n\",\n\t\t\tleaf_level, handle->max_depth);\n#endif\n\t\treturn EXT2_ET_OP_NOT_SUPPORTED;\n\t}\n\n#ifdef DEBUG\n\tprintf(\"goto extent ino %u, level %d, %llu\\n\", handle->ino,\n\t       leaf_level, blk);\n#endif\n\n#ifdef DEBUG_GOTO_EXTENTS\n\tdbg_print_extent(\"root\", &extent);\n#endif\n\twhile (1) {\n\t\tif (handle->max_depth - handle->level == leaf_level) {\n\t\t\t/* block is in this &extent */\n\t\t\tif ((blk >= extent.e_lblk) &&\n\t\t\t    (blk < extent.e_lblk + extent.e_len))\n\t\t\t\treturn 0;\n\t\t\tif (blk < extent.e_lblk) {\n\t\t\t\tretval = ext2fs_extent_get(handle,\n\t\t\t\t\t\t\t   EXT2_EXTENT_PREV_SIB,\n\t\t\t\t\t\t\t   &extent);\n\t\t\t\treturn EXT2_ET_EXTENT_NOT_FOUND;\n\t\t\t}\n\t\t\tretval = ext2fs_extent_get(handle,\n\t\t\t\t\t\t   EXT2_EXTENT_NEXT_SIB,\n\t\t\t\t\t\t   &extent);\n\t\t\tif (retval == EXT2_ET_EXTENT_NO_NEXT)\n\t\t\t\treturn EXT2_ET_EXTENT_NOT_FOUND;\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\t\t\tcontinue;\n\t\t}\n\n\t\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_NEXT_SIB,\n\t\t\t\t\t   &extent);\n\t\tif (retval == EXT2_ET_EXTENT_NO_NEXT)\n\t\t\tgoto go_down;\n\t\tif (retval)\n\t\t\treturn retval;\n\n#ifdef DEBUG_GOTO_EXTENTS\n\t\tdbg_print_extent(\"next\", &extent);\n#endif\n\t\tif (blk == extent.e_lblk)\n\t\t\tgoto go_down;\n\t\tif (blk > extent.e_lblk)\n\t\t\tcontinue;\n\n\t\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_PREV_SIB,\n\t\t\t\t\t   &extent);\n\t\tif (retval)\n\t\t\treturn retval;\n\n#ifdef DEBUG_GOTO_EXTENTS\n\t\tdbg_print_extent(\"prev\", &extent);\n#endif\n\n\tgo_down:\n\t\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_DOWN,\n\t\t\t\t\t   &extent);\n\t\tif (retval)\n\t\t\treturn retval;\n\n#ifdef DEBUG_GOTO_EXTENTS\n\t\tdbg_print_extent(\"down\", &extent);\n#endif\n\t}\n}\n\nerrcode_t ext2fs_extent_goto(ext2_extent_handle_t handle,\n\t\t\t     blk64_t blk)\n{\n\treturn ext2fs_extent_goto2(handle, 0, blk);\n}\n\n/*\n * Traverse back up to root fixing parents of current node as needed.\n *\n * If we changed start of first entry in a node, fix parent index start\n * and so on.\n *\n * Safe to call for any position in node; if not at the first entry,\n * it will simply return.\n *\n * Note a subtlety of this function -- if there happen to be two extents\n * mapping the same lblk and someone calls fix_parents on the second of the two\n * extents, the position of the extent handle after the call will be the second\n * extent if nothing happened, or the first extent if something did.  A caller\n * in this situation must use ext2fs_extent_goto() after calling this function.\n * Or simply don't map the same lblk with two extents, ever.\n */\nerrcode_t ext2fs_extent_fix_parents(ext2_extent_handle_t handle)\n{\n\tint\t\t\t\tretval = 0;\n\tint\t\t\t\torig_height;\n\tblk64_t\t\t\t\tstart;\n\tstruct extent_path\t\t*path;\n\tstruct ext2fs_extent\t\textent;\n\tstruct ext2_extent_info\t\tinfo;\n\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EXTENT_HANDLE);\n\n\tif (!(handle->fs->flags & EXT2_FLAG_RW))\n\t\treturn EXT2_ET_RO_FILSYS;\n\n\tif (!handle->path)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n\tpath = handle->path + handle->level;\n\tif (!path->curr)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT, &extent);\n\tif (retval)\n\t\tgoto done;\n\n\t/* modified node's start block */\n\tstart = extent.e_lblk;\n\n\tif ((retval = ext2fs_extent_get_info(handle, &info)))\n\t\treturn retval;\n\torig_height = info.max_depth - info.curr_level;\n\n\t/* traverse up until index not first, or startblk matches, or top */\n\twhile (handle->level > 0 &&\n\t       (path->left == path->entries - 1)) {\n\t\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_UP, &extent);\n\t\tif (retval)\n\t\t\tgoto done;\n\t\tif (extent.e_lblk == start)\n\t\t\tbreak;\n\t\tpath = handle->path + handle->level;\n\t\textent.e_len += (extent.e_lblk - start);\n\t\textent.e_lblk = start;\n\t\tretval = ext2fs_extent_replace(handle, 0, &extent);\n\t\tif (retval)\n\t\t\tgoto done;\n\t\tupdate_path(handle);\n\t}\n\n\t/* put handle back to where we started */\n\tretval = ext2fs_extent_goto2(handle, orig_height, start);\ndone:\n\treturn retval;\n}\n\nerrcode_t ext2fs_extent_replace(ext2_extent_handle_t handle,\n\t\t\t\tint flags EXT2FS_ATTR((unused)),\n\t\t\t\tstruct ext2fs_extent *extent)\n{\n\tstruct extent_path\t\t*path;\n\tstruct ext3_extent_idx\t\t*ix;\n\tstruct ext3_extent\t\t*ex;\n\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EXTENT_HANDLE);\n\n\tif (!(handle->fs->flags & EXT2_FLAG_RW))\n\t\treturn EXT2_ET_RO_FILSYS;\n\n\tif (!handle->path)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n\tpath = handle->path + handle->level;\n\tif (!path->curr)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n#ifdef DEBUG\n\tprintf(\"extent replace: %u \", handle->ino);\n\tdbg_print_extent(0, extent);\n#endif\n\n\tif (handle->level == handle->max_depth) {\n\t\tex = path->curr;\n\n\t\tex->ee_block = ext2fs_cpu_to_le32(extent->e_lblk);\n\t\tex->ee_start = ext2fs_cpu_to_le32(extent->e_pblk & 0xFFFFFFFF);\n\t\tex->ee_start_hi = ext2fs_cpu_to_le16(extent->e_pblk >> 32);\n\t\tif (extent->e_flags & EXT2_EXTENT_FLAGS_UNINIT) {\n\t\t\tif (extent->e_len > EXT_UNINIT_MAX_LEN)\n\t\t\t\treturn EXT2_ET_EXTENT_INVALID_LENGTH;\n\t\t\tex->ee_len = ext2fs_cpu_to_le16(extent->e_len +\n\t\t\t\t\t\t\tEXT_INIT_MAX_LEN);\n\t\t} else {\n\t\t\tif (extent->e_len > EXT_INIT_MAX_LEN)\n\t\t\t\treturn EXT2_ET_EXTENT_INVALID_LENGTH;\n\t\t\tex->ee_len = ext2fs_cpu_to_le16(extent->e_len);\n\t\t}\n\t} else {\n\t\tix = path->curr;\n\n\t\tix->ei_leaf = ext2fs_cpu_to_le32(extent->e_pblk & 0xFFFFFFFF);\n\t\tix->ei_leaf_hi = ext2fs_cpu_to_le16(extent->e_pblk >> 32);\n\t\tix->ei_block = ext2fs_cpu_to_le32(extent->e_lblk);\n\t\tix->ei_unused = 0;\n\t}\n\tupdate_path(handle);\n\treturn 0;\n}\n\nstatic int splitting_at_eof(struct ext2_extent_handle *handle,\n\t\t\t    struct extent_path *path)\n{\n\tstruct extent_path *ppp = path;\n\tdump_path(__func__, handle, path);\n\n\tif (handle->level == 0)\n\t\treturn 0;\n\n\tdo {\n\t\tif (ppp->left)\n\t\t\treturn 0;\n\t\tppp--;\n\t} while (ppp >= handle->path);\n\n\treturn 1;\n}\n\n/*\n * allocate a new block, move half the current node to it, and update parent\n *\n * handle will be left pointing at original record.\n */\nstatic errcode_t extent_node_split(ext2_extent_handle_t handle,\n\t\t\t\t   int expand_allowed)\n{\n\terrcode_t\t\t\tretval = 0;\n\tblk64_t\t\t\t\tnew_node_pblk;\n\tblk64_t\t\t\t\tnew_node_start;\n\tblk64_t\t\t\t\torig_lblk;\n\tblk64_t\t\t\t\tgoal_blk = 0;\n\tint\t\t\t\torig_height;\n\tchar\t\t\t\t*block_buf = NULL;\n\tstruct ext2fs_extent\t\textent;\n\tstruct extent_path\t\t*path, *newpath = 0;\n\tstruct ext3_extent_header\t*eh, *neweh;\n\tint\t\t\t\ttocopy;\n\tint\t\t\t\tnew_root = 0;\n\tstruct ext2_extent_info\t\tinfo;\n\tint\t\t\t\tno_balance;\n\n\t/* basic sanity */\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EXTENT_HANDLE);\n\n\tif (!(handle->fs->flags & EXT2_FLAG_RW))\n\t\treturn EXT2_ET_RO_FILSYS;\n\n\tif (!handle->path)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n#ifdef DEBUG\n\tprintf(\"splitting node at level %d\\n\", handle->level);\n#endif\n\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT, &extent);\n\tif (retval)\n\t\tgoto done;\n\n\tretval = ext2fs_extent_get_info(handle, &info);\n\tif (retval)\n\t\tgoto done;\n\n\t/* save the position we were originally splitting... */\n\torig_height = info.max_depth - info.curr_level;\n\torig_lblk = extent.e_lblk;\n\n\t/* Try to put the index block before the first extent */\n\tpath = handle->path + handle->level;\n\teh = (struct ext3_extent_header *) path->buf;\n\tif (handle->level == handle->max_depth) {\n\t\tstruct ext3_extent\t*ex;\n\n\t\tex = EXT_FIRST_EXTENT(eh);\n\t\tgoal_blk = ext2fs_le32_to_cpu(ex->ee_start) +\n\t\t\t((__u64) ext2fs_le16_to_cpu(ex->ee_start_hi) << 32);\n\t} else {\n\t\tstruct ext3_extent_idx\t*ix;\n\n\t\tix = EXT_FIRST_INDEX(eh);\n\t\tgoal_blk = ext2fs_le32_to_cpu(ix->ei_leaf) +\n\t\t\t((__u64) ext2fs_le16_to_cpu(ix->ei_leaf_hi) << 32);\n\t}\n\tgoal_blk -= EXT2FS_CLUSTER_RATIO(handle->fs);\n\tgoal_blk &= ~EXT2FS_CLUSTER_MASK(handle->fs);\n\n\t/* Is there room in the parent for a new entry? */\n\tif (handle->level &&\n\t\t\t(handle->path[handle->level - 1].entries >=\n\t\t\t handle->path[handle->level - 1].max_entries)) {\n\n#ifdef DEBUG\n\t\tprintf(\"parent level %d full; splitting it too\\n\",\n\t\t\t\t\t\t\thandle->level - 1);\n#endif\n\t\t/* split the parent */\n\t\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_UP, &extent);\n\t\tif (retval)\n\t\t\tgoto done;\n\n\t\tretval = extent_node_split(handle, expand_allowed);\n\t\tif (retval)\n\t\t\tgoto done;\n\n\t\t/* get handle back to our original split position */\n\t\tretval = ext2fs_extent_goto2(handle, orig_height, orig_lblk);\n\t\tif (retval)\n\t\t\tgoto done;\n\t}\n\n\t/* At this point, parent should have room for this split */\n\tpath = handle->path + handle->level;\n\tif (!path->curr)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n\t/*\n\t * Normally, we try to split a full node in half.  This doesn't turn\n\t * out so well if we're tacking extents on the end of the file because\n\t * then we're stuck with a tree of half-full extent blocks.  This of\n\t * course doesn't apply to the root level.\n\t */\n\tno_balance = expand_allowed ? splitting_at_eof(handle, path) : 0;\n\n\t/* extent header of the current node we'll split */\n\teh = (struct ext3_extent_header *)path->buf;\n\n\t/* splitting root level means moving them all out */\n\tif (handle->level == 0) {\n\t\tnew_root = 1;\n\t\ttocopy = ext2fs_le16_to_cpu(eh->eh_entries);\n\t\tretval = ext2fs_get_memzero((handle->max_paths + 1) *\n\t\t\t\t\t    sizeof(struct extent_path),\n\t\t\t\t\t    &newpath);\n\t\tif (retval)\n\t\t\tgoto done;\n\t} else {\n\t\tif (no_balance)\n\t\t\ttocopy = 1;\n\t\telse\n\t\t\ttocopy = ext2fs_le16_to_cpu(eh->eh_entries) / 2;\n\t}\n\n#ifdef DEBUG\n\tprintf(\"will copy out %d of %d entries at level %d\\n\",\n\t\t\t\ttocopy, ext2fs_le16_to_cpu(eh->eh_entries),\n\t\t\t\thandle->level);\n#endif\n\n\tif (!tocopy && !no_balance) {\n#ifdef DEBUG\n\t\tprintf(\"Nothing to copy to new block!\\n\");\n#endif\n\t\tretval = EXT2_ET_CANT_SPLIT_EXTENT;\n\t\tgoto done;\n\t}\n\n\t/* first we need a new block, or can do nothing. */\n\tblock_buf = malloc(handle->fs->blocksize);\n\tif (!block_buf) {\n\t\tretval = ENOMEM;\n\t\tgoto done;\n\t}\n\n\tif (!goal_blk)\n\t\tgoal_blk = ext2fs_find_inode_goal(handle->fs, handle->ino,\n\t\t\t\t\t\t  handle->inode, 0);\n\tretval = ext2fs_alloc_block2(handle->fs, goal_blk, block_buf,\n\t\t\t\t    &new_node_pblk);\n\tif (retval)\n\t\tgoto done;\n\n#ifdef DEBUG\n\tprintf(\"will copy to new node at block %lu\\n\",\n\t       (unsigned long) new_node_pblk);\n#endif\n\n\t/* Copy data into new block buffer */\n\t/* First the header for the new block... */\n\tneweh = (struct ext3_extent_header *) block_buf;\n\tmemcpy(neweh, eh, sizeof(struct ext3_extent_header));\n\tneweh->eh_entries = ext2fs_cpu_to_le16(tocopy);\n\tneweh->eh_max = ext2fs_cpu_to_le16((handle->fs->blocksize -\n\t\t\t sizeof(struct ext3_extent_header)) /\n\t\t\t\tsizeof(struct ext3_extent));\n\n\t/* then the entries for the new block... */\n\tmemcpy(EXT_FIRST_INDEX(neweh),\n\t\tEXT_FIRST_INDEX(eh) +\n\t\t\t(ext2fs_le16_to_cpu(eh->eh_entries) - tocopy),\n\t\tsizeof(struct ext3_extent_idx) * tocopy);\n\n\tnew_node_start = ext2fs_le32_to_cpu(EXT_FIRST_INDEX(neweh)->ei_block);\n\n\t/* then update the checksum */\n\tretval = ext2fs_extent_block_csum_set(handle->fs, handle->ino, neweh);\n\tif (retval)\n\t\tgoto done;\n\n\t/* ...and write the new node block out to disk. */\n\tretval = io_channel_write_blk64(handle->fs->io, new_node_pblk, 1,\n\t\t\t\t\tblock_buf);\n\n\tif (retval)\n\t\tgoto done;\n\n\t/* OK! we've created the new node; now adjust the tree */\n\n\t/* current path now has fewer active entries, we copied some out */\n\tif (handle->level == 0) {\n\t\tmemcpy(newpath, path,\n\t\t       sizeof(struct extent_path) * handle->max_paths);\n\t\thandle->path = newpath;\n\t\tnewpath = path;\n\t\tpath = handle->path;\n\t\tpath->entries = 1;\n\t\tpath->left = path->max_entries - 1;\n\t\thandle->max_depth++;\n\t\thandle->max_paths++;\n\t\teh->eh_depth = ext2fs_cpu_to_le16(handle->max_depth);\n\t} else {\n\t\tpath->entries -= tocopy;\n\t\tpath->left -= tocopy;\n\t}\n\n\teh->eh_entries = ext2fs_cpu_to_le16(path->entries);\n\t/* this writes out the node, incl. the modified header */\n\tretval = update_path(handle);\n\tif (retval)\n\t\tgoto done;\n\n\t/* now go up and insert/replace index for new node we created */\n\tif (new_root) {\n\t\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_FIRST_SIB, &extent);\n\t\tif (retval)\n\t\t\tgoto done;\n\n\t\textent.e_lblk = new_node_start;\n\t\textent.e_pblk = new_node_pblk;\n\t\textent.e_len = handle->path[0].end_blk - extent.e_lblk;\n\t\tretval = ext2fs_extent_replace(handle, 0, &extent);\n\t\tif (retval)\n\t\t\tgoto done;\n\t} else {\n\t\t__u32 new_node_length;\n\n\t\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_UP, &extent);\n\t\t/* will insert after this one; it's length is shorter now */\n\t\tnew_node_length = new_node_start - extent.e_lblk;\n\t\textent.e_len -= new_node_length;\n\t\tretval = ext2fs_extent_replace(handle, 0, &extent);\n\t\tif (retval)\n\t\t\tgoto done;\n\n\t\t/* now set up the new extent and insert it */\n\t\textent.e_lblk = new_node_start;\n\t\textent.e_pblk = new_node_pblk;\n\t\textent.e_len = new_node_length;\n\t\tretval = ext2fs_extent_insert(handle, EXT2_EXTENT_INSERT_AFTER, &extent);\n\t\tif (retval)\n\t\t\tgoto done;\n\t}\n\n\t/* get handle back to our original position */\n\tretval = ext2fs_extent_goto2(handle, orig_height, orig_lblk);\n\tif (retval)\n\t\tgoto done;\n\n\t/* new node hooked in, so update inode block count (do this here?) */\n\text2fs_iblk_add_blocks(handle->fs, handle->inode, 1);\n\tretval = ext2fs_write_inode(handle->fs, handle->ino,\n\t\t\t\t    handle->inode);\n\tif (retval)\n\t\tgoto done;\n\ndone:\n\tif (newpath)\n\t\text2fs_free_mem(&newpath);\n\tfree(block_buf);\n\n\treturn retval;\n}\n\nerrcode_t ext2fs_extent_node_split(ext2_extent_handle_t handle)\n{\n\treturn extent_node_split(handle, 0);\n}\n\nerrcode_t ext2fs_extent_insert(ext2_extent_handle_t handle, int flags,\n\t\t\t\t      struct ext2fs_extent *extent)\n{\n\tstruct extent_path\t\t*path;\n\tstruct ext3_extent_idx\t\t*ix;\n\tstruct ext3_extent_header\t*eh;\n\terrcode_t\t\t\tretval;\n\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EXTENT_HANDLE);\n\n\tif (!(handle->fs->flags & EXT2_FLAG_RW))\n\t\treturn EXT2_ET_RO_FILSYS;\n\n\tif (!handle->path)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n#ifdef DEBUG\n\tprintf(\"extent insert: %u \", handle->ino);\n\tdbg_print_extent(0, extent);\n#endif\n\n\tpath = handle->path + handle->level;\n\n\tif (path->entries >= path->max_entries) {\n\t\tif (flags & EXT2_EXTENT_INSERT_NOSPLIT) {\n\t\t\treturn EXT2_ET_CANT_INSERT_EXTENT;\n\t\t} else {\n#ifdef DEBUG\n\t\t\tprintf(\"node full (level %d) - splitting\\n\",\n\t\t\t\t   handle->level);\n#endif\n\t\t\tretval = extent_node_split(handle, 1);\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\t\t\tpath = handle->path + handle->level;\n\t\t}\n\t}\n\n\teh = (struct ext3_extent_header *) path->buf;\n\tif (path->curr) {\n\t\tix = path->curr;\n\t\tif (flags & EXT2_EXTENT_INSERT_AFTER) {\n\t\t\tix++;\n\t\t\tpath->left--;\n\t\t}\n\t} else {\n\t\tix = EXT_FIRST_INDEX(eh);\n\t\tpath->left = -1;\n\t}\n\n\tpath->curr = ix;\n\n\tif (path->left >= 0)\n\t\tmemmove(ix + 1, ix,\n\t\t\t(path->left+1) * sizeof(struct ext3_extent_idx));\n\tpath->left++;\n\tpath->entries++;\n\n\teh = (struct ext3_extent_header *) path->buf;\n\teh->eh_entries = ext2fs_cpu_to_le16(path->entries);\n\n\tretval = ext2fs_extent_replace(handle, 0, extent);\n\tif (retval)\n\t\tgoto errout;\n\n\tretval = update_path(handle);\n\tif (retval)\n\t\tgoto errout;\n\n\treturn 0;\n\nerrout:\n\text2fs_extent_delete(handle, 0);\n\treturn retval;\n}\n\n/*\n * Sets the physical block for a logical file block in the extent tree.\n *\n * May: map unmapped, unmap mapped, or remap mapped blocks.\n *\n * Mapping an unmapped block adds a single-block extent.\n *\n * Unmapping first or last block modifies extent in-place\n *  - But may need to fix parent's starts too in first-block case\n *\n * Mapping any unmapped block requires adding a (single-block) extent\n * and inserting into proper point in tree.\n *\n * Modifying (unmapping or remapping) a block in the middle\n * of an extent requires splitting the extent.\n *  - Remapping case requires new single-block extent.\n *\n * Remapping first or last block adds an extent.\n *\n * We really need extent adding to be smart about merging.\n */\n\nerrcode_t ext2fs_extent_set_bmap(ext2_extent_handle_t handle,\n\t\t\t\t blk64_t logical, blk64_t physical, int flags)\n{\n\terrcode_t\t\tec, retval = 0;\n\tint\t\t\tmapped = 1; /* logical is mapped? */\n\tint\t\t\torig_height;\n\tint\t\t\textent_uninit = 0;\n\tint\t\t\tprev_uninit = 0;\n\tint\t\t\tnext_uninit = 0;\n\tint\t\t\tnew_uninit = 0;\n\tint\t\t\tmax_len = EXT_INIT_MAX_LEN;\n\tint\t\t\thas_prev, has_next;\n\tblk64_t\t\t\torig_lblk;\n\tstruct extent_path\t*path;\n\tstruct ext2fs_extent\textent, next_extent, prev_extent;\n\tstruct ext2fs_extent\tnewextent;\n\tstruct ext2_extent_info\tinfo;\n\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EXTENT_HANDLE);\n\n#ifdef DEBUG\n\tprintf(\"set_bmap ino %u log %lld phys %lld flags %d\\n\",\n\t       handle->ino, logical, physical, flags);\n#endif\n\n\tif (!(handle->fs->flags & EXT2_FLAG_RW))\n\t\treturn EXT2_ET_RO_FILSYS;\n\n\tif (!handle->path)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n\tpath = handle->path + handle->level;\n\n\tif (flags & EXT2_EXTENT_SET_BMAP_UNINIT) {\n\t\tnew_uninit = 1;\n\t\tmax_len = EXT_UNINIT_MAX_LEN;\n\t}\n\n\t/* if (re)mapping, set up new extent to insert */\n\tif (physical) {\n\t\tnewextent.e_len = 1;\n\t\tnewextent.e_pblk = physical;\n\t\tnewextent.e_lblk = logical;\n\t\tnewextent.e_flags = EXT2_EXTENT_FLAGS_LEAF;\n\t\tif (new_uninit)\n\t\t\tnewextent.e_flags |= EXT2_EXTENT_FLAGS_UNINIT;\n\t}\n\n\t/* special case if the extent tree is completely empty */\n\tif ((handle->max_depth == 0) && (path->entries == 0)) {\n\t\tretval = ext2fs_extent_insert(handle, 0, &newextent);\n\t\treturn retval;\n\t}\n\n\t/* save our original location in the extent tree */\n\tif ((retval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT,\n\t\t\t\t\t&extent))) {\n\t\tif (retval != EXT2_ET_NO_CURRENT_NODE)\n\t\t\treturn retval;\n\t\tmemset(&extent, 0, sizeof(extent));\n\t}\n\tif ((retval = ext2fs_extent_get_info(handle, &info)))\n\t\treturn retval;\n\torig_height = info.max_depth - info.curr_level;\n\torig_lblk = extent.e_lblk;\n\n\t/* go to the logical spot we want to (re/un)map */\n\tretval = ext2fs_extent_goto(handle, logical);\n\tif (retval) {\n\t\tif (retval == EXT2_ET_EXTENT_NOT_FOUND) {\n\t\t\tretval = 0;\n\t\t\tmapped = 0;\n\t\t\tif (!physical) {\n#ifdef DEBUG\n\t\t\t\tprintf(\"block %llu already unmapped\\n\",\n\t\t\t\t\tlogical);\n#endif\n\t\t\t\tgoto done;\n\t\t\t}\n\t\t} else\n\t\t\tgoto done;\n\t}\n\n\t/*\n\t * This may be the extent *before* the requested logical,\n\t * if it's currently unmapped.\n\t *\n\t * Get the previous and next leaf extents, if they are present.\n\t */\n\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT, &extent);\n\tif (retval)\n\t\tgoto done;\n\tif (extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\textent_uninit = 1;\n\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_NEXT_LEAF, &next_extent);\n\tif (retval) {\n\t\thas_next = 0;\n\t\tif (retval != EXT2_ET_EXTENT_NO_NEXT)\n\t\t\tgoto done;\n\t} else {\n\t\tdbg_print_extent(\"set_bmap: next_extent\",\n\t\t\t\t &next_extent);\n\t\thas_next = 1;\n\t\tif (next_extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\t\tnext_uninit = 1;\n\t}\n\tretval = ext2fs_extent_goto(handle, logical);\n\tif (retval && retval != EXT2_ET_EXTENT_NOT_FOUND)\n\t\tgoto done;\n\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_PREV_LEAF, &prev_extent);\n\tif (retval) {\n\t\thas_prev = 0;\n\t\tif (retval != EXT2_ET_EXTENT_NO_PREV)\n\t\t\tgoto done;\n\t} else {\n\t\thas_prev = 1;\n\t\tdbg_print_extent(\"set_bmap: prev_extent\",\n\t\t\t\t &prev_extent);\n\t\tif (prev_extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\t\tprev_uninit = 1;\n\t}\n\tretval = ext2fs_extent_goto(handle, logical);\n\tif (retval && retval != EXT2_ET_EXTENT_NOT_FOUND)\n\t\tgoto done;\n\n\t/* check if already pointing to the requested physical */\n\tif (mapped && (new_uninit == extent_uninit) &&\n\t    (extent.e_pblk + (logical - extent.e_lblk) == physical)) {\n#ifdef DEBUG\n\t\tprintf(\"physical block (at %llu) unchanged\\n\", logical);\n#endif\n\t\tgoto done;\n\t}\n\n\tif (!mapped) {\n#ifdef DEBUG\n\t\tprintf(\"mapping unmapped logical block %llu\\n\", logical);\n#endif\n\t\tif ((logical == extent.e_lblk + extent.e_len) &&\n\t\t    (physical == extent.e_pblk + extent.e_len) &&\n\t\t    (new_uninit == extent_uninit) &&\n\t\t    ((int) extent.e_len < max_len-1)) {\n\t\t\textent.e_len++;\n\t\t\tretval = ext2fs_extent_replace(handle, 0, &extent);\n\t\t} else if ((logical == extent.e_lblk - 1) &&\n\t\t\t   (physical == extent.e_pblk - 1) &&\n\t\t\t   (new_uninit == extent_uninit) &&\n\t\t\t   ((int) extent.e_len < max_len - 1)) {\n\t\t\textent.e_len++;\n\t\t\textent.e_lblk--;\n\t\t\textent.e_pblk--;\n\t\t\tretval = ext2fs_extent_replace(handle, 0, &extent);\n\t\t} else if (has_next &&\n\t\t\t   (logical == next_extent.e_lblk - 1) &&\n\t\t\t   (physical == next_extent.e_pblk - 1) &&\n\t\t\t   (new_uninit == next_uninit) &&\n\t\t\t   ((int) next_extent.e_len < max_len - 1)) {\n\t\t\tretval = ext2fs_extent_get(handle,\n\t\t\t\t\t\t   EXT2_EXTENT_NEXT_LEAF,\n\t\t\t\t\t\t   &next_extent);\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t\tnext_extent.e_len++;\n\t\t\tnext_extent.e_lblk--;\n\t\t\tnext_extent.e_pblk--;\n\t\t\tretval = ext2fs_extent_replace(handle, 0, &next_extent);\n\t\t} else if (logical < extent.e_lblk)\n\t\t\tretval = ext2fs_extent_insert(handle, 0, &newextent);\n\t\telse\n\t\t\tretval = ext2fs_extent_insert(handle,\n\t\t\t\t      EXT2_EXTENT_INSERT_AFTER, &newextent);\n\t\tif (retval)\n\t\t\tgoto done;\n\t\tretval = ext2fs_extent_fix_parents(handle);\n\t\tif (retval)\n\t\t\tgoto done;\n\t} else if ((logical == extent.e_lblk) && (extent.e_len == 1))  {\n#ifdef DEBUG\n\t\tprintf(\"(re/un)mapping only block in extent\\n\");\n#endif\n\t\tif (physical) {\n\t\t\tretval = ext2fs_extent_replace(handle, 0, &newextent);\n\t\t} else {\n\t\t\tretval = ext2fs_extent_delete(handle, 0);\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t\tec = ext2fs_extent_fix_parents(handle);\n\t\t\tif (ec != EXT2_ET_NO_CURRENT_NODE)\n\t\t\t\tretval = ec;\n\t\t}\n\n\t\tif (retval)\n\t\t\tgoto done;\n\t} else if (logical == extent.e_lblk + extent.e_len - 1)  {\n#ifdef DEBUG\n\t\tprintf(\"(re/un)mapping last block in extent\\n\");\n#endif\n\t\tif (physical) {\n\t\t\tif (has_next &&\n\t\t\t    (logical == (next_extent.e_lblk - 1)) &&\n\t\t\t    (physical == (next_extent.e_pblk - 1)) &&\n\t\t\t    (new_uninit == next_uninit) &&\n\t\t\t    ((int) next_extent.e_len < max_len - 1)) {\n\t\t\t\tretval = ext2fs_extent_get(handle,\n\t\t\t\t\tEXT2_EXTENT_NEXT_LEAF, &next_extent);\n\t\t\t\tif (retval)\n\t\t\t\t\tgoto done;\n\t\t\t\tnext_extent.e_len++;\n\t\t\t\tnext_extent.e_lblk--;\n\t\t\t\tnext_extent.e_pblk--;\n\t\t\t\tretval = ext2fs_extent_replace(handle, 0,\n\t\t\t\t\t\t\t       &next_extent);\n\t\t\t\tif (retval)\n\t\t\t\t\tgoto done;\n\t\t\t} else\n\t\t\t\tretval = ext2fs_extent_insert(handle,\n\t\t\t\t      EXT2_EXTENT_INSERT_AFTER, &newextent);\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t\tretval = ext2fs_extent_fix_parents(handle);\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t\t/*\n\t\t\t * Now pointing at inserted extent; move back to prev.\n\t\t\t *\n\t\t\t * We cannot use EXT2_EXTENT_PREV to go back; note the\n\t\t\t * subtlety in the comment for fix_parents().\n\t\t\t */\n\t\t\tretval = ext2fs_extent_goto(handle, logical);\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t\tretval = ext2fs_extent_get(handle,\n\t\t\t\t\t\t   EXT2_EXTENT_CURRENT,\n\t\t\t\t\t\t   &extent);\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t}\n\t\textent.e_len--;\n\t\tretval = ext2fs_extent_replace(handle, 0, &extent);\n\t\tif (retval)\n\t\t\tgoto done;\n\t} else if (logical == extent.e_lblk) {\n#ifdef DEBUG\n\t\tprintf(\"(re/un)mapping first block in extent\\n\");\n#endif\n\t\tif (physical) {\n\t\t\tif (has_prev &&\n\t\t\t    (logical == (prev_extent.e_lblk +\n\t\t\t\t\t prev_extent.e_len)) &&\n\t\t\t    (physical == (prev_extent.e_pblk +\n\t\t\t\t\t  prev_extent.e_len)) &&\n\t\t\t    (new_uninit == prev_uninit) &&\n\t\t\t    ((int) prev_extent.e_len < max_len-1)) {\n\t\t\t\tretval = ext2fs_extent_get(handle, \n\t\t\t\t\tEXT2_EXTENT_PREV_LEAF, &prev_extent);\n\t\t\t\tif (retval)\n\t\t\t\t\tgoto done;\n\t\t\t\tprev_extent.e_len++;\n\t\t\t\tretval = ext2fs_extent_replace(handle, 0,\n\t\t\t\t\t\t\t       &prev_extent);\n\t\t\t} else\n\t\t\t\tretval = ext2fs_extent_insert(handle,\n\t\t\t\t\t\t\t      0, &newextent);\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t\tretval = ext2fs_extent_fix_parents(handle);\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t\tretval = ext2fs_extent_get(handle,\n\t\t\t\t\t\t   EXT2_EXTENT_NEXT_LEAF,\n\t\t\t\t\t\t   &extent);\n\t\t\tif (retval)\n\t\t\t\tgoto done;\n\t\t}\n\t\textent.e_pblk++;\n\t\textent.e_lblk++;\n\t\textent.e_len--;\n\t\tretval = ext2fs_extent_replace(handle, 0, &extent);\n\t\tif (retval)\n\t\t\tgoto done;\n\t\tretval = ext2fs_extent_fix_parents(handle);\n\t\tif (retval)\n\t\t\tgoto done;\n\t} else {\n\t\t__u32\tsave_length;\n\t\tblk64_t\tsave_lblk;\n\t\tstruct ext2fs_extent save_extent;\n\t\terrcode_t r2;\n\n#ifdef DEBUG\n\t\tprintf(\"(re/un)mapping in middle of extent\\n\");\n#endif\n\t\t/* need to split this extent; later */\n\t\tsave_lblk = extent.e_lblk;\n\t\tsave_length = extent.e_len;\n\t\tsave_extent = extent;\n\n\t\t/* shorten pre-split extent */\n\t\textent.e_len = (logical - extent.e_lblk);\n\t\tretval = ext2fs_extent_replace(handle, 0, &extent);\n\t\tif (retval)\n\t\t\tgoto done;\n\t\t/* insert our new extent, if any */\n\t\tif (physical) {\n\t\t\t/* insert new extent after current */\n\t\t\tretval = ext2fs_extent_insert(handle,\n\t\t\t\t\tEXT2_EXTENT_INSERT_AFTER, &newextent);\n\t\t\tif (retval) {\n\t\t\t\tr2 = ext2fs_extent_goto(handle, save_lblk);\n\t\t\t\tif (r2 == 0)\n\t\t\t\t\t(void)ext2fs_extent_replace(handle, 0,\n\t\t\t\t\t\t\t      &save_extent);\n\t\t\t\tgoto done;\n\t\t\t}\n\t\t}\n\t\t/* add post-split extent */\n\t\textent.e_pblk += (blk64_t)extent.e_len + 1;\n\t\textent.e_lblk += (blk64_t)extent.e_len + 1;\n\t\textent.e_len = save_length - extent.e_len - 1;\n\t\tretval = ext2fs_extent_insert(handle,\n\t\t\t\tEXT2_EXTENT_INSERT_AFTER, &extent);\n\t\tif (retval) {\n\t\t\tif (physical) {\n\t\t\t\tr2 = ext2fs_extent_goto(handle,\n\t\t\t\t\t\t\tnewextent.e_lblk);\n\t\t\t\tif (r2 == 0)\n\t\t\t\t\t(void)ext2fs_extent_delete(handle, 0);\n\t\t\t}\n\t\t\tr2 = ext2fs_extent_goto(handle, save_lblk);\n\t\t\tif (r2 == 0)\n\t\t\t\t(void)ext2fs_extent_replace(handle, 0,\n\t\t\t\t\t\t\t    &save_extent);\n\t\t\tgoto done;\n\t\t}\n\t}\n\ndone:\n\t/* get handle back to its position */\n\tif (orig_height > handle->max_depth)\n\t\torig_height = handle->max_depth; /* In case we shortened the tree */\n\text2fs_extent_goto2(handle, orig_height, orig_lblk);\n\treturn retval;\n}\n\nerrcode_t ext2fs_extent_delete(ext2_extent_handle_t handle, int flags)\n{\n\tstruct extent_path\t\t*path;\n\tchar \t\t\t\t*cp;\n\tstruct ext3_extent_header\t*eh;\n\terrcode_t\t\t\tretval = 0;\n\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EXTENT_HANDLE);\n\n\tif (!(handle->fs->flags & EXT2_FLAG_RW))\n\t\treturn EXT2_ET_RO_FILSYS;\n\n\tif (!handle->path)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n#ifdef DEBUG\n\t{\n\t\tstruct ext2fs_extent\textent;\n\n\t\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT,\n\t\t\t\t\t   &extent);\n\t\tif (retval == 0) {\n\t\t\tprintf(\"extent delete %u \", handle->ino);\n\t\t\tdbg_print_extent(0, &extent);\n\t\t}\n\t}\n#endif\n\n\tpath = handle->path + handle->level;\n\tif (!path->curr)\n\t\treturn EXT2_ET_NO_CURRENT_NODE;\n\n\tcp = path->curr;\n\n\tif (path->left) {\n\t\tmemmove(cp, cp + sizeof(struct ext3_extent_idx),\n\t\t\tpath->left * sizeof(struct ext3_extent_idx));\n\t\tpath->left--;\n\t} else {\n\t\tstruct ext3_extent_idx\t*ix = path->curr;\n\t\tix--;\n\t\tpath->curr = ix;\n\t}\n\tif (--path->entries == 0)\n\t\tpath->curr = 0;\n\n\t/* if non-root node has no entries left, remove it & parent ptr to it */\n\tif (path->entries == 0 && handle->level) {\n\t\tif (!(flags & EXT2_EXTENT_DELETE_KEEP_EMPTY)) {\n\t\t\tstruct ext2fs_extent\textent;\n\n\t\t\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_UP,\n\t\t\t\t\t\t\t\t&extent);\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\n\t\t\tretval = ext2fs_extent_delete(handle, flags);\n\t\t\thandle->inode->i_blocks -=\n\t\t\t\t(handle->fs->blocksize *\n\t\t\t\t EXT2FS_CLUSTER_RATIO(handle->fs)) / 512;\n\t\t\tretval = ext2fs_write_inode(handle->fs, handle->ino,\n\t\t\t\t\t\t    handle->inode);\n\t\t\text2fs_block_alloc_stats2(handle->fs,\n\t\t\t\t\t\t  extent.e_pblk, -1);\n\t\t}\n\t} else {\n\t\teh = (struct ext3_extent_header *) path->buf;\n\t\teh->eh_entries = ext2fs_cpu_to_le16(path->entries);\n\t\tif ((path->entries == 0) && (handle->level == 0)) {\n\t\t\teh->eh_depth = 0;\n\t\t\thandle->max_depth = 0;\n\t\t}\n\t\tretval = update_path(handle);\n\t}\n\treturn retval;\n}\n\nerrcode_t ext2fs_extent_get_info(ext2_extent_handle_t handle,\n\t\t\t\t struct ext2_extent_info *info)\n{\n\tstruct extent_path\t\t*path;\n\n\tEXT2_CHECK_MAGIC(handle, EXT2_ET_MAGIC_EXTENT_HANDLE);\n\n\tmemset(info, 0, sizeof(struct ext2_extent_info));\n\n\tpath = handle->path + handle->level;\n\tif (path) {\n\t\tif (path->curr)\n\t\t\tinfo->curr_entry = ((char *) path->curr - path->buf) /\n\t\t\t\tsizeof(struct ext3_extent_idx);\n\t\telse\n\t\t\tinfo->curr_entry = 0;\n\t\tinfo->num_entries = path->entries;\n\t\tinfo->max_entries = path->max_entries;\n\t\tinfo->bytes_avail = (path->max_entries - path->entries) *\n\t\t\tsizeof(struct ext3_extent);\n\t}\n\n\tinfo->curr_level = handle->level;\n\tinfo->max_depth = handle->max_depth;\n\tinfo->max_lblk = EXT_MAX_EXTENT_LBLK;\n\tinfo->max_pblk = EXT_MAX_EXTENT_PBLK;\n\tinfo->max_len = EXT_INIT_MAX_LEN;\n\tinfo->max_uninit_len = EXT_UNINIT_MAX_LEN;\n\n\treturn 0;\n}\n\nstatic int ul_log2(unsigned long arg)\n{\n\tint\tl = 0;\n\n\targ >>= 1;\n\twhile (arg) {\n\t\tl++;\n\t\targ >>= 1;\n\t}\n\treturn l;\n}\n\nsize_t ext2fs_max_extent_depth(ext2_extent_handle_t handle)\n{\n\tsize_t iblock_sz = sizeof(((struct ext2_inode *)NULL)->i_block);\n\tsize_t iblock_extents = (iblock_sz - sizeof(struct ext3_extent_header)) /\n\t\t\t\tsizeof(struct ext3_extent);\n\tsize_t extents_per_block = (handle->fs->blocksize -\n\t\t\t\t    sizeof(struct ext3_extent_header)) /\n\t\t\t\t   sizeof(struct ext3_extent);\n\tstatic unsigned int last_blocksize = 0;\n\tstatic size_t last_result = 0;\n\n\tif (last_blocksize && last_blocksize == handle->fs->blocksize)\n\t\treturn last_result;\n\tif (ul_log2(extents_per_block) == 0)\n\t\treturn last_result;\n\n\t// Nice work, Coverity: We've just validated that ul_log2(extents_per_block) is non-zero!\n\t// coverity[divide_by_zero]\n\tlast_result = 1 + ((ul_log2(EXT_MAX_EXTENT_LBLK) - ul_log2(iblock_extents)) /\n\t\t    ul_log2(extents_per_block));\n\tlast_blocksize = handle->fs->blocksize;\n\treturn last_result;\n}\n\nerrcode_t ext2fs_fix_extents_checksums(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t       struct ext2_inode *inode)\n{\n\text2_extent_handle_t\thandle;\n\tstruct ext2fs_extent\textent;\n\terrcode_t\t\terrcode;\n\tint    \t\t\tsave_flags = fs->flags;\n\n\tif (!ext2fs_has_feature_metadata_csum(fs->super) ||\n\t    (inode && !(inode->i_flags & EXT4_EXTENTS_FL)))\n\t\treturn 0;\n\n\terrcode = ext2fs_extent_open2(fs, ino, inode, &handle);\n\tif (errcode) {\n\t\tif (errcode == EXT2_ET_INODE_NOT_EXTENT)\n\t\t\terrcode = 0;\n\t\treturn errcode;\n\t}\n\n\tfs->flags &= ~EXT2_FLAG_IGNORE_CSUM_ERRORS;\n\terrcode = ext2fs_extent_get(handle, EXT2_EXTENT_ROOT, &extent);\n\tif (errcode)\n\t\tgoto out;\n\n\tdo {\n\t\t/* Skip to the end of a block of leaf nodes */\n\t\tif (extent.e_flags & EXT2_EXTENT_FLAGS_LEAF) {\n\t\t\terrcode = ext2fs_extent_get(handle,\n\t\t\t\t\t\t    EXT2_EXTENT_LAST_SIB,\n\t\t\t\t\t\t    &extent);\n\t\t\tif (errcode)\n\t\t\t\tbreak;\n\t\t}\n\n\t\terrcode = ext2fs_extent_get(handle, EXT2_EXTENT_NEXT, &extent);\n\t\tif (errcode == EXT2_ET_EXTENT_CSUM_INVALID)\n\t\t\terrcode = update_path(handle);\n\t} while (errcode == 0);\n\nout:\n\t/* Ok if we run off the end */\n\tif (errcode == EXT2_ET_EXTENT_NO_NEXT)\n\t\terrcode = 0;\n\text2fs_extent_free(handle);\n\tfs->flags = save_flags;\n\treturn errcode;\n}\n\n#ifdef DEBUG\n/*\n * Override debugfs's prompt\n */\nconst char *debug_prog_name = \"tst_extents\";\n\n#endif\n\n"
  },
  {
    "path": "src/ext2fs/fallocate.c",
    "content": "/*\n * fallocate.c -- Allocate large chunks of file.\n *\n * Copyright (C) 2014 Oracle.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n#ifndef min\n#define min(a, b) ((a) < (b) ? (a) : (b))\n#endif\n\n#undef DEBUG\n\n#ifdef DEBUG\n# define dbg_printf(f, a...)  do {printf(f, ## a); fflush(stdout); } while (0)\n#else\n# define dbg_printf(f, ...)\n#endif\n\n/*\n * Extent-based fallocate code.\n *\n * Find runs of unmapped logical blocks by starting at start and walking the\n * extents until we reach the end of the range we want.\n *\n * For each run of unmapped blocks, try to find the extents on either side of\n * the range.  If there's a left extent that can grow by at least a cluster and\n * there are lblocks between start and the next lcluster after start, see if\n * there's an implied cluster allocation; if so, zero the blocks (if the left\n * extent is initialized) and adjust the extent.  Ditto for the blocks between\n * the end of the last full lcluster and end, if there's a right extent.\n *\n * Try to attach as much as we can to the left extent, then try to attach as\n * much as we can to the right extent.  For the remainder, try to allocate the\n * whole range; map in whatever we get; and repeat until we're done.\n *\n * To attach to a left extent, figure out the maximum amount we can add to the\n * extent and try to allocate that much, and append if successful.  To attach\n * to a right extent, figure out the max we can add to the extent, try to\n * allocate that much, and prepend if successful.\n *\n * We need an alloc_range function that tells us how much we can allocate given\n * a maximum length and one of a suggested start, a fixed start, or a fixed end\n * point.\n *\n * Every time we modify the extent tree we also need to update the block stats.\n *\n * At the end, update i_blocks and i_size appropriately.\n */\n\nstatic void dbg_print_extent(const char *desc EXT2FS_ATTR((unused)),\n\t\tconst struct ext2fs_extent *extent EXT2FS_ATTR((unused)))\n{\n#ifdef DEBUG\n\tif (desc)\n\t\tprintf(\"%s: \", desc);\n\tprintf(\"extent: lblk %llu--%llu, len %u, pblk %llu, flags: \",\n\t       extent->e_lblk, extent->e_lblk + extent->e_len - 1,\n\t       extent->e_len, extent->e_pblk);\n\tif (extent->e_flags & EXT2_EXTENT_FLAGS_LEAF)\n\t\tfputs(\"LEAF \", stdout);\n\tif (extent->e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\tfputs(\"UNINIT \", stdout);\n\tif (extent->e_flags & EXT2_EXTENT_FLAGS_SECOND_VISIT)\n\t\tfputs(\"2ND_VISIT \", stdout);\n\tif (!extent->e_flags)\n\t\tfputs(\"(none)\", stdout);\n\tfputc('\\n', stdout);\n\tfflush(stdout);\n#endif\n}\n\nstatic errcode_t claim_range(ext2_filsys fs, struct ext2_inode *inode,\n\t\t\t     blk64_t blk, blk64_t len)\n{\n\tblk64_t\tclusters;\n\n\tclusters = (len + EXT2FS_CLUSTER_RATIO(fs) - 1) /\n\t\t   EXT2FS_CLUSTER_RATIO(fs);\n\text2fs_block_alloc_stats_range(fs, blk,\n\t\t\tclusters * EXT2FS_CLUSTER_RATIO(fs), +1);\n\treturn ext2fs_iblk_add_blocks(fs, inode, clusters);\n}\n\nstatic errcode_t ext_falloc_helper(ext2_filsys fs,\n\t\t\t\t   int flags,\n\t\t\t\t   ext2_ino_t ino,\n\t\t\t\t   struct ext2_inode *inode,\n\t\t\t\t   ext2_extent_handle_t handle,\n\t\t\t\t   struct ext2fs_extent *left_ext,\n\t\t\t\t   struct ext2fs_extent *right_ext,\n\t\t\t\t   blk64_t range_start, blk64_t range_len,\n\t\t\t\t   blk64_t alloc_goal)\n{\n\tstruct ext2fs_extent\tnewex, ex;\n\tint\t\t\top;\n\tblk64_t\t\t\tfillable, pblk, plen, x, y;\n\tblk64_t\t\t\teof_blk = 0, cluster_fill = 0;\n\terrcode_t\t\terr;\n\tblk_t\t\t\tmax_extent_len, max_uninit_len, max_init_len;\n\n#ifdef DEBUG\n\tprintf(\"%s: \", __func__);\n\tif (left_ext)\n\t\tprintf(\"left_ext=%llu--%llu, \", left_ext->e_lblk,\n\t\t       left_ext->e_lblk + left_ext->e_len - 1);\n\tif (right_ext)\n\t\tprintf(\"right_ext=%llu--%llu, \", right_ext->e_lblk,\n\t\t       right_ext->e_lblk + right_ext->e_len - 1);\n\tprintf(\"start=%llu len=%llu, goal=%llu\\n\", range_start, range_len,\n\t       alloc_goal);\n\tfflush(stdout);\n#endif\n\t/* Can't create initialized extents past EOF? */\n\tif (!(flags & EXT2_FALLOCATE_INIT_BEYOND_EOF))\n\t\teof_blk = EXT2_I_SIZE(inode) / fs->blocksize;\n\n\t/* The allocation goal must be as far into a cluster as range_start. */\n\talloc_goal = (alloc_goal & ~EXT2FS_CLUSTER_MASK(fs)) |\n\t\t     (range_start & EXT2FS_CLUSTER_MASK(fs));\n\n\tmax_uninit_len = EXT_UNINIT_MAX_LEN & ~EXT2FS_CLUSTER_MASK(fs);\n\tmax_init_len = EXT_INIT_MAX_LEN & ~EXT2FS_CLUSTER_MASK(fs);\n\n\t/* We must lengthen the left extent to the end of the cluster */\n\tif (left_ext && EXT2FS_CLUSTER_RATIO(fs) > 1) {\n\t\t/* How many more blocks can be attached to left_ext? */\n\t\tif (left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\t\tfillable = max_uninit_len - left_ext->e_len;\n\t\telse\n\t\t\tfillable = max_init_len - left_ext->e_len;\n\n\t\tif (fillable > range_len)\n\t\t\tfillable = range_len;\n\t\tif (fillable == 0)\n\t\t\tgoto expand_right;\n\n\t\t/*\n\t\t * If range_start isn't on a cluster boundary, try an\n\t\t * implied cluster allocation for left_ext.\n\t\t */\n\t\tcluster_fill = EXT2FS_CLUSTER_RATIO(fs) -\n\t\t\t       (range_start & EXT2FS_CLUSTER_MASK(fs));\n\t\tcluster_fill &= EXT2FS_CLUSTER_MASK(fs);\n\t\tif (cluster_fill == 0)\n\t\t\tgoto expand_right;\n\n\t\tif (cluster_fill > fillable)\n\t\t\tcluster_fill = fillable;\n\n\t\t/* Don't expand an initialized left_ext beyond EOF */\n\t\tif (!(flags & EXT2_FALLOCATE_INIT_BEYOND_EOF)) {\n\t\t\tx = left_ext->e_lblk + left_ext->e_len - 1;\n\t\t\tdbg_printf(\"%s: lend=%llu newlend=%llu eofblk=%llu\\n\",\n\t\t\t\t   __func__, x, x + cluster_fill, eof_blk);\n\t\t\tif (eof_blk >= x && eof_blk <= x + cluster_fill)\n\t\t\t\tcluster_fill = eof_blk - x;\n\t\t\tif (cluster_fill == 0)\n\t\t\t\tgoto expand_right;\n\t\t}\n\n\t\terr = ext2fs_extent_goto(handle, left_ext->e_lblk);\n\t\tif (err)\n\t\t\tgoto expand_right;\n\t\tleft_ext->e_len += cluster_fill;\n\t\trange_start += cluster_fill;\n\t\trange_len -= cluster_fill;\n\t\talloc_goal += cluster_fill;\n\n\t\tdbg_print_extent(\"ext_falloc clus left+\", left_ext);\n\t\terr = ext2fs_extent_replace(handle, 0, left_ext);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = ext2fs_extent_fix_parents(handle);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\t/* Zero blocks */\n\t\tif (!(left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)) {\n\t\t\terr = ext2fs_zero_blocks2(fs, left_ext->e_pblk +\n\t\t\t\t\t\t  left_ext->e_len -\n\t\t\t\t\t\t  cluster_fill, cluster_fill,\n\t\t\t\t\t\t  NULL, NULL);\n\t\t\tif (err)\n\t\t\t\tgoto out;\n\t\t}\n\t}\n\nexpand_right:\n\t/* We must lengthen the right extent to the beginning of the cluster */\n\tif (right_ext && EXT2FS_CLUSTER_RATIO(fs) > 1) {\n\t\t/* How much can we attach to right_ext? */\n\t\tif (right_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\t\tfillable = max_uninit_len - right_ext->e_len;\n\t\telse\n\t\t\tfillable = max_init_len - right_ext->e_len;\n\n\t\tif (fillable > range_len)\n\t\t\tfillable = range_len;\n\t\tif (fillable == 0)\n\t\t\tgoto try_merge;\n\n\t\t/*\n\t\t * If range_end isn't on a cluster boundary, try an implied\n\t\t * cluster allocation for right_ext.\n\t\t */\n\t\tcluster_fill = right_ext->e_lblk & EXT2FS_CLUSTER_MASK(fs);\n\t\tif (cluster_fill == 0)\n\t\t\tgoto try_merge;\n\n\t\terr = ext2fs_extent_goto(handle, right_ext->e_lblk);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\tif (cluster_fill > fillable)\n\t\t\tcluster_fill = fillable;\n\t\tright_ext->e_lblk -= cluster_fill;\n\t\tright_ext->e_pblk -= cluster_fill;\n\t\tright_ext->e_len += cluster_fill;\n\t\trange_len -= cluster_fill;\n\n\t\tdbg_print_extent(\"ext_falloc clus right+\", right_ext);\n\t\terr = ext2fs_extent_replace(handle, 0, right_ext);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = ext2fs_extent_fix_parents(handle);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\t/* Zero blocks if necessary */\n\t\tif (!(right_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)) {\n\t\t\terr = ext2fs_zero_blocks2(fs, right_ext->e_pblk,\n\t\t\t\t\t\t  cluster_fill, NULL, NULL);\n\t\t\tif (err)\n\t\t\t\tgoto out;\n\t\t}\n\t}\n\ntry_merge:\n\t/* Merge both extents together, perhaps? */\n\tif (left_ext && right_ext) {\n\t\t/* Are the two extents mergeable? */\n\t\tif ((left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT) !=\n\t\t    (right_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT))\n\t\t\tgoto try_left;\n\n\t\t/* User requires init/uninit but extent is uninit/init. */\n\t\tif (((flags & EXT2_FALLOCATE_FORCE_INIT) &&\n\t\t     (left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)) ||\n\t\t    ((flags & EXT2_FALLOCATE_FORCE_UNINIT) &&\n\t\t     !(left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)))\n\t\t\tgoto try_left;\n\n\t\t/*\n\t\t * Skip initialized extent unless user wants to zero blocks\n\t\t * or requires init extent.\n\t\t */\n\t\tif (!(left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT) &&\n\t\t    (!(flags & EXT2_FALLOCATE_ZERO_BLOCKS) ||\n\t\t     !(flags & EXT2_FALLOCATE_FORCE_INIT)))\n\t\t\tgoto try_left;\n\n\t\t/* Will it even fit? */\n\t\tx = left_ext->e_len + range_len + right_ext->e_len;\n\t\tif (x > (left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT ?\n\t\t\t\tmax_uninit_len : max_init_len))\n\t\t\tgoto try_left;\n\n\t\terr = ext2fs_extent_goto(handle, left_ext->e_lblk);\n\t\tif (err)\n\t\t\tgoto try_left;\n\n\t\t/* Allocate blocks */\n\t\ty = left_ext->e_pblk + left_ext->e_len;\n\t\terr = ext2fs_new_range(fs, EXT2_NEWRANGE_FIXED_GOAL |\n\t\t\t\t       EXT2_NEWRANGE_MIN_LENGTH, y,\n\t\t\t\t       right_ext->e_pblk - y + 1, NULL,\n\t\t\t\t       &pblk, &plen);\n\t\tif (err)\n\t\t\tgoto try_left;\n\t\tif (pblk + plen != right_ext->e_pblk)\n\t\t\tgoto try_left;\n\t\terr = claim_range(fs, inode, pblk, plen);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\t/* Modify extents */\n\t\tleft_ext->e_len = x;\n\t\tdbg_print_extent(\"ext_falloc merge\", left_ext);\n\t\terr = ext2fs_extent_replace(handle, 0, left_ext);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = ext2fs_extent_fix_parents(handle);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = ext2fs_extent_get(handle, EXT2_EXTENT_NEXT_LEAF, &newex);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = ext2fs_extent_delete(handle, 0);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = ext2fs_extent_fix_parents(handle);\n\t\tif (err)\n\t\t\tgoto out;\n\t\t*right_ext = *left_ext;\n\n\t\t/* Zero blocks */\n\t\tif (!(left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT) &&\n\t\t    (flags & EXT2_FALLOCATE_ZERO_BLOCKS)) {\n\t\t\terr = ext2fs_zero_blocks2(fs, range_start, range_len,\n\t\t\t\t\t\t  NULL, NULL);\n\t\t\tif (err)\n\t\t\t\tgoto out;\n\t\t}\n\n\t\treturn 0;\n\t}\n\ntry_left:\n\t/* Extend the left extent */\n\tif (left_ext) {\n\t\t/* How many more blocks can be attached to left_ext? */\n\t\tif (left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\t\tfillable = max_uninit_len - left_ext->e_len;\n\t\telse if (flags & EXT2_FALLOCATE_ZERO_BLOCKS)\n\t\t\tfillable = max_init_len - left_ext->e_len;\n\t\telse\n\t\t\tfillable = 0;\n\n\t\t/* User requires init/uninit but extent is uninit/init. */\n\t\tif (((flags & EXT2_FALLOCATE_FORCE_INIT) &&\n\t\t     (left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)) ||\n\t\t    ((flags & EXT2_FALLOCATE_FORCE_UNINIT) &&\n\t\t     !(left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)))\n\t\t\tgoto try_right;\n\n\t\tif (fillable > range_len)\n\t\t\tfillable = range_len;\n\n\t\t/* Don't expand an initialized left_ext beyond EOF */\n\t\tx = left_ext->e_lblk + left_ext->e_len - 1;\n\t\tif (!(flags & EXT2_FALLOCATE_INIT_BEYOND_EOF)) {\n\t\t\tdbg_printf(\"%s: lend=%llu newlend=%llu eofblk=%llu\\n\",\n\t\t\t\t   __func__, x, x + fillable, eof_blk);\n\t\t\tif (eof_blk >= x && eof_blk <= x + fillable)\n\t\t\t\tfillable = eof_blk - x;\n\t\t}\n\n\t\tif (fillable == 0)\n\t\t\tgoto try_right;\n\n\t\t/* Test if the right edge of the range is already mapped? */\n\t\tif (EXT2FS_CLUSTER_RATIO(fs) > 1) {\n\t\t\terr = ext2fs_map_cluster_block(fs, ino, inode,\n\t\t\t\t\tx + fillable, &pblk);\n\t\t\tif (err)\n\t\t\t\tgoto out;\n\t\t\tif (pblk)\n\t\t\t\tfillable -= 1 + ((x + fillable)\n\t\t\t\t\t\t & EXT2FS_CLUSTER_MASK(fs));\n\t\t\tif (fillable == 0)\n\t\t\t\tgoto try_right;\n\t\t}\n\n\t\t/* Allocate range of blocks */\n\t\tx = left_ext->e_pblk + left_ext->e_len;\n\t\terr = ext2fs_new_range(fs, EXT2_NEWRANGE_FIXED_GOAL |\n\t\t\t\tEXT2_NEWRANGE_MIN_LENGTH,\n\t\t\t\tx, fillable, NULL, &pblk, &plen);\n\t\tif (err)\n\t\t\tgoto try_right;\n\t\terr = claim_range(fs, inode, pblk, plen);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\t/* Modify left_ext */\n\t\terr = ext2fs_extent_goto(handle, left_ext->e_lblk);\n\t\tif (err)\n\t\t\tgoto out;\n\t\trange_start += plen;\n\t\trange_len -= plen;\n\t\tleft_ext->e_len += plen;\n\t\tdbg_print_extent(\"ext_falloc left+\", left_ext);\n\t\terr = ext2fs_extent_replace(handle, 0, left_ext);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = ext2fs_extent_fix_parents(handle);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\t/* Zero blocks if necessary */\n\t\tif (!(left_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT) &&\n\t\t    (flags & EXT2_FALLOCATE_ZERO_BLOCKS)) {\n\t\t\terr = ext2fs_zero_blocks2(fs, pblk, plen, NULL, NULL);\n\t\t\tif (err)\n\t\t\t\tgoto out;\n\t\t}\n\t}\n\ntry_right:\n\t/* Extend the right extent */\n\tif (right_ext) {\n\t\t/* How much can we attach to right_ext? */\n\t\tif (right_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\t\tfillable = max_uninit_len - right_ext->e_len;\n\t\telse if (flags & EXT2_FALLOCATE_ZERO_BLOCKS)\n\t\t\tfillable = max_init_len - right_ext->e_len;\n\t\telse\n\t\t\tfillable = 0;\n\n\t\t/* User requires init/uninit but extent is uninit/init. */\n\t\tif (((flags & EXT2_FALLOCATE_FORCE_INIT) &&\n\t\t     (right_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)) ||\n\t\t    ((flags & EXT2_FALLOCATE_FORCE_UNINIT) &&\n\t\t     !(right_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT)))\n\t\t\tgoto try_anywhere;\n\n\t\tif (fillable > range_len)\n\t\t\tfillable = range_len;\n\t\tif (fillable == 0)\n\t\t\tgoto try_anywhere;\n\n\t\t/* Test if the left edge of the range is already mapped? */\n\t\tif (EXT2FS_CLUSTER_RATIO(fs) > 1) {\n\t\t\terr = ext2fs_map_cluster_block(fs, ino, inode,\n\t\t\t\t\tright_ext->e_lblk - fillable, &pblk);\n\t\t\tif (err)\n\t\t\t\tgoto out;\n\t\t\tif (pblk)\n\t\t\t\tfillable -= EXT2FS_CLUSTER_RATIO(fs) -\n\t\t\t\t\t\t((right_ext->e_lblk - fillable)\n\t\t\t\t\t\t & EXT2FS_CLUSTER_MASK(fs));\n\t\t\tif (fillable == 0)\n\t\t\t\tgoto try_anywhere;\n\t\t}\n\n\t\t/*\n\t\t * FIXME: It would be nice if we could handle allocating a\n\t\t * variable range from a fixed end point instead of just\n\t\t * skipping to the general allocator if the whole range is\n\t\t * unavailable.\n\t\t */\n\t\terr = ext2fs_new_range(fs, EXT2_NEWRANGE_FIXED_GOAL |\n\t\t\t\tEXT2_NEWRANGE_MIN_LENGTH,\n\t\t\t\tright_ext->e_pblk - fillable,\n\t\t\t\tfillable, NULL, &pblk, &plen);\n\t\tif (err)\n\t\t\tgoto try_anywhere;\n\t\terr = claim_range(fs, inode,\n\t\t\t      pblk & ~EXT2FS_CLUSTER_MASK(fs),\n\t\t\t      plen + (pblk & EXT2FS_CLUSTER_MASK(fs)));\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\t/* Modify right_ext */\n\t\terr = ext2fs_extent_goto(handle, right_ext->e_lblk);\n\t\tif (err)\n\t\t\tgoto out;\n\t\trange_len -= plen;\n\t\tright_ext->e_lblk -= plen;\n\t\tright_ext->e_pblk -= plen;\n\t\tright_ext->e_len += plen;\n\t\tdbg_print_extent(\"ext_falloc right+\", right_ext);\n\t\terr = ext2fs_extent_replace(handle, 0, right_ext);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = ext2fs_extent_fix_parents(handle);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\t/* Zero blocks if necessary */\n\t\tif (!(right_ext->e_flags & EXT2_EXTENT_FLAGS_UNINIT) &&\n\t\t    (flags & EXT2_FALLOCATE_ZERO_BLOCKS)) {\n\t\t\terr = ext2fs_zero_blocks2(fs, pblk,\n\t\t\t\t\tplen + cluster_fill, NULL, NULL);\n\t\t\tif (err)\n\t\t\t\tgoto out;\n\t\t}\n\t}\n\ntry_anywhere:\n\t/* Try implied cluster alloc on the left and right ends */\n\tif (range_len > 0 && (range_start & EXT2FS_CLUSTER_MASK(fs))) {\n\t\tcluster_fill = EXT2FS_CLUSTER_RATIO(fs) -\n\t\t\t       (range_start & EXT2FS_CLUSTER_MASK(fs));\n\t\tcluster_fill &= EXT2FS_CLUSTER_MASK(fs);\n\t\tif (cluster_fill > range_len)\n\t\t\tcluster_fill = range_len;\n\t\tnewex.e_lblk = range_start;\n\t\terr = ext2fs_map_cluster_block(fs, ino, inode, newex.e_lblk,\n\t\t\t\t\t       &pblk);\n\t\tif (err)\n\t\t\tgoto out;\n\t\tif (pblk == 0)\n\t\t\tgoto try_right_implied;\n\t\tnewex.e_pblk = pblk;\n\t\tnewex.e_len = cluster_fill;\n\t\tnewex.e_flags = (flags & EXT2_FALLOCATE_FORCE_INIT ? 0 :\n\t\t\t\t EXT2_EXTENT_FLAGS_UNINIT);\n\t\tdbg_print_extent(\"ext_falloc iclus left+\", &newex);\n\t\text2fs_extent_goto(handle, newex.e_lblk);\n\t\terr = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT,\n\t\t\t\t\t&ex);\n\t\tif (err == EXT2_ET_NO_CURRENT_NODE)\n\t\t\tex.e_lblk = 0;\n\t\telse if (err)\n\t\t\tgoto out;\n\n\t\tif (ex.e_lblk > newex.e_lblk)\n\t\t\top = 0; /* insert before */\n\t\telse\n\t\t\top = EXT2_EXTENT_INSERT_AFTER;\n\t\tdbg_printf(\"%s: inserting %s lblk %llu newex=%llu\\n\",\n\t\t\t   __func__, op ? \"after\" : \"before\", ex.e_lblk,\n\t\t\t   newex.e_lblk);\n\t\terr = ext2fs_extent_insert(handle, op, &newex);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = ext2fs_extent_fix_parents(handle);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\tif (!(newex.e_flags & EXT2_EXTENT_FLAGS_UNINIT) &&\n\t\t    (flags & EXT2_FALLOCATE_ZERO_BLOCKS)) {\n\t\t\terr = ext2fs_zero_blocks2(fs, newex.e_pblk,\n\t\t\t\t\t\t  newex.e_len, NULL, NULL);\n\t\t\tif (err)\n\t\t\t\tgoto out;\n\t\t}\n\n\t\trange_start += cluster_fill;\n\t\trange_len -= cluster_fill;\n\t}\n\ntry_right_implied:\n\ty = range_start + range_len;\n\tif (range_len > 0 && (y & EXT2FS_CLUSTER_MASK(fs))) {\n\t\tcluster_fill = y & EXT2FS_CLUSTER_MASK(fs);\n\t\tif (cluster_fill > range_len)\n\t\t\tcluster_fill = range_len;\n\t\tnewex.e_lblk = y & ~EXT2FS_CLUSTER_MASK(fs);\n\t\terr = ext2fs_map_cluster_block(fs, ino, inode, newex.e_lblk,\n\t\t\t\t\t       &pblk);\n\t\tif (err)\n\t\t\tgoto out;\n\t\tif (pblk == 0)\n\t\t\tgoto no_implied;\n\t\tnewex.e_pblk = pblk;\n\t\tnewex.e_len = cluster_fill;\n\t\tnewex.e_flags = (flags & EXT2_FALLOCATE_FORCE_INIT ? 0 :\n\t\t\t\t EXT2_EXTENT_FLAGS_UNINIT);\n\t\tdbg_print_extent(\"ext_falloc iclus right+\", &newex);\n\t\text2fs_extent_goto(handle, newex.e_lblk);\n\t\terr = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT,\n\t\t\t\t\t&ex);\n\t\tif (err == EXT2_ET_NO_CURRENT_NODE)\n\t\t\tex.e_lblk = 0;\n\t\telse if (err)\n\t\t\tgoto out;\n\n\t\tif (ex.e_lblk > newex.e_lblk)\n\t\t\top = 0; /* insert before */\n\t\telse\n\t\t\top = EXT2_EXTENT_INSERT_AFTER;\n\t\tdbg_printf(\"%s: inserting %s lblk %llu newex=%llu\\n\",\n\t\t\t   __func__, op ? \"after\" : \"before\", ex.e_lblk,\n\t\t\t   newex.e_lblk);\n\t\terr = ext2fs_extent_insert(handle, op, &newex);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = ext2fs_extent_fix_parents(handle);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\tif (!(newex.e_flags & EXT2_EXTENT_FLAGS_UNINIT) &&\n\t\t    (flags & EXT2_FALLOCATE_ZERO_BLOCKS)) {\n\t\t\terr = ext2fs_zero_blocks2(fs, newex.e_pblk,\n\t\t\t\t\t\t  newex.e_len, NULL, NULL);\n\t\t\tif (err)\n\t\t\t\tgoto out;\n\t\t}\n\n\t\trange_len -= cluster_fill;\n\t}\n\nno_implied:\n\tif (range_len == 0)\n\t\treturn 0;\n\n\tnewex.e_lblk = range_start;\n\tif (flags & EXT2_FALLOCATE_FORCE_INIT) {\n\t\tmax_extent_len = max_init_len;\n\t\tnewex.e_flags = 0;\n\t} else {\n\t\tmax_extent_len = max_uninit_len;\n\t\tnewex.e_flags = EXT2_EXTENT_FLAGS_UNINIT;\n\t}\n\tpblk = alloc_goal;\n\ty = range_len;\n\tfor (x = 0; x < y;) {\n\t\tcluster_fill = newex.e_lblk & EXT2FS_CLUSTER_MASK(fs);\n\t\tfillable = min(range_len + cluster_fill, max_extent_len);\n\t\terr = ext2fs_new_range(fs, 0, pblk & ~EXT2FS_CLUSTER_MASK(fs),\n\t\t\t\t       fillable,\n\t\t\t\t       NULL, &pblk, &plen);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = claim_range(fs, inode, pblk, plen);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\t/* Create extent */\n\t\tnewex.e_pblk = pblk + cluster_fill;\n\t\tnewex.e_len = plen - cluster_fill;\n\t\tdbg_print_extent(\"ext_falloc create\", &newex);\n\t\text2fs_extent_goto(handle, newex.e_lblk);\n\t\terr = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT,\n\t\t\t\t\t&ex);\n\t\tif (err == EXT2_ET_NO_CURRENT_NODE)\n\t\t\tex.e_lblk = 0;\n\t\telse if (err)\n\t\t\tgoto out;\n\n\t\tif (ex.e_lblk > newex.e_lblk)\n\t\t\top = 0; /* insert before */\n\t\telse\n\t\t\top = EXT2_EXTENT_INSERT_AFTER;\n\t\tdbg_printf(\"%s: inserting %s lblk %llu newex=%llu\\n\",\n\t\t\t   __func__, op ? \"after\" : \"before\", ex.e_lblk,\n\t\t\t   newex.e_lblk);\n\t\terr = ext2fs_extent_insert(handle, op, &newex);\n\t\tif (err)\n\t\t\tgoto out;\n\t\terr = ext2fs_extent_fix_parents(handle);\n\t\tif (err)\n\t\t\tgoto out;\n\n\t\tif (!(newex.e_flags & EXT2_EXTENT_FLAGS_UNINIT) &&\n\t\t    (flags & EXT2_FALLOCATE_ZERO_BLOCKS)) {\n\t\t\terr = ext2fs_zero_blocks2(fs, pblk, plen, NULL, NULL);\n\t\t\tif (err)\n\t\t\t\tgoto out;\n\t\t}\n\n\t\t/* Update variables at end of loop */\n\t\tx += plen - cluster_fill;\n\t\trange_len -= plen - cluster_fill;\n\t\tnewex.e_lblk += plen - cluster_fill;\n\t\tpblk += plen - cluster_fill;\n\t\tif (pblk >= ext2fs_blocks_count(fs->super))\n\t\t\tpblk = fs->super->s_first_data_block;\n\t}\n\nout:\n\treturn err;\n}\n\nstatic errcode_t extent_fallocate(ext2_filsys fs, int flags, ext2_ino_t ino,\n\t\t\t\t      struct ext2_inode *inode, blk64_t goal,\n\t\t\t\t      blk64_t start, blk64_t len)\n{\n\text2_extent_handle_t\thandle;\n\tstruct ext2fs_extent\tleft_extent, right_extent;\n\tstruct ext2fs_extent\t*left_adjacent, *right_adjacent;\n\terrcode_t\t\terr;\n\tblk64_t\t\t\trange_start, range_end = 0, end, next;\n\tblk64_t\t\t\tcount, goal_distance;\n\n\tend = start + len - 1;\n\terr = ext2fs_extent_open2(fs, ino, inode, &handle);\n\tif (err)\n\t\treturn err;\n\n\t/*\n\t * Find the extent closest to the start of the alloc range.  We don't\n\t * check the return value because _goto() sets the current node to the\n\t * next-lowest extent if 'start' is in a hole; or the next-highest\n\t * extent if there aren't any lower ones; or doesn't set a current node\n\t * if there was a real error reading the extent tree.  In that case,\n\t * _get() will error out.\n\t */\nstart_again:\n\t// coverity[check_return]\n\text2fs_extent_goto(handle, start);\n\terr = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT, &left_extent);\n\tif (err == EXT2_ET_NO_CURRENT_NODE) {\n\t\tblk64_t max_blocks = ext2fs_blocks_count(fs->super);\n\n\t\tif (goal == ~0ULL)\n\t\t\tgoal = ext2fs_find_inode_goal(fs, ino, inode, start);\n\t\terr = ext2fs_find_first_zero_block_bitmap2(fs->block_map,\n\t\t\t\t\t\tgoal, max_blocks - 1, &goal);\n\t\tgoal += start;\n\t\terr = ext_falloc_helper(fs, flags, ino, inode, handle, NULL,\n\t\t\t\t\tNULL, start, len, goal);\n\t\tgoto errout;\n\t} else if (err)\n\t\tgoto errout;\n\n\tdbg_print_extent(\"ext_falloc initial\", &left_extent);\n\tnext = left_extent.e_lblk + left_extent.e_len;\n\tif (left_extent.e_lblk > start) {\n\t\t/* The nearest extent we found was beyond start??? */\n\t\tgoal = left_extent.e_pblk - (left_extent.e_lblk - start);\n\t\terr = ext_falloc_helper(fs, flags, ino, inode, handle, NULL,\n\t\t\t\t\t&left_extent, start,\n\t\t\t\t\tleft_extent.e_lblk - start, goal);\n\t\tif (err)\n\t\t\tgoto errout;\n\n\t\tgoto start_again;\n\t} else if (next >= start) {\n\t\trange_start = next;\n\t\tleft_adjacent = &left_extent;\n\t} else {\n\t\trange_start = start;\n\t\tleft_adjacent = NULL;\n\t}\n\tgoal = left_extent.e_pblk + (range_start - left_extent.e_lblk);\n\n\tdo {\n\t\terr = ext2fs_extent_get(handle, EXT2_EXTENT_NEXT_LEAF,\n\t\t\t\t\t   &right_extent);\n\t\tdbg_printf(\"%s: ino=%d get next =%d\\n\", __func__, ino,\n\t\t\t   (int)err);\n\t\tdbg_print_extent(\"ext_falloc next\", &right_extent);\n\t\t/* Stop if we've seen this extent before */\n\t\tif (!err && right_extent.e_lblk <= left_extent.e_lblk)\n\t\t\terr = EXT2_ET_EXTENT_NO_NEXT;\n\n\t\tif (err && err != EXT2_ET_EXTENT_NO_NEXT)\n\t\t\tgoto errout;\n\t\tif (err == EXT2_ET_EXTENT_NO_NEXT ||\n\t\t    right_extent.e_lblk > end + 1) {\n\t\t\trange_end = end;\n\t\t\tright_adjacent = NULL;\n\t\t} else {\n\t\t\t/* Handle right_extent.e_lblk <= end */\n\t\t\trange_end = right_extent.e_lblk - 1;\n\t\t\tright_adjacent = &right_extent;\n\t\t}\n\t\tgoal_distance = range_start - next;\n\t\tif (err != EXT2_ET_EXTENT_NO_NEXT &&\n\t\t    goal_distance > (range_end - right_extent.e_lblk))\n\t\t\tgoal = right_extent.e_pblk -\n\t\t\t\t\t(right_extent.e_lblk - range_start);\n\n\t\tdbg_printf(\"%s: ino=%d rstart=%llu rend=%llu\\n\", __func__, ino,\n\t\t\t   range_start, range_end);\n\t\terr = 0;\n\t\tif (range_start <= range_end) {\n\t\t\tcount = range_end - range_start + 1;\n\t\t\terr = ext_falloc_helper(fs, flags, ino, inode, handle,\n\t\t\t\t\t\tleft_adjacent, right_adjacent,\n\t\t\t\t\t\trange_start, count, goal);\n\t\t\tif (err)\n\t\t\t\tgoto errout;\n\t\t}\n\n\t\tif (range_end == end)\n\t\t\tbreak;\n\n\t\terr = ext2fs_extent_goto(handle, right_extent.e_lblk);\n\t\tif (err)\n\t\t\tgoto errout;\n\t\tnext = right_extent.e_lblk + right_extent.e_len;\n\t\tleft_extent = right_extent;\n\t\tleft_adjacent = &left_extent;\n\t\trange_start = next;\n\t\tgoal = left_extent.e_pblk + (range_start - left_extent.e_lblk);\n\t} while (range_end < end);\n\nerrout:\n\text2fs_extent_free(handle);\n\treturn err;\n}\n\n/*\n * Map physical blocks to a range of logical blocks within a file.  The range\n * of logical blocks are (start, start + len).  If there are already extents,\n * the mappings will try to extend the mappings; otherwise, it will try to map\n * start as if logical block 0 points to goal.  If goal is ~0ULL, then the goal\n * is calculated based on the inode group.\n *\n * Flags:\n * - EXT2_FALLOCATE_ZERO_BLOCKS: Zero the blocks that are allocated.\n * - EXT2_FALLOCATE_FORCE_INIT: Create only initialized extents.\n * - EXT2_FALLOCATE_FORCE_UNINIT: Create only uninitialized extents.\n * - EXT2_FALLOCATE_INIT_BEYOND_EOF: Create extents beyond EOF.\n *\n * If neither FORCE_INIT nor FORCE_UNINIT are specified, this function will\n * try to expand any extents it finds, zeroing blocks as necessary.\n */\nerrcode_t ext2fs_fallocate(ext2_filsys fs, int flags, ext2_ino_t ino,\n\t\t\t   struct ext2_inode *inode, blk64_t goal,\n\t\t\t   blk64_t start, blk64_t len)\n{\n\tstruct ext2_inode\tinode_buf;\n\tblk64_t\t\t\tblk, x, zero_blk = 0, last = 0;\n\tint\t\t\tzero_len = 0;\n\terrcode_t\t\terr = 0;\n\n\tif (((flags & EXT2_FALLOCATE_FORCE_INIT) &&\n\t    (flags & EXT2_FALLOCATE_FORCE_UNINIT)) ||\n\t   (flags & ~EXT2_FALLOCATE_ALL_FLAGS))\n\t\treturn EXT2_ET_INVALID_ARGUMENT;\n\n\tif (len > ext2fs_blocks_count(fs->super))\n\t\treturn EXT2_ET_BLOCK_ALLOC_FAIL;\n\telse if (len == 0)\n\t\treturn 0;\n\n\t/* Read inode structure if necessary */\n\tif (!inode) {\n\t\terr = ext2fs_read_inode(fs, ino, &inode_buf);\n\t\tif (err)\n\t\t\treturn err;\n\t\tinode = &inode_buf;\n\t}\n\tdbg_printf(\"%s: ino=%d start=%llu len=%llu goal=%llu\\n\", __func__, ino,\n\t\t   start, len, goal);\n\n\tif (inode->i_flags & EXT4_EXTENTS_FL) {\n\t\terr = extent_fallocate(fs, flags, ino, inode, goal, start, len);\n\t\tgoto out;\n\t}\n\n\t/* XXX: Allocate a bunch of blocks the slow way */\n\text2fs_print_progress(0, 0);\n\tfor (blk = start; blk < start + len; blk++) {\n\t\t/* For Rufus usage */\n\t\terr = ext2fs_print_progress(blk, start + len);\n\t\tif (err)\n\t\t\treturn err;\n\t\terr = ext2fs_bmap2(fs, ino, inode, NULL, 0, blk, 0, &x);\n\t\tif (err)\n\t\t\treturn err;\n\t\tif (x)\n\t\t\tcontinue;\n\n\t\terr = ext2fs_bmap2(fs, ino, inode, NULL, BMAP_ALLOC,\n\t\t\t\t   blk, 0, &x);\n\t\tif (err)\n\t\t\tgoto errout;\n\t\tif ((zero_len && (x != last+1)) ||\n\t\t    (zero_len >= 65536)) {\n\t\t\terr = ext2fs_zero_blocks2(fs, zero_blk, zero_len,\n\t\t\t\t\t\t  NULL, NULL);\n\t\t\tzero_len = 0;\n\t\t\tif (err)\n\t\t\t\tgoto errout;\n\t\t}\n\t\tif (zero_len == 0) {\n\t\t\tzero_blk = x;\n\t\t\tzero_len = 1;\n\t\t} else {\n\t\t\tzero_len++;\n\t\t}\n\t\tlast = x;\n\t}\n\nout:\n\tif (inode == &inode_buf)\n\t\text2fs_write_inode(fs, ino, inode);\nerrout:\n\tif (zero_len)\n\t\text2fs_zero_blocks2(fs, zero_blk, zero_len, NULL, NULL);\n\treturn err;\n}\n"
  },
  {
    "path": "src/ext2fs/fileio.c",
    "content": "/*\n * fileio.c --- Simple file I/O routines\n *\n * Copyright (C) 1997 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n#include \"ext2fsP.h\"\n\nstruct ext2_file {\n\terrcode_t\t\tmagic;\n\text2_filsys \t\tfs;\n\text2_ino_t\t\tino;\n\tstruct ext2_inode\tinode;\n\tint \t\t\tflags;\n\t__u64\t\t\tpos;\n\tblk64_t\t\t\tblockno;\n\tblk64_t\t\t\tphysblock;\n\tchar \t\t\t*buf;\n};\n\nstruct block_entry {\n\tblk64_t\t\tphysblock;\n\tunsigned char \tsha[EXT2FS_SHA512_LENGTH];\n};\ntypedef struct block_entry *block_entry_t;\n\n#define BMAP_BUFFER (file->buf + fs->blocksize)\n\nerrcode_t ext2fs_file_open2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t    struct ext2_inode *inode,\n\t\t\t    int flags, ext2_file_t *ret)\n{\n\text2_file_t \tfile;\n\terrcode_t\tretval;\n\n\t/*\n\t * Don't let caller create or open a file for writing if the\n\t * filesystem is read-only.\n\t */\n\tif ((flags & (EXT2_FILE_WRITE | EXT2_FILE_CREATE)) &&\n\t    !(fs->flags & EXT2_FLAG_RW))\n\t\treturn EXT2_ET_RO_FILSYS;\n\n\tretval = ext2fs_get_mem(sizeof(struct ext2_file), &file);\n\tif (retval)\n\t\treturn retval;\n\n\tmemset(file, 0, sizeof(struct ext2_file));\n\tfile->magic = EXT2_ET_MAGIC_EXT2_FILE;\n\tfile->fs = fs;\n\tfile->ino = ino;\n\tfile->flags = flags & EXT2_FILE_MASK;\n\n\tif (inode) {\n\t\tmemcpy(&file->inode, inode, sizeof(struct ext2_inode));\n\t} else {\n\t\tretval = ext2fs_read_inode(fs, ino, &file->inode);\n\t\tif (retval)\n\t\t\tgoto fail;\n\t}\n\n\tretval = ext2fs_get_array(3, fs->blocksize, &file->buf);\n\tif (retval)\n\t\tgoto fail;\n\n\t*ret = file;\n\treturn 0;\n\nfail:\n\tif (file->buf)\n\t\text2fs_free_mem(&file->buf);\n\text2fs_free_mem(&file);\n\treturn retval;\n}\n\nerrcode_t ext2fs_file_open(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t   int flags, ext2_file_t *ret)\n{\n\treturn ext2fs_file_open2(fs, ino, NULL, flags, ret);\n}\n\n/*\n * This function returns the filesystem handle of a file from the structure\n */\next2_filsys ext2fs_file_get_fs(ext2_file_t file)\n{\n\tif (file->magic != EXT2_ET_MAGIC_EXT2_FILE)\n\t\treturn 0;\n\treturn file->fs;\n}\n\n/*\n * This function returns the pointer to the inode of a file from the structure\n */\nstruct ext2_inode *ext2fs_file_get_inode(ext2_file_t file)\n{\n\tif (file->magic != EXT2_ET_MAGIC_EXT2_FILE)\n\t\treturn NULL;\n\treturn &file->inode;\n}\n\n/* This function returns the inode number from the structure */\next2_ino_t ext2fs_file_get_inode_num(ext2_file_t file)\n{\n\tif (file->magic != EXT2_ET_MAGIC_EXT2_FILE)\n\t\treturn 0;\n\treturn file->ino;\n}\n\n/*\n * This function flushes the dirty block buffer out to disk if\n * necessary.\n */\nerrcode_t ext2fs_file_flush(ext2_file_t file)\n{\n\terrcode_t\tretval;\n\text2_filsys fs;\n\tint\t\tret_flags;\n\tblk64_t\t\tdontcare;\n\n\tEXT2_CHECK_MAGIC(file, EXT2_ET_MAGIC_EXT2_FILE);\n\tfs = file->fs;\n\n\tif (!(file->flags & EXT2_FILE_BUF_VALID) ||\n\t    !(file->flags & EXT2_FILE_BUF_DIRTY))\n\t\treturn 0;\n\n\t/* Is this an uninit block? */\n\tif (file->physblock && file->inode.i_flags & EXT4_EXTENTS_FL) {\n\t\tretval = ext2fs_bmap2(fs, file->ino, &file->inode, BMAP_BUFFER,\n\t\t\t\t      0, file->blockno, &ret_flags, &dontcare);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tif (ret_flags & BMAP_RET_UNINIT) {\n\t\t\tretval = ext2fs_bmap2(fs, file->ino, &file->inode,\n\t\t\t\t\t      BMAP_BUFFER, BMAP_SET,\n\t\t\t\t\t      file->blockno, 0,\n\t\t\t\t\t      &file->physblock);\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\t\t}\n\t}\n\n\t/*\n\t * OK, the physical block hasn't been allocated yet.\n\t * Allocate it.\n\t */\n\tif (!file->physblock) {\n\t\tretval = ext2fs_bmap2(fs, file->ino, &file->inode,\n\t\t\t\t     BMAP_BUFFER, file->ino ? BMAP_ALLOC : 0,\n\t\t\t\t     file->blockno, 0, &file->physblock);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\n\tretval = io_channel_write_blk64(fs->io, file->physblock, 1, file->buf);\n\tif (retval)\n\t\treturn retval;\n\n\tfile->flags &= ~EXT2_FILE_BUF_DIRTY;\n\n\treturn retval;\n}\n\n/*\n * This function synchronizes the file's block buffer and the current\n * file position, possibly invalidating block buffer if necessary\n */\nstatic errcode_t sync_buffer_position(ext2_file_t file)\n{\n\tblk64_t\tb;\n\terrcode_t\tretval;\n\n\tb = file->pos / file->fs->blocksize;\n\tif (b != file->blockno) {\n\t\tretval = ext2fs_file_flush(file);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tfile->flags &= ~EXT2_FILE_BUF_VALID;\n\t}\n\tfile->blockno = b;\n\treturn 0;\n}\n\n/*\n * This function loads the file's block buffer with valid data from\n * the disk as necessary.\n *\n * If dontfill is true, then skip initializing the buffer since we're\n * going to be replacing its entire contents anyway.  If set, then the\n * function basically only sets file->physblock and EXT2_FILE_BUF_VALID\n */\n#define DONTFILL 1\nstatic errcode_t load_buffer(ext2_file_t file, int dontfill)\n{\n\text2_filsys\tfs = file->fs;\n\terrcode_t\tretval;\n\tint\t\tret_flags;\n\n\tif (!(file->flags & EXT2_FILE_BUF_VALID)) {\n\t\tretval = ext2fs_bmap2(fs, file->ino, &file->inode,\n\t\t\t\t     BMAP_BUFFER, 0, file->blockno, &ret_flags,\n\t\t\t\t     &file->physblock);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tif (!dontfill) {\n\t\t\tif (file->physblock &&\n\t\t\t    !(ret_flags & BMAP_RET_UNINIT)) {\n\t\t\t\tretval = io_channel_read_blk64(fs->io,\n\t\t\t\t\t\t\t       file->physblock,\n\t\t\t\t\t\t\t       1, file->buf);\n\t\t\t\tif (retval)\n\t\t\t\t\treturn retval;\n\t\t\t} else\n\t\t\t\tmemset(file->buf, 0, fs->blocksize);\n\t\t}\n\t\tfile->flags |= EXT2_FILE_BUF_VALID;\n\t}\n\treturn 0;\n}\n\n\nerrcode_t ext2fs_file_close(ext2_file_t file)\n{\n\terrcode_t\tretval;\n\n\tEXT2_CHECK_MAGIC(file, EXT2_ET_MAGIC_EXT2_FILE);\n\n\tretval = ext2fs_file_flush(file);\n\n\tif (file->buf)\n\t\text2fs_free_mem(&file->buf);\n\text2fs_free_mem(&file);\n\n\treturn retval;\n}\n\n\nstatic errcode_t\next2fs_file_read_inline_data(ext2_file_t file, void *buf,\n\t\t\t     unsigned int wanted, unsigned int *got)\n{\n\text2_filsys fs;\n\terrcode_t retval;\n\tunsigned int count = 0;\n\tsize_t size;\n\n\tfs = file->fs;\n\tretval = ext2fs_inline_data_get(fs, file->ino, &file->inode,\n\t\t\t\t\tfile->buf, &size);\n\tif (retval)\n\t\treturn retval;\n\n\tif (file->pos >= size)\n\t\tgoto out;\n\n\tcount = size - file->pos;\n\tif (count > wanted)\n\t\tcount = wanted;\n\tmemcpy(buf, file->buf + file->pos, count);\n\tfile->pos += count;\n\tbuf = (char *) buf + count;\n\nout:\n\tif (got)\n\t\t*got = count;\n\treturn retval;\n}\n\n\nerrcode_t ext2fs_file_read(ext2_file_t file, void *buf,\n\t\t\t   unsigned int wanted, unsigned int *got)\n{\n\text2_filsys\tfs;\n\terrcode_t\tretval = 0;\n\tunsigned int\tstart, c, count = 0;\n\t__u64\t\tleft;\n\tchar\t\t*ptr = (char *) buf;\n\n\tEXT2_CHECK_MAGIC(file, EXT2_ET_MAGIC_EXT2_FILE);\n\tfs = file->fs;\n\n\t/* If an inode has inline data, things get complicated. */\n\tif (file->inode.i_flags & EXT4_INLINE_DATA_FL)\n\t\treturn ext2fs_file_read_inline_data(file, buf, wanted, got);\n\n\twhile ((file->pos < EXT2_I_SIZE(&file->inode)) && (wanted > 0)) {\n\t\tretval = sync_buffer_position(file);\n\t\tif (retval)\n\t\t\tgoto fail;\n\t\tretval = load_buffer(file, 0);\n\t\tif (retval)\n\t\t\tgoto fail;\n\n\t\tstart = file->pos % fs->blocksize;\n\t\tc = fs->blocksize - start;\n\t\tif (c > wanted)\n\t\t\tc = wanted;\n\t\tleft = EXT2_I_SIZE(&file->inode) - file->pos ;\n\t\tif (c > left)\n\t\t\tc = left;\n\n\t\tmemcpy(ptr, file->buf+start, c);\n\t\tfile->pos += c;\n\t\tptr += c;\n\t\tcount += c;\n\t\twanted -= c;\n\t}\n\nfail:\n\tif (got)\n\t\t*got = count;\n\treturn retval;\n}\n\n\nstatic errcode_t\next2fs_file_write_inline_data(ext2_file_t file, const void *buf,\n\t\t\t      unsigned int nbytes, unsigned int *written)\n{\n\text2_filsys fs;\n\terrcode_t retval;\n\tunsigned int count = 0;\n\tsize_t size;\n\n\tfs = file->fs;\n\tretval = ext2fs_inline_data_get(fs, file->ino, &file->inode,\n\t\t\t\t\tfile->buf, &size);\n\tif (retval)\n\t\treturn retval;\n\n\tif (file->pos < size) {\n\t\tcount = nbytes - file->pos;\n\t\tmemcpy(file->buf + file->pos, buf, count);\n\n\t\tretval = ext2fs_inline_data_set(fs, file->ino, &file->inode,\n\t\t\t\t\t\tfile->buf, count);\n\t\tif (retval == EXT2_ET_INLINE_DATA_NO_SPACE)\n\t\t\tgoto expand;\n\t\tif (retval)\n\t\t\treturn retval;\n\n\t\tfile->pos += count;\n\n\t\t/* Update inode size */\n\t\tif (count != 0 && EXT2_I_SIZE(&file->inode) < file->pos)\n\t\t\tretval = ext2fs_file_set_size2(file, file->pos);\n\n\t\tif (written)\n\t\t\t*written = count;\n\t\treturn 0;\n\t}\n\nexpand:\n\tretval = ext2fs_inline_data_expand(fs, file->ino);\n\tif (retval)\n\t\treturn retval;\n\t/*\n\t * reload inode and return no space error\n\t *\n\t * XXX: file->inode could be copied from the outside\n\t * in ext2fs_file_open2().  We have no way to modify\n\t * the outside inode.\n\t */\n\tretval = ext2fs_read_inode(fs, file->ino, &file->inode);\n\tif (retval)\n\t\treturn retval;\n\treturn EXT2_ET_INLINE_DATA_NO_SPACE;\n}\n\n\nerrcode_t ext2fs_file_write(ext2_file_t file, const void *buf,\n\t\t\t    unsigned int nbytes, unsigned int *written)\n{\n\text2_filsys\tfs;\n\terrcode_t\tretval = 0;\n\tunsigned int\tstart, c, count = 0;\n\tconst char\t*ptr = (const char *) buf;\n\tblock_entry_t\tnew_block = NULL, old_block = NULL;\n\tint\t\tbmap_flags = 0;\n\n\tEXT2_CHECK_MAGIC(file, EXT2_ET_MAGIC_EXT2_FILE);\n\tfs = file->fs;\n\n\tif (!(file->flags & EXT2_FILE_WRITE))\n\t\treturn EXT2_ET_FILE_RO;\n\n\t/* If an inode has inline data, things get complicated. */\n\tif (file->inode.i_flags & EXT4_INLINE_DATA_FL) {\n\t\tretval = ext2fs_file_write_inline_data(file, buf, nbytes,\n\t\t\t\t\t\t       written);\n\t\tif (retval != EXT2_ET_INLINE_DATA_NO_SPACE)\n\t\t\treturn retval;\n\t\t/* fall through to read data from the block */\n\t\tretval = 0;\n\t}\n\n\twhile (nbytes > 0) {\n\t\tretval = sync_buffer_position(file);\n\t\tif (retval)\n\t\t\tgoto fail;\n\n\t\tstart = file->pos % fs->blocksize;\n\t\tc = fs->blocksize - start;\n\t\tif (c > nbytes)\n\t\t\tc = nbytes;\n\n\t\t/*\n\t\t * We only need to do a read-modify-update cycle if\n\t\t * we're doing a partial write.\n\t\t */\n\t\tretval = load_buffer(file, (c == fs->blocksize));\n\t\tif (retval)\n\t\t\tgoto fail;\n\n\t\tfile->flags |= EXT2_FILE_BUF_DIRTY;\n\t\tmemcpy(file->buf+start, ptr, c);\n\n\t\t/*\n\t\t * OK, the physical block hasn't been allocated yet.\n\t\t * Allocate it.\n\t\t */\n\t\tif (!file->physblock) {\n\t\t\tbmap_flags = (file->ino ? BMAP_ALLOC : 0);\n\t\t\tif (fs->flags & EXT2_FLAG_SHARE_DUP) {\n\t\t\t\tnew_block = calloc(1, sizeof(*new_block));\n\t\t\t\tif (!new_block) {\n\t\t\t\t\tretval = EXT2_ET_NO_MEMORY;\n\t\t\t\t\tgoto fail;\n\t\t\t\t}\n\t\t\t\text2fs_sha512((const unsigned char*)file->buf,\n\t\t\t\t\t\tfs->blocksize, new_block->sha);\n\t\t\t\told_block = ext2fs_hashmap_lookup(\n\t\t\t\t\t\t\tfs->block_sha_map,\n\t\t\t\t\t\t\tnew_block->sha,\n\t\t\t\t\t\t\tsizeof(new_block->sha));\n\t\t\t}\n\n\t\t\tif (old_block) {\n\t\t\t\tfile->physblock = old_block->physblock;\n\t\t\t\tbmap_flags |= BMAP_SET;\n\t\t\t\tfree(new_block);\n\t\t\t\tnew_block = NULL;\n\t\t\t}\n\n\t\t\tretval = ext2fs_bmap2(fs, file->ino, &file->inode,\n\t\t\t\t\t      BMAP_BUFFER,\n\t\t\t\t\t      bmap_flags,\n\t\t\t\t\t      file->blockno, 0,\n\t\t\t\t\t      &file->physblock);\n\t\t\tif (retval) {\n\t\t\t\tfree(new_block);\n\t\t\t\tnew_block = NULL;\n\t\t\t\tgoto fail;\n\t\t\t}\n\n\t\t\tif (new_block) {\n\t\t\t\tnew_block->physblock = file->physblock;\n\t\t\t\text2fs_hashmap_add(fs->block_sha_map, new_block,\n\t\t\t\t\tnew_block->sha, sizeof(new_block->sha));\n\t\t\t}\n\n\t\t\tif (bmap_flags & BMAP_SET) {\n\t\t\t\text2fs_iblk_add_blocks(fs, &file->inode, 1);\n\t\t\t\text2fs_write_inode(fs, file->ino, &file->inode);\n\t\t\t}\n\t\t}\n\n\t\tfile->pos += c;\n\t\tptr += c;\n\t\tcount += c;\n\t\tnbytes -= c;\n\t}\n\nfail:\n\t/* Update inode size */\n\tif (count != 0 && EXT2_I_SIZE(&file->inode) < file->pos) {\n\t\terrcode_t\trc;\n\n\t\trc = ext2fs_file_set_size2(file, file->pos);\n\t\tif (retval == 0)\n\t\t\tretval = rc;\n\t}\n\n\tif (written)\n\t\t*written = count;\n\treturn retval;\n}\n\nerrcode_t ext2fs_file_llseek(ext2_file_t file, __u64 offset,\n\t\t\t    int whence, __u64 *ret_pos)\n{\n\tEXT2_CHECK_MAGIC(file, EXT2_ET_MAGIC_EXT2_FILE);\n\n\tif (whence == EXT2_SEEK_SET)\n\t\tfile->pos = offset;\n\telse if (whence == EXT2_SEEK_CUR)\n\t\tfile->pos += offset;\n\telse if (whence == EXT2_SEEK_END)\n\t\tfile->pos = EXT2_I_SIZE(&file->inode) + offset;\n\telse\n\t\treturn EXT2_ET_INVALID_ARGUMENT;\n\n\tif (ret_pos)\n\t\t*ret_pos = file->pos;\n\n\treturn 0;\n}\n\nerrcode_t ext2fs_file_lseek(ext2_file_t file, ext2_off_t offset,\n\t\t\t    int whence, ext2_off_t *ret_pos)\n{\n\t__u64\t\tloffset, ret_loffset = 0;\n\terrcode_t\tretval;\n\n\tloffset = offset;\n\tretval = ext2fs_file_llseek(file, loffset, whence, &ret_loffset);\n\tif (ret_pos)\n\t\t*ret_pos = (ext2_off_t) ret_loffset;\n\treturn retval;\n}\n\n\n/*\n * This function returns the size of the file, according to the inode\n */\nerrcode_t ext2fs_file_get_lsize(ext2_file_t file, __u64 *ret_size)\n{\n\tif (file->magic != EXT2_ET_MAGIC_EXT2_FILE)\n\t\treturn EXT2_ET_MAGIC_EXT2_FILE;\n\t*ret_size = EXT2_I_SIZE(&file->inode);\n\treturn 0;\n}\n\n/*\n * This function returns the size of the file, according to the inode\n */\next2_off_t ext2fs_file_get_size(ext2_file_t file)\n{\n\t__u64\tsize;\n\n\tif (ext2fs_file_get_lsize(file, &size))\n\t\treturn 0;\n\tif ((size >> 32) != 0)\n\t\treturn 0;\n\treturn size;\n}\n\n/* Zero the parts of the last block that are past EOF. */\nstatic errcode_t ext2fs_file_zero_past_offset(ext2_file_t file,\n\t\t\t\t\t      ext2_off64_t offset)\n{\n\text2_filsys fs = file->fs;\n\tchar *b = NULL;\n\text2_off64_t off = offset % fs->blocksize;\n\tblk64_t blk;\n\tint ret_flags;\n\terrcode_t retval;\n\n\tif (off == 0)\n\t\treturn 0;\n\n\tretval = sync_buffer_position(file);\n\tif (retval)\n\t\treturn retval;\n\n\t/* Is there an initialized block at the end? */\n\tretval = ext2fs_bmap2(fs, file->ino, NULL, NULL, 0,\n\t\t\t      offset / fs->blocksize, &ret_flags, &blk);\n\tif (retval)\n\t\treturn retval;\n\tif ((blk == 0) || (ret_flags & BMAP_RET_UNINIT))\n\t\treturn 0;\n\n\t/* Zero to the end of the block */\n\tretval = ext2fs_get_mem(fs->blocksize, &b);\n\tif (retval)\n\t\treturn retval;\n\n\t/* Read/zero/write block */\n\tretval = io_channel_read_blk64(fs->io, blk, 1, b);\n\tif (retval)\n\t\tgoto out;\n\n\tmemset(b + off, 0, fs->blocksize - off);\n\n\tretval = io_channel_write_blk64(fs->io, blk, 1, b);\n\tif (retval)\n\t\tgoto out;\n\nout:\n\text2fs_free_mem(&b);\n\treturn retval;\n}\n\n/*\n * This function sets the size of the file, truncating it if necessary\n *\n */\nerrcode_t ext2fs_file_set_size2(ext2_file_t file, ext2_off64_t size)\n{\n\text2_off64_t\told_size;\n\terrcode_t\tretval;\n\tblk64_t\t\told_truncate, truncate_block;\n\n\tEXT2_CHECK_MAGIC(file, EXT2_ET_MAGIC_EXT2_FILE);\n\n\tif (size && ext2fs_file_block_offset_too_big(file->fs, &file->inode,\n\t\t\t\t\t(size - 1) / file->fs->blocksize))\n\t\treturn EXT2_ET_FILE_TOO_BIG;\n\ttruncate_block = ((size + file->fs->blocksize - 1) >>\n\t\t\t  EXT2_BLOCK_SIZE_BITS(file->fs->super));\n\told_size = EXT2_I_SIZE(&file->inode);\n\told_truncate = ((old_size + file->fs->blocksize - 1) >>\n\t\t      EXT2_BLOCK_SIZE_BITS(file->fs->super));\n\n\tretval = ext2fs_inode_size_set(file->fs, &file->inode, size);\n\tif (retval)\n\t\treturn retval;\n\n\tif (file->ino) {\n\t\tretval = ext2fs_write_inode(file->fs, file->ino, &file->inode);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\n\tretval = ext2fs_file_zero_past_offset(file, size);\n\tif (retval)\n\t\treturn retval;\n\n\tif (truncate_block >= old_truncate)\n\t\treturn 0;\n\n\treturn ext2fs_punch(file->fs, file->ino, &file->inode, 0,\n\t\t\t    truncate_block, ~0ULL);\n}\n\nerrcode_t ext2fs_file_set_size(ext2_file_t file, ext2_off_t size)\n{\n\treturn ext2fs_file_set_size2(file, size);\n}\n"
  },
  {
    "path": "src/ext2fs/freefs.c",
    "content": "/*\n * freefs.c --- free an ext2 filesystem\n *\n * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n#include \"hashmap.h\"\n\nvoid ext2fs_free(ext2_filsys fs)\n{\n\tif (!fs || (fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS))\n\t\treturn;\n\tif (fs->image_io != fs->io) {\n\t\tif (fs->image_io)\n\t\t\tio_channel_close(fs->image_io);\n\t}\n\tif (fs->io) {\n\t\tio_channel_close(fs->io);\n\t}\n\tif (fs->device_name)\n\t\text2fs_free_mem(&fs->device_name);\n\tif (fs->super)\n\t\text2fs_free_mem(&fs->super);\n\tif (fs->orig_super)\n\t\text2fs_free_mem(&fs->orig_super);\n\tif (fs->group_desc)\n\t\text2fs_free_mem(&fs->group_desc);\n\tif (fs->block_map)\n\t\text2fs_free_block_bitmap(fs->block_map);\n\tif (fs->inode_map)\n\t\text2fs_free_inode_bitmap(fs->inode_map);\n\tif (fs->image_header)\n\t\text2fs_free_mem(&fs->image_header);\n\n\tif (fs->badblocks)\n\t\text2fs_badblocks_list_free(fs->badblocks);\n\tfs->badblocks = 0;\n\n\tif (fs->dblist)\n\t\text2fs_free_dblist(fs->dblist);\n\n\tif (fs->icache)\n\t\text2fs_free_inode_cache(fs->icache);\n\n\tif (fs->mmp_buf)\n\t\text2fs_free_mem(&fs->mmp_buf);\n\tif (fs->mmp_cmp)\n\t\text2fs_free_mem(&fs->mmp_cmp);\n\n\tif (fs->block_sha_map)\n\t\text2fs_hashmap_free(fs->block_sha_map);\n\n\tfs->magic = 0;\n\n\t// coverity[check_return]\n\text2fs_zero_blocks2(NULL, 0, 0, NULL, NULL);\n\text2fs_free_mem(&fs);\n}\n\n/*\n * This procedure frees a badblocks list.\n */\nvoid ext2fs_u32_list_free(ext2_u32_list bb)\n{\n\tif (bb->magic != EXT2_ET_MAGIC_BADBLOCKS_LIST)\n\t\treturn;\n\n\tif (bb->list)\n\t\text2fs_free_mem(&bb->list);\n\tbb->list = 0;\n\text2fs_free_mem(&bb);\n}\n\nvoid ext2fs_badblocks_list_free(ext2_badblocks_list bb)\n{\n\text2fs_u32_list_free((ext2_u32_list) bb);\n}\n\n\n/*\n * Free a directory block list\n */\nvoid ext2fs_free_dblist(ext2_dblist dblist)\n{\n\tif (!dblist || (dblist->magic != EXT2_ET_MAGIC_DBLIST))\n\t\treturn;\n\n\tif (dblist->list)\n\t\text2fs_free_mem(&dblist->list);\n\tdblist->list = 0;\n\tif (dblist->fs && dblist->fs->dblist == dblist)\n\t\tdblist->fs->dblist = 0;\n\tdblist->magic = 0;\n\text2fs_free_mem(&dblist);\n}\n\n"
  },
  {
    "path": "src/ext2fs/gen_bitmap.c",
    "content": "/*\n * gen_bitmap.c --- Generic (32-bit) bitmap routines\n *\n * Copyright (C) 2001 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n\nstruct ext2fs_struct_generic_bitmap_32 {\n\terrcode_t\tmagic;\n\text2_filsys \tfs;\n\t__u32\t\tstart, end;\n\t__u32\t\treal_end;\n\tchar\t*\tdescription;\n\tchar\t*\tbitmap;\n\terrcode_t\tbase_error_code;\n\t__u32\t\treserved[7];\n};\n\ntypedef struct ext2fs_struct_generic_bitmap_32 *ext2fs_generic_bitmap_32;\n\n#define EXT2FS_IS_32_BITMAP(bmap) \\\n\t(((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP) || \\\n\t ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP) || \\\n\t ((bmap)->magic == EXT2_ET_MAGIC_INODE_BITMAP))\n\n#define EXT2FS_IS_64_BITMAP(bmap) \\\n\t(((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP64) || \\\n\t ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP64) || \\\n\t ((bmap)->magic == EXT2_ET_MAGIC_INODE_BITMAP64))\n\n/*\n * Used by previously inlined function, so we have to export this and\n * not change the function signature\n */\nvoid ext2fs_warn_bitmap2(ext2fs_generic_bitmap gen_bitmap,\n\t\t\t    int code, unsigned long arg)\n{\n\text2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;\n\n#ifndef OMIT_COM_ERR\n\tif (bitmap->description)\n\t\tcom_err(0, bitmap->base_error_code+code,\n\t\t\t\"#%lu for %s\", arg, bitmap->description);\n\telse\n\t\tcom_err(0, bitmap->base_error_code + code, \"#%lu\", arg);\n#endif\n}\n\nstatic errcode_t check_magic(ext2fs_generic_bitmap bitmap)\n{\n\tif (!bitmap || !((bitmap->magic == EXT2_ET_MAGIC_GENERIC_BITMAP) ||\n\t\t\t (bitmap->magic == EXT2_ET_MAGIC_INODE_BITMAP) ||\n\t\t\t (bitmap->magic == EXT2_ET_MAGIC_BLOCK_BITMAP)))\n\t\treturn EXT2_ET_MAGIC_GENERIC_BITMAP;\n\treturn 0;\n}\n\nerrcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs,\n\t\t\t\t     __u32 start, __u32 end, __u32 real_end,\n\t\t\t\t     const char *descr, char *init_map,\n\t\t\t\t     ext2fs_generic_bitmap *ret)\n{\n\text2fs_generic_bitmap_32 bitmap;\n\terrcode_t\t\tretval;\n\tsize_t\t\t\tsize;\n\n\tretval = ext2fs_get_mem(sizeof(struct ext2fs_struct_generic_bitmap_32),\n\t\t\t\t&bitmap);\n\tif (retval)\n\t\treturn retval;\n\n\tbitmap->magic = magic;\n\tbitmap->fs = fs;\n\tbitmap->start = start;\n\tbitmap->end = end;\n\tbitmap->real_end = real_end;\n\tswitch (magic) {\n\tcase EXT2_ET_MAGIC_INODE_BITMAP:\n\t\tbitmap->base_error_code = EXT2_ET_BAD_INODE_MARK;\n\t\tbreak;\n\tcase EXT2_ET_MAGIC_BLOCK_BITMAP:\n\t\tbitmap->base_error_code = EXT2_ET_BAD_BLOCK_MARK;\n\t\tbreak;\n\tdefault:\n\t\tbitmap->base_error_code = EXT2_ET_BAD_GENERIC_MARK;\n\t}\n\tif (descr) {\n\t\tretval = ext2fs_get_mem(strlen(descr)+1, &bitmap->description);\n\t\tif (retval) {\n\t\t\text2fs_free_mem(&bitmap);\n\t\t\treturn retval;\n\t\t}\n\t\tstrcpy(bitmap->description, descr);\n\t} else\n\t\tbitmap->description = 0;\n\n\tsize = (((size_t)bitmap->real_end - bitmap->start) / 8) + 1;\n\t/* Round up to allow for the BT x86 instruction */\n\tsize = (size + 7) & ~3;\n\tretval = ext2fs_get_mem(size, &bitmap->bitmap);\n\tif (retval) {\n\t\text2fs_free_mem(&bitmap->description);\n\t\text2fs_free_mem(&bitmap);\n\t\treturn retval;\n\t}\n\n\tif (init_map)\n\t\tmemcpy(bitmap->bitmap, init_map, size);\n\telse\n\t\tmemset(bitmap->bitmap, 0, size);\n\t*ret = (ext2fs_generic_bitmap) bitmap;\n\treturn 0;\n}\n\nerrcode_t ext2fs_allocate_generic_bitmap(__u32 start,\n\t\t\t\t\t __u32 end,\n\t\t\t\t\t __u32 real_end,\n\t\t\t\t\t const char *descr,\n\t\t\t\t\t ext2fs_generic_bitmap *ret)\n{\n\treturn ext2fs_make_generic_bitmap(EXT2_ET_MAGIC_GENERIC_BITMAP, 0,\n\t\t\t\t\t  start, end, real_end, descr, 0, ret);\n}\n\nerrcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap gen_src,\n\t\t\t\t     ext2fs_generic_bitmap *dest)\n{\n\text2fs_generic_bitmap_32 src = (ext2fs_generic_bitmap_32) gen_src;\n\n\treturn (ext2fs_make_generic_bitmap(src->magic, src->fs,\n\t\t\t\t\t   src->start, src->end,\n\t\t\t\t\t   src->real_end,\n\t\t\t\t\t   src->description, src->bitmap,\n\t\t\t\t\t   dest));\n}\n\nvoid ext2fs_free_generic_bitmap(ext2fs_inode_bitmap gen_bitmap)\n{\n\text2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;\n\n\tif (check_magic(gen_bitmap))\n\t\treturn;\n\n\tbitmap->magic = 0;\n\tif (bitmap->description) {\n\t\text2fs_free_mem(&bitmap->description);\n\t\tbitmap->description = 0;\n\t}\n\tif (bitmap->bitmap) {\n\t\text2fs_free_mem(&bitmap->bitmap);\n\t\tbitmap->bitmap = 0;\n\t}\n\text2fs_free_mem(&bitmap);\n}\n\nint ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\tblk_t bitno)\n{\n\text2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;\n\n\tif (!EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\tif (EXT2FS_IS_64_BITMAP(bitmap)) {\n\t\t\text2fs_warn_bitmap32(bitmap, __func__);\n\t\t\treturn ext2fs_test_generic_bmap(bitmap, bitno);\n\t\t}\n#ifndef OMIT_COM_ERR\n\t\tcom_err(0, EXT2_ET_MAGIC_GENERIC_BITMAP,\n\t\t\t\"test_bitmap(%lu)\", (unsigned long) bitno);\n#endif\n\t\treturn 0;\n\t}\n\n\tif ((bitno < bitmap32->start) || (bitno > bitmap32->end)) {\n\t\text2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, bitno);\n\t\treturn 0;\n\t}\n\treturn ext2fs_test_bit(bitno - bitmap32->start, bitmap32->bitmap);\n}\n\nint ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t __u32 bitno)\n{\n\text2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;\n\n\tif (!EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\tif (EXT2FS_IS_64_BITMAP(bitmap)) {\n\t\t\text2fs_warn_bitmap32(bitmap, __func__);\n\t\t\treturn ext2fs_mark_generic_bmap(bitmap, bitno);\n\t\t}\n#ifndef OMIT_COM_ERR\n\t\tcom_err(0, EXT2_ET_MAGIC_GENERIC_BITMAP,\n\t\t\t\"mark_bitmap(%lu)\", (unsigned long) bitno);\n#endif\n\t\treturn 0;\n\t}\n\n\tif ((bitno < bitmap32->start) || (bitno > bitmap32->end)) {\n\t\text2fs_warn_bitmap2(bitmap, EXT2FS_MARK_ERROR, bitno);\n\t\treturn 0;\n\t}\n\treturn ext2fs_set_bit(bitno - bitmap32->start, bitmap32->bitmap);\n}\n\nint ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t   blk_t bitno)\n{\n\text2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;\n\n\tif (!EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\tif (EXT2FS_IS_64_BITMAP(bitmap)) {\n\t\t\text2fs_warn_bitmap32(bitmap, __func__);\n\t\t\treturn ext2fs_unmark_generic_bmap(bitmap, bitno);\n\t\t}\n#ifndef OMIT_COM_ERR\n\t\tcom_err(0, EXT2_ET_MAGIC_GENERIC_BITMAP,\n\t\t\t\"mark_bitmap(%lu)\", (unsigned long) bitno);\n#endif\n\t\treturn 0;\n\t}\n\n\tif ((bitno < bitmap32->start) || (bitno > bitmap32->end)) {\n\t\text2fs_warn_bitmap2(bitmap, EXT2FS_UNMARK_ERROR, bitno);\n\t\treturn 0;\n\t}\n\treturn ext2fs_clear_bit(bitno - bitmap32->start, bitmap32->bitmap);\n}\n\n__u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap)\n{\n\text2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;\n\n\tif (!EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\tif (EXT2FS_IS_64_BITMAP(bitmap)) {\n\t\t\text2fs_warn_bitmap32(bitmap, __func__);\n\t\t\treturn ext2fs_get_generic_bmap_start(bitmap);\n\t\t}\n#ifndef OMIT_COM_ERR\n\t\tcom_err(0, EXT2_ET_MAGIC_GENERIC_BITMAP,\n\t\t\t\"get_bitmap_start\");\n#endif\n\t\treturn 0;\n\t}\n\n\treturn bitmap32->start;\n}\n\n__u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap)\n{\n\text2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;\n\n\tif (!EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\tif (EXT2FS_IS_64_BITMAP(bitmap)) {\n\t\t\text2fs_warn_bitmap32(bitmap, __func__);\n\t\t\treturn ext2fs_get_generic_bmap_end(bitmap);\n\t\t}\n#ifndef OMIT_COM_ERR\n\t\tcom_err(0, EXT2_ET_MAGIC_GENERIC_BITMAP,\n\t\t\t\"get_bitmap_end\");\n#endif\n\t\treturn 0;\n\t}\n\treturn bitmap32->end;\n}\n\nvoid ext2fs_clear_generic_bitmap(ext2fs_generic_bitmap bitmap)\n{\n\text2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap;\n\n\tif (!EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\tif (EXT2FS_IS_64_BITMAP(bitmap)) {\n\t\t\text2fs_warn_bitmap32(bitmap, __func__);\n\t\t\text2fs_clear_generic_bmap(bitmap);\n\t\t\treturn;\n\t\t}\n#ifndef OMIT_COM_ERR\n\t\tcom_err(0, EXT2_ET_MAGIC_GENERIC_BITMAP,\n\t\t\t\"clear_generic_bitmap\");\n#endif\n\t\treturn;\n\t}\n\n\tmemset(bitmap32->bitmap, 0,\n\t       (((size_t)bitmap32->real_end - bitmap32->start) / 8) + 1);\n}\n\nerrcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap gen_bitmap,\n\t\t\t\t\t  errcode_t magic, errcode_t neq,\n\t\t\t\t\t  ext2_ino_t end, ext2_ino_t *oend)\n{\n\text2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;\n\n\tEXT2_CHECK_MAGIC(bitmap, magic);\n\n\tif (end > bitmap->real_end)\n\t\treturn neq;\n\tif (oend)\n\t\t*oend = bitmap->end;\n\tbitmap->end = end;\n\treturn 0;\n}\n\nerrcode_t ext2fs_resize_generic_bitmap(errcode_t magic,\n\t\t\t\t       __u32 new_end, __u32 new_real_end,\n\t\t\t\t       ext2fs_generic_bitmap gen_bmap)\n{\n\text2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap;\n\terrcode_t\tretval;\n\tsize_t\t\tsize, new_size;\n\t__u32\t\tbitno;\n\n\tif (!bmap || (bmap->magic != magic))\n\t\treturn magic;\n\n\t/*\n\t * If we're expanding the bitmap, make sure all of the new\n\t * parts of the bitmap are zero.\n\t */\n\tif (new_end > bmap->end) {\n\t\tbitno = bmap->real_end;\n\t\tif (bitno > new_end)\n\t\t\tbitno = new_end;\n\t\tfor (; bitno > bmap->end; bitno--)\n\t\t\text2fs_clear_bit(bitno - bmap->start, bmap->bitmap);\n\t}\n\tif (new_real_end == bmap->real_end) {\n\t\tbmap->end = new_end;\n\t\treturn 0;\n\t}\n\n\tsize = ((bmap->real_end - bmap->start) / 8) + 1;\n\tnew_size = ((new_real_end - bmap->start) / 8) + 1;\n\n\tif (size != new_size) {\n\t\tretval = ext2fs_resize_mem(size, new_size, &bmap->bitmap);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\tif (new_size > size)\n\t\tmemset(bmap->bitmap + size, 0, new_size - size);\n\n\tbmap->end = new_end;\n\tbmap->real_end = new_real_end;\n\treturn 0;\n}\n\nerrcode_t ext2fs_compare_generic_bitmap(errcode_t magic, errcode_t neq,\n\t\t\t\t\text2fs_generic_bitmap gen_bm1,\n\t\t\t\t\text2fs_generic_bitmap gen_bm2)\n{\n\text2fs_generic_bitmap_32 bm1 = (ext2fs_generic_bitmap_32) gen_bm1;\n\text2fs_generic_bitmap_32 bm2 = (ext2fs_generic_bitmap_32) gen_bm2;\n\tblk_t\ti;\n\n\tif (!bm1 || bm1->magic != magic)\n\t\treturn magic;\n\tif (!bm2 || bm2->magic != magic)\n\t\treturn magic;\n\n\tif ((bm1->start != bm2->start) ||\n\t    (bm1->end != bm2->end) ||\n\t    (memcmp(bm1->bitmap, bm2->bitmap,\n\t\t    (size_t) (bm1->end - bm1->start)/8)))\n\t\treturn neq;\n\n\tfor (i = bm1->end - ((bm1->end - bm1->start) % 8); i <= bm1->end; i++)\n\t\tif (ext2fs_fast_test_block_bitmap(gen_bm1, i) !=\n\t\t    ext2fs_fast_test_block_bitmap(gen_bm2, i))\n\t\t\treturn neq;\n\n\treturn 0;\n}\n\nvoid ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap gen_map)\n{\n\text2fs_generic_bitmap_32 map = (ext2fs_generic_bitmap_32) gen_map;\n\t__u32\ti, j;\n\n\t/* Protect loop from wrap-around if map->real_end is maxed */\n\tfor (i=map->end+1, j = i - map->start;\n\t     i <= map->real_end && i > map->end;\n\t     i++, j++)\n\t\text2fs_set_bit(j, map->bitmap);\n}\n\nerrcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap gen_bmap,\n\t\t\t\t\t  errcode_t magic,\n\t\t\t\t\t  __u32 start, __u32 num,\n\t\t\t\t\t  void *out)\n{\n\text2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap;\n\n\tif (!bmap || (bmap->magic != magic))\n\t\treturn magic;\n\n\tif ((start < bmap->start) || (start+num-1 > bmap->real_end))\n\t\treturn EXT2_ET_INVALID_ARGUMENT;\n\n\tmemcpy(out, bmap->bitmap + (start >> 3), (num+7) >> 3);\n\treturn 0;\n}\n\nerrcode_t ext2fs_set_generic_bitmap_range(ext2fs_generic_bitmap gen_bmap,\n\t\t\t\t\t  errcode_t magic,\n\t\t\t\t\t  __u32 start, __u32 num,\n\t\t\t\t\t  void *in)\n{\n\text2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap;\n\n\tif (!bmap || (bmap->magic != magic))\n\t\treturn magic;\n\n\tif ((start < bmap->start) || (start+num-1 > bmap->real_end))\n\t\treturn EXT2_ET_INVALID_ARGUMENT;\n\n\tmemcpy(bmap->bitmap + (start >> 3), in, (num+7) >> 3);\n\treturn 0;\n}\n\n/*\n * Compare @mem to zero buffer by 256 bytes.\n * Return 1 if @mem is zeroed memory, otherwise return 0.\n */\nint ext2fs_mem_is_zero(const char *mem, size_t len)\n{\n\tstatic const char zero_buf[256];\n\n\twhile (len >= sizeof(zero_buf)) {\n\t\tif (memcmp(mem, zero_buf, sizeof(zero_buf)))\n\t\t\treturn 0;\n\t\tlen -= sizeof(zero_buf);\n\t\tmem += sizeof(zero_buf);\n\t}\n\t/* Deal with leftover bytes. */\n\tif (len)\n\t\treturn !memcmp(mem, zero_buf, len);\n\treturn 1;\n}\n\n/*\n * Return true if all of the bits in a specified range are clear\n */\nstatic int ext2fs_test_clear_generic_bitmap_range(ext2fs_generic_bitmap gen_bitmap,\n\t\t\t\t\t\t  unsigned int start,\n\t\t\t\t\t\t  unsigned int len)\n{\n\text2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;\n\tsize_t start_byte, len_byte = len >> 3;\n\tunsigned int start_bit, len_bit = len % 8;\n\tint first_bit = 0;\n\tint last_bit  = 0;\n\tint mark_count = 0;\n\tint mark_bit = 0;\n\tint i;\n\tconst char *ADDR = bitmap->bitmap;\n\n\tstart -= bitmap->start;\n\tstart_byte = start >> 3;\n\tstart_bit = start % 8;\n\n\tif (start_bit != 0) {\n\t\t/*\n\t\t * The compared start block number or start inode number\n\t\t * is not the first bit in a byte.\n\t\t */\n\t\tmark_count = 8 - start_bit;\n\t\tif (len < 8 - start_bit) {\n\t\t\tmark_count = (int)len;\n\t\t\tmark_bit = len + start_bit - 1;\n\t\t} else\n\t\t\tmark_bit = 7;\n\n\t\tfor (i = mark_count; i > 0; i--, mark_bit--)\n\t\t\tfirst_bit |= 1 << mark_bit;\n\n\t\t/*\n\t\t * Compare blocks or inodes in the first byte.\n\t\t * If there is any marked bit, this function returns 0.\n\t\t */\n\t\tif (first_bit & ADDR[start_byte])\n\t\t\treturn 0;\n\t\telse if (len <= 8 - start_bit)\n\t\t\treturn 1;\n\n\t\tstart_byte++;\n\t\tlen_bit = (len - mark_count) % 8;\n\t\tlen_byte = (len - mark_count) >> 3;\n\t}\n\n\t/*\n\t * The compared start block number or start inode number is\n\t * the first bit in a byte.\n\t */\n\tif (len_bit != 0) {\n\t\t/*\n\t\t * The compared end block number or end inode number is\n\t\t * not the last bit in a byte.\n\t\t */\n\t\tfor (mark_bit = len_bit - 1; mark_bit >= 0; mark_bit--)\n\t\t\tlast_bit |= 1 << mark_bit;\n\n\t\t/*\n\t\t * Compare blocks or inodes in the last byte.\n\t\t * If there is any marked bit, this function returns 0.\n\t\t */\n\t\tif (last_bit & ADDR[start_byte + len_byte])\n\t\t\treturn 0;\n\t\telse if (len_byte == 0)\n\t\t\treturn 1;\n\t}\n\n\t/* Check whether all bytes are 0 */\n\treturn ext2fs_mem_is_zero(ADDR + start_byte, len_byte);\n}\n\nerrcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap gen_bitmap,\n\t\t\t\t\t\t__u32 start, __u32 end,\n\t\t\t\t\t\t__u32 *out)\n{\n\text2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;\n\tblk_t b;\n\n\tif (start < bitmap->start || end > bitmap->end || start > end) {\n\t\text2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR, start);\n\t\treturn EINVAL;\n\t}\n\n\twhile (start <= end) {\n\t\tb = ext2fs_test_bit(start - bitmap->start, bitmap->bitmap);\n\t\tif (!b) {\n\t\t\t*out = start;\n\t\t\treturn 0;\n\t\t}\n\t\tstart++;\n\t}\n\n\treturn ENOENT;\n}\n\nerrcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap gen_bitmap,\n\t\t\t\t\t       __u32 start, __u32 end,\n\t\t\t\t\t       __u32 *out)\n{\n\text2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;\n\tblk_t b;\n\n\tif (start < bitmap->start || end > bitmap->end || start > end) {\n\t\text2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR, start);\n\t\treturn EINVAL;\n\t}\n\n\twhile (start <= end) {\n\t\tb = ext2fs_test_bit(start - bitmap->start, bitmap->bitmap);\n\t\tif (b) {\n\t\t\t*out = start;\n\t\t\treturn 0;\n\t\t}\n\t\tstart++;\n\t}\n\n\treturn ENOENT;\n}\n\nint ext2fs_test_block_bitmap_range(ext2fs_block_bitmap gen_bitmap,\n\t\t\t\t   blk_t block, int num)\n{\n\text2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;\n\n\tEXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_BLOCK_BITMAP);\n\tif ((block < bitmap->start) || (block > bitmap->real_end) ||\n\t    (block+num-1 > bitmap->real_end)) {\n\t\text2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_TEST,\n\t\t\t\t   block, bitmap->description);\n\t\treturn 0;\n\t}\n\treturn ext2fs_test_clear_generic_bitmap_range((ext2fs_generic_bitmap)\n\t\t\t\t\t\t      bitmap, block, num);\n}\n\nint ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap gen_bitmap,\n\t\t\t\t   ext2_ino_t inode, int num)\n{\n\text2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;\n\n\tEXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_INODE_BITMAP);\n\tif ((inode < bitmap->start) || (inode > bitmap->real_end) ||\n\t    (inode+num-1 > bitmap->real_end)) {\n\t\text2fs_warn_bitmap(EXT2_ET_BAD_INODE_TEST,\n\t\t\t\t   inode, bitmap->description);\n\t\treturn 0;\n\t}\n\treturn ext2fs_test_clear_generic_bitmap_range((ext2fs_generic_bitmap)\n\t\t\t\t\t\t      bitmap, inode, num);\n}\n\nvoid ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap gen_bitmap,\n\t\t\t\t    blk_t block, int num)\n{\n\text2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;\n\tint\ti;\n\n\tif ((block < bitmap->start) || (block > bitmap->end) ||\n\t    (block+num-1 > bitmap->end)) {\n\t\text2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_MARK, block,\n\t\t\t\t   bitmap->description);\n\t\treturn;\n\t}\n\tfor (i=0; i < num; i++)\n\t\text2fs_fast_set_bit(block + i - bitmap->start, bitmap->bitmap);\n}\n\nvoid ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap gen_bitmap,\n\t\t\t\t      blk_t block, int num)\n{\n\text2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap;\n\tint\ti;\n\n\tif ((block < bitmap->start) || (block > bitmap->end) ||\n\t    (block+num-1 > bitmap->end)) {\n\t\text2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_UNMARK, block,\n\t\t\t\t   bitmap->description);\n\t\treturn;\n\t}\n\tfor (i=0; i < num; i++)\n\t\text2fs_fast_clear_bit(block + i - bitmap->start,\n\t\t\t\t      bitmap->bitmap);\n}\n\n"
  },
  {
    "path": "src/ext2fs/gen_bitmap64.c",
    "content": "/*\n * gen_bitmap64.c --- routines to read, write, and manipulate the new qinode and\n * block bitmaps.\n *\n * Copyright (C) 2007, 2008 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Public\n * License.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#include <errno.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#ifdef HAVE_SYS_TIME_H\n#include <sys/time.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n#include \"bmap64.h\"\n\n/*\n * Design of 64-bit bitmaps\n *\n * In order maintain ABI compatibility with programs that don't\n * understand about 64-bit blocks/inodes,\n * ext2fs_allocate_inode_bitmap() and ext2fs_allocate_block_bitmap()\n * will create old-style bitmaps unless the application passes the\n * flag EXT2_FLAG_64BITS to ext2fs_open().  If this flag is\n * passed, then we know the application has been recompiled, so we can\n * use the new-style bitmaps.  If it is not passed, we have to return\n * an error if trying to open a filesystem which needs 64-bit bitmaps.\n *\n * The new bitmaps use a new set of structure magic numbers, so that\n * both the old-style and new-style interfaces can identify which\n * version of the data structure was used.  Both the old-style and\n * new-style interfaces will support either type of bitmap, although\n * of course 64-bit operation will only be possible when both the\n * new-style interface and the new-style bitmap are used.\n *\n * For example, the new bitmap interfaces will check the structure\n * magic numbers and so will be able to detect old-stype bitmap.  If\n * they see an old-style bitmap, they will pass it to the gen_bitmap.c\n * functions for handling.  The same will be true for the old\n * interfaces as well.\n *\n * The new-style interfaces will have several different back-end\n * implementations, so we can support different encodings that are\n * appropriate for different applications.  In general the default\n * should be whatever makes sense, and what the application/library\n * will use.  However, e2fsck may need specialized implementations for\n * its own uses.  For example, when doing parent directory pointer\n * loop detections in pass 3, the bitmap will *always* be sparse, so\n * e2fsck can request an encoding which is optimized for that.\n */\n\nstatic void warn_bitmap(ext2fs_generic_bitmap_64 bitmap,\n\t\t\tint code, __u64 arg)\n{\n#ifndef OMIT_COM_ERR\n\tif (bitmap->description)\n\t\tcom_err(0, bitmap->base_error_code+code,\n\t\t\t\"#%llu for %s\", arg, bitmap->description);\n\telse\n\t\tcom_err(0, bitmap->base_error_code + code, \"#%llu\", arg);\n#endif\n}\n\n#ifdef ENABLE_BMAP_STATS_OPS\n#define INC_STAT(map, name) map->stats.name\n#else\n#define INC_STAT(map, name) ;;\n#endif\n\n\nerrcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic,\n\t\t\t\t    int type, __u64 start, __u64 end,\n\t\t\t\t    __u64 real_end,\n\t\t\t\t    const char *descr,\n\t\t\t\t    ext2fs_generic_bitmap *ret)\n{\n\text2fs_generic_bitmap_64 bitmap;\n\tstruct ext2_bitmap_ops\t*ops;\n\text2_ino_t num_dirs;\n\terrcode_t retval;\n\n\tif (!type)\n\t\ttype = EXT2FS_BMAP64_BITARRAY;\n\n\tswitch (type) {\n\tcase EXT2FS_BMAP64_BITARRAY:\n\t\tops = &ext2fs_blkmap64_bitarray;\n\t\tbreak;\n\tcase EXT2FS_BMAP64_RBTREE:\n\t\tops = &ext2fs_blkmap64_rbtree;\n\t\tbreak;\n\tcase EXT2FS_BMAP64_AUTODIR:\n\t\tretval = ext2fs_get_num_dirs(fs, &num_dirs);\n\t\tif (retval || num_dirs > (fs->super->s_inodes_count / 320))\n\t\t\tops = &ext2fs_blkmap64_bitarray;\n\t\telse\n\t\t\tops = &ext2fs_blkmap64_rbtree;\n\t\tbreak;\n\tdefault:\n\t\treturn EINVAL;\n\t}\n\n\tretval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap_64),\n\t\t\t\t    &bitmap);\n\tif (retval)\n\t\treturn retval;\n\n#ifdef ENABLE_BMAP_STATS\n\tif (gettimeofday(&bitmap->stats.created,\n\t\t\t (struct timezone *) NULL) == -1) {\n\t\tperror(\"gettimeofday\");\n\t\text2fs_free_mem(&bitmap);\n\t\treturn 1;\n\t}\n\tbitmap->stats.type = type;\n#endif\n\n\t/* XXX factor out, repeated in copy_bmap */\n\tbitmap->magic = magic;\n\tbitmap->fs = fs;\n\tbitmap->start = start;\n\tbitmap->end = end;\n\tbitmap->real_end = real_end;\n\tbitmap->bitmap_ops = ops;\n\tbitmap->cluster_bits = 0;\n\tswitch (magic) {\n\tcase EXT2_ET_MAGIC_INODE_BITMAP64:\n\t\tbitmap->base_error_code = EXT2_ET_BAD_INODE_MARK;\n\t\tbreak;\n\tcase EXT2_ET_MAGIC_BLOCK_BITMAP64:\n\t\tbitmap->base_error_code = EXT2_ET_BAD_BLOCK_MARK;\n\t\tbitmap->cluster_bits = fs->cluster_ratio_bits;\n\t\tbreak;\n\tdefault:\n\t\tbitmap->base_error_code = EXT2_ET_BAD_GENERIC_MARK;\n\t}\n\tif (descr) {\n\t\tretval = ext2fs_get_mem(strlen(descr)+1, &bitmap->description);\n\t\tif (retval) {\n\t\t\text2fs_free_mem(&bitmap);\n\t\t\treturn retval;\n\t\t}\n\t\tstrcpy(bitmap->description, descr);\n\t} else\n\t\tbitmap->description = 0;\n\n\tretval = bitmap->bitmap_ops->new_bmap(fs, bitmap);\n\tif (retval) {\n\t\text2fs_free_mem(&bitmap->description);\n\t\text2fs_free_mem(&bitmap);\n\t\treturn retval;\n\t}\n\n\t*ret = (ext2fs_generic_bitmap) bitmap;\n\treturn 0;\n}\n\n#ifdef ENABLE_BMAP_STATS\nstatic void ext2fs_print_bmap_statistics(ext2fs_generic_bitmap_64 bitmap)\n{\n\tstruct ext2_bmap_statistics *stats = &bitmap->stats;\n#ifdef ENABLE_BMAP_STATS_OPS\n\tfloat mark_seq_perc = 0.0, test_seq_perc = 0.0;\n\tfloat mark_back_perc = 0.0, test_back_perc = 0.0;\n#endif\n\tdouble inuse;\n\tstruct timeval now;\n\n#ifdef ENABLE_BMAP_STATS_OPS\n\tif (stats->test_count) {\n\t\ttest_seq_perc = ((float)stats->test_seq /\n\t\t\t\t stats->test_count) * 100;\n\t\ttest_back_perc = ((float)stats->test_back /\n\t\t\t\t  stats->test_count) * 100;\n\t}\n\n\tif (stats->mark_count) {\n\t\tmark_seq_perc = ((float)stats->mark_seq /\n\t\t\t\t stats->mark_count) * 100;\n\t\tmark_back_perc = ((float)stats->mark_back /\n\t\t\t\t  stats->mark_count) * 100;\n\t}\n#endif\n\n\tif (gettimeofday(&now, (struct timezone *) NULL) == -1) {\n\t\tperror(\"gettimeofday\");\n\t\treturn;\n\t}\n\n\tinuse = (double) now.tv_sec + \\\n\t\t(((double) now.tv_usec) * 0.000001);\n\tinuse -= (double) stats->created.tv_sec + \\\n\t\t(((double) stats->created.tv_usec) * 0.000001);\n\n\tfprintf(stderr, \"\\n[+] %s bitmap (type %d)\\n\", bitmap->description,\n\t\tstats->type);\n\tfprintf(stderr, \"=================================================\\n\");\n#ifdef ENABLE_BMAP_STATS_OPS\n\tfprintf(stderr, \"%16llu bits long\\n\",\n\t\tbitmap->real_end - bitmap->start);\n\tfprintf(stderr, \"%16lu copy_bmap\\n%16lu resize_bmap\\n\",\n\t\tstats->copy_count, stats->resize_count);\n\tfprintf(stderr, \"%16lu mark bmap\\n%16lu unmark_bmap\\n\",\n\t\tstats->mark_count, stats->unmark_count);\n\tfprintf(stderr, \"%16lu test_bmap\\n%16lu mark_bmap_extent\\n\",\n\t\tstats->test_count, stats->mark_ext_count);\n\tfprintf(stderr, \"%16lu unmark_bmap_extent\\n\"\n\t\t\"%16lu test_clear_bmap_extent\\n\",\n\t\tstats->unmark_ext_count, stats->test_ext_count);\n\tfprintf(stderr, \"%16lu set_bmap_range\\n%16lu set_bmap_range\\n\",\n\t\tstats->set_range_count, stats->get_range_count);\n\tfprintf(stderr, \"%16lu clear_bmap\\n%16lu contiguous bit test (%.2f%%)\\n\",\n\t\tstats->clear_count, stats->test_seq, test_seq_perc);\n\tfprintf(stderr, \"%16lu contiguous bit mark (%.2f%%)\\n\"\n\t\t\"%16llu bits tested backwards (%.2f%%)\\n\",\n\t\tstats->mark_seq, mark_seq_perc,\n\t\tstats->test_back, test_back_perc);\n\tfprintf(stderr, \"%16llu bits marked backwards (%.2f%%)\\n\"\n\t\t\"%16.2f seconds in use\\n\",\n\t\tstats->mark_back, mark_back_perc, inuse);\n#endif /* ENABLE_BMAP_STATS_OPS */\n}\n#endif\n\nvoid ext2fs_free_generic_bmap(ext2fs_generic_bitmap gen_bmap)\n{\n\text2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;\n\n\tif (!bmap)\n\t\treturn;\n\n\tif (EXT2FS_IS_32_BITMAP(bmap)) {\n\t\text2fs_free_generic_bitmap(gen_bmap);\n\t\treturn;\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bmap))\n\t\treturn;\n\n#ifdef ENABLE_BMAP_STATS\n\tif (getenv(\"E2FSPROGS_BITMAP_STATS\")) {\n\t\text2fs_print_bmap_statistics(bmap);\n\t\tbmap->bitmap_ops->print_stats(bmap);\n\t}\n#endif\n\n\tbmap->bitmap_ops->free_bmap(bmap);\n\n\tif (bmap->description) {\n\t\text2fs_free_mem(&bmap->description);\n\t\tbmap->description = 0;\n\t}\n\tbmap->magic = 0;\n\text2fs_free_mem(&bmap);\n}\n\nerrcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap gen_src,\n\t\t\t\t   ext2fs_generic_bitmap *dest)\n{\n\text2fs_generic_bitmap_64 src = (ext2fs_generic_bitmap_64) gen_src;\n\tchar *descr, *new_descr;\n\text2fs_generic_bitmap_64 new_bmap;\n\terrcode_t retval;\n\n\tif (!src)\n\t\treturn EINVAL;\n\n\tif (EXT2FS_IS_32_BITMAP(src))\n\t\treturn ext2fs_copy_generic_bitmap(gen_src, dest);\n\n\tif (!EXT2FS_IS_64_BITMAP(src))\n\t\treturn EINVAL;\n\n\t/* Allocate a new bitmap struct */\n\tretval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap_64),\n\t\t\t\t    &new_bmap);\n\tif (retval)\n\t\treturn retval;\n\n\n#ifdef ENABLE_BMAP_STATS_OPS\n\tsrc->stats.copy_count++;\n#endif\n#ifdef ENABLE_BMAP_STATS\n\tif (gettimeofday(&new_bmap->stats.created,\n\t\t\t (struct timezone *) NULL) == -1) {\n\t\tperror(\"gettimeofday\");\n\t\text2fs_free_mem(&new_bmap);\n\t\treturn 1;\n\t}\n\tnew_bmap->stats.type = src->stats.type;\n#endif\n\n\t/* Copy all the high-level parts over */\n\tnew_bmap->magic = src->magic;\n\tnew_bmap->fs = src->fs;\n\tnew_bmap->start = src->start;\n\tnew_bmap->end = src->end;\n\tnew_bmap->real_end = src->real_end;\n\tnew_bmap->bitmap_ops = src->bitmap_ops;\n\tnew_bmap->base_error_code = src->base_error_code;\n\tnew_bmap->cluster_bits = src->cluster_bits;\n\n\tdescr = src->description;\n\tif (descr) {\n\t\tretval = ext2fs_get_mem(strlen(descr)+10, &new_descr);\n\t\tif (retval) {\n\t\t\text2fs_free_mem(&new_bmap);\n\t\t\treturn retval;\n\t\t}\n\t\tstrcpy(new_descr, \"copy of \");\n\t\tstrcat(new_descr, descr);\n\t\tnew_bmap->description = new_descr;\n\t}\n\n\tretval = src->bitmap_ops->copy_bmap(src, new_bmap);\n\tif (retval) {\n\t\text2fs_free_mem(&new_bmap->description);\n\t\text2fs_free_mem(&new_bmap);\n\t\treturn retval;\n\t}\n\n\t*dest = (ext2fs_generic_bitmap) new_bmap;\n\n\treturn 0;\n}\n\nerrcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap gen_bmap,\n\t\t\t\t     __u64 new_end,\n\t\t\t\t     __u64 new_real_end)\n{\n\text2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;\n\n\tif (!bmap)\n\t\treturn EINVAL;\n\n\tif (EXT2FS_IS_32_BITMAP(bmap))\n\t\treturn ext2fs_resize_generic_bitmap(gen_bmap->magic, new_end,\n\t\t\t\t\t\t    new_real_end, gen_bmap);\n\n\tif (!EXT2FS_IS_64_BITMAP(bmap))\n\t\treturn EINVAL;\n\n\tINC_STAT(bmap, resize_count);\n\n\treturn bmap->bitmap_ops->resize_bmap(bmap, new_end, new_real_end);\n}\n\nerrcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap,\n\t\t\t\t\terrcode_t neq,\n\t\t\t\t\t__u64 end, __u64 *oend)\n{\n\text2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;\n\n\tif (!bitmap)\n\t\treturn EINVAL;\n\n\tif (EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\text2_ino_t tmp_oend;\n\t\tint retval;\n\n\t\tretval = ext2fs_fudge_generic_bitmap_end(gen_bitmap,\n\t\t\t\t\t\t\t bitmap->magic,\n\t\t\t\t\t\t\t neq, end, &tmp_oend);\n\t\tif (oend)\n\t\t\t*oend = tmp_oend;\n\t\treturn retval;\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bitmap))\n\t\treturn EINVAL;\n\n\tif (end > bitmap->real_end)\n\t\treturn neq;\n\tif (oend)\n\t\t*oend = bitmap->end;\n\tbitmap->end = end;\n\treturn 0;\n}\n\n__u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap gen_bitmap)\n{\n\text2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;\n\n\tif (!bitmap)\n\t\treturn EINVAL;\n\n\tif (EXT2FS_IS_32_BITMAP(bitmap))\n\t\treturn ext2fs_get_generic_bitmap_start(gen_bitmap);\n\n\tif (!EXT2FS_IS_64_BITMAP(bitmap))\n\t\treturn EINVAL;\n\n\treturn bitmap->start;\n}\n\n__u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap)\n{\n\text2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;\n\n\tif (!bitmap)\n\t\treturn EINVAL;\n\n\tif (EXT2FS_IS_32_BITMAP(bitmap))\n\t\treturn ext2fs_get_generic_bitmap_end(gen_bitmap);\n\n\tif (!EXT2FS_IS_64_BITMAP(bitmap))\n\t\treturn EINVAL;\n\n\treturn bitmap->end;\n}\n\nvoid ext2fs_clear_generic_bmap(ext2fs_generic_bitmap gen_bitmap)\n{\n\text2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;\n\n\tif (EXT2FS_IS_32_BITMAP(bitmap))\n\t\text2fs_clear_generic_bitmap(gen_bitmap);\n\telse\n\t\tbitmap->bitmap_ops->clear_bmap(bitmap);\n}\n\nint ext2fs_mark_generic_bmap(ext2fs_generic_bitmap gen_bitmap,\n\t\t\t     __u64 arg)\n{\n\text2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;\n\n\tif (!bitmap)\n\t\treturn 0;\n\n\tif (EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\tif (arg & ~0xffffffffULL) {\n\t\t\text2fs_warn_bitmap2(gen_bitmap,\n\t\t\t\t\t    EXT2FS_MARK_ERROR, 0xffffffff);\n\t\t\treturn 0;\n\t\t}\n\t\treturn ext2fs_mark_generic_bitmap(gen_bitmap, arg);\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bitmap))\n\t\treturn 0;\n\n\targ >>= bitmap->cluster_bits;\n\n#ifdef ENABLE_BMAP_STATS_OPS\n\tif (arg == bitmap->stats.last_marked + 1)\n\t\tbitmap->stats.mark_seq++;\n\tif (arg < bitmap->stats.last_marked)\n\t\tbitmap->stats.mark_back++;\n\tbitmap->stats.last_marked = arg;\n\tbitmap->stats.mark_count++;\n#endif\n\n\tif ((arg < bitmap->start) || (arg > bitmap->end)) {\n\t\twarn_bitmap(bitmap, EXT2FS_MARK_ERROR, arg);\n\t\treturn 0;\n\t}\n\n\treturn bitmap->bitmap_ops->mark_bmap(bitmap, arg);\n}\n\nint ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap gen_bitmap,\n\t\t\t       __u64 arg)\n{\n\text2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;\n\n\tif (!bitmap)\n\t\treturn 0;\n\n\tif (EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\tif (arg & ~0xffffffffULL) {\n\t\t\text2fs_warn_bitmap2(gen_bitmap, EXT2FS_UNMARK_ERROR,\n\t\t\t\t\t    0xffffffff);\n\t\t\treturn 0;\n\t\t}\n\t\treturn ext2fs_unmark_generic_bitmap(gen_bitmap, arg);\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bitmap))\n\t\treturn 0;\n\n\targ >>= bitmap->cluster_bits;\n\n\tINC_STAT(bitmap, unmark_count);\n\n\tif ((arg < bitmap->start) || (arg > bitmap->end)) {\n\t\twarn_bitmap(bitmap, EXT2FS_UNMARK_ERROR, arg);\n\t\treturn 0;\n\t}\n\n\treturn bitmap->bitmap_ops->unmark_bmap(bitmap, arg);\n}\n\nint ext2fs_test_generic_bmap(ext2fs_generic_bitmap gen_bitmap,\n\t\t\t     __u64 arg)\n{\n\text2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;\n\tif (!bitmap)\n\t\treturn 0;\n\n\tif (EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\tif (arg & ~0xffffffffULL) {\n\t\t\text2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR,\n\t\t\t\t\t    0xffffffff);\n\t\t\treturn 0;\n\t\t}\n\t\treturn ext2fs_test_generic_bitmap(gen_bitmap, arg);\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bitmap))\n\t\treturn 0;\n\n\targ >>= bitmap->cluster_bits;\n\n#ifdef ENABLE_BMAP_STATS_OPS\n\tbitmap->stats.test_count++;\n\tif (arg == bitmap->stats.last_tested + 1)\n\t\tbitmap->stats.test_seq++;\n\tif (arg < bitmap->stats.last_tested)\n\t\tbitmap->stats.test_back++;\n\tbitmap->stats.last_tested = arg;\n#endif\n\n\tif ((arg < bitmap->start) || (arg > bitmap->end)) {\n\t\twarn_bitmap(bitmap, EXT2FS_TEST_ERROR, arg);\n\t\treturn 0;\n\t}\n\n\treturn bitmap->bitmap_ops->test_bmap(bitmap, arg);\n}\n\nerrcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap gen_bmap,\n\t\t\t\t\t__u64 start, unsigned int num,\n\t\t\t\t\tvoid *in)\n{\n\text2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;\n\n\tif (!bmap)\n\t\treturn EINVAL;\n\n\tif (EXT2FS_IS_32_BITMAP(bmap)) {\n\t\tif ((start+num-1) & ~0xffffffffULL) {\n\t\t\text2fs_warn_bitmap2(gen_bmap, EXT2FS_UNMARK_ERROR,\n\t\t\t\t\t    0xffffffff);\n\t\t\treturn EINVAL;\n\t\t}\n\t\treturn ext2fs_set_generic_bitmap_range(gen_bmap, bmap->magic,\n\t\t\t\t\t\t       start, num, in);\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bmap))\n\t\treturn EINVAL;\n\n\tINC_STAT(bmap, set_range_count);\n\n\treturn bmap->bitmap_ops->set_bmap_range(bmap, start, num, in);\n}\n\nerrcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap gen_bmap,\n\t\t\t\t\t__u64 start, unsigned int num,\n\t\t\t\t\tvoid *out)\n{\n\text2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;\n\n\tif (!bmap)\n\t\treturn EINVAL;\n\n\tif (EXT2FS_IS_32_BITMAP(bmap)) {\n\t\tif ((start+num-1) & ~0xffffffffULL) {\n\t\t\text2fs_warn_bitmap2(gen_bmap,\n\t\t\t\t\t    EXT2FS_UNMARK_ERROR, 0xffffffff);\n\t\t\treturn EINVAL;\n\t\t}\n\t\treturn ext2fs_get_generic_bitmap_range(gen_bmap, bmap->magic,\n\t\t\t\t\t\t       start, num, out);\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bmap))\n\t\treturn EINVAL;\n\n\tINC_STAT(bmap, get_range_count);\n\n\treturn bmap->bitmap_ops->get_bmap_range(bmap, start, num, out);\n}\n\nerrcode_t ext2fs_compare_generic_bmap(errcode_t neq,\n\t\t\t\t      ext2fs_generic_bitmap gen_bm1,\n\t\t\t\t      ext2fs_generic_bitmap gen_bm2)\n{\n\text2fs_generic_bitmap_64 bm1 = (ext2fs_generic_bitmap_64) gen_bm1;\n\text2fs_generic_bitmap_64 bm2 = (ext2fs_generic_bitmap_64) gen_bm2;\n\tblk64_t\ti;\n\n\tif (!bm1 || !bm2)\n\t\treturn EINVAL;\n\tif (bm1->magic != bm2->magic)\n\t\treturn EINVAL;\n\n\t/* Now we know both bitmaps have the same magic */\n\tif (EXT2FS_IS_32_BITMAP(bm1))\n\t\treturn ext2fs_compare_generic_bitmap(bm1->magic, neq,\n\t\t\t\t\t\t     gen_bm1, gen_bm2);\n\n\tif (!EXT2FS_IS_64_BITMAP(bm1))\n\t\treturn EINVAL;\n\n\tif ((bm1->start != bm2->start) ||\n\t    (bm1->end != bm2->end))\n\t\treturn neq;\n\n\tfor (i = bm1->end - ((bm1->end - bm1->start) % 8); i <= bm1->end; i++)\n\t\tif (ext2fs_test_generic_bmap(gen_bm1, i) !=\n\t\t    ext2fs_test_generic_bmap(gen_bm2, i))\n\t\t\treturn neq;\n\n\treturn 0;\n}\n\nvoid ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap gen_bmap)\n{\n\text2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;\n\t__u64\tstart, num;\n\n\tif (EXT2FS_IS_32_BITMAP(bmap)) {\n\t\text2fs_set_generic_bitmap_padding(gen_bmap);\n\t\treturn;\n\t}\n\n\tstart = bmap->end + 1;\n\tnum = bmap->real_end - bmap->end;\n\tbmap->bitmap_ops->mark_bmap_extent(bmap, start, num);\n\t/* XXX ought to warn on error */\n}\n\nint ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap gen_bmap,\n\t\t\t\t    blk64_t block, unsigned int num)\n{\n\text2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;\n\t__u64\tend = block + num;\n\n\tif (!bmap)\n\t\treturn EINVAL;\n\n\tif (num == 1)\n\t\treturn !ext2fs_test_generic_bmap((ext2fs_generic_bitmap)\n\t\t\t\t\t\t bmap, block);\n\n\tif (EXT2FS_IS_32_BITMAP(bmap)) {\n\t\tif ((block & ~0xffffffffULL) ||\n\t\t    ((block+num-1) & ~0xffffffffULL)) {\n\t\t\text2fs_warn_bitmap2((ext2fs_generic_bitmap) bmap,\n\t\t\t\t\t    EXT2FS_UNMARK_ERROR, 0xffffffff);\n\t\t\treturn EINVAL;\n\t\t}\n\t\treturn ext2fs_test_block_bitmap_range(\n\t\t\t(ext2fs_generic_bitmap) bmap, block, num);\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bmap))\n\t\treturn EINVAL;\n\n\tINC_STAT(bmap, test_ext_count);\n\n\t/* convert to clusters if necessary */\n\tblock >>= bmap->cluster_bits;\n\tend += (1ULL << bmap->cluster_bits) - 1;\n\tend >>= bmap->cluster_bits;\n\tnum = end - block;\n\n\tif ((block < bmap->start) || (block > bmap->end) ||\n\t    (block+num-1 > bmap->end)) {\n\t\text2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_TEST, block,\n\t\t\t\t   bmap->description);\n\t\treturn EINVAL;\n\t}\n\n\treturn bmap->bitmap_ops->test_clear_bmap_extent(bmap, block, num);\n}\n\nvoid ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap,\n\t\t\t\t     blk64_t block, unsigned int num)\n{\n\text2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;\n\t__u64\tend = block + num;\n\n\tif (!bmap)\n\t\treturn;\n\n\tif (EXT2FS_IS_32_BITMAP(bmap)) {\n\t\tif ((block & ~0xffffffffULL) ||\n\t\t    ((block+num-1) & ~0xffffffffULL)) {\n\t\t\text2fs_warn_bitmap2((ext2fs_generic_bitmap) bmap,\n\t\t\t\t\t    EXT2FS_UNMARK_ERROR, 0xffffffff);\n\t\t\treturn;\n\t\t}\n\t\text2fs_mark_block_bitmap_range((ext2fs_generic_bitmap) bmap,\n\t\t\t\t\t       block, num);\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bmap))\n\t\treturn;\n\n\tINC_STAT(bmap, mark_ext_count);\n\n\t/* convert to clusters if necessary */\n\tblock >>= bmap->cluster_bits;\n\tend += (1ULL << bmap->cluster_bits) - 1;\n\tend >>= bmap->cluster_bits;\n\tnum = end - block;\n\n\tif ((block < bmap->start) || (block > bmap->end) ||\n\t    (block+num-1 > bmap->end)) {\n\t\text2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_MARK, block,\n\t\t\t\t   bmap->description);\n\t\treturn;\n\t}\n\n\tbmap->bitmap_ops->mark_bmap_extent(bmap, block, num);\n}\n\nvoid ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap,\n\t\t\t\t       blk64_t block, unsigned int num)\n{\n\text2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap;\n\t__u64\tend = block + num;\n\n\tif (!bmap)\n\t\treturn;\n\n\tif (EXT2FS_IS_32_BITMAP(bmap)) {\n\t\tif ((block & ~0xffffffffULL) ||\n\t\t    ((block+num-1) & ~0xffffffffULL)) {\n\t\t\text2fs_warn_bitmap2((ext2fs_generic_bitmap) bmap,\n\t\t\t\t\t    EXT2FS_UNMARK_ERROR, 0xffffffff);\n\t\t\treturn;\n\t\t}\n\t\text2fs_unmark_block_bitmap_range((ext2fs_generic_bitmap) bmap,\n\t\t\t\t\t\t block, num);\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bmap))\n\t\treturn;\n\n\tINC_STAT(bmap, unmark_ext_count);\n\n\t/* convert to clusters if necessary */\n\tblock >>= bmap->cluster_bits;\n\tend += (1ULL << bmap->cluster_bits) - 1;\n\tend >>= bmap->cluster_bits;\n\tnum = end - block;\n\n\tif ((block < bmap->start) || (block > bmap->end) ||\n\t    (block+num-1 > bmap->end)) {\n\t\text2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_UNMARK, block,\n\t\t\t\t   bmap->description);\n\t\treturn;\n\t}\n\n\tbmap->bitmap_ops->unmark_bmap_extent(bmap, block, num);\n}\n\nvoid ext2fs_warn_bitmap32(ext2fs_generic_bitmap gen_bitmap, const char *func)\n{\n\text2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap;\n\n#ifndef OMIT_COM_ERR\n\tif (bitmap && bitmap->description)\n\t\tcom_err(0, EXT2_ET_MAGIC_GENERIC_BITMAP,\n\t\t\t\"called %s with 64-bit bitmap for %s\", func,\n\t\t\tbitmap->description);\n\telse\n\t\tcom_err(0, EXT2_ET_MAGIC_GENERIC_BITMAP,\n\t\t\t\"called %s with 64-bit bitmap\", func);\n#endif\n}\n\nerrcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs,\n\t\t\t\t\t   ext2fs_block_bitmap *bitmap)\n{\n\text2fs_generic_bitmap_64 bmap, cmap;\n\text2fs_block_bitmap\tgen_bmap = *bitmap, gen_cmap;\n\terrcode_t\t\tretval;\n\tblk64_t\t\t\ti, next, b_end, c_end;\n\n\tbmap = (ext2fs_generic_bitmap_64) gen_bmap;\n\tif (fs->cluster_ratio_bits == ext2fs_get_bitmap_granularity(gen_bmap))\n\t\treturn 0;\t/* Nothing to do */\n\n\tretval = ext2fs_allocate_block_bitmap(fs, \"converted cluster bitmap\",\n\t\t\t\t\t      &gen_cmap);\n\tif (retval)\n\t\treturn retval;\n\n\tcmap = (ext2fs_generic_bitmap_64) gen_cmap;\n\ti = bmap->start;\n\tb_end = bmap->end;\n\tbmap->end = bmap->real_end;\n\tc_end = cmap->end;\n\tcmap->end = cmap->real_end;\n\twhile (i < bmap->real_end) {\n\t\tretval = ext2fs_find_first_set_block_bitmap2(gen_bmap,\n\t\t\t\t\t\ti, bmap->real_end, &next);\n\t\tif (retval)\n\t\t\tbreak;\n\t\text2fs_mark_block_bitmap2(gen_cmap, next);\n\t\ti = EXT2FS_C2B(fs, EXT2FS_B2C(fs, next) + 1);\n\t}\n\tbmap->end = b_end;\n\tcmap->end = c_end;\n\text2fs_free_block_bitmap(gen_bmap);\n\t*bitmap = (ext2fs_block_bitmap) cmap;\n\treturn 0;\n}\n\nerrcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t      __u64 start, __u64 end, __u64 *out)\n{\n\text2fs_generic_bitmap_64 bmap64 = (ext2fs_generic_bitmap_64) bitmap;\n\t__u64 cstart, cend, cout;\n\terrcode_t retval;\n\n\tif (!bitmap)\n\t\treturn EINVAL;\n\n\tif (EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\tblk_t blk = 0;\n\n\t\tif (((start) & ~0xffffffffULL) ||\n\t\t    ((end) & ~0xffffffffULL)) {\n\t\t\text2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, start);\n\t\t\treturn EINVAL;\n\t\t}\n\n\t\tretval = ext2fs_find_first_zero_generic_bitmap(bitmap, start,\n\t\t\t\t\t\t\t       end, &blk);\n\t\tif (retval == 0)\n\t\t\t*out = blk;\n\t\treturn retval;\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bitmap))\n\t\treturn EINVAL;\n\n\tcstart = start >> bmap64->cluster_bits;\n\tcend = end >> bmap64->cluster_bits;\n\n\tif (cstart < bmap64->start || cend > bmap64->end || start > end) {\n\t\twarn_bitmap(bmap64, EXT2FS_TEST_ERROR, start);\n\t\treturn EINVAL;\n\t}\n\n\tif (bmap64->bitmap_ops->find_first_zero) {\n\t\tretval = bmap64->bitmap_ops->find_first_zero(bmap64, cstart,\n\t\t\t\t\t\t\t     cend, &cout);\n\t\tif (retval)\n\t\t\treturn retval;\n\tfound:\n\t\tcout <<= bmap64->cluster_bits;\n\t\t*out = (cout >= start) ? cout : start;\n\t\treturn 0;\n\t}\n\n\tfor (cout = cstart; cout <= cend; cout++)\n\t\tif (!bmap64->bitmap_ops->test_bmap(bmap64, cout))\n\t\t\tgoto found;\n\n\treturn ENOENT;\n}\n\nerrcode_t ext2fs_find_first_set_generic_bmap(ext2fs_generic_bitmap bitmap,\n\t\t\t\t\t     __u64 start, __u64 end, __u64 *out)\n{\n\text2fs_generic_bitmap_64 bmap64 = (ext2fs_generic_bitmap_64) bitmap;\n\t__u64 cstart, cend, cout;\n\terrcode_t retval;\n\n\tif (!bitmap)\n\t\treturn EINVAL;\n\n\tif (EXT2FS_IS_32_BITMAP(bitmap)) {\n\t\tblk_t blk = 0;\n\n\t\tif (((start) & ~0xffffffffULL) ||\n\t\t    ((end) & ~0xffffffffULL)) {\n\t\t\text2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, start);\n\t\t\treturn EINVAL;\n\t\t}\n\n\t\tretval = ext2fs_find_first_set_generic_bitmap(bitmap, start,\n\t\t\t\t\t\t\t      end, &blk);\n\t\tif (retval == 0)\n\t\t\t*out = blk;\n\t\treturn retval;\n\t}\n\n\tif (!EXT2FS_IS_64_BITMAP(bitmap))\n\t\treturn EINVAL;\n\n\tcstart = start >> bmap64->cluster_bits;\n\tcend = end >> bmap64->cluster_bits;\n\n\tif (cstart < bmap64->start || cend > bmap64->end || start > end) {\n\t\twarn_bitmap(bmap64, EXT2FS_TEST_ERROR, start);\n\t\treturn EINVAL;\n\t}\n\n\tif (bmap64->bitmap_ops->find_first_set) {\n\t\tretval = bmap64->bitmap_ops->find_first_set(bmap64, cstart,\n\t\t\t\t\t\t\t    cend, &cout);\n\t\tif (retval)\n\t\t\treturn retval;\n\tfound:\n\t\tcout <<= bmap64->cluster_bits;\n\t\t*out = (cout >= start) ? cout : start;\n\t\treturn 0;\n\t}\n\n\tfor (cout = cstart; cout <= cend; cout++)\n\t\tif (bmap64->bitmap_ops->test_bmap(bmap64, cout))\n\t\t\tgoto found;\n\n\treturn ENOENT;\n}\n\nerrcode_t ext2fs_count_used_clusters(ext2_filsys fs, blk64_t start,\n\t\t\t\t     blk64_t end, blk64_t *out)\n{\n\tblk64_t\t\tnext;\n\tblk64_t\t\ttot_set = 0;\n\terrcode_t\tretval = 0;\n\n\twhile (start < end) {\n\t\tretval = ext2fs_find_first_set_block_bitmap2(fs->block_map,\n\t\t\t\t\t\t\tstart, end, &next);\n\t\tif (retval) {\n\t\t\tif (retval == ENOENT)\n\t\t\t\tretval = 0;\n\t\t\tbreak;\n\t\t}\n\t\tstart = next;\n\n\t\tretval = ext2fs_find_first_zero_block_bitmap2(fs->block_map,\n\t\t\t\t\t\t\tstart, end, &next);\n\t\tif (retval == 0) {\n\t\t\ttot_set += next - start;\n\t\t\tstart  = next + 1;\n\t\t} else if (retval == ENOENT) {\n\t\t\tretval = 0;\n\t\t\ttot_set += end - start + 1;\n\t\t\tbreak;\n\t\t} else\n\t\t\tbreak;\n\t}\n\n\tif (!retval)\n\t\t*out = EXT2FS_NUM_B2C(fs, tot_set);\n\treturn retval;\n}\n"
  },
  {
    "path": "src/ext2fs/get_num_dirs.c",
    "content": "/*\n * get_num_dirs.c -- calculate number of directories\n *\n * Copyright 1997 by Theodore Ts'o\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <string.h>\n#include <time.h>\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n\n/*\n * Returns the number of directories in the filesystem as reported by\n * the group descriptors.  Of course, the group descriptors could be\n * wrong!\n */\nerrcode_t ext2fs_get_num_dirs(ext2_filsys fs, ext2_ino_t *ret_num_dirs)\n{\n\tdgrp_t\ti;\n\text2_ino_t\tnum_dirs, max_dirs;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tnum_dirs = 0;\n\tmax_dirs = fs->super->s_inodes_per_group;\n\tfor (i = 0; i < fs->group_desc_count; i++) {\n\t\tif (ext2fs_bg_used_dirs_count(fs, i) > max_dirs)\n\t\t\tnum_dirs += max_dirs / 8;\n\t\telse\n\t\t\tnum_dirs += ext2fs_bg_used_dirs_count(fs, i);\n\t}\n\tif (num_dirs > fs->super->s_inodes_count)\n\t\tnum_dirs = fs->super->s_inodes_count;\n\n\t*ret_num_dirs = num_dirs;\n\n\treturn 0;\n}\n\n"
  },
  {
    "path": "src/ext2fs/hashmap.c",
    "content": "#include \"hashmap.h\"\n#include <string.h>\n\nstruct ext2fs_hashmap {\n\tuint32_t size;\n\tuint32_t(*hash)(const void *key, size_t len);\n\tvoid(*free)(void*);\n\tstruct ext2fs_hashmap_entry *first;\n\tstruct ext2fs_hashmap_entry *last;\n#if __GNUC_PREREQ (4, 8)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wpedantic\"\n#endif\n\tstruct ext2fs_hashmap_entry *entries[0];\n#if __GNUC_PREREQ (4, 8)\n#pragma GCC diagnostic pop\n#endif\n};\n\nuint32_t ext2fs_djb2_hash(const void *str, size_t size)\n{\n\tint c;\n\tconst char *s = str;\n\tuint32_t hash = 5381;\n\n\twhile (size-- > 0) {\n\t\tc = *s++;\n\t\thash = ((hash << 5) + hash) + c;\n\t}\n\treturn hash;\n}\n\nstruct ext2fs_hashmap *ext2fs_hashmap_create(\n\t\t\t\tuint32_t(*hash_fct)(const void*, size_t),\n\t\t\t\tvoid(*free_fct)(void*), size_t size)\n{\n\tstruct ext2fs_hashmap *h = calloc(sizeof(struct ext2fs_hashmap) +\n\t\t\t\tsizeof(struct ext2fs_hashmap_entry) * size, 1);\n\tif (!h)\n\t\treturn h;\n\th->size = size;\n\th->free = free_fct;\n\th->hash = hash_fct;\n\th->first = h->last = NULL;\n\treturn h;\n}\n\nvoid ext2fs_hashmap_add(struct ext2fs_hashmap *h, void *data, const void *key,\n\t\t\tsize_t key_len)\n{\n\tuint32_t hash = h->hash(key, key_len) % h->size;\n\tstruct ext2fs_hashmap_entry *e = malloc(sizeof(*e));\n\n\tif (!e)\n\t\treturn;\n\te->data = data;\n\te->key = key;\n\te->key_len = key_len;\n\te->next = h->entries[hash];\n\th->entries[hash] = e;\n\n\te->list_prev = NULL;\n\te->list_next = h->first;\n\tif (h->first)\n\t\th->first->list_prev = e;\n\th->first = e;\n\tif (!h->last)\n\t\th->last = e;\n}\n\nvoid *ext2fs_hashmap_lookup(struct ext2fs_hashmap *h, const void *key,\n\t\t\t    size_t key_len)\n{\n\tstruct ext2fs_hashmap_entry *iter;\n\tuint32_t hash = h->hash(key, key_len) % h->size;\n\n\tfor (iter = h->entries[hash]; iter; iter = iter->next)\n\t\tif (iter->key_len == key_len && !memcmp(iter->key, key, key_len))\n\t\t\treturn iter->data;\n\treturn NULL;\n}\n\nvoid *ext2fs_hashmap_iter_in_order(struct ext2fs_hashmap *h,\n\t\t\t\t   struct ext2fs_hashmap_entry **it)\n{\n\t*it = *it ? (*it)->list_next : h->first;\n\treturn *it ? (*it)->data : NULL;\n}\n\nvoid ext2fs_hashmap_free(struct ext2fs_hashmap *h)\n{\n\tsize_t\ti;\n\n\tfor (i = 0; i < h->size; ++i) {\n\t\tstruct ext2fs_hashmap_entry *it = h->entries[i];\n\t\twhile (it) {\n\t\t\tstruct ext2fs_hashmap_entry *tmp = it->next;\n\t\t\tif (h->free)\n\t\t\t\th->free(it->data);\n\t\t\tfree(it);\n\t\t\tit = tmp;\n\t\t}\n\t}\n\tfree(h);\n}\n"
  },
  {
    "path": "src/ext2fs/hashmap.h",
    "content": "#ifndef HASHMAP_H\n# define HASHMAP_H\n\n# include <stdlib.h>\n# include <stdint.h>\n\n#ifndef __GNUC_PREREQ\n#if defined(__GNUC__) && defined(__GNUC_MINOR__)\n#define __GNUC_PREREQ(maj, min) \\\n\t((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))\n#else\n#define __GNUC_PREREQ(maj, min) 0\n#endif\n#endif\n\nstruct ext2fs_hashmap;\n\nstruct ext2fs_hashmap_entry {\n\tvoid *data;\n\tconst void *key;\n\tsize_t key_len;\n\tstruct ext2fs_hashmap_entry *next;\n\tstruct ext2fs_hashmap_entry *list_next;\n\tstruct ext2fs_hashmap_entry *list_prev;\n};\n\nstruct ext2fs_hashmap *ext2fs_hashmap_create(\n\t\t\t\tuint32_t(*hash_fct)(const void*, size_t),\n\t\t\t\tvoid(*free_fct)(void*), size_t size);\nvoid ext2fs_hashmap_add(struct ext2fs_hashmap *h, void *data, const void *key,\n\t\t\tsize_t key_len);\nvoid *ext2fs_hashmap_lookup(struct ext2fs_hashmap *h, const void *key,\n\t\t\t    size_t key_len);\nvoid *ext2fs_hashmap_iter_in_order(struct ext2fs_hashmap *h,\n\t\t\t\t   struct ext2fs_hashmap_entry **it);\nvoid ext2fs_hashmap_del(struct ext2fs_hashmap *h,\n\t\t\tstruct ext2fs_hashmap_entry *e);\nvoid ext2fs_hashmap_free(struct ext2fs_hashmap *h);\n\nuint32_t ext2fs_djb2_hash(const void *str, size_t size);\n\n#endif /* !HASHMAP_H */\n"
  },
  {
    "path": "src/ext2fs/i_block.c",
    "content": "/*\n * i_block.c --- Manage the i_block field for i_blocks\n *\n * Copyright (C) 2008 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <time.h>\n#include <string.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#include <errno.h>\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\nerrcode_t ext2fs_iblk_add_blocks(ext2_filsys fs, struct ext2_inode *inode,\n\t\t\t\t blk64_t num_blocks)\n{\n\tunsigned long long b = inode->i_blocks;\n\n\tif (ext2fs_has_feature_huge_file(fs->super))\n\t\tb += ((long long) inode->osd2.linux2.l_i_blocks_hi) << 32;\n\n\tif (!ext2fs_has_feature_huge_file(fs->super) ||\n\t    !(inode->i_flags & EXT4_HUGE_FILE_FL))\n\t    num_blocks *= fs->blocksize / 512;\n\tnum_blocks *= EXT2FS_CLUSTER_RATIO(fs);\n\n\tb += num_blocks;\n\n\tif (ext2fs_has_feature_huge_file(fs->super))\n\t\tinode->osd2.linux2.l_i_blocks_hi = b >> 32;\n\telse if (b > 0xFFFFFFFF)\n\t\treturn EOVERFLOW;\n\tinode->i_blocks = b & 0xFFFFFFFF;\n\treturn 0;\n}\n\nerrcode_t ext2fs_iblk_sub_blocks(ext2_filsys fs, struct ext2_inode *inode,\n\t\t\t\t blk64_t num_blocks)\n{\n\tunsigned long long b = inode->i_blocks;\n\n\tif (ext2fs_has_feature_huge_file(fs->super))\n\t\tb += ((long long) inode->osd2.linux2.l_i_blocks_hi) << 32;\n\n\tif (!ext2fs_has_feature_huge_file(fs->super) ||\n\t    !(inode->i_flags & EXT4_HUGE_FILE_FL))\n\t    num_blocks *= fs->blocksize / 512;\n\tnum_blocks *= EXT2FS_CLUSTER_RATIO(fs);\n\n\tif (num_blocks > b)\n\t\treturn EOVERFLOW;\n\n\tb -= num_blocks;\n\n\tif (ext2fs_has_feature_huge_file(fs->super))\n\t\tinode->osd2.linux2.l_i_blocks_hi = b >> 32;\n\tinode->i_blocks = b & 0xFFFFFFFF;\n\treturn 0;\n}\n\nerrcode_t ext2fs_iblk_set(ext2_filsys fs, struct ext2_inode *inode, blk64_t b)\n{\n\tif (!ext2fs_has_feature_huge_file(fs->super) ||\n\t    !(inode->i_flags & EXT4_HUGE_FILE_FL))\n\t\tb *= fs->blocksize / 512;\n\tb *= EXT2FS_CLUSTER_RATIO(fs);\n\n\tinode->i_blocks = b & 0xFFFFFFFF;\n\tif (ext2fs_has_feature_huge_file(fs->super))\n\t\tinode->osd2.linux2.l_i_blocks_hi = b >> 32;\n\telse if (b >> 32)\n\t\treturn EOVERFLOW;\n\treturn 0;\n}\n"
  },
  {
    "path": "src/ext2fs/ind_block.c",
    "content": "/*\n * ind_block.c --- indirect block I/O routines\n *\n * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,\n * \t2001, 2002, 2003, 2004, 2005 by  Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\nerrcode_t ext2fs_read_ind_block(ext2_filsys fs, blk_t blk, void *buf)\n{\n\terrcode_t\tretval;\n#ifdef WORDS_BIGENDIAN\n\tblk_t\t\t*block_nr;\n\tint\t\ti;\n\tint\t\tlimit = fs->blocksize >> 2;\n#endif\n\n\tif ((fs->flags & EXT2_FLAG_IMAGE_FILE) &&\n\t    (fs->io != fs->image_io))\n\t\tmemset(buf, 0, fs->blocksize);\n\telse {\n\t\tretval = io_channel_read_blk(fs->io, blk, 1, buf);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n#ifdef WORDS_BIGENDIAN\n\tblock_nr = (blk_t *) buf;\n\tfor (i = 0; i < limit; i++, block_nr++)\n\t\t*block_nr = ext2fs_swab32(*block_nr);\n#endif\n\treturn 0;\n}\n\nerrcode_t ext2fs_write_ind_block(ext2_filsys fs, blk_t blk, void *buf)\n{\n#ifdef WORDS_BIGENDIAN\n\tblk_t\t\t*block_nr;\n\tint\t\ti;\n\tint\t\tlimit = fs->blocksize >> 2;\n#endif\n\n\tif (fs->flags & EXT2_FLAG_IMAGE_FILE)\n\t\treturn 0;\n\n#ifdef WORDS_BIGENDIAN\n\tblock_nr = (blk_t *) buf;\n\tfor (i = 0; i < limit; i++, block_nr++)\n\t\t*block_nr = ext2fs_swab32(*block_nr);\n#endif\n\treturn io_channel_write_blk(fs->io, blk, 1, buf);\n}\n\n\n"
  },
  {
    "path": "src/ext2fs/initialize.c",
    "content": "/*\n * initialize.c --- initialize a filesystem handle given superblock\n * \tparameters.  Used by mke2fs when initializing a filesystem.\n *\n * Copyright (C) 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <assert.h>\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\n#ifndef O_BINARY\n#define O_BINARY 0\n#endif\n\n#if defined(__linux__)    &&\tdefined(EXT2_OS_LINUX)\n#define CREATOR_OS EXT2_OS_LINUX\n#else\n#if defined(__GNU__)     &&\tdefined(EXT2_OS_HURD)\n#define CREATOR_OS EXT2_OS_HURD\n#else\n#if defined(__FreeBSD__) &&\tdefined(EXT2_OS_FREEBSD)\n#define CREATOR_OS EXT2_OS_FREEBSD\n#else\n#if defined(LITES) \t   &&\tdefined(EXT2_OS_LITES)\n#define CREATOR_OS EXT2_OS_LITES\n#else\n#define CREATOR_OS EXT2_OS_LINUX /* by default */\n#endif /* defined(LITES) && defined(EXT2_OS_LITES) */\n#endif /* defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD) */\n#endif /* defined(__GNU__)     && defined(EXT2_OS_HURD) */\n#endif /* defined(__linux__)   && defined(EXT2_OS_LINUX) */\n\n/*\n * Calculate the number of GDT blocks to reserve for online filesystem growth.\n * The absolute maximum number of GDT blocks we can reserve is determined by\n * the number of block pointers that can fit into a single block.\n */\nstatic unsigned int calc_reserved_gdt_blocks(ext2_filsys fs)\n{\n\tstruct ext2_super_block *sb = fs->super;\n\tunsigned long bpg = sb->s_blocks_per_group;\n\tunsigned int gdpb = EXT2_DESC_PER_BLOCK(sb);\n\tunsigned long max_blocks = 0xffffffff;\n\tunsigned long rsv_groups;\n\tunsigned int rsv_gdb;\n\n\t/* We set it at 1024x the current filesystem size, or\n\t * the upper block count limit (2^32), whichever is lower.\n\t */\n\tif (ext2fs_blocks_count(sb) < max_blocks / 1024)\n\t\tmax_blocks = ext2fs_blocks_count(sb) * 1024;\n\t/*\n\t * ext2fs_div64_ceil() is unnecessary because max_blocks is\n\t * max _GDT_ blocks, which is limited to 32 bits.\n\t */\n\trsv_groups = ext2fs_div_ceil(max_blocks - sb->s_first_data_block, bpg);\n\trsv_gdb = ext2fs_div_ceil(rsv_groups, gdpb) - fs->desc_blocks;\n\tif (rsv_gdb > EXT2_ADDR_PER_BLOCK(sb))\n\t\trsv_gdb = EXT2_ADDR_PER_BLOCK(sb);\n#ifdef RES_GDT_DEBUG\n\tprintf(\"max_blocks %lu, rsv_groups = %lu, rsv_gdb = %u\\n\",\n\t       max_blocks, rsv_groups, rsv_gdb);\n#endif\n\n\treturn rsv_gdb;\n}\n\nerrcode_t ext2fs_initialize(const char *name, int flags,\n\t\t\t    struct ext2_super_block *param,\n\t\t\t    io_manager manager, ext2_filsys *ret_fs)\n{\n\text2_filsys\tfs;\n\terrcode_t\tretval;\n\tstruct ext2_super_block *super;\n\tunsigned int\trem;\n\tunsigned int\toverhead = 0;\n\tunsigned int\tipg;\n\tdgrp_t\t\ti;\n\tblk64_t\t\tfree_blocks;\n\tblk_t\t\tnumblocks;\n\tint\t\trsv_gdt;\n\tint\t\tcsum_flag;\n\tint\t\tbigalloc_flag;\n\tint\t\tio_flags;\n\tint\t\thas_bg;\n\tunsigned\treserved_inos;\n\tchar\t\t*buf = 0;\n\tchar\t\tc;\n\tdouble\t\treserved_ratio;\n\tchar\t\t*time_env;\n\n\tif (!param || !ext2fs_blocks_count(param))\n\t\treturn EXT2_ET_INVALID_ARGUMENT;\n\n\tretval = ext2fs_get_mem(sizeof(struct struct_ext2_filsys), &fs);\n\tif (retval)\n\t\treturn retval;\n\n\tmemset(fs, 0, sizeof(struct struct_ext2_filsys));\n\tfs->magic = EXT2_ET_MAGIC_EXT2FS_FILSYS;\n\tfs->flags = flags | EXT2_FLAG_RW;\n\tfs->umask = 022;\n\tfs->default_bitmap_type = EXT2FS_BMAP64_RBTREE;\n#ifdef WORDS_BIGENDIAN\n\tfs->flags |= EXT2_FLAG_SWAP_BYTES;\n#endif\n\n\ttime_env = getenv(\"E2FSPROGS_FAKE_TIME\");\n\tif (time_env)\n\t\tfs->now = strtoul(time_env, NULL, 0);\n\n\tio_flags = IO_FLAG_RW;\n\tif (flags & EXT2_FLAG_EXCLUSIVE)\n\t\tio_flags |= IO_FLAG_EXCLUSIVE;\n\tif (flags & EXT2_FLAG_DIRECT_IO)\n\t\tio_flags |= IO_FLAG_DIRECT_IO;\n\tio_flags |= O_BINARY;\n\tretval = manager->open(name, io_flags, &fs->io);\n\tif (retval)\n\t\tgoto cleanup;\n\tfs->image_io = fs->io;\n\tfs->io->app_data = fs;\n\tretval = ext2fs_get_mem(strlen(name)+1, &fs->device_name);\n\tif (retval)\n\t\tgoto cleanup;\n\n\tstrcpy(fs->device_name, name);\n\tretval = ext2fs_get_mem(SUPERBLOCK_SIZE, &super);\n\tif (retval)\n\t\tgoto cleanup;\n\tfs->super = super;\n\n\tmemset(super, 0, SUPERBLOCK_SIZE);\n\n#define set_field(field, default) (super->field = param->field ? \\\n\t\t\t\t   param->field : (default))\n#define assign_field(field)\t(super->field = param->field)\n\n\tsuper->s_magic = EXT2_SUPER_MAGIC;\n\tsuper->s_state = EXT2_VALID_FS;\n\n\tbigalloc_flag = ext2fs_has_feature_bigalloc(param);\n\n\tassign_field(s_log_block_size);\n\n\tif (bigalloc_flag) {\n\t\tset_field(s_log_cluster_size, super->s_log_block_size+4);\n\t\tif (super->s_log_block_size > super->s_log_cluster_size) {\n\t\t\tretval = EXT2_ET_INVALID_ARGUMENT;\n\t\t\tgoto cleanup;\n\t\t}\n\t} else\n\t\tsuper->s_log_cluster_size = super->s_log_block_size;\n\n\tset_field(s_first_data_block, super->s_log_cluster_size ? 0 : 1);\n\tset_field(s_max_mnt_count, 0);\n\tset_field(s_errors, EXT2_ERRORS_DEFAULT);\n\tset_field(s_feature_compat, 0);\n\tset_field(s_feature_incompat, 0);\n\tset_field(s_feature_ro_compat, 0);\n\tset_field(s_default_mount_opts, 0);\n\tset_field(s_first_meta_bg, 0);\n\tset_field(s_raid_stride, 0);\t\t/* default stride size: 0 */\n\tset_field(s_raid_stripe_width, 0);\t/* default stripe width: 0 */\n\tset_field(s_log_groups_per_flex, 0);\n\tset_field(s_flags, 0);\n\tassign_field(s_backup_bgs[0]);\n\tassign_field(s_backup_bgs[1]);\n\n\tassign_field(s_encoding);\n\tassign_field(s_encoding_flags);\n\n//\tif (ext2fs_has_feature_casefold(param))\n//\t\tfs->encoding = ext2fs_load_nls_table(param->s_encoding);\n\n\tif (super->s_feature_incompat & ~EXT2_LIB_FEATURE_INCOMPAT_SUPP) {\n\t\tretval = EXT2_ET_UNSUPP_FEATURE;\n\t\tgoto cleanup;\n\t}\n\tif (super->s_feature_ro_compat & ~EXT2_LIB_FEATURE_RO_COMPAT_SUPP) {\n\t\tretval = EXT2_ET_RO_UNSUPP_FEATURE;\n\t\tgoto cleanup;\n\t}\n\n\tset_field(s_rev_level, EXT2_GOOD_OLD_REV);\n\tif (super->s_rev_level >= EXT2_DYNAMIC_REV) {\n\t\tset_field(s_first_ino, EXT2_GOOD_OLD_FIRST_INO);\n\t\tset_field(s_inode_size, EXT2_GOOD_OLD_INODE_SIZE);\n\t\tif (super->s_inode_size >= sizeof(struct ext2_inode_large)) {\n\t\t\tint extra_isize = sizeof(struct ext2_inode_large) -\n\t\t\t\tEXT2_GOOD_OLD_INODE_SIZE;\n\t\t\tset_field(s_min_extra_isize, extra_isize);\n\t\t\tset_field(s_want_extra_isize, extra_isize);\n\t\t}\n\t} else {\n\t\tsuper->s_first_ino = EXT2_GOOD_OLD_FIRST_INO;\n\t\tsuper->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE;\n\t}\n\n\tset_field(s_checkinterval, 0);\n\tsuper->s_mkfs_time = super->s_lastcheck = fs->now ? fs->now : time(NULL);\n\n\tsuper->s_creator_os = CREATOR_OS;\n\n\tfs->fragsize = fs->blocksize = EXT2_BLOCK_SIZE(super);\n\tfs->cluster_ratio_bits = super->s_log_cluster_size -\n\t\tsuper->s_log_block_size;\n\n\tif (bigalloc_flag) {\n\t\tunsigned long long bpg;\n\n\t\tif (param->s_blocks_per_group &&\n\t\t    param->s_clusters_per_group &&\n\t\t    ((param->s_clusters_per_group * EXT2FS_CLUSTER_RATIO(fs)) !=\n\t\t     param->s_blocks_per_group)) {\n\t\t\tretval = EXT2_ET_INVALID_ARGUMENT;\n\t\t\tgoto cleanup;\n\t\t}\n\t\tif (param->s_clusters_per_group)\n\t\t\tassign_field(s_clusters_per_group);\n\t\telse if (param->s_blocks_per_group)\n\t\t\tsuper->s_clusters_per_group = \n\t\t\t\tparam->s_blocks_per_group /\n\t\t\t\tEXT2FS_CLUSTER_RATIO(fs);\n\t\telse if (super->s_log_cluster_size + 15 < 32)\n\t\t\tsuper->s_clusters_per_group = fs->blocksize * 8;\n\t\telse\n\t\t\tsuper->s_clusters_per_group = (fs->blocksize - 1) * 8;\n\t\tif (super->s_clusters_per_group > EXT2_MAX_CLUSTERS_PER_GROUP(super))\n\t\t\tsuper->s_clusters_per_group = EXT2_MAX_CLUSTERS_PER_GROUP(super);\n\t\tbpg = EXT2FS_C2B(fs,\n\t\t\t(unsigned long long) super->s_clusters_per_group);\n\t\tif (bpg >= (((unsigned long long) 1) << 32)) {\n\t\t\tretval = EXT2_ET_INVALID_ARGUMENT;\n\t\t\tgoto cleanup;\n\t\t}\n\t\tsuper->s_blocks_per_group = bpg;\n\t} else {\n\t\tset_field(s_blocks_per_group, fs->blocksize * 8);\n\t\tif (super->s_blocks_per_group > EXT2_MAX_BLOCKS_PER_GROUP(super))\n\t\t\tsuper->s_blocks_per_group = EXT2_MAX_BLOCKS_PER_GROUP(super);\n\t\tsuper->s_clusters_per_group = super->s_blocks_per_group;\n\t}\n\n\text2fs_blocks_count_set(super, ext2fs_blocks_count(param) &\n\t\t\t\t~((blk64_t) EXT2FS_CLUSTER_MASK(fs)));\n\text2fs_r_blocks_count_set(super, ext2fs_r_blocks_count(param));\n\tif (ext2fs_r_blocks_count(super) >= ext2fs_blocks_count(param)) {\n\t\tretval = EXT2_ET_INVALID_ARGUMENT;\n\t\tgoto cleanup;\n\t}\n\n\tset_field(s_mmp_update_interval, 0);\n\n\t/*\n\t * If we're creating an external journal device, we don't need\n\t * to bother with the rest.\n\t */\n\tif (ext2fs_has_feature_journal_dev(super)) {\n\t\tfs->group_desc_count = 0;\n\t\text2fs_mark_super_dirty(fs);\n\t\t*ret_fs = fs;\n\t\treturn 0;\n\t}\n\nretry:\n\tfs->group_desc_count = (dgrp_t) ext2fs_div64_ceil(\n\t\text2fs_blocks_count(super) - super->s_first_data_block,\n\t\tEXT2_BLOCKS_PER_GROUP(super));\n\tif (fs->group_desc_count == 0) {\n\t\tretval = EXT2_ET_TOOSMALL;\n\t\tgoto cleanup;\n\t}\n\n\tset_field(s_desc_size,\n\t\t  ext2fs_has_feature_64bit(super) ?\n\t\t  EXT2_MIN_DESC_SIZE_64BIT : 0);\n\n\tif (EXT2_DESC_SIZE(super) == 0) {\n\t\tretval = EXT2_ET_UNEXPECTED_BLOCK_SIZE;\n\t\tgoto cleanup;\n\t}\n\tfs->desc_blocks = ext2fs_div_ceil(fs->group_desc_count,\n\t\t\t\t\t  EXT2_DESC_PER_BLOCK(super));\n\n\ti = fs->blocksize >= 4096 ? 1 : 4096 / fs->blocksize;\n\n\tif (ext2fs_has_feature_64bit(super) &&\n\t    (ext2fs_blocks_count(super) / i) >= (1ULL << 32))\n\t\tset_field(s_inodes_count, ~0U);\n\telse\n\t\tset_field(s_inodes_count, ext2fs_blocks_count(super) / i);\n\n\t/*\n\t * Make sure we have at least EXT2_FIRST_INO + 1 inodes, so\n\t * that we have enough inodes for the filesystem(!)\n\t */\n\tif (super->s_inodes_count < EXT2_FIRST_INODE(super)+1)\n\t\tsuper->s_inodes_count = EXT2_FIRST_INODE(super)+1;\n\n\t/*\n\t * There should be at least as many inodes as the user\n\t * requested.  Figure out how many inodes per group that\n\t * should be.  But make sure that we don't allocate more than\n\t * one bitmap's worth of inodes each group.\n\t */\n\tipg = ext2fs_div_ceil(super->s_inodes_count, fs->group_desc_count);\n\tif (ipg > fs->blocksize * 8) {\n\t\tif (!bigalloc_flag && super->s_blocks_per_group >= 256) {\n\t\t\t/* Try again with slightly different parameters */\n\t\t\tsuper->s_blocks_per_group -= 8;\n\t\t\text2fs_blocks_count_set(super,\n\t\t\t\t\t\text2fs_blocks_count(param));\n\t\t\tsuper->s_clusters_per_group = super->s_blocks_per_group;\n\t\t\tgoto retry;\n\t\t} else {\n\t\t\tretval = EXT2_ET_TOO_MANY_INODES;\n\t\t\tgoto cleanup;\n\t\t}\n\t}\n\n\tif (ipg > (unsigned) EXT2_MAX_INODES_PER_GROUP(super))\n\t\tipg = EXT2_MAX_INODES_PER_GROUP(super);\n\nipg_retry:\n\tsuper->s_inodes_per_group = ipg;\n\n\t/*\n\t * Make sure the number of inodes per group completely fills\n\t * the inode table blocks in the descriptor.  If not, add some\n\t * additional inodes/group.  Waste not, want not...\n\t */\n\tfs->inode_blocks_per_group = (((super->s_inodes_per_group *\n\t\t\t\t\tEXT2_INODE_SIZE(super)) +\n\t\t\t\t       EXT2_BLOCK_SIZE(super) - 1) /\n\t\t\t\t      EXT2_BLOCK_SIZE(super));\n\tsuper->s_inodes_per_group = ((fs->inode_blocks_per_group *\n\t\t\t\t      EXT2_BLOCK_SIZE(super)) /\n\t\t\t\t     EXT2_INODE_SIZE(super));\n\t/*\n\t * Finally, make sure the number of inodes per group is a\n\t * multiple of 8.  This is needed to simplify the bitmap\n\t * splicing code.\n\t */\n\tif (super->s_inodes_per_group < 8)\n\t\tsuper->s_inodes_per_group = 8;\n\tsuper->s_inodes_per_group &= ~7;\n\tfs->inode_blocks_per_group = (((super->s_inodes_per_group *\n\t\t\t\t\tEXT2_INODE_SIZE(super)) +\n\t\t\t\t       EXT2_BLOCK_SIZE(super) - 1) /\n\t\t\t\t      EXT2_BLOCK_SIZE(super));\n\n\t/*\n\t * adjust inode count to reflect the adjusted inodes_per_group\n\t */\n\tif ((__u64)super->s_inodes_per_group * fs->group_desc_count > ~0U) {\n\t\tassert(ipg != 0);\n\t\tif (ipg != 0)\n\t\t\tipg--;\n\t\tgoto ipg_retry;\n\t}\n\tsuper->s_inodes_count = super->s_inodes_per_group *\n\t\tfs->group_desc_count;\n\tsuper->s_free_inodes_count = super->s_inodes_count;\n\n\t/*\n\t * check the number of reserved group descriptor table blocks\n\t */\n\tif (ext2fs_has_feature_resize_inode(super))\n\t\trsv_gdt = calc_reserved_gdt_blocks(fs);\n\telse\n\t\trsv_gdt = 0;\n\tset_field(s_reserved_gdt_blocks, rsv_gdt);\n\tif (super->s_reserved_gdt_blocks > EXT2_ADDR_PER_BLOCK(super)) {\n\t\tretval = EXT2_ET_RES_GDT_BLOCKS;\n\t\tgoto cleanup;\n\t}\n\t/* Enable meta_bg if we'd lose more than 3/4 of a BG to GDT blocks. */\n\tif (super->s_reserved_gdt_blocks + fs->desc_blocks >\n\t    super->s_blocks_per_group * 3 / 4) {\n\t\text2fs_set_feature_meta_bg(fs->super);\n\t\text2fs_clear_feature_resize_inode(fs->super);\n\t\tset_field(s_reserved_gdt_blocks, 0);\n\t}\n\n\t/*\n\t * Calculate the maximum number of bookkeeping blocks per\n\t * group.  It includes the superblock, the block group\n\t * descriptors, the block bitmap, the inode bitmap, the inode\n\t * table, and the reserved gdt blocks.\n\t */\n\toverhead = (int) (3 + fs->inode_blocks_per_group +\n\t\t\t  super->s_reserved_gdt_blocks);\n\n\tif (ext2fs_has_feature_meta_bg(fs->super))\n\t\toverhead++;\n\telse\n\t\toverhead += fs->desc_blocks;\n\n\t/* This can only happen if the user requested too many inodes */\n\tif (overhead > super->s_blocks_per_group) {\n\t\tretval = EXT2_ET_TOO_MANY_INODES;\n\t\tgoto cleanup;\n\t}\n\n\t/*\n\t * See if the last group is big enough to support the\n\t * necessary data structures.  If not, we need to get rid of\n\t * it.  We need to recalculate the overhead for the last block\n\t * group, since it might or might not have a superblock\n\t * backup.\n\t */\n\toverhead = (int) (2 + fs->inode_blocks_per_group);\n\thas_bg = 0;\n\tif (ext2fs_has_feature_sparse_super2(super)) {\n\t\t/*\n\t\t * We have to do this manually since\n\t\t * super->s_backup_bgs hasn't been set up yet.\n\t\t */\n\t\tif (fs->group_desc_count == 2)\n\t\t\thas_bg = param->s_backup_bgs[0] != 0;\n\t\telse\n\t\t\thas_bg = param->s_backup_bgs[1] != 0;\n\t} else\n\t\thas_bg = ext2fs_bg_has_super(fs, fs->group_desc_count - 1);\n\tif (has_bg)\n\t\toverhead += 1 + fs->desc_blocks + super->s_reserved_gdt_blocks;\n\trem = ((ext2fs_blocks_count(super) - super->s_first_data_block) %\n\t       super->s_blocks_per_group);\n\tif ((fs->group_desc_count == 1) && rem && (rem < overhead)) {\n\t\tretval = EXT2_ET_TOOSMALL;\n\t\tgoto cleanup;\n\t}\n\tif (rem && (rem < overhead+50)) {\n\t\text2fs_blocks_count_set(super, ext2fs_blocks_count(super) -\n\t\t\t\t\trem);\n\t\t/*\n\t\t * If blocks count is changed, we need to recalculate\n\t\t * reserved blocks count not to exceed 50%.\n\t\t */\n\t\treserved_ratio = 100.0 * ext2fs_r_blocks_count(param) /\n\t\t\text2fs_blocks_count(param);\n\t\text2fs_r_blocks_count_set(super, reserved_ratio *\n\t\t\text2fs_blocks_count(super) / 100.0);\n\n\t\tgoto retry;\n\t}\n\n\t/*\n\t * At this point we know how big the filesystem will be.  So\n\t * we can do any and all allocations that depend on the block\n\t * count.\n\t */\n\n\t/* Set up the locations of the backup superblocks */\n\tif (ext2fs_has_feature_sparse_super2(super)) {\n\t\tif (super->s_backup_bgs[0] >= fs->group_desc_count)\n\t\t\tsuper->s_backup_bgs[0] = fs->group_desc_count - 1;\n\t\tif (super->s_backup_bgs[1] >= fs->group_desc_count)\n\t\t\tsuper->s_backup_bgs[1] = fs->group_desc_count - 1;\n\t\tif (super->s_backup_bgs[0] == super->s_backup_bgs[1])\n\t\t\tsuper->s_backup_bgs[1] = 0;\n\t\tif (super->s_backup_bgs[0] > super->s_backup_bgs[1]) {\n\t\t\t__u32 t = super->s_backup_bgs[0];\n\t\t\tsuper->s_backup_bgs[0] = super->s_backup_bgs[1];\n\t\t\tsuper->s_backup_bgs[1] = t;\n\t\t}\n\t}\n\n\tretval = ext2fs_get_mem(strlen(fs->device_name) + 80, &buf);\n\tif (retval)\n\t\tgoto cleanup;\n\n\tstrcpy(buf, \"block bitmap for \");\n\tstrcat(buf, fs->device_name);\n\tretval = ext2fs_allocate_subcluster_bitmap(fs, buf, &fs->block_map);\n\tif (retval)\n\t\tgoto cleanup;\n\n\tstrcpy(buf, \"inode bitmap for \");\n\tstrcat(buf, fs->device_name);\n\tretval = ext2fs_allocate_inode_bitmap(fs, buf, &fs->inode_map);\n\tif (retval)\n\t\tgoto cleanup;\n\n\text2fs_free_mem(&buf);\n\n\tretval = ext2fs_get_array(fs->desc_blocks, fs->blocksize,\n\t\t\t\t&fs->group_desc);\n\tif (retval)\n\t\tgoto cleanup;\n\n\tmemset(fs->group_desc, 0, (size_t) fs->desc_blocks * fs->blocksize);\n\n\t/*\n\t * Reserve the superblock and group descriptors for each\n\t * group, and fill in the correct group statistics for group.\n\t * Note that although the block bitmap, inode bitmap, and\n\t * inode table have not been allocated (and in fact won't be\n\t * by this routine), they are accounted for nevertheless.\n\t *\n\t * If FLEX_BG meta-data grouping is used, only account for the\n\t * superblock and group descriptors (the inode tables and\n\t * bitmaps will be accounted for when allocated).\n\t */\n\tfree_blocks = 0;\n\tcsum_flag = ext2fs_has_group_desc_csum(fs);\n\treserved_inos = super->s_first_ino;\n\tfor (i = 0; i < fs->group_desc_count; i++) {\n\t\t/*\n\t\t * Don't set the BLOCK_UNINIT group for the last group\n\t\t * because the block bitmap needs to be padded.\n\t\t */\n\t\tif (csum_flag) {\n\t\t\tif (i != fs->group_desc_count - 1)\n\t\t\t\text2fs_bg_flags_set(fs, i,\n\t\t\t\t\t\t    EXT2_BG_BLOCK_UNINIT);\n\t\t\text2fs_bg_flags_set(fs, i, EXT2_BG_INODE_UNINIT);\n\t\t\tnumblocks = super->s_inodes_per_group;\n\t\t\tif (reserved_inos) {\n\t\t\t\tif (numblocks > reserved_inos) {\n\t\t\t\t\tnumblocks -= reserved_inos;\n\t\t\t\t\treserved_inos = 0;\n\t\t\t\t} else {\n\t\t\t\t\treserved_inos -= numblocks;\n\t\t\t\t\tnumblocks = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\text2fs_bg_itable_unused_set(fs, i, numblocks);\n\t\t}\n\t\tnumblocks = ext2fs_reserve_super_and_bgd(fs, i, fs->block_map);\n\t\tif (fs->super->s_log_groups_per_flex)\n\t\t\tnumblocks += 2 + fs->inode_blocks_per_group;\n\n\t\tfree_blocks += numblocks;\n\t\text2fs_bg_free_blocks_count_set(fs, i, numblocks);\n\t\text2fs_bg_free_inodes_count_set(fs, i, fs->super->s_inodes_per_group);\n\t\text2fs_bg_used_dirs_count_set(fs, i, 0);\n\t\text2fs_group_desc_csum_set(fs, i);\n\t}\n\tfree_blocks &= ~EXT2FS_CLUSTER_MASK(fs);\n\text2fs_free_blocks_count_set(super, free_blocks);\n\n\tc = (char) 255;\n\t// coverity[dead_error_condition]\n\tif (((int) c) == -1) {\n\t\tsuper->s_flags |= EXT2_FLAGS_SIGNED_HASH;\n\t} else {\n\t\tsuper->s_flags |= EXT2_FLAGS_UNSIGNED_HASH;\n\t}\n\n\text2fs_mark_super_dirty(fs);\n\text2fs_mark_bb_dirty(fs);\n\text2fs_mark_ib_dirty(fs);\n\n\tio_channel_set_blksize(fs->io, fs->blocksize);\n\n\t*ret_fs = fs;\n\treturn 0;\ncleanup:\n\tfree(buf);\n\text2fs_free(fs);\n\treturn retval;\n}\n"
  },
  {
    "path": "src/ext2fs/inline.c",
    "content": "/*\n * inline.c --- Includes the inlined functions defined in the header\n * \tfiles as standalone functions, in case the application program\n * \tis compiled with inlining turned off.\n *\n * Copyright (C) 1993, 1994 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#ifndef _XOPEN_SOURCE\n#define _XOPEN_SOURCE 600\t/* for posix_memalign() */\n#endif\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#if HAVE_MALLOC_H\n#include <malloc.h>\n#endif\n\n#include \"ext2_fs.h\"\n#define INCLUDE_INLINE_FUNCS\n#include \"ext2fs.h\"\n\n/*\n * We used to define this as an inline, but since we are now using\n * autoconf-defined #ifdef's, we need to export this as a\n * library-provided function exclusively.\n */\nerrcode_t ext2fs_get_memalign(unsigned long size,\n\t\t\t      unsigned long align, void *ptr)\n{\n\terrcode_t retval = 0;\n\tvoid **p = ptr;\n\n\tif (align < 8)\n\t\talign = 8;\n#ifdef HAVE_POSIX_MEMALIGN\n\tretval = posix_memalign(p, align, size);\n\tif (retval == ENOMEM)\n\t\treturn EXT2_ET_NO_MEMORY;\n#else  /* !HAVE_POSIX_MEMALIGN */\n#ifdef HAVE_MEMALIGN\n\t*p = memalign(align, size);\n\tif (*p == NULL) {\n\t\tif (errno)\n\t\t\treturn errno;\n\t\telse\n\t\t\treturn EXT2_ET_NO_MEMORY;\n\t}\n#else  /* !HAVE_MEMALIGN */\n#ifdef HAVE_VALLOC\n\tif (align > sizeof(long long))\n\t\t*p = valloc(size);\n\telse\n#endif\n\t\t*p = malloc(size);\n\tif ((uintptr_t) *p & (align - 1)) {\n\t\tfree(*p);\n\t\t*p = 0;\n\t}\n\tif (*p == 0)\n\t\treturn EXT2_ET_NO_MEMORY;\n#endif\t/* HAVE_MEMALIGN */\n#endif\t/* HAVE_POSIX_MEMALIGN */\n\treturn retval;\n}\n\n#ifdef DEBUG\nstatic int isaligned(void *ptr, unsigned long align)\n{\n\treturn (((unsigned long) ptr & (align - 1)) == 0);\n}\n\nstatic errcode_t test_memalign(unsigned long align)\n{\n\tvoid *ptr = 0;\n\terrcode_t retval;\n\n\tretval = ext2fs_get_memalign(32, align, &ptr);\n\tif (!retval && !isaligned(ptr, align))\n\t\tretval = EINVAL;\n\tfree(ptr);\n\tprintf(\"tst_memalign(%lu) is %s\\n\", align,\n\t       retval ? error_message(retval) : \"OK\");\n\treturn retval;\n}\n\nint main(int argc, char **argv)\n{\n\tint err = 0;\n\n\tif (test_memalign(4))\n\t\terr++;\n\tif (test_memalign(32))\n\t\terr++;\n\tif (test_memalign(1024))\n\t\terr++;\n\tif (test_memalign(4096))\n\t\terr++;\n\treturn err;\n}\n#endif\n"
  },
  {
    "path": "src/ext2fs/inline_data.c",
    "content": "/*\n * inline_data.c --- data in inode\n *\n * Copyright (C) 2012 Zheng Liu <wenqing.lz@taobao.com>\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <time.h>\n#include <limits.h> /* for PATH_MAX */\n\n#include \"ext2_fs.h\"\n#include \"ext2_ext_attr.h\"\n\n#include \"ext2fs.h\"\n#include \"ext2fsP.h\"\n\nstruct ext2_inline_data {\n\text2_filsys fs;\n\text2_ino_t ino;\n\tsize_t ea_size;\t/* the size of inline data in ea area */\n\tvoid *ea_data;\n};\n\nstatic errcode_t ext2fs_inline_data_ea_set(struct ext2_inline_data *data)\n{\n\tstruct ext2_xattr_handle *handle;\n\terrcode_t retval;\n\n\tretval = ext2fs_xattrs_open(data->fs, data->ino, &handle);\n\tif (retval)\n\t\treturn retval;\n\n\tretval = ext2fs_xattrs_read(handle);\n\tif (retval)\n\t\tgoto err;\n\n\tretval = ext2fs_xattr_set(handle, \"system.data\",\n\t\t\t\t  data->ea_data, data->ea_size);\nerr:\n\t(void) ext2fs_xattrs_close(&handle);\n\treturn retval;\n}\n\nstatic errcode_t ext2fs_inline_data_ea_get(struct ext2_inline_data *data)\n{\n\tstruct ext2_xattr_handle *handle;\n\terrcode_t retval;\n\n\tdata->ea_size = 0;\n\tdata->ea_data = 0;\n\n\tretval = ext2fs_xattrs_open(data->fs, data->ino, &handle);\n\tif (retval)\n\t\treturn retval;\n\n\tretval = ext2fs_xattrs_read(handle);\n\tif (retval)\n\t\tgoto err;\n\n\tretval = ext2fs_xattr_get(handle, \"system.data\",\n\t\t\t\t  (void **)&data->ea_data, &data->ea_size);\n\tif (retval == EXT2_ET_EA_KEY_NOT_FOUND) {\n\t\tdata->ea_size = 0;\n\t\tdata->ea_data = NULL;\n\t\tretval = 0;\n\t} else if (retval)\n\t\tgoto err;\n\nerr:\n\t(void) ext2fs_xattrs_close(&handle);\n\treturn retval;\n}\n\nerrcode_t ext2fs_inline_data_init(ext2_filsys fs, ext2_ino_t ino)\n{\n\tstruct ext2_inline_data data;\n\tchar empty[1] = { '\\0' };\n\n\tdata.fs = fs;\n\tdata.ino = ino;\n\tdata.ea_size = 0;\n\tdata.ea_data = empty;\n\treturn ext2fs_inline_data_ea_set(&data);\n}\n\nerrcode_t ext2fs_inline_data_size(ext2_filsys fs, ext2_ino_t ino, size_t *size)\n{\n\tstruct ext2_inode inode;\n\tstruct ext2_inline_data data;\n\terrcode_t retval;\n\n\tretval = ext2fs_read_inode(fs, ino, &inode);\n\tif (retval)\n\t\treturn retval;\n\n\tif (!(inode.i_flags & EXT4_INLINE_DATA_FL))\n\t\treturn EXT2_ET_NO_INLINE_DATA;\n\n\tdata.fs = fs;\n\tdata.ino = ino;\n\tretval = ext2fs_inline_data_ea_get(&data);\n\tif (retval)\n\t\treturn retval;\n\n\t*size = EXT4_MIN_INLINE_DATA_SIZE + data.ea_size;\n\treturn ext2fs_free_mem(&data.ea_data);\n}\n\nint ext2fs_inline_data_dir_iterate(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t   void *priv_data)\n{\n\tstruct dir_context *ctx;\n\tstruct ext2_inode inode;\n\tstruct ext2_dir_entry dirent;\n\tstruct ext2_inline_data data;\n\tint ret = BLOCK_ABORT;\n\te2_blkcnt_t blockcnt = 0;\n\tchar *old_buf;\n\tunsigned int old_buflen;\n\tint old_flags;\n\n\tctx = (struct dir_context *)priv_data;\n\told_buf = ctx->buf;\n\told_buflen = ctx->buflen;\n\told_flags = ctx->flags;\n\tctx->flags |= DIRENT_FLAG_INCLUDE_INLINE_DATA;\n\n\tctx->errcode = ext2fs_read_inode(fs, ino, &inode);\n\tif (ctx->errcode)\n\t\tgoto out;\n\n\tif (!(inode.i_flags & EXT4_INLINE_DATA_FL)) {\n\t\tctx->errcode = EXT2_ET_NO_INLINE_DATA;\n\t\tgoto out;\n\t}\n\n\tif (!LINUX_S_ISDIR(inode.i_mode)) {\n\t\tctx->errcode = EXT2_ET_NO_DIRECTORY;\n\t\tgoto out;\n\t}\n\tret = 0;\n\n\t/* we first check '.' and '..' dir */\n\tdirent.inode = ino;\n\tdirent.name_len = 1;\n\text2fs_set_rec_len(fs, EXT2_DIR_REC_LEN(2), &dirent);\n\tdirent.name[0] = '.';\n\tdirent.name[1] = '\\0';\n\tctx->buf = (char *)&dirent;\n\text2fs_get_rec_len(fs, &dirent, &ctx->buflen);\n\tret |= ext2fs_process_dir_block(fs, 0, blockcnt++, 0, 0, priv_data);\n\tif (ret & BLOCK_ABORT)\n\t\tgoto out;\n\n\tdirent.inode = ext2fs_le32_to_cpu(inode.i_block[0]);\n\tdirent.name_len = 2;\n\text2fs_set_rec_len(fs, EXT2_DIR_REC_LEN(3), &dirent);\n\tdirent.name[0] = '.';\n\tdirent.name[1] = '.';\n\tdirent.name[2] = '\\0';\n\tctx->buf = (char *)&dirent;\n\text2fs_get_rec_len(fs, &dirent, &ctx->buflen);\n\tret |= ext2fs_process_dir_block(fs, 0, blockcnt++, 0, 0, priv_data);\n\tif (ret & BLOCK_INLINE_DATA_CHANGED) {\n\t\terrcode_t err;\n\n\t\tinode.i_block[0] = ext2fs_cpu_to_le32(dirent.inode);\n\t\terr = ext2fs_write_inode(fs, ino, &inode);\n\t\tif (err)\n\t\t\tgoto out;\n\t\tret &= ~BLOCK_INLINE_DATA_CHANGED;\n\t}\n\tif (ret & BLOCK_ABORT)\n\t\tgoto out;\n\n\tctx->buf = (char *)inode.i_block + EXT4_INLINE_DATA_DOTDOT_SIZE;\n\tctx->buflen = EXT4_MIN_INLINE_DATA_SIZE - EXT4_INLINE_DATA_DOTDOT_SIZE;\n#ifdef WORDS_BIGENDIAN\n\tctx->errcode = ext2fs_dirent_swab_in2(fs, ctx->buf, ctx->buflen, 0);\n\tif (ctx->errcode) {\n\t\tret |= BLOCK_ABORT;\n\t\tgoto out;\n\t}\n#endif\n\tret |= ext2fs_process_dir_block(fs, 0, blockcnt++, 0, 0, priv_data);\n\tif (ret & BLOCK_INLINE_DATA_CHANGED) {\n#ifdef WORDS_BIGENDIAN\n\t\tctx->errcode = ext2fs_dirent_swab_out2(fs, ctx->buf,\n\t\t\t\t\t\t       ctx->buflen, 0);\n\t\tif (ctx->errcode) {\n\t\t\tret |= BLOCK_ABORT;\n\t\t\tgoto out;\n\t\t}\n#endif\n\t\tctx->errcode = ext2fs_write_inode(fs, ino, &inode);\n\t\tif (ctx->errcode)\n\t\t\tret |= BLOCK_ABORT;\n\t\tret &= ~BLOCK_INLINE_DATA_CHANGED;\n\t}\n\tif (ret & BLOCK_ABORT)\n\t\tgoto out;\n\n\tdata.fs = fs;\n\tdata.ino = ino;\n\tctx->errcode = ext2fs_inline_data_ea_get(&data);\n\tif (ctx->errcode) {\n\t\tret |= BLOCK_ABORT;\n\t\tgoto out;\n\t}\n\tif (data.ea_size <= 0)\n\t\tgoto out1;\n\n\tctx->buf = data.ea_data;\n\tctx->buflen = data.ea_size;\n#ifdef WORDS_BIGENDIAN\n\tctx->errcode = ext2fs_dirent_swab_in2(fs, ctx->buf, ctx->buflen, 0);\n\tif (ctx->errcode) {\n\t\tret |= BLOCK_ABORT;\n\t\tgoto out1;\n\t}\n#endif\n\n\tret |= ext2fs_process_dir_block(fs, 0, blockcnt++, 0, 0, priv_data);\n\tif (ret & BLOCK_INLINE_DATA_CHANGED) {\n#ifdef WORDS_BIGENDIAN\n\t\tctx->errcode = ext2fs_dirent_swab_out2(fs, ctx->buf,\n\t\t\t\t\t\t      ctx->buflen, 0);\n\t\tif (ctx->errcode) {\n\t\t\tret |= BLOCK_ABORT;\n\t\t\tgoto out1;\n\t\t}\n#endif\n\t\tctx->errcode = ext2fs_inline_data_ea_set(&data);\n\t\tif (ctx->errcode)\n\t\t\tret |= BLOCK_ABORT;\n\t}\n\nout1:\n\text2fs_free_mem(&data.ea_data);\nout:\n\tctx->buf = old_buf;\n\tctx->buflen = old_buflen;\n\tctx->flags = old_flags;\n\tret &= ~(BLOCK_ABORT | BLOCK_INLINE_DATA_CHANGED);\n\treturn ret;\n}\n\nerrcode_t ext2fs_inline_data_ea_remove(ext2_filsys fs, ext2_ino_t ino)\n{\n\tstruct ext2_xattr_handle *handle;\n\terrcode_t retval;\n\n\tretval = ext2fs_xattrs_open(fs, ino, &handle);\n\tif (retval)\n\t\treturn retval;\n\n\tretval = ext2fs_xattrs_read(handle);\n\tif (retval)\n\t\tgoto err;\n\n\tretval = ext2fs_xattr_remove(handle, \"system.data\");\nerr:\n\t(void) ext2fs_xattrs_close(&handle);\n\treturn retval;\n}\n\nstatic errcode_t ext2fs_inline_data_convert_dir(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\t\tchar *bbuf, char *ibuf, int size)\n{\n\tstruct ext2_dir_entry *dir, *dir2;\n\tstruct ext2_dir_entry_tail *t;\n\terrcode_t retval;\n\tint offset;\n\tunsigned int rec_len;\n\tint csum_size = 0;\n\tint filetype = 0;\n\n\tif (ext2fs_has_feature_metadata_csum(fs->super))\n\t\tcsum_size = sizeof(struct ext2_dir_entry_tail);\n\n\t/* Create '.' and '..' */\n\tif (ext2fs_has_feature_filetype(fs->super))\n\t\tfiletype = EXT2_FT_DIR;\n\n\t/*\n\t * Set up entry for '.'\n\t */\n\tdir = (struct ext2_dir_entry *) bbuf;\n\tdir->inode = ino;\n\text2fs_dirent_set_name_len(dir, 1);\n\text2fs_dirent_set_file_type(dir, filetype);\n\tdir->name[0] = '.';\n\trec_len = (fs->blocksize - csum_size) - EXT2_DIR_REC_LEN(1);\n\tdir->rec_len = EXT2_DIR_REC_LEN(1);\n\n\t/*\n\t * Set up entry for '..'\n\t */\n\tdir = (struct ext2_dir_entry *) (bbuf + dir->rec_len);\n\tdir->rec_len = EXT2_DIR_REC_LEN(2);\n\tdir->inode = ext2fs_le32_to_cpu(((__u32 *)ibuf)[0]);\n\text2fs_dirent_set_name_len(dir, 2);\n\text2fs_dirent_set_file_type(dir, filetype);\n\tdir->name[0] = '.';\n\tdir->name[1] = '.';\n\n\t/*\n\t * Adjust the last rec_len\n\t */\n\toffset = EXT2_DIR_REC_LEN(1) + EXT2_DIR_REC_LEN(2);\n\tdir = (struct ext2_dir_entry *) (bbuf + offset);\n\tmemcpy(bbuf + offset, ibuf + EXT4_INLINE_DATA_DOTDOT_SIZE,\n\t       size - EXT4_INLINE_DATA_DOTDOT_SIZE);\n\tsize += EXT2_DIR_REC_LEN(1) + EXT2_DIR_REC_LEN(2) -\n\t\tEXT4_INLINE_DATA_DOTDOT_SIZE;\n\n\tdo {\n\t\tdir2 = dir;\n\t\tretval = ext2fs_get_rec_len(fs, dir, &rec_len);\n\t\tif (retval)\n\t\t\tgoto err;\n\t\toffset += rec_len;\n\t\tdir = (struct ext2_dir_entry *) (bbuf + offset);\n\t} while (offset < size);\n\trec_len += fs->blocksize - csum_size - offset;\n\tretval = ext2fs_set_rec_len(fs, rec_len, dir2);\n\tif (retval)\n\t\tgoto err;\n\n\tif (csum_size) {\n\t\tt = EXT2_DIRENT_TAIL(bbuf, fs->blocksize);\n\t\text2fs_initialize_dirent_tail(fs, t);\n\t}\n\nerr:\n\treturn retval;\n}\n\nstatic errcode_t\next2fs_inline_data_dir_expand(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t      struct ext2_inode *inode, char *buf, size_t size)\n{\n\terrcode_t retval;\n\tblk64_t blk;\n\tchar *blk_buf;\n\n\tretval = ext2fs_get_memzero(fs->blocksize, &blk_buf);\n\tif (retval)\n\t\treturn retval;\n\n#ifdef WORDS_BIGENDIAN\n\tretval = ext2fs_dirent_swab_in2(fs, buf + EXT4_INLINE_DATA_DOTDOT_SIZE,\n\t\t\t\t\tsize, 0);\n\tif (retval)\n\t\tgoto errout;\n#endif\n\n\t/* Adjust the rec_len */\n\tretval = ext2fs_inline_data_convert_dir(fs, ino, blk_buf, buf, size);\n\tif (retval)\n\t\tgoto errout;\n\t/* Allocate a new block */\n\tretval = ext2fs_new_block2(fs, 0, 0, &blk);\n\tif (retval)\n\t\tgoto errout;\n\tretval = ext2fs_write_dir_block4(fs, blk, blk_buf, 0, ino);\n\tif (retval)\n\t\tgoto errout;\n\n\t/* Update inode */\n\tif (ext2fs_has_feature_extents(fs->super))\n\t\tinode->i_flags |= EXT4_EXTENTS_FL;\n\tinode->i_flags &= ~EXT4_INLINE_DATA_FL;\n\tretval = ext2fs_iblk_add_blocks(fs, inode, 1);\n\tif (retval)\n\t\tgoto errout;\n\tinode->i_size = fs->blocksize;\n\tretval = ext2fs_bmap2(fs, ino, inode, 0, BMAP_SET, 0, 0, &blk);\n\tif (retval)\n\t\tgoto errout;\n\tretval = ext2fs_write_inode(fs, ino, inode);\n\tif (retval)\n\t\tgoto errout;\n\text2fs_block_alloc_stats(fs, blk, +1);\n\nerrout:\n\text2fs_free_mem(&blk_buf);\n\treturn retval;\n}\n\nstatic errcode_t\next2fs_inline_data_file_expand(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t       struct ext2_inode *inode, char *buf, size_t size)\n{\n\text2_file_t e2_file;\n\terrcode_t retval;\n\n\t/* Update inode */\n\tmemset(inode->i_block, 0, sizeof(inode->i_block));\n\tif (ext2fs_has_feature_extents(fs->super)) {\n\t\text2_extent_handle_t handle;\n\n\t\tinode->i_flags &= ~EXT4_EXTENTS_FL;\n\t\tretval = ext2fs_extent_open2(fs, ino, inode, &handle);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\text2fs_extent_free(handle);\n\t}\n\tinode->i_flags &= ~EXT4_INLINE_DATA_FL;\n\tinode->i_size = 0;\n\tretval = ext2fs_write_inode(fs, ino, inode);\n\tif (retval)\n\t\treturn retval;\n\n\t/* Write out the block buffer */\n\tretval = ext2fs_file_open(fs, ino, EXT2_FILE_WRITE, &e2_file);\n\tif (retval)\n\t\treturn retval;\n\tretval = ext2fs_file_write(e2_file, buf, size, 0);\n\text2fs_file_close(e2_file);\n\treturn retval;\n}\n\nerrcode_t ext2fs_inline_data_expand(ext2_filsys fs, ext2_ino_t ino)\n{\n\tstruct ext2_inode inode;\n\tstruct ext2_inline_data data;\n\terrcode_t retval;\n\tsize_t inline_size;\n\tchar *inline_buf = 0;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tretval = ext2fs_read_inode(fs, ino, &inode);\n\tif (retval)\n\t\treturn retval;\n\n\tif (!(inode.i_flags & EXT4_INLINE_DATA_FL))\n\t\treturn EXT2_ET_NO_INLINE_DATA;\n\n\tdata.fs = fs;\n\tdata.ino = ino;\n\tretval = ext2fs_inline_data_ea_get(&data);\n\tif (retval)\n\t\treturn retval;\n\tinline_size = data.ea_size + EXT4_MIN_INLINE_DATA_SIZE;\n\tretval = ext2fs_get_mem(inline_size, &inline_buf);\n\tif (retval)\n\t\tgoto errout;\n\n\tmemcpy(inline_buf, (void *)inode.i_block, EXT4_MIN_INLINE_DATA_SIZE);\n\tif (data.ea_size > 0) {\n\t\tmemcpy(inline_buf + EXT4_MIN_INLINE_DATA_SIZE,\n\t\t       data.ea_data, data.ea_size);\n\t}\n\n\tmemset((void *)inode.i_block, 0, EXT4_MIN_INLINE_DATA_SIZE);\n\t/*\n\t * NOTE: We must do this write -> ea_remove -> read cycle here because\n\t * removing the inline data EA can free the EA block, which is a change\n\t * that our stack copy of the inode will never see.  If that happens,\n\t * we can end up with the EA block and lblk 0 pointing to the same\n\t * pblk, which is bad news.\n\t */\n\tretval = ext2fs_write_inode(fs, ino, &inode);\n\tif (retval)\n\t\tgoto errout;\n\tretval = ext2fs_inline_data_ea_remove(fs, ino);\n\tif (retval)\n\t\tgoto errout;\n\tretval = ext2fs_read_inode(fs, ino, &inode);\n\tif (retval)\n\t\tgoto errout;\n\n\tif (LINUX_S_ISDIR(inode.i_mode)) {\n\t\tretval = ext2fs_inline_data_dir_expand(fs, ino, &inode,\n\t\t\t\t\t\tinline_buf, inline_size);\n\t} else {\n\t\tretval = ext2fs_inline_data_file_expand(fs, ino, &inode,\n\t\t\t\t\t\tinline_buf, inline_size);\n\t}\n\nerrout:\n\tif (inline_buf)\n\t\text2fs_free_mem(&inline_buf);\n\text2fs_free_mem(&data.ea_data);\n\treturn retval;\n}\n\n/*\n * When caller uses this function to retrieve the inline data, it must\n * allocate a buffer which has the size of inline data.  The size of\n * inline data can be know by ext2fs_inline_data_get_size().\n */\nerrcode_t ext2fs_inline_data_get(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t struct ext2_inode *inode,\n\t\t\t\t void *buf, size_t *size)\n{\n\tstruct ext2_inode inode_buf;\n\tstruct ext2_inline_data data;\n\terrcode_t retval;\n\n\tif (!inode) {\n\t\tretval = ext2fs_read_inode(fs, ino, &inode_buf);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tinode = &inode_buf;\n\t}\n\n\tdata.fs = fs;\n\tdata.ino = ino;\n\tretval = ext2fs_inline_data_ea_get(&data);\n\tif (retval)\n\t\treturn retval;\n\n\tmemcpy(buf, (void *)inode->i_block, EXT4_MIN_INLINE_DATA_SIZE);\n\tif (data.ea_size > 0)\n\t\tmemcpy((char *) buf + EXT4_MIN_INLINE_DATA_SIZE,\n\t\t       data.ea_data, data.ea_size);\n\n\tif (size)\n\t\t*size = EXT4_MIN_INLINE_DATA_SIZE + data.ea_size;\n\text2fs_free_mem(&data.ea_data);\n\treturn 0;\n}\n\nerrcode_t ext2fs_inline_data_set(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t struct ext2_inode *inode,\n\t\t\t\t void *buf, size_t size)\n{\n\tstruct ext2_inode inode_buf;\n\tstruct ext2_inline_data data = {\n\t\t.fs = fs,\n\t\t.ino = ino,\n\t};\n\terrcode_t retval;\n\tsize_t free_ea_size, existing_size, free_inode_size;\n\n\tif (!inode) {\n\t\tretval = ext2fs_read_inode(fs, ino, &inode_buf);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tinode = &inode_buf;\n\t}\n\n\tif (size <= EXT4_MIN_INLINE_DATA_SIZE) {\n\t\tmemcpy((void *)inode->i_block, buf, size);\n\t} else {\n\t\tretval = ext2fs_xattr_inode_max_size(fs, ino, &free_ea_size);\n\t\tif (retval)\n\t\t\treturn retval;\n\n\t\tretval = ext2fs_inline_data_size(fs, ino, &existing_size);\n\t\tif (retval)\n\t\t\treturn retval;\n\n\t\tif (existing_size < EXT4_MIN_INLINE_DATA_SIZE) {\n\t\t\tfree_inode_size = EXT4_MIN_INLINE_DATA_SIZE -\n\t\t\t\t\t  existing_size;\n\t\t} else {\n\t\t\tfree_inode_size = 0;\n\t\t}\n\n\t\tif (size != existing_size &&\n\t\t    size > existing_size + free_ea_size + free_inode_size)\n\t\t\treturn EXT2_ET_INLINE_DATA_NO_SPACE;\n\n\t\tmemcpy((void *)inode->i_block, buf, EXT4_MIN_INLINE_DATA_SIZE);\n\t\tif (size > EXT4_MIN_INLINE_DATA_SIZE)\n\t\t\tdata.ea_size = size - EXT4_MIN_INLINE_DATA_SIZE;\n\t\tdata.ea_data = (char *) buf + EXT4_MIN_INLINE_DATA_SIZE;\n\t}\n\tretval = ext2fs_write_inode(fs, ino, inode);\n\tif (retval)\n\t\treturn retval;\n\treturn ext2fs_inline_data_ea_set(&data);\n}\n\n#ifdef DEBUG\n#include \"e2p/e2p.h\"\n\n/*\n * The length of buffer is set to 64 because in inode's i_block member it only\n * can save 60 bytes.  Thus this value can let the data being saved in extra\n * space.\n */\n#define BUFF_SIZE (64)\n\nstatic errcode_t file_test(ext2_filsys fs)\n{\n\tstruct ext2_inode inode;\n\text2_ino_t newfile;\n\terrcode_t retval;\n\tsize_t size;\n\tchar *buf = 0, *cmpbuf = 0;\n\n\t/* create a new file */\n\tretval = ext2fs_new_inode(fs, 2, 010755, 0, &newfile);\n\tif (retval) {\n\t\tcom_err(\"file_test\", retval, \"while allocating a new inode\");\n\t\treturn 1;\n\t}\n\n\tmemset(&inode, 0, sizeof(inode));\n\tinode.i_flags |= EXT4_INLINE_DATA_FL;\n\tinode.i_size = EXT4_MIN_INLINE_DATA_SIZE;\n\tinode.i_mode = LINUX_S_IFREG;\n\tretval = ext2fs_write_new_inode(fs, newfile, &inode);\n\tif (retval) {\n\t\tcom_err(\"file_test\", retval, \"while writing a new inode\");\n\t\treturn 1;\n\t}\n\n\tretval = ext2fs_inline_data_init(fs, newfile);\n\tif (retval) {\n\t\tcom_err(\"file_test\", retval, \"while init 'system.data'\");\n\t\treturn 1;\n\t}\n\n\tretval = ext2fs_inline_data_size(fs, newfile, &size);\n\tif (retval) {\n\t\tcom_err(\"file_test\", retval, \"while getting size\");\n\t\treturn 1;\n\t}\n\n\tif (size != EXT4_MIN_INLINE_DATA_SIZE) {\n\t\tfprintf(stderr,\n\t\t\t\"tst_inline_data: size of inline data is wrong\\n\");\n\t\treturn 1;\n\t}\n\n\text2fs_get_mem(BUFF_SIZE, &buf);\n\tmemset(buf, 'a', BUFF_SIZE);\n\tretval = ext2fs_inline_data_set(fs, newfile, 0, buf, BUFF_SIZE);\n\tif (retval) {\n\t\tcom_err(\"file_test\", retval,\n\t\t\t\"while setting inline data %s\", buf);\n\t\tgoto err;\n\t}\n\n\text2fs_get_mem(BUFF_SIZE, &cmpbuf);\n\tretval = ext2fs_inline_data_get(fs, newfile, 0, cmpbuf, &size);\n\tif (retval) {\n\t\tcom_err(\"file_test\", retval, \"while getting inline data\");\n\t\tgoto err;\n\t}\n\n\tif (size != BUFF_SIZE) {\n\t\tfprintf(stderr,\n\t\t\t\"tst_inline_data: size %lu != buflen %u\\n\",\n\t\t\tsize, BUFF_SIZE);\n\t\tretval = 1;\n\t\tgoto err;\n\t}\n\n\tif (memcmp(buf, cmpbuf, BUFF_SIZE)) {\n\t\tfprintf(stderr, \"tst_inline_data: buf != cmpbuf\\n\");\n\t\tretval = 1;\n\t\tgoto err;\n\t}\n\n\tretval = ext2fs_punch(fs, newfile, 0, 0, 0, ~0ULL);\n\tif (retval) {\n\t\tcom_err(\"file_test\", retval, \"while truncating inode\");\n\t\tgoto err;\n\t}\n\n\t/* reload inode and check isize */\n\text2fs_read_inode(fs, newfile, &inode);\n\tif (inode.i_size != 0) {\n\t\tfprintf(stderr, \"tst_inline_data: i_size should be 0\\n\");\n\t\tretval = 1;\n\t}\n\nerr:\n\tif (cmpbuf)\n\t\text2fs_free_mem(&cmpbuf);\n\tif (buf)\n\t\text2fs_free_mem(&buf);\n\treturn retval;\n}\n\nstatic errcode_t dir_test(ext2_filsys fs)\n{\n\tconst char *dot_name = \".\";\n\tconst char *stub_name = \"stub\";\n\tconst char *parent_name = \"test\";\n\text2_ino_t parent, dir, tmp;\n\terrcode_t retval;\n\tchar dirname[32];\n\tint i;\n\n\tretval = ext2fs_mkdir(fs, 11, 11, stub_name);\n\tif (retval) {\n\t\tcom_err(\"dir_test\", retval, \"while creating %s dir\", stub_name);\n\t\treturn retval;\n\t}\n\n\tretval = ext2fs_mkdir(fs, 11, 0, parent_name);\n\tif (retval) {\n\t\tcom_err(\"dir_test\", retval,\n\t\t\t\"while creating %s dir\", parent_name);\n\t\treturn retval;\n\t}\n\n\tretval = ext2fs_lookup(fs, 11, parent_name, strlen(parent_name),\n\t\t\t       0, &parent);\n\tif (retval) {\n\t\tcom_err(\"dir_test\", retval,\n\t\t\t\"while looking up %s dir\", parent_name);\n\t\treturn retval;\n\t}\n\n\tretval = ext2fs_lookup(fs, parent, dot_name, strlen(dot_name),\n\t\t\t       0, &tmp);\n\tif (retval) {\n\t\tcom_err(\"dir_test\", retval,\n\t\t\t\"while looking up %s dir\", parent_name);\n\t\treturn retval;\n\t}\n\n\tif (parent != tmp) {\n\t\tfprintf(stderr, \"tst_inline_data: parent (%u) != tmp (%u)\\n\",\n\t\t\tparent, tmp);\n\t\treturn 1;\n\t}\n\n\tfor (i = 0, dir = 13; i < 4; i++, dir++) {\n\t\ttmp = 0;\n\t\tsnprintf(dirname, sizeof(dirname), \"%d\", i);\n\t\tretval = ext2fs_mkdir(fs, parent, 0, dirname);\n\t\tif (retval) {\n\t\t\tcom_err(\"dir_test\", retval,\n\t\t\t\t\"while creating %s dir\", dirname);\n\t\t\treturn retval;\n\t\t}\n\n\t\tretval = ext2fs_lookup(fs, parent, dirname, strlen(dirname),\n\t\t\t\t       0, &tmp);\n\t\tif (retval) {\n\t\t\tcom_err(\"dir_test\", retval,\n\t\t\t\t\"while looking up %s dir\", parent_name);\n\t\t\treturn retval;\n\t\t}\n\n\t\tif (dir != tmp) {\n\t\t\tfprintf(stderr,\n\t\t\t\t\"tst_inline_data: dir (%u) != tmp (%u)\\n\",\n\t\t\t\tdir, tmp);\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tsnprintf(dirname, sizeof(dirname), \"%d\", i);\n\tretval = ext2fs_mkdir(fs, parent, 0, dirname);\n\tif (retval && retval != EXT2_ET_DIR_NO_SPACE) {\n\t\tcom_err(\"dir_test\", retval, \"while creating %s dir\", dirname);\n\t\treturn retval;\n\t}\n\n\tretval = ext2fs_expand_dir(fs, parent);\n\tif (retval) {\n\t\tcom_err(\"dir_test\", retval, \"while expanding %s dir\", parent_name);\n\t\treturn retval;\n\t}\n\n\treturn 0;\n}\n\nint main(int argc, char *argv[])\n{\n\text2_filsys\t\tfs;\n\tstruct ext2_super_block param;\n\terrcode_t\t\tretval;\n\n\t/* setup */\n\tinitialize_ext2_error_table();\n\n\tmemset(&param, 0, sizeof(param));\n\text2fs_blocks_count_set(&param, 32768);\n\tparam.s_inodes_count = 100;\n\n\tparam.s_feature_incompat |= EXT4_FEATURE_INCOMPAT_INLINE_DATA;\n\tparam.s_rev_level = EXT2_DYNAMIC_REV;\n\tparam.s_inode_size = 256;\n\n\tretval = ext2fs_initialize(\"test fs\", EXT2_FLAG_64BITS, &param,\n\t\t\t\t   test_io_manager, &fs);\n\tif (retval) {\n\t\tcom_err(\"setup\", retval,\n\t\t\t\"while initializing filesystem\");\n\t\texit(1);\n\t}\n\n\tretval = ext2fs_allocate_tables(fs);\n\tif (retval) {\n\t\tcom_err(\"setup\", retval,\n\t\t\t\"while allocating tables for test filesystem\");\n\t\texit(1);\n\t}\n\n\t/* initialize inode cache */\n\tif (!fs->icache) {\n\t\text2_ino_t first_ino = EXT2_FIRST_INO(fs->super);\n\t\tint i;\n\n\t\t/* we just want to init inode cache.  So ignore error */\n\t\text2fs_create_inode_cache(fs, 16);\n\t\tif (!fs->icache) {\n\t\t\tfprintf(stderr,\n\t\t\t\t\"tst_inline_data: init inode cache failed\\n\");\n\t\t\texit(1);\n\t\t}\n\n\t\t/* setup inode cache */\n\t\tfor (i = 0; i < fs->icache->cache_size; i++)\n\t\t\tfs->icache->cache[i].ino = first_ino++;\n\t}\n\n\t/* test */\n\tif (file_test(fs)) {\n\t\tfprintf(stderr, \"tst_inline_data(FILE): FAILED\\n\");\n\t\treturn 1;\n\t}\n\tprintf(\"tst_inline_data(FILE): OK\\n\");\n\n\tif (dir_test(fs)) {\n\t\tfprintf(stderr, \"tst_inline_data(DIR): FAILED\\n\");\n\t\treturn 1;\n\t}\n\tprintf(\"tst_inline_data(DIR): OK\\n\");\n\text2fs_free(fs);\n\n\treturn 0;\n}\n#endif\n"
  },
  {
    "path": "src/ext2fs/inode.c",
    "content": "/*\n * inode.c --- utility routines to read and write inodes\n *\n * Copyright (C) 1993, 1994, 1995, 1996, 1997 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#if HAVE_ERRNO_H\n#include <errno.h>\n#endif\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fsP.h\"\n#include \"e2image.h\"\n\n#define IBLOCK_STATUS_CSUMS_OK\t1\n#define IBLOCK_STATUS_INSANE\t2\n#define SCAN_BLOCK_STATUS(scan)\t((scan)->temp_buffer + (scan)->inode_size)\n\nstruct ext2_struct_inode_scan {\n\terrcode_t\t\tmagic;\n\text2_filsys\t\tfs;\n\text2_ino_t\t\tcurrent_inode;\n\tblk64_t\t\t\tcurrent_block;\n\tdgrp_t\t\t\tcurrent_group;\n\text2_ino_t\t\tinodes_left;\n\tblk_t\t\t\tblocks_left;\n\tdgrp_t\t\t\tgroups_left;\n\tblk_t\t\t\tinode_buffer_blocks;\n\tchar *\t\t\tinode_buffer;\n\tint\t\t\tinode_size;\n\tchar *\t\t\tptr;\n\tint\t\t\tbytes_left;\n\tchar\t\t\t*temp_buffer;\n\terrcode_t\t\t(*done_group)(ext2_filsys fs,\n\t\t\t\t\t      ext2_inode_scan scan,\n\t\t\t\t\t      dgrp_t group,\n\t\t\t\t\t      void * priv_data);\n\tvoid *\t\t\tdone_group_data;\n\tint\t\t\tbad_block_ptr;\n\tint\t\t\tscan_flags;\n\tint\t\t\treserved[6];\n};\n\n/*\n * This routine flushes the icache, if it exists.\n */\nerrcode_t ext2fs_flush_icache(ext2_filsys fs)\n{\n\tunsigned\ti;\n\n\tif (!fs->icache)\n\t\treturn 0;\n\n\tfor (i=0; i < fs->icache->cache_size; i++)\n\t\tfs->icache->cache[i].ino = 0;\n\n\tfs->icache->buffer_blk = 0;\n\treturn 0;\n}\n\n/*\n * Free the inode cache structure\n */\nvoid ext2fs_free_inode_cache(struct ext2_inode_cache *icache)\n{\n\tunsigned i;\n\n\tif (--icache->refcount)\n\t\treturn;\n\tif (icache->buffer)\n\t\text2fs_free_mem(&icache->buffer);\n\tif (icache->cache) {\n\t\tfor (i = 0; i < icache->cache_size; i++)\n\t\t\text2fs_free_mem(&icache->cache[i].inode);\n\t\text2fs_free_mem(&icache->cache);\n\t}\n\ticache->buffer_blk = 0;\n\text2fs_free_mem(&icache);\n}\n\nerrcode_t ext2fs_create_inode_cache(ext2_filsys fs, unsigned int cache_size)\n{\n\tunsigned\ti;\n\terrcode_t\tretval;\n\n\tif (fs->icache)\n\t\treturn 0;\n\tretval = ext2fs_get_mem(sizeof(struct ext2_inode_cache), &fs->icache);\n\tif (retval)\n\t\treturn retval;\n\n\tmemset(fs->icache, 0, sizeof(struct ext2_inode_cache));\n\tretval = ext2fs_get_mem(fs->blocksize, &fs->icache->buffer);\n\tif (retval)\n\t\tgoto errout;\n\n\tfs->icache->buffer_blk = 0;\n\tfs->icache->cache_last = -1;\n\tfs->icache->cache_size = cache_size;\n\tfs->icache->refcount = 1;\n\tretval = ext2fs_get_array(fs->icache->cache_size,\n\t\t\t\t  sizeof(struct ext2_inode_cache_ent),\n\t\t\t\t  &fs->icache->cache);\n\tif (retval)\n\t\tgoto errout;\n\n\tfor (i = 0; i < fs->icache->cache_size; i++) {\n\t\tretval = ext2fs_get_mem(EXT2_INODE_SIZE(fs->super),\n\t\t\t\t\t&fs->icache->cache[i].inode);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t}\n\n\text2fs_flush_icache(fs);\n\treturn 0;\nerrout:\n\text2fs_free_inode_cache(fs->icache);\n\tfs->icache = 0;\n\treturn retval;\n}\n\nerrcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks,\n\t\t\t\t ext2_inode_scan *ret_scan)\n{\n\text2_inode_scan\tscan;\n\terrcode_t\tretval;\n\terrcode_t (*save_get_blocks)(ext2_filsys f, ext2_ino_t ino, blk_t *blocks);\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\t/*\n\t * If fs->badblocks isn't set, then set it --- since the inode\n\t * scanning functions require it.\n\t */\n\tif (fs->badblocks == 0) {\n\t\t/*\n\t\t * Temporarily save fs->get_blocks and set it to zero,\n\t\t * for compatibility with old e2fsck's.\n\t\t */\n\t\tsave_get_blocks = fs->get_blocks;\n\t\tfs->get_blocks = 0;\n\t\tretval = ext2fs_read_bb_inode(fs, &fs->badblocks);\n\t\tif (retval && fs->badblocks) {\n\t\t\text2fs_badblocks_list_free(fs->badblocks);\n\t\t\tfs->badblocks = 0;\n\t\t}\n\t\tfs->get_blocks = save_get_blocks;\n\t}\n\n\tretval = ext2fs_get_mem(sizeof(struct ext2_struct_inode_scan), &scan);\n\tif (retval)\n\t\treturn retval;\n\tmemset(scan, 0, sizeof(struct ext2_struct_inode_scan));\n\n\tscan->magic = EXT2_ET_MAGIC_INODE_SCAN;\n\tscan->fs = fs;\n\tscan->inode_size = EXT2_INODE_SIZE(fs->super);\n\tscan->bytes_left = 0;\n\tscan->current_group = 0;\n\tscan->groups_left = fs->group_desc_count - 1;\n\tscan->inode_buffer_blocks = buffer_blocks ? buffer_blocks :\n\t\t\t\t    EXT2_INODE_SCAN_DEFAULT_BUFFER_BLOCKS;\n\tscan->current_block = ext2fs_inode_table_loc(scan->fs,\n\t\t\t\t\t\t     scan->current_group);\n\tif (scan->current_block &&\n\t    ((scan->current_block < fs->super->s_first_data_block) ||\n\t     (scan->current_block + fs->inode_blocks_per_group - 1 >=\n\t      ext2fs_blocks_count(fs->super)))) {\n\t\text2fs_free_mem(&scan);\n\t\treturn EXT2_ET_GDESC_BAD_INODE_TABLE;\n\t}\n\n\tscan->inodes_left = EXT2_INODES_PER_GROUP(scan->fs->super);\n\tscan->blocks_left = scan->fs->inode_blocks_per_group;\n\tif (ext2fs_has_group_desc_csum(fs)) {\n\t\t__u32 unused = ext2fs_bg_itable_unused(fs, scan->current_group);\n\t\tif (scan->inodes_left > unused)\n\t\t\tscan->inodes_left -= unused;\n\t\telse\n\t\t\tscan->inodes_left = 0;\n\t\tscan->blocks_left =\n\t\t\t(scan->inodes_left +\n\t\t\t (fs->blocksize / scan->inode_size - 1)) *\n\t\t\tscan->inode_size / fs->blocksize;\n\t}\n\tretval = io_channel_alloc_buf(fs->io, scan->inode_buffer_blocks,\n\t\t\t\t      &scan->inode_buffer);\n\tscan->done_group = 0;\n\tscan->done_group_data = 0;\n\tscan->bad_block_ptr = 0;\n\tif (retval) {\n\t\text2fs_free_mem(&scan);\n\t\treturn retval;\n\t}\n\tretval = ext2fs_get_mem(scan->inode_size + scan->inode_buffer_blocks,\n\t\t\t\t&scan->temp_buffer);\n\tif (retval) {\n\t\text2fs_free_mem(&scan->inode_buffer);\n\t\text2fs_free_mem(&scan);\n\t\treturn retval;\n\t}\n\tmemset(SCAN_BLOCK_STATUS(scan), 0, scan->inode_buffer_blocks);\n\tif (scan->fs->badblocks && scan->fs->badblocks->num)\n\t\tscan->scan_flags |= EXT2_SF_CHK_BADBLOCKS;\n\tif (ext2fs_has_group_desc_csum(fs))\n\t\tscan->scan_flags |= EXT2_SF_DO_LAZY;\n\t*ret_scan = scan;\n\treturn 0;\n}\n\nvoid ext2fs_close_inode_scan(ext2_inode_scan scan)\n{\n\tif (!scan || (scan->magic != EXT2_ET_MAGIC_INODE_SCAN))\n\t\treturn;\n\n\text2fs_free_mem(&scan->inode_buffer);\n\tscan->inode_buffer = NULL;\n\text2fs_free_mem(&scan->temp_buffer);\n\tscan->temp_buffer = NULL;\n\text2fs_free_mem(&scan);\n\treturn;\n}\n\nvoid ext2fs_set_inode_callback(ext2_inode_scan scan,\n\t\t\t       errcode_t (*done_group)(ext2_filsys fs,\n\t\t\t\t\t\t       ext2_inode_scan scan,\n\t\t\t\t\t\t       dgrp_t group,\n\t\t\t\t\t\t       void * priv_data),\n\t\t\t       void *done_group_data)\n{\n\tif (!scan || (scan->magic != EXT2_ET_MAGIC_INODE_SCAN))\n\t\treturn;\n\n\tscan->done_group = done_group;\n\tscan->done_group_data = done_group_data;\n}\n\nint ext2fs_inode_scan_flags(ext2_inode_scan scan, int set_flags,\n\t\t\t    int clear_flags)\n{\n\tint\told_flags;\n\n\tif (!scan || (scan->magic != EXT2_ET_MAGIC_INODE_SCAN))\n\t\treturn 0;\n\n\told_flags = scan->scan_flags;\n\tscan->scan_flags &= ~clear_flags;\n\tscan->scan_flags |= set_flags;\n\treturn old_flags;\n}\n\n/*\n * This function is called by ext2fs_get_next_inode when it needs to\n * get ready to read in a new blockgroup.\n */\nstatic errcode_t get_next_blockgroup(ext2_inode_scan scan)\n{\n\text2_filsys fs = scan->fs;\n\n\tscan->current_group++;\n\tscan->groups_left--;\n\n\tscan->current_block = ext2fs_inode_table_loc(scan->fs,\n\t\t\t\t\t\t     scan->current_group);\n\tscan->current_inode = scan->current_group *\n\t\tEXT2_INODES_PER_GROUP(fs->super);\n\n\tscan->bytes_left = 0;\n\tscan->inodes_left = EXT2_INODES_PER_GROUP(fs->super);\n\tscan->blocks_left = fs->inode_blocks_per_group;\n\tif (ext2fs_has_group_desc_csum(fs)) {\n\t\t__u32 unused = ext2fs_bg_itable_unused(fs, scan->current_group);\n\t\tif (scan->inodes_left > unused)\n\t\t\tscan->inodes_left -= unused;\n\t\telse\n\t\t\tscan->inodes_left = 0;\n\t\tscan->blocks_left =\n\t\t\t(scan->inodes_left +\n\t\t\t (fs->blocksize / scan->inode_size - 1)) *\n\t\t\tscan->inode_size / fs->blocksize;\n\t}\n\tif (scan->current_block &&\n\t    ((scan->current_block < fs->super->s_first_data_block) ||\n\t     (scan->current_block + fs->inode_blocks_per_group - 1 >=\n\t      ext2fs_blocks_count(fs->super))))\n\t\treturn EXT2_ET_GDESC_BAD_INODE_TABLE;\n\treturn 0;\n}\n\nerrcode_t ext2fs_inode_scan_goto_blockgroup(ext2_inode_scan scan,\n\t\t\t\t\t    int\tgroup)\n{\n\tscan->current_group = group - 1;\n\tscan->groups_left = scan->fs->group_desc_count - group;\n\tscan->bad_block_ptr = 0;\n\treturn get_next_blockgroup(scan);\n}\n\n/*\n * This function is called by get_next_blocks() to check for bad\n * blocks in the inode table.\n *\n * This function assumes that badblocks_list->list is sorted in\n * increasing order.\n */\nstatic errcode_t check_for_inode_bad_blocks(ext2_inode_scan scan,\n\t\t\t\t\t    blk64_t *num_blocks)\n{\n\tblk64_t\tblk = scan->current_block;\n\tbadblocks_list\tbb = scan->fs->badblocks;\n\n\t/*\n\t * If the inode table is missing, then obviously there are no\n\t * bad blocks.  :-)\n\t */\n\tif (blk == 0)\n\t\treturn 0;\n\n\t/* Make sure bad_block_ptr is still valid */\n\tif (scan->bad_block_ptr >= bb->num) {\n\t\tscan->scan_flags &= ~EXT2_SF_CHK_BADBLOCKS;\n\t\treturn 0;\n\t}\n\n\t/*\n\t * If the current block is greater than the bad block listed\n\t * in the bad block list, then advance the pointer until this\n\t * is no longer the case.  If we run out of bad blocks, then\n\t * we don't need to do any more checking!\n\t */\n\twhile (blk > bb->list[scan->bad_block_ptr]) {\n\t\tif (++scan->bad_block_ptr >= bb->num) {\n\t\t\tscan->scan_flags &= ~EXT2_SF_CHK_BADBLOCKS;\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\t/*\n\t * If the current block is equal to the bad block listed in\n\t * the bad block list, then handle that one block specially.\n\t * (We could try to handle runs of bad blocks, but that\n\t * only increases CPU efficiency by a small amount, at the\n\t * expense of a huge expense of code complexity, and for an\n\t * uncommon case at that.)\n\t */\n\tif (blk == bb->list[scan->bad_block_ptr]) {\n\t\tscan->scan_flags |= EXT2_SF_BAD_INODE_BLK;\n\t\t*num_blocks = 1;\n\t\tif (++scan->bad_block_ptr >= bb->num)\n\t\t\tscan->scan_flags &= ~EXT2_SF_CHK_BADBLOCKS;\n\t\treturn 0;\n\t}\n\n\t/*\n\t * If there is a bad block in the range that we're about to\n\t * read in, adjust the number of blocks to read so that we we\n\t * don't read in the bad block.  (Then the next block to read\n\t * will be the bad block, which is handled in the above case.)\n\t */\n\tif ((blk + *num_blocks) > bb->list[scan->bad_block_ptr])\n\t\t*num_blocks = (int) (bb->list[scan->bad_block_ptr] - blk);\n\n\treturn 0;\n}\n\nstatic int block_map_looks_insane(ext2_filsys fs,\n\t\t\t\t  struct ext2_inode_large *inode)\n{\n\tunsigned int i, bad;\n\n\t/* We're only interested in block mapped files, dirs, and symlinks */\n\tif ((inode->i_flags & EXT4_INLINE_DATA_FL) ||\n\t    (inode->i_flags & EXT4_EXTENTS_FL))\n\t\treturn 0;\n\tif (!LINUX_S_ISREG(inode->i_mode) &&\n\t    !LINUX_S_ISLNK(inode->i_mode) &&\n\t    !LINUX_S_ISDIR(inode->i_mode))\n\t\treturn 0;\n\tif (LINUX_S_ISLNK(inode->i_mode) &&\n\t    EXT2_I_SIZE(inode) <= sizeof(inode->i_block))\n\t\treturn 0;\n\n\t/* Unused inodes probably aren't insane */\n\tif (inode->i_links_count == 0)\n\t\treturn 0;\n\n\t/* See if more than half the block maps are insane */\n\tfor (i = 0, bad = 0; i < EXT2_N_BLOCKS; i++)\n\t\tif (inode->i_block[i] != 0 &&\n\t\t    (inode->i_block[i] < fs->super->s_first_data_block ||\n\t\t     inode->i_block[i] >= ext2fs_blocks_count(fs->super)))\n\t\t\tbad++;\n\treturn bad > EXT2_N_BLOCKS / 2;\n}\n\nstatic int extent_head_looks_insane(struct ext2_inode_large *inode)\n{\n\tif (!(inode->i_flags & EXT4_EXTENTS_FL) ||\n\t    ext2fs_extent_header_verify(inode->i_block,\n\t\t\t\t\tsizeof(inode->i_block)) == 0)\n\t\treturn 0;\n\treturn 1;\n}\n\n/*\n * Check all the inodes that we just read into the buffer.  Record what we\n * find here -- currently, we can observe that all checksums are ok; more\n * than half the inodes are insane; or no conclusions at all.\n */\nstatic void check_inode_block_sanity(ext2_inode_scan scan, blk64_t num_blocks)\n{\n\text2_ino_t\tino, inodes_to_scan;\n\tunsigned int\tbadness, checksum_failures;\n\tunsigned int\tinodes_in_buf, inodes_per_block;\n\tchar\t\t*p;\n\tstruct ext2_inode_large *inode;\n\tchar\t\t*block_status;\n\tunsigned int\tblk, bad_csum;\n\n\tif (!(scan->scan_flags & EXT2_SF_WARN_GARBAGE_INODES))\n\t\treturn;\n\n\tinodes_to_scan = scan->inodes_left;\n\tinodes_in_buf = num_blocks * scan->fs->blocksize / scan->inode_size;\n\tif (inodes_to_scan > inodes_in_buf)\n\t\tinodes_to_scan = inodes_in_buf;\n\n\tp = (char *) scan->inode_buffer;\n\tino = scan->current_inode + 1;\n\tchecksum_failures = badness = 0;\n\tblock_status = SCAN_BLOCK_STATUS(scan);\n\tmemset(block_status, 0, scan->inode_buffer_blocks);\n\tinodes_per_block = EXT2_INODES_PER_BLOCK(scan->fs->super);\n\n\tif (inodes_per_block < 2)\n\t\treturn;\n\n#ifdef WORDS_BIGENDIAN\n\tif (ext2fs_get_mem(EXT2_INODE_SIZE(scan->fs->super), &inode))\n\t\treturn;\n#endif\n\n\twhile (inodes_to_scan > 0) {\n\t\tblk = (p - (char *)scan->inode_buffer) / scan->fs->blocksize;\n\t\tbad_csum = ext2fs_inode_csum_verify(scan->fs, ino,\n\t\t\t\t(struct ext2_inode_large *) p) == 0;\n\n#ifdef WORDS_BIGENDIAN\n\t\text2fs_swap_inode_full(scan->fs,\n\t\t\t       (struct ext2_inode_large *) inode,\n\t\t\t       (struct ext2_inode_large *) p,\n\t\t\t       0, EXT2_INODE_SIZE(scan->fs->super));\n#else\n\t\tinode = (struct ext2_inode_large *) p;\n#endif\n\n\t\t/* Is this inode insane? */\n\t\tif (bad_csum) {\n\t\t\tchecksum_failures++;\n\t\t\tbadness++;\n\t\t} else if (extent_head_looks_insane(inode) ||\n\t\t\t   block_map_looks_insane(scan->fs, inode))\n\t\t\tbadness++;\n\n\t\t/* If more than half are insane, declare the whole block bad */\n\t\tif (badness > inodes_per_block / 2) {\n\t\t\tunsigned int ino_adj;\n\n\t\t\tblock_status[blk] |= IBLOCK_STATUS_INSANE;\n\t\t\tino_adj = inodes_per_block -\n\t\t\t\t\t\t((ino - 1) % inodes_per_block);\n\t\t\tif (ino_adj > inodes_to_scan)\n\t\t\t\tino_adj = inodes_to_scan;\n\t\t\tinodes_to_scan -= ino_adj;\n\t\t\tp += scan->inode_size * ino_adj;\n\t\t\tino += ino_adj;\n\t\t\tchecksum_failures = badness = 0;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ((ino % inodes_per_block) == 0) {\n\t\t\tif (checksum_failures == 0)\n\t\t\t\tblock_status[blk] |= IBLOCK_STATUS_CSUMS_OK;\n\t\t\tchecksum_failures = badness = 0;\n\t\t}\n\t\tinodes_to_scan--;\n\t\tp += scan->inode_size;\n\t\tino++;\n\t};\n\n#ifdef WORDS_BIGENDIAN\n\text2fs_free_mem(&inode);\n#endif\n}\n\n/*\n * This function is called by ext2fs_get_next_inode when it needs to\n * read in more blocks from the current blockgroup's inode table.\n */\nstatic errcode_t get_next_blocks(ext2_inode_scan scan)\n{\n\tblk64_t\t\tnum_blocks;\n\terrcode_t\tretval;\n\n\t/*\n\t * Figure out how many blocks to read; we read at most\n\t * inode_buffer_blocks, and perhaps less if there aren't that\n\t * many blocks left to read.\n\t */\n\tnum_blocks = scan->inode_buffer_blocks;\n\tif (num_blocks > scan->blocks_left)\n\t\tnum_blocks = scan->blocks_left;\n\n\t/*\n\t * If the past block \"read\" was a bad block, then mark the\n\t * left-over extra bytes as also being bad.\n\t */\n\tif (scan->scan_flags & EXT2_SF_BAD_INODE_BLK) {\n\t\tif (scan->bytes_left)\n\t\t\tscan->scan_flags |= EXT2_SF_BAD_EXTRA_BYTES;\n\t\tscan->scan_flags &= ~EXT2_SF_BAD_INODE_BLK;\n\t}\n\n\t/*\n\t * Do inode bad block processing, if necessary.\n\t */\n\tif (scan->scan_flags & EXT2_SF_CHK_BADBLOCKS) {\n\t\tretval = check_for_inode_bad_blocks(scan, &num_blocks);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\n\tif ((scan->scan_flags & EXT2_SF_BAD_INODE_BLK) ||\n\t    (scan->current_block == 0)) {\n\t\tmemset(scan->inode_buffer, 0,\n\t\t       (size_t) num_blocks * scan->fs->blocksize);\n\t} else {\n\t\tretval = io_channel_read_blk64(scan->fs->io,\n\t\t\t\t\t     scan->current_block,\n\t\t\t\t\t     (int) num_blocks,\n\t\t\t\t\t     scan->inode_buffer);\n\t\tif (retval)\n\t\t\treturn EXT2_ET_NEXT_INODE_READ;\n\t}\n\tcheck_inode_block_sanity(scan, num_blocks);\n\n\tscan->ptr = scan->inode_buffer;\n\tscan->bytes_left = num_blocks * scan->fs->blocksize;\n\n\tscan->blocks_left -= num_blocks;\n\tif (scan->current_block)\n\t\tscan->current_block += num_blocks;\n\n\treturn 0;\n}\n\n#if 0\n/*\n * Returns 1 if the entire inode_buffer has a non-zero size and\n * contains all zeros.  (Not just deleted inodes, since that means\n * that part of the inode table was used at one point; we want all\n * zeros, which means that the inode table is pristine.)\n */\nstatic inline int is_empty_scan(ext2_inode_scan scan)\n{\n\tint\ti;\n\n\tif (scan->bytes_left == 0)\n\t\treturn 0;\n\n\tfor (i=0; i < scan->bytes_left; i++)\n\t\tif (scan->ptr[i])\n\t\t\treturn 0;\n\treturn 1;\n}\n#endif\n\nerrcode_t ext2fs_get_next_inode_full(ext2_inode_scan scan, ext2_ino_t *ino,\n\t\t\t\t     struct ext2_inode *inode, int bufsize)\n{\n\terrcode_t\tretval;\n\tint\t\textra_bytes = 0;\n\tint\t\tlength;\n\tstruct ext2_inode_large\t*iptr = (struct ext2_inode_large *)inode;\n\tchar\t\t*iblock_status;\n\tunsigned int\tiblk;\n\n\tEXT2_CHECK_MAGIC(scan, EXT2_ET_MAGIC_INODE_SCAN);\n\tlength = EXT2_INODE_SIZE(scan->fs->super);\n\tiblock_status = SCAN_BLOCK_STATUS(scan);\n\n\t/*\n\t * Do we need to start reading a new block group?\n\t */\n\tif (scan->inodes_left <= 0) {\n\tforce_new_group:\n\t\tif (scan->done_group) {\n\t\t\tretval = (scan->done_group)\n\t\t\t\t(scan->fs, scan, scan->current_group,\n\t\t\t\t scan->done_group_data);\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\t\t}\n\t\tif (scan->groups_left <= 0) {\n\t\t\t*ino = 0;\n\t\t\treturn 0;\n\t\t}\n\t\tretval = get_next_blockgroup(scan);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\t/*\n\t * These checks are done outside the above if statement so\n\t * they can be done for block group #0.\n\t */\n\tif ((scan->scan_flags & EXT2_SF_DO_LAZY) &&\n\t    (ext2fs_bg_flags_test(scan->fs, scan->current_group, EXT2_BG_INODE_UNINIT)\n\t     ))\n\t\tgoto force_new_group;\n\tif (scan->inodes_left == 0)\n\t\tgoto force_new_group;\n\tif (scan->current_block == 0) {\n\t\tif (scan->scan_flags & EXT2_SF_SKIP_MISSING_ITABLE) {\n\t\t\tgoto force_new_group;\n\t\t} else\n\t\t\treturn EXT2_ET_MISSING_INODE_TABLE;\n\t}\n\n\n\t/*\n\t * Have we run out of space in the inode buffer?  If so, we\n\t * need to read in more blocks.\n\t */\n\tif (scan->bytes_left < scan->inode_size) {\n\t\tif (scan->bytes_left)\n\t\t\tmemcpy(scan->temp_buffer, scan->ptr, scan->bytes_left);\n\t\textra_bytes = scan->bytes_left;\n\n\t\tretval = get_next_blocks(scan);\n\t\tif (retval)\n\t\t\treturn retval;\n#if 0\n\t\t/*\n\t\t * XXX test  Need check for used inode somehow.\n\t\t * (Note: this is hard.)\n\t\t */\n\t\tif (is_empty_scan(scan))\n\t\t\tgoto force_new_group;\n#endif\n\t}\n\n\tif (bufsize < length) {\n\t\tretval = ext2fs_get_mem(length, &iptr);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\n\tretval = 0;\n\tiblk = scan->current_inode % EXT2_INODES_PER_GROUP(scan->fs->super) /\n\t\t\t\tEXT2_INODES_PER_BLOCK(scan->fs->super) %\n\t\t\t\tscan->inode_buffer_blocks;\n\tif (extra_bytes) {\n\t\tmemcpy(scan->temp_buffer+extra_bytes, scan->ptr,\n\t\t       scan->inode_size - extra_bytes);\n\t\tscan->ptr += scan->inode_size - extra_bytes;\n\t\tscan->bytes_left -= scan->inode_size - extra_bytes;\n\n\t\t/* Verify the inode checksum. */\n\t\tif (!(iblock_status[iblk] & IBLOCK_STATUS_CSUMS_OK) &&\n\t\t    !(scan->fs->flags & EXT2_FLAG_IGNORE_CSUM_ERRORS) &&\n\t\t    !ext2fs_inode_csum_verify(scan->fs, scan->current_inode + 1,\n\t\t\t\t(struct ext2_inode_large *)scan->temp_buffer))\n\t\t\tretval = EXT2_ET_INODE_CSUM_INVALID;\n\n#ifdef WORDS_BIGENDIAN\n\t\tmemset(iptr, 0, length);\n\t\text2fs_swap_inode_full(scan->fs,\n\t\t\t       (struct ext2_inode_large *) iptr,\n\t\t\t       (struct ext2_inode_large *) scan->temp_buffer,\n\t\t\t       0, length);\n#else\n\t\tmemcpy(iptr, scan->temp_buffer, length);\n#endif\n\t\tif (scan->scan_flags & EXT2_SF_BAD_EXTRA_BYTES)\n\t\t\tretval = EXT2_ET_BAD_BLOCK_IN_INODE_TABLE;\n\t\tscan->scan_flags &= ~EXT2_SF_BAD_EXTRA_BYTES;\n\t} else {\n\t\t/* Verify the inode checksum. */\n\t\tif (!(iblock_status[iblk] & IBLOCK_STATUS_CSUMS_OK) &&\n\t\t    !(scan->fs->flags & EXT2_FLAG_IGNORE_CSUM_ERRORS) &&\n\t\t    !ext2fs_inode_csum_verify(scan->fs, scan->current_inode + 1,\n\t\t\t\t(struct ext2_inode_large *)scan->ptr))\n\t\t\tretval = EXT2_ET_INODE_CSUM_INVALID;\n\n#ifdef WORDS_BIGENDIAN\n\t\tmemset(iptr, 0, length);\n\t\text2fs_swap_inode_full(scan->fs,\n\t\t\t\t(struct ext2_inode_large *) iptr,\n\t\t\t\t(struct ext2_inode_large *) scan->ptr,\n\t\t\t\t0, length);\n#else\n\t\tmemcpy(iptr, scan->ptr, length);\n#endif\n\t\tscan->ptr += scan->inode_size;\n\t\tscan->bytes_left -= scan->inode_size;\n\t\tif (scan->scan_flags & EXT2_SF_BAD_INODE_BLK)\n\t\t\tretval = EXT2_ET_BAD_BLOCK_IN_INODE_TABLE;\n\t}\n\tif ((iblock_status[iblk] & IBLOCK_STATUS_INSANE) &&\n\t    (retval == 0 || retval == EXT2_ET_INODE_CSUM_INVALID))\n\t\tretval = EXT2_ET_INODE_IS_GARBAGE;\n\n\tscan->inodes_left--;\n\tscan->current_inode++;\n\t*ino = scan->current_inode;\n\tif (iptr != (struct ext2_inode_large *)inode) {\n\t\tmemcpy(inode, iptr, bufsize);\n\t\text2fs_free_mem(&iptr);\n\t}\n\treturn retval;\n}\n\nerrcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ext2_ino_t *ino,\n\t\t\t\tstruct ext2_inode *inode)\n{\n\treturn ext2fs_get_next_inode_full(scan, ino, inode,\n\t\t\t\t\t\tsizeof(struct ext2_inode));\n}\n\n/*\n * Functions to read and write a single inode.\n */\nerrcode_t ext2fs_read_inode2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t     struct ext2_inode * inode, int bufsize,\n\t\t\t     int flags)\n{\n\tblk64_t\t\tblock_nr;\n\tdgrp_t\t\tgroup;\n\tunsigned long \tblock, offset;\n\tchar \t\t*ptr;\n\terrcode_t\tretval;\n\tunsigned\ti;\n\tint\t\tclen, inodes_per_block;\n\tio_channel\tio;\n\tint\t\tlength = EXT2_INODE_SIZE(fs->super);\n\tstruct ext2_inode_large\t*iptr;\n\tint\t\tcache_slot, fail_csum;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\t/* Check to see if user has an override function */\n\tif (fs->read_inode &&\n\t    ((bufsize == sizeof(struct ext2_inode)) ||\n\t     (EXT2_INODE_SIZE(fs->super) == sizeof(struct ext2_inode)))) {\n\t\tretval = (fs->read_inode)(fs, ino, inode);\n\t\tif (retval != EXT2_ET_CALLBACK_NOTHANDLED)\n\t\t\treturn retval;\n\t}\n\tif ((ino == 0) || (ino > fs->super->s_inodes_count))\n\t\treturn EXT2_ET_BAD_INODE_NUM;\n\t/* Create inode cache if not present */\n\tif (!fs->icache) {\n\t\tretval = ext2fs_create_inode_cache(fs, 4);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\t/* Check to see if it's in the inode cache */\n\tfor (i = 0; i < fs->icache->cache_size; i++) {\n\t\tif (fs->icache->cache[i].ino == ino) {\n\t\t\tmemcpy(inode, fs->icache->cache[i].inode,\n\t\t\t       (bufsize > length) ? length : bufsize);\n\t\t\treturn 0;\n\t\t}\n\t}\n\tif (fs->flags & EXT2_FLAG_IMAGE_FILE) {\n\t\tinodes_per_block = fs->blocksize / EXT2_INODE_SIZE(fs->super);\n\t\tblock_nr = ext2fs_le32_to_cpu(fs->image_header->offset_inode) / fs->blocksize;\n\t\tblock_nr += (ino - 1) / inodes_per_block;\n\t\toffset = ((ino - 1) % inodes_per_block) *\n\t\t\tEXT2_INODE_SIZE(fs->super);\n\t\tio = fs->image_io;\n\t} else {\n\t\tgroup = (ino - 1) / EXT2_INODES_PER_GROUP(fs->super);\n\t\tif (group > fs->group_desc_count)\n\t\t\treturn EXT2_ET_BAD_INODE_NUM;\n\t\toffset = ((ino - 1) % EXT2_INODES_PER_GROUP(fs->super)) *\n\t\t\tEXT2_INODE_SIZE(fs->super);\n\t\tblock = offset >> EXT2_BLOCK_SIZE_BITS(fs->super);\n\t\tblock_nr = ext2fs_inode_table_loc(fs, group);\n\t\tif (!block_nr)\n\t\t\treturn EXT2_ET_MISSING_INODE_TABLE;\n\t\tif ((block_nr < fs->super->s_first_data_block) ||\n\t\t    (block_nr + fs->inode_blocks_per_group - 1 >=\n\t\t     ext2fs_blocks_count(fs->super)))\n\t\t\treturn EXT2_ET_GDESC_BAD_INODE_TABLE;\n\t\tblock_nr += block;\n\t\tio = fs->io;\n\t}\n\toffset &= (EXT2_BLOCK_SIZE(fs->super) - 1);\n\n\tcache_slot = (fs->icache->cache_last + 1) % fs->icache->cache_size;\n\tiptr = (struct ext2_inode_large *)fs->icache->cache[cache_slot].inode;\n\n\tptr = (char *) iptr;\n\twhile (length) {\n\t\tclen = length;\n\t\tif ((offset + length) > fs->blocksize)\n\t\t\tclen = fs->blocksize - offset;\n\n\t\tif (block_nr != fs->icache->buffer_blk) {\n\t\t\tretval = io_channel_read_blk64(io, block_nr, 1,\n\t\t\t\t\t\t     fs->icache->buffer);\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\t\t\tfs->icache->buffer_blk = block_nr;\n\t\t}\n\n\t\tmemcpy(ptr, ((char *) fs->icache->buffer) + (unsigned) offset,\n\t\t       clen);\n\n\t\toffset = 0;\n\t\tlength -= clen;\n\t\tptr += clen;\n\t\tblock_nr++;\n\t}\n\tlength = EXT2_INODE_SIZE(fs->super);\n\n\t/* Verify the inode checksum. */\n\tfail_csum = !ext2fs_inode_csum_verify(fs, ino, iptr);\n\n#ifdef WORDS_BIGENDIAN\n\text2fs_swap_inode_full(fs, (struct ext2_inode_large *) iptr,\n\t\t\t       (struct ext2_inode_large *) iptr,\n\t\t\t       0, length);\n#endif\n\n\t/* Update the inode cache bookkeeping */\n\tif (!fail_csum) {\n\t\tfs->icache->cache_last = cache_slot;\n\t\tfs->icache->cache[cache_slot].ino = ino;\n\t}\n\tmemcpy(inode, iptr, (bufsize > length) ? length : bufsize);\n\n\tif (!(fs->flags & EXT2_FLAG_IGNORE_CSUM_ERRORS) &&\n\t    !(flags & READ_INODE_NOCSUM) && fail_csum)\n\t\treturn EXT2_ET_INODE_CSUM_INVALID;\n\n\treturn 0;\n}\n\nerrcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t struct ext2_inode * inode, int bufsize)\n{\n\treturn ext2fs_read_inode2(fs, ino, inode, bufsize, 0);\n}\n\nerrcode_t ext2fs_read_inode(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t    struct ext2_inode * inode)\n{\n\treturn ext2fs_read_inode2(fs, ino, inode,\n\t\t\t\t  sizeof(struct ext2_inode), 0);\n}\n\nerrcode_t ext2fs_write_inode2(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t      struct ext2_inode * inode, int bufsize,\n\t\t\t      int flags)\n{\n\tblk64_t block_nr;\n\tdgrp_t group;\n\tunsigned long block, offset;\n\terrcode_t retval = 0;\n\tstruct ext2_inode_large *w_inode;\n\tchar *ptr;\n\tunsigned i;\n\tint clen;\n\tint length = EXT2_INODE_SIZE(fs->super);\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\t/* Check to see if user provided an override function */\n\tif (fs->write_inode) {\n\t\tretval = (fs->write_inode)(fs, ino, inode);\n\t\tif (retval != EXT2_ET_CALLBACK_NOTHANDLED)\n\t\t\treturn retval;\n\t}\n\n\tif ((ino == 0) || (ino > fs->super->s_inodes_count))\n\t\treturn EXT2_ET_BAD_INODE_NUM;\n\n\t/* Prepare our shadow buffer for read/modify/byteswap/write */\n\tretval = ext2fs_get_mem(length, &w_inode);\n\tif (retval)\n\t\treturn retval;\n\n\tif (bufsize < length) {\n\t\tretval = ext2fs_read_inode2(fs, ino,\n\t\t\t\t\t    (struct ext2_inode *)w_inode,\n\t\t\t\t\t    length, READ_INODE_NOCSUM);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t}\n\n\t/* Check to see if the inode cache needs to be updated */\n\tif (fs->icache) {\n\t\tfor (i=0; i < fs->icache->cache_size; i++) {\n\t\t\tif (fs->icache->cache[i].ino == ino) {\n\t\t\t\tmemcpy(fs->icache->cache[i].inode, inode,\n\t\t\t\t       (bufsize > length) ? length : bufsize);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tretval = ext2fs_create_inode_cache(fs, 4);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t}\n\tmemcpy(w_inode, inode, (bufsize > length) ? length : bufsize);\n\n\tif (!(fs->flags & EXT2_FLAG_RW)) {\n\t\tretval = EXT2_ET_RO_FILSYS;\n\t\tgoto errout;\n\t}\n\n#ifdef WORDS_BIGENDIAN\n\text2fs_swap_inode_full(fs, w_inode, w_inode, 1, length);\n#endif\n\n\tif ((flags & WRITE_INODE_NOCSUM) == 0) {\n\t\tretval = ext2fs_inode_csum_set(fs, ino, w_inode);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t}\n\n\tgroup = (ino - 1) / EXT2_INODES_PER_GROUP(fs->super);\n\toffset = ((ino - 1) % EXT2_INODES_PER_GROUP(fs->super)) *\n\t\tEXT2_INODE_SIZE(fs->super);\n\tblock = offset >> EXT2_BLOCK_SIZE_BITS(fs->super);\n\tblock_nr = ext2fs_inode_table_loc(fs, (unsigned) group);\n\tif (!block_nr) {\n\t\tretval = EXT2_ET_MISSING_INODE_TABLE;\n\t\tgoto errout;\n\t}\n\tif ((block_nr < fs->super->s_first_data_block) ||\n\t    (block_nr + fs->inode_blocks_per_group - 1 >=\n\t     ext2fs_blocks_count(fs->super))) {\n\t\tretval = EXT2_ET_GDESC_BAD_INODE_TABLE;\n\t\tgoto errout;\n\t}\n\tblock_nr += block;\n\n\toffset &= (EXT2_BLOCK_SIZE(fs->super) - 1);\n\n\tptr = (char *) w_inode;\n\n\twhile (length) {\n\t\tclen = length;\n\t\tif ((offset + length) > fs->blocksize)\n\t\t\tclen = fs->blocksize - offset;\n\n\t\tif (fs->icache->buffer_blk != block_nr) {\n\t\t\tretval = io_channel_read_blk64(fs->io, block_nr, 1,\n\t\t\t\t\t\t     fs->icache->buffer);\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\t\t\tfs->icache->buffer_blk = block_nr;\n\t\t}\n\n\n\t\tmemcpy((char *) fs->icache->buffer + (unsigned) offset,\n\t\t       ptr, clen);\n\n\t\tretval = io_channel_write_blk64(fs->io, block_nr, 1,\n\t\t\t\t\t      fs->icache->buffer);\n\t\tif (retval)\n\t\t\tgoto errout;\n\n\t\toffset = 0;\n\t\tptr += clen;\n\t\tlength -= clen;\n\t\tblock_nr++;\n\t}\n\n\tfs->flags |= EXT2_FLAG_CHANGED;\nerrout:\n\text2fs_free_mem(&w_inode);\n\treturn retval;\n}\n\nerrcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t  struct ext2_inode * inode, int bufsize)\n{\n\treturn ext2fs_write_inode2(fs, ino, inode, bufsize, 0);\n}\n\nerrcode_t ext2fs_write_inode(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t     struct ext2_inode *inode)\n{\n\treturn ext2fs_write_inode2(fs, ino, inode,\n\t\t\t\t   sizeof(struct ext2_inode), 0);\n}\n\n/*\n * This function should be called when writing a new inode.  It makes\n * sure that extra part of large inodes is initialized properly.\n */\nerrcode_t ext2fs_write_new_inode(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t struct ext2_inode *inode)\n{\n\tstruct ext2_inode\t*buf;\n\tint \t\t\tsize = EXT2_INODE_SIZE(fs->super);\n\tstruct ext2_inode_large\t*large_inode;\n\terrcode_t\t\tretval;\n\t__u32 \t\t\tt = fs->now ? fs->now : time(NULL);\n\n\tif (!inode->i_ctime)\n\t\tinode->i_ctime = t;\n\tif (!inode->i_mtime)\n\t\tinode->i_mtime = t;\n\tif (!inode->i_atime)\n\t\tinode->i_atime = t;\n\n\tif (size == sizeof(struct ext2_inode))\n\t\treturn ext2fs_write_inode_full(fs, ino, inode,\n\t\t\t\t\t       sizeof(struct ext2_inode));\n\n\tbuf = malloc(size);\n\tif (!buf)\n\t\treturn ENOMEM;\n\n\tmemset(buf, 0, size);\n\t*buf = *inode;\n\n\tlarge_inode = (struct ext2_inode_large *) buf;\n\tlarge_inode->i_extra_isize = sizeof(struct ext2_inode_large) -\n\t\tEXT2_GOOD_OLD_INODE_SIZE;\n\tif (!large_inode->i_crtime)\n\t\tlarge_inode->i_crtime = t;\n\n\tretval = ext2fs_write_inode_full(fs, ino, buf, size);\n\tfree(buf);\n\treturn retval;\n}\n\n\nerrcode_t ext2fs_get_blocks(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks)\n{\n\tstruct ext2_inode\tinode;\n\tint\t\t\ti;\n\terrcode_t\t\tretval;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif (ino > fs->super->s_inodes_count)\n\t\treturn EXT2_ET_BAD_INODE_NUM;\n\n\tif (fs->get_blocks) {\n\t\tif (!(*fs->get_blocks)(fs, ino, blocks))\n\t\t\treturn 0;\n\t}\n\tretval = ext2fs_read_inode(fs, ino, &inode);\n\tif (retval)\n\t\treturn retval;\n\tfor (i=0; i < EXT2_N_BLOCKS; i++)\n\t\tblocks[i] = inode.i_block[i];\n\treturn 0;\n}\n\nerrcode_t ext2fs_check_directory(ext2_filsys fs, ext2_ino_t ino)\n{\n\tstruct\text2_inode\tinode;\n\terrcode_t\t\tretval;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif (ino > fs->super->s_inodes_count)\n\t\treturn EXT2_ET_BAD_INODE_NUM;\n\n\tif (fs->check_directory) {\n\t\tretval = (fs->check_directory)(fs, ino);\n\t\tif (retval != EXT2_ET_CALLBACK_NOTHANDLED)\n\t\t\treturn retval;\n\t}\n\tretval = ext2fs_read_inode(fs, ino, &inode);\n\tif (retval)\n\t\treturn retval;\n\tif (!LINUX_S_ISDIR(inode.i_mode))\n\t\treturn EXT2_ET_NO_DIRECTORY;\n\treturn 0;\n}\n\n"
  },
  {
    "path": "src/ext2fs/io_manager.c",
    "content": "/*\n * io_manager.c --- the I/O manager abstraction\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\nerrcode_t io_channel_set_options(io_channel channel, const char *opts)\n{\n\terrcode_t retval = 0;\n\tchar *next, *ptr, *options, *arg;\n\n\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n\n\tif (!opts)\n\t\treturn 0;\n\n\tif (!channel->manager->set_option)\n\t\treturn EXT2_ET_INVALID_ARGUMENT;\n\n\toptions = malloc(strlen(opts)+1);\n\tif (!options)\n\t\treturn EXT2_ET_NO_MEMORY;\n\tstrcpy(options, opts);\n\tptr = options;\n\n\twhile (ptr && *ptr) {\n\t\tnext = strchr(ptr, '&');\n\t\tif (next)\n\t\t\t*next++ = 0;\n\n\t\targ = strchr(ptr, '=');\n\t\tif (arg)\n\t\t\t*arg++ = 0;\n\n\t\tretval = (channel->manager->set_option)(channel, ptr, arg);\n\t\tif (retval)\n\t\t\tbreak;\n\t\tptr = next;\n\t}\n\tfree(options);\n\treturn retval;\n}\n\nerrcode_t io_channel_write_byte(io_channel channel, unsigned long offset,\n\t\t\t\tint count, const void *data)\n{\n\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n\n\tif (channel->manager->write_byte)\n\t\treturn channel->manager->write_byte(channel, offset,\n\t\t\t\t\t\t    count, data);\n\n\treturn EXT2_ET_UNIMPLEMENTED;\n}\n\nerrcode_t io_channel_read_blk64(io_channel channel, unsigned long long block,\n\t\t\t\t int count, void *data)\n{\n\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n\n\tif (channel->manager->read_blk64)\n\t\treturn (channel->manager->read_blk64)(channel, block,\n\t\t\t\t\t\t      count, data);\n\n\tif ((block >> 32) != 0)\n\t\treturn EXT2_ET_IO_CHANNEL_NO_SUPPORT_64;\n\n\treturn (channel->manager->read_blk)(channel, (unsigned long) block,\n\t\t\t\t\t     count, data);\n}\n\nerrcode_t io_channel_write_blk64(io_channel channel, unsigned long long block,\n\t\t\t\t int count, const void *data)\n{\n\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n\n\tif (channel->manager->write_blk64)\n\t\treturn (channel->manager->write_blk64)(channel, block,\n\t\t\t\t\t\t       count, data);\n\n\tif ((block >> 32) != 0)\n\t\treturn EXT2_ET_IO_CHANNEL_NO_SUPPORT_64;\n\n\treturn (channel->manager->write_blk)(channel, (unsigned long) block,\n\t\t\t\t\t     count, data);\n}\n\nerrcode_t io_channel_discard(io_channel channel, unsigned long long block,\n\t\t\t     unsigned long long count)\n{\n\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n\n\tif (channel->manager->discard)\n\t\treturn (channel->manager->discard)(channel, block, count);\n\n\treturn EXT2_ET_UNIMPLEMENTED;\n}\n\nerrcode_t io_channel_zeroout(io_channel channel, unsigned long long block,\n\t\t\t     unsigned long long count)\n{\n\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n\n\tif (channel->manager->zeroout)\n\t\treturn (channel->manager->zeroout)(channel, block, count);\n\n\treturn EXT2_ET_UNIMPLEMENTED;\n}\n\nerrcode_t io_channel_alloc_buf(io_channel io, int count, void *ptr)\n{\n\tsize_t\tsize;\n\n\tif (count == 0)\n\t\tsize = io->block_size;\n\telse if (count > 0)\n\t\tsize = (size_t)io->block_size * count;\n\telse\n\t\tsize = -count;\n\n\tif (io->align)\n\t\treturn ext2fs_get_memalign(size, io->align, ptr);\n\telse\n\t\treturn ext2fs_get_mem(size, ptr);\n}\n\nerrcode_t io_channel_cache_readahead(io_channel io, unsigned long long block,\n\t\t\t\t     unsigned long long count)\n{\n\tif (!io->manager->cache_readahead)\n\t\treturn EXT2_ET_OP_NOT_SUPPORTED;\n\n\treturn io->manager->cache_readahead(io, block, count);\n}\n"
  },
  {
    "path": "src/ext2fs/jfs_compat.h",
    "content": "\n#ifndef _JFS_COMPAT_H\n#define _JFS_COMPAT_H\n\n#include \"kernel-list.h\"\n#include <errno.h>\n#ifdef HAVE_NETINET_IN_H\n#include <netinet/in.h>\n#endif\n#ifdef HAVE_WINSOCK_H\n// Heck if we're gonna use WinSock just for htonl and friends\n#include <stdlib.h>\n#define htonl _byteswap_ulong\n#define ntohl _byteswap_ulong\n#define htons _byteswap_ushort\n#define ntohs _byteswap_ushort\n#else\n#include <arpa/inet.h>\n#endif\n\n#define printk printf\n#define KERN_ERR \"\"\n#define KERN_DEBUG \"\"\n\n#define REQ_OP_READ 0\n#define REQ_OP_WRITE 1\n\n#define cpu_to_be32(n) htonl(n)\n#define be32_to_cpu(n) ntohl(n)\n#define cpu_to_be16(n) htons(n)\n#define be16_to_cpu(n) ntohs(n)\n\ntypedef unsigned int tid_t;\ntypedef struct journal_s journal_t;\ntypedef struct kdev_s *kdev_t;\n\nstruct buffer_head;\nstruct inode;\n\ntypedef unsigned int gfp_t;\n#define GFP_KERNEL\t0\n#define GFP_NOFS\t0\n#define __GFP_NOFAIL\t0\n#define JBD2_TAG_SIZE32\tJBD_TAG_SIZE32\n#define JBD2_BARRIER\t0\ntypedef __u64 u64;\n#define put_bh(x)\tbrelse(x)\n\nstatic inline __u32 jbd2_chksum(journal_t *j EXT2FS_ATTR((unused)),\n\t\t\t\t__u32 crc, const void *address,\n\t\t\t\tunsigned int length)\n{\n\treturn ext2fs_crc32c_le(crc, address, length);\n}\n#define crc32_be(x, y, z)\text2fs_crc32_be((x), (y), (z))\n#define spin_lock_init(x)\n#define spin_lock(x)\n#define spin_unlock(x)\n#define SLAB_HWCACHE_ALIGN\t0\n#define SLAB_TEMPORARY\t\t0\n#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\\\n                sizeof(struct __struct), __alignof__(struct __struct),\\\n                (__flags), NULL)\n\n#define blkdev_issue_flush(kdev, a, b)\tsync_blockdev(kdev)\n#define is_power_of_2(x)\t((x) != 0 && (((x) & ((x) - 1)) == 0))\n#define pr_emerg(fmt)\n\nstruct journal_s\n{\n\tunsigned long\t\tj_flags;\n\tint\t\t\tj_errno;\n\tstruct buffer_head *\tj_sb_buffer;\n\tstruct journal_superblock_s *j_superblock;\n\tint\t\t\tj_format_version;\n\tunsigned long\t\tj_head;\n\tunsigned long\t\tj_tail;\n\tunsigned long\t\tj_free;\n\tunsigned long\t\tj_first, j_last;\n\tkdev_t\t\t\tj_dev;\n\tkdev_t\t\t\tj_fs_dev;\n\tint\t\t\tj_blocksize;\n\tunsigned int\t\tj_blk_offset;\n\tunsigned int\t\tj_maxlen;\n\tstruct inode *\t\tj_inode;\n\ttid_t\t\t\tj_tail_sequence;\n\ttid_t\t\t\tj_transaction_sequence;\n\t__u8\t\t\tj_uuid[16];\n\tstruct jbd2_revoke_table_s *j_revoke;\n\tstruct jbd2_revoke_table_s *j_revoke_table[2];\n\ttid_t\t\t\tj_failed_commit;\n\t__u32\t\t\tj_csum_seed;\n};\n\n#define is_journal_abort(x) 0\n\n#define BUFFER_TRACE(bh, info)\tdo {} while (0)\n\n/* Need this so we can compile with configure --enable-gcc-wall */\n#ifdef NO_INLINE_FUNCS\n#define inline\n#endif\n\n#endif /* _JFS_COMPAT_H */\n"
  },
  {
    "path": "src/ext2fs/kernel-jbd.h",
    "content": "/*\n * linux/include/linux/jbd.h\n *\n * Written by Stephen C. Tweedie <sct@redhat.com>\n *\n * Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved\n *\n * This file is part of the Linux kernel and is made available under\n * the terms of the GNU General Public License, version 2, or at your\n * option, any later version, incorporated herein by reference.\n *\n * Definitions for transaction data structures for the buffer cache\n * filesystem journaling support.\n */\n\n#ifndef _LINUX_JBD_H\n#define _LINUX_JBD_H\n\n#include \"jfs_compat.h\"\n#define JFS_DEBUG\n#define jfs_debug jbd_debug\n\n#if !defined(__GNUC__) && !defined(_MSC_VER)\n#define __FUNCTION__ \"\"\n#endif\n\n#define journal_oom_retry 0\n\n#ifdef __STDC__\n#ifdef CONFIG_JBD_DEBUG\n/*\n * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal\n * consistency checks.  By default we don't do this unless\n * CONFIG_JBD_DEBUG is on.\n */\n#define JBD_EXPENSIVE_CHECKING\nextern int journal_enable_debug;\n\n#define jbd_debug(n, f, a...)\t\t\t\t\t\t\\\n\tdo {\t\t\t\t\t\t\t\t\\\n\t\tif ((n) <= journal_enable_debug) {\t\t\t\\\n\t\t\tprintk (KERN_DEBUG \"(%s, %d): %s: \",\t\t\\\n\t\t\t\t__FILE__, __LINE__, __FUNCTION__);\t\\\n\t\t  \tprintk (f, ## a);\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t} while (0)\n#else\n#ifdef __GNUC__\n#if defined(__KERNEL__) || !defined(CONFIG_JBD_DEBUG)\n#define jbd_debug(f, a...)\t/**/\n#else\nextern int journal_enable_debug;\n#define jbd_debug(n, f, a...)\t\t\t\t\t\t\\\n\tdo {\t\t\t\t\t\t\t\t\\\n\t\tif ((n) <= journal_enable_debug) {\t\t\t\\\n\t\t\tprintf(\"(%s, %d): %s: \",\t\t\t\\\n\t\t\t\t__FILE__, __LINE__, __func__);\t\t\\\n\t\t\tprintf(f, ## a);\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t} while (0)\n#endif /*__KERNEL__ */\n#else\n#define jbd_debug(f, ...)\t/**/\n#endif\n#endif\n#else\n#define jbd_debug(x)\t\t/* AIX doesn't do STDC */\n#endif\n\nextern void * __jbd_kmalloc (char *where, size_t size, int flags, int retry);\n#define jbd_kmalloc(size, flags) \\\n\t__jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry)\n#define jbd_rep_kmalloc(size, flags) \\\n\t__jbd_kmalloc(__FUNCTION__, (size), (flags), 1)\n\n#define JBD2_MIN_JOURNAL_BLOCKS 1024\n\n/*\n * Internal structures used by the logging mechanism:\n */\n\n#define JBD2_MAGIC_NUMBER 0xc03b3998U /* The first 4 bytes of /dev/random! */\n\n/*\n * On-disk structures\n */\n\n/*\n * Descriptor block types:\n */\n\n#define JBD2_DESCRIPTOR_BLOCK\t1\n#define JBD2_COMMIT_BLOCK\t2\n#define JBD2_SUPERBLOCK_V1\t3\n#define JBD2_SUPERBLOCK_V2\t4\n#define JBD2_REVOKE_BLOCK\t5\n\n/*\n * Standard header for all descriptor blocks:\n */\ntypedef struct journal_header_s\n{\n\t__be32\t\th_magic;\n\t__be32\t\th_blocktype;\n\t__be32\t\th_sequence;\n} journal_header_t;\n\n/*\n * Checksum types.\n */\n#define JBD2_CRC32_CHKSUM   1\n#define JBD2_MD5_CHKSUM     2\n#define JBD2_SHA1_CHKSUM    3\n#define JBD2_CRC32C_CHKSUM  4\n\n#define JBD2_CRC32_CHKSUM_SIZE 4\n\n#define JBD2_CHECKSUM_BYTES (32 / sizeof(__u32))\n/*\n * Commit block header for storing transactional checksums:\n *\n * NOTE: If FEATURE_COMPAT_CHECKSUM (checksum v1) is set, the h_chksum*\n * fields are used to store a checksum of the descriptor and data blocks.\n *\n * If FEATURE_INCOMPAT_CSUM_V2 (checksum v2) is set, then the h_chksum\n * field is used to store crc32c(uuid+commit_block).  Each journal metadata\n * block gets its own checksum, and data block checksums are stored in\n * journal_block_tag (in the descriptor).  The other h_chksum* fields are\n * not used.\n *\n * If FEATURE_INCOMPAT_CSUM_V3 is set, the descriptor block uses\n * journal_block_tag3_t to store a full 32-bit checksum.  Everything else\n * is the same as v2.\n *\n * Checksum v1, v2, and v3 are mutually exclusive features.\n */\nstruct commit_header {\n\t__be32\t\th_magic;\n\t__be32\t\th_blocktype;\n\t__be32\t\th_sequence;\n\tunsigned char\th_chksum_type;\n\tunsigned char\th_chksum_size;\n\tunsigned char\th_padding[2];\n\t__be32\t\th_chksum[JBD2_CHECKSUM_BYTES];\n\t__be64\t\th_commit_sec;\n\t__be32\t\th_commit_nsec;\n};\n\n/*\n * The block tag: used to describe a single buffer in the journal\n */\ntypedef struct journal_block_tag3_s\n{\n\t__be32\t\tt_blocknr;\t/* The on-disk block number */\n\t__be32\t\tt_flags;\t/* See below */\n\t__be32\t\tt_blocknr_high; /* most-significant high 32bits. */\n\t__be32\t\tt_checksum;\t/* crc32c(uuid+seq+block) */\n} journal_block_tag3_t;\n\ntypedef struct journal_block_tag_s\n{\n\t__be32\t\tt_blocknr;\t/* The on-disk block number */\n\t__be16\t\tt_checksum;\t/* truncated crc32c(uuid+seq+block) */\n\t__be16\t\tt_flags;\t/* See below */\n\t__be32\t\tt_blocknr_high; /* most-significant high 32bits. */\n} journal_block_tag_t;\n\n/* Tail of descriptor or revoke block, for checksumming */\nstruct jbd2_journal_block_tail {\n\t__be32\t\tt_checksum;\n};\n\n/*\n * The revoke descriptor: used on disk to describe a series of blocks to\n * be revoked from the log\n */\ntypedef struct journal_revoke_header_s\n{\n\tjournal_header_t r_header;\n\t__be32\t\t r_count;\t/* Count of bytes used in the block */\n} jbd2_journal_revoke_header_t;\n\n/* Definitions for the journal tag flags word: */\n#define JBD2_FLAG_ESCAPE\t\t1\t/* on-disk block is escaped */\n#define JBD2_FLAG_SAME_UUID\t2\t/* block has same uuid as previous */\n#define JBD2_FLAG_DELETED\t4\t/* block deleted by this transaction */\n#define JBD2_FLAG_LAST_TAG\t8\t/* last tag in this descriptor block */\n\n\n#define UUID_SIZE 16\n#define JBD2_USERS_MAX 48\n#define JBD2_USERS_SIZE (UUID_SIZE * JBD2_USERS_MAX)\n/*\n * The journal superblock.  All fields are in big-endian byte order.\n */\ntypedef struct journal_superblock_s\n{\n/* 0x0000 */\n\tjournal_header_t s_header;\n\n/* 0x000C */\n\t/* Static information describing the journal */\n\t__be32\ts_blocksize;\t\t/* journal device blocksize */\n\t__be32\ts_maxlen;\t\t/* total blocks in journal file */\n\t__be32\ts_first;\t\t/* first block of log information */\n\n/* 0x0018 */\n\t/* Dynamic information describing the current state of the log */\n\t__be32\ts_sequence;\t\t/* first commit ID expected in log */\n\t__be32\ts_start;\t\t/* blocknr of start of log */\n\n/* 0x0020 */\n\t/* Error value, as set by journal_abort(). */\n\t__s32\ts_errno;\n\n/* 0x0024 */\n\t/* Remaining fields are only valid in a version-2 superblock */\n\t__be32\ts_feature_compat; \t/* compatible feature set */\n\t__be32\ts_feature_incompat; \t/* incompatible feature set */\n\t__be32\ts_feature_ro_compat; \t/* readonly-compatible feature set */\n/* 0x0030 */\n\t__u8\ts_uuid[16];\t\t/* 128-bit uuid for journal */\n\n/* 0x0040 */\n\t__be32\ts_nr_users;\t\t/* Nr of filesystems sharing log */\n\n\t__be32\ts_dynsuper;\t\t/* Blocknr of dynamic superblock copy*/\n\n/* 0x0048 */\n\t__be32\ts_max_transaction;\t/* Limit of journal blocks per trans.*/\n\t__be32\ts_max_trans_data;\t/* Limit of data blocks per trans. */\n\n/* 0x0050 */\n\t__u8\ts_checksum_type;\t/* checksum type */\n\t__u8\ts_padding2[3];\n\t__be32\ts_padding[42];\n\t__be32\ts_checksum;\t\t/* crc32c(superblock) */\n\n/* 0x0100 */\n\t__u8\ts_users[JBD2_USERS_SIZE];\t\t/* ids of all fs'es sharing the log */\n\n/* 0x0400 */\n} journal_superblock_t;\n\n#define JBD2_HAS_COMPAT_FEATURE(j,mask)\t\t\t\t\t\\\n\t((j)->j_format_version >= 2 &&\t\t\t\t\t\\\n\t ((j)->j_superblock->s_feature_compat & ext2fs_cpu_to_be32((mask))))\n#define JBD2_HAS_RO_COMPAT_FEATURE(j,mask)\t\t\t\t\\\n\t((j)->j_format_version >= 2 &&\t\t\t\t\t\\\n\t ((j)->j_superblock->s_feature_ro_compat & ext2fs_cpu_to_be32((mask))))\n#define JBD2_HAS_INCOMPAT_FEATURE(j,mask)\t\t\t\t\\\n\t((j)->j_format_version >= 2 &&\t\t\t\t\t\\\n\t ((j)->j_superblock->s_feature_incompat & ext2fs_cpu_to_be32((mask))))\n\n#define JBD2_FEATURE_COMPAT_CHECKSUM\t\t0x00000001\n\n#define JBD2_FEATURE_INCOMPAT_REVOKE\t\t0x00000001\n#define JBD2_FEATURE_INCOMPAT_64BIT\t\t0x00000002\n#define JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT\t0x00000004\n#define JBD2_FEATURE_INCOMPAT_CSUM_V2\t\t0x00000008\n#define JBD2_FEATURE_INCOMPAT_CSUM_V3\t\t0x00000010\n\n/* Features known to this kernel version: */\n#define JBD2_KNOWN_COMPAT_FEATURES\t0\n#define JBD2_KNOWN_ROCOMPAT_FEATURES\t0\n#define JBD2_KNOWN_INCOMPAT_FEATURES\t(JBD2_FEATURE_INCOMPAT_REVOKE|\\\n\t\t\t\t\t JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT| \\\n\t\t\t\t\t JBD2_FEATURE_INCOMPAT_64BIT|\\\n\t\t\t\t\t JBD2_FEATURE_INCOMPAT_CSUM_V2|\t\\\n\t\t\t\t\t JBD2_FEATURE_INCOMPAT_CSUM_V3)\n\n#ifdef NO_INLINE_FUNCS\nextern size_t journal_tag_bytes(journal_t *journal);\nextern int jbd2_journal_has_csum_v2or3(journal_t *journal);\nextern int tid_gt(tid_t x, tid_t y) EXT2FS_ATTR((unused));\nextern int tid_geq(tid_t x, tid_t y) EXT2FS_ATTR((unused));\n#endif\n\n#if (defined(E2FSCK_INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))\n#ifdef E2FSCK_INCLUDE_INLINE_FUNCS\n#if (__STDC_VERSION__ >= 199901L)\n#define _INLINE_ extern inline\n#else\n#define _INLINE_ inline\n#endif\n#else /* !E2FSCK_INCLUDE_INLINE FUNCS */\n#if (__STDC_VERSION__ >= 199901L)\n#define _INLINE_ inline\n#else /* not C99 */\n#ifdef __GNUC__\n#define _INLINE_ extern __inline__\n#else\t\t\t\t/* For Watcom C */\n#define _INLINE_ extern inline\n#endif /* __GNUC__ */\n#endif /* __STDC_VERSION__ >= 199901L */\n#endif /* INCLUDE_INLINE_FUNCS */\n\n/* journal feature predicate functions */\n#define JBD2_FEATURE_COMPAT_FUNCS(name, flagname) \\\n_INLINE_ int jbd2_has_feature_##name(journal_t *j); \\\n_INLINE_ int jbd2_has_feature_##name(journal_t *j) \\\n{ \\\n\treturn ((j)->j_format_version >= 2 && \\\n\t\t((j)->j_superblock->s_feature_compat & \\\n\t\t ext2fs_cpu_to_be32(JBD2_FEATURE_COMPAT_##flagname)) != 0); \\\n} \\\n_INLINE_ void jbd2_set_feature_##name(journal_t *j); \\\n_INLINE_ void jbd2_set_feature_##name(journal_t *j) \\\n{ \\\n\t(j)->j_superblock->s_feature_compat |= \\\n\t\text2fs_cpu_to_be32(JBD2_FEATURE_COMPAT_##flagname); \\\n} \\\n_INLINE_ void jbd2_clear_feature_##name(journal_t *j); \\\n_INLINE_ void jbd2_clear_feature_##name(journal_t *j) \\\n{ \\\n\t(j)->j_superblock->s_feature_compat &= \\\n\t\t~ext2fs_cpu_to_be32(JBD2_FEATURE_COMPAT_##flagname); \\\n}\n\n#define JBD2_FEATURE_RO_COMPAT_FUNCS(name, flagname) \\\n_INLINE_ int jbd2_has_feature_##name(journal_t *j);\t\\\n_INLINE_ int jbd2_has_feature_##name(journal_t *j) \\\n{ \\\n\treturn ((j)->j_format_version >= 2 && \\\n\t\t((j)->j_superblock->s_feature_ro_compat & \\\n\t\t ext2fs_cpu_to_be32(JBD2_FEATURE_RO_COMPAT_##flagname)) != 0); \\\n} \\\n_INLINE_ void jbd2_set_feature_##name(journal_t *j); \\\n_INLINE_ void jbd2_set_feature_##name(journal_t *j) \\\n{ \\\n\t(j)->j_superblock->s_feature_ro_compat |= \\\n\t\text2fs_cpu_to_be32(JBD2_FEATURE_RO_COMPAT_##flagname); \\\n} \\\n_INLINE_ void jbd2_clear_feature_##name(journal_t *j); \\\n_INLINE_ void jbd2_clear_feature_##name(journal_t *j) \\\n{ \\\n\t(j)->j_superblock->s_feature_ro_compat &= \\\n\t\t~ext2fs_cpu_to_be32(JBD2_FEATURE_RO_COMPAT_##flagname); \\\n}\n\n#define JBD2_FEATURE_INCOMPAT_FUNCS(name, flagname) \\\n_INLINE_ int jbd2_has_feature_##name(journal_t *j); \\\n_INLINE_ int jbd2_has_feature_##name(journal_t *j) \\\n{ \\\n\treturn ((j)->j_format_version >= 2 && \\\n\t\t((j)->j_superblock->s_feature_incompat & \\\n\t\t ext2fs_cpu_to_be32(JBD2_FEATURE_INCOMPAT_##flagname)) != 0); \\\n} \\\n_INLINE_ void jbd2_set_feature_##name(journal_t *j); \\\n_INLINE_ void jbd2_set_feature_##name(journal_t *j) \\\n{ \\\n\t(j)->j_superblock->s_feature_incompat |= \\\n\t\text2fs_cpu_to_be32(JBD2_FEATURE_INCOMPAT_##flagname); \\\n} \\\n_INLINE_ void jbd2_clear_feature_##name(journal_t *j); \\\n_INLINE_ void jbd2_clear_feature_##name(journal_t *j) \\\n{ \\\n\t(j)->j_superblock->s_feature_incompat &= \\\n\t\t~ext2fs_cpu_to_be32(JBD2_FEATURE_INCOMPAT_##flagname); \\\n}\n\n#else\n#define JBD2_FEATURE_COMPAT_FUNCS(name, flagname) \\\nextern int jbd2_has_feature_##name(journal_t *j); \\\nextern void jbd2_set_feature_##name(journal_t *j); \\\nextern void jbd2_clear_feature_##name(journal_t *j);\n\n#define JBD2_FEATURE_RO_COMPAT_FUNCS(name, flagname) \\\nextern int jbd2_has_feature_##name(journal_t *j); \\\nextern void jbd2_set_feature_##name(journal_t *j); \\\nextern void jbd2_clear_feature_##name(journal_t *j);\n\n#define JBD2_FEATURE_INCOMPAT_FUNCS(name, flagname) \\\nextern int jbd2_has_feature_##name(journal_t *j); \\\nextern void jbd2_set_feature_##name(journal_t *j); \\\nextern void jbd2_clear_feature_##name(journal_t *j);\n\n#endif /* (defined(E2FSCK_INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS)) */\n\nJBD2_FEATURE_COMPAT_FUNCS(checksum,\t\tCHECKSUM)\n\nJBD2_FEATURE_INCOMPAT_FUNCS(revoke,\t\tREVOKE)\nJBD2_FEATURE_INCOMPAT_FUNCS(64bit,\t\t64BIT)\nJBD2_FEATURE_INCOMPAT_FUNCS(async_commit,\tASYNC_COMMIT)\nJBD2_FEATURE_INCOMPAT_FUNCS(csum2,\t\tCSUM_V2)\nJBD2_FEATURE_INCOMPAT_FUNCS(csum3,\t\tCSUM_V3)\n\n#if (defined(E2FSCK_INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))\n/*\n * helper functions to deal with 32 or 64bit block numbers.\n */\n_INLINE_ size_t journal_tag_bytes(journal_t *journal)\n{\n\tsize_t sz;\n\n\tif (jbd2_has_feature_csum3(journal))\n\t\treturn sizeof(journal_block_tag3_t);\n\n\tsz = sizeof(journal_block_tag_t);\n\n\tif (jbd2_has_feature_csum2(journal))\n\t\tsz += sizeof(__u16);\n\n\tif (jbd2_has_feature_64bit(journal))\n\t\treturn sz;\n\n\treturn sz - sizeof(__u32);\n}\n\n_INLINE_ int jbd2_journal_has_csum_v2or3(journal_t *journal)\n{\n\tif (jbd2_has_feature_csum2(journal) || jbd2_has_feature_csum3(journal))\n\t\treturn 1;\n\n\treturn 0;\n}\n\n/* Comparison functions for transaction IDs: perform comparisons using\n * modulo arithmetic so that they work over sequence number wraps. */\n\n_INLINE_ int tid_gt(tid_t x, tid_t y)\n{\n\tint difference = (x - y);\n\treturn (difference > 0);\n}\n\n_INLINE_ int tid_geq(tid_t x, tid_t y)\n{\n\tint difference = (x - y);\n\treturn (difference >= 0);\n}\n#endif /* (defined(E2FSCK_INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS)) */\n\n#undef _INLINE_\n\nextern int journal_blocks_per_page(struct inode *inode);\n\n/*\n * Definitions which augment the buffer_head layer\n */\n\n/* journaling buffer types */\n#define BJ_None\t\t0\t/* Not journaled */\n#define BJ_SyncData\t1\t/* Normal data: flush before commit */\n#define BJ_AsyncData\t2\t/* writepage data: wait on it before commit */\n#define BJ_Metadata\t3\t/* Normal journaled metadata */\n#define BJ_Forget\t4\t/* Buffer superceded by this transaction */\n#define BJ_IO\t\t5\t/* Buffer is for temporary IO use */\n#define BJ_Shadow\t6\t/* Buffer contents being shadowed to the log */\n#define BJ_LogCtl\t7\t/* Buffer contains log descriptors */\n#define BJ_Reserved\t8\t/* Buffer is reserved for access by journal */\n#define BJ_Types\t9\n\nextern int jbd_blocks_per_page(struct inode *inode);\n\n#endif\t/* _LINUX_JBD_H */\n"
  },
  {
    "path": "src/ext2fs/kernel-list.h",
    "content": "#ifndef _LINUX_LIST_H\n#define _LINUX_LIST_H\n\n/*\n * Simple doubly linked list implementation.\n *\n * Some of the internal functions (\"__xxx\") are useful when\n * manipulating whole lists rather than single entries, as\n * sometimes we already know the next/prev entries and we can\n * generate better code by using them directly rather than\n * using the generic single-entry routines.\n */\n\nstruct list_head {\n\tstruct list_head *next, *prev;\n};\n\n#define LIST_HEAD_INIT(name) { &(name), &(name) }\n\n#define INIT_LIST_HEAD(ptr) do { \\\n\t(ptr)->next = (ptr); (ptr)->prev = (ptr); \\\n} while (0)\n\n#if (!defined(__GNUC__) && !defined(__WATCOMC__))\n#define __inline__\n#endif\n\n/*\n * Insert a new entry between two known consecutive entries.\n *\n * This is only for internal list manipulation where we know\n * the prev/next entries already!\n */\nstatic __inline__ void __list_add(struct list_head * new,\n\tstruct list_head * prev,\n\tstruct list_head * next)\n{\n\tnext->prev = new;\n\tnew->next = next;\n\tnew->prev = prev;\n\tprev->next = new;\n}\n\n/*\n * Insert a new entry after the specified head..\n */\nstatic __inline__ void list_add(struct list_head *new, struct list_head *head)\n{\n\t__list_add(new, head, head->next);\n}\n\n/*\n * Insert a new entry at the tail\n */\nstatic __inline__ void list_add_tail(struct list_head *new, struct list_head *head)\n{\n\t__list_add(new, head->prev, head);\n}\n\n/*\n * Delete a list entry by making the prev/next entries\n * point to each other.\n *\n * This is only for internal list manipulation where we know\n * the prev/next entries already!\n */\nstatic __inline__ void __list_del(struct list_head * prev,\n\t\t\t\t  struct list_head * next)\n{\n\tnext->prev = prev;\n\tprev->next = next;\n}\n\nstatic __inline__ void list_del(struct list_head *entry)\n{\n\t__list_del(entry->prev, entry->next);\n}\n\nstatic __inline__ int list_empty(struct list_head *head)\n{\n\treturn head->next == head;\n}\n\n/*\n * Splice in \"list\" into \"head\"\n */\nstatic __inline__ void list_splice(struct list_head *list, struct list_head *head)\n{\n\tstruct list_head *first = list->next;\n\n\tif (first != list) {\n\t\tstruct list_head *last = list->prev;\n\t\tstruct list_head *at = head->next;\n\n\t\tfirst->prev = head;\n\t\thead->next = first;\n\n\t\tlast->next = at;\n\t\tat->prev = last;\n\t}\n}\n\n#define list_entry(ptr, type, member) \\\n\t((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))\n\n#define list_for_each(pos, head) \\\n        for (pos = (head)->next; pos != (head); pos = pos->next)\n\n#endif\n"
  },
  {
    "path": "src/ext2fs/link.c",
    "content": "/*\n * link.c --- create links in a ext2fs directory\n *\n * Copyright (C) 1993, 1994 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n#include \"ext2fsP.h\"\n\n#define EXT2_DX_ROOT_OFF 24\n\nstruct dx_frame {\n\t__u8 *buf;\n\tblk64_t pblock;\n\tstruct ext2_dx_countlimit *head;\n\tstruct ext2_dx_entry *entries;\n\tstruct ext2_dx_entry *at;\n};\n\nstruct dx_lookup_info {\n\tconst char *name;\n\tint namelen;\n\tint hash_alg;\n\t__u32 hash;\n\tint levels;\n\tstruct dx_frame frames[EXT4_HTREE_LEVEL];\n};\n\nstatic errcode_t alloc_dx_frame(ext2_filsys fs, struct dx_frame *frame)\n{\n\treturn ext2fs_get_mem(fs->blocksize, &frame->buf);\n}\n\nstatic void dx_release(struct dx_lookup_info *info)\n{\n//\tstruct ext2_dx_root_info *root;\n\tint level;\n\n\tfor (level = 0; level < info->levels; level++) {\n\t\tif (info->frames[level].buf == NULL)\n\t\t\tbreak;\n\t\text2fs_free_mem(&(info->frames[level].buf));\n\t}\n\tinfo->levels = 0;\n}\n\nstatic void dx_search_entry(struct dx_frame *frame, int count, __u32 hash)\n{\n\tstruct ext2_dx_entry *p, *q, *m;\n\n\tp = frame->entries + 1;\n\tq = frame->entries + count - 1;\n\twhile (p <= q) {\n\t\tm = p + (q - p) / 2;\n\t\tif (ext2fs_le32_to_cpu(m->hash) > hash)\n\t\t\tq = m - 1;\n\t\telse\n\t\t\tp = m + 1;\n\t}\n\tframe->at = p - 1;\n}\n\nstatic errcode_t load_logical_dir_block(ext2_filsys fs, ext2_ino_t dir,\n\t\t\t\t\tstruct ext2_inode *diri, blk64_t block,\n\t\t\t\t\tblk64_t *pblk, void *buf)\n{\n\terrcode_t errcode;\n\tint ret_flags;\n\n\terrcode = ext2fs_bmap2(fs, dir, diri, NULL, 0, block, &ret_flags,\n\t\t\t       pblk);\n\tif (errcode)\n\t\treturn errcode;\n\tif (ret_flags & BMAP_RET_UNINIT)\n\t\treturn EXT2_ET_DIR_CORRUPTED;\n\treturn ext2fs_read_dir_block4(fs, *pblk, buf, 0, dir);\n}\n\nstatic errcode_t dx_lookup(ext2_filsys fs, ext2_ino_t dir,\n\t\t\t   struct ext2_inode *diri, struct dx_lookup_info *info)\n{\n\tstruct ext2_dx_root_info *root;\n\terrcode_t errcode;\n\tint level = 0;\n\tint count, limit;\n\tint hash_alg;\n\tint hash_flags = diri->i_flags & EXT4_CASEFOLD_FL;\n\t__u32 minor_hash;\n\tstruct dx_frame *frame;\n\n\terrcode = alloc_dx_frame(fs, &(info->frames[0]));\n\tif (errcode)\n\t\treturn errcode;\n\tinfo->levels = 1;\n\n\terrcode = load_logical_dir_block(fs, dir, diri, 0,\n\t\t\t\t\t &(info->frames[0].pblock),\n\t\t\t\t\t info->frames[0].buf);\n\tif (errcode)\n\t\tgoto out_err;\n\troot = (struct ext2_dx_root_info*)(info->frames[0].buf + EXT2_DX_ROOT_OFF);\n\thash_alg = root->hash_version;\n\tif (hash_alg != EXT2_HASH_TEA && hash_alg != EXT2_HASH_HALF_MD4 &&\n\t    hash_alg != EXT2_HASH_LEGACY) {\n\t\terrcode = EXT2_ET_DIRHASH_UNSUPP;\n\t\tgoto out_err;\n\t}\n\tif (hash_alg <= EXT2_HASH_TEA &&\n\t    fs->super->s_flags & EXT2_FLAGS_UNSIGNED_HASH)\n\t\thash_alg += 3;\n\tif (root->indirect_levels >= ext2_dir_htree_level(fs)) {\n\t\terrcode = EXT2_ET_DIR_CORRUPTED;\n\t\tgoto out_err;\n\t}\n\tinfo->hash_alg = hash_alg;\n\n\terrcode = ext2fs_dirhash2(hash_alg, info->name, info->namelen,\n\t\t\t\t  fs->encoding, hash_flags,\n\t\t\t\t  fs->super->s_hash_seed, &info->hash,\n\t\t\t\t  &minor_hash);\n\tif (errcode)\n\t\tgoto out_err;\n\n\tfor (level = 0; level <= root->indirect_levels; level++) {\n\t\tframe = &(info->frames[level]);\n\t\tif (level > 0) {\n\t\t\terrcode = alloc_dx_frame(fs, frame);\n\t\t\tif (errcode)\n\t\t\t\tgoto out_err;\n\t\t\tinfo->levels++;\n\n\t\t\terrcode = load_logical_dir_block(fs, dir, diri,\n\t\t\t\text2fs_le32_to_cpu(info->frames[level-1].at->block) & 0x0fffffff,\n\t\t\t\t&(frame->pblock), frame->buf);\n\t\t\tif (errcode)\n\t\t\t\tgoto out_err;\n\t\t}\n\t\terrcode = ext2fs_get_dx_countlimit(fs, (struct ext2_dir_entry*)frame->buf,\n\t\t\t\t\t\t   &(frame->head), NULL);\n\t\tif (errcode)\n\t\t\tgoto out_err;\n\t\tcount = ext2fs_le16_to_cpu(frame->head->count);\n\t\tlimit = ext2fs_le16_to_cpu(frame->head->limit);\n\t\tframe->entries = (struct ext2_dx_entry *)(frame->head);\n\t\tif (!count || count > limit) {\n\t\t\terrcode = EXT2_ET_DIR_CORRUPTED;\n\t\t\tgoto out_err;\n\t\t}\n\n\t\tdx_search_entry(frame, count, info->hash);\n\t}\n\treturn 0;\nout_err:\n\tdx_release(info);\n\treturn errcode;\n}\n\nstruct link_struct  {\n\text2_filsys\tfs;\n\tconst char\t*name;\n\tint\t\tnamelen;\n\text2_ino_t\tinode;\n\tint\t\tflags;\n\tint\t\tdone;\n\tunsigned int\tblocksize;\n\terrcode_t\terr;\n\tstruct ext2_super_block *sb;\n};\n\nstatic int link_proc(ext2_ino_t dir EXT2FS_ATTR((unused)),\n\t\t     int entru EXT2FS_ATTR((unused)),\n\t\t     struct ext2_dir_entry *dirent,\n\t\t     int\toffset,\n\t\t     int\tblocksize,\n\t\t     char\t*buf,\n\t\t     void\t*priv_data)\n{\n\tstruct link_struct *ls = (struct link_struct *) priv_data;\n\tstruct ext2_dir_entry *next;\n\tunsigned int rec_len, min_rec_len, curr_rec_len;\n\tint ret = 0;\n\tint csum_size = 0;\n\n\tif (ls->done)\n\t\treturn DIRENT_ABORT;\n\n\trec_len = EXT2_DIR_REC_LEN(ls->namelen);\n\n\tls->err = ext2fs_get_rec_len(ls->fs, dirent, &curr_rec_len);\n\tif (ls->err)\n\t\treturn DIRENT_ABORT;\n\n\tif (ext2fs_has_feature_metadata_csum(ls->fs->super))\n\t\tcsum_size = sizeof(struct ext2_dir_entry_tail);\n\t/*\n\t * See if the following directory entry (if any) is unused;\n\t * if so, absorb it into this one.\n\t */\n\tnext = (struct ext2_dir_entry *) (buf + offset + curr_rec_len);\n\tif ((offset + (int) curr_rec_len < blocksize - (8 + csum_size)) &&\n\t    (next->inode == 0) &&\n\t    (offset + (int) curr_rec_len + (int) next->rec_len <= blocksize)) {\n\t\tcurr_rec_len += next->rec_len;\n\t\tls->err = ext2fs_set_rec_len(ls->fs, curr_rec_len, dirent);\n\t\tif (ls->err)\n\t\t\treturn DIRENT_ABORT;\n\t\tret = DIRENT_CHANGED;\n\t}\n\n\t/*\n\t * If the directory entry is used, see if we can split the\n\t * directory entry to make room for the new name.  If so,\n\t * truncate it and return.\n\t */\n\tif (dirent->inode) {\n\t\tmin_rec_len = EXT2_DIR_REC_LEN(ext2fs_dirent_name_len(dirent));\n\t\tif (curr_rec_len < (min_rec_len + rec_len))\n\t\t\treturn ret;\n\t\trec_len = curr_rec_len - min_rec_len;\n\t\tls->err = ext2fs_set_rec_len(ls->fs, min_rec_len, dirent);\n\t\tif (ls->err)\n\t\t\treturn DIRENT_ABORT;\n\t\tnext = (struct ext2_dir_entry *) (buf + offset +\n\t\t\t\t\t\t  dirent->rec_len);\n\t\tnext->inode = 0;\n\t\text2fs_dirent_set_name_len(next, 0);\n\t\text2fs_dirent_set_file_type(next, 0);\n\t\tls->err = ext2fs_set_rec_len(ls->fs, rec_len, next);\n\t\tif (ls->err)\n\t\t\treturn DIRENT_ABORT;\n\t\treturn DIRENT_CHANGED;\n\t}\n\n\t/*\n\t * If we get this far, then the directory entry is not used.\n\t * See if we can fit the request entry in.  If so, do it.\n\t */\n\tif (curr_rec_len < rec_len)\n\t\treturn ret;\n\tdirent->inode = ls->inode;\n\text2fs_dirent_set_name_len(dirent, ls->namelen);\n\tstrncpy(dirent->name, ls->name, ls->namelen);\n\tif (ext2fs_has_feature_filetype(ls->sb))\n\t\text2fs_dirent_set_file_type(dirent, ls->flags & 0x7);\n\n\tls->done++;\n\treturn DIRENT_ABORT|DIRENT_CHANGED;\n}\n\nstatic errcode_t add_dirent_to_buf(ext2_filsys fs, e2_blkcnt_t blockcnt,\n\t\t\t\t   char *buf, ext2_ino_t dir,\n\t\t\t\t   struct ext2_inode *diri, const char *name,\n\t\t\t\t   ext2_ino_t ino, int flags, blk64_t *pblkp)\n{\n\tstruct dir_context ctx;\n\tstruct link_struct ls;\n\terrcode_t retval;\n\n\tretval = load_logical_dir_block(fs, dir, diri, blockcnt, pblkp, buf);\n\tif (retval)\n\t\treturn retval;\n\tctx.errcode = 0;\n\tctx.func = link_proc;\n\tctx.dir = dir;\n\tctx.flags = DIRENT_FLAG_INCLUDE_EMPTY;\n\tctx.buf = buf;\n\tctx.priv_data = &ls;\n\n\tls.fs = fs;\n\tls.name = name;\n\tls.namelen = strlen(name);\n\tls.inode = ino;\n\tls.flags = flags;\n\tls.done = 0;\n\tls.sb = fs->super;\n\tls.blocksize = fs->blocksize;\n\tls.err = 0;\n\n\text2fs_process_dir_block(fs, pblkp, blockcnt, 0, 0, &ctx);\n\tif (ctx.errcode)\n\t\treturn ctx.errcode;\n\tif (ls.err)\n\t\treturn ls.err;\n\tif (!ls.done)\n\t\treturn EXT2_ET_DIR_NO_SPACE;\n\treturn 0;\n}\n\nstruct dx_hash_map {\n\t__u32 hash;\n\tint size;\n\tint off;\n};\n\nstatic EXT2_QSORT_TYPE dx_hash_map_cmp(const void *ap, const void *bp)\n{\n\tconst struct dx_hash_map *a = ap, *b = bp;\n\n\tif (a->hash < b->hash)\n\t\treturn -1;\n\tif (a->hash > b->hash)\n\t\treturn 1;\n\treturn 0;\n}\n\nstatic errcode_t dx_move_dirents(ext2_filsys fs, struct dx_hash_map *map,\n\t\t\t\t int count, __u8 *from, __u8 *to)\n{\n\tstruct ext2_dir_entry *de;\n\tint i;\n\tint rec_len = 0;\n\terrcode_t retval;\n\tint csum_size = 0;\n\t__u8 *base = to;\n\n\tif (ext2fs_has_feature_metadata_csum(fs->super))\n\t\tcsum_size = sizeof(struct ext2_dir_entry_tail);\n\n\tfor (i = 0; i < count; i++) {\n\t\tde = (struct ext2_dir_entry*)(from + map[i].off);\n\t\trec_len = EXT2_DIR_REC_LEN(ext2fs_dirent_name_len(de));\n\t\tmemcpy(to, de, rec_len);\n\t\tretval = ext2fs_set_rec_len(fs, rec_len, (struct ext2_dir_entry*)to);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tto += rec_len;\n\t}\n\t/*\n\t * Update rec_len of the last dir entry to stretch to the end of block\n\t */\n\tto -= rec_len;\n\trec_len = fs->blocksize - (to - base) - csum_size;\n\tretval = ext2fs_set_rec_len(fs, rec_len, (struct ext2_dir_entry*)to);\n\tif (retval)\n\t\treturn retval;\n\tif (csum_size)\n\t\text2fs_initialize_dirent_tail(fs,\n\t\t\t\tEXT2_DIRENT_TAIL(base, fs->blocksize));\n\treturn 0;\n}\n\nstatic errcode_t dx_insert_entry(ext2_filsys fs, ext2_ino_t dir,\n\t\t\t\t struct dx_lookup_info *info, int level,\n\t\t\t\t __u32 hash, blk64_t lblk)\n{\n\tint pcount;\n\tstruct ext2_dx_entry *top, *new;\n\n\tpcount = ext2fs_le16_to_cpu(info->frames[level].head->count);\n\ttop = info->frames[level].entries + pcount;\n\tnew = info->frames[level].at + 1;\n\tmemmove(new + 1, new, (char *)top - (char *)new);\n\tnew->hash = ext2fs_cpu_to_le32(hash);\n\tnew->block = ext2fs_cpu_to_le32(lblk);\n\tinfo->frames[level].head->count = ext2fs_cpu_to_le16(pcount + 1);\n\treturn ext2fs_write_dir_block4(fs, info->frames[level].pblock,\n\t\t\t\t       info->frames[level].buf, 0, dir);\n}\n\nstatic errcode_t dx_split_leaf(ext2_filsys fs, ext2_ino_t dir,\n\t\t\t       struct ext2_inode *diri,\n\t\t\t       struct dx_lookup_info *info, __u8 *buf,\n\t\t\t       blk64_t leaf_pblk, blk64_t new_lblk,\n\t\t\t       blk64_t new_pblk)\n{\n\tint hash_flags = diri->i_flags & EXT4_CASEFOLD_FL;\n\tstruct ext2_dir_entry *de;\n\tvoid *buf2;\n\terrcode_t retval = 0;\n\tint rec_len;\n\tint offset, move_size;\n\tint i, count = 0;\n\tstruct dx_hash_map *map;\n\tint continued;\n\t__u32 minor_hash;\n\n\tretval = ext2fs_get_mem(fs->blocksize, &buf2);\n\tif (retval)\n\t\treturn retval;\n\tretval = ext2fs_get_array(fs->blocksize / 12,\n\t\t\t\t  sizeof(struct dx_hash_map), &map);\n\tif (retval) {\n\t\text2fs_free_mem(&buf2);\n\t\treturn retval;\n\t}\n\tfor (offset = 0; offset < fs->blocksize; offset += rec_len) {\n\t\tde = (struct ext2_dir_entry*)(buf + offset);\n\t\tretval = ext2fs_get_rec_len(fs, de, &rec_len);\n\t\tif (retval)\n\t\t\tgoto out;\n\t\tif (ext2fs_dirent_name_len(de) > 0 && de->inode) {\n\t\t\tmap[count].off = offset;\n\t\t\tmap[count].size = rec_len;\n\t\t\tretval = ext2fs_dirhash2(info->hash_alg, de->name,\n\t\t\t\t\text2fs_dirent_name_len(de),\n\t\t\t\t\tfs->encoding, hash_flags,\n\t\t\t\t\tfs->super->s_hash_seed,\n\t\t\t\t\t&(map[count].hash),\n\t\t\t\t\t&minor_hash);\n\t\t\tif (retval)\n\t\t\t\tgoto out;\n\t\t\tcount++;\n\t\t}\n\t}\n\tqsort(map, count, sizeof(struct dx_hash_map), dx_hash_map_cmp);\n\tmove_size = 0;\n\t/* Find place to split block */\n\tfor (i = count - 1; i >= 0; i--) {\n\t\tif (move_size + map[i].size / 2 > fs->blocksize / 2)\n\t\t\tbreak;\n\t\tmove_size += map[i].size;\n\t}\n\t/* Let i be the first entry to move */\n\ti++;\n\t/* Move selected directory entries to new block */\n\tretval = dx_move_dirents(fs, map + i, count - i, buf, buf2);\n\tif (retval)\n\t\tgoto out;\n\tretval = ext2fs_write_dir_block4(fs, new_pblk, buf2, 0, dir);\n\tif (retval)\n\t\tgoto out;\n\t/* Repack remaining entries in the old block */\n\tretval = dx_move_dirents(fs, map, i, buf, buf2);\n\tif (retval)\n\t\tgoto out;\n\tretval = ext2fs_write_dir_block4(fs, leaf_pblk, buf2, 0, dir);\n\tif (retval)\n\t\tgoto out;\n\t/* Update parent node */\n\tcontinued = map[i].hash == map[i-1].hash;\n\tretval = dx_insert_entry(fs, dir, info, info->levels - 1,\n\t\t\t\t map[i].hash + continued, new_lblk);\nout:\n\text2fs_free_mem(&buf2);\n\text2fs_free_mem(&map);\n\treturn retval;\n}\n\nstatic errcode_t dx_grow_tree(ext2_filsys fs, ext2_ino_t dir,\n\t\t\t      struct ext2_inode *diri,\n\t\t\t      struct dx_lookup_info *info, __u8 *buf,\n\t\t\t      blk64_t leaf_pblk)\n{\n\tint i;\n\terrcode_t retval;\n\text2_off64_t size = EXT2_I_SIZE(diri);\n\tblk64_t lblk, pblk;\n\tstruct ext2_dir_entry *de;\n\tstruct ext2_dx_countlimit *head;\n\tint csum_size = 0;\n\tint count;\n\n\tif (ext2fs_has_feature_metadata_csum(fs->super))\n\t\tcsum_size = sizeof(struct ext2_dx_tail);\n\n\t/* Find level which can accommodate new child */\n\tfor (i = info->levels - 1; i >= 0; i--)\n\t\tif (ext2fs_le16_to_cpu(info->frames[i].head->count) <\n\t\t    ext2fs_le16_to_cpu(info->frames[i].head->limit))\n\t\t\tbreak;\n\t/* Need to grow tree depth? */\n\tif (i < 0 && info->levels >= ext2_dir_htree_level(fs))\n\t\treturn EXT2_ET_DIR_NO_SPACE;\n\tlblk = size / fs->blocksize;\n\tsize += fs->blocksize;\n\tretval = ext2fs_inode_size_set(fs, diri, size);\n\tif (retval)\n\t\treturn retval;\n\tretval = ext2fs_fallocate(fs,\n\t\t\tEXT2_FALLOCATE_FORCE_INIT | EXT2_FALLOCATE_ZERO_BLOCKS,\n\t\t\tdir, diri, 0, lblk, 1);\n\tif (retval)\n\t\treturn retval;\n\tretval = ext2fs_write_inode(fs, dir, diri);\n\tif (retval)\n\t\treturn retval;\n\tretval = ext2fs_bmap2(fs, dir, diri, NULL, 0, lblk, NULL, &pblk);\n\tif (retval)\n\t\treturn retval;\n\t/* Only leaf addition needed? */\n\tif (i == info->levels - 1)\n\t\treturn dx_split_leaf(fs, dir, diri, info, buf, leaf_pblk,\n\t\t\t\t     lblk, pblk);\n\n\tde = (struct ext2_dir_entry*)buf;\n\tde->inode = 0;\n\text2fs_dirent_set_name_len(de, 0);\n\text2fs_dirent_set_file_type(de, 0);\n\tretval = ext2fs_set_rec_len(fs, fs->blocksize, de);\n\tif (retval)\n\t\treturn retval;\n\thead = (struct ext2_dx_countlimit*)(buf + 8);\n\tcount = ext2fs_le16_to_cpu(info->frames[i+1].head->count);\n\t/* Growing tree depth? */\n\tif (i < 0) {\n\t\tstruct ext2_dx_root_info *root;\n\n\t\tmemcpy(head, info->frames[0].entries,\n\t\t       count * sizeof(struct ext2_dx_entry));\n\t\thead->limit = ext2fs_cpu_to_le16(\n\t\t\t\t(fs->blocksize - (8 + csum_size)) /\n\t\t\t\tsizeof(struct ext2_dx_entry));\n\t\t/* head->count gets set by memcpy above to correct value */\n\n\t\t/* Now update tree root */\n\t\tinfo->frames[0].head->count = ext2fs_cpu_to_le16(1);\n\t\tinfo->frames[0].entries[0].block = ext2fs_cpu_to_le32(lblk);\n\t\troot = (struct ext2_dx_root_info*)(info->frames[0].buf + EXT2_DX_ROOT_OFF);\n\t\troot->indirect_levels++;\n\t} else {\n\t\t/* Splitting internal node in two */\n\t\tint count1 = count / 2;\n\t\tint count2 = count - count1;\n\t\t__u32 split_hash = ext2fs_le32_to_cpu(info->frames[i+1].entries[count1].hash);\n\n\t\tmemcpy(head, info->frames[i+1].entries + count1,\n\t\t       count2 * sizeof(struct ext2_dx_entry));\n\t\thead->count = ext2fs_cpu_to_le16(count2);\n\t\thead->limit = ext2fs_cpu_to_le16(\n\t\t\t\t(fs->blocksize - (8ULL + csum_size)) /\n\t\t\t\tsizeof(struct ext2_dx_entry));\n\t\tinfo->frames[i+1].head->count = ext2fs_cpu_to_le16(count1);\n\n\t\t/* Update parent node */\n\t\tretval = dx_insert_entry(fs, dir, info, i, split_hash, lblk);\n\t\tif (retval)\n\t\t\treturn retval;\n\n\t}\n\t/* Writeout split block / updated root */\n\tretval = ext2fs_write_dir_block4(fs, info->frames[i+1].pblock,\n\t\t\t\t\t info->frames[i+1].buf, 0, dir);\n\tif (retval)\n\t\treturn retval;\n\t/* Writeout new tree block */\n\tretval = ext2fs_write_dir_block4(fs, pblk, buf, 0, dir);\n\tif (retval)\n\t\treturn retval;\n\treturn 0;\n}\n\nstatic errcode_t dx_link(ext2_filsys fs, ext2_ino_t dir,\n\t\t\t struct ext2_inode *diri, const char *name,\n\t\t\t ext2_ino_t ino, int flags)\n{\n\tstruct dx_lookup_info dx_info;\n\terrcode_t retval;\n\tvoid *blockbuf;\n\tint restart = 0;\n\tblk64_t leaf_pblk;\n\n\tretval = ext2fs_get_mem(fs->blocksize, &blockbuf);\n\tif (retval)\n\t\treturn retval;\n\n\tdx_info.name = name;\n\tdx_info.namelen = strlen(name);\nagain:\n\tretval = dx_lookup(fs, dir, diri, &dx_info);\n\tif (retval)\n\t\tgoto free_buf;\n\n\tretval = add_dirent_to_buf(fs,\n\t\text2fs_le32_to_cpu(dx_info.frames[dx_info.levels-1].at->block) & 0x0fffffff,\n\t\tblockbuf, dir, diri, name, ino, flags, &leaf_pblk);\n\t/*\n\t * Success or error other than ENOSPC...? We are done. We may need upto\n\t * two tries to add entry. One to split htree node and another to add\n\t * new leaf block.\n\t */\n\tif (restart >= dx_info.levels || retval != EXT2_ET_DIR_NO_SPACE)\n\t\tgoto free_frames;\n\tretval = dx_grow_tree(fs, dir, diri, &dx_info, blockbuf, leaf_pblk);\n\tif (retval)\n\t\tgoto free_frames;\n\t/* Restart everything now that the tree is larger */\n\trestart++;\n\tdx_release(&dx_info);\n\tgoto again;\nfree_frames:\n\tdx_release(&dx_info);\nfree_buf:\n\text2fs_free_mem(&blockbuf);\n\treturn retval;\n}\n\n/*\n * Note: the low 3 bits of the flags field are used as the directory\n * entry filetype.\n */\n#ifdef __TURBOC__\n #pragma argsused\n#endif\nerrcode_t ext2fs_link(ext2_filsys fs, ext2_ino_t dir, const char *name,\n\t\t      ext2_ino_t ino, int flags)\n{\n\terrcode_t\t\tretval;\n\tstruct link_struct\tls;\n\tstruct ext2_inode\tinode;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif (!(fs->flags & EXT2_FLAG_RW))\n\t\treturn EXT2_ET_RO_FILSYS;\n\n\tif ((retval = ext2fs_read_inode(fs, dir, &inode)) != 0)\n\t\treturn retval;\n\n\tif (inode.i_flags & EXT2_INDEX_FL)\n\t\treturn dx_link(fs, dir, &inode, name, ino, flags);\n\n\tls.fs = fs;\n\tls.name = name;\n\tls.namelen = name ? strlen(name) : 0;\n\tls.inode = ino;\n\tls.flags = flags;\n\tls.done = 0;\n\tls.sb = fs->super;\n\tls.blocksize = fs->blocksize;\n\tls.err = 0;\n\n\tretval = ext2fs_dir_iterate2(fs, dir, DIRENT_FLAG_INCLUDE_EMPTY,\n\t\t\t\t     NULL, link_proc, &ls);\n\tif (retval)\n\t\treturn retval;\n\tif (ls.err)\n\t\treturn ls.err;\n\n\tif (!ls.done)\n\t\treturn EXT2_ET_DIR_NO_SPACE;\n\treturn 0;\n}\n"
  },
  {
    "path": "src/ext2fs/lookup.c",
    "content": "/*\n * lookup.c --- ext2fs directory lookup operations\n *\n * Copyright (C) 1993, 1994, 1994, 1995 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\nstruct lookup_struct  {\n\tconst char\t*name;\n\tint\t\tlen;\n\text2_ino_t\t*inode;\n\tint\t\tfound;\n};\n\n#ifdef __TURBOC__\n #pragma argsused\n#endif\nstatic int lookup_proc(struct ext2_dir_entry *dirent,\n\t\t       int\toffset EXT2FS_ATTR((unused)),\n\t\t       int\tblocksize EXT2FS_ATTR((unused)),\n\t\t       char\t*buf EXT2FS_ATTR((unused)),\n\t\t       void\t*priv_data)\n{\n\tstruct lookup_struct *ls = (struct lookup_struct *) priv_data;\n\n\tif (ls->len != ext2fs_dirent_name_len(dirent))\n\t\treturn 0;\n\tif (strncmp(ls->name, dirent->name, ext2fs_dirent_name_len(dirent)))\n\t\treturn 0;\n\t*ls->inode = dirent->inode;\n\tls->found++;\n\treturn DIRENT_ABORT;\n}\n\n\nerrcode_t ext2fs_lookup(ext2_filsys fs, ext2_ino_t dir, const char *name,\n\t\t\tint namelen, char *buf, ext2_ino_t *inode)\n{\n\terrcode_t\tretval;\n\tstruct lookup_struct ls;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tls.name = name;\n\tls.len = namelen;\n\tls.inode = inode;\n\tls.found = 0;\n\n\tretval = ext2fs_dir_iterate(fs, dir, 0, buf, lookup_proc, &ls);\n\tif (retval)\n\t\treturn retval;\n\n\treturn (ls.found) ? 0 : EXT2_ET_FILE_NOT_FOUND;\n}\n\n\n"
  },
  {
    "path": "src/ext2fs/mkdir.c",
    "content": "/*\n * mkdir.c --- make a directory in the filesystem\n *\n * Copyright (C) 1994, 1995 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n#include \"ext2fsP.h\"\n\n#ifndef EXT2_FT_DIR\n#define EXT2_FT_DIR\t\t2\n#endif\n\nerrcode_t ext2fs_mkdir(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t inum,\n\t\t       const char *name)\n{\n\text2_extent_handle_t\thandle;\n\terrcode_t\t\tretval;\n\tstruct ext2_inode\tparent_inode, inode;\n\text2_ino_t\t\tino = inum;\n\text2_ino_t\t\tscratch_ino;\n\tblk64_t\t\t\tblk;\n\tchar\t\t\t*block = 0;\n\tint\t\t\tinline_data = 0;\n\tint\t\t\tdrop_refcount = 0;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\t/*\n\t * Create a new dir with inline data iff this feature is enabled\n\t * and ino >= EXT2_FIRST_INO.\n\t */\n\tif ((!ino || ino >= EXT2_FIRST_INO(fs->super)) &&\n\t    ext2fs_has_feature_inline_data(fs->super))\n\t\tinline_data = 1;\n\n\t/*\n\t * Allocate an inode, if necessary\n\t */\n\tif (!ino) {\n\t\tretval = ext2fs_new_inode(fs, parent, LINUX_S_IFDIR | 0755,\n\t\t\t\t\t  0, &ino);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t}\n\n\t/*\n\t * Allocate a data block for the directory\n\t */\n\tmemset(&inode, 0, sizeof(struct ext2_inode));\n\tif (!inline_data) {\n\t\tretval = ext2fs_new_block2(fs, ext2fs_find_inode_goal(fs, ino,\n\t\t\t\t\t\t\t\t      &inode,\n\t\t\t\t\t\t\t\t      0),\n\t\t\t\t\t   NULL, &blk);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t}\n\n\t/*\n\t * Create a scratch template for the directory\n\t */\n\tif (inline_data)\n\t\tretval = ext2fs_new_dir_inline_data(fs, ino, parent,\n\t\t\t\t\t\t    inode.i_block);\n\telse\n\t\tretval = ext2fs_new_dir_block(fs, ino, parent, &block);\n\tif (retval)\n\t\tgoto cleanup;\n\n\t/*\n\t * Get the parent's inode, if necessary\n\t */\n\tif (parent != ino) {\n\t\tretval = ext2fs_read_inode(fs, parent, &parent_inode);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t} else\n\t\tmemset(&parent_inode, 0, sizeof(parent_inode));\n\n\t/*\n\t * Create the inode structure....\n\t */\n\tinode.i_mode = LINUX_S_IFDIR | (0777 & ~fs->umask);\n\tinode.i_uid = inode.i_gid = 0;\n\tif (inline_data) {\n\t\tinode.i_flags |= EXT4_INLINE_DATA_FL;\n\t\tinode.i_size = EXT4_MIN_INLINE_DATA_SIZE;\n\t} else {\n\t\tif (ext2fs_has_feature_extents(fs->super))\n\t\t\tinode.i_flags |= EXT4_EXTENTS_FL;\n\t\telse\n\t\t\tinode.i_block[0] = blk;\n\t\tinode.i_size = fs->blocksize;\n\t\text2fs_iblk_set(fs, &inode, 1);\n\t}\n\tinode.i_links_count = 2;\n\n\t/*\n\t * Write out the inode and inode data block.  The inode generation\n\t * number is assigned by write_new_inode, which means that the call\n\t * to write_dir_block must come after that.\n\t */\n\tretval = ext2fs_write_new_inode(fs, ino, &inode);\n\tif (retval)\n\t\tgoto cleanup;\n\tif (inline_data) {\n\t\t/* init \"system.data\" for new dir */\n\t\tretval = ext2fs_inline_data_init(fs, ino);\n\t} else {\n\t\tretval = ext2fs_write_dir_block4(fs, blk, block, 0, ino);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\n\t\tif (ext2fs_has_feature_extents(fs->super)) {\n\t\t\tretval = ext2fs_extent_open2(fs, ino, &inode, &handle);\n\t\t\tif (retval)\n\t\t\t\tgoto cleanup;\n\t\t\tretval = ext2fs_extent_set_bmap(handle, 0, blk, 0);\n\t\t\text2fs_extent_free(handle);\n\t\t\tif (retval)\n\t\t\t\tgoto cleanup;\n\t\t}\n\t}\n\n\t/*\n\t * Update accounting....\n\t */\n\tif (!inline_data)\n\t\text2fs_block_alloc_stats2(fs, blk, +1);\n\text2fs_inode_alloc_stats2(fs, ino, +1, 1);\n\tdrop_refcount = 1;\n\n\t/*\n\t * Link the directory into the filesystem hierarchy\n\t */\n\tif (name) {\n\t\tretval = ext2fs_lookup(fs, parent, name, strlen(name), 0,\n\t\t\t\t       &scratch_ino);\n\t\tif (!retval) {\n\t\t\tretval = EXT2_ET_DIR_EXISTS;\n\t\t\tname = 0;\n\t\t\tgoto cleanup;\n\t\t}\n\t\tif (retval != EXT2_ET_FILE_NOT_FOUND)\n\t\t\tgoto cleanup;\n\t\tretval = ext2fs_link(fs, parent, name, ino, EXT2_FT_DIR);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t}\n\n\t/*\n\t * Update parent inode's counts\n\t */\n\tif (parent != ino) {\n\t\t/* reload parent inode due to inline data */\n\t\tretval = ext2fs_read_inode(fs, parent, &parent_inode);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t\tparent_inode.i_links_count++;\n\t\tretval = ext2fs_write_inode(fs, parent, &parent_inode);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t}\n\tdrop_refcount = 0;\n\ncleanup:\n\tif (block)\n\t\text2fs_free_mem(&block);\n\tif (drop_refcount) {\n\t\tif (!inline_data)\n\t\t\text2fs_block_alloc_stats2(fs, blk, -1);\n\t\text2fs_inode_alloc_stats2(fs, ino, -1, 1);\n\t}\n\treturn retval;\n\n}\n\n\n"
  },
  {
    "path": "src/ext2fs/mkjournal.c",
    "content": "/*\n * mkjournal.c --- make a journal for a filesystem\n *\n * Copyright (C) 2000 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#if HAVE_ERRNO_H\n#include <errno.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#if HAVE_SYS_IOCTL_H\n#include <sys/ioctl.h>\n#endif\n#if HAVE_NETINET_IN_H\n#include <netinet/in.h>\n#endif\n#ifdef _MSC_VER\n#include <io.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\n#include \"kernel-jbd.h\"\n\n/*\n * This function automatically sets up the journal superblock and\n * returns it as an allocated block.\n */\nerrcode_t ext2fs_create_journal_superblock(ext2_filsys fs,\n\t\t\t\t\t   __u32 num_blocks, int flags,\n\t\t\t\t\t   char  **ret_jsb)\n{\n\terrcode_t\t\tretval;\n\tjournal_superblock_t\t*jsb;\n\n\tif (num_blocks < JBD2_MIN_JOURNAL_BLOCKS)\n\t\treturn EXT2_ET_JOURNAL_TOO_SMALL;\n\n\tif ((retval = ext2fs_get_mem(fs->blocksize, &jsb)))\n\t\treturn retval;\n\n\tmemset (jsb, 0, fs->blocksize);\n\n\tjsb->s_header.h_magic = htonl(JBD2_MAGIC_NUMBER);\n\tif (flags & EXT2_MKJOURNAL_V1_SUPER)\n\t\tjsb->s_header.h_blocktype = htonl(JBD2_SUPERBLOCK_V1);\n\telse\n\t\tjsb->s_header.h_blocktype = htonl(JBD2_SUPERBLOCK_V2);\n\tjsb->s_blocksize = htonl(fs->blocksize);\n\tjsb->s_maxlen = htonl(num_blocks);\n\tjsb->s_nr_users = htonl(1);\n\tjsb->s_first = htonl(1);\n\tjsb->s_sequence = htonl(1);\n\tmemcpy(jsb->s_uuid, fs->super->s_uuid, sizeof(fs->super->s_uuid));\n\t/*\n\t * If we're creating an external journal device, we need to\n\t * adjust these fields.\n\t */\n\tif (ext2fs_has_feature_journal_dev(fs->super)) {\n\t\tjsb->s_nr_users = 0;\n\t\tjsb->s_first = htonl(ext2fs_journal_sb_start(fs->blocksize) + 1);\n\t}\n\n\t*ret_jsb = (char *) jsb;\n\treturn 0;\n}\n\n/*\n * This function writes a journal using POSIX routines.  It is used\n * for creating external journals and creating journals on live\n * filesystems.\n */\nstatic errcode_t write_journal_file(ext2_filsys fs, char *filename,\n\t\t\t\t    blk_t num_blocks, int flags)\n{\n\terrcode_t\tretval;\n\tchar\t\t*buf = 0;\n\tint\t\tfd, ret_size;\n\tblk_t\t\ti;\n\n\tif ((retval = ext2fs_create_journal_superblock(fs, num_blocks, flags,\n\t\t\t\t\t\t       &buf)))\n\t\treturn retval;\n\n\t/* Open the device or journal file */\n\tif ((fd = open(filename, O_WRONLY)) < 0) {\n\t\tretval = errno;\n\t\tgoto errfree;\n\t}\n\n\t/* Write the superblock out */\n\tretval = EXT2_ET_SHORT_WRITE;\n\tret_size = write(fd, buf, fs->blocksize);\n\tif (ret_size < 0) {\n\t\tretval = errno;\n\t\tgoto errout;\n\t}\n\tif (ret_size != (int) fs->blocksize)\n\t\tgoto errout;\n\tmemset(buf, 0, fs->blocksize);\n\n\tif (flags & EXT2_MKJOURNAL_LAZYINIT)\n\t\tgoto success;\n\n\tfor (i = 1; i < num_blocks; i++) {\n\t\tret_size = write(fd, buf, fs->blocksize);\n\t\tif (ret_size < 0) {\n\t\t\tretval = errno;\n\t\t\tgoto errout;\n\t\t}\n\t\tif (ret_size != (int) fs->blocksize)\n\t\t\tgoto errout;\n\t}\n\nsuccess:\n\tretval = 0;\nerrout:\n\tclose(fd);\nerrfree:\n\text2fs_free_mem(&buf);\n\treturn retval;\n}\n\n/*\n * Convenience function which zeros out _num_ blocks starting at\n * _blk_.  In case of an error, the details of the error is returned\n * via _ret_blk_ and _ret_count_ if they are non-NULL pointers.\n * Returns 0 on success, and an error code on an error.\n *\n * As a special case, if the first argument is NULL, then it will\n * attempt to free the static zeroizing buffer.  (This is to keep\n * programs that check for memory leaks happy.)\n */\n#define MAX_STRIDE_LENGTH (4194304 / (int) fs->blocksize)\nerrcode_t ext2fs_zero_blocks2(ext2_filsys fs, blk64_t blk, int num,\n\t\t\t      blk64_t *ret_blk, int *ret_count)\n{\n\tint\t\tj, count;\n\tstatic void\t*buf;\n\tstatic int\tstride_length = 0;\n\terrcode_t\tretval;\n\n\t/* If fs is null, clean up the static buffer and return */\n\tif (!fs) {\n\t\tif (buf) {\n\t\t\tfree(buf);\n\t\t\tbuf = 0;\n\t\t\tstride_length = 0;\n\t\t}\n\t\treturn 0;\n\t}\n\n\t/* Deal with zeroing less than 1 block */\n\tif (num <= 0)\n\t\treturn 0;\n\n\t/* Try a zero out command, if supported */\n\tretval = io_channel_zeroout(fs->io, blk, num);\n\tif (retval == 0)\n\t\treturn 0;\n\n\t/* Allocate the zeroizing buffer if necessary */\n\tif (num > stride_length && stride_length < MAX_STRIDE_LENGTH) {\n\t\tvoid *p;\n\t\tint new_stride = num;\n\n\t\tif (new_stride > MAX_STRIDE_LENGTH)\n\t\t\tnew_stride = MAX_STRIDE_LENGTH;\n\t\tp = realloc(buf, (size_t)fs->blocksize * new_stride);\n\t\tif (!p)\n\t\t\treturn EXT2_ET_NO_MEMORY;\n\t\tbuf = p;\n\t\tstride_length = new_stride;\n\t\tmemset(buf, 0, (size_t)fs->blocksize * stride_length);\n\t}\n\t/* OK, do the write loop */\n\tj=0;\n\twhile (j < num) {\n\t\tif (blk % stride_length) {\n\t\t\tcount = stride_length - (blk % stride_length);\n\t\t\tif (count > (num - j))\n\t\t\t\tcount = num - j;\n\t\t} else {\n\t\t\tcount = num - j;\n\t\t\tif (count > stride_length)\n\t\t\t\tcount = stride_length;\n\t\t}\n\t\tretval = io_channel_write_blk64(fs->io, blk, count, buf);\n\t\tif (retval) {\n\t\t\tif (ret_count)\n\t\t\t\t*ret_count = count;\n\t\t\tif (ret_blk)\n\t\t\t\t*ret_blk = blk;\n\t\t\treturn retval;\n\t\t}\n\t\tj += count; blk += count;\n\t}\n\treturn 0;\n}\n\nerrcode_t ext2fs_zero_blocks(ext2_filsys fs, blk_t blk, int num,\n\t\t\t     blk_t *ret_blk, int *ret_count)\n{\n\tblk64_t ret_blk2;\n\terrcode_t retval;\n\n\tretval = ext2fs_zero_blocks2(fs, blk, num, &ret_blk2, ret_count);\n\tif (retval)\n\t\t*ret_blk = (blk_t) ret_blk2;\n\treturn retval;\n}\n\n/*\n * Calculate the initial goal block to be roughly at the middle of the\n * filesystem.  Pick a group that has the largest number of free\n * blocks.\n */\nstatic blk64_t get_midpoint_journal_block(ext2_filsys fs)\n{\n\tdgrp_t\tgroup, start, end, i, log_flex;\n\n\tgroup = ext2fs_group_of_blk2(fs, (ext2fs_blocks_count(fs->super) -\n\t\t\t\t\t fs->super->s_first_data_block) / 2);\n\tlog_flex = 1 << fs->super->s_log_groups_per_flex;\n\tif (fs->super->s_log_groups_per_flex && (group > log_flex)) {\n\t\tgroup = group & ~(log_flex - 1);\n\t\twhile ((group < fs->group_desc_count) &&\n\t\t       ext2fs_bg_free_blocks_count(fs, group) == 0)\n\t\t\tgroup++;\n\t\tif (group == fs->group_desc_count)\n\t\t\tgroup = 0;\n\t\tstart = group;\n\t} else\n\t\tstart = (group > 0) ? group-1 : group;\n\tend = ((group+1) < fs->group_desc_count) ? group+1 : group;\n\tgroup = start;\n\tfor (i = start + 1; i <= end; i++)\n\t\tif (ext2fs_bg_free_blocks_count(fs, i) >\n\t\t    ext2fs_bg_free_blocks_count(fs, group))\n\t\t\tgroup = i;\n\treturn ext2fs_group_first_block2(fs, group);\n}\n\n/*\n * This function creates a journal using direct I/O routines.\n */\nstatic errcode_t write_journal_inode(ext2_filsys fs, ext2_ino_t journal_ino,\n\t\t\t\t     blk_t num_blocks, blk64_t goal, int flags)\n{\n\tchar\t\t\t*buf;\n\terrcode_t\t\tretval;\n\tstruct ext2_inode\tinode;\n\tunsigned long long\tinode_size;\n\tint\t\t\tfalloc_flags = EXT2_FALLOCATE_FORCE_INIT;\n\tblk64_t\t\t\tzblk;\n\n\tif ((retval = ext2fs_create_journal_superblock(fs, num_blocks, flags,\n\t\t\t\t\t\t       &buf)))\n\t\treturn retval;\n\n\tif ((retval = ext2fs_read_bitmaps(fs)))\n\t\tgoto out2;\n\n\tif ((retval = ext2fs_read_inode(fs, journal_ino, &inode)))\n\t\tgoto out2;\n\n\tif (inode.i_blocks > 0) {\n\t\tretval = EEXIST;\n\t\tgoto out2;\n\t}\n\n\tif (goal == ~0ULL)\n\t\tgoal = get_midpoint_journal_block(fs);\n\n\tif (ext2fs_has_feature_extents(fs->super))\n\t\tinode.i_flags |= EXT4_EXTENTS_FL;\n\n\tif (!(flags & EXT2_MKJOURNAL_LAZYINIT))\n\t\tfalloc_flags |= EXT2_FALLOCATE_ZERO_BLOCKS;\n\n\tinode_size = (unsigned long long)fs->blocksize * num_blocks;\n\tinode.i_mtime = inode.i_ctime = fs->now ? fs->now : time(0);\n\tinode.i_links_count = 1;\n\tinode.i_mode = LINUX_S_IFREG | 0600;\n\tretval = ext2fs_inode_size_set(fs, &inode, inode_size);\n\tif (retval)\n\t\tgoto out2;\n\n\tretval = ext2fs_fallocate(fs, falloc_flags, journal_ino,\n\t\t\t\t  &inode, goal, 0, num_blocks);\n\tif (retval)\n\t\tgoto out2;\n\n\tif ((retval = ext2fs_write_new_inode(fs, journal_ino, &inode)))\n\t\tgoto out2;\n\n\tretval = ext2fs_bmap2(fs, journal_ino, &inode, NULL, 0, 0, NULL, &zblk);\n\tif (retval)\n\t\tgoto out2;\n\n\tretval = io_channel_write_blk64(fs->io, zblk, 1, buf);\n\tif (retval)\n\t\tgoto out2;\n\n\tmemcpy(fs->super->s_jnl_blocks, inode.i_block, EXT2_N_BLOCKS*4);\n\tfs->super->s_jnl_blocks[15] = inode.i_size_high;\n\tfs->super->s_jnl_blocks[16] = inode.i_size;\n\tfs->super->s_jnl_backup_type = EXT3_JNL_BACKUP_BLOCKS;\n\text2fs_mark_super_dirty(fs);\n\nout2:\n\text2fs_free_mem(&buf);\n\treturn retval;\n}\n\n/*\n * Find a reasonable journal file size (in blocks) given the number of blocks\n * in the filesystem.  For very small filesystems, it is not reasonable to\n * have a journal that fills more than half of the filesystem.\n *\n * n.b. comments assume 4k blocks\n */\nint ext2fs_default_journal_size(__u64 num_blocks)\n{\n\tif (num_blocks < 2048)\n\t\treturn -1;\n\tif (num_blocks < 32768)\t\t/* 128 MB */\n\t\treturn (1024);\t\t\t/* 4 MB */\n\tif (num_blocks < 256*1024)\t/* 1 GB */\n\t\treturn (4096);\t\t\t/* 16 MB */\n\tif (num_blocks < 512*1024)\t/* 2 GB */\n\t\treturn (8192);\t\t\t/* 32 MB */\n\tif (num_blocks < 4096*1024)\t/* 16 GB */\n\t\treturn (16384);\t\t\t/* 64 MB */\n\tif (num_blocks < 8192*1024)\t/* 32 GB */\n\t\treturn (32768);\t\t\t/* 128 MB */\n\tif (num_blocks < 16384*1024)\t/* 64 GB */\n\t\treturn (65536);\t\t\t/* 256 MB */\n\tif (num_blocks < 32768*1024)\t/* 128 GB */\n\t\treturn (131072);\t\t/* 512 MB */\n\treturn 262144;\t\t\t\t/* 1 GB */\n}\n\nint ext2fs_journal_sb_start(int blocksize)\n{\n\tif (blocksize == EXT2_MIN_BLOCK_SIZE)\n\t\treturn 2;\n\treturn 1;\n}\n\n/*\n * This function adds a journal device to a filesystem\n */\nerrcode_t ext2fs_add_journal_device(ext2_filsys fs, ext2_filsys journal_dev)\n{\n\tstruct stat\tst;\n\terrcode_t\tretval;\n\tchar\t\tbuf[SUPERBLOCK_SIZE];\n\tjournal_superblock_t\t*jsb;\n\tint\t\tstart;\n\t__u32\t\ti, nr_users;\n\n\t/* Make sure the device exists and is a block device */\n\tif (stat(journal_dev->device_name, &st) < 0)\n\t\treturn errno;\n\n\tif (!S_ISBLK(st.st_mode))\n\t\treturn EXT2_ET_JOURNAL_NOT_BLOCK; /* Must be a block device */\n\n\t/* Get the journal superblock */\n\tstart = ext2fs_journal_sb_start(journal_dev->blocksize);\n\tif ((retval = io_channel_read_blk64(journal_dev->io, start,\n\t\t\t\t\t    -SUPERBLOCK_SIZE,\n\t\t\t\t\t    buf)))\n\t\treturn retval;\n\n\tjsb = (journal_superblock_t *) buf;\n\tif ((jsb->s_header.h_magic != (unsigned) ntohl(JBD2_MAGIC_NUMBER)) ||\n\t    (jsb->s_header.h_blocktype != (unsigned) ntohl(JBD2_SUPERBLOCK_V2)))\n\t\treturn EXT2_ET_NO_JOURNAL_SB;\n\n\tif (ntohl(jsb->s_blocksize) != (unsigned long) fs->blocksize)\n\t\treturn EXT2_ET_UNEXPECTED_BLOCK_SIZE;\n\n\t/* Check and see if this filesystem has already been added */\n\tnr_users = ntohl(jsb->s_nr_users);\n\tif (nr_users > JBD2_USERS_MAX)\n\t\treturn EXT2_ET_CORRUPT_JOURNAL_SB;\n\tfor (i=0; i < nr_users; i++) {\n\t\tif (memcmp(fs->super->s_uuid,\n\t\t\t   &jsb->s_users[i*16], 16) == 0)\n\t\t\tbreak;\n\t}\n\tif (i >= nr_users) {\n\t\tmemcpy(&jsb->s_users[nr_users*16],\n\t\t       fs->super->s_uuid, 16);\n\t\tjsb->s_nr_users = htonl(nr_users+1);\n\t}\n\n\t/* Writeback the journal superblock */\n\tif ((retval = io_channel_write_blk64(journal_dev->io, start,\n\t\t\t\t\t    -SUPERBLOCK_SIZE, buf)))\n\t\treturn retval;\n\n\tfs->super->s_journal_inum = 0;\n\tfs->super->s_journal_dev = st.st_rdev;\n\tmemcpy(fs->super->s_journal_uuid, jsb->s_uuid,\n\t       sizeof(fs->super->s_journal_uuid));\n\tmemset(fs->super->s_jnl_blocks, 0, sizeof(fs->super->s_jnl_blocks));\n\text2fs_set_feature_journal(fs->super);\n\text2fs_mark_super_dirty(fs);\n\treturn 0;\n}\n\n/*\n * This function adds a journal inode to a filesystem, using either\n * POSIX routines if the filesystem is mounted, or using direct I/O\n * functions if it is not.\n */\nerrcode_t ext2fs_add_journal_inode2(ext2_filsys fs, blk_t num_blocks,\n\t\t\t\t    blk64_t goal, int flags)\n{\n\terrcode_t\t\tretval;\n\text2_ino_t\t\tjournal_ino;\n\tstruct stat\t\tst;\n\tchar\t\t\tjfile[1024];\n\tint\t\t\tmount_flags;\n\tint\t\t\tfd = -1;\n\n\tif (flags & EXT2_MKJOURNAL_NO_MNT_CHECK)\n\t\tmount_flags = 0;\n\telse if ((retval = ext2fs_check_mount_point(fs->device_name,\n\t\t\t\t\t\t    &mount_flags,\n\t\t\t\t\t\t    jfile, sizeof(jfile)-10)))\n\t\treturn retval;\n\n\tif (mount_flags & EXT2_MF_MOUNTED) {\n#if HAVE_EXT2_IOCTLS\n\t\tint f = 0;\n#endif\n\t\tstrcat(jfile, \"/.journal\");\n\n\t\t/*\n\t\t * If .../.journal already exists, make sure any\n\t\t * immutable or append-only flags are cleared.\n\t\t */\n#if defined(HAVE_CHFLAGS) && defined(UF_NODUMP)\n\t\t(void) chflags (jfile, 0);\n#else\n#if HAVE_EXT2_IOCTLS\n\t\tfd = open(jfile, O_RDONLY);\n\t\tif (fd >= 0) {\n\t\t\tretval = ioctl(fd, EXT2_IOC_SETFLAGS, &f);\n\t\t\tclose(fd);\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\t\t}\n#endif\n#endif\n\n\t\t/* Create the journal file */\n\t\tif ((fd = open(jfile, O_CREAT|O_WRONLY, 0600)) < 0)\n\t\t\treturn errno;\n\n\t\t/* Note that we can't do lazy journal initialization for mounted\n\t\t * filesystems, since the zero writing is also allocating the\n\t\t * journal blocks.  We could use fallocate, but not all kernels\n\t\t * support that, and creating a journal on a mounted ext2\n\t\t * filesystems is extremely rare these days...  Ignore it. */\n\t\tflags &= ~EXT2_MKJOURNAL_LAZYINIT;\n\n\t\tif ((retval = write_journal_file(fs, jfile, num_blocks, flags)))\n\t\t\tgoto errout;\n\n\t\t/* Get inode number of the journal file */\n\t\tif (fstat(fd, &st) < 0) {\n\t\t\tretval = errno;\n\t\t\tgoto errout;\n\t\t}\n\n#if defined(HAVE_CHFLAGS) && defined(UF_NODUMP)\n\t\tretval = fchflags (fd, UF_NODUMP|UF_IMMUTABLE);\n#else\n#if HAVE_EXT2_IOCTLS\n\t\tif (ioctl(fd, EXT2_IOC_GETFLAGS, &f) < 0) {\n\t\t\tretval = errno;\n\t\t\tgoto errout;\n\t\t}\n\t\tf |= EXT2_NODUMP_FL | EXT2_IMMUTABLE_FL;\n\t\tretval = ioctl(fd, EXT2_IOC_SETFLAGS, &f);\n#endif\n#endif\n\t\t// coverity[dead_error_condition]\n\t\tif (retval) {\n\t\t\tretval = errno;\n\t\t\tgoto errout;\n\t\t}\n\n\t\tif (close(fd) < 0) {\n\t\t\tretval = errno;\n\t\t\tfd = -1;\n\t\t\tgoto errout;\n\t\t}\n\t\tjournal_ino = st.st_ino;\n\t\tmemset(fs->super->s_jnl_blocks, 0,\n\t\t       sizeof(fs->super->s_jnl_blocks));\n\t} else {\n\t\tif ((mount_flags & EXT2_MF_BUSY) &&\n\t\t    !(fs->flags & EXT2_FLAG_EXCLUSIVE)) {\n\t\t\tretval = EBUSY;\n\t\t\tgoto errout;\n\t\t}\n\t\tjournal_ino = EXT2_JOURNAL_INO;\n\t\tif ((retval = write_journal_inode(fs, journal_ino,\n\t\t\t\t\t\t  num_blocks, goal, flags)))\n\t\t\treturn retval;\n\t}\n\n\tfs->super->s_journal_inum = journal_ino;\n\tfs->super->s_journal_dev = 0;\n\tmemset(fs->super->s_journal_uuid, 0,\n\t       sizeof(fs->super->s_journal_uuid));\n\text2fs_set_feature_journal(fs->super);\n\n\text2fs_mark_super_dirty(fs);\n\treturn 0;\nerrout:\n\tif (fd >= 0)\n\t\tclose(fd);\n\treturn retval;\n}\n\nerrcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t num_blocks, int flags)\n{\n\treturn ext2fs_add_journal_inode2(fs, num_blocks, ~0ULL, flags);\n}\n\n\n#ifdef DEBUG\nmain(int argc, char **argv)\n{\n\terrcode_t\tretval;\n\tchar\t\t*device_name;\n\text2_filsys\tfs;\n\n\tif (argc < 2) {\n\t\tfprintf(stderr, \"Usage: %s filesystem\\n\", argv[0]);\n\t\texit(1);\n\t}\n\tdevice_name = argv[1];\n\n\tretval = ext2fs_open (device_name, EXT2_FLAG_RW, 0, 0,\n\t\t\t      unix_io_manager, &fs);\n\tif (retval) {\n\t\tcom_err(argv[0], retval, \"while opening %s\", device_name);\n\t\texit(1);\n\t}\n\n\tretval = ext2fs_add_journal_inode(fs, JBD2_MIN_JOURNAL_BLOCKS, 0);\n\tif (retval) {\n\t\tcom_err(argv[0], retval, \"while adding journal to %s\",\n\t\t\tdevice_name);\n\t\texit(1);\n\t}\n\tretval = ext2fs_flush(fs);\n\tif (retval) {\n\t\tprintf(\"Warning, had trouble writing out superblocks.\\n\");\n\t}\n\text2fs_close_free(&fs);\n\texit(0);\n\n}\n#endif\n"
  },
  {
    "path": "src/ext2fs/mmp.c",
    "content": "/*\n * Helper functions for multiple mount protection (MMP).\n *\n * Copyright (C) 2011 Whamcloud, Inc.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#ifndef _GNU_SOURCE\n#define _GNU_SOURCE\n#endif\n#ifndef _DEFAULT_SOURCE\n#define _DEFAULT_SOURCE\t/* since glibc 2.20 _SVID_SOURCE is deprecated */\n#endif\n\n#include \"config.h\"\n\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#if HAVE_SYS_TIME_H\n#include <sys/time.h>\n#endif\n\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n\n#include \"ext2fs/ext2_fs.h\"\n#include \"ext2fs/ext2fs.h\"\n\n#ifndef O_DIRECT\n#define O_DIRECT 0\n#endif\n\n#if __GNUC_PREREQ (4, 6)\n#pragma GCC diagnostic push\n#ifndef CONFIG_MMP\n#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n#endif\n#endif\n\nerrcode_t ext2fs_mmp_read(ext2_filsys fs, blk64_t mmp_blk, void *buf)\n{\n#ifdef CONFIG_MMP\n\tstruct mmp_struct *mmp_cmp;\n\terrcode_t retval = 0;\n\n\tif ((mmp_blk <= fs->super->s_first_data_block) ||\n\t    (mmp_blk >= ext2fs_blocks_count(fs->super)))\n\t\treturn EXT2_ET_MMP_BAD_BLOCK;\n\n\t/* ext2fs_open() reserves fd0,1,2 to avoid stdio collision, so checking\n\t * mmp_fd <= 0 is OK to validate that the fd is valid.  This opens its\n\t * own fd to read the MMP block to ensure that it is using O_DIRECT,\n\t * regardless of how the io_manager is doing reads, to avoid caching of\n\t * the MMP block by the io_manager or the VM.  It needs to be fresh. */\n\tif (fs->mmp_fd <= 0) {\n\t\tint flags = O_RDWR | O_DIRECT;\n\nretry:\n\t\tfs->mmp_fd = open(fs->device_name, flags);\n\t\tif (fs->mmp_fd < 0) {\n\t\t\tstruct stat st;\n\n\t\t\t/* Avoid O_DIRECT for filesystem image files if open\n\t\t\t * fails, since it breaks when running on tmpfs. */\n\t\t\tif (errno == EINVAL && (flags & O_DIRECT) &&\n\t\t\t    stat(fs->device_name, &st) == 0 &&\n\t\t\t    S_ISREG(st.st_mode)) {\n\t\t\t\tflags &= ~O_DIRECT;\n\t\t\t\tgoto retry;\n\t\t\t}\n\t\t\tretval = EXT2_ET_MMP_OPEN_DIRECT;\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\tif (fs->mmp_cmp == NULL) {\n\t\tint align = ext2fs_get_dio_alignment(fs->mmp_fd);\n\n\t\tretval = ext2fs_get_memalign(fs->blocksize, align,\n\t\t\t\t\t     &fs->mmp_cmp);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\n\tif ((blk64_t) ext2fs_llseek(fs->mmp_fd, mmp_blk * fs->blocksize,\n\t\t\t\t    SEEK_SET) !=\n\t    mmp_blk * fs->blocksize) {\n\t\tretval = EXT2_ET_LLSEEK_FAILED;\n\t\tgoto out;\n\t}\n\n\tif (read(fs->mmp_fd, fs->mmp_cmp, fs->blocksize) != fs->blocksize) {\n\t\tretval = EXT2_ET_SHORT_READ;\n\t\tgoto out;\n\t}\n\n\tmmp_cmp = fs->mmp_cmp;\n\n\tif (!(fs->flags & EXT2_FLAG_IGNORE_CSUM_ERRORS) &&\n\t    !ext2fs_mmp_csum_verify(fs, mmp_cmp))\n\t\tretval = EXT2_ET_MMP_CSUM_INVALID;\n\n#ifdef WORDS_BIGENDIAN\n\text2fs_swap_mmp(mmp_cmp);\n#endif\n\n\tif (buf != NULL && buf != fs->mmp_cmp)\n\t\tmemcpy(buf, fs->mmp_cmp, fs->blocksize);\n\n\tif (mmp_cmp->mmp_magic != EXT4_MMP_MAGIC) {\n\t\tretval = EXT2_ET_MMP_MAGIC_INVALID;\n\t\tgoto out;\n\t}\n\nout:\n\treturn retval;\n#else\n\treturn EXT2_ET_OP_NOT_SUPPORTED;\n#endif\n}\n\nerrcode_t ext2fs_mmp_write(ext2_filsys fs, blk64_t mmp_blk, void *buf)\n{\n#ifdef CONFIG_MMP\n\tstruct mmp_struct *mmp_s = buf;\n\tstruct timeval tv;\n\terrcode_t retval = 0;\n\n\tgettimeofday(&tv, 0);\n\tmmp_s->mmp_time = tv.tv_sec;\n\tfs->mmp_last_written = tv.tv_sec;\n\n\tif (fs->super->s_mmp_block < fs->super->s_first_data_block ||\n\t    fs->super->s_mmp_block > ext2fs_blocks_count(fs->super))\n\t\treturn EXT2_ET_MMP_BAD_BLOCK;\n\n#ifdef WORDS_BIGENDIAN\n\text2fs_swap_mmp(mmp_s);\n#endif\n\n\tretval = ext2fs_mmp_csum_set(fs, mmp_s);\n\tif (retval)\n\t\treturn retval;\n\n\t/* I was tempted to make this use O_DIRECT and the mmp_fd, but\n\t * this caused no end of grief, while leaving it as-is works. */\n\tretval = io_channel_write_blk64(fs->io, mmp_blk, -(int)sizeof(struct mmp_struct), buf);\n\n#ifdef WORDS_BIGENDIAN\n\text2fs_swap_mmp(mmp_s);\n#endif\n\n\t/* Make sure the block gets to disk quickly */\n\tio_channel_flush(fs->io);\n\treturn retval;\n#else\n\treturn EXT2_ET_OP_NOT_SUPPORTED;\n#endif\n}\n\n#ifdef HAVE_SRANDOM\n#define srand(x)\tsrandom(x)\n#define rand()\t\trandom()\n#endif\n\nunsigned ext2fs_mmp_new_seq(void)\n{\n#ifdef CONFIG_MMP\n\tunsigned new_seq;\n\tstruct timeval tv;\n\n\tgettimeofday(&tv, 0);\n\tsrand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec);\n\n\tgettimeofday(&tv, 0);\n\t/* Crank the random number generator a few times */\n\tfor (new_seq = (tv.tv_sec ^ tv.tv_usec) & 0x1F; new_seq > 0; new_seq--)\n\t\trand();\n\n\tdo {\n\t\tnew_seq = rand();\n\t} while (new_seq > EXT4_MMP_SEQ_MAX);\n\n\treturn new_seq;\n#else\n\treturn EXT2_ET_OP_NOT_SUPPORTED;\n#endif\n}\n\n#ifdef CONFIG_MMP\nstatic errcode_t ext2fs_mmp_reset(ext2_filsys fs)\n{\n\tstruct mmp_struct *mmp_s = NULL;\n\terrcode_t retval = 0;\n\n\tif (fs->mmp_buf == NULL) {\n\t\tretval = ext2fs_get_mem(fs->blocksize, &fs->mmp_buf);\n\t\tif (retval)\n\t\t\tgoto out;\n\t}\n\n\tmemset(fs->mmp_buf, 0, fs->blocksize);\n\tmmp_s = fs->mmp_buf;\n\n\tmmp_s->mmp_magic = EXT4_MMP_MAGIC;\n\tmmp_s->mmp_seq = EXT4_MMP_SEQ_CLEAN;\n\tmmp_s->mmp_time = 0;\n#ifdef HAVE_GETHOSTNAME\n\tgethostname(mmp_s->mmp_nodename, sizeof(mmp_s->mmp_nodename));\n#else\n\tmmp_s->mmp_nodename[0] = '\\0';\n#endif\n\tstrncpy(mmp_s->mmp_bdevname, fs->device_name,\n\t\tsizeof(mmp_s->mmp_bdevname));\n\n\tmmp_s->mmp_check_interval = fs->super->s_mmp_update_interval;\n\tif (mmp_s->mmp_check_interval < EXT4_MMP_MIN_CHECK_INTERVAL)\n\t\tmmp_s->mmp_check_interval = EXT4_MMP_MIN_CHECK_INTERVAL;\n\n\tretval = ext2fs_mmp_write(fs, fs->super->s_mmp_block, fs->mmp_buf);\nout:\n\treturn retval;\n}\n#endif\n\nerrcode_t ext2fs_mmp_update(ext2_filsys fs)\n{\n\treturn ext2fs_mmp_update2(fs, 0);\n}\n\nerrcode_t ext2fs_mmp_clear(ext2_filsys fs)\n{\n#ifdef CONFIG_MMP\n\terrcode_t retval = 0;\n\n\tif (!(fs->flags & EXT2_FLAG_RW))\n\t\treturn EXT2_ET_RO_FILSYS;\n\n\tretval = ext2fs_mmp_reset(fs);\n\n\treturn retval;\n#else\n\treturn EXT2_ET_OP_NOT_SUPPORTED;\n#endif\n}\n\nerrcode_t ext2fs_mmp_init(ext2_filsys fs)\n{\n#ifdef CONFIG_MMP\n\tstruct ext2_super_block *sb = fs->super;\n\tblk64_t mmp_block;\n\terrcode_t retval;\n\n\tif (sb->s_mmp_update_interval == 0)\n\t\tsb->s_mmp_update_interval = EXT4_MMP_UPDATE_INTERVAL;\n\t/* This is probably excessively large, but who knows? */\n\telse if (sb->s_mmp_update_interval > EXT4_MMP_MAX_UPDATE_INTERVAL)\n\t\treturn EXT2_ET_INVALID_ARGUMENT;\n\n\tif (fs->mmp_buf == NULL) {\n\t\tretval = ext2fs_get_mem(fs->blocksize, &fs->mmp_buf);\n\t\tif (retval)\n\t\t\tgoto out;\n\t}\n\n\tretval = ext2fs_alloc_block2(fs, 0, fs->mmp_buf, &mmp_block);\n\tif (retval)\n\t\tgoto out;\n\n\tsb->s_mmp_block = mmp_block;\n\n\tretval = ext2fs_mmp_reset(fs);\n\tif (retval)\n\t\tgoto out;\n\nout:\n\treturn retval;\n#else\n\treturn EXT2_ET_OP_NOT_SUPPORTED;\n#endif\n}\n\n#ifndef min\n#define min(x, y) ((x) < (y) ? (x) : (y))\n#endif\n\n/*\n * Make sure that the fs is not mounted or being fsck'ed while opening the fs.\n */\nerrcode_t ext2fs_mmp_start(ext2_filsys fs)\n{\n#ifdef CONFIG_MMP\n\tstruct mmp_struct *mmp_s;\n\tunsigned seq;\n\tunsigned int mmp_check_interval;\n\terrcode_t retval = 0;\n\n\tif (fs->mmp_buf == NULL) {\n\t\tretval = ext2fs_get_mem(fs->blocksize, &fs->mmp_buf);\n\t\tif (retval)\n\t\t\tgoto mmp_error;\n\t}\n\n\tretval = ext2fs_mmp_read(fs, fs->super->s_mmp_block, fs->mmp_buf);\n\tif (retval)\n\t\tgoto mmp_error;\n\n\tmmp_s = fs->mmp_buf;\n\n\tmmp_check_interval = fs->super->s_mmp_update_interval;\n\tif (mmp_check_interval < EXT4_MMP_MIN_CHECK_INTERVAL)\n\t\tmmp_check_interval = EXT4_MMP_MIN_CHECK_INTERVAL;\n\n\tseq = mmp_s->mmp_seq;\n\tif (seq == EXT4_MMP_SEQ_CLEAN)\n\t\tgoto clean_seq;\n\tif (seq == EXT4_MMP_SEQ_FSCK) {\n\t\tretval = EXT2_ET_MMP_FSCK_ON;\n\t\tgoto mmp_error;\n\t}\n\n\tif (seq > EXT4_MMP_SEQ_FSCK) {\n\t\tretval = EXT2_ET_MMP_UNKNOWN_SEQ;\n\t\tgoto mmp_error;\n\t}\n\n\t/*\n\t * If check_interval in MMP block is larger, use that instead of\n\t * check_interval from the superblock.\n\t */\n\tif (mmp_s->mmp_check_interval > mmp_check_interval)\n\t\tmmp_check_interval = mmp_s->mmp_check_interval;\n\n\tsleep(min(mmp_check_interval * 2 + 1, mmp_check_interval + 60));\n\n\tretval = ext2fs_mmp_read(fs, fs->super->s_mmp_block, fs->mmp_buf);\n\tif (retval)\n\t\tgoto mmp_error;\n\n\tif (seq != mmp_s->mmp_seq) {\n\t\tretval = EXT2_ET_MMP_FAILED;\n\t\tgoto mmp_error;\n\t}\n\nclean_seq:\n\tif (!(fs->flags & EXT2_FLAG_RW))\n\t\tgoto mmp_error;\n\n\tmmp_s->mmp_seq = seq = ext2fs_mmp_new_seq();\n#ifdef HAVE_GETHOSTNAME\n\tgethostname(mmp_s->mmp_nodename, sizeof(mmp_s->mmp_nodename));\n#else\n\tstrcpy(mmp_s->mmp_nodename, \"unknown host\");\n#endif\n\tstrncpy(mmp_s->mmp_bdevname, fs->device_name,\n\t\tsizeof(mmp_s->mmp_bdevname));\n\n\tretval = ext2fs_mmp_write(fs, fs->super->s_mmp_block, fs->mmp_buf);\n\tif (retval)\n\t\tgoto mmp_error;\n\n\tsleep(min(2 * mmp_check_interval + 1, mmp_check_interval + 60));\n\n\tretval = ext2fs_mmp_read(fs, fs->super->s_mmp_block, fs->mmp_buf);\n\tif (retval)\n\t\tgoto mmp_error;\n\n\tif (seq != mmp_s->mmp_seq) {\n\t\tretval = EXT2_ET_MMP_FAILED;\n\t\tgoto mmp_error;\n\t}\n\n\tmmp_s->mmp_seq = EXT4_MMP_SEQ_FSCK;\n\tretval = ext2fs_mmp_write(fs, fs->super->s_mmp_block, fs->mmp_buf);\n\tif (retval)\n\t\tgoto mmp_error;\n\n\treturn 0;\n\nmmp_error:\n\treturn retval;\n#else\n\treturn EXT2_ET_OP_NOT_SUPPORTED;\n#endif\n}\n\n/*\n * Clear the MMP usage in the filesystem.  If this function returns an\n * error EXT2_ET_MMP_CHANGE_ABORT it means the filesystem was modified\n * by some other process while in use, and changes should be dropped, or\n * risk filesystem corruption.\n */\nerrcode_t ext2fs_mmp_stop(ext2_filsys fs)\n{\n#ifdef CONFIG_MMP\n\tstruct mmp_struct *mmp, *mmp_cmp;\n\terrcode_t retval = 0;\n\n\tif (!ext2fs_has_feature_mmp(fs->super) ||\n\t    !(fs->flags & EXT2_FLAG_RW) || (fs->flags & EXT2_FLAG_SKIP_MMP))\n\t\tgoto mmp_error;\n\n\tretval = ext2fs_mmp_read(fs, fs->super->s_mmp_block, fs->mmp_buf);\n\tif (retval)\n\t\tgoto mmp_error;\n\n\t/* Check if the MMP block is not changed. */\n\tmmp = fs->mmp_buf;\n\tmmp_cmp = fs->mmp_cmp;\n\tif (memcmp(mmp, mmp_cmp, sizeof(*mmp_cmp))) {\n\t\tretval = EXT2_ET_MMP_CHANGE_ABORT;\n\t\tgoto mmp_error;\n\t}\n\n\tmmp_cmp->mmp_seq = EXT4_MMP_SEQ_CLEAN;\n\tretval = ext2fs_mmp_write(fs, fs->super->s_mmp_block, fs->mmp_cmp);\n\nmmp_error:\n\tif (fs->mmp_fd > 0) {\n\t\tclose(fs->mmp_fd);\n\t\tfs->mmp_fd = -1;\n\t}\n\n\treturn retval;\n#else\n\tif (!ext2fs_has_feature_mmp(fs->super) ||\n\t    !(fs->flags & EXT2_FLAG_RW) || (fs->flags & EXT2_FLAG_SKIP_MMP))\n\t\treturn 0;\n\n\treturn EXT2_ET_OP_NOT_SUPPORTED;\n#endif\n}\n\n#define EXT2_MIN_MMP_UPDATE_INTERVAL 60\n\n/*\n * Update the on-disk mmp buffer, after checking that it hasn't been changed.\n */\nerrcode_t ext2fs_mmp_update2(ext2_filsys fs, int immediately)\n{\n#ifdef CONFIG_MMP\n\tstruct mmp_struct *mmp, *mmp_cmp;\n\tstruct timeval tv;\n\terrcode_t retval = 0;\n\n\tif (!ext2fs_has_feature_mmp(fs->super) ||\n\t    !(fs->flags & EXT2_FLAG_RW) || (fs->flags & EXT2_FLAG_SKIP_MMP))\n\t\treturn 0;\n\n\tgettimeofday(&tv, 0);\n\tif (!immediately &&\n\t    tv.tv_sec - fs->mmp_last_written < EXT2_MIN_MMP_UPDATE_INTERVAL)\n\t\treturn 0;\n\n\tretval = ext2fs_mmp_read(fs, fs->super->s_mmp_block, NULL);\n\tif (retval)\n\t\tgoto mmp_error;\n\n\tmmp = fs->mmp_buf;\n\tmmp_cmp = fs->mmp_cmp;\n\n\tif (memcmp(mmp, mmp_cmp, sizeof(*mmp_cmp)))\n\t\treturn EXT2_ET_MMP_CHANGE_ABORT;\n\n\tmmp->mmp_time = tv.tv_sec;\n\tmmp->mmp_seq = EXT4_MMP_SEQ_FSCK;\n\tretval = ext2fs_mmp_write(fs, fs->super->s_mmp_block, fs->mmp_buf);\n\nmmp_error:\n\treturn retval;\n#else\n\tif (!ext2fs_has_feature_mmp(fs->super) ||\n\t    !(fs->flags & EXT2_FLAG_RW) || (fs->flags & EXT2_FLAG_SKIP_MMP))\n\t\treturn 0;\n\n\treturn EXT2_ET_OP_NOT_SUPPORTED;\n#endif\n}\n#if __GNUC_PREREQ (4, 6)\n#pragma GCC diagnostic pop\n#endif\n"
  },
  {
    "path": "src/ext2fs/namei.c",
    "content": "/*\n * namei.c --- ext2fs directory lookup operations\n *\n * Copyright (C) 1993, 1994, 1994, 1995 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n\n/* #define NAMEI_DEBUG */\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n#include \"ext2fsP.h\"\n\nstatic errcode_t open_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t base,\n\t\t\t    const char *pathname, size_t pathlen, int follow,\n\t\t\t    int link_count, char *buf, ext2_ino_t *res_inode);\n\nstatic errcode_t follow_link(ext2_filsys fs, ext2_ino_t root, ext2_ino_t dir,\n\t\t\t     ext2_ino_t inode, int link_count,\n\t\t\t     char *buf, ext2_ino_t *res_inode)\n{\n\tchar *pathname;\n\tchar *buffer = 0;\n\terrcode_t retval;\n\tstruct ext2_inode ei;\n\tblk64_t blk;\n\n#ifdef NAMEI_DEBUG\n\tprintf(\"follow_link: root=%lu, dir=%lu, inode=%lu, lc=%d\\n\",\n\t       root, dir, inode, link_count);\n\n#endif\n\tretval = ext2fs_read_inode (fs, inode, &ei);\n\tif (retval) return retval;\n\tif (!LINUX_S_ISLNK (ei.i_mode)) {\n\t\t*res_inode = inode;\n\t\treturn 0;\n\t}\n\tif (link_count++ >= EXT2FS_MAX_NESTED_LINKS)\n\t\treturn EXT2_ET_SYMLINK_LOOP;\n\n\tif (ext2fs_is_fast_symlink(&ei))\n\t\tpathname = (char *)&(ei.i_block[0]);\n\telse if (ei.i_flags & EXT4_INLINE_DATA_FL) {\n\t\tretval = ext2fs_get_memzero(ei.i_size, &buffer);\n\t\tif (retval)\n\t\t\treturn retval;\n\n\t\tretval = ext2fs_inline_data_get(fs, inode,\n\t\t\t\t\t\t&ei, buffer, NULL);\n\t\tif (retval) {\n\t\t\text2fs_free_mem(&buffer);\n\t\t\treturn retval;\n\t\t}\n\t\tpathname = buffer;\n\t} else {\n\t\tretval = ext2fs_bmap2(fs, inode, &ei, NULL, 0, 0, NULL, &blk);\n\t\tif (retval)\n\t\t\treturn retval;\n\n\t\tretval = ext2fs_get_mem(fs->blocksize, &buffer);\n\t\tif (retval)\n\t\t\treturn retval;\n\n\t\tretval = io_channel_read_blk64(fs->io, blk, 1, buffer);\n\t\tif (retval) {\n\t\t\text2fs_free_mem(&buffer);\n\t\t\treturn retval;\n\t\t}\n\t\tpathname = buffer;\n\t}\n\n\tretval = open_namei(fs, root, dir, pathname, ei.i_size, 1,\n\t\t\t    link_count, buf, res_inode);\n\tif (buffer)\n\t\text2fs_free_mem(&buffer);\n\treturn retval;\n}\n\n/*\n * This routine interprets a pathname in the context of the current\n * directory and the root directory, and returns the inode of the\n * containing directory, and a pointer to the filename of the file\n * (pointing into the pathname) and the length of the filename.\n */\nstatic errcode_t dir_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t dir,\n\t\t\t   const char *pathname, int pathlen,\n\t\t\t   int link_count, char *buf,\n\t\t\t   const char **name, int *namelen,\n\t\t\t   ext2_ino_t *res_inode)\n{\n\tchar c;\n\tconst char *thisname;\n\tint len;\n\text2_ino_t inode;\n\terrcode_t retval;\n\n\tif ((c = *pathname) == '/') {\n        \tdir = root;\n\t\tpathname++;\n\t\tpathlen--;\n\t}\n\twhile (1) {\n        \tthisname = pathname;\n\t\tfor (len=0; --pathlen >= 0;len++) {\n\t\t\tc = *(pathname++);\n\t\t\tif (c == '/')\n\t\t\t\tbreak;\n\t\t}\n\t\tif (pathlen < 0)\n\t\t\tbreak;\n\t\tretval = ext2fs_lookup (fs, dir, thisname, len, buf, &inode);\n\t\tif (retval) return retval;\n        \tretval = follow_link (fs, root, dir, inode,\n\t\t\t\t      link_count, buf, &dir);\n        \tif (retval) return retval;\n    \t}\n\t*name = thisname;\n\t*namelen = len;\n\t*res_inode = dir;\n\treturn 0;\n}\n\nstatic errcode_t open_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t base,\n\t\t\t    const char *pathname, size_t pathlen, int follow,\n\t\t\t    int link_count, char *buf, ext2_ino_t *res_inode)\n{\n\tconst char *base_name;\n\tint namelen;\n\text2_ino_t dir, inode;\n\terrcode_t retval;\n\n#ifdef NAMEI_DEBUG\n\tprintf(\"open_namei: root=%lu, dir=%lu, path=%.*s, lc=%d\\n\",\n\t       root, base, pathlen, pathname, link_count);\n#endif\n\tretval = dir_namei(fs, root, base, pathname, pathlen,\n\t\t\t   link_count, buf, &base_name, &namelen, &dir);\n\tif (retval) return retval;\n\tif (!namelen) {                     /* special case: '/usr/' etc */\n\t\t*res_inode=dir;\n\t\treturn 0;\n\t}\n\tretval = ext2fs_lookup (fs, dir, base_name, namelen, buf, &inode);\n\tif (retval)\n\t\treturn retval;\n\tif (follow) {\n\t\tretval = follow_link(fs, root, dir, inode, link_count,\n\t\t\t\t     buf, &inode);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n#ifdef NAMEI_DEBUG\n\tprintf(\"open_namei: (link_count=%d) returns %lu\\n\",\n\t       link_count, inode);\n#endif\n\t*res_inode = inode;\n\treturn 0;\n}\n\nerrcode_t ext2fs_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,\n\t\t       const char *name, ext2_ino_t *inode)\n{\n\tchar *buf;\n\terrcode_t retval;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tretval = ext2fs_get_mem(fs->blocksize, &buf);\n\tif (retval)\n\t\treturn retval;\n\n\tretval = open_namei(fs, root, cwd, name, strlen(name), 0, 0,\n\t\t\t    buf, inode);\n\n\text2fs_free_mem(&buf);\n\treturn retval;\n}\n\nerrcode_t ext2fs_namei_follow(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,\n\t\t\t      const char *name, ext2_ino_t *inode)\n{\n\tchar *buf;\n\terrcode_t retval;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tretval = ext2fs_get_mem(fs->blocksize, &buf);\n\tif (retval)\n\t\treturn retval;\n\n\tretval = open_namei(fs, root, cwd, name, strlen(name), 1, 0,\n\t\t\t    buf, inode);\n\n\text2fs_free_mem(&buf);\n\treturn retval;\n}\n\nerrcode_t ext2fs_follow_link(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd,\n\t\t\text2_ino_t inode, ext2_ino_t *res_inode)\n{\n\tchar *buf;\n\terrcode_t retval;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tretval = ext2fs_get_mem(fs->blocksize, &buf);\n\tif (retval)\n\t\treturn retval;\n\n\tretval = follow_link(fs, root, cwd, inode, 0, buf, res_inode);\n\n\text2fs_free_mem(&buf);\n\treturn retval;\n}\n\n"
  },
  {
    "path": "src/ext2fs/newdir.c",
    "content": "/*\n * newdir.c --- create a new directory block\n *\n * Copyright (C) 1994, 1995 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\n#ifndef EXT2_FT_DIR\n#define EXT2_FT_DIR\t\t2\n#endif\n\n/*\n * Create new directory block\n */\nerrcode_t ext2fs_new_dir_block(ext2_filsys fs, ext2_ino_t dir_ino,\n\t\t\t       ext2_ino_t parent_ino, char **block)\n{\n\tstruct ext2_dir_entry \t*dir = NULL;\n\terrcode_t\t\tretval;\n\tchar\t\t\t*buf;\n\tint\t\t\trec_len;\n\tint\t\t\tfiletype = 0;\n\tstruct ext2_dir_entry_tail\t*t;\n\tint\t\t\tcsum_size = 0;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tretval = ext2fs_get_mem(fs->blocksize, &buf);\n\tif (retval)\n\t\treturn retval;\n\tmemset(buf, 0, fs->blocksize);\n\tdir = (struct ext2_dir_entry *) buf;\n\n\tif (ext2fs_has_feature_metadata_csum(fs->super))\n\t\tcsum_size = sizeof(struct ext2_dir_entry_tail);\n\n\tretval = ext2fs_set_rec_len(fs, fs->blocksize - csum_size, dir);\n\tif (retval) {\n\t\text2fs_free_mem(&buf);\n\t\treturn retval;\n\t}\n\n\tif (dir_ino) {\n\t\tif (ext2fs_has_feature_filetype(fs->super))\n\t\t\tfiletype = EXT2_FT_DIR;\n\t\t/*\n\t\t * Set up entry for '.'\n\t\t */\n\t\tdir->inode = dir_ino;\n\t\text2fs_dirent_set_name_len(dir, 1);\n\t\text2fs_dirent_set_file_type(dir, filetype);\n\t\tdir->name[0] = '.';\n\t\trec_len = (fs->blocksize - csum_size) - EXT2_DIR_REC_LEN(1);\n\t\tdir->rec_len = EXT2_DIR_REC_LEN(1);\n\n\t\t/*\n\t\t * Set up entry for '..'\n\t\t */\n\t\tdir = (struct ext2_dir_entry *) (buf + dir->rec_len);\n\t\tretval = ext2fs_set_rec_len(fs, rec_len, dir);\n\t\tif (retval) {\n\t\t\text2fs_free_mem(&buf);\n\t\t\treturn retval;\n\t\t}\n\t\tdir->inode = parent_ino;\n\t\text2fs_dirent_set_name_len(dir, 2);\n\t\text2fs_dirent_set_file_type(dir, filetype);\n\t\tdir->name[0] = '.';\n\t\tdir->name[1] = '.';\n\n\t}\n\n\tif (csum_size) {\n\t\tt = EXT2_DIRENT_TAIL(buf, fs->blocksize);\n\t\text2fs_initialize_dirent_tail(fs, t);\n\t}\n\t*block = buf;\n\treturn 0;\n}\n\n/*\n * Create new directory on inline data\n */\nerrcode_t ext2fs_new_dir_inline_data(ext2_filsys fs,\n\t\t\t\t     ext2_ino_t dir_ino EXT2FS_ATTR((unused)),\n\t\t\t\t     ext2_ino_t parent_ino, __u32 *iblock)\n{\n\tstruct ext2_dir_entry \t*dir = NULL;\n\terrcode_t\t\tretval;\n\tint\t\t\trec_len;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tiblock[0] = ext2fs_cpu_to_le32(parent_ino);\n\n\tdir = (struct ext2_dir_entry *)((char *)iblock +\n\t\t\t\t\tEXT4_INLINE_DATA_DOTDOT_SIZE);\n\tdir->inode = 0;\n\trec_len = EXT4_MIN_INLINE_DATA_SIZE - EXT4_INLINE_DATA_DOTDOT_SIZE;\n\tretval = ext2fs_set_rec_len(fs, rec_len, dir);\n\tif (retval)\n\t\tgoto errout;\n\n#ifdef WORDS_BIGENDIAN\n\tretval = ext2fs_dirent_swab_out2(fs, (char *)dir, rec_len, 0);\n\tif (retval)\n\t\tgoto errout;\n#endif\n\nerrout:\n\treturn retval;\n}\n"
  },
  {
    "path": "src/ext2fs/nt_io.c",
    "content": "/*\n * nt_io.c --- This is the Nt I/O interface to the I/O manager.\n *\n * Implements a one-block write-through cache.\n *\n * Copyright (C) 1993, 1994, 1995 Theodore Ts'o.\n * Copyright (C) 1998 Andrey Shedel <andreys@ns.cr.cyco.com>\n * Copyright (C) 2018-2024 Pete Batard <pete@akeo.ie>\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include <assert.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n#include <malloc.h>\n#include <errno.h>\n#include <sys/types.h>\n\n#include <windows.h>\n#include <winternl.h>\n#include <assert.h>\n\n#include \"config.h\"\n#include \"ext2fs.h\"\n#include \"rufus.h\"\n#include \"ntdll.h\"\n#include \"msapi_utf8.h\"\n\nextern char* NtStatusError(NTSTATUS Status);\nstatic DWORD LastWinError = 0;\n\n#define ARGUMENT_PRESENT(ArgumentPointer)   ((CHAR *)((ULONG_PTR)(ArgumentPointer)) != (CHAR *)(NULL))\n\n#define STATUS_SUCCESS                      ((NTSTATUS)0x00000000L)\n#define STATUS_ACCESS_DENIED                ((NTSTATUS)0xC0000022L)\n#define STATUS_INVALID_DEVICE_REQUEST       ((NTSTATUS)0xC0000010L)\n\n#define BooleanFlagOn(Flags, SingleFlag)    ((BOOLEAN)((((Flags) & (SingleFlag)) != 0)))\n\n#define EXT2_ET_MAGIC_NT_IO_CHANNEL         0x10ed\n\n// Private data block\ntypedef struct _NT_PRIVATE_DATA {\n    int     magic;\n    HANDLE  handle;\n    int     flags;\n    char*   buffer;\n    __u32   buffer_block_number;\n    ULONG   buffer_size;\n    BOOLEAN read_only;\n    BOOLEAN written;\n    // Used by Rufus\n    __u64   offset;\n    __u64   size;\n} NT_PRIVATE_DATA, *PNT_PRIVATE_DATA;\n\n//\n// Standard interface prototypes\n//\n\nstatic errcode_t nt_open(const char *name, int flags, io_channel *channel);\nstatic errcode_t nt_close(io_channel channel);\nstatic errcode_t nt_set_blksize(io_channel channel, int blksize);\nstatic errcode_t nt_read_blk(io_channel channel, unsigned long block, int count, void *data);\nstatic errcode_t nt_read_blk64(io_channel channel, unsigned long long block, int count, void* data);\nstatic errcode_t nt_write_blk(io_channel channel, unsigned long block, int count, const void *data);\nstatic errcode_t nt_write_blk64(io_channel channel, unsigned long long block, int count, const void* data);\nstatic errcode_t nt_flush(io_channel channel);\n\nstruct struct_io_manager struct_nt_manager = {\n\t.magic\t\t= EXT2_ET_MAGIC_IO_MANAGER,\n\t.name\t\t= \"NT I/O Manager\",\n\t.open\t\t= nt_open,\n\t.close\t\t= nt_close,\n\t.set_blksize\t= nt_set_blksize,\n\t.read_blk\t= nt_read_blk,\n\t.read_blk64\t= nt_read_blk64,\n\t.write_blk\t= nt_write_blk,\n\t.write_blk64\t= nt_write_blk64,\n\t.flush\t\t= nt_flush\n};\n\nio_manager nt_io_manager = &struct_nt_manager;\n\n// Convert Win32 errors to unix errno\ntypedef struct {\n\tULONG WinError;\n\tint errnocode;\n} ERROR_ENTRY;\n\nstatic ERROR_ENTRY ErrorTable[] = {\n        {  ERROR_INVALID_FUNCTION,       EINVAL    },\n        {  ERROR_FILE_NOT_FOUND,         ENOENT    },\n        {  ERROR_PATH_NOT_FOUND,         ENOENT    },\n        {  ERROR_TOO_MANY_OPEN_FILES,    EMFILE    },\n        {  ERROR_ACCESS_DENIED,          EACCES    },\n        {  ERROR_INVALID_HANDLE,         EBADF     },\n        {  ERROR_ARENA_TRASHED,          ENOMEM    },\n        {  ERROR_NOT_ENOUGH_MEMORY,      ENOMEM    },\n        {  ERROR_INVALID_BLOCK,          ENOMEM    },\n        {  ERROR_BAD_ENVIRONMENT,        E2BIG     },\n        {  ERROR_BAD_FORMAT,             ENOEXEC   },\n        {  ERROR_INVALID_ACCESS,         EINVAL    },\n        {  ERROR_INVALID_DATA,           EINVAL    },\n        {  ERROR_INVALID_DRIVE,          ENOENT    },\n        {  ERROR_CURRENT_DIRECTORY,      EACCES    },\n        {  ERROR_NOT_SAME_DEVICE,        EXDEV     },\n        {  ERROR_NO_MORE_FILES,          ENOENT    },\n        {  ERROR_LOCK_VIOLATION,         EACCES    },\n        {  ERROR_BAD_NETPATH,            ENOENT    },\n        {  ERROR_NETWORK_ACCESS_DENIED,  EACCES    },\n        {  ERROR_BAD_NET_NAME,           ENOENT    },\n        {  ERROR_FILE_EXISTS,            EEXIST    },\n        {  ERROR_CANNOT_MAKE,            EACCES    },\n        {  ERROR_FAIL_I24,               EACCES    },\n        {  ERROR_INVALID_PARAMETER,      EINVAL    },\n        {  ERROR_NO_PROC_SLOTS,          EAGAIN    },\n        {  ERROR_DRIVE_LOCKED,           EACCES    },\n        {  ERROR_BROKEN_PIPE,            EPIPE     },\n        {  ERROR_DISK_FULL,              ENOSPC    },\n        {  ERROR_INVALID_TARGET_HANDLE,  EBADF     },\n        {  ERROR_INVALID_HANDLE,         EINVAL    },\n        {  ERROR_WAIT_NO_CHILDREN,       ECHILD    },\n        {  ERROR_CHILD_NOT_COMPLETE,     ECHILD    },\n        {  ERROR_DIRECT_ACCESS_HANDLE,   EBADF     },\n        {  ERROR_NEGATIVE_SEEK,          EINVAL    },\n        {  ERROR_SEEK_ON_DEVICE,         EACCES    },\n        {  ERROR_DIR_NOT_EMPTY,          ENOTEMPTY },\n        {  ERROR_NOT_LOCKED,             EACCES    },\n        {  ERROR_BAD_PATHNAME,           ENOENT    },\n        {  ERROR_MAX_THRDS_REACHED,      EAGAIN    },\n        {  ERROR_LOCK_FAILED,            EACCES    },\n        {  ERROR_ALREADY_EXISTS,         EEXIST    },\n        {  ERROR_FILENAME_EXCED_RANGE,   ENOENT    },\n        {  ERROR_NESTING_NOT_ALLOWED,    EAGAIN    },\n        {  ERROR_NOT_ENOUGH_QUOTA,       ENOMEM    }\n};\n\nstatic unsigned _MapDosError(IN ULONG WinError)\n{\n\tint i;\n\n\tLastWinError = WinError;\n\tfor (i = 0; i < (sizeof(ErrorTable)/sizeof(ErrorTable[0])); ++i) {\n\t\tif (WinError == ErrorTable[i].WinError) {\n\t\t\treturn ErrorTable[i].errnocode;\n\t\t}\n\t}\n\n\t// Not in table. Check ranges\n\tif ((WinError >= ERROR_WRITE_PROTECT) && (WinError <= ERROR_SHARING_BUFFER_EXCEEDED))\n\t\treturn EACCES;\n\telse if ((WinError >= ERROR_INVALID_STARTING_CODESEG) && (WinError <= ERROR_INFLOOP_IN_RELOC_CHAIN))\n\t\treturn ENOEXEC;\n\telse\n\t\treturn EINVAL;\n}\n\n// Map NT status to dos error.\nstatic __inline unsigned _MapNtStatus(IN NTSTATUS Status)\n{\n\treturn _MapDosError(RtlNtStatusToDosError(Status));\n}\n\n// Return the last Windows Error\nDWORD ext2_last_winerror(DWORD default_error)\n{\n\treturn RUFUS_ERROR(LastWinError ? LastWinError : default_error);\n}\n\n//\n// Helper functions\n//\nstatic NTSTATUS _OpenNtName(IN PCSTR Name, IN BOOLEAN Readonly, OUT PHANDLE Handle, OUT PBOOLEAN OpenedReadonly OPTIONAL)\n{\n\tUNICODE_STRING UnicodeString;\n\tWCHAR Buffer[512];\n\tNTSTATUS Status = EFAULT;\n\tOBJECT_ATTRIBUTES ObjectAttributes;\n\tIO_STATUS_BLOCK IoStatusBlock;\n\n\t// Make Unicode name from input string\n\tutf8_to_wchar_no_alloc(Name, Buffer, ARRAYSIZE(Buffer));\n\tUnicodeString.Buffer = Buffer;\n\tUnicodeString.Length = (USHORT) wcslen(Buffer) * 2;\n\tUnicodeString.MaximumLength = sizeof(Buffer); // in bytes!!!\n\n\t// Initialize object\n\tInitializeObjectAttributes(&ObjectAttributes, &UnicodeString, OBJ_CASE_INSENSITIVE, NULL, NULL);\n\n\t// Try to open it in initial mode\n\tif (ARGUMENT_PRESENT(OpenedReadonly))\n\t\t*OpenedReadonly = Readonly;\n\n\tStatus = NtOpenFile(Handle, SYNCHRONIZE | FILE_READ_DATA | (Readonly ? 0 : FILE_WRITE_DATA),\n\t\t\t      &ObjectAttributes, &IoStatusBlock, FILE_SHARE_WRITE | FILE_SHARE_READ,\n\t\t\t      FILE_SYNCHRONOUS_IO_NONALERT);\n\tif (!NT_SUCCESS(Status)) {\n\t\t// Maybe was just mounted? wait 0.5 sec and retry.\n\t\tLARGE_INTEGER Interval;\n\t\tInterval.QuadPart = -5000000; // 0.5 sec. from now\n\t\tNtDelayExecution(FALSE, &Interval);\n\n\t\tStatus = NtOpenFile(Handle, SYNCHRONIZE | FILE_READ_DATA | (Readonly ? 0 : FILE_WRITE_DATA),\n\t\t\t\t      &ObjectAttributes, &IoStatusBlock, FILE_SHARE_WRITE | FILE_SHARE_READ,\n\t\t\t\t      FILE_SYNCHRONOUS_IO_NONALERT);\n\n\t\t// Try to satisfy mode\n\t\tif ((Status == STATUS_ACCESS_DENIED) && !Readonly) {\n\t\t\tif (ARGUMENT_PRESENT(OpenedReadonly))\n\t\t\t\t*OpenedReadonly = TRUE;\n\n\t\t\tStatus = NtOpenFile(Handle, SYNCHRONIZE | FILE_READ_DATA, &ObjectAttributes,\n\t\t\t\t\t      &IoStatusBlock, FILE_SHARE_WRITE | FILE_SHARE_READ,\n\t\t\t\t\t      FILE_SYNCHRONOUS_IO_NONALERT);\n\t\t}\n\t}\n\n\treturn Status;\n}\n\nstatic NTSTATUS _OpenDriveLetter(IN CHAR Letter, IN BOOLEAN ReadOnly, OUT PHANDLE Handle, OUT PBOOLEAN OpenedReadonly OPTIONAL)\n{\n\tCHAR Buffer[100];\n\tsprintf(Buffer, \"\\\\DosDevices\\\\%c:\", Letter);\n\treturn _OpenNtName(Buffer, ReadOnly, Handle, OpenedReadonly);\n}\n\nstatic __inline NTSTATUS _FlushDrive(IN HANDLE Handle)\n{\n\tIO_STATUS_BLOCK IoStatusBlock;\n\treturn NtFlushBuffersFile(Handle, &IoStatusBlock);\n}\n\n\nstatic __inline NTSTATUS _LockDrive(IN HANDLE Handle)\n{\n\tIO_STATUS_BLOCK IoStatusBlock;\n\treturn NtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_LOCK_VOLUME, 0, 0, 0, 0);\n}\n\n\nstatic __inline NTSTATUS _UnlockDrive(IN HANDLE Handle)\n{\n\tIO_STATUS_BLOCK IoStatusBlock;\n\treturn NtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_UNLOCK_VOLUME, 0, 0, 0, 0);\n}\n\nstatic __inline NTSTATUS _DismountDrive(IN HANDLE Handle)\n{\n\tIO_STATUS_BLOCK IoStatusBlock;\n\treturn NtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_DISMOUNT_VOLUME, 0, 0, 0, 0);\n}\n\nstatic __inline BOOLEAN _IsMounted(IN HANDLE Handle)\n{\n\tIO_STATUS_BLOCK IoStatusBlock;\n\treturn (BOOLEAN)(NtFsControlFile(Handle, 0, 0, 0, &IoStatusBlock, FSCTL_IS_VOLUME_MOUNTED, 0, 0, 0, 0) == STATUS_SUCCESS);\n}\n\nstatic __inline NTSTATUS _CloseDisk(IN HANDLE Handle)\n{\n\treturn NtClose(Handle);\n}\n\nstatic PCSTR _NormalizeDeviceName(IN PCSTR Device, IN PSTR NormalizedDeviceNameBuffer, OUT __u64 *Offset, OUT __u64 *Size)\n{\n\t*Offset = *Size = 0ULL;\n\t// Convert non NT paths to NT\n\tif (Device[0] == '\\\\') {\n\t\tif ((strlen(Device) < 4) || (Device[3] != '\\\\'))\n\t\t\treturn Device;\n\t\t// Handle custom paths of the form \"<Physical> <Offset> <Size>\" used by Rufus to\n\t\t// enable multi-partition access on removable devices, for pre 1703 platforms.\n\t\tif (sscanf(Device, \"%s %I64u %I64u\", NormalizedDeviceNameBuffer, Offset, Size) < 1)\n\t\t\treturn NULL;\n\t\tif ((NormalizedDeviceNameBuffer[1] == '\\\\') || (NormalizedDeviceNameBuffer[1] == '.'))\n\t\t\tNormalizedDeviceNameBuffer[1] = '?';\n\t\tif (NormalizedDeviceNameBuffer[2] == '.')\n\t\t\tNormalizedDeviceNameBuffer[2] = '?';\n\t\treturn NormalizedDeviceNameBuffer;\n\t}\n\n\t// Don't allow the conversion of non absolute paths.\n\t// Too easy to get a C:\\ drive altered on a mishap otherwise...\n\treturn NULL;\n}\n\nstatic VOID _GetDeviceSize(IN HANDLE h, OUT unsigned __int64 *FsSize)\n{\n\tPARTITION_INFORMATION_EX pi;\n\tDISK_GEOMETRY_EX gi;\n\tNTSTATUS Status;\n\tIO_STATUS_BLOCK IoStatusBlock;\n\tLARGE_INTEGER li;\n\n\t*FsSize = 0;\n\n\tRtlZeroMemory(&pi, sizeof(pi));\n\tStatus = NtDeviceIoControlFile(h, NULL, NULL, NULL, &IoStatusBlock,\n\t\t\t\t\t IOCTL_DISK_GET_PARTITION_INFO_EX,\n\t\t\t\t\t &pi, sizeof(pi), &pi, sizeof(pi));\n\tif (NT_SUCCESS(Status)) {\n\t\t*FsSize = pi.PartitionLength.QuadPart;\n\t} else if (Status == STATUS_INVALID_DEVICE_REQUEST) {\n\t\t// No partitions: Try a drive geometry request\n\t\tRtlZeroMemory(&gi, sizeof(gi));\n\n\t\tStatus = NtDeviceIoControlFile(h, NULL, NULL, NULL, &IoStatusBlock,\n\t\t\t\t\t\t IOCTL_DISK_GET_DRIVE_GEOMETRY_EX,\n\t\t\t\t\t\t &gi, sizeof(gi), &gi, sizeof(gi));\n\n\t\tif (NT_SUCCESS(Status))\n\t\t\t*FsSize = gi.DiskSize.QuadPart;\n\t} else if (Status == STATUS_INVALID_PARAMETER) {\n\t\t// Possibly a straight image file\n\t\tif (GetFileSizeEx(h, &li))\n\t\t\t*FsSize = li.QuadPart;\n\t}\n}\n\nstatic BOOLEAN _Ext2OpenDevice(IN PCSTR Name, IN BOOLEAN ReadOnly, OUT PHANDLE Handle,\n\tOUT __u64 *Offset, OUT __u64 *Size, OUT PBOOLEAN OpenedReadonly OPTIONAL, OUT errcode_t *Errno OPTIONAL)\n{\n\tCHAR NormalizedDeviceName[512];\n\tNTSTATUS Status;\n\n\tLastWinError = 0;\n\tif (Name == NULL) {\n\t\tLastWinError = ERROR_INVALID_PARAMETER;\n\t\tif (ARGUMENT_PRESENT(Errno))\n\t\t\t*Errno = ENOENT;\n\t\treturn FALSE;\n\t}\n\n\tif ((((*Name) | 0x20) >= 'a') && (((*Name) | 0x20) <= 'z') &&\n\t\t(':' == *(Name + 1)) && ('\\0' == *(Name + 2))) {\n\t\tStatus = _OpenDriveLetter(*Name, ReadOnly, Handle, OpenedReadonly);\n\t} else {\n\t\tName = _NormalizeDeviceName(Name, NormalizedDeviceName, Offset, Size);\n\t\tif (Name == NULL) {\n\t\t\tLastWinError = ERROR_INVALID_PARAMETER;\n\t\t\tif (ARGUMENT_PRESENT(Errno))\n\t\t\t\t*Errno = ENOENT;\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tStatus = _OpenNtName(Name, ReadOnly, Handle, OpenedReadonly);\n\t}\n\n\tif (!NT_SUCCESS(Status)) {\n\t\tif (ARGUMENT_PRESENT(Errno))\n\t\t\t*Errno = _MapNtStatus(Status);\n\t\treturn FALSE;\n\t}\n\n\treturn TRUE;\n}\n\nstatic BOOLEAN _BlockIo(IN HANDLE Handle, IN LARGE_INTEGER Offset, IN ULONG Bytes, IN OUT PCHAR Buffer, IN BOOLEAN Read, OUT errcode_t *Errno OPTIONAL)\n{\n\tIO_STATUS_BLOCK IoStatusBlock;\n\tNTSTATUS Status = STATUS_DLL_NOT_FOUND;\n\n\t// Should be aligned\n\tassert((Bytes % 512) == 0);\n\tassert((Offset.LowPart % 512) == 0);\n\n\tLastWinError = 0;\n\t// Perform io\n\tif(Read) {\n\t\tStatus = NtReadFile(Handle, NULL, NULL, NULL,\n\t\t\t&IoStatusBlock, Buffer, Bytes, &Offset, NULL);\n\t} else\t{\n\t\tStatus = NtWriteFile(Handle, NULL, NULL, NULL,\n\t\t\t&IoStatusBlock, Buffer, Bytes, &Offset, NULL);\n\t}\n\n\tif (!NT_SUCCESS(Status)) {\n\t\tif (ARGUMENT_PRESENT(Errno))\n\t\t\t*Errno = _MapNtStatus(Status);\n\t\treturn FALSE;\n\t}\n\n\tif (ARGUMENT_PRESENT(Errno))\n\t\t*Errno = 0;\n\treturn TRUE;\n}\n\nstatic BOOLEAN _RawWrite(IN HANDLE Handle, IN LARGE_INTEGER Offset, IN ULONG Bytes, OUT const CHAR* Buffer, OUT errcode_t* Errno)\n{\n\treturn _BlockIo(Handle, Offset, Bytes, (PCHAR)Buffer, FALSE, Errno);\n}\n\nstatic BOOLEAN _RawRead(IN HANDLE Handle, IN LARGE_INTEGER Offset, IN ULONG Bytes, IN PCHAR Buffer, OUT errcode_t* Errno)\n{\n\treturn _BlockIo(Handle, Offset, Bytes, Buffer, TRUE, Errno);\n}\n\nstatic BOOLEAN _SetPartType(IN HANDLE Handle, IN UCHAR Type)\n{\n\tIO_STATUS_BLOCK IoStatusBlock;\n\treturn NT_SUCCESS(NtDeviceIoControlFile(Handle, NULL, NULL, NULL, &IoStatusBlock,\n\t\t\t\t\t\t  IOCTL_DISK_SET_PARTITION_INFO, &Type, sizeof(Type), NULL, 0));\n}\n\n//\n// Interface functions.\n// Is_mounted is set to 1 if the device is mounted, 0 otherwise\n//\nerrcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags)\n{\n\terrcode_t errcode = 0;\n\t__u64 Offset, Size;\n\tHANDLE h;\n\tBOOLEAN Readonly;\n\n\t*mount_flags = 0;\n\n\tif (!_Ext2OpenDevice(file, TRUE, &h, &Offset, &Size, &Readonly, &errcode))\n\t\treturn errcode;\n\n\t*mount_flags &= _IsMounted(h) ? EXT2_MF_MOUNTED : 0;\n\t_CloseDisk(h);\n\n\treturn 0;\n}\n\n// Not implemented\nerrcode_t ext2fs_check_mount_point(const char *file, int *mount_flags, char *mtpt, int mtlen)\n{\n\treturn EXT2_ET_OP_NOT_SUPPORTED;\n}\n\n// Returns the number of blocks in a partition\n// Note: Do *NOT* be tempted to cache the device size according to the NT path as\n// different removable devices (e.g. UFD) may be remounted under the same path.\nerrcode_t ext2fs_get_device_size2(const char *file, int blocksize, blk64_t *retblocks)\n{\n\terrcode_t errcode = 0;\n\t__u64 Offset, Size = 0;\n\tHANDLE h;\n\tBOOLEAN Readonly;\n\n\tif (!_Ext2OpenDevice(file, TRUE, &h, &Offset, &Size, &Readonly, &errcode))\n\t\treturn errcode;\n\n\tif (Size == 0LL)\n\t\t_GetDeviceSize(h, &Size);\n\t_CloseDisk(h);\n\n\t*retblocks = (blk64_t)(Size / blocksize);\n\treturn 0;\n}\n\n\n//\n// Table elements\n//\nstatic errcode_t nt_open(const char *name, int flags, io_channel *channel)\n{\n\tio_channel io = NULL;\n\tPNT_PRIVATE_DATA nt_data = NULL;\n\terrcode_t errcode = 0;\n\n\tif (name == NULL)\n\t\treturn EXT2_ET_BAD_DEVICE_NAME;\n\n\t// Allocate buffers\n\tio = (io_channel) calloc(1, sizeof(struct struct_io_channel));\n\tif (io == NULL) {\n\t\terrcode = ENOMEM;\n\t\tgoto out;\n\t}\n\n\tio->name = calloc(strlen(name) + 1, 1);\n\tif (io->name == NULL) {\n\t\terrcode = ENOMEM;\n\t\tgoto out;\n\t}\n\n\tnt_data = (PNT_PRIVATE_DATA) calloc(1, sizeof(NT_PRIVATE_DATA));\n\tif (nt_data == NULL) {\n\t\terrcode = ENOMEM;\n\t\tgoto out;\n\t}\n\n\tnt_data->buffer = malloc(EXT2_MIN_BLOCK_SIZE);\n\tif (nt_data->buffer == NULL) {\n\t\terrcode = ENOMEM;\n\t\tgoto out;\n\t}\n\n\t// Initialize data\n\tio->magic = EXT2_ET_MAGIC_IO_CHANNEL;\n\tio->manager = nt_io_manager;\n\tstrcpy(io->name, name);\n\tio->block_size = EXT2_MIN_BLOCK_SIZE;\n\tio->refcount = 1;\n\n\tnt_data->magic = EXT2_ET_MAGIC_NT_IO_CHANNEL;\n\tnt_data->buffer_block_number = 0xffffffff;\n\tnt_data->buffer_size = EXT2_MIN_BLOCK_SIZE;\n\tio->private_data = nt_data;\n\n\t// Open the device\n\tif (!_Ext2OpenDevice(name, (BOOLEAN)!BooleanFlagOn(flags, EXT2_FLAG_RW), &nt_data->handle,\n\t\t&nt_data->offset, &nt_data->size, &nt_data->read_only, &errcode)) {\n\t\tif (!errcode)\n\t\t\terrcode = EIO;\n\t\tgoto out;\n\t}\n\n\t// Done\n\t*channel = io;\n\nout:\n\tif (errcode) {\n\t\tif (io != NULL) {\n\t\t\tfree(io->name);\n\t\t\tfree(io);\n\t\t}\n\n\t\tif (nt_data != NULL) {\n\t\t\tif (nt_data->handle != NULL) {\n\t\t\t\t_UnlockDrive(nt_data->handle);\n\t\t\t\t_CloseDisk(nt_data->handle);\n\t\t\t}\n\t\t\tfree(nt_data->buffer);\n\t\t\tfree(nt_data);\n\t\t}\n\t}\n\n\treturn errcode;\n}\n\nstatic errcode_t nt_close(io_channel channel)\n{\n\tPNT_PRIVATE_DATA nt_data = NULL;\n\n\tif (channel == NULL)\n\t\treturn 0;\n\n\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n\tnt_data = (PNT_PRIVATE_DATA) channel->private_data;\n\tEXT2_CHECK_MAGIC(nt_data, EXT2_ET_MAGIC_NT_IO_CHANNEL);\n\n\tif (--channel->refcount > 0)\n\t\treturn 0;\n\n\tfree(channel->name);\n\tfree(channel);\n\n\tif (nt_data != NULL) {\n\t\tif (nt_data->handle != NULL)\n\t\t\tCloseHandle(nt_data->handle);\n\t\tfree(nt_data->buffer);\n\t\tfree(nt_data);\n\t}\n\n\treturn 0;\n}\n\nstatic errcode_t nt_set_blksize(io_channel channel, int blksize)\n{\n\tPNT_PRIVATE_DATA nt_data = NULL;\n\n\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n\tnt_data = (PNT_PRIVATE_DATA) channel->private_data;\n\tEXT2_CHECK_MAGIC(nt_data, EXT2_ET_MAGIC_NT_IO_CHANNEL);\n\n\tif (channel->block_size != blksize) {\n\t\tchannel->block_size = blksize;\n\n\t\tfree(nt_data->buffer);\n\t\tnt_data->buffer_block_number = 0xffffffff;\n\t\tnt_data->buffer_size = channel->block_size;\n\t\tassert((nt_data->buffer_size % 512) == 0);\n\n\t\tnt_data->buffer = malloc(nt_data->buffer_size);\n\t\tif (nt_data->buffer == NULL)\n\t\t\treturn ENOMEM;\n\t}\n\n\treturn 0;\n}\n\nstatic errcode_t nt_read_blk64(io_channel channel, unsigned long long block, int count, void *buf)\n{\n\tPVOID read_buffer;\n\tULONG read_size;\n\tULONG size;\n\tLARGE_INTEGER offset;\n\tPNT_PRIVATE_DATA nt_data = NULL;\n\terrcode_t errcode = 0;\n\n\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n\tnt_data = (PNT_PRIVATE_DATA) channel->private_data;\n\tEXT2_CHECK_MAGIC(nt_data, EXT2_ET_MAGIC_NT_IO_CHANNEL);\n\n\t// If it's in the cache, use it!\n\tif ((count == 1) && (block == nt_data->buffer_block_number) &&\n\t    (nt_data->buffer_block_number != 0xffffffff)) {\n\t\tmemcpy(buf, nt_data->buffer, channel->block_size);\n\t\treturn 0;\n\t}\n\n\tsize = (count < 0) ? (ULONG)(-count) : (ULONG)(count * channel->block_size);\n\n\toffset.QuadPart = block * channel->block_size + nt_data->offset;\n\n\t// If not fit to the block\n\tif (size <= nt_data->buffer_size) {\n\t\t// Update the cache\n\t\tnt_data->buffer_block_number = block;\n\t\tread_buffer = nt_data->buffer;\n\t\tread_size = nt_data->buffer_size;\n\t} else {\n\t\tread_size = size;\n\t\tread_buffer = buf;\n\t\tassert((read_size % channel->block_size) == 0);\n\t}\n\n\tif (!_RawRead(nt_data->handle, offset, read_size, read_buffer, &errcode)) {\n\t\tif (channel->read_error)\n\t\t\treturn (channel->read_error)(channel, block, count, buf, size, 0, errcode);\n\t\telse\n\t\t\treturn errcode;\n\t}\n\n\tif (read_buffer != buf) {\n\t\tassert(size <= read_size);\n\t\tmemcpy(buf, read_buffer, size);\n\t}\n\n\treturn 0;\n}\n\nstatic errcode_t nt_read_blk(io_channel channel, unsigned long block, int count, void* buf)\n{\n\treturn nt_read_blk64(channel, block, count, buf);\n}\n\nstatic errcode_t nt_write_blk64(io_channel channel, unsigned long long block, int count, const void *buf)\n{\n\tULONG write_size;\n\tLARGE_INTEGER offset;\n\tPNT_PRIVATE_DATA nt_data = NULL;\n\terrcode_t errcode = 0;\n\n\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n\tnt_data = (PNT_PRIVATE_DATA) channel->private_data;\n\tEXT2_CHECK_MAGIC(nt_data, EXT2_ET_MAGIC_NT_IO_CHANNEL);\n\n\tif (nt_data->read_only)\n\t\treturn EACCES;\n\n\tif (count == 1) {\n\t\twrite_size = channel->block_size;\n\t} else {\n\t\tnt_data->buffer_block_number = 0xffffffff;\n\t\tif (count < 0)\n\t\t\twrite_size = (ULONG)(-count);\n\t\telse\n\t\t\twrite_size = (ULONG)(count * channel->block_size);\n\t}\n\n\n\tassert((write_size % 512) == 0);\n\toffset.QuadPart = block * channel->block_size + nt_data->offset;\n\n\tif (!_RawWrite(nt_data->handle, offset, write_size, buf, &errcode)) {\n\t\tif (channel->write_error)\n\t\t\treturn (channel->write_error)(channel, block, count, buf, write_size, 0, errcode);\n\t\telse\n\t\t\treturn errcode;\n\t}\n\n\n\t// Stash a copy.\n\tif(write_size >= nt_data->buffer_size) {\n\t\tnt_data->buffer_block_number = block;\n\t\tmemcpy(nt_data->buffer, buf, nt_data->buffer_size);\n\t}\n\n\tnt_data->written = TRUE;\n\n\treturn 0;\n}\n\nstatic errcode_t nt_write_blk(io_channel channel, unsigned long block, int count, const void* buf)\n{\n\treturn nt_write_blk64(channel, block, count, buf);\n}\n\nstatic errcode_t nt_flush(io_channel channel)\n{\n\tPNT_PRIVATE_DATA nt_data = NULL;\n\n\tEXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);\n\tnt_data = (PNT_PRIVATE_DATA) channel->private_data;\n\tEXT2_CHECK_MAGIC(nt_data, EXT2_ET_MAGIC_NT_IO_CHANNEL);\n\n\tif(nt_data->read_only)\n\t\treturn 0;\n\n\n\t// Flush file buffers.\n\t_FlushDrive(nt_data->handle);\n\n\n\t// Test and correct partition type.\n\tif (nt_data->written)\n\t\t_SetPartType(nt_data->handle, 0x83);\n\n\treturn 0;\n}\n"
  },
  {
    "path": "src/ext2fs/openfs.c",
    "content": "/*\n * openfs.c --- open an ext2 filesystem\n *\n * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#ifdef HAVE_ERRNO_H\n#include <errno.h>\n#endif\n\n#include \"ext2_fs.h\"\n\n#include \"ext2fs.h\"\n#include \"e2image.h\"\n\nblk64_t ext2fs_descriptor_block_loc2(ext2_filsys fs, blk64_t group_block,\n\t\t\t\t     dgrp_t i)\n{\n\tint\tbg;\n\tint\thas_super = 0, group_zero_adjust = 0;\n\tblk64_t\tret_blk;\n\n\t/*\n\t * On a bigalloc FS with 1K blocks, block 0 is reserved for non-ext4\n\t * stuff, so adjust for that if we're being asked for group 0.\n\t */\n\tif (i == 0 && fs->blocksize == 1024 && EXT2FS_CLUSTER_RATIO(fs) > 1)\n\t\tgroup_zero_adjust = 1;\n\n\tif (!ext2fs_has_feature_meta_bg(fs->super) ||\n\t    (i < fs->super->s_first_meta_bg))\n\t\treturn group_block + i + 1 + group_zero_adjust;\n\n\tbg = EXT2_DESC_PER_BLOCK(fs->super) * i;\n\tif (ext2fs_bg_has_super(fs, bg))\n\t\thas_super = 1;\n\tret_blk = ext2fs_group_first_block2(fs, bg);\n\t/*\n\t * If group_block is not the normal value, we're trying to use\n\t * the backup group descriptors and superblock --- so use the\n\t * alternate location of the second block group in the\n\t * metablock group.  Ideally we should be testing each bg\n\t * descriptor block individually for correctness, but we don't\n\t * have the infrastructure in place to do that.\n\t */\n\tif (group_block != fs->super->s_first_data_block &&\n\t    ((ret_blk + has_super + fs->super->s_blocks_per_group) <\n\t     ext2fs_blocks_count(fs->super))) {\n\t\tret_blk += fs->super->s_blocks_per_group;\n\n\t\t/*\n\t\t * If we're going to jump forward a block group, make sure\n\t\t * that we adjust has_super to account for the next group's\n\t\t * backup superblock (or lack thereof).\n\t\t */\n\t\tif (ext2fs_bg_has_super(fs, bg + 1))\n\t\t\thas_super = 1;\n\t\telse\n\t\t\thas_super = 0;\n\t}\n\treturn ret_blk + has_super + group_zero_adjust;\n}\n\nblk_t ext2fs_descriptor_block_loc(ext2_filsys fs, blk_t group_block, dgrp_t i)\n{\n\treturn ext2fs_descriptor_block_loc2(fs, group_block, i);\n}\n\nerrcode_t ext2fs_open(const char *name, int flags, int superblock,\n\t\t      unsigned int block_size, io_manager manager,\n\t\t      ext2_filsys *ret_fs)\n{\n\treturn ext2fs_open2(name, 0, flags, superblock, block_size,\n\t\t\t    manager, ret_fs);\n}\n\nstatic void block_sha_map_free_entry(void *data)\n{\n\tfree(data);\n\treturn;\n}\n\n/*\n *  Note: if superblock is non-zero, block-size must also be non-zero.\n * \tSuperblock and block_size can be zero to use the default size.\n *\n * Valid flags for ext2fs_open()\n *\n * \tEXT2_FLAG_RW\t- Open the filesystem for read/write.\n * \tEXT2_FLAG_FORCE - Open the filesystem even if some of the\n *\t\t\t\tfeatures aren't supported.\n *\tEXT2_FLAG_JOURNAL_DEV_OK - Open an ext3 journal device\n *\tEXT2_FLAG_SKIP_MMP - Open without multi-mount protection check.\n *\tEXT2_FLAG_64BITS - Allow 64-bit bitfields (needed for large\n *\t\t\t\tfilesystems)\n */\nerrcode_t ext2fs_open2(const char *name, const char *io_options,\n\t\t       int flags, int superblock,\n\t\t       unsigned int block_size, io_manager manager,\n\t\t       ext2_filsys *ret_fs)\n{\n\text2_filsys\tfs;\n\terrcode_t\tretval;\n\tunsigned long\ti, first_meta_bg;\n\t__u32\t\tfeatures;\n\tunsigned int\tblocks_per_group, io_flags;\n\tblk64_t\t\tgroup_block, blk;\n\tchar\t\t*dest, *cp;\n\tint\t\tgroup_zero_adjust = 0;\n\tunsigned int\tinode_size;\n\t__u64\t\tgroups_cnt;\n#ifdef WORDS_BIGENDIAN\n\tunsigned int\tgroups_per_block;\n\tstruct ext2_group_desc *gdp;\n\tint\t\tj;\n#endif\n\tchar\t\t*time_env;\n\tint\t\tcsum_retries = 0;\n\n\tEXT2_CHECK_MAGIC(manager, EXT2_ET_MAGIC_IO_MANAGER);\n\n\tretval = ext2fs_get_mem(sizeof(struct struct_ext2_filsys), &fs);\n\tif (retval)\n\t\treturn retval;\n\n\tmemset(fs, 0, sizeof(struct struct_ext2_filsys));\n\tfs->magic = EXT2_ET_MAGIC_EXT2FS_FILSYS;\n\tfs->flags = flags;\n\t/* don't overwrite sb backups unless flag is explicitly cleared */\n\tfs->flags |= EXT2_FLAG_MASTER_SB_ONLY;\n\tfs->umask = 022;\n\n\ttime_env = getenv(\"E2FSPROGS_FAKE_TIME\");\n\tif (time_env)\n\t\tfs->now = strtoul(time_env, NULL, 0);\n\n\tretval = ext2fs_get_mem(strlen(name)+1, &fs->device_name);\n\tif (retval)\n\t\tgoto cleanup;\n\tstrcpy(fs->device_name, name);\n\tcp = strchr(fs->device_name, '?');\n\t// Don't process \"?\\\" as an option since some Windows device paths use \"\\\\?\\...\"\n\tif (!io_options && cp && cp[1] != '\\\\') {\n\t\t*cp++ = 0;\n\t\tio_options = cp;\n\t}\n\n\tio_flags = 0;\n\tif (flags & EXT2_FLAG_RW)\n\t\tio_flags |= IO_FLAG_RW;\n\tif (flags & EXT2_FLAG_EXCLUSIVE)\n\t\tio_flags |= IO_FLAG_EXCLUSIVE;\n\tif (flags & EXT2_FLAG_DIRECT_IO)\n\t\tio_flags |= IO_FLAG_DIRECT_IO;\n\tretval = manager->open(fs->device_name, io_flags, &fs->io);\n\tif (retval)\n\t\tgoto cleanup;\n\tif (io_options &&\n\t    (retval = io_channel_set_options(fs->io, io_options)))\n\t\tgoto cleanup;\n\tfs->image_io = fs->io;\n\tfs->io->app_data = fs;\n\tretval = io_channel_alloc_buf(fs->io, -SUPERBLOCK_SIZE, &fs->super);\n\tif (retval)\n\t\tgoto cleanup;\n\tif (flags & EXT2_FLAG_IMAGE_FILE) {\n\t\tretval = ext2fs_get_mem(sizeof(struct ext2_image_hdr),\n\t\t\t\t\t&fs->image_header);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t\tretval = io_channel_read_blk(fs->io, 0,\n\t\t\t\t\t     -(int)sizeof(struct ext2_image_hdr),\n\t\t\t\t\t     fs->image_header);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t\tif (ext2fs_le32_to_cpu(fs->image_header->magic_number) != EXT2_ET_MAGIC_E2IMAGE)\n\t\t\treturn EXT2_ET_MAGIC_E2IMAGE;\n\t\tsuperblock = 1;\n\t\tblock_size = ext2fs_le32_to_cpu(fs->image_header->fs_blocksize);\n\t}\n\n\t/*\n\t * If the user specifies a specific block # for the\n\t * superblock, then he/she must also specify the block size!\n\t * Otherwise, read the master superblock located at offset\n\t * SUPERBLOCK_OFFSET from the start of the partition.\n\t *\n\t * Note: we only save a backup copy of the superblock if we\n\t * are reading the superblock from the primary superblock location.\n\t */\n\tif (superblock) {\n\t\tif (!block_size) {\n\t\t\tretval = EXT2_ET_INVALID_ARGUMENT;\n\t\t\tgoto cleanup;\n\t\t}\n\t\tio_channel_set_blksize(fs->io, block_size);\n\t\tgroup_block = superblock;\n\t\tfs->orig_super = 0;\n\t} else {\n\t\tio_channel_set_blksize(fs->io, SUPERBLOCK_OFFSET);\n\t\tsuperblock = 1;\n\t\tgroup_block = 0;\n\t\tretval = ext2fs_get_mem(SUPERBLOCK_SIZE, &fs->orig_super);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t}\nretry:\n\tretval = io_channel_read_blk(fs->io, superblock, -SUPERBLOCK_SIZE,\n\t\t\t\t     fs->super);\n\tif (retval)\n\t\tgoto cleanup;\n\tif (fs->orig_super)\n\t\tmemcpy(fs->orig_super, fs->super, SUPERBLOCK_SIZE);\n\n\tif (!(fs->flags & EXT2_FLAG_IGNORE_CSUM_ERRORS)) {\n\t\tretval = 0;\n\t\tif (!ext2fs_verify_csum_type(fs, fs->super))\n\t\t\tretval = EXT2_ET_UNKNOWN_CSUM;\n\t\tif (!ext2fs_superblock_csum_verify(fs, fs->super)) {\n\t\t\tif (csum_retries++ < 3)\n\t\t\t\tgoto retry;\n\t\t\tretval = EXT2_ET_SB_CSUM_INVALID;\n\t\t}\n\t}\n\n#ifdef WORDS_BIGENDIAN\n\tfs->flags |= EXT2_FLAG_SWAP_BYTES;\n\text2fs_swap_super(fs->super);\n#else\n\tif (fs->flags & EXT2_FLAG_SWAP_BYTES) {\n\t\tretval = EXT2_ET_UNIMPLEMENTED;\n\t\tgoto cleanup;\n\t}\n#endif\n\n\tif (fs->super->s_magic != EXT2_SUPER_MAGIC)\n\t\tretval = EXT2_ET_BAD_MAGIC;\n\tif (retval)\n\t\tgoto cleanup;\n\n\tif (fs->super->s_rev_level > EXT2_LIB_CURRENT_REV) {\n\t\tretval = EXT2_ET_REV_TOO_HIGH;\n\t\tgoto cleanup;\n\t}\n\n\t/*\n\t * Check for feature set incompatibility\n\t */\n\tif (!(flags & EXT2_FLAG_FORCE)) {\n\t\tfeatures = fs->super->s_feature_incompat;\n#ifdef EXT2_LIB_SOFTSUPP_INCOMPAT\n\t\tif (flags & EXT2_FLAG_SOFTSUPP_FEATURES)\n\t\t\tfeatures &= ~EXT2_LIB_SOFTSUPP_INCOMPAT;\n#endif\n\t\tif (features & ~EXT2_LIB_FEATURE_INCOMPAT_SUPP) {\n\t\t\tretval = EXT2_ET_UNSUPP_FEATURE;\n\t\t\tgoto cleanup;\n\t\t}\n\n\t\tfeatures = fs->super->s_feature_ro_compat;\n#ifdef EXT2_LIB_SOFTSUPP_RO_COMPAT\n\t\tif (flags & EXT2_FLAG_SOFTSUPP_FEATURES)\n\t\t\tfeatures &= ~EXT2_LIB_SOFTSUPP_RO_COMPAT;\n#endif\n\t\tif ((flags & EXT2_FLAG_RW) &&\n\t\t    (features & ~EXT2_LIB_FEATURE_RO_COMPAT_SUPP)) {\n\t\t\tretval = EXT2_ET_RO_UNSUPP_FEATURE;\n\t\t\tgoto cleanup;\n\t\t}\n\n\t\tif (!(flags & EXT2_FLAG_JOURNAL_DEV_OK) &&\n\t\t    ext2fs_has_feature_journal_dev(fs->super)) {\n\t\t\tretval = EXT2_ET_UNSUPP_FEATURE;\n\t\t\tgoto cleanup;\n\t\t}\n\t}\n\n\tif (fs->super->s_log_block_size >\n\t    (unsigned) (EXT2_MAX_BLOCK_LOG_SIZE - EXT2_MIN_BLOCK_LOG_SIZE)) {\n\t\tretval = EXT2_ET_CORRUPT_SUPERBLOCK;\n\t\tgoto cleanup;\n\t}\n\n\t/*\n\t * bigalloc requires cluster-aware bitfield operations, which at the\n\t * moment means we need EXT2_FLAG_64BITS.\n\t */\n\tif (ext2fs_has_feature_bigalloc(fs->super) &&\n\t    !(flags & EXT2_FLAG_64BITS)) {\n\t\tretval = EXT2_ET_CANT_USE_LEGACY_BITMAPS;\n\t\tgoto cleanup;\n\t}\n\n\tif (!ext2fs_has_feature_bigalloc(fs->super) &&\n\t    (fs->super->s_log_block_size != fs->super->s_log_cluster_size)) {\n\t\tretval = EXT2_ET_CORRUPT_SUPERBLOCK;\n\t\tgoto cleanup;\n\t}\n\tfs->fragsize = fs->blocksize = EXT2_BLOCK_SIZE(fs->super);\n\tinode_size = EXT2_INODE_SIZE(fs->super);\n\tif ((inode_size < EXT2_GOOD_OLD_INODE_SIZE) ||\n\t    (inode_size > fs->blocksize) ||\n\t    (inode_size & (inode_size - 1))) {\n\t\tretval = EXT2_ET_CORRUPT_SUPERBLOCK;\n\t\tgoto cleanup;\n\t}\n\n\t/* Enforce the block group descriptor size */\n\tif (ext2fs_has_feature_64bit(fs->super)) {\n\t\tif (fs->super->s_desc_size < EXT2_MIN_DESC_SIZE_64BIT) {\n\t\t\tretval = EXT2_ET_BAD_DESC_SIZE;\n\t\t\tgoto cleanup;\n\t\t}\n\t}\n\n\tfs->cluster_ratio_bits = fs->super->s_log_cluster_size -\n\t\tfs->super->s_log_block_size;\n\tif (EXT2_BLOCKS_PER_GROUP(fs->super) !=\n\t    EXT2_CLUSTERS_PER_GROUP(fs->super) << fs->cluster_ratio_bits) {\n\t\tretval = EXT2_ET_CORRUPT_SUPERBLOCK;\n\t\tgoto cleanup;\n\t}\n\tfs->inode_blocks_per_group = ((EXT2_INODES_PER_GROUP(fs->super) *\n\t\t\t\t       EXT2_INODE_SIZE(fs->super) +\n\t\t\t\t       EXT2_BLOCK_SIZE(fs->super) - 1) /\n\t\t\t\t      EXT2_BLOCK_SIZE(fs->super));\n\tif (block_size) {\n\t\tif (block_size != fs->blocksize) {\n\t\t\tretval = EXT2_ET_UNEXPECTED_BLOCK_SIZE;\n\t\t\tgoto cleanup;\n\t\t}\n\t}\n\t/*\n\t * Set the blocksize to the filesystem's blocksize.\n\t */\n\tio_channel_set_blksize(fs->io, fs->blocksize);\n\n\t/*\n\t * If this is an external journal device, don't try to read\n\t * the group descriptors, because they're not there.\n\t */\n\tif (ext2fs_has_feature_journal_dev(fs->super)) {\n\t\tfs->group_desc_count = 0;\n\t\t*ret_fs = fs;\n\t\treturn 0;\n\t}\n\n\tif (EXT2_INODES_PER_GROUP(fs->super) == 0) {\n\t\tretval = EXT2_ET_CORRUPT_SUPERBLOCK;\n\t\tgoto cleanup;\n\t}\n\t/* Precompute the FS UUID to seed other checksums */\n\text2fs_init_csum_seed(fs);\n\n\t/*\n\t * Read group descriptors\n\t */\n\tblocks_per_group = EXT2_BLOCKS_PER_GROUP(fs->super);\n\tif (blocks_per_group == 0 ||\n\t    blocks_per_group > EXT2_MAX_BLOCKS_PER_GROUP(fs->super) ||\n\t    fs->inode_blocks_per_group > EXT2_MAX_INODES_PER_GROUP(fs->super) ||\n           EXT2_DESC_PER_BLOCK(fs->super) == 0 ||\n           fs->super->s_first_data_block >= ext2fs_blocks_count(fs->super)) {\n\t\tretval = EXT2_ET_CORRUPT_SUPERBLOCK;\n\t\tgoto cleanup;\n\t}\n\tgroups_cnt = ext2fs_div64_ceil(ext2fs_blocks_count(fs->super) -\n\t\t\t\t       fs->super->s_first_data_block,\n\t\t\t\t       blocks_per_group);\n\tif (groups_cnt >> 32) {\n\t\tretval = EXT2_ET_CORRUPT_SUPERBLOCK;\n\t\tgoto cleanup;\n\t}\n\tfs->group_desc_count = \tgroups_cnt;\n\tif (!(flags & EXT2_FLAG_IGNORE_SB_ERRORS) &&\n\t    (__u64)fs->group_desc_count * EXT2_INODES_PER_GROUP(fs->super) !=\n\t    fs->super->s_inodes_count) {\n\t\tretval = EXT2_ET_CORRUPT_SUPERBLOCK;\n\t\tgoto cleanup;\n\t}\n\tfs->desc_blocks = ext2fs_div_ceil(fs->group_desc_count,\n\t\t\t\t\t  EXT2_DESC_PER_BLOCK(fs->super));\n\tif (flags & EXT2_FLAG_SUPER_ONLY)\n\t\tgoto skip_read_bg;\n\tretval = ext2fs_get_array(fs->desc_blocks, fs->blocksize,\n\t\t\t\t&fs->group_desc);\n\tif (retval)\n\t\tgoto cleanup;\n\tif (!group_block)\n\t\tgroup_block = fs->super->s_first_data_block;\n\t/*\n\t * On a FS with a 1K blocksize, block 0 is reserved for bootloaders\n\t * so we must increment block numbers to any group 0 items.\n\t *\n\t * However, we cannot touch group_block directly because in the meta_bg\n\t * case, the ext2fs_descriptor_block_loc2() function will interpret\n\t * group_block != s_first_data_block to mean that we want to access the\n\t * backup group descriptors.  This is not what we want if the caller\n\t * set superblock == 0 (i.e. auto-detect the superblock), which is\n\t * what's going on here.\n\t */\n\tif (group_block == 0 && fs->blocksize == 1024)\n\t\tgroup_zero_adjust = 1;\n\tdest = (char *) fs->group_desc;\n#ifdef WORDS_BIGENDIAN\n\tgroups_per_block = EXT2_DESC_PER_BLOCK(fs->super);\n#endif\n\tif (ext2fs_has_feature_meta_bg(fs->super) &&\n\t    !(flags & EXT2_FLAG_IMAGE_FILE)) {\n\t\tfirst_meta_bg = fs->super->s_first_meta_bg;\n\t\tif (first_meta_bg > fs->desc_blocks)\n\t\t\tfirst_meta_bg = fs->desc_blocks;\n\t} else\n\t\tfirst_meta_bg = fs->desc_blocks;\n\tif (first_meta_bg) {\n\t\tretval = io_channel_read_blk(fs->io, group_block +\n\t\t\t\t\t     group_zero_adjust + 1,\n\t\t\t\t\t     first_meta_bg, dest);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n#ifdef WORDS_BIGENDIAN\n\t\tgdp = (struct ext2_group_desc *) dest;\n\t\tfor (j=0; j < groups_per_block*first_meta_bg; j++) {\n\t\t\tgdp = ext2fs_group_desc(fs, fs->group_desc, j);\n\t\t\tif (gdp)\n\t\t\t\text2fs_swap_group_desc2(fs, gdp);\n\t\t}\n#endif\n\t\tdest += fs->blocksize*first_meta_bg;\n\t}\n\n\tfor (i = first_meta_bg ; i < fs->desc_blocks; i++) {\n\t\tblk = ext2fs_descriptor_block_loc2(fs, group_block, i);\n\t\tio_channel_cache_readahead(fs->io, blk, 1);\n\t}\n\n\tfor (i=first_meta_bg ; i < fs->desc_blocks; i++) {\n\t\tblk = ext2fs_descriptor_block_loc2(fs, group_block, i);\n\t\tretval = io_channel_read_blk64(fs->io, blk, 1, dest);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n#ifdef WORDS_BIGENDIAN\n\t\tfor (j=0; j < groups_per_block; j++) {\n\t\t\tgdp = ext2fs_group_desc(fs, fs->group_desc,\n\t\t\t\t\t\ti * groups_per_block + j);\n\t\t\tif (gdp)\n\t\t\t\text2fs_swap_group_desc2(fs, gdp);\n\t\t}\n#endif\n\t\tdest += fs->blocksize;\n\t}\n\n\tfs->stride = fs->super->s_raid_stride;\n\n\t/*\n\t * If recovery is from backup superblock, Clear _UNININT flags &\n\t * reset bg_itable_unused to zero\n\t */\n\tif (superblock > 1 && ext2fs_has_group_desc_csum(fs)) {\n\t\tdgrp_t group;\n\n\t\tfor (group = 0; group < fs->group_desc_count; group++) {\n\t\t\text2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT);\n\t\t\text2fs_bg_flags_clear(fs, group, EXT2_BG_INODE_UNINIT);\n\t\t\text2fs_bg_itable_unused_set(fs, group, 0);\n\t\t\t/* The checksum will be reset later, but fix it here\n\t\t\t * anyway to avoid printing a lot of spurious errors. */\n\t\t\text2fs_group_desc_csum_set(fs, group);\n\t\t}\n\t\tif (fs->flags & EXT2_FLAG_RW)\n\t\t\text2fs_mark_super_dirty(fs);\n\t}\nskip_read_bg:\n\tif (ext2fs_has_feature_mmp(fs->super) &&\n\t    !(flags & EXT2_FLAG_SKIP_MMP) &&\n\t    (flags & (EXT2_FLAG_RW | EXT2_FLAG_EXCLUSIVE))) {\n\t\tretval = ext2fs_mmp_start(fs);\n\t\tif (retval) {\n\t\t\tfs->flags |= EXT2_FLAG_SKIP_MMP; /* just do cleanup */\n\t\t\text2fs_mmp_stop(fs);\n\t\t\tgoto cleanup;\n\t\t}\n\t}\n\n\tif (fs->flags & EXT2_FLAG_SHARE_DUP) {\n\t\tfs->block_sha_map = ext2fs_hashmap_create(ext2fs_djb2_hash,\n\t\t\t\t\tblock_sha_map_free_entry, 4096);\n\t\tif (!fs->block_sha_map) {\n\t\t\tretval = EXT2_ET_NO_MEMORY;\n\t\t\tgoto cleanup;\n\t\t}\n\t\text2fs_set_feature_shared_blocks(fs->super);\n\t}\n\n//\tif (ext2fs_has_feature_casefold(fs->super))\n//\t\tfs->encoding = ext2fs_load_nls_table(fs->super->s_encoding);\n\n\tfs->flags &= ~EXT2_FLAG_NOFREE_ON_ERROR;\n\t*ret_fs = fs;\n\n\treturn 0;\ncleanup:\n\tif (!(flags & EXT2_FLAG_NOFREE_ON_ERROR)) {\n\t\text2fs_free(fs);\n\t\tfs = NULL;\n\t}\n\t*ret_fs = fs;\n\treturn retval;\n}\n\n/*\n * Set/get the filesystem data I/O channel.\n *\n * These functions are only valid if EXT2_FLAG_IMAGE_FILE is true.\n */\nerrcode_t ext2fs_get_data_io(ext2_filsys fs, io_channel *old_io)\n{\n\tif ((fs->flags & EXT2_FLAG_IMAGE_FILE) == 0)\n\t\treturn EXT2_ET_NOT_IMAGE_FILE;\n\tif (old_io) {\n\t\t*old_io = (fs->image_io == fs->io) ? 0 : fs->io;\n\t}\n\treturn 0;\n}\n\nerrcode_t ext2fs_set_data_io(ext2_filsys fs, io_channel new_io)\n{\n\tif ((fs->flags & EXT2_FLAG_IMAGE_FILE) == 0)\n\t\treturn EXT2_ET_NOT_IMAGE_FILE;\n\tfs->io = new_io ? new_io : fs->image_io;\n\treturn 0;\n}\n\nerrcode_t ext2fs_rewrite_to_io(ext2_filsys fs, io_channel new_io)\n{\n\terrcode_t err;\n\n\tif ((fs->flags & EXT2_FLAG_IMAGE_FILE) == 0)\n\t\treturn EXT2_ET_NOT_IMAGE_FILE;\n\terr = io_channel_set_blksize(new_io, fs->blocksize);\n\tif (err)\n\t\treturn err;\n\tif ((new_io == fs->image_io) || (new_io == fs->io))\n\t\treturn 0;\n\tif ((fs->image_io != fs->io) &&\n\t    fs->image_io)\n\t\tio_channel_close(fs->image_io);\n\tif (fs->io)\n\t\tio_channel_close(fs->io);\n\tfs->io = fs->image_io = new_io;\n\tfs->flags |= EXT2_FLAG_DIRTY | EXT2_FLAG_RW |\n\t\tEXT2_FLAG_BB_DIRTY | EXT2_FLAG_IB_DIRTY;\n\tfs->flags &= ~EXT2_FLAG_IMAGE_FILE;\n\treturn 0;\n}\n"
  },
  {
    "path": "src/ext2fs/punch.c",
    "content": "/*\n * punch.c --- deallocate blocks allocated to an inode\n *\n * Copyright (C) 2010 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <errno.h>\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n#include \"ext2fsP.h\"\n\n#undef PUNCH_DEBUG\n\n/*\n * This function returns 1 if the specified block is all zeros\n */\nstatic int check_zero_block(char *buf, int blocksize)\n{\n\tchar\t*cp = buf;\n\tint\tleft = blocksize;\n\n\twhile (left > 0) {\n\t\tif (*cp++)\n\t\t\treturn 0;\n\t\tleft--;\n\t}\n\treturn 1;\n}\n\n/*\n * This clever recursive function handles i_blocks[] as well as\n * indirect, double indirect, and triple indirect blocks.  It iterates\n * over the entries in the i_blocks array or indirect blocks, and for\n * each one, will recursively handle any indirect blocks and then\n * frees and deallocates the blocks.\n */\nstatic errcode_t ind_punch(ext2_filsys fs, struct ext2_inode *inode,\n\t\t\t   char *block_buf, blk_t *p, int level,\n\t\t\t   blk64_t start, blk64_t count, int max)\n{\n\terrcode_t\tretval;\n\tblk_t\t\tb;\n\tint\t\ti;\n\tblk64_t\t\toffset, incr;\n\tint\t\tfreed = 0;\n\n#ifdef PUNCH_DEBUG\n\tprintf(\"Entering ind_punch, level %d, start %llu, count %llu, \"\n\t       \"max %d\\n\", level, start, count, max);\n#endif\n\tincr = 1ULL << ((EXT2_BLOCK_SIZE_BITS(fs->super) - 2) * level);\n\tfor (i = 0, offset = 0; i < max; i++, p++, offset += incr) {\n\t\tif (offset >= start + count)\n\t\t\tbreak;\n\t\tif (*p == 0 || (offset+incr) <= start)\n\t\t\tcontinue;\n\t\tb = *p;\n\t\tif (level > 0) {\n\t\t\tblk_t start2;\n#ifdef PUNCH_DEBUG\n\t\t\tprintf(\"Reading indirect block %u\\n\", b);\n#endif\n\t\t\tretval = ext2fs_read_ind_block(fs, b, block_buf);\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\t\t\tstart2 = (start > offset) ? start - offset : 0;\n\t\t\tretval = ind_punch(fs, inode, block_buf + fs->blocksize,\n\t\t\t\t\t   (blk_t *) block_buf, level - 1,\n\t\t\t\t\t   start2, count - offset,\n\t\t\t\t\t   fs->blocksize >> 2);\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\t\t\tretval = ext2fs_write_ind_block(fs, b, block_buf);\n\t\t\tif (retval)\n\t\t\t\treturn retval;\n\t\t\tif (!check_zero_block(block_buf, fs->blocksize))\n\t\t\t\tcontinue;\n\t\t}\n#ifdef PUNCH_DEBUG\n\t\tprintf(\"Freeing block %u (offset %llu)\\n\", b, offset);\n#endif\n\t\text2fs_block_alloc_stats(fs, b, -1);\n\t\t*p = 0;\n\t\tfreed++;\n\t}\n#ifdef PUNCH_DEBUG\n\tprintf(\"Freed %d blocks\\n\", freed);\n#endif\n\treturn ext2fs_iblk_sub_blocks(fs, inode, freed);\n}\n\n#define BLK_T_MAX ((blk_t)~0ULL)\nstatic errcode_t ext2fs_punch_ind(ext2_filsys fs, struct ext2_inode *inode,\n\t\t\t\t  char *block_buf, blk64_t start, blk64_t end)\n{\n\terrcode_t\t\tretval;\n\tchar\t\t\t*buf = 0;\n\tint\t\t\tlevel;\n\tint\t\t\tnum = EXT2_NDIR_BLOCKS;\n\tblk_t\t\t\t*bp = inode->i_block;\n\tblk_t\t\t\taddr_per_block;\n\tblk64_t\t\t\tmax = EXT2_NDIR_BLOCKS;\n\tblk_t\t\t\tcount;\n\n\t/* Check start/end don't overflow the 2^32-1 indirect block limit */\n\tif (start > BLK_T_MAX)\n\t\treturn 0;\n\tif (end >= BLK_T_MAX || end - start + 1 >= BLK_T_MAX)\n\t\tcount = BLK_T_MAX - start;\n\telse\n\t\tcount = end - start + 1;\n\n\tif (!block_buf) {\n\t\tretval = ext2fs_get_array(3, fs->blocksize, &buf);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tblock_buf = buf;\n\t}\n\n\taddr_per_block = (blk_t)fs->blocksize >> 2;\n\n\tfor (level = 0; level < 4; level++, max *= (blk64_t)addr_per_block) {\n#ifdef PUNCH_DEBUG\n\t\tprintf(\"Main loop level %d, start %llu count %u \"\n\t\t       \"max %llu num %d\\n\", level, start, count, max, num);\n#endif\n\t\tif (start < max) {\n\t\t\tretval = ind_punch(fs, inode, block_buf, bp, level,\n\t\t\t\t\t   start, count, num);\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\t\t\tif (count > max)\n\t\t\t\tcount -= max - start;\n\t\t\telse\n\t\t\t\tbreak;\n\t\t\tstart = 0;\n\t\t} else\n\t\t\tstart -= max;\n\t\tbp += num;\n\t\tif (level == 0) {\n\t\t\tnum = 1;\n\t\t\tmax = 1;\n\t\t}\n\t}\n\tretval = 0;\nerrout:\n\tif (buf)\n\t\text2fs_free_mem(&buf);\n\treturn retval;\n}\n#undef BLK_T_MAX\n\n#ifdef PUNCH_DEBUG\n\n#define dbg_printf(f, a...)  printf(f, ## a)\n\nstatic void dbg_print_extent(char *desc, struct ext2fs_extent *extent)\n{\n\tif (desc)\n\t\tprintf(\"%s: \", desc);\n\tprintf(\"extent: lblk %llu--%llu, len %u, pblk %llu, flags: \",\n\t       extent->e_lblk, extent->e_lblk + extent->e_len - 1,\n\t       extent->e_len, extent->e_pblk);\n\tif (extent->e_flags & EXT2_EXTENT_FLAGS_LEAF)\n\t\tfputs(\"LEAF \", stdout);\n\tif (extent->e_flags & EXT2_EXTENT_FLAGS_UNINIT)\n\t\tfputs(\"UNINIT \", stdout);\n\tif (extent->e_flags & EXT2_EXTENT_FLAGS_SECOND_VISIT)\n\t\tfputs(\"2ND_VISIT \", stdout);\n\tif (!extent->e_flags)\n\t\tfputs(\"(none)\", stdout);\n\tfputc('\\n', stdout);\n\n}\n#else\n#define dbg_print_extent(desc, ex)\tdo { } while (0)\n#define dbg_printf(f, ...)\t\tdo { } while (0)\n#endif\n\n/* Free a range of blocks, respecting cluster boundaries */\nstatic errcode_t punch_extent_blocks(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t     struct ext2_inode *inode,\n\t\t\t\t     blk64_t lfree_start, blk64_t free_start,\n\t\t\t\t     __u32 free_count, int *freed)\n{\n\tblk64_t\t\tpblk;\n\tint\t\tfreed_now = 0;\n\t__u32\t\tcluster_freed;\n\terrcode_t\tretval = 0;\n\n\t/* No bigalloc?  Just free each block. */\n\tif (EXT2FS_CLUSTER_RATIO(fs) == 1) {\n\t\t*freed += free_count;\n\t\twhile (free_count-- > 0)\n\t\t\text2fs_block_alloc_stats2(fs, free_start++, -1);\n\t\treturn retval;\n\t}\n\n\t/*\n\t * Try to free up to the next cluster boundary.  We assume that all\n\t * blocks in a logical cluster map to blocks from the same physical\n\t * cluster, and that the offsets within the [pl]clusters match.\n\t */\n\tif (free_start & EXT2FS_CLUSTER_MASK(fs)) {\n\t\tretval = ext2fs_map_cluster_block(fs, ino, inode,\n\t\t\t\t\t\t  lfree_start, &pblk);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t\tif (!pblk) {\n\t\t\text2fs_block_alloc_stats2(fs, free_start, -1);\n\t\t\tfreed_now++;\n\t\t}\n\t\tcluster_freed = EXT2FS_CLUSTER_RATIO(fs) -\n\t\t\t(free_start & EXT2FS_CLUSTER_MASK(fs));\n\t\tif (cluster_freed > free_count)\n\t\t\tcluster_freed = free_count;\n\t\tfree_count -= cluster_freed;\n\t\tfree_start += cluster_freed;\n\t\tlfree_start += cluster_freed;\n\t}\n\n\t/* Free whole clusters from the middle of the range. */\n\twhile (free_count > 0 && free_count >= (unsigned) EXT2FS_CLUSTER_RATIO(fs)) {\n\t\text2fs_block_alloc_stats2(fs, free_start, -1);\n\t\tfreed_now++;\n\t\tcluster_freed = EXT2FS_CLUSTER_RATIO(fs);\n\t\tfree_count -= cluster_freed;\n\t\tfree_start += cluster_freed;\n\t\tlfree_start += cluster_freed;\n\t}\n\n\t/* Try to free the last cluster. */\n\tif (free_count > 0) {\n\t\tretval = ext2fs_map_cluster_block(fs, ino, inode,\n\t\t\t\t\t\t  lfree_start, &pblk);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t\tif (!pblk) {\n\t\t\text2fs_block_alloc_stats2(fs, free_start, -1);\n\t\t\tfreed_now++;\n\t\t}\n\t}\n\nerrout:\n\t*freed += freed_now;\n\treturn retval;\n}\n\nstatic errcode_t ext2fs_punch_extent(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t     struct ext2_inode *inode,\n\t\t\t\t     blk64_t start, blk64_t end)\n{\n\text2_extent_handle_t\thandle = 0;\n\tstruct ext2fs_extent\textent;\n\terrcode_t\t\tretval;\n\tblk64_t\t\t\tfree_start, next, lfree_start;\n\t__u32\t\t\tfree_count, newlen;\n\tint\t\t\tfreed = 0;\n\tint\t\t\top;\n\n\tretval = ext2fs_extent_open2(fs, ino, inode, &handle);\n\tif (retval)\n\t\treturn retval;\n\t/*\n\t * Find the extent closest to the start of the punch range.  We don't\n\t * check the return value because _goto() sets the current node to the\n\t * next-lowest extent if 'start' is in a hole, and doesn't set a\n\t * current node if there was a real error reading the extent tree.\n\t * In that case, _get() will error out.\n\t *\n\t * Note: If _get() returns 'no current node', that simply means that\n\t * there aren't any blocks mapped past this point in the file, so we're\n\t * done.\n\t */\n\tretval = ext2fs_extent_goto(handle, start);\n\tif (retval)\n\t\tgoto errout;\n\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT, &extent);\n\tif (retval == EXT2_ET_NO_CURRENT_NODE) {\n\t\tretval = 0;\n\t\tgoto errout;\n\t} else if (retval)\n\t\tgoto errout;\n\twhile (1) {\n\t\top = EXT2_EXTENT_NEXT_LEAF;\n\t\tdbg_print_extent(\"main loop\", &extent);\n\t\tnext = extent.e_lblk + extent.e_len;\n\t\tdbg_printf(\"start %llu, end %llu, next %llu\\n\",\n\t\t\t   (unsigned long long) start,\n\t\t\t   (unsigned long long) end,\n\t\t\t   (unsigned long long) next);\n\t\tif (start <= extent.e_lblk) {\n\t\t\t/*\n\t\t\t * Have we iterated past the end of the punch region?\n\t\t\t * If so, we can stop.\n\t\t\t */\n\t\t\tif (end < extent.e_lblk)\n\t\t\t\tbreak;\n\t\t\tdbg_printf(\"Case #%d\\n\", 1);\n\t\t\t/* Start of deleted region before extent; \n\t\t\t   adjust beginning of extent */\n\t\t\tfree_start = extent.e_pblk;\n\t\t\tlfree_start = extent.e_lblk;\n\t\t\tif (next > end)\n\t\t\t\tfree_count = end - extent.e_lblk + 1;\n\t\t\telse\n\t\t\t\tfree_count = extent.e_len;\n\t\t\textent.e_len -= free_count;\n\t\t\textent.e_lblk += free_count;\n\t\t\textent.e_pblk += free_count;\n\t\t} else if (end >= next-1) {\n\t\t\t/*\n\t\t\t * Is the punch region beyond this extent?  This can\n\t\t\t * happen if start is already inside a hole.  Try to\n\t\t\t * advance to the next extent if this is the case.\n\t\t\t */\n\t\t\tif (start >= next)\n\t\t\t\tgoto next_extent;\n\t\t\t/* End of deleted region after extent;\n\t\t\t   adjust end of extent */\n\t\t\tdbg_printf(\"Case #%d\\n\", 2);\n\t\t\tnewlen = start - extent.e_lblk;\n\t\t\tfree_start = extent.e_pblk + newlen;\n\t\t\tlfree_start = extent.e_lblk + newlen;\n\t\t\tfree_count = extent.e_len - newlen;\n\t\t\textent.e_len = newlen;\n\t\t} else {\n\t\t\tstruct ext2fs_extent\tnewex;\n\n\t\t\tdbg_printf(\"Case #%d\\n\", 3);\n\t\t\t/* The hard case; we need to split the extent */\n\t\t\tnewex.e_pblk = extent.e_pblk +\n\t\t\t\t(end + 1 - extent.e_lblk);\n\t\t\tnewex.e_lblk = end + 1;\n\t\t\tnewex.e_len = next - end - 1;\n\t\t\tnewex.e_flags = extent.e_flags;\n\n\t\t\textent.e_len = start - extent.e_lblk;\n\t\t\tfree_start = extent.e_pblk + extent.e_len;\n\t\t\tlfree_start = extent.e_lblk + extent.e_len;\n\t\t\tfree_count = end - start + 1;\n\n\t\t\tdbg_print_extent(\"inserting\", &newex);\n\t\t\tretval = ext2fs_extent_insert(handle,\n\t\t\t\t\tEXT2_EXTENT_INSERT_AFTER, &newex);\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\t\t\tretval = ext2fs_extent_fix_parents(handle);\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\t\t\t/*\n\t\t\t * Now pointing at inserted extent; so go back.\n\t\t\t *\n\t\t\t * We cannot use EXT2_EXTENT_PREV to go back; note the\n\t\t\t * subtlety in the comment for fix_parents().\n\t\t\t */\n\t\t\tretval = ext2fs_extent_goto(handle, extent.e_lblk);\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\t\t} \n\t\tif (extent.e_len) {\n\t\t\tdbg_print_extent(\"replacing\", &extent);\n\t\t\tretval = ext2fs_extent_replace(handle, 0, &extent);\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\t\t\tretval = ext2fs_extent_fix_parents(handle);\n\t\t} else {\n\t\t\tstruct ext2fs_extent\tnewex;\n\t\t\tblk64_t\t\t\told_lblk, next_lblk;\n\t\t\tdbg_printf(\"deleting current extent%s\\n\", \"\");\n\n\t\t\t/*\n\t\t\t * Save the location of the next leaf, then slip\n\t\t\t * back to the current extent.\n\t\t\t */\n\t\t\tretval = ext2fs_extent_get(handle, EXT2_EXTENT_CURRENT,\n\t\t\t\t\t\t   &newex);\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\t\t\told_lblk = newex.e_lblk;\n\n\t\t\tretval = ext2fs_extent_get(handle,\n\t\t\t\t\t\t   EXT2_EXTENT_NEXT_LEAF,\n\t\t\t\t\t\t   &newex);\n\t\t\tif (retval == EXT2_ET_EXTENT_NO_NEXT)\n\t\t\t\tnext_lblk = old_lblk;\n\t\t\telse if (retval)\n\t\t\t\tgoto errout;\n\t\t\telse\n\t\t\t\tnext_lblk = newex.e_lblk;\n\n\t\t\tretval = ext2fs_extent_goto(handle, old_lblk);\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\n\t\t\t/* Now delete the extent. */\n\t\t\tretval = ext2fs_extent_delete(handle, 0);\n\t\t\tif (retval)\n\t\t\t\tgoto errout;\n\n\t\t\tretval = ext2fs_extent_fix_parents(handle);\n\t\t\tif (retval && retval != EXT2_ET_NO_CURRENT_NODE)\n\t\t\t\tgoto errout;\n\t\t\tretval = 0;\n\n\t\t\t/*\n\t\t\t * Jump forward to the next extent.  If there are\n\t\t\t * errors, the ext2fs_extent_get down below will\n\t\t\t * capture them for us.\n\t\t\t */\n\t\t\t(void)ext2fs_extent_goto(handle, next_lblk);\n\t\t\top = EXT2_EXTENT_CURRENT;\n\t\t}\n\t\tif (retval)\n\t\t\tgoto errout;\n\t\tdbg_printf(\"Free start %llu, free count = %u\\n\",\n\t\t       free_start, free_count);\n\t\tretval = punch_extent_blocks(fs, ino, inode, lfree_start,\n\t\t\t\t\t     free_start, free_count, &freed);\n\t\tif (retval)\n\t\t\tgoto errout;\n\tnext_extent:\n\t\tretval = ext2fs_extent_get(handle, op,\n\t\t\t\t\t   &extent);\n\t\tif (retval == EXT2_ET_EXTENT_NO_NEXT ||\n\t\t    retval == EXT2_ET_NO_CURRENT_NODE)\n\t\t\tbreak;\n\t\tif (retval)\n\t\t\tgoto errout;\n\t}\n\tdbg_printf(\"Freed %d blocks\\n\", freed);\n\tretval = ext2fs_iblk_sub_blocks(fs, inode, freed);\nerrout:\n\text2fs_extent_free(handle);\n\treturn retval;\n}\n\t\nstatic errcode_t ext2fs_punch_inline_data(ext2_filsys fs, ext2_ino_t ino,\n\t\t\t\t\t  struct ext2_inode *inode,\n\t\t\t\t\t  blk64_t start,\n\t\t\t\t\t  blk64_t end EXT2FS_ATTR((unused)))\n{\n\terrcode_t retval;\n\n\t/*\n\t * In libext2fs ext2fs_punch is based on block unit.  So that\n\t * means that if start > 0 we don't need to do nothing.  Due\n\t * to this we will remove all inline data in ext2fs_punch()\n\t * now.\n\t */\n\tif (start > 0)\n\t\treturn 0;\n\n\tmemset((char *)inode->i_block, 0, EXT4_MIN_INLINE_DATA_SIZE);\n\tinode->i_size = 0;\n\tretval = ext2fs_write_inode(fs, ino, inode);\n\tif (retval)\n\t\treturn retval;\n\n\treturn ext2fs_inline_data_ea_remove(fs, ino);\n}\n\n/*\n * Deallocate all logical _blocks_ starting at start to end, inclusive.\n * If end is ~0ULL, then this is effectively truncate.\n */\nerrcode_t ext2fs_punch(ext2_filsys fs, ext2_ino_t ino,\n\t\t       struct ext2_inode *inode,\n\t\t       char *block_buf, blk64_t start,\n\t\t       blk64_t end)\n{\n\terrcode_t\t\tretval;\n\tstruct ext2_inode\tinode_buf;\n\n\tif (start > end)\n\t\treturn EINVAL;\n\n\t/* Read inode structure if necessary */\n\tif (!inode) {\n\t\tretval = ext2fs_read_inode(fs, ino, &inode_buf);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tinode = &inode_buf;\n\t}\n\tif (inode->i_flags & EXT4_INLINE_DATA_FL)\n\t\treturn ext2fs_punch_inline_data(fs, ino, inode, start, end);\n\telse if (inode->i_flags & EXT4_EXTENTS_FL)\n\t\tretval = ext2fs_punch_extent(fs, ino, inode, start, end);\n\telse\n\t\tretval = ext2fs_punch_ind(fs, inode, block_buf, start, end);\n\tif (retval)\n\t\treturn retval;\n\n#ifdef PUNCH_DEBUG\n\tprintf(\"%u: write inode size now %u blocks %u\\n\",\n\t\tino, inode->i_size, inode->i_blocks);\n#endif\n\treturn ext2fs_write_inode(fs, ino, inode);\n}\n"
  },
  {
    "path": "src/ext2fs/rbtree.c",
    "content": "/*\n  Red Black Trees\n  (C) 1999  Andrea Arcangeli <andrea@suse.de>\n  (C) 2002  David Woodhouse <dwmw2@infradead.org>\n\n  This program is free software; you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation; either version 2 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA\n\n  linux/lib/rbtree.c\n*/\n\n#include \"rbtree.h\"\n\nstatic void __rb_rotate_left(struct rb_node *node, struct rb_root *root)\n{\n\tstruct rb_node *right = node->rb_right;\n\tstruct rb_node *parent = ext2fs_rb_parent(node);\n\n\tif ((node->rb_right = right->rb_left))\n\t\text2fs_rb_set_parent(right->rb_left, node);\n\tright->rb_left = node;\n\n\text2fs_rb_set_parent(right, parent);\n\n\tif (parent)\n\t{\n\t\tif (node == parent->rb_left)\n\t\t\tparent->rb_left = right;\n\t\telse\n\t\t\tparent->rb_right = right;\n\t}\n\telse\n\t\troot->rb_node = right;\n\text2fs_rb_set_parent(node, right);\n}\n\nstatic void __rb_rotate_right(struct rb_node *node, struct rb_root *root)\n{\n\tstruct rb_node *left = node->rb_left;\n\tstruct rb_node *parent = ext2fs_rb_parent(node);\n\n\tif ((node->rb_left = left->rb_right))\n\t\text2fs_rb_set_parent(left->rb_right, node);\n\tleft->rb_right = node;\n\n\text2fs_rb_set_parent(left, parent);\n\n\tif (parent)\n\t{\n\t\tif (node == parent->rb_right)\n\t\t\tparent->rb_right = left;\n\t\telse\n\t\t\tparent->rb_left = left;\n\t}\n\telse\n\t\troot->rb_node = left;\n\text2fs_rb_set_parent(node, left);\n}\n\nvoid ext2fs_rb_insert_color(struct rb_node *node, struct rb_root *root)\n{\n\tstruct rb_node *parent, *gparent;\n\n\twhile ((parent = ext2fs_rb_parent(node)) && ext2fs_rb_is_red(parent))\n\t{\n\t\tgparent = ext2fs_rb_parent(parent);\n\n\t\tif (parent == gparent->rb_left)\n\t\t{\n\t\t\t{\n\t\t\t\tregister struct rb_node *uncle = gparent->rb_right;\n\t\t\t\tif (uncle && ext2fs_rb_is_red(uncle))\n\t\t\t\t{\n\t\t\t\t\text2fs_rb_set_black(uncle);\n\t\t\t\t\text2fs_rb_set_black(parent);\n\t\t\t\t\text2fs_rb_set_red(gparent);\n\t\t\t\t\tnode = gparent;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (parent->rb_right == node)\n\t\t\t{\n\t\t\t\tregister struct rb_node *tmp;\n\t\t\t\t__rb_rotate_left(parent, root);\n\t\t\t\ttmp = parent;\n\t\t\t\tparent = node;\n\t\t\t\tnode = tmp;\n\t\t\t}\n\n\t\t\text2fs_rb_set_black(parent);\n\t\t\text2fs_rb_set_red(gparent);\n\t\t\t__rb_rotate_right(gparent, root);\n\t\t} else {\n\t\t\t{\n\t\t\t\tregister struct rb_node *uncle = gparent->rb_left;\n\t\t\t\tif (uncle && ext2fs_rb_is_red(uncle))\n\t\t\t\t{\n\t\t\t\t\text2fs_rb_set_black(uncle);\n\t\t\t\t\text2fs_rb_set_black(parent);\n\t\t\t\t\text2fs_rb_set_red(gparent);\n\t\t\t\t\tnode = gparent;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (parent->rb_left == node)\n\t\t\t{\n\t\t\t\tregister struct rb_node *tmp;\n\t\t\t\t__rb_rotate_right(parent, root);\n\t\t\t\ttmp = parent;\n\t\t\t\tparent = node;\n\t\t\t\tnode = tmp;\n\t\t\t}\n\n\t\t\text2fs_rb_set_black(parent);\n\t\t\text2fs_rb_set_red(gparent);\n\t\t\t__rb_rotate_left(gparent, root);\n\t\t}\n\t}\n\n\text2fs_rb_set_black(root->rb_node);\n}\n\nstatic void __rb_erase_color(struct rb_node *node, struct rb_node *parent,\n\t\t\t     struct rb_root *root)\n{\n\tstruct rb_node *other;\n\n\twhile ((!node || ext2fs_rb_is_black(node)) && node != root->rb_node)\n\t{\n\t\tif (parent->rb_left == node)\n\t\t{\n\t\t\tother = parent->rb_right;\n\t\t\tif (ext2fs_rb_is_red(other))\n\t\t\t{\n\t\t\t\text2fs_rb_set_black(other);\n\t\t\t\text2fs_rb_set_red(parent);\n\t\t\t\t__rb_rotate_left(parent, root);\n\t\t\t\tother = parent->rb_right;\n\t\t\t}\n\t\t\tif ((!other->rb_left || ext2fs_rb_is_black(other->rb_left)) &&\n\t\t\t    (!other->rb_right || ext2fs_rb_is_black(other->rb_right)))\n\t\t\t{\n\t\t\t\text2fs_rb_set_red(other);\n\t\t\t\tnode = parent;\n\t\t\t\tparent = ext2fs_rb_parent(node);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!other->rb_right || ext2fs_rb_is_black(other->rb_right))\n\t\t\t\t{\n\t\t\t\t\text2fs_rb_set_black(other->rb_left);\n\t\t\t\t\text2fs_rb_set_red(other);\n\t\t\t\t\t__rb_rotate_right(other, root);\n\t\t\t\t\tother = parent->rb_right;\n\t\t\t\t}\n\t\t\t\text2fs_rb_set_color(other, ext2fs_rb_color(parent));\n\t\t\t\text2fs_rb_set_black(parent);\n\t\t\t\text2fs_rb_set_black(other->rb_right);\n\t\t\t\t__rb_rotate_left(parent, root);\n\t\t\t\tnode = root->rb_node;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tother = parent->rb_left;\n\t\t\tif (ext2fs_rb_is_red(other))\n\t\t\t{\n\t\t\t\text2fs_rb_set_black(other);\n\t\t\t\text2fs_rb_set_red(parent);\n\t\t\t\t__rb_rotate_right(parent, root);\n\t\t\t\tother = parent->rb_left;\n\t\t\t}\n\t\t\tif ((!other->rb_left || ext2fs_rb_is_black(other->rb_left)) &&\n\t\t\t    (!other->rb_right || ext2fs_rb_is_black(other->rb_right)))\n\t\t\t{\n\t\t\t\text2fs_rb_set_red(other);\n\t\t\t\tnode = parent;\n\t\t\t\tparent = ext2fs_rb_parent(node);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!other->rb_left || ext2fs_rb_is_black(other->rb_left))\n\t\t\t\t{\n\t\t\t\t\text2fs_rb_set_black(other->rb_right);\n\t\t\t\t\text2fs_rb_set_red(other);\n\t\t\t\t\t__rb_rotate_left(other, root);\n\t\t\t\t\tother = parent->rb_left;\n\t\t\t\t}\n\t\t\t\text2fs_rb_set_color(other, ext2fs_rb_color(parent));\n\t\t\t\text2fs_rb_set_black(parent);\n\t\t\t\text2fs_rb_set_black(other->rb_left);\n\t\t\t\t__rb_rotate_right(parent, root);\n\t\t\t\tnode = root->rb_node;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (node)\n\t\text2fs_rb_set_black(node);\n}\n\nvoid ext2fs_rb_erase(struct rb_node *node, struct rb_root *root)\n{\n\tstruct rb_node *child, *parent;\n\tint color;\n\n\tif (!node->rb_left)\n\t\tchild = node->rb_right;\n\telse if (!node->rb_right)\n\t\tchild = node->rb_left;\n\telse\n\t{\n\t\tstruct rb_node *old = node, *left;\n\n\t\tnode = node->rb_right;\n\t\twhile ((left = node->rb_left) != NULL)\n\t\t\tnode = left;\n\n\t\tif (ext2fs_rb_parent(old)) {\n\t\t\tif (ext2fs_rb_parent(old)->rb_left == old)\n\t\t\t\text2fs_rb_parent(old)->rb_left = node;\n\t\t\telse\n\t\t\t\text2fs_rb_parent(old)->rb_right = node;\n\t\t} else\n\t\t\troot->rb_node = node;\n\n\t\tchild = node->rb_right;\n\t\tparent = ext2fs_rb_parent(node);\n\t\tcolor = ext2fs_rb_color(node);\n\n\t\tif (parent == old) {\n\t\t\tparent = node;\n\t\t} else {\n\t\t\tif (child)\n\t\t\t\text2fs_rb_set_parent(child, parent);\n\t\t\tparent->rb_left = child;\n\n\t\t\tnode->rb_right = old->rb_right;\n\t\t\text2fs_rb_set_parent(old->rb_right, node);\n\t\t}\n\n\t\tnode->rb_parent_color = old->rb_parent_color;\n\t\tnode->rb_left = old->rb_left;\n\t\text2fs_rb_set_parent(old->rb_left, node);\n\n\t\tgoto color;\n\t}\n\n\tparent = ext2fs_rb_parent(node);\n\tcolor = ext2fs_rb_color(node);\n\n\tif (child)\n\t\text2fs_rb_set_parent(child, parent);\n\tif (parent)\n\t{\n\t\tif (parent->rb_left == node)\n\t\t\tparent->rb_left = child;\n\t\telse\n\t\t\tparent->rb_right = child;\n\t}\n\telse\n\t\troot->rb_node = child;\n\n color:\n\tif (color == RB_BLACK)\n\t\t__rb_erase_color(child, parent, root);\n}\n\nstatic void ext2fs_rb_augment_path(struct rb_node *node, rb_augment_f func, void *data)\n{\n\tstruct rb_node *parent;\n\nup:\n\tfunc(node, data);\n\tparent = ext2fs_rb_parent(node);\n\tif (!parent)\n\t\treturn;\n\n\tif (node == parent->rb_left && parent->rb_right)\n\t\tfunc(parent->rb_right, data);\n\telse if (parent->rb_left)\n\t\tfunc(parent->rb_left, data);\n\n\tnode = parent;\n\tgoto up;\n}\n\n/*\n * after inserting @node into the tree, update the tree to account for\n * both the new entry and any damage done by rebalance\n */\nvoid ext2fs_rb_augment_insert(struct rb_node *node, rb_augment_f func, void *data)\n{\n\tif (node->rb_left)\n\t\tnode = node->rb_left;\n\telse if (node->rb_right)\n\t\tnode = node->rb_right;\n\n\text2fs_rb_augment_path(node, func, data);\n}\n\n/*\n * before removing the node, find the deepest node on the rebalance path\n * that will still be there after @node gets removed\n */\nstruct rb_node *ext2fs_rb_augment_erase_begin(struct rb_node *node)\n{\n\tstruct rb_node *deepest;\n\n\tif (!node->rb_right && !node->rb_left)\n\t\tdeepest = ext2fs_rb_parent(node);\n\telse if (!node->rb_right)\n\t\tdeepest = node->rb_left;\n\telse if (!node->rb_left)\n\t\tdeepest = node->rb_right;\n\telse {\n\t\tdeepest = ext2fs_rb_next(node);\n\t\tif (!deepest)\n\t\t\treturn NULL;\n\t\tif (deepest->rb_right)\n\t\t\tdeepest = deepest->rb_right;\n\t\telse if (ext2fs_rb_parent(deepest) != node)\n\t\t\tdeepest = ext2fs_rb_parent(deepest);\n\t}\n\n\treturn deepest;\n}\n\n/*\n * after removal, update the tree to account for the removed entry\n * and any rebalance damage.\n */\nvoid ext2fs_rb_augment_erase_end(struct rb_node *node, rb_augment_f func, void *data)\n{\n\tif (node)\n\t\text2fs_rb_augment_path(node, func, data);\n}\n\n/*\n * This function returns the first node (in sort order) of the tree.\n */\nstruct rb_node *ext2fs_rb_first(const struct rb_root *root)\n{\n\tstruct rb_node\t*n;\n\n\tn = root->rb_node;\n\tif (!n)\n\t\treturn NULL;\n\twhile (n->rb_left)\n\t\tn = n->rb_left;\n\treturn n;\n}\n\nstruct rb_node *ext2fs_rb_last(const struct rb_root *root)\n{\n\tstruct rb_node\t*n;\n\n\tn = root->rb_node;\n\tif (!n)\n\t\treturn NULL;\n\twhile (n->rb_right)\n\t\tn = n->rb_right;\n\treturn n;\n}\n\nstruct rb_node *ext2fs_rb_next(struct rb_node *node)\n{\n\tstruct rb_node *parent;\n\n\tif (ext2fs_rb_parent(node) == node)\n\t\treturn NULL;\n\n\t/* If we have a right-hand child, go down and then left as far\n\t   as we can. */\n\tif (node->rb_right) {\n\t\tnode = node->rb_right;\n\t\twhile (node->rb_left)\n\t\t\tnode=node->rb_left;\n\t\treturn (struct rb_node *)node;\n\t}\n\n\t/* No right-hand children.  Everything down and left is\n\t   smaller than us, so any 'next' node must be in the general\n\t   direction of our parent. Go up the tree; any time the\n\t   ancestor is a right-hand child of its parent, keep going\n\t   up. First time it's a left-hand child of its parent, said\n\t   parent is our 'next' node. */\n\twhile ((parent = ext2fs_rb_parent(node)) && node == parent->rb_right)\n\t\tnode = parent;\n\n\treturn parent;\n}\n\nstruct rb_node *ext2fs_rb_prev(struct rb_node *node)\n{\n\tstruct rb_node *parent;\n\n\tif (ext2fs_rb_parent(node) == node)\n\t\treturn NULL;\n\n\t/* If we have a left-hand child, go down and then right as far\n\t   as we can. */\n\tif (node->rb_left) {\n\t\tnode = node->rb_left;\n\t\twhile (node->rb_right)\n\t\t\tnode=node->rb_right;\n\t\treturn (struct rb_node *)node;\n\t}\n\n\t/* No left-hand children. Go up till we find an ancestor which\n\t   is a right-hand child of its parent */\n\twhile ((parent = ext2fs_rb_parent(node)) && node == parent->rb_left)\n\t\tnode = parent;\n\n\treturn parent;\n}\n\nvoid ext2fs_rb_replace_node(struct rb_node *victim, struct rb_node *new,\n\t\t\t  struct rb_root *root)\n{\n\tstruct rb_node *parent = ext2fs_rb_parent(victim);\n\n\t/* Set the surrounding nodes to point to the replacement */\n\tif (parent) {\n\t\tif (victim == parent->rb_left)\n\t\t\tparent->rb_left = new;\n\t\telse\n\t\t\tparent->rb_right = new;\n\t} else {\n\t\troot->rb_node = new;\n\t}\n\tif (victim->rb_left)\n\t\text2fs_rb_set_parent(victim->rb_left, new);\n\tif (victim->rb_right)\n\t\text2fs_rb_set_parent(victim->rb_right, new);\n\n\t/* Copy the pointers/colour from the victim to the replacement */\n\t*new = *victim;\n}\n"
  },
  {
    "path": "src/ext2fs/rbtree.h",
    "content": "/*\n  Red Black Trees\n  (C) 1999  Andrea Arcangeli <andrea@suse.de>\n\n  This program is free software; you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation; either version 2 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA\n\n  linux/include/linux/rbtree.h\n\n  To use rbtrees you'll have to implement your own insert and search cores.\n  This will avoid us to use callbacks and to drop dramatically performances.\n  I know it's not the cleaner way,  but in C (not in C++) to get\n  performances and genericity...\n\n  Some example of insert and search follows here. The search is a plain\n  normal search over an ordered tree. The insert instead must be implemented\n  in two steps: First, the code must insert the element in order as a red leaf\n  in the tree, and then the support library function rb_insert_color() must\n  be called. Such function will do the not trivial work to rebalance the\n  rbtree, if necessary.\n\n-----------------------------------------------------------------------\nstatic inline struct page * rb_search_page_cache(struct inode * inode,\n\t\t\t\t\t\t unsigned long offset)\n{\n\tstruct rb_node * n = inode->i_rb_page_cache.rb_node;\n\tstruct page * page;\n\n\twhile (n)\n\t{\n\t\tpage = rb_entry(n, struct page, rb_page_cache);\n\n\t\tif (offset < page->offset)\n\t\t\tn = n->rb_left;\n\t\telse if (offset > page->offset)\n\t\t\tn = n->rb_right;\n\t\telse\n\t\t\treturn page;\n\t}\n\treturn NULL;\n}\n\nstatic inline struct page * __rb_insert_page_cache(struct inode * inode,\n\t\t\t\t\t\t   unsigned long offset,\n\t\t\t\t\t\t   struct rb_node * node)\n{\n\tstruct rb_node ** p = &inode->i_rb_page_cache.rb_node;\n\tstruct rb_node * parent = NULL;\n\tstruct page * page;\n\n\twhile (*p)\n\t{\n\t\tparent = *p;\n\t\tpage = rb_entry(parent, struct page, rb_page_cache);\n\n\t\tif (offset < page->offset)\n\t\t\tp = &(*p)->rb_left;\n\t\telse if (offset > page->offset)\n\t\t\tp = &(*p)->rb_right;\n\t\telse\n\t\t\treturn page;\n\t}\n\n\trb_link_node(node, parent, p);\n\n\treturn NULL;\n}\n\nstatic inline struct page * rb_insert_page_cache(struct inode * inode,\n\t\t\t\t\t\t unsigned long offset,\n\t\t\t\t\t\t struct rb_node * node)\n{\n\tstruct page * ret;\n\tif ((ret = __rb_insert_page_cache(inode, offset, node)))\n\t\tgoto out;\n\trb_insert_color(node, &inode->i_rb_page_cache);\n out:\n\treturn ret;\n}\n-----------------------------------------------------------------------\n*/\n\n#ifndef\t_LINUX_RBTREE_H\n#define\t_LINUX_RBTREE_H\n\n#include <stdlib.h>\n#include <stdint.h>\n\n#include \"config.h\"\n\n#if defined(__GNUC__) || defined(__clang__)\n#define EXT2FS_ALIGN_START(m)\n#define EXT2FS_ALIGN_END(m) __attribute__ ((__aligned__(m)))\n#elif defined(_MSC_VER)\n#define EXT2FS_ALIGN_START(m) __declspec(align(m))\n#define EXT2FS_ALIGN_END(m)\n#else\n#error \n#endif\n\n#undef offsetof\n#ifdef __compiler_offsetof\n#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)\n#else\n#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)\n#endif\n\n#define container_of(ptr, type, member) ({\t\t\t\\\n\tconst __typeof__( ((type *)0)->member ) *__mptr = (ptr);\t\\\n\t(type *)( (char *)__mptr - offsetof(type,member) );})\n\nEXT2FS_ALIGN_START(SIZEOF_LONG) struct rb_node\n{\n\tuintptr_t  rb_parent_color;\n#define\tRB_RED\t\t0\n#define\tRB_BLACK\t1\n\tstruct rb_node *rb_right;\n\tstruct rb_node *rb_left;\n} EXT2FS_ALIGN_END(SIZEOF_LONG);\n    /* The alignment might seem pointless, but allegedly CRIS needs it */\n\nstruct rb_root\n{\n\tstruct rb_node *rb_node;\n};\n\n\n#define ext2fs_rb_parent(r)   ((struct rb_node *)((r)->rb_parent_color & ~3))\n#define ext2fs_rb_color(r)   ((r)->rb_parent_color & 1)\n#define ext2fs_rb_is_red(r)   (!ext2fs_rb_color(r))\n#define ext2fs_rb_is_black(r) ext2fs_rb_color(r)\n#define ext2fs_rb_set_red(r)  do { (r)->rb_parent_color &= ~1; } while (0)\n#define ext2fs_rb_set_black(r)  do { (r)->rb_parent_color |= 1; } while (0)\n\nstatic inline void ext2fs_rb_set_parent(struct rb_node *rb, struct rb_node *p)\n{\n\trb->rb_parent_color = (rb->rb_parent_color & 3) | (uintptr_t)p;\n}\nstatic inline void ext2fs_rb_set_color(struct rb_node *rb, int color)\n{\n\trb->rb_parent_color = (rb->rb_parent_color & ~1) | color;\n}\n\n#define RB_ROOT\t(struct rb_root) { NULL, }\n#define\text2fs_rb_entry(ptr, type, member) container_of(ptr, type, member)\n\nstatic inline int ext2fs_rb_empty_root(struct rb_root *root)\n{\n\treturn root->rb_node == NULL;\n}\n\nstatic inline int ext2fs_rb_empty_node(struct rb_node *node)\n{\n\treturn ext2fs_rb_parent(node) == node;\n}\n\nstatic inline void ext2fs_rb_clear_node(struct rb_node *node)\n{\n\text2fs_rb_set_parent(node, node);\n}\n\nextern void ext2fs_rb_insert_color(struct rb_node *, struct rb_root *);\nextern void ext2fs_rb_erase(struct rb_node *, struct rb_root *);\n\ntypedef void (*rb_augment_f)(struct rb_node *node, void *data);\n\nextern void ext2fs_rb_augment_insert(struct rb_node *node,\n\t\t\t      rb_augment_f func, void *data);\nextern struct rb_node *ext2fs_rb_augment_erase_begin(struct rb_node *node);\nextern void ext2fs_rb_augment_erase_end(struct rb_node *node,\n\t\t\t\t rb_augment_f func, void *data);\n\n/* Find logical next and previous nodes in a tree */\nextern struct rb_node *ext2fs_rb_next(struct rb_node *);\nextern struct rb_node *ext2fs_rb_prev(struct rb_node *);\nextern struct rb_node *ext2fs_rb_first(const struct rb_root *);\nextern struct rb_node *ext2fs_rb_last(const struct rb_root *);\n\n/* Fast replacement of a single node without remove/rebalance/add/rebalance */\nextern void ext2fs_rb_replace_node(struct rb_node *victim, struct rb_node *new,\n\t\t\t\t struct rb_root *root);\n\nstatic inline void ext2fs_rb_link_node(struct rb_node * node,\n\t\t\t\t     struct rb_node * parent,\n\t\t\t\t     struct rb_node ** rb_link)\n{\n\tnode->rb_parent_color = (uintptr_t)parent;\n\tnode->rb_left = node->rb_right = NULL;\n\n\t*rb_link = node;\n}\n\n#endif\t/* _LINUX_RBTREE_H */\n"
  },
  {
    "path": "src/ext2fs/read_bb.c",
    "content": "/*\n * read_bb --- read the bad blocks inode\n *\n * Copyright (C) 1994 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\nstruct read_bb_record {\n\text2_badblocks_list\tbb_list;\n\terrcode_t\terr;\n};\n\n/*\n * Helper function for ext2fs_read_bb_inode()\n */\n#ifdef __TURBOC__\n #pragma argsused\n#endif\nstatic int mark_bad_block(ext2_filsys fs, blk_t *block_nr,\n\t\t\t  e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),\n\t\t\t  blk_t ref_block EXT2FS_ATTR((unused)),\n\t\t\t  int ref_offset EXT2FS_ATTR((unused)),\n\t\t\t  void *priv_data)\n{\n\tstruct read_bb_record *rb = (struct read_bb_record *) priv_data;\n\n\tif (blockcnt < 0)\n\t\treturn 0;\n\n\tif ((*block_nr < fs->super->s_first_data_block) ||\n\t    (*block_nr >= ext2fs_blocks_count(fs->super)))\n\t\treturn 0;\t/* Ignore illegal blocks */\n\n\trb->err = ext2fs_badblocks_list_add(rb->bb_list, *block_nr);\n\tif (rb->err)\n\t\treturn BLOCK_ABORT;\n\treturn 0;\n}\n\n/*\n * Reads the current bad blocks from the bad blocks inode.\n */\nerrcode_t ext2fs_read_bb_inode(ext2_filsys fs, ext2_badblocks_list *bb_list)\n{\n\terrcode_t\tretval;\n\tstruct read_bb_record rb;\n\tstruct ext2_inode inode;\n\tblk_t\tnumblocks;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif (!*bb_list) {\n\t\tretval = ext2fs_read_inode(fs, EXT2_BAD_INO, &inode);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\tnumblocks = inode.i_blocks;\n\t\tif (!(ext2fs_has_feature_huge_file(fs->super) &&\n\t\t      (inode.i_flags & EXT4_HUGE_FILE_FL)))\n\t\t\tnumblocks = numblocks / (fs->blocksize / 512);\n\t\tnumblocks += 20;\n\t\tif (numblocks < 50)\n\t\t\tnumblocks = 50;\n\t\tif (numblocks > 50000)\n\t\t\tnumblocks = 500;\n\t\tretval = ext2fs_badblocks_list_create(bb_list, numblocks);\n\t\tif (retval)\n\t\t\treturn retval;\n\t}\n\n\trb.bb_list = *bb_list;\n\trb.err = 0;\n\tretval = ext2fs_block_iterate2(fs, EXT2_BAD_INO, BLOCK_FLAG_READ_ONLY,\n\t\t\t\t       0, mark_bad_block, &rb);\n\tif (retval)\n\t\treturn retval;\n\n\treturn rb.err;\n}\n\n\n"
  },
  {
    "path": "src/ext2fs/rw_bitmaps.c",
    "content": "/*\n * rw_bitmaps.c --- routines to read and write the  inode and block bitmaps.\n *\n * Copyright (C) 1993, 1994, 1994, 1996 Theodore Ts'o.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#ifdef HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#ifdef HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n#include \"e2image.h\"\n\nstatic errcode_t write_bitmaps(ext2_filsys fs, int do_inode, int do_block)\n{\n\tdgrp_t \t\ti;\n\tunsigned int\tj;\n\tint\t\tblock_nbytes, inode_nbytes;\n\tunsigned int\tnbits;\n\terrcode_t\tretval;\n\tchar\t\t*block_buf = NULL, *inode_buf = NULL;\n\tint\t\tcsum_flag;\n\tblk64_t\t\tblk;\n\tblk64_t\t\tblk_itr = EXT2FS_B2C(fs, fs->super->s_first_data_block);\n\text2_ino_t\tino_itr = 1;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif (!(fs->flags & EXT2_FLAG_RW))\n\t\treturn EXT2_ET_RO_FILSYS;\n\n\tcsum_flag = ext2fs_has_group_desc_csum(fs);\n\n\tinode_nbytes = block_nbytes = 0;\n\tif (do_block) {\n\t\tblock_nbytes = EXT2_CLUSTERS_PER_GROUP(fs->super) / 8;\n\t\tretval = io_channel_alloc_buf(fs->io, 0, &block_buf);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t\tmemset(block_buf, 0xff, fs->blocksize);\n\t}\n\tif (do_inode) {\n\t\tinode_nbytes = (size_t)\n\t\t\t((EXT2_INODES_PER_GROUP(fs->super)+7) / 8);\n\t\tretval = io_channel_alloc_buf(fs->io, 0, &inode_buf);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t\tmemset(inode_buf, 0xff, fs->blocksize);\n\t}\n\n\tfor (i = 0; i < fs->group_desc_count; i++) {\n\t\tif (!do_block)\n\t\t\tgoto skip_block_bitmap;\n\n\t\tif (csum_flag && ext2fs_bg_flags_test(fs, i, EXT2_BG_BLOCK_UNINIT)\n\t\t    )\n\t\t\tgoto skip_this_block_bitmap;\n\n\t\tretval = ext2fs_get_block_bitmap_range2(fs->block_map,\n\t\t\t\tblk_itr, block_nbytes << 3, block_buf);\n\t\tif (retval)\n\t\t\tgoto errout;\n\n\t\tif (i == fs->group_desc_count - 1) {\n\t\t\t/* Force bitmap padding for the last group */\n\t\t\tnbits = EXT2FS_NUM_B2C(fs,\n\t\t\t\t((ext2fs_blocks_count(fs->super)\n\t\t\t\t  - (__u64) fs->super->s_first_data_block)\n\t\t\t\t % (__u64) EXT2_BLOCKS_PER_GROUP(fs->super)));\n\t\t\tif (nbits)\n\t\t\t\tfor (j = nbits; j < fs->blocksize * 8; j++)\n\t\t\t\t\text2fs_set_bit(j, block_buf);\n\t\t}\n\n\t\tretval = ext2fs_block_bitmap_csum_set(fs, i, block_buf,\n\t\t\t\t\t\t      block_nbytes);\n\t\tif (retval)\n\t\t\treturn retval;\n\t\text2fs_group_desc_csum_set(fs, i);\n\t\tfs->flags |= EXT2_FLAG_DIRTY;\n\n\t\tblk = ext2fs_block_bitmap_loc(fs, i);\n\t\tif (blk) {\n\t\t\tretval = io_channel_write_blk64(fs->io, blk, 1,\n\t\t\t\t\t\t\tblock_buf);\n\t\t\tif (retval) {\n\t\t\t\tretval = EXT2_ET_BLOCK_BITMAP_WRITE;\n\t\t\t\tgoto errout;\n\t\t\t}\n\t\t}\n\tskip_this_block_bitmap:\n\t\tblk_itr += (blk64_t)block_nbytes << 3;\n\tskip_block_bitmap:\n\n\t\tif (!do_inode)\n\t\t\tcontinue;\n\n\t\tif (csum_flag && ext2fs_bg_flags_test(fs, i, EXT2_BG_INODE_UNINIT)\n\t\t    )\n\t\t\tgoto skip_this_inode_bitmap;\n\n\t\tretval = ext2fs_get_inode_bitmap_range2(fs->inode_map,\n\t\t\t\tino_itr, inode_nbytes << 3, inode_buf);\n\t\tif (retval)\n\t\t\tgoto errout;\n\n\t\tretval = ext2fs_inode_bitmap_csum_set(fs, i, inode_buf,\n\t\t\t\t\t\t      inode_nbytes);\n\t\tif (retval)\n\t\t\tgoto errout;\n\t\text2fs_group_desc_csum_set(fs, i);\n\t\tfs->flags |= EXT2_FLAG_DIRTY;\n\n\t\tblk = ext2fs_inode_bitmap_loc(fs, i);\n\t\tif (blk) {\n\t\t\tretval = io_channel_write_blk64(fs->io, blk, 1,\n\t\t\t\t\t\t      inode_buf);\n\t\t\tif (retval) {\n\t\t\t\tretval = EXT2_ET_INODE_BITMAP_WRITE;\n\t\t\t\tgoto errout;\n\t\t\t}\n\t\t}\n\tskip_this_inode_bitmap:\n\t\tino_itr += inode_nbytes << 3;\n\n\t}\n\tif (do_block) {\n\t\tfs->flags &= ~EXT2_FLAG_BB_DIRTY;\n\t\text2fs_free_mem(&block_buf);\n\t}\n\tif (do_inode) {\n\t\tfs->flags &= ~EXT2_FLAG_IB_DIRTY;\n\t\text2fs_free_mem(&inode_buf);\n\t}\n\treturn 0;\nerrout:\n\tif (inode_buf)\n\t\text2fs_free_mem(&inode_buf);\n\tif (block_buf)\n\t\text2fs_free_mem(&block_buf);\n\treturn retval;\n}\n\nstatic errcode_t mark_uninit_bg_group_blocks(ext2_filsys fs)\n{\n\tdgrp_t\t\t\ti;\n\tblk64_t\t\t\tblk;\n\text2fs_block_bitmap\tbmap = fs->block_map;\n\n\tfor (i = 0; i < fs->group_desc_count; i++) {\n\t\tif (!ext2fs_bg_flags_test(fs, i, EXT2_BG_BLOCK_UNINIT))\n\t\t\tcontinue;\n\n\t\text2fs_reserve_super_and_bgd(fs, i, bmap);\n\n\t\t/*\n\t\t * Mark the blocks used for the inode table\n\t\t */\n\t\tblk = ext2fs_inode_table_loc(fs, i);\n\t\tif (blk)\n\t\t\text2fs_mark_block_bitmap_range2(bmap, blk,\n\t\t\t\t\t\tfs->inode_blocks_per_group);\n\n\t\t/*\n\t\t * Mark block used for the block bitmap\n\t\t */\n\t\tblk = ext2fs_block_bitmap_loc(fs, i);\n\t\tif (blk)\n\t\t\text2fs_mark_block_bitmap2(bmap, blk);\n\n\t\t/*\n\t\t * Mark block used for the inode bitmap\n\t\t */\n\t\tblk = ext2fs_inode_bitmap_loc(fs, i);\n\t\tif (blk)\n\t\t\text2fs_mark_block_bitmap2(bmap, blk);\n\t}\n\treturn 0;\n}\n\nstatic int bitmap_tail_verify(unsigned char *bitmap, int first, int last)\n{\n\tint i;\n\n\tfor (i = first; i <= last; i++)\n\t\tif (bitmap[i] != 0xff)\n\t\t\treturn 0;\n\treturn 1;\n}\n\nstatic errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)\n{\n\tdgrp_t i;\n\tchar *block_bitmap = 0, *inode_bitmap = 0;\n\tchar *buf;\n\terrcode_t retval;\n\tint block_nbytes = EXT2_CLUSTERS_PER_GROUP(fs->super) / 8;\n\tint inode_nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8;\n\tint tail_flags = 0;\n\tint csum_flag;\n\tunsigned int\tcnt;\n\tblk64_t\tblk;\n\tblk64_t\tblk_itr = EXT2FS_B2C(fs, fs->super->s_first_data_block);\n\tblk64_t   blk_cnt;\n\text2_ino_t ino_itr = 1;\n\text2_ino_t ino_cnt;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\tif ((block_nbytes > (int) fs->blocksize) ||\n\t    (inode_nbytes > (int) fs->blocksize))\n\t\treturn EXT2_ET_CORRUPT_SUPERBLOCK;\n\n\tfs->write_bitmaps = ext2fs_write_bitmaps;\n\n\tcsum_flag = ext2fs_has_group_desc_csum(fs);\n\n\tretval = ext2fs_get_mem(strlen(fs->device_name) + 80, &buf);\n\tif (retval)\n\t\treturn retval;\n\tif (do_block) {\n\t\tif (fs->block_map)\n\t\t\text2fs_free_block_bitmap(fs->block_map);\n\t\tstrcpy(buf, \"block bitmap for \");\n\t\tstrcat(buf, fs->device_name);\n\t\tretval = ext2fs_allocate_block_bitmap(fs, buf, &fs->block_map);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t\tretval = io_channel_alloc_buf(fs->io, 0, &block_bitmap);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t} else\n\t\tblock_nbytes = 0;\n\tif (do_inode) {\n\t\tif (fs->inode_map)\n\t\t\text2fs_free_inode_bitmap(fs->inode_map);\n\t\tstrcpy(buf, \"inode bitmap for \");\n\t\tstrcat(buf, fs->device_name);\n\t\tretval = ext2fs_allocate_inode_bitmap(fs, buf, &fs->inode_map);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t\tretval = io_channel_alloc_buf(fs->io, 0, &inode_bitmap);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t} else\n\t\tinode_nbytes = 0;\n\text2fs_free_mem(&buf);\n\n\tif (fs->flags & EXT2_FLAG_IMAGE_FILE) {\n\t\tblk = (ext2fs_le32_to_cpu(fs->image_header->offset_inodemap) / fs->blocksize);\n\t\tino_cnt = fs->super->s_inodes_count;\n\t\twhile (inode_bitmap && ino_cnt > 0) {\n\t\t\tretval = io_channel_read_blk64(fs->image_io, blk++,\n\t\t\t\t\t\t     1, inode_bitmap);\n\t\t\tif (retval)\n\t\t\t\tgoto cleanup;\n\t\t\tcnt = fs->blocksize << 3;\n\t\t\tif (cnt > ino_cnt)\n\t\t\t\tcnt = ino_cnt;\n\t\t\tretval = ext2fs_set_inode_bitmap_range2(fs->inode_map,\n\t\t\t\t\t       ino_itr, cnt, inode_bitmap);\n\t\t\tif (retval)\n\t\t\t\tgoto cleanup;\n\t\t\tino_itr += cnt;\n\t\t\tino_cnt -= cnt;\n\t\t}\n\t\tblk = (ext2fs_le32_to_cpu(fs->image_header->offset_blockmap) /\n\t\t       fs->blocksize);\n\t\tblk_cnt = EXT2_GROUPS_TO_CLUSTERS(fs->super,\n\t\t\t\t\t\t  fs->group_desc_count);\n\t\twhile (block_bitmap && blk_cnt > 0) {\n\t\t\tretval = io_channel_read_blk64(fs->image_io, blk++,\n\t\t\t\t\t\t     1, block_bitmap);\n\t\t\tif (retval)\n\t\t\t\tgoto cleanup;\n\t\t\tcnt = fs->blocksize << 3;\n\t\t\tif (cnt > blk_cnt)\n\t\t\t\tcnt = blk_cnt;\n\t\t\tretval = ext2fs_set_block_bitmap_range2(fs->block_map,\n\t\t\t\t       blk_itr, cnt, block_bitmap);\n\t\t\tif (retval)\n\t\t\t\tgoto cleanup;\n\t\t\tblk_itr += cnt;\n\t\t\tblk_cnt -= cnt;\n\t\t}\n\t\tgoto success_cleanup;\n\t}\n\n\tfor (i = 0; i < fs->group_desc_count; i++) {\n\t\tif (block_bitmap) {\n\t\t\tblk = ext2fs_block_bitmap_loc(fs, i);\n\t\t\tif ((csum_flag &&\n\t\t\t     ext2fs_bg_flags_test(fs, i, EXT2_BG_BLOCK_UNINIT) &&\n\t\t\t     ext2fs_group_desc_csum_verify(fs, i)) ||\n\t\t\t    (blk >= ext2fs_blocks_count(fs->super)))\n\t\t\t\tblk = 0;\n\t\t\tif (blk) {\n\t\t\t\tretval = io_channel_read_blk64(fs->io, blk,\n\t\t\t\t\t\t\t       1, block_bitmap);\n\t\t\t\tif (retval) {\n\t\t\t\t\tretval = EXT2_ET_BLOCK_BITMAP_READ;\n\t\t\t\t\tgoto cleanup;\n\t\t\t\t}\n\t\t\t\t/* verify block bitmap checksum */\n\t\t\t\tif (!(fs->flags &\n\t\t\t\t      EXT2_FLAG_IGNORE_CSUM_ERRORS) &&\n\t\t\t\t    !ext2fs_block_bitmap_csum_verify(fs, i,\n\t\t\t\t\t\tblock_bitmap, block_nbytes)) {\n\t\t\t\t\tretval =\n\t\t\t\t\tEXT2_ET_BLOCK_BITMAP_CSUM_INVALID;\n\t\t\t\t\tgoto cleanup;\n\t\t\t\t}\n\t\t\t\tif (!bitmap_tail_verify((unsigned char *) block_bitmap,\n\t\t\t\t\t\t\tblock_nbytes, fs->blocksize - 1))\n\t\t\t\t\ttail_flags |= EXT2_FLAG_BBITMAP_TAIL_PROBLEM;\n\t\t\t} else\n\t\t\t\tmemset(block_bitmap, 0, block_nbytes);\n\t\t\tcnt = block_nbytes << 3;\n\t\t\tretval = ext2fs_set_block_bitmap_range2(fs->block_map,\n\t\t\t\t\t       blk_itr, cnt, block_bitmap);\n\t\t\tif (retval)\n\t\t\t\tgoto cleanup;\n\t\t\tblk_itr += block_nbytes << 3;\n\t\t}\n\t\tif (inode_bitmap) {\n\t\t\tblk = ext2fs_inode_bitmap_loc(fs, i);\n\t\t\tif ((csum_flag &&\n\t\t\t     ext2fs_bg_flags_test(fs, i, EXT2_BG_INODE_UNINIT) &&\n\t\t\t     ext2fs_group_desc_csum_verify(fs, i)) ||\n\t\t\t    (blk >= ext2fs_blocks_count(fs->super)))\n\t\t\t\tblk = 0;\n\t\t\tif (blk) {\n\t\t\t\tretval = io_channel_read_blk64(fs->io, blk,\n\t\t\t\t\t\t\t       1, inode_bitmap);\n\t\t\t\tif (retval) {\n\t\t\t\t\tretval = EXT2_ET_INODE_BITMAP_READ;\n\t\t\t\t\tgoto cleanup;\n\t\t\t\t}\n\n\t\t\t\t/* verify inode bitmap checksum */\n\t\t\t\tif (!(fs->flags &\n\t\t\t\t      EXT2_FLAG_IGNORE_CSUM_ERRORS) &&\n\t\t\t\t    !ext2fs_inode_bitmap_csum_verify(fs, i,\n\t\t\t\t\t\tinode_bitmap, inode_nbytes)) {\n\t\t\t\t\tretval =\n\t\t\t\t\tEXT2_ET_INODE_BITMAP_CSUM_INVALID;\n\t\t\t\t\tgoto cleanup;\n\t\t\t\t}\n\t\t\t\tif (!bitmap_tail_verify((unsigned char *) inode_bitmap,\n\t\t\t\t\t\t\tinode_nbytes, fs->blocksize - 1))\n\t\t\t\t\ttail_flags |= EXT2_FLAG_IBITMAP_TAIL_PROBLEM;\n\t\t\t} else\n\t\t\t\tmemset(inode_bitmap, 0, inode_nbytes);\n\t\t\tcnt = inode_nbytes << 3;\n\t\t\tretval = ext2fs_set_inode_bitmap_range2(fs->inode_map,\n\t\t\t\t\t       ino_itr, cnt, inode_bitmap);\n\t\t\tif (retval)\n\t\t\t\tgoto cleanup;\n\t\t\tino_itr += inode_nbytes << 3;\n\t\t}\n\t}\n\n\t/* Mark group blocks for any BLOCK_UNINIT groups */\n\tif (do_block) {\n\t\tretval = mark_uninit_bg_group_blocks(fs);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t}\n\nsuccess_cleanup:\n\tif (inode_bitmap) {\n\t\text2fs_free_mem(&inode_bitmap);\n\t\tfs->flags &= ~EXT2_FLAG_IBITMAP_TAIL_PROBLEM;\n\t}\n\tif (block_bitmap) {\n\t\text2fs_free_mem(&block_bitmap);\n\t\tfs->flags &= ~EXT2_FLAG_BBITMAP_TAIL_PROBLEM;\n\t}\n\tfs->flags |= tail_flags;\n\treturn 0;\n\ncleanup:\n\tif (do_block) {\n\t\text2fs_free_block_bitmap(fs->block_map);\n\t\tfs->block_map = 0;\n\t}\n\tif (do_inode) {\n\t\text2fs_free_inode_bitmap(fs->inode_map);\n\t\tfs->inode_map = 0;\n\t}\n\tif (inode_bitmap)\n\t\text2fs_free_mem(&inode_bitmap);\n\tif (block_bitmap)\n\t\text2fs_free_mem(&block_bitmap);\n\tif (buf)\n\t\text2fs_free_mem(&buf);\n\treturn retval;\n}\n\nerrcode_t ext2fs_read_inode_bitmap(ext2_filsys fs)\n{\n\treturn read_bitmaps(fs, 1, 0);\n}\n\nerrcode_t ext2fs_read_block_bitmap(ext2_filsys fs)\n{\n\treturn read_bitmaps(fs, 0, 1);\n}\n\nerrcode_t ext2fs_write_inode_bitmap(ext2_filsys fs)\n{\n\treturn write_bitmaps(fs, 1, 0);\n}\n\nerrcode_t ext2fs_write_block_bitmap (ext2_filsys fs)\n{\n\treturn write_bitmaps(fs, 0, 1);\n}\n\nerrcode_t ext2fs_read_bitmaps(ext2_filsys fs)\n{\n\tif (fs->inode_map && fs->block_map)\n\t\treturn 0;\n\n\treturn read_bitmaps(fs, !fs->inode_map, !fs->block_map);\n}\n\nerrcode_t ext2fs_write_bitmaps(ext2_filsys fs)\n{\n\tint do_inode = fs->inode_map && ext2fs_test_ib_dirty(fs);\n\tint do_block = fs->block_map && ext2fs_test_bb_dirty(fs);\n\n\tif (!do_inode && !do_block)\n\t\treturn 0;\n\n\treturn write_bitmaps(fs, do_inode, do_block);\n}\n"
  },
  {
    "path": "src/ext2fs/sha512.c",
    "content": "/*\n * sha512.c --- The sha512 algorithm\n *\n * Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>\n * (copied from libtomcrypt and then relicensed under GPLv2)\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n\n#include \"config.h\"\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#include \"ext2fs.h\"\n\n/* the K array */\n#define CONST64(n) n\nstatic const __u64 K[80] = {\n\tCONST64(0x428a2f98d728ae22), CONST64(0x7137449123ef65cd),\n\tCONST64(0xb5c0fbcfec4d3b2f), CONST64(0xe9b5dba58189dbbc),\n\tCONST64(0x3956c25bf348b538), CONST64(0x59f111f1b605d019),\n\tCONST64(0x923f82a4af194f9b), CONST64(0xab1c5ed5da6d8118),\n\tCONST64(0xd807aa98a3030242), CONST64(0x12835b0145706fbe),\n\tCONST64(0x243185be4ee4b28c), CONST64(0x550c7dc3d5ffb4e2),\n\tCONST64(0x72be5d74f27b896f), CONST64(0x80deb1fe3b1696b1),\n\tCONST64(0x9bdc06a725c71235), CONST64(0xc19bf174cf692694),\n\tCONST64(0xe49b69c19ef14ad2), CONST64(0xefbe4786384f25e3),\n\tCONST64(0x0fc19dc68b8cd5b5), CONST64(0x240ca1cc77ac9c65),\n\tCONST64(0x2de92c6f592b0275), CONST64(0x4a7484aa6ea6e483),\n\tCONST64(0x5cb0a9dcbd41fbd4), CONST64(0x76f988da831153b5),\n\tCONST64(0x983e5152ee66dfab), CONST64(0xa831c66d2db43210),\n\tCONST64(0xb00327c898fb213f), CONST64(0xbf597fc7beef0ee4),\n\tCONST64(0xc6e00bf33da88fc2), CONST64(0xd5a79147930aa725),\n\tCONST64(0x06ca6351e003826f), CONST64(0x142929670a0e6e70),\n\tCONST64(0x27b70a8546d22ffc), CONST64(0x2e1b21385c26c926),\n\tCONST64(0x4d2c6dfc5ac42aed), CONST64(0x53380d139d95b3df),\n\tCONST64(0x650a73548baf63de), CONST64(0x766a0abb3c77b2a8),\n\tCONST64(0x81c2c92e47edaee6), CONST64(0x92722c851482353b),\n\tCONST64(0xa2bfe8a14cf10364), CONST64(0xa81a664bbc423001),\n\tCONST64(0xc24b8b70d0f89791), CONST64(0xc76c51a30654be30),\n\tCONST64(0xd192e819d6ef5218), CONST64(0xd69906245565a910),\n\tCONST64(0xf40e35855771202a), CONST64(0x106aa07032bbd1b8),\n\tCONST64(0x19a4c116b8d2d0c8), CONST64(0x1e376c085141ab53),\n\tCONST64(0x2748774cdf8eeb99), CONST64(0x34b0bcb5e19b48a8),\n\tCONST64(0x391c0cb3c5c95a63), CONST64(0x4ed8aa4ae3418acb),\n\tCONST64(0x5b9cca4f7763e373), CONST64(0x682e6ff3d6b2b8a3),\n\tCONST64(0x748f82ee5defb2fc), CONST64(0x78a5636f43172f60),\n\tCONST64(0x84c87814a1f0ab72), CONST64(0x8cc702081a6439ec),\n\tCONST64(0x90befffa23631e28), CONST64(0xa4506cebde82bde9),\n\tCONST64(0xbef9a3f7b2c67915), CONST64(0xc67178f2e372532b),\n\tCONST64(0xca273eceea26619c), CONST64(0xd186b8c721c0c207),\n\tCONST64(0xeada7dd6cde0eb1e), CONST64(0xf57d4f7fee6ed178),\n\tCONST64(0x06f067aa72176fba), CONST64(0x0a637dc5a2c898a6),\n\tCONST64(0x113f9804bef90dae), CONST64(0x1b710b35131c471b),\n\tCONST64(0x28db77f523047d84), CONST64(0x32caab7b40c72493),\n\tCONST64(0x3c9ebe0a15c9bebc), CONST64(0x431d67c49c100d4c),\n\tCONST64(0x4cc5d4becb3e42b6), CONST64(0x597f299cfc657e2a),\n\tCONST64(0x5fcb6fab3ad6faec), CONST64(0x6c44198c4a475817)\n};\n#define Ch(x,y,z)       (z ^ (x & (y ^ z)))\n#define Maj(x,y,z)      (((x | y) & z) | (x & y))\n#define S(x, n)         ROR64c(x, n)\n#define R(x, n)         (((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((__u64)n))\n#define Sigma0(x)       (S(x, 28) ^ S(x, 34) ^ S(x, 39))\n#define Sigma1(x)       (S(x, 14) ^ S(x, 18) ^ S(x, 41))\n#define Gamma0(x)       (S(x, 1) ^ S(x, 8) ^ R(x, 7))\n#define Gamma1(x)       (S(x, 19) ^ S(x, 61) ^ R(x, 6))\n#define RND(a,b,c,d,e,f,g,h,i)\\\n\t\tt0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i];\\\n\t\tt1 = Sigma0(a) + Maj(a, b, c);\\\n\t\td += t0;\\\n\t\th  = t0 + t1;\n#define STORE64H(x, y) \\\n\tdo { \\\n\t\t(y)[0] = (unsigned char)(((x)>>56)&255);\\\n\t\t(y)[1] = (unsigned char)(((x)>>48)&255);\\\n\t\t(y)[2] = (unsigned char)(((x)>>40)&255);\\\n\t\t(y)[3] = (unsigned char)(((x)>>32)&255);\\\n\t\t(y)[4] = (unsigned char)(((x)>>24)&255);\\\n\t\t(y)[5] = (unsigned char)(((x)>>16)&255);\\\n\t\t(y)[6] = (unsigned char)(((x)>>8)&255);\\\n\t\t(y)[7] = (unsigned char)((x)&255); } while(0)\n\n#define LOAD64H(x, y)\\\n\tdo {x = \\\n\t\t(((__u64)((y)[0] & 255)) << 56) |\\\n\t\t(((__u64)((y)[1] & 255)) << 48) |\\\n\t\t(((__u64)((y)[2] & 255)) << 40) |\\\n\t\t(((__u64)((y)[3] & 255)) << 32) |\\\n\t\t(((__u64)((y)[4] & 255)) << 24) |\\\n\t\t(((__u64)((y)[5] & 255)) << 16) |\\\n\t\t(((__u64)((y)[6] & 255)) << 8) |\\\n\t\t(((__u64)((y)[7] & 255)));\\\n\t} while(0)\n\n#define ROR64c(x, y) \\\n    ( ((((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((__u64)(y)&CONST64(63))) | \\\n      ((x)<<((__u64)(64-((y)&CONST64(63)))))) & CONST64(0xFFFFFFFFFFFFFFFF))\n\nstruct sha512_state {\n\t__u64  length, state[8];\n\tunsigned long curlen;\n\tunsigned char buf[128];\n};\n\n/* This is a highly simplified version from libtomcrypt */\nstruct hash_state {\n\tstruct sha512_state sha512;\n};\n\nstatic void sha512_compress(struct hash_state * md, const unsigned char *buf)\n{\n\t__u64 S[8], W[80], t0, t1;\n\tint i;\n\n\t/* copy state into S */\n\tfor (i = 0; i < 8; i++) {\n\t\tS[i] = md->sha512.state[i];\n\t}\n\n\t/* copy the state into 1024-bits into W[0..15] */\n\tfor (i = 0; i < 16; i++) {\n\t\tLOAD64H(W[i], buf + (8*i));\n\t}\n\n\t/* fill W[16..79] */\n\tfor (i = 16; i < 80; i++) {\n\t\tW[i] = Gamma1(W[i - 2]) + W[i - 7] +\n\t\t\tGamma0(W[i - 15]) + W[i - 16];\n\t}\n\n\tfor (i = 0; i < 80; i += 8) {\n\t\tRND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],i+0);\n\t\tRND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],i+1);\n\t\tRND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],i+2);\n\t\tRND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],i+3);\n\t\tRND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],i+4);\n\t\tRND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],i+5);\n\t\tRND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],i+6);\n\t\tRND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],i+7);\n\t}\n\n\t /* feedback */\n\tfor (i = 0; i < 8; i++) {\n\t\tmd->sha512.state[i] = md->sha512.state[i] + S[i];\n\t}\n}\n\nstatic void sha512_init(struct hash_state * md)\n{\n\tmd->sha512.curlen = 0;\n\tmd->sha512.length = 0;\n\tmd->sha512.state[0] = CONST64(0x6a09e667f3bcc908);\n\tmd->sha512.state[1] = CONST64(0xbb67ae8584caa73b);\n\tmd->sha512.state[2] = CONST64(0x3c6ef372fe94f82b);\n\tmd->sha512.state[3] = CONST64(0xa54ff53a5f1d36f1);\n\tmd->sha512.state[4] = CONST64(0x510e527fade682d1);\n\tmd->sha512.state[5] = CONST64(0x9b05688c2b3e6c1f);\n\tmd->sha512.state[6] = CONST64(0x1f83d9abfb41bd6b);\n\tmd->sha512.state[7] = CONST64(0x5be0cd19137e2179);\n}\n\nstatic void sha512_done(struct hash_state * md, unsigned char *out)\n{\n\tint i;\n\n\t/* increase the length of the message */\n\tmd->sha512.length += (__u64)md->sha512.curlen * CONST64(8);\n\n\t/* append the '1' bit */\n\tmd->sha512.buf[md->sha512.curlen++] = (unsigned char)0x80;\n\n\t/* if the length is currently above 112 bytes we append zeros then\n\t * compress. Then we can fall back to padding zeros and length encoding\n\t * like normal. */\n\tif (md->sha512.curlen > 112) {\n\t\twhile (md->sha512.curlen < 128) {\n\t\t\tmd->sha512.buf[md->sha512.curlen++] = (unsigned char)0;\n\t\t}\n\t\tsha512_compress(md, md->sha512.buf);\n\t\tmd->sha512.curlen = 0;\n\t}\n\n\t/* pad upto 120 bytes of zeroes note: that from 112 to 120 is the 64 MSB\n\t * of the length. We assume that you won't hash > 2^64 bits of data. */\n\twhile (md->sha512.curlen < 120) {\n\t\tmd->sha512.buf[md->sha512.curlen++] = (unsigned char)0;\n\t}\n\n\t/* store length */\n\tSTORE64H(md->sha512.length, md->sha512.buf + 120);\n\tsha512_compress(md, md->sha512.buf);\n\n\t/* copy output */\n\tfor (i = 0; i < 8; i++) {\n\t\tSTORE64H(md->sha512.state[i], out+(8 * i));\n\t}\n}\n\n#define MIN(x, y) ( ((x)<(y))?(x):(y) )\n#define SHA512_BLOCKSIZE 128\nstatic void sha512_process(struct hash_state * md,\n\t\t\t   const unsigned char *in,\n\t\t\t   unsigned long inlen)\n{\n\tunsigned long n;\n\n\twhile (inlen > 0) {\n\t\tif (md->sha512.curlen == 0 && inlen >= SHA512_BLOCKSIZE) {\n\t\t\tsha512_compress(md, in);\n\t\t\tmd->sha512.length += SHA512_BLOCKSIZE * 8;\n\t\t\tin += SHA512_BLOCKSIZE;\n\t\t\tinlen -= SHA512_BLOCKSIZE;\n\t\t} else {\n\t\t\tn = MIN(inlen, (SHA512_BLOCKSIZE - md->sha512.curlen));\n\t\t\tmemcpy(md->sha512.buf + md->sha512.curlen,\n\t\t\t       in, (size_t)n);\n\t\t\tmd->sha512.curlen += n;\n\t\t\tin += n;\n\t\t\tinlen -= n;\n\t\t\tif (md->sha512.curlen == SHA512_BLOCKSIZE) {\n\t\t\t\tsha512_compress(md, md->sha512.buf);\n\t\t\t\tmd->sha512.length += SHA512_BLOCKSIZE * 8;\n\t\t\t\tmd->sha512.curlen = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid ext2fs_sha512(const unsigned char *in, unsigned long in_size,\n\t\t   unsigned char out[EXT2FS_SHA512_LENGTH])\n{\n\tstruct hash_state md;\n\n\tsha512_init(&md);\n\tsha512_process(&md, in, in_size);\n\tsha512_done(&md, out);\n}\n\n#ifdef UNITTEST\nstatic const struct {\n\tchar *msg;\n\tunsigned char hash[64];\n} tests[] = {\n\t{ \"\",\n\t  { 0xcf, 0x83, 0xe1, 0x35, 0x7e, 0xef, 0xb8, 0xbd,\n\t    0xf1, 0x54, 0x28, 0x50, 0xd6, 0x6d, 0x80, 0x07,\n\t    0xd6, 0x20, 0xe4, 0x05, 0x0b, 0x57, 0x15, 0xdc,\n\t    0x83, 0xf4, 0xa9, 0x21, 0xd3, 0x6c, 0xe9, 0xce,\n\t    0x47, 0xd0, 0xd1, 0x3c, 0x5d, 0x85, 0xf2, 0xb0,\n\t    0xff, 0x83, 0x18, 0xd2, 0x87, 0x7e, 0xec, 0x2f,\n\t    0x63, 0xb9, 0x31, 0xbd, 0x47, 0x41, 0x7a, 0x81,\n\t    0xa5, 0x38, 0x32, 0x7a, 0xf9, 0x27, 0xda, 0x3e }\n\t},\n\t{ \"abc\",\n\t  { 0xdd, 0xaf, 0x35, 0xa1, 0x93, 0x61, 0x7a, 0xba,\n\t    0xcc, 0x41, 0x73, 0x49, 0xae, 0x20, 0x41, 0x31,\n\t    0x12, 0xe6, 0xfa, 0x4e, 0x89, 0xa9, 0x7e, 0xa2,\n\t    0x0a, 0x9e, 0xee, 0xe6, 0x4b, 0x55, 0xd3, 0x9a,\n\t    0x21, 0x92, 0x99, 0x2a, 0x27, 0x4f, 0xc1, 0xa8,\n\t    0x36, 0xba, 0x3c, 0x23, 0xa3, 0xfe, 0xeb, 0xbd,\n\t    0x45, 0x4d, 0x44, 0x23, 0x64, 0x3c, 0xe8, 0x0e,\n\t    0x2a, 0x9a, 0xc9, 0x4f, 0xa5, 0x4c, 0xa4, 0x9f }\n\t},\n\t{ \"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu\",\n\t  { 0x8e, 0x95, 0x9b, 0x75, 0xda, 0xe3, 0x13, 0xda,\n\t    0x8c, 0xf4, 0xf7, 0x28, 0x14, 0xfc, 0x14, 0x3f,\n\t    0x8f, 0x77, 0x79, 0xc6, 0xeb, 0x9f, 0x7f, 0xa1,\n\t    0x72, 0x99, 0xae, 0xad, 0xb6, 0x88, 0x90, 0x18,\n\t    0x50, 0x1d, 0x28, 0x9e, 0x49, 0x00, 0xf7, 0xe4,\n\t    0x33, 0x1b, 0x99, 0xde, 0xc4, 0xb5, 0x43, 0x3a,\n\t    0xc7, 0xd3, 0x29, 0xee, 0xb6, 0xdd, 0x26, 0x54,\n\t    0x5e, 0x96, 0xe5, 0x5b, 0x87, 0x4b, 0xe9, 0x09 }\n\t},\n};\n\nint main(int argc, char **argv)\n{\n\tint i;\n\tint errors = 0;\n\tunsigned char tmp[64];\n\n\tfor (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {\n\t\tunsigned char *msg = (unsigned char *) tests[i].msg;\n\t\tint len = strlen(tests[i].msg);\n\n\t\text2fs_sha512(msg, len, tmp);\n\t\tprintf(\"SHA512 test message %d: \", i);\n\t\tif (memcmp(tmp, tests[i].hash, 64) != 0) {\n\t\t\tprintf(\"FAILED\\n\");\n\t\t\terrors++;\n\t\t} else\n\t\t\tprintf(\"OK\\n\");\n\t}\n\treturn errors;\n}\n\n#endif /* UNITTEST */\n"
  },
  {
    "path": "src/ext2fs/symlink.c",
    "content": "/*\n * symlink.c --- make a symlink in the filesystem, based on mkdir.c\n *\n * Copyright (c) 2012, Intel Corporation.\n * All Rights Reserved.\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#include <string.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <fcntl.h>\n#include <time.h>\n#if HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#if HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\n#ifndef HAVE_STRNLEN\n/*\n * Incredibly, libc5 doesn't appear to have strnlen.  So we have to\n * provide our own.\n */\nstatic int my_strnlen(const char * s, int count)\n{\n\tconst char *cp = s;\n\n\twhile (count-- && *cp)\n\t\tcp++;\n\treturn cp - s;\n}\n#define strnlen(str, x) my_strnlen((str),(x))\n#endif\n\nerrcode_t ext2fs_symlink(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t ino,\n\t\t\t const char *name, const char *target)\n{\n\terrcode_t\t\tretval;\n\tstruct ext2_inode\tinode;\n\text2_ino_t\t\tscratch_ino;\n\tblk64_t\t\t\tblk;\n\tint\t\t\tfastlink, inlinelink;\n\tunsigned int\t\ttarget_len;\n\tchar\t\t\t*block_buf = 0;\n\tint\t\t\tdrop_refcount = 0;\n\n\tEXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);\n\n\t/*\n\t * The Linux kernel doesn't allow for links longer than a block\n\t * (counting the NUL terminator)\n\t */\n\ttarget_len = strnlen(target, fs->blocksize + 1);\n\tif (target_len >= fs->blocksize) {\n\t\tretval = EXT2_ET_INVALID_ARGUMENT;\n\t\tgoto cleanup;\n\t}\n\n\t/*\n\t * Allocate a data block for slow links\n\t */\n\tretval = ext2fs_get_mem(fs->blocksize, &block_buf);\n\tif (retval)\n\t\tgoto cleanup;\n\tmemset(block_buf, 0, fs->blocksize);\n\tstrncpy(block_buf, target, fs->blocksize);\n\n\tmemset(&inode, 0, sizeof(struct ext2_inode));\n\tfastlink = (target_len < sizeof(inode.i_block));\n\tif (!fastlink) {\n\t\tretval = ext2fs_new_block2(fs, ext2fs_find_inode_goal(fs, ino,\n\t\t\t\t\t\t\t\t      &inode,\n\t\t\t\t\t\t\t\t      0),\n\t\t\t\t\t   NULL, &blk);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t}\n\n\t/*\n\t * Allocate an inode, if necessary\n\t */\n\tif (!ino) {\n\t\tretval = ext2fs_new_inode(fs, parent, LINUX_S_IFLNK | 0755,\n\t\t\t\t\t  0, &ino);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t}\n\n\t/*\n\t * Create the inode structure....\n\t */\n\tinode.i_mode = LINUX_S_IFLNK | 0777;\n\tinode.i_uid = inode.i_gid = 0;\n\tinode.i_links_count = 1;\n\tretval = ext2fs_inode_size_set(fs, &inode, target_len);\n\tif (retval)\n\t\tgoto cleanup;\n\t/* The time fields are set by ext2fs_write_new_inode() */\n\n\tinlinelink = !fastlink && ext2fs_has_feature_inline_data(fs->super);\n\tif (fastlink) {\n\t\t/* Fast symlinks, target stored in inode */\n\t\tstrcpy((char *)&inode.i_block, target);\n\t} else if (inlinelink) {\n\t\t/* Try inserting an inline data symlink */\n\t\tinode.i_flags |= EXT4_INLINE_DATA_FL;\n\t\tretval = ext2fs_write_new_inode(fs, ino, &inode);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t\tretval = ext2fs_inline_data_set(fs, ino, &inode, block_buf,\n\t\t\t\t\t\ttarget_len);\n\t\tif (retval) {\n\t\t\tinode.i_flags &= ~EXT4_INLINE_DATA_FL;\n\t\t\tinlinelink = 0;\n\t\t\tgoto need_block;\n\t\t}\n\t\tretval = ext2fs_read_inode(fs, ino, &inode);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t} else {\nneed_block:\n\t\t/* Slow symlinks, target stored in the first block */\n\t\text2fs_iblk_set(fs, &inode, 1);\n\t\tif (ext2fs_has_feature_extents(fs->super)) {\n\t\t\t/*\n\t\t\t * The extent bmap is setup after the inode and block\n\t\t\t * have been written out below.\n\t\t\t */\n\t\t\tinode.i_flags |= EXT4_EXTENTS_FL;\n\t\t}\n\t}\n\n\t/*\n\t * Write out the inode and inode data block.  The inode generation\n\t * number is assigned by write_new_inode, which means that the\n\t * operations using ino must come after it.\n\t */\n\tif (inlinelink)\n\t\tretval = ext2fs_write_inode(fs, ino, &inode);\n\telse\n\t\tretval = ext2fs_write_new_inode(fs, ino, &inode);\n\tif (retval)\n\t\tgoto cleanup;\n\n\tif (!fastlink && !inlinelink) {\n\t\tretval = ext2fs_bmap2(fs, ino, &inode, NULL, BMAP_SET, 0, NULL,\n\t\t\t\t      &blk);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\n\t\tretval = io_channel_write_blk64(fs->io, blk, 1, block_buf);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t}\n\n\t/*\n\t * Update accounting....\n\t */\n\tif (!fastlink && !inlinelink)\n\t\text2fs_block_alloc_stats2(fs, blk, +1);\n\text2fs_inode_alloc_stats2(fs, ino, +1, 0);\n\tdrop_refcount = 1;\n\n\t/*\n\t * Link the symlink into the filesystem hierarchy\n\t */\n\tif (name) {\n\t\tretval = ext2fs_lookup(fs, parent, name, strlen(name), 0,\n\t\t\t\t       &scratch_ino);\n\t\tif (!retval) {\n\t\t\tretval = EXT2_ET_FILE_EXISTS;\n\t\t\tgoto cleanup;\n\t\t}\n\t\tif (retval != EXT2_ET_FILE_NOT_FOUND)\n\t\t\tgoto cleanup;\n\t\tretval = ext2fs_link(fs, parent, name, ino, EXT2_FT_SYMLINK);\n\t\tif (retval)\n\t\t\tgoto cleanup;\n\t}\n\tdrop_refcount = 0;\n\ncleanup:\n\tif (block_buf)\n\t\text2fs_free_mem(&block_buf);\n\tif (drop_refcount) {\n\t\tif (!fastlink && !inlinelink)\n\t\t\text2fs_block_alloc_stats2(fs, blk, -1);\n\t\text2fs_inode_alloc_stats2(fs, ino, -1, 0);\n\t}\n\treturn retval;\n}\n\n/*\n * Test whether an inode is a fast symlink.\n *\n * A fast symlink has its symlink data stored in inode->i_block.\n */\nint ext2fs_is_fast_symlink(struct ext2_inode *inode)\n{\n\treturn LINUX_S_ISLNK(inode->i_mode) && EXT2_I_SIZE(inode) &&\n\t       EXT2_I_SIZE(inode) < sizeof(inode->i_block);\n}\n"
  },
  {
    "path": "src/ext2fs/valid_blk.c",
    "content": "/*\n * valid_blk.c --- does the inode have valid blocks?\n *\n * Copyright 1997 by Theodore Ts'o\n *\n * %Begin-Header%\n * This file may be redistributed under the terms of the GNU Library\n * General Public License, version 2.\n * %End-Header%\n */\n\n#include \"config.h\"\n#include <stdio.h>\n#if HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <string.h>\n#include <time.h>\n\n#include \"ext2_fs.h\"\n#include \"ext2fs.h\"\n\n/*\n * This function returns 1 if the inode's block entries actually\n * contain block entries.\n */\nint ext2fs_inode_has_valid_blocks2(ext2_filsys fs, struct ext2_inode *inode)\n{\n\t/*\n\t * Only directories, regular files, and some symbolic links\n\t * have valid block entries.\n\t */\n\tif (!LINUX_S_ISDIR(inode->i_mode) && !LINUX_S_ISREG(inode->i_mode) &&\n\t    !LINUX_S_ISLNK(inode->i_mode))\n\t\treturn 0;\n\n\t/*\n\t * If the symbolic link is a \"fast symlink\", then the symlink\n\t * target is stored in the block entries.\n\t */\n\tif (LINUX_S_ISLNK (inode->i_mode)) {\n\t\tif (ext2fs_file_acl_block(fs, inode) == 0) {\n\t\t\t/* With no EA block, we can rely on i_blocks */\n\t\t\tif (inode->i_blocks == 0)\n\t\t\t\treturn 0;\n\t\t} else {\n\t\t\t/* With an EA block, life gets more tricky */\n\t\t\tif (inode->i_size >= EXT2_N_BLOCKS*4)\n\t\t\t\treturn 1; /* definitely using i_block[] */\n\t\t\tif (inode->i_size > 4 && inode->i_block[1] == 0)\n\t\t\t\treturn 1; /* definitely using i_block[] */\n\t\t\treturn 0; /* Probably a fast symlink */\n\t\t}\n\t}\n\n\t/*\n\t * If this inode has inline data, it shouldn't have valid block\n\t * entries.\n\t */\n\tif (inode->i_flags & EXT4_INLINE_DATA_FL)\n\t\treturn 0;\n\treturn 1;\n}\n\nint ext2fs_inode_has_valid_blocks(struct ext2_inode *inode)\n{\n\treturn ext2fs_inode_has_valid_blocks2(NULL, inode);\n}\n"
  },
  {
    "path": "src/format.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Formatting function calls\n * Copyright © 2011-2025 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <windowsx.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n#include <process.h>\n#include <stddef.h>\n#include <ctype.h>\n#include <locale.h>\n#include <assert.h>\n#if !defined(__MINGW32__)\n#include <vds.h>\n#endif\n\n#include \"rufus.h\"\n#include \"format.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"settings.h\"\n#include \"winio.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n\n#include \"br.h\"\n#include \"vhd.h\"\n#include \"wue.h\"\n#include \"fat16.h\"\n#include \"fat32.h\"\n#include \"ntfs.h\"\n#include \"partition_info.h\"\n#include \"file.h\"\n#include \"drive.h\"\n#include \"format.h\"\n#include \"badblocks.h\"\n#include \"bled/bled.h\"\n#include \"../res/grub/grub_version.h\"\n\n/* Numbers of buffer used for asynchronous DD reads */\n#define NUM_BUFFERS 2\n\n/*\n * Globals\n */\nconst char* FileSystemLabel[FS_MAX] = { \"FAT\", \"FAT32\", \"NTFS\", \"UDF\", \"exFAT\", \"ReFS\", \"ext2\", \"ext3\", \"ext4\" };\nDWORD ErrorStatus = 0, LastWriteError = 0;\nbadblocks_report report = { 0 };\nstatic float format_percent = 0.0f;\nstatic int task_number = 0, actual_fs_type;\nstatic unsigned int sec_buf_pos = 0;\nextern const int nb_steps[FS_MAX];\nextern const char* md5sum_name[2];\nextern uint32_t dur_mins, dur_secs;\nextern BOOL force_large_fat32, enable_ntfs_compression, lock_drive, zero_drive, fast_zeroing, enable_file_indexing;\nextern BOOL write_as_image, use_vds, write_as_esp, is_vds_available, has_ffu_support, use_rufus_mbr;\nextern char* archive_path;\nuint8_t *grub2_buf = NULL, *sec_buf = NULL;\nlong grub2_len;\n\n/*\n * Convert the fmifs outputs messages (that use an OEM code page) to UTF-8\n */\nstatic void OutputUTF8Message(const char* src)\n{\n\tint len;\n\twchar_t* wdst = NULL;\n\n\tif (src == NULL)\n\t\tgoto out;\n\tlen = (int)safe_strlen(src);\n\twhile ((len > 0) && ((src[len-1] == 0x0A) || (src[len-1] == 0x0D) || (src[len-1] == ' ')))\n\t\tlen--;\n\tif (len == 0)\n\t\tgoto out;\n\n\tlen = MultiByteToWideChar(CP_OEMCP, 0, src, len, NULL, 0);\n\tif (len == 0)\n\t\tgoto out;\n\twdst = (wchar_t*)calloc(len+1, sizeof(wchar_t));\n\tif ((wdst == NULL) || (MultiByteToWideChar(CP_OEMCP, 0, src, len, wdst, len+1) == 0))\n\t\tgoto out;\n\tuprintf(\"%S\", wdst);\n\nout:\n\tsafe_free(wdst);\n}\n\n/*\n * FormatEx callback. Return FALSE to halt operations\n */\nstatic BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command, DWORD Action, PVOID pData)\n{\n\tchar percent_str[8];\n\tif (IS_ERROR(ErrorStatus))\n\t\treturn FALSE;\n\n\tif_assert_fails((actual_fs_type >= 0) && (actual_fs_type < FS_MAX))\n\t\treturn FALSE;\n\n\tswitch(Command) {\n\tcase FCC_PROGRESS:\n\t\tstatic_sprintf(percent_str, \"%lu%%\", *((DWORD*)pData));\n\t\tPrintInfo(0, MSG_217, percent_str);\n\t\tUpdateProgress(OP_FORMAT, 1.0f * (*((DWORD*)pData)));\n\t\tbreak;\n\tcase FCC_STRUCTURE_PROGRESS:\t// No progress on quick format\n\t\tif (task_number < nb_steps[actual_fs_type] - 1) {\n\t\t\tif (task_number == 0)\n\t\t\t\tuprintf(\"Creating file system...\");\n\t\t\tPrintInfo(0, MSG_218, ++task_number, nb_steps[actual_fs_type]);\n\t\t\tformat_percent += 100.0f / (1.0f * nb_steps[actual_fs_type]);\n\t\t\tUpdateProgress(OP_CREATE_FS, format_percent);\n\t\t}\n\t\tbreak;\n\tcase FCC_DONE:\n\t\tPrintInfo(0, MSG_218, nb_steps[actual_fs_type], nb_steps[actual_fs_type]);\n\t\tUpdateProgress(OP_CREATE_FS, 100.0f);\n\t\tif(*(BOOLEAN*)pData == FALSE) {\n\t\t\tuprintf(\"Error while formatting\");\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_GEN_FAILURE);\n\t\t}\n\t\tbreak;\n\tcase FCC_DONE_WITH_STRUCTURE:\n\t\tbreak;\n\tcase FCC_INCOMPATIBLE_FILE_SYSTEM:\n\t\tuprintf(\"Incompatible File System\");\n\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_INCOMPATIBLE_FS));\n\t\tbreak;\n\tcase FCC_ACCESS_DENIED:\n\t\tuprintf(\"Access denied\");\n\t\tErrorStatus = RUFUS_ERROR(ERROR_ACCESS_DENIED);\n\t\tbreak;\n\tcase FCC_MEDIA_WRITE_PROTECTED:\n\t\tuprintf(\"Media is write protected\");\n\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_PROTECT);\n\t\tbreak;\n\tcase FCC_VOLUME_IN_USE:\n\t\tuprintf(\"Volume is in use\");\n\t\tErrorStatus = RUFUS_ERROR(ERROR_DEVICE_IN_USE);\n\t\tbreak;\n\tcase FCC_DEVICE_NOT_READY:\n\t\tuprintf(\"The device is not ready\");\n\t\tErrorStatus = RUFUS_ERROR(ERROR_NOT_READY);\n\t\tbreak;\n\tcase FCC_CANT_QUICK_FORMAT:\n\t\tuprintf(\"Cannot quick format this volume\");\n\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_QUICK_FORMAT));\n\t\tbreak;\n\tcase FCC_BAD_LABEL:\n\t\tuprintf(\"Bad label\");\n\t\tErrorStatus = RUFUS_ERROR(ERROR_LABEL_TOO_LONG);\n\t\tbreak;\n\tcase FCC_OUTPUT:\n\t\tOutputUTF8Message(((PTEXTOUTPUT)pData)->Output);\n\t\tbreak;\n\tcase FCC_CLUSTER_SIZE_TOO_BIG:\n\tcase FCC_CLUSTER_SIZE_TOO_SMALL:\n\t\tuprintf(\"Unsupported cluster size\");\n\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_INVALID_CLUSTER_SIZE));\n\t\tbreak;\n\tcase FCC_VOLUME_TOO_BIG:\n\tcase FCC_VOLUME_TOO_SMALL:\n\t\tuprintf(\"Volume is too %s\", (Command == FCC_VOLUME_TOO_BIG) ? \"big\" : \"small\");\n\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_INVALID_VOLUME_SIZE));\n\t\tbreak;\n\tcase FCC_NO_MEDIA_IN_DRIVE:\n\t\tuprintf(\"No media in drive\");\n\t\tErrorStatus = RUFUS_ERROR(ERROR_NO_MEDIA_IN_DRIVE);\n\t\tbreak;\n\tcase FCC_ALIGNMENT_VIOLATION:\n\t\tuprintf(\"Partition start offset is not aligned to the cluster size\");\n\t\tErrorStatus = RUFUS_ERROR(ERROR_OFFSET_ALIGNMENT_VIOLATION);\n\t\tbreak;\n\tdefault:\n\t\tuprintf(\"FormatExCallback: Received unhandled command 0x%02X - aborting\", Command);\n\t\tErrorStatus = RUFUS_ERROR(ERROR_NOT_SUPPORTED);\n\t\tbreak;\n\t}\n\treturn (!IS_ERROR(ErrorStatus));\n}\n\n/*\n * Chkdsk callback. Return FALSE to halt operations\n */\nstatic BOOLEAN __stdcall ChkdskCallback(FILE_SYSTEM_CALLBACK_COMMAND Command, DWORD Action, PVOID pData)\n{\n\tDWORD* percent;\n\tif (IS_ERROR(ErrorStatus))\n\t\treturn FALSE;\n\n\tswitch (Command) {\n\tcase FCC_PROGRESS:\n\tcase FCC_CHECKDISK_PROGRESS:\n\t\tpercent = (DWORD*)pData;\n\t\tPrintInfo(0, MSG_219, *percent);\n\t\tbreak;\n\tcase FCC_DONE:\n\t\tif (*(BOOLEAN*)pData == FALSE) {\n\t\t\tuprintf(\"Error while checking disk\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tbreak;\n\tcase FCC_UNKNOWN1A:\n\tcase FCC_DONE_WITH_STRUCTURE:\n\t\t// Silence these specific calls\n\t\tbreak;\n\tcase FCC_INCOMPATIBLE_FILE_SYSTEM:\n\t\tuprintf(\"Incompatible File System\");\n\t\treturn FALSE;\n\tcase FCC_ACCESS_DENIED:\n\t\tuprintf(\"Access denied\");\n\t\treturn FALSE;\n\tcase FCC_MEDIA_WRITE_PROTECTED:\n\t\tuprintf(\"Media is write protected\");\n\t\treturn FALSE;\n\tcase FCC_VOLUME_IN_USE:\n\t\tuprintf(\"Volume is in use\");\n\t\treturn FALSE;\n\tcase FCC_OUTPUT:\n\t\tOutputUTF8Message(((PTEXTOUTPUT)pData)->Output);\n\t\tbreak;\n\tcase FCC_NO_MEDIA_IN_DRIVE:\n\t\tuprintf(\"No media in drive\");\n\t\treturn FALSE;\n\tcase FCC_READ_ONLY_MODE:\n\t\tuprintf(\"Media has been switched to read-only - Leaving checkdisk\");\n\t\tbreak;\n\tdefault:\n\t\tuprintf(\"ChkdskExCallback: received unhandled command %X\", Command);\n\t\t// Assume the command isn't an error\n\t\tbreak;\n\t}\n\treturn TRUE;\n}\n\n/*\n * Converts an UTF-8 label to a valid FAT/NTFS one\n * TODO: Use IVdsService::QueryFileSystemTypes -> VDS_FILE_SYSTEM_TYPE_PROP\n * to get the list of unauthorised and max length for each FS.\n */\nstatic void ToValidLabel(char* Label, BOOL bFAT)\n{\n\tsize_t i, j, k;\n\tBOOL found;\n\tconst WCHAR unauthorized[] = L\"*?,;:/\\\\|+=<>[]\\\"\";\n\tconst WCHAR to_underscore[] = L\"\\t.\";\n\tchar label[16] = { 0 };\n\tWCHAR *wLabel = utf8_to_wchar(Label);\n\n\tif (wLabel == NULL)\n\t\treturn;\n\n\tfor (i = 0, k = 0; i < wcslen(wLabel); i++) {\n\t\tif (bFAT) {\t// NTFS does allows all the FAT unauthorized above\n\t\t\tfound = FALSE;\n\t\t\tfor (j = 0; j < wcslen(unauthorized); j++) {\n\t\t\t\tif (wLabel[i] == unauthorized[j]) {\n\t\t\t\t\tfound = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// A FAT label that contains extended chars will be rejected\n\t\t\tif (wLabel[i] >= 0x80) {\n\t\t\t\twLabel[k++] = L'_';\n\t\t\t\tfound = TRUE;\n\t\t\t}\n\t\t\tif (found)\n\t\t\t\tcontinue;\n\t\t}\n\t\tfound = FALSE;\n\t\tfor (j = 0; j < wcslen(to_underscore); j++) {\n\t\t\tif (wLabel[i] == to_underscore[j]) {\n\t\t\t\twLabel[k++] = '_';\n\t\t\t\tfound = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (found)\n\t\t\tcontinue;\n\t\twLabel[k++] = bFAT ? toupper(wLabel[i]) : wLabel[i];\n\t}\n\twLabel[k] = 0;\n\n\tif (bFAT) {\n\t\tif (wcslen(wLabel) > 11)\n\t\t\twLabel[11] = 0;\n\t\tfor (i = 0, j = 0; wLabel[i] != 0 ; i++)\n\t\t\tif (wLabel[i] == '_')\n\t\t\t\tj++;\n\t\tif (i < 2*j) {\n\t\t\t// If the final label is mostly underscore, use an alternate label according to the\n\t\t\t// size (eg: \"256 MB\", \"7.9 GB\"). Note that we can't use SelectedDrive.proposed_label\n\t\t\t// here as it may contain localized character for GB or MB, so make sure that the\n\t\t\t// effective label we use is an English one, and also make sure we convert the dot.\n\t\t\tstatic_sprintf(label, \"%s\", SizeToHumanReadable(SelectedDrive.DiskSize, TRUE, FALSE));\n\t\t\tfor (i = 0; label[i] != 0; i++)\n\t\t\t\twLabel[i] = (label[i] == '.') ? '_' : label[i];\n\t\t\twLabel[i] = 0;\n\t\t\tuprintf(\"FAT label is mostly underscores. Using '%S' label instead.\", wLabel);\n\t\t}\n\t} else if (wcslen(wLabel) > 32) {\n\t\twLabel[32] = 0;\n\t}\n\n\t// Needed for disk by label isolinux.cfg workaround\n\twchar_to_utf8_no_alloc(wLabel, img_report.usb_label, sizeof(img_report.usb_label));\n\tsafe_strcpy(Label, strlen(Label) + 1, img_report.usb_label);\n\tfree(wLabel);\n}\n\n/*\n * Call on VDS to format a partition\n */\nstatic BOOL FormatNativeVds(DWORD DriveIndex, uint64_t PartitionOffset, DWORD ClusterSize, LPCSTR FSName, LPCSTR Label, DWORD Flags)\n{\n\tBOOL r = FALSE, bFoundVolume = FALSE;\n\tHRESULT hr;\n\tULONG ulFetched;\n\tIVdsServiceLoader *pLoader;\n\tIVdsService *pService;\n\tIEnumVdsObject *pEnum;\n\tIUnknown *pUnk;\n\tchar* VolumeName = NULL;\n\tWCHAR *wVolumeName = NULL, *wLabel = utf8_to_wchar(Label), *wFSName = utf8_to_wchar(FSName);\n\n\tif ((strcmp(FSName, FileSystemLabel[FS_EXFAT]) == 0) && !((dur_mins == 0) && (dur_secs == 0))) {\n\t\tPrintInfo(0, MSG_220, FSName, dur_mins, dur_secs);\n\t} else {\n\t\tPrintInfo(0, MSG_222, FSName);\n\t}\n\tuprintf(\"Formatting to %s (using VDS)\", FSName);\n\n\tUpdateProgressWithInfoInit(NULL, TRUE);\n\tVolumeName = GetLogicalName(DriveIndex, PartitionOffset, TRUE, TRUE);\n\twVolumeName = utf8_to_wchar(VolumeName);\n\tif (wVolumeName == NULL) {\n\t\tuprintf(\"Could not read volume name\");\n\t\tErrorStatus = RUFUS_ERROR(ERROR_GEN_FAILURE);\n\t\tgoto out;\n\t}\n\n\t// Initialize COM\n\tIGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));\n\tIGNORE_RETVAL(CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_CONNECT,\n\t\tRPC_C_IMP_LEVEL_IMPERSONATE, NULL, 0, NULL));\n\n\t// Create a VDS Loader Instance\n\thr = CoCreateInstance(&CLSID_VdsLoader, NULL, CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,\n\t\t&IID_IVdsServiceLoader, (void **)&pLoader);\n\tif (hr != S_OK) {\n\t\tVDS_SET_ERROR(hr);\n\t\tuprintf(\"Could not create VDS Loader Instance: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t// Load the VDS Service\n\thr = IVdsServiceLoader_LoadService(pLoader, L\"\", &pService);\n\tIVdsServiceLoader_Release(pLoader);\n\tif (hr != S_OK) {\n\t\tVDS_SET_ERROR(hr);\n\t\tuprintf(\"Could not load VDS Service: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t// Wait for the Service to become ready if needed\n\thr = IVdsService_WaitForServiceReady(pService);\n\tif (hr != S_OK) {\n\t\tVDS_SET_ERROR(hr);\n\t\tuprintf(\"VDS Service is not ready: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t// Query the VDS Service Providers\n\thr = IVdsService_QueryProviders(pService, VDS_QUERY_SOFTWARE_PROVIDERS, &pEnum);\n\tif (hr != S_OK) {\n\t\tVDS_SET_ERROR(hr);\n\t\tuprintf(\"Could not query VDS Service Providers: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\twhile (IEnumVdsObject_Next(pEnum, 1, &pUnk, &ulFetched) == S_OK) {\n\t\tIVdsProvider *pProvider;\n\t\tIVdsSwProvider *pSwProvider;\n\t\tIEnumVdsObject *pEnumPack;\n\t\tIUnknown *pPackUnk;\n\t\tCHECK_FOR_USER_CANCEL;\n\n\t\t// Get VDS Provider\n\t\thr = IUnknown_QueryInterface(pUnk, &IID_IVdsProvider, (void **)&pProvider);\n\t\tIUnknown_Release(pUnk);\n\t\tif (hr != S_OK) {\n\t\t\tVDS_SET_ERROR(hr);\n\t\t\tuprintf(\"Could not get VDS Provider: %s\", WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\n\t\t// Get VDS Software Provider\n\t\thr = IVdsSwProvider_QueryInterface(pProvider, &IID_IVdsSwProvider, (void **)&pSwProvider);\n\t\tIVdsProvider_Release(pProvider);\n\t\tif (hr != S_OK) {\n\t\t\tVDS_SET_ERROR(hr);\n\t\t\tuprintf(\"Could not get VDS Software Provider: %s\", WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\n\t\t// Get VDS Software Provider Packs\n\t\thr = IVdsSwProvider_QueryPacks(pSwProvider, &pEnumPack);\n\t\tIVdsSwProvider_Release(pSwProvider);\n\t\tif (hr != S_OK) {\n\t\t\tVDS_SET_ERROR(hr);\n\t\t\tuprintf(\"Could not get VDS Software Provider Packs: %s\", WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\n\t\t// Enumerate Provider Packs\n\t\twhile (IEnumVdsObject_Next(pEnumPack, 1, &pPackUnk, &ulFetched) == S_OK) {\n\t\t\tIVdsPack *pPack;\n\t\t\tIEnumVdsObject *pEnumVolume;\n\t\t\tIUnknown *pVolumeUnk;\n\t\t\tCHECK_FOR_USER_CANCEL;\n\n\t\t\thr = IUnknown_QueryInterface(pPackUnk, &IID_IVdsPack, (void **)&pPack);\n\t\t\tIUnknown_Release(pPackUnk);\n\t\t\tif (hr != S_OK) {\n\t\t\t\tVDS_SET_ERROR(hr);\n\t\t\t\tuprintf(\"Could not query VDS Software Provider Pack: %s\", WindowsErrorString());\n\t\t\t\tgoto out;\n\t\t\t}\n\n\t\t\t// Use the pack interface to access the volumes\n\t\t\thr = IVdsPack_QueryVolumes(pPack, &pEnumVolume);\n\t\t\tif (hr != S_OK) {\n\t\t\t\tVDS_SET_ERROR(hr);\n\t\t\t\tuprintf(\"Could not query VDS volumes: %s\", WindowsErrorString());\n\t\t\t\tgoto out;\n\t\t\t}\n\n\t\t\t// List volumes\n\t\t\twhile (IEnumVdsObject_Next(pEnumVolume, 1, &pVolumeUnk, &ulFetched) == S_OK) {\n\t\t\t\tBOOL match;\n\t\t\t\tHRESULT hr2 = E_FAIL;\n\t\t\t\tVDS_VOLUME_PROP VolumeProps;\n\t\t\t\tLPWSTR *wszPathArray;\n\t\t\t\tULONG ulPercentCompleted, ulNumberOfPaths;\n\t\t\t\tUSHORT usFsVersion = 0;\n\t\t\t\tIVdsVolume *pVolume;\n\t\t\t\tIVdsAsync* pAsync;\n\t\t\t\tIVdsVolumeMF3 *pVolumeMF3;\n\t\t\t\tCHECK_FOR_USER_CANCEL;\n\n\t\t\t\t// Get the volume interface.\n\t\t\t\thr = IUnknown_QueryInterface(pVolumeUnk, &IID_IVdsVolume, (void **)&pVolume);\n\t\t\t\tif (hr != S_OK) {\n\t\t\t\t\tVDS_SET_ERROR(hr);\n\t\t\t\t\tuprintf(\"Could not query VDS Volume Interface: %s\", WindowsErrorString());\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\n\t\t\t\thr = IVdsVolume_GetProperties(pVolume, &VolumeProps);\n\t\t\t\tif ((hr != S_OK) && (hr != VDS_S_PROPERTIES_INCOMPLETE)) {\n\t\t\t\t\tVDS_SET_ERROR(hr);\n\t\t\t\t\tIVdsVolume_Release(pVolume);\n\t\t\t\t\tuprintf(\"Could not query VDS Volume Properties: %s\", WindowsErrorString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tCoTaskMemFree(VolumeProps.pwszName);\n\n\t\t\t\t// Instantiate the IVdsVolumeMF3 interface for our volume.\n\t\t\t\thr = IVdsVolume_QueryInterface(pVolume, &IID_IVdsVolumeMF3, (void **)&pVolumeMF3);\n\t\t\t\tIVdsVolume_Release(pVolume);\n\t\t\t\tif (hr != S_OK) {\n\t\t\t\t\tVDS_SET_ERROR(hr);\n\t\t\t\t\tuprintf(\"Could not access VDS VolumeMF3 interface: %s\", WindowsErrorString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Query the volume GUID\n\t\t\t\thr = IVdsVolumeMF3_QueryVolumeGuidPathnames(pVolumeMF3, &wszPathArray, &ulNumberOfPaths);\n\t\t\t\tif (hr != S_OK) {\n\t\t\t\t\tVDS_SET_ERROR(hr);\n\t\t\t\t\tuprintf(\"Could not query VDS VolumeGuidPathnames: %s\", WindowsErrorString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (ulNumberOfPaths > 1)\n\t\t\t\t\tuprintf(\"Notice: Volume %S has more than one GUID...\", wszPathArray[0]);\n\n\t\t\t\tmatch = (wcscmp(wVolumeName, wszPathArray[0]) == 0);\n\t\t\t\tCoTaskMemFree(wszPathArray);\n\t\t\t\tif (!match)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tbFoundVolume = TRUE;\n\t\t\t\tif (strcmp(Label, FileSystemLabel[FS_UDF]) == 0)\n\t\t\t\t\tusFsVersion = ReadSetting32(SETTING_USE_UDF_VERSION);\n\t\t\t\tif (ClusterSize < 0x200) {\n\t\t\t\t\tClusterSize = 0;\n\t\t\t\t\tuprintf(\"Using default cluster size\");\n\t\t\t\t} else {\n\t\t\t\t\tuprintf(\"Using cluster size: %d bytes\", ClusterSize);\n\t\t\t\t}\n\t\t\t\tformat_percent = 0.0f;\n\t\t\t\tuprintf(\"%s format was selected\", (Flags & FP_QUICK) ? \"Quick\" : \"Slow\");\n\t\t\t\tif (Flags & FP_COMPRESSION)\n\t\t\t\t\tuprintf(\"NTFS compression is enabled\");\n\n\t\t\t\thr = IVdsVolumeMF3_FormatEx2(pVolumeMF3, wFSName, usFsVersion, ClusterSize, wLabel, Flags, &pAsync);\n\t\t\t\twhile (SUCCEEDED(hr)) {\n\t\t\t\t\tif (IS_ERROR(ErrorStatus)) {\n\t\t\t\t\t\tIVdsAsync_Cancel(pAsync);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\thr = IVdsAsync_QueryStatus(pAsync, &hr2, &ulPercentCompleted);\n\t\t\t\t\tif (SUCCEEDED(hr)) {\n\t\t\t\t\t\tif (Flags & FP_QUICK) {\n\t\t\t\t\t\t\t// Progress report on quick format is useless, so we'll just pretend we have 2 tasks\n\t\t\t\t\t\t\tPrintInfo(0, MSG_218, (ulPercentCompleted < 100) ? 1 : 2, 2);\n\t\t\t\t\t\t\tUpdateProgress(OP_CREATE_FS, (float)ulPercentCompleted);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tUpdateProgressWithInfo(OP_FORMAT, MSG_217, ulPercentCompleted, 100);\n\t\t\t\t\t\t}\n\t\t\t\t\t\thr = hr2;\n\t\t\t\t\t\tif (hr == S_OK)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tif (hr == VDS_E_OPERATION_PENDING)\n\t\t\t\t\t\t\thr = S_OK;\n\t\t\t\t\t}\n\t\t\t\t\tSleep(500);\n\t\t\t\t}\n\t\t\t\tif (!SUCCEEDED(hr)) {\n\t\t\t\t\tVDS_SET_ERROR(hr);\n\t\t\t\t\tuprintf(\"Could not format drive: %s\", WindowsErrorString());\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\n\t\t\t\tIVdsAsync_Release(pAsync);\n\t\t\t\tIVdsVolumeMF3_Release(pVolumeMF3);\n\n\t\t\t\tif (!IS_ERROR(ErrorStatus)) {\n\t\t\t\t\tuprintf(\"Format completed.\");\n\t\t\t\t\tr = TRUE;\n\t\t\t\t}\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\t}\n\nout:\n\tif ((!bFoundVolume) && (ErrorStatus == 0))\n\t\tErrorStatus = RUFUS_ERROR(ERROR_PATH_NOT_FOUND);\n\tsafe_free(VolumeName);\n\tsafe_free(wVolumeName);\n\tsafe_free(wLabel);\n\tsafe_free(wFSName);\n\tCoUninitialize();\n\treturn r;\n}\n\n/*\n * Call on fmifs.dll's FormatEx() to format the drive\n */\nstatic BOOL FormatNative(DWORD DriveIndex, uint64_t PartitionOffset, DWORD ClusterSize, LPCSTR FSName, LPCSTR Label, DWORD Flags)\n{\n\tBOOL r = FALSE;\n\tPF_DECL(FormatEx);\n\tPF_DECL(EnableVolumeCompression);\n\tchar *locale, *VolumeName = NULL;\n\tWCHAR* wVolumeName = NULL, *wLabel = utf8_to_wchar(Label), *wFSName = utf8_to_wchar(FSName);\n\tsize_t i;\n\n\tif ((strcmp(FSName, FileSystemLabel[FS_EXFAT]) == 0) && !((dur_mins == 0) && (dur_secs == 0))) {\n\t\tPrintInfo(0, MSG_220, FSName, dur_mins, dur_secs);\n\t} else {\n\t\tPrintInfo(0, MSG_222, FSName);\n\t}\n\tuprintf(\"Formatting to %s (using IFS)\", FSName);\n\n\tVolumeName = GetLogicalName(DriveIndex, PartitionOffset, TRUE, TRUE);\n\twVolumeName = utf8_to_wchar(VolumeName);\n\tif (wVolumeName == NULL) {\n\t\tuprintf(\"Could not read volume name (%s)\", VolumeName);\n\t\tErrorStatus = RUFUS_ERROR(ERROR_GEN_FAILURE);\n\t\tgoto out;\n\t}\n\t// Hey, nice consistency here, Microsoft! -  FormatEx() fails if wVolumeName has\n\t// a trailing backslash, but EnableCompression() fails without...\n\twVolumeName[wcslen(wVolumeName)-1] = 0;\t\t// Remove trailing backslash\n\n\t// LoadLibrary(\"fmifs.dll\") appears to changes the locale, which can lead to\n\t// problems with tolower(). Make sure we restore the locale. For more details,\n\t// see https://sourceforge.net/p/mingw/mailman/message/29269040/\n\tlocale = setlocale(LC_ALL, NULL);\n\tPF_INIT_OR_OUT(FormatEx, fmifs);\n\tPF_INIT(EnableVolumeCompression, fmifs);\n\tsetlocale(LC_ALL, locale);\n\n\tif (ClusterSize < 0x200) {\n\t\t// 0 is FormatEx's value for default, which we need to use for UDF\n\t\tClusterSize = 0;\n\t\tuprintf(\"Using default cluster size\");\n\t} else {\n\t\tuprintf(\"Using cluster size: %d bytes\", ClusterSize);\n\t}\n\tformat_percent = 0.0f;\n\ttask_number = 0;\n\n\tuprintf(\"%s format was selected\", (Flags & FP_QUICK) ? \"Quick\" : \"Slow\");\n\tfor (i = 0; i < WRITE_RETRIES; i++) {\n\t\tpfFormatEx(wVolumeName, SelectedDrive.MediaType, wFSName, wLabel,\n\t\t\t(Flags & FP_QUICK), ClusterSize, FormatExCallback);\n\t\tif (!IS_ERROR(ErrorStatus) || (HRESULT_CODE(ErrorStatus) == ERROR_CANCELLED))\n\t\t\tbreak;\n\t\tuprintf(\"%s - Retrying...\", WindowsErrorString());\n\t\tSleep(WRITE_TIMEOUT);\n\t}\n\tif (IS_ERROR(ErrorStatus))\n\t\tgoto out;\n\n\tif (Flags & FP_COMPRESSION) {\n\t\twVolumeName[wcslen(wVolumeName)] = '\\\\';\t// Add trailing backslash back again\n\t\tif (pfEnableVolumeCompression(wVolumeName, FPF_COMPRESSED)) {\n\t\t\tuprintf(\"Enabled NTFS compression\");\n\t\t} else {\n\t\t\tuprintf(\"Could not enable NTFS compression: %s\", WindowsErrorString());\n\t\t}\n\t}\n\n\tif (!IS_ERROR(ErrorStatus)) {\n\t\tuprintf(\"Format completed.\");\n\t\tr = TRUE;\n\t}\n\nout:\n\tif (!r && !IS_ERROR(ErrorStatus))\n\t\tErrorStatus = RUFUS_ERROR(SCODE_CODE(GetLastError()));\n\tsafe_free(VolumeName);\n\tsafe_free(wVolumeName);\n\tsafe_free(wLabel);\n\tsafe_free(wFSName);\n\treturn r;\n}\n\nBOOL FormatPartition(DWORD DriveIndex, uint64_t PartitionOffset, DWORD UnitAllocationSize, USHORT FSType, LPCSTR Label, DWORD Flags)\n{\n\tif ((DriveIndex < 0x80) || (DriveIndex > 0x100) || (FSType >= FS_MAX) ||\n\t\t((UnitAllocationSize != 0) && (!IS_POWER_OF_2(UnitAllocationSize)))) {\n\t\tErrorStatus = RUFUS_ERROR(ERROR_INVALID_PARAMETER);\n\t\treturn FALSE;\n\t}\n\tactual_fs_type = FSType;\n\tif ((FSType == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32) || (Flags & FP_LARGE_FAT32)))\n\t\treturn FormatLargeFAT32(DriveIndex, PartitionOffset, UnitAllocationSize, FileSystemLabel[FSType], Label, Flags);\n\telse if (IS_EXT(FSType))\n\t\treturn FormatExtFs(DriveIndex, PartitionOffset, UnitAllocationSize, FileSystemLabel[FSType], Label, Flags);\n\telse if (use_vds)\n\t\treturn FormatNativeVds(DriveIndex, PartitionOffset, UnitAllocationSize, FileSystemLabel[FSType], Label, Flags);\n\telse\n\t\treturn FormatNative(DriveIndex, PartitionOffset, UnitAllocationSize, FileSystemLabel[FSType], Label, Flags);\n}\n\n/*\n * Call on fmifs.dll's Chkdsk() to fixup the filesystem\n */\nstatic BOOL CheckDisk(char DriveLetter)\n{\n\tBOOL r = FALSE;\n\tPF_DECL(Chkdsk);\n\tWCHAR wDriveRoot[] = L\"?:\\\\\";\n\tWCHAR wFSType[32];\n\tsize_t i;\n\n\twDriveRoot[0] = (WCHAR)DriveLetter;\n\tPrintInfoDebug(0, MSG_223);\n\n\tPF_INIT_OR_OUT(Chkdsk, Fmifs);\n\n\tGetWindowTextW(hFileSystem, wFSType, ARRAYSIZE(wFSType));\n\t// We may have a \" (Default)\" trail\n\tfor (i=0; i<wcslen(wFSType); i++) {\n\t\tif (wFSType[i] == ' ') {\n\t\t\twFSType[i] = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tpfChkdsk(wDriveRoot, wFSType, FALSE, FALSE, FALSE, FALSE, NULL, NULL, ChkdskCallback);\n\tif (!IS_ERROR(ErrorStatus)) {\n\t\tuprintf(\"NTFS Fixup completed.\");\n\t\tr = TRUE;\n\t}\n\nout:\n\treturn r;\n}\n\nstatic BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSize)\n{\n\tBOOL r = FALSE;\n\tLARGE_INTEGER liFilePointer;\n\tuint8_t* pZeroBuf = calloc(SectorSize, MAX_SECTORS_TO_CLEAR);\n\n\tif (pZeroBuf == NULL) {\n\t\tErrorStatus = RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY);\n\t\tgoto out;\n\t}\n\n\t// We now unconditionally zero MAX_SECTORS_TO_CLEAR and (MAX_SECTORS_TO_CLEAR / 8)\n\t// at the beginning and end of the drive respectively. This should encompass the\n\t// MBR, GPT, backup GPT and VBR for most devices and (hopefully) get Windows and\n\t// other apps off our back with trying to access zombie partitions...\n\tPrintInfoDebug(0, MSG_224);\n\tliFilePointer.QuadPart = 0ULL;\n\tif (!SetFilePointerEx(hPhysicalDrive, liFilePointer, &liFilePointer, FILE_BEGIN) || (liFilePointer.QuadPart != 0ULL))\n\t\tuprintf(\"WARNING: Could not reset disk position: %s\", WindowsErrorString());\n\tif (!WriteFileWithRetry(hPhysicalDrive, pZeroBuf, (DWORD)(SectorSize * MAX_SECTORS_TO_CLEAR), NULL, WRITE_RETRIES))\n\t\tgoto out;\n\tuprintf(\"Zeroed %s at the top of the drive\", SizeToHumanReadable(MAX_SECTORS_TO_CLEAR * SectorSize, FALSE, FALSE));\n\tCHECK_FOR_USER_CANCEL;\n\tliFilePointer.QuadPart = DiskSize - (LONGLONG)SectorSize * (MAX_SECTORS_TO_CLEAR / 8);\n\t// Windows seems to be an ass about keeping a lock on a backup GPT,\n\t// so we try to be lenient about not being able to clear it.\n\tif (SetFilePointerEx(hPhysicalDrive, liFilePointer, &liFilePointer, FILE_BEGIN) &&\n\t\tWriteFileWithRetry(hPhysicalDrive, pZeroBuf, SectorSize * (MAX_SECTORS_TO_CLEAR / 8), NULL, WRITE_RETRIES))\n\t\tuprintf(\"Zeroed %s at the end of the drive\", SizeToHumanReadable((MAX_SECTORS_TO_CLEAR / 8) * SectorSize, FALSE, FALSE));\n\telse\n\t\tuprintf(\"WARNING: Could not to clear the backup GPT area: %s\", WindowsErrorString());\n\t\n\tr = TRUE;\n\nout:\n\tsafe_free(pZeroBuf);\n\treturn r;\n}\n\n/*\n * Process the Master Boot Record\n */\nstatic BOOL WriteMBR(HANDLE hPhysicalDrive)\n{\n\tBOOL r = FALSE;\n\tBOOL needs_masquerading = HAS_WINPE(img_report) && (!img_report.uses_minint);\n\tuint8_t* buffer = NULL;\n\tFAKE_FD fake_fd = { 0 };\n\tFILE* fp = (FILE*)&fake_fd;\n\tconst char* using_msg = \"Using %s MBR\";\n\n\tif (SelectedDrive.SectorSize < 512)\n\t\tgoto out;\n\n\tif (partition_type == PARTITION_STYLE_GPT) {\n\t\t// Add a notice with a protective MBR\n\t\tfake_fd._handle = (char*)hPhysicalDrive;\n\t\tset_bytes_per_sector(SelectedDrive.SectorSize);\n\t\tuprintf(using_msg, \"Rufus protective\");\n\t\tr = write_rufus_msg_mbr(fp);\n\t\tgoto notify;\n\t}\n\n\t// FormatEx rewrites the MBR and removes the LBA attribute of FAT16\n\t// and FAT32 partitions - we need to correct this in the MBR\n\tbuffer = (uint8_t*)_mm_malloc(SelectedDrive.SectorSize, 16);\n\tif (buffer == NULL) {\n\t\tuprintf(\"Could not allocate memory for MBR\");\n\t\tErrorStatus = RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY);\n\t\tgoto out;\n\t}\n\n\tif (!read_sectors(hPhysicalDrive, SelectedDrive.SectorSize, 0, 1, buffer)) {\n\t\tuprintf(\"Could not read MBR\");\n\t\tErrorStatus = RUFUS_ERROR(ERROR_READ_FAULT);\n\t\tgoto out;\n\t}\n\n\tswitch (ComboBox_GetCurItemData(hFileSystem)) {\n\tcase FS_FAT16:\n\t\tif (buffer[0x1c2] == 0x0e) {\n\t\t\tuprintf(\"Partition is already FAT16 LBA...\");\n\t\t} else if ((buffer[0x1c2] != 0x04) && (buffer[0x1c2] != 0x06)) {\n\t\t\tuprintf(\"WARNING: converting a non FAT16 partition to FAT16 LBA: FS type=0x%02x\", buffer[0x1c2]);\n\t\t}\n\t\tbuffer[0x1c2] = 0x0e;\n\t\tbreak;\n\tcase FS_FAT32:\n\t\tif (buffer[0x1c2] == 0x0c) {\n\t\t\tuprintf(\"Partition is already FAT32 LBA...\");\n\t\t} else if (buffer[0x1c2] != 0x0b) {\n\t\t\tuprintf(\"WARNING: converting a non FAT32 partition to FAT32 LBA: FS type=0x%02x\", buffer[0x1c2]);\n\t\t}\n\t\tbuffer[0x1c2] = 0x0c;\n\t\tbreak;\n\t}\n\tif ((boot_type != BT_NON_BOOTABLE) && (target_type == TT_BIOS)) {\n\t\t// Set first partition bootable or masquerade as second disk\n\t\tbuffer[0x1be] = needs_masquerading ? 0x81 : 0x80;\n\t\tuprintf(\"Set bootable USB partition as 0x%02X\", buffer[0x1be]);\n\t}\n\n\tif (!write_sectors(hPhysicalDrive, SelectedDrive.SectorSize, 0, 1, buffer)) {\n\t\tuprintf(\"Could not write MBR\");\n\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\t\tgoto out;\n\t}\n\n\tfake_fd._handle = (char*)hPhysicalDrive;\n\tset_bytes_per_sector(SelectedDrive.SectorSize);\n\n\t// What follows is really a case statement with complex conditions listed\n\t// by order of preference\n\tif ((boot_type == BT_IMAGE) && HAS_WINDOWS(img_report) && (allow_dual_uefi_bios) && (target_type == TT_BIOS))\n\t\tgoto windows_mbr;\n\n\t// Non bootable or forced UEFI (zeroed MBR)\n\tif ((boot_type == BT_NON_BOOTABLE) || (target_type == TT_UEFI)) {\n\t\tuprintf(using_msg, \"Zeroed\");\n\t\tr = write_zero_mbr(fp);\n\t\tgoto notify;\n\t}\n\n\t// Syslinux\n\tif ( (boot_type == BT_SYSLINUX_V4) || (boot_type == BT_SYSLINUX_V6) ||\n\t\t ((boot_type == BT_IMAGE) && HAS_SYSLINUX(img_report)) ) {\n\t\tuprintf(using_msg, \"Syslinux\");\n\t\tr = write_syslinux_mbr(fp);\n\t\tgoto notify;\n\t}\n\n\t// Grub 2.0\n\tif ( ((boot_type == BT_IMAGE) && (img_report.has_grub2)) || (boot_type == BT_GRUB2) ) {\n\t\tuprintf(using_msg, \"Grub 2.0\");\n\t\tr = write_grub2_mbr(fp);\n\t\tgoto notify;\n\t}\n\n\t// Grub4DOS\n\tif ( ((boot_type == BT_IMAGE) && (img_report.has_grub4dos)) || (boot_type == BT_GRUB4DOS) ) {\n\t\tuprintf(using_msg, \"Grub4DOS\");\n\t\tr = write_grub4dos_mbr(fp);\n\t\tgoto notify;\n\t}\n\n\t// ReactOS\n\tif (boot_type == BT_REACTOS) {\n\t\tuprintf(using_msg, \"ReactOS\");\n\t\tr = write_reactos_mbr(fp);\n\t\tgoto notify;\n\t}\n\n\t// KolibriOS\n\tif ( (boot_type == BT_IMAGE) && HAS_KOLIBRIOS(img_report) && (IS_FAT(fs_type))) {\n\t\tuprintf(using_msg, \"KolibriOS\");\n\t\tr = write_kolibrios_mbr(fp);\n\t\tgoto notify;\n\t}\n\n\t// If everything else failed, fall back to a conventional Windows/Rufus MBR\nwindows_mbr:\n\tif (needs_masquerading || use_rufus_mbr) {\n\t\tuprintf(using_msg, APPLICATION_NAME);\n\t\tr = write_rufus_mbr(fp);\n\t} else {\n\t\tuprintf(using_msg, \"Windows 7\");\n\t\tr = write_win7_mbr(fp);\n\t}\n\nnotify:\n\t// Tell the system we've updated the disk properties\n\tif (!DeviceIoControl(hPhysicalDrive, IOCTL_DISK_UPDATE_PROPERTIES, NULL, 0, NULL, 0, NULL, NULL))\n\t\tuprintf(\"Failed to notify system about disk properties update: %s\", WindowsErrorString());\n\nout:\n\tsafe_mm_free(buffer);\n\treturn r;\n}\n\n/*\n * Write Secondary Boot Record (usually right after the MBR)\n */\nstatic BOOL WriteSBR(HANDLE hPhysicalDrive)\n{\n\t// TODO: Do we need anything special for 4K sectors?\n\tDWORD size, max_size, br_size = 0x200;\n\tint r, sub_type = boot_type;\n\tuint8_t *buf = NULL;\n\tFAKE_FD fake_fd = { 0 };\n\tFILE* fp = (FILE*)&fake_fd;\n\n\tfake_fd._handle = (char*)hPhysicalDrive;\n\tset_bytes_per_sector(SelectedDrive.SectorSize);\n\t// Syslinux has precedence over Grub\n\tif ((boot_type == BT_IMAGE) && (!HAS_SYSLINUX(img_report))) {\n\t\tif (img_report.has_grub4dos)\n\t\t\tsub_type = BT_GRUB4DOS;\n\t\tif (img_report.has_grub2)\n\t\t\tsub_type = BT_GRUB2;\n\t}\n\n\t// Use BT_MAX for the protective message\n\tif ((boot_type != BT_NON_BOOTABLE) && (partition_type == PARTITION_STYLE_GPT))\n\t\tsub_type = BT_MAX;\n\n\tswitch (sub_type) {\n\tcase BT_GRUB4DOS:\n\t\tuprintf(\"Writing Grub4Dos SBR\");\n\t\tbuf = GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_GR_GRUB_GRLDR_MBR), _RT_RCDATA, \"grldr.mbr\", &size, FALSE);\n\t\tif ((buf == NULL) || (size <= br_size)) {\n\t\t\tuprintf(\"grldr.mbr is either not present or too small\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tbuf = &buf[br_size];\n\t\tsize -= br_size;\n\t\tbreak;\n\tcase BT_GRUB2:\n\t\tif (grub2_buf != NULL) {\n\t\t\tuprintf(\"Writing Grub 2.0 SBR (from download) %s\",\n\t\t\t\tIsBufferInDB(grub2_buf, grub2_len)?\"✓\":\"✗\");\n\t\t\tbuf = grub2_buf;\n\t\t\tsize = (DWORD)grub2_len;\n\t\t} else {\n\t\t\tuprintf(\"Writing Grub 2.0 SBR (from embedded)\");\n\t\t\tbuf = GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_GR_GRUB2_CORE_IMG), _RT_RCDATA, \"core.img\", &size, FALSE);\n\t\t\tif (buf == NULL) {\n\t\t\t\tuprintf(\"Could not access core.img\");\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tcase BT_MAX:\n\t\tuprintf(\"Writing protective message SBR\");\n\t\tsize = 4 * KB;\n\t\tbr_size = 17 * KB;\t// 34 sectors are reserved for protective MBR + primary GPT\n\t\tbuf = GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_SBR_MSG), _RT_RCDATA, \"msg.txt\", &size, TRUE);\n\t\tif (buf == NULL) {\n\t\t\tuprintf(\"Could not access message\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\t// No need to write secondary block\n\t\treturn TRUE;\n\t}\n\n\t// Ensure that we have sufficient space for the SBR\n\tmax_size = (DWORD)SelectedDrive.Partition[0].Offset;\n\tif (br_size + size > max_size) {\n\t\tuprintf(\"  SBR size is too large - You may need to uncheck 'Add fixes for old BIOSes'.\");\n\t\tif (sub_type == BT_MAX)\n\t\t\tsafe_free(buf);\n\t\treturn FALSE;\n\t}\n\n\tr = write_data(fp, br_size, buf, (uint64_t)size);\n\tsafe_free(grub2_buf);\n\tif (sub_type == BT_MAX)\n\t\tsafe_free(buf);\n\treturn (r != 0);\n}\n\n/*\n * Process the Partition Boot Record\n */\nstatic __inline const char* bt_to_name(void) {\n\tswitch (boot_type) {\n\tcase BT_FREEDOS: return \"FreeDOS\";\n\tcase BT_REACTOS: return \"ReactOS\";\n\tdefault:\n\t\treturn ((boot_type == BT_IMAGE) && HAS_KOLIBRIOS(img_report)) ? \"KolibriOS\" : \"Standard\";\n\t}\n}\n\nBOOL WritePBR(HANDLE hLogicalVolume)\n{\n\tint i;\n\tFAKE_FD fake_fd = { 0 };\n\tFILE* fp = (FILE*)&fake_fd;\n\tconst char* using_msg = \"Using %s %s partition boot record\";\n\n\tfake_fd._handle = (char*)hLogicalVolume;\n\tset_bytes_per_sector(SelectedDrive.SectorSize);\n\n\tswitch (actual_fs_type) {\n\tcase FS_FAT16:\n\t\tuprintf(using_msg, bt_to_name(), \"FAT16\");\n\t\tif (!is_fat_16_fs(fp)) {\n\t\t\tuprintf(\"New volume does not have a FAT16 boot sector - aborting\");\n\t\t\tbreak;\n\t\t}\n\t\tuprintf(\"Confirmed new volume has a FAT16 boot sector\");\n\t\tif (boot_type == BT_FREEDOS) {\n\t\t\tif (!write_fat_16_fd_br(fp, 0)) break;\n\t\t} else if (boot_type == BT_REACTOS) {\n\t\t\tif (!write_fat_16_ros_br(fp, 0)) break;\n\t\t} else if ((boot_type == BT_IMAGE) && HAS_KOLIBRIOS(img_report)) {\n\t\t\tuprintf(\"FAT16 is not supported for KolibriOS\"); break;\n\t\t} else {\n\t\t\tif (!write_fat_16_br(fp, 0)) break;\n\t\t}\n\t\t// Disk Drive ID needs to be corrected on XP\n\t\tif (!write_partition_physical_disk_drive_id_fat16(fp))\n\t\t\tbreak;\n\t\treturn TRUE;\n\tcase FS_FAT32:\n\t\tuprintf(using_msg, bt_to_name(), \"FAT32\");\n\t\tfor (i = 0; i < 2; i++) {\n\t\t\tif (!is_fat_32_fs(fp)) {\n\t\t\t\tuprintf(\"New volume does not have a %s FAT32 boot sector - aborting\", i ? \"secondary\" : \"primary\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tuprintf(\"Confirmed new volume has a %s FAT32 boot sector\", i ? \"secondary\" : \"primary\");\n\t\t\tuprintf(\"Setting %s FAT32 boot sector for boot...\", i ? \"secondary\" : \"primary\");\n\t\t\tif (boot_type == BT_FREEDOS) {\n\t\t\t\tif (!write_fat_32_fd_br(fp, 0)) break;\n\t\t\t} else if (boot_type == BT_REACTOS) {\n\t\t\t\tif (!write_fat_32_ros_br(fp, 0)) break;\n\t\t\t} else if ((boot_type == BT_IMAGE) && HAS_KOLIBRIOS(img_report)) {\n\t\t\t\tif (!write_fat_32_kos_br(fp, 0)) break;\n\t\t\t} else if ((boot_type == BT_IMAGE) && HAS_BOOTMGR(img_report)) {\n\t\t\t\tif (!write_fat_32_pe_br(fp, 0)) break;\n\t\t\t} else if ((boot_type == BT_IMAGE) && HAS_WINPE(img_report)) {\n\t\t\t\tif (!write_fat_32_nt_br(fp, 0)) break;\n\t\t\t} else {\n\t\t\t\tif (!write_fat_32_br(fp, 0)) break;\n\t\t\t}\n\t\t\t// Disk Drive ID needs to be corrected on XP\n\t\t\tif (!write_partition_physical_disk_drive_id_fat32(fp))\n\t\t\t\tbreak;\n\t\t\tfake_fd._offset += 6 * SelectedDrive.SectorSize;\n\t\t}\n\t\treturn TRUE;\n\tcase FS_NTFS:\n\t\tuprintf(using_msg, bt_to_name(), \"NTFS\");\n\t\tif (!is_ntfs_fs(fp)) {\n\t\t\tuprintf(\"New volume does not have an NTFS boot sector - aborting\");\n\t\t\tbreak;\n\t\t}\n\t\tuprintf(\"Confirmed new volume has an NTFS boot sector\");\n\t\tif (!write_ntfs_br(fp)) break;\n\t\t// Note: NTFS requires a full remount after writing the PBR. We dismount when we lock\n\t\t// and also go through a forced remount, so that shouldn't be an issue.\n\t\t// But with NTFS, if you don't remount, you don't boot!\n\t\treturn TRUE;\n\tcase FS_EXT2:\n\tcase FS_EXT3:\n\tcase FS_EXT4:\n\t\treturn TRUE;\n\tdefault:\n\t\tuprintf(\"Unsupported FS for FS BR processing - aborting\");\n\t\tbreak;\n\t}\n\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\treturn FALSE;\n}\n\nstatic void update_progress(const uint64_t processed_bytes)\n{\n\tUpdateProgressWithInfo(OP_FORMAT, MSG_261, processed_bytes, img_report.image_size);\n\tuprint_progress(processed_bytes, img_report.image_size);\n}\n\n// Some compressed images use streams that aren't multiple of the sector\n// size and cause write failures => Use a write override that alleviates\n// the problem. See GitHub issue #1422 for details.\nstatic int sector_write(int fd, const void* _buf, unsigned int count)\n{\n\tconst uint8_t* buf = (const uint8_t*)_buf;\n\tunsigned int sec_size = (unsigned int)SelectedDrive.SectorSize;\n\tint written, fill_size = 0;\n\n\tif (sec_size == 0)\n\t\tsec_size = 512;\n\tif_assert_fails(sec_size <= 64 * KB)\n\t\treturn -1;\n\tif_assert_fails(count <= 1 * GB)\n\t\treturn -1;\n\n\t// If we are on a sector boundary and count is multiple of the\n\t// sector size, just issue a regular write\n\tif ((sec_buf_pos == 0) && (count % sec_size == 0))\n\t\treturn _write(fd, buf, count);\n\n\t// If we have an existing partial sector, fill and write it\n\tif (sec_buf_pos > 0) {\n\t\tif_assert_fails(sec_size >= sec_buf_pos)\n\t\t\treturn -1;\n\t\tfill_size = min(sec_size - sec_buf_pos, count);\n\t\tmemcpy(&sec_buf[sec_buf_pos], buf, fill_size);\n\t\tsec_buf_pos += fill_size;\n\t\t// If we don't have a full sector just buffer it for next call\n\t\tif (sec_buf_pos < sec_size)\n\t\t\treturn (int)count;\n\t\tsec_buf_pos = 0;\n\t\twritten = _write(fd, sec_buf, sec_size);\n\t\tif (written != sec_size)\n\t\t\treturn written;\n\t}\n\n\t// Now write as many full sectors as we can\n\tuint32_t sec_num = (count - fill_size) / sec_size;\n\twritten = _write(fd, &buf[fill_size], sec_num * sec_size);\n\tif (written < 0)\n\t\treturn written;\n\tif (written != sec_num * sec_size) {\n\t\t// Detect overflows\n\t\t// coverity[overflow]\n\t\tint v = fill_size + written;\n\t\tif_assert_fails(v >= fill_size)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn v;\n\t}\n\tsec_buf_pos = count - fill_size - written;\n\tif_assert_fails(sec_buf_pos < sec_size)\n\t\treturn -1;\n\n\t// Keep leftover bytes, if any, in the sector buffer\n\tif (sec_buf_pos != 0)\n\t\tmemcpy(sec_buf, &buf[fill_size + written], sec_buf_pos);\n\treturn (int)count;\n}\n\n/* Write an image file or zero a drive */\nstatic BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive)\n{\n\tBOOL s, ret = FALSE;\n\tLARGE_INTEGER li;\n\tHANDLE hSourceImage = INVALID_HANDLE_VALUE;\n\tDWORD i, read_size[NUM_BUFFERS] = { 0 }, write_size, comp_size, buf_size;\n\tuint64_t wb, target_size = bZeroDrive ? SelectedDrive.DiskSize : MIN((uint64_t)SelectedDrive.DiskSize, img_report.image_size);\n\tint64_t bled_ret;\n\tuint8_t* buffer = NULL;\n\tuint32_t zero_data, *cmp_buffer = NULL;\n\tchar* vhd_path = NULL;\n\tint throttle_fast_zeroing = 0, read_bufnum = 0, proc_bufnum = 1;\n\n\tif (SelectedDrive.SectorSize < 512) {\n\t\tuprintf(\"Unexpected sector size (%d) - Aborting\", SelectedDrive.SectorSize);\n\t\treturn FALSE;\n\t}\n\n\t// We poked the MBR and other stuff, so we need to rewind\n\tli.QuadPart = 0;\n\tif (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN))\n\t\tuprintf(\"WARNING: Unable to rewind image position - wrong data might be copied!\");\n\tUpdateProgressWithInfoInit(NULL, FALSE);\n\n\tif (bZeroDrive) {\n\t\tuprintf(fast_zeroing ? \"Fast-zeroing drive:\" : \"Zeroing drive:\");\n\t\t// Our buffer size must be a multiple of the sector size and *ALIGNED* to the sector size\n\t\tbuf_size = ((DD_BUFFER_SIZE + SelectedDrive.SectorSize - 1) / SelectedDrive.SectorSize) * SelectedDrive.SectorSize;\n\t\tbuffer = (uint8_t*)_mm_malloc(buf_size, SelectedDrive.SectorSize);\n\t\tif (buffer == NULL) {\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY);\n\t\t\tuprintf(\"Could not allocate disk zeroing buffer\");\n\t\t\tgoto out;\n\t\t}\n\t\tif_assert_fails((uintptr_t)buffer % SelectedDrive.SectorSize == 0)\n\t\t\tgoto out;\n\n\t\t// Clear buffer\n\t\tmemset(buffer, fast_zeroing ? 0xff : 0x00, buf_size);\n\n\t\tif (fast_zeroing) {\n\t\t\tcmp_buffer = (uint32_t*)_mm_malloc(buf_size, SelectedDrive.SectorSize);\n\t\t\tif (cmp_buffer == NULL) {\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY);\n\t\t\t\tuprintf(\"Could not allocate disk comparison buffer\");\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tif_assert_fails((uintptr_t)cmp_buffer % SelectedDrive.SectorSize == 0)\n\t\t\t\tgoto out;\n\t\t}\n\n\t\tread_size[0] = buf_size;\n\t\tuprint_progress(0, 0);\n\t\tfor (wb = 0, write_size = 0; wb < target_size; wb += write_size) {\n\t\t\tUpdateProgressWithInfo(OP_FORMAT, fast_zeroing ? MSG_306 : MSG_286, wb, target_size);\n\t\t\tuprint_progress(wb, target_size);\n\t\t\t// Don't overflow our projected size (mostly for VHDs)\n\t\t\tif (wb + read_size[0] > target_size)\n\t\t\t\tread_size[0] = (DWORD)(target_size - wb);\n\n\t\t\t// WriteFile fails unless the size is a multiple of sector size\n\t\t\tif (read_size[0] % SelectedDrive.SectorSize != 0)\n\t\t\t\tread_size[0] = ((read_size[0] + SelectedDrive.SectorSize - 1) / SelectedDrive.SectorSize) * SelectedDrive.SectorSize;\n\n\t\t\t// Fast-zeroing: Depending on your hardware, reading from flash may be much faster than writing, so\n\t\t\t// we might speed things up by skipping empty blocks, or skipping the write if the data is the same.\n\t\t\t// Notes: A block is declared empty when all bits are either 0 (zeros) or 1 (flash block erased).\n\t\t\t// Also, a back-off strategy is used to limit reading.\n\t\t\tif (throttle_fast_zeroing) {\n\t\t\t\tthrottle_fast_zeroing--;\n\t\t\t} else if (fast_zeroing) {\n\t\t\t\tCHECK_FOR_USER_CANCEL;\n\n\t\t\t\t// Read block and compare against the block that needs to be written\n\t\t\t\ts = ReadFile(hPhysicalDrive, cmp_buffer, read_size[0], &comp_size, NULL);\n\t\t\t\tif ((!s) || (comp_size != read_size[0])) {\n\t\t\t\t\tuprintf(\"\\r\\nRead error: Could not read data for fast zeroing comparison - %s\", WindowsErrorString());\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\n\t\t\t\t// Check for an empty block by comparing with the first element\n\t\t\t\tzero_data = cmp_buffer[0];\n\t\t\t\t// Check all bits are the same\n\t\t\t\tif ((zero_data == 0) || (zero_data == 0xffffffff)) {\n\t\t\t\t\t// Compare the rest of the block against the first element\n\t\t\t\t\tfor (i = 1; (i < read_size[0] / sizeof(uint32_t)) && (cmp_buffer[i] == zero_data); i++);\n\t\t\t\t\tif (i >= read_size[0] / sizeof(uint32_t)) {\n\t\t\t\t\t\t// Block is empty, skip write\n\t\t\t\t\t\twrite_size = read_size[0];\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Move the file pointer position back for writing\n\t\t\t\tli.QuadPart = wb;\n\t\t\t\tif (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN)) {\n\t\t\t\t\tuprintf(\"\\r\\nError: Could not reset position - %s\", WindowsErrorString());\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t\t// Throttle read operations\n\t\t\t\tthrottle_fast_zeroing = 15;\n\t\t\t}\n\n\t\t\tfor (i = 1; i <= WRITE_RETRIES; i++) {\n\t\t\t\tCHECK_FOR_USER_CANCEL;\n\t\t\t\ts = WriteFile(hPhysicalDrive, buffer, read_size[0], &write_size, NULL);\n\t\t\t\tif ((s) && (write_size == read_size[0]))\n\t\t\t\t\tbreak;\n\t\t\t\tif (s)\n\t\t\t\t\tuprintf(\"\\r\\nWrite error: Wrote %d bytes, expected %d bytes\", write_size, read_size[0]);\n\t\t\t\telse\n\t\t\t\t\tuprintf(\"\\r\\nWrite error at sector %lld: %s\", wb / SelectedDrive.SectorSize, WindowsErrorString());\n\t\t\t\tif (i < WRITE_RETRIES) {\n\t\t\t\t\tli.QuadPart = wb;\n\t\t\t\t\tuprintf(\"Retrying in %d seconds...\", WRITE_TIMEOUT / 1000);\n\t\t\t\t\tSleep(WRITE_TIMEOUT);\n\t\t\t\t\tif (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN)) {\n\t\t\t\t\t\tuprintf(\"Write error: Could not reset position - %s\", WindowsErrorString());\n\t\t\t\t\t\tgoto out;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t\tSleep(200);\n\t\t\t}\n\t\t\tif (i > WRITE_RETRIES)\n\t\t\t\tgoto out;\n\t\t}\n\t\tuprintfs(\"\\r\\n\");\n\t} else if (img_report.compression_type != BLED_COMPRESSION_NONE && img_report.compression_type < BLED_COMPRESSION_MAX) {\n\t\tuprintf(\"Writing compressed image:\");\n\t\thSourceImage = CreateFileU(image_path, GENERIC_READ, FILE_SHARE_READ, NULL,\n\t\t\tOPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);\n\t\tif (hSourceImage == INVALID_HANDLE_VALUE) {\n\t\t\tuprintf(\"Could not open image '%s': %s\", image_path, WindowsErrorString());\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_OPEN_FAILED);\n\t\t\tgoto out;\n\t\t}\n\t\tsec_buf = (uint8_t*)_mm_malloc(SelectedDrive.SectorSize, SelectedDrive.SectorSize);\n\t\tif (sec_buf == NULL) {\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY);\n\t\t\tuprintf(\"Could not allocate disk write buffer\");\n\t\t\tgoto out;\n\t\t}\n\t\tif_assert_fails((uintptr_t)sec_buf% SelectedDrive.SectorSize == 0)\n\t\t\tgoto out;\n\t\tsec_buf_pos = 0;\n\t\tupdate_progress(0);\n\t\tbled_init(256 * KB, uprintf, NULL, sector_write, update_progress, NULL, &ErrorStatus);\n\t\tbled_ret = bled_uncompress_with_handles(hSourceImage, hPhysicalDrive, img_report.compression_type);\n\t\tbled_exit();\n\t\tuprintfs(\"\\r\\n\");\n\t\tif ((bled_ret >= 0) && (sec_buf_pos != 0)) {\n\t\t\t// A disk image that doesn't end up on disk boundary should be a rare\n\t\t\t// enough case, so we dont bother checking the write operation and\n\t\t\t// just issue a notice about it in the log.\n\t\t\tuprintf(\"Notice: Compressed image data didn't end on block boundary.\");\n\t\t\t// Gonna assert that WriteFile() and _write() share the same file offset\n\t\t\tWriteFile(hPhysicalDrive, sec_buf, SelectedDrive.SectorSize, &write_size, NULL);\n\t\t}\n\t\tsafe_mm_free(sec_buf);\n\t\tif ((bled_ret < 0) && (SCODE_CODE(ErrorStatus) != ERROR_CANCELLED)) {\n\t\t\t// Unfortunately, different compression backends return different negative error codes\n\t\t\tuprintf(\"Could not write compressed image: %lld\", bled_ret);\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\t\t\tgoto out;\n\t\t}\n\t} else {\n\t\tif_assert_fails(img_report.compression_type != IMG_COMPRESSION_FFU)\n\t\t\tgoto out;\n\t\t// VHD/VHDX require mounting the image first\n\t\tif (img_report.compression_type == IMG_COMPRESSION_VHD ||\n\t\t\timg_report.compression_type == IMG_COMPRESSION_VHDX) {\n\t\t\t// Since VHDX images are compressed, we need to obtain the actual size\n\t\t\tvhd_path = VhdMountImageAndGetSize(image_path, &target_size);\n\t\t\tif (vhd_path == NULL || target_size == 0)\n\t\t\t\tgoto out;\n\t\t}\n\n\t\thSourceImage = CreateFileAsync(vhd_path != NULL ? vhd_path : image_path, GENERIC_READ,\n\t\t\tFILE_SHARE_READ, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN);\n\t\tif (hSourceImage == NULL) {\n\t\t\tuprintf(\"Could not open image '%s': %s\", image_path, WindowsErrorString());\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_OPEN_FAILED);\n\t\t\tgoto out;\n\t\t}\n\n\t\t// Our buffer size must be a multiple of the sector size and *ALIGNED* to the sector size\n\t\tbuf_size = ((DD_BUFFER_SIZE + SelectedDrive.SectorSize - 1) / SelectedDrive.SectorSize) * SelectedDrive.SectorSize;\n\t\tbuffer = (uint8_t*)_mm_malloc(buf_size * NUM_BUFFERS, SelectedDrive.SectorSize);\n\t\tif (buffer == NULL) {\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY);\n\t\t\tuprintf(\"Could not allocate disk write buffer\");\n\t\t\tgoto out;\n\t\t}\n\t\tif_assert_fails((uintptr_t)buffer% SelectedDrive.SectorSize == 0)\n\t\t\tgoto out;\n\n\t\t// Start the initial read\n\t\tReadFileAsync(hSourceImage, &buffer[read_bufnum * buf_size], (DWORD)MIN(buf_size, target_size));\n\n\t\tread_size[proc_bufnum] = 1;\t// To avoid early loop exit\n\t\tuprint_progress(0, 0);\n\t\tfor (wb = 0; read_size[proc_bufnum] != 0; wb += read_size[proc_bufnum]) {\n\t\t\t// 0. Update the progress\n\t\t\tUpdateProgressWithInfo(OP_FORMAT, MSG_261, wb, target_size);\n\t\t\tuprint_progress(wb, target_size);\n\n\t\t\tif (wb >= target_size)\n\t\t\t\tbreak;\n\n\t\t\t// 1. Wait for the current read operation to complete (and update the read size)\n\t\t\tif ((!WaitFileAsync(hSourceImage, DRIVE_ACCESS_TIMEOUT)) ||\n\t\t\t\t(!GetSizeAsync(hSourceImage, &read_size[read_bufnum]))) {\n\t\t\t\tuprintf(\"\\r\\nRead error: %s\", WindowsErrorString());\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_READ_FAULT);\n\t\t\t\tgoto out;\n\t\t\t}\n\n\n\t\t\t// 2. WriteFile fails unless the size is a multiple of sector size\n\t\t\tif (read_size[read_bufnum] % SelectedDrive.SectorSize != 0) {\n\t\t\t\tif_assert_fails(CEILING_ALIGN(read_size[read_bufnum], SelectedDrive.SectorSize) <= buf_size)\n\t\t\t\t\tgoto out;\n\t\t\t\tread_size[read_bufnum] = CEILING_ALIGN(read_size[read_bufnum], SelectedDrive.SectorSize);\n\t\t\t}\n\n\t\t\t// 3. Switch to the next reading buffer\n\t\t\tproc_bufnum = read_bufnum;\n\t\t\tread_bufnum = (read_bufnum + 1) % NUM_BUFFERS;\n\n\t\t\t// 3. Launch the next asynchronous read operation\n\t\t\t// It is VERY IMPORTANT here that we don't attempt to read past the source\n\t\t\t// or target sizes, as mounted VHDs will SCREW YOU if you attempt to do so\n\t\t\t// and will even start returning ERRONEOUS DATA for sectors before the end\n\t\t\t// of the disk... So we make sure to adjust the size not to ever overflow.\n\t\t\t// Also we need to make sure we add read_size[proc_bufnum] to wb since we\n\t\t\t// have already read the data and are about to write it.\n\t\t\tReadFileAsync(hSourceImage, &buffer[read_bufnum * buf_size], (DWORD)MIN(buf_size, target_size - (wb + read_size[proc_bufnum])));\n\n\t\t\t// 4. Synchronously write the current data buffer\n\t\t\tfor (i = 1; i <= WRITE_RETRIES; i++) {\n\t\t\t\tCHECK_FOR_USER_CANCEL;\n\t\t\t\ts = WriteFile(hPhysicalDrive, &buffer[proc_bufnum * buf_size], read_size[proc_bufnum], &write_size, NULL);\n\t\t\t\tif ((s) && (write_size == read_size[proc_bufnum]))\n\t\t\t\t\tbreak;\n\t\t\t\tif (s)\n\t\t\t\t\tuprintf(\"\\r\\nWrite error: Wrote %d bytes, expected %d bytes\", write_size, read_size[proc_bufnum]);\n\t\t\t\telse\n\t\t\t\t\tuprintf(\"\\r\\nWrite error at sector %lld: %s\", wb / SelectedDrive.SectorSize, WindowsErrorString());\n\t\t\t\tif (i < WRITE_RETRIES) {\n\t\t\t\t\tli.QuadPart = wb;\n\t\t\t\t\tuprintf(\"Retrying in %d seconds...\", WRITE_TIMEOUT / 1000);\n\t\t\t\t\tSleep(WRITE_TIMEOUT);\n\t\t\t\t\tif (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN)) {\n\t\t\t\t\t\tuprintf(\"Write error: Could not reset position - %s\", WindowsErrorString());\n\t\t\t\t\t\tgoto out;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t\tSleep(200);\n\t\t\t}\n\t\t\tif (i > WRITE_RETRIES)\n\t\t\t\tgoto out;\n\t\t}\n\t\tuprintfs(\"\\r\\n\");\n\t}\n\tRefreshDriveLayout(hPhysicalDrive);\n\tret = TRUE;\nout:\n\tif (img_report.compression_type != BLED_COMPRESSION_NONE && img_report.compression_type < BLED_COMPRESSION_MAX)\n\t\tsafe_closehandle(hSourceImage);\n\telse\n\t\tCloseFileAsync(hSourceImage);\n\tif (vhd_path != NULL)\n\t\tVhdUnmountImage();\n\tsafe_mm_free(buffer);\n\tsafe_mm_free(cmp_buffer);\n\treturn ret;\n}\n\n/*\n * Standalone thread for the formatting operation\n * According to https://learn.microsoft.com/windows/win32/api/winioctl/ni-winioctl-fsctl_dismount_volume\n * To change a volume file system\n *   Open a volume.\n *   Lock the volume.\n *   Format the volume.\n *   Dismount the volume.\n *   Unlock the volume.\n *   Close the volume handle.\n */\nDWORD WINAPI FormatThread(void* param)\n{\n\tint r;\n\tBOOL ret, windows_to_go, actual_lock_drive = lock_drive, write_as_ext = FALSE;\n\t// Windows 11 and VDS (which I suspect is what fmifs.dll's FormatEx() is now calling behind the scenes)\n\t// require us to unlock the physical drive to format the drive, else access denied is returned.\n\tBOOL need_logical = FALSE, must_unlock_physical = (use_vds || WindowsVersion.Version >= WINDOWS_11);\n\tBOOL retry_clear = TRUE;\n\tDWORD cr, DriveIndex = (DWORD)(uintptr_t)param, ClusterSize, Flags;\n\tHANDLE hPhysicalDrive = INVALID_HANDLE_VALUE;\n\tHANDLE hLogicalVolume = INVALID_HANDLE_VALUE;\n\tSYSTEMTIME lt;\n\tuint8_t *buffer = NULL, extra_partitions = 0;\n\tchar *bb_msg, *volume_name = NULL;\n\tchar drive_name[] = \"?:\\\\\";\n\tchar drive_letters[27], fs_name[32], label[64];\n\tchar logfile[MAX_PATH], *userdir;\n\tchar efi_dst[] = \"?:\\\\efi\\\\boot\\\\bootx64.efi\";\n\tchar kolibri_dst[] = \"?:\\\\MTLD_F32\";\n\tchar grub4dos_dst[] = \"?:\\\\grldr\";\n\n\twindows_to_go = (image_options & IMOP_WINTOGO) && (boot_type == BT_IMAGE) && HAS_WINTOGO(img_report) &&\n\t\t(ComboBox_GetCurItemData(hImageOption) == IMOP_WIN_TO_GO);\n\tlarge_drive = (SelectedDrive.DiskSize > (1*TB));\n\tif (large_drive)\n\t\tuprintf(\"Notice: Large drive detected (may produce short writes)\");\n\n\t// Find out if we need to add any extra partitions\n\textra_partitions = 0;\n\tif ((boot_type == BT_IMAGE) && !write_as_image && HAS_PERSISTENCE(img_report) && persistence_size)\n\t\textra_partitions |= XP_PERSISTENCE;\n\t// According to Microsoft, every GPT disk (we RUN Windows from) must have an MSR due to not having hidden sectors\n\t// https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-and-gpt-faq#disks-that-require-an-msr\n\tif ((windows_to_go) && (target_type == TT_UEFI) && (partition_type == PARTITION_STYLE_GPT))\n\t\textra_partitions |= XP_ESP | XP_MSR;\n\t// If we have a bootable image with UEFI bootloaders and the target file system is NTFS or exFAT\n\t// or the UEFI:NTFS option is selected, we add the UEFI:NTFS partition...\n\telse if ((((boot_type == BT_IMAGE) && IS_EFI_BOOTABLE(img_report)) && ((fs_type == FS_NTFS) || (fs_type == FS_EXFAT))) ||\n\t\t\t (boot_type == BT_UEFI_NTFS)) {\n\t\textra_partitions |= XP_UEFI_NTFS;\n\t\t// ...but only if we're not dealing with a Windows image in installer mode with target\n\t\t//  system set to BIOS and without dual BIOS+UEFI boot enabled.\n\t\tif ((boot_type == BT_IMAGE) && HAS_BOOTMGR_BIOS(img_report) && (!windows_to_go) &&\n\t\t\t(target_type == TT_BIOS) && (!allow_dual_uefi_bios))\n\t\t\textra_partitions &= ~XP_UEFI_NTFS;\n\t}\n\tif (IsChecked(IDC_OLD_BIOS_FIXES))\n\t\textra_partitions |= XP_COMPAT;\n\n\t// On pre 1703 platforms (and even on later ones), anything with ext2/ext3 doesn't sit\n\t// too well with Windows. Same with ESPs. Relaxing our locking rules seems to help...\n\tif ((extra_partitions & (XP_ESP | XP_PERSISTENCE)) || IS_EXT(fs_type))\n\t\tactual_lock_drive = FALSE;\n\t// Windows 11 is a lot more proactive in locking ESPs and MSRs than previous versions\n\t// were, meaning that we also can't lock the drive without incurring errors...\n\tif ((WindowsVersion.Version >= WINDOWS_11) && extra_partitions)\n\t\tactual_lock_drive = FALSE;\n\t// Fixed drives + ext2/ext3 don't play nice and require the same handling as ESPs\n\twrite_as_ext = IS_EXT(fs_type) && (GetDriveTypeFromIndex(DriveIndex) == DRIVE_FIXED);\n\n\tPrintInfoDebug(0, MSG_225);\n\thPhysicalDrive = GetPhysicalHandle(DriveIndex, actual_lock_drive, FALSE, !actual_lock_drive);\n\tif (hPhysicalDrive == INVALID_HANDLE_VALUE) {\n\t\tErrorStatus = RUFUS_ERROR(ERROR_OPEN_FAILED);\n\t\tgoto out;\n\t}\n\n\t// At this stage we have both a handle and a lock to the physical drive\n\tif (!GetDriveLetters(DriveIndex, drive_letters)) {\n\t\tuprintf(\"Failed to get a drive letter\");\n\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_ASSIGN_LETTER));\n\t\tgoto out;\n\t}\n\n\t// Unassign all drives letters\n\tdrive_name[0] = RemoveDriveLetters(DriveIndex, TRUE, FALSE);\n\tif (drive_name[0] == 0) {\n\t\tuprintf(\"Unable to find a drive letter to use\");\n\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_ASSIGN_LETTER));\n\t\tgoto out;\n\t}\n\tuprintf(\"Will use '%c:' as volume mountpoint\", toupper(drive_name[0]));\n\n\t// It kind of blows, but we have to relinquish access to the physical drive\n\t// for VDS to be able to delete the partitions that reside on it...\n\tsafe_unlockclose(hPhysicalDrive);\n\tPrintInfo(0, MSG_239, lmprintf(MSG_307));\n\tif (!is_vds_available || !DeletePartition(DriveIndex, 0, TRUE)) {\n\t\tuprintf(\"WARNING: Could not delete partition(s): %s\", is_vds_available ? WindowsErrorString() : \"VDS is not available\");\n\t\tSetLastError(ErrorStatus);\n\t\tErrorStatus = 0;\n\t\t// If we couldn't delete partitions, Windows give us trouble unless we\n\t\t// request access to the logical drive. Don't ask me why!\n\t\tneed_logical = TRUE;\n\t\t// Also, since we couldn't clean the disk, we need to disable drive locking\n\t\tactual_lock_drive = FALSE;\n\t}\n\n\t// An extra refresh of the (now empty) partition data here appears to be helpful\n\tGetDrivePartitionData(SelectedDrive.DeviceNumber, fs_name, sizeof(fs_name), TRUE);\n\n\t// Now get RW access to the physical drive\n\thPhysicalDrive = GetPhysicalHandle(DriveIndex, actual_lock_drive, TRUE, !actual_lock_drive);\n\tif (hPhysicalDrive == INVALID_HANDLE_VALUE) {\n\t\tErrorStatus = RUFUS_ERROR(ERROR_OPEN_FAILED);\n\t\tgoto out;\n\t}\n\tRefreshDriveLayout(hPhysicalDrive);\n\n\t// If we write an image that contains an ESP, Windows forcibly reassigns/removes the target\n\t// drive, which causes a write error. To work around this, we must lock the logical drive.\n\t// Also need to lock logical drive if we couldn't delete partitions, to keep Windows happy...\n\tif (((boot_type == BT_IMAGE) && write_as_image) || (need_logical)) {\n\t\tuprintf(\"Requesting logical volume handle...\");\n\t\thLogicalVolume = GetLogicalHandle(DriveIndex, 0, TRUE, FALSE, !actual_lock_drive);\n\t\tif (hLogicalVolume == INVALID_HANDLE_VALUE) {\n\t\t\tuprintf(\"Could not access logical volume\");\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_OPEN_FAILED);\n\t\t\tgoto out;\n\t\t// If the call succeeds (and we don't get a NULL logical handle as returned for\n\t\t// unpartitioned drives), try to unmount the volume.\n\t\t} else if ((hLogicalVolume != NULL) && (!UnmountVolume(hLogicalVolume))) {\n\t\t\tuprintf(\"Trying to continue regardless...\");\n\t\t}\n\t}\n\tCHECK_FOR_USER_CANCEL;\n\n\tif (!zero_drive && !write_as_image) {\n\t\tPrintInfoDebug(0, MSG_226);\n\t\tAnalyzeMBR(hPhysicalDrive, \"Drive\", FALSE);\n\t\tUpdateProgress(OP_ANALYZE_MBR, -1.0f);\n\t}\n\n\tif (zero_drive) {\n\t\tWriteDrive(hPhysicalDrive, TRUE);\n\t\tgoto out;\n\t}\n\ntry_clear:\n\t// Zap partition records. This may help prevent access errors.\n\t// Note, Microsoft's way of cleaning partitions (IOCTL_DISK_CREATE_DISK, which is what we apply\n\t// in InitializeDisk) is *NOT ENOUGH* to reset a disk and can render it inoperable for partitioning\n\t// or formatting under Windows. See https://github.com/pbatard/rufus/issues/759 for details.\n\tif ((boot_type != BT_IMAGE) || (img_report.is_iso && !write_as_image)) {\n\t\tif ((!ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize)) ||\n\t\t\t(!InitializeDisk(hPhysicalDrive))) {\n\t\t\t// If VDS is available, try cycling the device to see it it helps\n\t\t\tif (retry_clear && is_vds_available) {\n\t\t\t\tuprintf(\"Cycling the device to see if it helps...\");\n\t\t\t\t// Note: This may leave the device disabled on re-plug or reboot\n\t\t\t\t// so only do this for the experimental VDS path for now...\n\t\t\t\tcr = CycleDevice(ComboBox_GetCurSel(hDeviceList));\n\t\t\t\tif (cr == ERROR_DEVICE_REINITIALIZATION_NEEDED) {\n\t\t\t\t\tuprintf(\"Zombie device detected, trying again...\");\n\t\t\t\t\tSleep(1000);\n\t\t\t\t\tcr = CycleDevice(ComboBox_GetCurSel(hDeviceList));\n\t\t\t\t}\n\t\t\t\tif (cr == 0)\n\t\t\t\t\tuprintf(\"Successfully cycled device\");\n\t\t\t\telse\n\t\t\t\t\tuprintf(\"Cycling device failed!\");\n\t\t\t\tSleep(1000);\n\t\t\t\tretry_clear = FALSE;\n\t\t\t\tgoto try_clear;\n\t\t\t}\n\t\t\tuprintf(\"Could not reset partitions\");\n\t\t\tErrorStatus = (LastWriteError != 0) ? LastWriteError : RUFUS_ERROR(ERROR_PARTITION_FAILURE);\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\tif (IsChecked(IDC_BAD_BLOCKS)) {\n\t\tdo {\n\t\t\tFILE* log_fd;\n\t\t\tint sel = ComboBox_GetCurSel(hNBPasses);\n\t\t\t// create a log file for bad blocks report. Since %USERPROFILE% may\n\t\t\t// have localized characters, we use the UTF-8 API.\n\t\t\tuserdir = getenvU(\"USERPROFILE\");\n\t\t\tstatic_strcpy(logfile, userdir);\n\t\t\tsafe_free(userdir);\n\t\t\tGetLocalTime(&lt);\n\t\t\tsafe_sprintf(&logfile[strlen(logfile)], sizeof(logfile) - strlen(logfile) - 1,\n\t\t\t\t\"\\\\rufus_%04d%02d%02d_%02d%02d%02d.log\",\n\t\t\t\tlt.wYear, lt.wMonth, lt.wDay, lt.wHour, lt.wMinute, lt.wSecond);\n\t\t\tlog_fd = fopenU(logfile, \"w+\");\n\t\t\tif (log_fd == NULL) {\n\t\t\t\tuprintf(\"Error: Could not create log file for bad blocks check\");\n\t\t\t\tgoto out;\n\t\t\t} else {\n\t\t\t\tfprintf(log_fd, APPLICATION_NAME \" bad blocks check started on: %04d.%02d.%02d %02d:%02d:%02d\",\n\t\t\t\tlt.wYear, lt.wMonth, lt.wDay, lt.wHour, lt.wMinute, lt.wSecond);\n\t\t\t\tfflush(log_fd);\n\t\t\t}\n\n\t\t\tif (!BadBlocks(hPhysicalDrive, SelectedDrive.DiskSize, (sel >= 2) ? 4 : sel +1, sel, &report, log_fd)) {\n\t\t\t\tuprintf(\"Bad blocks: Check failed.\");\n\t\t\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_BADBLOCKS_FAILURE));\n\t\t\t\tClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize);\n\t\t\t\tfclose(log_fd);\n\t\t\t\tDeleteFileU(logfile);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tuprintf(\"Bad Blocks: Check completed, %d bad block%s found. (%d/%d/%d errors)\",\n\t\t\t\treport.bb_count, (report.bb_count==1)?\"\":\"s\",\n\t\t\t\treport.num_read_errors, report.num_write_errors, report.num_corruption_errors);\n\t\t\tr = IDOK;\n\t\t\tif (report.bb_count) {\n\t\t\t\tbb_msg = lmprintf(MSG_011, report.bb_count, report.num_read_errors, report.num_write_errors,\n\t\t\t\t\treport.num_corruption_errors);\n\t\t\t\tfprintf(log_fd, \"%s\", bb_msg);\n\t\t\t\tGetLocalTime(&lt);\n\t\t\t\tfprintf(log_fd, APPLICATION_NAME \" bad blocks check ended on: %04d.%02d.%02d %02d:%02d:%02d\",\n\t\t\t\tlt.wYear, lt.wMonth, lt.wDay, lt.wHour, lt.wMinute, lt.wSecond);\n\t\t\t\tfclose(log_fd);\n\t\t\t\tr = Notification(MB_ABORTRETRYIGNORE | MB_ICONWARNING, lmprintf(MSG_010), lmprintf(MSG_012, bb_msg, logfile));\n\t\t\t} else {\n\t\t\t\t// We didn't get any errors => delete the log file\n\t\t\t\tfclose(log_fd);\n\t\t\t\tDeleteFileU(logfile);\n\t\t\t}\n\t\t} while (r == IDRETRY);\n\t\tif (r == IDABORT) {\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_CANCELLED);\n\t\t\tgoto out;\n\t\t}\n\n\t\t// Especially after destructive badblocks test, you must zero the MBR/GPT completely\n\t\t// before repartitioning. Else, all kind of bad things happen.\n\t\tif (!ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize)) {\n\t\t\tuprintf(\"Could not zero MBR/GPT\");\n\t\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\t// Write an image file\n\tif ((boot_type == BT_IMAGE) && write_as_image) {\n\t\t// Special case for FFU images\n\t\tif (img_report.compression_type == IMG_COMPRESSION_FFU) {\n\t\t\tchar cmd[MAX_PATH + 128], *physical = NULL;\n\t\t\t// Should have been filtered out beforehand\n\t\t\tif_assert_fails(has_ffu_support)\n\t\t\t\tgoto out;\n\t\t\tsafe_unlockclose(hPhysicalDrive);\n\t\t\tphysical = GetPhysicalName(SelectedDrive.DeviceNumber);\n\t\t\tstatic_sprintf(cmd, \"%s\\\\dism.exe /Apply-Ffu /ApplyDrive:%s /ImageFile:\\\"%s\\\"\", sysnative_dir, physical, image_path);\n\t\t\tsafe_free(physical);\n\t\t\tuprintf(\"Running command: '%s'\", cmd);\n\t\t\tcr = RunCommandWithProgress(cmd, sysnative_dir, TRUE, MSG_261, \".*\\r\\\\[[= ]+([0-9\\\\.]+)%[= ]+\\\\].*\");\n\t\t\tif (cr != 0 && !IS_ERROR(ErrorStatus)) {\n\t\t\t\tSetLastError(cr);\n\t\t\t\tuprintf(\"Failed to apply FFU image: %s\", WindowsErrorString());\n\t\t\t\tErrorStatus = RUFUS_ERROR(SCODE_CODE(cr));\n\t\t\t}\n\t\t} else {\n\t\t\tWriteDrive(hPhysicalDrive, FALSE);\n\t\t}\n\t\tgoto out;\n\t}\n\n\tUpdateProgress(OP_ZERO_MBR, -1.0f);\n\tCHECK_FOR_USER_CANCEL;\n\n\tif (!CreatePartition(hPhysicalDrive, partition_type, fs_type, (partition_type == PARTITION_STYLE_MBR)\n\t\t&& (target_type == TT_UEFI), extra_partitions)) {\n\t\tErrorStatus = (LastWriteError != 0) ? LastWriteError : RUFUS_ERROR(ERROR_PARTITION_FAILURE);\n\t\tgoto out;\n\t}\n\tUpdateProgress(OP_PARTITION, -1.0f);\n\n\t// Close the (unmounted) volume before formatting\n\tif ((hLogicalVolume != NULL) && (hLogicalVolume != INVALID_HANDLE_VALUE)) {\n\t\tPrintInfoDebug(0, MSG_227);\n\t\tif (!CloseHandle(hLogicalVolume)) {\n\t\t\thLogicalVolume = INVALID_HANDLE_VALUE;\n\t\t\tuprintf(\"Could not close volume: %s\", WindowsErrorString());\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_ACCESS_DENIED);\n\t\t\tgoto out;\n\t\t}\n\t}\n\thLogicalVolume = INVALID_HANDLE_VALUE;\n\n\tif (must_unlock_physical)\n\t\tsafe_unlockclose(hPhysicalDrive);\n\n\tif (use_vds) {\n\t\t// Note: This may leave the device disabled on re-plug or reboot\n\t\t// so only do this for the experimental VDS path for now...\n\t\tuprintf(\"Cycling device...\");\n\t\tcr = CycleDevice(ComboBox_GetCurSel(hDeviceList));\n\t\tif (cr == ERROR_DEVICE_REINITIALIZATION_NEEDED) {\n\t\t\tuprintf(\"Zombie device detected, trying again...\");\n\t\t\tSleep(1000);\n\t\t\tcr = CycleDevice(ComboBox_GetCurSel(hDeviceList));\n\t\t}\n\t\tif (cr == 0)\n\t\t\tuprintf(\"Successfully cycled device\");\n\t\telse\n\t\t\tuprintf(\"Cycling device failed!\");\n\t}\n\tif (is_vds_available) {\n\t\t// This one should be safe to issue unconditionally\n\t\tuprintf(\"Refreshing drive layout...\");\n\t\tRefreshLayout(DriveIndex);\n\t}\n\n\t// Wait for the logical drive we just created to appear\n\tuprintf(\"Waiting for logical drive to reappear...\");\n\tSleep(200);\n\tif (write_as_esp || write_as_ext) {\n\t\t// Can't format ESPs or ext2/ext3 partitions unless we mount them ourselves\n\t\tvolume_name = AltMountVolume(DriveIndex, SelectedDrive.Partition[partition_index[PI_MAIN]].Offset, FALSE);\n\t\tif (volume_name == NULL) {\n\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_ASSIGN_LETTER));\n\t\t\tgoto out;\n\t\t}\n\t} else {\n\t\tif (!WaitForLogical(DriveIndex, SelectedDrive.Partition[partition_index[PI_MAIN]].Offset)) {\n\t\t\tuprintf(\"Logical drive was not found - aborting\");\n\t\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_TIMEOUT);\n\t\t\tgoto out;\n\t\t}\n\t}\n\tCHECK_FOR_USER_CANCEL;\n\n\t// Format Casper partition if required. Do it before we format anything with\n\t// a file system that Windows will recognize, to avoid concurrent access.\n\tif (extra_partitions & XP_PERSISTENCE) {\n\t\tuint32_t ext_version = ReadSetting32(SETTING_USE_EXT_VERSION);\n\t\tif ((ext_version < 2) || (ext_version > 4))\n\t\t\text_version = 3;\n\t\tuprintf(\"Using %s-like method to enable persistence\", img_report.uses_casper ? \"Ubuntu\" : \"Debian\");\n\t\tif (!FormatPartition(DriveIndex, SelectedDrive.Partition[partition_index[PI_CASPER]].Offset, 0, FS_EXT2 + (ext_version - 2),\n\t\t\timg_report.uses_casper ? \"casper-rw\" : \"persistence\",\n\t\t\t(img_report.uses_casper ? 0 : FP_CREATE_PERSISTENCE_CONF) |\n\t\t\t(IsChecked(IDC_QUICK_FORMAT) ? FP_QUICK : 0))) {\n\t\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\tGetWindowTextU(hLabel, label, sizeof(label));\n\tif (fs_type < FS_EXT2)\n\t\tToValidLabel(label, (fs_type == FS_FAT16) || (fs_type == FS_FAT32) || (fs_type == FS_EXFAT));\n\tClusterSize = (DWORD)ComboBox_GetCurItemData(hClusterSize);\n\tif ((ClusterSize < 0x200) || (write_as_esp))\n\t\tClusterSize = 0;\t// 0 = default cluster size\n\n\tFlags = FP_FORCE;\n\tif (IsChecked(IDC_QUICK_FORMAT))\n\t\tFlags |= FP_QUICK;\n\tif ((fs_type == FS_NTFS) && (enable_ntfs_compression))\n\t\tFlags |= FP_COMPRESSION;\n\tif (write_as_esp)\n\t\tFlags |= FP_LARGE_FAT32;\n\n\tret = FormatPartition(DriveIndex, SelectedDrive.Partition[partition_index[PI_MAIN]].Offset, ClusterSize, fs_type, label, Flags);\n\tif (!ret) {\n\t\t// Error will be set by FormatPartition() in ErrorStatus\n\t\tuprintf(\"Format error: %s\", StrError(ErrorStatus, TRUE));\n\t\tgoto out;\n\t}\n\n\tif (must_unlock_physical) {\n\t\t// Get RW access back to the physical drive...\n\t\thPhysicalDrive = GetPhysicalHandle(DriveIndex, actual_lock_drive, TRUE, !actual_lock_drive);\n\t\tif (hPhysicalDrive == INVALID_HANDLE_VALUE) {\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_OPEN_FAILED);\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\t// Thanks to Microsoft, we must fix the MBR AFTER the drive has been formatted\n\tif ((partition_type == PARTITION_STYLE_MBR) || ((boot_type != BT_NON_BOOTABLE) && (partition_type == PARTITION_STYLE_GPT))) {\n\t\tPrintInfoDebug(0, MSG_228);\t// \"Writing master boot record...\"\n\t\tif ((!WriteMBR(hPhysicalDrive)) || (!WriteSBR(hPhysicalDrive))) {\n\t\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\t\t\tgoto out;\n\t\t}\n\t\tUpdateProgress(OP_FIX_MBR, -1.0f);\n\t}\n\tSleep(200);\n\n\tif (!write_as_esp && !write_as_ext) {\n\t\tWaitForLogical(DriveIndex, 0);\n\t\t// Try to continue\n\t\tCHECK_FOR_USER_CANCEL;\n\n\t\tvolume_name = GetLogicalName(DriveIndex, SelectedDrive.Partition[partition_index[PI_MAIN]].Offset, TRUE, TRUE);\n\t\tif (volume_name == NULL) {\n\t\t\tuprintf(\"Could not get volume name\");\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_NO_VOLUME_ID);\n\t\t\tgoto out;\n\t\t}\n\t\tuprintf(\"Found volume %s\", volume_name);\n\n\n\t\t// Windows is really finicky with regards to reassigning drive letters even after\n\t\t// we forcibly removed them, so add yet another explicit call to RemoveDriveLetters()\n\t\tRemoveDriveLetters(DriveIndex, FALSE, TRUE);\n\t\tif (!MountVolume(drive_name, volume_name)) {\n\t\t\tuprintf(\"Could not remount %s as %c: %s\", volume_name, toupper(drive_name[0]), WindowsErrorString());\n\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_MOUNT_VOLUME));\n\t\t\tgoto out;\n\t\t}\n\t\tCHECK_FOR_USER_CANCEL;\n\n\t\t// Disable file indexing, unless it was force-enabled by the user\n\t\tif ((!enable_file_indexing) && ((fs_type == FS_NTFS) || (fs_type == FS_UDF) || (fs_type == FS_REFS))) {\n\t\t\tuprintf(\"Disabling file indexing...\");\n\t\t\tif (!SetFileAttributesA(volume_name, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))\n\t\t\t\tuprintf(\"Could not disable file indexing: %s\", WindowsErrorString());\n\t\t}\n\t}\n\n\t// Refresh the drive label - This is needed as Windows may have altered it from\n\t// the name we proposed, and we require an exact label, to patch config files.\n\tif ((fs_type < FS_EXT2) && !GetVolumeInformationU(drive_name, img_report.usb_label,\n\t\tARRAYSIZE(img_report.usb_label), NULL, NULL, NULL, NULL, 0)) {\n\t\tuprintf(\"WARNING: Failed to refresh label: %s\", WindowsErrorString());\n\t} else if (IS_EXT(fs_type)) {\n\t\tconst char* ext_label = GetExtFsLabel(DriveIndex, 0);\n\t\tif (ext_label != NULL)\n\t\t\tstatic_strcpy(img_report.usb_label, label);\n\t}\n\n\tif (boot_type != BT_NON_BOOTABLE) {\n\t\tif (boot_type == BT_UEFI_NTFS) {\n\t\t\t// All good\n\t\t} else if (target_type == TT_UEFI) {\n\t\t\t// For once, no need to do anything - just check our sanity\n\t\t\tif_assert_fails((boot_type == BT_IMAGE) && IS_EFI_BOOTABLE(img_report) && (fs_type <= FS_NTFS)) {\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_INSTALL_FAILURE);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if ( (boot_type == BT_SYSLINUX_V4) || (boot_type == BT_SYSLINUX_V6) ||\n\t\t\t((boot_type == BT_IMAGE) && (HAS_SYSLINUX(img_report) || HAS_REACTOS(img_report)) &&\n\t\t\t\t(!HAS_WINDOWS(img_report) || !allow_dual_uefi_bios)) ) {\n\t\t\tif (!InstallSyslinux(DriveIndex, drive_name[0], fs_type)) {\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_INSTALL_FAILURE);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else {\n\t\t\t// We still have a lock, which we need to modify the volume boot record\n\t\t\t// => no need to reacquire the lock...\n\t\t\thLogicalVolume = GetLogicalHandle(DriveIndex, SelectedDrive.Partition[partition_index[PI_MAIN]].Offset, FALSE, TRUE, FALSE);\n\t\t\tif ((hLogicalVolume == INVALID_HANDLE_VALUE) || (hLogicalVolume == NULL)) {\n\t\t\t\tuprintf(\"Could not re-mount volume for partition boot record access\");\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_OPEN_FAILED);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\t// NB: if you unmount the logical volume here, XP will report error:\n\t\t\t// [0x00000456] The media in the drive may have changed\n\t\t\tPrintInfoDebug(0, MSG_229);\n\t\t\tif (!WritePBR(hLogicalVolume)) {\n\t\t\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\t// We must close and unlock the volume to write files to it\n\t\t\tsafe_unlockclose(hLogicalVolume);\n\t\t}\n\t} else {\n\t\tif (IsChecked(IDC_EXTENDED_LABEL))\n\t\t\tSetAutorun(drive_name);\n\t}\n\tCHECK_FOR_USER_CANCEL;\n\n\t// We issue a complete remount of the filesystem on account of:\n\t// - Ensuring the file explorer properly detects that the volume was updated\n\t// - Ensuring that an NTFS system will be reparsed so that it becomes bootable\n\tif (!RemountVolume(drive_name, FALSE))\n\t\tgoto out;\n\tCHECK_FOR_USER_CANCEL;\n\n\tif (boot_type != BT_NON_BOOTABLE) {\n\t\tif ((boot_type == BT_MSDOS) || (boot_type == BT_FREEDOS)) {\n\t\t\tUpdateProgress(OP_FILE_COPY, -1.0f);\n\t\t\tPrintInfoDebug(0, MSG_230);\n\t\t\tif (!ExtractDOS(drive_name)) {\n\t\t\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_CANNOT_COPY);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if (boot_type == BT_GRUB4DOS) {\n\t\t\tgrub4dos_dst[0] = drive_name[0];\n\t\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\t\tuprintf(\"Installing: %s (Grub4DOS loader) %s\", grub4dos_dst,\n\t\t\t\tIsFileInDB(FILES_DIR \"\\\\grub4dos-\" GRUB4DOS_VERSION \"\\\\grldr\")?\"✓\":\"✗\");\n\t\t\tif (!CopyFileU(FILES_DIR \"\\\\grub4dos-\" GRUB4DOS_VERSION \"\\\\grldr\", grub4dos_dst, FALSE))\n\t\t\t\tuprintf(\"Failed to copy file: %s\", WindowsErrorString());\n\t\t} else if ((boot_type == BT_IMAGE) && (image_path != NULL) && (img_report.is_iso || img_report.is_windows_img)) {\n\t\t\tUpdateProgress(OP_FILE_COPY, 0.0f);\n\t\t\tdrive_name[2] = 0;\t// Ensure our drive is something like 'D:'\n\t\t\tif (windows_to_go) {\n\t\t\t\tPrintInfoDebug(0, MSG_268);\n\t\t\t\tif (!SetupWinToGo(DriveIndex, drive_name, (extra_partitions & XP_ESP))) {\n\t\t\t\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_ISO_EXTRACT));\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t\tif (unattend_xml_path != NULL) {\n\t\t\t\t\tif (!ApplyWindowsCustomization(drive_name[0], unattend_xml_flags | UNATTEND_WINDOWS_TO_GO))\n\t\t\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_PATCH));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif_assert_fails(!img_report.is_windows_img)\n\t\t\t\t\tgoto out;\n\t\t\t\tif (!ExtractISO(image_path, drive_name, FALSE)) {\n\t\t\t\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_ISO_EXTRACT));\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t\tif (HAS_KOLIBRIOS(img_report)) {\n\t\t\t\t\tkolibri_dst[0] = drive_name[0];\n\t\t\t\t\tuprintf(\"Installing: %s (KolibriOS loader)\", kolibri_dst);\n\t\t\t\t\tif (ExtractISOFile(image_path, \"HD_Load/USB_Boot/MTLD_F32\", kolibri_dst,\n\t\t\t\t\t\tFILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM) == 0) {\n\t\t\t\t\t\tuprintf(\"WARNING: Loader installation failed - KolibriOS will not boot!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// EFI mode selected, with no 'boot###.efi' but Windows 7 x64's 'bootmgr.efi' (bit #0)\n\t\t\t\tif (((target_type == TT_UEFI) || allow_dual_uefi_bios) && HAS_WIN7_EFI(img_report)) {\n\t\t\t\t\tPrintInfo(0, MSG_232, lmprintf(MSG_307));\n\t\t\t\t\tuprintf(\"Win7 EFI boot setup\");\n\t\t\t\t\timg_report.wininst_path[0][0] = drive_name[0];\n\t\t\t\t\tefi_dst[0] = drive_name[0];\n\t\t\t\t\tefi_dst[sizeof(efi_dst) - sizeof(\"\\\\bootx64.efi\")] = 0;\n\t\t\t\t\tif (!CreateDirectoryA(efi_dst, 0)) {\n\t\t\t\t\t\tuprintf(\"Could not create directory '%s': %s\", efi_dst, WindowsErrorString());\n\t\t\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_PATCH));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tefi_dst[sizeof(efi_dst) - sizeof(\"\\\\bootx64.efi\")] = '\\\\';\n\t\t\t\t\t\tif (!WimExtractFile(img_report.wininst_path[0], 1, \"Windows\\\\Boot\\\\EFI\\\\bootmgfw.efi\", efi_dst)) {\n\t\t\t\t\t\t\tuprintf(\"Failed to setup Win7 EFI boot\");\n\t\t\t\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_PATCH));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( (target_type == TT_BIOS) && HAS_WINPE(img_report) ) {\n\t\t\t\t\t// Apply WinPE fixup\n\t\t\t\t\tif (!SetupWinPE(drive_name[0]))\n\t\t\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_PATCH));\n\t\t\t\t}\n\t\t\t\tif (unattend_xml_path != NULL) {\n\t\t\t\t\tif (!ApplyWindowsCustomization(drive_name[0], unattend_xml_flags))\n\t\t\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_PATCH));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tUpdateProgress(OP_FINALIZE, -1.0f);\n\t\tPrintInfoDebug(0, MSG_233);\n\t\tif ((boot_type == BT_IMAGE) && (image_path != NULL) && (img_report.is_iso) && (!windows_to_go))\n\t\t\tUpdateMD5Sum(drive_name, md5sum_name[img_report.has_md5sum ? img_report.has_md5sum - 1 : 0]);\n\t\tif (IsChecked(IDC_EXTENDED_LABEL))\n\t\t\tSetAutorun(drive_name);\n\t\t// Issue another complete remount before we exit, to ensure we're clean\n\t\tRemountVolume(drive_name, TRUE);\n\t\t// NTFS fixup (WinPE/AIK images don't seem to boot without an extra checkdisk)\n\t\tif ((boot_type == BT_IMAGE) && (img_report.is_iso) && (fs_type == FS_NTFS)) {\n\t\t\t// Try to ensure that all messages from Checkdisk will be in English\n\t\t\tif (PRIMARYLANGID(GetThreadUILanguage()) != LANG_ENGLISH) {\n\t\t\t\tSetThreadUILanguage(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));\n\t\t\t\tif (PRIMARYLANGID(GetThreadUILanguage()) != LANG_ENGLISH)\n\t\t\t\t\tuprintf(\"Note: CheckDisk messages may be localized\");\n\t\t\t}\n\t\t\tCheckDisk(drive_name[0]);\n\t\t\tUpdateProgress(OP_FINALIZE, -1.0f);\n\t\t}\n\t}\n\n\t// Copy any additonal files from an optional zip archive selected by the user\n\tif (!IS_ERROR(ErrorStatus)) {\n\t\tUpdateProgress(OP_EXTRACT_ZIP, 0.0f);\n\t\tdrive_name[2] = 0;\n\t\tif (archive_path != NULL && fs_type < FS_EXT2 && !ExtractZip(archive_path, drive_name) && !IS_ERROR(ErrorStatus))\n\t\t\tuprintf(\"WARNING: Could not copy additional files\");\n\t}\n\nout:\n\tif ((write_as_esp || write_as_ext) && volume_name != NULL)\n\t\tAltUnmountVolume(volume_name, TRUE);\n\telse\n\t\tsafe_free(volume_name);\n\tsafe_free(buffer);\n\tsafe_unlockclose(hLogicalVolume);\n\tsafe_unlockclose(hPhysicalDrive);\t// This can take a while\n\tif ((boot_type == BT_IMAGE) && write_as_image) {\n\t\tPrintInfo(0, MSG_320, lmprintf(MSG_307));\n\t\tSleep(200);\n\t\tVdsRescan(VDS_RESCAN_REFRESH, 0, TRUE);\n\t\t// Trying to mount accessible partitions after writing an image leads to the\n\t\t// creation of the infamous 'System Volume Information' folder on ESPs, which\n\t\t// in turn leads to checksum errors for Ubuntu's boot/grub/efi.img (that maps\n\t\t// to the Ubuntu ESP). So we only call the code below if there are no ESPs or\n\t\t// if we're running a Ventoy image.\n\t\tif ((GetEspOffset(DriveIndex) == 0) || (img_report.compression_type == BLED_COMPRESSION_VTSI)) {\n\t\t\tWaitForLogical(DriveIndex, 0);\n\t\t\tif (GetDrivePartitionData(SelectedDrive.DeviceNumber, fs_name, sizeof(fs_name), TRUE)) {\n\t\t\t\tvolume_name = GetLogicalName(DriveIndex, 0, TRUE, TRUE);\n\t\t\t\tif ((volume_name != NULL) && (MountVolume(drive_name, volume_name)))\n\t\t\t\t\tuprintf(\"Remounted %s as %c:\", volume_name, toupper(drive_name[0]));\n\t\t\t}\n\t\t}\n\t}\n\tif (IS_ERROR(ErrorStatus)) {\n\t\tvolume_name = GetLogicalName(DriveIndex, SelectedDrive.Partition[partition_index[PI_MAIN]].Offset, TRUE, TRUE);\n\t\tif (volume_name != NULL) {\n\t\t\tif (MountVolume(drive_name, volume_name))\n\t\t\t\tuprintf(\"Re-mounted volume as %c: after error\", toupper(drive_name[0]));\n\t\t\tfree(volume_name);\n\t\t}\n\t}\n\tPostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)TRUE, 0);\n\tExitThread(0);\n}\n"
  },
  {
    "path": "src/format.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Formatting function calls\n * Copyright © 2011-2023 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <stdint.h>\n#include <windows.h>\n#include <winioctl.h>\t// for MEDIA_TYPE\n\n#pragma once\n\n/* Callback command types (some errorcode were filled from HPUSBFW V2.2.3 and their\n   designation from docs.microsoft.com/windows/win32/api/vds/nf-vds-ivdsvolumemf2-formatex */\ntypedef enum {\n\tFCC_PROGRESS,\n\tFCC_DONE_WITH_STRUCTURE,\n\tFCC_UNKNOWN2,\n\tFCC_INCOMPATIBLE_FILE_SYSTEM,\n\tFCC_UNKNOWN4,\n\tFCC_UNKNOWN5,\n\tFCC_ACCESS_DENIED,\n\tFCC_MEDIA_WRITE_PROTECTED,\n\tFCC_VOLUME_IN_USE,\n\tFCC_CANT_QUICK_FORMAT,\n\tFCC_UNKNOWNA,\n\tFCC_DONE,\n\tFCC_BAD_LABEL,\n\tFCC_UNKNOWND,\n\tFCC_OUTPUT,\n\tFCC_STRUCTURE_PROGRESS,\n\tFCC_CLUSTER_SIZE_TOO_SMALL,\n\tFCC_CLUSTER_SIZE_TOO_BIG,\n\tFCC_VOLUME_TOO_SMALL,\n\tFCC_VOLUME_TOO_BIG,\n\tFCC_NO_MEDIA_IN_DRIVE,\n\tFCC_UNKNOWN15,\n\tFCC_UNKNOWN16,\n\tFCC_UNKNOWN17,\n\tFCC_DEVICE_NOT_READY,\n\tFCC_CHECKDISK_PROGRESS,\n\tFCC_UNKNOWN1A,\n\tFCC_UNKNOWN1B,\n\tFCC_UNKNOWN1C,\n\tFCC_UNKNOWN1D,\n\tFCC_UNKNOWN1E,\n\tFCC_UNKNOWN1F,\n\tFCC_READ_ONLY_MODE,\n\tFCC_UNKNOWN21,\n\tFCC_UNKNOWN22,\n\tFCC_UNKNOWN23,\n\tFCC_UNKNOWN24,\n\tFCC_ALIGNMENT_VIOLATION,\n} FILE_SYSTEM_CALLBACK_COMMAND;\n\ntypedef struct {\n\tDWORD Lines;\n\tCHAR* Output;\n} TEXTOUTPUT, *PTEXTOUTPUT;\n\ntypedef BOOLEAN (__stdcall *FILE_SYSTEM_CALLBACK)(\n\tFILE_SYSTEM_CALLBACK_COMMAND Command,\n\tULONG                        Action,\n\tPVOID                        pData\n);\n\n/* Parameter names aligned to\n   http://msdn.microsoft.com/en-us/library/windows/desktop/aa819439.aspx */\ntypedef VOID (WINAPI *FormatEx_t)(\n\tWCHAR*               DriveRoot,\n\tMEDIA_TYPE           MediaType,\t\t// See WinIoCtl.h\n\tWCHAR*               FileSystemTypeName,\n\tWCHAR*               Label,\n\tBOOL                 QuickFormat,\n\tULONG                DesiredUnitAllocationSize,\n\tFILE_SYSTEM_CALLBACK Callback\n);\n\n/* Mostly from http://doxygen.reactos.org/df/d85/fmifs_8h_source.html */\ntypedef LONG (WINAPI *Chkdsk_t)(\n\tWCHAR*               DriveRoot,\n\tWCHAR*               FileSystemTypeName,\n\tBOOL                 CorrectErrors,\n\tBOOL                 Verbose,\n\tBOOL                 CheckOnlyIfDirty,\n\tBOOL                 ScanDrive,\n\tVOID*                Unused2,\n\tVOID*                Unused3,\n\tFILE_SYSTEM_CALLBACK Callback);\n\n/* http://msdn.microsoft.com/en-us/library/windows/desktop/aa383357.aspx */\ntypedef enum  {\n\tFPF_COMPRESSED       = 0x01 \n} FILE_SYSTEM_PROP_FLAG;\n\ntypedef BOOLEAN (WINAPI* EnableVolumeCompression_t)(\n\tWCHAR*               DriveRoot,\n\tULONG                CompressionFlags\t// FILE_SYSTEM_PROP_FLAG\n);\n\n#define IMG_COMPRESSION_FFU     (BLED_COMPRESSION_MAX)\n#define IMG_COMPRESSION_VHD     (BLED_COMPRESSION_MAX + 1)\n#define IMG_COMPRESSION_VHDX    (BLED_COMPRESSION_MAX + 2)\n\nBOOL WritePBR(HANDLE hLogicalDrive);\nBOOL FormatLargeFAT32(DWORD DriveIndex, uint64_t PartitionOffset, DWORD ClusterSize, LPCSTR FSName, LPCSTR Label, DWORD Flags);\nBOOL FormatExtFs(DWORD DriveIndex, uint64_t PartitionOffset, DWORD BlockSize, LPCSTR FSName, LPCSTR Label, DWORD Flags);\nBOOL FormatPartition(DWORD DriveIndex, uint64_t PartitionOffset, DWORD UnitAllocationSize, USHORT FSType, LPCSTR Label, DWORD Flags);\nDWORD WINAPI FormatThread(void* param);\n"
  },
  {
    "path": "src/format_ext.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * extfs formatting\n * Copyright © 2019-2025 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n#include <assert.h>\n\n#include \"rufus.h\"\n#include \"file.h\"\n#include \"drive.h\"\n#include \"format.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n#include \"ext2fs/ext2fs.h\"\n\nextern const char* FileSystemLabel[FS_MAX];\nextern io_manager nt_io_manager;\nextern DWORD ext2_last_winerror(DWORD default_error);\nstatic float ext2_percent_start = 0.0f, ext2_percent_share = 0.5f;\n\ntypedef struct {\n\tuint64_t max_size;\n\tuint32_t block_size;\n\tuint32_t inode_size;\n\tuint32_t inode_ratio;\n} ext2fs_default_t;\n\nconst char* error_message(errcode_t error_code)\n{\n\tstatic char error_string[256];\n\n\tswitch (error_code) {\n\tcase EXT2_ET_MAGIC_EXT2FS_FILSYS:\n\tcase EXT2_ET_MAGIC_BADBLOCKS_LIST:\n\tcase EXT2_ET_MAGIC_BADBLOCKS_ITERATE:\n\tcase EXT2_ET_MAGIC_INODE_SCAN:\n\tcase EXT2_ET_MAGIC_IO_CHANNEL:\n\tcase EXT2_ET_MAGIC_IO_MANAGER:\n\tcase EXT2_ET_MAGIC_BLOCK_BITMAP:\n\tcase EXT2_ET_MAGIC_INODE_BITMAP:\n\tcase EXT2_ET_MAGIC_GENERIC_BITMAP:\n\tcase EXT2_ET_MAGIC_ICOUNT:\n\tcase EXT2_ET_MAGIC_EXTENT_HANDLE:\n\tcase EXT2_ET_BAD_MAGIC:\n\t\treturn \"Bad magic\";\n\tcase EXT2_ET_RO_FILSYS:\n\t\treturn \"Read-only file system\";\n\tcase EXT2_ET_GDESC_BAD_BLOCK_MAP:\n\tcase EXT2_ET_GDESC_BAD_INODE_MAP:\n\tcase EXT2_ET_GDESC_BAD_INODE_TABLE:\n\t\treturn \"Bad map or table\";\n\tcase EXT2_ET_UNEXPECTED_BLOCK_SIZE:\n\t\treturn \"Unexpected block size\";\n\tcase EXT2_ET_DIR_CORRUPTED:\n\t\treturn \"Corrupted entry\";\n\tcase EXT2_ET_GDESC_READ:\n\tcase EXT2_ET_GDESC_WRITE:\n\tcase EXT2_ET_INODE_BITMAP_WRITE:\n\tcase EXT2_ET_INODE_BITMAP_READ:\n\tcase EXT2_ET_BLOCK_BITMAP_WRITE:\n\tcase EXT2_ET_BLOCK_BITMAP_READ:\n\tcase EXT2_ET_INODE_TABLE_WRITE:\n\tcase EXT2_ET_INODE_TABLE_READ:\n\tcase EXT2_ET_NEXT_INODE_READ:\n\tcase EXT2_ET_SHORT_READ:\n\tcase EXT2_ET_SHORT_WRITE:\n\t\treturn \"read/write error\";\n\tcase EXT2_ET_DIR_NO_SPACE:\n\t\treturn \"no space left\";\n\tcase EXT2_ET_TOOSMALL:\n\t\treturn \"Too small\";\n\tcase EXT2_ET_BAD_DEVICE_NAME:\n\t\treturn \"Bad device name\";\n\tcase EXT2_ET_MISSING_INODE_TABLE:\n\t\treturn \"Missing inode table\";\n\tcase EXT2_ET_CORRUPT_SUPERBLOCK:\n\t\treturn \"Superblock is corrupted\";\n\tcase EXT2_ET_CALLBACK_NOTHANDLED:\n\t\treturn \"Unhandled callback\";\n\tcase EXT2_ET_BAD_BLOCK_IN_INODE_TABLE:\n\t\treturn \"Bad block in inode table\";\n\tcase EXT2_ET_UNSUPP_FEATURE:\n\tcase EXT2_ET_RO_UNSUPP_FEATURE:\n\tcase EXT2_ET_UNIMPLEMENTED:\n\t\treturn \"Unsupported feature\";\n\tcase EXT2_ET_LLSEEK_FAILED:\n\t\treturn \"Seek failed\";\n\tcase EXT2_ET_NO_MEMORY:\n\tcase EXT2_ET_BLOCK_ALLOC_FAIL:\n\tcase EXT2_ET_INODE_ALLOC_FAIL:\n\t\treturn \"Out of memory\";\n\tcase EXT2_ET_INVALID_ARGUMENT:\n\t\treturn \"Invalid argument\";\n\tcase EXT2_ET_NO_DIRECTORY:\n\t\treturn \"No directory\";\n\tcase EXT2_ET_FILE_NOT_FOUND:\n\t\treturn \"File not found\";\n\tcase EXT2_ET_FILE_RO:\n\t\treturn \"File is read-only\";\n\tcase EXT2_ET_DIR_EXISTS:\n\t\treturn \"Directory already exists\";\n\tcase EXT2_ET_CANCEL_REQUESTED:\n\t\treturn \"Cancel requested\";\n\tcase EXT2_ET_FILE_TOO_BIG:\n\t\treturn \"File too big\";\n\tcase EXT2_ET_JOURNAL_NOT_BLOCK:\n\tcase EXT2_ET_NO_JOURNAL_SB:\n\t\treturn \"No journal superblock\";\n\tcase EXT2_ET_JOURNAL_TOO_SMALL:\n\t\treturn \"Journal too small\";\n\tcase EXT2_ET_NO_JOURNAL:\n\t\treturn \"No journal\";\n\tcase EXT2_ET_TOO_MANY_INODES:\n\t\treturn \"Too many inodes\";\n\tcase EXT2_ET_NO_CURRENT_NODE:\n\t\treturn \"No current node\";\n\tcase EXT2_ET_OP_NOT_SUPPORTED:\n\t\treturn \"Operation not supported\";\n\tcase EXT2_ET_IO_CHANNEL_NO_SUPPORT_64:\n\t\treturn \"I/O Channel does not support 64-bit operation\";\n\tcase EXT2_ET_BAD_DESC_SIZE:\n\t\treturn \"Bad descriptor size\";\n\tcase EXT2_ET_INODE_CSUM_INVALID:\n\tcase EXT2_ET_INODE_BITMAP_CSUM_INVALID:\n\tcase EXT2_ET_EXTENT_CSUM_INVALID:\n\tcase EXT2_ET_DIR_CSUM_INVALID:\n\tcase EXT2_ET_EXT_ATTR_CSUM_INVALID:\n\tcase EXT2_ET_SB_CSUM_INVALID:\n\tcase EXT2_ET_BLOCK_BITMAP_CSUM_INVALID:\n\tcase EXT2_ET_MMP_CSUM_INVALID:\n\t\treturn \"Invalid checksum\";\n\tcase EXT2_ET_UNKNOWN_CSUM:\n\t\treturn \"Unknown checksum\";\n\tcase EXT2_ET_FILE_EXISTS:\n\t\treturn \"File exists\";\n\tcase EXT2_ET_INODE_IS_GARBAGE:\n\t\treturn \"Inode is garbage\";\n\tcase EXT2_ET_JOURNAL_FLAGS_WRONG:\n\t\treturn \"Wrong journal flags\";\n\tcase EXT2_ET_FILESYSTEM_CORRUPTED:\n\t\treturn \"File system is corrupted\";\n\tcase EXT2_ET_BAD_CRC:\n\t\treturn \"Bad CRC\";\n\tcase EXT2_ET_CORRUPT_JOURNAL_SB:\n\t\treturn \"Journal Superblock is corrupted\";\n\tcase EXT2_ET_INODE_CORRUPTED:\n\tcase EXT2_ET_EA_INODE_CORRUPTED:\n\t\treturn \"Inode is corrupted\";\n\tcase EXT2_ET_NO_GDESC:\n\t\treturn \"Group descriptors not loaded\";\n\tdefault:\n\t\tif ((error_code > EXT2_ET_BASE) && error_code < (EXT2_ET_BASE + 1000)) {\n\t\t\tstatic_sprintf(error_string, \"Unknown ext2fs error %ld (EXT2_ET_BASE + %ld)\", error_code, error_code - EXT2_ET_BASE);\n\t\t} else {\n\t\t\tSetLastError((ErrorStatus == 0) ? RUFUS_ERROR(error_code & 0xFFFF) : ErrorStatus);\n\t\t\tstatic_sprintf(error_string, \"%s\", WindowsErrorString());\n\t\t}\n\t\treturn error_string;\n\t}\n}\n\nerrcode_t ext2fs_print_progress(int64_t cur_value, int64_t max_value)\n{\n\tUpdateProgressWithInfo(OP_FORMAT, MSG_217, (uint64_t)((ext2_percent_start * max_value) + (ext2_percent_share * cur_value)), max_value);\n\tuprint_progress((uint64_t)cur_value, (uint64_t)max_value);\n\treturn IS_ERROR(ErrorStatus) ? EXT2_ET_CANCEL_REQUESTED : 0;\n}\n\nconst char* GetExtFsLabel(DWORD DriveIndex, uint64_t PartitionOffset)\n{\n\tstatic char label[EXT2_LABEL_LEN + 1];\n\terrcode_t r;\n\text2_filsys ext2fs = NULL;\n\tio_manager manager = nt_io_manager;\n\tchar* volume_name = GetExtPartitionName(DriveIndex, PartitionOffset);\n\n\tif (volume_name == NULL)\n\t\treturn NULL;\n\tr = ext2fs_open(volume_name, EXT2_FLAG_SKIP_MMP, 0, 0, manager, &ext2fs);\n\tfree(volume_name);\n\tif (r == 0) {\n\t\tassert(ext2fs != NULL);\n\t\tstrncpy(label, ext2fs->super->s_volume_name, EXT2_LABEL_LEN);\n\t\tlabel[EXT2_LABEL_LEN] = 0;\n\t}\n\tif (ext2fs != NULL)\n\t\text2fs_close(ext2fs);\n\treturn (r == 0) ? label : NULL;\n}\n\n#define TEST_IMG_PATH               \"\\\\??\\\\C:\\\\tmp\\\\disk.img\"\n#define TEST_IMG_SIZE               4000\t\t// Size in MB\n#define SET_EXT2_FORMAT_ERROR(x)    if (!IS_ERROR(ErrorStatus)) ErrorStatus = ext2_last_winerror(x)\n\nBOOL FormatExtFs(DWORD DriveIndex, uint64_t PartitionOffset, DWORD BlockSize, LPCSTR FSName, LPCSTR Label, DWORD Flags)\n{\n\t// Mostly taken from mke2fs.conf\n\tconst float reserve_ratio = 0.05f;\n\tconst ext2fs_default_t ext2fs_default[5] = {\n\t\t{ 3 * MB, 1024, 128, 3},\t// \"floppy\"\n\t\t{ 512 * MB, 1024, 128, 2},\t// \"small\"\n\t\t{ 4 * GB, 4096, 256, 2},\t// \"default\"\n\t\t{ 16 * GB, 4096, 256, 3},\t// \"big\"\n\t\t{ 1024 * TB, 4096, 256, 4}\t// \"huge\"\n\t};\n\n\tBOOL ret = FALSE;\n\tchar* volume_name = NULL;\n\tint i, count;\n\tstruct ext2_super_block features = { 0 };\n\tio_manager manager = nt_io_manager;\n\tblk_t journal_size;\n\tblk64_t size = 0, cur;\n\text2_filsys ext2fs = NULL;\n\terrcode_t r;\n\tuint8_t* buf = NULL;\n\n#if defined(RUFUS_TEST)\n\t// Create a disk image file to test\n\tuint8_t zb[1024];\n\tHANDLE h;\n\tDWORD dwSize;\n\tHCRYPTPROV hCryptProv = 0;\n\tvolume_name = strdup(TEST_IMG_PATH);\n\tuprintf(\"Creating '%s'...\", volume_name);\n\tif (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT) || !CryptGenRandom(hCryptProv, sizeof(zb), zb)) {\n\t\tuprintf(\"Failed to randomize buffer - filling with constant value\");\n\t\tmemset(zb, rand(), sizeof(zb));\n\t}\n\tCryptReleaseContext(hCryptProv, 0);\n\th = CreateFileU(volume_name, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\n\tfor (i = 0; i < TEST_IMG_SIZE * sizeof(zb); i++) {\n\t\tif (!WriteFile(h, zb, sizeof(zb), &dwSize, NULL) || (dwSize != sizeof(zb))) {\n\t\t\tuprintf(\"Write error: %s\", WindowsErrorString());\n\t\t\tbreak;\n\t\t}\n\t}\n\tCloseHandle(h);\n#else\n\tvolume_name = GetExtPartitionName(DriveIndex, PartitionOffset);\n#endif\n\tif ((volume_name == NULL) | (strlen(FSName) != 4) || (strncmp(FSName, \"ext\", 3) != 0)) {\n\t\tErrorStatus = RUFUS_ERROR(ERROR_INVALID_PARAMETER);\n\t\tgoto out;\n\t}\n\tif (strchr(volume_name, ' ') != NULL)\n\t\tuprintf(\"Notice: Using physical device to access partition data\");\n\n\tif ((strcmp(FSName, FileSystemLabel[FS_EXT2]) != 0) && (strcmp(FSName, FileSystemLabel[FS_EXT3]) != 0)) {\n\t\tif (strcmp(FSName, FileSystemLabel[FS_EXT4]) == 0)\n\t\t\tuprintf(\"ext4 file system is not supported, defaulting to ext3\");\n\t\telse\n\t\t\tuprintf(\"Invalid ext file system version requested, defaulting to ext3\");\n\t\tFSName = FileSystemLabel[FS_EXT3];\n\t}\n\n\tPrintInfoDebug(0, MSG_222, FSName);\n\tUpdateProgressWithInfoInit(NULL, TRUE);\n\n\t// Figure out the volume size and block size\n\tr = ext2fs_get_device_size2(volume_name, KB, &size);\n\tif ((r != 0) || (size == 0)) {\n\t\tSET_EXT2_FORMAT_ERROR(ERROR_READ_FAULT);\n\t\tuprintf(\"Could not read device size: %s\", error_message(r));\n\t\tgoto out;\n\t}\n\tsize *= KB;\n\tfor (i = 0; i < ARRAYSIZE(ext2fs_default); i++) {\n\t\tif (size < ext2fs_default[i].max_size)\n\t\t\tbreak;\n\t}\n\tassert(i < ARRAYSIZE(ext2fs_default));\n\tif ((BlockSize == 0) || (BlockSize < EXT2_MIN_BLOCK_SIZE))\n\t\tBlockSize = ext2fs_default[i].block_size;\n\tassert(IS_POWER_OF_2(BlockSize));\n\tfor (features.s_log_block_size = 0; EXT2_BLOCK_SIZE_BITS(&features) <= EXT2_MAX_BLOCK_LOG_SIZE; features.s_log_block_size++) {\n\t\tif (EXT2_BLOCK_SIZE(&features) == BlockSize)\n\t\t\tbreak;\n\t}\n\tassert(EXT2_BLOCK_SIZE_BITS(&features) <= EXT2_MAX_BLOCK_LOG_SIZE);\n\tfeatures.s_log_cluster_size = features.s_log_block_size;\n\tsize /= BlockSize;\n\n\t// ext2 and ext3 have a can only accommodate up to Blocksize * 2^32 sized volumes\n\tif (((strcmp(FSName, FileSystemLabel[FS_EXT2]) == 0) || (strcmp(FSName, FileSystemLabel[FS_EXT3]) == 0)) &&\n\t\t(size >= 0x100000000ULL)) {\n\t\tSET_EXT2_FORMAT_ERROR(ERROR_INVALID_VOLUME_SIZE);\n\t\tuprintf(\"Volume size is too large for ext2 or ext3\");\n\t\tgoto out;\n\t}\n\n\t// Set the blocks, reserved blocks and inodes\n\text2fs_blocks_count_set(&features, size);\n\text2fs_r_blocks_count_set(&features, (blk64_t)(reserve_ratio * size));\n\tfeatures.s_rev_level = 1;\n\tfeatures.s_inode_size = ext2fs_default[i].inode_size;\n\tfeatures.s_inodes_count = ((ext2fs_blocks_count(&features) >> ext2fs_default[i].inode_ratio) > UINT32_MAX) ?\n\t\tUINT32_MAX : (uint32_t)(ext2fs_blocks_count(&features) >> ext2fs_default[i].inode_ratio);\n\tuprintf(\"%d possible inodes out of %lld blocks (block size = %d)\", features.s_inodes_count, size, EXT2_BLOCK_SIZE(&features));\n\tuprintf(\"%lld blocks (%0.1f%%) reserved for the super user\", ext2fs_r_blocks_count(&features), reserve_ratio * 100.0f);\n\n\t// Set features\n\text2fs_set_feature_dir_index(&features);\n\text2fs_set_feature_filetype(&features);\n\text2fs_set_feature_large_file(&features);\n\text2fs_set_feature_sparse_super(&features);\n\text2fs_set_feature_xattr(&features);\n\tif (FSName[3] != '2')\n\t\text2fs_set_feature_journal(&features);\n\tfeatures.s_default_mount_opts = EXT2_DEFM_XATTR_USER | EXT2_DEFM_ACL;\n\n\t// Now that we have set our base features, initialize a virtual superblock\n\tr = ext2fs_initialize(volume_name, EXT2_FLAG_EXCLUSIVE | EXT2_FLAG_64BITS, &features, manager, &ext2fs);\n\tif (r != 0) {\n\t\tSET_EXT2_FORMAT_ERROR(ERROR_INVALID_DATA);\n\t\tuprintf(\"Could not initialize %s features: %s\", FSName, error_message(r));\n\t\tgoto out;\n\t}\n\n\t// Zero 16 blocks of data from the start of our volume\n\tbuf = calloc(16, ext2fs->io->block_size);\n\tassert(buf != NULL);\n\tr = io_channel_write_blk64(ext2fs->io, 0, 16, buf);\n\tsafe_free(buf);\n\tif (r != 0) {\n\t\tSET_EXT2_FORMAT_ERROR(ERROR_WRITE_FAULT);\n\t\tuprintf(\"Could not zero %s superblock area: %s\", FSName, error_message(r));\n\t\tgoto out;\n\t}\n\n\t// Finish setting up the file system\n\tIGNORE_RETVAL(CoCreateGuid((GUID*)ext2fs->super->s_uuid));\n\text2fs_init_csum_seed(ext2fs);\n\text2fs->super->s_def_hash_version = EXT2_HASH_HALF_MD4;\n\tIGNORE_RETVAL(CoCreateGuid((GUID*)ext2fs->super->s_hash_seed));\n\text2fs->super->s_max_mnt_count = -1;\n\text2fs->super->s_creator_os = EXT2_OS_WINDOWS;\n\text2fs->super->s_errors = EXT2_ERRORS_CONTINUE;\n\tif (Label != NULL)\n\t\tstatic_strcpy(ext2fs->super->s_volume_name, Label);\n\n\tr = ext2fs_allocate_tables(ext2fs);\n\tif (r != 0) {\n\t\tSET_EXT2_FORMAT_ERROR(ERROR_INVALID_DATA);\n\t\tuprintf(\"Could not allocate %s tables: %s\", FSName, error_message(r));\n\t\tgoto out;\n\t}\n\tr = ext2fs_convert_subcluster_bitmap(ext2fs, &ext2fs->block_map);\n\tif (r != 0) {\n\t\tuprintf(\"Could not set %s cluster bitmap: %s\", FSName, error_message(r));\n\t\tgoto out;\n\t}\n\n\text2_percent_start = 0.0f;\n\text2_percent_share = (FSName[3] == '2') ? 1.0f : 0.5f;\n\tuprintf(\"Creating %d inode sets: [1 marker = %0.1f set(s)]\", ext2fs->group_desc_count,\n\t\tmax((float)ext2fs->group_desc_count / MAX_MARKER, 1.0f));\n\tfor (i = 0; i < (int)ext2fs->group_desc_count; i++) {\n\t\tif (ext2fs_print_progress((int64_t)i, (int64_t)ext2fs->group_desc_count))\n\t\t\tgoto out;\n\t\tcur = ext2fs_inode_table_loc(ext2fs, i);\n\t\tcount = ext2fs_div_ceil((ext2fs->super->s_inodes_per_group - ext2fs_bg_itable_unused(ext2fs, i))\n\t\t\t* EXT2_INODE_SIZE(ext2fs->super), EXT2_BLOCK_SIZE(ext2fs->super));\n\t\tr = ext2fs_zero_blocks2(ext2fs, cur, count, &cur, &count);\n\t\tif (r != 0) {\n\t\t\tSET_EXT2_FORMAT_ERROR(ERROR_WRITE_FAULT);\n\t\t\tuprintf(\"\\r\\nCould not zero inode set at position %llu (%d blocks): %s\", cur, count, error_message(r));\n\t\t\tgoto out;\n\t\t}\n\t}\n\tuprintfs(\"\\r\\n\");\n\n\t// Create root and lost+found dirs\n\tr = ext2fs_mkdir(ext2fs, EXT2_ROOT_INO, EXT2_ROOT_INO, 0);\n\tif (r != 0) {\n\t\tSET_EXT2_FORMAT_ERROR(ERROR_FILE_CORRUPT);\n\t\tuprintf(\"Failed to create %s root dir: %s\", FSName, error_message(r));\n\t\tgoto out;\n\t}\n\text2fs->umask = 077;\n\tr = ext2fs_mkdir(ext2fs, EXT2_ROOT_INO, 0, \"lost+found\");\n\tif (r != 0) {\n\t\tSET_EXT2_FORMAT_ERROR(ERROR_FILE_CORRUPT);\n\t\tuprintf(\"Failed to create %s 'lost+found' dir: %s\", FSName, error_message(r));\n\t\tgoto out;\n\t}\n\n\t// Create bitmaps\n\tfor (i = EXT2_ROOT_INO + 1; i < (int)EXT2_FIRST_INODE(ext2fs->super); i++)\n\t\text2fs_inode_alloc_stats(ext2fs, i, 1);\n\text2fs_mark_ib_dirty(ext2fs);\n\n\tr = ext2fs_mark_inode_bitmap2(ext2fs->inode_map, EXT2_BAD_INO);\n\tif (r != 0) {\n\t\tSET_EXT2_FORMAT_ERROR(ERROR_WRITE_FAULT);\n\t\tuprintf(\"Could not set inode bitmaps: %s\", error_message(r));\n\t\tgoto out;\n\t}\n\text2fs_inode_alloc_stats(ext2fs, EXT2_BAD_INO, 1);\n\tr = ext2fs_update_bb_inode(ext2fs, NULL);\n\tif (r != 0) {\n\t\tSET_EXT2_FORMAT_ERROR(ERROR_WRITE_FAULT);\n\t\tuprintf(\"Could not set inode stats: %s\", error_message(r));\n\t\tgoto out;\n\t}\n\n\tif (FSName[3] != '2') {\n\t\t// Create the journal\n\t\text2_percent_start = 0.5f;\n\t\tjournal_size = ext2fs_default_journal_size(ext2fs_blocks_count(ext2fs->super));\n\t\tjournal_size /= 2;\t// That journal init is really killing us!\n\t\tuprintf(\"Creating %d journal blocks: [1 marker = %0.1f block(s)]\", journal_size,\n\t\t\tmax((float)journal_size / MAX_MARKER, 1.0f));\n\t\t// Even with EXT2_MKJOURNAL_LAZYINIT, this call is absolutely dreadful in terms of speed...\n\t\tr = ext2fs_add_journal_inode(ext2fs, journal_size, EXT2_MKJOURNAL_NO_MNT_CHECK | ((Flags & FP_QUICK) ? EXT2_MKJOURNAL_LAZYINIT : 0));\n\t\tuprintfs(\"\\r\\n\");\n\t\tif (r != 0) {\n\t\t\tSET_EXT2_FORMAT_ERROR(ERROR_WRITE_FAULT);\n\t\t\tuprintf(\"Could not create %s journal: %s\", FSName, error_message(r));\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\t// Create a 'persistence.conf' file if required\n\tif (Flags & FP_CREATE_PERSISTENCE_CONF) {\n\t\t// You *do* want the LF at the end of the \"/ union\" line, else Debian Live bails out...\n\t\tconst char* name = \"persistence.conf\", data[] = \"/ union\\n\";\n\t\tint written = 0, fsize = sizeof(data) - 1;\n\t\text2_file_t ext2fd;\n\t\text2_ino_t inode_id;\n\t\ttime_t ctime = time(NULL);\n\t\tstruct ext2_inode inode = { 0 };\n\t\t// Don't care about the Y2K38 problem of ext2/ext3 for a 'persistence.conf' timestamp\n\t\tif (ctime > UINT32_MAX)\n\t\t\tctime = UINT32_MAX;\n\t\tinode.i_mode = 0100644;\n\t\tinode.i_links_count = 1;\n\t\t// coverity[store_truncates_time_t]\n\t\tinode.i_atime = (uint32_t)ctime;\n\t\t// coverity[store_truncates_time_t]\n\t\tinode.i_ctime = (uint32_t)ctime;\n\t\t// coverity[store_truncates_time_t]\n\t\tinode.i_mtime = (uint32_t)ctime;\n\t\tinode.i_size = fsize;\n\n\t\text2fs_namei(ext2fs, EXT2_ROOT_INO, EXT2_ROOT_INO, name, &inode_id);\n\t\text2fs_new_inode(ext2fs, EXT2_ROOT_INO, 010755, 0, &inode_id);\n\t\text2fs_link(ext2fs, EXT2_ROOT_INO, name, inode_id, EXT2_FT_REG_FILE);\n\t\text2fs_inode_alloc_stats(ext2fs, inode_id, 1);\n\t\text2fs_write_new_inode(ext2fs, inode_id, &inode);\n\t\text2fs_file_open(ext2fs, inode_id, EXT2_FILE_WRITE, &ext2fd);\n\t\tif ((ext2fs_file_write(ext2fd, data, fsize, &written) != 0) || (written != fsize))\n\t\t\tuprintf(\"Error: Could not create '%s' file\", name);\n\t\telse\n\t\t\tuprintf(\"Created '%s' file\", name);\n\t\text2fs_file_close(ext2fd);\n\t}\n\n\t// Finally we can call close() to get the file system gets created\n\tr = ext2fs_close(ext2fs);\n\tif (r == 0) {\n\t\t// Make sure ext2fs isn't freed twice\n\t\text2fs = NULL;\n\t} else {\n\t\tSET_EXT2_FORMAT_ERROR(ERROR_WRITE_FAULT);\n\t\tuprintf(\"Could not create %s volume: %s\", FSName, error_message(r));\n\t\tgoto out;\n\t}\n\tUpdateProgressWithInfo(OP_FORMAT, MSG_217, 100, 100);\n\tret = TRUE;\n\nout:\n\tfree(volume_name);\n\text2fs_free(ext2fs);\n\tfree(buf);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/format_fat32.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Large FAT32 formatting\n * Copyright © 2007-2009 Tom Thornhill/Ridgecrop\n * Copyright © 2011-2025 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n#include <assert.h>\n\n#include \"rufus.h\"\n#include \"file.h\"\n#include \"drive.h\"\n#include \"format.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n\n#define die(msg, err) do { uprintf(msg); ErrorStatus = RUFUS_ERROR(err); goto out; } while(0)\n\nextern BOOL write_as_esp;\n\n/* Large FAT32 */\n#pragma pack(push, 1)\ntypedef struct tagFAT_BOOTSECTOR32\n{\n\t// Common fields.\n\tBYTE sJmpBoot[3];\n\tBYTE sOEMName[8];\n\tWORD wBytsPerSec;\n\tBYTE bSecPerClus;\n\tWORD wRsvdSecCnt;\n\tBYTE bNumFATs;\n\tWORD wRootEntCnt;\n\tWORD wTotSec16;           // if zero, use dTotSec32 instead\n\tBYTE bMedia;\n\tWORD wFATSz16;\n\tWORD wSecPerTrk;\n\tWORD wNumHeads;\n\tDWORD dHiddSec;\n\tDWORD dTotSec32;\n\t// Fat 32/16 only\n\tDWORD dFATSz32;\n\tWORD wExtFlags;\n\tWORD wFSVer;\n\tDWORD dRootClus;\n\tWORD wFSInfo;\n\tWORD wBkBootSec;\n\tBYTE Reserved[12];\n\tBYTE bDrvNum;\n\tBYTE Reserved1;\n\tBYTE bBootSig;           // == 0x29 if next three fields are ok\n\tDWORD dBS_VolID;\n\tBYTE sVolLab[11];\n\tBYTE sBS_FilSysType[8];\n} FAT_BOOTSECTOR32;\n\ntypedef struct {\n\tDWORD dLeadSig;         // 0x41615252\n\tBYTE sReserved1[480];   // zeros\n\tDWORD dStrucSig;        // 0x61417272\n\tDWORD dFree_Count;      // 0xFFFFFFFF\n\tDWORD dNxt_Free;        // 0xFFFFFFFF\n\tBYTE sReserved2[12];    // zeros\n\tDWORD dTrailSig;        // 0xAA550000\n} FAT_FSINFO;\n#pragma pack(pop)\n\n/*\n * 28.2  CALCULATING THE VOLUME SERIAL NUMBER\n *\n * For example, say a disk was formatted on 26 Dec 95 at 9:55 PM and 41.94\n * seconds.  DOS takes the date and time just before it writes it to the\n * disk.\n *\n * Low order word is calculated:               Volume Serial Number is:\n * Month & Day         12/26   0c1ah\n * Sec & Hundredths    41:94   295eh               3578:1d02\n * -----\n * 3578h\n *\n * High order word is calculated:\n * Hours & Minutes     21:55   1537h\n * Year                1995    07cbh\n * -----\n * 1d02h\n */\nstatic DWORD GetVolumeID(void)\n{\n\tSYSTEMTIME s;\n\tDWORD d;\n\tWORD lo, hi, tmp;\n\n\tGetLocalTime(&s);\n\n\tlo = s.wDay + (s.wMonth << 8);\n\ttmp = (s.wMilliseconds / 10) + (s.wSecond << 8);\n\tlo += tmp;\n\n\thi = s.wMinute + (s.wHour << 8);\n\thi += s.wYear;\n\n\td = lo + (hi << 16);\n\treturn d;\n}\n\n/*\n * Proper computation of FAT size\n * See: http://www.syslinux.org/archives/2016-February/024850.html\n * and subsequent replies.\n */\nstatic DWORD GetFATSizeSectors(DWORD DskSize, DWORD ReservedSecCnt, DWORD SecPerClus, DWORD NumFATs, DWORD BytesPerSect)\n{\n\tULONGLONG Numerator, Denominator;\n\tULONGLONG FatElementSize = 4;\n\tULONGLONG ReservedClusCnt = 2;\n\tULONGLONG FatSz;\n\n\tNumerator = DskSize - ReservedSecCnt + ReservedClusCnt * SecPerClus;\n\tDenominator = (ULONGLONG)SecPerClus * BytesPerSect / FatElementSize + NumFATs;\n\tFatSz = Numerator / Denominator + 1;\t// +1 to ensure we are rounded up\n\n\treturn (DWORD)FatSz;\n}\n\n/*\n * Large FAT32 volume formatting from fat32format by Tom Thornhill\n * http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm\n */\nBOOL FormatLargeFAT32(DWORD DriveIndex, uint64_t PartitionOffset, DWORD ClusterSize, LPCSTR FSName, LPCSTR Label, DWORD Flags)\n{\n\tBOOL r = FALSE;\n\tDWORD i;\n\tHANDLE hLogicalVolume = NULL;\n\tDWORD cbRet;\n\tDISK_GEOMETRY dgDrive;\n\tBYTE geometry_ex[256]; // DISK_GEOMETRY_EX is variable size\n\tPDISK_GEOMETRY_EX xdgDrive = (PDISK_GEOMETRY_EX)(void*)geometry_ex;\n\tPARTITION_INFORMATION piDrive;\n\tPARTITION_INFORMATION_EX xpiDrive;\n\t// Recommended values\n\tDWORD ReservedSectCount = 32;\n\tDWORD NumFATs = 2;\n\tDWORD BackupBootSect = 6;\n\tDWORD VolumeId = 0; // calculated before format\n\tchar* VolumeName = NULL;\n\tDWORD BurstSize = 128; // Zero in blocks of 64K typically\n\n\t// Calculated later\n\tDWORD FatSize = 0;\n\tDWORD BytesPerSect = 0;\n\tDWORD SectorsPerCluster = 0;\n\tDWORD TotalSectors = 0;\n\tDWORD AlignSectors = 0;\n\tDWORD SystemAreaSize = 0;\n\tDWORD UserAreaSize = 0;\n\tULONGLONG qTotalSectors = 0;\n\n\t// Structures to be written to the disk\n\tFAT_BOOTSECTOR32* pFAT32BootSect = NULL;\n\tFAT_FSINFO* pFAT32FsInfo = NULL;\n\tDWORD* pFirstSectOfFat = NULL;\n\tBYTE* pZeroSect = NULL;\n\tchar VolId[12] = \"NO NAME    \";\n\n\t// Debug temp vars\n\tULONGLONG FatNeeded, ClusterCount;\n\n\tif (safe_strncmp(FSName, \"FAT\", 3) != 0) {\n\t\tErrorStatus = RUFUS_ERROR(ERROR_INVALID_PARAMETER);\n\t\tgoto out;\n\t}\n\tif (!(Flags & FP_NO_PROGRESS)) {\n\t\tPrintInfoDebug(0, MSG_222, \"Large FAT32\");\n\t\tUpdateProgressWithInfoInit(NULL, TRUE);\n\t}\n\tVolumeId = GetVolumeID();\n\n\t// Open the drive and lock it\n\thLogicalVolume = write_as_esp ?\n\t\tAltGetLogicalHandle(DriveIndex, PartitionOffset, TRUE, TRUE, FALSE) :\n\t\tGetLogicalHandle(DriveIndex, PartitionOffset, TRUE, TRUE, FALSE);\n\tif (IS_ERROR(ErrorStatus))\n\t\tgoto out;\n\tif ((hLogicalVolume == INVALID_HANDLE_VALUE) || (hLogicalVolume == NULL))\n\t\tdie(\"Invalid logical volume handle\", ERROR_INVALID_HANDLE);\n\n\t// Try to disappear the volume while we're formatting it\n\tUnmountVolume(hLogicalVolume);\n\n\t// Work out drive params\n\tif (!DeviceIoControl (hLogicalVolume, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, &dgDrive,\n\t\tsizeof(dgDrive), &cbRet, NULL)) {\n\t\tif (!DeviceIoControl (hLogicalVolume, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, xdgDrive,\n\t\t\tsizeof(geometry_ex), &cbRet, NULL)) {\n\t\t\tuprintf(\"IOCTL_DISK_GET_DRIVE_GEOMETRY error: %s\", WindowsErrorString());\n\t\t\tdie(\"Failed to get device geometry (both regular and _ex)\", ERROR_NOT_SUPPORTED);\n\t\t}\n\t\tmemcpy(&dgDrive, &xdgDrive->Geometry, sizeof(dgDrive));\n\t}\n\tif (dgDrive.BytesPerSector < 512)\n\t\tdgDrive.BytesPerSector = 512;\n\tif (IS_ERROR(ErrorStatus)) goto out;\n\tif (!DeviceIoControl (hLogicalVolume, IOCTL_DISK_GET_PARTITION_INFO, NULL, 0, &piDrive,\n\t\tsizeof(piDrive), &cbRet, NULL)) {\n\t\tif (!DeviceIoControl (hLogicalVolume, IOCTL_DISK_GET_PARTITION_INFO_EX, NULL, 0, &xpiDrive,\n\t\t\tsizeof(xpiDrive), &cbRet, NULL)) {\n\t\t\tuprintf(\"IOCTL_DISK_GET_PARTITION_INFO error: %s\", WindowsErrorString());\n\t\t\tdie(\"Failed to get partition info (both regular and _ex)\", ERROR_NOT_SUPPORTED);\n\t\t}\n\n\t\tmemset(&piDrive, 0, sizeof(piDrive));\n\t\tpiDrive.StartingOffset.QuadPart = xpiDrive.StartingOffset.QuadPart;\n\t\tpiDrive.PartitionLength.QuadPart = xpiDrive.PartitionLength.QuadPart;\n\t\tpiDrive.HiddenSectors = (DWORD)(xpiDrive.StartingOffset.QuadPart / dgDrive.BytesPerSector);\n\t}\n\tif (IS_ERROR(ErrorStatus)) goto out;\n\n\tBytesPerSect = dgDrive.BytesPerSector;\n\n\t// Checks on Disk Size\n\tqTotalSectors = piDrive.PartitionLength.QuadPart / dgDrive.BytesPerSector;\n\t// Low end limit - 65536 sectors\n\tif (qTotalSectors < 65536) {\n\t\t// Most FAT32 implementations would probably mount this volume just fine,\n\t\t// but the spec says that we shouldn't do this, so we won't\n\t\tdie(\"This drive is too small for FAT32 - there must be at least 64K clusters\", APPERR(ERROR_INVALID_CLUSTER_SIZE));\n\t}\n\n\tif (qTotalSectors >= 0xffffffff) {\n\t\t// This is a more fundamental limitation on FAT32 - the total sector count in the root dir\n\t\t// is 32bit. With a bit of creativity, FAT32 could be extended to handle at least 2^28 clusters\n\t\t// There would need to be an extra field in the FSInfo sector, and the old sector count could\n\t\t// be set to 0xffffffff. This is non standard though, the Windows FAT driver FASTFAT.SYS won't\n\t\t// understand this. Perhaps a future version of FAT32 and FASTFAT will handle this.\n\t\tdie(\"This drive is too big for FAT32 - max 2TB supported\", APPERR(ERROR_INVALID_VOLUME_SIZE));\n\t}\n\n\t// Set default cluster size\n\t// https://support.microsoft.com/en-us/help/140365/default-cluster-size-for-ntfs-fat-and-exfat\n\tif (ClusterSize == 0) {\n\t\tif (piDrive.PartitionLength.QuadPart < 64 * MB)\n\t\t\tClusterSize = 512;\n\t\telse if (piDrive.PartitionLength.QuadPart < 128 * MB)\n\t\t\tClusterSize = 1 * KB;\n\t\telse if (piDrive.PartitionLength.QuadPart < 256 * MB)\n\t\t\tClusterSize = 2 * KB;\n\t\telse if (piDrive.PartitionLength.QuadPart < 8 * GB)\n\t\t\tClusterSize = 4 * KB;\n\t\telse if (piDrive.PartitionLength.QuadPart < 16 * GB)\n\t\t\tClusterSize = 8 * KB;\n\t\telse if (piDrive.PartitionLength.QuadPart < 32 * GB)\n\t\t\tClusterSize = 16 * KB;\n\t\telse if (piDrive.PartitionLength.QuadPart < 2 * TB)\n\t\t\tClusterSize = 32 * KB;\n\t\telse\n\t\t\tClusterSize = 64 * KB;\n\t}\n\n\t// coverity[tainted_data]\n\tpFAT32BootSect = (FAT_BOOTSECTOR32*)calloc(BytesPerSect, 1);\n\tpFAT32FsInfo = (FAT_FSINFO*)calloc(BytesPerSect, 1);\n\tpFirstSectOfFat = (DWORD*)calloc(BytesPerSect, 1);\n\tif (!pFAT32BootSect || !pFAT32FsInfo || !pFirstSectOfFat) {\n\t\tdie(\"Failed to allocate memory\", ERROR_NOT_ENOUGH_MEMORY);\n\t}\n\n\t// fill out the boot sector and fs info\n\tpFAT32BootSect->sJmpBoot[0] = 0xEB;\n\tpFAT32BootSect->sJmpBoot[1] = 0x58; // jmp.s $+0x5a is 0xeb 0x58, not 0xeb 0x5a. Thanks Marco!\n\tpFAT32BootSect->sJmpBoot[2] = 0x90;\n\tmemcpy(pFAT32BootSect->sOEMName, \"MSWIN4.1\", 8);\n\tpFAT32BootSect->wBytsPerSec = (WORD)BytesPerSect;\n\tSectorsPerCluster = ClusterSize / BytesPerSect;\n\n\tpFAT32BootSect->bSecPerClus = (BYTE)SectorsPerCluster;\n\tpFAT32BootSect->bNumFATs = (BYTE)NumFATs;\n\tpFAT32BootSect->wRootEntCnt = 0;\n\tpFAT32BootSect->wTotSec16 = 0;\n\tpFAT32BootSect->bMedia = 0xF8;\n\tpFAT32BootSect->wFATSz16 = 0;\n\tpFAT32BootSect->wSecPerTrk = (WORD)dgDrive.SectorsPerTrack;\n\tpFAT32BootSect->wNumHeads = (WORD)dgDrive.TracksPerCylinder;\n\tpFAT32BootSect->dHiddSec = (DWORD)piDrive.HiddenSectors;\n\tTotalSectors = (DWORD)(piDrive.PartitionLength.QuadPart / dgDrive.BytesPerSector);\n\tpFAT32BootSect->dTotSec32 = TotalSectors;\n\n\tFatSize = GetFATSizeSectors(pFAT32BootSect->dTotSec32, pFAT32BootSect->wRsvdSecCnt,\n\t\tpFAT32BootSect->bSecPerClus, pFAT32BootSect->bNumFATs, BytesPerSect);\n\n\t// Update reserved sector count so that the start of data region is aligned to a MB boundary\n\tSystemAreaSize = ReservedSectCount + NumFATs * FatSize;\n\tAlignSectors = (1 * MB) / BytesPerSect;\n\tSystemAreaSize = (SystemAreaSize + AlignSectors - 1) / AlignSectors * AlignSectors;\n\tReservedSectCount = SystemAreaSize - NumFATs * FatSize;\n\n\tpFAT32BootSect->wRsvdSecCnt = (WORD)ReservedSectCount;\n\tpFAT32BootSect->dFATSz32 = FatSize;\n\tpFAT32BootSect->wExtFlags = 0;\n\tpFAT32BootSect->wFSVer = 0;\n\tpFAT32BootSect->dRootClus = 2;\n\tpFAT32BootSect->wFSInfo = 1;\n\tpFAT32BootSect->wBkBootSec = (WORD)BackupBootSect;\n\tpFAT32BootSect->bDrvNum = 0x80;\n\tpFAT32BootSect->Reserved1 = 0;\n\tpFAT32BootSect->bBootSig = 0x29;\n\n\tpFAT32BootSect->dBS_VolID = VolumeId;\n\tmemcpy(pFAT32BootSect->sVolLab, VolId, 11);\n\tmemcpy(pFAT32BootSect->sBS_FilSysType, \"FAT32   \", 8);\n\t((BYTE*)pFAT32BootSect)[510] = 0x55;\n\t((BYTE*)pFAT32BootSect)[511] = 0xaa;\n\n\t// FATGEN103.DOC says \"NOTE: Many FAT documents mistakenly say that this 0xAA55 signature occupies the \"last 2 bytes of\n\t// the boot sector\". This statement is correct if - and only if - BPB_BytsPerSec is 512. If BPB_BytsPerSec is greater than\n\t// 512, the offsets of these signature bytes do not change (although it is perfectly OK for the last two bytes at the end\n\t// of the boot sector to also contain this signature).\"\n\t//\n\t// Windows seems to only check the bytes at offsets 510 and 511. Other OSs might check the ones at the end of the sector,\n\t// so we'll put them there too.\n\tif (BytesPerSect != 512) {\n\t\t((BYTE*)pFAT32BootSect)[BytesPerSect - 2] = 0x55;\n\t\t((BYTE*)pFAT32BootSect)[BytesPerSect - 1] = 0xaa;\n\t}\n\n\t// FSInfo sect\n\tpFAT32FsInfo->dLeadSig = 0x41615252;\n\tpFAT32FsInfo->dStrucSig = 0x61417272;\n\tpFAT32FsInfo->dFree_Count = (DWORD)-1;\n\tpFAT32FsInfo->dNxt_Free = (DWORD)-1;\n\tpFAT32FsInfo->dTrailSig = 0xaa550000;\n\n\t// First FAT Sector\n\tpFirstSectOfFat[0] = 0x0ffffff8;  // Reserved cluster 1 media id in low byte\n\tpFirstSectOfFat[1] = 0x0fffffff;  // Reserved cluster 2 EOC\n\tpFirstSectOfFat[2] = 0x0fffffff;  // end of cluster chain for root dir\n\n\t// Write boot sector, fats\n\t// Sector 0 Boot Sector\n\t// Sector 1 FSInfo\n\t// Sector 2 More boot code - we write zeros here\n\t// Sector 3 unused\n\t// Sector 4 unused\n\t// Sector 5 unused\n\t// Sector 6 Backup boot sector\n\t// Sector 7 Backup FSInfo sector\n\t// Sector 8 Backup 'more boot code'\n\t// zeroed sectors up to ReservedSectCount\n\t// FAT1  ReservedSectCount to ReservedSectCount + FatSize\n\t// ...\n\t// FATn  ReservedSectCount to ReservedSectCount + FatSize\n\t// RootDir - allocated to cluster2\n\n\tUserAreaSize = TotalSectors - ReservedSectCount - (NumFATs * FatSize);\n\tassert(SectorsPerCluster > 0);\n\tClusterCount = UserAreaSize / SectorsPerCluster;\n\n\t// Sanity check for a cluster count of >2^28, since the upper 4 bits of the cluster values in\n\t// the FAT are reserved.\n\tif (ClusterCount > 0x0FFFFFFF) {\n\t\tdie(\"This drive has more than 2^28 clusters, try to specify a larger cluster size or use the default\",\n\t\t\tERROR_INVALID_CLUSTER_SIZE);\n\t}\n\n\t// Sanity check - < 64K clusters means that the volume will be misdetected as FAT16\n\tif (ClusterCount < 65536) {\n\t\tdie(\"FAT32 must have at least 65536 clusters, try to specify a smaller cluster size or use the default\",\n\t\t\tERROR_INVALID_CLUSTER_SIZE);\n\t}\n\n\t// Sanity check, make sure the fat is big enough\n\t// Convert the cluster count into a Fat sector count, and check the fat size value we calculated\n\t// earlier is OK.\n\tFatNeeded = ClusterCount * 4;\n\tFatNeeded += (BytesPerSect - 1);\n\tFatNeeded /= BytesPerSect;\n\tif (FatNeeded > FatSize) {\n\t\tdie(\"This drive is too big for large FAT32 format\", APPERR(ERROR_INVALID_VOLUME_SIZE));\n\t}\n\n\t// Now we're committed - print some info first\n\tuprintf(\"Size : %s %lu sectors\", SizeToHumanReadable(piDrive.PartitionLength.QuadPart, TRUE, FALSE), TotalSectors);\n\tuprintf(\"Cluster size %lu bytes, %lu bytes per sector\", SectorsPerCluster * BytesPerSect, BytesPerSect);\n\tuprintf(\"Volume ID is %x:%x\", VolumeId >> 16, VolumeId & 0xffff);\n\tuprintf(\"%lu Reserved sectors, %lu sectors per FAT, %lu FATs\", ReservedSectCount, FatSize, NumFATs);\n\tuprintf(\"%llu Total clusters\", ClusterCount);\n\n\t// Fix up the FSInfo sector\n\tpFAT32FsInfo->dFree_Count = (UserAreaSize / SectorsPerCluster) - 1;\n\tpFAT32FsInfo->dNxt_Free = 3; // clusters 0-1 reserved, we used cluster 2 for the root dir\n\n\tuprintf(\"%lu Free clusters\", pFAT32FsInfo->dFree_Count);\n\t// Work out the Cluster count\n\n\t// First zero out ReservedSect + FatSize * NumFats + SectorsPerCluster\n\tSystemAreaSize = ReservedSectCount + (NumFATs * FatSize) + SectorsPerCluster;\n\tuprintf(\"Clearing out %d sectors for reserved sectors, FATs and root cluster...\", SystemAreaSize);\n\n\t// Not the most effective, but easy on RAM\n\tpZeroSect = (BYTE*)calloc(BytesPerSect, BurstSize);\n\tif (!pZeroSect) {\n\t\tdie(\"Failed to allocate memory\", ERROR_NOT_ENOUGH_MEMORY);\n\t}\n\n\tfor (i = 0; i < (SystemAreaSize + BurstSize - 1); i += BurstSize) {\n\t\tif (!(Flags & FP_NO_PROGRESS))\n\t\t\tUpdateProgressWithInfo(OP_FORMAT, MSG_217, (uint64_t)i, (uint64_t)SystemAreaSize + BurstSize);\n\t\tCHECK_FOR_USER_CANCEL;\n\t\tif (write_sectors(hLogicalVolume, BytesPerSect, i, BurstSize, pZeroSect) != (BytesPerSect * BurstSize)) {\n\t\t\tdie(\"Error clearing reserved sectors\", ERROR_WRITE_FAULT);\n\t\t}\n\t}\n\n\tuprintf (\"Initializing reserved sectors and FATs...\");\n\t// Now we should write the boot sector and fsinfo twice, once at 0 and once at the backup boot sect position\n\tfor (i = 0; i < 2; i++) {\n\t\tint SectorStart = (i == 0) ? 0 : BackupBootSect;\n\t\twrite_sectors(hLogicalVolume, BytesPerSect, SectorStart, 1, pFAT32BootSect);\n\t\twrite_sectors(hLogicalVolume, BytesPerSect, SectorStart + 1, 1, pFAT32FsInfo);\n\t}\n\n\t// Write the first fat sector in the right places\n\tfor (i = 0; i < NumFATs; i++) {\n\t\tint SectorStart = ReservedSectCount + (i * FatSize);\n\t\tuprintf(\"FAT #%d sector at address: %d\", i, SectorStart);\n\t\twrite_sectors(hLogicalVolume, BytesPerSect, SectorStart, 1, pFirstSectOfFat);\n\t}\n\n\tif (!(Flags & FP_NO_BOOT)) {\n\t\t// Must do it here, as have issues when trying to write the PBR after a remount\n\t\tif (!(Flags & FP_NO_PROGRESS))\n\t\t\tPrintInfoDebug(0, MSG_229);\n\t\tif (!WritePBR(hLogicalVolume)) {\n\t\t\t// Non fatal error, but the drive probably won't boot\n\t\t\tuprintf(\"Could not write partition boot record - drive may not boot...\");\n\t\t}\n\t}\n\n\t// Set the FAT32 volume label\n\tif (!(Flags & FP_NO_PROGRESS)) {\n\t\tPrintInfo(0, MSG_221, lmprintf(MSG_307));\n\t\tuprintf(\"Setting label...\");\n\t}\n\t// Handle must be closed for SetVolumeLabel to work\n\tsafe_closehandle(hLogicalVolume);\n\tVolumeName = write_as_esp ?\n\t\tAltGetLogicalName(DriveIndex, PartitionOffset, TRUE, TRUE) :\n\t\tGetLogicalName(DriveIndex, PartitionOffset, TRUE, TRUE);\n\tif ((VolumeName == NULL) || (!SetVolumeLabelA(VolumeName, Label))) {\n\t\tuprintf(\"Could not set label: %s\", WindowsErrorString());\n\t\t// Non fatal error\n\t}\n\n\tuprintf(\"Format completed.\");\n\tr = TRUE;\n\nout:\n\tsafe_free(VolumeName);\n\tsafe_closehandle(hLogicalVolume);\n\tsafe_free(pFAT32BootSect);\n\tsafe_free(pFAT32FsInfo);\n\tsafe_free(pFirstSectOfFat);\n\tsafe_free(pZeroSect);\n\treturn r;\n}\n"
  },
  {
    "path": "src/getopt/.editorconfig",
    "content": "[*]\ntab_width = 8\n"
  },
  {
    "path": "src/getopt/getopt.c",
    "content": "/* Getopt for GNU.\n   NOTE: getopt is now part of the C library, so if you don't know what\n   \"Keep this file name-space clean\" means, talk to drepper@gnu.org\n   before changing it!\n   Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001\n   \tFree Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, write to the Free\n   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n   02111-1307 USA.  */\n\f\n/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.\n   Ditto for AIX 3.2 and <stdlib.h>.  */\n#ifndef _NO_PROTO\n# define _NO_PROTO\n#endif\n\n#ifdef HAVE_CONFIG_H\n# include <config.h>\n#endif\n\n#if !defined __STDC__ || !__STDC__\n/* This is a separate conditional since some stdc systems\n   reject `defined (const)'.  */\n# ifndef const\n#  define const\n# endif\n#endif\n\n#include <stdio.h>\n\n/* Comment out all this code if we are using the GNU C Library, and are not\n   actually compiling the library itself.  This code is part of the GNU C\n   Library, but also included in many other GNU distributions.  Compiling\n   and linking in this code is a waste when using the GNU C library\n   (especially if it is a shared library).  Rather than having every GNU\n   program understand `configure --with-gnu-libc' and omit the object files,\n   it is simpler to just do this in the source for each such file.  */\n\n#define GETOPT_INTERFACE_VERSION 2\n#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2\n# include <gnu-versions.h>\n# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION\n#  define ELIDE_CODE\n# endif\n#endif\n\n#ifndef ELIDE_CODE\n\n\n/* This needs to come after some library #include\n   to get __GNU_LIBRARY__ defined.  */\n#ifdef\t__GNU_LIBRARY__\n/* Don't include stdlib.h for non-GNU C libraries because some of them\n   contain conflicting prototypes for getopt.  */\n# include <stdlib.h>\n# include <unistd.h>\n#endif\t/* GNU C library.  */\n\n#ifdef VMS\n# include <unixlib.h>\n# if HAVE_STRING_H - 0\n#  include <string.h>\n# endif\n#endif\n\n#ifndef _\n/* This is for other GNU distributions with internationalized messages.  */\n# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC\n#  include <libintl.h>\n#  ifndef _\n#   define _(msgid)\tgettext (msgid)\n#  endif\n# else\n#  define _(msgid)\t(msgid)\n# endif\n#endif\n\n/* This version of `getopt' appears to the caller like standard Unix `getopt'\n   but it behaves differently for the user, since it allows the user\n   to intersperse the options with the other arguments.\n\n   As `getopt' works, it permutes the elements of ARGV so that,\n   when it is done, all the options precede everything else.  Thus\n   all application programs are extended to handle flexible argument order.\n\n   Setting the environment variable POSIXLY_CORRECT disables permutation.\n   Then the behavior is completely standard.\n\n   GNU application programs can use a third alternative mode in which\n   they can distinguish the relative order of options and other arguments.  */\n\n#include \"getopt.h\"\n\n/* For communication from `getopt' to the caller.\n   When `getopt' finds an option that takes an argument,\n   the argument value is returned here.\n   Also, when `ordering' is RETURN_IN_ORDER,\n   each non-option ARGV-element is returned here.  */\n\nchar *optarg;\n\n/* Index in ARGV of the next element to be scanned.\n   This is used for communication to and from the caller\n   and for communication between successive calls to `getopt'.\n\n   On entry to `getopt', zero means this is the first call; initialize.\n\n   When `getopt' returns -1, this is the index of the first of the\n   non-option elements that the caller should itself scan.\n\n   Otherwise, `optind' communicates from one call to the next\n   how much of ARGV has been scanned so far.  */\n\n/* 1003.2 says this must be 1 before any call.  */\nint optind = 1;\n\n/* Formerly, initialization of getopt depended on optind==0, which\n   causes problems with re-calling getopt as programs generally don't\n   know that. */\n\nint __getopt_initialized;\n\n/* The next char to be scanned in the option-element\n   in which the last option character we returned was found.\n   This allows us to pick up the scan where we left off.\n\n   If this is zero, or a null string, it means resume the scan\n   by advancing to the next ARGV-element.  */\n\nstatic char *nextchar;\n\n/* Callers store zero here to inhibit the error message\n   for unrecognized options.  */\n\nint opterr = 1;\n\n/* Set to an option character which was unrecognized.\n   This must be initialized on some systems to avoid linking in the\n   system's own getopt implementation.  */\n\nint optopt = '?';\n\n/* Describe how to deal with options that follow non-option ARGV-elements.\n\n   If the caller did not specify anything,\n   the default is REQUIRE_ORDER if the environment variable\n   POSIXLY_CORRECT is defined, PERMUTE otherwise.\n\n   REQUIRE_ORDER means don't recognize them as options;\n   stop option processing when the first non-option is seen.\n   This is what Unix does.\n   This mode of operation is selected by either setting the environment\n   variable POSIXLY_CORRECT, or using `+' as the first character\n   of the list of option characters.\n\n   PERMUTE is the default.  We permute the contents of ARGV as we scan,\n   so that eventually all the non-options are at the end.  This allows options\n   to be given in any order, even with programs that were not written to\n   expect this.\n\n   RETURN_IN_ORDER is an option available to programs that were written\n   to expect options and other ARGV-elements in any order and that care about\n   the ordering of the two.  We describe each non-option ARGV-element\n   as if it were the argument of an option with character code 1.\n   Using `-' as the first character of the list of option characters\n   selects this mode of operation.\n\n   The special argument `--' forces an end of option-scanning regardless\n   of the value of `ordering'.  In the case of RETURN_IN_ORDER, only\n   `--' can cause `getopt' to return -1 with `optind' != ARGC.  */\n\nstatic enum\n{\n  REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER\n} ordering;\n\n/* Value of POSIXLY_CORRECT environment variable.  */\nstatic char *posixly_correct;\n\f\n#ifdef\t__GNU_LIBRARY__\n/* We want to avoid inclusion of string.h with non-GNU libraries\n   because there are many ways it can cause trouble.\n   On some systems, it contains special magic macros that don't work\n   in GCC.  */\n# include <string.h>\n# define my_index\tstrchr\n#else\n\n# if HAVE_STRING_H\n#  include <string.h>\n# else\n#  include <strings.h>\n# endif\n\n/* Avoid depending on library functions or files\n   whose names are inconsistent.  */\n\n#ifndef getenv\n#ifdef _MSC_VER\n// MSVC will complain if you don't use the stdlib defined getenv\n#include <stdlib.h>\n#else\nextern char *getenv ();\n#endif\n#endif\n\nstatic char *\nmy_index (str, chr)\n     const char *str;\n     int chr;\n{\n  while (*str)\n    {\n      if (*str == chr)\n\treturn (char *) str;\n      str++;\n    }\n  return 0;\n}\n\n/* If using GCC, we can safely declare strlen this way.\n   If not using GCC, it is ok not to declare it.  */\n#ifdef __GNUC__\n/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.\n   That was relevant to code that was here before.  */\n# if (!defined __STDC__ || !__STDC__) && !defined strlen\n/* gcc with -traditional declares the built-in strlen to return int,\n   and has done so at least since version 2.4.5. -- rms.  */\nextern int strlen (const char *);\n# endif /* not __STDC__ */\n#endif /* __GNUC__ */\n\n#endif /* not __GNU_LIBRARY__ */\n\f\n/* Handle permutation of arguments.  */\n\n/* Describe the part of ARGV that contains non-options that have\n   been skipped.  `first_nonopt' is the index in ARGV of the first of them;\n   `last_nonopt' is the index after the last of them.  */\n\nstatic int first_nonopt;\nstatic int last_nonopt;\n\n#ifdef _LIBC\n/* Stored original parameters.\n   XXX This is no good solution.  We should rather copy the args so\n   that we can compare them later.  But we must not use malloc(3).  */\nextern int __libc_argc;\nextern char **__libc_argv;\n\n/* Bash 2.0 gives us an environment variable containing flags\n   indicating ARGV elements that should not be considered arguments.  */\n\n# ifdef USE_NONOPTION_FLAGS\n/* Defined in getopt_init.c  */\nextern char *__getopt_nonoption_flags;\n\nstatic int nonoption_flags_max_len;\nstatic int nonoption_flags_len;\n# endif\n\n# ifdef USE_NONOPTION_FLAGS\n#  define SWAP_FLAGS(ch1, ch2) \\\n  if (nonoption_flags_len > 0)\t\t\t\t\t\t      \\\n    {\t\t\t\t\t\t\t\t\t      \\\n      char __tmp = __getopt_nonoption_flags[ch1];\t\t\t      \\\n      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];\t      \\\n      __getopt_nonoption_flags[ch2] = __tmp;\t\t\t\t      \\\n    }\n# else\n#  define SWAP_FLAGS(ch1, ch2)\n# endif\n#else\t/* !_LIBC */\n# define SWAP_FLAGS(ch1, ch2)\n#endif\t/* _LIBC */\n\n/* Exchange two adjacent subsequences of ARGV.\n   One subsequence is elements [first_nonopt,last_nonopt)\n   which contains all the non-options that have been skipped so far.\n   The other is elements [last_nonopt,optind), which contains all\n   the options processed since those non-options were skipped.\n\n   `first_nonopt' and `last_nonopt' are relocated so that they describe\n   the new indices of the non-options in ARGV after they are moved.  */\n\n#if defined __STDC__ && __STDC__\nstatic void exchange (char **);\n#endif\n\nstatic void\nexchange (argv)\n     char **argv;\n{\n  int bottom = first_nonopt;\n  int middle = last_nonopt;\n  int top = optind;\n  char *tem;\n\n  /* Exchange the shorter segment with the far end of the longer segment.\n     That puts the shorter segment into the right place.\n     It leaves the longer segment in the right place overall,\n     but it consists of two parts that need to be swapped next.  */\n\n#if defined _LIBC && defined USE_NONOPTION_FLAGS\n  /* First make sure the handling of the `__getopt_nonoption_flags'\n     string can work normally.  Our top argument must be in the range\n     of the string.  */\n  if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)\n    {\n      /* We must extend the array.  The user plays games with us and\n\t presents new arguments.  */\n      char *new_str = malloc (top + 1);\n      if (new_str == NULL)\n\tnonoption_flags_len = nonoption_flags_max_len = 0;\n      else\n\t{\n\t  memset (__mempcpy (new_str, __getopt_nonoption_flags,\n\t\t\t     nonoption_flags_max_len),\n\t\t  '\\0', top + 1 - nonoption_flags_max_len);\n\t  nonoption_flags_max_len = top + 1;\n\t  __getopt_nonoption_flags = new_str;\n\t}\n    }\n#endif\n\n  while (top > middle && middle > bottom)\n    {\n      if (top - middle > middle - bottom)\n\t{\n\t  /* Bottom segment is the short one.  */\n\t  int len = middle - bottom;\n\t  register int i;\n\n\t  /* Swap it with the top part of the top segment.  */\n\t  for (i = 0; i < len; i++)\n\t    {\n\t      tem = argv[bottom + i];\n\t      argv[bottom + i] = argv[top - (middle - bottom) + i];\n\t      argv[top - (middle - bottom) + i] = tem;\n\t      SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);\n\t    }\n\t  /* Exclude the moved bottom segment from further swapping.  */\n\t  top -= len;\n\t}\n      else\n\t{\n\t  /* Top segment is the short one.  */\n\t  int len = top - middle;\n\t  register int i;\n\n\t  /* Swap it with the bottom part of the bottom segment.  */\n\t  for (i = 0; i < len; i++)\n\t    {\n\t      tem = argv[bottom + i];\n\t      argv[bottom + i] = argv[middle + i];\n\t      argv[middle + i] = tem;\n\t      SWAP_FLAGS (bottom + i, middle + i);\n\t    }\n\t  /* Exclude the moved top segment from further swapping.  */\n\t  bottom += len;\n\t}\n    }\n\n  /* Update records for the slots the non-options now occupy.  */\n\n  first_nonopt += (optind - last_nonopt);\n  last_nonopt = optind;\n}\n\n/* Initialize the internal data when the first call is made.  */\n\n#if defined __STDC__ && __STDC__\nstatic const char *_getopt_initialize (int, char *const *, const char *);\n#endif\nstatic const char *\n_getopt_initialize (argc, argv, optstring)\n     int argc;\n     char *const *argv;\n     const char *optstring;\n{\n  size_t posixly_correct_size = 0;\n  char posixly_correct_buffer[16];\n  /* Start processing options with ARGV-element 1 (since ARGV-element 0\n     is the program name); the sequence of previously skipped\n     non-option ARGV-elements is empty.  */\n\n  first_nonopt = last_nonopt = optind;\n\n  nextchar = NULL;\n\n  if ((getenv_s(&posixly_correct_size, posixly_correct_buffer, sizeof(posixly_correct_buffer),\n      \"POSIXLY_CORRECT\") == 0) && (posixly_correct_size != 0))\n    posixly_correct = _strdup(posixly_correct_buffer);\n\n  /* Determine how to handle the ordering of options and nonoptions.  */\n\n  if (optstring[0] == '-')\n    {\n      ordering = RETURN_IN_ORDER;\n      ++optstring;\n    }\n  else if (optstring[0] == '+')\n    {\n      ordering = REQUIRE_ORDER;\n      ++optstring;\n    }\n  else if (posixly_correct != NULL)\n    ordering = REQUIRE_ORDER;\n  else\n    ordering = PERMUTE;\n\n#if defined _LIBC && defined USE_NONOPTION_FLAGS\n  if (posixly_correct == NULL\n      && argc == __libc_argc && argv == __libc_argv)\n    {\n      if (nonoption_flags_max_len == 0)\n\t{\n\t  if (__getopt_nonoption_flags == NULL\n\t      || __getopt_nonoption_flags[0] == '\\0')\n\t    nonoption_flags_max_len = -1;\n\t  else\n\t    {\n\t      const char *orig_str = __getopt_nonoption_flags;\n\t      int len = nonoption_flags_max_len = strlen (orig_str);\n\t      if (nonoption_flags_max_len < argc)\n\t\tnonoption_flags_max_len = argc;\n\t      __getopt_nonoption_flags =\n\t\t(char *) malloc (nonoption_flags_max_len);\n\t      if (__getopt_nonoption_flags == NULL)\n\t\tnonoption_flags_max_len = -1;\n\t      else\n\t\tmemset (__mempcpy (__getopt_nonoption_flags, orig_str, len),\n\t\t\t'\\0', nonoption_flags_max_len - len);\n\t    }\n\t}\n      nonoption_flags_len = nonoption_flags_max_len;\n    }\n  else\n    nonoption_flags_len = 0;\n#endif\n\n  return optstring;\n}\n\f\n/* Scan elements of ARGV (whose length is ARGC) for option characters\n   given in OPTSTRING.\n\n   If an element of ARGV starts with '-', and is not exactly \"-\" or \"--\",\n   then it is an option element.  The characters of this element\n   (aside from the initial '-') are option characters.  If `getopt'\n   is called repeatedly, it returns successively each of the option characters\n   from each of the option elements.\n\n   If `getopt' finds another option character, it returns that character,\n   updating `optind' and `nextchar' so that the next call to `getopt' can\n   resume the scan with the following option character or ARGV-element.\n\n   If there are no more option characters, `getopt' returns -1.\n   Then `optind' is the index in ARGV of the first ARGV-element\n   that is not an option.  (The ARGV-elements have been permuted\n   so that those that are not options now come last.)\n\n   OPTSTRING is a string containing the legitimate option characters.\n   If an option character is seen that is not listed in OPTSTRING,\n   return '?' after printing an error message.  If you set `opterr' to\n   zero, the error message is suppressed but we still return '?'.\n\n   If a char in OPTSTRING is followed by a colon, that means it wants an arg,\n   so the following text in the same ARGV-element, or the text of the following\n   ARGV-element, is returned in `optarg'.  Two colons mean an option that\n   wants an optional arg; if there is text in the current ARGV-element,\n   it is returned in `optarg', otherwise `optarg' is set to zero.\n\n   If OPTSTRING starts with `-' or `+', it requests different methods of\n   handling the non-option ARGV-elements.\n   See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.\n\n   Long-named options begin with `--' instead of `-'.\n   Their names may be abbreviated as long as the abbreviation is unique\n   or is an exact match for some defined option.  If they have an\n   argument, it follows the option name in the same ARGV-element, separated\n   from the option name by a `=', or else the in next ARGV-element.\n   When `getopt' finds a long-named option, it returns 0 if that option's\n   `flag' field is nonzero, the value of the option's `val' field\n   if the `flag' field is zero.\n\n   The elements of ARGV aren't really const, because we permute them.\n   But we pretend they're const in the prototype to be compatible\n   with other systems.\n\n   LONGOPTS is a vector of `struct option' terminated by an\n   element containing a name which is zero.\n\n   LONGIND returns the index in LONGOPT of the long-named option found.\n   It is only valid when a long-named option has been found by the most\n   recent call.\n\n   If LONG_ONLY is nonzero, '-' as well as '--' can introduce\n   long-named options.  */\n\nint\n_getopt_internal (argc, argv, optstring, longopts, longind, long_only)\n     int argc;\n     char *const *argv;\n     const char *optstring;\n     const struct option *longopts;\n     int *longind;\n     int long_only;\n{\n  int print_errors = opterr;\n  if (optstring[0] == ':')\n    print_errors = 0;\n\n  if (argc < 1)\n    return -1;\n\n  optarg = NULL;\n\n  if (optind == 0 || !__getopt_initialized)\n    {\n      if (optind == 0)\n\toptind = 1;\t/* Don't scan ARGV[0], the program name.  */\n      optstring = _getopt_initialize (argc, argv, optstring);\n      __getopt_initialized = 1;\n    }\n\n  /* Test whether ARGV[optind] points to a non-option argument.\n     Either it does not have option syntax, or there is an environment flag\n     from the shell indicating it is not an option.  The later information\n     is only used when the used in the GNU libc.  */\n#if defined _LIBC && defined USE_NONOPTION_FLAGS\n# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\\0'\t      \\\n\t\t      || (optind < nonoption_flags_len\t\t\t      \\\n\t\t\t  && __getopt_nonoption_flags[optind] == '1'))\n#else\n# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\\0')\n#endif\n\n  if (nextchar == NULL || *nextchar == '\\0')\n    {\n      /* Advance to the next ARGV-element.  */\n\n      /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been\n\t moved back by the user (who may also have changed the arguments).  */\n      if (last_nonopt > optind)\n\tlast_nonopt = optind;\n      if (first_nonopt > optind)\n\tfirst_nonopt = optind;\n\n      if (ordering == PERMUTE)\n\t{\n\t  /* If we have just processed some options following some non-options,\n\t     exchange them so that the options come first.  */\n\n\t  if (first_nonopt != last_nonopt && last_nonopt != optind)\n\t    exchange ((char **) argv);\n\t  else if (last_nonopt != optind)\n\t    first_nonopt = optind;\n\n\t  /* Skip any additional non-options\n\t     and extend the range of non-options previously skipped.  */\n\n\t  while (optind < argc && NONOPTION_P)\n\t    optind++;\n\t  last_nonopt = optind;\n\t}\n\n      /* The special ARGV-element `--' means premature end of options.\n\t Skip it like a null option,\n\t then exchange with previous non-options as if it were an option,\n\t then skip everything else like a non-option.  */\n\n      if (optind != argc && !strcmp (argv[optind], \"--\"))\n\t{\n\t  optind++;\n\n\t  if (first_nonopt != last_nonopt && last_nonopt != optind)\n\t    exchange ((char **) argv);\n\t  else if (first_nonopt == last_nonopt)\n\t    first_nonopt = optind;\n\t  last_nonopt = argc;\n\n\t  optind = argc;\n\t}\n\n      /* If we have done all the ARGV-elements, stop the scan\n\t and back over any non-options that we skipped and permuted.  */\n\n      if (optind == argc)\n\t{\n\t  /* Set the next-arg-index to point at the non-options\n\t     that we previously skipped, so the caller will digest them.  */\n\t  if (first_nonopt != last_nonopt)\n\t    optind = first_nonopt;\n\t  return -1;\n\t}\n\n      /* If we have come to a non-option and did not permute it,\n\t either stop the scan or describe it to the caller and pass it by.  */\n\n      if (NONOPTION_P)\n\t{\n\t  if (ordering == REQUIRE_ORDER)\n\t    return -1;\n\t  optarg = argv[optind++];\n\t  return 1;\n\t}\n\n      /* We have found another option-ARGV-element.\n\t Skip the initial punctuation.  */\n\n      nextchar = (argv[optind] + 1\n\t\t  + (longopts != NULL && argv[optind][1] == '-'));\n    }\n\n  /* Decode the current option-ARGV-element.  */\n\n  /* Check whether the ARGV-element is a long option.\n\n     If long_only and the ARGV-element has the form \"-f\", where f is\n     a valid short option, don't consider it an abbreviated form of\n     a long option that starts with f.  Otherwise there would be no\n     way to give the -f short option.\n\n     On the other hand, if there's a long option \"fubar\" and\n     the ARGV-element is \"-fu\", do consider that an abbreviation of\n     the long option, just like \"--fu\", and not \"-f\" with arg \"u\".\n\n     This distinction seems to be the most useful approach.  */\n\n  if (longopts != NULL\n      && (argv[optind][1] == '-'\n\t  || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))\n    {\n      char *nameend;\n      const struct option *p;\n      const struct option *pfound = NULL;\n      int exact = 0;\n      int ambig = 0;\n      int indfound = -1;\n      int option_index;\n\n      for (nameend = nextchar; *nameend && *nameend != '='; nameend++)\n\t/* Do nothing.  */ ;\n\n      /* Test all long options for either exact match\n\t or abbreviated matches.  */\n      for (p = longopts, option_index = 0; p->name; p++, option_index++)\n\tif (!strncmp (p->name, nextchar, nameend - nextchar))\n\t  {\n\t    if ((unsigned int) (nameend - nextchar)\n\t\t== (unsigned int) strlen (p->name))\n\t      {\n\t\t/* Exact match found.  */\n\t\tpfound = p;\n\t\tindfound = option_index;\n\t\texact = 1;\n\t\tbreak;\n\t      }\n\t    else if (pfound == NULL)\n\t      {\n\t\t/* First nonexact match found.  */\n\t\tpfound = p;\n\t\tindfound = option_index;\n\t      }\n\t    else if (long_only\n\t\t     || pfound->has_arg != p->has_arg\n\t\t     || pfound->flag != p->flag\n\t\t     || pfound->val != p->val)\n\t      /* Second or later nonexact match found.  */\n\t      ambig = 1;\n\t  }\n\n      if (ambig && !exact)\n\t{\n\t  if (print_errors)\n\t    fprintf (stderr, _(\"%s: option `%s' is ambiguous\\n\"),\n\t\t     argv[0], argv[optind]);\n\t  nextchar += strlen (nextchar);\n\t  optind++;\n\t  optopt = 0;\n\t  return '?';\n\t}\n\n      if (pfound != NULL)\n\t{\n\t  option_index = indfound;\n\t  optind++;\n\t  if (*nameend)\n\t    {\n\t      /* Don't test has_arg with >, because some C compilers don't\n\t\t allow it to be used on enums.  */\n\t      if (pfound->has_arg)\n\t\toptarg = nameend + 1;\n\t      else\n\t\t{\n\t\t  if (print_errors)\n\t\t    {\n\t\t      if (argv[optind - 1][1] == '-')\n\t\t\t/* --option */\n\t\t\tfprintf (stderr,\n\t\t\t\t _(\"%s: option `--%s' doesn't allow an argument\\n\"),\n\t\t\t\t argv[0], pfound->name);\n\t\t      else\n\t\t\t/* +option or -option */\n\t\t\tfprintf (stderr,\n\t\t\t\t _(\"%s: option `%c%s' doesn't allow an argument\\n\"),\n\t\t\t\t argv[0], argv[optind - 1][0], pfound->name);\n\t\t    }\n\n\t\t  nextchar += strlen (nextchar);\n\n\t\t  optopt = pfound->val;\n\t\t  return '?';\n\t\t}\n\t    }\n\t  else if (pfound->has_arg == 1)\n\t    {\n\t      if (optind < argc)\n\t\toptarg = argv[optind++];\n\t      else\n\t\t{\n\t\t  if (print_errors)\n\t\t    fprintf (stderr,\n\t\t\t   _(\"%s: option `%s' requires an argument\\n\"),\n\t\t\t   argv[0], argv[optind - 1]);\n\t\t  nextchar += strlen (nextchar);\n\t\t  optopt = pfound->val;\n\t\t  return optstring[0] == ':' ? ':' : '?';\n\t\t}\n\t    }\n\t  nextchar += strlen (nextchar);\n\t  if (longind != NULL)\n\t    *longind = option_index;\n\t  if (pfound->flag)\n\t    {\n\t      *(pfound->flag) = pfound->val;\n\t      return 0;\n\t    }\n\t  return pfound->val;\n\t}\n\n      /* Can't find it as a long option.  If this is not getopt_long_only,\n\t or the option starts with '--' or is not a valid short\n\t option, then it's an error.\n\t Otherwise interpret it as a short option.  */\n      if (!long_only || argv[optind][1] == '-'\n\t  || my_index (optstring, *nextchar) == NULL)\n\t{\n\t  if (print_errors)\n\t    {\n\t      if (argv[optind][1] == '-')\n\t\t/* --option */\n\t\tfprintf (stderr, _(\"%s: unrecognized option `--%s'\\n\"),\n\t\t\t argv[0], nextchar);\n\t      else\n\t\t/* +option or -option */\n\t\tfprintf (stderr, _(\"%s: unrecognized option `%c%s'\\n\"),\n\t\t\t argv[0], argv[optind][0], nextchar);\n\t    }\n\t  nextchar = (char *) \"\";\n\t  optind++;\n\t  optopt = 0;\n\t  return '?';\n\t}\n    }\n\n  /* Look at and handle the next short option-character.  */\n\n  {\n    char c = *nextchar++;\n    char *temp = my_index (optstring, c);\n\n    /* Increment `optind' when we start to process its last character.  */\n    if (*nextchar == '\\0')\n      ++optind;\n\n    if (temp == NULL || c == ':')\n      {\n\tif (print_errors)\n\t  {\n\t    if (posixly_correct)\n\t      /* 1003.2 specifies the format of this message.  */\n\t      fprintf (stderr, _(\"%s: illegal option -- %c\\n\"),\n\t\t       argv[0], c);\n\t    else\n\t      fprintf (stderr, _(\"%s: invalid option -- %c\\n\"),\n\t\t       argv[0], c);\n\t  }\n\toptopt = c;\n\treturn '?';\n      }\n    /* Convenience. Treat POSIX -W foo same as long option --foo */\n    if (temp[0] == 'W' && temp[1] == ';')\n      {\n\tchar *nameend;\n\tconst struct option *p;\n\tconst struct option *pfound = NULL;\n\tint exact = 0;\n\tint ambig = 0;\n\tint indfound = 0;\n\tint option_index;\n\n\t/* This is an option that requires an argument.  */\n\tif (*nextchar != '\\0')\n\t  {\n\t    optarg = nextchar;\n\t    /* If we end this ARGV-element by taking the rest as an arg,\n\t       we must advance to the next element now.  */\n\t    optind++;\n\t  }\n\telse if (optind == argc)\n\t  {\n\t    if (print_errors)\n\t      {\n\t\t/* 1003.2 specifies the format of this message.  */\n\t\tfprintf (stderr, _(\"%s: option requires an argument -- %c\\n\"),\n\t\t\t argv[0], c);\n\t      }\n\t    optopt = c;\n\t    if (optstring[0] == ':')\n\t      c = ':';\n\t    else\n\t      c = '?';\n\t    return c;\n\t  }\n\telse\n\t  /* We already incremented `optind' once;\n\t     increment it again when taking next ARGV-elt as argument.  */\n\t  optarg = argv[optind++];\n\n\t/* optarg is now the argument, see if it's in the\n\t   table of longopts.  */\n\n\tfor (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)\n\t  /* Do nothing.  */ ;\n\n\t/* Test all long options for either exact match\n\t   or abbreviated matches.  */\n\tfor (p = longopts, option_index = 0; p != NULL && p->name; p++, option_index++)\n\t  if (!strncmp (p->name, nextchar, nameend - nextchar))\n\t    {\n\t      if ((unsigned int) (nameend - nextchar) == strlen (p->name))\n\t\t{\n\t\t  /* Exact match found.  */\n\t\t  pfound = p;\n\t\t  indfound = option_index;\n\t\t  exact = 1;\n\t\t  break;\n\t\t}\n\t      else if (pfound == NULL)\n\t\t{\n\t\t  /* First nonexact match found.  */\n\t\t  pfound = p;\n\t\t  indfound = option_index;\n\t\t}\n\t      else\n\t\t/* Second or later nonexact match found.  */\n\t\tambig = 1;\n\t    }\n\tif (ambig && !exact)\n\t  {\n\t    if (print_errors)\n\t      fprintf (stderr, _(\"%s: option `-W %s' is ambiguous\\n\"),\n\t\t       argv[0], argv[optind]);\n\t    nextchar += strlen (nextchar);\n\t    optind++;\n\t    return '?';\n\t  }\n\tif (pfound != NULL)\n\t  {\n\t    option_index = indfound;\n\t    if (*nameend)\n\t      {\n\t\t/* Don't test has_arg with >, because some C compilers don't\n\t\t   allow it to be used on enums.  */\n\t\tif (pfound->has_arg)\n\t\t  optarg = nameend + 1;\n\t\telse\n\t\t  {\n\t\t    if (print_errors)\n\t\t      fprintf (stderr, _(\"\\\n%s: option `-W %s' doesn't allow an argument\\n\"),\n\t\t\t       argv[0], pfound->name);\n\n\t\t    nextchar += strlen (nextchar);\n\t\t    return '?';\n\t\t  }\n\t      }\n\t    else if (pfound->has_arg == 1)\n\t      {\n\t\tif (optind < argc)\n\t\t  optarg = argv[optind++];\n\t\telse\n\t\t  {\n\t\t    if (print_errors)\n\t\t      fprintf (stderr,\n\t\t\t       _(\"%s: option `%s' requires an argument\\n\"),\n\t\t\t       argv[0], argv[optind - 1]);\n\t\t    nextchar += strlen (nextchar);\n\t\t    return optstring[0] == ':' ? ':' : '?';\n\t\t  }\n\t      }\n\t    nextchar += strlen (nextchar);\n\t    if (longind != NULL)\n\t      *longind = option_index;\n\t    if (pfound->flag)\n\t      {\n\t\t*(pfound->flag) = pfound->val;\n\t\treturn 0;\n\t      }\n\t    return pfound->val;\n\t  }\n\t  nextchar = NULL;\n\t  return 'W';\t/* Let the application handle it.   */\n      }\n    if (temp[1] == ':')\n      {\n\tif (temp[2] == ':')\n\t  {\n\t    /* This is an option that accepts an argument optionally.  */\n\t    if (*nextchar != '\\0')\n\t      {\n\t\toptarg = nextchar;\n\t\toptind++;\n\t      }\n\t    else\n\t      optarg = NULL;\n\t    nextchar = NULL;\n\t  }\n\telse\n\t  {\n\t    /* This is an option that requires an argument.  */\n\t    if (*nextchar != '\\0')\n\t      {\n\t\toptarg = nextchar;\n\t\t/* If we end this ARGV-element by taking the rest as an arg,\n\t\t   we must advance to the next element now.  */\n\t\toptind++;\n\t      }\n\t    else if (optind == argc)\n\t      {\n\t\tif (print_errors)\n\t\t  {\n\t\t    /* 1003.2 specifies the format of this message.  */\n\t\t    fprintf (stderr,\n\t\t\t     _(\"%s: option requires an argument -- %c\\n\"),\n\t\t\t     argv[0], c);\n\t\t  }\n\t\toptopt = c;\n\t\tif (optstring[0] == ':')\n\t\t  c = ':';\n\t\telse\n\t\t  c = '?';\n\t      }\n\t    else\n\t      /* We already incremented `optind' once;\n\t\t increment it again when taking next ARGV-elt as argument.  */\n\t      optarg = argv[optind++];\n\t    nextchar = NULL;\n\t  }\n      }\n    return c;\n  }\n}\n\nint\ngetopt (argc, argv, optstring)\n     int argc;\n     char *const *argv;\n     const char *optstring;\n{\n  return _getopt_internal (argc, argv, optstring,\n\t\t\t   (const struct option *) 0,\n\t\t\t   (int *) 0,\n\t\t\t   0);\n}\n\n#endif\t/* Not ELIDE_CODE.  */\n\f\n#ifdef TEST\n\n/* Compile with -DTEST to make an executable for use in testing\n   the above definition of `getopt'.  */\n\nint\nmain (argc, argv)\n     int argc;\n     char **argv;\n{\n  int c;\n  int digit_optind = 0;\n\n  while (1)\n    {\n      int this_option_optind = optind ? optind : 1;\n\n      c = getopt (argc, argv, \"abc:d:0123456789\");\n      if (c == -1)\n\tbreak;\n\n      switch (c)\n\t{\n\tcase '0':\n\tcase '1':\n\tcase '2':\n\tcase '3':\n\tcase '4':\n\tcase '5':\n\tcase '6':\n\tcase '7':\n\tcase '8':\n\tcase '9':\n\t  if (digit_optind != 0 && digit_optind != this_option_optind)\n\t    printf (\"digits occur in two different argv-elements.\\n\");\n\t  digit_optind = this_option_optind;\n\t  printf (\"option %c\\n\", c);\n\t  break;\n\n\tcase 'a':\n\t  printf (\"option a\\n\");\n\t  break;\n\n\tcase 'b':\n\t  printf (\"option b\\n\");\n\t  break;\n\n\tcase 'c':\n\t  printf (\"option c with value `%s'\\n\", optarg);\n\t  break;\n\n\tcase '?':\n\t  break;\n\n\tdefault:\n\t  printf (\"?? getopt returned character code 0%o ??\\n\", c);\n\t}\n    }\n\n  if (optind < argc)\n    {\n      printf (\"non-option ARGV-elements: \");\n      while (optind < argc)\n\tprintf (\"%s \", argv[optind++]);\n      printf (\"\\n\");\n    }\n\n  exit (0);\n}\n\n#endif /* TEST */\n"
  },
  {
    "path": "src/getopt/getopt.h",
    "content": "/* Declarations for getopt.\n   Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, write to the Free\n   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n   02111-1307 USA.  */\n\n#ifndef _GETOPT_H\n\n#ifndef __need_getopt\n# define _GETOPT_H 1\n#endif\n\n/* If __GNU_LIBRARY__ is not already defined, either we are being used\n   standalone, or this is the first header included in the source file.\n   If we are being used with glibc, we need to include <features.h>, but\n   that does not exist if we are standalone.  So: if __GNU_LIBRARY__ is\n   not defined, include <ctype.h>, which will pull in <features.h> for us\n   if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it\n   doesn't flood the namespace with stuff the way some other headers do.)  */\n#if !defined __GNU_LIBRARY__\n# include <ctype.h>\n#endif\n\n#ifdef\t__cplusplus\nextern \"C\" {\n#endif\n\n/* For communication from `getopt' to the caller.\n   When `getopt' finds an option that takes an argument,\n   the argument value is returned here.\n   Also, when `ordering' is RETURN_IN_ORDER,\n   each non-option ARGV-element is returned here.  */\n\nextern char *optarg;\n\n/* Index in ARGV of the next element to be scanned.\n   This is used for communication to and from the caller\n   and for communication between successive calls to `getopt'.\n\n   On entry to `getopt', zero means this is the first call; initialize.\n\n   When `getopt' returns -1, this is the index of the first of the\n   non-option elements that the caller should itself scan.\n\n   Otherwise, `optind' communicates from one call to the next\n   how much of ARGV has been scanned so far.  */\n\nextern int optind;\n\n/* Callers store zero here to inhibit the error message `getopt' prints\n   for unrecognized options.  */\n\nextern int opterr;\n\n/* Set to an option character which was unrecognized.  */\n\nextern int optopt;\n\n#ifndef __need_getopt\n/* Describe the long-named options requested by the application.\n   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector\n   of `struct option' terminated by an element containing a name which is\n   zero.\n\n   The field `has_arg' is:\n   no_argument\t\t(or 0) if the option does not take an argument,\n   required_argument\t(or 1) if the option requires an argument,\n   optional_argument \t(or 2) if the option takes an optional argument.\n\n   If the field `flag' is not NULL, it points to a variable that is set\n   to the value given in the field `val' when the option is found, but\n   left unchanged if the option is not found.\n\n   To have a long-named option do something other than set an `int' to\n   a compiled-in constant, such as set a value from `optarg', set the\n   option's `flag' field to zero and its `val' field to a nonzero\n   value (the equivalent single-letter option character, if there is\n   one).  For long options that have a zero `flag' field, `getopt'\n   returns the contents of the `val' field.  */\n\nstruct option\n{\n# if (defined __STDC__ && __STDC__) || defined __cplusplus\n  const char *name;\n# else\n  char *name;\n# endif\n  /* has_arg can't be an enum because some compilers complain about\n     type mismatches in all the code that assumes it is an int.  */\n  int has_arg;\n  int *flag;\n  int val;\n};\n\n/* Names for the values of the `has_arg' field of `struct option'.  */\n\n# define no_argument\t\t0\n# define required_argument\t1\n# define optional_argument\t2\n#endif\t/* need getopt */\n\n\n/* Get definitions and prototypes for functions to process the\n   arguments in ARGV (ARGC of them, minus the program name) for\n   options given in OPTS.\n\n   Return the option character from OPTS just read.  Return -1 when\n   there are no more options.  For unrecognized options, or options\n   missing arguments, `optopt' is set to the option letter, and '?' is\n   returned.\n\n   The OPTS string is a list of characters which are recognized option\n   letters, optionally followed by colons, specifying that that letter\n   takes an argument, to be placed in `optarg'.\n\n   If a letter in OPTS is followed by two colons, its argument is\n   optional.  This behavior is specific to the GNU `getopt'.\n\n   The argument `--' causes premature termination of argument\n   scanning, explicitly telling `getopt' that there are no more\n   options.\n\n   If OPTS begins with `--', then non-option arguments are treated as\n   arguments to the option '\\0'.  This behavior is specific to the GNU\n   `getopt'.  */\n\n#if (defined __STDC__ && __STDC__) || defined __cplusplus\n# ifdef __GNU_LIBRARY__\n/* Many other libraries have conflicting prototypes for getopt, with\n   differences in the consts, in stdlib.h.  To avoid compilation\n   errors, only prototype getopt for the GNU C library.  */\nextern int getopt (int __argc, char *const *__argv, const char *__shortopts);\n# else /* not __GNU_LIBRARY__ */\nextern int getopt ();\n# endif /* __GNU_LIBRARY__ */\n\n# ifndef __need_getopt\nextern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,\n\t\t        const struct option *__longopts, int *__longind);\nextern int getopt_long_only (int __argc, char *const *__argv,\n\t\t\t     const char *__shortopts,\n\t\t             const struct option *__longopts, int *__longind);\n\n/* Internal only.  Users should not call this directly.  */\nextern int _getopt_internal (int __argc, char *const *__argv,\n\t\t\t     const char *__shortopts,\n\t\t             const struct option *__longopts, int *__longind,\n\t\t\t     int __long_only);\n# endif\n#else /* not __STDC__ */\nextern int getopt ();\n# ifndef __need_getopt\nextern int getopt_long ();\nextern int getopt_long_only ();\n\nextern int _getopt_internal ();\n# endif\n#endif /* __STDC__ */\n\n#ifdef\t__cplusplus\n}\n#endif\n\n/* Make sure we later can get all the definitions and declarations.  */\n#undef __need_getopt\n\n#endif /* getopt.h */\n"
  },
  {
    "path": "src/getopt/getopt1.c",
    "content": "/* getopt_long and getopt_long_only entry points for GNU getopt.\n   Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98\n     Free Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, write to the Free\n   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n   02111-1307 USA.  */\n\f\n#ifdef HAVE_CONFIG_H\n#include <config.h>\n#endif\n\n#include \"getopt.h\"\n\n#if !defined __STDC__ || !__STDC__\n/* This is a separate conditional since some stdc systems\n   reject `defined (const)'.  */\n#ifndef const\n#define const\n#endif\n#endif\n\n#include <stdio.h>\n\n/* Comment out all this code if we are using the GNU C Library, and are not\n   actually compiling the library itself.  This code is part of the GNU C\n   Library, but also included in many other GNU distributions.  Compiling\n   and linking in this code is a waste when using the GNU C library\n   (especially if it is a shared library).  Rather than having every GNU\n   program understand `configure --with-gnu-libc' and omit the object files,\n   it is simpler to just do this in the source for each such file.  */\n\n#define GETOPT_INTERFACE_VERSION 2\n#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2\n#include <gnu-versions.h>\n#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION\n#define ELIDE_CODE\n#endif\n#endif\n\n#ifndef ELIDE_CODE\n\n\n/* This needs to come after some library #include\n   to get __GNU_LIBRARY__ defined.  */\n#ifdef __GNU_LIBRARY__\n#include <stdlib.h>\n#endif\n\n#ifndef\tNULL\n#define NULL 0\n#endif\n\nint\ngetopt_long (argc, argv, options, long_options, opt_index)\n     int argc;\n     char *const *argv;\n     const char *options;\n     const struct option *long_options;\n     int *opt_index;\n{\n  return _getopt_internal (argc, argv, options, long_options, opt_index, 0);\n}\n\n/* Like getopt_long, but '-' as well as '--' can indicate a long option.\n   If an option that starts with '-' (not '--') doesn't match a long option,\n   but does match a short option, it is parsed as a short option\n   instead.  */\n\nint\ngetopt_long_only (argc, argv, options, long_options, opt_index)\n     int argc;\n     char *const *argv;\n     const char *options;\n     const struct option *long_options;\n     int *opt_index;\n{\n  return _getopt_internal (argc, argv, options, long_options, opt_index, 1);\n}\n\n\n#endif\t/* Not ELIDE_CODE.  */\n\f\n#ifdef TEST\n\n#include <stdio.h>\n\nint\nmain (argc, argv)\n     int argc;\n     char **argv;\n{\n  int c;\n  int digit_optind = 0;\n\n  while (1)\n    {\n      int this_option_optind = optind ? optind : 1;\n      int option_index = 0;\n      static struct option long_options[] =\n      {\n\t{\"add\", 1, 0, 0},\n\t{\"append\", 0, 0, 0},\n\t{\"delete\", 1, 0, 0},\n\t{\"verbose\", 0, 0, 0},\n\t{\"create\", 0, 0, 0},\n\t{\"file\", 1, 0, 0},\n\t{0, 0, 0, 0}\n      };\n\n      c = getopt_long (argc, argv, \"abc:d:0123456789\",\n\t\t       long_options, &option_index);\n      if (c == -1)\n\tbreak;\n\n      switch (c)\n\t{\n\tcase 0:\n\t  printf (\"option %s\", long_options[option_index].name);\n\t  if (optarg)\n\t    printf (\" with arg %s\", optarg);\n\t  printf (\"\\n\");\n\t  break;\n\n\tcase '0':\n\tcase '1':\n\tcase '2':\n\tcase '3':\n\tcase '4':\n\tcase '5':\n\tcase '6':\n\tcase '7':\n\tcase '8':\n\tcase '9':\n\t  if (digit_optind != 0 && digit_optind != this_option_optind)\n\t    printf (\"digits occur in two different argv-elements.\\n\");\n\t  digit_optind = this_option_optind;\n\t  printf (\"option %c\\n\", c);\n\t  break;\n\n\tcase 'a':\n\t  printf (\"option a\\n\");\n\t  break;\n\n\tcase 'b':\n\t  printf (\"option b\\n\");\n\t  break;\n\n\tcase 'c':\n\t  printf (\"option c with value `%s'\\n\", optarg);\n\t  break;\n\n\tcase 'd':\n\t  printf (\"option d with value `%s'\\n\", optarg);\n\t  break;\n\n\tcase '?':\n\t  break;\n\n\tdefault:\n\t  printf (\"?? getopt returned character code 0%o ??\\n\", c);\n\t}\n    }\n\n  if (optind < argc)\n    {\n      printf (\"non-option ARGV-elements: \");\n      while (optind < argc)\n\tprintf (\"%s \", argv[optind++]);\n      printf (\"\\n\");\n    }\n\n  exit (0);\n}\n\n#endif /* TEST */\n"
  },
  {
    "path": "src/gpt_types.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * GPT Partition Types\n * Copyright © 2020-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <windows.h>\n// MinGW won't properly embed the GUIDs unless the following is defined\n#define INITGUID\n#include <guiddef.h>\n\n#pragma once\n\ntypedef struct {\n    uint16_t    code;\n    const char* guid_str;\n    const char* description;\n} gpt_type_entry_t;\n\n#define AddType(code, guid, desc, ...) { code, guid, desc },\n\n/*\n * Because we value our sanity, we build our GPT entries from code lifted\n * verbatim from Debian's gdisk's parttypes.cc and use AddType() as a macro\n * to create a static table.\n */\nstatic const gpt_type_entry_t gpt_type_table[] = {\n    // From https://salsa.debian.org/debian/gdisk/-/blob/master/parttypes.cc\n    // Semicolons after Addtype() *MUST* be removed.\n\n    // Start with the \"unused entry,\" which should normally appear only\n    // on empty partition table entries....\n    AddType(0x0000, \"00000000-0000-0000-0000-000000000000\", \"Unused entry\", 0)\n\n    // DOS/Windows partition types, most of which are hidden from the \"L\" listing\n    // (they're available mainly for MBR-to-GPT conversions).\n    AddType(0x0100, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // FAT-12\n    AddType(0x0400, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // FAT-16 < 32M\n    AddType(0x0600, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // FAT-16\n    AddType(0x0700, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 1) // NTFS (or HPFS)\n    AddType(0x0701, \"558D43C5-A1AC-43C0-AAC8-D1472B2923D1\", \"Microsoft Storage Replica\", 1)\n    AddType(0x0702, \"90B6FF38-B98F-4358-A21F-48F35B4A8AD3\", \"ArcaOS Type 1\", 1)\n    AddType(0x0b00, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // FAT-32\n    AddType(0x0c00, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // FAT-32 LBA\n    AddType(0x0c01, \"E3C9E316-0B5C-4DB8-817D-F92DF00215AE\", \"Microsoft reserved\")\n    AddType(0x0e00, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // FAT-16 LBA\n    AddType(0x1100, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // Hidden FAT-12\n    AddType(0x1400, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // Hidden FAT-16 < 32M\n    AddType(0x1600, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // Hidden FAT-16\n    AddType(0x1700, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // Hidden NTFS (or HPFS)\n    AddType(0x1b00, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // Hidden FAT-32\n    AddType(0x1c00, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // Hidden FAT-32 LBA\n    AddType(0x1e00, \"EBD0A0A2-B9E5-4433-87C0-68B6B72699C7\", \"Microsoft basic data\", 0) // Hidden FAT-16 LBA\n    AddType(0x2700, \"DE94BBA4-06D1-4D40-A16A-BFD50179D6AC\", \"Windows RE\")\n\n    // Open Network Install Environment (ONIE) specific types.\n    // See http://www.onie.org/ and\n    // https://github.com/opencomputeproject/onie/blob/master/patches/gptfdisk/add-onie-partition-types.patch\n    AddType(0x3000, \"7412F7D5-A156-4B13-81DC-867174929325\", \"ONIE boot\")\n    AddType(0x3001, \"D4E6E2CD-4469-46F3-B5CB-1BFF57AFC149\", \"ONIE config\")\n\n    // Plan 9; see http://man.cat-v.org/9front/8/prep\n    AddType(0x3900, \"C91818F9-8025-47AF-89D2-F030D7000C2C\", \"Plan 9\")\n\n    // PowerPC reference platform boot partition\n    AddType(0x4100, \"9E1A2D38-C612-4316-AA26-8B49521E5A8B\", \"PowerPC PReP boot\")\n\n    // Windows LDM (\"dynamic disk\") types\n    AddType(0x4200, \"AF9B60A0-1431-4F62-BC68-3311714A69AD\", \"Windows LDM data\") // Logical disk manager\n    AddType(0x4201, \"5808C8AA-7E8F-42E0-85D2-E1E90434CFB3\", \"Windows LDM metadata\") // Logical disk manager\n    AddType(0x4202, \"E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D\", \"Windows Storage Spaces\") // A newer LDM-type setup\n\n    // An oddball IBM filesystem....\n    AddType(0x7501, \"37AFFC90-EF7D-4E96-91C3-2D7AE055B174\", \"IBM GPFS\") // General Parallel File System (GPFS)\n\n    // ChromeOS-specific partition types...\n    // Values taken from vboot_reference/firmware/lib/cgptlib/include/gpt.h in\n    // ChromeOS source code, retrieved 12/23/2010. They're also at\n    // http://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format.\n    // These have no MBR equivalents, AFAIK, so I'm using 0x7Fxx values, since they're close\n    // to the Linux values.\n    AddType(0x7f00, \"FE3A2A5D-4F32-41A7-B725-ACCC3285A309\", \"ChromeOS kernel\")\n    AddType(0x7f01, \"3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC\", \"ChromeOS root\")\n    AddType(0x7f02, \"2E0A753D-9E48-43B0-8337-B15192CB1B5E\", \"ChromeOS reserved\")\n    AddType(0x7f03, \"CAB6E88E-ABF3-4102-A07A-D4BB9BE3C1D3\", \"ChromeOS firmware\")\n    AddType(0x7f04, \"09845860-705F-4BB5-B16C-8A8A099CAF52\", \"ChromeOS mini-OS\")\n    AddType(0x7f05, \"3F0F8318-F146-4E6B-8222-C28C8F02E0D5\", \"ChromeOS hibernate\")\n\n    // Linux-specific partition types....\n    AddType(0x8200, \"0657FD6D-A4AB-43C4-84E5-0933C84B4F4F\", \"Linux swap\") // Linux swap (or Solaris on MBR)\n    AddType(0x8300, \"0FC63DAF-8483-4772-8E79-3D69D8477DE4\", \"Linux filesystem\") // Linux native\n    AddType(0x8301, \"8DA63339-0007-60C0-C436-083AC8230908\", \"Linux reserved\")\n    // See https://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html\n    // and https://systemd.io/DISCOVERABLE_PARTITIONS\n    AddType(0x8302, \"933AC7E1-2EB4-4F13-B844-0E14E2AEF915\", \"Linux /home\") // Linux /home (auto-mounted by systemd)\n    AddType(0x8303, \"44479540-F297-41B2-9AF7-D131D5F0458A\", \"Linux x86 root (/)\") // Linux / on x86 (auto-mounted by systemd)\n    AddType(0x8304, \"4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709\", \"Linux x86-64 root (/)\") // Linux / on x86-64 (auto-mounted by systemd)\n    AddType(0x8305, \"B921B045-1DF0-41C3-AF44-4C6F280D3FAE\", \"Linux ARM64 root (/)\") // Linux / on 64-bit ARM (auto-mounted by systemd)\n    AddType(0x8306, \"3B8F8425-20E0-4F3B-907F-1A25A76F98E8\", \"Linux /srv\") // Linux /srv (auto-mounted by systemd)\n    AddType(0x8307, \"69DAD710-2CE4-4E3C-B16C-21A1D49ABED3\", \"Linux ARM32 root (/)\") // Linux / on 32-bit ARM (auto-mounted by systemd)\n    AddType(0x8308, \"7FFEC5C9-2D00-49B7-8941-3EA10A5586B7\", \"Linux dm-crypt\")\n    AddType(0x8309, \"CA7D7CCB-63ED-4C53-861C-1742536059CC\", \"Linux LUKS\")\n    AddType(0x830A, \"993D8D3D-F80E-4225-855A-9DAF8ED7EA97\", \"Linux IA-64 root (/)\") // Linux / on Itanium (auto-mounted by systemd)\n    AddType(0x830B, \"D13C5D3B-B5D1-422A-B29F-9454FDC89D76\", \"Linux x86 root verity\")\n    AddType(0x830C, \"2C7357ED-EBD2-46D9-AEC1-23D437EC2BF5\", \"Linux x86-64 root verity\")\n    AddType(0x830D, \"7386CDF2-203C-47A9-A498-F2ECCE45A2D6\", \"Linux ARM32 root verity\")\n    AddType(0x830E, \"DF3300CE-D69F-4C92-978C-9BFB0F38D820\", \"Linux ARM64 root verity\")\n    AddType(0x830F, \"86ED10D5-B607-45BB-8957-D350F23D0571\", \"Linux IA-64 root verity\")\n    AddType(0x8310, \"4D21B016-B534-45C2-A9FB-5C16E091FD2D\", \"Linux /var\") // Linux /var (auto-mounted by systemd)\n    AddType(0x8311, \"7EC6F557-3BC5-4ACA-B293-16EF5DF639D1\", \"Linux /var/tmp\") // Linux /var/tmp (auto-mounted by systemd)\n    // https://systemd.io/HOME_DIRECTORY/\n    AddType(0x8312, \"773F91EF-66D4-49B5-BD83-D683BF40AD16\", \"Linux user's home\") // used by systemd-homed\n    AddType(0x8313, \"75250D76-8CC6-458E-BD66-BD47CC81A812\", \"Linux x86 /usr \") // Linux /usr on x86 (auto-mounted by systemd)\n    AddType(0x8314, \"8484680C-9521-48C6-9C11-B0720656F69E\", \"Linux x86-64 /usr\") // Linux /usr on x86-64 (auto-mounted by systemd)\n    AddType(0x8315, \"7D0359A3-02B3-4F0A-865C-654403E70625\", \"Linux ARM32 /usr\") // Linux /usr on 32-bit ARM (auto-mounted by systemd)\n    AddType(0x8316, \"B0E01050-EE5F-4390-949A-9101B17104E9\", \"Linux ARM64 /usr\") // Linux /usr on 64-bit ARM (auto-mounted by systemd)\n    AddType(0x8317, \"4301D2A6-4E3B-4B2A-BB94-9E0B2C4225EA\", \"Linux IA-64 /usr\") // Linux /usr on Itanium (auto-mounted by systemd)\n    AddType(0x8318, \"8F461B0D-14EE-4E81-9AA9-049B6FB97ABD\", \"Linux x86 /usr verity\")\n    AddType(0x8319, \"77FF5F63-E7B6-4633-ACF4-1565B864C0E6\", \"Linux x86-64 /usr verity\")\n    AddType(0x831A, \"C215D751-7BCD-4649-BE90-6627490A4C05\", \"Linux ARM32 /usr verity\")\n    AddType(0x831B, \"6E11A4E7-FBCA-4DED-B9E9-E1A512BB664E\", \"Linux ARM64 /usr verity\")\n    AddType(0x831C, \"6A491E03-3BE7-4545-8E38-83320E0EA880\", \"Linux IA-64 /usr verity\")\n    AddType(0x831D, \"6523F8AE-3EB1-4E2A-A05A-18B695AE656F\", \"Linux Alpha root (/)\")\n    AddType(0x831E, \"D27F46ED-2919-4CB8-BD25-9531F3C16534\", \"Linux ARC root (/)\")\n    AddType(0x831F, \"77055800-792C-4F94-B39A-98C91B762BB6\", \"Linux LoongArch root (/)\")\n    AddType(0x8320, \"E9434544-6E2C-47CC-BAE2-12D6DEAFB44C\", \"Linux MIPS-32 BE root (/)\")\n    AddType(0x8321, \"D113AF76-80EF-41B4-BDB6-0CFF4D3D4A25\", \"Linux MIPS-64 BE root (/)\")\n    AddType(0x8322, \"37C58C8A-D913-4156-A25F-48B1B64E07F0\", \"Linux MIPS-32 LE root (/)\")\n    AddType(0x8323, \"700BDA43-7A34-4507-B179-EEB93D7A7CA3\", \"Linux MIPS-64 LE root (/)\")\n    AddType(0x8324, \"1AACDB3B-5444-4138-BD9E-E5C2239B2346\", \"Linux PA-RISC root (/)\")\n    AddType(0x8325, \"1DE3F1EF-FA98-47B5-8DCD-4A860A654D78\", \"Linux PowerPC-32 root (/)\")\n    AddType(0x8326, \"912ADE1D-A839-4913-8964-A10EEE08FBD2\", \"Linux PowerPC-64 BE root (/)\")\n    AddType(0x8327, \"C31C45E6-3F39-412E-80FB-4809C4980599\", \"Linux PowerPC-64 LE root (/)\")\n    AddType(0x8328, \"60D5A7FE-8E7D-435C-B714-3DD8162144E1\", \"Linux RISC-V-32 root (/)\")\n    AddType(0x8329, \"72EC70A6-CF74-40E6-BD49-4BDA08E8F224\", \"Linux RISC-V-64 root (/)\")\n    AddType(0x832A, \"08A7ACEA-624C-4A20-91E8-6E0FA67D23F9\", \"Linux s390 root (/)\")\n    AddType(0x832B, \"5EEAD9A9-FE09-4A1E-A1D7-520D00531306\", \"Linux s390x root (/)\")\n    AddType(0x832C, \"C50CDD70-3862-4CC3-90E1-809A8C93EE2C\", \"Linux TILE-Gx root (/)\")\n    AddType(0x832D, \"E18CF08C-33EC-4C0D-8246-C6C6FB3DA024\", \"Linux Alpha /usr\")\n    AddType(0x832E, \"7978A683-6316-4922-BBEE-38BFF5A2FECC\", \"Linux ARC /usr\")\n    AddType(0x832F, \"E611C702-575C-4CBE-9A46-434FA0BF7E3F\", \"Linux LoongArch /usr\")\n    AddType(0x8330, \"773B2ABC-2A99-4398-8BF5-03BAAC40D02B\", \"Linux MIPS-32 BE /usr\")\n    AddType(0x8331, \"57E13958-7331-4365-8E6E-35EEEE17C61B\", \"Linux MIPS-64 BE /usr\")\n    AddType(0x8332, \"0F4868E9-9952-4706-979F-3ED3A473E947\", \"Linux MIPS-32 LE /usr\")\n    AddType(0x8333, \"C97C1F32-BA06-40B4-9F22-236061B08AA8\", \"Linux MIPS-64 LE /usr\")\n    AddType(0x8334, \"DC4A4480-6917-4262-A4EC-DB9384949F25\", \"Linux PA-RISC /usr\")\n    AddType(0x8335, \"7D14FEC5-CC71-415D-9D6C-06BF0B3C3EAF\", \"Linux PowerPC-32 /usr\")\n    AddType(0x8336, \"2C9739E2-F068-46B3-9FD0-01C5A9AFBCCA\", \"Linux PowerPC-64 BE /usr\")\n    AddType(0x8337, \"15BB03AF-77E7-4D4A-B12B-C0D084F7491C\", \"Linux PowerPC-64 LE /usr\")\n    AddType(0x8338, \"B933FB22-5C3F-4F91-AF90-E2BB0FA50702\", \"Linux RISC-V-32 /usr\")\n    AddType(0x8339, \"BEAEC34B-8442-439B-A40B-984381ED097D\", \"Linux RISC-V-64 /usr\")\n    AddType(0x833A, \"CD0F869B-D0FB-4CA0-B141-9EA87CC78D66\", \"Linux s390 /usr\")\n    AddType(0x833B, \"8A4F5770-50AA-4ED3-874A-99B710DB6FEA\", \"Linux s390x /usr\")\n    AddType(0x833C, \"55497029-C7C1-44CC-AA39-815ED1558630\", \"Linux TILE-Gx /usr\")\n    AddType(0x833D, \"FC56D9E9-E6E5-4C06-BE32-E74407CE09A5\", \"Linux Alpha root verity\")\n    AddType(0x833E, \"24B2D975-0F97-4521-AFA1-CD531E421B8D\", \"Linux ARC root verity\")\n    AddType(0x833F, \"F3393B22-E9AF-4613-A948-9D3BFBD0C535\", \"Linux LoongArch root verity\")\n    AddType(0x8340, \"7A430799-F711-4C7E-8E5B-1D685BD48607\", \"Linux MIPS-32 BE root verity\")\n    AddType(0x8341, \"579536F8-6A33-4055-A95A-DF2D5E2C42A8\", \"Linux MIPS-64 BE root verity\")\n    AddType(0x8342, \"D7D150D2-2A04-4A33-8F12-16651205FF7B\", \"Linux MIPS-32 LE root verity\")\n    AddType(0x8343, \"16B417F8-3E06-4F57-8DD2-9B5232F41AA6\", \"Linux MIPS-64 LE root verity\")\n    AddType(0x8344, \"D212A430-FBC5-49F9-A983-A7FEEF2B8D0E\", \"Linux PA-RISC root verity\")\n    AddType(0x8345, \"906BD944-4589-4AAE-A4E4-DD983917446A\", \"Linux PowerPC-64 LE root verity\")\n    AddType(0x8346, \"9225A9A3-3C19-4D89-B4F6-EEFF88F17631\", \"Linux PowerPC-64 BE root verity\")\n    AddType(0x8347, \"98CFE649-1588-46DC-B2F0-ADD147424925\", \"Linux PowerPC-32 root verity\")\n    AddType(0x8348, \"AE0253BE-1167-4007-AC68-43926C14C5DE\", \"Linux RISC-V-32 root verity\")\n    AddType(0x8349, \"B6ED5582-440B-4209-B8DA-5FF7C419EA3D\", \"Linux RISC-V-64 root verity\")\n    AddType(0x834A, \"7AC63B47-B25C-463B-8DF8-B4A94E6C90E1\", \"Linux s390 root verity\")\n    AddType(0x834B, \"B325BFBE-C7BE-4AB8-8357-139E652D2F6B\", \"Linux s390x root verity\")\n    AddType(0x834C, \"966061EC-28E4-4B2E-B4A5-1F0A825A1D84\", \"Linux TILE-Gx root verity\")\n    AddType(0x834D, \"8CCE0D25-C0D0-4A44-BD87-46331BF1DF67\", \"Linux Alpha /usr verity\")\n    AddType(0x834E, \"FCA0598C-D880-4591-8C16-4EDA05C7347C\", \"Linux ARC /usr verity\")\n    AddType(0x834F, \"F46B2C26-59AE-48F0-9106-C50ED47F673D\", \"Linux LoongArch /usr verity\")\n    AddType(0x8350, \"6E5A1BC8-D223-49B7-BCA8-37A5FCCEB996\", \"Linux MIPS-32 BE /usr verity\")\n    AddType(0x8351, \"81CF9D90-7458-4DF4-8DCF-C8A3A404F09B\", \"Linux MIPS-64 BE /usr verity\")\n    AddType(0x8352, \"46B98D8D-B55C-4E8F-AAB3-37FCA7F80752\", \"Linux MIPS-32 LE /usr verity\")\n    AddType(0x8353, \"3C3D61FE-B5F3-414D-BB71-8739A694A4EF\", \"Linux MIPS-64 LE /usr verity\")\n    AddType(0x8354, \"5843D618-EC37-48D7-9F12-CEA8E08768B2\", \"Linux PA-RISC /usr verity\")\n    AddType(0x8355, \"EE2B9983-21E8-4153-86D9-B6901A54D1CE\", \"Linux PowerPC-64 LE /usr verity\")\n    AddType(0x8356, \"BDB528A5-A259-475F-A87D-DA53FA736A07\", \"Linux PowerPC-64 BE /usr verity\")\n    AddType(0x8357, \"DF765D00-270E-49E5-BC75-F47BB2118B09\", \"Linux PowerPC-32 /usr verity\")\n    AddType(0x8358, \"CB1EE4E3-8CD0-4136-A0A4-AA61A32E8730\", \"Linux RISC-V-32 /usr verity\")\n    AddType(0x8359, \"8F1056BE-9B05-47C4-81D6-BE53128E5B54\", \"Linux RISC-V-64 /usr verity\")\n    AddType(0x835A, \"B663C618-E7BC-4D6D-90AA-11B756BB1797\", \"Linux s390 /usr verity\")\n    AddType(0x835B, \"31741CC4-1A2A-4111-A581-E00B447D2D06\", \"Linux s390x /usr verity\")\n    AddType(0x835C, \"2FB4BF56-07FA-42DA-8132-6B139F2026AE\", \"Linux TILE-Gx /usr verity\")\n    AddType(0x835D, \"D46495B7-A053-414F-80F7-700C99921EF8\", \"Linux Alpha root verity signature\")\n    AddType(0x835E, \"143A70BA-CBD3-4F06-919F-6C05683A78BC\", \"Linux ARC root verity signature\")\n    AddType(0x835F, \"42B0455F-EB11-491D-98D3-56145BA9D037\", \"Linux ARM32 root verity signature\")\n    AddType(0x8360, \"6DB69DE6-29F4-4758-A7A5-962190F00CE3\", \"Linux ARM64 root verity signature\")\n    AddType(0x8361, \"E98B36EE-32BA-4882-9B12-0CE14655F46A\", \"Linux IA-64 root verity signature\")\n    AddType(0x8362, \"5AFB67EB-ECC8-4F85-AE8E-AC1E7C50E7D0\", \"Linux LoongArch root verity signature\")\n    AddType(0x8363, \"BBA210A2-9C5D-45EE-9E87-FF2CCBD002D0\", \"Linux MIPS-32 BE root verity signature\")\n    AddType(0x8364, \"43CE94D4-0F3D-4999-8250-B9DEAFD98E6E\", \"Linux MIPS-64 BE root verity signature\")\n    AddType(0x8365, \"C919CC1F-4456-4EFF-918C-F75E94525CA5\", \"Linux MIPS-32 LE root verity signature\")\n    AddType(0x8366, \"904E58EF-5C65-4A31-9C57-6AF5FC7C5DE7\", \"Linux MIPS-64 LE root verity signature\")\n    AddType(0x8367, \"15DE6170-65D3-431C-916E-B0DCD8393F25\", \"Linux PA-RISC root verity signature\")\n    AddType(0x8368, \"D4A236E7-E873-4C07-BF1D-BF6CF7F1C3C6\", \"Linux PowerPC-64 LE root verity signature\")\n    AddType(0x8369, \"F5E2C20C-45B2-4FFA-BCE9-2A60737E1AAF\", \"Linux PowerPC-64 BE root verity signature\")\n    AddType(0x836A, \"1B31B5AA-ADD9-463A-B2ED-BD467FC857E7\", \"Linux PowerPC-32 root verity signature\")\n    AddType(0x836B, \"3A112A75-8729-4380-B4CF-764D79934448\", \"Linux RISC-V-32 root verity signature\")\n    AddType(0x836C, \"EFE0F087-EA8D-4469-821A-4C2A96A8386A\", \"Linux RISC-V-64 root verity signature\")\n    AddType(0x836D, \"3482388E-4254-435A-A241-766A065F9960\", \"Linux s390 root verity signature\")\n    AddType(0x836E, \"C80187A5-73A3-491A-901A-017C3FA953E9\", \"Linux s390x root verity signature\")\n    AddType(0x836F, \"B3671439-97B0-4A53-90F7-2D5A8F3AD47B\", \"Linux TILE-Gx root verity signature\")\n    AddType(0x8370, \"41092B05-9FC8-4523-994F-2DEF0408B176\", \"Linux x86-64 root verity signature\")\n    AddType(0x8371, \"5996FC05-109C-48DE-808B-23FA0830B676\", \"Linux x86 root verity signature\")\n    AddType(0x8372, \"5C6E1C76-076A-457A-A0FE-F3B4CD21CE6E\", \"Linux Alpha /usr verity signature\")\n    AddType(0x8373, \"94F9A9A1-9971-427A-A400-50CB297F0F35\", \"Linux ARC /usr verity signature\")\n    AddType(0x8374, \"D7FF812F-37D1-4902-A810-D76BA57B975A\", \"Linux ARM32 /usr verity signature\")\n    AddType(0x8375, \"C23CE4FF-44BD-4B00-B2D4-B41B3419E02A\", \"Linux ARM64 /usr verity signature\")\n    AddType(0x8376, \"8DE58BC2-2A43-460D-B14E-A76E4A17B47F\", \"Linux IA-64 /usr verity signature\")\n    AddType(0x8377, \"B024F315-D330-444C-8461-44BBDE524E99\", \"Linux LoongArch /usr verity signature\")\n    AddType(0x8378, \"97AE158D-F216-497B-8057-F7F905770F54\", \"Linux MIPS-32 BE /usr verity signature\")\n    AddType(0x8379, \"05816CE2-DD40-4AC6-A61D-37D32DC1BA7D\", \"Linux MIPS-64 BE /usr verity signature\")\n    AddType(0x837A, \"3E23CA0B-A4BC-4B4E-8087-5AB6A26AA8A9\", \"Linux MIPS-32 LE /usr verity signature\")\n    AddType(0x837B, \"F2C2C7EE-ADCC-4351-B5C6-EE9816B66E16\", \"Linux MIPS-64 LE /usr verity signature\")\n    AddType(0x837C, \"450DD7D1-3224-45EC-9CF2-A43A346D71EE\", \"Linux PA-RISC /usr verity signature\")\n    AddType(0x837D, \"C8BFBD1E-268E-4521-8BBA-BF314C399557\", \"Linux PowerPC-64 LE /usr verity signature\")\n    AddType(0x837E, \"0B888863-D7F8-4D9E-9766-239FCE4D58AF\", \"Linux PowerPC-64 BE /usr verity signature\")\n    AddType(0x837F, \"7007891D-D371-4A80-86A4-5CB875B9302E\", \"Linux PowerPC-32 /usr verity signature\")\n    AddType(0x8380, \"C3836A13-3137-45BA-B583-B16C50FE5EB4\", \"Linux RISC-V-32 /usr verity signature\")\n    AddType(0x8381, \"D2F9000A-7A18-453F-B5CD-4D32F77A7B32\", \"Linux RISC-V-64 /usr verity signature\")\n    AddType(0x8382, \"17440E4F-A8D0-467F-A46E-3912AE6EF2C5\", \"Linux s390 /usr verity signature\")\n    AddType(0x8383, \"3F324816-667B-46AE-86EE-9B0C0C6C11B4\", \"Linux s390x /usr verity signature\")\n    AddType(0x8384, \"4EDE75E2-6CCC-4CC8-B9C7-70334B087510\", \"Linux TILE-Gx /usr verity signature\")\n    AddType(0x8385, \"E7BB33FB-06CF-4E81-8273-E543B413E2E2\", \"Linux x86-64 /usr verity signature\")\n    AddType(0x8386, \"974A71C0-DE41-43C3-BE5D-5C5CCD1AD2C0\", \"Linux x86 /usr verity signature\")\n\n    // Used by Intel Rapid Start technology\n    AddType(0x8400, \"D3BFE2DE-3DAF-11DF-BA40-E3A556D89593\", \"Intel Rapid Start\")\n    // This is another Intel-associated technology, so I'm keeping it close to the previous one....\n    AddType(0x8401, \"7C5222BD-8F5D-4087-9C00-BF9843C7B58C\", \"SPDK block device\")\n\n    // Type codes for Container Linux (formerly CoreOS; https://coreos.com)\n    AddType(0x8500, \"5DFBF5F4-2848-4BAC-AA5E-0D9A20B745A6\", \"Container Linux /usr\")\n    AddType(0x8501, \"3884DD41-8582-4404-B9A8-E9B84F2DF50E\", \"Container Linux resizable rootfs\")\n    AddType(0x8502, \"C95DC21A-DF0E-4340-8D7B-26CBFA9A03E0\", \"Container Linux /OEM customizations\")\n    AddType(0x8503, \"BE9067B9-EA49-4F15-B4F6-F36F8C9E1818\", \"Container Linux root on RAID\")\n\n    // Another Linux type code....\n    AddType(0x8e00, \"E6D6D379-F507-44C2-A23C-238F2A3DF928\", \"Linux LVM\")\n\n    // Android type codes....\n    // from Wikipedia, https://gist.github.com/culots/704afd126dec2f45c22d0c9d42cb7fab,\n    // and my own Android devices' partition tables\n    AddType(0xa000, \"2568845D-2332-4675-BC39-8FA5A4748D15\", \"Android bootloader\")\n    AddType(0xa001, \"114EAFFE-1552-4022-B26E-9B053604CF84\", \"Android bootloader 2\")\n    AddType(0xa002, \"49A4D17F-93A3-45C1-A0DE-F50B2EBE2599\", \"Android boot 1\")\n    AddType(0xa003, \"4177C722-9E92-4AAB-8644-43502BFD5506\", \"Android recovery 1\")\n    AddType(0xa004, \"EF32A33B-A409-486C-9141-9FFB711F6266\", \"Android misc\")\n    AddType(0xa005, \"20AC26BE-20B7-11E3-84C5-6CFDB94711E9\", \"Android metadata\")\n    AddType(0xa006, \"38F428E6-D326-425D-9140-6E0EA133647C\", \"Android system 1\")\n    AddType(0xa007, \"A893EF21-E428-470A-9E55-0668FD91A2D9\", \"Android cache\")\n    AddType(0xa008, \"DC76DDA9-5AC1-491C-AF42-A82591580C0D\", \"Android data\")\n    AddType(0xa009, \"EBC597D0-2053-4B15-8B64-E0AAC75F4DB1\", \"Android persistent\")\n    AddType(0xa00a, \"8F68CC74-C5E5-48DA-BE91-A0C8C15E9C80\", \"Android factory\")\n    AddType(0xa00b, \"767941D0-2085-11E3-AD3B-6CFDB94711E9\", \"Android fastboot/tertiary\")\n    AddType(0xa00c, \"AC6D7924-EB71-4DF8-B48D-E267B27148FF\", \"Android OEM\")\n    AddType(0xa00d, \"C5A0AEEC-13EA-11E5-A1B1-001E67CA0C3C\", \"Android vendor\")\n    AddType(0xa00e, \"BD59408B-4514-490D-BF12-9878D963F378\", \"Android config\")\n    AddType(0xa00f, \"9FDAA6EF-4B3F-40D2-BA8D-BFF16BFB887B\", \"Android factory (alt)\")\n    AddType(0xa010, \"19A710A2-B3CA-11E4-B026-10604B889DCF\", \"Android meta\")\n    AddType(0xa011, \"193D1EA4-B3CA-11E4-B075-10604B889DCF\", \"Android EXT\")\n    AddType(0xa012, \"DEA0BA2C-CBDD-4805-B4F9-F428251C3E98\", \"Android SBL1\")\n    AddType(0xa013, \"8C6B52AD-8A9E-4398-AD09-AE916E53AE2D\", \"Android SBL2\")\n    AddType(0xa014, \"05E044DF-92F1-4325-B69E-374A82E97D6E\", \"Android SBL3\")\n    AddType(0xa015, \"400FFDCD-22E0-47E7-9A23-F16ED9382388\", \"Android APPSBL\")\n    AddType(0xa016, \"A053AA7F-40B8-4B1C-BA08-2F68AC71A4F4\", \"Android QSEE/tz\")\n    AddType(0xa017, \"E1A6A689-0C8D-4CC6-B4E8-55A4320FBD8A\", \"Android QHEE/hyp\")\n    AddType(0xa018, \"098DF793-D712-413D-9D4E-89D711772228\", \"Android RPM\")\n    AddType(0xa019, \"D4E0D938-B7FA-48C1-9D21-BC5ED5C4B203\", \"Android WDOG debug/sdi\")\n    AddType(0xa01a, \"20A0C19C-286A-42FA-9CE7-F64C3226A794\", \"Android DDR\")\n    AddType(0xa01b, \"A19F205F-CCD8-4B6D-8F1E-2D9BC24CFFB1\", \"Android CDT\")\n    AddType(0xa01c, \"66C9B323-F7FC-48B6-BF96-6F32E335A428\", \"Android RAM dump\")\n    AddType(0xa01d, \"303E6AC3-AF15-4C54-9E9B-D9A8FBECF401\", \"Android SEC\")\n    AddType(0xa01e, \"C00EEF24-7709-43D6-9799-DD2B411E7A3C\", \"Android PMIC\")\n    AddType(0xa01f, \"82ACC91F-357C-4A68-9C8F-689E1B1A23A1\", \"Android misc 1\")\n    AddType(0xa020, \"E2802D54-0545-E8A1-A1E8-C7A3E245ACD4\", \"Android misc 2\")\n    AddType(0xa021, \"65ADDCF4-0C5C-4D9A-AC2D-D90B5CBFCD03\", \"Android device info\")\n    AddType(0xa022, \"E6E98DA2-E22A-4D12-AB33-169E7DEAA507\", \"Android APDP\")\n    AddType(0xa023, \"ED9E8101-05FA-46B7-82AA-8D58770D200B\", \"Android MSADP\")\n    AddType(0xa024, \"11406F35-1173-4869-807B-27DF71802812\", \"Android DPO\")\n    AddType(0xa025, \"9D72D4E4-9958-42DA-AC26-BEA7A90B0434\", \"Android recovery 2\")\n    AddType(0xa026, \"6C95E238-E343-4BA8-B489-8681ED22AD0B\", \"Android persist\")\n    AddType(0xa027, \"EBBEADAF-22C9-E33B-8F5D-0E81686A68CB\", \"Android modem ST1\")\n    AddType(0xa028, \"0A288B1F-22C9-E33B-8F5D-0E81686A68CB\", \"Android modem ST2\")\n    AddType(0xa029, \"57B90A16-22C9-E33B-8F5D-0E81686A68CB\", \"Android FSC\")\n    AddType(0xa02a, \"638FF8E2-22C9-E33B-8F5D-0E81686A68CB\", \"Android FSG 1\")\n    AddType(0xa02b, \"2013373E-1AC4-4131-BFD8-B6A7AC638772\", \"Android FSG 2\")\n    AddType(0xa02c, \"2C86E742-745E-4FDD-BFD8-B6A7AC638772\", \"Android SSD\")\n    AddType(0xa02d, \"DE7D4029-0F5B-41C8-AE7E-F6C023A02B33\", \"Android keystore\")\n    AddType(0xa02e, \"323EF595-AF7A-4AFA-8060-97BE72841BB9\", \"Android encrypt\")\n    AddType(0xa02f, \"45864011-CF89-46E6-A445-85262E065604\", \"Android EKSST\")\n    AddType(0xa030, \"8ED8AE95-597F-4C8A-A5BD-A7FF8E4DFAA9\", \"Android RCT\")\n    AddType(0xa031, \"DF24E5ED-8C96-4B86-B00B-79667DC6DE11\", \"Android spare1\")\n    AddType(0xa032, \"7C29D3AD-78B9-452E-9DEB-D098D542F092\", \"Android spare2\")\n    AddType(0xa033, \"379D107E-229E-499D-AD4F-61F5BCF87BD4\", \"Android spare3\")\n    AddType(0xa034, \"0DEA65E5-A676-4CDF-823C-77568B577ED5\", \"Android spare4\")\n    AddType(0xa035, \"4627AE27-CFEF-48A1-88FE-99C3509ADE26\", \"Android raw resources\")\n    AddType(0xa036, \"20117F86-E985-4357-B9EE-374BC1D8487D\", \"Android boot 2\")\n    AddType(0xa037, \"86A7CB80-84E1-408C-99AB-694F1A410FC7\", \"Android FOTA\")\n    AddType(0xa038, \"97D7B011-54DA-4835-B3C4-917AD6E73D74\", \"Android system 2\")\n    AddType(0xa039, \"5594C694-C871-4B5F-90B1-690A6F68E0F7\", \"Android cache\")\n    AddType(0xa03a, \"1B81E7E6-F50D-419B-A739-2AEEF8DA3335\", \"Android user data\")\n    AddType(0xa03b, \"98523EC6-90FE-4C67-B50A-0FC59ED6F56D\", \"LG (Android) advanced flasher\")\n    AddType(0xa03c, \"2644BCC0-F36A-4792-9533-1738BED53EE3\", \"Android PG1FS\")\n    AddType(0xa03d, \"DD7C91E9-38C9-45C5-8A12-4A80F7E14057\", \"Android PG2FS\")\n    AddType(0xa03e, \"7696D5B6-43FD-4664-A228-C563C4A1E8CC\", \"Android board info\")\n    AddType(0xa03f, \"0D802D54-058D-4A20-AD2D-C7A362CEACD4\", \"Android MFG\")\n    AddType(0xa040, \"10A0C19C-516A-5444-5CE3-664C3226A794\", \"Android limits\")\n\n    // Atari TOS partition type\n    AddType(0xa200, \"734E5AFE-F61A-11E6-BC64-92361F002671\", \"Atari TOS basic data\")\n\n    // FreeBSD partition types....\n    // Note: Rather than extract FreeBSD disklabel data, convert FreeBSD\n    // partitions in-place, and let FreeBSD sort out the details....\n    AddType(0xa500, \"516E7CB4-6ECF-11D6-8FF8-00022D09712B\", \"FreeBSD disklabel\")\n    AddType(0xa501, \"83BD6B9D-7F41-11DC-BE0B-001560B84F0F\", \"FreeBSD boot\")\n    AddType(0xa502, \"516E7CB5-6ECF-11D6-8FF8-00022D09712B\", \"FreeBSD swap\")\n    AddType(0xa503, \"516E7CB6-6ECF-11D6-8FF8-00022D09712B\", \"FreeBSD UFS\")\n    AddType(0xa504, \"516E7CBA-6ECF-11D6-8FF8-00022D09712B\", \"FreeBSD ZFS\")\n    AddType(0xa505, \"516E7CB8-6ECF-11D6-8FF8-00022D09712B\", \"FreeBSD Vinum/RAID\")\n    AddType(0xa506, \"74BA7DD9-A689-11E1-BD04-00E081286ACF\", \"FreeBSD nandfs\")\n\n    // Midnight BSD partition types....\n    AddType(0xa580, \"85D5E45A-237C-11E1-B4B3-E89A8F7FC3A7\", \"Midnight BSD data\")\n    AddType(0xa581, \"85D5E45E-237C-11E1-B4B3-E89A8F7FC3A7\", \"Midnight BSD boot\")\n    AddType(0xa582, \"85D5E45B-237C-11E1-B4B3-E89A8F7FC3A7\", \"Midnight BSD swap\")\n    AddType(0xa583, \"0394Ef8B-237E-11E1-B4B3-E89A8F7FC3A7\", \"Midnight BSD UFS\")\n    AddType(0xa584, \"85D5E45D-237C-11E1-B4B3-E89A8F7FC3A7\", \"Midnight BSD ZFS\")\n    AddType(0xa585, \"85D5E45C-237C-11E1-B4B3-E89A8F7FC3A7\", \"Midnight BSD Vinum\")\n\n    // OpenBSD partition type....\n    AddType(0xa600, \"824CC7A0-36A8-11E3-890A-952519AD3F61\", \"OpenBSD disklabel\")\n\n    // A MacOS partition type, separated from others by NetBSD partition types...\n    AddType(0xa800, \"55465300-0000-11AA-AA11-00306543ECAC\", \"Apple UFS\") // Mac OS X\n\n    // NetBSD partition types. Note that the main entry sets it up as a\n    // FreeBSD disklabel. I'm not 100% certain this is the correct behavior.\n    AddType(0xa900, \"516E7CB4-6ECF-11D6-8FF8-00022D09712B\", \"FreeBSD disklabel\", 0) // NetBSD disklabel\n    AddType(0xa901, \"49F48D32-B10E-11DC-B99B-0019D1879648\", \"NetBSD swap\")\n    AddType(0xa902, \"49F48D5A-B10E-11DC-B99B-0019D1879648\", \"NetBSD FFS\")\n    AddType(0xa903, \"49F48D82-B10E-11DC-B99B-0019D1879648\", \"NetBSD LFS\")\n    AddType(0xa904, \"2DB519C4-B10F-11DC-B99B-0019D1879648\", \"NetBSD concatenated\")\n    AddType(0xa905, \"2DB519EC-B10F-11DC-B99B-0019D1879648\", \"NetBSD encrypted\")\n    AddType(0xa906, \"49F48DAA-B10E-11DC-B99B-0019D1879648\", \"NetBSD RAID\")\n\n    // Mac OS partition types (See also 0xa800, above)....\n    AddType(0xab00, \"426F6F74-0000-11AA-AA11-00306543ECAC\", \"Recovery HD\")\n    AddType(0xaf00, \"48465300-0000-11AA-AA11-00306543ECAC\", \"Apple HFS/HFS+\")\n    AddType(0xaf01, \"52414944-0000-11AA-AA11-00306543ECAC\", \"Apple RAID\")\n    AddType(0xaf02, \"52414944-5F4F-11AA-AA11-00306543ECAC\", \"Apple RAID offline\")\n    AddType(0xaf03, \"4C616265-6C00-11AA-AA11-00306543ECAC\", \"Apple label\")\n    AddType(0xaf04, \"5265636F-7665-11AA-AA11-00306543ECAC\", \"AppleTV recovery\")\n    AddType(0xaf05, \"53746F72-6167-11AA-AA11-00306543ECAC\", \"Apple Core Storage\")\n    AddType(0xaf06, \"B6FA30DA-92D2-4A9A-96F1-871EC6486200\", \"Apple SoftRAID Status\")\n    AddType(0xaf07, \"2E313465-19B9-463F-8126-8A7993773801\", \"Apple SoftRAID Scratch\")\n    AddType(0xaf08, \"FA709C7E-65B1-4593-BFD5-E71D61DE9B02\", \"Apple SoftRAID Volume\")\n    AddType(0xaf09, \"BBBA6DF5-F46F-4A89-8F59-8765B2727503\", \"Apple SoftRAID Cache\")\n    AddType(0xaf0a, \"7C3457EF-0000-11AA-AA11-00306543ECAC\", \"Apple APFS\")\n    AddType(0xaf0b, \"69646961-6700-11AA-AA11-00306543ECAC\", \"Apple APFS Pre-Boot\")\n    AddType(0xaf0c, \"52637672-7900-11AA-AA11-00306543ECAC\", \"Apple APFS Recovery\")\n\n    // U-Boot boot loader; see https://lists.denx.de/pipermail/u-boot/2020-November/432928.html\n    // and https://source.denx.de/u-boot/u-boot/-/blob/v2021.07/include/part_efi.h#L59-61\n    AddType(0xb000, \"3DE21764-95BD-54BD-A5C3-4ABE786F38A8\", \"U-Boot boot loader\")\n\n    // QNX Power-Safe (QNX6)\n    AddType(0xb300, \"CEF5A9AD-73BC-4601-89F3-CDEEEEE321A1\", \"QNX6 Power-Safe\")\n\n    // Barebox boot loader; see https://barebox.org/doc/latest/user/state.html?highlight=guid#sd-emmc-and-ata\n    AddType(0xbb00, \"4778ED65-BF42-45FA-9C5B-287A1DC4AAB1\", \"Barebox boot loader\")\n\n    // Acronis Secure Zone\n    AddType(0xbc00, \"0311FC50-01CA-4725-AD77-9ADBB20ACE98\", \"Acronis Secure Zone\")\n\n    // Solaris partition types (one of which is shared with MacOS)\n    AddType(0xbe00, \"6A82CB45-1DD2-11B2-99A6-080020736631\", \"Solaris boot\")\n    AddType(0xbf00, \"6A85CF4D-1DD2-11B2-99A6-080020736631\", \"Solaris root\")\n    AddType(0xbf01, \"6A898CC3-1DD2-11B2-99A6-080020736631\", \"Solaris /usr & Mac ZFS\") // Solaris/MacOS\n    AddType(0xbf02, \"6A87C46F-1DD2-11B2-99A6-080020736631\", \"Solaris swap\")\n    AddType(0xbf03, \"6A8B642B-1DD2-11B2-99A6-080020736631\", \"Solaris backup\")\n    AddType(0xbf04, \"6A8EF2E9-1DD2-11B2-99A6-080020736631\", \"Solaris /var\")\n    AddType(0xbf05, \"6A90BA39-1DD2-11B2-99A6-080020736631\", \"Solaris /home\")\n    AddType(0xbf06, \"6A9283A5-1DD2-11B2-99A6-080020736631\", \"Solaris alternate sector\")\n    AddType(0xbf07, \"6A945A3B-1DD2-11B2-99A6-080020736631\", \"Solaris Reserved 1\")\n    AddType(0xbf08, \"6A9630D1-1DD2-11B2-99A6-080020736631\", \"Solaris Reserved 2\")\n    AddType(0xbf09, \"6A980767-1DD2-11B2-99A6-080020736631\", \"Solaris Reserved 3\")\n    AddType(0xbf0a, \"6A96237F-1DD2-11B2-99A6-080020736631\", \"Solaris Reserved 4\")\n    AddType(0xbf0b, \"6A8D2AC7-1DD2-11B2-99A6-080020736631\", \"Solaris Reserved 5\")\n\n    // I can find no MBR equivalents for these, but they're on the\n    // Wikipedia page for GPT, so here we go....\n    AddType(0xc001, \"75894C1E-3AEB-11D3-B7C1-7B03A0000000\", \"HP-UX data\")\n    AddType(0xc002, \"E2A1E728-32E3-11D6-A682-7B03A0000000\", \"HP-UX service\")\n\n    // Open Network Install Environment (ONIE) partitions....\n    AddType(0xe100, \"7412F7D5-A156-4B13-81DC-867174929325\", \"ONIE boot\")\n    AddType(0xe101, \"D4E6E2CD-4469-46F3-B5CB-1BFF57AFC149\", \"ONIE config\")\n\n    // Veracrypt (https://www.veracrypt.fr/en/Home.html) encrypted partition\n    AddType(0xe900, \"8C8F8EFF-AC95-4770-814A-21994F2DBC8F\", \"Veracrypt data\")\n\n    // See https://systemd.io/BOOT_LOADER_SPECIFICATION/\n    AddType(0xea00, \"BC13C2FF-59E6-4262-A352-B275FD6F7172\", \"XBOOTLDR partition\")\n\n    // Type code for Haiku; uses BeOS MBR code as hex code base\n    AddType(0xeb00, \"42465331-3BA3-10F1-802A-4861696B7521\", \"Haiku BFS\")\n\n    // Manufacturer-specific ESP-like partitions (in order in which they were added)\n    AddType(0xed00, \"F4019732-066E-4E12-8273-346C5641494F\", \"Sony system partition\")\n    AddType(0xed01, \"BFBFAFE7-A34F-448A-9A5B-6213EB736C22\", \"Lenovo system partition\")\n\n    // EFI system and related partitions\n    AddType(0xef00, \"C12A7328-F81F-11D2-BA4B-00A0C93EC93B\", \"EFI system partition\") // Parted identifies these as having the \"boot flag\" set\n    AddType(0xef01, \"024DEE41-33E7-11D3-9D69-0008C781F39F\", \"MBR partition scheme\") // Used to nest MBR in GPT\n    AddType(0xef02, \"21686148-6449-6E6F-744E-656564454649\", \"BIOS boot partition\") // Used by GRUB\n\n    // Fuscia OS codes; see https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/system/public/zircon/hw/gpt.h\n    AddType(0xf100, \"FE8A2634-5E2E-46BA-99E3-3A192091A350\", \"Fuchsia boot loader (slot A/B/R)\")\n    AddType(0xf101, \"D9FD4535-106C-4CEC-8D37-DFC020CA87CB\", \"Fuchsia durable mutable encrypted system data\")\n    AddType(0xf102, \"A409E16B-78AA-4ACC-995C-302352621A41\", \"Fuchsia durable mutable boot loader\")\n    AddType(0xf103, \"F95D940E-CABA-4578-9B93-BB6C90F29D3E\", \"Fuchsia factory ro system data\")\n    AddType(0xf104, \"10B8DBAA-D2BF-42A9-98C6-A7C5DB3701E7\", \"Fuchsia factory ro bootloader data\")\n    AddType(0xf105, \"49FD7CB8-DF15-4E73-B9D9-992070127F0F\", \"Fuchsia Volume Manager\")\n    AddType(0xf106, \"421A8BFC-85D9-4D85-ACDA-B64EEC0133E9\", \"Fuchsia verified boot metadata (slot A/B/R)\")\n    AddType(0xf107, \"9B37FFF6-2E58-466A-983A-F7926D0B04E0\", \"Fuchsia Zircon boot image (slot A/B/R)\")\n    AddType(0xf108, \"C12A7328-F81F-11D2-BA4B-00A0C93EC93B\", \"Fuchsia ESP\")\n    AddType(0xf109, \"606B000B-B7C7-4653-A7D5-B737332C899D\", \"Fuchsia System\")\n    AddType(0xf10a, \"08185F0C-892D-428A-A789-DBEEC8F55E6A\", \"Fuchsia Data\")\n    AddType(0xf10b, \"48435546-4953-2041-494E-5354414C4C52\", \"Fuchsia Install\")\n    AddType(0xf10c, \"2967380E-134C-4CBB-B6DA-17E7CE1CA45D\", \"Fuchsia Blob\")\n    AddType(0xf10d, \"41D0E340-57E3-954E-8C1E-17ECAC44CFF5\", \"Fuchsia FVM\")\n    AddType(0xf10e, \"DE30CC86-1F4A-4A31-93C4-66F147D33E05\", \"Fuchsia Zircon boot image (slot A)\")\n    AddType(0xf10f, \"23CC04DF-C278-4CE7-8471-897D1A4BCDF7\", \"Fuchsia Zircon boot image (slot B)\")\n    AddType(0xf110, \"A0E5CF57-2DEF-46BE-A80C-A2067C37CD49\", \"Fuchsia Zircon boot image (slot R)\")\n    AddType(0xf111, \"4E5E989E-4C86-11E8-A15B-480FCF35F8E6\", \"Fuchsia sys-config\")\n    AddType(0xf112, \"5A3A90BE-4C86-11E8-A15B-480FCF35F8E6\", \"Fuchsia factory-config\")\n    AddType(0xf113, \"5ECE94FE-4C86-11E8-A15B-480FCF35F8E6\", \"Fuchsia bootloader\")\n    AddType(0xf114, \"8B94D043-30BE-4871-9DFA-D69556E8C1F3\", \"Fuchsia guid-test\")\n    AddType(0xf115, \"A13B4D9A-EC5F-11E8-97D8-6C3BE52705BF\", \"Fuchsia verified boot metadata (A)\")\n    AddType(0xf116, \"A288ABF2-EC5F-11E8-97D8-6C3BE52705BF\", \"Fuchsia verified boot metadata (B)\")\n    AddType(0xf117, \"6A2460C3-CD11-4E8B-80A8-12CCE268ED0A\", \"Fuchsia verified boot metadata (R)\")\n    AddType(0xf118, \"1D75395D-F2C6-476B-A8B7-45CC1C97B476\", \"Fuchsia misc\")\n    AddType(0xf119, \"900B0FC5-90CD-4D4F-84F9-9F8ED579DB88\", \"Fuchsia emmc-boot1\")\n    AddType(0xf11a, \"B2B2E8D1-7C10-4EBC-A2D0-4614568260AD\", \"Fuchsia emmc-boot2\")\n\n    // Ceph type codes; see https://github.com/ceph/ceph/blob/9bcc42a3e6b08521694b5c0228b2c6ed7b3d312e/src/ceph-disk#L76-L81\n    // and Wikipedia\n    AddType(0xf800, \"4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D\", \"Ceph OSD\") // Ceph Object Storage Daemon\n    AddType(0xf801, \"4FBD7E29-9D25-41B8-AFD0-5EC00CEFF05D\", \"Ceph dm-crypt OSD\") // Ceph Object Storage Daemon (encrypted)\n    AddType(0xf802, \"45B0969E-9B03-4F30-B4C6-B4B80CEFF106\", \"Ceph journal\")\n    AddType(0xf803, \"45B0969E-9B03-4F30-B4C6-5EC00CEFF106\", \"Ceph dm-crypt journal\")\n    AddType(0xf804, \"89C57F98-2FE5-4DC0-89C1-F3AD0CEFF2BE\", \"Ceph disk in creation\")\n    AddType(0xf805, \"89C57F98-2FE5-4DC0-89C1-5EC00CEFF2BE\", \"Ceph dm-crypt disk in creation\")\n    AddType(0xf806, \"CAFECAFE-9B03-4F30-B4C6-B4B80CEFF106\", \"Ceph block\")\n    AddType(0xf807, \"30CD0809-C2B2-499C-8879-2D6B78529876\", \"Ceph block DB\")\n    AddType(0xf808, \"5CE17FCE-4087-4169-B7FF-056CC58473F9\", \"Ceph block write-ahead log\")\n    AddType(0xf809, \"FB3AABF9-D25F-47CC-BF5E-721D1816496B\", \"Ceph lockbox for dm-crypt keys\")\n    AddType(0xf80a, \"4FBD7E29-8AE0-4982-BF9D-5A8D867AF560\", \"Ceph multipath OSD\")\n    AddType(0xf80b, \"45B0969E-8AE0-4982-BF9D-5A8D867AF560\", \"Ceph multipath journal\")\n    AddType(0xf80c, \"CAFECAFE-8AE0-4982-BF9D-5A8D867AF560\", \"Ceph multipath block 1\")\n    AddType(0xf80d, \"7F4A666A-16F3-47A2-8445-152EF4D03F6C\", \"Ceph multipath block 2\")\n    AddType(0xf80e, \"EC6D6385-E346-45DC-BE91-DA2A7C8B3261\", \"Ceph multipath block DB\")\n    AddType(0xf80f, \"01B41E1B-002A-453C-9F17-88793989FF8F\", \"Ceph multipath block write-ahead log\")\n    AddType(0xf810, \"CAFECAFE-9B03-4F30-B4C6-5EC00CEFF106\", \"Ceph dm-crypt block\")\n    AddType(0xf811, \"93B0052D-02D9-4D8A-A43B-33A3EE4DFBC3\", \"Ceph dm-crypt block DB\")\n    AddType(0xf812, \"306E8683-4FE2-4330-B7C0-00A917C16966\", \"Ceph dm-crypt block write-ahead log\")\n    AddType(0xf813, \"45B0969E-9B03-4F30-B4C6-35865CEFF106\", \"Ceph dm-crypt LUKS journal\")\n    AddType(0xf814, \"CAFECAFE-9B03-4F30-B4C6-35865CEFF106\", \"Ceph dm-crypt LUKS block\")\n    AddType(0xf815, \"166418DA-C469-4022-ADF4-B30AFD37F176\", \"Ceph dm-crypt LUKS block DB\")\n    AddType(0xf816, \"86A32090-3647-40B9-BBBD-38D8C573AA86\", \"Ceph dm-crypt LUKS block write-ahead log\")\n    AddType(0xf817, \"4FBD7E29-9D25-41B8-AFD0-35865CEFF05D\", \"Ceph dm-crypt LUKS OSD\")\n\n    // VMWare ESX partition types codes\n    AddType(0xfb00, \"AA31E02A-400F-11DB-9590-000C2911D1B8\", \"VMWare VMFS\")\n    AddType(0xfb01, \"9198EFFC-31C0-11DB-8F78-000C2911D1B8\", \"VMWare reserved\")\n    AddType(0xfc00, \"9D275380-40AD-11DB-BF97-000C2911D1B8\", \"VMWare kcore crash protection\")\n\n    // A straggler Linux partition type....\n    AddType(0xfd00, \"A19D880F-05FC-4D3B-A006-743F0F84911E\", \"Linux RAID\")\n};\n#undef AddType\n\nstatic inline const gpt_type_entry_t* gpt_type_lookup(uint16_t code)\n{\n    for (int i = 0; i < ARRAYSIZE(gpt_type_table); i++) {\n        if (gpt_type_table[i].code == code)\n            return &gpt_type_table[i];\n    }\n    return NULL;\n}\n\nstatic inline const char* gpt_type_desc(const GUID* guid)\n{\n    const char* guid_str = GuidToString(guid, TRUE);\n    if (guid_str == NULL)\n        return NULL;\n    for (int i = 0; i < ARRAYSIZE(gpt_type_table); i++) {\n        if (_strnicmp(&guid_str[1], gpt_type_table[i].guid_str, 36) == 0)\n            return gpt_type_table[i].description;\n    }\n    return NULL;\n}\n\nstatic inline const char* gpt_type_guid_str(uint16_t code)\n{\n    const gpt_type_entry_t* e = gpt_type_lookup(code);\n    return (e != NULL) ? e->guid_str : NULL;\n}\n\nstatic inline const char* gpt_type_description(uint16_t code)\n{\n    const gpt_type_entry_t* e = gpt_type_lookup(code);\n    return (e != NULL) ? e->description : NULL;\n}\n\nstatic inline GUID gpt_type_guid(uint16_t code)\n{\n    return StringToGuid(gpt_type_guid_str(code));\n}\n\n// Also redefine the constant GUIDs we use in the application\nDEFINE_GUID(PARTITION_GENERIC_ESP, 0xC12A7328, 0xF81F, 0x11D2, 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B);\nDEFINE_GUID(PARTITION_LINUX_DATA, 0x0FC63DAF, 0x8483, 0x4772, 0x8E, 0x79, 0x3D, 0x69, 0xD8, 0x47, 0x7D, 0xE4);\nDEFINE_GUID(PARTITION_MICROSOFT_DATA, 0xEBD0A0A2, 0xB9E5, 0x4433, 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7);\nDEFINE_GUID(PARTITION_MICROSOFT_RESERVED, 0xE3C9E316, 0x0B5C, 0x4DB8, 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE);\n"
  },
  {
    "path": "src/hash.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Message-Digest algorithms (md5sum, sha1sum, sha256sum, sha512sum)\n * Copyright © 1998-2001 Free Software Foundation, Inc.\n * Copyright © 2004-2019 Tom St Denis\n * Copyright © 2004 g10 Code GmbH\n * Copyright © 2002-2015 Wei Dai & Igor Pavlov\n * Copyright © 2015-2025 Pete Batard <pete@akeo.ie>\n * Copyright © 2022 Jeffrey Walton <noloader@gmail.com>\n * Copyright © 2016 Alexander Graf\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/*\n * SHA-1 code taken from GnuPG, as per copyrights above.\n *\n * SHA-256 taken from 7-zip's Sha256.c, itself based on Crypto++ - Public Domain\n *\n * SHA-512 modified from LibTomCrypt - Public Domain\n *\n * PE256 modified from u-boot's efi_image_loader.c - GPLv2.0+\n *\n * CPU accelerated SHA code taken from SHA-Intrinsics - Public Domain\n *\n * MD5 code from various public domain sources sharing the following\n * copyright declaration:\n *\n * This code implements the MD5 message-digest algorithm.\n * The algorithm is due to Ron Rivest.  This code was\n * written by Colin Plumb in 1993, no copyright is claimed.\n * This code is in the public domain; do with it what you wish.\n *\n * Equivalent code is available from RSA Data Security, Inc.\n * This code has been tested against that, and is equivalent,\n * except that you don't need to include two pages of legalese\n * with every copy.\n *\n * To compute the message digest of a chunk of bytes, declare an\n * MD5Context structure, pass it to MD5Init, call MD5Update as\n * needed on buffers full of bytes, and then call MD5Final, which\n * will fill a supplied 16-byte array with the digest.\n */\n\n /* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <stdio.h>\n#include <assert.h>\n#include <stdlib.h>\n#include <string.h>\n#include <inttypes.h>\n#include <errno.h>\n#include <intrin.h>\n#include <windows.h>\n#include <windowsx.h>\n\n#include \"db.h\"\n#include \"efi.h\"\n#include \"rufus.h\"\n#include \"winio.h\"\n#include \"missing.h\"\n#include \"darkmode.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n\n#if (defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || \\\n     defined(_X86_) || defined(__I86__) || defined(__x86_64__))\n#define CPU_X86_SHA1_ACCELERATION       1\n#define CPU_X86_SHA256_ACCELERATION     1\n#endif\n\n#if defined(_MSC_VER)\n#define RUFUS_ENABLE_GCC_ARCH(arch)\n#else\n#define RUFUS_ENABLE_GCC_ARCH(arch) __attribute__ ((target (arch)))\n#endif\n\n#undef BIG_ENDIAN_HOST\n\n#define BUFFER_SIZE         (64*KB)\n#define WAIT_TIME           5000\n\n/* Number of buffers we work with */\n#define NUM_BUFFERS         3   // 2 + 1 as a mere double buffered async I/O\n                                // would modify the buffer being processed.\n\n/* Globals */\nchar hash_str[HASH_MAX][150];\nHANDLE data_ready[HASH_MAX] = { 0 }, thread_ready[HASH_MAX] = { 0 };\nDWORD read_size[NUM_BUFFERS];\nBOOL enable_extra_hashes = FALSE, validate_md5sum = FALSE;\nBOOL cpu_has_sha1_accel = FALSE, cpu_has_sha256_accel = FALSE;\nuint8_t ALIGNED(64) buffer[NUM_BUFFERS][BUFFER_SIZE];\nuint8_t* pe256ssp = NULL;\nuint32_t proc_bufnum, hash_count[HASH_MAX] = { MD5_HASHSIZE, SHA1_HASHSIZE, SHA256_HASHSIZE, SHA512_HASHSIZE };\nuint32_t pe256ssp_size = 0;\nuint64_t md5sum_totalbytes;\nStrArray modified_files = { 0 };\n\nextern int default_thread_priority;\nextern const char* efi_archname[ARCH_MAX];\nextern char *sbat_level_txt, *sb_active_txt, *sb_revoked_txt;\nextern BOOL expert_mode, usb_debug;\n\n/*\n * Detect if the processor supports SHA-1 acceleration. We only check for\n * the three ISAs we need - SSSE3, SSE4.1 and SHA. We don't check for OS\n * support or XSAVE because that's been enabled since Windows 2000.\n */\nBOOL DetectSHA1Acceleration(void)\n{\n#if defined(CPU_X86_SHA1_ACCELERATION)\n#if defined(_MSC_VER)\n\tuint32_t regs0[4] = { 0,0,0,0 }, regs1[4] = { 0,0,0,0 }, regs7[4] = { 0,0,0,0 };\n\tconst uint32_t SSSE3_BIT = 1u << 9; /* Function 1, Bit  9 of ECX */\n\tconst uint32_t SSE41_BIT = 1u << 19; /* Function 1, Bit 19 of ECX */\n\tconst uint32_t SHA_BIT = 1u << 29; /* Function 7, Bit 29 of EBX */\n\n\t__cpuid(regs0, 0);\n\tconst uint32_t highest = regs0[0]; /*EAX*/\n\n\tif (highest >= 0x01) {\n\t\t__cpuidex(regs1, 1, 0);\n\t}\n\tif (highest >= 0x07) {\n\t\t__cpuidex(regs7, 7, 0);\n\t}\n\n\treturn (regs1[2] /*ECX*/ & SSSE3_BIT) && (regs1[2] /*ECX*/ & SSE41_BIT) && (regs7[1] /*EBX*/ & SHA_BIT) ? TRUE : FALSE;\n#elif defined(__GNUC__) || defined(__clang__)\n\t/* __builtin_cpu_supports available in GCC 4.8.1 and above */\n\treturn __builtin_cpu_supports(\"ssse3\") && __builtin_cpu_supports(\"sse4.1\") && __builtin_cpu_supports(\"sha\") ? TRUE : FALSE;\n#else\n\treturn FALSE;\n#endif\n#else\n\treturn FALSE;\n#endif\n}\n\n/*\n * Detect if the processor supports SHA-256 acceleration. We only check for\n * the three ISAs we need - SSSE3, SSE4.1 and SHA. We don't check for OS\n * support or XSAVE because that's been enabled since Windows 2000.\n */\nBOOL DetectSHA256Acceleration(void)\n{\n#if defined(CPU_X86_SHA256_ACCELERATION)\n#if defined(_MSC_VER)\n\tuint32_t regs0[4] = { 0,0,0,0 }, regs1[4] = { 0,0,0,0 }, regs7[4] = { 0,0,0,0 };\n\tconst uint32_t SSSE3_BIT = 1u << 9; /* Function 1, Bit  9 of ECX */\n\tconst uint32_t SSE41_BIT = 1u << 19; /* Function 1, Bit 19 of ECX */\n\tconst uint32_t SHA_BIT = 1u << 29; /* Function 7, Bit 29 of EBX */\n\n\t__cpuid(regs0, 0);\n\tconst uint32_t highest = regs0[0]; /*EAX*/\n\n\tif (highest >= 0x01) {\n\t\t__cpuidex(regs1, 1, 0);\n\t}\n\tif (highest >= 0x07) {\n\t\t__cpuidex(regs7, 7, 0);\n\t}\n\n\treturn (regs1[2] /*ECX*/ & SSSE3_BIT) && (regs1[2] /*ECX*/ & SSE41_BIT) && (regs7[1] /*EBX*/ & SHA_BIT) ? TRUE : FALSE;\n#elif defined(__GNUC__) || defined(__clang__)\n\t/* __builtin_cpu_supports available in GCC 4.8.1 and above */\n\treturn __builtin_cpu_supports(\"ssse3\") && __builtin_cpu_supports(\"sse4.1\") && __builtin_cpu_supports(\"sha\") ? TRUE : FALSE;\n#else\n\treturn FALSE;\n#endif\n#else\n\treturn FALSE;\n#endif\n}\n\n/*\n * Rotate 32 or 64 bit integers by n bytes.\n * Don't bother trying to hand-optimize those, as the\n * compiler usually does a pretty good job at that.\n */\n#define ROL32(a,b) (((a) << (b)) | ((a) >> (32-(b))))\n#define ROR32(a,b) (((a) >> (b)) | ((a) << (32-(b))))\n#define ROL64(a,b) (((a) << (b)) | ((a) >> (64-(b))))\n#define ROR64(a,b) (((a) >> (b)) | ((a) << (64-(b))))\n\n/*\n * SHA-256, SHA-512 common macros (use Wikipedia SHA-2 names for clarity)\n */\n#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))\n#define Ma(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))\n\n/* SHA-256 constants */\nstatic const uint32_t K256[64] = {\n\t0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n\t0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n\t0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n\t0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n\t0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n\t0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n\t0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n\t0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n};\n\n/* SHA-512 constants */\nstatic const uint64_t K512[80] = {\n\t0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL,\n\t0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL,\n\t0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL,\n\t0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL,\n\t0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL,\n\t0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL,\n\t0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL,\n\t0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL,\n\t0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL,\n\t0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL,\n\t0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL,\n\t0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL,\n\t0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL,\n\t0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL,\n\t0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL,\n\t0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL,\n\t0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL,\n\t0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL,\n\t0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL,\n\t0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL\n};\n\nstatic void md5_init(HASH_CONTEXT *ctx)\n{\n\tmemset(ctx, 0, sizeof(*ctx));\n\tctx->state[0] = 0x67452301;\n\tctx->state[1] = 0xefcdab89;\n\tctx->state[2] = 0x98badcfe;\n\tctx->state[3] = 0x10325476;\n}\n\nstatic void sha1_init(HASH_CONTEXT *ctx)\n{\n\tmemset(ctx, 0, sizeof(*ctx));\n\tctx->state[0] = 0x67452301;\n\tctx->state[1] = 0xefcdab89;\n\tctx->state[2] = 0x98badcfe;\n\tctx->state[3] = 0x10325476;\n\tctx->state[4] = 0xc3d2e1f0;\n}\n\nstatic void sha256_init(HASH_CONTEXT *ctx)\n{\n\tmemset(ctx, 0, sizeof(*ctx));\n\tctx->state[0] = 0x6a09e667;\n\tctx->state[1] = 0xbb67ae85;\n\tctx->state[2] = 0x3c6ef372;\n\tctx->state[3] = 0xa54ff53a;\n\tctx->state[4] = 0x510e527f;\n\tctx->state[5] = 0x9b05688c;\n\tctx->state[6] = 0x1f83d9ab;\n\tctx->state[7] = 0x5be0cd19;\n}\n\nstatic void sha512_init(HASH_CONTEXT* ctx)\n{\n\tmemset(ctx, 0, sizeof(*ctx));\n\tctx->state[0] = 0x6a09e667f3bcc908ULL;\n\tctx->state[1] = 0xbb67ae8584caa73bULL;\n\tctx->state[2] = 0x3c6ef372fe94f82bULL;\n\tctx->state[3] = 0xa54ff53a5f1d36f1ULL;\n\tctx->state[4] = 0x510e527fade682d1ULL;\n\tctx->state[5] = 0x9b05688c2b3e6c1fULL;\n\tctx->state[6] = 0x1f83d9abfb41bd6bULL;\n\tctx->state[7] = 0x5be0cd19137e2179ULL;\n}\n\n/* Transform the message X which consists of 16 32-bit-words (SHA-1) */\nstatic void sha1_transform_cc(HASH_CONTEXT *ctx, const uint8_t *data)\n{\n\tuint32_t a, b, c, d, e, tm, x[16];\n\n\t/* get values from the chaining vars */\n\ta = (uint32_t)ctx->state[0];\n\tb = (uint32_t)ctx->state[1];\n\tc = (uint32_t)ctx->state[2];\n\td = (uint32_t)ctx->state[3];\n\te = (uint32_t)ctx->state[4];\n\n#ifdef BIG_ENDIAN_HOST\n\tmemcpy(x, data, sizeof(x));\n#else\n\t{\n\t\tunsigned k;\n\t\tfor (k = 0; k < 16; k += 4) {\n\t\t\tconst uint8_t *p2 = data + k * 4;\n\t\t\tx[k] = read_swap32(p2);\n\t\t\tx[k + 1] = read_swap32(p2 + 4);\n\t\t\tx[k + 2] = read_swap32(p2 + 8);\n\t\t\tx[k + 3] = read_swap32(p2 + 12);\n\t\t}\n\t}\n#endif\n\n#define K1  0x5a827999L\n#define K2  0x6ed9eba1L\n#define K3  0x8f1bbcdcL\n#define K4  0xca62c1d6L\n#define F1(x,y,z)   ( z ^ ( x & ( y ^ z ) ) )\n#define F2(x,y,z)   ( x ^ y ^ z )\n#define F3(x,y,z)   ( ( x & y ) | ( z & ( x | y ) ) )\n#define F4(x,y,z)   ( x ^ y ^ z )\n\n#define M(i) ( tm = x[i&0x0f] ^ x[(i-14)&0x0f] ^ x[(i-8)&0x0f] ^ x[(i-3)&0x0f], (x[i&0x0f] = ROL32(tm,1)) )\n\n#define SHA1STEP(a, b, c, d, e, f, k, m) do { e += ROL32(a, 5) + f(b, c, d) + k + m; \\\n                                              b = ROL32(b, 30); } while(0)\n\tSHA1STEP(a, b, c, d, e, F1, K1, x[0]);\n\tSHA1STEP(e, a, b, c, d, F1, K1, x[1]);\n\tSHA1STEP(d, e, a, b, c, F1, K1, x[2]);\n\tSHA1STEP(c, d, e, a, b, F1, K1, x[3]);\n\tSHA1STEP(b, c, d, e, a, F1, K1, x[4]);\n\tSHA1STEP(a, b, c, d, e, F1, K1, x[5]);\n\tSHA1STEP(e, a, b, c, d, F1, K1, x[6]);\n\tSHA1STEP(d, e, a, b, c, F1, K1, x[7]);\n\tSHA1STEP(c, d, e, a, b, F1, K1, x[8]);\n\tSHA1STEP(b, c, d, e, a, F1, K1, x[9]);\n\tSHA1STEP(a, b, c, d, e, F1, K1, x[10]);\n\tSHA1STEP(e, a, b, c, d, F1, K1, x[11]);\n\tSHA1STEP(d, e, a, b, c, F1, K1, x[12]);\n\tSHA1STEP(c, d, e, a, b, F1, K1, x[13]);\n\tSHA1STEP(b, c, d, e, a, F1, K1, x[14]);\n\tSHA1STEP(a, b, c, d, e, F1, K1, x[15]);\n\tSHA1STEP(e, a, b, c, d, F1, K1, M(16));\n\tSHA1STEP(d, e, a, b, c, F1, K1, M(17));\n\tSHA1STEP(c, d, e, a, b, F1, K1, M(18));\n\tSHA1STEP(b, c, d, e, a, F1, K1, M(19));\n\tSHA1STEP(a, b, c, d, e, F2, K2, M(20));\n\tSHA1STEP(e, a, b, c, d, F2, K2, M(21));\n\tSHA1STEP(d, e, a, b, c, F2, K2, M(22));\n\tSHA1STEP(c, d, e, a, b, F2, K2, M(23));\n\tSHA1STEP(b, c, d, e, a, F2, K2, M(24));\n\tSHA1STEP(a, b, c, d, e, F2, K2, M(25));\n\tSHA1STEP(e, a, b, c, d, F2, K2, M(26));\n\tSHA1STEP(d, e, a, b, c, F2, K2, M(27));\n\tSHA1STEP(c, d, e, a, b, F2, K2, M(28));\n\tSHA1STEP(b, c, d, e, a, F2, K2, M(29));\n\tSHA1STEP(a, b, c, d, e, F2, K2, M(30));\n\tSHA1STEP(e, a, b, c, d, F2, K2, M(31));\n\tSHA1STEP(d, e, a, b, c, F2, K2, M(32));\n\tSHA1STEP(c, d, e, a, b, F2, K2, M(33));\n\tSHA1STEP(b, c, d, e, a, F2, K2, M(34));\n\tSHA1STEP(a, b, c, d, e, F2, K2, M(35));\n\tSHA1STEP(e, a, b, c, d, F2, K2, M(36));\n\tSHA1STEP(d, e, a, b, c, F2, K2, M(37));\n\tSHA1STEP(c, d, e, a, b, F2, K2, M(38));\n\tSHA1STEP(b, c, d, e, a, F2, K2, M(39));\n\tSHA1STEP(a, b, c, d, e, F3, K3, M(40));\n\tSHA1STEP(e, a, b, c, d, F3, K3, M(41));\n\tSHA1STEP(d, e, a, b, c, F3, K3, M(42));\n\tSHA1STEP(c, d, e, a, b, F3, K3, M(43));\n\tSHA1STEP(b, c, d, e, a, F3, K3, M(44));\n\tSHA1STEP(a, b, c, d, e, F3, K3, M(45));\n\tSHA1STEP(e, a, b, c, d, F3, K3, M(46));\n\tSHA1STEP(d, e, a, b, c, F3, K3, M(47));\n\tSHA1STEP(c, d, e, a, b, F3, K3, M(48));\n\tSHA1STEP(b, c, d, e, a, F3, K3, M(49));\n\tSHA1STEP(a, b, c, d, e, F3, K3, M(50));\n\tSHA1STEP(e, a, b, c, d, F3, K3, M(51));\n\tSHA1STEP(d, e, a, b, c, F3, K3, M(52));\n\tSHA1STEP(c, d, e, a, b, F3, K3, M(53));\n\tSHA1STEP(b, c, d, e, a, F3, K3, M(54));\n\tSHA1STEP(a, b, c, d, e, F3, K3, M(55));\n\tSHA1STEP(e, a, b, c, d, F3, K3, M(56));\n\tSHA1STEP(d, e, a, b, c, F3, K3, M(57));\n\tSHA1STEP(c, d, e, a, b, F3, K3, M(58));\n\tSHA1STEP(b, c, d, e, a, F3, K3, M(59));\n\tSHA1STEP(a, b, c, d, e, F4, K4, M(60));\n\tSHA1STEP(e, a, b, c, d, F4, K4, M(61));\n\tSHA1STEP(d, e, a, b, c, F4, K4, M(62));\n\tSHA1STEP(c, d, e, a, b, F4, K4, M(63));\n\tSHA1STEP(b, c, d, e, a, F4, K4, M(64));\n\tSHA1STEP(a, b, c, d, e, F4, K4, M(65));\n\tSHA1STEP(e, a, b, c, d, F4, K4, M(66));\n\tSHA1STEP(d, e, a, b, c, F4, K4, M(67));\n\tSHA1STEP(c, d, e, a, b, F4, K4, M(68));\n\tSHA1STEP(b, c, d, e, a, F4, K4, M(69));\n\tSHA1STEP(a, b, c, d, e, F4, K4, M(70));\n\tSHA1STEP(e, a, b, c, d, F4, K4, M(71));\n\tSHA1STEP(d, e, a, b, c, F4, K4, M(72));\n\tSHA1STEP(c, d, e, a, b, F4, K4, M(73));\n\tSHA1STEP(b, c, d, e, a, F4, K4, M(74));\n\tSHA1STEP(a, b, c, d, e, F4, K4, M(75));\n\tSHA1STEP(e, a, b, c, d, F4, K4, M(76));\n\tSHA1STEP(d, e, a, b, c, F4, K4, M(77));\n\tSHA1STEP(c, d, e, a, b, F4, K4, M(78));\n\tSHA1STEP(b, c, d, e, a, F4, K4, M(79));\n\n#undef F1\n#undef F2\n#undef F3\n#undef F4\n\n\t/* Update chaining vars */\n\tctx->state[0] += a;\n\tctx->state[1] += b;\n\tctx->state[2] += c;\n\tctx->state[3] += d;\n\tctx->state[4] += e;\n}\n\n#ifdef CPU_X86_SHA1_ACCELERATION\n/*\n * Transform the message X which consists of 16 32-bit-words (SHA-1)\n * The code is public domain taken from https://github.com/noloader/SHA-Intrinsics.\n */\nRUFUS_ENABLE_GCC_ARCH(\"ssse3,sse4.1,sha\")\nstatic void sha1_transform_x86(uint64_t state64[5], const uint8_t *data, size_t length)\n{\n\t__m128i ABCD, E0, E1;\n\t__m128i MSG0, MSG1, MSG2, MSG3;\n\tconst __m128i MASK = _mm_set_epi64x(0x0001020304050607ULL, 0x08090a0b0c0d0e0fULL);\n\n\t/* Rufus uses uint64_t for the state array. Pack it into uint32_t. */\n\tuint32_t state[5] = {\n\t\t(uint32_t)state64[0],\n\t\t(uint32_t)state64[1],\n\t\t(uint32_t)state64[2],\n\t\t(uint32_t)state64[3],\n\t\t(uint32_t)state64[4]\n\t};\n\n\t/* Load initial values */\n\tABCD = _mm_loadu_si128((const __m128i*) state);\n\tE0 = _mm_set_epi32(state[4], 0, 0, 0);\n\tABCD = _mm_shuffle_epi32(ABCD, 0x1B);\n\n\twhile (length >= SHA1_BLOCKSIZE)\n\t{\n\t\t/* Save current state  */\n\t\tconst __m128i ABCD_SAVE = ABCD;\n\t\tconst __m128i E0_SAVE = E0;\n\n\t\t/* Rounds 0-3 */\n\t\tMSG0 = _mm_loadu_si128((const __m128i*)(data + 0));\n\t\tMSG0 = _mm_shuffle_epi8(MSG0, MASK);\n\t\tE0 = _mm_add_epi32(E0, MSG0);\n\t\tE1 = ABCD;\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E0, 0);\n\n\t\t/* Rounds 4-7 */\n\t\tMSG1 = _mm_loadu_si128((const __m128i*)(data + 16));\n\t\tMSG1 = _mm_shuffle_epi8(MSG1, MASK);\n\t\tE1 = _mm_sha1nexte_epu32(E1, MSG1);\n\t\tE0 = ABCD;\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E1, 0);\n\t\tMSG0 = _mm_sha1msg1_epu32(MSG0, MSG1);\n\n\t\t/* Rounds 8-11 */\n\t\tMSG2 = _mm_loadu_si128((const __m128i*)(data + 32));\n\t\tMSG2 = _mm_shuffle_epi8(MSG2, MASK);\n\t\tE0 = _mm_sha1nexte_epu32(E0, MSG2);\n\t\tE1 = ABCD;\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E0, 0);\n\t\tMSG1 = _mm_sha1msg1_epu32(MSG1, MSG2);\n\t\tMSG0 = _mm_xor_si128(MSG0, MSG2);\n\n\t\t/* Rounds 12-15 */\n\t\tMSG3 = _mm_loadu_si128((const __m128i*)(data + 48));\n\t\tMSG3 = _mm_shuffle_epi8(MSG3, MASK);\n\t\tE1 = _mm_sha1nexte_epu32(E1, MSG3);\n\t\tE0 = ABCD;\n\t\tMSG0 = _mm_sha1msg2_epu32(MSG0, MSG3);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E1, 0);\n\t\tMSG2 = _mm_sha1msg1_epu32(MSG2, MSG3);\n\t\tMSG1 = _mm_xor_si128(MSG1, MSG3);\n\n\t\t/* Rounds 16-19 */\n\t\tE0 = _mm_sha1nexte_epu32(E0, MSG0);\n\t\tE1 = ABCD;\n\t\tMSG1 = _mm_sha1msg2_epu32(MSG1, MSG0);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E0, 0);\n\t\tMSG3 = _mm_sha1msg1_epu32(MSG3, MSG0);\n\t\tMSG2 = _mm_xor_si128(MSG2, MSG0);\n\n\t\t/* Rounds 20-23 */\n\t\tE1 = _mm_sha1nexte_epu32(E1, MSG1);\n\t\tE0 = ABCD;\n\t\tMSG2 = _mm_sha1msg2_epu32(MSG2, MSG1);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E1, 1);\n\t\tMSG0 = _mm_sha1msg1_epu32(MSG0, MSG1);\n\t\tMSG3 = _mm_xor_si128(MSG3, MSG1);\n\n\t\t/* Rounds 24-27 */\n\t\tE0 = _mm_sha1nexte_epu32(E0, MSG2);\n\t\tE1 = ABCD;\n\t\tMSG3 = _mm_sha1msg2_epu32(MSG3, MSG2);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E0, 1);\n\t\tMSG1 = _mm_sha1msg1_epu32(MSG1, MSG2);\n\t\tMSG0 = _mm_xor_si128(MSG0, MSG2);\n\n\t\t/* Rounds 28-31 */\n\t\tE1 = _mm_sha1nexte_epu32(E1, MSG3);\n\t\tE0 = ABCD;\n\t\tMSG0 = _mm_sha1msg2_epu32(MSG0, MSG3);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E1, 1);\n\t\tMSG2 = _mm_sha1msg1_epu32(MSG2, MSG3);\n\t\tMSG1 = _mm_xor_si128(MSG1, MSG3);\n\n\t\t/* Rounds 32-35 */\n\t\tE0 = _mm_sha1nexte_epu32(E0, MSG0);\n\t\tE1 = ABCD;\n\t\tMSG1 = _mm_sha1msg2_epu32(MSG1, MSG0);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E0, 1);\n\t\tMSG3 = _mm_sha1msg1_epu32(MSG3, MSG0);\n\t\tMSG2 = _mm_xor_si128(MSG2, MSG0);\n\n\t\t/* Rounds 36-39 */\n\t\tE1 = _mm_sha1nexte_epu32(E1, MSG1);\n\t\tE0 = ABCD;\n\t\tMSG2 = _mm_sha1msg2_epu32(MSG2, MSG1);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E1, 1);\n\t\tMSG0 = _mm_sha1msg1_epu32(MSG0, MSG1);\n\t\tMSG3 = _mm_xor_si128(MSG3, MSG1);\n\n\t\t/* Rounds 40-43 */\n\t\tE0 = _mm_sha1nexte_epu32(E0, MSG2);\n\t\tE1 = ABCD;\n\t\tMSG3 = _mm_sha1msg2_epu32(MSG3, MSG2);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E0, 2);\n\t\tMSG1 = _mm_sha1msg1_epu32(MSG1, MSG2);\n\t\tMSG0 = _mm_xor_si128(MSG0, MSG2);\n\n\t\t/* Rounds 44-47 */\n\t\tE1 = _mm_sha1nexte_epu32(E1, MSG3);\n\t\tE0 = ABCD;\n\t\tMSG0 = _mm_sha1msg2_epu32(MSG0, MSG3);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E1, 2);\n\t\tMSG2 = _mm_sha1msg1_epu32(MSG2, MSG3);\n\t\tMSG1 = _mm_xor_si128(MSG1, MSG3);\n\n\t\t/* Rounds 48-51 */\n\t\tE0 = _mm_sha1nexte_epu32(E0, MSG0);\n\t\tE1 = ABCD;\n\t\tMSG1 = _mm_sha1msg2_epu32(MSG1, MSG0);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E0, 2);\n\t\tMSG3 = _mm_sha1msg1_epu32(MSG3, MSG0);\n\t\tMSG2 = _mm_xor_si128(MSG2, MSG0);\n\n\t\t/* Rounds 52-55 */\n\t\tE1 = _mm_sha1nexte_epu32(E1, MSG1);\n\t\tE0 = ABCD;\n\t\tMSG2 = _mm_sha1msg2_epu32(MSG2, MSG1);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E1, 2);\n\t\tMSG0 = _mm_sha1msg1_epu32(MSG0, MSG1);\n\t\tMSG3 = _mm_xor_si128(MSG3, MSG1);\n\n\t\t/* Rounds 56-59 */\n\t\tE0 = _mm_sha1nexte_epu32(E0, MSG2);\n\t\tE1 = ABCD;\n\t\tMSG3 = _mm_sha1msg2_epu32(MSG3, MSG2);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E0, 2);\n\t\tMSG1 = _mm_sha1msg1_epu32(MSG1, MSG2);\n\t\tMSG0 = _mm_xor_si128(MSG0, MSG2);\n\n\t\t/* Rounds 60-63 */\n\t\tE1 = _mm_sha1nexte_epu32(E1, MSG3);\n\t\tE0 = ABCD;\n\t\tMSG0 = _mm_sha1msg2_epu32(MSG0, MSG3);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E1, 3);\n\t\tMSG2 = _mm_sha1msg1_epu32(MSG2, MSG3);\n\t\tMSG1 = _mm_xor_si128(MSG1, MSG3);\n\n\t\t/* Rounds 64-67 */\n\t\tE0 = _mm_sha1nexte_epu32(E0, MSG0);\n\t\tE1 = ABCD;\n\t\tMSG1 = _mm_sha1msg2_epu32(MSG1, MSG0);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E0, 3);\n\t\tMSG3 = _mm_sha1msg1_epu32(MSG3, MSG0);\n\t\tMSG2 = _mm_xor_si128(MSG2, MSG0);\n\n\t\t/* Rounds 68-71 */\n\t\tE1 = _mm_sha1nexte_epu32(E1, MSG1);\n\t\tE0 = ABCD;\n\t\tMSG2 = _mm_sha1msg2_epu32(MSG2, MSG1);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E1, 3);\n\t\tMSG3 = _mm_xor_si128(MSG3, MSG1);\n\n\t\t/* Rounds 72-75 */\n\t\tE0 = _mm_sha1nexte_epu32(E0, MSG2);\n\t\tE1 = ABCD;\n\t\tMSG3 = _mm_sha1msg2_epu32(MSG3, MSG2);\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E0, 3);\n\n\t\t/* Rounds 76-79 */\n\t\tE1 = _mm_sha1nexte_epu32(E1, MSG3);\n\t\tE0 = ABCD;\n\t\tABCD = _mm_sha1rnds4_epu32(ABCD, E1, 3);\n\n\t\t/* Combine state */\n\t\tE0 = _mm_sha1nexte_epu32(E0, E0_SAVE);\n\t\tABCD = _mm_add_epi32(ABCD, ABCD_SAVE);\n\n\t\tdata += 64;\n\t\tlength -= 64;\n\t}\n\n\t/* Save state */\n\tABCD = _mm_shuffle_epi32(ABCD, 0x1B);\n\t_mm_storeu_si128((__m128i*) state, ABCD);\n\tstate[4] = _mm_extract_epi32(E0, 3);\n\n\t/* Repack into uint64_t. */\n\tstate64[0] = state[0];\n\tstate64[1] = state[1];\n\tstate64[2] = state[2];\n\tstate64[3] = state[3];\n\tstate64[4] = state[4];\n}\n#endif /* CPU_X86_SHA1_ACCELERATION */\n\n/* Transform the message X which consists of 16 32-bit-words (SHA-1) */\nstatic void sha1_transform(HASH_CONTEXT *ctx, const uint8_t *data)\n{\n#ifdef CPU_X86_SHA1_ACCELERATION\n\tif (cpu_has_sha1_accel)\n\t{\n\t\t/* SHA-1 acceleration using intrinsics */\n\t\tsha1_transform_x86(ctx->state, data, SHA1_BLOCKSIZE);\n\t}\n\telse\n#endif\n\t{\n\t\t/* Portable C/C++ implementation */\n\t\tsha1_transform_cc(ctx, data);\n\t}\n}\n\n/* Transform the message X which consists of 16 32-bit-words (SHA-256) */\nstatic __inline void sha256_transform_cc(HASH_CONTEXT *ctx, const uint8_t *data)\n{\n\tuint32_t a, b, c, d, e, f, g, h, j, x[16];\n\n\ta = (uint32_t)ctx->state[0];\n\tb = (uint32_t)ctx->state[1];\n\tc = (uint32_t)ctx->state[2];\n\td = (uint32_t)ctx->state[3];\n\te = (uint32_t)ctx->state[4];\n\tf = (uint32_t)ctx->state[5];\n\tg = (uint32_t)ctx->state[6];\n\th = (uint32_t)ctx->state[7];\n\n// Nesting the ROR allows for single register compiler optimizations\n#define S0(x) (ROR32(ROR32(ROR32(x,9)^(x),11)^(x),2))\t// Σ0 (Sigma 0)\n#define S1(x) (ROR32(ROR32(ROR32(x,14)^(x),5)^(x),6))\t// Σ1 (Sigma 1)\n#define s0(x) (ROR32(ROR32(x,11)^(x),7)^((x)>>3))\t\t// σ0 (sigma 0)\n#define s1(x) (ROR32(ROR32(x,2)^(x),17)^((x)>>10))\t\t// σ1 (sigma 1)\n#define BLK0(i) (x[i])\n#define BLK2(i) (x[i] += s1(x[((i)-2)&15]) + x[((i)-7)&15] + s0(x[((i)-15)&15]))\n#define R(a, b, c, d, e, f, g, h, i) \\\n\th += S1(e) + Ch(e,f,g) + K256[(i)+(j)] + (j ? BLK2(i) : BLK0(i)); \\\n\td += h; \\\n\th += S0(a) + Ma(a, b, c)\n#define RX_8(i) \\\n\tR(a, b, c, d, e, f, g, h, i);   \\\n\tR(h, a, b, c, d, e, f, g, i+1); \\\n\tR(g, h, a, b, c, d, e, f, i+2); \\\n\tR(f, g, h, a, b, c, d, e, i+3); \\\n\tR(e, f, g, h, a, b, c, d, i+4); \\\n\tR(d, e, f, g, h, a, b, c, i+5); \\\n\tR(c, d, e, f, g, h, a, b, i+6); \\\n\tR(b, c, d, e, f, g, h, a, i+7)\n\n#ifdef BIG_ENDIAN_HOST\n\tmemcpy(x, data, sizeof(x));\n#else\n\t{\n\t\tuint32_t k;\n\t\tfor (k = 0; k < 16; k += 4) {\n\t\t\tconst uint8_t* p2 = data + k * 4;\n\t\t\tx[k] = read_swap32(p2);\n\t\t\tx[k + 1] = read_swap32(p2 + 4);\n\t\t\tx[k + 2] = read_swap32(p2 + 8);\n\t\t\tx[k + 3] = read_swap32(p2 + 12);\n\t\t}\n\t}\n#endif\n\n\tfor (j = 0; j < 64; j += 16) {\n\t\tRX_8(0);\n\t\tRX_8(8);\n\t}\n\n#undef S0\n#undef S1\n#undef s0\n#undef s1\n#undef BLK0\n#undef BLK2\n#undef R\n#undef RX_8\n\n\tctx->state[0] += a;\n\tctx->state[1] += b;\n\tctx->state[2] += c;\n\tctx->state[3] += d;\n\tctx->state[4] += e;\n\tctx->state[5] += f;\n\tctx->state[6] += g;\n\tctx->state[7] += h;\n}\n\n#ifdef CPU_X86_SHA256_ACCELERATION\n/*\n * Transform the message X which consists of 16 32-bit-words (SHA-256)\n * The code is public domain taken from https://github.com/noloader/SHA-Intrinsics.\n */\nRUFUS_ENABLE_GCC_ARCH(\"ssse3,sse4.1,sha\")\nstatic __inline void sha256_transform_x86(uint64_t state64[8], const uint8_t *data, size_t length)\n{\n\t__m128i STATE0, STATE1;\n\t__m128i MSG, TMP;\n\t__m128i MSG0, MSG1, MSG2, MSG3;\n\tconst __m128i MASK = _mm_set_epi64x(0x0c0d0e0f08090a0bULL, 0x0405060700010203ULL);\n\n\t/* Rufus uses uint64_t for the state array. Pack it into uint32_t. */\n\tuint32_t state[8] = {\n\t\t(uint32_t)state64[0],\n\t\t(uint32_t)state64[1],\n\t\t(uint32_t)state64[2],\n\t\t(uint32_t)state64[3],\n\t\t(uint32_t)state64[4],\n\t\t(uint32_t)state64[5],\n\t\t(uint32_t)state64[6],\n\t\t(uint32_t)state64[7]\n\t};\n\n\t/* Load initial values */\n\tTMP = _mm_loadu_si128((const __m128i*) (state+0));\n\tSTATE1 = _mm_loadu_si128((const __m128i*) (state+4));\n\n\tTMP = _mm_shuffle_epi32(TMP, 0xB1);          /* CDAB */\n\tSTATE1 = _mm_shuffle_epi32(STATE1, 0x1B);    /* EFGH */\n\tSTATE0 = _mm_alignr_epi8(TMP, STATE1, 8);    /* ABEF */\n\tSTATE1 = _mm_blend_epi16(STATE1, TMP, 0xF0); /* CDGH */\n\n\twhile (length >= SHA256_BLOCKSIZE)\n\t{\n\t\t/* Save current state */\n\t\tconst __m128i ABEF_SAVE = STATE0;\n\t\tconst __m128i CDGH_SAVE = STATE1;\n\n\t\t/* Rounds 0-3 */\n\t\tMSG = _mm_loadu_si128((const __m128i*) (data+0));\n\t\tMSG0 = _mm_shuffle_epi8(MSG, MASK);\n\t\tMSG = _mm_add_epi32(MSG0, _mm_set_epi64x(0xE9B5DBA5B5C0FBCFULL, 0x71374491428A2F98ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\n\t\t/* Rounds 4-7 */\n\t\tMSG1 = _mm_loadu_si128((const __m128i*) (data+16));\n\t\tMSG1 = _mm_shuffle_epi8(MSG1, MASK);\n\t\tMSG = _mm_add_epi32(MSG1, _mm_set_epi64x(0xAB1C5ED5923F82A4ULL, 0x59F111F13956C25BULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG0 = _mm_sha256msg1_epu32(MSG0, MSG1);\n\n\t\t/* Rounds 8-11 */\n\t\tMSG2 = _mm_loadu_si128((const __m128i*) (data+32));\n\t\tMSG2 = _mm_shuffle_epi8(MSG2, MASK);\n\t\tMSG = _mm_add_epi32(MSG2, _mm_set_epi64x(0x550C7DC3243185BEULL, 0x12835B01D807AA98ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG1 = _mm_sha256msg1_epu32(MSG1, MSG2);\n\n\t\t/* Rounds 12-15 */\n\t\tMSG3 = _mm_loadu_si128((const __m128i*) (data+48));\n\t\tMSG3 = _mm_shuffle_epi8(MSG3, MASK);\n\t\tMSG = _mm_add_epi32(MSG3, _mm_set_epi64x(0xC19BF1749BDC06A7ULL, 0x80DEB1FE72BE5D74ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG3, MSG2, 4);\n\t\tMSG0 = _mm_add_epi32(MSG0, TMP);\n\t\tMSG0 = _mm_sha256msg2_epu32(MSG0, MSG3);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG2 = _mm_sha256msg1_epu32(MSG2, MSG3);\n\n\t\t/* Rounds 16-19 */\n\t\tMSG = _mm_add_epi32(MSG0, _mm_set_epi64x(0x240CA1CC0FC19DC6ULL, 0xEFBE4786E49B69C1ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG0, MSG3, 4);\n\t\tMSG1 = _mm_add_epi32(MSG1, TMP);\n\t\tMSG1 = _mm_sha256msg2_epu32(MSG1, MSG0);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG3 = _mm_sha256msg1_epu32(MSG3, MSG0);\n\n\t\t/* Rounds 20-23 */\n\t\tMSG = _mm_add_epi32(MSG1, _mm_set_epi64x(0x76F988DA5CB0A9DCULL, 0x4A7484AA2DE92C6FULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG1, MSG0, 4);\n\t\tMSG2 = _mm_add_epi32(MSG2, TMP);\n\t\tMSG2 = _mm_sha256msg2_epu32(MSG2, MSG1);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG0 = _mm_sha256msg1_epu32(MSG0, MSG1);\n\n\t\t/* Rounds 24-27 */\n\t\tMSG = _mm_add_epi32(MSG2, _mm_set_epi64x(0xBF597FC7B00327C8ULL, 0xA831C66D983E5152ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG2, MSG1, 4);\n\t\tMSG3 = _mm_add_epi32(MSG3, TMP);\n\t\tMSG3 = _mm_sha256msg2_epu32(MSG3, MSG2);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG1 = _mm_sha256msg1_epu32(MSG1, MSG2);\n\n\t\t/* Rounds 28-31 */\n\t\tMSG = _mm_add_epi32(MSG3, _mm_set_epi64x(0x1429296706CA6351ULL,  0xD5A79147C6E00BF3ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG3, MSG2, 4);\n\t\tMSG0 = _mm_add_epi32(MSG0, TMP);\n\t\tMSG0 = _mm_sha256msg2_epu32(MSG0, MSG3);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG2 = _mm_sha256msg1_epu32(MSG2, MSG3);\n\n\t\t/* Rounds 32-35 */\n\t\tMSG = _mm_add_epi32(MSG0, _mm_set_epi64x(0x53380D134D2C6DFCULL, 0x2E1B213827B70A85ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG0, MSG3, 4);\n\t\tMSG1 = _mm_add_epi32(MSG1, TMP);\n\t\tMSG1 = _mm_sha256msg2_epu32(MSG1, MSG0);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG3 = _mm_sha256msg1_epu32(MSG3, MSG0);\n\n\t\t/* Rounds 36-39 */\n\t\tMSG = _mm_add_epi32(MSG1, _mm_set_epi64x(0x92722C8581C2C92EULL, 0x766A0ABB650A7354ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG1, MSG0, 4);\n\t\tMSG2 = _mm_add_epi32(MSG2, TMP);\n\t\tMSG2 = _mm_sha256msg2_epu32(MSG2, MSG1);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG0 = _mm_sha256msg1_epu32(MSG0, MSG1);\n\n\t\t/* Rounds 40-43 */\n\t\tMSG = _mm_add_epi32(MSG2, _mm_set_epi64x(0xC76C51A3C24B8B70ULL, 0xA81A664BA2BFE8A1ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG2, MSG1, 4);\n\t\tMSG3 = _mm_add_epi32(MSG3, TMP);\n\t\tMSG3 = _mm_sha256msg2_epu32(MSG3, MSG2);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG1 = _mm_sha256msg1_epu32(MSG1, MSG2);\n\n\t\t/* Rounds 44-47 */\n\t\tMSG = _mm_add_epi32(MSG3, _mm_set_epi64x(0x106AA070F40E3585ULL, 0xD6990624D192E819ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG3, MSG2, 4);\n\t\tMSG0 = _mm_add_epi32(MSG0, TMP);\n\t\tMSG0 = _mm_sha256msg2_epu32(MSG0, MSG3);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG2 = _mm_sha256msg1_epu32(MSG2, MSG3);\n\n\t\t/* Rounds 48-51 */\n\t\tMSG = _mm_add_epi32(MSG0, _mm_set_epi64x(0x34B0BCB52748774CULL, 0x1E376C0819A4C116ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG0, MSG3, 4);\n\t\tMSG1 = _mm_add_epi32(MSG1, TMP);\n\t\tMSG1 = _mm_sha256msg2_epu32(MSG1, MSG0);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\t\tMSG3 = _mm_sha256msg1_epu32(MSG3, MSG0);\n\n\t\t/* Rounds 52-55 */\n\t\tMSG = _mm_add_epi32(MSG1, _mm_set_epi64x(0x682E6FF35B9CCA4FULL, 0x4ED8AA4A391C0CB3ULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG1, MSG0, 4);\n\t\tMSG2 = _mm_add_epi32(MSG2, TMP);\n\t\tMSG2 = _mm_sha256msg2_epu32(MSG2, MSG1);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\n\t\t/* Rounds 56-59 */\n\t\tMSG = _mm_add_epi32(MSG2, _mm_set_epi64x(0x8CC7020884C87814ULL, 0x78A5636F748F82EEULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tTMP = _mm_alignr_epi8(MSG2, MSG1, 4);\n\t\tMSG3 = _mm_add_epi32(MSG3, TMP);\n\t\tMSG3 = _mm_sha256msg2_epu32(MSG3, MSG2);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\n\t\t/* Rounds 60-63 */\n\t\tMSG = _mm_add_epi32(MSG3, _mm_set_epi64x(0xC67178F2BEF9A3F7ULL, 0xA4506CEB90BEFFFAULL));\n\t\tSTATE1 = _mm_sha256rnds2_epu32(STATE1, STATE0, MSG);\n\t\tMSG = _mm_shuffle_epi32(MSG, 0x0E);\n\t\tSTATE0 = _mm_sha256rnds2_epu32(STATE0, STATE1, MSG);\n\n\t\t/* Combine state  */\n\t\tSTATE0 = _mm_add_epi32(STATE0, ABEF_SAVE);\n\t\tSTATE1 = _mm_add_epi32(STATE1, CDGH_SAVE);\n\n\t\tdata += 64;\n\t\tlength -= 64;\n\t}\n\n\tTMP = _mm_shuffle_epi32(STATE0, 0x1B);       /* FEBA */\n\tSTATE1 = _mm_shuffle_epi32(STATE1, 0xB1);    /* DCHG */\n\tSTATE0 = _mm_blend_epi16(TMP, STATE1, 0xF0); /* DCBA */\n\tSTATE1 = _mm_alignr_epi8(STATE1, TMP, 8);    /* ABEF */\n\n\t/* Save state */\n\t_mm_storeu_si128((__m128i*) (state+0), STATE0);\n\t_mm_storeu_si128((__m128i*) (state+4), STATE1);\n\n\t/* Repack into uint64_t. */\n\tstate64[0] = state[0];\n\tstate64[1] = state[1];\n\tstate64[2] = state[2];\n\tstate64[3] = state[3];\n\tstate64[4] = state[4];\n\tstate64[5] = state[5];\n\tstate64[6] = state[6];\n\tstate64[7] = state[7];\n}\n#endif /* CPU_X86_SHA256_ACCELERATION */\n\nstatic __inline void sha256_transform(HASH_CONTEXT *ctx, const uint8_t *data)\n{\n#ifdef CPU_X86_SHA256_ACCELERATION\n\tif (cpu_has_sha256_accel)\n\t{\n\t\t/* SHA-256 acceleration using intrinsics */\n\t\tsha256_transform_x86(ctx->state, data, SHA256_BLOCKSIZE);\n\t}\n\telse\n#endif\n\t{\n\t\t/* Portable C/C++ implementation */\n\t\tsha256_transform_cc(ctx, data);\n\t}\n}\n\n/*\n * Transform the message X which consists of 16 64-bit-words (SHA-512)\n * This is an algorithm that *REALLY* benefits from being executed as 64-bit\n * code rather than 32-bit, as it's more than twice as fast then...\n */\nstatic __inline void sha512_transform(HASH_CONTEXT* ctx, const uint8_t* data)\n{\n\tuint64_t a, b, c, d, e, f, g, h, W[80];\n\tuint32_t i;\n\n\ta = ctx->state[0];\n\tb = ctx->state[1];\n\tc = ctx->state[2];\n\td = ctx->state[3];\n\te = ctx->state[4];\n\tf = ctx->state[5];\n\tg = ctx->state[6];\n\th = ctx->state[7];\n\n// Nesting the ROR allows for single register compiler optimizations\n#define S0(x) (ROR64(ROR64(ROR64(x,5)^(x),6)^(x),28))\t// Σ0 (Sigma 0)\n#define S1(x) (ROR64(ROR64(ROR64(x,23)^(x),4)^(x),14))\t// Σ1 (Sigma 1)\n#define s0(x) (ROR64(ROR64(x,7)^(x),1)^((x)>>7))\t\t// σ0 (sigma 0)\n#define s1(x) (ROR64(ROR64(x,42)^(x),19)^((x)>>6))\t\t// σ1 (sigma 1)\n#define R(a, b, c, d, e, f, g, h, i) \\\n\th += S1(e) + Ch(e, f, g) + K512[i] + W[i]; \\\n\td += h; \\\n\th += S0(a) + Ma(a, b, c)\n\n\tfor (i = 0; i < 80; i++) {\n\t\tif (i < 16)\n#ifdef BIG_ENDIAN_HOST\n\t\t\tW[i] = *((uint64_t*)&data[8 * i]));\n#else\n\t\t\tW[i] = read_swap64(&data[8 * i]);\n#endif\n\t\telse\n\t\t\tW[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16];\n\t}\n\n\tfor (i = 0; i < 80; i += 8) {\n\t\tR(a, b, c, d, e, f, g, h, i);\n\t\tR(h, a, b, c, d, e, f, g, i+1);\n\t\tR(g, h, a, b, c, d, e, f, i+2);\n\t\tR(f, g, h, a, b, c, d, e, i+3);\n\t\tR(e, f, g, h, a, b, c, d, i+4);\n\t\tR(d, e, f, g, h, a, b, c, i+5);\n\t\tR(c, d, e, f, g, h, a, b, i+6);\n\t\tR(b, c, d, e, f, g, h, a, i+7);\n\t}\n\n#undef S0\n#undef S1\n#undef s0\n#undef s1\n#undef R\n\n\tctx->state[0] += a;\n\tctx->state[1] += b;\n\tctx->state[2] += c;\n\tctx->state[3] += d;\n\tctx->state[4] += e;\n\tctx->state[5] += f;\n\tctx->state[6] += g;\n\tctx->state[7] += h;\n}\n\n/* Transform the message X which consists of 16 32-bit-words (MD5) */\nstatic void md5_transform(HASH_CONTEXT *ctx, const uint8_t *data)\n{\n\tuint32_t a, b, c, d, x[16];\n\n\ta = (uint32_t)ctx->state[0];\n\tb = (uint32_t)ctx->state[1];\n\tc = (uint32_t)ctx->state[2];\n\td = (uint32_t)ctx->state[3];\n\n#ifdef BIG_ENDIAN_HOST\n\t{\n\t\tuint32_t k;\n\t\tfor (k = 0; k < 16; k += 4) {\n\t\t\tconst uint8_t *p2 = data + k * 4;\n\t\t\tx[k] = read_swap32(p2);\n\t\t\tx[k + 1] = read_swap32(p2 + 4);\n\t\t\tx[k + 2] = read_swap32(p2 + 8);\n\t\t\tx[k + 3] = read_swap32(p2 + 12);\n\t\t}\n\t}\n#else\n\tmemcpy(x, data, sizeof(x));\n#endif\n\n#define F1(x, y, z) (z ^ (x & (y ^ z)))\n#define F2(x, y, z) F1(z, x, y)\n#define F3(x, y, z) (x ^ y ^ z)\n#define F4(x, y, z) (y ^ (x | ~z))\n\n#define MD5STEP(f, w, x, y, z, data, s) do { \\\n\t( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x ); } while(0)\n\n\tMD5STEP(F1, a, b, c, d, x[0] + 0xd76aa478, 7);\n\tMD5STEP(F1, d, a, b, c, x[1] + 0xe8c7b756, 12);\n\tMD5STEP(F1, c, d, a, b, x[2] + 0x242070db, 17);\n\tMD5STEP(F1, b, c, d, a, x[3] + 0xc1bdceee, 22);\n\tMD5STEP(F1, a, b, c, d, x[4] + 0xf57c0faf, 7);\n\tMD5STEP(F1, d, a, b, c, x[5] + 0x4787c62a, 12);\n\tMD5STEP(F1, c, d, a, b, x[6] + 0xa8304613, 17);\n\tMD5STEP(F1, b, c, d, a, x[7] + 0xfd469501, 22);\n\tMD5STEP(F1, a, b, c, d, x[8] + 0x698098d8, 7);\n\tMD5STEP(F1, d, a, b, c, x[9] + 0x8b44f7af, 12);\n\tMD5STEP(F1, c, d, a, b, x[10] + 0xffff5bb1, 17);\n\tMD5STEP(F1, b, c, d, a, x[11] + 0x895cd7be, 22);\n\tMD5STEP(F1, a, b, c, d, x[12] + 0x6b901122, 7);\n\tMD5STEP(F1, d, a, b, c, x[13] + 0xfd987193, 12);\n\tMD5STEP(F1, c, d, a, b, x[14] + 0xa679438e, 17);\n\tMD5STEP(F1, b, c, d, a, x[15] + 0x49b40821, 22);\n\n\tMD5STEP(F2, a, b, c, d, x[1] + 0xf61e2562, 5);\n\tMD5STEP(F2, d, a, b, c, x[6] + 0xc040b340, 9);\n\tMD5STEP(F2, c, d, a, b, x[11] + 0x265e5a51, 14);\n\tMD5STEP(F2, b, c, d, a, x[0] + 0xe9b6c7aa, 20);\n\tMD5STEP(F2, a, b, c, d, x[5] + 0xd62f105d, 5);\n\tMD5STEP(F2, d, a, b, c, x[10] + 0x02441453, 9);\n\tMD5STEP(F2, c, d, a, b, x[15] + 0xd8a1e681, 14);\n\tMD5STEP(F2, b, c, d, a, x[4] + 0xe7d3fbc8, 20);\n\tMD5STEP(F2, a, b, c, d, x[9] + 0x21e1cde6, 5);\n\tMD5STEP(F2, d, a, b, c, x[14] + 0xc33707d6, 9);\n\tMD5STEP(F2, c, d, a, b, x[3] + 0xf4d50d87, 14);\n\tMD5STEP(F2, b, c, d, a, x[8] + 0x455a14ed, 20);\n\tMD5STEP(F2, a, b, c, d, x[13] + 0xa9e3e905, 5);\n\tMD5STEP(F2, d, a, b, c, x[2] + 0xfcefa3f8, 9);\n\tMD5STEP(F2, c, d, a, b, x[7] + 0x676f02d9, 14);\n\tMD5STEP(F2, b, c, d, a, x[12] + 0x8d2a4c8a, 20);\n\n\tMD5STEP(F3, a, b, c, d, x[5] + 0xfffa3942, 4);\n\tMD5STEP(F3, d, a, b, c, x[8] + 0x8771f681, 11);\n\tMD5STEP(F3, c, d, a, b, x[11] + 0x6d9d6122, 16);\n\tMD5STEP(F3, b, c, d, a, x[14] + 0xfde5380c, 23);\n\tMD5STEP(F3, a, b, c, d, x[1] + 0xa4beea44, 4);\n\tMD5STEP(F3, d, a, b, c, x[4] + 0x4bdecfa9, 11);\n\tMD5STEP(F3, c, d, a, b, x[7] + 0xf6bb4b60, 16);\n\tMD5STEP(F3, b, c, d, a, x[10] + 0xbebfbc70, 23);\n\tMD5STEP(F3, a, b, c, d, x[13] + 0x289b7ec6, 4);\n\tMD5STEP(F3, d, a, b, c, x[0] + 0xeaa127fa, 11);\n\tMD5STEP(F3, c, d, a, b, x[3] + 0xd4ef3085, 16);\n\tMD5STEP(F3, b, c, d, a, x[6] + 0x04881d05, 23);\n\tMD5STEP(F3, a, b, c, d, x[9] + 0xd9d4d039, 4);\n\tMD5STEP(F3, d, a, b, c, x[12] + 0xe6db99e5, 11);\n\tMD5STEP(F3, c, d, a, b, x[15] + 0x1fa27cf8, 16);\n\tMD5STEP(F3, b, c, d, a, x[2] + 0xc4ac5665, 23);\n\n\tMD5STEP(F4, a, b, c, d, x[0] + 0xf4292244, 6);\n\tMD5STEP(F4, d, a, b, c, x[7] + 0x432aff97, 10);\n\tMD5STEP(F4, c, d, a, b, x[14] + 0xab9423a7, 15);\n\tMD5STEP(F4, b, c, d, a, x[5] + 0xfc93a039, 21);\n\tMD5STEP(F4, a, b, c, d, x[12] + 0x655b59c3, 6);\n\tMD5STEP(F4, d, a, b, c, x[3] + 0x8f0ccc92, 10);\n\tMD5STEP(F4, c, d, a, b, x[10] + 0xffeff47d, 15);\n\tMD5STEP(F4, b, c, d, a, x[1] + 0x85845dd1, 21);\n\tMD5STEP(F4, a, b, c, d, x[8] + 0x6fa87e4f, 6);\n\tMD5STEP(F4, d, a, b, c, x[15] + 0xfe2ce6e0, 10);\n\tMD5STEP(F4, c, d, a, b, x[6] + 0xa3014314, 15);\n\tMD5STEP(F4, b, c, d, a, x[13] + 0x4e0811a1, 21);\n\tMD5STEP(F4, a, b, c, d, x[4] + 0xf7537e82, 6);\n\tMD5STEP(F4, d, a, b, c, x[11] + 0xbd3af235, 10);\n\tMD5STEP(F4, c, d, a, b, x[2] + 0x2ad7d2bb, 15);\n\tMD5STEP(F4, b, c, d, a, x[9] + 0xeb86d391, 21);\n\n#undef F1\n#undef F2\n#undef F3\n#undef F4\n\n\t/* Update chaining vars */\n\tctx->state[0] += a;\n\tctx->state[1] += b;\n\tctx->state[2] += c;\n\tctx->state[3] += d;\n}\n\n/* Update the message digest with the contents of the buffer (SHA-1) */\nstatic void sha1_write(HASH_CONTEXT *ctx, const uint8_t *buf, size_t len)\n{\n\tsize_t num = ctx->bytecount & (SHA1_BLOCKSIZE - 1);\n\n\t/* Update bytecount */\n\tctx->bytecount += len;\n\n\t/* Handle any leading odd-sized chunks */\n\tif (num) {\n\t\tuint8_t *p = ctx->buf + num;\n\n\t\tnum = SHA1_BLOCKSIZE - num;\n\t\tif (len < num) {\n\t\t\tmemcpy(p, buf, len);\n\t\t\treturn;\n\t\t}\n\t\tmemcpy(p, buf, num);\n\t\tsha1_transform(ctx, ctx->buf);\n\t\tbuf += num;\n\t\tlen -= num;\n\t}\n\n#ifdef CPU_X86_SHA1_ACCELERATION\n\tif (cpu_has_sha1_accel)\n\t{\n\t\t/* Process all full blocks at once */\n\t\tif (len >= SHA1_BLOCKSIZE) {\n\t\t\t/* Calculate full blocks, in bytes */\n\t\t\tnum = (len / SHA1_BLOCKSIZE) * SHA1_BLOCKSIZE;\n\t\t\t/* SHA-1 acceleration using intrinsics */\n\t\t\tsha1_transform_x86(ctx->state, buf, num);\n\t\t\tbuf += num;\n\t\t\tlen -= num;\n\t\t}\n\t}\n\telse\n#endif\n\t{\n\t\t/* Process data in blocksize chunks */\n\t\twhile (len >= SHA1_BLOCKSIZE) {\n\t\t\tPREFETCH64(buf + SHA1_BLOCKSIZE);\n\t\t\tsha1_transform(ctx, buf);\n\t\t\tbuf += SHA1_BLOCKSIZE;\n\t\t\tlen -= SHA1_BLOCKSIZE;\n\t\t}\n\t}\n\n\t/* Handle any remaining bytes of data. */\n\tmemcpy(ctx->buf, buf, len);\n}\n\n/* Update the message digest with the contents of the buffer (SHA-256) */\nstatic void sha256_write(HASH_CONTEXT *ctx, const uint8_t *buf, size_t len)\n{\n\tsize_t num = ctx->bytecount & (SHA256_BLOCKSIZE - 1);\n\n\t/* Update bytecount */\n\tctx->bytecount += len;\n\n\t/* Handle any leading odd-sized chunks */\n\tif (num) {\n\t\tuint8_t *p = ctx->buf + num;\n\n\t\tnum = SHA256_BLOCKSIZE - num;\n\t\tif (len < num) {\n\t\t\tmemcpy(p, buf, len);\n\t\t\treturn;\n\t\t}\n\t\tmemcpy(p, buf, num);\n\t\tsha256_transform(ctx, ctx->buf);\n\t\tbuf += num;\n\t\tlen -= num;\n\t}\n\n#ifdef CPU_X86_SHA256_ACCELERATION\n\tif (cpu_has_sha256_accel)\n\t{\n\t\t/* Process all full blocks at once */\n\t\tif (len >= SHA256_BLOCKSIZE) {\n\t\t\t/* Calculate full blocks, in bytes */\n\t\t\tnum = (len / SHA256_BLOCKSIZE) * SHA256_BLOCKSIZE;\n\t\t\t/* SHA-256 acceleration using intrinsics */\n\t\t\tsha256_transform_x86(ctx->state, buf, num);\n\t\t\tbuf += num;\n\t\t\tlen -= num;\n\t\t}\n\t}\n\telse\n#endif\n\t{\n\t\t/* Process data in blocksize chunks */\n\t\twhile (len >= SHA256_BLOCKSIZE) {\n\t\t\tPREFETCH64(buf + SHA256_BLOCKSIZE);\n\t\t\tsha256_transform(ctx, buf);\n\t\t\tbuf += SHA256_BLOCKSIZE;\n\t\t\tlen -= SHA256_BLOCKSIZE;\n\t\t}\n\t}\n\n\t/* Handle any remaining bytes of data. */\n\tmemcpy(ctx->buf, buf, len);\n}\n\n/* Update the message digest with the contents of the buffer (SHA-512) */\nstatic void sha512_write(HASH_CONTEXT* ctx, const uint8_t* buf, size_t len)\n{\n\tsize_t num = ctx->bytecount & (SHA512_BLOCKSIZE - 1);\n\n\t/* Update bytecount */\n\tctx->bytecount += len;\n\n\t/* Handle any leading odd-sized chunks */\n\tif (num) {\n\t\tuint8_t* p = ctx->buf + num;\n\n\t\tnum = SHA512_BLOCKSIZE - num;\n\t\tif (len < num) {\n\t\t\tmemcpy(p, buf, len);\n\t\t\treturn;\n\t\t}\n\t\tmemcpy(p, buf, num);\n\t\tsha512_transform(ctx, ctx->buf);\n\t\tbuf += num;\n\t\tlen -= num;\n\t}\n\n\t/* Process data in blocksize chunks */\n\twhile (len >= SHA512_BLOCKSIZE) {\n\t\tPREFETCH64(buf + SHA512_BLOCKSIZE);\n\t\tsha512_transform(ctx, buf);\n\t\tbuf += SHA512_BLOCKSIZE;\n\t\tlen -= SHA512_BLOCKSIZE;\n\t}\n\n\t/* Handle any remaining bytes of data. */\n\tmemcpy(ctx->buf, buf, len);\n}\n\n/* Update the message digest with the contents of the buffer (MD5) */\nstatic void md5_write(HASH_CONTEXT *ctx, const uint8_t *buf, size_t len)\n{\n\tsize_t num = ctx->bytecount & (MD5_BLOCKSIZE - 1);\n\n\t/* Update bytecount */\n\tctx->bytecount += len;\n\n\t/* Handle any leading odd-sized chunks */\n\tif (num) {\n\t\tuint8_t *p = ctx->buf + num;\n\n\t\tnum = MD5_BLOCKSIZE - num;\n\t\tif (len < num) {\n\t\t\tmemcpy(p, buf, num);\n\t\t\treturn;\n\t\t}\n\t\tmemcpy(p, buf, num);\n\t\tmd5_transform(ctx, ctx->buf);\n\t\tbuf += num;\n\t\tlen -= num;\n\t}\n\n\t/* Process data in blocksize chunks */\n\twhile (len >= MD5_BLOCKSIZE) {\n\t\tPREFETCH64(buf + MD5_BLOCKSIZE);\n\t\tmd5_transform(ctx, buf);\n\t\tbuf += MD5_BLOCKSIZE;\n\t\tlen -= MD5_BLOCKSIZE;\n\t}\n\n\t/* Handle any remaining bytes of data. */\n\tmemcpy(ctx->buf, buf, len);\n}\n\n/* Finalize the computation and write the digest in ctx->state[] (SHA-1) */\nstatic void sha1_final(HASH_CONTEXT *ctx)\n{\n\tsize_t pos = ((size_t)ctx->bytecount) & (SHA1_BLOCKSIZE - 1);\n\tuint64_t bitcount = ctx->bytecount << 3;\n\tuint8_t *p;\n\n\tctx->buf[pos++] = 0x80;\n\n\t/* Pad whatever data is left in the buffer */\n\twhile (pos != (SHA1_BLOCKSIZE - sizeof(uint64_t))) {\n\t\tpos &= (SHA1_BLOCKSIZE - 1);\n\t\tif (pos == 0)\n\t\t\tsha1_transform(ctx, ctx->buf);\n\t\tctx->buf[pos++] = 0;\n\t}\n\n\t/* Append to the padding the total message's length in bits and transform */\n\tctx->buf[SHA1_BLOCKSIZE - 1] = (uint8_t) bitcount;\n\tctx->buf[SHA1_BLOCKSIZE - 2] = (uint8_t) (bitcount >> 8);\n\tctx->buf[SHA1_BLOCKSIZE - 3] = (uint8_t) (bitcount >> 16);\n\tctx->buf[SHA1_BLOCKSIZE - 4] = (uint8_t) (bitcount >> 24);\n\tctx->buf[SHA1_BLOCKSIZE - 5] = (uint8_t) (bitcount >> 32);\n\tctx->buf[SHA1_BLOCKSIZE - 6] = (uint8_t) (bitcount >> 40);\n\tctx->buf[SHA1_BLOCKSIZE - 7] = (uint8_t) (bitcount >> 48);\n\tctx->buf[SHA1_BLOCKSIZE - 8] = (uint8_t) (bitcount >> 56);\n\n\tsha1_transform(ctx, ctx->buf);\n\n\tp = ctx->buf;\n#ifdef BIG_ENDIAN_HOST\n#define X(a) do { *(uint32_t*)p = (uint32_t)ctx->state[a]; p += 4; } while(0)\n#else\n#define X(a) do { write_swap32(p, (uint32_t)ctx->state[a]); p += 4; } while(0);\n#endif\n\tX(0);\n\tX(1);\n\tX(2);\n\tX(3);\n\tX(4);\n#undef X\n}\n\n/* Finalize the computation and write the digest in ctx->state[] (SHA-256) */\nstatic void sha256_final(HASH_CONTEXT *ctx)\n{\n\tsize_t pos = ((size_t)ctx->bytecount) & (SHA256_BLOCKSIZE - 1);\n\tuint64_t bitcount = ctx->bytecount << 3;\n\tuint8_t *p;\n\n\tctx->buf[pos++] = 0x80;\n\n\t/* Pad whatever data is left in the buffer */\n\twhile (pos != (SHA256_BLOCKSIZE - sizeof(uint64_t))) {\n\t\tpos &= (SHA256_BLOCKSIZE - 1);\n\t\tif (pos == 0)\n\t\t\tsha256_transform(ctx, ctx->buf);\n\t\tctx->buf[pos++] = 0;\n\t}\n\n\t/* Append to the padding the total message's length in bits and transform */\n\tctx->buf[SHA256_BLOCKSIZE - 1] = (uint8_t) bitcount;\n\tctx->buf[SHA256_BLOCKSIZE - 2] = (uint8_t) (bitcount >> 8);\n\tctx->buf[SHA256_BLOCKSIZE - 3] = (uint8_t) (bitcount >> 16);\n\tctx->buf[SHA256_BLOCKSIZE - 4] = (uint8_t) (bitcount >> 24);\n\tctx->buf[SHA256_BLOCKSIZE - 5] = (uint8_t) (bitcount >> 32);\n\tctx->buf[SHA256_BLOCKSIZE - 6] = (uint8_t) (bitcount >> 40);\n\tctx->buf[SHA256_BLOCKSIZE - 7] = (uint8_t) (bitcount >> 48);\n\tctx->buf[SHA256_BLOCKSIZE - 8] = (uint8_t) (bitcount >> 56);\n\n\tsha256_transform(ctx, ctx->buf);\n\n\tp = ctx->buf;\n#ifdef BIG_ENDIAN_HOST\n#define X(a) do { *(uint32_t*)p = (uint32_t)ctx->state[a]; p += 4; } while(0)\n#else\n#define X(a) do { write_swap32(p, (uint32_t)ctx->state[a]); p += 4; } while(0);\n#endif\n\tX(0);\n\tX(1);\n\tX(2);\n\tX(3);\n\tX(4);\n\tX(5);\n\tX(6);\n\tX(7);\n#undef X\n}\n\n/* Finalize the computation and write the digest in ctx->state[] (SHA-256) */\nstatic void sha512_final(HASH_CONTEXT* ctx)\n{\n\tsize_t pos = ((size_t)ctx->bytecount) & (SHA512_BLOCKSIZE - 1);\n\t/* 16 EB ought to be enough for everybody... */\n\tuint64_t bitcount_lo = ctx->bytecount << 3;\n\tuint64_t bitcount_hi = ctx->bytecount >> (64 - 3);\n\tuint8_t* p;\n\n\tctx->buf[pos++] = 0x80;\n\n\t/* Pad whatever data is left in the buffer */\n\twhile (pos != (SHA512_BLOCKSIZE - (2 * sizeof(uint64_t)))) {\n\t\tpos &= (SHA512_BLOCKSIZE - 1);\n\t\tif (pos == 0)\n\t\t\tsha512_transform(ctx, ctx->buf);\n\t\tctx->buf[pos++] = 0;\n\t}\n\n\t/* Append to the padding the total message's length in bits and transform */\n\tctx->buf[SHA512_BLOCKSIZE - 1] = (uint8_t)bitcount_lo;\n\tctx->buf[SHA512_BLOCKSIZE - 2] = (uint8_t)(bitcount_lo >> 8);\n\tctx->buf[SHA512_BLOCKSIZE - 3] = (uint8_t)(bitcount_lo >> 16);\n\tctx->buf[SHA512_BLOCKSIZE - 4] = (uint8_t)(bitcount_lo >> 24);\n\tctx->buf[SHA512_BLOCKSIZE - 5] = (uint8_t)(bitcount_lo >> 32);\n\tctx->buf[SHA512_BLOCKSIZE - 6] = (uint8_t)(bitcount_lo >> 40);\n\tctx->buf[SHA512_BLOCKSIZE - 7] = (uint8_t)(bitcount_lo >> 48);\n\tctx->buf[SHA512_BLOCKSIZE - 8] = (uint8_t)(bitcount_lo >> 56);\n\tctx->buf[SHA512_BLOCKSIZE - 9] = (uint8_t)bitcount_hi;\n\t/* For clarity since, with a 64-bit bytecount, the following are always 0 */\n\tctx->buf[SHA512_BLOCKSIZE - 10] = (uint8_t)(bitcount_hi >> 8);\n\tctx->buf[SHA512_BLOCKSIZE - 11] = (uint8_t)(bitcount_hi >> 16);\n\tctx->buf[SHA512_BLOCKSIZE - 12] = (uint8_t)(bitcount_hi >> 24);\n\tctx->buf[SHA512_BLOCKSIZE - 13] = (uint8_t)(bitcount_hi >> 32);\n\tctx->buf[SHA512_BLOCKSIZE - 14] = (uint8_t)(bitcount_hi >> 40);\n\tctx->buf[SHA512_BLOCKSIZE - 15] = (uint8_t)(bitcount_hi >> 48);\n\tctx->buf[SHA512_BLOCKSIZE - 16] = (uint8_t)(bitcount_hi >> 56);\n\n\tsha512_transform(ctx, ctx->buf);\n\n\tp = ctx->buf;\n#ifdef BIG_ENDIAN_HOST\n#define X(a) do { *p = ctx->state[a]; p += 8; } while(0)\n#else\n#define X(a) do { write_swap64(p, ctx->state[a]); p += 8; } while(0);\n#endif\n\tX(0);\n\tX(1);\n\tX(2);\n\tX(3);\n\tX(4);\n\tX(5);\n\tX(6);\n\tX(7);\n#undef X\n}\n\n/* Finalize the computation and write the digest in ctx->state[] (MD5) */\nstatic void md5_final(HASH_CONTEXT *ctx)\n{\n\tsize_t count = ((size_t)ctx->bytecount) & (MD5_BLOCKSIZE - 1);\n\tuint64_t bitcount = ctx->bytecount << 3;\n\tuint8_t *p;\n\n\t/* Set the first char of padding to 0x80.\n\t * This is safe since there is always at least one byte free\n\t */\n\tp = ctx->buf + count;\n\t*p++ = 0x80;\n\n\t/* Bytes of padding needed to make blocksize */\n\tcount = (MD5_BLOCKSIZE - 1) - count;\n\n\t/* Pad out to 56 mod 64 */\n\tif (count < 8) {\n\t\t/* Two lots of padding: Pad the first block to blocksize */\n\t\tmemset(p, 0, count);\n\t\tmd5_transform(ctx, ctx->buf);\n\n\t\t/* Now fill the next block */\n\t\tmemset(ctx->buf, 0, MD5_BLOCKSIZE - 8);\n\t} else {\n\t\t/* Pad block to blocksize */\n\t\tmemset(p, 0, count - 8);\n\t}\n\n\t/* append the 64 bit count (little endian) */\n\tctx->buf[MD5_BLOCKSIZE - 8] = (uint8_t) bitcount;\n\tctx->buf[MD5_BLOCKSIZE - 7] = (uint8_t) (bitcount >> 8);\n\tctx->buf[MD5_BLOCKSIZE - 6] = (uint8_t) (bitcount >> 16);\n\tctx->buf[MD5_BLOCKSIZE - 5] = (uint8_t) (bitcount >> 24);\n\tctx->buf[MD5_BLOCKSIZE - 4] = (uint8_t) (bitcount >> 32);\n\tctx->buf[MD5_BLOCKSIZE - 3] = (uint8_t) (bitcount >> 40);\n\tctx->buf[MD5_BLOCKSIZE - 2] = (uint8_t) (bitcount >> 48);\n\tctx->buf[MD5_BLOCKSIZE - 1] = (uint8_t) (bitcount >> 56);\n\n\tmd5_transform(ctx, ctx->buf);\n\n\tp = ctx->buf;\n#ifdef BIG_ENDIAN_HOST\n#define X(a) do { write_swap32(p, (uint32_t)ctx->state[a]); p += 4; } while(0);\n#else\n#define X(a) do { *(uint32_t*)p = (uint32_t)ctx->state[a]; p += 4; } while(0)\n#endif\n\tX(0);\n\tX(1);\n\tX(2);\n\tX(3);\n#undef X\n}\n\n//#define NULL_TEST\n#ifdef NULL_TEST\n// These 'null' calls are useful for testing load balancing and individual algorithm speed\nstatic void null_init(HASH_CONTEXT *ctx) { memset(ctx, 0, sizeof(*ctx)); }\nstatic void null_write(HASH_CONTEXT *ctx, const uint8_t *buf, size_t len) { }\nstatic void null_final(HASH_CONTEXT *ctx) { }\n#endif\n\nhash_init_t *hash_init[HASH_MAX] = { md5_init, sha1_init , sha256_init, sha512_init };\nhash_write_t *hash_write[HASH_MAX] = { md5_write, sha1_write , sha256_write, sha512_write };\nhash_final_t *hash_final[HASH_MAX] = { md5_final, sha1_final , sha256_final, sha512_final };\n\n/* Compute an individual hash without threading or buffering, for a single file */\nBOOL HashFile(const unsigned type, const char* path, uint8_t* hash)\n{\n\tBOOL r = FALSE;\n\tHASH_CONTEXT hash_ctx = { {0} };\n\tHANDLE h = INVALID_HANDLE_VALUE;\n\tDWORD rs = 0;\n\tuint64_t rb;\n\tuint8_t buf[4096];\n\n\tif ((type >= HASH_MAX) || (path == NULL) || (hash == NULL))\n\t\tgoto out;\n\n\th = CreateFileU(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);\n\tif (h == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Could not open file: %s\", WindowsErrorString());\n\t\tErrorStatus = RUFUS_ERROR(ERROR_OPEN_FAILED);\n\t\tgoto out;\n\t}\n\n\thash_init[type](&hash_ctx);\n\tfor (rb = 0; ; rb += rs) {\n\t\tCHECK_FOR_USER_CANCEL;\n\t\tif (!ReadFile(h, buf, sizeof(buf), &rs, NULL)) {\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_READ_FAULT);\n\t\t\tuprintf(\"  Read error: %s\", WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tif (rs == 0)\n\t\t\tbreak;\n\t\thash_write[type](&hash_ctx, buf, (size_t)rs);\n\t}\n\thash_final[type](&hash_ctx);\n\n\tmemcpy(hash, hash_ctx.buf, hash_count[type]);\n\tr = TRUE;\n\nout:\n\tsafe_closehandle(h);\n\treturn r;\n}\n\n/* A part of an image, used for hashing */\nstruct image_region {\n\tconst uint8_t*      data;\n\tuint32_t            size;\n};\n\n/**\n * struct efi_image_regions - A list of memory regions\n *\n * @max:    Maximum number of regions\n * @num:    Number of regions\n * @reg:    Array of regions\n */\nstruct efi_image_regions {\n\tint                 max;\n\tint                 num;\n\tstruct image_region reg[];\n};\n\n/**\n * efi_image_region_add() - add an entry of region\n * @regs:       Pointer to array of regions\n * @start:      Start address of region (included)\n * @end:        End address of region (excluded)\n * @nocheck:    Flag against overlapped regions\n *\n * Take one entry of region \\[@start, @end\\[ and insert it into the list.\n *\n * * If @nocheck is false, the list will be sorted ascending by address.\n *   Overlapping entries will not be allowed.\n *\n * * If @nocheck is true, the list will be sorted ascending by sequence\n *   of adding the entries. Overlapping is allowed.\n *\n * Return:  TRUE on success, FALSE on error\n */\nBOOL efi_image_region_add(struct efi_image_regions* regs,\n\tconst void* start, const void* end, int nocheck)\n{\n\tstruct image_region* reg;\n\tint i, j;\n\n\tif (regs->num >= regs->max) {\n\t\tuprintf(\"%s: no more room for regions\", __func__);\n\t\treturn FALSE;\n\t}\n\n\tif (end < start)\n\t\treturn FALSE;\n\n\tfor (i = 0; i < regs->num; i++) {\n\t\treg = &regs->reg[i];\n\t\tif (nocheck)\n\t\t\tcontinue;\n\n\t\t/* new data after registered region */\n\t\tif ((uint8_t*)start >= reg->data + reg->size)\n\t\t\tcontinue;\n\n\t\t/* new data preceding registered region */\n\t\tif ((uint8_t*)end <= reg->data) {\n\t\t\tfor (j = regs->num - 1; j >= i; j--)\n\t\t\t\tmemcpy(&regs->reg[j + 1], &regs->reg[j],\n\t\t\t\t\tsizeof(*reg));\n\t\t\tbreak;\n\t\t}\n\n\t\t/* new data overlapping registered region */\n\t\tuprintf(\"%s: new region already part of another\", __func__);\n\t\treturn FALSE;\n\t}\n\n\treg = &regs->reg[i];\n\treg->data = start;\n\treg->size = (uint32_t)((uintptr_t)end - (uintptr_t)start);\n\tregs->num++;\n\n\treturn TRUE;\n}\n\n/**\n * cmp_pe_section() - compare virtual addresses of two PE image sections\n * @arg1:   Pointer to pointer to first section header\n * @arg2:   Pointer to pointer to second section header\n *\n * Compare the virtual addresses of two sections of an portable executable.\n * The arguments are defined as const void * to allow usage with qsort().\n *\n * Return:  -1 if the virtual address of arg1 is less than that of arg2,\n *           0 if the virtual addresses are equal, 1 if the virtual address\n *             of arg1 is greater than that of arg2.\n */\nstatic int cmp_pe_section(const void* arg1, const void* arg2)\n{\n\tconst IMAGE_SECTION_HEADER* section1, * section2;\n\n\tsection1 = *((const IMAGE_SECTION_HEADER**)arg1);\n\tsection2 = *((const IMAGE_SECTION_HEADER**)arg2);\n\n\tif (section1->VirtualAddress < section2->VirtualAddress)\n\t\treturn -1;\n\telse if (section1->VirtualAddress == section2->VirtualAddress)\n\t\treturn 0;\n\telse\n\t\treturn 1;\n}\n\n/**\n * efi_image_parse() - parse a PE image\n * @efi:    Pointer to image\n * @len:    Size of @efi\n * @regp:   Pointer to a list of regions\n *\n * Parse image binary in PE32(+) format.\n *\n * Return:  TRUE on success, FALSE on error\n */\nBOOL efi_image_parse(uint8_t* efi, size_t len, struct efi_image_regions** regp)\n{\n\tstruct efi_image_regions* regs;\n\tIMAGE_DOS_HEADER* dos;\n\tIMAGE_NT_HEADERS32* nt;\n\tIMAGE_SECTION_HEADER *sections, **sorted;\n\tint num_regions, num_sections, i;\n\tDWORD ctidx = IMAGE_DIRECTORY_ENTRY_SECURITY;\n\tuint32_t align, size, authsz;\n\tsize_t bytes_hashed;\n\n\tif (len < 0x80)\n\t\treturn FALSE;\n\tdos = (void*)efi;\n\tif (dos->e_lfanew > (LONG)len - 0x40)\n\t\treturn FALSE;\n\tnt = (void*)(efi + dos->e_lfanew);\n\tauthsz = 0;\n\n\t/*\n\t * Count maximum number of regions to be digested.\n\t * We don't have to have an exact number here.\n\t * See efi_image_region_add()'s in parsing below.\n\t */\n\tnum_regions = 3; /* for header */\n\tnum_regions += nt->FileHeader.NumberOfSections;\n\tnum_regions++; /* for extra */\n\n\tregs = calloc(sizeof(*regs) + sizeof(struct image_region) * num_regions, 1);\n\tif (!regs)\n\t\tgoto err;\n\tregs->max = num_regions;\n\n\t/*\n\t * Collect data regions for hash calculation\n\t * 1. File headers\n\t */\n\tif (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) {\n\t\tIMAGE_NT_HEADERS64* nt64 = (void*)nt;\n\t\tIMAGE_OPTIONAL_HEADER64* opt = &nt64->OptionalHeader;\n\n\t\t/* Skip CheckSum */\n\t\tefi_image_region_add(regs, efi, &opt->CheckSum, 0);\n\t\tif (nt64->OptionalHeader.NumberOfRvaAndSizes <= ctidx) {\n\t\t\tefi_image_region_add(regs,\n\t\t\t\t&opt->Subsystem,\n\t\t\t\tefi + opt->SizeOfHeaders, 0);\n\t\t} else {\n\t\t\t/* Skip Certificates Table */\n\t\t\tefi_image_region_add(regs,\n\t\t\t\t&opt->Subsystem,\n\t\t\t\t&opt->DataDirectory[ctidx], 0);\n\t\t\tefi_image_region_add(regs,\n\t\t\t\t&opt->DataDirectory[ctidx] + 1,\n\t\t\t\tefi + opt->SizeOfHeaders, 0);\n\n\t\t\tauthsz = opt->DataDirectory[ctidx].Size;\n\t\t}\n\n\t\tbytes_hashed = opt->SizeOfHeaders;\n\t\talign = opt->FileAlignment;\n\t} else if (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) {\n\t\tIMAGE_OPTIONAL_HEADER32* opt = &nt->OptionalHeader;\n\n\t\t/* Skip CheckSum */\n\t\tefi_image_region_add(regs, efi, &opt->CheckSum, 0);\n\t\tif (nt->OptionalHeader.NumberOfRvaAndSizes <= ctidx) {\n\t\t\tefi_image_region_add(regs,\n\t\t\t\t&opt->Subsystem,\n\t\t\t\tefi + opt->SizeOfHeaders, 0);\n\t\t} else {\n\t\t\t/* Skip Certificates Table */\n\t\t\tefi_image_region_add(regs, &opt->Subsystem,\n\t\t\t\t&opt->DataDirectory[ctidx], 0);\n\t\t\tefi_image_region_add(regs,\n\t\t\t\t&opt->DataDirectory[ctidx] + 1,\n\t\t\t\tefi + opt->SizeOfHeaders, 0);\n\n\t\t\tauthsz = opt->DataDirectory[ctidx].Size;\n\t\t}\n\n\t\tbytes_hashed = opt->SizeOfHeaders;\n\t\talign = opt->FileAlignment;\n\t} else {\n\t\tuprintf(\"%s: Invalid optional header magic %x\", __func__,\n\t\t\tnt->OptionalHeader.Magic);\n\t\tgoto err;\n\t}\n\n\t/* 2. Sections */\n\tnum_sections = nt->FileHeader.NumberOfSections;\n\tsections = (void*)((uint8_t*)&nt->OptionalHeader +\n\t\tnt->FileHeader.SizeOfOptionalHeader);\n\tsorted = calloc(sizeof(IMAGE_SECTION_HEADER*), num_sections);\n\tif (!sorted) {\n\t\tuprintf(\"%s: Out of memory\", __func__);\n\t\tgoto err;\n\t}\n\n\t/*\n\t * Make sure the section list is in ascending order.\n\t */\n\tfor (i = 0; i < num_sections; i++)\n\t\tsorted[i] = &sections[i];\n\tqsort(sorted, num_sections, sizeof(sorted[0]), cmp_pe_section);\n\n\tfor (i = 0; i < num_sections; i++) {\n\t\tif (!sorted[i]->SizeOfRawData)\n\t\t\tcontinue;\n\n\t\tsize = (sorted[i]->SizeOfRawData + align - 1) & ~(align - 1);\n\t\tefi_image_region_add(regs, efi + sorted[i]->PointerToRawData,\n\t\t\tefi + sorted[i]->PointerToRawData + size, 0);\n\t\t//uprintf(\"section[%d](%s): raw: 0x%x-0x%x, virt: %x-%x\",\n\t\t//\ti, sorted[i]->Name,\n\t\t//\tsorted[i]->PointerToRawData,\n\t\t//\tsorted[i]->PointerToRawData + size,\n\t\t//\tsorted[i]->VirtualAddress,\n\t\t//\tsorted[i]->VirtualAddress\n\t\t//\t+ sorted[i]->Misc.VirtualSize);\n\n\t\tbytes_hashed += size;\n\t}\n\tfree(sorted);\n\n\t/* 3. Extra data excluding Certificates Table */\n\tif (bytes_hashed + authsz < len) {\n\t\t//uprintf(\"extra data for hash: %zu\",\n\t\t//\tlen - (bytes_hashed + authsz));\n\t\tefi_image_region_add(regs, efi + bytes_hashed,\n\t\t\tefi + len - authsz, 0);\n\t}\n\n\t*regp = regs;\n\treturn TRUE;\n\nerr:\n\tfree(regs);\n\treturn FALSE;\n}\n\n/*\n * Compute the PE256 (a.k.a. Applocker SHA256) hash of a single EFI executable.\n * This is a SHA-256 hash applied to only specific parts of a PE binary.\n * See https://security.stackexchange.com/a/199627/270178.\n * Oh, and you'd think that Windows's ImageGetDigestStream() API could be used\n * for some part of this but you'd be very, very wrong since the PE sections it\n * feeds to the hash function does include the PE header checksum field...\n */\nBOOL PE256Buffer(uint8_t* buf, uint32_t len, uint8_t* hash)\n{\n\tBOOL r = FALSE;\n\tHASH_CONTEXT hash_ctx = { {0} };\n\tint i;\n\tstruct efi_image_regions* regs = NULL;\n\n\tif ((buf == NULL) || (len == 0) || (len < 1 * KB) || (len > 64 * MB) || (hash == NULL))\n\t\tgoto out;\n\n\t/* Isolate the PE sections to hash */\n\tif (!efi_image_parse(buf, len, &regs))\n\t\tgoto out;\n\n\t/* Hash the relevant PE data */\n\tsha256_init(&hash_ctx);\n\tfor (i = 0; i < regs->num; i++)\n\t\tsha256_write(&hash_ctx, regs->reg[i].data, regs->reg[i].size);\n\tsha256_final(&hash_ctx);\n\n\tmemcpy(hash, hash_ctx.buf, SHA256_HASHSIZE);\n\tr = TRUE;\n\nout:\n\tfree(regs);\n\treturn r;\n}\n\n/*\n * Compute the hash of a single buffer.\n */\nBOOL HashBuffer(const unsigned type, const uint8_t* buf, const size_t len, uint8_t* hash)\n{\n\tBOOL r = FALSE;\n\tHASH_CONTEXT hash_ctx = { {0} };\n\n\tif ((type >= HASH_MAX) || (hash == NULL))\n\t\tgoto out;\n\n\thash_init[type](&hash_ctx);\n\thash_write[type](&hash_ctx, buf, len);\n\thash_final[type](&hash_ctx);\n\n\tmemcpy(hash, hash_ctx.buf, hash_count[type]);\n\tr = TRUE;\n\nout:\n\treturn r;\n}\n\n/*\n * Hash dialog callback\n */\nINT_PTR CALLBACK HashCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tstatic HFONT hFont = NULL;\n\tint i, dw, dh;\n\tRECT rc;\n\tHDC hDC;\n\n\tswitch (message) {\n\tcase WM_INITDIALOG:\n\t\tSetDarkModeForDlg(hDlg);\n\t\tapply_localization(IDD_HASH, hDlg);\n\t\tif (hFont == NULL) {\n\t\t\thDC = GetDC(hDlg);\n\t\t\thFont = CreateFontA(-MulDiv(9, GetDeviceCaps(hDC, LOGPIXELSY), 72),\n\t\t\t\t0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET,\n\t\t\t\t0, 0, PROOF_QUALITY, 0, \"Courier New\");\n\t\t\tsafe_release_dc(hDlg, hDC);\n\t\t}\n\t\tSendDlgItemMessageA(hDlg, IDC_MD5, WM_SETFONT, (WPARAM)hFont, TRUE);\n\t\tSendDlgItemMessageA(hDlg, IDC_SHA1, WM_SETFONT, (WPARAM)hFont, TRUE);\n\t\tSendDlgItemMessageA(hDlg, IDC_SHA256, WM_SETFONT, (WPARAM)hFont, TRUE);\n\t\tSendDlgItemMessageA(hDlg, IDC_SHA512, WM_SETFONT, (WPARAM)hFont, TRUE);\n\t\tSetWindowTextA(GetDlgItem(hDlg, IDC_MD5), hash_str[0]);\n\t\tSetWindowTextA(GetDlgItem(hDlg, IDC_SHA1), hash_str[1]);\n\t\tSetWindowTextA(GetDlgItem(hDlg, IDC_SHA256), hash_str[2]);\n\t\tif (enable_extra_hashes)\n\t\t\tSetWindowTextA(GetDlgItem(hDlg, IDC_SHA512), hash_str[3]);\n\t\telse\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_SHA512), lmprintf(MSG_311, \"<Alt>-<H>\"));\n\n\t\t// Move/Resize the controls as needed to fit our text\n\t\thDC = GetDC(GetDlgItem(hDlg, IDC_MD5));\n\t\tSelectFont(hDC, hFont);\t// Yes, you *MUST* reapply the font to the DC, even after SetWindowText!\n\n\t\tGetWindowRect(GetDlgItem(hDlg, IDC_MD5), &rc);\n\t\tdw = rc.right - rc.left;\n\t\tdh = rc.bottom - rc.top;\n\t\tDrawTextU(hDC, hash_str[0], -1, &rc, DT_CALCRECT);\n\t\tdw = rc.right - rc.left - dw + 12;\t// Ideally we'd compute the field borders from the system, but hey...\n\t\tdh = rc.bottom - rc.top - dh + 6;\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SHA256), 0, 0, dw, dh, 1.0f);\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SHA512), 0, 0, dw, dh, 1.0f);\n\n\t\tGetWindowRect(GetDlgItem(hDlg, IDC_SHA1), &rc);\n\t\tdw = rc.right - rc.left;\n\t\tDrawTextU(hDC, hash_str[1], -1, &rc, DT_CALCRECT);\n\t\tdw = rc.right - rc.left - dw + 12;\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_MD5), 0, 0, dw, 0, 1.0f);\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SHA1), 0, 0, dw, 0, 1.0f);\n\t\tResizeButtonHeight(hDlg, IDOK);\n\n\t\tsafe_release_dc(GetDlgItem(hDlg, IDC_MD5), hDC);\n\n\t\tif (image_path != NULL) {\n\t\t\tfor (i = (int)strlen(image_path); (i > 0) && (image_path[i] != '\\\\'); i--);\n\t\t\tSetWindowTextU(hDlg, &image_path[i + 1]);\n\t\t}\n\t\tSetDarkModeForChild(hDlg);\n\t\t// Set focus on the OK button\n\t\tSendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDOK), TRUE);\n\t\tCenterDialog(hDlg, NULL);\n\t\tbreak;\n\tcase WM_NCDESTROY:\n\t\tsafe_delete_object(hFont);\n\t\tbreak;\n\tcase WM_COMMAND:\n\t\tswitch (LOWORD(wParam)) {\n\t\tcase IDOK:\n\t\tcase IDCANCEL:\n\t\t\treset_localization(IDD_HASH);\n\t\t\tEndDialog(hDlg, LOWORD(wParam));\n\t\t\treturn (INT_PTR)TRUE;\n\t\t}\n\t}\n\treturn (INT_PTR)FALSE;\n}\n\n/* Individual thread that computes one of MD5, SHA1, SHA256 or SHA512 in parallel */\nDWORD WINAPI IndividualHashThread(void* param)\n{\n\tHASH_CONTEXT hash_ctx = { {0} }; // There's a memset in hash_init, but static analyzers still bug us\n\tuint32_t i = (uint32_t)(uintptr_t)param, j;\n\n\thash_init[i](&hash_ctx);\n\t// Signal that we're ready to service requests\n\tif (!SetEvent(thread_ready[i]))\n\t\tgoto error;\n\n\t// Wait for requests\n\twhile (1) {\n\t\tif (WaitForSingleObject(data_ready[i], WAIT_TIME) != WAIT_OBJECT_0) {\n\t\t\tuprintf(\"Failed to wait for event for hash thread #%d: %s\", i, WindowsErrorString());\n\t\t\treturn 1;\n\t\t}\n\t\tif (read_size[proc_bufnum] != 0) {\n\t\t\thash_write[i](&hash_ctx, buffer[proc_bufnum], (size_t)read_size[proc_bufnum]);\n\t\t\tif (!SetEvent(thread_ready[i]))\n\t\t\t\tgoto error;\n\t\t} else {\n\t\t\thash_final[i](&hash_ctx);\n\t\t\tmemset(&hash_str[i], 0, ARRAYSIZE(hash_str[i]));\n\t\t\tfor (j = 0; j < hash_count[i]; j++) {\n\t\t\t\thash_str[i][2 * j] = ((hash_ctx.buf[j] >> 4) < 10) ?\n\t\t\t\t\t((hash_ctx.buf[j] >> 4) + '0') : ((hash_ctx.buf[j] >> 4) - 0xa + 'a');\n\t\t\t\thash_str[i][2 * j + 1] = ((hash_ctx.buf[j] & 15) < 10) ?\n\t\t\t\t\t((hash_ctx.buf[j] & 15) + '0') : ((hash_ctx.buf[j] & 15) - 0xa + 'a');\n\t\t\t}\n\t\t\thash_str[i][2 * j] = 0;\n\t\t\treturn 0;\n\t\t}\n\t}\nerror:\n\tuprintf(\"Failed to set event for hash thread #%d: %s\", i, WindowsErrorString());\n\treturn 1;\n}\n\nDWORD WINAPI HashThread(void* param)\n{\n\tDWORD_PTR* thread_affinity = (DWORD_PTR*)param;\n\tHANDLE hash_thread[HASH_MAX] = { NULL, NULL, NULL, NULL };\n\tDWORD wr;\n\tVOID* fd = NULL;\n\tuint64_t processed_bytes;\n\tint i, read_bufnum, r = -1;\n\tint num_hashes = HASH_MAX - (enable_extra_hashes ? 0 : 1);\n\n\tif ((image_path == NULL) || (thread_affinity == NULL))\n\t\tExitThread(r);\n\n\tuprintf(\"\\r\\nComputing hash for '%s'...\", image_path);\n\n\tif (thread_affinity[0] != 0)\n\t\t// Use the first affinity mask, as our read thread is the least\n\t\t// CPU intensive (mostly waits on disk I/O or on the other threads)\n\t\t// whereas the OS is likely to requisition the first Core, which\n\t\t// is usually in this first mask, for other tasks.\n\t\tSetThreadAffinityMask(GetCurrentThread(), thread_affinity[0]);\n\n\tfor (i = 0; i < num_hashes; i++) {\n\t\t// NB: Can't use a single manual-reset event for data_ready as we\n\t\t// wouldn't be able to ensure the event is reset before the thread\n\t\t// gets into its next wait loop\n\t\tdata_ready[i] = CreateEvent(NULL, FALSE, FALSE, NULL);\n\t\tthread_ready[i] = CreateEvent(NULL, FALSE, FALSE, NULL);\n\t\tif ((data_ready[i] == NULL) || (thread_ready[i] == NULL)) {\n\t\t\tuprintf(\"Unable to create hash thread event: %s\", WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\thash_thread[i] = CreateThread(NULL, 0, IndividualHashThread, (LPVOID)(uintptr_t)i, 0, NULL);\n\t\tif (hash_thread[i] == NULL) {\n\t\t\tuprintf(\"Unable to start hash thread #%d\", i);\n\t\t\tgoto out;\n\t\t}\n\t\tSetThreadPriority(hash_thread[i], default_thread_priority);\n\t\tif (thread_affinity[i+1] != 0)\n\t\t\tSetThreadAffinityMask(hash_thread[i], thread_affinity[i+1]);\n\t}\n\n\tfd = CreateFileAsync(image_path, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN);\n\tif (fd == NULL) {\n\t\tuprintf(\"Could not open file: %s\", WindowsErrorString());\n\t\tErrorStatus = RUFUS_ERROR(ERROR_OPEN_FAILED);\n\t\tgoto out;\n\t}\n\n\tread_bufnum = 0;\n\tproc_bufnum = 1;\n\tread_size[proc_bufnum] = 1;\t// To avoid early loop exit\n\tUpdateProgressWithInfoInit(hMainDialog, FALSE);\n\n\t// Start the initial read\n\tReadFileAsync(fd, buffer[read_bufnum], BUFFER_SIZE);\n\n\tfor (processed_bytes = 0; read_size[proc_bufnum] != 0; processed_bytes += read_size[proc_bufnum]) {\n\t\t// 0. Update the progress and check for cancel\n\t\tUpdateProgressWithInfo(OP_NOOP_WITH_TASKBAR, MSG_271, processed_bytes, img_report.image_size);\n\t\tCHECK_FOR_USER_CANCEL;\n\n\t\t// 1. Wait for the current read operation to complete (and update the read size)\n\t\tif ((!WaitFileAsync(fd, DRIVE_ACCESS_TIMEOUT)) ||\n\t\t\t(!GetSizeAsync(fd, &read_size[read_bufnum]))) {\n\t\t\tuprintf(\"Read error: %s\", WindowsErrorString());\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_READ_FAULT);\n\t\t\tgoto out;\n\t\t}\n\n\t\t// 2. Switch to the next reading buffer\n\t\tread_bufnum = (read_bufnum + 1) % NUM_BUFFERS;\n\n\t\t// 3. Launch the next asynchronous read operation\n\t\tReadFileAsync(fd, buffer[read_bufnum], BUFFER_SIZE);\n\n\t\t// 4. Wait for all the hash threads to indicate that they are ready to process data\n\t\twr = WaitForMultipleObjects(num_hashes, thread_ready, TRUE, WAIT_TIME);\n\t\tif (wr != WAIT_OBJECT_0) {\n\t\t\tif (wr == STATUS_TIMEOUT)\n\t\t\t\tSetLastError(ERROR_TIMEOUT);\n\t\t\tuprintf(\"Hash threads failed to signal: %s\", WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\n\t\t// 5. Set the target buffer we want to process to the buffer we just read data into\n\t\t// Note that this variable should only be updated AFTER all the threads have signalled.\n\t\tproc_bufnum = (read_bufnum + NUM_BUFFERS - 1) % NUM_BUFFERS;\n\n\t\t// 6. Signal the waiting threads that there is data available\n\t\tfor (i = 0; i < num_hashes; i++) {\n\t\t\tif (!SetEvent(data_ready[i])) {\n\t\t\t\tuprintf(\"Could not signal hash thread %d: %s\", i, WindowsErrorString());\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Our last event with read_size=0 signaled the threads to exit - wait for that to happen\n\tif (WaitForMultipleObjects(num_hashes, hash_thread, TRUE, WAIT_TIME) != WAIT_OBJECT_0) {\n\t\tuprintf(\"Hash threads did not finalize: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tuprintf(\"  MD5:    %s\", hash_str[0]);\n\tuprintf(\"  SHA1:   %s\", hash_str[1]);\n\tuprintf(\"  SHA256: %s\", hash_str[2]);\n\tif (enable_extra_hashes) {\n\t\tchar c = hash_str[3][SHA512_HASHSIZE];\n\t\thash_str[3][SHA512_HASHSIZE] = 0;\n\t\tuprintf(\"  SHA512: %s\", hash_str[3]);\n\t\thash_str[3][SHA512_HASHSIZE] = c;\n\t\tuprintf(\"          %s\", &hash_str[3][SHA512_HASHSIZE]);\n\t}\n\tr = 0;\n\nout:\n\tfor (i = 0; i < num_hashes; i++) {\n\t\tif (hash_thread[i] != NULL)\n\t\t\tTerminateThread(hash_thread[i], 1);\n\t\tsafe_closehandle(data_ready[i]);\n\t\tsafe_closehandle(thread_ready[i]);\n\t}\n\tCloseFileAsync(fd);\n\tPostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)FALSE, 0);\n\tif (r == 0)\n\t\tMyDialogBox(hMainInstance, IDD_HASH, hMainDialog, HashCallback);\n\tExitThread(r);\n}\n\n/*\n * The following 2 calls are used to check whether a buffer/file is in our hash DB\n */\nBOOL IsBufferInDB(const unsigned char* buf, const size_t len)\n{\n\tint i;\n\tuint8_t hash[SHA256_HASHSIZE];\n\tif (!HashBuffer(HASH_SHA256, buf, len, hash))\n\t\treturn FALSE;\n\tfor (i = 0; i < ARRAYSIZE(sha256db); i += SHA256_HASHSIZE)\n\t\tif (memcmp(hash, &sha256db[i], SHA256_HASHSIZE) == 0)\n\t\t\treturn TRUE;\n\treturn FALSE;\n}\n\nBOOL IsFileInDB(const char* path)\n{\n\tint i;\n\tuint8_t hash[SHA256_HASHSIZE];\n\tif (!HashFile(HASH_SHA256, path, hash))\n\t\treturn FALSE;\n\tfor (i = 0; i < ARRAYSIZE(sha256db); i += SHA256_HASHSIZE)\n\t\tif (memcmp(hash, &sha256db[i], SHA256_HASHSIZE) == 0)\n\t\t\treturn TRUE;\n\treturn FALSE;\n}\n\nBOOL FileMatchesHash(const char* path, const char* str)\n{\n\tuint8_t hash[SHA256_HASHSIZE];\n\tif (!HashFile(HASH_SHA256, path, hash))\n\t\treturn FALSE;\n\treturn (memcmp(hash, StringToHash(str), SHA256_HASHSIZE) == 0);\n}\n\nBOOL BufferMatchesHash(const uint8_t* buf, const size_t len, const char* str)\n{\n\tuint8_t hash[SHA256_HASHSIZE];\n\tif (!HashBuffer(HASH_SHA256, buf, len, hash))\n\t\treturn FALSE;\n\treturn (memcmp(hash, StringToHash(str), SHA256_HASHSIZE) == 0);\n}\n\nstatic BOOL IsRevokedBySbat(uint8_t* buf, uint32_t len)\n{\n\tchar* sbat = NULL, *version_str;\n\tuint32_t i, j, sbat_len;\n\tsbat_entry_t entry;\n\n\t// Fall back to embedded sbat_level.txt if we couldn't access remote\n\tif (sbat_entries == NULL) {\n\t\tsbat_level_txt = safe_strdup(db_sbat_level_txt);\n\t\tsbat_entries = GetSbatEntries(sbat_level_txt);\n\t}\n\tassert(sbat_entries != NULL);\n\tif (sbat_entries == NULL)\n\t\treturn FALSE;\n\n\t// Look for a .sbat section\n\tsbat = GetPeSection(buf, \".sbat\", &sbat_len);\n\tif (sbat == NULL || sbat < (char*)buf || sbat >= (char*)buf + len)\n\t\treturn FALSE;\n\n\tfor (i = 0; sbat[i] != '\\0'; ) {\n\t\twhile (sbat[i] == '\\n')\n\t\t\ti++;\n\t\tif (sbat[i] == '\\0')\n\t\t\tbreak;\n\t\tentry.product = &sbat[i];\n\t\tfor (; sbat[i] != ',' && sbat[i] != '\\0' && sbat[i] != '\\n'; i++);\n\t\tif (sbat[i] == '\\0' || sbat[i] == '\\n')\n\t\t\tbreak;\n\t\tsbat[i++] = '\\0';\n\t\tversion_str = &sbat[i];\n\t\tfor (; sbat[i] != ',' && sbat[i] != '\\0' && sbat[i] != '\\n'; i++);\n\t\tsbat[i++] = '\\0';\n\t\tentry.version = atoi(version_str);\n\t\tuuprintf(\"  SBAT: %s,%d\", entry.product, entry.version);\n\t\tfor (; sbat[i] != '\\0' && sbat[i] != '\\n'; i++);\n\t\tif (entry.version == 0)\n\t\t\tcontinue;\n\t\tfor (j = 0; sbat_entries[j].product != NULL; j++) {\n\t\t\tif (strcmp(entry.product, sbat_entries[j].product) == 0 && entry.version < sbat_entries[j].version) {\n\t\t\t\tuprintf(\"  SBAT version for '%s' (%d) is lower than the current minimum SBAT version (%d)!\",\n\t\t\t\t\tentry.product, entry.version, sbat_entries[j].version);\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn FALSE;\n}\n\n// NB: Can be tested using en_windows_8_1_x64_dvd_2707217.iso\nextern BOOL UseLocalDbx(int arch);\nstatic BOOL IsRevokedByDbx(uint8_t* hash, uint8_t* buf, uint32_t len)\n{\n\tEFI_VARIABLE_AUTHENTICATION_2* efi_var_auth;\n\tEFI_SIGNATURE_LIST* efi_sig_list;\n\tBYTE* dbx_data = NULL;\n\tBOOL ret = FALSE, needs_free = FALSE;\n\tDWORD dbx_size = 0;\n\tchar dbx_name[32], path[MAX_PATH];\n\tuint32_t i, fluff_size, nb_entries;\n\n\ti = MachineToArch(GetPeArch(buf));\n\tif (i == ARCH_UNKNOWN)\n\t\tgoto out;\n\n\t// Check if a more recent local DBX should be preferred over embedded\n\tstatic_sprintf(dbx_name, \"dbx_%s.bin\", efi_archname[i]);\n\tif (UseLocalDbx(i)) {\n\t\tstatic_sprintf(path, \"%s\\\\%s\\\\%s\", app_data_dir, FILES_DIR, dbx_name);\n\t\tdbx_size = read_file(path, &dbx_data);\n\t\tneeds_free = (dbx_data != NULL);\n\t\tif (needs_free)\n\t\t\tduprintf(\"  Using local %s for revocation check\", path);\n\t}\n\tif (dbx_size == 0) {\n\t\tdbx_data = (BYTE*)GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_DBX + i),\n\t\t\t_RT_RCDATA, dbx_name, &dbx_size, FALSE);\n\t}\n\tif (dbx_data == NULL || dbx_size <= sizeof(EFI_VARIABLE_AUTHENTICATION_2))\n\t\tgoto out;\n\n\tefi_var_auth = (EFI_VARIABLE_AUTHENTICATION_2*)dbx_data;\n\tfluff_size = efi_var_auth->AuthInfo.Hdr.dwLength + sizeof(EFI_TIME);\n\tif (dbx_size <= fluff_size)\n\t\tgoto out;\n\tefi_sig_list = (EFI_SIGNATURE_LIST*)&dbx_data[fluff_size];\n\tfluff_size += sizeof(EFI_SIGNATURE_LIST);\n\tif (dbx_size <= fluff_size)\n\t\tgoto out;\n\t// Expect SHA-256 hashes\n\tif (!CompareGUID(&efi_sig_list->SignatureType, &EFI_CERT_SHA256_GUID)) {\n\t\tuprintf(\"  Warning: %s is not using SHA-256 hashes - Cannot check for UEFI revocation!\", dbx_name);\n\t\tgoto out;\n\t}\n\tfluff_size += efi_sig_list->SignatureHeaderSize;\n\tassert(efi_sig_list->SignatureSize != 0);\n\tnb_entries = (efi_sig_list->SignatureListSize - efi_sig_list->SignatureHeaderSize - sizeof(EFI_SIGNATURE_LIST)) / efi_sig_list->SignatureSize;\n\tassert(dbx_size >= fluff_size + nb_entries * efi_sig_list->SignatureSize);\n\n\tfluff_size += sizeof(GUID);\n\tfor (i = 0; i < nb_entries && !ret; i++) {\n\t\tif (memcmp(hash, &dbx_data[fluff_size + i * efi_sig_list->SignatureSize], SHA256_HASHSIZE) == 0)\n\t\t\tret = TRUE;\n\t}\n\nout:\n\tif (needs_free)\n\t\tfree(dbx_data);\n\treturn ret;\n}\n\nstatic BOOL IsRevokedBySvn(uint8_t* buf, uint32_t len)\n{\n\twchar_t* rsrc_name = NULL;\n\tuint8_t *root;\n\tuint32_t i, j, rsrc_rva, rsrc_len, *svn_ver;\n\tIMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf;\n\tIMAGE_NT_HEADERS32* pe_header;\n\tIMAGE_NT_HEADERS64* pe64_header;\n\tIMAGE_DATA_DIRECTORY img_data_dir;\n\n\tif (sbat_entries == NULL)\n\t\treturn FALSE;\n\n\tfor (i = 0; sbat_entries[i].product != NULL; i++) {\n\t\t// SVN entries are expected to be uppercase\n\t\tfor (j = 0; j < strlen(sbat_entries[i].product) && isupper(sbat_entries[i].product[j]); j++);\n\t\tif (j < strlen(sbat_entries[i].product))\n\t\t\tcontinue;\n\t\trsrc_name = utf8_to_wchar(sbat_entries[i].product);\n\t\tif (rsrc_name == NULL)\n\t\t\tcontinue;\n\n\t\tpe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew];\n\t\tif (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) {\n\t\t\timg_data_dir = pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE];\n\t\t} else {\n\t\t\tpe64_header = (IMAGE_NT_HEADERS64*)pe_header;\n\t\t\timg_data_dir = pe64_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE];\n\t\t}\n\n\t\troot = RvaToPhysical(buf, img_data_dir.VirtualAddress);\n\t\trsrc_rva = FindResourceRva(rsrc_name, root, root, &rsrc_len);\n\t\tsafe_free(rsrc_name);\n\t\tif (rsrc_rva != 0) {\n\t\t\tif (rsrc_len == sizeof(uint32_t)) {\n\t\t\t\tsvn_ver = (uint32_t*)RvaToPhysical(buf, rsrc_rva);\n\t\t\t\tif (svn_ver != NULL) {\n\t\t\t\t\tuuprintf(\"  SVN version: %d.%d\", *svn_ver >> 16, *svn_ver & 0xffff);\n\t\t\t\t\tif (*svn_ver < sbat_entries[i].version) {\n\t\t\t\t\t\tuprintf(\"  SVN version %d.%d is lower than required minimum SVN version %d.%d!\",\n\t\t\t\t\t\t\t*svn_ver >> 16, *svn_ver & 0xffff, sbat_entries[i].version >> 16, sbat_entries[i].version & 0xffff);\n\t\t\t\t\t\treturn TRUE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tuprintf(\"  Warning: Unexpected Secure Version Number size\");\n\t\t\t}\n\t\t}\n\t}\n\treturn FALSE;\n}\n\nstatic BOOL IsRevokedByCert(cert_info_t* info)\n{\n\tuint32_t i;\n\n\t// TODO: Enable this for non expert mode after enforcement of PCA2011 cert revocation\n\tif (!expert_mode)\n\t\treturn FALSE;\n\n\t// Fall back to embedded Secure Boot thumbprints if we couldn't access remote\n\tif (sb_revoked_certs == NULL) {\n\t\tsb_revoked_txt = safe_strdup(db_sb_revoked_txt);\n\t\tsb_revoked_certs = GetThumbprintEntries(sb_revoked_txt);\n\t}\n\tassert(sb_revoked_certs != NULL && sb_revoked_certs->count != 0);\n\tif (sb_revoked_certs == NULL)\n\t\treturn FALSE;\n\n\tfor (i = 0; i < sb_revoked_certs->count; i++) {\n\t\tif (memcmp(info->thumbprint, sb_revoked_certs->list[i], SHA1_HASHSIZE) == 0) {\n\t\t\tuuprintf(\"  Found '%s' revoked certificate\", info->name);\n\t\t\treturn TRUE;\n\t\t}\n\t}\n\treturn FALSE;\n}\n\nBOOL IsSignedBySecureBootAuthority(uint8_t* buf, uint32_t len)\n{\n\tuint32_t i;\n\tuint8_t* cert;\n\tcert_info_t info;\n\n\tif (buf == NULL || len < 0x100)\n\t\treturn FALSE;\n\n\t// Get the signer/issuer info\n\tcert = GetPeSignatureData(buf);\n\t// Secure Boot Authority is always an issuer\n\tif (GetIssuerCertificateInfo(cert, &info) != 2)\n\t\treturn FALSE;\n\n\t// Fall back to embedded Secure Boot thumbprints if we couldn't access remote\n\tif (sb_active_certs == NULL) {\n\t\tsb_active_txt = safe_strdup(db_sb_active_txt);\n\t\tsb_active_certs = GetThumbprintEntries(sb_active_txt);\n\t}\n\t// If we still manage to get an empty list at this stage, I sure wanna know about it!\n\tassert(sb_active_certs != NULL && sb_active_certs->count != 0);\n\tif (sb_active_certs == NULL || sb_active_certs->count == 0)\n\t\treturn FALSE;\n\n\tfor (i = 0; i < sb_active_certs->count; i++) {\n\t\tif (memcmp(info.thumbprint, sb_active_certs->list[i], SHA1_HASHSIZE) == 0)\n\t\t\treturn TRUE;\n\t}\n\treturn FALSE;\n}\n\nint IsBootloaderRevoked(uint8_t* buf, uint32_t len)\n{\n\tuint32_t i;\n\tuint8_t hash[SHA256_HASHSIZE];\n\tIMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf;\n\tIMAGE_NT_HEADERS32* pe_header;\n\tuint8_t* cert;\n\tcert_info_t info;\n\tint r, revoked = 0;\n\n\tif (buf == NULL || len < 0x100 || dos_header->e_magic != IMAGE_DOS_SIGNATURE)\n\t\treturn -2;\n\tpe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew];\n\tif (pe_header->Signature != IMAGE_NT_SIGNATURE)\n\t\treturn -2;\n\n\t// Get the signer/issuer info\n\tcert = GetPeSignatureData(buf);\n\tr = GetIssuerCertificateInfo(cert, &info);\n\tif (r == 0) {\n\t\tuprintf(\"  (Unsigned Bootloader)\");\n\t} else if (r > 0) {\n\t\tuprintf(\"  Signed by '%s'\", info.name);\n\t\t// Only perform revocation checks on signed bootloaders\n\t\tif (!PE256Buffer(buf, len, hash))\n\t\t\treturn -1;\n\t\t// Check for UEFI DBX revocation\n\t\tif (IsRevokedByDbx(hash, buf, len))\n\t\t\trevoked = 1;\n\t\t// Check for Microsoft SSP revocation\n\t\tfor (i = 0; revoked == 0 && i < pe256ssp_size * SHA256_HASHSIZE; i += SHA256_HASHSIZE)\n\t\t\tif (memcmp(hash, &pe256ssp[i], SHA256_HASHSIZE) == 0)\n\t\t\t\trevoked = 2;\n\t\t// Check for Linux SBAT revocation\n\t\tif (revoked == 0 && IsRevokedBySbat(buf, len))\n\t\t\trevoked = 3;\n\t\t// Check for Microsoft SVN revocation\n\t\tif (revoked == 0 && IsRevokedBySvn(buf, len))\n\t\t\trevoked = 4;\n\t\t// Check for UEFI DBX certificate revocation\n\t\tif (revoked == 0 && IsRevokedByCert(&info))\n\t\t\trevoked = 5;\n\n\t\t// If signed and not revoked, print the various Secure Boot \"gotchas\"\n\t\tif (revoked == 0) {\n\t\t\tif (strcmp(info.name, \"Microsoft Windows Production PCA 2011\") == 0) {\n\t\t\t\tuprintf(\"  Note: This bootloader may fail Secure Boot validation on systems that\");\n\t\t\t\tuprintf(\"  have been updated to use the 'Windows UEFI CA 2023' certificate.\");\n\t\t\t} else if (strcmp(info.name, \"Windows UEFI CA 2023\") == 0) {\n\t\t\t\tuprintf(\"  Note: This bootloader will fail Secure Boot validation on systems that\");\n\t\t\t\tuprintf(\"  have not been updated to use the latest Secure Boot certificates\");\n\t\t\t} else if (strcmp(info.name, \"Microsoft Corporation UEFI CA 2011\") == 0 ||\n\t\t\t\tstrcmp(info.name, \"Microsoft UEFI CA 2023\") == 0) {\n\t\t\t\tuprintf(\"  Note: This bootloader may fail Secure Boot validation on *some* systems,\");\n\t\t\t\tuprintf(\"  unless you enable \\\"Microsoft 3rd-party UEFI CA\\\" in your 'BIOS'.\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn revoked;\n}\n\n/*\n * Updates the MD5SUMS/md5sum.txt file that some distros (Ubuntu, Mint...)\n * use to validate the media. Because we may alter some of the validated files\n * to add persistence and whatnot, we need to alter the MD5 list as a result.\n * The format of the file is expected to always be \"<MD5SUM> <FILE_PATH>\" on\n * individual lines.\n * This function is also used to finalize the md5sum.txt we create for use with\n * our uefi-md5sum bootloaders.\n */\nvoid UpdateMD5Sum(const char* dest_dir, const char* md5sum_name)\n{\n\tBOOL display_header = TRUE;\n\tBYTE* res_data;\n\tDWORD res_size;\n\tHANDLE hFile;\n\tintptr_t pos;\n\tuint32_t i, j, size, md5_size, new_size;\n\tuint8_t sum[MD5_HASHSIZE];\n\tchar md5_path[64], path1[64], path2[64], bootloader_name[32];\n\tchar *md5_data = NULL, *new_data = NULL, *str_pos, *d, *s, *p;\n\n\tif (!img_report.has_md5sum && !validate_md5sum)\n\t\treturn;\n\n\tstatic_sprintf(md5_path, \"%s\\\\%s\", dest_dir, md5sum_name);\n\tmd5_size = read_file(md5_path, (uint8_t**)&md5_data);\n\tif (md5_size == 0)\n\t\treturn;\n\n\tfor (i = 0; i < modified_files.Index; i++) {\n\t\tfor (j = 0; j < (uint32_t)strlen(modified_files.String[i]); j++)\n\t\t\tif (modified_files.String[i][j] == '\\\\')\n\t\t\t\tmodified_files.String[i][j] = '/';\n\t\tstr_pos = strstr(md5_data, &modified_files.String[i][2]);\n\t\tif (str_pos == NULL)\n\t\t\t// File is not listed in md5 sums\n\t\t\tcontinue;\n\t\tif (display_header) {\n\t\t\tuprintf(\"Updating %s:\", md5_path);\n\t\t\tdisplay_header = FALSE;\n\t\t}\n\t\tuprintf(\"● %s\", &modified_files.String[i][2]);\n\t\tpos = str_pos - md5_data;\n\t\tHashFile(HASH_MD5, modified_files.String[i], sum);\n\t\twhile ((pos > 0) && (md5_data[pos - 1] != '\\n'))\n\t\t\tpos--;\n\t\tassert(IS_HEXASCII(md5_data[pos]));\n\t\tfor (j = 0; j < 16; j++) {\n\t\t\tmd5_data[pos + 2 * j] = ((sum[j] >> 4) < 10) ? ('0' + (sum[j] >> 4)) : ('a' - 0xa + (sum[j] >> 4));\n\t\t\tmd5_data[pos + 2 * j + 1] = ((sum[j] & 15) < 10) ? ('0' + (sum[j] & 15)) : ('a' - 0xa + (sum[j] & 15));\n\t\t}\n\t}\n\n\t// If we validate md5sum we need to update the original bootloader names and add md5sum_totalbytes\n\tif (validate_md5sum) {\n\t\tnew_size = md5_size;\n\t\tnew_data = malloc(md5_size + 1024);\n\t\tassert(new_data != NULL);\n\t\tif (new_data == NULL)\n\t\t\treturn;\n\t\t// Will be nonzero if we created the file, otherwise zero\n\t\tif (md5sum_totalbytes != 0) {\n\t\t\tsnprintf(new_data, md5_size + 1024, \"# md5sum_totalbytes = 0x%llx\\n\", md5sum_totalbytes);\n\t\t\tnew_size += (uint32_t)strlen(new_data);\n\t\t\td = &new_data[strlen(new_data)];\n\t\t} else {\n\t\t\td = new_data;\n\t\t}\n\t\ts = md5_data;\n\t\t// Extract the MD5Sum bootloader(s)\n\t\tfor (i = 1; i < ARRAYSIZE(efi_archname); i++) {\n\t\t\tstatic_sprintf(bootloader_name, \"boot%s.efi\", efi_archname[i]);\n\t\t\tstatic_sprintf(path1, \"%s\\\\efi\\\\boot\\\\boot%s.efi\", dest_dir, efi_archname[i]);\n\t\t\tif (!PathFileExistsA(path1))\n\t\t\t\tcontinue;\n\t\t\tres_data = (BYTE*)GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_MD5_BOOT + i),\n\t\t\t\t_RT_RCDATA, bootloader_name, &res_size, FALSE);\n\t\t\tstatic_strcpy(path2, path1);\n\t\t\tpath2[strlen(path2) - 4] = 0;\n\t\t\tstatic_strcat(path2, \"_original.efi\");\n\t\t\tif (res_data == NULL || !MoveFileU(path1, path2)) {\n\t\t\t\tuprintf(\"Could not rename: %s → %s\", path1, path2);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tuprintf(\"Renamed: %s → %s\", path1, path2);\n\t\t\thFile = CreateFileA(path1, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL,\n\t\t\t\tCREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\n\t\t\tif ((hFile == NULL) || (hFile == INVALID_HANDLE_VALUE)) {\n\t\t\t\tuprintf(\"Could not create '%s': %s.\", path1, WindowsErrorString());\n\t\t\t\tMoveFileU(path2, path1);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!WriteFileWithRetry(hFile, res_data, res_size, NULL, WRITE_RETRIES)) {\n\t\t\t\tuprintf(\"Could not write '%s': %s.\", path1, WindowsErrorString());\n\t\t\t\tsafe_closehandle(hFile);\n\t\t\t\tMoveFileU(path2, path1);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tsafe_closehandle(hFile);\n\t\t\tuprintf(\"Created: %s (%s)\", path1, SizeToHumanReadable(res_size, FALSE, FALSE));\n\t\t}\n\t\t// Rename the original bootloaders if present in md5sum.txt\n\t\tfor (p = md5_data; (p = StrStrIA(p, \" ./efi/boot/boot\")) != NULL; ) {\n\t\t\tfor (i = 1; i < ARRAYSIZE(efi_archname); i++) {\n\t\t\t\tstatic_sprintf(bootloader_name, \"boot%s.efi\", efi_archname[i]);\n\t\t\t\tif (p[12 + strlen(bootloader_name)] != 0x0a)\n\t\t\t\t\tcontinue;\n\t\t\t\tp[12 + strlen(bootloader_name)] = 0;\n\t\t\t\tif (lstrcmpiA(&p[12], bootloader_name) == 0) {\n\t\t\t\t\tsize = (uint32_t)(p - s) + 12 + (uint32_t)strlen(bootloader_name) - 4;\n\t\t\t\t\tmemcpy(d, s, size);\n\t\t\t\t\td = &d[size];\n\t\t\t\t\tstrcpy(d, \"_original.efi\\n\");\n\t\t\t\t\tnew_size += 9;\n\t\t\t\t\td = &d[14];\n\t\t\t\t\ts = &p[12 + strlen(bootloader_name) + 1];\n\t\t\t\t}\n\t\t\t\tp[12 + strlen(bootloader_name)] = 0x0a;\n\t\t\t}\n\t\t\tp = &p[12];\n\t\t}\n\t\tp = &md5_data[md5_size];\n\t\tmemcpy(d, s, p - s);\n\t\tfree(md5_data);\n\t\tmd5_data = new_data;\n\t\tmd5_size = new_size;\n\t}\n\n\twrite_file(md5_path, md5_data, md5_size);\n\tfree(md5_data);\n}\n\n/* Convert an (unprefixed) hex string to hash binary. Non concurrent. */\nuint8_t* StringToHash(const char* str)\n{\n\tstatic uint8_t ret[MAX_HASHSIZE];\n\tsize_t i, len = safe_strlen(str);\n\tuint8_t val = 0;\n\tchar c;\n\n\tif_assert_fails(len / 2 == MD5_HASHSIZE || len / 2 == SHA1_HASHSIZE ||\n\t\tlen / 2 == SHA256_HASHSIZE || len / 2 == SHA512_HASHSIZE)\n\t\treturn NULL;\n\tmemset(ret, 0, sizeof(ret));\n\n\tfor (i = 0; i < len; i++) {\n\t\tval <<= 4;\n\t\tc = tolower(str[i]);\n\t\tif_assert_fails((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f'))\n\t\t\treturn NULL;\n\t\tval |= ((c - '0') < 0xa) ? (c - '0') : (c - 'a' + 0xa);\n\t\tif (i % 2)\n\t\t\tret[i / 2] = val;\n\t}\n\n\treturn ret;\n}\n\n#if defined(_DEBUG) || defined(TEST) || defined(ALPHA)\nconst char test_msg[] = \"Did you ever hear the tragedy of Darth Plagueis The Wise? \"\n\t\"I thought not. It's not a story the Jedi would tell you. It's a Sith legend. \"\n\t\"Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could \"\n\t\"use the Force to influence the midichlorians to create life... He had such a \"\n\t\"knowledge of the dark side that he could even keep the ones he cared about \"\n\t\"from dying. The dark side of the Force is a pathway to many abilities some \"\n\t\"consider to be unnatural. He became so powerful... the only thing he was afraid \"\n\t\"of was losing his power, which eventually, of course, he did. Unfortunately, \"\n\t\"he taught his apprentice everything he knew, then his apprentice killed him \"\n\t\"in his sleep. Ironic. He could save others from death, but not himself.\";\n\n/*\n * Yeah, I'm not gonna bother with binary arrays of hash values since\n * they have different sizes and MSVC is an ass with initializing unions.\n * Much rather copy paste from md5sum/sha#sum output from Linux and just\n * convert the string.\n */\nconst char* test_hash[HASH_MAX][4] = {\n\t{\n\t\t\"d41d8cd98f00b204e9800998ecf8427e\",\n\t\t\"74cac558072300385f7ab4dff7465e3c\",\n\t\t\"f99d37d3bee20f9c0ca3204991be2698\",\n\t\t\"e0ea372ac14a3574167543b851d4babb\"\n\t}, {\n\t\t\"da39a3ee5e6b4b0d3255bfef95601890afd80709\",\n\t\t\"a5bac908bf3e51ff0036a94d43b4f3bd2d01a75d\",\n\t\t\"8aa6c0064b013b8a6f4e88a0421d39bbf07e2e1b\",\n\t\t\"09463ec0b5917706c9cb1d6b164b2582c04018e0\"\n\t}, {\n\t\t\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\n\t\t\"62c1a97974dfe6848942794be4f2f027b5f4815e1eb76db63a30f0e290b5c1c4\",\n\t\t\"dbca61af192edba49ea215c49a23feee302c98cc4d2c018347fe78db572f07a5\",\n\t\t\"c9b43c1058bc7f7661619e9d983fc9d31356e97f9195a2405ab972d0737b11bf\"\n\t}, {\n\t\t\"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e\",\n\t\t\"4913ace12f1169e5a5f524ef87ab8fc39dff0418851fbbbb1f609d3261b2b4072bd1746e6accb91bf38f3b1b3d59b0a60af5de67aab87b76c2456fde523efc1c\",\n\t\t\"33df8a16dd624cbc4613b5ae902b722411c7e90f37dd3947c9a86e01c51ada68fcf5a0cd4ca928d7cc1ed469bb34c2ed008af069d8b28cc4512e6c8b2e7a5592\",\n\t\t\"999b4eae14de584cce5fa5962b768beda076b06df00d384bb502c6389df8159c006a5b94d1324f47e8d7bd2efe9d8d3dc1fa1429798e49826987ab5ae7ed5c21\"\n\t},\n};\n\n/* Tests the message digest algorithms */\nint TestHashes(void)\n{\n\tconst uint32_t blocksize[HASH_MAX] = { MD5_BLOCKSIZE, SHA1_BLOCKSIZE, SHA256_BLOCKSIZE, SHA512_BLOCKSIZE };\n\tconst char* hash_name[4] = { \"MD5   \", \"SHA1  \", \"SHA256\", \"SHA512\" };\n\tint i, j, errors = 0;\n\tuint8_t hash[MAX_HASHSIZE];\n\tsize_t full_msg_len = strlen(test_msg);\n\tchar* msg = malloc(full_msg_len + 1);\n\tif (msg == NULL)\n\t\treturn -1;\n\n\t/* Display accelerations available */\n\tuprintf(\"SHA1   acceleration: %s\", (cpu_has_sha1_accel ? \"TRUE\" : \"FALSE\"));\n\tuprintf(\"SHA256 acceleration: %s\", (cpu_has_sha256_accel ? \"TRUE\" : \"FALSE\"));\n\n\tfor (j = 0; j < HASH_MAX; j++) {\n\t\tsize_t copy_msg_len[4];\n\t\tcopy_msg_len[0] = 0;\n\t\tcopy_msg_len[1] = 3;\n\t\t// Designed to test the case where we pad into the total message length area\n\t\t// For SHA-512 this is 128 - 16 = 112 bytes, for others 64 - 8 = 56 bytes\n\t\tcopy_msg_len[2] = blocksize[j] - (blocksize[j] >> 3);\n\t\tcopy_msg_len[3] = full_msg_len;\n\t\tfor (i = 0; i < 4; i++) {\n\t\t\tmemset(msg, 0, full_msg_len + 1);\n\t\t\tif (i != 0)\n\t\t\t\tmemcpy(msg, test_msg, copy_msg_len[i]);\n\t\t\tHashBuffer(j, msg, copy_msg_len[i], hash);\n\t\t\tif (memcmp(hash, StringToHash(test_hash[j][i]), hash_count[j]) != 0) {\n\t\t\t\tuprintf(\"Test %s %d: FAIL\", hash_name[j], i);\n\t\t\t\terrors++;\n\t\t\t} else {\n\t\t\t\tuprintf(\"Test %s %d: PASS\", hash_name[j], i);\n\t\t\t}\n\t\t}\n\t}\n\n\tfree(msg);\n\treturn errors;\n}\n#endif\n"
  },
  {
    "path": "src/hdd_vs_ufd.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * SMART HDD vs Flash detection - isHDD() tables\n * Copyright © 2013-2023 Pete Batard <pete@akeo.ie>\n *\n * Based in part on drivedb.h from Smartmontools:\n * http://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools/drivedb.h\n * Copyright © 2003-11 Philip Williams, Bruce Allen\n * Copyright © 2008-13 Christian Franke <smartmontools-support@lists.sourceforge.net>\n *\n * Also based on entries listed in the identification flash database\n * (http://flashboot.ru/iflash/saved/) as well as the Linux USB IDs\n * (http://www.linux-usb.org/usb.ids)\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n#pragma once\n\n#include <stdint.h>\n\n/*\n * A positive score means HDD, a negative one an UFD\n * The higher the absolute value, the greater the probability\n */\ntypedef struct {\n\tconst char* name;\n\tconst int score;\n} str_score_t;\n\ntypedef struct {\n\tconst uint16_t vid;\n\tconst int score;\n} vid_score_t;\n\ntypedef struct {\n\tconst uint16_t vid;\n\tconst uint16_t pid;\n\tconst int score;\n} vidpid_score_t;\n\n/* String identifiers:\n * Some info comes from http://knowledge.seagate.com/articles/en_US/FAQ/204763en,\n * other http://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools/drivedb.h\n * '#' means any number in [0-9]\n */\nstatic str_score_t str_score[] = {\n\t{ \"IC#\", 10 },\n\t{ \"ST#\", 10 },\n\t{ \"MX#\", 10 },\n\t{ \"WDC\", 10 },\n\t{ \"IBM\", 10 },\n\t{ \"STM#\", 10 },\n\t{ \"HDS#\", 10 },\t\t// These Hitachi drives are a PITA\n\t{ \"HDP#\", 10 },\n\t{ \"HDT#\", 10 },\n\t{ \"HTE#\", 10 },\n\t{ \"HTS#\", 10 },\n\t{ \"HUA#\", 10 },\n\t{ \"APPLE\", 10 },\n\t{ \"INTEL\", 10 },\n\t{ \"MAXTOR\", 10 },\n\t{ \"HITACHI\", 10 },\n\t{ \"SEAGATE\", 10 },\n\t{ \"SAMSUNG\", 5 },\n\t{ \"FUJITSU\", 10 },\n\t{ \"TOSHIBA\", 5 },\n\t{ \"QUANTUM\", 10 },\n\t{ \"EXCELSTOR\", 10 },\n\t{ \"CORSAIR\", -15 },\n\t{ \"KINGMAX\", -15 },\n\t{ \"KINGSTON\", -15 },\n\t{ \"LEXAR\", -15 },\n\t{ \"MUSHKIN\", -15 },\n\t{ \"PNY\", -15 },\n\t{ \"SANDISK\", -15 },\n\t{ \"TRANSCEND\", -15 },\n};\n\nstatic str_score_t str_adjust[] = {\n\t{ \"Gadget\", -10 },\n\t{ \"Flash\", -10 },\n\t{ \"SD-CARD\", -10 },\n\t{ \"uSD Card\", -10 },\n\t{ \"HDD\", +20 },\n\t{ \"SATA\", +20 },\n\t{ \"SCSI\", +20 },\n\t{ \"SSD\", +20 }\n};\n\n/* The lists belows set a score according to VID & VID:PID\n * These were constructed as follows:\n * 1. Pick all the VID:PIDs from http://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools/drivedb.h\n * 2. Check that VID against http://flashboot.ru/iflash/saved/ as well as http://www.linux-usb.org/usb.ids\n * 3. If a lot of flash or card reader devices are returned, add the VID:PID, with a positive score,\n *    in the vidpid table (so that the default will be UFD, and HDD the exception)\n * 4. If only a few flash devices are returned, add the VID to our list with a positive score and\n *    add the flash entries in the VID:PID list with a negative score\n * 5. Add common UFD providers from http://flashboot.ru/iflash/saved/ with a negative score\n * These lists MUST be kept in increasing VID/VID:PID order\n */\nstatic vid_score_t vid_score[] = {\n\t{ 0x0011, -5 },\t\t// Kingston\n\t{ 0x03f0, -5 },\t\t// HP\n\t{ 0x0409, -10 },\t// NEC/Toshiba\n\t{ 0x0411, 5 },\t\t// Buffalo\n\t{ 0x0420, -5 },\t\t// Chipsbank\n\t{ 0x046d, -5 },\t\t// Logitech\n\t{ 0x0480, 5 },\t\t// Toshiba\n\t{ 0x048d, -10 },\t// ITE\n\t{ 0x04b4, 10 },\t\t// Cypress\n\t{ 0x04c5, 7 },\t\t// Fujitsu\n\t{ 0x04e8, 5 },\t\t// Samsung\n\t{ 0x04f3, -5 },\t\t// Elan\n\t{ 0x04fc, 5 },\t\t// Sunplus\n\t{ 0x056e, -5 },\t\t// Elecom\n\t{ 0x058f, -5 },\t\t// Alcor\n\t{ 0x059b, 7 },\t\t// Iomega\n\t{ 0x059f, 5 },\t\t// LaCie\n\t{ 0x05ab, 10 },\t\t// In-System Design\n\t{ 0x05dc, -5 },\t\t// Lexar\n\t{ 0x05e3, -5 },\t\t// Genesys Logic\n\t{ 0x067b, 7 },\t\t// Prolific\n\t{ 0x0718, -2 },\t\t// Imation\n\t{ 0x0781, -5 },\t\t// SanDisk\n\t{ 0x07ab, 8 },\t\t// Freecom\n\t{ 0x090c, -5 },\t\t// Silicon Motion (also used by Samsung)\n\t{ 0x0928, 10 },\t\t// PLX Technology\n\t{ 0x0930, -8 },\t\t// Toshiba\n\t{ 0x093a, -5 },\t\t// Pixart\n\t{ 0x0951, -5 },\t\t// Kingston\n\t{ 0x09da, -5 },\t\t// A4 Tech\n\t{ 0x0b27, -5 },\t\t// Ritek\n\t{ 0x0bc2, 10 },\t\t// Seagate\n\t{ 0x0bda, -10 },\t// Realtek\n\t{ 0x0c76, -5 },\t\t// JMTek\n\t{ 0x0cf2, -5 },\t\t// ENE\n\t{ 0x0d49, 10 },\t\t// Maxtor\n\t{ 0x0dc4, 10 },\t\t// Macpower Peripherals\n\t{ 0x1000, -5 },\t\t// Speed Tech\n\t{ 0x1002, -5 },\t\t// Hisun\n\t{ 0x1005, -5 },\t\t// Apacer\n\t{ 0x1043, -5 },\t\t// iCreate\n\t{ 0x1058, 10 },\t\t// Western Digital\n\t{ 0x1221, -5 },\t\t// Kingston (?)\n\t{ 0x12d1, -5 },\t\t// Huawei\n\t{ 0x125f, -5 },\t\t// Adata\n\t{ 0x1307, -5 },\t\t// USBest\n\t{ 0x13fd, 10 },\t\t// Initio\n\t{ 0x13fe, -5 },\t\t// Kingston\n\t{ 0x14cd, -5 },\t\t// Super Top\n\t{ 0x1516, -5 },\t\t// CompUSA\n\t{ 0x152d, 10 },\t\t// JMicron\n\t{ 0x1687, -5 },\t\t// Kingmax\n\t{ 0x174c, 3 },\t\t// ASMedia (also used by SanDisk)\n\t{ 0x1759, 8 },\t\t// LucidPort\n\t{ 0x18a5, -2 },\t\t// Verbatim\n\t{ 0x18ec, -5 },\t\t// Arkmicro\n\t{ 0x1908, -5 },\t\t// Ax216\n\t{ 0x1a4a, 10 },\t\t// Silicon Image\n\t{ 0x1b1c, -5 },\t\t// Corsair\n\t{ 0x1e3d, -5 },\t\t// Chipsbank\n\t{ 0x1f75, -2 },\t\t// Innostor\n\t{ 0x2001, -5 },\t\t// Micov\n\t{ 0x201e, -5 },\t\t// Evdo\n\t{ 0x2109, 10 },\t\t// VIA Labs\n\t{ 0x2188, -5 },\t\t// SMI\n\t{ 0x3538, -5 },\t\t// PQI\n\t{ 0x413c, -5 },\t\t// Ameco\n\t{ 0x4971, 10 },\t\t// Hitachi\n\t{ 0x5136, -5 },\t\t// Skymedi\n\t{ 0x8564, -5 },\t\t// Transcend\n\t{ 0x8644, -5 },\t\t// NandTec\n\t{ 0xeeee, -5 },\t\t// ????\n};\n\nstatic vidpid_score_t vidpid_score[] = {\n\t{ 0x03f0, 0xbd07, 10 },\t\t// HP Desktop HD BD07\n\t{ 0x0402, 0x5621, 10 },\t\t// ALi M5621\n\t// NOT in VID list as 040d:6205 is a card reader\n\t{ 0x040d, 0x6204, 10 },\t\t// Connectland BE-USB2-35BP-LCM\n\t// NOT in VID list as 043e:70e2 & 043e:70d3 are flash drives\n\t{ 0x043e, 0x70f1, 10 },\t\t// LG Mini HXD5\n\t// NOT in VID list as 0471:0855 is a flash drive\n\t{ 0x0471, 0x2021, 10 },\t\t// Philips\n\t// NOT in VID list as many UFDs and card readers exist\n\t{ 0x05e3, 0x0718, 10 },\t\t// Genesys Logic IDE/SATA Adapter\n\t{ 0x05e3, 0x0719, 10 },\t\t// Genesys Logic SATA adapter\n\t{ 0x05e3, 0x0731, 10 },\t\t// Genesys Logic GL3310 SATA 3Gb/s Bridge Controller\n\t{ 0x05e3, 0x0731, 2 },\t\t// Genesys Logic Mass Storage Device\n\t// Only one HDD device => keep in this list\n\t{ 0x0634, 0x0655, 5 },\t\t// Micron USB SSD\n\t// NOT in VID list as plenty of UFDs\n\t{ 0x0718, 0x1000, 7 },\t\t// Imation Odyssey external USB dock\n\t// Only one HDD device\n\t{ 0x0939, 0x0b16, 10 },\t\t// Toshiba Stor.E\n\t// Plenty of card readers\n\t{ 0x0c0b, 0xb001, 10 },\t\t// Dura Micro\n\t{ 0x0c0b, 0xb159, 10 },\t\t// Dura Micro 509\n\t// Meh\n\t{ 0x0e21, 0x0510, 5 },\t\t// Cowon iAudio X5\n\t{ 0x11b0, 0x6298, 10 },\t\t// Enclosure from Kingston SSDNow notebook upgrade kit\n\t// NOT in VID list as plenty of UFDs\n\t{ 0x125f, 0xa93a, 10 },\t\t// A-DATA SH93\n\t{ 0x125f, 0xa94a, 10 },\t\t// A-DATA DashDrive\n\t// NOT in VID list as plenty of card readers\n\t{ 0x14cd, 0x6116, 10 },\t\t// Super Top generic enclosure\n\t// Verbatim are way too widespread - good candidate for ATA passthrough\n\t{ 0x18a5, 0x0214, 10 },\t\t// Verbatim Portable Hard Drive\n\t{ 0x18a5, 0x0215, 10 },\t\t// Verbatim FW/USB160\n\t{ 0x18a5, 0x0216, 10 },\t\t// Verbatim External Hard Drive 47519\n\t{ 0x18a5, 0x0227, 10 },\t\t// Verbatim Pocket Hard Drive\n\t{ 0x18a5, 0x022a, 10 },\t\t// Verbatim External Hard Drive\n\t{ 0x18a5, 0x022b, 10 },\t\t// Verbatim Portable Hard Drive (Store'n'Go)\n\t{ 0x18a5, 0x0237, 10 },\t\t// Verbatim Portable Hard Drive (500 GB)\n\t// SunPlus seem to have a bunch of UFDs\n\t{ 0x1bcf, 0x0c31, 10 },\t\t// SunplusIT\n\t// Plenty of Innostor UFDs\n\t{ 0x1f75, 0x0888, 10 },\t\t// Innostor IS888\n\t// NOT in VID list as plenty of UFDs\n\t{ 0x3538, 0x0902, 10 },\t\t// PQI H560\n\t// Too many card readers to be in VID list\n\t{ 0x55aa, 0x0015, 10 },\t\t// OnSpec Hard Drive\n\t{ 0x55aa, 0x0102, 8 },\t\t// OnSpec SuperDisk\n\t{ 0x55aa, 0x0103, 10 },\t\t// OnSpec IDE Hard Drive\n\t{ 0x55aa, 0x1234, 8 },\t\t// OnSpec ATAPI Bridge\n\t{ 0x55aa, 0x2b00, 8 },\t\t// OnSpec USB->PATA\n\t// Smartmontools are uncertain about that one, and so am I\n\t{ 0x6795, 0x2756, 2 },\t\t// Sharkoon 2-Bay RAID Box\n\n\t// OCZ exceptions\n\t{ 0x0324, 0xbc06, -20 },\t// OCZ ATV USB 2.0 Flash Drive\n\t{ 0x0324, 0xbc08, -20 },\t// OCZ Rally2 / ATV USB 2.0 Flash Drive\n\t{ 0x0325, 0xac02, -20 },\t// OCZ ATV Turbo / Rally2 Dual Channel USB 2.0 Flash Drive\n\t// Buffalo exceptions\n\t{ 0x0411, 0x01e8, -20 },\t// Buffalo HD-PNTU2\n\t// Samsung exceptions\n\t{ 0x04e8, 0x0100, -20 },\t// Kingston Flash Drive (128MB)\n\t{ 0x04e8, 0x0100, -20 },\t// Connect3D Flash Drive\n\t{ 0x04e8, 0x0101, -20 },\t// Connect3D Flash Drive\n\t{ 0x04e8, 0x1a23, -20 },\t// 2 GB UFD\n\t{ 0x04e8, 0x5120, -20 },\t// 4 GB UFD\n\t{ 0x04e8, 0x6300, -20 },\t// 256 GB UFD (MUF-256DA/APC)\n\t{ 0x04e8, 0x6818, -20 },\t// 8 GB UFD\n\t{ 0x04e8, 0x6845, -20 },\t// 16 GB UFD\n\t{ 0x04e8, 0x685E, -20 },\t// 16 GB UFD\n\t// Sunplus exceptions\n\t{ 0x04fc, 0x05d8, -20 },\t// Verbatim Flash Drive\n\t{ 0x04fc, 0x5720, -20 },\t// Card Reader\n\t// LaCie exceptions\n\t{ 0x059f, 0x1027, -20 },\t// 16 GB UFD\n\t{ 0x059f, 0x103B, -20 },\t// 16 GB UFD\n\t{ 0x059f, 0x1064, -20 },\t// 16 GB UFD\n\t{ 0x059f, 0x1079, -20 },\t// LaCie XtremKey UFD\n\t// Apple exceptions\n\t{ 0x05ac, 0x8400, -20},\n\t{ 0x05ac, 0x8401, -20},\n\t{ 0x05ac, 0x8402, -20},\n\t{ 0x05ac, 0x8403, -20},\n\t{ 0x05ac, 0x8404, -20},\n\t{ 0x05ac, 0x8405, -20},\n\t{ 0x05ac, 0x8406, -20},\n\t{ 0x05ac, 0x8407, -20},\n\t// Prolific exceptions\n\t{ 0x067b, 0x2506, -20 },\t// 8 GB Micro Hard Drive\n\t{ 0x067b, 0x2517, -20 },\t// 1 GB UFD\n\t{ 0x067b, 0x2528, -20 },\t// 8 GB UFD\n\t{ 0x067b, 0x2731, -20 },\t// SD/TF Card Reader\n\t{ 0x067b, 0x2733, -20 },\t// EAGET Mass Storage USB Device\n\t{ 0x067b, 0x3400, -10 },\t// Hi-Speed Flash Disk with TruePrint AES3400\n\t{ 0x067b, 0x3500, -10 },\t// Hi-Speed Flash Disk with TruePrint AES3500\n\t// Sandisk exceptions\n\t{ 0x0781, 0x5580, -20 },\n\t// Freecom exceptions\n\t{ 0x07ab, 0xfcab, -20 },\t// 4 GB UFD\n\t// Samsung exceptions\n\t{ 0x090c, 0x1000, -20 },\t// Samsung Flash Drive\n\t// Toshiba exceptions\n\t{ 0x0930, 0x1400, -20 },\n\t{ 0x0930, 0x6533, -20 },\n\t{ 0x0930, 0x653e, -20 },\n\t{ 0x0930, 0x6544, -20 },\n\t{ 0x0930, 0x6545, -20 },\n\t// Innostor exceptions\n\t{ 0x0bc2, 0x3312, -20 },\n\t// JMicron exceptions\n\t{ 0x152d, 0x0901, -20 },\n\t// Verbatim exceptions\n\t{ 0x18a5, 0x0243, -20 },\n\t{ 0x18a5, 0x0245, -20 },\n\t{ 0x18a5, 0x0302, -20 },\n\t{ 0x18a5, 0x0304, -20 },\n\t{ 0x18a5, 0x3327, -20 },\n\t// More Innostor\n\t{ 0x1f75, 0x0917, -10 },\t// Intenso Speed Line USB Device\n\t// ??? (https://github.com/pbatard/rufus/issues/2247)\n\t{ 0x23a9, 0xef18, -10 },\n\t// No idea who these guys are. They don't exist in usb.ids.\n\t{ 0x6557, 0x0021, -5 },\n};\n"
  },
  {
    "path": "src/icon.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Extract icon from executable and set autorun.inf\n * Copyright © 2012-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <stdio.h>\n#include <string.h>\n#include <assert.h>\n\n#include \"rufus.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n\n#pragma pack(push)\n#pragma pack(2)\n\ntypedef struct\n{\n\tBYTE\t\tbWidth;\t\t\t// Width, in pixels, of the image\n\tBYTE\t\tbHeight;\t\t// Height, in pixels, of the image\n\tBYTE\t\tbColorCount;\t// Number of colors in image (0 if >=8bpp)\n\tBYTE\t\tbReserved;\t\t// Reserved ( must be 0)\n\tWORD\t\twPlanes;\t\t// Color Planes\n\tWORD\t\twBitCount;\t\t// Bits per pixel\n\tDWORD\t\tdwBytesInRes;\t// How many bytes in this resource?\n\tDWORD\t\tdwImageOffset;\t// Where in the file is this image?\n} ICONDIRENTRY, *LPICONDIRENTRY;\n\ntypedef struct\n{\n\tWORD\t\t\tidReserved;\t\t// Reserved (must be 0)\n\tWORD\t\t\tidType;\t\t\t// Resource Type (1 for icons)\n\tWORD\t\t\tidCount;\t\t// How many images?\n\tICONDIRENTRY\tidEntries[1];\t// An entry for each image (idCount of 'em)\n} ICONDIR, *LPICONDIR;\n\ntypedef struct\n{\n\tBITMAPINFOHEADER\ticHeader;\t\t// DIB header\n\tRGBQUAD\t\t\t\ticColors[1];\t// Color table\n\tBYTE\t\t\t\ticXOR[1];\t\t// DIB bits for XOR mask\n\tBYTE\t\t\t\ticAND[1];\t\t// DIB bits for AND mask\n} ICONIMAGE, *LPICONIMAGE;\n\ntypedef struct\n{\n\tBYTE\tbWidth;\t\t\t// Width, in pixels, of the image\n\tBYTE\tbHeight;\t\t// Height, in pixels, of the image\n\tBYTE\tbColorCount;\t// Number of colors in image (0 if >=8bpp)\n\tBYTE\tbReserved;\t\t// Reserved\n\tWORD\twPlanes;\t\t// Color Planes\n\tWORD\twBitCount;\t\t// Bits per pixel\n\tDWORD\tdwBytesInRes;\t// how many bytes in this resource?\n\tWORD\tnID;\t\t\t// the ID\n} GRPICONDIRENTRY, *LPGRPICONDIRENTRY;\n\ntypedef struct\n{\n\tWORD\t\t\tidReserved;\t\t// Reserved (must be 0)\n\tWORD\t\t\tidType;\t\t\t// Resource type (1 for icons)\n\tWORD\t\t\tidCount;\t\t// How many images?\n\tGRPICONDIRENTRY\tidEntries[1];\t// The entries for each image\n} GRPICONDIR, *LPGRPICONDIR;\n\n#pragma pack(pop)\n\n/*\n * Extract the main icon set from the exe\n */\nBOOL ExtractAppIcon(const char* path, BOOL bSilent)\n{\n\tHGLOBAL res_handle;\n\tHRSRC res;\n\tWORD i;\n\tBYTE* res_data;\n\tDWORD res_size, offset;\n\tHANDLE hFile = INVALID_HANDLE_VALUE;\n\tBOOL r = FALSE;\n\tGRPICONDIR* icondir;\n\n\ticondir = (GRPICONDIR*)GetResource(hMainInstance, MAKEINTRESOURCEA(IDI_ICON), _RT_GROUP_ICON, \"icon\", &res_size, FALSE);\n\tassert(icondir != NULL && icondir->idCount <= 64);\n\tif (icondir == NULL || icondir->idCount > 64)\n\t\tgoto out;\n\n\thFile = CreateFileU(path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ,\n\t\t\tNULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\n\tif (hFile == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Unable to create icon '%s': %s.\", path, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t// Write .ico header\n\tif (!WriteFileWithRetry(hFile, icondir, 3 * sizeof(WORD), NULL, WRITE_RETRIES)) {\n\t\tuprintf(\"Could not write icon header: %s.\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t// Write icon data\n\toffset = 3 * sizeof(WORD) + icondir->idCount * sizeof(ICONDIRENTRY);\n\tfor (i = 0; i < icondir->idCount; i++) {\n\t\t// Write the common part of ICONDIRENTRY\n\t\tif (!WriteFileWithRetry(hFile, &icondir->idEntries[i], sizeof(GRPICONDIRENTRY)-sizeof(WORD), NULL, WRITE_RETRIES)) {\n\t\t\tuprintf(\"Could not write ICONDIRENTRY[%d]: %s.\", i, WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tres = FindResourceA(hMainInstance, MAKEINTRESOURCEA(icondir->idEntries[i].nID), _RT_ICON);\n\t\t// Write the DWORD offset\n\t\tif (!WriteFileWithRetry(hFile, &offset, sizeof(offset), NULL, WRITE_RETRIES)) {\n\t\t\tuprintf(\"Could not write ICONDIRENTRY[%d] offset: %s.\", i, WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\toffset += SizeofResource(NULL, res);\n\t}\n\tfor (i = 0; i < icondir->idCount; i++) {\n\t\t// Write icon data\n\t\tres = FindResourceA(hMainInstance, MAKEINTRESOURCEA(icondir->idEntries[i].nID), _RT_ICON);\n\t\tres_handle = LoadResource(NULL, res);\n\t\tres_data = (BYTE*)LockResource(res_handle);\n\t\tres_size = SizeofResource(NULL, res);\n\t\tif (!WriteFileWithRetry(hFile, res_data, res_size, NULL, WRITE_RETRIES)) {\n\t\t\tuprintf(\"Could not write icon data #%d: %s.\", i, WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t}\n\tsuprintf(\"Created: %s\", path);\n\tr = TRUE;\n\nout:\n\tsafe_closehandle(hFile);\n\treturn r;\n}\n\n/*\n * Create an autorun.inf, if none exists\n * We use this to set the icon as well as labels that are longer than 11/32 chars or,\n * in the case of FAT, contain non-English characters\n */\nBOOL SetAutorun(const char* path)\n{\n\tFILE* fd;\n\tchar filename[64];\n\twchar_t wlabel[128], wRufusVersion[32];\n\n\tstatic_sprintf(filename, \"%sautorun.inf\", path);\n\tfd = fopen(filename, \"r\");\t// If there's an existing autorun, don't overwrite\n\tif (fd != NULL) {\n\t\tuprintf(\"%s already exists - keeping it\", filename);\n\t\tfclose(fd);\n\t\treturn FALSE;\n\t}\n\t// No \"/autorun.inf\" => create a new one in UTF-16 LE mode\n\tfd = fopen(filename, \"w, ccs=UTF-16LE\");\n\tif (fd == NULL) {\n\t\tuprintf(\"Unable to create %s\", filename);\n\t\tuprintf(\"NOTE: This may be caused by a poorly designed security solution. See https://goo.gl/QTobxX.\");\n\t\treturn FALSE;\n\t}\n\n\tGetWindowTextW(hLabel, wlabel, ARRAYSIZE(wlabel));\n\tGetWindowTextW(hMainDialog, wRufusVersion, ARRAYSIZE(wRufusVersion));\n\t// coverity[invalid_type]\n\tfwprintf_s(fd, L\"; Created by %s\\n; \" LTEXT(RUFUS_URL) L\"\\n\", wRufusVersion);\n\t// coverity[invalid_type]\n\tfwprintf_s(fd, L\"[autorun]\\nicon  = autorun.ico\\nlabel = %s\\n\", wlabel);\n\tfclose(fd);\n\tuprintf(\"Created: %s\", filename);\n\n\t// .inf -> .ico\n\tassert(strlen(filename) >= 2);\n\tfilename[strlen(filename) - 1] = 'o';\n\tfilename[strlen(filename) - 2] = 'c';\n\treturn ExtractAppIcon(filename, FALSE);\n}\n"
  },
  {
    "path": "src/iso.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * ISO file extraction\n * Copyright © 2011-2024 Pete Batard <pete@akeo.ie>\n * Based on libcdio's iso & udf samples:\n * Copyright © 2003-2014 Rocky Bernstein <rocky@gnu.org>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <stdio.h>\n#include <string.h>\n#include <malloc.h>\n#include <errno.h>\n#include <direct.h>\n#include <ctype.h>\n#include <assert.h>\n#include <virtdisk.h>\n#include <sys/stat.h>\n\n#define DO_NOT_WANT_COMPATIBILITY\n#include <cdio/cdio.h>\n#include <cdio/logging.h>\n#include <cdio/iso9660.h>\n#include <cdio/udf.h>\n\n#include \"rufus.h\"\n#include \"ui.h\"\n#include \"vhd.h\"\n#include \"drive.h\"\n#include \"libfat.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n#include \"bled/bled.h\"\n\n// How often should we update the progress bar, as updating the\n// progress bar too frequently will bring extraction to a crawl\n_Static_assert(256 * KB >= ISO_BLOCKSIZE, \"Can't set PROGRESS_THRESHOLD\");\n#define PROGRESS_THRESHOLD        ((256 * KB) / ISO_BLOCKSIZE)\n\n// Needed for UDF symbolic link testing\n#define S_IFLNK                   0xA000\n#define S_ISLNK(m)                (((m) & S_IFMT) == S_IFLNK)\n\n// Set the iso_open_ext() extension mask according to our global options\n#define ISO_EXTENSION_MASK        (ISO_EXTENSION_ALL & (enable_joliet ? ISO_EXTENSION_ALL : ~ISO_EXTENSION_JOLIET) & \\\n                                  (enable_rockridge ? ISO_EXTENSION_ALL : ~ISO_EXTENSION_ROCK_RIDGE))\n\n// Needed for UDF ISO access\nCdIo_t* cdio_open (const char* psz_source, driver_id_t driver_id) {return NULL;}\nvoid cdio_destroy (CdIo_t* p_cdio) {}\n\ntypedef struct {\n\tBOOLEAN is_cfg;\n\tBOOLEAN is_conf;\n\tBOOLEAN is_syslinux_cfg;\n\tBOOLEAN is_grub_cfg;\n\tBOOLEAN is_menu_cfg;\n\tBOOLEAN is_old_c32[NB_OLD_C32];\n} EXTRACT_PROPS;\n\nRUFUS_IMG_REPORT img_report;\nFILE* fd_md5sum = NULL;\nint64_t iso_blocking_status = -1;\nuint64_t total_blocks, extra_blocks, nb_blocks, last_nb_blocks;\n\nextern uint64_t md5sum_totalbytes;\nextern BOOL preserve_timestamps, enable_ntfs_compression, validate_md5sum;\nextern HANDLE format_thread;\nextern StrArray modified_files;\nBOOL enable_iso = TRUE, enable_joliet = TRUE, enable_rockridge = TRUE, has_ldlinux_c32;\n#define ISO_BLOCKING(x) do {x; iso_blocking_status++; } while(0)\nstatic const char* psz_extract_dir;\nstatic const char* bootmgr_name = \"bootmgr\";\nconst char* bootmgr_efi_name = \"bootmgr.efi\";\nstatic const char* grldr_name = \"grldr\";\nstatic const char* ldlinux_name = \"ldlinux.sys\";\nstatic const char* ldlinux_c32 = \"ldlinux.c32\";\nconst char* md5sum_name[2] = { \"md5sum.txt\", \"MD5SUMS\" };\nstatic const char* casper_dirname = \"/casper\";\nstatic const char* proxmox_dirname = \"/proxmox\";\nconst char* efi_dirname = \"/efi/boot\";\nconst char* efi_bootname[3] = { \"boot\", \"grub\", \"mm\" };\nconst char* efi_archname[ARCH_MAX] = { \"\", \"ia32\", \"x64\", \"arm\", \"aa64\", \"ia64\", \"riscv64\", \"loongarch64\", \"ebc\" };\nstatic const char* sources_str = \"/sources\";\nstatic const char* wininst_name[] = { \"install.wim\", \"install.esd\", \"install.swm\" };\n_STATIC_ASSERT(ARRAYSIZE(wininst_name) < 4);\t// Must fit as 4 bit position flag\n// We only support GRUB/BIOS (x86) that uses a standard config dir (/boot/grub/i386-pc/)\n// If the disc was mastered properly, GRUB/EFI will take care of itself\nstatic const char* grub_dirname[] = { \"/boot/grub/i386-pc\", \"/boot/grub2/i386-pc\" };\nstatic const char* grub_cfg[] = { \"grub.cfg\", \"loopback.cfg\" };\nstatic const char* menu_cfg = \"menu.cfg\";\n// NB: Do not alter the order of the array below without validating hardcoded indexes in check_iso_props\nstatic const char* syslinux_cfg[] = { \"isolinux.cfg\", \"syslinux.cfg\", \"extlinux.conf\", \"txt.cfg\", \"live.cfg\" };\nstatic const char* isolinux_bin[] = { \"isolinux.bin\", \"boot.bin\" };\nstatic const char* pe_dirname[] = { \"/i386\", \"/amd64\", \"/minint\" };\nstatic const char* pe_file[] = { \"ntdetect.com\", \"setupldr.bin\", \"txtsetup.sif\" };\nstatic const char* reactos_name[] = { \"setupldr.sys\", \"freeldr.sys\" };\nstatic const char* kolibri_name = \"kolibri.img\";\nstatic const char* autorun_name = \"autorun.inf\";\nstatic const char* manjaro_marker = \".miso\";\nstatic const char* pop_os_name = \"pop-os\";\nstatic const char* stupid_antivirus = \"  NOTE: This is usually caused by a poorly designed security solution. \"\n\t\"See https://bit.ly/40qDtyF.\\r\\n  This file will be skipped for now, but you should really \"\n\t\"look into using a *SMARTER* antivirus solution.\";\nconst char* old_c32_name[NB_OLD_C32] = OLD_C32_NAMES;\nstatic const int64_t old_c32_threshold[NB_OLD_C32] = OLD_C32_THRESHOLD;\nstatic uint8_t joliet_level = 0;\nstatic uint32_t md5sum_size = 0;\nstatic BOOL scan_only = FALSE;\nstatic StrArray config_path, isolinux_path, grub_filesystems;\nstatic char symlinked_syslinux[MAX_PATH], *md5sum_data = NULL, *md5sum_pos = NULL;\n\n// Ensure filenames do not contain invalid FAT32 or NTFS characters\nstatic __inline char* sanitize_filename(char* filename, BOOL* is_identical)\n{\n\tsize_t i, j;\n\tchar* ret = NULL;\n\tchar unauthorized[] = { '*', '?', '<', '>', ':', '|' };\n\n\t*is_identical = TRUE;\n\tret = safe_strdup(filename);\n\tif (ret == NULL) {\n\t\tuprintf(\"Could not allocate string for sanitized path\");\n\t\treturn NULL;\n\t}\n\n\t// Must start after the drive part (D:\\...) so that we don't eliminate the first column\n\tfor (i = 2; i<safe_strlen(ret); i++) {\n\t\tfor (j = 0; j<sizeof(unauthorized); j++) {\n\t\t\tif (ret[i] == unauthorized[j]) {\n\t\t\t\tret[i] = '_';\n\t\t\t\t*is_identical = FALSE;\n\t\t\t}\n\t\t}\n\t}\n\treturn ret;\n}\n\nstatic void log_handler (cdio_log_level_t level, const char *message)\n{\n\tuprintf(\"libcdio: %s\", message);\n}\n\n// Returns TRUE if a path appears in md5sum.txt\nstatic BOOL is_in_md5sum(char* path)\n{\n\tBOOL found = FALSE;\n\tchar c[3], * p, * pos = md5sum_pos, * nul_pos;\n\n\t// If we are creating the md5sum file from scratch, every file is in it.\n\tif (fd_md5sum != NULL)\n\t\treturn TRUE;\n\n\t// If we don't have an existing file at this stage, then no file is in it.\n\tif (md5sum_size == 0 || md5sum_data == NULL)\n\t\treturn FALSE;\n\n\t// We should have a \"X:/xyz\" path\n\tassert(path[1] == ':' && path[2] == '/');\n\n\t// Modify the path to have \" ./xyz\"\n\tc[0] = path[0];\n\tc[1] = path[1];\n\tpath[0] = ' ';\n\tpath[1] = '.';\n\n\t// Search for the string in the remainder of the md5sum.txt\n\t// NB: md5sum_data is always NUL terminated.\n\tp = strstr(pos, path);\n\t// Cater for the case where we matched a partial string and look for the full one\n\twhile (p != NULL && p[strlen(path)] != '\\n' && p[strlen(path)] != '\\r' && p[strlen(path)] != '\\0') {\n\t\tpos = p + strlen(path);\n\t\tp = strstr(pos, path);\n\t}\n\tfound = (p != NULL);\n\t// If not found in remainder and we have a remainder, loop to search from beginning\n\tif (!found && pos != md5sum_data) {\n\t\tnul_pos = pos;\n\t\tc[2] = *nul_pos;\n\t\t*nul_pos = 0;\n\t\tp = strstr(md5sum_data, path);\n\t\twhile (p != NULL && p[strlen(path)] != '\\n' && p[strlen(path)] != '\\r' && p[strlen(path)] != '\\0') {\n\t\t\tpos = p + strlen(path);\n\t\t\tp = strstr(pos, path);\n\t\t}\n\t\t*nul_pos = c[2];\n\t\tfound = (p != NULL);\n\t}\n\n\tpath[0] = c[0];\n\tpath[1] = c[1];\n\tif (found)\n\t\tmd5sum_pos = p + strlen(path);\n\treturn found;\n}\n\nstatic void _print_extracted_file(char* psz_fullpath, uint64_t file_length, BOOL split)\n{\n\tsize_t nul_pos;\n\n\tif (psz_fullpath == NULL)\n\t\treturn;\n\t// Replace slashes with backslashes and append the size to the path for UI display\n\tto_windows_path(psz_fullpath);\n\tnul_pos = strlen(psz_fullpath);\n\tsafe_sprintf(&psz_fullpath[nul_pos], 24, \" (%s)\", SizeToHumanReadable(file_length, TRUE, FALSE));\n\tuprintf(split ? \"Splitting: %s\" : \"Extracting: %s\", psz_fullpath);\n\tsafe_sprintf(&psz_fullpath[nul_pos], 24, \" (%s)\", SizeToHumanReadable(file_length, FALSE, FALSE));\n\tPrintStatus(0, MSG_000, psz_fullpath);\t// MSG_000 is \"%s\"\n\t// Remove the appended size for extraction\n\tpsz_fullpath[nul_pos] = 0;\n\t// ISO9660 cannot handle backslashes\n\tto_unix_path(psz_fullpath);\n\t// Update md5sum_totalbytes as needed\n\tif (is_in_md5sum(psz_fullpath))\n\t\tmd5sum_totalbytes += file_length;\n}\n#define print_extracted_file(p, l) _print_extracted_file(p, l, FALSE)\n#define print_split_file(p, l) _print_extracted_file(p, l, TRUE)\n\n/*\n * Scan and set ISO properties\n * Returns true if the the current file does not need to be processed further\n */\nstatic BOOL check_iso_props(const char* psz_dirname, int64_t file_length, const char* psz_basename,\n\tconst char* psz_fullpath, EXTRACT_PROPS *props)\n{\n\tsize_t i, j, k, len;\n\tchar bootloader_name[32];\n\n\t// Check for an isolinux/syslinux config file anywhere\n\tmemset(props, 0, sizeof(EXTRACT_PROPS));\n\tfor (i = 0; i < ARRAYSIZE(syslinux_cfg); i++) {\n\t\tif (safe_stricmp(psz_basename, syslinux_cfg[i]) == 0) {\n\t\t\tprops->is_cfg = TRUE;\t// Required for \"extlinux.conf\"\n\t\t\tprops->is_syslinux_cfg = TRUE;\n\t\t\t// Maintain a list of all the isolinux/syslinux config files identified so far\n\t\t\tif ((scan_only) && (i < 3))\n\t\t\t\tStrArrayAdd(&config_path, psz_fullpath, TRUE);\n\t\t\tif ((scan_only) && (i == 1) && (safe_stricmp(psz_dirname, efi_dirname) == 0))\n\t\t\t\timg_report.has_efi_syslinux = TRUE;\n\t\t}\n\t}\n\n\t// Check for archiso loader/entries/*.conf files\n\tif (safe_stricmp(psz_dirname, \"/loader/entries\") == 0) {\n\t\tlen = safe_strlen(psz_basename);\n\t\tprops->is_conf = ((len > 4) && (stricmp(&psz_basename[len - 5], \".conf\") == 0));\n\t}\n\n\t// Check for an old incompatible c32 file anywhere\n\tfor (i = 0; i < NB_OLD_C32; i++) {\n\t\tif ((safe_stricmp(psz_basename, old_c32_name[i]) == 0) && (file_length <= old_c32_threshold[i]))\n\t\t\tprops->is_old_c32[i] = TRUE;\n\t}\n\n\tif (!scan_only) {\t// Write-time checks\n\t\t// Check for config files that may need patching\n\t\tlen = safe_strlen(psz_basename);\n\t\tif ((len >= 4) && safe_stricmp(&psz_basename[len - 4], \".cfg\") == 0) {\n\t\t\tprops->is_cfg = TRUE;\n\t\t\tfor (i = 0; i < ARRAYSIZE(grub_cfg); i++) {\n\t\t\t\tif (safe_stricmp(psz_basename, grub_cfg[i]) == 0)\n\t\t\t\t\tprops->is_grub_cfg = TRUE;\n\t\t\t}\n\t\t\tif (safe_stricmp(psz_basename, menu_cfg) == 0) {\n\t\t\t\tprops->is_menu_cfg = TRUE;\n\t\t\t}\n\t\t}\n\n\t\t// In case there's an ldlinux.sys on the ISO, prevent it from overwriting ours\n\t\tif ((psz_dirname != NULL) && (psz_dirname[0] == 0) && (safe_stricmp(psz_basename, ldlinux_name) == 0)) {\n\t\t\tuprintf(\"Skipping '%s' file from ISO image\", psz_basename);\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// Split a >4GB install.wim if the target filesystem is FAT\n\t\tif (file_length >= 4 * GB && psz_dirname != NULL && IS_FAT(fs_type) && img_report.has_4GB_file == 0x11) {\n\t\t\tif (safe_stricmp(&psz_dirname[max(0, ((int)safe_strlen(psz_dirname)) -\n\t\t\t\t((int)strlen(sources_str)))], sources_str) == 0) {\n\t\t\t\tchar wim_path[4 * MAX_PATH];\n\t\t\t\tfor (i = 0; i < ARRAYSIZE(wininst_name) - 1; i++) {\n\t\t\t\t\tif (safe_stricmp(psz_basename, wininst_name[i]) == 0 && file_length >= 4 * GB) {\n\t\t\t\t\t\tprint_split_file((char*)psz_fullpath, file_length);\n\t\t\t\t\t\tchar* dst = safe_strdup(psz_fullpath);\n\t\t\t\t\t\tdst[strlen(dst) - 3] = 's';\n\t\t\t\t\t\tdst[strlen(dst) - 2] = 'w';\n\t\t\t\t\t\tdst[strlen(dst) - 1] = 'm';\n\t\t\t\t\t\tassert(safe_strlen(image_path) + safe_strlen(psz_dirname) + safe_strlen(psz_basename) + 2 < ARRAYSIZE(wim_path));\n\t\t\t\t\t\tstatic_sprintf(wim_path, \"%s|%s/%s\", image_path, psz_dirname, psz_basename);\n\t\t\t\t\t\tWimSplitFile(wim_path, dst);\n\t\t\t\t\t\tfree(dst);\n\t\t\t\t\t\treturn TRUE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\t// Scan-time checks\n\t\t// Check for GRUB artifacts\n\t\tfor (i = 0; i < ARRAYSIZE(grub_dirname); i++) {\n\t\t\tif (safe_stricmp(psz_dirname, grub_dirname[i]) == 0)\n\t\t\t\timg_report.has_grub2 = (uint8_t)i + 1;\n\t\t}\n\n\t\t// Check for a syslinux v5.0+ file anywhere\n\t\tif (safe_stricmp(psz_basename, ldlinux_c32) == 0) {\n\t\t\thas_ldlinux_c32 = TRUE;\n\t\t}\n\n\t\t// Check for a '/casper#####' directory (non-empty)\n\t\tif (safe_strnicmp(psz_dirname, casper_dirname, strlen(casper_dirname)) == 0) {\n\t\t\timg_report.uses_casper = TRUE;\n\t\t\tif (safe_strstr(psz_dirname, pop_os_name) != NULL)\n\t\t\t\timg_report.disable_iso = TRUE;\n\t\t}\n\n\t\t// Check for a '/proxmox' directory\n\t\tif (safe_stricmp(psz_dirname, proxmox_dirname) == 0) {\n\t\t\timg_report.disable_iso = TRUE;\n\t\t}\n\n\t\t// Check for various files and directories in root (psz_dirname = \"\")\n\t\tif ((psz_dirname != NULL) && (psz_dirname[0] == 0)) {\n\t\t\tif (safe_stricmp(psz_basename, bootmgr_name) == 0) {\n\t\t\t\timg_report.has_bootmgr = TRUE;\n\t\t\t}\n\t\t\tif (safe_stricmp(psz_basename, bootmgr_efi_name) == 0) {\n\t\t\t\t// We may extract the bootloaders for revocation validation later but\n\t\t\t\t// to do so, since we're working with case sensitive file systems, we\n\t\t\t\t// must store all found UEFI bootloader paths with the right case.\n\t\t\t\tfor (j = 0; j < ARRAYSIZE(img_report.efi_boot_entry); j++) {\n\t\t\t\t\tif (img_report.efi_boot_entry[j].path[0] == 0) {\n\t\t\t\t\t\timg_report.efi_boot_entry[j].type = EBT_BOOTMGR;\n\t\t\t\t\t\tstatic_strcpy(img_report.efi_boot_entry[j].path, psz_fullpath);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\timg_report.has_efi |= 1;\n\t\t\t\timg_report.has_bootmgr_efi = TRUE;\n\t\t\t}\n\t\t\tif (safe_stricmp(psz_basename, grldr_name) == 0) {\n\t\t\t\timg_report.has_grub4dos = TRUE;\n\t\t\t}\n\t\t\tif (safe_stricmp(psz_basename, kolibri_name) == 0) {\n\t\t\t\timg_report.has_kolibrios = TRUE;\n\t\t\t}\n\t\t\tif (safe_stricmp(psz_basename, manjaro_marker) == 0) {\n\t\t\t\timg_report.disable_iso = TRUE;\n\t\t\t}\n\t\t\tfor (i = 0; i < ARRAYSIZE(md5sum_name); i++) {\n\t\t\t\tif (safe_stricmp(psz_basename, md5sum_name[i]) == 0)\n\t\t\t\t\timg_report.has_md5sum = (uint8_t)(i + 1);\n\t\t\t}\n\t\t}\n\n\t\t// Check for ReactOS presence anywhere\n\t\tif (img_report.reactos_path[0] == 0) {\n\t\t\tfor (i = 0; i < ARRAYSIZE(reactos_name); i++)\n\t\t\t\tif (safe_stricmp(psz_basename, reactos_name[i]) == 0)\n\t\t\t\t\tstatic_strcpy(img_report.reactos_path, psz_fullpath);\n\t\t}\n\n\t\t// Check for the first 'efi*.img' we can find (that hopefully contains EFI boot files)\n\t\tif (!HAS_EFI_IMG(img_report) && (safe_strlen(psz_basename) >= 7) &&\n\t\t\t(safe_strnicmp(psz_basename, \"efi\", 3) == 0) &&\n\t\t\t(safe_stricmp(&psz_basename[strlen(psz_basename) - 4], \".img\") == 0))\n\t\t\tstatic_strcpy(img_report.efi_img_path, psz_fullpath);\n\n\t\t// Check for the EFI boot entries. Note that because of Bazzite maintainers' disregard for end users\n\t\t// (evidenced in https://github.com/ublue-os/bazzite/issues/4374) and Fedora's disregards for standards\n\t\t// (evidenced in pushing for '/efi/fedora/' to store bootloaders, instead of sticking to '/efi/boot/')\n\t\t// we check for anything starting with '/efi/' instead of just '/efi/boot/').\n\t\tif (safe_strnicmp(psz_dirname, \"/efi/\", 5) == 0) {\n\t\t\tfor (k = 0; k < ARRAYSIZE(efi_bootname); k++) {\n\t\t\t\tfor (i = 0; i < ARRAYSIZE(efi_archname); i++) {\n\t\t\t\t\tstatic_sprintf(bootloader_name, \"%s%s.efi\", efi_bootname[k], efi_archname[i]);\n\t\t\t\t\tif (safe_stricmp(psz_basename, bootloader_name) == 0) {\n\t\t\t\t\t\tif (k == 0)\n\t\t\t\t\t\t\timg_report.has_efi |= (2 << i);\t// start at 2 since \"bootmgr.efi\" is bit 0\n\t\t\t\t\t\tfor (j = 0; j < ARRAYSIZE(img_report.efi_boot_entry); j++) {\n\t\t\t\t\t\t\tif (img_report.efi_boot_entry[j].path[0] == 0) {\n\t\t\t\t\t\t\t\timg_report.efi_boot_entry[j].type = (uint8_t)k;\n\t\t\t\t\t\t\t\tstatic_strcpy(img_report.efi_boot_entry[j].path, psz_fullpath);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Linux Mint Edge 21.2/Mint 21.3 have an invalid /EFI/boot/bootx64.efi\n\t\t\t// because it's a symbolic link to a file that does not exist on the media.\n\t\t\t// This is originally due to a Debian bug that was fixed in:\n\t\t\t// https://salsa.debian.org/live-team/live-build/-/commit/5bff71fea2dd54adcd6c428d3f1981734079a2f7\n\t\t\t// Because of this, if we detect a small bootx64.efi file, we assert that it's a\n\t\t\t// broken link and try to extract a \"good\" version from the El-Torito image.\n\t\t\tif ((safe_stricmp(psz_basename, \"bootx64.efi\") == 0) && (file_length < 256)) {\n\t\t\t\timg_report.has_efi |= 0x4000;\n\t\t\t\tstatic_strcpy(img_report.efi_img_path, \"[BOOT]/1-Boot-NoEmul.img\");\n\t\t\t}\n\t\t}\n\n\t\tif (psz_dirname != NULL) {\n\t\t\tif (safe_stricmp(&psz_dirname[max(0, ((int)safe_strlen(psz_dirname)) -\n\t\t\t\t((int)strlen(sources_str)))], sources_str) == 0) {\n\t\t\t\t// Check for \"install.###\" in \"###/sources/\"\n\t\t\t\tfor (i = 0; i < ARRAYSIZE(wininst_name); i++) {\n\t\t\t\t\tif (safe_stricmp(psz_basename, wininst_name[i]) == 0) {\n\t\t\t\t\t\tif (img_report.wininst_index < MAX_WININST) {\n\t\t\t\t\t\t\tstatic_sprintf(img_report.wininst_path[img_report.wininst_index],\n\t\t\t\t\t\t\t\t\"?:%s\", psz_fullpath);\n\t\t\t\t\t\t\timg_report.wininst_index++;\n\t\t\t\t\t\t\tif (file_length >= 4 * GB)\n\t\t\t\t\t\t\t\timg_report.has_4GB_file |= (0x10 << i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check for \"\\sources\\\\$OEM$\\\\$$\\\\Panther\\\\unattend.xml\"\n\t\tif ((safe_stricmp(psz_dirname, \"/sources/$OEM$/$$/Panther\") == 0) &&\n\t\t\t(safe_stricmp(psz_basename, \"unattend.xml\") == 0))\n\t\t\timg_report.has_panther_unattend = TRUE;\n\n\t\t// Check for PE (XP) specific files in \"/i386\", \"/amd64\" or \"/minint\"\n\t\tfor (i = 0; i < ARRAYSIZE(pe_dirname); i++)\n\t\t\tif (safe_stricmp(psz_dirname, pe_dirname[i]) == 0)\n\t\t\t\tfor (j=0; j<ARRAYSIZE(pe_file); j++)\n\t\t\t\t\tif (safe_stricmp(psz_basename, pe_file[j]) == 0)\n\t\t\t\t\t\timg_report.winpe |= (1<<j)<<(ARRAYSIZE(pe_dirname)*i);\n\n\t\tfor (i = 0; i < ARRAYSIZE(isolinux_bin); i++) {\n\t\t\tif (safe_stricmp(psz_basename, isolinux_bin[i]) == 0) {\n\t\t\t\t// Maintain a list of all the isolinux.bin files found\n\t\t\t\tStrArrayAdd(&isolinux_path, psz_fullpath, TRUE);\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < NB_OLD_C32; i++) {\n\t\t\tif (props->is_old_c32[i])\n\t\t\t\timg_report.has_old_c32[i] = TRUE;\n\t\t}\n\t\tif (file_length >= 4 * GB && (img_report.has_4GB_file & 0x0f) != 0x0f)\n\t\t\timg_report.has_4GB_file++;\n\t\t// Compute projected size needed (NB: ISO_BLOCKSIZE = UDF_BLOCKSIZE)\n\t\tif (file_length != 0)\n\t\t\ttotal_blocks += (file_length + (ISO_BLOCKSIZE - 1)) / ISO_BLOCKSIZE;\n\t\treturn TRUE;\n\t}\n\treturn FALSE;\n}\n\n// Apply various workarounds to Linux config files\nstatic void fix_config(const char* psz_fullpath, const char* psz_path, const char* psz_basename, EXTRACT_PROPS* props)\n{\n\tBOOL modified = FALSE, patched;\n\tsize_t nul_pos;\n\tchar *iso_label = NULL, *usb_label = NULL, *src, *dst;\n\n\tsrc = safe_strdup(psz_fullpath);\n\tif (src == NULL)\n\t\treturn;\n\tnul_pos = strlen(src);\n\tto_windows_path(src);\n\n\t// Add persistence to the kernel options\n\tif ((boot_type == BT_IMAGE) && HAS_PERSISTENCE(img_report) && persistence_size) {\n\t\tif ((props->is_grub_cfg) || (props->is_menu_cfg) || (props->is_syslinux_cfg)) {\n\t\t\tif (replace_in_token_data(src, props->is_grub_cfg ? \"linux\" : \"append\",\n\t\t\t\t\"file=/cdrom/preseed\", \"persistent file=/cdrom/preseed\", TRUE) != NULL) {\n\t\t\t\t// Ubuntu & derivatives are assumed to use 'file=/cdrom/preseed/...'\n\t\t\t\t// or 'layerfs-path=minimal.standard.live.squashfs' (see below)\n\t\t\t\t// somewhere in their kernel options and use 'persistent' as keyword.\n\t\t\t\tuprintf(\"  Added 'persistent' kernel option\");\n\t\t\t\tmodified = TRUE;\n\t\t\t\t// Also remove Ubuntu's \"maybe-ubiquity\" to avoid splash screen (GRUB only)\n\t\t\t\tif ((props->is_grub_cfg) && replace_in_token_data(src, \"linux\",\n\t\t\t\t\t\"maybe-ubiquity\", \"\", TRUE))\n\t\t\t\t\tuprintf(\"  Removed 'maybe-ubiquity' kernel option\");\n\t\t\t} else if (replace_in_token_data(src, props->is_grub_cfg ? \"linux\" : \"append\",\n\t\t\t\t\"boot=casper\", \"boot=casper persistent\", TRUE) != NULL) {\n\t\t\t\t// Linux Mint uses \"boot=casper\". Oh and we want this replacement to happen BEFORE\n\t\t\t\t// the \"linux /casper/vmlinuz\" one, because Mint (Why is it ALWAYS them?) also use\n\t\t\t\t// \"linux /casper/vmlinuz\" and \"kernel /casper/vmlinuz\" in their config, and even\n\t\t\t\t// do so in a SUPER INCONSISTENT manner in their Syslinux' live.cfg, so we want to\n\t\t\t\t// make sure we don't have to do extra work to fix their inconsistency.\n\t\t\t\tuprintf(\"  Added 'persistent' kernel option\");\n\t\t\t\tmodified = TRUE;\n\t\t\t} else if (replace_in_token_data(src, \"linux\", \"/casper/vmlinuz\",\n\t\t\t\t\"/casper/vmlinuz persistent\", TRUE) != NULL) {\n\t\t\t\t// Ubuntu 23.04 and 24.04 use GRUB only with the above and don't use \"maybe-ubiquity\"\n\t\t\t\tuprintf(\"  Added 'persistent' kernel option\");\n\t\t\t\tmodified = TRUE;\n\t\t\t} else if (replace_in_token_data(src, \"kernel\", \"/casper/vmlinuz\",\n\t\t\t\t\"/casper/vmlinuz persistent\", TRUE) != NULL) {\n\t\t\t\t// Some people might use \"kernel\" in their Syslinux config instead of \"linux\"\n\t\t\t\tuprintf(\"  Added 'persistent' kernel option\");\n\t\t\t\tmodified = TRUE;\n\t\t\t} else if (replace_in_token_data(src, props->is_grub_cfg ? \"linux\" : \"append\",\n\t\t\t\t\"boot=live\", \"boot=live persistence\", TRUE) != NULL) {\n\t\t\t\t// Debian & derivatives are assumed to use 'boot=live' in\n\t\t\t\t// their kernel options and use 'persistence' as keyword.\n\t\t\t\tuprintf(\"  Added 'persistence' kernel option\");\n\t\t\t\tmodified = TRUE;\n\t\t\t}\n\t\t\t// Other distros can go to hell. Seriously, just check all partitions for\n\t\t\t// an ext volume with the right label and use persistence *THEN*. I mean,\n\t\t\t// why on earth do you need a bloody *NONSTANDARD* kernel option and/or a\n\t\t\t// \"persistence.conf\" file. This is SO INCREDIBLY RETARDED that it makes\n\t\t\t// Windows look smart in comparison. Great job there, Linux people!\n\t\t}\n\t}\n\n\t// Workaround for config files requiring an ISO label for kernel append that may be\n\t// different from our USB label. Oh, and these labels must have spaces converted to \\x20.\n\tif ((props->is_cfg) || (props->is_conf)) {\n\t\t// Older versions of GRUB EFI used \"linuxefi\", newer just use \"linux\".\n\t\t// Also, in their great wisdom, the openSUSE maintainers added a 'set linux=linux'\n\t\t// line to their grub.cfg, which means that their kernel option cfg_token is no longer\n\t\t//'linux' but '$linux'... and we have to add a workaround for that.\n\t\t// Then, newer Arch and derivatives added an extra \"search --label ...\" command\n\t\t// in their GRUB conf, which we need to cater for in supplement of the kernel line.\n\t\t// Then Artix called in and decided they would use a \"for kopt ...\" loop.\n\t\t// Finally, we're just shoving the known isolinux/syslinux tokens in there to process\n\t\t// all config files equally.\n\t\tstatic const char* cfg_token[] = { \"options\", \"append\", \"linux\", \"linuxefi\", \"$linux\", \"search\", \"for\"};\n\t\tiso_label = replace_char(img_report.label, ' ', \"\\\\x20\");\n\t\tusb_label = replace_char(img_report.usb_label, ' ', \"\\\\x20\");\n\t\tif ((iso_label != NULL) && (usb_label != NULL)) {\n\t\t\tpatched = FALSE;\n\t\t\tfor (int i = 0; i < ARRAYSIZE(cfg_token); i++) {\n\t\t\t\tif (replace_in_token_data(src, cfg_token[i], iso_label, usb_label, TRUE) != NULL) {\n\t\t\t\t\tmodified = TRUE;\n\t\t\t\t\tpatched = TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (patched)\n\t\t\t\tuprintf(\"  Patched %s: '%s' ➔ '%s'\", src, iso_label, usb_label);\n\t\t\t// Since version 8.2, and https://github.com/rhinstaller/anaconda/commit/a7661019546ec1d8b0935f9cb0f151015f2e1d95,\n\t\t\t// Red Hat derivatives have changed their CD-ROM detection policy which leads to the installation source\n\t\t\t// not being found. So we need to use 'inst.repo' instead of 'inst.stage2' in the kernel options.\n\t\t\t// *EXCEPT* this should not be done for netinst media such as Fedora 37 netinstall and trying to differentiate\n\t\t\t// netinst from regular is a pain. So, because I don't have all day to fix the mess that Red-Hat created when\n\t\t\t// they introduced a kernel option to decide where the source packages should be picked from we're just going\n\t\t\t// to *hope* that users didn't rename their ISOs and check whether it contains 'netinst' or not. Oh well...\n\t\t\tpatched = FALSE;\n\t\t\tif (img_report.rh8_derivative && (strstr(image_path, \"netinst\") == NULL)) {\n\t\t\t\tfor (int i = 0; i < ARRAYSIZE(cfg_token); i++) {\n\t\t\t\t\tif (replace_in_token_data(src, cfg_token[i], \"inst.stage2\", \"inst.repo\", TRUE) != NULL) {\n\t\t\t\t\t\tmodified = TRUE;\n\t\t\t\t\t\tpatched = TRUE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (patched)\n\t\t\t\t\tuprintf(\"  Patched %s: '%s' ➔ '%s'\", src, \"inst.stage2\", \"inst.repo\");\n\t\t\t}\n\t\t}\n\t\tsafe_free(iso_label);\n\t\tsafe_free(usb_label);\n\t}\n\n\t// Fix dual BIOS + EFI support for tails and other ISOs\n\tif ( (props->is_syslinux_cfg) && (safe_stricmp(psz_path, efi_dirname) == 0) &&\n\t\t (safe_stricmp(psz_basename, syslinux_cfg[0]) == 0) &&\n\t\t (!img_report.has_efi_syslinux) && (dst = safe_strdup(src)) ) {\n\t\tdst[nul_pos-12] = 's'; dst[nul_pos-11] = 'y'; dst[nul_pos-10] = 's';\n\t\tCopyFileA(src, dst, TRUE);\n\t\tuprintf(\"Duplicated %s to %s\", src, dst);\n\t\tfree(dst);\n\t}\n\n\t// Workaround for FreeNAS\n\tif (props->is_grub_cfg) {\n\t\tiso_label = malloc(MAX_PATH);\n\t\tusb_label = malloc(MAX_PATH);\n\t\tif ((iso_label != NULL) && (usb_label != NULL)) {\n\t\t\tsafe_sprintf(iso_label, MAX_PATH, \"cd9660:/dev/iso9660/%s\", img_report.label);\n\t\t\tsafe_sprintf(usb_label, MAX_PATH, \"msdosfs:/dev/msdosfs/%s\", img_report.usb_label);\n\t\t\tif (replace_in_token_data(src, \"set\", iso_label, usb_label, TRUE) != NULL) {\n\t\t\t\tuprintf(\"  Patched %s: '%s' ➔ '%s'\", src, iso_label, usb_label);\n\t\t\t\tmodified = TRUE;\n\t\t\t}\n\t\t}\n\t\tsafe_free(iso_label);\n\t\tsafe_free(usb_label);\n\t}\n\n\tif (modified)\n\t\tStrArrayAdd(&modified_files, psz_fullpath, TRUE);\n\n\tfree(src);\n}\n\n// Convert from time_t to FILETIME\n// Uses 3 static entries so that we can convert 3 concurrent values at the same time\nstatic LPFILETIME __inline to_filetime(time_t t)\n{\n\tstatic int i = 0;\n\tstatic FILETIME ft[3], *r;\n\tLONGLONG ll = (t * 10000000LL) + 116444736000000000LL;\n\n\tr = &ft[i];\n\tr->dwLowDateTime = (DWORD)ll;\n\tr->dwHighDateTime = (DWORD)(ll >> 32);\n\ti = (i + 1) % ARRAYSIZE(ft);\n\treturn r;\n}\n\n// Helper function to restore the timestamp on a directory\nstatic void __inline set_directory_timestamp(char* path, LPFILETIME creation, LPFILETIME last_access, LPFILETIME modify)\n{\n\tHANDLE dir_handle = CreateFileU(path, GENERIC_READ | GENERIC_WRITE,\n\t\tFILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);\n\tif ((dir_handle == INVALID_HANDLE_VALUE) || (!SetFileTime(dir_handle, creation, last_access, modify)))\n\t\tuprintf(\"  Could not set timestamp for directory '%s': %s\", path, WindowsErrorString());\n\tsafe_closehandle(dir_handle);\n}\n\n// Returns 0 on success, nonzero on error\nstatic int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const char *psz_path)\n{\n\tHANDLE file_handle = NULL;\n\tDWORD buf_size, wr_size, err;\n\tEXTRACT_PROPS props;\n\tHASH_CONTEXT ctx;\n\tBOOL r, is_identical;\n\tint length;\n\tsize_t i, j, nb;\n\tchar tmp[128], *psz_fullpath = NULL, *psz_sanpath = NULL;\n\tconst char* psz_basename;\n\tudf_dirent_t *p_udf_dirent2;\n\t_Static_assert(ISO_BUFFER_SIZE % UDF_BLOCKSIZE == 0,\n\t\t\"ISO_BUFFER_SIZE is not a multiple of UDF_BLOCKSIZE\");\n\tuint8_t* buf = malloc(ISO_BUFFER_SIZE);\n\tint64_t read, file_length;\n\n\tif ((p_udf_dirent == NULL) || (psz_path == NULL) || (buf == NULL)) {\n\t\tsafe_free(buf);\n\t\treturn 1;\n\t}\n\n\tif (psz_path[0] == 0)\n\t\tUpdateProgressWithInfoInit(NULL, TRUE);\n\twhile ((p_udf_dirent = udf_readdir(p_udf_dirent)) != NULL) {\n\t\tif (ErrorStatus) goto out;\n\t\tpsz_basename = udf_get_filename(p_udf_dirent);\n\t\tif (strlen(psz_basename) == 0)\n\t\t\tcontinue;\n\t\tlength = (int)(3 + strlen(psz_path) + strlen(psz_basename) + strlen(psz_extract_dir) + 24);\n\t\tpsz_fullpath = (char*)calloc(sizeof(char), length);\n\t\tif (psz_fullpath == NULL) {\n\t\t\tuprintf(\"Error allocating file name\");\n\t\t\tgoto out;\n\t\t}\n\t\tlength = _snprintf_s(psz_fullpath, length, _TRUNCATE, \"%s%s/%s\", psz_extract_dir, psz_path, psz_basename);\n\t\tif (length < 0)\n\t\t\tgoto out;\n\t\tif (S_ISLNK(udf_get_posix_filemode(p_udf_dirent)))\n\t\t\timg_report.has_symlinks = SYMLINKS_UDF;\n\t\tif (udf_is_dir(p_udf_dirent)) {\n\t\t\tif (!scan_only) {\n\t\t\t\tpsz_sanpath = sanitize_filename(psz_fullpath, &is_identical);\n\t\t\t\tIGNORE_RETVAL(_mkdirU(psz_sanpath));\n\t\t\t\tif (preserve_timestamps) {\n\t\t\t\t\tset_directory_timestamp(psz_sanpath, to_filetime(udf_get_attribute_time(p_udf_dirent)),\n\t\t\t\t\t\tto_filetime(udf_get_access_time(p_udf_dirent)), to_filetime(udf_get_modification_time(p_udf_dirent)));\n\t\t\t\t}\n\t\t\t\tsafe_free(psz_sanpath);\n\t\t\t}\n\t\t\tp_udf_dirent2 = udf_opendir(p_udf_dirent);\n\t\t\tif (p_udf_dirent2 != NULL) {\n\t\t\t\tif (udf_extract_files(p_udf, p_udf_dirent2, &psz_fullpath[strlen(psz_extract_dir)]))\n\t\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else {\n\t\t\tfile_length = udf_get_file_length(p_udf_dirent);\n\t\t\tif (check_iso_props(psz_path, file_length, psz_basename, psz_fullpath, &props)) {\n\t\t\t\tsafe_free(psz_fullpath);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprint_extracted_file(psz_fullpath, file_length);\n\t\t\tfor (i = 0; i < NB_OLD_C32; i++) {\n\t\t\t\tif (props.is_old_c32[i] && use_own_c32[i]) {\n\t\t\t\t\tstatic_sprintf(tmp, \"%s/syslinux-%s/%s\", FILES_DIR, embedded_sl_version_str[0], old_c32_name[i]);\n\t\t\t\t\tif (CopyFileU(tmp, psz_fullpath, FALSE)) {\n\t\t\t\t\t\tuprintf(\"  Replaced with local version %s\", IsFileInDB(tmp)?\"✓\":\"✗\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tuprintf(\"  Could not replace file: %s\", WindowsErrorString());\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i < NB_OLD_C32)\n\t\t\t\tcontinue;\n\t\t\tpsz_sanpath = sanitize_filename(psz_fullpath, &is_identical);\n\t\t\tif (!is_identical)\n\t\t\t\tuprintf(\"  File name sanitized to '%s'\", psz_sanpath);\n\t\t\tfile_handle = CreatePreallocatedFile(psz_sanpath, GENERIC_READ | GENERIC_WRITE,\n\t\t\t\tFILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, file_length);\n\t\t\tif (file_handle == INVALID_HANDLE_VALUE) {\n\t\t\t\terr = GetLastError();\n\t\t\t\tuprintf(\"  Unable to create file: %s\", WindowsErrorString());\n\t\t\t\tif (((err == ERROR_ACCESS_DENIED) || (err == ERROR_INVALID_HANDLE)) &&\n\t\t\t\t\t(safe_strcmp(&psz_sanpath[3], autorun_name) == 0))\n\t\t\t\t\tuprintf(stupid_antivirus);\n\t\t\t\telse\n\t\t\t\t\tgoto out;\n\t\t\t} else {\n\t\t\t\tif (fd_md5sum != NULL)\n\t\t\t\t\thash_init[HASH_MD5](&ctx);\n\t\t\t\twhile (file_length > 0) {\n\t\t\t\t\tif (ErrorStatus)\n\t\t\t\t\t\tgoto out;\n\t\t\t\t\tnb = (size_t)MIN(ISO_BUFFER_SIZE / UDF_BLOCKSIZE, (file_length + UDF_BLOCKSIZE - 1) / UDF_BLOCKSIZE);\n\t\t\t\t\tread = udf_read_block(p_udf_dirent, buf, nb);\n\t\t\t\t\tif (read < 0) {\n\t\t\t\t\t\tuprintf(\"  Error reading UDF file %s\", &psz_fullpath[strlen(psz_extract_dir)]);\n\t\t\t\t\t\tgoto out;\n\t\t\t\t\t}\n\t\t\t\t\tbuf_size = (DWORD)MIN(file_length, read);\n\t\t\t\t\tif (fd_md5sum != NULL)\n\t\t\t\t\t\thash_write[HASH_MD5](&ctx, buf, buf_size);\n\t\t\t\t\tISO_BLOCKING(r = WriteFileWithRetry(file_handle, buf, buf_size, &wr_size, WRITE_RETRIES));\n\t\t\t\t\tif (!r || (wr_size != buf_size)) {\n\t\t\t\t\t\tif (r)\n\t\t\t\t\t\t\tSetLastError(ERROR_WRITE_FAULT);\n\t\t\t\t\t\tuprintf(\"  Error writing file: %s\", WindowsErrorString());\n\t\t\t\t\t\tgoto out;\n\t\t\t\t\t}\n\t\t\t\t\tfile_length -= wr_size;\n\t\t\t\t\tnb_blocks += nb;\n\t\t\t\t\tif (nb_blocks - last_nb_blocks >= PROGRESS_THRESHOLD) {\n\t\t\t\t\t\tUpdateProgressWithInfo(OP_FILE_COPY, MSG_231, nb_blocks, total_blocks);\n\t\t\t\t\t\tlast_nb_blocks = nb_blocks;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (fd_md5sum != NULL) {\n\t\t\t\t\thash_final[HASH_MD5](&ctx);\n\t\t\t\t\tfor (j = 0; j < MD5_HASHSIZE; j++)\n\t\t\t\t\t\tfprintf(fd_md5sum, \"%02x\", ctx.buf[j]);\n\t\t\t\t\tfprintf(fd_md5sum, \"  ./%s\\n\", &psz_fullpath[3]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((preserve_timestamps) && (!SetFileTime(file_handle, to_filetime(udf_get_attribute_time(p_udf_dirent)),\n\t\t\t\tto_filetime(udf_get_access_time(p_udf_dirent)), to_filetime(udf_get_modification_time(p_udf_dirent)))))\n\t\t\t\tuprintf(\"  Could not set timestamp: %s\", WindowsErrorString());\n\n\t\t\t// If you have a fast USB 3.0 device, the default Windows buffering does an\n\t\t\t// excellent job at compensating for our small blocks read/writes to max out the\n\t\t\t// device's bandwidth.\n\t\t\t// The drawback however is with cancellation. With a large file, CloseHandle()\n\t\t\t// may take forever to complete and is not interruptible. We try to detect this.\n\t\t\tISO_BLOCKING(safe_closehandle(file_handle));\n\t\t\tif (props.is_cfg || props.is_conf)\n\t\t\t\tfix_config(psz_sanpath, psz_path, psz_basename, &props);\n\t\t\tsafe_free(psz_sanpath);\n\t\t}\n\t\tsafe_free(psz_fullpath);\n\t}\n\tsafe_free(buf);\n\treturn 0;\n\nout:\n\tif (GetLastError() != ERROR_SUCCESS)\n\t\tErrorStatus = RUFUS_ERROR(GetLastError());\n\tudf_dirent_free(p_udf_dirent);\n\tISO_BLOCKING(safe_closehandle(file_handle));\n\tsafe_free(psz_sanpath);\n\tsafe_free(psz_fullpath);\n\tsafe_free(buf);\n\treturn 1;\n}\n\n// Returns 0 on success, >0 on error, <0 to ignore current dir\nstatic int iso_extract_files(iso9660_t* p_iso, const char *psz_path)\n{\n\tHANDLE file_handle = NULL;\n\tDWORD buf_size, wr_size, err;\n\tEXTRACT_PROPS props;\n\tHASH_CONTEXT ctx;\n\tBOOL is_symlink, is_identical, create_file, free_p_statbuf = FALSE;\n\tint length, r = 1;\n\tchar psz_fullpath[MAX_PATH], *psz_basename = NULL, *psz_sanpath = NULL;\n\tchar tmp[128], target_path[256], *last_slash;\n\tconst char *psz_iso_name = &psz_fullpath[strlen(psz_extract_dir)];\n\t_Static_assert(ISO_BUFFER_SIZE % ISO_BLOCKSIZE == 0,\n\t\t\"ISO_BUFFER_SIZE is not a multiple of ISO_BLOCKSIZE\");\n\tuint8_t* buf = malloc(ISO_BUFFER_SIZE);\n\tCdioListNode_t* p_entnode;\n\tiso9660_stat_t *p_statbuf;\n\tCdioISO9660FileList_t* p_entlist = NULL;\n\tsize_t i, j, nb;\n\tlsn_t lsn;\n\tint64_t file_length;\n\n\tif ((p_iso == NULL) || (psz_path == NULL) || (buf == NULL)) {\n\t\tsafe_free(buf);\n\t\treturn 1;\n\t}\n\n\tlength = _snprintf_s(psz_fullpath, sizeof(psz_fullpath), _TRUNCATE, \"%s%s/\", psz_extract_dir, psz_path);\n\tif (length < 0)\n\t\tgoto out;\n\tpsz_basename = &psz_fullpath[length];\n\n\tp_entlist = iso9660_ifs_readdir(p_iso, psz_path);\n\tif (!p_entlist) {\n\t\tuprintf(\"Could not access directory %s\", psz_path);\n\t\tgoto out;\n\t}\n\n\tif (psz_path[0] == 0)\n\t\tUpdateProgressWithInfoInit(NULL, TRUE);\n\t_CDIO_LIST_FOREACH(p_entnode, p_entlist) {\n\t\tif (ErrorStatus) goto out;\n\t\tp_statbuf = (iso9660_stat_t*) _cdio_list_node_data(p_entnode);\n\t\tfree_p_statbuf = FALSE;\n\t\tif (scan_only && (p_statbuf->rr.b3_rock == yep) && enable_rockridge) {\n\t\t\tif (p_statbuf->rr.u_su_fields & ISO_ROCK_SUF_PL) {\n\t\t\t\tif (!img_report.has_deep_directories)\n\t\t\t\t\tuprintf(\"  Note: The selected ISO uses Rock Ridge 'deep directories'.\\r\\n\"\n\t\t\t\t\t\t\"  Because of this, it may take a very long time to scan or extract...\");\n\t\t\t\timg_report.has_deep_directories = TRUE;\n\t\t\t\t// Due to the nature of the parsing of Rock Ridge deep directories\n\t\t\t\t// which requires performing a *very costly* search of the whole\n\t\t\t\t// ISO9660 file system to find the matching LSN, ISOs with loads of\n\t\t\t\t// deep directory entries (e.g. OPNsense) are very slow to parse...\n\t\t\t\t// To speed up the scan process, and since we expect deep directory\n\t\t\t\t// entries to appear below anything we care for, we cut things\n\t\t\t\t// short by telling the parent not to bother any further once we\n\t\t\t\t// find that we are dealing with a deep directory.\n\t\t\t\tr = -1;\n\t\t\t\t// Add at least one extra block, since we're skipping content.\n\t\t\t\ttotal_blocks++;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\t\t// Eliminate . and .. entries\n\t\tif ( (strcmp(p_statbuf->filename, \".\") == 0)\n\t\t\t|| (strcmp(p_statbuf->filename, \"..\") == 0) )\n\t\t\tcontinue;\n\t\t// Rock Ridge requires an exception\n\t\tis_symlink = FALSE;\n\t\tif ((p_statbuf->rr.b3_rock == yep) && enable_rockridge) {\n\t\t\tsafe_strcpy(psz_basename, sizeof(psz_fullpath) - length - 1, p_statbuf->filename);\n\t\t\tif (safe_strlen(p_statbuf->filename) > 64)\n\t\t\t\timg_report.has_long_filename = TRUE;\n\t\t\tis_symlink = (p_statbuf->rr.psz_symlink != NULL);\n\t\t\tif (is_symlink)\n\t\t\t\timg_report.has_symlinks = SYMLINKS_RR;\n\t\t} else {\n\t\t\tiso9660_name_translate_ext(p_statbuf->filename, psz_basename, joliet_level);\n\t\t}\n\t\tif (p_statbuf->type == _STAT_DIR) {\n\t\t\tif (!scan_only) {\n\t\t\t\tpsz_sanpath = sanitize_filename(psz_fullpath, &is_identical);\n\t\t\t\tIGNORE_RETVAL(_mkdirU(psz_sanpath));\n\t\t\t\tif (preserve_timestamps) {\n\t\t\t\t\tLPFILETIME ft = to_filetime(mktime(&p_statbuf->tm));\n\t\t\t\t\tset_directory_timestamp(psz_sanpath, ft, ft, ft);\n\t\t\t\t}\n\t\t\t\tsafe_free(psz_sanpath);\n\t\t\t}\n\t\t\tr = iso_extract_files(p_iso, psz_iso_name);\n\t\t\tif (r > 0)\n\t\t\t\tgoto out;\n\t\t\tif (r < 0)\t// Stop processing current dir\n\t\t\t\tbreak;\n\t\t} else {\n\t\t\tfile_length = p_statbuf->total_size;\n\t\t\tif (check_iso_props(psz_path, file_length, psz_basename, psz_fullpath, &props)) {\n\t\t\t\tif (is_symlink && (file_length == 0)) {\n\t\t\t\t\t// Add symlink duplicated files to total_size at scantime\n\t\t\t\t\tif ((strcmp(psz_path, \"/firmware\") == 0)) {\n\t\t\t\t\t\tstatic_sprintf(target_path, \"%s/%s\", psz_path, p_statbuf->rr.psz_symlink);\n\t\t\t\t\t\tiso9660_stat_t* p_statbuf2 = iso9660_ifs_stat_translate(p_iso, target_path);\n\t\t\t\t\t\tif (p_statbuf2 != NULL) {\n\t\t\t\t\t\t\textra_blocks += (p_statbuf2->total_size + ISO_BLOCKSIZE - 1) / ISO_BLOCKSIZE;\n\t\t\t\t\t\t\tiso9660_stat_free(p_statbuf2);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ((strcmp(p_statbuf->filename, \"live\") == 0) &&\n\t\t\t\t\t\t(strcmp(p_statbuf->rr.psz_symlink, \"casper\") == 0)) {\n\t\t\t\t\t\t// Mint LMDE requires working symbolic links and therefore requires the use of NTFS\n\t\t\t\t\t\timg_report.needs_ntfs = TRUE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!is_symlink)\n\t\t\t\tprint_extracted_file(psz_fullpath, file_length);\n\t\t\tfor (i = 0; i < NB_OLD_C32; i++) {\n\t\t\t\tif (props.is_old_c32[i] && use_own_c32[i]) {\n\t\t\t\t\tstatic_sprintf(tmp, \"%s/syslinux-%s/%s\", FILES_DIR, embedded_sl_version_str[0], old_c32_name[i]);\n\t\t\t\t\tif (CopyFileU(tmp, psz_fullpath, FALSE)) {\n\t\t\t\t\t\tuprintf(\"  Replaced with local version %s\", IsFileInDB(tmp)?\"✓\":\"✗\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tuprintf(\"  Could not replace file: %s\", WindowsErrorString());\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (i < NB_OLD_C32)\n\t\t\t\tcontinue;\n\t\t\tpsz_sanpath = sanitize_filename(psz_fullpath, &is_identical);\n\t\t\tif (!is_identical)\n\t\t\t\tuprintf(\"  File name sanitized to '%s'\", psz_sanpath);\n\t\t\tcreate_file = TRUE;\n\t\t\tif (is_symlink) {\n\t\t\t\tif (fs_type == FS_NTFS) {\n\t\t\t\t\t// Replicate symlinks if NTFS is being used\n\t\t\t\t\tstatic_sprintf(target_path, \"%s/%s\", psz_path, p_statbuf->rr.psz_symlink);\n\t\t\t\t\tiso9660_stat_t* p_statbuf2 = iso9660_ifs_stat_translate(p_iso, target_path);\n\t\t\t\t\tif (p_statbuf2 != NULL) {\n\t\t\t\t\t\tto_windows_path(psz_fullpath);\n\t\t\t\t\t\tto_windows_path(p_statbuf->rr.psz_symlink);\n\t\t\t\t\t\tuprintf(\"Symlinking: %s%s ➔ %s\", psz_fullpath,\n\t\t\t\t\t\t\t(p_statbuf2->type == _STAT_DIR) ? \"\\\\\" : \"\", p_statbuf->rr.psz_symlink);\n\t\t\t\t\t\tif (!CreateSymbolicLinkU(psz_fullpath, p_statbuf->rr.psz_symlink,\n\t\t\t\t\t\t\t(p_statbuf2->type == _STAT_DIR) ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0))\n\t\t\t\t\t\t\tuprintf(\"  Could not create symlink: %s\", WindowsErrorString());\n\t\t\t\t\t\tto_unix_path(p_statbuf->rr.psz_symlink);\n\t\t\t\t\t\tto_unix_path(psz_fullpath);\n\t\t\t\t\t\tiso9660_stat_free(p_statbuf2);\n\t\t\t\t\t\tcreate_file = FALSE;\n\t\t\t\t\t}\n\t\t\t\t} else if (file_length == 0) {\n\t\t\t\t\tif ((safe_stricmp(p_statbuf->filename, \"syslinux\") == 0) &&\n\t\t\t\t\t\t// Special handling for ISOs that have a syslinux → isolinux symbolic link (e.g. Knoppix)\n\t\t\t\t\t\t(safe_stricmp(p_statbuf->rr.psz_symlink, \"isolinux\") == 0)) {\n\t\t\t\t\t\tstatic_strcpy(symlinked_syslinux, psz_fullpath);\n\t\t\t\t\t\tprint_extracted_file(psz_fullpath, file_length);\n\t\t\t\t\t\tuprintf(\"  Found Rock Ridge symbolic link to '%s'\", p_statbuf->rr.psz_symlink);\n\t\t\t\t\t} else if (strcmp(psz_path, \"/firmware\") == 0) {\n\t\t\t\t\t\t// Special handling for ISOs that use symlinks for /firmware/ (e.g. Debian non-free)\n\t\t\t\t\t\t// TODO: Do we want to do this for all file symlinks?\n\t\t\t\t\t\tstatic_sprintf(target_path, \"%s/%s\", psz_path, p_statbuf->rr.psz_symlink);\n\t\t\t\t\t\tp_statbuf = iso9660_ifs_stat_translate(p_iso, target_path);\n\t\t\t\t\t\tif (p_statbuf != NULL) {\n\t\t\t\t\t\t\t// The original p_statbuf will be freed automatically, but not\n\t\t\t\t\t\t\t// the new one so we need to force an explicit free.\n\t\t\t\t\t\t\tfree_p_statbuf = TRUE;\n\t\t\t\t\t\t\tfile_length = p_statbuf->total_size;\n\t\t\t\t\t\t\tprint_extracted_file(psz_fullpath, file_length);\n\t\t\t\t\t\t\tuprintf(\"  Duplicated from '%s'\", target_path);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuprintf(\"Could not resolve Rock Ridge Symlink - ABORTING!\");\n\t\t\t\t\t\t\tgoto out;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprint_extracted_file(psz_fullpath, safe_strlen(p_statbuf->rr.psz_symlink));\n\t\t\t\t\t\tuprintf(\"  Ignoring Rock Ridge symbolic link to '%s'\", p_statbuf->rr.psz_symlink);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tuuprintf(\"Unexpected symlink length: %d\", file_length);\n\t\t\t\t\tcreate_file = FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (create_file) {\n\t\t\t\tfile_handle = CreatePreallocatedFile(psz_sanpath, GENERIC_READ | GENERIC_WRITE,\n\t\t\t\t\tFILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, file_length);\n\t\t\t\tif (file_handle == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PATH_NOT_FOUND) {\n\t\t\t\t\t// Some folks (umbrelos) managed to master their ISOs in a manner where some\n\t\t\t\t\t// directories don't exist (or don't have _STAT_DIR) but still have files,\n\t\t\t\t\t// in which case our approach, that expects a sane layout with directories\n\t\t\t\t\t// properly declared before the files they contain, breaks. Therefore:\n\t\t\t\t\tlast_slash = strrchr(psz_sanpath, '/');\n\t\t\t\t\tif (last_slash != NULL) {\n\t\t\t\t\t\t*last_slash = '\\0';\n\t\t\t\t\t\tuprintf(\"WARNING: Directory '%s/' was improperly mastered on the source image!\", &psz_sanpath[2]);\n\t\t\t\t\t\t_mkdirExU(psz_sanpath);\n\t\t\t\t\t\t*last_slash = '/';\n\t\t\t\t\t\tfile_handle = CreatePreallocatedFile(psz_sanpath, GENERIC_READ | GENERIC_WRITE,\n\t\t\t\t\t\t\tFILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, file_length);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (file_handle == INVALID_HANDLE_VALUE) {\n\t\t\t\t\terr = GetLastError();\n\t\t\t\t\tuprintf(\"  Unable to create file: %s\", WindowsErrorString());\n\t\t\t\t\tif (((err == ERROR_ACCESS_DENIED) || (err == ERROR_INVALID_HANDLE)) &&\n\t\t\t\t\t\t(safe_strcmp(&psz_sanpath[3], autorun_name) == 0))\n\t\t\t\t\t\tuprintf(stupid_antivirus);\n\t\t\t\t\telse\n\t\t\t\t\t\tgoto out;\n\t\t\t\t} else if (is_symlink) {\n\t\t\t\t\t// Create a text file that contains the target link\n\t\t\t\t\tISO_BLOCKING(r = WriteFileWithRetry(file_handle, p_statbuf->rr.psz_symlink,\n\t\t\t\t\t\t(DWORD)safe_strlen(p_statbuf->rr.psz_symlink), &wr_size, WRITE_RETRIES));\n\t\t\t\t\tif (!r) {\n\t\t\t\t\t\tuprintf(\"  Error writing file: %s\", WindowsErrorString());\n\t\t\t\t\t\tgoto out;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (fd_md5sum != NULL)\n\t\t\t\t\t\thash_init[HASH_MD5](&ctx);\n\t\t\t\t\tfor (i = 0; file_length > 0; i += nb) {\n\t\t\t\t\t\tif (ErrorStatus)\n\t\t\t\t\t\t\tgoto out;\n\t\t\t\t\t\tlsn = p_statbuf->lsn + (lsn_t)i;\n\t\t\t\t\t\tnb = (size_t)MIN(ISO_BUFFER_SIZE / ISO_BLOCKSIZE, (file_length + ISO_BLOCKSIZE - 1) / ISO_BLOCKSIZE);\n\t\t\t\t\t\tif (iso9660_iso_seek_read(p_iso, buf, lsn, (long)nb) != (nb * ISO_BLOCKSIZE)) {\n\t\t\t\t\t\t\tuprintf(\"  Error reading ISO9660 file %s at LSN %lu\",\n\t\t\t\t\t\t\t\tpsz_iso_name, (long unsigned int)lsn);\n\t\t\t\t\t\t\tgoto out;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuf_size = (DWORD)MIN(file_length, ISO_BUFFER_SIZE);\n\t\t\t\t\t\tif (fd_md5sum != NULL)\n\t\t\t\t\t\t\thash_write[HASH_MD5](&ctx, buf, buf_size);\n\t\t\t\t\t\tISO_BLOCKING(r = WriteFileWithRetry(file_handle, buf, buf_size, &wr_size, WRITE_RETRIES));\n\t\t\t\t\t\tif (!r || wr_size != buf_size) {\n\t\t\t\t\t\t\tif (r)\n\t\t\t\t\t\t\t\tSetLastError(ERROR_WRITE_FAULT);\n\t\t\t\t\t\t\tuprintf(\"  Error writing file: %s\", WindowsErrorString());\n\t\t\t\t\t\t\tgoto out;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfile_length -= wr_size;\n\t\t\t\t\t\tnb_blocks += nb;\n\t\t\t\t\t\tif (nb_blocks - last_nb_blocks >= PROGRESS_THRESHOLD) {\n\t\t\t\t\t\t\tUpdateProgressWithInfo(OP_FILE_COPY, MSG_231, nb_blocks, total_blocks +\n\t\t\t\t\t\t\t\t((fs_type != FS_NTFS) ? extra_blocks : 0));\n\t\t\t\t\t\t\tlast_nb_blocks = nb_blocks;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (fd_md5sum != NULL) {\n\t\t\t\t\t\thash_final[HASH_MD5](&ctx);\n\t\t\t\t\t\tfor (j = 0; j < MD5_HASHSIZE; j++)\n\t\t\t\t\t\t\tfprintf(fd_md5sum, \"%02x\", ctx.buf[j]);\n\t\t\t\t\t\tfprintf(fd_md5sum, \"  ./%s\\n\", &psz_fullpath[3]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (preserve_timestamps) {\n\t\t\t\t\tLPFILETIME ft = to_filetime(mktime(&p_statbuf->tm));\n\t\t\t\t\tif (!SetFileTime(file_handle, ft, ft, ft))\n\t\t\t\t\t\tuprintf(\"  Could not set timestamp: %s\", WindowsErrorString());\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (free_p_statbuf)\n\t\t\t\tiso9660_stat_free(p_statbuf);\n\t\t\tISO_BLOCKING(safe_closehandle(file_handle));\n\t\t\tif (props.is_cfg || props.is_conf)\n\t\t\t\tfix_config(psz_sanpath, psz_path, psz_basename, &props);\n\t\t\tsafe_free(psz_sanpath);\n\t\t}\n\t}\n\tr = 0;\n\nout:\n\tif (r != 0 && GetLastError() != ERROR_SUCCESS)\n\t\tErrorStatus = RUFUS_ERROR(GetLastError());\n\tISO_BLOCKING(safe_closehandle(file_handle));\n\tif (p_entlist != NULL)\n\t\tiso9660_filelist_free(p_entlist);\n\tsafe_free(psz_sanpath);\n\tsafe_free(buf);\n\treturn r;\n}\n\nvoid GetGrubVersion(char* buf, size_t buf_size, const char* source)\n{\n\t// In typical \"I'll make my own Open Source... with blackjack and hookers!\" fashion,\n\t// IBM/Red-Hat/Fedora took it upon themselves to \"fix\" the double space typo from the\n\t// GRUB version string. But of course, just like their introduction of GRUB calls like\n\t// 'grub_debug_is_enabled', they didn't want to bother upstreaming their changes...\n\t// On the other hand, boy do they want to leech of FSF/GNU developed software, while\n\t// not having it mention GNU anywhere. See:\n\t// https://src.fedoraproject.org/rpms/grub2/blob/rawhide/f/0024-Don-t-say-GNU-Linux-in-generated-menus.patch\n\tconst char* grub_version_str[] = { \"GRUB  version %s\", \"GRUB version %s\" };\n\tconst char* grub_debug_is_enabled_str = \"grub_debug_is_enabled\";\n\tconst size_t max_string_size = 32;\t// The strings above *MUST* be no longer than this value\n\tchar grub_version[192] = { 0 };\n\tsize_t i, j;\n\tBOOL has_grub_debug_is_enabled = FALSE;\n\n\t// Make sure we don't overflow our buffer\n\tif (buf_size > max_string_size) {\n\t\tfor (i = 0; i < buf_size - max_string_size; i++) {\n\t\t\tfor (j = 0; j < ARRAYSIZE(grub_version_str); j++) {\n\t\t\t\tif (memcmp(&buf[i], grub_version_str[j], strlen(grub_version_str[j])) == 0) {\n\t\t\t\t\t// For CentOS, who decided to add a '\\n' after \"GRUB  version %s\"\n\t\t\t\t\tif (buf[i + strlen(grub_version_str[j]) + 1] == '\\0')\n\t\t\t\t\t\ti++;\n\t\t\t\t\tstatic_strcpy(grub_version, &buf[i + strlen(grub_version_str[j]) + 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (memcmp(&buf[i], grub_debug_is_enabled_str, strlen(grub_debug_is_enabled_str)) == 0)\n\t\t\t\thas_grub_debug_is_enabled = TRUE;\n\t\t}\n\t}\n\n\tuprintf(\"  Detected GRUB version: %s (from '%s')\", grub_version, source);\n\n\tif (img_report.grub2_version[0] != 0)\n\t\treturn;\n\n\tstatic_strcpy(img_report.grub2_version, grub_version);\n\n\t// <Shakes fist angrily> \"KASPERSKYYYYYY!!!...\" (https://github.com/pbatard/rufus/issues/467)\n\t// But seriously, these guys should know better than \"security\" through obscurity...\n\tif (img_report.grub2_version[0] == '0')\n\t\timg_report.grub2_version[0] = 0;\n\n\t// For some obscure reason, openSUSE have decided that their Live images should\n\t// use /boot/grub2/ as their prefix directory instead of the standard /boot/grub/\n\t// This creates a MAJOR issue because the prefix directory is hardcoded in\n\t// 'core.img', and Rufus must install a 'core.img', that is not provided by the\n\t// ISO, for the USB to boot (since even trying to pick the one from ISOHybrid\n\t// does usually not guarantees the presence of the FAT driver which is mandatory\n\t// for ISO boot).\n\t// Therefore, when *someone* uses a nonstandard GRUB prefix directory, our base\n\t// 'core.img' can't work with their image, since it isn't able to load modules\n\t// like 'normal.mod', that are required to access the configuration files. Oh and\n\t// you can forget about direct editing the prefix string inside 'core.img' since\n\t// GRUB are forcing LZMA compression for BIOS payloads. And it gets even better,\n\t// because even if you're trying to be smart and use GRUB's earlyconfig features\n\t// to do something like:\n\t//   if [ -e /boot/grub2/i386-pc/normal.mod ]; then set prefix = ...\n\t// you still must embed 'configfile.mod' and 'normal.mod' in 'core.img' in order\n\t// to do that, which ends up tripling the file size...\n\t// Also, as mentioned above, Fedora, Ubuntu and others have started applying\n\t// *BREAKING* patches willy-nilly, without bothering to alter the GRUB version\n\t// string. And it gets worse with 2.06 since there are patches we can't detect\n\t// that will produce \"452: out of range pointer\" whether they are applied OR NOT\n\t// (meaning that if you use a patched GRUB 2.06 with unpatched GRUB 2.06 modules\n\t// you will get the error, and if you use unpatched with patched modules, you\n\t// will also get the error).\n\t// Soooo, since the universe, and project maintainers who do not REALISE that\n\t// NOT RELEASING IN A TIMELY MANNER *DOES* HAVE VERY NEGATIVE CONSEQUENCES FOR\n\t// END USERS, are conspiring against us, and since we already have a facility\n\t// for it, we'll use it to dowload the relevant 'core.img' by appending a missing\n\t// version suffix as needed. Especially, if GRUB only identifies itself as '2.06'\n\t// we'll append a sanitized version of the ISO label to try to differentiate\n\t// between GRUB 2.06 incompatible versions...\n\tif (img_report.grub2_version[0] != 0) {\n\t\t// Make sure we append '-nonstandard' and '-gdie' before the sanitized label.\n\t\tBOOL append_label = (safe_strcmp(img_report.grub2_version, \"2.06\") == 0);\n\t\t// Must be in the same order as we have on the server\n\t\tif ((img_report.has_grub2 & 0x7f) > 1)\n\t\t\tsafe_strcat(img_report.grub2_version, sizeof(img_report.grub2_version), \"-nonstandard\");\n\t\tif (has_grub_debug_is_enabled)\n\t\t\tsafe_strcat(img_report.grub2_version, sizeof(img_report.grub2_version), \"-gdie\");\n\t\tif (append_label) {\n\t\t\tsafe_strcat(img_report.grub2_version, sizeof(img_report.grub2_version), \"-\");\n\t\t\tsafe_strcat(img_report.grub2_version, sizeof(img_report.grub2_version), img_report.label);\n\t\t}\n\t\tsanitize_label(img_report.grub2_version);\n\t}\n}\n\nvoid GetGrubFs(char* buf, size_t buf_size)\n{\n\tconst char* grub_fshelp_str = \"fshelp\";\n\tconst size_t max_string_size = 32;\n\tsize_t i;\n\n\tif (buf_size > max_string_size) {\n\t\tfor (i = 0; i < buf_size - max_string_size; i++) {\n\t\t\tif (memcmp(&buf[i], grub_fshelp_str, strlen(grub_fshelp_str) + 1) == 0) {\n\t\t\t\tif (buf[i + strlen(grub_fshelp_str) + 1] != 0 && strlen(&buf[i + strlen(grub_fshelp_str) + 1]) < 12) {\n\t\t\t\t\tStrArrayAddUnique(&grub_filesystems, &buf[i + strlen(grub_fshelp_str) + 1], TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid GetEfiBootInfo(char* buf, size_t buf_size, const char* source)\n{\n\t// Data to help us identify the EFI bootloader type\n\tconst struct {\n\t\tconst char* label;\n\t\tconst char* search_string;\n\t} boot_info[] = {\n\t\t{ \"Shim\", \"UEFI SHIM\\n$Version: \"},\n\t\t// NB: There's also an ID=systemd-boot\\nVERSION=\"x.y.z\" footer\n\t\t// in the Arch systemd-boot EFI binary, but I'm not sure if we\n\t\t// can count on this metadata footer to always be present...\n\t\t{ \"systemd-boot\", \"#### LoaderInfo: systemd-boot \" },\n\t};\n\tconst size_t max_string_size = 64;\n\tsize_t i, j, k;\n\n\tif (buf_size > max_string_size) {\n\t\tfor (i = 0; i < buf_size - max_string_size; i++) {\n\t\t\tfor (j = 0; j < ARRAYSIZE(boot_info); j++) {\n\t\t\t\tif (memcmp(&buf[i], boot_info[j].search_string, strlen(boot_info[j].search_string)) == 0) {\n\t\t\t\t\ti += strlen(boot_info[j].search_string);\n\t\t\t\t\tfor (k = 0; k < 32 && i + k < buf_size - 1 && !isspace(buf[i + k]); k++);\n\t\t\t\t\tbuf[i + k] = '\\0';\n\t\t\t\t\tuprintf(\"  Detected %s version: %s (from '%s')\", boot_info[j].label, &buf[i], source);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nBOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan)\n{\n\tconst char* basedir[] = { \"i386\", \"amd64\", \"minint\" };\n\tint k, r = 1;\n\tchar *tmp, *ext, *spacing = \"  \";\n\tchar path[MAX_PATH], path2[16];\n\tuint8_t* buf = NULL;\n\tuint16_t sl_version;\n\tsize_t i, j, size, sl_index = 0;\n\tFILE* fd;\n\tiso9660_t* p_iso = NULL;\n\tiso9660_pvd_t pvd;\n\tudf_t* p_udf = NULL;\n\tudf_dirent_t* p_udf_root;\n\tiso_extension_mask_t iso_extension_mask = ISO_EXTENSION_ALL;\n\n\tif ((!enable_iso) || (src_iso == NULL) || (dest_dir == NULL))\n\t\treturn FALSE;\n\n\tscan_only = scan;\n\tif (!scan_only)\n\t\tspacing = \"\";\n\tcdio_log_set_handler(log_handler);\n\tpsz_extract_dir = dest_dir;\n\t// Change progress style to marquee for scanning\n\tif (scan_only) {\n\t\tuprintf(\"ISO analysis:\");\n\t\tSendMessage(hMainDialog, UM_PROGRESS_INIT, PBS_MARQUEE, 0);\n\t\ttotal_blocks = 0;\n\t\textra_blocks = 0;\n\t\thas_ldlinux_c32 = FALSE;\n\t\t// String array of all isolinux/syslinux locations\n\t\tStrArrayCreate(&config_path, 8);\n\t\tStrArrayCreate(&isolinux_path, 8);\n\t\tStrArrayCreate(&grub_filesystems, 8);\n\t\tPrintInfo(0, MSG_202);\n\t} else {\n\t\tuprintf(\"Extracting files...\");\n\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\tif (total_blocks == 0) {\n\t\t\tuprintf(\"Error: ISO has not been properly scanned.\");\n\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_ISO_SCAN));\n\t\t\tgoto out;\n\t\t}\n\t\tnb_blocks = 0;\n\t\tlast_nb_blocks = 0;\n\t\tiso_blocking_status = 0;\n\t\tsymlinked_syslinux[0] = 0;\n\t\tStrArrayClear(&modified_files);\n\t\tif (validate_md5sum) {\n\t\t\tmd5sum_totalbytes = 0;\n\t\t\t// If there isn't an already existing md5sum.txt create one\n\t\t\tif (img_report.has_md5sum != 1) {\n\t\t\t\tstatic_sprintf(path, \"%s\\\\%s\", dest_dir, md5sum_name[0]);\n\t\t\t\tfd_md5sum = fopenU(path, \"wb\");\n\t\t\t\tif (fd_md5sum == NULL)\n\t\t\t\t\tuprintf(\"WARNING: Could not create '%s'\", md5sum_name[0]);\n\t\t\t} else {\n\t\t\t\tmd5sum_size = ReadISOFileToBuffer(src_iso, md5sum_name[0], (uint8_t**)&md5sum_data);\n\t\t\t\tmd5sum_pos = md5sum_data;\n\t\t\t}\n\t\t}\n\t}\n\n\t// First try to open as UDF - fallback to ISO if it failed\n\tp_udf = udf_open(src_iso);\n\tif (p_udf == NULL)\n\t\tgoto try_iso;\n\tuprintf(\"%sImage is a UDF image\", spacing);\n\n\tp_udf_root = udf_get_root(p_udf, true, 0);\n\tif (p_udf_root == NULL) {\n\t\tuprintf(\"%sCould not locate UDF root directory\", spacing);\n\t\tgoto try_iso;\n\t}\n\tif (scan_only) {\n\t\tif (udf_get_logical_volume_id(p_udf, img_report.label, sizeof(img_report.label)) <= 0)\n\t\t\timg_report.label[0] = 0;\n\t\t// Open the UDF as ISO so that we can perform size checks\n\t\tp_iso = iso9660_open(src_iso);\n\t}\n\tr = udf_extract_files(p_udf, p_udf_root, \"\");\n\tgoto out;\n\ntry_iso:\n\t// Perform our first scan with Joliet disabled (if Rock Ridge is enabled), so that we can find if\n\t// there exists a Rock Ridge file with a name > 64 chars or if there are symlinks. If that is the\n\t// case then we also disable Joliet during the extract phase.\n\tif ((!enable_joliet) || (enable_rockridge && (scan_only || img_report.has_long_filename ||\n\t\t(img_report.has_symlinks == SYMLINKS_RR)))) {\n\t\tiso_extension_mask &= ~ISO_EXTENSION_JOLIET;\n\t}\n\tif (!enable_rockridge) {\n\t\tiso_extension_mask &= ~ISO_EXTENSION_ROCK_RIDGE;\n\t}\n\n\tp_iso = iso9660_open_ext(src_iso, iso_extension_mask);\n\tif (p_iso == NULL) {\n\t\tuprintf(\"%s'%s' doesn't look like an ISO image\", spacing, src_iso);\n\t\tr = 1;\n\t\tgoto out;\n\t}\n\tuprintf(\"%sImage is an ISO9660 image\", spacing);\n\tjoliet_level = iso9660_ifs_get_joliet_level(p_iso);\n\tif (scan_only) {\n\t\tif (iso9660_ifs_get_volume_id(p_iso, &tmp)) {\n\t\t\tstatic_strcpy(img_report.label, tmp);\n\t\t\tsafe_free(tmp);\n\t\t} else\n\t\t\timg_report.label[0] = 0;\n\t} else {\n\t\tif (iso_extension_mask & (ISO_EXTENSION_JOLIET|ISO_EXTENSION_ROCK_RIDGE))\n\t\t\tuprintf(\"%sThis image will be extracted using %s extensions (if present)\", spacing,\n\t\t\t\t(iso_extension_mask & ISO_EXTENSION_JOLIET)?\"Joliet\":\"Rock Ridge\");\n\t\telse\n\t\t\tuprintf(\"%sThis image will not be extracted using any ISO extensions\", spacing);\n\t}\n\tr = iso_extract_files(p_iso, \"\");\n\nout:\n\tiso_blocking_status = -1;\n\tif (scan_only) {\n\t\tconst char* fs_name[] = { \"fat\", \"exfat\", \"ntfs\" };\n\t\tstruct __stat64 stat;\n\t\tchar fses[256] = { 0 };\n\t\t// Find if there is a mismatch between the ISO size, as reported by the PVD, and the actual file size\n\t\tif ((iso9660_ifs_read_pvd(p_iso, &pvd)) && (_stat64U(src_iso, &stat) == 0))\n\t\t\timg_report.mismatch_size = (int64_t)(iso9660_get_pvd_space_size(&pvd)) * ISO_BLOCKSIZE - stat.st_size;\n\t\t// Remove trailing spaces from the label\n\t\tfor (k = (int)safe_strlen(img_report.label) - 1; ((k > 0) && (isspaceU(img_report.label[k]))); k--)\n\t\t\timg_report.label[k] = 0;\n\t\t// We use the fact that UDF_BLOCKSIZE and ISO_BLOCKSIZE are the same here\n\t\t// Also, we add 1% extra requirement, on account that we most likely use a 4k or higher cluster size\n\t\t// whereas ISO_BLOCKSIZE is 2k, which means we'll need extra spaces if there are many small files.\n\t\timg_report.projected_size = (uint64_t)((double)total_blocks * ISO_BLOCKSIZE * 1.01f);\n\t\t// We will link the existing isolinux.cfg from a syslinux.cfg we create\n\t\t// If multiple config files exist, choose the one with the shortest path\n\t\t// (so that a '/syslinux.cfg' is preferred over a '/isolinux/isolinux.cfg')\n\t\tif (!IsStrArrayEmpty(config_path)) {\n\t\t\t// Set the img_report.cfg_path string to maximum length, so that we don't have to\n\t\t\t// do a special case for StrArray entry 0.\n\t\t\tmemset(img_report.cfg_path, '_', sizeof(img_report.cfg_path) - 1);\n\t\t\timg_report.cfg_path[sizeof(img_report.cfg_path) - 1] = 0;\n\t\t\tfor (i = 0; i < config_path.Index; i++) {\n\t\t\t\t// OpenSuse based Live image have a /syslinux.cfg that doesn't work, so we enforce\n\t\t\t\t// the use of the one in '/boot/[i386|x86_64]/loader/isolinux.cfg' if present.\n\t\t\t\t// Note that, because the openSuse live script are not designed to handle anything but\n\t\t\t\t// an ISO9660 filesystem for the live device, this still won't allow for proper boot.\n\t\t\t\t// See https://github.com/openSUSE/kiwi/issues/354\n\t\t\t\tif ( (_stricmp(config_path.String[i], \"/boot/i386/loader/isolinux.cfg\") == 0) ||\n\t\t\t\t\t (_stricmp(config_path.String[i], \"/boot/x86_64/loader/isolinux.cfg\") == 0)) {\n\t\t\t\t\tstatic_strcpy(img_report.cfg_path, config_path.String[i]);\n\t\t\t\t\timg_report.needs_syslinux_overwrite = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// Tails uses an '/EFI/BOOT/isolinux.cfg' along with a '/isolinux/isolinux.cfg'\n\t\t\t\t// which are the exact same length. However, only the /isolinux one will work,\n\t\t\t\t// so for now, at equal length, always pick the latest.\n\t\t\t\t// We may have to revisit this and prefer a path that contains '/isolinux' if\n\t\t\t\t// this hack is not enough for other images.\n\t\t\t\tif (safe_strlen(img_report.cfg_path) >= safe_strlen(config_path.String[i]))\n\t\t\t\t\tstatic_strcpy(img_report.cfg_path, config_path.String[i]);\n\t\t\t}\n\t\t\tuprintf(\"  Will use '%s' for Syslinux\", img_report.cfg_path);\n\t\t\t// Extract all of the isolinux.bin files we found to identify their versions\n\t\t\tfor (i = 0; i < isolinux_path.Index; i++) {\n\t\t\t\tsize = (size_t)ReadISOFileToBuffer(src_iso, isolinux_path.String[i], &buf);\n\t\t\t\tif (size == 0) {\n\t\t\t\t\tuprintf(\"  Could not access %s\", isolinux_path.String[i]);\n\t\t\t\t} else {\n\t\t\t\t\tsl_version = GetSyslinuxVersion(buf, size, &ext);\n\t\t\t\t\tif (img_report.sl_version == 0) {\n\t\t\t\t\t\tstatic_strcpy(img_report.sl_version_ext, ext);\n\t\t\t\t\t\timg_report.sl_version = sl_version;\n\t\t\t\t\t\tsl_index = i;\n\t\t\t\t\t} else if ((img_report.sl_version != sl_version) || (safe_strcmp(img_report.sl_version_ext, ext) != 0)) {\n\t\t\t\t\t\tuprintf(\"  Found conflicting Isolinux versions:\\r\\n  '%s' (%d.%02d%s) vs '%s' (%d.%02d%s)\",\n\t\t\t\t\t\t\tisolinux_path.String[sl_index], SL_MAJOR(img_report.sl_version), SL_MINOR(img_report.sl_version),\n\t\t\t\t\t\t\timg_report.sl_version_ext, isolinux_path.String[i], SL_MAJOR(sl_version), SL_MINOR(sl_version), ext);\n\t\t\t\t\t\t// Workaround for Antergos and other ISOs, that have multiple Syslinux versions.\n\t\t\t\t\t\t// Where possible, prefer to the one that resides in the same directory as the config file.\n\t\t\t\t\t\tfor (j=safe_strlen(img_report.cfg_path); (j > 0) && (img_report.cfg_path[j] != '/'); j--);\n\t\t\t\t\t\tif (safe_strnicmp(img_report.cfg_path, isolinux_path.String[i], j) == 0) {\n\t\t\t\t\t\t\tstatic_strcpy(img_report.sl_version_ext, ext);\n\t\t\t\t\t\t\timg_report.sl_version = sl_version;\n\t\t\t\t\t\t\tsl_index = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsafe_free(buf);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (img_report.sl_version != 0) {\n\t\t\t\tstatic_sprintf(img_report.sl_version_str, \"%d.%02d\",\n\t\t\t\t\tSL_MAJOR(img_report.sl_version), SL_MINOR(img_report.sl_version));\n\t\t\t\tuprintf(\"  Detected Syslinux version: %s%s (from '%s')\",\n\t\t\t\t\timg_report.sl_version_str, img_report.sl_version_ext, isolinux_path.String[sl_index]);\n\t\t\t\tif ( (has_ldlinux_c32 && (SL_MAJOR(img_report.sl_version) < 5))\n\t\t\t\t  || (!has_ldlinux_c32 && (SL_MAJOR(img_report.sl_version) >= 5)) )\n\t\t\t\t\tuprintf(\"  Warning: Conflict between Isolinux version and the presence of ldlinux.c32...\");\n\t\t\t} else {\n\t\t\t\t// Couldn't find a version from isolinux.bin. Force set to the versions we embed\n\t\t\t\timg_report.sl_version = embedded_sl_version[has_ldlinux_c32?1:0];\n\t\t\t\tstatic_sprintf(img_report.sl_version_str, \"%d.%02d\",\n\t\t\t\t\tSL_MAJOR(img_report.sl_version), SL_MINOR(img_report.sl_version));\n\t\t\t\tuprintf(\"  Warning: Could not detect Isolinux version - Forcing to %s (embedded)\",\n\t\t\t\t\timg_report.sl_version_str);\n\t\t\t}\n\t\t}\n\t\tif (!IS_EFI_BOOTABLE(img_report) && HAS_EFI_IMG(img_report) && HasEfiImgBootLoaders()) {\n\t\t\timg_report.has_efi = 0x8000;\n\t\t}\n\t\tif (HAS_WINPE(img_report)) {\n\t\t\t// In case we have a WinPE 1.x based iso, we extract and parse txtsetup.sif\n\t\t\t// during scan, to see if /minint was provided for OsLoadOptions, as it decides\n\t\t\t// whether we should use 0x80 or 0x81 as the disk ID in the MBR\n\t\t\tstatic_sprintf(path, \"/%s/txtsetup.sif\",\n\t\t\t\tbasedir[((img_report.winpe & WINPE_I386) == WINPE_I386) ? 0 : ((img_report.winpe & WINPE_AMD64) == WINPE_AMD64 ? 1 : 2)]);\n\t\t\tsize = (size_t)ReadISOFileToBuffer(src_iso, path, &buf);\n\t\t\ttmp = get_token_data_buffer(\"OsLoadOptions\", 1, buf, size);\n\t\t\tif (tmp != NULL) {\n\t\t\t\tfor (i = 0; i < strlen(tmp); i++)\n\t\t\t\t\ttmp[i] = (char)tolower(tmp[i]);\n\t\t\t\tuprintf(\"  Checking txtsetup.sif:\\r\\n  OsLoadOptions = %s\", tmp);\n\t\t\t\timg_report.uses_minint = (strstr(tmp, \"/minint\") != NULL);\n\t\t\t\tsafe_free(tmp);\n\t\t\t}\n\t\t\tsafe_free(buf);\n\t\t}\n\t\tif (HAS_WININST(img_report)) {\n\t\t\tchar wim_path[4 * MAX_PATH];\n\t\t\tassert(safe_strlen(image_path) + safe_strlen(&img_report.wininst_path[0][2]) + 2 < ARRAYSIZE(wim_path));\n\t\t\tstatic_sprintf(wim_path, \"%s|%s\", image_path, &img_report.wininst_path[0][2]);\n\t\t\timg_report.wininst_version = GetWimVersion(wim_path);\n\t\t}\n\t\tif (img_report.has_grub2) {\n\t\t\tchar grub_path[128];\n\t\t\tstatic_sprintf(grub_path, \"/%s/normal.mod\", &grub_dirname[img_report.has_grub2 - 1][1]);\n\t\t\t// In case we have a GRUB2 based iso, we extract boot/grub/i386-pc/normal.mod to parse its version\n\t\t\timg_report.grub2_version[0] = 0;\n\t\t\tsize = (size_t)ReadISOFileToBuffer(src_iso, grub_path, &buf);\n\t\t\tif (size == 0)\n\t\t\t\tuprintf(\"  Could not read Grub version from '%s'\", grub_path);\n\t\t\telse\n\t\t\t\tGetGrubVersion(buf, size, grub_path);\n\t\t\tsafe_free(buf);\n\t\t\tif (img_report.grub2_version[0] == 0) {\n\t\t\t\tuprintf(\"  Could not detect Grub version\");\n\t\t\t\timg_report.has_grub2 &= 0x80;\n\t\t\t}\n\t\t}\n\t\tfor (j = 0; j < ARRAYSIZE(img_report.efi_boot_entry); j++) {\n\t\t\tif (!img_report.efi_boot_entry[j].path[0])\n\t\t\t\tcontinue;\n\t\t\tif (img_report.efi_boot_entry[j].type == EBT_GRUB) {\n\t\t\t\tsize = (size_t)ReadISOFileToBuffer(src_iso, img_report.efi_boot_entry[j].path, &buf);\n\t\t\t\tif (size == 0) {\n\t\t\t\t\tuprintf(\"  Could not read Grub version from '%s'\", img_report.efi_boot_entry[j].path);\n\t\t\t\t} else {\n\t\t\t\t\timg_report.has_grub2 |= 0x80;\n\t\t\t\t\tGetGrubVersion(buf, size, img_report.efi_boot_entry[j].path);\n\t\t\t\t\tGetGrubFs(buf, size);\n\t\t\t\t}\n\t\t\t\tsafe_free(buf);\n\t\t\t} else if (img_report.efi_boot_entry[j].type == EBT_MAIN) {\n\t\t\t\tsize = (size_t)ReadISOFileToBuffer(src_iso, img_report.efi_boot_entry[j].path, &buf);\n\t\t\t\tif (size == 0) {\n\t\t\t\t\tuprintf(\"  Could not parse '%s'\", img_report.efi_boot_entry[j].path);\n\t\t\t\t} else {\n\t\t\t\t\tGetEfiBootInfo(buf, size, img_report.efi_boot_entry[j].path);\n\t\t\t\t}\n\t\t\t\tsafe_free(buf);\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < (int)grub_filesystems.Index; i++) {\n\t\t\tif (i != 0)\n\t\t\t\tstatic_strcat(fses, \", \");\n\t\t\tstatic_strcat(fses, grub_filesystems.String[i]);\n\t\t\tfor (j = 0; j < ARRAYSIZE(fs_name); j++)\n\t\t\t\tif (stricmp(grub_filesystems.String[i], fs_name[j]) == 0)\n\t\t\t\t\timg_report.has_grub2_fs |= (1 << j);\n\t\t}\n\t\tif (*fses)\n\t\t\tuprintf(\"  Supported GRUB filesystems: %s\", fses);\n\n\t\tStrArrayDestroy(&config_path);\n\t\tStrArrayDestroy(&isolinux_path);\n\t\tStrArrayDestroy(&grub_filesystems);\n\t\tSendMessage(hMainDialog, UM_PROGRESS_EXIT, 0, 0);\n\t} else {\n\t\t// Solus and other ISOs only provide EFI boot files in a FAT efi.img\n\t\t// Also work around ISOs that have a borked symbolic link for bootx64.efi.\n\t\t// See https://github.com/linuxmint/linuxmint/issues/622.\n\t\tif (img_report.has_efi & 0xc000) {\n\t\t\tif (img_report.has_efi & 0x4000) {\n\t\t\t\tuprintf(\"Broken UEFI bootloader detected - Applying workaround:\");\n\t\t\t\tstatic_sprintf(path, \"%s\\\\EFI\\\\boot\\\\bootx64.efi\", dest_dir);\n\t\t\t\tDeleteFileU(path);\n\t\t\t}\n\t\t\tDumpFatDir(dest_dir, 0);\n\t\t}\n\t\tif (HAS_SYSLINUX(img_report)) {\n\t\t\tstatic_sprintf(path, \"%s\\\\syslinux.cfg\", dest_dir);\n\t\t\t// Create a /syslinux.cfg (if none exists) that points to the existing isolinux cfg\n\t\t\tfd = fopen(path, \"r\");\n\t\t\tif (fd != NULL && img_report.needs_syslinux_overwrite) {\n\t\t\t\tfclose(fd);\n\t\t\t\tfd = NULL;\n\t\t\t\tstatic_sprintf(path2, \"%s\\\\syslinux.org\", dest_dir);\n\t\t\t\tuprintf(\"Renaming: %s ➔ %s\", path, path2);\n\t\t\t\tIGNORE_RETVAL(rename(path, path2));\n\t\t\t}\n\t\t\tif (fd == NULL) {\n\t\t\t\tfd = fopen(path, \"w\");\t// No \"/syslinux.cfg\" => create a new one\n\t\t\t\tif (fd == NULL) {\n\t\t\t\t\tuprintf(\"Unable to create %s - booting from USB will not work\", path);\n\t\t\t\t\tr = 1;\n\t\t\t\t} else {\n\t\t\t\t\tfprintf(fd, \"DEFAULT loadconfig\\n\\nLABEL loadconfig\\n  CONFIG %s\\n\", img_report.cfg_path);\n\t\t\t\t\tfor (i = safe_strlen(img_report.cfg_path); (i > 0) && (img_report.cfg_path[i] != '/'); i--);\n\t\t\t\t\tif (i > 0) {\n\t\t\t\t\t\timg_report.cfg_path[i] = 0;\n\t\t\t\t\t\tfprintf(fd, \"  APPEND %s/\\n\", img_report.cfg_path);\n\t\t\t\t\t\timg_report.cfg_path[i] = '/';\n\t\t\t\t\t}\n\t\t\t\t\tuprintf(\"Created: %s → %s\", path, img_report.cfg_path);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (fd != NULL)\n\t\t\t\tfclose(fd);\n\t\t\t// Workaround needed for Knoppix that has a /boot/syslinux that links to /boot/isolinux/\n\t\t\t// with EFI Syslinux trying to read /boot/syslinux/syslnx[32|64].cfg as the config file.\n\t\t\tif (symlinked_syslinux[0] != 0) {\n\t\t\t\tstatic const char* efi_cfg_name[] = { \"syslnx32.cfg\", \"syslnx64.cfg\" };\n\t\t\t\tsize_t len = strlen(symlinked_syslinux);\n\t\t\t\tchar isolinux_dir[MAX_PATH];\n\t\t\t\tstatic_strcpy(isolinux_dir, symlinked_syslinux);\n\t\t\t\tassert(len > 8);\n\t\t\t\t// \".../syslinux\" -> \".../isolinux\"\n\t\t\t\tisolinux_dir[len - 8] = 'i';\n\t\t\t\tisolinux_dir[len - 7] = 's';\n\t\t\t\tisolinux_dir[len - 6] = 'o';\n\t\t\t\t// Delete the empty syslinux symbolic link remnant and replace it with a syslinux/ dir\n\t\t\t\tDeleteFileA(symlinked_syslinux);\n\t\t\t\tCreateDirectoryA(symlinked_syslinux, NULL);\n\t\t\t\t// Now add the relevant config files that link back to the ones in isolinux/\n\t\t\t\tfor (i = 0; i < ARRAYSIZE(efi_cfg_name); i++) {\n\t\t\t\t\tstatic_sprintf(path, \"%s/%s\", isolinux_dir, efi_cfg_name[i]);\n\t\t\t\t\tif (!PathFileExistsA(path))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tstatic_sprintf(path, \"%s/%s\", symlinked_syslinux, efi_cfg_name[i]);\n\t\t\t\t\tfd = fopen(path, \"w\");\n\t\t\t\t\tif (fd == NULL) {\n\t\t\t\t\t\tuprintf(\"Unable to create %s - booting from USB may not work\", path);\n\t\t\t\t\t\tr = 1;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tstatic_sprintf(path, \"%s/%s\", isolinux_dir, efi_cfg_name[i]);\n\t\t\t\t\tfprintf(fd, \"DEFAULT loadconfig\\n\\nLABEL loadconfig\\n  CONFIG %s\\n  APPEND %s\\n\", &path[2], &isolinux_dir[2]);\n\t\t\t\t\tfclose(fd);\n\t\t\t\t\tto_windows_path(symlinked_syslinux);\n\t\t\t\t\tuprintf(\"Created: %s\\\\%s → %s\", symlinked_syslinux, efi_cfg_name[i], &path[2]);\n\t\t\t\t\tto_unix_path(symlinked_syslinux);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (HAS_BOOTMGR(img_report) && enable_ntfs_compression) {\n\t\t\t// bootmgr might need to be uncompressed: https://github.com/pbatard/rufus/issues/1381\n\t\t\tRunCommand(\"compact /u bootmgr* efi/boot/*.efi\", dest_dir, TRUE);\n\t\t}\n\t\t// Exception for Slax Syslinux UEFI bootloaders...\n\t\t// ...that don't appear to work anyway as of slax-64bit-slackware-15.0.3.iso\n\t\tstatic_sprintf(path, \"%s\\\\slax\\\\boot\\\\EFI\", dest_dir);\n\t\tif (PathFileExistsA(path)) {\n\t\t\tchar dst_path[16];\n\t\t\tstatic_sprintf(dst_path, \"%s\\\\EFI\", dest_dir);\n\t\t\tif (!PathFileExistsA(dst_path)) {\n\t\t\t\tif (MoveFileA(path, dst_path))\n\t\t\t\t\tuprintf(\"Moved: %s → %s\", path, dst_path);\n\t\t\t\telse\n\t\t\t\t\tuprintf(\"Could not move %s → %s: %s\", path, dst_path, WindowsErrorString());\n\t\t\t}\n\t\t}\n\t\tif (fd_md5sum != NULL) {\n\t\t\tuprintf(\"Created: %s\\\\%s (%s)\", dest_dir, md5sum_name[0], SizeToHumanReadable(ftell(fd_md5sum), FALSE, FALSE));\n\t\t\tfclose(fd_md5sum);\n\t\t} else if (md5sum_data != NULL) {\n\t\t\tsafe_free(md5sum_data);\n\t\t\tmd5sum_size = 0;\n\t\t}\n\t}\n\tiso9660_close(p_iso);\n\tudf_close(p_udf);\n\tif ((r != 0) && (ErrorStatus == 0))\n\t\tErrorStatus = RUFUS_ERROR(APPERR(scan_only ? ERROR_ISO_SCAN : ERROR_ISO_EXTRACT));\n\treturn (r == 0);\n}\n\nint64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_file, DWORD attributes)\n{\n\tsize_t i;\n\tssize_t read_size;\n\tint64_t file_length, r = 0;\n\tchar buf[UDF_BLOCKSIZE];\n\tDWORD buf_size, wr_size;\n\tiso9660_t* p_iso = NULL;\n\tudf_t* p_udf = NULL;\n\tudf_dirent_t *p_udf_root = NULL, *p_udf_file = NULL;\n\tiso9660_stat_t *p_statbuf = NULL;\n\tlsn_t lsn;\n\tHANDLE file_handle = INVALID_HANDLE_VALUE;\n\n\tfile_handle = CreateFileU(dest_file, GENERIC_READ | GENERIC_WRITE,\n\t\tFILE_SHARE_READ, NULL, CREATE_ALWAYS, attributes, NULL);\n\tif (file_handle == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Could not create file %s: %s\", dest_file, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t// First try to open as UDF - fallback to ISO if it failed\n\tp_udf = udf_open(iso);\n\tif (p_udf == NULL)\n\t\tgoto try_iso;\n\n\tp_udf_root = udf_get_root(p_udf, true, 0);\n\tif (p_udf_root == NULL) {\n\t\tuprintf(\"Could not locate UDF root directory\");\n\t\tgoto out;\n\t}\n\tp_udf_file = udf_fopen(p_udf_root, iso_file);\n\tif (!p_udf_file) {\n\t\tuprintf(\"Could not locate file %s in ISO image\", iso_file);\n\t\tgoto out;\n\t}\n\tfile_length = udf_get_file_length(p_udf_file);\n\twhile (file_length > 0) {\n\t\tmemset(buf, 0, UDF_BLOCKSIZE);\n\t\tread_size = udf_read_block(p_udf_file, buf, 1);\n\t\tif (read_size < 0) {\n\t\t\tuprintf(\"Error reading UDF file %s\", iso_file);\n\t\t\tgoto out;\n\t\t}\n\t\tbuf_size = (DWORD)MIN(file_length, (int64_t)read_size);\n\t\tif (!WriteFileWithRetry(file_handle, buf, buf_size, &wr_size, WRITE_RETRIES)) {\n\t\t\tuprintf(\"Error writing file %s: %s\", dest_file, WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tfile_length -= buf_size;\n\t\tr += buf_size;\n\t}\n\tgoto out;\n\ntry_iso:\n\t// Make sure to enable extensions, else we may not match the name of the file we are looking\n\t// for since Rock Ridge may be needed to translate something like 'I386_PC' into 'i386-pc'...\n\tp_iso = iso9660_open_ext(iso, ISO_EXTENSION_MASK);\n\tif (p_iso == NULL) {\n\t\tuprintf(\"Unable to open image '%s'\", iso);\n\t\tgoto out;\n\t}\n\n\tp_statbuf = iso9660_ifs_stat_translate(p_iso, iso_file);\n\tif (p_statbuf == NULL) {\n\t\tuprintf(\"Could not get ISO-9660 file information for file %s\", iso_file);\n\t\tgoto out;\n\t}\n\n\tfile_length = p_statbuf->total_size;\n\tfor (i = 0; file_length > 0; i++) {\n\t\tmemset(buf, 0, ISO_BLOCKSIZE);\n\t\tlsn = p_statbuf->lsn + (lsn_t)i;\n\t\tif (iso9660_iso_seek_read(p_iso, buf, lsn, 1) != ISO_BLOCKSIZE) {\n\t\t\tuprintf(\"Error reading ISO9660 file %s at LSN %lu\", iso_file, (long unsigned int)lsn);\n\t\t\tgoto out;\n\t\t}\n\t\tbuf_size = (DWORD)MIN(file_length, ISO_BLOCKSIZE);\n\t\tif (!WriteFileWithRetry(file_handle, buf, buf_size, &wr_size, WRITE_RETRIES)) {\n\t\t\tuprintf(\"Error writing file %s: %s\", dest_file, WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tfile_length -= buf_size;\n\t\tr += buf_size;\n\t}\n\nout:\n\tsafe_closehandle(file_handle);\n\tif (r == 0)\n\t\tDeleteFileU(dest_file);\n\tiso9660_stat_free(p_statbuf);\n\tudf_dirent_free(p_udf_root);\n\tudf_dirent_free(p_udf_file);\n\tiso9660_close(p_iso);\n\tudf_close(p_udf);\n\treturn r;\n}\n\n/*\n * Extract a file to a buffer. Buffer must be freed by the caller.\n */\nuint32_t ReadISOFileToBuffer(const char* iso, const char* iso_file, uint8_t** buf)\n{\n\tssize_t read_size;\n\tint64_t file_length;\n\tuint32_t ret = 0, nblocks;\n\tiso9660_t* p_iso = NULL;\n\tudf_t* p_udf = NULL;\n\tudf_dirent_t *p_udf_root = NULL, *p_udf_file = NULL;\n\tiso9660_stat_t* p_statbuf = NULL;\n\n\t*buf = NULL;\n\tcdio_loglevel_default = CDIO_LOG_WARN;\n\n\t// First try to open as UDF - fallback to ISO if it failed\n\tp_udf = udf_open(iso);\n\tif (p_udf == NULL)\n\t\tgoto try_iso;\n\tp_udf_root = udf_get_root(p_udf, true, 0);\n\tif (p_udf_root == NULL) {\n\t\tuprintf(\"Could not locate UDF root directory\");\n\t\tgoto out;\n\t}\n\tp_udf_file = udf_fopen(p_udf_root, iso_file);\n\tif (!p_udf_file) {\n\t\tuprintf(\"Could not locate file %s in ISO image\", iso_file);\n\t\tgoto out;\n\t}\n\tfile_length = udf_get_file_length(p_udf_file);\n\tif (file_length > 1 * GB) {\n\t\tuprintf(\"Only files smaller than 1 GB are supported\");\n\t\tgoto out;\n\t}\n\tnblocks = (uint32_t)((file_length + UDF_BLOCKSIZE - 1) / UDF_BLOCKSIZE);\n\t*buf = malloc(nblocks * UDF_BLOCKSIZE + 1);\n\tif (*buf == NULL) {\n\t\tuprintf(\"Could not allocate buffer for file %s\", iso_file);\n\t\tgoto out;\n\t}\n\tread_size = udf_read_block(p_udf_file, *buf, nblocks);\n\tif (read_size < 0 || read_size != file_length) {\n\t\tuprintf(\"Error reading UDF file %s\", iso_file);\n\t\tgoto out;\n\t}\n\tret = (uint32_t)file_length;\n\t(*buf)[ret] = 0;\n\tgoto out;\n\ntry_iso:\n\t// Make sure to enable extensions, else we may not match the name of the file we are looking\n\t// for since Rock Ridge may be needed to translate something like 'I386_PC' into 'i386-pc'...\n\tp_iso = iso9660_open_ext(iso, ISO_EXTENSION_MASK);\n\tif (p_iso == NULL) {\n\t\tuprintf(\"Unable to open image '%s'\", iso);\n\t\tgoto out;\n\t}\n\tp_statbuf = iso9660_ifs_stat_translate(p_iso, iso_file);\n\tif (p_statbuf == NULL) {\n\t\tuprintf(\"Could not get ISO-9660 file information for file %s\", iso_file);\n\t\tgoto out;\n\t}\n\tfile_length = p_statbuf->total_size;\n\tif (file_length > 1 * GB) {\n\t\tuprintf(\"Only files smaller than 1 GB are supported\");\n\t\tgoto out;\n\t}\n\t// coverity[cast_overflow]\n\tnblocks = (uint32_t)((file_length + ISO_BLOCKSIZE - 1) / ISO_BLOCKSIZE);\n\t*buf = malloc(nblocks * ISO_BLOCKSIZE + 1);\n\tif (*buf == NULL) {\n\t\tuprintf(\"Could not allocate buffer for file %s\", iso_file);\n\t\tgoto out;\n\t}\n\tif (iso9660_iso_seek_read(p_iso, *buf, p_statbuf->lsn, nblocks) != nblocks * ISO_BLOCKSIZE) {\n\t\tuprintf(\"Error reading ISO file %s\", iso_file);\n\t\tgoto out;\n\t}\n\tret = (uint32_t)file_length;\n\t(*buf)[ret] = 0;\n\nout:\n\tiso9660_stat_free(p_statbuf);\n\tudf_dirent_free(p_udf_root);\n\tudf_dirent_free(p_udf_file);\n\tiso9660_close(p_iso);\n\tudf_close(p_udf);\n\tcdio_loglevel_default = usb_debug ? CDIO_LOG_INFO : CDIO_LOG_WARN;\n\tif (ret == 0)\n\t\tsafe_free(*buf);\n\treturn ret;\n}\n\n#define ISO_NB_BLOCKS 16\ntypedef struct {\n\tiso9660_t*      p_iso;\n\tlsn_t           lsn;\n\tlibfat_sector_t sec_start;\n\t// Use a multi block buffer, to improve sector reads\n\tuint8_t         buf[ISO_BLOCKSIZE * ISO_NB_BLOCKS];\n} iso9660_readfat_private;\n\n/*\n * Read sectors from a FAT img file residing on an ISO-9660 filesystem.\n * NB: This assumes that the img file sectors are contiguous on the ISO.\n  */\nint iso9660_readfat(intptr_t pp, void *buf, size_t secsize, libfat_sector_t sec)\n{\n\tiso9660_readfat_private* p_private = (iso9660_readfat_private*)pp;\n\n\tif (sizeof(p_private->buf) % secsize != 0) {\n\t\tuprintf(\"iso9660_readfat: Sector size %zu is not a divisor of %zu\", secsize, sizeof(p_private->buf));\n\t\treturn 0;\n\t}\n\n\tif ((sec < p_private->sec_start) || (sec >= p_private->sec_start + sizeof(p_private->buf) / secsize)) {\n\t\t// Sector being queried is not in our multi block buffer -> Update it\n\t\tp_private->sec_start = (((sec * secsize) / ISO_BLOCKSIZE) * ISO_BLOCKSIZE) / secsize;\n\t\tif (iso9660_iso_seek_read(p_private->p_iso, p_private->buf,\n\t\t\tp_private->lsn + (lsn_t)((p_private->sec_start * secsize) / ISO_BLOCKSIZE), ISO_NB_BLOCKS)\n\t\t\t!= ISO_NB_BLOCKS * ISO_BLOCKSIZE) {\n\t\t\tuprintf(\"Error reading ISO-9660 file %s at LSN %lu\", img_report.efi_img_path,\n\t\t\t\t(long unsigned int)(p_private->lsn + (p_private->sec_start * secsize) / ISO_BLOCKSIZE));\n\t\t\treturn 0;\n\t\t}\n\t}\n\tmemcpy(buf, &p_private->buf[(sec - p_private->sec_start)*secsize], secsize);\n\treturn (int)secsize;\n}\n\n/*\n * Returns TRUE if an EFI bootloader exists in the img.\n */\nBOOL HasEfiImgBootLoaders(void)\n{\n\tBOOL ret = FALSE;\n\tiso9660_t* p_iso = NULL;\n\tiso9660_stat_t* p_statbuf = NULL;\n\tiso9660_readfat_private* p_private = NULL;\n\tint32_t dc, c;\n\tstruct libfat_filesystem *lf_fs = NULL;\n\tstruct libfat_direntry direntry;\n\tchar bootloader_name[16];\n\tint i;\n\n\tif ((image_path == NULL) || !HAS_EFI_IMG(img_report))\n\t\treturn FALSE;\n\n\tp_iso = iso9660_open_ext(image_path, ISO_EXTENSION_MASK);\n\tif (p_iso == NULL) {\n\t\tuprintf(\"Could not open image '%s' as an ISO-9660 file system\", image_path);\n\t\tgoto out;\n\t}\n\tp_statbuf = iso9660_ifs_stat_translate(p_iso, img_report.efi_img_path);\n\tif (p_statbuf == NULL) {\n\t\tuprintf(\"Could not get ISO-9660 file information for file %s\", img_report.efi_img_path);\n\t\tgoto out;\n\t}\n\tp_private = malloc(sizeof(iso9660_readfat_private));\n\tif (p_private == NULL)\n\t\tgoto out;\n\tp_private->p_iso = p_iso;\n\tp_private->lsn = p_statbuf->lsn;\n\tp_private->sec_start = 0;\n\t// Populate our initial buffer\n\tif (iso9660_iso_seek_read(p_private->p_iso, p_private->buf, p_private->lsn, ISO_NB_BLOCKS) != ISO_NB_BLOCKS * ISO_BLOCKSIZE) {\n\t\tuprintf(\"Error reading ISO-9660 file %s at LSN %lu\", img_report.efi_img_path, (long unsigned int)p_private->lsn);\n\t\tgoto out;\n\t}\n\tlf_fs = libfat_open(iso9660_readfat, (intptr_t)p_private);\n\tif (lf_fs == NULL) {\n\t\tuprintf(\"FAT access error\");\n\t\tgoto out;\n\t}\n\n\t// Navigate to /EFI/BOOT\n\tif (libfat_searchdir(lf_fs, 0, \"EFI        \", &direntry) < 0)\n\t\tgoto out;\n\tdc = direntry.entry[26] + (direntry.entry[27] << 8);\n\tif (libfat_searchdir(lf_fs, dc, \"BOOT       \", &direntry) < 0)\n\t\tgoto out;\n\tdc = direntry.entry[26] + (direntry.entry[27] << 8);\n\n\tfor (i = 1; i < ARRAYSIZE(efi_archname); i++) {\n\t\t// We consider it unlikely that any bootri#####.efi or bootlo#####.efi files\n\t\t// in the /efi/boot/ subdirectory will be anything but 'bootriscv64.efi' and\n\t\t// 'bootloongarch64.efi', so we'll use the ~1 LFN shortened names for them.\n\t\tstatic_sprintf(bootloader_name, \"BOOT%c%c%c%cEFI\", efi_archname[i][0], efi_archname[i][1],\n\t\t\tstrlen(efi_archname[i]) > 4 ? '~' : efi_archname[i][2],\n\t\t\tstrlen(efi_archname[i]) > 4 ? '1' : (strlen(efi_archname[i]) > 3 ? efi_archname[i][3] : ' '));\n\t\tsafe_strtoupper(bootloader_name);\n\t\tc = libfat_searchdir(lf_fs, dc, bootloader_name, &direntry);\n\t\tif (c > 0) {\n\t\t\tif (!ret)\n\t\t\t\tuprintf(\"  Detected EFI bootloader(s) (from '%s'):\", img_report.efi_img_path);\n\t\t\tuprintf(\"  ● 'boot%s.efi'\", efi_archname[i]);\n\t\t\tret = TRUE;\n\t\t}\n\t}\n\nout:\n\tif (lf_fs != NULL)\n\t\tlibfat_close(lf_fs);\n\tiso9660_stat_free(p_statbuf);\n\tiso9660_close(p_iso);\n\tsafe_free(p_private);\n\treturn ret;\n}\n\nBOOL DumpFatDir(const char* path, int32_t cluster)\n{\n\t// We don't have concurrent calls to this function, so a static lf_fs is fine\n\tstatic struct libfat_filesystem *lf_fs = NULL;\n\tvoid* buf;\n\tchar *target = NULL, *name = NULL;\n\tBOOL ret = FALSE;\n\tHANDLE handle = NULL;\n\tDWORD size, written;\n\tlibfat_diritem_t diritem = { 0 };\n\tlibfat_dirpos_t dirpos = { cluster, -1, 0 };\n\tlibfat_sector_t s;\n\tiso9660_t* p_iso = NULL;\n\tiso9660_stat_t* p_statbuf = NULL;\n\tiso9660_readfat_private* p_private = NULL;\n\n\tif (path == NULL)\n\t\treturn -1;\n\n\tif (cluster == 0) {\n\t\t// Root dir => Perform init stuff\n\t\tif (image_path == NULL)\n\t\t\treturn FALSE;\n\t\tp_iso = iso9660_open_ext(image_path, ISO_EXTENSION_MASK);\n\t\tif (p_iso == NULL) {\n\t\t\tuprintf(\"Could not open image '%s' as an ISO-9660 file system\", image_path);\n\t\t\tgoto out;\n\t\t}\n\t\tp_statbuf = iso9660_ifs_stat_translate(p_iso, img_report.efi_img_path);\n\t\tif (p_statbuf == NULL) {\n\t\t\tuprintf(\"Could not get ISO-9660 file information for file %s\", img_report.efi_img_path);\n\t\t\tgoto out;\n\t\t}\n\t\tp_private = malloc(sizeof(iso9660_readfat_private));\n\t\tif (p_private == NULL)\n\t\t\tgoto out;\n\t\tp_private->p_iso = p_iso;\n\t\tp_private->lsn = p_statbuf->lsn;\n\t\tp_private->sec_start = 0;\n\t\t// Populate our initial buffer\n\t\tif (iso9660_iso_seek_read(p_private->p_iso, p_private->buf, p_private->lsn, ISO_NB_BLOCKS) != ISO_NB_BLOCKS * ISO_BLOCKSIZE) {\n\t\t\tuprintf(\"Error reading ISO-9660 file %s at LSN %lu\", img_report.efi_img_path, (long unsigned int)p_private->lsn);\n\t\t\tgoto out;\n\t\t}\n\t\tlf_fs = libfat_open(iso9660_readfat, (intptr_t)p_private);\n\t\tif (lf_fs == NULL) {\n\t\t\tuprintf(\"FAT access error\");\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\tdo {\n\t\tdirpos.cluster = libfat_dumpdir(lf_fs, &dirpos, &diritem);\n\t\tif (dirpos.cluster >= 0) {\n\t\t\tname = wchar_to_utf8(diritem.name);\n\t\t\ttarget = malloc(strlen(path) + safe_strlen(name) + 2);\n\t\t\tif ((name == NULL) || (target == NULL)) {\n\t\t\t\tuprintf(\"Could not allocate buffer\");\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tstrcpy(target, path);\n\t\t\tstrcat(target, \"\\\\\");\n\t\t\tstrcat(target, name);\n\t\t\tif (diritem.attributes & 0x10) {\n\t\t\t\t// Directory => Create directory\n\t\t\t\tif (!CreateDirectoryU(target, 0) && (GetLastError() != ERROR_ALREADY_EXISTS)) {\n\t\t\t\t\tuprintf(\"Could not create directory '%s': %s\", target, WindowsErrorString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!DumpFatDir(target, dirpos.cluster))\n\t\t\t\t\tgoto out;\n\t\t\t} else if (!PathFileExistsU(target)) {\n\t\t\t\t// Need to figure out if it's a .conf file (Damn you Solus!!)\n\t\t\t\tEXTRACT_PROPS props = { 0 };\n\t\t\t\tsize_t len = strlen(name);\n\t\t\t\tprops.is_conf = ((len > 4) && (stricmp(&name[len - 5], \".conf\") == 0));\n\t\t\t\tuprintf(\"Extracting: %s (from '%s', %s)\", target, img_report.efi_img_path,\n\t\t\t\t\tSizeToHumanReadable(diritem.size, FALSE, FALSE));\n\t\t\t\thandle = CreateFileU(target, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ,\n\t\t\t\t\tNULL, CREATE_ALWAYS, diritem.attributes, NULL);\n\t\t\t\tif (handle == INVALID_HANDLE_VALUE) {\n\t\t\t\t\tuprintf(\"Could not create '%s': %s\", target, WindowsErrorString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\twritten = 0;\n\t\t\t\ts = libfat_clustertosector(lf_fs, dirpos.cluster);\n\t\t\t\twhile ((s != 0) && (s < 0xFFFFFFFFULL) && (written < diritem.size)) {\n\t\t\t\t\tbuf = libfat_get_sector(lf_fs, s);\n\t\t\t\t\tif (buf == NULL)\n\t\t\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_SECTOR_NOT_FOUND);\n\t\t\t\t\tif (IS_ERROR(ErrorStatus))\n\t\t\t\t\t\tgoto out;\n\t\t\t\t\tsize = MIN(LIBFAT_SECTOR_SIZE, diritem.size - written);\n\t\t\t\t\tif (!WriteFileWithRetry(handle, buf, size, &size, WRITE_RETRIES) ||\n\t\t\t\t\t\t(size != MIN(LIBFAT_SECTOR_SIZE, diritem.size - written))) {\n\t\t\t\t\t\tuprintf(\"Could not write '%s': %s\", target, WindowsErrorString());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\twritten += size;\n\t\t\t\t\ts = libfat_nextsector(lf_fs, s);\n\t\t\t\t\t// Trust me, you *REALLY* want to invoke libfat_flush() here\n\t\t\t\t\tlibfat_flush(lf_fs);\n\t\t\t\t}\n\t\t\t\tsafe_closehandle(handle);\n\t\t\t\tif (props.is_conf)\n\t\t\t\t\tfix_config(target, NULL, NULL, &props);\n\t\t\t}\n\t\t\tsafe_free(target);\n\t\t\tsafe_free(name);\n\t\t}\n\t// coverity[tainted_data]\n\t} while (dirpos.cluster >= 0);\n\tret = TRUE;\n\nout:\n\tif (cluster == 0) {\n\t\tif (lf_fs != NULL) {\n\t\t\tlibfat_close(lf_fs);\n\t\t\tlf_fs = NULL;\n\t\t}\n\t\tiso9660_stat_free(p_statbuf);;\n\t\tiso9660_close(p_iso);\n\t\tsafe_free(p_private);\n\t}\n\tsafe_closehandle(handle);\n\tsafe_free(name);\n\tsafe_free(target);\n\treturn ret;\n}\n\n// TODO: If we can't get save to ISO from virtdisk, we might as well drop this\nstatic DWORD WINAPI OpticalDiscSaveImageThread(void* param)\n{\n\tBOOL s;\n\tDWORD rSize, wSize;\n\tIMG_SAVE* img_save = (IMG_SAVE*)param;\n\tHANDLE hPhysicalDrive = INVALID_HANDLE_VALUE;\n\tHANDLE hDestImage = INVALID_HANDLE_VALUE;\n\tLARGE_INTEGER li;\n\tuint8_t* buffer = NULL;\n\tuint64_t wb;\n\tint i;\n\n\tassert(img_save->Type == VIRTUAL_STORAGE_TYPE_DEVICE_ISO);\n\n\tPrintInfoDebug(0, MSG_225);\n\thPhysicalDrive = CreateFileA(img_save->DevicePath, GENERIC_READ, FILE_SHARE_READ,\n\t\tNULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);\n\tif (hPhysicalDrive == INVALID_HANDLE_VALUE) {\n\t\tErrorStatus = RUFUS_ERROR(ERROR_OPEN_FAILED);\n\t\tgoto out;\n\t}\n\n\t// In case someone poked the disc before us\n\tli.QuadPart = 0;\n\tif (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN))\n\t\tuprintf(\"WARNING: Unable to rewind device position - wrong data might be copied!\");\n\thDestImage = CreateFileU(img_save->ImagePath, GENERIC_WRITE, FILE_SHARE_WRITE, NULL,\n\t\tCREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\n\tif (hDestImage == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Could not open image '%s': %s\", img_save->ImagePath, WindowsErrorString());\n\t\tErrorStatus = RUFUS_ERROR(ERROR_OPEN_FAILED);\n\t\tgoto out;\n\t}\n\n\tbuffer = (uint8_t*)_mm_malloc(img_save->BufSize, 16);\n\tif (buffer == NULL) {\n\t\tErrorStatus = RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY);\n\t\tuprintf(\"Could not allocate buffer\");\n\t\tgoto out;\n\t}\n\n\tuprintf(\"Will use a buffer size of %s\", SizeToHumanReadable(img_save->BufSize, FALSE, FALSE));\n\tuprintf(\"Saving to image '%s'...\", img_save->ImagePath);\n\n\t// Don't bother trying for something clever, using double buffering overlapped and whatnot:\n\t// With Windows' default optimizations, sync read + sync write for sequential operations\n\t// will be as fast, if not faster, than whatever async scheme you can come up with.\n\tUpdateProgressWithInfoInit(NULL, FALSE);\n\tfor (wb = 0; ; wb += wSize) {\n\t\t// Optical drives do not appear to increment the sectors to read automatically\n\t\tli.QuadPart = wb;\n\t\tif (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN))\n\t\t\tuprintf(\"WARNING: Unable to set device position - wrong data might be copied!\");\n\t\ts = ReadFile(hPhysicalDrive, buffer,\n\t\t\t(DWORD)MIN(img_save->BufSize, img_save->DeviceSize - wb), &rSize, NULL);\n\t\tif (!s) {\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_READ_FAULT);\n\t\t\tuprintf(\"Read error: %s\", WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tif (rSize == 0)\n\t\t\tbreak;\n\t\tUpdateProgressWithInfo(OP_FORMAT, MSG_261, wb, img_save->DeviceSize);\n\t\tfor (i = 1; i <= WRITE_RETRIES; i++) {\n\t\t\tCHECK_FOR_USER_CANCEL;\n\t\t\ts = WriteFile(hDestImage, buffer, rSize, &wSize, NULL);\n\t\t\tif ((s) && (wSize == rSize))\n\t\t\t\tbreak;\n\t\t\tif (s)\n\t\t\t\tuprintf(\"Write error: Wrote %d bytes, expected %d bytes\", wSize, rSize);\n\t\t\telse\n\t\t\t\tuprintf(\"Write error: %s\", WindowsErrorString());\n\t\t\tif (i < WRITE_RETRIES) {\n\t\t\t\tli.QuadPart = wb;\n\t\t\t\tuprintf(\"Retrying in %d seconds...\", WRITE_TIMEOUT / 1000);\n\t\t\t\tSleep(WRITE_TIMEOUT);\n\t\t\t\tif (!SetFilePointerEx(hDestImage, li, NULL, FILE_BEGIN)) {\n\t\t\t\t\tuprintf(\"Write error: Could not reset position - %s\", WindowsErrorString());\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tSleep(200);\n\t\t}\n\t\tif (i > WRITE_RETRIES)\n\t\t\tgoto out;\n\t}\n\tif (wb != img_save->DeviceSize) {\n\t\tuprintf(\"Error: wrote %s, expected %s\", SizeToHumanReadable(wb, FALSE, FALSE),\n\t\t\tSizeToHumanReadable(img_save->DeviceSize, FALSE, FALSE));\n\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\t\tgoto out;\n\t}\n\tuprintf(\"Operation complete (Wrote %s).\", SizeToHumanReadable(wb, FALSE, FALSE));\n\nout:\n\tsafe_free(img_save->ImagePath);\n\tsafe_mm_free(buffer);\n\tsafe_closehandle(hDestImage);\n\tsafe_unlockclose(hPhysicalDrive);\n\tPostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)TRUE, 0);\n\tExitThread(0);\n}\n\nvoid OpticalDiscSaveImage(void)\n{\n\tstatic IMG_SAVE img_save = { 0 };\n\tchar filename[33] = \"disc_image.iso\";\n\tEXT_DECL(img_ext, filename, __VA_GROUP__(\"*.iso\"), __VA_GROUP__(lmprintf(MSG_036)));\n\n\tif (op_in_progress || (format_thread != NULL))\n\t\treturn;\n\n\timg_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_ISO;\n\tif (!GetOpticalMedia(&img_save)) {\n\t\tuprintf(\"No dumpable optical media found.\");\n\t\treturn;\n\t}\n\t// Adjust the buffer size according to the disc size so that we get a decent speed.\n\tfor (img_save.BufSize = 32 * MB;\n\t\t(img_save.BufSize > 8 * MB) && (img_save.DeviceSize <= img_save.BufSize * 64);\n\t\timg_save.BufSize /= 2);\n\tif ((img_save.Label != NULL) && (img_save.Label[0] != 0))\n\t\tstatic_sprintf(filename, \"%s.iso\", img_save.Label);\n\n\timg_save.ImagePath = FileDialog(TRUE, NULL, &img_ext, 0);\n\tif (img_save.ImagePath == NULL)\n\t\treturn;\n\n\tuprintf(\"ISO media size %s\", SizeToHumanReadable(img_save.DeviceSize, FALSE, FALSE));\n\tSendMessage(hMainDialog, UM_PROGRESS_INIT, 0, 0);\n\tErrorStatus = 0;\n\t// Disable all controls except cancel\n\tEnableControls(FALSE, FALSE);\n\tInitProgress(TRUE);\n\tformat_thread = CreateThread(NULL, 0, OpticalDiscSaveImageThread, &img_save, 0, NULL);\n\tif (format_thread != NULL) {\n\t\tuprintf(\"\\r\\nSave to ISO operation started\");\n\t\tPrintInfo(0, -1);\n\t\tSendMessage(hMainDialog, UM_TIMER_START, 0, 0);\n\t} else {\n\t\tuprintf(\"Unable to start ISO save thread\");\n\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_START_THREAD));\n\t\tsafe_free(img_save.ImagePath);\n\t\tPostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)FALSE, 0);\n\t}\n}\n\n// Create an ISO image from the currently selected drive, using oscdimg.exe\nDWORD WINAPI IsoSaveImageThread(void* param)\n{\n\tDWORD r = ERROR_NOT_FOUND;\n\tHANDLE exe = INVALID_HANDLE_VALUE;\n\tIMG_SAVE* img_save = (IMG_SAVE*)param;\n\tchar cmd[2 * KB], letters[27], *label;\n\n\tif (!GetDriveLabel(SelectedDrive.DeviceNumber, letters, &label, TRUE) || letters[0] == '\\0')\n\t\tgoto out;\n\n\t// Get a lock and validate that the oscdimg.exe has not been tampered with\n\tstatic_sprintf(cmd, \"%s\\\\%s\\\\oscdimg_%s.exe\", app_data_dir, FILES_DIR, APPLICATION_ARCH);\n\texe = CreateFileU(cmd, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n\tif (exe == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"ERROR: Could not lock 'oscdimg.exe'\");\n\t\tr = GetLastError();\n\t\tgoto out;\n\t}\n\tif (!FileMatchesHash(cmd, OSCDIMG_HASH)) {\n\t\tuprintf(\"ERROR: Existing 'oscdimg.exe' hash does not match expected value!\");\n\t\tr = ERROR_INVALID_IMAGE_HASH;\n\t\tgoto out;\n\t}\n\n\t// UDF labels cannot be more than 32 characters (and if we have more than 32 chars we are\n\t// using the static modifiable char buffer from GetDriveLabel(), so we can alter it).\n\tif (strlen(label) > 32)\n\t\tlabel[32] = '\\0';\n\n\t// Save to UDF only, as Microsoft's implementation of ISO-9660 doesn't support multiextent\n\t// and produces BROKEN images if you try to add files larger than 4 GB.\n\t// Plus ISO-9660/Joliet limits labels to 16 characters and has issues with long paths.\n\tstatic_sprintf(cmd, \"\\\"%s\\\\%s\\\\oscdimg_%s.exe\\\" -g -h -k -l\\\"%s\\\" -m -u2 -udfver102 %c:\\\\ \\\"%s\\\"\",\n\t\tapp_data_dir, FILES_DIR, APPLICATION_ARCH, label, letters[0], img_save->ImagePath);\n\tuprintf(\"Running command: '%s'\", cmd);\n\t// For detecting typical oscdimg commandline progress report of type: \"\\r15.5% complete\"\n\tr = RunCommandWithProgress(cmd, sysnative_dir, FALSE, MSG_261, \".*\\r([0-9\\\\.]+)% complete.*\");\n\nout:\n\tsafe_closehandle(exe);\n\tif (r != 0 && !IS_ERROR(ErrorStatus)) {\n\t\tSetLastError(r);\n\t\tuprintf(\"Failed to write ISO image: %s\", WindowsErrorString());\n\t\tErrorStatus = RUFUS_ERROR(SCODE_CODE(r));\n\t}\n\tPostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)TRUE, 0);\n\tif (!IS_ERROR(ErrorStatus))\n\t\tuprintf(\"Saved '%s'\", img_save->ImagePath);\n\tsafe_free(img_save->DevicePath);\n\tsafe_free(img_save->ImagePath);\n\tExitThread(r);\n}\n"
  },
  {
    "path": "src/libcdio/.editorconfig",
    "content": "[*]\ntab_width = 8\n"
  },
  {
    "path": "src/libcdio/cdio/audio.h",
    "content": "/* -*- c -*-\n    Copyright (C) 2005, 2007, 2008, 2019 Rocky Bernstein <rocky@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/** \\file audio.h\n *\n *  \\brief The top-level header for CD audio-related libcdio\n *         calls.  These control playing of the CD-ROM through its\n *         line-out jack.\n */\n#ifndef CDIO_AUDIO_H_\n#define CDIO_AUDIO_H_\n\n#include <cdio/types.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n  /*! This struct is used by the cdio_audio_read_subchannel */\n  typedef struct cdio_subchannel_s\n  {\n    uint8_t format;\n    uint8_t audio_status;\n    uint8_t address:\t4;\n    uint8_t control:\t4;\n    uint8_t track;\n    uint8_t index;\n    msf_t   abs_addr;\n    msf_t   rel_addr;\n  } cdio_subchannel_t;\n\n  /*! This struct is used by cdio_audio_get_volume and cdio_audio_set_volume */\n  typedef struct cdio_audio_volume_s\n  {\n    uint8_t level[4];\n  } cdio_audio_volume_t;\n\n\n  /*! This struct is used by the CDROMPLAYTRKIND ioctl */\n  typedef struct cdio_track_index_s\n  {\n    uint8_t\ti_start_track;\t/**< start track */\n    uint8_t\ti_start_index;\t/**< start index */\n    uint8_t\ti_end_track;\t/**< end track */\n    uint8_t\ti_end_index;\t/**< end index */\n  } cdio_track_index_t;\n\n  /*!\n    Get volume of an audio CD.\n\n    @param p_cdio the CD object to be acted upon.\n    @param p_volume place to put the list of volume outputs levels\n\n    \\p p_volume can be \\p NULL in which case we return only whether\n    the driver has the ability to get the volume or not.\n\n  */\n  driver_return_code_t cdio_audio_get_volume (CdIo_t *p_cdio,  /*out*/\n\t\t\t\t\t      cdio_audio_volume_t *p_volume);\n\n  /*!\n    Return the number of seconds (discarding frame portion) of an MSF\n  */\n  uint32_t cdio_audio_get_msf_seconds(msf_t *p_msf);\n\n  /*!\n    Pause playing CD through analog output\n\n    @param p_cdio the CD object to be acted upon.\n  */\n  driver_return_code_t cdio_audio_pause (CdIo_t *p_cdio);\n\n  /*!\n    Playing CD through analog output at the given MSF.\n\n    @param p_cdio the CD object to be acted upon.\n    @param p_start_msf pointer to staring MSF\n    @param p_end_msf pointer to ending MSF\n  */\n  driver_return_code_t cdio_audio_play_msf (CdIo_t *p_cdio,\n\t\t\t\t\t    /*in*/msf_t *p_start_msf,\n\t\t\t\t\t    /*in*/ msf_t *p_end_msf);\n\n  /*!\n    Playing CD through analog output at the desired track and index\n\n    @param p_cdio the CD object to be acted upon.\n    @param p_track_index location to start/end.\n  */\n  driver_return_code_t cdio_audio_play_track_index\n  ( CdIo_t *p_cdio,  cdio_track_index_t *p_track_index);\n\n  /*!\n    Get subchannel information.\n\n    @param p_cdio the CD object to be acted upon.\n    @param p_subchannel place for returned subchannel information\n  */\n  driver_return_code_t cdio_audio_read_subchannel (CdIo_t *p_cdio,\n\t\t\t\t\t\t   /*out*/ cdio_subchannel_t *p_subchannel);\n\n  /*!\n    Resume playing an audio CD.\n\n    @param p_cdio the CD object to be acted upon.\n\n  */\n  driver_return_code_t cdio_audio_resume (CdIo_t *p_cdio);\n\n  /*!\n    Set volume of an audio CD.\n\n    @param p_cdio the CD object to be acted upon.\n    @param p_volume place for returned volume-level information\n\n  */\n  driver_return_code_t cdio_audio_set_volume (CdIo_t *p_cdio, /*out*/\n\t\t\t\t\t      cdio_audio_volume_t *p_volume);\n\n  /*!\n    Stop playing an audio CD.\n\n    @param p_cdio the CD object to be acted upon.\n\n  */\n  driver_return_code_t cdio_audio_stop (CdIo_t *p_cdio);\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_AUDIO_H_ */\n"
  },
  {
    "path": "src/libcdio/cdio/bytesex.h",
    "content": "/*\n    Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>\n    Copyright (C) 2005, 2008, 2012, 2015 Rocky Bernstein <rocky@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n/** \\file bytesex.h\n *  \\brief  Generic Byte-swapping routines.\n *\n *   Note: this header will is slated to get removed and libcdio will\n *   use glib.h routines instead.\n*/\n\n#ifndef CDIO_BYTESEX_H_\n#define CDIO_BYTESEX_H_\n\n#include <cdio/types.h>\n#include <cdio/bytesex_asm.h> /* also defines CDIO_INLINE */\n#include <cdio/logging.h>\n\n/** 16-bit big-endian to little-endian */\n#define UINT16_SWAP_LE_BE_C(val) ((uint16_t) ( \\\n    (((uint16_t) (val) & (uint16_t) 0x00ffU) << 8) | \\\n    (((uint16_t) (val) & (uint16_t) 0xff00U) >> 8)))\n\n/** 32-bit big-endian to little-endian */\n#define UINT32_SWAP_LE_BE_C(val) ((uint32_t) ( \\\n    (((uint32_t) (val) & (uint32_t) 0x000000ffU) << 24) | \\\n    (((uint32_t) (val) & (uint32_t) 0x0000ff00U) <<  8) | \\\n    (((uint32_t) (val) & (uint32_t) 0x00ff0000U) >>  8) | \\\n    (((uint32_t) (val) & (uint32_t) 0xff000000U) >> 24)))\n\n/** 64-bit big-endian to little-endian */\n#define UINT64_SWAP_LE_BE_C(val) ((uint64_t) ( \\\n    (((uint64_t) (val) & (uint64_t) UINT64_C(0x00000000000000ff)) << 56) | \\\n    (((uint64_t) (val) & (uint64_t) UINT64_C(0x000000000000ff00)) << 40) | \\\n    (((uint64_t) (val) & (uint64_t) UINT64_C(0x0000000000ff0000)) << 24) | \\\n    (((uint64_t) (val) & (uint64_t) UINT64_C(0x00000000ff000000)) <<  8) | \\\n    (((uint64_t) (val) & (uint64_t) UINT64_C(0x000000ff00000000)) >>  8) | \\\n    (((uint64_t) (val) & (uint64_t) UINT64_C(0x0000ff0000000000)) >> 24) | \\\n    (((uint64_t) (val) & (uint64_t) UINT64_C(0x00ff000000000000)) >> 40) | \\\n    (((uint64_t) (val) & (uint64_t) UINT64_C(0xff00000000000000)) >> 56)))\n\n#ifndef UINT16_SWAP_LE_BE\n# define UINT16_SWAP_LE_BE UINT16_SWAP_LE_BE_C\n#endif\n\n#ifndef UINT32_SWAP_LE_BE\n# define UINT32_SWAP_LE_BE UINT32_SWAP_LE_BE_C\n#endif\n\n#ifndef UINT64_SWAP_LE_BE\n# define UINT64_SWAP_LE_BE UINT64_SWAP_LE_BE_C\n#endif\n\nstatic CDIO_INLINE\nuint16_t uint16_swap_le_be (const uint16_t val)\n{\n  return UINT16_SWAP_LE_BE (val);\n}\n\nstatic CDIO_INLINE\nuint32_t uint32_swap_le_be (const uint32_t val)\n{\n  return UINT32_SWAP_LE_BE (val);\n}\n\nstatic CDIO_INLINE\nuint64_t uint64_swap_le_be (const uint64_t val)\n{\n  return UINT64_SWAP_LE_BE (val);\n}\n\n# define UINT8_TO_BE(val)      ((uint8_t) (val))\n# define UINT8_TO_LE(val)      ((uint8_t) (val))\n#ifdef WORDS_BIGENDIAN\n# define UINT16_TO_BE(val)     ((uint16_t) (val))\n# define UINT16_TO_LE(val)     ((uint16_t) UINT16_SWAP_LE_BE(val))\n\n# define UINT32_TO_BE(val)     ((uint32_t) (val))\n# define UINT32_TO_LE(val)     ((uint32_t) UINT32_SWAP_LE_BE(val))\n\n# define UINT64_TO_BE(val)     ((uint64_t) (val))\n# define UINT64_TO_LE(val)     ((uint64_t) UINT64_SWAP_LE_BE(val))\n#else\n# define UINT16_TO_BE(val)     ((uint16_t) UINT16_SWAP_LE_BE(val))\n# define UINT16_TO_LE(val)     ((uint16_t) (val))\n\n# define UINT32_TO_BE(val)     ((uint32_t) UINT32_SWAP_LE_BE(val))\n# define UINT32_TO_LE(val)     ((uint32_t) (val))\n\n# define UINT64_TO_BE(val)     ((uint64_t) UINT64_SWAP_LE_BE(val))\n# define UINT64_TO_LE(val)     ((uint64_t) (val))\n#endif\n\n/** symmetric conversions */\n#define UINT8_FROM_BE(val)     (UINT8_TO_BE (val))\n#define UINT8_FROM_LE(val)     (UINT8_TO_LE (val))\n#define UINT16_FROM_BE(val)    (UINT16_TO_BE (val))\n#define UINT16_FROM_LE(val)    (UINT16_TO_LE (val))\n#define UINT32_FROM_BE(val)    (UINT32_TO_BE (val))\n#define UINT32_FROM_LE(val)    (UINT32_TO_LE (val))\n#define UINT64_FROM_BE(val)    (UINT64_TO_BE (val))\n#define UINT64_FROM_LE(val)    (UINT64_TO_LE (val))\n\n/** converter function template */\n#define CVT_TO_FUNC(bits) \\\n static CDIO_INLINE uint ## bits ## _t \\\n uint ## bits ## _to_be (uint ## bits ## _t val) \\\n { return UINT ## bits ## _TO_BE (val); } \\\n static CDIO_INLINE uint ## bits ## _t \\\n uint ## bits ## _to_le (uint ## bits ## _t val) \\\n { return UINT ## bits ## _TO_LE (val); } \\\n\nCVT_TO_FUNC(8)\nCVT_TO_FUNC(16)\nCVT_TO_FUNC(32)\nCVT_TO_FUNC(64)\n\n#undef CVT_TO_FUNC\n\n#define uint8_from_be(val)     (uint8_to_be (val))\n#define uint8_from_le(val)     (uint8_to_le (val))\n#define uint16_from_be(val)    (uint16_to_be (val))\n#define uint16_from_le(val)    (uint16_to_le (val))\n#define uint32_from_be(val)    (uint32_to_be (val))\n#define uint32_from_le(val)    (uint32_to_le (val))\n#define uint64_from_be(val)    (uint64_to_be (val))\n#define uint64_from_le(val)    (uint64_to_le (val))\n\n/** ISO9660-related field conversion routines */\n\n/** Convert from uint8_t to ISO 9660 7.1.1 format */\n#define to_711(i)   uint8_to_le(i)\n\n/** Convert from ISO 9660 7.1.1 format to uint8_t */\n#define from_711(i) uint8_from_le(i)\n\n/** Convert from uint16_t to ISO 9669 7.2.1 format */\n#define to_721(i)   uint16_to_le(i)\n\n/** Convert from ISO 9660 7.2.1 format to uint16_t */\n#define from_721(i) uint16_from_le(i)\n\n/** Convert from uint16_t to ISO 9669 7.2.2 format */\n#define to_722(i)   uint16_to_be(i)\n\n/** Convert from ISO 9660 7.2.2 format to uint16_t */\n#define from_722(i) uint16_from_be(i)\n\n/** Convert from uint16_t to ISO 9669 7.2.3 format */\nstatic CDIO_INLINE uint32_t\nto_723(uint16_t i)\n{\n  return uint32_swap_le_be(i) | i;\n}\n\n/** Convert from ISO 9660 7.2.3 format to uint16_t */\nstatic CDIO_INLINE uint16_t\nfrom_723 (uint32_t p)\n{\n  uint8_t *u = (uint8_t *) &p;\n  /* Return the little-endian part always, to handle non-specs-compliant images */\n  return (u[0] | (u[1] << 8));\n}\n\nstatic CDIO_INLINE uint16_t\nfrom_723_with_err (uint32_t p, bool *err)\n{\n  if (uint32_swap_le_be (p) != p) {\n    cdio_warn (\"from_723: broken byte order\");\n    *err = true;\n  } else {\n    *err = false;\n  }\n  return (0xFFFF & p);\n}\n\n/** Convert from uint16_t to ISO 9669 7.3.1 format */\n#define to_731(i)   uint32_to_le(i)\n\n/** Convert from ISO 9660 7.3.1 format to uint32_t */\n#define from_731(i) uint32_from_le(i)\n\n/** Convert from uint32_t to ISO 9669 7.3.2 format */\n#define to_732(i)   uint32_to_be(i)\n\n/** Convert from ISO 9660 7.3.2 format to uint32_t */\n#define from_732(i) uint32_from_be(i)\n\n/** Convert from uint16_t to ISO 9669 7.3.3 format */\nstatic CDIO_INLINE uint64_t\nto_733(uint32_t i)\n{\n  return uint64_swap_le_be(i) | i;\n}\n\n/** Convert from ISO 9660 7.3.3 format to uint32_t */\nstatic CDIO_INLINE uint32_t\nfrom_733 (uint64_t p)\n{\n  uint8_t *u = (uint8_t *) &p;\n  /* Return the little-endian part always, to handle non-specs-compliant images */\n  return (u[0] | (u[1] << 8) | (u[2] << 16) | (u[3] << 24));\n}\n\nstatic CDIO_INLINE uint32_t\nfrom_733_with_err (uint64_t p, bool *err)\n{\n  if (uint64_swap_le_be (p) != p) {\n    cdio_warn (\"from_733: broken byte order\");\n    *err = true;\n  } else {\n    *err = false;\n  }\n  return (UINT32_C(0xFFFFFFFF) & p);\n}\n\n#endif /* CDIO_BYTESEX_H_ */\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/cdio/bytesex_asm.h",
    "content": "/*\n    Copyright (C) 2008, 2012 Rocky Bernstein <rocky@gnu.org>\n                  2001, 2004, 2005 Herbert Valerio Riedel <hvr@gnu.org>\n                  2001 Sven Ottemann <ac-logic@freenet.de>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n/** \\file bytesex_asm.h \n *  \\brief  Assembly code to handle byte-swapping.\n\n    Note: this header will is slated to get removed and libcdio will use \n    glib.h routines instead. \n*/\n\n#ifndef CDIO_BYTESEX_ASM_H_\n#define CDIO_BYTESEX_ASM_H_\n#if !defined(DISABLE_ASM_OPTIMIZE)\n\n#include <cdio/types.h>\n\n#if !defined CDIO_INLINE\n#if defined(__cplusplus) || defined(inline)\n#define CDIO_INLINE inline\n#elif defined(__GNUC__)\n#define CDIO_INLINE __inline__\n#elif defined(_MSC_VER)\n#define CDIO_INLINE __inline\n#else\n#define CDIO_INLINE\n#endif\n#endif /* CDIO_INLINE */\n\n#if defined(__powerpc__) && defined(__GNUC__)\n\nstatic CDIO_INLINE\nuint32_t uint32_swap_le_be_asm(const uint32_t a)\n{\n  uint32_t b;\n\n  __asm__ (\"lwbrx %0,0,%1\"\n           :\"=r\"(b)\n           :\"r\"(&a), \"m\"(a));\n\n  return b;\n}\n\nstatic CDIO_INLINE\nuint16_t uint16_swap_le_be_asm(const uint16_t a)\n{\n  uint32_t b;\n\n  __asm__ (\"lhbrx %0,0,%1\"\n           :\"=r\"(b)\n           :\"r\"(&a), \"m\"(a));\n\n  return b;\n}\n\n#define UINT16_SWAP_LE_BE uint16_swap_le_be_asm\n#define UINT32_SWAP_LE_BE uint32_swap_le_be_asm\n\n#elif defined(__mc68000__) &&  defined(__STORMGCC__)\n\nstatic CDIO_INLINE\nuint32_t uint32_swap_le_be_asm(uint32_t a __asm__(\"d0\"))\n{\n  /* __asm__(\"rolw #8,%0; swap %0; rolw #8,%0\" : \"=d\" (val) : \"0\" (val)); */\n\n  __asm__(\"move.l %1,d0;rol.w #8,d0;swap d0;rol.w #8,d0;move.l d0,%0\"\n          :\"=r\"(a)\n          :\"r\"(a));\n\n  return(a);\n}\n\nstatic CDIO_INLINE\nuint16_t uint16_swap_le_be_asm(uint16_t a __asm__(\"d0\"))\n{\n  __asm__(\"move.l %1,d0;rol.w #8,d0;move.l d0,%0\"\n          :\"=r\"(a)\n          :\"r\"(a));\n  \n  return(a);\n}\n\n#define UINT16_SWAP_LE_BE uint16_swap_le_be_asm\n#define UINT32_SWAP_LE_BE uint32_swap_le_be_asm\n\n#elif 0 && defined(__i386__) && defined(__GNUC__)\n\nstatic CDIO_INLINE\nuint32_t uint32_swap_le_be_asm(uint32_t a)\n{\n  __asm__(\"xchgb %b0,%h0\\n\\t\"     /* swap lower bytes     */\n          \"rorl $16,%0\\n\\t\"       /* swap words           */\n          \"xchgb %b0,%h0\"         /* swap higher bytes    */\n          :\"=q\" (a)\n          : \"0\" (a));\n\n  return(a);\n}\n\nstatic CDIO_INLINE\nuint16_t uint16_swap_le_be_asm(uint16_t a)\n{\n  __asm__(\"xchgb %b0,%h0\"         /* swap bytes           */ \n          : \"=q\" (a) \n          :  \"0\" (a));\n  \n  return(a);\n}\n\n#define UINT16_SWAP_LE_BE uint16_swap_le_be_asm\n#define UINT32_SWAP_LE_BE uint32_swap_le_be_asm\n\n#endif\n\n#endif /* !defined(DISABLE_ASM_OPTIMIZE) */\n#endif /* CDIO_BYTESEX_ASM_H_ */\n\n\f\n/* \n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/cdio/cdio.h",
    "content": "/* -*- c -*-\n    Copyright (C) 2003, 2004, 2005, 2008, 2009, 2014\n    Rocky Bernstein <rocky@gnu.org>\n    Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/** \\file cdio.h\n *\n *  \\brief The top-level header for libcdio: the CD Input and Control\n *  library. Applications include this for anything regarding libcdio.\n */\n\n\f\n#ifndef __CDIO_H__\n#define __CDIO_H__\n\n/** Application Interface or Protocol version number. If the public\n *  interface changes, we increase this number.\n */\n#define CDIO_API_VERSION 6\n\n#include <cdio/version.h>\n#include <cdio/types.h>\n#include <cdio/sector.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n/* For compatibility. */\n#define CdIo CdIo_t\n\n  /** This is an opaque structure for the CD object. */\n  typedef struct _CdIo CdIo_t;\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n/* Drive(r)/Device-related functions. Perhaps we should break out\n   Driver from device?\n*/\n#include <cdio/device.h>\n\n/* CD-Text-related functions. */\n#include <cdio/cdtext.h>\n\n/* Disc-related functions. */\n#include <cdio/disc.h>\n\n/* Sector (frame, or block)-related functions. Uses driver_return_code_t\n   from <cdio/device.h> so it should come after that.\n*/\n#include <cdio/read.h>\n\n/* Track-related functions. */\n#include <cdio/track.h>\n\n/* Memory management functions. */\n#include <cdio/memory.h>\n\n#endif /* __CDIO_H__ */\n"
  },
  {
    "path": "src/libcdio/cdio/cdtext.h",
    "content": "/*\n    Copyright (C) 2018 Thomas Schmitt\n    Copyright (C) 2004, 2005, 2008, 2012, 2019 Rocky Bernstein <rocky@gnu.org>\n    adapted from cuetools\n    Copyright (C) 2003 Svend Sanjay Sorensen <ssorensen@fastmail.fm>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/*!\n * \\file cdtext.h\n *\n * \\brief The top-level header for CD-Text information. Applications\n *  include this for CD-Text access.\n*/\n\n\f\n#ifndef CDIO_CDTEXT_H_\n#define CDIO_CDTEXT_H_\n\n#include <cdio/types.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n#define MIN_CDTEXT_FIELD          0\n#define MAX_CDTEXT_FIELDS         10\n\n/*! \\typedef enum cdtext_field_t\n\n  \\brief Enumeration of CD-TEXT text fields.\n*/\ntypedef enum {\n  CDTEXT_FIELD_TITLE          =  0,   /**< title of album name or track titles */\n  CDTEXT_FIELD_PERFORMER      =  1,   /**< name(s) of the performer(s) */\n  CDTEXT_FIELD_SONGWRITER     =  2,   /**< name(s) of the songwriter(s) */\n  CDTEXT_FIELD_COMPOSER       =  3,   /**< name(s) of the composer(s) */\n  CDTEXT_FIELD_MESSAGE        =  4,   /**< message(s) from content provider or artist, ISO-8859-1 encoded*/\n  CDTEXT_FIELD_ARRANGER       =  5,   /**< name(s) of the arranger(s) */\n  CDTEXT_FIELD_ISRC           =  6,   /**< ISRC code of each track */\n  CDTEXT_FIELD_UPC_EAN        =  7,   /**< upc/european article number of disc, ISO-8859-1 encoded */\n  CDTEXT_FIELD_GENRE          =  8,   /**< genre identification and genre information, ASCII encoded */\n  CDTEXT_FIELD_DISCID         =  9,   /**< disc identification, ASCII encoded (may be non-printable) */\n  CDTEXT_FIELD_INVALID        =  MAX_CDTEXT_FIELDS /**< INVALID FIELD*/\n} cdtext_field_t;\n\n/*! \\typedef enum cdtext_genre_t\n\n  \\brief Enumeration of possible genre codes.\n*/\ntypedef enum {\n  CDTEXT_GENRE_UNUSED         =  0,   /**< field is not used. default */\n  CDTEXT_GENRE_UNDEFINED      =  1,   /**< not defined */\n  CDTEXT_GENRE_ADULT_CONTEMP  =  2,   /**< Adult Contemporary */\n  CDTEXT_GENRE_ALT_ROCK       =  3,   /**< Alternative Rock */\n  CDTEXT_GENRE_CHILDRENS      =  4,   /**< Childrens Music */\n  CDTEXT_GENRE_CLASSIC        =  5,   /**< Classical */\n  CDTEXT_GENRE_CHRIST_CONTEMP =  6,   /**< Contemporary Christian */\n  CDTEXT_GENRE_COUNTRY        =  7,   /**< Country */\n  CDTEXT_GENRE_DANCE          =  8,   /**< Dance */\n  CDTEXT_GENRE_EASY_LISTENING =  9,   /**< Easy Listening */\n  CDTEXT_GENRE_EROTIC         = 10,   /**< Erotic */\n  CDTEXT_GENRE_FOLK           = 11,   /**< Folk */\n  CDTEXT_GENRE_GOSPEL         = 12,   /**< Gospel */\n  CDTEXT_GENRE_HIPHOP         = 13,   /**< Hip Hop */\n  CDTEXT_GENRE_JAZZ           = 14,   /**< Jazz */\n  CDTEXT_GENRE_LATIN          = 15,   /**< Latin */\n  CDTEXT_GENRE_MUSICAL        = 16,   /**< Musical */\n  CDTEXT_GENRE_NEWAGE         = 17,   /**< New Age */\n  CDTEXT_GENRE_OPERA          = 18,   /**< Opera */\n  CDTEXT_GENRE_OPERETTA       = 19,   /**< Operetta */\n  CDTEXT_GENRE_POP            = 20,   /**< Pop Music */\n  CDTEXT_GENRE_RAP            = 21,   /**< RAP */\n  CDTEXT_GENRE_REGGAE         = 22,   /**< Reggae */\n  CDTEXT_GENRE_ROCK           = 23,   /**< Rock Music */\n  CDTEXT_GENRE_RYTHMANDBLUES  = 24,   /**< Rhythm & Blues */\n  CDTEXT_GENRE_SOUNDEFFECTS   = 25,   /**< Sound Effects */\n  CDTEXT_GENRE_SOUNDTRACK     = 26,   /**< Soundtrack */\n  CDTEXT_GENRE_SPOKEN_WORD    = 27,   /**< Spoken Word */\n  CDTEXT_GENRE_WORLD_MUSIC    = 28    /**< World Music */\n} cdtext_genre_t;\n\n/*! \\typedef typedef enum cdtext_lang_t\n\n    \\brief Enumeration of possible CD-TEXT languages.\n\n  The language code is encoded as specified in ANNEX 1 to part 5 of EBU\n  Tech 32 58 -E (1991).\n */\ntypedef enum {\n  CDTEXT_LANGUAGE_UNKNOWN     = 0x00,\n  CDTEXT_LANGUAGE_ALBANIAN    = 0x01,\n  CDTEXT_LANGUAGE_BRETON      = 0x02,\n  CDTEXT_LANGUAGE_CATALAN     = 0x03,\n  CDTEXT_LANGUAGE_CROATIAN    = 0x04,\n  CDTEXT_LANGUAGE_WELSH       = 0x05,\n  CDTEXT_LANGUAGE_CZECH       = 0x06,\n  CDTEXT_LANGUAGE_DANISH      = 0x07,\n  CDTEXT_LANGUAGE_GERMAN      = 0x08,\n  CDTEXT_LANGUAGE_ENGLISH     = 0x09,\n  CDTEXT_LANGUAGE_SPANISH     = 0x0A,\n  CDTEXT_LANGUAGE_ESPERANTO   = 0x0B,\n  CDTEXT_LANGUAGE_ESTONIAN    = 0x0C,\n  CDTEXT_LANGUAGE_BASQUE      = 0x0D,\n  CDTEXT_LANGUAGE_FAROESE     = 0x0E,\n  CDTEXT_LANGUAGE_FRENCH      = 0x0F,\n  CDTEXT_LANGUAGE_FRISIAN     = 0x10,\n  CDTEXT_LANGUAGE_IRISH       = 0x11,\n  CDTEXT_LANGUAGE_GAELIC      = 0x12,\n  CDTEXT_LANGUAGE_GALICIAN    = 0x13,\n  CDTEXT_LANGUAGE_ICELANDIC   = 0x14,\n  CDTEXT_LANGUAGE_ITALIAN     = 0x15,\n  CDTEXT_LANGUAGE_LAPPISH     = 0x16,\n  CDTEXT_LANGUAGE_LATIN       = 0x17,\n  CDTEXT_LANGUAGE_LATVIAN     = 0x18,\n  CDTEXT_LANGUAGE_LUXEMBOURGIAN = 0x19,\n  CDTEXT_LANGUAGE_LITHUANIAN  = 0x1A,\n  CDTEXT_LANGUAGE_HUNGARIAN   = 0x1B,\n  CDTEXT_LANGUAGE_MALTESE     = 0x1C,\n  CDTEXT_LANGUAGE_DUTCH       = 0x1D,\n  CDTEXT_LANGUAGE_NORWEGIAN   = 0x1E,\n  CDTEXT_LANGUAGE_OCCITAN     = 0x1F,\n  CDTEXT_LANGUAGE_POLISH      = 0x20,\n  CDTEXT_LANGUAGE_PORTUGUESE  = 0x21,\n  CDTEXT_LANGUAGE_ROMANIAN    = 0x22,\n  CDTEXT_LANGUAGE_ROMANSH     = 0x23,\n  CDTEXT_LANGUAGE_SERBIAN     = 0x24,\n  CDTEXT_LANGUAGE_SLOVAK      = 0x25,\n  CDTEXT_LANGUAGE_SLOVENIAN   = 0x26,\n  CDTEXT_LANGUAGE_FINNISH     = 0x27,\n  CDTEXT_LANGUAGE_SWEDISH     = 0x28,\n  CDTEXT_LANGUAGE_TURKISH     = 0x29,\n  CDTEXT_LANGUAGE_FLEMISH     = 0x2A,\n  CDTEXT_LANGUAGE_WALLON      = 0x2B,\n  CDTEXT_LANGUAGE_ZULU        = 0x45,\n  CDTEXT_LANGUAGE_VIETNAMESE  = 0x46,\n  CDTEXT_LANGUAGE_UZBEK       = 0x47,\n  CDTEXT_LANGUAGE_URDU        = 0x48,\n  CDTEXT_LANGUAGE_UKRAINIAN   = 0x49,\n  CDTEXT_LANGUAGE_THAI        = 0x4A,\n  CDTEXT_LANGUAGE_TELUGU      = 0x4B,\n  CDTEXT_LANGUAGE_TATAR       = 0x4C,\n  CDTEXT_LANGUAGE_TAMIL       = 0x4D,\n  CDTEXT_LANGUAGE_TADZHIK     = 0x4E,\n  CDTEXT_LANGUAGE_SWAHILI     = 0x4F,\n  CDTEXT_LANGUAGE_SRANANTONGO = 0x50,\n  CDTEXT_LANGUAGE_SOMALI      = 0x51,\n  CDTEXT_LANGUAGE_SINHALESE   = 0x52,\n  CDTEXT_LANGUAGE_SHONA       = 0x53,\n  CDTEXT_LANGUAGE_SERBO_CROAT = 0x54,\n  CDTEXT_LANGUAGE_RUTHENIAN   = 0x55,\n  CDTEXT_LANGUAGE_RUSSIAN     = 0x56,\n  CDTEXT_LANGUAGE_QUECHUA     = 0x57,\n  CDTEXT_LANGUAGE_PUSHTU      = 0x58,\n  CDTEXT_LANGUAGE_PUNJABI     = 0x59,\n  CDTEXT_LANGUAGE_PERSIAN     = 0x5A,\n  CDTEXT_LANGUAGE_PAPAMIENTO  = 0x5B,\n  CDTEXT_LANGUAGE_ORIYA       = 0x5C,\n  CDTEXT_LANGUAGE_NEPALI      = 0x5D,\n  CDTEXT_LANGUAGE_NDEBELE     = 0x5E,\n  CDTEXT_LANGUAGE_MARATHI     = 0x5F,\n  CDTEXT_LANGUAGE_MOLDAVIAN   = 0x60,\n  CDTEXT_LANGUAGE_MALAYSIAN   = 0x61,\n  CDTEXT_LANGUAGE_MALAGASAY   = 0x62,\n  CDTEXT_LANGUAGE_MACEDONIAN  = 0x63,\n  CDTEXT_LANGUAGE_LAOTIAN     = 0x64,\n  CDTEXT_LANGUAGE_KOREAN      = 0x65,\n  CDTEXT_LANGUAGE_KHMER       = 0x66,\n  CDTEXT_LANGUAGE_KAZAKH      = 0x67,\n  CDTEXT_LANGUAGE_KANNADA     = 0x68,\n  CDTEXT_LANGUAGE_JAPANESE    = 0x69,\n  CDTEXT_LANGUAGE_INDONESIAN  = 0x6A,\n  CDTEXT_LANGUAGE_HINDI       = 0x6B,\n  CDTEXT_LANGUAGE_HEBREW      = 0x6C,\n  CDTEXT_LANGUAGE_HAUSA       = 0x6D,\n  CDTEXT_LANGUAGE_GURANI      = 0x6E,\n  CDTEXT_LANGUAGE_GUJURATI    = 0x6F,\n  CDTEXT_LANGUAGE_GREEK       = 0x70,\n  CDTEXT_LANGUAGE_GEORGIAN    = 0x71,\n  CDTEXT_LANGUAGE_FULANI      = 0x72,\n  CDTEXT_LANGUAGE_DARI        = 0x73,\n  CDTEXT_LANGUAGE_CHURASH     = 0x74,\n  CDTEXT_LANGUAGE_CHINESE     = 0x75,\n  CDTEXT_LANGUAGE_BURMESE     = 0x76,\n  CDTEXT_LANGUAGE_BULGARIAN   = 0x77,\n  CDTEXT_LANGUAGE_BENGALI     = 0x78,\n  CDTEXT_LANGUAGE_BIELORUSSIAN = 0x79,\n  CDTEXT_LANGUAGE_BAMBORA     = 0x7A,\n  CDTEXT_LANGUAGE_AZERBAIJANI = 0x7B,\n  CDTEXT_LANGUAGE_ASSAMESE    = 0x7C,\n  CDTEXT_LANGUAGE_ARMENIAN    = 0x7D,\n  CDTEXT_LANGUAGE_ARABIC      = 0x7E,\n  CDTEXT_LANGUAGE_AMHARIC     = 0x7F,\n\n  /* libcdio-internal pseudo codes: */\n\n  CDTEXT_LANGUAGE_INVALID      = 0x100, /**< Invalid language code */\n  CDTEXT_LANGUAGE_BLOCK_UNUSED = 0x101  /**< Language code should be ignored */\n\n} cdtext_lang_t;\n\n/*!\n  \\typedef struct cdtext_s cdtext_t\n\n  \\brief Opaque type for CD-Text.\n*/\ntypedef struct cdtext_s cdtext_t;\n\n/*!\n  Return string representation of the given genre code.\n*/\nconst char *cdtext_genre2str (cdtext_genre_t i);\n\n/*!\n  Return string representation of the given language code.\n*/\nconst char *cdtext_lang2str (cdtext_lang_t i);\n\n/*!\n  Return the language code of a given language string representation.\n  This is the inverse of cdtext_lang2str().\n\n  @param lang language to look up\n\n  @return if lang is among the possible results of cdtext_lang2str():\n          the \\p cdtext_lang_t which is associated, or \\p\n          CDTEXT_LANGUAGE_INVALID otherwise.\n*/\ncdtext_lang_t cdtext_str2lang (const char *lang);\n\n/*!\n  Return string representation of given field type.\n*/\nconst char *cdtext_field2str (cdtext_field_t i);\n\n/*!\n  Initialize a new \\p cdtext_t structure.\n\n  When the structure is no longer needed, release the\n  resources using cdtext_delete.\n*/\ncdtext_t *cdtext_init (void);\n\n/*!\n  Fill a cdtext_t object with text pack bytes as they were handed out by the\n  CD drive, but without the 4-byte header which the drive prepended.\n\n  The text pack data can be obtained by the calls\n\n    - cdio_get_cdtext_raw()\n    - mmc_read_cdtext()\n    - mmc_read_toc_cdtext()\n\n  Each sets in the buffer passed into values that begin with a 4-byte header. This should\n  be skipped. Here is some sample code:\n\n  @code\n    #include <cdio/mmc_ll_cmds.h>\n    if (DRIVER_OP_SUCCESS == mmc_read_toc_cdtext (p_cdio, &i_length, p_buf, 0)\n        && 4 < i_length)\n        cdtext_data_init(p_cdtext, p_buf + 4, (size_t) i_length - 4);\n  @endcode\n\n  Instead of calling cdtext_data_init(), you can call\n  cdio_get_cdtext() which returns a pointer to the \\p cdtext_t object\n  that is attached to the inquired \\p CdIo_t object. This \\p cdtext_t\n  object gets created and filled if none is yet attached to the\n  inquired \\p CdIo_t object.\n\n  @param p_cdtext the CD-TEXT object\n  @param wdata the data\n  @param i_data size of wdata\n\n  @returns 0 on success, non-zero on failure\n*/\nint cdtext_data_init(cdtext_t *p_cdtext, uint8_t *wdata, size_t i_data);\n\n/*!\n  Free memory associated with the given \\p cdtext_t object.\n\n  @param p_cdtext the CD-TEXT object\n*/\nvoid cdtext_destroy (cdtext_t *p_cdtext);\n\n/*!\n  Returns a copy of the return value of cdtext_get_const or NULL.\n\n  Must be freed using cdio_free() when done.\n  @see cdtext_get_const\n*/\nchar *cdtext_get (const cdtext_t *p_cdtext, cdtext_field_t key, track_t track);\n\n/*!\n  Returns value of the given field.\n\n  NULL is returned if key is CDTEXT_INVALID or the field is not set.\n  Strings are encoded in UTF-8.\n\n  @param p_cdtext the CD-TEXT object\n  @param field type of the field to return\n  @param track specifies the track, 0 stands for disc\n*/\nconst char *cdtext_get_const (const cdtext_t *p_cdtext, cdtext_field_t field,\n                              track_t track);\n\n/*!\n  Returns the discs genre code.\n\n  @param p_cdtext the CD-TEXT object\n*/\ncdtext_genre_t cdtext_get_genre (const cdtext_t *p_cdtext);\n\n/*!\n  Returns the currently active language.\n\n  @param p_cdtext the CD-TEXT object\n*/\ncdtext_lang_t cdtext_get_language (const cdtext_t *p_cdtext);\n\n/*!\n  Returns the first track number.\n\n  @param p_cdtext the CD-TEXT object\n*/\ntrack_t cdtext_get_first_track(const cdtext_t *p_cdtext);\n\n/*!\n  Returns the last track number.\n\n  @param p_cdtext the CD-TEXT object\n*/\ntrack_t cdtext_get_last_track(const cdtext_t *p_cdtext);\n\n/*!\n  Try to select the given language.\n\n  @param p_cdtext the CD-TEXT object\n  @param language string representation of the language\n\n  @return true on success, false if language is not available\n*/\nbool cdtext_select_language(cdtext_t *p_cdtext, cdtext_lang_t language);\n\n/*!\n\n  @deprecated Use cdtext_list_languages_v2()\n\n  Returns a list of available languages or NULL.\n\n  __WARNING__: The indices in the returned array _do not_ match the indexing\n           as expected by cdtext_set_language_index().\n           Use cdtext_select_language() with the values of array elements.\n\n  Internally the list is stored in a static array.\n\n  @param p_cdtext the CD-TEXT object\n  @return NULL if p_cdtext is NULL, or an array of 8 cdtext_lang_t elements:\n          CDTEXT_LANGUAGE_UNKNOWN not only marks language code 0x00\n          but also invalid language codes and invalid language blocks.\n*/\ncdtext_lang_t *cdtext_list_languages (const cdtext_t *p_cdtext);\n\n/*!\n  Returns an array of available languages or NULL.\n  The index of an array element may be used to select the corresponding\n  language block by call cdtext_set_language_index().\n\n  The return value is a pointer into the memory range of *p_cdtext.\n  Do not use it after having freed that memory range.\n\n  @param p_cdtext the CD-TEXT object\n  @return NULL if p_cdtext is NULL, or an array of 8 cdtext_lang_t elements.\n\n  If an enumeration is CDTEXT_LANGUAGE_INVALID, then the language block has an invalid\n  language code.\n\n  If an enumeration is CDTEXT_LANGUAGE_BLOCK_UNUSED, then the block does not\n  exist on CD or could not be read in CD-TEXT for some reason.\n\n  Otherwise, the enumeration of element will be a value in\n  CDTEXT_LANGUAGE_UNKNOWN to CDTEXT_LANGUAGE_AMHARIC, and is a block\n  in that language.\n*/\ncdtext_lang_t *cdtext_list_languages_v2(cdtext_t *p_cdtext);\n\n/*!\n  Select the given language by block index. See cdtext_list_languages_v2().\n  If the index is bad, or no language block with that index was read:\n  select the default language at index 0 and return false.\n\n  @param p_cdtext the CD-TEXT object\n  @param idx      the desired index: 0 to 7.\n\n  @return true on success, false if no language block is associated to \\p idx.\n*/\nbool\ncdtext_set_language_index(cdtext_t *p_cdtext, int idx);\n\n/*!\n  Sets the given field at the given track to the given value.\n\n  Recodes to UTF-8 if charset is not \\p NULL.\n\n  @param p_cdtext the CD-TEXT object\n  @param key field to set\n  @param value value to set\n  @param track track to work on\n  @param charset charset to convert from\n */\nvoid cdtext_set (cdtext_t *p_cdtext, cdtext_field_t key, const uint8_t *value, track_t track, const char *charset);\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_CDTEXT_H_ */\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/cdio/device.h",
    "content": "/* -*- c -*-\n\n    Copyright (C) 2005-2006, 2008-2013 Rocky Bernstein <rocky@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/**\n *  \\file device.h\n *\n *  \\brief C header for driver- or device-related libcdio\n *          calls.  (\"device\" includes CD-image reading devices).\n */\n#ifndef CDIO_DEVICE_H_\n#define CDIO_DEVICE_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n#include <cdio/types.h>\n#include <cdio/cdio.h>\n\n  /** The type of an drive capability bit mask. See below for values*/\n  typedef uint32_t cdio_drive_read_cap_t;\n  typedef uint32_t cdio_drive_write_cap_t;\n  typedef uint32_t cdio_drive_misc_cap_t;\n\n  /**\n    \\brief Drive capability bits returned by cdio_get_drive_cap()\n    NOTE: Setting a bit here means the presence of a capability.\n  */\n\n  /** Miscellaneous capabilities. */\n  typedef enum {\n    CDIO_DRIVE_CAP_ERROR             = 0x40000, /**< Error */\n    CDIO_DRIVE_CAP_UNKNOWN           = 0x80000, /**< Dunno. It can be on if we\n                                                have only partial information\n                                                or are not completely certain\n                                                */\n    CDIO_DRIVE_CAP_MISC_CLOSE_TRAY   = 0x00001, /**< caddy systems can't\n                                                     close... */\n    CDIO_DRIVE_CAP_MISC_EJECT        = 0x00002, /**< but can eject.  */\n    CDIO_DRIVE_CAP_MISC_LOCK         = 0x00004, /**< disable manual eject */\n    CDIO_DRIVE_CAP_MISC_SELECT_SPEED = 0x00008, /**< programmable speed */\n    CDIO_DRIVE_CAP_MISC_SELECT_DISC  = 0x00010, /**< select disc from\n                                                      juke-box */\n    CDIO_DRIVE_CAP_MISC_MULTI_SESSION= 0x00020, /**< read sessions>1 */\n    CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED= 0x00080, /**< media changed */\n    CDIO_DRIVE_CAP_MISC_RESET        = 0x00100, /**< hard reset device */\n    CDIO_DRIVE_CAP_MISC_FILE         = 0x20000 /**< drive is really a file,\n                                                  i.e a CD file image */\n  } cdio_drive_cap_misc_t;\n\n  /** Reading masks.. */\n  typedef enum {\n    CDIO_DRIVE_CAP_READ_AUDIO        = 0x00001, /**< drive can play CD audio */\n    CDIO_DRIVE_CAP_READ_CD_DA        = 0x00002, /**< drive can read CD-DA */\n    CDIO_DRIVE_CAP_READ_CD_G         = 0x00004, /**< drive can read CD+G  */\n    CDIO_DRIVE_CAP_READ_CD_R         = 0x00008, /**< drive can read CD-R  */\n    CDIO_DRIVE_CAP_READ_CD_RW        = 0x00010, /**< drive can read CD-RW */\n    CDIO_DRIVE_CAP_READ_DVD_R        = 0x00020, /**< drive can read DVD-R */\n    CDIO_DRIVE_CAP_READ_DVD_PR       = 0x00040, /**< drive can read DVD+R */\n    CDIO_DRIVE_CAP_READ_DVD_RAM      = 0x00080, /**< drive can read DVD-RAM */\n    CDIO_DRIVE_CAP_READ_DVD_ROM      = 0x00100, /**< drive can read DVD-ROM */\n    CDIO_DRIVE_CAP_READ_DVD_RW       = 0x00200, /**< drive can read DVD-RW  */\n    CDIO_DRIVE_CAP_READ_DVD_RPW      = 0x00400, /**< drive can read DVD+RW  */\n    CDIO_DRIVE_CAP_READ_C2_ERRS      = 0x00800, /**< has C2 error correction */\n    CDIO_DRIVE_CAP_READ_MODE2_FORM1  = 0x01000, /**< can read mode 2 form 1 */\n    CDIO_DRIVE_CAP_READ_MODE2_FORM2  = 0x02000, /**< can read mode 2 form 2 */\n    CDIO_DRIVE_CAP_READ_MCN          = 0x04000, /**< can read MCN      */\n    CDIO_DRIVE_CAP_READ_ISRC         = 0x08000 /**< can read ISRC     */\n  } cdio_drive_cap_read_t;\n\n  /** Writing masks.. */\n  typedef enum {\n    CDIO_DRIVE_CAP_WRITE_CD_R        = 0x00001, /**< drive can write CD-R */\n    CDIO_DRIVE_CAP_WRITE_CD_RW       = 0x00002, /**< drive can write CD-RW */\n    CDIO_DRIVE_CAP_WRITE_DVD_R       = 0x00004, /**< drive can write DVD-R */\n    CDIO_DRIVE_CAP_WRITE_DVD_PR      = 0x00008, /**< drive can write DVD+R */\n    CDIO_DRIVE_CAP_WRITE_DVD_RAM     = 0x00010, /**< drive can write DVD-RAM */\n    CDIO_DRIVE_CAP_WRITE_DVD_RW      = 0x00020, /**< drive can write DVD-RW */\n    CDIO_DRIVE_CAP_WRITE_DVD_RPW     = 0x00040, /**< drive can write DVD+RW */\n    CDIO_DRIVE_CAP_WRITE_MT_RAINIER  = 0x00080, /**< Mount Rainier           */\n    CDIO_DRIVE_CAP_WRITE_BURN_PROOF  = 0x00100, /**< burn proof */\n    CDIO_DRIVE_CAP_WRITE_CD =\n    (CDIO_DRIVE_CAP_WRITE_CD_R | CDIO_DRIVE_CAP_WRITE_CD_RW),\n    /**< Has some sort of CD writer ability */\n\n    CDIO_DRIVE_CAP_WRITE_DVD =\n    (CDIO_DRIVE_CAP_WRITE_DVD_R | CDIO_DRIVE_CAP_WRITE_DVD_PR\n     | CDIO_DRIVE_CAP_WRITE_DVD_RAM | CDIO_DRIVE_CAP_WRITE_DVD_RW\n     | CDIO_DRIVE_CAP_WRITE_DVD_RPW ),\n    /**< Has some sort of DVD writer ability */\n\n    CDIO_DRIVE_CAP_WRITE =\n    (CDIO_DRIVE_CAP_WRITE_CD | CDIO_DRIVE_CAP_WRITE_DVD)\n    /**< Has some sort of DVD or CD writing ability */\n  } cdio_drive_cap_write_t;\n\n/** Size of fields returned by an \\p INQUIRY command */\n  typedef enum {\n    CDIO_MMC_HW_VENDOR_LEN   =  8, /**< length of vendor field */\n    CDIO_MMC_HW_MODEL_LEN    = 16, /**< length of model field */\n    CDIO_MMC_HW_REVISION_LEN =  4  /**< length of revision field */\n  } cdio_mmc_hw_len_t;\n\n\n  /** \\brief Structure to return CD vendor, model, and revision-level\n      strings obtained via the \\p INQUIRY command  */\n  typedef struct cdio_hwinfo\n  {\n    char psz_vendor  [CDIO_MMC_HW_VENDOR_LEN+1];\n    char psz_model   [CDIO_MMC_HW_MODEL_LEN+1];\n    char psz_revision[CDIO_MMC_HW_REVISION_LEN+1];\n  } cdio_hwinfo_t;\n\n\n  /** Flags specifying the category of device to open or is opened. */\n  typedef enum {\n    CDIO_SRC_IS_DISK_IMAGE_MASK = 0x0001, /**< Read source is a CD image. */\n    CDIO_SRC_IS_DEVICE_MASK     = 0x0002, /**< Read source is a CD device. */\n    CDIO_SRC_IS_SCSI_MASK       = 0x0004, /**< Read source SCSI device. */\n    CDIO_SRC_IS_NATIVE_MASK     = 0x0008\n  } cdio_src_category_mask_t;\n\n\n  /**\n   * The driver_id_t enumerations may be used to tag a specific driver\n   * that is opened or is desired to be opened. Note that this is\n   * different than what is available on a given host.\n   *\n   * Order should not be changed lightly because it breaks the ABI.\n   * One is not supposed to iterate over the values, but iterate over the\n   * cdio_drivers and cdio_device_drivers arrays.\n   *\n   * NOTE: IF YOU MODIFY ENUM MAKE SURE INITIALIZATION IN CDIO.C AGREES.\n   *\n   */\n  typedef enum  {\n    DRIVER_UNKNOWN, /**< Used as input when we don't care what kind\n                         of driver to use. */\n    DRIVER_AIX,     /**< AIX driver */\n    DRIVER_FREEBSD, /**< FreeBSD driver - includes CAM and ioctl access */\n    DRIVER_NETBSD,  /**< NetBSD Driver. */\n    DRIVER_LINUX,   /**< GNU/Linux Driver */\n    DRIVER_SOLARIS, /**< Sun Solaris Driver */\n    DRIVER_OSX,     /**< Apple OSX (or MacOS) Driver */\n    DRIVER_WIN32,   /**< Microsoft Windows Driver. Includes ASPI and\n                         ioctl access. */\n    DRIVER_CDRDAO,  /**< cdrdao format CD image. This is listed\n                         before BIN/CUE, to make the code prefer cdrdao\n                         over BIN/CUE when both exist. */\n    DRIVER_BINCUE,  /**< CDRWIN BIN/CUE format CD image. This is\n                         listed before NRG, to make the code prefer\n                         BIN/CUE over NRG when both exist. */\n    DRIVER_NRG,     /**< Nero NRG format CD image. */\n    DRIVER_DEVICE   /**< Is really a set of the above; should come last */\n  } driver_id_t;\n\n  /**\n      A null-terminated (that is DRIVER_UNKNOWN-terminated) ordered (in\n      order of preference) array of drivers.\n  */\n  extern const driver_id_t cdio_drivers[];\n\n  /**\n     A null-terminated (that is DRIVER_UNKNOWN-terminated) ordered (in\n     order of preference) array of device drivers.\n  */\n  extern const driver_id_t cdio_device_drivers[];\n\n  /**\n      There will generally be only one hardware for a given\n      build/platform from the list above. You can use the variable\n      below to determine which you've got. If the build doesn't make an\n      hardware driver, then the value will be DRIVER_UNKNOWN.\n  */\n  extern const driver_id_t cdio_os_driver;\n\n\n  /**\n      The following are status codes for completion of a given cdio\n      operation. By design 0 is successful completion and -1 is error\n      completion. This is compatable with ioctl so those routines that\n      call ioctl can just pass the value the get back (cast as this\n      enum). Also, by using negative numbers for errors, the\n      enumeration values below can be used in places where a positive\n      value is expected when things complete successfully. For example,\n      get_blocksize returns the blocksize, but on error uses the error\n      codes below. So note that this enumeration is often cast to an\n      integer.  C seems to tolerate this.\n  */\n  typedef enum  {\n    DRIVER_OP_SUCCESS        =  0, /**< in cases where an int is\n                                    returned, like cdio_set_speed,\n                                    more the negative return codes are\n                                    for errors and the positive ones\n                                    for success. */\n    DRIVER_OP_ERROR          = -1, /**< operation returned an error */\n    DRIVER_OP_UNSUPPORTED    = -2, /**< returned when a particular driver\n                                      doesn't support a particular operation.\n                                      For example an image driver which doesn't\n                                      really \"eject\" a CD.\n                                   */\n    DRIVER_OP_UNINIT         = -3, /**< returned when a particular driver\n                                      hasn't been initialized or a null\n                                      pointer has been passed.\n                                   */\n    DRIVER_OP_NOT_PERMITTED  = -4, /**< Operation not permitted.\n                                      For example might be a permission\n                                      problem.\n                                   */\n    DRIVER_OP_BAD_PARAMETER  = -5, /**< Bad parameter passed  */\n    DRIVER_OP_BAD_POINTER    = -6, /**< Bad pointer to memory area  */\n    DRIVER_OP_NO_DRIVER      = -7, /**< Operation called on a driver\n                                      not available on this OS  */\n    DRIVER_OP_MMC_SENSE_DATA = -8, /**< MMC operation returned sense data,\n                                      but no other error above recorded. */\n  } driver_return_code_t;\n\n  /**\n    Close media tray in CD drive if there is a routine to do so.\n\n    @param psz_drive the name of CD-ROM to be closed. If NULL, we will\n    use the default device.\n\n    @param p_driver_id is the driver to be used or that got used if\n    it was \\p DRIVER_UNKNOWN or \\p DRIVER_DEVICE; If this is \\p NULL, we won't\n    report back the driver used.\n  */\n  driver_return_code_t cdio_close_tray (const char *psz_drive,\n                                        /*in/out*/ driver_id_t *p_driver_id);\n\n  /**\n    @param drc the return code you want interpreted.\n\n    @return the string information about \\p drc\n  */\n  const char *cdio_driver_errmsg(driver_return_code_t drc);\n\n  /**\n    Eject media in CD drive if there is a routine to do so.\n\n    @param p_cdio the CD object to be acted upon.\n    If the CD is ejected \\p *p_cdio is free'd and p_cdio set to \\p NULL.\n  */\n  driver_return_code_t cdio_eject_media (CdIo_t **p_cdio);\n\n  /**\n    Eject media in CD drive if there is a routine to do so.\n\n    @param psz_drive the name of the device to be acted upon.\n    If NULL is given as the drive, we'll use the default driver device.\n  */\n  driver_return_code_t cdio_eject_media_drive (const char *psz_drive);\n\n  /**\n    Free device list returned by cdio_get_devices or\n    cdio_get_devices_with_cap().\n\n    @param device_list list returned by cdio_get_devices or\n    cdio_get_devices_with_cap().\n\n    @see cdio_get_devices(), and cdio_get_devices_with_cap().\n\n  */\n  void cdio_free_device_list (char * device_list[]);\n\n  /**\n    Get the default CD device.\n    if \\p p_cdio is \\p NULL (we haven't initialized a specific device driver),\n    then find a suitable one and return the default device for that.\n\n    @param p_cdio the CD object queried\n\n    @return a string containing the default CD device or \\p NULL\n    if we couldn't get a default device.\n\n    In some situations of drivers or OS's we can't find a CD device if\n    there is no media in it and it is possible for this routine to return\n    NULL even though there may be a hardware CD-ROM.\n  */\n  char * cdio_get_default_device (const CdIo_t *p_cdio);\n\n  /**\n    Return a string containing the default CD device if none is specified.\n    if \\p p_driver_id is \\p DRIVER_UNKNOWN or \\p DRIVER_DEVICE\n    then find a suitable one set the default device for that.\n\n    \\p NULL is returned if we couldn't get a default device.\n  */\n  char * cdio_get_default_device_driver (/*in/out*/ driver_id_t *p_driver_id);\n\n  /** Return an array of device names. If you want a specific\n    devices for a driver, give that device. If you want hardware\n    devices, give \\p DRIVER_DEVICE and if you want all possible devices,\n    image drivers and hardware drivers give \\p DRIVER_UNKNOWN.\n\n    NULL is returned if we couldn't return a list of devices.\n\n    In some situations of drivers or OS's we can't find a CD device if\n    there is no media in it and it is possible for this routine to return\n    \\p NULL even though there may be a hardware CD-ROM.\n  */\n  char ** cdio_get_devices (driver_id_t driver_id);\n\n  /**\n     Get an array of device names in search_devices that have at least\n     the capabilities listed by the capabities parameter.  If\n     search_devices is \\p NULL, then we'll search all possible CD drives.\n\n     Capabilities have two parts to them, a \"filesystem\" part and an\n     \"analysis\" part.\n\n     The filesystem part is mutually exclusive. For example either the\n     filesystem is at most one of the High-Sierra, UFS, or HFS,\n     ISO9660, fileystems. Valid combinations of say HFS and ISO9660\n     are specified as a separate \"filesystem\".\n\n     Capabilities on the other hand are not mutually exclusive. For\n     example a filesystem may have none, either, or both of the XA or\n     Rock-Ridge extension properties.\n\n     If \"b_any\" is set false then every capability listed in the\n     analysis portion of capabilities (i.e. not the basic filesystem)\n     must be satisified. If no analysis capabilities are specified,\n     that's a match.\n\n     If \"b_any\" is set true, then if any of the analysis capabilities\n     matches, we call that a success.\n\n     In either case, in the filesystem portion different filesystem\n     either specify 0 to match any filesystem or the specific\n     filesystem type.\n\n     To find a CD-drive of any type, use the mask CDIO_FS_MATCH_ALL.\n\n     @return the array of device names or NULL if we couldn't get a\n     default device.  It is also possible to return a non NULL but\n     after dereferencing the the value is NULL. This also means nothing\n     was found.\n  */\n  char ** cdio_get_devices_with_cap (/*in*/ char *ppsz_search_devices[],\n                                     cdio_fs_anal_t capabilities, bool b_any);\n\n  /**\n     Like cdio_get_devices_with_cap() but we return the driver we found\n     as well. This is because often one wants to search for kind of drive\n     and then *open* it afterwards. Giving the driver back facilitates this,\n     and speeds things up for libcdio as well.\n  */\n  char ** cdio_get_devices_with_cap_ret (/*in*/ char* ppsz_search_devices[],\n                                         cdio_fs_anal_t capabilities,\n                                         bool b_any,\n                                         /*out*/ driver_id_t *p_driver_id);\n\n  /**\n     Like cdio_get_devices(), but we may change the p_driver_id if we\n     were given \\p DRIVER_DEVICE or \\p DRIVER_UNKNOWN. This is because often\n     one wants to get a drive name and then *open* it\n     afterwards. Giving the driver back facilitates this, and speeds\n     things up for libcdio as well.\n   */\n\n  char ** cdio_get_devices_ret (/*in/out*/ driver_id_t *p_driver_id);\n\n  /**\n     Get the what kind of device we've got.\n\n     @param p_cdio the CD object queried\n     @param p_read_cap pointer to return read capabilities\n     @param p_write_cap pointer to return write capabilities\n     @param p_misc_cap pointer to return miscellaneous other capabilities\n\n     In some situations of drivers or OS's we can't find a CD device if\n     there is no media in it. In this situation capabilities will show up as\n     \\p NULL even though there isa hardware CD-ROM.\n  */\n  void cdio_get_drive_cap (const CdIo_t *p_cdio,\n                           cdio_drive_read_cap_t  *p_read_cap,\n                           cdio_drive_write_cap_t *p_write_cap,\n                           cdio_drive_misc_cap_t  *p_misc_cap);\n\n  /**\n     Get the drive capabilities for a specified device.\n\n     Return a list of device capabilities.\n\n     In some situations of drivers or OS's we can't find a CD device if\n     there is no media in it. In this situation capabilities will show up as\n     \\p NULL even though there isa hardware CD-ROM.\n  */\n  void cdio_get_drive_cap_dev (const char *device,\n                               cdio_drive_read_cap_t  *p_read_cap,\n                               cdio_drive_write_cap_t *p_write_cap,\n                               cdio_drive_misc_cap_t  *p_misc_cap);\n\n  /**\n     Get a string containing the name of the driver in use.\n\n     @param p_cdio the CD object to be acted upon.\n\n     @return a string with driver name or NULL if CdIo_t is NULL (we\n     haven't initialized a specific device.\n  */\n  const char * cdio_get_driver_name (const CdIo_t *p_cdio);\n\n  /**\n     Return a string name for the \\p driver_id.\n  */\n  const char * cdio_get_driver_name_from_id (driver_id_t driver_id);\n\n\n  /**\n     Get the driver id.\n     if \\p p_cdio is \\p NULL (we haven't initialized a specific device driver),\n     then return \\p DRIVER_UNKNOWN.\n\n     @param p_cdio the CD object to be acted upon.\n\n     @return the driver id..\n  */\n  driver_id_t cdio_get_driver_id (const CdIo_t *p_cdio);\n\n  /**\n    Get the CD-ROM hardware info via a SCSI MMC INQUIRY command.\n    False is returned if we had an error getting the information.\n  */\n  bool cdio_get_hwinfo ( const CdIo_t *p_cdio,\n                         /*out*/ cdio_hwinfo_t *p_hw_info );\n\n\n  /**\n     Get the LSN of the first track of the last session of\n     on the CD.\n\n     @param p_cdio the CD object to be acted upon.\n     @param i_last_session pointer to the session number to be returned.\n  */\n  driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio,\n                                              /*out*/ lsn_t *i_last_session);\n\n  /**\n      Find out if media has changed since the last call.\n\n      @param p_cdio the CD object to be acted upon.\n\n      @return 1 if media has changed since last call, 0 if not. Error\n      return codes are the same as \\p driver_return_code_t\n   */\n  int cdio_get_media_changed(CdIo_t *p_cdio);\n\n  /** True if CD-ROM understand ATAPI commands. */\n  bool_3way_t cdio_have_atapi (CdIo_t *p_cdio);\n\n  /** Like cdio_have_xxx but uses an enumeration instead. */\n  bool cdio_have_driver (driver_id_t driver_id);\n\n  /**\n     Free any resources associated with \\p p_cdio. Call this when done\n     using p_cdio and using CD reading/control operations.\n\n    @param p_cdio the CD object to eliminated.\n   */\n  void cdio_destroy (CdIo_t *p_cdio);\n\n  /**\n    Get a string decribing driver_id.\n\n    @param driver_id the driver you want the description for\n    @return a string of driver description\n  */\n  const char *cdio_driver_describe (driver_id_t driver_id);\n\n  /**\n     Sets up to read from place specified by \\p psz_source and\n     \\p driver_id. This or cdio_open_* should be called before using any\n     other routine, except cdio_init or any routine that accesses the\n     CD-ROM drive by name. cdio_open will call cdio_init, if that\n     hasn't been done previously.\n\n     @return the cdio object or NULL on error or no device.  If NULL\n     is given as the source, we'll use the default driver device.\n  */\n  CdIo_t * cdio_open (const char *psz_source, driver_id_t driver_id);\n\n  /**\n     Sets up to read from place specified by psz_source, driver_id and\n     access mode. This or cdio_open* should be called before using any\n     other routine, except cdio_init or any routine that accesses the\n     CD-ROM drive by name. This will call cdio_init, if that hasn't\n     been done previously.\n\n     If \\p NULL is given as the source, we'll use the default driver\n     device.\n\n     @return the cdio object or \\p NULL on error or no device.\n  */\n  CdIo_t * cdio_open_am (const char *psz_source,\n                         driver_id_t driver_id, const char *psz_access_mode);\n\n  /**\n     Set up BIN/CUE CD disk-image for reading. Source is the .bin or\n     .cue file\n\n     @return the cdio object or \\p NULL on error or no device.\n   */\n  CdIo_t * cdio_open_bincue (const char *psz_cue_name);\n\n  /**\n     Set up BIN/CUE CD disk-image for reading. Source is the .bin or\n     .cue file\n\n     @return the cdio object or \\p NULL on error or no device..\n   */\n  CdIo_t * cdio_open_am_bincue (const char *psz_cue_name,\n                                const char *psz_access_mode);\n\n  /**\n     Set up cdrdao CD disk-image for reading. Source is the .toc file\n\n     @return the cdio object or \\p NULL on error or no device.\n   */\n  CdIo_t * cdio_open_cdrdao (const char *psz_toc_name);\n\n  /**\n     Set up cdrdao CD disk-image for reading. Source is the .toc file\n\n     @return the cdio object or NULL on error or no device..\n  */\n  CdIo_t * cdio_open_am_cdrdao (const char *psz_toc_name,\n                                const char *psz_access_mode);\n\n  /**\n     Return a string containing the default CUE file that would\n     be used when none is specified.\n\n     @return the cdio object or \\p NULL on error or no device.\n  */\n  char * cdio_get_default_device_bincue(void);\n\n  char **cdio_get_devices_bincue(void);\n\n  /**\n     @return string containing the default CUE file that would be\n     used when none is specified. \\p NULL is returned on error or there\n     is no device.\n   */\n  char * cdio_get_default_device_cdrdao(void);\n\n  char **cdio_get_devices_cdrdao(void);\n\n  /**\n     Set up CD-ROM for reading. The device_name is\n     the some sort of device name.\n\n     @return the cdio object for subsequent operations.\n     \\p NULL on error or there is no driver for a some sort of hardware CD-ROM.\n  */\n  CdIo_t * cdio_open_cd (const char *device_name);\n\n  /**\n     Set up CD-ROM for reading. The device_name is\n     the some sort of device name.\n\n     @return the cdio object for subsequent operations.\n     \\p NULL on error or there is no driver for a some sort of hardware CD-ROM.\n  */\n  CdIo_t * cdio_open_am_cd (const char *psz_device,\n                            const char *psz_access_mode);\n\n  /**\n     CDRWIN BIN/CUE CD disc-image routines. Source is the .cue file\n\n     @return the cdio object for subsequent operations.\n     \\p NULL on error.\n   */\n  CdIo_t * cdio_open_cue (const char *cue_name);\n\n  /**\n     Set up CD-ROM for reading using the AIX driver. The device_name is\n     the some sort of device name.\n\n     @return the cdio object for subsequent operations.\n     \\p NULL on error or there is no AIX driver.\n\n     @see cdio_open()\n   */\n  CdIo_t * cdio_open_am_aix (const char *psz_source,\n                             const char *psz_access_mode);\n\n  /**\n     Set up CD-ROM for reading using the AIX driver. The device_name is\n     the some sort of device name.\n\n     @return the cdio object for subsequent operations.\n     \\p NULL on error or there is no AIX driver.\n\n     @see cdio_open()\n   */\n  CdIo_t * cdio_open_aix (const char *psz_source);\n\n  /**\n     Return a string containing the default device name that the AIX\n     driver would use when none is specified.\n\n     @return the cdio object for subsequent operations.\n     \\p NULL on error or there is no AIX driver.\n\n     @see cdio_open_cd(), cdio_open()\n   */\n  char * cdio_get_default_device_aix(void);\n\n  /**\n     Return a list of all of the CD-ROM devices that the AIX driver\n     can find.\n\n     In some situations of drivers or OS's we can't find a CD device\n     if there is no media in it and it is possible for this routine to\n     return \\p NULL even though there may be a hardware CD-ROM.\n   */\n  char **cdio_get_devices_aix(void);\n\n  /**\n     Set up CD-ROM for reading using the FreeBSD driver. The\n     device_name is the some sort of device name.\n\n     NULL is returned on error or there is no FreeBSD driver.\n\n     @see cdio_open_cd(), cdio_open()\n   */\n  CdIo_t * cdio_open_freebsd (const char *paz_psz_source);\n\n  /**\n     Set up CD-ROM for reading using the FreeBSD driver. The\n     device_name is the some sort of device name.\n\n     NULL is returned on error or there is no FreeBSD driver.\n\n     @see cdio_open_cd(), cdio_open()\n   */\n  CdIo_t * cdio_open_am_freebsd (const char *psz_source,\n                                 const char *psz_access_mode);\n\n  /**\n     Return a string containing the default device name that the\n     FreeBSD driver would use when none is specified.\n\n     NULL is returned on error or there is no CD-ROM device.\n   */\n  char * cdio_get_default_device_freebsd(void);\n\n  /**\n     Return a list of all of the CD-ROM devices that the FreeBSD\n     driver can find.\n   */\n  char **cdio_get_devices_freebsd(void);\n\n  /**\n     Set up CD-ROM for reading using the GNU/Linux driver. The\n     device_name is the some sort of device name.\n\n     @return the cdio object for subsequent operations.\n     NULL on error or there is no GNU/Linux driver.\n\n     In some situations of drivers or OS's we can't find a CD device if\n     there is no media in it and it is possible for this routine to return\n     NULL even though there may be a hardware CD-ROM.\n   */\n  CdIo_t * cdio_open_linux (const char *psz_source);\n\n  /**\n     Set up CD-ROM for reading using the GNU/Linux driver. The\n     device_name is the some sort of device name.\n\n     @return the cdio object for subsequent operations.\n     NULL on error or there is no GNU/Linux driver.\n   */\n  CdIo_t * cdio_open_am_linux (const char *psz_source,\n                               const char *access_mode);\n\n  /**\n     Return a string containing the default device name that the\n     GNU/Linux driver would use when none is specified. A scan is made\n     for CD-ROM drives with CDs in them.\n\n     NULL is returned on error or there is no CD-ROM device.\n\n     In some situations of drivers or OS's we can't find a CD device if\n     there is no media in it and it is possible for this routine to return\n     NULL even though there may be a hardware CD-ROM.\n\n     @see cdio_open_cd, cdio_open\n   */\n  char * cdio_get_default_device_linux(void);\n\n  /**\n     Return a list of all of the CD-ROM devices that the GNU/Linux\n     driver can find.\n   */\n  char **cdio_get_devices_linux(void);\n\n  /**\n     Set up CD-ROM for reading using the Sun Solaris driver. The\n     device_name is the some sort of device name.\n\n     @return the cdio object for subsequent operations.\n     \\p NULL on error or there is no Solaris driver.\n   */\n  CdIo_t * cdio_open_solaris (const char *psz_source);\n\n  /**\n     Set up CD-ROM for reading using the Sun Solaris driver. The\n     device_name is the some sort of device name.\n\n     @return the cdio object for subsequent operations.\n     \\p NULL on error or there is no Solaris driver.\n   */\n  CdIo_t * cdio_open_am_solaris (const char *psz_source,\n                                 const char *psz_access_mode);\n\n  /**\n     Return a string containing the default device name that the\n     Solaris driver would use when none is specified. A scan is made\n     for CD-ROM drives with CDs in them.\n\n     \\p NULL is returned on error or there is no CD-ROM device.\n\n     In some situations of drivers or OS's we can't find a CD device if\n     there is no media in it and it is possible for this routine to return\n     \\p NULL even though there may be a hardware CD-ROM.\n\n     @see cdio_open_cd(), cdio_open()\n   */\n  char * cdio_get_default_device_solaris(void);\n\n  /**\n     Return a list of all of the CD-ROM devices that the Solaris\n     driver can find.\n   */\n  char **cdio_get_devices_solaris(void);\n\n  /**\n     Set up CD-ROM for reading using the Apple OSX driver. The\n     device_name is the some sort of device name.\n\n     \\p NULL is returned on error or there is no OSX driver.\n\n     In some situations of drivers or OS's we can't find a CD device if\n     there is no media in it and it is possible for this routine to return\n     NULL even though there may be a hardware CD-ROM.\n\n     @see cdio_open_cd(), cdio_open()\n   */\n  CdIo_t * cdio_open_osx (const char *psz_source);\n\n  /**\n     Set up CD-ROM for reading using the Apple OSX driver. The\n     device_name is the some sort of device name.\n\n     NULL is returned on error or there is no OSX driver.\n\n     @see cdio_open_cd(), cdio_open()\n   */\n  CdIo_t * cdio_open_am_osx (const char *psz_source,\n                             const char *psz_access_mode);\n\n  /**\n     Return a string containing the default device name that the OSX\n     driver would use when none is specified. A scan is made for\n     CD-ROM drives with CDs in them.\n\n     In some situations of drivers or OS's we can't find a CD device if\n     there is no media in it and it is possible for this routine to return\n     NULL even though there may be a hardware CD-ROM.\n   */\n  char * cdio_get_default_device_osx(void);\n\n  /**\n     Return a list of all of the CD-ROM devices that the OSX driver\n     can find.\n   */\n  char **cdio_get_devices_osx(void);\n\n  /**\n     Set up CD-ROM for reading using the Microsoft Windows driver. The\n     device_name is the some sort of device name.\n\n     In some situations of drivers or OS's we can't find a CD device if\n     there is no media in it and it is possible for this routine to return\n     NULL even though there may be a hardware CD-ROM.\n   */\n  CdIo_t * cdio_open_win32 (const char *psz_source);\n\n  /**\n     Set up CD-ROM for reading using the Microsoft Windows driver. The\n     device_name is the some sort of device name.\n\n     NULL is returned on error or there is no Microsof Windows driver.\n   */\n  CdIo_t * cdio_open_am_win32 (const char *psz_source,\n                               const char *psz_access_mode);\n\n  /**\n     Return a string containing the default device name that the\n     Win32 driver would use when none is specified. A scan is made\n     for CD-ROM drives with CDs in them.\n\n     In some situations of drivers or OS's we can't find a CD device\n     if there is no media in it and it is possible for this routine to\n     return NULL even though there may be a hardware CD-ROM.\n\n     @see cdio_open_cd(), cdio_open()\n   */\n  char * cdio_get_default_device_win32(void);\n\n  char **cdio_get_devices_win32(void);\n\n  /**\n     Set up CD-ROM for reading using the Nero driver. The device_name\n     is the some sort of device name.\n\n     @return true on success; NULL on error or there is no Nero driver.\n   */\n  CdIo_t * cdio_open_nrg (const char *psz_source);\n\n  /**\n     Set up CD-ROM for reading using the Nero driver. The device_name\n     is the some sort of device name.\n\n     @return true on success; NULL on error or there is no Nero driver.\n   */\n  CdIo_t * cdio_open_am_nrg (const char *psz_source,\n                             const char *psz_access_mode);\n\n  /**\n     Get a string containing the default device name that the NRG\n     driver would use when none is specified. A scan is made for NRG\n     disk images in the current directory.\n\n     @return string containing the default device. NULL on error or\n     there is no CD-ROM device.\n   */\n  char * cdio_get_default_device_nrg(void);\n\n  char **cdio_get_devices_nrg(void);\n\n  /**\n\n     Determine if bin_name is the bin file part of  a CDRWIN CD disk image.\n\n     @param bin_name location of presumed CDRWIN bin image file.\n     @return the corresponding CUE file if bin_name is a BIN file or\n     \\p NULL if not a BIN file.\n  */\n  char *cdio_is_binfile(const char *bin_name);\n\n  /**\n     Determine if cue_name is the cue sheet for a CDRWIN CD disk image.\n\n     @return corresponding BIN file if cue_name is a CDRWIN cue file or\n     \\p NULL if not a CUE file.\n  */\n  char *cdio_is_cuefile(const char *cue_name);\n\n  /**\n    Determine if psg_nrg is a Nero CD disc image.\n\n    @param psz_nrg location of presumed NRG image file.\n    @return true if psz_nrg is a Nero NRG image or false\n    if not a NRG image.\n  */\n  bool cdio_is_nrg(const char *psz_nrg);\n\n  /**\n     Determine if psz_toc is a TOC file for a cdrdao CD disc image.\n\n     @param psz_toc location of presumed TOC image file.\n     @return true if toc_name is a cdrdao TOC file or false\n     if not a TOC file.\n  */\n  bool cdio_is_tocfile(const char *psz_toc);\n\n  /**\n     Determine if psz_source refers to a real hardware CD-ROM.\n\n     @param psz_source location name of object\n     @param driver_id   driver for reading object. Use DRIVER_UNKNOWN if you\n     don't know what driver to use.\n     @return true if psz_source is a device; If false is returned we\n     could have a CD disk image.\n  */\n  bool cdio_is_device(const char *psz_source, driver_id_t driver_id);\n\n  /**\n    Set the blocksize for subsequent reads.\n  */\n  driver_return_code_t cdio_set_blocksize ( const CdIo_t *p_cdio,\n                                            int i_blocksize );\n\n  /**\n     Set the drive speed.\n\n     @param p_cdio          CD structure set by cdio_open().\n\n    @param i_drive_speed speed in CD-ROM speed units. Note this not\n                         Kbs as would be used in the MMC spec or in\n                         mmc_set_speed(). To convert CD-ROM speed\n                         units to Kbs, multiply the number by 176 (for\n                         raw data) and by 150 (for filesystem\n                         data). On many CD-ROM drives, specifying a\n                         value too large will result in using the\n                         fastest speed.\n\n      @see mmc_set_speed() and mmc_set_drive_speed()\n  */\n  driver_return_code_t cdio_set_speed ( const CdIo_t *p_cdio,\n                                        int i_drive_speed );\n\n  /**\n     Get the value associatied with key.\n\n     @param p_cdio the CD object queried @param key the key to\n     retrieve @return the value associated with \"key\", \\p NULL if \\p\n     p_cdio is \\p NULL, or \"key\" does not exist.\n  */\n  const char * cdio_get_arg (const CdIo_t *p_cdio,  const char key[]);\n\n  /**\n     Set the arg \"key\" with \"value\" in \"p_cdio\".\n\n     @param p_cdio the CD object to set\n     @param key the key to set\n     @param value the value to assocaiate with key\n  */\n  driver_return_code_t cdio_set_arg (CdIo_t *p_cdio, const char key[],\n                                     const char value[]);\n\n  /**\n    Initialize CD Reading and control routines. Should be called first.\n  */\n  bool cdio_init(void);\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n/**\n   The below variables are trickery to force the above enum symbol\n   values to be recorded in debug symbol tables. They are used to\n   allow one to refer to the enumeration value names in the typedefs\n   above in a debugger and debugger expressions.  */\nextern cdio_drive_cap_misc_t          debug_cdio_drive_cap_misc;\nextern cdio_drive_cap_read_t          debug_cdio_drive_cap_read_t;\nextern cdio_drive_cap_write_t         debug_drive_cap_write_t;\nextern cdio_mmc_hw_len_t              debug_cdio_mmc_hw_len;\nextern cdio_src_category_mask_t       debug_cdio_src_category_mask;\n\n#endif /* CDIO_DEVICE_H_ */\n"
  },
  {
    "path": "src/libcdio/cdio/disc.h",
    "content": "/* -*- c -*-\n\n    Copyright (C) 2018 Thomas Schmitt\n    Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012, 2014\n    Rocky Bernstein <rocky@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/**\n   \\file disc.h\n   \\brief  The top-level header for disc-related libcdio calls.\n */\n#ifndef CDIO_DISC_H_\n#define CDIO_DISC_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n    /**\n       disc modes. The first combined from MMC-5 6.33.3.13 (Send\n       CUESHEET), \"DVD Book\" from MMC-5 Table 400, page 419.  and\n       GNU/Linux /usr/include/linux/cdrom.h and we've added DVD.\n    */\n  typedef enum {\n    CDIO_DISC_MODE_CD_DA,           /**< CD-DA */\n    CDIO_DISC_MODE_CD_DATA,         /**< CD-ROM form 1 */\n    CDIO_DISC_MODE_CD_XA,           /**< CD-ROM XA form2 */\n    CDIO_DISC_MODE_CD_MIXED,        /**< Some combo of above. */\n    CDIO_DISC_MODE_DVD_ROM,         /**< DVD ROM (e.g. movies) */\n    CDIO_DISC_MODE_DVD_RAM,         /**< DVD-RAM */\n    CDIO_DISC_MODE_DVD_R,           /**< DVD-R */\n    CDIO_DISC_MODE_DVD_RW,          /**< DVD-RW */\n    CDIO_DISC_MODE_HD_DVD_ROM,      /**< HD DVD-ROM */\n    CDIO_DISC_MODE_HD_DVD_RAM,      /**< HD DVD-RAM */\n    CDIO_DISC_MODE_HD_DVD_R,        /**< HD DVD-R */\n    CDIO_DISC_MODE_DVD_PR,          /**< DVD+R */\n    CDIO_DISC_MODE_DVD_PRW,         /**< DVD+RW */\n    CDIO_DISC_MODE_DVD_PRW_DL,      /**< DVD+RW DL */\n    CDIO_DISC_MODE_DVD_PR_DL,       /**< DVD+R DL */\n    CDIO_DISC_MODE_DVD_OTHER,       /**< Unknown/unclassified DVD type */\n    CDIO_DISC_MODE_NO_INFO,\n    CDIO_DISC_MODE_ERROR,\n    CDIO_DISC_MODE_CD_I         /**< CD-i. */\n  } discmode_t;\n\n  extern const char *discmode2str[];\n\n  /**\n    Read cdtext information for a cdtext_t object.\n    About format and usage of these data see the documentation of call\n    mmc_read_cdtext() in include file <cdio/mmc.h>.\n\n\n    @param p_cdio the CD object that may contain CD-Text information.\n    @return malloc'd pointer to raw CD-Text data as replied by the drive\n            or NULL if problems occur or CD-Text information does not exist.\n            A non-NULL return value must be freed with cdio_free() when done.\n  */\n  uint8_t * cdio_get_cdtext_raw (CdIo_t *p_cdio);\n\n  /**\n    Return a pointer to the cdtext_t object which is attached to a CdIo_t\n    object. If no such cdtext_t is attached yet, then try to read CD-TEXT\n    information and use it to create and initialise the cdtext_t object.\n\n    For usage of cdtext_t see include file <cdio/cdtext.h>.\n\n    @param p_cdio the CD object that may contain CD-Text information.\n    @return a pointer to the attached cdtext_t object or NULL if problems\n            occur or if CD-Text information does not exist.\n  */\n  cdtext_t *cdio_get_cdtext (CdIo_t *p_cdio);\n\n  /**\n    Get disc mode - the kind of CD (CD-DA, CD-ROM mode 1, CD-MIXED, etc.\n    that we've got. The notion of \"CD\" is extended a little to include\n    DVD's.\n  */\n  discmode_t cdio_get_discmode (CdIo_t *p_cdio);\n\n  /**\n    Get the lsn of the end of the CD\n\n    @return the lsn. On error 0 or CDIO_INVALD_LSN.\n  */\n  lsn_t cdio_get_disc_last_lsn(const CdIo_t *p_cdio);\n\n  /**\n    Return the Joliet level recognized for p_cdio.\n  */\n  uint8_t cdio_get_joliet_level(const CdIo_t *p_cdio);\n\n  /**\n    Get the media catalog number (MCN) from the CD.\n\n    @return the media catalog number or NULL if there is none or we\n    don't have the ability to get it.\n\n    Note: The caller must free the returned string with cdio_free()\n    when done with it.\n\n  */\n  char * cdio_get_mcn (const CdIo_t *p_cdio);\n\n  /**\n    Get the number of tracks on the CD.\n\n    @return the number of tracks, or CDIO_INVALID_TRACK if there is\n    an error.\n  */\n  track_t cdio_get_num_tracks (const CdIo_t *p_cdio);\n\n  /**\n    Return true if discmode is some sort of CD.\n  */\n  bool cdio_is_discmode_cdrom (discmode_t discmode);\n\n  /**\n    Return true if discmode is some sort of DVD.\n  */\n  bool cdio_is_discmode_dvd (discmode_t discmode);\n\n  /**\n      cdio_stat_size is deprecated. @see cdio_get_disc_last_lsn\n  */\n#define cdio_stat_size cdio_get_disc_last_lsn\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_DISC_H_ */\n"
  },
  {
    "path": "src/libcdio/cdio/ds.h",
    "content": "/*\n    Copyright (C) 2005, 2008, 2017 Rocky Bernstein <rocky@gnu.org>\n    Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/** \\file ds.h\n *  \\brief  The top-level header for list-related data structures.\n\n    Note: this header will is slated to get removed and libcdio will use\n    glib.h routines instead.\n*/\n\n\f\n#ifndef CDIO_DS_H_\n#define CDIO_DS_H_\n\n#include <cdio/types.h>\n\n/** opaque types... */\ntypedef struct _CdioList CdioList_t;\ntypedef struct _CdioListNode CdioListNode_t;\n\ntypedef int (*_cdio_list_cmp_func_t) (void *p_data1, void *p_data2);\ntypedef int (*_cdio_list_iterfunc_t) (void *p_data, void *p_user_data);\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n/** methods */\nCdioList_t *_cdio_list_new (void);\n\nvoid _cdio_list_free (CdioList_t *p_list, int free_data, CdioDataFree_t free_fn);\n\nunsigned _cdio_list_length (const CdioList_t *list);\n\nvoid _cdio_list_prepend (CdioList_t *p_list, void *p_data);\n\nvoid _cdio_list_append (CdioList_t *p_list, void *p_data);\n\nvoid _cdio_list_foreach (CdioList_t *p_list, _cdio_list_iterfunc_t func,\n                         void *p_user_data);\n\nCdioListNode_t *_cdio_list_find (CdioList_t *p_list,\n                                 _cdio_list_iterfunc_t cmp_func,\n                                 void *p_user_data);\n\n#define _CDIO_LIST_FOREACH(node, list) \\\n for (node = _cdio_list_begin (list); node; node = _cdio_list_node_next (node))\n\n/** node operations */\n\nCdioListNode_t *_cdio_list_begin (const CdioList_t *p_list);\n\nCdioListNode_t *_cdio_list_end (CdioList_t *p_list);\n\nCdioListNode_t *_cdio_list_node_next (CdioListNode_t *p_node);\n\n  void _cdio_list_node_free (CdioListNode_t *p_node, int i_free_data,\n                             CdioDataFree_t free_fn);\n\nvoid *_cdio_list_node_data (CdioListNode_t *p_node);\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_DS_H_ */\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/cdio/dvd.h",
    "content": "/*\n    Copyright (C) 2004, 2010 Rocky Bernstein <rocky@gnu.org>\n    Modeled after GNU/Linux definitions in linux/cdrom.h\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/**\n   \\file dvd.h \n   \\brief Definitions for DVD access.\n\n   The documents we make use of are described Multi-Media Commands\n   (MMC). This document generally has a numeric level number\n   appended. For example MMC-5 refers to ``Multi-Media Commands - 5'\n   which is the current version in 2010.\n\n*/\n\n#ifndef CDIO_DVD_H_\n#define CDIO_DVD_H_\n\n#include <cdio/types.h>\n\n/**\n   Values used in a READ DVD STRUCTURE\n */\ntypedef enum cdio_dvd_structure\n{\n\tCDIO_DVD_STRUCT_PHYSICAL\t= 0x00,\n\tCDIO_DVD_STRUCT_COPYRIGHT\t= 0x01,\n\tCDIO_DVD_STRUCT_DISCKEY\t        = 0x02,\n\tCDIO_DVD_STRUCT_BCA\t\t= 0x03,\n\tCDIO_DVD_STRUCT_MANUFACT\t= 0x04\n} cdio_dvd_structure;\n\n/**\n    Media definitions for \"DVD Book\" from MMC-5 Table 400, page 419.\n*/\ntypedef enum cdio_dvd_book\n{\n\tCDIO_DVD_BOOK_DVD_ROM    = 0x0, /**< DVD-ROM */\n\tCDIO_DVD_BOOK_DVD_RAM    = 0x1, /**< DVD-RAM */\n\tCDIO_DVD_BOOK_DVD_R      = 0x2, /**< DVD-R */\n\tCDIO_DVD_BOOK_DVD_RW     = 0x3, /**< DVD-RW */\n\tCDIO_DVD_BOOK_HD_DVD_ROM = 0x4, /**< HD DVD-ROM */\n\tCDIO_DVD_BOOK_HD_DVD_RAM = 0x5, /**< HD DVD-RAM */\n\tCDIO_DVD_BOOK_HD_DVD_R   = 0x6, /**< HD DVD-R */\n\tCDIO_DVD_BOOK_DVD_PRW    = 0x9, /**< DVD+RW */\n\tCDIO_DVD_BOOK_DVD_PR     = 0xa, /**< DVD+R  */\n\tCDIO_DVD_BOOK_DVD_PRW_DL = 0xd, /**< DVD+RW DL  */\n\tCDIO_DVD_BOOK_DVD_PR_DL  = 0xe  /**< DVD+R DL  */\n} cdio_dvd_book;\n\ntypedef struct cdio_dvd_layer {\n  unsigned int book_version\t: 4;\n  unsigned int book_type\t: 4;\n  unsigned int min_rate\t        : 4;\n  unsigned int disc_size\t: 4;\n  unsigned int layer_type\t: 4;\n  unsigned int track_path\t: 1;\n  unsigned int nlayers\t        : 2;\n  unsigned int track_density\t: 4;\n  unsigned int linear_density   : 4;\n  unsigned int bca\t\t: 1;\n  uint32_t start_sector;\n  uint32_t end_sector;\n  uint32_t end_sector_l0;\n} cdio_dvd_layer_t;\n\n/**\n    Maximum number of layers in a DVD.  \n */\n#define CDIO_DVD_MAX_LAYERS\t4\n\ntypedef struct cdio_dvd_physical {\n  uint8_t type;\n  uint8_t layer_num;\n  cdio_dvd_layer_t layer[CDIO_DVD_MAX_LAYERS];\n} cdio_dvd_physical_t;\n\ntypedef struct cdio_dvd_copyright {\n  uint8_t type;\n  \n  uint8_t layer_num;\n  uint8_t cpst;\n  uint8_t rmi;\n} cdio_dvd_copyright_t;\n\ntypedef struct cdio_dvd_disckey {\n  uint8_t type;\n  \n  unsigned agid\t: 2;\n  uint8_t value[2048];\n} cdio_dvd_disckey_t;\n\ntypedef struct cdio_dvd_bca {\n  uint8_t type;\n  \n  int len;\n  uint8_t value[188];\n} cdio_dvd_bca_t;\n\ntypedef struct cdio_dvd_manufact {\n  uint8_t type;\n  \n  uint8_t layer_num;\n  int len;\n  uint8_t value[2048];\n} cdio_dvd_manufact_t;\n\ntypedef union {\n  uint8_t type;\n  \n  cdio_dvd_physical_t\tphysical;\n  cdio_dvd_copyright_t\tcopyright;\n  cdio_dvd_disckey_t\tdisckey;\n  cdio_dvd_bca_t\tbca;\n  cdio_dvd_manufact_t\tmanufact;\n} cdio_dvd_struct_t;\n\n#endif /* CDIO_DVD_H_ */\n"
  },
  {
    "path": "src/libcdio/cdio/ecma_167.h",
    "content": "/*\n    Copyright (c) 2005, 2006, 2008, 2012, 2024 Rocky Bernstein <rocky@gnu.org>\n    Copyright (c) 2001-2002  Ben Fennema <bfennema@falcon.csc.calpoly.edu>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/*\n * Some portions taken from FreeBSD ecma167-udf.h which states:\n * Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n/*!\n * \\file ecma_167.h\n *\n * \\brief Definitions based on ECMA-167 3rd edition (June 1997)\n * See http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-167.pdf\n*/\n\n#ifndef CDIO_ECMA_167_H\n#define CDIO_ECMA_167_H 1\n\n#include <cdio/types.h>\n\n/**\n   Imagine the below enum values as \\#define'd values rather than\n   distinct values of an enum.\n*/\ntypedef enum {\n  VSD_STD_ID_SIZE    =    5, /** Volume Structure Descriptor (ECMA 167r3\n                                2/9.1) */\n  UDF_REGID_ID_SIZE  =   23, /**< See identifier (ECMA 167r3 1/7.4) */\n  UDF_VOLID_SIZE     =   32,\n  UDF_FID_SIZE       =   38,\n  UDF_VOLSET_ID_SIZE =  128\n} ecma_167_enum1_t ;\n\n/** Tag Identifier (ECMA 167r3 3/7.2.1) */\n\ntypedef enum {\n  TAGID_PRI_VOL          = 0x0001,\n  TAGID_ANCHOR           = 0x0002,\n  TAGID_VOL              = 0x0003,\n  TAGID_IMP_VOL          = 0x0004,\n  TAGID_PARTITION        = 0x0005,\n  TAGID_LOGVOL           = 0x0006,\n  TAGID_UNALLOC_SPACE    = 0x0007,\n  TAGID_TERM             = 0x0008,\n  TAGID_LOGVOL_INTEGRITY = 0x0009,\n  TAGID_FSD              = 0x0100,\n  TAGID_FID              = 0x0101,\n  TAGID_AED              = 0x0102,\n  TAGID_IE               = 0x0103,\n  TAGID_TE               = 0x0104,\n  TAGID_FILE_ENTRY       = 0x0105,\n  TAGID_EAHD             = 0x0106,\n  TAGID_USE              = 0x0107,\n  TAGID_SBD              = 0x0108,\n  TAGID_PIE              = 0x0109,\n  TAGID_EFE              = 0x010A,\n} tag_id_t ;\n\n/** Character Set Type (ECMA 167r3 1/7.2.1.1) */\ntypedef enum {\n  CHARSPEC_TYPE_CS0 = 0x00,     /**< Section 1/7.2.2 */\n  CHARSPEC_TYPE_CS1 = 0x01,     /**< Section 1/7.2.3 */\n  CHARSPEC_TYPE_CS2 = 0x02,     /**< Section 1/7.2.4 */\n  CHARSPEC_TYPE_CS3 = 0x03,     /**< Section 1/7.2.5 */\n  CHARSPEC_TYPE_CS4 = 0x04,     /**< Section 1/7.2.6 */\n  CHARSPEC_TYPE_CS5 = 0x05,     /**< Section 1/7.2.7 */\n  CHARSPEC_TYPE_CS6 = 0x06,     /**< Section 1/7.2.8 */\n  CHARSPEC_TYPE_CS7 = 0x07,     /**< Section 1/7.2.9 */\n\n  CHARSPEC_TYPE_CS8 = 0x08,     /**< Section 1/7.2.10 */\n} udf_charspec_enum_t;\n\ntypedef uint8_t  udf_Uint8_t;  /*! Section 1/7/1.1 */\ntypedef uint16_t udf_Uint16_t; /*! Section 1/7.1.3 */\ntypedef uint32_t udf_Uint32_t; /*! Section 1/7.1.5 */\ntypedef uint64_t udf_Uint64_t; /*! Section 1/7.1.7 */\ntypedef char     udf_dstring;  /*! Section 1/7.1.12 */\n\n#define UDF_LENGTH_MASK 0x3fffffff\n\nPRAGMA_BEGIN_PACKED\n\n/** Character set specification (ECMA 167r3 1/7.2.1) */\nstruct udf_charspec_s\n{\n  udf_Uint8_t   charset_type;\n  udf_Uint8_t   charset_info[63];\n} GNUC_PACKED;\n\ntypedef struct udf_charspec_s udf_charspec_t;\n\n/** Timestamp (ECMA 167r3 1/7.3) */\nstruct udf_timestamp_s\n{\n  udf_Uint16_t          type_tz;\n  udf_Uint16_t          year;\n  udf_Uint8_t           month;\n  udf_Uint8_t           day;\n  udf_Uint8_t           hour;\n  udf_Uint8_t           minute;\n  udf_Uint8_t           second;\n  udf_Uint8_t           centiseconds;\n  udf_Uint8_t           hundreds_of_microseconds;\n  udf_Uint8_t           microseconds;\n} GNUC_PACKED;\n\ntypedef struct udf_timestamp_s udf_timestamp_t;\n\n/** Type and Time Zone (ECMA 167r3 1/7.3.1)\n\n    Imagine the below enum values as \\#define'd values rather than\n    distinct values of an enum.\n*/\ntypedef enum {\n  TIMESTAMP_TYPE_CUT        =   0x0000,\n  TIMESTAMP_TYPE_LOCAL      =   0x1000,\n  TIMESTAMP_TYPE_AGREEMENT  =   0x2000,\n  TIMESTAMP_TYPE_MASK       =   0xF000,\n  TIMESTAMP_TIMEZONE_MASK   =   0x0FFF,\n} ecma_167_timezone_enum_t ;\n\n\n#define TIMESTAMP_TYPE_MASK             0xF000\n#define TIMESTAMP_TYPE_CUT              0x0000\n#define TIMESTAMP_TYPE_LOCAL            0x1000\n#define TIMESTAMP_TYPE_AGREEMENT        0x2000\n#define TIMESTAMP_TIMEZONE_MASK         0x0FFF\n\nstruct udf_id_suffix_s\n{\n  udf_Uint16_t  udf_revision;\n  udf_Uint8_t   os_class;\n  udf_Uint8_t   os_identifier;\n  udf_Uint8_t   reserved[4];\n} GNUC_PACKED;\n\ntypedef struct udf_id_suffix_s udf_id_suffix_t;\n\n/** Entity identifier (ECMA 167r3 1/7.4) */\nstruct udf_regid_s\n{\n  udf_Uint8_t           flags;\n  udf_Uint8_t           id[UDF_REGID_ID_SIZE];\n  udf_id_suffix_t       id_suffix;\n} GNUC_PACKED;\n\ntypedef struct udf_regid_s udf_regid_t;\n\n/** Flags (ECMA 167r3 1/7.4.1) */\n#define ENTITYID_FLAGS_DIRTY            0x00\n#define ENTITYID_FLAGS_PROTECTED        0x01\n\n/** Volume Structure Descriptor (ECMA 167r3 2/9.1) */\nstruct vol_struct_desc_s\n{\n  udf_Uint8_t           struct_type;\n  udf_Uint8_t           std_id[VSD_STD_ID_SIZE];\n  udf_Uint8_t           struct_version;\n  udf_Uint8_t           struct_data[2041];\n} GNUC_PACKED;\n\n/** Standard Identifier (EMCA 167r2 2/9.1.2) */\n#define VSD_STD_ID_NSR02                \"NSR02\" /* (3/9.1) */\n\n/** Standard Identifier (ECMA 167r3 2/9.1.2) */\n\n/* The below const definitions are to faciltate debugging of the\n   values #define'd below. */\nextern const char VSD_STD_ID_BEA01[sizeof(\"BEA01\")-1];\nextern const char VSD_STD_ID_BOOT2[sizeof(\"BOOT2\")-1];\nextern const char VSD_STD_ID_CD001[sizeof(\"CD001\")-1];\nextern const char VSD_STD_ID_CDW01[sizeof(\"CDW02\")-1];\nextern const char VSD_STD_ID_NSR03[sizeof(\"NSR03\")-1];\nextern const char VSD_STD_ID_TEA01[sizeof(\"TEA01\")-1];\n\n#define VSD_STD_ID_BEA01                \"BEA01\" /**< ECMA-167 2/9.2 */\n#define VSD_STD_ID_BOOT2                \"BOOT2\" /**< ECMA-167 2/9.4 */\n#define VSD_STD_ID_CD001                \"CD001\" /**< ECMA-119 */\n#define VSD_STD_ID_CDW02                \"CDW02\" /**< ECMA-168 */\n#define VSD_STD_ID_NSR02                \"NSR02\" /**< ECMA-167, 3/9.1\n                                               NOTE: ECMA-167, 2nd edition */\n#define VSD_STD_ID_NSR03                \"NSR03\" /**< ECMA-167 3/9.1 */\n#define VSD_STD_ID_TEA01                \"TEA01\" /**< ECMA-168 2/9.3 */\n\n/** Beginning Extended Area Descriptor (ECMA 167r3 2/9.2) */\nstruct beginning_extended_area_desc_s\n{\n  udf_Uint8_t           struct_type;\n  udf_Uint8_t           std_id[VSD_STD_ID_SIZE];\n  udf_Uint8_t           struct_version;\n  udf_Uint8_t           struct_data[2041];\n} GNUC_PACKED;\n\n/** Terminating Extended Area Descriptor (ECMA 167r3 2/9.3) */\nstruct terminating_extended_area_desc_s\n{\n  udf_Uint8_t           struct_type;\n  udf_Uint8_t           std_id[VSD_STD_ID_SIZE];\n  udf_Uint8_t           struct_version;\n  udf_Uint8_t           struct_data[2041];\n} GNUC_PACKED;\n\n/** Boot Descriptor (ECMA 167r3 2/9.4) */\nstruct boot_desc_s\n{\n  udf_Uint8_t           struct_type;\n  udf_Uint8_t           std_ident[VSD_STD_ID_SIZE];\n  udf_Uint8_t           struct_version;\n  udf_Uint8_t           reserved1;\n  udf_regid_t           arch_type;\n  udf_regid_t           boot_ident;\n  udf_Uint32_t          bool_ext_location;\n  udf_Uint32_t          bool_ext_length;\n  udf_Uint64_t          load_address;\n  udf_Uint64_t          start_address;\n  udf_timestamp_t       desc_creation_time;\n  udf_Uint16_t          flags;\n  udf_Uint8_t           reserved2[32];\n  udf_Uint8_t           boot_use[1906];\n} GNUC_PACKED;\n\n/** Flags (ECMA 167r3 2/9.4.12) */\n#define BOOT_FLAGS_ERASE                0x01\n\n/** Extent Descriptor (ECMA 167r3 3/7.1) */\nstruct udf_extent_ad_s\n{\n  udf_Uint32_t          len;\n  udf_Uint32_t          loc;\n} GNUC_PACKED;\n\ntypedef struct udf_extent_ad_s udf_extent_ad_t;\n\n/** Descriptor Tag (ECMA 167r3 3/7.2) */\nstruct udf_tag_s\n{\n  udf_Uint16_t          id;\n  udf_Uint16_t          desc_version;\n  udf_Uint8_t           cksum;\n  udf_Uint8_t           reserved;\n  udf_Uint16_t          i_serial;\n  udf_Uint16_t          desc_CRC;\n  udf_Uint16_t          desc_CRC_len;\n  udf_Uint32_t          loc;\n} GNUC_PACKED;\n\ntypedef struct udf_tag_s udf_tag_t;\n\n/** NSR Descriptor (ECMA 167r3 3/9.1) */\nstruct NSR_desc_s\n{\n  udf_Uint8_t   struct_type;\n  udf_Uint8_t   std_id[VSD_STD_ID_SIZE];\n  udf_Uint8_t   struct_version;\n  udf_Uint8_t   reserved;\n  udf_Uint8_t   struct_data[2040];\n} GNUC_PACKED;\n\n/** Primary Volume Descriptor (ECMA 167r3 3/10.1) */\nstruct udf_pvd_s\n{\n  udf_tag_t       tag;\n  udf_Uint32_t    vol_desc_seq_num;\n  udf_Uint32_t    primary_vol_desc_num;\n  udf_dstring     vol_ident[UDF_VOLID_SIZE];\n  udf_Uint16_t    vol_seq_num;\n  udf_Uint16_t    max_vol_seqnum;\n  udf_Uint16_t    interchange_lvl;\n  udf_Uint16_t    max_interchange_lvl;\n  udf_Uint32_t    charset_list;\n  udf_Uint32_t    max_charset_list;\n  udf_dstring     volset_id[UDF_VOLSET_ID_SIZE];\n  udf_charspec_t  desc_charset;\n  udf_charspec_t  explanatory_charset;\n  udf_extent_ad_t vol_abstract;\n  udf_extent_ad_t vol_copyright;\n  udf_regid_t     app_ident;\n  udf_timestamp_t recording_time;\n  udf_regid_t     imp_ident;\n  udf_Uint8_t     imp_use[64];\n  udf_Uint32_t    predecessor_vol_desc_seq_location;\n  udf_Uint16_t    flags;\n  udf_Uint8_t     reserved[22];\n} GNUC_PACKED;\n\ntypedef struct udf_pvd_s udf_pvd_t;\n\n/** Flags (ECMA 167r3 3/10.1.21) */\n#define PVD_FLAGS_VSID_COMMON           0x0001\n\n/** Anchor Volume Descriptor Pointer (ECMA 167r3 3/10.2) */\nstruct anchor_vol_desc_ptr_s\n{\n  udf_tag_t       tag;\n  udf_extent_ad_t main_vol_desc_seq_ext;\n  udf_extent_ad_t reserve_vol_desc_seq_ext;\n  udf_Uint8_t     reserved[480];\n} GNUC_PACKED;\n\ntypedef struct anchor_vol_desc_ptr_s anchor_vol_desc_ptr_t;\n\n/** Volume Descriptor Pointer (ECMA 167r3 3/10.3) */\nstruct vol_desc_ptr_s\n{\n  udf_tag_t       tag;\n  udf_Uint32_t    vol_desc_seq_num;\n  udf_extent_ad_t next_vol_desc_set_ext;\n  udf_Uint8_t     reserved[484];\n} GNUC_PACKED;\n\n/** Implementation Use Volume Descriptor (ECMA 167r3 3/10.4) */\nstruct imp_use_vol_desc_s\n{\n  udf_tag_t    tag;\n  udf_Uint32_t vol_desc_seq_num;\n  udf_regid_t  imp_id;\n  udf_Uint8_t  imp_use[460];\n} GNUC_PACKED;\n\n/** Partition Descriptor (ECMA 167r3 3/10.5) */\nstruct partition_desc_s\n{\n  udf_tag_t     tag;\n  udf_Uint32_t  vol_desc_seq_num;\n  udf_Uint16_t  flags;\n  udf_Uint16_t  number;             /**< Partition number */\n  udf_regid_t   contents;\n  udf_Uint8_t   contents_use[128];\n  udf_Uint32_t  access_type;\n  udf_Uint32_t  start_loc;\n  udf_Uint32_t  part_len;\n  udf_regid_t   imp_id;\n  udf_Uint8_t   imp_use[128];\n  udf_Uint8_t   reserved[156];\n} GNUC_PACKED;\n\ntypedef struct partition_desc_s partition_desc_t;\n\n/** Partition Flags (ECMA 167r3 3/10.5.3) */\n#define PD_PARTITION_FLAGS_ALLOC        0x0001\n\n/** Partition Contents (ECMA 167r2 3/10.5.3) */\n#define PD_PARTITION_CONTENTS_NSR02     \"+NSR02\"\n\n/** Partition Contents (ECMA 167r3 3/10.5.5) */\n#define PD_PARTITION_CONTENTS_FDC01     \"+FDC01\"\n#define PD_PARTITION_CONTENTS_CD001     \"+CD001\"\n#define PD_PARTITION_CONTENTS_CDW02     \"+CDW02\"\n#define PD_PARTITION_CONTENTS_NSR03     \"+NSR03\"\n\n/** Access Type (ECMA 167r3 3/10.5.7) */\n#define PD_ACCESS_TYPE_NONE             0x00000000\n#define PD_ACCESS_TYPE_READ_ONLY        0x00000001\n#define PD_ACCESS_TYPE_WRITE_ONCE       0x00000002\n#define PD_ACCESS_TYPE_REWRITABLE       0x00000003\n#define PD_ACCESS_TYPE_OVERWRITABLE     0x00000004\n\n/** Recorded Address (ECMA 167r3 4/7.1) */\nstruct udf_lb_addr_s\n{\n  udf_Uint32_t  lba;\n  udf_Uint16_t  partitionReferenceNum;\n} GNUC_PACKED;\n\ntypedef struct udf_lb_addr_s udf_lb_addr_t;\n\n/** Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */\nstruct udf_short_ad_s\n{\n  udf_Uint32_t  len;\n  udf_Uint32_t  pos;\n} GNUC_PACKED;\n\ntypedef struct udf_short_ad_s udf_short_ad_t;\n\n/** Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */\nstruct udf_long_ad_s\n{\n  udf_Uint32_t  len;\n  udf_lb_addr_t loc;\n  udf_Uint8_t   imp_use[6];\n} GNUC_PACKED;\n\ntypedef struct udf_long_ad_s udf_long_ad_t;\n\n/** Logical Volume Descriptor (ECMA 167r3 3/10.6) */\nstruct logical_vol_desc_s\n{\n  udf_tag_t       tag;\n  udf_Uint32_t    seq_num;\n  udf_charspec_t  desc_charset;\n  udf_dstring     logvol_id[128];\n  udf_Uint32_t    logical_blocksize;\n  udf_regid_t     domain_id;\n  union {\n    udf_long_ad_t fsd_loc;\n    udf_Uint8_t   logvol_content_use[16];\n  } lvd_use;\n  udf_Uint8_t     logvol_contents_use[16];\n  udf_Uint32_t    maptable_len;\n  udf_Uint32_t    i_partition_maps;\n  udf_regid_t     imp_id;\n  udf_Uint8_t     imp_use[128];\n  udf_extent_ad_t integrity_seq_ext;\n  udf_Uint8_t     partition_maps[0];\n} GNUC_PACKED;\n\ntypedef struct logical_vol_desc_s logical_vol_desc_t;\n\n/** Generic Partition Map (ECMA 167r3 3/10.7.1) */\nstruct generic_partition_map\n{\n  udf_Uint8_t   partition_map_type;\n  udf_Uint8_t   partition_map_length;\n  udf_Uint8_t   partition_mapping[0];\n} GNUC_PACKED;\n\n/** Partition Map Type (ECMA 167r3 3/10.7.1.1) */\n#define GP_PARTITION_MAP_TYPE_UNDEF     0x00\n#define GP_PARTIITON_MAP_TYPE_1         0x01\n#define GP_PARTITION_MAP_TYPE_2         0x02\n\n/** Type 1 Partition Map (ECMA 167r3 3/10.7.2) */\nstruct generic_partition_map1\n{\n  udf_Uint8_t   partition_map_type;\n  udf_Uint8_t   partition_map_length;\n  udf_Uint16_t  vol_seq_num;\n  udf_Uint16_t  i_partition;\n} GNUC_PACKED;\n\n/** Type 2 Partition Map (ECMA 167r3 3/10.7.3) */\nstruct generic_partition_map2\n{\n  udf_Uint8_t   partition_map_type;\n  udf_Uint8_t   partition_map_length;\n  udf_Uint8_t   partition_id[62];\n} GNUC_PACKED;\n\n/** Unallocated Space Descriptor (ECMA 167r3 3/10.8) */\nstruct unalloc_space_desc_s\n{\n  udf_tag_t       tag;\n  udf_Uint32_t    vol_desc_seq_num;\n  udf_Uint32_t    u_alloc_descs;\n  udf_extent_ad_t allocDescs[0];\n} GNUC_PACKED;\n\n/** Terminating Descriptor (ECMA 167r3 3/10.9) */\nstruct terminating_desc_s\n{\n  udf_tag_t    tag;\n  udf_Uint8_t   reserved[496];\n} GNUC_PACKED;\n\n/** Logical Volume Integrity Descriptor (ECMA 167r3 3/10.10) */\nstruct logvol_integrity_desc_s\n{\n  udf_tag_t       tag;\n  udf_timestamp_t recording_time;\n  udf_Uint32_t    integrity_type;\n  udf_extent_ad_t next_integrity_ext;\n  udf_Uint8_t     logvol_contents_use[32];\n  udf_Uint32_t    i_partitions;\n  union { /* Same MSVC workaround as with struct udf_fileid_desc_s */\n    udf_Uint32_t  imp_use_len;\n    struct {\n      udf_Uint32_t unused;\n      udf_Uint32_t data[0];\n    } freespace_table;\n    struct {\n      udf_Uint32_t unused;\n      udf_Uint32_t data[0];\n    } size_table;\n    struct {\n      udf_Uint32_t unused;\n      udf_Uint32_t data[0];\n    } imp_use;\n  } u;\n} GNUC_PACKED;\n\n/** Integrity Type (ECMA 167r3 3/10.10.3) */\n#define LVID_INTEGRITY_TYPE_OPEN        0x00000000\n#define LVID_INTEGRITY_TYPE_CLOSE       0x00000001\n\n/** Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */\nstruct udf_ext_ad_s\n{\n  udf_Uint32_t  len;\n  udf_Uint32_t  recorded_len;\n  udf_Uint32_t  information_len;\n  udf_lb_addr_t ext_loc;\n} GNUC_PACKED;\n\ntypedef struct udf_ext_ad_s udf_ext_ad_t;\n\n/** Descriptor Tag (ECMA 167r3 4/7.2 - See 3/7.2) */\n\n/** Tag Identifier (ECMA 167r3 4/7.2.1) */\n\n/** File Set Descriptor (ECMA 167r3 4/14.1) */\nstruct udf_fsd_s\n{\n  udf_tag_t       tag;\n  udf_timestamp_t recording_time;\n  udf_Uint16_t    interchange_lvl;\n  udf_Uint16_t    maxInterchange_lvl;\n  udf_Uint32_t    charset_list;\n  udf_Uint32_t    max_charset_list;\n  udf_Uint32_t    fileset_num;\n  udf_Uint32_t    udf_fsd_num;\n  udf_charspec_t  logical_vol_id_charset;\n  udf_dstring     logical_vol_id[128];\n  udf_charspec_t  fileset_charset;\n  udf_dstring     fileSet_id[32];\n  udf_dstring     copyright_file_id[32];\n  udf_dstring     abstract_file_id[32];\n  udf_long_ad_t   root_icb;\n  udf_regid_t     domain_id;\n  udf_long_ad_t   next_ext;\n  udf_long_ad_t   stream_directory_ICB;\n  udf_Uint8_t     reserved[32];\n} GNUC_PACKED;\n\ntypedef struct udf_fsd_s udf_fsd_t;\n\n/** Partition Header Descriptor (ECMA 167r3 4/14.3) */\nstruct partition_header_desc_s\n{\n  udf_short_ad_t unalloc_space_table;\n  udf_short_ad_t unalloc_space_bitmap;\n  udf_short_ad_t partition_integrity_table;\n  udf_short_ad_t freed_space_table;\n  udf_short_ad_t freed_space_bitmap;\n  udf_Uint8_t    reserved[88];\n} GNUC_PACKED;\n\ntypedef struct partition_header_desc_s partition_header_desc_t;\n\n/** File Identifier Descriptor (ECMA 167r3 4/14.4) */\nstruct udf_fileid_desc_s\n{\n  udf_tag_t     tag;\n  udf_Uint16_t  file_version_num;\n  udf_Uint8_t   file_characteristics;\n  udf_Uint8_t   i_file_id;\n  udf_long_ad_t icb;\n  /* MSVC workaround for multiple zero sized arrays\n     Unlike what is the case with GNU, and against logic, an union of zero\n     sized arrays in the Microsoft world is not zero bytes but one byte!\n     Thus, for sizeof() to be consistent across platforms, we must use an\n     ugly workaround that attaches the union to the last non-zero member. */\n  union {\n    udf_Uint16_t        i_imp_use;\n    struct {\n      udf_Uint16_t      unused;\n      udf_Uint8_t       data[0];\n    } imp_use;\n    struct {\n      udf_Uint16_t      unused;\n      udf_Uint8_t       data[0];\n    } file_id;\n    struct {\n      udf_Uint16_t      unused;\n      udf_Uint8_t       data[0];\n    } padding;\n  } u;\n} GNUC_PACKED;\n\ntypedef struct udf_fileid_desc_s udf_fileid_desc_t;\n\n/** File Characteristics (ECMA 167r3 4/14.4.3)\n\n    Imagine the below enumeration values are \\#defines to be used in a\n    bitmask rather than distinct values of an enum.\n*/\ntypedef enum {\n  UDF_FILE_HIDDEN       = (1 << 0),\n  UDF_FILE_DIRECTORY    = (1 << 1),\n  UDF_FILE_DELETED      = (1 << 2),\n  UDF_FILE_PARENT       = (1 << 3),\n  UDF_FILE_METADATA     = (1 << 4)\n} file_characteristics_t;\n\n/** Allocation Ext Descriptor (ECMA 167r3 4/14.5) */\nstruct allocExtDesc\n{\n  udf_tag_t    tag;\n  udf_Uint32_t previous_alloc_ext_loc;\n  udf_Uint32_t u_alloc_descs;\n} GNUC_PACKED;\n\n/** ICB Tag (ECMA 167r3 4/14.6) */\nstruct udf_icbtag_s\n{\n  udf_Uint32_t  prev_num_dirs;\n  udf_Uint16_t  strat_type;\n  udf_Uint16_t  strat_param;\n  udf_Uint16_t  max_num_entries;\n  udf_Uint8_t   reserved;\n  udf_Uint8_t   file_type;\n  udf_lb_addr_t parent_ICB;\n  udf_Uint16_t  flags;\n} GNUC_PACKED;\n\ntypedef struct udf_icbtag_s udf_icbtag_t;\n\n#define UDF_ICB_TAG_FLAGS_SETUID        0x40\n#define UDF_ICB_TAG_FLAGS_SETGID        0x80\n#define UDF_ICB_TAG_FLAGS_STICKY        0x100\n\n/** Strategy Type (ECMA 167r3 4/14.6.2) which helpfully points\n    largely to 4/A.x */\n#define ICBTAG_STRATEGY_TYPE_UNDEF 0x0000\n#define ICBTAG_STRATEGY_TYPE_1     0x0001 /**< 4/A.2 Direct entries Uint16 */\n#define ICBTAG_STRATEGY_TYPE_2     0x0002 /**< 4/A.3 List of ICB direct entries */\n#define ICBTAG_STRATEGY_TYPE_3     0x0003 /**< 4/A.4 */\n#define ICBTAG_STRATEGY_TYPE_4     0x0004 /**< 4/A.5 Hierarchy having one\n                                           single ICB with one direct entry.\n                                           This is what's most often used.\n                                          */\n\n/** File Type (ECMA 167r3 4/14.6.6)\n\n   Imagine the below enum values as \\#define'd values rather than\n   distinct values of an enum.\n*/\ntypedef enum {\n  ICBTAG_FILE_TYPE_UNDEF =      0x00,\n  ICBTAG_FILE_TYPE_USE =        0x01,\n  ICBTAG_FILE_TYPE_PIE =        0x02,\n  ICBTAG_FILE_TYPE_IE =         0x03,\n  ICBTAG_FILE_TYPE_DIRECTORY =  0x04,\n  ICBTAG_FILE_TYPE_REGULAR =    0x05,\n  ICBTAG_FILE_TYPE_BLOCK =      0x06,\n  ICBTAG_FILE_TYPE_CHAR =       0x07,\n  ICBTAG_FILE_TYPE_EA =         0x08,\n  ICBTAG_FILE_TYPE_FIFO =       0x09,\n  ICBTAG_FILE_TYPE_SOCKET =     0x0A,\n  ICBTAG_FILE_TYPE_TE =         0x0B,\n  ICBTAG_FILE_TYPE_SYMLINK =    0x0C,\n  ICBTAG_FILE_TYPE_STREAMDIR =  0x0D\n} icbtag_file_type_enum_t;\n\n/** Flags (ECMA 167r3 4/14.6.8) */\ntypedef enum {\n  ICBTAG_FLAG_AD_MASK        =  0x0007, /**< \"&\" this to get below address\n                                             flags */\n  ICBTAG_FLAG_AD_SHORT       =  0x0000, /**< The allocation descriptor\n                                             field is filled with\n                                             short_ad's.  If the\n                                             offset is beyond the\n                                             current extent, look for\n                                             the next extent. */\n  ICBTAG_FLAG_AD_LONG        =  0x0001, /**< The allocation descriptor\n                                             field is filled with\n                                             long_ad's If the offset\n                                             is beyond the current\n                                             extent, look for the next\n                                             extent. */\n  ICBTAG_FLAG_AD_EXTENDED    =  0x0002,\n  ICBTAG_FLAG_AD_IN_ICB      =  0x0003, /**< This type means that the\n                                             file *data* is stored in\n                                             the allocation descriptor\n                                             field of the file entry. */\n  ICBTAG_FLAG_SORTED         =  0x0008,\n  ICBTAG_FLAG_NONRELOCATABLE =  0x0010,\n  ICBTAG_FLAG_ARCHIVE        =  0x0020,\n  ICBTAG_FLAG_SETUID         =  0x0040,\n  ICBTAG_FLAG_SETGID         =  0x0080,\n  ICBTAG_FLAG_STICKY         =  0x0100,\n  ICBTAG_FLAG_CONTIGUOUS     =  0x0200,\n  ICBTAG_FLAG_SYSTEM         =  0x0400,\n  ICBTAG_FLAG_TRANSFORMED    =  0x0800,\n  ICBTAG_FLAG_MULTIVERSIONS  =  0x1000,\n  ICBTAG_FLAG_STREAM =          0x2000\n} icbtag_flag_enum_t;\n\n/** Indirect Entry (ECMA 167r3 4/14.7) */\nstruct indirect_entry_s\n{\n  udf_tag_t       tag;\n  udf_icbtag_t    icb_tag;\n  udf_long_ad_t   indirect_ICB;\n} GNUC_PACKED;\n\n/** Terminal Entry (ECMA 167r3 4/14.8) */\nstruct terminal_entry_s\n{\n  udf_tag_t       tag;\n  udf_icbtag_t    icb_tag;\n} GNUC_PACKED;\n\n/** File Entry (ECMA 167r3 4/14.9) */\nstruct udf_file_entry_s\n{\n  udf_tag_t       tag;\n  udf_icbtag_t    icb_tag;                /**< 4/14.9.2 */\n  udf_Uint32_t    uid;                    /**< 4/14.9.3 */\n  udf_Uint32_t    gid;                    /**< 4/14.9.4 */\n  udf_Uint32_t    permissions;            /**< 4/14.9.5 */\n  udf_Uint16_t    link_count;             /**< 4/14.9.6 */\n  udf_Uint8_t     rec_format;             /**< 4/14.9.7 */\n  udf_Uint8_t     rec_disp_attr;          /**< 4/14.9.8 */\n  udf_Uint32_t    rec_len;                /**< 4/14.9.9 */\n  udf_Uint64_t    info_len;               /**< 4/14.9.10 */\n  udf_Uint64_t    logblks_recorded;       /**< 4/14.9.11 */\n  udf_timestamp_t access_time;            /**< 4/14.9.12 - last access to\n                                           any stream of file prior to\n                                           recording file entry */\n  udf_timestamp_t modification_time;      /**< 4/14.9.13 - last access to\n                                             modification to any stream of\n                                             file */\n  udf_timestamp_t attribute_time;\n  udf_Uint32_t    checkpoint;\n  udf_long_ad_t   ext_attr_ICB;\n  udf_regid_t     imp_id;\n  udf_Uint64_t    unique_ID;\n  udf_Uint32_t    u_extended_attr;\n  udf_Uint32_t    u_alloc_descs;\n  /* The following union allows file entry reuse without worrying\n     about overflows, by ensuring the struct is always the\n     maximum possible size allowed by the specs: one UDF block. */\n  union {\n    udf_Uint8_t   ext_attr[0];\n    udf_Uint8_t   alloc_descs[0];\n    udf_Uint8_t   pad_to_one_block[2048-176];\n  } u;\n} GNUC_PACKED;\n\ntypedef struct udf_file_entry_s udf_file_entry_t;\n\n#define UDF_FENTRY_SIZE 176\n#define UDF_FENTRY_PERM_USER_MASK       0x07\n#define UDF_FENTRY_PERM_GRP_MASK        0xE0\n#define UDF_FENTRY_PERM_OWNER_MASK      0x1C00\n\n/** Permissions (ECMA 167r3 4/14.9.5) */\n#define FE_PERM_O_EXEC                  0x00000001U\n#define FE_PERM_O_WRITE                 0x00000002U\n#define FE_PERM_O_READ                  0x00000004U\n#define FE_PERM_O_CHATTR                0x00000008U\n#define FE_PERM_O_DELETE                0x00000010U\n#define FE_PERM_G_EXEC                  0x00000020U\n#define FE_PERM_G_WRITE                 0x00000040U\n#define FE_PERM_G_READ                  0x00000080U\n#define FE_PERM_G_CHATTR                0x00000100U\n#define FE_PERM_G_DELETE                0x00000200U\n#define FE_PERM_U_EXEC                  0x00000400U\n#define FE_PERM_U_WRITE                 0x00000800U\n#define FE_PERM_U_READ                  0x00001000U\n#define FE_PERM_U_CHATTR                0x00002000U\n#define FE_PERM_U_DELETE                0x00004000U\n\n/** Record Format (ECMA 167r3 4/14.9.7) */\n#define FE_RECORD_FMT_UNDEF             0x00\n#define FE_RECORD_FMT_FIXED_PAD         0x01\n#define FE_RECORD_FMT_FIXED             0x02\n#define FE_RECORD_FMT_VARIABLE8         0x03\n#define FE_RECORD_FMT_VARIABLE16        0x04\n#define FE_RECORD_FMT_VARIABLE16_MSB    0x05\n#define FE_RECORD_FMT_VARIABLE32        0x06\n#define FE_RECORD_FMT_PRINT             0x07\n#define FE_RECORD_FMT_LF                0x08\n#define FE_RECORD_FMT_CR                0x09\n#define FE_RECORD_FMT_CRLF              0x0A\n#define FE_RECORD_FMT_LFCR              0x0B\n\n/** Record Display Attributes (ECMA 167r3 4/14.9.8) */\n#define FE_RECORD_DISPLAY_ATTR_UNDEF    0x00\n#define FE_RECORD_DISPLAY_ATTR_1        0x01\n#define FE_RECORD_DISPLAY_ATTR_2        0x02\n#define FE_RECORD_DISPLAY_ATTR_3        0x03\n\n/** Extended Attribute Header Descriptor (ECMA 167r3 4/14.10.1) */\nstruct extended_attr_header_desc_s\n{\n  udf_tag_t       tag;\n  udf_Uint32_t    imp_attr_location;\n  udf_Uint32_t    app_attr_location;\n} GNUC_PACKED;\n\n/** Generic Format (ECMA 167r3 4/14.10.2) */\nstruct generic_format_s\n{\n  udf_Uint32_t  attr_type;\n  udf_Uint8_t   attr_subtype;\n  udf_Uint8_t   reserved[3];\n  udf_Uint32_t  attrLength;\n  udf_Uint8_t   attrData[0];\n} GNUC_PACKED;\n\n/** Character Set Information (ECMA 167r3 4/14.10.3) */\nstruct charSet_info_s\n{\n  udf_Uint32_t  attr_type;\n  udf_Uint8_t   attr_subtype;\n  udf_Uint8_t   reserved[3];\n  udf_Uint32_t  attrLength;\n  udf_Uint32_t  escapeSeqLength;\n  udf_Uint8_t   charSetType;\n  udf_Uint8_t   escapeSeq[0];\n} GNUC_PACKED;\n\n/* Alternate Permissions (ECMA 167r3 4/14.10.4) */\nstruct alt_perms_s\n{\n  udf_Uint32_t  attr_type;\n  udf_Uint8_t   attr_subtype;\n  udf_Uint8_t   reserved[3];\n  udf_Uint32_t  attrLength;\n  udf_Uint16_t  owner_id;\n  udf_Uint16_t  group_id;\n  udf_Uint16_t  permission;\n} GNUC_PACKED;\n\n/** File Times Extended Attribute (ECMA 167r3 4/14.10.5) */\nstruct filetimes_ext_attr_s\n{\n  udf_Uint32_t  attr_type;\n  udf_Uint8_t   attr_subtype;\n  udf_Uint8_t   reserved[3];\n  udf_Uint32_t  attrLength;\n  udf_Uint32_t  dataLength;\n  udf_Uint32_t  fileTimeExistence;\n  udf_Uint8_t   fileTimes;\n} GNUC_PACKED;\n\n/** FileTimeExistence (ECMA 167r3 4/14.10.5.6) */\n#define FTE_CREATION                    0x00000001\n#define FTE_DELETION                    0x00000004\n#define FTE_EFFECTIVE                   0x00000008\n#define FTE_BACKUP                      0x00000002\n\n/** Information Times Extended Attribute (ECMA 167r3 4/14.10.6) */\nstruct infoTimesExtAttr\n{\n  udf_Uint32_t  attr_type;\n  udf_Uint8_t   attr_subtype;\n  udf_Uint8_t   reserved[3];\n  udf_Uint32_t  attrLength;\n  udf_Uint32_t  dataLength;\n  udf_Uint32_t  infoTimeExistence;\n  udf_Uint8_t   infoTimes[0];\n} GNUC_PACKED;\n\n/** Device Specification (ECMA 167r3 4/14.10.7) */\nstruct deviceSpec\n{\n  udf_Uint32_t  attr_type;\n  udf_Uint8_t   attr_subtype;\n  udf_Uint8_t   reserved[3];\n  udf_Uint32_t  attrLength;\n  udf_Uint32_t  imp_useLength;\n  udf_Uint32_t  majorDevice_id;\n  udf_Uint32_t  minorDevice_id;\n  udf_Uint8_t   imp_use[0];\n} GNUC_PACKED;\n\n/** Implementation Use Extended Attr (ECMA 167r3 4/14.10.8) */\nstruct impUseExtAttr\n{\n  udf_Uint32_t  attr_type;\n  udf_Uint8_t   attr_subtype;\n  udf_Uint8_t   reserved[3];\n  udf_Uint32_t  attrLength;\n  udf_Uint32_t  imp_useLength;\n  udf_regid_t   imp_id;\n  udf_Uint8_t   imp_use[0];\n} GNUC_PACKED;\n\n/** Application Use Extended Attribute (ECMA 167r3 4/14.10.9) */\nstruct appUseExtAttr\n{\n  udf_Uint32_t  attr_type;\n  udf_Uint8_t   attr_subtype;\n  udf_Uint8_t   reserved[3];\n  udf_Uint32_t  attrLength;\n  udf_Uint32_t  appUseLength;\n  udf_regid_t   app_id;\n  udf_Uint8_t   appUse[0];\n} GNUC_PACKED;\n\n#define EXTATTR_CHAR_SET                1\n#define EXTATTR_ALT_PERMS               3\n#define EXTATTR_FILE_TIMES              5\n#define EXTATTR_INFO_TIMES              6\n#define EXTATTR_DEV_SPEC                12\n#define EXTATTR_IMP_USE                 2048\n#define EXTATTR_APP_USE                 65536\n\n\n/** Unallocated Space Entry (ECMA 167r3 4/14.11) */\nstruct unallocSpaceEntry\n{\n  udf_tag_t     tag;\n  udf_icbtag_t  icb_tag;\n  udf_Uint32_t  lengthAllocDescs;\n  udf_Uint8_t   allocDescs[0];\n} GNUC_PACKED;\n\n/** Space Bitmap Descriptor (ECMA 167r3 4/14.12) */\nstruct spaceBitmapDesc\n{\n  udf_tag_t     tag;\n  udf_Uint32_t  i_bits;\n  udf_Uint32_t  i_bytes;\n  udf_Uint8_t   bitmap[0];\n} GNUC_PACKED;\n\n/** Partition Integrity Entry (ECMA 167r3 4/14.13) */\nstruct partitionIntegrityEntry\n{\n  udf_tag_t       tag;\n  udf_icbtag_t    icb_tag;\n  udf_timestamp_t recording_time;\n  udf_Uint8_t     integrityType;\n  udf_Uint8_t     reserved[175];\n  udf_regid_t     imp_id;\n  udf_Uint8_t     imp_use[256];\n} GNUC_PACKED;\n\n/** Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */\n\n/** Extent Length (ECMA 167r3 4/14.14.1.1) */\n#define EXT_RECORDED_ALLOCATED          0x00000000\n#define EXT_NOT_RECORDED_ALLOCATED      0x40000000\n#define EXT_NOT_RECORDED_NOT_ALLOCATED  0x80000000\n#define EXT_NEXT_EXTENT_ALLOCDECS       0xC0000000\n\n/** Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */\n\n/** Extended Allocation Descriptor (ECMA 167r3 4/14.14.3) */\n\n/** Logical Volume Header Descriptor (ECMA 167r3 4/14.15) */\nstruct logical_vol_header_desc_s\n{\n  udf_Uint64_t  uniqueID;\n  udf_Uint8_t   reserved[24];\n} GNUC_PACKED;\n\ntypedef struct logical_vol_header_desc_s logical_vol_header_desc_t;\n\n/** Path Component (ECMA 167r3 4/14.16.1) */\nstruct pathComponent\n{\n  udf_Uint8_t   component_type;\n  udf_Uint8_t   lengthComponent_id;\n  udf_Uint16_t  componentFileVersionNum;\n  udf_dstring   component_id[0];\n} GNUC_PACKED;\n\n/** File Entry (ECMA 167r3 4/14.17) */\nstruct extended_file_entry\n{\n  udf_tag_t       tag;                     /**< 4/14.17.1 - id = 266  */\n  udf_icbtag_t    icb_tag;                 /**< 4/14.17.2  & 4/14.9.2 */\n  udf_Uint32_t    uid;                     /**< 4/14.17.3  & 4/14.9.3 */\n  udf_Uint32_t    gid;                     /**< 4/14.17.4  & 4/14.9.4 */\n  udf_Uint32_t    permissions;             /**< 4/14.17.5  & 4/14.9.5 */\n  udf_Uint16_t    link_count;              /**< 4/14.17.6  & 4/14.9.6 */\n  udf_Uint8_t     rec_format;              /**< 4/14.17.7  & 4/14.9.7 */\n  udf_Uint8_t     rec_display_attr;        /**< 4/14.17.8  & 4/14.9.8 */\n  udf_Uint32_t    record_len;              /**< 4/14.17.9  & 4/14.9.9 */\n  udf_Uint64_t    info_len;                /**< 4/14.17.10 & 4/14.9.10 */\n  udf_Uint64_t    object_size;             /**< 4/14.17.11 */\n  udf_Uint64_t    logblks_recorded;        /**< 4/14.17.12 & 4/14.9.11 */\n  udf_timestamp_t access_time;             /**< 4/14.17.13 & 4/14.9.12 - last\n                                              access to any stream of file */\n  udf_timestamp_t modification_time;       /**< 4/14.17.14 & 4/14.9.13 - last\n                                              modification to any stream of\n                                              file*/\n  udf_timestamp_t create_time;             /**< 4/14.17.15 */\n  udf_timestamp_t attribute_time;          /**< 4/14.17.16 & 4/14.9.14 -\n                                              most recent create or modify\n                                              time */\n  udf_Uint32_t    checkpoint;\n  udf_Uint32_t    reserved;                /**< #00 bytes */\n  udf_long_ad_t   ext_attr_ICB;\n  udf_long_ad_t   stream_directory_ICB;\n  udf_regid_t     imp_id;\n  udf_Uint64_t    unique_ID;\n  udf_Uint32_t    length_extended_attr;\n  udf_Uint32_t    length_alloc_descs;\n  union { /* MSVC workaround for multiple zero sized arrays */\n    udf_Uint8_t   ext_attr[0];\n    udf_Uint8_t   alloc_descs[0];\n        udf_Uint8_t       pad_to_one_block[2048-216];\n  } u;\n} GNUC_PACKED;\n\nPRAGMA_END_PACKED\n\n/** The below variables are trickery to force the above enum symbol\n    values to be recorded in debug symbol tables. They are used to\n    allow one refer to the enumeration value names in the typedefs\n    above in a debugger and in debugger expressions.\n*/\nextern tag_id_t                 debug_tagid;\nextern file_characteristics_t   debug_file_characteristics;\nextern icbtag_file_type_enum_t  debug_icbtag_file_type_enum;\nextern icbtag_flag_enum_t       debug_flag_enum;\nextern ecma_167_enum1_t         debug_ecma_167_enum1;\nextern ecma_167_timezone_enum_t debug_ecma_167_timezone_enum;\n\n#endif /* CDIO_ECMA_167_H */\n"
  },
  {
    "path": "src/libcdio/cdio/iso9660.h",
    "content": "/*\n    Copyright (C) 2003-2008, 2012-2013, 2017, 2023-2024\n                  Rocky Bernstein <rocky@gnu.org>\n    Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n    See also iso9660.h by Eric Youngdale (1993).\n\n    Copyright 1993 Yggdrasil Computing, Incorporated\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/*!\n * \\file iso9660.h\n *\n * \\brief The top-level interface header for libiso9660: the ISO-9660\n * filesystem library; applications include this.\n *\n * See also the ISO-9660 specification. The freely available European\n * equivalent standard is called ECMA-119.\n*/\n\n\f\n#ifndef CDIO_ISO9660_H_\n#define CDIO_ISO9660_H_\n\n#include <time.h>\n\n#include <cdio/cdio.h>\n#include <cdio/ds.h>\n#include <cdio/posix.h>\n\n/** \\brief ISO 9660 Integer and Character types\n\nThese are described in the section 7 of the ISO 9660 (or ECMA 119)\nspecification.\n*/\n\ntypedef uint8_t  iso711_t; /*! See section 7.1.1 */\ntypedef int8_t   iso712_t; /*! See section 7.1.2 */\ntypedef uint16_t iso721_t; /*! See section 7.2.1 */\ntypedef uint16_t iso722_t; /*! See section 7.2.2 */\ntypedef uint32_t iso723_t; /*! See section 7.2.3 */\ntypedef uint32_t iso731_t; /*! See section 7.3.1 */\ntypedef uint32_t iso732_t; /*! See section 7.3.2 */\ntypedef uint64_t iso733_t; /*! See section 7.3.3 */\n\ntypedef char     achar_t;  /*! See section 7.4.1 */\ntypedef char     dchar_t;  /*! See section 7.4.1 */\n\n#ifndef EMPTY_ARRAY_SIZE\n#define EMPTY_ARRAY_SIZE 0\n#endif\n\n#include <cdio/types.h>\n#include <cdio/xa.h>\n\n#ifdef ISODCL\n#undef ISODCL\n#endif\n/* This part borrowed from the bsd386 isofs */\n#define ISODCL(from, to)        ((to) - (from) + 1)\n\n#define MIN_TRACK_SIZE 4*75\n#define MIN_ISO_SIZE MIN_TRACK_SIZE\n\n/*! The below isn't really an enumeration one would really use in a\n    program; things are done this way so that in a debugger one can to\n    refer to the enumeration value names such as in a debugger\n    expression and get something. With the more common a \\#define\n    mechanism, the name/value association is lost at run time.\n  */\nextern enum iso_enum1_s {\n  ISO_PVD_SECTOR      =   16, /**< Sector of Primary Volume Descriptor. */\n  ISO_EVD_SECTOR      =   17, /**< Sector of End Volume Descriptor. */\n  LEN_ISONAME         =   31, /**< Size in bytes of the filename\n                                 portion + null byte. */\n  ISO_MAX_SYSTEM_ID   =   32, /**< Maximum number of characters in a system\n                                 id. */\n  MAX_ISONAME         =   37, /**< Size in bytes of the filename\n                                 portion + null byte. */\n  ISO_MAX_PREPARER_ID =  128, /**< Maximum number of characters in a\n                                 preparer id. */\n  MAX_ISOPATHNAME     =  255, /**< Maximum number of characters in the\n                                 entire ISO 9660 filename. */\n  ISO_BLOCKSIZE       = 2048, /**< Number of bytes in an ISO 9660 block. */\n  VIRTUAL_SECTORSIZE  =  512  /**< Number of bytes in an El Torito virtual\n                                   image sector */\n} iso_enums1;\n\n/*! An enumeration for some of the ISO_* \\#defines below. This isn't\n    really an enumeration one would really use in a program it is here\n    to be helpful in debuggers where wants just to refer to the\n    ISO_*_ names and get something.\n  */\n\n/*! ISO 9660 directory flags. */\nextern enum iso_flag_enum_s {\n  ISO_FILE            =   0,   /**<  Not really a flag...                */\n  ISO_EXISTENCE       =   1,   /**< Do not make existence known (hidden) */\n  ISO_DIRECTORY       =   2,   /**< This file is a directory             */\n  ISO_ASSOCIATED      =   4,   /**< This file is an associated file      */\n  ISO_RECORD          =   8,   /**< Record format in extended attr. != 0 */\n  ISO_PROTECTION      =  16,   /**< No read/execute perm. in ext. attr.  */\n  ISO_DRESERVED1      =  32,   /**<, Reserved bit 5                      */\n  ISO_DRESERVED2      =  64,   /**<, Reserved bit 6                      */\n  ISO_MULTIEXTENT     = 128,   /**< Not final entry of a mult. ext. file */\n} iso_flag_enums;\n\n/*! Volume descriptor types */\nextern enum iso_vd_enum_s {\n  ISO_VD_BOOT_RECORD   =  0,  /**< CD is bootable */\n  ISO_VD_PRIMARY       =  1,  /**< Is in any ISO-9660 */\n  ISO_VD_SUPPLEMENTARY =  2,  /**< Used by Joliet, for example */\n  ISO_VD_PARITION      =  3,  /**< Indicates a partition of a CD */\n  ISO_VD_END           = 255\n} iso_vd_enums;\n\n\n/*!\n   An ISO filename is:\n   <em>abcd</em>.<em>eee</em> ->\n   <em>filename</em>.<em>ext</em>;<em>version#</em>\n\n    For ISO-9660 Level 1, the maximum needed string length is:\n\n@code\n         30 chars (filename + ext)\n    +     2 chars ('.' + ';')\n    +     5 chars (strlen(\"32767\"))\n    +     1 null byte\n   ================================\n    =    38 chars\n@endcode\n\n*/\n\n/*! \\brief Maximum number of characters in a publisher id. */\n#define ISO_MAX_PUBLISHER_ID 128\n\n/*! \\brief Maximum number of characters in an application id. */\n#define ISO_MAX_APPLICATION_ID 128\n\n/*! \\brief Maximum number of characters in a volume id. */\n#define ISO_MAX_VOLUME_ID 32\n\n/*! \\brief Maximum number of characters in a volume-set id. */\n#define ISO_MAX_VOLUMESET_ID 128\n\n/*! String inside frame which identifies an ISO 9660 filesystem. This\n    string is the \"id\" field of an iso9660_pvd_t or an iso9660_svd_t.\n*/\nextern const char ISO_STANDARD_ID[sizeof(\"CD001\")-1];\n\n#define ISO_STANDARD_ID      \"CD001\"\n#define EL_TORITO_ID         \"EL TORITO SPECIFICATION\\0\\0\\0\\0\\0\\0\\0\\0\\0\"\n\n#define CDIO_EXTENT_BLOCKS(size) ((size + (ISO_BLOCKSIZE - 1)) / ISO_BLOCKSIZE)\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\ntypedef enum strncpy_pad_check {\n  ISO9660_NOCHECK = 0,\n  ISO9660_7BIT,\n  ISO9660_ACHARS,\n  ISO9660_DCHARS\n} strncpy_pad_check_t;\n\nPRAGMA_BEGIN_PACKED\n\n/*!\n  \\brief ISO-9660 shorter-format time structure. See ECMA 9.1.5.\n\n  @see iso9660_dtime\n */\nstruct  iso9660_dtime_s {\n  iso711_t      dt_year;   /**< Number of years since 1900 */\n  iso711_t      dt_month;  /**< Has value in range 1..12. Note starts\n                              at 1, not 0 like a tm struct. */\n  iso711_t      dt_day;    /**< Day of the month from 1 to 31 */\n  iso711_t      dt_hour;   /**< Hour of the day from 0 to 23 */\n  iso711_t      dt_minute; /**< Minute of the hour from 0 to 59 */\n  iso711_t      dt_second; /**< Second of the minute from 0 to 59 */\n  iso712_t      dt_gmtoff; /**< GMT values -48 .. + 52 in 15 minute\n                              intervals */\n} GNUC_PACKED;\n\ntypedef struct iso9660_dtime_s  iso9660_dtime_t;\n\n/*!\n  \\brief ISO-9660 longer-format time structure.\n\n  Section 8.4.26.1 of ECMA 119. All values are encoded as character\n  arrays, eg. '1', '9', '5', '5' for the year 1955 (no null terminated\n  byte).\n\n  @see iso9660_ltime\n */\nstruct  iso9660_ltime_s {\n  char   lt_year        [ISODCL(   1,   4)];   /**< Add 1900 to value\n                                                    for the Julian\n                                                    year */\n  char   lt_month       [ISODCL(   5,   6)];   /**< Has value in range\n                                                  1..12. Note starts\n                                                  at 1, not 0 like a\n                                                  tm struct. */\n  char   lt_day         [ISODCL(   7,   8)];   /**< Day of month: 1..31 */\n  char   lt_hour        [ISODCL(   9,   10)];  /**< hour: 0..23 */\n  char   lt_minute      [ISODCL(  11,   12)];  /**< minute: 0..59 */\n  char   lt_second      [ISODCL(  13,   14)];  /**< second: 0..59 */\n  char   lt_hsecond     [ISODCL(  15,   16)];  /**< The value is in\n                                                  units of 1/100's of\n                                                  a second */\n  iso712_t lt_gmtoff;  /**< Offset from Greenwich Mean Time in number\n                          of 15 min intervals from -48 (West) to +52\n                          (East) recorded according to 7.1.2 numerical\n                          value */\n} GNUC_PACKED;\n\ntypedef struct iso9660_ltime_s  iso9660_ltime_t;\ntypedef struct iso9660_dir_s    iso9660_dir_t;\ntypedef struct iso9660_stat_s   iso9660_stat_t;\n\n#include <cdio/rock.h>\n\n/*! \\brief Format of an ISO-9660 directory record\n\n Section 9.1 of ECMA 119.\n\n This structure may have an odd length depending on how many\n characters there are in the filename!  Some compilers (e.g. on\n Sun3/mc68020) pad the structures to an even length.  For this reason,\n we cannot use sizeof (struct iso_path_table) or sizeof (struct\n iso_directory_record) to compute on disk sizes.  Instead, we use\n offsetof(..., name) and add the name size.  See mkisofs.h of the\n cdrtools package.\n\n  @see iso9660_stat\n*/\nstruct iso9660_dir_s {\n  iso711_t         length;            /*! Length of Directory record (9.1.1) */\n  iso711_t         xa_length;         /*! XA length if XA is used. Otherwise\n                                          zero. (9.1.2)  */\n  iso733_t         extent;            /*! LBA of first local block allocated\n                                          to the extent */\n  iso733_t         size;              /*! data length of File Section. This\n                                          does not include the length of\n                                          any XA Records. (9.1.2) */\n  iso9660_dtime_t  recording_time;    /*! Recording date and time (9.1.3) */\n  uint8_t          file_flags;        /*! If no XA then zero. If a directory,\n                                        then bits 2,3 and 7 are zero.\n                                        (9.1.6) */\n  iso711_t         file_unit_size;    /*! File Unit size for the File\n                                        Section if the File Section\n                                        is recorded in interleaved\n                                        mode. Otherwise zero. (9.1.7) */\n  iso711_t         interleave_gap;    /*! Interleave Gap size for the\n                                        File Section if the File\n                                        Section is interleaved. Otherwise\n                                        zero. (9.1.8) */\n  iso723_t volume_sequence_number;    /*! Ordinal number of the volume\n                                          in the Volume Set on which\n                                          the Extent described by this\n                                          Directory Record is\n                                          recorded. (9.1.9) */\n/*! MSVC compilers cannot handle a zero sized array in the middle\n    of a struct, and iso9660_dir_s is reused within iso9660_pvd_s.\n    Therefore, instead of defining:\n       iso711_t filename_len;\n       char     filename[];\n    we leverage the fact that iso711_t and char are the same size\n    and use an union. The only gotcha is that the actual string\n    payload of filename.str[] starts at 1, not 0. */\n  union {\n    iso711_t        len;\n    char            str[1];\n  } filename;\n} GNUC_PACKED;\n\n/*!\n  \\brief ISO-9660 Primary Volume Descriptor.\n */\nstruct iso9660_pvd_s {\n  iso711_t         type;                         /**< ISO_VD_PRIMARY - 1 */\n  char             id[5];                        /**< ISO_STANDARD_ID \"CD001\"\n                                                  */\n  iso711_t         version;                      /**< value 1 for ECMA 119 */\n  char             unused1[1];                   /**< unused - value 0 */\n  achar_t          system_id[ISO_MAX_SYSTEM_ID]; /**< each char is an achar */\n  dchar_t          volume_id[ISO_MAX_VOLUME_ID]; /**< each char is a dchar */\n  uint8_t          unused2[8];                   /**< unused - value 0 */\n  iso733_t         volume_space_size;            /**< total number of\n                                                    sectors */\n  uint8_t          unused3[32];                  /**< unused - value 0 */\n  iso723_t         volume_set_size;              /**< often 1 */\n  iso723_t         volume_sequence_number;       /**< often 1 */\n  iso723_t         logical_block_size;           /**< sector size, e.g. 2048 */\n  iso733_t         path_table_size;              /**< bytes in path table */\n  iso731_t         type_l_path_table;            /**< first sector of L Path\n                                                      Table */\n  iso731_t         opt_type_l_path_table;        /**< first sector of optional\n                                                    L Path Table */\n  iso732_t         type_m_path_table;            /**< first sector of M Path\n                                                    table */\n  iso732_t         opt_type_m_path_table;        /**< first sector of optional\n                                                    M Path table */\n  iso9660_dir_t    root_directory_record;        /**< See 8.4.18 and\n                                                    section 9.1 of\n                                                    ISO 9660 spec. */\n  char             root_directory_filename;      /**< Is '\\\\0' or root\n                                                  directory. Also pads previous\n                                                  field to 34 bytes */\n  dchar_t          volume_set_id[ISO_MAX_VOLUMESET_ID]; /**< Volume Set of\n                                                           which the volume is\n                                                           a member. See\n                                                        section 8.4.19 */\n  achar_t          publisher_id[ISO_MAX_PUBLISHER_ID];  /**< Publisher of\n                                                         volume. If the first\n                                                         character is '_' 0x5F,\n                                                         the remaining bytes\n                                                         specify a file\n                                                         containing the user.\n                                                         If all bytes are \" \"\n                                                         (0x20) no publisher\n                                                         is specified. See\n                                                         section 8.4.20 of\n                                                         ECMA 119 */\n  achar_t          preparer_id[ISO_MAX_PREPARER_ID]; /**< preparer of\n                                                         volume. If the first\n                                                         character is '_' 0x5F,\n                                                         the remaining bytes\n                                                         specify a file\n                                                         containing the user.\n                                                         If all bytes are \" \"\n                                                         (0x20) no preparer\n                                                         is specified.\n                                                         See section 8.4.21\n                                                         of ECMA 119 */\n  achar_t          application_id[ISO_MAX_APPLICATION_ID]; /**< application\n                                                         use to create the\n                                                         volume. If the first\n                                                         character is '_' 0x5F,\n                                                         the remaining bytes\n                                                         specify a file\n                                                         containing the user.\n                                                         If all bytes are \" \"\n                                                         (0x20) no application\n                                                         is specified.\n                                                         See section of 8.4.22\n                                                         of ECMA 119 */\n  dchar_t          copyright_file_id[37];     /**< Name of file for\n                                                 copyright info. If\n                                                 all bytes are \" \"\n                                                 (0x20), then no file\n                                                 is identified.  See\n                                                 section 8.4.23 of ECMA 119\n                                                 9660 spec. */\n  dchar_t          abstract_file_id[37];      /**< See section 8.4.24 of\n                                                 ECMA 119. */\n  dchar_t          bibliographic_file_id[37]; /**< See section 7.5 of\n                                                 ISO 9660 spec. */\n  iso9660_ltime_t  creation_date;             /**< date and time of volume\n                                                 creation. See section 8.4.26.1\n                                                 of the ISO 9660 spec. */\n  iso9660_ltime_t  modification_date;         /**< date and time of the most\n                                                 recent modification.\n                                                 See section 8.4.27 of the\n                                                 ISO 9660 spec. */\n  iso9660_ltime_t  expiration_date;           /**< date and time when volume\n                                                 expires. See section 8.4.28\n                                                 of the ISO 9660 spec. */\n  iso9660_ltime_t  effective_date;            /**< date and time when volume\n                                                 is effective. See section\n                                                 8.4.29 of the ISO 9660\n                                                 spec. */\n  iso711_t         file_structure_version;    /**< value 1 for ECMA 119 */\n  uint8_t           unused4[1];                /**< unused - value 0 */\n  char             application_data[512];     /**< Application can put\n                                                 whatever it wants here. */\n  uint8_t          unused5[653];              /**< Unused - value 0 */\n} GNUC_PACKED;\n\ntypedef struct iso9660_pvd_s  iso9660_pvd_t;\n\n/*!\n  \\brief ISO-9660 Supplementary Volume Descriptor.\n\n  This is used for Joliet Extensions and is almost the same as the\n  the primary descriptor but two unused fields, \"unused1\" and \"unused3\n  become \"flags and \"escape_sequences\" respectively.\n*/\nstruct iso9660_svd_s {\n  iso711_t         type;                         /**< ISO_VD_SUPPLEMENTARY - 2\n                                                  */\n  char             id[5];                        /**< ISO_STANDARD_ID \"CD001\"\n                                                  */\n  iso711_t         version;                      /**< value 1 */\n  char             flags;                        /**< Section 8.5.3 */\n  achar_t          system_id[ISO_MAX_SYSTEM_ID]; /**< Section 8.5.4; each char\n                                                    is an achar */\n  dchar_t          volume_id[ISO_MAX_VOLUME_ID]; /**< Section 8.5.5; each char\n                                                    is a dchar */\n  char             unused2[8];\n  iso733_t         volume_space_size;            /**< total number of\n                                                    sectors */\n  char             escape_sequences[32];         /**< Section 8.5.6 */\n  iso723_t         volume_set_size;              /**< often 1 */\n  iso723_t         volume_sequence_number;       /**< often 1 */\n  iso723_t         logical_block_size;           /**< sector size, e.g. 2048 */\n  iso733_t         path_table_size;              /**< 8.5.7; bytes in path\n                                                    table */\n  iso731_t         type_l_path_table;            /**< 8.5.8; first sector of\n                                                    little-endian path table */\n  iso731_t         opt_type_l_path_table;        /**< 8.5.9; first sector of\n                                                    optional little-endian\n                                                    path table */\n  iso732_t         type_m_path_table;            /**< 8.5.10; first sector of\n                                                    big-endian path table */\n  iso732_t         opt_type_m_path_table;        /**< 8.5.11; first sector of\n                                                    optional big-endian path\n                                                    table */\n  iso9660_dir_t    root_directory_record;        /**< See section 8.5.12 and\n                                                    9.1 of ISO 9660 spec. */\n  char             root_directory_filename;      /**< Is '\\\\0' or root\n                                                  directory. Also pads previous\n                                                  field to 34 bytes */\n  dchar_t          volume_set_id[ISO_MAX_VOLUMESET_ID];    /**< 8.5.13;\n                                                              dchars */\n  achar_t          publisher_id[ISO_MAX_PUBLISHER_ID]; /**<\n                                                          Publisher of volume.\n                                                          If the first char-\n                                                          aracter is '_' 0x5F,\n                                                          the remaining bytes\n                                                          specify a file\n                                                          containing the user.\n                                                          If all bytes are \" \"\n                                                          (0x20) no publisher\n                                                          is specified. See\n                                                          section 8.5.14 of\n                                                          ECMA 119 */\n  achar_t          preparer_id[ISO_MAX_PREPARER_ID]; /**<\n                                                        Data preparer of\n                                                        volume. If the first\n                                                        character is '_' 0x5F,\n                                                        the remaining bytes\n                                                        specify a file\n                                                        containing the user.\n                                                        If all bytes are \" \"\n                                                        (0x20) no preparer\n                                                        is specified.\n                                                        See section 8.5.15\n                                                        of ECMA 119 */\n  achar_t          application_id[ISO_MAX_APPLICATION_ID]; /**< application\n                                                         use to create the\n                                                         volume. If the first\n                                                         character is '_' 0x5F,\n                                                         the remaining bytes\n                                                         specify a file\n                                                         containing the user.\n                                                         If all bytes are \" \"\n                                                         (0x20) no application\n                                                         is specified.\n                                                         See section of 8.5.16\n                                                         of ECMA 119 */\n  dchar_t          copyright_file_id[37];     /**< Name of file for\n                                                 copyright info. If\n                                                 all bytes are \" \"\n                                                 (0x20), then no file\n                                                 is identified.  See\n                                                 section 8.5.17 of ECMA 119\n                                                 9660 spec. */\n  dchar_t          abstract_file_id[37];      /**< See section 8.5.18 of\n                                                 ECMA 119. */\n  dchar_t          bibliographic_file_id[37]; /**< See section 8.5.19 of\n                                                 ECMA 119. */\n  iso9660_ltime_t  creation_date;             /**< date and time of volume\n                                                 creation. See section 8.4.26.1\n                                                 of the ECMA 119 spec. */\n  iso9660_ltime_t  modification_date;         /**< date and time of the most\n                                                 recent modification.\n                                                 See section 8.4.27 of the\n                                                 ECMA 119 spec. */\n  iso9660_ltime_t  expiration_date;           /**< date and time when volume\n                                                 expires. See section 8.4.28\n                                                 of the ECMA 119 spec. */\n  iso9660_ltime_t  effective_date;            /**< date and time when volume\n                                                 is effective. See section\n                                                 8.4.29 of the ECMA 119\n                                                 spec. */\n  iso711_t         file_structure_version;    /**< value 1 for ECMA 119 */\n  uint8_t           unused4[1];                /**< unused - value 0 */\n  char             application_data[512];     /**< 8.5.20 Application can put\n                                                 whatever it wants here. */\n  uint8_t          unused5[653];              /**< Unused - value 0 */\n} GNUC_PACKED;\n\ntypedef struct iso9660_svd_s  iso9660_svd_t;\n\n/*!\n  \\brief ISO-9660 Boot Record Volume Descriptor.\n */\nstruct iso9660_brvd_s {\n    uint8_t          type;                         /**< ISO_VD_BOOT_RECORD - 0 */\n    char             id[5];                        /**< ISO_STANDARD_ID \"CD001\" */\n    uint8_t          version;                      /**< value 1 for El Torito */\n    char             system_id[ISO_MAX_SYSTEM_ID]; /**< Boot system ID */\n    uint8_t          unused1[32];                  /**< unused - value 0 */\n    uint32_t         boot_catalog_sector;          /**< first sector of boot catalog */\n    uint8_t          unused2[1973];                /**< Unused - value 0 */\n} GNUC_PACKED;\n\ntypedef struct iso9660_brvd_s  iso9660_brvd_t;\n\n/*!\n  \\brief ISO-9660 Boot Record Volume Descriptor.\n */\nstruct iso9660_br_s {\n    uint8_t          boot_id;                      /**< Boot indicator - 0x88 */\n    uint8_t          media_type;                   /**< Boot media type - 0 for no emul. */\n    uint16_t         load_seg;                     /**< Load segment for x86 */\n    uint8_t          system_type;                  /**< System type - 0 for x86 */\n    uint8_t          unused1;\n    uint16_t         num_sectors;                  /**< Virtual sectors count of the image */\n    uint32_t         image_lsn;                    /**< Start address of the image */\n    uint8_t          unused2[20];\n} GNUC_PACKED;\n\ntypedef struct iso9660_br_s  iso9660_br_t;\n\nPRAGMA_END_PACKED\n\n/*! \\brief A data type for a list of ISO9660\n  statbuf file pointers returned from the various\n  Cdio iso9660 readdir routines.\n */\ntypedef CdioList_t CdioISO9660FileList_t;\n\n/*! \\brief A data type for a list of ISO9660\n  statbuf drectory pointer returned from the variious\n  Cdio iso9660 readdir routines.\n */\ntypedef CdioList_t CdioISO9660DirList_t;\n\n/*! \\brief Unix stat-like version of iso9660_dir\n\n   The iso9660_stat structure is not part of the ISO-9660\n   specification. We use it for our to communicate information\n   in a C-library friendly way, e.g struct tm time structures and\n   a C-style filename string.\n\n   @see iso9660_dir\n*/\nstruct iso9660_stat_s { /* big endian!! */\n\n  iso_rock_statbuf_t rr;              /**< Rock Ridge-specific fields  */\n\n  struct tm          tm;              /**< time on entry - FIXME merge with\n                                         one of entries above, like ctime? */\n  lsn_t              lsn;             /**< start logical sector number */\n\n#ifndef DO_NOT_WANT_COMPATIBILITY\n\n  /* *** Deprecated Legacy API ***\n     Use .total_size and CDIO_EXTENT_BLOCKS.\n   */\n  uint32_t           size;         /**< size of the first extent, in bytes */\n  uint32_t           secsize;      /**< size of the first extent, in sectors */\n\n#endif /* DO_NOT_WANT_COMPATIBILITY */\n\n  /* Multi-extent aware size, in bytes.\n\n     It is guaranteed that the bytes are stored as gapless string in a\n     contiguous sequence of blocks. I.e. they can be read sequentially\n     starting at iso9660_stat_s.lsn.\n     Data files which do not fulfil this promise cause a warning message\n     and are not represented by this type of struct.\n     (Directories are not allowed to have more than one extent and thus cannot\n      legally break the promise.)\n   */\n  uint64_t           total_size;\n\n  /* NB: If you need to access the 'secsize' equivalent for an extent,\n   * you should use CDIO_EXTENT_BLOCKS(iso9660_stat_s.total_size) */\n\n  iso9660_xa_t       xa;              /**< XA attributes */\n  enum { _STAT_FILE = 1, _STAT_DIR = 2 } type;\n  bool               b_xa;\n  char               filename[EMPTY_ARRAY_SIZE];    /**< filename */\n};\n\n/** A mask used in iso9660_ifs_read_vd which allows what kinds\n    of extensions we allow, eg. Joliet, Rock Ridge, etc. */\ntypedef uint8_t iso_extension_mask_t;\n\n/*! An enumeration for some of the ISO_EXTENSION_* \\#defines below. This isn't\n    really an enumeration one would really use in a program it is here\n    to be helpful in debuggers where wants just to refer to the\n    ISO_EXTENSION_*_ names and get something.\n  */\nextern enum iso_extension_enum_s {\n  ISO_EXTENSION_JOLIET_LEVEL1 = 0x01,\n  ISO_EXTENSION_JOLIET_LEVEL2 = 0x02,\n  ISO_EXTENSION_JOLIET_LEVEL3 = 0x04,\n  ISO_EXTENSION_ROCK_RIDGE    = 0x08,\n  ISO_EXTENSION_HIGH_SIERRA   = 0x10,\n  ISO_EXTENSION_EL_TORITO     = 0x20\n} iso_extension_enums;\n\n\n#define ISO_EXTENSION_ALL           0xFF\n#define ISO_EXTENSION_NONE          0x00\n#define ISO_EXTENSION_JOLIET     \\\n  (ISO_EXTENSION_JOLIET_LEVEL1 | \\\n   ISO_EXTENSION_JOLIET_LEVEL2 | \\\n   ISO_EXTENSION_JOLIET_LEVEL3 )\n\n\n/** This is an opaque structure. */\ntypedef struct _iso9660_s iso9660_t;\n\n  /*! Close previously opened ISO 9660 image and free resources\n    associated with the image. Call this when done using using an ISO\n    9660 image.\n\n    @param p_iso the ISO-9660 file image to get data from\n\n    @return true is unconditionally returned. If there was an error\n    false would be returned. Resources associated with p_iso are\n    freed.\n  */\n  bool iso9660_close (iso9660_t * p_iso);\n\n\n  /*!\n    Open an ISO 9660 image for reading. Maybe in the future we will have\n    a mode. NULL is returned on error.\n\n    @param psz_path full path of ISO9660 file.\n\n\n    @return a IS9660 structure  is unconditionally returned. The caller\n    should call iso9660_close() when done.\n  */\n  iso9660_t *iso9660_open (const char *psz_path /*flags, mode */);\n\n  /*!\n    Open an ISO 9660 image for reading allowing various ISO 9660\n    extensions.  Maybe in the future we will have a mode. NULL is\n    returned on error.\n\n    @see iso9660_open_fuzzy\n  */\n  iso9660_t *iso9660_open_ext (const char *psz_path,\n                               iso_extension_mask_t iso_extension_mask);\n\n  /*! Open an ISO 9660 image for \"fuzzy\" reading. This means that we\n    will try to guess various internal offset based on internal\n    checks. This may be useful when trying to read an ISO 9660 image\n    contained in a file format that libiso9660 doesn't know natively\n    (or knows imperfectly.)\n\n    Some tolerance allowed for positioning the ISO 9660 image. We scan\n    for STANDARD_ID and use that to set the eventual offset to adjust\n    by (as long as that is <= i_fuzz).\n\n    Maybe in the future we will have a mode. NULL is returned on error.\n\n    @see iso9660_open, @see iso9660_fuzzy_ext\n  */\n  iso9660_t *iso9660_open_fuzzy (const char *psz_path /*flags, mode */,\n                                 uint16_t i_fuzz);\n\n  /*!\n    Open an ISO 9660 image for reading with some tolerance for positioning\n    of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set\n    the eventual offset to adjust by (as long as that is <= i_fuzz).\n\n    Maybe in the future we will have a mode. NULL is returned on error.\n\n    @see iso9660_open_ext @see iso9660_open_fuzzy\n  */\n  iso9660_t *iso9660_open_fuzzy_ext (const char *psz_path,\n                                     iso_extension_mask_t iso_extension_mask,\n                                     uint16_t i_fuzz\n                                     /*flags, mode */);\n\n  /*!\n    Read the Super block of an ISO 9660 image but determine framesize\n    and datastart and a possible additional offset. Generally here we are\n    not reading an ISO 9660 image but a CD-Image which contains an ISO 9660\n    filesystem.\n  */\n  bool iso9660_ifs_fuzzy_read_superblock (iso9660_t *p_iso,\n                                          iso_extension_mask_t iso_extension_mask,\n                                          uint16_t i_fuzz);\n\n  /*!\n    Seek to a position and then read i_size blocks.\n\n    @param p_iso the ISO-9660 file image to get data from\n\n    @param ptr place to put returned data. It should be able to store\n    a least i_size bytes\n\n    @param start location to start reading from\n\n    @param i_size number of blocks to read. Each block is ISO_BLOCKSIZE bytes\n    long.\n\n    @return number of bytes (not blocks) read\n\n  */\n  long int iso9660_iso_seek_read (const iso9660_t *p_iso, /*out*/ void *ptr,\n                                  lsn_t start, long int i_size);\n\n  /*!\n    Read the Primary Volume Descriptor for a CD.\n    True is returned if read, and false if there was an error.\n  */\n  bool iso9660_fs_read_pvd ( const CdIo_t *p_cdio,\n                             /*out*/ iso9660_pvd_t *p_pvd );\n\n  /*!\n    Read the Primary Volume Descriptor for an ISO 9660 image.\n    True is returned if read, and false if there was an error.\n  */\n  bool iso9660_ifs_read_pvd (const iso9660_t *p_iso,\n                             /*out*/ iso9660_pvd_t *p_pvd);\n\n  /*!\n    Read the Super block of an ISO 9660 image. This is the\n    Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume\n    Descriptor if (Joliet) extensions are acceptable.\n  */\n  bool iso9660_fs_read_superblock (CdIo_t *p_cdio,\n                                   iso_extension_mask_t iso_extension_mask);\n\n  /*!\n    Read the Super block of an ISO 9660 image. This is the\n    Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume\n    Descriptor if (Joliet) extensions are acceptable.\n  */\n  bool iso9660_ifs_read_superblock (iso9660_t *p_iso,\n                                    iso_extension_mask_t iso_extension_mask);\n\n\n/*====================================================\n  Time conversion\n ====================================================*/\n\n  /*!\n    Set time in format used in ISO 9660 directory index record\n    from a Unix time structure.\n  */\n  void iso9660_set_dtime (const struct tm *tm,\n                          /*out*/ iso9660_dtime_t *idr_date);\n\n\n  /*!\n    Set time in format used in ISO 9660 directory index record\n    from a Unix time structure. timezone is given as an offset\n    correction in minutes.\n  */\n  void iso9660_set_dtime_with_timezone (const struct tm *p_tm,\n                                        int timezone,\n                                        /*out*/ iso9660_dtime_t *p_idr_date);\n\n  /*!\n    Set \"long\" time in format used in ISO 9660 primary volume descriptor\n    from a Unix time structure. */\n  void iso9660_set_ltime (const struct tm *_tm,\n                          /*out*/ iso9660_ltime_t *p_pvd_date);\n\n  /*!\n    Set \"long\" time in format used in ISO 9660 primary volume descriptor\n    from a Unix time structure. */\n  void iso9660_set_ltime_with_timezone (const struct tm *_tm,\n                                        int timezone,\n                                        /*out*/ iso9660_ltime_t *p_pvd_date);\n\n  /*!\n    Get Unix time structure from format use in an ISO 9660 directory index\n    record. Even though tm_wday and tm_yday fields are not explicitly in\n    idr_date, they are calculated from the other fields.\n\n    If tm is to reflect the localtime, set \"b_localtime\" true, otherwise\n    tm will reported in GMT.\n  */\n  bool iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,\n                          /*out*/ struct tm *p_tm);\n\n\n  /*!\n    Get \"long\" time in format used in ISO 9660 primary volume descriptor\n    from a Unix time structure.\n  */\n  bool iso9660_get_ltime (const iso9660_ltime_t *p_ldate,\n                          /*out*/ struct tm *p_tm);\n\n  /*====================================================\n    Character Classification and String Manipulation\n    ====================================================*/\n  /*!\n    Return true if c is a DCHAR - a character that can appear in an an\n    ISO-9600 level 1 directory name. These are the ASCII capital\n    letters A-Z, the digits 0-9 and an underscore.\n  */\n  bool iso9660_is_dchar (int c);\n\n  /*!\n    Return true if c is an ACHAR -\n    These are the DCHAR's plus some ASCII symbols including the space\n    symbol.\n  */\n  bool iso9660_is_achar (int c);\n\n  /*!\n    Convert an ISO-9660 file name which is in the format usually stored\n    in a ISO 9660 directory entry into what's usually listed as the\n    file name in a listing.  Lowercase name, and remove trailing ;1's\n    or .;1's and turn the other ;'s into version numbers.\n\n    @param psz_oldname the ISO-9660 filename to be translated.\n    @param psz_newname returned string. The caller allocates this and\n    it should be at least the size of psz_oldname.\n    @return length of the translated string is returned.\n  */\n  int iso9660_name_translate(const char *psz_oldname,\n                             /*out*/ char *psz_newname);\n\n  /*!\n    Convert an ISO-9660 file name which is in the format usually stored\n    in a ISO 9660 directory entry into what's usually listed as the\n    file name in a listing.  Lowercase name if no Joliet Extension\n    interpretation. Remove trailing ;1's or .;1's and turn the other\n    ;'s into version numbers.\n\n    @param psz_oldname the ISO-9660 filename to be translated.\n    @param psz_newname returned string. The caller allocates this and\n    it should be at least the size of psz_oldname.\n    @param i_joliet_level 0 if not using Joliet Extension. Otherwise the\n    Joliet level.\n    @return length of the translated string is returned. It will be no greater\n    than the length of psz_oldname.\n  */\n  int iso9660_name_translate_ext(const char *psz_oldname, char *psz_newname,\n                                 uint8_t i_joliet_level);\n\n  /*!\n    Pad string src with spaces to size len and copy this to dst. If\n    len is less than the length of src, dst will be truncated to the\n    first len characters of src.\n\n    src can also be scanned to see if it contains only ACHARs, DCHARs,\n    7-bit ASCII chars depending on the enumeration _check.\n\n    In addition to getting changed, dst is the return value.\n    Note: this string might not be NULL terminated.\n  */\n  char *iso9660_strncpy_pad(char dst[], const char src[], size_t len,\n                            enum strncpy_pad_check _check);\n\n  /*=====================================================================\n    File and Directory Names\n    ======================================================================*/\n\n  /*!\n    Check that psz_path is a valid ISO-9660 directory name.\n\n    A valid directory name should not start out with a slash (/),\n    dot (.) or null byte, should be less than 37 characters long,\n    have no more than 8 characters in a directory component\n    which is separated by a /, and consist of only DCHARs.\n\n    True is returned if psz_path is valid.\n  */\n  bool iso9660_dirname_valid_p (const char psz_path[]);\n\n  /*!\n    Take psz_path and a version number and turn that into a ISO-9660\n    pathname.  (That's just the pathname followed by \";\" and the version\n    number. For example, mydir/file.ext -> MYDIR/FILE.EXT;1 for version\n    1. The resulting ISO-9660 pathname is returned.\n  */\n  char *iso9660_pathname_isofy (const char psz_path[], uint16_t i_version);\n\n  /*!\n    Check that psz_path is a valid ISO-9660 pathname.\n\n    A valid pathname contains a valid directory name, if one appears and\n    the filename portion should be no more than 8 characters for the\n    file prefix and 3 characters in the extension (or portion after a\n    dot). There should be exactly one dot somewhere in the filename\n    portion and the filename should be composed of only DCHARs.\n\n    True is returned if psz_path is valid.\n  */\n  bool iso9660_pathname_valid_p (const char psz_path[]);\n\n/*=====================================================================\n  directory tree\n======================================================================*/\n\nvoid\niso9660_dir_init_new (void *dir, uint32_t self, uint32_t ssize,\n                      uint32_t parent, uint32_t psize,\n                      const time_t *dir_time);\n\nvoid\niso9660_dir_init_new_su (void *dir, uint32_t self, uint32_t ssize,\n                         const void *ssu_data, unsigned int ssu_size,\n                         uint32_t parent, uint32_t psize,\n                         const void *psu_data, unsigned int psu_size,\n                         const time_t *dir_time);\n\nvoid\niso9660_dir_add_entry_su (void *dir, const char filename[], uint32_t extent,\n                          uint32_t size, uint8_t file_flags,\n                          const void *su_data,\n                          unsigned int su_size, const time_t *entry_time);\n\nunsigned int\niso9660_dir_calc_record_size (unsigned int namelen, unsigned int su_len);\n\n/*!\n   Given a directory pointer, find the filesystem entry that contains\n   lsn and return information about it.\n\n   @param p_cdio the CD object to read from\n   @param i_lsn an lsn to find\n\n   @return stat_t of entry if we found lsn, or NULL otherwise.\n   Caller must free return value using iso9660_stat_free().\n */\niso9660_stat_t *iso9660_fs_find_lsn(CdIo_t *p_cdio, lsn_t i_lsn);\niso9660_stat_t *iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn);\n\n\n/*!\n   Given a directory pointer, find the filesystem entry that contains\n   LSN and return information about it.\n\n   @param p_cdio the ISO-9660 file image to get data from.\n\n   @param i_lsn the LSN to find\n\n   @param ppsz_full_filename the place to store the name of the path that has LSN.\n   On entry this should point to NULL. If not, the value will be freed.\n   On exit a value is malloc'd and the caller is responsible for\n   freeing the result.\n\n   @return stat_t of entry if we found lsn, or NULL otherwise.\n   Caller must free return value using iso9660_stat_free().\n */\niso9660_stat_t *iso9660_fs_find_lsn_with_path(CdIo_t *p_cdio, lsn_t i_lsn,\n                                              /*out*/ char **ppsz_full_filename);\n\n/*!\n   Given a directory pointer, find the filesystem entry that contains\n   lsn and return information about it.\n\n   @param p_iso the ISO-9660 file image to get data from.\n\n   @param i_lsn the LSN to find\n\n   @return stat_t of entry if we found lsn, or NULL otherwise.\n   Caller must free return value using iso9660_stat_free().\n */\niso9660_stat_t *iso9660_ifs_find_lsn(iso9660_t *p_iso, lsn_t i_lsn);\n\n\n/*!\n   Given a directory pointer, find the filesystem entry that contains\n   lsn and return information about it.\n\n   @param p_iso pointer to iso_t\n\n   @param i_lsn LSN to find\n\n   @param ppsz_path  full path of lsn filename. On entry *ppsz_path should be\n   NULL. On return it will be allocated an point to the full path of the\n   file at lsn or NULL if the lsn is not found. You should deallocate\n   *ppsz_path when you are done using it.\n\n   @return stat_t of entry if we found lsn, or NULL otherwise.\n   Caller must free return value using iso9660_stat_free().\n */\niso9660_stat_t *iso9660_ifs_find_lsn_with_path(iso9660_t *p_iso,\n                                               lsn_t i_lsn,\n                                               /*out*/ char **ppsz_path);\n\n/*!\n  Free the passed iso9660_stat_t structure.\n\n  @param p_stat iso9660 stat buffer to free.\n\n */\nvoid iso9660_stat_free(iso9660_stat_t *p_stat);\n\n/*!\n  Return file status for psz_path. NULL is returned on error.\n\n  @param p_cdio the CD object to read from\n\n  @param psz_path filename path to look up and get information about\n\n  @return ISO 9660 file information. The caller must free the returned\n  result using iso9660_stat_free().\n\n\n  Important note:\n\n  You make get different results looking up \"/\" versus \"/.\" and the\n  latter may give more complete information. \"/\" will take information\n  from the PVD only, whereas \"/.\" will force a directory read of \"/\" and\n  find \".\" and in that Rock-Ridge information might be found which fills\n  in more stat information. Ideally iso9660_fs_stat should be fixed.\n  Patches anyone?\n */\niso9660_stat_t *iso9660_fs_stat (CdIo_t *p_cdio, const char psz_path[]);\n\n\n/*!\n  Return file status for path name psz_path. NULL is returned on error.\n  pathname version numbers in the ISO 9660 name are dropped, i.e. ;1\n  is removed and if level 1 ISO-9660 names are lowercased.\n\n  @param p_cdio the CD object to read from\n\n  @param psz_path filename path to look up and get information about\n\n  @return ISO 9660 file information.  The caller must free the\n  returned result using iso9660_stat_free().\n\n */\niso9660_stat_t *iso9660_fs_stat_translate (CdIo_t *p_cdio,\n                                           const char psz_path[]);\n/*!\n\n  @param p_iso the ISO-9660 file image to get data from\n\n  @param psz_path path the look up\n\n  @return file status for pathname. NULL is returned on error.\n  The caller must free the returned result using iso9660_stat_free().\n */\niso9660_stat_t *iso9660_ifs_stat (iso9660_t *p_iso, const char psz_path[]);\n\n\n/*!\n  @param p_iso the ISO-9660 file image to get data from\n\n  @param psz_path filename path translate\n\n  @return file status for path name psz_path. NULL is returned on\n  error.  pathname version numbers in the ISO 9660 name are dropped,\n  i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased.\n  The caller must free the returned result using iso9660_stat_free().\n */\niso9660_stat_t *iso9660_ifs_stat_translate (iso9660_t *p_iso,\n                                            const char psz_path[]);\n\n\n/*!\n  Create a new data structure to hold a list of\n  ISO9660 statbuf-entry pointers for the files inside\n  a directory.\n\n  @return allocated list. Free with iso9660_filelist_free()\n*/\nCdioISO9660FileList_t * iso9660_filelist_new(void);\n\n\n/*!\n  Create a new data structure to hold a list of\n  ISO9660 statbuf entries for directory\n  pointers for the files inside a directory.\n\n  @return allocated list. Free with iso9660_dirlist_free()\n*/\nCdioISO9660DirList_t * iso9660_dirlist_new(void);\n\n\n\n/*!\n  Free the passed CdioISOC9660FileList_t structure.\n*/\nvoid iso9660_filelist_free(CdioISO9660FileList_t *p_filelist);\n\n\n/*!\n  Free the passed CdioISOC9660Dirlist_t structure.\n*/\nvoid iso9660_dirlist_free(CdioISO9660DirList_t *p_filelist);\n\n\n/*!\n  Read psz_path (a directory) and return a list of iso9660_stat_t\n  pointers for the files inside that directory.\n\n  @param p_cdio the CD object to read from\n\n  @param psz_path path the read the directory from.\n\n  @return file status for psz_path. The caller must free the\n  The caller must free the returned result using iso9660_stat_free().\n*/\nCdioList_t * iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]);\n\n/*!\n  Read psz_path (a directory) and return a list of iso9660_stat_t\n  pointers for the files inside that directory.\n\n  @param p_iso the ISO-9660 file image to get data from\n\n  @param psz_path path the read the directory from.\n\n  @return file status for psz_path. The caller must free the\n  The caller must free the returned result using iso9660_stat_free().\n*/\nCdioList_t * iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]);\n\n/*!\n  Return the PVD's application ID.\n\n  @param p_pvd the PVD to get data from\n\n  @return  the application id.\n  NULL is returned if there is some problem in getting this.\n  The caller must free the resturned result using free() if\n  not null.\n*/\nchar * iso9660_get_application_id(iso9660_pvd_t *p_pvd);\n\n/*!\n  Return the PVD's application ID.\n\n  @param p_iso the ISO-9660 file image to get data from\n\n  @param p_psz_app_id the application id set on success.\n\n  NULL is returned if there is some problem in getting this.\n  The caller must free the resturned result using free() if\n  not null.\n*/\nbool iso9660_ifs_get_application_id(iso9660_t *p_iso,\n                                    /*out*/ cdio_utf8_t **p_psz_app_id);\n\n/*!\n  Return the Joliet level recognized for p_iso.\n*/\nuint8_t iso9660_ifs_get_joliet_level(iso9660_t *p_iso);\n\nuint8_t iso9660_get_dir_len(const iso9660_dir_t *p_idr);\n\n#ifdef FIXME\nuint8_t iso9660_get_dir_size(const iso9660_dir_t *p_idr);\n\nlsn_t iso9660_get_dir_extent(const iso9660_dir_t *p_idr);\n#endif\n\n  /*!\n    Return the directory name stored in the iso9660_dir_t\n\n    A string is allocated: the caller must deallocate. This routine\n    can return NULL if memory allocation fails.\n  */\n  char * iso9660_dir_to_name (const iso9660_dir_t *p_iso9660_dir);\n\n  /*!\n    Returns a POSIX mode for a given p_iso_dirent.\n  */\n  mode_t iso9660_get_posix_filemode(const iso9660_stat_t *p_iso_dirent);\n\n  /*!\n    Return a string containing the preparer id with trailing\n    blanks removed.\n  */\n  char *iso9660_get_preparer_id(const iso9660_pvd_t *p_pvd);\n\n  /*!\n    Get the preparer ID.  psz_preparer_id is set to NULL if there\n    is some problem in getting this and false is returned.\n  */\n  bool iso9660_ifs_get_preparer_id(iso9660_t *p_iso,\n                                   /*out*/ cdio_utf8_t **p_psz_preparer_id);\n\n  /*!\n    Return a string containing the PVD's publisher id with trailing\n    blanks removed.\n  */\n  char *iso9660_get_publisher_id(const iso9660_pvd_t *p_pvd);\n\n  /*!\n    Get the publisher ID.  psz_publisher_id is set to NULL if there\n    is some problem in getting this and false is returned.\n  */\n  bool iso9660_ifs_get_publisher_id(iso9660_t *p_iso,\n                                    /*out*/ cdio_utf8_t **p_psz_publisher_id);\n\n  uint8_t iso9660_get_pvd_type(const iso9660_pvd_t *p_pvd);\n\n  const char * iso9660_get_pvd_id(const iso9660_pvd_t *p_pvd);\n\n  int iso9660_get_pvd_space_size(const iso9660_pvd_t *p_pvd);\n\n  int iso9660_get_pvd_block_size(const iso9660_pvd_t *p_pvd) ;\n\n  /*! Return the primary volume id version number (of pvd).\n    If there is an error 0 is returned.\n  */\n  int iso9660_get_pvd_version(const iso9660_pvd_t *pvd) ;\n\n  /*!\n    Return a string containing the PVD's system id with trailing\n    blanks removed.\n  */\n  char *iso9660_get_system_id(const iso9660_pvd_t *p_pvd);\n\n  /*!\n    Return \"yup\" if any file has Rock-Ridge extensions. Warning: this can\n    be time consuming. On an ISO 9600 image with lots of files but no Rock-Ridge\n    extensions, the entire directory structure will be scanned up to u_file_limit.\n\n    @param p_iso the ISO-9660 file image to get data from\n\n    @param u_file_limit the maximum number of (non-rock-ridge) files\n    to consider before giving up and returning \"dunno\".\n\n    \"dunno\" can also be returned if there was some error encountered\n    such as not being able to allocate memory in processing.\n\n  */\n  bool_3way_t iso9660_have_rr(iso9660_t *p_iso, uint64_t u_file_limit);\n\n  /*!\n    Get the system ID.  psz_system_id is set to NULL if there\n    is some problem in getting this and false is returned.\n  */\n  bool iso9660_ifs_get_system_id(iso9660_t *p_iso,\n                                 /*out*/ cdio_utf8_t **p_psz_system_id);\n\n\n  /*! Return the LSN of the root directory for pvd.\n    If there is an error CDIO_INVALID_LSN is returned.\n  */\n  lsn_t iso9660_get_root_lsn(const iso9660_pvd_t *p_pvd);\n\n  /*!\n    Get the volume ID in the PVD.  psz_volume_id is set to NULL if there\n    is some problem in getting this and false is returned.\n  */\n  char *iso9660_get_volume_id(const iso9660_pvd_t *p_pvd);\n\n  /*!\n    Get the volume ID in the PVD.  psz_volume_id is set to NULL if there\n    is some problem in getting this and false is returned.\n  */\n  bool iso9660_ifs_get_volume_id(iso9660_t *p_iso,\n                                 /*out*/ cdio_utf8_t **p_psz_volume_id);\n\n  /*!\n    Return the volumeset ID in the PVD.\n    NULL is returned if there is some problem in getting this.\n  */\n  char *iso9660_get_volumeset_id(const iso9660_pvd_t *p_pvd);\n\n  /*!\n    Get the volumeset ID.  psz_systemset_id is set to NULL if there\n    is some problem in getting this and false is returned.\n  */\n  bool iso9660_ifs_get_volumeset_id(iso9660_t *p_iso,\n                                    /*out*/ cdio_utf8_t **p_psz_volumeset_id);\n\n  /* pathtable */\n\n  /*! Zero's out pathable. Do this first. */\n  void iso9660_pathtable_init (void *pt);\n\n  unsigned int iso9660_pathtable_get_size (const void *pt);\n\n  uint16_t iso9660_pathtable_l_add_entry (void *pt, const char name[],\n                                          uint32_t extent, uint16_t parent);\n\n  uint16_t iso9660_pathtable_m_add_entry (void *pt, const char name[],\n                                          uint32_t extent, uint16_t parent);\n\n  /**=====================================================================\n     Volume Descriptors\n     ======================================================================*/\n\n  void iso9660_set_pvd (void *pd, const char volume_id[],\n                        const char application_id[],\n                        const char publisher_id[], const char preparer_id[],\n                        uint32_t iso_size, const void *root_dir,\n                        uint32_t path_table_l_extent,\n                        uint32_t path_table_m_extent,\n                        uint32_t path_table_size, const time_t *pvd_time);\n\n  void iso9660_set_evd (void *pd);\n\n  /*!\n    Return true if ISO 9660 image has extended attributes (XA).\n  */\n  bool iso9660_ifs_is_xa (const iso9660_t * p_iso);\n\n\n#ifndef DO_NOT_WANT_COMPATIBILITY\n/** For compatibility with < 0.77 */\n#define iso9660_isdchar       iso9660_is_dchar\n#define iso9660_isachar       iso9660_is_achar\n#endif /*DO_NOT_WANT_COMPATIBILITY*/\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#undef ISODCL\n#endif /* CDIO_ISO9660_H_ */\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/cdio/logging.h",
    "content": "/*\n    Copyright (C) 2003, 2004, 2008, 2012 Rocky Bernstein <rocky@gnu.org>\n    Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/** \\file logging.h\n *  \\brief Header to control logging and level of detail of output.\n *\n */\n\f\n#ifndef CDIO_LOGGING_H_\n#define CDIO_LOGGING_H_\n\n#include <cdio/types.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/**\n * The different log levels supported.\n */\ntypedef enum {\n  CDIO_LOG_DEBUG = 1, /**< Debug-level messages - helps debug what's up. */\n  CDIO_LOG_INFO,      /**< Informational - indicates perhaps something of\n                           interest. */\n  CDIO_LOG_WARN,      /**< Warning conditions - something that looks funny. */\n  CDIO_LOG_ERROR,     /**< Error conditions - may terminate program.  */\n  CDIO_LOG_ASSERT     /**< Critical conditions - may abort program. */\n} cdio_log_level_t;\n\n/**\n * The place to save the preference concerning how much verbosity\n * is desired. This is used by the internal default log handler, but\n * it could be use by applications which provide their own log handler.\n */\nextern cdio_log_level_t cdio_loglevel_default;\n\n/**\n * This type defines the signature of a log handler.  For every\n * message being logged, the handler will receive the log level and\n * the message string.\n *\n * @see cdio_log_set_handler\n * @see cdio_log_level_t\n *\n * @param level   The log level.\n * @param message The log message.\n */\ntypedef void (*cdio_log_handler_t) (cdio_log_level_t level,\n                                    const char message[]);\n\n/**\n * The initial or default log handler in effect.\n *\n * @param level   The log level.\n * @param message The log message.\n */\nextern void cdio_default_log_handler(cdio_log_level_t level, const char message[]);\n\n/**\n * Set a custom log handler for libcdio.  The return value is the log\n * handler being replaced.  If the provided parameter is NULL, then\n * the handler will be reset to the default handler.\n *\n * @see cdio_log_handler_t\n *\n * @param new_handler The new log handler.\n * @return The previous log handler.\n */\ncdio_log_handler_t cdio_log_set_handler (cdio_log_handler_t new_handler);\n\n/**\n * Handle an message with the given log level.\n *\n * @see cdio_debug\n * @see cdio_info\n * @see cdio_warn\n * @see cdio_error\n\n * @param level   The log level.\n * @param format  printf-style format string\n * @param ...     remaining arguments needed by format string\n */\nvoid cdio_log (cdio_log_level_t level,\n               const char format[], ...) GNUC_PRINTF(2, 3);\n\n/**\n * Handle a debugging message.\n *\n * @see cdio_log for a more generic routine\n */\nvoid cdio_debug (const char format[], ...) GNUC_PRINTF(1,2);\n\n/**\n * Handle an informative message.\n *\n * @see cdio_log for a more generic routine\n */\nvoid cdio_info (const char format[], ...) GNUC_PRINTF(1,2);\n\n/**\n * Handle a warning message.\n *\n * @see cdio_log for a more generic routine\n */\nvoid cdio_warn (const char format[], ...) GNUC_PRINTF(1,2);\n\n/**\n * Handle an error message. Execution is terminated.\n *\n * @see cdio_log for a more generic routine.\n */\nvoid cdio_error (const char format[], ...) GNUC_PRINTF(1,2);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* CDIO_LOGGING_H_ */\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/cdio/memory.h",
    "content": "/*  \n    Copyright (C) 2014 Robert Kausch <robert.kausch@freac.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/*!\n * \\file memory.h \n *\n * \\brief memory management utility functions.\n *\n*/\n\n#ifndef CDIO_MEMORY_H_\n#define CDIO_MEMORY_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n  /*!\n    Free the passed pointer.\n  */\n  void cdio_free(void *p_memory);\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_MEMORY_H_ */\n"
  },
  {
    "path": "src/libcdio/cdio/posix.h",
    "content": "/*\n    Copyright (C) 2005, 2008, 2012 Rocky Bernstein <rocky@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/*!\n * \\file posix.h \n *\n * \\brief various POSIX definitions.\n*/\n\n#ifndef CDIO_POSIX_H_\n#define CDIO_POSIX_H_\n\ntypedef uint32_t posix_mode_t;\ntypedef uint32_t posix_nlink_t;\ntypedef uint32_t posix_uid_t;\ntypedef uint32_t posix_gid_t;\ntypedef uint16_t unicode16_t;\n\n#endif /* CDIO_POSIX_H_ */\n\n\f\n/* \n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/cdio/read.h",
    "content": "/*\n    Copyright (C) 2005, 2006, 2007, 2008, 2012 Rocky Bernstein <rocky@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/** \\file read.h \n *\n *  \\brief The top-level header for sector (block, frame)-related\n *  libcdio calls. \n */\n\n#ifndef CDIO_READ_H_\n#define CDIO_READ_H_\n\n#include <cdio/types.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n  /** All the different ways a block/sector can be read. */\n  typedef enum {\n    CDIO_READ_MODE_AUDIO,  /**< CD-DA, audio, Red Book */\n    CDIO_READ_MODE_M1F1,   /**< Mode 1 Form 1 */\n    CDIO_READ_MODE_M1F2,   /**< Mode 1 Form 2 */\n    CDIO_READ_MODE_M2F1,   /**< Mode 2 Form 1 */\n    CDIO_READ_MODE_M2F2    /**< Mode 2 Form 2 */\n  } cdio_read_mode_t;\n  \n  /*!\n    Reposition read offset\n    Similar to (if not the same as) libc's fseek()\n\n    @param p_cdio object which gets adjusted\n    @param offset amount to seek\n    @param whence  like corresponding parameter in libc's fseek, e.g. \n                   SEEK_SET or SEEK_END.\n    @return (off_t) -1 on error. \n  */\n\n  off_t cdio_lseek(const CdIo_t *p_cdio, off_t offset, int whence);\n    \n  /*!  Reads into buf the next size bytes.  Similar to (if not the\n    same as) libc's read(). This is a \"cooked\" read, or one handled by\n    the OS. It probably won't work on audio data. For that use\n    cdio_read_audio_sector(s).\n\n    @param p_cdio object to read from\n    @param p_buf place to read data into. The caller should make sure\n                 this location can store at least i_size bytes.\n    @param i_size number of bytes to read\n\n    @return (ssize_t) -1 on error. \n  */\n  ssize_t cdio_read(const CdIo_t *p_cdio, void *p_buf, size_t i_size);\n    \n  /*!\n    Read an audio sector\n\n    @param p_cdio object to read from\n    @param p_buf place to read data into. The caller should make sure\n                 this location can store at least CDIO_FRAMESIZE_RAW\n                 bytes.\n    @param i_lsn sector to read\n  */\n  driver_return_code_t cdio_read_audio_sector (const CdIo_t *p_cdio, \n                                               void *p_buf, lsn_t i_lsn);\n\n  /*!\n    Reads audio sectors\n\n    @param p_cdio object to read from\n    @param p_buf place to read data into. The caller should make sure\n                 this location can store at least CDIO_FRAMESIZE_RAW\n                 * i_blocks bytes.\n    @param i_lsn sector to read\n    @param i_blocks number of sectors to read\n  */\n  driver_return_code_t cdio_read_audio_sectors (const CdIo_t *p_cdio, \n                                                void *p_buf, lsn_t i_lsn,\n                                                uint32_t i_blocks);\n\n  /*!\n    Read data sectors\n\n    @param p_cdio object to read from\n    @param p_buf place to read data into.  The caller should make sure\n                 this location can store at least ISO_BLOCKSIZE, \n                 M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE depending\n                 on the kind of sector getting read. If you don't \n                 know whether you have a Mode 1/2, Form 1/ Form 2/Formless\n                 sector best to reserve space for the maximum, \n                 M2RAW_SECTOR_SIZE.\n    @param i_lsn sector to read\n    @param i_blocksize size of block. Should be either CDIO_CD_FRAMESIZE, \n    M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf.\n\n    @param i_blocks number of blocks to read\n  */\n  driver_return_code_t cdio_read_data_sectors ( const CdIo_t *p_cdio, \n                                                void *p_buf, lsn_t i_lsn,\n                                                uint16_t i_blocksize,\n                                                uint32_t i_blocks );\n  /*!\n    Reads a mode 1 sector\n\n    @param p_cdio object to read from\n    @param p_buf place to read data into.\n    @param i_lsn sector to read\n    @param b_form2 true for reading mode 1 form 2 sectors or false for \n    mode 1 form 1 sectors.\n  */\n  driver_return_code_t cdio_read_mode1_sector (const CdIo_t *p_cdio, \n                                               void *p_buf, lsn_t i_lsn, \n                                               bool b_form2);\n  /*!\n    Reads mode 1 sectors\n\n    @param p_cdio object to read from\n    @param p_buf place to read data into\n    @param i_lsn sector to read\n    @param b_form2 true for reading mode 1 form 2 sectors or false for \n    mode 1 form 1 sectors.\n    @param i_blocks number of sectors to read\n  */\n  driver_return_code_t cdio_read_mode1_sectors (const CdIo_t *p_cdio, \n                                                void *p_buf, lsn_t i_lsn, \n                                                bool b_form2, \n                                                uint32_t i_blocks);\n  /*!\n    Reads a mode 2 sector\n\n    @param p_cdio object to read from\n    @param p_buf place to read data into. The caller should make sure\n                 this location can store at least \n                 M2RAW_SECTOR_SIZE (for form 1) or CDIO_CD_FRAMESIZE (for \n                 form 2) bytes.\n    @param i_lsn sector to read\n    @param b_form2 true for reading mode 2 form 2 sectors or false for \n    mode 2 form 1 sectors.\n\n    @return 0 if no error, nonzero otherwise.\n  */\n  driver_return_code_t cdio_read_mode2_sector (const CdIo_t *p_cdio, \n                                               void *p_buf, lsn_t i_lsn, \n                                               bool b_form2);\n  \n  /** The special case of reading a single block is a common one so we\n      provide a routine for that as a convenience.\n  */\n  driver_return_code_t cdio_read_sector(const CdIo_t *p_cdio, void *p_buf, \n                                        lsn_t i_lsn, \n                                        cdio_read_mode_t read_mode);\n  /*!\n    Reads mode 2 sectors\n\n    @param p_cdio object to read from\n    @param p_buf place to read data into. The caller should make sure\n                 this location can store at least \n                 M2RAW_SECTOR_SIZE (for form 1) or CDIO_CD_FRAMESIZE (for \n                 form 2) * i_blocks bytes.\n    @param i_lsn sector to read\n    @param b_form2 true for reading mode2 form 2 sectors or false for \n           mode 2  form 1 sectors.\n    @param i_blocks number of sectors to read\n\n    @return 0 if no error, nonzero otherwise.\n  */\n  driver_return_code_t cdio_read_mode2_sectors (const CdIo_t *p_cdio, \n                                                void *p_buf, lsn_t i_lsn, \n                                                bool b_form2, \n                                                uint32_t i_blocks);\n  \n  /*!\n    Reads a number of sectors (AKA blocks).\n\n    @param p_cdio cdio object\n    @param p_buf place to read data into. The caller should make sure\n    this location is large enough. See below for size information.\n    @param read_mode the kind of \"mode\" to use in reading.\n    @param i_lsn sector to read\n    @param i_blocks number of sectors to read\n    @return DRIVER_OP_SUCCESS (0) if no error, other (negative) enumerations\n    are returned on error.\n\n    If read_mode is CDIO_MODE_AUDIO,\n      *p_buf should hold at least CDIO_FRAMESIZE_RAW * i_blocks bytes.\n\n    If read_mode is CDIO_MODE_DATA,\n      *p_buf should hold at least i_blocks times either ISO_BLOCKSIZE, \n      M1RAW_SECTOR_SIZE or M2F2_SECTOR_SIZE depending on the kind of \n      sector getting read. If you don't know whether you have a Mode 1/2, \n    Form 1/ Form 2/Formless sector best to reserve space for the maximum\n    which is M2RAW_SECTOR_SIZE.\n\n    If read_mode is CDIO_MODE_M2F1,\n    *p_buf should hold at least M2RAW_SECTOR_SIZE * i_blocks bytes.\n    \n    If read_mode is CDIO_MODE_M2F2,\n    *p_buf should hold at least CDIO_CD_FRAMESIZE * i_blocks bytes.\n    \n  */\n  driver_return_code_t cdio_read_sectors(const CdIo_t *p_cdio, void *p_buf, \n                                         lsn_t i_lsn, \n                                         cdio_read_mode_t read_mode,\n                                         uint32_t i_blocks);\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_READ_H_ */\n"
  },
  {
    "path": "src/libcdio/cdio/rock.h",
    "content": "/*\n    Copyright (C) 2005, 2006 2008, 2012 Rocky Bernstein <rocky@gnu.org>\n\n    See also rock.c by Eric Youngdale (1993) from GNU/Linux \n    This is Copyright 1993 Yggdrasil Computing, Incorporated\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/*!\n   \\file rock.h \n   \\brief Things related to the Rock Ridge Interchange Protocol (RRIP)\n\n   Applications will probably not include this directly but via \n   the iso9660.h header.\n*/\n\n\f\n#ifndef CDIO_ROCK_H_\n#define CDIO_ROCK_H_\n\n#include <cdio/types.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n/*! An enumeration for some of the ISO_ROCK_* \\#defines below. This isn't\n  really an enumeration one would really use in a program it is to\n  be helpful in debuggers where wants just to refer to the ISO_ROCK_*\n  names and get something.\n*/\nextern enum iso_rock_enums {\n  ISO_ROCK_IRUSR  = 000400,   /**< read permission (owner) */\n  ISO_ROCK_IWUSR  = 000200,   /**< write permission (owner) */\n  ISO_ROCK_IXUSR  = 000100,   /**< execute permission (owner) */\n  ISO_ROCK_IRGRP  = 000040,   /**< read permission (group) */\n  ISO_ROCK_IWGRP  = 000020,   /**< write permission (group) */\n  ISO_ROCK_IXGRP  = 000010,   /**< execute permission (group) */\n  ISO_ROCK_IROTH  = 000004,   /**< read permission (other) */\n  ISO_ROCK_IWOTH  = 000002,   /**< write permission (other) */\n  ISO_ROCK_IXOTH  = 000001,   /**< execute permission (other) */\n\n  ISO_ROCK_ISUID  = 004000,   /**< set user ID on execution */\n  ISO_ROCK_ISGID  = 002000,   /**< set group ID on execution */\n  ISO_ROCK_ISVTX  = 001000,   /**< save swapped text even after use */\n\n  ISO_ROCK_ISSOCK = 0140000,  /**< socket */\n  ISO_ROCK_ISLNK  = 0120000,  /**< symbolic link */\n  ISO_ROCK_ISREG  = 0100000,  /**< regular */\n  ISO_ROCK_ISBLK  = 060000,   /**< block special */\n  ISO_ROCK_ISCHR  = 020000,   /**< character special */\n  ISO_ROCK_ISDIR  = 040000,   /**< directory */\n  ISO_ROCK_ISFIFO = 010000    /**< pipe or FIFO */\n} iso_rock_enums;\n\n#define ISO_ROCK_IRUSR    000400  /** read permission (owner) */\n#define ISO_ROCK_IWUSR    000200  /** write permission (owner) */\n#define ISO_ROCK_IXUSR    000100  /** execute permission (owner) */\n#define ISO_ROCK_IRGRP    000040  /** read permission (group) */\n#define ISO_ROCK_IWGRP    000020  /** write permission (group) */\n#define ISO_ROCK_IXGRP    000010  /** execute permission (group) */\n#define ISO_ROCK_IROTH    000004  /** read permission (other) */\n#define ISO_ROCK_IWOTH    000002  /** write permission (other) */\n#define ISO_ROCK_IXOTH    000001  /** execute permission (other) */\n\n#define ISO_ROCK_ISUID    004000  /** set user ID on execution */\n#define ISO_ROCK_ISGID    002000  /** set group ID on execution */\n#define ISO_ROCK_ISVTX    001000  /** save swapped text even after use */\n\n#define ISO_ROCK_ISSOCK  0140000  /** socket */\n#define ISO_ROCK_ISLNK   0120000  /** symbolic link */\n#define ISO_ROCK_ISREG   0100000  /** regular */\n#define ISO_ROCK_ISBLK    060000  /** block special */\n#define ISO_ROCK_ISCHR    020000  /** character special */\n#define ISO_ROCK_ISDIR    040000  /** directory */\n#define ISO_ROCK_ISFIFO   010000  /** pipe or FIFO */\n\n/** Enforced file locking (shared w/set group ID) */\n#define ISO_ROCK_ENFMT ISO_ROCK_ISGID\n\nPRAGMA_BEGIN_PACKED\n\n/*! The next two structs are used by the system-use-sharing protocol\n   (SUSP), in which the Rock Ridge extensions are embedded.  It is\n   quite possible that other extensions are present on the disk, and\n   this is fine as long as they all use SUSP. */\n\n/*! system-use-sharing protocol */\ntypedef struct iso_su_sp_s{\n  uint8_t       magic[2];\n  uint8_t       skip;\n} GNUC_PACKED iso_su_sp_t;\n\n/*! system-use extension record */\ntypedef struct iso_su_er_s {\n  iso711_t      len_id;  /**< Identifier length. Value 10?. */\n  uint8_t       len_des;\n  uint8_t       len_src;\n  iso711_t      ext_ver; /**< Extension version. Value 1? */\n  char          data[EMPTY_ARRAY_SIZE];\n} GNUC_PACKED iso_su_er_t;\n\ntypedef struct iso_su_ce_s {\n  iso733_t      extent;\n  iso733_t      offset;\n  iso733_t      size;\n} GNUC_PACKED iso_su_ce_t;\n\n/*! POSIX file attributes, PX. See Rock Ridge Section 4.1.2 */\ntypedef struct iso_rock_px_s {\n  iso733_t st_mode;       /*! file mode permissions; same as st_mode \n                            of POSIX:5.6.1 */\n  iso733_t st_nlinks;     /*! number of links to file; same as st_nlinks\n                            of POSIX:5.6.1 */\n  iso733_t st_uid;        /*! user id owner of file; same as st_uid\n                            of POSIX:5.6.1 */\n  iso733_t st_gid;        /*! group id of file; same as st_gid of \n                            of POSIX:5.6.1 */\n} GNUC_PACKED iso_rock_px_t ;\n\n/*! POSIX device number, PN. A PN is mandatory if the file type\n  recorded in the \"PX\" File Mode field for a Directory Record\n  indicates a character or block device (ISO_ROCK_ISCHR |\n  ISO_ROCK_ISBLK).  This entry is ignored for other (non-Direcotry)\n  file types. No more than one \"PN\" is recorded in the System Use Area\n  of a Directory Record.\n\n  See Rock Ridge Section 4.1.2 */\ntypedef struct iso_rock_pn_s {\n  iso733_t dev_high;     /**< high-order 32 bits of the 64 bit device number.\n                            7.2.3 encoded */\n  iso733_t dev_low;      /**< low-order 32 bits of the 64 bit device number.\n                            7.2.3 encoded */\n} GNUC_PACKED iso_rock_pn_t ;\n\n/*! These are the bits and their meanings for flags in the SL structure. */\ntypedef enum {\n  ISO_ROCK_SL_CONTINUE = 1,\n  ISO_ROCK_SL_CURRENT  = 2,\n  ISO_ROCK_SL_PARENT   = 4,\n  ISO_ROCK_SL_ROOT     = 8\n} iso_rock_sl_flag_t;\n\n#define ISO_ROCK_SL_CONTINUE 1\n#define ISO_ROCK_SL_CURRENT  2\n#define ISO_ROCK_SL_PARENT   4\n#define ISO_ROCK_SL_ROOT     8\n\ntypedef struct iso_rock_sl_part_s {\n  uint8_t flags;\n  uint8_t len;\n  char text[EMPTY_ARRAY_SIZE];\n} GNUC_PACKED iso_rock_sl_part_t ;\n\n/*! Symbolic link. See Rock Ridge Section 4.1.3 */\ntypedef struct iso_rock_sl_s {\n  uint8_t flags;\n  iso_rock_sl_part_t link;\n} GNUC_PACKED iso_rock_sl_t ;\n\n/*! Alternate name. See Rock Ridge Section 4.1.4 */\n\n/*! These are the bits and their meanings for flags in the NM structure. */\ntypedef enum {\n  ISO_ROCK_NM_CONTINUE = 1,\n  ISO_ROCK_NM_CURRENT  = 2,\n  ISO_ROCK_NM_PARENT   = 4,\n} iso_rock_nm_flag_t;\n\n#define ISO_ROCK_NM_CONTINUE 1\n#define ISO_ROCK_NM_CURRENT  2\n#define ISO_ROCK_NM_PARENT   4\n\n\ntypedef struct iso_rock_nm_s {\n  uint8_t flags;\n  char name[EMPTY_ARRAY_SIZE];\n} GNUC_PACKED iso_rock_nm_t ;\n\n/*! Child link. See Section 4.1.5.1 */\ntypedef struct iso_rock_cl_s {\n  iso733_t location;\n} GNUC_PACKED iso_rock_cl_t ;\n\n/*! Parent link. See Section 4.1.5.2 */\ntypedef struct iso_rock_pl_s {\n  iso733_t location;\n} GNUC_PACKED iso_rock_pl_t ;\n\n/*! These are the bits and their meanings for flags in the TF structure. */\ntypedef enum {\n  ISO_ROCK_TF_CREATE     =  1,\n  ISO_ROCK_TF_MODIFY     =  2,\n  ISO_ROCK_TF_ACCESS     =  4,\n  ISO_ROCK_TF_ATTRIBUTES =  8,\n  ISO_ROCK_TF_BACKUP     =  16,\n  ISO_ROCK_TF_EXPIRATION =  32,\n  ISO_ROCK_TF_EFFECTIVE  =  64,\n  ISO_ROCK_TF_LONG_FORM  = 128\n} iso_rock_tf_flag_t;\n\n/* These are the bits and their meanings for flags in the TF structure. */\n#define ISO_ROCK_TF_CREATE      1\n#define ISO_ROCK_TF_MODIFY      2\n#define ISO_ROCK_TF_ACCESS      4\n#define ISO_ROCK_TF_ATTRIBUTES  8\n#define ISO_ROCK_TF_BACKUP     16\n#define ISO_ROCK_TF_EXPIRATION 32\n#define ISO_ROCK_TF_EFFECTIVE  64\n#define ISO_ROCK_TF_LONG_FORM 128\n\n/*! Time stamp(s) for a file. See Rock Ridge Section 4.1.6 */\ntypedef struct iso_rock_tf_s {\n  uint8_t flags; /**< See ISO_ROCK_TF_* bits above. */\n  uint8_t time_bytes[EMPTY_ARRAY_SIZE]; /**< A homogenious array of\n                                           iso9660_ltime_t or\n                                           iso9660_dtime_t entries\n                                           depending on flags &\n                                           ISO_ROCK_TF_LONG_FORM. Lacking\n                                           a better method, we store\n                                           this as an array of bytes\n                                           and a cast to the\n                                           appropriate type will have\n                                           to be made before\n                                           extraction.  */\n} GNUC_PACKED iso_rock_tf_t ;\n\n/*! File data in sparse format. See Rock Ridge Section 4.1.7 */\ntypedef struct iso_rock_sf_s {\n  iso733_t virtual_size_high; /**< high-order 32 bits of virtual size */\n  iso733_t virtual_size_low;  /**< low-order 32 bits of virtual size */\n  uint8_t   table_depth;\n} GNUC_PACKED iso_rock_sf_t ;\n\ntypedef struct iso_extension_record_s {\n  char signature[2];   /**< signature word; either 'SP', 'CE', 'ER', 'RR',\n                          'PX', 'PN', 'SL', 'NM', 'CL', 'PL', 'TF', or \n                          'ZF' */\n  iso711_t len;        /**< length of system-user area - 44 for PX\n                          20 for PN, 5+strlen(text) for SL, 21 for \n                          SF, etc. */\n  iso711_t version;    /**< version number - value 1 */\n  union {\n    iso_su_sp_t    SP;  /**< system-use-sharing protocol - not\n                          strictly part of Rock Ridge */\n    iso_su_er_t    ER;  /**< system-use extension packet - not\n                           strictly part of Rock Ridge */\n    iso_su_ce_t    CE;  /**< system-use -  strictly part of Rock Ridge */\n    iso_rock_px_t  PX;  /**< Rock Ridge POSIX file attributes */\n    iso_rock_pn_t  PN;  /**< Rock Ridge POSIX device number */\n    iso_rock_sl_t  SL;  /**< Rock Ridge symbolic link */\n    iso_rock_nm_t  NM;  /**< Rock Ridge alternate name */\n    iso_rock_cl_t  CL;  /**< Rock Ridge child link */\n    iso_rock_pl_t  PL;  /**< Rock Ridge parent link */\n    iso_rock_tf_t  TF;  /**< Rock Ridge timestamp(s) for a file */\n    iso_rock_sf_t  SF;  /**< Rock Ridge sparse file */\n  } u;\n} GNUC_PACKED iso_extension_record_t;\n\n/* Bits for the u_su_fields of iso_rock_statbuf_t */\n#define ISO_ROCK_SUF_SP 0x00000001\n#define ISO_ROCK_SUF_ER 0x00000002\n#define ISO_ROCK_SUF_CE 0x00000004\n#define ISO_ROCK_SUF_PX 0x00000008\n#define ISO_ROCK_SUF_PN 0x00000010\n#define ISO_ROCK_SUF_SL 0x00000020\n#define ISO_ROCK_SUF_NM 0x00000040\n#define ISO_ROCK_SUF_TF 0x00000080\n#define ISO_ROCK_SUF_CL 0x00000100\n#define ISO_ROCK_SUF_PL 0x00000200\n#define ISO_ROCK_SUF_RE 0x00000400\n#define ISO_ROCK_SUF_SF 0x00000800\n\n#define ISO_ROCK_SUF_FORMAL (ISO_ROCK_SUF_ER | ISO_ROCK_SUF_PX | ISO_ROCK_SUF_PN | \\\n                             ISO_ROCK_SUF_SL | ISO_ROCK_SUF_NM | ISO_ROCK_SUF_CL | \\\n                             ISO_ROCK_SUF_PL | ISO_ROCK_SUF_RE | ISO_ROCK_SUF_TF | \\\n                             ISO_ROCK_SUF_SF)\n\ntypedef struct iso_rock_time_s {\n  bool          b_used;     /**< If true, field has been set and  is valid. \n                               Otherwise remaning fields are meaningless. */\n  bool          b_longdate;  /**< If true date format is a iso9660_ltime_t. \n                               Otherwise date is iso9660_dtime_t */\n  union \n  {\n    iso9660_ltime_t ltime;\n    iso9660_dtime_t dtime;\n  } t;\n} GNUC_PACKED iso_rock_time_t;\n\ntypedef struct iso_rock_statbuf_s {\n  bool_3way_t   b3_rock;              /**< has Rock Ridge extension. \n                                         If \"yep\", then the fields\n                                         are used.\n                                      */\n  posix_mode_t  st_mode;              /**< protection */\n  posix_nlink_t st_nlinks;            /**< number of hard links */\n  posix_uid_t   st_uid;               /**< user ID of owner */\n  posix_gid_t   st_gid;               /**< group ID of owner */\n  uint8_t       s_rock_offset;\n  int           i_symlink;            /**< size of psz_symlink */\n  int           i_symlink_max;        /**< max allocated to psz_symlink */\n  char         *psz_symlink;          /**< if symbolic link, name\n                                         of pointed to file.  */\n  iso_rock_time_t create;             /**< create time See ISO 9660:9.5.4. */\n  iso_rock_time_t modify;             /**< time of last modification\n                                         ISO 9660:9.5.5. st_mtime field of \n                                         POSIX:5.6.1. */\n  iso_rock_time_t access;             /**< time of last file access st_atime \n                                         field of POSIX:5.6.1. */\n  iso_rock_time_t attributes;         /**< time of last attribute change.\n                                         st_ctime field of POSIX:5.6.1. */\n  iso_rock_time_t backup;             /**< time of last backup. */\n  iso_rock_time_t expiration;         /**< time of expiration; See ISO \n                                         9660:9.5.6. */\n  iso_rock_time_t effective;          /**< Effective time; See ISO 9660:9.5.7.\n                                       */\n  uint32_t        i_rdev;             /**< the upper 16-bits is major device \n                                         number, the lower 16-bits is the\n                                         minor device number */\n  uint32_t        u_su_fields;        /**< System Use field attributes */\n\n} iso_rock_statbuf_t;\n\nPRAGMA_END_PACKED\n\n/*! return length of name field; 0: not found, -1: to be ignored */\nint get_rock_ridge_filename(iso9660_dir_t * de,\n                            /*in*/ void * p_iso,\n                            /*out*/ char * retname,\n                            /*out*/ iso9660_stat_t *p_stat);\n\nint parse_rock_ridge_stat(iso9660_dir_t *de,\n                          /*out*/ iso9660_stat_t *p_stat);\n\n  /*!\n    Returns POSIX mode bitstring for a given file.\n  */\n  mode_t \n  iso9660_get_posix_filemode_from_rock(const iso_rock_statbuf_t *rr);\n\n/*!\n  Returns a string which interpreting the POSIX mode st_mode. \n  For example:\n  \\verbatim\n  drwxrws---\n  -rw---Sr--\n  lrwxrwxrwx\n  \\endverbatim\n  \n  A description of the characters in the string follows\n  The 1st character is either \"d\" if the entry is a directory, \"l\" is\n  a symbolic link or \"-\" if neither.\n  \n  The 2nd to 4th characters refer to permissions for a user while the\n  the 5th to 7th characters refer to permissions for a group while, and \n  the 8th to 10h characters refer to permissions for everyone. \n  \n  In each of these triplets the first character (2, 5, 8) is \"r\" if\n  the entry is allowed to be read.\n\n  The second character of a triplet (3, 6, 9) is \"w\" if the entry is\n  allowed to be written.\n\n  The third character of a triplet (4, 7, 10) is \"x\" if the entry is\n  executable but not user (for character 4) or group (for characters\n  6) settable and \"s\" if the item has the corresponding user/group set.\n\n  For a directory having an executable property on (\"x\" or \"s\") means\n  the directory is allowed to be listed or \"searched\". If the execute\n  property is not allowed for a group or user but the corresponding\n  group/user is set \"S\" indicates this. If none of these properties\n  holds the \"-\" indicates this.\n*/\nconst char *iso9660_get_rock_attr_str(posix_mode_t st_mode);\n\n/** These variables are not used, but are defined to facilatate debugging\n    by letting us use enumerations values (which also correspond to \n    \\#define's inside a debugged program.\n */\nextern iso_rock_nm_flag_t iso_rock_nm_flag;\nextern iso_rock_sl_flag_t iso_rock_sl_flag;\nextern iso_rock_tf_flag_t iso_rock_tf_flag;\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_ROCK_H_ */\n\f\n/* \n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/cdio/sector.h",
    "content": "/*\n    Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012\n     Rocky Bernstein <rocky@gnu.org>\n    Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/*!\n   \\file sector.h \n   \\brief Things related to CD-ROM layout: tracks, sector sizes, MSFs, LBAs.\n\n  A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336,\n  2340, or 2352 bytes long.\n\n  Sector types of the standard CD-ROM data formats:\n\n\\verbatim \n  format   sector type               user data size (bytes)\n  -----------------------------------------------------------------------------\n    1     (Red Book)    CD-DA          2352    (CDIO_CD_FRAMESIZE_RAW)\n    2     (Yellow Book) Mode1 Form1    2048    (CDIO_CD_FRAMESIZE)\n    3     (Yellow Book) Mode1 Form2    2336    (M2RAW_SECTOR_SIZE)\n    4     (Green Book)  Mode2 Form1    2048    (CDIO_CD_FRAMESIZE)\n    5     (Green Book)  Mode2 Form2    2328    (2324+4 spare bytes)\n \n \n        The layout of the standard CD-ROM data formats:\n  -----------------------------------------------------------------------------\n  - audio (red):                  | audio_sample_bytes |\n                                  |        2352        |\n \n  - data (yellow, mode1):         | sync - head - data - EDC - zero - ECC |\n                                  |  12  -   4  - 2048 -  4  -   8  - 276 |\n \n  - data (yellow, mode2):         | sync - head - data |\n                                 |  12  -   4  - 2336 |\n \n  - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC |\n                                  |  12  -   4  -  8  - 2048 -  4  - 276 |\n \n  - XA data (green, mode2 form2): | sync - head - sub - data - Spare |\n                                  |  12  -   4  -  8  - 2324 -  4    |\n\\endverbatim\n \n\n*/\n\f\n#ifndef CDIO_SECTOR_H_\n#define CDIO_SECTOR_H_\n\n#ifdef __cplusplus\n    extern \"C\" {\n#endif\n\n#include <cdio/types.h>\n\n      /*! Information that can be obtained through a Read Subchannel\n        command.\n      */\n      typedef enum cdio_subchannel\n        {\n          CDIO_SUBCHANNEL_SUBQ_DATA             = 0,\n          CDIO_SUBCHANNEL_CURRENT_POSITION      = 1,\n          CDIO_SUBCHANNEL_MEDIA_CATALOG         = 2,\n          CDIO_SUBCHANNEL_TRACK_ISRC            = 3\n        } cdio_subchannel;\n      \n      /*! track flags\n       * Q Sub-channel Control Field (4.2.3.3)\n       */\n      typedef enum {\n        NONE =                  0x00,   /* no flags set */\n        PRE_EMPHASIS =          0x01,   /* audio track recorded with pre-emphasis */\n        COPY_PERMITTED =        0x02,   /* digital copy permitted */\n        DATA =                  0x04,   /* data track */\n        FOUR_CHANNEL_AUDIO =    0x08,   /* 4 audio channels */\n        SCMS =                  0x10    /* SCMS (5.29.2.7) */\n      } flag_t;\n      \n#define CDIO_PREGAP_SECTORS  150\n#define CDIO_POSTGAP_SECTORS 150\n      \n      /*! An enumeration for some of the CDIO_CD \\#defines below. This isn't\n        really an enumeration one would really use in a program it is to\n        be helpful in debuggers where wants just to refer to the CDIO_CD_\n        names and get something.\n      */\n      extern enum cdio_cd_enums {\n        CDIO_CD_MINS =              74,   /**< max. minutes per CD, not really\n                                             a limit */\n        CDIO_CD_SECS_PER_MIN =      60,   /**< seconds per minute */\n        CDIO_CD_FRAMES_PER_SEC =    75,   /**< frames per second */\n        CDIO_CD_SYNC_SIZE =         12,   /**< 12 sync bytes per raw data \n                                             frame */\n        CDIO_CD_CHUNK_SIZE =        24,   /**< lowest-level \"data bytes \n                                             piece\" */\n        CDIO_CD_NUM_OF_CHUNKS =     98,   /**< chunks per frame */\n        CDIO_CD_FRAMESIZE_SUB =     96,   /**< subchannel data \"frame\" size */\n        CDIO_CD_HEADER_SIZE =        4,   /**< header (address) bytes per raw\n                                             frame */\n        CDIO_CD_SUBHEADER_SIZE =     8,   /**< subheader bytes per raw XA data \n                                             frame */\n        CDIO_CD_ECC_SIZE =         276,   /**< bytes ECC per most raw data \n                                             frame types */\n        CDIO_CD_FRAMESIZE =       2048,   /**< bytes per frame, \"cooked\" \n                                             mode */\n        CDIO_CD_FRAMESIZE_RAW =   2352,   /**< bytes per frame, \"raw\" mode */\n        CDIO_CD_FRAMESIZE_RAWER = 2646,   /**< The maximum possible \n                                             returned  */\n        CDIO_CD_FRAMESIZE_RAW1  = 2340,\n        CDIO_CD_FRAMESIZE_RAW0  = 2336,\n        CDIO_CD_MAX_SESSIONS =      99, \n        CDIO_CD_MIN_SESSION_NO =     1,   /**<, Smallest CD session number */\n        CDIO_CD_MAX_LSN =       450150,   /**< Largest LSN in a CD */\n        CDIO_CD_MIN_LSN      = -450150,   /**< Smallest LSN in a CD */\n      } cdio_cd_enums;\n        \n      /*!\n        Some generally useful CD-ROM information -- mostly based on the above.\n        This is from linux.h - not to slight other OS's. This was the first\n        place I came across such useful stuff.\n      */\n#define CDIO_CD_MINS              74   /**< max. minutes per CD, not really\n                                          a limit */\n#define CDIO_CD_SECS_PER_MIN      60   /**< seconds per minute */\n#define CDIO_CD_FRAMES_PER_SEC    75   /**< frames per second */\n#define CDIO_CD_SYNC_SIZE         12   /**< 12 sync bytes per raw data frame */\n#define CDIO_CD_CHUNK_SIZE        24   /**< lowest-level \"data bytes piece\" */\n#define CDIO_CD_NUM_OF_CHUNKS     98   /**< chunks per frame */\n#define CDIO_CD_FRAMESIZE_SUB     96   /**< subchannel data \"frame\" size */\n#define CDIO_CD_HEADER_SIZE        4   /**< header (address) bytes per raw\n                                          data frame */\n#define CDIO_CD_SUBHEADER_SIZE     8   /**< subheader bytes per raw XA data \n                                            frame */\n#define CDIO_CD_EDC_SIZE           4   /**< bytes EDC per most raw data\n                                          frame types */\n#define CDIO_CD_M1F1_ZERO_SIZE     8   /**< bytes zero per yellow book mode\n                                          1 frame */\n#define CDIO_CD_ECC_SIZE         276   /**< bytes ECC per most raw data frame \n                                          types */\n#define CDIO_CD_FRAMESIZE       2048   /**< bytes per frame, \"cooked\" mode */\n#define CDIO_CD_FRAMESIZE_RAW   2352   /**< bytes per frame, \"raw\" mode */\n#define CDIO_CD_FRAMESIZE_RAWER 2646   /**< The maximum possible returned \n                                          bytes */ \n#define CDIO_CD_FRAMESIZE_RAW1 (CDIO_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE) /*2340*/\n#define CDIO_CD_FRAMESIZE_RAW0 (CDIO_CD_FRAMESIZE_RAW-CDIO_CD_SYNC_SIZE-CDIO_CD_HEADER_SIZE) /*2336*/\n      \n      /*! \"before data\" part of raw XA (green, mode2) frame */\n#define CDIO_CD_XA_HEADER (CDIO_CD_HEADER_SIZE+CDIO_CD_SUBHEADER_SIZE) \n      \n      /*! \"after data\" part of raw XA (green, mode2 form1) frame */\n#define CDIO_CD_XA_TAIL   (CDIO_CD_EDC_SIZE+CDIO_CD_ECC_SIZE) \n      \n      /*! \"before data\" sync bytes + header of XA (green, mode2) frame */\n#define CDIO_CD_XA_SYNC_HEADER   (CDIO_CD_SYNC_SIZE+CDIO_CD_XA_HEADER) \n      \n      /*! String of bytes used to identify the beginning of a Mode 1 or\n          Mode 2 sector. */\n      extern const uint8_t CDIO_SECTOR_SYNC_HEADER[CDIO_CD_SYNC_SIZE];\n      /**<  \n        {0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0};\n      */\n      \n      /*! An enumeration for some of the M2*_SECTOR_SIZE \\#defines\n        below. This isn't really an enumeration one would really use in a\n        program it is to be helpful in debuggers where wants just to refer\n        to the M2*_SECTOR_SIZE names and get something.\n      */\n      extern enum m2_sector_enums {\n        M2F2_SECTOR_SIZE  = 2324,\n        M2SUB_SECTOR_SIZE = 2332,\n        M2RAW_SECTOR_SIZE = 2336\n      } m2_sector_enums;\n      \n#define M2F2_SECTOR_SIZE    2324\n#define M2SUB_SECTOR_SIZE   2332\n#define M2RAW_SECTOR_SIZE   2336\n      \n      /*! Largest CD session number */\n#define CDIO_CD_MAX_SESSIONS    99 \n      /*! Smallest CD session number */\n#define CDIO_CD_MIN_SESSION_NO   1\n      \n      /*! Largest LSN in a CD */\n#define CDIO_CD_MAX_LSN   450150\n      /*! Smallest LSN in a CD */\n#define CDIO_CD_MIN_LSN  -450150\n      \n      \n#define CDIO_CD_FRAMES_PER_MIN                          \\\n      (CDIO_CD_FRAMES_PER_SEC*CDIO_CD_SECS_PER_MIN)\n      \ntypedef enum cdio_cd_minutes_sectors\n{\n        CDIO_CD_74MIN_SECTORS = UINT32_C(74) * CDIO_CD_FRAMES_PER_MIN,\n        CDIO_CD_80MIN_SECTORS = UINT32_C(80) * CDIO_CD_FRAMES_PER_MIN,\n        CDIO_CD_90MIN_SECTORS = UINT32_C(90) * CDIO_CD_FRAMES_PER_MIN,\n      \n        CDIO_CD_MAX_SECTORS   = UINT32_C(100) * CDIO_CD_FRAMES_PER_MIN - CDIO_PREGAP_SECTORS\n} cdio_cd_minutes_sectors;\n      \n#define msf_t_SIZEOF 3\n      \n      /*! \n        Convert an LBA into a string representation of the MSF.\n        \\warning cdio_lba_to_msf_str returns new allocated string */\n      char *cdio_lba_to_msf_str (lba_t i_lba);\n      \n      /*! \n        Convert an MSF into a string representation of the MSF.\n        \\warning cdio_msf_to_msf_str returns new allocated string */\n      char *cdio_msf_to_str (const msf_t *p_msf);\n      \n      /*! \n        Convert an LBA into the corresponding LSN.\n      */\n      lba_t cdio_lba_to_lsn (lba_t i_lba);\n      \n      /*! \n        Convert an LBA into the corresponding MSF.\n      */\n      void  cdio_lba_to_msf(lba_t i_lba, msf_t *p_msf);\n      \n      /*! \n        Convert an LSN into the corresponding LBA.\n        CDIO_INVALID_LBA is returned if there is an error.\n      */\n      lba_t cdio_lsn_to_lba (lsn_t i_lsn);\n      \n      /*! \n        Convert an LSN into the corresponding MSF.\n      */\n      void  cdio_lsn_to_msf (lsn_t i_lsn, msf_t *p_msf);\n      \n      /*! \n        Convert a MSF into the corresponding LBA.\n        CDIO_INVALID_LBA is returned if there is an error.\n      */\n      lba_t cdio_msf_to_lba (const msf_t *p_msf);\n      \n      /*! \n        Convert a MSF into the corresponding LSN.\n        CDIO_INVALID_LSN is returned if there is an error.\n      */\n      lsn_t cdio_msf_to_lsn (const msf_t *p_msf);\n      \n      /*!  \n        Convert a MSF - broken out as 3 integer components into the\n        corresponding LBA.  \n        CDIO_INVALID_LBA is returned if there is an error.\n      */\n      lba_t cdio_msf3_to_lba (unsigned int minutes, unsigned int seconds, \n                              unsigned int frames);\n      \n      /*! \n        Convert a string of the form MM:SS:FF into the corresponding LBA.\n        CDIO_INVALID_LBA is returned if there is an error.\n      */\n      lba_t cdio_mmssff_to_lba (const char *psz_mmssff);\n      \n#ifdef __cplusplus\n    }\n#endif\n\n#ifndef DO_NOT_WANT_PARANOIA_COMPATIBILITY\n/** For compatibility with good ol' paranoia */\n#define CD_FRAMESIZE_RAW        CDIO_CD_FRAMESIZE_RAW\n#endif /*DO_NOT_WANT_PARANOIA_COMPATIBILITY*/\n\n#endif /* CDIO_SECTOR_H_ */\n\n\f\n/* \n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/cdio/track.h",
    "content": "/*\n    Copyright (C) 2005, 2006, 2008, 2012 Rocky Bernstein <rocky@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/** \\file track.h\n *  \\brief  The top-level header for track-related libcdio calls.\n */\n#ifndef CDIO_TRACK_H_\n#define CDIO_TRACK_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n  /*! Printable tags for track_format_t enumeration.  */\n  extern const char *track_format2str[6];\n\n  typedef enum  {\n    TRACK_FORMAT_AUDIO,   /**< Audio track, e.g. CD-DA */\n    TRACK_FORMAT_CDI,     /**< CD-i. How this is different from DATA below? */\n    TRACK_FORMAT_XA,      /**< Mode2 of some sort */\n    TRACK_FORMAT_DATA,    /**< Mode1 of some sort */\n    TRACK_FORMAT_PSX,     /**< Playstation CD. Like audio but only 2336 bytes\n                           *   of user data.\n                           */\n    TRACK_FORMAT_ERROR    /**< Dunno what is, or some other error. */\n  } track_format_t;\n\n  typedef enum {\n    CDIO_TRACK_FLAG_FALSE,\n    CDIO_TRACK_FLAG_TRUE,\n    CDIO_TRACK_FLAG_ERROR,\n    CDIO_TRACK_FLAG_UNKNOWN\n  } track_flag_t;\n\n  /*! \\brief Structure containing attributes associated with a track */\n  typedef struct {\n    track_flag_t preemphasis; /**< Linear preemphasis on an audio track */\n    track_flag_t copy_permit; /**< Whether copying is permitted */\n    int channels;             /**< Number of audio channels, 2, 4. -2 if not\n                                   implemented or -1 for error.\n                              */\n  } track_flags_t;\n\n  /*! The leadout track is always 0xAA, regardless of # of tracks on\n    disc, or what value may be used internally. For example although\n    OS X uses a different value for the lead-out track internally than\n    given below, programmers should use CDIO_CDROM_LEADOUT_TRACK and\n    not worry about this.\n  */\n\n  /*! An enumeration for some of the CDIO_CDROM_* \\#defines below. This\n    isn't really an enumeration one would really use in a program; it\n    is to be helpful in debuggers where wants just to refer to the\n    CDIO_CDROM_* names and get something.\n  */\n  extern enum cdio_track_enums {\n    CDIO_CDROM_LBA           = 0x01, /**< \"logical block\": first frame is #0 */\n    CDIO_CDROM_MSF           = 0x02, /**< \"minute-second-frame\": binary, not\n                                        BCD here! */\n    CDIO_CDROM_DATA_TRACK    = 0x04,\n    CDIO_CDROM_CDI_TRACK     = 0x10,\n    CDIO_CDROM_XA_TRACK      = 0x20,\n    CDIO_CD_MAX_TRACKS       =   99, /**< Largest CD track number */\n    CDIO_CDROM_LEADOUT_TRACK = 0xAA, /**< Lead-out track number */\n    CDIO_INVALID_TRACK       = 0xFF, /**<  Constant for invalid track number */\n\n   } cdio_track_enums;\n\n#define CDIO_CD_MIN_TRACK_NO  1 /**< Smallest CD track number */\n\n  /*! track modes (Table 350)\n    reference: MMC-3 draft revsion - 10g\n  */\n  typedef enum {\n    AUDIO,                      /**< 2352 byte block length */\n    MODE1,                      /**< 2048 byte block length */\n    MODE1_RAW,                  /**< 2352 byte block length */\n    MODE2,                      /**< 2336 byte block length */\n    MODE2_FORM1,                /**< 2048 byte block length */\n    MODE2_FORM2,                /**< 2324 byte block length */\n    MODE2_FORM_MIX,             /**< 2336 byte block length */\n    MODE2_RAW                   /**< 2352 byte block length */\n  } trackmode_t;\n\n  /*!\n    Get the number of the first track.\n\n    @return the track number or CDIO_INVALID_TRACK\n    on error.\n  */\n  track_t cdio_get_first_track_num(const CdIo_t *p_cdio);\n\n  /*!\n    Return the last track number.\n    CDIO_INVALID_TRACK is returned on error.\n  */\n  track_t cdio_get_last_track_num (const CdIo_t *p_cdio);\n\n\n  /*! Find the track which contains lsn.\n    CDIO_INVALID_TRACK is returned if the lsn outside of the CD or\n    if there was some error.\n\n    If the lsn is before the pregap of the first track 0 is returned.\n    Otherwise we return the track that spans the lsn.\n  */\n  track_t cdio_get_track(const CdIo_t *p_cdio, lsn_t lsn);\n\n  /*! Return number of channels in track: 2 or 4; -2 if not\n      implemented or -1 for error.\n      Not meaningful if track is not an audio track.\n  */\n  int cdio_get_track_channels(const CdIo_t *p_cdio, track_t i_track);\n\n  /*! Return copy protection status on a track. Is this meaningful\n      if not an audio track?\n   */\n  track_flag_t cdio_get_track_copy_permit(const CdIo_t *p_cdio,\n                                          track_t i_track);\n\n  /*!\n    Get the format (audio, mode2, mode1) of track.\n  */\n  track_format_t cdio_get_track_format(const CdIo_t *p_cdio, track_t i_track);\n\n  /*!\n    Return true if we have XA data (green, mode2 form1) or\n    XA data (green, mode2 form2). That is track begins:\n    sync - header - subheader\n    12     4      -  8\n\n    FIXME: there's gotta be a better design for this and get_track_format?\n  */\n  bool cdio_get_track_green(const CdIo_t *p_cdio, track_t i_track);\n\n  /*!\n    Return the ending LSN for track number\n    i_track in cdio.  CDIO_INVALID_LSN is returned on error.\n  */\n  lsn_t cdio_get_track_last_lsn(const CdIo_t *p_cdio, track_t i_track);\n\n  /*!\n    Get the starting LBA for track number\n    i_track in p_cdio.  Track numbers usually start at something\n    greater than 0, usually 1.\n\n    The \"leadout\" track is specified either by\n    using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1.\n\n    @param p_cdio object to get information from\n    @param i_track  the track number we want the LSN for\n    @return the starting LBA or CDIO_INVALID_LBA on error.\n  */\n  lba_t cdio_get_track_lba(const CdIo_t *p_cdio, track_t i_track);\n\n  /*!\n    Return the starting LSN for track number\n    i_track in p_cdio.  Track numbers usually start at something\n    greater than 0, usually 1.\n\n    The \"leadout\" track is specified either by\n    using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1.\n\n    @param p_cdio object to get information from\n    @param i_track  the track number we want the LSN for\n    @return the starting LSN or CDIO_INVALID_LSN on error.\n  */\n  lsn_t cdio_get_track_lsn(const CdIo_t *p_cdio, track_t i_track);\n\n  /*!\n    Return the starting LBA for the pregap for track number\n    i_track in p_cdio.  Track numbers usually start at something\n    greater than 0, usually 1.\n\n    @param p_cdio object to get information from\n    @param i_track  the track number we want the LBA for\n    @return the starting LBA or CDIO_INVALID_LBA on error.\n  */\n  lba_t cdio_get_track_pregap_lba(const CdIo_t *p_cdio, track_t i_track);\n\n  /*!\n    Return the starting LSN for the pregap for track number\n    i_track in p_cdio.  Track numbers usually start at something\n    greater than 0, usually 1.\n\n    @param p_cdio object to get information from\n    @param i_track  the track number we want the LSN for\n    @return the starting LSN or CDIO_INVALID_LSN on error.\n  */\n  lsn_t cdio_get_track_pregap_lsn(const CdIo_t *p_cdio, track_t i_track);\n\n  /*!\n    Get the International Standard Recording Code (ISRC) for track number\n    i_track in p_cdio.  Track numbers usually start at something\n    greater than 0, usually 1.\n\n    @return the International Standard Recording Code (ISRC) or NULL\n    if there is none or we don't have the ability to get it.\n\n    Note: The caller must free the returned string with cdio_free()\n    when done with it.\n\n  */\n  char * cdio_get_track_isrc (const CdIo_t *p_cdio, track_t i_track);\n\n  /*!\n    Return the starting MSF (minutes/secs/frames) for track number\n    i_track in p_cdio.  Track numbers usually start at something\n    greater than 0, usually 1.\n\n    The \"leadout\" track is specified either by\n    using i_track CDIO_CDROM_LEADOUT_TRACK or the total tracks+1.\n\n    @return true if things worked or false if there is no track entry.\n  */\n  bool cdio_get_track_msf(const CdIo_t *p_cdio, track_t i_track,\n                          /*out*/ msf_t *msf);\n\n  /*! Get linear preemphasis status on an audio track\n      This is not meaningful if not an audio track?\n   */\n  track_flag_t cdio_get_track_preemphasis(const CdIo_t *p_cdio,\n                                          track_t i_track);\n\n  /*!\n    Get the number of sectors between this track an the next.  This\n    includes any pregap sectors before the start of the next track.\n    Track numbers usually start at something\n    greater than 0, usually 1.\n\n    @return the number of sectors or 0 if there is an error.\n  */\n  unsigned int cdio_get_track_sec_count(const CdIo_t *p_cdio, track_t i_track);\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_TRACK_H_ */\n"
  },
  {
    "path": "src/libcdio/cdio/types.h",
    "content": "/*\n    Copyright (C) 2002-2008, 2012, 2017, 2019, 2024\n                  Rocky Bernstein <rocky@gnu.org>\n    Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/** \\file types.h\n *  \\brief  Common type definitions used pervasively in libcdio.\n */\n\n\f\n#ifndef CDIO_TYPES_H_\n#define CDIO_TYPES_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#else\n# include <stdbool.h>\n#endif /* __cplusplus */\n\n#include <stddef.h>\n\n/* If <sys/types.h> is not available on your platform please\n   contact the libcdio mailing list so that we can fix it! */\n#if !defined(ARE_THERE_STILL_ENVS_WITHOUT_SYS_TYPES)\n#include <sys/types.h>\n#endif\n\n#if defined(AMIGA)\ntypedef u_int8_t uint8_t;\ntypedef u_int16_t uint16_t;\ntypedef u_int32_t uint32_t;\ntypedef u_int64_t uint64_t;\n#else\n/* If <stdint.h> is not available on your platform please\n   contact the libcdio mailing list so that we can fix it!\n   For MSVC, you can find both a public domain stdint.h and\n   inttypes.h in the MSVC/missing directory of libcdio. */\n#include <stdint.h>\n#endif\n\ntypedef uint8_t ubyte;\n\n/* MSVC does not define mode_t and ssize_t by default. The way\n   to compensate for missing UNIX types is to include a custom\n   unistd.h that defines them. Such a file is provided with\n   the libcdio source, in the MSVC/missing directory */\n#if defined(_MSC_VER)\n#include <unistd.h>\n#endif\n\n  /* default HP/UX macros are broken */\n#if defined(__hpux__)\n# undef UINT16_C\n# undef UINT32_C\n# undef UINT64_C\n# undef INT64_C\n#endif\n\n  /* if it's still not defined, take a good guess... should work for\n     most 32bit and 64bit archs */\n\n#ifndef UINT16_C\n# define UINT16_C(c) c ## U\n#endif\n\n#ifndef UINT32_C\n# if defined (SIZEOF_INT) && SIZEOF_INT == 4\n#  define UINT32_C(c) c ## U\n# elif defined (SIZEOF_LONG) && SIZEOF_LONG == 4\n#  define UINT32_C(c) c ## UL\n# else\n#  define UINT32_C(c) c ## U\n# endif\n#endif\n\n#ifndef UINT64_C\n# if defined (SIZEOF_LONG) && SIZEOF_LONG == 8\n#  define UINT64_C(c) c ## UL\n# elif defined (SIZEOF_INT) && SIZEOF_INT == 8\n#  define UINT64_C(c) c ## U\n# else\n#  define UINT64_C(c) c ## ULL\n# endif\n#endif\n\n#ifndef INT64_C\n# if defined (SIZEOF_LONG) && SIZEOF_LONG == 8\n#  define INT64_C(c) c ## L\n# elif defined (SIZEOF_INT) && SIZEOF_INT == 8\n#  define INT64_C(c) c\n# else\n#  define INT64_C(c) c ## LL\n# endif\n#endif\n\n  /* some GCC optimizations -- gcc 2.5+ */\n\n#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)\n#define GNUC_PRINTF( format_idx, arg_idx )              \\\n  __attribute__((format (printf, format_idx, arg_idx)))\n#define GNUC_SCANF( format_idx, arg_idx )               \\\n  __attribute__((format (scanf, format_idx, arg_idx)))\n#define GNUC_FORMAT( arg_idx )                  \\\n  __attribute__((format_arg (arg_idx)))\n#define GNUC_NORETURN                           \\\n  __attribute__((noreturn))\n#define GNUC_CONST                              \\\n  __attribute__((const))\n#define GNUC_UNUSED                             \\\n  __attribute__((unused))\n#define GNUC_PACKED                             \\\n  __attribute__((packed))\n#else   /* !__GNUC__ */\n#define GNUC_PRINTF( format_idx, arg_idx )\n#define GNUC_SCANF( format_idx, arg_idx )\n#define GNUC_FORMAT( arg_idx )\n#define GNUC_NORETURN\n#define GNUC_CONST\n#define GNUC_UNUSED\n#define GNUC_PACKED\n#ifdef _MSC_VER\n#define __PRETTY_FUNCTION__ __FUNCSIG__\n#endif\n#endif  /* !__GNUC__ */\n\n#if defined(__MINGW32__) || (defined( __clang_major__) && __clang_major__ > 9)\n#  define PRAGMA_BEGIN_PACKED _Pragma(\"pack(push)\") \\\n                              _Pragma(\"pack(1)\")\n#  define PRAGMA_END_PACKED   _Pragma(\"pack(pop)\")\n#elif __GNUC__ > 4  || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901)\n     /* should work with GCC > 4.0 clang and most EDG-frontend based C\n        and C++ compilers */\n#    define PRAGMA_BEGIN_PACKED _Pragma(\"pack(1)\")\n#    define PRAGMA_END_PACKED   _Pragma(\"pack()\")\n#elif defined(_MSC_VER)\n#  define PRAGMA_BEGIN_PACKED __pragma(pack(push, 1))\n#  define PRAGMA_END_PACKED   __pragma(pack(pop))\n#else /* neither gcc nor _Pragma() available... */\n   /* ...so let's be naive and hope the regression testsuite is run... */\n#  define PRAGMA_BEGIN_PACKED\n#  define PRAGMA_END_PACKED\n#endif\n\n  /*\n   * user directed static branch prediction gcc 2.96+\n   */\n#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)\n# define GNUC_LIKELY(x)   __builtin_expect((x),true)\n# define GNUC_UNLIKELY(x) __builtin_expect((x),false)\n#else\n# define GNUC_LIKELY(x)   (x)\n# define GNUC_UNLIKELY(x) (x)\n#endif\n\n  /** Provide a notice for deprecated elements. Before gcc 4.5 'deprecated'\n   takes no arguments. */\n#if defined(__GNUC__)\n# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)\n#   define LIBCDIO_DEPRECATED(object, notice) object __attribute__ ((deprecated(notice)))\n# else\n#   define LIBCDIO_DEPRECATED(object, notice) object __attribute__ ((deprecated))\n# endif\n#elif defined(_MSC_VER)\n#define LIBCDIO_DEPRECATED(object, notice) __declspec(deprecated(notice)) object\n#else\n#define LIBCDIO_DEPRECATED(object, notice)\n#endif\n\n  /** our own offsetof()-like macro */\n#define __cd_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)\n\n  /*!\n    \\brief MSF (minute/second/frame) structure\n\n    One CD-ROMs addressing scheme especially used in audio formats\n    (Red Book) is an address by minute, sector and frame which\n    BCD-encoded in three bytes. An alternative format is an lba_t.\n\n    Note: the fields in this structure are BCD encoded. Use\n    cdio_to_bcd8() or cdio_from_bcd8() to convert an integer into or\n    out of this format. The format specifier %x (not %d) can be used\n    if you need to format or print values in this structure.\n\n    @see lba_t\n  */\n  PRAGMA_BEGIN_PACKED\n  struct msf_s {\n    uint8_t m, s, f; /* BCD encoded! */\n  } GNUC_PACKED;\n  PRAGMA_END_PACKED\n\n  typedef struct msf_s msf_t;\n\n#define msf_t_SIZEOF 3\n\n  /*!\n    \\brief UTF-8 char definition\n\n    Type to denote UTF-8 strings.\n  */\n\n  typedef char cdio_utf8_t;\n\n  typedef enum  {\n    nope  = 0,\n    yep   = 1,\n    dunno = 2\n  } bool_3way_t;\n\n  /* type used for bit-fields in structs (1 <= bits <= 8) */\n#if defined(__GNUC__)\n  /* this is strict ISO C99 which allows only 'unsigned int', 'signed\n     int' and '_Bool' explicitly as bit-field type */\n  typedef unsigned int bitfield_t;\n#else\n  /* other compilers might increase alignment requirements to match the\n     'unsigned int' type -- fixme: find out how unalignment accesses can\n     be pragma'ed on non-gcc compilers */\n  typedef uint8_t bitfield_t;\n#endif\n\n  /*! The type of a Logical Block Address. We allow for an lba to be\n    negative to be consistent with an lba, although I'm not sure this\n    this is possible.\n\n   */\n  typedef int32_t lba_t;\n\n  /*! The type of a Logical Sector Number. Note that an lba can be negative\n    and the MMC3 specs allow for a conversion of a negative lba.\n\n    @see msf_t\n  */\n  typedef int32_t lsn_t;\n\n  /* Address in either MSF or logical format */\n  union cdio_cdrom_addr\n  {\n    msf_t       msf;\n    lba_t       lba;\n  };\n\n  /*! The type of a track number 0..99. */\n  typedef uint8_t track_t;\n\n  /*! The type of a session number 0..99. */\n  typedef uint8_t session_t;\n\n  /*!\n    Constant for invalid session number\n  */\n#define CDIO_INVALID_SESSION   0xFF\n\n  /*!\n    Constant for invalid LBA. It is 151 less than the most negative\n    LBA -45150. This provide slack for the 150-frame offset in\n    LBA to LSN 150 conversions\n  */\n#define CDIO_INVALID_LBA    -45301\n\n  /*!\n    Constant for invalid LSN\n  */\n#define CDIO_INVALID_LSN    CDIO_INVALID_LBA\n\n  /*!\n    Number of ASCII bytes in a media catalog number (MCN).\n    We include an extra 0 byte so these can be used as C strings.\n  */\n#define CDIO_MCN_SIZE       13\n\n  /*!\n    Type to hold ASCII bytes in a media catalog number (MCN).\n    We include an extra 0 byte so these can be used as C strings.\n  */\n  typedef char cdio_mcn_t[CDIO_MCN_SIZE+1];\n\n\n  /*!\n    Number of ASCII bytes in International Standard Recording Codes (ISRC)\n  */\n#define CDIO_ISRC_SIZE       12\n\n  /*!\n    Type to hold ASCII bytes in a ISRC.\n    We include an extra 0 byte so these can be used as C strings.\n  */\n  typedef char cdio_isrc_t[CDIO_ISRC_SIZE+1];\n\n  typedef int cdio_fs_anal_t;\n\n  /*!\n    track flags\n    Q Sub-channel Control Field (4.2.3.3)\n  */\n  typedef enum {\n    CDIO_TRACK_FLAG_NONE =               0x00,  /**< no flags set */\n    CDIO_TRACK_FLAG_PRE_EMPHASIS =       0x01,  /**< audio track recorded with\n                                                   pre-emphasis */\n    CDIO_TRACK_FLAG_COPY_PERMITTED =     0x02,  /**< digital copy permitted */\n    CDIO_TRACK_FLAG_DATA =               0x04,  /**< data track */\n    CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO = 0x08,  /**< 4 audio channels */\n  CDIO_TRACK_FLAG_SCMS =                 0x10   /**< SCMS (5.29.2.7) */\n} cdio_track_flag;\n\n\n/* Note that this matches the free() prototype.*/\ntypedef void (*CdioDataFree_t)(void *ptr);\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_TYPES_H_ */\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/cdio/udf.h",
    "content": "/*  \n    Copyright (C) 2005, 2006, 2008, 2010 Rocky Bernstein <rocky@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/*!\n * \\file udf.h \n *\n * \\brief The top-level interface header for libudf: UDF filesystem\n * library; applications include this.\n *\n*/\n\n#ifndef UDF_H\n#define UDF_H \n\n#include <cdio/cdio.h>\n#include <cdio/ecma_167.h>\n#include <cdio/posix.h>\n\ntypedef uint16_t partition_num_t;\n\n/** Opaque structures. */\ntypedef struct udf_s udf_t; \ntypedef struct udf_file_s udf_file_t;\n\ntypedef struct udf_dirent_s {\n    char              *psz_name;\n    bool               b_dir;    /* true if this entry is a directory. */\n    bool               b_parent; /* True if has parent directory (e.g. not root\n                                    directory). If not set b_dir will probably\n                                    be true. */\n    udf_t             *p_udf;\n    uint32_t           i_part_start;\n    uint32_t           i_loc, i_loc_end;\n    uint64_t           dir_left;\n    uint8_t           *sector;\n    udf_fileid_desc_t *fid;\n    \n    /* This field has to come last because it is variable in length. */\n    udf_file_entry_t   fe;\n} udf_dirent_t;\n\n\n\n/**\n   Imagine the below a \\#define'd value rather than distinct values of\n   an enum.\n*/\ntypedef enum {\n  UDF_BLOCKSIZE       = 2048\n} udf_enum1_t; \n\n/** This variable is trickery to force the above enum symbol value to\n    be recorded in debug symbol tables. It is used to allow one refer\n    to above enumeration values in a debugger and debugger\n    expressions */\nextern udf_enum1_t debug_udf_enum1;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n  /*!\n    Close UDF and free resources associated with p_udf.\n  */\n  bool udf_close (udf_t *p_udf);\n  \n  /*!  \n    Seek to a position i_start and then read i_blocks. Number of\n    blocks read is returned. One normally expects the return to be\n    equal to i_blocks.\n  */\n\n  driver_return_code_t udf_read_sectors (const udf_t *p_udf, void *ptr, \n                                         lsn_t i_start,  long int i_blocks);\n\n  /*!\n    Open an UDF for reading. Maybe in the future we will have\n    a mode. NULL is returned on error.\n    \n    Caller must free result - use udf_close for that.\n  */\n  udf_t *udf_open (const char *psz_path);\n  \n  /*!\n    Return the partition number of the the opened udf handle. -1 \n    Is returned if we have an error.\n  */\n  int16_t udf_get_part_number(const udf_t *p_udf);\n\n  /*!\n    Get the root in p_udf. If b_any_partition is false then\n    the root must be in the given partition.\n    NULL is returned if the partition is not found or a root is not found or\n    there is on error.\n\n    Caller must free result - use udf_file_free for that.\n  */\n  udf_dirent_t *udf_get_root (udf_t *p_udf, bool b_any_partition, \n                              partition_num_t i_partition);\n  \n  /**\n   * Gets the Volume Identifier string, in 8bit unicode (latin-1)\n   * psz_volid, place to put the string\n   * i_volid, size of the buffer psz_volid points to\n   * returns the size of buffer needed for all data\n   */\n  int udf_get_volume_id(udf_t *p_udf, /*out*/ char *psz_volid,  \n                        unsigned int i_volid);\n  \n  /**\n   * Gets the Volume Set Identifier, as a 128-byte dstring (not decoded)\n   * WARNING This is not a null terminated string\n   * volsetid, place to put the data\n   * i_volsetid, size of the buffer psz_volsetid points to \n   * the buffer should be >=128 bytes to store the whole volumesetidentifier\n   * returns the size of the available volsetid information (128)\n   * or 0 on error\n   */\n  int udf_get_volumeset_id(udf_t *p_udf, /*out*/ uint8_t *volsetid,\n                           unsigned int i_volsetid);\n\n  /**\n   * Gets the Logical Volume Identifier string, in 8bit unicode (latin-1)\n   * psz_logvolid, place to put the string\n   * i_logvolid, size of the buffer psz_logvolid points to\n   * returns the size of buffer needed for all data\n   * A call to udf_get_root() should have been issued before this call\n   */\n  int udf_get_logical_volume_id(udf_t *p_udf, /*out*/ char *psz_logvolid,  \n                        unsigned int i_logvolid);\n\n  /*!\n    Return a file pointer matching psz_name. \n  */\n  udf_dirent_t *udf_fopen(udf_dirent_t *p_udf_root, const char *psz_name);\n  \n  /*! udf_mode_string - fill in string PSZ_STR with an ls-style ASCII\n    representation of the i_mode. PSZ_STR is returned.\n\n    10 characters are stored in PSZ_STR; a terminating null byte is added.\n    The characters stored in PSZ_STR are:\n    \n    0   File type.  'd' for directory, 'c' for character\n        special, 'b' for block special, 'm' for multiplex,\n        'l' for symbolic link, 's' for socket, 'p' for fifo,\n        '-' for regular, '?' for any other file type\n\n    1   'r' if the owner may read, '-' otherwise.\n\n    2   'w' if the owner may write, '-' otherwise.\n\n    3   'x' if the owner may execute, 's' if the file is\n        set-user-id, '-' otherwise.\n        'S' if the file is set-user-id, but the execute\n        bit isn't set.\n\n    4   'r' if group members may read, '-' otherwise.\n\n    5   'w' if group members may write, '-' otherwise.\n\n    6   'x' if group members may execute, 's' if the file is\n        set-group-id, '-' otherwise.\n        'S' if it is set-group-id but not executable.\n\n    7   'r' if any user may read, '-' otherwise.\n\n    8   'w' if any user may write, '-' otherwise.\n\n    9   'x' if any user may execute, 't' if the file is \"sticky\"\n        (will be retained in swap space after execution), '-'\n        otherwise.\n        'T' if the file is sticky but not executable.  */\n\n    char *udf_mode_string (mode_t i_mode, char *psz_str);\n\n    bool udf_get_lba(const udf_file_entry_t *p_udf_fe, \n                     /*out*/ uint32_t *start, /*out*/ uint32_t *end);\n\n    /**\n     * Seek to a specific offset in a UDF file.\n     * The offset *must* be a multiple of UDF_BLOCKSIZE.\n     * Returns true if the position was successfully changed, or false on\n     * any error condition (such as offset out of range or not aligned to\n     * UDF_BLOCKSIZE).\n     */\n    bool udf_setpos(udf_dirent_t* p_udf_dirent, off_t offset);\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#include <cdio/udf_time.h>\n#include <cdio/udf_file.h>\n\n#endif /*UDF_H*/\n"
  },
  {
    "path": "src/libcdio/cdio/udf_file.h",
    "content": "/*  \n    Copyright (C) 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/**\n * \\file udf_file.h \n *\n * \\brief Routines involving UDF file operations\n *\n*/\n\n#ifndef UDF_FILE_H\n#define UDF_FILE_H \n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n  /**\n    Return the file id descriptor of the given file.\n  */\n  bool udf_get_fileid_descriptor(const udf_dirent_t *p_udf_dirent, \n\t\t\t\t /*out*/ udf_fileid_desc_t *p_udf_fid);\n\n  /**\n    Return the name of the file\n  */\n  const char *udf_get_filename(const udf_dirent_t *p_udf_dirent);\n  \n  /**\n    Return the name of the file\n  */\n  bool udf_get_file_entry(const udf_dirent_t *p_udf_dirent, \n\t\t\t  /*out*/ udf_file_entry_t *p_udf_fe);\n\n  /**\n    Return the number of hard links of the file. Return 0 if error.\n  */\n  uint16_t udf_get_link_count(const udf_dirent_t *p_udf_dirent);\n\n  /**\n    Return the file length the file. Return 2147483647L if error.\n  */\n  uint64_t udf_get_file_length(const udf_dirent_t *p_udf_dirent);\n\n  /**  \n    Returns a POSIX mode for a given p_udf_dirent.\n  */\n  mode_t udf_get_posix_filemode(const udf_dirent_t *p_udf_dirent);\n\n  /**\n    Return the next subdirectory. \n  */\n  udf_dirent_t *udf_opendir(const udf_dirent_t *p_udf_dirent);\n  \n  /**\n     Attempts to read up to count bytes from UDF directory entry\n     p_udf_dirent into the buffer starting at buf. buf should be a\n     multiple of UDF_BLOCKSIZE bytes. Reading continues after the\n     point at which we last read or from the beginning the first time.\n     \n     If count is zero, read() returns zero and has no other results. If\n     count is greater than SSIZE_MAX, the result is unspecified.\n     \n     If there is an error, cast the result to driver_return_code_t for \n     the specific error code.\n  */\n  /**\n    Attempts to read up to count bytes from file descriptor fd into\n    the buffer starting at buf.\n    \n    If count is zero, read() returns zero and has no other results. If\n    count is greater than SSIZE_MAX, the result is unspecified.\n  */\n  ssize_t udf_read_block(const udf_dirent_t *p_udf_dirent, \n\t\t\t void * buf, size_t count);\n\n  /**\n    Advances p_udf_direct to the the next directory entry in the\n    pointed to by p_udf_dir. It also returns this as the value.  NULL\n    is returned on reaching the end-of-file or if an error. Also\n    p_udf_dirent is free'd. If the end of is not reached the caller\n    must call udf_dirent_free() with p_udf_dirent when done with it to \n    release resources.\n  */\n  udf_dirent_t *udf_readdir(udf_dirent_t *p_udf_dirent);\n  \n  /**\n    free free resources associated with p_udf_dirent.\n  */\n  bool udf_dirent_free(udf_dirent_t *p_udf_dirent);\n  \n  /**\n    Return true if the file is a directory.\n  */\n  bool udf_is_dir(const udf_dirent_t *p_udf_dirent);\n  \n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /*UDF_FILE_H*/\n"
  },
  {
    "path": "src/libcdio/cdio/udf_time.h",
    "content": "/*\n    Copyright (C) 2005, 2008, 2012 Rocky Bernstein <rocky@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/*!\n * \\file udf_time.h\n *\n * \\brief UDF time conversion and access files.\n *\n*/\n\n#ifndef UDF_TIME_H\n#define UDF_TIME_H\n\n#include <time.h>\n\n#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) && !defined(__struct_timespec_defined)\nstruct timespec {\n  time_t  tv_sec;   /* Seconds */\n  long    tv_nsec;  /* Nanoseconds */\n};\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n  /*!\n    Return the access time of the file.\n  */\n  time_t udf_get_access_time(const udf_dirent_t *p_udf_dirent);\n\n  /*!\n    Return the attribute (most recent create or access) time of the file\n  */\n  time_t udf_get_attribute_time(const udf_dirent_t *p_udf_dirent);\n\n  /*!\n    Return the modification time of the file.\n  */\n  time_t udf_get_modification_time(const udf_dirent_t *p_udf_dirent);\n\n  /*!\n    Return the access timestamp of the file\n  */\n  udf_timestamp_t *udf_get_access_timestamp(const udf_dirent_t *p_udf_dirent);\n\n  /*!\n    Return the modification timestamp of the file\n  */\n  udf_timestamp_t *udf_get_modification_timestamp(const udf_dirent_t\n\t\t\t\t\t\t  *p_udf_dirent);\n\n  /*!\n    Return the attr timestamp of the file\n  */\n  udf_timestamp_t *udf_get_attr_timestamp(const udf_dirent_t *p_udf_dirent);\n\n  /*!\n    Convert a UDF timestamp to a time_t. If microseconds are desired,\n    use dest_usec. The return value is the same as dest. */\n  time_t *udf_stamp_to_time(time_t *dest, long int *dest_usec,\n\t\t\t  const udf_timestamp_t src);\n\n  udf_timestamp_t *udf_timespec_to_stamp(const struct timespec ts,\n\t\t\t\t\t udf_timestamp_t *dest);\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /*UDF_TIME_H*/\n"
  },
  {
    "path": "src/libcdio/cdio/utf8.h",
    "content": "/*\n    Copyright (C) 2008, 2012, 2014 Rocky Bernstein <rocky@gnu.org>\n    Copyright (C) 2006 Burkhard Plaum <plaum@ipf.uni-stuttgart.de>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/** \\file utf8.h \n *\n *  \\brief UTF-8 support\n */\n\f\n\n#include <cdio/types.h>\n\n/** \\brief Opaque characterset converter\n */\n\ntypedef struct cdio_charset_coverter_s cdio_charset_coverter_t;\n\n/** \\brief Create a charset converter\n *  \\param src_charset Source charset\n *  \\param dst_charset Destination charset\n *  \\returns A newly allocated charset converter\n */\n\ncdio_charset_coverter_t *\ncdio_charset_converter_create(const char * src_charset,\n                              const char * dst_charset);\n\n/** \\brief Destroy a characterset converter\n *  \\param cnv A characterset converter\n */\n\nvoid cdio_charset_converter_destroy(cdio_charset_coverter_t*cnv);\n\n/** \\brief Convert a string from one character set to another\n *  \\param cnv A charset converter\n *  \\param src Source string\n *  \\param src_len Length of source string\n *  \\param dst Returns destination string\n *  \\param dst_len If non NULL, returns the length of the destination string\n *  \\returns true if conversion was sucessful, false else.\n *\n *  The destination string must be freed by the caller with cdio_free().\n *  If you pass -1 for src_len, strlen() will be used.\n */\n\nbool cdio_charset_convert(cdio_charset_coverter_t*cnv,\n                          char * src, int src_len,\n                          char ** dst, int * dst_len);\n\n/** \\brief Convert a string from UTF-8 to another charset\n *  \\param src Source string (0 terminated)\n *  \\param dst Returns destination string\n *  \\param dst_len If non NULL, returns the length of the destination string\n *  \\param dst_charset The characterset to convert to\n *  \\returns true if conversion was sucessful, false else.\n *\n *  This is a convenience function, which creates a charset converter,\n *  converts one string and destroys the charset converter.\n *\n *  The destination string must be freed by the caller with cdio_free().\n */\n\n\nbool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst,\n                            int * dst_len, const char * dst_charset);\n\n/** \\brief Convert a string from another charset to UTF-8 \n *  \\param src Source string\n *  \\param src_len Length of the source string\n *  \\param dst Returns destination string (0 terminated)\n *  \\param src_charset The characterset to convert from\n *  \\returns true if conversion was sucessful, false else.\n *\n *  This is a convenience function, which creates a charset converter,\n *  converts one string and destroys the charset converter.\n *\n *  The destination string must be freed by the caller with cdio_free().\n *  If you pass -1 for src_len, strlen() will be used.\n */\n\n\nbool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst,\n                          const char * src_charset);\n\n#ifdef _WIN32\n/** \\brief Convert an UTF8 string to UTF-16 (allocate returned string)\n *  \\param str Source string\n *  \\returns NULL if the conversion was unsuccesful. Caller must free the\n *  returned string with cdio_free().\n *  This is a convenience function available on Windows platforms only.\n */\nwchar_t* cdio_utf8_to_wchar(const char* str);\n\n#include <stdio.h> /* for FILE */\n/** \\brief Provides an UTF-8 compliant version of fopen for Windows\n *  The parameters and return value are the same as fopen().\n */\nFILE* fopen_utf8(const char* filename, const char* mode);\n#endif\n"
  },
  {
    "path": "src/libcdio/cdio/util.h",
    "content": "/*\n    Copyright (C) 2004, 2005, 2006, 2008, 2010, 2012, 2014\n    Rocky Bernstein <rocky@gnu.org>\n    Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n#ifndef CDIO_UTIL_H_\n#define CDIO_UTIL_H_\n\n/*!\n   \\file util.h\n   \\brief Miscellaneous utility functions.\n\n   Warning: this will probably get removed/replaced by using glib.h\n*/\n#include <stdlib.h>\n#include <cdio/types.h>\n\n#if !defined CDIO_INLINE\n#if defined(__cplusplus) || defined(inline)\n#define CDIO_INLINE inline\n#elif defined(__GNUC__)\n#define CDIO_INLINE __inline__\n#elif defined(_MSC_VER)\n#define CDIO_INLINE __inline\n#else\n#define CDIO_INLINE\n#endif\n#endif /* CDIO_INLINE */\n\n#undef  MAX\n#define MAX(a, b)  (((a) > (b)) ? (a) : (b))\n\n#undef  MIN\n#define MIN(a, b)  (((a) < (b)) ? (a) : (b))\n\n#undef  IN\n#define IN(x, low, high) ((x) >= (low) && (x) <= (high))\n\n#undef  CLAMP\n#define CLAMP(x, low, high)  (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))\n\nstatic CDIO_INLINE uint32_t\n_cdio_len2blocks (uint32_t i_len, uint16_t i_blocksize)\n{\n  uint32_t i_blocks;\n\n  i_blocks = i_len / (uint32_t) i_blocksize;\n  if (i_len % i_blocksize)\n    i_blocks++;\n\n  return i_blocks;\n}\n\n\n/*! free() and NULL out p_obj it is not already null. */\n#define CDIO_FREE_IF_NOT_NULL(p_obj) \\\n  if (NULL != p_obj) { free(p_obj); p_obj=NULL; };\n\n\n/* round up to next block boundary */\nstatic CDIO_INLINE unsigned\n_cdio_ceil2block (unsigned offset, uint16_t i_blocksize)\n{\n  return _cdio_len2blocks (offset, i_blocksize) * i_blocksize;\n}\n\nstatic CDIO_INLINE unsigned int\n_cdio_ofs_add (unsigned offset, unsigned length, uint16_t i_blocksize)\n{\n  if (i_blocksize - (offset % i_blocksize) < length)\n    offset = _cdio_ceil2block (offset, i_blocksize);\n\n  offset += length;\n\n  return offset;\n}\n\nstatic CDIO_INLINE const char *\n_cdio_bool_str (bool b)\n{\n  return b ? \"yes\" : \"no\";\n}\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid *\n_cdio_memdup (const void *mem, size_t count);\n\nchar *\n_cdio_strdup_upper (const char str[]);\n\nint\n_cdio_stricmp(const char str1[], const char str2[]);\n\nint\n_cdio_strnicmp(const char str1[], const char str2[], size_t count);\n\n/*! Duplicate path and make it platform compliant. Typically needed for\n    MinGW/MSYS where a \"/c/...\" path must be translated to \"c:/...\" for\n    use with fopen(), etc. Returned string must be freed by the caller\n    using cdio_free(). */\nchar *\n_cdio_strdup_fixpath (const char path[]);\n\nvoid\n_cdio_strfreev(char **strv);\n\nsize_t\n_cdio_strlenv(char **str_array);\n\nchar **\n_cdio_strsplit(const char str[], char delim);\n\nuint8_t cdio_to_bcd8(uint8_t n);\nuint8_t cdio_from_bcd8(uint8_t p);\n\n/*!  cdio_realpath() same as POSIX.1-2001 realpath if that's\naround. If not we do poor-man's simulation of that behavior.  */\nchar *cdio_realpath (const char *psz_src, char *psz_dst);\n\n#ifdef WANT_FOLLOW_SYMLINK_COMPATIBILITY\n# define cdio_follow_symlink cdio_realpath\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* CDIO_UTIL_H_ */\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/cdio/version.h",
    "content": "/** \\file version.h\n *\n *  \\brief A file containing the libcdio package version\n *  number (20201) and OS build name.\n */\n\n/*! CDIO_VERSION is a C-Preprocessor macro of a string that shows what\n    version is used.  cdio_version_string has the same value, but it is a\n    constant variable that can be accessed at run time. */\n#define CDIO_VERSION \"2.2.1 (Rufus)\"\nextern const char *cdio_version_string; /**< = CDIO_VERSION */\n\n/*! LIBCDIO_VERSION_NUM is a C-Preprocessor macro that can be used for\n    testing in the C preprocessor. libcdio_version_num has the same\n    value, but it is a constant variable that can be accessed at run\n    time.  */\n#define LIBCDIO_VERSION_NUM 20201\n\nextern const unsigned int libcdio_version_num; /**< = LIBCDIO_VERSION_NUM */\n"
  },
  {
    "path": "src/libcdio/cdio/xa.h",
    "content": "/*\n    Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012\n    Rocky Bernstein <rocky@gnu.org>\n    Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n    See also iso9660.h by Eric Youngdale (1993) and in cdrtools. These are \n\n    Copyright 1993 Yggdrasil Computing, Incorporated\n    Copyright (c) 1999,2000 J. Schilling\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/*!\n   \\file xa.h \n   \\brief Things related to the ISO-9660 XA (Extended Attributes) format\n\n   Applications will probably not include this directly but via \n   the iso9660.h header.\n*/\n\n\f\n#ifndef CDIO_XA_H_\n#define CDIO_XA_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n  /*! An enumeration for some of the XA_* \\#defines below. This isn't\n    really an enumeration one would really use in a program it is to\n    be helpful in debuggers where wants just to refer to the XA_*\n    names and get something.\n  */\n  typedef enum {\n    ISO_XA_MARKER_OFFSET =   1024,\n    XA_PERM_RSYS =         0x0001,  /**< System Group Read */\n    XA_PERM_XSYS =         0x0004,  /**< System Group Execute */\n    \n    XA_PERM_RUSR =         0x0010,  /**< User (owner) Read */\n    XA_PERM_XUSR =         0x0040,  /**< User (owner) Execute */\n    \n    XA_PERM_RGRP =         0x0100,  /**< Group Read */\n    XA_PERM_XGRP =         0x0400,  /**< Group Execute */\n    \n    XA_PERM_ROTH =         0x1000,  /**< Other (world) Read */\n    XA_PERM_XOTH =         0x4000,  /**< Other (world) Execute */\n    \n    XA_ATTR_MODE2FORM1  =   (1 << 11),\n    XA_ATTR_MODE2FORM2  =   (1 << 12),\n    XA_ATTR_INTERLEAVED =   (1 << 13),\n    XA_ATTR_CDDA        =   (1 << 14),\n    XA_ATTR_DIRECTORY   =   (1 << 15),\n    \n    XA_PERM_ALL_READ    =   (XA_PERM_RUSR | XA_PERM_RSYS | XA_PERM_RGRP),\n    XA_PERM_ALL_EXEC    =   (XA_PERM_XUSR | XA_PERM_XSYS | XA_PERM_XGRP),\n    XA_PERM_ALL_ALL     =   (XA_PERM_ALL_READ | XA_PERM_ALL_EXEC),\n    \n    XA_FORM1_DIR  = (XA_ATTR_DIRECTORY | XA_ATTR_MODE2FORM1 | XA_PERM_ALL_ALL),\n    XA_FORM1_FILE =  (XA_ATTR_MODE2FORM1 | XA_PERM_ALL_ALL),\n    XA_FORM2_FILE =  (XA_ATTR_MODE2FORM2 | XA_PERM_ALL_ALL)\n  } xa_misc_enum_t;\n  \nextern const char ISO_XA_MARKER_STRING[sizeof(\"CD-XA001\")-1];\n\n#define ISO_XA_MARKER_STRING    \"CD-XA001\"\n\n/*! \\brief \"Extended Architecture\" according to the Philips Yellow Book.\n \nCD-ROM EXtended Architecture is a modification to the CD-ROM\nspecification that defines two new types of sectors.  CD-ROM XA was\ndeveloped jointly by Sony, Philips, and Microsoft, and announced in\nAugust 1988. Its specifications were published in an extension to the\nYellow Book.  CD-i, Photo CD, Video CD and CD-EXTRA have all\nsubsequently been based on CD-ROM XA.\n\nCD-XA defines another way of formatting sectors on a CD-ROM, including\nheaders in the sectors that describe the type (audio, video, data) and\nsome additional info (markers, resolution in case of a video or audio\nsector, file numbers, etc).\n\nThe data written on a CD-XA is consistent with and can be in ISO-9660\nfile system format and therefore be readable by ISO-9660 file system\ntranslators. But also a CD-I player can also read CD-XA discs even if\nits own `Green Book' file system only resembles ISO 9660 and isn't\nfully compatible. \n\n Note structure is big-endian.\n*/\ntypedef struct iso9660_xa_s\n{\n  uint16_t group_id;      /**< 0 */\n  uint16_t user_id;       /**< 0 */\n  uint16_t attributes;    /**< XA_ATTR_ */ \n  char     signature[2];  /**< { 'X', 'A' } */\n  uint8_t  filenum;       /**< file number, see also XA subheader */\n  uint8_t  reserved[5];   /**< zero */\n} GNUC_PACKED iso9660_xa_t;\n  \n  \n  /*!\n    Returns POSIX mode bitstring for a given file.\n  */\n  posix_mode_t iso9660_get_posix_filemode_from_xa(uint16_t i_perms);\n\n/*!\n  Returns a string interpreting the extended attribute xa_attr. \n  For example:\n  \\verbatim\n  d---1xrxrxr\n  ---2--r-r-r\n  -a--1xrxrxr\n  \\endverbatim\n  \n  A description of the characters in the string follows.\n  The 1st character is either \"d\" if the entry is a directory, or \"-\" if not\n  The 2nd character is either \"a\" if the entry is CDDA (audio), or \"-\" if not\n  The 3rd character is either \"i\" if the entry is interleaved, or \"-\" if not\n  The 4th character is either \"2\" if the entry is mode2 form2 or \"-\" if not\n  The 5th character is either \"1\" if the entry is mode2 form1 or \"-\" if not\n  Note that an entry will either be in mode2 form1 or mode form2. That\n  is you will either see \"2-\" or \"-1\" in the 4th & 5th positions.\n  \n  The 6th and 7th characters refer to permissions for a user while the\n  the 8th and 9th characters refer to permissions for a group while, and \n  the 10th and 11th characters refer to permissions for everyone. \n  \n  In each of these pairs the first character (6, 8, 10) is \"x\" if the \n  entry is executable. For a directory this means the directory is\n  allowed to be listed or \"searched\".\n  The second character of a pair (7, 9, 11) is \"r\" if the entry is allowed\n  to be read. \n*/\nconst char *\niso9660_get_xa_attr_str (uint16_t xa_attr);\n  \n/*! \n  Allocates and initalizes a new iso9600_xa_t variable and returns\n  it. The caller must free the returned result using iso9660_xa_free().\n\n  @see iso9660_xa\n*/\niso9660_xa_t *\niso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr, \n                 uint8_t filenum);\n\n/*! \n  Frees the passed iso9600_xa_t structure.\n\n  @see iso9660_xa\n*/\nvoid\niso9660_xa_free (iso9660_xa_t *_xa);\n\n#ifdef __cplusplus\n}\n\n/** The below variables are trickery to force the above enum symbol\n    values to be recorded in debug symbol tables. They are used to\n    allow one to refer to the enumeration value names in the typedefs\n    above in a debugger and debugger expressions.\n*/\nextern xa_misc_enum_t debugger_xa_misc_enum;\n\n  \n#endif /* __cplusplus */\n\n#endif /* CDIO_XA_H_ */\n\f\n/* \n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/config.h",
    "content": "/* config.h for libcdio (used by both MinGW and MSVC) */\r\n\r\n#if defined(_MSC_VER)\r\n/* Disable: warning C4996: The POSIX name for this item is deprecated. */\r\n#pragma warning(disable:4996)\r\n/* Disable: warning C4018: signed/unsigned mismatch */\r\n#pragma warning(disable:4018)\r\n/* Disable: warning C4242: conversion from 'x' to 'y', possible loss of data */\r\n#pragma warning(disable:4242) /* 32 bit */\r\n#pragma warning(disable:4244) /* 64 bit */\r\n#pragma warning(disable:4267) /* 64 bit */\r\n#endif\r\n\r\n/* what to put between the brackets for empty arrays */\r\n#define EMPTY_ARRAY_SIZE\r\n\r\n/* Define to 1 if you have the `chdir' function. */\r\n/* #undef HAVE_CHDIR */\r\n\r\n/* Define if time.h defines extern long timezone and int daylight vars. */\r\n#define HAVE_DAYLIGHT 1\r\n\r\n/* Define to 1 if you have the `drand48' function. */\r\n/* #undef HAVE_DRAND48 */\r\n\r\n/* Define to 1 if you have the <errno.h> header file. */\r\n#define HAVE_ERRNO_H 1\r\n\r\n/* Define to 1 if you have the <fcntl.h> header file. */\r\n#define HAVE_FCNTL_H 1\r\n\r\n/* Define to 1 if you have the `lseek64' function. */\r\n#define HAVE_LSEEK64 1\r\n/* The equivalent of lseek64 on MSVC is _lseeki64 */\r\n#define lseek64 _lseeki64\r\n\r\n/* Define to 1 if you have the `fseeko' function. */\r\n/* #undef HAVE_FSEEKO */\r\n\r\n/* Define to 1 if you have the `fseeko64' function. */\r\n#define HAVE_FSEEKO64 1\r\n\r\n#if defined(_MSC_VER)\r\n/* The equivalent of fseeko64 for MSVC is _fseeki64 */\r\n#define fseeko64 _fseeki64\r\n#endif\r\n\r\n/* Define to 1 if you have the `ftruncate' function. */\r\n#define HAVE_FTRUNCATE 1\r\n\r\n/* Define if you have the iconv() function and it works. */\r\n/* #undef HAVE_ICONV */\r\n\r\n/* Define this if you want to use the 2020 version of the libcdio API. */\r\n#define DO_NOT_WANT_COMPATIBILITY /**/\r\n\r\n/* Define to 1 if you have the <inttypes.h> header file. */\r\n#define HAVE_INTTYPES_H 1 /* provided in MSVC/missing if needed */\r\n\r\n/* Supports ISO _Pragma() macro */\r\n/* #undef HAVE_ISOC99_PRAGMA */\r\n\r\n/* Define 1 if you want ISO-9660 Joliet extension support. You must have also\r\n   libiconv installed to get Joliet extension support. */\r\n#define HAVE_JOLIET 1\r\n\r\n/* Define to 1 if you have the <limits.h> header file. */\r\n#define HAVE_LIMITS_H 1\r\n\r\n/* Define to 1 if you have the `lstat' function. */\r\n/* #undef HAVE_LSTAT */\r\n\r\n/* Define to 1 if you have the `memcpy' function. */\r\n#define HAVE_MEMCPY 1\r\n\r\n/* Define to 1 if you have the <memory.h> header file. */\r\n#define HAVE_MEMORY_H 1\r\n\r\n/* Define to 1 if you have the `memset' function. */\r\n#define HAVE_MEMSET 1\r\n\r\n/* Define to 1 if you have the `rand' function. */\r\n#define HAVE_RAND 1\r\n\r\n/* Define to 1 if you have the `readlink' function. */\r\n/* #undef HAVE_READLINK */\r\n\r\n/* Define to 1 if you have the `realpath' function. */\r\n/* #undef HAVE_REALPATH */\r\n\r\n/* Define 1 if you want ISO-9660 Rock-Ridge extension support. */\r\n#define HAVE_ROCK 1\r\n\r\n/* Define to 1 if you have the `setegid' function. */\r\n/* #undef HAVE_SETEGID */\r\n\r\n/* Define to 1 if you have the `setenv' function. */\r\n/* #undef HAVE_SETENV */\r\n\r\n/* Define to 1 if you have the `seteuid' function. */\r\n/* #undef HAVE_SETEUID */\r\n\r\n/* Define to 1 if you have the `sleep' function. */\r\n/* #undef HAVE_SLEEP */\r\n\r\n/* Define to 1 if you have the `snprintf' function. */\r\n#if defined(_MSC_VER) && (_MSC_VER >= 1900)\r\n#define HAVE_SNPRINTF 1\r\n#endif\r\n\r\n/* Define to 1 if you have the `vsnprintf' function. */\r\n#if defined(_MSC_VER) && (_MSC_VER >= 1900)\r\n#define HAVE_VSNPRINTF\r\n#endif\r\n\r\n/* Define to 1 if you have the <stdarg.h> header file. */\r\n#define HAVE_STDARG_H 1\r\n\r\n/* Define to 1 if you have the <stdbool.h> header file. */\r\n/* #undef HAVE_STDBOOL_H */\r\n\r\n/* Define to 1 if you have the <stdint.h> header file. */\r\n#define HAVE_STDINT_H 1 /* provided in MSVC/missing if needed */\r\n\r\n/* Define to 1 if you have the <stdio.h> header file. */\r\n#define HAVE_STDIO_H 1\r\n\r\n/* Define to 1 if you have the <stdlib.h> header file. */\r\n#define HAVE_STDLIB_H 1\r\n\r\n/* Define to 1 if you have the `strdup' function. */\r\n#define HAVE_STRDUP 1\r\n/* The equivalent of strdup on MSVC is _strdup */\r\n#define strdup _strdup\r\n\r\n/* Define to 1 if you have the <strings.h> header file. */\r\n/* #undef HAVE_STRINGS_H */\r\n\r\n/* Define to 1 if you have the <string.h> header file. */\r\n#define HAVE_STRING_H 1\r\n\r\n/* Define to 1 if you have the `strndup' function. */\r\n#if defined(__MINGW32__)\r\n#define HAVE_STRNDUP 1\r\n#endif\r\n\r\n/* Define this if you have struct timespec */\r\n/* #undef HAVE_STRUCT_TIMESPEC */\r\n\r\n/* Define to 1 if you have the <sys/cdio.h> header file. */\r\n/* #undef HAVE_SYS_CDIO_H */\r\n\r\n/* Define to 1 if you have the <sys/param.h> header file. */\r\n/* #undef HAVE_SYS_PARAM_H */\r\n\r\n/* Define to 1 if you have the <sys/stat.h> header file. */\r\n#define HAVE_SYS_STAT_H 1\r\n\r\n/* Define to 1 if you have the <sys/time.h> header file. */\r\n#define HAVE_SYS_TIME_H 1\r\n\r\n/* Define to 1 if you have the <sys/types.h> header file. */\r\n#define HAVE_SYS_TYPES_H 1\r\n\r\n/* Define this <sys/stat.h> defines S_ISLNK() */\r\n/* #undef HAVE_S_ISLNK */\r\n\r\n/* Define this <sys/stat.h> defines S_ISSOCK() */\r\n/* #undef HAVE_S_ISSOCK */\r\n\r\n/* Define if you have an extern long timenzone variable. */\r\n#define HAVE_TIMEZONE_VAR 1\r\n\r\n/* Define if struct tm has the tm_gmtoff member. */\r\n/* #undef HAVE_TM_GMTOFF */\r\n\r\n/* Define if time.h defines extern extern char *tzname[2] variable */\r\n#define HAVE_TZNAME 1\r\n/* The equivalent of tzset on MSVC is _tzset */\r\n#define tzset _tzset\r\n\r\n/* Define to 1 if you have the `tzset' function. */\r\n#define HAVE_TZSET 1\r\n\r\n/* Define to 1 if you have the <unistd.h> header file. */\r\n#define HAVE_UNISTD_H 1 /* provided in MSVC/missing if needed */\r\n\r\n/* Define to 1 if you have the `unsetenv' function. */\r\n/* #undef HAVE_UNSETENV */\r\n\r\n/* Define to 1 if you have the `usleep' function. */\r\n/* #undef HAVE_USLEEP */\r\n\r\n/* Define to 1 if you have the `vsnprintf' function. */\r\n/* #undef HAVE_VSNPRINTF */\r\n\r\n/* Define 1 if you have MinGW CD-ROM support */\r\n/* #undef HAVE_WIN32_CDROM */\r\n\r\n/* Define to 1 if you have the <windows.h> header file. */\r\n#define HAVE_WINDOWS_H 1\r\n\r\n/* Define to 1 if you have the `_stati64' function. */\r\n#define HAVE__STATI64 1\r\n\r\n/* Define as const if the declaration of iconv() needs const. */\r\n/* #undef ICONV_CONST  */\r\n\r\n/* Is set when libcdio's config.h has been included. Applications wishing to\r\n   sue their own config.h values (such as set by the application's configure\r\n   script can define this before including any of libcdio's headers. */\r\n#define LIBCDIO_CONFIG_H 1\r\n\r\n/* Define to 1 if you have the ANSI C header files. */\r\n#define STDC_HEADERS 1\r\n\r\n/* Number of bits in a file offset, on hosts where this is settable. */\r\n/* Note: This is defined as a preprocessor macro in the project files */\r\n#define _FILE_OFFSET_BITS 64\r\n\r\n/* Define to `__inline__' or `__inline' if that's what the C compiler\r\n   calls it, or to nothing if 'inline' is not supported under any name.  */\r\n#define inline __inline\r\n"
  },
  {
    "path": "src/libcdio/driver/Makefile.am",
    "content": "noinst_LIBRARIES = libdriver.a\nlibdriver_a_SOURCES = disc.c ds.c logging.c memory.c read.c sector.c track.c util.c _cdio_stdio.c _cdio_stream.c utf8.c\n# Boy do you NOT want to have HAVE_CONFIG_H set before $(AM_CFLAGS) with Clang!\nlibdriver_a_CFLAGS = $(AM_CFLAGS) -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/..\n"
  },
  {
    "path": "src/libcdio/driver/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = src/libcdio/driver\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLIBRARIES = $(noinst_LIBRARIES)\nARFLAGS = cru\nAM_V_AR = $(am__v_AR_@AM_V@)\nam__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)\nam__v_AR_0 = @echo \"  AR      \" $@;\nam__v_AR_1 = \nlibdriver_a_AR = $(AR) $(ARFLAGS)\nlibdriver_a_LIBADD =\nam_libdriver_a_OBJECTS = libdriver_a-disc.$(OBJEXT) \\\n\tlibdriver_a-ds.$(OBJEXT) libdriver_a-logging.$(OBJEXT) \\\n\tlibdriver_a-memory.$(OBJEXT) libdriver_a-read.$(OBJEXT) \\\n\tlibdriver_a-sector.$(OBJEXT) libdriver_a-track.$(OBJEXT) \\\n\tlibdriver_a-util.$(OBJEXT) libdriver_a-_cdio_stdio.$(OBJEXT) \\\n\tlibdriver_a-_cdio_stream.$(OBJEXT) libdriver_a-utf8.$(OBJEXT)\nlibdriver_a_OBJECTS = $(am_libdriver_a_OBJECTS)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp =\nam__depfiles_maybe =\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libdriver_a_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LIBRARIES = libdriver.a\nlibdriver_a_SOURCES = disc.c ds.c logging.c memory.c read.c sector.c track.c util.c _cdio_stdio.c _cdio_stream.c utf8.c\n# Boy do you NOT want to have HAVE_CONFIG_H set before $(AM_CFLAGS) with Clang!\nlibdriver_a_CFLAGS = $(AM_CFLAGS) -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/..\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/libcdio/driver/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps src/libcdio/driver/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLIBRARIES:\n\t-test -z \"$(noinst_LIBRARIES)\" || rm -f $(noinst_LIBRARIES)\n\nlibdriver.a: $(libdriver_a_OBJECTS) $(libdriver_a_DEPENDENCIES) $(EXTRA_libdriver_a_DEPENDENCIES) \n\t$(AM_V_at)-rm -f libdriver.a\n\t$(AM_V_AR)$(libdriver_a_AR) libdriver.a $(libdriver_a_OBJECTS) $(libdriver_a_LIBADD)\n\t$(AM_V_at)$(RANLIB) libdriver.a\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n.c.o:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\nlibdriver_a-disc.o: disc.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-disc.o `test -f 'disc.c' || echo '$(srcdir)/'`disc.c\n\nlibdriver_a-disc.obj: disc.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-disc.obj `if test -f 'disc.c'; then $(CYGPATH_W) 'disc.c'; else $(CYGPATH_W) '$(srcdir)/disc.c'; fi`\n\nlibdriver_a-ds.o: ds.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-ds.o `test -f 'ds.c' || echo '$(srcdir)/'`ds.c\n\nlibdriver_a-ds.obj: ds.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-ds.obj `if test -f 'ds.c'; then $(CYGPATH_W) 'ds.c'; else $(CYGPATH_W) '$(srcdir)/ds.c'; fi`\n\nlibdriver_a-logging.o: logging.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-logging.o `test -f 'logging.c' || echo '$(srcdir)/'`logging.c\n\nlibdriver_a-logging.obj: logging.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-logging.obj `if test -f 'logging.c'; then $(CYGPATH_W) 'logging.c'; else $(CYGPATH_W) '$(srcdir)/logging.c'; fi`\n\nlibdriver_a-memory.o: memory.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-memory.o `test -f 'memory.c' || echo '$(srcdir)/'`memory.c\n\nlibdriver_a-memory.obj: memory.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-memory.obj `if test -f 'memory.c'; then $(CYGPATH_W) 'memory.c'; else $(CYGPATH_W) '$(srcdir)/memory.c'; fi`\n\nlibdriver_a-read.o: read.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-read.o `test -f 'read.c' || echo '$(srcdir)/'`read.c\n\nlibdriver_a-read.obj: read.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-read.obj `if test -f 'read.c'; then $(CYGPATH_W) 'read.c'; else $(CYGPATH_W) '$(srcdir)/read.c'; fi`\n\nlibdriver_a-sector.o: sector.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-sector.o `test -f 'sector.c' || echo '$(srcdir)/'`sector.c\n\nlibdriver_a-sector.obj: sector.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-sector.obj `if test -f 'sector.c'; then $(CYGPATH_W) 'sector.c'; else $(CYGPATH_W) '$(srcdir)/sector.c'; fi`\n\nlibdriver_a-track.o: track.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-track.o `test -f 'track.c' || echo '$(srcdir)/'`track.c\n\nlibdriver_a-track.obj: track.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-track.obj `if test -f 'track.c'; then $(CYGPATH_W) 'track.c'; else $(CYGPATH_W) '$(srcdir)/track.c'; fi`\n\nlibdriver_a-util.o: util.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c\n\nlibdriver_a-util.obj: util.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`\n\nlibdriver_a-_cdio_stdio.o: _cdio_stdio.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-_cdio_stdio.o `test -f '_cdio_stdio.c' || echo '$(srcdir)/'`_cdio_stdio.c\n\nlibdriver_a-_cdio_stdio.obj: _cdio_stdio.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-_cdio_stdio.obj `if test -f '_cdio_stdio.c'; then $(CYGPATH_W) '_cdio_stdio.c'; else $(CYGPATH_W) '$(srcdir)/_cdio_stdio.c'; fi`\n\nlibdriver_a-_cdio_stream.o: _cdio_stream.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-_cdio_stream.o `test -f '_cdio_stream.c' || echo '$(srcdir)/'`_cdio_stream.c\n\nlibdriver_a-_cdio_stream.obj: _cdio_stream.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-_cdio_stream.obj `if test -f '_cdio_stream.c'; then $(CYGPATH_W) '_cdio_stream.c'; else $(CYGPATH_W) '$(srcdir)/_cdio_stream.c'; fi`\n\nlibdriver_a-utf8.o: utf8.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-utf8.o `test -f 'utf8.c' || echo '$(srcdir)/'`utf8.c\n\nlibdriver_a-utf8.obj: utf8.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdriver_a_CFLAGS) $(CFLAGS) -c -o libdriver_a-utf8.obj `if test -f 'utf8.c'; then $(CYGPATH_W) 'utf8.c'; else $(CYGPATH_W) '$(srcdir)/utf8.c'; fi`\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LIBRARIES)\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \\\n\tdistclean-compile distclean-generic distclean-tags dvi dvi-am \\\n\thtml html-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "src/libcdio/driver/_cdio_stdio.c",
    "content": "/*\n  Copyright (C) 2003, 2004, 2005, 2008, 2011 Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef HAVE_STDIO_H\n#include <stdio.h>\n#endif\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#ifdef HAVE_STRING_H\n#include <string.h>\n#endif\n#ifdef HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#ifdef HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n#ifdef HAVE_ERRNO_H\n#include <errno.h>\n#endif\n#include <ctype.h>\n\n#include <cdio/logging.h>\n#include <cdio/util.h>\n#include \"_cdio_stream.h\"\n#include \"_cdio_stdio.h\"\n#include \"cdio_assert.h\"\n\n/* On 32 bit platforms, fseek can only access streams of 2 GB or less.\n   Prefer fseeko/fseeko64, that take a 64 bit offset when LFS is enabled */\n#if defined(HAVE_FSEEKO64) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)\n#define CDIO_FSEEK fseeko64\n#elif defined(HAVE_FSEEKO)\n#define CDIO_FSEEK fseeko\n#else\n#define CDIO_FSEEK fseek\n#endif\n\n/* Windows' fopen is not UTF-8 compliant, so we use our own */\n#if defined(_WIN32)\n#include <cdio/utf8.h>\n#define CDIO_FOPEN fopen_utf8\n#else\n#define CDIO_FOPEN fopen\n#endif\n\n/* Use _stati64 if needed, on platforms that don't have transparent LFS support */\n#if defined(HAVE__STATI64) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)\n#define CDIO_STAT_STRUCT _stati64\n#if defined(_WIN32)\n/* Once again, use our own UTF-8 compliant version */\nstatic inline int _stati64_utf8(const char *path, struct _stati64 *buffer) {\n  int ret;\n  wchar_t* wpath = cdio_utf8_to_wchar(path);\n  ret = _wstati64(wpath, buffer);\n  cdio_free(wpath);\n  return ret;\n}\n#define CDIO_STAT_CALL _stati64_utf8\n#else\n#define CDIO_STAT_CALL _stati64\n#endif\n#else\n#define CDIO_STAT_STRUCT stat\n#define CDIO_STAT_CALL stat\n#endif\n\n#define _STRINGIFY(a) #a\n#define STRINGIFY(a) _STRINGIFY(a)\n\n#define CDIO_STDIO_BUFSIZE (128*1024)\n\ntypedef struct {\n  char *pathname;\n  FILE *fd;\n  char *fd_buf;\n  off_t st_size; /* used only for source */\n} _UserData;\n\nstatic int\n_stdio_open (void *user_data)\n{\n  _UserData *const ud = user_data;\n\n  if ((ud->fd = CDIO_FOPEN (ud->pathname, \"rb\")))\n    {\n      ud->fd_buf = calloc (1, CDIO_STDIO_BUFSIZE);\n      setvbuf (ud->fd, ud->fd_buf, _IOFBF, CDIO_STDIO_BUFSIZE);\n    }\n\n  return (ud->fd == NULL);\n}\n\nstatic int\n_stdio_close(void *user_data)\n{\n  _UserData *const ud = user_data;\n\n  if (fclose (ud->fd))\n    cdio_error (\"fclose (): %s\", strerror (errno));\n\n  ud->fd = NULL;\n\n  free (ud->fd_buf);\n  ud->fd_buf = NULL;\n\n  return 0;\n}\n\nstatic void\n_stdio_free(void *user_data)\n{\n  _UserData *const ud = user_data;\n\n  if (ud->pathname)\n    free(ud->pathname);\n\n  if (ud->fd) /* should be NULL anyway... */\n    _stdio_close(user_data);\n\n  free(ud);\n}\n\n/*!\n  Like fseek/fseeko(3) and in fact may be the same.\n\n  This  function sets the file position indicator for the stream\n  pointed to by stream.  The new position, measured in bytes, is obtained\n  by  adding offset bytes to the position specified by whence.  If whence\n  is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset  is  relative  to\n  the  start of the file, the current position indicator, or end-of-file,\n  respectively.  A successful call to the fseek function clears the end-\n  of-file indicator for the stream and undoes any effects of the\n  ungetc(3) function on the same stream.\n\n  @return upon successful completion, DRIVER_OP_SUCCESS, else,\n  DRIVER_OP_ERROR is returned and the global variable errno is set to\n  indicate the error.\n*/\nstatic int\n_stdio_seek(void *p_user_data, off_t i_offset, int whence)\n{\n  _UserData *const ud = p_user_data;\n  int ret;\n#if !defined(HAVE_FSEEKO) && !defined(HAVE_FSEEKO64)\n  /* Detect if off_t is lossy-truncated to long to avoid data corruption */\n  if ( (sizeof(off_t) > sizeof(long)) && (i_offset != (off_t)((long)i_offset)) ) {\n    cdio_error ( STRINGIFY(CDIO_FSEEK) \" (): lossy truncation detected!\");\n    errno = EFBIG;\n    return DRIVER_OP_ERROR;\n  }\n#endif\n\n  if ( (ret=CDIO_FSEEK (ud->fd, i_offset, whence)) ) {\n    cdio_error ( STRINGIFY(CDIO_FSEEK) \" (): %s\", strerror (errno));\n  }\n\n  return ret;\n}\n\nstatic off_t\n_stdio_stat(void *p_user_data)\n{\n  const _UserData *const ud = p_user_data;\n\n  return ud->st_size;\n}\n\n/*!\n  Like fread(3) and in fact is about the same.\n\n  DESCRIPTION:\n  The function fread reads nmemb elements of data, each size bytes long,\n  from the stream pointed to by stream, storing them at the location\n  given by ptr.\n\n  RETURN VALUE:\n  return the number of items successfully read or written (i.e.,\n  not the number of characters).  If an error occurs, or the\n  end-of-file is reached, the return value is a short item count\n  (or zero).\n\n  We do not distinguish between end-of-file and error, and callers\n  must use feof(3) and ferror(3) to determine which occurred.\n  */\nstatic ssize_t\n_stdio_read(void *user_data, void *buf, size_t count)\n{\n  _UserData *const ud = user_data;\n  long read_count;\n\n  // Define a max buffer size of 1 GB for _stdio_read\n  const size_t MAX_ALLOWED_COUNT = 0x40000000;\n  if (count > MAX_ALLOWED_COUNT) {\n      cdio_error(\"Requested count exceeds maximum allowed value.\\n\");\n      return 0;\n  }\n\n  read_count = fread(buf, 1, count, ud->fd);\n\n  if (read_count != count)\n    { /* fixme -- ferror/feof */\n      if (feof (ud->fd))\n        {\n          cdio_debug (\"fread (): EOF encountered\");\n          clearerr (ud->fd);\n        }\n      else if (ferror (ud->fd))\n        {\n          cdio_error (\"fread (): %s\", strerror (errno));\n          clearerr (ud->fd);\n        }\n      else\n        cdio_debug (\"fread (): short read and no EOF?!?\");\n    }\n\n  return read_count;\n}\n\n/*!\n  Deallocate resources assocaited with obj. After this obj is unusable.\n*/\nvoid\ncdio_stdio_destroy(CdioDataSource_t *p_obj)\n{\n  cdio_stream_destroy(p_obj);\n}\n\nCdioDataSource_t *\ncdio_stdio_new(const char pathname[])\n{\n  CdioDataSource_t *new_obj = NULL;\n  cdio_stream_io_functions funcs = { NULL, NULL, NULL, NULL, NULL, NULL };\n  _UserData *ud = NULL;\n  struct CDIO_STAT_STRUCT statbuf;\n  char* pathdup;\n\n  if (pathname == NULL)\n    return NULL;\n\n  /* MinGW may require a translated path */\n  pathdup = _cdio_strdup_fixpath(pathname);\n  if (pathdup == NULL)\n    return NULL;\n\n  if (CDIO_STAT_CALL (pathdup, &statbuf) == -1)\n    {\n      cdio_warn (\"could not retrieve file info for `%s': %s\",\n                 pathdup, strerror (errno));\n      cdio_free(pathdup);\n      return NULL;\n    }\n\n  ud = calloc (1, sizeof (_UserData));\n  cdio_assert (ud != NULL);\n\n  ud->pathname = pathdup;\n  ud->st_size  = statbuf.st_size; /* let's hope it doesn't change... */\n\n  funcs.open   = _stdio_open;\n  funcs.seek   = _stdio_seek;\n  funcs.stat   = _stdio_stat;\n  funcs.read   = _stdio_read;\n  funcs.close  = _stdio_close;\n  funcs.free   = _stdio_free;\n\n  new_obj = cdio_stream_new(ud, &funcs);\n\n  return new_obj;\n}\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/driver/_cdio_stdio.h",
    "content": "/*\n  Copyright (C) 2003, 2008, 2012 Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n\n#ifndef CDIO_STDIO_H_\n#define CDIO_STDIO_H_\n\n#include \"_cdio_stream.h\"\n\n/*!\n  Initialize a new stdio stream reading from pathname.\n  A pointer to the stream is returned or NULL if there was an error.\n\n  cdio_stream_free should be called on the returned value when you\n  don't need the stream any more. No other finalization is needed.\n */\nCdioDataSource_t * cdio_stdio_new(const char psz_path[]);\n\n/*!\n  Deallocate resources assocaited with obj. After this obj is unusable.\n*/\nvoid cdio_stdio_destroy(CdioDataSource_t *p_obj);\n\n\n#endif /* CDIO_STDIO_H_ */\n\n\f\n/* \n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/driver/_cdio_stream.c",
    "content": "/*\n  Copyright (C) 2005, 2006, 2008, 2011, 2016 Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2000, 2004, 2005 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef HAVE_STDIO_H\n#include <stdio.h>\n#endif\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#ifdef HAVE_STRING_H\n#include <string.h>\n#endif\n#ifdef HAVE_STDARG_H\n#include <stdarg.h>\n#endif\n#include \"cdio_assert.h\"\n\n/* #define STREAM_DEBUG  */\n\n#include <cdio/logging.h>\n#include <cdio/util.h>\n#include \"_cdio_stream.h\"\n\n/*\n * DataSource implementations\n */\n\nstruct _CdioDataSource {\n  void* user_data;\n  cdio_stream_io_functions op;\n  int is_open;\n  off_t position;\n};\n\nvoid\ncdio_stream_close(CdioDataSource_t *p_obj)\n{\n  if (!p_obj) return;\n\n  if (p_obj->is_open) {\n    cdio_debug (\"closed source...\");\n    p_obj->op.close(p_obj->user_data);\n    p_obj->is_open  = 0;\n    p_obj->position = 0;\n  }\n}\n\nvoid\ncdio_stream_destroy(CdioDataSource_t *p_obj)\n{\n  if (!p_obj) return;\n\n  cdio_stream_close(p_obj);\n\n  p_obj->op.free(p_obj->user_data);\n  p_obj->user_data = NULL;\n  free(p_obj);\n}\n\n/**\n  Like 3 fgetpos.\n\n  This function gets the current file position indicator for the stream\n  pointed to by stream.\n\n  @return unpon successful completion, return value is positive, else,\n  the global variable errno is set to indicate the error.\n*/\noff_t\ncdio_stream_getpos(CdioDataSource_t* p_obj, /*out*/ off_t *i_offset)\n{\n  if (!p_obj || !p_obj->is_open) return DRIVER_OP_UNINIT;\n  return *i_offset = p_obj->position;\n}\n\nCdioDataSource_t *\ncdio_stream_new(void *user_data, const cdio_stream_io_functions *funcs)\n{\n  CdioDataSource_t *new_obj;\n\n  new_obj = calloc (1, sizeof (CdioDataSource_t));\n  cdio_assert (new_obj != NULL);\n\n  new_obj->user_data = user_data;\n  memcpy(&(new_obj->op), funcs, sizeof(cdio_stream_io_functions));\n\n  return new_obj;\n}\n\n/*\n   Open if not already open.\n   Return false if we hit an error. Errno should be set for that error.\n*/\nstatic bool\n_cdio_stream_open_if_necessary(CdioDataSource_t *p_obj)\n{\n  if (!p_obj) return false;\n\n  if (!p_obj->is_open) {\n    if (p_obj->op.open(p_obj->user_data)) {\n      cdio_warn (\"could not open input stream...\");\n      return false;\n    } else {\n      cdio_debug (\"opened source...\");\n      p_obj->is_open = 1;\n      p_obj->position = 0;\n    }\n  }\n  return true;\n}\n\n/**\n  Like fread(3) and in fact may be the same.\n\n  DESCRIPTION:\n  The function fread reads nmemb elements of data, each size bytes long,\n  from the stream pointed to by stream, storing them at the location\n  given by ptr.\n\n  RETURN VALUE:\n  return the number of items successfully read or written (i.e.,\n  not the number of characters).  If an error occurs, or the\n  end-of-file is reached, the return value is a short item count\n  (or zero).\n\n  We do not distinguish between end-of-file and error, and callers\n  must use feof(3) and ferror(3) to determine which occurred.\n*/\nssize_t\ncdio_stream_read(CdioDataSource_t* p_obj, void *ptr, size_t size, size_t nmemb)\n{\n  long read_bytes;\n\n  if (!p_obj) return 0;\n  if (!_cdio_stream_open_if_necessary(p_obj)) return 0;\n\n  read_bytes = (p_obj->op.read)(p_obj->user_data, ptr, size*nmemb);\n  p_obj->position += read_bytes;\n\n  return read_bytes;\n}\n\n/**\n  Like 3 fseek and in fact may be the same.\n\n  This  function sets the file position indicator for the stream\n  pointed to by stream.  The new position, measured in bytes, is obtained\n  by  adding offset bytes to the position specified by whence.  If whence\n  is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset  is  relative  to\n  the  start of the file, the current position indicator, or end-of-file,\n  respectively.  A successful call to the fseek function clears the end-\n  of-file indicator for the stream and undoes any effects of the\n  ungetc(3) function on the same stream.\n\n  @return unpon successful completion, return value is positive, else,\n  the global variable errno is set to indicate the error.\n*/\nint\ncdio_stream_seek(CdioDataSource_t* p_obj, off_t offset, int whence)\n{\n  if (!p_obj) return DRIVER_OP_UNINIT;\n\n  if (!_cdio_stream_open_if_necessary(p_obj))\n    /* errno is set by _cdio_stream_open_if necessary. */\n    return DRIVER_OP_ERROR;\n\n  if (offset < 0) return DRIVER_OP_ERROR;\n  if (p_obj->position < 0) return DRIVER_OP_ERROR;\n\n  if (p_obj->position != offset) {\n#ifdef STREAM_DEBUG\n    cdio_warn(\"had to reposition DataSource from %ld to %ld!\", p_obj->position, offset);\n#endif\n    p_obj->position = offset;\n    return p_obj->op.seek(p_obj->user_data, offset, whence);\n  }\n\n  return 0;\n}\n\n/**\n  Return whatever size of stream reports, I guess unit size is bytes.\n  On error return -1;\n */\noff_t\ncdio_stream_stat(CdioDataSource_t *p_obj)\n{\n  if (!p_obj) return -1;\n  if (!_cdio_stream_open_if_necessary(p_obj)) return -1;\n\n  return p_obj->op.stat(p_obj->user_data);\n}\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/driver/_cdio_stream.h",
    "content": "/*\n  Copyright (C) 2003, 2004, 2005, 2006, 2008, 2012\n  Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n\n#ifndef CDIO_STREAM_H_\n#define CDIO_STREAM_H_\n\n#include <cdio/types.h>\n#include \"cdio_private.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n  /* typedef'ed IO functions prototypes */\n  \n  typedef int(*cdio_data_open_t)(void *user_data);\n  \n  typedef ssize_t(*cdio_data_read_t)(void *user_data, void *buf, size_t count);\n  \n  typedef int(*cdio_data_seek_t)(void *user_data, off_t offset,\n                                                  int whence);\n  \n  typedef off_t(*cdio_data_stat_t)(void *user_data);\n  \n  typedef int(*cdio_data_close_t)(void *user_data);\n  \n  typedef void(*cdio_data_free_t)(void *user_data);\n  \n  \n  /* abstract data source */\n  \n  typedef struct {\n    cdio_data_open_t open;\n    cdio_data_seek_t seek; \n    cdio_data_stat_t stat; \n    cdio_data_read_t read;\n    cdio_data_close_t close;\n    cdio_data_free_t free;\n  } cdio_stream_io_functions;\n  \n  /**\n     Like 3 fgetpos.\n     \n     This function gets the current file position indicator for the stream\n     pointed to by stream.  \n     \n     @return unpon successful completion, return value is positive, else,\n     the global variable errno is set to indicate the error.\n  */\n  off_t cdio_stream_getpos(CdioDataSource_t* p_obj, \n                             /*out*/ off_t *i_offset);\n  \n  CdioDataSource_t *\n  cdio_stream_new(void *user_data, const cdio_stream_io_functions *funcs);\n\n  /**\n     Like fread(3) and in fact may be the same.\n\n     DESCRIPTION:\n     The function fread reads nmemb elements of data, each size bytes long,\n     from the stream pointed to by stream, storing them at the location\n     given by ptr.\n\n     RETURN VALUE:\n     return the number of items successfully read or written (i.e.,\n     not the number of characters).  If an error occurs, or the\n     end-of-file is reached, the return value is a short item count\n     (or zero).\n\n     We do not distinguish between end-of-file and error, and callers\n     must use feof(3) and ferror(3) to determine which occurred.\n  */\n  ssize_t cdio_stream_read(CdioDataSource_t* p_obj, void *ptr, size_t i_size, \n                           size_t nmemb);\n  \n  /** \n    Like fseek(3)/fseeko(3) and in fact may be the same.\n\n    This  function sets the file position indicator for the stream\n    pointed to by stream.  The new position, measured in bytes, is obtained\n    by  adding offset bytes to the position specified by whence.  If whence\n    is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset  is  relative  to\n    the  start of the file, the current position indicator, or end-of-file,\n    respectively.  A successful call to the fseek function clears the end-\n    of-file indicator for the stream and undoes any effects of the\n    ungetc(3) function on the same stream.\n    \n    @return upon successful completion, DRIVER_OP_SUCCESS, else,\n    DRIVER_OP_ERROR is returned and the global variable errno is set to\n    indicate the error.\n   */\n  int cdio_stream_seek(CdioDataSource_t *p_obj, off_t i_offset, \n                           int whence);\n  \n  /**\n    Return whatever size of stream reports, I guess unit size is bytes. \n    On error return -1;\n  */\n  off_t cdio_stream_stat(CdioDataSource_t *p_obj);\n  \n  /**\n    Deallocate resources associated with p_obj. After this p_obj is unusable.\n  */\n  void cdio_stream_destroy(CdioDataSource_t *p_obj);\n  \n  void cdio_stream_close(CdioDataSource_t *p_obj);\n  \n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_STREAM_H_ */\n\n\f\n/* \n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/driver/cdio_assert.h",
    "content": "/*\n  Copyright (C) 2008, 2011, 2012 Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n#ifndef CDIO_ASSERT_H_\n#define CDIO_ASSERT_H_\n\n#if defined(__GNUC__) && !defined(__MINGW32__)\n\n#if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__)\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#include <cdio/types.h>\n#include <cdio/logging.h>\n\n#define cdio_assert(expr) \\\n { \\\n   if (GNUC_UNLIKELY (!(expr))) cdio_log (CDIO_LOG_ASSERT, \\\n     \"file %s: line %d (%s): assertion failed: (%s)\", \\\n     __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr); \\\n }\n\n#define cdio_assert_not_reached() \\\n { \\\n   cdio_log (CDIO_LOG_ASSERT, \\\n     \"file %s: line %d (%s): should not be reached\", \\\n     __FILE__, __LINE__, __PRETTY_FUNCTION__); \\\n }\n\n#else /* non GNU C */\n\n#include <assert.h>\n\n#define cdio_assert(expr) \\\n assert(expr)\n\n#define cdio_assert_not_reached() \\\n assert(0)\n\n#endif\n\n#endif /* CDIO_ASSERT_H_ */\n"
  },
  {
    "path": "src/libcdio/driver/cdio_private.h",
    "content": "/*\n  Copyright (C) 2003-2005, 2008-2009, 2011-2012, 2016-2017\n  Rocky Bernstein <rocky@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/* Internal routines for CD I/O drivers. */\n\n\f\n#ifndef CDIO_DRIVER_PRIVATE_H_\n#define CDIO_DRIVER_PRIVATE_H_\n\n#if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H)\n# include \"config.h\"\n#endif\n\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#ifdef HAVE_STRING_H\n#include <string.h>\n#endif\n\n#include <cdio/cdio.h>\n#include <cdio/audio.h>\n#include <cdio/cdtext.h>\n#include \"mmc/mmc_private.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n#ifndef HAVE_STRNDUP\n#undef  strndup\n#define strndup libcdio_strndup\nstatic inline char *libcdio_strndup(const char *s, size_t n)\n{\n    char *result;\n    size_t len = strlen (s);\n    if (n < len)\n        len = n;\n    result = (char *) malloc (len + 1);\n    if (!result)\n        return 0;\n    result[len] = '\\0';\n    return (char *) memcpy (result, s, len);\n}\n#endif /*HAVE_STRNDUP*/\n\n  /*!\n    Get directory name from file name.\n\n    Callers must free return value after use.\n   */\n  extern char *cdio_dirname(const char *fname);\n\n  /*!\n    Construct an absolute file name from path and file name.\n\n    Callers must free return value after use.\n   */\n  extern char *cdio_abspath(const char *cwd, const char *fname);\n\n  /* Opaque type */\n  typedef struct _CdioDataSource CdioDataSource_t;\n\n#ifdef __cplusplus\n}\n\n#endif /* __cplusplus */\n\n#include \"generic.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n\n  typedef struct {\n\n    /*!\n      Get volume of an audio CD.\n\n      @param p_env the CD object to be acted upon.\n\n    */\n    driver_return_code_t (*audio_get_volume)\n         (void *p_env,  /*out*/ cdio_audio_volume_t *p_volume);\n\n    /*!\n      Pause playing CD through analog output\n\n      @param p_env the CD object to be acted upon.\n    */\n    driver_return_code_t (*audio_pause) (void *p_env);\n\n    /*!\n      Playing CD through analog output\n\n      @param p_env the CD object to be acted upon.\n    */\n    driver_return_code_t (*audio_play_msf) ( void *p_env,\n                                             msf_t *p_start_msf,\n                                             msf_t *p_end_msf );\n\n    /*!\n      Playing CD through analog output\n\n      @param p_env the CD object to be acted upon.\n    */\n    driver_return_code_t (*audio_play_track_index)\n         ( void *p_env, cdio_track_index_t *p_track_index );\n\n    /*!\n      Get subchannel information.\n\n      @param p_env the CD object to be acted upon.\n    */\n    driver_return_code_t (*audio_read_subchannel)\n         ( void *p_env, cdio_subchannel_t *subchannel );\n\n    /*!\n      Resume playing an audio CD.\n\n      @param p_env the CD object to be acted upon.\n\n    */\n    driver_return_code_t (*audio_resume) ( void *p_env );\n\n    /*!\n      Set volume of an audio CD.\n\n      @param p_env the CD object to be acted upon.\n\n    */\n    driver_return_code_t (*audio_set_volume)\n         ( void *p_env,  cdio_audio_volume_t *p_volume );\n\n    /*!\n      Stop playing an audio CD.\n\n      @param p_env the CD object to be acted upon.\n\n    */\n    driver_return_code_t (*audio_stop) ( void *p_env );\n\n    /*!\n      Eject media in CD drive. If successful, as a side effect we\n      also free p_env.\n\n      @param p_env the CD object to be acted upon.\n      If the CD is ejected *p_env is freed and p_env set to NULL.\n    */\n    driver_return_code_t (*eject_media) ( void *p_env );\n\n    /*!\n      Release and free resources associated with cd.\n    */\n    void (*free) (void *p_env);\n\n    /*!\n      Return the value associated with the key \"arg\".\n    */\n    const char * (*get_arg) (void *p_env, const char key[]);\n\n    /*!\n      Get the block size for subsequest read requests, via a SCSI MMC\n      MODE_SENSE 6 command.\n    */\n    int (*get_blocksize) ( void *p_env );\n\n    /*!\n      Get cdtext information for a CdIo object.\n\n      @param obj the CD object that may contain CD-TEXT information.\n      @return the CD-TEXT object or NULL if obj is NULL\n      or CD-TEXT information does not exist.\n    */\n    cdtext_t * (*get_cdtext) ( void *p_env );\n\n    /*!\n      Get raw cdtext information as on the disc for a CdIo object\n\n      @param obj the CD object that may contain CD-TEXT information.\n      @return pointer to the raw CD-TEXT data or NULL if obj is NULL\n      or no CD-TEXT information present on the disc.\n\n      free when done and not NULL.\n    */\n    uint8_t * (*get_cdtext_raw) ( void *p_env );\n\n    /*!\n      Return an array of device names. if CdIo is NULL (we haven't\n      initialized a specific device driver), then find a suitable device\n      driver.\n\n      NULL is returned if we couldn't return a list of devices.\n    */\n    char ** (*get_devices) ( void );\n\n    /*!\n      Get the default CD device.\n\n      @return a string containing the default CD device or NULL is\n      if we couldn't get a default device.\n\n      In some situations of drivers or OS's we can't find a CD device if\n      there is no media in it and it is possible for this routine to return\n      NULL even though there may be a hardware CD-ROM.\n    */\n    char * (*get_default_device) ( void );\n\n    /*!\n      Return the size of the CD in logical block address (LBA) units.\n      @return the lsn. On error 0 or CDIO_INVALD_LSN.\n    */\n    lsn_t (*get_disc_last_lsn) ( void *p_env );\n\n    /*!\n      Get disc mode associated with cd_obj.\n    */\n    discmode_t (*get_discmode) ( void *p_env );\n\n    /*!\n      Return the what kind of device we've got.\n\n      See cd_types.h for a list of bitmasks for the drive type;\n    */\n    void (*get_drive_cap) (const void *p_env,\n                           cdio_drive_read_cap_t  *p_read_cap,\n                           cdio_drive_write_cap_t *p_write_cap,\n                           cdio_drive_misc_cap_t  *p_misc_cap);\n    /*!\n      Return the number of of the first track.\n      CDIO_INVALID_TRACK is returned on error.\n    */\n    track_t (*get_first_track_num) ( void *p_env );\n\n    /*!\n      Get the CD-ROM hardware info via a SCSI MMC INQUIRY command.\n      False is returned if we had an error getting the information.\n    */\n    bool (*get_hwinfo)\n         ( const CdIo_t *p_cdio, /* out*/ cdio_hwinfo_t *p_hw_info );\n\n    /*! Get the LSN of the first track of the last session of\n      on the CD.\n\n       @param p_cdio the CD object to be acted upon.\n       @param i_last_session pointer to the session number to be returned.\n    */\n    driver_return_code_t (*get_last_session)\n         ( void *p_env, /*out*/ lsn_t *i_last_session );\n\n    /*!\n      Find out if media has changed since the last call.\n      @param p_env the CD object to be acted upon.\n      @return 1 if media has changed since last call, 0 if not. Error\n      return codes are the same as driver_return_code_t\n    */\n    int (*get_media_changed) ( const void *p_env );\n\n    /*!\n      Return the media catalog number MCN from the CD or NULL if\n      there is none or we don't have the ability to get it.\n    */\n    char * (*get_mcn) ( const void *p_env );\n\n    /*!\n      Return the number of tracks in the current medium.\n      CDIO_INVALID_TRACK is returned on error.\n    */\n    track_t (*get_num_tracks) ( void *p_env );\n\n    /*! Return number of channels in track: 2 or 4; -2 if not\n      implemented or -1 for error.\n      Not meaningful if track is not an audio track.\n    */\n    int (*get_track_channels) ( const void *p_env, track_t i_track );\n\n    /*! Return 0 if track is copy protected, 1 if not, or -1 for error\n      or -2 if not implimented (yet). Is this meaningful if not an\n      audio track?\n    */\n    track_flag_t (*get_track_copy_permit) ( void *p_env, track_t i_track );\n\n    /*!\n      Return the starting LBA for track number\n      i_track in p_env.  Tracks numbers start at 1.\n      The \"leadout\" track is specified either by\n      using track_num LEADOUT_TRACK or the total tracks+1.\n      CDIO_INVALID_LBA is returned on error.\n    */\n    lba_t (*get_track_lba) ( void *p_env, track_t i_track );\n\n    /*!\n      Return the starting LBA for the pregap for track number\n      i_track in p_env.  Tracks numbers start at 1.\n      CDIO_INVALID_LBA is returned on error.\n    */\n    lba_t (*get_track_pregap_lba) ( const void *p_env, track_t i_track );\n\n    /*!\n      Return the International Standard Recording Code (ISRC) for track number\n      i_track in p_cdio.  Track numbers start at 1.\n\n      Note: string is malloc'd so caller has to free() the returned\n      string when done with it.\n    */\n    char * (*get_track_isrc) ( const void *p_env, track_t i_track );\n\n    /*!\n      Get format of track.\n    */\n    track_format_t (*get_track_format) ( void *p_env, track_t i_track );\n\n    /*!\n      Return true if we have XA data (green, mode2 form1) or\n      XA data (green, mode2 form2). That is track begins:\n      sync - header - subheader\n      12     4      -  8\n\n      FIXME: there's gotta be a better design for this and get_track_format?\n    */\n    bool (*get_track_green) ( void *p_env, track_t i_track );\n\n    /*!\n      Return the starting MSF (minutes/secs/frames) for track number\n      i_track in p_env.  Tracks numbers start at 1.\n      The \"leadout\" track is specified either by\n      using i_track LEADOUT_TRACK or the total tracks+1.\n      False is returned on error.\n    */\n    bool (*get_track_msf) ( void *p_env, track_t i_track, msf_t *p_msf );\n\n    /*! Return 1 if track has pre-emphasis, 0 if not, or -1 for error\n      or -2 if not implimented (yet). Is this meaningful if not an\n      audio track?\n    */\n    track_flag_t (*get_track_preemphasis)\n         ( const void  *p_env, track_t i_track );\n\n    /*!\n      lseek - reposition read/write file offset\n      Returns (off_t) -1 on error.\n      Similar to libc's lseek()\n    */\n    off_t (*lseek) ( void *p_env, off_t offset, int whence );\n\n    /*!\n      Reads into buf the next size bytes.\n      Returns -1 on error.\n      Similar to libc's read()\n    */\n    ssize_t (*read) ( void *p_env, void *p_buf, size_t i_size );\n\n    /*!\n      Reads a single mode2 sector from cd device into buf starting\n      from lsn. Returns 0 if no error.\n    */\n    int (*read_audio_sectors) ( void *p_env, void *p_buf, lsn_t i_lsn,\n                                unsigned int i_blocks );\n\n    /*!\n      Read a data sector\n\n      @param p_env environment to read from\n\n      @param p_buf place to read data into.  The caller should make sure\n      this location can store at least CDIO_CD_FRAMESIZE,\n      M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE depending\n      on the kind of sector getting read. If you don't\n      know whether you have a Mode 1/2, Form 1/ Form 2/Formless\n      sector best to reserve space for the maximum,\n      M2RAW_SECTOR_SIZE.\n\n      @param i_lsn sector to read\n      @param i_blocksize size of block. Should be either CDIO_CD_FRAMESIZE,\n      M2RAW_SECTOR_SIZE, or M2F2_SECTOR_SIZE. See comment above under p_buf.\n    */\n    driver_return_code_t (*read_data_sectors)\n         ( void *p_env, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize,\n           uint32_t i_blocks );\n\n    /*!\n      Reads a single mode2 sector from cd device into buf starting\n      from lsn. Returns 0 if no error.\n    */\n    int (*read_mode2_sector)\n         ( void *p_env, void *p_buf, lsn_t i_lsn, bool b_mode2_form2 );\n\n    /*!\n      Reads i_blocks of mode2 sectors from cd device into data starting\n      from lsn.\n      Returns 0 if no error.\n    */\n    int (*read_mode2_sectors)\n         ( void *p_env, void *p_buf, lsn_t i_lsn, bool b_mode2_form2,\n           unsigned int i_blocks );\n\n    /*!\n      Reads a single mode1 sector from cd device into buf starting\n      from lsn. Returns 0 if no error.\n    */\n    int (*read_mode1_sector)\n         ( void *p_env, void *p_buf, lsn_t i_lsn, bool mode1_form2 );\n\n    /*!\n      Reads i_blocks of mode1 sectors from cd device into data starting\n      from lsn.\n      Returns 0 if no error.\n    */\n    int (*read_mode1_sectors)\n         ( void *p_env, void *p_buf, lsn_t i_lsn, bool mode1_form2,\n           unsigned int i_blocks );\n\n    bool (*read_toc) ( void *p_env ) ;\n\n    /*!\n      Run a SCSI MMC command.\n\n      cdio              CD structure set by cdio_open().\n      i_timeout_ms      time in milliseconds we will wait for the command\n                        to complete.\n      cdb_len           number of bytes in cdb (6, 10, or 12).\n      cdb               CDB bytes. All values that are needed should be set on\n                        input.\n      b_return_data     TRUE if the command expects data to be returned in\n                        the buffer\n      len               Size of buffer\n      buf               Buffer for data, both sending and receiving\n\n      Returns 0 if command completed successfully.\n    */\n    mmc_run_cmd_fn_t run_mmc_cmd;\n\n    /*!\n      Set the arg \"key\" with \"value\" in the source device.\n    */\n    int (*set_arg) ( void *p_env, const char key[], const char value[] );\n\n    /*!\n      Set the blocksize for subsequent reads.\n    */\n    driver_return_code_t (*set_blocksize) ( void *p_env,\n                                            uint16_t i_blocksize );\n\n    /*!\n      Set the drive speed.\n\n      @return 0 if everything went okay, -1 if we had an error. is -2\n      returned if this is not implemented for the current driver.\n    */\n    int (*set_speed) ( void *p_env, int i_speed );\n\n  } cdio_funcs_t;\n\n  typedef struct {\n    uint16_t    u_type;\n    uint16_t    u_flags;\n  } cdio_header_t;\n\n#define CDIO_HEADER_TYPE_CDIO           0x0000\n#define CDIO_HEADER_TYPE_ISO            0x0001\n\n#define CDIO_HEADER_FLAGS_DISABLE_RR_DD 0x0001\n\n  /*! Implementation of CdIo type */\n  struct _CdIo {\n    cdio_header_t header;    /**< Internal header - MUST come first. */\n    driver_id_t   driver_id; /**< Particular driver opened. */\n    cdio_funcs_t  op;        /**< driver-specific routines handling\n                                  implementation. */\n    void*         env;       /**< environment. Passed to routine above. */\n  };\n\n  /* This is used in drivers that must keep their own internal\n     position pointer for doing seeks. Stream-based drivers (like bincue,\n     nrg, toc, network) would use this.\n   */\n  typedef struct\n  {\n    off_t   buff_offset;      /* buffer offset in disk-image seeks. */\n    track_t index;            /* Current track index in tocent. */\n    lba_t   lba;              /* Current LBA */\n  } internal_position_t;\n\n  CdIo_t * cdio_new (generic_img_private_t *p_env, cdio_funcs_t *p_funcs);\n\n  /* The below structure describes a specific CD Input driver  */\n  typedef struct\n  {\n    driver_id_t  id;\n    unsigned int flags;\n    const char  *name;\n    const char  *describe;\n    bool (*have_driver) (void);\n    CdIo_t *(*driver_open) (const char *psz_source_name);\n    CdIo_t *(*driver_open_am) (const char *psz_source_name,\n                             const char *psz_access_mode);\n    char *(*get_default_device) (void);\n    bool (*is_device) (const char *psz_source_name);\n    char **(*get_devices) (void);\n    driver_return_code_t (*close_tray) (const char *psz_device);\n  } CdIo_driver_t;\n\n  /* The below array gives of the drivers that are currently available for\n     on a particular host. */\n  extern CdIo_driver_t CdIo_driver[];\n\n  /* The last valid entry of Cdio_driver. -1 means uninitialzed. -2\n     means some sort of error.\n   */\n  extern int CdIo_last_driver;\n\n  /* The below array gives all drivers that can possibly appear.\n     on a particular host. */\n  extern CdIo_driver_t CdIo_all_drivers[];\n\n  /*!\n    Add/allocate a drive to the end of drives.\n    Use cdio_free_device_list() to free this device_list.\n  */\n  void cdio_add_device_list(char **device_list[], const char *psz_drive,\n                            unsigned int *i_drives);\n\n  driver_return_code_t close_tray_bsdi    (const char *psz_drive);\n  driver_return_code_t close_tray_freebsd (const char *psz_drive);\n  driver_return_code_t close_tray_linux   (const char *psz_drive);\n  driver_return_code_t close_tray_netbsd  (const char *psz_drive);\n  driver_return_code_t close_tray_osx     (const char *psz_drive);\n  driver_return_code_t close_tray_solaris (const char *psz_drive);\n  driver_return_code_t close_tray_win32   (const char *psz_drive);\n\n  bool cdio_have_netbsd(void);\n  CdIo_t * cdio_open_netbsd (const char *psz_source);\n  char * cdio_get_default_device_netbsd(void);\n  char **cdio_get_devices_netbsd(void);\n  /*! Set up CD-ROM for reading using the NetBSD driver. The device_name is\n      the some sort of device name.\n\n     NULL is returned on error or there is no FreeBSD driver.\n\n     @see cdio_open_cd, cdio_open\n   */\n  CdIo_t * cdio_open_am_netbsd (const char *psz_source,\n                                const char *psz_access_mode);\n\n  /*! DEPRICATED: use cdio_have_driver().\n    True if AIX driver is available. */\n  bool cdio_have_aix    (void);\n\n  /*! DEPRICATED: use cdio_have_driver().\n    True if BSDI driver is available. */\n  bool cdio_have_bsdi    (void);\n\n  /*! DEPRICATED: use cdio_have_driver().\n    True if FreeBSD driver is available. */\n  bool cdio_have_freebsd (void);\n\n  /*! DEPRICATED: use cdio_have_driver().\n    True if GNU/Linux driver is available. */\n  bool cdio_have_linux   (void);\n\n  /*! DEPRICATED: use cdio_have_driver().\n    True if Sun Solaris driver is available. */\n  bool cdio_have_solaris (void);\n\n  /*! DEPRICATED: use cdio_have_driver().\n    True if IBM OS2 driver is available. */\n  bool cdio_have_os2     (void);\n\n  /*! DEPRICATED: use cdio_have_driver().\n    True if Apple OSX driver is available. */\n  bool cdio_have_osx     (void);\n\n  /*! DEPRICATED: use cdio_have_driver().\n    True if Microsoft Windows driver is available. */\n  bool cdio_have_win32   (void);\n\n  /*! True if Nero driver is available. */\n  bool cdio_have_nrg     (void);\n\n  /*! True if BIN/CUE driver is available. */\n  bool cdio_have_bincue  (void);\n\n  /*! True if cdrdao CDRDAO driver is available. */\n  bool cdio_have_cdrdao  (void);\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_DRIVER_PRIVATE_H_ */\n"
  },
  {
    "path": "src/libcdio/driver/disc.c",
    "content": "/*\n  Copyright (C) 2003, 2004, 2005, 2008, 2011, 2012, 2014\n   Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef HAVE_STDBOOL_H\n# include <stdbool.h>\n#endif \n\n#include <cdio/cdio.h>\n#include \"cdio_private.h\"\n\n/* Must match discmode enumeration */\nconst char *discmode2str[] = {\n  \"CD-DA\", \n  \"CD-DATA (Mode 1)\", \n  \"CD DATA (Mode 2)\", \n  \"CD-ROM Mixed\",\n  \"DVD-ROM\", \n  \"DVD-RAM\", \n  \"DVD-R\", \n  \"DVD-RW\", \n  \"HD DVD ROM\",\n  \"HD_DVD RAM\", \n  \"HD DVD-R\", \n  \"DVD+R\",\n  \"DVD+RW\", \n  \"DVD+RW DL\", \n  \"DVD+R DL\", \n  \"Unknown/unclassified DVD\", \n  \"No information\",\n  \"Error in getting information\",\n  \"CD-i\" \n};\n\n/*! \n  Get cdtext information for a CdIo object .\n  \n  @param obj the CD object that may contain CD-TEXT information.\n  @return the CD-TEXT object or NULL if obj is NULL\n  or CD-TEXT information does not exist.\n*/\ncdtext_t *\ncdio_get_cdtext (CdIo *obj)\n{\n  if (obj == NULL) return NULL;\n  \n  if (NULL != obj->op.get_cdtext) {\n    return obj->op.get_cdtext (obj->env);\n  } else {\n    return NULL;\n  }\n}\n\n/*! \n  Get binary cdtext information for a CdIo object .\n  \n  @param obj the CD object that may contain CD-TEXT information.\n  @return pointer to allocated memory area holding the raw CD-TEXT\n  or NULL if obj is NULL or CD-TEXT does not exist. Return value\n  must be freed with cdio_free() when done with it and not NULL.\n*/\nuint8_t *\ncdio_get_cdtext_raw (CdIo *obj)\n{\n  if (obj == NULL) return NULL;\n\n  if (NULL != obj->op.get_cdtext_raw) {\n    return obj->op.get_cdtext_raw (obj->env);\n  } else {\n    return NULL;\n  }\n}\n\n/*!\n  Get the size of the CD in logical block address (LBA) units.\n  \n  @param p_cdio the CD object queried\n  @return the lsn. On error 0 or CDIO_INVALD_LSN.\n*/\nlsn_t \ncdio_get_disc_last_lsn(const CdIo_t *p_cdio)\n{\n  if (!p_cdio) return CDIO_INVALID_LSN;\n  return p_cdio->op.get_disc_last_lsn (p_cdio->env);\n}\n\n/*! \n  Get medium associated with cd_obj.\n*/\ndiscmode_t\ncdio_get_discmode (CdIo_t *cd_obj)\n{\n  if (!cd_obj) return CDIO_DISC_MODE_ERROR;\n  \n  if (cd_obj->op.get_discmode) {\n    return cd_obj->op.get_discmode (cd_obj->env);\n  } else {\n    return CDIO_DISC_MODE_NO_INFO;\n  }\n}\n\n/*!\n  Return a string containing the name of the driver in use.\n  if CdIo is NULL (we haven't initialized a specific device driver), \n  then return NULL.\n*/\nchar *\ncdio_get_mcn (const CdIo_t *p_cdio) \n{\n  if (p_cdio && p_cdio->op.get_mcn) {\n    return p_cdio->op.get_mcn (p_cdio->env);\n  } else {\n    return NULL;\n  }\n}\n\nbool\ncdio_is_discmode_cdrom(discmode_t discmode) \n{\n  switch (discmode) {\n  case CDIO_DISC_MODE_CD_DA:\n  case CDIO_DISC_MODE_CD_DATA:\n  case CDIO_DISC_MODE_CD_XA:\n  case CDIO_DISC_MODE_CD_MIXED:\n  case CDIO_DISC_MODE_NO_INFO:\n    return true;\n  default:\n    return false;\n  }\n}\n\nbool\ncdio_is_discmode_dvd(discmode_t discmode) \n{\n  switch (discmode) {\n    case CDIO_DISC_MODE_DVD_ROM:\n    case CDIO_DISC_MODE_DVD_RAM:\n    case CDIO_DISC_MODE_DVD_R:\n    case CDIO_DISC_MODE_DVD_RW:\n    case CDIO_DISC_MODE_DVD_PR:\n    case CDIO_DISC_MODE_DVD_PRW:\n    case CDIO_DISC_MODE_DVD_OTHER:\n      return true;\n    default:\n      return false;\n  }\n}\n"
  },
  {
    "path": "src/libcdio/driver/ds.c",
    "content": "/*\n  Copyright (C) 2005, 2008, 2011, 2016 Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#ifdef HAVE_STRING_H\n#include <string.h>\n#endif\n\n#include <cdio/ds.h>\n#include <cdio/util.h>\n#include <cdio/types.h>\n#include \"cdio_assert.h\"\n\nstruct _CdioList\n{\n  unsigned length;\n\n  CdioListNode_t *begin;\n  CdioListNode_t *end;\n};\n\nstruct _CdioListNode\n{\n  CdioList_t *list;\n\n  CdioListNode_t *next;\n\n  void *data;\n};\n\n/* impl */\n\nCdioList_t *\n_cdio_list_new (void)\n{\n  CdioList_t *p_new_obj = calloc (1, sizeof (CdioList_t));\n\n  return p_new_obj;\n}\n\nvoid\n_cdio_list_free (CdioList_t *p_list, int free_data, CdioDataFree_t free_fn)\n{\n  while (_cdio_list_length (p_list))\n    _cdio_list_node_free (_cdio_list_begin (p_list), free_data, free_fn);\n\n  free (p_list);\n}\n\nunsigned\n_cdio_list_length (const CdioList_t *p_list)\n{\n  cdio_assert (p_list != NULL);\n\n  return p_list->length;\n}\n\nvoid\n_cdio_list_prepend (CdioList_t *p_list, void *p_data)\n{\n  CdioListNode_t *p_new_node;\n\n  cdio_assert (p_list != NULL);\n\n  p_new_node = calloc (1, sizeof (CdioListNode_t));\n  cdio_assert (p_new_node != NULL);\n\n  p_new_node->list = p_list;\n  p_new_node->next = p_list->begin;\n  p_new_node->data = p_data;\n\n  p_list->begin = p_new_node;\n  if (p_list->length == 0)\n    p_list->end = p_new_node;\n\n  p_list->length++;\n}\n\nvoid\n_cdio_list_append (CdioList_t *p_list, void *p_data)\n{\n  cdio_assert (p_list != NULL);\n\n  if (p_list->length == 0)\n    {\n      _cdio_list_prepend (p_list, p_data);\n    }\n  else\n    {\n      CdioListNode_t *p_new_node = calloc (1, sizeof (CdioListNode_t));\n      cdio_assert (p_new_node != NULL);\n\n      p_new_node->list = p_list;\n      p_new_node->next = NULL;\n      p_new_node->data = p_data;\n\n      p_list->end->next = p_new_node;\n      p_list->end = p_new_node;\n\n      p_list->length++;\n    }\n}\n\nvoid\n_cdio_list_foreach (CdioList_t *p_list, _cdio_list_iterfunc_t func,\n                    void *p_user_data)\n{\n  CdioListNode_t *node;\n\n  cdio_assert (p_list != NULL);\n  cdio_assert (func != 0);\n\n  for (node = _cdio_list_begin (p_list);\n       node != NULL;\n       node = _cdio_list_node_next (node))\n    func (_cdio_list_node_data (node), p_user_data);\n}\n\nCdioListNode_t *\n_cdio_list_find (CdioList_t *p_list, _cdio_list_iterfunc_t cmp_func,\n                 void *p_user_data)\n{\n  CdioListNode_t *p_node;\n\n  cdio_assert (p_list != NULL);\n  cdio_assert (cmp_func != 0);\n\n  for (p_node = _cdio_list_begin (p_list);\n       p_node != NULL;\n       p_node = _cdio_list_node_next (p_node))\n    if (cmp_func (_cdio_list_node_data (p_node), p_user_data))\n      break;\n\n  return p_node;\n}\n\nCdioListNode_t *\n_cdio_list_begin (const CdioList_t *p_list)\n{\n  cdio_assert (p_list != NULL);\n\n  return p_list->begin;\n}\n\nCdioListNode_t *\n_cdio_list_end (CdioList_t *p_list)\n{\n  cdio_assert (p_list != NULL);\n\n  return p_list->end;\n}\n\nCdioListNode_t *\n_cdio_list_node_next (CdioListNode_t *p_node)\n{\n  if (p_node)\n    return p_node->next;\n\n  return NULL;\n}\n\nvoid\n_cdio_list_node_free (CdioListNode_t *p_node,\n                      int free_data, CdioDataFree_t free_fn)\n{\n  CdioList_t *p_list;\n  CdioListNode_t *prev_node;\n\n  cdio_assert (p_node != NULL);\n\n  p_list = p_node->list;\n\n  cdio_assert (_cdio_list_length (p_list) > 0);\n\n  if (free_data && free_fn)\n    free_fn (_cdio_list_node_data (p_node));\n\n  if (_cdio_list_length (p_list) == 1)\n    {\n      cdio_assert (p_list->begin == p_list->end);\n\n      p_list->end = p_list->begin = NULL;\n      p_list->length = 0;\n      free (p_node);\n      return;\n    }\n\n  cdio_assert (p_list->begin != p_list->end);\n\n  if (p_list->begin == p_node)\n    {\n      p_list->begin = p_node->next;\n      free (p_node);\n      p_list->length--;\n      return;\n    }\n\n  for (prev_node = p_list->begin; prev_node->next; prev_node = prev_node->next)\n    if (prev_node->next == p_node)\n      break;\n\n  cdio_assert (prev_node->next != NULL);\n\n  if (p_list->end == p_node)\n    p_list->end = prev_node;\n\n  prev_node->next = p_node->next;\n\n  p_list->length--;\n\n  free (p_node);\n}\n\nvoid *\n_cdio_list_node_data (CdioListNode_t *p_node)\n{\n  if (p_node)\n    return p_node->data;\n\n  return NULL;\n}\n\n/* eof */\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/driver/filemode.h",
    "content": "/*\n  filemode.h -- file modes common definitions\n\n  Copyright (C) 2005, 2008, 2011, 2012 Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 1985, 1990, 1993, 1998-2000 Free Software Foundation, Inc.\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n#ifndef CDIO_DRIVER_FILEMODE_H_\n#define CDIO_DRIVER_FILEMODE_H_\n\n#ifdef HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n\n#ifndef S_IRUSR\n# ifdef S_IREAD\n#  define S_IRUSR S_IREAD\n# else\n#  define S_IRUSR 00400\n# endif\n#endif\n\n#ifndef S_IWUSR\n# ifdef S_IWRITE\n#  define S_IWUSR S_IWRITE\n# else\n#  define S_IWUSR 00200\n# endif\n#endif\n\n#ifndef S_IXUSR\n# ifdef S_IEXEC\n#  define S_IXUSR S_IEXEC\n# else\n#  define S_IXUSR 00100\n# endif\n#endif\n\n#ifndef S_IRGRP\n# define S_IRGRP (S_IRUSR >> 3)\n#endif\n#ifndef S_IWGRP\n# define S_IWGRP (S_IWUSR >> 3)\n#endif\n#ifndef S_IXGRP\n# define S_IXGRP (S_IXUSR >> 3)\n#endif\n#ifndef S_IROTH\n# define S_IROTH (S_IRUSR >> 6)\n#endif\n#ifndef S_IWOTH\n# define S_IWOTH (S_IWUSR >> 6)\n#endif\n#ifndef S_IXOTH\n# define S_IXOTH (S_IXUSR >> 6)\n#endif\n\n#ifdef STAT_MACROS_BROKEN\n# undef S_ISBLK\n# undef S_ISCHR\n# undef S_ISDIR\n# undef S_ISFIFO\n# undef S_ISLNK\n# undef S_ISMPB\n# undef S_ISMPC\n# undef S_ISNWK\n# undef S_ISREG\n# undef S_ISSOCK\n#endif /* STAT_MACROS_BROKEN.  */\n\n#if !defined S_IFBLK && defined _WIN32\n# define S_IFBLK 0x3000\n#endif\n#if !defined S_IFIFO && defined _WIN32\n# define S_IFIFO 0x1000\n#endif\n#if !defined S_IFLNK && defined _WIN32\n#define S_IFLNK 0xA000\n#endif\n#if !defined S_IFSOCK && defined _WIN32\n#define S_IFSOCK 0xC000\n#endif\n\n#if !defined S_ISBLK && defined S_IFBLK\n# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)\n#endif\n#if !defined S_ISCHR && defined S_IFCHR\n# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)\n#endif\n#if !defined S_ISDIR && defined S_IFDIR\n# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)\n#endif\n#if !defined S_ISREG && defined S_IFREG\n# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)\n#endif\n#if !defined S_ISFIFO && defined S_IFIFO\n# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)\n#endif\n#if !defined HAVE_S_ISLNK\n# if !defined S_ISLNK && defined S_IFLNK\n#  define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)\n# else\n#  define S_ISLNK(m) ((void)m, 0)\n# endif\n#endif\n#if !defined HAVE_S_ISSOCK\n# if !defined S_ISSOCK && defined S_IFSOCK\n#  define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)\n# else\n#  define S_ISSOCK(m) ((void)m, 0)\n# endif\n#endif\n#if !defined S_ISMPB && defined S_IFMPB /* V7 */\n# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)\n# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)\n#endif\n#if !defined S_ISNWK && defined S_IFNWK /* HP/UX */\n# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)\n#endif\n#if !defined S_ISDOOR && defined S_IFDOOR /* Solaris 2.5 and up */\n# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR)\n#endif\n#if !defined S_ISCTG && defined S_IFCTG /* MassComp */\n# define S_ISCTG(m) (((m) & S_IFMT) == S_IFCTG)\n#endif\n\n#endif /* CDIO_DRIVER_FILEMODE_H_ */\n"
  },
  {
    "path": "src/libcdio/driver/generic.h",
    "content": "/*\n  Copyright (C) 2004-2006, 2008-2009, 2012-2013\n  Rocky Bernstein <rocky@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/* Internal routines for CD I/O drivers. */\n\n\f\n#ifndef CDIO_DRIVER_GENERIC_H_\n#define CDIO_DRIVER_GENERIC_H_\n\n#if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H)\n# include \"config.h\"\n#endif\n\n#include <cdio/cdio.h>\n#include <cdio/cdtext.h>\n#include <cdio/iso9660.h>\n\n#ifdef HAVE_STDBOOL_H\n# include <stdbool.h>\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n  /*!\n    Things common to private device structures. Even though not all\n    devices may have some of these fields, by listing common ones\n    we facilitate writing generic routines and even cut-and-paste\n    code.\n   */\n  typedef struct {\n    char *source_name;      /**< Name used in open. */\n    bool  init;             /**< True if structure has been initialized */\n    bool  toc_init;         /**< True if TOC read in */\n    bool  b_cdtext_error;   /**< True if trouble reading CD-Text */\n\n    int   ioctls_debugged;  /**< for debugging */\n\n    /* Only one of data_source or fd is used; fd  is for CD-ROM\n       devices and the data_source for stream reading (bincue, nrg, toc,\n       network).\n     */\n    CdioDataSource_t *data_source;\n    int     fd;             /**< File descriptor of device */\n    track_t i_first_track;  /**< The starting track number. */\n    track_t i_tracks;       /**< The number of tracks. */\n\n    uint8_t u_joliet_level; /**< 0 = no Joliet extensions.\n                               1-3: Joliet level. */\n    iso9660_pvd_t pvd;\n    iso9660_svd_t svd;\n    CdIo_t   *cdio;         /**< a way to call general cdio routines. */\n    cdtext_t *cdtext;       /**< CD-Text for disc. */\n    track_flags_t track_flags[CDIO_CD_MAX_TRACKS+1];\n\n    /* Memorized sense reply of the most recent SCSI command.\n       Recorded by driver implementations of cdio_funcs_t.run_mmc_cmd().\n       Read by API function mmc_get_cmd_scsi_sense().\n    */\n    unsigned char  scsi_mmc_sense[263];   /* See SPC-3 4.5.3 : 252 bytes legal\n                                             but 263 bytes possible */\n    int            scsi_mmc_sense_valid;  /* Number of valid sense bytes */\n\n    /* Memorized eventual system specific SCSI address tuple text.\n       Empty text means that there is no such text defined for the drive.\n       NULL means that the driver does not support \"scsi-tuple\".\n       To be read by cdio_get_arg(\"scsi-tuple\").\n       System specific suffixes to the key may demand and eventually\n       guarantee a further specified format.\n       E.g. \"scsi-tuple-linux\" guarantees either \"Bus,Host,Channel,Target,Lun\",\n                               or empty text, or NULL. No other forms.\n    */\n    char *scsi_tuple;\n  } generic_img_private_t;\n\n  /*!\n    Bogus eject media when there is no ejectable media, e.g. a disk image\n    We always return 2. Should we also free resources?\n  */\n  driver_return_code_t cdio_generic_unimplemented_eject_media (void *p_env);\n\n  /*!\n    Set the blocksize for subsequent reads.\n\n    @return -2 since it's not implemented.\n  */\n  driver_return_code_t\n  cdio_generic_unimplemented_set_blocksize (void *p_user_data,\n                                            uint16_t i_blocksize);\n\n  /*!\n    Set the drive speed.\n\n    @return -2 since it's not implemented.\n  */\n  driver_return_code_t cdio_generic_unimplemented_set_speed (void *p_user_data,\n                                                             int i_speed);\n\n  /*!\n    Release and free resources associated with cd.\n  */\n  void cdio_generic_free (void *p_env);\n\n  /*!\n    Initialize CD device.\n  */\n  bool cdio_generic_init (void *p_env, int open_mode);\n\n  /*!\n    Reads into buf the next size bytes.\n    Returns -1 on error.\n    Is in fact libc's read().\n  */\n  off_t cdio_generic_lseek (void *p_env, off_t offset, int whence);\n\n  /*!\n    Reads into buf the next size bytes.\n    Returns -1 on error.\n    Is in fact libc's read().\n  */\n  ssize_t cdio_generic_read (void *p_env, void *p_buf, size_t size);\n\n  /*!\n    Reads a single form1 sector from cd device into data starting\n    from lsn. Returns 0 if no error.\n  */\n  int cdio_generic_read_form1_sector (void * user_data, void *data,\n                                      lsn_t lsn);\n\n  /*!\n    Release and free resources associated with stream or disk image.\n  */\n  void cdio_generic_stdio_free (void *env);\n\n  /*!\n    Return true if source_name could be a device containing a CD-ROM on\n    Win32\n  */\n  bool cdio_is_device_win32(const char *source_name);\n\n  /*!\n    Return true if source_name could be a device containing a CD-ROM on\n    OS/2\n  */\n  bool cdio_is_device_os2(const char *source_name);\n\n\n  /*!\n    Return true if source_name could be a device containing a CD-ROM on\n    most Unix servers with block and character devices.\n  */\n  bool cdio_is_device_generic(const char *source_name);\n\n\n  /*!\n    Like above, but don't give a warning device doesn't exist.\n  */\n  bool cdio_is_device_quiet_generic(const char *source_name);\n\n  /*!\n    Get cdtext information for a CdIo object .\n\n    @param obj the CD object that may contain CD-TEXT information.\n    @return the CD-TEXT object or NULL if obj is NULL\n    or CD-TEXT information does not exist.\n  */\n  cdtext_t *get_cdtext_generic (void *p_user_data);\n\n  /*!\n    Return the number of of the first track.\n    CDIO_INVALID_TRACK is returned on error.\n  */\n  track_t get_first_track_num_generic(void *p_user_data);\n\n  /*!\n    Return the number of tracks in the current medium.\n  */\n  track_t get_num_tracks_generic(void *p_user_data);\n\n  /*!\n    Get disc type associated with cd object.\n  */\n  discmode_t get_discmode_generic (void *p_user_data );\n\n  /*!\n    Same as above but only handles CD cases\n  */\n  discmode_t get_discmode_cd_generic (void *p_user_data );\n\n  /*! Return number of channels in track: 2 or 4; -2 if not\n    implemented or -1 for error.\n    Not meaningful if track is not an audio track.\n  */\n  int  get_track_channels_generic(const void *p_user_data, track_t i_track);\n\n  /*! Return 1 if copy is permitted on the track, 0 if not, or -1 for error.\n    Is this meaningful if not an audio track?\n  */\n  track_flag_t get_track_copy_permit_generic(void *p_user_data,\n                                             track_t i_track);\n\n  /*! Return 1 if track has pre-emphasis, 0 if not, or -1 for error.\n    Is this meaningful if not an audio track?\n\n    pre-emphasis is a non linear frequency response.\n  */\n  track_flag_t get_track_preemphasis_generic(const void *p_user_data,\n                                             track_t i_track);\n\n  /*!\n    Read cdtext information for a CdIo object .\n\n    return true on success, false on error or CD-Text information does\n    not exist.\n  */\n  uint8_t * read_cdtext_generic (void *p_env);\n\n  void set_track_flags(track_flags_t *p_track_flag, uint8_t flag);\n\n  /*! Read mode 1 or mode2 sectors (using cooked mode).  */\n  driver_return_code_t read_data_sectors_generic (void *p_user_data,\n                                                  void *p_buf, lsn_t i_lsn,\n                                                  uint16_t i_blocksize,\n                                                  uint32_t i_blocks);\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n\n#endif /* CDIO_DRIVER_GENERIC_H_ */\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/driver/logging.c",
    "content": "/*\n  Copyright (C) 2003, 2004, 2008, 2011, 2012, 2015\n  Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#ifdef HAVE_STDARG_H\n#include <stdarg.h>\n#endif\n#ifdef HAVE_STDIO_H\n#include <stdio.h>\n#endif\n\n#include <cdio/logging.h>\n#include \"cdio_assert.h\"\n#include \"portable.h\"\n#include <assert.h>\n\ncdio_log_level_t cdio_loglevel_default = CDIO_LOG_WARN;\n\nextern void\ncdio_default_log_handler(cdio_log_level_t level, const char message[])\n{\n  switch (level)\n    {\n    case CDIO_LOG_ERROR:\n      if (level >= cdio_loglevel_default) {\n        fprintf (stderr, \"**ERROR: %s\\n\", message);\n        fflush (stderr);\n      }\n      exit (EXIT_FAILURE);\n      break;\n    case CDIO_LOG_DEBUG:\n      if (level >= cdio_loglevel_default) {\n        fprintf (stdout, \"--DEBUG: %s\\n\", message);\n      }\n      break;\n    case CDIO_LOG_WARN:\n      if (level >= cdio_loglevel_default) {\n        fprintf (stdout, \"++ WARN: %s\\n\", message);\n      }\n      break;\n    case CDIO_LOG_INFO:\n      if (level >= cdio_loglevel_default) {\n        fprintf (stdout, \"   INFO: %s\\n\", message);\n      }\n      break;\n    case CDIO_LOG_ASSERT:\n      if (level >= cdio_loglevel_default) {\n        fprintf (stderr, \"!ASSERT: %s\\n\", message);\n        fflush (stderr);\n      }\n      abort ();\n      break;\n    default:\n      cdio_assert_not_reached ();\n      break;\n    }\n\n  fflush (stdout);\n}\n\ncdio_log_handler_t _handler = cdio_default_log_handler;\n\ncdio_log_handler_t\ncdio_log_set_handler(cdio_log_handler_t new_handler)\n{\n  cdio_log_handler_t old_handler = _handler;\n\n  _handler = new_handler;\n\n  return old_handler;\n}\n\nstatic void\ncdio_logv(cdio_log_level_t level, const char format[], va_list args)\n{\n  char buf[1024] = { 0, };\n\n  /* _handler() is user defined and we want to make sure _handler()\n  doesn't call us, cdio_logv. in_recursion is used for that, however\n  it has a problem in multi-threaded programs. I'm not sure how to\n  handle multi-threading and recursion checking both. For now, we'll\n  leave in the recursion checking, at the expense of handling\n  multi-threaded log calls. To ameliorate this, we'll check the log\n  level and handle calls where there is no output, before the\n  recursion check.\n  */\n static int in_recursion = 0;\n\n  if (level < cdio_loglevel_default) return;\n\n  if (in_recursion) {\n    /* Can't use cdio_assert_not_reached() as that may call cdio_logv */\n    assert(0);\n  }\n\n  in_recursion = 1;\n\n  vsnprintf(buf, sizeof(buf)-1, format, args);\n\n  _handler(level, buf);\n\n  in_recursion = 0;\n}\n\nvoid\ncdio_log(cdio_log_level_t level, const char format[], ...)\n{\n  va_list args;\n  va_start (args, format);\n  cdio_logv (level, format, args);\n  va_end (args);\n}\n\n#define CDIO_LOG_TEMPLATE(level, LEVEL) \\\nvoid \\\ncdio_ ## level (const char format[], ...) \\\n{ \\\n  va_list args; \\\n  va_start (args, format); \\\n  cdio_logv (CDIO_LOG_ ## LEVEL, format, args); \\\n  va_end (args); \\\n}\n\nCDIO_LOG_TEMPLATE(debug, DEBUG)\nCDIO_LOG_TEMPLATE(info, INFO)\nCDIO_LOG_TEMPLATE(warn, WARN)\nCDIO_LOG_TEMPLATE(error, ERROR)\n\n#undef CDIO_LOG_TEMPLATE\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/driver/memory.c",
    "content": "/*\n  Copyright (C) 2014-2015 Robert Kausch <robert.kausch@freac.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n\n#include <cdio/memory.h>\n#include <cdio/types.h>\n\n/*! \n  Free the passed pointer.\n  \n  @param p_memory a pointer to memory allocated by a libcdio funtion.\n*/\nvoid\ncdio_free (void *p_memory)\n{\n  if (p_memory != NULL)\n    free(p_memory);\n}\n"
  },
  {
    "path": "src/libcdio/driver/portable.h",
    "content": "/*\n  Copyright (C) 2006, 2008, 2011, 2012 Rocky Bernstein <rocky@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/* \n   This file contains definitions to fill in for differences or\n   deficiencies to OS or compiler irregularities.  If this file is\n   included other routines can be more portable.\n*/\n\f\n#ifndef CDIO_DRIVER_PORTABLE_H_\n#define CDIO_DRIVER_PORTABLE_H_\n\n#if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__)\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#if !defined(HAVE_FTRUNCATE)\n# if defined (_WIN32)\n#  define ftruncate chsize\n# endif\n#endif /*HAVE_FTRUNCATE*/\n\n#if !defined(HAVE_SNPRINTF)\n# if defined (_MSC_VER)\n#  define snprintf _snprintf\n# endif\n#endif /*HAVE_SNPRINTF*/\n\n#if !defined(HAVE_VSNPRINTF)\n# if defined (_MSC_VER)\n#  define vsnprintf _vsnprintf\n# endif\n#endif /*HAVE_SNPRINTF*/\n\n#if !defined(HAVE_DRAND48) && defined(HAVE_RAND)\n# define drand48()   (rand() / (double)RAND_MAX)\n#endif\n\n#endif /* CDIO_DRIVER_PORTABLE_H_ */\n"
  },
  {
    "path": "src/libcdio/driver/read.c",
    "content": "/*\n  Copyright (C) 2005, 2008, 2011, 2012 Rocky Bernstein <rocky@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/** \\file read.h\n *\n * \\brief sector (block, frame)-related libcdio routines.\n */\n\f\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef HAVE_STDBOOL_H\n# include <stdbool.h>\n#endif\n\n#include <cdio/cdio.h>\n#include <cdio/logging.h>\n#include \"cdio_private.h\"\n#include \"cdio_assert.h\"\n\n#ifdef HAVE_STRING_H\n#include <string.h>\n#endif\n\n#define check_read_parms(p_cdio, p_buf, i_lsn)                          \\\n  if (!p_cdio) return DRIVER_OP_UNINIT;                                 \\\n  if (!p_buf || CDIO_INVALID_LSN == i_lsn)                              \\\n    return DRIVER_OP_ERROR;\n\n#define check_lsn(i_lsn)                                                \\\n  check_read_parms(p_cdio, p_buf, i_lsn);                               \\\n  {                                                                     \\\n    lsn_t end_lsn =                                                     \\\n      cdio_get_track_lsn(p_cdio, CDIO_CDROM_LEADOUT_TRACK);             \\\n    if ( i_lsn > end_lsn ) {                                            \\\n      cdio_info(\"Trying to access past end of disk lsn: %ld, end lsn: %ld\", \\\n                (long int) i_lsn, (long int) end_lsn);                  \\\n      return DRIVER_OP_ERROR;                                           \\\n    }                                                                   \\\n  }\n\n#define check_lsn_blocks(i_lsn, i_blocks)                               \\\n  check_read_parms(p_cdio, p_buf, i_lsn);                               \\\n  {                                                                     \\\n    lsn_t end_lsn =                                                     \\\n      cdio_get_track_lsn(p_cdio, CDIO_CDROM_LEADOUT_TRACK);             \\\n    if ( i_lsn > end_lsn ) {                                            \\\n      cdio_info(\"Trying to access past end of disk lsn: %ld, end lsn: %ld\", \\\n                (long int) i_lsn, (long int) end_lsn);                   \\\n      return DRIVER_OP_ERROR;                                            \\\n    }                                                                    \\\n    /* Care is used in the expression below to be correct with */        \\\n    /* respect to unsigned integers.                           */        \\\n    if ( i_lsn + i_blocks > end_lsn + 1 ) {                              \\\n      cdio_info(\"Request truncated to end disk; lsn: %ld, end lsn: %ld\", \\\n                (long int) i_lsn, (long int) end_lsn);                   \\\n      i_blocks = end_lsn - i_lsn + 1;                                    \\\n    }                                                                    \\\n  }\n\n/*!\n  lseek - reposition read/write file offset\n  Returns (off_t) -1 on error.\n  Similar to (if not the same as) libc's lseek()\n*/\noff_t\ncdio_lseek (const CdIo_t *p_cdio, off_t offset, int whence)\n{\n  if (!p_cdio) return DRIVER_OP_UNINIT;\n\n  if (p_cdio->op.lseek)\n    return (p_cdio->op.lseek) (p_cdio->env, offset, whence);\n  return DRIVER_OP_UNSUPPORTED;\n}\n\n/*!  Reads into buf the next size bytes.  Similar to (if not the\n  same as) libc's read(). This is a \"cooked\" read, or one handled by\n  the OS. It probably won't work on audio data. For that use\n  cdio_read_audio_sector(s).\n\n  @param p_cdio object to read from\n  @param p_buf place to read data into. The caller should make sure\n               this location can store at least i_size bytes.\n  @param i_size number of bytes to read\n\n  @return (ssize_t) -1 on error.\n*/\nssize_t\ncdio_read (const CdIo_t *p_cdio, void *p_buf, size_t i_size)\n{\n  if (!p_cdio) return DRIVER_OP_UNINIT;\n\n  if (p_cdio->op.read)\n    return (p_cdio->op.read) (p_cdio->env, p_buf, i_size);\n  return DRIVER_OP_UNSUPPORTED;\n}\n\n/*!\n  Reads an audio sector from cd device into data starting\n  from lsn. Returns DRIVER_OP_SUCCESS if no error.\n*/\ndriver_return_code_t\ncdio_read_audio_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn)\n{\n  check_lsn(i_lsn);\n  if  (p_cdio->op.read_audio_sectors)\n    return p_cdio->op.read_audio_sectors (p_cdio->env, p_buf, i_lsn, 1);\n  return DRIVER_OP_UNSUPPORTED;\n}\n\n/*!\n  Reads audio sectors from cd device into data starting\n  from lsn. Returns DRIVER_OP_SUCCESS if no error.\n*/\ndriver_return_code_t\ncdio_read_audio_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,\n                         uint32_t i_blocks)\n{\n  check_lsn_blocks(i_lsn, i_blocks);\n\n  if (0 == i_blocks) return DRIVER_OP_SUCCESS;\n\n  if (p_cdio->op.read_audio_sectors) {\n    cdio_debug(\"Reading audio sector(s) lsn %u for %d blocks\",\n               i_lsn, i_blocks);\n    return (p_cdio->op.read_audio_sectors) (p_cdio->env, p_buf, i_lsn,\n                                            i_blocks);\n  }\n  return DRIVER_OP_UNSUPPORTED;\n}\n\n/*!\n  Reads an audio sector from cd device into data starting\n  from lsn. Returns DRIVER_OP_SUCCESS if no error.\n*/\ndriver_return_code_t\ncdio_read_data_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,\n                        uint16_t i_blocksize, uint32_t i_blocks)\n{\n  check_lsn(i_lsn);\n\n  if (0 == i_blocks) return DRIVER_OP_SUCCESS;\n\n  if  (p_cdio->op.read_data_sectors) {\n    cdio_debug(\"Reading data sector(s) lsn, %u blocksize %d, for %d blocks\",\n               i_lsn, i_blocksize, i_blocks);\n    return p_cdio->op.read_data_sectors (p_cdio->env, p_buf, i_lsn,\n                                         i_blocksize, i_blocks);\n  }\n  return DRIVER_OP_UNSUPPORTED;\n}\n\n\n#ifndef SEEK_SET\n#define SEEK_SET 0\n#endif\n\n/*!\n   Reads a single mode1 form1 or form2  sector from cd device\n   into data starting from lsn. Returns DRIVER_OP_SUCCESS if no error.\n */\ndriver_return_code_t\ncdio_read_mode1_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,\n                        bool b_form2)\n{\n  uint32_t size = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE ;\n\n  check_lsn(i_lsn);\n  if (p_cdio->op.read_mode1_sector) {\n    cdio_debug(\"Reading mode 1 secto lsn %u\", i_lsn);\n    return p_cdio->op.read_mode1_sector(p_cdio->env, p_buf, i_lsn, b_form2);\n  } else if (p_cdio->op.lseek && p_cdio->op.read) {\n    char buf[M2RAW_SECTOR_SIZE] = { 0, };\n    if (0 > cdio_lseek(p_cdio, (off_t)CDIO_CD_FRAMESIZE * i_lsn, SEEK_SET))\n      return -1;\n    if (0 > cdio_read(p_cdio, buf, CDIO_CD_FRAMESIZE))\n      return -1;\n    memcpy (p_buf, buf, size);\n    return DRIVER_OP_SUCCESS;\n  }\n\n  return DRIVER_OP_UNSUPPORTED;\n}\n\n/*!\n  Reads mode 1 sectors\n\n  @param p_cdio object to read from\n  @param buf place to read data into\n  @param lsn sector to read\n  @param b_form2 true for reading mode 1 form 2 sectors or false for\n  mode 1 form 1 sectors.\n  @param i_blocks number of sectors to read\n*/\ndriver_return_code_t\ncdio_read_mode1_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,\n                         bool b_form2,  uint32_t i_blocks)\n{\n  check_lsn_blocks(i_lsn, i_blocks);\n\n  if (0 == i_blocks) return DRIVER_OP_SUCCESS;\n\n  if (p_cdio->op.read_mode1_sectors)\n    return (p_cdio->op.read_mode1_sectors) (p_cdio->env, p_buf, i_lsn, b_form2,\n                                            i_blocks);\n  return DRIVER_OP_UNSUPPORTED;\n}\n\n/*!\n  Reads a mode 2 sector\n\n  @param p_cdio object to read from\n  @param buf place to read data into\n  @param lsn sector to read\n  @param b_form2 true for reading mode 2 form 2 sectors or false for\n  mode 2 form 1 sectors.\n*/\ndriver_return_code_t\ncdio_read_mode2_sector (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,\n                        bool b_form2)\n{\n  check_lsn(i_lsn);\n  if (p_cdio->op.read_mode2_sector)\n    return p_cdio->op.read_mode2_sector (p_cdio->env, p_buf, i_lsn, b_form2);\n\n  /* fallback */\n  if (p_cdio->op.read_mode2_sectors != NULL)\n    return cdio_read_mode2_sectors (p_cdio, p_buf, i_lsn, b_form2, 1);\n  return DRIVER_OP_UNSUPPORTED;\n}\n\n/*!\n  Reads mode 2 sectors\n\n  @param p_cdio object to read from\n  @param buf place to read data into\n  @param lsn sector to read\n  @param b_form2 true for reading mode2 form 2 sectors or false for\n  mode 2  form 1 sectors.\n  @param i_blocks number of sectors to read\n*/\ndriver_return_code_t\ncdio_read_mode2_sectors (const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,\n                         bool b_form2, uint32_t i_blocks)\n{\n  check_lsn_blocks(i_lsn, i_blocks);\n\n  if (0 == i_blocks) return DRIVER_OP_SUCCESS;\n\n  if (p_cdio->op.read_mode2_sectors)\n    return (p_cdio->op.read_mode2_sectors) (p_cdio->env, p_buf, i_lsn,\n                                            b_form2, i_blocks);\n  return DRIVER_OP_UNSUPPORTED;\n\n}\n\n\n/** The special case of reading a single block is a common one so we\n    provide a routine for that as a convenience.\n*/\ndriver_return_code_t\ncdio_read_sector(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,\n                 cdio_read_mode_t read_mode)\n{\n  return cdio_read_sectors(p_cdio, p_buf, i_lsn, read_mode, 1);\n}\n\n/*!\n  Reads a number of sectors (AKA blocks).\n\n  @param p_buf place to read data into. The caller should make sure\n  this location is large enough. See below for size information.\n  @param read_mode the kind of \"mode\" to use in reading.\n  @param i_lsn sector to read\n  @param i_blocks number of sectors to read\n  @return DRIVER_OP_SUCCESS (0) if no error, other (negative) enumerations\n  are returned on error.\n\n  If read_mode is CDIO_MODE_AUDIO,\n    *p_buf should hold at least CDIO_FRAMESIZE_RAW * i_blocks bytes.\n\n  If read_mode is CDIO_MODE_DATA,\n    *p_buf should hold at least i_blocks times either ISO_BLOCKSIZE,\n    M1RAW_SECTOR_SIZE or M2F2_SECTOR_SIZE depending on the kind of\n    sector getting read. If you don't know whether you have a Mode 1/2,\n    Form 1/ Form 2/Formless sector best to reserve space for the maximum\n    which is M2RAW_SECTOR_SIZE.\n\n  If read_mode is CDIO_MODE_M2F1,\n    *p_buf should hold at least M2RAW_SECTOR_SIZE * i_blocks bytes.\n\n  If read_mode is CDIO_MODE_M2F2,\n    *p_buf should hold at least CDIO_CD_FRAMESIZE * i_blocks bytes.\n\n\n*/\ndriver_return_code_t\ncdio_read_sectors(const CdIo_t *p_cdio, void *p_buf, lsn_t i_lsn,\n                  cdio_read_mode_t read_mode, uint32_t i_blocks)\n{\n  switch(read_mode) {\n  case CDIO_READ_MODE_AUDIO:\n    return cdio_read_audio_sectors (p_cdio, p_buf, i_lsn, i_blocks);\n  case CDIO_READ_MODE_M1F1:\n    return cdio_read_mode1_sectors (p_cdio, p_buf, i_lsn, false, i_blocks);\n  case CDIO_READ_MODE_M1F2:\n    return cdio_read_mode1_sectors (p_cdio, p_buf, i_lsn, true,  i_blocks);\n  case CDIO_READ_MODE_M2F1:\n    return cdio_read_mode2_sectors (p_cdio, p_buf, i_lsn, false, i_blocks);\n  case CDIO_READ_MODE_M2F2:\n    return cdio_read_mode2_sectors (p_cdio, p_buf, i_lsn, true,  i_blocks);\n  }\n  /* Can't happen. Just to shut up gcc. */\n  return DRIVER_OP_ERROR;\n}\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/driver/sector.c",
    "content": "/*\n  Copyright (C) 2004, 2005, 2011, 2012, 2014, 2016\n  Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#include <cdio/sector.h>\n#include <cdio/util.h>\n#include <cdio/logging.h>\n#include \"cdio_assert.h\"\n#include \"portable.h\"\n\n#ifdef HAVE_STDIO_H\n#include <stdio.h>\n#endif\n#ifdef HAVE_STRING_H\n#include <string.h>\n#endif\n\n#include <ctype.h>\n\n/*! String of bytes used to identify the beginning of a Mode 1 or\n  Mode 2 sector. */\nconst uint8_t CDIO_SECTOR_SYNC_HEADER[CDIO_CD_SYNC_SIZE] =\n  {0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0};\n\n/* Variables to hold debugger-helping enumerations */\nenum cdio_cd_enums;\nenum m2_sector_enums;\n\nlba_t\ncdio_lba_to_lsn (lba_t lba)\n{\n  if (CDIO_INVALID_LBA     == lba) return CDIO_INVALID_LSN;\n  return lba - CDIO_PREGAP_SECTORS;\n}\n\n/*\n   The below is adapted from cdparanoia code which claims it is\n   straight from the MMC3 spec.\n*/\n\nvoid\ncdio_lsn_to_msf (lsn_t lsn, msf_t *msf)\n{\n  int m, s, f;\n\n  cdio_assert (msf != 0);\n\n  if ( lsn >= -CDIO_PREGAP_SECTORS ){\n    m    = (lsn + CDIO_PREGAP_SECTORS) / CDIO_CD_FRAMES_PER_MIN;\n    lsn -= m * CDIO_CD_FRAMES_PER_MIN;\n    s    = (lsn + CDIO_PREGAP_SECTORS) / CDIO_CD_FRAMES_PER_SEC;\n    lsn -= s * CDIO_CD_FRAMES_PER_SEC;\n    f    = lsn + CDIO_PREGAP_SECTORS;\n  } else {\n    m    = (lsn + CDIO_CD_MAX_LSN)     / CDIO_CD_FRAMES_PER_MIN;\n    lsn -= m * (CDIO_CD_FRAMES_PER_MIN);\n    s    = (lsn+CDIO_CD_MAX_LSN)       / CDIO_CD_FRAMES_PER_SEC;\n    lsn -= s * CDIO_CD_FRAMES_PER_SEC;\n    f    = lsn + CDIO_CD_MAX_LSN;\n  }\n\n  if (m > 99) {\n    cdio_warn (\"number of minutes (%d) truncated to 99.\", m);\n    m = 99;\n  }\n\n  msf->m = cdio_to_bcd8 (m);\n  msf->s = cdio_to_bcd8 (s);\n  msf->f = cdio_to_bcd8 (f);\n}\n\n/*!\n  Convert an LBA into a string representation of the MSF.\n  \\warning cdio_lba_to_msf_str returns new allocated string */\nchar *\ncdio_lba_to_msf_str (lba_t lba)\n{\n\n  if (CDIO_INVALID_LBA == lba) {\n    return strdup(\"*INVALID\");\n  } else {\n    msf_t msf;\n    msf.m = msf.s = msf.f = 0;\n    cdio_lba_to_msf (lba, &msf);\n    return cdio_msf_to_str(&msf);\n  }\n}\n\n/*!\n  Convert an LSN into the corresponding LBA.\n  CDIO_INVALID_LBA is returned if there is an error.\n*/\nlba_t\ncdio_lsn_to_lba (lsn_t lsn)\n{\n  if (CDIO_INVALID_LSN  == lsn) return CDIO_INVALID_LBA;\n  return lsn + CDIO_PREGAP_SECTORS;\n}\n\n/*!\n  Convert an LBA into the corresponding MSF.\n*/\nvoid\ncdio_lba_to_msf (lba_t lba, msf_t *msf)\n{\n  cdio_assert (msf != 0);\n  cdio_lsn_to_msf(cdio_lba_to_lsn(lba), msf);\n}\n\n/*!\n  Convert a MSF into the corresponding LBA.\n  CDIO_INVALID_LBA is returned if there is an error.\n*/\nlba_t\ncdio_msf_to_lba (const msf_t *msf)\n{\n  uint32_t lba = 0;\n\n  cdio_assert (msf != 0);\n\n  lba = cdio_from_bcd8 (msf->m);\n  lba *= CDIO_CD_SECS_PER_MIN;\n\n  lba += cdio_from_bcd8 (msf->s);\n  lba *= CDIO_CD_FRAMES_PER_SEC;\n\n  lba += cdio_from_bcd8 (msf->f);\n\n  return lba;\n}\n\n/*!\n  Convert a MSF into the corresponding LSN.\n  CDIO_INVALID_LSN is returned if there is an error.\n*/\nlba_t\ncdio_msf_to_lsn (const msf_t *msf)\n{\n  return cdio_lba_to_lsn(cdio_msf_to_lba (msf));\n}\n\n/*!\n  Convert an LBA into a string representation of the MSF.\n  \\warning cdio_lba_to_msf_str returns new allocated string */\nchar *\ncdio_msf_to_str (const msf_t *msf)\n{\n  char buf[16];\n\n  snprintf (buf, sizeof (buf), \"%2.2x:%2.2x:%2.2x\", msf->m, msf->s, msf->f);\n  return strdup (buf);\n}\n\n/*!\n  Convert a MSF - broken out as 3 integer components into the\n  corresponding LBA.\n  CDIO_INVALID_LBA is returned if there is an error.\n*/\nlba_t\ncdio_msf3_to_lba (unsigned int minutes, unsigned int seconds,\n                  unsigned int frames)\n{\n  return ((minutes * CDIO_CD_SECS_PER_MIN + seconds) * CDIO_CD_FRAMES_PER_SEC\n\t  + frames);\n}\n\n/*!\n  Convert a string of the form MM:SS:FF into the corresponding LBA.\n  CDIO_INVALID_LBA is returned if there is an error.\n*/\nlba_t\ncdio_mmssff_to_lba (const char *psz_mmssff)\n{\n  int psz_field;\n  lba_t ret;\n  unsigned char c;\n\n  if (0 == strcmp (psz_mmssff, \"0\"))\n    return 0;\n\n  c = *psz_mmssff++;\n  if(c >= '0' && c <= '9')\n    psz_field = (c - '0');\n  else\n    return CDIO_INVALID_LBA;\n  while(':' != (c = *psz_mmssff++)) {\n    if(c >= '0' && c <= '9')\n      psz_field = psz_field * 10 + (c - '0');\n    else\n      return CDIO_INVALID_LBA;\n  }\n\n  ret = cdio_msf3_to_lba (psz_field, 0, 0);\n\n  c = *psz_mmssff++;\n  if(c >= '0' && c <= '9')\n    psz_field = (c - '0');\n  else\n    return CDIO_INVALID_LBA;\n  if(':' != (c = *psz_mmssff++)) {\n    if(c >= '0' && c <= '9') {\n      psz_field = psz_field * 10 + (c - '0');\n      c = *psz_mmssff++;\n      if(c != ':')\n\treturn CDIO_INVALID_LBA;\n    }\n    else\n      return CDIO_INVALID_LBA;\n  }\n\n  if(psz_field >= CDIO_CD_SECS_PER_MIN)\n    return CDIO_INVALID_LBA;\n\n  ret += cdio_msf3_to_lba (0, psz_field, 0);\n\n  c = *psz_mmssff++;\n  if (isdigit(c))\n    psz_field = (c - '0');\n  else\n    return -1;\n  if('\\0' != (c = *psz_mmssff++)) {\n    if (isdigit(c)) {\n      psz_field = psz_field * 10 + (c - '0');\n      c = *psz_mmssff++;\n    }\n    else\n      return CDIO_INVALID_LBA;\n  }\n\n  if('\\0' != c)\n    return CDIO_INVALID_LBA;\n\n  if(psz_field >= CDIO_CD_FRAMES_PER_SEC)\n    return CDIO_INVALID_LBA;\n\n  ret += psz_field;\n\n  return ret;\n}\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/driver/track.c",
    "content": "/*\n  Copyright (C) 2003-2005, 2008, 2011-2013\n  Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/*! Track-related routines. */\n\f\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n\n#ifdef HAVE_STDBOOL_H\n# include <stdbool.h>\n#endif\n\n#include <cdio/cdio.h>\n#include <cdio/logging.h>\n#include \"cdio_private.h\"\n\nconst char *track_format2str[6] =\n  {\n    \"audio\", \"CD-i\", \"XA\", \"data\", \"PSX\", \"error\"\n  };\n\n/* Variables to hold debugger-helping enumerations */\nenum cdio_track_enums;\n\n/*!\n  Return the number of the first track.\n  CDIO_INVALID_TRACK is returned on error.\n*/\ntrack_t\ncdio_get_first_track_num(const CdIo_t *p_cdio)\n{\n  if (NULL == p_cdio) {\n    cdio_info(\"Null CdIo object passed\\n\");\n    return CDIO_INVALID_TRACK;\n  }\n\n\n  if (p_cdio->op.get_first_track_num) {\n    return p_cdio->op.get_first_track_num (p_cdio->env);\n  } else {\n    return CDIO_INVALID_TRACK;\n  }\n}\n\n/*!\n  Return the last track number.\n  CDIO_INVALID_TRACK is returned on error.\n*/\ntrack_t\ncdio_get_last_track_num (const CdIo_t *p_cdio)\n{\n  if (NULL == p_cdio) {\n    cdio_info(\"Null CdIo object passed\\n\");\n    return CDIO_INVALID_TRACK;\n  }\n\n  {\n    const track_t i_first_track = cdio_get_first_track_num(p_cdio);\n    if ( CDIO_INVALID_TRACK != i_first_track ) {\n      const track_t u_tracks = cdio_get_num_tracks(p_cdio);\n      if ( CDIO_INVALID_TRACK != u_tracks )\n\treturn i_first_track + u_tracks - 1;\n    }\n    return CDIO_INVALID_TRACK;\n  }\n}\n\n/*! Return number of channels in track: 2 or 4; -2 if not\n  implemented or -1 for error.\n  Not meaningful if track is not an audio track.\n*/\nint\ncdio_get_track_channels(const CdIo_t *p_cdio, track_t u_track)\n{\n  track_t u_last_track;\n  if (NULL == p_cdio) {\n    cdio_info(\"Null CdIo object passed\\n\");\n    return -1;\n  }\n  u_last_track = cdio_get_last_track_num(p_cdio);\n  if (u_track > u_last_track) {\n     cdio_log(CDIO_LOG_WARN, \"Number of tracks exceeds maximum (%d vs. %d)\\n\",\n              u_track, u_last_track);\n     return -1;\n  }\n  if (p_cdio->op.get_track_channels) {\n    return p_cdio->op.get_track_channels (p_cdio->env, u_track);\n  } else {\n    return -2;\n  }\n}\n\n/*! Return copy protection status on a track. Is this meaningful\n  if not an audio track?\n*/\ntrack_flag_t\ncdio_get_track_copy_permit(const CdIo_t *p_cdio, track_t u_track)\n{\n  if (p_cdio->op.get_track_copy_permit) {\n    return p_cdio->op.get_track_copy_permit (p_cdio->env, u_track);\n  } else {\n    return CDIO_TRACK_FLAG_UNKNOWN;\n  }\n}\n\n/*!\n  Get format of track.\n*/\ntrack_format_t\ncdio_get_track_format(const CdIo_t *p_cdio, track_t u_track)\n{\n  if (!p_cdio) return TRACK_FORMAT_ERROR;\n\n  if (p_cdio->op.get_track_format) {\n    return p_cdio->op.get_track_format (p_cdio->env, u_track);\n  } else {\n    return TRACK_FORMAT_ERROR;\n  }\n}\n/*!\n  Return the Joliet level recognized for p_cdio.\n*/\nuint8_t\ncdio_get_joliet_level(const CdIo_t *p_cdio)\n{\n  if (!p_cdio) return 0;\n  {\n    const generic_img_private_t *p_env\n      = (generic_img_private_t *) (p_cdio->env);\n    return p_env->u_joliet_level;\n  }\n}\n\n/*!\n  Return the number of tracks in the current medium.\n  CDIO_INVALID_TRACK is returned on error.\n*/\ntrack_t\ncdio_get_num_tracks (const CdIo_t *p_cdio)\n{\n  if (p_cdio == NULL) return CDIO_INVALID_TRACK;\n\n  if (p_cdio->op.get_num_tracks) {\n    return p_cdio->op.get_num_tracks (p_cdio->env);\n  } else {\n    return CDIO_INVALID_TRACK;\n  }\n}\n\n/*! Find the track which contans lsn.\n    CDIO_INVALID_TRACK is returned if the lsn outside of the CD or\n    if there was some error.\n\n    If the lsn is before the pregap of the first track 0 is returned.\n    Otherwise we return the track that spans the lsn.\n*/\ntrack_t\ncdio_get_track(const CdIo_t *p_cdio, lsn_t lsn)\n{\n  if (!p_cdio) return CDIO_INVALID_TRACK;\n\n  {\n    track_t i_low_track   = cdio_get_first_track_num(p_cdio);\n    // coverity[overflow_const]\n    track_t i_high_track  = cdio_get_last_track_num(p_cdio)+1;\n    track_t i_lead_track  = i_high_track;\n\n    if (CDIO_INVALID_TRACK == i_low_track\n\t|| CDIO_INVALID_TRACK == i_high_track ) return CDIO_INVALID_TRACK;\n\n    if (lsn < cdio_get_track_lsn(p_cdio, i_low_track))\n      return 0; /* We're in the pre-gap of first track */\n\n    if (lsn > cdio_get_track_lsn(p_cdio, CDIO_CDROM_LEADOUT_TRACK))\n      return CDIO_INVALID_TRACK; /* We're beyond the end. */\n\n    do {\n      const track_t i_mid = (i_low_track + i_high_track) / 2;\n      const lsn_t i_mid_lsn = cdio_get_track_lsn(p_cdio, i_mid);\n      if (lsn <= i_mid_lsn) i_high_track = i_mid - 1;\n      if (lsn >= i_mid_lsn) i_low_track  = i_mid + 1;\n    } while ( i_low_track <= i_high_track );\n\n    if (i_low_track > i_high_track + 1) {\n\ti_high_track++;\n    }\n    if (i_high_track == i_lead_track ) {\n\treturn CDIO_CDROM_LEADOUT_TRACK;\n    } else {\n\treturn i_high_track;\n    }\n  }\n}\n\n/*!\n  Return true if we have XA data (green, mode2 form1) or\n  XA data (green, mode2 form2). That is track begins:\n  sync - header - subheader\n  12     4      -  8\n\n  FIXME: there's gotta be a better design for this and get_track_format?\n*/\nbool\ncdio_get_track_green(const CdIo_t *p_cdio, track_t u_track)\n{\n  if (p_cdio == NULL) {\n    return false;\n  }\n\n  if (p_cdio->op.get_track_green) {\n    return p_cdio->op.get_track_green (p_cdio->env, u_track);\n  } else {\n    return false;\n  }\n}\n\n/*!\n  Return the starting LBA for track number\n  track_num in cdio.  Tracks numbers start at 1.\n  The \"leadout\" track is specified either by\n  using track_num LEADOUT_TRACK or the total tracks+1.\n  CDIO_INVALID_LBA is returned on error.\n*/\nlba_t\ncdio_get_track_lba(const CdIo_t *p_cdio, track_t u_track)\n{\n  if (NULL == p_cdio) {\n    cdio_info(\"Null CdIo object passed\\n\");\n    return CDIO_INVALID_LBA;\n  }\n\n  if (p_cdio->op.get_track_lba) {\n    return p_cdio->op.get_track_lba (p_cdio->env, u_track);\n  } else {\n    msf_t msf;\n    if (p_cdio->op.get_track_msf)\n      if (cdio_get_track_msf(p_cdio, u_track, &msf))\n        return cdio_msf_to_lba(&msf);\n    return CDIO_INVALID_LBA;\n  }\n}\n\n/*!\n  Return the starting LSN for track number\n  u_track in cdio.  Tracks numbers start at 1.\n  The \"leadout\" track is specified either by\n  using u_track LEADOUT_TRACK or the total tracks+1.\n  CDIO_INVALID_LSN is returned on error.\n*/\nlsn_t\ncdio_get_track_lsn(const CdIo_t *p_cdio, track_t u_track)\n{\n  /*track_t u_last_track; */\n  if (NULL == p_cdio) {\n    cdio_info(\"Null CdIo object passed\\n\");\n    return CDIO_INVALID_LSN;\n  }\n  /*\n  u_last_track = cdio_get_last_track_num(p_cdio);\n  if (u_track > u_last_track && u_track != CDIO_CDROM_LEADOUT_TRACK) {\n     cdio_log(CDIO_LOG_WARN, \"Number of tracks exceeds maximum (%d vs. %d)\\n\",\n              u_track, u_last_track);\n     return CDIO_INVALID_LSN;\n  }\n  */\n\n  if (p_cdio->op.get_track_lba) {\n    return cdio_lba_to_lsn(p_cdio->op.get_track_lba (p_cdio->env, u_track));\n  } else {\n    msf_t msf;\n    if (cdio_get_track_msf(p_cdio, u_track, &msf))\n      return cdio_msf_to_lsn(&msf);\n    return CDIO_INVALID_LSN;\n  }\n}\n\n/*!\n  Return the International Standard Recording Code (ISRC) for track number\n  u_track in p_cdio.  Track numbers start at 1.\n\n  Note: The caller must free the returned string with cdio_free()\n  when done with it.\n*/\nchar *\ncdio_get_track_isrc (const CdIo_t *p_cdio, track_t u_track)\n{\n  track_t u_last_track;\n  if (NULL == p_cdio) {\n    cdio_info(\"Null CdIo object passed\\n\");\n    return NULL;\n  }\n\n  u_last_track = cdio_get_last_track_num(p_cdio);\n  if (u_track > u_last_track) {\n     cdio_log(CDIO_LOG_WARN, \"Number of tracks exceeds maximum (%d vs. %d)\\n\",\n              u_track, u_last_track);\n     return NULL;\n  }\n\n  if (p_cdio->op.get_track_isrc) {\n    return p_cdio->op.get_track_isrc (p_cdio->env, u_track);\n  } else {\n    return NULL;\n  }\n}\n\n/*!\n  Return the starting LBA for the pregap for track number\n  u_track in cdio.  Track numbers start at 1.\n  CDIO_INVALID_LBA is returned on error.\n*/\nlba_t\ncdio_get_track_pregap_lba(const CdIo_t *p_cdio, track_t u_track)\n{\n  if (NULL == p_cdio) {\n    cdio_info(\"Null CdIo object passed\\n\");\n    return CDIO_INVALID_LBA;\n  }\n\n  if (p_cdio->op.get_track_pregap_lba) {\n    return p_cdio->op.get_track_pregap_lba (p_cdio->env, u_track);\n  } else {\n    return CDIO_INVALID_LBA;\n  }\n}\n\n/*!\n  Return the starting LSN for the pregap for track number\n  u_track in cdio.  Track numbers start at 1.\n  CDIO_INVALID_LSN is returned on error.\n*/\nlsn_t\ncdio_get_track_pregap_lsn(const CdIo_t *p_cdio, track_t u_track)\n{\n  return cdio_lba_to_lsn(cdio_get_track_pregap_lba(p_cdio, u_track));\n}\n\n/*!\n  Return the ending LSN for track number\n  u_track in cdio.  CDIO_INVALID_LSN is returned on error.\n*/\nlsn_t\ncdio_get_track_last_lsn(const CdIo_t *p_cdio, track_t u_track)\n{\n  lsn_t lsn = cdio_get_track_lsn(p_cdio, u_track+1);\n\n  if (CDIO_INVALID_LSN == lsn) return CDIO_INVALID_LSN;\n  /* Safe, we've always the leadout. */\n  return lsn - 1;\n}\n\n/*!\n  Return the starting MSF (minutes/secs/frames) for track number\n  u_track in cdio.  Track numbers start at 1.\n  The \"leadout\" track is specified either by\n  using u_track LEADOUT_TRACK or the total tracks+1.\n  False is returned if there is no track entry.\n*/\nbool\ncdio_get_track_msf(const CdIo_t *p_cdio, track_t u_track, /*out*/ msf_t *msf)\n{\n  if (!p_cdio) return false;\n\n  if (p_cdio->op.get_track_msf) {\n    return p_cdio->op.get_track_msf (p_cdio->env, u_track, msf);\n  } else if (p_cdio->op.get_track_lba) {\n    lba_t lba = p_cdio->op.get_track_lba (p_cdio->env, u_track);\n    if (lba  == CDIO_INVALID_LBA) return false;\n    cdio_lba_to_msf(lba, msf);\n    return true;\n  } else {\n    return false;\n  }\n}\n\n/*! Return copy protection status on a track. Is this meaningful\n  if not an audio track?\n*/\ntrack_flag_t\ncdio_get_track_preemphasis(const CdIo *p_cdio, track_t u_track)\n{\n  if (p_cdio->op.get_track_preemphasis) {\n    return p_cdio->op.get_track_preemphasis (p_cdio->env, u_track);\n  } else {\n    return CDIO_TRACK_FLAG_UNKNOWN;\n  }\n}\n\n/*!\n  Return the number of sectors between this track an the next.  This\n  includes any pregap sectors before the start of the next track.\n  Tracks start at 1.\n  0 is returned if there is an error.\n*/\nunsigned int\ncdio_get_track_sec_count(const CdIo_t *p_cdio, track_t u_track)\n{\n  const track_t u_tracks = cdio_get_num_tracks(p_cdio);\n\n  if (u_track >=1 && u_track <= u_tracks)\n    return ( cdio_get_track_lba(p_cdio, u_track+1)\n             - cdio_get_track_lba(p_cdio, u_track) );\n  return 0;\n}\n"
  },
  {
    "path": "src/libcdio/driver/utf8.c",
    "content": "/*\n  Copyright (C) 2006, 2008 Burkhard Plaum <plaum@ipf.uni-stuttgart.de>\n  Copyright (C) 2011, 2014 Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2012 Pete Batard <pete@akeo.ie>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/* UTF-8 support */\n\f\n#ifdef HAVE_CONFIG_H\n# define __CDIO_CONFIG_H__ 1\n# include \"config.h\"\n#endif\n\n#ifdef HAVE_STDIO_H\n#include <stdio.h>\n#endif\n\n#ifdef HAVE_STRING_H\n#include <string.h>\n#endif\n\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n\n#ifdef HAVE_ERRNO_H\n#include <errno.h>\n#endif\n\n#include <cdio/utf8.h>\n#include <cdio/logging.h>\n#include <cdio/memory.h>\n#include \"cdio_assert.h\"\n\n/* Windows requires some basic UTF-8 support outside of Joliet */\n#if defined(_WIN32)\n#include <windows.h>\n\n#define wchar_to_utf8_no_alloc(wsrc, dest, dest_size) \\\n\tWideCharToMultiByte(CP_UTF8, 0, wsrc, -1, dest, dest_size, NULL, NULL)\n#define utf8_to_wchar_no_alloc(src, wdest, wdest_size) \\\n\tMultiByteToWideChar(CP_UTF8, 0, src, -1, wdest, wdest_size)\n\n/*\n * Converts an UTF-16 string to UTF8 (allocate returned string)\n * Returns NULL on error\n */\nstatic inline char* cdio_wchar_to_utf8(const wchar_t* wstr)\n  {\n  int size = 0;\n  char* str = NULL;\n\n  /* Find out the size we need to allocate for our converted string */\n  size = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);\n  if (size <= 1) /* An empty string would be size 1 */\n    return NULL;\n\n  if ((str = (char*)calloc(size, 1)) == NULL)\n    return NULL;\n\n  if (wchar_to_utf8_no_alloc(wstr, str, size) != size) {\n    free(str);\n    return NULL;\n  }\n\n  return str;\n  }\n\n/*\n * Converts an UTF8 string to UTF-16 (allocate returned string)\n * Returns NULL on error\n */\nwchar_t* cdio_utf8_to_wchar(const char* str)\n  {\n  int size = 0;\n  wchar_t* wstr = NULL;\n\n  /* Find out the size we need to allocate for our converted string */\n  size = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);\n  if (size <= 1) /* An empty string would be size 1 */\n    return NULL;\n\n  if ((wstr = (wchar_t*)calloc(size, sizeof(wchar_t))) == NULL)\n    return NULL;\n\n  if (utf8_to_wchar_no_alloc(str, wstr, size) != size) {\n    free(wstr);\n    return NULL;\n  }\n  return wstr;\n  }\n\n/* UTF-8 compliant version of fopen() */\nFILE* fopen_utf8(const char* filename, const char* mode)\n{\n  FILE* ret = NULL;\n  wchar_t* wfilename = cdio_utf8_to_wchar(filename);\n  wchar_t* wmode =  cdio_utf8_to_wchar(mode);\n  ret = _wfopen(wfilename, wmode);\n  cdio_free(wfilename);\n  cdio_free(wmode);\n  return ret;\n}\n#endif\n\n#ifdef HAVE_ICONV\n#include <iconv.h>\nstruct cdio_charset_coverter_s\n  {\n  iconv_t ic;\n  };\n\ncdio_charset_coverter_t *\ncdio_charset_converter_create(const char * src_charset,\n                              const char * dst_charset)\n  {\n  cdio_charset_coverter_t * ret;\n  ret = calloc(1, sizeof(*ret));\n  ret->ic = iconv_open(dst_charset, src_charset);\n  return ret;\n  }\n\n#if 0\nstatic void bgav_hexdump(uint8_t * data, int len, int linebreak)\n  {\n  int i;\n  int bytes_written = 0;\n  int imax;\n\n  while(bytes_written < len)\n    {\n    imax = (bytes_written + linebreak > len) ? len - bytes_written : linebreak;\n    for(i = 0; i < imax; i++)\n      fprintf(stderr, \"%02x \", data[bytes_written + i]);\n    for(i = imax; i < linebreak; i++)\n      fprintf(stderr, \"   \");\n    for(i = 0; i < imax; i++)\n      {\n      if(!(data[bytes_written + i] & 0x80) && (data[bytes_written + i] >= 32))\n        fprintf(stderr, \"%c\", data[bytes_written + i]);\n      else\n        fprintf(stderr, \".\");\n      }\n    bytes_written += imax;\n    fprintf(stderr, \"\\n\");\n    }\n  }\n#endif\n\nvoid cdio_charset_converter_destroy(cdio_charset_coverter_t*cnv)\n  {\n  iconv_close(cnv->ic);\n  free(cnv);\n  }\n\n#define BYTES_INCREMENT 16\n\nstatic bool\ndo_convert(iconv_t cd, const char * src, int src_len,\n           char ** dst, int *dst_len)\n  {\n  char * ret;\n\n  char *inbuf;\n  char *outbuf;\n  int alloc_size;\n  int output_pos;\n  size_t inbytesleft;\n  size_t outbytesleft;\n\n  if(src_len < 0)\n    src_len = strlen(src);\n#if 0\n  fprintf(stderr, \"Converting:\\n\");\n  bgav_hexdump(src, src_len, 16);\n#endif\n  alloc_size = src_len + BYTES_INCREMENT;\n\n  inbytesleft  = src_len;\n\n  /* We reserve space here to add a final '\\0' */\n  outbytesleft = alloc_size-1;\n\n  ret    = malloc(alloc_size);\n\n  inbuf  = (char *)src;\n  outbuf = ret;\n\n  while(1)\n    {\n\n    if(iconv(cd, (ICONV_CONST char **)&inbuf, &inbytesleft,\n             &outbuf, &outbytesleft) == (size_t)-1)\n      {\n      switch(errno)\n        {\n        case E2BIG:\n          output_pos = (int)(outbuf - ret);\n\n          alloc_size   += BYTES_INCREMENT;\n          outbytesleft += BYTES_INCREMENT;\n\n          ret = realloc(ret, alloc_size);\n          if (ret == NULL)\n            {\n            cdio_warn(\"Can't realloc(%d).\", alloc_size);\n            return false;\n            }\n          outbuf = ret + output_pos;\n          break;\n        default:\n          cdio_warn(\"Iconv failed: %s\", strerror(errno));\n          if (ret != NULL)\n            free(ret);\n          return false;\n          break;\n        }\n      }\n    if(!inbytesleft)\n      break;\n    }\n  /* Zero terminate */\n  *outbuf = '\\0';\n\n  /* Set return values */\n  *dst = ret;\n  if(dst_len)\n    *dst_len = (int)(outbuf - ret);\n#if 0\n  fprintf(stderr, \"Conversion done, src:\\n\");\n  bgav_hexdump(src, src_len, 16);\n  fprintf(stderr, \"dst:\\n\");\n  bgav_hexdump((uint8_t*)(ret), (int)(outbuf - ret), 16);\n#endif\n  return true;\n  }\n\nbool cdio_charset_convert(cdio_charset_coverter_t*cnv,\n                          char * src, int src_len,\n                          char ** dst, int * dst_len)\n  {\n  return do_convert(cnv->ic, src, src_len, dst, dst_len);\n  }\n\n\n\nbool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst,\n                            int * dst_len, const char * dst_charset)\n  {\n  iconv_t ic;\n  bool result;\n  ic = iconv_open(dst_charset, \"UTF-8\");\n  result = do_convert(ic, src, -1, dst, dst_len);\n  iconv_close(ic);\n  return result;\n  }\n\n\n\n\nbool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst,\n                          const char * src_charset)\n  {\n  iconv_t ic;\n  bool result;\n  ic = iconv_open(\"UTF-8\", src_charset);\n  result = do_convert(ic, src, src_len, dst, NULL);\n  iconv_close(ic);\n  return result;\n  }\n#elif defined(_WIN32)\n\nbool cdio_charset_from_utf8(cdio_utf8_t * src, char ** dst,\n                            int * dst_len, const char * dst_charset)\n  {\n  wchar_t* le_dst;\n  size_t i, len;\n\n  if (src == NULL || dst == NULL || dst_len == NULL || dst_charset == NULL || strcmp(dst_charset, \"UCS-2BE\") != 0)\n    return false;\n\n  /* Eliminate empty strings */\n  le_dst = cdio_utf8_to_wchar(src);\n  if ((le_dst == NULL) || (le_dst[0] == 0)) {\n    cdio_free(le_dst);\n    return false;\n  }\n\n  /* Perform byte reversal */\n  len = wcslen(le_dst);\n  *dst = (char*)calloc(len+1, sizeof(wchar_t));\n  cdio_assert(*dst != NULL);\n  for (i=0; i<2*len; i++) {\n    (*dst)[i] = ((char*)le_dst)[i+1];\n    (*dst)[i+1] = ((char*)le_dst)[i];\n  }\n  free(le_dst);\n\n  return true;\n  }\n\nbool cdio_charset_to_utf8(const char *src, size_t src_len, cdio_utf8_t **dst,\n                          const char *src_charset)\n  {\n  int codepage = 0;\n  wchar_t* wstr = NULL;\n  int i, size = 0;\n\n  if (src == NULL || dst == NULL || src_charset == NULL)\n    return false;\n\n  if (strcmp(src_charset, \"UCS-2BE\") == 0) {\n    codepage = -1;\n  } else if (strcmp(src_charset, \"ASCII\") == 0 || strcmp(src_charset, \"ISO-8859-1\") == 0) {\n    codepage = 28591;\n  } else if (strcmp(src_charset, \"SHIFT_JIS\") == 0) {\n    codepage = 932;\n  } else {\n    cdio_warn(\"Conversion from %s to UTF-8 is not implemented\", src_charset);\n    return false;\n  }\n\n  switch (codepage) {\n  case -1: /* Convert big endian to little endian */\n    /* Compute UCS-2 src length */\n    if (src_len == (size_t)-1) {\n      for (src_len = 0; ((uint16_t*)src)[src_len] !=0; src_len++);\n    } else {\n      src_len >>=1;\n    }\n\n    /* Eliminate empty strings */\n    if ((src_len < 1) || ((src[0] == 0) && (src[1] == 0))) {\n      *dst = NULL;\n      return false;\n    }\n\n    /* Perform byte reversal */\n    wstr = (wchar_t*)calloc(src_len+1, sizeof(wchar_t));\n    cdio_assert(wstr != NULL);\n    for (i=0; i<src_len; i++) {\n      ((char*)wstr)[2*i] = src[2*i+1];\n      ((char*)wstr)[2*i+1] = src[2*i];\n    }\n    wstr[src_len] = 0;\n    break;\n  default:  /* Convert multi-byte to wide string */\n    /* Compute src length */\n    if (src_len == (size_t)-1) {\n      for (src_len = 0; src[src_len] != 0; src_len++);\n    }\n\n    /* Eliminate empty strings */\n    if ((src_len < 1) || (src[0] == 0)) {\n      *dst = NULL;\n      return false;\n    }\n\n    /* Find out the size we need to allocate for our converted string */\n    size = MultiByteToWideChar(codepage, 0, src, -1, NULL, 0);\n    if (size <= 1) /* An empty string would be size 1 */\n      return false;\n\n    if ((wstr = (wchar_t*)calloc(size, sizeof(wchar_t))) == NULL)\n      return false;\n\n    if (MultiByteToWideChar(CP_UTF8, 0, src, -1, wstr, size) != size) {\n      free(wstr);\n      return false;\n    }\n    break;\n  }\n\n  /* Convert wide string to UTF-8 */\n  if (wstr != NULL) {\n    *dst = cdio_wchar_to_utf8(wstr);\n    free(wstr);\n    return (*dst != NULL);\n  }\n\n  return false;\n}\n#else\n# error \"The iconv library is needed to build drivers, but it is not detected\"\n#endif /* HAVE_ICONV */\n"
  },
  {
    "path": "src/libcdio/driver/util.c",
    "content": "/*\n  Copyright (C) 2003, 2004, 2005, 2008, 2009, 2010, 2011\n  Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#include <ctype.h>\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n#ifdef HAVE_STDIO_H\n#include <stdio.h>\n#endif\n\n#ifdef HAVE_STRING_H\n#include <string.h>\n#endif\n\n#ifdef HAVE_INTTYPES_H\n#include \"inttypes.h\"\n#endif\n\n#include <ctype.h>\n\n#include \"cdio_assert.h\"\n#include <cdio/types.h>\n#include <cdio/util.h>\n#include <cdio/version.h>\n\nsize_t\n_cdio_strlenv(char **str_array)\n{\n  size_t n = 0;\n\n  cdio_assert (str_array != NULL);\n\n  while(str_array[n])\n    n++;\n\n  return n;\n}\n\nvoid\n_cdio_strfreev(char **strv)\n{\n  int n;\n\n  cdio_assert (strv != NULL);\n  if (strv == NULL)\n      return;\n\n  for(n = 0; strv[n]; n++)\n    free(strv[n]);\n\n  free(strv);\n}\n\nchar **\n_cdio_strsplit(const char str[], char delim) /* fixme -- non-reentrant */\n{\n  int n;\n  char **strv = NULL;\n  char *_str, *p;\n  char _delim[2] = { 0, 0 };\n\n  cdio_assert (str != NULL);\n\n  _str = strdup(str);\n  _delim[0] = delim;\n\n  cdio_assert (_str != NULL);\n\n  n = 1;\n  p = _str;\n  while(*p)\n    if (*(p++) == delim)\n      n++;\n\n  strv = calloc (n+1, sizeof (char *));\n  cdio_assert (strv != NULL);\n\n  n = 0;\n  while((p = strtok(n ? NULL : _str, _delim)) != NULL)\n    strv[n++] = strdup(p);\n\n  free(_str);\n\n  return strv;\n}\n\nvoid *\n_cdio_memdup (const void *mem, size_t count)\n{\n  void *new_mem = NULL;\n\n  if (mem)\n    {\n      new_mem = calloc (1, count);\n      cdio_assert (new_mem != NULL);\n      memcpy (new_mem, mem, count);\n    }\n\n  return new_mem;\n}\n\nchar *\n_cdio_strdup_upper (const char str[])\n{\n  char *new_str = NULL;\n\n  if (str)\n    {\n      char *p;\n\n      p = new_str = strdup (str);\n\n      while (*p)\n        {\n          *p = toupper ((unsigned char) *p);\n          p++;\n        }\n    }\n\n  return new_str;\n}\n\nint\n_cdio_stricmp (const char str1[], const char str2[])\n{\n  if (str1 && str2) {\n    int c1, c2;\n    do {\n      c1 = tolower((unsigned char)*str1++);\n      c2 = tolower((unsigned char)*str2++);\n    } while (c1 == c2 && c1 != '\\0');\n    return c1 - c2;\n  } else return (str1 != str2);\n}\n\nint\n_cdio_strnicmp(const char str1[], const char str2[], size_t count)\n{\n    if (str1 && str2) {\n      int c1 = 0, c2 = 0;\n      size_t i;\n      for (i = 0; i < count; i++) {\n        c1 = tolower((unsigned char)*str1++);\n        c2 = tolower((unsigned char)*str2++);\n        if (c1 != c2 || c1 == '\\0')\n          break;\n      }\n      return c1 - c2;\n    } else return (str1 != str2);\n}\n\n/* Convert MinGW/MSYS paths that start in \"/c/...\" to \"c:/...\"\n   so that they can be used with fopen(), stat(), etc.\n   Returned string must be freed by the caller using cdio_free().*/\nchar *\n_cdio_strdup_fixpath (const char path[])\n{\n  char *new_path = NULL;\n\n  if (path)\n    {\n       new_path = strdup (path);\n#if defined(_WIN32)\n       if (new_path && (strlen (new_path) >= 3) && (new_path[0] == '/') &&\n          (new_path[2] == '/') && (isalpha (new_path[1])))\n         {\n           new_path[0] = new_path[1];\n           new_path[1] = ':';\n         }\n#endif\n    }\n\n  return new_path;\n}\n\nuint8_t\ncdio_to_bcd8 (uint8_t n)\n{\n  /*cdio_assert (n < 100);*/\n\n  return ((n/10)<<4) | (n%10);\n}\n\nuint8_t\ncdio_from_bcd8(uint8_t p)\n{\n  return (0xf & p)+(10*(p >> 4));\n}\n\nconst char *cdio_version_string = CDIO_VERSION;\nconst unsigned int libcdio_version_num = LIBCDIO_VERSION_NUM;\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/iso9660/Makefile.am",
    "content": "noinst_LIBRARIES = libiso9660.a\nlibiso9660_a_SOURCES = iso9660.c iso9660_fs.c rock.c xa.c\n# Boy do you NOT want to have HAVE_CONFIG_H set before $(AM_CFLAGS) with Clang!\nlibiso9660_a_CFLAGS = $(AM_CFLAGS) -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../driver\n"
  },
  {
    "path": "src/libcdio/iso9660/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = src/libcdio/iso9660\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLIBRARIES = $(noinst_LIBRARIES)\nARFLAGS = cru\nAM_V_AR = $(am__v_AR_@AM_V@)\nam__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)\nam__v_AR_0 = @echo \"  AR      \" $@;\nam__v_AR_1 = \nlibiso9660_a_AR = $(AR) $(ARFLAGS)\nlibiso9660_a_LIBADD =\nam_libiso9660_a_OBJECTS = libiso9660_a-iso9660.$(OBJEXT) \\\n\tlibiso9660_a-iso9660_fs.$(OBJEXT) libiso9660_a-rock.$(OBJEXT) \\\n\tlibiso9660_a-xa.$(OBJEXT)\nlibiso9660_a_OBJECTS = $(am_libiso9660_a_OBJECTS)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp =\nam__depfiles_maybe =\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libiso9660_a_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LIBRARIES = libiso9660.a\nlibiso9660_a_SOURCES = iso9660.c iso9660_fs.c rock.c xa.c\n# Boy do you NOT want to have HAVE_CONFIG_H set before $(AM_CFLAGS) with Clang!\nlibiso9660_a_CFLAGS = $(AM_CFLAGS) -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../driver\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/libcdio/iso9660/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps src/libcdio/iso9660/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLIBRARIES:\n\t-test -z \"$(noinst_LIBRARIES)\" || rm -f $(noinst_LIBRARIES)\n\nlibiso9660.a: $(libiso9660_a_OBJECTS) $(libiso9660_a_DEPENDENCIES) $(EXTRA_libiso9660_a_DEPENDENCIES) \n\t$(AM_V_at)-rm -f libiso9660.a\n\t$(AM_V_AR)$(libiso9660_a_AR) libiso9660.a $(libiso9660_a_OBJECTS) $(libiso9660_a_LIBADD)\n\t$(AM_V_at)$(RANLIB) libiso9660.a\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n.c.o:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\nlibiso9660_a-iso9660.o: iso9660.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libiso9660_a_CFLAGS) $(CFLAGS) -c -o libiso9660_a-iso9660.o `test -f 'iso9660.c' || echo '$(srcdir)/'`iso9660.c\n\nlibiso9660_a-iso9660.obj: iso9660.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libiso9660_a_CFLAGS) $(CFLAGS) -c -o libiso9660_a-iso9660.obj `if test -f 'iso9660.c'; then $(CYGPATH_W) 'iso9660.c'; else $(CYGPATH_W) '$(srcdir)/iso9660.c'; fi`\n\nlibiso9660_a-iso9660_fs.o: iso9660_fs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libiso9660_a_CFLAGS) $(CFLAGS) -c -o libiso9660_a-iso9660_fs.o `test -f 'iso9660_fs.c' || echo '$(srcdir)/'`iso9660_fs.c\n\nlibiso9660_a-iso9660_fs.obj: iso9660_fs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libiso9660_a_CFLAGS) $(CFLAGS) -c -o libiso9660_a-iso9660_fs.obj `if test -f 'iso9660_fs.c'; then $(CYGPATH_W) 'iso9660_fs.c'; else $(CYGPATH_W) '$(srcdir)/iso9660_fs.c'; fi`\n\nlibiso9660_a-rock.o: rock.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libiso9660_a_CFLAGS) $(CFLAGS) -c -o libiso9660_a-rock.o `test -f 'rock.c' || echo '$(srcdir)/'`rock.c\n\nlibiso9660_a-rock.obj: rock.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libiso9660_a_CFLAGS) $(CFLAGS) -c -o libiso9660_a-rock.obj `if test -f 'rock.c'; then $(CYGPATH_W) 'rock.c'; else $(CYGPATH_W) '$(srcdir)/rock.c'; fi`\n\nlibiso9660_a-xa.o: xa.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libiso9660_a_CFLAGS) $(CFLAGS) -c -o libiso9660_a-xa.o `test -f 'xa.c' || echo '$(srcdir)/'`xa.c\n\nlibiso9660_a-xa.obj: xa.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libiso9660_a_CFLAGS) $(CFLAGS) -c -o libiso9660_a-xa.obj `if test -f 'xa.c'; then $(CYGPATH_W) 'xa.c'; else $(CYGPATH_W) '$(srcdir)/xa.c'; fi`\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LIBRARIES)\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \\\n\tdistclean-compile distclean-generic distclean-tags dvi dvi-am \\\n\thtml html-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "src/libcdio/iso9660/iso9660.c",
    "content": "/*\n  Copyright (C) 2003-2009, 2013-2014, 2016-2017 Rocky Bernstein\n  <rocky@gnu.org>\n  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n/*! String inside frame which identifies an ISO 9660 filesystem. This\n    string is the \"id\" field of an iso9660_pvd_t or an iso9660_svd_t.\n    Note should come *before* #include <cdio/iso9660.h> which does\n    a #define of this name.\n*/\nconst char ISO_STANDARD_ID[] = {'C', 'D', '0', '0', '1'};\n\n/* Private headers */\n#include \"iso9660_private.h\"\n#include \"cdio_assert.h\"\n\n/* Public headers */\n#include <cdio/bytesex.h>\n#include <cdio/iso9660.h>\n#include <cdio/util.h>\n\n#include <time.h>\n#include <ctype.h>\n#ifdef HAVE_STRING_H\n# include <string.h>\n#endif\n#ifdef HAVE_STDIO_H\n# include <stdio.h>\n#endif\n#ifdef HAVE_LIMITS_H\n# include <limits.h>\n#endif\n#ifdef HAVE_STDLIB_H\n# include <stdlib.h>\n#endif\n#ifdef HAVE_SYS_STAT_H\n# include <sys/stat.h>\n#endif\n\n#ifdef HAVE_ERRNO_H\n#include <errno.h>\n#endif\n\n#ifndef HAVE_SETENV\nstatic int\nsetenv(const char *envname, const char *envval, int overwrite)\n{\n  return -1;\n}\n#endif\n\n#ifndef HAVE_UNSETENV\nstatic int\nunsetenv(const char *envname)\n{\n  return -1;\n}\n#endif\n\n#ifndef HAVE_TIMEGM\nstatic time_t\ntimegm(struct tm *tm)\n{\n  time_t ret;\n  char *tz;\n\n  tz = getenv(\"TZ\");\n  setenv(\"TZ\", \"UTC\", 1);\n  tzset();\n  ret = mktime(tm);\n  if (tz)\n    setenv(\"TZ\", tz, 1);\n  else\n    unsetenv(\"TZ\");\n  tzset();\n  return ret;\n}\n#endif\n\n#ifndef HAVE_GMTIME_R\nstatic struct tm *\ngmtime_r(const time_t *timer, struct tm *result)\n{\n#ifdef WIN32\n    return (gmtime_s(result, timer) == 0) ? result : NULL;\n#else\n    struct tm *tmp = gmtime(timer);\n\n    if (tmp) {\n        *result = *tmp;\n        return result;\n    }\n    return tmp;\n#endif\n}\n#endif\n\n#ifndef HAVE_LOCALTIME_R\nstatic struct tm *\nlocaltime_r(const time_t *timer, struct tm *result)\n{\n#ifdef WIN32\n    return (localtime_s(result, timer) == 0) ? result : NULL;\n#else\n    struct tm *tmp = localtime(timer);\n\n    if (tmp) {\n        *result = *tmp;\n        return result;\n    }\n    return tmp;\n#endif\n}\n#endif\n\n/* Variables to hold debugger-helping enumerations */\nenum iso_enum1_s     iso_enums1;\nenum iso_flag_enum_s iso_flag_enums;\nenum iso_vd_enum_s   iso_vd_enums;\nenum iso_extension_enum_s iso_extension_enums;\n\n/* some parameters... */\n#define SYSTEM_ID         \"CD-RTOS CD-BRIDGE\"\n#define VOLUME_SET_ID     \"\"\n\n/*!\n   Change trailing blanks in str to nulls.  Str has a maximum size of\n   n characters.\n*/\nstatic char *\nstrip_trail (const char str[], size_t n)\n{\n  static char buf[1025];\n  int j;\n\n  cdio_assert (n < 1024);\n\n  strncpy (buf, str, n);\n  buf[n] = '\\0';\n\n  for (j = strlen (buf) - 1; j >= 0; j--)\n    {\n      if (buf[j] != ' ')\n        break;\n\n      buf[j] = '\\0';\n    }\n\n  return buf;\n}\n\nstatic void\npathtable_get_size_and_entries(const void *pt, unsigned int *size,\n                               unsigned int *entries);\n\n/*!\n  Get time structure from structure in an ISO 9660 directory index\n  record. Even though tm_wday and tm_yday fields are not explicitly in\n  idr_date, the are calculated from the other fields.\n\n  If tm is to reflect the localtime set b_localtime true, otherwise\n  tm will reported in GMT.\n*/\nbool\niso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime,\n                   /*out*/ struct tm *p_tm)\n{\n  if (!idr_date) return false;\n\n  /*\n     Section 9.1.5 of ECMA 119 says:\n     If all seven numbers are zero, it shall mean that the date and\n     time are not specified.\n\n     HACK: However we've seen it happen that everything except gmtoff\n     is zero and the expected date is the beginning of the epoch. So\n     we accept 6 numbers being zero. I'm also not sure if using the\n     beginning of the Epoch is also the right thing to do either.\n  */\n\n  if ( 0 == idr_date->dt_year   && 0 == idr_date->dt_month &&\n       0 == idr_date->dt_day    && 0 == idr_date->dt_hour  &&\n       0 == idr_date->dt_minute && 0 == idr_date->dt_second ) {\n    time_t t = 0;\n    struct tm temp_tm;\n    localtime_r(&t, &temp_tm);\n\n    memcpy(p_tm, &temp_tm, sizeof(struct tm));\n    return true;\n  }\n\n  memset(p_tm, 0, sizeof(struct tm));\n\n  p_tm->tm_year   = idr_date->dt_year;\n  p_tm->tm_mon    = idr_date->dt_month - 1;\n  p_tm->tm_mday   = idr_date->dt_day;\n  p_tm->tm_hour   = idr_date->dt_hour;\n  p_tm->tm_min    = idr_date->dt_minute;\n  p_tm->tm_sec    = idr_date->dt_second - idr_date->dt_gmtoff * (15 * 60);\n  p_tm->tm_isdst  = -1; /* information not available */\n\n#ifdef HAVE_STRUCT_TM_TM_ZONE\n  /* Initialize everything */\n  p_tm->tm_zone   = 0;\n#endif\n\n  /* Recompute tm_wday and tm_yday via mktime. mktime will also renormalize\n     date values to account for the timezone offset. */\n  {\n    time_t t = 0;\n    struct tm temp_tm;\n\n    t = timegm(p_tm);\n\n    if (b_localtime)\n      localtime_r(&t, &temp_tm);\n    else\n      gmtime_r(&t, &temp_tm);\n\n    memcpy(p_tm, &temp_tm, sizeof(struct tm));\n  }\n\n\n  return true;\n}\n\n/*\n   A note regarding the strange strtol() testing below as pointed out SMS.\n   From man strtol:\n\n     If an underflow occurs, strtol() returns LONG_MIN. If an overflow\n     occurs, strtol() returns LONG_MAX.  In both cases, errno is set to\n     ERANGE.\n\n   This implies that one should only look at errno if the value is\n   LONG_MIN or LONG_MAX.\n*/\n\n#define set_ltime_field(TM_FIELD, LT_FIELD, ADD_CONSTANT)               \\\n  {                                                                     \\\n    char num[10]; long tmp;                                             \\\n    memcpy(num, p_ldate->LT_FIELD, sizeof(p_ldate->LT_FIELD));          \\\n    num[sizeof(p_ldate->LT_FIELD)] = '\\0';                              \\\n    errno = 0;                                                          \\\n    tmp = strtol(num, (char **)NULL, 10);                               \\\n    if ( tmp == LONG_MIN || tmp == LONG_MAX ||                          \\\n         (uint64_t)tmp + ADD_CONSTANT >= (uint64_t)LONG_MAX ||          \\\n         (uint64_t)tmp + ADD_CONSTANT <= (uint64_t)LONG_MIN )           \\\n      return false;                                                     \\\n    p_tm->TM_FIELD = tmp + ADD_CONSTANT;                                \\\n  }\n\n/*!\n  Get \"long\" time in format used in ISO 9660 primary volume descriptor\n  from a Unix time structure.\n*/\nbool\niso9660_get_ltime (const iso9660_ltime_t *p_ldate,\n                   /*out*/ struct tm *p_tm)\n{\n  if (!p_tm) return false;\n  memset(p_tm, 0, sizeof(struct tm));\n  set_ltime_field(tm_year, lt_year,  -1900);\n  set_ltime_field(tm_mon,  lt_month, -1);\n  set_ltime_field(tm_mday, lt_day,    0);\n  set_ltime_field(tm_hour, lt_hour,   0);\n  set_ltime_field(tm_min,  lt_minute, 0);\n  set_ltime_field(tm_sec,  lt_second, 0);\n  p_tm->tm_isdst= -1; /* information not available */\n#ifndef HAVE_TM_GMTOFF\n  p_tm->tm_sec += p_ldate->lt_gmtoff * (15 * 60);\n#endif\n#ifdef HAVE_STRUCT_TM_TM_ZONE\n  /* Initialize everything */\n  p_tm->tm_zone = 0;\n#endif\n\n  /* Recompute tm_wday and tm_yday via mktime. mktime will also renormalize\n     date values to account for the timezone offset. */\n  {\n    time_t t;\n    struct tm temp_tm;\n\n    t = mktime(p_tm);\n\n    localtime_r(&t, &temp_tm);\n\n    memcpy(p_tm, &temp_tm, sizeof(struct tm));\n  }\n  p_tm->tm_isdst= -1; /* information not available */\n#ifdef HAVE_TM_GMTOFF\n  p_tm->tm_gmtoff = -p_ldate->lt_gmtoff * (15 * 60);\n#endif\n  return true;\n}\n\n/*!\n  Set time in format used in ISO 9660 directory index record\n  from a Unix time structure. timezone is given as an offset\n  correction in minutes.\n*/\nvoid\niso9660_set_dtime_with_timezone (const struct tm *p_tm,\n                                 int time_zone,\n                                 /*out*/ iso9660_dtime_t *p_idr_date)\n{\n  memset (p_idr_date, 0, 7);\n\n  if (!p_tm) return;\n\n  p_idr_date->dt_year   = p_tm->tm_year;\n  p_idr_date->dt_month  = p_tm->tm_mon + 1;\n  p_idr_date->dt_day    = p_tm->tm_mday;\n  p_idr_date->dt_hour   = p_tm->tm_hour;\n  p_idr_date->dt_minute = p_tm->tm_min;\n  p_idr_date->dt_second = p_tm->tm_sec;\n\n  /* The ISO 9660 timezone is in the range -48..+52 and each unit\n     represents a 15-minute interval. */\n  p_idr_date->dt_gmtoff = time_zone / 15;\n\n  if (p_idr_date->dt_gmtoff < -48 ) {\n\n    cdio_warn (\"Converted ISO 9660 timezone %d is less than -48. Adjusted\",\n               p_idr_date->dt_gmtoff);\n    p_idr_date->dt_gmtoff = -48;\n  } else if (p_idr_date->dt_gmtoff > 52) {\n    cdio_warn (\"Converted ISO 9660 timezone %d is over 52. Adjusted\",\n               p_idr_date->dt_gmtoff);\n    p_idr_date->dt_gmtoff = 52;\n  }\n}\n\n/*!\n  Set time in format used in ISO 9660 directory index record\n  from a Unix time structure. */\nvoid\niso9660_set_dtime(const struct tm *p_tm, /*out*/ iso9660_dtime_t *p_idr_date)\n{\n  int time_zone = 0;\n  if (p_tm) {\n#ifdef HAVE_TM_GMTOFF\n    /* Convert seconds to minutes */\n    time_zone = p_tm->tm_gmtoff / 60;\n#else\n    time_zone = (p_tm->tm_isdst > 0) ? -60 : 0;\n#endif\n  }\n  iso9660_set_dtime_with_timezone (p_tm, time_zone, p_idr_date);\n}\n\n/*!\n  Set \"long\" time in format used in ISO 9660 primary volume descriptor\n  from a Unix time structure. timezone is given as an offset\n  correction in minutes.\n*/\nvoid\niso9660_set_ltime_with_timezone(const struct tm *p_tm,\n                                int time_zone,\n                                /*out*/ iso9660_ltime_t *pvd_date)\n{\n  char *_pvd_date = (char *) pvd_date;\n\n  memset (_pvd_date, (int) '0', 16);\n  pvd_date->lt_gmtoff = (iso712_t) 0; /* Start out with time zone GMT. */\n\n  if (!p_tm) return;\n\n#if defined(__GNUC__) && !defined(__DARWIN_C_ANSI)\n#pragma GCC diagnostic ignored \"-Wformat-truncation\"\n#endif\n  snprintf(_pvd_date, 17,\n           \"%4.4d%2.2d%2.2d\" \"%2.2d%2.2d%2.2d\" \"%2.2d\",\n           p_tm->tm_year + 1900, p_tm->tm_mon + 1, p_tm->tm_mday,\n           p_tm->tm_hour, p_tm->tm_min, p_tm->tm_sec,\n           0 /* 1/100 secs */ );\n\n  /* Set time zone in 15-minute interval encoding. */\n  pvd_date->lt_gmtoff -= (time_zone / 15);\n  if (pvd_date->lt_gmtoff < -48 ) {\n\n    cdio_warn (\"Converted ISO 9660 timezone %d is less than -48. Adjusted\",\n               (int) pvd_date->lt_gmtoff);\n    pvd_date->lt_gmtoff = -48;\n  } else if (pvd_date->lt_gmtoff > 52) {\n    cdio_warn (\"Converted ISO 9660 timezone %d is over 52. Adjusted\",\n               (int) pvd_date->lt_gmtoff);\n    pvd_date->lt_gmtoff = 52;\n  }\n}\n\n/*!\n  Set \"long\" time in format used in ISO 9660 primary volume descriptor\n  from a Unix time structure. */\nvoid\niso9660_set_ltime(const struct tm *p_tm, /*out*/ iso9660_ltime_t *pvd_date)\n{\n  int time_zone = 0;\n  if (p_tm) {\n#ifdef HAVE_TM_GMTOFF\n    /* Set time zone in 15-minute interval encoding. */\n    time_zone = p_tm->tm_gmtoff / 60;\n#else\n    time_zone = (p_tm->tm_isdst > 0) ? -60 : 0;\n#endif\n  }\n  iso9660_set_ltime_with_timezone (p_tm, time_zone, pvd_date);\n}\n\n/*!\n   Convert an ISO-9660 file name which is in the format usually stored\n   in a ISO 9660 directory entry into what's usually listed as the\n   file name in a listing.  Lowercase name, and remove trailing ;1's\n   or .;1's and turn the other ;'s into version numbers.\n\n   @param psz_oldname the ISO-9660 filename to be translated.\n   @param psz_newname returned string. The caller allocates this and\n   it should be at least the size of psz_oldname.\n   @return length of the translated string is returned. It will be no greater\n   than the length of psz_oldname.\n*/\nint\niso9660_name_translate(const char *psz_oldname, char *psz_newname)\n{\n  return iso9660_name_translate_ext(psz_oldname, psz_newname, 0);\n}\n\n/*!\n   Convert an ISO-9660 file name which is in the format usually stored\n   in a ISO 9660 directory entry into what's usually listed as the\n   file name in a listing.  Lowercase name if no Joliet Extension\n   interpretation. Remove trailing ;1's or .;1's and turn the other\n   ;'s into version numbers.\n\n   @param psz_oldname the ISO-9660 filename to be translated.\n   @param psz_newname returned string. The caller allocates this and\n   it should be at least the size of psz_oldname.\n   @param u_joliet_level 0 if not using Joliet Extension. Otherwise the\n   Joliet level.\n   @return length of the translated string is returned. It will be no greater\n   than the length of psz_oldname.\n*/\nint\niso9660_name_translate_ext(const char *psz_oldname, char *psz_newname,\n                           uint8_t u_joliet_level)\n{\n  int len = strlen(psz_oldname);\n  int i;\n\n  if (0 == len) return 0;\n  for (i = 0; i < len; i++) {\n    unsigned char c = psz_oldname[i];\n    if (!c)\n      break;\n\n    /* Lower case, unless we have Joliet extensions.  */\n    if (!u_joliet_level && isupper(c)) c = tolower(c);\n\n    /* Drop trailing '.;1' (ISO 9660:1988 7.5.1 requires period) */\n    if (c == '.' && i == len - 3\n        && psz_oldname[i + 1] == ';' && psz_oldname[i + 2] == '1')\n      break;\n\n    /* Drop trailing ';1' */\n    if (c == ';' && i == len - 2 && psz_oldname[i + 1] == '1')\n      break;\n\n    /* Convert remaining ';' to '.' */\n    if (c == ';')\n      c = '.';\n\n    psz_newname[i] = c;\n  }\n  psz_newname[i] = '\\0';\n  return i;\n}\n\n/*!\n  Pad string src with spaces to size len and copy this to dst. If\n  len is less than the length of src, dst will be truncated to the\n  first len characters of src.\n\n  src can also be scanned to see if it contains only ACHARs, DCHARs,\n  7-bit ASCII chars depending on the enumeration _check.\n\n  In addition to getting changed, dst is the return value.\n  Note: this string might not be NULL terminated.\n */\nchar *\niso9660_strncpy_pad(char dst[], const char src[], size_t len,\n                    enum strncpy_pad_check _check)\n{\n  size_t rlen;\n\n  cdio_assert (dst != NULL);\n  cdio_assert (src != NULL);\n  cdio_assert (len > 0);\n\n  switch (_check)\n    {\n      int idx;\n    case ISO9660_NOCHECK:\n      break;\n\n    case ISO9660_7BIT:\n      for (idx = 0; src[idx]; idx++)\n        if ((int8_t) src[idx] < 0)\n          {\n            cdio_warn (\"string '%s' fails 7bit constraint (pos = %d)\",\n                      src, idx);\n            break;\n          }\n      break;\n\n    case ISO9660_ACHARS:\n      for (idx = 0; src[idx]; idx++)\n        if (!iso9660_is_achar (src[idx]))\n          {\n            cdio_warn (\"string '%s' fails a-character constraint (pos = %d)\",\n                      src, idx);\n            break;\n          }\n      break;\n\n    case ISO9660_DCHARS:\n      for (idx = 0; src[idx]; idx++)\n        if (!iso9660_is_dchar (src[idx]))\n          {\n            cdio_warn (\"string '%s' fails d-character constraint (pos = %d)\",\n                      src, idx);\n            break;\n          }\n      break;\n\n    default:\n      cdio_assert_not_reached ();\n      break;\n    }\n\n  rlen = strlen (src);\n\n  if (rlen > len)\n    cdio_warn (\"string '%s' is getting truncated to %d characters\",\n              src, (unsigned int) len);\n\n  strncpy (dst, src, len);\n  if (rlen < len)\n    memset(dst+rlen, ' ', len-rlen);\n  return dst;\n}\n\n/*!\n   Return true if c is a DCHAR - a valid ISO-9660 level 1 character.\n   These are the ASCSII capital letters A-Z, the digits 0-9 and an\n   underscore.\n*/\nbool\niso9660_is_dchar (int c)\n{\n  if (!IN (c, 0x30, 0x5f)\n      || IN (c, 0x3a, 0x40)\n      || IN (c, 0x5b, 0x5e))\n    return false;\n\n  return true;\n}\n\n\n/*!\n   Return true if c is an ACHAR -\n   These are the DCHAR's plus some ASCII symbols including the space\n   symbol.\n*/\nbool\niso9660_is_achar (int c)\n{\n  if (!IN (c, 0x20, 0x5f)\n      || IN (c, 0x23, 0x24)\n      || c == 0x40\n      || IN (c, 0x5b, 0x5e))\n    return false;\n\n  return true;\n}\n\nvoid\niso9660_set_evd(void *pd)\n{\n  iso_volume_descriptor_t ied;\n\n  cdio_assert (sizeof(iso_volume_descriptor_t) == ISO_BLOCKSIZE);\n\n  cdio_assert (pd != NULL);\n\n  memset(&ied, 0, sizeof(ied));\n\n  ied.type = to_711(ISO_VD_END);\n  iso9660_strncpy_pad (ied.id, ISO_STANDARD_ID, sizeof(ied.id),\n                       ISO9660_DCHARS);\n  ied.version = to_711(ISO_VERSION);\n\n  memcpy(pd, &ied, sizeof(ied));\n}\n\nvoid\niso9660_set_pvd(void *pd,\n                const char volume_id[],\n                const char publisher_id[],\n                const char preparer_id[],\n                const char application_id[],\n                uint32_t iso_size,\n                const void *root_dir,\n                uint32_t path_table_l_extent,\n                uint32_t path_table_m_extent,\n                uint32_t path_table_size,\n                const time_t *pvd_time\n                )\n{\n  iso9660_pvd_t ipd;\n  struct tm temp_tm;\n\n  cdio_assert (sizeof(iso9660_pvd_t) == ISO_BLOCKSIZE);\n\n  cdio_assert (pd != NULL);\n  cdio_assert (volume_id != NULL);\n  cdio_assert (application_id != NULL);\n\n  memset(&ipd,0,sizeof(ipd)); /* paranoia? */\n\n  /* magic stuff ... thatis CD XA marker... */\n  strncpy(((char*)&ipd)+ISO_XA_MARKER_OFFSET, ISO_XA_MARKER_STRING,\n          strlen(ISO_XA_MARKER_STRING)+1);\n\n  ipd.type = to_711(ISO_VD_PRIMARY);\n  iso9660_strncpy_pad (ipd.id, ISO_STANDARD_ID, 5, ISO9660_DCHARS);\n  ipd.version = to_711(ISO_VERSION);\n\n  iso9660_strncpy_pad (ipd.system_id, SYSTEM_ID, 32, ISO9660_ACHARS);\n  iso9660_strncpy_pad (ipd.volume_id, volume_id, 32, ISO9660_DCHARS);\n\n  ipd.volume_space_size = to_733(iso_size);\n\n  ipd.volume_set_size = to_723(1);\n  ipd.volume_sequence_number = to_723(1);\n  ipd.logical_block_size = to_723(ISO_BLOCKSIZE);\n\n  ipd.path_table_size = to_733(path_table_size);\n  ipd.type_l_path_table = to_731(path_table_l_extent);\n  ipd.type_m_path_table = to_732(path_table_m_extent);\n\n  /* root_directory_record doesn't contain the 1-byte filename,\n     so we add one for that. */\n  cdio_assert (sizeof(ipd.root_directory_record) == 33);\n  memcpy(&(ipd.root_directory_record), root_dir,\n         sizeof(ipd.root_directory_record));\n  ipd.root_directory_filename='\\0';\n  ipd.root_directory_record.length = sizeof(ipd.root_directory_record)+1;\n  iso9660_strncpy_pad (ipd.volume_set_id, VOLUME_SET_ID,\n                       ISO_MAX_VOLUMESET_ID, ISO9660_DCHARS);\n\n  iso9660_strncpy_pad (ipd.publisher_id, publisher_id, ISO_MAX_PUBLISHER_ID,\n                       ISO9660_ACHARS);\n  iso9660_strncpy_pad (ipd.preparer_id, preparer_id, ISO_MAX_PREPARER_ID,\n                       ISO9660_ACHARS);\n  iso9660_strncpy_pad (ipd.application_id, application_id,\n                       ISO_MAX_APPLICATION_ID, ISO9660_ACHARS);\n\n  iso9660_strncpy_pad (ipd.copyright_file_id    , \"\", 37, ISO9660_DCHARS);\n  iso9660_strncpy_pad (ipd.abstract_file_id     , \"\", 37, ISO9660_DCHARS);\n  iso9660_strncpy_pad (ipd.bibliographic_file_id, \"\", 37, ISO9660_DCHARS);\n\n  gmtime_r(pvd_time, &temp_tm);\n  iso9660_set_ltime (&temp_tm, &(ipd.creation_date));\n  gmtime_r(pvd_time, &temp_tm);\n  iso9660_set_ltime (&temp_tm, &(ipd.modification_date));\n  iso9660_set_ltime (NULL,     &(ipd.expiration_date));\n  iso9660_set_ltime (NULL,     &(ipd.effective_date));\n\n  ipd.file_structure_version = to_711(1);\n\n  /* we leave ipd.application_data = 0 */\n\n  memcpy(pd, &ipd, sizeof(ipd)); /* copy stuff to arg ptr */\n}\n\nunsigned int\niso9660_dir_calc_record_size(unsigned int namelen, unsigned int su_len)\n{\n  unsigned int length;\n\n  length = sizeof(iso9660_dir_t);\n  length += namelen;\n  if (length % 2) /* pad to word boundary */\n    length++;\n  length += su_len;\n  if (length % 2) /* pad to word boundary again */\n    length++;\n\n  return length;\n}\n\nvoid\niso9660_dir_add_entry_su(void *dir,\n                         const char filename[],\n                         uint32_t extent,\n                         uint32_t size,\n                         uint8_t file_flags,\n                         const void *su_data,\n                         unsigned int su_size,\n                         const time_t *entry_time)\n{\n  iso9660_dir_t *idr = dir;\n  uint8_t *dir8 = dir;\n  unsigned int offset = 0;\n  uint32_t dsize = from_733(idr->size);\n  int length, su_offset;\n  struct tm temp_tm = { 0 };\n  cdio_assert (sizeof(iso9660_dir_t) == 33);\n\n  if (!dsize && !idr->length)\n    dsize = ISO_BLOCKSIZE; /* for when dir lacks '.' entry */\n\n  cdio_assert (dsize > 0 && !(dsize % ISO_BLOCKSIZE));\n  cdio_assert (dir != NULL);\n  cdio_assert (extent > 17);\n  cdio_assert (filename != NULL);\n  cdio_assert (strlen(filename) <= MAX_ISOPATHNAME);\n\n  length = sizeof(iso9660_dir_t);\n  length += strlen(filename);\n  length = _cdio_ceil2block (length, 2); /* pad to word boundary */\n  su_offset = length;\n  length += su_size;\n  length = _cdio_ceil2block (length, 2); /* pad to word boundary again */\n\n  /* find the last entry's end */\n  {\n    unsigned int ofs_last_rec = 0;\n\n    offset = 0;\n    // coverity[tainted_data]\n    while (offset < dsize)\n      {\n        if (!dir8[offset])\n          {\n            offset++;\n            continue;\n          }\n\n        offset += dir8[offset];\n        ofs_last_rec = offset;\n      }\n\n    cdio_assert (offset == dsize);\n\n    offset = ofs_last_rec;\n  }\n\n  /* be sure we don't cross sectors boundaries */\n  offset = _cdio_ofs_add (offset, length, ISO_BLOCKSIZE);\n  offset -= length;\n\n  cdio_assert (offset + length <= dsize);\n\n  idr = (iso9660_dir_t *) &dir8[offset];\n\n  cdio_assert (offset+length < dsize);\n\n  memset(idr, 0, length);\n\n  idr->length = to_711(length);\n  idr->extent = to_733(extent);\n  idr->size = to_733(size);\n\n  gmtime_r(entry_time, &temp_tm);\n  iso9660_set_dtime (&temp_tm, &(idr->recording_time));\n\n  idr->file_flags = to_711(file_flags);\n\n  idr->volume_sequence_number = to_723(1);\n\n  idr->filename.len = to_711(strlen(filename)\n                             ? strlen(filename) : 1); /* working hack! */\n\n  memcpy(&idr->filename.str[1], filename, from_711(idr->filename.len));\n  if (su_size > 0 && su_data)\n    memcpy(&dir8[offset] + su_offset, su_data, su_size);\n}\n\nvoid\niso9660_dir_init_new (void *dir,\n                      uint32_t self,\n                      uint32_t ssize,\n                      uint32_t parent,\n                      uint32_t psize,\n                      const time_t *dir_time)\n{\n  iso9660_dir_init_new_su (dir, self, ssize, NULL, 0, parent, psize, NULL,\n                           0, dir_time);\n}\n\nvoid\niso9660_dir_init_new_su (void *dir,\n                         uint32_t self,\n                         uint32_t ssize,\n                         const void *ssu_data,\n                         unsigned int ssu_size,\n                         uint32_t parent,\n                         uint32_t psize,\n                         const void *psu_data,\n                         unsigned int psu_size,\n                         const time_t *dir_time)\n{\n  cdio_assert (ssize > 0 && !(ssize % ISO_BLOCKSIZE));\n  cdio_assert (psize > 0 && !(psize % ISO_BLOCKSIZE));\n  cdio_assert (dir != NULL);\n\n  memset (dir, 0, ssize);\n\n  /* \"\\0\" -- working hack due to padding  */\n  iso9660_dir_add_entry_su (dir, \"\\0\", self, ssize, ISO_DIRECTORY, ssu_data,\n                            ssu_size, dir_time);\n\n  iso9660_dir_add_entry_su (dir, \"\\1\", parent, psize, ISO_DIRECTORY, psu_data,\n                            psu_size, dir_time);\n}\n\n/* Zero's out pathable. Do this first.  */\nvoid\niso9660_pathtable_init (void *pt)\n{\n  cdio_assert (sizeof (iso_path_table_t) == 8);\n\n  cdio_assert (pt != NULL);\n\n  memset (pt, 0, ISO_BLOCKSIZE); /* fixme */\n}\n\n/*!\n  Returns POSIX mode bitstring for a given file.\n*/\nmode_t\niso9660_get_posix_filemode(const iso9660_stat_t *p_iso_dirent)\n{\n  mode_t mode = 0;\n\n#ifdef HAVE_ROCK\n  if (yep == p_iso_dirent->rr.b3_rock) {\n      return iso9660_get_posix_filemode_from_rock(&p_iso_dirent->rr);\n  } else\n#endif\n  if (p_iso_dirent->b_xa) {\n    return iso9660_get_posix_filemode_from_xa(p_iso_dirent->xa.attributes);\n  }\n  return mode;\n}\n\nstatic const iso_path_table_t *\npathtable_get_entry (const void *pt, unsigned int entrynum)\n{\n  const uint8_t *tmp = pt;\n  unsigned int offset = 0;\n  unsigned int count = 0;\n\n  cdio_assert (pt != NULL);\n\n  while (from_711 (*tmp))\n    {\n      if (count == entrynum)\n        break;\n\n      cdio_assert (count < entrynum);\n\n      offset += sizeof (iso_path_table_t);\n      offset += from_711 (*tmp);\n      if (offset % 2)\n        offset++;\n      tmp = (uint8_t *)pt + offset;\n      count++;\n    }\n\n  if (!from_711 (*tmp))\n    return NULL;\n\n  return (const void *) tmp;\n}\n\nvoid\npathtable_get_size_and_entries (const void *pt,\n                                unsigned int *size,\n                                unsigned int *entries)\n{\n  const uint8_t *tmp = pt;\n  unsigned int offset = 0;\n  unsigned int count = 0;\n\n  cdio_assert (pt != NULL);\n\n  while (from_711 (*tmp))\n    {\n      offset += sizeof (iso_path_table_t);\n      offset += from_711 (*tmp);\n      if (offset % 2)\n        offset++;\n      tmp = (uint8_t *)pt + offset;\n      count++;\n    }\n\n  if (size)\n    *size = offset;\n\n  if (entries)\n    *entries = count;\n}\n\nunsigned int\niso9660_pathtable_get_size (const void *pt)\n{\n  unsigned int size = 0;\n  pathtable_get_size_and_entries (pt, &size, NULL);\n  return size;\n}\n\nuint16_t\niso9660_pathtable_l_add_entry (void *pt,\n                               const char name[],\n                               uint32_t extent,\n                               uint16_t parent)\n{\n  iso_path_table_t *ipt =\n    (iso_path_table_t *)((char *)pt + iso9660_pathtable_get_size (pt));\n  size_t name_len = strlen (name) ? strlen (name) : 1;\n  unsigned int entrynum = 0;\n\n  cdio_assert (iso9660_pathtable_get_size (pt) < ISO_BLOCKSIZE); /*fixme */\n\n  memset (ipt, 0, sizeof (iso_path_table_t) + name_len); /* paranoia */\n\n  ipt->name_len = to_711 (name_len);\n  ipt->extent = to_731 (extent);\n  ipt->parent = to_721 (parent);\n  memcpy (ipt->name, name, name_len);\n\n  pathtable_get_size_and_entries (pt, NULL, &entrynum);\n\n  if (entrynum > 1)\n    {\n      const iso_path_table_t *ipt2\n        = pathtable_get_entry (pt, entrynum - 2);\n\n      cdio_assert (ipt2 != NULL);\n\n      cdio_assert (from_721 (ipt2->parent) <= parent);\n    }\n\n  return entrynum;\n}\n\nuint16_t\niso9660_pathtable_m_add_entry (void *pt,\n                               const char name[],\n                               uint32_t extent,\n                               uint16_t parent)\n{\n  iso_path_table_t *ipt =\n    (iso_path_table_t *)((char *)pt + iso9660_pathtable_get_size (pt));\n  size_t name_len = strlen (name) ? strlen (name) : 1;\n  unsigned int entrynum = 0;\n\n  cdio_assert (iso9660_pathtable_get_size(pt) < ISO_BLOCKSIZE); /* fixme */\n\n  memset(ipt, 0, sizeof (iso_path_table_t) + name_len); /* paranoia */\n\n  ipt->name_len = to_711 (name_len);\n  ipt->extent = to_732 (extent);\n  ipt->parent = to_722 (parent);\n  memcpy (ipt->name, name, name_len);\n\n  pathtable_get_size_and_entries (pt, NULL, &entrynum);\n\n  if (entrynum > 1)\n    {\n      const iso_path_table_t *ipt2\n        = pathtable_get_entry (pt, entrynum - 2);\n\n      cdio_assert (ipt2 != NULL);\n\n      cdio_assert (from_722 (ipt2->parent) <= parent);\n    }\n\n  return entrynum;\n}\n\n/*!\n  Check that pathname is a valid ISO-9660 directory name.\n\n  A valid directory name should not start out with a slash (/),\n  dot (.) or null byte, should be less than 37 characters long,\n  have no more than 8 characters in a directory component\n  which is separated by a /, and consist of only DCHARs.\n */\nbool\niso9660_dirname_valid_p (const char pathname[])\n{\n  const char *p = pathname;\n  int len;\n\n  cdio_assert (pathname != NULL);\n\n  if (*p == '/' || *p == '.' || *p == '\\0')\n    return false;\n\n  if (strlen (pathname) > MAX_ISOPATHNAME)\n    return false;\n\n  len = 0;\n  for (; *p; p++)\n    if (iso9660_is_dchar (*p))\n      {\n        len++;\n        if (len > 8)\n          return false;\n      }\n    else if (*p == '/')\n      {\n        if (!len)\n          return false;\n        len = 0;\n      }\n    else\n      return false; /* unexpected char */\n\n  if (!len)\n    return false; /* last char may not be '/' */\n\n  return true;\n}\n\n/*!\n  Check that pathname is a valid ISO-9660 pathname.\n\n  A valid pathname contains a valid directory name, if one appears and\n  the filename portion should be no more than 8 characters for the\n  file prefix and 3 characters in the extension (or portion after a\n  dot). There should be exactly one dot somewhere in the filename\n  portion and the filename should be composed of only DCHARs.\n\n  True is returned if pathname is valid.\n */\nbool\niso9660_pathname_valid_p (const char pathname[])\n{\n  const char *p = NULL;\n\n  cdio_assert (pathname != NULL);\n\n  if ((p = strrchr (pathname, '/')))\n    {\n      bool rc;\n      char *_tmp = strdup (pathname);\n\n      *strrchr (_tmp, '/') = '\\0';\n\n      rc = iso9660_dirname_valid_p (_tmp);\n\n      free (_tmp);\n\n      if (!rc)\n        return false;\n\n      p++;\n    }\n  else\n    p = pathname;\n\n  if (strlen (pathname) > (MAX_ISOPATHNAME - 6))\n    return false;\n\n  {\n    int len = 0;\n    int dots = 0;\n\n    for (; *p; p++)\n      if (iso9660_is_dchar (*p))\n        {\n          len++;\n          if (dots == 0 ? len > 8 : len > 3)\n            return false;\n        }\n      else if (*p == '.')\n        {\n          dots++;\n          if (dots > 1)\n            return false;\n          if (!len)\n            return false;\n          len = 0;\n        }\n      else\n        return false;\n\n    if (dots != 1)\n      return false;\n  }\n\n  return true;\n}\n\n/*!\n  Take pathname and a version number and turn that into a ISO-9660\n  pathname.  (That's just the pathname followd by \";\" and the version\n  number. For example, mydir/file.ext -> mydir/file.ext;1 for version\n  1. The resulting ISO-9660 pathname is returned.\n*/\nchar *\niso9660_pathname_isofy (const char pathname[], uint16_t version)\n{\n  char tmpbuf[1024] = { 0, };\n\n  cdio_assert (strlen (pathname) < (sizeof (tmpbuf) - sizeof (\";65535\")));\n\n  snprintf (tmpbuf, sizeof(tmpbuf), \"%s;%d\", pathname, version);\n\n  return strdup (tmpbuf);\n}\n\n/*!\n  Return the PVD's application ID.\n  NULL is returned if there is some problem in getting this.\n*/\nchar *\niso9660_get_application_id(iso9660_pvd_t *p_pvd)\n{\n  if (NULL==p_pvd) return NULL;\n  return strdup(strip_trail(p_pvd->application_id, ISO_MAX_APPLICATION_ID));\n}\n\n#ifdef FIXME\nlsn_t\niso9660_get_dir_extent(const iso9660_dir_t *idr)\n{\n  if (NULL == idr) return 0;\n  return from_733(idr->extent);\n}\n#endif\n\nuint8_t\niso9660_get_dir_len(const iso9660_dir_t *idr)\n{\n  if (NULL == idr) return 0;\n  return idr->length;\n}\n\n#ifdef FIXME\nuint8_t\niso9660_get_dir_size(const iso9660_dir_t *idr)\n{\n  if (NULL == idr) return 0;\n  return from_733(idr->size);\n}\n#endif\n\nuint8_t\niso9660_get_pvd_type(const iso9660_pvd_t *pvd)\n{\n  if (NULL == pvd) return 255;\n  return(pvd->type);\n}\n\nconst char *\niso9660_get_pvd_id(const iso9660_pvd_t *pvd)\n{\n  if (NULL == pvd) return \"ERR\";\n  return(pvd->id);\n}\n\nint\niso9660_get_pvd_space_size(const iso9660_pvd_t *pvd)\n{\n  if (NULL == pvd) return 0;\n  return from_733(pvd->volume_space_size);\n}\n\nint\niso9660_get_pvd_block_size(const iso9660_pvd_t *pvd)\n{\n  if (NULL == pvd) return 0;\n  return from_723(pvd->logical_block_size);\n}\n\n/*! Return the primary volume id version number (of pvd).\n    If there is an error 0 is returned.\n */\nint\niso9660_get_pvd_version(const iso9660_pvd_t *pvd)\n{\n  if (NULL == pvd) return 0;\n  return pvd->version;\n}\n\n/*! Return the LSN of the root directory for pvd.\n    If there is an error CDIO_INVALID_LSN is returned.\n */\nlsn_t\niso9660_get_root_lsn(const iso9660_pvd_t *pvd)\n{\n  if (NULL == pvd)\n    return CDIO_INVALID_LSN;\n  else {\n    const iso9660_dir_t *idr = &(pvd->root_directory_record);\n    if (NULL == idr) return CDIO_INVALID_LSN;\n    return(from_733 (idr->extent));\n  }\n}\n\n/*!\n   Return a string containing the preparer id with trailing\n   blanks removed.\n*/\nchar *\niso9660_get_preparer_id(const iso9660_pvd_t *pvd)\n{\n  if (NULL==pvd) return NULL;\n  return strdup(strip_trail(pvd->preparer_id, ISO_MAX_PREPARER_ID));\n}\n\n/*!\n   Return a string containing the publisher id with trailing\n   blanks removed.\n*/\nchar *\niso9660_get_publisher_id(const iso9660_pvd_t *pvd)\n{\n  if (NULL==pvd) return NULL;\n  return strdup(strip_trail(pvd->publisher_id, ISO_MAX_PUBLISHER_ID));\n}\n\n/*!\n   Return a string containing the PVD's system id with trailing\n   blanks removed.\n*/\nchar *\niso9660_get_system_id(const iso9660_pvd_t *pvd)\n{\n  if (NULL==pvd) return NULL;\n  return strdup(strip_trail(pvd->system_id, ISO_MAX_SYSTEM_ID));\n}\n\n/*!\n  Return the PVD's volume ID.\n*/\nchar *\niso9660_get_volume_id(const iso9660_pvd_t *pvd)\n{\n  if (NULL == pvd) return NULL;\n  return strdup(strip_trail(pvd->volume_id, ISO_MAX_VOLUME_ID));\n}\n\n/*!\n  Return the PVD's volumeset ID.\n  NULL is returned if there is some problem in getting this.\n*/\nchar *\niso9660_get_volumeset_id(const iso9660_pvd_t *pvd)\n{\n  if ( NULL == pvd ) return NULL;\n  return strdup(strip_trail(pvd->volume_set_id, ISO_MAX_VOLUMESET_ID));\n}\n\n\f\n/*\n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/iso9660/iso9660_fs.c",
    "content": "/*\n  Copyright (C) 2003-2008, 2011-2015, 2017, 2024\n  Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2018, 2020, 2024 Pete Batard <pete@akeo.ie>\n  Copyright (C) 2018 Thomas Schmitt <scdbackup@gmx.net>\n  Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/* iso9660 filesystem-based routines */\n\n/* FIXME: _cdio_list_free for iso9660 statbuf is insufficient because it doesn't\n   free bits that are allocated inside the data. */\n\n\f\n#if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__)\n#include \"config.h\"\n#define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef HAVE_STDBOOL_H\n# include <stdbool.h>\n#endif\n\n#ifdef HAVE_STDIO_H\n#include <stdio.h>\n#endif\n\n#ifdef HAVE_STRING_H\n#include <string.h>\n#endif\n\n#ifdef HAVE_ERRNO_H\n#include <errno.h>\n#endif\n\n#ifdef HAVE_LANGINFO_CODESET\n#include <langinfo.h>\n#endif\n\n#include <cdio/cdio.h>\n#include <cdio/bytesex.h>\n#include <cdio/iso9660.h>\n#include <cdio/util.h>\n#include <cdio/utf8.h>\n\n/* Private headers */\n#include \"cdio_assert.h\"\n#include \"_cdio_stdio.h\"\n#include \"cdio_private.h\"\n\n/* Maximum number of El-Torito boot images we keep an index for */\n#define MAX_BOOT_IMAGES     8\n\n/** Implementation of iso9660_t type */\nstruct _iso9660_s {\n  cdio_header_t header;     /**< Internal header - MUST come first. */\n  CdioDataSource_t *stream; /**< Stream pointer */\n  bool_3way_t b_xa;         /**< true if has XA attributes. */\n  bool_3way_t b_mode2;      /**< true if has mode 2, false for mode 1. */\n  uint8_t  u_joliet_level;  /**< 0 = no Joliet extensions.\n\t\t\t         1-3: Joliet level. */\n  iso9660_pvd_t pvd;\n  iso9660_svd_t svd;\n  iso_extension_mask_t iso_extension_mask; /**< What extensions we\n\t\t\t\t\t        tolerate. */\n  uint32_t i_datastart;     /**< Usually 0 when i_framesize is ISO_BLOCKSIZE.\n\t\t\t         This is the normal condition. But in a fuzzy\n\t\t\t         read we may be reading a CD-image\n\t\t\t         and not a true ISO 9660 image this might be\n\t\t\t         CDIO_CD_SYNC_SIZE\n                            */\n  uint32_t i_framesize;     /**< Usually ISO_BLOCKSIZE (2048), but in a\n\t\t\t        fuzzy read, we may be reading a CD-image\n\t\t\t        and not a true ISO 9660 image this might\n\t\t\t        be CDIO_CD_FRAMESIZE_RAW (2352) or\n\t\t\t        M2RAW_SECTOR_SIZE (2336).\n                            */\n  struct {\n    uint32_t lsn;\t    /**< Start LSN of an El-Torito bootable image */\n    uint32_t num_sectors;   /**< Number of virtual sectors occupied by the\n\t\t\t        bootable image */\n  } boot_img[MAX_BOOT_IMAGES];\n  int i_fuzzy_offset;       /**< Adjustment in bytes to make ISO_STANDARD_ID\n\t\t\t         (\"CD001\") come out as ISO_PVD_SECTOR\n\t\t\t         (frame 16).  Normally this should be 0\n\t\t\t         for an ISO 9660 image, but if one is\n\t\t\t         say reading a BIN/CUE or cdrdao BIN/TOC\n\t\t\t         without having the CUE or TOC and\n\t\t\t         trying to extract an ISO-9660\n\t\t\t         filesystem inside that it may be\n\t\t\t         different.\n\t\t\t     */\n  bool b_have_superblock;   /**< Superblock has been read in? */\n};\n\nstatic long int iso9660_seek_read_framesize (const iso9660_t *p_iso,\n\t\t\t\t\t     void *ptr, lsn_t start,\n\t\t\t\t\t     long int size,\n\t\t\t\t\t     uint16_t i_framesize);\n\n/* Adjust the p_iso's i_datastart, i_byte_offset and i_framesize\n   based on whether we find a frame header or not.\n*/\nstatic void\nadjust_fuzzy_pvd( iso9660_t *p_iso )\n{\n  long int i_byte_offset;\n\n  if (!p_iso) return;\n\n  i_byte_offset = (ISO_PVD_SECTOR * p_iso->i_framesize)\n    + p_iso->i_fuzzy_offset + p_iso->i_datastart;\n\n  /* If we have a raw 2352-byte frame then we should expect to see a sync\n     frame and a header.\n   */\n  if (CDIO_CD_FRAMESIZE_RAW == p_iso->i_framesize) {\n    char buf[CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE];\n\n    i_byte_offset -= CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE + CDIO_CD_SUBHEADER_SIZE;\n\n    if ( DRIVER_OP_SUCCESS != cdio_stream_seek (p_iso->stream, i_byte_offset,\n\t\t\t\t\t\tSEEK_SET) )\n      return;\n    if (sizeof(buf) == cdio_stream_read (p_iso->stream, buf, sizeof(buf), 1)) {\n      /* Does the sector frame header suggest Mode 1 format? */\n      if (!memcmp(CDIO_SECTOR_SYNC_HEADER, buf+CDIO_CD_SUBHEADER_SIZE,\n\t\t  CDIO_CD_SYNC_SIZE)) {\n\tif (buf[14+CDIO_CD_SUBHEADER_SIZE] != 0x16) {\n\t  cdio_warn (\"Expecting the PVD sector header MSF to be 0x16, is: %x\",\n\t\t     buf[14]);\n\t}\n\tif (buf[15+CDIO_CD_SUBHEADER_SIZE] != 0x1) {\n\t  cdio_warn (\"Expecting the PVD sector mode to be Mode 1 is: %x\",\n\t\t     buf[15]);\n\t}\n\tp_iso->b_mode2 = nope;\n\tp_iso->b_xa = nope;\n      } else if (!memcmp(CDIO_SECTOR_SYNC_HEADER, buf, CDIO_CD_SYNC_SIZE)) {\n\t/* Frame header indicates Mode 2 Form 1*/\n\tif (buf[14] != 0x16) {\n\t  cdio_warn (\"Expecting the PVD sector header MSF to be 0x16, is: %x\",\n\t\t     buf[14]);\n\t}\n\tif (buf[15] != 0x2) {\n\t  cdio_warn (\"Expecting the PVD sector mode to be Mode 2 is: %x\",\n\t\t     buf[15]);\n\t}\n\tp_iso->b_mode2 = yep;\n\t/* Do do: check Mode 2 Form 2? */\n      } else {\n\t  /* Has no frame header */\n\t  p_iso->i_framesize = M2RAW_SECTOR_SIZE;\n\t  p_iso->i_fuzzy_offset = (CDIO_CD_FRAMESIZE_RAW - M2RAW_SECTOR_SIZE)\n\t    * ISO_PVD_SECTOR + p_iso->i_fuzzy_offset + p_iso->i_datastart;\n\t  p_iso->i_datastart = 0;\n\t}\n    }\n  }\n\n\n}\n\n/*!\n  Open an ISO 9660 image for reading in either fuzzy mode or not.\n*/\nstatic iso9660_t *\niso9660_open_ext_private (const char *psz_path,\n\t\t\t  iso_extension_mask_t iso_extension_mask,\n\t\t\t  uint16_t i_fuzz, bool b_fuzzy)\n{\n  iso9660_t *p_iso = (iso9660_t *) calloc(1, sizeof(iso9660_t)) ;\n\n  if (!p_iso)\n     return NULL;\n\n  p_iso->header.u_type = CDIO_HEADER_TYPE_ISO;\n  p_iso->stream = cdio_stdio_new( psz_path );\n  if (NULL == p_iso->stream)\n    goto error;\n\n  p_iso->i_framesize = ISO_BLOCKSIZE;\n\n  p_iso->b_have_superblock = (b_fuzzy)\n    ? iso9660_ifs_fuzzy_read_superblock(p_iso, iso_extension_mask, i_fuzz)\n    : iso9660_ifs_read_superblock(p_iso, iso_extension_mask) ;\n\n  if ( ! p_iso->b_have_superblock ) goto error;\n\n  /* Determine if image has XA attributes. */\n\n  p_iso->b_xa = strncmp ((char *) &(p_iso->pvd) + ISO_XA_MARKER_OFFSET,\n\t\t\t ISO_XA_MARKER_STRING,\n\t\t\t sizeof (ISO_XA_MARKER_STRING))\n    ? nope : yep;\n\n  p_iso->iso_extension_mask = iso_extension_mask;\n  return p_iso;\n\n error:\n  if (p_iso && p_iso->stream) cdio_stdio_destroy(p_iso->stream);\n  free(p_iso);\n\n  return NULL;\n}\n\n/*!\n  Open an ISO 9660 image for reading. Maybe in the future we will have\n  a mode. NULL is returned on error.\n\n  @param psz_path full path of ISO9660 file.\n\n  @return a IS9660 structure  is unconditionally returned. The caller\n  should call iso9660_close() when done.\n*/\niso9660_t *\niso9660_open (const char *psz_path /*, mode*/)\n{\n  return iso9660_open_ext(psz_path, ISO_EXTENSION_NONE);\n}\n\n/*!\n  Open an ISO 9660 image for reading allowing various ISO 9660\n  extensions.  Maybe in the future we will have a mode. NULL is\n  returned on error.\n\n  @see iso9660_open_fuzzy\n*/\niso9660_t *\niso9660_open_ext (const char *psz_path,\n\t\t  iso_extension_mask_t iso_extension_mask)\n{\n  return iso9660_open_ext_private(psz_path, iso_extension_mask, 0, false);\n}\n\n\n/*! Open an ISO 9660 image for \"fuzzy\" reading. This means that we\n  will try to guess various internal offset based on internal\n  checks. This may be useful when trying to read an ISO 9660 image\n  contained in a file format that libiso9660 doesn't know natively\n  (or knows imperfectly.)\n\n  Some tolerance allowed for positioning the ISO 9660 image. We scan\n  for STANDARD_ID and use that to set the eventual offset to adjust\n  by (as long as that is <= i_fuzz).\n\n  Maybe in the future we will have a mode. NULL is returned on error.\n\n  @see iso9660_open, @see iso9660_fuzzy_ext\n*/\niso9660_t *\niso9660_open_fuzzy (const char *psz_path, uint16_t i_fuzz /*, mode*/)\n{\n  return iso9660_open_fuzzy_ext(psz_path, ISO_EXTENSION_NONE, i_fuzz);\n}\n\n/*!\n  Open an ISO 9660 image for reading with some tolerance for positioning\n  of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set\n  the eventual offset to adjust by (as long as that is <= i_fuzz).\n\n  Maybe in the future we will have a mode. NULL is returned on error.\n\n  @see iso9660_open_ext @see iso9660_open_fuzzy\n*/\niso9660_t *\niso9660_open_fuzzy_ext (const char *psz_path,\n\t\t\tiso_extension_mask_t iso_extension_mask,\n\t\t\tuint16_t i_fuzz)\n{\n  return iso9660_open_ext_private(psz_path, iso_extension_mask, i_fuzz,\n\t\t\t\t  true);\n}\n\n/*! Close previously opened ISO 9660 image and free resources\n    associated with the image. Call this when done using using an ISO\n    9660 image.\n\n    @return true is unconditionally returned. If there was an error\n    false would be returned.\n*/\nbool\niso9660_close (iso9660_t *p_iso)\n{\n  if (NULL != p_iso) {\n    cdio_stdio_destroy(p_iso->stream);\n    p_iso->stream = NULL;\n    free(p_iso);\n  }\n  return true;\n}\n\nstatic bool\ncheck_pvd (const iso9660_pvd_t *p_pvd, cdio_log_level_t log_level)\n{\n  if ( ISO_VD_PRIMARY != from_711(p_pvd->type) ) {\n// Commented out for Rufus usage\n//    cdio_log (log_level, \"unexpected PVD type %d\", p_pvd->type);\n    return false;\n  }\n\n  if (strncmp (p_pvd->id, ISO_STANDARD_ID, strlen (ISO_STANDARD_ID)))\n    {\n      cdio_log (log_level, \"unexpected ID encountered (expected '\"\n\t\tISO_STANDARD_ID \"', got '%.5s')\", p_pvd->id);\n      return false;\n    }\n  return true;\n}\n\n\n/*!\n  Core procedure for the iso9660_ifs_get_###_id() calls.\n  pvd_member/svd_member is a pointer to an achar_t or dchar_t\n  ID string which we can superset as char.\n  If the Joliet converted string is the same as the achar_t/dchar_t\n  one, we fall back to using the latter, as it may be longer.\n*/\nstatic inline bool\nget_member_id(iso9660_t *p_iso, cdio_utf8_t **p_psz_member_id,\n              char* pvd_member, char* svd_member, size_t max_size)\n{\n  int j;\n  bool strip;\n\n  if (!p_iso) {\n    *p_psz_member_id = NULL;\n    return false;\n  }\n#ifdef HAVE_JOLIET\n  if (p_iso->u_joliet_level) {\n    /* Translate UCS-2 string from Secondary Volume Descriptor */\n    if (cdio_charset_to_utf8(svd_member, max_size,\n                            p_psz_member_id, \"UCS-2BE\")) {\n      /* NB: *p_psz_member_id is never NULL on success. */\n      if (strncmp(*p_psz_member_id, pvd_member,\n                  strlen(*p_psz_member_id)) != 0) {\n        /* Strip trailing spaces */\n        for (j = strlen(*p_psz_member_id)-1; j >= 0; j--) {\n          if ((*p_psz_member_id)[j] != ' ')\n            break;\n          (*p_psz_member_id)[j] = '\\0';\n        }\n        if ((*p_psz_member_id)[0] != 0) {\n          /* Joliet string is not empty and differs from\n             non Joliet one => use it */\n          return true;\n        }\n      }\n      /* Joliet string was either empty or same */\n      free(*p_psz_member_id);\n    }\n  }\n#endif /*HAVE_JOLIET*/\n  *p_psz_member_id = calloc(max_size+1, sizeof(cdio_utf8_t));\n  if (!*p_psz_member_id) {\n    cdio_warn(\"Memory allocation error\");\n    return false;\n  }\n  /* Copy string while removing trailing spaces */\n  (*p_psz_member_id)[max_size] = 0;\n  for (strip=true, j=max_size-1; j>=0; j--) {\n    if (strip && (pvd_member[j] == ' '))\n      continue;\n    strip = false;\n    (*p_psz_member_id)[j] = pvd_member[j];\n  }\n  if (strlen(*p_psz_member_id) == 0) {\n    free(*p_psz_member_id);\n    *p_psz_member_id = NULL;\n    return false;\n  }\n  return true;\n}\n\n\n/*!\n  Return the application ID.  NULL is returned in psz_app_id if there\n  is some problem in getting this.\n*/\nbool\niso9660_ifs_get_application_id(iso9660_t *p_iso,\n\t\t\t       /*out*/ cdio_utf8_t **p_psz_app_id)\n{\n  return get_member_id(p_iso, p_psz_app_id,\n                       (char*)p_iso->pvd.application_id,\n                       (char*)p_iso->svd.application_id,\n                       ISO_MAX_APPLICATION_ID);\n}\n\n/*!\n  Return the Joliet level recognized for p_iso.\n*/\nuint8_t iso9660_ifs_get_joliet_level(iso9660_t *p_iso)\n{\n  if (!p_iso) return 0;\n  return p_iso->u_joliet_level;\n}\n\n/*!\n   Return a string containing the preparer id with trailing\n   blanks removed.\n*/\nbool\niso9660_ifs_get_preparer_id(iso9660_t *p_iso,\n\t\t\t/*out*/ cdio_utf8_t **p_psz_preparer_id)\n{\n  return get_member_id(p_iso, p_psz_preparer_id,\n                       (char*)p_iso->pvd.preparer_id,\n                       (char*)p_iso->svd.preparer_id,\n                       ISO_MAX_PREPARER_ID);\n}\n\n/*!\n   Return a string containing the PVD's publisher id with trailing\n   blanks removed.\n*/\nbool iso9660_ifs_get_publisher_id(iso9660_t *p_iso,\n                                  /*out*/ cdio_utf8_t **p_psz_publisher_id)\n{\n  return get_member_id(p_iso, p_psz_publisher_id,\n                       (char*)p_iso->pvd.publisher_id,\n                       (char*)p_iso->svd.publisher_id,\n                       ISO_MAX_PUBLISHER_ID);\n}\n\n/*!\n   Return a string containing the PVD's system id with trailing\n   blanks removed.\n*/\nbool iso9660_ifs_get_system_id(iso9660_t *p_iso,\n\t\t\t       /*out*/ cdio_utf8_t **p_psz_system_id)\n{\n  return get_member_id(p_iso, p_psz_system_id,\n                       (char*)p_iso->pvd.system_id,\n                       (char*)p_iso->svd.system_id,\n                       ISO_MAX_SYSTEM_ID);\n}\n\n/*!\n   Return a string containing the PVD's volume id with trailing\n   blanks removed.\n*/\nbool iso9660_ifs_get_volume_id(iso9660_t *p_iso,\n\t\t\t       /*out*/ cdio_utf8_t **p_psz_volume_id)\n{\n  return get_member_id(p_iso, p_psz_volume_id,\n                       (char*)p_iso->pvd.volume_id,\n                       (char*)p_iso->svd.volume_id,\n                       ISO_MAX_VOLUME_ID);\n}\n\n/*!\n   Return a string containing the PVD's volumeset id with trailing\n   blanks removed.\n*/\nbool iso9660_ifs_get_volumeset_id(iso9660_t *p_iso,\n\t\t\t\t  /*out*/ cdio_utf8_t **p_psz_volumeset_id)\n{\n  return get_member_id(p_iso, p_psz_volumeset_id,\n                       (char*)p_iso->pvd.volume_set_id,\n                       (char*)p_iso->svd.volume_set_id,\n                       ISO_MAX_VOLUMESET_ID);\n}\n\n\n/*!\n  Read the Primary Volume Descriptor for an ISO 9660 image.\n  True is returned if read, and false if there was an error.\n*/\nstatic bool\niso9660_ifs_read_pvd_loglevel (const iso9660_t *p_iso,\n\t\t\t       /*out*/ iso9660_pvd_t *p_pvd,\n\t\t\t       cdio_log_level_t log_level)\n{\n  if (0 == iso9660_iso_seek_read (p_iso, p_pvd, ISO_PVD_SECTOR, 1)) {\n// Commented out for Rufus usage\n//    cdio_log ( log_level, \"error reading PVD sector (%d)\", ISO_PVD_SECTOR );\n    return false;\n  }\n  return check_pvd(p_pvd, log_level);\n}\n\n/*!\n  Read the Primary Volume Descriptor for an ISO 9660 image.\n  True is returned if read, and false if there was an error.\n*/\nbool\niso9660_ifs_read_pvd (const iso9660_t *p_iso, /*out*/ iso9660_pvd_t *p_pvd)\n{\n  return iso9660_ifs_read_pvd_loglevel(p_iso, p_pvd, CDIO_LOG_WARN);\n}\n\n\n/*!\n  Read the Super block of an ISO 9660 image. This is the\n  Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume\n  Descriptor if (Joliet) extensions are acceptable.\n*/\nbool\niso9660_ifs_read_superblock (iso9660_t *p_iso,\n\t\t\t     iso_extension_mask_t iso_extension_mask)\n{\n  iso9660_svd_t p_svd;  /* Secondary volume descriptor. */\n  iso9660_brvd_t* p_brvd = (iso9660_brvd_t*)&p_svd;  /* Boot record volume descriptor. */\n  int i, j, k;\n\n  if (!p_iso || !iso9660_ifs_read_pvd(p_iso, &(p_iso->pvd)))\n    return false;\n\n  p_iso->u_joliet_level = 0;\n\n  /* There may be multiple Secondary Volume Descriptors (e.g. El Torito + Joliet) */\n  for (i=1; (0 != iso9660_iso_seek_read (p_iso, &p_svd, ISO_PVD_SECTOR+i, 1)); i++) {\n    if (ISO_VD_END == from_711(p_svd.type) ) /* Last SVD */\n      break;\n    if (iso_extension_mask & ISO_EXTENSION_EL_TORITO) {\n      /* Check for an El-Torito boot volume descriptor */\n      if (ISO_VD_BOOT_RECORD == from_711(p_svd.type) &&\n\t  (memcmp(p_brvd->system_id, EL_TORITO_ID, ISO_MAX_SYSTEM_ID) == 0)) {\n\t/* Perform basic parsing of boot entries to fill an image table */\n\tiso9660_br_t br[ISO_BLOCKSIZE / sizeof(iso9660_br_t)];\n\tif (iso9660_iso_seek_read(p_iso, &br, p_brvd->boot_catalog_sector, 1) ==\n\t    ISO_BLOCKSIZE) {\n\t  for (j = 0, k = 0;\n\t       j < (ISO_BLOCKSIZE / sizeof(iso9660_br_t)) && k < MAX_BOOT_IMAGES;\n\t       j++) {\n\t    if (br[j].boot_id == 0x88 && br[j].media_type == 0) {\n\t      p_iso->boot_img[k].lsn = uint32_from_le(br[j].image_lsn);\n\t      p_iso->boot_img[k++].num_sectors = uint16_from_le(br[j].num_sectors);\n\t    }\n\t  }\n\t  /* Special case for non specs-compliant images that do follow the UEFI  */\n\t  /* specs and that use size 0 or 1 for images larger than 0xffff virtual */\n\t  /* sectors, in which case the image runs to the end of the volume (per  */\n\t  /* UEFI specs) or to the next LSN (as seen with some software).         */\n\t  cdio_assert(ISO_BLOCKSIZE / VIRTUAL_SECTORSIZE == 4);\n\t  for (j = 0; j < MAX_BOOT_IMAGES; j++) {\n\t    uint32_t next_lsn = from_733(p_iso->pvd.volume_space_size);\n\t    if (p_iso->boot_img[j].lsn == 0)\n\t      continue;\n\t    /* Find the closest LSN after the one from this image */\n\t    cdio_assert(p_iso->boot_img[j].lsn <= next_lsn);\n\t    for (k = 0; k < MAX_BOOT_IMAGES; k++) {\n\t      if (p_iso->boot_img[k].lsn > p_iso->boot_img[j].lsn &&\n\t\t  p_iso->boot_img[k].lsn < next_lsn)\n\t\tnext_lsn = p_iso->boot_img[k].lsn;\n\t    }\n\t    /* If the image has a sector size of 0 or 1 and theres' more than      */\n\t    /* 0xffff sectors to the next LSN, assume it needs expansion.          */\n\t    if (p_iso->boot_img[j].num_sectors <= 1 &&\n\t\t(next_lsn - p_iso->boot_img[j].lsn) >= 0x4000) {\n\t\tp_iso->boot_img[j].num_sectors =\n\t\t    (next_lsn - p_iso->boot_img[j].lsn) * 4;\n//\t\tcdio_warn(\"Auto-expanding the size of %d-Boot-NoEmul.img\", j);\n\t    }\n\t  }\n\t}\n      }\n    }\n    if ( ISO_VD_SUPPLEMENTARY == from_711(p_svd.type) ) {\n      /* We're only interested in Joliet => make sure the SVD isn't overwritten */\n      if (p_iso->u_joliet_level == 0)\n        memcpy(&(p_iso->svd), &p_svd, sizeof(iso9660_svd_t));\n      if (p_svd.escape_sequences[0] == 0x25\n\t  && p_svd.escape_sequences[1] == 0x2f) {\n\tswitch (p_svd.escape_sequences[2]) {\n\tcase 0x40:\n\t  if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL1)\n\t    p_iso->u_joliet_level = 1;\n\t  break;\n\tcase 0x43:\n\t  if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL2)\n\t    p_iso->u_joliet_level = 2;\n\t  break;\n\tcase 0x45:\n\t  if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL3)\n\t    p_iso->u_joliet_level = 3;\n\t  break;\n\tdefault:\n\t  cdio_info(\"Supplementary Volume Descriptor found, but not Joliet\");\n\t}\n\tif (p_iso->u_joliet_level > 0) {\n\t  cdio_info(\"Found Extension: Joliet Level %d\", p_iso->u_joliet_level);\n\t}\n      }\n    }\n  }\n\n  return true;\n}\n\n/*!\n  Read the Super block of an ISO 9660 image but determine framesize\n  and datastart and a possible additional offset. Generally here we are\n  not reading an ISO 9660 image but a CD-Image which contains an ISO 9660\n  filesystem.\n*/\nbool\niso9660_ifs_fuzzy_read_superblock (iso9660_t *p_iso,\n\t\t\t\t   iso_extension_mask_t iso_extension_mask,\n\t\t\t\t   uint16_t i_fuzz)\n{\n  /* Got some work to do to find ISO_STANDARD_ID (\"CD001\") */\n  unsigned int i;\n\n  for (i=0; i<i_fuzz; i++) {\n    unsigned int j;\n    char *pvd = NULL;\n\n    for (j = 0; j <= 1; j++ ) {\n      lsn_t lsn;\n      uint16_t k;\n      const uint16_t framesizes[] = { ISO_BLOCKSIZE, CDIO_CD_FRAMESIZE_RAW,\n\t\t\t\t      M2RAW_SECTOR_SIZE } ;\n\n      /* We don't need to loop over a zero offset twice*/\n      if (0==i && j)\n\tcontinue;\n\n      lsn = (j) ? ISO_PVD_SECTOR - i : ISO_PVD_SECTOR + i;\n\n      for (k=0; k < 3; k++) {\n\tchar *p, *q;\n\tchar frame[CDIO_CD_FRAMESIZE_RAW] = {'\\0',};\n\tp_iso->i_framesize = framesizes[k];\n\tp_iso->i_datastart = (ISO_BLOCKSIZE == framesizes[k]) ?\n\t\t\t      0 : CDIO_CD_SYNC_SIZE;\n\tp_iso->i_fuzzy_offset = 0;\n\tif (0 == iso9660_seek_read_framesize (p_iso, frame, lsn, 1,\n\t\t\t\t\t      p_iso->i_framesize)) {\n\t  return false;\n\t}\n\n\tq = memchr(frame, 'C', p_iso->i_framesize);\n\tfor ( p=q; p && p < frame + p_iso->i_framesize ; p=q+1 ) {\n\t  q = memchr(p, 'C', p_iso->i_framesize - (p - frame));\n\t  if ( !q || (pvd = strstr(q, ISO_STANDARD_ID)) )\n\t    break;\n\t}\n\n\tif (pvd) {\n\t  /* Yay! Found something */\n\t  p_iso->i_fuzzy_offset = (pvd - frame - 1) -\n\t    ((ISO_PVD_SECTOR-lsn)*p_iso->i_framesize) ;\n\t  /* But is it *really* a PVD? */\n\t  if ( iso9660_ifs_read_pvd_loglevel(p_iso, &(p_iso->pvd),\n\t\t\t\t\t     CDIO_LOG_DEBUG) ) {\n\t    adjust_fuzzy_pvd(p_iso);\n\t    return true;\n\t  }\n\n\t}\n      }\n    }\n  }\n  return false;\n}\n\n\n/*!\n  Read the Primary Volume Descriptor for of CD.\n*/\nbool\niso9660_fs_read_pvd(const CdIo_t *p_cdio, /*out*/ iso9660_pvd_t *p_pvd)\n{\n  /* A bit of a hack, we'll assume track 1 contains ISO_PVD_SECTOR.*/\n  char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };\n  driver_return_code_t driver_return =\n    cdio_read_data_sectors (p_cdio, buf, ISO_PVD_SECTOR, ISO_BLOCKSIZE, 1);\n\n  if (DRIVER_OP_SUCCESS != driver_return) {\n    cdio_warn (\"error reading PVD sector (%d) error %d\", ISO_PVD_SECTOR,\n\t       driver_return);\n    return false;\n  }\n\n  /* The size of a PVD or SVD is smaller than a sector. So we\n     allocated a bigger block above (buf) and now we'll copy just\n     the part we need to save.\n   */\n  cdio_assert (sizeof(buf) >= sizeof (iso9660_pvd_t));\n  memcpy(p_pvd, buf, sizeof(iso9660_pvd_t));\n\n  return check_pvd(p_pvd, CDIO_LOG_WARN);\n}\n\n\n/*!\n  Read the Super block of an ISO 9660 image. This is the\n  Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume\n  Descriptor if (Joliet) extensions are acceptable.\n*/\nbool\niso9660_fs_read_superblock (CdIo_t *p_cdio,\n\t\t\t    iso_extension_mask_t iso_extension_mask)\n{\n  if (!p_cdio) return false;\n\n  {\n    generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env;\n    iso9660_pvd_t         *p_pvd = &(p_env->pvd);\n    iso9660_svd_t         *p_svd = &(p_env->svd);\n    char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, };\n    driver_return_code_t driver_return;\n\n    if ( !iso9660_fs_read_pvd(p_cdio, p_pvd) )\n      return false;\n\n    p_env->u_joliet_level = 0;\n\n    driver_return =\n      cdio_read_data_sectors ( p_cdio, buf, ISO_PVD_SECTOR+1, ISO_BLOCKSIZE,\n\t\t\t       1 );\n\n    if (DRIVER_OP_SUCCESS == driver_return) {\n      /* The size of a PVD or SVD is smaller than a sector. So we\n\t allocated a bigger block above (buf) and now we'll copy just\n\t the part we need to save.\n      */\n      cdio_assert (sizeof(buf) >= sizeof (iso9660_svd_t));\n      memcpy(p_svd, buf, sizeof(iso9660_svd_t));\n\n      if ( ISO_VD_SUPPLEMENTARY == from_711(p_svd->type) ) {\n\tif (p_svd->escape_sequences[0] == 0x25\n\t    && p_svd->escape_sequences[1] == 0x2f) {\n\t  switch (p_svd->escape_sequences[2]) {\n\t  case 0x40:\n\t    if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL1)\n\t      p_env->u_joliet_level = 1;\n\t    break;\n\t  case 0x43:\n\t    if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL2)\n\t      p_env->u_joliet_level = 2;\n\t    break;\n\t  case 0x45:\n\t    if (iso_extension_mask & ISO_EXTENSION_JOLIET_LEVEL3)\n\t      p_env->u_joliet_level = 3;\n\t    break;\n\t  default:\n\t    cdio_info(\"Supplementary Volume Descriptor found, but not Joliet\");\n\t  }\n\t  if (p_env->u_joliet_level > 0) {\n\t    cdio_info(\"Found Extension: Joliet Level %d\",\n\t\t      p_env->u_joliet_level);\n\t  }\n\t}\n      }\n    }\n  }\n\n  return true;\n}\n\n/*!\n  Seek to a position and then read n blocks. Size read is returned.\n*/\nstatic long int\niso9660_seek_read_framesize (const iso9660_t *p_iso, void *ptr,\n\t\t\t     lsn_t start, long int size,\n\t\t\t     uint16_t i_framesize)\n{\n  long int ret;\n  int64_t i_byte_offset;\n\n  if (!p_iso) return 0;\n  i_byte_offset = (start * (int64_t)(p_iso->i_framesize))\n    + p_iso->i_fuzzy_offset + p_iso->i_datastart;\n\n  ret = cdio_stream_seek (p_iso->stream, i_byte_offset, SEEK_SET);\n  if (ret!=0) return 0;\n  return cdio_stream_read (p_iso->stream, ptr, i_framesize, size);\n}\n\n/*!\n  Seek to a position and then read n blocks. Size read is returned.\n*/\nlong int\niso9660_iso_seek_read (const iso9660_t *p_iso, void *ptr, lsn_t start,\n\t\t       long int size)\n{\n  return iso9660_seek_read_framesize(p_iso, ptr, start, size, ISO_BLOCKSIZE);\n}\n\n\n\n/*!\n  Check for the end of a directory record list in a single directory\n  block.  If at the end, set the offset to start of the next block and\n  return \"true\". The caller often skips actions only when at the end\n  of a record list.\n*/\nstatic bool\niso9660_check_dir_block_end(iso9660_dir_t *p_iso9660_dir, unsigned *offset)\n{\n  if (!iso9660_get_dir_len(p_iso9660_dir))\n    {\n      /*\n\t Length 0 indicates that no more directory records are in this\n\t block. This matches how Linux and libburn's libisofs work.\n\n\t Note that assignment below does not exactly round up.\n\t If (offset % ISO_BLOCKSIZE) == 0  then offset is incremented\n\t by ISO_BLOCKSIZE, i.e. the block is skipped.\n      */\n      *offset += ISO_BLOCKSIZE - (*offset % ISO_BLOCKSIZE);\n      return true;\n    }\n\n  if ((*offset + iso9660_get_dir_len(p_iso9660_dir) - 1) / ISO_BLOCKSIZE\n      != *offset / ISO_BLOCKSIZE)\n    {\n      /*\n\t Directory record spans over block limit.\n\t Hop to next block where a new record is supposed to begin,\n\t if it is not after the end of the directory data.\n       */\n      *offset += ISO_BLOCKSIZE - (*offset % ISO_BLOCKSIZE);\n      return true;\n    }\n\n  return false;\n}\n\nstatic inline bool\n_iso9660_is_rock_ridge_enabled(void* p_image)\n{\n  cdio_header_t* p_header = (cdio_header_t*)p_image;\n\n  if (!p_header)\n    return false;\n  if (p_header->u_type == CDIO_HEADER_TYPE_ISO) {\n    iso9660_t* p_iso = (iso9660_t*)p_image;\n    return (p_iso->iso_extension_mask & ISO_EXTENSION_ROCK_RIDGE);\n  }\n  /* Rock Ridge is always enabled for other types */\n  return true;\n}\n\n/*!\n  Convert a directory record name to a 0-terminated string.\n  One of parameters alloc_result and cpy_result should be non-NULL to take\n  the result.\n*/\nstatic bool\n_iso9660_recname_to_cstring(const char *src, size_t src_len,\n\t\t\t    cdio_utf8_t **alloc_result,\n\t\t\t    cdio_utf8_t *cpy_result, uint8_t u_joliet_level)\n{\n#ifdef HAVE_JOLIET\n  if (u_joliet_level) {\n    int i_inlen = src_len;\n    cdio_utf8_t *p_psz_out = NULL;\n\n    if (cdio_charset_to_utf8(src, i_inlen, &p_psz_out, \"UCS-2BE\")) {\n      if (cpy_result != NULL) {\n        strncpy(cpy_result, p_psz_out, i_inlen);\n\tif (strlen(p_psz_out) > i_inlen)\n\t  cdio_warn(\"file name '%s' will be truncated\", p_psz_out);\n      }\n      if (alloc_result != NULL)\n        *alloc_result = p_psz_out;\n      else\n        free(p_psz_out);\n    } else {\n      return false;\n    }\n  } else\n#endif /*HAVE_JOLIET*/\n  {\n    if (alloc_result != NULL) {\n      *alloc_result = calloc(1, src_len + 1);\n      if (*alloc_result == NULL)\n\treturn false;\n      strncpy(*alloc_result, src, src_len);\n      (*alloc_result)[src_len] = 0;\n    }\n    if (cpy_result != NULL) {\n      strncpy(cpy_result, src, src_len);\n      cpy_result[src_len] = 0;\n    }\n  }\n  return true;\n}\n\nstatic iso9660_stat_t *\n_iso9660_dir_to_statbuf (iso9660_dir_t *p_iso9660_dir,\n\t\t\t iso9660_stat_t *last_p_stat,\n\t\t\t void* p_image,\n\t\t\t bool_3way_t b_xa,\n\t\t\t uint8_t u_joliet_level)\n{\n  uint8_t dir_len= iso9660_get_dir_len(p_iso9660_dir);\n  iso711_t i_fname;\n  unsigned int stat_len;\n  iso9660_stat_t *p_stat = last_p_stat;\n  char rr_fname[256] = \"\";\n  int i_rr_fname = 0;\n  lsn_t extent_lsn;\n  bool first_extent;\n\n  if (!dir_len) return NULL;\n\n  i_fname = from_711(p_iso9660_dir->filename.len);\n\n  /* .. string in statbuf is one longer than in p_iso9660_dir's listing '\\1' */\n  stat_len = sizeof(iso9660_stat_t) + i_fname + 2;\n\n  /* Reuse multiextent p_stat if not NULL */\n  if (!p_stat) {\n    p_stat = calloc(1, stat_len);\n    first_extent = true;\n  } else {\n    /* Ignore Rock Ridge Deep Directory RE entries */\n    if (p_stat->rr.u_su_fields & ISO_ROCK_SUF_RE)\n      goto fail;\n    first_extent = false;\n  }\n  if (!p_stat) {\n    cdio_warn(\"Couldn't calloc(1, %d)\", stat_len);\n    return NULL;\n  }\n  p_stat->type    = (p_iso9660_dir->file_flags & ISO_DIRECTORY)\n    ? _STAT_DIR : _STAT_FILE;\n\n  /* Test for gaps between extents. Important: Use previous .total_size */\n  extent_lsn = from_733 (p_iso9660_dir->extent);\n  if (p_stat->total_size > 0) {\n    /* This is a follow-up extent. Check for a gap. */\n    if (p_stat->lsn + p_stat->total_size / ISO_BLOCKSIZE != extent_lsn\n\t|| p_stat->total_size % ISO_BLOCKSIZE) {\n      /* Gap detected. Throw error. */\n      cdio_warn(\"Non-contiguous data extents with '%s'\", p_stat->filename);\n      goto fail;\n    }\n  } else if (first_extent) {\n    p_stat->lsn = extent_lsn;\n  }\n  /* Only now update .total_size */\n  p_stat->total_size += from_733(p_iso9660_dir->size);\n\n#ifdef HAVE_ROCK\n  if (_iso9660_is_rock_ridge_enabled(p_image))\n    p_stat->rr.b3_rock = dunno;\n#endif\n  p_stat->b_xa = false;\n\n#ifndef DO_NOT_WANT_COMPATIBILITY\n  if (first_extent) {\n    p_stat->size = from_733(p_iso9660_dir->size);\n    p_stat->secsize = CDIO_EXTENT_BLOCKS(p_stat->size);\n  }\n#endif /* DO_NOT_WANT_COMPATIBILITY */\n\n  /* Only resolve the full filename when we're not dealing with extent */\n  if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0) {\n    /* Check if this is the last part of a multiextent file */\n    if (!first_extent) {\n      cdio_utf8_t *p_psz_out = NULL;\n      int bad_multi;\n      int i_inlen = i_fname;\n\n      if (!_iso9660_recname_to_cstring(&p_iso9660_dir->filename.str[1],\n\t\t\t\t       i_inlen, &p_psz_out, NULL,\n\t\t\t\t       u_joliet_level))\n\tgoto fail;\n      bad_multi = (strcmp(p_stat->filename, p_psz_out) != 0);\n      free(p_psz_out);\n      if (bad_multi) {\n\tcdio_warn(\"Non consecutive multiextent file parts for '%s'\",\n\t\t  p_stat->filename);\n\tgoto fail;\n      }\n    }\n\n#ifdef HAVE_ROCK\n    i_rr_fname = get_rock_ridge_filename(p_iso9660_dir, p_image, rr_fname, p_stat);\n#endif\n\n    if (i_rr_fname > 0) {\n      if (i_rr_fname > i_fname) {\n\t/* realloc gives Valgrind errors */\n\tiso9660_stat_t *p_stat_new =\n\t  calloc(1, sizeof(iso9660_stat_t)+i_rr_fname+2);\n\tif (!p_stat_new) {\n\t  cdio_warn(\"Couldn't calloc(1, %d)\", (int)(sizeof(iso9660_stat_t)+i_rr_fname+2));\n\t  goto fail;\n\t}\n\tmemcpy(p_stat_new, p_stat, stat_len);\n\tfree(p_stat);\n\tp_stat = p_stat_new;\n      }\n      strncpy(p_stat->filename, rr_fname, i_rr_fname+1);\n    } else {\n      if ('\\0' == p_iso9660_dir->filename.str[1] && 1 == i_fname) {\n\tstrncpy (p_stat->filename, \".\", strlen(\".\")+1);\n      } else if ('\\1' == p_iso9660_dir->filename.str[1] && 1 == i_fname) {\n\tstrncpy (p_stat->filename, \"..\", strlen(\"..\")+1);\n      } else {\n\tint i_inlen = i_fname;\n\n\tif (!_iso9660_recname_to_cstring(&p_iso9660_dir->filename.str[1],\n\t\t\t\t\t i_inlen, NULL, p_stat->filename,\n\t\t\t\t\t u_joliet_level))\n\t  goto fail;\n      }\n    }\n  } else {\n    int i_inlen = i_fname;\n\n    if (!_iso9660_recname_to_cstring(&p_iso9660_dir->filename.str[1],\n\t\t\t\t     i_inlen, NULL, p_stat->filename,\n\t\t\t\t     u_joliet_level))\n      goto fail;\n  }\n\n  iso9660_get_dtime(&(p_iso9660_dir->recording_time), true, &(p_stat->tm));\n\n  if (dir_len < sizeof(iso9660_dir_t)) {\n    iso9660_stat_free(p_stat);\n    return NULL;\n  }\n\n\n  {\n    int su_length = iso9660_get_dir_len(p_iso9660_dir)\n      - sizeof (iso9660_dir_t);\n    su_length -= i_fname;\n\n    if (su_length % 2)\n      su_length--;\n\n    if (su_length < sizeof (iso9660_xa_t))\n      return p_stat;\n\n    if (nope == b_xa) {\n      return p_stat;\n    } else {\n      iso9660_xa_t *xa_data =\n\t(void *) (((char *) p_iso9660_dir)\n\t\t  + (iso9660_get_dir_len(p_iso9660_dir) - su_length));\n      cdio_log_level_t loglevel = (yep == b_xa)\n\t? CDIO_LOG_WARN : CDIO_LOG_INFO;\n\n      if (xa_data->signature[0] != 'X'\n\t  || xa_data->signature[1] != 'A')\n\t{\n\t  cdio_log (loglevel,\n\t\t    \"XA signature not found in ISO9660's system use area;\"\n\t\t     \" ignoring XA attributes for this file entry.\");\n\t  cdio_debug (\"%d %d %d, '%c%c' (%d, %d)\",\n\t\t      iso9660_get_dir_len(p_iso9660_dir),\n\t\t      i_fname,\n\t\t      su_length,\n\t\t      xa_data->signature[0], xa_data->signature[1],\n\t\t      xa_data->signature[0], xa_data->signature[1]);\n\t  return p_stat;\n\t}\n      p_stat->b_xa = true;\n      p_stat->xa   = *xa_data;\n    }\n  }\n  return p_stat;\n\nfail:\n  iso9660_stat_free(p_stat);\n  return NULL;\n}\n\n/*!\n  Return the directory name stored in the iso9660_dir_t\n\n  A string is allocated: the caller must deallocate. This routine\n  can return NULL if memory allocation fails.\n */\nchar *\niso9660_dir_to_name (const iso9660_dir_t *iso9660_dir)\n{\n  uint8_t len=iso9660_get_dir_len(iso9660_dir);\n\n  if (!len) return NULL;\n\n  cdio_assert (len >= sizeof (iso9660_dir_t));\n\n  /* (iso9660_dir->file_flags & ISO_DIRECTORY) */\n\n  if (iso9660_dir->filename.str[1] == '\\0')\n    return strdup(\".\");\n  else if (iso9660_dir->filename.str[1] == '\\1')\n    return strdup(\"..\");\n  else {\n    return strdup(&iso9660_dir->filename.str[1]);\n  }\n}\n\n/*\n   Return a pointer to a ISO 9660 stat buffer or NULL if there's an error\n*/\nstatic iso9660_stat_t *\n_fs_stat_root (CdIo_t *p_cdio)\n{\n\n  if (!p_cdio) return NULL;\n\n  {\n    iso_extension_mask_t iso_extension_mask = ISO_EXTENSION_ALL;\n    generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env;\n    iso9660_dir_t *p_iso9660_dir;\n    iso9660_stat_t *p_stat;\n    bool_3way_t b_xa;\n\n    if (!p_env->u_joliet_level)\n      iso_extension_mask &= ~ISO_EXTENSION_JOLIET;\n\n    /* FIXME: try also with Joliet.*/\n    if ( !iso9660_fs_read_superblock (p_cdio, iso_extension_mask) ) {\n      cdio_warn(\"Could not read ISO-9660 Superblock.\");\n      return NULL;\n    }\n\n    switch(cdio_get_discmode(p_cdio)) {\n    case CDIO_DISC_MODE_CD_XA:\n      b_xa = yep;\n      break;\n    case CDIO_DISC_MODE_CD_DATA:\n      b_xa = nope;\n      break;\n    default:\n      b_xa = dunno;\n    }\n\n#ifdef HAVE_JOLIET\n    p_iso9660_dir = p_env->u_joliet_level\n      ? &(p_env->svd.root_directory_record)\n      : &(p_env->pvd.root_directory_record) ;\n#else\n    p_iso9660_dir = &(p_env->pvd.root_directory_record) ;\n#endif\n\n    p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, NULL, p_cdio,\n\t\t\t\t      b_xa, p_env->u_joliet_level);\n    return p_stat;\n  }\n\n}\n\nstatic iso9660_stat_t *\n_ifs_stat_root (iso9660_t *p_iso)\n{\n  iso9660_stat_t *p_stat;\n  iso9660_dir_t *p_iso9660_dir;\n\n#ifdef HAVE_JOLIET\n  p_iso9660_dir = p_iso->u_joliet_level\n    ? &(p_iso->svd.root_directory_record)\n    : &(p_iso->pvd.root_directory_record) ;\n#else\n  p_iso9660_dir = &(p_iso->pvd.root_directory_record) ;\n#endif\n\n  p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, NULL,\n\t\t\t\t    p_iso, p_iso->b_xa,\n\t\t\t\t    p_iso->u_joliet_level);\n  return p_stat;\n}\n\nstatic iso9660_stat_t *\n_fs_stat_traverse (const CdIo_t *p_cdio, const iso9660_stat_t *_root,\n\t\t   char **splitpath)\n{\n  unsigned offset = 0;\n  uint8_t *_dirbuf = NULL;\n  uint32_t blocks;\n  iso9660_stat_t *p_stat;\n  generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env;\n  iso9660_stat_t *p_iso9660_stat = NULL;\n  bool skip_following_extents = false;\n\n  if (!splitpath[0])\n    {\n      unsigned int len=sizeof(iso9660_stat_t) + strlen(_root->filename)+1;\n      p_stat = calloc(1, len);\n      cdio_assert (p_stat != NULL);\n      memcpy(p_stat, _root, len);\n      p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max);\n      cdio_assert (p_stat->rr.psz_symlink != NULL);\n      memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink,\n\t     p_stat->rr.i_symlink_max);\n      return p_stat;\n    }\n\n  if (_root->type == _STAT_FILE)\n    return NULL;\n\n  cdio_assert (_root->type == _STAT_DIR);\n  blocks = CDIO_EXTENT_BLOCKS(_root->total_size);\n\n  _dirbuf = calloc(1, blocks * ISO_BLOCKSIZE);\n  if (!_dirbuf)\n    {\n    cdio_warn(\"Couldn't calloc(1, %d)\", blocks * ISO_BLOCKSIZE);\n    return NULL;\n    }\n\n  if (cdio_read_data_sectors (p_cdio, _dirbuf, _root->lsn, ISO_BLOCKSIZE,\n\t\t\t      blocks))\n      return NULL;\n\n  while (offset < (blocks * ISO_BLOCKSIZE))\n    {\n      iso9660_dir_t *p_iso9660_dir = (void *) &_dirbuf[offset];\n      int cmp;\n\n      if (iso9660_check_dir_block_end(p_iso9660_dir, &offset))\n\tcontinue;\n\n      if (skip_following_extents) {\n\t/* Do not register remaining extents of ill file */\n\tp_iso9660_stat = NULL;\n      } else {\n\tp_iso9660_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, p_iso9660_stat,\n\t\t\t\t(CdIo_t*)p_cdio, dunno, p_env->u_joliet_level);\n\tif (NULL == p_iso9660_stat)\n\t  skip_following_extents = true; /* Start ill file mode */\n      }\n      if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0)\n\tskip_following_extents = false; /* Ill or not: The file ends now */\n\n      if (NULL == p_iso9660_stat ||\n\t  (p_iso9660_dir->file_flags & ISO_MULTIEXTENT))\n\tgoto skip_to_next_record;\n\n      cmp = strcmp(splitpath[0], p_iso9660_stat->filename);\n\n      if ( 0 != cmp && 0 == p_env->u_joliet_level\n\t   && yep != p_iso9660_stat->rr.b3_rock ) {\n\tchar *trans_fname = NULL;\n\tunsigned int i_trans_fname=strlen(p_iso9660_stat->filename);\n\n\tif (i_trans_fname) {\n\t  trans_fname = calloc(1, i_trans_fname+1);\n\t  if (!trans_fname) {\n\t    cdio_warn(\"can't allocate %lu bytes\",\n\t\t      (long unsigned int) strlen(p_iso9660_stat->filename));\n\t    iso9660_stat_free(p_iso9660_stat);\n\t    return NULL;\n\t  }\n\t  iso9660_name_translate_ext(p_iso9660_stat->filename, trans_fname,\n\t\t\t\t     p_env->u_joliet_level);\n\t  cmp = strcmp(splitpath[0], trans_fname);\n\t  free(trans_fname);\n\t}\n      }\n\n      if (!cmp) {\n\tiso9660_stat_t *ret_stat\n\t  = _fs_stat_traverse (p_cdio, p_iso9660_stat, &splitpath[1]);\n\tiso9660_stat_free(p_iso9660_stat);\n\tfree (_dirbuf);\n\treturn ret_stat;\n      }\n\nskip_to_next_record:\n      iso9660_stat_free(p_iso9660_stat);\n      p_iso9660_stat = NULL;\n      offset += iso9660_get_dir_len(p_iso9660_dir);\n    }\n\n  cdio_assert (offset == (blocks * ISO_BLOCKSIZE));\n\n  /* not found */\n  free (_dirbuf);\n  return NULL;\n}\n\nstatic iso9660_stat_t *\n_fs_iso_stat_traverse (iso9660_t *p_iso, const iso9660_stat_t *_root,\n\t\t       char **splitpath)\n{\n  unsigned offset = 0;\n  uint8_t *_dirbuf = NULL;\n  uint32_t blocks;\n  int ret, cmp;\n  iso9660_stat_t *p_stat = NULL;\n  iso9660_dir_t *p_iso9660_dir = NULL;\n\n  if (!splitpath[0])\n    {\n      unsigned int len=sizeof(iso9660_stat_t) + strlen(_root->filename)+1;\n      p_stat = calloc(1, len);\n      cdio_assert (p_stat != NULL);\n      memcpy(p_stat, _root, len);\n      p_stat->rr.psz_symlink = calloc(1, p_stat->rr.i_symlink_max);\n      cdio_assert (p_stat->rr.psz_symlink != NULL);\n      memcpy(p_stat->rr.psz_symlink, _root->rr.psz_symlink,\n\t     p_stat->rr.i_symlink_max);\n      return p_stat;\n    }\n\n  if (_root->type == _STAT_FILE)\n    return NULL;\n\n  cdio_assert (_root->type == _STAT_DIR);\n\n  blocks = CDIO_EXTENT_BLOCKS(_root->total_size);\n  _dirbuf = calloc(1, blocks * ISO_BLOCKSIZE);\n  if (!_dirbuf)\n    {\n    cdio_warn(\"Couldn't calloc(1, %d)\", blocks * ISO_BLOCKSIZE);\n    return NULL;\n    }\n\n  ret = iso9660_iso_seek_read (p_iso, _dirbuf, _root->lsn, blocks);\n  if (ret != blocks * ISO_BLOCKSIZE) {\n    free(_dirbuf);\n    return NULL;\n  }\n\n  for (offset = 0; offset < (blocks * ISO_BLOCKSIZE);\n       offset += iso9660_get_dir_len(p_iso9660_dir))\n    {\n      p_iso9660_dir = (void *) &_dirbuf[offset];\n\n      if (iso9660_check_dir_block_end(p_iso9660_dir, &offset))\n\tcontinue;\n\n      p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, p_stat, p_iso,\n\t\t\t\t\tp_iso->b_xa, p_iso->u_joliet_level);\n\n      if (!p_stat) {\n\tcdio_warn(\"Bad directory information for %s\", splitpath[0]);\n\tfree(_dirbuf);\n\treturn NULL;\n      }\n\n      /* If we have multiextent file parts, loop until the last one */\n      if (p_iso9660_dir->file_flags & ISO_MULTIEXTENT)\n        continue;\n\n      cmp = strcmp(splitpath[0], p_stat->filename);\n\n      if ( 0 != cmp && 0 == p_iso->u_joliet_level\n\t   && yep != p_stat->rr.b3_rock ) {\n\tchar *trans_fname = NULL;\n\tunsigned int i_trans_fname=strlen(p_stat->filename);\n\n\tif (i_trans_fname) {\n\t  trans_fname = calloc(1, i_trans_fname+1);\n\t  if (!trans_fname) {\n\t    cdio_warn(\"can't allocate %lu bytes\",\n\t\t      (long unsigned int) strlen(p_stat->filename));\n\t    iso9660_stat_free(p_stat);\n\t    return NULL;\n\t  }\n\t  iso9660_name_translate_ext(p_stat->filename, trans_fname,\n\t\t\t\t     p_iso->u_joliet_level);\n\t  cmp = strcmp(splitpath[0], trans_fname);\n\t  free(trans_fname);\n\t}\n      }\n\n      if (!cmp) {\n\tiso9660_stat_t *ret_stat\n\t  = _fs_iso_stat_traverse (p_iso, p_stat, &splitpath[1]);\n\tiso9660_stat_free(p_stat);\n\tfree (_dirbuf);\n\treturn ret_stat;\n      }\n      iso9660_stat_free(p_stat);\n      p_stat = NULL;\n    }\n\n  cdio_assert (offset == (blocks * ISO_BLOCKSIZE));\n\n  /* not found */\n  iso9660_stat_free(p_stat);\n  free (_dirbuf);\n  return NULL;\n}\n\n/*!\n  Return file status for psz_path. NULL is returned on error.\n\n  @param p_cdio the CD object to read from\n\n  @param psz_path filename path to look up and get information about\n\n  @return ISO 9660 file information\n\n  Important note:\n\n  You make get different results looking up \"/\" versus \"/.\" and the\n  latter may give more complete information. \"/\" will take information\n  from the PVD only, whereas \"/.\" will force a directory read of \"/\" and\n  find \".\" and in that Rock-Ridge information might be found which fills\n  in more stat information. Ideally iso9660_fs_stat should be fixed.\n  Patches anyone?\n */\niso9660_stat_t *\niso9660_fs_stat (CdIo_t *p_cdio, const char psz_path[])\n{\n  iso9660_stat_t *p_root;\n  char **p_psz_splitpath;\n  iso9660_stat_t *p_stat;\n\n  if (!p_cdio)   return NULL;\n  if (!psz_path) return NULL;\n\n  p_root = _fs_stat_root (p_cdio);\n\n  if (!p_root)   return NULL;\n\n  p_psz_splitpath = _cdio_strsplit (psz_path, '/');\n  p_stat = _fs_stat_traverse (p_cdio, p_root, p_psz_splitpath);\n  iso9660_stat_free(p_root);\n  _cdio_strfreev (p_psz_splitpath);\n\n  return p_stat;\n}\n\ntypedef iso9660_stat_t * (stat_root_t) (void *p_image);\ntypedef iso9660_stat_t * (stat_traverse_t)\n  (const void *p_image, const iso9660_stat_t *_root, char **splitpath);\n\n/*!\n  Get file status for psz_path into stat. NULL is returned on error.\n  pathname version numbers in the ISO 9660\n  name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names\n  are downcased.\n */\nstatic iso9660_stat_t *\nfs_stat_translate (void *p_image, stat_root_t stat_root,\n\t\t   stat_traverse_t stat_traverse,\n\t\t   const char psz_path[])\n{\n  iso9660_stat_t *p_root;\n  char **p_psz_splitpath;\n  iso9660_stat_t *p_stat;\n\n  if (!p_image)  return NULL;\n  if (!psz_path) return NULL;\n\n  p_root = stat_root (p_image);\n  if (!p_root) return NULL;\n\n  p_psz_splitpath = _cdio_strsplit (psz_path, '/');\n  p_stat = stat_traverse (p_image, p_root, p_psz_splitpath);\n  iso9660_stat_free(p_root);\n  _cdio_strfreev (p_psz_splitpath);\n\n  return p_stat;\n}\n\n/*!\n  Return file status for path name psz_path. NULL is returned on error.\n  pathname version numbers in the ISO 9660 name are dropped, i.e. ;1\n  is removed and if level 1 ISO-9660 names are downcased.\n\n  @param p_cdio the CD object to read from\n\n  @param psz_path filename path to look up and get information about\n\n  @return ISO 9660 file information.  The caller must free the\n  returned result using iso9660_stat_free().\n\n */\niso9660_stat_t *\niso9660_fs_stat_translate (CdIo_t *p_cdio, const char psz_path[])\n{\n  return fs_stat_translate(p_cdio, (stat_root_t *) _fs_stat_root,\n\t\t\t   (stat_traverse_t *) _fs_stat_traverse,\n\t\t\t   psz_path);\n}\n\n/*!\n  @param p_iso the ISO-9660 file image to get data from\n\n  @param psz_path filename path translate\n\n  @return file status for path name psz_path. NULL is returned on\n  error.  pathname version numbers in the ISO 9660 name are dropped,\n  i.e. ;1 is removed and if level 1 ISO-9660 names are downcased.\n  The caller must free the returned result using iso9660_stat_free().\n */\niso9660_stat_t *\niso9660_ifs_stat_translate (iso9660_t *p_iso, const char psz_path[])\n{\n  /* Special case for virtual El-Torito boot images ('/[BOOT]/#-Boot-NoEmul.img') */\n  if (psz_path && p_iso && p_iso->boot_img[0].lsn != 0) {\n    /* Work on a path without leading slash */\n    const char* path = (psz_path[0] == '/') ? &psz_path[1] : psz_path;\n    if ((_cdio_strnicmp(path, \"[BOOT]/\", 7) == 0) &&\n\t(_cdio_stricmp(&path[8], \"-Boot-NoEmul.img\") == 0)) {\n      int index = path[7] - '0';\n      iso9660_stat_t* p_stat;\n      if (strlen(path) < 24)\n\treturn NULL;\n      cdio_assert(MAX_BOOT_IMAGES <= 10);\n      if ((path[7] < '0') || (path[7] > '0' + MAX_BOOT_IMAGES - 1))\n\treturn NULL;\n      if (p_iso->boot_img[index].lsn == 0 || p_iso->boot_img[index].num_sectors == 0)\n\treturn NULL;\n      p_stat = calloc(1, sizeof(iso9660_stat_t) + strlen(path));\n      if (!p_stat) {\n\tcdio_warn(\"Couldn't calloc(1, %d)\", (int)sizeof(iso9660_stat_t));\n\treturn NULL;\n      }\n      p_stat->lsn = p_iso->boot_img[index].lsn;\n      p_stat->total_size = p_iso->boot_img[index].num_sectors * VIRTUAL_SECTORSIZE;\n      p_stat->type = _STAT_FILE;\n      strcpy(p_stat->filename, path);\n      return p_stat;\n    }\n  }\n\n  return fs_stat_translate(p_iso, (stat_root_t *) _ifs_stat_root,\n\t\t\t   (stat_traverse_t *) _fs_iso_stat_traverse,\n\t\t\t   psz_path);\n}\n\n\n/*!\n\n  @param p_cdio the CD object to read from\n\n  @param pzs_path path the look up\n\n  @return file status for pathname. NULL is returned on error.\n  The caller must free the returned result using iso9660_stat_free().\n */\niso9660_stat_t *\niso9660_ifs_stat (iso9660_t *p_iso, const char psz_path[])\n{\n  iso9660_stat_t *p_root;\n  char **splitpath;\n  iso9660_stat_t *stat;\n\n  if (!p_iso)    return NULL;\n  if (!psz_path) return NULL;\n\n  p_root = _ifs_stat_root (p_iso);\n  if (!p_root) return NULL;\n\n  splitpath = _cdio_strsplit (psz_path, '/');\n  stat = _fs_iso_stat_traverse (p_iso, p_root, splitpath);\n  iso9660_stat_free(p_root);\n  _cdio_strfreev (splitpath);\n\n  return stat;\n}\n\n/*!\n  Read psz_path (a directory) and return a list of iso9660_stat_t\n  pointers for the files inside that directory.\n\n  @param p_cdio the CD object to read from\n\n  @param pzs_path path the read the directory from.\n\n  @return file status for psz_path. The caller must free the\n  The caller must free the returned result using iso9660_stat_free().\n*/\nCdioISO9660FileList_t *\niso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[])\n{\n  generic_img_private_t *p_env;\n  iso9660_dir_t *p_iso9660_dir;\n  iso9660_stat_t *p_iso9660_stat = NULL;\n  iso9660_stat_t *p_stat;\n\n  unsigned offset = 0;\n  uint8_t *_dirbuf = NULL;\n  uint64_t blocks;\n  CdioISO9660DirList_t *retval;\n  bool skip_following_extents = false;\n\n  if (!p_cdio)   return NULL;\n  if (!psz_path) return NULL;\n\n  p_env = (generic_img_private_t *) p_cdio->env;\n\n  p_stat = iso9660_fs_stat (p_cdio, psz_path);\n  if (!p_stat) return NULL;\n\n  if (p_stat->type != _STAT_DIR) {\n    iso9660_stat_free(p_stat);\n    return NULL;\n  }\n\n  /* Check for overflow on 32-bit systems.\n     uint32_t has a limited maximum value, and if p_stat->total_size (the total\n     size of the directory) is very large, the calculation might exceed this limit.\n  */\n  if (p_stat->total_size > SIZE_MAX / ISO_BLOCKSIZE) {\n    cdio_warn(\"Total size is too large\");\n    iso9660_stat_free(p_stat);\n    return NULL;\n  }\n\n  blocks = CDIO_EXTENT_BLOCKS(p_stat->total_size);\n  retval = _cdio_list_new ();\n\n  /* Check for potential integer overflow when calculating total blocks */\n  if (blocks > (SIZE_MAX / ISO_BLOCKSIZE)) {\n    cdio_warn(\"Total size is too large\");\n    iso9660_stat_free(p_stat);\n    return NULL;\n  }\n\n  _dirbuf = calloc(1, blocks * ISO_BLOCKSIZE);\n  if (!_dirbuf)\n    {\n      cdio_warn(\"Couldn't calloc(1, %lld)\", blocks * ISO_BLOCKSIZE);\n      iso9660_stat_free(p_stat);\n      iso9660_dirlist_free(retval);\n      return NULL;\n    }\n\n  if (cdio_read_data_sectors (p_cdio, _dirbuf, p_stat->lsn,\n\t\t\t      ISO_BLOCKSIZE, blocks)) {\n    iso9660_stat_free(p_stat);\n    iso9660_dirlist_free(retval);\n    return NULL;\n  }\n\n  while (offset < (blocks * ISO_BLOCKSIZE))\n    {\n      p_iso9660_dir = (void *) &_dirbuf[offset];\n\n      if (iso9660_check_dir_block_end(p_iso9660_dir, &offset))\n\tcontinue;\n\n      if (skip_following_extents) {\n\t/* Do not register remaining extents of ill file */\n\tp_iso9660_stat = NULL;\n      } else {\n\tp_iso9660_stat = _iso9660_dir_to_statbuf(p_iso9660_dir,\n\t\t\t\t\t\t p_iso9660_stat, p_cdio,\n\t\t\t\t\t\t dunno, p_env->u_joliet_level);\n\tif (NULL == p_iso9660_stat)\n\t  skip_following_extents = true; /* Start ill file mode */\n      }\n      if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0)\n\tskip_following_extents = false; /* Ill or not: The file ends now */\n\n      if ((p_iso9660_stat) &&\n\t  ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0)) {\n\t_cdio_list_append (retval, p_iso9660_stat);\n\tp_iso9660_stat = NULL;\n      }\n\n      offset += iso9660_get_dir_len(p_iso9660_dir);\n    }\n\n  cdio_assert (offset == (blocks * ISO_BLOCKSIZE));\n\n  free(_dirbuf);\n  iso9660_stat_free(p_stat);\n  iso9660_stat_free(p_iso9660_stat);\n  return retval;\n}\n\n/*!\n  Read psz_path (a directory) and return a list of iso9660_stat_t\n  of the files inside that. The caller must free the returned result.\n*/\nCdioISO9660FileList_t *\niso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[])\n{\n  int i;\n  iso9660_dir_t *p_iso9660_dir;\n  iso9660_stat_t *p_iso9660_stat = NULL;\n  iso9660_stat_t *p_stat;\n\n  long int ret;\n  unsigned offset = 0;\n  uint8_t *_dirbuf = NULL;\n  uint32_t blocks;\n  CdioList_t *retval;\n  size_t dirbuf_len;\n  bool skip_following_extents = false;\n\n  if (!p_iso)    return NULL;\n  if (!psz_path) return NULL;\n\n  /* List the virtual El-Torito images */\n  if (p_iso->boot_img[0].lsn != 0) {\n    const char* path = (psz_path[0] == '/') ? &psz_path[1] : psz_path;\n    if (_cdio_strnicmp(path, \"[BOOT]\", 6) == 0 && (path[6] == '\\0' || path[6] == '/')) {\n      retval = _cdio_list_new();\n      for (i = 0; i < MAX_BOOT_IMAGES && p_iso->boot_img[i].lsn != 0; i++) {\n\tp_iso9660_stat = calloc(1, sizeof(iso9660_stat_t) + 18);\n\tif (!p_iso9660_stat) {\n\t  cdio_warn(\"Couldn't calloc(1, %d)\", (int)sizeof(iso9660_stat_t) + 18);\n\t  break;\n\t}\n\tstrcpy(p_iso9660_stat->filename, \"#-Boot-NoEmul.img\");\n\tp_iso9660_stat->filename[0] = '0' + i;\n\tp_iso9660_stat->type = _STAT_FILE;\n\tp_iso9660_stat->lsn = p_iso->boot_img[i].lsn;\n\tp_iso9660_stat->total_size = p_iso->boot_img[i].num_sectors * VIRTUAL_SECTORSIZE;\n\tiso9660_get_ltime(&p_iso->pvd.creation_date, &p_iso9660_stat->tm);\n\t_cdio_list_append(retval, p_iso9660_stat);\n      }\n      return retval;\n    }\n  }\n\n  p_stat = iso9660_ifs_stat (p_iso, psz_path);\n  if (!p_stat)   return NULL;\n\n  if (p_stat->type != _STAT_DIR) {\n    iso9660_stat_free(p_stat);\n    return NULL;\n  }\n\n  /* Check for overflow on 32-bit systems.\n     uint32_t has a limited maximum value, and if p_stat->total_size (the total\n     size of the directory) is very large, the calculation might exceed this limit.\n  */\n\n  if (p_stat->total_size > SIZE_MAX / ISO_BLOCKSIZE) {\n    cdio_warn(\"Total size is too large\");\n    iso9660_stat_free(p_stat);\n    return NULL;\n  }\n\n  blocks = CDIO_EXTENT_BLOCKS(p_stat->total_size);\n  dirbuf_len = blocks * ISO_BLOCKSIZE;\n  retval = _cdio_list_new ();\n\n  /* Add the virtual El-Torito \"[BOOT]\" directory to root */\n  if (p_iso->boot_img[0].lsn != 0) {\n    if (psz_path[0] == '\\0' || (psz_path[0] == '/' && psz_path[1] == '\\0')) {\n      p_iso9660_stat = calloc(1, sizeof(iso9660_stat_t) + 7);\n      if (p_iso9660_stat) {\n\tstrcpy(p_iso9660_stat->filename, \"[BOOT]\");\n\tp_iso9660_stat->type = _STAT_DIR;\n\tp_iso9660_stat->lsn = ISO_PVD_SECTOR + 1;\n\tiso9660_get_ltime(&p_iso->pvd.creation_date, &p_iso9660_stat->tm);\n\t_cdio_list_append(retval, p_iso9660_stat);\n\t p_iso9660_stat = NULL;\n      }\n    }\n  }\n\n  if (!dirbuf_len)\n    {\n      cdio_warn(\"Invalid directory buffer sector size %u\", blocks);\n      iso9660_stat_free(p_stat);\n      _cdio_list_free (retval, true, NULL);\n      return NULL;\n    }\n\n  _dirbuf = calloc(1, dirbuf_len);\n  if (!_dirbuf)\n    {\n      cdio_warn(\"Couldn't calloc(1, %lu)\", (unsigned long)dirbuf_len);\n      iso9660_stat_free(p_stat);\n      _cdio_list_free (retval, true, NULL);\n      return NULL;\n    }\n\n  ret = iso9660_iso_seek_read (p_iso, _dirbuf, p_stat->lsn, blocks);\n  if (ret != dirbuf_len) {\n    _cdio_list_free (retval, true, NULL);\n    iso9660_stat_free(p_stat);\n    free (_dirbuf);\n    return NULL;\n  }\n\n  while (offset < (dirbuf_len))\n    {\n      p_iso9660_dir = (void *) &_dirbuf[offset];\n\n      if (iso9660_check_dir_block_end(p_iso9660_dir, &offset))\n\tcontinue;\n\n      if (skip_following_extents) {\n\t/* Do not register remaining extents of ill file */\n\tp_iso9660_stat = NULL;\n      } else {\n\tp_iso9660_stat = _iso9660_dir_to_statbuf(p_iso9660_dir,\n\t\t\t\t\t\t p_iso9660_stat,\n\t\t\t\t\t\t p_iso,\n\t\t\t\t\t\t p_iso->b_xa,\n\t\t\t\t\t\t p_iso->u_joliet_level);\n\tif (NULL == p_iso9660_stat)\n\t  skip_following_extents = true; /* Start ill file mode */\n\telse if (p_iso9660_stat->rr.u_su_fields & ISO_ROCK_SUF_RE)\n\t  continue; /* Ignore RE entries */\n      }\n      if ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0)\n\tskip_following_extents = false; /* Ill or not: The file ends now */\n      if ((p_iso9660_stat) &&\n\t  ((p_iso9660_dir->file_flags & ISO_MULTIEXTENT) == 0)) {\n\t_cdio_list_append(retval, p_iso9660_stat);\n\tp_iso9660_stat = NULL;\n      }\n\n      offset += iso9660_get_dir_len(p_iso9660_dir);\n    }\n\n  free (_dirbuf);\n  iso9660_stat_free(p_stat);\n  if (offset != dirbuf_len)\n    _cdio_list_free (retval, true, (CdioDataFree_t) iso9660_stat_free);\n  iso9660_stat_free(p_iso9660_stat);\n  return (offset == dirbuf_len) ? retval : NULL;\n}\n\ntypedef CdioISO9660FileList_t * (iso9660_readdir_t)\n  (void *p_image,  const char * psz_path);\n\nCdioISO9660FileList_t *\niso9660_filelist_new(void) {\n  return (CdioISO9660FileList_t *) _cdio_list_new ();\n}\n\nCdioISO9660DirList_t *\niso9660_dirlist_new(void) {\n  return (CdioISO9660FileList_t *) _cdio_list_new ();\n}\n\nstatic iso9660_stat_t *\nfind_lsn_recurse (void *p_image, iso9660_readdir_t iso9660_readdir,\n\t\t  const char psz_path[], lsn_t lsn,\n\t\t  /*out*/ char **ppsz_full_filename)\n{\n  CdioISO9660FileList_t *entlist = iso9660_readdir (p_image, psz_path);\n  CdioISO9660DirList_t *dirlist = iso9660_filelist_new();\n  CdioListNode_t *entnode;\n\n  cdio_assert (entlist != NULL);\n\n  /* iterate over each entry in the directory */\n\n  _CDIO_LIST_FOREACH (entnode, entlist)\n    {\n      iso9660_stat_t *statbuf = _cdio_list_node_data (entnode);\n      const char *psz_filename  = (char *) statbuf->filename;\n      unsigned int len = strlen(psz_path) + strlen(psz_filename)+2;\n\n      if (*ppsz_full_filename != NULL) free(*ppsz_full_filename);\n      *ppsz_full_filename = calloc(1, len);\n      snprintf (*ppsz_full_filename, len, \"%s%s/\", psz_path, psz_filename);\n\n      if (statbuf->type == _STAT_DIR\n          && strcmp ((char *) statbuf->filename, \".\")\n          && strcmp ((char *) statbuf->filename, \"..\")) {\n\tsnprintf (*ppsz_full_filename, len, \"%s%s/\", psz_path, psz_filename);\n        _cdio_list_append (dirlist, strdup(*ppsz_full_filename));\n      }\n\n      if (statbuf->lsn == lsn) {\n\tconst unsigned int len2 = sizeof(iso9660_stat_t) +\n\t\t\t\t  strlen(statbuf->filename) + 1;\n\tiso9660_stat_t *ret_stat = calloc(1, len2);\n\tif (!ret_stat)\n\t  {\n\t    iso9660_dirlist_free(dirlist);\n\t    cdio_warn(\"Couldn't calloc(1, %d)\", len2);\n\t    free(*ppsz_full_filename);\n\t    *ppsz_full_filename = NULL;\n\t    return NULL;\n\t  }\n\tmemcpy(ret_stat, statbuf, len2);\n\tiso9660_filelist_free (entlist);\n\tiso9660_dirlist_free(dirlist);\n\treturn ret_stat;\n      }\n\n    }\n\n  iso9660_filelist_free (entlist);\n\n  /* now recurse/descend over directories encountered */\n\n  _CDIO_LIST_FOREACH (entnode, dirlist)\n    {\n      char *psz_path_prefix = _cdio_list_node_data (entnode);\n      iso9660_stat_t *ret_stat;\n      free(*ppsz_full_filename);\n      *ppsz_full_filename = NULL;\n      ret_stat = find_lsn_recurse (p_image, iso9660_readdir,\n\t\t\t\t   psz_path_prefix, lsn,\n\t\t\t\t   ppsz_full_filename);\n\n      if (NULL != ret_stat) {\n        iso9660_dirlist_free(dirlist);\n        return ret_stat;\n      }\n    }\n\n  if (*ppsz_full_filename != NULL) {\n    free(*ppsz_full_filename);\n    *ppsz_full_filename = NULL;\n  }\n  iso9660_dirlist_free(dirlist);\n  return NULL;\n}\n\n/*!\n   Given a directory pointer, find the filesystem entry that contains\n   lsn and return information about it.\n\n   Returns stat_t of entry if we found lsn, or NULL otherwise.\n */\niso9660_stat_t *\niso9660_fs_find_lsn(CdIo_t *p_cdio, lsn_t i_lsn)\n{\n  char *psz_full_filename = NULL;\n  iso9660_stat_t * p_statbuf;\n  p_statbuf = find_lsn_recurse (p_cdio, (iso9660_readdir_t *) iso9660_fs_readdir,\n\t\t\t\t\"/\", i_lsn, &psz_full_filename);\n  if (psz_full_filename != NULL)\n    free(psz_full_filename);\n  return p_statbuf;\n}\niso9660_stat_t *\n#if defined(__GNUC__) && !defined(__DARWIN_C_ANSI)\niso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn) __attribute__ ((alias (\"iso9660_fs_find_lsn\")));\n#else\niso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn);\n#endif\n\n/*!\n   Given a directory pointer, find the filesystem entry that contains\n   LSN and return information about it.\n\n   @param p_iso the ISO-9660 file image to get data from.\n   @param i_lsn the LSN to find\n   @param ppsz_full_filename the place to store the name of the path that has LSN.\n   On entry this should point to NULL. If not, the value will be freed.\n   On exit a value is malloc'd and the caller is responsible for\n   freeing the result.\n\n   @return stat_t of entry if we found lsn, or NULL otherwise.\n   Caller must free return value using iso9660_stat_free().\n */\niso9660_stat_t *\niso9660_fs_find_lsn_with_path(CdIo_t *p_cdio, lsn_t i_lsn,\n\t\t\t      /*out*/ char **ppsz_full_filename)\n{\n  return find_lsn_recurse (p_cdio, (iso9660_readdir_t *) iso9660_fs_readdir,\n\t\t\t   \"/\", i_lsn, ppsz_full_filename);\n}\n\n/*!\n   Given a directory pointer, find the filesystem entry that contains\n   lsn and return information about it.\n\n   @param p_iso the ISO-9660 file image to get data from.\n\n   @param i_lsn the LSN to find\n\n   @return stat_t of entry if we found lsn, or NULL otherwise.\n   Caller must free return value using iso9660_stat_free().\n */\niso9660_stat_t *\niso9660_ifs_find_lsn(iso9660_t *p_iso, lsn_t i_lsn)\n{\n  char *psz_full_filename = NULL;\n  iso9660_stat_t *ret  =\n    find_lsn_recurse (p_iso, (iso9660_readdir_t *) iso9660_ifs_readdir,\n\t\t      \"/\", i_lsn, &psz_full_filename);\n  if (psz_full_filename != NULL)\n    free(psz_full_filename);\n  return ret;\n}\n\n#ifdef HAVE_ROCK\n/* Some compilers complain if the prototype is not defined */\niso9660_stat_t *\n_iso9660_dd_find_lsn(void* p_image, lsn_t i_lsn);\n\n/* Same as above for Rock Ridge deep directory traversing. */\niso9660_stat_t *\n_iso9660_dd_find_lsn(void* p_image, lsn_t i_lsn)\n{\n  cdio_header_t* p_header = (cdio_header_t*)p_image;\n  char* psz_full_filename = NULL;\n  void* p_image_dd;\n  iso9660_readdir_t* f_readdir;\n  iso9660_stat_t* ret;\n  size_t size;\n\n  switch(p_header->u_type) {\n  case CDIO_HEADER_TYPE_ISO:\n    size = sizeof(iso9660_t);\n    f_readdir = (iso9660_readdir_t*)iso9660_ifs_readdir;\n    break;\n  case CDIO_HEADER_TYPE_CDIO:\n    size = sizeof(CdIo_t);\n    f_readdir = (iso9660_readdir_t*)iso9660_fs_readdir;\n    break;\n  default:\n    cdio_assert(false);\n    return NULL;\n  }\n\n  /* Work with a duplicate to allow concurrency. */\n  p_image_dd = calloc(1, size);\n  if (!p_image_dd) {\n    cdio_warn(\"Memory duplication error\");\n    return NULL;\n  }\n  memcpy(p_image_dd, p_image, size);\n\n  /* Disable the deep directory flag so we can process all entries */\n  p_header = (cdio_header_t*)p_image_dd;\n  p_header->u_flags |= CDIO_HEADER_FLAGS_DISABLE_RR_DD;\n  ret = find_lsn_recurse(p_image_dd, f_readdir, \"/\", i_lsn, &psz_full_filename);\n  if (psz_full_filename != NULL)\n    free(psz_full_filename);\n  free(p_image_dd);\n  return ret;\n}\n#endif /* HAVE ROCK */\n\n/*!\n   Given a directory pointer, find the filesystem entry that contains\n   lsn and return information about it.\n\n   @param p_iso pointer to iso_t\n\n   @param i_lsn LSN to find\n\n   @param ppsz_path  full path of lsn filename. On entry *ppsz_path should be\n   NULL. On return it will be allocated an point to the full path of the\n   file at lsn or NULL if the lsn is not found. You should deallocate\n   *ppsz_path when you are done using it.\n\n   @return stat_t of entry if we found lsn, or NULL otherwise.\n   Caller must free return value using iso9660_stat_free().\n */\niso9660_stat_t *\niso9660_ifs_find_lsn_with_path(iso9660_t *p_iso, lsn_t i_lsn,\n\t\t\t       /*out*/ char **ppsz_full_filename)\n{\n  return find_lsn_recurse (p_iso, (iso9660_readdir_t *) iso9660_ifs_readdir,\n\t\t\t   \"/\", i_lsn, ppsz_full_filename);\n}\n\n/*!\n  Free the passed iso9660_stat_t structure.\n\n  @param p_stat iso9660 stat buffer to free.\n\n */\nvoid\niso9660_stat_free(iso9660_stat_t *p_stat)\n{\n  if (p_stat != NULL) {\n    if (p_stat->rr.psz_symlink) {\n      CDIO_FREE_IF_NOT_NULL(p_stat->rr.psz_symlink);\n    }\n    free(p_stat);\n  }\n}\n\n/*!\n  Free the passed CdioISOC9660FileList_t structure.\n*/\nvoid\niso9660_filelist_free(CdioISO9660FileList_t *p_filelist) {\n  _cdio_list_free(p_filelist, true, (CdioDataFree_t) iso9660_stat_free);\n}\n\n/*!\n  Free the passed CdioISOC9660DirList_t structure.\n*/\nvoid\niso9660_dirlist_free(CdioISO9660DirList_t *p_filelist) {\n  _cdio_list_free(p_filelist, true, free);\n}\n\n\n/*!\n  Return true if ISO 9660 image has extended attributes (XA).\n*/\nbool\niso9660_ifs_is_xa (const iso9660_t * p_iso)\n{\n  if (!p_iso) return false;\n  return yep == p_iso->b_xa;\n}\n\nstatic bool_3way_t\niso_have_rr_traverse (iso9660_t *p_iso, const iso9660_stat_t *_root,\n\t\t      char **splitpath, uint64_t *pu_file_limit)\n{\n  unsigned offset = 0;\n  uint8_t *_dirbuf = NULL;\n  uint32_t blocks;\n  int ret;\n  bool_3way_t have_rr = nope;\n\n  if (!splitpath[0]) return false;\n\n  if (_root->type == _STAT_FILE) return nope;\n  if (*pu_file_limit == 0) return dunno;\n\n  cdio_assert (_root->type == _STAT_DIR);\n\n   blocks = CDIO_EXTENT_BLOCKS(_root->total_size);\n  _dirbuf = calloc(1, blocks * ISO_BLOCKSIZE);\n  if (!_dirbuf)\n    {\n    cdio_warn(\"Couldn't calloc(1, %d)\", blocks * ISO_BLOCKSIZE);\n    return dunno;\n    }\n\n  ret = iso9660_iso_seek_read (p_iso, _dirbuf, _root->lsn, blocks);\n  if (ret != blocks * ISO_BLOCKSIZE) {\n    free(_dirbuf);\n    return false;\n  }\n\n  while (offset < (blocks * ISO_BLOCKSIZE))\n    {\n      iso9660_dir_t *p_iso9660_dir = (void *) &_dirbuf[offset];\n      iso9660_stat_t *p_stat;\n      unsigned int i_last_component = 1;\n\n      if (iso9660_check_dir_block_end(p_iso9660_dir, &offset))\n\tcontinue;\n\n      p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, NULL, p_iso,\n\t\t\t\t\tp_iso->b_xa, p_iso->u_joliet_level);\n      have_rr = p_stat->rr.b3_rock;\n      if ( have_rr != yep) {\n\tif (strlen(splitpath[0]) == 0)\n\t  have_rr = false;\n\telse\n\t  have_rr = iso_have_rr_traverse (p_iso, p_stat, &splitpath[i_last_component],\n\t\t\t\t\t  pu_file_limit);\n      }\n      iso9660_stat_free(p_stat);\n      if (have_rr != nope) {\n\tfree (_dirbuf);\n\treturn have_rr;\n      }\n\n      offset += iso9660_get_dir_len(p_iso9660_dir);\n      *pu_file_limit = (*pu_file_limit)-1;\n      if ((*pu_file_limit) == 0) {\n\tfree (_dirbuf);\n\treturn dunno;\n      }\n    }\n\n  cdio_assert (offset == (blocks * ISO_BLOCKSIZE));\n\n  /* not found */\n  free (_dirbuf);\n  return nope;\n}\n\n/*!\n  Return \"yup\" if any file has Rock-Ridge extensions. Warning: this can\n  be time consuming. On an ISO 9600 image with lots of files but no Rock-Ridge\n  extensions, the entire directory structure will be scanned up to u_file_limit.\n\n  @param p_iso the ISO-9660 file image to get data from\n\n  @param u_file_limit the maximum number of (non-rock-ridge) files\n  to consider before giving up and returning \"dunno\".\n\n  \"dunno\" can also be returned if there was some error encountered\n  such as not being able to allocate memory in processing.\n\n*/\nextern bool_3way_t\niso9660_have_rr(iso9660_t *p_iso, uint64_t u_file_limit)\n{\n  iso9660_stat_t *p_root;\n  char *p_psz_splitpath[2] = {strdup(\"/\"), strdup(\"\")};\n  bool_3way_t is_rr = nope;\n\n  if (!p_iso) return false;\n\n  p_root = _ifs_stat_root (p_iso);\n  if (!p_root) return dunno;\n\n  if (u_file_limit == 0) u_file_limit = UINT64_MAX;\n\n  is_rr = iso_have_rr_traverse (p_iso, p_root, p_psz_splitpath, &u_file_limit);\n  iso9660_stat_free(p_root);\n  free(p_psz_splitpath[0]);\n  free(p_psz_splitpath[1]);\n\n  return is_rr;\n}\n"
  },
  {
    "path": "src/libcdio/iso9660/iso9660_private.h",
    "content": "/*\n  Copyright (C) 2003, 2004, 2005, 2008, 2011, 2012\n  Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n  See also iso9660.h by Eric Youngdale (1993).\n\n  Copyright 1993 Yggdrasil Computing, Incorporated\n  Copyright (c) 1999,2000 J. Schilling\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n#ifndef CDIO_ISO9660_ISO9660_PRIVATE_H_\n#define CDIO_ISO9660_ISO9660_PRIVATE_H_\n\n#if defined(HAVE_CONFIG_H) && !defined(__CDIO_CONFIG_H__)\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#include <cdio/types.h>\n\n#ifdef HAVE_STDBOOL_H\n# include <stdbool.h>\n#endif \n\n#define ISO_VERSION             1\n\nPRAGMA_BEGIN_PACKED\n\ntypedef struct iso_volume_descriptor_s {\n  uint8_t  type;      /**< 7.1.1 */\n  char     id[5];     /**< \"CD001\" (ISO_STANDARD_ID) */\n  uint8_t  version;   /**< 7.1.1 */\n  char     data[2041];\n}  GNUC_PACKED iso_volume_descriptor_t;\n\n#define iso_volume_descriptor_t_SIZEOF ISO_BLOCKSIZE\n\n#define iso9660_pvd_t_SIZEOF ISO_BLOCKSIZE\n\n/*\n * XXX JS: The next structure has an odd length!\n * Some compilers (e.g. on Sun3/mc68020) padd the structures to even length.\n * For this reason, we cannot use sizeof (struct iso_path_table) or\n * sizeof (struct iso_directory_record) to compute on disk sizes.\n * Instead, we use offsetof(..., name) and add the name size.\n * See mkisofs.h\n */\n\n/** We use this to help us look up the parent inode numbers. */\ntypedef struct iso_path_table_s {\n  uint8_t  name_len; /**< 7.1.1 */\n  uint8_t  xa_len;   /**< 7.1.1 */\n  uint32_t extent;   /**< 7.3.1/7.3.2 */\n  uint16_t parent;   /**< 7.2.1/7.2.2 */\n  char     name[EMPTY_ARRAY_SIZE];\n} GNUC_PACKED iso_path_table_t;\n\n#define iso_path_table_t_SIZEOF 8\n\n#define iso9660_dir_t_SIZEOF 33\n\nPRAGMA_END_PACKED\n\n#endif /* CDIO_ISO0660_ISO9660_PRIVATE_H_ */\n\n\f\n/* \n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/iso9660/rock.c",
    "content": "/*\n  Copyright (C) 2020, 2023 Pete Batard <pete@akeo.ie>\n  Copyright (C) 2005, 2008, 2010-2011, 2014, 2017, 2022 Rocky Bernstein\n  <rocky@gnu.org>\n\n  Adapted from GNU/Linux fs/isofs/rock.c (C) 1992, 1993 Eric Youngdale\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/* Rock Ridge Extensions to iso9660 */\n\n\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n\n#ifdef HAVE_STRING_H\n# include <string.h>\n#endif\n\n#ifdef HAVE_STDLIB_H\n# include <stdlib.h>\n#endif\n\n#ifdef HAVE_SYS_STAT_H\n# include <sys/stat.h>\n#endif\n\n#include <cdio/iso9660.h>\n#include <cdio/logging.h>\n#include <cdio/bytesex.h>\n#include \"filemode.h\"\n#include \"cdio_private.h\"\n\n#define CDIO_MKDEV(ma,mi)\t((ma)<<16 | (mi))\n\nenum iso_rock_enums iso_rock_enums;\niso_rock_nm_flag_t iso_rock_nm_flag;\niso_rock_sl_flag_t iso_rock_sl_flag;\niso_rock_tf_flag_t iso_rock_tf_flag;\n\n/* Used by get_rock_ridge_filename() */\nextern iso9660_stat_t*\n_iso9660_dd_find_lsn(void* p_image, lsn_t i_lsn);\n\n/* Our own realloc routine tailored for the iso9660_stat_t symlink\n   field.  I can't figure out how to make realloc() work without\n   valgrind complaint.\n*/\nstatic bool\nrealloc_symlink(/*in/out*/ iso9660_stat_t *p_stat, uint8_t i_grow)\n{\n  if (!p_stat->rr.i_symlink) {\n    const uint16_t i_max = 2*i_grow+1;\n    p_stat->rr.psz_symlink = (char *) calloc(1, i_max);\n    p_stat->rr.i_symlink_max = i_max;\n    return (NULL != p_stat->rr.psz_symlink);\n  } else {\n    unsigned int i_needed = p_stat->rr.i_symlink + i_grow * 2; // Allocate enough space for growth and additional buffer\n    if ( i_needed <= p_stat->rr.i_symlink_max)\n      return true;\n    else {\n      char * psz_newsymlink = (char *) calloc(1, 2*i_needed);\n      if (!psz_newsymlink) return false;\n      p_stat->rr.i_symlink_max = 2*i_needed;\n      memcpy(psz_newsymlink, p_stat->rr.psz_symlink, p_stat->rr.i_symlink);\n      free(p_stat->rr.psz_symlink);\n      p_stat->rr.psz_symlink = psz_newsymlink;\n      return true;\n    }\n  }\n}\n\n/* These functions are designed to read the system areas of a directory record\n * and extract relevant information.  There are different functions provided\n * depending upon what information we need at the time.  One function fills\n * out an inode structure, a second one extracts a filename, a third one\n * returns a symbolic link name, and a fourth one returns the extent number\n * for the file. */\n\n#define SIG(A,B) ((A) | ((B) << 8)) /* isonum_721() */\n\n\n/* This is a way of ensuring that we have something in the system\n   use fields that is compatible with Rock Ridge */\n#define CHECK_SP(FAIL)\t\t\t\t\\\n      if (rr->u.SP.magic[0] != 0xbe) FAIL;\t\\\n      if (rr->u.SP.magic[1] != 0xef) FAIL;\t\\\n      p_stat->rr.s_rock_offset = rr->u.SP.skip;\n/* We define a series of macros because each function must do exactly the\n   same thing in certain places.  We use the macros to ensure that everything\n   is done correctly */\n\n#define CONTINUE_DECLS \\\n  uint32_t cont_extent = 0, cont_offset = 0, cont_size = 0;\t\\\n  uint8_t *buffer = NULL, ce_count = 0\n\n#define CHECK_CE(FAIL)\t\t\t\t\\\n  { cont_extent = from_733(rr->u.CE.extent);\t\\\n    cont_offset = from_733(rr->u.CE.offset);\t\\\n    if (cont_offset >= ISO_BLOCKSIZE) FAIL;\t\\\n    cont_size = from_733(rr->u.CE.size);\t\\\n    if (cont_size >= ISO_BLOCKSIZE) FAIL;\t\\\n  }\n\n#define SETUP_ROCK_RIDGE(DE, CHR, LEN)\t\t\t\t\\\n  {\t\t\t\t\t\t\t\t\\\n    LEN= sizeof(iso9660_dir_t) + DE->filename.len;\t\t\\\n    if (LEN & 1) LEN++;\t\t\t\t\t\t\\\n    CHR = ((unsigned char *) DE) + LEN;\t\t\t\t\\\n    LEN = *((unsigned char *) DE) - LEN;\t\t\t\\\n    if (0xff != p_stat->rr.s_rock_offset)\t\t\t\\\n      {\t\t\t\t\t\t\t\t\\\n\tLEN -= p_stat->rr.s_rock_offset;\t\t\t\\\n\tCHR += p_stat->rr.s_rock_offset;\t\t\t\\\n\tif (LEN<0) LEN=0;\t\t\t\t\t\\\n      }\t\t\t\t\t\t\t\t\\\n  }\n\n/* Copy a long or short time from the iso_rock_tf_t into\n   the specified field of a iso_rock_statbuf_t.\n   non-paramater variables are p_stat, rr, and cnt.\n*/\n#define add_time(FLAG, TIME_FIELD)\t\t\t\t\\\n  if (rr->u.TF.flags & FLAG) {\t\t\t\t\t\\\n    p_stat->rr.TIME_FIELD.b_used = true;\t\t\t\\\n    p_stat->rr.TIME_FIELD.b_longdate =\t\t\t\t\\\n      (0 != (rr->u.TF.flags & ISO_ROCK_TF_LONG_FORM));\t\t\\\n    if (p_stat->rr.TIME_FIELD.b_longdate) {\t\t\t\\\n      memcpy(&(p_stat->rr.TIME_FIELD.t.ltime),\t\t\t\\\n\t     &(rr->u.TF.time_bytes[cnt]),\t\t\t\\\n\t     sizeof(iso9660_ltime_t));\t\t\t\t\\\n      cnt += sizeof(iso9660_ltime_t);\t\t\t\t\\\n    } else {\t\t\t\t\t\t\t\\\n      memcpy(&(p_stat->rr.TIME_FIELD.t.dtime),\t\t\t\\\n\t     &(rr->u.TF.time_bytes[cnt]),\t\t\t\\\n\t     sizeof(iso9660_dtime_t));\t\t\t\t\\\n      cnt += sizeof(iso9660_dtime_t);\t\t\t\t\\\n    }\t\t\t\t\t\t\t\t\\\n  }\n\n/* Indicates if we should process deep directory entries */\nstatic inline bool\nis_rr_dd_enabled(void * p_image) {\n  cdio_header_t* p_header = (cdio_header_t*)p_image;\n  if (!p_header)\n    return false;\n  return !(p_header->u_flags & CDIO_HEADER_FLAGS_DISABLE_RR_DD);\n}\n\n/*!\n  Get\n  @return length of name field; 0: not found, -1: to be ignored\n*/\nint\nget_rock_ridge_filename(iso9660_dir_t * p_iso9660_dir,\n\t\t\t/*in*/ void * p_image,\n\t\t\t/*out*/ char * psz_name,\n\t\t\t/*in/out*/ iso9660_stat_t *p_stat)\n{\n  int len;\n  unsigned char *chr;\n  int symlink_len = 0;\n  CONTINUE_DECLS;\n  int i_namelen = 0;\n  int truncate=0;\n\n  if (!p_stat || nope == p_stat->rr.b3_rock)\n    return 0;\n  *psz_name = 0;\n\n  SETUP_ROCK_RIDGE(p_iso9660_dir, chr, len);\nrepeat:\n  {\n    iso_extension_record_t * rr;\n    int sig;\n    int rootflag;\n\n    // coverity[tainted_data]\n    while (len > 1){ /* There may be one byte for padding somewhere */\n      rr = (iso_extension_record_t *) chr;\n      sig = *chr+(*(chr+1) << 8);\n\n      /* We used to check for some valid values of SIG, specifically\n\t SP, CE, ER, RR, PX, PN, SL, NM, CL, PL, TF, and ZF.\n\t However there are various extensions to this set. So we\n\t skip checking now.\n      */\n\n      if (rr->len == 0)\n\tgoto out; /* Something got screwed up here */\n      chr += rr->len;\n      len -= rr->len;\n\n      switch(sig) {\n      case SIG('S','P'):\n\tCHECK_SP({cdio_warn(\"Invalid Rock Ridge SP field\"); goto out;});\n\tp_stat->rr.u_su_fields |= ISO_ROCK_SUF_SP;\n\tbreak;\n      case SIG('C','E'):\n\t{\n\t  iso711_t i_fname = from_711(p_iso9660_dir->filename.len);\n\t  if ('\\0' == p_iso9660_dir->filename.str[1] && 1 == i_fname)\n\t    break;\n\t  if ('\\1' == p_iso9660_dir->filename.str[1] && 1 == i_fname)\n\t    break;\n\t}\n\tCHECK_CE({cdio_warn(\"Invalid Rock Ridge CE field\"); goto out;});\n\tp_stat->rr.u_su_fields |= ISO_ROCK_SUF_CE;\n\t/* Though no mastering utility in its right mind would produce anything\n\t   like this, the specs make it theoretically possible to have more RR\n\t   extensions after a CE, so we delay the CE block processing for later.\n\t*/\n\tbreak;\n      case SIG('E','R'):\n\tcdio_debug(\"ISO 9660 Extensions: \");\n\t{\n\t  int p;\n\t  for (p=0; p < rr->u.ER.len_id; p++)\n\t    cdio_debug(\"%c\", rr->u.ER.data[p]);\n\t}\n\tbreak;\n      case SIG('N','M'):\n\t/* Alternate name */\n\tp_stat->rr.u_su_fields |= ISO_ROCK_SUF_NM;\n\tif (truncate)\n\t  break;\n\tif (rr->u.NM.flags & ISO_ROCK_NM_PARENT) {\n\t  i_namelen = sizeof(\"..\");\n\t  strncat(psz_name, \"..\", i_namelen);\n\t  break;\n\t} else if (rr->u.NM.flags & ISO_ROCK_NM_CURRENT) {\n\t  i_namelen = sizeof(\".\");\n\t  strncat(psz_name, \".\", i_namelen);\n\t  break;\n\t}\n\n\tif (rr->u.NM.flags & ~1) {\n\t  cdio_info(\"Unsupported NM flag settings (%d)\",rr->u.NM.flags);\n\t  break;\n\t}\n\tif((strlen(psz_name) + rr->len - 5) >= 254) {\n\t  truncate = 1;\n\t  break;\n\t}\n\tstrncat(psz_name, rr->u.NM.name, rr->len - 5);\n\ti_namelen += rr->len - 5;\n\tbreak;\n      case SIG('P','X'):\n\t/* POSIX file attributes */\n\tp_stat->rr.st_mode   = from_733(rr->u.PX.st_mode);\n\tp_stat->rr.st_nlinks = from_733(rr->u.PX.st_nlinks);\n\tp_stat->rr.st_uid    = from_733(rr->u.PX.st_uid);\n\tp_stat->rr.st_gid    = from_733(rr->u.PX.st_gid);\n\tp_stat->rr.u_su_fields |= ISO_ROCK_SUF_PX;\n\tbreak;\n      case SIG('S','L'):\n\t{\n\t  /* Symbolic link */\n\t  uint8_t slen;\n\t  iso_rock_sl_part_t * p_sl;\n\t  iso_rock_sl_part_t * p_oldsl;\n\t  slen = rr->len - 5;\n\t  p_sl = &rr->u.SL.link;\n\t  p_stat->rr.i_symlink = symlink_len;\n\t  p_stat->rr.u_su_fields |= ISO_ROCK_SUF_SL;\n\t  while (slen > 1){\n\t    rootflag = 0;\n\t    switch(p_sl->flags &~1){\n\t    case 0:\n\t      realloc_symlink(p_stat, p_sl->len);\n\t      memcpy(&(p_stat->rr.psz_symlink[p_stat->rr.i_symlink]),\n\t\t     p_sl->text, p_sl->len);\n\t      p_stat->rr.i_symlink += p_sl->len;\n\t      break;\n\t    case 4:\n\t      realloc_symlink(p_stat, 1);\n\t      p_stat->rr.psz_symlink[p_stat->rr.i_symlink++] = '.';\n\t      /* continue into next case. */\n\t    case 2:\n\t      realloc_symlink(p_stat, 1);\n\t      p_stat->rr.psz_symlink[p_stat->rr.i_symlink++] = '.';\n\t      break;\n\t    case 8:\n\t      rootflag = 1;\n\t      realloc_symlink(p_stat, 1);\n\t      p_stat->rr.psz_symlink[p_stat->rr.i_symlink++] = '/';\n\t      break;\n\t    default:\n\t      cdio_warn(\"Symlink component flag not implemented\");\n\t    }\n\t    slen -= p_sl->len + 2;\n\t    p_oldsl = p_sl;\n\t    p_sl = (iso_rock_sl_part_t *) (((char *) p_sl) + p_sl->len + 2);\n\n\t    if (slen < 2) {\n\t      if (((rr->u.SL.flags & 1) != 0) && ((p_oldsl->flags & 1) == 0))\n\t\tp_stat->rr.i_symlink += 1;\n\t      break;\n\t    }\n\n\t    /*\n\t     * If this component record isn't continued, then append a '/'.\n\t     */\n\t    if (!rootflag && (p_oldsl->flags & 1) == 0) {\n\t      realloc_symlink(p_stat, 1);\n\t      p_stat->rr.psz_symlink[p_stat->rr.i_symlink++] = '/';\n\t    }\n\t  }\n\t}\n\tsymlink_len = p_stat->rr.i_symlink;\n\trealloc_symlink(p_stat, 1);\n\tp_stat->rr.psz_symlink[symlink_len]='\\0';\n\tbreak;\n      case SIG('T','F'):\n\t/* Time stamp(s) for a file */\n\t{\n\t  int cnt = 0;\n\t  add_time(ISO_ROCK_TF_CREATE,     create);\n\t  add_time(ISO_ROCK_TF_MODIFY,     modify);\n\t  add_time(ISO_ROCK_TF_ACCESS,     access);\n\t  add_time(ISO_ROCK_TF_ATTRIBUTES, attributes);\n\t  add_time(ISO_ROCK_TF_BACKUP,     backup);\n\t  add_time(ISO_ROCK_TF_EXPIRATION, expiration);\n\t  add_time(ISO_ROCK_TF_EFFECTIVE,  effective);\n\t  p_stat->rr.u_su_fields |= ISO_ROCK_SUF_TF;\n\t  break;\n\t}\n      case SIG('C','L'):\n\t/* Child Link for a deep directory */\n\tif (!is_rr_dd_enabled(p_image))\n\t  break;\n\t{\n\t  iso9660_stat_t* target = NULL;\n\t  p_stat->rr.u_su_fields |= ISO_ROCK_SUF_CL;\n\t  target = _iso9660_dd_find_lsn(p_image, from_733(rr->u.PL.location));\n\t  if (!target) {\n\t    cdio_warn(\"Could not get Rock Ridge deep directory child\");\n\t    break;\n\t  }\n\t  memcpy(p_stat, target, sizeof(iso9660_stat_t));\n\t  /* Prevent the symlink from being freed on the duplicated struct */\n\t  target->rr.psz_symlink = NULL;\n\t  iso9660_stat_free(target);\n\t}\n\tbreak;\n      case SIG('P','L'):\n\t/* Parent link of a deep directory */\n\tif (is_rr_dd_enabled(p_image))\n\t  p_stat->rr.u_su_fields |= ISO_ROCK_SUF_PL;\n\tbreak;\n      case SIG('R','E'):\n\t/* Relocated entry for a deep directory */\n\tif (is_rr_dd_enabled(p_image))\n\t  p_stat->rr.u_su_fields |= ISO_ROCK_SUF_RE;\n\tbreak;\n      case SIG('S','F'):\n\t/* Sparse File */\n\tp_stat->rr.u_su_fields |= ISO_ROCK_SUF_SF;\n\tcdio_warn(\"Rock Ridge Sparse File detected\");\n\tbreak;\n      default:\n\tbreak;\n      }\n    }\n  }\n  /* Process delayed CE blocks */\n  if (cont_size != 0) {\n      free(buffer);\n      buffer = calloc(1, ISO_BLOCKSIZE);\n      if (!buffer)\n\t  goto out;\n      if (iso9660_iso_seek_read(p_image, buffer, cont_extent, 1) != ISO_BLOCKSIZE)\n\t  goto out;\n      chr = &buffer[cont_offset];\n      len = cont_size;\n      cont_size = 0;\n      /* Someone abusing the specs may also be creating looping CEs */\n      if (ce_count++ < 64)\n\t  goto repeat;\n      else\n\t  cdio_warn(\"More than 64 consecutive Rock Ridge CEs detected\");\n  }\n  if (p_stat->rr.u_su_fields & ISO_ROCK_SUF_FORMAL)\n    p_stat->rr.b3_rock = yep;\n  free(buffer);\n  return i_namelen; /* If 0, this file did not have a NM field */\nout:\n  free(buffer);\n  return 0;\n}\n\n#define BUF_COUNT 16\n#define BUF_SIZE sizeof(\"drwxrwxrwx\")\n\n/* Return a pointer to a internal free buffer */\nstatic char *\n_getbuf (void)\n{\n  static char _buf[BUF_COUNT][BUF_SIZE];\n  static int _i = -1;\n\n  _i++;\n  _i %= BUF_COUNT;\n\n  memset (_buf[_i], 0, BUF_SIZE);\n\n  return _buf[_i];\n}\n\n/*!\n  Returns a string which interpreting the POSIX mode st_mode.\n  For example:\n  \\verbatim\n  drwxrws---\n  -rw-rw-r--\n  lrwxrwxrwx\n  \\endverbatim\n\n  A description of the characters in the string follows\n  The 1st character is either \"b\" for a block device,\n  \"c\" for a character device, \"d\" if the entry is a directory, \"l\" for\n  a symbolic link, \"p\" for a pipe or FIFO, \"s\" for a \"socket\",\n  or \"-\" if none of the these.\n\n  The 2nd to 4th characters refer to permissions for a user while the\n  the 5th to 7th characters refer to permissions for a group while, and\n  the 8th to 10h characters refer to permissions for everyone.\n\n  In each of these triplets the first character (2, 5, 8) is \"r\" if\n  the entry is allowed to be read.\n\n  The second character of a triplet (3, 6, 9) is \"w\" if the entry is\n  allowed to be written.\n\n  The third character of a triplet (4, 7, 10) is \"x\" if the entry is\n  executable but not user (for character 4) or group (for characters\n  6) settable and \"s\" if the item has the corresponding user/group set.\n\n  For a directory having an executable property on (\"x\" or \"s\") means\n  the directory is allowed to be listed or \"searched\". If the execute\n  property is not allowed for a group or user but the corresponding\n  group/user is set \"S\" indicates this. If none of these properties\n  holds the \"-\" indicates this.\n*/\nconst char *\niso9660_get_rock_attr_str(posix_mode_t st_mode)\n{\n  char *result = _getbuf();\n\n  if (S_ISBLK(st_mode))\n    result[ 0] = 'b';\n  else if (S_ISDIR(st_mode))\n    result[ 0] = 'd';\n  else if (S_ISCHR(st_mode))\n    result[ 0] = 'c';\n  else if (S_ISLNK(st_mode))\n    result[ 0] = 'l';\n  else if (S_ISFIFO(st_mode))\n    result[ 0] = 'p';\n  else if (S_ISSOCK(st_mode))\n    result[ 0] = 's';\n  /* May eventually fill in others.. */\n  else\n    result[ 0] = '-';\n\n  result[ 1] = (st_mode & ISO_ROCK_IRUSR) ? 'r' : '-';\n  result[ 2] = (st_mode & ISO_ROCK_IWUSR) ? 'w' : '-';\n\n  if (st_mode & ISO_ROCK_ISUID)\n    result[ 3] = (st_mode & ISO_ROCK_IXUSR) ? 's' : 'S';\n  else\n    result[ 3] = (st_mode & ISO_ROCK_IXUSR) ? 'x' : '-';\n\n  result[ 4] = (st_mode & ISO_ROCK_IRGRP) ? 'r' : '-';\n  result[ 5] = (st_mode & ISO_ROCK_IWGRP) ? 'w' : '-';\n\n  if (st_mode & ISO_ROCK_ISGID)\n    result[ 6] = (st_mode & ISO_ROCK_IXGRP) ? 's' : 'S';\n  else\n    result[ 6] = (st_mode & ISO_ROCK_IXGRP) ? 'x' : '-';\n\n  result[ 7] = (st_mode & ISO_ROCK_IROTH) ? 'r' : '-';\n  result[ 8] = (st_mode & ISO_ROCK_IWOTH) ? 'w' : '-';\n  result[ 9] = (st_mode & ISO_ROCK_IXOTH) ? 'x' : '-';\n\n  result[10] = '\\0';\n\n  return result;\n}\n\n/*!\n  Returns POSIX mode bitstring for a given file.\n*/\nmode_t\niso9660_get_posix_filemode_from_rock(const iso_rock_statbuf_t *rr)\n{\n  return (mode_t) rr->st_mode;\n}\n"
  },
  {
    "path": "src/libcdio/iso9660/xa.c",
    "content": "/*\n  Copyright (C) 2003, 2005, 2008, 2011 Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\f\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef HAVE_STRING_H\n#include <string.h>\n#endif\n\n#ifdef HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif\n\n/*! String inside frame which identifies XA attributes.  Note should\n    come *before* public headers which does a #define of\n    this name.\n*/\nconst char ISO_XA_MARKER_STRING[] = {'C', 'D', '-', 'X', 'A', '0', '0', '1'};\n\n/* Public headers */\n#include <cdio/iso9660.h>\n#include <cdio/util.h>\n#include <cdio/bytesex.h>\n\n/* Private headers */\n#include \"cdio_assert.h\"\n#include \"filemode.h\"\n\n/** The below variable is trickery to force enum symbol values to be\n    recorded in debug symbol tables. It is used to allow one to refer\n    to the enumeration value names in the typedefs above in a debugger\n    and debugger expressions.\n*/\nxa_misc_enum_t debugger_xa_misc_enum;\n\n#define BUF_COUNT 16\n#define BUF_SIZE 80\n\n/* Return a pointer to a internal free buffer */\nstatic char *\n_getbuf (void)\n{\n  static char _buf[BUF_COUNT][BUF_SIZE];\n  static int _num = -1;\n  \n  _num++;\n  _num %= BUF_COUNT;\n\n  memset (_buf[_num], 0, BUF_SIZE);\n\n  return _buf[_num];\n}\n\n/*!\n  Returns a string which interpreting the extended attribute xa_attr. \n  For example:\n  \\verbatim\n  d---1xrxrxr\n  ---2--r-r-r\n  -a--1xrxrxr\n  \\endverbatim\n\n  A description of the characters in the string follows\n  The 1st character is either \"d\" if the entry is a directory, or \"-\" if not.\n  The 2nd character is either \"a\" if the entry is CDDA (audio), or \"-\" if not.\n  The 3rd character is either \"i\" if the entry is interleaved, or \"-\" if not.\n  The 4th character is either \"2\" if the entry is mode2 form2 or \"-\" if not.\n  The 5th character is either \"1\" if the entry is mode2 form1 or \"-\" if not.\n   Note that an entry will either be in mode2 form1 or mode form2. That\n   is you will either see \"2-\" or \"-1\" in the 4th & 5th positions.\n\n  The 6th and 7th characters refer to permissions for a user while the\n  the 8th and 9th characters refer to permissions for a group while, and \n  the 10th and 11th characters refer to permissions for a others. \n \n  In each of these pairs the first character (6, 8, 10) is \"x\" if the \n  entry is executable. For a directory this means the directory is\n  allowed to be listed or \"searched\".\n  The second character of a pair (7, 9, 11) is \"r\" if the entry is allowed\n  to be read. \n*/\n\nconst char *\niso9660_get_xa_attr_str (uint16_t xa_attr)\n{\n  char *result = _getbuf();\n\n  xa_attr = uint16_from_be (xa_attr);\n\n  result[ 0] = (xa_attr & XA_ATTR_DIRECTORY) ? 'd' : '-';\n  result[ 1] = (xa_attr & XA_ATTR_CDDA) ? 'a' : '-';\n  result[ 2] = (xa_attr & XA_ATTR_INTERLEAVED) ? 'i' : '-';\n  result[ 3] = (xa_attr & XA_ATTR_MODE2FORM2) ? '2' : '-';\n  result[ 4] = (xa_attr & XA_ATTR_MODE2FORM1) ? '1' : '-';\n\n  result[ 5] = (xa_attr & XA_PERM_XUSR) ? 'x' : '-';\n  result[ 6] = (xa_attr & XA_PERM_RUSR) ? 'r' : '-';\n\n  result[ 7] = (xa_attr & XA_PERM_XGRP) ? 'x' : '-';\n  result[ 8] = (xa_attr & XA_PERM_RGRP) ? 'r' : '-';\n\n  /* Hack alert: wonder if this should be ROTH and XOTH? */\n  result[ 9] = (xa_attr & XA_PERM_XSYS) ? 'x' : '-';\n  result[10] = (xa_attr & XA_PERM_RSYS) ? 'r' : '-';\n\n  result[11] = '\\0';\n\n  return result;\n}\n\niso9660_xa_t *\niso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr, \n\t      uint8_t filenum)\n{\n  cdio_assert (_xa != NULL);\n  \n  _xa->user_id = uint16_to_be (uid);\n  _xa->group_id = uint16_to_be (gid);\n  _xa->attributes = uint16_to_be (attr);\n\n  _xa->signature[0] = 'X';\n  _xa->signature[1] = 'A';\n\n  _xa->filenum = filenum;\n\n  _xa->reserved[0] \n    = _xa->reserved[1] \n    = _xa->reserved[2] \n    = _xa->reserved[3] \n    = _xa->reserved[4] = 0x00;\n\n  return _xa;\n}\n\nvoid\niso9660_xa_free (iso9660_xa_t *_xa)\n{\n  if (_xa != NULL)\n    free(_xa);\n}\n\n/*!\n  Returns POSIX mode bitstring for a given file.\n*/\nposix_mode_t \niso9660_get_posix_filemode_from_xa(uint16_t i_perms) \n{\n  posix_mode_t mode = 0;\n  \n  if (i_perms & XA_PERM_RUSR)  mode |= S_IRUSR;\n  if (i_perms & XA_PERM_XUSR)  mode |= S_IXUSR;\n  \n#ifdef S_IRGRP\n  if (i_perms & XA_PERM_RGRP)  mode |= S_IRGRP;\n#endif\n#ifdef S_IXGRP\n  if (i_perms & XA_PERM_XGRP)  mode |= S_IXGRP;\n#endif\n  \n#ifdef S_IROTH\n  if (i_perms & XA_PERM_ROTH)  mode |= S_IROTH;\n#endif\n#ifdef S_IXOTH\n  if (i_perms & XA_PERM_XOTH)  mode |= S_IXOTH;\n#endif\n  \n  if (i_perms & XA_ATTR_DIRECTORY)  mode |= S_IFDIR;\n  \n  return mode;\n}\n\n"
  },
  {
    "path": "src/libcdio/mmc/mmc_private.h",
    "content": "/* placeholder for unused MMC helper routines. */\n\ntypedef driver_return_code_t (*mmc_run_cmd_fn_t) ( void );\n"
  },
  {
    "path": "src/libcdio/udf/Makefile.am",
    "content": "noinst_LIBRARIES = libudf.a\nlibudf_a_SOURCES = udf.c udf_file.c udf_fs.c udf_time.c filemode.c\n# Boy do you NOT want to have HAVE_CONFIG_H set before $(AM_CFLAGS) with Clang!\nlibudf_a_CFLAGS = $(AM_CFLAGS) -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../driver\n"
  },
  {
    "path": "src/libcdio/udf/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = src/libcdio/udf\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLIBRARIES = $(noinst_LIBRARIES)\nARFLAGS = cru\nAM_V_AR = $(am__v_AR_@AM_V@)\nam__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)\nam__v_AR_0 = @echo \"  AR      \" $@;\nam__v_AR_1 = \nlibudf_a_AR = $(AR) $(ARFLAGS)\nlibudf_a_LIBADD =\nam_libudf_a_OBJECTS = libudf_a-udf.$(OBJEXT) \\\n\tlibudf_a-udf_file.$(OBJEXT) libudf_a-udf_fs.$(OBJEXT) \\\n\tlibudf_a-udf_time.$(OBJEXT) libudf_a-filemode.$(OBJEXT)\nlibudf_a_OBJECTS = $(am_libudf_a_OBJECTS)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp =\nam__depfiles_maybe =\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libudf_a_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LIBRARIES = libudf.a\nlibudf_a_SOURCES = udf.c udf_file.c udf_fs.c udf_time.c filemode.c\n# Boy do you NOT want to have HAVE_CONFIG_H set before $(AM_CFLAGS) with Clang!\nlibudf_a_CFLAGS = $(AM_CFLAGS) -DHAVE_CONFIG_H -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../driver\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/libcdio/udf/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps src/libcdio/udf/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLIBRARIES:\n\t-test -z \"$(noinst_LIBRARIES)\" || rm -f $(noinst_LIBRARIES)\n\nlibudf.a: $(libudf_a_OBJECTS) $(libudf_a_DEPENDENCIES) $(EXTRA_libudf_a_DEPENDENCIES) \n\t$(AM_V_at)-rm -f libudf.a\n\t$(AM_V_AR)$(libudf_a_AR) libudf.a $(libudf_a_OBJECTS) $(libudf_a_LIBADD)\n\t$(AM_V_at)$(RANLIB) libudf.a\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n.c.o:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\nlibudf_a-udf.o: udf.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libudf_a_CFLAGS) $(CFLAGS) -c -o libudf_a-udf.o `test -f 'udf.c' || echo '$(srcdir)/'`udf.c\n\nlibudf_a-udf.obj: udf.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libudf_a_CFLAGS) $(CFLAGS) -c -o libudf_a-udf.obj `if test -f 'udf.c'; then $(CYGPATH_W) 'udf.c'; else $(CYGPATH_W) '$(srcdir)/udf.c'; fi`\n\nlibudf_a-udf_file.o: udf_file.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libudf_a_CFLAGS) $(CFLAGS) -c -o libudf_a-udf_file.o `test -f 'udf_file.c' || echo '$(srcdir)/'`udf_file.c\n\nlibudf_a-udf_file.obj: udf_file.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libudf_a_CFLAGS) $(CFLAGS) -c -o libudf_a-udf_file.obj `if test -f 'udf_file.c'; then $(CYGPATH_W) 'udf_file.c'; else $(CYGPATH_W) '$(srcdir)/udf_file.c'; fi`\n\nlibudf_a-udf_fs.o: udf_fs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libudf_a_CFLAGS) $(CFLAGS) -c -o libudf_a-udf_fs.o `test -f 'udf_fs.c' || echo '$(srcdir)/'`udf_fs.c\n\nlibudf_a-udf_fs.obj: udf_fs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libudf_a_CFLAGS) $(CFLAGS) -c -o libudf_a-udf_fs.obj `if test -f 'udf_fs.c'; then $(CYGPATH_W) 'udf_fs.c'; else $(CYGPATH_W) '$(srcdir)/udf_fs.c'; fi`\n\nlibudf_a-udf_time.o: udf_time.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libudf_a_CFLAGS) $(CFLAGS) -c -o libudf_a-udf_time.o `test -f 'udf_time.c' || echo '$(srcdir)/'`udf_time.c\n\nlibudf_a-udf_time.obj: udf_time.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libudf_a_CFLAGS) $(CFLAGS) -c -o libudf_a-udf_time.obj `if test -f 'udf_time.c'; then $(CYGPATH_W) 'udf_time.c'; else $(CYGPATH_W) '$(srcdir)/udf_time.c'; fi`\n\nlibudf_a-filemode.o: filemode.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libudf_a_CFLAGS) $(CFLAGS) -c -o libudf_a-filemode.o `test -f 'filemode.c' || echo '$(srcdir)/'`filemode.c\n\nlibudf_a-filemode.obj: filemode.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libudf_a_CFLAGS) $(CFLAGS) -c -o libudf_a-filemode.obj `if test -f 'filemode.c'; then $(CYGPATH_W) 'filemode.c'; else $(CYGPATH_W) '$(srcdir)/filemode.c'; fi`\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LIBRARIES)\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \\\n\tdistclean-compile distclean-generic distclean-tags dvi dvi-am \\\n\thtml html-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "src/libcdio/udf/filemode.c",
    "content": "/*\n  filemode.c -- make a string describing file modes\n\n  Copyright (C) 2005, 2008, 2011, 2012 Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 1985, 1990, 1993, 1998-2000 Free Software Foundation, Inc.\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n#if HAVE_CONFIG_H\n# include <config.h>\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef HAVE_SYS_STAT_H\n#include <sys/stat.h>\n#endif \n\n#include <cdio/udf.h>\n#include \"filemode.h\"\n\n\n/* Set the 's' and 't' flags in file attributes string CHARS,\n   according to the file mode BITS.  */\n\nstatic void\nsetst (mode_t bits, char *chars)\n{\n#ifdef S_ISUID\n  if (bits & S_ISUID)\n    {\n      if (chars[3] != 'x')\n\t/* Set-uid, but not executable by owner.  */\n\tchars[3] = 'S';\n      else\n\tchars[3] = 's';\n    }\n#endif\n#ifdef S_ISGID\n  if (bits & S_ISGID)\n    {\n      if (chars[6] != 'x')\n\t/* Set-gid, but not executable by group.  */\n\tchars[6] = 'S';\n      else\n\tchars[6] = 's';\n    }\n#endif\n#ifdef S_ISVTX\n  if (bits & S_ISVTX)\n    {\n      if (chars[9] != 'x')\n\t/* Sticky, but not executable by others.  */\n\tchars[9] = 'T';\n      else\n\tchars[9] = 't';\n    }\n#endif\n}\n\n/* Return a character indicating the type of file described by\n   file mode BITS:\n   'd' for directories\n   'D' for doors\n   'b' for block special files\n   'c' for character special files\n   'n' for network special files\n   'm' for multiplexor files\n   'M' for an off-line (regular) file\n   'l' for symbolic links\n   's' for sockets\n   'p' for fifos\n   'C' for contigous data files\n   '-' for regular files\n   '?' for any other file type.  */\n\nstatic char\nftypelet (mode_t bits)\n{\n#ifdef S_ISBLK\n  if (S_ISBLK (bits))\n    return 'b';\n#endif\n  if (S_ISCHR (bits))\n    return 'c';\n  if (S_ISDIR (bits))\n    return 'd';\n  if (S_ISREG (bits))\n    return '-';\n#ifdef S_ISFIFO\n  if (S_ISFIFO (bits))\n    return 'p';\n#endif\n#ifdef S_ISLNK\n  if (S_ISLNK (bits))\n    return 'l';\n#endif\n#ifdef S_ISSOCK\n  if (S_ISSOCK (bits))\n    return 's';\n#endif\n#ifdef S_ISMPC\n  if (S_ISMPC (bits))\n    return 'm';\n#endif\n#ifdef S_ISNWK\n  if (S_ISNWK (bits))\n    return 'n';\n#endif\n#ifdef S_ISDOOR\n  if (S_ISDOOR (bits))\n    return 'D';\n#endif\n#ifdef S_ISCTG\n  if (S_ISCTG (bits))\n    return 'C';\n#endif\n\n  /* The following two tests are for Cray DMF (Data Migration\n     Facility), which is a HSM file system.  A migrated file has a\n     `st_dm_mode' that is different from the normal `st_mode', so any\n     tests for migrated files should use the former.  */\n\n#ifdef S_ISOFD\n  if (S_ISOFD (bits))\n    /* off line, with data  */\n    return 'M';\n#endif\n#ifdef S_ISOFL\n  /* off line, with no data  */\n  if (S_ISOFL (bits))\n    return 'M';\n#endif\n  return '?';\n}\n\n/*! udf_mode_string - fill in string STR with an ls-style ASCII\n   representation of the st_mode field of file stats block STATP.\n   10 characters are stored in STR; no terminating null is added.\n   The characters stored in STR are:\n\n   0\tFile type.  'd' for directory, 'c' for character\n\tspecial, 'b' for block special, 'm' for multiplex,\n\t'l' for symbolic link, 's' for socket, 'p' for fifo,\n\t'-' for regular, '?' for any other file type\n\n   1\t'r' if the owner may read, '-' otherwise.\n\n   2\t'w' if the owner may write, '-' otherwise.\n\n   3\t'x' if the owner may execute, 's' if the file is\n\tset-user-id, '-' otherwise.\n\t'S' if the file is set-user-id, but the execute\n\tbit isn't set.\n\n   4\t'r' if group members may read, '-' otherwise.\n\n   5\t'w' if group members may write, '-' otherwise.\n\n   6\t'x' if group members may execute, 's' if the file is\n\tset-group-id, '-' otherwise.\n\t'S' if it is set-group-id but not executable.\n\n   7\t'r' if any user may read, '-' otherwise.\n\n   8\t'w' if any user may write, '-' otherwise.\n\n   9\t'x' if any user may execute, 't' if the file is \"sticky\"\n\t(will be retained in swap space after execution), '-'\n\totherwise.\n\t'T' if the file is sticky but not executable.  */\n\nchar *\nudf_mode_string (mode_t i_mode, char *psz_str)\n{\n  psz_str[ 0] = ftypelet (i_mode);\n  psz_str[ 1] = i_mode & S_IRUSR ? 'r' : '-';\n  psz_str[ 2] = i_mode & S_IWUSR ? 'w' : '-';\n  psz_str[ 3] = i_mode & S_IXUSR ? 'x' : '-';\n  psz_str[ 4] = i_mode & S_IRGRP ? 'r' : '-';\n  psz_str[ 5] = i_mode & S_IWGRP ? 'w' : '-';\n  psz_str[ 6] = i_mode & S_IXGRP ? 'x' : '-';\n  psz_str[ 7] = i_mode & S_IROTH ? 'r' : '-';\n  psz_str[ 8] = i_mode & S_IWOTH ? 'w' : '-';\n  psz_str[ 9] = i_mode & S_IXOTH ? 'x' : '-';\n  psz_str[10] = '\\0';\n  setst (i_mode, psz_str);\n  return psz_str;\n}\n"
  },
  {
    "path": "src/libcdio/udf/udf.c",
    "content": "/*\n  Copyright (C) 2005, 2008, 2010, 2012 Rocky Bernstein <rocky@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/* Access routines */\n\n/* udf_private.h has to come first else _FILE_OFFSET_BITS are redefined in\n   say opensolaris. */\n#include \"udf_private.h\"\n#include <cdio/bytesex.h>\n#include \"filemode.h\"\n\n#ifdef HAVE_STRING_H\n# include <string.h>\n#endif\n\n#ifdef HAVE_SYS_STAT_H\n# include <sys/stat.h>\n#endif\n\n/** The below variables are trickery to force enum symbol values to be\n    recorded in debug symbol tables. They are used to allow one to refer\n    to the enumeration value names in the typedefs above in a debugger\n    and debugger expressions\n*/\ntag_id_t                 debug_tagid;\nfile_characteristics_t   debug_file_characteristics;\nicbtag_file_type_enum_t  debug_icbtag_file_type_enum;\nicbtag_flag_enum_t       debug_flag_enum;\necma_167_enum1_t         debug_ecma_167_enum1;\necma_167_timezone_enum_t debug_ecma_167_timezone_enum;\nudf_enum1_t              debug_udf_enum1;\n  \n\n/*!\n  Returns POSIX mode bitstring for a given file.\n*/\nmode_t \nudf_get_posix_filemode(const udf_dirent_t *p_udf_dirent) \n{\n  udf_file_entry_t udf_fe;\n  mode_t mode = 0;\n\n  if (udf_get_file_entry(p_udf_dirent, &udf_fe)) {\n    uint32_t i_perms;\n#ifdef S_ISUID\n    uint16_t i_flags;\n\n    i_flags = uint16_from_le(udf_fe.icb_tag.flags);\n#endif\n    i_perms = uint32_from_le(udf_fe.permissions);\n\n    if (i_perms & FE_PERM_U_READ)  mode |= S_IRUSR;\n    if (i_perms & FE_PERM_U_WRITE) mode |= S_IWUSR;\n    if (i_perms & FE_PERM_U_EXEC)  mode |= S_IXUSR;\n    \n#ifdef S_IRGRP\n    if (i_perms & FE_PERM_G_READ)  mode |= S_IRGRP;\n    if (i_perms & FE_PERM_G_WRITE) mode |= S_IWGRP;\n    if (i_perms & FE_PERM_G_EXEC)  mode |= S_IXGRP;\n#endif\n    \n#ifdef S_IROTH\n    if (i_perms & FE_PERM_O_READ)  mode |= S_IROTH;\n    if (i_perms & FE_PERM_O_WRITE) mode |= S_IWOTH;\n    if (i_perms & FE_PERM_O_EXEC)  mode |= S_IXOTH;\n#endif\n\n    switch (udf_fe.icb_tag.file_type) {\n    case ICBTAG_FILE_TYPE_DIRECTORY: \n      mode |= S_IFDIR;\n      break;\n    case ICBTAG_FILE_TYPE_REGULAR:\n      mode |= S_IFREG;\n      break;\n#ifdef S_IFLNK\n    case ICBTAG_FILE_TYPE_SYMLINK:\n      mode |= S_IFLNK;\n      break;\n#endif\n    case ICBTAG_FILE_TYPE_CHAR:\n      mode |= S_IFCHR;\n      break;\n#ifdef S_IFSOCK\n    case ICBTAG_FILE_TYPE_SOCKET:\n      mode |= S_IFSOCK;\n      break;\n#endif\n    case ICBTAG_FILE_TYPE_BLOCK:\n      mode |= S_IFBLK;\n      break;\n    default: ;\n    };\n  \n#ifdef S_ISUID\n    if (i_flags & ICBTAG_FLAG_SETUID) mode |= S_ISUID;\n    if (i_flags & ICBTAG_FLAG_SETGID) mode |= S_ISGID;\n    if (i_flags & ICBTAG_FLAG_STICKY) mode |= S_ISVTX;\n#endif\n  }\n  \n  return mode;\n  \n}\n\n/*!\n  Return the partition number of the the opened udf handle. -1 \n  Is returned if we have an error.\n*/\nint16_t udf_get_part_number(const udf_t *p_udf)\n{\n  if (!p_udf) return -1;\n  return p_udf->i_partition;\n}\n\n"
  },
  {
    "path": "src/libcdio/udf/udf_file.c",
    "content": "/*\n  Copyright (C) 2005, 2006, 2008, 2010, 2012, 2024 Rocky Bernstein <rocky@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/* Access routines */\n\n/* udf_private.h has to come first else _FILE_OFFSET_BITS are redefined in\n   say opensolaris. */\n#include \"udf_private.h\"\n#include <cdio/bytesex.h>\n#include \"udf_fs.h\"\n\n#ifdef HAVE_STRING_H\n# include <string.h>\n#endif\n\n#ifdef HAVE_STDIO_H\n#include <stdio.h>  /* Remove when adding cdio/logging.h */\n#endif\n\n/* Useful defines */\n\n#define MIN(a, b) (a<b) ? (a) : (b)\n#define CEILING(x, y) ((x+(y-1))/y)\n\n#define\tGETICB(offset)\t\\\n\t&p_udf_fe->u.alloc_descs[offset]\n\nconst char *\nudf_get_filename(const udf_dirent_t *p_udf_dirent)\n{\n  if (!p_udf_dirent) return NULL;\n  if (!p_udf_dirent->psz_name) return \"..\";\n  return p_udf_dirent->psz_name;\n}\n\n/* Copy an UDF File Entry into a Directory Entry structure. */\nbool\nudf_get_file_entry(const udf_dirent_t *p_udf_dirent,\n\t\t   /*out*/ udf_file_entry_t *p_udf_fe)\n{\n  if (!p_udf_dirent) return false;\n  memcpy(p_udf_fe, &p_udf_dirent->fe, sizeof(udf_file_entry_t));\n  return true;\n}\n\n/*!\n  Return the file id descriptor of the given file.\n*/\nbool udf_get_fileid_descriptor(const udf_dirent_t *p_udf_dirent,\n\t\t\t       /*out*/ udf_fileid_desc_t *p_udf_fid)\n{\n\n  if (!p_udf_dirent) return false;\n  if (!p_udf_dirent->fid) {\n    /* FIXME do something about trying to get the descriptor. */\n    return false;\n  }\n  memcpy(p_udf_fid, p_udf_dirent->fid, sizeof(udf_fileid_desc_t));\n  return true;\n}\n\n\n/*!\n  Return the number of hard links of the file. Return 0 if error.\n*/\nuint16_t udf_get_link_count(const udf_dirent_t *p_udf_dirent)\n{\n  if (p_udf_dirent) {\n    return uint16_from_le(p_udf_dirent->fe.link_count);\n  }\n  return 0; /* Error. Non-error case handled above. */\n}\n\n/*!\n  Return the file length the file. Return 2147483647L if error.\n*/\nuint64_t udf_get_file_length(const udf_dirent_t *p_udf_dirent)\n{\n  if (p_udf_dirent) {\n    return uint64_from_le(p_udf_dirent->fe.info_len);\n  }\n  return 2147483647L; /* Error. Non-error case handled above. */\n}\n\n/*!\n  Return true if the file is a directory.\n*/\nbool\nudf_is_dir(const udf_dirent_t *p_udf_dirent)\n{\n  return p_udf_dirent->b_dir;\n}\n\n/*\n * Translate a file offset into a logical block and then into a physical\n * block.\n */\nstatic lba_t\noffset_to_lba(const udf_dirent_t *p_udf_dirent, off_t i_offset,\n\t      /*out*/ lba_t *pi_lba, /*out*/ uint32_t *pi_max_size)\n{\n  udf_t *p_udf = p_udf_dirent->p_udf;\n  const udf_file_entry_t *p_udf_fe = (udf_file_entry_t *)\n    &p_udf_dirent->fe;\n  const udf_icbtag_t *p_icb_tag = &p_udf_fe->icb_tag;\n  const uint16_t strat_type= uint16_from_le(p_icb_tag->strat_type);\n\n  if (i_offset < 0) {\n    cdio_warn(\"Negative offset value\");\n    return CDIO_INVALID_LBA;\n  }\n\n  switch (strat_type) {\n  case 4096:\n    cdio_warn(\"Cannot deal with strategy4096 yet!\");\n    return CDIO_INVALID_LBA;\n    break;\n  case ICBTAG_STRATEGY_TYPE_4:\n    {\n      off_t icblen = 0;\n      uint64_t lsector;\n      int ad_offset, ad_num = 0;\n      uint16_t addr_ilk = uint16_from_le(p_icb_tag->flags&ICBTAG_FLAG_AD_MASK);\n\n      switch (addr_ilk) {\n      case ICBTAG_FLAG_AD_SHORT:\n\t{\n\t  udf_short_ad_t *p_icb;\n\t  /*\n\t   * The allocation descriptor field is filled with short_ad's.\n\t   * If the offset is beyond the current extent, look for the\n\t   * next extent.\n\t   */\n\t  do {\n\t    i_offset -= icblen;\n\t    ad_offset = sizeof(udf_short_ad_t) * ad_num;\n\t    if (ad_offset > uint32_from_le(p_udf_fe->u_alloc_descs)) {\n\t      cdio_warn(\"File offset out of bounds\");\n\t      return CDIO_INVALID_LBA;\n\t    }\n\t    p_icb = (udf_short_ad_t *)\n\t      GETICB( uint32_from_le(p_udf_fe->u_extended_attr)\n\t\t      + ad_offset );\n\t    icblen = p_icb->len;\n\t    ad_num++;\n\t  } while(i_offset >= icblen);\n\n\t  lsector = (i_offset / UDF_BLOCKSIZE) + p_icb->pos;\n\n\t  *pi_max_size = p_icb->len;\n\t}\n\tbreak;\n      case ICBTAG_FLAG_AD_LONG:\n\t{\n\t  /*\n\t   * The allocation descriptor field is filled with long_ad's\n\t   * If the i_offset is beyond the current extent, look for the\n\t   * next extent.\n\t   */\n\t  udf_long_ad_t *p_icb;\n\t  do {\n\t    i_offset -= icblen;\n\t    ad_offset = sizeof(udf_long_ad_t) * ad_num;\n\t    if (ad_offset > uint32_from_le(p_udf_fe->u_alloc_descs)) {\n\t      cdio_warn(\"File offset out of bounds\");\n\t      return CDIO_INVALID_LBA;\n\t    }\n\t    p_icb = (udf_long_ad_t *)\n\t      GETICB( uint32_from_le(p_udf_fe->u_extended_attr)\n\t\t      + ad_offset );\n\t    icblen = p_icb->len;\n\t    ad_num++;\n\t  } while(i_offset >= icblen);\n\n\t  lsector = (i_offset / UDF_BLOCKSIZE) +\n\t    uint32_from_le(((udf_long_ad_t *)(p_icb))->loc.lba);\n\n\t  *pi_max_size = p_icb->len;\n\t}\n\tbreak;\n      case ICBTAG_FLAG_AD_IN_ICB:\n\t/*\n\t * This type means that the file *data* is stored in the\n\t * allocation descriptor field of the file entry.\n\t */\n\t*pi_max_size = 0;\n\tcdio_warn(\"Don't know how to data in ICB handle yet\");\n\treturn CDIO_INVALID_LBA;\n      case ICBTAG_FLAG_AD_EXTENDED:\n\tcdio_warn(\"Don't know how to handle extended addresses yet\");\n\treturn CDIO_INVALID_LBA;\n      default:\n\tcdio_warn(\"Unsupported allocation descriptor %d\", addr_ilk);\n\treturn CDIO_INVALID_LBA;\n      }\n\n      *pi_lba = (lba_t)lsector + p_udf->i_part_start;\n      if (*pi_lba < 0) {\n\tcdio_warn(\"Negative LBA value\");\n\treturn CDIO_INVALID_LBA;\n      }\n      return *pi_lba;\n    }\n  default:\n    cdio_warn(\"Unknown strategy type %d\", strat_type);\n    return DRIVER_OP_ERROR;\n  }\n}\n\n/**\n  Attempts to read up to count bytes from UDF directory entry\n  p_udf_dirent into the buffer starting at buf. buf should be a\n  multiple of UDF_BLOCKSIZE bytes. Reading continues after the point\n  at which we last read or from the beginning the first time.\n\n  If count is zero, read() returns zero and has no other results. If\n  count is greater than SSIZE_MAX, the result is unspecified.\n\n  It is the caller's responsibility to ensure that count is less\n  than the number of blocks recorded via p_udf_dirent.\n\n  If there is an error, cast the result to driver_return_code_t for\n  the specific error code.\n*/\nssize_t\nudf_read_block(const udf_dirent_t *p_udf_dirent, void * buf, size_t count)\n{\n  if (count == 0) return 0;\n  else {\n    driver_return_code_t ret;\n    uint32_t i_max_size=0;\n    udf_t *p_udf = p_udf_dirent->p_udf;\n    lba_t i_lba = offset_to_lba(p_udf_dirent, p_udf->i_position, &i_lba,\n\t\t\t\t&i_max_size);\n    if (i_lba != CDIO_INVALID_LBA) {\n      uint32_t i_max_blocks = CEILING(i_max_size, UDF_BLOCKSIZE);\n      if ( i_max_blocks < count ) {\n\t  cdio_warn(\"read count %u is larger than %u extent size.\",\n\t\t  (unsigned int)count, i_max_blocks);\n\t  cdio_warn(\"read count truncated to %u\", i_max_blocks);\n\t  count = i_max_blocks;\n      }\n      ret = udf_read_sectors(p_udf, buf, i_lba, count);\n      if (DRIVER_OP_SUCCESS == ret) {\n\tssize_t i_read_len = MIN(i_max_size, count * UDF_BLOCKSIZE);\n\tp_udf->i_position += i_read_len;\n\treturn i_read_len;\n      }\n      return ret;\n    } else {\n      return DRIVER_OP_ERROR;\n    }\n  }\n}\n"
  },
  {
    "path": "src/libcdio/udf/udf_fs.c",
    "content": "/*\n  Copyright (C) 2005-2006, 2008, 2011, 2013-2014, 2017, 2024\n  Rocky Bernstein <rocky@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/*\n * Portions copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n\f\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#include <cdio/util.h>\n\n#ifdef HAVE_STDIO_H\n#include <stdio.h>\n#endif\n\n#ifdef HAVE_STRING_H\n# include <string.h>\n#endif\n\n#ifdef HAVE_STDLIB_H\n# include <stdlib.h>\n#endif\n\n/* These definitions are also to make debugging easy. Note that they\n   have to come *before* #include <cdio/ecma_167.h> which sets\n   #defines for these.\n*/\nconst char VSD_STD_ID_BEA01[] = {'B', 'E', 'A', '0', '1'};\nconst char VSD_STD_ID_BOOT2[] = {'B', 'O', 'O', 'T', '2'};\nconst char VSD_STD_ID_CD001[] = {'C', 'D', '0', '0', '1'};\nconst char VSD_STD_ID_CDW01[] = {'C', 'D', 'W', '0', '2'};\nconst char VSD_STD_ID_NSR03[] = {'N', 'S', 'R', '0', '3'};\nconst char VSD_STD_ID_TEA01[] = {'T', 'E', 'A', '0', '1'};\n\n#include <cdio/bytesex.h>\n#include <cdio/utf8.h>\n#include <cdio/util.h>\n\n#include \"udf_private.h\"\n#include \"udf_fs.h\"\n#include \"cdio_assert.h\"\n\n/*\n * The UDF specs are pretty clear on how each data structure is made\n * up, but not very clear on how they relate to each other.  Here is\n * the skinny... This demostrates a filesystem with one file in the\n * root directory.  Subdirectories are treated just as normal files,\n * but they have File Id Descriptors of their children as their file\n * data.  As for the Anchor Volume Descriptor Pointer, it can exist in\n * two of the following three places: sector 256, sector n (the max\n * sector of the disk), or sector n - 256.  It's a pretty good bet\n * that one will exist at sector 256 though.  One caveat is unclosed\n * CD media.  For that, sector 256 cannot be written, so the Anchor\n * Volume Descriptor Pointer can exist at sector 512 until the media\n * is closed.\n *\n *  Sector:\n *     256:\n *       n: Anchor Volume Descriptor Pointer\n * n - 256:\t|\n *\t\t|\n *\t\t|-->Main Volume Descriptor Sequence\n *\t\t\t|\t|\n *\t\t\t|\t|\n *\t\t\t|\t|-->Logical Volume Descriptor\n *\t\t\t|\t\t\t  |\n *\t\t\t|-->Partition Descriptor  |\n *\t\t\t\t|\t\t  |\n *\t\t\t\t|\t\t  |\n *\t\t\t\t|-->Fileset Descriptor\n *\t\t\t\t\t|\n *\t\t\t\t\t|\n *\t\t\t\t\t|-->Root Dir File Entry\n *\t\t\t\t\t\t|\n *\t\t\t\t\t\t|\n *\t\t\t\t\t\t|-->File data:\n *\t\t\t\t\t\t    File Id Descriptor\n *\t\t\t\t\t\t\t|\n *\t\t\t\t\t\t\t|\n *\t\t\t\t\t\t\t|-->File Entry\n *\t\t\t\t\t\t\t\t|\n *\t\t\t\t\t\t\t\t|\n *\t\t\t\t\t\t\t\t|-->File data\n */\n\nstatic udf_dirent_t *\nudf_new_dirent(udf_file_entry_t *p_udf_fe, udf_t *p_udf,\n\t       const char *psz_name, bool b_dir, bool b_parent);\n\n/**\n * Check the descriptor tag for both the correct id and correct checksum.\n * Return zero if all is good, -1 if not.\n */\nint\nudf_checktag(const udf_tag_t *p_tag, udf_Uint16_t tag_id)\n{\n  uint8_t *itag;\n  uint8_t i;\n  uint8_t cksum = 0;\n\n  itag = (uint8_t *)p_tag;\n\n#ifdef WORDS_BIGENDIAN\n  tag_id = UINT16_SWAP_LE_BE(tag_id);\n#endif\n\n  if (p_tag->id != tag_id)\n    return -1;\n\n  for (i = 0; i < 15; i++)\n    cksum = cksum + itag[i];\n  cksum = cksum - itag[4];\n\n  if (cksum == p_tag->cksum)\n    return 0;\n\n  return -1;\n}\n\nbool\nudf_get_lba(const udf_file_entry_t *p_udf_fe,\n\t    /*out*/ uint32_t *start, /*out*/ uint32_t *end)\n{\n  if (! p_udf_fe->u_alloc_descs)\n    return false;\n\n  // check the validity of the u_extended_attr member\n  if (p_udf_fe->u_extended_attr > UINT32_MAX - sizeof(udf_short_ad_t))\n\treturn false;\n\n  switch (p_udf_fe->icb_tag.flags & ICBTAG_FLAG_AD_MASK) {\n  case ICBTAG_FLAG_AD_SHORT:\n    {\n      /* The allocation descriptor field is filled with short_ad's. */\n      udf_short_ad_t *p_ad = (udf_short_ad_t *)\n\t(p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->u_extended_attr));\n\n      *start = uint32_from_le(p_ad->pos);\n      *end = *start +\n\t((uint32_from_le(p_ad->len) & UDF_LENGTH_MASK) - 1) / UDF_BLOCKSIZE;\n      return true;\n    }\n    break;\n  case ICBTAG_FLAG_AD_LONG:\n    {\n      /* The allocation descriptor field is filled with long_ad's */\n      udf_long_ad_t *p_ad = (udf_long_ad_t *)\n\t(p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->u_extended_attr));\n\n      *start = uint32_from_le(p_ad->loc.lba); /* ignore partition number */\n      *end = *start +\n\t((uint32_from_le(p_ad->len) & UDF_LENGTH_MASK) - 1) / UDF_BLOCKSIZE;\n      return true;\n    }\n    break;\n  case ICBTAG_FLAG_AD_EXTENDED:\n    {\n      udf_ext_ad_t *p_ad = (udf_ext_ad_t *)\n\t(p_udf_fe->u.ext_attr + uint32_from_le(p_udf_fe->u_extended_attr));\n\n      *start = uint32_from_le(p_ad->ext_loc.lba); /* ignore partition number */\n      *end = *start +\n\t((uint32_from_le(p_ad->len) & UDF_LENGTH_MASK) - 1) / UDF_BLOCKSIZE;\n      return true;\n    }\n    break;\n  default:\n    return false;\n  }\n  return false;\n}\n\n#define udf_PATH_DELIMITERS \"/\\\\\"\n\n/* Searches p_udf_dirent for a directory entry called psz_token.\n   Note that p_udf_dirent may be replaced or freed during this call\n   and only the returned udf_dirent_t must be used afterwards.\n*/\nstatic\nudf_dirent_t *\nudf_ff_traverse(udf_dirent_t *p_udf_dirent, char *psz_token)\n{\n  while ((p_udf_dirent = udf_readdir(p_udf_dirent))) {\n    if (strcmp(psz_token, p_udf_dirent->psz_name) == 0) {\n      char *next_tok = strtok(NULL, udf_PATH_DELIMITERS);\n\n      if (!next_tok)\n\treturn p_udf_dirent; /* found */\n      else if (p_udf_dirent->b_dir) {\n\tudf_dirent_t * p_udf_dirent_next = udf_opendir(p_udf_dirent);\n\n\tif (p_udf_dirent_next) {\n\t  /* free p_udf_dirent to avoid leaking memory. */\n\t  udf_dirent_free(p_udf_dirent);\n\n\t  /* previous p_udf_dirent_next is freed by udf_ff_traverse. */\n\t  p_udf_dirent_next = udf_ff_traverse(p_udf_dirent_next, next_tok);\n\n\t  return p_udf_dirent_next;\n\t}\n      }\n    }\n  }\n\n  return NULL;\n}\n\n/* FIXME! */\n#define udf_MAX_PATHLEN 2048\n\nudf_dirent_t *\nudf_fopen(udf_dirent_t *p_udf_root, const char *psz_name)\n{\n  udf_dirent_t *p_udf_file = NULL;\n\n  if (p_udf_root) {\n    char tokenline[udf_MAX_PATHLEN];\n    char *psz_token;\n\n    /* file position must be reset when accessing a new file */\n    p_udf_root->p_udf->i_position = 0;\n\n    strncpy(tokenline, psz_name, udf_MAX_PATHLEN-1);\n    tokenline[udf_MAX_PATHLEN-1] = '\\0';\n    psz_token = strtok(tokenline, udf_PATH_DELIMITERS);\n    if (psz_token) {\n      udf_dirent_t *p_udf_dirent =\n\tudf_new_dirent(&p_udf_root->fe, p_udf_root->p_udf,\n\t\t       p_udf_root->psz_name, p_udf_root->b_dir,\n\t\t       p_udf_root->b_parent);\n      p_udf_file = udf_ff_traverse(p_udf_dirent, psz_token);\n    }\n    else if ( 0 == strncmp(\"/\", psz_name, sizeof(\"/\")) ) {\n      return udf_new_dirent(&p_udf_root->fe, p_udf_root->p_udf,\n\t\t\t    p_udf_root->psz_name, p_udf_root->b_dir,\n\t\t\t    p_udf_root->b_parent);\n    }\n  }\n  return p_udf_file;\n}\n\n/* Convert unicode16 to UTF-8.\n   The returned string is allocated and must be freed by the caller\n*/\nstatic char*\nunicode16_decode(const uint8_t *data, unsigned int u_len)\n{\n  int i;\n  char* r = NULL;\n\n  switch (data[0])\n  {\n  case 8:\n    r = (char*)calloc(u_len, 1);\n    if (r == NULL)\n      return r;\n    for (i=0; i<u_len-1; i++)\n      r[i] = data[i+1];\n    return r;\n  case 16:\n    cdio_charset_to_utf8((char*)&data[1], u_len-1, &r, \"UCS-2BE\");\n    return r;\n  default:\n    /* Empty string, as some existing sections can't take a NULL pointer */\n    r = (char*)calloc(1, 1);\n    return r;\n  }\n}\n\n\nstatic udf_dirent_t *\nudf_new_dirent(udf_file_entry_t *p_udf_fe, udf_t *p_udf,\n\t       const char *psz_name, bool b_dir, bool b_parent)\n{\n  udf_dirent_t *p_udf_dirent = (udf_dirent_t *)\n    calloc(1, sizeof(udf_dirent_t));\n  if (!p_udf_dirent) return NULL;\n\n  p_udf_dirent->psz_name     = strdup(psz_name);\n  p_udf_dirent->b_dir        = b_dir;\n  p_udf_dirent->b_parent     = b_parent;\n  p_udf_dirent->p_udf        = p_udf;\n  p_udf_dirent->i_part_start = p_udf->i_part_start;\n  p_udf_dirent->dir_left     = uint64_from_le(p_udf_fe->info_len);\n\n  memcpy(&(p_udf_dirent->fe), p_udf_fe,\n\t sizeof(udf_file_entry_t));\n  udf_get_lba( p_udf_fe, &(p_udf_dirent->i_loc),\n\t       &(p_udf_dirent->i_loc_end) );\n  return p_udf_dirent;\n}\n\n/*!\n  Seek to a position i_start and then read i_blocks. Number of blocks read is\n  returned. One normally expects the return to be equal to i_blocks.\n*/\ndriver_return_code_t\nudf_read_sectors (const udf_t *p_udf, void *ptr, lsn_t i_start,\n\t\t long i_blocks)\n{\n  driver_return_code_t ret;\n  long i_read;\n  off_t i_byte_offset;\n\n  if (!p_udf) return 0;\n  /* Without the cast, i_start * UDF_BLOCKSIZE may be evaluated as 32 bit */\n  i_byte_offset = ((off_t)i_start) * UDF_BLOCKSIZE;\n  /* Since we're using SEEK_SET, the value must be positive */\n  if (i_byte_offset < 0) {\n    if (sizeof(off_t) <= 4)\t/* probably missing LFS */\n      cdio_warn(\"Large File Support is required to access streams of 2 GB or more\");\n    return DRIVER_OP_BAD_PARAMETER;\n  }\n\n  if (p_udf->b_stream) {\n    ret = cdio_stream_seek (p_udf->stream, i_byte_offset, SEEK_SET);\n    if (DRIVER_OP_SUCCESS != ret) return ret;\n    i_read = cdio_stream_read (p_udf->stream, ptr, UDF_BLOCKSIZE, i_blocks);\n    if (i_read) return DRIVER_OP_SUCCESS;\n    return DRIVER_OP_ERROR;\n  } else {\n    return cdio_read_data_sectors(p_udf->cdio, ptr, i_start, UDF_BLOCKSIZE,\n\t\t\t\t  i_blocks);\n  }\n}\n\n/*!\n  Open an UDF for reading. Maybe in the future we will have\n  a mode. NULL is returned on error.\n\n  Caller must free result - use udf_close for that.\n*/\nudf_t *\nudf_open (const char *psz_path)\n{\n  udf_t *p_udf = (udf_t *) calloc(1, sizeof(udf_t)) ;\n  uint8_t data[UDF_BLOCKSIZE];\n\n  if (!p_udf) return NULL;\n\n  /* Sanity check */\n  cdio_assert(sizeof(udf_file_entry_t) == UDF_BLOCKSIZE);\n\n  p_udf->cdio = cdio_open(psz_path, DRIVER_UNKNOWN);\n  if (!p_udf->cdio) {\n    /* Not a CD-ROM drive or CD Image. Maybe it's a UDF file not\n       encapsulated as a CD-ROM Image (e.g. often .UDF or (sic) .ISO)\n    */\n    p_udf->stream = cdio_stdio_new( psz_path );\n    if (!p_udf->stream)\n      goto error;\n    p_udf->b_stream = true;\n  }\n\n  /*\n   * Look for an Anchor Volume Descriptor Pointer at sector 256.\n   */\n  if (DRIVER_OP_SUCCESS != udf_read_sectors (p_udf, &data, 256, 1) )\n    goto error;\n\n  memcpy(&(p_udf->anchor_vol_desc_ptr), &data, sizeof(anchor_vol_desc_ptr_t));\n\n  if (udf_checktag((udf_tag_t *)&(p_udf->anchor_vol_desc_ptr), TAGID_ANCHOR))\n    goto error;\n\n  /*\n   * Then try to find a reference to a Primary Volume Descriptor.\n   */\n  {\n    anchor_vol_desc_ptr_t *p_avdp = &p_udf->anchor_vol_desc_ptr;\n\n    const uint32_t mvds_start =\n      uint32_from_le(p_avdp->main_vol_desc_seq_ext.loc);\n    const uint32_t mvds_end   = mvds_start +\n      (uint32_from_le(p_avdp->main_vol_desc_seq_ext.len) - 1) / UDF_BLOCKSIZE;\n\n    uint32_t i_lba;\n\n    for (i_lba = mvds_start; i_lba < mvds_end; i_lba++) {\n      udf_pvd_t *p_pvd = (udf_pvd_t *) &data;\n\n      if (DRIVER_OP_SUCCESS != udf_read_sectors (p_udf, p_pvd, i_lba, 1) )\n\tgoto error;\n\n      if (!udf_checktag(&p_pvd->tag, TAGID_PRI_VOL)) {\n\tp_udf->pvd_lba = i_lba;\n\tbreak;\n      }\n\n    }\n\n    /*\n     * If we couldn't find a reference, bail out.\n     */\n    if (i_lba == mvds_end)\n      goto error;\n  }\n\n  return p_udf;\n\n error:\n  cdio_stdio_destroy(p_udf->stream);\n  free(p_udf);\n  return NULL;\n}\n\n/**\n * Gets the Volume Identifier, as an UTF-8 string\n * psz_volid, place to put the string\n * i_volid, size of the buffer psz_volid points to\n * returns the size of buffer needed for all data\n * Note: this call accepts a NULL psz_volid, to retrieve the length required.\n */\nint\nudf_get_volume_id(udf_t *p_udf, /*out*/ char *psz_volid, unsigned int i_volid)\n{\n  uint8_t data[UDF_BLOCKSIZE];\n  const udf_pvd_t *p_pvd = (udf_pvd_t *) &data;\n  char* r;\n  unsigned int volid_len;\n\n  /* clear the output to empty string */\n  if (psz_volid != NULL)\n    psz_volid[0] = 0;\n\n  /* get primary volume descriptor */\n  if ( DRIVER_OP_SUCCESS != udf_read_sectors(p_udf, &data, p_udf->pvd_lba, 1) )\n    return 0;\n\n  volid_len = p_pvd->vol_ident[UDF_VOLID_SIZE-1];\n  if(volid_len > UDF_VOLID_SIZE-1) {\n    /* this field is only UDF_VOLID_SIZE bytes something is wrong */\n    volid_len = UDF_VOLID_SIZE-1;\n  }\n\n  r = unicode16_decode((uint8_t *) p_pvd->vol_ident, volid_len);\n  if (r == NULL)\n    return 0;\n\n  volid_len = strlen(r)+1;     /* +1 for NUL terminator */\n  if (psz_volid != NULL) {\n    strncpy(psz_volid, r, i_volid);\n    psz_volid[i_volid-1] = 0;  /* strncpy does not always terminate the dest */\n  }\n  free(r);\n\n  return volid_len;\n}\n\n/**\n * Gets the Volume Set Identifier, as a 128-byte dstring (not decoded)\n * WARNING This is not a null terminated string\n * volsetid, place to put the data\n * i_volsetid, size of the buffer psz_volsetid points to\n * the buffer should be >=128 bytes to store the whole volumesetidentifier\n * returns the size of the available volsetid information (128)\n * or 0 on error\n */\nint\nudf_get_volumeset_id(udf_t *p_udf, /*out*/ uint8_t *volsetid,\n\t\t     unsigned int i_volsetid)\n{\n  uint8_t data[UDF_BLOCKSIZE];\n  const udf_pvd_t *p_pvd = (udf_pvd_t *) &data;\n\n  /* get primary volume descriptor */\n  if ( DRIVER_OP_SUCCESS != udf_read_sectors(p_udf, &data, p_udf->pvd_lba, 1) )\n    return 0;\n\n  if (i_volsetid > UDF_VOLSET_ID_SIZE) {\n    i_volsetid = UDF_VOLSET_ID_SIZE;\n  }\n\n  memcpy(volsetid, p_pvd->volset_id, i_volsetid);\n\n  return UDF_VOLSET_ID_SIZE;\n}\n\n/**\n * Gets the Logical Volume Identifier string, as an UTF-8 string\n * psz_logvolid, place to put the string (should be at least 64 bytes)\n * i_logvolid, size of the buffer psz_logvolid points to\n * returns the size of buffer needed for all data, including NUL terminator\n * A call to udf_get_root() should have been issued before this call\n * Note: this call accepts a NULL psz_volid, to retrieve the length required.\n */\nint\nudf_get_logical_volume_id(udf_t *p_udf, /*out*/ char *psz_logvolid, unsigned int i_logvolid)\n{\n  uint8_t data[UDF_BLOCKSIZE];\n  logical_vol_desc_t *p_logvol = (logical_vol_desc_t *) &data;\n  char* r;\n  int logvolid_len;\n\n  /* clear the output to empty string */\n  if (psz_logvolid != NULL)\n    psz_logvolid[0] = 0;\n\n  if (DRIVER_OP_SUCCESS != udf_read_sectors (p_udf, p_logvol, p_udf->lvd_lba, 1) )\n    return 0;\n\n  r = unicode16_decode((uint8_t *) p_logvol->logvol_id, p_logvol->logvol_id[127]);\n  if (r == NULL)\n    return 0;\n\n  logvolid_len = strlen(r)+1;  /* +1 for NUL terminator */\n  if (psz_logvolid != NULL) {\n    strncpy(psz_logvolid, r, i_logvolid);\n    psz_logvolid[i_logvolid-1] = 0;    /* strncpy does not always terminate the dest */\n  }\n  free(r);\n\n  return logvolid_len;\n}\n\n/*!\n  Get the root in p_udf. If b_any_partition is false then\n  the root must be in the given partition.\n  NULL is returned if the partition is not found or a root is not found or\n  there is on error.\n\n  Caller must free result - use udf_dirent_free for that.\n*/\nudf_dirent_t *\nudf_get_root (udf_t *p_udf, bool b_any_partition, partition_num_t i_partition)\n{\n  const anchor_vol_desc_ptr_t *p_avdp = &p_udf->anchor_vol_desc_ptr;\n  const uint32_t mvds_start =\n    uint32_from_le(p_avdp->main_vol_desc_seq_ext.loc);\n  const uint32_t mvds_end   = mvds_start +\n    (uint32_from_le(p_avdp->main_vol_desc_seq_ext.len) - 1) / UDF_BLOCKSIZE;\n  uint32_t i_lba;\n  uint8_t data[UDF_BLOCKSIZE];\n\n  /*\n     Now we have the joy of finding the Partition Descriptor and the\n     Logical Volume Descriptor for the Main Volume Descriptor\n     Sequence. Once we've got that, we use the Logical Volume\n     Descriptor to get a Fileset Descriptor and that has the Root\n     Directory File Entry.\n  */\n  for (i_lba = mvds_start; i_lba < mvds_end; i_lba++) {\n    uint8_t data2[UDF_BLOCKSIZE];\n\n    partition_desc_t *p_partition = (partition_desc_t *) &data2;\n\n    if (DRIVER_OP_SUCCESS != udf_read_sectors (p_udf, p_partition, i_lba, 1) )\n      return NULL;\n\n    if (!udf_checktag(&p_partition->tag, TAGID_PARTITION)) {\n      const partition_num_t i_partition_check\n\t= uint16_from_le(p_partition->number);\n      if (b_any_partition || i_partition_check == i_partition) {\n\t/* Squirrel away some data regarding partition */\n\tp_udf->i_partition = uint16_from_le(p_partition->number);\n\tp_udf->i_part_start = uint32_from_le(p_partition->start_loc);\n\tif (p_udf->lvd_lba) break;\n      }\n    } else if (!udf_checktag(&p_partition->tag, TAGID_LOGVOL)) {\n      /* Get fileset descriptor */\n      logical_vol_desc_t *p_logvol = (logical_vol_desc_t *) &data2;\n      bool b_valid =\n\tUDF_BLOCKSIZE == uint32_from_le(p_logvol->logical_blocksize);\n\n      if (b_valid) {\n\tp_udf->lvd_lba = i_lba;\n\tp_udf->fsd_offset =\n\t  uint32_from_le(p_logvol->lvd_use.fsd_loc.loc.lba);\n\tif (p_udf->i_part_start) break;\n      }\n    }\n  }\n  if (p_udf->lvd_lba && p_udf->i_part_start) {\n    udf_fsd_t *p_fsd = (udf_fsd_t *) &data;\n\n    driver_return_code_t ret =\n      udf_read_sectors(p_udf, p_fsd, p_udf->i_part_start + p_udf->fsd_offset,\n\t\t       1);\n\n    if (DRIVER_OP_SUCCESS == ret && !udf_checktag(&p_fsd->tag, TAGID_FSD)) {\n      udf_file_entry_t *p_udf_fe = (udf_file_entry_t *) &data;\n      const uint32_t parent_icb = uint32_from_le(p_fsd->root_icb.loc.lba);\n\n      /* Check partition numbers match of last-read block?  */\n\n      ret = udf_read_sectors(p_udf, p_udf_fe,\n\t\t\t     p_udf->i_part_start + parent_icb, 1);\n      if (ret == DRIVER_OP_SUCCESS &&\n\t  !udf_checktag(&p_udf_fe->tag, TAGID_FILE_ENTRY)) {\n\n\t/* Check partition numbers match of last-read block? */\n\n\t/* We win! - Save root directory information. */\n\treturn udf_new_dirent(p_udf_fe, p_udf, \"/\", true, false );\n      }\n    }\n  }\n\n  return NULL;\n}\n\n#define free_and_null(x) \\\n  CDIO_FREE_IF_NOT_NULL(x); \\\n  x=NULL\n\n/*!\n  Close UDF and free resources associated with p_udf.\n*/\nbool\nudf_close (udf_t *p_udf)\n{\n  if (!p_udf) return true;\n  if (p_udf->b_stream) {\n    cdio_stdio_destroy(p_udf->stream);\n  } else {\n    cdio_destroy(p_udf->cdio);\n  }\n\n  /* Get rid of root directory if allocated. */\n\n  free_and_null(p_udf);\n  return true;\n}\n\nudf_dirent_t *\nudf_opendir(const udf_dirent_t *p_udf_dirent)\n{\n  if (p_udf_dirent->b_dir && !p_udf_dirent->b_parent && p_udf_dirent->fid) {\n    udf_t *p_udf = p_udf_dirent->p_udf;\n    udf_file_entry_t udf_fe;\n\n    driver_return_code_t i_ret =\n      udf_read_sectors(p_udf, &udf_fe, p_udf->i_part_start\n\t\t       + p_udf_dirent->fid->icb.loc.lba, 1);\n\n    if (DRIVER_OP_SUCCESS == i_ret\n\t&& !udf_checktag(&udf_fe.tag, TAGID_FILE_ENTRY)) {\n\n      if (ICBTAG_FILE_TYPE_DIRECTORY == udf_fe.icb_tag.file_type) {\n\tudf_dirent_t *p_udf_dirent_new =\n\t  udf_new_dirent(&udf_fe, p_udf, p_udf_dirent->psz_name, true, true);\n\treturn p_udf_dirent_new;\n      }\n    }\n  }\n  return NULL;\n}\n\nudf_dirent_t *\nudf_readdir(udf_dirent_t *p_udf_dirent)\n{\n  udf_t *p_udf;\n  uint8_t* p;\n\n  if (p_udf_dirent->dir_left <= 0) {\n    udf_dirent_free(p_udf_dirent);\n    return NULL;\n  }\n\n  /* file position must be reset when accessing a new file */\n  p_udf = p_udf_dirent->p_udf;\n  p_udf->i_position = 0;\n\n  if (p_udf_dirent->fid) {\n    /* advance to next File Identifier Descriptor */\n    /* FIXME: need to advance file entry (fe) as well.  */\n    uint32_t ofs = 4 *\n      ((sizeof(*(p_udf_dirent->fid)) + p_udf_dirent->fid->u.i_imp_use\n\t+ p_udf_dirent->fid->i_file_id + 3) / 4);\n\n    p_udf_dirent->fid =\n      (udf_fileid_desc_t *)((uint8_t *)p_udf_dirent->fid + ofs);\n  }\n\n  if (!p_udf_dirent->fid) {\n    uint32_t i_sectors =\n      (p_udf_dirent->i_loc_end - p_udf_dirent->i_loc + 1);\n    uint32_t size = UDF_BLOCKSIZE * i_sectors;\n    driver_return_code_t i_ret;\n\n    if (!p_udf_dirent->sector)\n      p_udf_dirent->sector = (uint8_t*) malloc(size);\n    i_ret = udf_read_sectors(p_udf, p_udf_dirent->sector,\n\t\t\t     p_udf_dirent->i_part_start+p_udf_dirent->i_loc,\n\t\t\t     i_sectors);\n    if (DRIVER_OP_SUCCESS == i_ret)\n      p_udf_dirent->fid = (udf_fileid_desc_t *) p_udf_dirent->sector;\n    else\n      p_udf_dirent->fid = NULL;\n  }\n\n  if (p_udf_dirent->fid && !udf_checktag(&(p_udf_dirent->fid->tag), TAGID_FID))\n    {\n      uint32_t ofs =\n\t4 * ((sizeof(*p_udf_dirent->fid) + p_udf_dirent->fid->u.i_imp_use\n\t      + p_udf_dirent->fid->i_file_id + 3) / 4);\n\n      p_udf_dirent->dir_left -= ofs;\n      p_udf_dirent->b_dir =\n\t(p_udf_dirent->fid->file_characteristics & UDF_FILE_DIRECTORY) != 0;\n      p_udf_dirent->b_parent =\n\t(p_udf_dirent->fid->file_characteristics & UDF_FILE_PARENT) != 0;\n\n      {\n\tconst unsigned int u_len = p_udf_dirent->fid->i_file_id;\n\n\tif (DRIVER_OP_SUCCESS != udf_read_sectors(p_udf, &p_udf_dirent->fe, p_udf->i_part_start\n\t\t\t + uint32_from_le(p_udf_dirent->fid->icb.loc.lba), 1)) {\n\t\tudf_dirent_free(p_udf_dirent);\n\t\treturn NULL;\n\t}\n\n       free_and_null(p_udf_dirent->psz_name);\n       p = (uint8_t*)p_udf_dirent->fid->u.imp_use.data + p_udf_dirent->fid->u.i_imp_use;\n       // coverity[tainted_data]\n       p_udf_dirent->psz_name = unicode16_decode(p, u_len);\n      }\n      return p_udf_dirent;\n    }\n  udf_dirent_free(p_udf_dirent);\n  return NULL;\n}\n\n/*!\n  free free resources associated with p_udf_dirent.\n*/\nbool\nudf_dirent_free(udf_dirent_t *p_udf_dirent)\n{\n  if (p_udf_dirent) {\n    p_udf_dirent->fid = NULL;\n    free_and_null(p_udf_dirent->psz_name);\n    free_and_null(p_udf_dirent->sector);\n    free_and_null(p_udf_dirent);\n  }\n  return true;\n}\n\n/**\n * Seek to a specific offset in a UDF file.\n * The offset *must* be a multiple of UDF_BLOCKSIZE.\n * Returns true if the position was successfully changed, or false on\n * any error condition (such as offset out of range or not aligned to\n * UDF_BLOCKSIZE).\n */\nbool\nudf_setpos(udf_dirent_t* p_udf_dirent, off_t offset)\n{\n    if (!p_udf_dirent)\n\treturn false;\n    if (offset % UDF_BLOCKSIZE || offset < 0 || offset > uint64_from_le(p_udf_dirent->fe.info_len))\n\treturn false;\n    p_udf_dirent->p_udf->i_position = offset;\n    return true;\n}\n"
  },
  {
    "path": "src/libcdio/udf/udf_fs.h",
    "content": "/*\n  Copyright (C) 2006, 2008, 2012 Rocky Bernstein <rockyb@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n#ifndef CDIO_UDF_UDF_FS_H_\n#define CDIO_UDF_UDF_FS_H_\n\n#include <cdio/ecma_167.h>\n/**\n * Check the descriptor tag for both the correct id and correct checksum.\n * Return zero if all is good, -1 if not.\n */\nint udf_checktag(const udf_tag_t *p_tag, udf_Uint16_t tag_id);\n\n#endif /* CDIO_UDF_UDF_FS_H_ */\n\n\f\n/* \n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/udf/udf_private.h",
    "content": "/*\n  Copyright (C) 2005, 2006, 2008, 2011, 2012 Rocky Bernstein <rocky@gnu.org>\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n#ifndef CDIO_UDF_UDF_PRIVATE_H_\n#define CDIO_UDF_UDF_PRIVATE_H_\n\n#if defined(HAVE_CONFIG_H) && !defined(LIBCDIO_CONFIG_H) && !defined(__CDIO_CONFIG_H__)\n# include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef HAVE_STDBOOL_H\n# include <stdbool.h>\n#endif \n\n#include <cdio/types.h>\n#include <cdio/ecma_167.h>\n#include <cdio/udf.h>\n#include \"_cdio_stdio.h\"\n\n/* Implementation of opaque types */\n\nstruct udf_s {\n  bool                  b_stream;     /* Use stream pointer, else use p_cdio */\n  off_t                 i_position;   /* Position in file if positive */\n  CdioDataSource_t      *stream;      /* Stream pointer if stream */\n  CdIo_t                *cdio;        /* Cdio pointer if read device */\n  anchor_vol_desc_ptr_t anchor_vol_desc_ptr;\n  uint32_t              pvd_lba;      /* sector of Primary Volume Descriptor */\n  partition_num_t       i_partition;  /* partition number */\n  uint32_t              i_part_start; /* start of Partition Descriptor */\n  uint32_t              lvd_lba;      /* sector of Logical Volume Descriptor */\n  uint32_t              fsd_offset;   /* lba of fileset descriptor */\n};\n\n#endif /* CDIO_UDF_UDF_PRIVATE_H_ */\n\n\f\n/* \n * Local variables:\n *  c-file-style: \"gnu\"\n *  tab-width: 8\n *  indent-tabs-mode: nil\n * End:\n */\n"
  },
  {
    "path": "src/libcdio/udf/udf_time.c",
    "content": "/* \n  Copyright (C) 2005, 2008, 2011 Rocky Bernstein <rocky@gnu.org>\n  Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.\n\n  Modified From part of the GNU C Library.\n  Contributed by Paul Eggert.\n\n  This program is free software: you can redistribute it and/or modify\n  it under the terms of the GNU General Public License as published by\n  the Free Software Foundation, either version 3 of the License, or\n  (at your option) any later version.\n\n  This program is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU General Public License\n  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/* Some history from the GNU/Linux kernel from which this is also taken...\n   dgb 10/02/98: ripped this from glibc source to help convert\n                 timestamps to unix time\n\n       10/04/98: added new table-based lookup after seeing how ugly the\n                 gnu code is\n  \n   blf 09/27/99: ripped out all the old code and inserted new table from\n                 John Brockmeyer (without leap second corrections)\n                 rewrote udf_stamp_to_time and fixed timezone\n                 accounting in udf_timespec_to_stamp.\n*/\n\n/*\n * We don't take into account leap seconds. This may be correct or incorrect.\n * For more NIST information (especially dealing with leap seconds), see:\n *  http://www.boulder.nist.gov/timefreq/pubs/bulletin/leapsecond.htm\n */\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n# define __CDIO_CONFIG_H__ 1\n#endif\n\n#ifdef NEED_TIMEZONEVAR\n#define timezonevar 1\n#endif\n\n#include \"udf_private.h\"\n#include <cdio/udf.h>\n\n/**\n   Imagine the below enum values as #define'd or constant values\n   rather than distinct values of an enum.\n*/\nenum {\n  HOURS_PER_DAY    =   24,\n  SECS_PER_MINUTE  =   60,\n  MAX_YEAR_SECONDS =   69,\n  DAYS_PER_YEAR    =  365,  /* That is, in most of the years. */\n  EPOCH_YEAR       = 1970,\n  SECS_PER_HOUR\t   = (60 * SECS_PER_MINUTE),\n  SECS_PER_DAY\t   = SECS_PER_HOUR * HOURS_PER_DAY\n} debug_udf_time_enum;\n  \n#ifndef __isleap\n/* Nonzero if YEAR is a leap year (every 4 years,\n   except every 100th isn't, and every 400th is).  */\n#define\t__isleap(year)\t\\\n  ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))\n#endif\n\n/* How many days come before each month (0-12).  */\nstatic const unsigned short int __mon_yday[2][13] =\n  {\n    /* Normal years.  */\n    { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, DAYS_PER_YEAR },\n    /* Leap years.  */\n    { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, DAYS_PER_YEAR+1 }\n  };\n\n#define SPY(y,l,s) (SECS_PER_DAY * (DAYS_PER_YEAR*y+l)+s) /* Seconds per year */\n\nstatic time_t year_seconds[MAX_YEAR_SECONDS]= {\n  /*1970*/ SPY( 0, 0,0), SPY( 1, 0,0), SPY( 2, 0,0), SPY( 3, 1,0), \n  /*1974*/ SPY( 4, 1,0), SPY( 5, 1,0), SPY( 6, 1,0), SPY( 7, 2,0), \n  /*1978*/ SPY( 8, 2,0), SPY( 9, 2,0), SPY(10, 2,0), SPY(11, 3,0), \n  /*1982*/ SPY(12, 3,0), SPY(13, 3,0), SPY(14, 3,0), SPY(15, 4,0), \n  /*1986*/ SPY(16, 4,0), SPY(17, 4,0), SPY(18, 4,0), SPY(19, 5,0), \n  /*1990*/ SPY(20, 5,0), SPY(21, 5,0), SPY(22, 5,0), SPY(23, 6,0), \n  /*1994*/ SPY(24, 6,0), SPY(25, 6,0), SPY(26, 6,0), SPY(27, 7,0), \n  /*1998*/ SPY(28, 7,0), SPY(29, 7,0), SPY(30, 7,0), SPY(31, 8,0), \n  /*2002*/ SPY(32, 8,0), SPY(33, 8,0), SPY(34, 8,0), SPY(35, 9,0), \n  /*2006*/ SPY(36, 9,0), SPY(37, 9,0), SPY(38, 9,0), SPY(39,10,0), \n  /*2010*/ SPY(40,10,0), SPY(41,10,0), SPY(42,10,0), SPY(43,11,0), \n  /*2014*/ SPY(44,11,0), SPY(45,11,0), SPY(46,11,0), SPY(47,12,0), \n  /*2018*/ SPY(48,12,0), SPY(49,12,0), SPY(50,12,0), SPY(51,13,0), \n  /*2022*/ SPY(52,13,0), SPY(53,13,0), SPY(54,13,0), SPY(55,14,0), \n  /*2026*/ SPY(56,14,0), SPY(57,14,0), SPY(58,14,0), SPY(59,15,0), \n  /*2030*/ SPY(60,15,0), SPY(61,15,0), SPY(62,15,0), SPY(63,16,0), \n  /*2034*/ SPY(64,16,0), SPY(65,16,0), SPY(66,16,0), SPY(67,17,0), \n  /*2038*/ SPY(68,17,0)\n};\n\n#if defined(HAVE_TIMEZONE_VAR) && !defined(_WIN32)\nextern long timezone;\n#endif\n\ntime_t *\nudf_stamp_to_time(time_t *dest, long int *dest_usec, \n\t\t  const udf_timestamp_t src)\n{\n  int yday;\n  uint8_t type = src.type_tz >> 12;\n  int16_t offset;\n  \n  if (type == 1) {\n    offset = src.type_tz << 4;\n    /* sign extent offset */\n    offset = (offset >> 4);\n    if (offset == -2047) /* unspecified offset */\n      offset = 0;\n  }\n  else\n    offset = 0;\n  \n  if ((src.year < EPOCH_YEAR) ||\n      (src.year >= EPOCH_YEAR+MAX_YEAR_SECONDS))\n    {\n      *dest = -1;\n      *dest_usec = -1;\n      return NULL;\n    }\n  *dest = year_seconds[src.year - EPOCH_YEAR];\n  *dest -= offset * SECS_PER_MINUTE;\n  \n  yday = ((__mon_yday[__isleap (src.year)]\n\t   [src.month-1]) + (src.day-1));\n  *dest += src.second + \n    ( SECS_PER_MINUTE *\n      ( ( (yday* HOURS_PER_DAY) + src.hour ) * 60 + src.minute ) );\n\n  *dest_usec = src.microseconds\n    + (src.centiseconds * 10000)\n    + (src.hundreds_of_microseconds * 100);\n  return dest;\n}\n\n#ifdef HAVE_STRUCT_TIMESPEC\n/*!\n  Convert a UDF timestamp to a time_t. If microseconds are desired,\n  use dest_usec. The return value is the same as dest. */\nudf_timestamp_t *\nudf_timespec_to_stamp(const struct timespec ts, udf_timestamp_t *dest)\n{\n  long int days, rem, y;\n  const unsigned short int *ip;\n  int16_t offset = 0;\n  int16_t tv_sec;\n\n#ifdef HAVE_TIMEZONE_VAR  \n  offset = -timezone;\n#endif\n  \n  if (!dest)\n    return dest;\n  \n  dest->type_tz = 0x1000 | (offset & 0x0FFF);\n  \n  tv_sec       = ts.tv_sec + (offset * SECS_PER_MINUTE);\n  days         = tv_sec / SECS_PER_DAY;\n  rem          = tv_sec % SECS_PER_DAY;\n  dest->hour   = rem / SECS_PER_HOUR;\n  rem         %= SECS_PER_HOUR;\n  dest->minute = rem / SECS_PER_MINUTE;\n  dest->second = rem % SECS_PER_MINUTE;\n  y            = EPOCH_YEAR;\n  \n#define DIV(a,b) ((a) / (b) - ((a) % (b) < 0))\n#define LEAPS_THRU_END_OF(y) (DIV (y, 4) - DIV (y, 100) + DIV (y, 400))\n  \n  while (days < 0 || days >= (__isleap(y) ? DAYS_PER_YEAR+1 : DAYS_PER_YEAR)) {\n    long int yg = y + days / DAYS_PER_YEAR - (days % DAYS_PER_YEAR < 0);\n    \n    /* Adjust DAYS and Y to match the guessed year.  */\n    days -= ((yg - y) * DAYS_PER_YEAR\n\t     + LEAPS_THRU_END_OF (yg - 1)\n\t     - LEAPS_THRU_END_OF (y - 1));\n    y = yg;\n  }\n  dest->year = y;\n  ip = __mon_yday[__isleap(y)];\n  for (y = 11; days < (long int) ip[y]; --y)\n    continue;\n  days -= ip[y];\n  dest->month = y + 1;\n  dest->day   = days + 1;\n  \n  dest->centiseconds = ts.tv_nsec / 10000000;\n  dest->hundreds_of_microseconds = ( (ts.tv_nsec / 1000)\n\t\t\t\t     - (dest->centiseconds * 10000) ) / 100;\n  dest->microseconds = ( (ts.tv_nsec / 1000) \n\t\t\t - (dest->centiseconds * 10000)\n\t\t\t - (dest->hundreds_of_microseconds * 100) );\n  return dest;\n}\n#endif\n\n/*!\n  Return the modification time of the file.\n */\ntime_t\nudf_get_modification_time(const udf_dirent_t *p_udf_dirent)\n{\n  if (p_udf_dirent) {\n    time_t ret_time;\n    long int usec;\n    udf_stamp_to_time(&ret_time, &usec, p_udf_dirent->fe.modification_time);\n    return ret_time;\n  }\n  return 0;\n}\n\n/*!\n  Return the access time of the file.\n */\ntime_t\nudf_get_access_time(const udf_dirent_t *p_udf_dirent)\n{\n  if (p_udf_dirent) {\n    time_t ret_time;\n    long int usec;\n    udf_stamp_to_time(&ret_time, &usec, p_udf_dirent->fe.access_time);\n    return ret_time;\n  }\n  return 0;\n}\n\n/*!\n  Return the attribute (most recent create or access) time of the file\n */\ntime_t\nudf_get_attribute_time(const udf_dirent_t *p_udf_dirent)\n{\n  if (p_udf_dirent) {\n    time_t ret_time;\n    long int usec;\n    udf_stamp_to_time(&ret_time, &usec, p_udf_dirent->fe.attribute_time);\n    return ret_time;\n  }\n  return 0;\n}\n\n"
  },
  {
    "path": "src/license.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Licensing Data\n * Copyright © 2011-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\nconst char* about_blurb_format =\n\"{\\\\rtf1\\\\ansi\\n\"\n\"\\\\b\\\\fs20%s\\\\b0\\\\line\\n\"\n\"\\\\fs18%s\\\\line\\n\"\n\"\\\\line\\n\"\n\"%s\\\\line\\n\"\nRUFUS_URL \"\\\\line\\n\"\n\"\\\\fs3 \\\\line\\n\"\n\"\\\\fs18%s\\\\line\\n\"\n\"\\\\line\\n\"\n\"%s\\\\line\\n\"\n\"https://github.com/pbatard/rufus/issues\\\\line\\n\"\n\"\\\\line\\n\"\n\"\\\\b\\\\fs19 %s\\\\b0}\";\n\nconst char* additional_copyrights =\n\"{\\\\rtf1\\\\ansi\\n\"\n\"UI redesign concept by Fahad Al-Riyami\\\\line\\n\"\n\"Used with kind authorization\\\\line\\n\"\n\"\\\\line\\n\"\n\"Rufus icon by PC Unleashed:\\\\line\\n\"\n\"Freeware\\\\line\\n\"\n\"\\\\line\\n\"\n\"Additional icons courtesy of Axialis Software:\\\\line\\n\"\n\"https://axialis.com/\\\\line\\n\"\n\"CC BY-ND 4.0, when used as native resolution bitmaps\\\\line\\n\"\n\"\\\\line\\n\"\n\"Boot record handling from ms-sys by Henrik Carlqvist:\\\\line\\n\"\n\"http://ms-sys.sourceforge.net/\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"FreeDOS support from the FreeDOS project:\\\\line\\n\"\n\"https://www.freedos.org/\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later, with binary redistribution allowed\\\\line\\n\"\n\"\\\\line\\n\"\n\"ISO extraction support from libcdio by Rocky Bernstein et al.:\\\\line\\n\"\n\"https://www.gnu.org/software/libcdio\\\\line\\n\"\n\"GNU General Public License (GPL) v3 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"WIM image manipulation support from wimlib by Carl Thijssen and Eric Biggers:\\\\line\\n\"\n\"https://wimlib.net\\\\line\\n\"\n\"GNU General Public License (GPL) v3 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"Syslinux support from Syslinux by H. Peter Anvin et al.:\\\\line\\n\"\n\"https://syslinux.org/\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"Grub4DOS support from Grub4DOS by chenall, itself based on GRUB Legacy by the Free Software Foundation:\\\\line\\n\"\n\"https://github.com/chenall/grub4dos\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"GRUB 2 support from GNU GRUB by the Free Software Foundation:\\\\line\\n\"\n\"https://www.gnu.org/software/grub\\\\line\\n\"\n\"GNU General Public License (GPL) v3 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"ReactOS support & additional FAT and time-conversion handling by ReactOS:\\\\line\\n\"\n\"https://www.reactos.org/\\\\line\\n\"\n\"https://svn.reactos.org/reactos/trunk\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"Bad blocks testing and ext2/ext3 formatting from e2fsprogs by Theodore Ts'o et al.:\\\\line\\n\"\n\"http://e2fsprogs.sourceforge.net/\\\\line\\n\"\n\"GNU General Public License (GPL) v3 compatible\\\\line\\n\"\n\"\\\\line\\n\"\n\"Large FAT32 volume formatting from fat32format by Tom Thornhill:\\\\line\\n\"\n\"http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"XML parsing support from ezxml by Aaron Voisine:\\\\line\\n\"\n\"https://ezxml.sourceforge.net/\\\\line\\n\"\n\"MIT license\\\\line\\n\"\n\"\\\\line\\n\"\n\"fmifs.dll usage based on Formatx by Mark Russinovich:\\\\line\\n\"\n\"https://svn.reactos.org/reactos/trunk/reactos/dll/win32/fmifs\\\\line\\n\"\n\"Public Domain\\\\line\\n\"\n\"\\\\line\\n\"\n\"Device enumeration based on TestUSBDriveEject.cpp by ahmd:\\\\line\\n\"\n\"https://www.codeguru.com/forum/showthread.php?p=1951973\\\\line\\n\"\n\"Public Domain\\\\line\\n\"\n\"\\\\line\\n\"\n\"Handle search & process enumeration from System Informer by wj32 & dmex:\\\\line\\n\"\n\"https://systeminformer.sourceforge.io/\\\\line\\n\"\n\"GNU General Public License (GPL) v3 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"Decompression support from BusyBox/Bled:\\\\line\\n\"\n\"https://www.busybox.net/\\\\line\\n\"\n\"https://github.com/pbatard/bled\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"USB vs HDD and additional functions calls derived from smartmontools:\\\\line\\n\"\n\"https://sourceforge.net/projects/smartmontools\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"Partition and FS Type identification from GNU fdisk and GPT fdisk:\\\\line\\n\"\n\"https://www.gnu.org/software/fdisk\\\\line\\n\"\n\"https://www.rodsbooks.com/gdisk\\\\line\\n\"\n\"https://salsa.debian.org/debian/gdisk\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"Speed/ETA computation from GNU wget:\\\\line\\n\"\n\"https://www.gnu.org/software/wget\\\\line\\n\"\n\"GNU General Public License (GPL) v3 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"Additional bootloaders from KolibriOS:\\\\line\\n\"\n\"https://kolibrios.org/\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"MD5 digest functions by Ron Rivest, Colin Plumb et al.\\\\line\\n\"\n\"Public Domain\\\\line\\n\"\n\"\\\\line\\n\"\n\"SHA1 digest functions from GnuPG:\\\\line\\n\"\n\"https://www.gnupg.org/\\\\line\\n\"\n\"GNU General Public License (GPL) v3 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"SHA256 digest functions from 7-zip by Igor Pavlov and Crypto++ by Wei Dai:\\\\line\\n\"\n\"https://7-zip.org/\\\\line\\n\"\n\"https://github.com/weidai11/cryptopp/\\\\line\\n\"\n\"Public Domain\\\\line\\n\"\n\"\\\\line\\n\"\n\"SHA512 digest functions from libtomcrypt:\\\\line\\n\"\n\"https://github.com/libtom/libtomcrypt\\\\line\\n\"\n\"Public Domain\\\\line\\n\"\n\"\\\\line\\n\"\n\"PE256 digest functions from U-Boot:\\\\line\\n\"\n\"https://github.com/u-boot/u-boot\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"About and License dialogs inspired by WinSCP by Martin Prikryl\\\\line\\n\"\n\"https://winscp.net/\\\\line\\n\"\n\"GNU General Public License (GPL) v3 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"Check for Update dialog inspired by TortoiseSVN & TortoiseGit\\\\line\\n\"\n\"https://tortoisesvn.net/, https://tortoisegit.org/\\\\line\\n\"\n\"GNU General Public License (GPL) v2 or later\\\\line\\n\"\n\"\\\\line\\n\"\n\"Dark Mode support by ozone10\\\\line\\n\"\n\"https://github.com/ozone10\\\\line\\n\"\n\"\\\\line\\n\"\n\"Regular Expression parser from tiny-regex-c by Jim Huang (jserv):\\\\line\\n\"\n\"https://github.com/jserv/cregex\\\\line\\n\"\n\"BSD 2-Clause\\\\line\\n\"\n\"\\\\line\\n\"\n\"All other references can be found in the source.\\\\line\\n}\";\n\nconst char* update_policy =\n\"{\\\\rtf1\\\\ansi{\\\\fonttbl{\\\\f0\\\\fnil\\\\fcharset0 Microsoft Sans Serif;}}\\n\"\n\"\\\\fs16\\\\b %s\\\\b0\\\\line\\n\"\n\"%s\\\\par\\n\"\n\"\\\\fs20•\\\\fs16  %s\\\\par\\n\"\n\"\\\\fs20•\\\\fs16  %s\\\\par\\n\"\n\"\\\\fs20•\\\\fs16  %s\\\\line\\n\"\n\"\\\\line\\n\"\n\"%s\\\\line\\n\\\\line\\n\"\n\"\\\\b %s\\\\b0\\\\line\\n\"\n\"%s\\\\line\\n\"\n\"}\";\n\nconst char* gplv3 =\n\"                    GNU GENERAL PUBLIC LICENSE\\r\\n\"\n\"                       Version 3, 29 June 2007\\r\\n\"\n\"\\r\\n\"\n\" Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\\r\\n\"\n\" Everyone is permitted to copy and distribute verbatim copies\\r\\n\"\n\" of this license document, but changing it is not allowed.\\r\\n\"\n\"\\r\\n\"\n\"                            Preamble\\r\\n\"\n\"\\r\\n\"\n\"  The GNU General Public License is a free, copyleft license for\\r\\n\"\n\"software and other kinds of works.\\r\\n\"\n\"\\r\\n\"\n\"  The licenses for most software and other practical works are designed\\r\\n\"\n\"to take away your freedom to share and change the works.  By contrast,\\r\\n\"\n\"the GNU General Public License is intended to guarantee your freedom to\\r\\n\"\n\"share and change all versions of a program--to make sure it remains free\\r\\n\"\n\"software for all its users.  We, the Free Software Foundation, use the\\r\\n\"\n\"GNU General Public License for most of our software; it applies also to\\r\\n\"\n\"any other work released this way by its authors.  You can apply it to\\r\\n\"\n\"your programs, too.\\r\\n\"\n\"\\r\\n\"\n\"  When we speak of free software, we are referring to freedom, not\\r\\n\"\n\"price.  Our General Public Licenses are designed to make sure that you\\r\\n\"\n\"have the freedom to distribute copies of free software (and charge for\\r\\n\"\n\"them if you wish), that you receive source code or can get it if you\\r\\n\"\n\"want it, that you can change the software or use pieces of it in new\\r\\n\"\n\"free programs, and that you know you can do these things.\\r\\n\"\n\"\\r\\n\"\n\"  To protect your rights, we need to prevent others from denying you\\r\\n\"\n\"these rights or asking you to surrender the rights.  Therefore, you have\\r\\n\"\n\"certain responsibilities if you distribute copies of the software, or if\\r\\n\"\n\"you modify it: responsibilities to respect the freedom of others.\\r\\n\"\n\"\\r\\n\"\n\"  For example, if you distribute copies of such a program, whether\\r\\n\"\n\"gratis or for a fee, you must pass on to the recipients the same\\r\\n\"\n\"freedoms that you received.  You must make sure that they, too, receive\\r\\n\"\n\"or can get the source code.  And you must show them these terms so they\\r\\n\"\n\"know their rights.\\r\\n\"\n\"\\r\\n\"\n\"  Developers that use the GNU GPL protect your rights with two steps:\\r\\n\"\n\"(1) assert copyright on the software, and (2) offer you this License\\r\\n\"\n\"giving you legal permission to copy, distribute and/or modify it.\\r\\n\"\n\"\\r\\n\"\n\"  For the developers' and authors' protection, the GPL clearly explains\\r\\n\"\n\"that there is no warranty for this free software.  For both users' and\\r\\n\"\n\"authors' sake, the GPL requires that modified versions be marked as\\r\\n\"\n\"changed, so that their problems will not be attributed erroneously to\\r\\n\"\n\"authors of previous versions.\\r\\n\"\n\"\\r\\n\"\n\"  Some devices are designed to deny users access to install or run\\r\\n\"\n\"modified versions of the software inside them, although the manufacturer\\r\\n\"\n\"can do so.  This is fundamentally incompatible with the aim of\\r\\n\"\n\"protecting users' freedom to change the software.  The systematic\\r\\n\"\n\"pattern of such abuse occurs in the area of products for individuals to\\r\\n\"\n\"use, which is precisely where it is most unacceptable.  Therefore, we\\r\\n\"\n\"have designed this version of the GPL to prohibit the practice for those\\r\\n\"\n\"products.  If such problems arise substantially in other domains, we\\r\\n\"\n\"stand ready to extend this provision to those domains in future versions\\r\\n\"\n\"of the GPL, as needed to protect the freedom of users.\\r\\n\"\n\"\\r\\n\"\n\"  Finally, every program is threatened constantly by software patents.\\r\\n\"\n\"States should not allow patents to restrict development and use of\\r\\n\"\n\"software on general-purpose computers, but in those that do, we wish to\\r\\n\"\n\"avoid the special danger that patents applied to a free program could\\r\\n\"\n\"make it effectively proprietary.  To prevent this, the GPL assures that\\r\\n\"\n\"patents cannot be used to render the program non-free.\\r\\n\"\n\"\\r\\n\"\n\"  The precise terms and conditions for copying, distribution and\\r\\n\"\n\"modification follow.\\r\\n\"\n\"\\r\\n\"\n\"                       TERMS AND CONDITIONS\\r\\n\"\n\"\\r\\n\"\n\"  0. Definitions.\\r\\n\"\n\"\\r\\n\"\n\"  \\\"This License\\\" refers to version 3 of the GNU General Public License.\\r\\n\"\n\"\\r\\n\"\n\"  \\\"Copyright\\\" also means copyright-like laws that apply to other kinds of\\r\\n\"\n\"works, such as semiconductor masks.\\r\\n\"\n\"\\r\\n\"\n\"  \\\"The Program\\\" refers to any copyrightable work licensed under this\\r\\n\"\n\"License.  Each licensee is addressed as \\\"you\\\".  \\\"Licensees\\\" and\\r\\n\"\n\"\\\"recipients\\\" may be individuals or organizations.\\r\\n\"\n\"\\r\\n\"\n\"  To \\\"modify\\\" a work means to copy from or adapt all or part of the work\\r\\n\"\n\"in a fashion requiring copyright permission, other than the making of an\\r\\n\"\n\"exact copy.  The resulting work is called a \\\"modified version\\\" of the\\r\\n\"\n\"earlier work or a work \\\"based on\\\" the earlier work.\\r\\n\"\n\"\\r\\n\"\n\"  A \\\"covered work\\\" means either the unmodified Program or a work based\\r\\n\"\n\"on the Program.\\r\\n\"\n\"\\r\\n\"\n\"  To \\\"propagate\\\" a work means to do anything with it that, without\\r\\n\"\n\"permission, would make you directly or secondarily liable for\\r\\n\"\n\"infringement under applicable copyright law, except executing it on a\\r\\n\"\n\"computer or modifying a private copy.  Propagation includes copying,\\r\\n\"\n\"distribution (with or without modification), making available to the\\r\\n\"\n\"public, and in some countries other activities as well.\\r\\n\"\n\"\\r\\n\"\n\"  To \\\"convey\\\" a work means any kind of propagation that enables other\\r\\n\"\n\"parties to make or receive copies.  Mere interaction with a user through\\r\\n\"\n\"a computer network, with no transfer of a copy, is not conveying.\\r\\n\"\n\"\\r\\n\"\n\"  An interactive user interface displays \\\"Appropriate Legal Notices\\\"\\r\\n\"\n\"to the extent that it includes a convenient and prominently visible\\r\\n\"\n\"feature that (1) displays an appropriate copyright notice, and (2)\\r\\n\"\n\"tells the user that there is no warranty for the work (except to the\\r\\n\"\n\"extent that warranties are provided), that licensees may convey the\\r\\n\"\n\"work under this License, and how to view a copy of this License.  If\\r\\n\"\n\"the interface presents a list of user commands or options, such as a\\r\\n\"\n\"menu, a prominent item in the list meets this criterion.\\r\\n\"\n\"\\r\\n\"\n\"  1. Source Code.\\r\\n\"\n\"\\r\\n\"\n\"  The \\\"source code\\\" for a work means the preferred form of the work\\r\\n\"\n\"for making modifications to it.  \\\"Object code\\\" means any non-source\\r\\n\"\n\"form of a work.\\r\\n\"\n\"\\r\\n\"\n\"  A \\\"Standard Interface\\\" means an interface that either is an official\\r\\n\"\n\"standard defined by a recognized standards body, or, in the case of\\r\\n\"\n\"interfaces specified for a particular programming language, one that\\r\\n\"\n\"is widely used among developers working in that language.\\r\\n\"\n\"\\r\\n\"\n\"  The \\\"System Libraries\\\" of an executable work include anything, other\\r\\n\"\n\"than the work as a whole, that (a) is included in the normal form of\\r\\n\"\n\"packaging a Major Component, but which is not part of that Major\\r\\n\"\n\"Component, and (b) serves only to enable use of the work with that\\r\\n\"\n\"Major Component, or to implement a Standard Interface for which an\\r\\n\"\n\"implementation is available to the public in source code form.  A\\r\\n\"\n\"\\\"Major Component\\\", in this context, means a major essential component\\r\\n\"\n\"(kernel, window system, and so on) of the specific operating system\\r\\n\"\n\"(if any) on which the executable work runs, or a compiler used to\\r\\n\"\n\"produce the work, or an object code interpreter used to run it.\\r\\n\"\n\"\\r\\n\"\n\"  The \\\"Corresponding Source\\\" for a work in object code form means all\\r\\n\"\n\"the source code needed to generate, install, and (for an executable\\r\\n\"\n\"work) run the object code and to modify the work, including scripts to\\r\\n\"\n\"control those activities.  However, it does not include the work's\\r\\n\"\n\"System Libraries, or general-purpose tools or generally available free\\r\\n\"\n\"programs which are used unmodified in performing those activities but\\r\\n\"\n\"which are not part of the work.  For example, Corresponding Source\\r\\n\"\n\"includes interface definition files associated with source files for\\r\\n\"\n\"the work, and the source code for shared libraries and dynamically\\r\\n\"\n\"linked subprograms that the work is specifically designed to require,\\r\\n\"\n\"such as by intimate data communication or control flow between those\\r\\n\"\n\"subprograms and other parts of the work.\\r\\n\"\n\"\\r\\n\"\n\"  The Corresponding Source need not include anything that users\\r\\n\"\n\"can regenerate automatically from other parts of the Corresponding\\r\\n\"\n\"Source.\\r\\n\"\n\"\\r\\n\"\n\"  The Corresponding Source for a work in source code form is that\\r\\n\"\n\"same work.\\r\\n\"\n\"\\r\\n\"\n\"  2. Basic Permissions.\\r\\n\"\n\"\\r\\n\"\n\"  All rights granted under this License are granted for the term of\\r\\n\"\n\"copyright on the Program, and are irrevocable provided the stated\\r\\n\"\n\"conditions are met.  This License explicitly affirms your unlimited\\r\\n\"\n\"permission to run the unmodified Program.  The output from running a\\r\\n\"\n\"covered work is covered by this License only if the output, given its\\r\\n\"\n\"content, constitutes a covered work.  This License acknowledges your\\r\\n\"\n\"rights of fair use or other equivalent, as provided by copyright law.\\r\\n\"\n\"\\r\\n\"\n\"  You may make, run and propagate covered works that you do not\\r\\n\"\n\"convey, without conditions so long as your license otherwise remains\\r\\n\"\n\"in force.  You may convey covered works to others for the sole purpose\\r\\n\"\n\"of having them make modifications exclusively for you, or provide you\\r\\n\"\n\"with facilities for running those works, provided that you comply with\\r\\n\"\n\"the terms of this License in conveying all material for which you do\\r\\n\"\n\"not control copyright.  Those thus making or running the covered works\\r\\n\"\n\"for you must do so exclusively on your behalf, under your direction\\r\\n\"\n\"and control, on terms that prohibit them from making any copies of\\r\\n\"\n\"your copyrighted material outside their relationship with you.\\r\\n\"\n\"\\r\\n\"\n\"  Conveying under any other circumstances is permitted solely under\\r\\n\"\n\"the conditions stated below.  Sublicensing is not allowed; section 10\\r\\n\"\n\"makes it unnecessary.\\r\\n\"\n\"\\r\\n\"\n\"  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\\r\\n\"\n\"\\r\\n\"\n\"  No covered work shall be deemed part of an effective technological\\r\\n\"\n\"measure under any applicable law fulfilling obligations under article\\r\\n\"\n\"11 of the WIPO copyright treaty adopted on 20 December 1996, or\\r\\n\"\n\"similar laws prohibiting or restricting circumvention of such\\r\\n\"\n\"measures.\\r\\n\"\n\"\\r\\n\"\n\"  When you convey a covered work, you waive any legal power to forbid\\r\\n\"\n\"circumvention of technological measures to the extent such circumvention\\r\\n\"\n\"is effected by exercising rights under this License with respect to\\r\\n\"\n\"the covered work, and you disclaim any intention to limit operation or\\r\\n\"\n\"modification of the work as a means of enforcing, against the work's\\r\\n\"\n\"users, your or third parties' legal rights to forbid circumvention of\\r\\n\"\n\"technological measures.\\r\\n\"\n\"\\r\\n\"\n\"  4. Conveying Verbatim Copies.\\r\\n\"\n\"\\r\\n\"\n\"  You may convey verbatim copies of the Program's source code as you\\r\\n\"\n\"receive it, in any medium, provided that you conspicuously and\\r\\n\"\n\"appropriately publish on each copy an appropriate copyright notice;\\r\\n\"\n\"keep intact all notices stating that this License and any\\r\\n\"\n\"non-permissive terms added in accord with section 7 apply to the code;\\r\\n\"\n\"keep intact all notices of the absence of any warranty; and give all\\r\\n\"\n\"recipients a copy of this License along with the Program.\\r\\n\"\n\"\\r\\n\"\n\"  You may charge any price or no price for each copy that you convey,\\r\\n\"\n\"and you may offer support or warranty protection for a fee.\\r\\n\"\n\"\\r\\n\"\n\"  5. Conveying Modified Source Versions.\\r\\n\"\n\"\\r\\n\"\n\"  You may convey a work based on the Program, or the modifications to\\r\\n\"\n\"produce it from the Program, in the form of source code under the\\r\\n\"\n\"terms of section 4, provided that you also meet all of these conditions:\\r\\n\"\n\"\\r\\n\"\n\"    a) The work must carry prominent notices stating that you modified\\r\\n\"\n\"    it, and giving a relevant date.\\r\\n\"\n\"\\r\\n\"\n\"    b) The work must carry prominent notices stating that it is\\r\\n\"\n\"    released under this License and any conditions added under section\\r\\n\"\n\"    7.  This requirement modifies the requirement in section 4 to\\r\\n\"\n\"    \\\"keep intact all notices\\\".\\r\\n\"\n\"\\r\\n\"\n\"    c) You must license the entire work, as a whole, under this\\r\\n\"\n\"    License to anyone who comes into possession of a copy.  This\\r\\n\"\n\"    License will therefore apply, along with any applicable section 7\\r\\n\"\n\"    additional terms, to the whole of the work, and all its parts,\\r\\n\"\n\"    regardless of how they are packaged.  This License gives no\\r\\n\"\n\"    permission to license the work in any other way, but it does not\\r\\n\"\n\"    invalidate such permission if you have separately received it.\\r\\n\"\n\"\\r\\n\"\n\"    d) If the work has interactive user interfaces, each must display\\r\\n\"\n\"    Appropriate Legal Notices; however, if the Program has interactive\\r\\n\"\n\"    interfaces that do not display Appropriate Legal Notices, your\\r\\n\"\n\"    work need not make them do so.\\r\\n\"\n\"\\r\\n\"\n\"  A compilation of a covered work with other separate and independent\\r\\n\"\n\"works, which are not by their nature extensions of the covered work,\\r\\n\"\n\"and which are not combined with it such as to form a larger program,\\r\\n\"\n\"in or on a volume of a storage or distribution medium, is called an\\r\\n\"\n\"\\\"aggregate\\\" if the compilation and its resulting copyright are not\\r\\n\"\n\"used to limit the access or legal rights of the compilation's users\\r\\n\"\n\"beyond what the individual works permit.  Inclusion of a covered work\\r\\n\"\n\"in an aggregate does not cause this License to apply to the other\\r\\n\"\n\"parts of the aggregate.\\r\\n\"\n\"\\r\\n\"\n\"  6. Conveying Non-Source Forms.\\r\\n\"\n\"\\r\\n\"\n\"  You may convey a covered work in object code form under the terms\\r\\n\"\n\"of sections 4 and 5, provided that you also convey the\\r\\n\"\n\"machine-readable Corresponding Source under the terms of this License,\\r\\n\"\n\"in one of these ways:\\r\\n\"\n\"\\r\\n\"\n\"    a) Convey the object code in, or embodied in, a physical product\\r\\n\"\n\"    (including a physical distribution medium), accompanied by the\\r\\n\"\n\"    Corresponding Source fixed on a durable physical medium\\r\\n\"\n\"    customarily used for software interchange.\\r\\n\"\n\"\\r\\n\"\n\"    b) Convey the object code in, or embodied in, a physical product\\r\\n\"\n\"    (including a physical distribution medium), accompanied by a\\r\\n\"\n\"    written offer, valid for at least three years and valid for as\\r\\n\"\n\"    long as you offer spare parts or customer support for that product\\r\\n\"\n\"    model, to give anyone who possesses the object code either (1) a\\r\\n\"\n\"    copy of the Corresponding Source for all the software in the\\r\\n\"\n\"    product that is covered by this License, on a durable physical\\r\\n\"\n\"    medium customarily used for software interchange, for a price no\\r\\n\"\n\"    more than your reasonable cost of physically performing this\\r\\n\"\n\"    conveying of source, or (2) access to copy the\\r\\n\"\n\"    Corresponding Source from a network server at no charge.\\r\\n\"\n\"\\r\\n\"\n\"    c) Convey individual copies of the object code with a copy of the\\r\\n\"\n\"    written offer to provide the Corresponding Source.  This\\r\\n\"\n\"    alternative is allowed only occasionally and noncommercially, and\\r\\n\"\n\"    only if you received the object code with such an offer, in accord\\r\\n\"\n\"    with subsection 6b.\\r\\n\"\n\"\\r\\n\"\n\"    d) Convey the object code by offering access from a designated\\r\\n\"\n\"    place (gratis or for a charge), and offer equivalent access to the\\r\\n\"\n\"    Corresponding Source in the same way through the same place at no\\r\\n\"\n\"    further charge.  You need not require recipients to copy the\\r\\n\"\n\"    Corresponding Source along with the object code.  If the place to\\r\\n\"\n\"    copy the object code is a network server, the Corresponding Source\\r\\n\"\n\"    may be on a different server (operated by you or a third party)\\r\\n\"\n\"    that supports equivalent copying facilities, provided you maintain\\r\\n\"\n\"    clear directions next to the object code saying where to find the\\r\\n\"\n\"    Corresponding Source.  Regardless of what server hosts the\\r\\n\"\n\"    Corresponding Source, you remain obligated to ensure that it is\\r\\n\"\n\"    available for as long as needed to satisfy these requirements.\\r\\n\"\n\"\\r\\n\"\n\"    e) Convey the object code using peer-to-peer transmission, provided\\r\\n\"\n\"    you inform other peers where the object code and Corresponding\\r\\n\"\n\"    Source of the work are being offered to the general public at no\\r\\n\"\n\"    charge under subsection 6d.\\r\\n\"\n\"\\r\\n\"\n\"  A separable portion of the object code, whose source code is excluded\\r\\n\"\n\"from the Corresponding Source as a System Library, need not be\\r\\n\"\n\"included in conveying the object code work.\\r\\n\"\n\"\\r\\n\"\n\"  A \\\"User Product\\\" is either (1) a \\\"consumer product\\\", which means any\\r\\n\"\n\"tangible personal property which is normally used for personal, family,\\r\\n\"\n\"or household purposes, or (2) anything designed or sold for incorporation\\r\\n\"\n\"into a dwelling.  In determining whether a product is a consumer product,\\r\\n\"\n\"doubtful cases shall be resolved in favor of coverage.  For a particular\\r\\n\"\n\"product received by a particular user, \\\"normally used\\\" refers to a\\r\\n\"\n\"typical or common use of that class of product, regardless of the status\\r\\n\"\n\"of the particular user or of the way in which the particular user\\r\\n\"\n\"actually uses, or expects or is expected to use, the product.  A product\\r\\n\"\n\"is a consumer product regardless of whether the product has substantial\\r\\n\"\n\"commercial, industrial or non-consumer uses, unless such uses represent\\r\\n\"\n\"the only significant mode of use of the product.\\r\\n\"\n\"\\r\\n\"\n\"  \\\"Installation Information\\\" for a User Product means any methods,\\r\\n\"\n\"procedures, authorization keys, or other information required to install\\r\\n\"\n\"and execute modified versions of a covered work in that User Product from\\r\\n\"\n\"a modified version of its Corresponding Source.  The information must\\r\\n\"\n\"suffice to ensure that the continued functioning of the modified object\\r\\n\"\n\"code is in no case prevented or interfered with solely because\\r\\n\"\n\"modification has been made.\\r\\n\"\n\"\\r\\n\"\n\"  If you convey an object code work under this section in, or with, or\\r\\n\"\n\"specifically for use in, a User Product, and the conveying occurs as\\r\\n\"\n\"part of a transaction in which the right of possession and use of the\\r\\n\"\n\"User Product is transferred to the recipient in perpetuity or for a\\r\\n\"\n\"fixed term (regardless of how the transaction is characterized), the\\r\\n\"\n\"Corresponding Source conveyed under this section must be accompanied\\r\\n\"\n\"by the Installation Information.  But this requirement does not apply\\r\\n\"\n\"if neither you nor any third party retains the ability to install\\r\\n\"\n\"modified object code on the User Product (for example, the work has\\r\\n\"\n\"been installed in ROM).\\r\\n\"\n\"\\r\\n\"\n\"  The requirement to provide Installation Information does not include a\\r\\n\"\n\"requirement to continue to provide support service, warranty, or updates\\r\\n\"\n\"for a work that has been modified or installed by the recipient, or for\\r\\n\"\n\"the User Product in which it has been modified or installed.  Access to a\\r\\n\"\n\"network may be denied when the modification itself materially and\\r\\n\"\n\"adversely affects the operation of the network or violates the rules and\\r\\n\"\n\"protocols for communication across the network.\\r\\n\"\n\"\\r\\n\"\n\"  Corresponding Source conveyed, and Installation Information provided,\\r\\n\"\n\"in accord with this section must be in a format that is publicly\\r\\n\"\n\"documented (and with an implementation available to the public in\\r\\n\"\n\"source code form), and must require no special password or key for\\r\\n\"\n\"unpacking, reading or copying.\\r\\n\"\n\"\\r\\n\"\n\"  7. Additional Terms.\\r\\n\"\n\"\\r\\n\"\n\"  \\\"Additional permissions\\\" are terms that supplement the terms of this\\r\\n\"\n\"License by making exceptions from one or more of its conditions.\\r\\n\"\n\"Additional permissions that are applicable to the entire Program shall\\r\\n\"\n\"be treated as though they were included in this License, to the extent\\r\\n\"\n\"that they are valid under applicable law.  If additional permissions\\r\\n\"\n\"apply only to part of the Program, that part may be used separately\\r\\n\"\n\"under those permissions, but the entire Program remains governed by\\r\\n\"\n\"this License without regard to the additional permissions.\\r\\n\"\n\"\\r\\n\"\n\"  When you convey a copy of a covered work, you may at your option\\r\\n\"\n\"remove any additional permissions from that copy, or from any part of\\r\\n\"\n\"it.  (Additional permissions may be written to require their own\\r\\n\"\n\"removal in certain cases when you modify the work.)  You may place\\r\\n\"\n\"additional permissions on material, added by you to a covered work,\\r\\n\"\n\"for which you have or can give appropriate copyright permission.\\r\\n\"\n\"\\r\\n\"\n\"  Notwithstanding any other provision of this License, for material you\\r\\n\"\n\"add to a covered work, you may (if authorized by the copyright holders of\\r\\n\"\n\"that material) supplement the terms of this License with terms:\\r\\n\"\n\"\\r\\n\"\n\"    a) Disclaiming warranty or limiting liability differently from the\\r\\n\"\n\"    terms of sections 15 and 16 of this License; or\\r\\n\"\n\"\\r\\n\"\n\"    b) Requiring preservation of specified reasonable legal notices or\\r\\n\"\n\"    author attributions in that material or in the Appropriate Legal\\r\\n\"\n\"    Notices displayed by works containing it; or\\r\\n\"\n\"\\r\\n\"\n\"    c) Prohibiting misrepresentation of the origin of that material, or\\r\\n\"\n\"    requiring that modified versions of such material be marked in\\r\\n\"\n\"    reasonable ways as different from the original version; or\\r\\n\"\n\"\\r\\n\"\n\"    d) Limiting the use for publicity purposes of names of licensors or\\r\\n\"\n\"    authors of the material; or\\r\\n\"\n\"\\r\\n\"\n\"    e) Declining to grant rights under trademark law for use of some\\r\\n\"\n\"    trade names, trademarks, or service marks; or\\r\\n\"\n\"\\r\\n\"\n\"    f) Requiring indemnification of licensors and authors of that\\r\\n\"\n\"    material by anyone who conveys the material (or modified versions of\\r\\n\"\n\"    it) with contractual assumptions of liability to the recipient, for\\r\\n\"\n\"    any liability that these contractual assumptions directly impose on\\r\\n\"\n\"    those licensors and authors.\\r\\n\"\n\"\\r\\n\"\n\"  All other non-permissive additional terms are considered \\\"further\\r\\n\"\n\"restrictions\\\" within the meaning of section 10.  If the Program as you\\r\\n\"\n\"received it, or any part of it, contains a notice stating that it is\\r\\n\"\n\"governed by this License along with a term that is a further\\r\\n\"\n\"restriction, you may remove that term.  If a license document contains\\r\\n\"\n\"a further restriction but permits relicensing or conveying under this\\r\\n\"\n\"License, you may add to a covered work material governed by the terms\\r\\n\"\n\"of that license document, provided that the further restriction does\\r\\n\"\n\"not survive such relicensing or conveying.\\r\\n\"\n\"\\r\\n\"\n\"  If you add terms to a covered work in accord with this section, you\\r\\n\"\n\"must place, in the relevant source files, a statement of the\\r\\n\"\n\"additional terms that apply to those files, or a notice indicating\\r\\n\"\n\"where to find the applicable terms.\\r\\n\"\n\"\\r\\n\"\n\"  Additional terms, permissive or non-permissive, may be stated in the\\r\\n\"\n\"form of a separately written license, or stated as exceptions;\\r\\n\"\n\"the above requirements apply either way.\\r\\n\"\n\"\\r\\n\"\n\"  8. Termination.\\r\\n\"\n\"\\r\\n\"\n\"  You may not propagate or modify a covered work except as expressly\\r\\n\"\n\"provided under this License.  Any attempt otherwise to propagate or\\r\\n\"\n\"modify it is void, and will automatically terminate your rights under\\r\\n\"\n\"this License (including any patent licenses granted under the third\\r\\n\"\n\"paragraph of section 11).\\r\\n\"\n\"\\r\\n\"\n\"  However, if you cease all violation of this License, then your\\r\\n\"\n\"license from a particular copyright holder is reinstated (a)\\r\\n\"\n\"provisionally, unless and until the copyright holder explicitly and\\r\\n\"\n\"finally terminates your license, and (b) permanently, if the copyright\\r\\n\"\n\"holder fails to notify you of the violation by some reasonable means\\r\\n\"\n\"prior to 60 days after the cessation.\\r\\n\"\n\"\\r\\n\"\n\"  Moreover, your license from a particular copyright holder is\\r\\n\"\n\"reinstated permanently if the copyright holder notifies you of the\\r\\n\"\n\"violation by some reasonable means, this is the first time you have\\r\\n\"\n\"received notice of violation of this License (for any work) from that\\r\\n\"\n\"copyright holder, and you cure the violation prior to 30 days after\\r\\n\"\n\"your receipt of the notice.\\r\\n\"\n\"\\r\\n\"\n\"  Termination of your rights under this section does not terminate the\\r\\n\"\n\"licenses of parties who have received copies or rights from you under\\r\\n\"\n\"this License.  If your rights have been terminated and not permanently\\r\\n\"\n\"reinstated, you do not qualify to receive new licenses for the same\\r\\n\"\n\"material under section 10.\\r\\n\"\n\"\\r\\n\"\n\"  9. Acceptance Not Required for Having Copies.\\r\\n\"\n\"\\r\\n\"\n\"  You are not required to accept this License in order to receive or\\r\\n\"\n\"run a copy of the Program.  Ancillary propagation of a covered work\\r\\n\"\n\"occurring solely as a consequence of using peer-to-peer transmission\\r\\n\"\n\"to receive a copy likewise does not require acceptance.  However,\\r\\n\"\n\"nothing other than this License grants you permission to propagate or\\r\\n\"\n\"modify any covered work.  These actions infringe copyright if you do\\r\\n\"\n\"not accept this License.  Therefore, by modifying or propagating a\\r\\n\"\n\"covered work, you indicate your acceptance of this License to do so.\\r\\n\"\n\"\\r\\n\"\n\"  10. Automatic Licensing of Downstream Recipients.\\r\\n\"\n\"\\r\\n\"\n\"  Each time you convey a covered work, the recipient automatically\\r\\n\"\n\"receives a license from the original licensors, to run, modify and\\r\\n\"\n\"propagate that work, subject to this License.  You are not responsible\\r\\n\"\n\"for enforcing compliance by third parties with this License.\\r\\n\"\n\"\\r\\n\"\n\"  An \\\"entity transaction\\\" is a transaction transferring control of an\\r\\n\"\n\"organization, or substantially all assets of one, or subdividing an\\r\\n\"\n\"organization, or merging organizations.  If propagation of a covered\\r\\n\"\n\"work results from an entity transaction, each party to that\\r\\n\"\n\"transaction who receives a copy of the work also receives whatever\\r\\n\"\n\"licenses to the work the party's predecessor in interest had or could\\r\\n\"\n\"give under the previous paragraph, plus a right to possession of the\\r\\n\"\n\"Corresponding Source of the work from the predecessor in interest, if\\r\\n\"\n\"the predecessor has it or can get it with reasonable efforts.\\r\\n\"\n\"\\r\\n\"\n\"  You may not impose any further restrictions on the exercise of the\\r\\n\"\n\"rights granted or affirmed under this License.  For example, you may\\r\\n\"\n\"not impose a license fee, royalty, or other charge for exercise of\\r\\n\"\n\"rights granted under this License, and you may not initiate litigation\\r\\n\"\n\"(including a cross-claim or counterclaim in a lawsuit) alleging that\\r\\n\"\n\"any patent claim is infringed by making, using, selling, offering for\\r\\n\"\n\"sale, or importing the Program or any portion of it.\\r\\n\"\n\"\\r\\n\"\n\"  11. Patents.\\r\\n\"\n\"\\r\\n\"\n\"  A \\\"contributor\\\" is a copyright holder who authorizes use under this\\r\\n\"\n\"License of the Program or a work on which the Program is based.  The\\r\\n\"\n\"work thus licensed is called the contributor's \\\"contributor version\\\".\\r\\n\"\n\"\\r\\n\"\n\"  A contributor's \\\"essential patent claims\\\" are all patent claims\\r\\n\"\n\"owned or controlled by the contributor, whether already acquired or\\r\\n\"\n\"hereafter acquired, that would be infringed by some manner, permitted\\r\\n\"\n\"by this License, of making, using, or selling its contributor version,\\r\\n\"\n\"but do not include claims that would be infringed only as a\\r\\n\"\n\"consequence of further modification of the contributor version.  For\\r\\n\"\n\"purposes of this definition, \\\"control\\\" includes the right to grant\\r\\n\"\n\"patent sublicenses in a manner consistent with the requirements of\\r\\n\"\n\"this License.\\r\\n\"\n\"\\r\\n\"\n\"  Each contributor grants you a non-exclusive, worldwide, royalty-free\\r\\n\"\n\"patent license under the contributor's essential patent claims, to\\r\\n\"\n\"make, use, sell, offer for sale, import and otherwise run, modify and\\r\\n\"\n\"propagate the contents of its contributor version.\\r\\n\"\n\"\\r\\n\"\n\"  In the following three paragraphs, a \\\"patent license\\\" is any express\\r\\n\"\n\"agreement or commitment, however denominated, not to enforce a patent\\r\\n\"\n\"(such as an express permission to practice a patent or covenant not to\\r\\n\"\n\"sue for patent infringement).  To \\\"grant\\\" such a patent license to a\\r\\n\"\n\"party means to make such an agreement or commitment not to enforce a\\r\\n\"\n\"patent against the party.\\r\\n\"\n\"\\r\\n\"\n\"  If you convey a covered work, knowingly relying on a patent license,\\r\\n\"\n\"and the Corresponding Source of the work is not available for anyone\\r\\n\"\n\"to copy, free of charge and under the terms of this License, through a\\r\\n\"\n\"publicly available network server or other readily accessible means,\\r\\n\"\n\"then you must either (1) cause the Corresponding Source to be so\\r\\n\"\n\"available, or (2) arrange to deprive yourself of the benefit of the\\r\\n\"\n\"patent license for this particular work, or (3) arrange, in a manner\\r\\n\"\n\"consistent with the requirements of this License, to extend the patent\\r\\n\"\n\"license to downstream recipients.  \\\"Knowingly relying\\\" means you have\\r\\n\"\n\"actual knowledge that, but for the patent license, your conveying the\\r\\n\"\n\"covered work in a country, or your recipient's use of the covered work\\r\\n\"\n\"in a country, would infringe one or more identifiable patents in that\\r\\n\"\n\"country that you have reason to believe are valid.\\r\\n\"\n\"\\r\\n\"\n\"  If, pursuant to or in connection with a single transaction or\\r\\n\"\n\"arrangement, you convey, or propagate by procuring conveyance of, a\\r\\n\"\n\"covered work, and grant a patent license to some of the parties\\r\\n\"\n\"receiving the covered work authorizing them to use, propagate, modify\\r\\n\"\n\"or convey a specific copy of the covered work, then the patent license\\r\\n\"\n\"you grant is automatically extended to all recipients of the covered\\r\\n\"\n\"work and works based on it.\\r\\n\"\n\"\\r\\n\"\n\"  A patent license is \\\"discriminatory\\\" if it does not include within\\r\\n\"\n\"the scope of its coverage, prohibits the exercise of, or is\\r\\n\"\n\"conditioned on the non-exercise of one or more of the rights that are\\r\\n\"\n\"specifically granted under this License.  You may not convey a covered\\r\\n\"\n\"work if you are a party to an arrangement with a third party that is\\r\\n\"\n\"in the business of distributing software, under which you make payment\\r\\n\"\n\"to the third party based on the extent of your activity of conveying\\r\\n\"\n\"the work, and under which the third party grants, to any of the\\r\\n\"\n\"parties who would receive the covered work from you, a discriminatory\\r\\n\"\n\"patent license (a) in connection with copies of the covered work\\r\\n\"\n\"conveyed by you (or copies made from those copies), or (b) primarily\\r\\n\"\n\"for and in connection with specific products or compilations that\\r\\n\"\n\"contain the covered work, unless you entered into that arrangement,\\r\\n\"\n\"or that patent license was granted, prior to 28 March 2007.\\r\\n\"\n\"\\r\\n\"\n\"  Nothing in this License shall be construed as excluding or limiting\\r\\n\"\n\"any implied license or other defenses to infringement that may\\r\\n\"\n\"otherwise be available to you under applicable patent law.\\r\\n\"\n\"\\r\\n\"\n\"  12. No Surrender of Others' Freedom.\\r\\n\"\n\"\\r\\n\"\n\"  If conditions are imposed on you (whether by court order, agreement or\\r\\n\"\n\"otherwise) that contradict the conditions of this License, they do not\\r\\n\"\n\"excuse you from the conditions of this License.  If you cannot convey a\\r\\n\"\n\"covered work so as to satisfy simultaneously your obligations under this\\r\\n\"\n\"License and any other pertinent obligations, then as a consequence you may\\r\\n\"\n\"not convey it at all.  For example, if you agree to terms that obligate you\\r\\n\"\n\"to collect a royalty for further conveying from those to whom you convey\\r\\n\"\n\"the Program, the only way you could satisfy both those terms and this\\r\\n\"\n\"License would be to refrain entirely from conveying the Program.\\r\\n\"\n\"\\r\\n\"\n\"  13. Use with the GNU Affero General Public License.\\r\\n\"\n\"\\r\\n\"\n\"  Notwithstanding any other provision of this License, you have\\r\\n\"\n\"permission to link or combine any covered work with a work licensed\\r\\n\"\n\"under version 3 of the GNU Affero General Public License into a single\\r\\n\"\n\"combined work, and to convey the resulting work.  The terms of this\\r\\n\"\n\"License will continue to apply to the part which is the covered work,\\r\\n\"\n\"but the special requirements of the GNU Affero General Public License,\\r\\n\"\n\"section 13, concerning interaction through a network will apply to the\\r\\n\"\n\"combination as such.\\r\\n\"\n\"\\r\\n\"\n\"  14. Revised Versions of this License.\\r\\n\"\n\"\\r\\n\"\n\"  The Free Software Foundation may publish revised and/or new versions of\\r\\n\"\n\"the GNU General Public License from time to time.  Such new versions will\\r\\n\"\n\"be similar in spirit to the present version, but may differ in detail to\\r\\n\"\n\"address new problems or concerns.\\r\\n\"\n\"\\r\\n\"\n\"  Each version is given a distinguishing version number.  If the\\r\\n\"\n\"Program specifies that a certain numbered version of the GNU General\\r\\n\"\n\"Public License \\\"or any later version\\\" applies to it, you have the\\r\\n\"\n\"option of following the terms and conditions either of that numbered\\r\\n\"\n\"version or of any later version published by the Free Software\\r\\n\"\n\"Foundation.  If the Program does not specify a version number of the\\r\\n\"\n\"GNU General Public License, you may choose any version ever published\\r\\n\"\n\"by the Free Software Foundation.\\r\\n\"\n\"\\r\\n\"\n\"  If the Program specifies that a proxy can decide which future\\r\\n\"\n\"versions of the GNU General Public License can be used, that proxy's\\r\\n\"\n\"public statement of acceptance of a version permanently authorizes you\\r\\n\"\n\"to choose that version for the Program.\\r\\n\"\n\"\\r\\n\"\n\"  Later license versions may give you additional or different\\r\\n\"\n\"permissions.  However, no additional obligations are imposed on any\\r\\n\"\n\"author or copyright holder as a result of your choosing to follow a\\r\\n\"\n\"later version.\\r\\n\"\n\"\\r\\n\"\n\"  15. Disclaimer of Warranty.\\r\\n\"\n\"\\r\\n\"\n\"  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\\r\\n\"\n\"APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\\r\\n\"\n\"HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \\\"AS IS\\\" WITHOUT WARRANTY\\r\\n\"\n\"OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\\r\\n\"\n\"THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\\r\\n\"\n\"PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\\r\\n\"\n\"IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\\r\\n\"\n\"ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\\r\\n\"\n\"\\r\\n\"\n\"  16. Limitation of Liability.\\r\\n\"\n\"\\r\\n\"\n\"  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\\r\\n\"\n\"WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\\r\\n\"\n\"THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\\r\\n\"\n\"GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\\r\\n\"\n\"USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\\r\\n\"\n\"DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\\r\\n\"\n\"PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\\r\\n\"\n\"EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\\r\\n\"\n\"SUCH DAMAGES.\\r\\n\"\n\"\\r\\n\"\n\"  17. Interpretation of Sections 15 and 16.\\r\\n\"\n\"\\r\\n\"\n\"  If the disclaimer of warranty and limitation of liability provided\\r\\n\"\n\"above cannot be given local legal effect according to their terms,\\r\\n\"\n\"reviewing courts shall apply local law that most closely approximates\\r\\n\"\n\"an absolute waiver of all civil liability in connection with the\\r\\n\"\n\"Program, unless a warranty or assumption of liability accompanies a\\r\\n\"\n\"copy of the Program in return for a fee.\\r\\n\"\n\"\\r\\n\"\n\"                     END OF TERMS AND CONDITIONS\";\n"
  },
  {
    "path": "src/localization.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Localization functions, a.k.a. \"Everybody is doing it wrong but me!\"\n * Copyright © 2013-2023 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <windowsx.h>\n#include <stdio.h>\n#include <wchar.h>\n#include <string.h>\n#include <stddef.h>\n\n#include \"rufus.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n#include \"localization_data.h\"\n\n/*\n * List of supported locale commands, with their parameter syntax:\n *   c control ID (no space, no quotes)\n *   s: quoted string\n *   i: 32 bit signed integer\n *   u: 32 bit unsigned CSV list\n * Remember to update the size of the array in localization.h when adding/removing elements\n */\nconst loc_parse parse_cmd[7] = {\n\t// Translation name and Windows LCIDs it should apply to\n\t{ 'l', LC_LOCALE, \"ssu\" },\t// l \"en_US\" \"English (US)\" 0x0009,0x1009\n\t// Base translation to add on top of (eg. \"English (UK)\" can be used to build on top of \"English (US)\"\n\t{ 'b', LC_BASE, \"s\" },\t\t// b \"en_US\"\n\t// Version to use for the localization commandset and API\n\t{ 'v', LC_VERSION, \"u\" },\t// v 1.0.2\n\t// Translate the text control associated with an ID\n\t{ 't', LC_TEXT, \"cs\" },\t\t// t IDC_CONTROL \"Translation\"\n\t// Set the section/dialog to which the next commands should apply\n\t{ 'g', LC_GROUP, \"c\" },\t\t// g IDD_DIALOG\n\t// Set the font to use for the text controls that follow\n\t// Use f \"Default\" 0 to reset the font\n\t{ 'f', LC_FONT, \"si\" },\t\t// f \"MS Dialog\" 10\n\t// Set translations attributes such as right-to-left, numerals to use, etc\n\t{ 'a', LC_ATTRIBUTES, \"s\" },\t// a \"ra\"\n};\n\n/* Hash table for reused translation commands */\nstatic htab_table htab_loc = HTAB_EMPTY;\n\n/* Globals */\nint    loc_line_nr;\nstruct list_head locale_list = {NULL, NULL};\nchar   *loc_filename = NULL, *embedded_loc_filename = \"embedded.loc\";\nstatic BOOL localization_initialized = FALSE;\n\n/* Message table */\nchar* default_msg_table[MSG_MAX-MSG_000] = {\"%s\", 0};\nchar* current_msg_table[MSG_MAX-MSG_000] = {\"%s\", 0};\nchar** msg_table = NULL;\n\nstatic void mtab_destroy(BOOL reinit)\n{\n\tsize_t j;\n\tfor (j=1; j<MSG_MAX-MSG_000; j++) {\n\t\tsafe_free(current_msg_table[j]);\n\t\tif (!reinit)\n\t\t\tsafe_free(default_msg_table[j]);\n\t}\n}\n\n/*\n * Add a localization command to a dialog/section\n */\nvoid add_dialog_command(int index, loc_cmd* lcmd)\n{\n\tchar str[128];\n\tloc_cmd* htab_lcmd;\n\tuint32_t i;\n\tif ((lcmd == NULL) || (lcmd->txt[0] == NULL) || (index < 0) || (index >= ARRAYSIZE(loc_dlg))) {\n\t\tuprintf(\"localization: invalid parameter for add_dialog_command\\n\");\n\t\treturn;\n\t}\n\n\t// A dialog command must be unique, so we use a hash to identify any\n\t// command that may already have been populated, and ensure it is replaced\n\t// with the new one.\n\t// Two dialogs may have different \"m IDC_CONTROL\" lines, and also\n\t// \"m IDC_CONTROL\" and \"t IDC_CONTROL\" are separate, so we compute two more\n\t// unique identifiers for dialog and command at the beginning of our string\n\tstr[0] = index + 0x30;\n\tstr[1] = lcmd->command + 0x30;\n\tsafe_strcpy(&str[2], sizeof(str)-2, lcmd->txt[0]);\n\ti = htab_hash(str, &htab_loc);\n\tif (i != 0) {\n\t\thtab_lcmd = (loc_cmd*)(htab_loc.table[i].data);\n\t\tif (htab_lcmd != NULL) {\n\t\t\tlist_del(&(htab_lcmd->list));\n\t\t\tfree_loc_cmd(htab_lcmd);\n\t\t}\n\t\thtab_loc.table[i].data = (void*)lcmd;\n\t}\n\tlist_add(&lcmd->list, &loc_dlg[index].list);\n}\n\n/*\n * Add a translated message to a direct lookup table\n */\nvoid add_message_command(loc_cmd* lcmd)\n{\n\tif (lcmd == NULL) {\n\t\tuprintf(\"localization: invalid parameter for add_message_command\\n\");\n\t\treturn;\n\t}\n\n\tif ((lcmd->ctrl_id <= MSG_000) || (lcmd->ctrl_id >= MSG_MAX)) {\n\t\tuprintf(\"localization: invalid MSG_ index\\n\");\n\t\treturn;\n\t}\n\n\tsafe_free(msg_table[lcmd->ctrl_id-MSG_000]);\n\tmsg_table[lcmd->ctrl_id-MSG_000] = lcmd->txt[1];\n\tlcmd->txt[1] = NULL;\t// String would be freed after this call otherwise\n}\n\nvoid free_loc_cmd(loc_cmd* lcmd)\n{\n\tif (lcmd == NULL)\n\t\treturn;\n\tsafe_free(lcmd->txt[0]);\n\tsafe_free(lcmd->txt[1]);\n\tsafe_free(lcmd->unum);\n\tfree(lcmd);\n}\n\nvoid free_dialog_list(void)\n{\n\tsize_t i = 0;\n\tloc_cmd *lcmd, *next;\n\n\tfor (i=0; i<ARRAYSIZE(loc_dlg); i++) {\n\t\tif (list_empty(&loc_dlg[i].list))\n\t\t\tcontinue;\n\t\tlist_for_each_entry_safe(lcmd, next, &loc_dlg[i].list, loc_cmd, list) {\n\t\t\tlist_del(&lcmd->list);\n\t\t\tfree_loc_cmd(lcmd);\n\t\t}\n\t}\n}\n\nvoid free_locale_list(void)\n{\n\tloc_cmd *lcmd, *next;\n\n\tlist_for_each_entry_safe(lcmd, next, &locale_list, loc_cmd, list) {\n\t\tlist_del(&lcmd->list);\n\t\tfree_loc_cmd(lcmd);\n\t}\n}\n\n/*\n * Init/destroy our various localization lists\n * keep the locale list and filename on reinit\n */\nvoid _init_localization(BOOL reinit) {\n\tsize_t i;\n\tfor (i=0; i<ARRAYSIZE(loc_dlg); i++)\n\t\tlist_init(&loc_dlg[i].list);\n\tif (!reinit)\n\t\tlist_init(&locale_list);\n\thtab_create(LOC_HTAB_SIZE, &htab_loc);\n\tlocalization_initialized = TRUE;\n}\n\nvoid _exit_localization(BOOL reinit) {\n\tif (!localization_initialized)\n\t\treturn;\n\tif (!reinit) {\n\t\tfree_locale_list();\n\t\tif (loc_filename != embedded_loc_filename)\n\t\t\tsafe_free(loc_filename);\n\t}\n\tfree_dialog_list();\n\tmtab_destroy(reinit);\n\thtab_destroy(&htab_loc);\n}\n\n/*\n * Validate and store localization command data\n */\nBOOL dispatch_loc_cmd(loc_cmd* lcmd)\n{\n\tsize_t i;\n\tstatic int dlg_index = 0;\n\tloc_cmd* base_locale = NULL;\n\tconst char* msg_prefix = \"MSG_\";\n\n\tif (lcmd == NULL)\n\t\treturn FALSE;\n\n\tif (lcmd->command <= LC_TEXT) {\n\t\t// Any command up to LC_TEXT takes a control ID in text[0]\n\t\tif (safe_strncmp(lcmd->txt[0], msg_prefix, 4) == 0) {\n\t\t\t// The unneeded NULL check is to silence a VS warning\n\t\t\tif ((lcmd->txt[0] == NULL) || (lcmd->command != LC_TEXT)) {\n\t\t\t\tluprint(\"only the [t]ext command can be applied to a message (MSG_###)\\n\");\n\t\t\t\tgoto err;\n\t\t\t}\n\t\t\t// Try to convert the numeric part of a MSG_#### to a numeric\n\t\t\tlcmd->ctrl_id = MSG_000 + atoi(&(lcmd->txt[0][4]));\n\t\t\tif (lcmd->ctrl_id == MSG_000) {\n\t\t\t\t// Conversion could not be performed\n\t\t\t\tluprintf(\"failed to convert the numeric value in '%s'\\n\", lcmd->txt[0]);\n\t\t\t\tgoto err;\n\t\t\t}\n\t\t\tadd_message_command(lcmd);\n\t\t\tfree_loc_cmd(lcmd);\n\t\t\treturn TRUE;\n\t\t}\n\t\tfor (i=0; i<ARRAYSIZE(control_id); i++) {\n\t\t\tif (safe_strcmp(lcmd->txt[0], control_id[i].name) == 0) {\n\t\t\t\tlcmd->ctrl_id = control_id[i].id;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (lcmd->ctrl_id < 0) {\n\t\t\tluprintf(\"unknown control '%s'\\n\", lcmd->txt[0]);\n\t\t\tgoto err;\n\t\t}\n\t}\n\n\t// Don't process UI commands when we're dealing with the default\n\tif (msg_table == default_msg_table) {\n\t\tfree_loc_cmd(lcmd);\n\t\treturn TRUE;\n\t}\n\n\tswitch(lcmd->command) {\n\t// NB: For commands that take an ID, ctrl_id is always a valid index at this stage\n\tcase LC_TEXT:\n\t\tadd_dialog_command(dlg_index, lcmd);\n\t\tbreak;\n\tcase LC_GROUP:\n\t\tif ((lcmd->ctrl_id-IDD_DIALOG) > ARRAYSIZE(loc_dlg)) {\n\t\t\tluprintf(\"'%s' is not a group ID\\n\", lcmd->txt[0]);\n\t\t\tgoto err;\n\t\t}\n\t\tdlg_index = lcmd->ctrl_id - IDD_DIALOG;\n\t\tfree_loc_cmd(lcmd);\n\t\tbreak;\n\tcase LC_BASE:\n\t\tbase_locale = get_locale_from_name(lcmd->txt[0], FALSE);\n\t\tif (base_locale != NULL) {\n\t\t\tuprintf(\"localization: using locale base '%s'\\n\", lcmd->txt[0]);\n\t\t\tget_loc_data_file(NULL, base_locale);\n\t\t} else {\n\t\t\tluprintf(\"locale base '%s' not found - ignoring\", lcmd->txt[0]);\n\t\t}\n\t\tfree_loc_cmd(lcmd);\n\t\tbreak;\n\tdefault:\n\t\tfree_loc_cmd(lcmd);\n\t\tbreak;\n\t}\n\treturn TRUE;\n\nerr:\n\tfree_loc_cmd(lcmd);\n\treturn FALSE;\n}\n\n/*\n * Apply stored localization commands to a specific dialog\n * If hDlg is NULL, apply the commands against an active Window\n */\nvoid apply_localization(int dlg_id, HWND hDlg)\n{\n\tloc_cmd* lcmd;\n\tHWND hCtrl = NULL;\n\tint id_start = IDD_DIALOG, id_end = IDD_DIALOG + ARRAYSIZE(loc_dlg);\n\n\tif ((dlg_id >= id_start) && (dlg_id < id_end)) {\n\t\t// If we have a valid dialog_id, just process that one dialog\n\t\tid_start = dlg_id;\n\t\tid_end = dlg_id + 1;\n\t\tif (hDlg != NULL) {\n\t\t\tloc_dlg[dlg_id-IDD_DIALOG].hDlg = hDlg;\n\t\t}\n\t}\n\n\tfor (dlg_id = id_start; dlg_id < id_end; dlg_id++) {\n\t\thDlg = loc_dlg[dlg_id-IDD_DIALOG].hDlg;\n\t\tif ((!IsWindow(hDlg)) || (list_empty(&loc_dlg[dlg_id-IDD_DIALOG].list)))\n\t\t\tcontinue;\n\n\t\tlist_for_each_entry(lcmd, &loc_dlg[dlg_id-IDD_DIALOG].list, loc_cmd, list) {\n\t\t\tif (lcmd->command <= LC_TEXT) {\n\t\t\t\tif (lcmd->ctrl_id == dlg_id) {\n\t\t\t\t\tif ((dlg_id == IDD_DIALOG) && (lcmd->txt[1] != NULL) && (lcmd->txt[1][0] != 0)) {\n\t\t\t\t\t\tloc_line_nr = lcmd->line_nr;\n\t\t\t\t\t\tluprint(\"operation forbidden (main dialog title cannot be changed)\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\thCtrl = hDlg;\n\t\t\t\t\tif (dlg_id == IDD_DIALOG)\n\t\t\t\t\t\thDlg = NULL;\n\t\t\t\t} else {\n\t\t\t\t\thCtrl = GetDlgItem(hDlg, lcmd->ctrl_id);\n\t\t\t\t}\n\t\t\t\tif ((hCtrl == NULL) && (hDlg != NULL)) {\n\t\t\t\t\tloc_line_nr = lcmd->line_nr;\n\t\t\t\t\tluprintf(\"control '%s' is not part of dialog '%s'\\n\",\n\t\t\t\t\t\tlcmd->txt[0], control_id[dlg_id-IDD_DIALOG].name);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch(lcmd->command) {\n\t\t\tcase LC_TEXT:\n\t\t\t\tif (hCtrl != NULL) {\n\t\t\t\t\tif ((lcmd->txt[1] != NULL) && (lcmd->txt[1][0] != 0))\n\t\t\t\t\t\tSetWindowTextU(hCtrl, lcmd->txt[1]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/*\n * This function should be called when a localized dialog is destroyed\n * NB: we can't use isWindow() against our existing HWND to avoid this call\n * as handles are recycled.\n */\nvoid reset_localization(int dlg_id)\n{\n\tloc_dlg[dlg_id-IDD_DIALOG].hDlg = NULL;\n}\n\n/*\n * Produce a formatted localized message.\n * Like printf, this call takes a variable number of argument, and uses\n * the message ID to identify the formatted message to use.\n * Uses a rolling list of buffers to allow concurrency\n * TODO: use dynamic realloc'd buffer in case LOC_MESSAGE_SIZE is not enough\n */\nchar* lmprintf(uint32_t msg_id, ...)\n{\n\tstatic int buf_id = 0;\n\tstatic char buf[LOC_MESSAGE_NB][LOC_MESSAGE_SIZE];\n\tchar *format = NULL;\n\tsize_t pos = 0;\n\tva_list args;\n\tBOOL is_rtf = (msg_id & MSG_RTF);\n\n\tbuf_id %= LOC_MESSAGE_NB;\n\tbuf[buf_id][0] = 0;\n\n\tmsg_id &= MSG_MASK;\n\tif ((msg_id >= MSG_000) && (msg_id < MSG_MAX)) {\n\t\tformat = msg_table[msg_id - MSG_000];\n\t}\n\n\tif (format == NULL) {\n\t\tsafe_sprintf(buf[buf_id], LOC_MESSAGE_SIZE-1, \"MSG_%03u UNTRANSLATED\", msg_id - MSG_000);\n\t} else {\n\t\tif (right_to_left_mode && (msg_table != default_msg_table)) {\n\t\t\tif (is_rtf) {\n\t\t\t\tsafe_strcpy(&buf[buf_id][pos], LOC_MESSAGE_SIZE - 1, \"\\\\rtlch\");\n\t\t\t\tpos += 6;\n\t\t\t}\n\t\t\tsafe_strcpy(&buf[buf_id][pos], LOC_MESSAGE_SIZE - 1, RIGHT_TO_LEFT_EMBEDDING);\n\t\t\tpos += sizeof(RIGHT_TO_LEFT_EMBEDDING) - 1;\n\t\t}\n\t\tva_start(args, msg_id);\n\t\tsafe_vsnprintf(&buf[buf_id][pos], LOC_MESSAGE_SIZE - 1 - 2*pos, format, args);\n\t\tva_end(args);\n\t\tif (right_to_left_mode && (msg_table != default_msg_table)) {\n\t\t\tsafe_strcat(buf[buf_id], LOC_MESSAGE_SIZE - 1, POP_DIRECTIONAL_FORMATTING);\n\t\t\tif (is_rtf)\n\t\t\t\tsafe_strcat(buf[buf_id], LOC_MESSAGE_SIZE - 1, \"\\\\ltrch\");\n\t\t}\n\t\tbuf[buf_id][LOC_MESSAGE_SIZE-1] = '\\0';\n\t}\n\treturn buf[buf_id++];\n}\n\n/*\n * The following calls help display a localized message on the info field or status bar as well as its\n * _English_ counterpart in the log (if debug is set).\n * If duration is non zero, that message is displayed for at least duration ms, regardless of\n * any other incoming message. After that time, the display reverts to the last non-timeout message.\n */\n// TODO: handle a timeout message overriding a timeout message\n#define MSG_LEN      256\n#define MSG_STATUS   0\n#define MSG_INFO     1\n#define MSG_LOW_PRI  0\n#define MSG_HIGH_PRI 1\nchar szMessage[2][2][MSG_LEN] = { {\"\", \"\"}, {\"\", \"\"} };\nchar* szStatusMessage = szMessage[MSG_STATUS][MSG_HIGH_PRI];\nstatic BOOL bStatusTimerArmed = FALSE, bOutputTimerArmed[2] = { FALSE, FALSE };\nstatic char *output_msg[2];\nstatic uint64_t last_msg_time[2] = { 0, 0 };\n\nstatic void PrintInfoMessage(char* msg) {\n\tSetWindowTextU(hProgress, msg);\n\tInvalidateRect(hProgress, NULL, TRUE);\n}\nstatic void PrintStatusMessage(char* msg) {\n\tSendMessageLU(hStatus, SB_SETTEXTW, SBT_OWNERDRAW | SB_SECTION_LEFT, msg);\n}\ntypedef void PRINT_FUNCTION(char*);\nPRINT_FUNCTION *PrintMessage[2] = { PrintInfoMessage, PrintStatusMessage };\n\n/*\n * The following timer call is used, along with MAX_REFRESH, to prevent obnoxious flicker\n * on the Info and Status fields due to messages being updated too quickly.\n */\nstatic void CALLBACK OutputMessageTimeout(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)\n{\n\tint i = (idEvent == TID_OUTPUT_INFO)? 0 : 1;\n\n\tKillTimer(hMainDialog, idEvent);\n\tbOutputTimerArmed[i] = FALSE;\n\n\tPrintMessage[i](output_msg[i]);\n\tlast_msg_time[i] = GetTickCount64();\n}\n\nstatic void OutputMessage(BOOL info, char* msg)\n{\n\tuint64_t delta;\n\tint i = info ? 0 : 1;\n\n\tif (bOutputTimerArmed[i]) {\n\t\t// Already have a delayed message going - just change that message to latest\n\t\toutput_msg[i] = msg;\n\t} else {\n\t\t// Find if we need to arm a timer\n\t\tdelta = GetTickCount64() - last_msg_time[i];\n\t\tif (delta < (2 * MAX_REFRESH)) {\n\t\t\t// Not enough time has elapsed since our last output => arm a timer\n\t\t\toutput_msg[i] = msg;\n\t\t\tSetTimer(hMainDialog, TID_OUTPUT_INFO + i, (UINT)((2 * MAX_REFRESH) - delta), OutputMessageTimeout);\n\t\t\tbOutputTimerArmed[i] = TRUE;\n\t\t} else {\n\t\t\tPrintMessage[i](msg);\n\t\t\tlast_msg_time[i] = GetTickCount64();\n\t\t}\n\t}\n}\n\nstatic void CALLBACK PrintMessageTimeout(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)\n{\n\tbStatusTimerArmed = FALSE;\n\t// We're going to print high priority message, so restore our pointer\n\tif (idEvent != TID_MESSAGE_INFO)\n\t\tszStatusMessage = szMessage[MSG_STATUS][MSG_HIGH_PRI];\n\tOutputMessage((idEvent == TID_MESSAGE_INFO), szMessage[(idEvent == TID_MESSAGE_INFO)?MSG_INFO:MSG_STATUS][MSG_HIGH_PRI]);\n\tKillTimer(hMainDialog, idEvent);\n}\n\nvoid PrintStatusInfo(BOOL info, BOOL debug, unsigned int duration, int msg_id, ...)\n{\n\tchar *format = NULL, buf[MSG_LEN];\n\tchar *msg_hi = szMessage[info?MSG_INFO:MSG_STATUS][MSG_HIGH_PRI];\n\tchar *msg_lo = szMessage[info?MSG_INFO:MSG_STATUS][MSG_LOW_PRI];\n\tchar *msg_cur = (duration > 0)?msg_lo:msg_hi;\n\tva_list args;\n\n\tif (msg_id < 0) {\n\t\t// A negative msg_id clears the message\n\t\tmsg_hi[0] = 0;\n\t\tOutputMessage(info, msg_hi);\n\t\treturn;\n\t}\n\n\tif ((msg_id < MSG_000) || (msg_id >= MSG_MAX)) {\n\t\tuprintf(\"PrintStatusInfo: invalid MSG_ID\\n\");\n\t\treturn;\n\t}\n\n\t// We need to keep track of where szStatusMessage should point to so that ellipses work\n\tif (!info)\n\t\tszStatusMessage = szMessage[MSG_STATUS][(duration > 0)?MSG_LOW_PRI:MSG_HIGH_PRI];\n\n\tif ((msg_id >= MSG_000) && (msg_id < MSG_MAX))\n\t\tformat = msg_table[msg_id - MSG_000];\n\tif (format == NULL) {\n\t\tsafe_sprintf(msg_hi, MSG_LEN, \"MSG_%03d UNTRANSLATED\", msg_id - MSG_000);\n\t\tuprintf(msg_hi);\n\t\tOutputMessage(info, msg_hi);\n\t\treturn;\n\t}\n\n\tva_start(args, msg_id);\n\tsafe_vsnprintf(msg_cur, MSG_LEN, format, args);\n\tva_end(args);\n\tmsg_cur[MSG_LEN - 1] = '\\0';\n\n\tif ((duration != 0) || (!bStatusTimerArmed))\n\t\tOutputMessage(info, msg_cur);\n\n\tif (duration != 0) {\n\t\tSetTimer(hMainDialog, (info)?TID_MESSAGE_INFO:TID_MESSAGE_STATUS, duration, PrintMessageTimeout);\n\t\tbStatusTimerArmed = TRUE;\n\t}\n\n\t// Because we want the log messages in English, we go through the VA business once more, but this time with default_msg_table\n\tif (debug) {\n\t\tif ((msg_id >= MSG_000) && (msg_id < MSG_MAX))\n\t\t\tformat = default_msg_table[msg_id - MSG_000];\n\t\tif (format == NULL) {\n\t\t\tsafe_sprintf(buf, sizeof(szStatusMessage), \"(default) MSG_%03d UNTRANSLATED\", msg_id - MSG_000);\n\t\t\treturn;\n\t\t}\n\t\tva_start(args, msg_id);\n\t\tsafe_vsnprintf(buf, MSG_LEN, format, args);\n\t\tva_end(args);\n\t\tbuf[MSG_LEN - 1] = '\\0';\n\t\t// buf may(?) containt a '%' so don't feed it as a naked format string\n\t\tuprintf(\"%s\", buf);\n\t}\n}\n\n/*\n * These 2 functions are used to set the current locale\n * If fallback is true, the call will fall back to use the first\n * translation listed in the loc file\n */\nloc_cmd* get_locale_from_lcid(int lcid, BOOL fallback)\n{\n\tloc_cmd* lcmd = NULL;\n\tint i;\n\n\tif (list_empty(&locale_list)) {\n\t\tuprintf(\"localization: the locale list is empty!\\n\");\n\t\treturn NULL;\n\t}\n\n\tlist_for_each_entry(lcmd, &locale_list, loc_cmd, list) {\n\t\tfor (i=0; i<lcmd->unum_size; i++) {\n\t\t\tif (lcmd->unum[i] == lcid) {\n\t\t\t\treturn lcmd;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!fallback)\n\t\treturn NULL;\n\n\tlcmd = list_entry(locale_list.next, loc_cmd, list);\n\t// If we couldn't find a supported locale, just pick the first one (usually English)\n\tuprintf(\"localization: could not find locale for LCID: 0x%04X. Will default to '%s'\\n\", lcid, lcmd->txt[0]);\n\treturn lcmd;\n}\n\nloc_cmd* get_locale_from_name(char* locale_name, BOOL fallback)\n{\n\tloc_cmd* lcmd = NULL;\n\n\tif (list_empty(&locale_list)) {\n\t\tuprintf(\"localization: the locale list is empty!\\n\");\n\t\treturn NULL;\n\t}\n\n\tlist_for_each_entry(lcmd, &locale_list, loc_cmd, list) {\n\t\tif (safe_strcmp(lcmd->txt[0], locale_name) == 0)\n\t\t\treturn lcmd;\n\t}\n\n\tif (!fallback)\n\t\treturn NULL;\n\n\tlcmd = list_entry(locale_list.next, loc_cmd, list);\n\tuprintf(\"localization: could not find locale for name '%s'. Will default to '%s'\\n\", locale_name, lcmd->txt[0]);\n\treturn lcmd;\n}\n\n/*\n * This call is used to toggle the issuing of messages with the default locale\n * (usually en-US) instead of the current (usually non en) one.\n */\nvoid toggle_default_locale(void)\n{\n\tstatic char** old_msg_table = NULL;\n\n\tif (old_msg_table == NULL) {\n\t\told_msg_table = msg_table;\n\t\tmsg_table = default_msg_table;\n\t} else {\n\t\tmsg_table = old_msg_table;\n\t\told_msg_table = NULL;\n\t}\n}\n\nconst char* get_name_from_id(int id)\n{\n\tint i;\n\tfor (i=0; i<ARRAYSIZE(control_id); i++) {\n\t\tif (control_id[i].id == id)\n\t\t\treturn control_id[i].name;\n\t}\n\treturn \"UNKNOWN ID\";\n}\n\n/*\n * This call is used to get a supported Windows Language identifier we\n * should pass to MessageBoxEx to try to get the buttons displayed in\n * the currently selected language. This relies on the relevant language\n * pack having been installed.\n */\nstatic BOOL found_lang;\nstatic BOOL CALLBACK EnumUILanguagesProc(LPWSTR lpUILanguageString, LONG_PTR lParam)\n{\n\twchar_t* wlang = (wchar_t*)lParam;\n\tif (wcscmp(wlang, lpUILanguageString) == 0)\n\t\tfound_lang = TRUE;\n\treturn TRUE;\n}\n\nWORD get_language_id(loc_cmd* lcmd)\n{\n\tint i;\n\twchar_t wlang[5];\n\tLANGID lang_id = GetUserDefaultUILanguage();\n\n\tif (lcmd == NULL)\n\t\treturn MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);\n\n\t// Find if the selected language is the user default\n\tfor (i = 0; i<lcmd->unum_size; i++) {\n\t\tif (lcmd->unum[i] == lang_id) {\n\t\t\tubprintf(\"Will use default UI locale 0x%04X\", lang_id);\n\t\t\treturn MAKELANGID(lang_id, SUBLANG_DEFAULT);\n\t\t}\n\t}\n\n\t// Selected language is not user default - find if a language pack is installed for it\n\tfound_lang = FALSE;\n\tfor (i = 0; (i<lcmd->unum_size); i++) {\n\t\t// Always uppercase\n\t\t_snwprintf(wlang, ARRAYSIZE(wlang), L\"%04X\", lcmd->unum[i]);\n\t\t// This callback enumeration from Microsoft is retarded. Now we need a global\n\t\t// boolean to tell us that we found what we were after.\n\t\tEnumUILanguages(EnumUILanguagesProc, 0x4, (LONG_PTR)wlang);\t// 0x04 = MUI_LANGUAGE_ID\n\t\tif (found_lang) {\n\t\t\tubprintf(\"Detected installed Windows Language Pack for 0x%04X (%s)\", lcmd->unum[i], lcmd->txt[1]);\n\t\t\treturn MAKELANGID(lcmd->unum[i], SUBLANG_DEFAULT);\n\t\t}\n\t}\n\n\tubprintf(\"NOTE: No Windows Language Pack is installed for %s on this system.\\r\\n\"\n\t\t\"This means that some controls may still be displayed using the system locale.\", lcmd->txt[1]);\n\treturn MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);\n}\n"
  },
  {
    "path": "src/localization.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Localization functions, a.k.a. \"Everybody is doing it wrong but me!\"\n * Copyright © 2013-2016 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <stdint.h>\n#include <stddef.h>\n\n#pragma once\n\n// Number of concurrent localization messages (i.e. messages we can concurrently\n// reference at the same time). Must be a power of 2.\n#define LOC_MESSAGE_NB          32\n#define LOC_MESSAGE_SIZE        2048\n#define LOC_HTAB_SIZE           1031\t// Using a prime speeds up the hash table init\n\n// Attributes that can be set by a translation\n#define LOC_RIGHT_TO_LEFT       0x00000001\n#define LOC_NEEDS_UPDATE        0x00000002\n\n#define MSG_RTF                 0x10000000\n#define MSG_MASK                0x0FFFFFFF\n\n#define luprint(msg) uprintf(\"%s(%d): \" msg \"\\n\", loc_filename, loc_line_nr)\n#define luprintf(msg, ...) uprintf(\"%s(%d): \" msg \"\\n\", loc_filename, loc_line_nr, __VA_ARGS__)\n\n/*\n * List handling functions (stolen from libusb)\n * NB: offsetof() requires '#include <stddef.h>'\n */\nstruct list_head {\n\tstruct list_head *prev, *next;\n};\n\n/* Get an entry from the list\n *  ptr - the address of this list_head element in \"type\"\n *  type - the data type that contains \"member\"\n *  member - the list_head element in \"type\"\n */\n#define list_entry(ptr, type, member) \\\n\t((type *)((uintptr_t)(ptr) - (uintptr_t)offsetof(type, member)))\n\n/* Get each entry from a list\n *  pos - A structure pointer has a \"member\" element\n *  head - list head\n *  member - the list_head element in \"pos\"\n *  type - the type of the first parameter\n */\n#define list_for_each_entry(pos, head, type, member)\t\t\t\\\n\tfor (pos = list_entry((head)->next, type, member);\t\t\t\\\n\t\t &pos->member != (head);\t\t\t\t\t\t\t\t\\\n\t\t pos = list_entry(pos->member.next, type, member))\n\n\n#define list_for_each_entry_safe(pos, n, head, type, member)\t\\\n\tfor (pos = list_entry((head)->next, type, member),\t\t\t\\\n\t\t n = list_entry(pos->member.next, type, member);\t\t\\\n\t\t &pos->member != (head);\t\t\t\t\t\t\t\t\\\n\t\t pos = n, n = list_entry(n->member.next, type, member))\n\n#define list_empty(entry) ((entry)->next == (entry))\n\nstatic __inline void list_init(struct list_head *entry)\n{\n\tentry->prev = entry->next = entry;\n}\n\nstatic __inline void list_add(struct list_head *entry, struct list_head *head)\n{\n\tentry->next = head->next;\n\tentry->prev = head;\n\n\thead->next->prev = entry;\n\thead->next = entry;\n}\n\nstatic __inline void list_add_tail(struct list_head *entry,\n\tstruct list_head *head)\n{\n\tentry->next = head;\n\tentry->prev = head->prev;\n\n\thead->prev->next = entry;\n\thead->prev = entry;\n}\n\nstatic __inline void list_del(struct list_head *entry)\n{\n\tentry->next->prev = entry->prev;\n\tentry->prev->next = entry->next;\n\tentry->next = entry->prev = NULL;\n}\n\n// Commands that take a control ID *MUST* be at the top\n// The last command with a control ID *MUST* be LC_TEXT\nenum loc_command_type {\n\tLC_GROUP,\n\tLC_TEXT,\t// Delimits commands that take a Control ID and commands that don't\n\tLC_VERSION,\n\tLC_LOCALE,\n\tLC_BASE,\n\tLC_FONT,\n\tLC_ATTRIBUTES,\n};\n\ntypedef struct loc_cmd_struct {\n\tuint8_t\t\tcommand;\n\tuint8_t\t\tunum_size;\n\tuint16_t\tline_nr;\n\tint\t\t\tctrl_id;\t// Also used as the attributes mask\n\tint32_t\t\tnum[2];\n\tuint32_t*\tunum;\n\tchar*\t\ttxt[2];\n\tstruct list_head list;\n} loc_cmd;\n\ntypedef struct loc_parse_struct {\n\tchar  c;\n\tenum  loc_command_type cmd;\n\tchar* arg_type;\n} loc_parse;\n\ntypedef struct loc_control_id_struct {\n\tconst char* name;\n\tconst int id;\n} loc_control_id;\n\ntypedef struct loc_dlg_list_struct {\n\tconst int dlg_id;\n\tHWND hDlg;\n\tstruct list_head list;\n} loc_dlg_list;\n\nextern const loc_parse parse_cmd[7];\nextern struct list_head locale_list;\nextern char *default_msg_table[], *current_msg_table[], **msg_table;\nextern int loc_line_nr;\nextern char *loc_filename, *embedded_loc_filename;\nextern BOOL en_msg_mode;\n\nvoid free_loc_cmd(loc_cmd* lcmd);\nBOOL dispatch_loc_cmd(loc_cmd* lcmd);\nvoid _init_localization(BOOL reinit);\nvoid _exit_localization(BOOL reinit);\n#define init_localization() _init_localization(FALSE)\n#define exit_localization() _exit_localization(FALSE)\n#define reinit_localization() do {_exit_localization(TRUE); _init_localization(TRUE);} while(0)\nvoid apply_localization(int dlg_id, HWND hDlg);\nvoid reset_localization(int dlg_id);\nvoid free_dialog_list(void);\nchar* lmprintf(uint32_t msg_id, ...);\nBOOL get_supported_locales(const char* filename);\nBOOL get_loc_data_file(const char* filename, loc_cmd* lcmd);\nvoid free_locale_list(void);\nloc_cmd* get_locale_from_lcid(int lcid, BOOL fallback);\nloc_cmd* get_locale_from_name(char* locale_name, BOOL fallback);\nvoid toggle_default_locale(void);\nconst char* get_name_from_id(int id);\nWORD get_language_id(loc_cmd* lcmd);\n"
  },
  {
    "path": "src/localization_data.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Localization tables - autogenerated from resource.h\n * Copyright © 2013-2024 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <windows.h>\n#include \"resource.h\"\n#include \"localization.h\"\n\n#define LOC_CTRL(x)  { #x, x }\n#define LOC_DLG(x)   { x, NULL, {NULL, NULL} }\n\n// Control IDs\nconst loc_control_id control_id[] = {\n\t// The dialog IDs must come first\n\tLOC_CTRL(IDD_DIALOG),\n\tLOC_CTRL(IDD_ABOUTBOX),\n\tLOC_CTRL(IDD_NOTIFICATION),\n\tLOC_CTRL(IDD_SELECTION),\n\tLOC_CTRL(IDD_LICENSE),\n\tLOC_CTRL(IDD_LOG),\n\tLOC_CTRL(IDD_UPDATE_POLICY),\n\tLOC_CTRL(IDD_NEW_VERSION),\n\tLOC_CTRL(IDD_HASH),\n\tLOC_CTRL(IDD_LIST),\n\tLOC_CTRL(IDC_DEVICE),\n\tLOC_CTRL(IDC_FILE_SYSTEM),\n\tLOC_CTRL(IDC_START),\n\tLOC_CTRL(IDC_PARTITION_TYPE),\n\tLOC_CTRL(IDC_CLUSTER_SIZE),\n\tLOC_CTRL(IDC_STATUS),\n\tLOC_CTRL(IDC_LABEL),\n\tLOC_CTRL(IDC_QUICK_FORMAT),\n\tLOC_CTRL(IDC_BAD_BLOCKS),\n\tLOC_CTRL(IDC_PROGRESS),\n\tLOC_CTRL(IDC_BOOT_SELECTION),\n\tLOC_CTRL(IDC_NB_PASSES),\n\tLOC_CTRL(IDC_TEST),\n\tLOC_CTRL(IDC_SELECT),\n\tLOC_CTRL(IDC_EXTENDED_LABEL),\n\tLOC_CTRL(IDC_UEFI_MEDIA_VALIDATION),\n\tLOC_CTRL(IDC_TARGET_SYSTEM),\n\tLOC_CTRL(IDC_PERSISTENCE_SIZE),\n\tLOC_CTRL(IDC_PERSISTENCE_UNITS),\n\tLOC_CTRL(IDC_OLD_BIOS_FIXES),\n\tLOC_CTRL(IDC_LIST_USB_HDD),\n\tLOC_CTRL(IDC_STATUS_TOOLBAR),\n\tLOC_CTRL(IDC_SAVE),\n\tLOC_CTRL(IDC_HASH),\n\tLOC_CTRL(IDC_IMAGE_OPTION),\n\tLOC_CTRL(IDC_PERSISTENCE_SLIDER),\n\tLOC_CTRL(IDC_ADVANCED_DRIVE_PROPERTIES),\n\tLOC_CTRL(IDC_ADVANCED_FORMAT_OPTIONS),\n\tLOC_CTRL(IDC_ABOUT_LICENSE),\n\tLOC_CTRL(IDC_ABOUT_ICON),\n\tLOC_CTRL(IDC_ABOUT_COPYRIGHTS),\n\tLOC_CTRL(IDC_ABOUT_BLURB),\n\tLOC_CTRL(IDC_LICENSE_TEXT),\n\tLOC_CTRL(IDC_NOTIFICATION_ICON),\n\tLOC_CTRL(IDC_NOTIFICATION_TEXT),\n\tLOC_CTRL(IDC_NOTIFICATION_LINE),\n\tLOC_CTRL(IDC_ADVANCED_DEVICE_TOOLBAR),\n\tLOC_CTRL(IDC_ADVANCED_FORMAT_TOOLBAR),\n\tLOC_CTRL(IDC_SAVE_TOOLBAR),\n\tLOC_CTRL(IDC_HASH_TOOLBAR),\n\tLOC_CTRL(IDC_MULTI_TOOLBAR),\n\tLOC_CTRL(IDC_LANG),\n\tLOC_CTRL(IDC_ABOUT),\n\tLOC_CTRL(IDC_SETTINGS),\n\tLOC_CTRL(IDC_LOG),\n\tLOC_CTRL(IDC_LOG_EDIT),\n\tLOC_CTRL(IDC_LOG_SAVE),\n\tLOC_CTRL(IDC_LOG_CLEAR),\n\tLOC_CTRL(IDC_DONT_DISPLAY_AGAIN),\n\tLOC_CTRL(IDC_MORE_INFO),\n\tLOC_CTRL(IDC_POLICY),\n\tLOC_CTRL(IDC_UPDATE_FREQUENCY),\n\tLOC_CTRL(IDC_INCLUDE_BETAS),\n\tLOC_CTRL(IDC_RELEASE_NOTES),\n\tLOC_CTRL(IDC_DOWNLOAD),\n\tLOC_CTRL(IDC_CHECK_NOW),\n\tLOC_CTRL(IDC_WEBSITE),\n\tLOC_CTRL(IDC_YOUR_VERSION),\n\tLOC_CTRL(IDC_LATEST_VERSION),\n\tLOC_CTRL(IDC_DOWNLOAD_URL),\n\tLOC_CTRL(IDC_MD5),\n\tLOC_CTRL(IDC_SHA1),\n\tLOC_CTRL(IDC_SHA256),\n\tLOC_CTRL(IDC_SHA512),\n\tLOC_CTRL(IDC_SELECTION_ICON),\n\tLOC_CTRL(IDC_SELECTION_TEXT),\n\tLOC_CTRL(IDC_SELECTION_LINE),\n\tLOC_CTRL(IDC_SELECTION_CHOICE1),\n\tLOC_CTRL(IDC_SELECTION_CHOICE2),\n\tLOC_CTRL(IDC_SELECTION_CHOICE3),\n\tLOC_CTRL(IDC_SELECTION_CHOICE4),\n\tLOC_CTRL(IDC_SELECTION_CHOICE5),\n\tLOC_CTRL(IDC_SELECTION_CHOICE6),\n\tLOC_CTRL(IDC_SELECTION_CHOICE7),\n\tLOC_CTRL(IDC_SELECTION_CHOICE8),\n\tLOC_CTRL(IDC_SELECTION_CHOICE9),\n\tLOC_CTRL(IDC_SELECTION_CHOICE10),\n\tLOC_CTRL(IDC_SELECTION_CHOICE11),\n\tLOC_CTRL(IDC_SELECTION_CHOICE12),\n\tLOC_CTRL(IDC_SELECTION_CHOICE13),\n\tLOC_CTRL(IDC_SELECTION_CHOICE14),\n\tLOC_CTRL(IDC_SELECTION_CHOICE15),\n\tLOC_CTRL(IDC_SELECTION_CHOICEMAX),\n\tLOC_CTRL(IDC_LIST_ICON),\n\tLOC_CTRL(IDC_LIST_TEXT),\n\tLOC_CTRL(IDC_LIST_LINE),\n\tLOC_CTRL(IDC_LIST_ITEM1),\n\tLOC_CTRL(IDC_LIST_ITEM2),\n\tLOC_CTRL(IDC_LIST_ITEM3),\n\tLOC_CTRL(IDC_LIST_ITEM4),\n\tLOC_CTRL(IDC_LIST_ITEM5),\n\tLOC_CTRL(IDC_LIST_ITEM6),\n\tLOC_CTRL(IDC_LIST_ITEM7),\n\tLOC_CTRL(IDC_LIST_ITEM8),\n\tLOC_CTRL(IDC_LIST_ITEM9),\n\tLOC_CTRL(IDC_LIST_ITEM10),\n\tLOC_CTRL(IDC_LIST_ITEM11),\n\tLOC_CTRL(IDC_LIST_ITEM12),\n\tLOC_CTRL(IDC_LIST_ITEM13),\n\tLOC_CTRL(IDC_LIST_ITEM14),\n\tLOC_CTRL(IDC_LIST_ITEM15),\n\tLOC_CTRL(IDC_LIST_ITEMMAX),\n\tLOC_CTRL(IDS_DEVICE_TXT),\n\tLOC_CTRL(IDS_PARTITION_TYPE_TXT),\n\tLOC_CTRL(IDS_FILE_SYSTEM_TXT),\n\tLOC_CTRL(IDS_CLUSTER_SIZE_TXT),\n\tLOC_CTRL(IDS_LABEL_TXT),\n\tLOC_CTRL(IDS_CSM_HELP_TXT),\n\tLOC_CTRL(IDS_UPDATE_SETTINGS_GRP),\n\tLOC_CTRL(IDS_UPDATE_FREQUENCY_TXT),\n\tLOC_CTRL(IDS_INCLUDE_BETAS_TXT),\n\tLOC_CTRL(IDS_NEW_VERSION_AVAIL_TXT),\n\tLOC_CTRL(IDS_NEW_VERSION_DOWNLOAD_GRP),\n\tLOC_CTRL(IDS_NEW_VERSION_NOTES_GRP),\n\tLOC_CTRL(IDS_CHECK_NOW_GRP),\n\tLOC_CTRL(IDS_TARGET_SYSTEM_TXT),\n\tLOC_CTRL(IDS_IMAGE_OPTION_TXT),\n\tLOC_CTRL(IDS_BOOT_SELECTION_TXT),\n\tLOC_CTRL(IDS_DRIVE_PROPERTIES_TXT),\n\tLOC_CTRL(IDS_FORMAT_OPTIONS_TXT),\n\tLOC_CTRL(IDS_STATUS_TXT),\n\tLOC_CTRL(MSG_000),\n\tLOC_CTRL(MSG_001),\n\tLOC_CTRL(MSG_002),\n\tLOC_CTRL(MSG_003),\n\tLOC_CTRL(MSG_004),\n\tLOC_CTRL(MSG_005),\n\tLOC_CTRL(MSG_006),\n\tLOC_CTRL(MSG_007),\n\tLOC_CTRL(MSG_008),\n\tLOC_CTRL(MSG_009),\n\tLOC_CTRL(MSG_010),\n\tLOC_CTRL(MSG_011),\n\tLOC_CTRL(MSG_012),\n\tLOC_CTRL(MSG_013),\n\tLOC_CTRL(MSG_014),\n\tLOC_CTRL(MSG_015),\n\tLOC_CTRL(MSG_016),\n\tLOC_CTRL(MSG_017),\n\tLOC_CTRL(MSG_018),\n\tLOC_CTRL(MSG_019),\n\tLOC_CTRL(MSG_020),\n\tLOC_CTRL(MSG_021),\n\tLOC_CTRL(MSG_022),\n\tLOC_CTRL(MSG_023),\n\tLOC_CTRL(MSG_024),\n\tLOC_CTRL(MSG_025),\n\tLOC_CTRL(MSG_026),\n\tLOC_CTRL(MSG_027),\n\tLOC_CTRL(MSG_028),\n\tLOC_CTRL(MSG_029),\n\tLOC_CTRL(MSG_030),\n\tLOC_CTRL(MSG_031),\n\tLOC_CTRL(MSG_032),\n\tLOC_CTRL(MSG_033),\n\tLOC_CTRL(MSG_034),\n\tLOC_CTRL(MSG_035),\n\tLOC_CTRL(MSG_036),\n\tLOC_CTRL(MSG_037),\n\tLOC_CTRL(MSG_038),\n\tLOC_CTRL(MSG_039),\n\tLOC_CTRL(MSG_040),\n\tLOC_CTRL(MSG_041),\n\tLOC_CTRL(MSG_042),\n\tLOC_CTRL(MSG_043),\n\tLOC_CTRL(MSG_044),\n\tLOC_CTRL(MSG_045),\n\tLOC_CTRL(MSG_046),\n\tLOC_CTRL(MSG_047),\n\tLOC_CTRL(MSG_048),\n\tLOC_CTRL(MSG_049),\n\tLOC_CTRL(MSG_050),\n\tLOC_CTRL(MSG_051),\n\tLOC_CTRL(MSG_052),\n\tLOC_CTRL(MSG_053),\n\tLOC_CTRL(MSG_054),\n\tLOC_CTRL(MSG_055),\n\tLOC_CTRL(MSG_056),\n\tLOC_CTRL(MSG_057),\n\tLOC_CTRL(MSG_058),\n\tLOC_CTRL(MSG_059),\n\tLOC_CTRL(MSG_060),\n\tLOC_CTRL(MSG_061),\n\tLOC_CTRL(MSG_062),\n\tLOC_CTRL(MSG_063),\n\tLOC_CTRL(MSG_064),\n\tLOC_CTRL(MSG_065),\n\tLOC_CTRL(MSG_066),\n\tLOC_CTRL(MSG_067),\n\tLOC_CTRL(MSG_068),\n\tLOC_CTRL(MSG_069),\n\tLOC_CTRL(MSG_070),\n\tLOC_CTRL(MSG_071),\n\tLOC_CTRL(MSG_072),\n\tLOC_CTRL(MSG_073),\n\tLOC_CTRL(MSG_074),\n\tLOC_CTRL(MSG_075),\n\tLOC_CTRL(MSG_076),\n\tLOC_CTRL(MSG_077),\n\tLOC_CTRL(MSG_078),\n\tLOC_CTRL(MSG_079),\n\tLOC_CTRL(MSG_080),\n\tLOC_CTRL(MSG_081),\n\tLOC_CTRL(MSG_082),\n\tLOC_CTRL(MSG_083),\n\tLOC_CTRL(MSG_084),\n\tLOC_CTRL(MSG_085),\n\tLOC_CTRL(MSG_086),\n\tLOC_CTRL(MSG_087),\n\tLOC_CTRL(MSG_088),\n\tLOC_CTRL(MSG_089),\n\tLOC_CTRL(MSG_090),\n\tLOC_CTRL(MSG_091),\n\tLOC_CTRL(MSG_092),\n\tLOC_CTRL(MSG_093),\n\tLOC_CTRL(MSG_094),\n\tLOC_CTRL(MSG_095),\n\tLOC_CTRL(MSG_096),\n\tLOC_CTRL(MSG_097),\n\tLOC_CTRL(MSG_098),\n\tLOC_CTRL(MSG_099),\n\tLOC_CTRL(MSG_100),\n\tLOC_CTRL(MSG_101),\n\tLOC_CTRL(MSG_102),\n\tLOC_CTRL(MSG_103),\n\tLOC_CTRL(MSG_104),\n\tLOC_CTRL(MSG_105),\n\tLOC_CTRL(MSG_106),\n\tLOC_CTRL(MSG_107),\n\tLOC_CTRL(MSG_108),\n\tLOC_CTRL(MSG_109),\n\tLOC_CTRL(MSG_110),\n\tLOC_CTRL(MSG_111),\n\tLOC_CTRL(MSG_112),\n\tLOC_CTRL(MSG_113),\n\tLOC_CTRL(MSG_114),\n\tLOC_CTRL(MSG_115),\n\tLOC_CTRL(MSG_116),\n\tLOC_CTRL(MSG_117),\n\tLOC_CTRL(MSG_118),\n\tLOC_CTRL(MSG_119),\n\tLOC_CTRL(MSG_120),\n\tLOC_CTRL(MSG_121),\n\tLOC_CTRL(MSG_122),\n\tLOC_CTRL(MSG_123),\n\tLOC_CTRL(MSG_124),\n\tLOC_CTRL(MSG_125),\n\tLOC_CTRL(MSG_126),\n\tLOC_CTRL(MSG_127),\n\tLOC_CTRL(MSG_128),\n\tLOC_CTRL(MSG_129),\n\tLOC_CTRL(MSG_130),\n\tLOC_CTRL(MSG_131),\n\tLOC_CTRL(MSG_132),\n\tLOC_CTRL(MSG_133),\n\tLOC_CTRL(MSG_134),\n\tLOC_CTRL(MSG_135),\n\tLOC_CTRL(MSG_136),\n\tLOC_CTRL(MSG_137),\n\tLOC_CTRL(MSG_138),\n\tLOC_CTRL(MSG_139),\n\tLOC_CTRL(MSG_140),\n\tLOC_CTRL(MSG_141),\n\tLOC_CTRL(MSG_142),\n\tLOC_CTRL(MSG_143),\n\tLOC_CTRL(MSG_144),\n\tLOC_CTRL(MSG_145),\n\tLOC_CTRL(MSG_146),\n\tLOC_CTRL(MSG_147),\n\tLOC_CTRL(MSG_148),\n\tLOC_CTRL(MSG_149),\n\tLOC_CTRL(MSG_150),\n\tLOC_CTRL(MSG_151),\n\tLOC_CTRL(MSG_152),\n\tLOC_CTRL(MSG_153),\n\tLOC_CTRL(MSG_154),\n\tLOC_CTRL(MSG_155),\n\tLOC_CTRL(MSG_156),\n\tLOC_CTRL(MSG_157),\n\tLOC_CTRL(MSG_158),\n\tLOC_CTRL(MSG_159),\n\tLOC_CTRL(MSG_160),\n\tLOC_CTRL(MSG_161),\n\tLOC_CTRL(MSG_162),\n\tLOC_CTRL(MSG_163),\n\tLOC_CTRL(MSG_164),\n\tLOC_CTRL(MSG_165),\n\tLOC_CTRL(MSG_166),\n\tLOC_CTRL(MSG_167),\n\tLOC_CTRL(MSG_168),\n\tLOC_CTRL(MSG_169),\n\tLOC_CTRL(MSG_170),\n\tLOC_CTRL(MSG_171),\n\tLOC_CTRL(MSG_172),\n\tLOC_CTRL(MSG_173),\n\tLOC_CTRL(MSG_174),\n\tLOC_CTRL(MSG_175),\n\tLOC_CTRL(MSG_176),\n\tLOC_CTRL(MSG_177),\n\tLOC_CTRL(MSG_178),\n\tLOC_CTRL(MSG_179),\n\tLOC_CTRL(MSG_180),\n\tLOC_CTRL(MSG_181),\n\tLOC_CTRL(MSG_182),\n\tLOC_CTRL(MSG_183),\n\tLOC_CTRL(MSG_184),\n\tLOC_CTRL(MSG_185),\n\tLOC_CTRL(MSG_186),\n\tLOC_CTRL(MSG_187),\n\tLOC_CTRL(MSG_188),\n\tLOC_CTRL(MSG_189),\n\tLOC_CTRL(MSG_190),\n\tLOC_CTRL(MSG_191),\n\tLOC_CTRL(MSG_192),\n\tLOC_CTRL(MSG_193),\n\tLOC_CTRL(MSG_194),\n\tLOC_CTRL(MSG_195),\n\tLOC_CTRL(MSG_196),\n\tLOC_CTRL(MSG_197),\n\tLOC_CTRL(MSG_198),\n\tLOC_CTRL(MSG_199),\n\tLOC_CTRL(MSG_200),\n\tLOC_CTRL(MSG_201),\n\tLOC_CTRL(MSG_202),\n\tLOC_CTRL(MSG_203),\n\tLOC_CTRL(MSG_204),\n\tLOC_CTRL(MSG_205),\n\tLOC_CTRL(MSG_206),\n\tLOC_CTRL(MSG_207),\n\tLOC_CTRL(MSG_208),\n\tLOC_CTRL(MSG_209),\n\tLOC_CTRL(MSG_210),\n\tLOC_CTRL(MSG_211),\n\tLOC_CTRL(MSG_212),\n\tLOC_CTRL(MSG_213),\n\tLOC_CTRL(MSG_214),\n\tLOC_CTRL(MSG_215),\n\tLOC_CTRL(MSG_216),\n\tLOC_CTRL(MSG_217),\n\tLOC_CTRL(MSG_218),\n\tLOC_CTRL(MSG_219),\n\tLOC_CTRL(MSG_220),\n\tLOC_CTRL(MSG_221),\n\tLOC_CTRL(MSG_222),\n\tLOC_CTRL(MSG_223),\n\tLOC_CTRL(MSG_224),\n\tLOC_CTRL(MSG_225),\n\tLOC_CTRL(MSG_226),\n\tLOC_CTRL(MSG_227),\n\tLOC_CTRL(MSG_228),\n\tLOC_CTRL(MSG_229),\n\tLOC_CTRL(MSG_230),\n\tLOC_CTRL(MSG_231),\n\tLOC_CTRL(MSG_232),\n\tLOC_CTRL(MSG_233),\n\tLOC_CTRL(MSG_234),\n\tLOC_CTRL(MSG_235),\n\tLOC_CTRL(MSG_236),\n\tLOC_CTRL(MSG_237),\n\tLOC_CTRL(MSG_238),\n\tLOC_CTRL(MSG_239),\n\tLOC_CTRL(MSG_240),\n\tLOC_CTRL(MSG_241),\n\tLOC_CTRL(MSG_242),\n\tLOC_CTRL(MSG_243),\n\tLOC_CTRL(MSG_244),\n\tLOC_CTRL(MSG_245),\n\tLOC_CTRL(MSG_246),\n\tLOC_CTRL(MSG_247),\n\tLOC_CTRL(MSG_248),\n\tLOC_CTRL(MSG_249),\n\tLOC_CTRL(MSG_250),\n\tLOC_CTRL(MSG_251),\n\tLOC_CTRL(MSG_252),\n\tLOC_CTRL(MSG_253),\n\tLOC_CTRL(MSG_254),\n\tLOC_CTRL(MSG_255),\n\tLOC_CTRL(MSG_256),\n\tLOC_CTRL(MSG_257),\n\tLOC_CTRL(MSG_258),\n\tLOC_CTRL(MSG_259),\n\tLOC_CTRL(MSG_260),\n\tLOC_CTRL(MSG_261),\n\tLOC_CTRL(MSG_262),\n\tLOC_CTRL(MSG_263),\n\tLOC_CTRL(MSG_264),\n\tLOC_CTRL(MSG_265),\n\tLOC_CTRL(MSG_266),\n\tLOC_CTRL(MSG_267),\n\tLOC_CTRL(MSG_268),\n\tLOC_CTRL(MSG_269),\n\tLOC_CTRL(MSG_270),\n\tLOC_CTRL(MSG_271),\n\tLOC_CTRL(MSG_272),\n\tLOC_CTRL(MSG_273),\n\tLOC_CTRL(MSG_274),\n\tLOC_CTRL(MSG_275),\n\tLOC_CTRL(MSG_276),\n\tLOC_CTRL(MSG_277),\n\tLOC_CTRL(MSG_278),\n\tLOC_CTRL(MSG_279),\n\tLOC_CTRL(MSG_280),\n\tLOC_CTRL(MSG_281),\n\tLOC_CTRL(MSG_282),\n\tLOC_CTRL(MSG_283),\n\tLOC_CTRL(MSG_284),\n\tLOC_CTRL(MSG_285),\n\tLOC_CTRL(MSG_286),\n\tLOC_CTRL(MSG_287),\n\tLOC_CTRL(MSG_288),\n\tLOC_CTRL(MSG_289),\n\tLOC_CTRL(MSG_290),\n\tLOC_CTRL(MSG_291),\n\tLOC_CTRL(MSG_292),\n\tLOC_CTRL(MSG_293),\n\tLOC_CTRL(MSG_294),\n\tLOC_CTRL(MSG_295),\n\tLOC_CTRL(MSG_296),\n\tLOC_CTRL(MSG_297),\n\tLOC_CTRL(MSG_298),\n\tLOC_CTRL(MSG_299),\n\tLOC_CTRL(MSG_300),\n\tLOC_CTRL(MSG_301),\n\tLOC_CTRL(MSG_302),\n\tLOC_CTRL(MSG_303),\n\tLOC_CTRL(MSG_304),\n\tLOC_CTRL(MSG_305),\n\tLOC_CTRL(MSG_306),\n\tLOC_CTRL(MSG_307),\n\tLOC_CTRL(MSG_308),\n\tLOC_CTRL(MSG_309),\n\tLOC_CTRL(MSG_310),\n\tLOC_CTRL(MSG_311),\n\tLOC_CTRL(MSG_312),\n\tLOC_CTRL(MSG_313),\n\tLOC_CTRL(MSG_314),\n\tLOC_CTRL(MSG_315),\n\tLOC_CTRL(MSG_316),\n\tLOC_CTRL(MSG_317),\n\tLOC_CTRL(MSG_318),\n\tLOC_CTRL(MSG_319),\n\tLOC_CTRL(MSG_320),\n\tLOC_CTRL(MSG_321),\n\tLOC_CTRL(MSG_322),\n\tLOC_CTRL(MSG_323),\n\tLOC_CTRL(MSG_324),\n\tLOC_CTRL(MSG_325),\n\tLOC_CTRL(MSG_326),\n\tLOC_CTRL(MSG_327),\n\tLOC_CTRL(MSG_328),\n\tLOC_CTRL(MSG_329),\n\tLOC_CTRL(MSG_330),\n\tLOC_CTRL(MSG_331),\n\tLOC_CTRL(MSG_332),\n\tLOC_CTRL(MSG_333),\n\tLOC_CTRL(MSG_334),\n\tLOC_CTRL(MSG_335),\n\tLOC_CTRL(MSG_336),\n\tLOC_CTRL(MSG_337),\n\tLOC_CTRL(MSG_338),\n\tLOC_CTRL(MSG_339),\n\tLOC_CTRL(MSG_340),\n\tLOC_CTRL(MSG_341),\n\tLOC_CTRL(MSG_342),\n\tLOC_CTRL(MSG_343),\n\tLOC_CTRL(MSG_344),\n\tLOC_CTRL(MSG_345),\n\tLOC_CTRL(MSG_346),\n\tLOC_CTRL(MSG_347),\n\tLOC_CTRL(MSG_348),\n\tLOC_CTRL(MSG_349),\n\tLOC_CTRL(MSG_350),\n\tLOC_CTRL(MSG_351),\n\tLOC_CTRL(MSG_352),\n\tLOC_CTRL(MSG_353),\n\tLOC_CTRL(MSG_354),\n\tLOC_CTRL(MSG_355),\n\tLOC_CTRL(MSG_356),\n\tLOC_CTRL(MSG_357),\n\tLOC_CTRL(MSG_358),\n\tLOC_CTRL(MSG_359),\n\tLOC_CTRL(MSG_360),\n\tLOC_CTRL(MSG_361),\n\tLOC_CTRL(MSG_362),\n\tLOC_CTRL(MSG_363),\n\tLOC_CTRL(MSG_364),\n\tLOC_CTRL(MSG_365),\n\tLOC_CTRL(MSG_366),\n\tLOC_CTRL(MSG_367),\n\tLOC_CTRL(MSG_368),\n\tLOC_CTRL(MSG_369),\n\tLOC_CTRL(MSG_370),\n\tLOC_CTRL(MSG_371),\n\tLOC_CTRL(MSG_372),\n\tLOC_CTRL(MSG_373),\n\tLOC_CTRL(MSG_374),\n\tLOC_CTRL(MSG_375),\n\tLOC_CTRL(MSG_376),\n\tLOC_CTRL(MSG_377),\n\tLOC_CTRL(MSG_378),\n\tLOC_CTRL(MSG_379),\n\tLOC_CTRL(MSG_380),\n\tLOC_CTRL(MSG_381),\n\tLOC_CTRL(MSG_382),\n\tLOC_CTRL(MSG_383),\n\tLOC_CTRL(MSG_384),\n\tLOC_CTRL(MSG_385),\n\tLOC_CTRL(MSG_386),\n\tLOC_CTRL(MSG_387),\n\tLOC_CTRL(MSG_388),\n\tLOC_CTRL(MSG_389),\n\tLOC_CTRL(MSG_390),\n\tLOC_CTRL(MSG_391),\n\tLOC_CTRL(MSG_392),\n\tLOC_CTRL(MSG_393),\n\tLOC_CTRL(MSG_394),\n\tLOC_CTRL(MSG_395),\n\tLOC_CTRL(MSG_396),\n\tLOC_CTRL(MSG_397),\n\tLOC_CTRL(MSG_398),\n\tLOC_CTRL(MSG_399),\n\tLOC_CTRL(MSG_MAX),\n\tLOC_CTRL(IDOK),\n\tLOC_CTRL(IDCANCEL),\n\tLOC_CTRL(IDABORT),\n\tLOC_CTRL(IDRETRY),\n\tLOC_CTRL(IDIGNORE),\n\tLOC_CTRL(IDYES),\n\tLOC_CTRL(IDNO),\n\tLOC_CTRL(IDCLOSE),\n\tLOC_CTRL(IDHELP),\n};\n\n// Dialog data\nloc_dlg_list loc_dlg[] = {\n\tLOC_DLG(IDD_DIALOG),\n\tLOC_DLG(IDD_ABOUTBOX),\n\tLOC_DLG(IDD_NOTIFICATION),\n\tLOC_DLG(IDD_SELECTION),\n\tLOC_DLG(IDD_LICENSE),\n\tLOC_DLG(IDD_LOG),\n\tLOC_DLG(IDD_UPDATE_POLICY),\n\tLOC_DLG(IDD_NEW_VERSION),\n\tLOC_DLG(IDD_HASH),\n\tLOC_DLG(IDD_LIST),\n};\n"
  },
  {
    "path": "src/localization_data.sh",
    "content": "#!/bin/sh\n\necho This file recreates localization_data.h according resource.h\necho\n\n# check that sed is available\ntype -P sed &>/dev/null || { echo \"sed command not found. Aborting.\" >&2; exit 1; }\n\n# Create the first sed command file\ncat > cmd.sed <<\\_EOF\n# Insert header\n1i /*\\\n * Rufus: The Reliable USB Formatting Utility\\\n * Localization tables - autogenerated from resource.h\\\n * Copyright © 2013-2026 Pete Batard <pete@akeo.ie>\\\n *\\\n * This program is free software: you can redistribute it and/or modify\\\n * it under the terms of the GNU General Public License as published by\\\n * the Free Software Foundation, either version 3 of the License, or\\\n * (at your option) any later version.\\\n *\\\n * This program is distributed in the hope that it will be useful,\\\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\\\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\n * GNU General Public License for more details.\\\n *\\\n * You should have received a copy of the GNU General Public License\\\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\\\n */\\\n\\\n#include <windows.h>\\\n#include \"resource.h\"\\\n#include \"localization.h\"\\\n\\\n#define LOC_CTRL(x)  { #x, x }\\\n#define LOC_DLG(x)   { x, NULL, {NULL, NULL} }\\\n\\\n// Control IDs\\\nconst loc_control_id control_id[] = {\\\n\t// The dialog IDs must come first\n\n# Add the control entries - must be in IDD_, IDC_, IDS_ or MSG_ (and not contain _XP or _RTL suffix)\ns/^.* IDD_.*_RTL .*//\ns/^.* IDD_.*_XP .*//\ns/^#define \\([I|M][D|S][D|C|S|G]_[^ ]*\\) .*/\\\tLOC_CTRL(\\1),/\n\n# Add standard IDs from windows.h and close table\n$a\\\n\tLOC_CTRL(IDOK),\\\n\tLOC_CTRL(IDCANCEL),\\\n\tLOC_CTRL(IDABORT),\\\n\tLOC_CTRL(IDRETRY),\\\n\tLOC_CTRL(IDIGNORE),\\\n\tLOC_CTRL(IDYES),\\\n\tLOC_CTRL(IDNO),\\\n\tLOC_CTRL(IDCLOSE),\\\n\tLOC_CTRL(IDHELP),\\\n\\};\\\n\n# Remove everything else\n/^[#|\\/]/d\n/^$/d\n_EOF\n\n# Run first part\nsed -f cmd.sed resource.h > localization_data.h\n\n# Create the second sed command file\ncat > cmd.sed <<\\_EOF\n\n# Insert dialog table header\n1i // Dialog data\\\nloc_dlg_list loc_dlg[] = {\n\n# Add the dialog entries - must start with IDD_\ns/^.* IDD_.*_RTL .*//\ns/^.* IDD_.*_XP .*//\ns/^#define \\(IDD_[^ ]*\\) .*/\\\tLOC_DLG(\\1),/\n\n# Close the table\n$a\\\n};\n\n# Remove everything else\n/^[#|\\/]/d\n/^$/d\n_EOF\n\n# Run second part\nsed -f cmd.sed resource.h >> localization_data.h\n\nrm cmd.sed\necho Done.\n"
  },
  {
    "path": "src/mbr_types.h",
    "content": "/*\n    GNU fdisk - a clone of Linux fdisk.\n\n    Copyright © 2020 Pete Batard <pete@akeo.ie>\n    Copyright © 2006 Free Software Foundation, Inc.\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA\n*/\n\n#include <inttypes.h>\n\n#pragma once\n\ntypedef struct {\n\tconst uint8_t type;\n\tconst char *name;\n} mbr_type_t;\n\n/*\n * File system types for MBR partition tables\n * See http://en.wikipedia.org/wiki/Partition_type\n * Also http://www.win.tue.nl/~aeb/partitions/partition_types-1.html\n * Note: If googling APTI (Alternative Partition Table Identification)\n * doesn't return squat, then IT ISN'T A REAL THING!!\n */\nmbr_type_t mbr_type[] = {\n\t{ 0x00, \"Empty\" },\n\t{ 0x01, \"FAT12\" },\n\t{ 0x02, \"XENIX root\" },\n\t{ 0x03, \"XENIX usr\" },\n\t{ 0x04, \"Small FAT16\" },\n\t{ 0x05, \"Extended\" },\n\t{ 0x06, \"FAT16\" },\n\t{ 0x07, \"NTFS/exFAT/UDF\" },\n\t{ 0x08, \"AIX\" },\n\t{ 0x09, \"AIX Bootable\" },\n\t{ 0x0a, \"OS/2 Boot Manager\" },\n\t{ 0x0b, \"FAT32\" },\n\t{ 0x0c, \"FAT32 LBA\" },\n\t{ 0x0e, \"FAT16 LBA\" },\n\t{ 0x0f, \"Extended LBA\" },\n\t{ 0x10, \"OPUS\" },\n\t{ 0x11, \"Hidden FAT12\" },\n\t{ 0x12, \"Compaq Diagnostics\" },\n\t{ 0x14, \"Hidden Small FAT16\" },\n\t{ 0x16, \"Hidden FAT16\" },\n\t{ 0x17, \"Hidden NTFS\" },\n\t{ 0x18, \"AST SmartSleep\" },\n\t{ 0x1b, \"Hidden FAT32\" },\n\t{ 0x1c, \"Hidden FAT32 LBA\" },\n\t{ 0x1e, \"Hidden FAT16 LBA\" },\n\t{ 0x20, \"Windows Mobile XIP\" },\n\t{ 0x21, \"SpeedStor\" },\n\t{ 0x23, \"Windows Mobile XIP\" },\n\t{ 0x24, \"NEC DOS\" },\n\t{ 0x25, \"Windows Mobile IMGFS\" },\n\t{ 0x27, \"Hidden NTFS WinRE\" },\n\t{ 0x39, \"Plan 9\" },\n\t{ 0x3c, \"PMagic Recovery\" },\n\t{ 0x40, \"Venix 80286\" },\n\t{ 0x41, \"PPC PReP Boot\" },\n\t{ 0x42, \"SFS\" },\n\t{ 0x4d, \"QNX4.x\" },\n\t{ 0x4e, \"QNX4.x\" },\n\t{ 0x4f, \"QNX4.x\" },\n\t{ 0x50, \"OnTrack DM\" },\n\t{ 0x51, \"OnTrack DM\" },\n\t{ 0x52, \"CP/M\" },\n\t{ 0x53, \"OnTrack DM\" },\n\t{ 0x54, \"OnTrack DM\" },\n\t{ 0x55, \"EZ Drive\" },\n\t{ 0x56, \"Golden Bow\" },\n\t{ 0x5c, \"Priam EDisk\" },\n\t{ 0x61, \"SpeedStor\" },\n\t{ 0x63, \"GNU HURD/SysV\" },\n\t{ 0x64, \"Netware\" },\n\t{ 0x65, \"Netware\" },\n\t{ 0x66, \"Netware\" },\n\t{ 0x67, \"Netware\" },\n\t{ 0x68, \"Netware\" },\n\t{ 0x69, \"Netware\" },\n\t{ 0x70, \"DiskSecure MultiBoot\" },\n\t{ 0x75, \"PC/IX\" },\n\t{ 0x77, \"Novell\" },\n\t{ 0x78, \"XOSL\" },\n\t{ 0x7e, \"F.I.X.\" },\n\t{ 0x7e, \"AODPS\" },\n\t{ 0x80, \"Minix\" },\n\t{ 0x81, \"Minix\" },\n\t{ 0x82, \"GNU/Linux Swap\" },\n\t{ 0x83, \"GNU/Linux\" },\n\t{ 0x84, \"Windows Hibernation\" },\n\t{ 0x85, \"GNU/Linux Extended\" },\n\t{ 0x86, \"NTFS Volume Set\" },\n\t{ 0x87, \"NTFS Volume Set\" },\n\t{ 0x88, \"GNU/Linux Plaintext\" },\n\t{ 0x8d, \"FreeDOS Hidden FAT12\" },\n\t{ 0x8e, \"GNU/Linux LVM\" },\n\t{ 0x90, \"FreeDOS Hidden FAT16\" },\n\t{ 0x91, \"FreeDOS Hidden Extended\" },\n\t{ 0x92, \"FreeDOS Hidden FAT16\" },\n\t{ 0x93, \"GNU/Linux Hidden\" },\n\t{ 0x96, \"CHRP ISO-9660\" },\n\t{ 0x97, \"FreeDOS Hidden FAT32\" },\n\t{ 0x98, \"FreeDOS Hidden FAT32\" },\n\t{ 0x9a, \"FreeDOS Hidden FAT16\" },\n\t{ 0x9b, \"FreeDOS Hidden Extended\" },\n\t{ 0x9f, \"BSD/OS\" },\n\t{ 0xa0, \"Hibernation\" },\n\t{ 0xa1, \"Hibernation\" },\n\t{ 0xa2, \"SpeedStor\" },\n\t{ 0xa3, \"SpeedStor\" },\n\t{ 0xa4, \"SpeedStor\" },\n\t{ 0xa5, \"FreeBSD\" },\n\t{ 0xa6, \"OpenBSD\" },\n\t{ 0xa7, \"NeXTSTEP\" },\n\t{ 0xa8, \"Darwin UFS\" },\n\t{ 0xa9, \"NetBSD\" },\n\t{ 0xab, \"Darwin Boot\" },\n\t{ 0xaf, \"HFS/HFS+\" },\n\t{ 0xb0, \"BootStar Dummy\" },\n\t{ 0xb1, \"QNX\" },\n\t{ 0xb2, \"QNX\" },\n\t{ 0xb3, \"QNX\" },\n\t{ 0xb4, \"SpeedStor\" },\n\t{ 0xb6, \"SpeedStor\" },\n\t{ 0xb7, \"BSDI\" },\n\t{ 0xb8, \"BSDI Swap\" },\n\t{ 0xbb, \"BootWizard Hidden\" },\n\t{ 0xbc, \"Acronis SZ\" },\n\t{ 0xbe, \"Solaris Boot\" },\n\t{ 0xbf, \"Solaris\" },\n\t{ 0xc0, \"Secured FAT\" },\n\t{ 0xc1, \"DR DOS FAT12\" },\n\t{ 0xc2, \"GNU/Linux Hidden\" },\n\t{ 0xc3, \"GNU/Linux Hidden Swap\" },\n\t{ 0xc4, \"DR DOS FAT16\" },\n\t{ 0xc4, \"DR DOS Extended\" },\n\t{ 0xc6, \"DR DOS FAT16\" },\n\t{ 0xc7, \"Syrinx\" },\n\t{ 0xcd, \"ISOHybrid\" },\n\t{ 0xda, \"Non-FS Data\" },\n\t{ 0xdb, \"CP/M\" },\n\t{ 0xde, \"Dell Utility\" },\n\t{ 0xdf, \"BootIt\" },\n\t{ 0xe0, \"ST AVFS\" },\n\t{ 0xe1, \"SpeedStor\" },\n\t{ 0xe3, \"SpeedStor\" },\n\t{ 0xe4, \"SpeedStor\" },\n\t{ 0xe6, \"SpeedStor\" },\n\t{ 0xe8, \"LUKS\" },\n\t{ 0xea, \"Rufus Extra\" },\n\t{ 0xeb, \"BeOS/Haiku\" },\n\t{ 0xec, \"SkyFS\" },\n\t{ 0xed, \"GPT Hybrid MBR\" },\n\t{ 0xee, \"GPT Protective MBR\" },\n\t{ 0xef, \"EFI System Partition\" },\n\t{ 0xf0, \"PA-RISC Boot\" },\n\t{ 0xf1, \"SpeedStor\" },\n\t{ 0xf2, \"DOS secondary\" },\n\t{ 0xf3, \"SpeedStor\" },\n\t{ 0xf4, \"SpeedStor\" },\n\t{ 0xf6, \"SpeedStor\" },\n\t{ 0xfa, \"Bochs\" },\n\t{ 0xfb, \"VMware VMFS\" },\n\t{ 0xfc, \"VMware VMKCORE\" },\n\t{ 0xfd, \"GNU/Linux RAID Auto\" },\n\t{ 0xfe, \"LANstep\" },\n\t{ 0xff, \"XENIX BBT\" },\n\t{ 0, NULL }\n};\n"
  },
  {
    "path": "src/missing.h",
    "content": "/*\n* Rufus: The Reliable USB Formatting Utility\n* Constants and defines missing from various toolchains\n* Copyright © 2016-2025 Pete Batard <pete@akeo.ie>\n*\n* This program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU General Public License as published by\n* the Free Software Foundation, either version 3 of the License, or\n* (at your option) any later version.\n*\n* This program is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n* GNU General Public License for more details.\n*\n* You should have received a copy of the GNU General Public License\n* along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n#include <windows.h>\n#include <intrin.h>\n\n#pragma once\n\n#ifndef MIN\n#define MIN(a,b) (((a) < (b)) ? (a) : (b))\n#endif\n\n#ifndef MAX\n#define MAX(a,b) (((a) > (b)) ? (a) : (b))\n#endif\n\n#define MAP_BIT(bit) do { map[_log2(bit)] = b; b <<= 1; } while(0)\n\n#define FLOOR_ALIGN(x, y) (((x) / (y)) * (y))\n#define CEILING_ALIGN(x, y) ((((x) + (y) - 1) / (y)) * (y))\n\n#define IS_HEXASCII(c) (((c) >= '0' && (c) <= '9') || ((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f'))\n#define FROM_HEXASCII(c) (((c) >= '0' && (c) <= '9') ? (c) - '0' : (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A' + 10 : \\\n\t(((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 10 : 0 )))\n\n/*\n * Prefetch 64 bytes at address m, for read-only operation\n * We account for these built-in calls doing nothing if the\n * line has already been fetched, or if the address is invalid.\n */\n#if defined(__GNUC__) || defined(__clang__)\n#define PREFETCH64(m) do { __builtin_prefetch((m), 0, 0); __builtin_prefetch((m) + 32, 0, 0); } while(0)\n#elif defined(_MSC_VER)\n#if defined(_M_IX86) || defined (_M_X64)\n#define PREFETCH64(m) do { _m_prefetch((void*)(m)); _m_prefetch((void*)((m) + 32)); } while(0)\n#else\n// _m_prefetch() doesn't seem to exist for MSVC/ARM\n#define PREFETCH64(m)\n#endif\n#endif\n\n/* Read/write with endianness swap */\n#if defined (_MSC_VER) && (_MSC_VER >= 1300)\n#include <stdlib.h>\n#pragma intrinsic(_byteswap_ushort)\n#pragma intrinsic(_byteswap_ulong)\n#pragma intrinsic(_byteswap_uint64)\n#define bswap_uint64 _byteswap_uint64\n#define bswap_uint32 _byteswap_ulong\n#define bswap_uint16 _byteswap_ushort\n#elif defined (__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))\n#define bswap_uint64 __builtin_bswap64\n#define bswap_uint32 __builtin_bswap32\n#define bswap_uint16 __builtin_bswap16\n#endif\n#define read_swap16(p) bswap_uint16(*(const uint16_t*)(const uint8_t*)(p))\n#define read_swap32(p) bswap_uint32(*(const uint32_t*)(const uint8_t*)(p))\n#define read_swap64(p) bswap_uint64(*(const uint64_t*)(const uint8_t*)(p))\n#define write_swap16(p,v) (*(uint16_t*)(void*)(p)) = bswap_uint16(v)\n#define write_swap32(p,v) (*(uint32_t*)(void*)(p)) = bswap_uint32(v)\n#define write_swap64(p,v) (*(uint64_t*)(void*)(p)) = bswap_uint64(v)\n\n/*\n * Nibbled from https://github.com/hanji/popcnt/blob/master/populationcount.cpp\n * Since MSVC x86_32 and/or ARM don't have intrinsic popcount and I don't have all day\n */\nstatic __inline uint8_t popcnt8(uint8_t val)\n{\n\tstatic const uint8_t nibble_lookup[16] = {\n\t\t0, 1, 1, 2, 1, 2, 2, 3,\n\t\t1, 2, 2, 3, 2, 3, 3, 4\n\t};\n\treturn nibble_lookup[val & 0x0F] + nibble_lookup[val >> 4];\n}\n\nstatic __inline uint8_t popcnt64(register uint64_t u)\n{\n\tu = (u & 0x5555555555555555ULL) + ((u >> 1) & 0x5555555555555555ULL);\n\tu = (u & 0x3333333333333333ULL) + ((u >> 2) & 0x3333333333333333ULL);\n\tu = (u & 0x0f0f0f0f0f0f0f0fULL) + ((u >> 4) & 0x0f0f0f0f0f0f0f0fULL);\n\tu = (u & 0x00ff00ff00ff00ffULL) + ((u >> 8) & 0x00ff00ff00ff00ffULL);\n\tu = (u & 0x0000ffff0000ffffULL) + ((u >> 16) & 0x0000ffff0000ffffULL);\n\tu = (u & 0x00000000ffffffffULL) + ((u >> 32) & 0x00000000ffffffffULL);\n\treturn (uint8_t)u;\n}\n\nstatic __inline void *_reallocf(void *ptr, size_t size) {\n\tvoid *ret = realloc(ptr, size);\n\tif (!ret)\n\t\tfree(ptr);\n\treturn ret;\n}\n\nstatic __inline int _log2(register int val)\n{\n\tint ret = 0;\n\tif (val < 0)\n\t\treturn -2;\n\twhile (val >>= 1)\n\t\tret++;\n\treturn ret;\n}\n\n/// <summary>\n/// Remaps bits from a byte according to an 8x8 bit matrix.\n/// </summary>\n/// <param name=\"src\">The byte to remap.</param>\n/// <param name=\"map\">An 8-byte array where each byte has a single bit set to the position to remap to.</param>\n/// <param name=\"reverse\">Indicates whether the reverse mapping operation should be applied.</param>\n/// <returns>The remapped byte data.</returns>\nstatic __inline uint8_t remap8(uint8_t src, uint8_t* map, const BOOL reverse)\n{\n\tuint8_t i, m = 1, r = 0;\n\tfor (i = 0, m = 1; i < (sizeof(src) * 8); i++, m <<= 1) {\n\t\tif (reverse) {\n\t\t\tif (src & map[i])\n\t\t\t\tr |= m;\n\t\t} else {\n\t\t\tif (src & m)\n\t\t\t\tr |= map[i];\n\t\t}\n\t}\n\treturn r;\n}\n\n/// <summary>\n/// Remaps bits from a 16-bit word according to a 16x16 bit matrix.\n/// </summary>\n/// <param name=\"src\">The word to remap.</param>\n/// <param name=\"map\">A 16-word array where each word has a single bit set to the position to remap to.</param>\n/// <param name=\"reverse\">Indicates whether the reverse mapping operation should be applied.</param>\n/// <returns>The remapped byte data.</returns>\nstatic __inline uint16_t remap16(uint16_t src, uint16_t* map, const BOOL reverse)\n{\n\tuint16_t i, m = 1, r = 0;\n\tfor (i = 0, m = 1; i < (sizeof(src) * 8); i++, m <<= 1) {\n\t\tif (reverse) {\n\t\t\tif (src & map[i])\n\t\t\t\tr |= m;\n\t\t} else {\n\t\t\tif (src & m)\n\t\t\t\tr |= map[i];\n\t\t}\n\t}\n\treturn r;\n}\n\n/* Why oh why does Microsoft have to make everybody suffer with their braindead use of Unicode? */\n#define _RT_ICON\t\t\tMAKEINTRESOURCEA(3)\n#define _RT_DIALOG\t\t\tMAKEINTRESOURCEA(5)\n#define _RT_RCDATA\t\t\tMAKEINTRESOURCEA(10)\n#define _RT_GROUP_ICON\t\tMAKEINTRESOURCEA((ULONG_PTR)(MAKEINTRESOURCEA(3) + 11))\n\n/* MinGW doesn't know these */\n#ifndef WM_CLIENTSHUTDOWN\n#define WM_CLIENTSHUTDOWN                       0x3B\n#endif\n#ifndef WM_COPYGLOBALDATA\n#define WM_COPYGLOBALDATA                       0x49\n#endif\n#ifndef INTERNET_OPTION_ENABLE_HTTP_PROTOCOL\n#define INTERNET_OPTION_ENABLE_HTTP_PROTOCOL    148\n#endif\n#ifndef INTERNET_OPTION_HTTP_DECODING\n#define INTERNET_OPTION_HTTP_DECODING           65\n#endif\n#ifndef HTTP_PROTOCOL_FLAG_HTTP2\n#define HTTP_PROTOCOL_FLAG_HTTP2                2\n#endif\n#ifndef ERROR_OFFSET_ALIGNMENT_VIOLATION\n#define ERROR_OFFSET_ALIGNMENT_VIOLATION        327\n#endif\n\n/* RISC-V and LoongArch are still bleeding edge */\n#ifndef IMAGE_FILE_MACHINE_RISCV32\n#define IMAGE_FILE_MACHINE_RISCV32 0x5032\n#endif\n#ifndef IMAGE_FILE_MACHINE_RISCV64\n#define IMAGE_FILE_MACHINE_RISCV64 0x5064\n#endif\n#ifndef IMAGE_FILE_MACHINE_RISCV128\n#define IMAGE_FILE_MACHINE_RISCV128 0x5128\n#endif\n#ifndef IMAGE_FILE_MACHINE_LOONGARCH32\n#define IMAGE_FILE_MACHINE_LOONGARCH32 0x6232\n#endif\n#ifndef IMAGE_FILE_MACHINE_LOONGARCH64\n#define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264\n#endif\n"
  },
  {
    "path": "src/ms-sys/.editorconfig",
    "content": "[*]\ntab_width = 8\n"
  },
  {
    "path": "src/ms-sys/Makefile.am",
    "content": "noinst_LIBRARIES = libmssys.a\n\nlibmssys_a_SOURCES = fat12.c fat16.c fat32.c ntfs.c partition_info.c br.c file.c\nlibmssys_a_CFLAGS = -I$(srcdir)/inc $(AM_CFLAGS)\n"
  },
  {
    "path": "src/ms-sys/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = src/ms-sys\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLIBRARIES = $(noinst_LIBRARIES)\nARFLAGS = cru\nAM_V_AR = $(am__v_AR_@AM_V@)\nam__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)\nam__v_AR_0 = @echo \"  AR      \" $@;\nam__v_AR_1 = \nlibmssys_a_AR = $(AR) $(ARFLAGS)\nlibmssys_a_LIBADD =\nam_libmssys_a_OBJECTS = libmssys_a-fat12.$(OBJEXT) \\\n\tlibmssys_a-fat16.$(OBJEXT) libmssys_a-fat32.$(OBJEXT) \\\n\tlibmssys_a-ntfs.$(OBJEXT) libmssys_a-partition_info.$(OBJEXT) \\\n\tlibmssys_a-br.$(OBJEXT) libmssys_a-file.$(OBJEXT)\nlibmssys_a_OBJECTS = $(am_libmssys_a_OBJECTS)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp =\nam__depfiles_maybe =\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libmssys_a_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LIBRARIES = libmssys.a\nlibmssys_a_SOURCES = fat12.c fat16.c fat32.c ntfs.c partition_info.c br.c file.c\nlibmssys_a_CFLAGS = -I$(srcdir)/inc $(AM_CFLAGS)\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/ms-sys/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps src/ms-sys/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLIBRARIES:\n\t-test -z \"$(noinst_LIBRARIES)\" || rm -f $(noinst_LIBRARIES)\n\nlibmssys.a: $(libmssys_a_OBJECTS) $(libmssys_a_DEPENDENCIES) $(EXTRA_libmssys_a_DEPENDENCIES) \n\t$(AM_V_at)-rm -f libmssys.a\n\t$(AM_V_AR)$(libmssys_a_AR) libmssys.a $(libmssys_a_OBJECTS) $(libmssys_a_LIBADD)\n\t$(AM_V_at)$(RANLIB) libmssys.a\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n.c.o:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\nlibmssys_a-fat12.o: fat12.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-fat12.o `test -f 'fat12.c' || echo '$(srcdir)/'`fat12.c\n\nlibmssys_a-fat12.obj: fat12.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-fat12.obj `if test -f 'fat12.c'; then $(CYGPATH_W) 'fat12.c'; else $(CYGPATH_W) '$(srcdir)/fat12.c'; fi`\n\nlibmssys_a-fat16.o: fat16.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-fat16.o `test -f 'fat16.c' || echo '$(srcdir)/'`fat16.c\n\nlibmssys_a-fat16.obj: fat16.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-fat16.obj `if test -f 'fat16.c'; then $(CYGPATH_W) 'fat16.c'; else $(CYGPATH_W) '$(srcdir)/fat16.c'; fi`\n\nlibmssys_a-fat32.o: fat32.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-fat32.o `test -f 'fat32.c' || echo '$(srcdir)/'`fat32.c\n\nlibmssys_a-fat32.obj: fat32.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-fat32.obj `if test -f 'fat32.c'; then $(CYGPATH_W) 'fat32.c'; else $(CYGPATH_W) '$(srcdir)/fat32.c'; fi`\n\nlibmssys_a-ntfs.o: ntfs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-ntfs.o `test -f 'ntfs.c' || echo '$(srcdir)/'`ntfs.c\n\nlibmssys_a-ntfs.obj: ntfs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-ntfs.obj `if test -f 'ntfs.c'; then $(CYGPATH_W) 'ntfs.c'; else $(CYGPATH_W) '$(srcdir)/ntfs.c'; fi`\n\nlibmssys_a-partition_info.o: partition_info.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-partition_info.o `test -f 'partition_info.c' || echo '$(srcdir)/'`partition_info.c\n\nlibmssys_a-partition_info.obj: partition_info.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-partition_info.obj `if test -f 'partition_info.c'; then $(CYGPATH_W) 'partition_info.c'; else $(CYGPATH_W) '$(srcdir)/partition_info.c'; fi`\n\nlibmssys_a-br.o: br.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-br.o `test -f 'br.c' || echo '$(srcdir)/'`br.c\n\nlibmssys_a-br.obj: br.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-br.obj `if test -f 'br.c'; then $(CYGPATH_W) 'br.c'; else $(CYGPATH_W) '$(srcdir)/br.c'; fi`\n\nlibmssys_a-file.o: file.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-file.o `test -f 'file.c' || echo '$(srcdir)/'`file.c\n\nlibmssys_a-file.obj: file.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmssys_a_CFLAGS) $(CFLAGS) -c -o libmssys_a-file.obj `if test -f 'file.c'; then $(CYGPATH_W) 'file.c'; else $(CYGPATH_W) '$(srcdir)/file.c'; fi`\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LIBRARIES)\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \\\n\tdistclean-compile distclean-generic distclean-tags dvi dvi-am \\\n\thtml html-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "src/ms-sys/br.c",
    "content": "/******************************************************************\n    Copyright (C) 2009-2015  Henrik Carlqvist\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n******************************************************************/\n#include <stdio.h>\n\n#include \"file.h\"\n#include \"nls.h\"\n#include \"br.h\"\n\nunsigned long ulBytesPerSector = 512;\n\nvoid set_bytes_per_sector(unsigned long ulValue)\n{\n   ulBytesPerSector = ulValue;\n   if ((ulBytesPerSector < 512) || (ulBytesPerSector > 65536))\n      ulBytesPerSector = 512;\n} /* set_bytes_per_sector */\n\nuint32_t read_windows_disk_signature(FILE *fp)\n{\n   uint32_t tWDS;\n   if(!read_data(fp, 0x1b8, &tWDS, 4))\n      return 0;\n   return tWDS;\n} /* read_windows_disk_signature */\n\nint write_windows_disk_signature(FILE *fp, uint32_t tWDS)\n{\n   return write_data(fp, 0x1b8, &tWDS, 4);\n} /* write_windows_disk_signature */\n\nuint16_t read_mbr_copy_protect_bytes(FILE *fp)\n{\n   uint16_t tOut;\n   if(!read_data(fp, 0x1bc, &tOut, 2))\n      return 0xffff;\n   return tOut;\n} /* read_mbr_copy_protect_bytes */\n\nconst char *read_mbr_copy_protect_bytes_explained(FILE *fp)\n{\n   uint16_t t = read_mbr_copy_protect_bytes(fp);\n   switch(t)\n   {\n      case 0:\n\t return _(\"not copy protected\");\n      case 0x5a5a:\n\t return _(\"copy protected\");\n      default:\n\t return _(\"unknown value\");\n   }\n} /* read_mbr_copy_protect_bytes_explained */\n\nint is_br(FILE *fp)\n{\n   /* A \"file\" is probably some kind of boot record if it contains the magic\n      chars 0x55, 0xAA at position 0x1FE */\n   unsigned char aucRef[] = {0x55, 0xAA};\n\n   return contains_data(fp, 0x1FE, aucRef, sizeof(aucRef));\n} /* is_br */\n\nint is_lilo_br(FILE *fp)\n{\n   /* A \"file\" is probably a LILO boot record if it contains the magic\n      chars LILO at position 0x6 or 0x2 for floppies */\n   unsigned char aucRef[] = {'L','I','L','O'};\n\n   return ( contains_data(fp, 0x6, aucRef, sizeof(aucRef)) ||\n\t    contains_data(fp, 0x2, aucRef, sizeof(aucRef)) );\n} /* is_lilo_br */\n\nint is_dos_mbr(FILE *fp)\n{\n   #include \"mbr_dos.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_dos_0x0, sizeof(mbr_dos_0x0)) &&\n      is_br(fp);\n} /* is_dos_mbr */\n\nint is_dos_f2_mbr(FILE *fp)\n{\n   #include \"mbr_dos_f2.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_dos_f2_0x0, sizeof(mbr_dos_f2_0x0)) &&\n      is_br(fp);\n} /* is_dos_f2_mbr */\n\nint is_95b_mbr(FILE *fp)\n{\n   #include \"mbr_95b.h\"\n\n   return\n      contains_data(fp, 0x0,   mbr_95b_0x0,   sizeof(mbr_95b_0x0)) &&\n      contains_data(fp, 0x0e0, mbr_95b_0x0e0, sizeof(mbr_95b_0x0e0)) &&\n      is_br(fp);\n} /* is_95b_mbr */\n\nint is_2000_mbr(FILE *fp)\n{\n   #include \"mbr_2000.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_2000_0x0, MBR_2000_LANG_INDEP_LEN) &&\n      is_br(fp);\n} /* is_2000_mbr */\n\nint is_vista_mbr(FILE *fp)\n{\n   #include \"mbr_vista.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_vista_0x0, MBR_VISTA_LANG_INDEP_LEN) &&\n      is_br(fp);\n} /* is_vista_mbr */\n\nint is_win7_mbr(FILE *fp)\n{\n   #include \"mbr_win7.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_win7_0x0, MBR_WIN7_LANG_INDEP_LEN) &&\n      is_br(fp);\n} /* is_win7_mbr */\n\nint is_rufus_mbr(FILE *fp)\n{\n   #include \"mbr_rufus.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_rufus_0x0, sizeof(mbr_rufus_0x0)) &&\n      is_br(fp);\n} /* is_rufus_mbr */\n\nint is_rufus_msg_mbr(FILE *fp)\n{\n#include \"mbr_msg_rufus.h\"\n\n    return\n       contains_data(fp, 0x0, mbr_msg_rufus_0x0, sizeof(mbr_msg_rufus_0x0)) &&\n       is_br(fp);\n} /* is_rufus_msg_mbr */\n\nint is_reactos_mbr(FILE *fp)\n{\n   #include \"mbr_reactos.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_reactos_0x0, sizeof(mbr_reactos_0x0)) &&\n      is_br(fp);\n} /* is_reactos_mbr */\n\nint is_grub4dos_mbr(FILE *fp)\n{\n   #include \"mbr_grub.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_grub_0x0, sizeof(mbr_grub_0x0)) &&\n      is_br(fp);\n} /* is_grub_mbr */\n\nint is_grub2_mbr(FILE *fp)\n{\n   #include \"mbr_grub2.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_grub2_0x0, sizeof(mbr_grub2_0x0)) &&\n      is_br(fp);\n} /* is_grub2_mbr */\n\nint is_kolibrios_mbr(FILE *fp)\n{\n   #include \"mbr_kolibri.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_kolibri_0x0, sizeof(mbr_kolibri_0x0)) &&\n      is_br(fp);\n} /* is_kolibri_mbr */\n\nint is_syslinux_mbr(FILE *fp)\n{\n   #include \"mbr_syslinux.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_syslinux_0x0, sizeof(mbr_syslinux_0x0)) &&\n      is_br(fp);\n} /* is_syslinux_mbr */\n\nint is_syslinux_gpt_mbr(FILE *fp)\n{\n   #include \"mbr_gpt_syslinux.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_gpt_syslinux_0x0,\n\t\t    sizeof(mbr_gpt_syslinux_0x0)) &&\n      is_br(fp);\n} /* is_syslinux_gpt_mbr */\n\nint is_zero_mbr(FILE *fp)\n{\n   #include \"mbr_zero.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_zero_0x0, sizeof(mbr_zero_0x0));\n\t/* Don't bother to check 55AA signature */\n} /* is_zero_mbr */\n\nint is_zero_mbr_not_including_disk_signature_or_copy_protect(FILE *fp)\n{\n   #include \"mbr_zero.h\"\n\n   return\n      contains_data(fp, 0x0, mbr_zero_0x0, 0x1b8);\n} /* is_zero_mbr_not_including_disk_signature_or_copy_protect */\n\n/* Handle nonstandard sector sizes (such as 4K) by writing\n   the boot marker at every 512-2 bytes location */\nstatic int write_bootmark(FILE *fp)\n{\n   unsigned char aucRef[] = {0x55, 0xAA};\n   unsigned long pos = 0x1FE;\n\n   for (pos = 0x1FE; pos < ulBytesPerSector; pos += 0x200) {\n      if (!write_data(fp, pos, aucRef, sizeof(aucRef)))\n\t\t    return 0;\n   }\n   return 1;\n}\n\nint write_dos_mbr(FILE *fp)\n{\n   #include \"mbr_dos.h\"\n\n   return\n      write_data(fp, 0x0, mbr_dos_0x0, sizeof(mbr_dos_0x0)) &&\n      write_bootmark(fp);\n} /* write_dos_mbr */\n\nint write_95b_mbr(FILE *fp)\n{\n   #include \"mbr_95b.h\"\n\n   return\n      write_data(fp, 0x0,   mbr_95b_0x0, sizeof(mbr_95b_0x0)) &&\n      write_data(fp, 0x0e0, mbr_95b_0x0e0, sizeof(mbr_95b_0x0e0)) &&\n      write_bootmark(fp);\n} /* write_95b_mbr */\n\nint write_2000_mbr(FILE *fp)\n{\n   #include \"mbr_2000.h\"\n\n   return\n      write_data(fp, 0x0, mbr_2000_0x0, sizeof(mbr_2000_0x0)) &&\n      write_bootmark(fp);\n} /* write_2000_mbr */\n\nint write_vista_mbr(FILE *fp)\n{\n   #include \"mbr_vista.h\"\n\n   return\n      write_data(fp, 0x0, mbr_vista_0x0, sizeof(mbr_vista_0x0)) &&\n      write_bootmark(fp);\n} /* write_vista_mbr */\n\nint write_win7_mbr(FILE *fp)\n{\n   #include \"mbr_win7.h\"\n\n   return\n      write_data(fp, 0x0, mbr_win7_0x0, sizeof(mbr_win7_0x0)) &&\n      write_bootmark(fp);\n} /* write_win7_mbr */\n\nint write_rufus_mbr(FILE *fp)\n{\n   #include \"mbr_rufus.h\"\n\n   return\n      write_data(fp, 0x0, mbr_rufus_0x0, sizeof(mbr_rufus_0x0)) &&\n      write_bootmark(fp);\n} /* write_rufus_mbr */\n\nint write_rufus_msg_mbr(FILE *fp)\n{\n#include \"mbr_msg_rufus.h\"\n\n    return\n       write_data(fp, 0x0, mbr_msg_rufus_0x0, sizeof(mbr_msg_rufus_0x0)) &&\n       write_bootmark(fp);\n} /* write_rufus_msg_mbr */\n\nint write_reactos_mbr(FILE *fp)\n{\n   #include \"mbr_reactos.h\"\n\n   return\n      write_data(fp, 0x0, mbr_reactos_0x0, sizeof(mbr_reactos_0x0)) &&\n      write_bootmark(fp);\n} /* write_reactos_mbr */\n\nint write_kolibrios_mbr(FILE *fp)\n{\n   #include \"mbr_kolibri.h\"\n\n   return\n      write_data(fp, 0x0, mbr_kolibri_0x0, sizeof(mbr_kolibri_0x0)) &&\n      write_bootmark(fp);\n} /* write_kolibri_mbr */\n\nint write_syslinux_mbr(FILE *fp)\n{\n   #include \"mbr_syslinux.h\"\n\n   return\n      write_data(fp, 0x0, mbr_syslinux_0x0, sizeof(mbr_syslinux_0x0)) &&\n      write_bootmark(fp);\n} /* write_syslinux_mbr */\n\nint write_syslinux_gpt_mbr(FILE *fp)\n{\n   #include \"mbr_gpt_syslinux.h\"\n\n   return\n      write_data(fp, 0x0, mbr_gpt_syslinux_0x0, sizeof(mbr_gpt_syslinux_0x0)) &&\n      write_bootmark(fp);\n} /* write_syslinux_gpt_mbr */\n\nint write_grub4dos_mbr(FILE *fp)\n{\n   #include \"mbr_grub.h\"\n\n   return\n      write_data(fp, 0x0, mbr_grub_0x0, sizeof(mbr_grub_0x0)) &&\n      write_bootmark(fp);\n}\n\nint write_grub2_mbr(FILE *fp)\n{\n   #include \"mbr_grub2.h\"\n\n   return\n      write_data(fp, 0x0, mbr_grub2_0x0, sizeof(mbr_grub2_0x0)) &&\n      write_bootmark(fp);\n}\n\nint write_zero_mbr(FILE *fp)\n{\n   #include \"mbr_zero.h\"\n\n   return\n      write_data(fp, 0x0, mbr_zero_0x0, sizeof(mbr_zero_0x0)) &&\n      write_bootmark(fp);\n} /* write_zero_mbr */\n"
  },
  {
    "path": "src/ms-sys/fat12.c",
    "content": "/******************************************************************\n    Copyright (C) 2009  Henrik Carlqvist\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n******************************************************************/\n#include <stdio.h>\n#include <string.h>\n\n#include \"file.h\"\n#include \"fat12.h\"\n\nint is_fat_12_fs(FILE *fp)\n{\n   char *szMagic = \"FAT12   \";\n\n   return contains_data(fp, 0x36, szMagic, strlen(szMagic));\n} /* is_fat_12_fs */\n\nint entire_fat_12_br_matches(FILE *fp)\n{\n   #include \"br_fat12_0x0.h\"\n   #include \"br_fat12_0x3e.h\"\n\n   return\n      ( contains_data(fp, 0x0, br_fat12_0x0, sizeof(br_fat12_0x0)) &&\n\t/* BIOS Parameter Block might differ between systems */\n\tcontains_data(fp, 0x3e, br_fat12_0x3e, sizeof(br_fat12_0x3e)) );\n} /* entire_fat_12_br_matches */\n\nint write_fat_12_br(FILE *fp, int bKeepLabel)\n{\n   #include \"label_11_char.h\"\n   #include \"br_fat12_0x0.h\"\n   #include \"br_fat12_0x3e.h\"\n\n   if(bKeepLabel)\n      return\n\t ( write_data(fp, 0x0, br_fat12_0x0, sizeof(br_fat12_0x0)) &&\n\t   /* BIOS Parameter Block might differ between systems */\n\t   write_data(fp, 0x3e, br_fat12_0x3e, sizeof(br_fat12_0x3e)) );\n   else\n      return\n\t ( write_data(fp, 0x0, br_fat12_0x0, sizeof(br_fat12_0x0)) &&\n\t   /* BIOS Parameter Block might differ between systems */\n\t   write_data(fp, 0x2b, label_11_char, sizeof(label_11_char)) &&\n\t   write_data(fp, 0x3e, br_fat12_0x3e, sizeof(br_fat12_0x3e)) );\n} /* write_fat_12_br */\n"
  },
  {
    "path": "src/ms-sys/fat16.c",
    "content": "/******************************************************************\n    Copyright (C) 2009  Henrik Carlqvist\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n******************************************************************/\n#include <stdio.h>\n#include <string.h>\n\n#include \"file.h\"\n#include \"fat16.h\"\n\nint is_fat_16_fs(FILE *fp)\n{\n   char *szMagic = \"FAT16   \";\n\n   return contains_data(fp, 0x36, szMagic, strlen(szMagic));\n} /* is_fat_16_fs */\n\nint is_fat_16_br(FILE *fp)\n{\n   /* A \"file\" is probably some kind of FAT16 boot record if it contains the\n      magic chars 0x55, 0xAA at positions 0x1FE */\n   unsigned char aucRef[] = {0x55, 0xAA};\n   unsigned char aucMagic[] = {'M','S','W','I','N','4','.','1'};\n\n   if( ! contains_data(fp, 0x1FE, aucRef, sizeof(aucRef)))\n      return 0;\n   if( ! contains_data(fp, 0x03, aucMagic, sizeof(aucMagic)))\n      return 0;\n   return 1;\n} /* is_fat_16_br */\n\nint entire_fat_16_br_matches(FILE *fp)\n{\n   #include \"br_fat16_0x0.h\"\n   #include \"br_fat16_0x3e.h\"\n\n   return\n      ( contains_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) &&\n\t/* BIOS Parameter Block might differ between systems */\n\tcontains_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) );\n} /* entire_fat_16_br_matches */\n\nint write_fat_16_br(FILE *fp, int bKeepLabel)\n{\n   #include \"label_11_char.h\"\n   #include \"br_fat16_0x0.h\"\n   #include \"br_fat16_0x3e.h\"\n\n   if(bKeepLabel)\n      return\n\t ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) );\n   else\n      return\n\t ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x2b, label_11_char, sizeof(label_11_char)) &&\n\t   write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) );\n} /* write_fat_16_br */\n\nint entire_fat_16_fd_br_matches(FILE *fp)\n{\n   #include \"br_fat16_0x0.h\"\n   #include \"br_fat16fd_0x3e.h\"\n\n   return\n      ( contains_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) &&\n\t/* BIOS Parameter Block might differ between systems */\n\tcontains_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) );\n} /* entire_fat_16_fd_br_matches */\n\nint write_fat_16_fd_br(FILE *fp, int bKeepLabel)\n{\n   #include \"label_11_char.h\"\n   #include \"br_fat16_0x0.h\"\n   #include \"br_fat16fd_0x3e.h\"\n\n   if(bKeepLabel)\n      return\n\t ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) );\n   else\n      return\n\t ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x2b, label_11_char, sizeof(label_11_char)) &&\n\t   write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) );      \n} /* write_fat_16_fd_br */\n\nint entire_fat_16_ros_br_matches(FILE *fp)\n{\n   #include \"br_fat16ros_0x0.h\"\n   #include \"br_fat16ros_0x3e.h\"\n\n   return\n      ( contains_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) &&\n\t/* BIOS Parameter Block might differ between systems */\n\tcontains_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) );\n} /* entire_fat_16_ros_br_matches */\n\nint write_fat_16_ros_br(FILE *fp, int bKeepLabel)\n{\n   #include \"label_11_char.h\"\n   #include \"br_fat16ros_0x0.h\"\n   #include \"br_fat16ros_0x3e.h\"\n\n   if(bKeepLabel)\n      return\n\t ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) );\n   else\n      return\n\t ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x2b, label_11_char, sizeof(label_11_char)) &&\n\t   write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) );\n} /* write_fat_16_ros_br */\n"
  },
  {
    "path": "src/ms-sys/fat32.c",
    "content": "/******************************************************************\n    Copyright (C) 2009  Henrik Carlqvist\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n******************************************************************/\n#include <stdio.h>\n#include <string.h>\n\n#include \"file.h\"\n#include \"fat32.h\"\n\nint is_fat_32_fs(FILE *fp)\n{\n   char *szMagic = \"FAT32   \";\n\n   return contains_data(fp, 0x52, szMagic, strlen(szMagic));\n} /* is_fat_32_fs */\n\nint is_fat_32_br(FILE *fp)\n{\n   /* A \"file\" is probably some kind of FAT32 boot record if it contains the\n      magic chars 0x55, 0xAA at positions 0x1FE, 0x3FE and 0x5FE */\n   unsigned char aucRef[] = {0x55, 0xAA};\n   unsigned char aucMagic[] = {'M','S','W','I','N','4','.','1'};\n   int i;\n\n   for(i=0 ; i<3 ; i++)\n      if( ! contains_data(fp, 0x1FEULL + i * 0x200ULL, aucRef, sizeof(aucRef)))\n\t return 0;\n   if( ! contains_data(fp, 0x03, aucMagic, sizeof(aucMagic)))\n      return 0;\n   return 1;\n} /* is_fat_32_br */\n\nint entire_fat_32_br_matches(FILE *fp)\n{\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32_0x52.h\"\n   #include \"br_fat32_0x3f0.h\"\n\n   return\n      ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t/* BIOS Parameter Block might differ between systems */\n\tcontains_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) &&\n\t/* Cluster information might differ between systems */\n\tcontains_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) );\n} /* entire_fat_32_br_matches */\n\nint write_fat_32_br(FILE *fp, int bKeepLabel)\n{\n   #include \"label_11_char.h\"\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32_0x52.h\"\n   #include \"br_fat32_0x3f0.h\"\n\n   if(bKeepLabel)\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) &&\n\t   /* Cluster information is not overwritten, however, it would be OK\n\t      to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */\n\t   write_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) );\n   else\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) &&\n\t   write_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) &&\n\t   /* Cluster information is not overwritten, however, it would be OK\n\t      to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */\n\t   write_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) );\n} /* write_fat_32_br */\n\nint entire_fat_32_fd_br_matches(FILE *fp)\n{\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32fd_0x52.h\"\n   #include \"br_fat32fd_0x3f0.h\"\n\n   return\n      ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t/* BIOS Parameter Block might differ between systems */\n\tcontains_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) &&\n\t/* Cluster information might differ between systems */\n\tcontains_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) );\n} /* entire_fat_32_fd_br_matches */\n\nint write_fat_32_fd_br(FILE *fp, int bKeepLabel)\n{\n   #include \"label_11_char.h\"\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32fd_0x52.h\"\n   #include \"br_fat32fd_0x3f0.h\"\n\n   if(bKeepLabel)\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) &&\n\t   /* Cluster information is not overwritten, however, it would be OK\n\t      to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */\n\t   write_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) );\n   else\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) &&\n\t   write_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) &&\n\t   /* Cluster information is not overwritten, however, it would be OK\n\t      to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */\n\t   write_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) );\n} /* write_fat_32_fd_br */\n\nint entire_fat_32_nt_br_matches(FILE *fp)\n{\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32nt_0x52.h\"\n   #include \"br_fat32nt_0x3f0.h\"\n   #include \"br_fat32nt_0x1800.h\"\n\n   return\n      ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t/* BIOS Parameter Block might differ between systems */\n\tcontains_data(fp, 0x52, br_fat32nt_0x52, sizeof(br_fat32nt_0x52)) &&\n\t/* Cluster information might differ between systems */\n\tcontains_data(fp, 0x3f0, br_fat32nt_0x3f0, sizeof(br_fat32nt_0x3f0)) &&\n\tcontains_data(fp, 0x1800, br_fat32nt_0x1800, sizeof(br_fat32nt_0x1800))\n\t );\n} /* entire_fat_32_nt_br_matches */\n\nint write_fat_32_nt_br(FILE *fp, int bKeepLabel)\n{\n   #include \"label_11_char.h\"\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32nt_0x52.h\"\n   #include \"br_fat32nt_0x3f0.h\"\n   #include \"br_fat32nt_0x1800.h\"\n\n   if(bKeepLabel)\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x52, br_fat32nt_0x52, sizeof(br_fat32nt_0x52)) &&\n   /* Cluster information is not overwritten, however, it would be OK\n      to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */\n\t   write_data(fp, 0x3f0, br_fat32nt_0x3f0, sizeof(br_fat32nt_0x3f0)) &&\n\t   write_data(fp, 0x1800, br_fat32nt_0x1800, sizeof(br_fat32nt_0x1800))\n\t    );\n   else\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) &&\n\t   write_data(fp, 0x52, br_fat32nt_0x52, sizeof(br_fat32nt_0x52)) &&\n   /* Cluster information is not overwritten, however, it would be OK\n      to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */\n\t   write_data(fp, 0x3f0, br_fat32nt_0x3f0, sizeof(br_fat32nt_0x3f0)) &&\n\t   write_data(fp, 0x1800, br_fat32nt_0x1800, sizeof(br_fat32nt_0x1800))\n\t    );\n} /* write_fat_32_nt_br */\n\nint entire_fat_32_pe_br_matches(FILE *fp)\n{\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32pe_0x52.h\"\n   #include \"br_fat32pe_0x3f0.h\"\n   #include \"br_fat32pe_0x1800.h\"\n\n   return\n      ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t/* BIOS Parameter Block might differ between systems */\n\tcontains_data(fp, 0x52, br_fat32pe_0x52, sizeof(br_fat32pe_0x52)) &&\n\t/* Cluster information might differ between systems */\n\tcontains_data(fp, 0x3f0, br_fat32pe_0x3f0, sizeof(br_fat32pe_0x3f0)) &&\n\tcontains_data(fp, 0x1800, br_fat32pe_0x1800, sizeof(br_fat32pe_0x1800))\n\t );\n} /* entire_fat_32_nt_br_matches */\n\nint write_fat_32_pe_br(FILE *fp, int bKeepLabel)\n{\n   #include \"label_11_char.h\"\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32pe_0x52.h\"\n   #include \"br_fat32pe_0x3f0.h\"\n   #include \"br_fat32pe_0x1800.h\"\n\n   if(bKeepLabel)\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x52, br_fat32pe_0x52, sizeof(br_fat32pe_0x52)) &&\n   /* Cluster information is not overwritten, however, it would bo OK\n      to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */\n\t   write_data(fp, 0x3f0, br_fat32pe_0x3f0, sizeof(br_fat32pe_0x3f0)) &&\n\t   write_data(fp, 0x1800, br_fat32pe_0x1800, sizeof(br_fat32pe_0x1800))\n\t    );\n   else\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) &&\n\t   write_data(fp, 0x52, br_fat32pe_0x52, sizeof(br_fat32pe_0x52)) &&\n   /* Cluster information is not overwritten, however, it would bo OK\n      to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */\n\t   write_data(fp, 0x3f0, br_fat32pe_0x3f0, sizeof(br_fat32pe_0x3f0)) &&\n\t   write_data(fp, 0x1800, br_fat32pe_0x1800, sizeof(br_fat32pe_0x1800))\n\t    );\n} /* write_fat_32_pe_br */\n\nint entire_fat_32_ros_br_matches(FILE *fp)\n{\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32ros_0x52.h\"\n   #include \"br_fat32ros_0x3f0.h\"\n   #include \"br_fat32ros_0x1c00.h\"\n\n   return\n      ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t/* BIOS Parameter Block might differ between systems */\n\tcontains_data(fp, 0x52, br_fat32ros_0x52, sizeof(br_fat32ros_0x52)) &&\n\t/* Cluster information might differ between systems */\n\tcontains_data(fp, 0x3f0, br_fat32ros_0x3f0, sizeof(br_fat32ros_0x3f0)) &&\n\tcontains_data(fp, 0x1c00, br_fat32ros_0x1c00, sizeof(br_fat32ros_0x1c00))\n\t );\n} /* entire_fat_32_ros_br_matches */\n\n/* See http://doxygen.reactos.org/dc/d83/bootsup_8c_source.html#l01596 */\nint write_fat_32_ros_br(FILE *fp, int bKeepLabel)\n{\n   #include \"label_11_char.h\"\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32ros_0x52.h\"\n   #include \"br_fat32ros_0x3f0.h\"\n   #include \"br_fat32ros_0x1c00.h\"\n\n   if(bKeepLabel)\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x52, br_fat32ros_0x52, sizeof(br_fat32ros_0x52)) &&\n   /* Cluster information is not overwritten, however, it would be OK\n      to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */\n\t   write_data(fp, 0x3f0, br_fat32ros_0x3f0, sizeof(br_fat32ros_0x3f0)) &&\n\t   write_data(fp, 0x1c00, br_fat32ros_0x1c00, sizeof(br_fat32ros_0x1c00))\n\t    );\n   else\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) &&\n\t   write_data(fp, 0x52, br_fat32ros_0x52, sizeof(br_fat32ros_0x52)) &&\n   /* Cluster information is not overwritten, however, it would be OK\n      to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */\n\t   write_data(fp, 0x3f0, br_fat32ros_0x3f0, sizeof(br_fat32ros_0x3f0)) &&\n\t   write_data(fp, 0x1c00, br_fat32ros_0x1c00, sizeof(br_fat32ros_0x1c00))\n\t    );\n} /* write_fat_32_ros_br */\n\nint entire_fat_32_kos_br_matches(FILE *fp)\n{\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32kos_0x52.h\"\n\n   return\n      ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n        contains_data(fp, 0x52, br_fat32kos_0x52, sizeof(br_fat32kos_0x52)) );\n} /* entire_fat_32_kos_br_matches */\n\nint write_fat_32_kos_br(FILE *fp, int bKeepLabel)\n{\n   #include \"label_11_char.h\"\n   #include \"br_fat32_0x0.h\"\n   #include \"br_fat32kos_0x52.h\"\n\n   if(bKeepLabel)\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   write_data(fp, 0x52, br_fat32kos_0x52, sizeof(br_fat32kos_0x52)) );\n   else\n      return\n\t ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) &&\n\t   write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) &&\n\t   write_data(fp, 0x52, br_fat32kos_0x52, sizeof(br_fat32kos_0x52)) );\n} /* write_fat_32_kos_br */\n"
  },
  {
    "path": "src/ms-sys/file.c",
    "content": "/******************************************************************\n    Copyright (C) 2009  Henrik Carlqvist\n    Modified for Rufus/Windows (C) 2011-2019  Pete Batard\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n******************************************************************/\n#include <stdio.h>\n#include <string.h>\n#include <stdint.h>\n\n#include \"../rufus.h\"\n#include \"file.h\"\n\nextern unsigned long ulBytesPerSector;\n\n/* Returns the number of bytes written or -1 on error */\nint64_t write_sectors(HANDLE hDrive, uint64_t SectorSize,\n                      uint64_t StartSector, uint64_t nSectors,\n                      const void *pBuf)\n{\n   LARGE_INTEGER ptr;\n   DWORD Size;\n\n   if((nSectors*SectorSize) > 0xFFFFFFFFUL)\n   {\n      uprintf(\"write_sectors: nSectors x SectorSize is too big\\n\");\n      return -1;\n   }\n   Size = (DWORD)(nSectors*SectorSize);\n\n   ptr.QuadPart = StartSector*SectorSize;\n   if(!SetFilePointerEx(hDrive, ptr, NULL, FILE_BEGIN))\n   {\n      uprintf(\"write_sectors: Could not access sector 0x%08\" PRIx64 \" - %s\\n\", StartSector, WindowsErrorString());\n      return -1;\n   }\n\n   LastWriteError = 0;\n   if(!WriteFileWithRetry(hDrive, pBuf, Size, &Size, WRITE_RETRIES))\n   {\n      LastWriteError = RUFUS_ERROR(GetLastError());\n      uprintf(\"write_sectors: Write error %s\\n\", WindowsErrorString());\n      uprintf(\"  StartSector: 0x%08\" PRIx64 \", nSectors: 0x%\" PRIx64 \", SectorSize: 0x%\" PRIx64 \"\\n\", StartSector, nSectors, SectorSize);\n      return -1;\n   }\n   if (Size != nSectors*SectorSize)\n   {\n      /* Some large drives return 0, even though all the data was written - See github #787 */\n      if (large_drive && Size == 0) {\n         uprintf(\"WARNING: Possible short write\\n\");\n         return 0;\n      }\n      uprintf(\"write_sectors: Write error\\n\");\n      LastWriteError = RUFUS_ERROR(ERROR_WRITE_FAULT);\n      uprintf(\"  Wrote: %d, Expected: %\" PRIu64 \"\\n\", Size, nSectors*SectorSize);\n      uprintf(\"  StartSector: 0x%08\" PRIx64 \", nSectors: 0x%\" PRIx64 \", SectorSize: 0x%\" PRIx64 \"\\n\", StartSector, nSectors, SectorSize);\n      return -1;\n   }\n\n   return (int64_t)Size;\n}\n\n/* Returns the number of bytes read or -1 on error */\nint64_t read_sectors(HANDLE hDrive, uint64_t SectorSize,\n                     uint64_t StartSector, uint64_t nSectors,\n                     void *pBuf)\n{\n   LARGE_INTEGER ptr;\n   DWORD Size;\n\n   if((nSectors*SectorSize) > 0xFFFFFFFFUL)\n   {\n      uprintf(\"read_sectors: nSectors x SectorSize is too big\\n\");\n      return -1;\n   }\n   Size = (DWORD)(nSectors*SectorSize);\n\n   ptr.QuadPart = StartSector*SectorSize;\n   if(!SetFilePointerEx(hDrive, ptr, NULL, FILE_BEGIN))\n   {\n      uprintf(\"read_sectors: Could not access sector 0x%08\" PRIx64 \" - %s\\n\", StartSector, WindowsErrorString());\n      return -1;\n   }\n\n   if((!ReadFile(hDrive, pBuf, Size, &Size, NULL)) || (Size != nSectors*SectorSize))\n   {\n      uprintf(\"read_sectors: Read error %s\\n\", (GetLastError()!=ERROR_SUCCESS)?WindowsErrorString():\"\");\n      uprintf(\"  Read: %d, Expected: %\" PRIu64 \"\\n\",  Size, nSectors*SectorSize);\n      uprintf(\"  StartSector: 0x%08\" PRIx64 \", nSectors: 0x%\" PRIx64 \", SectorSize: 0x%\" PRIx64 \"\\n\", StartSector, nSectors, SectorSize);\n   }\n\n   return (int64_t)Size;\n}\n\n/*\n* The following calls use a hijacked fp on Windows that contains:\n* fp->_handle: a Windows handle\n* fp->_offset: a file offset\n*/\n\nint contains_data(FILE *fp, uint64_t Position,\n\tconst void *pData, uint64_t Len)\n{\n   int r = 0;\n   unsigned char *aucBuf = _mm_malloc(MAX_DATA_LEN, 16);\n\n   if(aucBuf == NULL)\n      return 0;\n\n   if(!read_data(fp, Position, aucBuf, Len))\n      goto out;\n\n   if(memcmp(pData, aucBuf, (size_t)Len))\n      goto out;\n\n   r = 1;\n\nout:\n   _mm_free(aucBuf);\n   return r;\n} /* contains_data */\n\nint read_data(FILE *fp, uint64_t Position,\n              void *pData, uint64_t Len)\n{\n   int r = 0;\n   unsigned char *aucBuf = _mm_malloc(MAX_DATA_LEN, 16);\n   FAKE_FD* fd = (FAKE_FD*)fp;\n   HANDLE hDrive = (HANDLE)fd->_handle;\n   uint64_t StartSector, EndSector, NumSectors;\n\n   if (aucBuf == NULL)\n      return 0;\n\n   Position += fd->_offset;\n\n   StartSector = Position/ulBytesPerSector;\n   EndSector   = (Position+Len+ulBytesPerSector -1)/ulBytesPerSector;\n   NumSectors  = (size_t)(EndSector - StartSector);\n\n   if((NumSectors*ulBytesPerSector) > MAX_DATA_LEN)\n   {\n      uprintf(\"read_data: Please increase MAX_DATA_LEN in file.h\\n\");\n      goto out;\n   }\n\n   if(Len > 0xFFFFFFFFUL)\n   {\n      uprintf(\"read_data: Len is too big\\n\");\n      goto out;\n   }\n\n   if(read_sectors(hDrive, ulBytesPerSector, StartSector,\n                     NumSectors, aucBuf) <= 0)\n   goto out;\n\n   memcpy(pData, &aucBuf[Position - StartSector*ulBytesPerSector], (size_t)Len);\n\n   r = 1;\n\nout:\n   _mm_free(aucBuf);\n   return r;\n}  /* read_data */\n\n/* May read/write the same sector many times, but compatible with existing ms-sys */\nint write_data(FILE *fp, uint64_t Position,\n               const void *pData, uint64_t Len)\n{\n   int r = 0;\n   /* Windows' WriteFile() may require a buffer that is aligned to the sector size */\n   unsigned char *aucBuf = _mm_malloc(MAX_DATA_LEN, 4096);\n   FAKE_FD* fd = (FAKE_FD*)fp;\n   HANDLE hDrive = (HANDLE)fd->_handle;\n   uint64_t StartSector, EndSector, NumSectors;\n\n   if (aucBuf == NULL)\n      return 0;\n\n   Position += fd->_offset;\n\n   StartSector = Position/ulBytesPerSector;\n   EndSector   = (Position+Len+ulBytesPerSector-1)/ulBytesPerSector;\n   NumSectors  = EndSector - StartSector;\n\n   if((NumSectors*ulBytesPerSector) > MAX_DATA_LEN)\n   {\n      uprintf(\"write_data: Please increase MAX_DATA_LEN in file.h\\n\");\n      goto out;\n   }\n\n   if(Len > 0xFFFFFFFFUL)\n   {\n      uprintf(\"write_data: Len is too big\\n\");\n      goto out;\n   }\n\n   /* Data to write may not be aligned on a sector boundary => read into a sector buffer first */\n   if(read_sectors(hDrive, ulBytesPerSector, StartSector,\n                     NumSectors, aucBuf) <= 0)\n      goto out;\n\n   if(!memcpy(&aucBuf[Position - StartSector*ulBytesPerSector], pData, (size_t)Len))\n      goto out;\n\n   if(write_sectors(hDrive, ulBytesPerSector, StartSector,\n                     NumSectors, aucBuf) <= 0)\n      goto out;\n\n   r = 1;\n\nout:\n   _mm_free(aucBuf);\n   return r;\n} /* write_data */\n"
  },
  {
    "path": "src/ms-sys/inc/br.h",
    "content": "#ifndef BR_H\n#define BR_H\n\n#include <stdio.h>\n#include <stdint.h>\n\n/* Sets custom number of bytes per sector, default value is 512 */\nvoid set_bytes_per_sector(unsigned long ulValue);\n\n/* Gets Windows Disk Signature from MBR */\nuint32_t read_windows_disk_signature(FILE *fp);\n\n/* Sets a new Windows Disk Signature to MBR */\nint write_windows_disk_signature(FILE *fp, uint32_t tWDS);\n\n/* Reads copy protect bytes after Windows Disk Signature from MBR */\nuint16_t read_mbr_copy_protect_bytes(FILE *fp);\nconst char *read_mbr_copy_protect_bytes_explained(FILE *fp);\n\n/* returns TRUE if the file has a boot record, otherwise FALSE.\n   The file position will change when this function is called! */\nint is_br(FILE *fp);\n\n/* returns TRUE if the file has a LILO boot record, otherwise FALSE.\n   The file position will change when this function is called! */\nint is_lilo_br(FILE *fp);\n\n/* returns TRUE if the file has a Microsoft dos master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_dos_mbr(FILE *fp);\n\n/* returns TRUE if the file has a Microsoft dos master boot record with the\n   undocumented F2 instruction, otherwise FALSE. The file position will change\n   when this function is called! */\nint is_dos_f2_mbr(FILE *fp);\n\n/* returns TRUE if the file has a Microsoft 95b master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_95b_mbr(FILE *fp);\n\n/* returns TRUE if the file has a Microsoft 2000 master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_2000_mbr(FILE *fp);\n\n/* returns TRUE if the file has a Microsoft Vista master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_vista_mbr(FILE *fp);\n\n/* returns TRUE if the file has a Microsoft 7 master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_win7_mbr(FILE *fp);\n\n/* returns TRUE if the file has a Rufus master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_rufus_mbr(FILE *fp);\n\n/* returns TRUE if the file has a Rufus GPT master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_rufus_gpt_mbr(FILE *fp);\n\n/* returns TRUE if the file has a ReactOS master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_reactos_mbr(FILE *fp);\n\n/* returns TRUE if the file has a Grub4DOS master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_grub4dos_mbr(FILE *fp);\n\n/* returns TRUE if the file has a Grub 2.0 master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_grub2_mbr(FILE *fp);\n\n/* returns TRUE if the file has a KolibriOS master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_kolibrios_mbr(FILE *fp);\n\n/* returns TRUE if the file has a syslinux master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_syslinux_mbr(FILE *fp);\n\n/* returns TRUE if the file has a syslinux GPT master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_syslinux_gpt_mbr(FILE *fp);\n\n/* returns TRUE if the file has a zeroed master boot record, otherwise\n   FALSE.The file position will change when this function is called! */\nint is_zero_mbr(FILE *fp);\nint is_zero_mbr_not_including_disk_signature_or_copy_protect(FILE *fp);\n\n/* Writes a dos master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_dos_mbr(FILE *fp);\n\n/* Writes a 95b master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_95b_mbr(FILE *fp);\n\n/* Writes a 2000 master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_2000_mbr(FILE *fp);\n\n/* Writes a Vista master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_vista_mbr(FILE *fp);\n\n/* Writes a Windows 7 master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_win7_mbr(FILE *fp);\n\n/* Writes a Rufus master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_rufus_mbr(FILE *fp);\n\n/* Writes a Rufus MSG master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_rufus_msg_mbr(FILE *fp);\n\n/* Writes a ReactOS master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_reactos_mbr(FILE *fp);\n\n/* Writes a Grub4DOS master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_grub4dos_mbr(FILE *fp);\n\n/* Writes a Grub 2.0 master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_grub2_mbr(FILE *fp);\n\n/* Writes a KolibriOS master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_kolibrios_mbr(FILE *fp);\n\n/* Writes a syslinux master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_syslinux_mbr(FILE *fp);\n\n/* Writes a syslinux GPT master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_syslinux_gpt_mbr(FILE *fp);\n\n/* Writes an empty (zeroed) master boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_zero_mbr(FILE *fp);\n\n#endif\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat12_0x0.h",
    "content": "unsigned char br_fat12_0x0[] = {\n  0xeb, 0x3c, 0x90, 0x4d, 0x53, 0x57, 0x49, 0x4e, 0x34, 0x2e, 0x31\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat12_0x3e.h",
    "content": "unsigned char br_fat12_0x3e[] = {\n              0x33, 0xc9, 0x8e, 0xd1, 0xbc, 0xfc, 0x7b, 0x16, 0x07, 0xbd,\n  0x78, 0x00, 0xc5, 0x76, 0x00, 0x1e, 0x56, 0x16, 0x55, 0xbf, 0x22, 0x05,\n  0x89, 0x7e, 0x00, 0x89, 0x4e, 0x02, 0xb1, 0x0b, 0xfc, 0xf3, 0xa4, 0x06,\n  0x1f, 0xbd, 0x00, 0x7c, 0xc6, 0x45, 0xfe, 0x0f, 0x38, 0x4e, 0x24, 0x7d,\n  0x20, 0x8b, 0xc1, 0x99, 0xe8, 0x7e, 0x01, 0x83, 0xeb, 0x3a, 0x66, 0xa1,\n  0x1c, 0x7c, 0x66, 0x3b, 0x07, 0x8a, 0x57, 0xfc, 0x75, 0x06, 0x80, 0xca,\n  0x02, 0x88, 0x56, 0x02, 0x80, 0xc3, 0x10, 0x73, 0xed, 0x33, 0xc9, 0xfe,\n  0x06, 0xd8, 0x7d, 0x8a, 0x46, 0x10, 0x98, 0xf7, 0x66, 0x16, 0x03, 0x46,\n  0x1c, 0x13, 0x56, 0x1e, 0x03, 0x46, 0x0e, 0x13, 0xd1, 0x8b, 0x76, 0x11,\n  0x60, 0x89, 0x46, 0xfc, 0x89, 0x56, 0xfe, 0xb8, 0x20, 0x00, 0xf7, 0xe6,\n  0x8b, 0x5e, 0x0b, 0x03, 0xc3, 0x48, 0xf7, 0xf3, 0x01, 0x46, 0xfc, 0x11,\n  0x4e, 0xfe, 0x61, 0xbf, 0x00, 0x07, 0xe8, 0x28, 0x01, 0x72, 0x3e, 0x38,\n  0x2d, 0x74, 0x17, 0x60, 0xb1, 0x0b, 0xbe, 0xd8, 0x7d, 0xf3, 0xa6, 0x61,\n  0x74, 0x3d, 0x4e, 0x74, 0x09, 0x83, 0xc7, 0x20, 0x3b, 0xfb, 0x72, 0xe7,\n  0xeb, 0xdd, 0xfe, 0x0e, 0xd8, 0x7d, 0x7b, 0xa7, 0xbe, 0x7f, 0x7d, 0xac,\n  0x98, 0x03, 0xf0, 0xac, 0x98, 0x40, 0x74, 0x0c, 0x48, 0x74, 0x13, 0xb4,\n  0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xef, 0xbe, 0x82, 0x7d, 0xeb,\n  0xe6, 0xbe, 0x80, 0x7d, 0xeb, 0xe1, 0xcd, 0x16, 0x5e, 0x1f, 0x66, 0x8f,\n  0x04, 0xcd, 0x19, 0xbe, 0x81, 0x7d, 0x8b, 0x7d, 0x1a, 0x8d, 0x45, 0xfe,\n  0x8a, 0x4e, 0x0d, 0xf7, 0xe1, 0x03, 0x46, 0xfc, 0x13, 0x56, 0xfe, 0xb1,\n  0x04, 0xe8, 0xc2, 0x00, 0x72, 0xd7, 0xea, 0x00, 0x02, 0x70, 0x00, 0x52,\n  0x50, 0x06, 0x53, 0x6a, 0x01, 0x6a, 0x10, 0x91, 0x8b, 0x46, 0x18, 0xa2,\n  0x26, 0x05, 0x96, 0x92, 0x33, 0xd2, 0xf7, 0xf6, 0x91, 0xf7, 0xf6, 0x42,\n  0x87, 0xca, 0xf7, 0x76, 0x1a, 0x8a, 0xf2, 0x8a, 0xe8, 0xc0, 0xcc, 0x02,\n  0x0a, 0xcc, 0xb8, 0x01, 0x02, 0x80, 0x7e, 0x02, 0x0e, 0x75, 0x04, 0xb4,\n  0x42, 0x8b, 0xf4, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x61, 0x61, 0x72, 0x0a,\n  0x40, 0x75, 0x01, 0x42, 0x03, 0x5e, 0x0b, 0x49, 0x75, 0x77, 0xc3, 0x03,\n  0x18, 0x01, 0x27, 0x0d, 0x0a, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64,\n  0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x64, 0x69, 0x73, 0x6b,\n  0xff, 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x49, 0x2f, 0x4f, 0x20,\n  0x65, 0x72, 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x52, 0x65, 0x70, 0x6c,\n  0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x6b,\n  0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x70,\n  0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79,\n  0x0d, 0x0a, 0x00, 0x00, 0x49, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n  0x53, 0x59, 0x53, 0x4d, 0x53, 0x44, 0x4f, 0x53, 0x20, 0x20, 0x20, 0x53,\n  0x59, 0x53, 0x7f, 0x01, 0x00, 0x41, 0xbb, 0x00, 0x07, 0x60, 0x66, 0x6a,\n  0x00, 0xe9, 0x3b, 0xff, 0x00, 0x00, 0x55, 0xaa\n};\n\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat16_0x0.h",
    "content": "unsigned char br_fat16_0x0[] = {\n  0xeb, 0x3c, 0x90, 0x4d, 0x53, 0x57, 0x49, 0x4e, 0x34, 0x2e, 0x31\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat16_0x3e.h",
    "content": "unsigned char br_fat16_0x3e[] = {\n                                                                                      0xfa, 0x33, \n  0xc9, 0x8e, 0xd1, 0xbc, 0xfc, 0x7b, 0x16, 0x07, 0xbd, 0x78, 0x00, 0xc5, 0x76, 0x00, 0x1e, 0x56, \n  0x16, 0x55, 0xbf, 0x22, 0x05, 0x89, 0x7e, 0x00, 0x89, 0x4e, 0x02, 0xb1, 0x0b, 0xfc, 0xf3, 0xa4, \n  0x06, 0x1f, 0xbd, 0x00, 0x7c, 0xc6, 0x45, 0xfe, 0x0f, 0x8b, 0x46, 0x18, 0x88, 0x45, 0xf9, 0x38, \n  0x4e, 0x24, 0x7d, 0x22, 0x8b, 0xc1, 0x99, 0xe8, 0x77, 0x01, 0x72, 0x1a, 0x83, 0xeb, 0x3a, 0x66, \n  0xa1, 0x1c, 0x7c, 0x66, 0x3b, 0x07, 0x8a, 0x57, 0xfc, 0x75, 0x06, 0x80, 0xca, 0x02, 0x88, 0x56, \n  0x02, 0x80, 0xc3, 0x10, 0x73, 0xed, 0x33, 0xc9, 0x8a, 0x46, 0x10, 0x98, 0xf7, 0x66, 0x16, 0x03, \n  0x46, 0x1c, 0x13, 0x56, 0x1e, 0x03, 0x46, 0x0e, 0x13, 0xd1, 0x8b, 0x76, 0x11, 0x60, 0x89, 0x46, \n  0xfc, 0x89, 0x56, 0xfe, 0xb8, 0x20, 0x00, 0xf7, 0xe6, 0x8b, 0x5e, 0x0b, 0x03, 0xc3, 0x48, 0xf7, \n  0xf3, 0x01, 0x46, 0xfc, 0x11, 0x4e, 0xfe, 0x61, 0xbf, 0x00, 0x07, 0xe8, 0x23, 0x01, 0x72, 0x39, \n  0x38, 0x2d, 0x74, 0x17, 0x60, 0xb1, 0x0b, 0xbe, 0xd8, 0x7d, 0xf3, 0xa6, 0x61, 0x74, 0x39, 0x4e, \n  0x74, 0x09, 0x83, 0xc7, 0x20, 0x3b, 0xfb, 0x72, 0xe7, 0xeb, 0xdd, 0xbe, 0x7f, 0x7d, 0xac, 0x98,\n  0x03, 0xf0, 0xac, 0x84, 0xc0, 0x74, 0x17, 0x3c, 0xff, 0x74, 0x09, 0xb4, 0x0e, 0xbb, 0x07, 0x00, \n  0xcd, 0x10, 0xeb, 0xee, 0xbe, 0x82, 0x7d, 0xeb, 0xe5, 0xbe, 0x80, 0x7d, 0xeb, 0xe0, 0x98, 0xcd, \n  0x16, 0x5e, 0x1f, 0x66, 0x8f, 0x04, 0xcd, 0x19, 0xbe, 0x81, 0x7d, 0x8b, 0x7d, 0x1a, 0x8d, 0x45, \n  0xfe, 0x8a, 0x4e, 0x0d, 0xf7, 0xe1, 0x03, 0x46, 0xfc, 0x13, 0x56, 0xfe, 0xb1, 0x04, 0xe8, 0xc1,\n  0x00, 0x72, 0xd6, 0xea, 0x00, 0x02, 0x70, 0x00, 0xb4, 0x42, 0xeb, 0x2d, 0x60, 0x66, 0x6a, 0x00,\n  0x52, 0x50, 0x06, 0x53, 0x6a, 0x01, 0x6a, 0x10, 0x8b, 0xf4, 0x74, 0xec, 0x91, 0x92, 0x33, 0xd2, \n  0xf7, 0x76, 0x18, 0x91, 0xf7, 0x76, 0x18, 0x42, 0x87, 0xca, 0xf7, 0x76, 0x1a, 0x8a, 0xf2, 0x8a, \n  0xe8, 0xc0, 0xcc, 0x02, 0x0a, 0xcc, 0xb8, 0x01, 0x02, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x8d, 0x64, \n  0x10, 0x61, 0x72, 0x0a, 0x40, 0x75, 0x01, 0x42, 0x03, 0x5e, 0x0b, 0x49, 0x75, 0x77, 0xc3, 0x03, \n  0x18, 0x01, 0x27, 0x0d, 0x0a, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x73, 0x79, 0x73, \n  0x74, 0x65, 0x6d, 0x20, 0x64, 0x69, 0x73, 0x6b, 0xff, 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, \n  0x49, 0x2f, 0x4f, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x52, 0x65, 0x70, 0x6c, \n  0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x6b, 0x2c, 0x20, 0x61, 0x6e, \n  0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, \n  0x20, 0x6b, 0x65, 0x79, 0x0d, 0x0a, 0x00, 0x00, 0x49, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, \n  0x53, 0x59, 0x53, 0x4d, 0x53, 0x44, 0x4f, 0x53, 0x20, 0x20, 0x20, 0x53, 0x59, 0x53, 0x7f, 0x01, \n  0x00, 0x41, 0xbb, 0x00, 0x07, 0x80, 0x7e, 0x02, 0x0e, 0xe9, 0x40, 0xff, 0x00, 0x00, 0x55, 0xaa\n};\n\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat16fd_0x3e.h",
    "content": "/* br_fat16_0x3e.h\n//\n// ANI\n// substring gmbh/tw 14.9.04 \n// modified bootsector 0x03e - 0x200 to support FreeDOS\n*/\nunsigned char br_fat16_0x3e[] = { 0xfa, 0xfc,\n\t0x31, 0xc0, 0x8e, 0xd8, 0xbd, 0x00, 0x7c, 0xb8, 0xe0, 0x1f, 0x8e, 0xc0, 0x89, 0xee, 0x89, 0xef, \n\t0xb9, 0x00, 0x01, 0xf3, 0xa5, 0xea, 0x5e, 0x7c, 0xe0, 0x1f, 0x00, 0x00, 0x60, 0x00, 0x8e, 0xd8, \n\t0x8e, 0xd0, 0x8d, 0x66, 0xa0, 0xfb, 0x80, 0x7e, 0x24, 0xff, 0x75, 0x03, 0x88, 0x56, 0x24, 0xc7, \n\t0x46, 0xc0, 0x10, 0x00, 0xc7, 0x46, 0xc2, 0x01, 0x00, 0xe8, 0xe6, 0x00, 0x46, 0x72, 0x65, 0x65, \n\t0x44, 0x4f, 0x53, 0x00, 0x8b, 0x76, 0x1c, 0x8b, 0x7e, 0x1e, 0x03, 0x76, 0x0e, 0x83, 0xd7, 0x00, \n\t0x89, 0x76, 0xd2, 0x89, 0x7e, 0xd4, 0x8a, 0x46, 0x10, 0x98, 0xf7, 0x66, 0x16, 0x01, 0xc6, 0x11, \n\t0xd7, 0x89, 0x76, 0xd6, 0x89, 0x7e, 0xd8, 0x8b, 0x5e, 0x0b, 0xb1, 0x05, 0xd3, 0xeb, 0x8b, 0x46, \n\t0x11, 0x31, 0xd2, 0xf7, 0xf3, 0x89, 0x46, 0xd0, 0x01, 0xc6, 0x83, 0xd7, 0x00, 0x89, 0x76, 0xda, \n\t0x89, 0x7e, 0xdc, 0x8b, 0x46, 0xd6, 0x8b, 0x56, 0xd8, 0x8b, 0x7e, 0xd0, 0xc4, 0x5e, 0x5a, 0xe8, \n\t0x98, 0x00, 0x72, 0x2f, 0xc4, 0x7e, 0x5a, 0xb9, 0x0b, 0x00, 0xbe, 0xf1, 0x7d, 0x57, 0xf3, 0xa6, \n\t0x5f, 0x26, 0x8b, 0x45, 0x1a, 0x74, 0x0b, 0x83, 0xc7, 0x20, 0x26, 0x80, 0x3d, 0x00, 0x75, 0xe7, \n\t0x72, 0x56, 0x50, 0xc4, 0x5e, 0x5a, 0x8b, 0x7e, 0x16, 0x8b, 0x46, 0xd2, 0x8b, 0x56, 0xd4, 0xe8, \n\t0x68, 0x00, 0x58, 0x72, 0x43, 0x1e, 0x07, 0x8e, 0x5e, 0x5c, 0xbf, 0x00, 0x20, 0xab, 0x89, 0xc6, \n\t0x8b, 0x56, 0x5c, 0x01, 0xf6, 0x73, 0x03, 0x80, 0xc6, 0x10, 0x8e, 0xda, 0xad, 0x3d, 0xf8, 0xff, \n\t0x72, 0xeb, 0x31, 0xc0, 0xab, 0x0e, 0x1f, 0xc4, 0x5e, 0x5a, 0xbe, 0x00, 0x20, 0xad, 0x09, 0xc0, \n\t0x74, 0x24, 0x48, 0x48, 0x8b, 0x7e, 0x0d, 0x81, 0xe7, 0xff, 0x00, 0xf7, 0xe7, 0x03, 0x46, 0xda, \n\t0x13, 0x56, 0xdc, 0xe8, 0x24, 0x00, 0x73, 0xe5, 0xe8, 0x17, 0x00, 0x20, 0x65, 0x72, 0x72, 0x00, \n\t0x30, 0xe4, 0xcd, 0x16, 0xcd, 0x19, 0x8a, 0x5e, 0x24, 0xff, 0x6e, 0x5a, 0x31, 0xdb, 0xb4, 0x0e, \n\t0xcd, 0x10, 0x5e, 0xac, 0x56, 0x3c, 0x00, 0x75, 0xf3, 0xc3, 0x56, 0x89, 0x46, 0xc8, 0x89, 0x56, \n\t0xca, 0x8c, 0x46, 0xc6, 0x89, 0x5e, 0xc4, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0x8a, 0x56, 0x24, 0x84, \n\t0xd2, 0x74, 0x19, 0xcd, 0x13, 0x72, 0x15, 0xd1, 0xe9, 0x81, 0xdb, 0x54, 0xaa, 0x75, 0x0d, 0x8d, \n\t0x76, 0xc0, 0x89, 0x5e, 0xcc, 0x89, 0x5e, 0xce, 0xb4, 0x42, 0xeb, 0x2c, 0x8b, 0x4e, 0xc8, 0x8b, \n\t0x56, 0xca, 0x8a, 0x46, 0x18, 0xf6, 0x66, 0x1a, 0x91, 0xf7, 0xf1, 0x92, 0xf6, 0x76, 0x18, 0x89, \n\t0xd1, 0x88, 0xc6, 0x86, 0xe9, 0xd0, 0xc9, 0xd0, 0xc9, 0x8a, 0x46, 0x18, 0x28, 0xe0, 0xfe, 0xc4, \n\t0x08, 0xe1, 0xc4, 0x5e, 0xc4, 0xb8, 0x01, 0x02, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x73, 0x06, 0x30, \n\t0xe4, 0xcd, 0x13, 0xeb, 0xa2, 0x8b, 0x46, 0x0b, 0xf6, 0x76, 0xc0, 0x01, 0x46, 0xc6, 0x83, 0x46, \n\t0xc8, 0x01, 0x83, 0x56, 0xca, 0x00, 0x4f, 0x75, 0xea, 0x8e, 0x46, 0xc6, 0x5e, 0xc3, 0x00, 0x00, \n\t0x00, 0x4b, 0x45, 0x52, 0x4e, 0x45, 0x4c, 0x20, 0x20, 0x53, 0x59, 0x53, 0x00, 0x00, 0x55, 0xaa\n};\n\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat16ros_0x0.h",
    "content": "unsigned char br_fat16_0x0[] = {\n  0xeb, 0x71, 0x90, 0x46, 0x72, 0x4c, 0x64, 0x72, 0x31, 0x2e, 0x30\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat16ros_0x3e.h",
    "content": "unsigned char br_fat16_0x3e[] = {\n\t0x46, 0x52, 0x45, 0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x4c,\n\t0x6f, 0x61, 0x64, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x21, 0x0d,\n\t0x0a, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20,\n\t0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x62, 0x6f, 0x6f,\n\t0x74, 0x2e, 0x2e, 0x2e, 0x00, 0x31, 0xc0, 0x8e, 0xd8, 0x8e, 0xd0, 0xbc,\n\t0xe0, 0x7b, 0x89, 0xe5, 0xa0, 0x24, 0x7c, 0x3c, 0xff, 0x74, 0x02, 0x88,\n\t0xc2, 0x88, 0x16, 0x24, 0x7c, 0x31, 0xff, 0xb4, 0x08, 0xcd, 0x13, 0x0f,\n\t0x82, 0xb8, 0x00, 0x66, 0x0f, 0xb6, 0xdd, 0x88, 0xcf, 0xc0, 0xef, 0x06,\n\t0x80, 0xe1, 0x3f, 0x66, 0x0f, 0xb6, 0xc9, 0x66, 0x0f, 0xb6, 0xc6, 0x66,\n\t0x40, 0x66, 0x43, 0x66, 0xf7, 0xe1, 0x66, 0xf7, 0xe3, 0x66, 0x89, 0x46,\n\t0x08, 0x66, 0x0f, 0xb7, 0x86, 0x2e, 0x00, 0x66, 0x03, 0x86, 0x3c, 0x00,\n\t0x66, 0x0f, 0xb7, 0x8e, 0x36, 0x00, 0x66, 0x60, 0xbb, 0x00, 0x80, 0x8e,\n\t0xc3, 0x31, 0xff, 0xe8, 0xb9, 0x00, 0x66, 0x61, 0x66, 0x89, 0xc3, 0x66,\n\t0x0f, 0xb6, 0x86, 0x30, 0x00, 0x66, 0xf7, 0xe1, 0x66, 0x01, 0xd8, 0x66,\n\t0x89, 0x46, 0x04, 0x66, 0x0f, 0xb7, 0x9e, 0x31, 0x00, 0x66, 0x83, 0xc3,\n\t0x0f, 0x66, 0xc1, 0xeb, 0x04, 0x66, 0x01, 0xc3, 0x66, 0x89, 0x5e, 0x00,\n\t0xbb, 0x00, 0x10, 0x8e, 0xc3, 0x31, 0xff, 0x31, 0xc9, 0x41, 0x06, 0xe8,\n\t0x81, 0x00, 0x07, 0xba, 0x10, 0x00, 0x31, 0xdb, 0x89, 0xdf, 0x26, 0x38,\n\t0x2d, 0x74, 0x34, 0xbe, 0x3e, 0x7c, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74,\n\t0x08, 0x83, 0xc3, 0x20, 0x4a, 0x75, 0xe9, 0xeb, 0xd3, 0x26, 0x66, 0x0f,\n\t0xb7, 0x47, 0x1a, 0xba, 0x80, 0x0f, 0x8e, 0xc2, 0x31, 0xff, 0xe8, 0x24,\n\t0x00, 0x83, 0xf8, 0xf8, 0x72, 0xf8, 0x8a, 0x16, 0x24, 0x7c, 0x8a, 0x36,\n\t0xfd, 0x7d, 0xea, 0x00, 0xf8, 0x00, 0x00, 0xbe, 0x49, 0x7c, 0xe8, 0x7b,\n\t0x00, 0xbe, 0x58, 0x7c, 0xe8, 0x75, 0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd,\n\t0x19, 0x66, 0x60, 0x66, 0x48, 0x66, 0x48, 0x66, 0x0f, 0xb6, 0x8e, 0x2d,\n\t0x00, 0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0x00, 0xe8, 0x18, 0x00, 0x66,\n\t0x61, 0x06, 0xbb, 0x02, 0x00, 0xf7, 0xe3, 0xc1, 0xe2, 0x0c, 0x81, 0xc2,\n\t0x00, 0x80, 0x8e, 0xc2, 0x89, 0xc3, 0x26, 0x8b, 0x07, 0x07, 0xc3, 0x66,\n\t0x0f, 0xb7, 0xd9, 0x83, 0xfb, 0x40, 0x76, 0x03, 0xbb, 0x40, 0x00, 0x66,\n\t0x60, 0x66, 0x6a, 0x00, 0x66, 0x50, 0x06, 0x57, 0x53, 0x6a, 0x10, 0x89,\n\t0xe6, 0x8a, 0x16, 0x24, 0x7c, 0xb4, 0x42, 0xcd, 0x13, 0x72, 0x9c, 0x83,\n\t0xc4, 0x10, 0xc1, 0xe3, 0x05, 0x8c, 0xc0, 0x01, 0xd8, 0x8e, 0xc0, 0x66,\n\t0x61, 0x66, 0x01, 0xd8, 0x29, 0xd9, 0x75, 0xc7, 0xc3, 0xb4, 0x0e, 0xbb,\n\t0x07, 0x00, 0xcd, 0x10, 0xac, 0x08, 0xc0, 0x75, 0xf4, 0xc3, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x55, 0xaa\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32_0x0.h",
    "content": "unsigned char br_fat32_0x0[] = {\n  0xeb, 0x58, 0x90, 0x4d, 0x53, 0x57, 0x49, 0x4e, 0x34, 0x2e, 0x31\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32_0x3f0.h",
    "content": "unsigned char br_fat32_0x3f0[] = {\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x55, 0xaa, 0xfa, 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0x8b,\n  0x4e, 0x24, 0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7,\n  0x56, 0x0e, 0x66, 0x03, 0xc2, 0x33, 0xc9, 0x66, 0x89, 0x46, 0xfc, 0x66,\n  0xc7, 0x46, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x66, 0x8b, 0x46, 0x2c,\n  0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0xcf, 0xfc, 0x66, 0x3d, 0xf8, 0xff,\n  0xff, 0x0f, 0x0f, 0x83, 0xc5, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb,\n  0x52, 0x50, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x66, 0x0f, 0xac, 0xd0, 0x10,\n  0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x8b, 0xf3, 0x66,\n  0xf7, 0xe3, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb,\n  0xbb, 0x00, 0x07, 0x8b, 0xfb, 0xb9, 0x01, 0x00, 0xe8, 0xbe, 0xfc, 0x0f,\n  0x82, 0xaa, 0xfc, 0x38, 0x2d, 0x74, 0x1e, 0xb1, 0x0b, 0x56, 0xbe, 0xd8,\n  0x7d, 0xf3, 0xa6, 0x5e, 0x74, 0x19, 0x03, 0xf9, 0x83, 0xc7, 0x15, 0x3b,\n  0xfb, 0x72, 0xe8, 0x4e, 0x75, 0xd6, 0x58, 0x5a, 0xe8, 0x66, 0x00, 0x72,\n  0xab, 0x83, 0xc4, 0x04, 0xe9, 0x64, 0xfc, 0x83, 0xc4, 0x04, 0x8b, 0x75,\n  0x09, 0x8b, 0x7d, 0x0f, 0x8b, 0xc6, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x8b,\n  0xc7, 0x66, 0x83, 0xf8, 0x02, 0x72, 0x3b, 0x66, 0x3d, 0xf8, 0xff, 0xff,\n  0x0f, 0x73, 0x33, 0x66, 0x48, 0x66, 0x48, 0x66, 0x0f, 0xb6, 0x4e, 0x0d,\n  0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10,\n  0xfb, 0xbb, 0x00, 0x07, 0x53, 0xb9, 0x04, 0x00, 0xe8, 0x52, 0xfc, 0x5b,\n  0x0f, 0x82, 0x3d, 0xfc, 0x81, 0x3f, 0x4d, 0x5a, 0x75, 0x08, 0x81, 0xbf,\n  0x00, 0x02, 0x42, 0x4a, 0x74, 0x06, 0xbe, 0x80, 0x7d, 0xe9, 0x0e, 0xfc,\n  0xea, 0x00, 0x02, 0x70, 0x00, 0x03, 0xc0, 0x13, 0xd2, 0x03, 0xc0, 0x13,\n  0xd2, 0xe8, 0x18, 0x00, 0xfa, 0x26, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff,\n  0xff, 0xff, 0x0f, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0x66, 0x3d, 0xf8, 0xff,\n  0xff, 0x0f, 0xfb, 0xc3, 0xbf, 0x00, 0x7e, 0xfa, 0x66, 0xc1, 0xe0, 0x10,\n  0x66, 0x0f, 0xac, 0xd0, 0x10, 0x66, 0x0f, 0xb7, 0x4e, 0x0b, 0x66, 0x33,\n  0xd2, 0x66, 0xf7, 0xf1, 0x66, 0x3b, 0x46, 0xf8, 0x74, 0x44, 0x66, 0x89,\n  0x46, 0xf8, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 0x4e, 0x0e, 0x66,\n  0x03, 0xc1, 0x66, 0x0f, 0xb7, 0x5e, 0x28, 0x83, 0xe3, 0x0f, 0x74, 0x16,\n  0x3a, 0x5e, 0x10, 0x0f, 0x83, 0xa4, 0xfb, 0x52, 0x66, 0x8b, 0xc8, 0x66,\n  0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x03, 0xc1, 0x5a, 0x52, 0x66,\n  0x0f, 0xa4, 0xc2, 0x10, 0xfb, 0x8b, 0xdf, 0xb9, 0x01, 0x00, 0xe8, 0xb4,\n  0xfb, 0x5a, 0x0f, 0x82, 0x9f, 0xfb, 0xfb, 0x8b, 0xda, 0xc3, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32_0x52.h",
    "content": "unsigned char br_fat32_0x52[] = {\n                                                              0x46, 0x41,\n  0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0xfa, 0x33, 0xc9, 0x8e, 0xd1, 0xbc,\n  0xf8, 0x7b, 0x8e, 0xc1, 0xbd, 0x78, 0x00, 0xc5, 0x76, 0x00, 0x1e, 0x56,\n  0x16, 0x55, 0xbf, 0x22, 0x05, 0x89, 0x7e, 0x00, 0x89, 0x4e, 0x02, 0xb1,\n  0x0b, 0xfc, 0xf3, 0xa4, 0x8e, 0xd9, 0xbd, 0x00, 0x7c, 0xc6, 0x45, 0xfe,\n  0x0f, 0x8b, 0x46, 0x18, 0x88, 0x45, 0xf9, 0x38, 0x4e, 0x40, 0x7d, 0x25,\n  0x8b, 0xc1, 0x99, 0xbb, 0x00, 0x07, 0xe8, 0x97, 0x00, 0x72, 0x1a, 0x83,\n  0xeb, 0x3a, 0x66, 0xa1, 0x1c, 0x7c, 0x66, 0x3b, 0x07, 0x8a, 0x57, 0xfc,\n  0x75, 0x06, 0x80, 0xca, 0x02, 0x88, 0x56, 0x02, 0x80, 0xc3, 0x10, 0x73,\n  0xed, 0xbf, 0x02, 0x00, 0x83, 0x7e, 0x16, 0x00, 0x75, 0x45, 0x8b, 0x46,\n  0x1c, 0x8b, 0x56, 0x1e, 0xb9, 0x03, 0x00, 0x49, 0x40, 0x75, 0x01, 0x42,\n  0xbb, 0x00, 0x7e, 0xe8, 0x5f, 0x00, 0x73, 0x26, 0xb0, 0xf8, 0x4f, 0x74,\n  0x1d, 0x8b, 0x46, 0x32, 0x33, 0xd2, 0xb9, 0x03, 0x00, 0x3b, 0xc8, 0x77,\n  0x1e, 0x8b, 0x76, 0x0e, 0x3b, 0xce, 0x73, 0x17, 0x2b, 0xf1, 0x03, 0x46,\n  0x1c, 0x13, 0x56, 0x1e, 0xeb, 0xd1, 0x73, 0x0b, 0xeb, 0x27, 0x83, 0x7e,\n  0x2a, 0x00, 0x77, 0x03, 0xe9, 0xfd, 0x02, 0xbe, 0x7e, 0x7d, 0xac, 0x98,\n  0x03, 0xf0, 0xac, 0x84, 0xc0, 0x74, 0x17, 0x3c, 0xff, 0x74, 0x09, 0xb4,\n  0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xee, 0xbe, 0x81, 0x7d, 0xeb,\n  0xe5, 0xbe, 0x7f, 0x7d, 0xeb, 0xe0, 0x98, 0xcd, 0x16, 0x5e, 0x1f, 0x66,\n  0x8f, 0x04, 0xcd, 0x19, 0x41, 0x56, 0x66, 0x6a, 0x00, 0x52, 0x50, 0x06,\n  0x53, 0x6a, 0x01, 0x6a, 0x10, 0x8b, 0xf4, 0x60, 0x80, 0x7e, 0x02, 0x0e,\n  0x75, 0x04, 0xb4, 0x42, 0xeb, 0x1d, 0x91, 0x92, 0x33, 0xd2, 0xf7, 0x76,\n  0x18, 0x91, 0xf7, 0x76, 0x18, 0x42, 0x87, 0xca, 0xf7, 0x76, 0x1a, 0x8a,\n  0xf2, 0x8a, 0xe8, 0xc0, 0xcc, 0x02, 0x0a, 0xcc, 0xb8, 0x01, 0x02, 0x8a,\n  0x56, 0x40, 0xcd, 0x13, 0x61, 0x8d, 0x64, 0x10, 0x5e, 0x72, 0x0a, 0x40,\n  0x75, 0x01, 0x42, 0x03, 0x5e, 0x0b, 0x49, 0x75, 0xb4, 0xc3, 0x03, 0x18,\n  0x01, 0x27, 0x0d, 0x0a, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20,\n  0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x64, 0x69, 0x73, 0x6b, 0xff,\n  0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x49, 0x2f, 0x4f, 0x20, 0x65,\n  0x72, 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x52, 0x65, 0x70, 0x6c, 0x61,\n  0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x6b, 0x2c,\n  0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x72,\n  0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x0d,\n  0x0a, 0x00, 0x00, 0x00, 0x49, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n  0x53, 0x59, 0x53, 0x4d, 0x53, 0x44, 0x4f, 0x53, 0x20, 0x20, 0x20, 0x53,\n  0x59, 0x53, 0x7e, 0x01, 0x00, 0x57, 0x49, 0x4e, 0x42, 0x4f, 0x4f, 0x54,\n  0x20, 0x53, 0x59, 0x53, 0x00, 0x00, 0x55, 0xaa, 0x52, 0x52, 0x61, 0x41,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x72, 0x72, 0x41, 0x61\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32fd_0x3f0.h",
    "content": "/* br_fat32_0x52.h\n//\n// ANI\n// substring gmbh/tw 14.9.04 \n// modified cluster code 0x3f0 to support FreeDOS\n*/\nunsigned char br_fat32_0x3f0[] = {\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x55, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa\n};\n\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32fd_0x52.h",
    "content": "/* br_fat32_0x52.h\n//\n// ANI\n// substring gmbh/tw 14.9.04 \n// modified bootstrap code 0x052 to support FreeDOS\n*/\nunsigned char br_fat32_0x52[] = {\n    0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0xfc, 0xfa, 0x29, 0xc0, \n    0x8e, 0xd8, 0xbd, 0x00, 0x7c, 0xb8, 0xe0, 0x1f, 0x8e, 0xc0, 0x89, 0xee, \n    0x89, 0xef, 0xb9, 0x00, 0x01, 0xf3, 0xa5, 0xea, 0x7a, 0x7c, 0xe0, 0x1f, \n    0x00, 0x00, 0x60, 0x00, 0x8e, 0xd8, 0x8e, 0xd0, 0x8d, 0x66, 0xe0, 0xfb, \n    0x88, 0x56, 0x40, 0xbe, 0xc1, 0x7d, 0xe8, 0xf4, 0x00, 0x66, 0x31, 0xc0, \n    0x66, 0x89, 0x46, 0x44, 0x8b, 0x46, 0x0e, 0x66, 0x03, 0x46, 0x1c, 0x66, \n    0x89, 0x46, 0x48, 0x66, 0x89, 0x46, 0x4c, 0x66, 0x8b, 0x46, 0x10, 0x66, \n    0xf7, 0x6e, 0x24, 0x66, 0x01, 0x46, 0x4c, 0xb8, 0x00, 0x02, 0x3b, 0x46, \n    0x0b, 0x74, 0x08, 0x01, 0xc0, 0xff, 0x06, 0x34, 0x7d, 0xeb, 0xf3, 0x66, \n    0x8b, 0x46, 0x2c, 0x66, 0x50, 0xe8, 0x94, 0x00, 0x72, 0x4d, 0xc4, 0x5e, \n    0x76, 0xe8, 0xb7, 0x00, 0x31, 0xff, 0xb9, 0x0b, 0x00, 0xbe, 0xf1, 0x7d, \n    0xf3, 0xa6, 0x74, 0x15, 0x83, 0xc7, 0x20, 0x83, 0xe7, 0xe0, 0x3b, 0x7e, \n    0x0b, 0x75, 0xeb, 0x4a, 0x75, 0xe0, 0x66, 0x58, 0xe8, 0x34, 0x00, 0xeb, \n    0xd2, 0x26, 0xff, 0x75, 0x09, 0x26, 0xff, 0x75, 0x0f, 0x66, 0x58, 0x29, \n    0xdb, 0x66, 0x50, 0xe8, 0x5a, 0x00, 0x72, 0x0d, 0xe8, 0x80, 0x00, 0x4a, \n    0x75, 0xfa, 0x66, 0x58, 0xe8, 0x14, 0x00, 0xeb, 0xec, 0x8a, 0x5e, 0x40, \n    0xff, 0x6e, 0x76, 0xbe, 0xee, 0x7d, 0xe8, 0x64, 0x00, 0x30, 0xe4, 0xcd, \n    0x16, 0xcd, 0x19, 0x06, 0x57, 0x53, 0x89, 0xc7, 0xc1, 0xe7, 0x02, 0x50, \n    0x8b, 0x46, 0x0b, 0x48, 0x21, 0xc7, 0x58, 0x66, 0xc1, 0xe8, 0x07, 0x66, \n    0x03, 0x46, 0x48, 0xbb, 0x00, 0x20, 0x8e, 0xc3, 0x29, 0xdb, 0x66, 0x3b, \n    0x46, 0x44, 0x74, 0x07, 0x66, 0x89, 0x46, 0x44, 0xe8, 0x38, 0x00, 0x26, \n    0x80, 0x65, 0x03, 0x0f, 0x26, 0x66, 0x8b, 0x05, 0x5b, 0x5f, 0x07, 0xc3, \n    0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x73, 0x15, 0x66, 0x48, 0x66, 0x48, \n    0x66, 0x0f, 0xb6, 0x56, 0x0d, 0x66, 0x52, 0x66, 0xf7, 0xe2, 0x66, 0x5a, \n    0x66, 0x03, 0x46, 0x4c, 0xc3, 0xf9, 0xc3, 0x31, 0xdb, 0xb4, 0x0e, 0xcd, \n    0x10, 0xac, 0x3c, 0x00, 0x75, 0xf5, 0xc3, 0x52, 0x56, 0x57, 0x66, 0x50, \n    0x89, 0xe7, 0x6a, 0x00, 0x6a, 0x00, 0x66, 0x50, 0x06, 0x53, 0x6a, 0x01, \n    0x6a, 0x10, 0x89, 0xe6, 0x8a, 0x56, 0x40, 0xb4, 0x42, 0xcd, 0x13, 0x89, \n    0xfc, 0x66, 0x58, 0x73, 0x08, 0x50, 0x30, 0xe4, 0xcd, 0x13, 0x58, 0xeb, \n    0xd9, 0x66, 0x40, 0x03, 0x5e, 0x0b, 0x73, 0x07, 0x8c, 0xc2, 0x80, 0xc6, \n    0x10, 0x8e, 0xc2, 0x5f, 0x5e, 0x5a, 0xc3, 0x4c, 0x6f, 0x61, 0x64, 0x69, \n    0x6e, 0x67, 0x20, 0x46, 0x72, 0x65, 0x65, 0x44, 0x4f, 0x53, 0x20, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x4e, 0x6f, 0x20, 0x4b, 0x45, 0x52, 0x4e, 0x45, \n    0x4c, 0x20, 0x20, 0x53, 0x59, 0x53, 0x00, 0x00, 0x55, 0xaa, 0x52, 0x52, \n    0x61, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n    0x00, 0x00, 0x72, 0x72, 0x41, 0x61\n};\n\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32kos_0x52.h",
    "content": "unsigned char br_fat32kos_0x52[] = {\n\t0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x80, 0x3C, 0x80, 0x75,\n\t0x09, 0x66, 0x8B, 0x44, 0x08, 0x2E, 0x66, 0xA3, 0x1C, 0x7C, 0x66, 0x31,\n\t0xC0, 0x8E, 0xD8, 0x8E, 0xD0, 0xBC, 0x00, 0x7C, 0x89, 0xE5, 0x88, 0x16,\n\t0x08, 0x7A, 0xFC, 0xFB, 0x68, 0x00, 0x08, 0x07, 0x66, 0x0F, 0xB7, 0x5E,\n\t0x0E, 0x66, 0x89, 0x1E, 0x00, 0x7A, 0x8A, 0x46, 0x10, 0x66, 0xF7, 0x66,\n\t0x24, 0x66, 0x01, 0xD8, 0x66, 0x0F, 0xB6, 0x5E, 0x0D, 0x01, 0xDB, 0x66,\n\t0x29, 0xD8, 0x66, 0xA3, 0x04, 0x7A, 0x66, 0x8B, 0x46, 0x2C, 0x66, 0x25,\n\t0xFF, 0xFF, 0xFF, 0x0F, 0x31, 0xDB, 0x89, 0xDF, 0x66, 0x50, 0xE8, 0x62,\n\t0x00, 0x0F, 0xB6, 0x4E, 0x0D, 0xC1, 0xE1, 0x04, 0x26, 0x80, 0x3D, 0x00,\n\t0x74, 0x4D, 0x51, 0x57, 0xB9, 0x0B, 0x00, 0xBE, 0xCB, 0x7D, 0xF3, 0xA6,\n\t0x5F, 0x59, 0x74, 0x0E, 0x83, 0xC7, 0x20, 0xE2, 0xE7, 0x66, 0x58, 0xE8,\n\t0x8D, 0x00, 0x73, 0x33, 0x72, 0xCE, 0x66, 0x58, 0x26, 0x8B, 0x45, 0x14,\n\t0x25, 0xFF, 0x0F, 0x66, 0xC1, 0xE0, 0x10, 0x26, 0x8B, 0x45, 0x1A, 0x31,\n\t0xDB, 0x66, 0x50, 0xE8, 0x21, 0x00, 0x8C, 0xC0, 0x0F, 0xB6, 0x4E, 0x0D,\n\t0xC1, 0xE1, 0x05, 0x01, 0xC8, 0x8E, 0xC0, 0x66, 0x58, 0xE8, 0x5F, 0x00,\n\t0x72, 0xE5, 0xEA, 0x00, 0x80, 0x00, 0x00, 0xBE, 0xBA, 0x7D, 0xE8, 0x98,\n\t0x00, 0xEB, 0xFE, 0x66, 0x0F, 0xB6, 0x4E, 0x0D, 0x66, 0xF7, 0xE1, 0x66,\n\t0x03, 0x06, 0x04, 0x7A, 0x66, 0x03, 0x46, 0x1C, 0x06, 0x66, 0x60, 0x6A,\n\t0x00, 0x6A, 0x00, 0x66, 0x50, 0x06, 0x53, 0x83, 0xE9, 0x7F, 0x19, 0xC0,\n\t0x21, 0xC8, 0x83, 0xC0, 0x7F, 0x50, 0xC1, 0xE0, 0x05, 0x8C, 0xC1, 0x01,\n\t0xC1, 0x8E, 0xC1, 0x6A, 0x10, 0xB8, 0x00, 0x42, 0x8A, 0x16, 0x08, 0x7A,\n\t0x89, 0xE6, 0xCD, 0x13, 0xBE, 0xD9, 0x7D, 0x72, 0xB9, 0x61, 0x66, 0x61,\n\t0x66, 0x83, 0xC0, 0x7F, 0x83, 0xE9, 0x7F, 0x77, 0xC4, 0x07, 0xC3, 0x06,\n\t0x1E, 0x07, 0xBB, 0x00, 0x7E, 0x66, 0x50, 0x66, 0xC1, 0xE8, 0x07, 0x66,\n\t0x3B, 0x06, 0xF9, 0x7D, 0x74, 0x0F, 0x66, 0xA3, 0xF9, 0x7D, 0x66, 0x03,\n\t0x06, 0x00, 0x7A, 0xB9, 0x01, 0x00, 0xE8, 0x9B, 0xFF, 0x66, 0x58, 0x66,\n\t0x83, 0xE0, 0x7F, 0x67, 0x66, 0x8B, 0x04, 0x85, 0x00, 0x7E, 0x00, 0x00,\n\t0x66, 0x25, 0xFF, 0xFF, 0xFF, 0x0F, 0x66, 0x3D, 0xF7, 0xFF, 0xFF, 0x0F,\n\t0xBE, 0xEB, 0x7D, 0x0F, 0x84, 0x67, 0xFF, 0x07, 0xC3, 0xAC, 0x84, 0xC0,\n\t0x74, 0x09, 0xB4, 0x0E, 0xBB, 0x07, 0x00, 0xCD, 0x10, 0xEB, 0xF2, 0xC3,\n\t0x43, 0x61, 0x6E, 0x6E, 0x6F, 0x74, 0x20, 0x66, 0x69, 0x6E, 0x64, 0x20,\n\t0x66, 0x69, 0x6C, 0x65, 0x20, 0x4D, 0x54, 0x4C, 0x44, 0x5F, 0x46, 0x33,\n\t0x32, 0x20, 0x20, 0x20, 0x0D, 0x0A, 0x00, 0x44, 0x69, 0x73, 0x6B, 0x20,\n\t0x72, 0x65, 0x61, 0x64, 0x20, 0x65, 0x72, 0x72, 0x6F, 0x72, 0x0D, 0x0A,\n\t0x00, 0x42, 0x61, 0x64, 0x20, 0x63, 0x6C, 0x75, 0x73, 0x74, 0x65, 0x72,\n\t0x0D, 0x0A, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x55, 0xAA\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32nt_0x1800.h",
    "content": "unsigned char br_fat32nt_0x1800[] = {\n  0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0x8b, 0x4e, 0x24, 0x66, 0xf7, 0xe1,\n  0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 0x56, 0x0e, 0x66, 0x03, 0xc2,\n  0x66, 0x89, 0x46, 0xfc, 0x66, 0xc7, 0x46, 0xf4, 0xff, 0xff, 0xff, 0xff,\n  0x66, 0x8b, 0x46, 0x2c, 0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0xa6, 0xfc,\n  0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x0f, 0x83, 0x9c, 0xfc, 0x66, 0x50,\n  0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x8b, 0xf3, 0x66,\n  0xf7, 0xe3, 0x66, 0x03, 0x46, 0xfc, 0xbb, 0x00, 0x82, 0x8b, 0xfb, 0xb9,\n  0x01, 0x00, 0xe8, 0x87, 0xfc, 0x38, 0x2d, 0x74, 0x1e, 0xb1, 0x0b, 0x56,\n  0xbe, 0x70, 0x7d, 0xf3, 0xa6, 0x5e, 0x74, 0x1b, 0x03, 0xf9, 0x83, 0xc7,\n  0x15, 0x3b, 0xfb, 0x72, 0xe8, 0x4e, 0x75, 0xda, 0x66, 0x58, 0xe8, 0x65,\n  0x00, 0x72, 0xbf, 0x83, 0xc4, 0x04, 0xe9, 0x55, 0xfc, 0x00, 0x20, 0x83,\n  0xc4, 0x04, 0x8b, 0x75, 0x09, 0x8b, 0x7d, 0x0f, 0x8b, 0xc6, 0x66, 0xc1,\n  0xe0, 0x10, 0x8b, 0xc7, 0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0x3a, 0xfc,\n  0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x0f, 0x83, 0x30, 0xfc, 0x66, 0x50,\n  0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x4e, 0x0d, 0x66, 0xf7, 0xe1,\n  0x66, 0x03, 0x46, 0xfc, 0xbb, 0x00, 0x00, 0x06, 0x8e, 0x06, 0x81, 0x80,\n  0xe8, 0x1d, 0xfc, 0x07, 0x66, 0x58, 0xc1, 0xeb, 0x04, 0x01, 0x1e, 0x81,\n  0x80, 0xe8, 0x0e, 0x00, 0x0f, 0x83, 0x02, 0x00, 0x72, 0xd0, 0x8a, 0x56,\n  0x40, 0xea, 0x00, 0x00, 0x00, 0x20, 0x66, 0xc1, 0xe0, 0x02, 0xe8, 0x11,\n  0x00, 0x26, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff, 0xff, 0xff, 0x0f, 0x66,\n  0x3d, 0xf8, 0xff, 0xff, 0x0f, 0xc3, 0xbf, 0x00, 0x7e, 0x66, 0x0f, 0xb7,\n  0x4e, 0x0b, 0x66, 0x33, 0xd2, 0x66, 0xf7, 0xf1, 0x66, 0x3b, 0x46, 0xf4,\n  0x74, 0x3a, 0x66, 0x89, 0x46, 0xf4, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f,\n  0xb7, 0x4e, 0x0e, 0x66, 0x03, 0xc1, 0x66, 0x0f, 0xb7, 0x5e, 0x28, 0x83,\n  0xe3, 0x0f, 0x74, 0x16, 0x3a, 0x5e, 0x10, 0x0f, 0x83, 0xab, 0xfb, 0x52,\n  0x66, 0x8b, 0xc8, 0x66, 0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x03,\n  0xc1, 0x5a, 0x52, 0x8b, 0xdf, 0xb9, 0x01, 0x00, 0xe8, 0x9d, 0xfb, 0x5a,\n  0x8b, 0xda, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32nt_0x3f0.h",
    "content": "unsigned char br_fat32nt_0x3f0[] = {\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x55, 0xaa, 0xfa, 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0x8b,\n  0x4e, 0x24, 0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7,\n  0x56, 0x0e, 0x66, 0x03, 0xc2, 0x33, 0xc9, 0x66, 0x89, 0x46, 0xfc, 0x66,\n  0xc7, 0x46, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x66, 0x8b, 0x46, 0x2c,\n  0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0xcf, 0xfc, 0x66, 0x3d, 0xf8, 0xff,\n  0xff, 0x0f, 0x0f, 0x83, 0xc5, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb,\n  0x52, 0x50, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x66, 0x0f, 0xac, 0xd0, 0x10,\n  0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x8b, 0xf3, 0x66,\n  0xf7, 0xe3, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb,\n  0xbb, 0x00, 0x07, 0x8b, 0xfb, 0xb9, 0x01, 0x00, 0xe8, 0xbe, 0xfc, 0x0f,\n  0x82, 0xaa, 0xfc, 0x38, 0x2d, 0x74, 0x1e, 0xb1, 0x0b, 0x56, 0xbe, 0xd8,\n  0x7d, 0xf3, 0xa6, 0x5e, 0x74, 0x19, 0x03, 0xf9, 0x83, 0xc7, 0x15, 0x3b,\n  0xfb, 0x72, 0xe8, 0x4e, 0x75, 0xd6, 0x58, 0x5a, 0xe8, 0x66, 0x00, 0x72,\n  0xab, 0x83, 0xc4, 0x04, 0xe9, 0x64, 0xfc, 0x83, 0xc4, 0x04, 0x8b, 0x75,\n  0x09, 0x8b, 0x7d, 0x0f, 0x8b, 0xc6, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x8b,\n  0xc7, 0x66, 0x83, 0xf8, 0x02, 0x72, 0x3b, 0x66, 0x3d, 0xf8, 0xff, 0xff,\n  0x0f, 0x73, 0x33, 0x66, 0x48, 0x66, 0x48, 0x66, 0x0f, 0xb6, 0x4e, 0x0d,\n  0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10,\n  0xfb, 0xbb, 0x00, 0x07, 0x53, 0xb9, 0x04, 0x00, 0xe8, 0x52, 0xfc, 0x5b,\n  0x0f, 0x82, 0x3d, 0xfc, 0x81, 0x3f, 0x4d, 0x5a, 0x75, 0x08, 0x81, 0xbf,\n  0x00, 0x02, 0x42, 0x4a, 0x74, 0x06, 0xbe, 0x80, 0x7d, 0xe9, 0x0e, 0xfc,\n  0xea, 0x00, 0x02, 0x70, 0x00, 0x03, 0xc0, 0x13, 0xd2, 0x03, 0xc0, 0x13,\n  0xd2, 0xe8, 0x18, 0x00, 0xfa, 0x26, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff,\n  0xff, 0xff, 0x0f, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0x66, 0x3d, 0xf8, 0xff,\n  0xff, 0x0f, 0xfb, 0xc3, 0xbf, 0x00, 0x7e, 0xfa, 0x66, 0xc1, 0xe0, 0x10,\n  0x66, 0x0f, 0xac, 0xd0, 0x10, 0x66, 0x0f, 0xb7, 0x4e, 0x0b, 0x66, 0x33,\n  0xd2, 0x66, 0xf7, 0xf1, 0x66, 0x3b, 0x46, 0xf8, 0x74, 0x44, 0x66, 0x89,\n  0x46, 0xf8, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 0x4e, 0x0e, 0x66,\n  0x03, 0xc1, 0x66, 0x0f, 0xb7, 0x5e, 0x28, 0x83, 0xe3, 0x0f, 0x74, 0x16,\n  0x3a, 0x5e, 0x10, 0x0f, 0x83, 0xa4, 0xfb, 0x52, 0x66, 0x8b, 0xc8, 0x66,\n  0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x03, 0xc1, 0x5a, 0x52, 0x66,\n  0x0f, 0xa4, 0xc2, 0x10, 0xfb, 0x8b, 0xdf, 0xb9, 0x01, 0x00, 0xe8, 0xb4,\n  0xfb, 0x5a, 0x0f, 0x82, 0x9f, 0xfb, 0xfb, 0x8b, 0xda, 0xc3, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32nt_0x52.h",
    "content": "unsigned char br_fat32nt_0x52[] = {\n                                                              0x46, 0x41,\n  0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x33, 0xc9, 0x8e, 0xd1, 0xbc, 0xf4,\n  0x7b, 0x8e, 0xc1, 0x8e, 0xd9, 0xbd, 0x00, 0x7c, 0x88, 0x4e, 0x02, 0x8a,\n  0x56, 0x40, 0xb4, 0x08, 0xcd, 0x13, 0x73, 0x05, 0xb9, 0xff, 0xff, 0x8a,\n  0xf1, 0x66, 0x0f, 0xb6, 0xc6, 0x40, 0x66, 0x0f, 0xb6, 0xd1, 0x80, 0xe2,\n  0x3f, 0xf7, 0xe2, 0x86, 0xcd, 0xc0, 0xed, 0x06, 0x41, 0x66, 0x0f, 0xb7,\n  0xc9, 0x66, 0xf7, 0xe1, 0x66, 0x89, 0x46, 0xf8, 0x83, 0x7e, 0x16, 0x00,\n  0x75, 0x38, 0x83, 0x7e, 0x2a, 0x00, 0x77, 0x32, 0x66, 0x8b, 0x46, 0x1c,\n  0x66, 0x83, 0xc0, 0x0c, 0xbb, 0x00, 0x80, 0xb9, 0x01, 0x00, 0xe8, 0x2b,\n  0x00, 0xe9, 0x48, 0x03, 0xa0, 0xfa, 0x7d, 0xb4, 0x7d, 0x8b, 0xf0, 0xac,\n  0x84, 0xc0, 0x74, 0x17, 0x3c, 0xff, 0x74, 0x09, 0xb4, 0x0e, 0xbb, 0x07,\n  0x00, 0xcd, 0x10, 0xeb, 0xee, 0xa0, 0xfb, 0x7d, 0xeb, 0xe5, 0xa0, 0xf9,\n  0x7d, 0xeb, 0xe0, 0x98, 0xcd, 0x16, 0xcd, 0x19, 0x66, 0x60, 0x66, 0x3b,\n  0x46, 0xf8, 0x0f, 0x82, 0x4a, 0x00, 0x66, 0x6a, 0x00, 0x66, 0x50, 0x06,\n  0x53, 0x66, 0x68, 0x10, 0x00, 0x01, 0x00, 0x80, 0x7e, 0x02, 0x00, 0x0f,\n  0x85, 0x20, 0x00, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0x8a, 0x56, 0x40, 0xcd,\n  0x13, 0x0f, 0x82, 0x1c, 0x00, 0x81, 0xfb, 0x55, 0xaa, 0x0f, 0x85, 0x14,\n  0x00, 0xf6, 0xc1, 0x01, 0x0f, 0x84, 0x0d, 0x00, 0xfe, 0x46, 0x02, 0xb4,\n  0x42, 0x8a, 0x56, 0x40, 0x8b, 0xf4, 0xcd, 0x13, 0xb0, 0xf9, 0x66, 0x58,\n  0x66, 0x58, 0x66, 0x58, 0x66, 0x58, 0xeb, 0x2a, 0x66, 0x33, 0xd2, 0x66,\n  0x0f, 0xb7, 0x4e, 0x18, 0x66, 0xf7, 0xf1, 0xfe, 0xc2, 0x8a, 0xca, 0x66,\n  0x8b, 0xd0, 0x66, 0xc1, 0xea, 0x10, 0xf7, 0x76, 0x1a, 0x86, 0xd6, 0x8a,\n  0x56, 0x40, 0x8a, 0xe8, 0xc0, 0xe4, 0x06, 0x0a, 0xcc, 0xb8, 0x01, 0x02,\n  0xcd, 0x13, 0x66, 0x61, 0x0f, 0x82, 0x54, 0xff, 0x81, 0xc3, 0x00, 0x02,\n  0x66, 0x40, 0x49, 0x0f, 0x85, 0x71, 0xff, 0xc3, 0x4e, 0x54, 0x4c, 0x44,\n  0x52, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0a, 0x4e, 0x54,\n  0x4c, 0x44, 0x52, 0x20, 0x69, 0x73, 0x20, 0x6d, 0x69, 0x73, 0x73, 0x69,\n  0x6e, 0x67, 0xff, 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x65, 0x72,\n  0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x50, 0x72, 0x65, 0x73, 0x73, 0x20,\n  0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72,\n  0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0xac, 0xbf, 0xcc, 0x00, 0x00, 0x55, 0xaa, 0x52, 0x52, 0x61, 0x41,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x72, 0x72, 0x41, 0x61\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32pe_0x1800.h",
    "content": "unsigned char br_fat32pe_0x1800[] = {\n  0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0x8b, 0x4e, 0x24, 0x66, 0xf7, 0xe1,\n  0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 0x56, 0x0e, 0x66, 0x03, 0xc2,\n  0x66, 0x89, 0x46, 0xfc, 0x66, 0xc7, 0x46, 0xf4, 0xff, 0xff, 0xff, 0xff,\n  0x66, 0x8b, 0x46, 0x2c, 0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0xc2, 0xfc,\n  0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x0f, 0x83, 0xb8, 0xfc, 0x66, 0x50,\n  0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x8b, 0xf3, 0x66,\n  0xf7, 0xe3, 0x66, 0x03, 0x46, 0xfc, 0xbb, 0x00, 0x82, 0x8b, 0xfb, 0xb9,\n  0x01, 0x00, 0xe8, 0xa3, 0xfc, 0x38, 0x2d, 0x74, 0x1e, 0xb1, 0x0b, 0x56,\n  0xbe, 0x69, 0x7d, 0xf3, 0xa6, 0x5e, 0x74, 0x1b, 0x03, 0xf9, 0x83, 0xc7,\n  0x15, 0x3b, 0xfb, 0x72, 0xe8, 0x4e, 0x75, 0xda, 0x66, 0x58, 0xe8, 0x65,\n  0x00, 0x72, 0xbf, 0x83, 0xc4, 0x04, 0xe9, 0x71, 0xfc, 0x00, 0x20, 0x83,\n  0xc4, 0x04, 0x8b, 0x75, 0x09, 0x8b, 0x7d, 0x0f, 0x8b, 0xc6, 0x66, 0xc1,\n  0xe0, 0x10, 0x8b, 0xc7, 0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0x56, 0xfc,\n  0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x0f, 0x83, 0x4c, 0xfc, 0x66, 0x50,\n  0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x4e, 0x0d, 0x66, 0xf7, 0xe1,\n  0x66, 0x03, 0x46, 0xfc, 0xbb, 0x00, 0x00, 0x06, 0x8e, 0x06, 0x81, 0x80,\n  0xe8, 0x39, 0xfc, 0x07, 0x66, 0x58, 0xc1, 0xeb, 0x04, 0x01, 0x1e, 0x81,\n  0x80, 0xe8, 0x0e, 0x00, 0x0f, 0x83, 0x02, 0x00, 0x72, 0xd0, 0x8a, 0x56,\n  0x40, 0xea, 0x00, 0x00, 0x00, 0x20, 0x66, 0xc1, 0xe0, 0x02, 0xe8, 0x11,\n  0x00, 0x26, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff, 0xff, 0xff, 0x0f, 0x66,\n  0x3d, 0xf8, 0xff, 0xff, 0x0f, 0xc3, 0xbf, 0x00, 0x7e, 0x66, 0x0f, 0xb7,\n  0x4e, 0x0b, 0x66, 0x33, 0xd2, 0x66, 0xf7, 0xf1, 0x66, 0x3b, 0x46, 0xf4,\n  0x74, 0x3a, 0x66, 0x89, 0x46, 0xf4, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f,\n  0xb7, 0x4e, 0x0e, 0x66, 0x03, 0xc1, 0x66, 0x0f, 0xb7, 0x5e, 0x28, 0x83,\n  0xe3, 0x0f, 0x74, 0x16, 0x3a, 0x5e, 0x10, 0x0f, 0x83, 0xc7, 0xfb, 0x52,\n  0x66, 0x8b, 0xc8, 0x66, 0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x03,\n  0xc1, 0x5a, 0x52, 0x8b, 0xdf, 0xb9, 0x01, 0x00, 0xe8, 0xb9, 0xfb, 0x5a,\n  0x8b, 0xda, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32pe_0x3f0.h",
    "content": "unsigned char br_fat32pe_0x3f0[] = {\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x55, 0xaa, 0xfa, 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0x8b,\n  0x4e, 0x24, 0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7,\n  0x56, 0x0e, 0x66, 0x03, 0xc2, 0x33, 0xc9, 0x66, 0x89, 0x46, 0xfc, 0x66,\n  0xc7, 0x46, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x66, 0x8b, 0x46, 0x2c,\n  0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0xcf, 0xfc, 0x66, 0x3d, 0xf8, 0xff,\n  0xff, 0x0f, 0x0f, 0x83, 0xc5, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb,\n  0x52, 0x50, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x66, 0x0f, 0xac, 0xd0, 0x10,\n  0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x8b, 0xf3, 0x66,\n  0xf7, 0xe3, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb,\n  0xbb, 0x00, 0x07, 0x8b, 0xfb, 0xb9, 0x01, 0x00, 0xe8, 0xbe, 0xfc, 0x0f,\n  0x82, 0xaa, 0xfc, 0x38, 0x2d, 0x74, 0x1e, 0xb1, 0x0b, 0x56, 0xbe, 0xd8,\n  0x7d, 0xf3, 0xa6, 0x5e, 0x74, 0x19, 0x03, 0xf9, 0x83, 0xc7, 0x15, 0x3b,\n  0xfb, 0x72, 0xe8, 0x4e, 0x75, 0xd6, 0x58, 0x5a, 0xe8, 0x66, 0x00, 0x72,\n  0xab, 0x83, 0xc4, 0x04, 0xe9, 0x64, 0xfc, 0x83, 0xc4, 0x04, 0x8b, 0x75,\n  0x09, 0x8b, 0x7d, 0x0f, 0x8b, 0xc6, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x8b,\n  0xc7, 0x66, 0x83, 0xf8, 0x02, 0x72, 0x3b, 0x66, 0x3d, 0xf8, 0xff, 0xff,\n  0x0f, 0x73, 0x33, 0x66, 0x48, 0x66, 0x48, 0x66, 0x0f, 0xb6, 0x4e, 0x0d,\n  0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10,\n  0xfb, 0xbb, 0x00, 0x07, 0x53, 0xb9, 0x04, 0x00, 0xe8, 0x52, 0xfc, 0x5b,\n  0x0f, 0x82, 0x3d, 0xfc, 0x81, 0x3f, 0x4d, 0x5a, 0x75, 0x08, 0x81, 0xbf,\n  0x00, 0x02, 0x42, 0x4a, 0x74, 0x06, 0xbe, 0x80, 0x7d, 0xe9, 0x0e, 0xfc,\n  0xea, 0x00, 0x02, 0x70, 0x00, 0x03, 0xc0, 0x13, 0xd2, 0x03, 0xc0, 0x13,\n  0xd2, 0xe8, 0x18, 0x00, 0xfa, 0x26, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff,\n  0xff, 0xff, 0x0f, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0x66, 0x3d, 0xf8, 0xff,\n  0xff, 0x0f, 0xfb, 0xc3, 0xbf, 0x00, 0x7e, 0xfa, 0x66, 0xc1, 0xe0, 0x10,\n  0x66, 0x0f, 0xac, 0xd0, 0x10, 0x66, 0x0f, 0xb7, 0x4e, 0x0b, 0x66, 0x33,\n  0xd2, 0x66, 0xf7, 0xf1, 0x66, 0x3b, 0x46, 0xf8, 0x74, 0x44, 0x66, 0x89,\n  0x46, 0xf8, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 0x4e, 0x0e, 0x66,\n  0x03, 0xc1, 0x66, 0x0f, 0xb7, 0x5e, 0x28, 0x83, 0xe3, 0x0f, 0x74, 0x16,\n  0x3a, 0x5e, 0x10, 0x0f, 0x83, 0xa4, 0xfb, 0x52, 0x66, 0x8b, 0xc8, 0x66,\n  0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x03, 0xc1, 0x5a, 0x52, 0x66,\n  0x0f, 0xa4, 0xc2, 0x10, 0xfb, 0x8b, 0xdf, 0xb9, 0x01, 0x00, 0xe8, 0xb4,\n  0xfb, 0x5a, 0x0f, 0x82, 0x9f, 0xfb, 0xfb, 0x8b, 0xda, 0xc3, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32pe_0x52.h",
    "content": "unsigned char br_fat32pe_0x52[] = {\n                                                              0x46, 0x41,\n  0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x33, 0xc9, 0x8e, 0xd1, 0xbc, 0xf4,\n  0x7b, 0x8e, 0xc1, 0x8e, 0xd9, 0xbd, 0x00, 0x7c, 0x88, 0x4e, 0x02, 0x8a,\n  0x56, 0x40, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0xcd, 0x13, 0x72, 0x10, 0x81,\n  0xfb, 0x55, 0xaa, 0x75, 0x0a, 0xf6, 0xc1, 0x01, 0x74, 0x05, 0xfe, 0x46,\n  0x02, 0xeb, 0x2d, 0x8a, 0x56, 0x40, 0xb4, 0x08, 0xcd, 0x13, 0x73, 0x05,\n  0xb9, 0xff, 0xff, 0x8a, 0xf1, 0x66, 0x0f, 0xb6, 0xc6, 0x40, 0x66, 0x0f,\n  0xb6, 0xd1, 0x80, 0xe2, 0x3f, 0xf7, 0xe2, 0x86, 0xcd, 0xc0, 0xed, 0x06,\n  0x41, 0x66, 0x0f, 0xb7, 0xc9, 0x66, 0xf7, 0xe1, 0x66, 0x89, 0x46, 0xf8,\n  0x83, 0x7e, 0x16, 0x00, 0x75, 0x38, 0x83, 0x7e, 0x2a, 0x00, 0x77, 0x32,\n  0x66, 0x8b, 0x46, 0x1c, 0x66, 0x83, 0xc0, 0x0c, 0xbb, 0x00, 0x80, 0xb9,\n  0x01, 0x00, 0xe8, 0x2b, 0x00, 0xe9, 0x2c, 0x03, 0xa0, 0xfa, 0x7d, 0xb4,\n  0x7d, 0x8b, 0xf0, 0xac, 0x84, 0xc0, 0x74, 0x17, 0x3c, 0xff, 0x74, 0x09,\n  0xb4, 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xee, 0xa0, 0xfb, 0x7d,\n  0xeb, 0xe5, 0xa0, 0xf9, 0x7d, 0xeb, 0xe0, 0x98, 0xcd, 0x16, 0xcd, 0x19,\n  0x66, 0x60, 0x80, 0x7e, 0x02, 0x00, 0x0f, 0x84, 0x20, 0x00, 0x66, 0x6a,\n  0x00, 0x66, 0x50, 0x06, 0x53, 0x66, 0x68, 0x10, 0x00, 0x01, 0x00, 0xb4,\n  0x42, 0x8a, 0x56, 0x40, 0x8b, 0xf4, 0xcd, 0x13, 0x66, 0x58, 0x66, 0x58,\n  0x66, 0x58, 0x66, 0x58, 0xeb, 0x33, 0x66, 0x3b, 0x46, 0xf8, 0x72, 0x03,\n  0xf9, 0xeb, 0x2a, 0x66, 0x33, 0xd2, 0x66, 0x0f, 0xb7, 0x4e, 0x18, 0x66,\n  0xf7, 0xf1, 0xfe, 0xc2, 0x8a, 0xca, 0x66, 0x8b, 0xd0, 0x66, 0xc1, 0xea,\n  0x10, 0xf7, 0x76, 0x1a, 0x86, 0xd6, 0x8a, 0x56, 0x40, 0x8a, 0xe8, 0xc0,\n  0xe4, 0x06, 0x0a, 0xcc, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x66, 0x61, 0x0f,\n  0x82, 0x75, 0xff, 0x81, 0xc3, 0x00, 0x02, 0x66, 0x40, 0x49, 0x75, 0x94,\n  0xc3, 0x42, 0x4f, 0x4f, 0x54, 0x4d, 0x47, 0x52, 0x20, 0x20, 0x20, 0x20,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0a, 0x42, 0x4f,\n  0x4f, 0x54, 0x4d, 0x47, 0x52, 0x20, 0x69, 0x73, 0x20, 0x6d, 0x69, 0x73,\n  0x73, 0x69, 0x6e, 0x67, 0xff, 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20,\n  0x65, 0x72, 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x50, 0x72, 0x65, 0x73,\n  0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f,\n  0x20, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0xac, 0xc1, 0xce, 0x00, 0x00, 0x55, 0xaa, 0x52, 0x52, 0x61, 0x41,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x72, 0x72, 0x41, 0x61, 0x00, 0x00, 0x00, 0x00, 0x02\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32ros_0x1c00.h",
    "content": "unsigned char br_fat32ros_0x1c00[] = {\n\t0x66, 0x8b, 0x86, 0x2c, 0x00, 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x72,\n\t0x03, 0xe9, 0x6c, 0x01, 0xbb, 0x00, 0x20, 0x8e, 0xc3, 0xe8, 0x26, 0x01,\n\t0x31, 0xdb, 0x8a, 0x9e, 0x0d, 0x00, 0xc1, 0xe3, 0x04, 0xb8, 0x00, 0x20,\n\t0x8e, 0xc0, 0x31, 0xff, 0xbe, 0xa3, 0x7f, 0xb9, 0x0b, 0x00, 0xf3, 0xa6,\n\t0x74, 0x2b, 0x4b, 0x75, 0x03, 0xe9, 0x44, 0x01, 0x8c, 0xc0, 0x83, 0xc0,\n\t0x02, 0x8e, 0xc0, 0x31, 0xff, 0xbe, 0xa3, 0x7f, 0xb9, 0x0b, 0x00, 0xf3,\n\t0xa6, 0x74, 0x12, 0x4b, 0x75, 0xea, 0x66, 0x8b, 0x86, 0x2c, 0x00, 0xe8,\n\t0x6c, 0x00, 0x66, 0x89, 0x86, 0x2c, 0x00, 0xeb, 0xa3, 0xbe, 0xae, 0x7f,\n\t0xe8, 0x42, 0xff, 0x31, 0xff, 0x31, 0xd2, 0x26, 0x8b, 0x45, 0x14, 0x66,\n\t0xc1, 0xe0, 0x10, 0x26, 0x8b, 0x45, 0x1a, 0x66, 0x83, 0xf8, 0x02, 0x73,\n\t0x03, 0xe9, 0x17, 0xff, 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x72, 0x03,\n\t0xe9, 0x0c, 0xff, 0xbb, 0x80, 0x0f, 0x8e, 0xc3, 0x66, 0x3d, 0xf8, 0xff,\n\t0xff, 0x0f, 0x73, 0x21, 0x66, 0x50, 0x31, 0xdb, 0x06, 0xe8, 0xa2, 0x00,\n\t0x07, 0x31, 0xdb, 0x8a, 0x9e, 0x0d, 0x00, 0xc1, 0xe3, 0x05, 0x8c, 0xc0,\n\t0x01, 0xd8, 0x8e, 0xc0, 0x66, 0x58, 0x06, 0xe8, 0x10, 0x00, 0x07, 0xeb,\n\t0xd7, 0x8a, 0x96, 0x40, 0x00, 0x8a, 0x36, 0xfd, 0x7d, 0xea, 0x00, 0xf8,\n\t0x00, 0x00, 0x66, 0xc1, 0xe0, 0x02, 0x66, 0x89, 0xc1, 0x66, 0x31, 0xd2,\n\t0x66, 0x0f, 0xb7, 0x9e, 0x0b, 0x00, 0x66, 0x53, 0x66, 0xf7, 0xf3, 0x66,\n\t0x0f, 0xb7, 0x9e, 0x0e, 0x00, 0x66, 0x01, 0xd8, 0x66, 0x8b, 0x9e, 0x1c,\n\t0x00, 0x66, 0x01, 0xd8, 0x66, 0x5b, 0x66, 0x4b, 0x66, 0x21, 0xd9, 0x66,\n\t0x0f, 0xb7, 0x9e, 0x28, 0x00, 0x83, 0xe3, 0x0f, 0x74, 0x18, 0x3a, 0x9e,\n\t0x10, 0x00, 0x72, 0x03, 0xe9, 0x90, 0xfe, 0x66, 0x50, 0x66, 0x8b, 0x86,\n\t0x24, 0x00, 0x66, 0xf7, 0xe3, 0x66, 0x5a, 0x66, 0x01, 0xd0, 0x66, 0x51,\n\t0xbb, 0x00, 0x90, 0x8e, 0xc3, 0x66, 0x3b, 0x06, 0x3a, 0x7f, 0x74, 0x0c,\n\t0x66, 0xa3, 0x3a, 0x7f, 0x31, 0xdb, 0xb9, 0x01, 0x00, 0xe8, 0xaf, 0xfd,\n\t0x66, 0x59, 0x26, 0x67, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff, 0xff, 0xff,\n\t0x0f, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x66, 0x48, 0x66, 0x48, 0x66, 0x31,\n\t0xd2, 0x66, 0x0f, 0xb6, 0x9e, 0x0d, 0x00, 0x66, 0xf7, 0xe3, 0x66, 0x50,\n\t0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x86, 0x10, 0x00, 0x66, 0xf7, 0xa6,\n\t0x24, 0x00, 0x66, 0x0f, 0xb7, 0x9e, 0x0e, 0x00, 0x66, 0x01, 0xd8, 0x66,\n\t0x03, 0x86, 0x1c, 0x00, 0x66, 0x5b, 0x66, 0x01, 0xd8, 0x31, 0xdb, 0x0f,\n\t0xb6, 0x8e, 0x0d, 0x00, 0xe8, 0x60, 0xfd, 0xc3, 0xbe, 0x8b, 0x7f, 0xe8,\n\t0x23, 0xfe, 0xbe, 0xd9, 0x7d, 0xe8, 0x1d, 0xfe, 0xe9, 0x0e, 0xfe, 0x66,\n\t0x72, 0x65, 0x65, 0x6c, 0x64, 0x72, 0x2e, 0x73, 0x79, 0x73, 0x20, 0x6e,\n\t0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x00, 0x46,\n\t0x52, 0x45, 0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x4c, 0x6f,\n\t0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x46, 0x72, 0x65, 0x65, 0x4c, 0x6f,\n\t0x61, 0x64, 0x65, 0x72, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32ros_0x3f0.h",
    "content": "unsigned char br_fat32ros_0x3f0[] = {\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x55, 0xaa\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_fat32ros_0x52.h",
    "content": "unsigned char br_fat32ros_0x52[] = {\n\t0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x31, 0xc0, 0x8e, 0xd8,\n\t0x8e, 0xc0, 0x8e, 0xd0, 0xbd, 0x00, 0x7c, 0xbc, 0x00, 0x7c, 0x80, 0xbe,\n\t0x40, 0x00, 0xff, 0x75, 0x04, 0x88, 0x96, 0x40, 0x00, 0x83, 0xbe, 0x16,\n\t0x00, 0x00, 0x75, 0x0f, 0x66, 0x83, 0xbe, 0x11, 0x00, 0x00, 0x75, 0x07,\n\t0x83, 0xbe, 0x2a, 0x00, 0x00, 0x76, 0x03, 0xe9, 0x07, 0x01, 0xb8, 0x00,\n\t0x08, 0x8a, 0x96, 0x40, 0x00, 0xcd, 0x13, 0x73, 0x05, 0xb9, 0xff, 0xff,\n\t0x88, 0xce, 0x88, 0xeb, 0x88, 0xcf, 0xc0, 0xef, 0x06, 0x80, 0xe1, 0x3f,\n\t0x66, 0x0f, 0xb6, 0xc6, 0x66, 0x0f, 0xb7, 0xdb, 0x66, 0x0f, 0xb6, 0xc9,\n\t0x66, 0x40, 0x66, 0x43, 0x66, 0xf7, 0xe1, 0x66, 0xf7, 0xe3, 0x66, 0xa3,\n\t0xb4, 0x7d, 0x66, 0xb8, 0x0e, 0x00, 0x00, 0x00, 0x66, 0x03, 0x86, 0x1c,\n\t0x00, 0xb9, 0x01, 0x00, 0x31, 0xdb, 0x8e, 0xc3, 0xbb, 0x00, 0x7e, 0xe8,\n\t0x03, 0x00, 0xe9, 0x25, 0x01, 0x06, 0x66, 0x3b, 0x06, 0xb4, 0x7d, 0x73,\n\t0x1c, 0x66, 0x60, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0x8a, 0x96, 0x40, 0x00,\n\t0xcd, 0x13, 0x72, 0x57, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x51, 0xf6, 0xc1,\n\t0x01, 0x74, 0x4c, 0x66, 0x61, 0x66, 0x60, 0x83, 0xf9, 0x40, 0x76, 0x03,\n\t0xb9, 0x40, 0x00, 0x89, 0x0e, 0x45, 0x7d, 0x6a, 0x00, 0x6a, 0x00, 0x66,\n\t0x50, 0x06, 0x53, 0x51, 0x6a, 0x10, 0x89, 0xe6, 0x8a, 0x96, 0x40, 0x00,\n\t0xb4, 0x42, 0xcd, 0x13, 0x72, 0x67, 0x83, 0xc4, 0x10, 0x66, 0x61, 0x53,\n\t0x66, 0x8b, 0x1e, 0x45, 0x7d, 0x66, 0x01, 0xd8, 0x66, 0xc1, 0xe3, 0x05,\n\t0x8c, 0xc2, 0x01, 0xda, 0x8e, 0xc2, 0x5b, 0x2b, 0x0e, 0x45, 0x7d, 0x75,\n\t0xbc, 0x07, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x66, 0x61, 0x66, 0x60, 0x66,\n\t0x31, 0xd2, 0x66, 0x0f, 0xb7, 0x8e, 0x18, 0x00, 0x66, 0xf7, 0xf1, 0xfe,\n\t0xc2, 0x88, 0xd1, 0x66, 0x89, 0xc2, 0x66, 0xc1, 0xea, 0x10, 0xf7, 0xb6,\n\t0x1a, 0x00, 0x88, 0xd6, 0x8a, 0x96, 0x40, 0x00, 0x88, 0xc5, 0xd0, 0xcc,\n\t0xd0, 0xcc, 0x08, 0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x72, 0x0e, 0x66,\n\t0x61, 0x66, 0x40, 0x8c, 0xc2, 0x83, 0xc2, 0x20, 0x8e, 0xc2, 0xe2, 0xc1,\n\t0xc3, 0xbe, 0xb8, 0x7d, 0xe8, 0x14, 0x00, 0xeb, 0x06, 0xbe, 0xc5, 0x7d,\n\t0xe8, 0x0c, 0x00, 0xbe, 0xd9, 0x7d, 0xe8, 0x06, 0x00, 0x31, 0xc0, 0xcd,\n\t0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0, 0x74, 0x09, 0xb4, 0x0e, 0xbb, 0x07,\n\t0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x44, 0x69,\n\t0x73, 0x6b, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x46,\n\t0x69, 0x6c, 0x65, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x65,\n\t0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73,\n\t0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20,\n\t0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa, 0x52, 0x52,\n\t0x61, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x72, 0x72, 0x41, 0x61\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_ntfs_0x0.h",
    "content": "unsigned char br_ntfs_0x0[] = {\n  0xEB, 0x52, 0x90, 0x4E, 0x54, 0x46, 0x53, 0x20, 0x20, 0x20, 0x20\n};\n"
  },
  {
    "path": "src/ms-sys/inc/br_ntfs_0x54.h",
    "content": "unsigned char br_ntfs_0x54[] = {\r\n  0xFA, 0x33, 0xC0, 0x8E, 0xD0, 0xBC, 0x00, 0x7C, 0xFB, 0x68, 0xC0, 0x07,\r\n  0x1F, 0x1E, 0x68, 0x66, 0x00, 0xCB, 0x88, 0x16, 0x0E, 0x00, 0x66, 0x81,\r\n  0x3E, 0x03, 0x00, 0x4E, 0x54, 0x46, 0x53, 0x75, 0x15, 0xB4, 0x41, 0xBB,\r\n  0xAA, 0x55, 0xCD, 0x13, 0x72, 0x0C, 0x81, 0xFB, 0x55, 0xAA, 0x75, 0x06,\r\n  0xF7, 0xC1, 0x01, 0x00, 0x75, 0x03, 0xE9, 0xDD, 0x00, 0x1E, 0x83, 0xEC,\r\n  0x18, 0x68, 0x1A, 0x00, 0xB4, 0x48, 0x8A, 0x16, 0x0E, 0x00, 0x8B, 0xF4,\r\n  0x16, 0x1F, 0xCD, 0x13, 0x9F, 0x83, 0xC4, 0x18, 0x9E, 0x58, 0x1F, 0x72,\r\n  0xE1, 0x3B, 0x06, 0x0B, 0x00, 0x75, 0xDB, 0xA3, 0x0F, 0x00, 0xC1, 0x2E,\r\n  0x0F, 0x00, 0x04, 0x1E, 0x5A, 0x33, 0xDB, 0xB9, 0x00, 0x20, 0x2B, 0xC8,\r\n  0x66, 0xFF, 0x06, 0x11, 0x00, 0x03, 0x16, 0x0F, 0x00, 0x8E, 0xC2, 0xFF,\r\n  0x06, 0x16, 0x00, 0xE8, 0x4B, 0x00, 0x2B, 0xC8, 0x77, 0xEF, 0xB8, 0x00,\r\n  0xBB, 0xCD, 0x1A, 0x66, 0x23, 0xC0, 0x75, 0x2D, 0x66, 0x81, 0xFB, 0x54,\r\n  0x43, 0x50, 0x41, 0x75, 0x24, 0x81, 0xF9, 0x02, 0x01, 0x72, 0x1E, 0x16,\r\n  0x68, 0x07, 0xBB, 0x16, 0x68, 0x70, 0x0E, 0x16, 0x68, 0x09, 0x00, 0x66,\r\n  0x53, 0x66, 0x53, 0x66, 0x55, 0x16, 0x16, 0x16, 0x68, 0xB8, 0x01, 0x66,\r\n  0x61, 0x0E, 0x07, 0xCD, 0x1A, 0x33, 0xC0, 0xBF, 0x28, 0x10, 0xB9, 0xD8,\r\n  0x0F, 0xFC, 0xF3, 0xAA, 0xE9, 0x5F, 0x01, 0x90, 0x90, 0x66, 0x60, 0x1E,\r\n  0x06, 0x66, 0xA1, 0x11, 0x00, 0x66, 0x03, 0x06, 0x1C, 0x00, 0x1E, 0x66,\r\n  0x68, 0x00, 0x00, 0x00, 0x00, 0x66, 0x50, 0x06, 0x53, 0x68, 0x01, 0x00,\r\n  0x68, 0x10, 0x00, 0xB4, 0x42, 0x8A, 0x16, 0x0E, 0x00, 0x16, 0x1F, 0x8B,\r\n  0xF4, 0xCD, 0x13, 0x66, 0x59, 0x5B, 0x5A, 0x66, 0x59, 0x66, 0x59, 0x1F,\r\n  0x0F, 0x82, 0x16, 0x00, 0x66, 0xFF, 0x06, 0x11, 0x00, 0x03, 0x16, 0x0F,\r\n  0x00, 0x8E, 0xC2, 0xFF, 0x0E, 0x16, 0x00, 0x75, 0xBC, 0x07, 0x1F, 0x66,\r\n  0x61, 0xC3, 0xA0, 0xF8, 0x01, 0xE8, 0x09, 0x00, 0xA0, 0xFB, 0x01, 0xE8,\r\n  0x03, 0x00, 0xF4, 0xEB, 0xFD, 0xB4, 0x01, 0x8B, 0xF0, 0xAC, 0x3C, 0x00,\r\n  0x74, 0x09, 0xB4, 0x0E, 0xBB, 0x07, 0x00, 0xCD, 0x10, 0xEB, 0xF2, 0xC3,\r\n  0x0D, 0x0A, 0x41, 0x20, 0x64, 0x69, 0x73, 0x6B, 0x20, 0x72, 0x65, 0x61,\r\n  0x64, 0x20, 0x65, 0x72, 0x72, 0x6F, 0x72, 0x20, 0x6F, 0x63, 0x63, 0x75,\r\n  0x72, 0x72, 0x65, 0x64, 0x00, 0x0D, 0x0A, 0x42, 0x4F, 0x4F, 0x54, 0x4D,\r\n  0x47, 0x52, 0x20, 0x69, 0x73, 0x20, 0x6D, 0x69, 0x73, 0x73, 0x69, 0x6E,\r\n  0x67, 0x00, 0x0D, 0x0A, 0x42, 0x4F, 0x4F, 0x54, 0x4D, 0x47, 0x52, 0x20,\r\n  0x69, 0x73, 0x20, 0x63, 0x6F, 0x6D, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65,\r\n  0x64, 0x00, 0x0D, 0x0A, 0x50, 0x72, 0x65, 0x73, 0x73, 0x20, 0x43, 0x74,\r\n  0x72, 0x6C, 0x2B, 0x41, 0x6C, 0x74, 0x2B, 0x44, 0x65, 0x6C, 0x20, 0x74,\r\n  0x6F, 0x20, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x0D, 0x0A, 0x00,\r\n  0x8C, 0xA9, 0xBE, 0xD6, 0x00, 0x00, 0x55, 0xAA, 0x07, 0x00, 0x42, 0x00,\r\n  0x4F, 0x00, 0x4F, 0x00, 0x54, 0x00, 0x4D, 0x00, 0x47, 0x00, 0x52, 0x00,\r\n  0x04, 0x00, 0x24, 0x00, 0x49, 0x00, 0x33, 0x00, 0x30, 0x00, 0x00, 0xD4,\r\n  0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEB, 0x22,\r\n  0x90, 0x90, 0x05, 0x00, 0x4E, 0x00, 0x54, 0x00, 0x4C, 0x00, 0x44, 0x00,\r\n  0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x0F,\r\n  0xB7, 0x06, 0x0B, 0x00, 0x66, 0x0F, 0xB6, 0x1E, 0x0D, 0x00, 0x66, 0xF7,\r\n  0xE3, 0x66, 0xA3, 0x52, 0x02, 0x66, 0x8B, 0x0E, 0x40, 0x00, 0x80, 0xF9,\r\n  0x00, 0x0F, 0x8F, 0x0E, 0x00, 0xF6, 0xD9, 0x66, 0xB8, 0x01, 0x00, 0x00,\r\n  0x00, 0x66, 0xD3, 0xE0, 0xEB, 0x08, 0x90, 0x66, 0xA1, 0x52, 0x02, 0x66,\r\n  0xF7, 0xE1, 0x66, 0xA3, 0x66, 0x02, 0x66, 0x0F, 0xB7, 0x1E, 0x0B, 0x00,\r\n  0x66, 0x33, 0xD2, 0x66, 0xF7, 0xF3, 0x66, 0xA3, 0x56, 0x02, 0xE8, 0x95,\r\n  0x04, 0x66, 0x8B, 0x0E, 0x4E, 0x02, 0x66, 0x89, 0x0E, 0x26, 0x02, 0x66,\r\n  0x03, 0x0E, 0x66, 0x02, 0x66, 0x89, 0x0E, 0x2A, 0x02, 0x66, 0x03, 0x0E,\r\n  0x66, 0x02, 0x66, 0x89, 0x0E, 0x2E, 0x02, 0x66, 0x03, 0x0E, 0x66, 0x02,\r\n  0x66, 0x89, 0x0E, 0x3E, 0x02, 0x66, 0x03, 0x0E, 0x66, 0x02, 0x66, 0x89,\r\n  0x0E, 0x46, 0x02, 0x66, 0xB8, 0x90, 0x00, 0x00, 0x00, 0x66, 0x8B, 0x0E,\r\n  0x26, 0x02, 0xE8, 0x83, 0x09, 0x66, 0x0B, 0xC0, 0x0F, 0x84, 0x5E, 0xFE,\r\n  0x66, 0xA3, 0x32, 0x02, 0x66, 0xB8, 0xA0, 0x00, 0x00, 0x00, 0x66, 0x8B,\r\n  0x0E, 0x2A, 0x02, 0xE8, 0x6A, 0x09, 0x66, 0xA3, 0x36, 0x02, 0x66, 0xB8,\r\n  0xB0, 0x00, 0x00, 0x00, 0x66, 0x8B, 0x0E, 0x2E, 0x02, 0xE8, 0x58, 0x09,\r\n  0x66, 0xA3, 0x3A, 0x02, 0x66, 0xA1, 0x32, 0x02, 0x66, 0x0B, 0xC0, 0x0F,\r\n  0x84, 0x2B, 0xFE, 0x67, 0x80, 0x78, 0x08, 0x00, 0x0F, 0x85, 0x22, 0xFE,\r\n  0x67, 0x66, 0x8D, 0x50, 0x10, 0x67, 0x03, 0x42, 0x04, 0x67, 0x66, 0x0F,\r\n  0xB6, 0x48, 0x0C, 0x66, 0x89, 0x0E, 0x72, 0x02, 0x67, 0x66, 0x8B, 0x48,\r\n  0x08, 0x66, 0x89, 0x0E, 0x6E, 0x02, 0x66, 0xA1, 0x6E, 0x02, 0x66, 0x0F,\r\n  0xB7, 0x0E, 0x0B, 0x00, 0x66, 0x33, 0xD2, 0x66, 0xF7, 0xF1, 0x66, 0xA3,\r\n  0x76, 0x02, 0x66, 0xA1, 0x46, 0x02, 0x66, 0x03, 0x06, 0x6E, 0x02, 0x66,\r\n  0xA3, 0x4A, 0x02, 0x66, 0x83, 0x3E, 0x36, 0x02, 0x00, 0x0F, 0x84, 0x1D,\r\n  0x00, 0x66, 0x83, 0x3E, 0x3A, 0x02, 0x00, 0x0F, 0x84, 0xCF, 0xFD, 0x66,\r\n  0x8B, 0x1E, 0x3A, 0x02, 0x1E, 0x07, 0x66, 0x8B, 0x3E, 0x4A, 0x02, 0x66,\r\n  0xA1, 0x2E, 0x02, 0xE8, 0xE0, 0x01, 0x66, 0x0F, 0xB7, 0x0E, 0x00, 0x02,\r\n  0x66, 0xB8, 0x02, 0x02, 0x00, 0x00, 0xE8, 0x22, 0x08, 0x66, 0x0B, 0xC0,\r\n  0x0F, 0x85, 0x16, 0x00, 0x66, 0x0F, 0xB7, 0x0E, 0x5A, 0x02, 0x66, 0xB8,\r\n  0x5C, 0x02, 0x00, 0x00, 0xE8, 0x0C, 0x08, 0x66, 0x0B, 0xC0, 0x0F, 0x84,\r\n  0x42, 0x0C, 0x67, 0x66, 0x8B, 0x00, 0x1E, 0x07, 0x66, 0x8B, 0x3E, 0x3E,\r\n  0x02, 0xE8, 0x3F, 0x06, 0x66, 0xA1, 0x3E, 0x02, 0x66, 0xBB, 0x20, 0x00,\r\n  0x00, 0x00, 0x66, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x66, 0xBA, 0x00, 0x00,\r\n  0x00, 0x00, 0xE8, 0xE4, 0x00, 0x66, 0x85, 0xC0, 0x0F, 0x85, 0x23, 0x00,\r\n  0x66, 0xA1, 0x3E, 0x02, 0x66, 0xBB, 0x80, 0x00, 0x00, 0x00, 0x66, 0xB9,\r\n  0x00, 0x00, 0x00, 0x00, 0x66, 0xBA, 0x00, 0x00, 0x00, 0x00, 0xE8, 0xC4,\r\n  0x00, 0x66, 0x0B, 0xC0, 0x0F, 0x85, 0x44, 0x00, 0xE9, 0xF1, 0x0B, 0x66,\r\n  0x33, 0xD2, 0x66, 0xB9, 0x80, 0x00, 0x00, 0x00, 0x66, 0xA1, 0x3E, 0x02,\r\n  0xE8, 0xCA, 0x08, 0x66, 0x0B, 0xC0, 0x0F, 0x84, 0xDA, 0x0B, 0x1E, 0x07,\r\n  0x66, 0x8B, 0x3E, 0x3E, 0x02, 0xE8, 0xDB, 0x05, 0x66, 0xA1, 0x3E, 0x02,\r\n  0x66, 0xBB, 0x80, 0x00, 0x00, 0x00, 0x66, 0xB9, 0x00, 0x00, 0x00, 0x00,\r\n  0x66, 0xBA, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x80, 0x00, 0x66, 0x0B, 0xC0,\r\n  0x0F, 0x84, 0xB0, 0x0B, 0x67, 0x66, 0x0F, 0xB7, 0x58, 0x0C, 0x66, 0x81,\r\n  0xE3, 0xFF, 0x00, 0x00, 0x00, 0x0F, 0x85, 0xA5, 0x0B, 0x66, 0x8B, 0xD8,\r\n  0x68, 0x00, 0x20, 0x07, 0x66, 0x2B, 0xFF, 0x66, 0xA1, 0x3E, 0x02, 0xE8,\r\n  0x00, 0x01, 0x68, 0x00, 0x20, 0x07, 0x66, 0x2B, 0xFF, 0x66, 0xA1, 0x3E,\r\n  0x02, 0xE8, 0xAC, 0x0A, 0x8A, 0x16, 0x0E, 0x00, 0xB8, 0xE8, 0x03, 0x8E,\r\n  0xC0, 0x8D, 0x36, 0x0B, 0x00, 0x2B, 0xC0, 0x68, 0x00, 0x20, 0x50, 0xCB,\r\n  0x06, 0x1E, 0x66, 0x60, 0x66, 0x8B, 0xDA, 0x66, 0x0F, 0xB6, 0x0E, 0x0D,\r\n  0x00, 0x66, 0xF7, 0xE1, 0x66, 0xA3, 0x11, 0x00, 0x66, 0x8B, 0xC3, 0x66,\r\n  0xF7, 0xE1, 0xA3, 0x16, 0x00, 0x8B, 0xDF, 0x83, 0xE3, 0x0F, 0x8C, 0xC0,\r\n  0x66, 0xC1, 0xEF, 0x04, 0x03, 0xC7, 0x50, 0x07, 0xE8, 0x3E, 0xFC, 0x66,\r\n  0x61, 0x90, 0x1F, 0x07, 0xC3, 0x67, 0x03, 0x40, 0x14, 0x67, 0x66, 0x83,\r\n  0x38, 0xFF, 0x0F, 0x84, 0x4C, 0x00, 0x67, 0x66, 0x39, 0x18, 0x0F, 0x85,\r\n  0x33, 0x00, 0x66, 0x0B, 0xC9, 0x0F, 0x85, 0x0A, 0x00, 0x67, 0x80, 0x78,\r\n  0x09, 0x00, 0x0F, 0x85, 0x23, 0x00, 0xC3, 0x67, 0x3A, 0x48, 0x09, 0x0F,\r\n  0x85, 0x1A, 0x00, 0x66, 0x8B, 0xF0, 0x67, 0x03, 0x70, 0x0A, 0xE8, 0x97,\r\n  0x06, 0x66, 0x51, 0x1E, 0x07, 0x66, 0x8B, 0xFA, 0xF3, 0xA7, 0x66, 0x59,\r\n  0x0F, 0x85, 0x01, 0x00, 0xC3, 0x67, 0x66, 0x83, 0x78, 0x04, 0x00, 0x0F,\r\n  0x84, 0x07, 0x00, 0x67, 0x66, 0x03, 0x40, 0x04, 0xEB, 0xAB, 0x66, 0x2B,\r\n  0xC0, 0xC3, 0x66, 0x8B, 0xF3, 0xE8, 0x6C, 0x06, 0x67, 0x66, 0x03, 0x00,\r\n  0x67, 0xF7, 0x40, 0x0C, 0x02, 0x00, 0x0F, 0x85, 0x34, 0x00, 0x67, 0x66,\r\n  0x8D, 0x50, 0x10, 0x67, 0x3A, 0x4A, 0x40, 0x0F, 0x85, 0x18, 0x00, 0x67,\r\n  0x66, 0x8D, 0x72, 0x42, 0xE8, 0x49, 0x06, 0x66, 0x51, 0x1E, 0x07, 0x66,\r\n  0x8B, 0xFB, 0xF3, 0xA7, 0x66, 0x59, 0x0F, 0x85, 0x01, 0x00, 0xC3, 0x67,\r\n  0x83, 0x78, 0x08, 0x00, 0x0F, 0x84, 0x06, 0x00, 0x67, 0x03, 0x40, 0x08,\r\n  0xEB, 0xC2, 0x66, 0x33, 0xC0, 0xC3, 0x67, 0x80, 0x7B, 0x08, 0x00, 0x0F,\r\n  0x85, 0x1C, 0x00, 0x06, 0x1E, 0x66, 0x60, 0x67, 0x66, 0x8D, 0x53, 0x10,\r\n  0x67, 0x66, 0x8B, 0x0A, 0x66, 0x8B, 0xF3, 0x67, 0x03, 0x72, 0x04, 0xF3,\r\n  0xA4, 0x66, 0x61, 0x90, 0x1F, 0x07, 0xC3, 0x66, 0x50, 0x67, 0x66, 0x8D,\r\n  0x53, 0x10, 0x66, 0x85, 0xC0, 0x0F, 0x85, 0x0A, 0x00, 0x67, 0x66, 0x8B,\r\n  0x4A, 0x08, 0x66, 0x41, 0xEB, 0x11, 0x90, 0x67, 0x66, 0x8B, 0x42, 0x18,\r\n  0x66, 0x33, 0xD2, 0x66, 0xF7, 0x36, 0x52, 0x02, 0x66, 0x8B, 0xC8, 0x66,\r\n  0x2B, 0xC0, 0x66, 0x5E, 0xE8, 0x01, 0x00, 0xC3, 0x06, 0x1E, 0x66, 0x60,\r\n  0x67, 0x80, 0x7B, 0x08, 0x01, 0x0F, 0x84, 0x03, 0x00, 0xE9, 0x76, 0xFB,\r\n  0x66, 0x83, 0xF9, 0x00, 0x0F, 0x85, 0x06, 0x00, 0x66, 0x61, 0x90, 0x1F,\r\n  0x07, 0xC3, 0x66, 0x53, 0x66, 0x50, 0x66, 0x51, 0x66, 0x56, 0x66, 0x57,\r\n  0x06, 0xE8, 0x91, 0x04, 0x66, 0x8B, 0xD1, 0x07, 0x66, 0x5F, 0x66, 0x5E,\r\n  0x66, 0x59, 0x66, 0x85, 0xC0, 0x0F, 0x84, 0x34, 0x00, 0x66, 0x3B, 0xCA,\r\n  0x0F, 0x8D, 0x03, 0x00, 0x66, 0x8B, 0xD1, 0xE8, 0x82, 0xFE, 0x66, 0x2B,\r\n  0xCA, 0x66, 0x8B, 0xDA, 0x66, 0x8B, 0xC2, 0x66, 0x0F, 0xB6, 0x16, 0x0D,\r\n  0x00, 0x66, 0xF7, 0xE2, 0x66, 0x0F, 0xB7, 0x16, 0x0B, 0x00, 0x66, 0xF7,\r\n  0xE2, 0x66, 0x03, 0xF8, 0x66, 0x58, 0x66, 0x03, 0xC3, 0x66, 0x5B, 0xEB,\r\n  0x9F, 0x66, 0x85, 0xF6, 0x0F, 0x84, 0x0E, 0xFB, 0x66, 0x51, 0x66, 0x57,\r\n  0x06, 0x67, 0x66, 0x0F, 0xB6, 0x43, 0x09, 0x66, 0x85, 0xC0, 0x0F, 0x84,\r\n  0x20, 0x00, 0x66, 0xD1, 0xE0, 0x66, 0x2B, 0xE0, 0x66, 0x8B, 0xFC, 0x66,\r\n  0x54, 0x66, 0x56, 0x67, 0x66, 0x0F, 0xB7, 0x73, 0x0A, 0x66, 0x03, 0xF3,\r\n  0x66, 0x8B, 0xC8, 0xF3, 0xA4, 0x66, 0x5E, 0xEB, 0x03, 0x90, 0x66, 0x50,\r\n  0x66, 0x50, 0x67, 0x66, 0x8B, 0x03, 0x66, 0x50, 0x67, 0x66, 0x8B, 0x43,\r\n  0x18, 0x66, 0x50, 0x67, 0x66, 0x8B, 0x56, 0x20, 0x66, 0x85, 0xD2, 0x0F,\r\n  0x84, 0x0B, 0x00, 0x66, 0x8B, 0xFE, 0x1E, 0x07, 0x66, 0x8B, 0xC2, 0xE8,\r\n  0x71, 0x03, 0x66, 0x8B, 0xC6, 0x66, 0x5A, 0x66, 0x59, 0x66, 0x42, 0x66,\r\n  0x51, 0x66, 0x56, 0xE8, 0x3F, 0x06, 0x66, 0x85, 0xC0, 0x0F, 0x84, 0x9D,\r\n  0xFA, 0x66, 0x5E, 0x66, 0x59, 0x66, 0x8B, 0xFE, 0x1E, 0x07, 0xE8, 0x4E,\r\n  0x03, 0x66, 0x8B, 0xC6, 0x66, 0x8B, 0xD9, 0x66, 0x59, 0x66, 0x5A, 0x66,\r\n  0x51, 0x66, 0x56, 0x66, 0xD1, 0xE9, 0xE8, 0xF8, 0xFD, 0x66, 0x85, 0xC0,\r\n  0x0F, 0x84, 0x76, 0xFA, 0x66, 0x5E, 0x66, 0x59, 0x66, 0x03, 0xE1, 0x07,\r\n  0x66, 0x5F, 0x66, 0x59, 0x66, 0x8B, 0xD0, 0x66, 0x58, 0x66, 0x5B, 0x66,\r\n  0x8B, 0xDA, 0xE9, 0xF5, 0xFE, 0x06, 0x1E, 0x66, 0x60, 0x26, 0x67, 0x66,\r\n  0x0F, 0xB7, 0x5F, 0x04, 0x26, 0x67, 0x66, 0x0F, 0xB7, 0x4F, 0x06, 0x66,\r\n  0x0B, 0xC9, 0x0F, 0x84, 0x44, 0xFA, 0x66, 0x03, 0xDF, 0x66, 0x83, 0xC3,\r\n  0x02, 0x66, 0x81, 0xC7, 0xFE, 0x01, 0x00, 0x00, 0x66, 0x49, 0x66, 0x0B,\r\n  0xC9, 0x0F, 0x84, 0x17, 0x00, 0x26, 0x67, 0x8B, 0x03, 0x26, 0x67, 0x89,\r\n  0x07, 0x66, 0x83, 0xC3, 0x02, 0x66, 0x81, 0xC7, 0x00, 0x02, 0x00, 0x00,\r\n  0x66, 0x49, 0xEB, 0xE2, 0x66, 0x61, 0x90, 0x1F, 0x07, 0xC3, 0x06, 0x1E,\r\n  0x66, 0x60, 0x66, 0xB8, 0x01, 0x00, 0x00, 0x00, 0x66, 0xA3, 0x22, 0x02,\r\n  0x66, 0xA1, 0x1E, 0x02, 0x66, 0x03, 0x06, 0x66, 0x02, 0x66, 0xA3, 0x6A,\r\n  0x02, 0x66, 0x03, 0x06, 0x66, 0x02, 0x66, 0xA3, 0x4E, 0x02, 0x66, 0xA1,\r\n  0x30, 0x00, 0x66, 0x0F, 0xB6, 0x1E, 0x0D, 0x00, 0x66, 0xF7, 0xE3, 0x66,\r\n  0x8B, 0x1E, 0x4E, 0x02, 0x66, 0x89, 0x07, 0x66, 0xA3, 0x11, 0x00, 0x83,\r\n  0xC3, 0x04, 0x66, 0xA1, 0x56, 0x02, 0x66, 0x89, 0x07, 0xA3, 0x16, 0x00,\r\n  0x83, 0xC3, 0x04, 0x66, 0x89, 0x1E, 0x4E, 0x02, 0x66, 0x8B, 0x1E, 0x1E,\r\n  0x02, 0x1E, 0x07, 0xE8, 0x67, 0xF9, 0x66, 0x8B, 0xFB, 0xE8, 0x51, 0xFF,\r\n  0x66, 0xA1, 0x1E, 0x02, 0x66, 0xBB, 0x20, 0x00, 0x00, 0x00, 0x66, 0xB9,\r\n  0x00, 0x00, 0x00, 0x00, 0x66, 0xBA, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x10,\r\n  0xFD, 0x66, 0x0B, 0xC0, 0x0F, 0x84, 0x19, 0x01, 0x66, 0x8B, 0xD8, 0x1E,\r\n  0x07, 0x66, 0x8B, 0x3E, 0x1A, 0x02, 0x66, 0x33, 0xC0, 0xE8, 0xA2, 0xFD,\r\n  0x66, 0x8B, 0x1E, 0x1A, 0x02, 0x66, 0x81, 0x3F, 0x80, 0x00, 0x00, 0x00,\r\n  0x0F, 0x84, 0xEB, 0x00, 0x03, 0x5F, 0x04, 0xEB, 0xF0, 0x66, 0x53, 0x66,\r\n  0x8B, 0x47, 0x10, 0x66, 0xF7, 0x26, 0x56, 0x02, 0x66, 0x50, 0x66, 0x33,\r\n  0xD2, 0x66, 0x0F, 0xB6, 0x1E, 0x0D, 0x00, 0x66, 0xF7, 0xF3, 0x66, 0x52,\r\n  0xE8, 0xDC, 0x00, 0x66, 0x0B, 0xC0, 0x0F, 0x84, 0x44, 0xF9, 0x66, 0x8B,\r\n  0x0E, 0x56, 0x02, 0x66, 0x0F, 0xB6, 0x1E, 0x0D, 0x00, 0x66, 0xF7, 0xE3,\r\n  0x66, 0x5A, 0x66, 0x03, 0xC2, 0x66, 0x8B, 0x1E, 0x4E, 0x02, 0x66, 0x89,\r\n  0x07, 0x83, 0xC3, 0x04, 0x66, 0x0F, 0xB6, 0x06, 0x0D, 0x00, 0x66, 0x2B,\r\n  0xC2, 0x66, 0x3B, 0xC1, 0x0F, 0x86, 0x03, 0x00, 0x66, 0x8B, 0xC1, 0x66,\r\n  0x89, 0x07, 0x66, 0x2B, 0xC8, 0x66, 0x5A, 0x0F, 0x84, 0x75, 0x00, 0x66,\r\n  0x03, 0xC2, 0x66, 0x50, 0x66, 0x33, 0xD2, 0x66, 0x0F, 0xB6, 0x1E, 0x0D,\r\n  0x00, 0x66, 0xF7, 0xF3, 0x66, 0x51, 0xE8, 0x82, 0x00, 0x66, 0x59, 0x66,\r\n  0x0B, 0xC0, 0x0F, 0x84, 0xE8, 0xF8, 0x66, 0x0F, 0xB6, 0x1E, 0x0D, 0x00,\r\n  0x66, 0xF7, 0xE3, 0x66, 0x8B, 0x1E, 0x4E, 0x02, 0x66, 0x8B, 0x17, 0x83,\r\n  0xC3, 0x04, 0x66, 0x03, 0x17, 0x66, 0x3B, 0xD0, 0x0F, 0x85, 0x15, 0x00,\r\n  0x66, 0x0F, 0xB6, 0x06, 0x0D, 0x00, 0x66, 0x3B, 0xC1, 0x0F, 0x86, 0x03,\r\n  0x00, 0x66, 0x8B, 0xC1, 0x66, 0x01, 0x07, 0xEB, 0xA5, 0x83, 0xC3, 0x04,\r\n  0x66, 0x89, 0x1E, 0x4E, 0x02, 0x66, 0x89, 0x07, 0x83, 0xC3, 0x04, 0x66,\r\n  0x0F, 0xB6, 0x06, 0x0D, 0x00, 0x66, 0x3B, 0xC1, 0x0F, 0x86, 0x03, 0x00,\r\n  0x66, 0x8B, 0xC1, 0x66, 0x89, 0x07, 0xEB, 0x82, 0x83, 0xC3, 0x04, 0x66,\r\n  0xFF, 0x06, 0x22, 0x02, 0x66, 0x89, 0x1E, 0x4E, 0x02, 0x66, 0x5B, 0x03,\r\n  0x5F, 0x04, 0x66, 0x81, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x0F, 0x84, 0x0C,\r\n  0xFF, 0x66, 0x61, 0x90, 0x1F, 0x07, 0xC3, 0x66, 0x8B, 0xD0, 0x66, 0x8B,\r\n  0x0E, 0x22, 0x02, 0x66, 0x8B, 0x36, 0x6A, 0x02, 0x66, 0x03, 0x36, 0x66,\r\n  0x02, 0x66, 0x52, 0x66, 0x51, 0x66, 0x52, 0x66, 0x8B, 0x1E, 0x6A, 0x02,\r\n  0x66, 0x8B, 0x3E, 0x56, 0x02, 0x66, 0x8B, 0x04, 0x66, 0xA3, 0x11, 0x00,\r\n  0x83, 0xC6, 0x04, 0x66, 0x8B, 0x04, 0xA3, 0x16, 0x00, 0x83, 0xC6, 0x04,\r\n  0x1E, 0x07, 0xE8, 0xE8, 0xF7, 0x66, 0x2B, 0xF8, 0x0F, 0x84, 0x08, 0x00,\r\n  0xF7, 0x26, 0x0B, 0x00, 0x03, 0xD8, 0xEB, 0xD9, 0x66, 0x8B, 0x3E, 0x6A,\r\n  0x02, 0x1E, 0x07, 0xE8, 0xBF, 0xFD, 0x66, 0xA1, 0x6A, 0x02, 0x66, 0xBB,\r\n  0x80, 0x00, 0x00, 0x00, 0x66, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x66, 0x8B,\r\n  0xD1, 0xE8, 0x81, 0xFB, 0x66, 0x0B, 0xC0, 0x0F, 0x84, 0xFF, 0xF7, 0x66,\r\n  0x8B, 0xD8, 0x66, 0x58, 0x66, 0x56, 0xE8, 0x2C, 0x01, 0x66, 0x5E, 0x66,\r\n  0x0B, 0xC0, 0x0F, 0x84, 0x05, 0x00, 0x66, 0x5B, 0x66, 0x5B, 0xC3, 0x66,\r\n  0x59, 0x66, 0x5A, 0xE2, 0x84, 0x66, 0x33, 0xC0, 0xC3, 0x06, 0x1E, 0x66,\r\n  0x60, 0x66, 0x50, 0x66, 0x51, 0x66, 0x33, 0xD2, 0x66, 0x0F, 0xB6, 0x1E,\r\n  0x0D, 0x00, 0x66, 0xF7, 0xF3, 0x66, 0x52, 0x66, 0x57, 0xE8, 0x53, 0xFF,\r\n  0x66, 0x5F, 0x66, 0x0B, 0xC0, 0x0F, 0x84, 0xB9, 0xF7, 0x66, 0x0F, 0xB6,\r\n  0x1E, 0x0D, 0x00, 0x66, 0xF7, 0xE3, 0x66, 0x5A, 0x66, 0x03, 0xC2, 0x66,\r\n  0xA3, 0x11, 0x00, 0x66, 0x59, 0x66, 0x0F, 0xB6, 0x1E, 0x0D, 0x00, 0x66,\r\n  0x3B, 0xCB, 0x0F, 0x8E, 0x13, 0x00, 0x89, 0x1E, 0x16, 0x00, 0x66, 0x2B,\r\n  0xCB, 0x66, 0x58, 0x66, 0x03, 0xC3, 0x66, 0x50, 0x66, 0x51, 0xEB, 0x14,\r\n  0x90, 0x66, 0x58, 0x66, 0x03, 0xC1, 0x66, 0x50, 0x89, 0x0E, 0x16, 0x00,\r\n  0x66, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x66, 0x51, 0x06, 0x66, 0x57, 0x8B,\r\n  0xDF, 0x83, 0xE3, 0x0F, 0x8C, 0xC0, 0x66, 0xC1, 0xEF, 0x04, 0x03, 0xC7,\r\n  0x50, 0x07, 0xE8, 0x10, 0xF7, 0x66, 0x5F, 0x07, 0x66, 0x03, 0x3E, 0x52,\r\n  0x02, 0x66, 0x59, 0x66, 0x58, 0x66, 0x83, 0xF9, 0x00, 0x0F, 0x8F, 0x70,\r\n  0xFF, 0x66, 0x61, 0x90, 0x1F, 0x07, 0xC3, 0x06, 0x1E, 0x66, 0x60, 0x66,\r\n  0xF7, 0x26, 0x56, 0x02, 0x66, 0x8B, 0x0E, 0x56, 0x02, 0xE8, 0x55, 0xFF,\r\n  0xE8, 0xD2, 0xFC, 0x66, 0x61, 0x90, 0x1F, 0x07, 0xC3, 0x06, 0x1E, 0x66,\r\n  0x60, 0x66, 0xF7, 0x26, 0x72, 0x02, 0x66, 0x8B, 0x1E, 0x36, 0x02, 0x66,\r\n  0x8B, 0x0E, 0x72, 0x02, 0x66, 0x8B, 0x36, 0x2A, 0x02, 0x1E, 0x07, 0x66,\r\n  0x8B, 0x3E, 0x46, 0x02, 0xE8, 0x81, 0xFB, 0xE8, 0xA7, 0xFC, 0x66, 0x61,\r\n  0x90, 0x1F, 0x07, 0xC3, 0x66, 0x50, 0x66, 0x53, 0x66, 0x51, 0x66, 0x8B,\r\n  0x1E, 0x4A, 0x02, 0x66, 0x8B, 0xC8, 0x66, 0xC1, 0xE8, 0x03, 0x66, 0x83,\r\n  0xE1, 0x07, 0x66, 0x03, 0xD8, 0x66, 0xB8, 0x01, 0x00, 0x00, 0x00, 0x66,\r\n  0xD3, 0xE0, 0x67, 0x84, 0x03, 0x0F, 0x84, 0x04, 0x00, 0xF8, 0xEB, 0x02,\r\n  0x90, 0xF9, 0x66, 0x59, 0x66, 0x5B, 0x66, 0x58, 0xC3, 0x67, 0x80, 0x7B,\r\n  0x08, 0x01, 0x0F, 0x84, 0x04, 0x00, 0x66, 0x2B, 0xC0, 0xC3, 0x67, 0x66,\r\n  0x8D, 0x73, 0x10, 0x67, 0x66, 0x8B, 0x56, 0x08, 0x66, 0x3B, 0xC2, 0x0F,\r\n  0x87, 0x0B, 0x00, 0x67, 0x66, 0x8B, 0x16, 0x66, 0x3B, 0xC2, 0x0F, 0x83,\r\n  0x04, 0x00, 0x66, 0x2B, 0xC0, 0xC3, 0x67, 0x03, 0x5E, 0x10, 0x66, 0x2B,\r\n  0xF6, 0x67, 0x80, 0x3B, 0x00, 0x0F, 0x84, 0x3E, 0x00, 0xE8, 0x81, 0x00,\r\n  0x66, 0x03, 0xF1, 0xE8, 0x39, 0x00, 0x66, 0x03, 0xCA, 0x66, 0x3B, 0xC1,\r\n  0x0F, 0x8C, 0x21, 0x00, 0x66, 0x8B, 0xD1, 0x66, 0x50, 0x67, 0x66, 0x0F,\r\n  0xB6, 0x0B, 0x66, 0x8B, 0xC1, 0x66, 0x83, 0xE0, 0x0F, 0x66, 0xC1, 0xE9,\r\n  0x04, 0x66, 0x03, 0xD9, 0x66, 0x03, 0xD8, 0x66, 0x43, 0x66, 0x58, 0xEB,\r\n  0xC4, 0x66, 0x2B, 0xC8, 0x66, 0x2B, 0xC2, 0x66, 0x03, 0xC6, 0xC3, 0x66,\r\n  0x2B, 0xC0, 0xC3, 0x66, 0x2B, 0xC9, 0x67, 0x8A, 0x0B, 0x80, 0xE1, 0x0F,\r\n  0x66, 0x83, 0xF9, 0x00, 0x0F, 0x85, 0x04, 0x00, 0x66, 0x2B, 0xC9, 0xC3,\r\n  0x66, 0x53, 0x66, 0x52, 0x66, 0x03, 0xD9, 0x67, 0x66, 0x0F, 0xBE, 0x13,\r\n  0x66, 0x49, 0x66, 0x4B, 0x66, 0x83, 0xF9, 0x00, 0x0F, 0x84, 0x0D, 0x00,\r\n  0x66, 0xC1, 0xE2, 0x08, 0x67, 0x8A, 0x13, 0x66, 0x4B, 0x66, 0x49, 0xEB,\r\n  0xEB, 0x66, 0x8B, 0xCA, 0x66, 0x5A, 0x66, 0x5B, 0xC3, 0x66, 0x53, 0x66,\r\n  0x52, 0x66, 0x2B, 0xD2, 0x67, 0x8A, 0x13, 0x66, 0x83, 0xE2, 0x0F, 0x66,\r\n  0x2B, 0xC9, 0x67, 0x8A, 0x0B, 0xC0, 0xE9, 0x04, 0x66, 0x83, 0xF9, 0x00,\r\n  0x0F, 0x85, 0x08, 0x00, 0x66, 0x2B, 0xC9, 0x66, 0x5A, 0x66, 0x5B, 0xC3,\r\n  0x66, 0x03, 0xDA, 0x66, 0x03, 0xD9, 0x67, 0x66, 0x0F, 0xBE, 0x13, 0x66,\r\n  0x49, 0x66, 0x4B, 0x66, 0x83, 0xF9, 0x00, 0x0F, 0x84, 0x0D, 0x00, 0x66,\r\n  0xC1, 0xE2, 0x08, 0x67, 0x8A, 0x13, 0x66, 0x4B, 0x66, 0x49, 0xEB, 0xEB,\r\n  0x66, 0x8B, 0xCA, 0x66, 0x5A, 0x66, 0x5B, 0xC3, 0x66, 0x0B, 0xC9, 0x0F,\r\n  0x85, 0x01, 0x00, 0xC3, 0x66, 0x51, 0x66, 0x56, 0x67, 0x83, 0x3E, 0x61,\r\n  0x0F, 0x8C, 0x0C, 0x00, 0x67, 0x83, 0x3E, 0x7A, 0x0F, 0x8F, 0x04, 0x00,\r\n  0x67, 0x83, 0x2E, 0x20, 0x66, 0x83, 0xC6, 0x02, 0xE2, 0xE6, 0x66, 0x5E,\r\n  0x66, 0x59, 0xC3, 0x66, 0x50, 0x66, 0x51, 0x66, 0x8B, 0xD0, 0x66, 0xA1,\r\n  0x32, 0x02, 0x67, 0x66, 0x8D, 0x58, 0x10, 0x67, 0x03, 0x43, 0x04, 0x67,\r\n  0x66, 0x8D, 0x40, 0x10, 0x66, 0x8B, 0xDA, 0xE8, 0x44, 0xF9, 0x66, 0x0B,\r\n  0xC0, 0x0F, 0x84, 0x05, 0x00, 0x66, 0x59, 0x66, 0x59, 0xC3, 0x66, 0xA1,\r\n  0x36, 0x02, 0x66, 0x0B, 0xC0, 0x0F, 0x85, 0x08, 0x00, 0x66, 0x59, 0x66,\r\n  0x59, 0x66, 0x33, 0xC0, 0xC3, 0x66, 0x8B, 0x16, 0x36, 0x02, 0x67, 0x66,\r\n  0x8D, 0x52, 0x10, 0x67, 0x66, 0x8B, 0x42, 0x18, 0x66, 0x33, 0xD2, 0x66,\r\n  0xF7, 0x36, 0x6E, 0x02, 0x66, 0x33, 0xF6, 0x66, 0x50, 0x66, 0x56, 0x66,\r\n  0x58, 0x66, 0x5E, 0x66, 0x3B, 0xC6, 0x0F, 0x84, 0x3A, 0x00, 0x66, 0x56,\r\n  0x66, 0x40, 0x66, 0x50, 0x66, 0x48, 0xE8, 0x1B, 0xFE, 0x72, 0xE8, 0xE8,\r\n  0xEB, 0xFD, 0x66, 0x5A, 0x66, 0x5E, 0x66, 0x59, 0x66, 0x5B, 0x66, 0x53,\r\n  0x66, 0x51, 0x66, 0x56, 0x66, 0x52, 0x66, 0xA1, 0x46, 0x02, 0x67, 0x66,\r\n  0x8D, 0x40, 0x18, 0xE8, 0xD0, 0xF8, 0x66, 0x0B, 0xC0, 0x74, 0xC4, 0x66,\r\n  0x59, 0x66, 0x59, 0x66, 0x59, 0x66, 0x59, 0xC3, 0x66, 0x59, 0x66, 0x59,\r\n  0x66, 0x33, 0xC0, 0xC3, 0x66, 0x51, 0x66, 0x50, 0x66, 0xB8, 0x05, 0x00,\r\n  0x00, 0x00, 0x1E, 0x07, 0x66, 0x8B, 0xF9, 0xE8, 0x8D, 0xFD, 0x66, 0x8B,\r\n  0xC1, 0x66, 0xBB, 0x20, 0x00, 0x00, 0x00, 0x66, 0xB9, 0x00, 0x00, 0x00,\r\n  0x00, 0x66, 0xBA, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x33, 0xF8, 0x66, 0x5B,\r\n  0x66, 0x59, 0x66, 0x85, 0xC0, 0x0F, 0x85, 0x15, 0x00, 0x66, 0x8B, 0xC1,\r\n  0x66, 0x0F, 0xB7, 0x0E, 0x10, 0x02, 0x66, 0xBA, 0x12, 0x02, 0x00, 0x00,\r\n  0xE8, 0x16, 0xF8, 0xEB, 0x33, 0x90, 0x66, 0x33, 0xD2, 0x66, 0x8B, 0xC1,\r\n  0x66, 0x8B, 0xCB, 0x66, 0x50, 0x66, 0x53, 0xE8, 0x23, 0x00, 0x66, 0x5B,\r\n  0x66, 0x5F, 0x66, 0x0B, 0xC0, 0x0F, 0x84, 0x17, 0x00, 0x1E, 0x07, 0xE8,\r\n  0x35, 0xFD, 0x66, 0x8B, 0xC7, 0x66, 0x0F, 0xB7, 0x0E, 0x10, 0x02, 0x66,\r\n  0xBA, 0x12, 0x02, 0x00, 0x00, 0xE8, 0xE1, 0xF7, 0xC3, 0x66, 0x52, 0x66,\r\n  0x51, 0x66, 0xBB, 0x20, 0x00, 0x00, 0x00, 0x66, 0xB9, 0x00, 0x00, 0x00,\r\n  0x00, 0x66, 0xBA, 0x00, 0x00, 0x00, 0x00, 0xE8, 0xC7, 0xF7, 0x66, 0x0B,\r\n  0xC0, 0x0F, 0x84, 0x63, 0x00, 0x66, 0x8B, 0xD8, 0x1E, 0x07, 0x66, 0x8B,\r\n  0x3E, 0x1A, 0x02, 0x66, 0x33, 0xC0, 0xE8, 0x59, 0xF8, 0x1E, 0x07, 0x66,\r\n  0x8B, 0x1E, 0x1A, 0x02, 0x66, 0x59, 0x66, 0x5A, 0x26, 0x66, 0x39, 0x0F,\r\n  0x0F, 0x85, 0x0C, 0x00, 0x26, 0x66, 0x39, 0x57, 0x08, 0x0F, 0x84, 0x31,\r\n  0x00, 0xEB, 0x13, 0x90, 0x26, 0x66, 0x83, 0x3F, 0xFF, 0x0F, 0x84, 0x2F,\r\n  0x00, 0x26, 0x83, 0x7F, 0x04, 0x00, 0x0F, 0x84, 0x26, 0x00, 0x26, 0x66,\r\n  0x0F, 0xB7, 0x47, 0x04, 0x03, 0xD8, 0x8B, 0xC3, 0x25, 0x00, 0x80, 0x74,\r\n  0xCB, 0x8C, 0xC0, 0x05, 0x00, 0x08, 0x8E, 0xC0, 0x81, 0xE3, 0xFF, 0x7F,\r\n  0xEB, 0xBE, 0x26, 0x66, 0x8B, 0x47, 0x10, 0xC3, 0x66, 0x59, 0x66, 0x5A,\r\n  0x66, 0x33, 0xC0, 0xC3, 0x66, 0x50, 0x66, 0x51, 0x66, 0x8B, 0xC7, 0x66,\r\n  0xC1, 0xE8, 0x04, 0x06, 0x59, 0x03, 0xC8, 0x51, 0x07, 0x66, 0x83, 0xE7,\r\n  0x0F, 0x66, 0x59, 0x66, 0x58, 0xC3, 0x60, 0x06, 0xBE, 0xBD, 0x0D, 0xBF,\r\n  0x00, 0x20, 0x1E, 0x07, 0xB9, 0x0D, 0x00, 0x90, 0xF3, 0xA5, 0x07, 0x61,\r\n  0xC3, 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA,\r\n  0x98, 0x76, 0x54, 0x32, 0x10, 0xF0, 0xE1, 0xD2, 0xC3, 0x00, 0x00, 0x00,\r\n  0x00, 0x20, 0x20, 0x60, 0x8B, 0x36, 0x18, 0x20, 0x26, 0x8A, 0x05, 0x88,\r\n  0x04, 0x47, 0x46, 0x66, 0xFF, 0x06, 0x14, 0x20, 0x81, 0xFE, 0x60, 0x20,\r\n  0x75, 0x06, 0xE8, 0x5B, 0x00, 0xBE, 0x20, 0x20, 0xE2, 0xE6, 0x89, 0x36,\r\n  0x18, 0x20, 0x61, 0xC3, 0x66, 0x60, 0x8B, 0x36, 0x18, 0x20, 0xB0, 0x80,\r\n  0x88, 0x04, 0x46, 0x32, 0xC0, 0x81, 0xFE, 0x60, 0x20, 0x75, 0x06, 0xE8,\r\n  0x3A, 0x00, 0xBE, 0x20, 0x20, 0x81, 0xFE, 0x58, 0x20, 0x75, 0xE9, 0x66,\r\n  0x33, 0xC0, 0x66, 0xA3, 0x58, 0x20, 0x66, 0xA1, 0x14, 0x20, 0x66, 0xC1,\r\n  0xE0, 0x03, 0x66, 0x0F, 0xC8, 0x66, 0xA3, 0x5C, 0x20, 0xE8, 0x18, 0x00,\r\n  0xBB, 0x00, 0x20, 0x66, 0x8B, 0x07, 0x66, 0x0F, 0xC8, 0x66, 0x89, 0x07,\r\n  0x83, 0xC3, 0x04, 0x81, 0xFB, 0x34, 0x20, 0x75, 0xEE, 0x66, 0x61, 0xC3,\r\n  0x66, 0x60, 0xBB, 0x20, 0x20, 0x66, 0x8B, 0x07, 0x66, 0x0F, 0xC8, 0x66,\r\n  0x89, 0x07, 0x83, 0xC3, 0x04, 0x81, 0xFB, 0x60, 0x20, 0x75, 0xEE, 0xBB,\r\n  0x00, 0x20, 0x66, 0x8B, 0x0F, 0x66, 0x8B, 0x57, 0x04, 0x66, 0x8B, 0x77,\r\n  0x08, 0x66, 0x8B, 0x7F, 0x0C, 0x66, 0x8B, 0x6F, 0x10, 0xBB, 0x20, 0x20,\r\n  0xC7, 0x06, 0x1A, 0x20, 0x30, 0x0F, 0xC6, 0x06, 0x1C, 0x20, 0x14, 0x90,\r\n  0x53, 0x8B, 0x1E, 0x1A, 0x20, 0xFF, 0x17, 0x66, 0x03, 0x47, 0x02, 0x5B,\r\n  0x66, 0x03, 0xE8, 0x66, 0x03, 0x2F, 0x66, 0x8B, 0xC1, 0x66, 0xC1, 0xC0,\r\n  0x05, 0x66, 0x03, 0xC5, 0x66, 0x8B, 0xEF, 0x66, 0x8B, 0xFE, 0x66, 0x8B,\r\n  0xF2, 0x66, 0xC1, 0xC6, 0x1E, 0x66, 0x8B, 0xD1, 0x66, 0x8B, 0xC8, 0x66,\r\n  0x8B, 0x07, 0x66, 0x33, 0x47, 0x08, 0x66, 0x33, 0x47, 0x20, 0x66, 0x33,\r\n  0x47, 0x34, 0x66, 0xD1, 0xC0, 0x66, 0x89, 0x47, 0x40, 0x83, 0xC3, 0x04,\r\n  0xFE, 0x0E, 0x1C, 0x20, 0x75, 0xB2, 0x83, 0x06, 0x1A, 0x20, 0x06, 0x81,\r\n  0x3E, 0x1A, 0x20, 0x48, 0x0F, 0x75, 0x9F, 0xBB, 0x00, 0x20, 0x66, 0x01,\r\n  0x0F, 0x66, 0x01, 0x57, 0x04, 0x66, 0x01, 0x77, 0x08, 0x66, 0x01, 0x7F,\r\n  0x0C, 0x66, 0x01, 0x6F, 0x10, 0x66, 0x61, 0xC3, 0x66, 0x8B, 0xC6, 0x66,\r\n  0x33, 0xC7, 0x66, 0x23, 0xC2, 0x66, 0x33, 0xC7, 0xC3, 0x66, 0x8B, 0xC2,\r\n  0x66, 0x33, 0xC6, 0x66, 0x33, 0xC7, 0xC3, 0x66, 0x53, 0x66, 0x8B, 0xC2,\r\n  0x66, 0x23, 0xC6, 0x66, 0x8B, 0xDA, 0x66, 0x23, 0xDF, 0x66, 0x0B, 0xC3,\r\n  0x66, 0x8B, 0xDE, 0x66, 0x23, 0xDF, 0x66, 0x0B, 0xC3, 0x66, 0x5B, 0xC3,\r\n  0xFC, 0x0E, 0x99, 0x79, 0x82, 0x5A, 0x09, 0x0F, 0xA1, 0xEB, 0xD9, 0x6E,\r\n  0x13, 0x0F, 0xDC, 0xBC, 0x1B, 0x8F, 0x09, 0x0F, 0xD6, 0xC1, 0x62, 0xCA,\r\n  0x06, 0x1E, 0x66, 0x60, 0x66, 0x33, 0xDB, 0xB8, 0x00, 0xBB, 0xCD, 0x1A,\r\n  0x66, 0x23, 0xC0, 0x0F, 0x85, 0xBB, 0x00, 0x66, 0x81, 0xFB, 0x54, 0x43,\r\n  0x50, 0x41, 0x0F, 0x85, 0xB0, 0x00, 0x81, 0xF9, 0x02, 0x01, 0x0F, 0x82,\r\n  0xA8, 0x00, 0x66, 0x61, 0x90, 0x1F, 0x07, 0x06, 0x1E, 0x66, 0x60, 0x67,\r\n  0x80, 0x7B, 0x08, 0x00, 0x0F, 0x85, 0x0C, 0x00, 0x67, 0x66, 0x8D, 0x53,\r\n  0x10, 0x67, 0x66, 0x8B, 0x0A, 0xEB, 0x25, 0x90, 0x67, 0x66, 0x8D, 0x53,\r\n  0x10, 0x67, 0x66, 0x8B, 0x4A, 0x28, 0x66, 0x81, 0xF9, 0x00, 0x00, 0x08,\r\n  0x00, 0x0F, 0x83, 0x0C, 0x00, 0x67, 0x66, 0x8B, 0x42, 0x2C, 0x66, 0x23,\r\n  0xC0, 0x0F, 0x84, 0x03, 0x00, 0x66, 0x33, 0xC9, 0x0E, 0x1F, 0xE8, 0xF5,\r\n  0xFD, 0x66, 0x23, 0xC9, 0x0F, 0x84, 0x32, 0x00, 0x66, 0xBA, 0x00, 0x80,\r\n  0x00, 0x00, 0x66, 0x3B, 0xCA, 0x0F, 0x86, 0x1F, 0x00, 0x66, 0x2B, 0xCA,\r\n  0x06, 0x66, 0x51, 0x66, 0x57, 0x66, 0x52, 0x66, 0x8B, 0xCA, 0xE8, 0xB7,\r\n  0xFD, 0xE8, 0xFB, 0xFD, 0x66, 0x5A, 0x66, 0x5F, 0x66, 0x59, 0x07, 0x66,\r\n  0x03, 0xFA, 0xEB, 0xDA, 0xE8, 0xA5, 0xFD, 0xE8, 0xE9, 0xFD, 0xE8, 0x0B,\r\n  0xFE, 0x0E, 0x07, 0x66, 0xBB, 0x54, 0x43, 0x50, 0x41, 0x66, 0xBF, 0x00,\r\n  0x20, 0x00, 0x00, 0x66, 0xB9, 0x14, 0x00, 0x00, 0x00, 0x66, 0xB8, 0x07,\r\n  0xBB, 0x00, 0x00, 0x66, 0xBA, 0x0A, 0x00, 0x00, 0x00, 0x66, 0x33, 0xF6,\r\n  0xCD, 0x1A, 0x66, 0x61, 0x90, 0x1F, 0x07, 0xC3, 0xA0, 0xF9, 0x01, 0xE9,\r\n  0x4B, 0xF1, 0xA0, 0xFA, 0x01, 0xE9, 0x45, 0xF1\r\n};\r\n"
  },
  {
    "path": "src/ms-sys/inc/fat12.h",
    "content": "#ifndef FAT12_H\n#define FAT12_H\n\n/* returns TRUE if the file has a FAT12 file system, otherwise FALSE.\n   The file position will change when this function is called! */\nint is_fat_12_fs(FILE *fp);\n\n/* returns TRUE if the file has an exact match ot the FAT12 boot record this\n   program would create, otherwise FALSE.\n   The file position will change when this function is called! */\nint entire_fat_12_br_matches(FILE *fp);\n\n/* Writes a FAT12 boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_fat_12_br(FILE *fp, int bKeepLabel);\n\n\n#endif\n"
  },
  {
    "path": "src/ms-sys/inc/fat16.h",
    "content": "#ifndef FAT16_H\n#define FAT16_H\n\n#include <stdio.h>\n\n/* returns TRUE if the file has a FAT16 file system, otherwise FALSE.\n   The file position will change when this function is called! */\nint is_fat_16_fs(FILE *fp);\n\n/* returns TRUE if the file has a FAT16 boot record, otherwise FALSE.\n   The file position will change when this function is called! */\nint is_fat_16_br(FILE *fp);\n\n/* returns TRUE if the file has an exact match of the FAT16 boot record this\n   program would create, otherwise FALSE.\n   The file position will change when this function is called! */\nint entire_fat_16_br_matches(FILE *fp);\n\n/* Writes a FAT16 boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_fat_16_br(FILE *fp, int bKeepLabel);\n\n/* returns TRUE if the file has an exact match of the FAT16 boot record this\n   program would create for FreeDOS, otherwise FALSE.\n   The file position will change when this function is called! */\nint entire_fat_16_fd_br_matches(FILE *fp);\n\n/* Writes a FAT16 FreeDOS boot record to a file, returns TRUE on success,\n   otherwise FALSE */\nint write_fat_16_fd_br(FILE *fp, int bKeepLabel);\n\n/* returns TRUE if the file has an exact match of the FAT16 boot record this\n   program would create for ReactOS, otherwise FALSE.\n   The file position will change when this function is called! */\nint entire_fat_16_ros_br_matches(FILE *fp);\n\n/* Writes a FAT16 ReactOS boot record to a file, returns TRUE on success,\n   otherwise FALSE */\nint write_fat_16_ros_br(FILE *fp, int bKeepLabel);\n\n#endif\n"
  },
  {
    "path": "src/ms-sys/inc/fat32.h",
    "content": "#ifndef FAT32_H\n#define FAT32_H\n\n#include <stdio.h>\n\n/* returns TRUE if the file has a FAT32 file system, otherwise FALSE.\n   The file position will change when this function is called! */\nint is_fat_32_fs(FILE *fp);\n\n/* returns TRUE if the file has a FAT32 DOS boot record, otherwise FALSE.\n   The file position will change when this function is called! */\nint is_fat_32_br(FILE *fp);\n\n/* returns TRUE if the file has an exact match of the FAT32 DOS boot record\n   this program would create, otherwise FALSE.\n   The file position will change when this function is called! */\nint entire_fat_32_br_matches(FILE *fp);\n\n/* Writes a FAT32 DOS boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_fat_32_br(FILE *fp, int bKeepLabel);\n\n/* returns TRUE if the file has an exact match of the FAT32 boot record this\n   program would create for FreeDOS, otherwise FALSE.\n   The file position will change when this function is called! */\nint entire_fat_32_fd_br_matches(FILE *fp);\n\n/* Writes a FAT32 FreeDOS boot record to a file, returns TRUE on success,\n   otherwise FALSE */\nint write_fat_32_fd_br(FILE *fp, int bKeepLabel);\n\n/* returns TRUE if the file has an exact match of the FAT32 boot record this\n   program would create for NT, otherwise FALSE.\n   The file position will change when this function is called! */\nint entire_fat_32_nt_br_matches(FILE *fp);\n\n/* Writes a FAT32 NT boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_fat_32_nt_br(FILE *fp, int bKeepLabel);\n\n/* returns TRUE if the file has an exact match of the FAT32 boot record this\n   program would create for NT, otherwise FALSE.\n   The file position will change when this function is called! */\nint entire_fat_32_pe_br_matches(FILE *fp);\n\n/* Writes a FAT32 NT boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_fat_32_pe_br(FILE *fp, int bKeepLabel);\n\n/* returns TRUE if the file has an exact match of the FAT32 boot record this\n   program would create for ReactOS, otherwise FALSE.\n   The file position will change when this function is called! */\nint entire_fat_32_ros_br_matches(FILE *fp);\n\n/* Writes a FAT32 ReactOS boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_fat_32_ros_br(FILE *fp, int bKeepLabel);\n\n/* returns TRUE if the file has an exact match of the FAT32 boot record this\n   program would create for KolibriOS, otherwise FALSE.\n   The file position will change when this function is called! */\nint entire_fat_32_kos_br_matches(FILE *fp);\n\n/* Writes a FAT32 KolibriOS boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_fat_32_kos_br(FILE *fp, int bKeepLabel);\n\n#endif\n"
  },
  {
    "path": "src/ms-sys/inc/file.h",
    "content": "#ifndef FILE_H\n#define FILE_H\n\n#include <stdint.h>\n\n/* Max valid value of uiLen for contains_data */\n#define MAX_DATA_LEN 65536\n\n/* We hijack the FILE structure for our own needs */\ntypedef struct {\n\tvoid *_handle;\n\tuint64_t _offset;\n} FAKE_FD;\n\n/* Checks if a file contains a data pattern of length Len at position\n   Position. The file pointer will change when calling this function! */\nint contains_data(FILE *fp, uint64_t Position,\n                  const void *pData, uint64_t Len);\n\n/* Reads data of length Len at position Position.\nThe file pointer will change when calling this function! */\nint read_data(FILE *fp, uint64_t Position,\n              void *pData, uint64_t uiLen);\n\n/* Writes a data pattern of length Len at position Position.\n   The file pointer will change when calling this function! */\nint write_data(FILE *fp, uint64_t Position,\n               const void *pData, uint64_t Len);\n\n/* Writes nSectors of size SectorSize starting at sector StartSector */\nint64_t write_sectors(void *hDrive, uint64_t SectorSize,\n                      uint64_t StartSector, uint64_t nSectors,\n                      const void *pBuf);\n\n/* Reads nSectors of size SectorSize starting at sector StartSector */\nint64_t read_sectors(void *hDrive, uint64_t SectorSize,\n                     uint64_t StartSector, uint64_t nSectors,\n                     void *pBuf);\n\n#endif\n"
  },
  {
    "path": "src/ms-sys/inc/label_11_char.h",
    "content": "unsigned char label_11_char[] = {'N','O',' ','N','A','M','E',' ',' ',' ',' '};\n"
  },
  {
    "path": "src/ms-sys/inc/libintl.h",
    "content": "#ifndef LIBINTL_H\n#define LIBINTL_H\n\n/* This file is only supposed to be used on systems which doesn't have a\n   builtin libintl.h and which also miss gnu gettext */\n\n#define NO_LIBINTL_OR_GETTEXT\n\n#endif\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_2000.h",
    "content": "/* First 446 bytes of MBR from Windows 2000, XP and 2003 */\n/* This is English version. Bytes 0x12c onwards vary with language. */\n/* Last three bytes 1b5-1b7 point to language-specific messages.    */\n/* Support of other languages is an exercise for the reader!        */\n/* see: http://thestarman.pcministry.com/asm/mbr/Win2kmbr.htm       */\n#define MBR_2000_LANG_INDEP_LEN 0x12c\nunsigned char mbr_2000_0x0[] = {\n  0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0xfb, 0x50, 0x07, 0x50, 0x1f,\n  0xfc, 0xbe, 0x1b, 0x7c, 0xbf, 0x1b, 0x06, 0x50, 0x57, 0xb9, 0xe5, 0x01,\n  0xf3, 0xa4, 0xcb, 0xbd, 0xbe, 0x07, 0xb1, 0x04, 0x38, 0x6e, 0x00, 0x7c,\n  0x09, 0x75, 0x13, 0x83, 0xc5, 0x10, 0xe2, 0xf4, 0xcd, 0x18, 0x8b, 0xf5,\n  0x83, 0xc6, 0x10, 0x49, 0x74, 0x19, 0x38, 0x2c, 0x74, 0xf6, 0xa0, 0xb5,\n  0x07, 0xb4, 0x07, 0x8b, 0xf0, 0xac, 0x3c, 0x00, 0x74, 0xfc, 0xbb, 0x07,\n  0x00, 0xb4, 0x0e, 0xcd, 0x10, 0xeb, 0xf2, 0x88, 0x4e, 0x10, 0xe8, 0x46,\n  0x00, 0x73, 0x2a, 0xfe, 0x46, 0x10, 0x80, 0x7e, 0x04, 0x0b, 0x74, 0x0b,\n  0x80, 0x7e, 0x04, 0x0c, 0x74, 0x05, 0xa0, 0xb6, 0x07, 0x75, 0xd2, 0x80,\n  0x46, 0x02, 0x06, 0x83, 0x46, 0x08, 0x06, 0x83, 0x56, 0x0a, 0x00, 0xe8,\n  0x21, 0x00, 0x73, 0x05, 0xa0, 0xb6, 0x07, 0xeb, 0xbc, 0x81, 0x3e, 0xfe,\n  0x7d, 0x55, 0xaa, 0x74, 0x0b, 0x80, 0x7e, 0x10, 0x00, 0x74, 0xc8, 0xa0,\n  0xb7, 0x07, 0xeb, 0xa9, 0x8b, 0xfc, 0x1e, 0x57, 0x8b, 0xf5, 0xcb, 0xbf,\n  0x05, 0x00, 0x8a, 0x56, 0x00, 0xb4, 0x08, 0xcd, 0x13, 0x72, 0x23, 0x8a,\n  0xc1, 0x24, 0x3f, 0x98, 0x8a, 0xde, 0x8a, 0xfc, 0x43, 0xf7, 0xe3, 0x8b,\n  0xd1, 0x86, 0xd6, 0xb1, 0x06, 0xd2, 0xee, 0x42, 0xf7, 0xe2, 0x39, 0x56,\n  0x0a, 0x77, 0x23, 0x72, 0x05, 0x39, 0x46, 0x08, 0x73, 0x1c, 0xb8, 0x01,\n  0x02, 0xbb, 0x00, 0x7c, 0x8b, 0x4e, 0x02, 0x8b, 0x56, 0x00, 0xcd, 0x13,\n  0x73, 0x51, 0x4f, 0x74, 0x4e, 0x32, 0xe4, 0x8a, 0x56, 0x00, 0xcd, 0x13,\n  0xeb, 0xe4, 0x8a, 0x56, 0x00, 0x60, 0xbb, 0xaa, 0x55, 0xb4, 0x41, 0xcd,\n  0x13, 0x72, 0x36, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x30, 0xf6, 0xc1, 0x01,\n  0x74, 0x2b, 0x61, 0x60, 0x6a, 0x00, 0x6a, 0x00, 0xff, 0x76, 0x0a, 0xff,\n  0x76, 0x08, 0x6a, 0x00, 0x68, 0x00, 0x7c, 0x6a, 0x01, 0x6a, 0x10, 0xb4,\n  0x42, 0x8b, 0xf4, 0xcd, 0x13, 0x61, 0x61, 0x73, 0x0e, 0x4f, 0x74, 0x0b,\n  0x32, 0xe4, 0x8a, 0x56, 0x00, 0xcd, 0x13, 0xeb, 0xd6, 0x61, 0xf9, 0xc3,\n  0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74,\n  0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x00,\n  0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e,\n  0x67, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20,\n  0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69,\n  0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67,\n  0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x44, 0x63\n};\n/* Next four bytes used for Windows Disk Signature / Drive serial number */\n/*\nunsigned char mbr_2000_0x1b8[] = {\n                                                  0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00\n};\n*/\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_95b.h",
    "content": "/* First 446 bytes of MBR from Windows 95B, 98, 98SE and ME */\nunsigned char mbr_95b_0x0[] = {\n  0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0xfb, 0x50, 0x07, 0x50, 0x1f,\n  0xfc, 0xbe, 0x1b, 0x7c, 0xbf, 0x1b, 0x06, 0x50, 0x57, 0xb9, 0xe5, 0x01,\n  0xf3, 0xa4, 0xcb, 0xbe, 0xbe, 0x07, 0xb1, 0x04, 0x38, 0x2c, 0x7c, 0x09,\n  0x75, 0x15, 0x83, 0xc6, 0x10, 0xe2, 0xf5, 0xcd, 0x18, 0x8b, 0x14, 0x8b,\n  0xee, 0x83, 0xc6, 0x10, 0x49, 0x74, 0x16, 0x38, 0x2c, 0x74, 0xf6, 0xbe,\n  0x10, 0x07, 0x4e, 0xac, 0x3c, 0x00, 0x74, 0xfa, 0xbb, 0x07, 0x00, 0xb4,\n  0x0e, 0xcd, 0x10, 0xeb, 0xf2, 0x89, 0x46, 0x25, 0x96, 0x8a, 0x46, 0x04,\n  0xb4, 0x06, 0x3c, 0x0e, 0x74, 0x11, 0xb4, 0x0b, 0x3c, 0x0c, 0x74, 0x05,\n  0x3a, 0xc4, 0x75, 0x2b, 0x40, 0xc6, 0x46, 0x25, 0x06, 0x75, 0x24, 0xbb,\n  0xaa, 0x55, 0x50, 0xb4, 0x41, 0xcd, 0x13, 0x58, 0x72, 0x16, 0x81, 0xfb,\n  0x55, 0xaa, 0x75, 0x10, 0xf6, 0xc1, 0x01, 0x74, 0x0b, 0x8a, 0xe0, 0x88,\n  0x56, 0x24, 0xc7, 0x06, 0xa1, 0x06, 0xeb, 0x1e, 0x88, 0x66, 0x04, 0xbf,\n  0x0a, 0x00, 0xb8, 0x01, 0x02, 0x8b, 0xdc, 0x33, 0xc9, 0x83, 0xff, 0x05,\n  0x7f, 0x03, 0x8b, 0x4e, 0x25, 0x03, 0x4e, 0x02, 0xcd, 0x13, 0x72, 0x29,\n  0xbe, 0x46, 0x07, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x74, 0x5a, 0x83,\n  0xef, 0x05, 0x7f, 0xda, 0x85, 0xf6, 0x75, 0x83, 0xbe, 0x27, 0x07, 0xeb,\n  0x8a, 0x98, 0x91, 0x52, 0x99, 0x03, 0x46, 0x08, 0x13, 0x56, 0x0a, 0xe8,\n  0x12, 0x00, 0x5a, 0xeb, 0xd5, 0x4f, 0x74, 0xe4, 0x33, 0xc0, 0xcd, 0x13,\n  0xeb, 0xb8\n};\n/* Next 6 bytes used to write boot drive and time by some Windows OSs */\n/*\nunsigned char mbr_95b_0x0da[] = {\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\n*/\nunsigned char mbr_95b_0x0e0[] = {\n                                                  0x56, 0x33, 0xf6, 0x56,\n  0x56, 0x52, 0x50, 0x06, 0x53, 0x51, 0xbe, 0x10, 0x00, 0x56, 0x8b, 0xf4,\n  0x50, 0x52, 0xb8, 0x00, 0x42, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x5a, 0x58,\n  0x8d, 0x64, 0x10, 0x72, 0x0a, 0x40, 0x75, 0x01, 0x42, 0x80, 0xc7, 0x02,\n  0xe2, 0xf7, 0xf8, 0x5e, 0xc3, 0xeb, 0x74, 0x49, 0x6e, 0x76, 0x61, 0x6c,\n  0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n  0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72,\n  0x20, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65,\n  0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65,\n  0x6d, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70,\n  0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74,\n  0x65, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x8b, 0xfc, 0x1e, 0x57, 0x8b, 0xf5, 0xcb, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\n/* Next four bytes used for Windows Disk Signature / Drive serial number */\n/*\nunsigned char mbr_95b_0x1b8[] = {\n                                                  0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00\n};\n*/\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_dos.h",
    "content": "/* First 446 bytes of MBR from Dos 3.3 onwards and Windows 95A */\nunsigned char mbr_dos_0x0[] = {\n  0xfa, 0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8b, 0xf4, 0x50, 0x07,\n  0x50, 0x1f, 0xfb, 0xfc, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x01, 0xf3, 0xa5,\n  0xea, 0x1d, 0x06, 0x00, 0x00, 0xbe, 0xbe, 0x07, 0xb3, 0x04, 0x80, 0x3c,\n  0x80, 0x74, 0x0e, 0x80, 0x3c, 0x00, 0x75, 0x1c, 0x83, 0xc6, 0x10, 0xfe,\n  0xcb, 0x75, 0xef, 0xcd, 0x18, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x8b, 0xee,\n  0x83, 0xc6, 0x10, 0xfe, 0xcb, 0x74, 0x1a, 0x80, 0x3c, 0x00, 0x74, 0xf4,\n  0xbe, 0x8b, 0x06, 0xac, 0x3c, 0x00, 0x74, 0x0b, 0x56, 0xbb, 0x07, 0x00,\n  0xb4, 0x0e, 0xcd, 0x10, 0x5e, 0xeb, 0xf0, 0xeb, 0xfe, 0xbf, 0x05, 0x00,\n  0xbb, 0x00, 0x7c, 0xb8, 0x01, 0x02, 0x57, 0xcd, 0x13, 0x5f, 0x73, 0x0c,\n  0x33, 0xc0, 0xcd, 0x13, 0x4f, 0x75, 0xed, 0xbe, 0xa3, 0x06, 0xeb, 0xd3,\n  0xbe, 0xc2, 0x06, 0xbf, 0xfe, 0x7d, 0x81, 0x3d, 0x55, 0xaa, 0x75, 0xc7,\n  0x8b, 0xf5, 0xea, 0x00, 0x7c, 0x00, 0x00, 0x49, 0x6e, 0x76, 0x61, 0x6c,\n  0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n  0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72,\n  0x20, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65,\n  0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65,\n  0x6d, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70,\n  0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74,\n  0x65, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\n/* Next four bytes used for Windows Disk Signature / Drive serial number */\n/*\nunsigned char mbr_dos_0x1b8[] = {\n                                                  0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00\n};\n*/\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_dos_f2.h",
    "content": "/* First 446 bytes of MBR from Dos 3.3 onwards and Windows 95A */\nunsigned char mbr_dos_f2_0x0[] = {\n  0xfa, 0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8b, 0xf4, 0x50, 0x07,\n  0x50, 0x1f, 0xfb, 0xfc, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x01, 0xf2, 0xa5,\n  0xea, 0x1d, 0x06, 0x00, 0x00, 0xbe, 0xbe, 0x07, 0xb3, 0x04, 0x80, 0x3c,\n  0x80, 0x74, 0x0e, 0x80, 0x3c, 0x00, 0x75, 0x1c, 0x83, 0xc6, 0x10, 0xfe,\n  0xcb, 0x75, 0xef, 0xcd, 0x18, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x8b, 0xee,\n  0x83, 0xc6, 0x10, 0xfe, 0xcb, 0x74, 0x1a, 0x80, 0x3c, 0x00, 0x74, 0xf4,\n  0xbe, 0x8b, 0x06, 0xac, 0x3c, 0x00, 0x74, 0x0b, 0x56, 0xbb, 0x07, 0x00,\n  0xb4, 0x0e, 0xcd, 0x10, 0x5e, 0xeb, 0xf0, 0xeb, 0xfe, 0xbf, 0x05, 0x00,\n  0xbb, 0x00, 0x7c, 0xb8, 0x01, 0x02, 0x57, 0xcd, 0x13, 0x5f, 0x73, 0x0c,\n  0x33, 0xc0, 0xcd, 0x13, 0x4f, 0x75, 0xed, 0xbe, 0xa3, 0x06, 0xeb, 0xd3,\n  0xbe, 0xc2, 0x06, 0xbf, 0xfe, 0x7d, 0x81, 0x3d, 0x55, 0xaa, 0x75, 0xc7,\n  0x8b, 0xf5, 0xea, 0x00, 0x7c, 0x00, 0x00, 0x49, 0x6e, 0x76, 0x61, 0x6c,\n  0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n  0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72,\n  0x20, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65,\n  0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65,\n  0x6d, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70,\n  0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74,\n  0x65, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_gpt_syslinux.h",
    "content": "/* This version is from gptmbr.bin from syslinux 6.02 */\nunsigned char mbr_gpt_syslinux_0x0[] = {\n  0x33, 0xc0, 0xfa, 0x8e, 0xd8, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x89, 0xe6,\n  0x06, 0x57, 0x8e, 0xc0, 0xfb, 0xfc, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x01,\n  0xf3, 0xa5, 0xea, 0x1f, 0x06, 0x00, 0x00, 0x52, 0x89, 0xe5, 0x83, 0xec,\n  0x1c, 0x6a, 0x1e, 0xc7, 0x46, 0xfa, 0x00, 0x02, 0x52, 0xb4, 0x41, 0xbb,\n  0xaa, 0x55, 0x31, 0xc9, 0x30, 0xf6, 0xf9, 0xcd, 0x13, 0x5a, 0xb4, 0x08,\n  0x72, 0x17, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x11, 0xd1, 0xe9, 0x73, 0x0d,\n  0x66, 0xc7, 0x06, 0x59, 0x07, 0xb4, 0x42, 0xeb, 0x13, 0xb4, 0x48, 0x89,\n  0xe6, 0xcd, 0x13, 0x83, 0xe1, 0x3f, 0x51, 0x0f, 0xb6, 0xc6, 0x40, 0xf7,\n  0xe1, 0x52, 0x50, 0x66, 0x31, 0xc0, 0x66, 0x99, 0x40, 0xe8, 0xdc, 0x00,\n  0x8b, 0x4e, 0x56, 0x8b, 0x46, 0x5a, 0x50, 0x51, 0xf7, 0xe1, 0xf7, 0x76,\n  0xfa, 0x91, 0x41, 0x66, 0x8b, 0x46, 0x4e, 0x66, 0x8b, 0x56, 0x52, 0x53,\n  0xe8, 0xc4, 0x00, 0xe2, 0xfb, 0x31, 0xf6, 0x5f, 0x59, 0x58, 0x66, 0x8b,\n  0x15, 0x66, 0x0b, 0x55, 0x04, 0x66, 0x0b, 0x55, 0x08, 0x66, 0x0b, 0x55,\n  0x0c, 0x74, 0x0c, 0xf6, 0x45, 0x30, 0x04, 0x74, 0x06, 0x21, 0xf6, 0x75,\n  0x19, 0x89, 0xfe, 0x01, 0xc7, 0xe2, 0xdf, 0x21, 0xf6, 0x75, 0x2e, 0xe8,\n  0xe1, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x4f, 0x53,\n  0x0d, 0x0a, 0xe8, 0xd2, 0x00, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c,\n  0x65, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, 0x72,\n  0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0d, 0x0a, 0x91, 0xbf, 0xbe,\n  0x07, 0x57, 0x66, 0x31, 0xc0, 0xb0, 0x80, 0x66, 0xab, 0xb0, 0xed, 0x66,\n  0xab, 0x66, 0x8b, 0x44, 0x20, 0x66, 0x8b, 0x54, 0x24, 0xe8, 0x40, 0x00,\n  0x66, 0x8b, 0x44, 0x28, 0x66, 0x8b, 0x54, 0x2c, 0x66, 0x2b, 0x44, 0x20,\n  0x66, 0x1b, 0x54, 0x24, 0xe8, 0x70, 0x00, 0xe8, 0x2a, 0x00, 0x66, 0x0f,\n  0xb7, 0xc1, 0x66, 0xab, 0xf3, 0xa4, 0x5e, 0x66, 0x8b, 0x44, 0x34, 0x66,\n  0x8b, 0x54, 0x38, 0xe8, 0x22, 0x00, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa,\n  0x75, 0x85, 0x89, 0xec, 0x5a, 0x5f, 0x07, 0x66, 0xb8, 0x21, 0x47, 0x50,\n  0x54, 0xfa, 0xff, 0xe4, 0x66, 0x21, 0xd2, 0x74, 0x04, 0x66, 0x83, 0xc8,\n  0xff, 0x66, 0xab, 0xc3, 0xbb, 0x00, 0x7c, 0x66, 0x60, 0x66, 0x52, 0x66,\n  0x50, 0x06, 0x53, 0x6a, 0x01, 0x6a, 0x10, 0x89, 0xe6, 0x66, 0xf7, 0x76,\n  0xdc, 0xc0, 0xe4, 0x06, 0x88, 0xe1, 0x88, 0xc5, 0x92, 0xf6, 0x76, 0xe0,\n  0x88, 0xc6, 0x08, 0xe1, 0x41, 0xb8, 0x01, 0x02, 0x8a, 0x56, 0x00, 0xcd,\n  0x13, 0x8d, 0x64, 0x10, 0x66, 0x61, 0x72, 0x0c, 0x02, 0x7e, 0xfb, 0x66,\n  0x83, 0xc0, 0x01, 0x66, 0x83, 0xd2, 0x00, 0xc3, 0xe8, 0x0c, 0x00, 0x44,\n  0x69, 0x73, 0x6b, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x5e,\n  0xac, 0xb4, 0x0e, 0x8a, 0x3e, 0x62, 0x04, 0xb3, 0x07, 0xcd, 0x10, 0x3c,\n  0x0a, 0x75, 0xf1, 0xcd, 0x18, 0xf4, 0xeb, 0xfd, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_grub.h",
    "content": "/*\n * First 423 bytes of MBR from Grub4DOS (Converted from res/grub/grldr.mbr)\n */\nunsigned char mbr_grub_0x0[] = {\n    0xEB, 0x5E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x20, 0x39, 0xFF, 0xFF,\n    0x31, 0xDB, 0x8E, 0xD3, 0xBC, 0x80, 0x05, 0xE8, 0x00, 0x00, 0x5B, 0x81,\n    0xEB, 0x6A, 0x00, 0xC1, 0xEB, 0x04, 0x8C, 0xC8, 0x01, 0xC3, 0x53, 0x68,\n    0x7B, 0x00, 0xCB, 0x68, 0x00, 0x20, 0x17, 0xBC, 0x00, 0x90, 0x80, 0xFA,\n    0x00, 0x74, 0x02, 0xB2, 0x80, 0x16, 0x07, 0xB0, 0x10, 0x30, 0xF6, 0x31,\n    0xDB, 0xE8, 0xC2, 0x00, 0x72, 0x29, 0x0E, 0x1F, 0x31, 0xF6, 0x31, 0xFF,\n    0xB9, 0xDF, 0x00, 0xFC, 0xF3, 0xA5, 0xBB, 0xFC, 0x1F, 0x66, 0xB8, 0x47,\n    0x52, 0x55, 0xAA, 0x66, 0x39, 0x07, 0x75, 0x03, 0xE8, 0xA7, 0x19, 0xEA,\n    0xB8, 0x00, 0x00, 0x20, 0x16, 0x1F, 0x66, 0x39, 0x07, 0x74, 0x1F, 0x80,\n    0xF2, 0x80, 0x68, 0xC0, 0x07, 0x07, 0xB0, 0x10, 0x30, 0xF6, 0x31, 0xDB,\n    0xE8, 0x87, 0x00, 0x72, 0x05, 0xEA, 0x00, 0x00, 0xC0, 0x07, 0xBE, 0x92,\n    0x01, 0xE8, 0xAF, 0x00, 0xEB, 0xFE, 0xBE, 0xBE, 0x01, 0xE8, 0x24, 0x10,\n    0xF6, 0x06, 0xA4, 0x01, 0x80, 0x0F, 0x84, 0x7B, 0x19, 0x83, 0xC6, 0x0C,\n    0x81, 0xFE, 0xFE, 0x01, 0x72, 0xEB, 0x77, 0x2D, 0xF6, 0x06, 0xA7, 0x01,\n    0x01, 0x0F, 0x85, 0x2D, 0x17, 0x80, 0x0E, 0xA7, 0x01, 0x01, 0xF6, 0x06,\n    0xA7, 0x01, 0x02, 0x75, 0xD4, 0x68, 0x00, 0x0D, 0x07, 0xB0, 0x04, 0x31,\n    0xD2, 0x31, 0xDB, 0xE8, 0x3C, 0x00, 0x73, 0xC2, 0xBE, 0xBC, 0x1C, 0xE8,\n    0x69, 0x00, 0xE9, 0x09, 0x17, 0xF6, 0x06, 0xA7, 0x01, 0x01, 0x0F, 0x85,\n    0x00, 0x17, 0x80, 0x0E, 0xA7, 0x01, 0x01, 0xE9, 0xE1, 0x16, 0x1E, 0x06,\n    0x52, 0x56, 0x57, 0x55, 0xF9, 0xCD, 0x13, 0x5D, 0x5F, 0x5E, 0x5A, 0x07,\n    0x1F, 0xC3, 0xFA, 0xB8, 0x00, 0x20, 0x8E, 0xD0, 0xBC, 0xDC, 0x8F, 0xFB,\n    0x66, 0x61, 0x07, 0x1F, 0xEB, 0x97, 0xB4, 0x02, 0xBF, 0x03, 0x00, 0xB9,\n    0x01, 0x00, 0x60, 0x50, 0x53, 0x51, 0xFE, 0xC8, 0x00, 0xC1, 0xD0, 0xE0,\n    0x00, 0xC7, 0xB0, 0x01, 0xE8, 0xC7, 0xFF, 0x59, 0x5B, 0x58, 0x72, 0x04,\n    0xFE, 0xC8, 0x75, 0xE7, 0x61, 0x73, 0x0B, 0x60, 0x31, 0xC0, 0xE8, 0xB5,\n    0xFF, 0x61, 0x4F, 0x75, 0xD9, 0xF9, 0xC3, 0xB4, 0x0E, 0xCD, 0x10, 0x2E,\n    0xAC, 0x3C, 0x00, 0x75, 0xF6, 0xC3, 0x0D, 0x0A, 0x4D, 0x69, 0x73, 0x73,\n    0x69, 0x6E, 0x67, 0x20, 0x68, 0x65, 0x6C, 0x70, 0x65, 0x72, 0x2E, 0x00,\n    0x00, 0x3F, 0xFF\n};\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_grub2.h",
    "content": "/*\n * First 432 bytes of MBR from Grub2 (boot.img), with 2 bytes NOPed @0x66\n * as per grub2's setup.c comments:\n *   If DEST_DRIVE is a hard disk, enable the workaround, which is\n *   for buggy BIOSes which don't pass boot drive correctly. Instead,\n *   they pass 0x00 or 0x01 even when booted from 0x80.\n */\n\nunsigned char mbr_grub2_0x0[] = {\n\t0xEB, 0x63, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0xFF, 0xFA, 0x90, 0x90, 0xF6, 0xC2, 0x80, 0x74,\n\t0x05, 0xF6, 0xC2, 0x70, 0x74, 0x02, 0xB2, 0x80, 0xEA, 0x79, 0x7C, 0x00,\n\t0x00, 0x31, 0xC0, 0x8E, 0xD8, 0x8E, 0xD0, 0xBC, 0x00, 0x20, 0xFB, 0xA0,\n\t0x64, 0x7C, 0x3C, 0xFF, 0x74, 0x02, 0x88, 0xC2, 0x52, 0xBE, 0x80, 0x7D,\n\t0xE8, 0x17, 0x01, 0xBE, 0x05, 0x7C, 0xB4, 0x41, 0xBB, 0xAA, 0x55, 0xCD,\n\t0x13, 0x5A, 0x52, 0x72, 0x3D, 0x81, 0xFB, 0x55, 0xAA, 0x75, 0x37, 0x83,\n\t0xE1, 0x01, 0x74, 0x32, 0x31, 0xC0, 0x89, 0x44, 0x04, 0x40, 0x88, 0x44,\n\t0xFF, 0x89, 0x44, 0x02, 0xC7, 0x04, 0x10, 0x00, 0x66, 0x8B, 0x1E, 0x5C,\n\t0x7C, 0x66, 0x89, 0x5C, 0x08, 0x66, 0x8B, 0x1E, 0x60, 0x7C, 0x66, 0x89,\n\t0x5C, 0x0C, 0xC7, 0x44, 0x06, 0x00, 0x70, 0xB4, 0x42, 0xCD, 0x13, 0x72,\n\t0x05, 0xBB, 0x00, 0x70, 0xEB, 0x76, 0xB4, 0x08, 0xCD, 0x13, 0x73, 0x0D,\n\t0x5A, 0x84, 0xD2, 0x0F, 0x83, 0xD8, 0x00, 0xBE, 0x8B, 0x7D, 0xE9, 0x82,\n\t0x00, 0x66, 0x0F, 0xB6, 0xC6, 0x88, 0x64, 0xFF, 0x40, 0x66, 0x89, 0x44,\n\t0x04, 0x0F, 0xB6, 0xD1, 0xC1, 0xE2, 0x02, 0x88, 0xE8, 0x88, 0xF4, 0x40,\n\t0x89, 0x44, 0x08, 0x0F, 0xB6, 0xC2, 0xC0, 0xE8, 0x02, 0x66, 0x89, 0x04,\n\t0x66, 0xA1, 0x60, 0x7C, 0x66, 0x09, 0xC0, 0x75, 0x4E, 0x66, 0xA1, 0x5C,\n\t0x7C, 0x66, 0x31, 0xD2, 0x66, 0xF7, 0x34, 0x88, 0xD1, 0x31, 0xD2, 0x66,\n\t0xF7, 0x74, 0x04, 0x3B, 0x44, 0x08, 0x7D, 0x37, 0xFE, 0xC1, 0x88, 0xC5,\n\t0x30, 0xC0, 0xC1, 0xE8, 0x02, 0x08, 0xC1, 0x88, 0xD0, 0x5A, 0x88, 0xC6,\n\t0xBB, 0x00, 0x70, 0x8E, 0xC3, 0x31, 0xDB, 0xB8, 0x01, 0x02, 0xCD, 0x13,\n\t0x72, 0x1E, 0x8C, 0xC3, 0x60, 0x1E, 0xB9, 0x00, 0x01, 0x8E, 0xDB, 0x31,\n\t0xF6, 0xBF, 0x00, 0x80, 0x8E, 0xC6, 0xFC, 0xF3, 0xA5, 0x1F, 0x61, 0xFF,\n\t0x26, 0x5A, 0x7C, 0xBE, 0x86, 0x7D, 0xEB, 0x03, 0xBE, 0x95, 0x7D, 0xE8,\n\t0x34, 0x00, 0xBE, 0x9A, 0x7D, 0xE8, 0x2E, 0x00, 0xCD, 0x18, 0xEB, 0xFE,\n\t0x47, 0x52, 0x55, 0x42, 0x20, 0x00, 0x47, 0x65, 0x6F, 0x6D, 0x00, 0x48,\n\t0x61, 0x72, 0x64, 0x20, 0x44, 0x69, 0x73, 0x6B, 0x00, 0x52, 0x65, 0x61,\n\t0x64, 0x00, 0x20, 0x45, 0x72, 0x72, 0x6F, 0x72, 0x0D, 0x0A, 0x00, 0xBB,\n\t0x01, 0x00, 0xB4, 0x0E, 0xCD, 0x10, 0xAC, 0x3C, 0x00, 0x75, 0xF4, 0xC3\n};\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_kolibri.h",
    "content": "/* First 440 bytes of MBR from KolibriOS */\nunsigned char mbr_kolibri_0x0[] = {\n\t0x33, 0xC0, 0x8E, 0xD0, 0xBC, 0x00, 0x7C, 0xFB, 0x50, 0x07, 0x50, 0x1F,\n\t0xFC, 0xBE, 0x1B, 0x7C, 0xBF, 0x1B, 0x06, 0x50, 0x57, 0xB9, 0xE5, 0x01,\n\t0xF3, 0xA4, 0xCB, 0xBD, 0xBE, 0x07, 0xB1, 0x04, 0x38, 0x6E, 0x00, 0x7C,\n\t0x09, 0x75, 0x13, 0x83, 0xC5, 0x10, 0xE2, 0xF4, 0xCD, 0x18, 0x8B, 0xF5,\n\t0x83, 0xC6, 0x10, 0x49, 0x74, 0x19, 0x38, 0x2C, 0x74, 0xF6, 0xA0, 0xB5,\n\t0x07, 0xB4, 0x07, 0x8B, 0xF0, 0xAC, 0x3C, 0x00, 0x74, 0xFC, 0xBB, 0x07,\n\t0x00, 0xB4, 0x0E, 0xCD, 0x10, 0xEB, 0xF2, 0x88, 0x4E, 0x10, 0xE8, 0x46,\n\t0x00, 0x73, 0x2A, 0xFE, 0x46, 0x10, 0x80, 0x7E, 0x04, 0x0B, 0x74, 0x0B,\n\t0x80, 0x7E, 0x04, 0x0C, 0x74, 0x05, 0xA0, 0xB6, 0x07, 0x75, 0xD2, 0x80,\n\t0x46, 0x02, 0x06, 0x83, 0x46, 0x08, 0x06, 0x83, 0x56, 0x0A, 0x00, 0xE8,\n\t0x21, 0x00, 0x73, 0x05, 0xA0, 0xB6, 0x07, 0xEB, 0xBC, 0x81, 0x3E, 0xFE,\n\t0x7D, 0x55, 0xAA, 0x74, 0x0B, 0x80, 0x7E, 0x10, 0x00, 0x74, 0xC8, 0xA0,\n\t0xB7, 0x07, 0xEB, 0xA9, 0x8B, 0xFC, 0x1E, 0x57, 0x8B, 0xF5, 0xCB, 0xBF,\n\t0x05, 0x00, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,\n\t0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,\n\t0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,\n\t0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,\n\t0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,\n\t0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,\n\t0x90, 0x90, 0x90, 0x90, 0x90, 0x60, 0xBB, 0xAA, 0x55, 0xB4, 0x41, 0xCD,\n\t0x13, 0x72, 0x36, 0x81, 0xFB, 0x55, 0xAA, 0x75, 0x30, 0xF6, 0xC1, 0x01,\n\t0x74, 0x2B, 0x61, 0x60, 0x6A, 0x00, 0x6A, 0x00, 0xFF, 0x76, 0x0A, 0xFF,\n\t0x76, 0x08, 0x6A, 0x00, 0x68, 0x00, 0x7C, 0x6A, 0x01, 0x6A, 0x10, 0xB4,\n\t0x42, 0x8B, 0xF4, 0xCD, 0x13, 0x61, 0x61, 0x73, 0x0E, 0x4F, 0x74, 0x0B,\n\t0x32, 0xE4, 0x52, 0xCD, 0x13, 0x5A, 0x90, 0xEB, 0xD6, 0x61, 0xF9, 0xC3,\n\t0x49, 0x6E, 0x76, 0x61, 0x6C, 0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74,\n\t0x69, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x00,\n\t0x45, 0x72, 0x72, 0x6F, 0x72, 0x20, 0x6C, 0x6F, 0x61, 0x64, 0x69, 0x6E,\n\t0x67, 0x20, 0x6F, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6E, 0x67, 0x20,\n\t0x73, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x00, 0x4D, 0x69, 0x73, 0x73, 0x69,\n\t0x6E, 0x67, 0x20, 0x6F, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6E, 0x67,\n\t0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x44, 0x63\n};\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_msg_rufus.h",
    "content": "/*\n * Rufus message MBR - Displays an ASCII text message contained in the\n * 4 KB of sectors starting at LBA 34 (i.e. after the primary GPT if any).\n * See https://github.com/pbatard/rufus/tree/master/res/mbr\n * Copyright © 2019-2022 Pete Batard <pete@akeo.ie>\n */\n\nunsigned char mbr_msg_rufus_0x0[] = {\n\t0x41, 0x4B, 0x45, 0x4F, 0xFC, 0x31, 0xC0, 0xFA, 0x8E, 0xD0, 0xBC, 0x00,\n\t0x7C, 0xFB, 0x8E, 0xD8, 0xBB, 0x13, 0x04, 0x8B, 0x07, 0x83, 0xE8, 0x04,\n\t0x89, 0x07, 0xC1, 0xE0, 0x06, 0x8E, 0xC0, 0xB8, 0x03, 0x00, 0xCD, 0x10,\n\t0xB4, 0x02, 0xCD, 0x10, 0xB4, 0x41, 0xBB, 0xAA, 0x55, 0x31, 0xC9, 0x31,\n\t0xD2, 0xCD, 0x13, 0x72, 0x27, 0x81, 0xFB, 0x55, 0xAA, 0x75, 0x21, 0xF7,\n\t0xC1, 0x01, 0x00, 0x74, 0x1B, 0x66, 0x31, 0xC0, 0x66, 0x50, 0x6A, 0x22,\n\t0x06, 0x66, 0x50, 0x6A, 0x08, 0x6A, 0x10, 0x89, 0xE6, 0xB4, 0x42, 0xCD,\n\t0x13, 0x9F, 0x83, 0xC4, 0x10, 0x9E, 0xEB, 0x0D, 0xB8, 0x08, 0x02, 0xB9,\n\t0x23, 0x00, 0xBA, 0x80, 0x00, 0x31, 0xDB, 0xCD, 0x13, 0xBB, 0x07, 0x00,\n\t0x72, 0x0B, 0x31, 0xF6, 0x8C, 0xC0, 0x8E, 0xD8, 0xE8, 0x3F, 0x00, 0xEB,\n\t0x06, 0xBE, 0x0B, 0x7D, 0xE8, 0x37, 0x00, 0x31, 0xC0, 0x8E, 0xD8, 0xBE,\n\t0x57, 0x7D, 0xE8, 0x2D, 0x00, 0xE8, 0x1D, 0x00, 0xB4, 0x01, 0xCD, 0x16,\n\t0x75, 0x08, 0xB4, 0x02, 0xCD, 0x16, 0x24, 0x04, 0x74, 0xF2, 0x31, 0xC0,\n\t0x8E, 0xD8, 0xB8, 0x34, 0x12, 0xA3, 0x73, 0x04, 0xEA, 0x00, 0x00, 0xFF,\n\t0xFF, 0xB4, 0x01, 0xCD, 0x16, 0x74, 0x06, 0xB4, 0x00, 0xCD, 0x16, 0xE2,\n\t0xF4, 0xC3, 0xAC, 0x3C, 0x00, 0x74, 0x4F, 0x3C, 0x0D, 0x74, 0xF7, 0x3C,\n\t0x0A, 0x75, 0x10, 0x53, 0xB4, 0x03, 0xCD, 0x10, 0xFE, 0xC6, 0xB2, 0x00,\n\t0xB4, 0x02, 0xCD, 0x10, 0x5B, 0xEB, 0xE3, 0x3C, 0x5C, 0x75, 0x1C, 0xB1,\n\t0x02, 0xAC, 0x3C, 0x46, 0x7F, 0xD8, 0x2C, 0x30, 0x3C, 0x09, 0x7E, 0x02,\n\t0x2C, 0x07, 0xC0, 0xE3, 0x04, 0x24, 0x0F, 0x08, 0xC3, 0xFE, 0xC9, 0x75,\n\t0xE8, 0xEB, 0xC3, 0xB9, 0x01, 0x00, 0xB4, 0x09, 0xCD, 0x10, 0x53, 0x31,\n\t0xDB, 0xB4, 0x03, 0xCD, 0x10, 0xFE, 0xC2, 0xB4, 0x02, 0xCD, 0x10, 0x5B,\n\t0xEB, 0xAC, 0xC3, 0x0D, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5C, 0x30, 0x34, 0x2A, 0x2A, 0x2A,\n\t0x20, 0x45, 0x52, 0x52, 0x4F, 0x52, 0x3A, 0x20, 0x54, 0x48, 0x49, 0x53,\n\t0x20, 0x4D, 0x45, 0x44, 0x49, 0x41, 0x20, 0x43, 0x41, 0x4E, 0x4E, 0x4F,\n\t0x54, 0x20, 0x42, 0x4F, 0x4F, 0x54, 0x20, 0x49, 0x4E, 0x20, 0x4C, 0x45,\n\t0x47, 0x41, 0x43, 0x59, 0x20, 0x4D, 0x4F, 0x44, 0x45, 0x20, 0x2A, 0x2A,\n\t0x2A, 0x5C, 0x30, 0x37, 0x0D, 0x0A, 0x00, 0x0D, 0x0A, 0x0D, 0x0A, 0x20,\n\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t0x5C, 0x37, 0x30, 0x50, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x20, 0x72, 0x65,\n\t0x6D, 0x6F, 0x76, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6D, 0x65,\n\t0x64, 0x69, 0x61, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x70, 0x72, 0x65, 0x73,\n\t0x73, 0x20, 0x61, 0x6E, 0x79, 0x20, 0x6B, 0x65, 0x79, 0x20, 0x74, 0x6F,\n\t0x20, 0x72, 0x65, 0x62, 0x6F, 0x6F, 0x74, 0x5C, 0x30, 0x37, 0x00, 0x00,\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_reactos.h",
    "content": "/* First 267 bytes of MBR from ReactOS */\nunsigned char mbr_reactos_0x0[] = {\n\t0xfa, 0xfc, 0x31, 0xc0, 0x8e, 0xd0, 0x8e, 0xd8, 0xbd, 0x00, 0x7c, 0x8d,\n\t0x66, 0xe0, 0xfb, 0xb8, 0xe0, 0x1f, 0x8e, 0xc0, 0x89, 0xee, 0x89, 0xef,\n\t0xb9, 0x00, 0x01, 0xf3, 0xa5, 0xea, 0x22, 0x7c, 0xe0, 0x1f, 0x8e, 0xd8,\n\t0x8e, 0xd0, 0x31, 0xc0, 0x8e, 0xc0, 0x8d, 0xbe, 0xbe, 0x01, 0xf6, 0x05,\n\t0x80, 0x75, 0x6d, 0x83, 0xc7, 0x10, 0x81, 0xff, 0xfe, 0x7d, 0x72, 0xf2,\n\t0xe8, 0xc4, 0x00, 0x6e, 0x6f, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65,\n\t0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66,\n\t0x6f, 0x75, 0x6e, 0x64, 0x00, 0xeb, 0xfe, 0xe8, 0xa5, 0x00, 0x72, 0x65,\n\t0x61, 0x64, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x77, 0x68, 0x69,\n\t0x6c, 0x65, 0x20, 0x72, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x64,\n\t0x72, 0x69, 0x76, 0x65, 0x00, 0xeb, 0xda, 0xe8, 0x81, 0x00, 0x70, 0x61,\n\t0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x69, 0x67, 0x6e,\n\t0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x21, 0x3d, 0x20, 0x35, 0x35, 0x41,\n\t0x41, 0x00, 0xeb, 0xb9, 0xe8, 0x10, 0x00, 0x72, 0xb6, 0x26, 0x81, 0x3e,\n\t0xfe, 0x7d, 0x55, 0xaa, 0x75, 0xd1, 0xea, 0x00, 0x7c, 0x00, 0x00, 0xbb,\n\t0xaa, 0x55, 0xb4, 0x41, 0xcd, 0x13, 0x72, 0x32, 0x81, 0xfb, 0x55, 0xaa,\n\t0x75, 0x2c, 0xf6, 0xc1, 0x01, 0x74, 0x27, 0xeb, 0x10, 0x10, 0x00, 0x04,\n\t0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n\t0x00, 0x8b, 0x45, 0x08, 0xa3, 0xd1, 0x7c, 0x8b, 0x45, 0x0a, 0xa3, 0xd3,\n\t0x7c, 0xb8, 0x00, 0x42, 0xbe, 0xc9, 0x7c, 0xcd, 0x13, 0xc3, 0xb8, 0x04,\n\t0x02, 0xbb, 0x00, 0x7c, 0x8b, 0x4d, 0x02, 0x8a, 0x75, 0x01, 0xcd, 0x13,\n\t0xc3, 0x31, 0xdb, 0xb4, 0x0e, 0xcd, 0x10, 0x5e, 0xac, 0x56, 0x3c, 0x00,\n\t0x75, 0xf3, 0xc3\n};\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_rufus.h",
    "content": "/*\n * First 440 bytes of Rufus MBR\n * https://github.com/pbatard/rufus/tree/master/res/mbr\n * Copyright © 2012-2014 Pete Batard <pete@akeo.ie>\n */\nunsigned char mbr_rufus_0x0[] = {\n\t0x41, 0x4b, 0x45, 0x4f, 0xfc, 0x31, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00,\n\t0x7c, 0xfb, 0x89, 0xe6, 0x89, 0xe7, 0x1e, 0x06, 0x8e, 0xd8, 0xbb, 0x13,\n\t0x04, 0x8b, 0x07, 0x48, 0x89, 0x07, 0xc1, 0xe0, 0x06, 0x2d, 0xc0, 0x07,\n\t0x8e, 0xc0, 0xb9, 0x00, 0x02, 0xf3, 0xa4, 0x50, 0x68, 0x30, 0x7c, 0xcb,\n\t0x8e, 0xd8, 0x66, 0x31, 0xdb, 0x8e, 0xc3, 0x41, 0xba, 0x81, 0x00, 0xe8,\n\t0x89, 0x00, 0x72, 0x6d, 0xbb, 0xbe, 0x7d, 0xb9, 0x04, 0x00, 0x26, 0x80,\n\t0x3f, 0x00, 0x7c, 0x09, 0x75, 0x05, 0x83, 0xc3, 0x10, 0xe2, 0xf3, 0xeb,\n\t0x58, 0xbe, 0x94, 0x7d, 0xe8, 0xda, 0x00, 0xe8, 0xca, 0x00, 0xba, 0x5a,\n\t0x7d, 0xbe, 0x6e, 0x7d, 0xe8, 0xa0, 0x00, 0xb4, 0x01, 0xcd, 0x16, 0x75,\n\t0x3d, 0xb4, 0x02, 0xcd, 0x16, 0x24, 0x04, 0x75, 0x38, 0x80, 0x3e, 0x93,\n\t0x7d, 0x00, 0x7f, 0x0b, 0xbe, 0xb4, 0x7d, 0xe8, 0xb3, 0x00, 0xc6, 0x06,\n\t0x93, 0x7d, 0x12, 0x80, 0x3e, 0x92, 0x7d, 0x00, 0x75, 0xd9, 0xe8, 0x89,\n\t0x00, 0xc6, 0x06, 0xbe, 0x7d, 0x81, 0x68, 0x80, 0x00, 0xba, 0x72, 0x7d,\n\t0xbe, 0x7e, 0x7d, 0xe8, 0x65, 0x00, 0x5a, 0x07, 0x1f, 0xea, 0x00, 0x7c,\n\t0x00, 0x00, 0xe8, 0x6d, 0x00, 0xe8, 0x78, 0x00, 0xbb, 0xbe, 0x7d, 0x8b,\n\t0x17, 0x52, 0xb2, 0x80, 0x8b, 0x4f, 0x02, 0x66, 0x8b, 0x5f, 0x08, 0xe8,\n\t0x05, 0x00, 0x73, 0xd5, 0x07, 0x1f, 0xcb, 0x60, 0xb4, 0x41, 0xbb, 0xaa,\n\t0x55, 0xcd, 0x13, 0x72, 0x2c, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x26, 0xf7,\n\t0xc1, 0x01, 0x00, 0x74, 0x20, 0x61, 0x1e, 0x66, 0x31, 0xc0, 0x8e, 0xd8,\n\t0x66, 0x50, 0x66, 0x53, 0x50, 0x68, 0x00, 0x7c, 0x40, 0x50, 0x6a, 0x10,\n\t0x89, 0xe6, 0xb4, 0x42, 0xcd, 0x13, 0x9f, 0x83, 0xc4, 0x10, 0x9e, 0x1f,\n\t0xc3, 0x61, 0xbb, 0x00, 0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0xc3, 0xfa,\n\t0x8b, 0x1c, 0x26, 0x66, 0x8b, 0x07, 0x66, 0x89, 0x04, 0x26, 0x89, 0x17,\n\t0x26, 0x8c, 0x4f, 0x02, 0xfb, 0xc3, 0xfa, 0xbb, 0x20, 0x00, 0x66, 0xa1,\n\t0x6e, 0x7d, 0x26, 0x66, 0x89, 0x07, 0xfb, 0xc3, 0xb4, 0x01, 0xcd, 0x16,\n\t0x74, 0x06, 0xb4, 0x00, 0xcd, 0x16, 0xe2, 0xf4, 0xc3, 0xac, 0x3c, 0x00,\n\t0x74, 0x09, 0xb4, 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3,\n\t0x50, 0x2e, 0xa0, 0xbe, 0x7d, 0x80, 0xfa, 0x80, 0x75, 0x04, 0x88, 0xc2,\n\t0xeb, 0x06, 0x38, 0xc2, 0x75, 0x02, 0xb2, 0x80, 0x58, 0xc3, 0xfa, 0x2e,\n\t0x80, 0x3e, 0x92, 0x7d, 0x00, 0x74, 0x0a, 0x2e, 0xfe, 0x0e, 0x93, 0x7d,\n\t0x2e, 0xfe, 0x0e, 0x92, 0x7d, 0xea, 0x20, 0x00, 0x00, 0x00, 0x9c, 0x2e,\n\t0xfe, 0x06, 0x91, 0x7d, 0x75, 0x03, 0xe8, 0xc7, 0xff, 0x9a, 0x4c, 0x00,\n\t0x00, 0x00, 0x9c, 0x2e, 0xfe, 0x0e, 0x91, 0x7d, 0x79, 0x03, 0xe8, 0xb7,\n\t0xff, 0x9d, 0xca, 0x02, 0x00, 0xff, 0x49, 0x12, 0x0d, 0x0a, 0x50, 0x72,\n\t0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20,\n\t0x74, 0x6f, 0x20, 0x62, 0x6f, 0x6f, 0x74, 0x20, 0x66, 0x72, 0x6f, 0x6d,\n\t0x20, 0x55, 0x53, 0x42, 0x2e, 0x00, 0x00, 0x00\n};\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_syslinux.h",
    "content": "/* This version is from mbr.bin from syslinux 6.02 */\nunsigned char mbr_syslinux_0x0[] = {\n  0x33, 0xc0, 0xfa, 0x8e, 0xd8, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x89, 0xe6,\n  0x06, 0x57, 0x8e, 0xc0, 0xfb, 0xfc, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x01,\n  0xf3, 0xa5, 0xea, 0x1f, 0x06, 0x00, 0x00, 0x52, 0x52, 0xb4, 0x41, 0xbb,\n  0xaa, 0x55, 0x31, 0xc9, 0x30, 0xf6, 0xf9, 0xcd, 0x13, 0x72, 0x13, 0x81,\n  0xfb, 0x55, 0xaa, 0x75, 0x0d, 0xd1, 0xe9, 0x73, 0x09, 0x66, 0xc7, 0x06,\n  0x8d, 0x06, 0xb4, 0x42, 0xeb, 0x15, 0x5a, 0xb4, 0x08, 0xcd, 0x13, 0x83,\n  0xe1, 0x3f, 0x51, 0x0f, 0xb6, 0xc6, 0x40, 0xf7, 0xe1, 0x52, 0x50, 0x66,\n  0x31, 0xc0, 0x66, 0x99, 0xe8, 0x66, 0x00, 0xe8, 0x35, 0x01, 0x4d, 0x69,\n  0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74,\n  0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x0d,\n  0x0a, 0x66, 0x60, 0x66, 0x31, 0xd2, 0xbb, 0x00, 0x7c, 0x66, 0x52, 0x66,\n  0x50, 0x06, 0x53, 0x6a, 0x01, 0x6a, 0x10, 0x89, 0xe6, 0x66, 0xf7, 0x36,\n  0xf4, 0x7b, 0xc0, 0xe4, 0x06, 0x88, 0xe1, 0x88, 0xc5, 0x92, 0xf6, 0x36,\n  0xf8, 0x7b, 0x88, 0xc6, 0x08, 0xe1, 0x41, 0xb8, 0x01, 0x02, 0x8a, 0x16,\n  0xfa, 0x7b, 0xcd, 0x13, 0x8d, 0x64, 0x10, 0x66, 0x61, 0xc3, 0xe8, 0xc4,\n  0xff, 0xbe, 0xbe, 0x7d, 0xbf, 0xbe, 0x07, 0xb9, 0x20, 0x00, 0xf3, 0xa5,\n  0xc3, 0x66, 0x60, 0x89, 0xe5, 0xbb, 0xbe, 0x07, 0xb9, 0x04, 0x00, 0x31,\n  0xc0, 0x53, 0x51, 0xf6, 0x07, 0x80, 0x74, 0x03, 0x40, 0x89, 0xde, 0x83,\n  0xc3, 0x10, 0xe2, 0xf3, 0x48, 0x74, 0x5b, 0x79, 0x39, 0x59, 0x5b, 0x8a,\n  0x47, 0x04, 0x3c, 0x0f, 0x74, 0x06, 0x24, 0x7f, 0x3c, 0x05, 0x75, 0x22,\n  0x66, 0x8b, 0x47, 0x08, 0x66, 0x8b, 0x56, 0x14, 0x66, 0x01, 0xd0, 0x66,\n  0x21, 0xd2, 0x75, 0x03, 0x66, 0x89, 0xc2, 0xe8, 0xac, 0xff, 0x72, 0x03,\n  0xe8, 0xb6, 0xff, 0x66, 0x8b, 0x46, 0x1c, 0xe8, 0xa0, 0xff, 0x83, 0xc3,\n  0x10, 0xe2, 0xcc, 0x66, 0x61, 0xc3, 0xe8, 0x76, 0x00, 0x4d, 0x75, 0x6c,\n  0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65,\n  0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,\n  0x0d, 0x0a, 0x66, 0x8b, 0x44, 0x08, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x89,\n  0x44, 0x08, 0xe8, 0x30, 0xff, 0x72, 0x27, 0x66, 0x81, 0x3e, 0x00, 0x7c,\n  0x58, 0x46, 0x53, 0x42, 0x75, 0x09, 0x66, 0x83, 0xc0, 0x04, 0xe8, 0x1c,\n  0xff, 0x72, 0x13, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x0f, 0x85, 0xf2,\n  0xfe, 0xbc, 0xfa, 0x7b, 0x5a, 0x5f, 0x07, 0xfa, 0xff, 0xe4, 0xe8, 0x1e,\n  0x00, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73,\n  0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x65,\n  0x72, 0x72, 0x6f, 0x72, 0x2e, 0x0d, 0x0a, 0x5e, 0xac, 0xb4, 0x0e, 0x8a,\n  0x3e, 0x62, 0x04, 0xb3, 0x07, 0xcd, 0x10, 0x3c, 0x0a, 0x75, 0xf1, 0xcd,\n  0x18, 0xf4, 0xeb, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_vista.h",
    "content": "/* First 446 bytes of MBR from Windows Vista */\n/* This is English version. Bytes 0x162 onwards vary with language. */\n/* Last three bytes 1b5-1b7 point to language-specific messages.    */\n/* Support of other languages is an exercise for the reader!        */\n/* see: http://thestarman.pcministry.com/asm/mbr/VistaMBR.htm       */\n#define MBR_VISTA_LANG_INDEP_LEN 0x162\nunsigned char mbr_vista_0x0[] = {\n0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xbe,\n0x00, 0x7c, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0x50,\n0x68, 0x1c, 0x06, 0xcb, 0xfb, 0xb9, 0x04, 0x00, 0xbd, 0xbe, 0x07, 0x80,\n0x7e, 0x00, 0x00, 0x7c, 0x0b, 0x0f, 0x85, 0x10, 0x01, 0x83, 0xc5, 0x10,\n0xe2, 0xf1, 0xcd, 0x18, 0x88, 0x56, 0x00, 0x55, 0xc6, 0x46, 0x11, 0x05,\n0xc6, 0x46, 0x10, 0x00, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0xcd, 0x13, 0x5d,\n0x72, 0x0f, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x09, 0xf7, 0xc1, 0x01, 0x00,\n0x74, 0x03, 0xfe, 0x46, 0x10, 0x66, 0x60, 0x80, 0x7e, 0x10, 0x00, 0x74,\n0x26, 0x66, 0x68, 0x00, 0x00, 0x00, 0x00, 0x66, 0xff, 0x76, 0x08, 0x68,\n0x00, 0x00, 0x68, 0x00, 0x7c, 0x68, 0x01, 0x00, 0x68, 0x10, 0x00, 0xb4,\n0x42, 0x8a, 0x56, 0x00, 0x8b, 0xf4, 0xcd, 0x13, 0x9f, 0x83, 0xc4, 0x10,\n0x9e, 0xeb, 0x14, 0xb8, 0x01, 0x02, 0xbb, 0x00, 0x7c, 0x8a, 0x56, 0x00,\n0x8a, 0x76, 0x01, 0x8a, 0x4e, 0x02, 0x8a, 0x6e, 0x03, 0xcd, 0x13, 0x66,\n0x61, 0x73, 0x1e, 0xfe, 0x4e, 0x11, 0x0f, 0x85, 0x0c, 0x00, 0x80, 0x7e,\n0x00, 0x80, 0x0f, 0x84, 0x8a, 0x00, 0xb2, 0x80, 0xeb, 0x82, 0x55, 0x32,\n0xe4, 0x8a, 0x56, 0x00, 0xcd, 0x13, 0x5d, 0xeb, 0x9c, 0x81, 0x3e, 0xfe,\n0x7d, 0x55, 0xaa, 0x75, 0x6e, 0xff, 0x76, 0x00, 0xe8, 0x8a, 0x00, 0x0f,\n0x85, 0x15, 0x00, 0xb0, 0xd1, 0xe6, 0x64, 0xe8, 0x7f, 0x00, 0xb0, 0xdf,\n0xe6, 0x60, 0xe8, 0x78, 0x00, 0xb0, 0xff, 0xe6, 0x64, 0xe8, 0x71, 0x00,\n0xb8, 0x00, 0xbb, 0xcd, 0x1a, 0x66, 0x23, 0xc0, 0x75, 0x3b, 0x66, 0x81,\n0xfb, 0x54, 0x43, 0x50, 0x41, 0x75, 0x32, 0x81, 0xf9, 0x02, 0x01, 0x72,\n0x2c, 0x66, 0x68, 0x07, 0xbb, 0x00, 0x00, 0x66, 0x68, 0x00, 0x02, 0x00,\n0x00, 0x66, 0x68, 0x08, 0x00, 0x00, 0x00, 0x66, 0x53, 0x66, 0x53, 0x66,\n0x55, 0x66, 0x68, 0x00, 0x00, 0x00, 0x00, 0x66, 0x68, 0x00, 0x7c, 0x00,\n0x00, 0x66, 0x61, 0x68, 0x00, 0x00, 0x07, 0xcd, 0x1a, 0x5a, 0x32, 0xf6,\n0xea, 0x00, 0x7c, 0x00, 0x00, 0xcd, 0x18, 0xa0, 0xb7, 0x07, 0xeb, 0x08,\n0xa0, 0xb6, 0x07, 0xeb, 0x03, 0xa0, 0xb5, 0x07, 0x32, 0xe4, 0x05, 0x00,\n0x07, 0x8b, 0xf0, 0xac, 0x3c, 0x00, 0x74, 0xfc, 0xbb, 0x07, 0x00, 0xb4,\n0x0e, 0xcd, 0x10, 0xeb, 0xf2, 0x2b, 0xc9, 0xe4, 0x64, 0xeb, 0x00, 0x24,\n0x02, 0xe0, 0xf8, 0x24, 0x02, 0xc3, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69,\n0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n0x74, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20,\n0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65, 0x72,\n0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d,\n0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65,\n0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65,\n0x6d, 0x00, 0x00, 0x00, 0x00, 0x62, 0x7a, 0x99\n};\n/* Next four bytes used for Windows Disk Signature / Drive serial number */\n/*\nunsigned char mbr_vista_0x1b8[] = {\n                                                  0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00\n};\n*/\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_win7.h",
    "content": "/* First 446 bytes of MBR from Windows 7 */\n/* This is English version. Bytes 0x163 onwards vary with language. */\n/* Last three bytes 1b5-1b7 point to language-specific messages.    */\n/* Support of other languages is an exercise for the reader!        */\n/* see: http://thestarman.pcministry.com/asm/mbr/W7MBR.htm          */\n#define MBR_WIN7_LANG_INDEP_LEN 0x163\nunsigned char mbr_win7_0x0[] = {\n  0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xbe,\n  0x00, 0x7c, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0x50,\n  0x68, 0x1c, 0x06, 0xcb, 0xfb, 0xb9, 0x04, 0x00, 0xbd, 0xbe, 0x07, 0x80,\n  0x7e, 0x00, 0x00, 0x7c, 0x0b, 0x0f, 0x85, 0x0e, 0x01, 0x83, 0xc5, 0x10,\n  0xe2, 0xf1, 0xcd, 0x18, 0x88, 0x56, 0x00, 0x55, 0xc6, 0x46, 0x11, 0x05,\n  0xc6, 0x46, 0x10, 0x00, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0xcd, 0x13, 0x5d,\n  0x72, 0x0f, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x09, 0xf7, 0xc1, 0x01, 0x00,\n  0x74, 0x03, 0xfe, 0x46, 0x10, 0x66, 0x60, 0x80, 0x7e, 0x10, 0x00, 0x74,\n  0x26, 0x66, 0x68, 0x00, 0x00, 0x00, 0x00, 0x66, 0xff, 0x76, 0x08, 0x68,\n  0x00, 0x00, 0x68, 0x00, 0x7c, 0x68, 0x01, 0x00, 0x68, 0x10, 0x00, 0xb4,\n  0x42, 0x8a, 0x56, 0x00, 0x8b, 0xf4, 0xcd, 0x13, 0x9f, 0x83, 0xc4, 0x10,\n  0x9e, 0xeb, 0x14, 0xb8, 0x01, 0x02, 0xbb, 0x00, 0x7c, 0x8a, 0x56, 0x00,\n  0x8a, 0x76, 0x01, 0x8a, 0x4e, 0x02, 0x8a, 0x6e, 0x03, 0xcd, 0x13, 0x66,\n  0x61, 0x73, 0x1c, 0xfe, 0x4e, 0x11, 0x75, 0x0c, 0x80, 0x7e, 0x00, 0x80,\n  0x0f, 0x84, 0x8a, 0x00, 0xb2, 0x80, 0xeb, 0x84, 0x55, 0x32, 0xe4, 0x8a,\n  0x56, 0x00, 0xcd, 0x13, 0x5d, 0xeb, 0x9e, 0x81, 0x3e, 0xfe, 0x7d, 0x55,\n  0xaa, 0x75, 0x6e, 0xff, 0x76, 0x00, 0xe8, 0x8d, 0x00, 0x75, 0x17, 0xfa,\n  0xb0, 0xd1, 0xe6, 0x64, 0xe8, 0x83, 0x00, 0xb0, 0xdf, 0xe6, 0x60, 0xe8,\n  0x7c, 0x00, 0xb0, 0xff, 0xe6, 0x64, 0xe8, 0x75, 0x00, 0xfb, 0xb8, 0x00,\n  0xbb, 0xcd, 0x1a, 0x66, 0x23, 0xc0, 0x75, 0x3b, 0x66, 0x81, 0xfb, 0x54,\n  0x43, 0x50, 0x41, 0x75, 0x32, 0x81, 0xf9, 0x02, 0x01, 0x72, 0x2c, 0x66,\n  0x68, 0x07, 0xbb, 0x00, 0x00, 0x66, 0x68, 0x00, 0x02, 0x00, 0x00, 0x66,\n  0x68, 0x08, 0x00, 0x00, 0x00, 0x66, 0x53, 0x66, 0x53, 0x66, 0x55, 0x66,\n  0x68, 0x00, 0x00, 0x00, 0x00, 0x66, 0x68, 0x00, 0x7c, 0x00, 0x00, 0x66,\n  0x61, 0x68, 0x00, 0x00, 0x07, 0xcd, 0x1a, 0x5a, 0x32, 0xf6, 0xea, 0x00,\n  0x7c, 0x00, 0x00, 0xcd, 0x18, 0xa0, 0xb7, 0x07, 0xeb, 0x08, 0xa0, 0xb6,\n  0x07, 0xeb, 0x03, 0xa0, 0xb5, 0x07, 0x32, 0xe4, 0x05, 0x00, 0x07, 0x8b,\n  0xf0, 0xac, 0x3c, 0x00, 0x74, 0x09, 0xbb, 0x07, 0x00, 0xb4, 0x0e, 0xcd,\n  0x10, 0xeb, 0xf2, 0xf4, 0xeb, 0xfd, 0x2b, 0xc9, 0xe4, 0x64, 0xeb, 0x00,\n  0x24, 0x02, 0xe0, 0xf8, 0x24, 0x02, 0xc3, 0x49, 0x6e, 0x76, 0x61, 0x6c,\n  0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n  0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72,\n  0x20, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65,\n  0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65,\n  0x6d, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70,\n  0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74,\n  0x65, 0x6d, 0x00, 0x00, 0x00, 0x63, 0x7b, 0x9a\n};\n/* Next four bytes used for Windows Disk Signature / Drive serial number */\n/*\nunsigned char mbr_win7_0x1b8[] = {\n                                                  0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00\n};\n*/\n"
  },
  {
    "path": "src/ms-sys/inc/mbr_zero.h",
    "content": "/* First 446 bytes of a zeroed MBR*/\nunsigned char mbr_zero_0x0[] = {\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00\n};\n"
  },
  {
    "path": "src/ms-sys/inc/nls.h",
    "content": "#ifndef NLS_H\n#define NLS_H\n\n#include <libintl.h>\n\n#ifdef NO_LIBINTL_OR_GETTEXT\n#define _(String) (String)\n#else\n#define _(String) gettext(String)\n#endif\n#define gettext_noop(String) (String)\n#define N_(String) gettext_noop(String)\n\n/* Init Native language support */\nvoid nls_init(void);\n\n#endif\n"
  },
  {
    "path": "src/ms-sys/inc/ntfs.h",
    "content": "#ifndef NTFS_H\n#define NTFS_H\n\n#include <stdio.h>\n\n/* returns TRUE if the file has an NFTS file system, otherwise FALSE.\n   The file position will change when this function is called! */\nint is_ntfs_fs(FILE *fp);\n\n/* returns TRUE if the file has a NTFS boot record, otherwise FALSE.\n   The file position will change when this function is called! */\nint is_ntfs_br(FILE *fp);\n\n/* returns TRUE if the file has an exact match of the NTFS boot record\n   this program would create, otherwise FALSE.\n   The file position will change when this function is called! */\nint entire_ntfs_br_matches(FILE *fp);\n\n/* Writes a NTFS boot record to a file, returns TRUE on success, otherwise\n   FALSE */\nint write_ntfs_br(FILE *fp);\n\n#endif\n"
  },
  {
    "path": "src/ms-sys/inc/partition_info.h",
    "content": "#ifndef PARTITION_INFO_H\n#define PARTITION_INFO_H\n\n/* Writes the number of heads to a partition\n   returns TRUE on success, otherwise FALSE */\nint write_partition_number_of_heads(FILE *fp, int iHeads);\n\n/* Writes the start sector number to a partition (also known as\n   \"number of hidden sectors\"), returns TRUE on success, otherwise FALSE */\nint write_partition_start_sector_number(FILE *fp, int iStartSector);\n\n/* Writes a physical disk drive id of 0x80 (for C:) to a partition */\nint write_partition_physical_disk_drive_id_fat32(FILE *fp);\nint write_partition_physical_disk_drive_id_fat16(FILE *fp);\n\n#endif\n"
  },
  {
    "path": "src/ms-sys/ntfs.c",
    "content": "/******************************************************************\n    Copyright (C) 2012  Pete Batard <pete@akeo.ie>\n    Based on fat16.c Copyright (C) 2009  Henrik Carlqvist\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n******************************************************************/\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"file.h\"\n#include \"ntfs.h\"\n\nint is_ntfs_fs(FILE *fp)\n{\n   unsigned char aucMagic[] = {'N','T','F','S',' ',' ',' ',' '};\n\n   return contains_data(fp, 0x03, aucMagic, sizeof(aucMagic));\n} /* is_ntfs_fs */\n\nint is_ntfs_br(FILE *fp)\n{\n   /* A \"file\" is probably some kind of NTFS boot record if it contains the\n      magic chars 0x55, 0xAA at positions 0x1FE */\n   unsigned char aucRef[] = {0x55, 0xAA};\n   unsigned char aucMagic[] = {'N','T','F','S',' ',' ',' ',' '};\n\n   if( ! contains_data(fp, 0x1FE, aucRef, sizeof(aucRef)))\n      return 0;\n   if( ! contains_data(fp, 0x03, aucMagic, sizeof(aucMagic)))\n      return 0;\n   return 1;\n} /* is_ntfs_br */\n\nint entire_ntfs_br_matches(FILE *fp)\n{\n   #include \"br_ntfs_0x0.h\"\n   #include \"br_ntfs_0x54.h\"\n\n   return\n      ( contains_data(fp, 0x0, br_ntfs_0x0, sizeof(br_ntfs_0x0)) &&\n\t/* BIOS Parameter Block might differ between systems */\n\tcontains_data(fp, 0x54, br_ntfs_0x54, sizeof(br_ntfs_0x54)) );\n} /* entire_ntfs_br_matches */\n\nint write_ntfs_br(FILE *fp)\n{\n   #include \"br_ntfs_0x0.h\"\n   #include \"br_ntfs_0x54.h\"\n\n   return\n\t ( write_data(fp, 0x0, br_ntfs_0x0, sizeof(br_ntfs_0x0)) &&\n\t   /* BIOS Parameter Block should not be overwritten */\n\t   write_data(fp, 0x54, br_ntfs_0x54, sizeof(br_ntfs_0x54)) );\n} /* write_ntsf_br */\n"
  },
  {
    "path": "src/ms-sys/partition_info.c",
    "content": "/******************************************************************\n    Copyright (C) 2009  Henrik Carlqvist\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program; if not, write to the Free Software\n    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n******************************************************************/\n#include <stdio.h>\n\n#include \"file.h\"\n#include \"partition_info.h\"\n\nint write_partition_number_of_heads(FILE *fp, int iHeads)\n{\n   unsigned char aucBuf[2];\n   unsigned short s = (unsigned short) iHeads;\n\n   if(!s)\n      return 0;\n   /* Converting a number like this is not necessary as long as we are on\n      i386 compatible CPUs, however, the following code might make the program\n      more portable... */\n   aucBuf[0] = (unsigned char)(s & 0xff);\n   aucBuf[1] = (unsigned char)((s & 0xff00) >> 8);\n   return write_data(fp, 0x1a, aucBuf, 2);\n} /* write_partition_number_of_heads */\n\nint write_partition_start_sector_number(FILE *fp, int iStartSector)\n{\n   unsigned char aucBuf[4];\n   unsigned long l = (unsigned long)iStartSector;\n\n   if(!l)\n      return 0;\n   /* Converting a number like this is not necessary as long as we are on\n      i386 compatible CPUs, however, the following code might make the program\n      more portable... */\n   aucBuf[0] = (unsigned char)(l & 0xff);\n   aucBuf[1] = (unsigned char)((l & 0xff00) >> 8);\n   aucBuf[2] = (unsigned char)((l & 0xff0000) >> 16);\n   aucBuf[3] = (unsigned char)((l & 0xff000000) >> 24);\n   return write_data(fp, 0x1c, aucBuf, 4);\n} /* write_partition_start_sector_number */\n\nint write_partition_physical_disk_drive_id_fat32(FILE *fp)\n{\n   unsigned char ucId = 0x80; /* C: */\n\n   return write_data(fp, 0x40, &ucId, 1);\n} /* write_partition_physical_disk_drive_id_fat32 */\n\nint write_partition_physical_disk_drive_id_fat16(FILE *fp)\n{\n   unsigned char ucId = 0x80; /* C: */\n\n   return write_data(fp, 0x24, &ucId, 1);\n} /* write_partition_physical_disk_drive_id_fat16 */\n"
  },
  {
    "path": "src/msapi_utf8.h",
    "content": "/*\n * MSAPI_UTF8: Common API calls using UTF-8 strings\n * Compensating for what Microsoft should have done a long long time ago, that they\n * ONLY started to do in mid-2019 (What the £%^& took them so long?!?), as per:\n * https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/use-utf8-code-page\n *\n * See also: https://utf8everywhere.org\n *\n * Copyright © 2010-2026 Pete Batard <pete@akeo.ie>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 3 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n#include <windows.h>\n#include <stdio.h>\n#include <shlobj.h>\n#include <ctype.h>\n#include <aclapi.h>\n#include <accctrl.h>\n#include <commdlg.h>\n#include <shellapi.h>\n#include <shlwapi.h>\n#include <setupapi.h>\n#include <direct.h>\n#include <share.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <io.h>\n#include <sddl.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <psapi.h>\n\n#pragma once\n#if defined(_MSC_VER)\n// disable VS2012 Code Analysis warnings that are intentional\n#pragma warning(disable: 6387)\t// Don't care about bad params\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define _LTEXT(txt) L##txt\n#define LTEXT(txt) _LTEXT(txt)\n\n#define wchar_to_utf8_no_alloc(wsrc, dest, dest_size) \\\n\tWideCharToMultiByte(CP_UTF8, 0, wsrc, -1, dest, (int)(dest_size), NULL, NULL)\n#define wchar_to_utf8_get_size(wsrc) \\\n\tWideCharToMultiByte(CP_UTF8, 0, wsrc, -1, NULL, 0, NULL, NULL)\n#define utf8_to_wchar_no_alloc(src, wdest, wdest_size) \\\n\tMultiByteToWideChar(CP_UTF8, 0, src, -1, wdest, (int)(wdest_size))\n#define utf8_to_wchar_get_size(src) \\\n\tMultiByteToWideChar(CP_UTF8, 0, src, -1, NULL, 0)\n#define Edit_ReplaceSelU(hCtrl, str) ((void)SendMessageLU(hCtrl, EM_REPLACESEL, (WPARAM)FALSE, str))\n#define ComboBox_AddStringU(hCtrl, str) ((int)(DWORD)SendMessageLU(hCtrl, CB_ADDSTRING, (WPARAM)FALSE, str))\n#define ComboBox_InsertStringU(hCtrl, index, str) ((int)(DWORD)SendMessageLU(hCtrl, CB_INSERTSTRING, (WPARAM)index, str))\n#define ComboBox_GetTextU(hCtrl, str, max_str) GetWindowTextU(hCtrl, str, max_str)\n#define GetSaveFileNameU(p) GetOpenSaveFileNameU(p, TRUE)\n#define GetOpenFileNameU(p) GetOpenSaveFileNameU(p, FALSE)\n#define ListView_SetItemTextU(hwndLV,i,iSubItem_,pszText_) { LVITEMW _ms_wlvi; _ms_wlvi.iSubItem = iSubItem_; \\\n\t_ms_wlvi.pszText = utf8_to_wchar(pszText_); \\\n\tSNDMSG((hwndLV),LVM_SETITEMTEXTW,(WPARAM)(i),(LPARAM)&_ms_wlvi); sfree(_ms_wlvi.pszText);}\n\n// Never ever use isdigit() or isspace(), etc. on UTF-8 strings!\n// These calls take an int and char is signed so MS compilers will produce an assert error on anything that's > 0x80\n#define isasciiU(c) isascii((unsigned char)(c))\n#define iscntrlU(c) iscntrl((unsigned char)(c))\n#define isdigitU(c) isdigit((unsigned char)(c))\n#define isspaceU(c) isspace((unsigned char)(c))\n#define isxdigitU(c) isxdigit((unsigned char)(c))\n// NB: other issomething() calls are not implemented as they may require multibyte UTF-8 sequences to be converted\n\n#define sfree(p) do {if (p != NULL) {free((void*)(p)); p = NULL;}} while(0)\n#define wconvert(p)     wchar_t* w ## p = utf8_to_wchar(p)\n#define walloc(p, size) wchar_t* w ## p = (p == NULL)?NULL:(wchar_t*)calloc(size, sizeof(wchar_t))\n#define wfree(p) sfree(w ## p)\n\n/*\n * Converts an UTF-16 string to UTF8 (allocates returned string)\n * Returns NULL on error\n */\nstatic __inline char* wchar_to_utf8(const wchar_t* wstr)\n{\n\tint size = 0;\n\tchar* str = NULL;\n\n\tif (wstr == NULL)\n\t\treturn NULL;\n\n\t// Convert the empty string too\n\tif (wstr[0] == 0)\n\t\treturn (char*)calloc(1, 1);\n\n\t// Find out the size we need to allocate for our converted string\n\tsize = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);\n\tif (size <= 1)\t// An empty string would be size 1\n\t\treturn NULL;\n\n\tif ((str = (char*)calloc(size, 1)) == NULL)\n\t\treturn NULL;\n\n\tif (wchar_to_utf8_no_alloc(wstr, str, size) != size) {\n\t\tsfree(str);\n\t\treturn NULL;\n\t}\n\n\treturn str;\n}\n\n/*\n * Converts an UTF8 string to UTF-16 (allocates returned string)\n * Returns NULL on error\n */\nstatic __inline wchar_t* utf8_to_wchar(const char* str)\n{\n\tint size = 0;\n\twchar_t* wstr = NULL;\n\n\tif (str == NULL)\n\t\treturn NULL;\n\n\t// Convert the empty string too\n\tif (str[0] == 0)\n\t\treturn (wchar_t*)calloc(1, sizeof(wchar_t));\n\n\t// Find out the size we need to allocate for our converted string\n\tsize = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);\n\tif (size <= 1)\t// An empty string would be size 1\n\t\treturn NULL;\n\n\tif ((wstr = (wchar_t*)calloc(size, sizeof(wchar_t))) == NULL)\n\t\treturn NULL;\n\n\tif (utf8_to_wchar_no_alloc(str, wstr, size) != size) {\n\t\tsfree(wstr);\n\t\treturn NULL;\n\t}\n\treturn wstr;\n}\n\n/*\n* Converts a non NUL-terminated UTF-16 string of length wlen to NUL-terminated UTF8 (allocates returned string)\n* Returns NULL on error\n*/\nstatic __inline char* wchar_len_to_utf8(const wchar_t* wstr, int wlen)\n{\n\tint size = 0;\n\tchar* str = NULL;\n\n\t// Find out the size we need to allocate for our converted string\n\tsize = WideCharToMultiByte(CP_UTF8, 0, wstr, wlen, NULL, 0, NULL, NULL);\n\tif (size <= 1)\t// An empty string would be size 1\n\t\treturn NULL;\n\n\tif ((str = (char*)calloc(size, 1)) == NULL)\n\t\treturn NULL;\n\n\tif (WideCharToMultiByte(CP_UTF8, 0, wstr, wlen, str, size, NULL, NULL) != size) {\n\t\tsfree(str);\n\t\treturn NULL;\n\t}\n\n\treturn str;\n}\n\nstatic __inline DWORD FormatMessageU(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId,\n\t\t\t\t\t\t\t\t\t DWORD dwLanguageId, char* lpBuffer, DWORD nSize, va_list *Arguments)\n{\n\tDWORD ret = 0, err = ERROR_INVALID_DATA;\n\t// Exclude support for the FORMAT_MESSAGE_ALLOCATE_BUFFER special case.\n\tif (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {\n\t\tSetLastError(ERROR_INVALID_PARAMETER);\n\t\treturn 0;\n\t}\n\twalloc(lpBuffer, nSize);\n\tif (wlpBuffer == NULL) {\n\t\tSetLastError(ERROR_NOT_ENOUGH_MEMORY);\n\t\treturn 0;\n\t}\n\tret = FormatMessageW(dwFlags, lpSource, dwMessageId, dwLanguageId, wlpBuffer, nSize, Arguments);\n\terr = GetLastError();\n\tif ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, nSize)) == 0)) {\n\t\terr = GetLastError();\n\t\tret = 0;\n\t}\n\t// Coverity doesn't realise that we filtered out the FORMAT_MESSAGE_ALLOCATE_BUFFER case\n\t// coverity[leaked_storage]\n\twfree(lpBuffer);\n\tSetLastError(err);\n\treturn ret;\n}\n\n// SendMessage, with LPARAM as UTF-8 string\nstatic __inline LRESULT SendMessageLU(HWND hWnd, UINT Msg, WPARAM wParam, const char* lParam)\n{\n\tLRESULT ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lParam);\n\tret = SendMessageW(hWnd, Msg, wParam, (LPARAM)wlParam);\n\terr = GetLastError();\n\twfree(lParam);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline int DrawTextExU(HDC hDC, LPCSTR lpchText, int nCount, LPRECT lpRect, UINT uFormat, LPDRAWTEXTPARAMS lpDTParams)\n{\n\tint ret;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpchText);\n\tret = DrawTextExW(hDC, wlpchText, nCount, lpRect, uFormat, lpDTParams);\n\terr = GetLastError();\n\twfree(lpchText);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL SHGetPathFromIDListU(LPCITEMIDLIST pidl, char* pszPath)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\t// coverity[returned_null]\n\twalloc(pszPath, MAX_PATH);\n\tret = SHGetPathFromIDListW(pidl, wpszPath);\n\terr = GetLastError();\n\tif ((ret) && (wchar_to_utf8_no_alloc(wpszPath, pszPath, MAX_PATH) == 0)) {\n\t\terr = GetLastError();\n\t\tret = FALSE;\n\t}\n\twfree(pszPath);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline HWND CreateWindowU(char* lpClassName, char* lpWindowName,\n\tDWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent,\n\tHMENU hMenu, HINSTANCE hInstance, LPVOID lpParam)\n{\n\tHWND ret = NULL;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpClassName);\n\twconvert(lpWindowName);\n\tret = CreateWindowW(wlpClassName, wlpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);\n\terr = GetLastError();\n\twfree(lpClassName);\n\twfree(lpWindowName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline HWND CreateWindowExU(DWORD dwExStyle, char* lpClassName, char* lpWindowName,\n\tDWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu,\n\tHINSTANCE hInstance, LPVOID lpParam)\n{\n\tHWND ret = NULL;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpClassName);\n\twconvert(lpWindowName);\n\tret = CreateWindowExW(dwExStyle, wlpClassName, wlpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);\n\terr = GetLastError();\n\twfree(lpClassName);\n\twfree(lpWindowName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline int MessageBoxU(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType)\n{\n\tint ret;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpText);\n\twconvert(lpCaption);\n\tret = MessageBoxW(hWnd, wlpText, wlpCaption, uType);\n\terr = GetLastError();\n\twfree(lpText);\n\twfree(lpCaption);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline int MessageBoxExU(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType, WORD wLanguageId)\n{\n\tint ret;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpText);\n\twconvert(lpCaption);\n\tret = MessageBoxExW(hWnd, wlpText, wlpCaption, uType, wLanguageId);\n\terr = GetLastError();\n\twfree(lpText);\n\twfree(lpCaption);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline int LoadStringU(HINSTANCE hInstance, UINT uID, LPSTR lpBuffer, int nBufferMax)\n{\n\tint ret;\n\tDWORD err = ERROR_INVALID_DATA;\n\tif (nBufferMax == 0) {\n\t\t// read-only pointer to resource mode is not supported\n\t\tSetLastError(ERROR_INVALID_PARAMETER);\n\t\treturn 0;\n\t}\n\t// coverity[returned_null]\n\twalloc(lpBuffer, nBufferMax);\n\tret = LoadStringW(hInstance, uID, wlpBuffer, nBufferMax);\n\terr = GetLastError();\n\tif ((ret > 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, nBufferMax)) == 0)) {\n\t\terr = GetLastError();\n\t}\n\twfree(lpBuffer);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline HMODULE LoadLibraryU(LPCSTR lpFileName)\n{\n\tHMODULE ret;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpFileName);\n\tret = LoadLibraryW(wlpFileName);\n\terr = GetLastError();\n\twfree(lpFileName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline HMODULE LoadLibraryExU(LPCSTR lpFileName, HANDLE hFile, DWORD dwFlags)\n{\n\tHMODULE ret;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpFileName);\n\tret = LoadLibraryExW(wlpFileName, hFile, dwFlags);\n\terr = GetLastError();\n\twfree(lpFileName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline int DrawTextU(HDC hDC, LPCSTR lpText, int nCount, LPRECT lpRect, UINT uFormat)\n{\n\tint ret;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpText);\n\tret = DrawTextW(hDC, wlpText, nCount, lpRect, uFormat);\n\terr = GetLastError();\n\twfree(lpText);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline int GetWindowTextU(HWND hWnd, char* lpString, int nMaxCount)\n{\n\tint ret = 0;\n\tDWORD err = ERROR_INVALID_PARAMETER;\n\tif (lpString == NULL || nMaxCount < 1)\n\t\tgoto out;\n\t// Handle the empty string as GetWindowTextW() returns 0 then\n\tlpString[0] = 0;\n\twalloc(lpString, nMaxCount);\n\tret = GetWindowTextW(hWnd, wlpString, nMaxCount);\n\terr = GetLastError();\n\tif ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpString, lpString, nMaxCount)) == 0))\n\t\terr = GetLastError();\n\twfree(lpString);\n\tlpString[nMaxCount - 1] = 0;\nout:\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL SetWindowTextU(HWND hWnd, const char* lpString)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpString);\n\tret = SetWindowTextW(hWnd, wlpString);\n\terr = GetLastError();\n\twfree(lpString);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline int GetWindowTextLengthU(HWND hWnd)\n{\n\tint ret = 0;\n\tDWORD err = ERROR_INVALID_DATA;\n\twchar_t* wbuf = NULL;\n\tchar* buf = NULL;\n\n\tret = GetWindowTextLengthW(hWnd);\n\terr = GetLastError();\n\tif (ret == 0) goto out;\n\twbuf = (wchar_t* )calloc(ret, sizeof(wchar_t));\n\terr = GetLastError();\n\tif (wbuf == NULL) {\n\t\terr = ERROR_OUTOFMEMORY; ret = 0; goto out;\n\t}\n\tret = GetWindowTextW(hWnd, wbuf, ret);\n\terr = GetLastError();\n\tif (ret == 0) goto out;\n\tbuf = wchar_to_utf8(wbuf);\n\terr = GetLastError();\n\tif (buf == NULL) {\n\t\terr = ERROR_OUTOFMEMORY; ret = 0; goto out;\n\t}\n\tret = (int)strlen(buf) + 2;\t// GetDlgItemText seems to add a character\n\terr = GetLastError();\nout:\n\tsfree(wbuf);\n\tsfree(buf);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline UINT GetDlgItemTextU(HWND hDlg, int nIDDlgItem, char* lpString, int nMaxCount)\n{\n\tUINT ret = 0;\n\tDWORD err = ERROR_INVALID_DATA;\n\t// coverity[returned_null]\n\twalloc(lpString, nMaxCount);\n\tret = GetDlgItemTextW(hDlg, nIDDlgItem, wlpString, nMaxCount);\n\terr = GetLastError();\n\tif ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpString, lpString, nMaxCount)) == 0)) {\n\t\terr = GetLastError();\n\t}\n\twfree(lpString);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL SetDlgItemTextU(HWND hDlg, int nIDDlgItem, const char* lpString)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpString);\n\tret = SetDlgItemTextW(hDlg, nIDDlgItem, wlpString);\n\terr = GetLastError();\n\twfree(lpString);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL InsertMenuU(HMENU hMenu, UINT uPosition, UINT uFlags, UINT_PTR uIDNewItem, const char* lpNewItem)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpNewItem);\n\tret = InsertMenuW(hMenu, uPosition, uFlags, uIDNewItem, wlpNewItem);\n\terr = GetLastError();\n\twfree(lpNewItem);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline int ComboBox_GetLBTextU(HWND hCtrl, int index, char* lpString)\n{\n\tint size;\n\tDWORD err = ERROR_INVALID_DATA;\n\twchar_t* wlpString;\n\tif (lpString == NULL)\n\t\treturn CB_ERR;\n\tsize = (int)SendMessageW(hCtrl, CB_GETLBTEXTLEN, (WPARAM)index, (LPARAM)0);\n\tif (size < 0)\n\t\treturn size;\n\twlpString = (wchar_t*)calloc((size_t)size + 1, sizeof(wchar_t));\n\tsize = (int)SendMessageW(hCtrl, CB_GETLBTEXT, (WPARAM)index, (LPARAM)wlpString);\n\terr = GetLastError();\n\tif (size > 0)\n\t\twchar_to_utf8_no_alloc(wlpString, lpString, size+1);\n\twfree(lpString);\n\tSetLastError(err);\n\treturn size;\n}\n\nstatic __inline DWORD CharUpperBuffU(char* lpString, DWORD len)\n{\n\tDWORD ret;\n\twchar_t *wlpString = (wchar_t*)calloc(len, sizeof(wchar_t));\n\tif (wlpString == NULL)\n\t\treturn 0;\n\tutf8_to_wchar_no_alloc(lpString, wlpString, len);\n\tret = CharUpperBuffW(wlpString, len);\n\twchar_to_utf8_no_alloc(wlpString, lpString, len);\n\tfree(wlpString);\n\treturn ret;\n}\n\nstatic __inline HANDLE CreateFileU(const char* lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,\n\t\t\t\t\t\t\t\t   LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,\n\t\t\t\t\t\t\t\t   DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)\n{\n\tHANDLE ret = INVALID_HANDLE_VALUE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpFileName);\n\tret = CreateFileW(wlpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes,\n\t\tdwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);\n\terr = GetLastError();\n\twfree(lpFileName);\n\tSetLastError(err);\n\treturn ret;\n}\n\n// CreateFile() that restricts file access to Admin and System only\nstatic __inline HANDLE CreateFileRestrictedU(const char* lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,\n\t\t\t\t\t\t\t\t   DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes)\n{\n\t// Restrict access to Admin (BA) and System (SY) only\n\tconst char* sddl = \"D:P(A;;FA;;;BA)(A;;FA;;;SY)(A;;FR;;;WD)\";\n\tSECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, FALSE };\n\tHANDLE h;\n\n\tif (!ConvertStringSecurityDescriptorToSecurityDescriptorA(sddl, 1, &sa.lpSecurityDescriptor, NULL))\n\t\treturn INVALID_HANDLE_VALUE;\n\th = CreateFileU(lpFileName, dwDesiredAccess, dwShareMode, &sa, dwCreationDisposition, dwFlagsAndAttributes, NULL);\n\tLocalFree(sa.lpSecurityDescriptor);\n\treturn h;\n}\n\nstatic __inline BOOL CreateDirectoryU(const char* lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpPathName);\n\tret = CreateDirectoryW(wlpPathName, lpSecurityAttributes);\n\terr = GetLastError();\n\twfree(lpPathName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL CopyFileU(const char* lpExistingFileName, const char* lpNewFileName, BOOL bFailIfExists)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpExistingFileName);\n\twconvert(lpNewFileName);\n\tret = CopyFileW(wlpExistingFileName, wlpNewFileName, bFailIfExists);\n\terr = GetLastError();\n\twfree(lpExistingFileName);\n\twfree(lpNewFileName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL DeleteFileU(const char* lpFileName)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpFileName);\n\tret = DeleteFileW(wlpFileName);\n\terr = GetLastError();\n\twfree(lpFileName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL PathFileExistsU(char* szPath)\n{\n\tBOOL ret;\n\twconvert(szPath);\n\tret = PathFileExistsW(wszPath);\n\twfree(szPath);\n\treturn ret;\n}\n\nstatic __inline int PathGetDriveNumberU(char* lpPath)\n{\n\tint ret = 0;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpPath);\n\tret = PathGetDriveNumberW(wlpPath);\n\terr = GetLastError();\n\twfree(lpPath);\n\tSetLastError(err);\n\treturn ret;\n}\n\n// This one is tricky since we can't blindly convert a\n// UTF-16 position to a UTF-8 one. So we do it manually.\nstatic __inline const char* PathFindFileNameU(const char* szPath)\n{\n\tsize_t i;\n\tif (szPath == NULL)\n\t\treturn NULL;\n\tfor (i = strlen(szPath); i != 0; i--) {\n\t\tif ((szPath[i] == '/') || (szPath[i] == '\\\\')) {\n\t\t\ti++;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn &szPath[i];\n}\n\nstatic __inline char* PathCombineU(char* lpDest, char* lpDir, char* lpFile)\n{\n\twchar_t* wret = NULL;\n\tDWORD err = ERROR_INVALID_DATA;\n\twchar_t wlpDest[MAX_PATH];\n\twconvert(lpDir);\n\twconvert(lpFile);\n\twret = PathCombineW(wlpDest, wlpDir, wlpFile);\n\terr = GetLastError();\n\twfree(lpDir);\n\twfree(lpFile);\n\tif (wret == NULL)\n\t\treturn NULL;\n\twchar_to_utf8_no_alloc(wlpDest, lpDest, MAX_PATH);\n\tSetLastError(err);\n\treturn lpDest;\n}\n\nstatic __inline HANDLE FindFirstFileU(char* lpFileName, LPWIN32_FIND_DATAA lpFindFileData)\n{\n\tHANDLE ret = INVALID_HANDLE_VALUE;\n\tWIN32_FIND_DATAW wFindFileData = { 0 };\n\twconvert(lpFileName);\n\tret = FindFirstFileW(wlpFileName, &wFindFileData);\n\tif (ret != INVALID_HANDLE_VALUE) {\n\t\tmemcpy(lpFindFileData, &wFindFileData, offsetof(WIN32_FIND_DATAW, cFileName));\n\t\twchar_to_utf8_no_alloc(wFindFileData.cFileName, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName));\n\t\twchar_to_utf8_no_alloc(wFindFileData.cAlternateFileName, lpFindFileData->cAlternateFileName, sizeof(lpFindFileData->cAlternateFileName));\n\t}\n\twfree(lpFileName);\n\treturn ret;\n}\n\nstatic __inline BOOL FindNextFileU(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData)\n{\n\tBOOL ret = FALSE;\n\tWIN32_FIND_DATAW wFindFileData = { 0 };\n\tret = FindNextFileW(hFindFile, &wFindFileData);\n\tif (ret) {\n\t\tmemcpy(lpFindFileData, &wFindFileData, offsetof(WIN32_FIND_DATAW, cFileName));\n\t\twchar_to_utf8_no_alloc(wFindFileData.cFileName, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName));\n\t\twchar_to_utf8_no_alloc(wFindFileData.cAlternateFileName, lpFindFileData->cAlternateFileName, sizeof(lpFindFileData->cAlternateFileName));\n\t}\n\treturn ret;\n}\n\n// This function differs from regular GetTextExtentPoint in that it uses a zero terminated string\nstatic __inline BOOL GetTextExtentPointU(HDC hdc, const char* lpString, LPSIZE lpSize)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpString);\n\tif (wlpString == NULL)\n\t\treturn FALSE;\n\tret = GetTextExtentPoint32W(hdc, wlpString, (int)wcslen(wlpString), lpSize);\n\terr = GetLastError();\n\twfree(lpString);\n\tSetLastError(err);\n\treturn ret;\n}\n\n// Gets the directory where the executable resises, through GetModuleFileName()\nstatic __inline DWORD GetAppDirectoryU(DWORD nBufferLength, char* lpBuffer)\n{\n\tDWORD i, ret = 0, err = ERROR_INVALID_DATA;\n\t// coverity[returned_null]\n\twalloc(lpBuffer, nBufferLength);\n\tif (wlpBuffer == NULL) {\n\t\tSetLastError(ERROR_OUTOFMEMORY);\n\t\treturn 0;\n\t}\n\tret = GetModuleFileNameW(NULL, wlpBuffer, nBufferLength);\n\terr = GetLastError();\n\tif (ret > 0) {\n\t\tfor (i = ret - 1; i > 0; i--) {\n\t\t\tif (wlpBuffer[i] == L'\\\\') {\n\t\t\t\twlpBuffer[i] = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, nBufferLength)) == 0)) {\n\t\terr = GetLastError();\n\t}\n\twfree(lpBuffer);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline UINT GetSystemDirectoryU(char* lpBuffer, UINT uSize)\n{\n\tUINT ret = 0, err = ERROR_INVALID_DATA;\n\t// coverity[returned_null]\n\twalloc(lpBuffer, uSize);\n\tret = GetSystemDirectoryW(wlpBuffer, uSize);\n\terr = GetLastError();\n\tif ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, uSize)) == 0)) {\n\t\terr = GetLastError();\n\t}\n\twfree(lpBuffer);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline UINT GetSystemWindowsDirectoryU(char* lpBuffer, UINT uSize)\n{\n\tUINT ret = 0, err = ERROR_INVALID_DATA;\n\t// coverity[returned_null]\n\twalloc(lpBuffer, uSize);\n\tret = GetSystemWindowsDirectoryW(wlpBuffer, uSize);\n\terr = GetLastError();\n\tif ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, uSize)) == 0)) {\n\t\terr = GetLastError();\n\t}\n\twfree(lpBuffer);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL SHGetSpecialFolderPathU(HWND hwnd, char* pszPath, int csidl, BOOL fCreate)\n{\n\tBOOL ret;\n\tDWORD err = ERROR_INVALID_DATA;\n\t// pszPath is at least MAX_PATH characters in size\n\tWCHAR wpszPath[MAX_PATH] = { 0 };\n\tret = SHGetSpecialFolderPathW(hwnd, wpszPath, csidl, fCreate);\n\terr = GetLastError();\n\twchar_to_utf8_no_alloc(wpszPath, pszPath, MAX_PATH);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline DWORD GetTempPathU(DWORD nBufferLength, char* lpBuffer)\n{\n\tDWORD ret = 0, err = ERROR_INVALID_DATA;\n\t// coverity[returned_null]\n\twalloc(lpBuffer, nBufferLength);\n\tret = GetTempPathW(nBufferLength, wlpBuffer);\n\terr = GetLastError();\n\tif ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, nBufferLength)) == 0)) {\n\t\terr = GetLastError();\n\t}\n\twfree(lpBuffer);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline DWORD GetTempFileNameU(char* lpPathName, char* lpPrefixString, UINT uUnique, char* lpTempFileName)\n{\n\tDWORD ret = 0, err = ERROR_INVALID_DATA;\n\twconvert(lpPathName);\n\twconvert(lpPrefixString);\n\t// coverity[returned_null]\n\twalloc(lpTempFileName, MAX_PATH);\n\tret = GetTempFileNameW(wlpPathName, wlpPrefixString, uUnique, wlpTempFileName);\n\terr = GetLastError();\n\tif ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpTempFileName, lpTempFileName, MAX_PATH)) == 0)) {\n\t\terr = GetLastError();\n\t}\n\twfree(lpTempFileName);\n\twfree(lpPrefixString);\n\twfree(lpPathName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline DWORD GetTempDirNameU(char* lpPathName, char* lpPrefixString, UINT uUnique, char* lpTempDirName)\n{\n\tDWORD ret = GetTempFileNameU(lpPathName, lpPrefixString, uUnique, lpTempDirName);\n\tif (ret != 0) {\n\t\tDeleteFileU(lpTempDirName);\n\t\tif (!CreateDirectoryU(lpTempDirName, NULL))\n\t\t\tret = 0;\n\t}\n\treturn ret;\n}\n\nstatic __inline DWORD GetModuleFileNameU(HMODULE hModule, char* lpFilename, DWORD nSize)\n{\n\tDWORD ret = 0, err = ERROR_INVALID_DATA;\n\t// coverity[returned_null]\n\twalloc(lpFilename, nSize);\n\tret = GetModuleFileNameW(hModule, wlpFilename, nSize);\n\terr = GetLastError();\n\tif ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpFilename, lpFilename, nSize)) == 0)) {\n\t\terr = GetLastError();\n\t}\n\twfree(lpFilename);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline DWORD GetModuleFileNameExU(HANDLE hProcess, HMODULE hModule, char* lpFilename, DWORD nSize)\n{\n\tDWORD ret = 0, err = ERROR_INVALID_DATA;\n\t// coverity[returned_null]\n\twalloc(lpFilename, nSize);\n\tret = GetModuleFileNameExW(hProcess, hModule, wlpFilename, nSize);\n\terr = GetLastError();\n\tif ((ret != 0)\n\t\t&& ((ret = wchar_to_utf8_no_alloc(wlpFilename, lpFilename, nSize)) == 0)) {\n\t\terr = GetLastError();\n\t}\n\twfree(lpFilename);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline DWORD GetFinalPathNameByHandleU(HANDLE hFile, char* lpszFilePath, DWORD cchFilePath, DWORD dwFlags)\n{\n\tDWORD ret = 0, err = ERROR_INVALID_DATA;\n\twalloc(lpszFilePath, cchFilePath);\n\tret = GetFinalPathNameByHandleW(hFile, wlpszFilePath, cchFilePath, dwFlags);\n\terr = GetLastError();\n\tif ((ret != 0)\n\t\t&& ((ret = wchar_to_utf8_no_alloc(wlpszFilePath, lpszFilePath, cchFilePath)) == 0)) {\n\t\terr = GetLastError();\n\t}\n\twfree(lpszFilePath);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline DWORD GetFileVersionInfoSizeU(const char* lpFileName, LPDWORD lpdwHandle)\n{\n\tDWORD ret = 0, err = ERROR_INVALID_DATA;\n\twconvert(lpFileName);\n\tret = GetFileVersionInfoSizeW(wlpFileName, lpdwHandle);\n\terr = GetLastError();\n\twfree(lpFileName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL GetFileVersionInfoU(const char* lpFileName, DWORD dwHandle, DWORD dwLen, LPVOID lpData)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpFileName);\n\tif (dwHandle != 0)\n\t\tSetLastError(ERROR_INVALID_PARAMETER);\n\telse\n\t\tret = GetFileVersionInfoW(wlpFileName, dwHandle, dwLen, lpData);\n\terr = GetLastError();\n\twfree(lpFileName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline DWORD GetFullPathNameU(const char* lpFileName, DWORD nBufferLength, char* lpBuffer, char** lpFilePart)\n{\n\tDWORD ret = 0, err = ERROR_INVALID_DATA;\n\twchar_t* wlpFilePart;\n\twconvert(lpFileName);\n\t// coverity[returned_null]\n\twalloc(lpBuffer, nBufferLength);\n\n\t// lpFilePart is not supported\n\tif (lpFilePart != NULL) goto out;\n\n\tret = GetFullPathNameW(wlpFileName, nBufferLength, wlpBuffer, &wlpFilePart);\n\terr = GetLastError();\n\tif ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, nBufferLength)) == 0)) {\n\t\terr = GetLastError();\n\t}\n\nout:\n\twfree(lpBuffer);\n\twfree(lpFileName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline DWORD GetFileAttributesU(const char* lpFileName)\n{\n\tDWORD ret = 0xFFFFFFFF, err = ERROR_INVALID_DATA;\n\twconvert(lpFileName);\n\t// Unlike Microsoft's version, ours doesn't fail if the string is quoted\n\tif ((wlpFileName[0] == L'\"') && (wlpFileName[wcslen(wlpFileName) - 1] == L'\"')) {\n\t\twlpFileName[wcslen(wlpFileName) - 1] = 0;\n\t\tret = GetFileAttributesW(&wlpFileName[1]);\n\t} else {\n\t\tret = GetFileAttributesW(wlpFileName);\n\t}\n\terr = GetLastError();\n\twfree(lpFileName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL SetFileAttributesU(const char* lpFileName, DWORD dwFileAttributes)\n{\n\tBOOL ret = FALSE, err = ERROR_INVALID_DATA;\n\twconvert(lpFileName);\n\t// Unlike Microsoft's version, ours doesn't fail if the string is quoted\n\tif ((wlpFileName[0] == L'\"') && (wlpFileName[wcslen(wlpFileName) - 1] == L'\"')) {\n\t\twlpFileName[wcslen(wlpFileName) - 1] = 0;\n\t\tret = SetFileAttributesW(&wlpFileName[1], dwFileAttributes);\n\t} else {\n\t\tret = SetFileAttributesW(wlpFileName, dwFileAttributes);\n\t}\n\terr = GetLastError();\n\twfree(lpFileName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline DWORD GetNamedSecurityInfoU(const char* lpObjectName, SE_OBJECT_TYPE ObjectType,\n\tSECURITY_INFORMATION SecurityInfo, PSID* ppsidOwner, PSID* ppsidGroup, PACL* ppDacl,\n\tPACL* ppSacl, PSECURITY_DESCRIPTOR* ppSecurityDescriptor)\n{\n\tDWORD ret;\n\twconvert(lpObjectName);\n\tret = GetNamedSecurityInfoW(wlpObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup,\n\t\tppDacl, ppSacl, ppSecurityDescriptor);\n\twfree(lpObjectName);\n\treturn ret;\n}\n\nstatic __inline DWORD SetNamedSecurityInfoU(const char* lpObjectName, SE_OBJECT_TYPE ObjectType,\n\tSECURITY_INFORMATION SecurityInfo, PSID psidOwner, PSID psidGroup, PACL pDacl, PACL pSacl)\n{\n\tDWORD ret;\n\twconvert(lpObjectName);\n\tret = SetNamedSecurityInfoW(wlpObjectName, ObjectType, SecurityInfo, psidOwner, psidGroup, pDacl, pSacl);\n\twfree(lpObjectName);\n\treturn ret;\n}\n\nstatic __inline int SHCreateDirectoryExU(HWND hwnd, const char* pszPath, SECURITY_ATTRIBUTES *psa)\n{\n\tint ret = ERROR_INVALID_DATA;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(pszPath);\n\tret = SHCreateDirectoryExW(hwnd, wpszPath, psa);\n\terr = GetLastError();\n\twfree(pszPath);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline int SHDeleteDirectoryExU(HWND hwnd, const char* pszPath, FILEOP_FLAGS fFlags)\n{\n\tint ret;\n\t// String needs to be double NULL terminated, so we just use the length of the UTF-8 string\n\t// which is always expected to be larger than our UTF-16 one, and add 2 chars for good measure.\n\tsize_t wpszPath_len = (pszPath == NULL) ? 0 : strlen(pszPath) + 2;\n\t// coverity[returned_null]\n\twalloc(pszPath, wpszPath_len);\n\tSHFILEOPSTRUCTW shfo = { hwnd, FO_DELETE, wpszPath, NULL, fFlags, FALSE, NULL, NULL };\n\tutf8_to_wchar_no_alloc(pszPath, wpszPath, (int)wpszPath_len);\n\t// FOF_SILENT | FOF_NOERRORUI | FOF_NOCONFIRMATION,\n\tret = SHFileOperationW(&shfo);\n\twfree(pszPath);\n\treturn ret;\n}\n\nstatic __inline BOOL ShellExecuteExU(SHELLEXECUTEINFOA* lpExecInfo)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\tSHELLEXECUTEINFOW wExecInfo;\n\n\t// Because we're lazy, we'll assume that the A and W structs inherently have the same size\n\tif (lpExecInfo->cbSize != sizeof(SHELLEXECUTEINFOW)) {\n\t\tSetLastError(ERROR_BAD_LENGTH); return FALSE;\n\t}\n\tmemcpy(&wExecInfo, lpExecInfo, lpExecInfo->cbSize);\n\twExecInfo.lpVerb = utf8_to_wchar(lpExecInfo->lpVerb);\n\twExecInfo.lpFile = utf8_to_wchar(lpExecInfo->lpFile);\n\twExecInfo.lpParameters = utf8_to_wchar(lpExecInfo->lpParameters);\n\twExecInfo.lpDirectory = utf8_to_wchar(lpExecInfo->lpDirectory);\n\tif (wExecInfo.fMask & SEE_MASK_CLASSNAME) {\n\t\twExecInfo.lpClass = utf8_to_wchar(lpExecInfo->lpClass);\n\t} else {\n\t\twExecInfo.lpClass = NULL;\n\t}\n\tret = ShellExecuteExW(&wExecInfo);\n\terr = GetLastError();\n\t// Copy the returned values back\n\tlpExecInfo->hInstApp = wExecInfo.hInstApp;\n\tlpExecInfo->hProcess = wExecInfo.hProcess;\n\tsfree(wExecInfo.lpVerb);\n\tsfree(wExecInfo.lpFile);\n\tsfree(wExecInfo.lpParameters);\n\tsfree(wExecInfo.lpDirectory);\n\tsfree(wExecInfo.lpClass);\n\tSetLastError(err);\n\treturn ret;\n}\n\n// Doesn't support LPSTARTUPINFOEX struct\nstatic __inline BOOL CreateProcessU(const char* lpApplicationName, const char* lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes,\n\t\t\t\t\t\t\t\t\tLPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags,\n\t\t\t\t\t\t\t\t\tLPVOID lpEnvironment, const char* lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo,\n\t\t\t\t\t\t\t\t\tLPPROCESS_INFORMATION lpProcessInformation)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\tSTARTUPINFOW wStartupInfo;\n\twconvert(lpApplicationName);\n\twconvert(lpCommandLine);\n\twconvert(lpCurrentDirectory);\n\n\t// Because we're lazy, we'll assume that the A and W structs inherently have the same size\n\t// Also prevents the use of STARTUPINFOEX\n\tif (lpStartupInfo->cb != sizeof(STARTUPINFOW)) {\n\t\terr = ERROR_BAD_LENGTH; goto out;\n\t}\n\tmemcpy(&wStartupInfo, lpStartupInfo, lpStartupInfo->cb);\n\twStartupInfo.lpDesktop = utf8_to_wchar(lpStartupInfo->lpDesktop);\n\twStartupInfo.lpTitle = utf8_to_wchar(lpStartupInfo->lpTitle);\n\tret = CreateProcessW(wlpApplicationName, wlpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles,\n\t\tdwCreationFlags, lpEnvironment, wlpCurrentDirectory, &wStartupInfo, lpProcessInformation);\n\terr = GetLastError();\n\tsfree(wStartupInfo.lpDesktop);\n\tsfree(wStartupInfo.lpTitle);\nout:\n\twfree(lpApplicationName);\n\twfree(lpCommandLine);\n\twfree(lpCurrentDirectory);\n\tSetLastError(err);\n\treturn ret;\n}\n\n// NOTE: when used, nFileOffset & nFileExtension MUST be provided\n// in number of Unicode characters, NOT number of UTF-8 bytes\nstatic __inline BOOL WINAPI GetOpenSaveFileNameU(LPOPENFILENAMEA lpofn, BOOL save)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\tsize_t i, len;\n\tOPENFILENAMEW wofn;\n\tmemset(&wofn, 0, sizeof(wofn));\n\twofn.lStructSize = sizeof(wofn);\n\twofn.hwndOwner = lpofn->hwndOwner;\n\twofn.hInstance = lpofn->hInstance;\n\n\t// No support for custom filters\n\tif (lpofn->lpstrCustomFilter != NULL) goto out;\n\n\t// Count on Microsoft to use an moronic scheme for filters\n\t// that relies on NULL separators and double NULL terminators\n\tif (lpofn->lpstrFilter != NULL) {\n\t\t// Replace the NULLs by something that can be converted\n\t\tfor (i=0; ; i++) {\n\t\t\tif (lpofn->lpstrFilter[i] == 0) {\n\t\t\t\t((char*)lpofn->lpstrFilter)[i] = '\\r';\n\t\t\t\tif (lpofn->lpstrFilter[i+1] == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twofn.lpstrFilter = utf8_to_wchar(lpofn->lpstrFilter);\n\t\t// And revert\n\t\tlen = wcslen(wofn.lpstrFilter);\t// don't use in the loop as it would be reevaluated\n\t\tfor (i=0; i<len; i++) {\n\t\t\tif (wofn.lpstrFilter[i] == '\\r') {\n\t\t\t\t((wchar_t*)wofn.lpstrFilter)[i] = 0;\n\t\t\t}\n\t\t}\n\t\tlen = strlen(lpofn->lpstrFilter);\n\t\tfor (i=0; i<len; i++) {\n\t\t\tif (lpofn->lpstrFilter[i] == '\\r') {\n\t\t\t\t((char*)lpofn->lpstrFilter)[i] = 0;\n\t\t\t}\n\t\t}\n\t} else {\n\t\twofn.lpstrFilter = NULL;\n\t}\n\twofn.nMaxCustFilter = lpofn->nMaxCustFilter;\n\twofn.nFilterIndex = lpofn->nFilterIndex;\n\twofn.lpstrFile = (LPWSTR)calloc(lpofn->nMaxFile, sizeof(wchar_t));\n\tutf8_to_wchar_no_alloc(lpofn->lpstrFile, wofn.lpstrFile, lpofn->nMaxFile);\n\twofn.nMaxFile = lpofn->nMaxFile;\n\twofn.lpstrFileTitle = (LPWSTR)calloc(lpofn->nMaxFileTitle, sizeof(wchar_t));\n\tutf8_to_wchar_no_alloc(lpofn->lpstrFileTitle, wofn.lpstrFileTitle, lpofn->nMaxFileTitle);\n\twofn.nMaxFileTitle = lpofn->nMaxFileTitle;\n\twofn.lpstrInitialDir = utf8_to_wchar(lpofn->lpstrInitialDir);\n\twofn.lpstrTitle = utf8_to_wchar(lpofn->lpstrTitle);\n\twofn.Flags = lpofn->Flags;\n\twofn.nFileOffset = lpofn->nFileOffset;\n\twofn.nFileExtension = lpofn->nFileExtension;\n\twofn.lpstrDefExt = utf8_to_wchar(lpofn->lpstrDefExt);\n\twofn.lCustData = lpofn->lCustData;\n\twofn.lpfnHook = lpofn->lpfnHook;\n\twofn.lpTemplateName = utf8_to_wchar(lpofn->lpTemplateName);\n\twofn.pvReserved = lpofn->pvReserved;\n\twofn.dwReserved = lpofn->dwReserved;\n\twofn.FlagsEx = lpofn->FlagsEx;\n\n\tif (save) {\n\t\tret = GetSaveFileNameW(&wofn);\n\t} else {\n\t\tret = GetOpenFileNameW(&wofn);\n\t}\n\terr = GetLastError();\n\tif ( (ret)\n\t  && ( (wchar_to_utf8_no_alloc(wofn.lpstrFile, lpofn->lpstrFile, lpofn->nMaxFile) == 0)\n\t    || (wchar_to_utf8_no_alloc(wofn.lpstrFileTitle, lpofn->lpstrFileTitle, lpofn->nMaxFileTitle) == 0) ) ) {\n\t\terr = GetLastError();\n\t\tret = FALSE;\n\t}\nout:\n\tsfree(wofn.lpstrDefExt);\n\tsfree(wofn.lpstrFile);\n\tsfree(wofn.lpstrFileTitle);\n\tsfree(wofn.lpstrFilter);\n\tsfree(wofn.lpstrInitialDir);\n\tsfree(wofn.lpstrTitle);\n\tsfree(wofn.lpTemplateName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nextern BOOL WINAPI UpdateDriverForPlugAndPlayDevicesW(HWND hwndParent, LPCWSTR HardwareId,\n\tLPCWSTR FullInfPath, DWORD InstallFlags, PBOOL bRebootRequired);\n\nstatic __inline BOOL UpdateDriverForPlugAndPlayDevicesU(HWND hwndParent, const char* HardwareId, const char* FullInfPath,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDWORD InstallFlags, PBOOL bRebootRequired)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(HardwareId);\n\twconvert(FullInfPath);\n\tret = UpdateDriverForPlugAndPlayDevicesW(hwndParent, wHardwareId, wFullInfPath, InstallFlags, bRebootRequired);\n\terr = GetLastError();\n\twfree(HardwareId);\n\twfree(FullInfPath);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL SetupCopyOEMInfU(const char* SourceInfFileName, const char* OEMSourceMediaLocation, DWORD OEMSourceMediaType,\n\t\t\t\t\t\t\t\t\t  DWORD CopyStyle, char* DestinationInfFileName, DWORD DestinationInfFileNameSize,\n\t\t\t\t\t\t\t\t\t  PDWORD RequiredSize, PTSTR DestinationInfFileNameComponent)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(SourceInfFileName);\n\twconvert(OEMSourceMediaLocation);\n\t// coverity[returned_null]\n\twalloc(DestinationInfFileName, DestinationInfFileNameSize);\n\n\t// DestinationInfFileNameComponent is not supported\n\tif (DestinationInfFileNameComponent != NULL) goto out;\n\n\tret = SetupCopyOEMInfW(wSourceInfFileName, wOEMSourceMediaLocation, OEMSourceMediaType, CopyStyle,\n\t\twDestinationInfFileName, DestinationInfFileNameSize, RequiredSize, NULL);\n\terr = GetLastError();\n\tif ((ret != FALSE) && ((ret = wchar_to_utf8_no_alloc(wDestinationInfFileName, DestinationInfFileName, DestinationInfFileNameSize)) == 0)) {\n\t\terr = GetLastError();\n\t}\nout:\n\twfree(SourceInfFileName);\n\twfree(OEMSourceMediaLocation);\n\twfree(DestinationInfFileName);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline int _chdirU(const char *dirname)\n{\n\tint ret;\n\twconvert(dirname);\n\tret = _wchdir(wdirname);\n\twfree(dirname);\n\treturn ret;\n}\n\n#if defined(_WIN32_WINNT) && (_WIN32_WINNT <= 0x501)\nstatic __inline FILE* fopenU(const char* filename, const char* mode)\n{\n\tFILE* ret = NULL;\n\twconvert(filename);\n\twconvert(mode);\n\tret = _wfopen(wfilename, wmode);\n\twfree(filename);\n\twfree(mode);\n\treturn ret;\n}\n\nstatic __inline int _openU(const char *filename, int oflag, int pmode)\n{\n\tint ret = -1;\n\twconvert(filename);\n\tret = _wopen(wfilename, oflag, pmode);\n\twfree(filename);\n\treturn ret;\n}\n#else\nstatic __inline FILE* fopenU(const char* filename, const char* mode)\n{\n\tFILE* ret = NULL;\n\twconvert(filename);\n\twconvert(mode);\n\t_wfopen_s(&ret, wfilename, wmode);\n\twfree(filename);\n\twfree(mode);\n\treturn ret;\n}\n\nstatic __inline int _openU(const char *filename, int oflag , int pmode)\n{\n\tint ret = -1;\n\tint shflag = _SH_DENYNO;\n\twconvert(filename);\n\t// Try to match the share flag to the oflag\n\tif ((oflag & 0x03) == _O_RDONLY)\n\t\tshflag = _SH_DENYWR;\n\telse if ((oflag & 0x03) == _O_WRONLY)\n\t\tshflag = _SH_DENYRD;\n\t_wsopen_s(&ret, wfilename, oflag, shflag, pmode);\n\twfree(filename);\n\treturn ret;\n}\n#endif\n\nstatic __inline int _unlinkU(const char* path)\n{\n\tint ret;\n\twconvert(path);\n\tret = _wunlink(wpath);\n\twfree(path);\n\treturn ret;\n}\n\nstatic __inline int _stat64U(const char *path, struct __stat64 *buffer)\n{\n\tint ret;\n\twconvert(path);\n\tret = _wstat64(wpath, buffer);\n\twfree(path);\n\treturn ret;\n}\n\nstatic __inline int _accessU(const char* path, int mode)\n{\n\tint ret;\n\twconvert(path);\n\tret = _waccess(wpath, mode);\n\twfree(path);\n\treturn ret;\n}\n\nstatic __inline const char* _filenameU(const char* path)\n{\n\tint i;\n\tif (path == NULL)\n\t\treturn NULL;\n\tfor (i = (int)strlen(path) - 1; i >= 0; i--)\n\t\tif ((path[i] == '/') || (path[i] == '\\\\'))\n\t\t\treturn &path[i + 1];\n\treturn path;\n}\n\nstatic __inline uint64_t _filesizeU(const char* path)\n{\n\tstruct __stat64 stat64 = { 0 };\n\t_stat64U(path, &stat64);\n\treturn stat64.st_size;\n}\n\n// returned UTF-8 string must be freed\nstatic __inline char* getenvU(const char* varname)\n{\n\twconvert(varname);\n\tchar* ret = NULL;\n\twchar_t* wbuf = NULL;\n\t// _wgetenv() is *BROKEN* in MS compilers => use GetEnvironmentVariableW()\n\tDWORD dwSize = GetEnvironmentVariableW(wvarname, wbuf, 0);\n\twbuf = (wchar_t*)calloc(dwSize, sizeof(wchar_t));\n\tif (wbuf == NULL) {\n\t\twfree(varname);\n\t\treturn NULL;\n\t}\n\tdwSize = GetEnvironmentVariableW(wvarname, wbuf, dwSize);\n\tif (dwSize != 0)\n\t\tret = wchar_to_utf8(wbuf);\n\tfree(wbuf);\n\twfree(varname);\n\treturn ret;\n}\n\nstatic __inline int _mkdirU(const char* dirname)\n{\n\twconvert(dirname);\n\tint ret;\n\tret = _wmkdir(wdirname);\n\twfree(dirname);\n\treturn ret;\n}\n\n// This version of _mkdirU creates all needed directories along the way\nstatic __inline int _mkdirExU(const char* dirname)\n{\n\tint ret = -1, trailing_slash = -1;\n\tsize_t i, len;\n\twconvert(dirname);\n\tlen = wcslen(wdirname);\n\twhile (trailing_slash && (len > 0)) {\n\t\tif ((wdirname[len - 1] == '\\\\') || (wdirname[len - 1] == '/'))\n\t\t\twdirname[--len] = 0;\n\t\telse\n\t\t\ttrailing_slash = 0;\n\t}\n\tfor (i = 0; i < len; i++)\n\t\tif ((wdirname[i] == '\\\\') || (wdirname[i] == '/'))\n\t\t\twdirname[i] = 0;\n\tfor (i = 0; i < len; ) {\n\t\tif ((_wmkdir(wdirname) < 0) && (errno != EEXIST) && (errno != EACCES))\n\t\t\tgoto out;\n\t\ti = wcslen(wdirname);\n\t\twdirname[i] = '\\\\';\n\t}\n\tret = 0;\nout:\n\twfree(dirname);\n\treturn ret;\n}\n\nstatic __inline int _rmdirU(const char* dirname)\n{\n\twconvert(dirname);\n\tint ret;\n\tret = _wrmdir(wdirname);\n\twfree(dirname);\n\treturn ret;\n}\n\nstatic __inline BOOL MoveFileU(const char* lpExistingFileName, const char* lpNewFileName)\n{\n\twconvert(lpExistingFileName);\n\twconvert(lpNewFileName);\n\tBOOL ret = MoveFileW(wlpExistingFileName, wlpNewFileName);\n\twfree(lpNewFileName);\n\twfree(lpExistingFileName);\n\treturn ret;\n}\n\nstatic __inline BOOL MoveFileExU(const char* lpExistingFileName, const char* lpNewFileName, DWORD dwFlags)\n{\n\twconvert(lpExistingFileName);\n\twconvert(lpNewFileName);\n\tBOOL ret = MoveFileExW(wlpExistingFileName, wlpNewFileName, dwFlags);\n\twfree(lpNewFileName);\n\twfree(lpExistingFileName);\n\treturn ret;\n}\n\nstatic __inline BOOL CreateSymbolicLinkU(const char* lpSymlinkFileName, const char* lpTargetFileName, DWORD dwFlags)\n{\n\twconvert(lpSymlinkFileName);\n\twconvert(lpTargetFileName);\n\tBOOL ret = CreateSymbolicLinkW(wlpSymlinkFileName, wlpTargetFileName, dwFlags);\n\twfree(lpTargetFileName);\n\twfree(lpSymlinkFileName);\n\treturn ret;\n}\n\n// The following expects PropertyBuffer to contain a single Unicode string\nstatic __inline BOOL SetupDiGetDeviceRegistryPropertyU(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData,\n\tDWORD Property, PDWORD PropertyRegDataType, PBYTE PropertyBuffer, DWORD PropertyBufferSize, PDWORD RequiredSize)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\t// coverity[returned_null]\n\twalloc(PropertyBuffer, PropertyBufferSize);\n\n\tret = SetupDiGetDeviceRegistryPropertyW(DeviceInfoSet, DeviceInfoData, Property,\n\t\tPropertyRegDataType, (PBYTE)wPropertyBuffer, PropertyBufferSize, RequiredSize);\n\terr = GetLastError();\n\tif ((ret != 0) && (wchar_to_utf8_no_alloc(wPropertyBuffer,\n\t\t(char*)(uintptr_t)PropertyBuffer, PropertyBufferSize) == 0)) {\n\t\terr = GetLastError();\n\t\tret = FALSE;\n\t}\n\twfree(PropertyBuffer);\n\tSetLastError(err);\n\treturn ret;\n}\n\n// NB: This does not support the ERROR_INSUFFICIENT_BUFFER dance to retrieve the required buffer size\nstatic __inline BOOL GetUserNameU(LPSTR lpBuffer, LPDWORD pcbBuffer)\n{\n\tBOOL ret;\n\tDWORD err, size;\n\tif (lpBuffer == NULL || pcbBuffer == NULL) {\n\t\tSetLastError(ERROR_INVALID_PARAMETER);\n\t\treturn FALSE;\n\t}\n\tsize = *pcbBuffer;\n\t// coverity[returned_null]\n\twalloc(lpBuffer, size);\n\tret = GetUserNameW(wlpBuffer, &size);\n\terr = GetLastError();\n\tif (ret) {\n\t\t*pcbBuffer = (DWORD)wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, size);\n\t\tif (*pcbBuffer == 0)\n\t\t\terr = GetLastError();\n\t\telse\n\t\t\t// Reported size includes the NUL terminator\n\t\t\t(*pcbBuffer)++;\n\t}\n\twfree(lpBuffer);\n\tSetLastError(err);\n\treturn ret;\n}\n\nstatic __inline BOOL GetVolumeInformationU(LPCSTR lpRootPathName, LPSTR lpVolumeNameBuffer,\n\tDWORD nVolumeNameSize, LPDWORD lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength,\n\tLPDWORD lpFileSystemFlags, LPSTR lpFileSystemNameBuffer, DWORD nFileSystemNameSize)\n{\n\tBOOL ret = FALSE;\n\tDWORD err = ERROR_INVALID_DATA;\n\twconvert(lpRootPathName);\n\t// coverity[returned_null]\n\twalloc(lpVolumeNameBuffer, nVolumeNameSize);\n\t// coverity[returned_null]\n\twalloc(lpFileSystemNameBuffer, nFileSystemNameSize);\n\n\tret = GetVolumeInformationW(wlpRootPathName, wlpVolumeNameBuffer, nVolumeNameSize,\n\t\tlpVolumeSerialNumber, lpMaximumComponentLength, lpFileSystemFlags,\n\t\twlpFileSystemNameBuffer, nFileSystemNameSize);\n\terr = GetLastError();\n\tif (ret) {\n\t\tif ( ((lpVolumeNameBuffer != NULL) && (wchar_to_utf8_no_alloc(wlpVolumeNameBuffer,\n\t\t\tlpVolumeNameBuffer, nVolumeNameSize) == 0))\n\t\t  || ((lpFileSystemNameBuffer != NULL) && (wchar_to_utf8_no_alloc(wlpFileSystemNameBuffer,\n\t\t\tlpFileSystemNameBuffer, nFileSystemNameSize) == 0)) ) {\n\t\t\terr = GetLastError();\n\t\t\tret = FALSE;\n\t\t}\n\t}\n\twfree(lpVolumeNameBuffer);\n\twfree(lpFileSystemNameBuffer);\n\twfree(lpRootPathName);\n\tSetLastError(err);\n\treturn ret;\n}\n\n#ifdef __cplusplus\n}\n#endif\n"
  },
  {
    "path": "src/msvc-missing/unistd.h",
    "content": "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file was originally part of the w64 mingw-runtime package.\n */\n\n/* Workaround unistd.h for MS compilers */\n\n#ifndef _MSC_VER\n#error This header should only be used with Microsoft compilers\n#endif\n\n#include <windows.h>\n\n#ifndef _UNISTD_H_\n#define _UNISTD_H_\n\n/* mode_t is used in the libcdio headers */\n#ifndef _MODE_T_DEFINED\n#define _MODE_T_DEFINED\ntypedef unsigned short mode_t;\n#endif /* _MODE_T_DEFINED */\n\n/* ssize_t is also not available (copy/paste from MinGW) */\n#ifndef _SSIZE_T_DEFINED\n#define _SSIZE_T_DEFINED\n#undef ssize_t\n#ifdef _WIN64\ntypedef __int64 ssize_t;\n#else\ntypedef int ssize_t;\n#endif /* _WIN64 */\n#endif /* _SSIZE_T_DEFINED */\n\n/* ext2fs needs this, which we picked from libcdio-driver/filemode.h */\n#if !defined S_IFBLK && defined _WIN32\n# define S_IFBLK 0x3000\n#endif\n#if !defined S_ISBLK && defined S_IFBLK\n# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)\n#endif\n\n/* access() mode flags */\n#ifndef R_OK\n#define R_OK    4\n#endif\n#ifndef W_OK\n#define W_OK    2\n#endif\n#ifndef F_OK\n#define F_OK    0\n#endif\n#endif\n\n/* Standard file descriptors.  */\n#ifndef STDIN_FILENO\n#define STDIN_FILENO    0\n#endif\n#ifndef STDOUT_FILENO\n#define STDOUT_FILENO   1\n#endif\n#ifndef STDERR_FILENO\n#define STDERR_FILENO   2\n#endif\n\n/* For wimlib */\n#define ftruncate       _chsize_s\n#define snwprintf(dst, count, ...)  _snwprintf_s(dst, count, _TRUNCATE, __VA_ARGS__)\n#define vsnwprintf      _vsnwprintf\n"
  },
  {
    "path": "src/net.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Networking functionality (web file download, check for update, etc.)\n * Copyright © 2012-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <wininet.h>\n#include <netlistmgr.h>\n#include <stdio.h>\n#include <malloc.h>\n#include <string.h>\n#include <inttypes.h>\n#include <assert.h>\n#include <time.h>\n#include <virtdisk.h>\n\n#include \"rufus.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n#include \"bled/bled.h\"\n#include \"dbx/dbx_info.h\"\n\n#include \"settings.h\"\n\n/* Maximum download chunk size, in bytes */\n#define DOWNLOAD_BUFFER_SIZE    (10*KB)\n/* Default delay between update checks (1 day) */\n#define DEFAULT_UPDATE_INTERVAL (24*3600)\n\nDWORD DownloadStatus;\nBYTE* fido_script = NULL;\nHANDLE update_check_thread = NULL;\n\nextern loc_cmd* selected_locale;\nextern HANDLE dialog_handle;\nextern BOOL is_x86_64;\nextern USHORT NativeMachine;\nstatic DWORD error_code, fido_len = 0;\nstatic BOOL force_update_check = FALSE;\nextern const char* efi_archname[ARCH_MAX];\n\n#if defined(__MINGW32__)\n#define INetworkListManager_get_IsConnectedToInternet INetworkListManager_IsConnectedToInternet\n#endif\n\nstatic char* GetShortName(const char* url)\n{\n\tstatic char short_name[128];\n\tchar *p;\n\tsize_t i, len = safe_strlen(url);\n\tif (len < 5)\n\t\treturn NULL;\n\n\tfor (i = len - 2; i > 0; i--) {\n\t\tif (url[i] == '/') {\n\t\t\ti++;\n\t\t\tbreak;\n\t\t}\n\t}\n\tmemset(short_name, 0, sizeof(short_name));\n\tstatic_strcpy(short_name, &url[i]);\n\t// If the URL is followed by a query, remove that part\n\t// Make sure we detect escaped queries too\n\tp = strstr(short_name, \"%3F\");\n\tif (p != NULL)\n\t\t*p = 0;\n\tp = strstr(short_name, \"%3f\");\n\tif (p != NULL)\n\t\t*p = 0;\n\tfor (i = 0; i < strlen(short_name); i++) {\n\t\tif ((short_name[i] == '?') || (short_name[i] == '#')) {\n\t\t\tshort_name[i] = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn short_name;\n}\n\nstatic __inline BOOL is_WOW64(void)\n{\n\tBOOL ret = FALSE;\n\tIsWow64Process(GetCurrentProcess(), &ret);\n\treturn ret;\n}\n\n// Open an Internet session\nstatic HINTERNET GetInternetSession(const char* user_agent, BOOL bRetry)\n{\n\tint i;\n\tchar default_agent[64];\n\tBOOL decodingSupport = TRUE;\n\tVARIANT_BOOL InternetConnection = VARIANT_FALSE;\n\tDWORD dwFlags, dwTimeout = NET_SESSION_TIMEOUT, dwProtocolSupport = HTTP_PROTOCOL_FLAG_HTTP2;\n\tHINTERNET hSession = NULL;\n\tHRESULT hr = S_FALSE;\n\tINetworkListManager* pNetworkListManager;\n\t// Create a NetworkListManager Instance to check the network connection\n\tIGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));\n\thr = CoCreateInstance(&CLSID_NetworkListManager, NULL, CLSCTX_ALL,\n\t\t&IID_INetworkListManager, (LPVOID*)&pNetworkListManager);\n\tif (hr == S_OK) {\n\t\tfor (i = 0; i <= WRITE_RETRIES; i++) {\n\t\t\thr = INetworkListManager_get_IsConnectedToInternet(pNetworkListManager, &InternetConnection);\n\t\t\t// INetworkListManager may fail with ERROR_SERVICE_DEPENDENCY_FAIL if the DHCP service\n\t\t\t// is not running, in which case we must fall back to using InternetGetConnectedState().\n\t\t\t// See https://github.com/pbatard/rufus/issues/1801.\n\t\t\tif (hr == HRESULT_FROM_WIN32(ERROR_SERVICE_DEPENDENCY_FAIL)) {\n\t\t\t\tInternetConnection = InternetGetConnectedState(&dwFlags, 0) ? VARIANT_TRUE : VARIANT_FALSE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (hr == S_OK || !bRetry)\n\t\t\t\tbreak;\n\t\t\tSleep(1000);\n\t\t}\n\t}\n\tif (InternetConnection == VARIANT_FALSE) {\n\t\tSetLastError(ERROR_INTERNET_DISCONNECTED);\n\t\tgoto out;\n\t}\n\tstatic_sprintf(default_agent, APPLICATION_NAME \"/%d.%d.%d (Windows NT %lu.%lu%s)\",\n\t\trufus_version[0], rufus_version[1], rufus_version[2],\n\t\tWindowsVersion.Major, WindowsVersion.Minor, is_WOW64() ? \"; WOW64\" : \"\");\n\thSession = InternetOpenA((user_agent == NULL) ? default_agent : user_agent,\n\t\tINTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);\n\t// Set the timeouts\n\tInternetSetOptionA(hSession, INTERNET_OPTION_CONNECT_TIMEOUT, (LPVOID)&dwTimeout, sizeof(dwTimeout));\n\tInternetSetOptionA(hSession, INTERNET_OPTION_SEND_TIMEOUT, (LPVOID)&dwTimeout, sizeof(dwTimeout));\n\tInternetSetOptionA(hSession, INTERNET_OPTION_RECEIVE_TIMEOUT, (LPVOID)&dwTimeout, sizeof(dwTimeout));\n\t// Enable gzip and deflate decoding schemes\n\tInternetSetOptionA(hSession, INTERNET_OPTION_HTTP_DECODING, (LPVOID)&decodingSupport, sizeof(decodingSupport));\n\t// Enable HTTP/2 protocol support\n\tInternetSetOptionA(hSession, INTERNET_OPTION_ENABLE_HTTP_PROTOCOL, (LPVOID)&dwProtocolSupport, sizeof(dwProtocolSupport));\n\nout:\n\treturn hSession;\n}\n\n/*\n * Download a file or fill a buffer from an URL\n * Mostly taken from http://support.microsoft.com/kb/234913\n * If file is NULL, a buffer is allocated for the download (that needs to be freed by the caller)\n * If hProgressDialog is not NULL, this function will send INIT and EXIT messages\n * to the dialog in question, with WPARAM being set to nonzero for EXIT on success\n * and also attempt to indicate progress using an IDC_PROGRESS control\n * Note that when a buffer is used, the actual size of the buffer is two more than its reported\n * size (with the extra bytes set to 0) to accommodate for calls that need NUL-terminated data.\n */\nuint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char* user_agent,\n\tBYTE** buffer, HWND hProgressDialog, BOOL bTaskBarProgress)\n{\n\tconst char* accept_types[] = {\"*/*\\0\", NULL};\n\tconst char* short_name;\n\tunsigned char buf[DOWNLOAD_BUFFER_SIZE];\n\tchar hostname[64], urlpath[128], strsize[32];\n\tBOOL r = FALSE;\n\tDWORD dwSize, dwWritten, dwDownloaded;\n\tHANDLE hFile = INVALID_HANDLE_VALUE;\n\tHINTERNET hSession = NULL, hConnection = NULL, hRequest = NULL;\n\tURL_COMPONENTSA UrlParts = { sizeof(URL_COMPONENTSA), NULL, 1, (INTERNET_SCHEME)0,\n\t\thostname, sizeof(hostname), 0, NULL, 1, urlpath, sizeof(urlpath), NULL, 1 };\n\tuint64_t size = 0, total_size = 0;\n\n\tErrorStatus = 0;\n\tDownloadStatus = 404;\n\tif (hProgressDialog != NULL)\n\t\tUpdateProgressWithInfoInit(hProgressDialog, FALSE);\n\n\tassert(url != NULL);\n\tif (buffer != NULL)\n\t\t*buffer = NULL;\n\n\tshort_name = (file != NULL) ? PathFindFileNameU(file) : PathFindFileNameU(url);\n\n\tif (hProgressDialog != NULL) {\n\t\tPrintInfo(5000, MSG_085, short_name);\n\t\tuprintf(\"Downloading %s\", url);\n\t}\n\n\tif ( (!InternetCrackUrlA(url, (DWORD)safe_strlen(url), 0, &UrlParts))\n\t  || (UrlParts.lpszHostName == NULL) || (UrlParts.lpszUrlPath == NULL)) {\n\t\tuprintf(\"Unable to decode URL: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\thostname[sizeof(hostname)-1] = 0;\n\n\thSession = GetInternetSession(user_agent, TRUE);\n\tif (hSession == NULL) {\n\t\tuprintf(\"Could not open Internet session: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\thConnection = InternetConnectA(hSession, UrlParts.lpszHostName, UrlParts.nPort, NULL, NULL, INTERNET_SERVICE_HTTP, 0, (DWORD_PTR)NULL);\n\tif (hConnection == NULL) {\n\t\tuprintf(\"Could not connect to server %s:%d: %s\", UrlParts.lpszHostName, UrlParts.nPort, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\thRequest = HttpOpenRequestA(hConnection, \"GET\", UrlParts.lpszUrlPath, NULL, NULL, accept_types,\n\t\tINTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS |\n\t\tINTERNET_FLAG_NO_COOKIES | INTERNET_FLAG_NO_UI | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_HYPERLINK |\n\t\t((UrlParts.nScheme == INTERNET_SCHEME_HTTPS) ? INTERNET_FLAG_SECURE : 0), (DWORD_PTR)NULL);\n\tif (hRequest == NULL) {\n\t\tuprintf(\"Could not open URL %s: %s\", url, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t// If we are querying the GitHub API, we need to enable raw content\n\tif (strstr(url, \"api.github.com\") != NULL && !HttpAddRequestHeadersA(hRequest,\n\t\t\"Accept: application/vnd.github.v3.raw\", (DWORD)-1, HTTP_ADDREQ_FLAG_ADD)) {\n\t\tuprintf(\"Unable to enable raw content from GitHub API: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\t// Must use \"Accept-Encoding: identity\" to get the file size\n\t// This is needed for GitHub as the Microsoft HTTP APIs can't seem to read content-length for\n\t// compressed content from GitHub, and using \"identity\" disables compression.\n\tHttpSendRequestA(hRequest, \"Accept-Encoding: identity\", -1L, NULL, 0);\n\n\t// Get the file size\n\tdwSize = sizeof(DownloadStatus);\n\tHttpQueryInfoA(hRequest, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, (LPVOID)&DownloadStatus, &dwSize, NULL);\n\tif (DownloadStatus != 200) {\n\t\terror_code = ERROR_INTERNET_ITEM_NOT_FOUND;\n\t\tSetLastError(RUFUS_ERROR(error_code));\n\t\tuprintf(\"%s '%s': %d\", (DownloadStatus == 404) ? \"File not found\" : \"Unable to access file\", url, DownloadStatus);\n\t\tgoto out;\n\t}\n\tdwSize = sizeof(strsize);\n\tif (!HttpQueryInfoA(hRequest, HTTP_QUERY_CONTENT_LENGTH, (LPVOID)strsize, &dwSize, NULL)) {\n\t\tuprintf(\"Unable to retrieve file length: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\ttotal_size = strtoull(strsize, NULL, 10);\n\tif (hProgressDialog != NULL) {\n\t\tchar msg[128];\n\t\tuprintf(\"File length: %s\", SizeToHumanReadable(total_size, FALSE, FALSE));\n\t\tif (right_to_left_mode)\n\t\t\tstatic_sprintf(msg, \"(%s) %s\", SizeToHumanReadable(total_size, FALSE, FALSE), GetShortName(url));\n\t\telse\n\t\t\tstatic_sprintf(msg, \"%s (%s)\", GetShortName(url), SizeToHumanReadable(total_size, FALSE, FALSE));\n\t\tPrintStatus(5000, MSG_085, msg);\n\t}\n\n\tif (file != NULL) {\n\t\thFile = CreateFileU(file, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\n\t\tif (hFile == INVALID_HANDLE_VALUE) {\n\t\t\tuprintf(\"Unable to create file '%s': %s\", short_name, WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t} else {\n\t\tif (buffer == NULL) {\n\t\t\tuprintf(\"No buffer pointer provided for download\");\n\t\t\tgoto out;\n\t\t}\n\t\t// Allocate one extra byte, so that caller can rely on NUL-terminated text if needed\n\t\t*buffer = calloc((size_t)total_size + 2, 1);\n\t\tif (*buffer == NULL) {\n\t\t\tuprintf(\"Could not allocate buffer for download\");\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\t// Keep checking for data until there is nothing left.\n\twhile (1) {\n\t\t// User may have cancelled the download\n\t\tif (IS_ERROR(ErrorStatus))\n\t\t\tgoto out;\n\t\tif (!InternetReadFile(hRequest, buf, sizeof(buf), &dwDownloaded) || (dwDownloaded == 0))\n\t\t\tbreak;\n\t\tif (hProgressDialog != NULL)\n\t\t\tUpdateProgressWithInfo(OP_NOOP, MSG_241, size, total_size);\n\t\tif (file != NULL) {\n\t\t\tif (!WriteFile(hFile, buf, dwDownloaded, &dwWritten, NULL)) {\n\t\t\t\tuprintf(\"Error writing file '%s': %s\", short_name, WindowsErrorString());\n\t\t\t\tgoto out;\n\t\t\t} else if (dwDownloaded != dwWritten) {\n\t\t\t\tuprintf(\"Error writing file '%s': Only %d/%d bytes written\", short_name, dwWritten, dwDownloaded);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else {\n\t\t\tmemcpy(&(*buffer)[size], buf, dwDownloaded);\n\t\t}\n\t\tsize += dwDownloaded;\n\t}\n\n\tif (size != total_size) {\n\t\tuprintf(\"Could not download complete file - read: %lld bytes, expected: %lld bytes\", size, total_size);\n\t\tErrorStatus = RUFUS_ERROR(ERROR_WRITE_FAULT);\n\t\tgoto out;\n\t} else {\n\t\tDownloadStatus = 200;\n\t\tr = TRUE;\n\t\tif (hProgressDialog != NULL) {\n\t\t\tUpdateProgressWithInfo(OP_NOOP, MSG_241, total_size, total_size);\n\t\t\tuprintf(\"Successfully downloaded '%s'\", short_name);\n\t\t}\n\t}\n\nout:\n\terror_code = GetLastError();\n\tif (hFile != INVALID_HANDLE_VALUE) {\n\t\t// Force a flush - May help with the PKI API trying to process downloaded updates too early...\n\t\tFlushFileBuffers(hFile);\n\t\tCloseHandle(hFile);\n\t}\n\tif (!r) {\n\t\tif (file != NULL)\n\t\t\tDeleteFileU(file);\n\t\tif (buffer != NULL)\n\t\t\tsafe_free(*buffer);\n\t}\n\tif (hRequest)\n\t\tInternetCloseHandle(hRequest);\n\tif (hConnection)\n\t\tInternetCloseHandle(hConnection);\n\tif (hSession)\n\t\tInternetCloseHandle(hSession);\n\n\tSetLastError(error_code);\n\treturn r ? size : 0;\n}\n\n// Download and validate a signed file. The file must have a corresponding '.sig' on the server.\nDWORD DownloadSignedFile(const char* url, const char* file, HWND hProgressDialog, BOOL bPromptOnError)\n{\n\tchar* url_sig = NULL;\n\tBYTE *buf = NULL, *sig = NULL;\n\tDWORD buf_len = 0, sig_len = 0;\n\tDWORD ret = 0;\n\tHANDLE hFile = INVALID_HANDLE_VALUE;\n\n\tassert(url != NULL);\n\n\turl_sig = malloc(strlen(url) + 5);\n\tif (url_sig == NULL) {\n\t\tuprintf(\"Could not allocate signature URL\");\n\t\tgoto out;\n\t}\n\tstrcpy(url_sig, url);\n\tstrcat(url_sig, \".sig\");\n\n\tbuf_len = (DWORD)DownloadToFileOrBuffer(url, NULL, &buf, hProgressDialog, FALSE);\n\tif (buf_len == 0)\n\t\tgoto out;\n\tsig_len = (DWORD)DownloadToFileOrBuffer(url_sig, NULL, &sig, NULL, FALSE);\n\tif ((sig_len != RSA_SIGNATURE_SIZE) || (!ValidateOpensslSignature(buf, buf_len, sig, sig_len))) {\n\t\tuprintf(\"FATAL: Download signature is invalid ✗\");\n\t\tDownloadStatus = 403;\t// Forbidden\n\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_BAD_SIGNATURE));\n\t\tSendMessage(GetDlgItem(hProgressDialog, IDC_PROGRESS), PBM_SETSTATE, (WPARAM)PBST_ERROR, 0);\n\t\tSetTaskbarProgressState(TASKBAR_ERROR);\n\t\tgoto out;\n\t}\n\n\tuprintf(\"Download signature is valid ✓\");\n\tDownloadStatus = 206;\t// Partial content\n\thFile = CreateFileU(file, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\n\tif (hFile == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Unable to create file '%s': %s\", PathFindFileNameU(file), WindowsErrorString());\n\t\tgoto out;\n\t}\n\tif (!WriteFile(hFile, buf, buf_len, &ret, NULL)) {\n\t\tuprintf(\"Error writing file '%s': %s\", PathFindFileNameU(file), WindowsErrorString());\n\t\tret = 0;\n\t\tgoto out;\n\t} else if (ret != buf_len) {\n\t\tuprintf(\"Error writing file '%s': Only %d/%d bytes written\", PathFindFileNameU(file), ret, buf_len);\n\t\tret = 0;\n\t\tgoto out;\n\t}\n\tDownloadStatus = 200;\t// Full content\n\nout:\n\tif (hProgressDialog != NULL)\n\t\tSendMessage(hProgressDialog, UM_PROGRESS_EXIT, (WPARAM)ret, 0);\n\tif ((bPromptOnError) && (DownloadStatus != 200)) {\n\t\tPrintInfo(0, MSG_242);\n\t\tSetLastError(error_code);\n\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_044), IS_ERROR(ErrorStatus) ? StrError(ErrorStatus, FALSE) : WindowsErrorString());\n\t}\n\tsafe_closehandle(hFile);\n\tfree(url_sig);\n\tfree(buf);\n\tfree(sig);\n\treturn ret;\n}\n\n/* Threaded download */\ntypedef struct {\n\tconst char* url;\n\tconst char* file;\n\tHWND hProgressDialog;\n\tBOOL bPromptOnError;\n} DownloadSignedFileThreadArgs;\n\nstatic DWORD WINAPI DownloadSignedFileThread(LPVOID param)\n{\n\tDownloadSignedFileThreadArgs* args = (DownloadSignedFileThreadArgs*)param;\n\tExitThread(DownloadSignedFile(args->url, args->file, args->hProgressDialog, args->bPromptOnError));\n}\n\nHANDLE DownloadSignedFileThreaded(const char* url, const char* file, HWND hProgressDialog, BOOL bPromptOnError)\n{\n\tstatic DownloadSignedFileThreadArgs args;\n\targs.url = url;\n\targs.file = file;\n\targs.hProgressDialog = hProgressDialog;\n\targs.bPromptOnError = bPromptOnError;\n\treturn CreateThread(NULL, 0, DownloadSignedFileThread, &args, 0, NULL);\n}\n\nstatic __inline uint64_t to_uint64_t(uint16_t x[3]) {\n\tint i;\n\tuint64_t ret = 0;\n\tfor (i = 0; i < 3; i++)\n\t\tret = (ret << 16) + x[i];\n\treturn ret;\n}\n\nBOOL UseLocalDbx(int arch)\n{\n\tchar reg_name[32];\n\tstatic_sprintf(reg_name, \"DBXTimestamp_%s\", efi_archname[arch]);\n\treturn (uint64_t)ReadSetting64(reg_name) > dbx_info[arch - 1].timestamp;\n}\n\nstatic void CheckForDBXUpdates(int verbose)\n{\n\tint i, r;\n\tchar reg_name[32], timestamp_url[256], path[MAX_PATH];\n\tchar *p, *c, *rep, *buf = NULL;\n\tstruct tm t = { 0 };\n\tuint64_t size, timestamp;\n\tBOOL already_prompted = FALSE;\n\n\tfor (i = 0; i < ARRAYSIZE(dbx_info); i++) {\n\t\t// Get the epoch of the last commit\n\t\ttimestamp = 0;\n\t\tstatic_strcpy(timestamp_url, dbx_info[i].url);\n\t\tp = strstr(timestamp_url, \"contents/\");\n\t\tif (p == NULL)\n\t\t\tcontinue;\n\t\t*p = 0;\n\t\trep = replace_char(&p[9], '/', \"%2F\");\n\t\tstatic_strcat(timestamp_url, \"commits?path=\");\n\t\tstatic_strcat(timestamp_url, rep);\n\t\tfree(rep);\n\t\tstatic_strcat(timestamp_url, \"&page=1&per_page=1\");\n\t\tvuprintf(\"Querying %s for DBX update timestamp\", timestamp_url);\n\t\tsize = DownloadToFileOrBuffer(timestamp_url, NULL, (BYTE**)&buf, NULL, FALSE);\n\t\tif (size == 0)\n\t\t\tcontinue;\n\t\t// Assumes that the GitHub JSON commit dates are of the form:\n\t\t// \"date\":[ ]*\"2025-02-24T20:20:22Z\"\n\t\tp = strstr(buf, \"\\\"date\\\":\");\n\t\tif (p == NULL) {\n\t\t\tsafe_free(buf);\n\t\t\tcontinue;\n\t\t}\n\t\tc = &p[7];\n\t\twhile (*c == ' ' || *c == '\"')\n\t\t\tc++;\n\t\tp = c;\n\t\twhile (*c != '\"' && *c != '\\0')\n\t\t\tc++;\n\t\t*c = 0;\n\t\t// \"Thank you, X3J11 ANSI committee, for introducing the well thought through 'struct tm'\", said ABSOLUTELY NOONE ever!\n\t\tr = sscanf(p, \"%d-%d-%dT%d:%d:%dZ\", &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec);\n\t\tsafe_free(buf);\n\t\tif (r != 6)\n\t\t\tcontinue;\n\t\tt.tm_year -= 1900;\n\t\tt.tm_mon -= 1;\n\t\ttimestamp = _mkgmtime64(&t);\n\t\tvuprintf(\"DBX update timestamp is %\" PRId64, timestamp);\n\t\tstatic_sprintf(reg_name, \"DBXTimestamp_%s\", efi_archname[i + 1]);\n\t\t// Check if we have an external DBX that is newer than embedded/last downloaded\n\t\tif (timestamp <= MAX(dbx_info[i].timestamp, (uint64_t)ReadSetting64(reg_name)))\n\t\t\tcontinue;\n\t\tif (!already_prompted) {\n\t\t\tr = Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_353), lmprintf(MSG_354));\n\t\t\talready_prompted = TRUE;\n\t\t\tif (r != IDYES)\n\t\t\t\tbreak;\n\t\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\t\tIGNORE_RETVAL(_mkdir(FILES_DIR));\n\t\t\tIGNORE_RETVAL(_chdir(FILES_DIR));\n\t\t}\n\t\tstatic_sprintf(path, \"%s\\\\%s\\\\dbx_%s.bin\", app_data_dir, FILES_DIR, efi_archname[i + 1]);\n\t\tif (DownloadToFileOrBuffer(dbx_info[i].url, path, NULL, NULL, FALSE) != 0) {\n\t\t\tWriteSetting64(reg_name, timestamp);\n\t\t\tuprintf(\"Saved %s as 'dbx_%s.bin'\", dbx_info[i].url, efi_archname[i + 1]);\n\t\t} else\n\t\t\tuprintf(\"WARNING: Failed to download %s\", dbx_info[i].url);\n\t}\n}\n\n/*\n * Background thread to check for updates (including UEFI DBX updates)\n */\nstatic DWORD WINAPI CheckForUpdatesThread(LPVOID param)\n{\n\tBOOL releases_only = TRUE, found_new_version = FALSE;\n\tint status = 0;\n\tconst char* server_url = RUFUS_URL \"/\";\n\tint i, j, k, max_channel, verbose = 0, verpos[4];\n\tstatic const char* channel[] = { \"release\", \"beta\", \"test\" };\t\t// release channel\n\tconst char* accept_types[] = { \"*/*\\0\", NULL };\n\tchar* buf = NULL;\n\tchar agent[64], hostname[64], urlpath[128], sigpath[256];\n\tDWORD dwSize, dwDownloaded, dwTotalSize, dwStatus;\n\tBYTE *sig = NULL;\n\tHINTERNET hSession = NULL, hConnection = NULL, hRequest = NULL;\n\tURL_COMPONENTSA UrlParts = { sizeof(URL_COMPONENTSA), NULL, 1, (INTERNET_SCHEME)0,\n\t\thostname, sizeof(hostname), 0, NULL, 1, urlpath, sizeof(urlpath), NULL, 1 };\n\tSYSTEMTIME ServerTime, LocalTime;\n\tFILETIME FileTime;\n\tint64_t local_time = 0, reg_time, server_time, update_interval;\n\tverbose = ReadSetting32(SETTING_VERBOSE_UPDATES);\n\t// Without this the FileDialog will produce error 0x8001010E when compiled for Vista or later\n\tIGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));\n\t// Unless the update was forced, wait a while before performing the update check\n\tif (!force_update_check) {\n\t\t// It would of course be a lot nicer to use a timer and wake the thread, but my\n\t\t// development time is limited and this is FASTER to implement.\n\t\tdo {\n\t\t\tfor (i = 0; ( i < 30) && (!force_update_check); i++)\n\t\t\t\tSleep(500);\n\t\t} while ((!force_update_check) && ((op_in_progress || (dialog_showing > 0))));\n\t\tif (!force_update_check) {\n\t\t\tif ((ReadSetting32(SETTING_UPDATE_INTERVAL) == -1)) {\n\t\t\t\tvuprintf(\"Check for updates disabled, as per settings.\");\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\treg_time = ReadSetting64(SETTING_LAST_UPDATE);\n\t\t\tupdate_interval = (int64_t)ReadSetting32(SETTING_UPDATE_INTERVAL);\n\t\t\tif (update_interval == 0) {\n\t\t\t\tWriteSetting32(SETTING_UPDATE_INTERVAL, DEFAULT_UPDATE_INTERVAL);\n\t\t\t\tupdate_interval = DEFAULT_UPDATE_INTERVAL;\n\t\t\t}\n\t\t\tGetSystemTime(&LocalTime);\n\t\t\tif (!SystemTimeToFileTime(&LocalTime, &FileTime))\n\t\t\t\tgoto out;\n\t\t\tlocal_time = ((((int64_t)FileTime.dwHighDateTime) << 32) + FileTime.dwLowDateTime) / 10000000;\n\t\t\tvvuprintf(\"Local time: %\" PRId64, local_time);\n\t\t\tif (local_time < reg_time + update_interval) {\n\t\t\t\tvuprintf(\"Next update check in %\" PRId64 \" seconds.\", reg_time + update_interval - local_time);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Perform the DBX Update check\n\tPrintInfoDebug(3000, MSG_352);\n\tCheckForDBXUpdates(verbose);\n\n\tPrintInfoDebug(3000, MSG_243);\n\tstatus++;\t// 1\n\n\tif (!InternetCrackUrlA(server_url, (DWORD)safe_strlen(server_url), 0, &UrlParts))\n\t\tgoto out;\n\thostname[sizeof(hostname)-1] = 0;\n\n\tstatic_sprintf(agent, APPLICATION_NAME \"/%d.%d.%d (Windows NT %lu.%lu%s)\",\n\t\trufus_version[0], rufus_version[1], rufus_version[2],\n\t\tWindowsVersion.Major, WindowsVersion.Minor, is_WOW64() ? \"; WOW64\" : \"\");\n\thSession = GetInternetSession(NULL, FALSE);\n\tif (hSession == NULL)\n\t\tgoto out;\n\thConnection = InternetConnectA(hSession, UrlParts.lpszHostName, UrlParts.nPort,\n\t\tNULL, NULL, INTERNET_SERVICE_HTTP, 0, (DWORD_PTR)NULL);\n\tif (hConnection == NULL)\n\t\tgoto out;\n\n\tstatus++;\t// 2\n\t// BETAs are only made available when the application arch is x86_64\n\tif (is_x86_64)\n\t\treleases_only = !ReadSettingBool(SETTING_INCLUDE_BETAS);\n\n\t// Test releases get their own distribution channel (and also force beta checks)\n#if defined(TEST)\n\tmax_channel = (int)ARRAYSIZE(channel);\n#else\n\tmax_channel = releases_only ? 1 : (int)ARRAYSIZE(channel) - 1;\n#endif\n\tvuprintf(\"Using %s for the update check\", RUFUS_URL);\n\tfor (k = 0; (k < max_channel) && (!found_new_version); k++) {\n\t\t// Get the arch name and convert it lowercase\n\t\tchar* archname = strdup(GetArchName(WindowsVersion.Arch));\n\t\tsafe_strtolower(archname);\n\t\t// Free any previous buffers we might have used\n\t\tsafe_free(buf);\n\t\tsafe_free(sig);\n\t\tuprintf(\"Checking %s channel...\", channel[k]);\n\t\t// At this stage we can query the server for various update version files.\n\t\t// We first try to lookup for \"<appname>_<os_arch>_<os_version_major>_<os_version_minor>.ver\"\n\t\t// and then remove each of the <os_> components until we find our match. For instance, we may first\n\t\t// look for rufus_win_x64_6.2.ver (Win8 x64) but only get a match for rufus_win_x64_6.ver (Vista x64 or later)\n\t\t// This allows sunsetting OS versions (eg XP) or providing different downloads for different archs/groups.\n\t\t// Note that for BETAs, we only catter for x64 regardless of the OS arch.\n\t\tstatic_sprintf(urlpath, \"%s%s%s_win_%s_%lu.%lu.ver\", APPLICATION_NAME, (k == 0) ? \"\": \"_\",\n\t\t\t(k == 0) ? \"\" : channel[k], archname, WindowsVersion.Major, WindowsVersion.Minor);\n\t\tsafe_free(archname);\n\t\tvuprintf(\"Base update check: %s\", urlpath);\n\t\tfor (i = 0, j = (int)safe_strlen(urlpath) - 5; (j > 0) && (i < ARRAYSIZE(verpos)); j--) {\n\t\t\tif ((urlpath[j] == '.') || (urlpath[j] == '_')) {\n\t\t\t\tverpos[i++] = j;\n\t\t\t}\n\t\t}\n\t\tassert(i == ARRAYSIZE(verpos));\n\n\t\tUrlParts.lpszUrlPath = urlpath;\n\t\tUrlParts.dwUrlPathLength = sizeof(urlpath);\n\t\tfor (i = 0; i < ARRAYSIZE(verpos); i++) {\n\t\t\tvvuprintf(\"Trying %s\", UrlParts.lpszUrlPath);\n\t\t\thRequest = HttpOpenRequestA(hConnection, \"GET\", UrlParts.lpszUrlPath, NULL, NULL, accept_types,\n\t\t\t\tINTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS |\n\t\t\t\tINTERNET_FLAG_NO_COOKIES | INTERNET_FLAG_NO_UI | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_HYPERLINK |\n\t\t\t\t((UrlParts.nScheme == INTERNET_SCHEME_HTTPS) ? INTERNET_FLAG_SECURE : 0), (DWORD_PTR)NULL);\n\t\t\tif (hRequest == NULL) {\n\t\t\t\tuprintf(\"Unable to send request: %s\", WindowsErrorString());\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\t// Must use \"Accept-Encoding: identity\" to get the file size\n\t\t\tHttpSendRequestA(hRequest, \"Accept-Encoding: identity\", -1L, NULL, 0);\n\n\t\t\t// Ensure that we get a text file\n\t\t\tdwSize = sizeof(dwStatus);\n\t\t\tdwStatus = 404;\n\t\t\tHttpQueryInfoA(hRequest, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, (LPVOID)&dwStatus, &dwSize, NULL);\n\t\t\tif (dwStatus == 200)\n\t\t\t\tbreak;\n\t\t\tInternetCloseHandle(hRequest);\n\t\t\thRequest = NULL;\n\t\t\tsafe_strcpy(&urlpath[verpos[i]], 5, \".ver\");\n\t\t}\n\t\tif (dwStatus != 200) {\n\t\t\tvuprintf(\"Could not find a %s version file on server %s\", channel[k], server_url);\n\t\t\tif ((releases_only) || (k + 1 >= ARRAYSIZE(channel)))\n\t\t\t\tgoto out;\n\t\t\tcontinue;\n\t\t}\n\t\tvuprintf(\"Found match for %s on server %s\", urlpath, server_url);\n\n\t\t// We also get a date from the web server, which we'll use to avoid out of sync check,\n\t\t// in case some set their clock way into the future and back.\n\t\t// On the other hand, if local clock is set way back in the past, we will never check.\n\t\tdwSize = sizeof(ServerTime);\n\t\t// If we can't get a date we can trust, don't bother...\n\t\tif ( (!HttpQueryInfoA(hRequest, HTTP_QUERY_DATE|HTTP_QUERY_FLAG_SYSTEMTIME, (LPVOID)&ServerTime, &dwSize, NULL))\n\t\t\t|| (!SystemTimeToFileTime(&ServerTime, &FileTime)) )\n\t\t\tgoto out;\n\t\tserver_time = ((((int64_t)FileTime.dwHighDateTime) << 32) + FileTime.dwLowDateTime) / 10000000;\n\t\tvvuprintf(\"Server time: %\" PRId64, server_time);\n\t\t// Always store the server response time - the only clock we trust!\n\t\tWriteSetting64(SETTING_LAST_UPDATE, server_time);\n\t\t// Might as well let the user know\n\t\tif (!force_update_check) {\n\t\t\tif ((local_time > server_time + 600) || (local_time < server_time - 600)) {\n\t\t\t\tuprintf(\"IMPORTANT: Your local clock is more than 10 minutes in the %s. Unless you fix this, \"\n\t\t\t\t\tAPPLICATION_NAME \" may not be able to check for updates...\",\n\t\t\t\t\t(local_time > server_time + 600)?\"future\":\"past\");\n\t\t\t}\n\t\t}\n\n\t\tdwSize = sizeof(dwTotalSize);\n\t\tif (!HttpQueryInfoA(hRequest, HTTP_QUERY_CONTENT_LENGTH|HTTP_QUERY_FLAG_NUMBER, (LPVOID)&dwTotalSize, &dwSize, NULL))\n\t\t\tgoto out;\n\n\t\t// Make sure the file is NUL terminated\n\t\tbuf = (char*)calloc(dwTotalSize + 1, 1);\n\t\tif (buf == NULL)\n\t\t\tgoto out;\n\t\t// This is a version file - we should be able to gulp it down in one go\n\t\tif (!InternetReadFile(hRequest, buf, dwTotalSize, &dwDownloaded) || (dwDownloaded != dwTotalSize))\n\t\t\tgoto out;\n\t\tvuprintf(\"Successfully downloaded version file (%d bytes)\", dwTotalSize);\n\n\t\t// Now download the signature file\n\t\tstatic_sprintf(sigpath, \"%s/%s.sig\", server_url, urlpath);\n\t\tdwDownloaded = (DWORD)DownloadToFileOrBuffer(sigpath, NULL, &sig, NULL, FALSE);\n\t\tif ((dwDownloaded != RSA_SIGNATURE_SIZE) || (!ValidateOpensslSignature(buf, dwTotalSize, sig, dwDownloaded))) {\n\t\t\tuprintf(\"FATAL: Version signature is invalid ✗\");\n\t\t\tgoto out;\n\t\t}\n\t\tvuprintf(\"Version signature is valid ✓\");\n\n\t\tstatus++;\n\t\tparse_update(buf, dwTotalSize + 1);\n\n\t\tvuprintf(\"UPDATE DATA:\");\n\t\tvuprintf(\"  version: %d.%d.%d (%s)\", update.version[0], update.version[1], update.version[2], channel[k]);\n\t\tvuprintf(\"  platform_min: %d.%d\", update.platform_min[0], update.platform_min[1]);\n\t\tvuprintf(\"  url: %s\", update.download_url);\n\n\t\tfound_new_version = ((to_uint64_t(update.version) > to_uint64_t(rufus_version)) || (force_update))\n\t\t\t&& ((WindowsVersion.Major > update.platform_min[0])\n\t\t\t\t|| ((WindowsVersion.Major == update.platform_min[0]) && (WindowsVersion.Minor >= update.platform_min[1])));\n\t\tuprintf(\"N%sew %s version found%c\", found_new_version ? \"\" : \"o n\", channel[k], found_new_version ? '!' : '.');\n\t}\n\nout:\n\tsafe_free(buf);\n\tsafe_free(sig);\n\tif (hRequest)\n\t\tInternetCloseHandle(hRequest);\n\tif (hConnection)\n\t\tInternetCloseHandle(hConnection);\n\tif (hSession)\n\t\tInternetCloseHandle(hSession);\n\tswitch (status) {\n\tcase 1:\n\t\tPrintInfoDebug(3000, MSG_244);\n\t\tbreak;\n\tcase 2:\n\t\tPrintInfoDebug(3000, MSG_245);\n\t\tbreak;\n\tcase 3:\n\tcase 4:\n\t\tPrintInfo(3000, found_new_version ? MSG_246 : MSG_247);\n\tdefault:\n\t\tbreak;\n\t}\n\t// Start the new download after cleanup\n\tif (found_new_version) {\n\t\t// User may have started an operation while we were checking\n\t\twhile ((!force_update_check) && (op_in_progress || (dialog_showing > 0))) {\n\t\t\tSleep(15000);\n\t\t}\n\t\tDownloadNewVersion();\n\t} else if (force_update_check) {\n\t\tPostMessage(hMainDialog, UM_NO_UPDATE, 0, 0);\n\t}\n\tforce_update_check = FALSE;\n\tupdate_check_thread = NULL;\n\tCoUninitialize();\n\tExitThread(0);\n}\n\n/*\n * Initiate a check for updates. If force is true, ignore the wait period\n */\nBOOL CheckForUpdates(BOOL force)\n{\n\tforce_update_check = force;\n\tif (update_check_thread != NULL)\n\t\treturn FALSE;\n\n\tupdate_check_thread = CreateThread(NULL, 0, CheckForUpdatesThread, NULL, 0, NULL);\n\tif (update_check_thread == NULL) {\n\t\tuprintf(\"Unable to start update check thread\");\n\t\treturn FALSE;\n\t}\n\treturn TRUE;\n}\n\n/*\n * Download an ISO through Fido\n */\nstatic DWORD WINAPI DownloadISOThread(LPVOID param)\n{\n\tchar locale_str[1024], cmdline[sizeof(locale_str) + 512], pipe[MAX_GUID_STRING_LENGTH + 16] = \"\\\\\\\\.\\\\pipe\\\\\";\n\tchar powershell_path[MAX_PATH], icon_path[MAX_PATH] = { 0 }, script_path[MAX_PATH] = { 0 };\n\tchar *url = NULL, sig_url[128];\n\tuint64_t uncompressed_size;\n\tint64_t size = -1;\n\tBYTE *compressed = NULL, *sig = NULL;\n\tHANDLE hFile = INVALID_HANDLE_VALUE, hPipe = INVALID_HANDLE_VALUE;\n\tDWORD dwExitCode = 99, dwCompressedSize, dwSize, dwAvail, dwPipeSize = 4096;\n\tGUID guid;\n\n\tdialog_showing++;\n\tIGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));\n\n\t// Use a GUID as random unique string, else ill-intentioned security \"researchers\"\n\t// may either spam our pipe or replace our script to fool antivirus solutions into\n\t// thinking that Rufus is doing something malicious...\n\tIGNORE_RETVAL(CoCreateGuid(&guid));\n\t// coverity[fixed_size_dest]\n\tstrcpy(&pipe[9], GuidToString(&guid, TRUE));\n\tstatic_sprintf(icon_path, \"%s%s.ico\", temp_dir, APPLICATION_NAME);\n\tExtractAppIcon(icon_path, TRUE);\n\n//#define FORCE_URL \"https://github.com/pbatard/rufus/raw/master/res/loc/test/windows_to_go.iso\"\n//#define FORCE_URL \"https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.8.0-amd64-netinst.iso\"\n#if !defined(FORCE_URL)\n#if defined(RUFUS_TEST)\n\tIGNORE_RETVAL(hFile);\n\tIGNORE_RETVAL(sig_url);\n\tIGNORE_RETVAL(dwCompressedSize);\n\tIGNORE_RETVAL(uncompressed_size);\n\t// In test mode, just use our local script\n\tstatic_strcpy(script_path, \"D:\\\\Projects\\\\Fido\\\\Fido.ps1\");\n#else\n\t// If we don't have the script, download it\n\tif (fido_script == NULL) {\n\t\tdwCompressedSize = (DWORD)DownloadToFileOrBuffer(fido_url, NULL, &compressed, hMainDialog, FALSE);\n\t\tif (dwCompressedSize == 0)\n\t\t\tgoto out;\n\t\tstatic_sprintf(sig_url, \"%s.sig\", fido_url);\n\t\tdwSize = (DWORD)DownloadToFileOrBuffer(sig_url, NULL, &sig, NULL, FALSE);\n\t\tif ((dwSize != RSA_SIGNATURE_SIZE) || (!ValidateOpensslSignature(compressed, dwCompressedSize, sig, dwSize))) {\n\t\t\tuprintf(\"FATAL: Download signature is invalid ✗\");\n\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_BAD_SIGNATURE));\n\t\t\tSendMessage(hProgress, PBM_SETSTATE, (WPARAM)PBST_ERROR, 0);\n\t\t\tSetTaskbarProgressState(TASKBAR_ERROR);\n\t\t\tsafe_free(compressed);\n\t\t\tfree(sig);\n\t\t\tgoto out;\n\t\t}\n\t\tfree(sig);\n\t\tuprintf(\"Download signature is valid ✓\");\n\t\tuncompressed_size = *((uint64_t*)&compressed[5]);\n\t\tif ((uncompressed_size < 1 * MB) && (bled_init(0, uprintf, NULL, NULL, NULL, NULL, &ErrorStatus) >= 0)) {\n\t\t\tfido_script = malloc((size_t)uncompressed_size);\n\t\t\tsize = bled_uncompress_from_buffer_to_buffer(compressed, dwCompressedSize, fido_script, (size_t)uncompressed_size, BLED_COMPRESSION_LZMA);\n\t\t\tbled_exit();\n\t\t}\n\t\tsafe_free(compressed);\n\t\tif (size != uncompressed_size) {\n\t\t\tuprintf(\"FATAL: Could not uncompressed download script\");\n\t\t\tsafe_free(fido_script);\n\t\t\tErrorStatus = RUFUS_ERROR(ERROR_INVALID_DATA);\n\t\t\tSendMessage(hProgress, PBM_SETSTATE, (WPARAM)PBST_ERROR, 0);\n\t\t\tSetTaskbarProgressState(TASKBAR_ERROR);\n\t\t\tgoto out;\n\t\t}\n\t\tfido_len = (DWORD)size;\n\t\tSendMessage(hProgress, PBM_SETSTATE, (WPARAM)PBST_NORMAL, 0);\n\t\tSetTaskbarProgressState(TASKBAR_NORMAL);\n\t\tSetTaskbarProgressValue(0, MAX_PROGRESS);\n\t\tSendMessage(hProgress, PBM_SETPOS, 0, 0);\n\t}\n\tPrintInfo(0, MSG_148);\n\n\tif_assert_fails((fido_script != NULL) && (fido_len != 0))\n\t\tgoto out;\n\n\t// Why oh why does PowerShell refuse to open read-only files that haven't been closed?\n\t// Because of this limitation, we can't fully prevent TOCTOUs on the file we create, and therefore we:\n\t// - Create the file with a \"random\" non-guessable name => TOCTOUs require a permanently running script/exe\n\t// - Create the file in the user's AppData temp directory => TOCTOUs can't be enacted by a different user\n\t// - Create the file with Administrator access only => TOCTOUs require elevated privileges (in which case\n\t// the machine is already compromised anyway, so TOCTOU attacks become entirely moot)\n\t// See https://github.com/pbatard/rufus/security/advisories/GHSA-hcx5-hrhj-xhq9 and CVE-2026-23988.\n\tstatic_sprintf(script_path, \"%s%s.ps1\", temp_dir, GuidToString(&guid, TRUE));\n\thFile = CreateFileRestrictedU(script_path, GENERIC_WRITE, FILE_SHARE_READ, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY);\n\tif (hFile == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Unable to create download script '%s': %s\", script_path, WindowsErrorString());\n\t\tgoto out;\n\t}\n\tif ((!WriteFile(hFile, fido_script, fido_len, &dwSize, NULL)) || (dwSize != fido_len)) {\n\t\tuprintf(\"Unable to write download script '%s': %s\", script_path, WindowsErrorString());\n\t\tgoto out;\n\t}\n\tsafe_closehandle(hFile);\n#endif\n\tstatic_sprintf(powershell_path, \"%s\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe\", system_dir);\n\tstatic_sprintf(locale_str, \"%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s\",\n\t\tselected_locale->txt[0], lmprintf(MSG_135), lmprintf(MSG_136), lmprintf(MSG_137),\n\t\tlmprintf(MSG_138), lmprintf(MSG_139), lmprintf(MSG_040), lmprintf(MSG_140), lmprintf(MSG_141),\n\t\tlmprintf(MSG_006), lmprintf(MSG_007), lmprintf(MSG_042), lmprintf(MSG_142), lmprintf(MSG_143),\n\t\tlmprintf(MSG_144), lmprintf(MSG_145), lmprintf(MSG_146), lmprintf(MSG_199));\n\n\thPipe = CreateNamedPipeA(pipe, PIPE_ACCESS_INBOUND,\n\t\tPIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,\n\t\tdwPipeSize, dwPipeSize, 0, NULL);\n\tif (hPipe == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Could not create pipe '%s': %s\", pipe, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t// Ideally, since our script is signed, we'd have '-ExecutionPolicy AllSigned' below.\n\t// Except that, in the myriad of execution policy options they provide, Microsoft chose\n\t// not to add an option that allows signed scripts that validate up to the root of trust,\n\t// but aren't in Trusted Publishers, to be validated:\n\t// https://old.reddit.com/r/PowerShell/comments/kpwi5r/powershell_script_signing_trusted_publisher_prompt/gzi10oc/\n\tstatic_sprintf(cmdline, \"\\\"%s\\\" -NonInteractive -Sta -NoProfile -ExecutionPolicy Bypass \"\n\t\t\"-File \\\"%s\\\" -PipeName %s -LocData \\\"%s\\\" -Icon \\\"%s\\\" -AppTitle \\\"%s\\\" -PlatformArch \\\"%s\\\"\",\n\t\tpowershell_path, script_path, &pipe[9], locale_str, icon_path, lmprintf(MSG_149), GetArchName(NativeMachine));\n\n#ifndef RUFUS_TEST\n\t// Because we can't force PowerShell to do it, we validate the signature of the local script.\n\tif (ValidateSignature(INVALID_HANDLE_VALUE, script_path) != NO_ERROR) {\n\t\tuprintf(\"FATAL: Script signature is invalid ✗\");\n\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_BAD_SIGNATURE));\n\t\tSendMessage(hProgress, PBM_SETSTATE, (WPARAM)PBST_ERROR, 0);\n\t\tSetTaskbarProgressState(TASKBAR_ERROR);\n\t\tgoto out;\n\t}\n\tuprintf(\"Script signature is valid ✓\");\n#endif\n\n\tErrorStatus = 0;\n\tdwExitCode = RunCommand(cmdline, app_data_dir, TRUE);\n\tuprintf(\"Exited download script with code: %d\", dwExitCode);\n\tif ((dwExitCode == 0) && PeekNamedPipe(hPipe, NULL, dwPipeSize, NULL, &dwAvail, NULL) && (dwAvail != 0)) {\n\t\turl = malloc(dwAvail + 1);\n\t\tdwSize = 0;\n\t\tif ((url != NULL) && ReadFile(hPipe, url, dwAvail, &dwSize, NULL) && (dwSize > 4)) {\n#else\n\t{\t{\turl = strdup(FORCE_URL);\n\t\t\tdwSize = (DWORD)strlen(FORCE_URL);\n#endif\n\t\t\tIMG_SAVE img_save = { 0 };\n\t\t\turl[min(dwSize, dwAvail)] = 0;\n\t\t\tEXT_DECL(img_ext, GetShortName(url), __VA_GROUP__(\"*.iso\"), __VA_GROUP__(lmprintf(MSG_036)));\n\t\t\timg_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_ISO;\n\t\t\timg_save.ImagePath = FileDialog(TRUE, NULL, &img_ext, NULL);\n\t\t\tif (img_save.ImagePath == NULL) {\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\t// Download the ISO and report errors if any\n\t\t\tSendMessage(hMainDialog, UM_PROGRESS_INIT, 0, 0);\n\t\t\tErrorStatus = 0;\n\t\t\tSendMessage(hMainDialog, UM_TIMER_START, 0, 0);\n\t\t\tif (DownloadToFileOrBuffer(url, img_save.ImagePath, NULL, hMainDialog, TRUE) == 0) {\n\t\t\t\tSendMessage(hMainDialog, UM_PROGRESS_EXIT, 0, 0);\n\t\t\t\tif (SCODE_CODE(ErrorStatus) == ERROR_CANCELLED) {\n\t\t\t\t\tuprintf(\"Download cancelled by user\");\n\t\t\t\t\tNotification(MB_ICONINFORMATION | MB_CLOSE, lmprintf(MSG_211), lmprintf(MSG_041));\n\t\t\t\t\tPrintInfo(0, MSG_211);\n\t\t\t\t} else {\n\t\t\t\t\tNotification(MB_ICONERROR | MB_CLOSE, lmprintf(MSG_194, GetShortName(url)), lmprintf(MSG_043, WindowsErrorString()));\n\t\t\t\t\tPrintInfo(0, MSG_212);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Download was successful => Select and scan the ISO\n\t\t\t\timage_path = safe_strdup(img_save.ImagePath);\n\t\t\t\tPostMessage(hMainDialog, UM_SELECT_ISO, 0, 0);\n\t\t\t}\n\t\t\tsafe_free(img_save.ImagePath);\n\t\t}\n\t}\n\nout:\n\tsafe_closehandle(hPipe);\n\tsafe_closehandle(hFile);\n\tif (icon_path[0] != '\\0')\n\t\tDeleteFileU(icon_path);\n#if !defined(RUFUS_TEST)\n\tif (script_path[0] != '\\0') {\n\t\tSetFileAttributesU(script_path, FILE_ATTRIBUTE_NORMAL);\n\t\tDeleteFileU(script_path);\n\t}\n#endif\n\tfree(url);\n\tSendMessage(hMainDialog, UM_ENABLE_CONTROLS, 0, 0);\n\tdialog_showing--;\n\tCoUninitialize();\n\tExitThread(dwExitCode);\n}\n\nBOOL DownloadISO()\n{\n\tif (CreateThread(NULL, 0, DownloadISOThread, NULL, 0, NULL) == NULL) {\n\t\tuprintf(\"Unable to start Windows ISO download thread\");\n\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_START_THREAD));\n\t\tSendMessage(hMainDialog, UM_ENABLE_CONTROLS, 0, 0);\n\t\treturn FALSE;\n\t}\n\treturn TRUE;\n}\n\nBOOL IsDownloadable(const char* url)\n{\n\tDWORD dwSize, dwTotalSize = 0;\n\tconst char* accept_types[] = { \"*/*\\0\", NULL };\n\tchar hostname[64], urlpath[128];\n\tHINTERNET hSession = NULL, hConnection = NULL, hRequest = NULL;\n\tURL_COMPONENTSA UrlParts = { sizeof(URL_COMPONENTSA), NULL, 1, (INTERNET_SCHEME)0,\n\t\thostname, sizeof(hostname), 0, NULL, 1, urlpath, sizeof(urlpath), NULL, 1 };\n\n\tif (url == NULL)\n\t\treturn FALSE;\n\n\tErrorStatus = 0;\n\tDownloadStatus = 404;\n\n\tif ((!InternetCrackUrlA(url, (DWORD)safe_strlen(url), 0, &UrlParts))\n\t\t|| (UrlParts.lpszHostName == NULL) || (UrlParts.lpszUrlPath == NULL))\n\t\tgoto out;\n\thostname[sizeof(hostname) - 1] = 0;\n\n\t// Open an Internet session\n\thSession = GetInternetSession(NULL, FALSE);\n\tif (hSession == NULL)\n\t\tgoto out;\n\n\thConnection = InternetConnectA(hSession, UrlParts.lpszHostName, UrlParts.nPort, NULL, NULL, INTERNET_SERVICE_HTTP, 0, (DWORD_PTR)NULL);\n\tif (hConnection == NULL)\n\t\tgoto out;\n\n\thRequest = HttpOpenRequestA(hConnection, \"GET\", UrlParts.lpszUrlPath, NULL, NULL, accept_types,\n\t\tINTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS |\n\t\tINTERNET_FLAG_NO_COOKIES | INTERNET_FLAG_NO_UI | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_HYPERLINK |\n\t\t((UrlParts.nScheme == INTERNET_SCHEME_HTTPS) ? INTERNET_FLAG_SECURE : 0), (DWORD_PTR)NULL);\n\tif (hRequest == NULL)\n\t\tgoto out;\n\n\t// Must use \"Accept-Encoding: identity\" to get the file size\n\tHttpSendRequestA(hRequest, \"Accept-Encoding: identity\", -1L, NULL, 0);\n\n\t// Get the file size\n\tdwSize = sizeof(DownloadStatus);\n\tHttpQueryInfoA(hRequest, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, (LPVOID)&DownloadStatus, &dwSize, NULL);\n\tif (DownloadStatus != 200)\n\t\tgoto out;\n\tdwSize = sizeof(dwTotalSize);\n\tHttpQueryInfoA(hRequest, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, (LPVOID)&dwTotalSize, &dwSize, NULL);\n\nout:\n\tif (hRequest)\n\t\tInternetCloseHandle(hRequest);\n\tif (hConnection)\n\t\tInternetCloseHandle(hConnection);\n\tif (hSession)\n\t\tInternetCloseHandle(hSession);\n\n\treturn (dwTotalSize > 0);\n}\n"
  },
  {
    "path": "src/ntdll.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * ntdll definitions & process search functionality\n *\n * Modified from System Informer (a.k.a. Process Hacker):\n *   https://github.com/winsiderss/systeminformer\n * Copyright © 2017-2026 Pete Batard <pete@akeo.ie>\n * Copyright © 2017 dmex\n * Copyright © 2009-2016 wj32\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <windows.h>\n#include <winnt.h>\n#include <winternl.h>\n#include <stdint.h>\n\n#pragma once\n\n#define PH_LARGE_BUFFER_SIZE\t\t\t(256 * 1024 * 1024)\n\n#define STATUS_SUCCESS\t\t\t\t\t((NTSTATUS)0x00000000L)\n#define STATUS_ALREADY_COMPLETE\t\t\t((NTSTATUS)0x000000FFL)\n#define STATUS_UNSUCCESSFUL\t\t\t\t((NTSTATUS)0x80000001L)\n#define STATUS_BUFFER_OVERFLOW\t\t\t((NTSTATUS)0x80000005L)\n#define STATUS_NOT_IMPLEMENTED\t\t\t((NTSTATUS)0xC0000002L)\n#define STATUS_INFO_LENGTH_MISMATCH\t\t((NTSTATUS)0xC0000004L)\n//#define STATUS_INVALID_HANDLE\t\t\t((NTSTATUS)0xC0000008L)\n#define STATUS_ACCESS_DENIED\t\t\t((NTSTATUS)0xC0000022L)\n#define STATUS_BUFFER_TOO_SMALL\t\t\t((NTSTATUS)0xC0000023L)\n#define STATUS_OBJECT_TYPE_MISMATCH\t\t((NTSTATUS)0xC0000024L)\n#define STATUS_OBJECT_NAME_INVALID\t\t((NTSTATUS)0xC0000033L)\n#define STATUS_OBJECT_NAME_NOT_FOUND\t((NTSTATUS)0xC0000034L)\n#define STATUS_OBJECT_PATH_INVALID\t\t((NTSTATUS)0xC0000039L)\n#define STATUS_SHARING_VIOLATION\t\t((NTSTATUS)0xC0000043L)\n#define STATUS_PROCEDURE_NOT_FOUND\t\t((NTSTATUS)0xC000007AL)\n#define STATUS_INSUFFICIENT_RESOURCES\t((NTSTATUS)0xC000009AL)\n#define STATUS_NOT_SUPPORTED\t\t\t((NTSTATUS)0xC00000BBL)\n\n#define SystemExtendedHandleInformation    64\n#define FileProcessIdsUsingFileInformation 47\n\n// MinGW doesn't know this one yet\n#if !defined(PROCESSOR_ARCHITECTURE_ARM64)\n#define PROCESSOR_ARCHITECTURE_ARM64       12\n#endif\n\n#define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)\n\ntypedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX\n{\n\tPVOID Object;\n\tULONG_PTR UniqueProcessId;\n\tULONG_PTR HandleValue;\n\tULONG GrantedAccess;\n\tUSHORT CreatorBackTraceIndex;\n\tUSHORT ObjectTypeIndex;\n\tULONG HandleAttributes;\n\tULONG Reserved;\n} SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO_EX;\n\ntypedef struct _SYSTEM_HANDLE_INFORMATION_EX\n{\n\tULONG_PTR NumberOfHandles;\n\tULONG_PTR Reserved;\n\tSYSTEM_HANDLE_TABLE_ENTRY_INFO_EX Handles[1];\n} SYSTEM_HANDLE_INFORMATION_EX, *PSYSTEM_HANDLE_INFORMATION_EX;\n\n#if defined(_MSC_VER)\ntypedef struct _OBJECT_NAME_INFORMATION\n{\n\tUNICODE_STRING Name;\n} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;\n\ntypedef struct _OBJECT_TYPE_INFORMATION\n{\n\tUNICODE_STRING TypeName;\n\tULONG TotalNumberOfObjects;\n\tULONG TotalNumberOfHandles;\n\tULONG TotalPagedPoolUsage;\n\tULONG TotalNonPagedPoolUsage;\n\tULONG TotalNamePoolUsage;\n\tULONG TotalHandleTableUsage;\n\tULONG HighWaterNumberOfObjects;\n\tULONG HighWaterNumberOfHandles;\n\tULONG HighWaterPagedPoolUsage;\n\tULONG HighWaterNonPagedPoolUsage;\n\tULONG HighWaterNamePoolUsage;\n\tULONG HighWaterHandleTableUsage;\n\tULONG InvalidAttributes;\n\tGENERIC_MAPPING GenericMapping;\n\tULONG ValidAccessMask;\n\tBOOLEAN SecurityRequired;\n\tBOOLEAN MaintainHandleCount;\n\tUCHAR TypeIndex; // since WINBLUE\n\tCHAR ReservedByte;\n\tULONG PoolType;\n\tULONG DefaultPagedPoolCharge;\n\tULONG DefaultNonPagedPoolCharge;\n} OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;\n\n#define ObjectNameInformation  1\n#endif\n#define ObjectTypesInformation 3\n\ntypedef struct _OBJECT_TYPES_INFORMATION\n{\n\tULONG NumberOfTypes;\n} OBJECT_TYPES_INFORMATION, *POBJECT_TYPES_INFORMATION;\n\ntypedef struct _PROCESS_BASIC_INFORMATION_INTERNAL\n{\n\tNTSTATUS ExitStatus;\n\tULONG_PTR PebBaseAddress;\n\tULONG_PTR AffinityMask;\n\tKPRIORITY BasePriority;\n\tULONG_PTR UniqueProcessId;\n\tULONG_PTR InheritedFromUniqueProcessId;\n} PROCESS_BASIC_INFORMATION_INTERNAL;\n\ntypedef struct _UNICODE_STRING_WOW64\n{\n\tUSHORT Length;\n\tUSHORT MaximumLength;\n\tULONGLONG Buffer;\n} UNICODE_STRING_WOW64;\n\ntypedef struct _FILE_PROCESS_IDS_USING_FILE_INFORMATION\n{\n\tULONG NumberOfProcessIdsInList;\n\tULONG_PTR ProcessIdList[1];\n} FILE_PROCESS_IDS_USING_FILE_INFORMATION, *PFILE_PROCESS_IDS_USING_FILE_INFORMATION;\n\n#define ALIGN_UP_BY(Address, Align) (((ULONG_PTR)(Address) + (Align) - 1) & ~((Align) - 1))\n#define ALIGN_UP(Address, Type) ALIGN_UP_BY(Address, sizeof(Type))\n\n#define PH_FIRST_OBJECT_TYPE(ObjectTypes) \\\n\t(POBJECT_TYPE_INFORMATION)((PCHAR)(ObjectTypes) + ALIGN_UP(sizeof(OBJECT_TYPES_INFORMATION), ULONG_PTR))\n\n#define PH_NEXT_OBJECT_TYPE(ObjectType) \\\n\t(POBJECT_TYPE_INFORMATION)((PCHAR)(ObjectType) + sizeof(OBJECT_TYPE_INFORMATION) + \\\n\tALIGN_UP(ObjectType->TypeName.MaximumLength, ULONG_PTR))\n\n// Heaps\n\ntypedef struct _RTL_HEAP_ENTRY\n{\n\tSIZE_T Size;\n\tUSHORT Flags;\n\tUSHORT AllocatorBackTraceIndex;\n\tunion\n\t{\n\t\tstruct\n\t\t{\n\t\t\tSIZE_T Settable;\n\t\t\tULONG Tag;\n\t\t} s1;\n\t\tstruct\n\t\t{\n\t\t\tSIZE_T CommittedSize;\n\t\t\tPVOID FirstBlock;\n\t\t} s2;\n\t} u;\n} RTL_HEAP_ENTRY, *PRTL_HEAP_ENTRY;\n\n#define RTL_HEAP_BUSY (USHORT)0x0001\n#define RTL_HEAP_SEGMENT (USHORT)0x0002\n#define RTL_HEAP_SETTABLE_VALUE (USHORT)0x0010\n#define RTL_HEAP_SETTABLE_FLAG1 (USHORT)0x0020\n#define RTL_HEAP_SETTABLE_FLAG2 (USHORT)0x0040\n#define RTL_HEAP_SETTABLE_FLAG3 (USHORT)0x0080\n#define RTL_HEAP_SETTABLE_FLAGS (USHORT)0x00e0\n#define RTL_HEAP_UNCOMMITTED_RANGE (USHORT)0x0100\n#define RTL_HEAP_PROTECTED_ENTRY (USHORT)0x0200\n\ntypedef struct _RTL_HEAP_TAG\n{\n\tULONG NumberOfAllocations;\n\tULONG NumberOfFrees;\n\tSIZE_T BytesAllocated;\n\tUSHORT TagIndex;\n\tUSHORT CreatorBackTraceIndex;\n\tWCHAR TagName[24];\n} RTL_HEAP_TAG, *PRTL_HEAP_TAG;\n\ntypedef struct _RTL_HEAP_INFORMATION\n{\n\tPVOID BaseAddress;\n\tULONG Flags;\n\tUSHORT EntryOverhead;\n\tUSHORT CreatorBackTraceIndex;\n\tSIZE_T BytesAllocated;\n\tSIZE_T BytesCommitted;\n\tULONG NumberOfTags;\n\tULONG NumberOfEntries;\n\tULONG NumberOfPseudoTags;\n\tULONG PseudoTagGranularity;\n\tULONG Reserved[5];\n\tPRTL_HEAP_TAG Tags;\n\tPRTL_HEAP_ENTRY Entries;\n} RTL_HEAP_INFORMATION, *PRTL_HEAP_INFORMATION;\n\ntypedef struct _RTL_PROCESS_HEAPS\n{\n\tULONG NumberOfHeaps;\n\tRTL_HEAP_INFORMATION Heaps[1];\n} RTL_PROCESS_HEAPS, *PRTL_PROCESS_HEAPS;\n\ntypedef NTSTATUS(NTAPI *PRTL_HEAP_COMMIT_ROUTINE)(\n\t_In_ PVOID Base,\n\t_Inout_ PVOID *CommitAddress,\n\t_Inout_ PSIZE_T CommitSize\n\t);\n\n#if defined(_MSC_VER)\ntypedef struct _RTL_HEAP_PARAMETERS\n{\n\tULONG Length;\n\tSIZE_T SegmentReserve;\n\tSIZE_T SegmentCommit;\n\tSIZE_T DeCommitFreeBlockThreshold;\n\tSIZE_T DeCommitTotalFreeThreshold;\n\tSIZE_T MaximumAllocationSize;\n\tSIZE_T VirtualMemoryThreshold;\n\tSIZE_T InitialCommit;\n\tSIZE_T InitialReserve;\n\tPRTL_HEAP_COMMIT_ROUTINE CommitRoutine;\n\tSIZE_T Reserved[2];\n} RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;\n#endif\n\n#define HEAP_SETTABLE_USER_VALUE 0x00000100\n#define HEAP_SETTABLE_USER_FLAG1 0x00000200\n#define HEAP_SETTABLE_USER_FLAG2 0x00000400\n#define HEAP_SETTABLE_USER_FLAG3 0x00000800\n#define HEAP_SETTABLE_USER_FLAGS 0x00000e00\n\n#define HEAP_CLASS_0 0x00000000 // Process heap\n#define HEAP_CLASS_1 0x00001000 // Private heap\n#define HEAP_CLASS_2 0x00002000 // Kernel heap\n#define HEAP_CLASS_3 0x00003000 // GDI heap\n#define HEAP_CLASS_4 0x00004000 // User heap\n#define HEAP_CLASS_5 0x00005000 // Console heap\n#define HEAP_CLASS_6 0x00006000 // User desktop heap\n#define HEAP_CLASS_7 0x00007000 // CSR shared heap\n#define HEAP_CLASS_8 0x00008000 // CSR port heap\n#define HEAP_CLASS_MASK 0x0000f000\n\n// Privileges\n\n#define SE_MIN_WELL_KNOWN_PRIVILEGE (2L)\n#define SE_CREATE_TOKEN_PRIVILEGE (2L)\n#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE (3L)\n#define SE_LOCK_MEMORY_PRIVILEGE (4L)\n#define SE_INCREASE_QUOTA_PRIVILEGE (5L)\n#define SE_MACHINE_ACCOUNT_PRIVILEGE (6L)\n#define SE_TCB_PRIVILEGE (7L)\n#define SE_SECURITY_PRIVILEGE (8L)\n#define SE_TAKE_OWNERSHIP_PRIVILEGE (9L)\n#define SE_LOAD_DRIVER_PRIVILEGE (10L)\n#define SE_SYSTEM_PROFILE_PRIVILEGE (11L)\n#define SE_SYSTEMTIME_PRIVILEGE (12L)\n#define SE_PROF_SINGLE_PROCESS_PRIVILEGE (13L)\n#define SE_INC_BASE_PRIORITY_PRIVILEGE (14L)\n#define SE_CREATE_PAGEFILE_PRIVILEGE (15L)\n#define SE_CREATE_PERMANENT_PRIVILEGE (16L)\n#define SE_BACKUP_PRIVILEGE (17L)\n#define SE_RESTORE_PRIVILEGE (18L)\n#define SE_SHUTDOWN_PRIVILEGE (19L)\n#define SE_DEBUG_PRIVILEGE (20L)\n#define SE_AUDIT_PRIVILEGE (21L)\n#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE (22L)\n#define SE_CHANGE_NOTIFY_PRIVILEGE (23L)\n#define SE_REMOTE_SHUTDOWN_PRIVILEGE (24L)\n#define SE_UNDOCK_PRIVILEGE (25L)\n#define SE_SYNC_AGENT_PRIVILEGE (26L)\n#define SE_ENABLE_DELEGATION_PRIVILEGE (27L)\n#define SE_MANAGE_VOLUME_PRIVILEGE (28L)\n#define SE_IMPERSONATE_PRIVILEGE (29L)\n#define SE_CREATE_GLOBAL_PRIVILEGE (30L)\n#define SE_TRUSTED_CREDMAN_ACCESS_PRIVILEGE (31L)\n#define SE_RELABEL_PRIVILEGE (32L)\n#define SE_INC_WORKING_SET_PRIVILEGE (33L)\n#define SE_TIME_ZONE_PRIVILEGE (34L)\n#define SE_CREATE_SYMBOLIC_LINK_PRIVILEGE (35L)\n#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_SYMBOLIC_LINK_PRIVILEGE\n\n#define MAX_NUM_HANDLES             16\n#define MAX_BLOCKING_PROCESSES      16\n#define SEARCH_PROCESS_LOCK_TIMEOUT 2000\n\ntypedef struct {\n\tuint64_t pid;\t\t\t// PID of the process\n\tuint8_t access_rights;\t// rwx access rights\n\tuint32_t seen_on_pass;\t// nPass value of when this process was last detected\n\tchar cmdline[2 * KB];\t// Command line for the process\n} ProcessEntry;\n\ntypedef struct {\n\tBOOL bActive;\t\t\t// Indicates whether the search for processes is currently active\n\tuint32_t nVersion[2];\t// Version indicator for the handle name list.\n\tuint32_t nHandles;\t\t// Number of handle names in the list below\n\twchar_t** wHandleName;\t// Handle names we search against\n\tHANDLE hLock;\t\t\t// Global lock to request for modifying this structure\n\tHANDLE hStart;\t\t\t// Event indicating that the search for processes can be started\n\tProcessEntry Process[MAX_BLOCKING_PROCESSES];\t// Fixed size process list\n\tuint32_t nPass;\t\t\t// Incremental counter of how many passes we ran\n} BlockingProcess;\n\n#if !defined(__MINGW32__)\ntypedef enum _FSINFOCLASS {\n\tFileFsVolumeInformation = 1,\n\tFileFsLabelInformation,\n\tFileFsSizeInformation,\n\tFileFsDeviceInformation,\n\tFileFsAttributeInformation,\n\tFileFsControlInformation,\n\tFileFsFullSizeInformation,\n\tFileFsObjectIdInformation,\n\tFileFsDriverPathInformation,\n\tFileFsVolumeFlagsInformation,\n\tFileFsMaximumInformation\n} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;\n#endif\n\nNTSYSAPI PVOID NTAPI RtlCreateHeap(\n\tIN ULONG Flags,\n\tIN PVOID HeapBase OPTIONAL,\n\tIN SIZE_T ReserveSize OPTIONAL,\n\tIN SIZE_T CommitSize OPTIONAL,\n\tIN PVOID Lock OPTIONAL,\n\tIN PRTL_HEAP_PARAMETERS Parameters OPTIONAL);\n\nNTSYSAPI PVOID NTAPI RtlAllocateHeap(\n\tIN HANDLE HeapHandle,\n\tIN ULONG Flags OPTIONAL,\n\tIN SIZE_T Size);\n\nNTSYSAPI BOOLEAN NTAPI RtlFreeHeap(\n\tIN PVOID HeapHandle,\n\tIN ULONG Flags OPTIONAL,\n\tIN PVOID BaseAddress);\n\nNTSYSAPI PVOID NTAPI RtlDestroyHeap(\n\tIN PVOID HeapHandle);\n\nNTSYSAPI NTSTATUS NTAPI NtOpenProcess(\n\tOUT PHANDLE ProcessHandle,\n\tIN ACCESS_MASK AccessMask,\n\tIN POBJECT_ATTRIBUTES ObjectAttributes,\n\tIN CLIENT_ID* ClientId);\n\nNTSYSCALLAPI NTSTATUS NTAPI NtOpenProcessToken(\n\tIN HANDLE ProcessHandle,\n\tIN ACCESS_MASK DesiredAccess,\n\tOUT PHANDLE TokenHandle);\n\nNTSYSAPI NTSTATUS NTAPI NtAdjustPrivilegesToken(\n\tIN HANDLE TokenHandle,\n\tIN BOOLEAN DisableAllPrivileges,\n\tIN PTOKEN_PRIVILEGES TokenPrivileges,\n\tIN ULONG PreviousPrivilegesLength,\n\tOUT PTOKEN_PRIVILEGES PreviousPrivileges OPTIONAL,\n\tOUT PULONG RequiredLength OPTIONAL);\n\nNTSYSAPI NTSTATUS NTAPI NtDuplicateObject(\n\tIN HANDLE SourceProcessHandle,\n\tIN PHANDLE SourceHandle,\n\tIN HANDLE TargetProcessHandle,\n\tOUT PHANDLE TargetHandle,\n\tIN ACCESS_MASK DesiredAccess OPTIONAL,\n\tIN BOOLEAN InheritHandle,\n\tIN ULONG Options);\n\nNTSYSCALLAPI NTSTATUS NTAPI NtQueryInformationFile(\n\tIN HANDLE FileHandle,\n\tOUT PIO_STATUS_BLOCK IoStatusBlock,\n\tOUT PVOID FileInformation,\n\tIN ULONG Length,\n\tIN FILE_INFORMATION_CLASS FileInformationClass);\n\nNTSYSAPI NTSTATUS NTAPI NtQueryVolumeInformationFile(\n\tIN HANDLE FileHandle,\n\tOUT PIO_STATUS_BLOCK IoStatusBlock,\n\tOUT PVOID FsInformation,\n\tIN ULONG Length,\n\tIN FS_INFORMATION_CLASS FsInformationClass);\n\nNTSYSAPI NTSTATUS NTAPI NtReadFile(IN HANDLE FileHandle,\n\tIN HANDLE Event OPTIONAL,\n\tIN PIO_APC_ROUTINE ApcRoutine OPTIONAL,\n\tIN PVOID ApcContext OPTIONAL,\n\tOUT PIO_STATUS_BLOCK IoStatusBlock,\n\tOUT PVOID Buffer,\n\tIN ULONG Length,\n\tIN PLARGE_INTEGER ByteOffset OPTIONAL,\n\tIN PULONG Key OPTIONAL);\n\nNTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE FileHandle,\n\tIN HANDLE Event OPTIONAL,\n\tIN PIO_APC_ROUTINE ApcRoutine OPTIONAL,\n\tIN PVOID ApcContext OPTIONAL,\n\tOUT PIO_STATUS_BLOCK IoStatusBlock,\n\tIN PVOID Buffer,\n\tIN ULONG Length,\n\tIN PLARGE_INTEGER ByteOffset OPTIONAL,\n\tIN PULONG Key OPTIONAL);\n\nNTSYSAPI NTSTATUS NTAPI NtFlushBuffersFile(\n\tIN HANDLE FileHandle,\n\tOUT PIO_STATUS_BLOCK IoStatusBlock);\n\nNTSYSAPI NTSTATUS NTAPI NtFsControlFile(\n\tIN HANDLE FileHandle,\n\tIN HANDLE Event,\n\tIN PIO_APC_ROUTINE  ApcRoutine,\n\tIN PVOID ApcContext,\n\tOUT PIO_STATUS_BLOCK IoStatusBlock,\n\tIN ULONG FsControlCode,\n\tIN PVOID InputBuffer,\n\tIN ULONG InputBufferLength,\n\tOUT PVOID OutputBuffer,\n\tIN ULONG OutputBufferLength);\n\nNTSYSAPI NTSTATUS NTAPI NtDelayExecution(\n\tIN BOOLEAN Alertable,\n\tIN PLARGE_INTEGER DelayInterval);\n"
  },
  {
    "path": "src/parser.c",
    "content": "/*\r\n * Rufus: The Reliable USB Formatting Utility\r\n * Elementary Unicode compliant find/replace parser\r\n * Copyright © 2012-2025 Pete Batard <pete@akeo.ie>\r\n *\r\n * This program is free software: you can redistribute it and/or modify\r\n * it under the terms of the GNU General Public License as published by\r\n * the Free Software Foundation, either version 3 of the License, or\r\n * (at your option) any later version.\r\n *\r\n * This program is distributed in the hope that it will be useful,\r\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n * GNU General Public License for more details.\r\n *\r\n * You should have received a copy of the GNU General Public License\r\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r\n */\r\n\r\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\r\n#ifdef _CRTDBG_MAP_ALLOC\r\n#include <stdlib.h>\r\n#include <crtdbg.h>\r\n#endif\r\n\r\n#include <windows.h>\r\n#include <wincrypt.h>\r\n#include <wintrust.h>\r\n#include <stdio.h>\r\n#include <wchar.h>\r\n#include <string.h>\r\n#include <malloc.h>\r\n#include <io.h>\r\n#include <fcntl.h>\r\n\r\n#include \"rufus.h\"\r\n#include \"missing.h\"\r\n#include \"msapi_utf8.h\"\r\n#include \"localization.h\"\r\n\r\nstatic const char space[] = \" \\t\";\r\nstatic const wchar_t wspace[] = L\" \\t\";\r\nstatic const char* conversion_error = \"Could not convert '%s' to UTF-16\";\r\n\r\nconst struct {char c; int flag;} attr_parse[] = {\r\n\t{ 'r', LOC_RIGHT_TO_LEFT },\r\n};\r\n\r\n/*\r\n * Fill a localization command buffer by parsing the line arguments\r\n * The command is allocated and must be freed (by calling free_loc_cmd)\r\n */\r\nstatic loc_cmd* get_loc_cmd(char c, char* line) {\r\n\tsize_t i, j, k, l, r, ti = 0, ii = 0;\r\n\tchar *endptr, *expected_endptr, *token;\r\n\tloc_cmd* lcmd = NULL;\r\n\r\n\tfor (j = 0; j<ARRAYSIZE(parse_cmd); j++) {\r\n\t\tif (c == parse_cmd[j].c)\r\n\t\t\tbreak;\r\n\t}\r\n\tif (j >= ARRAYSIZE(parse_cmd)) {\r\n\t\tluprint(\"unknown command\");\r\n\t\treturn NULL;\r\n\t}\r\n\r\n\tlcmd = (loc_cmd*)calloc(sizeof(loc_cmd), 1);\r\n\tif (lcmd == NULL) {\r\n\t\tluprint(\"could not allocate command\");\r\n\t\treturn NULL;\r\n\t}\r\n\tlcmd->command = parse_cmd[j].cmd;\r\n\tlcmd->ctrl_id = (lcmd->command <= LC_TEXT)?-1:0;\r\n\tlcmd->line_nr = (uint16_t)loc_line_nr;\r\n\r\n\ti = 0;\r\n\tfor (k = 0; parse_cmd[j].arg_type[k] != 0; k++) {\r\n\t\t// Skip leading spaces\r\n\t\ti += strspn(&line[i], space);\r\n\t\tr = i;\r\n\t\tif (line[i] == 0) {\r\n\t\t\tluprintf(\"missing parameter for command '%c'\", parse_cmd[j].c);\r\n\t\t\tgoto err;\r\n\t\t}\r\n\t\tswitch(parse_cmd[j].arg_type[k]) {\r\n\t\tcase 's':\t// quoted string\r\n\t\t\t// search leading quote\r\n\t\t\tif (line[i++] != '\"') {\r\n\t\t\t\tluprint(\"no start quote\");\r\n\t\t\t\tgoto err;\r\n\t\t\t}\r\n\t\t\tr = i;\r\n\t\t\t// locate ending quote\r\n\t\t\twhile ((line[i] != 0) && ((line[i] != '\"') || ((line[i] == '\"') && (line[i-1] == '\\\\')))) {\r\n\t\t\t\tif ((line[i] == '\"') && (line[i-1] == '\\\\')) {\r\n\t\t\t\t\tmemmove(&line[i-1], &line[i], strlen(&line[i]) + 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (line[i] == 0) {\r\n\t\t\t\tluprint(\"no end quote\");\r\n\t\t\t\tgoto err;\r\n\t\t\t}\r\n\t\t\tline[i++] = 0;\r\n\t\t\tlcmd->txt[ti++] = safe_strdup(&line[r]);\r\n\t\t\tbreak;\r\n\t\tcase 'c':\t// control ID (single word)\r\n\t\t\twhile ((line[i] != 0) && (line[i] != space[0]) && (line[i] != space[1]))\r\n\t\t\t\ti++;\r\n\t\t\tif (line[i] != 0)\r\n\t\t\t\tline[i++] = 0;\r\n\t\t\tlcmd->txt[ti++] = safe_strdup(&line[r]);\r\n\t\t\tbreak;\r\n\t\tcase 'i':\t// 32 bit signed integer\r\n\t\t\t// allow commas or dots between values\r\n\t\t\tif ((line[i] == ',') || (line[i] == '.')) {\r\n\t\t\t\ti += strspn(&line[i+1], space);\r\n\t\t\t\tr = i;\r\n\t\t\t}\r\n\t\t\twhile ((line[i] != 0) && (line[i] != space[0]) && (line[i] != space[1])\r\n\t\t\t\t&& (line[i] != ',') && (line[i] != '.'))\r\n\t\t\t\ti++;\r\n\t\t\texpected_endptr = &line[i];\r\n\t\t\tif (line[i] != 0)\r\n\t\t\t\tline[i++] = 0;\r\n\t\t\tlcmd->num[ii++] = (int32_t)strtol(&line[r], &endptr, 0);\r\n\t\t\tif (endptr != expected_endptr) {\r\n\t\t\t\tluprint(\"invalid integer\");\r\n\t\t\t\tgoto err;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 'u':\t// comma or dot separated list of unsigned integers (to end of line)\r\n\t\t\t// count the number of commas\r\n\t\t\tlcmd->unum_size = 1;\r\n\t\t\tfor (l = i; line[l] != 0; l++) {\r\n\t\t\t\tif ((line[l] == '.') || (line[l] == ','))\r\n\t\t\t\t\tlcmd->unum_size++;\r\n\t\t\t}\r\n\t\t\tfree(lcmd->unum);\r\n\t\t\tlcmd->unum = (uint32_t*)malloc(lcmd->unum_size * sizeof(uint32_t));\r\n\t\t\tif (lcmd->unum == NULL) {\r\n\t\t\t\tluprint(\"could not allocate memory\");\r\n\t\t\t\tgoto err;\r\n\t\t\t}\r\n\t\t\ttoken = strtok(&line[i], \".,\");\r\n\t\t\tfor (l=0; (l<lcmd->unum_size) && (token != NULL); l++) {\r\n\t\t\t\tlcmd->unum[l] = (int32_t)strtol(token, &endptr, 0);\r\n\t\t\t\ttoken = strtok(NULL, \".,\");\r\n\t\t\t}\r\n\t\t\tif ((token != NULL) || (l != lcmd->unum_size)) {\r\n\t\t\t\tluprint(\"internal error (unexpected number of numeric values)\");\r\n\t\t\t\tgoto err;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tuprintf(\"localization: unhandled arg_type '%c'\\n\", parse_cmd[j].arg_type[k]);\r\n\t\t\tgoto err;\r\n\t\t}\r\n\t}\r\n\r\n\treturn lcmd;\r\n\r\nerr:\r\n\tfree_loc_cmd(lcmd);\r\n\treturn NULL;\r\n}\r\n\r\n/*\r\n * Parse an UTF-8 localization command line\r\n */\r\nstatic void get_loc_data_line(char* line)\r\n{\r\n\tsize_t i;\r\n\tloc_cmd* lcmd = NULL;\r\n\tchar t;\r\n\r\n\tif ((line == NULL) || (line[0] == 0))\r\n\t\treturn;\r\n\r\n\t// Skip leading spaces\r\n\ti = strspn(line, space);\r\n\r\n\t// Read token (NUL character will be read if EOL)\r\n\tt = line[i++];\r\n\tif (t == '#')\t// Comment\r\n\t\treturn;\r\n\tif ((t == 0) || ((line[i] != space[0]) && (line[i] != space[1]))) {\r\n\t\tluprintf(\"syntax error: '%s'\", line);\r\n\t\treturn;\r\n\t}\r\n\r\n\tlcmd = get_loc_cmd(t, &line[i]);\r\n\r\n\tif ((lcmd != NULL) && (lcmd->command != LC_LOCALE))\r\n\t\t// TODO: check return value?\r\n\t\tdispatch_loc_cmd(lcmd);\r\n\telse\r\n\t\tfree_loc_cmd(lcmd);\r\n}\r\n\r\n/*\r\n * Open a localization file and store its file name, with special case\r\n * when dealing with the embedded loc file.\r\n */\r\nFILE* open_loc_file(const char* filename)\r\n{\r\n\tFILE* fd = NULL;\r\n\twchar_t *wfilename = NULL;\r\n\tconst char* tmp_ext = \".tmp\";\r\n\r\n\tif (filename == NULL)\r\n\t\treturn NULL;\r\n\r\n\tif (loc_filename != embedded_loc_filename) {\r\n\t\tsafe_free(loc_filename);\r\n\t}\r\n\tif (safe_strcmp(tmp_ext, &filename[safe_strlen(filename)-4]) == 0) {\r\n\t\tloc_filename = embedded_loc_filename;\r\n\t} else {\r\n\t\tloc_filename = safe_strdup(filename);\r\n\t}\r\n\twfilename = utf8_to_wchar(filename);\r\n\tif (wfilename == NULL) {\r\n\t\tuprintf(conversion_error, filename);\r\n\t\tgoto out;\r\n\t}\r\n\tfd = _wfopen(wfilename, L\"rb\");\r\n\tif (fd == NULL) {\r\n\t\tuprintf(\"localization: could not open '%s'\\n\", filename);\r\n\t}\r\n\r\nout:\r\n\tsafe_free(wfilename);\r\n\treturn fd;\r\n}\r\n\r\n/*\r\n * Parse a localization file, to construct the list of available locales.\r\n * The locale file must be UTF-8 with NO BOM.\r\n */\r\nBOOL get_supported_locales(const char* filename)\r\n{\r\n\tFILE* fd = NULL;\r\n\tBOOL r = FALSE;\r\n\tchar line[1024];\r\n\tsize_t i, j, k;\r\n\tloc_cmd *lcmd = NULL, *last_lcmd = NULL;\r\n\tlong end_of_block;\r\n\tint version_line_nr = 0;\r\n\tuint32_t loc_base_major = -1, loc_base_minor = -1;\r\n\r\n\tfd = open_loc_file(filename);\r\n\tif (fd == NULL)\r\n\t\tgoto out;\r\n\r\n\t// Check that the file doesn't contain a BOM and was saved in DOS mode\r\n\ti = fread(line, 1, sizeof(line), fd);\r\n\tif (i < sizeof(line)) {\r\n\t\tuprintf(\"Invalid loc file: the file is too small!\");\r\n\t\tgoto out;\r\n\t}\r\n\tif (((uint8_t)line[0]) > 0x80) {\r\n\t\tuprintf(\"Invalid loc file: the file should not have a BOM (Byte Order Mark)\");\r\n\t\tgoto out;\r\n\t}\r\n\tfor (i=0; i<sizeof(line)-1; i++)\r\n\t\tif ((((uint8_t)line[i]) == 0x0D) && (((uint8_t)line[i+1]) == 0x0A)) break;\r\n\tif (i >= sizeof(line)-1) {\r\n\t\tuprintf(\"Invalid loc file: the file MUST be saved in DOS mode (CR/LF)\");\r\n\t\tgoto out;\r\n\t}\r\n\tfseek(fd, 0, SEEK_SET);\r\n\r\n\tloc_line_nr = 0;\r\n\tline[0] = 0;\r\n\tfree_locale_list();\r\n\tdo {\r\n\t\t// adjust the last block\r\n\t\tend_of_block = ftell(fd);\r\n\t\tif (fgets(line, sizeof(line), fd) == NULL)\r\n\t\t\tbreak;\r\n\t\tloc_line_nr++;\r\n\t\t// Skip leading spaces\r\n\t\ti = strspn(line, space);\r\n\t\tif ((line[i] != 'l') && (line[i] != 'v') && (line[i] != 'a'))\r\n\t\t\tcontinue;\r\n\t\t// line[i] is not NUL so i+1 is safe to access\r\n\t\t// coverity[tainted_data]\r\n\t\tlcmd = get_loc_cmd(line[i], &line[i+1]);\r\n\t\tif ((lcmd == NULL) || ((lcmd->command != LC_LOCALE) && (lcmd->command != LC_VERSION) && (lcmd->command != LC_ATTRIBUTES))) {\r\n\t\t\tfree_loc_cmd(lcmd);\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tswitch (lcmd->command) {\r\n\t\tcase LC_LOCALE:\r\n\t\t\t// we use num[0] and num[1] as block delimiter index for this locale in the file\r\n\t\t\tif (last_lcmd != NULL) {\r\n\t\t\t\tif (version_line_nr == 0) {\r\n\t\t\t\t\tuprintf(\"localization: no compatible version was found - this locale will be ignored\\n\");\r\n\t\t\t\t\tlist_del(&last_lcmd->list);\r\n\t\t\t\t\tfree_loc_cmd(last_lcmd);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlast_lcmd->num[1] = (int32_t)end_of_block;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlcmd->num[0] = (int32_t)ftell(fd);\r\n\t\t\t// Add our locale command to the locale list\r\n\t\t\tlist_add_tail(&lcmd->list, &locale_list);\r\n\t\t\tuprintf(\"localization: found locale '%s'\\n\", lcmd->txt[0]);\r\n\t\t\tlast_lcmd = lcmd;\r\n\t\t\tversion_line_nr = 0;\r\n\t\t\tbreak;\r\n\t\tcase LC_ATTRIBUTES:\r\n\t\t\tif (last_lcmd == NULL) {\r\n\t\t\t\tluprint(\"[a]ttributes cannot precede [l]ocale\");\r\n\t\t\t} else for(j=0; lcmd->txt[0][j] != 0; j++) {\r\n\t\t\t\tfor (k=0; k<ARRAYSIZE(attr_parse); k++) {\r\n\t\t\t\t\tif (attr_parse[k].c == lcmd->txt[0][j]) {\r\n\t\t\t\t\t\t// Repurpose ctrl_id as an attributes mask\r\n\t\t\t\t\t\tlast_lcmd->ctrl_id |= attr_parse[k].flag;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (k >= ARRAYSIZE(attr_parse))\r\n\t\t\t\t\tluprintf(\"unknown attribute '%c' - ignored\", lcmd->txt[0][j]);\r\n\t\t\t}\r\n\t\t\tfree_loc_cmd(lcmd);\r\n\t\t\tbreak;\r\n\t\tcase LC_VERSION:\r\n\t\t\tif (version_line_nr != 0) {\r\n\t\t\t\tluprintf(\"[v]ersion was already provided at line %d\", version_line_nr);\r\n\t\t\t} else if (lcmd->unum_size != 2) {\r\n\t\t\t\tluprint(\"[v]ersion format is invalid\");\r\n\t\t\t} else if (last_lcmd == NULL) {\r\n\t\t\t\tluprint(\"[v]ersion cannot precede [l]ocale\");\r\n\t\t\t} else if (loc_base_major == -1) {\r\n\t\t\t\t// We use the first version from our loc file (usually en-US) as our base\r\n\t\t\t\t// as it should always be the most up to date.\r\n\t\t\t\tloc_base_major = lcmd->unum[0];\r\n\t\t\t\tloc_base_minor = lcmd->unum[1];\r\n\t\t\t\tversion_line_nr = loc_line_nr;\r\n\t\t\t} else {\r\n\t\t\t\tif ((lcmd->unum[0] < loc_base_major) || ((lcmd->unum[0] == loc_base_major) && (lcmd->unum[1] < loc_base_minor))) {\r\n\t\t\t\t\tlast_lcmd->ctrl_id |= LOC_NEEDS_UPDATE;\r\n\t\t\t\t\tluprintf(\"the version of this translation is older than the base one and may result in some messages not being properly translated.\\n\"\r\n\t\t\t\t\t\t\"If you are the translator, please update your translation with the changes that intervened between v%d.%d and v%d.%d.\\n\"\r\n\t\t\t\t\t\t\"See https://github.com/pbatard/rufus/blob/master/res/loc/ChangeLog.txt\",\r\n\t\t\t\t\t\tlcmd->unum[0], lcmd->unum[1], loc_base_major, loc_base_minor);\r\n\t\t\t\t}\r\n\t\t\t\tversion_line_nr = loc_line_nr;\r\n\t\t\t}\r\n\t\t\tfree_loc_cmd(lcmd);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t} while (1);\r\n\tif (last_lcmd != NULL) {\r\n\t\tif (version_line_nr == 0) {\r\n\t\t\tuprintf(\"localization: no compatible version was found - this locale will be ignored\\n\");\r\n\t\t\tlist_del(&last_lcmd->list);\r\n\t\t\tfree_loc_cmd(last_lcmd);\r\n\t\t} else {\r\n\t\t\tlast_lcmd->num[1] = (int32_t)ftell(fd);\r\n\t\t}\r\n\t}\r\n\tr = !list_empty(&locale_list);\r\n\tif (r == FALSE)\r\n\t\tuprintf(\"localization: '%s' contains no valid locale sections\\n\", filename);\r\n\r\nout:\r\n\tif (fd != NULL)\r\n\t\tfclose(fd);\r\n\treturn r;\r\n}\r\n\r\n/*\r\n * Parse a locale section in a localization file (UTF-8, no BOM)\r\n * NB: this call is reentrant for the \"base\" command support\r\n */\r\nBOOL get_loc_data_file(const char* filename, loc_cmd* lcmd)\r\n{\r\n\tsize_t bufsize = 1024;\r\n\tstatic FILE* fd = NULL;\r\n\tstatic BOOL populate_default = FALSE;\r\n\tchar *buf = NULL;\r\n\tsize_t i = 0;\r\n\tint r = 0, line_nr_incr = 1;\r\n\tint c = 0, eol_char = 0;\r\n\tint start_line, old_loc_line_nr = 0;\r\n\tBOOL ret = FALSE, eol = FALSE, escape_sequence = FALSE, reentrant = (fd != NULL);\r\n\tlong offset, cur_offset = -1, end_offset;\r\n\t// The default locale is always the first one\r\n\tloc_cmd* default_locale = list_entry(locale_list.next, loc_cmd, list);\r\n\r\n\tif ((lcmd == NULL) || (default_locale == NULL)) {\r\n\t\tuprintf(\"localization: no %slocale\", (default_locale == NULL)?\"default \":\" \");\r\n\t\tgoto out;\r\n\t}\r\n\r\n\tif (msg_table == NULL) {\r\n\t\t// Initialize the default message table (usually en-US)\r\n\t\tmsg_table = default_msg_table;\r\n\t\tuprintf(\"localization: initializing default message table\");\r\n\t\tpopulate_default = TRUE;\r\n\t\tget_loc_data_file(filename, default_locale);\r\n\t\tpopulate_default = FALSE;\r\n\t}\r\n\r\n\tif (reentrant) {\r\n\t\t// Called, from a 'b' command - no need to reopen the file,\r\n\t\t// just save the current offset and current line number\r\n\t\tcur_offset = ftell(fd);\r\n\t\told_loc_line_nr = loc_line_nr;\r\n\t} else {\r\n\t\tif ((filename == NULL) || (filename[0] == 0))\r\n\t\t\treturn FALSE;\r\n\t\tif (!populate_default) {\r\n\t\t\tif (lcmd == default_locale) {\r\n\t\t\t\t// The default locale has already been populated => nothing to do\r\n\t\t\t\tmsg_table = default_msg_table;\r\n\t\t\t\treturn TRUE;\r\n\t\t\t}\r\n\t\t\tmsg_table = current_msg_table;\r\n\t\t}\r\n\t\tfree_dialog_list();\r\n\t\tfd = open_loc_file(filename);\r\n\t\tif (fd == NULL)\r\n\t\t\tgoto out;\r\n\t}\r\n\r\n\toffset = (long)lcmd->num[0];\r\n\tend_offset = (long)lcmd->num[1];\r\n\tstart_line = lcmd->line_nr;\r\n\tloc_line_nr = start_line;\r\n\tbuf = (char*) malloc(bufsize);\r\n\tif (buf == NULL) {\r\n\t\tuprintf(\"localization: could not allocate line buffer\\n\");\r\n\t\tgoto out;\r\n\t}\r\n\r\n\tif (fseek(fd, offset, SEEK_SET) != 0) {\r\n\t\tuprintf(\"localization: could not rewind\\n\");\r\n\t\tgoto out;\r\n\t}\r\n\r\n\tdo {\t// custom readline handling for string collation, realloc, line numbers, etc.\r\n\t\tc = getc(fd);\r\n\t\tswitch(c) {\r\n\t\tcase EOF:\r\n\t\t\tbuf[i] = 0;\r\n\t\t\tif (!eol)\r\n\t\t\t\tloc_line_nr += line_nr_incr;\r\n\t\t\t// coverity[tainted_data]\r\n\t\t\tget_loc_data_line(buf);\r\n\t\t\tbreak;\r\n\t\tcase '\\r':\r\n\t\tcase '\\n':\r\n\t\t\tif (escape_sequence) {\r\n\t\t\t\tescape_sequence = FALSE;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t// This assumes that the EOL sequence is always the same throughout the file\r\n\t\t\tif (eol_char == 0)\r\n\t\t\t\teol_char = c;\r\n\t\t\tif (c == eol_char) {\r\n\t\t\t\tif (eol) {\r\n\t\t\t\t\tline_nr_incr++;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tloc_line_nr += line_nr_incr;\r\n\t\t\t\t\tline_nr_incr = 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbuf[i] = 0;\r\n\t\t\tif (!eol) {\r\n\t\t\t\t// Strip trailing spaces (for string collation)\r\n\t\t\t\tfor (r = ((int)i)-1; (r>0) && ((buf[r]==space[0])||(buf[r]==space[1])); r--);\r\n\t\t\t\tif (r < 0)\r\n\t\t\t\t\tr = 0;\r\n\t\t\t\teol = TRUE;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase ' ':\r\n\t\tcase '\\t':\r\n\t\t\tif (escape_sequence) {\r\n\t\t\t\tescape_sequence = FALSE;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (!eol) {\r\n\t\t\t\tbuf[i++] = (char)c;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase '\\\\':\r\n\t\t\tif (!escape_sequence) {\r\n\t\t\t\tescape_sequence = TRUE;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t// fall through on escape sequence\r\n\t\tdefault:\r\n\t\t\tif (escape_sequence) {\r\n\t\t\t\tswitch (c) {\r\n\t\t\t\tcase 'n':\t// \\n -> CRLF\r\n\t\t\t\t\tbuf[i++] = '\\r';\r\n\t\t\t\t\tbuf[i++] = '\\n';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase '\"':\t// \\\" carried as is\r\n\t\t\t\t\tbuf[i++] = '\\\\';\r\n\t\t\t\t\tbuf[i++] = '\"';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase '\\\\':\r\n\t\t\t\t\tbuf[i++] = '\\\\';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\t// ignore any other escape sequence\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tescape_sequence = FALSE;\r\n\t\t\t} else {\r\n\t\t\t\t// Collate multiline strings\r\n\t\t\t\tif ((eol) && (c == '\"') && (buf[r] == '\"')) {\r\n\t\t\t\t\ti = r;\r\n\t\t\t\t\teol = FALSE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (eol) {\r\n\t\t\t\t\tget_loc_data_line(buf);\r\n\t\t\t\t\teol = FALSE;\r\n\t\t\t\t\ti = 0;\r\n\t\t\t\t\tr = 0;\r\n\t\t\t\t}\r\n\t\t\t\tbuf[i++] = (char)c;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tif ((c == EOF) || (ftell(fd) > end_offset))\r\n\t\t\tbreak;\r\n\t\t// Have at least 2 chars extra, for \\r\\n sequences\r\n\t\tif (i >= bufsize-2) {\r\n\t\t\tbufsize *= 2;\r\n\t\t\tif (bufsize > 32768) {\r\n\t\t\t\tuprintf(\"localization: requested line buffer is larger than 32K!\\n\");\r\n\t\t\t\tgoto out;\r\n\t\t\t}\r\n\t\t\tbuf = (char*) _reallocf(buf, bufsize);\r\n\t\t\tif (buf == NULL) {\r\n\t\t\t\tuprintf(\"localization: could not grow line buffer\\n\");\r\n\t\t\t\tgoto out;\r\n\t\t\t}\r\n\t\t}\r\n\t} while(1);\r\n\tret = TRUE;\r\n\r\nout:\r\n\t// Don't close on a reentrant call\r\n\tif (reentrant) {\r\n\t\tif ((cur_offset < 0) || (fseek(fd, cur_offset, SEEK_SET) != 0)) {\r\n\t\t\tuprintf(\"localization: unable to reset reentrant position\\n\");\r\n\t\t\tret = FALSE;\r\n\t\t}\r\n\t\tloc_line_nr = old_loc_line_nr;\r\n\t} else if (fd != NULL) {\r\n\t\tfclose(fd);\r\n\t\tfd = NULL;\r\n\t}\r\n\tsafe_free(buf);\r\n\treturn ret;\r\n}\r\n\r\n\r\n/*\r\n * Parse a line of UTF-16 text and return the data if it matches the 'token'\r\n * The parsed line is of the form: [ ][<][ ]token[ ][=|>][ ][\"]data[\"][ ][<] and is\r\n * modified by the parser\r\n */\r\nstatic wchar_t* get_token_data_line(const wchar_t* wtoken, wchar_t* wline)\r\n{\r\n\tsize_t i, r;\r\n\tBOOLEAN quoteth = FALSE;\r\n\tBOOLEAN xml = FALSE;\r\n\r\n\tif ((wtoken == NULL) || (wline == NULL) || (wline[0] == 0))\r\n\t\treturn NULL;\r\n\r\n\ti = 0;\r\n\r\n\t// Skip leading spaces and opening '<'\r\n\ti += wcsspn(&wline[i], wspace);\r\n\tif (wline[i] == L'<')\r\n\t\ti++;\r\n\ti += wcsspn(&wline[i], wspace);\r\n\r\n\t// Our token should begin a line\r\n\tif (_wcsnicmp(&wline[i], wtoken, wcslen(wtoken)) != 0)\r\n\t\treturn NULL;\r\n\r\n\t// Token was found, move past token\r\n\ti += wcslen(wtoken);\r\n\r\n\t// Skip spaces\r\n\ti += wcsspn(&wline[i], wspace);\r\n\r\n\t// Check for '=' or '>' sign\r\n\tif (wline[i] == L'>')\r\n\t\txml = TRUE;\r\n\telse if (wline[i] != L'=')\r\n\t\treturn NULL;\r\n\ti++;\r\n\r\n\t// Skip spaces\r\n\ti += wcsspn(&wline[i], wspace);\r\n\r\n\t// eliminate leading quote, if it exists\r\n\tif (wline[i] == L'\"') {\r\n\t\tquoteth = TRUE;\r\n\t\ti++;\r\n\t}\r\n\r\n\t// Keep the starting pos of our data\r\n\tr = i;\r\n\r\n\t// locate end of string or quote\r\n\twhile ( (wline[i] != 0) && (((wline[i] != L'\"') && (wline[i] != L'<')) || ((wline[i] == L'\"') && (!quoteth)) || ((wline[i] == L'<') && (!xml))) )\r\n\t\ti++;\r\n\twline[i--] = 0;\r\n\r\n\t// Eliminate trailing EOL characters\r\n\twhile ((i>=r) && ((wline[i] == L'\\r') || (wline[i] == L'\\n')))\r\n\t\twline[i--] = 0;\r\n\r\n\treturn (wline[r] == 0)?NULL:&wline[r];\r\n}\r\n\r\n/*\r\n * Parse a file (ANSI or UTF-8 or UTF-16) and return the data for the 'index'th occurrence of 'token'\r\n * The returned string is UTF-8 and MUST be freed by the caller\r\n */\r\nchar* get_token_data_file_indexed(const char* token, const char* filename, int index)\r\n{\r\n\tint i = 0;\r\n\twchar_t *wtoken = NULL, *wdata= NULL, *wfilename = NULL;\r\n\twchar_t buf[1024];\r\n\tFILE* fd = NULL;\r\n\tchar *ret = NULL;\r\n\r\n\tif ((filename == NULL) || (token == NULL))\r\n\t\treturn NULL;\r\n\tif ((filename[0] == 0) || (token[0] == 0))\r\n\t\treturn NULL;\r\n\r\n\twfilename = utf8_to_wchar(filename);\r\n\tif (wfilename == NULL) {\r\n\t\tuprintf(conversion_error, filename);\r\n\t\tgoto out;\r\n\t}\r\n\twtoken = utf8_to_wchar(token);\r\n\tif (wtoken == NULL) {\r\n\t\tuprintf(conversion_error, token);\r\n\t\tgoto out;\r\n\t}\r\n\tfd = _wfopen(wfilename, L\"r, ccs=UNICODE\");\r\n\tif (fd == NULL) goto out;\r\n\r\n\t// Process individual lines. NUL is always appended.\r\n\t// Ideally, we'd check that our buffer fits the line\r\n\twhile (fgetws(buf, ARRAYSIZE(buf), fd) != NULL) {\r\n\t\twdata = get_token_data_line(wtoken, buf);\r\n\t\tif ((wdata != NULL) && (++i == index)) {\r\n\t\t\tret = wchar_to_utf8(wdata);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\nout:\r\n\tif (fd != NULL)\r\n\t\tfclose(fd);\r\n\tsafe_free(wfilename);\r\n\tsafe_free(wtoken);\r\n\treturn ret;\r\n}\r\n\r\n/*\r\n * replace or add 'data' for token 'token' in config file 'filename'\r\n */\r\nchar* set_token_data_file(const char* token, const char* data, const char* filename)\r\n{\r\n\tconst wchar_t* outmode[] = { L\"w\", L\"w, ccs=UTF-8\", L\"w, ccs=UTF-16LE\" };\r\n\twchar_t *wtoken = NULL, *wfilename = NULL, *wtmpname = NULL, *wdata = NULL, bom = 0;\r\n\twchar_t buf[1024];\r\n\tFILE *fd_in = NULL, *fd_out = NULL;\r\n\tsize_t i, size;\r\n\tint mode = 0;\r\n\tchar *ret = NULL, tmp[2];\r\n\r\n\tif ((filename == NULL) || (token == NULL) || (data == NULL))\r\n\t\treturn NULL;\r\n\tif ((filename[0] == 0) || (token[0] == 0) || (data[0] == 0))\r\n\t\treturn NULL;\r\n\r\n\twfilename = utf8_to_wchar(filename);\r\n\tif (wfilename == NULL) {\r\n\t\tuprintf(conversion_error, filename);\r\n\t\tgoto out;\r\n\t}\r\n\twtoken = utf8_to_wchar(token);\r\n\tif (wtoken == NULL) {\r\n\t\tuprintf(conversion_error, token);\r\n\t\tgoto out;\r\n\t}\r\n\twdata = utf8_to_wchar(data);\r\n\tif (wdata == NULL) {\r\n\t\tuprintf(conversion_error, data);\r\n\t\tgoto out;\r\n\t}\r\n\r\n\tfd_in = _wfopen(wfilename, L\"r, ccs=UNICODE\");\r\n\tif (fd_in == NULL) {\r\n\t\tuprintf(\"Could not open file '%s'\\n\", filename);\r\n\t\tgoto out;\r\n\t}\r\n\t// Check the input file's BOM and create an output file with the same\r\n\tif (fread(&bom, sizeof(bom), 1, fd_in) == 1) {\r\n\t\tswitch(bom) {\r\n\t\tcase 0xFEFF:\r\n\t\t\tmode = 2;\t// UTF-16 (LE)\r\n\t\t\tbreak;\r\n\t\tcase 0xBBEF:\t// Yeah, the UTF-8 BOM is really 0xEF,0xBB,0xBF, but\r\n\t\t\tmode = 1;\t// find me a non UTF-8 file that actually begins with \"ï»\"\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tmode = 0;\t// ANSI\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tfseek(fd_in, 0, SEEK_SET);\r\n\t}\r\n\r\n\twtmpname = (wchar_t*)calloc(wcslen(wfilename)+2, sizeof(wchar_t));\r\n\tif (wtmpname == NULL) {\r\n\t\tuprintf(\"Could not allocate space for temporary output name\\n\");\r\n\t\tgoto out;\r\n\t}\r\n\twcscpy(wtmpname, wfilename);\r\n\twtmpname[wcslen(wtmpname)] = '~';\r\n\r\n\tfd_out = _wfopen(wtmpname, outmode[mode]);\r\n\tif (fd_out == NULL) {\r\n\t\tuprintf(\"Could not open temporary output file '%s~'\\n\", filename);\r\n\t\tgoto out;\r\n\t}\r\n\r\n\t// Process individual lines. NUL is always appended.\r\n\twhile (fgetws(buf, ARRAYSIZE(buf), fd_in) != NULL) {\r\n\r\n\t\ti = 0;\r\n\r\n\t\t// Skip leading spaces\r\n\t\ti += wcsspn(&buf[i], wspace);\r\n\r\n\t\t// Ignore comments or section headers\r\n\t\tif ((buf[i] == ';') || (buf[i] == '[')) {\r\n\t\t\tfputws(buf, fd_out);\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// Our token should begin a line\r\n\t\tif (_wcsnicmp(&buf[i], wtoken, wcslen(wtoken)) != 0) {\r\n\t\t\tfputws(buf, fd_out);\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// Token was found, move past token\r\n\t\ti += wcslen(wtoken);\r\n\r\n\t\t// Skip spaces\r\n\t\ti += wcsspn(&buf[i], wspace);\r\n\r\n\t\t// Check for an equal sign\r\n\t\tif (buf[i] != L'=') {\r\n\t\t\tfputws(buf, fd_out);\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\ti++;\r\n\r\n\t\t// Skip spaces after equal sign\r\n\t\ti += wcsspn(&buf[i], wspace);\r\n\r\n\t\t// Output the token\r\n\t\tbuf[i] = 0;\r\n\t\tfputws(buf, fd_out);\r\n\r\n\t\t// Now output the new data\r\n\t\t// coverity[invalid_type]\r\n\t\tfwprintf_s(fd_out, L\"%s\\n\", wdata);\r\n\t\tret = (char*)data;\r\n\t}\r\n\r\n\tif (ret == NULL) {\r\n\t\t// Didn't find an existing token => append it\r\n\t\t// coverity[invalid_type]\r\n\t\tfwprintf_s(fd_out, L\"%s = %s\\n\", wtoken, wdata);\r\n\t\tret = (char*)data;\r\n\t}\r\n\r\nout:\r\n\tif (fd_in != NULL) {\r\n\t\tfclose(fd_in);\r\n\t\tfd_in = NULL;\r\n\t}\r\n\tif (fd_out != NULL)\r\n\t\tfclose(fd_out);\r\n\r\n\t// If an insertion occurred, delete existing file and use the new one\r\n\tif (ret != NULL) {\r\n\t\t// We're in Windows text mode => Remove CRs if requested\r\n\t\tif (wtmpname != NULL)\r\n\t\t\tfd_in = _wfopen(wtmpname, L\"rb\");\r\n\t\tfd_out = _wfopen(wfilename, L\"wb\");\r\n\t\t// Don't check fds\r\n\t\tif ((fd_in != NULL) && (fd_out != NULL)) {\r\n\t\t\tsize = (mode==2)?2:1;\r\n\t\t\twhile(fread(tmp, size, 1, fd_in) == 1)\r\n\t\t\t\tfwrite(tmp, size, 1, fd_out);\r\n\t\t\tfclose(fd_in);\r\n\t\t\tfclose(fd_out);\r\n\t\t} else {\r\n\t\t\tuprintf(\"Could not write '%s' - original file has been left unmodified\\n\", filename);\r\n\t\t\tret = NULL;\r\n\t\t\tif (fd_in != NULL)\r\n\t\t\t\tfclose(fd_in);\r\n\t\t\tif (fd_out != NULL)\r\n\t\t\t\tfclose(fd_out);\r\n\t\t}\r\n\t}\r\n\tif (wtmpname != NULL)\r\n\t\t_wunlink(wtmpname);\r\n\tsafe_free(wfilename);\r\n\tsafe_free(wtmpname);\r\n\tsafe_free(wtoken);\r\n\tsafe_free(wdata);\r\n\r\n\treturn ret;\r\n}\r\n\r\n/*\r\n * Parse a buffer (ANSI or UTF-8) and return the data for the 'n'th occurrence of 'token'\r\n * The returned string is UTF-8 and MUST be freed by the caller\r\n */\r\nchar* get_token_data_buffer(const char* token, unsigned int n, const char* buffer, size_t buffer_size)\r\n{\r\n\tunsigned int j, curly_count;\r\n\twchar_t *wtoken = NULL, *wdata = NULL, *wbuffer = NULL, *wline = NULL;\r\n\tsize_t i;\r\n\tBOOL done = FALSE;\r\n\tchar* ret = NULL;\r\n\r\n\t// We're handling remote data => better safe than sorry\r\n\tif ((token == NULL) || (buffer == NULL) || (buffer_size <= 4) || (buffer_size > 65536))\r\n\t\tgoto out;\r\n\r\n\t// Ensure that our buffer is NUL terminated\r\n\tif (buffer[buffer_size-1] != 0)\r\n\t\tgoto out;\r\n\r\n\twbuffer = utf8_to_wchar(buffer);\r\n\twtoken = utf8_to_wchar(token);\r\n\tif ((wbuffer == NULL) || (wtoken == NULL))\r\n\t\tgoto out;\r\n\r\n\t// Process individual lines (or multiple lines when between {}, for RTF)\r\n\tfor (i=0,j=0,done=FALSE; (j!=n)&&(!done); ) {\r\n\t\twline = &wbuffer[i];\r\n\r\n\t\tfor(curly_count=0;((curly_count>0)||((wbuffer[i]!=L'\\n')&&(wbuffer[i]!=L'\\r')))&&(wbuffer[i]!=0);i++) {\r\n\t\t\tif (wbuffer[i] == L'{') curly_count++;\r\n\t\t\tif (wbuffer[i] == L'}') curly_count--;\r\n\t\t}\r\n\t\tif (wbuffer[i]==0) {\r\n\t\t\tdone = TRUE;\r\n\t\t} else {\r\n\t\t\twbuffer[i++] = 0;\r\n\t\t}\r\n\t\twdata = get_token_data_line(wtoken, wline);\r\n\t\tif (wdata != NULL) {\r\n\t\t\tj++;\r\n\t\t}\r\n\t}\r\nout:\r\n\tif (wdata != NULL)\r\n\t\tret = wchar_to_utf8(wdata);\r\n\tsafe_free(wbuffer);\r\n\tsafe_free(wtoken);\r\n\treturn ret;\r\n}\r\n\r\nstatic __inline char* get_sanitized_token_data_buffer(const char* token, unsigned int n, const char* buffer, size_t buffer_size)\r\n{\r\n\tsize_t i;\r\n\tchar* data = get_token_data_buffer(token, n, buffer, buffer_size);\r\n\tif (data != NULL) {\r\n\t\tfor (i = 0; i < strlen(data); i++) {\r\n\t\t\tif ((data[i] == '\\\\') && (data[i+1] == 'n')) {\r\n\t\t\t\tdata[i] = '\\r';\r\n\t\t\t\tdata[i+1] = '\\n';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn data;\r\n}\r\n\r\n/*\r\n * Parse an update data file and populates a rufus_update structure.\r\n * NB: since this is remote data, and we're running elevated, it *IS* considered\r\n * potentially malicious, even if it comes from a supposedly trusted server.\r\n * len should be the size of the buffer, including the zero terminator\r\n */\r\nvoid parse_update(char* buf, size_t len)\r\n{\r\n\tsize_t i;\r\n\tchar *data = NULL, *token;\r\n\tchar allowed_rtf_chars[] = \"abcdefghijklmnopqrstuvwxyz|~-_:*'\";\r\n\tchar allowed_std_chars[] = \"\\r\\n ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\\\"$%^&+=<>(){}[].,;#@/?\";\r\n\tchar download_url_name[24];\r\n\r\n\t// strchr includes the NUL terminator in the search, so take care of backslash before NUL\r\n\tif ((buf == NULL) || (len < 2) || (len > 64 * KB) || (buf[len-1] != 0) || (buf[len-2] == '\\\\'))\r\n\t\treturn;\r\n\t// Sanitize the data - Not a silver bullet, but it helps\r\n\tlen = safe_strlen(buf)+1;\t// Someone may be inserting NULs\r\n\tfor (i = 0; i < len - 1; i++) {\r\n\t\t// Check for valid RTF sequences as well as allowed chars if not RTF\r\n\t\tif (buf[i] == '\\\\') {\r\n\t\t\t// NB: we have a zero terminator, so we can afford a +1 without overflow\r\n\t\t\tif (strchr(allowed_rtf_chars, buf[i+1]) == NULL) {\r\n\t\t\t\tbuf[i] = ' ';\r\n\t\t\t}\r\n\t\t} else if ((strchr(allowed_rtf_chars, buf[i]) == NULL) && (strchr(allowed_std_chars, buf[i]) == NULL)) {\r\n\t\t\tbuf[i] = ' ';\r\n\t\t}\r\n\t}\r\n\r\n\tfor (i = 0; i < 3; i++)\r\n\t\tupdate.version[i] = 0;\r\n\tupdate.platform_min[0] = 5;\r\n\tupdate.platform_min[1] = 2;\t// XP or later\r\n\tsafe_free(update.download_url);\r\n\tsafe_free(update.release_notes);\r\n\tif ((data = get_sanitized_token_data_buffer(\"version\", 1, buf, len)) != NULL) {\r\n\t\tfor (i = 0; (i < 3) && ((token = strtok((i == 0) ? data : NULL, \".\")) != NULL); i++) {\r\n\t\t\tupdate.version[i] = (uint16_t)atoi(token);\r\n\t\t}\r\n\t\tsafe_free(data);\r\n\t}\r\n\tif ((data = get_sanitized_token_data_buffer(\"platform_min\", 1, buf, len)) != NULL) {\r\n\t\tfor (i = 0; (i < 2) && ((token = strtok((i == 0) ? data : NULL, \".\")) != NULL); i++) {\r\n\t\t\tupdate.platform_min[i] = (uint32_t)atoi(token);\r\n\t\t}\r\n\t\tsafe_free(data);\r\n\t}\r\n\tstatic_sprintf(download_url_name, \"download_url_%s\", GetArchName(WindowsVersion.Arch));\r\n\tsafe_strtolower(download_url_name);\r\n\tupdate.download_url = get_sanitized_token_data_buffer(download_url_name, 1, buf, len);\r\n\tif (update.download_url == NULL)\r\n\t\tupdate.download_url = get_sanitized_token_data_buffer(\"download_url\", 1, buf, len);\r\n\tupdate.release_notes = get_sanitized_token_data_buffer(\"release_notes\", 1, buf, len);\r\n}\r\n\r\n/*\r\n * Insert entry 'data' under section 'section' of a config file\r\n * Section must include the relevant delimiters (eg '[', ']') if needed\r\n */\r\nchar* insert_section_data(const char* filename, const char* section, const char* data, BOOL dos2unix)\r\n{\r\n\tconst wchar_t* outmode[] = { L\"w\", L\"w, ccs=UTF-8\", L\"w, ccs=UTF-16LE\" };\r\n\twchar_t *wsection = NULL, *wfilename = NULL, *wtmpname = NULL, *wdata = NULL, bom = 0;\r\n\twchar_t buf[1024];\r\n\tFILE *fd_in = NULL, *fd_out = NULL;\r\n\tsize_t i, size;\r\n\tint mode = 0;\r\n\tchar *ret = NULL, tmp[2];\r\n\r\n\tif ((filename == NULL) || (section == NULL) || (data == NULL))\r\n\t\treturn NULL;\r\n\tif ((filename[0] == 0) || (section[0] == 0) || (data[0] == 0))\r\n\t\treturn NULL;\r\n\r\n\twfilename = utf8_to_wchar(filename);\r\n\tif (wfilename == NULL) {\r\n\t\tuprintf(conversion_error, filename);\r\n\t\tgoto out;\r\n\t}\r\n\twsection = utf8_to_wchar(section);\r\n\tif (wsection == NULL) {\r\n\t\tuprintf(conversion_error, section);\r\n\t\tgoto out;\r\n\t}\r\n\twdata = utf8_to_wchar(data);\r\n\tif (wdata == NULL) {\r\n\t\tuprintf(conversion_error, data);\r\n\t\tgoto out;\r\n\t}\r\n\r\n\tfd_in = _wfopen(wfilename, L\"r, ccs=UNICODE\");\r\n\tif (fd_in == NULL) {\r\n\t\tuprintf(\"Could not open file '%s'\\n\", filename);\r\n\t\tgoto out;\r\n\t}\r\n\t// Check the input file's BOM and create an output file with the same\r\n\tif (fread(&bom, sizeof(bom), 1, fd_in) != 1) {\r\n\t\tuprintf(\"Could not read file '%s'\\n\", filename);\r\n\t\tgoto out;\r\n\t}\r\n\tswitch(bom) {\r\n\tcase 0xFEFF:\r\n\t\tmode = 2;\t// UTF-16 (LE)\r\n\t\tbreak;\r\n\tcase 0xBBEF:\t// Yeah, the UTF-8 BOM is really 0xEF,0xBB,0xBF, but\r\n\t\tmode = 1;\t// find me a non UTF-8 file that actually begins with \"ï»\"\r\n\t\tbreak;\r\n\tdefault:\r\n\t\tmode = 0;\t// ANSI\r\n\t\tbreak;\r\n\t}\r\n\tfseek(fd_in, 0, SEEK_SET);\r\n//\tduprintf(\"'%s' was detected as %s\\n\", filename,\r\n//\t\t(mode==0)?\"ANSI/UTF8 (no BOM)\":((mode==1)?\"UTF8 (with BOM)\":\"UTF16 (with BOM\"));\r\n\r\n\twtmpname = (wchar_t*)calloc(wcslen(wfilename)+2, sizeof(wchar_t));\r\n\tif (wtmpname == NULL) {\r\n\t\tuprintf(\"Could not allocate space for temporary output name\\n\");\r\n\t\tgoto out;\r\n\t}\r\n\twcscpy(wtmpname, wfilename);\r\n\twtmpname[wcslen(wtmpname)] = '~';\r\n\r\n\tfd_out = _wfopen(wtmpname, outmode[mode]);\r\n\tif (fd_out == NULL) {\r\n\t\tuprintf(\"Could not open temporary output file '%s~'\\n\", filename);\r\n\t\tgoto out;\r\n\t}\r\n\r\n\t// Process individual lines. NUL is always appended.\r\n\twhile (fgetws(buf, ARRAYSIZE(buf), fd_in) != NULL) {\r\n\r\n\t\ti = 0;\r\n\r\n\t\t// Skip leading spaces\r\n\t\ti += wcsspn(&buf[i], wspace);\r\n\r\n\t\t// Our token should begin a line\r\n\t\tif (_wcsnicmp(&buf[i], wsection, wcslen(wsection)) != 0) {\r\n\t\t\tfputws(buf, fd_out);\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// Section was found, output it\r\n\t\tfputws(buf, fd_out);\r\n\t\t// Now output the new data\r\n\t\t// coverity[invalid_type]\r\n\t\tfwprintf_s(fd_out, L\"%s\\n\", wdata);\r\n\t\tret = (char*)data;\r\n\t}\r\n\r\nout:\r\n\tif (fd_in != NULL) fclose(fd_in);\r\n\tif (fd_out != NULL) fclose(fd_out);\r\n\r\n\t// If an insertion occurred, delete existing file and use the new one\r\n\tif (ret != NULL && wtmpname != NULL && wfilename != NULL) {\r\n\t\t// We're in Windows text mode => Remove CRs if requested\r\n\t\tfd_in = _wfopen(wtmpname, L\"rb\");\r\n\t\tfd_out = _wfopen(wfilename, L\"wb\");\r\n\t\t// Don't check fds\r\n\t\tif ((fd_in != NULL) && (fd_out != NULL)) {\r\n\t\t\tsize = (mode==2)?2:1;\r\n\t\t\twhile(fread(tmp, size, 1, fd_in) == 1) {\r\n\t\t\t\tif ((!dos2unix) || (tmp[0] != 0x0D))\r\n\t\t\t\t\tfwrite(tmp, size, 1, fd_out);\r\n\t\t\t}\r\n\t\t\tfclose(fd_in);\r\n\t\t\tfclose(fd_out);\r\n\t\t} else {\r\n\t\t\tuprintf(\"Could not write '%s' - original file has been left unmodified\\n\", filename);\r\n\t\t\tret = NULL;\r\n\t\t\tif (fd_in != NULL) fclose(fd_in);\r\n\t\t\tif (fd_out != NULL) fclose(fd_out);\r\n\t\t}\r\n\t}\r\n\tif (wtmpname != NULL)\r\n\t\t_wunlink(wtmpname);\r\n\tsafe_free(wfilename);\r\n\tsafe_free(wtmpname);\r\n\tsafe_free(wsection);\r\n\tsafe_free(wdata);\r\n\r\n\treturn ret;\r\n}\r\n\r\n/*\r\n * Search for a specific 'src' substring data for all occurrences of 'token', and replace\r\n * it with 'rep'. File can be ANSI or UNICODE and is overwritten. Parameters are UTF-8.\r\n * The parsed line is of the form: [ ]token[ ]data\r\n * Returns a pointer to rep if replacement occurred, NULL otherwise\r\n * TODO: We might have to end up with a regexp engine, so that we can do stuff like: \"foo*\" -> \"bar\\1\"\r\n */\r\n#define MAX_OCCURRENCES 4\r\nchar* replace_in_token_data(const char* filename, const char* token, const char* src, const char* rep, BOOL dos2unix)\r\n{\r\n\tconst wchar_t* outmode[] = { L\"w\", L\"w, ccs=UTF-8\", L\"w, ccs=UTF-16LE\" };\r\n\twchar_t *wtoken = NULL, *wfilename = NULL, *wtmpname = NULL, *wsrc = NULL, *wrep = NULL, bom = 0;\r\n\twchar_t buf[1024], *torep[MAX_OCCURRENCES + 1] = { NULL };\r\n\tFILE *fd_in = NULL, *fd_out = NULL;\r\n\tsize_t i, j, p[MAX_OCCURRENCES + 1] = { 0 }, ns, size;\r\n\tint mode = 0;\r\n\tchar *ret = NULL, tmp[2];\r\n\r\n\tif ((filename == NULL) || (token == NULL) || (src == NULL) || (rep == NULL))\r\n\t\treturn NULL;\r\n\tif ((filename[0] == 0) || (token[0] == 0) || (src[0] == 0))\r\n\t\treturn NULL;\r\n\tif (strcmp(src, rep) == 0)\t// No need for processing is source is same as replacement\r\n\t\treturn NULL;\r\n\r\n\twfilename = utf8_to_wchar(filename);\r\n\tif (wfilename == NULL) {\r\n\t\tuprintf(conversion_error, filename);\r\n\t\tgoto out;\r\n\t}\r\n\twtoken = utf8_to_wchar(token);\r\n\tif (wtoken == NULL) {\r\n\t\tuprintf(conversion_error, token);\r\n\t\tgoto out;\r\n\t}\r\n\twsrc = utf8_to_wchar(src);\r\n\tif (wsrc == NULL) {\r\n\t\tuprintf(conversion_error, src);\r\n\t\tgoto out;\r\n\t}\r\n\twrep = utf8_to_wchar(rep);\r\n\tif (wrep == NULL) {\r\n\t\tuprintf(conversion_error, rep);\r\n\t\tgoto out;\r\n\t}\r\n\r\n\tfd_in = _wfopen(wfilename, L\"r, ccs=UNICODE\");\r\n\tif (fd_in == NULL) {\r\n\t\tuprintf(\"Could not open file '%s'\\n\", filename);\r\n\t\tgoto out;\r\n\t}\r\n\t// Check the input file's BOM and create an output file with the same\r\n\tif (fread(&bom, sizeof(bom), 1, fd_in) != 1) {\r\n\t\tif (!feof(fd_in))\r\n\t\t\tuprintf(\"Could not read file '%s'\\n\", filename);\r\n\t\tgoto out;\r\n\t}\r\n\tswitch(bom) {\r\n\tcase 0xFEFF:\r\n\t\tmode = 2;\t// UTF-16 (LE)\r\n\t\tbreak;\r\n\tcase 0xBBEF:\t// Yeah, the UTF-8 BOM is really 0xEF,0xBB,0xBF, but\r\n\t\tmode = 1;\t// find me a non UTF-8 file that actually begins with \"ï»\"\r\n\t\tbreak;\r\n\tdefault:\r\n\t\tmode = 0;\t// ANSI\r\n\t\tbreak;\r\n\t}\r\n\tfseek(fd_in, 0, SEEK_SET);\r\n//\tduprintf(\"'%s' was detected as %s\\n\", filename,\r\n//\t\t(mode==0)?\"ANSI/UTF8 (no BOM)\":((mode==1)?\"UTF8 (with BOM)\":\"UTF16 (with BOM\"));\r\n\r\n\twtmpname = (wchar_t*)calloc(wcslen(wfilename)+2, sizeof(wchar_t));\r\n\tif (wtmpname == NULL) {\r\n\t\tuprintf(\"Could not allocate space for temporary output name\\n\");\r\n\t\tgoto out;\r\n\t}\r\n\twcscpy(wtmpname, wfilename);\r\n\twtmpname[wcslen(wtmpname)] = '~';\r\n\r\n\tfd_out = _wfopen(wtmpname, outmode[mode]);\r\n\tif (fd_out == NULL) {\r\n\t\tuprintf(\"Could not open temporary output file '%s~'\\n\", filename);\r\n\t\tgoto out;\r\n\t}\r\n\r\n\t// Process individual lines. NUL is always appended.\r\n\twhile (fgetws(buf, ARRAYSIZE(buf), fd_in) != NULL) {\r\n\r\n\t\ti = 0;\r\n\r\n\t\t// Skip leading spaces\r\n\t\ti += wcsspn(&buf[i], wspace);\r\n\r\n\t\t// Our token should begin a line\r\n\t\tif (_wcsnicmp(&buf[i], wtoken, wcslen(wtoken)) != 0) {\r\n\t\t\tfputws(buf, fd_out);\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// Token was found, move past token\r\n\t\ti += wcslen(wtoken);\r\n\r\n\t\t// Skip whitespaces after token (while making sure there's at least one)\r\n\t\tns = wcsspn(&buf[i], wspace);\r\n\t\tif (ns == 0) {\r\n\t\t\tfputws(buf, fd_out);\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\ti += ns;\r\n\r\n\t\t// p[x] = starting position of the fragment with the replaceable string\r\n\t\tp[0] = 0;\r\n\t\tfor (j = 0; j < MAX_OCCURRENCES; j++) {\r\n\t\t\ttorep[j] = wcsstr(&buf[i], wsrc);\r\n\t\t\tif (torep[j] == NULL)\r\n\t\t\t\tbreak;\r\n\t\t\t// Next fragment will start after current + replaced string\r\n\t\t\ti = (torep[j] - buf) + wcslen(wsrc);\r\n\t\t\tp[j + 1] = i;\r\n\t\t\t// Truncate each fragment to before the replaced string\r\n\t\t\t*torep[j] = 0;\r\n\t\t}\r\n\r\n\t\t// No replaceable string found => output as is\r\n\t\tif (torep[0] == NULL) {\r\n\t\t\tfputws(buf, fd_out);\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// Output all the truncated fragments + replaced strings\r\n\t\tfor (j = 0; torep[j] != NULL; j++)\r\n\t\t\t// coverity[invalid_type]\r\n\t\t\tfwprintf_s(fd_out, L\"%s%s\", &buf[p[j]], wrep);\r\n\r\n\t\t// Output the last fragment\r\n\t\t// coverity[invalid_type]\r\n\t\tfwprintf_s(fd_out, L\"%s\", &buf[p[j]]);\r\n\r\n\t\tret = (char*)rep;\r\n\t}\r\n\r\nout:\r\n\tif (fd_in != NULL) fclose(fd_in);\r\n\tif (fd_out != NULL) fclose(fd_out);\r\n\r\n\t// If a replacement occurred, delete existing file and use the new one\r\n\tif (ret != NULL && wtmpname != NULL && wfilename != NULL) {\r\n\t\t// We're in Windows text mode => Remove CRs if requested\r\n\t\tfd_in = _wfopen(wtmpname, L\"rb\");\r\n\t\tfd_out = _wfopen(wfilename, L\"wb\");\r\n\t\t// Don't check fds\r\n\t\tif ((fd_in != NULL) && (fd_out != NULL)) {\r\n\t\t\tsize = (mode==2)?2:1;\r\n\t\t\twhile(fread(tmp, size, 1, fd_in) == 1) {\r\n\t\t\t\tif ((!dos2unix) || (tmp[0] != 0x0D))\r\n\t\t\t\t\tfwrite(tmp, size, 1, fd_out);\r\n\t\t\t}\r\n\t\t\tfclose(fd_in);\r\n\t\t\tfclose(fd_out);\r\n\t\t} else {\r\n\t\t\tuprintf(\"Could not write '%s' - original file has been left unmodified.\\n\", filename);\r\n\t\t\tret = NULL;\r\n\t\t\tif (fd_in != NULL) fclose(fd_in);\r\n\t\t\tif (fd_out != NULL) fclose(fd_out);\r\n\t\t}\r\n\t}\r\n\tif (wtmpname != NULL)\r\n\t\t_wunlink(wtmpname);\r\n\tsafe_free(wfilename);\r\n\tsafe_free(wtmpname);\r\n\tsafe_free(wtoken);\r\n\tsafe_free(wsrc);\r\n\tsafe_free(wrep);\r\n\r\n\treturn ret;\r\n}\r\n\r\n/*\r\n * Replace all 'c' characters in string 'src' with the substring 'rep'.\r\n * The returned string is allocated and must be freed by the caller.\r\n */\r\nchar* replace_char(const char* src, const char c, const char* rep)\r\n{\r\n\tsize_t i, j, k, count=0, str_len = safe_strlen(src), rep_len = safe_strlen(rep);\r\n\tchar* res;\r\n\r\n\tif ((src == NULL) || (rep == NULL))\r\n\t\treturn NULL;\r\n\tfor (i=0; i<str_len; i++) {\r\n\t\tif (src[i] == c)\r\n\t\t\tcount++;\r\n\t}\r\n\tres = (char*)malloc(str_len + count*rep_len + 1);\r\n\tif (res == NULL)\r\n\t\treturn NULL;\r\n\tfor (i=0,j=0; i<str_len; i++) {\r\n\t\tif (src[i] == c) {\r\n\t\t\tfor(k=0; k<rep_len; k++)\r\n\t\t\t\tres[j++] = rep[k];\r\n\t\t} else {\r\n// Since the VS Code Analysis tool is dumb...\r\n#if defined(_MSC_VER)\r\n#pragma warning(suppress: 6386)\r\n#endif\r\n\t\t\tres[j++] = src[i];\r\n\t\t}\r\n\t}\r\n\tres[j] = 0;\r\n\treturn res;\r\n}\r\n\r\n/*\r\n * Replace all characters from string 'str' that are present in the array of chars 'rem'\r\n * to the 'rep' character.\r\n */\r\nvoid filter_chars(char* str, const char* rem, const char rep)\r\n{\r\n\tchar *p, *q;\r\n\r\n\tif (str == NULL || rem == NULL)\r\n\t\treturn;\r\n\tfor (p = str; *p != '\\0'; p++) {\r\n\t\tfor (q = (char*)rem; *q != '\\0'; q++)\r\n\t\t\tif (*p == *q)\r\n\t\t\t\t*p = rep;\r\n\t}\r\n}\r\n\r\n/*\r\n * Remove all instances of substring 'sub' form string 'src.\r\n * The returned string is allocated and must be freed by the caller.\r\n */\r\nchar* remove_substr(const char* src, const char* sub)\r\n{\r\n\tsize_t i, j, str_len = safe_strlen(src), sub_len = safe_strlen(sub);\r\n\tchar* res;\r\n\r\n\tif ((src == NULL) || (sub == NULL) || (sub_len > str_len))\r\n\t\treturn NULL;\r\n\r\n\tres = (char*)calloc(str_len + 1, 1);\r\n\tif (res == NULL)\r\n\t\treturn NULL;\r\n\tfor (i = 0, j = 0; i <= str_len; ) {\r\n\t\tif (i <= str_len - sub_len && memcmp(&src[i], sub, sub_len) == 0)\r\n\t\t\ti += sub_len;\r\n\t\telse\r\n\t\t\tres[j++] = src[i++];\r\n\t}\r\n\treturn res;\r\n}\r\n\r\n/*\r\n * Internal recursive call for get_data_from_asn1(). Returns FALSE on error, TRUE otherwise.\r\n */\r\nstatic BOOL get_data_from_asn1_internal(const uint8_t* buf, size_t buf_len, const void* oid,\r\n\t\t\tsize_t oid_len, uint8_t asn1_type, void** data, size_t* data_len, BOOL* matched)\r\n{\r\n\tsize_t pos = 0, len, len_len, i;\r\n\tuint8_t tag;\r\n\tBOOL is_sequence, is_universal_tag;\r\n\r\n\twhile (pos < buf_len) {\r\n\t\tis_sequence = buf[pos] & 0x20;\r\n\t\tis_universal_tag = ((buf[pos] & 0xC0) == 0x00);\r\n\t\ttag = buf[pos++] & 0x1F;\r\n\t\tif (tag == 0x1F) {\r\n\t\t\tuprintf(\"get_data_from_asn1: Long form tags are unsupported\");\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t// Compute the length\r\n\t\tlen = 0;\r\n\t\tlen_len = 1;\r\n\t\tif ((is_universal_tag) && (tag == 0x05)) {\t// ignore \"NULL\" tag\r\n\t\t\tpos++;\r\n\t\t} else {\r\n\t\t\tif (buf[pos] & 0x80) {\r\n\t\t\t\tlen_len = buf[pos++] & 0x7F;\r\n\t\t\t\t// The data we're dealing with is not expected to ever be larger than 64K\r\n\t\t\t\tif (len_len > 2) {\r\n\t\t\t\t\tuprintf(\"get_data_from_asn1: Length fields larger than 2 bytes are unsupported\");\r\n\t\t\t\t\treturn FALSE;\r\n\t\t\t\t}\r\n\t\t\t\tfor (i = 0; i < len_len; i++) {\r\n\t\t\t\t\tlen <<= 8;\r\n\t\t\t\t\tlen += buf[pos++];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tlen = buf[pos++];\r\n\t\t\t}\r\n\r\n\t\t\tif (len > buf_len - pos) {\r\n\t\t\t\tuprintf(\"get_data_from_asn1: Overflow error (computed length %zu is larger than remaining data)\", len);\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (len != 0) {\r\n\t\t\tif (is_sequence) {\r\n\t\t\t\tif (!get_data_from_asn1_internal(&buf[pos], len, oid, oid_len, asn1_type, data, data_len, matched))\r\n\t\t\t\t\treturn FALSE;\t// error\r\n\t\t\t\tif (*data != NULL)\r\n\t\t\t\t\treturn TRUE;\r\n\t\t\t} else if (is_universal_tag) {\t// Only process tags that belong to the UNIVERSAL class\r\n\t\t\t\t// NB: 0x06 = \"OID\" tag\r\n\t\t\t\tif ((!*matched) && (tag == 0x06) && (len == oid_len) && (memcmp(&buf[pos], oid, oid_len) == 0)) {\r\n\t\t\t\t\t*matched = TRUE;\r\n\t\t\t\t} else if ((*matched) && (tag == asn1_type)) {\r\n\t\t\t\t\t*data_len = len;\r\n\t\t\t\t\t*data = (void*)&buf[pos];\r\n\t\t\t\t\treturn TRUE;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tpos += len;\r\n\t\t}\r\n\t};\r\n\r\n\treturn TRUE;\r\n}\r\n\r\n/*\r\n * Helper functions to convert an OID string to an OID byte array\r\n * Taken from from openpgp-oid.c\r\n */\r\nstatic size_t make_flagged_int(unsigned long value, uint8_t *buf, size_t buf_len)\r\n{\r\n\tBOOL more = FALSE;\r\n\tint shift;\r\n\r\n\tfor (shift = 28; shift > 0; shift -= 7) {\r\n\t\tif (more || value >= ((unsigned long)1 << shift)) {\r\n\t\t\tbuf[buf_len++] = (uint8_t) (0x80 | (value >> shift));\r\n\t\t\tvalue -= (value >> shift) << shift;\r\n\t\t\tmore = TRUE;\r\n\t\t}\r\n\t}\r\n\tbuf[buf_len++] = (uint8_t) value;\r\n\treturn buf_len;\r\n}\r\n\r\n/*\r\n * Convert OID string 'oid_str' to an OID byte array of size 'ret_len'\r\n * The returned array must be freed by the caller.\r\n */\r\nstatic uint8_t* oid_from_str(const char* oid_str, size_t* ret_len)\r\n{\r\n\tuint8_t* oid = NULL;\r\n\tunsigned long val1 = 0, val;\r\n\tconst char *endp;\r\n\tint arcno = 0;\r\n\tsize_t oid_len = 0;\r\n\r\n\tif ((oid_str == NULL) || (oid_str[0] == 0))\r\n\t\treturn NULL;\r\n\r\n\t// We can safely assume that the encoded OID is shorter than the string.\r\n\toid = malloc(1 + strlen(oid_str) + 2);\r\n\tif (oid == NULL)\r\n\t\treturn NULL;\r\n\r\n\tdo {\r\n\t\tarcno++;\r\n\t\tval = strtoul(oid_str, (char**)&endp, 10);\r\n\t\tif (!isdigit(*oid_str) || !(*endp == '.' || !*endp))\r\n\t\t\tgoto err;\r\n\t\tif (*endp == '.')\r\n\t\t\toid_str = endp + 1;\r\n\r\n\t\tif (arcno == 1) {\r\n\t\t\tif (val > 2)\r\n\t\t\t\tbreak; // Not allowed, error caught below.\r\n\t\t\tval1 = val;\r\n\t\t} else if (arcno == 2) {\r\n\t\t\t// Need to combine the first two arcs in one byte.\r\n\t\t\tif (val1 < 2) {\r\n\t\t\t\tif (val > 39)\r\n\t\t\t\t\tgoto err;\r\n\t\t\t\toid[oid_len++] = (uint8_t)(val1 * 40 + val);\r\n\t\t\t} else {\r\n\t\t\t\tval += 80;\r\n\t\t\t\toid_len = make_flagged_int(val, oid, oid_len);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\toid_len = make_flagged_int(val, oid, oid_len);\r\n\t\t}\r\n\t} while (*endp == '.');\r\n\r\n\t// It is not possible to encode only the first arc.\r\n\tif (arcno == 1 || oid_len < 2 || oid_len > 254)\r\n\t\tgoto err;\r\n\r\n\t*ret_len = oid_len;\r\n\treturn oid;\r\n\r\nerr:\r\n\tfree(oid);\r\n\treturn NULL;\r\n}\r\n\r\n/*\r\n * Parse an ASN.1 binary buffer and return a pointer to the first instance of OID data of type 'asn1_type',\r\n * matching the OID 'oid_str' (expressed as an OID string). If successful, the length or the returned data\r\n * is placed in 'data_len'. Note: Only the UNIVERSAL class is supported for 'asn1_type' (other classes are\r\n * ignored). If 'oid_str' is NULL or empty, the first data element of type 'asn1_type' is returned.\r\n */\r\nvoid* get_data_from_asn1(const uint8_t* buf, size_t buf_len, const char* oid_str, uint8_t asn1_type, size_t* data_len)\r\n{\r\n\tvoid* data = NULL;\r\n\tuint8_t* oid = NULL;\r\n\tsize_t oid_len = 0;\r\n\tBOOL matched = ((oid_str == NULL) || (oid_str[0] == 0));\r\n\r\n\tif (buf_len >= 65536) {\r\n\t\tuprintf(\"get_data_from_asn1: Buffers larger than 64KB are not supported\");\r\n\t\treturn NULL;\r\n\t}\r\n\r\n\tif (!matched) {\r\n\t\t// We have an OID string to convert\r\n\t\toid = oid_from_str(oid_str, &oid_len);\r\n\t\tif (oid == NULL) {\r\n\t\t\tuprintf(\"get_data_from_asn1: Could not convert OID string '%s'\", oid_str);\r\n\t\t\treturn NULL;\r\n\t\t}\r\n\t}\r\n\r\n\t// No need to check for the return value as data is always NULL on error\r\n\tget_data_from_asn1_internal(buf, buf_len, oid, oid_len, asn1_type, &data, data_len, &matched);\r\n\tfree(oid);\r\n\treturn data;\r\n}\r\n\r\n/*\r\n * Sanitize an ISO volume label or GRUB version, so that we can use it for bootloader lookup.\r\n * Note that this call modifies the string passed as parameter.\r\n */\r\nint sanitize_label(char* label)\r\n{\r\n\t// Notice: Do not add \"-beta\" to this list as we have existing GRUB lookups for\r\n\t// \"grub-2.02-beta2\" and stuff...\r\n\tstatic const char* remove[] = { \"-i386\", \"-i686\", \"-amd64\", \"-x86-64\", \".x86-64\",\r\n\t\t\"-x64\", \"-armhf\", \"-arm64\", \"-aarch64\", \"-32-bit\", \"-64-bit\", \"-32bit\", \"-64bit\",\r\n\t\t\"-intel\", \"-cd\", \"-dvd\", \"-standard\", \"-live\", \"-install\", \"-server\", \"-net\",\r\n\t\t\"-desktop\", \"-lts\", \"-studio\", \"-baseos\", \"-kde\", \"-xfce\", \"-lxde\", \"-gnome\",\r\n\t\t\"-mate\", \"-unstable\", \"-debug\", \"-release\", \"-final\", \"-stream\", \"-cinnamon\",\r\n\t\t\"-cinn\", \"-leap\", \"-tumbleweed\", \"-budgie\", \"-ws\", \"-iot\", \"-ostree\", \".iso\"\r\n\t};\r\n\tsize_t i, len;\r\n\tchar *s;\r\n\r\n\tlen = strlen(label);\r\n\tfor (i = 0; i < len; i++) {\r\n\t\tchar c = label[i];\r\n\t\t// Convert to lowercase\r\n\t\tif (c >= 'A' && c <= 'Z')\r\n\t\t\tc += 0x20;\r\n\t\t// Convert non alphanum (except '.') to dash\r\n\t\tif ((c < '0' && c != '.') || (c > '9' && c < 'a') || (c > 'z'))\r\n\t\t\tc = '-';\r\n\t\tlabel[i] = c;\r\n\t}\r\n\r\n\t// Remove all leading '-'\r\n\tfor (i = 0; i < len && label[i] == '-'; i++);\r\n\tif (i != 0)\r\n\t\tmemmove(label, &label[i], len - i);\r\n\tlen = strlen(label);\r\n\tif (len <= 1)\r\n\t\treturn -1;\r\n\r\n\t// Remove all trailing '-'\r\n\tfor (i = len - 1; i > 0 && label[i] == '-'; i--)\r\n\t\tlabel[i] = 0;\r\n\tlen = strlen(label);\r\n\tif (len <= 1)\r\n\t\treturn -1;\r\n\r\n\t// Remove all duplicate '-' (non-optimized!)\r\n\tfor (i = 0; len >= 2 && i < len - 2; i++) {\r\n\t\tif (label[i] == '-' && label[i + 1] == '-') {\r\n\t\t\tmemmove(&label[i + 1], &label[i + 2], len - i - 1);\r\n\t\t\tlen--;\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\r\n\t// Remove specific substrings\r\n\tfor (i = 0; i < ARRAYSIZE(remove); i++) {\r\n\t\ts = strstr(label, remove[i]);\r\n\t\tif (s != NULL)\r\n\t\t\tstrcpy(s, &s[strlen(remove[i])]);\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n\r\n/*\r\n * Parse an sbat_level.txt file and returns an array of (product_name, min_version) tuples.\r\n * Array must be freed by caller.\r\n */\r\nsbat_entry_t* GetSbatEntries(char* sbatlevel)\r\n{\r\n\tBOOL eol, eof;\r\n\tchar* version_str;\r\n\tuint32_t i, num_entries;\r\n\tsbat_entry_t* sbat_list;\r\n\r\n\tif (sbatlevel == NULL)\r\n\t\treturn NULL;\r\n\r\n\tnum_entries = 1;\r\n\tfor (i = 0; sbatlevel[i] != '\\0'; i++) {\r\n\t\tif (sbatlevel[i] == '\\n')\r\n\t\t\tnum_entries++;\r\n\t\tif (sbatlevel[i] == '\\r')\r\n\t\t\tsbatlevel[i] = '\\n';\r\n\t}\r\n\r\n\tsbat_list = calloc(num_entries + 1, sizeof(sbat_entry_t));\r\n\tif (sbat_list == NULL)\r\n\t\treturn NULL;\r\n\r\n\tnum_entries = 0;\r\n\tfor (i = 0; sbatlevel[i] != '\\0'; ) {\r\n\t\t// Eliminate blank lines\r\n\t\tif (sbatlevel[i] == '\\n') {\r\n\t\t\ti++;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t// Eliminate comments\r\n\t\tif (sbatlevel[i] == '#') {\r\n\t\t\twhile (sbatlevel[i] != '\\n' && sbatlevel[i] != '\\0')\r\n\t\t\t\ti++;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tsbat_list[num_entries].product = &sbatlevel[i];\r\n\t\tfor (; sbatlevel[i] != ',' && sbatlevel[i] != '\\0' && sbatlevel[i] != '\\n'; i++);\r\n\t\tif (sbatlevel[i] == '\\0' || sbatlevel[i] == '\\n')\r\n\t\t\tbreak;\r\n\t\tsbatlevel[i++] = '\\0';\r\n\t\tversion_str = &sbatlevel[i];\r\n\t\tfor (; sbatlevel[i] != ',' && sbatlevel[i] != '\\0' && sbatlevel[i] != '\\n'; i++);\r\n\t\teol = (sbatlevel[i] == '\\0' || sbatlevel[i] == '\\n');\r\n\t\teof = (sbatlevel[i] == '\\0');\r\n\t\tsbatlevel[i] = '\\0';\r\n\t\tif (!eof)\r\n\t\t\ti++;\r\n\t\t// Allow the provision of an hex version\r\n\t\tif (version_str[0] == '0' && version_str[1] == 'x')\r\n\t\t\tsbat_list[num_entries].version = strtoul(version_str, NULL, 16);\r\n\t\telse\r\n\t\t\tsbat_list[num_entries].version = strtoul(version_str, NULL, 10);\r\n\t\tif (!eol)\r\n\t\t\tfor (; sbatlevel[i] != '\\0' && sbatlevel[i] != '\\n'; i++);\r\n\t\tif (sbat_list[num_entries].version != 0)\r\n\t\t\tnum_entries++;\r\n\t}\r\n\tif (num_entries == 0) {\r\n\t\tfree(sbat_list);\r\n\t\treturn NULL;\r\n\t}\r\n\r\n\treturn sbat_list;\r\n}\r\n\r\n/*\r\n * Parse a list of SHA-1 certificate hexascii thumbprints.\r\n * List must be freed by the caller.\r\n */\r\nthumbprint_list_t* GetThumbprintEntries(char* thumbprints_txt)\r\n{\r\n\tuint32_t i, j, num_entries;\r\n\tthumbprint_list_t* thumbprints;\r\n\r\n\tif (thumbprints_txt == NULL)\r\n\t\treturn NULL;\r\n\r\n\tnum_entries = 1;\r\n\tfor (i = 0; thumbprints_txt[i] != '\\0'; i++)\r\n\t\tif (thumbprints_txt[i] == '\\n')\r\n\t\t\tnum_entries++;\r\n\r\n\tthumbprints = calloc(sizeof(thumbprint_list_t) + num_entries * SHA1_HASHSIZE, 1);\r\n\tif (thumbprints == NULL)\r\n\t\treturn NULL;\r\n\tthumbprints->count = 0;\r\n\r\n\tfor (i = 0; thumbprints_txt[i] != '\\0'; ) {\r\n\t\t// Eliminate blank lines\r\n\t\tif (thumbprints_txt[i] == '\\n') {\r\n\t\t\ti++;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t// Eliminate lines that don't start by an hexadecimal digit\r\n\t\tif (!IS_HEXASCII(thumbprints_txt[i])) {\r\n\t\t\twhile (thumbprints_txt[i] != '\\n' && thumbprints_txt[i] != '\\0')\r\n\t\t\t\ti++;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tfor (j = 0; thumbprints_txt[i] != '\\n' && thumbprints_txt[i] != '\\0'; i++, j++) {\r\n\t\t\tif (!IS_HEXASCII(thumbprints_txt[i]))\r\n\t\t\t\tbreak;\r\n\t\t\tif ((j / 2) >= SHA1_HASHSIZE)\r\n\t\t\t\tbreak;\r\n\t\t\tthumbprints->list[thumbprints->count][j / 2] = thumbprints->list[thumbprints->count][j / 2] << 4;\r\n\t\t\tthumbprints->list[thumbprints->count][j / 2] |= FROM_HEXASCII(thumbprints_txt[i]);\r\n\t\t\tif (j == 2 * SHA1_HASHSIZE - 1)\r\n\t\t\t\tthumbprints->count++;\r\n\t\t}\r\n\t\twhile (thumbprints_txt[i] != '\\n' && thumbprints_txt[i] != '\\0')\r\n\t\t\ti++;\r\n\t}\r\n\r\n\tif (thumbprints->count == 0) {\r\n\t\tfree(thumbprints);\r\n\t\treturn NULL;\r\n\t}\r\n\r\n\treturn thumbprints;\r\n}\r\n\r\n/*\r\n * PE parsing functions\r\n */\r\n\r\n// Return the arch of a PE executable buffer\r\nuint16_t GetPeArch(uint8_t* buf)\r\n{\r\n\tIMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf;\r\n\tIMAGE_NT_HEADERS32* pe_header;\r\n\r\n\tif (buf == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE)\r\n\t\treturn IMAGE_FILE_MACHINE_UNKNOWN;\r\n\r\n\tpe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew];\r\n\tif (pe_header->Signature != IMAGE_NT_SIGNATURE)\r\n\t\treturn IMAGE_FILE_MACHINE_UNKNOWN;\r\n\treturn pe_header->FileHeader.Machine;\r\n}\r\n\r\n// Return the address and (optionally) the length of a PE section from a PE buffer\r\nuint8_t* GetPeSection(uint8_t* buf, const char* name, uint32_t* len)\r\n{\r\n\tchar section_name[IMAGE_SIZEOF_SHORT_NAME] = { 0 };\r\n\tuint32_t i, nb_sections;\r\n\tIMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf;\r\n\tIMAGE_NT_HEADERS32* pe_header;\r\n\tIMAGE_NT_HEADERS64* pe64_header;\r\n\tIMAGE_SECTION_HEADER* section_header;\r\n\r\n\tstatic_strcpy(section_name, name);\r\n\r\n\tif (buf == NULL || name == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE)\r\n\t\treturn NULL;\r\n\r\n\tpe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew];\r\n\tif (pe_header->Signature != IMAGE_NT_SIGNATURE)\r\n\t\treturn NULL;\r\n\tif (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) {\r\n\t\tsection_header = (IMAGE_SECTION_HEADER*)(&pe_header[1]);\r\n\t\tnb_sections = pe_header->FileHeader.NumberOfSections;\r\n\t} else {\r\n\t\tpe64_header = (IMAGE_NT_HEADERS64*)pe_header;\r\n\t\tsection_header = (IMAGE_SECTION_HEADER*)(&pe64_header[1]);\r\n\t\tnb_sections = pe64_header->FileHeader.NumberOfSections;\r\n\t}\r\n\tfor (i = 0; i < nb_sections; i++) {\r\n\t\tif (memcmp(section_header[i].Name, section_name, sizeof(section_name)) == 0) {\r\n\t\t\tif (len != NULL)\r\n\t\t\t\t*len = section_header->SizeOfRawData;\r\n\t\t\treturn &buf[section_header[i].PointerToRawData];\r\n\t\t}\r\n\t}\r\n\treturn NULL;\r\n}\r\n\r\n// Convert an RVA address to a physical address from a PE buffer\r\nuint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva)\r\n{\r\n\tuint32_t i, nb_sections;\r\n\tIMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf;\r\n\tIMAGE_NT_HEADERS32* pe_header;\r\n\tIMAGE_NT_HEADERS64* pe64_header;\r\n\tIMAGE_SECTION_HEADER* section_header;\r\n\r\n\tif (buf == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE)\r\n\t\treturn NULL;\r\n\r\n\tpe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew];\r\n\tif (pe_header->Signature != IMAGE_NT_SIGNATURE)\r\n\t\treturn NULL;\r\n\tif (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) {\r\n\t\tsection_header = (IMAGE_SECTION_HEADER*)(pe_header + 1);\r\n\t\tnb_sections = pe_header->FileHeader.NumberOfSections;\r\n\t} else {\r\n\t\tpe64_header = (IMAGE_NT_HEADERS64*)pe_header;\r\n\t\tsection_header = (IMAGE_SECTION_HEADER*)(pe64_header + 1);\r\n\t\tnb_sections = pe64_header->FileHeader.NumberOfSections;\r\n\t}\r\n\r\n\tfor (i = 0; i < nb_sections; i++) {\r\n\t\tif ((section_header[i].VirtualAddress <= rva && rva < (section_header[i].VirtualAddress + section_header[i].Misc.VirtualSize)))\r\n\t\t\tbreak;\r\n\t}\r\n\tif (i >= nb_sections)\r\n\t\treturn NULL;\r\n\r\n\treturn &buf[section_header[i].PointerToRawData + (rva - section_header[i].VirtualAddress)];\r\n}\r\n\r\n// Using the MS APIs to poke the resources of the EFI bootloaders is simply TOO. DAMN. SLOW.\r\n// So, to QUICKLY access the resources we need, we reivent Microsoft's sub-optimal resource parser.\r\nstatic BOOL FoundResourceRva = FALSE;\r\nuint32_t FindResourceRva(const wchar_t* name, uint8_t* root, uint8_t* dir, uint32_t* len)\r\n{\r\n\tuint32_t i, rva;\r\n\tIMAGE_RESOURCE_DIRECTORY* _dir = (IMAGE_RESOURCE_DIRECTORY*)dir;\r\n\tIMAGE_RESOURCE_DIRECTORY_ENTRY* dir_entry = (IMAGE_RESOURCE_DIRECTORY_ENTRY*)&_dir[1];\r\n\tIMAGE_RESOURCE_DIR_STRING_U* dir_string;\r\n\tIMAGE_RESOURCE_DATA_ENTRY* data_entry;\r\n\r\n\tif (root == NULL || dir == NULL || name == NULL)\r\n\t\treturn 0;\r\n\r\n\t// Initial invocation should always start at the root\r\n\tif (root == dir)\r\n\t\tFoundResourceRva = FALSE;\r\n\r\n\tfor (i = 0; i < (uint32_t)_dir->NumberOfNamedEntries + _dir->NumberOfIdEntries; i++) {\r\n\t\tif (!FoundResourceRva && i < _dir->NumberOfNamedEntries) {\r\n\t\t\tdir_string = (IMAGE_RESOURCE_DIR_STRING_U*)(root + dir_entry[i].NameOffset);\r\n\t\t\tif (dir_string->Length != wcslen(name) ||\r\n\t\t\t\tmemcmp(name, dir_string->NameString, wcslen(name)) != 0)\r\n\t\t\t\tcontinue;\r\n\t\t\tFoundResourceRva = TRUE;\r\n\t\t}\r\n\t\tif (dir_entry[i].OffsetToData & IMAGE_RESOURCE_DATA_IS_DIRECTORY) {\r\n\t\t\trva = FindResourceRva(name, root, &root[dir_entry[i].OffsetToDirectory], len);\r\n\t\t\tif (rva != 0)\r\n\t\t\t\treturn rva;\r\n\t\t} else if (FoundResourceRva) {\r\n\t\t\tdata_entry = (IMAGE_RESOURCE_DATA_ENTRY*)(root + dir_entry[i].OffsetToData);\r\n\t\t\tif (len != NULL)\r\n\t\t\t\t*len = data_entry->Size;\r\n\t\t\treturn data_entry->OffsetToData;\r\n\t\t}\r\n\t}\r\n\treturn 0;\r\n}\r\n\r\nuint8_t* GetPeSignatureData(uint8_t* buf)\r\n{\r\n\tIMAGE_DOS_HEADER* dos_header = (IMAGE_DOS_HEADER*)buf;\r\n\tIMAGE_NT_HEADERS32* pe_header;\r\n\tIMAGE_NT_HEADERS64* pe64_header;\r\n\tIMAGE_DATA_DIRECTORY sec_dir;\r\n\tWIN_CERTIFICATE* cert;\r\n\r\n\tif (buf == NULL || dos_header->e_magic != IMAGE_DOS_SIGNATURE)\r\n\t\treturn NULL;\r\n\r\n\tpe_header = (IMAGE_NT_HEADERS32*)&buf[dos_header->e_lfanew];\r\n\tif (pe_header->Signature != IMAGE_NT_SIGNATURE)\r\n\t\treturn NULL;\r\n\r\n\tif (pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 || pe_header->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM) {\r\n\t\tsec_dir = pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY];\r\n\t} else {\r\n\t\tpe64_header = (IMAGE_NT_HEADERS64*)pe_header;\r\n\t\tsec_dir = pe64_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY];\r\n\t}\r\n\tif (sec_dir.VirtualAddress == 0 || sec_dir.Size == 0)\r\n\t\treturn NULL;\r\n\r\n\tcert = (WIN_CERTIFICATE*)&buf[sec_dir.VirtualAddress];\r\n\tif (cert->dwLength == 0 || cert->wCertificateType != WIN_CERT_TYPE_PKCS_SIGNED_DATA)\r\n\t\treturn NULL;\r\n\r\n\treturn (uint8_t*)cert;\r\n}\r\n"
  },
  {
    "path": "src/pki.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * PKI functions (code signing, etc.)\n * Copyright © 2015-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <stdio.h>\n#include <wincrypt.h>\n#include <wintrust.h>\n#include <assert.h>\n\n#include \"rufus.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n\n#define ENCODING (X509_ASN_ENCODING | PKCS_7_ASN_ENCODING)\n\n// MinGW doesn't seem to have this one\n#if !defined(szOID_NESTED_SIGNATURE)\n#define szOID_NESTED_SIGNATURE \"1.3.6.1.4.1.311.2.4.1\"\n#endif\n\n// Signatures names we accept. Must be the the exact name, including capitalization,\n// that CertGetNameStringA(CERT_NAME_ATTR_TYPE, szOID_COMMON_NAME) returns.\nconst char* cert_name[3] = { \"Akeo Consulting\", \"Akeo Systems\", \"Pete Batard\" };\n// For added security, we also validate the country code of the certificate recipient.\nconst char* cert_country = \"IE\";\n\ntypedef struct {\n\tLPWSTR      lpszProgramName;\n\tLPWSTR      lpszPublisherLink;\n\tLPWSTR      lpszMoreInfoLink;\n} SPROG_PUBLISHERINFO, *PSPROG_PUBLISHERINFO;\n\n// https://msdn.microsoft.com/en-us/library/ee442238.aspx\ntypedef struct {\n\tBLOBHEADER  BlobHeader;\n\tRSAPUBKEY   RsaHeader;\n\tBYTE        Modulus[256];\t// 2048 bit modulus\n} RSA_2048_PUBKEY;\n\n// For PKCS7 WDAC Code Integrity processing\n#define PE256_HASHSIZE  32\n\nconst GUID SKU_CODE_INTEGRITY_POLICY = { 0x976d12c8, 0xcb9f, 0x4730, { 0xbe, 0x52, 0x54, 0x60, 0x08, 0x43, 0x23, 0x8e} };\n\ntypedef struct {\n\tWORD        Nano;\n\tWORD        Micro;\n\tWORD        Minor;\n\tWORD        Major;\n} CIVersion;\n\ntypedef struct {\n\tDWORD       PolicyFormatVersion;\n\tGUID        PolicyTypeGUID;\n\tGUID        PlatformGUID;\n\tDWORD       OptionFlags;\n\tDWORD       EKURuleEntryCount;\n\tDWORD       FileRuleEntryCount;\n\tDWORD       SignerRuleEntryCount;\n\tDWORD       SignerScenarioEntryCount;\n\tCIVersion   PolicyVersion;\n\tDWORD       HeaderLength;\n} CIHeader;\n\ntypedef struct {\n\tDWORD       Type;\n\tDWORD       FileNameLength;\n\tWCHAR       FileName[0];\n} CIFileRuleHeader;\n\ntypedef struct {\n\tDWORD       Unknown;\n\tCIVersion   Version;\n\tDWORD       HashLength;\n\tBYTE        Hash[0];\n} CIFileRuleData;\n\nenum {\n\tCI_DENY = 0,\n\tCI_ALLOW,\n\tCI_FILE_ATTRIBUTES,\n};\n\n// The RSA public key modulus for the private key we use to sign the files on the server.\n// NOTE 1: This openssl modulus must be *REVERSED* to be usable with Microsoft APIs\n// NOTE 2: Also, this modulus is 2052 bits, and not 2048, because openssl adds an extra\n// 0x00 at the beginning to force an integer sign. These extra 8 bits *MUST* be removed.\nstatic uint8_t rsa_pubkey_modulus[] = {\n\t/*\n\t\t$ openssl genrsa -aes256 -out private.pem 2048\n\t\t$ openssl rsa -in private.pem -pubout -out public.pem\n\t\t$ openssl rsa -pubin -inform PEM -text -noout < public.pem\n\t\tPublic-Key: (2048 bit)\n\t\tModulus:\n\t\t\t00:b6:40:7d:d1:98:7b:81:9e:be:23:0f:32:5d:55:\n\t\t\t60:c6:bf:b4:41:bb:43:1b:f1:e1:e6:f9:2b:d6:dd:\n\t\t\t11:50:e8:b9:3f:19:97:5e:a7:8b:4a:30:c6:76:58:\n\t\t\t72:1c:ac:ff:a1:f8:96:6c:51:5d:13:11:e3:5b:11:\n\t\t\t82:f5:9a:69:e4:28:97:0f:ca:1f:02:ea:1f:7d:dc:\n\t\t\tf9:fc:79:2f:61:ff:8e:45:60:65:ba:37:9b:de:49:\n\t\t\t05:6a:a8:fd:70:d0:0c:79:b6:d7:81:aa:54:c3:c6:\n\t\t\t4a:87:a0:45:ee:ca:d5:d5:c5:c2:ac:86:42:b3:58:\n\t\t\t27:d2:43:b9:37:f2:e6:75:66:17:53:d0:38:d0:c6:\n\t\t\t57:c2:55:36:a2:43:87:ea:24:f0:96:ec:34:dd:79:\n\t\t\t4d:80:54:9d:84:81:a7:cf:0c:a5:7c:d6:63:fa:7a:\n\t\t\t66:30:a9:50:ee:f0:e5:f8:a2:2d:ac:fc:24:21:fe:\n\t\t\tef:e8:d3:6f:0e:27:b0:64:22:95:3e:6d:a6:66:97:\n\t\t\tc6:98:c2:47:b3:98:69:4d:b1:b5:d3:6f:43:f5:d7:\n\t\t\ta5:13:5e:8c:28:4f:62:4e:01:48:0a:63:89:e7:ca:\n\t\t\t34:aa:7d:2f:bb:70:e0:31:bb:39:49:a3:d2:c9:2e:\n\t\t\ta6:30:54:9a:5c:4d:58:17:d9:fc:3a:43:e6:8e:2a:\n\t\t\t18:e9\n\t\tExponent: 65537 (0x10001)\n\t*/\n\t0x00, 0xb6, 0x40, 0x7d, 0xd1, 0x98, 0x7b, 0x81, 0x9e, 0xbe, 0x23, 0x0f, 0x32, 0x5d, 0x55,\n\t0x60, 0xc6, 0xbf, 0xb4, 0x41, 0xbb, 0x43, 0x1b, 0xf1, 0xe1, 0xe6, 0xf9, 0x2b, 0xd6, 0xdd,\n\t0x11, 0x50, 0xe8, 0xb9, 0x3f, 0x19, 0x97, 0x5e, 0xa7, 0x8b, 0x4a, 0x30, 0xc6, 0x76, 0x58,\n\t0x72, 0x1c, 0xac, 0xff, 0xa1, 0xf8, 0x96, 0x6c, 0x51, 0x5d, 0x13, 0x11, 0xe3, 0x5b, 0x11,\n\t0x82, 0xf5, 0x9a, 0x69, 0xe4, 0x28, 0x97, 0x0f, 0xca, 0x1f, 0x02, 0xea, 0x1f, 0x7d, 0xdc,\n\t0xf9, 0xfc, 0x79, 0x2f, 0x61, 0xff, 0x8e, 0x45, 0x60, 0x65, 0xba, 0x37, 0x9b, 0xde, 0x49,\n\t0x05, 0x6a, 0xa8, 0xfd, 0x70, 0xd0, 0x0c, 0x79, 0xb6, 0xd7, 0x81, 0xaa, 0x54, 0xc3, 0xc6,\n\t0x4a, 0x87, 0xa0, 0x45, 0xee, 0xca, 0xd5, 0xd5, 0xc5, 0xc2, 0xac, 0x86, 0x42, 0xb3, 0x58,\n\t0x27, 0xd2, 0x43, 0xb9, 0x37, 0xf2, 0xe6, 0x75, 0x66, 0x17, 0x53, 0xd0, 0x38, 0xd0, 0xc6,\n\t0x57, 0xc2, 0x55, 0x36, 0xa2, 0x43, 0x87, 0xea, 0x24, 0xf0, 0x96, 0xec, 0x34, 0xdd, 0x79,\n\t0x4d, 0x80, 0x54, 0x9d, 0x84, 0x81, 0xa7, 0xcf, 0x0c, 0xa5, 0x7c, 0xd6, 0x63, 0xfa, 0x7a,\n\t0x66, 0x30, 0xa9, 0x50, 0xee, 0xf0, 0xe5, 0xf8, 0xa2, 0x2d, 0xac, 0xfc, 0x24, 0x21, 0xfe,\n\t0xef, 0xe8, 0xd3, 0x6f, 0x0e, 0x27, 0xb0, 0x64, 0x22, 0x95, 0x3e, 0x6d, 0xa6, 0x66, 0x97,\n\t0xc6, 0x98, 0xc2, 0x47, 0xb3, 0x98, 0x69, 0x4d, 0xb1, 0xb5, 0xd3, 0x6f, 0x43, 0xf5, 0xd7,\n\t0xa5, 0x13, 0x5e, 0x8c, 0x28, 0x4f, 0x62, 0x4e, 0x01, 0x48, 0x0a, 0x63, 0x89, 0xe7, 0xca,\n\t0x34, 0xaa, 0x7d, 0x2f, 0xbb, 0x70, 0xe0, 0x31, 0xbb, 0x39, 0x49, 0xa3, 0xd2, 0xc9, 0x2e,\n\t0xa6, 0x30, 0x54, 0x9a, 0x5c, 0x4d, 0x58, 0x17, 0xd9, 0xfc, 0x3a, 0x43, 0xe6, 0x8e, 0x2a,\n\t0x18, 0xe9\n};\n\n/*\n * FormatMessage does not handle PKI errors\n */\nconst char* WinPKIErrorString(void)\n{\n\tstatic char error_string[64];\n\tDWORD error_code = GetLastError();\n\n\tif (((error_code >> 16) != 0x8009) && ((error_code >> 16) != 0x800B))\n\t\treturn WindowsErrorString();\n\n\tswitch (error_code) {\n\t// See also https://docs.microsoft.com/en-gb/windows/desktop/com/com-error-codes-4\n\tcase NTE_BAD_UID:\n\t\treturn \"Bad UID.\";\n\tcase NTE_NO_KEY:\n\t\treturn \"Key does not exist.\";\n\tcase NTE_BAD_KEYSET:\n\t\treturn \"Keyset does not exist.\";\n\tcase NTE_BAD_ALGID:\n\t\treturn \"Invalid algorithm specified.\";\n\tcase NTE_BAD_VER:\n\t\treturn \"Bad version of provider.\";\n\tcase NTE_BAD_SIGNATURE:\n\t\treturn \"Invalid Signature.\";\n\tcase CRYPT_E_MSG_ERROR:\n\t\treturn \"An error occurred while performing an operation on a cryptographic message.\";\n\tcase CRYPT_E_UNKNOWN_ALGO:\n\t\treturn \"Unknown cryptographic algorithm.\";\n\tcase CRYPT_E_INVALID_MSG_TYPE:\n\t\treturn \"Invalid cryptographic message type.\";\n\tcase CRYPT_E_HASH_VALUE:\n\t\treturn \"The hash value is not correct\";\n\tcase CRYPT_E_ISSUER_SERIALNUMBER:\n\t\treturn \"Invalid issuer and/or serial number.\";\n\tcase CRYPT_E_BAD_LEN:\n\t\treturn \"The length specified for the output data was insufficient.\";\n\tcase CRYPT_E_BAD_ENCODE:\n\t\treturn \"An error occurred during encode or decode operation.\";\n\tcase CRYPT_E_FILE_ERROR:\n\t\treturn \"An error occurred while reading or writing to a file.\";\n\tcase CRYPT_E_NOT_FOUND:\n\t\treturn \"Cannot find object or property.\";\n\tcase CRYPT_E_EXISTS:\n\t\treturn \"The object or property already exists.\";\n\tcase CRYPT_E_NO_PROVIDER:\n\t\treturn \"No provider was specified for the store or object.\";\n\tcase CRYPT_E_DELETED_PREV:\n\t\treturn \"The previous certificate or CRL context was deleted.\";\n\tcase CRYPT_E_NO_MATCH:\n\t\treturn \"Cannot find the requested object.\";\n\tcase CRYPT_E_UNEXPECTED_MSG_TYPE:\n\tcase CRYPT_E_NO_KEY_PROPERTY:\n\tcase CRYPT_E_NO_DECRYPT_CERT:\n\t\treturn \"Private key or certificate issue\";\n\tcase CRYPT_E_BAD_MSG:\n\t\treturn \"Not a cryptographic message.\";\n\tcase CRYPT_E_NO_SIGNER:\n\t\treturn \"The signed cryptographic message does not have a signer for the specified signer index.\";\n\tcase CRYPT_E_REVOKED:\n\t\treturn \"The certificate is revoked.\";\n\tcase CRYPT_E_NO_REVOCATION_DLL:\n\tcase CRYPT_E_NO_REVOCATION_CHECK:\n\tcase CRYPT_E_REVOCATION_OFFLINE:\n\tcase CRYPT_E_NOT_IN_REVOCATION_DATABASE:\n\t\treturn \"Cannot check certificate revocation.\";\n\tcase CRYPT_E_INVALID_NUMERIC_STRING:\n\tcase CRYPT_E_INVALID_PRINTABLE_STRING:\n\tcase CRYPT_E_INVALID_IA5_STRING:\n\tcase CRYPT_E_INVALID_X500_STRING:\n\tcase  CRYPT_E_NOT_CHAR_STRING:\n\t\treturn \"Invalid string.\";\n\tcase CRYPT_E_SECURITY_SETTINGS:\n\t\treturn \"The cryptographic operation failed due to a local security option setting.\";\n\tcase CRYPT_E_NO_VERIFY_USAGE_CHECK:\n\tcase CRYPT_E_VERIFY_USAGE_OFFLINE:\n\t\treturn \"Cannot complete usage check.\";\n\tcase CRYPT_E_NO_TRUSTED_SIGNER:\n\t\treturn \"None of the signers of the cryptographic message or certificate trust list is trusted.\";\n\tcase CERT_E_UNTRUSTEDROOT:\n\t\treturn \"The root certificate is not trusted.\";\n\tcase TRUST_E_SYSTEM_ERROR:\n\t\treturn \"A system-level error occurred while verifying trust.\";\n\tcase TRUST_E_NO_SIGNER_CERT:\n\t\treturn \"The certificate for the signer of the message is invalid or not found.\";\n\tcase TRUST_E_COUNTER_SIGNER:\n\t\treturn \"One of the counter signatures was invalid.\";\n\tcase TRUST_E_CERT_SIGNATURE:\n\t\treturn \"The signature of the certificate cannot be verified.\";\n\tcase TRUST_E_TIME_STAMP:\n\t\treturn \"The timestamp could not be verified.\";\n\tcase TRUST_E_BAD_DIGEST:\n\t\treturn \"The file content has been altered.\";\n\tcase TRUST_E_BASIC_CONSTRAINTS:\n\t\treturn \"A certificate's basic constraint extension has not been observed.\";\n\tcase TRUST_E_NOSIGNATURE:\n\t\treturn \"Not digitally signed.\";\n\tcase TRUST_E_EXPLICIT_DISTRUST:\n\t\treturn \"One of the certificates used was marked as untrusted by the user.\";\n\tdefault:\n\t\tstatic_sprintf(error_string, \"Unknown PKI error 0x%08lX\", error_code);\n\t\treturn error_string;\n\t}\n}\n\n// Mostly from https://support.microsoft.com/kb/323809\nchar* GetSignatureName(const char* path, const char* country_code, uint8_t* thumbprint, BOOL bSilent)\n{\n\tstatic char szSubjectName[128];\n\tchar szCountry[3] = \"__\";\n\tchar *p = NULL, *mpath = NULL;\n\tint i;\n\tBOOL r;\n\tHCERTSTORE hStore = NULL;\n\tHCRYPTMSG hMsg = NULL;\n\tPCCERT_CONTEXT pCertContext = NULL;\n\tDWORD dwSize, dwEncoding, dwContentType, dwFormatType, dwSignerInfoSize = 0;\n\tPCMSG_SIGNER_INFO pSignerInfo = NULL;\n\t// TODO: Do we really need CertInfo? Or can we just reference pSignerInfo?\n\tCERT_INFO CertInfo = { 0 };\n\tSPROG_PUBLISHERINFO ProgPubInfo = { 0 };\n\twchar_t *szFileName;\n\n\t// If the path is NULL, get the signature of the current runtime\n\tif (path == NULL) {\n\t\tszFileName = calloc(MAX_PATH, sizeof(wchar_t));\n\t\tif (szFileName == NULL)\n\t\t\treturn NULL;\n\t\tdwSize = GetModuleFileNameW(NULL, szFileName, MAX_PATH);\n\t\tif ((dwSize == 0) || ((dwSize == MAX_PATH) && (GetLastError() == ERROR_INSUFFICIENT_BUFFER))) {\n\t\t\tuprintf(\"PKI: Could not get module filename: %s\", WinPKIErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tmpath = wchar_to_utf8(szFileName);\n\t} else {\n\t\tszFileName = utf8_to_wchar(path);\n\t}\n\n\t// Get message handle and store handle from the signed file.\n\tfor (i = 0; i < 5; i++) {\n\t\tr = CryptQueryObject(CERT_QUERY_OBJECT_FILE, szFileName,\n\t\t\tCERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED, CERT_QUERY_FORMAT_FLAG_BINARY,\n\t\t\t0, &dwEncoding, &dwContentType, &dwFormatType, &hStore, &hMsg, NULL);\n\t\tif (r)\n\t\t\tbreak;\n\t\tif (i == 0)\n\t\t\tuprintf(\"PKI: Failed to get signature for '%s': %s\", (path==NULL)?mpath:path, WinPKIErrorString());\n\t\tif (path == NULL)\n\t\t\tbreak;\n\t\tuprintf(\"PKI: Retrying...\");\n\t\tSleep(2000);\n\t}\n\tif (!r)\n\t\tgoto out;\n\n\t// Get signer information size.\n\tr = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, NULL, &dwSignerInfoSize);\n\tif (!r) {\n\t\tuprintf(\"PKI: Failed to get signer size: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Allocate memory for signer information.\n\tpSignerInfo = (PCMSG_SIGNER_INFO)calloc(dwSignerInfoSize, 1);\n\tif (!pSignerInfo) {\n\t\tuprintf(\"PKI: Could not allocate memory for signer information\");\n\t\tgoto out;\n\t}\n\n\t// Get Signer Information.\n\tr = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, (PVOID)pSignerInfo, &dwSignerInfoSize);\n\tif (!r) {\n\t\tuprintf(\"PKI: Failed to get signer information: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Search for the signer certificate in the temporary certificate store.\n\tCertInfo.Issuer = pSignerInfo->Issuer;\n\tCertInfo.SerialNumber = pSignerInfo->SerialNumber;\n\tpCertContext = CertFindCertificateInStore(hStore, ENCODING, 0, CERT_FIND_SUBJECT_CERT, (PVOID)&CertInfo, NULL);\n\tif (!pCertContext) {\n\t\tuprintf(\"PKI: Failed to locate signer certificate in store: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Get the thumbprint if requested\n\tif (thumbprint != NULL) {\n\t\tdwSize = SHA1_HASHSIZE;\n\t\tif (!CryptHashCertificate(0, CALG_SHA1, 0, pCertContext->pbCertEncoded,\n\t\t\tpCertContext->cbCertEncoded, thumbprint, &dwSize)) {\n\t\t\tuprintf(\"PKI: Failed to compute the thumbprint: %s\", WinPKIErrorString());\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\t// If a country code is provided, validate that the certificate we have is for the same country\n\tif (country_code != NULL) {\n\t\tdwSize = CertGetNameStringA(pCertContext, CERT_NAME_ATTR_TYPE, 0, szOID_COUNTRY_NAME,\n\t\t\tszCountry, sizeof(szCountry));\n\t\tif (dwSize < 2) {\n\t\t\tuprintf(\"PKI: Failed to get Country Code\");\n\t\t\tgoto out;\n\t\t}\n\t\tif (strcmpi(country_code, szCountry) != 0) {\n\t\t\tuprintf(\"PKI: Unexpected Country Code (Found '%s', expected '%s')\", szCountry, country_code);\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\t// Isolate the signing certificate subject name\n\tdwSize = CertGetNameStringA(pCertContext, CERT_NAME_ATTR_TYPE, 0, szOID_COMMON_NAME,\n\t\tszSubjectName, sizeof(szSubjectName));\n\tif (dwSize <= 1) {\n\t\tuprintf(\"PKI: Failed to get Subject Name\");\n\t\tgoto out;\n\t}\n\n\tif (szCountry[0] == '_')\n\t\tsuprintf(\"Binary executable is signed by '%s'\", szSubjectName);\n\telse\n\t\tsuprintf(\"Binary executable is signed by '%s' (%s)\", szSubjectName, szCountry);\n\tp = szSubjectName;\n\nout:\n\tsafe_free(mpath);\n\tsafe_free(szFileName);\n\tsafe_free(ProgPubInfo.lpszProgramName);\n\tsafe_free(ProgPubInfo.lpszPublisherLink);\n\tsafe_free(ProgPubInfo.lpszMoreInfoLink);\n\tsafe_free(pSignerInfo);\n\tif (pCertContext != NULL)\n\t\tCertFreeCertificateContext(pCertContext);\n\tif (hStore != NULL)\n\t\tCertCloseStore(hStore, 0);\n\tif (hMsg != NULL)\n\t\tCryptMsgClose(hMsg);\n\treturn p;\n}\n\n// Fills the certificate's name and thumbprint.\n// Tries the issuer first, and if none is available, falls back to current cert.\n// Returns 0 for unsigned, -1 on error, 1 for signer or 2 for issuer.\nint GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info)\n{\n\tint ret = 0;\n\tDWORD dwSize, dwEncoding, dwContentType, dwFormatType, dwSignerInfoSize = 0;\n\tWIN_CERTIFICATE* pWinCert = (WIN_CERTIFICATE*)cert;\n\tCRYPT_DATA_BLOB signedDataBlob;\n\tHCERTSTORE hStore = NULL;\n\tHCRYPTMSG hMsg = NULL;\n\tPCMSG_SIGNER_INFO pSignerInfo = NULL;\n\tPCCERT_CONTEXT pCertContext[2] = { NULL, NULL };\n\tPCCERT_CHAIN_CONTEXT pChainContext = NULL;\n\tCERT_CHAIN_PARA chainPara;\n\tint CertIndex = 0;\n\n\tif (info == NULL)\n\t\treturn -1;\n\tif (pWinCert == NULL || pWinCert->dwLength == 0)\n\t\treturn 0;\n\n\t// Get message handle and store handle from the signed file.\n\tsignedDataBlob.cbData = pWinCert->dwLength;\n\tsignedDataBlob.pbData = pWinCert->bCertificate;\n\tif (!CryptQueryObject(CERT_QUERY_OBJECT_BLOB, &signedDataBlob,\n\t\tCERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED, CERT_QUERY_FORMAT_FLAG_BINARY,\n\t\t0, &dwEncoding, &dwContentType, &dwFormatType, &hStore, &hMsg, NULL)) {\n\t\tuprintf(\"PKI: Failed to get signature: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Get signer information size.\n\tif (!CryptMsgGetParam(hMsg, CMSG_SIGNER_CERT_INFO_PARAM, 0, NULL, &dwSignerInfoSize)) {\n\t\tuprintf(\"PKI: Failed to get signer size: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Allocate memory for signer information.\n\tpSignerInfo = (PCMSG_SIGNER_INFO)calloc(dwSignerInfoSize, 1);\n\tif (pSignerInfo == NULL) {\n\t\tuprintf(\"PKI: Could not allocate memory for signer information\");\n\t\tgoto out;\n\t}\n\n\t// Get Signer Information.\n\tif (!CryptMsgGetParam(hMsg, CMSG_SIGNER_CERT_INFO_PARAM, 0, pSignerInfo, &dwSignerInfoSize)) {\n\t\tuprintf(\"PKI: Failed to get signer info: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Search for the signer certificate in the temporary certificate store.\n\tpCertContext[0] = CertFindCertificateInStore(hStore, ENCODING, 0, CERT_FIND_SUBJECT_CERT, (PVOID)pSignerInfo, NULL);\n\tif (pCertContext[0] == NULL) {\n\t\tuprintf(\"PKI: Failed to locate signer certificate in store: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Build a certificate chain to get the issuer (CA) certificate.\n\tmemset(&chainPara, 0, sizeof(chainPara));\n\tchainPara.cbSize = sizeof(CERT_CHAIN_PARA);\n\tif (!CertGetCertificateChain(NULL, pCertContext[0], NULL, hStore, &chainPara,\n\t\tCERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL | CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY, NULL, &pChainContext)) {\n\t\tuprintf(\"PKI: Failed to build certificate chain. Error code: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Try to get the issuer's certificate (second certificate in the chain) if available\n\tif (pChainContext->cChain > 0 && pChainContext->rgpChain[0]->cElement > 1) {\n\t\tpCertContext[1] = pChainContext->rgpChain[0]->rgpElement[1]->pCertContext;\n\t\tCertIndex = 1;\n\t}\n\n\t// Isolate the signing certificate subject name\n\tdwSize = CertGetNameStringA(pCertContext[CertIndex], CERT_NAME_ATTR_TYPE, 0, szOID_COMMON_NAME,\n\t\tinfo->name, sizeof(info->name));\n\tif (dwSize <= 1) {\n\t\tuprintf(\"PKI: Failed to get Subject Name\");\n\t\tgoto out;\n\t}\n\n\tdwSize = SHA1_HASHSIZE;\n\tif (!CryptHashCertificate(0, CALG_SHA1, 0, pCertContext[CertIndex]->pbCertEncoded,\n\t\tpCertContext[CertIndex]->cbCertEncoded, info->thumbprint, &dwSize)) {\n\t\tuprintf(\"PKI: Failed to compute the thumbprint: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\tret = CertIndex + 1;\n\nout:\n\tsafe_free(pSignerInfo);\n\tif (pCertContext[1] != NULL)\n\t\tCertFreeCertificateContext(pCertContext[1]);\n\tif (pCertContext[0] != NULL)\n\t\tCertFreeCertificateContext(pCertContext[0]);\n\tif (hStore != NULL)\n\t\tCertCloseStore(hStore, 0);\n\tif (hMsg != NULL)\n\t\tCryptMsgClose(hMsg);\n\treturn ret;\n}\n\n// The timestamping authorities we use are RFC 3161 compliant\nstatic uint64_t GetRFC3161TimeStamp(PCMSG_SIGNER_INFO pSignerInfo)\n{\n\tBOOL r, found = FALSE;\n\tDWORD n, dwSize = 0;\n\tPCRYPT_CONTENT_INFO pCounterSignerInfo = NULL;\n\tuint64_t ts = 0ULL;\n\tuint8_t *timestamp_token;\n\tsize_t timestamp_token_size;\n\tchar* timestamp_str;\n\tsize_t timestamp_str_size;\n\n\t// Loop through unauthenticated attributes for szOID_RFC3161_counterSign OID\n\tfor (n = 0; n < pSignerInfo->UnauthAttrs.cAttr; n++) {\n\t\tif (lstrcmpA(pSignerInfo->UnauthAttrs.rgAttr[n].pszObjId, szOID_RFC3161_counterSign) == 0) {\n\t\t\t// Depending on how Microsoft implemented their timestamp checks, and the fact that we are dealing\n\t\t\t// with UnauthAttrs, there's a possibility that an attacker may add a \"fake\" RFC 3161 countersigner\n\t\t\t// to try to trick us into using their timestamp data. Detect that.\n\t\t\tif (found) {\n\t\t\t\tuprintf(\"PKI: Multiple RFC 3161 countersigners found. This could indicate something very nasty...\");\n\t\t\t\treturn 0ULL;\n\t\t\t}\n\t\t\tfound = TRUE;\n\n\t\t\t// Read the countersigner message data\n\t\t\tr = CryptDecodeObjectEx(PKCS_7_ASN_ENCODING, PKCS_CONTENT_INFO,\n\t\t\t\tpSignerInfo->UnauthAttrs.rgAttr[n].rgValue[0].pbData,\n\t\t\t\tpSignerInfo->UnauthAttrs.rgAttr[n].rgValue[0].cbData,\n\t\t\t\tCRYPT_DECODE_ALLOC_FLAG, NULL, (PVOID)&pCounterSignerInfo, &dwSize);\n\t\t\tif (!r) {\n\t\t\t\tuprintf(\"PKI: Could not retrieve RFC 3161 countersigner data: %s\", WinPKIErrorString());\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get the RFC 3161 timestamp message\n\t\t\ttimestamp_token = get_data_from_asn1(pCounterSignerInfo->Content.pbData,\n\t\t\t\tpCounterSignerInfo->Content.cbData, szOID_TIMESTAMP_TOKEN,\n\t\t\t\t// 0x04 = \"Octet String\" ASN.1 tag\n\t\t\t\t0x04, &timestamp_token_size);\n\t\t\tif (timestamp_token) {\n\t\t\t\ttimestamp_str = get_data_from_asn1(timestamp_token, timestamp_token_size, NULL,\n\t\t\t\t\t// 0x18 = \"Generalized Time\" ASN.1 tag\n\t\t\t\t\t0x18, &timestamp_str_size);\n\t\t\t\tif (timestamp_str) {\n\t\t\t\t\t// As per RFC 3161 The syntax is: YYYYMMDDhhmmss[.s...]Z\n\t\t\t\t\tif ((timestamp_str_size < 14) || (timestamp_str[timestamp_str_size - 1] != 'Z')) {\n\t\t\t\t\t\t// Sanity checks\n\t\t\t\t\t\tuprintf(\"PKI: Not an RFC 3161 timestamp\");\n\t\t\t\t\t\tDumpBufferHex(timestamp_str, timestamp_str_size);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tts = strtoull(timestamp_str, NULL, 10);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tLocalFree(pCounterSignerInfo);\n\t\t}\n\t}\n\treturn ts;\n}\n\n// The following is used to get the RFP 3161 timestamp of a nested signature\nstatic uint64_t GetNestedRFC3161TimeStamp(PCMSG_SIGNER_INFO pSignerInfo)\n{\n\tBOOL r, found = FALSE;\n\tDWORD n, dwSize = 0;\n\tPCRYPT_CONTENT_INFO pNestedSignature = NULL;\n\tPCMSG_SIGNER_INFO pNestedSignerInfo = NULL;\n\tHCRYPTMSG hMsg = NULL;\n\tuint64_t ts = 0ULL;\n\n\t// Loop through unauthenticated attributes for szOID_NESTED_SIGNATURE OID\n\tfor (n = 0; ; n++) {\n\t\tif (pNestedSignature != NULL) {\n\t\t\tLocalFree(pNestedSignature);\n\t\t\tpNestedSignature = NULL;\n\t\t}\n\t\tif (hMsg != NULL) {\n\t\t\tCryptMsgClose(hMsg);\n\t\t\thMsg = NULL;\n\t\t}\n\t\tsafe_free(pNestedSignerInfo);\n\t\tif (n >= pSignerInfo->UnauthAttrs.cAttr)\n\t\t\tbreak;\n\t\tif (lstrcmpA(pSignerInfo->UnauthAttrs.rgAttr[n].pszObjId, szOID_NESTED_SIGNATURE) == 0) {\n\t\t\tif (found) {\n\t\t\t\tuprintf(\"PKI: Multiple nested signatures found. This could indicate something very nasty...\");\n\t\t\t\treturn 0ULL;\n\t\t\t}\n\t\t\tfound = TRUE;\n\t\t\tr = CryptDecodeObjectEx(PKCS_7_ASN_ENCODING, PKCS_CONTENT_INFO,\n\t\t\t\tpSignerInfo->UnauthAttrs.rgAttr[n].rgValue[0].pbData,\n\t\t\t\tpSignerInfo->UnauthAttrs.rgAttr[n].rgValue[0].cbData,\n\t\t\t\tCRYPT_DECODE_ALLOC_FLAG, NULL, (PVOID)&pNestedSignature, &dwSize);\n\t\t\tif (!r) {\n\t\t\t\tuprintf(\"PKI: Could not retrieve nested signature data: %s\", WinPKIErrorString());\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\thMsg = CryptMsgOpenToDecode(ENCODING, CMSG_DETACHED_FLAG, CMSG_SIGNED, (HCRYPTPROV)NULL, NULL, NULL);\n\t\t\tif (hMsg == NULL) {\n\t\t\t\tuprintf(\"PKI: Could not create nested signature message: %s\", WinPKIErrorString());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tr = CryptMsgUpdate(hMsg, pNestedSignature->Content.pbData, pNestedSignature->Content.cbData, TRUE);\n\t\t\tif (!r) {\n\t\t\t\tuprintf(\"PKI: Could not update message: %s\", WinPKIErrorString());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Get nested signer\n\t\t\tr = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, NULL, &dwSize);\n\t\t\tif (!r) {\n\t\t\t\tuprintf(\"PKI: Failed to get nested signer size: %s\", WinPKIErrorString());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tpNestedSignerInfo = (PCMSG_SIGNER_INFO)calloc(dwSize, 1);\n\t\t\tif (!pNestedSignerInfo) {\n\t\t\t\tuprintf(\"PKI: Could not allocate memory for nested signer\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tr = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, (PVOID)pNestedSignerInfo, &dwSize);\n\t\t\tif (!r) {\n\t\t\t\tuprintf(\"PKI: Failed to get nested signer information: %s\", WinPKIErrorString());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tts = GetRFC3161TimeStamp(pNestedSignerInfo);\n\t\t}\n\t}\n\treturn ts;\n}\n\n// Return the signature timestamp (as a YYYYMMDDHHMMSS value) or 0 on error\nuint64_t GetSignatureTimeStamp(const char* path)\n{\n\tchar *mpath = NULL;\n\tBOOL r;\n\tHMODULE hm;\n\tHCERTSTORE hStore = NULL;\n\tHCRYPTMSG hMsg = NULL;\n\tDWORD dwSize, dwEncoding, dwContentType, dwFormatType, dwSignerInfoSize = 0;\n\tPCMSG_SIGNER_INFO pSignerInfo = NULL;\n\twchar_t *szFileName;\n\tuint64_t timestamp = 0ULL, nested_timestamp;\n\n\t// If the path is NULL, get the signature of the current runtime\n\tif (path == NULL) {\n\t\tszFileName = calloc(MAX_PATH, sizeof(wchar_t));\n\t\tif (szFileName == NULL)\n\t\t\tgoto out;\n\t\thm = GetModuleHandle(NULL);\n\t\tif (hm == NULL) {\n\t\t\tuprintf(\"PKI: Could not get current executable handle: %s\", WinPKIErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tdwSize = GetModuleFileNameW(hm, szFileName, MAX_PATH);\n\t\tif ((dwSize == 0) || ((dwSize == MAX_PATH) && (GetLastError() == ERROR_INSUFFICIENT_BUFFER))) {\n\t\t\tuprintf(\"PKI: Could not get module filename: %s\", WinPKIErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tmpath = wchar_to_utf8(szFileName);\n\t} else {\n\t\tszFileName = utf8_to_wchar(path);\n\t}\n\n\t// Get message handle and store handle from the signed file.\n\tr = CryptQueryObject(CERT_QUERY_OBJECT_FILE, szFileName,\n\t\tCERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED, CERT_QUERY_FORMAT_FLAG_BINARY,\n\t\t0, &dwEncoding, &dwContentType, &dwFormatType, &hStore, &hMsg, NULL);\n\tif (!r) {\n\t\tuprintf(\"PKI: Failed to get signature for '%s': %s\", (path==NULL)?mpath:path, WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Get signer information size.\n\tr = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, NULL, &dwSignerInfoSize);\n\tif (!r) {\n\t\tuprintf(\"PKI: Failed to get signer size: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Allocate memory for signer information.\n\tpSignerInfo = (PCMSG_SIGNER_INFO)calloc(dwSignerInfoSize, 1);\n\tif (!pSignerInfo) {\n\t\tuprintf(\"PKI: Could not allocate memory for signer information\");\n\t\tgoto out;\n\t}\n\n\t// Get Signer Information.\n\tr = CryptMsgGetParam(hMsg, CMSG_SIGNER_INFO_PARAM, 0, (PVOID)pSignerInfo, &dwSignerInfoSize);\n\tif (!r) {\n\t\tuprintf(\"PKI: Failed to get signer information: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Get the RFC 3161 timestamp\n\ttimestamp = GetRFC3161TimeStamp(pSignerInfo);\n\tif (timestamp)\n\t\tuprintf(\"Note: '%s' has timestamp %s\", (path==NULL)?mpath:path, TimestampToHumanReadable(timestamp));\n\t// Because we were using both SHA-1 and SHA-256 signatures during the SHA-256 transition, we were\n\t// in the very specific situation where Windows could say that our executable passed Authenticode\n\t// validation even if the SHA-1 signature or timestamps had been altered.\n\t// This means that, unless we also check the nested signature timestamp, an attacker could alter\n\t// the most vulnerable signature (which may also be the one used for chronology validation) and\n\t// trick us into using an invalid timestamp value. To prevent this, we validate that, if we have\n\t// both a regular and nested timestamp, they are within 60 seconds of each other.\n\t// Even as we are no longer dual signing with two versions of SHA, we keep the code in case a\n\t// major SHA-256 vulnerability is found and we have to go through a dual SHA again.\n\tnested_timestamp = GetNestedRFC3161TimeStamp(pSignerInfo);\n\tif (nested_timestamp)\n\t\tuprintf(\"Note: '%s' has nested timestamp %s\", (path==NULL)?mpath:path, TimestampToHumanReadable(nested_timestamp));\n\tif ((timestamp != 0ULL) && (nested_timestamp != 0ULL)) {\n\t\tif (_abs64(nested_timestamp - timestamp) > 100) {\n\t\t\tuprintf(\"PKI: Signature timestamp (%lld) and nested timestamp (%lld) differ by more than a minute. \"\n\t\t\t\t\"This could indicate something very nasty...\", timestamp, nested_timestamp);\n\t\t\ttimestamp = 0ULL;\n\t\t}\n\t}\n\nout:\n\tsafe_free(mpath);\n\tsafe_free(szFileName);\n\tsafe_free(pSignerInfo);\n\tif (hStore != NULL)\n\t\tCertCloseStore(hStore, 0);\n\tif (hMsg != NULL)\n\t\tCryptMsgClose(hMsg);\n\treturn timestamp;\n}\n\n// From https://msdn.microsoft.com/en-us/library/windows/desktop/aa382384.aspx\nLONG ValidateSignature(HWND hDlg, const char* path)\n{\n\tLONG r = TRUST_E_SYSTEM_ERROR;\n\tWINTRUST_DATA trust_data = { 0 };\n\tWINTRUST_FILE_INFO trust_file = { 0 };\n\tGUID guid_generic_verify =\t// WINTRUST_ACTION_GENERIC_VERIFY_V2\n\t\t{ 0xaac56b, 0xcd44, 0x11d0,{ 0x8c, 0xc2, 0x0, 0xc0, 0x4f, 0xc2, 0x95, 0xee } };\n\tchar *signature_name;\n\tsize_t i;\n\tuint64_t current_ts, update_ts;\n\n\t// Check the signature name. Make it specific enough (i.e. don't simply check for \"Akeo\")\n\t// so that, besides hacking our server, it'll place an extra hurdle on any malicious entity\n\t// into also fooling a C.A. to issue a certificate that passes our test.\n\tsignature_name = GetSignatureName(path, cert_country, NULL, (hDlg == INVALID_HANDLE_VALUE));\n\tif (signature_name == NULL) {\n\t\tuprintf(\"PKI: Could not get signature name\");\n\t\tif (hDlg != INVALID_HANDLE_VALUE)\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_283), lmprintf(MSG_284));\n\t\treturn TRUST_E_NOSIGNATURE;\n\t}\n\tfor (i = 0; i < ARRAYSIZE(cert_name); i++) {\n\t\tif (strcmp(signature_name, cert_name[i]) == 0)\n\t\t\tbreak;\n\t}\n\tif (i >= ARRAYSIZE(cert_name)) {\n\t\tuprintf(\"PKI: Signature '%s' is unexpected...\", signature_name);\n\t\tif ((hDlg == INVALID_HANDLE_VALUE) || (Notification(MB_YESNO | MB_ICONWARNING,\n\t\t\tlmprintf(MSG_283), lmprintf(MSG_285, signature_name)) != IDYES))\n\t\t\treturn TRUST_E_EXPLICIT_DISTRUST;\n\t}\n\n\ttrust_file.cbStruct = sizeof(trust_file);\n\ttrust_file.pcwszFilePath = utf8_to_wchar(path);\n\tif (trust_file.pcwszFilePath == NULL) {\n\t\tuprintf(\"PKI: Unable to convert '%s' to UTF16\", path);\n\t\treturn RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY);\n\t}\n\n\ttrust_data.cbStruct = sizeof(trust_data);\n\t// NB: WTD_UI_ALL can result in ERROR_SUCCESS even if the signature validation fails,\n\t// because it still prompts the user to run untrusted software, even after explicitly\n\t// notifying them that the signature invalid (and of course Microsoft had to make\n\t// that UI prompt a bit too similar to the other benign prompt you get when running\n\t// trusted software, which, as per cert.org's assessment, may confuse non-security\n\t// conscious-users who decide to gloss over these kind of notifications).\n\ttrust_data.dwUIChoice = WTD_UI_NONE;\n\t// We just downloaded from the Internet, so we should be able to check revocation\n\ttrust_data.fdwRevocationChecks = WTD_REVOKE_WHOLECHAIN;\n\t// 0x400 = WTD_MOTW  for Windows 8.1 or later\n\ttrust_data.dwProvFlags = WTD_REVOCATION_CHECK_CHAIN | 0x400;\n\ttrust_data.dwUnionChoice = WTD_CHOICE_FILE;\n\ttrust_data.pFile = &trust_file;\n\n\t// NB: Calling this API will create DLL sideloading issues through 'msasn1.dll'.\n\t// So make sure you delay-load 'wintrust.dll' in your application.\n\tr = WinVerifyTrustEx(INVALID_HANDLE_VALUE, &guid_generic_verify, &trust_data);\n\tsafe_free(trust_file.pcwszFilePath);\n\tswitch (r) {\n\tcase ERROR_SUCCESS:\n\t\t// hDlg = INVALID_HANDLE_VALUE is used when validating the Fido PS1 script\n\t\tif (hDlg == INVALID_HANDLE_VALUE)\n\t\t\tbreak;\n\t\t// Verify that the timestamp of the downloaded update is in the future of our current one.\n\t\t// This is done to prevent the use of an officially signed, but older binary, as potential attack vector.\n\t\tcurrent_ts = GetSignatureTimeStamp(NULL);\n\t\tif (current_ts == 0ULL) {\n\t\t\tuprintf(\"PKI: Cannot retrieve the current binary's timestamp - Aborting update\");\n\t\t\tr = TRUST_E_TIME_STAMP;\n\t\t} else {\n\t\t\tupdate_ts = GetSignatureTimeStamp(path);\n\t\t\tif (update_ts < current_ts) {\n\t\t\t\tuprintf(\"PKI: Update timestamp (%\" PRIi64 \") is younger than ours (%\" PRIi64 \") - Aborting update\", update_ts, current_ts);\n\t\t\t\tr = TRUST_E_TIME_STAMP;\n\t\t\t}\n\t\t}\n\t\tif ((r != ERROR_SUCCESS) && (force_update < 2))\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_299), lmprintf(MSG_300));\n\t\tbreak;\n\tcase TRUST_E_NOSIGNATURE:\n\t\t// Should already have been reported, but since we have a custom message for it...\n\t\tuprintf(\"PKI: File does not appear to be signed: %s\", WinPKIErrorString());\n\t\tif (hDlg != INVALID_HANDLE_VALUE)\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_283), lmprintf(MSG_284));\n\t\tbreak;\n\tdefault:\n\t\tuprintf(\"PKI: Failed to validate signature: %s\", WinPKIErrorString());\n\t\tif (hDlg != INVALID_HANDLE_VALUE)\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_283), lmprintf(MSG_240));\n\t\tbreak;\n\t}\n\n\treturn r;\n}\n\n// Why-oh-why am I the only one on github doing this openssl vs MS signature validation?!?\n// For once, I'd like to find code samples from *OTHER PEOPLE* who went through this ordeal first...\nBOOL ValidateOpensslSignature(BYTE* pbBuffer, DWORD dwBufferLen, BYTE* pbSignature, DWORD dwSigLen)\n{\n\tHCRYPTPROV hProv = 0;\n\tHCRYPTHASH hHash = 0;\n\tHCRYPTKEY hPubKey;\n\t// We could load and convert an openssl PEM, but since we know what we need...\n\tRSA_2048_PUBKEY pbMyPubKey = {\n\t\t{ PUBLICKEYBLOB, CUR_BLOB_VERSION, 0, CALG_RSA_KEYX },\n\t\t// $ openssl genrsa -aes256 -out private.pem 2048\n\t\t// Generating RSA private key, 2048 bit long modulus\n\t\t// e is 65537 (0x010001)\n\t\t// => 0x010001 below. Also 0x31415352 = \"RSA1\"\n\t\t{ 0x31415352, sizeof(pbMyPubKey.Modulus) * 8, 0x010001 },\n\t\t{ 0 }\t// Modulus is initialized below\n\t};\n\tUSHORT dwMyPubKeyLen = sizeof(pbMyPubKey);\n\tBOOL r;\n\tBYTE t;\n\tint i, j;\n\n\t// Get a handle to the default PROV_RSA_AES provider (AES so we get SHA-256 support).\n\t// 2 passes in case we need to create a new container.\n\tr = CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_AES, CRYPT_NEWKEYSET | CRYPT_VERIFYCONTEXT);\n\tif (!r) {\n\t\tuprintf(\"PKI: Could not create the default key container: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Reverse the modulus bytes from openssl (and also remove the extra unwanted 0x00)\n\tassert(sizeof(rsa_pubkey_modulus) >= sizeof(pbMyPubKey.Modulus));\n\tfor (i = 0; i < sizeof(pbMyPubKey.Modulus); i++)\n\t\tpbMyPubKey.Modulus[i] = rsa_pubkey_modulus[sizeof(rsa_pubkey_modulus) -1 - i];\n\n\t// Import our RSA public key so that the MS API can use it\n\tr = CryptImportKey(hProv, (BYTE*)&pbMyPubKey.BlobHeader, dwMyPubKeyLen, 0, 0, &hPubKey);\n\tif (!r) {\n\t\tuprintf(\"PKI: Could not import public key: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Create the hash object.\n\tr = CryptCreateHash(hProv, CALG_SHA_256, 0, 0, &hHash);\n\tif (!r) {\n\t\tuprintf(\"PKI: Could not create empty hash: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Compute the cryptographic hash of the buffer.\n\tr = CryptHashData(hHash, pbBuffer, dwBufferLen, 0);\n\tif (!r) {\n\t\tuprintf(\"PKI: Could not hash data: %s\", WinPKIErrorString());\n\t\tgoto out;\n\t}\n\n\t// Reverse the signature bytes\n\tfor (i = 0, j = dwSigLen - 1; i < j; i++, j--) {\n\t\tt = pbSignature[i];\n\t\tpbSignature[i] = pbSignature[j];\n\t\tpbSignature[j] = t;\n\t}\n\n\t// Now that we have all of the public key, hash and signature data in a\n\t// format that Microsoft can handle, we can call CryptVerifySignature().\n\tr = CryptVerifySignature(hHash, pbSignature, dwSigLen, hPubKey, NULL, 0);\n\tif (!r) {\n\t\t// If the signature is invalid, clear the buffer so that\n\t\t// we don't keep potentially nasty stuff in memory.\n\t\tmemset(pbBuffer, 0, dwBufferLen);\n\t\tuprintf(\"Signature validation failed: %s\", WinPKIErrorString());\n\t}\n\nout:\n\tif (hHash)\n\t\tCryptDestroyHash(hHash);\n\tif (hProv)\n\t\tCryptReleaseContext(hProv, 0);\n\treturn r;\n}\n"
  },
  {
    "path": "src/process.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Process search functionality\n *\n * Modified from System Informer (a.k.a. Process Hacker):\n *   https://github.com/winsiderss/systeminformer\n * Copyright © 2017-2026 Pete Batard <pete@akeo.ie>\n * Copyright © 2017 dmex\n * Copyright © 2009-2016 wj32\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <assert.h>\n\n#include \"rufus.h\"\n#include \"drive.h\"\n#include \"ntdll.h\"\n#include \"missing.h\"\n#include \"msapi_utf8.h\"\n\nPF_TYPE_DECL(NTAPI, NTSTATUS, NtWow64QueryInformationProcess64, (HANDLE, ULONG, PVOID, ULONG, PULONG));\nPF_TYPE_DECL(NTAPI, NTSTATUS, NtWow64ReadVirtualMemory64, (HANDLE, ULONGLONG, PVOID, ULONG64, PULONG64));\n\nstatic PVOID PhHeapHandle = NULL;\nstatic HANDLE hSearchProcessThread = NULL;\nstatic BlockingProcess blocking_process = { 0 };\n\nextern StrArray BlockingProcessList;\n\n/*\n * Convert an NT Status to an error message\n *\n * \\param Status An operattonal status.\n *\n * \\return An error message string.\n *\n */\nchar* NtStatusError(NTSTATUS Status) {\n\tstatic char unknown[32];\n\n\tswitch (Status) {\n\tcase STATUS_SUCCESS:\n\t\treturn \"Operation Successful\";\n\tcase STATUS_UNSUCCESSFUL:\n\t\treturn \"Operation Failed\";\n\tcase STATUS_BUFFER_OVERFLOW:\n\t\treturn \"Buffer Overflow\";\n\tcase STATUS_NOT_IMPLEMENTED:\n\t\treturn \"Not Implemented\";\n\tcase STATUS_INFO_LENGTH_MISMATCH:\n\t\treturn \"Info Length Mismatch\";\n\tcase STATUS_INVALID_HANDLE:\n\t\treturn \"Invalid Handle.\";\n\tcase STATUS_INVALID_PARAMETER:\n\t\treturn \"Invalid Parameter\";\n\tcase STATUS_NO_MEMORY:\n\t\treturn \"Not Enough Quota\";\n\tcase STATUS_ACCESS_DENIED:\n\t\treturn \"Access Denied\";\n\tcase STATUS_BUFFER_TOO_SMALL:\n\t\treturn \"Buffer Too Small\";\n\tcase STATUS_OBJECT_TYPE_MISMATCH:\n\t\treturn \"Wrong Type\";\n\tcase STATUS_OBJECT_NAME_INVALID:\n\t\treturn \"Object Name Invalid\";\n\tcase STATUS_OBJECT_NAME_NOT_FOUND:\n\t\treturn \"Object Name not found\";\n\tcase STATUS_OBJECT_PATH_INVALID:\n\t\treturn \"Object Path Invalid\";\n\tcase STATUS_SHARING_VIOLATION:\n\t\treturn \"Sharing Violation\";\n\tcase STATUS_INSUFFICIENT_RESOURCES:\n\t\treturn \"Insufficient resources\";\n\tcase STATUS_NOT_SUPPORTED:\n\t\treturn \"Operation is not supported\";\n\tdefault:\n\t\tstatic_sprintf(unknown, \"Unknown error 0x%08lx\", Status);\n\t\treturn unknown;\n\t}\n}\n\nstatic NTSTATUS PhCreateHeap(VOID)\n{\n\tNTSTATUS status = STATUS_SUCCESS;\n\n\tif (PhHeapHandle != NULL)\n\t\treturn STATUS_ALREADY_COMPLETE;\n\n\n\tPhHeapHandle = RtlCreateHeap(HEAP_NO_SERIALIZE | HEAP_GROWABLE, NULL, 2 * MB, 1 * MB, NULL, NULL);\n\tif (PhHeapHandle == NULL)\n\t\tstatus = STATUS_UNSUCCESSFUL;\n\n\treturn status;\n}\n\nstatic NTSTATUS PhDestroyHeap(VOID)\n{\n\tNTSTATUS status = STATUS_SUCCESS;\n\n\tif (PhHeapHandle == NULL)\n\t\treturn STATUS_ALREADY_COMPLETE;\n\n\tif (RtlDestroyHeap(PhHeapHandle) == NULL) {\n\t\tPhHeapHandle = NULL;\n\t} else {\n\t\tstatus = STATUS_UNSUCCESSFUL;\n\t}\n\n\treturn status;\n}\n\n/**\n * Allocates a block of memory.\n *\n * \\param Size The number of bytes to allocate.\n *\n * \\return A pointer to the allocated block of memory.\n */\nstatic PVOID PhAllocate(SIZE_T Size)\n{\n\tif (PhHeapHandle == NULL)\n\t\treturn NULL;\n\n\treturn RtlAllocateHeap(PhHeapHandle, 0, Size);\n}\n\n/**\n * Frees a block of memory allocated with PhAllocate().\n *\n * \\param Memory A pointer to a block of memory.\n */\nstatic VOID PhFree(PVOID Memory)\n{\n\tif (PhHeapHandle == NULL)\n\t\treturn;\n\n\tRtlFreeHeap(PhHeapHandle, 0, Memory);\n}\n\n/**\n * Enumerates all open handles.\n *\n * \\param Handles A variable which receives a pointer to a structure containing information about\n * all opened handles. You must free the structure using PhFree() when you no longer need it.\n *\n * \\return An NTStatus indicating success or the error code.\n */\nNTSTATUS PhEnumHandlesEx(PSYSTEM_HANDLE_INFORMATION_EX *Handles)\n{\n\tstatic ULONG initialBufferSize = 0x10000;\n\tNTSTATUS status = STATUS_SUCCESS;\n\tPVOID buffer;\n\tULONG bufferSize;\n\n\tbufferSize = initialBufferSize;\n\tbuffer = PhAllocate(bufferSize);\n\tif (buffer == NULL)\n\t\treturn STATUS_NO_MEMORY;\n\n\twhile ((status = NtQuerySystemInformation(SystemExtendedHandleInformation,\n\t\tbuffer, bufferSize, NULL)) == STATUS_INFO_LENGTH_MISMATCH) {\n\t\tPhFree(buffer);\n\t\tbufferSize *= 2;\n\n\t\t// Fail if we're resizing the buffer to something very large.\n\t\tif (bufferSize > PH_LARGE_BUFFER_SIZE)\n\t\t\treturn STATUS_INSUFFICIENT_RESOURCES;\n\n\t\tbuffer = PhAllocate(bufferSize);\n\t\tif (buffer == NULL)\n\t\t\treturn STATUS_NO_MEMORY;\n\t}\n\n\tif (!NT_SUCCESS(status)) {\n\t\tPhFree(buffer);\n\t\treturn status;\n\t}\n\n\tif (bufferSize <= 0x200000)\n\t\tinitialBufferSize = bufferSize;\n\t*Handles = (PSYSTEM_HANDLE_INFORMATION_EX)buffer;\n\n\treturn status;\n}\n\n/**\n * Opens a process.\n *\n * \\param ProcessHandle A variable which receives a handle to the process.\n * \\param DesiredAccess The desired access to the process.\n * \\param ProcessId The ID of the process.\n *\n * \\return An NTStatus indicating success or the error code.\n */\nNTSTATUS PhOpenProcess(PHANDLE ProcessHandle, ACCESS_MASK DesiredAccess, HANDLE ProcessId)\n{\n\tNTSTATUS status = STATUS_SUCCESS;\n\tOBJECT_ATTRIBUTES objectAttributes;\n\tCLIENT_ID clientId;\n\n\tif ((LONG_PTR)ProcessId == (LONG_PTR)GetCurrentProcessId()) {\n\t\t*ProcessHandle = NtCurrentProcess();\n\t\treturn 0;\n\t}\n\n\tclientId.UniqueProcess = ProcessId;\n\tclientId.UniqueThread = NULL;\n\n\tInitializeObjectAttributes(&objectAttributes, NULL, 0, NULL, NULL);\n\tstatus = NtOpenProcess(ProcessHandle, DesiredAccess, &objectAttributes, &clientId);\n\n\treturn status;\n}\n\n/**\n * Query processes with open handles to a file, volume or disk.\n *\n * \\param VolumeOrFileHandle The handle to the target.\n * \\param Information The returned list of processes.\n *\n * \\return An NTStatus indicating success or the error code.\n */\nNTSTATUS PhQueryProcessesUsingVolumeOrFile(HANDLE VolumeOrFileHandle,\n\tPFILE_PROCESS_IDS_USING_FILE_INFORMATION *Information)\n{\n\tstatic ULONG initialBufferSize = 16 * KB;\n\tNTSTATUS status = STATUS_SUCCESS;\n\tPVOID buffer;\n\tULONG bufferSize;\n\tIO_STATUS_BLOCK isb;\n\n\tbufferSize = initialBufferSize;\n\tbuffer = PhAllocate(bufferSize);\n\tif (buffer == NULL)\n\t\treturn STATUS_INSUFFICIENT_RESOURCES;\n\n\twhile ((status = NtQueryInformationFile(VolumeOrFileHandle, &isb, buffer, bufferSize,\n\t\tFileProcessIdsUsingFileInformation)) == STATUS_INFO_LENGTH_MISMATCH) {\n\t\tPhFree(buffer);\n\t\tbufferSize *= 2;\n\t\t// Fail if we're resizing the buffer to something very large.\n\t\tif (bufferSize > 64 * MB)\n\t\t\treturn STATUS_INSUFFICIENT_RESOURCES;\n\t\tbuffer = PhAllocate(bufferSize);\n\t}\n\n\tif (!NT_SUCCESS(status)) {\n\t\tPhFree(buffer);\n\t\treturn status;\n\t}\n\n\tif (bufferSize <= 64 * MB)\n\t\tinitialBufferSize = bufferSize;\n\t*Information = (PFILE_PROCESS_IDS_USING_FILE_INFORMATION)buffer;\n\n\treturn status;\n}\n\n/**\n * Return the parent PID of a process\n *\n * \\param pid The PID of the process to look up the parent PID.\n *\n * \\return The parent PID or 0 on error.\n */\nDWORD GetPPID(DWORD pid)\n{\n\tULONG_PTR ppid = 0;\n\tHANDLE hProcess = NULL;\n\tPROCESS_BASIC_INFORMATION_INTERNAL pbi = { 0 };\n\n\thProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);\n\tif (hProcess == NULL)\n\t\tgoto out;\n\n\tif (NT_SUCCESS(NtQueryInformationProcess(hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), NULL)))\n\t\tppid = pbi.InheritedFromUniqueProcessId;\n\nout:\n\tsafe_closehandle(hProcess);\n\treturn (DWORD)ppid;\n}\n\n/**\n * Query the full commandline that was used to create a process.\n * This can be helpful to differentiate between service instances (svchost.exe).\n * Taken from: https://stackoverflow.com/a/14012919/1069307\n *\n * \\param hProcess A handle to a process.\n *\n * \\return A Unicode commandline string, or NULL on error.\n *         The returned string must be freed by the caller.\n */\nstatic PWSTR GetProcessCommandLine(HANDLE hProcess)\n{\n\tPWSTR wcmdline = NULL;\n\tBOOL wow;\n\tDWORD pp_offset, cmd_offset;\n\tNTSTATUS status = STATUS_SUCCESS;\n\tSYSTEM_INFO si;\n\tPBYTE peb = NULL, pp = NULL;\n\tPROCESS_BASIC_INFORMATION_INTERNAL pbi = { 0 };\n\n\t// Determine if 64 or 32-bit processor\n\tGetNativeSystemInfo(&si);\n\tif ((si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) || (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM64)) {\n\t\tpp_offset = 0x20;\n\t\tcmd_offset = 0x70;\n\t} else {\n\t\tpp_offset = 0x10;\n\t\tcmd_offset = 0x40;\n\t}\n\n\t// PEB and Process Parameters (we only need the beginning of these structs)\n\tpeb = (PBYTE)calloc(pp_offset + 8, 1);\n\tif (peb == NULL)\n\t\tgoto out;\n\tpp = (PBYTE)calloc(cmd_offset + 16, 1);\n\tif (pp == NULL)\n\t\tgoto out;\n\n\tIsWow64Process(GetCurrentProcess(), &wow);\n\tif (wow) {\n\t\t// 32-bit process running on a 64-bit OS\n\t\tULONGLONG params;\n\t\tUNICODE_STRING_WOW64* ucmdline;\n\n\t\tPF_INIT_OR_OUT(NtWow64QueryInformationProcess64, NtDll);\n\t\tPF_INIT_OR_OUT(NtWow64ReadVirtualMemory64, NtDll);\n\n\t\tstatus = pfNtWow64QueryInformationProcess64(hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), NULL);\n\t\tif (!NT_SUCCESS(status))\n\t\t\tgoto out;\n\n\t\tstatus = pfNtWow64ReadVirtualMemory64(hProcess, pbi.PebBaseAddress, peb, pp_offset + 8, NULL);\n\t\tif (!NT_SUCCESS(status))\n\t\t\tgoto out;\n\n\t\t// Read Process Parameters from the 64-bit address space\n\t\tparams = (ULONGLONG) *((ULONGLONG*)(peb + pp_offset));\n\t\tstatus = pfNtWow64ReadVirtualMemory64(hProcess, params, pp, cmd_offset + 16, NULL);\n\t\tif (!NT_SUCCESS (status))\n\t\t\tgoto out;\n\n\t\tucmdline = (UNICODE_STRING_WOW64*)(pp + cmd_offset);\n\t\twcmdline = (PWSTR)calloc(ucmdline->Length + 1, sizeof(WCHAR));\n\t\tif (wcmdline == NULL)\n\t\t\tgoto out;\n\t\tstatus = pfNtWow64ReadVirtualMemory64(hProcess, ucmdline->Buffer, wcmdline, ucmdline->Length, NULL);\n\t\tif (!NT_SUCCESS(status)) {\n\t\t\tsafe_free(wcmdline);\n\t\t\tgoto out;\n\t\t}\n\t} else {\n\t\t// 32-bit process on a 32-bit OS, or 64-bit process on a 64-bit OS\n\t\tPBYTE* params;\n\t\tUNICODE_STRING* ucmdline;\n\n\t\tstatus = NtQueryInformationProcess(hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), NULL);\n\t\tif (!NT_SUCCESS(status))\n\t\t\tgoto out;\n\n\t\t// Read PEB\n\t\tif (!ReadProcessMemory(hProcess, (LPCVOID)pbi.PebBaseAddress, peb, pp_offset + 8, NULL))\n\t\t\tgoto out;\n\n\t\t// Read Process Parameters\n\t\tparams = (PBYTE*)*(LPVOID*)(peb + pp_offset);\n\t\tif (!ReadProcessMemory(hProcess, params, pp, cmd_offset + 16, NULL))\n\t\t\tgoto out;\n\n\t\tucmdline = (UNICODE_STRING*)(pp + cmd_offset);\n\t\t// In the absolute, someone could craft a process with dodgy attributes to try to cause an overflow\n\t\t// coverity[cast_overflow]\n\t\tucmdline->Length = min(ucmdline->Length, (USHORT)2 * KB);\n\t\twcmdline = (PWSTR)calloc(ucmdline->Length + 1, sizeof(WCHAR));\n\t\tif (!ReadProcessMemory(hProcess, ucmdline->Buffer, wcmdline, ucmdline->Length, NULL)) {\n\t\t\tsafe_free(wcmdline);\n\t\t\tgoto out;\n\t\t}\n\t}\n\nout:\n\tfree(peb);\n\tfree(pp);\n\treturn wcmdline;\n}\n\n\n/**\n * The search process thread.\n * Note: Avoid using uprintf statements here, as it may lock the thread.\n *\n * \\param param The thread parameters.\n *\n * \\return A thread exit code.\n */\nstatic DWORD WINAPI SearchProcessThread(LPVOID param)\n{\n\tBOOL bInitSuccess = FALSE;\n\tNTSTATUS status = STATUS_SUCCESS;\n\tPSYSTEM_HANDLE_INFORMATION_EX handles = NULL;\n\tPOBJECT_NAME_INFORMATION buffer = NULL;\n\tULONG_PTR i;\n\tULONG_PTR pid[2];\n\tULONG_PTR last_access_denied_pid = 0;\n\tULONG bufferSize;\n\twchar_t** wHandleName = NULL;\n\tUSHORT* wHandleNameLen = NULL;\n\tHANDLE dupHandle = NULL;\n\tHANDLE processHandle = NULL;\n\tHANDLE hLock = NULL;\n\tBOOLEAN bFound = FALSE, bGotCmdLine;\n\tULONG access_rights = 0;\n\tDWORD size;\n\twchar_t wexe_path[MAX_PATH], *wcmdline;\n\tuint64_t start_time;\n\tchar cmdline[2 * KB] = { 0 }, tmp[64];\n\tint cur_pid, j, nHandles = 0;\n\n\t// Initialize the blocking process struct\n\tmemset(&blocking_process, 0, sizeof(blocking_process));\n\thLock = CreateMutexA(NULL, TRUE, NULL);\n\tif (hLock == NULL)\n\t\tgoto out;\n\tblocking_process.hStart = CreateEventA(NULL, TRUE, FALSE, NULL);\n\tif (blocking_process.hStart == NULL)\n\t\tgoto out;\n\tif (!ReleaseMutex(hLock))\n\t\tgoto out;\n\t// Only assign the mutex handle once our init is complete\n\tblocking_process.hLock = hLock;\n\n\tif (!NT_SUCCESS(PhCreateHeap()))\n\t\tgoto out;\n\n\t// Wait until we are signaled active one way or another\n\tif (!blocking_process.bActive &&\n\t\t(WaitForSingleObject(blocking_process.hStart, INFINITE) != WAIT_OBJECT_0)) {\n\t\tgoto out;\n\t}\n\n\tbInitSuccess = TRUE;\n\twhile (blocking_process.bActive) {\n\t\t// Get a lock to our data\n\t\tif (WaitForSingleObject(hLock, SEARCH_PROCESS_LOCK_TIMEOUT) != WAIT_OBJECT_0)\n\t\t\tgoto out;\n\t\t// No handles to check => just sleep for a while\n\t\tif (blocking_process.nHandles == 0) {\n\t\t\tReleaseMutex(hLock);\n\t\t\tSleep(500);\n\t\t\tcontinue;\n\t\t}\n\t\t// Work on our own copy of the handle names so we don't have to hold the\n\t\t// mutex for string comparison. Update only if the version has changed.\n\t\tif (blocking_process.nVersion[0] != blocking_process.nVersion[1]) {\n\t\t\tif_assert_fails(blocking_process.wHandleName != NULL && blocking_process.nHandles != 0) {\n\t\t\t\tReleaseMutex(hLock);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tif (wHandleName != NULL) {\n\t\t\t\tfor (j = 0; j < nHandles; j++)\n\t\t\t\t\tfree(wHandleName[j]);\n\t\t\t\tfree(wHandleName);\n\t\t\t}\n\t\t\tsafe_free(wHandleNameLen);\n\t\t\tnHandles = blocking_process.nHandles;\n\t\t\twHandleName = calloc(nHandles, sizeof(wchar_t*));\n\t\t\tif (wHandleName == NULL) {\n\t\t\t\tReleaseMutex(hLock);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\twHandleNameLen = calloc(nHandles, sizeof(USHORT));\n\t\t\tif (wHandleNameLen == NULL) {\n\t\t\t\tReleaseMutex(hLock);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tfor (j = 0; j < nHandles; j++) {\n\t\t\t\twHandleName[j] = wcsdup(blocking_process.wHandleName[j]);\n\t\t\t\twHandleNameLen[j] = (USHORT)wcslen(blocking_process.wHandleName[j]);\n\t\t\t\tif (wHandleName[j] == NULL) {\n\t\t\t\t\tReleaseMutex(hLock);\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t}\n\t\t\tblocking_process.nVersion[1] = blocking_process.nVersion[0];\n\t\t\tblocking_process.nPass = 0;\n\t\t}\n\t\tReleaseMutex(hLock);\n\n\t\tstart_time = GetTickCount64();\n\t\t// Get a list of all opened handles\n\t\tif (!NT_SUCCESS(PhEnumHandlesEx(&handles))) {\n\t\t\tSleep(1000);\n\t\t\tcontinue;\n\t\t}\n\n\t\tpid[0] = (ULONG_PTR)0;\n\t\tcur_pid = 1;\n\t\tbufferSize = 0x200;\n\t\tbuffer = PhAllocate(bufferSize);\n\t\tif (buffer == NULL)\n\t\t\tgoto out;\n\n\t\tfor (i = 0; blocking_process.bActive; i++) {\n\t\t\tULONG attempts = 8;\n\t\t\tPSYSTEM_HANDLE_TABLE_ENTRY_INFO_EX handleInfo = NULL;\n\n\t\t\t// We are seeing reports of application crashes due to access\n\t\t\t// violation exceptions here, so, since this is not critical code,\n\t\t\t// we add an exception handler to ignore them.\n\t\t\tTRY_AND_HANDLE(\n\t\t\t\tEXCEPTION_ACCESS_VIOLATION,\n\t\t\t\t{ handleInfo = (i < handles->NumberOfHandles) ? &handles->Handles[i] : NULL; },\n\t\t\t\t{ continue; }\n\t\t\t);\n\n\t\t\tif ((dupHandle != NULL) && (processHandle != NtCurrentProcess())) {\n\t\t\t\tTRY_AND_HANDLE(\n\t\t\t\t\tEXCEPTION_ACCESS_VIOLATION,\n\t\t\t\t\t{ NtClose(dupHandle); },\n\t\t\t\t\t{ continue; }\n\t\t\t\t);\n\t\t\t\tdupHandle = NULL;\n\t\t\t}\n\n\t\t\t// Update the current handle's process PID and compare against last\n\t\t\t// Note: Be careful about not trying to overflow our list!\n\t\t\tTRY_AND_HANDLE(\n\t\t\t\tEXCEPTION_ACCESS_VIOLATION,\n\t\t\t\t{ pid[cur_pid] = (handleInfo != NULL) ? handleInfo->UniqueProcessId : -1; },\n\t\t\t\t{ continue; }\n\t\t\t);\n\n\t\t\tif (pid[0] != pid[1]) {\n\t\t\t\tcur_pid = (cur_pid + 1) % 2;\n\n\t\t\t\t// If we're switching process and found a match, store it\n\t\t\t\tif (bFound) {\n\t\t\t\t\tif (WaitForSingleObject(hLock, SEARCH_PROCESS_LOCK_TIMEOUT) == WAIT_OBJECT_0) {\n\t\t\t\t\t\tProcessEntry* pe = blocking_process.Process;\n\t\t\t\t\t\t// Prune entries that have not been detected for a few passes\n\t\t\t\t\t\tfor (j = 0; j < MAX_BLOCKING_PROCESSES; j++)\n\t\t\t\t\t\t\tif (pe[j].pid != 0 && pe[j].seen_on_pass < blocking_process.nPass - 1)\n\t\t\t\t\t\t\t\tpe[j].pid = 0;\n\t\t\t\t\t\t// Try to reuse an existing entry for the current pid\n\t\t\t\t\t\tfor (j = 0; (j < MAX_BLOCKING_PROCESSES) && (pe[j].pid != pid[cur_pid]); j++);\n\t\t\t\t\t\tif (j == MAX_BLOCKING_PROCESSES)\n\t\t\t\t\t\t\tfor (j = 0; (j < MAX_BLOCKING_PROCESSES) && (pe[j].pid != 0); j++);\n\t\t\t\t\t\tif (j != MAX_BLOCKING_PROCESSES) {\n\t\t\t\t\t\t\tpe[j].pid = pid[cur_pid];\n\t\t\t\t\t\t\tpe[j].access_rights = access_rights & 0x7;\n\t\t\t\t\t\t\tpe[j].seen_on_pass = blocking_process.nPass;\n\t\t\t\t\t\t\tstatic_strcpy(pe[j].cmdline, cmdline);\n\t\t\t\t\t\t} else if (usb_debug) {\n\t\t\t\t\t\t\t// coverity[dont_call]\n\t\t\t\t\t\t\tOutputDebugStringA(\"SearchProcessThread: No empty slot!\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tReleaseMutex(hLock);\n\t\t\t\t\t}\n\t\t\t\t\tbFound = FALSE;\n\t\t\t\t\taccess_rights = 0;\n\t\t\t\t}\n\n\t\t\t\t// Close the previous handle\n\t\t\t\tif (processHandle != NULL) {\n\t\t\t\t\tif (processHandle != NtCurrentProcess())\n\t\t\t\t\t\tNtClose(processHandle);\n\t\t\t\t\tprocessHandle = NULL;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Exit thread condition\n\t\t\tif (!blocking_process.bActive)\n\t\t\t\tgoto out;\n\n\t\t\t// Exit loop condition\n\t\t\tif (i >= handles->NumberOfHandles)\n\t\t\t\tbreak;\n\n\t\t\tif (handleInfo == NULL)\n\t\t\t\tcontinue;\n\n\t\t\t// Don't bother with processes we can't access\n\t\t\tif (handleInfo->UniqueProcessId == last_access_denied_pid)\n\t\t\t\tcontinue;\n\n\t\t\t// Filter out handles that aren't opened with Read (bit 0), Write (bit 1) or Execute (bit 5) access\n\t\t\tif ((handleInfo->GrantedAccess & 0x23) == 0)\n\t\t\t\tcontinue;\n\n\t\t\t// Open the process to which the handle we are after belongs, if not already opened\n\t\t\tif (pid[0] != pid[1]) {\n\t\t\t\tstatus = PhOpenProcess(&processHandle, PROCESS_DUP_HANDLE | PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,\n\t\t\t\t\t(HANDLE)handleInfo->UniqueProcessId);\n\t\t\t\t// There exists some processes we can't access\n\t\t\t\tif (!NT_SUCCESS(status)) {\n\t\t\t\t\tprocessHandle = NULL;\n\t\t\t\t\tif (status == STATUS_ACCESS_DENIED) {\n\t\t\t\t\t\tlast_access_denied_pid = handleInfo->UniqueProcessId;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Now duplicate this handle onto our own process, so that we can access its properties\n\t\t\tif (processHandle == NtCurrentProcess())\n\t\t\t\tcontinue;\n\t\t\tstatus = NtDuplicateObject(processHandle, (HANDLE)handleInfo->HandleValue,\n\t\t\t\tNtCurrentProcess(), &dupHandle, 0, 0, 0);\n\t\t\tif (!NT_SUCCESS(status))\n\t\t\t\tcontinue;\n\n\t\t\t// Filter non-storage handles. We're not interested in them and they make NtQueryObject() freeze\n\t\t\tif (GetFileType(dupHandle) != FILE_TYPE_DISK)\n\t\t\t\tcontinue;\n\n\t\t\t// A loop is needed because the I/O subsystem likes to give us the wrong return lengths...\n\t\t\tdo {\n\t\t\t\tULONG returnSize;\n\t\t\t\t// TODO: We might potentially still need a timeout on ObjectName queries, as PH does...\n\t\t\t\tstatus = NtQueryObject(dupHandle, ObjectNameInformation, buffer, bufferSize, &returnSize);\n\t\t\t\tif (status == STATUS_BUFFER_OVERFLOW || status == STATUS_INFO_LENGTH_MISMATCH ||\n\t\t\t\t\tstatus == STATUS_BUFFER_TOO_SMALL) {\n\t\t\t\t\tbufferSize = returnSize;\n\t\t\t\t\tPhFree(buffer);\n\t\t\t\t\tbuffer = PhAllocate(bufferSize);\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (--attempts);\n\t\t\tif (!NT_SUCCESS(status))\n\t\t\t\tcontinue;\n\n\t\t\tfor (j = 0; j < nHandles; j++) {\n\t\t\t\t// Don't bother comparing if length of our handle string is larger than the current data\n\t\t\t\tif (wHandleNameLen[j] > buffer->Name.Length)\n\t\t\t\t\tcontinue;\n\t\t\t\t// Match against our target string(s)\n\t\t\t\tif (wcsncmp(wHandleName[j], buffer->Name.Buffer, wHandleNameLen[j]) == 0)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (j == nHandles)\n\t\t\t\tcontinue;\n\t\t\tbFound = TRUE;\n\n\t\t\t// Keep a mask of all the access rights being used\n\t\t\taccess_rights |= handleInfo->GrantedAccess;\n\t\t\t// The Executable bit is in a place we don't like => reposition it\n\t\t\tif (access_rights & 0x20)\n\t\t\t\taccess_rights = (access_rights & 0x03) | 0x04;\n\t\t\taccess_rights &= 0x07;\n\n\t\t\t// Where possible, try to get the full command line\n\t\t\tbGotCmdLine = FALSE;\n\t\t\tsize = MAX_PATH;\n\t\t\twcmdline = GetProcessCommandLine(processHandle);\n\t\t\tif (wcmdline != NULL) {\n\t\t\t\tbGotCmdLine = TRUE;\n\t\t\t\twchar_to_utf8_no_alloc(wcmdline, cmdline, sizeof(cmdline));\n\t\t\t\tfree(wcmdline);\n\t\t\t}\n\n\t\t\t// If we couldn't get the full commandline, try to get the executable path\n\t\t\tif (!bGotCmdLine)\n\t\t\t\tbGotCmdLine = (GetModuleFileNameExU(processHandle, 0, cmdline, MAX_PATH - 1) != 0);\n\n\t\t\t// The above may not work on all Windows version, so fall back to QueryFullProcessImageName\n\t\t\tif (!bGotCmdLine) {\n\t\t\t\tbGotCmdLine = (QueryFullProcessImageNameW(processHandle, 0, wexe_path, &size) != FALSE);\n\t\t\t\tif (bGotCmdLine)\n\t\t\t\t\twchar_to_utf8_no_alloc(wexe_path, cmdline, sizeof(cmdline));\n\t\t\t}\n\n\t\t\t// Still nothing? Try GetProcessImageFileName. Note that GetProcessImageFileName uses\n\t\t\t// '\\Device\\Harddisk#\\Partition#\\' instead drive letters\n\t\t\tif (!bGotCmdLine) {\n\t\t\t\tbGotCmdLine = (GetProcessImageFileNameW(processHandle, wexe_path, MAX_PATH) != 0);\n\t\t\t\tif (bGotCmdLine)\n\t\t\t\t\twchar_to_utf8_no_alloc(wexe_path, cmdline, sizeof(cmdline));\n\t\t\t}\n\n\t\t\t// Complete failure => Just craft a default process name that includes the PID\n\t\t\tif (!bGotCmdLine) {\n\t\t\t\tstatic_sprintf(cmdline, \"Unknown_Process_%\" PRIu64,\n\t\t\t\t\t(ULONGLONG)handleInfo->UniqueProcessId);\n\t\t\t}\n\t\t}\n\t\tPhFree(buffer);\n\t\tPhFree(handles);\n\t\t// We are the only ones updating the counter so no need for lock\n\t\tblocking_process.nPass++;\n\t\t// In extended debug mode, notify how much time our search took to the debug facility\n\t\tif (usb_debug) {\n\t\t\tstatic_sprintf(tmp, \"Process search run #%d completed in %llu ms\\n\",\n\t\t\t\tblocking_process.nPass, GetTickCount64() - start_time);\n\t\t\t// coverity[dont_call]\n\t\t\tOutputDebugStringA(tmp);\n\t\t}\n\t\tSleep(1000);\n\t}\n\nout:\n\tif (!bInitSuccess)\n\t\tuprintf(\"WARNING: Could not start process handle enumerator!\");\n\n\tif (wHandleName != NULL) {\n\t\tfor (j = 0; j < nHandles; j++)\n\t\t\tfree(wHandleName[j]);\n\t\tfree(wHandleName);\n\t}\n\tsafe_free(wHandleNameLen);\n\n\tPhDestroyHeap();\n\tif ((hLock != NULL) && (hLock != INVALID_HANDLE_VALUE) &&\n\t\t(WaitForSingleObject(hLock, 1000) == WAIT_OBJECT_0)) {\n\t\tblocking_process.hLock = NULL;\n\t\tblocking_process.bActive = FALSE;\n\t\tfor (i = 0; i < blocking_process.nHandles; i++)\n\t\t\tfree(blocking_process.wHandleName[i]);\n\t\tsafe_free(blocking_process.wHandleName);\n\t\tsafe_closehandle(blocking_process.hStart);\n\t\tReleaseMutex(hLock);\n\t}\n\tsafe_closehandle(hLock);\n\n\tExitThread(0);\n}\n\n/**\n * Start the process search thread.\n *\n * \\return TRUE on success, FALSE otherwise.\n *\n */\nBOOL StartProcessSearch(void)\n{\n\tint i;\n\n\tif (hSearchProcessThread != NULL)\n\t\treturn TRUE;\n\n\thSearchProcessThread = CreateThread(NULL, 0, SearchProcessThread, NULL, 0, NULL);\n\tif (hSearchProcessThread == NULL) {\n\t\tuprintf(\"Failed to start process search thread: %s\", WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\tSetThreadPriority(SearchProcessThread, THREAD_PRIORITY_LOWEST);\n\n\t// Wait until we have hLock\n\tfor (i = 0; (i < 50) && (blocking_process.hLock == NULL); i++)\n\t\tSleep(100);\n\tif (i >= 50) {\n\t\tuprintf(\"Failed to start process search thread: hLock init failure!\");\n\t\tTerminateThread(hSearchProcessThread, 0);\n\t\tCloseHandle(hSearchProcessThread);\n\t\thSearchProcessThread = NULL;\n\t\treturn FALSE;\n\t}\n\n\treturn TRUE;\n}\n\n/**\n * Stop the process search thread..\n *\n */\nvoid StopProcessSearch(void)\n{\n\tif (hSearchProcessThread == NULL)\n\t\treturn;\n\n\t// No need for a lock on this one\n\tblocking_process.bActive = FALSE;\n\tif (WaitForSingleObject(hSearchProcessThread, SEARCH_PROCESS_LOCK_TIMEOUT) != WAIT_OBJECT_0) {\n\t\tuprintf(\"Process search thread did not exit within timeout - forcefully terminating it!\");\n\t\tTerminateThread(hSearchProcessThread, 0);\n\t\tCloseHandle(hSearchProcessThread);\n\t}\n\thSearchProcessThread = NULL;\n}\n\n/**\n * Set up the handles that the process search will run against.\n *\n * \\param DeviceNum The device number for the currently selected drive.\n *\n * \\return TRUE on success, FALSE otherwise.\n *\n */\nBOOL SetProcessSearch(DWORD DeviceNum)\n{\n\tchar* PhysicalPath = NULL, DevPath[MAX_PATH];\n\tchar drive_letter[27], drive_name[] = \"?:\";\n\tuint32_t i, nHandles = 0;\n\twchar_t** wHandleName = NULL;\n\n\tif (hSearchProcessThread == NULL) {\n\t\tuprintf(\"Process search thread is not started!\");\n\t\treturn FALSE;\n\t}\n\n\tassert(blocking_process.hLock != NULL);\n\n\t// Populate the handle names\n\twHandleName = calloc(MAX_NUM_HANDLES, sizeof(wchar_t*));\n\tif (wHandleName == NULL)\n\t\treturn FALSE;\n\t// Physical drive handle name\n\tPhysicalPath = GetPhysicalName(DeviceNum);\n\tif (QueryDosDeviceA(&PhysicalPath[4], DevPath, sizeof(DevPath)) != 0)\n\t\twHandleName[nHandles++] = utf8_to_wchar(DevPath);\n\tfree(PhysicalPath);\n\t// Logical drive(s) handle name(s)\n\tif (GetDriveLetters(DeviceNum, drive_letter)) {\n\t\tfor (i = 0; nHandles < MAX_NUM_HANDLES && drive_letter[i]; i++) {\n\t\t\tdrive_name[0] = drive_letter[i];\n\t\t\tif (QueryDosDeviceA(drive_name, DevPath, sizeof(DevPath)) != 0)\n\t\t\t\twHandleName[nHandles++] = utf8_to_wchar(DevPath);\n\t\t}\n\t}\n\tif (WaitForSingleObject(blocking_process.hLock, SEARCH_PROCESS_LOCK_TIMEOUT) != WAIT_OBJECT_0) {\n\t\tuprintf(\"Could not obtain process search lock\");\n\t\tfree(wHandleName);\n\t\tnHandles = 0;\n\t\treturn FALSE;\n\t}\n\n\tif (blocking_process.wHandleName != NULL)\n\t\tfor (i = 0; i < blocking_process.nHandles; i++)\n\t\t\tfree(blocking_process.wHandleName[i]);\n\tfree(blocking_process.wHandleName);\n\tblocking_process.wHandleName = wHandleName;\n\tblocking_process.nHandles = nHandles;\n\tblocking_process.nVersion[0]++;\n\tblocking_process.bActive = TRUE;\n\tif (!SetEvent(blocking_process.hStart))\n\t\tuprintf(\"Could not signal start event to process search: %s\", WindowsErrorString());\n\treturn ReleaseMutex(blocking_process.hLock);\n}\n\n/**\n * Check whether the corresponding PID is that of a running process.\n *\n * \\param pid The PID of the process to check.\n *\n * \\return TRUE if the process is detected as currently running, FALSE otherwise.\n *\n */\nstatic BOOL IsProcessRunning(uint64_t pid)\n{\n\tHANDLE hProcess = NULL;\n\tDWORD dwExitCode;\n\tBOOL ret = FALSE;\n\tNTSTATUS status;\n\n\tstatus = PhOpenProcess(&hProcess, PROCESS_QUERY_LIMITED_INFORMATION, (HANDLE)(uintptr_t)pid);\n\tif (!NT_SUCCESS(status) || (hProcess == NULL))\n\t\treturn FALSE;\n\tif (GetExitCodeProcess(hProcess, &dwExitCode))\n\t\tret = (dwExitCode == STILL_ACTIVE);\n\tNtClose(hProcess);\n\treturn ret;\n}\n\n/**\n * Report the result of the process search.\n *\n * \\param timeout Maximum time that should be spend in this function before aborting (in ms).\n * \\param access_mask Desired access mask (x = 0x4, w = 0x2, r = 0x1).\n * \\param bIgnoreStaleProcesses Whether to ignore processes that are no longer active.\n *\n * \\return The combined access mask of all the matching processes found.\n *         The BlockingProcessList string array is also updated with the results.\n *\n */\nBYTE GetProcessSearch(uint32_t timeout, uint8_t access_mask, BOOL bIgnoreStaleProcesses)\n{\n\tconst char* access_rights_str[8] = { \"n\", \"r\", \"w\", \"rw\", \"x\", \"rx\", \"wx\", \"rwx\" };\n\tchar tmp[2 * KB];\n\tint i, j;\n\tuint32_t elapsed = 0;\n\tBYTE returned_mask = 0;\n//\tDWORD pid, rufus_pid = GetCurrentProcessId();\n\n\tStrArrayClear(&BlockingProcessList);\n\tif (hSearchProcessThread == NULL) {\n\t\tuprintf(\"Process search thread is not started!\");\n\t\treturn 0;\n\t}\n\n\tif_assert_fails(blocking_process.hLock != NULL)\n\t\treturn 0;\n\nretry:\n\tif (WaitForSingleObject(blocking_process.hLock, SEARCH_PROCESS_LOCK_TIMEOUT) != WAIT_OBJECT_0)\n\t\treturn 0;\n\n\t// Make sure we have at least one pass with the current handles in order to report them.\n\t// If we have a timeout, wait until timeout has elapsed to give up.\n\tif ((blocking_process.nVersion[0] != blocking_process.nVersion[1]) ||\n\t\t(blocking_process.nPass < 1)) {\n\t\tReleaseMutex(blocking_process.hLock);\n\t\tif (elapsed < timeout) {\n\t\t\tSleep(100);\n\t\t\telapsed += 100;\n\t\t\tgoto retry;\n\t\t}\n\t\tif (timeout != 0)\n\t\t\tuprintf(\"Timeout while retrieving conflicting process list\");\n\t\treturn 0;\n\t}\n\n\tfor (i = 0, j = 0; i < MAX_BLOCKING_PROCESSES; i++) {\n\t\tif (blocking_process.Process[i].pid == 0)\n\t\t\tcontinue;\n\t\tif ((blocking_process.Process[i].access_rights & access_mask) == 0)\n\t\t\tcontinue;\n\t\tif (bIgnoreStaleProcesses && !IsProcessRunning(blocking_process.Process[i].pid))\n\t\t\tcontinue;\n//\t\tfor (pid = (DWORD)blocking_process.Process[i].pid; pid != 0 && pid != rufus_pid; pid = GetPPID(pid));\n//\t\tif (pid == rufus_pid)\n//\t\t\tcontinue;\n\t\t// Ignore read-only access from explorer.exe, as it's usually no big deal\n\t\tif (blocking_process.Process[i].access_rights == 0x1 &&\n\t\t\t// NB: We are not bothering with nonstandard system drives here\n\t\t\t_stricmp(blocking_process.Process[i].cmdline, \"C:\\\\Windows\\\\explorer.exe\") == 0) {\n\t\t\tcontinue;\n\t\t}\n\t\treturned_mask |= blocking_process.Process[i].access_rights;\n\t\tstatic_sprintf(tmp, \"● [%llu] %s (%s)\", blocking_process.Process[i].pid, blocking_process.Process[i].cmdline,\n\t\t\taccess_rights_str[blocking_process.Process[i].access_rights & 0x7]);\n\t\tStrArrayAdd(&BlockingProcessList, tmp, TRUE);\n\t\tif (j++ == 0)\n\t\t\tuprintf(\"WARNING: The following application(s) or service(s) are accessing the drive:\");\n\t\t// tmp may contain a '%' so don't feed it as a naked format string\n\t\tuprintf(\"%s\", tmp);\n\t}\n\tif (j != 0)\n\t\tuprintf(\"You should close these applications before retrying the operation.\");\n\tReleaseMutex(blocking_process.hLock);\n\n\treturn returned_mask & access_mask;\n}\n\n/**\n * Alternative search for processes keeping a handle on a specific disk or volume\n * Note that this search requires opening the disk or volume, which may not always\n * be convenient for our usage (since we might be looking for processes preventing\n * us to open said target in exclusive mode).\n *\n * At least on Windows 11, this no longer seems to work as querying a logical or\n * physical volume seems to return almost ALL the processes that are running,\n * including the ones that are not actually accessing the handle.\n *\n * \\param HandleName The name of the handle to look for.\n *\n * \\return TRUE if processes were found, FALSE otherwise.\n */\nBOOL SearchProcessAlt(char* HandleName)\n{\n\tNTSTATUS status = STATUS_SUCCESS;\n\tULONG i;\n\tHANDLE searchHandle = NULL;\n\tBOOLEAN bFound = FALSE;\n\tPFILE_PROCESS_IDS_USING_FILE_INFORMATION info = NULL;\n\n\tstatus = PhCreateHeap();\n\tif (!NT_SUCCESS(status))\n\t\tgoto out;\n\n\t// Note that the access rights being used with CreateFile() might matter...\n\tsearchHandle = CreateFileA(HandleName, FILE_READ_ATTRIBUTES | SYNCHRONIZE, FILE_SHARE_READ,\n\t\tNULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n\t\n\tstatus = PhQueryProcessesUsingVolumeOrFile(searchHandle, &info);\n\n\tif (NT_SUCCESS(status) && (info->NumberOfProcessIdsInList > 0)) {\n\t\tbFound = TRUE;\n\t\tuprintf(\"WARNING: The following process(es) or service(s) are accessing %s:\", HandleName);\n\t\tfor (i = 0; i < info->NumberOfProcessIdsInList; i++) {\n\t\t\tuprintf(\"o Process with PID %llu\", (uint64_t)info->ProcessIdList[i]);\n\t\t}\n\t}\n\nout:\n\tsafe_closehandle(searchHandle);\n\tPhFree(info);\n\tPhDestroyHeap();\n\tif (!NT_SUCCESS(status))\n\t\tuprintf(\"SearchProcessAlt('%s') failed: %s\", HandleName, NtStatusError(status));\n\treturn bFound;\n}\n\n/**\n * Increase the privileges of the current application.\n *\n * \\return TRUE if the request was successful.\n */\nBOOL EnablePrivileges(void)\n{\n\t// List of the privileges we require. A list of requestable privileges can\n\t// be obtained at https://technet.microsoft.com/en-us/library/dn221963.aspx\n\tconst DWORD requestedPrivileges[] = {\n\t\tSE_DEBUG_PRIVILEGE,\n\t};\n\tNTSTATUS status = STATUS_NOT_IMPLEMENTED;\n\tHANDLE tokenHandle;\n\n\tstatus = NtOpenProcessToken(NtCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &tokenHandle);\n\n\tif (NT_SUCCESS(status)) {\n\t\tCHAR privilegesBuffer[FIELD_OFFSET(TOKEN_PRIVILEGES, Privileges) +\n\t\t\tsizeof(LUID_AND_ATTRIBUTES) * ARRAYSIZE(requestedPrivileges)] = { 0 };\n\t\tPTOKEN_PRIVILEGES privileges;\n\t\tULONG i;\n\n\t\tprivileges = (PTOKEN_PRIVILEGES)privilegesBuffer;\n\t\tprivileges->PrivilegeCount = ARRAYSIZE(requestedPrivileges);\n\n\t\tfor (i = 0; i < privileges->PrivilegeCount; i++) {\n\t\t\tprivileges->Privileges[i].Attributes = SE_PRIVILEGE_ENABLED;\n\t\t\tprivileges->Privileges[i].Luid.HighPart = 0;\n\t\t\tprivileges->Privileges[0].Luid.LowPart = requestedPrivileges[i];\n\t\t}\n\n\t\tstatus = NtAdjustPrivilegesToken(tokenHandle, FALSE, privileges, 0, NULL, NULL);\n\n\t\tNtClose(tokenHandle);\n\t}\n\n\tif (!NT_SUCCESS(status))\n\t\tubprintf(\"NOTE: Could not set process privileges: %s\", NtStatusError(status));\n\treturn NT_SUCCESS(status);\n}\n"
  },
  {
    "path": "src/registry.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Registry access\n * Copyright © 2012-2022 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n#include <windows.h>\n#include <stdint.h>\n#include <assert.h>\n#include \"rufus.h\"\n\n#pragma once\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define REGKEY_HKCU                 HKEY_CURRENT_USER\n#define REGKEY_HKLM                 HKEY_LOCAL_MACHINE\n\n/* Delete a registry key from <key_root>\\Software and all its values\n   If the key has subkeys, this call will fail. */\nstatic __inline BOOL DeleteRegistryKey(HKEY key_root, const char* key_name)\n{\n\tHKEY hSoftware = NULL;\n\tLONG s;\n\n\tif_assert_fails(key_root == REGKEY_HKCU)\n\t\treturn FALSE;\n\tif_assert_fails(key_name != NULL)\n\t\treturn FALSE;\n\n\tif (RegOpenKeyExA(key_root, \"SOFTWARE\", 0, KEY_READ|KEY_CREATE_SUB_KEY, &hSoftware) != ERROR_SUCCESS)\n\t\treturn FALSE;\n\n\ts = RegDeleteKeyA(hSoftware, key_name);\n\tif ((s != ERROR_SUCCESS) && (s != ERROR_FILE_NOT_FOUND)) {\n\t\tSetLastError(s);\n\t\tuprintf(\"Failed to delete registry key HKCU\\\\Software\\\\%s: %s\", key_name,\n\t\t\t(s == ERROR_ACCESS_DENIED)?\"Key is not empty\":WindowsErrorString());\n\t}\n\tRegCloseKey(hSoftware);\n\treturn ((s == ERROR_SUCCESS) || (s == ERROR_FILE_NOT_FOUND));\n}\n\n/* Find if a registry node exists */\nstatic __inline BOOL IsRegistryNode(HKEY key_root, const char* key_name)\n{\n\tBOOL r;\n\tHKEY hSoftware = NULL;\n\tr = (RegOpenKeyExA(key_root, key_name, 0, KEY_READ, &hSoftware) == ERROR_SUCCESS);\n\tif (hSoftware != NULL)\n\t\tRegCloseKey(hSoftware);\n\treturn r;\n}\n\n/*\n * Read a generic registry key value. If a short key_name is used, assume that\n * it belongs to the application and create the app subkey if required\n */\nstatic __inline BOOL _GetRegistryKey(HKEY key_root, const char* key_name, DWORD reg_type,\n\tLPBYTE dest, DWORD dest_size)\n{\n\tchar long_key_name[MAX_PATH] = { 0 };\n\tBOOL r = FALSE;\n\tsize_t i;\n\tLONG s;\n\tHKEY hSoftware = NULL, hApp = NULL;\n\tDWORD dwDisp, dwType = -1, dwSize = dest_size;\n\n\tmemset(dest, 0, dest_size);\n\n\tif (key_name == NULL)\n\t\treturn FALSE;\n\n\tfor (i = safe_strlen(key_name); i > 0; i--) {\n\t\tif (key_name[i] == '\\\\')\n\t\t\tbreak;\n\t}\n\n\tif (i > 0) {\n\t\t// For a read operation, allow access to any long key\n\t\tif (i >= sizeof(long_key_name))\n\t\t\treturn FALSE;\n\t\tstatic_strcpy(long_key_name, key_name);\n\t\tlong_key_name[i] = 0;\n\t\ti++;\n\t\tif (RegOpenKeyExA(key_root, long_key_name, 0, KEY_READ, &hApp) != ERROR_SUCCESS) {\n\t\t\thApp = NULL;\n\t\t\tgoto out;\n\t\t}\n\t} else {\n\t\tif (RegOpenKeyExA(key_root, \"SOFTWARE\", 0, KEY_READ|KEY_CREATE_SUB_KEY, &hSoftware) != ERROR_SUCCESS) {\n\t\t\thSoftware = NULL;\n\t\t\tgoto out;\n\t\t}\n\t\tif (RegCreateKeyExA(hSoftware, COMPANY_NAME \"\\\\\" APPLICATION_NAME, 0, NULL, 0,\n\t\t\tKEY_SET_VALUE | KEY_QUERY_VALUE | KEY_CREATE_SUB_KEY, NULL, &hApp, &dwDisp) != ERROR_SUCCESS) {\n\t\t\thApp = NULL;\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\ts = RegQueryValueExA(hApp, &key_name[i], NULL, &dwType, (LPBYTE)dest, &dwSize);\n\t// No key means default value of 0 or empty string\n\tif ((s == ERROR_FILE_NOT_FOUND) || ((s == ERROR_SUCCESS) && (dwType == reg_type) && (dwSize > 0))) {\n\t\tr = TRUE;\n\t}\nout:\n\tif (hSoftware != NULL)\n\t\tRegCloseKey(hSoftware);\n\tif (hApp != NULL)\n\t\tRegCloseKey(hApp);\n\treturn r;\n}\n\n/* Write a generic registry key value (create the key if it doesn't exist) */\nstatic __inline BOOL _SetRegistryKey(HKEY key_root, const char* key_name, DWORD reg_type, LPBYTE src, DWORD src_size)\n{\n\tBOOL r = FALSE;\n\tHKEY hRoot = NULL, hApp = NULL;\n\tDWORD dwDisp, dwType = reg_type;\n\n\tif_assert_fails(key_name != NULL)\n\t\treturn FALSE;\n\tif_assert_fails(key_root == REGKEY_HKCU)\n\t\treturn FALSE;\n\t// Validate that we are always dealing with a short key\n\tif_assert_fails(strchr(key_name, '\\\\') == NULL)\n\t\treturn FALSE;\n\n\tif (RegOpenKeyExA(key_root, NULL, 0, KEY_READ|KEY_CREATE_SUB_KEY, &hRoot) != ERROR_SUCCESS) {\n\t\thRoot = NULL;\n\t\tgoto out;\n\t}\n\n\t// This is a short key name, store the value under our app sub-hive\n\tif (RegCreateKeyExA(hRoot, \"SOFTWARE\\\\\" COMPANY_NAME \"\\\\\" APPLICATION_NAME, 0, NULL, 0,\n\t\tKEY_SET_VALUE | KEY_QUERY_VALUE | KEY_CREATE_SUB_KEY, NULL, &hApp, &dwDisp) != ERROR_SUCCESS) {\n\t\thApp = NULL;\n\t\tgoto out;\n\t}\n\n\tr = (RegSetValueExA(hApp, key_name, 0, dwType, src, src_size) == ERROR_SUCCESS);\n\nout:\n\tif (hRoot != NULL)\n\t\tRegCloseKey(hRoot);\n\tif (hApp != NULL)\n\t\tRegCloseKey(hApp);\n\treturn r;\n}\n\n/* Helpers for 64 bit registry operations */\n#define GetRegistryKey64(root, key, pval) _GetRegistryKey(root, key, REG_QWORD, (LPBYTE)pval, sizeof(LONGLONG))\n#define SetRegistryKey64(root, key, val) _SetRegistryKey(root, key, REG_QWORD, (LPBYTE)&val, sizeof(LONGLONG))\n// Check that a key is accessible for R/W (will create a key if not already existing)\nstatic __inline BOOL CheckRegistryKey64(HKEY root, const char* key) {\n\tLONGLONG val;\n\treturn GetRegistryKey64(root, key, &val);\n}\nstatic __inline int64_t ReadRegistryKey64(HKEY root, const char* key) {\n\tLONGLONG val;\n\tGetRegistryKey64(root, key, &val);\n\treturn (int64_t)val;\n}\nstatic __inline BOOL WriteRegistryKey64(HKEY root, const char* key, int64_t val) {\n\tLONGLONG tmp = (LONGLONG)val;\n\treturn SetRegistryKey64(root, key, tmp);\n}\n\n/* Helpers for 32 bit registry operations */\n#define GetRegistryKey32(root, key, pval) _GetRegistryKey(root, key, REG_DWORD, (LPBYTE)pval, sizeof(DWORD))\n#define SetRegistryKey32(root, key, val) _SetRegistryKey(root, key, REG_DWORD, (LPBYTE)&val, sizeof(DWORD))\nstatic __inline BOOL CheckRegistryKey32(HKEY root, const char* key) {\n\tDWORD val;\n\treturn (GetRegistryKey32(root, key, &val) && SetRegistryKey32(root, key, val));\n}\nstatic __inline int32_t ReadRegistryKey32(HKEY root, const char* key) {\n\tDWORD val;\n\tGetRegistryKey32(root, key, &val);\n\treturn (int32_t)val;\n}\nstatic __inline BOOL WriteRegistryKey32(HKEY root, const char* key, int32_t val) {\n\tDWORD tmp = (DWORD)val;\n\treturn SetRegistryKey32(root, key, tmp);\n}\n\n/* Helpers for boolean registry operations */\n#define ReadRegistryKeyBool(root, key) (ReadRegistryKey32(root, key) != 0)\n#define WriteRegistryKeyBool(root, key, b) WriteRegistryKey32(root, key, (b)?1:0)\n#define CheckRegistryKeyBool CheckRegistryKey32\n\n/* Helpers for String registry operations */\n#define GetRegistryKeyStr(root, key, str, len) _GetRegistryKey(root, key, REG_SZ, (LPBYTE)str, (DWORD)len)\n#define SetRegistryKeyStr(root, key, str) _SetRegistryKey(root, key, REG_SZ, (LPBYTE)str, (DWORD)safe_strlen(str))\n// Use a static buffer - don't allocate\nstatic __inline char* ReadRegistryKeyStr(HKEY root, const char* key) {\n\tstatic char str[512];\n\tstr[0] = 0;\n\t_GetRegistryKey(root, key, REG_SZ, (LPBYTE)str, (DWORD)sizeof(str)-1);\n\treturn str;\n}\n#define WriteRegistryKeyStr SetRegistryKeyStr\n\n#ifdef __cplusplus\n}\n#endif\n"
  },
  {
    "path": "src/resource.h",
    "content": "//{{NO_DEPENDENCIES}}\r\n// Microsoft Visual C++ generated include file.\r\n// Used by rufus.rc\r\n//\r\n#define IDD_DIALOG                      101\r\n#define IDD_ABOUTBOX                    102\r\n#define IDD_NOTIFICATION                103\r\n#define IDD_SELECTION                   104\r\n#define IDD_LICENSE                     105\r\n#define IDD_LOG                         106\r\n#define IDD_UPDATE_POLICY               107\r\n#define IDD_NEW_VERSION                 108\r\n#define IDD_HASH                        109\r\n#define IDD_LIST                        110\r\n#define IDI_ICON                        120\r\n#define IDI_LANG_16                     121\r\n#define IDI_INFO_16                     122\r\n#define IDI_SETTINGS_16                 123\r\n#define IDI_LOG_16                      124\r\n#define IDI_SAVE_16                     125\r\n#define IDI_HASH_16                     126\r\n#define IDI_LANG_24                     131\r\n#define IDI_INFO_24                     132\r\n#define IDI_SETTINGS_24                 133\r\n#define IDI_LOG_24                      134\r\n#define IDI_SAVE_24                     135\r\n#define IDI_HASH_24                     136\r\n#define IDI_LANG_32                     141\r\n#define IDI_INFO_32                     142\r\n#define IDI_SETTINGS_32                 143\r\n#define IDI_LOG_32                      144\r\n#define IDI_SAVE_32                     145\r\n#define IDI_HASH_32                     146\r\n#define IDR_FD_COMMAND_COM              300\r\n#define IDR_FD_KERNEL_SYS               301\r\n#define IDR_FD_DISPLAY_EXE              302\r\n#define IDR_FD_KEYB_EXE                 303\r\n#define IDR_FD_MODE_COM                 304\r\n#define IDR_FD_KB1_SYS                  305\r\n#define IDR_FD_KB2_SYS                  306\r\n#define IDR_FD_KB3_SYS                  307\r\n#define IDR_FD_KB4_SYS                  308\r\n#define IDR_FD_EGA1_CPX                 309\r\n#define IDR_FD_EGA2_CPX                 310\r\n#define IDR_FD_EGA3_CPX                 311\r\n#define IDR_FD_EGA4_CPX                 312\r\n#define IDR_FD_EGA5_CPX                 313\r\n#define IDR_FD_EGA6_CPX                 314\r\n#define IDR_FD_EGA7_CPX                 315\r\n#define IDR_FD_EGA8_CPX                 316\r\n#define IDR_FD_EGA9_CPX                 317\r\n#define IDR_FD_EGA10_CPX                318\r\n#define IDR_FD_EGA11_CPX                319\r\n#define IDR_FD_EGA12_CPX                320\r\n#define IDR_FD_EGA13_CPX                321\r\n#define IDR_FD_EGA14_CPX                322\r\n#define IDR_FD_EGA15_CPX                323\r\n#define IDR_FD_EGA16_CPX                324\r\n#define IDR_FD_EGA17_CPX                325\r\n#define IDR_FD_EGA18_CPX                326\r\n#define IDR_SL_LDLINUX_V4_BSS           400\r\n#define IDR_SL_LDLINUX_V4_SYS           401\r\n#define IDR_SL_LDLINUX_V6_BSS           402\r\n#define IDR_SL_LDLINUX_V6_SYS           403\r\n#define IDR_SL_MBOOT_C32                404\r\n#define IDR_GR_GRUB_GRLDR_MBR           450\r\n#define IDR_GR_GRUB2_CORE_IMG           451\r\n#define IDR_SBR_MSG                     452\r\n#define IDR_LC_RUFUS_LOC                500\r\n#define IDR_XT_HOGGER                   501\r\n#define IDR_UEFI_NTFS                   502\r\n#define IDR_SETUP_X64                   503\r\n#define IDR_SETUP_ARM64                 504\r\n// The following should match the ArchType array values +600/+700\r\n#define IDR_MD5_BOOT                    600\r\n#define IDR_MD5_BOOTIA32                601\r\n#define IDR_MD5_BOOTX64                 602\r\n#define IDR_MD5_BOOTARM                 603\r\n#define IDR_MD5_BOOTAA64                604\r\n#define IDR_MD5_BOOTRISCV64             606\r\n#define IDR_MD5_BOOTLOONGARCH64         607\r\n#define IDR_DBX                         700\r\n#define IDR_DBX_IA32                    701\r\n#define IDR_DBX_X64                     702\r\n#define IDR_DBX_ARM                     703\r\n#define IDR_DBX_AA64                    704\r\n#define IDR_DBX_IA64                    705\r\n#define IDR_DBX_RISCV64                 706\r\n#define IDR_DBX_LOONGARCH64             707\r\n#define IDM_SELECT                      901\r\n#define IDM_DOWNLOAD                    902\r\n#define IDC_DEVICE                      1001\r\n#define IDC_FILE_SYSTEM                 1002\r\n#define IDC_START                       1003\r\n#define IDC_PARTITION_TYPE              1004\r\n#define IDC_CLUSTER_SIZE                1005\r\n#define IDC_STATUS                      1006\r\n#define IDC_LABEL                       1007\r\n#define IDC_QUICK_FORMAT                1008\r\n#define IDC_BAD_BLOCKS                  1009\r\n#define IDC_PROGRESS                    1010\r\n#define IDC_BOOT_SELECTION              1011\r\n#define IDC_NB_PASSES                   1012\r\n#define IDC_TEST                        1013\r\n#define IDC_SELECT                      1014\r\n#define IDC_EXTENDED_LABEL              1015\r\n#define IDC_TARGET_SYSTEM               1017\r\n#define IDC_PERSISTENCE_SIZE            1018\r\n#define IDC_PERSISTENCE_UNITS           1019\r\n#define IDC_OLD_BIOS_FIXES              1020\r\n#define IDC_UEFI_MEDIA_VALIDATION       1021\r\n#define IDC_LIST_USB_HDD                1022\r\n#define IDC_STATUS_TOOLBAR              1023\r\n#define IDC_SAVE                        1024\r\n#define IDC_HASH                        1025\r\n#define IDC_IMAGE_OPTION                1026\r\n#define IDC_PERSISTENCE_SLIDER          1027\r\n#define IDC_ADVANCED_DRIVE_PROPERTIES   1028\r\n#define IDC_ADVANCED_FORMAT_OPTIONS     1029\r\n#define IDC_ABOUT_LICENSE               1030\r\n#define IDC_ABOUT_ICON                  1031\r\n#define IDC_ABOUT_COPYRIGHTS            1032\r\n#define IDC_ABOUT_BLURB                 1033\r\n#define IDC_LICENSE_TEXT                1034\r\n#define IDC_NOTIFICATION_ICON           1040\r\n#define IDC_NOTIFICATION_TEXT           1041\r\n#define IDC_NOTIFICATION_LINE           1042\r\n#define IDC_ADVANCED_DEVICE_TOOLBAR     1043\r\n#define IDC_ADVANCED_FORMAT_TOOLBAR     1044\r\n#define IDC_SAVE_TOOLBAR                1045\r\n#define IDC_HASH_TOOLBAR                1046\r\n#define IDC_MULTI_TOOLBAR               1047\r\n#define IDC_LANG                        1051\r\n#define IDC_ABOUT                       1052\r\n#define IDC_SETTINGS                    1053\r\n#define IDC_LOG                         1054\r\n#define IDC_LOG_EDIT                    1055\r\n#define IDC_LOG_SAVE                    1056\r\n#define IDC_LOG_CLEAR                   1057\r\n#define IDC_DONT_DISPLAY_AGAIN          1059\r\n#define IDC_MORE_INFO                   1060\r\n#define IDC_POLICY                      1061\r\n#define IDC_UPDATE_FREQUENCY            1062\r\n#define IDC_INCLUDE_BETAS               1063\r\n#define IDC_RELEASE_NOTES               1064\r\n#define IDC_DOWNLOAD                    1065\r\n#define IDC_CHECK_NOW                   1066\r\n#define IDC_WEBSITE                     1067\r\n#define IDC_YOUR_VERSION                1068\r\n#define IDC_LATEST_VERSION              1069\r\n#define IDC_DOWNLOAD_URL                1070\r\n#define IDC_MD5                         1071\r\n#define IDC_SHA1                        1072\r\n#define IDC_SHA256                      1073\r\n#define IDC_SHA512                      1074\r\n#define IDC_SELECTION_ICON              1075\r\n#define IDC_SELECTION_TEXT              1076\r\n#define IDC_SELECTION_LINE              1077\r\n#define IDC_SELECTION_CHOICE1           1078\r\n#define IDC_SELECTION_CHOICE2           1079\r\n#define IDC_SELECTION_CHOICE3           1080\r\n#define IDC_SELECTION_CHOICE4           1081\r\n#define IDC_SELECTION_CHOICE5           1082\r\n#define IDC_SELECTION_CHOICE6           1083\r\n#define IDC_SELECTION_CHOICE7           1084\r\n#define IDC_SELECTION_CHOICE8           1085\r\n#define IDC_SELECTION_CHOICE9           1086\r\n#define IDC_SELECTION_CHOICE10          1087\r\n#define IDC_SELECTION_CHOICE11          1088\r\n#define IDC_SELECTION_CHOICE12          1089\r\n#define IDC_SELECTION_CHOICE13          1090\r\n#define IDC_SELECTION_CHOICE14          1091\r\n#define IDC_SELECTION_CHOICE15          1092\r\n#define IDC_SELECTION_CHOICEMAX         1093\r\n#define IDC_SELECTION_USERNAME          1094\r\n#define IDC_SELECTION_EDITION           1095\r\n#define IDC_LIST_ICON                   1100\r\n#define IDC_LIST_TEXT                   1101\r\n#define IDC_LIST_LINE                   1102\r\n#define IDC_LIST_ITEM1                  1103\r\n#define IDC_LIST_ITEM2                  1104\r\n#define IDC_LIST_ITEM3                  1105\r\n#define IDC_LIST_ITEM4                  1106\r\n#define IDC_LIST_ITEM5                  1107\r\n#define IDC_LIST_ITEM6                  1108\r\n#define IDC_LIST_ITEM7                  1109\r\n#define IDC_LIST_ITEM8                  1110\r\n#define IDC_LIST_ITEM9                  1111\r\n#define IDC_LIST_ITEM10                 1112\r\n#define IDC_LIST_ITEM11                 1113\r\n#define IDC_LIST_ITEM12                 1114\r\n#define IDC_LIST_ITEM13                 1115\r\n#define IDC_LIST_ITEM14                 1116\r\n#define IDC_LIST_ITEM15                 1117\r\n#define IDC_LIST_ITEMMAX                1118\r\n#define IDS_DEVICE_TXT                  2000\r\n#define IDS_PARTITION_TYPE_TXT          2001\r\n#define IDS_FILE_SYSTEM_TXT             2002\r\n#define IDS_CLUSTER_SIZE_TXT            2003\r\n#define IDS_LABEL_TXT                   2004\r\n#define IDS_CSM_HELP_TXT                2005\r\n#define IDS_UPDATE_SETTINGS_GRP         2006\r\n#define IDS_UPDATE_FREQUENCY_TXT        2007\r\n#define IDS_INCLUDE_BETAS_TXT           2008\r\n#define IDS_NEW_VERSION_AVAIL_TXT       2009\r\n#define IDS_NEW_VERSION_DOWNLOAD_GRP    2010\r\n#define IDS_NEW_VERSION_NOTES_GRP       2011\r\n#define IDS_CHECK_NOW_GRP               2012\r\n#define IDS_TARGET_SYSTEM_TXT           2013\r\n#define IDS_IMAGE_OPTION_TXT            2014\r\n#define IDS_BOOT_SELECTION_TXT          2015\r\n#define IDS_DRIVE_PROPERTIES_TXT        2016\r\n#define IDS_FORMAT_OPTIONS_TXT          2017\r\n#define IDS_STATUS_TXT                  2018\r\n#define MSG_000                         3000\r\n#define MSG_001                         3001\r\n#define MSG_002                         3002\r\n#define MSG_003                         3003\r\n#define MSG_004                         3004\r\n#define MSG_005                         3005\r\n#define MSG_006                         3006\r\n#define MSG_007                         3007\r\n#define MSG_008                         3008\r\n#define MSG_009                         3009\r\n#define MSG_010                         3010\r\n#define MSG_011                         3011\r\n#define MSG_012                         3012\r\n#define MSG_013                         3013\r\n#define MSG_014                         3014\r\n#define MSG_015                         3015\r\n#define MSG_016                         3016\r\n#define MSG_017                         3017\r\n#define MSG_018                         3018\r\n#define MSG_019                         3019\r\n#define MSG_020                         3020\r\n#define MSG_021                         3021\r\n#define MSG_022                         3022\r\n#define MSG_023                         3023\r\n#define MSG_024                         3024\r\n#define MSG_025                         3025\r\n#define MSG_026                         3026\r\n#define MSG_027                         3027\r\n#define MSG_028                         3028\r\n#define MSG_029                         3029\r\n#define MSG_030                         3030\r\n#define MSG_031                         3031\r\n#define MSG_032                         3032\r\n#define MSG_033                         3033\r\n#define MSG_034                         3034\r\n#define MSG_035                         3035\r\n#define MSG_036                         3036\r\n#define MSG_037                         3037\r\n#define MSG_038                         3038\r\n#define MSG_039                         3039\r\n#define MSG_040                         3040\r\n#define MSG_041                         3041\r\n#define MSG_042                         3042\r\n#define MSG_043                         3043\r\n#define MSG_044                         3044\r\n#define MSG_045                         3045\r\n#define MSG_046                         3046\r\n#define MSG_047                         3047\r\n#define MSG_048                         3048\r\n#define MSG_049                         3049\r\n#define MSG_050                         3050\r\n#define MSG_051                         3051\r\n#define MSG_052                         3052\r\n#define MSG_053                         3053\r\n#define MSG_054                         3054\r\n#define MSG_055                         3055\r\n#define MSG_056                         3056\r\n#define MSG_057                         3057\r\n#define MSG_058                         3058\r\n#define MSG_059                         3059\r\n#define MSG_060                         3060\r\n#define MSG_061                         3061\r\n#define MSG_062                         3062\r\n#define MSG_063                         3063\r\n#define MSG_064                         3064\r\n#define MSG_065                         3065\r\n#define MSG_066                         3066\r\n#define MSG_067                         3067\r\n#define MSG_068                         3068\r\n#define MSG_069                         3069\r\n#define MSG_070                         3070\r\n#define MSG_071                         3071\r\n#define MSG_072                         3072\r\n#define MSG_073                         3073\r\n#define MSG_074                         3074\r\n#define MSG_075                         3075\r\n#define MSG_076                         3076\r\n#define MSG_077                         3077\r\n#define MSG_078                         3078\r\n#define MSG_079                         3079\r\n#define MSG_080                         3080\r\n#define MSG_081                         3081\r\n#define MSG_082                         3082\r\n#define MSG_083                         3083\r\n#define MSG_084                         3084\r\n#define MSG_085                         3085\r\n#define MSG_086                         3086\r\n#define MSG_087                         3087\r\n#define MSG_088                         3088\r\n#define MSG_089                         3089\r\n#define MSG_090                         3090\r\n#define MSG_091                         3091\r\n#define MSG_092                         3092\r\n#define MSG_093                         3093\r\n#define MSG_094                         3094\r\n#define MSG_095                         3095\r\n#define MSG_096                         3096\r\n#define MSG_097                         3097\r\n#define MSG_098                         3098\r\n#define MSG_099                         3099\r\n#define MSG_100                         3100\r\n#define MSG_101                         3101\r\n#define MSG_102                         3102\r\n#define MSG_103                         3103\r\n#define MSG_104                         3104\r\n#define MSG_105                         3105\r\n#define MSG_106                         3106\r\n#define MSG_107                         3107\r\n#define MSG_108                         3108\r\n#define MSG_109                         3109\r\n#define MSG_110                         3110\r\n#define MSG_111                         3111\r\n#define MSG_112                         3112\r\n#define MSG_113                         3113\r\n#define MSG_114                         3114\r\n#define MSG_115                         3115\r\n#define MSG_116                         3116\r\n#define MSG_117                         3117\r\n#define MSG_118                         3118\r\n#define MSG_119                         3119\r\n#define MSG_120                         3120\r\n#define MSG_121                         3121\r\n#define MSG_122                         3122\r\n#define MSG_123                         3123\r\n#define MSG_124                         3124\r\n#define MSG_125                         3125\r\n#define MSG_126                         3126\r\n#define MSG_127                         3127\r\n#define MSG_128                         3128\r\n#define MSG_129                         3129\r\n#define MSG_130                         3130\r\n#define MSG_131                         3131\r\n#define MSG_132                         3132\r\n#define MSG_133                         3133\r\n#define MSG_134                         3134\r\n#define MSG_135                         3135\r\n#define MSG_136                         3136\r\n#define MSG_137                         3137\r\n#define MSG_138                         3138\r\n#define MSG_139                         3139\r\n#define MSG_140                         3140\r\n#define MSG_141                         3141\r\n#define MSG_142                         3142\r\n#define MSG_143                         3143\r\n#define MSG_144                         3144\r\n#define MSG_145                         3145\r\n#define MSG_146                         3146\r\n#define MSG_147                         3147\r\n#define MSG_148                         3148\r\n#define MSG_149                         3149\r\n#define MSG_150                         3150\r\n#define MSG_151                         3151\r\n#define MSG_152                         3152\r\n#define MSG_153                         3153\r\n#define MSG_154                         3154\r\n#define MSG_155                         3155\r\n#define MSG_156                         3156\r\n#define MSG_157                         3157\r\n#define MSG_158                         3158\r\n#define MSG_159                         3159\r\n#define MSG_160                         3160\r\n#define MSG_161                         3161\r\n#define MSG_162                         3162\r\n#define MSG_163                         3163\r\n#define MSG_164                         3164\r\n#define MSG_165                         3165\r\n#define MSG_166                         3166\r\n#define MSG_167                         3167\r\n#define MSG_168                         3168\r\n#define MSG_169                         3169\r\n#define MSG_170                         3170\r\n#define MSG_171                         3171\r\n#define MSG_172                         3172\r\n#define MSG_173                         3173\r\n#define MSG_174                         3174\r\n#define MSG_175                         3175\r\n#define MSG_176                         3176\r\n#define MSG_177                         3177\r\n#define MSG_178                         3178\r\n#define MSG_179                         3179\r\n#define MSG_180                         3180\r\n#define MSG_181                         3181\r\n#define MSG_182                         3182\r\n#define MSG_183                         3183\r\n#define MSG_184                         3184\r\n#define MSG_185                         3185\r\n#define MSG_186                         3186\r\n#define MSG_187                         3187\r\n#define MSG_188                         3188\r\n#define MSG_189                         3189\r\n#define MSG_190                         3190\r\n#define MSG_191                         3191\r\n#define MSG_192                         3192\r\n#define MSG_193                         3193\r\n#define MSG_194                         3194\r\n#define MSG_195                         3195\r\n#define MSG_196                         3196\r\n#define MSG_197                         3197\r\n#define MSG_198                         3198\r\n#define MSG_199                         3199\r\n#define MSG_200                         3200\r\n#define MSG_201                         3201\r\n#define MSG_202                         3202\r\n#define MSG_203                         3203\r\n#define MSG_204                         3204\r\n#define MSG_205                         3205\r\n#define MSG_206                         3206\r\n#define MSG_207                         3207\r\n#define MSG_208                         3208\r\n#define MSG_209                         3209\r\n#define MSG_210                         3210\r\n#define MSG_211                         3211\r\n#define MSG_212                         3212\r\n#define MSG_213                         3213\r\n#define MSG_214                         3214\r\n#define MSG_215                         3215\r\n#define MSG_216                         3216\r\n#define MSG_217                         3217\r\n#define MSG_218                         3218\r\n#define MSG_219                         3219\r\n#define MSG_220                         3220\r\n#define MSG_221                         3221\r\n#define MSG_222                         3222\r\n#define MSG_223                         3223\r\n#define MSG_224                         3224\r\n#define MSG_225                         3225\r\n#define MSG_226                         3226\r\n#define MSG_227                         3227\r\n#define MSG_228                         3228\r\n#define MSG_229                         3229\r\n#define MSG_230                         3230\r\n#define MSG_231                         3231\r\n#define MSG_232                         3232\r\n#define MSG_233                         3233\r\n#define MSG_234                         3234\r\n#define MSG_235                         3235\r\n#define MSG_236                         3236\r\n#define MSG_237                         3237\r\n#define MSG_238                         3238\r\n#define MSG_239                         3239\r\n#define MSG_240                         3240\r\n#define MSG_241                         3241\r\n#define MSG_242                         3242\r\n#define MSG_243                         3243\r\n#define MSG_244                         3244\r\n#define MSG_245                         3245\r\n#define MSG_246                         3246\r\n#define MSG_247                         3247\r\n#define MSG_248                         3248\r\n#define MSG_249                         3249\r\n#define MSG_250                         3250\r\n#define MSG_251                         3251\r\n#define MSG_252                         3252\r\n#define MSG_253                         3253\r\n#define MSG_254                         3254\r\n#define MSG_255                         3255\r\n#define MSG_256                         3256\r\n#define MSG_257                         3257\r\n#define MSG_258                         3258\r\n#define MSG_259                         3259\r\n#define MSG_260                         3260\r\n#define MSG_261                         3261\r\n#define MSG_262                         3262\r\n#define MSG_263                         3263\r\n#define MSG_264                         3264\r\n#define MSG_265                         3265\r\n#define MSG_266                         3266\r\n#define MSG_267                         3267\r\n#define MSG_268                         3268\r\n#define MSG_269                         3269\r\n#define MSG_270                         3270\r\n#define MSG_271                         3271\r\n#define MSG_272                         3272\r\n#define MSG_273                         3273\r\n#define MSG_274                         3274\r\n#define MSG_275                         3275\r\n#define MSG_276                         3276\r\n#define MSG_277                         3277\r\n#define MSG_278                         3278\r\n#define MSG_279                         3279\r\n#define MSG_280                         3280\r\n#define MSG_281                         3281\r\n#define MSG_282                         3282\r\n#define MSG_283                         3283\r\n#define MSG_284                         3284\r\n#define MSG_285                         3285\r\n#define MSG_286                         3286\r\n#define MSG_287                         3287\r\n#define MSG_288                         3288\r\n#define MSG_289                         3289\r\n#define MSG_290                         3290\r\n#define MSG_291                         3291\r\n#define MSG_292                         3292\r\n#define MSG_293                         3293\r\n#define MSG_294                         3294\r\n#define MSG_295                         3295\r\n#define MSG_296                         3296\r\n#define MSG_297                         3297\r\n#define MSG_298                         3298\r\n#define MSG_299                         3299\r\n#define MSG_300                         3300\r\n#define MSG_301                         3301\r\n#define MSG_302                         3302\r\n#define MSG_303                         3303\r\n#define MSG_304                         3304\r\n#define MSG_305                         3305\r\n#define MSG_306                         3306\r\n#define MSG_307                         3307\r\n#define MSG_308                         3308\r\n#define MSG_309                         3309\r\n#define MSG_310                         3310\r\n#define MSG_311                         3311\r\n#define MSG_312                         3312\r\n#define MSG_313                         3313\r\n#define MSG_314                         3314\r\n#define MSG_315                         3315\r\n#define MSG_316                         3316\r\n#define MSG_317                         3317\r\n#define MSG_318                         3318\r\n#define MSG_319                         3319\r\n#define MSG_320                         3320\r\n#define MSG_321                         3321\r\n#define MSG_322                         3322\r\n#define MSG_323                         3323\r\n#define MSG_324                         3324\r\n#define MSG_325                         3325\r\n#define MSG_326                         3326\r\n#define MSG_327                         3327\r\n#define MSG_328                         3328\r\n#define MSG_329                         3329\r\n#define MSG_330                         3330\r\n#define MSG_331                         3331\r\n#define MSG_332                         3332\r\n#define MSG_333                         3333\r\n#define MSG_334                         3334\r\n#define MSG_335                         3335\r\n#define MSG_336                         3336\r\n#define MSG_337                         3337\r\n#define MSG_338                         3338\r\n#define MSG_339                         3339\r\n#define MSG_340                         3340\r\n#define MSG_341                         3341\r\n#define MSG_342                         3342\r\n#define MSG_343                         3343\r\n#define MSG_344                         3344\r\n#define MSG_345                         3345\r\n#define MSG_346                         3346\r\n#define MSG_347                         3347\r\n#define MSG_348                         3348\r\n#define MSG_349                         3349\r\n#define MSG_350                         3350\r\n#define MSG_351                         3351\r\n#define MSG_352                         3352\r\n#define MSG_353                         3353\r\n#define MSG_354                         3354\r\n#define MSG_355                         3355\r\n#define MSG_356                         3356\r\n#define MSG_357                         3357\r\n#define MSG_358                         3358\r\n#define MSG_359                         3359\r\n#define MSG_360                         3360\r\n#define MSG_361                         3361\r\n#define MSG_362                         3362\r\n#define MSG_363                         3363\r\n#define MSG_364                         3364\r\n#define MSG_365                         3365\r\n#define MSG_366                         3366\r\n#define MSG_367                         3367\r\n#define MSG_368                         3368\r\n#define MSG_369                         3369\r\n#define MSG_370                         3370\r\n#define MSG_371                         3371\r\n#define MSG_372                         3372\r\n#define MSG_373                         3373\r\n#define MSG_374                         3374\r\n#define MSG_375                         3375\r\n#define MSG_376                         3376\r\n#define MSG_377                         3377\r\n#define MSG_378                         3378\r\n#define MSG_379                         3379\r\n#define MSG_380                         3380\r\n#define MSG_381                         3381\r\n#define MSG_382                         3382\r\n#define MSG_383                         3383\r\n#define MSG_384                         3384\r\n#define MSG_385                         3385\r\n#define MSG_386                         3386\r\n#define MSG_387                         3387\r\n#define MSG_388                         3388\r\n#define MSG_389                         3389\r\n#define MSG_390                         3390\r\n#define MSG_391                         3391\r\n#define MSG_392                         3392\r\n#define MSG_393                         3393\r\n#define MSG_394                         3394\r\n#define MSG_395                         3395\r\n#define MSG_396                         3396\r\n#define MSG_397                         3397\r\n#define MSG_398                         3398\r\n#define MSG_399                         3399\r\n#define MSG_MAX                         3400\r\n\r\n// Next default values for new objects\r\n//\r\n#ifdef APSTUDIO_INVOKED\r\n#ifndef APSTUDIO_READONLY_SYMBOLS\r\n#define _APS_NO_MFC                     1\r\n#define _APS_NEXT_RESOURCE_VALUE        505\r\n#define _APS_NEXT_COMMAND_VALUE         40001\r\n#define _APS_NEXT_CONTROL_VALUE         1114\r\n#define _APS_NEXT_SYMED_VALUE           4000\r\n#endif\r\n#endif\r\n"
  },
  {
    "path": "src/rufus.c",
    "content": "﻿/*\n * Rufus: The Reliable USB Formatting Utility\n * Copyright © 2011-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <windowsx.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <math.h>\n#include <time.h>\n#include <winioctl.h>\n#include <shlobj.h>\n#include <process.h>\n#include <dwmapi.h>\n#include <dbt.h>\n#include <io.h>\n#include <getopt.h>\n#include <assert.h>\n#include <delayimp.h>\n\n#include \"rufus.h\"\n#include \"format.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n\n#include \"ui.h\"\n#include \"vhd.h\"\n#include \"wue.h\"\n#include \"drive.h\"\n#include \"cregex.h\"\n#include \"settings.h\"\n#include \"darkmode.h\"\n#include \"bled/bled.h\"\n#include \"cdio/logging.h\"\n#include \"../res/grub/grub_version.h\"\n#include \"../res/grub2/grub2_version.h\"\n\nenum bootcheck_return {\n\tBOOTCHECK_PROCEED = 0,\n\tBOOTCHECK_CANCEL = -1,\n\tBOOTCHECK_DOWNLOAD_ERROR = -2,\n\tBOOTCHECK_GENERAL_ERROR = -3,\n};\n\nstatic const char* cmdline_hogger = \".\\\\rufus.com\";\nstatic const char* ep_reg = \"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Policies\\\\Explorer\";\nstatic const char* vs_reg = \"Software\\\\Microsoft\\\\VisualStudio\";\nstatic const char* arch_name[ARCH_MAX] = {\n\t\"unknown\", \"x86_32\", \"x86_64\", \"ARM\", \"ARM64\", \"IA64\", \"RISC-V 64\", \"LoongArch 64\", \"EBC\" };\nstatic BOOL existing_key = FALSE;\t// For LGP set/restore\nstatic BOOL size_check = TRUE;\nstatic BOOL log_displayed = FALSE;\nstatic BOOL img_provided = FALSE;\nstatic BOOL user_notified = FALSE;\nstatic BOOL relaunch = FALSE;\nstatic BOOL dont_display_image_name = FALSE;\nstatic BOOL dont_process_dbt_devnodes = FALSE;\nstatic BOOL user_changed_label = FALSE;\nstatic BOOL user_deleted_rufus_dir = FALSE;\nstatic BOOL app_changed_label = FALSE;\nstatic BOOL allowed_filesystem[FS_MAX] = { 0 };\nstatic int64_t last_iso_blocking_status;\nstatic int selected_pt = -1, selected_fs = FS_UNKNOWN, preselected_fs = FS_UNKNOWN;\nstatic int image_index = 0, select_index = 0;\nstatic RECT relaunch_rc = { -65536, -65536, 0, 0};\nstatic HWND hSelectImage = NULL, hStart = NULL;\nstatic char szTimer[12] = \"00:00:00\";\nstatic unsigned int timer;\nstatic char uppercase_select[2][64], uppercase_start[64], uppercase_close[64], uppercase_cancel[64];\n\nextern HANDLE update_check_thread;\nextern HIMAGELIST hUpImageList, hDownImageList;\nextern BOOL enable_iso, enable_joliet, enable_rockridge, enable_extra_hashes;\nextern BOOL validate_md5sum, cpu_has_sha1_accel, cpu_has_sha256_accel, toggle_dark_mode;\nextern BYTE* fido_script;\nextern uint8_t* grub2_buf;\nextern long grub2_len;\nextern char* szStatusMessage;\nextern const char* old_c32_name[NB_OLD_C32];\nextern const char* cert_name[3];\nextern const char* FileSystemLabel[FS_MAX];\nextern const char *bootmgr_efi_name, *efi_dirname, *efi_bootname[ARCH_MAX];\n\n/*\n * Globals\n */\nOPENED_LIBRARIES_VARS;\nRUFUS_UPDATE update = { { 0,0,0 },{ 0,0 }, NULL, NULL };\nHINSTANCE hMainInstance;\nHWND hMainDialog, hMultiToolbar, hSaveToolbar, hHashToolbar, hAdvancedDeviceToolbar, hAdvancedFormatToolbar, hUpdatesDlg = NULL;\nHFONT hInfoFont = NULL, hSectionHeaderFont = NULL;\nHICON hSmallIcon, hBigIcon = NULL;\nuint8_t image_options = IMOP_WINTOGO;\nuint16_t rufus_version[3], embedded_sl_version[2];\nuint32_t dur_mins, dur_secs;\nloc_cmd* selected_locale = NULL;\nWORD selected_langid = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);\nDWORD MainThreadId;\nUSHORT NativeMachine = IMAGE_FILE_MACHINE_UNKNOWN;\nHWND hDeviceList, hPartitionScheme, hTargetSystem, hFileSystem, hClusterSize, hLabel, hBootType, hNBPasses, hLog = NULL;\nHWND hImageOption, hLogDialog = NULL, hProgress = NULL, hFidoDlg = NULL;\nHANDLE dialog_handle = NULL, format_thread = NULL;\nBOOL is_x86_64, use_own_c32[NB_OLD_C32] = { FALSE, FALSE }, mbr_selected_by_user = FALSE, lock_drive = TRUE;\nBOOL op_in_progress = TRUE, right_to_left_mode = FALSE, has_uefi_csm = FALSE, its_a_me_mario = FALSE;\nBOOL enable_HDDs = FALSE, enable_VHDs = TRUE, enable_ntfs_compression = FALSE, no_confirmation_on_cancel = FALSE;\nBOOL advanced_mode_device, advanced_mode_format, allow_dual_uefi_bios, detect_fakes, enable_vmdk, force_large_fat32;\nBOOL usb_debug, use_fake_units, preserve_timestamps = FALSE, fast_zeroing = FALSE, app_changed_size = FALSE;\nBOOL zero_drive = FALSE, list_non_usb_removable_drives = FALSE, enable_file_indexing, large_drive = FALSE;\nBOOL write_as_image = FALSE, write_as_esp = FALSE, use_vds = FALSE, ignore_boot_marker = FALSE, save_image = FALSE;\nBOOL appstore_version = FALSE, is_vds_available = TRUE, persistent_log = FALSE, has_ffu_support = FALSE;\nBOOL expert_mode = FALSE, use_rufus_mbr = TRUE;\nfloat fScale = 1.0f;\nint dialog_showing = 0, selection_default = BT_IMAGE, persistence_unit_selection = -1, imop_win_sel = 0;\nint default_fs, fs_type, boot_type, partition_type, target_type;\nint force_update = 0, default_thread_priority = THREAD_PRIORITY_ABOVE_NORMAL;\nchar szFolderPath[MAX_PATH], app_dir[MAX_PATH], system_dir[MAX_PATH], temp_dir[MAX_PATH], sysnative_dir[MAX_PATH];\nchar app_data_dir[MAX_PATH], user_dir[MAX_PATH], cur_dir[MAX_PATH];\nchar embedded_sl_version_str[2][12] = { \"?.??\", \"?.??\" };\nchar embedded_sl_version_ext[2][32];\nchar ClusterSizeLabel[MAX_CLUSTER_SIZES][64];\nchar msgbox[1024], msgbox_title[32], *ini_file = NULL, *image_path = NULL, *short_image_path;\nchar *archive_path = NULL, image_option_txt[128], *fido_url = NULL, *save_image_type = NULL;\nchar *sbat_level_txt = NULL, *sb_active_txt = NULL, *sb_revoked_txt = NULL;\nStrArray BlockingProcessList, ImageList;\n// Number of steps for each FS for FCC_STRUCTURE_PROGRESS\nconst int nb_steps[FS_MAX] = { 5, 5, 12, 1, 10, 1, 1, 1, 1 };\nconst char* flash_type[BADLOCKS_PATTERN_TYPES] = { \"SLC\", \"MLC\", \"TLC\" };\nRUFUS_DRIVE rufus_drive[MAX_DRIVES] = { 0 };\nsbat_entry_t* sbat_entries = NULL;\nthumbprint_list_t *sb_active_certs = NULL, *sb_revoked_certs = NULL;\n\n// TODO: Remember to update copyright year in stdlg's AboutCallback() WM_INITDIALOG,\n// localization_data.sh and the .rc when the year changes!\n\n// Fill in the cluster size names\nstatic void SetClusterSizeLabels(void)\n{\n\tunsigned int i, j, msg_id;\n\tsafe_sprintf(ClusterSizeLabel[0], 64, \"%s\", lmprintf(MSG_029));\n\tfor (i=512, j=1, msg_id=MSG_026; j<MAX_CLUSTER_SIZES; i<<=1, j++) {\n\t\tif (i > 8192) {\n\t\t\ti /= 1024;\n\t\t\tmsg_id++;\n\t\t}\n\t\tsafe_sprintf(ClusterSizeLabel[j], 64, \"%d %s\", i, lmprintf(msg_id));\n\t}\n}\n\nstatic void SetAllowedFileSystems(void)\n{\n\tint i;\n\n\tmemset(allowed_filesystem, 0, sizeof(allowed_filesystem));\n\t// Nothing is allowed if we don't have a drive\n\tif (ComboBox_GetCurSel(hDeviceList) < 0)\n\t\treturn;\n\tswitch (selection_default) {\n\tcase BT_NON_BOOTABLE:\n\t\tfor (i = 0; i < FS_MAX; i++)\n\t\t\tallowed_filesystem[i] = TRUE;\n\t\tbreak;\n\tcase BT_MSDOS:\n\tcase BT_FREEDOS:\n\t\tallowed_filesystem[FS_FAT16] = TRUE;\n\t\tallowed_filesystem[FS_FAT32] = TRUE;\n\t\tbreak;\n\tcase BT_IMAGE:\n\t\tif ((image_path == NULL) || !HAS_NTFSLESS_GRUB(img_report))\n\t\t\tallowed_filesystem[FS_NTFS] = TRUE;\n\t\t// Don't allow anything besides NTFS if the image is not compatible\n\t\tif ((image_path != NULL) && !IS_FAT32_COMPAT(img_report)) {\n\t\t\t// Only disable FAT32 if we have NTFS enabled\n\t\t\tif (allowed_filesystem[FS_NTFS])\n\t\t\t\tbreak;\n\t\t\t// Else, print a warning\n\t\t\tuprintf(\"WARNING: FAT32 has been forcefully enabled, but this image may not work with FAT32.\");\n\t\t}\n\t\tif (!HAS_WINDOWS(img_report) || (target_type != TT_BIOS) || allow_dual_uefi_bios) {\n\t\t\tif (!HAS_WINTOGO(img_report) || (ComboBox_GetCurItemData(hImageOption) != IMOP_WIN_TO_GO)) {\n\t\t\t\tallowed_filesystem[FS_FAT16] = TRUE;\n\t\t\t\tallowed_filesystem[FS_FAT32] = TRUE;\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tcase BT_GRUB2:\n\t\tallowed_filesystem[FS_EXT2] = TRUE;\n\t\tallowed_filesystem[FS_EXT3] = TRUE;\n\t\tallowed_filesystem[FS_EXT4] = TRUE;\n\t\t// Fall through\n\tcase BT_SYSLINUX_V6:\n\tcase BT_GRUB4DOS:\n\t\tallowed_filesystem[FS_NTFS] = TRUE;\n\t\t// Fall through\n\tcase BT_SYSLINUX_V4:\n\tcase BT_REACTOS:\n\t\tallowed_filesystem[FS_FAT16] = TRUE;\n\t\tallowed_filesystem[FS_FAT32] = TRUE;\n\t\tbreak;\n\tcase BT_UEFI_NTFS:\n\t\tallowed_filesystem[FS_NTFS] = TRUE;\n\t\tallowed_filesystem[FS_EXFAT] = TRUE;\n\t\tbreak;\n\t}\n}\n\n// Populate the Boot selection dropdown\nstatic void SetBootOptions(void)\n{\n\tchar tmp[32];\n\n\tIGNORE_RETVAL(ComboBox_ResetContent(hBootType));\n\tIGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, lmprintf(MSG_279)), BT_NON_BOOTABLE));\n\tIGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType,\n\t\t(image_path == NULL) ? lmprintf(MSG_281, lmprintf(MSG_280)) : short_image_path), BT_IMAGE));\n\timage_index = 1;\n\tIGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, \"MS-DOS\"), BT_MSDOS));\n\tIGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, \"FreeDOS\"), BT_FREEDOS));\n\n\tif (advanced_mode_device) {\n\t\tstatic_sprintf(tmp, \"Syslinux %s\", embedded_sl_version_str[0]);\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, tmp), BT_SYSLINUX_V4));\n\t\tstatic_sprintf(tmp, \"Syslinux %s\", embedded_sl_version_str[1]);\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, tmp), BT_SYSLINUX_V6));\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, \"ReactOS\"), BT_REACTOS));\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType,\n\t\t\t\"Grub \" GRUB2_PACKAGE_VERSION), BT_GRUB2));\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType,\n\t\t\t\"Grub4DOS \" GRUB4DOS_VERSION), BT_GRUB4DOS));\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hBootType, ComboBox_AddStringU(hBootType, \"UEFI:NTFS\"), BT_UEFI_NTFS));\n\t}\n\tif ((!advanced_mode_device) && (selection_default >= BT_SYSLINUX_V4))\n\t\tselection_default = BT_IMAGE;\n\tSetComboEntry(hBootType, selection_default);\n}\n\nstatic void SetPartitionSchemeAndTargetSystem(BOOL only_target)\n{\n\t//                                   MBR,  GPT,  SFD\n\tBOOL allowed_partition_scheme[3] = { TRUE, TRUE, FALSE };\n\t//                                   BIOS, UEFI, DUAL\n\tBOOL allowed_target_system[3]    = { TRUE, TRUE, FALSE };\n\tBOOL is_windows_to_go_selected;\n\n\tif (!only_target)\n\t\tIGNORE_RETVAL(ComboBox_ResetContent(hPartitionScheme));\n\tIGNORE_RETVAL(ComboBox_ResetContent(hTargetSystem));\n\n\tboot_type = (int)ComboBox_GetCurItemData(hBootType);\n\tis_windows_to_go_selected = (boot_type == BT_IMAGE) && (image_path != NULL) && HAS_WINTOGO(img_report) &&\n\t\t(ComboBox_GetCurItemData(hImageOption) == IMOP_WIN_TO_GO);\n\t// If no device is selected, don't populate anything\n\tif (ComboBox_GetCurSel(hDeviceList) < 0)\n\t\treturn;\n\tswitch (boot_type) {\n\tcase BT_NON_BOOTABLE:\n\t\tallowed_partition_scheme[PARTITION_STYLE_SFD] = TRUE;\n\t\tallowed_target_system[0] = FALSE;\n\t\tallowed_target_system[1] = FALSE;\n\t\tallowed_target_system[2] = TRUE;\n\t\tbreak;\n\tcase BT_IMAGE:\n\t\tif (image_path == NULL)\n\t\t\tbreak;\n\t\t// Check if image is EFI bootable\n\t\tif (!IS_EFI_BOOTABLE(img_report)) {\n\t\t\tallowed_partition_scheme[PARTITION_STYLE_GPT] = FALSE;\n\t\t\tallowed_target_system[1] = FALSE;\n\t\t\tbreak;\n\t\t}\n\t\t// Image is EFI bootable => set dual BIOS + UEFI and so on...\n\t\tif (IS_BIOS_BOOTABLE(img_report)) {\n\t\t\tif (!HAS_WINDOWS(img_report) || allow_dual_uefi_bios || is_windows_to_go_selected) {\n\t\t\t\tallowed_target_system[0] = FALSE;\n\t\t\t\tallowed_target_system[1] = TRUE;\n\t\t\t\tallowed_target_system[2] = TRUE;\n\t\t\t}\n\t\t\t// Syslinux 4.x or earlier has no support for NTFS so if an image is using Syslinux 4.x only\n\t\t\t// and has a 4 GB file (which forces us to use NTFS) then disable MBR altogether as we won't\n\t\t\t// be able to make a working MBR install of Syslinux.\n\t\t\tif (HAS_SYSLINUX(img_report) && (SL_MAJOR(img_report.sl_version) < 5) && img_report.has_4GB_file &&\n\t\t\t\t!HAS_BOOTMGR(img_report) && !HAS_WINPE(img_report) && !HAS_GRUB(img_report))\n\t\t\t\tallowed_partition_scheme[PARTITION_STYLE_MBR] = FALSE;\n\t\t} else {\n\t\t\tallowed_target_system[0] = FALSE;\n\t\t}\n\t\tbreak;\n\tcase BT_MSDOS:\n\tcase BT_FREEDOS:\n\tcase BT_SYSLINUX_V4:\n\tcase BT_SYSLINUX_V6:\n\tcase BT_REACTOS:\n\tcase BT_GRUB4DOS:\n\tcase BT_GRUB2:\n\t\tallowed_partition_scheme[PARTITION_STYLE_GPT] = FALSE;\n\t\tallowed_target_system[1] = FALSE;\n\t\tbreak;\n\tcase BT_UEFI_NTFS:\n\t\tallowed_target_system[0] = FALSE;\n\t\tbreak;\n\t}\n\n\tif (!only_target) {\n\t\t// Override partition type selection to GPT for drives larger than 2TB\n\t\tif (SelectedDrive.DiskSize > 2 * TB)\n\t\t\tselected_pt = PARTITION_STYLE_GPT;\n\t\t// Try to reselect the current drive's partition scheme\n\t\tint preferred_pt = SelectedDrive.PartitionStyle;\n\t\tif (allowed_partition_scheme[PARTITION_STYLE_MBR]) \n\t\t\tIGNORE_RETVAL(ComboBox_SetItemData(hPartitionScheme,\n\t\t\t\tComboBox_AddStringU(hPartitionScheme, \"MBR\"), PARTITION_STYLE_MBR));\n\t\tif (allowed_partition_scheme[PARTITION_STYLE_GPT])\n\t\t\tIGNORE_RETVAL(ComboBox_SetItemData(hPartitionScheme,\n\t\t\t\tComboBox_AddStringU(hPartitionScheme, \"GPT\"), PARTITION_STYLE_GPT));\n\t\tif (allowed_partition_scheme[PARTITION_STYLE_SFD])\n\t\t\tIGNORE_RETVAL(ComboBox_SetItemData(hPartitionScheme,\n\t\t\t\tComboBox_AddStringU(hPartitionScheme, sfd_name), PARTITION_STYLE_SFD));\n\t\t// Override the partition scheme according to the current \n\t\tif (boot_type == BT_NON_BOOTABLE)\n\t\t\tpreferred_pt = (selected_pt >= 0) ? selected_pt : PARTITION_STYLE_MBR;\n\t\telse if (boot_type == BT_UEFI_NTFS)\n\t\t\tpreferred_pt = (selected_pt >= 0) ? selected_pt : PARTITION_STYLE_GPT;\n\t\telse if ((boot_type == BT_IMAGE) && (image_path != NULL) && (img_report.is_iso || img_report.is_windows_img)) {\n\t\t\tif (HAS_WINDOWS(img_report) && img_report.has_efi)\n\t\t\t\tpreferred_pt = allow_dual_uefi_bios? PARTITION_STYLE_MBR :\n\t\t\t\t\t((selected_pt >= 0) ? selected_pt : PARTITION_STYLE_GPT);\n\t\t\tif (IS_DD_BOOTABLE(img_report))\n\t\t\t\tpreferred_pt = (selected_pt >= 0) ? selected_pt : PARTITION_STYLE_MBR;\n\t\t}\n\t\tSetComboEntry(hPartitionScheme, preferred_pt);\n\t\tpartition_type = (int)ComboBox_GetCurItemData(hPartitionScheme);\n\t}\n\n\thas_uefi_csm = FALSE;\n\tif (allowed_target_system[0] && (partition_type != PARTITION_STYLE_GPT)) {\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hTargetSystem,\n\t\t\tComboBox_AddStringU(hTargetSystem, lmprintf(MSG_031)), TT_BIOS));\n\t\thas_uefi_csm = TRUE;\n\t}\n\tif (allowed_target_system[1] && !((partition_type == PARTITION_STYLE_MBR) && (boot_type == BT_IMAGE) && IS_BIOS_BOOTABLE(img_report) && IS_EFI_BOOTABLE(img_report)) )\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hTargetSystem,\n\t\t\tComboBox_AddStringU(hTargetSystem, lmprintf(MSG_032)), TT_UEFI));\n\tif (allowed_target_system[2] && ((partition_type != PARTITION_STYLE_GPT) || (boot_type == BT_NON_BOOTABLE)))\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hTargetSystem,\n\t\t\tComboBox_AddStringU(hTargetSystem, lmprintf(MSG_033)), TT_BIOS));\n\tIGNORE_RETVAL(ComboBox_SetCurSel(hTargetSystem, 0));\n\ttarget_type = (int)ComboBox_GetCurItemData(hTargetSystem);\n\t// Can't update a tooltip from a thread, so we send a message instead\n\tSendMessage(hMainDialog, UM_UPDATE_CSM_TOOLTIP, 0, 0);\n}\n\n// Populate the Allocation unit size field\nstatic BOOL SetClusterSizes(int FSType)\n{\n\tchar* szClustSize;\n\tint i, k, default_index = 0;\n\tULONG j;\n\n\tIGNORE_RETVAL(ComboBox_ResetContent(hClusterSize));\n\n\tif ((FSType < 0) || (FSType >= FS_MAX)) {\n\t\treturn FALSE;\n\t}\n\n\tif ((SelectedDrive.ClusterSize[FSType].Allowed == 0)\n\t\t|| (SelectedDrive.ClusterSize[FSType].Default == 0)) {\n\t\treturn FALSE;\n\t}\n\n\tfor (i = 0, j = 0x100, k = 0; j < 0x10000000; i++, j <<= 1) {\n\t\tif (j & SelectedDrive.ClusterSize[FSType].Allowed) {\n\t\t\tif (j == SelectedDrive.ClusterSize[FSType].Default) {\n\t\t\t\tszClustSize = lmprintf(MSG_030, ClusterSizeLabel[i]);\n\t\t\t\tdefault_index = k;\n\t\t\t} else {\n\t\t\t\tszClustSize = ClusterSizeLabel[i];\n\t\t\t}\n\t\t\tIGNORE_RETVAL(ComboBox_SetItemData(hClusterSize, ComboBox_AddStringU(hClusterSize, szClustSize), j));\n\t\t\tk++;\n\t\t}\n\t}\n\n\tIGNORE_RETVAL(ComboBox_SetCurSel(hClusterSize, default_index));\n\treturn TRUE;\n}\n\nstatic BOOL IsRefsAvailable(MEDIA_TYPE MediaType)\n{\n\t// The creation of ReFS drives was added in Windows 8.1... but then removed by\n\t// Microsoft in Windows 10 1709, except for the Enterprise and Pro Workstation\n\t// versions. Oh and VdsService::QueryFileSystemTypes() is *USELESS* to detect\n\t// if ReFS is available on the system. Oh, and it only applies to fixed media.\n\t// Oh and Microsoft removed the ability to format a volume to ReFS unless you\n\t// use VDS... Why do I even bother with this?\n\n\tif (MediaType != FixedMedia)\n\t\treturn FALSE;\n\tif (WindowsVersion.Version < WINDOWS_8_1 || WindowsVersion.BuildNumber <= 0)\n\t\treturn FALSE;\n\tif (!use_vds)\n\t\treturn FALSE;\n\t// Per https://gist.github.com/0xbadfca11/da0598e47dd643d933dc\n\tif (WindowsVersion.BuildNumber < 16226)\n\t\treturn TRUE;\n\tswitch (WindowsVersion.Edition) {\n\tcase 0x0000000A: // Enterprise Server\n\tcase 0x0000001B: // Enterprise N\n\tcase 0x00000046: // Enterprise E\n\tcase 0x00000048: // Enterprise Eval\n\tcase 0x00000054: // Enterprise N Eval\n\tcase 0x0000007D: // Enterprise S\n\tcase 0x0000007E: // Enterprise S N\n\tcase 0x00000081: // Enterprise S Eval\n\tcase 0x00000082: // Enterprise S N Eval\n\tcase 0x0000008C: // Enterprise Subscription\n\tcase 0x0000008D: // Enterprise Subscription N\n\tcase 0x000000A1: // Pro Workstation\n\tcase 0x000000A2: // Pro Workstation N\n\tcase 0x000000AB: // Enterprise G\n\tcase 0x000000AC: // Enterprise G N\n\t\treturn TRUE;\n\tdefault:\n\t\treturn FALSE;\n\t}\n}\n\n// Populate the File System and Cluster Size dropdowns\nstatic BOOL SetFileSystemAndClusterSize(char* fs_name)\n{\n\tint fs_index;\n\tLONGLONG i;\n\tchar tmp[128] = \"\", *entry;\n\n\tIGNORE_RETVAL(ComboBox_ResetContent(hFileSystem));\n\tIGNORE_RETVAL(ComboBox_ResetContent(hClusterSize));\n\tdefault_fs = FS_UNKNOWN;\n\tmemset(&SelectedDrive.ClusterSize, 0, sizeof(SelectedDrive.ClusterSize));\n\n/*\n * See https://support.microsoft.com/en-gb/help/140365/default-cluster-size-for-ntfs--fat--and-exfat\n * The following are MS's allowed cluster sizes for FAT16 and FAT32:\n *\n * FAT16\n * 31M  :  512 - 4096\n * 63M  : 1024 - 8192\n * 127M : 2048 - 16k\n * 255M : 4096 - 32k\n * 511M : 8192 - 64k\n * 1023M:  16k - 64k\n * 2047M:  32k - 64k\n * 4095M:  64k\n * 4GB+ : N/A\n *\n * FAT32\n * 31M  : N/A\n * 63M  : N/A\t\t\t(NB unlike MS, we're allowing 512-512 here)\n * 127M :  512 - 1024\n * 255M :  512 - 2048\n * 511M :  512 - 4096\n * 1023M:  512 - 8192\n * 2047M:  512 - 16k\n * 4095M: 1024 - 32k\n * 7GB  : 2048 - 64k\n * 15GB : 4096 - 64k\n * 31GB : 8192 - 64k This is as far as Microsoft's FormatEx goes...\n * 63GB :  16k - 64k ...but we can go higher using fat32format from RidgeCrop.\n * 2TB+ : N/A\n *\n */\n\n\t// FAT 16\n\tif (SelectedDrive.DiskSize < 4 * GB) {\n\t\tSelectedDrive.ClusterSize[FS_FAT16].Allowed = 0x00001E00;\n\t\tfor (i = 32; i <= 4096; i <<= 1) {\t\t\t// 8 MB -> 4 GB\n\t\t\tif (SelectedDrive.DiskSize < i * MB) {\n\t\t\t\tSelectedDrive.ClusterSize[FS_FAT16].Default = 16 * (ULONG)i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSelectedDrive.ClusterSize[FS_FAT16].Allowed <<= 1;\n\t\t}\n\t\tSelectedDrive.ClusterSize[FS_FAT16].Allowed &= 0x0001FE00;\n\t}\n\n\t// FAT 32\n\t// > 32GB FAT32 is not supported by MS and FormatEx but is achieved using fat32format\n\t// See: http://ridgecrop.co.uk/index.htm?fat32format.htm\n\t// < 32 MB FAT32 is not allowed by FormatEx, so we don't bother\n\tif ((SelectedDrive.DiskSize >= 32 * MB) && (SelectedDrive.DiskSize < MAX_FAT32_SIZE)) {\n\t\tSelectedDrive.ClusterSize[FS_FAT32].Allowed = 0x000001F8;\n\t\tfor (i = 32; i <= (32 * 1024); i <<= 1) {\t\t\t// 32 MB -> 32 GB\n\t\t\tif (SelectedDrive.DiskSize*1.0f < i * MB * FAT32_CLUSTER_THRESHOLD) {\t// MS\n\t\t\t\tSelectedDrive.ClusterSize[FS_FAT32].Default = 8*(ULONG)i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSelectedDrive.ClusterSize[FS_FAT32].Allowed <<= 1;\n\t\t}\n\t\tSelectedDrive.ClusterSize[FS_FAT32].Allowed &= 0x0001FE00;\n\n\t\t// Default cluster sizes in the 256MB to 32 GB range do not follow the rule above\n\t\tif ((SelectedDrive.DiskSize >= 256 * MB) && (SelectedDrive.DiskSize < 32 * GB)) {\n\t\t\tfor (i = 8; i <= 32; i <<= 1) {\t\t\t// 256 MB -> 32 GB\n\t\t\t\tif (SelectedDrive.DiskSize * 1.0f < i * GB * FAT32_CLUSTER_THRESHOLD) {\n\t\t\t\t\tSelectedDrive.ClusterSize[FS_FAT32].Default = ((ULONG)i / 2) * KB;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// More adjustments for large drives\n\t\tif (SelectedDrive.DiskSize >= 32 * GB) {\n\t\t\tSelectedDrive.ClusterSize[FS_FAT32].Allowed &= 0x0001C000;\n\t\t\tSelectedDrive.ClusterSize[FS_FAT32].Default = 0x00008000;\n\t\t}\n\t}\n\n\tif (SelectedDrive.DiskSize < 256 * TB) {\n\t\t// NTFS\n\t\tSelectedDrive.ClusterSize[FS_NTFS].Allowed = 0x0001F000;\n\t\tfor (i = 16; i <= 256; i <<= 1) {\t\t\t// 7 MB -> 256 TB\n\t\t\tif (SelectedDrive.DiskSize < i * TB) {\n\t\t\t\tSelectedDrive.ClusterSize[FS_NTFS].Default = ((ULONG)i / 4) * KB;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// exFAT\n\t\tSelectedDrive.ClusterSize[FS_EXFAT].Allowed = 0x03FFFE00;\n\t\tif (SelectedDrive.DiskSize < 256 * MB)\t// < 256 MB\n\t\t\tSelectedDrive.ClusterSize[FS_EXFAT].Default = 4 * KB;\n\t\telse if (SelectedDrive.DiskSize < 32 * GB)\t// < 32 GB\n\t\t\tSelectedDrive.ClusterSize[FS_EXFAT].Default = 32 * KB;\n\t\telse\n\t\t\tSelectedDrive.ClusterSize[FS_EXFAT].Default = 128 * KB;\n\n\t\t// UDF\n\t\tSelectedDrive.ClusterSize[FS_UDF].Allowed = SINGLE_CLUSTERSIZE_DEFAULT;\n\t\tSelectedDrive.ClusterSize[FS_UDF].Default = 1;\n\n\t\t// ext2/ext3/ext4\n\t\tif (advanced_mode_format && (SelectedDrive.DiskSize >= MIN_EXT_SIZE)) {\n\t\t\tSelectedDrive.ClusterSize[FS_EXT2].Allowed = SINGLE_CLUSTERSIZE_DEFAULT;\n\t\t\tSelectedDrive.ClusterSize[FS_EXT2].Default = 1;\n\t\t\tSelectedDrive.ClusterSize[FS_EXT3].Allowed = SINGLE_CLUSTERSIZE_DEFAULT;\n\t\t\tSelectedDrive.ClusterSize[FS_EXT3].Default = 1;\n\t\t}\n\n\t\t// ReFS (only applicable for a select number of Windows platforms and editions)\n\t\tif ((SelectedDrive.DiskSize >= 512 * MB) && (IsRefsAvailable(SelectedDrive.MediaType))) {\n\t\t\tif (SelectedDrive.DiskSize < 16 * TB) {\t// < 16 TB\n\t\t\t\tSelectedDrive.ClusterSize[FS_REFS].Allowed = 64 * KB + 4 * KB;\n\t\t\t\tSelectedDrive.ClusterSize[FS_REFS].Default = 4 * KB;\n\t\t\t} else {\n\t\t\t\tSelectedDrive.ClusterSize[FS_REFS].Allowed = 64 * KB;\n\t\t\t\tSelectedDrive.ClusterSize[FS_REFS].Default = 64 * KB;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Only add the filesystems we can service\n\tSetAllowedFileSystems();\n\tSetClusterSizeLabels();\n\n\tfor (fs_index = 0; fs_index < FS_MAX; fs_index++) {\n\t\t// Remove all cluster sizes that are below the sector size\n\t\tif (SelectedDrive.ClusterSize[fs_index].Allowed != SINGLE_CLUSTERSIZE_DEFAULT) {\n\t\t\tSelectedDrive.ClusterSize[fs_index].Allowed &= ~(SelectedDrive.SectorSize - 1);\n\t\t\tif ((SelectedDrive.ClusterSize[fs_index].Default & SelectedDrive.ClusterSize[fs_index].Allowed) == 0)\n\t\t\t\t// We lost our default => Use rightmost bit to select the new one\n\t\t\t\tSelectedDrive.ClusterSize[fs_index].Default =\n\t\t\t\tSelectedDrive.ClusterSize[fs_index].Allowed & (-(LONG)SelectedDrive.ClusterSize[fs_index].Allowed);\n\t\t}\n\n\t\tif (SelectedDrive.ClusterSize[fs_index].Allowed != 0) {\n\t\t\ttmp[0] = 0;\n\t\t\t// Tell the user if we're going to use Large FAT32 or regular\n\t\t\tif ((fs_index == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32)))\n\t\t\t\tstatic_strcat(tmp, \"Large \");\n\t\t\tstatic_strcat(tmp, FileSystemLabel[fs_index]);\n\t\t\tif (default_fs == FS_UNKNOWN) {\n\t\t\t\tentry = lmprintf(MSG_030, tmp);\n\t\t\t\tdefault_fs = fs_index;\n\t\t\t} else {\n\t\t\t\tentry = tmp;\n\t\t\t}\n\t\t\tif (allowed_filesystem[fs_index]) {\n\t\t\t\tIGNORE_RETVAL(ComboBox_SetItemData(hFileSystem,\n\t\t\t\t\tComboBox_AddStringU(hFileSystem, entry), fs_index));\n\t\t\t}\n\t\t}\n\t}\n\n\t// re-select existing FS if it's one we know\n\tSelectedDrive.FSType = FS_UNKNOWN;\n\tif (safe_strlen(fs_name) != 0) {\n\t\tfor (SelectedDrive.FSType = FS_MAX - 1; SelectedDrive.FSType >= 0; SelectedDrive.FSType--) {\n\t\t\tif (safe_strcmp(fs_name, FileSystemLabel[SelectedDrive.FSType]) == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Re-select last user-selected FS\n\t\tSelectedDrive.FSType = selected_fs;\n\t}\n\n\tfor (i = 0; i < ComboBox_GetCount(hFileSystem); i++) {\n\t\tif (ComboBox_GetItemData(hFileSystem, i) == SelectedDrive.FSType) {\n\t\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hFileSystem, i));\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (i == ComboBox_GetCount(hFileSystem)) {\n\t\t// failed to reselect => pick default\n\t\tSetComboEntry(hFileSystem, default_fs);\n\t}\n\n\treturn SetClusterSizes((int)ComboBox_GetCurItemData(hFileSystem));\n}\n\nstatic void SetFSFromISO(void)\n{\n\tint i, fs_tmp, preferred_fs = FS_UNKNOWN;\n\tuint32_t fs_mask = FS_NTFS | (img_report.has_4GB_file ? 0 : FS_FAT32);\n\tBOOL windows_to_go = (image_options & IMOP_WINTOGO) && (boot_type == BT_IMAGE) &&\n\t\tHAS_WINTOGO(img_report) && (ComboBox_GetCurItemData(hImageOption) == IMOP_WIN_TO_GO);\n\n\tif (image_path == NULL)\n\t\treturn;\n\n\t// Create a mask of all the FS's available\n\tfor (i = 0; i < ComboBox_GetCount(hFileSystem); i++) {\n\t\tfs_tmp = (int)ComboBox_GetItemData(hFileSystem, i);\n\t\tfs_mask |= 1 << fs_tmp;\n\t}\n\n\t// If the FS requested from the command line is valid use it\n\tif ((preselected_fs != FS_UNKNOWN) && (fs_mask & (1 << preselected_fs))) {\n\t\tpreferred_fs = preselected_fs;\n\t} else {\n\t\t// Syslinux and EFI have precedence over bootmgr (unless the user selected BIOS as target type)\n\t\tif ((HAS_SYSLINUX(img_report)) || (HAS_REACTOS(img_report)) || HAS_KOLIBRIOS(img_report) ||\n\t\t\t(IS_EFI_BOOTABLE(img_report) && (target_type == TT_UEFI) && (!windows_to_go) && (!img_report.has_4GB_file))) {\n\t\t\tif (fs_mask & (1 << FS_FAT32))\n\t\t\t\tpreferred_fs = FS_FAT32;\n\t\t\telse if ((fs_mask & (1 << FS_FAT16)) && !HAS_KOLIBRIOS(img_report))\n\t\t\t\tpreferred_fs = FS_FAT16;\n\t\t} else if ((windows_to_go) || HAS_BOOTMGR(img_report) || HAS_WINPE(img_report)) {\n\t\t\tif ((fs_mask & (1 << FS_FAT32)) && (!img_report.has_4GB_file) && (allow_dual_uefi_bios))\n\t\t\t\tpreferred_fs = FS_FAT32;\n\t\t\telse if (fs_mask & (1 << FS_NTFS))\n\t\t\t\tpreferred_fs = FS_NTFS;\n\t\t}\n\t}\n\n\t// Try to select the FS\n\tfor (i = 0; i < ComboBox_GetCount(hFileSystem); i++) {\n\t\tfs_tmp = (int)ComboBox_GetItemData(hFileSystem, i);\n\t\tif (fs_tmp == preferred_fs) {\n\t\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hFileSystem, i));\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (selected_fs == FS_UNKNOWN)\n\t\tselected_fs = preferred_fs;\n\n\tSendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE_INTERNAL << 16) | IDC_FILE_SYSTEM,\n\t\tComboBox_GetCurSel(hFileSystem));\n}\n\nstatic void SetProposedLabel(int ComboIndex)\n{\n\tconst char no_label[] = STR_NO_LABEL, empty[] = \"\";\n\n\t// If the user manually changed the label, try to preserve it\n\tif (user_changed_label)\n\t\treturn;\n\n\tapp_changed_label = TRUE;\n\t// If bootable ISO creation is selected, and we have an ISO selected with a valid name, use that\n\t// Also some distros (eg. Arch) require the USB to have the same label as the ISO\n\tif ((boot_type == BT_IMAGE) && (image_path != NULL) && (img_report.label[0] != 0)) {\n\t\tSetWindowTextU(hLabel, img_report.label);\n\t\treturn;\n\t}\n\n\t// Empty the label if no device is currently selected\n\tif (ComboIndex < 0) {\n\t\tSetWindowTextU(hLabel, \"\");\n\t\treturn;\n\t}\n\n\t// Else if no existing label is available, propose one according to the size (eg: \"256MB\", \"8GB\")\n\tif ((_stricmp(no_label, rufus_drive[ComboIndex].label) == 0) || (_stricmp(no_label, empty) == 0)\n\t\t|| (safe_stricmp(lmprintf(MSG_207), rufus_drive[ComboIndex].label) == 0)) {\n\t\tSetWindowTextU(hLabel, SelectedDrive.proposed_label);\n\t} else {\n\t\tSetWindowTextU(hLabel, rufus_drive[ComboIndex].label);\n\t}\n}\n\nstatic void EnableOldBiosFixes(BOOL enable, BOOL remove_checkboxes)\n{\n\tstatic UINT checked, state = 0;\n\tHWND hCtrl = GetDlgItem(hMainDialog, IDC_OLD_BIOS_FIXES);\n\n\t// The fix for old BIOSes option cannot apply if we aren't targetting BIOS, or are using an image that isn't BIOS bootable\n\tif ((partition_type != PARTITION_STYLE_MBR) || (target_type != TT_BIOS) || (boot_type == BT_NON_BOOTABLE) ||\n\t\t((boot_type == BT_IMAGE) && (!IS_BIOS_BOOTABLE(img_report) || IS_DD_ONLY(img_report)))) {\n\t\tenable = FALSE;\n\t}\n\n\tif (remove_checkboxes) {\n\t\tif (!enable && (state != 1)) {\n\t\t\tchecked = IsChecked(IDC_OLD_BIOS_FIXES);\n\t\t\tCheckDlgButton(hMainDialog, IDC_OLD_BIOS_FIXES, BST_UNCHECKED);\n\t\t\tstate = 1;\n\t\t} else if (enable && !IsWindowEnabled(hCtrl) && (state != 2)) {\n\t\t\tif (state != 0)\n\t\t\t\tCheckDlgButton(hMainDialog, IDC_OLD_BIOS_FIXES, checked);\n\t\t\tstate = 2;\n\t\t}\n\t}\n\tEnableWindow(hCtrl, enable);\n}\n\nstatic void EnableUefiValidation(BOOL enable, BOOL remove_checkboxes)\n{\n\tUINT checked = validate_md5sum ? BST_CHECKED : BST_UNCHECKED;\n\tHWND hCtrl = GetDlgItem(hMainDialog, IDC_UEFI_MEDIA_VALIDATION);\n\n\t// The UEFI validation bootloader cannot apply if we don't write an ISO, or if the ISO is not UEFI bootable\n\t// or if it's a Windows To Go installation or if DD or BIOS/CSM only are enforced.\n\tif ((boot_type != BT_IMAGE) || (!IS_EFI_BOOTABLE(img_report)) || IS_DD_ONLY(img_report) ||\n\t\t((image_options & IMOP_WINTOGO) && (ComboBox_GetCurItemData(hImageOption) == IMOP_WIN_TO_GO)) ||\n\t\t((target_type == TT_BIOS) && HAS_WINDOWS(img_report) && (!allow_dual_uefi_bios))) {\n\t\tenable = FALSE;\n\t}\n\n\tif (!enable && remove_checkboxes)\n\t\tCheckDlgButton(hMainDialog, IDC_UEFI_MEDIA_VALIDATION, BST_UNCHECKED);\n\telse\n\t\tCheckDlgButton(hMainDialog, IDC_UEFI_MEDIA_VALIDATION, checked);\n\tEnableWindow(hCtrl, enable);\n}\n\nstatic void EnableExtendedLabel(BOOL enable, BOOL remove_checkboxes)\n{\n\tstatic UINT checked, state = 0;\n\tHWND hCtrl = GetDlgItem(hMainDialog, IDC_EXTENDED_LABEL);\n\n\tif (IS_EXT(fs_type) || ((boot_type == BT_IMAGE) && IS_DD_ONLY(img_report)))\n\t\tenable = FALSE;\n\n\tif (remove_checkboxes) {\n\t\tif (!enable && (state != 1)) {\n\t\t\tchecked = IsChecked(IDC_EXTENDED_LABEL);\n\t\t\tCheckDlgButton(hMainDialog, IDC_EXTENDED_LABEL, BST_UNCHECKED);\n\t\t\tstate = 1;\n\t\t} else if (enable && !IsWindowEnabled(hCtrl) && (state != 2)) {\n\t\t\tif (state != 0)\n\t\t\t\tCheckDlgButton(hMainDialog, IDC_EXTENDED_LABEL, checked);\n\t\t\tstate = 2;\n\t\t}\n\t}\n\tEnableWindow(hCtrl, enable);\n}\n\nstatic void EnableQuickFormat(BOOL enable, BOOL remove_checkboxes)\n{\n\tstatic UINT checked, state = 0;\n\tHWND hCtrl = GetDlgItem(hMainDialog, IDC_QUICK_FORMAT);\n\n\tif ((boot_type == BT_IMAGE) && IS_DD_ONLY(img_report))\n\t\tenable = FALSE;\n\n\t// Disable/restore the quick format control depending on large FAT32 or ReFS\n\tif (((fs_type == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32))) || (fs_type == FS_REFS)) {\n\t\tenable = FALSE;\n\t\t// Quick Format is the only option for the above\n\t\tremove_checkboxes = FALSE;\n\t\tCheckDlgButton(hMainDialog, IDC_QUICK_FORMAT, BST_CHECKED);\n\t}\n\n\tif (remove_checkboxes) {\n\t\tif (!enable && (state != 1)) {\n\t\t\tchecked = IsChecked(IDC_QUICK_FORMAT);\n\t\t\tCheckDlgButton(hMainDialog, IDC_QUICK_FORMAT, BST_UNCHECKED);\n\t\t\tstate = 1;\n\t\t} else if (enable && !IsWindowEnabled(hCtrl) && (state != 2)) {\n\t\t\tif (state != 0)\n\t\t\t\tCheckDlgButton(hMainDialog, IDC_QUICK_FORMAT, checked);\n\t\t\tstate = 2;\n\t\t}\n\t}\n\tEnableWindow(hCtrl, enable);\n}\n\nstatic void EnableBootOptions(BOOL enable, BOOL remove_checkboxes)\n{\n\tBOOL actual_enable_bb, actual_enable = enable;\n\n\t// If no device is selected, don't enable anything and also don't remove the checkboxes\n\tif (ComboBox_GetCurSel(hDeviceList) < 0) {\n\t\tactual_enable = FALSE;\n\t\tremove_checkboxes = FALSE;\n\t}\n\t// If boot selection is set to image, but no image is currently selected, don't enable anything\n\tif ((boot_type == BT_IMAGE) && (image_path == NULL))\n\t\tactual_enable = FALSE;\n\tactual_enable_bb = actual_enable;\n\t// If we are dealing with a pure DD image, remove all options except Bad Blocks check\n\tif ((boot_type == BT_IMAGE) && IS_DD_BOOTABLE(img_report) && (!img_report.is_iso))\n\t\tactual_enable = FALSE;\n\n\tEnableWindow(hImageOption, actual_enable);\n\tEnableWindow(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SLIDER), actual_enable);\n\t// Make sure we set the range if we have persistence\n\tif ((image_path != NULL) && HAS_PERSISTENCE(img_report))\n\t\tSetPersistenceSize();\n\tEnableWindow(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), (persistence_size != 0) && actual_enable);\n\tEnableWindow(GetDlgItem(hMainDialog, IDC_PERSISTENCE_UNITS), (persistence_size != 0) && actual_enable);\n\tEnableOldBiosFixes(actual_enable, remove_checkboxes);\n\tEnableUefiValidation(actual_enable, remove_checkboxes);\n\n\tEnableWindow(GetDlgItem(hMainDialog, IDC_LABEL), actual_enable);\n\tif (boot_type == BT_IMAGE) {\n\t\tif (IS_DD_ONLY(img_report))\n\t\t\tremove_checkboxes = TRUE;\n\t\telse if (image_path == NULL)\n\t\t\tremove_checkboxes = FALSE;\n\t}\n\tEnableQuickFormat(actual_enable, remove_checkboxes);\n\tEnableExtendedLabel(actual_enable, remove_checkboxes);\n\tEnableWindow(GetDlgItem(hMainDialog, IDC_BAD_BLOCKS), actual_enable_bb);\n\tEnableWindow(GetDlgItem(hMainDialog, IDC_NB_PASSES), actual_enable_bb);\n}\n\n// Toggle controls according to operation\nvoid EnableControls(BOOL enable, BOOL remove_checkboxes)\n{\n\top_in_progress = !enable;\n\n\t// The following only get disabled on format/hash and otherwise remain enabled,\n\t// even if no device or image are selected\n\tEnableWindow(hDeviceList, enable);\n\tEnableWindow(hBootType, enable);\n\tEnableWindow(hSelectImage, enable);\n\tEnableWindow(GetDlgItem(hMainDialog, IDC_LIST_USB_HDD), enable);\n\tEnableWindow(hAdvancedDeviceToolbar, enable);\n\tEnableWindow(hAdvancedFormatToolbar, enable);\n\tSendMessage(hMultiToolbar, TB_ENABLEBUTTON, (WPARAM)IDC_LANG, (LPARAM)enable);\n\tSendMessage(hMultiToolbar, TB_ENABLEBUTTON, (WPARAM)IDC_ABOUT, (LPARAM)enable);\n\tSendMessage(hMultiToolbar, TB_ENABLEBUTTON, (WPARAM)IDC_SETTINGS, (LPARAM)enable);\n\n\t// Hash button is enabled if an image has been selected\n\tEnableWindow(hHashToolbar, enable && (boot_type == BT_IMAGE) && (image_path != NULL));\n\n\t// Toggle CLOSE/CANCEL\n\tSetDlgItemTextU(hMainDialog, IDCANCEL, enable ? uppercase_close : uppercase_cancel);\n\n\t// Only enable the following controls if a device is active\n\tenable = (ComboBox_GetCurSel(hDeviceList) < 0) ? FALSE : enable;\n\tEnableWindow(hImageOption, enable);\n\tEnableWindow(hSaveToolbar, enable);\n\n\t// Enable or disable the Start button and the other boot options\n\tenable = ((boot_type == BT_IMAGE) && (image_path == NULL)) ? FALSE : enable;\n\tEnableWindow(hStart, enable);\n\tEnableBootOptions(enable, remove_checkboxes);\n\n\t// Finally, only enable the half-size dropdowns if we aren't dealing with a pure DD image\n\tenable = ((boot_type == BT_IMAGE) && (image_path != NULL) &&\n\t\t(!(img_report.is_iso || img_report.is_windows_img))) ? FALSE : enable;\n\tEnableWindow(hPartitionScheme, enable);\n\tEnableWindow(hTargetSystem, enable);\n\tEnableWindow(GetDlgItem(hMainDialog, IDS_CSM_HELP_TXT), enable);\n\tEnableWindow(hFileSystem, enable);\n\tEnableWindow(hClusterSize, enable);\n}\n\n// Populate the UI main dropdown properties.\n// This should be called on device or boot type change.\nstatic BOOL PopulateProperties(void)\n{\n\tchar* device_tooltip;\n\tint device_index = ComboBox_GetCurSel(hDeviceList);\n\tchar fs_name[32];\n\n\tmemset(&SelectedDrive, 0, sizeof(SelectedDrive));\n\tEnableWindow(hStart, FALSE);\n\n\tif (device_index < 0)\n\t\tgoto out;\n\n\tpersistence_unit_selection = -1;\n\t// Get data from the currently selected drive\n\tSelectedDrive.DeviceNumber = (DWORD)ComboBox_GetItemData(hDeviceList, device_index);\n\t// This fills the SelectedDrive properties\n\tGetDrivePartitionData(SelectedDrive.DeviceNumber, fs_name, sizeof(fs_name), FALSE);\n\tSetPartitionSchemeAndTargetSystem(FALSE);\n\t// Attempt to reselect the last file system explicitly set by the user\n\tif (!SetFileSystemAndClusterSize((selected_fs == FS_UNKNOWN) ? fs_name : NULL)) {\n\t\tSetProposedLabel(-1);\n\t\tuprintf(\"No file system is selectable for this drive\\n\");\n\t\treturn FALSE;\n\t}\n\n\tEnableControls(TRUE, FALSE);\n\n\t// Set a proposed label according to the size (eg: \"256MB\", \"8GB\")\n\tstatic_sprintf(SelectedDrive.proposed_label, \"%s\",\n\t\tSizeToHumanReadable(SelectedDrive.DiskSize, FALSE, TRUE));\n\n\t// Add a tooltip (with the size of the device in parenthesis)\n\tdevice_tooltip = (char*) malloc(safe_strlen(rufus_drive[device_index].name) + 32);\n\tif (device_tooltip != NULL) {\n\t\tif (right_to_left_mode)\n\t\t\tsafe_sprintf(device_tooltip, safe_strlen(rufus_drive[device_index].name) + 32, \"(%s) %s\",\n\t\t\t\tSizeToHumanReadable(SelectedDrive.DiskSize, FALSE, FALSE), rufus_drive[device_index].name);\n\t\telse\n\t\t\tsafe_sprintf(device_tooltip, safe_strlen(rufus_drive[device_index].name) + 32, \"%s (%s)\",\n\t\t\t\trufus_drive[device_index].name, SizeToHumanReadable(SelectedDrive.DiskSize, FALSE, FALSE));\n\t\tCreateTooltip(hDeviceList, device_tooltip, -1);\n\t\tfree(device_tooltip);\n\t}\n\nout:\n\tSetProposedLabel(device_index);\n\treturn TRUE;\n}\n\n// Callback for the log window\nBOOL CALLBACK LogCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tstatic HFONT hf = NULL;\n\tHDC hDC;\n\tLONG lfHeight;\n\tLONG_PTR style;\n\tDWORD log_size;\n\tchar *log_buffer = NULL, *filepath;\n\tEXT_DECL(log_ext, \"rufus.log\", __VA_GROUP__(\"*.log\"), __VA_GROUP__(\"Rufus log\"));\n\tswitch (message) {\n\tcase WM_INITDIALOG:\n\t\tSetDarkModeForDlg(hDlg);\n\t\tapply_localization(IDD_LOG, hDlg);\n\t\thLog = GetDlgItem(hDlg, IDC_LOG_EDIT);\n\n\t\t// Increase the size of our log textbox to MAX_LOG_SIZE (unsigned word)\n\t\tPostMessage(hLog, EM_LIMITTEXT, MAX_LOG_SIZE , 0);\n\t\tif (hf == NULL) {\n\t\t\t// Set the font to Unicode so that we can display anything\n\t\t\thDC = GetDC(NULL);\n\t\t\tlfHeight = -MulDiv(9, GetDeviceCaps(hDC, LOGPIXELSY), 72);\n\t\t\tsafe_release_dc(NULL, hDC);\n\t\t\thf = CreateFontA(lfHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,\n\t\t\t\tDEFAULT_CHARSET, 0, 0, PROOF_QUALITY, 0, \"Consolas\");\n\t\t}\n\t\tSendDlgItemMessageA(hDlg, IDC_LOG_EDIT, WM_SETFONT, (WPARAM)hf, TRUE);\n\t\t// Set 'Close Log' as the selected button\n\t\tSendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDCANCEL), TRUE);\n\n\t\t// Suppress any inherited RTL flags from our edit control's style. Otherwise\n\t\t// the displayed text becomes a mess due to Windows trying to interpret\n\t\t// dots, parenthesis, columns and so on in an RTL context...\n\t\t// We also take this opportunity to fix the scroll bar and text alignment.\n\t\tstyle = GetWindowLongPtr(hLog, GWL_EXSTYLE);\n\t\tstyle &= ~(WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR);\n\t\tSetWindowLongPtr(hLog, GWL_EXSTYLE, style);\n\t\tstyle = GetWindowLongPtr(hLog, GWL_STYLE);\n\t\tstyle &= ~(ES_RIGHT);\n\t\tSetWindowLongPtr(hLog, GWL_STYLE, style);\n\t\tSetDarkModeForChild(hDlg);\n\t\tbreak;\n\tcase WM_NCDESTROY:\n\t\tsafe_delete_object(hf);\n\t\tbreak;\n\tcase WM_COMMAND:\n\t\tswitch (LOWORD(wParam)) {\n\t\tcase IDCANCEL:\n\t\t\tShowWindow(hDlg, SW_HIDE);\n\t\t\tlog_displayed = FALSE;\n\t\t\t// Set focus to the Cancel button on the main dialog\n\t\t\t// This avoids intempestive tooltip display from the log toolbar button\n\t\t\tSendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hMainDialog, IDCANCEL), TRUE);\n\t\t\treturn TRUE;\n\t\tcase IDC_LOG_CLEAR:\n\t\t\tSetWindowTextA(hLog, \"\");\n\t\t\treturn TRUE;\n\t\tcase IDC_LOG_SAVE:\n\t\t\tlog_size = GetWindowTextLengthU(hLog);\n\t\t\tif (log_size <= 0)\n\t\t\t\tbreak;\n\t\t\tlog_buffer = (char*)malloc(log_size);\n\t\t\tif (log_buffer != NULL) {\n\t\t\t\tlog_size = GetDlgItemTextU(hDlg, IDC_LOG_EDIT, log_buffer, log_size);\n\t\t\t\tif (log_size != 0) {\n\t\t\t\t\tlog_size--;\t// remove NUL terminator\n\t\t\t\t\tfilepath =  FileDialog(TRUE, user_dir, &log_ext, NULL);\n\t\t\t\t\tif (filepath != NULL)\n\t\t\t\t\t\tFileIO(FILE_IO_WRITE, filepath, &log_buffer, &log_size);\n\t\t\t\t\tsafe_free(filepath);\n\t\t\t\t}\n\t\t\t\tsafe_free(log_buffer);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\tcase WM_CLOSE:\n\t\tShowWindow(hDlg, SW_HIDE);\n\t\treset_localization(IDD_LOG);\n\t\tlog_displayed = FALSE;\n\t\t// Set focus to the Cancel button on the main dialog\n\t\t// This avoids intempestive tooltip display from the log toolbar button\n\t\tSendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hMainDialog, IDCANCEL), TRUE);\n\t\treturn TRUE;\n\tcase UM_RESIZE_BUTTONS:\n\t\t// Resize our buttons for low scaling factors\n\t\tResizeButtonHeight(hDlg, IDCANCEL);\n\t\tResizeButtonHeight(hDlg, IDC_LOG_SAVE);\n\t\tResizeButtonHeight(hDlg, IDC_LOG_CLEAR);\n\t\treturn TRUE;\n\t}\n\treturn FALSE;\n}\n\n// Timer in the right part of the status area\nstatic void CALLBACK ClockTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)\n{\n\ttimer++;\n\tstatic_sprintf(szTimer, \"%02d:%02d:%02d\", timer/3600, (timer%3600)/60, timer%60);\n\tSendMessageA(hStatus, SB_SETTEXTA, SBT_OWNERDRAW | SB_SECTION_RIGHT, (LPARAM)szTimer);\n}\n\n// Device Refresh Timer\nstatic void CALLBACK RefreshTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)\n{\n\t// DO NOT USE WM_DEVICECHANGE - IT MAY BE FILTERED OUT BY WINDOWS!\n\tSendMessage(hWnd, UM_MEDIA_CHANGE, 0, 0);\n}\n\n// Detect and notify about a blocking operation during ISO extraction cancellation\nstatic void CALLBACK BlockingTimer(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)\n{\n\tif (iso_blocking_status < 0) {\n\t\tKillTimer(hMainDialog, TID_BLOCKING_TIMER);\n\t\tuser_notified = FALSE;\n\t\tuprintf(\"Killed blocking I/O timer\\n\");\n\t} else if(!user_notified) {\n\t\tif (last_iso_blocking_status == iso_blocking_status) {\n\t\t\t// A write or close operation hasn't made any progress since our last check\n\t\t\tuser_notified = TRUE;\n\t\t\tuprintf(\"Blocking I/O operation detected\\n\");\n\t\t\tNotification(MB_OK | MB_ICONINFORMATION, lmprintf(MSG_048), lmprintf(MSG_080));\n\t\t} else {\n\t\t\tlast_iso_blocking_status = iso_blocking_status;\n\t\t}\n\t}\n}\n\n// Report the features of the selected ISO images\n#define PRINT_ISO_PROP(b, ...) do {if (b) uprintf(__VA_ARGS__);} while(0)\nstatic void DisplayISOProps(void)\n{\n\tstatic char inst_str[] = \" [1/#]\";\n\tint i;\n\n\tuprintf(\"ISO label: '%s'\", img_report.label);\n\tif (img_report.win_version.major != 0) {\n\t\tif (img_report.win_version.minor == 0)\n\t\t\tuprintf(\"  Detected: Windows %d ISO (Build %d.%d)\", img_report.win_version.major,\n\t\t\t\timg_report.win_version.build, img_report.win_version.revision);\n\t\telse\n\t\t\tuprintf(\"  Detected: Windows %d.%d ISO (Build %d.%d)\", img_report.win_version.major,\n\t\t\t\timg_report.win_version.minor, img_report.win_version.build, img_report.win_version.revision);\n\t}\n\n\tuprintf(\"  Size: %s (Projected)\", SizeToHumanReadable(img_report.projected_size, FALSE, FALSE));\n\tif (img_report.mismatch_size > 0) {\n\t\tuprintf(\"  ERROR: Detected that file on disk has been truncated by %s!\",\n\t\t\tSizeToHumanReadable(img_report.mismatch_size, FALSE, FALSE));\n\t\tNotification(MB_OK | MB_ICONWARNING, lmprintf(MSG_297),\n\t\t\tlmprintf(MSG_298, SizeToHumanReadable(img_report.mismatch_size, FALSE, FALSE)));\n\t} else if (img_report.mismatch_size < 0) {\n\t\t// Not an error (ISOHybrid?), but we report it just in case\n\t\tuprintf(\"  Note: File on disk is larger than reported ISO size by %s...\",\n\t\t\tSizeToHumanReadable(-img_report.mismatch_size, FALSE, FALSE));\n\t}\n\n\tPRINT_ISO_PROP(img_report.has_4GB_file, \"  Has a >4GB file\");\n\tPRINT_ISO_PROP(img_report.has_long_filename, \"  Has a >64 chars filename\");\n\tPRINT_ISO_PROP(img_report.has_deep_directories, \"  Has a Rock Ridge deep directory\");\n\tPRINT_ISO_PROP(HAS_SYSLINUX(img_report), \"  Uses: Syslinux/Isolinux v%s\", img_report.sl_version_str);\n\tif (HAS_SYSLINUX(img_report) && (SL_MAJOR(img_report.sl_version) < 5)) {\n\t\tfor (i = 0; i < NB_OLD_C32; i++) {\n\t\t\tPRINT_ISO_PROP(img_report.has_old_c32[i], \"    With an old %s\", old_c32_name[i]);\n\t\t}\n\t}\n\tPRINT_ISO_PROP(HAS_KOLIBRIOS(img_report), \"  Uses: KolibriOS\");\n\tPRINT_ISO_PROP(HAS_REACTOS(img_report), \"  Uses: ReactOS\");\n\tPRINT_ISO_PROP(img_report.has_grub4dos, \"  Uses: Grub4DOS\");\n\tPRINT_ISO_PROP(img_report.has_grub2, \"  Uses: GRUB2 (%s)\", img_report.grub2_version);\n\tif (img_report.has_efi == 0x80)\n\t\tuprintf(\"  Uses: EFI (through '%s')\", img_report.efi_img_path);\n\telse\n\t\tPRINT_ISO_PROP(img_report.has_efi, \"  Uses: EFI %s\", HAS_WIN7_EFI(img_report) ? \"(win7_x64)\" : \"\");\n\tPRINT_ISO_PROP(HAS_BOOTMGR(img_report), \"  Uses: Bootmgr (%s)\",\n\t\tHAS_BOOTMGR_BIOS(img_report) ? (HAS_BOOTMGR_EFI(img_report) ? \"BIOS and UEFI\" : \"BIOS only\") : \"UEFI only\");\n\tPRINT_ISO_PROP(HAS_WINPE(img_report), \"  Uses: WinPE %s\", (img_report.uses_minint) ? \"(with /minint)\" : \"\");\n\tif (HAS_WININST(img_report)) {\n\t\tinst_str[4] = '0' + img_report.wininst_index;\n\t\tassert(strlen(img_report.wininst_path[0]) >= 3);\n\t\tuprintf(\"  Uses: Install.%s%s (version %d.%d.%d%s)\", &img_report.wininst_path[0][strlen(img_report.wininst_path[0]) - 3],\n\t\t\t(img_report.wininst_index > 1) ? inst_str : \"\", (img_report.wininst_version >> 24) & 0xff,\n\t\t\t(img_report.wininst_version >> 16) & 0xff, (img_report.wininst_version >> 8) & 0xff,\n\t\t\t(img_report.wininst_version >= SPECIAL_WIM_VERSION) ? \"+\": \"\");\n\t}\n\tif (img_report.needs_ntfs) {\n\t\tuprintf(\"  Note: This ISO uses symbolic links and was not designed to work without them.\\r\\n\"\n\t\t\t\"  Because of this, only NTFS will be allowed as the target file system.\");\n\t} else {\n\t\tPRINT_ISO_PROP(img_report.has_symlinks,\n\t\t\t\"  Note: This ISO uses symbolic links, which may not be replicated due to file system\");\n\t\tPRINT_ISO_PROP((img_report.has_symlinks == SYMLINKS_RR),\n\t\t\t\"  limitations. Because of this, some features from this image may not work...\");\n\t\tPRINT_ISO_PROP((img_report.has_symlinks == SYMLINKS_UDF),\n\t\t\t\"  limitations. Because of this, the size required for the target media may be much\\r\\n\"\n\t\t\t\"  larger than size of the ISO...\");\n\t}\n}\n\n// Insert the image name into the Boot selection dropdown and (re)populate the Image option dropdown\nstatic void UpdateImage(BOOL update_image_option_only)\n{\n\tif_assert_fails(image_index != 0)\n\t\treturn;\n\n\tif (!update_image_option_only) {\n\t\tif (ComboBox_GetItemData(hBootType, image_index) == BT_IMAGE)\n\t\t\tComboBox_DeleteString(hBootType, image_index);\n\t\tComboBox_InsertStringU(hBootType, image_index,\n\t\t\t(image_path == NULL) ? lmprintf(MSG_281, lmprintf(MSG_280)) : short_image_path);\n\t\tComboBox_SetItemData(hBootType, image_index, BT_IMAGE);\n\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hBootType, image_index));\n\t\tboot_type = (int)ComboBox_GetCurItemData(hBootType);\n\t\tSetBootTypeDropdownWidth();\n\t}\n\n\tComboBox_ResetContent(hImageOption);\n\n\tif (!img_report.is_windows_img)\t// Straight install.wim/install.esd only have Windows To Go option\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hImageOption, ComboBox_AddStringU(hImageOption, lmprintf(MSG_117)), IMOP_WIN_STANDARD));\n\tIGNORE_RETVAL(ComboBox_SetItemData(hImageOption, ComboBox_AddStringU(hImageOption, lmprintf(MSG_118)), IMOP_WIN_TO_GO));\n\tIGNORE_RETVAL(ComboBox_SetCurSel(hImageOption, imop_win_sel));\n}\n\nenum ArchType MachineToArch(WORD machine)\n{\n\tswitch (machine) {\n\tcase IMAGE_FILE_MACHINE_I386:\n\t\treturn ARCH_X86_32;\n\tcase IMAGE_FILE_MACHINE_AMD64:\n\t\treturn ARCH_X86_64;\n\tcase IMAGE_FILE_MACHINE_ARM:\n\t\treturn ARCH_ARM_32;\n\tcase IMAGE_FILE_MACHINE_ARM64:\n\t\treturn ARCH_ARM_64;\n\tcase IMAGE_FILE_MACHINE_IA64:\n\t\treturn ARCH_IA_64;\n\tcase IMAGE_FILE_MACHINE_RISCV64:\n\t\treturn ARCH_RISCV_64;\n\tcase IMAGE_FILE_MACHINE_LOONGARCH64:\n\t\treturn ARCH_LOONGARCH_64;\n\tcase IMAGE_FILE_MACHINE_EBC:\n\t\treturn ARCH_EBC;\n\tdefault:\n\t\treturn ARCH_UNKNOWN;\n\t}\n}\n\n/// <summary>\n/// Parse a PE executable file and return its CPU architecture.\n/// </summary>\n/// <param name=\"path\">The path of the PE executable to parse.</param>\n/// <returns>An enum ArchType value (as defined in rufus.h)</returns>\nstatic uint8_t FindArch(const char* path)\n{\n\tuint8_t ret = ARCH_UNKNOWN;\n\tHANDLE hFile = NULL, hFileMapping = NULL;\n\tPIMAGE_DOS_HEADER pImageDOSHeader = NULL;\n\t// NB: The field we are after is at the same location for 32 and 64-bit\n\t// PE headers, so we don't need to care about using PIMAGE_NT_HEADERS[32|64]\n\tPIMAGE_NT_HEADERS pImageNTHeader = NULL;\n\n\thFile = CreateFileU(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);\n\tif (hFile == NULL) {\n\t\tuprintf(\"FindArch: Could not open file '%s': %s\", path, WindowsErrorString());\n\t\treturn 0;\n\t}\n\n\thFileMapping = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL);\n\tif (hFileMapping == NULL) {\n\t\tuprintf(\"FindArch: Could not create file mapping: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tpImageDOSHeader = (PIMAGE_DOS_HEADER)MapViewOfFile(hFileMapping, FILE_MAP_READ, 0, 0, 0);\n\tif (pImageDOSHeader == NULL) {\n\t\tuprintf(\"FindArch: Could not get mapped view address: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\tif (pImageDOSHeader->e_magic != IMAGE_DOS_SIGNATURE) {\n\t\tuprintf(\"FindArch: DOS header not found\");\n\t\tgoto out;\n\t}\n\tpImageNTHeader = (PIMAGE_NT_HEADERS)((uintptr_t)pImageDOSHeader + pImageDOSHeader->e_lfanew);\n\tif (pImageNTHeader->Signature != IMAGE_NT_SIGNATURE) {\n\t\tuprintf(\"FindArch: NT header not found\");\n\t\tgoto out;\n\t}\n\n\tret = MachineToArch(pImageNTHeader->FileHeader.Machine);\n\nout:\n\tif (pImageDOSHeader != NULL)\n\t\tUnmapViewOfFile(pImageDOSHeader);\n\tsafe_closehandle(hFileMapping);\n\tsafe_closehandle(hFile);\n\tassert(ret != 0 && ret < ARCH_MAX);\n\treturn ret;\n}\n\nvoid GetBootladerInfo(void)\n{\n\tstatic const char* revocation_type[] = { \"UEFI DBX\", \"Windows SSP\", \"Linux SBAT\", \"Windows SVN\", \"Cert DBX\" };\n\tint r;\n\tBOOL sb_signed;\n\tuint32_t i, len;\n\tuint8_t* buf = NULL;\n\n\t// Check UEFI bootloaders for revocation\n\tif (!IS_EFI_BOOTABLE(img_report))\n\t\treturn;\n\n\tassert(ARRAYSIZE(img_report.efi_boot_entry) > 0);\n\tPrintStatus(0, MSG_351);\n\tuprintf(\"UEFI bootloaders analysis:\");\n\tfor (i = 0; i < ARRAYSIZE(img_report.efi_boot_entry) && img_report.efi_boot_entry[i].path[0] != 0; i++) {\n\t\tlen = ReadISOFileToBuffer(image_path, img_report.efi_boot_entry[i].path, &buf);\n\t\tif (len == 0) {\n\t\t\tuprintf(\"  Warning: Failed to extract '%s' to check for UEFI Secure Boot info\", img_report.efi_boot_entry[i].path);\n\t\t\tcontinue;\n\t\t}\n\t\tsb_signed = IsSignedBySecureBootAuthority(buf, len);\n\t\tif (sb_signed)\n\t\t\timg_report.has_secureboot_bootloader |= 1;\n\t\tuprintf(\"  • %s%s\", img_report.efi_boot_entry[i].path, sb_signed ? \"*\" : \"\");\n\t\tr = IsBootloaderRevoked(buf, len);\n\t\tif (r > 0) {\n\t\t\tassert(r <= ARRAYSIZE(revocation_type));\n\t\t\tassert(r <= 7);\n\t\t\tuprintf(\"  WARNING: '%s' has been revoked by %s\", img_report.efi_boot_entry[i].path, revocation_type[r - 1]);\n\t\t\timg_report.has_secureboot_bootloader |= 1 << r;\n\t\t}\n\t\tsafe_free(buf);\n\t}\n}\n\n// The scanning process can be blocking for message processing => use a thread\nDWORD WINAPI ImageScanThread(LPVOID param)\n{\n\t// Regexp patterns used to match ISO labels for the Red Hat 8 derivatives\n\t// where we should apply an inst.stage2 ➔ inst.repo workaround for ISO\n\t// mode (per: https://github.com/rhinstaller/anaconda/pull/3529).\n\tconst char* redhat8_derivative[] = {\n\t\t\"^AlmaLinux-[8-9].*\",\t\t// AlmaLinux 8.x and 9.x\n\t\t\"^Fedora.*-3[3-9].*\",\t\t// Fedora 33-39\n\t\t\"^CentOS.*-[8-9].*\",\t\t// CentOS and CentOS Stream 8.x and 9.x\n\t\t\"^Circle.*-[8-9].*\",\t\t// Circle Linux 8.x.and 9.x\n\t\t\"^OL-[8-9].*\",\t\t\t\t// Oracle Linux 8.x and 9.x\n\t\t\"^RHEL-[8-9].*\",\t\t\t// Red Hat 8.x and 9.x\n\t\t\"^Rocky-[8-9].*\",\t\t\t// Rocky Linux 8.x and 9.x\n\t\t\"^MIRACLE-LINUX-[8-9].*\",\t// MIRACLE LINUX 8.x and 9.x\n\t};\n\t// As expected, SUSE maintainers DO NOT care about making the lives of SUSE users easier\n\t// by applying simple changes. On the other hand, boy are they caring about making their\n\t// *own* lives easier, and angrily dismissing anything that dares challenges that...\n\t// See: https://bugzilla.suse.com/show_bug.cgi?id=1243236.\n\tconst char* suse_derivative[] = {\n\t\t\"Install-SUSE\",\n\t\t\"Install-LEAP\",\n\t\t\"openSUSE-Tumbleweed\"\n\t};\n\tint i;\n\tuint8_t arch;\n\tchar tmp_path[MAX_PATH], tmp_str[64];\n\tconst char* matches[REGEX_VM_MAX_MATCHES];\n\tcregex_node_t* node = NULL;\n\tcregex_program_t* program = NULL;\n\n\t// We may mount an ISO during the lookup of the Windows version, which\n\t// produces DBT_DEVNODES_CHANGED messages that lead to unwanted device\n\t// refreshes. So make sure to ignore DBT_DEVNODES_CHANGED while scanning.\n\tdont_process_dbt_devnodes = TRUE;\n\tif (image_path == NULL)\n\t\tgoto out;\n\tPrintInfoDebug(0, MSG_202);\n\tuser_notified = FALSE;\n\tEnableControls(FALSE, FALSE);\n\tmemset(&img_report, 0, sizeof(img_report));\n\timg_report.is_iso = (BOOLEAN)ExtractISO(image_path, \"\", TRUE);\n\timg_report.is_bootable_img = IsBootableImage(image_path);\n\tif (img_report.wininst_index > 0 || img_report.is_windows_img)\n\t\tPopulateWindowsVersion();\n\tComboBox_ResetContent(hImageOption);\n\timop_win_sel = 0;\n\n\tif ((ErrorStatus == RUFUS_ERROR(ERROR_CANCELLED)) || (img_report.image_size == 0) ||\n\t\t(!img_report.is_iso && (img_report.is_bootable_img <= 0) && !img_report.is_windows_img)) {\n\t\t// Failed to scan image\n\t\tif (img_report.is_bootable_img < 0)\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_042), lmprintf(MSG_322, image_path));\n\t\telse\n\t\t\tNotification(MB_OK | MB_ICONINFORMATION, lmprintf(MSG_081), lmprintf(MSG_082));\n\t\t// Make sure to relinquish image_path before we call UpdateImage\n\t\t// otherwise the boot selection dropdown won't be properly reset.\n\t\tsafe_free(image_path);\n\t\tSendMessage(hMainDialog, UM_PROGRESS_EXIT, 0, 0);\n\t\tUpdateImage(FALSE);\n\t\tPopulateProperties();\n\t\tPrintInfoDebug(0, MSG_203);\n\t\tPrintStatus(0, MSG_203);\n\t\tEnableControls(TRUE, FALSE);\n\t\tgoto out;\n\t}\n\n\tif (img_report.is_windows_img) {\n\t\tselection_default = BT_IMAGE;\n\t\t// coverity[swapped_arguments]\n\t\tif (GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, tmp_path) != 0) {\n\t\t\t// Only look at index 1 for now. If people complain, we may look for more.\n\t\t\tif (WimExtractFile(image_path, 1, \"Windows\\\\Boot\\\\EFI\\\\bootmgr.efi\", tmp_path)) {\n\t\t\t\tarch = FindArch(tmp_path);\n\t\t\t\tif (arch != 0) {\n\t\t\t\t\tuprintf(\"  Image contains a%s %s EFI boot manager\",\n\t\t\t\t\t\t(arch == ARCH_RISCV_64) ? \"\" : \"n\", arch_name[arch]);\n\t\t\t\t\timg_report.has_efi = 1 | (1 << arch);\n\t\t\t\t\timg_report.has_bootmgr_efi = TRUE;\n\t\t\t\t\timg_report.wininst_index = 1;\n\t\t\t\t} else {\n\t\t\t\t\tuprintf(\"  Image does not contain an EFI boot manager\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tDeleteFileU(tmp_path);\n\t\t}\n\t\ttmp_str[0] = 0;\n\t\tif (img_report.win_version.major != 0) {\n\t\t\tif (img_report.win_version.minor == 0)\n\t\t\t\tstatic_sprintf(tmp_str, \" %d (Build %d.%d)\", img_report.win_version.major,\n\t\t\t\t\timg_report.win_version.build, img_report.win_version.revision);\n\t\t\telse\n\t\t\t\tstatic_sprintf(tmp_str, \" %d.%d (Build %d.%d)\", img_report.win_version.major,\n\t\t\t\t\timg_report.win_version.minor, img_report.win_version.build, img_report.win_version.revision);\n\t\t}\n\t\tuprintf(\"  Image is a %sUEFI bootable Windows%s installation image\", img_report.has_efi ? \"\" : \"NON-\", tmp_str);\n\t} else if (IS_DD_BOOTABLE(img_report)) {\n\t\tif (img_report.is_bootable_img == 2)\n\t\t\tuprintf(\"  Image is a FORCED non-bootable image\");\n\t\telse\n\t\t\tuprintf(\"  Image is a %sbootable %s image\",\n\t\t\t\t(img_report.compression_type != BLED_COMPRESSION_NONE && img_report.compression_type < BLED_COMPRESSION_MAX) ?\n\t\t\t\t\"compressed \" : \"\", img_report.is_vhd ? \"VHD\" : \"disk\");\n\t\tselection_default = BT_IMAGE;\n\t}\n\n\tif (img_report.is_iso) {\n\t\tGetBootladerInfo();\n\t\tDisplayISOProps();\n\n\t\tfor (i = 0; i < ARRAYSIZE(redhat8_derivative) && !img_report.rh8_derivative; i++) {\n\t\t\tnode = cregex_parse(redhat8_derivative[i]);\n\t\t\tif (node != NULL) {\n\t\t\t\tprogram = cregex_compile_node(node);\n\t\t\t\tcregex_parse_free(node);\n\t\t\t}\n\t\t\tif (node == NULL || program == NULL) {\n\t\t\t\tuprintf(\"Internal error: Failed to parse '%s'\", redhat8_derivative[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (cregex_program_run(program, img_report.label, matches, ARRAYSIZE(matches)) > 0)\n\t\t\t\timg_report.rh8_derivative = TRUE;\n\t\t\tcregex_compile_free(program);\n\t\t\tprogram = NULL;\n\t\t}\n\n\t\tfor (i = 0; i < ARRAYSIZE(suse_derivative); i++) {\n\t\t\tif (strncmp(img_report.label, suse_derivative[i], strlen(suse_derivative[i])) == 0) {\n\t\t\t\timg_report.disable_iso = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// If we have EFI GRUB, detect whether we have FAT, exFAT or NTFS support (with exFAT\n\t\t// or NTFS support being mandatory if we have a file that is larger than 4 GB)\n\t\tif (img_report.has_grub2 & 0x80) {\n\t\t\tif (!(img_report.has_grub2_fs & 0x7) || (img_report.has_4GB_file && !(img_report.has_grub2_fs & 0x6)))\n\t\t\t\timg_report.disable_iso = TRUE;\n\t\t}\n\n\t\t// If we have an ISOHybrid, but without an ISO method we support, disable ISO support altogether\n\t\tif (IS_DD_BOOTABLE(img_report) && (img_report.disable_iso ||\n\t\t\t\t(!IS_BIOS_BOOTABLE(img_report) && !IS_EFI_BOOTABLE(img_report)))) {\n\t\t\tNotification(MB_OK | MB_ICONINFORMATION, lmprintf(MSG_274, \"ISOHybrid\"), lmprintf(MSG_321));\n\t\t\tuprintf(\"Note: DD image mode enforced since this ISOHybrid is not ISO mode compatible.\");\n\t\t\timg_report.is_iso = FALSE;\n\t\t}\n\t\tselection_default = BT_IMAGE;\n\t}\n\tif (!IS_DD_BOOTABLE(img_report) && !IS_BIOS_BOOTABLE(img_report) && !IS_EFI_BOOTABLE(img_report)) {\n\t\t// No boot method that we support\n\t\tPrintInfo(0, MSG_081);\n\t\tsafe_free(image_path);\n\t\tNotification(MB_OK | MB_ICONINFORMATION, lmprintf(MSG_081), lmprintf(MSG_082));\n\t\tPrintStatus(0, MSG_086);\n\t\tEnableControls(TRUE, FALSE);\n\t} else {\n\t\tif (!dont_display_image_name) {\n\t\t\tfor (i = (int)safe_strlen(image_path); (i > 0) && (image_path[i] != '\\\\'); i--);\n\t\t\tif (i != 0)\n\t\t\t\ti++;\n\t\t\tshort_image_path = &image_path[i];\n\t\t\tPrintStatus(0, MSG_205, short_image_path);\n\t\t\tuprintf(\"Using image: %s (%s)\", short_image_path, SizeToHumanReadable(img_report.image_size, FALSE, FALSE));\n\t\t}\n\t\tUpdateImage(dont_display_image_name);\n\t\tToggleImageOptions();\n\t\tEnableControls(TRUE, FALSE);\n\t\t// Set Target and FS accordingly\n\t\tif (img_report.is_iso || img_report.is_windows_img) {\n\t\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hBootType, image_index));\n\t\t\tSetPartitionSchemeAndTargetSystem(FALSE);\n\t\t\tSetFileSystemAndClusterSize(NULL);\n\t\t\tSetFSFromISO();\n\t\t\tuser_changed_label = FALSE;\n\t\t\tSetProposedLabel(ComboBox_GetCurSel(hDeviceList));\n\t\t} else {\n\t\t\tSendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE_INTERNAL << 16) | IDC_FILE_SYSTEM,\n\t\t\t\tComboBox_GetCurSel(hFileSystem));\n\t\t}\n\t\t// Lose the focus on the select ISO (but place it on Close)\n\t\tSendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)FALSE, 0);\n\t\t// Lose the focus from Close and set it back to Start\n\t\tSendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)hStart, TRUE);\n\t}\n\n\t// Need to invalidate as we may have changed the UI and may get artifacts if we don't\n\t// Oh and we need to invoke BOTH RedrawWindow() and InvalidateRect() because UI refresh\n\t// in the Microsoft worlds SUCKS!!!! (we may lose the disabled \"Start\" button otherwise)\n\tRedrawWindow(hMainDialog, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW);\n\tInvalidateRect(hMainDialog, NULL, TRUE);\n\nout:\n\tdont_display_image_name = FALSE;\n\tdont_process_dbt_devnodes = FALSE;\n\tPrintInfo(0, MSG_210);\n\tExitThread(0);\n}\n\n// Likewise, boot check will block message processing => use a thread\nstatic DWORD WINAPI BootCheckThread(LPVOID param)\n{\n\tint i, r;\n\tFILE *fd;\n\tuint32_t len;\n\tWPARAM ret = BOOTCHECK_CANCEL;\n\tBOOL in_files_dir = FALSE, esp_already_asked = FALSE;\n\tBOOL is_windows_to_go = ((image_options & IMOP_WINTOGO) && (ComboBox_GetCurItemData(hImageOption) == IMOP_WIN_TO_GO));\n\tconst char* msg;\n\tconst char* grub = \"grub\";\n\tconst char* core_img = \"core.img\";\n\tconst char* ldlinux = \"ldlinux\";\n\tconst char* syslinux = \"syslinux\";\n\tconst char* ldlinux_ext[3] = { \"sys\", \"bss\", \"c32\" };\n\tchar tmp[MAX_PATH], tmp2[MAX_PATH], c;\n\tselection_dialog_options_t selection = { 0 };\n\n\tsyslinux_ldlinux_len[0] = 0; syslinux_ldlinux_len[1] = 0;\n\tsafe_free(grub2_buf);\n\n\tif (ComboBox_GetCurSel(hDeviceList) == CB_ERR)\n\t\tgoto out;\n\n\tif ((zero_drive) || (boot_type == BT_NON_BOOTABLE)) {\n\t\t// Nothing to check\n\t\tret = BOOTCHECK_PROCEED;\n\t\tgoto out;\n\t}\n\n\tif (boot_type == BT_IMAGE) {\n\t\tif_assert_fails(image_path != NULL)\n\t\t\tgoto out;\n\t\tif (IsSourceImageLocatedOnTargetDrive((DWORD)ComboBox_GetItemData(hDeviceList, ComboBox_GetCurSel(hDeviceList)))) {\n\t\t\t// You cannot use an image that is located on the target drive\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_358), lmprintf(MSG_359));\n\t\t\tgoto out;\n\t\t}\n\t\tif ((size_check) && (img_report.projected_size > (uint64_t)SelectedDrive.DiskSize)) {\n\t\t\t// This ISO image is too big for the selected target\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_088), lmprintf(MSG_089));\n\t\t\tgoto out;\n\t\t}\n\n\t\t// Display an alert if any of the UEFI bootloaders have been revoked\n\t\tif (img_report.has_secureboot_bootloader & 0xfe) {\n\t\t\tswitch (img_report.has_secureboot_bootloader & 0xfe) {\n\t\t\tcase 4:\n\t\t\t\tmsg = lmprintf(MSG_341, \"Error code: 0xc0000428\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmsg = lmprintf(MSG_340);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tr = Notification(MB_OKCANCEL | MB_ICONWARNING, lmprintf(MSG_338), lmprintf(MSG_339, msg));\n\t\t\tif (r == IDCANCEL)\n\t\t\t\tgoto out;\n\t\t}\n\n\t\tif (IS_DD_BOOTABLE(img_report)) {\n\t\t\tif (!img_report.is_iso) {\n\t\t\t\t// Pure DD images are fine at this stage\n\t\t\t\twrite_as_image = TRUE;\n\t\t\t} else if (persistence_size == 0) {\n\t\t\t\t// Ask users how they want to write ISOHybrid images,\n\t\t\t\t// but only do so if persistence has not been selected.\n\t\t\t\tchar* iso_image = lmprintf(MSG_036);\n\t\t\t\tchar* dd_image = lmprintf(MSG_095);\n\t\t\t\tStrArrayCreate(&selection.choices, 4);\n\t\t\t\t// If the ISO is small enough to be written as an ESP and we are using GPT add the ISO → ESP option\n\t\t\t\tif ((img_report.projected_size < MAX_ISO_TO_ESP_SIZE) && HAS_REGULAR_EFI(img_report) &&\n\t\t\t\t\t(partition_type == PARTITION_STYLE_GPT) && IS_FAT(fs_type)) {\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_276, iso_image), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_277, \"ISO → ESP\"), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_277, dd_image), TRUE);\n\t\t\t\t\ti = SelectionDialog(lmprintf(MSG_274, \"ISOHybrid\"), lmprintf(MSG_275, iso_image, dd_image, iso_image, dd_image), &selection);\n\t\t\t\t\tStrArrayDestroy(&selection.choices);\n\t\t\t\t\tif (i < 0)\t// Cancel\n\t\t\t\t\t\tgoto out;\n\t\t\t\t\twrite_as_esp = (i & 2);\n\t\t\t\t\twrite_as_image = (i & 4);\n\t\t\t\t\tesp_already_asked = TRUE;\n\t\t\t\t} else {\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_276, iso_image), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_277, dd_image), TRUE);\n\t\t\t\t\ti = SelectionDialog(lmprintf(MSG_274, \"ISOHybrid\"), lmprintf(MSG_275, iso_image, dd_image, iso_image, dd_image), &selection);\n\t\t\t\t\tStrArrayDestroy(&selection.choices);\n\t\t\t\t\tif (i < 0)\t// Cancel\n\t\t\t\t\t\tgoto out;\n\t\t\t\t\twrite_as_image = (i & 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (write_as_image) {\n\t\t\t\tret = BOOTCHECK_PROCEED;\n\t\t\t\tgoto out;\n\t\t}\n\n\t\tif (is_windows_to_go) {\n\t\t\tif (fs_type != FS_NTFS) {\n\t\t\t\t// Windows To Go only works for NTFS\n\t\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_092), lmprintf(MSG_097, \"Windows To Go\"));\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tif (SelectedDrive.MediaType != FixedMedia) {\n\t\t\t\tif ((target_type == TT_UEFI) && (partition_type == PARTITION_STYLE_GPT) && (WindowsVersion.BuildNumber < 15000)) {\n\t\t\t\t\t// Up to Windows 10 Creators Update (1703), we were screwed, since we need access to 2 partitions at the same time.\n\t\t\t\t\t// Thankfully, the newer Windows allow mounting multiple partitions on the same REMOVABLE drive.\n\t\t\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_190), lmprintf(MSG_198));\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If multiple versions are available, asks the user to select one before we commit to format the drive\n\t\t\tswitch(SetWinToGoIndex()) {\n\t\t\tcase -1:\n\t\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_291), lmprintf(MSG_073));\n\t\t\t\t// fall through\n\t\t\tcase -2:\n\t\t\t\tgoto out;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ((WindowsVersion.Version >= WINDOWS_8) && IS_WINDOWS_1X(img_report)) {\n\t\t\t\tint arch = _log2(img_report.has_efi >> 1);\n\t\t\t\tuint16_t map[16] = { 0 }, b = 1;\n\t\t\t\tStrArrayCreate(&selection.choices, 8);\n\t\t\t\tStrArrayCreate(&selection.tooltips, 8);\n\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_332), TRUE);\n\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_363), TRUE);\n\t\t\t\tMAP_BIT(UNATTEND_OFFLINE_INTERNAL_DRIVES);\n\t\t\t\tif (img_report.win_version.build >= 22500) {\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_330), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_361), TRUE);\n\t\t\t\t\tMAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT);\n\t\t\t\t}\n\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_333), TRUE);\n\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_364), TRUE);\n\t\t\t\tselection.username_index = _log2(b);\n\t\t\t\tMAP_BIT(UNATTEND_SET_USER);\n\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_334), TRUE);\n\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_365), TRUE);\n\t\t\t\tMAP_BIT(UNATTEND_DUPLICATE_LOCALE);\n\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_331), TRUE);\n\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_362), TRUE);\n\t\t\t\tMAP_BIT(UNATTEND_NO_DATA_COLLECTION);\n\t\t\t\tif (IS_WINDOWS_11(img_report)) {\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_324), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_370), TRUE);\n\t\t\t\t\tMAP_BIT(UNATTEND_QOL_ENHANCEMENTS);\n\t\t\t\t}\n\t\t\t\tif (expert_mode) {\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_346), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_367), TRUE);\n\t\t\t\t\tMAP_BIT(UNATTEND_FORCE_S_MODE);\n\t\t\t\t}\n\t\t\t\tselection.mask = remap16(unattend_xml_mask, map, FALSE);\n\t\t\t\tselection.style = BS_AUTOCHECKBOX;\n\t\t\t\ti = SelectionDialog(lmprintf(MSG_327), lmprintf(MSG_328), &selection);\n\t\t\t\tStrArrayDestroy(&selection.choices);\n\t\t\t\tStrArrayDestroy(&selection.tooltips);\n\t\t\t\tif (i < 0)\n\t\t\t\t\tgoto out;\n\t\t\t\t// Remap i to the correct bit positions before calling CreateUnattendXml()\n\t\t\t\ti = remap16(i, map, TRUE);\n\t\t\t\tunattend_xml_path = CreateUnattendXml(arch, i | UNATTEND_WINDOWS_TO_GO);\n\t\t\t\t// Keep the bits we didn't process\n\t\t\t\tunattend_xml_mask &= ~(remap16(0x1ff, map, TRUE));\n\t\t\t\t// And add back the bits we did process\n\t\t\t\tunattend_xml_mask |= i;\n\t\t\t\tWriteSetting32(SETTING_WUE_OPTIONS, (UNATTEND_DEFAULT_MASK << 16) | unattend_xml_mask);\n\t\t\t}\n\t\t} else if (target_type == TT_UEFI) {\n\t\t\tif (!IS_EFI_BOOTABLE(img_report)) {\n\t\t\t\t// Unsupported ISO\n\t\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_090), lmprintf(MSG_091));\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t} else if ( ((fs_type == FS_NTFS) && !HAS_WINDOWS(img_report) && !HAS_GRUB(img_report) && \n\t\t\t\t\t (!HAS_SYSLINUX(img_report) || (SL_MAJOR(img_report.sl_version) <= 5)))\n\t\t\t\t || ((IS_FAT(fs_type)) && (!HAS_SYSLINUX(img_report)) && (!allow_dual_uefi_bios) && !IS_EFI_BOOTABLE(img_report) &&\n\t\t\t\t\t (!HAS_REACTOS(img_report)) && !HAS_KOLIBRIOS(img_report) && (!HAS_GRUB(img_report)))\n\t\t\t\t || ((IS_FAT(fs_type)) && (HAS_WINDOWS(img_report) || HAS_WININST(img_report)) && (!allow_dual_uefi_bios)) ) {\n\t\t\t// Incompatible FS and ISO\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_092), lmprintf(MSG_096));\n\t\t\tgoto out;\n\t\t} else if ((fs_type == FS_FAT16) && HAS_KOLIBRIOS(img_report)) {\n\t\t\t// KolibriOS doesn't support FAT16\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_099), lmprintf(MSG_189));\n\t\t\tgoto out;\n\t\t}\n\t\tif (IS_FAT(fs_type) && img_report.has_4GB_file != 0 && img_report.has_4GB_file != 0x11){\n\t\t\t// This ISO image contains a file larger than 4GB file (FAT32)\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_099), lmprintf(MSG_100));\n\t\t\tgoto out;\n\t\t}\n\t\tif ((WindowsVersion.Version >= WINDOWS_8) && IS_WINDOWS_1X(img_report) && (!is_windows_to_go)) {\n\t\t\tif (img_report.has_panther_unattend) {\n\t\t\t\tuprintf(\"NOTICE: A '/sources/$OEM$/$$/Panther/unattend.xml' was detected on the ISO.\");\n\t\t\t\tuprintf(\"As a result, the 'Windows User Experience dialog' will not be displayed.\");\n\t\t\t} else {\n\t\t\t\tint arch = _log2(img_report.has_efi >> 1);\n\t\t\t\tuint16_t map[16] = { 0 }, b = 1;\n\t\t\t\tStrArrayCreate(&selection.choices, 16);\n\t\t\t\tStrArrayCreate(&selection.tooltips, 16);\n\t\t\t\tif (IS_WINDOWS_11(img_report)) {\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_329), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_360), TRUE);\n\t\t\t\t\tMAP_BIT(UNATTEND_SECUREBOOT_TPM_MINRAM);\n\t\t\t\t}\n\t\t\t\tif (img_report.win_version.build >= 22500) {\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_330), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_361), TRUE);\n\t\t\t\t\tMAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT);\n\t\t\t\t}\n\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_333), TRUE);\n\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_364), TRUE);\n\t\t\t\tselection.username_index = _log2(b);\n\t\t\t\tMAP_BIT(UNATTEND_SET_USER);\n\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_334), TRUE);\n\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_365), TRUE);\n\t\t\t\tselection.regional_index = _log2(b);\n\t\t\t\tMAP_BIT(UNATTEND_DUPLICATE_LOCALE);\n\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_331), TRUE);\n\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_362), TRUE);\n\t\t\t\tselection.privacy_index = _log2(b);\n\t\t\t\tMAP_BIT(UNATTEND_NO_DATA_COLLECTION);\n\t\t\t\tif (IS_WINDOWS_11(img_report)) {\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_335), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_366), TRUE);\n\t\t\t\t\tMAP_BIT(UNATTEND_DISABLE_BITLOCKER);\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_324), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_370), TRUE);\n\t\t\t\t\tMAP_BIT(UNATTEND_QOL_ENHANCEMENTS);\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_355), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_371), TRUE);\n\t\t\t\t\tselection.edition_index = _log2(b);\n\t\t\t\t\tMAP_BIT(UNATTEND_SILENT_INSTALL);\n\t\t\t\t\tif (img_report.win_version.build >= 26200) {\n\t\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_350), TRUE);\n\t\t\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_368), TRUE);\n\t\t\t\t\t\tMAP_BIT(UNATTEND_USE_MS2023_BOOTLOADERS);\n\t\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_323), TRUE);\n\t\t\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_369), TRUE);\n\t\t\t\t\t\tMAP_BIT(UNATTEND_APPLY_SKUSIPOLICY);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (expert_mode) {\n\t\t\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_346), TRUE);\n\t\t\t\t\tStrArrayAdd(&selection.tooltips, lmprintf(MSG_367), TRUE);\n\t\t\t\t\tMAP_BIT(UNATTEND_FORCE_S_MODE);\n\t\t\t\t}\n\t\t\t\tselection.mask = remap16(unattend_xml_mask, map, FALSE);\n\t\t\t\tselection.style = BS_AUTOCHECKBOX;\n\t\t\t\ti = SelectionDialog(lmprintf(MSG_327), lmprintf(MSG_328), &selection);\n\t\t\t\tStrArrayDestroy(&selection.choices);\n\t\t\t\tStrArrayDestroy(&selection.tooltips);\n\t\t\t\tif (i < 0)\n\t\t\t\t\tgoto out;\n\t\t\t\ti = remap16(i, map, TRUE);\n\t\t\t\tunattend_xml_path = CreateUnattendXml(arch, i);\n\t\t\t\t// Remember the user preferences for the current session.\n\t\t\t\tunattend_xml_mask &= ~(remap16(UNATTEND_FULL_MASK, map, TRUE));\n\t\t\t\tunattend_xml_mask |= i;\n\t\t\t\tWriteSetting32(SETTING_WUE_OPTIONS, (UNATTEND_DEFAULT_MASK << 16) | unattend_xml_mask);\n\t\t\t}\n\t\t}\n\n\t\tif ((img_report.projected_size < MAX_ISO_TO_ESP_SIZE) && HAS_REGULAR_EFI(img_report) &&\n\t\t\t(partition_type == PARTITION_STYLE_GPT) && IS_FAT(fs_type) && !esp_already_asked) {\n\t\t\t// The ISO is small enough to be written as an ESP and we are using GPT\n\t\t\t// so ask the users if they want to write it as an ESP.\n\t\t\tchar* iso_image = lmprintf(MSG_036);\n\t\t\tStrArrayCreate(&selection.choices, 2);\n\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_276, iso_image), TRUE);\n\t\t\tStrArrayAdd(&selection.choices, lmprintf(MSG_277, \"ISO → ESP\"), TRUE);\n\t\t\ti = SelectionDialog(lmprintf(MSG_274, \"ESP\"), lmprintf(MSG_310), &selection);\n\t\t\tStrArrayDestroy(&selection.choices);\n\t\t\tif (i < 0)\t// Cancel\n\t\t\t\tgoto out;\n\t\t\twrite_as_esp = (i & 2);\n\t\t}\n\n\t\t// If the selected target doesn't include BIOS, skip file downloads for GRUB/Syslinux\n\t\tif (target_type != TT_BIOS)\n\t\t\tgoto uefi_target;\n\n\t\tif ((partition_type == PARTITION_STYLE_MBR) && (img_report.has_grub2) && (img_report.grub2_version[0] != 0) &&\n\t\t\t(strcmp(img_report.grub2_version, GRUB2_PACKAGE_VERSION) != 0)) {\n\t\t\t// We may have to download a different Grub2 version if we can find one\n\t\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\t\tIGNORE_RETVAL(_mkdir(FILES_DIR));\n\t\t\tIGNORE_RETVAL(_chdir(FILES_DIR));\n\t\t\tstatic_sprintf(tmp, \"%s-%s/%s\", grub, img_report.grub2_version, core_img);\n\t\t\tfd = fopen(tmp, \"rb\");\n\t\t\tif (fd != NULL) {\n\t\t\t\t// If a file already exists in the current directory, use that one\n\t\t\t\tto_windows_path(tmp);\n\t\t\t\tuprintf(\"Will reuse '%s' from '%s\\\\%s\\\\%s-%s\\\\' for Grub 2.x installation\",\n\t\t\t\t\tcore_img, app_data_dir, FILES_DIR, grub, img_report.grub2_version);\n\t\t\t\tfseek(fd, 0, SEEK_END);\n\t\t\t\tgrub2_len = ftell(fd);\n\t\t\t\tfseek(fd, 0, SEEK_SET);\n\t\t\t\tif (grub2_len > 0)\n\t\t\t\t\tgrub2_buf = malloc(grub2_len);\n\n\t\t\t\t// grub2_buf was set to NULL at the beginning of this call\n\t\t\t\tif ((grub2_buf == NULL) || (fread(grub2_buf, 1, (size_t)grub2_len, fd) != (size_t)grub2_len)) {\n\t\t\t\t\tuprintf(\"Failed to read existing '%s' data - will use embedded version\", core_img);\n\t\t\t\t\tsafe_free(grub2_buf);\n\t\t\t\t}\n\t\t\t\tfclose(fd);\n\t\t\t} else {\n\t\t\t\tr = Notification(MB_YESNOCANCEL | MB_ICONWARNING, lmprintf(MSG_115),\n\t\t\t\t\tlmprintf(MSG_116, img_report.grub2_version, GRUB2_PACKAGE_VERSION));\n\t\t\t\tif (r == IDCANCEL)\n\t\t\t\t\tgoto out;\n\t\t\t\telse if (r == IDYES) {\n\t\t\t\t\tstatic_sprintf(tmp, \"%s-%s\", grub, img_report.grub2_version);\n\t\t\t\t\tIGNORE_RETVAL(_mkdir(tmp));\n\t\t\t\t\tIGNORE_RETVAL(_chdir(tmp));\n\t\t\t\t\t// The following loops through the grub2 version (which may have the ISO label appended)\n\t\t\t\t\t// and breaks it according to '.' or '-' until it finds a match on the server.\n\t\t\t\t\tfor (i = (int)strlen(img_report.grub2_version), grub2_len = 0; i > 0 && grub2_len <= 0; i--) {\n\t\t\t\t\t\tc = img_report.grub2_version[i];\n\t\t\t\t\t\tif (c != 0 && c != '.' && c != '-')\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\timg_report.grub2_version[i] = 0;\n\t\t\t\t\t\tstatic_sprintf(tmp, \"%s/%s-%s/%s\", FILES_URL, grub, img_report.grub2_version, core_img);\n\t\t\t\t\t\tgrub2_len = (long)DownloadSignedFile(tmp, core_img, hMainDialog, FALSE);\n\t\t\t\t\t\timg_report.grub2_version[i] = c;\n\t\t\t\t\t}\n\t\t\t\t\tif (grub2_len <= 0) {\n\t\t\t\t\t\tPrintInfo(0, MSG_195, \"Grub2\");\n\t\t\t\t\t\tuprintf(\"%s was not found - will use embedded version\", tmp);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tPrintInfo(0, MSG_193, tmp);\n\t\t\t\t\t\tfd = fopen(core_img, \"rb\");\n\t\t\t\t\t\tgrub2_buf = malloc(grub2_len);\n\t\t\t\t\t\tif ((fd == NULL) || (grub2_buf == NULL) || (fread(grub2_buf, 1, (size_t)grub2_len, fd) != (size_t)grub2_len)) {\n\t\t\t\t\t\t\tuprintf(\"Failed to read '%s' data - will use embedded version\", core_img);\n\t\t\t\t\t\t\tsafe_free(grub2_buf);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (fd != NULL)\n\t\t\t\t\t\t\tfclose(fd);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ((partition_type == PARTITION_STYLE_MBR) && HAS_SYSLINUX(img_report)) {\n\t\t\tif (SL_MAJOR(img_report.sl_version) < 5) {\n\t\t\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\t\t\tfor (i = 0; i < NB_OLD_C32; i++) {\n\t\t\t\t\tif (img_report.has_old_c32[i]) {\n\t\t\t\t\t\tif (!in_files_dir) {\n\t\t\t\t\t\t\tIGNORE_RETVAL(_mkdir(FILES_DIR));\n\t\t\t\t\t\t\tIGNORE_RETVAL(_chdir(FILES_DIR));\n\t\t\t\t\t\t\tin_files_dir = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstatic_sprintf(tmp, \"%s-%s/%s\", syslinux, embedded_sl_version_str[0], old_c32_name[i]);\n\t\t\t\t\t\tfd = fopen(tmp, \"rb\");\n\t\t\t\t\t\tif (fd != NULL) {\n\t\t\t\t\t\t\t// If a file already exists in the current directory, use that one\n\t\t\t\t\t\t\tuprintf(\"Will replace obsolete '%s' from ISO with the one found in '%s\\\\%s\\\\%s'\",\n\t\t\t\t\t\t\t\told_c32_name[i], app_data_dir, FILES_DIR, tmp);\n\t\t\t\t\t\t\tfclose(fd);\n\t\t\t\t\t\t\tuse_own_c32[i] = TRUE;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tPrintInfo(0, MSG_204, old_c32_name[i]);\n\t\t\t\t\t\t\tif (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_083, old_c32_name[i]),\n\t\t\t\t\t\t\t\tlmprintf(MSG_084, old_c32_name[i], old_c32_name[i])) == IDYES) {\n\t\t\t\t\t\t\t\tstatic_sprintf(tmp, \"%s-%s\", syslinux, embedded_sl_version_str[0]);\n\t\t\t\t\t\t\t\tIGNORE_RETVAL(_mkdir(tmp));\n\t\t\t\t\t\t\t\tstatic_sprintf(tmp, \"%s/%s-%s/%s\", FILES_URL, syslinux, embedded_sl_version_str[0], old_c32_name[i]);\n\t\t\t\t\t\t\t\tlen = DownloadSignedFile(tmp, &tmp[sizeof(FILES_URL)], hMainDialog, TRUE);\n\t\t\t\t\t\t\t\tif (len == 0) {\n\t\t\t\t\t\t\t\t\tuprintf(\"Could not download file - cancelling\");\n\t\t\t\t\t\t\t\t\tret = BOOTCHECK_DOWNLOAD_ERROR;\n\t\t\t\t\t\t\t\t\tgoto out;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tuse_own_c32[i] = TRUE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ((img_report.sl_version != embedded_sl_version[1]) ||\n\t\t\t\t(safe_strcmp(img_report.sl_version_ext, embedded_sl_version_ext[1]) != 0)) {\n\t\t\t\t// Unlike what was the case for v4 and earlier, Syslinux v5+ versions are INCOMPATIBLE with one another!\n\t\t\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\t\t\tIGNORE_RETVAL(_mkdir(FILES_DIR));\n\t\t\t\tIGNORE_RETVAL(_chdir(FILES_DIR));\n\t\t\t\tfor (i = 0; i < 2; i++) {\n\t\t\t\t\t// Check if we already have the relevant ldlinux_v#.##.sys & ldlinux_v#.##.bss files\n\t\t\t\t\tstatic_sprintf(tmp, \"%s-%s%s\\\\%s.%s\", syslinux, img_report.sl_version_str,\n\t\t\t\t\t\timg_report.sl_version_ext, ldlinux, ldlinux_ext[i]);\n\t\t\t\t\tfd = fopen(tmp, \"rb\");\n\t\t\t\t\tif (fd != NULL) {\n\t\t\t\t\t\tfseek(fd, 0, SEEK_END);\n\t\t\t\t\t\tsyslinux_ldlinux_len[i] = (DWORD)ftell(fd);\n\t\t\t\t\t\tfclose(fd);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ((syslinux_ldlinux_len[0] != 0) && (syslinux_ldlinux_len[1] != 0)) {\n\t\t\t\t\tto_windows_path(img_report.sl_version_ext);\n\t\t\t\t\tuprintf(\"Will reuse '%s.%s' and '%s.%s' from '%s\\\\%s\\\\%s-%s%s\\\\' for Syslinux installation\",\n\t\t\t\t\t\tldlinux, ldlinux_ext[0], ldlinux, ldlinux_ext[1], app_data_dir, FILES_DIR, syslinux,\n\t\t\t\t\t\timg_report.sl_version_str, img_report.sl_version_ext);\n\t\t\t\t} else {\n\t\t\t\t\tr = Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_115),\n\t\t\t\t\t\tlmprintf(MSG_114, img_report.sl_version_str, img_report.sl_version_ext,\n\t\t\t\t\t\t\tembedded_sl_version_str[1], embedded_sl_version_ext[1]));\n\t\t\t\t\tif (r != IDYES)\n\t\t\t\t\t\tgoto out;\n\t\t\t\t\tfor (i = 0; i < 2; i++) {\n\t\t\t\t\t\tstatic_sprintf(tmp, \"%s-%s\", syslinux, img_report.sl_version_str);\n\t\t\t\t\t\tIGNORE_RETVAL(_mkdir(tmp));\n\t\t\t\t\t\tif (*img_report.sl_version_ext != 0) {\n\t\t\t\t\t\t\tIGNORE_RETVAL(_chdir(tmp));\n\t\t\t\t\t\t\tIGNORE_RETVAL(_mkdir(&img_report.sl_version_ext[1]));\n\t\t\t\t\t\t\tIGNORE_RETVAL(_chdir(\"..\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstatic_sprintf(tmp, \"%s/%s-%s%s/%s.%s\", FILES_URL, syslinux, img_report.sl_version_str,\n\t\t\t\t\t\t\timg_report.sl_version_ext, ldlinux, ldlinux_ext[i]);\n\t\t\t\t\t\tsyslinux_ldlinux_len[i] = DownloadSignedFile(tmp, &tmp[sizeof(FILES_URL)],\n\t\t\t\t\t\t\thMainDialog, (*img_report.sl_version_ext == 0));\n\t\t\t\t\t\tif ((syslinux_ldlinux_len[i] == 0) && (DownloadStatus == 404) && (*img_report.sl_version_ext != 0)) {\n\t\t\t\t\t\t\t// Couldn't locate the file on the server => try to download without the version extra\n\t\t\t\t\t\t\tuprintf(\"Extended version was not found, trying main version...\");\n\t\t\t\t\t\t\tstatic_sprintf(tmp, \"%s/%s-%s/%s.%s\", FILES_URL, syslinux, img_report.sl_version_str,\n\t\t\t\t\t\t\t\tldlinux, ldlinux_ext[i]);\n\t\t\t\t\t\t\tsyslinux_ldlinux_len[i] = DownloadSignedFile(tmp, &tmp[sizeof(FILES_URL)],\n\t\t\t\t\t\t\t\thMainDialog, (*img_report.sl_version_ext == 0));\n\t\t\t\t\t\t\tif (syslinux_ldlinux_len[i] != 0) {\n\t\t\t\t\t\t\t\t// Duplicate the file so that the user won't be prompted to download again\n\t\t\t\t\t\t\t\tstatic_sprintf(tmp, \"%s-%s\\\\%s.%s\", syslinux, img_report.sl_version_str, ldlinux, ldlinux_ext[i]);\n\t\t\t\t\t\t\t\tstatic_sprintf(tmp2, \"%s-%s\\\\%s\\\\%s.%s\", syslinux, img_report.sl_version_str,\n\t\t\t\t\t\t\t\t\t&img_report.sl_version_ext[1], ldlinux, ldlinux_ext[i]);\n\t\t\t\t\t\t\t\tCopyFileA(tmp, tmp2, FALSE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (syslinux_ldlinux_len[i] == 0) {\n\t\t\t\t\t\t\t// If the version matches our embedded one, try to use that as a last ditch effort\n\t\t\t\t\t\t\tif (img_report.sl_version == embedded_sl_version[1]) {\n\t\t\t\t\t\t\t\tuprintf(\"Could not download the file - will try to use embedded %s version instead\", img_report.sl_version_str);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tuprintf(\"Could not download the file - cancelling\");\n\t\t\t\t\t\t\t\tret = BOOTCHECK_DOWNLOAD_ERROR;\n\t\t\t\t\t\t\t\tgoto out;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (boot_type == BT_SYSLINUX_V6) {\n\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\tIGNORE_RETVAL(_mkdir(FILES_DIR));\n\t\tIGNORE_RETVAL(_chdir(FILES_DIR));\n\t\tstatic_sprintf(tmp, \"%s-%s/%s.%s\", syslinux, embedded_sl_version_str[1], ldlinux, ldlinux_ext[2]);\n\t\tfd = fopenU(tmp, \"rb\");\n\t\tif (fd != NULL) {\n\t\t\tto_windows_path(tmp);\n\t\t\tuprintf(\"Will reuse '%s\\\\%s\\\\%s' for Syslinux installation\", app_data_dir, FILES_DIR, tmp);\n\t\t\tfclose(fd);\n\t\t} else {\n\t\t\tstatic_sprintf(tmp, \"%s.%s\", ldlinux, ldlinux_ext[2]);\n\t\t\tPrintInfo(0, MSG_206, tmp);\n\t\t\t// MSG_104: \"Syslinux v5.0 or later requires a '%s' file to be installed\"\n\t\t\tr = Notification(MB_YESNOCANCEL | MB_ICONWARNING, lmprintf(MSG_103, tmp),\n\t\t\t\tlmprintf(MSG_104, \"Syslinux v5.0\", tmp, \"Syslinux v5+\", tmp));\n\t\t\tif (r == IDCANCEL)\n\t\t\t\tgoto out;\n\t\t\tif (r == IDYES) {\n\t\t\t\tstatic_sprintf(tmp, \"%s-%s\", syslinux, embedded_sl_version_str[1]);\n\t\t\t\tIGNORE_RETVAL(_mkdir(tmp));\n\t\t\t\tstatic_sprintf(tmp, \"%s/%s-%s/%s.%s\", FILES_URL, syslinux, embedded_sl_version_str[1], ldlinux, ldlinux_ext[2]);\n\t\t\t\tif (DownloadSignedFile(tmp, &tmp[sizeof(FILES_URL)], hMainDialog, TRUE) == 0) {\n\t\t\t\t\tret = BOOTCHECK_DOWNLOAD_ERROR;\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (boot_type == BT_MSDOS) {\n\t\tif ((size_check) && (ComboBox_GetCurItemData(hClusterSize) >= 65536)) {\n\t\t\t// MS-DOS cannot boot from a drive using a 64 kilobytes Cluster size\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_111), lmprintf(MSG_110));\n\t\t\tgoto out;\n\t\t}\n\t\tstatic_sprintf(tmp, \"%s\\\\%s\\\\diskcopy.dll\", app_data_dir, FILES_DIR);\n\t\tif (_accessU(tmp, 0) != -1) {\n\t\t\tuprintf(\"Will reuse '%s' for MS-DOS installation\", tmp);\n\t\t} else {\n\t\t\tif (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_115), lmprintf(MSG_337, \"diskcopy.dll\")) != IDYES)\n\t\t\t\tgoto out;\n\t\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\t\tIGNORE_RETVAL(_mkdir(FILES_DIR));\n\t\t\tIGNORE_RETVAL(_chdir(FILES_DIR));\n\t\t\tif (DownloadToFileOrBufferEx(DISKCOPY_URL, tmp, SYMBOL_SERVER_USER_AGENT, NULL, hMainDialog, FALSE) != DISKCOPY_SIZE) {\n\t\t\t\tret = BOOTCHECK_DOWNLOAD_ERROR;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\t} else if (boot_type == BT_GRUB4DOS) {\n\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\tIGNORE_RETVAL(_mkdir(FILES_DIR));\n\t\tIGNORE_RETVAL(_chdir(FILES_DIR));\n\t\tstatic_sprintf(tmp, \"grub4dos-%s/grldr\", GRUB4DOS_VERSION);\n\t\tfd = fopenU(tmp, \"rb\");\n\t\tif (fd != NULL) {\n\t\t\tto_windows_path(tmp);\n\t\t\tuprintf(\"Will reuse '%s\\\\%s\\\\%s' for Grub4DOS installation\", app_data_dir, FILES_DIR, tmp);\n\t\t\tfclose(fd);\n\t\t} else {\n\t\t\tstatic_sprintf(tmp, \"grldr\");\n\t\t\tPrintInfo(0, MSG_206, tmp);\n\t\t\tr = Notification(MB_YESNOCANCEL | MB_ICONWARNING, lmprintf(MSG_103, tmp),\n\t\t\t\tlmprintf(MSG_104, \"Grub4DOS 0.4\", tmp, \"Grub4DOS\", tmp));\n\t\t\tif (r == IDCANCEL)\n\t\t\t\tgoto out;\n\t\t\tif (r == IDYES) {\n\t\t\t\tstatic_sprintf(tmp, \"grub4dos-%s\", GRUB4DOS_VERSION);\n\t\t\t\tIGNORE_RETVAL(_mkdir(tmp));\n\t\t\t\tstatic_sprintf(tmp, \"%s/grub4dos-%s/grldr\", FILES_URL, GRUB4DOS_VERSION);\n\t\t\t\tif (DownloadSignedFile(tmp, &tmp[sizeof(FILES_URL)], hMainDialog, TRUE) == 0) {\n\t\t\t\t\tret = BOOTCHECK_DOWNLOAD_ERROR;\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\nuefi_target:\n\tif (boot_type == BT_UEFI_NTFS) {\n\t\tfs_type = (int)ComboBox_GetCurItemData(hFileSystem);\n\t\tif (fs_type != FS_NTFS && fs_type != FS_EXFAT) {\n\t\t\tNotification(MB_OK | MB_ICONERROR, lmprintf(MSG_092), lmprintf(MSG_097, \"UEFI:NTFS\"));\n\t\t\tgoto out;\n\t\t}\n\t}\n\tret = BOOTCHECK_PROCEED;\n\nout:\n\tPostMessage(hMainDialog, UM_FORMAT_START, ret, 0);\n\tExitThread((DWORD)ret);\n}\n\nstatic __inline const char* IsAlphaOrBeta(void)\n{\n#if defined(ALPHA)\n\treturn \" (Alpha) \";\n#elif defined(BETA)\n\treturn \" (Beta) \";\n#elif defined(TEST)\n#\tdefine TEST_STR(x) \" (Test\" STRINGIFY(x) \") \"\n\treturn TEST_STR(TEST);\n#else\n\treturn \" \";\n#endif\n}\n\nstatic void InitDialog(HWND hDlg)\n{\n\tDWORD len;\n\tHDC hDC;\n\tUSHORT ProcessMachine = IMAGE_FILE_MACHINE_UNKNOWN;\n\tint i, lfHeight;\n\tchar tmp[128], *token, *buf, *ext, *msg;\n\tstatic char* resource[2] = { MAKEINTRESOURCEA(IDR_SL_LDLINUX_V4_SYS), MAKEINTRESOURCEA(IDR_SL_LDLINUX_V6_SYS) };\n\n\tPF_TYPE_DECL(WINAPI, BOOL, IsWow64Process2, (HANDLE, USHORT*, USHORT*));\n\tPF_INIT(IsWow64Process2, Kernel32);\n\n#ifdef RUFUS_TEST\n\tShowWindow(GetDlgItem(hDlg, IDC_TEST), SW_SHOW);\n#endif\n\n\thDC = GetDC(hDlg);\n\tlfHeight = -MulDiv(9, GetDeviceCaps(hDC, LOGPIXELSY), 72);\n\tsafe_release_dc(hDlg, hDC);\n\n\t// Quite a burden to carry around as parameters\n\thMainDialog = hDlg;\n\tMainThreadId = GetCurrentThreadId();\n\thDeviceList = GetDlgItem(hDlg, IDC_DEVICE);\n\thPartitionScheme = GetDlgItem(hDlg, IDC_PARTITION_TYPE);\n\thTargetSystem = GetDlgItem(hDlg, IDC_TARGET_SYSTEM);\n\thFileSystem = GetDlgItem(hDlg, IDC_FILE_SYSTEM);\n\thClusterSize = GetDlgItem(hDlg, IDC_CLUSTER_SIZE);\n\thLabel = GetDlgItem(hDlg, IDC_LABEL);\n\thProgress = GetDlgItem(hDlg, IDC_PROGRESS);\n\thBootType = GetDlgItem(hDlg, IDC_BOOT_SELECTION);\n\thImageOption = GetDlgItem(hDlg, IDC_IMAGE_OPTION);\n\thSelectImage = GetDlgItem(hDlg, IDC_SELECT);\n\thNBPasses = GetDlgItem(hDlg, IDC_NB_PASSES);\n\thStart = GetDlgItem(hDlg, IDC_START);\n\n\t// Convert the main button labels to uppercase\n\tGetWindowTextU(hStart, uppercase_start, sizeof(uppercase_start));\n\tCharUpperBuffU(uppercase_start, sizeof(uppercase_start));\n\tSetWindowTextU(hStart, uppercase_start);\n\tGetWindowTextU(GetDlgItem(hDlg, IDCANCEL), uppercase_close, sizeof(uppercase_close));\n\tCharUpperBuffU(uppercase_close, sizeof(uppercase_close));\n\t// Hardcoded exception for German\n\tif (strcmp(\"SCHLIEßEN\", uppercase_close) == 0)\n\t\tstrcpy(uppercase_close, \"SCHLIESSEN\");\n\tSetWindowTextU(GetDlgItem(hDlg, IDCANCEL), uppercase_close);\n\tGetWindowTextU(GetDlgItem(hDlg, IDC_SELECT), uppercase_select[0], sizeof(uppercase_select[0]));\n\tstatic_strcpy(uppercase_select[1], lmprintf(MSG_040));\n\tCharUpperBuffU(uppercase_select[0], sizeof(uppercase_select[0]));\n\tCharUpperBuffU(uppercase_select[1], sizeof(uppercase_select[1]));\n\tSetWindowTextU(GetDlgItem(hDlg, IDC_SELECT), uppercase_select[0]);\n\tstatic_strcpy(uppercase_cancel, lmprintf(MSG_007));\n\tCharUpperBuffU(uppercase_cancel, sizeof(uppercase_cancel));\n\n\tCreateSmallButtons(hDlg);\n\tGetBasicControlsWidth(hDlg);\n\tGetMainButtonsWidth(hDlg);\n\tGetHalfDropwdownWidth(hDlg);\n\tGetFullWidth(hDlg);\n\n\t// Set some missing labels\n\tSetAccessibleName(hNBPasses, lmprintf(MSG_316));\n\n\t// Create the font and brush for the progress messages\n\tif (hInfoFont == NULL) {\n\t\thInfoFont = CreateFontA(lfHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET,\n\t\t\t0, 0, PROOF_QUALITY, 0, \"Segoe UI\");\n\t}\n\n\t// Create the title bar icon\n\tSetTitleBarIcon(hDlg);\n\tGetWindowTextA(hDlg, tmp, sizeof(tmp));\n\t// Count on Microsoft for making it more attractive to read a\n\t// version using strtok() than using GetFileVersionInfo()\n\ttoken = strtok(tmp, \" \");\n\tfor (i = 0; (i < 3) && ((token = strtok(NULL, \".\")) != NULL); i++)\n\t\trufus_version[i] = (uint16_t)atoi(token);\n\n\t// Redefine the title to be able to add \"Alpha\" or \"Beta\"\n\tstatic_sprintf(tmp, APPLICATION_NAME \" %d.%d.%d%s%s\", rufus_version[0], rufus_version[1], rufus_version[2],\n\t\tIsAlphaOrBeta(), (ini_file != NULL)?\"(Portable)\":\"\");\n\tSetWindowTextU(hDlg, tmp);\n\t// Now that we have a title, we can find the handle of our Dialog\n\tdialog_handle = FindWindowA(NULL, tmp);\n\t// Add a timestamp in persistent log mode\n\tif (persistent_log) {\n\t\t__time64_t ltime;\n\t\tchar timestamp[32] = \"[\";\n\t\t_time64(&ltime);\n\t\tif (_ctime64_s(&timestamp[1], sizeof(timestamp) - 2, &ltime) == 0) {\n\t\t\t// Windows' _ctime64_s adds a \\n at the end - replace it\n\t\t\ttimestamp[strlen(timestamp) - 1] = ']';\n\t\t\tuprintf(timestamp);\n\t\t}\n\t}\n\tuprintf(APPLICATION_NAME \" \" APPLICATION_ARCH \" v%d.%d.%d%s%s\", rufus_version[0], rufus_version[1], rufus_version[2],\n\t\tIsAlphaOrBeta(), (ini_file != NULL)?\"(Portable)\": (appstore_version ? \"(AppStore version)\" : \"\"));\n\t// Display a notice if running x86 emulation on ARM\n\t// Oh, and https://devblogs.microsoft.com/oldnewthing/20220209-00/?p=106239 is *WRONG*:\n\t// Get­Native­System­Info() will not tell you what the native system architecture is when\n\t// running x86 code on ARM64. Instead you have to use IsWow64Process2(), which is only\n\t// available on Windows 10 1709 or later...\n\tif ((pfIsWow64Process2 != NULL) && pfIsWow64Process2(GetCurrentProcess(), &ProcessMachine, &NativeMachine)) {\n\t\t// x64 running emulated on ARM64 returns IMAGE_FILE_MACHINE_UNKNOWN for ProcessMachine\n\t\t// because Microsoft does not consider it a WOW64 process. So we need to fix\n\t\t// ProcessMachine ourselves to *ACTUALLY* return the bloody process machine...\n\t\tif (ProcessMachine == IMAGE_FILE_MACHINE_UNKNOWN)\n\t\t\tProcessMachine = GetApplicationArch();\n\t\tif ((NativeMachine == IMAGE_FILE_MACHINE_ARM || NativeMachine == IMAGE_FILE_MACHINE_ARM64) &&\n\t\t\t(ProcessMachine == IMAGE_FILE_MACHINE_I386 || ProcessMachine == IMAGE_FILE_MACHINE_AMD64))\n\t\t\tuprintf(\"Notice: Running emulated on %s platform\", GetArchName(NativeMachine));\n\t}\n\tfor (i = 0; i < ARRAYSIZE(resource); i++) {\n\t\tlen = 0;\n\t\tbuf = (char*)GetResource(hMainInstance, resource[i], _RT_RCDATA, \"ldlinux_sys\", &len, TRUE);\n\t\tif (buf == NULL) {\n\t\t\tuprintf(\"WARNING: could not read embedded Syslinux v%d version\", i + 4);\n\t\t} else {\n\t\t\tembedded_sl_version[i] = GetSyslinuxVersion(buf, len, &ext);\n\t\t\tstatic_sprintf(embedded_sl_version_str[i], \"%d.%02d\", SL_MAJOR(embedded_sl_version[i]), SL_MINOR(embedded_sl_version[i]));\n\t\t\tstatic_strcpy(embedded_sl_version_ext[i], ext);\n\t\t\tfree(buf);\n\t\t}\n\t}\n\tuprintf(\"Windows version: %s\", WindowsVersion.VersionStr);\n\tuprintf(\"Syslinux versions: %s%s, %s%s\", embedded_sl_version_str[0], embedded_sl_version_ext[0],\n\t\tembedded_sl_version_str[1], embedded_sl_version_ext[1]);\n\tuprintf(\"Grub versions: %s, %s\", GRUB4DOS_VERSION, GRUB2_PACKAGE_VERSION);\n\tuprintf(\"System locale ID: 0x%04X (%s)\", GetUserDefaultUILanguage(), ToLocaleName(GetUserDefaultUILanguage()));\n\tubflush();\n\tif (selected_locale->ctrl_id & LOC_NEEDS_UPDATE) {\n\t\tuprintf(\"NOTE: The %s translation requires an update, but the current translator hasn't submitted \"\n\t\t\t\"one. Because of this, some messages will only be displayed in English.\", selected_locale->txt[1]);\n\t\tuprintf(\"If you think you can help update this translation, please e-mail the author of this application\");\n\t}\n\t// Detect and report system limitations\n\tif (ReadRegistryKeyBool(HKEY_LOCAL_MACHINE, \"SYSTEM\\\\CurrentControlSet\\\\Policies\\\\Microsoft\\\\FVE\"))\n\t\tuprintf(\"WARNING: This system has a policy set to prevent write access to FIXED drives not using BitLocker\");\n\tif (ReadRegistryKeyBool(HKEY_LOCAL_MACHINE, \"SYSTEM\\\\CurrentControlSet\\\\Control\\\\StorageDevicePolicies\\\\WriteProtect\"))\n\t\tuprintf(\"WARNING: This system has a policy set to prevent write access to storage devices\");\n\tif (!is_vds_available)\n\t\tuprintf(\"Notice: Windows VDS is unavailable\");\n\n\tCreateTaskbarList();\n\tSetTaskbarProgressState(TASKBAR_NORMAL);\n\n\t// Use maximum granularity for the progress bar\n\tSendMessage(hProgress, PBM_SETRANGE, 0, (MAX_PROGRESS<<16) & 0xFFFF0000);\n\n\t// Fill up the passes\n\tfor (i = 1; i <= 5; i++) {\n\t\tmsg = (i == 1) ? lmprintf(MSG_034, 1) : lmprintf(MSG_035, (i == 2) ? 2 : 4, (i == 2) ? \"\" : lmprintf(MSG_087, flash_type[i - 3]));\n\t\tIGNORE_RETVAL(ComboBox_AddStringU(hNBPasses, msg));\n\t}\n\tIGNORE_RETVAL(ComboBox_SetCurSel(hNBPasses, 0));\n\tSetPassesTooltip();\n\n\t// Fill up the boot options dropdown\n\tSetBootOptions();\n\n\t// Create the string arrays\n\tStrArrayCreate(&BlockingProcessList, 16);\n\tStrArrayCreate(&ImageList, 16);\n\tStrArrayCreate(&modified_files, 8);\n\t// Set various checkboxes\n\tCheckDlgButton(hDlg, IDC_QUICK_FORMAT, BST_CHECKED);\n\tCheckDlgButton(hDlg, IDC_EXTENDED_LABEL, BST_CHECKED);\n\n\tCreateAdditionalControls(hDlg);\n\tSetSectionHeaders(hDlg, &hSectionHeaderFont);\n\tPositionMainControls(hDlg);\n\tAdjustForLowDPI(hDlg);\n\t// Because we created the log dialog before we computed our sizes, we need to send a custom message\n\tSendMessage(hLogDialog, UM_RESIZE_BUTTONS, 0, 0);\n\t// Limit the amount of characters for the Persistence size field\n\tSendMessage(GetDlgItem(hDlg, IDC_PERSISTENCE_SIZE), EM_LIMITTEXT, 7, 0);\n\t// Create the status line and initialize the taskbar icon for progress overlay\n\tCreateStatusBar(&hInfoFont);\n\n\t// Set the various tooltips\n\tCreateTooltip(hFileSystem, lmprintf(MSG_157), -1);\n\tCreateTooltip(hClusterSize, lmprintf(MSG_158), -1);\n\tCreateTooltip(hLabel, lmprintf(MSG_159), -1);\n\tCreateTooltip(hAdvancedDeviceToolbar, lmprintf(MSG_160), -1);\n\tCreateTooltip(hAdvancedFormatToolbar, lmprintf(MSG_160), -1);\n\tCreateTooltip(GetDlgItem(hDlg, IDC_BAD_BLOCKS), lmprintf(MSG_161), -1);\n\tCreateTooltip(GetDlgItem(hDlg, IDC_QUICK_FORMAT), lmprintf(MSG_162), -1);\n\tCreateTooltip(hBootType, lmprintf(MSG_164), -1);\n\tCreateTooltip(hSelectImage, lmprintf(MSG_165), -1);\n\tCreateTooltip(GetDlgItem(hDlg, IDC_EXTENDED_LABEL), lmprintf(MSG_166), 10000);\n\tCreateTooltip(GetDlgItem(hDlg, IDC_UEFI_MEDIA_VALIDATION), lmprintf(MSG_167), 10000);\n\tCreateTooltip(GetDlgItem(hDlg, IDC_OLD_BIOS_FIXES), lmprintf(MSG_169), -1);\n\tCreateTooltip(GetDlgItem(hDlg, IDC_LIST_USB_HDD), lmprintf(MSG_170), -1);\n\tCreateTooltip(hStart, lmprintf(MSG_171), -1);\n\tCreateTooltip(hPartitionScheme, lmprintf(MSG_163), -1);\n\tCreateTooltip(hTargetSystem, lmprintf(MSG_150), 30000);\n\tCreateTooltip(GetDlgItem(hDlg, IDS_CSM_HELP_TXT), lmprintf(MSG_151), 30000);\n\tCreateTooltip(hImageOption, lmprintf(MSG_305), 30000);\n\tCreateTooltip(GetDlgItem(hDlg, IDC_PERSISTENCE_SLIDER), lmprintf(MSG_125), 30000);\n\tCreateTooltip(GetDlgItem(hDlg, IDC_PERSISTENCE_SIZE), lmprintf(MSG_125), 30000);\n\tCreateTooltip(GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS), lmprintf(MSG_126), 30000);\n\n\tif (!advanced_mode_device)\t// Hide as needed, since we display the advanced controls by default\n\t\tToggleAdvancedDeviceOptions(FALSE);\n\tif (!advanced_mode_format)\n\t\tToggleAdvancedFormatOptions(FALSE);\n\tToggleImageOptions();\n\n\t// Process commandline parameters\n\tif (img_provided) {\n\t\t// Simulate a button click for image selection\n\t\tPostMessage(hDlg, WM_COMMAND, IDC_SELECT, 0);\n\t}\n\tSetBootTypeDropdownWidth();\n\n\tCheckDlgButton(hMainDialog, IDC_LIST_USB_HDD, enable_HDDs ? BST_CHECKED : BST_UNCHECKED);\n\n\tPrintInfo(0, MSG_210);\n}\n\nstatic void PrintStatusTimeout(const char* str, BOOL val)\n{\n\tPrintStatus(STATUS_MSG_TIMEOUT, (val)?MSG_250:MSG_251, str);\n}\n\n/*\n * Main dialog callback\n */\nstatic INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tstatic DWORD DeviceNum = 0;\n\tstatic uint64_t LastRefresh = 0;\n\tstatic BOOL first_log_display = TRUE, isMarquee = FALSE, queued_hotplug_event = FALSE;\n\tstatic ULONG ulRegister = 0;\n\tstatic LPITEMIDLIST pidlDesktop = NULL;\n\tstatic SHChangeNotifyEntry NotifyEntry;\n\tstatic DWORD_PTR thread_affinity[HASH_MAX + 1];\n\tstatic HFONT hHyperlinkFont = NULL;\n\tstatic wchar_t wtooltip[128];\n\tLONG lPos;\n\tBOOL set_selected_fs;\n\tDRAWITEMSTRUCT* pDI;\n\tLPTOOLTIPTEXT lpttt;\n\tNMBCDROPDOWN* pDropDown;\n\tHDROP droppedFileInfo;\n\tHMENU hMenu;\n\tPOINT Point;\n\tRECT rc, DialogRect, DesktopRect;\n\tHDC hDC;\n\tPAINTSTRUCT ps;\n\tDWORD log_size;\n\tint nDeviceIndex, i, nWidth, nHeight, nb_devices, selected_language, offset, tb_state, tb_flags;\n\tchar tmp[MAX_PATH], *log_buffer = NULL;\n\twchar_t* wbuffer = NULL;\n\tloc_cmd* lcmd = NULL;\n\n\tswitch (message) {\n\n\tcase WM_COMMAND:\n#ifdef RUFUS_TEST\n\t\tif (LOWORD(wParam) == IDC_TEST) {\n\t\t\tbreak;\n\t\t}\n#endif\n\n\t\tif ((LOWORD(wParam) >= UM_LANGUAGE_MENU) && (LOWORD(wParam) < UM_LANGUAGE_MENU_MAX)) {\n\t\t\tselected_language = LOWORD(wParam) - UM_LANGUAGE_MENU;\n\t\t\ti = 0;\n\t\t\tlist_for_each_entry(lcmd, &locale_list, loc_cmd, list) {\n\t\t\t\tif (i++ == selected_language) {\n\t\t\t\t\tif (selected_locale != lcmd) {\n\t\t\t\t\t\tselected_locale = lcmd;\n\t\t\t\t\t\tselected_langid = get_language_id(lcmd);\n\t\t\t\t\t\t// Avoid the FS being reset on language change\n\t\t\t\t\t\tselected_fs = (int)ComboBox_GetCurItemData(hFileSystem);\n\t\t\t\t\t\trelaunch = TRUE;\n\t\t\t\t\t\tPostMessage(hDlg, WM_COMMAND, IDCANCEL, 0);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tswitch(LOWORD(wParam)) {\n\t\tcase IDOK:\t\t\t// close application\n\t\tcase IDCANCEL:\n\t\t\tEnableWindow(GetDlgItem(hDlg, IDCANCEL), FALSE);\n\t\t\tif (format_thread != NULL) {\n\t\t\t\tif ((no_confirmation_on_cancel) || (Notification(MB_YESNO | MB_ICONWARNING,\n\t\t\t\t\tlmprintf(MSG_049), lmprintf(MSG_105)) == IDYES)) {\n\t\t\t\t\t// Operation may have completed in the meantime\n\t\t\t\t\tif (format_thread != NULL) {\n\t\t\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_CANCELLED);\n\t\t\t\t\t\tPrintInfo(0, MSG_201);\n\t\t\t\t\t\tuprintf(\"Cancelling\");\n\t\t\t\t\t\t//  Start a timer to detect blocking operations during ISO file extraction\n\t\t\t\t\t\tif (iso_blocking_status >= 0) {\n\t\t\t\t\t\t\tlast_iso_blocking_status = iso_blocking_status;\n\t\t\t\t\t\t\tSetTimer(hMainDialog, TID_BLOCKING_TIMER, 3000, BlockingTimer);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tEnableWindow(GetDlgItem(hDlg, IDCANCEL), TRUE);\n\t\t\t\t}\n\t\t\t\tno_confirmation_on_cancel = FALSE;\n\t\t\t\treturn (INT_PTR)TRUE;\n\t\t\t} else if (op_in_progress) {\n\t\t\t\t// User might be trying to cancel during preliminary checks\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_CANCELLED);\n\t\t\t\tPrintInfo(0, MSG_201);\n\t\t\t\tEnableWindow(GetDlgItem(hDlg, IDCANCEL), TRUE);\n\t\t\t\treturn (INT_PTR)TRUE;\n\t\t\t}\n\n\t\t\t// Save or append the current log to %LocalAppData%\\Rufus\\rufus.log\n\t\t\tlog_size = GetWindowTextLengthU(hLog);\n\t\t\tif ((!user_deleted_rufus_dir) && (log_size > 0) && ((log_buffer = (char*)malloc(log_size + 2)) != NULL)) {\n\t\t\t\tlog_size = GetDlgItemTextU(hLogDialog, IDC_LOG_EDIT, log_buffer, log_size);\n\t\t\t\tif (log_size-- > 1) {\n\t\t\t\t\tif (persistent_log) {\n\t\t\t\t\t\t// Add an extra line for persistent logs\n\t\t\t\t\t\tlog_buffer[log_size - 1] = '\\r';\n\t\t\t\t\t\tlog_buffer[log_size] = '\\n';\n\t\t\t\t\t}\n\t\t\t\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\t\t\t\tIGNORE_RETVAL(_mkdir(FILES_DIR));\n\t\t\t\t\tIGNORE_RETVAL(_chdir(FILES_DIR));\n\t\t\t\t\tFileIO(persistent_log ? FILE_IO_APPEND : FILE_IO_WRITE, \"rufus.log\", &log_buffer, &log_size);\n\t\t\t\t}\n\t\t\t\tsafe_free(log_buffer);\n\t\t\t}\n\n\t\t\tif (ulRegister != 0)\n\t\t\t\tSHChangeNotifyDeregister(ulRegister);\n\t\t\tPostQuitMessage(0);\n\t\t\tClearDrives();\n\t\t\tStopProcessSearch();\n\t\t\tStrArrayDestroy(&BlockingProcessList);\n\t\t\tStrArrayDestroy(&ImageList);\n\t\t\tStrArrayDestroy(&modified_files);\n\t\t\tDestroyAllTooltips();\n\t\t\tDestroyWindow(hLogDialog);\n\t\t\tGetWindowRect(hDlg, &relaunch_rc);\n\t\t\tDestroyWindow(hDlg);\n\t\t\tbreak;\n\t\tcase IDC_ABOUT:\n\t\t\tCreateAboutBox();\n\t\t\tbreak;\n\t\tcase IDC_LOG:\n\t\t\t// Place the log Window to the right (or left for RTL) of our dialog on first display\n\t\t\tif (first_log_display) {\n\t\t\t\tGetClientRect(GetDesktopWindow(), &DesktopRect);\n\t\t\t\tGetWindowRect(hLogDialog, &DialogRect);\n\t\t\t\tnWidth = DialogRect.right - DialogRect.left;\n\t\t\t\tnHeight = DialogRect.bottom - DialogRect.top;\n\t\t\t\tGetWindowRect(hDlg, &DialogRect);\n\t\t\t\toffset = GetSystemMetrics(SM_CXBORDER);\n\t\t\t\tif (WindowsVersion.Version >= WINDOWS_10) {\n\t\t\t\t\t// See https://stackoverflow.com/a/42491227/1069307\n\t\t\t\t\t// I agree with Stephen Hazel: Whoever at Microsoft thought it would be a great idea to\n\t\t\t\t\t// add a *FRIGGING INVISIBLE BORDER* in Windows 10 should face the harshest punishment!\n\t\t\t\t\t// Also calling this API will create DLL sideloading issues through 'dwmapi.dll' so make\n\t\t\t\t\t// sure you delay-load it in your application.\n\t\t\t\t\tDwmGetWindowAttribute(hDlg, DWMWA_EXTENDED_FRAME_BOUNDS, &rc, sizeof(RECT));\n\t\t\t\t\toffset += 2 * (DialogRect.left - rc.left);\n\t\t\t\t}\n\t\t\t\tif (right_to_left_mode)\n\t\t\t\t\tPoint.x = max(DialogRect.left - offset - nWidth, 0);\n\t\t\t\telse\n\t\t\t\t\tPoint.x = min(DialogRect.right + offset, DesktopRect.right - nWidth);\n\n\t\t\t\tPoint.y = max(DialogRect.top, DesktopRect.top - nHeight);\n\t\t\t\tMoveWindow(hLogDialog, Point.x, Point.y, nWidth, nHeight, FALSE);\n\t\t\t\t// The log may have been recentered to fit the screen, in which case, try to shift our main dialog left (or right for RTL)\n\t\t\t\tnWidth = DialogRect.right - DialogRect.left;\n\t\t\t\tnHeight = DialogRect.bottom - DialogRect.top;\n\t\t\t\tif (right_to_left_mode) {\n\t\t\t\t\tPoint.x = DialogRect.left;\n\t\t\t\t\tGetWindowRect(hLogDialog, &DialogRect);\n\t\t\t\t\tPoint.x = max(Point.x, DialogRect.right - DialogRect.left + offset);\n\t\t\t\t} else {\n\t\t\t\t\tPoint.x = max((DialogRect.left<0)?DialogRect.left:0, Point.x - offset - nWidth);\n\t\t\t\t}\n\t\t\t\tMoveWindow(hDlg, Point.x, Point.y, nWidth, nHeight, TRUE);\n\t\t\t\tfirst_log_display = FALSE;\n\t\t\t}\n\t\t\t// Display the log Window\n\t\t\tlog_displayed = !log_displayed;\n\t\t\t// Set focus on the start button\n\t\t\tSendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)FALSE, 0);\n\t\t\tSendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)hStart, TRUE);\n\t\t\t// Must come last for the log window to get focus\n\t\t\tShowWindow(hLogDialog, log_displayed?SW_SHOW:SW_HIDE);\n\t\t\tbreak;\n\t\tcase IDC_ADVANCED_DRIVE_PROPERTIES:\n\t\t\tadvanced_mode_device = !advanced_mode_device;\n\t\t\tWriteSettingBool(SETTING_ADVANCED_MODE_DEVICE, advanced_mode_device);\n\t\t\tToggleAdvancedDeviceOptions(advanced_mode_device);\n\t\t\tSetBootOptions();\n\t\t\tboot_type = (int)ComboBox_GetCurItemData(hBootType);\n\t\t\tEnableControls(TRUE, FALSE);\n\t\t\tSetFileSystemAndClusterSize(NULL);\n\t\t\tSendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE_INTERNAL<<16) | IDC_FILE_SYSTEM,\n\t\t\t\tComboBox_GetCurSel(hFileSystem));\n\t\t\tbreak;\n\t\tcase IDC_ADVANCED_FORMAT_OPTIONS:\n\t\t\tadvanced_mode_format = !advanced_mode_format;\n\t\t\tWriteSettingBool(SETTING_ADVANCED_MODE_FORMAT, advanced_mode_format);\n\t\t\tToggleAdvancedFormatOptions(advanced_mode_format);\n\t\t\tif (selected_fs == FS_UNKNOWN)\n\t\t\t\tselected_fs = (int)ComboBox_GetCurItemData(hFileSystem);\n\t\t\tSetFileSystemAndClusterSize(NULL);\n\t\t\tSendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE_INTERNAL << 16) | IDC_FILE_SYSTEM,\n\t\t\t\tComboBox_GetCurSel(hFileSystem));\n\t\t\tbreak;\n\t\tcase IDC_LABEL:\n\t\t\tif (HIWORD(wParam) == EN_CHANGE) {\n\t\t\t\t// We will get EN_CHANGE when we change the label automatically, so we need to detect that\n\t\t\t\tif (!app_changed_label)\n\t\t\t\t\tuser_changed_label = TRUE;\n\t\t\t\tapp_changed_label = FALSE;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase IDC_DEVICE:\n\t\t\tif (HIWORD(wParam) != CBN_SELCHANGE)\n\t\t\t\tbreak;\n\t\t\tnb_devices = ComboBox_GetCount(hDeviceList);\n\t\t\tPrintStatusDebug(0, (nb_devices == 1) ? MSG_208 : MSG_209, nb_devices);\n\t\t\tPopulateProperties();\n\t\t\tnDeviceIndex = ComboBox_GetCurSel(hDeviceList);\n\t\t\tDeviceNum = (nDeviceIndex == CB_ERR) ? 0 : (DWORD)ComboBox_GetItemData(hDeviceList, nDeviceIndex);\n\t\t\tSendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE_INTERNAL << 16) | IDC_FILE_SYSTEM,\n\t\t\t\tComboBox_GetCurSel(hFileSystem));\n\t\t\tif (nb_devices == 0) {\n\t\t\t\t// No need to run the process search if no device is selected\n\t\t\t\tStopProcessSearch();\n\t\t\t} else if (!StartProcessSearch() || !SetProcessSearch(DeviceNum)) {\n\t\t\t\tuprintf(\"Failed to start conflicting process search\");\n\t\t\t\tStopProcessSearch();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase IDC_IMAGE_OPTION:\n\t\t\tif (HIWORD(wParam) != CBN_SELCHANGE)\n\t\t\t\tbreak;\n\t\t\tSetFileSystemAndClusterSize(NULL);\n\t\t\timop_win_sel = ComboBox_GetCurSel(hImageOption);\n\t\t\tEnableUefiValidation((imop_win_sel == 0), TRUE);\n\t\t\tbreak;\n\t\tcase IDC_PERSISTENCE_SIZE:\n\t\t\tif (HIWORD(wParam) == EN_CHANGE) {\n\t\t\t\tuint64_t pos;\n\t\t\t\t// We get EN_CHANGE when we change the size automatically, so we need to detect that\n\t\t\t\tif (app_changed_size) {\n\t\t\t\t\tapp_changed_size = FALSE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tGetWindowTextA(GetDlgItem(hDlg, IDC_PERSISTENCE_SIZE), tmp, sizeof(tmp));\n\t\t\t\tlPos = strtol(tmp, NULL, 10);\n\t\t\t\tpersistence_unit_selection = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS));\n\t\t\t\tpersistence_size = lPos * MB;\n\t\t\t\tfor (i = 0; i < persistence_unit_selection; i++)\n\t\t\t\t\tpersistence_size *= 1024;\n\t\t\t\tif (persistence_size > SelectedDrive.DiskSize - PERCENTAGE(PROJECTED_SIZE_RATIO, img_report.projected_size))\n\t\t\t\t\tpersistence_size = SelectedDrive.DiskSize - PERCENTAGE(PROJECTED_SIZE_RATIO, img_report.projected_size);\n\t\t\t\tpos = persistence_size / MB;\n\t\t\t\tfor (i = 0; i < persistence_unit_selection; i++)\n\t\t\t\t\tpos /= 1024;\n\t\t\t\tlPos = (LONG)pos;\n\t\t\t\tSendMessage(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SLIDER), TBM_SETPOS, TRUE, lPos);\n\t\t\t\tif (persistence_size >= (SelectedDrive.DiskSize - PERCENTAGE(PROJECTED_SIZE_RATIO, img_report.projected_size))) {\n\t\t\t\t\tstatic_sprintf(tmp, \"%ld\", lPos);\n\t\t\t\t\tapp_changed_size = TRUE;\n\t\t\t\t\tSetWindowTextU(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp);\n\t\t\t\t}\n\t\t\t} else if (HIWORD(wParam) == EN_KILLFOCUS) {\n\t\t\t\tif (persistence_size == 0) {\n\t\t\t\t\tTogglePersistenceControls(FALSE);\n\t\t\t\t\tstatic_sprintf(tmp, \"0 (%s)\", lmprintf(MSG_124));\n\t\t\t\t\tapp_changed_size = TRUE;\n\t\t\t\t\tSetWindowTextU(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp);\n\t\t\t\t} else if (persistence_size < MIN_EXT_SIZE) {\n\t\t\t\t\tpersistence_size = MIN_EXT_SIZE;\n\t\t\t\t\tuint64_t pos = persistence_size / MB;\n\t\t\t\t\tfor (i = 0; i < persistence_unit_selection; i++)\n\t\t\t\t\t\tpos /= 1024;\n\t\t\t\t\tlPos = (LONG)pos;\n\t\t\t\t\tSendMessage(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SLIDER), TBM_SETPOS, TRUE, lPos);\n\t\t\t\t\tstatic_sprintf(tmp, \"%ld\", lPos);\n\t\t\t\t\tapp_changed_size = TRUE;\n\t\t\t\t\tSetWindowTextU(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase IDC_PERSISTENCE_UNITS:\n\t\t\tif (HIWORD(wParam) != CBN_SELCHANGE)\n\t\t\t\tbreak;\n\t\t\tif (ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS)) == persistence_unit_selection)\n\t\t\t\tbreak;\n\t\t\tGetWindowTextA(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp, sizeof(tmp));\n\t\t\tpersistence_size = strtol(tmp, NULL, 10) * MB;\n\t\t\tfor (i = 0; i < persistence_unit_selection; i++)\n\t\t\t\tpersistence_size *= 1024;\n\t\t\tpersistence_unit_selection = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS));\n\t\t\tSetPersistenceSize();\n\t\t\tbreak;\n\t\tcase IDC_NB_PASSES:\n\t\t\tif (HIWORD(wParam) != CBN_SELCHANGE)\n\t\t\t\tbreak;\n\t\t\tSetPassesTooltip();\n\t\t\tbreak;\n\t\tcase IDC_TARGET_SYSTEM:\n\t\t\tif (HIWORD(wParam) != CBN_SELCHANGE)\n\t\t\t\tbreak;\n\t\t\ttarget_type = (int)ComboBox_GetCurItemData(hTargetSystem);\n\t\t\tSendMessage(hMainDialog, UM_UPDATE_CSM_TOOLTIP, 0, 0);\n\t\t\tSetFileSystemAndClusterSize(NULL);\n\t\t\tEnableUefiValidation(TRUE, TRUE);\n\t\t\tbreak;\n\t\tcase IDC_PARTITION_TYPE:\n\t\t\tif (HIWORD(wParam) != CBN_SELCHANGE)\n\t\t\t\tbreak;\n\t\t\tpartition_type = (int)ComboBox_GetCurItemData(hPartitionScheme);\n\t\t\tSetPartitionSchemeAndTargetSystem(TRUE);\n\t\t\tSetFileSystemAndClusterSize(NULL);\n\t\t\tEnableOldBiosFixes(TRUE, TRUE);\n\t\t\tEnableUefiValidation(TRUE, TRUE);\n\t\t\tselected_pt = partition_type;\n\t\t\tbreak;\n\t\tcase IDC_FILE_SYSTEM:\n\t\t\tif ((HIWORD(wParam) != CBN_SELCHANGE) && (HIWORD(wParam) != CBN_SELCHANGE_INTERNAL))\n\t\t\t\tbreak;\n\t\t\tif (!IsWindowEnabled(hFileSystem))\n\t\t\t\tbreak;\n\t\t\tset_selected_fs = (HIWORD(wParam) == CBN_SELCHANGE);\n\t\t\tfs_type = (int)ComboBox_GetCurItemData(hFileSystem);\n\t\t\tSetClusterSizes(fs_type);\n\t\t\tif (set_selected_fs && (fs_type > 0))\n\t\t\t\tselected_fs = fs_type;\n\t\t\t// Some FS's (such as ReFS or Large FAT32) only have QuickFormat so make sure we reflect that\n\t\t\tEnableQuickFormat(TRUE, TRUE);\n\t\t\tEnableOldBiosFixes(TRUE, TRUE);\n\t\t\tEnableExtendedLabel(TRUE, TRUE);\n\t\t\tbreak;\n\t\tcase IDC_BOOT_SELECTION:\n\t\t\tif (HIWORD(wParam) != CBN_SELCHANGE)\n\t\t\t\tbreak;\n\t\t\tboot_type = (int)ComboBox_GetCurItemData(hBootType);\n\t\t\tif ((HIWORD(wParam) != CBN_SELCHANGE) || (boot_type == selection_default))\n\t\t\t\tbreak;\n\t\t\tselection_default = boot_type;\n\t\t\tSetPartitionSchemeAndTargetSystem(FALSE);\n\t\t\t// Try to reselect current FS from the drive for non-bootable\n\t\t\ttmp[0] = 0;\n\t\t\tif ((selected_fs == FS_UNKNOWN) && (SelectedDrive.DeviceNumber != 0))\n\t\t\t\tGetDrivePartitionData(SelectedDrive.DeviceNumber, tmp, sizeof(tmp), !usb_debug);\n\t\t\tSetFileSystemAndClusterSize(tmp);\n\t\t\tToggleImageOptions();\n\t\t\tSetProposedLabel(ComboBox_GetCurSel(hDeviceList));\n\t\t\tEnableControls(TRUE, TRUE);\n\t\t\ttarget_type = (int)ComboBox_GetCurItemData(hPartitionScheme);\n\t\t\tpartition_type = (int)ComboBox_GetCurItemData(hTargetSystem);\n\t\t\treturn (INT_PTR)TRUE;\n\t\tcase IDC_SELECT:\n\t\t\t// Ctrl-SELECT is used to select an additional archive of files to extract\n\t\t\t// For now only zip archives are supported.\n\t\t\tif (GetKeyState(VK_CONTROL) & 0x8000) {\n\t\t\t\tEXT_DECL(arch_ext, NULL, __VA_GROUP__(\"*.zip\"), __VA_GROUP__(lmprintf(MSG_309)));\n\t\t\t\tarchive_path = FileDialog(FALSE, NULL, &arch_ext, NULL);\n\t\t\t\tif (archive_path != NULL) {\n\t\t\t\t\tuprintf(\"Using archive: %s (%s)\", _filenameU(archive_path),\n\t\t\t\t\t\tSizeToHumanReadable(_filesizeU(archive_path), FALSE, FALSE));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (select_index == 1) {\n\t\t\t\tEnableControls(FALSE, FALSE);\n\t\t\t\tDownloadISO();\n\t\t\t} else {\n\t\t\t\tif (img_provided) {\n\t\t\t\t\tuprintf(\"\\r\\nImage provided: '%s'\", image_path);\n\t\t\t\t\timg_provided = FALSE;\t// One off thing...\n\t\t\t\t} else {\n\t\t\t\t\tchar* old_image_path = image_path;\n\t\t\t\t\tchar extensions[128] = \"*.iso;*.img;*.vhd;*.vhdx;*.usb;*.bz2;*.bzip2;*.gz;*.lzma;*.xz;*.Z;*.zip;*.zst;*.wic;*.wim;*.esd;*.vtsi\";\n\t\t\t\t\tif (has_ffu_support)\n\t\t\t\t\t\tstrcat(extensions, \";*.ffu\");\n\t\t\t\t\t// If declared globaly, lmprintf(MSG_280) would be called on each message...\n\t\t\t\t\tEXT_DECL(img_ext, NULL, __VA_GROUP__(extensions),\n\t\t\t\t\t\t__VA_GROUP__(lmprintf(MSG_280)));\n\t\t\t\t\timage_path = FileDialog(FALSE, NULL, &img_ext, NULL);\n\t\t\t\t\tif (image_path == NULL) {\n\t\t\t\t\t\tif (old_image_path != NULL) {\n\t\t\t\t\t\t\t// Reselect previous image\n\t\t\t\t\t\t\timage_path = old_image_path;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tCreateTooltip(hSelectImage, lmprintf(MSG_173), -1);\n\t\t\t\t\t\t\tPrintStatus(0, MSG_086);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsafe_free(archive_path);\n\t\t\t\t\t\tfree(old_image_path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tErrorStatus = 0;\n\t\t\t\tif (CreateThread(NULL, 0, ImageScanThread, NULL, 0, NULL) == NULL) {\n\t\t\t\t\tuprintf(\"Unable to start ISO scanning thread\");\n\t\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_START_THREAD));\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase IDC_UEFI_MEDIA_VALIDATION:\n\t\t\tif ((HIWORD(wParam)) == BN_CLICKED) {\n\t\t\t\tvalidate_md5sum = IsChecked(IDC_UEFI_MEDIA_VALIDATION);\n//\t\t\t\tWriteSettingBool(SETTING_ENABLE_RUNTIME_VALIDATION, validate_md5sum);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase IDC_LIST_USB_HDD:\n\t\t\tif ((HIWORD(wParam)) == BN_CLICKED) {\n\t\t\t\tenable_HDDs = !enable_HDDs;\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_253), enable_HDDs);\n\t\t\t\tGetDevices(0);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase IDC_START:\n\t\t\tif (format_thread != NULL)\n\t\t\t\treturn (INT_PTR)TRUE;\n\t\t\t// Just in case\n\t\t\tboot_type = (int)ComboBox_GetCurItemData(hBootType);\n\t\t\tpartition_type = (int)ComboBox_GetCurItemData(hPartitionScheme);\n\t\t\ttarget_type = (int)ComboBox_GetCurItemData(hTargetSystem);\n\t\t\tfs_type = (int)ComboBox_GetCurItemData(hFileSystem);\n\t\t\twrite_as_image = FALSE;\n\t\t\twrite_as_esp = FALSE;\n\t\t\tunattend_xml_flags = 0;\n\t\t\t// Disable all controls except Cancel\n\t\t\tEnableControls(FALSE, FALSE);\n\t\t\tErrorStatus = 0;\n\t\t\tLastWriteError = 0;\n\t\t\tStrArrayClear(&BlockingProcessList);\n\t\t\tno_confirmation_on_cancel = FALSE;\n\t\t\tSendMessage(hMainDialog, UM_PROGRESS_INIT, 0, 0);\n\t\t\tselection_default = (int)ComboBox_GetCurItemData(hBootType);\n\t\t\t// Create a thread to validate options and download files as needed (so that we can update the UI).\n\t\t\t// On exit, this thread sends message UM_FORMAT_START back to this dialog.\n\t\t\tif (CreateThread(NULL, 0, BootCheckThread, NULL, 0, NULL) == NULL) {\n\t\t\t\tuprintf(\"Unable to start boot check thread\");\n\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_START_THREAD));\n\t\t\t\tPostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)FALSE, 0);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase IDC_LANG:\n\t\t\t// Show the language menu such that it doesn't overlap the button\n\t\t\tSendMessage(hMultiToolbar, TB_GETRECT, (WPARAM)IDC_ABOUT, (LPARAM)&rc);\n\t\t\tMapWindowPoints(hDlg, NULL, (POINT*)&rc, 2);\n\t\t\trc.left += cbw / 2;\n\t\t\tShowLanguageMenu(rc);\n\t\t\tbreak;\n\t\tcase IDC_SETTINGS:\n\t\t\tMyDialogBox(hMainInstance, IDD_UPDATE_POLICY, hDlg, UpdateCallback);\n\t\t\tbreak;\n\t\tcase IDC_HASH:\n\t\t\tif ((format_thread == NULL) && (image_path != NULL)) {\n\t\t\t\tErrorStatus = 0;\n\t\t\t\tno_confirmation_on_cancel = TRUE;\n\t\t\t\tSendMessage(hMainDialog, UM_PROGRESS_INIT, 0, 0);\n\t\t\t\t// Disable all controls except cancel\n\t\t\t\tEnableControls(FALSE, FALSE);\n\t\t\t\tInitProgress(FALSE);\n\t\t\t\tSetThreadAffinity(thread_affinity, HASH_MAX + 1);\n\t\t\t\tformat_thread = CreateThread(NULL, 0, HashThread, (LPVOID)thread_affinity, 0, NULL);\n\t\t\t\tif (format_thread != NULL) {\n\t\t\t\t\tSetThreadPriority(format_thread, default_thread_priority);\n\t\t\t\t\tPrintInfo(0, -1);\n\t\t\t\t\tSendMessage(hMainDialog, UM_TIMER_START, 0, 0);\n\t\t\t\t} else {\n\t\t\t\t\tuprintf(\"Unable to start hash thread\");\n\t\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_START_THREAD));\n\t\t\t\t\tPostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)FALSE, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase IDC_SAVE:\n\t\t\tif (format_thread == NULL && (ComboBox_GetCurSel(hDeviceList) >= 0)) {\n\t\t\t\tsave_image = SaveImage();\n\t\t\t\tif (!save_image) {\n\t\t\t\t\tuprintf(\"Unable to start image save thread\");\n\t\t\t\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\t\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_START_THREAD));\n\t\t\t\t\tPostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)FALSE, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase IDM_SELECT:\n\t\tcase IDM_DOWNLOAD:\n\t\t\tselect_index = LOWORD(wParam) - IDM_SELECT;\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_SELECT), uppercase_select[select_index]);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn (INT_PTR)FALSE;\n\t\t}\n\t\treturn (INT_PTR)TRUE;\n\n\tcase UM_UPDATE_CSM_TOOLTIP:\n\t\tShowWindow(GetDlgItem(hMainDialog, IDS_CSM_HELP_TXT), ((target_type == TT_UEFI) || has_uefi_csm) ? SW_SHOW : SW_HIDE);\n\t\tCreateTooltip(GetDlgItem(hMainDialog, IDS_CSM_HELP_TXT), lmprintf((target_type == TT_UEFI) ? MSG_152 : MSG_151), 30000);\n\t\tbreak;\n\tcase UM_ENABLE_CONTROLS:\n\t\tKillTimer(hMainDialog, TID_APP_TIMER);\n\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\tPrintInfo(0, MSG_210);\n\t\telse switch (SCODE_CODE(ErrorStatus)) {\n\t\tcase ERROR_CANCELLED:\n\t\t\tPrintInfo(0, MSG_211);\n\t\t\tbreak;\n\t\tcase ERROR_BAD_SIGNATURE:\n\t\t\tPrintInfo(0, MSG_283);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tPrintInfo(0, MSG_212);\n\t\t\tbreak;\n\t\t}\n\t\tEnableControls(TRUE, FALSE);\n\t\tbreak;\n\tcase UM_TIMER_START:\n\t\tPrintInfo(0, -1);\n\t\ttimer = 0;\n\t\tstatic_sprintf(szTimer, \"00:00:00\");\n\t\tSendMessageA(hStatus, SB_SETTEXTA, SBT_OWNERDRAW | SB_SECTION_RIGHT, (LPARAM)szTimer);\n\t\tSetTimer(hMainDialog, TID_APP_TIMER, 1000, ClockTimer);\n\t\tbreak;\n\tcase UM_SELECT_ISO:\n\t\tselect_index = 0;\n\t\timg_provided = TRUE;\n\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_SELECT), uppercase_select[0]);\n\t\tSendMessage(hDlg, WM_COMMAND, IDC_SELECT, 0);\n\t\tbreak;\n\tcase UM_MEDIA_CHANGE:\n\t\twParam = DBT_CUSTOMEVENT;\n\t\t// Fall through\n\tcase WM_DEVICECHANGE:\n\t\t// The Windows hotplug subsystem sucks. Among other things, if you insert a GPT partitioned\n\t\t// USB drive with zero partitions, the only device messages you will get are a stream of\n\t\t// DBT_DEVNODES_CHANGED and that's it. But those messages are also issued when you get a\n\t\t// DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE, and there's a whole slew of them so we\n\t\t// can't really issue a refresh for each one we receive\n\t\t// What we do then is arm a timer on DBT_DEVNODES_CHANGED, if it's been more than 1 second\n\t\t// since last refresh/arm timer, and have that timer send DBT_CUSTOMEVENT when it expires.\n\t\t// DO *NOT* USE WM_DEVICECHANGE AS THE MESSAGE FROM THE TIMER PROC, as it may be filtered!\n\t\t// For instance filtering will occur when (un)plugging in a FreeBSD UFD on Windows 8.\n\t\t// Instead, use a custom user message, such as UM_MEDIA_CHANGE, to set DBT_CUSTOMEVENT.\n\t\tif (format_thread == NULL) {\n\t\t\tswitch (wParam) {\n\t\t\tcase DBT_DEVICEARRIVAL:\n\t\t\tcase DBT_DEVICEREMOVECOMPLETE:\n\t\t\tcase DBT_CUSTOMEVENT:\t// Sent by our timer refresh function or for card reader media change\n\t\t\t\tLastRefresh = GetTickCount64();\n\t\t\t\tKillTimer(hMainDialog, TID_REFRESH_TIMER);\n\t\t\t\tif (!op_in_progress) {\n\t\t\t\t\tqueued_hotplug_event = FALSE;\n\t\t\t\t\tGetDevices((DWORD)ComboBox_GetCurItemData(hDeviceList));\n\t\t\t\t\tEnableControls(TRUE, FALSE);\n\t\t\t\t\tif (ComboBox_GetCurSel(hDeviceList) < 0) {\n\t\t\t\t\t\tSetPartitionSchemeAndTargetSystem(FALSE);\n\t\t\t\t\t\tSetFileSystemAndClusterSize(NULL);\n\t\t\t\t\t\tShowWindow(GetDlgItem(hDlg, IDS_CSM_HELP_TXT), SW_HIDE);\n\t\t\t\t\t\tpersistence_unit_selection = -1;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tqueued_hotplug_event = TRUE;\n\t\t\t\t}\n\t\t\t\treturn (INT_PTR)TRUE;\n\t\t\tcase DBT_DEVNODES_CHANGED:\n\t\t\t\t// If it's been more than a second since last device refresh, arm a refresh timer\n\t\t\t\tif (dont_process_dbt_devnodes) {\n\t\t\t\t\t// This ensures we don't get unwanted refreshes while scanning an image.\n\t\t\t\t\tLastRefresh = GetTickCount64();\n\t\t\t\t} else if (GetTickCount64() > LastRefresh + 1000) {\n\t\t\t\t\tLastRefresh = GetTickCount64();\n\t\t\t\t\tSetTimer(hMainDialog, TID_REFRESH_TIMER, 1000, RefreshTimer);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tbreak;\n\n\tcase WM_INITDIALOG:\n\t\tInitAndSetDarkModeForMainDlg(hDlg);\n\t\t// Make sure fScale is set before the first call to apply localization, so that move/resize scale appropriately\n\t\thDC = GetDC(hDlg);\n\t\tfScale = GetDeviceCaps(hDC, LOGPIXELSX) / 96.0f;\n\t\tsafe_release_dc(hDlg, hDC);\n\t\tapply_localization(IDD_DIALOG, hDlg);\n\t\t// The AppStore version always enables Fido\n\t\tif (appstore_version)\n\t\t\tSetFidoCheck();\n\t\telse\n\t\t\tSetUpdateCheck();\n\t\tfirst_log_display = TRUE;\n\t\tlog_displayed = FALSE;\n\t\thLogDialog = MyCreateDialog(hMainInstance, IDD_LOG, hDlg, (DLGPROC)LogCallback);\n\t\tInitDialog(hDlg);\n\t\tGetDevices(0);\n\t\tEnableControls(TRUE, FALSE);\n\t\tUpdateImage(FALSE);\n\t\t// The AppStore version does not need the internal check for updates\n\t\tif (!appstore_version)\n\t\t\tCheckForUpdates(FALSE);\n\t\t// Register MEDIA_INSERTED/MEDIA_REMOVED notifications for card readers\n\t\tif (SUCCEEDED(SHGetSpecialFolderLocation(0, CSIDL_DESKTOP, &pidlDesktop))) {\n\t\t\tNotifyEntry.pidl = pidlDesktop;\n\t\t\tNotifyEntry.fRecursive = TRUE;\n\t\t\t// NB: The following only works if the media is already formatted.\n\t\t\t// If you insert a blank card, notifications will not be sent... :(\n\t\t\tulRegister = SHChangeNotifyRegister(hDlg, 0x0001 | 0x0002 | 0x8000,\n\t\t\t\tSHCNE_MEDIAINSERTED | SHCNE_MEDIAREMOVED, UM_MEDIA_CHANGE, 1, &NotifyEntry);\n\t\t}\n\t\t// Bring our Window on top. We have to go through all *THREE* of these, or Far Manager hides our window :(\n\t\tSetWindowPos(hMainDialog, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);\n\t\tSetWindowPos(hMainDialog, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);\n\t\tSetWindowPos(hMainDialog, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);\n\n\t\t// Set 'START' as the selected button if it's enabled, otherwise use 'SELECT', instead\n\t\tSendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)(IsWindowEnabled(hStart) ? hStart : hSelectImage), TRUE);\n\n#if defined(ALPHA)\n\t\t// Add a VERY ANNOYING popup for Alpha releases, so that people don't start redistributing them\n\t\tMessageBoxA(NULL, \"This is an Alpha version of \" APPLICATION_NAME \" - It is meant to be used for \"\n\t\t\t\"testing ONLY and should NOT be distributed as a release.\", \"ALPHA VERSION\", MB_ICONINFORMATION);\n#elif defined(TEST)\n\t\t// Same thing for Test releases\n\t\tMessageBoxA(NULL, \"This is a Test version of \" APPLICATION_NAME \" - It is meant to be used for \"\n\t\t\t\"testing ONLY and should NOT be distributed as a release.\", \"TEST VERSION\", MB_ICONINFORMATION);\n#endif\n\t\tSetDarkModeForChild(hDlg);\n\t\tSubclassStatusBar(hStatus);\n\t\tSetHyperLinkFont(GetDlgItem(hDlg, IDS_CSM_HELP_TXT), (HDC)wParam, &hHyperlinkFont, FALSE);\n\t\t// Let's not take any risk: Ask Windows to redraw the whole dialog before we exit init\n\t\tRedrawWindow(hMainDialog, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW);\n\t\tInvalidateRect(hMainDialog, NULL, TRUE);\n\n\t\treturn (INT_PTR)FALSE;\n\n\tcase WM_DRAWITEM:\n\t\t// The things one must do to get an ellipsis and text alignment on the status bar...\n\t\tif (wParam == IDC_STATUS) {\n\t\t\tpDI = (DRAWITEMSTRUCT*)lParam;\n\t\t\tif (WindowsVersion.Version >= WINDOWS_10)\n\t\t\t\tpDI->rcItem.top += (int)(1.0f * fScale);\n\t\t\telse if (fScale >= 1.49f)\n\t\t\t\tpDI->rcItem.top -= (int)(1.5f * fScale);\n\t\t\tpDI->rcItem.left += (int)(4.0f * fScale);\n\t\t\tSetBkMode(pDI->hDC, TRANSPARENT);\n\t\t\tswitch (pDI->itemID) {\n\t\t\tcase SB_SECTION_LEFT:\n\t\t\t\tSetTextColor(pDI->hDC, is_darkmode_enabled ? DARKMODE_NORMAL_TEXT_COLOR : GetSysColor(COLOR_BTNTEXT));\n\t\t\t\tDrawTextExU(pDI->hDC, szStatusMessage, -1, &pDI->rcItem,\n\t\t\t\t\tDT_LEFT | DT_END_ELLIPSIS | DT_PATH_ELLIPSIS, NULL);\n\t\t\t\treturn (INT_PTR)TRUE;\n\t\t\tcase SB_SECTION_RIGHT:\n\t\t\t\tSetTextColor(pDI->hDC, is_darkmode_enabled ? DARKMODE_DISABLED_TEXT_COLOR : GetSysColor(COLOR_3DSHADOW));\n\t\t\t\tDrawTextExA(pDI->hDC, szTimer, -1, &pDI->rcItem, DT_LEFT, NULL);\n\t\t\t\treturn (INT_PTR)TRUE;\n\t\t\t}\n\t\t}\n\t\tbreak;\n\n\tcase WM_PAINT:\n\t\thDC = BeginPaint(hDlg, &ps);\n\t\tOnPaint(hDC);\n\t\tEndPaint(hDlg, &ps);\n\t\tbreak;\n\n\tcase WM_CTLCOLORSTATIC:\n\t\tif ((HWND)lParam != GetDlgItem(hDlg, IDS_CSM_HELP_TXT))\n\t\t\treturn FALSE;\n\t\tSetBkMode((HDC)wParam, TRANSPARENT);\n\t\tSelectObject((HDC)wParam, hHyperlinkFont);\n\t\tSetTextColor((HDC)wParam, TOOLBAR_ICON_COLOR);\n\t\treturn (INT_PTR)GetSysColorBrush(COLOR_BTNFACE);\n\n\tcase WM_DESTROY:\n\t\tsafe_destroy_imagelist_from_toolbar(hSaveToolbar);\n\t\tsafe_destroy_imagelist_from_toolbar(hHashToolbar);\n\t\tsafe_destroy_imagelist_from_toolbar(hMultiToolbar);\n\t\tbreak;\n\n\tcase WM_NCDESTROY:\n\t\tsafe_delete_object(hHyperlinkFont);\n\t\tsafe_delete_object(hInfoFont);\n\t\tsafe_delete_object(hSectionHeaderFont);\n\t\tsafe_destroy_imagelist(hUpImageList);\n\t\tsafe_destroy_imagelist(hDownImageList);\n\t\tsafe_destroy_icon(hSmallIcon);\n\t\tsafe_destroy_icon(hBigIcon);\n\t\tbreak;\n\n\tcase WM_NOTIFY:\n\t\tswitch (((LPNMHDR)lParam)->code) {\n\t\tcase TTN_GETDISPINFO:\n\t\t\tlpttt = (LPTOOLTIPTEXT)lParam;\n\t\t\tswitch (lpttt->hdr.idFrom) {\n\t\t\tcase IDC_ABOUT:\n\t\t\t\tutf8_to_wchar_no_alloc(lmprintf(MSG_302), wtooltip, ARRAYSIZE(wtooltip));\n\t\t\t\tlpttt->lpszText = wtooltip;\n\t\t\t\tbreak;\n\t\t\tcase IDC_SETTINGS:\n\t\t\t\tutf8_to_wchar_no_alloc(lmprintf(MSG_301), wtooltip, ARRAYSIZE(wtooltip));\n\t\t\t\tlpttt->lpszText = wtooltip;\n\t\t\t\tbreak;\n\t\t\tcase IDC_LANG:\n\t\t\t\tutf8_to_wchar_no_alloc(lmprintf(MSG_273), wtooltip, ARRAYSIZE(wtooltip));\n\t\t\t\tlpttt->lpszText = wtooltip;\n\t\t\t\tbreak;\n\t\t\tcase IDC_LOG:\n\t\t\t\tutf8_to_wchar_no_alloc(lmprintf(MSG_303), wtooltip, ARRAYSIZE(wtooltip));\n\t\t\t\tlpttt->lpszText = wtooltip;\n\t\t\t\tbreak;\n\t\t\tcase IDC_SAVE:\n\t\t\t\tutf8_to_wchar_no_alloc(lmprintf(MSG_304), wtooltip, ARRAYSIZE(wtooltip));\n\t\t\t\tlpttt->lpszText = wtooltip;\n\t\t\t\tbreak;\n\t\t\tcase IDC_HASH:\n\t\t\t\tutf8_to_wchar_no_alloc(lmprintf(MSG_272), wtooltip, ARRAYSIZE(wtooltip));\n\t\t\t\tlpttt->lpszText = wtooltip;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase BCN_DROPDOWN:\n\t\t\tpDropDown = (LPNMBCDROPDOWN)lParam;\n\t\t\tPoint.x = pDropDown->rcButton.left;\n\t\t\tPoint.y = pDropDown->rcButton.bottom;\n\t\t\tClientToScreen(pDropDown->hdr.hwndFrom, &Point);\n\t\t\thMenu = CreatePopupMenu();\n\t\t\tInsertMenuU(hMenu, -1, MF_BYPOSITION | ((select_index == 0) ? MF_CHECKED : 0), IDM_SELECT, uppercase_select[0]);\n\t\t\tInsertMenuU(hMenu, -1, MF_BYPOSITION | ((select_index == 1) ? MF_CHECKED : 0), IDM_DOWNLOAD, uppercase_select[1]);\n\t\t\tTrackPopupMenuEx(hMenu, TPM_LEFTALIGN | TPM_TOPALIGN, Point.x, Point.y, hMainDialog, NULL);\n\t\t\tDestroyMenu(hMenu);\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\n\tcase WM_HSCROLL:\n\t\tlPos = (LONG)SendMessage(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SLIDER), TBM_GETPOS, 0, 0);\n\t\tSetPersistencePos(lPos);\n\t\tpersistence_size = lPos * MB;\n\t\tfor (i = 0; i < persistence_unit_selection; i++)\n\t\t\tpersistence_size *= 1024;\n\t\tbreak;\n\n\tcase WM_DROPFILES:\n\t\tif (format_thread == NULL) {\n\t\t\tdroppedFileInfo = (HDROP)wParam;\n\t\t\t\twbuffer = calloc(MAX_PATH, sizeof(wchar_t));\n\t\t\t\tif (wbuffer == NULL) {\n\t\t\t\t\tuprintf(\"Failed to alloc buffer for drag-n-drop\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tDragQueryFileW(droppedFileInfo, 0, wbuffer, MAX_PATH);\n\t\t\t\tsafe_free(image_path);\n\t\t\t\timage_path = wchar_to_utf8(wbuffer);\n\t\t\t\tsafe_free(wbuffer);\n\n\t\t\t\tif (image_path != NULL) {\n\t\t\t\t\timg_provided = TRUE;\n\t\t\t\t\t// Simulate image selection click\n\t\t\t\t\tSendMessage(hDlg, WM_COMMAND, IDC_SELECT, 0);\n\t\t\t\t} else {\n\t\t\t\t\tEnableControls(TRUE, FALSE);\n\t\t\t\t}\n\t\t}\n\t\tbreak;\n\n\t// This is >>>SUPER WEIRD<<<. After a successful ISO or DD write (e.g. Arch 2016.01)\n\t// we no longer receive WM_QUERYENDSESSION messages, only WM_ENDSESSION.\n\t// But if we do a FreeDOS format, WM_QUERYENDSESSION is still sent to us alright.\n\t// What the heck is going on here?!?\n\t// Also, even as we try to work around this, WM_ENDSESSION comes too late in the game\n\t// to prevent shutdown block. So we need to handle the _undocumented_ WM_CLIENTSHUTDOWN.\n\tcase WM_CLOSE:\n\tcase WM_CLIENTSHUTDOWN:\n\tcase WM_QUERYENDSESSION:\n\tcase WM_ENDSESSION:\n\t\tif (op_in_progress)\n\t\t\treturn (INT_PTR)TRUE;\n\t\tif (message == WM_CLOSE) {\n\t\t\t// We must use PostQuitMessage() on WM_CLOSE, to prevent notification sound...\n\t\t\tPostQuitMessage(0);\n\t\t} else {\n\t\t\t// ...but we must simulate Cancel on shutdown requests, else the app freezes.\n\t\t\tSendMessage(hDlg, WM_COMMAND, (WPARAM)IDCANCEL, (LPARAM)0);\n\t\t}\n\t\tbreak;\n\n\tcase UM_PROGRESS_INIT:\n\t\tisMarquee = (wParam == PBS_MARQUEE);\n\t\tSendMessage(hProgress, PBM_SETSTATE, (WPARAM)PBST_NORMAL, 0);\n\t\tif (isMarquee) {\n\t\t\tSendMessage(hProgress, PBM_SETMARQUEE, TRUE, 0);\n\t\t\tSetTaskbarProgressState(TASKBAR_INDETERMINATE);\n\t\t} else {\n\t\t\tSendMessage(hProgress, PBM_SETPOS, 0, 0);\n\t\t\tSetTaskbarProgressState(TASKBAR_NORMAL);\n\t\t\tSetTaskbarProgressValue(0, MAX_PROGRESS);\n\t\t}\n\t\tbreak;\n\n\tcase UM_PROGRESS_EXIT:\n\t\ttb_state = PBST_NORMAL;\n\t\ttb_flags = TASKBAR_NORMAL;\n\t\tif (isMarquee) {\n\t\t\tSendMessage(hProgress, PBM_SETMARQUEE, FALSE, 0);\n\t\t\tSetTaskbarProgressValue(0, MAX_PROGRESS);\n\t\t} else if (!IS_ERROR(ErrorStatus)) {\n\t\t\tSetTaskbarProgressValue(MAX_PROGRESS, MAX_PROGRESS);\n\t\t} else if (SCODE_CODE(ErrorStatus) == ERROR_CANCELLED) {\n\t\t\ttb_state = PBST_PAUSED;\n\t\t\ttb_flags = TASKBAR_PAUSED;\n\t\t} else {\n\t\t\ttb_state = PBST_ERROR;\n\t\t\ttb_flags = TASKBAR_ERROR;\n\t\t\tMessageBeep(MB_ICONERROR);\n\t\t\tFlashTaskbar(dialog_handle);\n\t\t}\n\t\tSendMessage(hProgress, PBM_SETSTATE, (WPARAM)tb_state, 0);\n\t\tSetTaskbarProgressState(tb_flags);\n\t\tbreak;\n\n\tcase UM_NO_UPDATE:\n\t\tNotification(MB_ICONINFORMATION | MB_CLOSE, lmprintf(MSG_243), lmprintf(MSG_247));\n\t\t// Need to manually set focus back to \"Check Now\" for tabbing to work\n\t\tSendMessage(hUpdatesDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hUpdatesDlg, IDC_CHECK_NOW), TRUE);\n\t\tbreak;\n\n\tcase UM_FORMAT_START:\n\t\tif (wParam != BOOTCHECK_PROCEED)\n\t\t\tgoto aborted_start;\n\t\t// All subsequent aborts below translate to a user cancellation\n\t\twParam = BOOTCHECK_CANCEL;\n\t\tsave_image = FALSE;\n\n\t\tif ((partition_type == PARTITION_STYLE_MBR) && (SelectedDrive.DiskSize > 2 * TB)) {\n\t\t\tif (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_128, \"MBR\"),\n\t\t\t\tlmprintf(MSG_134, SizeToHumanReadable(SelectedDrive.DiskSize - 2 * TB, FALSE, FALSE))) != IDYES)\n\t\t\t\tgoto aborted_start;\n\t\t}\n\n\t\tif (!zero_drive && (fs_type == FS_UDF)) {\n\t\t\t// Display a warning about UDF formatting times\n\t\t\tdur_secs = (uint32_t)(((double)SelectedDrive.DiskSize) / 1073741824.0f / UDF_FORMAT_SPEED);\n\t\t\tif (dur_secs > UDF_FORMAT_WARN) {\n\t\t\t\tdur_mins = dur_secs / 60;\n\t\t\t\tdur_secs -= dur_mins * 60;\n\t\t\t\tNotification(MB_OK | MB_ICONINFORMATION, lmprintf(MSG_113), lmprintf(MSG_112, dur_mins, dur_secs));\n\t\t\t} else {\n\t\t\t\tdur_secs = 0;\n\t\t\t\tdur_mins = 0;\n\t\t\t}\n\t\t}\n\n\t\t// Detect processes that have write (0x2) or exec (0x4) permissions against our drive.\n\t\t// Ideally, exec should be no big deal, but Windows complains on USB ejection if a\n\t\t// process such as cmd.exe holds exec rights, so we follow suit.\n\t\tPrintStatus(0, MSG_278);\n\t\tif (GetProcessSearch(SEARCH_PROCESS_TIMEOUT, 0x06, TRUE)) {\n\t\t\tchar title[128];\n\t\t\tComboBox_GetTextU(hDeviceList, title, sizeof(title));\n\t\t\tif (Notification(MB_ICONWARNING | MB_YESNO, title, lmprintf(MSG_132)) != IDYES)\n\t\t\t\tgoto aborted_start;\n\t\t}\n\t\tPrintStatus(0, MSG_142);\n\n\t\tGetWindowTextU(hDeviceList, tmp, ARRAYSIZE(tmp));\n\t\tif (Notification(MB_OKCANCEL | MB_ICONWARNING, APPLICATION_NAME, lmprintf(MSG_003, tmp)) != IDOK)\n\t\t\tgoto aborted_start;\n\t\tif ((SelectedDrive.nPartitions > 1) && (Notification(MB_OKCANCEL | MB_ICONWARNING, lmprintf(MSG_094), lmprintf(MSG_093)) != IDOK))\n\t\t\tgoto aborted_start;\n\t\tif ((!zero_drive) && (boot_type != BT_NON_BOOTABLE) && (SelectedDrive.SectorSize != 512) &&\n\t\t\t(Notification(MB_OKCANCEL | MB_ICONWARNING, lmprintf(MSG_197), lmprintf(MSG_196, SelectedDrive.SectorSize)) != IDOK))\n\t\t\tgoto aborted_start;\n\n\t\tnDeviceIndex = ComboBox_GetCurSel(hDeviceList);\n\t\tDeviceNum = (DWORD)ComboBox_GetItemData(hDeviceList, nDeviceIndex);\n\t\tInitProgress(zero_drive || write_as_image);\n\t\tformat_thread = CreateThread(NULL, 0, FormatThread, (LPVOID)(uintptr_t)DeviceNum, 0, NULL);\n\t\tif (format_thread == NULL) {\n\t\t\tuprintf(\"Unable to start formatting thread\");\n\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_START_THREAD));\n\t\t\tPostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)FALSE, 0);\n\t\t} else {\n\t\t\tSetThreadPriority(format_thread, default_thread_priority);\n\t\t\tuprintf(\"\\r\\nFormat operation started\");\n\t\t\tSendMessage(hMainDialog, UM_TIMER_START, 0, 0);\n\t\t\t// Set focus to the Cancel button\n\t\t\tSendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hMainDialog, IDCANCEL), TRUE);\n\t\t}\n\t\tif (format_thread != NULL)\n\t\t\tbreak;\n\taborted_start:\n\t\tzero_drive = FALSE;\n\t\tif (queued_hotplug_event)\n\t\t\tSendMessage(hDlg, UM_MEDIA_CHANGE, 0, 0);\n\t\tif (wParam == BOOTCHECK_CANCEL) {\n\t\t\tnb_devices = ComboBox_GetCount(hDeviceList);\n\t\t\tPrintStatus(0, (nb_devices == 1) ? MSG_208 : MSG_209, nb_devices);\n\t\t\tPrintStatus(5000, MSG_041);\n\t\t\tif (unattend_xml_path != NULL) {\n\t\t\t\tDeleteFileU(unattend_xml_path);\n\t\t\t\tunattend_xml_path = NULL;\n\t\t\t}\n\t\t\tEnableControls(TRUE, FALSE);\n\t\t\tbreak;\n\t\t}\n\t\tErrorStatus = RUFUS_ERROR((wParam == BOOTCHECK_DOWNLOAD_ERROR) ? APPERR(ERROR_CANT_DOWNLOAD) : ERROR_GEN_FAILURE);\n\t\t// Fall through\n\n\tcase UM_FORMAT_COMPLETED:\n\t\tzero_drive = FALSE;\n\t\tformat_thread = NULL;\n\t\tif (unattend_xml_path != NULL) {\n\t\t\tDeleteFileU(unattend_xml_path);\n\t\t\tunattend_xml_path = NULL;\n\t\t}\n\t\t// Stop the timer\n\t\tKillTimer(hMainDialog, TID_APP_TIMER);\n\t\t// Close the cancel MessageBox and Blocking notification if active\n\t\tSendMessage(FindWindowA(MAKEINTRESOURCEA(32770), lmprintf(MSG_049)), WM_COMMAND, IDNO, 0);\n\t\tSendMessage(FindWindowA(MAKEINTRESOURCEA(32770), lmprintf(MSG_049)), WM_COMMAND, IDYES, 0);\n\t\tEnableWindow(GetDlgItem(hMainDialog, IDCANCEL), TRUE);\n\t\tEnableControls(TRUE, FALSE);\n\t\tif (wParam && !save_image) {\n\t\t\tuprintf(\"\\r\\n\");\n\t\t\tGetDevices(DeviceNum);\n\t\t}\n\t\tsave_image = FALSE;\n\t\tif (!IS_ERROR(ErrorStatus)) {\n\t\t\tSendMessage(hProgress, PBM_SETPOS, MAX_PROGRESS, 0);\n\t\t\tSetTaskbarProgressState(TASKBAR_NOPROGRESS);\n\t\t\tPrintInfo(0, MSG_210);\n\t\t\tMessageBeep(MB_OK);\n\t\t\tFlashTaskbar(dialog_handle);\n\t\t} else if (SCODE_CODE(ErrorStatus) == ERROR_CANCELLED) {\n\t\t\tSendMessage(hProgress, PBM_SETSTATE, (WPARAM)PBST_PAUSED, 0);\n\t\t\tSetTaskbarProgressState(TASKBAR_PAUSED);\n\t\t\tPrintInfo(0, MSG_211);\n\t\t\tNotification(MB_ICONINFORMATION | MB_CLOSE, lmprintf(MSG_211), lmprintf(MSG_041));\n\t\t} else {\n\t\t\tSendMessage(hProgress, PBM_SETSTATE, (WPARAM)PBST_ERROR, 0);\n\t\t\tSetTaskbarProgressState(TASKBAR_ERROR);\n\t\t\tPrintInfo(0, MSG_212);\n\t\t\tMessageBeep(MB_ICONERROR);\n\t\t\tFlashTaskbar(dialog_handle);\n\t\t\tGetProcessSearch(0, 0x07, TRUE);\n\t\t\t// TODO: Fix/Improve this\n\t\t\tif (BlockingProcessList.Index > 0) {\n\t\t\t\tListDialog(lmprintf(MSG_042), lmprintf(MSG_055), BlockingProcessList.String, BlockingProcessList.Index);\n\t\t\t} else {\n\t\t\t\tif (WindowsVersion.Version >= WINDOWS_10) {\n\t\t\t\t\t// Try to detect if 'Controlled Folder Access' is enabled on Windows 10 or later. See also:\n\t\t\t\t\t// http://www.winhelponline.com/blog/use-controlled-folder-access-windows-10-windows-defender\n\t\t\t\t\tchar cmdline[256];\n\t\t\t\t\tstatic const char* ps_cmd[2] = {\n\t\t\t\t\t\t// Return 1 if the 'Get-MpPreference' PowerShell cmdlet exists\n\t\t\t\t\t\t\"If (Get-Command -Commandtype Function Get-MpPreference -ErrorAction SilentlyContinue) { Exit 1 } Else { Exit 0 }\",\n\t\t\t\t\t\t// Return 1 if Controlled Folder Access is enabled\n\t\t\t\t\t\t\"Exit (Get-MpPreference).EnableControlledFolderAccess\" };\n\t\t\t\t\tswitch (SCODE_CODE(ErrorStatus)) {\n\t\t\t\t\tcase ERROR_PARTITION_FAILURE:\n\t\t\t\t\tcase ERROR_WRITE_FAULT:\n\t\t\t\t\t\t// Find if PowerShell is available at its expected location\n\t\t\t\t\t\tstatic_sprintf(tmp, \"%s\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe\", system_dir);\n\t\t\t\t\t\tif (PathFileExistsU(tmp)) {\n\t\t\t\t\t\t\tfor (i = 0; i < ARRAYSIZE(ps_cmd); i++) {\n\t\t\t\t\t\t\t\t// Run the PowerShell commands\n\t\t\t\t\t\t\t\tstatic_sprintf(cmdline, \"%s -NonInteractive -NoProfile -Command %s\", tmp, ps_cmd[i]);\n\t\t\t\t\t\t\t\tif (RunCommand(cmdline, app_data_dir, TRUE) != 1)\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (i == ARRAYSIZE(ps_cmd)) {\n\t\t\t\t\t\t\t\tuprintf(\"\\r\\nWARNING: 'Controlled Folder Access' appears to be enabled on this system\");\n\t\t\t\t\t\t\t\tuprintf(\"You may need to disable this feature, or add an exception, for Rufus to to work...\\n\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (SCODE_CODE(ErrorStatus) == ERROR_NOT_READY) {\n\t\t\t\t\t// A port cycle usually helps with a device not ready\n\t\t\t\t\tint index = ComboBox_GetCurSel(hDeviceList);\n\t\t\t\t\tif (index >= 0) {\n\t\t\t\t\t\tuprintf(\"Device not ready → Trying to cycle port...\");\n\t\t\t\t\t\tCyclePort(index);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tNotification(MB_ICONERROR | MB_CLOSE, lmprintf(MSG_042), lmprintf(MSG_043, StrError(ErrorStatus, FALSE)));\n\t\t\t}\n\t\t}\n\t\tErrorStatus = 0;\n\t\tLastWriteError = 0;\n\t\treturn (INT_PTR)TRUE;\n\n\t}\n\treturn (INT_PTR)FALSE;\n}\n\nstatic void PrintUsage(char* appname)\n{\n\tchar fname[_MAX_FNAME];\n\n\t_splitpath(appname, NULL, NULL, fname, NULL);\n\tprintf(\"\\nUsage: %s [-x] [-g] [-h] [-f FILESYSTEM] [-i PATH] [-l LOCALE] [-w TIMEOUT]\\n\", fname);\n\tprintf(\"  -x, --extra-devs\\n\");\n\tprintf(\"     List extra devices, such as USB HDDs\\n\");\n\tprintf(\"  -g, --gui\\n\");\n\tprintf(\"     Start in GUI mode (disable the 'rufus.com' commandline hogger)\\n\");\n\tprintf(\"  -i PATH, --iso=PATH\\n\");\n\tprintf(\"     Select the ISO image pointed by PATH to be used on startup\\n\");\n\tprintf(\"  -l LOCALE, --locale=LOCALE\\n\");\n\tprintf(\"     Select the locale to be used on startup\\n\");\n\tprintf(\"  -f FILESYSTEM, --filesystem=FILESYSTEM\\n\");\n\tprintf(\"     Preselect the file system to be preferred when formatting\\n\");\n\tprintf(\"  -w TIMEOUT, --wait=TIMEOUT\\n\");\n\tprintf(\"     Wait TIMEOUT tens of seconds for the global application mutex to be released.\\n\");\n\tprintf(\"     Used when launching a newer version of \" APPLICATION_NAME \" from a running application.\\n\");\n\tprintf(\"  -h, --help\\n\");\n\tprintf(\"     This usage guide.\\n\");\n}\n\nstatic HANDLE SetHogger(void)\n{\n\tINPUT* input;\n\tBYTE* hog_data;\n\tDWORD hog_size, Size;\n\tHANDLE hogmutex = NULL, hFile = NULL;\n\tint i;\n\n\thog_data = GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_XT_HOGGER),\n\t\t_RT_RCDATA, &cmdline_hogger[2], &hog_size, FALSE);\n\tif (hog_data != NULL) {\n\t\t// Create our synchronisation mutex\n\t\thogmutex = CreateMutexA(NULL, TRUE, \"Global/Rufus_CmdLine\");\n\n\t\t// Extract the hogger resource\n\t\t_chdirU(cur_dir);\n\t\thFile = CreateFileA(&cmdline_hogger[2], GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ,\n\t\t\tNULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\n\t\tif (hFile != INVALID_HANDLE_VALUE) {\n\t\t\t// coverity[check_return]\n\t\t\tWriteFile(hFile, hog_data, hog_size, &Size, NULL);\n\t\t}\n\t\tsafe_closehandle(hFile);\n\n\t\t// Now launch the file from the commandline, by simulating keypresses\n\t\tinput = (INPUT*)calloc(strlen(cmdline_hogger) + 1, sizeof(INPUT));\n\t\tif (input != NULL) {\n\t\t\tfor (i = 0; i < (int)strlen(cmdline_hogger); i++) {\n\t\t\t\tinput[i].type = INPUT_KEYBOARD;\n\t\t\t\tinput[i].ki.dwFlags = KEYEVENTF_UNICODE;\n\t\t\t\tinput[i].ki.wScan = (wchar_t)cmdline_hogger[i];\n\t\t\t}\n\t\t\tinput[i].type = INPUT_KEYBOARD;\n\t\t\tinput[i].ki.wVk = VK_RETURN;\n\t\t\tSendInput(i + 1, input, sizeof(INPUT));\n\t\t\tfree(input);\n\t\t}\n\t}\n\tif (hogmutex != NULL)\n\t\tSleep(200);\t// Need to add a delay, otherwise we may get some printout before the hogger\n\treturn hogmutex;\n}\n\n// For delay-loaded DLLs, use LOAD_LIBRARY_SEARCH_SYSTEM32 to avoid DLL search order hijacking.\nFARPROC WINAPI dllDelayLoadHook(unsigned dliNotify, PDelayLoadInfo pdli)\n{\n\tif (dliNotify == dliNotePreLoadLibrary) {\n\t\t// Windows 7 without KB2533623 does not support the LOAD_LIBRARY_SEARCH_SYSTEM32 flag.\n\t\t// That is OK, because the delay load handler will interrupt the NULL return value\n\t\t// to mean that it should perform a normal LoadLibrary.\n\t\treturn (FARPROC)LoadLibraryExA(pdli->szDll, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);\n\t}\n\treturn NULL;\n}\n\n#if defined(_MSC_VER)\n// By default the Windows SDK headers have a `const` while MinGW does not.\nconst\n#endif\nPfnDliHook __pfnDliNotifyHook2 = dllDelayLoadHook;\n\n/*\n * Application Entrypoint\n */\n#if defined(_MSC_VER) && (_MSC_VER >= 1600)\nint WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd)\n#else\nint WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)\n#endif\n{\n\tconst char* rufus_loc = \"rufus.loc\";\n\tint i, opt, option_index = 0, argc = 0, si = 0, lcid = GetUserDefaultUILanguage();\n\tint wait_for_mutex = 0, forced_windows_version = 0;\n\tuint32_t wue_options;\n\tFILE* fd;\n\tBOOL attached_console = FALSE, external_loc_file = FALSE, lgp_set = FALSE, automount = TRUE;\n\tBOOL disable_hogger = FALSE, previous_enable_HDDs = FALSE, vc = IsRegistryNode(REGKEY_HKCU, vs_reg);\n\tBOOL alt_pressed = FALSE, alt_command = FALSE;\n\tBYTE *loc_data;\n\tDWORD loc_size, u = 0, size = sizeof(u);\n\tchar tmp_path[MAX_PATH] = \"\", loc_file[MAX_PATH] = \"\", ini_path[MAX_PATH] = \"\", ini_flags[] = \"rb\";\n\tchar *tmp, *locale_name = NULL, **argv = NULL;\n\twchar_t **wenv, **wargv;\n\tPF_TYPE_DECL(CDECL, int, __wgetmainargs, (int*, wchar_t***, wchar_t***, int, int*));\n\tHANDLE mutex = NULL, hogmutex = NULL, hFile = NULL;\n\tHWND hDlg = NULL;\n\tHDC hDC;\n\tMSG msg;\n\tstruct option long_options[] = {\n\t\t{\"extra-devs\", no_argument,       NULL, 'x'},\n\t\t{\"gui\",        no_argument,       NULL, 'g'},\n\t\t{\"help\",       no_argument,       NULL, 'h'},\n\t\t{\"iso\",        required_argument, NULL, 'i'},\n\t\t{\"locale\",     required_argument, NULL, 'l'},\n\t\t{\"filesystem\", required_argument, NULL, 'f'},\n\t\t{\"wait\",       required_argument, NULL, 'w'},\n\t\t{0, 0, NULL, 0}\n\t};\n\n\t// Disable loading system DLLs from the current directory (side-loading mitigation)\n\t// PS: You know that official MSDN documentation for SetDllDirectory() that explicitly\n\t// indicates that \"If the parameter is an empty string (\"\"), the call removes the current\n\t// directory from the default DLL search order\"? Yeah, that doesn't work. At all. And as\n\t// a matter of fact, Microsoft has now altered their doc to remove that part, though it\n\t// is still *currently* being mentioned in their doc for Dynamic-Link Library Security:\n\t// https://web.archive.org/web/20250206201109/https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-security\n\t// So, Microsoft currently offers NO WAY to easily disable the main vulnerability most\n\t// applications suffer from, which is the loading of bloody DLLs from the current/app\n\t// dir, even for executables, like Rufus, that are designed from the get go to NEVER EVER\n\t// rely on any DLLs there, and would like to DISABLE THIS UTTER BULLSHIT OF AN ENTIRELY\n\t// PREVENTABLE SECURITY RISK! The end result of all this is that we have to contend with\n\t// delay loading (*when* it actually works) or direct hooking (when it doesn't) and no\n\t// longer try to bother with a quick and easy side-loading fix that Microsoft has been\n\t// dangling as a lure, for years, but hasn't actually bothered to implement... \n\t// SetDllDirectoryA(\"\");\n\n\t// For libraries on the KnownDLLs list, the system will always load them from System32.\n\t// For other DLLs we link directly to, we can delay load the DLL and use a delay load\n\t// hook to load them from System32. Note that, for this to work, something like:\n\t// 'somelib.dll;%(DelayLoadDLLs)' must be added to the 'Delay Loaded Dlls' option of\n\t// the linker properties in Visual Studio... which means this won't work with MinGW.\n\t// For all other DLLs, use SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32),\n\t// though this *STILL* does not prevent the Windows default of looking for DLLs in the\n\t// current directories.\n\tSetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32);\n\n\tuprintf(\"*** \" APPLICATION_NAME \" init ***\\n\");\n\tits_a_me_mario = GetUserNameA((char*)(uintptr_t)&u, &size) && (u == 7104878);\n\t// coverity[pointless_string_compare]\n\tis_x86_64 = (strcmp(APPLICATION_ARCH, \"x64\") == 0);\n\n\t// Retrieve various app & system directories.\n\tif (GetAppDirectoryU(sizeof(app_dir), app_dir) == 0) {\n\t\tuprintf(\"Could not get application directory: %s\", WindowsErrorString());\n\t\tstatic_strcpy(app_dir, \".\\\\\");\n\t} else {\n\t\t// Microsoft has a bad habit of making some of its APIs (_chdir/_wchdir) break\n\t\t// when app_dir is a drive letter that doesn't have a trailing backslash. For\n\t\t// instance _chdir(\"F:\") does not change the directory, whereas _chdir(\"F:\\\\\")\n\t\t// does. So make sure we always have a trailing backslash.\n\t\tstatic_strcat(app_dir, \"\\\\\");\n\t}\n\n\t// In the wonderful world of Microsoft Windows, GetCurrentDirectory() may return the\n\t// directory where the application resides, instead of the real current directory\n\t// so we need another method to resolve the *ACTUAL* current directory.\n\tstatic_strcpy(cur_dir, \".\\\\\");\n\thFile = CreateFileU(cur_dir, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,\n\t\tFILE_FLAG_BACKUP_SEMANTICS, NULL);\n\tif ((hFile == INVALID_HANDLE_VALUE) ||\n\t\t(GetFinalPathNameByHandleU(hFile, cur_dir, sizeof(cur_dir), FILE_NAME_OPENED) == 0) ||\n\t\t((strstr(cur_dir, \"\\\\\\\\?\\\\\") != cur_dir) && (strstr(cur_dir, \"\\\\\\\\.\\\\\") != cur_dir))) {\n\t\tuprintf(\"Could not get current directory from '%s': %s\", cur_dir, WindowsErrorString());\n\t\tstatic_strcpy(cur_dir, \".\\\\\");\n\t} else {\n\t\t// Need to remove the '\\\\?\\' prefix and reappend the trailing '\\'\n\t\tstatic_strcpy(cur_dir, &cur_dir[4]);\n\t\tstatic_strcat(cur_dir, \"\\\\\");\n\t}\n\tsafe_closehandle(hFile);\n\n\t// Per documentation, the returned string ends with a backslash\n\tif (GetTempPathU(sizeof(temp_dir), temp_dir) == 0) {\n\t\tuprintf(\"Could not get temp directory: %s\", WindowsErrorString());\n\t\tstatic_strcpy(temp_dir, cur_dir);\n\t} else {\n\t\t// Some folks have found nothing better than configure their Windows installation to use\n\t\t// a symlink for their temp dir, and it so happens that the Windows WIM mounting facility,\n\t\t// which we need for applying the WUE options, can't handle symlinked directories. So we\n\t\t// *attempt* to resolve the actual symlinked temp dir for this super limited number of\n\t\t// users, with the hope that doing so is not going to break stuff elsewhere...\n\t\thFile = CreateFileU(temp_dir, GENERIC_READ, FILE_SHARE_READ, NULL,\n\t\t\tOPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);\n\t\t// GetFinalPathNameByHandle returns a UNC path, which should be prefixed by '\\\\?\\' or '\\\\.\\'\n\t\tif ((hFile == INVALID_HANDLE_VALUE) ||\n\t\t\t(GetFinalPathNameByHandleU(hFile, temp_dir, sizeof(temp_dir), FILE_NAME_OPENED) == 0) ||\n\t\t\t((strstr(temp_dir, \"\\\\\\\\?\\\\\") != temp_dir) && (strstr(temp_dir, \"\\\\\\\\.\\\\\") != temp_dir))) {\n\t\t\tuprintf(\"Could not get actual temp directory from '%s': %s\", temp_dir, WindowsErrorString());\n\t\t\tstatic_strcpy(temp_dir, cur_dir);\n\t\t} else {\n\t\t\t// Need to remove the '\\\\?\\' prefix or else we'll get issues with the Fido icon\n\t\t\tstatic_strcpy(temp_dir, &temp_dir[4]);\n\t\t\t// And me must re-append the '\\' that gets removed by GetFinalPathNameByHandle()\n\t\t\tstatic_strcat(temp_dir, \"\\\\\");\n\t\t}\n\t\tsafe_closehandle(hFile);\n\t}\n\tif (GetSystemDirectoryU(system_dir, sizeof(system_dir)) == 0) {\n\t\tuprintf(\"Could not get system directory: %s\", WindowsErrorString());\n\t\tstatic_strcpy(system_dir, \"C:\\\\Windows\\\\System32\");\n\t}\n\tif (!SHGetSpecialFolderPathU(NULL, app_data_dir, CSIDL_LOCAL_APPDATA, FALSE)) {\n\t\tuprintf(\"Could not get app data directory: %s\", WindowsErrorString());\n\t\tstatic_strcpy(app_data_dir, temp_dir);\n\t}\n\tif (!SHGetSpecialFolderPathU(NULL, user_dir, CSIDL_PROFILE, FALSE)) {\n\t\tuprintf(\"Could not get user directory: %s\", WindowsErrorString());\n\t\tstatic_strcpy(user_dir, temp_dir);\n\t}\n\t// Construct Sysnative ourselves as there is no GetSysnativeDirectory() call\n\t// By default (64bit app running on 64 bit OS or 32 bit app running on 32 bit OS)\n\t// Sysnative and System32 are the same\n\tstatic_strcpy(sysnative_dir, system_dir);\n\t// But if the app is 32 bit and the OS is 64 bit, Sysnative must differ from System32\n#if (!defined(_WIN64) && !defined(BUILD64))\n\t{\n\t\tBOOL is_WOW64 = FALSE;\n\t\tIsWow64Process(GetCurrentProcess(), &is_WOW64);\n\t\tif (is_WOW64) {\n\t\t\tif (GetSystemWindowsDirectoryU(sysnative_dir, sizeof(sysnative_dir)) == 0) {\n\t\t\t\tuprintf(\"Could not get Windows directory: %s\", WindowsErrorString());\n\t\t\t\tstatic_strcpy(sysnative_dir, \"C:\\\\Windows\");\n\t\t\t}\n\t\t\tstatic_strcat(sysnative_dir, \"\\\\Sysnative\");\n\t\t}\n\t}\n#endif\n\tuprintf(\"Cur dir: '%s'\", cur_dir);\n\tuprintf(\"App dir: '%s'\", app_dir);\n\tuprintf(\"Sys dir: '%s'\", sysnative_dir);\n\tuprintf(\"Usr dir: '%s'\", user_dir);\n\tuprintf(\"Dat dir: '%s'\", app_data_dir);\n\tuprintf(\"Tmp dir: '%s'\", temp_dir);\n\n\t// Look for a rufus.app file in the current app directory\n\t// Since Microsoft makes it downright impossible to pass an arg in the app manifest\n\t// and the automated VS2019 package building process doesn't like renaming the .exe\n\t// right under its nose (else we would use the same trick as for portable vs regular)\n\t// we use yet another workaround to detect if we are running the AppStore version...\n\tstatic_sprintf(tmp_path, \"%srufus.app\", app_dir);\n\tif (PathFileExistsU(tmp_path)) {\n\t\tappstore_version = TRUE;\n\t\tgoto skip_args_processing;\n\t}\n\n\t// We have to process the arguments before we acquire the lock and process the locale\n\tPF_INIT(__wgetmainargs, Msvcrt);\n\tif (pf__wgetmainargs != NULL) {\n\t\tBOOL list_params = FALSE;\n\t\tpf__wgetmainargs(&argc, &wargv, &wenv, 1, &si);\n\t\targv = (char**)calloc(argc, sizeof(char*));\n\t\tif (argv != NULL) {\n\t\t\t// Non getopt parameter check\n\t\t\tfor (i = 0; i < argc; i++) {\n\t\t\t\targv[i] = wchar_to_utf8(wargv[i]);\n\t\t\t\t// Check for \"/W\" (wait for mutex release for pre 1.3.3 versions)\n\t\t\t\tif (strcmp(argv[i], \"/W\") == 0)\n\t\t\t\t\twait_for_mutex = 150;\t// Try to acquire the mutex for 15 seconds\n\t\t\t\t// We need to find if we need to disable the hogger BEFORE we start\n\t\t\t\t// processing arguments with getopt, as we may want to print messages\n\t\t\t\t// on the commandline then, which the hogger makes more intuitive.\n\t\t\t\tif ((strcmp(argv[i], \"-g\") == 0) || (strcmp(argv[i], \"--gui\") == 0))\n\t\t\t\t\tdisable_hogger = TRUE;\n\t\t\t\t// Check for \"/InvokerPRAID\", which may *STUPIDLY* be added by Microsoft\n\t\t\t\t// when starting an app that was installed from the Windows store...\n\t\t\t\tif (stricmp(argv[i], \"/InvokerPRAID\") == 0) {\n\t\t\t\t\tappstore_version = TRUE;\n\t\t\t\t\tgoto skip_args_processing;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If our application name contains a 'p' (for \"portable\") create a 'rufus.ini'\n\t\t\t// NB: argv[0] is populated in the previous loop\n\t\t\ttmp = &argv[0][strlen(argv[0]) - 1];\n\t\t\twhile ((((uintptr_t)tmp) > ((uintptr_t)argv[0])) && (*tmp != '\\\\'))\n\t\t\t\ttmp--;\n\t\t\t// Need to take 'ALPHA' into account\n\t\t\tif ((strchr(tmp, 'p') != NULL) || ((strchr(tmp, 'P') != NULL) && (strchr(tmp, 'P')[1] != 'H')))\n\t\t\t\tini_flags[0] = 'a';\n\n\t\t\t// Now enable the hogger before processing the rest of the arguments.\n\t\t\t// Note that with POSIX shells (e.g. msys) we don't enable the hogger as it is not needed.\n\t\t\tif (!disable_hogger && getenv(\"SHELL\") == NULL) {\n\t\t\t\t// Reattach the console, if we were started from commandline\n\t\t\t\tif (AttachConsole(ATTACH_PARENT_PROCESS) != 0) {\n\t\t\t\t\tuprintf(\"Enabling console line hogger\");\n\t\t\t\t\tattached_console = TRUE;\n\t\t\t\t\tIGNORE_RETVAL(freopen(\"CONIN$\", \"r\", stdin));\n\t\t\t\t\tIGNORE_RETVAL(freopen(\"CONOUT$\", \"w\", stdout));\n\t\t\t\t\tIGNORE_RETVAL(freopen(\"CONOUT$\", \"w\", stderr));\n\t\t\t\t\t_flushall();\n\t\t\t\t\thogmutex = SetHogger();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile ((opt = getopt_long(argc, argv, \"ghxf:i:l:w:z:\", long_options, &option_index)) != EOF) {\n\t\t\t\tswitch (opt) {\n\t\t\t\tcase 'x':\n\t\t\t\t\tenable_HDDs = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'a':\n\t\t\t\tcase 'g':\n\t\t\t\t\t// No need to reprocess that option\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'i':\n\t\t\t\t\tsafe_free(image_path);\n\t\t\t\t\timage_path = calloc(1, MAX_PATH);\n\t\t\t\t\tif (image_path == NULL)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tIGNORE_RETVAL(GetFullPathNameU(optarg, MAX_PATH, image_path, NULL));\n\t\t\t\t\t// FILE_ATTRIBUTE_DIRECTORY is set for both dir and access error\n\t\t\t\t\tif (GetFileAttributesU(image_path) & FILE_ATTRIBUTE_DIRECTORY) {\n\t\t\t\t\t\tprintf(\"Could not find image '%s'\\n\", image_path);\n\t\t\t\t\t\tsafe_free(image_path);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\timg_provided = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'l':\n\t\t\t\t\tif (isdigitU(optarg[0])) {\n\t\t\t\t\t\tlcid = (int)strtol(optarg, NULL, 0);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsafe_free(locale_name);\n\t\t\t\t\t\tlocale_name = safe_strdup(optarg);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'f':\n\t\t\t\t\tif (isdigitU(optarg[0])) {\n\t\t\t\t\t\tpreselected_fs = (int)strtol(optarg, NULL, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (i = 0; i < ARRAYSIZE(FileSystemLabel); i++) {\n\t\t\t\t\t\t\tif (safe_stricmp(optarg, FileSystemLabel[i]) == 0) {\n\t\t\t\t\t\t\t\tpreselected_fs = i;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ((preselected_fs < FS_UNKNOWN) || (preselected_fs >= FS_MAX))\n\t\t\t\t\t\tpreselected_fs = FS_UNKNOWN;\n\t\t\t\t\tselected_fs = preselected_fs;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w':\n\t\t\t\t\twait_for_mutex = atoi(optarg);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'h':\n\t\t\t\t\tPrintUsage(argv[0]);\n\t\t\t\t\tgoto out;\n\t\t\t\tcase 'z':\n\t\t\t\t\tforced_windows_version = (int)strtol(optarg, NULL, 16);\n\t\t\t\t\tbreak;\n\t\t\t\t// getopt_long returns '?' for any option it doesn't recognize\n\t\t\t\tdefault:\n\t\t\t\t\tlist_params = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (list_params) {\n\t\t\t\tuprintf(\"Command line arguments:\");\n\t\t\t\tfor (i = 1; i < argc; i++)\n\t\t\t\t\t// argv[i] may contain a '%' so don't feed it as a naked format string.\n\t\t\t\t\tuprintf(\"%s\", argv[i]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tuprintf(\"Could not access UTF-16 args\");\n\t}\n\nskip_args_processing:\n\tif (appstore_version)\n\t\tuprintf(\"AppStore version detected\");\n\n\t// Look for a .ini file in the current app directory\n\tstatic_sprintf(ini_path, \"%srufus.ini\", app_dir);\n\tfd = fopenU(ini_path, ini_flags);\t// Will create the file if portable mode is requested\n#if !defined(ALPHA)\n\t// Using the string directly in safe_strcmp() would call GetSignatureName() twice\n\ttmp = GetSignatureName(NULL, NULL, NULL, FALSE);\n\tvc |= (safe_strcmp(tmp, cert_name[0]) == 0);\n#else\n\t// So as not to multiply user prompts, as well as officialize our own GitHub builds,\n\t// we sign ALPHAs using disposable (non Authenticode) self-signed credentials.\n\tstatic const uint8_t github_thumbprint[SHA1_HASHSIZE] =\n\t{ 0xc9, 0x00, 0x1c, 0x67, 0x25, 0x16, 0x83, 0x2b, 0x1a, 0x61, 0xf4, 0x5f, 0x1a, 0x26, 0xd5, 0x76, 0xda, 0xab, 0x06, 0xdf };\n\tuint8_t thumbprint[SHA1_HASHSIZE] = { 0 };\n\ttmp = GetSignatureName(NULL, NULL, thumbprint, FALSE);\n\tvc |= (safe_strcmp(tmp, \"Rufus - GitHub Official Build\") == 0) && (memcmp(thumbprint, github_thumbprint, SHA1_HASHSIZE) == 0);\n#endif\n\tif (fd != NULL) {\n\t\tini_file = ini_path;\n\t\t// In portable mode, use the app directory for all local storage\n\t\tstatic_strcpy(app_data_dir, app_dir);\n\t\tfclose(fd);\n\t}\n\tuprintf(\"Will use settings from %s\", (ini_file != NULL) ? \"INI file\" : \"registry\");\n\n\t// Use the locale specified by the settings, if any\n\ttmp = ReadSettingStr(SETTING_LOCALE);\n\tif (tmp[0] != 0) {\n\t\tlocale_name = safe_strdup(tmp);\n\t\tuprintf(\"found locale '%s'\", locale_name);\n\t}\n\n\t// Restore user-saved settings\n\tadvanced_mode_device = ReadSettingBool(SETTING_ADVANCED_MODE_DEVICE);\n\tadvanced_mode_format = ReadSettingBool(SETTING_ADVANCED_MODE_FORMAT);\n\tpreserve_timestamps = ReadSettingBool(SETTING_PRESERVE_TIMESTAMPS);\n\tuse_fake_units = !ReadSettingBool(SETTING_USE_PROPER_SIZE_UNITS);\n\tis_vds_available = IsVdsAvailable(FALSE);\n\tuse_vds = ReadSettingBool(SETTING_USE_VDS) && is_vds_available;\n\tusb_debug = ReadSettingBool(SETTING_ENABLE_USB_DEBUG);\n\tcdio_loglevel_default = usb_debug ? CDIO_LOG_INFO : CDIO_LOG_WARN;\n\tuse_rufus_mbr = !ReadSettingBool(SETTING_DISABLE_RUFUS_MBR);\n//\tvalidate_md5sum = ReadSettingBool(SETTING_ENABLE_RUNTIME_VALIDATION);\n\tdetect_fakes = !ReadSettingBool(SETTING_DISABLE_FAKE_DRIVES_CHECK);\n\tallow_dual_uefi_bios = ReadSettingBool(SETTING_ENABLE_WIN_DUAL_EFI_BIOS);\n\tforce_large_fat32 = ReadSettingBool(SETTING_FORCE_LARGE_FAT32_FORMAT);\n\tenable_vmdk = ReadSettingBool(SETTING_ENABLE_VMDK_DETECTION);\n\tenable_file_indexing = ReadSettingBool(SETTING_ENABLE_FILE_INDEXING);\n\tenable_VHDs = !ReadSettingBool(SETTING_DISABLE_VHDS);\n\tenable_extra_hashes = ReadSettingBool(SETTING_ENABLE_EXTRA_HASHES);\n\texpert_mode = ReadSettingBool(SETTING_EXPERT_MODE);\n\tignore_boot_marker = ReadSettingBool(SETTING_IGNORE_BOOT_MARKER);\n\tpersistent_log = ReadSettingBool(SETTING_PERSISTENT_LOG);\n\tsave_image_type = ReadSettingStr(SETTING_PREFERRED_SAVE_IMAGE_TYPE);\n\t// This restores the Windows User Experience/unattend.xml mask from the saved user\n\t// settings, and is designed to work even if we add new options later.\n\twue_options = ReadSetting32(SETTING_WUE_OPTIONS);\n\tif ((wue_options >> 16) != 0) {\n\t\tuint32_t mask = wue_options >> 16;\n\t\tunattend_xml_mask &= ~mask;\n\t\tunattend_xml_mask |= (wue_options & mask);\n\t}\n\t// We want above normal priority by default, so we offset the value.\n\tdefault_thread_priority = ReadSetting32(SETTING_DEFAULT_THREAD_PRIORITY) + THREAD_PRIORITY_ABOVE_NORMAL;\n\n\t// Initialize the global scaling, in case we need it before we initialize the dialog\n\thDC = GetDC(NULL);\n\tfScale = GetDeviceCaps(hDC, LOGPIXELSX) / 96.0f;\n\tsafe_release_dc(NULL, hDC);\n\n\t// Init localization\n\tinit_localization();\n\n\t// Seek for a loc file in the application directory\n\tstatic_sprintf(loc_file, \"%s%s\", app_dir, rufus_loc);\n\tif (GetFileAttributesU(loc_file) == INVALID_FILE_ATTRIBUTES) {\n\t\tuprintf(\"loc file not found in current directory - embedded one will be used\");\n\n\t\tloc_data = (BYTE*)GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_LC_RUFUS_LOC), _RT_RCDATA, \"embedded.loc\", &loc_size, FALSE);\n\t\tif ( (GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, loc_file) == 0) || (loc_file[0] == 0) ) {\n\t\t\t// If we don't have a working temp API, forget it\n\t\t\tuprintf(\"FATAL: Unable to create temp loc file: %s\", WindowsErrorString());\n\t\t\tMessageBoxA(NULL, \"Unable to create temporary localization file. This application will now exit.\",\n\t\t\t\t\"Fatal error\", MB_ICONERROR | MB_SYSTEMMODAL);\n\t\t\tgoto out;\n\t\t}\n\n\t\thFile = CreateFileU(loc_file, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ,\n\t\t\tNULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\n\t\tif ((hFile == INVALID_HANDLE_VALUE) || (!WriteFileWithRetry(hFile, loc_data, loc_size, &size, WRITE_RETRIES))) {\n\t\t\tuprintf(\"FATAL: Unable to extract loc file '%s': %s\", loc_file, WindowsErrorString());\n\t\t\tsafe_closehandle(hFile);\n\t\t\tMessageBoxA(NULL, \"Unable to extract localization file. This application will now exit.\",\n\t\t\t\t\"Fatal error\", MB_ICONERROR | MB_SYSTEMMODAL);\n\t\t\tgoto out;\n\t\t}\n\t\tuprintf(\"localization: extracted data to '%s'\", loc_file);\n\t\tsafe_closehandle(hFile);\n\t} else {\n\t\texternal_loc_file = TRUE;\n\t\t// We do want to report if an external loc file is being used, in the UI log\n\t\tubprintf(\"Using external loc file '%s'\", loc_file);\n\t}\n\n\tif ( (!get_supported_locales(loc_file))\n\t  || ((selected_locale = ((locale_name == NULL) ?\n\t\t  get_locale_from_lcid(lcid, TRUE) : get_locale_from_name(locale_name, TRUE))) == NULL) ) {\n\t\tuprintf(\"FATAL: Could not access locale!\");\n\t\tMessageBoxA(NULL, \"The locale data is missing or invalid. This application will now exit.\",\n\t\t\t\"Fatal error\", MB_ICONERROR | MB_SYSTEMMODAL);\n\t\tgoto out;\n\t}\n\tselected_langid = get_language_id(selected_locale);\n\n\t// Set the Windows version\n\tGetWindowsVersion(&WindowsVersion);\n\t// Force a version if specified as parameter, but without allowing folks running\n\t// a version of Windows we no longer support to use the option as a bypass!\n\tif (WindowsVersion.Version > WINDOWS_7 && forced_windows_version != 0)\n\t\tWindowsVersion.Version = forced_windows_version;\n\n\t// ...and nothing of value was lost\n\tif (WindowsVersion.Version <= WINDOWS_7) {\n\t\t// Load the translation before we print the error\n\t\tget_loc_data_file(loc_file, selected_locale);\n\t\tright_to_left_mode = ((selected_locale->ctrl_id) & LOC_RIGHT_TO_LEFT);\n\t\t// Set MB_SYSTEMMODAL to prevent Far Manager from stealing focus...\n\t\tMessageBoxExU(NULL, lmprintf(MSG_294,\n\t\t\t\t(WindowsVersion.Version == WINDOWS_7) ? 3 : 2,\n\t\t\t\t(WindowsVersion.Version == WINDOWS_7) ? 22 : 18),\n\t\t\tlmprintf(MSG_293), MB_ICONERROR | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid);\n\t\tgoto out;\n\t}\n\n\t// This is needed as there appears to be a *FLAW* in Windows allowing the app to run unelevated with some\n\t// weirdly configured user accounts, even as we explicitly set 'requireAdministrator' in the manifest...\n\tif (!IsCurrentProcessElevated()) {\n\t\tuprintf(\"FATAL: No administrative privileges!\");\n\t\t// Load the translation before we print the error\n\t\tget_loc_data_file(loc_file, selected_locale);\n\t\tright_to_left_mode = ((selected_locale->ctrl_id) & LOC_RIGHT_TO_LEFT);\n\t\tMessageBoxExU(NULL, lmprintf(MSG_289), lmprintf(MSG_288), MB_ICONERROR | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid);\n\t\tgoto out;\n\t}\n\n\t// Prevent 2 applications from running at the same time, unless \"/W\" is passed as an option\n\t// in which case we wait for the mutex to be relinquished\n\tif ((safe_strlen(lpCmdLine) == 2) && (lpCmdLine[0] == '/') && (lpCmdLine[1] == 'W'))\n\t\twait_for_mutex = 150;\t\t// Try to acquire the mutex for 15 seconds\n\tmutex = CreateMutexA(NULL, TRUE, \"Global/\" APPLICATION_NAME);\n\tfor (;(wait_for_mutex>0) && (mutex != NULL) && (GetLastError() == ERROR_ALREADY_EXISTS); wait_for_mutex--) {\n\t\tCloseHandle(mutex);\n\t\tSleep(100);\n\t\tmutex = CreateMutexA(NULL, TRUE, \"Global/\" APPLICATION_NAME);\n\t}\n\tif ((mutex == NULL) || (GetLastError() == ERROR_ALREADY_EXISTS)) {\n\t\t// Load the translation before we print the error\n\t\tget_loc_data_file(loc_file, selected_locale);\n\t\tright_to_left_mode = ((selected_locale->ctrl_id) & LOC_RIGHT_TO_LEFT);\n\t\t// Set MB_SYSTEMMODAL to prevent Far Manager from stealing focus...\n\t\tMessageBoxExU(NULL, lmprintf(MSG_002), lmprintf(MSG_001),\n\t\t\tMB_ICONERROR | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid);\n\t\tgoto out;\n\t}\n\n\t// Save instance of the application for further reference\n\thMainInstance = hInstance;\n\n\t// Initialize COM for folder selection\n\tIGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));\n\n\t// Some dialogs have Rich Edit controls and won't display without this\n\tif (GetLibraryHandle(\"Riched20\") == NULL)\n\t\tuprintf(\"Could not load RichEdit library - some dialogs may not display: %s\", WindowsErrorString());\n\n\t// Increase the application privileges (SE_DEBUG_PRIVILEGE), so that we can report\n\t// the Windows Services preventing access to the disk or volume we want to format.\n\tEnablePrivileges();\n\n\t// We use local group policies rather than direct registry manipulation\n\t// 0x9e disables removable and fixed drive notifications\n\tlgp_set = SetLGP(FALSE, &existing_key, ep_reg, \"NoDriveTypeAutorun\", 0x9e);\n\n\t// Re-enable AutoMount if needed\n\tif (!GetAutoMount(&automount)) {\n\t\tuprintf(\"Could not get AutoMount status\");\n\t\tautomount = TRUE;\t// So that we don't try to change its status on exit\n\t} else if (!automount) {\n\t\tuprintf(\"AutoMount was detected as disabled - temporarily re-enabling it\");\n\t\tif (!SetAutoMount(TRUE))\n\t\t\tuprintf(\"Failed to enable AutoMount\");\n\t}\n\n\t// Detect CPU acceleration for SHA-1/SHA-256\n\tcpu_has_sha1_accel = DetectSHA1Acceleration();\n\tcpu_has_sha256_accel = DetectSHA256Acceleration();\n\t// FFU support started with Windows 10 1709 (through FfuProvider.dll)\n\tstatic_sprintf(tmp_path, \"%s\\\\dism\\\\FfuProvider.dll\", sysnative_dir);\n\thas_ffu_support = (_accessU(tmp_path, 0) == 0);\n\nrelaunch:\n\tubprintf(\"Localization set to '%s'\", selected_locale->txt[0]);\n\tright_to_left_mode = ((selected_locale->ctrl_id) & LOC_RIGHT_TO_LEFT);\n\t// We always launch with the image options displaying\n\timage_options = IMOP_WINTOGO;\n\timage_option_txt[0] = 0;\n\tselect_index = 0;\n\tsafe_free(fido_url);\n\tSetProcessDefaultLayout(right_to_left_mode ? LAYOUT_RTL : 0);\n\tif (get_loc_data_file(loc_file, selected_locale))\n\t\tWriteSettingStr(SETTING_LOCALE, selected_locale->txt[0]);\n\n\tif (!vc) {\n\t\tif (MessageBoxExU(NULL, lmprintf(MSG_296), lmprintf(MSG_295),\n\t\t\tMB_YESNO | MB_ICONWARNING | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid) != IDYES)\n\t\t\tgoto out;\n\t\tvc = TRUE;\n\t}\n\n\t/*\n\t * Create the main Window\n\t */\n\tif (hDlg != NULL)\n\t\t// Make sure any previous dialog is destroyed (e.g. when switching languages)\n\t\tDestroyWindow(hDlg);\n\thDlg = MyCreateDialog(hInstance, IDD_DIALOG, NULL, MainCallback);\n\tif (hDlg == NULL) {\n\t\tMessageBoxExU(NULL, \"Could not create Window\", \"DialogBox failure\",\n\t\t\tMB_OK | MB_ICONERROR | MB_IS_RTL | MB_SYSTEMMODAL, selected_langid);\n\t\tgoto out;\n\t}\n\tif ((relaunch_rc.left > -65536) && (relaunch_rc.top > -65536))\n\t\tSetWindowPos(hDlg, HWND_TOP, relaunch_rc.left, relaunch_rc.top, 0, 0, SWP_NOSIZE);\n\n\t// Enable drag-n-drop through the message filter\n\tChangeWindowMessageFilterEx(hDlg, WM_DROPFILES, MSGFLT_ADD, NULL);\n\tChangeWindowMessageFilterEx(hDlg, WM_COPYDATA, MSGFLT_ADD, NULL);\n\t// CopyGlobalData is needed since we are running elevated\n\tChangeWindowMessageFilterEx(hDlg, WM_COPYGLOBALDATA, MSGFLT_ADD, NULL);\n\n\t// Set the hook to automatically close Windows' \"You need to format the disk in drive...\" prompt\n\tSetAlertPromptMessages();\n\tif (!SetAlertPromptHook())\n\t\tuprintf(\"WARNING: Could not set alert prompt hook\");\n\n\tShowWindow(hDlg, SW_SHOWNORMAL);\n\tUpdateWindow(hDlg);\n\n\t// Do our own event processing and process \"magic\" commands\n\twhile(GetMessage(&msg, NULL, 0, 0)) {\n\t\tstatic BOOL ctrl_without_focus = FALSE;\n\t\tBOOL no_focus = (msg.message == WM_SYSKEYDOWN) && !(msg.lParam & 0x20000000);\n\t\t// ******************************\n\t\t// .,ABCDEFGHIJKLMNOPQRSTUVWXYZ+-\n\n\t\t// Sigh... The things one need to do to detect standalone use of the 'Alt' key.\n\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam != VK_MENU))\n\t\t\talt_command = TRUE;\n\t\telse if (GetKeyState(VK_MENU) & 0x8000)\n\t\t\talt_pressed = TRUE;\n\n\t\t// Ctrl-A => Select the log data\n\t\tif ((IsWindowVisible(hLogDialog)) && (GetKeyState(VK_CONTROL) & 0x8000) &&\n\t\t\t(msg.message == WM_KEYDOWN) && (msg.wParam == 'A')) {\n\t\t\t// Might also need ES_NOHIDESEL property if you want to select when not active\n\t\t\tEdit_SetSel(hLog, 0, -1);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Detecting Ctrl combination keypress while an operation is in progress is a super-mess\n\t\t// because Windows considers that our dialog doesn't have keyboard focus (WHYYYYYY?!?!?)\n\t\t// and therefore first sends a WM_SYSKEYDOWN (i.e. the message that is supposed to tell\n\t\t// you that Alt is being pressed, because why not also use it for a COMPLETELY DIFFERENT\n\t\t// FRIGGING KEY!!!) with bit 29 of msg.lParam cleared, along with the code for the Ctrl\n\t\t// key and *THEN* a subsequent message (still using WM_SYSKEYDOWN without Alt) with the\n\t\t// other key. So we need to detect both the messages in sequence...\n\t\tif (no_focus && (msg.wParam == VK_CONTROL))\n\t\t\tctrl_without_focus = op_in_progress;\n\n\t\t// Ctrl-L => Open/Close the log\n\t\tif ((ctrl_without_focus || ((GetKeyState(VK_CONTROL) & 0x8000) && (msg.message == WM_KEYDOWN)))\n\t\t\t&& (msg.wParam == 'L')) {\n\t\t\tctrl_without_focus = FALSE;\n\t\t\tSendMessage(hMainDialog, WM_COMMAND, IDC_LOG, 0);\n\t\t\tcontinue;\n\t\t}\n#if defined(_DEBUG) || defined(TEST) || defined(ALPHA)\nextern int TestHashes(void);\n\t\t// Ctrl-T => Alternate Test mode that doesn't require a full rebuild\n\t\tif ((ctrl_without_focus || ((GetKeyState(VK_CONTROL) & 0x8000) && (msg.message == WM_KEYDOWN)))\n\t\t\t&& (msg.wParam == 'T')) {\n\t\t\tTestHashes();\n\t\t\tcontinue;\n\t\t}\n#endif\n\t\t// Ctrl-P => Persistent log\n\t\tif ((ctrl_without_focus || ((GetKeyState(VK_CONTROL) & 0x8000) && (msg.message == WM_KEYDOWN)))\n\t\t\t&& (msg.wParam == 'P')) {\n\t\t\tpersistent_log = !persistent_log;\n\t\t\tWriteSettingBool(SETTING_PERSISTENT_LOG, persistent_log);\n\t\t\tPrintStatusTimeout(lmprintf(MSG_336), persistent_log);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (no_focus && (msg.wParam != VK_CONTROL))\n\t\t\tctrl_without_focus = FALSE;\n\n\t\tif (no_focus)\n\t\t\tcontinue;\n\n\t\t// Alt +/- => Increase or decrease thread priority for format/file-copy operations\n\t\tif ((msg.message == WM_SYSKEYDOWN) && ((msg.wParam == VK_OEM_PLUS) || (msg.wParam == VK_OEM_MINUS) ||\n\t\t\t(msg.wParam == VK_ADD) || (msg.wParam == VK_SUBTRACT))) {\n\t\t\tint delta = ((msg.wParam == VK_OEM_PLUS) || (msg.wParam == VK_ADD)) ? +1 : -1;\n\t\t\tif (((delta == +1) && (default_thread_priority < THREAD_PRIORITY_HIGHEST)) ||\n\t\t\t\t((delta == -1) && (default_thread_priority > THREAD_PRIORITY_LOWEST))) {\n\t\t\t\tdefault_thread_priority += delta;\n\t\t\t\tWriteSetting32(SETTING_DEFAULT_THREAD_PRIORITY, default_thread_priority - THREAD_PRIORITY_ABOVE_NORMAL);\n\t\t\t\tif (format_thread != NULL)\n\t\t\t\t\tSetThreadPriority(format_thread, default_thread_priority);\n\t\t\t}\n\t\t\tPrintStatus(STATUS_MSG_TIMEOUT, MSG_318, default_thread_priority);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// The following cheat modes should not be enacted when an operation is in progress\n\t\tif (!op_in_progress) {\n\t\t\t// Alt-. => Enable USB enumeration debug\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == VK_OEM_PERIOD)) {\n\t\t\t\tusb_debug = !usb_debug;\n\t\t\t\tcdio_loglevel_default = usb_debug ? CDIO_LOG_INFO : CDIO_LOG_WARN;\n\t\t\t\tWriteSettingBool(SETTING_ENABLE_USB_DEBUG, usb_debug);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_270), usb_debug);\n\t\t\t\tGetDevices(0);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-, => Disable physical drive locking\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == VK_OEM_COMMA)) {\n\t\t\t\tlock_drive = !lock_drive;\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_282), lock_drive);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-A => Toggle use of Rufus MBR for Windows boot\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'A')) {\n\t\t\t\tuse_rufus_mbr = !use_rufus_mbr;\n\t\t\t\tWriteSettingBool(SETTING_DISABLE_RUFUS_MBR, !use_rufus_mbr);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_349), use_rufus_mbr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-B => Toggle fake drive detection during bad blocks check\n\t\t\t// By default, Rufus will check for fake USB flash drives that mistakenly present\n\t\t\t// more capacity than they already have by looping over the flash. This check which\n\t\t\t// is enabled by default is performed by writing the block number sequence and reading\n\t\t\t// it back during the bad block check.\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'B')) {\n\t\t\t\tdetect_fakes = !detect_fakes;\n\t\t\t\tWriteSettingBool(SETTING_DISABLE_FAKE_DRIVES_CHECK, !detect_fakes);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_256), detect_fakes);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-C => Cycle USB port for currently selected device\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'C')) {\n\t\t\t\tint index = ComboBox_GetCurSel(hDeviceList);\n\t\t\t\tif (index >= 0)\n\t\t\t\t\tCyclePort(index);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-D => Delete the subdirectory where Rufus keeps its files\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'D')) {\n\t\t\t\tstatic_sprintf(tmp_path, \"%s\\\\%s\", app_data_dir, FILES_DIR);\n\t\t\t\tPrintStatusDebug(STATUS_MSG_TIMEOUT, MSG_264, tmp_path);\n\t\t\t\tSHDeleteDirectoryExU(NULL, tmp_path, FOF_NO_UI);\n\t\t\t\tuser_deleted_rufus_dir = TRUE;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-E => Enhanced installation mode (allow dual UEFI/BIOS mode and FAT32 for Windows)\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'E')) {\n\t\t\t\tallow_dual_uefi_bios = !allow_dual_uefi_bios;\n\t\t\t\tWriteSettingBool(SETTING_ENABLE_WIN_DUAL_EFI_BIOS, allow_dual_uefi_bios);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_266), allow_dual_uefi_bios);\n\t\t\t\tSetPartitionSchemeAndTargetSystem(FALSE);\n\t\t\t\tSetFileSystemAndClusterSize(NULL);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-F => Toggle detection of USB HDDs\n\t\t\t// By default Rufus does not list USB HDDs. This is a safety feature aimed at avoiding\n\t\t\t// unintentional formatting of backup drives instead of USB keys.\n\t\t\t// When enabled, Rufus will list and allow the formatting of USB HDDs.\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'F')) {\n\t\t\t\tenable_HDDs = !enable_HDDs;\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_253), enable_HDDs);\n\t\t\t\tGetDevices(0);\n\t\t\t\tCheckDlgButton(hMainDialog, IDC_LIST_USB_HDD, enable_HDDs ? BST_CHECKED : BST_UNCHECKED);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-G => Toggle detection of Virtual Disks\n\t\t\t// By default Rufus list Virtual Disks but some people use them for backup.\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'G')) {\n\t\t\t\tenable_VHDs = !enable_VHDs;\n\t\t\t\tWriteSettingBool(SETTING_DISABLE_VHDS, !enable_VHDs);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_308), enable_VHDs);\n\t\t\t\tGetDevices(0);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-H => Toggle computation of SHA512 digest\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'H')) {\n\t\t\t\tenable_extra_hashes = !enable_extra_hashes;\n\t\t\t\tWriteSettingBool(SETTING_ENABLE_EXTRA_HASHES, enable_extra_hashes);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_312), enable_extra_hashes);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-I => Toggle ISO support\n\t\t\t// This is useful if you have an ISOHybrid image and you want to force Rufus to use\n\t\t\t// DD-mode when writing the data.\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'I')) {\n\t\t\t\tenable_iso = !enable_iso;\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_262), enable_iso);\n\t\t\t\tif (image_path != NULL) {\n\t\t\t\t\timg_provided = TRUE;\n\t\t\t\t\tdont_display_image_name = TRUE;\n\t\t\t\t\tSendMessage(hDlg, WM_COMMAND, IDC_SELECT, 0);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt J => Toggle Joliet support for ISO9660 images\n\t\t\t// Some ISOs (Ubuntu) have Joliet extensions but expect applications not to use them,\n\t\t\t// due to their reliance on filenames that are > 64 chars (the Joliet max length for\n\t\t\t// a file name). This option allows users to ignore Joliet when using such images.\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'J')) {\n\t\t\t\tenable_joliet = !enable_joliet;\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_257), enable_joliet);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt K => Toggle Rock Ridge support for ISO9660 images\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'K')) {\n\t\t\t\tenable_rockridge = !enable_rockridge;\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_258), enable_rockridge);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-L => Force Large FAT32 format to be used on < 32 GB drives\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'L')) {\n\t\t\t\tforce_large_fat32 = !force_large_fat32;\n\t\t\t\tWriteSettingBool(SETTING_FORCE_LARGE_FAT32_FORMAT, force_large_fat32);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_254), force_large_fat32);\n\t\t\t\tGetDevices(0);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-M => Toggle the check for the 0x55 0xAA boot marker at offset 0x1fe.\n\t\t\t// This means that Rufus treats anything selected as a writeable DD image.\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'M')) {\n\t\t\t\tignore_boot_marker = !ignore_boot_marker;\n\t\t\t\tWriteSettingBool(SETTING_IGNORE_BOOT_MARKER, ignore_boot_marker);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_319), ignore_boot_marker);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt N => Enable NTFS compression\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'N')) {\n\t\t\t\tenable_ntfs_compression = !enable_ntfs_compression;\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_260), enable_ntfs_compression);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-O => Save from Optical drive to ISO\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'O')) {\n\t\t\t\tOpticalDiscSaveImage();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-P => Toggle GPT ESP to and from Basic Data type (Windows 10 or later)\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'P')) {\n\t\t\t\tint index = ComboBox_GetCurSel(hDeviceList);\n\t\t\t\tDWORD DeviceNum = (DWORD)ComboBox_GetItemData(hDeviceList, index);\n\t\t\t\tif (ToggleEsp(DeviceNum, 0))\n\t\t\t\t\tCyclePort(index);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-Q => Enable file indexing (for file systems that support it)\n\t\t\t// For multiple reasons, file indexing is disabled by default\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'Q')) {\n\t\t\t\tenable_file_indexing = !enable_file_indexing;\n\t\t\t\tWriteSettingBool(SETTING_ENABLE_FILE_INDEXING, enable_file_indexing);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_290), enable_file_indexing);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-R => Remove all the registry keys that may have been created by Rufus\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'R')) {\n\t\t\t\tPrintStatus(STATUS_MSG_TIMEOUT, DeleteRegistryKey(REGKEY_HKCU, COMPANY_NAME \"\\\\\" APPLICATION_NAME) ? MSG_248 : MSG_249);\n\t\t\t\t// Also try to delete the upper key (company name) if it's empty (don't care about the result)\n\t\t\t\tDeleteRegistryKey(REGKEY_HKCU, COMPANY_NAME);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-S => Disable size limit for ISOs\n\t\t\t// By default, Rufus will not copy ISOs that are larger than in size than\n\t\t\t// the target USB drive. If this is enabled, the size check is disabled.\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'S')) {\n\t\t\t\tsize_check = !size_check;\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_252), size_check);\n\t\t\t\tGetDevices(0);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-T => Preserve timestamps when extracting ISO files\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'T')) {\n\t\t\t\tpreserve_timestamps = !preserve_timestamps;\n\t\t\t\tWriteSettingBool(SETTING_PRESERVE_TIMESTAMPS, preserve_timestamps);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_269), preserve_timestamps);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-U => Use PROPER size units, instead of this whole Kibi/Gibi nonsense\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'U')) {\n\t\t\t\tuse_fake_units = !use_fake_units;\n\t\t\t\tWriteSettingBool(SETTING_USE_PROPER_SIZE_UNITS, !use_fake_units);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_263), !use_fake_units);\n\t\t\t\tGetDevices(0);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-V => Use VDS facilities for formatting\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'V')) {\n\t\t\t\tif (is_vds_available) {\n\t\t\t\t\tuse_vds = !use_vds;\n\t\t\t\t\tSetFileSystemAndClusterSize(NULL);\n\t\t\t\t\tWriteSettingBool(SETTING_USE_VDS, use_vds);\n\t\t\t\t\tPrintStatusTimeout(\"VDS\", use_vds);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-W => Enable VMWare disk detection\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'W')) {\n\t\t\t\tenable_vmdk = !enable_vmdk;\n\t\t\t\tWriteSettingBool(SETTING_ENABLE_VMDK_DETECTION, enable_vmdk);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_265), enable_vmdk);\n\t\t\t\tGetDevices(0);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-X => Delete the NoDriveTypeAutorun key on exit (useful if the app crashed)\n\t\t\t// This key is used to disable Windows popup messages when an USB drive is plugged in.\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'X')) {\n\t\t\t\tPrintStatus(2000, MSG_255);\n\t\t\t\texisting_key = FALSE;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt Y => Force the update check to be successful\n\t\t\t// This will set the reported current version of Rufus to 0.0.0.0 when performing an update\n\t\t\t// check, so that it always succeeds. This is useful for translators.\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'Y')) {\n\t\t\t\tforce_update = (force_update > 0) ? 0 : 1;\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_259), force_update);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Alt-Z => Zero the drive\n\t\t\tif ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'Z')) {\n\t\t\t\tzero_drive = TRUE;\n\t\t\t\tfast_zeroing = FALSE;\n\t\t\t\t// Simulate a button click for Start\n\t\t\t\tPostMessage(hDlg, WM_COMMAND, (WPARAM)IDC_START, 0);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Ctrl-Alt-Z => Zero the drive while trying to skip empty blocks\n\t\t\tif ((msg.message == WM_KEYDOWN) && (msg.wParam == 'Z') &&\n\t\t\t\t(GetKeyState(VK_CONTROL) & 0x8000) && (GetKeyState(VK_MENU) & 0x8000)) {\n\t\t\t\tzero_drive = TRUE;\n\t\t\t\tfast_zeroing = TRUE;\n\t\t\t\t// Simulate a button click for Start\n\t\t\t\tPostMessage(hDlg, WM_COMMAND, (WPARAM)IDC_START, 0);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Other hazardous cheat modes require Ctrl + Alt\n\t\t\t// Ctrl-Alt-D => Toggle dark mode and restart. Note that if you enable this, then\n\t\t\t// unless you *MANUALLY* delete the registry key, Rufus always forces the mode.\n\t\t\tif ((msg.message == WM_KEYDOWN) && (msg.wParam == 'D') &&\n\t\t\t\t(GetKeyState(VK_CONTROL) & 0x8000) && (GetKeyState(VK_MENU) & 0x8000)) {\n\t\t\t\tWriteSetting32(SETTING_DARK_MODE, is_darkmode_enabled ? 2 : 1);\n\t\t\t\tselected_fs = (int)ComboBox_GetCurItemData(hFileSystem);\n\t\t\t\trelaunch = TRUE;\n\t\t\t\tPostMessage(hDlg, WM_COMMAND, IDCANCEL, 0);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Ctrl-Alt-E => Expert Mode\n\t\t\tif ((msg.message == WM_KEYDOWN) && (msg.wParam == 'E') &&\n\t\t\t\t(GetKeyState(VK_CONTROL) & 0x8000) && (GetKeyState(VK_MENU) & 0x8000)) {\n\t\t\t\texpert_mode = !expert_mode;\n\t\t\t\tWriteSettingBool(SETTING_EXPERT_MODE, expert_mode);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_347), expert_mode);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Ctrl-Alt-F => List non USB removable drives such as eSATA, etc - CAUTION!!!\n\t\t\tif ((msg.message == WM_KEYDOWN) && (msg.wParam == 'F') &&\n\t\t\t\t(GetKeyState(VK_CONTROL) & 0x8000) && (GetKeyState(VK_MENU) & 0x8000)) {\n\t\t\t\tlist_non_usb_removable_drives = !list_non_usb_removable_drives;\n\t\t\t\tif (list_non_usb_removable_drives) {\n\t\t\t\t\tprevious_enable_HDDs = enable_HDDs;\n\t\t\t\t\tenable_HDDs = TRUE;\n\t\t\t\t} else {\n\t\t\t\t\tenable_HDDs = previous_enable_HDDs;\n\t\t\t\t}\n\t\t\t\tCheckDlgButton(hMainDialog, IDC_LIST_USB_HDD, enable_HDDs ? BST_CHECKED : BST_UNCHECKED);\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_287), list_non_usb_removable_drives);\n\t\t\t\tuprintf(\"%sListing of non-USB removable drives %s\",\n\t\t\t\t\t(list_non_usb_removable_drives) ? \"CAUTION: \" : \"\", (list_non_usb_removable_drives) ? \"enabled\" : \"disabled\");\n\t\t\t\tif (list_non_usb_removable_drives)\n\t\t\t\t\tuprintf(\"By using this unofficial cheat mode you forfeit ANY RIGHT to complain if you lose valuable data!\");\n\t\t\t\tGetDevices(0);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Ctrl-Alt-Y => Force update check to be successful and ignore timestamp errors\n\t\t\tif ((msg.message == WM_KEYDOWN) && (msg.wParam == 'Y') &&\n\t\t\t\t(GetKeyState(VK_CONTROL) & 0x8000) && (GetKeyState(VK_MENU) & 0x8000)) {\n\t\t\t\tforce_update = (force_update > 0) ? 0 : 2;\n\t\t\t\tPrintStatusTimeout(lmprintf(MSG_259), force_update);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t// Standalone 'Alt' key toggles progress report between percent, rate (if available)\n\t\t// and remaining time (if available)\n\t\tif (alt_pressed && !(GetKeyState(VK_MENU) & 0x8000)) {\n\t\t\talt_pressed = FALSE;\n\t\t\tif (!alt_command)\n\t\t\t\tupdate_progress_type = (update_progress_type + 1) % UPT_MAX;\n\t\t\talt_command = FALSE;\n\t\t}\n\n\t\t// Let the system handle dialog messages (e.g. those from the tab key)\n\t\tif (!IsDialogMessage(hDlg, &msg) && !IsDialogMessage(hLogDialog, &msg)) {\n\t\t\tTranslateMessage(&msg);\n\t\t\tDispatchMessage(&msg);\n\t\t}\n\t}\n\tif (hFidoDlg != NULL)\n\t\tSendMessage(hFidoDlg, WM_CLOSE, 0, 0);\n\tif (relaunch) {\n\t\trelaunch = FALSE;\n\t\treinit_localization();\n\t\tgoto relaunch;\n\t}\n\nout:\n\t_chdirU(cur_dir);\n\t// Destroy the hogger mutex first, so that the cmdline app can exit and we can delete it\n\tif (hogmutex != NULL) {\n\t\tReleaseMutex(hogmutex);\n\t\tsafe_closehandle(hogmutex);\n\t\t// Unconditional delete with retry, just in case...\n\t\tfor (i = 0; (!DeleteFileA(&cmdline_hogger[2])) && (i <= 10); i++)\n\t\t\tSleep(200);\n\t}\n\t// Kill the update check thread if running\n\tif (update_check_thread != NULL)\n\t\tTerminateThread(update_check_thread, 1);\n\tif ((!external_loc_file) && (loc_file[0] != 0)) {\n\t\tif (!DeleteFileU(loc_file))\n\t\t\tuprintf(\"Could not delete '%s': %s\", loc_file, WindowsErrorString());\n\t}\n\tDestroyAllTooltips();\n\tDestroyDarkModeGDIObjects();\n\tClrAlertPromptHook();\n\texit_localization();\n\tsafe_free(image_path);\n\tsafe_free(archive_path);\n\tsafe_free(locale_name);\n\tsafe_free(update.download_url);\n\tsafe_free(update.release_notes);\n\tsafe_free(grub2_buf);\n\tsafe_free(fido_url);\n\tsafe_free(fido_script);\n\tsafe_free(pe256ssp);\n\tsafe_free(sbat_entries);\n\tsafe_free(sbat_level_txt);\n\tsafe_free(sb_active_certs);\n\tsafe_free(sb_active_txt);\n\tsafe_free(sb_revoked_certs);\n\tsafe_free(sb_revoked_txt);\n\tif (argv != NULL) {\n\t\tfor (i = 0; i < argc; i++)\n\t\t\tsafe_free(argv[i]);\n\t\tsafe_free(argv);\n\t}\n\tif (lgp_set)\n\t\tSetLGP(TRUE, &existing_key, ep_reg, \"NoDriveTypeAutorun\", 0);\n\tif ((!automount) && (!SetAutoMount(FALSE)))\n\t\tuprintf(\"Failed to restore AutoMount to disabled\");\n\tubflush();\n\tif (attached_console) {\n\t\tSetWindowPos(GetConsoleWindow(), HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);\n\t\tFreeConsole();\n\t}\n\tCoUninitialize();\n\tCLOSE_OPENED_LIBRARIES;\n\tsafe_closehandle(mutex);\n\tuprintf(\"*** \" APPLICATION_NAME \" exit ***\\n\");\n#ifdef _CRTDBG_MAP_ALLOC\n\t_CrtDumpMemoryLeaks();\n#endif\n\n\treturn 0;\n}\n\n/*\n * The following adds a Load Configuration section in .rdata for MinGW, that can then be referenced\n * by a PE post processing script to emulate the /DEPENDENTLOADFLAG:0x800 behaviour of MSVC.\n * See https://github.com/pbatard/rufus/blob/master/loadcfg.py for such a script.\n * Note however that, per https://github.com/pbatard/rufus/issues/2701#issuecomment-2874788564\n * /DEPENDENTLOADFLAG is far from being the ultimate solution to stop DLL side-loading vulnerabilities...\n */\n#if defined(__MINGW32__)\n// MinGW produces a warning since we don't use this section in the code => silence it.\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wunused-const-variable\"\n// Add a 16-byte marker for scripts to easily locate this section.\nstatic const char _load_config_marker[16] __attribute__((aligned(16))) __attribute__((section(\".rdata\"))) = \"_RUFUS_LOAD_CFG\";\n#if defined(_M_AMD64)\nstatic const IMAGE_LOAD_CONFIG_DIRECTORY64 _load_config __attribute__((aligned(16))) __attribute__((section(\".rdata\"))) = {\n\t.Size = sizeof(IMAGE_LOAD_CONFIG_DIRECTORY64),\n\t.DependentLoadFlags = LOAD_LIBRARY_SEARCH_SYSTEM32\n};\n#else\nstatic const IMAGE_LOAD_CONFIG_DIRECTORY32 _load_config __attribute__((aligned(16))) __attribute__((section(\".rdata\"))) = {\n\t.Size = sizeof(IMAGE_LOAD_CONFIG_DIRECTORY32),\n\t.DependentLoadFlags = LOAD_LIBRARY_SEARCH_SYSTEM32\n};\n#endif\n#pragma GCC diagnostic pop\n#endif\n"
  },
  {
    "path": "src/rufus.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Copyright © 2011-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n#include <assert.h>\n#include <windows.h>\n#include <malloc.h>\n#include <inttypes.h>\n\n#if defined(_MSC_VER)\n// Disable some VS Code Analysis warnings\n#pragma warning(disable: 4996)\t\t// Ignore deprecated\n#pragma warning(disable: 6258)\t\t// I know what I'm using TerminateThread for\n#pragma warning(disable: 26451)\t\t// Stop bugging me with casts already!\n#pragma warning(disable: 28159)\t\t// I'll keep using GetVersionEx(), thank you very much...\n// Enable C11's _Static_assert (requires VS2015 or later)\n#define _Static_assert static_assert\n#endif\n\n#pragma once\n\n/* Convenient to have around */\n#define KB                          1024LL\n#define MB                          1048576LL\n#define GB                          1073741824LL\n#define TB                          1099511627776LL\n#define PB                          1125899906842624LL\n\n/*\n * Features not ready for prime time and that may *DESTROY* your data - USE AT YOUR OWN RISKS!\n */\n//#define RUFUS_TEST\n\n#define APPLICATION_NAME            \"Rufus\"\n#if defined(_M_AMD64)\n#define APPLICATION_ARCH            \"x64\"\n#elif defined(_M_IX86)\n#define APPLICATION_ARCH            \"x86\"\n#elif defined(_M_ARM64)\n#define APPLICATION_ARCH            \"Arm64\"\n#elif defined(_M_ARM)\n#define APPLICATION_ARCH            \"Arm\"\n#else\n#define APPLICATION_ARCH            \"(Unknown Arch)\"\n#endif\n#define COMPANY_NAME                \"Akeo Consulting\"\n#define STR_NO_LABEL                \"NO_LABEL\"\n#define LEFT_TO_RIGHT_MARK          \"\\u200e\"\n#define RIGHT_TO_LEFT_MARK          \"\\u200f\"\n#define LEFT_TO_RIGHT_EMBEDDING     \"\\u202a\"\n#define RIGHT_TO_LEFT_EMBEDDING     \"\\u202b\"\n#define POP_DIRECTIONAL_FORMATTING  \"\\u202c\"\n#define LEFT_TO_RIGHT_OVERRIDE      \"\\u202d\"\n#define RIGHT_TO_LEFT_OVERRIDE      \"\\u202e\"\n#define DRIVE_ACCESS_TIMEOUT        15000\t\t// How long we should retry drive access (in ms)\n#define DRIVE_ACCESS_RETRIES        150\t\t\t// How many times we should retry\n#define DRIVE_INDEX_MIN             0x00000080\n#define DRIVE_INDEX_MAX             0x000000C0\n#define MIN_DRIVE_SIZE              (8 * MB)\t// Minimum size a drive must have, to be formattable\n#define MIN_EXTRA_PART_SIZE         (1 * MB)\t// Minimum size of the extra partition, in bytes\n#define MIN_EXT_SIZE                (256 * MB)\t// Minimum size we allow for ext formatting\n#define MAX_DRIVES                  (DRIVE_INDEX_MAX - DRIVE_INDEX_MIN)\n#define MAX_TOOLTIPS                128\n#define MAX_SIZE_SUFFIXES           6\t\t\t// bytes, KB, MB, GB, TB, PB\n#define MAX_CLUSTER_SIZES           18\n#define MAX_PROGRESS                0xFFFF\n#define PATCH_PROGRESS_TOTAL        207\n#define MAX_LOG_SIZE                0x7FFFFFFE\n#define MAX_REFRESH                 25\t\t\t// How long we should wait to refresh UI elements (in ms)\n#define MARQUEE_TIMER_REFRESH       10\t\t\t// Time between progress bar marquee refreshes, in ms\n#define MAX_GUID_STRING_LENGTH      40\n#define MAX_PARTITIONS              16\t\t\t// Maximum number of partitions we handle\n#define MAX_ESP_TOGGLE              8\t\t\t// Maximum number of entries we record to toggle GPT ESP back and forth\n#define MAX_IGNORE_USB              8\t\t\t// Maximum number of USB drives we want to ignore\n#define MAX_ISO_TO_ESP_SIZE         (1 * GB)\t// Maximum size we allow for the ISO → ESP option\n#define MAX_DEFAULT_LIST_CARD_SIZE  (500 * GB)\t// Size above which we don't list a card without enable HDD or Alt-F\n#define MAX_SECTORS_TO_CLEAR        (8 * MB / 512)\t// Sectors to zap when clearing the MBR/GPT (must be >34)\n#define MAX_USERNAME_LENGTH         128\t\t\t// Maximum size we'll accept for a WUE specified username\n#define MAX_WININST                 4\t\t\t// Max number of install[.wim|.esd] we can handle on an image\n#define MAX_MARKER                  80.0f\t\t// Max number of '+' signs we display for progress\n#define MBR_UEFI_MARKER             0x49464555\t// 'U', 'E', 'F', 'I', as a 32 bit little endian longword\n#define MORE_INFO_URL               0xFFFF\n#define PROJECTED_SIZE_RATIO        110\t\t\t// Percentage by which we inflate projected_size to prevent persistence overflow\n#define STATUS_MSG_TIMEOUT          3500\t\t// How long should cheat mode messages appear for on the status bar\n#define WRITE_RETRIES               4\n#define WRITE_TIMEOUT               5000\t\t// How long we should wait between write retries (in ms)\n#define SEARCH_PROCESS_TIMEOUT      5000\t\t// How long we should wait to get the conflicting process data (in ms)\n#define NET_SESSION_TIMEOUT         3500\t\t// How long we should wait to connect, send or receive internet data (in ms)\n#define FS_DEFAULT                  FS_FAT32\n#define SINGLE_CLUSTERSIZE_DEFAULT  0x00000100\n#define BADLOCKS_PATTERN_TYPES      5\n#define BADBLOCK_PATTERN_COUNT      4\n#define BADBLOCK_PATTERN_ONE_PASS   {0x55, 0x00, 0x00, 0x00}\n#define BADBLOCK_PATTERN_TWO_PASSES {0x55, 0xaa, 0x00, 0x00}\n#define BADBLOCK_PATTERN_SLC        {0x00, 0xff, 0x55, 0xaa}\n#define BADCLOCK_PATTERN_MLC        {0x00, 0xff, 0x33, 0xcc}\n#define BADBLOCK_PATTERN_TLC        {0x00, 0xff, 0x1c71c7, 0xe38e38}\n#define BADBLOCK_BLOCK_SIZE         (512 * KB)\n#define LARGE_FAT32_SIZE            (32 * GB)\t// Size at which we need to use fat32format\n#define UDF_FORMAT_SPEED            3.1f\t\t// Speed estimate at which we expect UDF drives to be formatted (GB/s)\n#define UDF_FORMAT_WARN             20\t\t\t// Duration (in seconds) above which we warn about long UDF formatting times\n#define MAX_FAT32_SIZE              (2 * TB)\t// Threshold above which we disable FAT32 formatting\n#define FAT32_CLUSTER_THRESHOLD     1.011f\t\t// For FAT32, cluster size changes don't occur at power of 2 boundaries but slightly above\n#define DD_BUFFER_SIZE              (32 * MB)\t// Minimum size of buffer to use for DD operations\n#define UBUFFER_SIZE                4096\n#define ISO_BUFFER_SIZE             (64 * KB)\t// Buffer size used for ISO data extraction\n#define RSA_SIGNATURE_SIZE          256\n#define CBN_SELCHANGE_INTERNAL      (CBN_SELCHANGE + 256)\n#if defined(RUFUS_TEST)\n#define RUFUS_URL                   \"http://nas/~rufus\"\n#else\n#define RUFUS_URL                   \"https://rufus.ie\"\n#endif\n#define DOWNLOAD_URL                RUFUS_URL \"/downloads\"\n#define FILES_URL                   RUFUS_URL \"/files\"\n#define FILES_DIR                   APPLICATION_NAME\n#define FIDO_VERSION                \"z1\"\n#define WPPRECORDER_MORE_INFO_URL   \"https://github.com/pbatard/rufus/wiki/FAQ#bsods-with-windows-to-go-drives-created-from-windows-10-1809-isos\"\n// Generated by following https://randomascii.wordpress.com/2013/03/09/symbols-the-microsoft-way/\n#define DISKCOPY_URL                \"https://msdl.microsoft.com/download/symbols/diskcopy.dll/54505118173000/diskcopy.dll\"\n#define DISKCOPY_HASH               \"95fc0786f5bc0a6db5c0604b31ac18fbed0502a2c6858e5fb02a647983ae03c7\"\n#define DISKCOPY_SIZE               0x16ee00\n#define DISKCOPY_IMAGE_OFFSET       0x66d8\n#define DISKCOPY_IMAGE_SIZE         0x168000\n#if defined(_M_AMD64)\n#define OSCDIMG_URL                 \"https://msdl.microsoft.com/download/symbols/oscdimg.exe/688CABB065000/oscdimg.exe\"\n#define OSCDIMG_HASH                \"2000160b2c5044691b2f9a0ac308e5207f273d4880a572457af16d05886ba861\"\n#elif defined(_M_IX86)\n#define OSCDIMG_URL                 \"https://msdl.microsoft.com/download/symbols/oscdimg.exe/704FD1B760000/oscdimg.exe\"\n#define OSCDIMG_HASH                \"cbd6872265d44e88897905bdc47f7035d64ad1775ab890ea59db13ec92d867eb\"\n#elif defined(_M_ARM64)\n#define OSCDIMG_URL                 \"https://msdl.microsoft.com/download/symbols/oscdimg.exe/02633D8D66000/oscdimg.exe\"\n#define OSCDIMG_HASH                \"80c059815d82fca009841143a821f79c8ac78dba12bb63dc07842f1a2a552666\"\n#elif defined(_M_ARM)\n#define OSCDIMG_URL                 \"https://msdl.microsoft.com/download/symbols/oscdimg.exe/9CD825745F000/oscdimg.exe\"\n#define OSCDIMG_HASH                \"5ecd9956da589baa65806c884a55f9303ec6c6c559bdeb8afe00c72614a24c7a\"\n#endif\n#define SYMBOL_SERVER_USER_AGENT    \"Microsoft-Symbol-Server/10.0.22621.755\"\n#define DEFAULT_ESP_MOUNT_POINT     \"S:\\\\\"\n#define IS_POWER_OF_2(x)            ((x != 0) && (((x) & ((x) - 1)) == 0))\n#define IGNORE_RETVAL(expr)         do { (void)(expr); } while(0)\n#ifndef ARRAYSIZE\n#define ARRAYSIZE(A)                (sizeof(A)/sizeof((A)[0]))\n#endif\n#ifndef STRINGIFY\n#define STRINGIFY(x)                #x\n#endif\n#define PERCENTAGE(percent, value)  ((1ULL * (percent) * (value)) / 100ULL)\n#define IsChecked(CheckBox_ID)      (IsDlgButtonChecked(hMainDialog, CheckBox_ID) == BST_CHECKED)\n#define MB_IS_RTL                   (right_to_left_mode?MB_RTLREADING|MB_RIGHT:0)\n#define CHECK_FOR_USER_CANCEL       if (IS_ERROR(ErrorStatus) && (SCODE_CODE(ErrorStatus) == ERROR_CANCELLED)) goto out\n// Bit masks used for the display of additional image options in the UI\n#define IMOP_WINTOGO                0x01\n#define IMOP_PERSISTENCE            0x02\n\n#define ComboBox_GetCurItemData(hCtrl) ComboBox_GetItemData(hCtrl, ComboBox_GetCurSel(hCtrl))\n\n#define safe_free(p) do { free((void*)p); p = NULL; } while(0)\n#define safe_mm_free(p) do { _mm_free((void*)p); p = NULL; } while(0)\nstatic __inline void safe_strcp(char* dst, const size_t dst_max, const char* src, const size_t count) {\n\tmemmove(dst, src, min(count, dst_max));\n\tif (dst != NULL) dst[min(count, dst_max) - 1] = 0;\n}\n#define safe_strcpy(dst, dst_max, src) safe_strcp(dst, dst_max, src, safe_strlen(src) + 1)\n#define static_strcpy(dst, src) safe_strcpy(dst, sizeof(dst), src)\n#define safe_strcat(dst, dst_max, src) strncat_s(dst, dst_max, src, _TRUNCATE)\n#define static_strcat(dst, src) safe_strcat(dst, sizeof(dst), src)\n#define safe_strcmp(str1, str2) strcmp(((str1 == NULL) ? \"<NULL>\" : str1), ((str2 == NULL) ? \"<NULL>\" : str2))\n#define safe_strstr(str1, str2) strstr(((str1 == NULL) ? \"<NULL>\" : str1), ((str2 == NULL) ? \"<NULL>\" : str2))\n#define safe_stricmp(str1, str2) _stricmp(((str1 == NULL) ? \"<NULL>\" : str1), ((str2 == NULL) ? \"<NULL>\" : str2))\n#define safe_strncmp(str1, str2, count) strncmp(((str1 == NULL) ? \"<NULL>\" : str1), ((str2 == NULL) ? \"<NULL>\" : str2), count)\n#define safe_strnicmp(str1, str2, count) _strnicmp(((str1 == NULL) ? \"<NULL>\" : str1), ((str2 == NULL) ? \"<NULL>\" : str2), count)\n#define safe_closehandle(h) do { if ((h != INVALID_HANDLE_VALUE) && (h != NULL)) { CloseHandle(h); h = INVALID_HANDLE_VALUE; } } while(0)\n#define safe_release_dc(hDlg, hDC) do { if ((hDC != INVALID_HANDLE_VALUE) && (hDC != NULL)) { ReleaseDC(hDlg, hDC); hDC = NULL; } } while(0)\n#define safe_delete_object(hObj) do { if (hObj != NULL) { DeleteObject(hObj); hObj = NULL; } } while(0)\n#define safe_destroy_icon(hIcon) do { if (hIcon != NULL) { DestroyIcon(hIcon); hIcon = NULL; } } while(0)\n#define safe_destroy_imagelist(hImageList) do { if (hImageList != NULL) { ImageList_Destroy(hImageList); hImageList = NULL; } } while(0)\n#define safe_destroy_imagelist_from_toolbar(hToolbar) do { if (hToolbar != NULL) {                     \\\n\tHIMAGELIST _hImageList = (HIMAGELIST)SendMessage(hToolbar, TB_GETIMAGELIST, (WPARAM)0, (LPARAM)0); \\\n\tsafe_destroy_imagelist(_hImageList); } } while(0)\n#define safe_sprintf(dst, count, ...) do { size_t _count = count; char* _dst = dst; _snprintf_s(_dst, _count, _TRUNCATE, __VA_ARGS__); \\\n\tif (_dst != NULL) _dst[(_count) - 1] = 0; } while(0)\n#define static_sprintf(dst, ...) safe_sprintf(dst, sizeof(dst), __VA_ARGS__)\n#define safe_atoi(str) ((((char*)(str))==NULL) ? 0 : atoi(str))\n#define safe_strlen(str) ((((char*)(str))==NULL) ? 0 : strlen(str))\n#define safe_strdup(str) ((((char*)(str))==NULL) ? NULL : _strdup(str))\n#if defined(_MSC_VER)\n#define safe_vsnprintf(buf, size, format, arg) _vsnprintf_s(buf, size, _TRUNCATE, format, arg)\n#else\n#define safe_vsnprintf vsnprintf\n#endif\n#define safe_strtolower(str) do { if (str != NULL) CharLowerA(str); } while(0)\n#define safe_strtoupper(str) do { if (str != NULL) CharUpperA(str); } while(0)\nstatic __inline void static_repchr(char* p, char s, char r) {\n\tif (p != NULL) while (*p != 0) { if (*p == s) *p = r; p++; }\n}\n#define to_unix_path(str) static_repchr(str, '\\\\', '/')\n#define to_windows_path(str) static_repchr(str, '/', '\\\\')\n#define if_assert_fails(cond) assert(cond); if (!(cond))\n#define if_assert_succeeds(cond) assert(cond); if ((cond))\n\nextern void uprintf(const char *format, ...);\nextern void uprintfs(const char *str);\nextern void wuprintf(const wchar_t* format, ...);\nextern void uprint_progress(uint64_t cur_value, uint64_t max_value);\n#define vuprintf(...) do { if (verbose) uprintf(__VA_ARGS__); } while(0)\n#define vvuprintf(...) do { if (verbose > 1) uprintf(__VA_ARGS__); } while(0)\n#define suprintf(...) do { if (!bSilent) uprintf(__VA_ARGS__); } while(0)\n#define uuprintf(...) do { if (usb_debug) uprintf(__VA_ARGS__); } while(0)\n#define ubprintf(...) do { safe_sprintf(&ubuffer[ubuffer_pos], UBUFFER_SIZE - ubuffer_pos - 4, __VA_ARGS__); \\\n\tubuffer_pos = strlen(ubuffer); ubuffer[ubuffer_pos++] = '\\r'; ubuffer[ubuffer_pos++] = '\\n'; \\\n\tubuffer[ubuffer_pos] = 0; } while(0)\n#define ubflush() do { if (ubuffer_pos) uprintf(\"%s\", ubuffer); ubuffer_pos = 0; } while(0)\n#ifdef _DEBUG\n#define duprintf uprintf\n#else\n#define duprintf(...)\n#endif\n\n/* Custom Windows messages */\nenum user_message_type {\n\tUM_FORMAT_COMPLETED = WM_APP,\n\tUM_MEDIA_CHANGE,\n\tUM_PROGRESS_INIT,\n\tUM_PROGRESS_EXIT,\n\tUM_NO_UPDATE,\n\tUM_UPDATE_CSM_TOOLTIP,\n\tUM_RESIZE_BUTTONS,\n\tUM_ENABLE_CONTROLS,\n\tUM_SELECT_ISO,\n\tUM_TIMER_START,\n\tUM_FORMAT_START,\n\t// Start of the WM IDs for the language menu items\n\tUM_LANGUAGE_MENU = WM_APP + 0x100\n};\n\n/* Custom notifications */\n#define MB_CLOSE 0x0F\ntypedef INT_PTR (CALLBACK *Callback_t)(HWND, UINT, WPARAM, LPARAM);\ntypedef struct {\n\tWORD id;\n\tunion {\n\t\tCallback_t callback;\n\t\tchar* url;\n\t};\n} notification_info;\t// To provide a \"More info...\" on notifications\n\n/* Status Bar sections */\n#define SB_SECTION_LEFT         0\n#define SB_SECTION_RIGHT        1\n#define SB_TIMER_SECTION_SIZE   58.0f\n\n/* Timers used throughout the program */\nenum timer_type {\n\tTID_MESSAGE_INFO = 0x1000,\n\tTID_MESSAGE_STATUS,\n\tTID_OUTPUT_INFO,\n\tTID_OUTPUT_STATUS,\n\tTID_BADBLOCKS_UPDATE,\n\tTID_APP_TIMER,\n\tTID_BLOCKING_TIMER,\n\tTID_REFRESH_TIMER,\n\tTID_MARQUEE_TIMER\n};\n\n/* Action type, for progress bar breakdown */\nenum action_type {\n\tOP_NOOP_WITH_TASKBAR = -3,\n\tOP_NOOP = -2,\n\tOP_INIT = -1,\n\tOP_ANALYZE_MBR = 0,\n\tOP_BADBLOCKS,\n\tOP_ZERO_MBR,\n\tOP_PARTITION,\n\tOP_FORMAT,\n\tOP_CREATE_FS,\n\tOP_FIX_MBR,\n\tOP_FILE_COPY,\n\tOP_PATCH,\n\tOP_FINALIZE,\n\tOP_EXTRACT_ZIP,\n\tOP_MAX\n};\n\n/* File system indexes in our FS combobox */\nenum fs_type {\n\tFS_UNKNOWN = -1,\n\tFS_FAT16 = 0,\n\tFS_FAT32,\n\tFS_NTFS,\n\tFS_UDF,\n\tFS_EXFAT,\n\tFS_REFS,\n\tFS_EXT2,\n\tFS_EXT3,\n\tFS_EXT4,\n\tFS_MAX\n};\n\nenum boot_type {\n\tBT_NON_BOOTABLE = 0,\n\tBT_MSDOS,\n\tBT_FREEDOS,\n\tBT_IMAGE,\n\tBT_SYSLINUX_V4,\t\t// Start of indexes that only display in advanced mode\n\tBT_SYSLINUX_V6,\n\tBT_REACTOS,\n\tBT_GRUB4DOS,\n\tBT_GRUB2,\n\tBT_UEFI_NTFS,\n\tBT_MAX\n};\n\nenum target_type {\n\tTT_BIOS = 0,\n\tTT_UEFI,\n\tTT_MAX\n};\n// For the partition types we'll use Microsoft's PARTITION_STYLE_### constants\n#define PARTITION_STYLE_SFD PARTITION_STYLE_RAW\n\nenum image_option_type {\n\tIMOP_WIN_STANDARD = 0,\n\tIMOP_WIN_EXTENDED,\n\tIMOP_WIN_TO_GO,\n\tIMOP_MAX\n};\n\nenum file_io_type {\n\tFILE_IO_READ = 0,\n\tFILE_IO_WRITE,\n\tFILE_IO_APPEND\n};\n\nenum EFI_BOOT_TYPE {\n\tEBT_MAIN = 0,\n\tEBT_GRUB,\n\tEBT_MOKMANAGER,\n\tEBT_BOOTMGR\n};\n\n/* Special handling for old .c32 files we need to replace */\n#define NB_OLD_C32          2\n#define OLD_C32_NAMES       { \"menu.c32\", \"vesamenu.c32\" }\n#define OLD_C32_THRESHOLD   { 53500, 148000 }\n\n/* ISO details that the application may want */\n#define WINPE_I386          0x0007\n#define WINPE_AMD64         0x0023\n#define WINPE_MININT        0x01C0\n#define SPECIAL_WIM_VERSION 0x000E0000\n#define HAS_KOLIBRIOS(r)    (r.has_kolibrios)\n#define HAS_REACTOS(r)      (r.reactos_path[0] != 0)\n#define HAS_GRUB(r)         ((r.has_grub2) || (r.has_grub4dos))\n#define HAS_SYSLINUX(r)     (r.sl_version != 0)\n#define HAS_BOOTMGR_BIOS(r) (r.has_bootmgr)\n#define HAS_BOOTMGR_EFI(r)  (r.has_bootmgr_efi)\n#define HAS_BOOTMGR(r)      (HAS_BOOTMGR_BIOS(r) || HAS_BOOTMGR_EFI(r))\n#define HAS_REGULAR_EFI(r)  (r.has_efi & 0x7FFE)\n#define HAS_WININST(r)      (r.wininst_index != 0)\n#define HAS_WINPE(r)        (((r.winpe & WINPE_I386) == WINPE_I386)||((r.winpe & WINPE_AMD64) == WINPE_AMD64)||((r.winpe & WINPE_MININT) == WINPE_MININT))\n#define HAS_WINDOWS(r)      (HAS_BOOTMGR(r) || (r.uses_minint) || HAS_WINPE(r))\n#define HAS_WIN7_EFI(r)     ((r.has_efi == 1) && HAS_WININST(r))\n#define HAS_FATLESS_GRUB(r) ((r.has_grub2 & 0x80) && !(r.has_grub2_fs & 0x1))\n#define HAS_NTFSLESS_GRUB(r)((r.has_grub2 & 0x80) && !(r.has_grub2_fs & 0x4))\n#define IS_WINDOWS_1X(r)    (r.has_bootmgr_efi && (r.win_version.major >= 10))\n#define IS_WINDOWS_11(r)    (r.has_bootmgr_efi && (r.win_version.major >= 11))\n#define IS_FAT32_COMPAT(r)  (((r.has_4GB_file == 0 && !HAS_FATLESS_GRUB(r)) || (r.has_4GB_file == 0x11 && allow_dual_uefi_bios)) && !r.needs_ntfs)\n#define HAS_EFI_IMG(r)      (r.efi_img_path[0] != 0)\n#define IS_DD_BOOTABLE(r)   (r.is_bootable_img > 0)\n#define IS_DD_ONLY(r)       ((r.is_bootable_img > 0) && (!r.is_iso || r.disable_iso))\n#define IS_EFI_BOOTABLE(r)  (r.has_efi != 0)\n#define IS_BIOS_BOOTABLE(r) (HAS_BOOTMGR(r) || HAS_SYSLINUX(r) || HAS_WINPE(r) || HAS_GRUB(r) || HAS_REACTOS(r) || HAS_KOLIBRIOS(r))\n#define HAS_WINTOGO(r)      (HAS_BOOTMGR(r) && IS_EFI_BOOTABLE(r) && HAS_WININST(r))\n#define HAS_PERSISTENCE(r)  ((HAS_SYSLINUX(r) || HAS_GRUB(r)) && !(HAS_WINDOWS(r) || HAS_REACTOS(r) || HAS_KOLIBRIOS(r)))\n#define IS_FAT(fs)          ((fs == FS_FAT16) || (fs == FS_FAT32))\n#define IS_EXT(fs)          ((fs >= FS_EXT2) && (fs <= FS_EXT4))\n#define SYMLINKS_RR         0x01\n#define SYMLINKS_UDF        0x02\n\ntypedef struct {\n\tuint16_t major;\n\tuint16_t minor;\n\tuint16_t build;\n\tuint16_t revision;\n} winver_t;\n\n/*\n * We can't use the Microsoft enums as we want to have RISC-V and LoongArch\n * and we also translate these to IDR_BASE + Value for resource items, which,\n * if we were to use the Microsoft IMAGE_FILE_MACHINE constants, would force\n * us to leave a 65536 sized gap between bases in order to properly map\n * 0x8664 (x86_64), 0xaa64 (ARM64) and so on...\n * NB: When editing this, make sure to also update the values in resource.h!\n */\nenum ArchType {\n\tARCH_UNKNOWN = 0,\n\tARCH_X86_32,\n\tARCH_X86_64,\n\tARCH_ARM_32,\n\tARCH_ARM_64,\n\tARCH_IA_64,\n\tARCH_RISCV_64,\n\tARCH_LOONGARCH_64,\n\tARCH_EBC,\n\tARCH_MAX\n};\n\ntypedef struct {\n\tuint8_t type;\n\tchar path[64];\n} efi_boot_entry_t; \n\ntypedef struct {\n\tchar label[192];\t\t\t\t\t// 3*64 to account for UTF-8\n\tchar usb_label[192];\t\t\t\t// converted USB label for workaround\n\tchar cfg_path[128];\t\t\t\t\t// path to the ISO's isolinux.cfg\n\tchar reactos_path[128];\t\t\t\t// path to the ISO's freeldr.sys or setupldr.sys\n\tchar wininst_path[MAX_WININST][64];\t// path to the Windows install image(s)\n\tefi_boot_entry_t efi_boot_entry[64];// types and paths of detected UEFI bootloaders\n\tchar efi_img_path[128];\t\t\t\t// path to an efi.img file\n\tuint64_t image_size;\n\tuint64_t projected_size;\n\tint64_t mismatch_size;\n\tuint32_t wininst_version;\n\tBOOLEAN is_iso;\n\tint8_t is_bootable_img;\n\tBOOLEAN is_vhd;\n\tBOOLEAN is_windows_img;\n\tBOOLEAN disable_iso;\n\tBOOLEAN rh8_derivative;\n\tuint16_t winpe;\n\tuint16_t has_efi;\n\tuint8_t has_secureboot_bootloader;\n\tuint8_t has_md5sum;\n\tuint8_t wininst_index;\n\tuint8_t has_symlinks;\n\tuint8_t has_4GB_file;\n\tBOOLEAN has_long_filename;\n\tBOOLEAN has_deep_directories;\n\tBOOLEAN has_bootmgr;\n\tBOOLEAN has_bootmgr_efi;\n\tBOOLEAN has_autorun;\n\tBOOLEAN has_old_c32[NB_OLD_C32];\n\tBOOLEAN has_old_vesamenu;\n\tBOOLEAN has_efi_syslinux;\n\tBOOLEAN has_grub4dos;\n\tuint8_t has_grub2;\n\tuint8_t has_grub2_fs;\n\tBOOLEAN has_compatresources_dll;\n\tBOOLEAN has_panther_unattend;\n\tBOOLEAN has_kolibrios;\n\tBOOLEAN needs_syslinux_overwrite;\n\tBOOLEAN needs_ntfs;\n\tBOOLEAN uses_casper;\n\tBOOLEAN uses_minint;\n\tuint8_t compression_type;\n\twinver_t win_version;\t// Windows ISO version\n\tuint16_t sl_version;\t// Syslinux/Isolinux version\n\tchar sl_version_str[12];\n\tchar sl_version_ext[32];\n\tchar grub2_version[192];\n} RUFUS_IMG_REPORT;\n\n/* Isolate the Syslinux version numbers */\n#define SL_MAJOR(x) ((uint8_t)((x)>>8))\n#define SL_MINOR(x) ((uint8_t)(x))\n\ntypedef struct {\n\tchar* id;\n\tchar* name;\n\tchar* display_name;\n\tchar* label;\n\tchar* hub;\n\tDWORD index;\n\tuint32_t port;\n\tuint64_t size;\n} RUFUS_DRIVE;\n\ntypedef struct {\n\tuint16_t version[3];\n\tuint32_t platform_min[2];\t\t// minimum platform version required\n\tchar* download_url;\n\tchar* release_notes;\n} RUFUS_UPDATE;\n\ntypedef struct {\n\tDWORD Type;\n\tDWORD DeviceNum;\n\tDWORD BufSize;\n\tLONGLONG DeviceSize;\n\tchar* DevicePath;\n\tchar* ImagePath;\n\tchar* Label;\n} IMG_SAVE;\n\n/*\n * Structure and macros used for the extensions specification of FileDialog()\n * You can use:\n *   EXT_DECL(my_extensions, \"default.std\", __VA_GROUP__(\"*.std\", \"*.other\"), __VA_GROUP__(\"Standard type\", \"Other Type\"));\n * to define an 'ext_t my_extensions' variable initialized with the relevant attributes.\n */\ntypedef struct ext_t {\n\tsize_t count;\n\tconst char* filename;\n\tconst char** extension;\n\tconst char** description;\n} ext_t;\n\n/* DLL address resolver */\ntypedef struct {\n\tchar* path;\n\tuint32_t    count;\n\tchar** name;\n\tuint32_t* address;\t// 32-bit will do, as we're not dealing with >4GB DLLs...\n} dll_resolver_t;\n\n/* Alignment macro */\n#if defined(__GNUC__)\n#define ALIGNED(m) __attribute__ ((__aligned__(m)))\n#elif defined(_MSC_VER)\n#define ALIGNED(m) __declspec(align(m))\n#endif\n\n/* Hash definitions */\nenum hash_type {\n\tHASH_MD5 = 0,\n\tHASH_SHA1,\n\tHASH_SHA256,\n\tHASH_SHA512,\n\tHASH_MAX\n};\n\n/* Blocksize for each hash algorithm - Must be a power of 2 */\n#define MD5_BLOCKSIZE       64\n#define SHA1_BLOCKSIZE      64\n#define SHA256_BLOCKSIZE    64\n#define SHA512_BLOCKSIZE    128\n#define MAX_BLOCKSIZE       SHA512_BLOCKSIZE\n\n/* Hashsize for each hash algorithm */\n#define MD5_HASHSIZE        16\n#define SHA1_HASHSIZE       20\n#define SHA256_HASHSIZE     32\n#define SHA512_HASHSIZE     64\n#define MAX_HASHSIZE        SHA512_HASHSIZE\n\n/* Context for the hash algorithms */\ntypedef struct ALIGNED(64) {\n\tuint8_t buf[MAX_BLOCKSIZE];\n\tuint64_t state[8];\n\tuint64_t bytecount;\n} HASH_CONTEXT;\n\n/* Certificate info */\ntypedef struct {\n\tchar name[256];\n\tuint8_t thumbprint[SHA1_HASHSIZE];\n} cert_info_t;\n\n/* Hash functions */\ntypedef void hash_init_t(HASH_CONTEXT* ctx);\ntypedef void hash_write_t(HASH_CONTEXT* ctx, const uint8_t* buf, size_t len);\ntypedef void hash_final_t(HASH_CONTEXT* ctx);\nextern hash_init_t* hash_init[HASH_MAX];\nextern hash_write_t* hash_write[HASH_MAX];\nextern hash_final_t* hash_final[HASH_MAX];\n\n/* SBAT entry */\ntypedef struct {\n\tchar* product;\n\tuint32_t version;\n} sbat_entry_t;\n\n/* Certificate thumbprint list */\ntypedef struct {\n\tuint32_t count;\n\tuint8_t list[0][SHA1_HASHSIZE];\n} thumbprint_list_t;\n\n#ifndef __VA_GROUP__\n#define __VA_GROUP__(...)  __VA_ARGS__\n#endif\n#define EXT_X(prefix, ...) const char* _##prefix##_x[] = { __VA_ARGS__ }\n#define EXT_D(prefix, ...) const char* _##prefix##_d[] = { __VA_ARGS__ }\n#define EXT_DECL(var, filename, extensions, descriptions)                   \\\n\tEXT_X(var, extensions);                                                 \\\n\tEXT_D(var, descriptions);                                               \\\n\text_t var = { ARRAYSIZE(_##var##_x), filename, _##var##_x, _##var##_d }\n\n/* Duplication of the TBPFLAG enum for Windows taskbar progress */\ntypedef enum TASKBAR_PROGRESS_FLAGS\n{\n\tTASKBAR_NOPROGRESS = 0,\n\tTASKBAR_INDETERMINATE = 0x1,\n\tTASKBAR_NORMAL = 0x2,\n\tTASKBAR_ERROR = 0x4,\n\tTASKBAR_PAUSED = 0x8\n} TASKBAR_PROGRESS_FLAGS;\n\nstatic __inline USHORT GetApplicationArch(void)\n{\n#if defined(_M_AMD64)\n\treturn IMAGE_FILE_MACHINE_AMD64;\n#elif defined(_M_IX86)\n\treturn IMAGE_FILE_MACHINE_I386;\n#elif defined(_M_ARM64)\n\treturn IMAGE_FILE_MACHINE_ARM64;\n#elif defined(_M_ARM)\n\treturn IMAGE_FILE_MACHINE_ARM;\n#else\n\treturn IMAGE_FILE_MACHINE_UNKNOWN;\n#endif\n}\n\nstatic __inline const char* GetArchName(USHORT uArch)\n{\n\tswitch (uArch) {\n\tcase IMAGE_FILE_MACHINE_AMD64:\n\t\treturn \"x64\";\n\tcase IMAGE_FILE_MACHINE_I386:\n\t\treturn \"x86\";\n\tcase IMAGE_FILE_MACHINE_ARM64:\n\t\treturn \"ARM64\";\n\tcase IMAGE_FILE_MACHINE_ARM:\n\t\treturn \"ARM32\";\n\tdefault:\n\t\treturn \"Unknown\";\n\t}\n}\n\n/* Windows versions */\nenum WindowsVersion {\n\tWINDOWS_UNDEFINED = 0,\n\tWINDOWS_XP = 0x51,\n\tWINDOWS_2003 = 0x52,\t// Also XP_64\n\tWINDOWS_VISTA = 0x60,\t// Also Server 2008\n\tWINDOWS_7 = 0x61,\t\t// Also Server 2008_R2\n\tWINDOWS_8 = 0x62,\t\t// Also Server 2012\n\tWINDOWS_8_1 = 0x63,\t\t// Also Server 2012_R2\n\tWINDOWS_10_PREVIEW1 = 0x64,\n\tWINDOWS_10 = 0xA0,\t\t// Also Server 2016, also Server 2019\n\tWINDOWS_11 = 0xB0,\t\t// Also Server 2022\n\tWINDOWS_MAX = 0xFFFF,\n};\n\ntypedef struct {\n\tDWORD Major;\n\tDWORD Minor;\n\tDWORD Micro;\n\tDWORD Nano;\n} version_t;\n\ntypedef struct {\n\tDWORD Version;\n\tDWORD Major;\n\tDWORD Minor;\n\tDWORD BuildNumber;\n\tDWORD Ubr;\n\tDWORD Edition;\n\tUSHORT Arch;\n\tchar VersionStr[128];\n} windows_version_t;\n\n// Windows User Experience (unattend.xml) flags and masks\n#define UNATTEND_SECUREBOOT_TPM_MINRAM      0x00001\n#define UNATTEND_NO_ONLINE_ACCOUNT          0x00004\n#define UNATTEND_NO_DATA_COLLECTION         0x00008\n#define UNATTEND_OFFLINE_INTERNAL_DRIVES    0x00010\n#define UNATTEND_DUPLICATE_LOCALE           0x00020\n#define UNATTEND_SET_USER                   0x00040\n#define UNATTEND_DISABLE_BITLOCKER          0x00080\n#define UNATTEND_FORCE_S_MODE               0x00100\n#define UNATTEND_USE_MS2023_BOOTLOADERS     0x00200\n#define UNATTEND_APPLY_SKUSIPOLICY          0x00400\n#define UNATTEND_SILENT_INSTALL             0x00800\n#define UNATTEND_QOL_ENHANCEMENTS           0x01000\n#define UNATTEND_FULL_MASK                  0x01FFF\n#define UNATTEND_DEFAULT_MASK               0x016FF\t\t// Mask of values that are persisted\n#define UNATTEND_WINDOWS_TO_GO              0x10000\t\t// Special flag for Windows To Go\n\n#define UNATTEND_WINPE_SETUP_MASK           (UNATTEND_SECUREBOOT_TPM_MINRAM | UNATTEND_SILENT_INSTALL)\n#define UNATTEND_SPECIALIZE_DEPLOYMENT_MASK (UNATTEND_NO_ONLINE_ACCOUNT | UNATTEND_QOL_ENHANCEMENTS)\n#define UNATTEND_OOBE_SHELL_SETUP_MASK      (UNATTEND_NO_DATA_COLLECTION | UNATTEND_SET_USER | UNATTEND_DUPLICATE_LOCALE)\n#define UNATTEND_OOBE_INTERNATIONAL_MASK    (UNATTEND_DUPLICATE_LOCALE)\n#define UNATTEND_OOBE_MASK                  (UNATTEND_OOBE_SHELL_SETUP_MASK | UNATTEND_OOBE_INTERNATIONAL_MASK | UNATTEND_DISABLE_BITLOCKER | \\\n                                             UNATTEND_USE_MS2023_BOOTLOADERS | UNATTEND_APPLY_SKUSIPOLICY | UNATTEND_QOL_ENHANCEMENTS)\n#define UNATTEND_OFFLINE_SERVICING_MASK     (UNATTEND_OFFLINE_INTERNAL_DRIVES | UNATTEND_FORCE_S_MODE)\n#define UNATTEND_DEFAULT_SELECTION_MASK     (UNATTEND_SECUREBOOT_TPM_MINRAM | UNATTEND_NO_ONLINE_ACCOUNT | UNATTEND_OFFLINE_INTERNAL_DRIVES)\n\n/* Used with ListDirectoryContent */\n#define LIST_DIR_TYPE_FILE\t\t\t0x01\n#define LIST_DIR_TYPE_DIRECTORY\t\t0x02\n#define LIST_DIR_TYPE_RECURSIVE\t\t0x80\n\n/* Hash tables */\ntypedef struct htab_entry {\n\tuint32_t used;\n\tchar* str;\n\tvoid* data;\n} htab_entry;\ntypedef struct htab_table {\n\thtab_entry* table;\n\tuint32_t size;\n\tuint32_t filled;\n} htab_table;\n#define HTAB_EMPTY { NULL, 0, 0 }\nextern BOOL htab_create(uint32_t nel, htab_table* htab);\nextern void htab_destroy(htab_table* htab);\nextern uint32_t htab_hash(char* str, htab_table* htab);\n\n/* Basic String Array */\ntypedef struct {\n\tchar** String;\n\tuint32_t Index;\t\t// Current array size\n\tuint32_t Max;\t\t// Maximum array size\n} StrArray;\nextern void StrArrayCreate(StrArray* arr, uint32_t initial_size);\nextern int32_t StrArrayAdd(StrArray* arr, const char* str, BOOL);\nextern int32_t StrArrayAddUnique(StrArray* arr, const char* str, BOOL);\nextern int32_t StrArrayFind(StrArray* arr, const char* str);\nextern void StrArrayClear(StrArray* arr);\nextern void StrArrayDestroy(StrArray* arr);\n#define IsStrArrayEmpty(arr) (arr.Index == 0)\n\n// Options for the custom selection dialog\ntypedef struct {\n\tint style;\n\tint mask;\n\tint username_index;\n\tint edition_index;\n\tint regional_index;\n\tint privacy_index;\n\tStrArray choices;\n\tStrArray tooltips;\n} selection_dialog_options_t;\n\n/*\n * Globals\n */\nextern RUFUS_UPDATE update;\nextern RUFUS_IMG_REPORT img_report;\nextern HINSTANCE hMainInstance;\nextern HWND hMainDialog, hLogDialog, hStatus, hDeviceList, hCapacity, hImageOption;\nextern HWND hPartitionScheme, hTargetSystem, hFileSystem, hClusterSize, hLabel, hBootType;\nextern HWND hNBPasses, hLog, hInfo, hProgress;\nextern WORD selected_langid;\nextern DWORD ErrorStatus, DownloadStatus, MainThreadId, LastWriteError;\nextern BOOL use_own_c32[NB_OLD_C32], detect_fakes, op_in_progress, right_to_left_mode;\nextern BOOL allow_dual_uefi_bios, large_drive, usb_debug;\nextern uint8_t image_options, *pe256ssp;\nextern uint16_t rufus_version[3], embedded_sl_version[2];\nextern uint32_t pe256ssp_size;\nextern uint64_t persistence_size;\nextern int64_t iso_blocking_status;\nextern size_t ubuffer_pos;\nextern const int nb_steps[FS_MAX];\nextern float fScale;\nextern windows_version_t WindowsVersion;\nextern sbat_entry_t* sbat_entries;\nextern thumbprint_list_t *sb_active_certs, *sb_revoked_certs;\nextern int dialog_showing, force_update, fs_type, boot_type, partition_type, target_type;\nextern unsigned long syslinux_ldlinux_len[2];\nextern char ubuffer[UBUFFER_SIZE], embedded_sl_version_str[2][12];\nextern char szFolderPath[MAX_PATH], app_dir[MAX_PATH], temp_dir[MAX_PATH], system_dir[MAX_PATH];\nextern char sysnative_dir[MAX_PATH], app_data_dir[MAX_PATH], *image_path, *fido_url;\nextern StrArray modified_files;\n\n/*\n * Shared prototypes\n */\nextern void GetWindowsVersion(windows_version_t* WindowsVersion);\nextern const char* GetEditionName(DWORD ProductType);\nextern int GetEditions(StrArray* version_name, StrArray* version_index);\nextern version_t* GetExecutableVersion(const char* path);\nextern const char* WindowsErrorString(void);\nextern void DumpBufferHex(void *buf, size_t size);\nextern void PrintStatusInfo(BOOL info, BOOL debug, unsigned int duration, int msg_id, ...);\n#define PrintStatus(...) PrintStatusInfo(FALSE, FALSE, __VA_ARGS__)\n#define PrintStatusDebug(...) PrintStatusInfo(FALSE, TRUE, __VA_ARGS__)\n#define PrintInfo(...) PrintStatusInfo(TRUE, FALSE, __VA_ARGS__)\n#define PrintInfoDebug(...) PrintStatusInfo(TRUE, TRUE, __VA_ARGS__)\nextern void UpdateProgress(int op, float percent);\nextern void _UpdateProgressWithInfo(int op, int msg, uint64_t processed, uint64_t total, BOOL force);\n#define UpdateProgressWithInfo(op, msg, processed, total) _UpdateProgressWithInfo(op, msg, processed, total, FALSE)\n#define UpdateProgressWithInfoUpTo(upto, op, msg, processed, total) _UpdateProgressWithInfo(op, msg, (processed) * (upto), (total) * 100, FALSE)\n#define UpdateProgressWithInfoForce(op, msg, processed, total) _UpdateProgressWithInfo(op, msg, processed, total, TRUE)\n#define UpdateProgressWithInfoInit(hProgressDialog, bNoAltMode) UpdateProgressWithInfo(OP_INIT, (int)bNoAltMode, (uint64_t)(uintptr_t)hProgressDialog, 0);\nextern const char* StrError(DWORD error_code, BOOL use_default_locale);\nextern char* GuidToString(const GUID* guid, BOOL bDecorated);\nextern GUID StringToGuid(const char* str);\nextern char* SizeToHumanReadable(uint64_t size, BOOL copy_to_log, BOOL fake_units);\nextern char* TimestampToHumanReadable(uint64_t ts);\nextern HWND MyCreateDialog(HINSTANCE hInstance, int Dialog_ID, HWND hWndParent, DLGPROC lpDialogFunc);\nextern INT_PTR MyDialogBox(HINSTANCE hInstance, int Dialog_ID, HWND hWndParent, DLGPROC lpDialogFunc);\nextern void CenterDialog(HWND hDlg, HWND hParent);\nextern void ResizeMoveCtrl(HWND hDlg, HWND hCtrl, int dx, int dy, int dw, int dh, float scale);\nextern void ResizeButtonHeight(HWND hDlg, int id);\nextern void CreateStatusBar(HFONT* hFont);\nextern void CreateStaticFont(HDC hDC, HFONT* hFont, BOOL underlined);\nextern void SetHyperLinkFont(HWND hWnd, HDC hDC, HFONT* hFont, BOOL underlined);\nextern void SetTitleBarIcon(HWND hDlg);\nextern BOOL CreateTaskbarList(void);\nextern BOOL SetTaskbarProgressState(TASKBAR_PROGRESS_FLAGS tbpFlags);\nextern BOOL SetTaskbarProgressValue(ULONGLONG ullCompleted, ULONGLONG ullTotal);\nextern INT_PTR CreateAboutBox(void);\nextern BOOL CreateTooltip(HWND hControl, const char* message, int duration);\nextern void DestroyTooltip(HWND hWnd);\nextern void DestroyAllTooltips(void);\nextern int NotificationEx(int type, const char* dont_display_setting, const notification_info* more_info, const char* title, const char* format, ...);\n#define Notification(type, title, ...) NotificationEx(type, NULL, NULL, title, __VA_ARGS__)\nextern int SelectionDialog(char* title, char* message, selection_dialog_options_t* options);\nextern void ListDialog(char* title, char* message, char** items, int size);\nextern SIZE GetTextSize(HWND hCtrl, char* txt);\nextern BOOL ExtractAppIcon(const char* filename, BOOL bSilent);\nextern BOOL ExtractDOS(const char* path);\nextern BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan);\nextern BOOL ExtractZip(const char* src_zip, const char* dest_dir);\nextern int64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_file, DWORD attributes);\nextern uint32_t ReadISOFileToBuffer(const char* iso, const char* iso_file, uint8_t** buf);\nextern BOOL HasEfiImgBootLoaders(void);\nextern BOOL DumpFatDir(const char* path, int32_t cluster);\nextern BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int fs);\nextern uint16_t GetSyslinuxVersion(char* buf, size_t buf_size, char** ext);\nextern BOOL SetAutorun(const char* path);\nextern char* FileDialog(BOOL save, char* path, const ext_t* ext, UINT* selected_ext);\nextern BOOL FileIO(enum file_io_type io_type, char* path, char** buffer, DWORD* size);\nextern uint8_t* GetResource(HMODULE module, char* name, char* type, const char* desc, DWORD* len, BOOL duplicate);\nextern DWORD GetResourceSize(HMODULE module, char* name, char* type, const char* desc);\nextern DWORD RunCommandWithProgress(const char* cmdline, const char* dir, BOOL log, int msg, const char* pattern);\n#define RunCommand(cmd, dir, log) RunCommandWithProgress(cmd, dir, log, 0, NULL)\nextern BOOL CompareGUID(const GUID *guid1, const GUID *guid2);\nextern BOOL MountRegistryHive(const HKEY key, const char* pszHiveName, const char* pszHivePath);\nextern BOOL UnmountRegistryHive(const HKEY key, const char* pszHiveName);\nextern BOOL SetLGP(BOOL bRestore, BOOL* bExistingKey, const char* szPath, const char* szPolicy, DWORD dwValue);\nextern LONG GetEntryWidth(HWND hDropDown, const char* entry);\nextern uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char* user_agent,\n\tBYTE** buffer, HWND hProgressDialog, BOOL bTaskBarProgress);\n#define DownloadToFileOrBuffer(url, file, buffer, hProgressDialog, bTaskBarProgress) \\\n\tDownloadToFileOrBufferEx(url, file, NULL, buffer, hProgressDialog, bTaskBarProgress)\nextern DWORD DownloadSignedFile(const char* url, const char* file, HWND hProgressDialog, BOOL PromptOnError);\nextern HANDLE DownloadSignedFileThreaded(const char* url, const char* file, HWND hProgressDialog, BOOL bPromptOnError);\nextern INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\nextern void SetFidoCheck(void);\nextern BOOL SetUpdateCheck(void);\nextern BOOL CheckForUpdates(BOOL force);\nextern void DownloadNewVersion(void);\nextern BOOL DownloadISO(void);\nextern BOOL IsDownloadable(const char* url);\nextern BOOL IsShown(HWND hDlg);\nextern uint32_t read_file(const char* path, uint8_t** buf);\nextern uint32_t write_file(const char* path, const uint8_t* buf, const uint32_t size);\nextern char* get_token_data_file_indexed(const char* token, const char* filename, int index);\n#define get_token_data_file(token, filename) get_token_data_file_indexed(token, filename, 1)\nextern char* set_token_data_file(const char* token, const char* data, const char* filename);\nextern char* get_token_data_buffer(const char* token, unsigned int n, const char* buffer, size_t buffer_size);\nextern char* insert_section_data(const char* filename, const char* section, const char* data, BOOL dos2unix);\nextern char* replace_in_token_data(const char* filename, const char* token, const char* src, const char* rep, BOOL dos2unix);\nextern char* replace_char(const char* src, const char c, const char* rep);\nextern void filter_chars(char* str, const char* rem, const char rep);\nextern char* remove_substr(const char* src, const char* sub);\nextern void parse_update(char* buf, size_t len);\nextern void* get_data_from_asn1(const uint8_t* buf, size_t buf_len, const char* oid_str, uint8_t asn1_type, size_t* data_len);\nextern int sanitize_label(char* label);\nextern int IsHDD(DWORD DriveIndex, uint16_t vid, uint16_t pid, const char* strid);\nextern char* GetSignatureName(const char* path, const char* country_code, uint8_t* thumbprint, BOOL bSilent);\nextern int GetIssuerCertificateInfo(uint8_t* cert, cert_info_t* info);\nextern uint64_t GetSignatureTimeStamp(const char* path);\nextern LONG ValidateSignature(HWND hDlg, const char* path);\nextern BOOL ValidateOpensslSignature(BYTE* pbBuffer, DWORD dwBufferLen, BYTE* pbSignature, DWORD dwSigLen);\nextern BOOL IsFontAvailable(const char* font_name);\nextern BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,\n\tLPDWORD lpNumberOfBytesWritten, DWORD nNumRetries);\nextern HANDLE CreateFileWithTimeout(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,\n\tLPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes,\n\tHANDLE hTemplateFile, DWORD dwTimeOut);\nextern BOOL SetThreadAffinity(DWORD_PTR* thread_affinity, size_t num_threads);\nextern BOOL DetectSHA1Acceleration(void);\nextern BOOL DetectSHA256Acceleration(void);\nextern BOOL HashFile(const unsigned type, const char* path, uint8_t* sum);\nextern BOOL PE256Buffer(uint8_t* buf, uint32_t len, uint8_t* hash);\nextern void UpdateMD5Sum(const char* dest_dir, const char* md5sum_name);\nextern BOOL HashBuffer(const unsigned type, const uint8_t* buf, const size_t len, uint8_t* sum);\nextern uint8_t* StringToHash(const char* str);\nextern BOOL FileMatchesHash(const char* path, const char* str);\nextern BOOL BufferMatchesHash(const uint8_t* buf, const size_t len, const char* str);\nextern BOOL IsFileInDB(const char* path);\nextern BOOL IsSignedBySecureBootAuthority(uint8_t* buf, uint32_t len);\nextern int IsBootloaderRevoked(uint8_t* buf, uint32_t len);\nextern BOOL IsBufferInDB(const unsigned char* buf, const size_t len);\n#define printbits(x) _printbits(sizeof(x), &x, 0)\n#define printbitslz(x) _printbits(sizeof(x), &x, 1)\nextern char* _printbits(size_t const size, void const * const ptr, int leading_zeroes);\nextern BOOL IsCurrentProcessElevated(void);\nextern char* ToLocaleName(DWORD lang_id);\nextern void SetAlertPromptMessages(void);\nextern BOOL SetAlertPromptHook(void);\nextern void ClrAlertPromptHook(void);\nextern BOOL StartProcessSearch(void);\nextern void StopProcessSearch(void);\nextern BOOL SetProcessSearch(DWORD DeviceNum);\nextern BYTE GetProcessSearch(uint32_t timeout, uint8_t access_mask, BOOL bIgnoreStaleProcesses);\nextern BOOL EnablePrivileges(void);\nextern void FlashTaskbar(HANDLE handle);\nextern DWORD WaitForSingleObjectWithMessages(HANDLE hHandle, DWORD dwMilliseconds);\nextern HICON CreateMirroredIcon(HICON hiconOrg);\nextern HANDLE CreatePreallocatedFile(const char* lpFileName, DWORD dwDesiredAccess,\n\tDWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,\n\tDWORD dwFlagsAndAttributes, LONGLONG fileSize);\nextern uint32_t ResolveDllAddress(dll_resolver_t* resolver);\nextern sbat_entry_t* GetSbatEntries(char* sbatlevel);\nextern thumbprint_list_t* GetThumbprintEntries(char* thumbprints_txt);\nextern uint16_t GetPeArch(uint8_t* buf);\nextern uint8_t* GetPeSection(uint8_t* buf, const char* name, uint32_t* len);\nextern uint8_t* GetPeSignatureData(uint8_t* buf);\nextern uint8_t* RvaToPhysical(uint8_t* buf, uint32_t rva);\nextern uint32_t FindResourceRva(const wchar_t* name, uint8_t* root, uint8_t* dir, uint32_t* len);\nextern DWORD ListDirectoryContent(StrArray* arr, char* dir, uint8_t type);\nextern BOOL TakeOwnership(LPCSTR lpszOwnFile);\nextern enum ArchType MachineToArch(WORD machine);\n#define GetTextWidth(hDlg, id) GetTextSize(GetDlgItem(hDlg, id), NULL).cx\n\nDWORD WINAPI HashThread(void* param);\n\n/*\n * typedefs for the function prototypes. Use the something like:\n *   PF_DECL(FormatEx);\n * which translates to:\n *   FormatEx_t pfFormatEx = NULL;\n * in your code, to declare the entrypoint and then use:\n *   PF_INIT(FormatEx, Fmifs);\n * which translates to:\n *   pfFormatEx = (FormatEx_t) GetProcAddress(GetDLLHandle(\"fmifs\"), \"FormatEx\");\n * to make it accessible.\n */\n#define         MAX_LIBRARY_HANDLES 64\nextern HMODULE  OpenedLibrariesHandle[MAX_LIBRARY_HANDLES];\nextern uint16_t OpenedLibrariesHandleSize;\n#define         OPENED_LIBRARIES_VARS HMODULE OpenedLibrariesHandle[MAX_LIBRARY_HANDLES]; uint16_t OpenedLibrariesHandleSize = 0\n#define         CLOSE_OPENED_LIBRARIES while(OpenedLibrariesHandleSize > 0) FreeLibrary(OpenedLibrariesHandle[--OpenedLibrariesHandleSize])\nstatic __inline HMODULE GetLibraryHandle(char* szLibraryName) {\n\tHMODULE h = NULL;\n\twchar_t* wszLibraryName = NULL;\n\tint size;\n\tif (szLibraryName == NULL || szLibraryName[0] == 0)\n\t\tgoto out;\n\tsize = MultiByteToWideChar(CP_UTF8, 0, szLibraryName, -1, NULL, 0);\n\tif ((size <= 1) || ((wszLibraryName = (wchar_t*)calloc(size, sizeof(wchar_t))) == NULL) ||\n\t\t(MultiByteToWideChar(CP_UTF8, 0, szLibraryName, -1, wszLibraryName, size) != size))\n\t\tgoto out;\n\t// If the library is already opened, just return a handle (that doesn't need to be freed)\n\tif ((h = GetModuleHandleW(wszLibraryName)) != NULL)\n\t\tgoto out;\n\t// Sanity check\n\tif (OpenedLibrariesHandleSize >= MAX_LIBRARY_HANDLES) {\n\t\tuprintf(\"Error: MAX_LIBRARY_HANDLES is too small\\n\");\n\t\tgoto out;\n\t}\n\th = LoadLibraryExW(wszLibraryName, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);\n\tif (h != NULL)\n\t\tOpenedLibrariesHandle[OpenedLibrariesHandleSize++] = h;\n\telse\n\t\tuprintf(\"Unable to load '%S.dll': %s\", wszLibraryName, WindowsErrorString());\nout:\n\tfree(wszLibraryName);\n\treturn h;\n}\n#define PF_TYPE(api, ret, proc, args)\t\ttypedef ret (api *proc##_t)args\n#define PF_DECL(proc)\t\t\t\t\t\tstatic proc##_t pf##proc = NULL\n#define PF_TYPE_DECL(api, ret, proc, args)\tPF_TYPE(api, ret, proc, args); PF_DECL(proc)\n#define PF_INIT(proc, name)\t\t\t\t\tif (pf##proc == NULL) pf##proc = \\\n\t(proc##_t) GetProcAddress(GetLibraryHandle(#name), #proc)\n#define PF_INIT_ID(proc, name, id)\t\t\tif (pf##proc == NULL) pf##proc = \\\n\t(proc##_t) GetProcAddress(GetLibraryHandle(#name), MAKEINTRESOURCEA(id))\n#define PF_INIT_OR_OUT(proc, name)\t\t\tdo {PF_INIT(proc, name);         \\\n\tif (pf##proc == NULL) {uprintf(\"Unable to locate %s() in '%s.dll': %s\",  \\\n\t#proc, #name, WindowsErrorString()); goto out;} } while(0)\n#define PF_INIT_ID_OR_OUT(proc, name, id)\tdo {PF_INIT_ID(proc, name, id);  \\\n\tif (pf##proc == NULL) {uprintf(\"Unable to locate %s() in %s.dll: %s\\n\",  \\\n\t#proc, #name, WindowsErrorString()); goto out;} } while(0)\n#define PF_INIT_OR_SET_STATUS(proc, name)\tdo {PF_INIT(proc, name);         \\\n\tif ((pf##proc == NULL) && (NT_SUCCESS(status))) status = STATUS_PROCEDURE_NOT_FOUND; } while(0)\n#if defined(_MSC_VER)\n#define TRY_AND_HANDLE(exception, TRY_CODE, EXCEPTION_CODE) __try TRY_CODE   \\\n\t__except (GetExceptionCode() == exception ? EXCEPTION_EXECUTE_HANDLER :  \\\n\t\t\t  EXCEPTION_CONTINUE_SEARCH) EXCEPTION_CODE\n#else\n// NB: Eventually we may try __try1 and __except1 from MinGW...\n#define TRY_AND_HANDLE(exception, TRY_CODE, EXCEPTION_CODE) TRY_CODE\n#endif\n\n/* Custom application errors */\n#define FAC(f)                         ((f)<<16)\n#define APPERR(err)                    (APPLICATION_ERROR_MASK|(err))\n#define ERROR_INCOMPATIBLE_FS          0x1201\n#define ERROR_CANT_QUICK_FORMAT        0x1202\n#define ERROR_INVALID_CLUSTER_SIZE     0x1203\n#define ERROR_INVALID_VOLUME_SIZE      0x1204\n#define ERROR_CANT_START_THREAD        0x1205\n#define ERROR_BADBLOCKS_FAILURE        0x1206\n#define ERROR_ISO_SCAN                 0x1207\n#define ERROR_ISO_EXTRACT              0x1208\n#define ERROR_CANT_REMOUNT_VOLUME      0x1209\n#define ERROR_CANT_PATCH               0x120A\n#define ERROR_CANT_ASSIGN_LETTER       0x120B\n#define ERROR_CANT_MOUNT_VOLUME        0x120C\n#define ERROR_BAD_SIGNATURE            0x120D\n#define ERROR_CANT_DOWNLOAD            0x120E\n\n#define RUFUS_ERROR(err)               (ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | (err))\n"
  },
  {
    "path": "src/rufus.manifest",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\" xmlns:asmv3=\"urn:schemas-microsoft-com:asm.v3\" >\n  <asmv3:application>\n    <asmv3:windowsSettings xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">\n      <dpiAware>true</dpiAware>\n    </asmv3:windowsSettings>\n    <asmv3:windowsSettings xmlns:ws2=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\">\n      <ws2:longPathAware>true</ws2:longPathAware>\n    </asmv3:windowsSettings>\n    <asmv3:windowsSettings xmlns=\"http://schemas.microsoft.com/SMI/2019/WindowsSettings\">\n      <activeCodePage>UTF-8</activeCodePage>\n    </asmv3:windowsSettings>\n  </asmv3:application>\n  <dependency>\n    <dependentAssembly>\n      <assemblyIdentity\n        type=\"win32\"\n        name=\"Microsoft.Windows.Common-Controls\"\n        version=\"6.0.0.0\"\n        processorArchitecture=\"*\"\n        publicKeyToken=\"6595b64144ccf1df\"\n        language=\"*\"\n      />\n    </dependentAssembly>\n  </dependency>\n  <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n    <security>\n      <requestedPrivileges>\n        <requestedExecutionLevel\n          level=\"requireAdministrator\"\n          uiAccess=\"false\"/>\n      </requestedPrivileges>\n    </security>\n  </trustInfo>\n  <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\"> \n    <!-- If you don't have those in your app, Windows 10's GetVersionEx() -->\n    <!-- DELIBERATELY reports the WRONG version... which brings us to     -->\n    <!-- tonight's spelling bee: \"How do you spell 'spineless morons'?\"   -->\n    <!-- The answer: \"M-I-C-R-O-S-O-F-T; 'spineless morons'!\"             -->\n    <application>\n      <!-- Windows 10 -->\n      <supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"/>\n      <!-- Windows 8.1 -->\n      <supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\"/>\n      <!-- Windows 8 -->\n      <supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\"/>\n      <!-- Windows 7 -->\n      <supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\"/>\n      <!-- Windows Vista -->\n      <supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\"/> \n    </application> \n  </compatibility>\n</assembly>\n"
  },
  {
    "path": "src/rufus.rc",
    "content": "// Microsoft Visual C++ generated resource script.\r\n//\r\n#include \"resource.h\"\r\n\r\n#define APSTUDIO_READONLY_SYMBOLS\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Generated from the TEXTINCLUDE 2 resource.\r\n//\r\n#ifndef _USING_V110_SDK71_\r\n#define _USING_V110_SDK71_\r\n#endif\r\n#include <windows.h>\r\n#ifndef IDC_STATIC\r\n#define IDC_STATIC -1\r\n#endif\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n#undef APSTUDIO_READONLY_SYMBOLS\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n// Neutral resources\r\n\r\n#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)\r\nLANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL\r\n#pragma code_page(1252)\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Dialog\r\n//\r\n\r\nIDD_DIALOG DIALOGEX 12, 12, 232, 326\r\nSTYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nEXSTYLE WS_EX_ACCEPTFILES\r\nCAPTION \"Rufus 4.14.2328\"\r\nFONT 9, \"Segoe UI Symbol\", 400, 0, 0x0\r\nBEGIN\r\n    LTEXT           \"Drive Properties\",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP\r\n    LTEXT           \"Device\",IDS_DEVICE_TXT,8,21,216,8\r\n    COMBOBOX        IDC_DEVICE,8,30,196,10,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r\n    PUSHBUTTON      \"...\",IDC_SAVE,210,30,14,12,BS_FLAT | NOT WS_VISIBLE\r\n    LTEXT           \"Boot selection\",IDS_BOOT_SELECTION_TXT,8,43,216,8\r\n    COMBOBOX        IDC_BOOT_SELECTION,8,52,148,10,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP\r\n    PUSHBUTTON      \"#\",IDC_HASH,162,52,10,12,BS_FLAT | NOT WS_VISIBLE\r\n    CONTROL         \"SELECT\",IDC_SELECT,\"Button\", WS_TABSTOP,180,52,45,10\r\n    LTEXT           \"Image option\",IDS_IMAGE_OPTION_TXT,8,65,216,8\r\n    COMBOBOX        IDC_IMAGE_OPTION,8,74,96,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r\n    CONTROL         \"\",IDC_PERSISTENCE_SLIDER,\"msctls_trackbar32\",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,125,76,34,8\r\n    EDITTEXT        IDC_PERSISTENCE_SIZE,160,74,36,12,ES_AUTOHSCROLL | ES_NUMBER\r\n    COMBOBOX        IDC_PERSISTENCE_UNITS,200,74,24,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r\n    LTEXT           \"Partition scheme\",IDS_PARTITION_TYPE_TXT,8,87,96,8\r\n    COMBOBOX        IDC_PARTITION_TYPE,8,96,96,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r\n    LTEXT           \"Target system\",IDS_TARGET_SYSTEM_TXT,128,87,96,8\r\n    COMBOBOX        IDC_TARGET_SYSTEM,128,96,96,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r\n    LTEXT           \"?\",IDS_CSM_HELP_TXT,226,97,8,15,SS_NOTIFY | NOT WS_VISIBLE\r\n    CONTROL         \"Show advanced drive properties\",IDC_ADVANCED_DRIVE_PROPERTIES,\r\n                    \"Button\",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,8,109,216,10\r\n    CONTROL         \"List USB Hard Drives\",IDC_LIST_USB_HDD,\"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,8,119,216,10\r\n    CONTROL         \"Add fixes for old BIOSes (extra partition, align, etc.)\",IDC_OLD_BIOS_FIXES,\r\n                    \"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,8,129,216,10\r\n    CONTROL         \"Enable runtime UEFI media validation\",IDC_UEFI_MEDIA_VALIDATION,\r\n                    \"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,8,139,216,10\r\n    LTEXT           \"Format Options\",IDS_FORMAT_OPTIONS_TXT,8,152,57,12,NOT WS_GROUP\r\n    LTEXT           \"Volume label\",IDS_LABEL_TXT,8,167,216,8\r\n    EDITTEXT        IDC_LABEL,8,176,216,12,ES_AUTOHSCROLL\r\n    LTEXT           \"File system\",IDS_FILE_SYSTEM_TXT,8,189,96,8\r\n    COMBOBOX        IDC_FILE_SYSTEM,8,198,96,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r\n    LTEXT           \"Cluster size\",IDS_CLUSTER_SIZE_TXT,128,189,96,8\r\n    COMBOBOX        IDC_CLUSTER_SIZE,128,198,96,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r\n    CONTROL         \"Show advanced format options\",IDC_ADVANCED_FORMAT_OPTIONS,\r\n                    \"Button\",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,8,211,216,10\r\n    CONTROL         \"Quick format\",IDC_QUICK_FORMAT,\"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,8,221,216,10\r\n    CONTROL         \"Create extended label and icon files\",IDC_EXTENDED_LABEL,\r\n                    \"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,8,231,216,10\r\n    CONTROL         \"Check device for bad blocks\",IDC_BAD_BLOCKS,\"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,8,241,112,10\r\n    COMBOBOX        IDC_NB_PASSES,128,241,96,10,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r\n    LTEXT           \"Status\",IDS_STATUS_TXT,8,254,23,9,NOT WS_GROUP\r\n    CONTROL         \"\",IDC_PROGRESS,\"msctls_progress32\",PBS_SMOOTH | WS_BORDER,8,273,216,9\r\n    PUSHBUTTON      \"Multi Toolbar\",IDC_ABOUT,8,294,74,10,NOT WS_VISIBLE\r\n    PUSHBUTTON      \"T\",IDC_TEST,90,294,12,10,NOT WS_VISIBLE\r\n    DEFPUSHBUTTON   \"START\",IDC_START,124,294,45,10\r\n    PUSHBUTTON      \"CLOSE\",IDCANCEL,178,294,45,10\r\nEND\r\n\r\nIDD_ABOUTBOX DIALOGEX 0, 0, 319, 237\r\nSTYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"About Rufus\"\r\nFONT 9, \"Segoe UI Symbol\", 400, 0, 0x0\r\nBEGIN\r\n    ICON            IDI_ICON,IDC_ABOUT_ICON,11,8,20,20\r\n    CONTROL         \"\",IDC_ABOUT_BLURB,\"RichEdit20W\",0x884,45,7,268,107\r\n    CONTROL         \"\",IDC_ABOUT_COPYRIGHTS,\"RichEdit20W\",WS_VSCROLL | WS_TABSTOP | 0x804,46,115,267,91,WS_EX_STATICEDGE\r\n    PUSHBUTTON      \"License\",IDC_ABOUT_LICENSE,46,216,50,12,WS_GROUP\r\n    DEFPUSHBUTTON   \"OK\",IDOK,253,216,50,12,WS_GROUP\r\nEND\r\n\r\nIDD_HASH DIALOGEX 0, 0, 301, 110\r\nSTYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Checksums\"\r\nFONT 9, \"Segoe UI Symbol\", 400, 0, 0x0\r\nBEGIN\r\n    LTEXT           \"MD5:\",IDC_STATIC,9,10,18,8\r\n    EDITTEXT        IDC_MD5,40,9,197,12,ES_AUTOHSCROLL | ES_READONLY\r\n    LTEXT           \"SHA1:\",IDC_STATIC,9,26,20,8\r\n    EDITTEXT        IDC_SHA1,40,25,197,12,ES_AUTOHSCROLL | ES_READONLY\r\n    LTEXT           \"SHA256:\",IDC_STATIC,9,42,27,8\r\n    EDITTEXT        IDC_SHA256,40,41,197,22,ES_MULTILINE | ES_READONLY\r\n    DEFPUSHBUTTON   \"OK\",IDOK,243,86,50,12,WS_GROUP\r\n    LTEXT           \"SHA512:\",IDC_STATIC,9,69,27,8\r\n    EDITTEXT        IDC_SHA512,40,67,197,35,ES_MULTILINE | ES_READONLY\r\nEND\r\n\r\nIDD_LICENSE DIALOGEX 0, 0, 335, 213\r\nSTYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Rufus License\"\r\nFONT 9, \"Segoe UI Symbol\", 400, 0, 0x0\r\nBEGIN\r\n    DEFPUSHBUTTON   \"Close\",IDCANCEL,278,192,50,12\r\n    EDITTEXT        IDC_LICENSE_TEXT,7,7,321,176,ES_MULTILINE | ES_READONLY | WS_VSCROLL\r\nEND\r\n\r\nIDD_LOG DIALOGEX 0, 0, 366, 326\r\nSTYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Log\"\r\nFONT 9, \"Segoe UI Symbol\", 400, 0, 0x0\r\nBEGIN\r\n    EDITTEXT        IDC_LOG_EDIT,0,0,366,296,ES_MULTILINE | ES_READONLY | NOT WS_BORDER | WS_VSCROLL,WS_EX_CLIENTEDGE\r\n    PUSHBUTTON      \"Clear\",IDC_LOG_CLEAR,192,305,50,12\r\n    PUSHBUTTON      \"Save\",IDC_LOG_SAVE,249,305,50,12\r\n    DEFPUSHBUTTON   \"Close\",IDCANCEL,306,305,50,12\r\nEND\r\n\r\nIDD_NOTIFICATION DIALOGEX 0, 0, 263, 73\r\nSTYLE DS_SETFONT | DS_NOFAILCREATE | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_THICKFRAME\r\nCAPTION \"Rufus\"\r\nFONT 9, \"Segoe UI Symbol\", 400, 0, 0x0\r\nBEGIN\r\n    LTEXT           \"\",IDC_NOTIFICATION_LINE,0,0,263,35\r\n    LTEXT           \"\",IDC_STATIC,0,0,263,34\r\n    ICON            OCR_UP,IDC_NOTIFICATION_ICON,6,6,20,20\r\n    LTEXT           \"Message\",IDC_NOTIFICATION_TEXT,35,6,219,20\r\n    DEFPUSHBUTTON   \"No\",IDNO,205,53,50,14\r\n    PUSHBUTTON      \"More information\",IDC_MORE_INFO,8,53,76,14,NOT WS_VISIBLE\r\n    PUSHBUTTON      \"Yes\",IDYES,148,53,50,14,NOT WS_VISIBLE\r\n    CONTROL         \"Do not show this message again\",IDC_DONT_DISPLAY_AGAIN,\r\n                    \"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,8,39,248,10,WS_EX_TRANSPARENT\r\n    PUSHBUTTON      \"Abort\",IDABORT,91,53,50,14,NOT WS_VISIBLE\r\nEND\r\n\r\nIDD_SELECTION DIALOGEX 0, 0, 312, 71\r\nSTYLE DS_SETFONT | DS_FIXEDSYS | DS_NOFAILCREATE | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_THICKFRAME\r\nCAPTION \"Rufus\"\r\nFONT 9, \"Segoe UI Symbol\", 400, 0, 0x0\r\nBEGIN\r\n    LTEXT           \"\",IDC_SELECTION_LINE,0,0,312,47\r\n    LTEXT           \"\",IDC_STATIC,0,0,312,46\r\n    ICON            IDI_ICON,IDC_SELECTION_ICON,6,6,20,20,0,WS_EX_TRANSPARENT\r\n    LTEXT           \"Message\",IDC_SELECTION_TEXT,35,5,269,8\r\n    DEFPUSHBUTTON   \"OK\",IDOK,196,53,50,12\r\n    PUSHBUTTON      \"Cancel\",IDCANCEL,254,53,50,12\r\n    CONTROL         \"Choice 1\",IDC_SELECTION_CHOICE1,\"Button\",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,35,18,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 2\",IDC_SELECTION_CHOICE2,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,31,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 3\",IDC_SELECTION_CHOICE3,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,44,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 4\",IDC_SELECTION_CHOICE4,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,57,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 5\",IDC_SELECTION_CHOICE5,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,70,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 6\",IDC_SELECTION_CHOICE6,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,83,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 7\",IDC_SELECTION_CHOICE7,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,96,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 8\",IDC_SELECTION_CHOICE8,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,109,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 9\",IDC_SELECTION_CHOICE9,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,122,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 10\",IDC_SELECTION_CHOICE10,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,135,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 11\",IDC_SELECTION_CHOICE11,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,148,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 12\",IDC_SELECTION_CHOICE12,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,161,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 13\",IDC_SELECTION_CHOICE13,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,174,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 14\",IDC_SELECTION_CHOICE14,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,187,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 15\",IDC_SELECTION_CHOICE15,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,200,269,10,WS_EX_TRANSPARENT\r\n    CONTROL         \"Choice 16\",IDC_SELECTION_CHOICEMAX,\"Button\",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_TABSTOP,35,213,269,10,WS_EX_TRANSPARENT\r\n    EDITTEXT        IDC_SELECTION_USERNAME,197,57,0,9,ES_AUTOHSCROLL | NOT WS_VISIBLE | WS_TABSTOP | WS_BORDER\r\n    COMBOBOX        IDC_SELECTION_EDITION,197,57,0,9,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r\nEND\r\n\r\nIDD_LIST DIALOGEX 0, 0, 312, 59\r\nSTYLE DS_SETFONT | DS_FIXEDSYS | DS_NOFAILCREATE | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_THICKFRAME\r\nCAPTION \"Rufus\"\r\nFONT 9, \"Segoe UI Symbol\", 400, 0, 0x0\r\nBEGIN\r\n    LTEXT           \"\",IDC_LIST_LINE,0,0,312,32\r\n    LTEXT           \"\",IDC_STATIC,0,0,312,31\r\n    ICON            IDI_ICON,IDC_LIST_ICON,6,6,20,20,0,WS_EX_TRANSPARENT\r\n    LTEXT           \"Message\",IDC_LIST_TEXT,35,5,269,8\r\n    PUSHBUTTON      \"OK\",IDOK,254,40,50,12\r\n    LTEXT           \"List 1\",IDC_LIST_ITEM1,35,17,269,10,SS_PATHELLIPSIS\r\n    LTEXT           \"List 2\",IDC_LIST_ITEM2,35,28,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 3\",IDC_LIST_ITEM3,35,39,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 4\",IDC_LIST_ITEM4,35,50,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 5\",IDC_LIST_ITEM5,35,61,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 6\",IDC_LIST_ITEM6,35,72,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 7\",IDC_LIST_ITEM7,35,73,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 8\",IDC_LIST_ITEM8,35,84,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 9\",IDC_LIST_ITEM9,35,95,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 10\",IDC_LIST_ITEM10,35,106,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 11\",IDC_LIST_ITEM11,35,117,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 12\",IDC_LIST_ITEM12,35,128,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 13\",IDC_LIST_ITEM13,35,139,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 14\",IDC_LIST_ITEM14,35,150,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 15\",IDC_LIST_ITEM15,35,161,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\n    LTEXT           \"List 16\",IDC_LIST_ITEMMAX,35,172,269,10,SS_PATHELLIPSIS | NOT WS_VISIBLE\r\nEND\r\n\r\nIDD_UPDATE_POLICY DIALOGEX 0, 0, 287, 198\r\nSTYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Update policy and settings\"\r\nFONT 9, \"Segoe UI Symbol\", 400, 0, 0x0\r\nBEGIN\r\n    ICON            IDI_ICON,IDC_ABOUT_ICON,11,8,20,20\r\n    CONTROL         \"\",IDC_POLICY,\"RichEdit20W\",WS_VSCROLL | WS_TABSTOP | 0x804,45,8,236,132,WS_EX_STATICEDGE\r\n    GROUPBOX        \"Settings\",IDS_UPDATE_SETTINGS_GRP,45,145,165,46\r\n    LTEXT           \"Check for updates\",IDS_UPDATE_FREQUENCY_TXT,51,158,80,10\r\n    COMBOBOX        IDC_UPDATE_FREQUENCY,133,158,66,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r\n    LTEXT           \"Include beta versions\",IDS_INCLUDE_BETAS_TXT,51,173,80,10\r\n    COMBOBOX        IDC_INCLUDE_BETAS,133,173,66,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r\n    GROUPBOX        \"\",IDS_CHECK_NOW_GRP,210,145,71,46\r\n    PUSHBUTTON      \"Check Now\",IDC_CHECK_NOW,221,158,50,11\r\n    DEFPUSHBUTTON   \"Close\",IDCANCEL,221,173,50,11,WS_GROUP\r\nEND\r\n\r\nIDD_NEW_VERSION DIALOGEX 0, 0, 384, 268\r\nSTYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Check For Updates - Rufus\"\r\nFONT 9, \"Segoe UI Symbol\", 400, 0, 0x0\r\nBEGIN\r\n    PUSHBUTTON      \"Close\",IDCANCEL,167,245,50,12,WS_GROUP\r\n    CONTROL         \"\",IDC_RELEASE_NOTES,\"RichEdit20W\",WS_VSCROLL | 0x804,15,77,352,88,WS_EX_STATICEDGE\r\n    GROUPBOX        \"Release Notes\",IDS_NEW_VERSION_NOTES_GRP,8,63,367,111\r\n    LTEXT           \"A newer version is available. Please download the latest version!\",IDS_NEW_VERSION_AVAIL_TXT,10,32,366,8\r\n    LTEXT           \"[...]\",IDC_YOUR_VERSION,10,8,366,8\r\n    LTEXT           \"[...]\",IDC_LATEST_VERSION,10,19,366,8\r\n    CTEXT           \"Click here to go to the website\",IDC_WEBSITE,10,49,366,9,SS_NOTIFY\r\n    GROUPBOX        \"Download\",IDS_NEW_VERSION_DOWNLOAD_GRP,8,177,367,58\r\n    EDITTEXT        IDC_DOWNLOAD_URL,15,191,351,11,ES_AUTOHSCROLL | ES_READONLY\r\n    CONTROL         \"\",IDC_PROGRESS,\"msctls_progress32\",WS_BORDER,15,212,270,11\r\n    DEFPUSHBUTTON   \"Download\",IDC_DOWNLOAD,293,212,74,11,WS_GROUP\r\nEND\r\n\r\n\r\n#ifdef APSTUDIO_INVOKED\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// TEXTINCLUDE\r\n//\r\n\r\n1 TEXTINCLUDE\r\nBEGIN\r\n    \"resource.h\\0\"\r\nEND\r\n\r\n2 TEXTINCLUDE\r\nBEGIN\r\n    \"#ifndef _USING_V110_SDK71_\\r\\n\"\r\n    \"#define _USING_V110_SDK71_\\r\\n\"\r\n    \"#endif\\r\\n\"\r\n    \"#include <windows.h>\\r\\n\"\r\n    \"#ifndef IDC_STATIC\\r\\n\"\r\n    \"#define IDC_STATIC -1\\r\\n\"\r\n    \"#endif\\r\\n\"\r\n    \"\\0\"\r\nEND\r\n\r\n3 TEXTINCLUDE\r\nBEGIN\r\n    \"\\r\\n\"\r\n    \"IDR_LC_RUFUS_LOC        RCDATA                  \"\"../res/loc/embedded.loc\"\"\\r\\n\"\r\n    \"IDR_SL_LDLINUX_V4_BSS   RCDATA                  \"\"../res/syslinux/ldlinux_v4.bss\"\"\\r\\n\"\r\n    \"IDR_SL_LDLINUX_V4_SYS   RCDATA                  \"\"../res/syslinux/ldlinux_v4.sys\"\"\\r\\n\"\r\n    \"IDR_SL_LDLINUX_V6_BSS   RCDATA                  \"\"../res/syslinux/ldlinux_v6.bss\"\"\\r\\n\"\r\n    \"IDR_SL_LDLINUX_V6_SYS   RCDATA                  \"\"../res/syslinux/ldlinux_v6.sys\"\"\\r\\n\"\r\n    \"IDR_SL_MBOOT_C32        RCDATA                  \"\"../res/syslinux/mboot.c32\"\"\\r\\n\"\r\n    \"IDR_GR_GRUB_GRLDR_MBR   RCDATA                  \"\"../res/grub/grldr.mbr\"\"\\r\\n\"\r\n    \"IDR_GR_GRUB2_CORE_IMG   RCDATA                  \"\"../res/grub2/core.img\"\"\\r\\n\"\r\n    \"IDR_SBR_MSG             RCDATA                  \"\"../res/mbr/msg.txt\"\"\\r\\n\"\r\n    \"IDR_FD_COMMAND_COM      RCDATA                  \"\"../res/freedos/COMMAND.COM\"\"\\r\\n\"\r\n    \"IDR_FD_KERNEL_SYS       RCDATA                  \"\"../res/freedos/KERNEL.SYS\"\"\\r\\n\"\r\n    \"IDR_FD_DISPLAY_EXE      RCDATA                  \"\"../res/freedos/DISPLAY.EXE\"\"\\r\\n\"\r\n    \"IDR_FD_KEYB_EXE         RCDATA                  \"\"../res/freedos/KEYB.EXE\"\"\\r\\n\"\r\n    \"IDR_FD_MODE_COM         RCDATA                  \"\"../res/freedos/MODE.COM\"\"\\r\\n\"\r\n    \"IDR_FD_KB1_SYS          RCDATA                  \"\"../res/freedos/KEYBOARD.SYS\"\"\\r\\n\"\r\n    \"IDR_FD_KB2_SYS          RCDATA                  \"\"../res/freedos/KEYBRD2.SYS\"\"\\r\\n\"\r\n    \"IDR_FD_KB3_SYS          RCDATA                  \"\"../res/freedos/KEYBRD3.SYS\"\"\\r\\n\"\r\n    \"IDR_FD_KB4_SYS          RCDATA                  \"\"../res/freedos/KEYBRD4.SYS\"\"\\r\\n\"\r\n    \"IDR_FD_EGA1_CPX         RCDATA                  \"\"../res/freedos/EGA.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA2_CPX         RCDATA                  \"\"../res/freedos/EGA2.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA3_CPX         RCDATA                  \"\"../res/freedos/EGA3.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA4_CPX         RCDATA                  \"\"../res/freedos/EGA4.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA5_CPX         RCDATA                  \"\"../res/freedos/EGA5.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA6_CPX         RCDATA                  \"\"../res/freedos/EGA6.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA7_CPX         RCDATA                  \"\"../res/freedos/EGA7.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA8_CPX         RCDATA                  \"\"../res/freedos/EGA8.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA9_CPX         RCDATA                  \"\"../res/freedos/EGA9.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA10_CPX        RCDATA                  \"\"../res/freedos/EGA10.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA11_CPX        RCDATA                  \"\"../res/freedos/EGA11.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA12_CPX        RCDATA                  \"\"../res/freedos/EGA12.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA13_CPX        RCDATA                  \"\"../res/freedos/EGA13.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA14_CPX        RCDATA                  \"\"../res/freedos/EGA14.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA15_CPX        RCDATA                  \"\"../res/freedos/EGA15.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA16_CPX        RCDATA                  \"\"../res/freedos/EGA16.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA17_CPX        RCDATA                  \"\"../res/freedos/EGA17.CPX\"\"\\r\\n\"\r\n    \"IDR_FD_EGA18_CPX        RCDATA                  \"\"../res/freedos/EGA18.CPX\"\"\\r\\n\"\r\n    \"IDR_XT_HOGGER           RCDATA                  \"\"../res/hogger/hogger.exe\"\"\\r\\n\"\r\n    \"IDR_UEFI_NTFS           RCDATA                  \"\"../res/uefi/uefi-ntfs.img\"\"\\r\\n\"\r\n    \"IDR_SETUP_X64           RCDATA                  \"\"../res/setup/setup_x64.exe\"\"\\r\\n\"\r\n    \"IDR_SETUP_ARM64         RCDATA                  \"\"../res/setup/setup_arm64.exe\"\"\\r\\n\"\r\n    \"IDR_MD5_BOOTIA32        RCDATA                  \"\"../res/md5/bootia32.efi\"\"\\r\\n\"\r\n    \"IDR_MD5_BOOTX64         RCDATA                  \"\"../res/md5/bootx64.efi\"\"\\r\\n\"\r\n    \"IDR_MD5_BOOTARM         RCDATA                  \"\"../res/md5/bootarm.efi\"\"\\r\\n\"\r\n    \"IDR_MD5_BOOTAA64        RCDATA                  \"\"../res/md5/bootaa64.efi\"\"\\r\\n\"\r\n    \"IDR_MD5_BOOTRISCV64     RCDATA                  \"\"../res/md5/bootriscv64.efi\"\"\\r\\n\"\r\n    \"IDR_MD5_BOOTLOONGARCH64 RCDATA                  \"\"../res/md5/bootloongarch64.efi\"\"\\r\\n\"\r\n    \"IDR_DBX_IA32            RCDATA                  \"\"../res/dbx/x86_DBXUpdate.bin\"\"\\r\\n\"\r\n    \"IDR_DBX_X64             RCDATA                  \"\"../res/dbx/amd64_DBXUpdate.bin\"\"\\r\\n\"\r\n    \"IDR_DBX_ARM             RCDATA                  \"\"../res/dbx/arm_DBXUpdate.bin\"\"\\r\\n\"\r\n    \"IDR_DBX_AA64            RCDATA                  \"\"../res/dbx/arm64_DBXUpdate.bin\"\"\\r\\n\"\r\n    \"IDR_DBX_IA64            RCDATA                  \"\"../res/dbx/ia64_DBXUpdate.bin\"\"\\r\\n\"\r\n    \"IDR_DBX_RISCV64         RCDATA                  \"\"../res/dbx/riscv64_DBXUpdate.bin\"\"\\r\\n\"\r\n    \"IDR_DBX_LOONGARCH64     RCDATA                  \"\"../res/dbx/loongarch64_DBXUpdate.bin\"\"\\r\\n\"\r\n    \"IDI_LANG_16             RCDATA                  \"\"../res/icons/lang-16.png\"\"\\r\\n\"\r\n    \"IDI_INFO_16             RCDATA                  \"\"../res/icons/info-16.png\"\"\\r\\n\"\r\n    \"IDI_SETTINGS_16         RCDATA                  \"\"../res/icons/settings-16.png\"\"\\r\\n\"\r\n    \"IDI_LOG_16              RCDATA                  \"\"../res/icons/log-16.png\"\"\\r\\n\"\r\n    \"IDI_SAVE_16             RCDATA                  \"\"../res/icons/save-16.png\"\"\\r\\n\"\r\n    \"IDI_HASH_16             RCDATA                  \"\"../res/icons/hash-16.png\"\"\\r\\n\"\r\n    \"IDI_LANG_24             RCDATA                  \"\"../res/icons/lang-24.png\"\"\\r\\n\"\r\n    \"IDI_INFO_24             RCDATA                  \"\"../res/icons/info-24.png\"\"\\r\\n\"\r\n    \"IDI_SETTINGS_24         RCDATA                  \"\"../res/icons/settings-24.png\"\"\\r\\n\"\r\n    \"IDI_LOG_24              RCDATA                  \"\"../res/icons/log-24.png\"\"\\r\\n\"\r\n    \"IDI_SAVE_24             RCDATA                  \"\"../res/icons/save-24.png\"\"\\r\\n\"\r\n    \"IDI_HASH_24             RCDATA                  \"\"../res/icons/hash-24.png\"\"\\r\\n\"\r\n    \"IDI_LANG_32             RCDATA                  \"\"../res/icons/lang-32.png\"\"\\r\\n\"\r\n    \"IDI_INFO_32             RCDATA                  \"\"../res/icons/info-32.png\"\"\\r\\n\"\r\n    \"IDI_SETTINGS_32         RCDATA                  \"\"../res/icons/settings-32.png\"\"\\r\\n\"\r\n    \"IDI_LOG_32              RCDATA                  \"\"../res/icons/log-32.png\"\"\\r\\n\"\r\n    \"IDI_SAVE_32             RCDATA                  \"\"../res/icons/save-32.png\"\"\\r\\n\"\r\n    \"IDI_HASH_32             RCDATA                  \"\"../res/icons/hash-32.png\"\"\\r\\n\"\r\n    \"\\r\\n\"\r\n    \"// Must reference a manifest for visual styles and elevation\\r\\n\"\r\n    \"// Oh, and it must happen at the end, or MinGW will ignore it!\\r\\n\"\r\n    \"#if defined(__GNUC__)\\r\\n\"\r\n    \"CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST \"\"rufus.manifest\"\"\\r\\n\"\r\n    \"#endif\\r\\n\"\r\n    \"\\0\"\r\nEND\r\n\r\n#endif    // APSTUDIO_INVOKED\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// DESIGNINFO\r\n//\r\n\r\n#ifdef APSTUDIO_INVOKED\r\nGUIDELINES DESIGNINFO\r\nBEGIN\r\n    IDD_DIALOG, DIALOG\r\n    BEGIN\r\n    END\r\n\r\n    IDD_ABOUTBOX, DIALOG\r\n    BEGIN\r\n    END\r\n\r\n    IDD_HASH, DIALOG\r\n    BEGIN\r\n    END\r\n\r\n    IDD_LICENSE, DIALOG\r\n    BEGIN\r\n    END\r\n\r\n    IDD_LOG, DIALOG\r\n    BEGIN\r\n    END\r\n\r\n    IDD_NOTIFICATION, DIALOG\r\n    BEGIN\r\n    END\r\n\r\n    IDD_SELECTION, DIALOG\r\n    BEGIN\r\n    END\r\n\r\n    IDD_LIST, DIALOG\r\n    BEGIN\r\n    END\r\n\r\n    IDD_UPDATE_POLICY, DIALOG\r\n    BEGIN\r\n    END\r\n\r\n    IDD_NEW_VERSION, DIALOG\r\n    BEGIN\r\n    END\r\nEND\r\n#endif    // APSTUDIO_INVOKED\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Version\r\n//\r\n\r\nVS_VERSION_INFO VERSIONINFO\r\n FILEVERSION 4,14,2328,0\r\n PRODUCTVERSION 4,14,2328,0\r\n FILEFLAGSMASK 0x3fL\r\n#ifdef _DEBUG\r\n FILEFLAGS 0x1L\r\n#else\r\n FILEFLAGS 0x0L\r\n#endif\r\n FILEOS 0x40004L\r\n FILETYPE 0x1L\r\n FILESUBTYPE 0x0L\r\nBEGIN\r\n    BLOCK \"StringFileInfo\"\r\n    BEGIN\r\n        BLOCK \"000004b0\"\r\n        BEGIN\r\n            VALUE \"Comments\", \"https://rufus.ie\"\r\n            VALUE \"CompanyName\", \"Akeo Consulting\"\r\n            VALUE \"FileDescription\", \"Rufus\"\r\n            VALUE \"FileVersion\", \"4.14.2328\"\r\n            VALUE \"InternalName\", \"Rufus\"\r\n            VALUE \"LegalCopyright\", \" 2011-2026 Pete Batard (GPL v3)\"\r\n            VALUE \"LegalTrademarks\", \"https://www.gnu.org/licenses/gpl-3.0.html\"\r\n            VALUE \"OriginalFilename\", \"rufus-4.14.exe\"\r\n            VALUE \"ProductName\", \"Rufus\"\r\n            VALUE \"ProductVersion\", \"4.14.2328\"\r\n        END\r\n    END\r\n    BLOCK \"VarFileInfo\"\r\n    BEGIN\r\n        VALUE \"Translation\", 0x0, 1200\r\n    END\r\nEND\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Icon\r\n//\r\n\r\n// Icon with lowest ID value placed first to ensure application icon\r\n// remains consistent on all systems.\r\nIDI_ICON                ICON                    \"../res/rufus.ico\"\r\n\r\n#endif    // Neutral resources\r\n/////////////////////////////////////////////////////////////////////////////\r\n\r\n\r\n\r\n#ifndef APSTUDIO_INVOKED\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Generated from the TEXTINCLUDE 3 resource.\r\n//\r\n\r\nIDR_LC_RUFUS_LOC        RCDATA                  \"../res/loc/embedded.loc\"\r\nIDR_SL_LDLINUX_V4_BSS   RCDATA                  \"../res/syslinux/ldlinux_v4.bss\"\r\nIDR_SL_LDLINUX_V4_SYS   RCDATA                  \"../res/syslinux/ldlinux_v4.sys\"\r\nIDR_SL_LDLINUX_V6_BSS   RCDATA                  \"../res/syslinux/ldlinux_v6.bss\"\r\nIDR_SL_LDLINUX_V6_SYS   RCDATA                  \"../res/syslinux/ldlinux_v6.sys\"\r\nIDR_SL_MBOOT_C32        RCDATA                  \"../res/syslinux/mboot.c32\"\r\nIDR_GR_GRUB_GRLDR_MBR   RCDATA                  \"../res/grub/grldr.mbr\"\r\nIDR_GR_GRUB2_CORE_IMG   RCDATA                  \"../res/grub2/core.img\"\r\nIDR_SBR_MSG             RCDATA                  \"../res/mbr/msg.txt\"\r\nIDR_FD_COMMAND_COM      RCDATA                  \"../res/freedos/COMMAND.COM\"\r\nIDR_FD_KERNEL_SYS       RCDATA                  \"../res/freedos/KERNEL.SYS\"\r\nIDR_FD_DISPLAY_EXE      RCDATA                  \"../res/freedos/DISPLAY.EXE\"\r\nIDR_FD_KEYB_EXE         RCDATA                  \"../res/freedos/KEYB.EXE\"\r\nIDR_FD_MODE_COM         RCDATA                  \"../res/freedos/MODE.COM\"\r\nIDR_FD_KB1_SYS          RCDATA                  \"../res/freedos/KEYBOARD.SYS\"\r\nIDR_FD_KB2_SYS          RCDATA                  \"../res/freedos/KEYBRD2.SYS\"\r\nIDR_FD_KB3_SYS          RCDATA                  \"../res/freedos/KEYBRD3.SYS\"\r\nIDR_FD_KB4_SYS          RCDATA                  \"../res/freedos/KEYBRD4.SYS\"\r\nIDR_FD_EGA1_CPX         RCDATA                  \"../res/freedos/EGA.CPX\"\r\nIDR_FD_EGA2_CPX         RCDATA                  \"../res/freedos/EGA2.CPX\"\r\nIDR_FD_EGA3_CPX         RCDATA                  \"../res/freedos/EGA3.CPX\"\r\nIDR_FD_EGA4_CPX         RCDATA                  \"../res/freedos/EGA4.CPX\"\r\nIDR_FD_EGA5_CPX         RCDATA                  \"../res/freedos/EGA5.CPX\"\r\nIDR_FD_EGA6_CPX         RCDATA                  \"../res/freedos/EGA6.CPX\"\r\nIDR_FD_EGA7_CPX         RCDATA                  \"../res/freedos/EGA7.CPX\"\r\nIDR_FD_EGA8_CPX         RCDATA                  \"../res/freedos/EGA8.CPX\"\r\nIDR_FD_EGA9_CPX         RCDATA                  \"../res/freedos/EGA9.CPX\"\r\nIDR_FD_EGA10_CPX        RCDATA                  \"../res/freedos/EGA10.CPX\"\r\nIDR_FD_EGA11_CPX        RCDATA                  \"../res/freedos/EGA11.CPX\"\r\nIDR_FD_EGA12_CPX        RCDATA                  \"../res/freedos/EGA12.CPX\"\r\nIDR_FD_EGA13_CPX        RCDATA                  \"../res/freedos/EGA13.CPX\"\r\nIDR_FD_EGA14_CPX        RCDATA                  \"../res/freedos/EGA14.CPX\"\r\nIDR_FD_EGA15_CPX        RCDATA                  \"../res/freedos/EGA15.CPX\"\r\nIDR_FD_EGA16_CPX        RCDATA                  \"../res/freedos/EGA16.CPX\"\r\nIDR_FD_EGA17_CPX        RCDATA                  \"../res/freedos/EGA17.CPX\"\r\nIDR_FD_EGA18_CPX        RCDATA                  \"../res/freedos/EGA18.CPX\"\r\nIDR_XT_HOGGER           RCDATA                  \"../res/hogger/hogger.exe\"\r\nIDR_UEFI_NTFS           RCDATA                  \"../res/uefi/uefi-ntfs.img\"\r\nIDR_SETUP_X64           RCDATA                  \"../res/setup/setup_x64.exe\"\r\nIDR_SETUP_ARM64         RCDATA                  \"../res/setup/setup_arm64.exe\"\r\nIDR_MD5_BOOTIA32        RCDATA                  \"../res/md5/bootia32.efi\"\r\nIDR_MD5_BOOTX64         RCDATA                  \"../res/md5/bootx64.efi\"\r\nIDR_MD5_BOOTARM         RCDATA                  \"../res/md5/bootarm.efi\"\r\nIDR_MD5_BOOTAA64        RCDATA                  \"../res/md5/bootaa64.efi\"\r\nIDR_MD5_BOOTRISCV64     RCDATA                  \"../res/md5/bootriscv64.efi\"\r\nIDR_MD5_BOOTLOONGARCH64 RCDATA                  \"../res/md5/bootloongarch64.efi\"\r\nIDR_DBX_IA32            RCDATA                  \"../res/dbx/x86_DBXUpdate.bin\"\r\nIDR_DBX_X64             RCDATA                  \"../res/dbx/amd64_DBXUpdate.bin\"\r\nIDR_DBX_ARM             RCDATA                  \"../res/dbx/arm_DBXUpdate.bin\"\r\nIDR_DBX_AA64            RCDATA                  \"../res/dbx/arm64_DBXUpdate.bin\"\r\nIDR_DBX_IA64            RCDATA                  \"../res/dbx/ia64_DBXUpdate.bin\"\r\nIDR_DBX_RISCV64         RCDATA                  \"../res/dbx/riscv64_DBXUpdate.bin\"\r\nIDR_DBX_LOONGARCH64     RCDATA                  \"../res/dbx/loongarch64_DBXUpdate.bin\"\r\nIDI_LANG_16             RCDATA                  \"../res/icons/lang-16.png\"\r\nIDI_INFO_16             RCDATA                  \"../res/icons/info-16.png\"\r\nIDI_SETTINGS_16         RCDATA                  \"../res/icons/settings-16.png\"\r\nIDI_LOG_16              RCDATA                  \"../res/icons/log-16.png\"\r\nIDI_SAVE_16             RCDATA                  \"../res/icons/save-16.png\"\r\nIDI_HASH_16             RCDATA                  \"../res/icons/hash-16.png\"\r\nIDI_LANG_24             RCDATA                  \"../res/icons/lang-24.png\"\r\nIDI_INFO_24             RCDATA                  \"../res/icons/info-24.png\"\r\nIDI_SETTINGS_24         RCDATA                  \"../res/icons/settings-24.png\"\r\nIDI_LOG_24              RCDATA                  \"../res/icons/log-24.png\"\r\nIDI_SAVE_24             RCDATA                  \"../res/icons/save-24.png\"\r\nIDI_HASH_24             RCDATA                  \"../res/icons/hash-24.png\"\r\nIDI_LANG_32             RCDATA                  \"../res/icons/lang-32.png\"\r\nIDI_INFO_32             RCDATA                  \"../res/icons/info-32.png\"\r\nIDI_SETTINGS_32         RCDATA                  \"../res/icons/settings-32.png\"\r\nIDI_LOG_32              RCDATA                  \"../res/icons/log-32.png\"\r\nIDI_SAVE_32             RCDATA                  \"../res/icons/save-32.png\"\r\nIDI_HASH_32             RCDATA                  \"../res/icons/hash-32.png\"\r\n\r\n// Must reference a manifest for visual styles and elevation\r\n// Oh, and it must happen at the end, or MinGW will ignore it!\r\n#if defined(__GNUC__)\r\nCREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST \"rufus.manifest\"\r\n#endif\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n#endif    // not APSTUDIO_INVOKED\r\n\r\n"
  },
  {
    "path": "src/settings.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Settings access, through either registry or INI file\n * Copyright © 2015-2024 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n#include <windows.h>\n#include <stdint.h>\n#include \"rufus.h\"\n#include \"msapi_utf8.h\"\n#include \"registry.h\"\n\n#pragma once\nextern char* ini_file;\n\n/*\n * List of setting names used by this application\n */\n#define SETTING_ADVANCED_MODE               \"AdvancedMode\"\n#define SETTING_ADVANCED_MODE_DEVICE        \"ShowAdvancedDriveProperties\"\n#define SETTING_ADVANCED_MODE_FORMAT        \"ShowAdvancedFormatOptions\"\n#define SETTING_COMM_CHECK                  \"CommCheck64\"\n#define SETTING_DEFAULT_THREAD_PRIORITY     \"DefaultThreadPriority\"\n#define SETTING_DARK_MODE                   \"DarkMode\"\n#define SETTING_DISABLE_FAKE_DRIVES_CHECK   \"DisableFakeDrivesCheck\"\n#define SETTING_DISABLE_LGP                 \"DisableLGP\"\n#define SETTING_DISABLE_RUFUS_MBR           \"DisableRufusMBR\"\n#define SETTING_DISABLE_SECURE_BOOT_NOTICE  \"DisableSecureBootNotice\"\n#define SETTING_DISABLE_VHDS                \"DisableVHDs\"\n#define SETTING_ENABLE_EXTRA_HASHES         \"EnableExtraHashes\"\n#define SETTING_ENABLE_FILE_INDEXING        \"EnableFileIndexing\"\n#define SETTING_ENABLE_RUNTIME_VALIDATION   \"EnableRuntimeValidation\"\n#define SETTING_ENABLE_USB_DEBUG            \"EnableUsbDebug\"\n#define SETTING_ENABLE_VMDK_DETECTION       \"EnableVmdkDetection\"\n#define SETTING_ENABLE_WIN_DUAL_EFI_BIOS    \"EnableWindowsDualUefiBiosMode\"\n#define SETTING_EXPERT_MODE                 \"ExpertMode\"\n#define SETTING_FORCE_LARGE_FAT32_FORMAT    \"ForceLargeFat32Formatting\"\n#define SETTING_IGNORE_BOOT_MARKER          \"IgnoreBootMarker\"\n#define SETTING_INCLUDE_BETAS               \"CheckForBetas\"\n#define SETTING_LAST_UPDATE                 \"LastUpdateCheck\"\n#define SETTING_LOCALE                      \"Locale\"\n#define SETTING_UPDATE_INTERVAL             \"UpdateCheckInterval\"\n#define SETTING_USE_EXT_VERSION             \"UseExtVersion\"\n#define SETTING_USE_PROPER_SIZE_UNITS       \"UseProperSizeUnits\"\n#define SETTING_USE_UDF_VERSION             \"UseUdfVersion\"\n#define SETTING_USE_VDS                     \"UseVds\"\n#define SETTING_PERSISTENT_LOG              \"PersistentLog\"\n#define SETTING_PREFERRED_SAVE_IMAGE_TYPE   \"PreferredSaveImageType\"\n#define SETTING_PRESERVE_TIMESTAMPS         \"PreserveTimestamps\"\n#define SETTING_VERBOSE_UPDATES             \"VerboseUpdateCheck\"\n#define SETTING_WUE_OPTIONS                 \"WindowsUserExperienceOptions\"\n\n\nstatic __inline BOOL CheckIniKey(const char* key) {\n\tchar* str = get_token_data_file(key, ini_file);\n\tBOOL ret = (str != NULL);\n\tsafe_free(str);\n\treturn ret;\n}\n#define CheckIniKey64 CheckIniKey\n#define CheckIniKey32 CheckIniKey\n#define CheckIniKeyBool CheckIniKey\n#define CheckIniKeyStr CheckIniKey\n\nstatic __inline int64_t ReadIniKey64(const char* key) {\n\tint64_t val = 0;\n\tchar* str = get_token_data_file(key, ini_file);\n\tif (str != NULL) {\n\t\tval = _strtoi64(str, NULL, 0);\n\t\tfree(str);\n\t}\n\treturn val;\n}\nstatic __inline BOOL WriteIniKey64(const char* key, int64_t val) {\n\tchar str[24];\n\tstatic_sprintf(str, \"%\" PRIi64, val);\n\treturn (set_token_data_file(key, str, ini_file) != NULL);\n}\n\nstatic __inline int32_t ReadIniKey32(const char* key) {\n\tint32_t val = 0;\n\tchar* str = get_token_data_file(key, ini_file);\n\tif (str != NULL) {\n\t\tval = strtol(str, NULL, 0);\n\t\tfree(str);\n\t}\n\treturn val;\n}\nstatic __inline BOOL WriteIniKey32(const char* key, int32_t val) {\n\tchar str[12];\n\tstatic_sprintf(str, \"%d\", val);\n\treturn (set_token_data_file(key, str, ini_file) != NULL);\n}\n\nstatic __inline char* ReadIniKeyStr(const char* key) {\n\tstatic char str[512];\n\tchar* val;\n\tstr[0] = 0;\n\tval = get_token_data_file(key, ini_file);\n\tif (val != NULL) {\n\t\tstatic_strcpy(str, val);\n\t\tfree(val);\n\t}\n\treturn str;\n}\n\nstatic __inline BOOL WriteIniKeyStr(const char* key, const char* val) {\n\treturn (set_token_data_file(key, val, ini_file) != NULL);\n}\n\n/* Helpers for boolean operations */\n#define ReadIniKeyBool(key) (ReadIniKey32(key) != 0)\n#define WriteIniKeyBool(key, b) WriteIniKey32(key, (b)?1:0)\n\n/*\n * Read and store settings from/to ini file or registry\n */\nstatic __inline int64_t ReadSetting64(const char* key) {\n\treturn (ini_file != NULL)?ReadIniKey64(key):ReadRegistryKey64(REGKEY_HKCU, key);\n}\nstatic __inline BOOL WriteSetting64(const char* key, int64_t val) {\n\treturn (ini_file != NULL)?WriteIniKey64(key, val):WriteRegistryKey64(REGKEY_HKCU, key, val);\n}\nstatic __inline int32_t ReadSetting32(const char* key) {\n\treturn (ini_file != NULL)?ReadIniKey32(key):ReadRegistryKey32(REGKEY_HKCU, key);\n}\nstatic __inline BOOL WriteSetting32(const char* key, int32_t val) {\n\treturn (ini_file != NULL)?WriteIniKey32(key, val):WriteRegistryKey32(REGKEY_HKCU, key, val);\n}\nstatic __inline BOOL ReadSettingBool(const char* key) {\n\treturn (ini_file != NULL)?ReadIniKeyBool(key):ReadRegistryKeyBool(REGKEY_HKCU, key);\n}\nstatic __inline BOOL WriteSettingBool(const char* key, BOOL val) {\n\treturn (ini_file != NULL)?WriteIniKeyBool(key, val):WriteRegistryKeyBool(REGKEY_HKCU, key, val);\n}\nstatic __inline char* ReadSettingStr(const char* key) {\n\treturn (ini_file != NULL)?ReadIniKeyStr(key):ReadRegistryKeyStr(REGKEY_HKCU, key);\n}\nstatic __inline BOOL WriteSettingStr(const char* key, char* val) {\n\treturn (ini_file != NULL)?WriteIniKeyStr(key, val):WriteRegistryKeyStr(REGKEY_HKCU, key, val);\n}\n"
  },
  {
    "path": "src/smart.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * SMART HDD vs Flash detection (using ATA over USB, S.M.A.R.T., etc.)\n * Copyright © 2013-2023 Pete Batard <pete@akeo.ie>\n *\n * Based in part on scsiata.cpp from Smartmontools: http://smartmontools.sourceforge.net\n * Copyright © 2006-2012 Douglas Gilbert <dgilbert@interlog.com>\n * Copyright © 2009-2013 Christian Franke <smartmontools-support@lists.sourceforge.net>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <stdio.h>\n#include <string.h>\n#include <ctype.h>\n#include <stddef.h>\n\n#include \"rufus.h\"\n#include \"missing.h\"\n#include \"msapi_utf8.h\"\n\n#include \"drive.h\"\n#include \"smart.h\"\n#include \"hdd_vs_ufd.h\"\n\n#if defined(RUFUS_TEST)\n/* Helper functions */\nstatic uint8_t GetAtaDirection(uint8_t AtaCmd, uint8_t Features) {\n\t// Far from complete -- only the commands we *may* use.\n\n\t// Most SMART commands require DATA_IN but there are a couple exceptions\n\tBOOL smart_out = (AtaCmd == ATA_SMART_CMD) &&\n\t\t((Features == ATA_SMART_STATUS) || (Features == ATA_SMART_WRITE_LOG_SECTOR));\n\n\tswitch (AtaCmd) {\n\tcase ATA_IDENTIFY_DEVICE:\n\tcase ATA_READ_LOG_EXT:\n\t\treturn ATA_PASSTHROUGH_DATA_IN;\n\tcase ATA_SMART_CMD:\n\t\tif (!smart_out)\n\t\t\treturn ATA_PASSTHROUGH_DATA_IN;\n\t\t// fall through\n\tcase ATA_DATA_SET_MANAGEMENT:\n\t\treturn ATA_PASSTHROUGH_DATA_OUT;\n\tdefault:\n\t\treturn ATA_PASSTHROUGH_DATA_NONE;\n\t}\n}\n\nconst char* SptStrerr(int errcode)\n{\n\tstatic char scsi_err[64];\n\n\tif ((errcode > 0) && (errcode <= 0xff)) {\n\t\tstatic_sprintf(scsi_err, \"SCSI status: 0x%02X\", (uint8_t)errcode);\n\t\treturn (const char*)scsi_err;\n\t}\n\n\tswitch(errcode) {\n\tcase SPT_SUCCESS:\n\t\treturn \"Success\";\n\tcase SPT_ERROR_CDB_LENGTH:\n\t\treturn \"Invalid CDB length\";\n\tcase SPT_ERROR_BUFFER:\n\t\treturn \"Buffer must be aligned to a page boundary and less than 64KB in size\";\n\tcase SPT_ERROR_DIRECTION:\n\t\treturn \"Invalid Direction\";\n\tcase SPT_ERROR_EXTENDED_CDB:\n\t\treturn \"Extended and variable length CDB commands are not supported\";\n\tcase SPT_ERROR_CDB_OPCODE:\n\t\treturn \"Opcodes above 0xC0 are not supported\";\n\tcase SPT_ERROR_TIMEOUT:\n\t\treturn \"Timeout\";\n\tcase SPT_ERROR_INVALID_PARAMETER:\n\t\treturn \"Invalid DeviceIoControl parameter\";\n\tcase SPT_ERROR_CHECK_STATUS:\n\t\treturn \"SCSI error (check Status)\";\n\tdefault:\n\t\treturn \"Unknown error\";\n\t}\n}\n\n/*\n * SCSI Passthrough (using IOCTL_SCSI_PASS_THROUGH_DIRECT)\n * Should be provided a handle to the physical device (R/W) as well as a Cdb and a buffer that is page aligned\n * Direction should be one of SCSI_IOCTL_DATA_###\n *\n * Returns 0 (SPT_SUCCESS) on success, a positive SCSI Status in case of an SCSI error or negative otherwise.\n */\n\nBOOL ScsiPassthroughDirect(HANDLE hPhysical, uint8_t* Cdb, size_t CdbLen, uint8_t Direction,\n\t\t\t\t\t\t   void* DataBuffer, size_t BufLen, uint32_t Timeout)\n{\n\tSCSI_PASS_THROUGH_DIRECT_WITH_BUFFER sptdwb = {{0}, 0, {0}};\n\tDWORD err, size = sizeof(SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER);\n\tBOOL r;\n\n\t// Sanity checks\n\tif ((CdbLen == 0) || (CdbLen > sizeof(sptdwb.sptd.Cdb)))\n\t\treturn SPT_ERROR_CDB_LENGTH;\n\n\tif (((uintptr_t)DataBuffer % 0x10 != 0) || (BufLen > 0xFFFF))\n\t\treturn SPT_ERROR_BUFFER;\n\n\tif (Direction > SCSI_IOCTL_DATA_UNSPECIFIED)\n\t\treturn SPT_ERROR_DIRECTION;\n\n\t// http://en.wikipedia.org/wiki/SCSI_command\n\tif ((Cdb[0] == 0x7e) || (Cdb[0] == 0x7f))\n\t\treturn SPT_ERROR_EXTENDED_CDB;\n\n\t// Opcodes above 0xC0 are unsupported (apart for the special JMicron/Sunplus modes)\n\tif ( (Cdb[0] >= 0xc0) && (Cdb[0] != USB_JMICRON_ATA_PASSTHROUGH)\n\t  && (Cdb[0] != USB_SUNPLUS_ATA_PASSTHROUGH) )\n\t\treturn SPT_ERROR_CDB_OPCODE;\n\n\tsptdwb.sptd.Length = sizeof(SCSI_PASS_THROUGH_DIRECT);\n\tsptdwb.sptd.PathId = 0;\n\tsptdwb.sptd.TargetId = 0;\n\tsptdwb.sptd.Lun = 0;\n\tsptdwb.sptd.CdbLength = (uint8_t)CdbLen;\n\tsptdwb.sptd.DataIn = Direction;\t\t// One of SCSI_IOCTL_DATA_###\n\tsptdwb.sptd.SenseInfoLength = SPT_SENSE_LENGTH;\n\tsptdwb.sptd.DataTransferLength = (uint16_t)BufLen;\n\tsptdwb.sptd.TimeOutValue = Timeout;\n\tsptdwb.sptd.DataBuffer = DataBuffer;\n\tsptdwb.sptd.SenseInfoOffset = offsetof(SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER, SenseBuf);\n\n\tmemcpy(sptdwb.sptd.Cdb, Cdb, CdbLen);\n\n\tr = DeviceIoControl(hPhysical, IOCTL_SCSI_PASS_THROUGH_DIRECT, &sptdwb, size, &sptdwb, size, &size, FALSE);\n\tif ((r) && (sptdwb.sptd.ScsiStatus == 0)) {\n\t\treturn SPT_SUCCESS;\n\t}\n\n\tif (sptdwb.sptd.ScsiStatus != 0) {\n\t\t// uprintf(\"ScsiPassthroughDirect: CDB command 0x%02X failed (SCSI status 0x%02X)\\n\", Cdb[0], sptdwb.sptd.ScsiStatus);\n\t\treturn (int)sptdwb.sptd.ScsiStatus;\n\t} else {\n\t\terr = GetLastError();\n\t\t// uprintf(\"ScsiPassthroughDirect: CDB command 0x%02X failed %s\\n\", Cdb[0], WindowsErrorString()); SetLastError(err);\n\t\tswitch(err) {\n\t\tcase ERROR_SEM_TIMEOUT:\n\t\t\treturn SPT_ERROR_TIMEOUT;\n\t\tcase ERROR_INVALID_PARAMETER:\n\t\t\treturn SPT_ERROR_INVALID_PARAMETER;\n\t\tdefault:\n\t\t\treturn SPT_ERROR_UNKNOWN_ERROR;\n\t\t}\n\t}\n\treturn FALSE;\n}\n\n\n/* See ftp://ftp.t10.org/t10/document.04/04-262r8.pdf, http://www.scsitoolbox.com/pdfs/UsingSAT.pdf,\n * as well as http://nevar.pl/pliki/ATA8-ACS-3.pdf‎ */\nstatic int SatAtaPassthrough(HANDLE hPhysical, ATA_PASSTHROUGH_CMD* Command, void* DataBuffer, size_t BufLen, uint32_t Timeout)\n{\n\tuint8_t Cdb[12] = {0};\n\tint extend = 0;     /* For 48-bit ATA command (unused here) */\n\tint ck_cond = 0;    /* Set to 1 to read register(s) back */\n\tint protocol = 3;   /* Non-data */\n\tint t_dir = 1;      /* 0 -> to device, 1 -> from device */\n\tint byte_block = 1; /* 0 -> bytes, 1 -> 512 byte blocks */\n\tint t_length = 0;   /* 0 -> no data transferred */\n\tuint8_t Direction;\n\n\tif (BufLen % SelectedDrive.SectorSize != 0) {\n\t\tuprintf(\"SatAtaPassthrough: BufLen must be a multiple of <block size>\\n\");\n\t\treturn SPT_ERROR_BUFFER;\n\t}\n\n\t// Set data direction\n\tDirection = GetAtaDirection(Command->AtaCmd, Command->Features);\n\tif (BufLen != 0) {\n\t\tswitch (Direction) {\n\t\tcase ATA_PASSTHROUGH_DATA_NONE:\n\t\t\tbreak;\n\t\tcase ATA_PASSTHROUGH_DATA_IN:\n\t\t\tprotocol = 4;  // PIO data-in\n\t\t\tt_length = 2;  // The transfer length is specified in the sector_count field\n\t\t\tbreak;\n\t\tcase ATA_PASSTHROUGH_DATA_OUT:\n\t\t\tprotocol = 5;  // PIO data-out\n\t\t\tt_length = 2;  // The transfer length is specified in the sector_count field\n\t\t\tt_dir = 0;     // to device\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tCdb[0] = SAT_ATA_PASSTHROUGH_12;\n\tCdb[1] = (protocol << 1) | extend;\n\tCdb[2] = (ck_cond << 5) | (t_dir << 3) | (byte_block << 2) | t_length;\n\tCdb[3] = Command->Features;\n\tCdb[4] = (uint8_t)(BufLen >> SECTOR_SIZE_SHIFT_BIT);\n\tCdb[5] = Command->Lba_low;\n\tCdb[6] = Command->Lba_mid;\n\tCdb[7] = Command->Lba_high;\n\tCdb[8] = Command->Device;\t\t\t// (m_port == 0 ? 0xa0 : 0xb0);  // Must be 0 for identify\n\tCdb[9] = Command->AtaCmd;\n\n\treturn ScsiPassthroughDirect(hPhysical, Cdb, sizeof(Cdb), Direction, DataBuffer, BufLen, Timeout);\n}\n\n/* The only differences between JMicron and Prolific are the extra 2 bytes for the CDB */\nstatic int _UsbJMPLAtaPassthrough(HANDLE hPhysical, ATA_PASSTHROUGH_CMD* Command,\n\t\tvoid* DataBuffer, size_t BufLen, uint32_t Timeout, BOOL prolific)\n{\n\tuint8_t Cdb[14] = {0};\n\tuint8_t Direction;\n\n\tDirection = GetAtaDirection(Command->AtaCmd, Command->Features);\n\n\tCdb[0] = USB_JMICRON_ATA_PASSTHROUGH;\n\tCdb[1] = ((BufLen != 0) && (Direction == ATA_PASSTHROUGH_DATA_OUT))?0x00:0x10;\n\tCdb[3] = (uint8_t)(BufLen >> 8);\n\tCdb[4] = (uint8_t)(BufLen);\n\tCdb[5] = Command->Features;\n\tCdb[6] = (uint8_t)(BufLen >> SECTOR_SIZE_SHIFT_BIT);\n\tCdb[7] = Command->Lba_low;\n\tCdb[8] = Command->Lba_mid;\n\tCdb[9] = Command->Lba_high;\n\tCdb[10] = Command->Device;\t\t\t// (m_port == 0 ? 0xa0 : 0xb0);  // Must be 0 for identify\n\tCdb[11] = Command->AtaCmd;\n\t// Prolific PL3507\n\tCdb[12] = 0x06;\n\tCdb[13] = 0x7b;\n\n\treturn ScsiPassthroughDirect(hPhysical, Cdb, sizeof(Cdb)-(prolific?2:0), Direction, DataBuffer, BufLen, Timeout);\n}\n\nstatic int UsbJmicronAtaPassthrough(HANDLE hPhysical, ATA_PASSTHROUGH_CMD* Command, void* DataBuffer, size_t BufLen, uint32_t Timeout)\n{\n\treturn _UsbJMPLAtaPassthrough(hPhysical, Command, DataBuffer, BufLen, Timeout, FALSE);\n}\n\n/* UNTESTED!!! */\nstatic int UsbProlificAtaPassthrough(HANDLE hPhysical, ATA_PASSTHROUGH_CMD* Command, void* DataBuffer, size_t BufLen, uint32_t Timeout)\n{\n\treturn _UsbJMPLAtaPassthrough(hPhysical, Command, DataBuffer, BufLen, Timeout, TRUE);\n}\n\n/* UNTESTED!!! */\nstatic int UsbSunPlusAtaPassthrough(HANDLE hPhysical, ATA_PASSTHROUGH_CMD* Command, void* DataBuffer, size_t BufLen, uint32_t Timeout)\n{\n\tuint8_t Cdb[12] = {0};\n\tuint8_t Direction;\n\n\tDirection = GetAtaDirection(Command->AtaCmd, Command->Features);\n\n\tCdb[0] = USB_SUNPLUS_ATA_PASSTHROUGH;\n\tCdb[2] = 0x22;\n\tif (BufLen != 0) {\n\t\tif (Direction == ATA_PASSTHROUGH_DATA_IN)\n\t\t\tCdb[3] = 0x10;\n\t\telse if (Direction == ATA_PASSTHROUGH_DATA_OUT)\n\t\t\tCdb[3] = 0x11;\n\t}\n\tCdb[4] = (uint8_t)(BufLen >> SECTOR_SIZE_SHIFT_BIT);\n\tCdb[5] = Command->Features;\n\tCdb[6] = (uint8_t)(BufLen >> SECTOR_SIZE_SHIFT_BIT);\n\tCdb[7] = Command->Lba_low;\n\tCdb[8] = Command->Lba_mid;\n\tCdb[9] = Command->Lba_high;\n\tCdb[10] = Command->Device | 0xa0;\n\tCdb[11] = Command->AtaCmd;\n\n\treturn ScsiPassthroughDirect(hPhysical, Cdb, sizeof(Cdb), Direction, DataBuffer, BufLen, Timeout);\n}\n\n/* UNTESTED!!! */\n/* See: http://kernel.opensuse.org/cgit/kernel/tree/drivers/usb/storage/cypress_atacb.c */\nstatic int UsbCypressAtaPassthrough(HANDLE hPhysical, ATA_PASSTHROUGH_CMD* Command, void* DataBuffer, size_t BufLen, uint32_t Timeout)\n{\n\tuint8_t Cdb[16] = {0};\n\tuint8_t Direction;\n\n\tDirection = GetAtaDirection(Command->AtaCmd, Command->Features);\n\n\tCdb[0] = USB_CYPRESS_ATA_PASSTHROUGH;\n\tCdb[1] = USB_CYPRESS_ATA_PASSTHROUGH;\n\tif (Command->AtaCmd == ATA_IDENTIFY_DEVICE || Command->AtaCmd == ATA_IDENTIFY_PACKET_DEVICE)\n\t\tCdb[2] = (1<<7);\t\t\t\t// Set IdentifyPacketDevice\n\tCdb[3] = 0xff - (1<<0) - (1<<6);\t// Features, sector count, lba low, lba med, lba high\n\tCdb[4] = 1;\t\t\t\t\t\t\t// Units in blocks rather than bytes\n\n\tCdb[6] = Command->Features;\n\tCdb[7] = (uint8_t)(BufLen >> SECTOR_SIZE_SHIFT_BIT);\n\tCdb[8] = Command->Lba_low;\n\tCdb[9] = Command->Lba_mid;\n\tCdb[10] = Command->Lba_high;\n\tCdb[11] = Command->Device;\n\tCdb[12] = Command->AtaCmd;\n\n\treturn ScsiPassthroughDirect(hPhysical, Cdb, sizeof(Cdb), Direction, DataBuffer, BufLen, Timeout);\n}\n\n/* The various bridges we will try, in order */\nAtaPassThroughType ata_pt[] = {\n\t{ SatAtaPassthrough, \"SAT\" },\n\t{ UsbJmicronAtaPassthrough, \"JMicron\" },\n\t{ UsbProlificAtaPassthrough, \"Prolific\" },\n\t{ UsbSunPlusAtaPassthrough, \"SunPlus\" },\n\t{ UsbCypressAtaPassthrough, \"Cypress\" },\n};\n\nBOOL Identify(HANDLE hPhysical)\n{\n\tATA_PASSTHROUGH_CMD Command = {0};\n\tIDENTIFY_DEVICE_DATA* idd;\n\tint i, r;\n\n\tCommand.AtaCmd = ATA_IDENTIFY_DEVICE;\n\n\t// You'll get an error here if your compiler does not properly pack the IDENTIFY struct\n\tCOMPILE_TIME_ASSERT(sizeof(IDENTIFY_DEVICE_DATA) == 512);\n\n\tidd = (IDENTIFY_DEVICE_DATA*)_mm_malloc(sizeof(IDENTIFY_DEVICE_DATA), 0x10);\n\tif (idd == NULL)\n\t\treturn FALSE;\n\n\tfor (i=0; i<ARRAYSIZE(ata_pt); i++) {\n\t\tr = ata_pt[i].fn(hPhysical, &Command, idd, sizeof(IDENTIFY_DEVICE_DATA), SPT_TIMEOUT_VALUE);\n\t\tif (r == SPT_SUCCESS) {\n\t\t\tuprintf(\"Success using %s\\n\", ata_pt[i].type);\n\t\t\tif (idd->CommandSetSupport.SmartCommands) {\n\t\t\t\tDumpBufferHex(idd, sizeof(IDENTIFY_DEVICE_DATA));\n\t\t\t\tuprintf(\"SMART support detected!\\n\");\n\t\t\t} else {\n\t\t\t\tuprintf(\"No SMART support\\n\");\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tuprintf(\"No joy with: %s (%s)\\n\", ata_pt[i].type, SptStrerr(r));\n\t}\n\tif (i >= ARRAYSIZE(ata_pt))\n\t\tuprintf(\"NO ATA FOR YOU!\\n\");\n\n\t_mm_free(idd);\n\treturn TRUE;\n}\n#endif\n\n/* Generic SMART access. Kept for reference, as it doesn't work for USB to ATA/SATA bridges */\n#if 0\n#pragma pack(1)\ntypedef struct  {\n\tUCHAR  bVersion;\n\tUCHAR  bRevision;\n\tUCHAR  bReserved;\n\tUCHAR  bIDEDeviceMap;\n\tULONG  fCapabilities;\n\tULONG  dwReserved[4];\n} MY_GETVERSIONINPARAMS;\n#pragma pack()\n\n#ifndef SMART_GET_VERSION\n#define SMART_GET_VERSION \\\n  CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS)\n#endif\n\nBOOL SmartGetVersion(HANDLE hdevice)\n{\n\tMY_GETVERSIONINPARAMS vers;\n\tDWORD size = sizeof(MY_GETVERSIONINPARAMS);\n\tBOOL r;\n\n\tmemset(&vers, 0, sizeof(vers));\n\n\tr = DeviceIoControl(hdevice, SMART_GET_VERSION, NULL, 0, &vers, sizeof(vers), &size, NULL);\n\tif ( (!r) || (size != sizeof(MY_GETVERSIONINPARAMS)) ) {\n\t\tuprintf(\"SmartGetVersion failed: %s\\n\", r?\"unexpected size\":WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\tuprintf(\"Smart Version: %d.%d, Caps = 0x%x, DeviceMap = 0x%02x\\n\",\n\t\tvers.bVersion, vers.bRevision, (unsigned)vers.fCapabilities, vers.bIDEDeviceMap);\n\n\treturn vers.bIDEDeviceMap;\n}\n#endif\n\n/*\n * This attempts to detect whether a drive is an USB HDD or an USB Flash Drive (UFD).\n * A positive score means that we think it's an USB HDD, zero or negative means that\n * we think it's an UFD.\n *\n * This is done so that, if someone already has an USB HDD plugged in (say as a\n * backup drive) and plugs an UFD we *try* to do what we can to avoid them formatting\n * that drive by mistake.\n * However, because there is no foolproof (let alone easy) way to differentiate UFDs\n * from HDDs, thanks to every manufacturer, Microsoft, and their mothers, making it\n * exceedingly troublesome to find what type of hardware we are actually accessing,\n * you are expected to pay heed to the following:\n *\n * WARNING: NO PROMISE IS MADE ABOUT THIS ALGORITHM BEING ABLE TO CORRECTLY\n * DIFFERENTIATE AN USB HDD FROM AN USB FLASH DRIVE. MOREOVER, YOU ARE REMINDED THAT\n * THE LICENSE OF THIS APPLICATION MAKES NO PROMISE ABOUT AVOIDING DATA LOSS EITHER\n * (PROVIDED \"AS IS\").\n * THUS, IF DATA LOSS IS INCURRED DUE TO THIS, OR ANY OTHER PART OF THIS APPLICATION,\n * NOT BEHAVING IN THE MANNER YOU EXPECTED, THE RESPONSIBILITY IS ENTIRELY ON YOU!\n *\n * What you have below, then, is our *current best guess* at differentiating UFDs\n * from HDDs. But short of a crystal ball, this remains just a guess, which may be\n * way off mark. Still, you are also reminded that Rufus does produce PROMINENT\n * warnings before you format a drive, and also provides extensive info about the\n * drive (from the tooltips and the log) => PAY ATTENTION TO THESE OR PAY THE PRICE!\n *\n * But let me just elaborate further on why differentiating UFDs from HDDs is not as\n * 'simple' as it seems:\n * - many USB flash drives manufacturer will present UFDs as non-removable, which used\n *   to be reserved for HDDs => we can't use that as differentiator.\n * - some UFDs (SanDisk Extreme) have added S.M.A.R.T. support, which also used to be\n *   reserved for HDDs => can't use that either\n * - even if S.M.A.R.T. was enough, not all USB->IDE or USB->SATA bridges support ATA\n *   passthrough, which is required S.M.A.R.T. data, and each manufacturer of an\n *   USB<->(S)ATA bridge seem to have their own method of implementing passthrough.\n * - SSDs have also changed the deal completely, as you can get something that looks\n *   like Flash but that is really an HDD.\n * - Some manufacturers (eg. Verbatim) provide both USB Flash Drives and USB HDDs, so\n *   we can't exactly use the VID to say for sure what we're looking at.\n * - Finally, Microsoft is absolutely no help either (which is kind of understandable\n *   from the above) => there is no magic API we can query that will tell us what we're\n *   really looking at.\n */\nint IsHDD(DWORD DriveIndex, uint16_t vid, uint16_t pid, const char* strid)\n{\n\tint score = 0;\n\tsize_t i, mlen, ilen, score_list_size = 0;\n\tBOOL wc;\n\tuint64_t drive_size;\n\tint8_t score_list[16];\n\tchar str[64] = { 0 };\n\n\t// Boost the score if fixed, as these are *generally* HDDs\n\tif (GetDriveTypeFromIndex(DriveIndex) == DRIVE_FIXED) {\n\t\tscore_list[score_list_size] = 3;\n\t\tscore += score_list[score_list_size++];\n\t}\n\n\t// Adjust the score depending on the size\n\tdrive_size = GetDriveSize(DriveIndex);\n\tif (drive_size > 800 * GB) {\n\t\tscore_list[score_list_size] = 15;\n\t\tscore += score_list[score_list_size++];\n\t\tif (drive_size > 1800 * GB) {\n\t\t\tscore_list[score_list_size] = 15;\n\t\t\tscore += score_list[score_list_size++];\n\t\t}\n\t} else if (drive_size < 128 * GB) {\n\t\tscore_list[score_list_size] = -15;\n\t\tscore += score_list[score_list_size++];\n\t}\n\n\t// Check the string against well known HDD identifiers\n\tif (strid != NULL) {\n\t\tilen = strlen(strid);\n\t\tfor (i = 0; i < ARRAYSIZE(str_score); i++) {\n\t\t\tmlen = strlen(str_score[i].name);\n\t\t\tif (mlen > ilen)\n\t\t\t\tbreak;\n\t\t\twc = (str_score[i].name[mlen-1] == '#');\n\t\t\tif ( (_strnicmp(strid, str_score[i].name, mlen-((wc)?1:0)) == 0)\n\t\t\t  && ((!wc) || ((strid[mlen] >= '0') && (strid[mlen] <= '9'))) ) {\n\t\t\t\tscore_list[score_list_size] = str_score[i].score;\n\t\t\t\tscore += score_list[score_list_size++];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Adjust for oddball devices\n\tif (strid != NULL) {\n\t\tfor (i = 0; i < ARRAYSIZE(str_adjust); i++)\n\t\t\tif (StrStrIA(strid, str_adjust[i].name) != NULL) {\n\t\t\t\tscore_list[score_list_size] = str_adjust[i].score;\n\t\t\t\tscore += score_list[score_list_size++];\n\t\t\t}\n\t}\n\n\t// Check against known VIDs\n\tfor (i = 0; i < ARRAYSIZE(vid_score); i++) {\n\t\tif (vid == vid_score[i].vid) {\n\t\t\tscore_list[score_list_size] = vid_score[i].score;\n\t\t\tscore += score_list[score_list_size++];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Check against known VID:PIDs\n\tfor (i = 0; i < ARRAYSIZE(vidpid_score); i++) {\n\t\tif ((vid == vidpid_score[i].vid) && (pid == vidpid_score[i].pid)) {\n\t\t\tscore_list[score_list_size] = vidpid_score[i].score;\n\t\t\tscore += score_list[score_list_size++];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Print a breakdown of the device score if requested\n\tif (usb_debug) {\n\t\tstatic_strcat(str, \"Device score: \");\n\t\tfor (i = 0; i < score_list_size; i++)\n\t\t\tsafe_sprintf(&str[strlen(str)], sizeof(str) - strlen(str), \"%+d\", score_list[i]);\n\t\tuprintf(\"%s=%+d → Detected as %s\", str, score, (score > 0) ? \"HDD\" : \"UFD\");\n\t}\n\n\treturn score;\n}\n"
  },
  {
    "path": "src/smart.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * SMART HDD vs Flash detection (using ATA over USB, S.M.A.R.T., etc.)\n * Copyright © 2013-2014 Pete Batard <pete@akeo.ie>\n *\n * Based in part on Smartmontools: http://smartmontools.sourceforge.net\n * Copyright © 2006-12 Douglas Gilbert <dgilbert@interlog.com>\n * Copyright © 2009-13 Christian Franke <smartmontools-support@lists.sourceforge.net>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n// From http://stackoverflow.com/a/9284679\n#define COMPILE_TIME_ASSERT(pred)       switch(0) {case 0: case pred:;}\n\n// Official commands\n#define ATA_DATA_SET_MANAGEMENT         0x06\t// TRIM command for SSDs\n#define ATA_READ_LOG_EXT                0x2f\n#define ATA_CHECK_POWER_MODE            0xe5\n#define ATA_IDENTIFY_DEVICE             0xec\n#define ATA_IDENTIFY_PACKET_DEVICE      0xa1\n#define ATA_IDLE                        0xe3\n#define ATA_SMART_CMD                   0xb0\n#define ATA_SECURITY_FREEZE_LOCK        0xf5\n#define ATA_SET_FEATURES                0xef\n#define ATA_STANDBY_IMMEDIATE           0xe0\n#define SAT_ATA_PASSTHROUGH_12          0xa1\n// Non official pseudo commands\n#define USB_CYPRESS_ATA_PASSTHROUGH     0x24\n#define USB_JMICRON_ATA_PASSTHROUGH     0xdf\n#define USB_SUNPLUS_ATA_PASSTHROUGH     0xf8\n\n// SMART ATA Subcommands\n// Also see https://github.com/gregkh/ndas/blob/master/udev.c\n#define ATA_SMART_READ_VALUES           0xd0\n#define ATA_SMART_READ_THRESHOLDS       0xd1\n#define ATA_SMART_AUTOSAVE              0xd2\n#define ATA_SMART_SAVE                  0xd3\n#define ATA_SMART_IMMEDIATE_OFFLINE     0xd4\n#define ATA_SMART_READ_LOG_SECTOR       0xd5\n#define ATA_SMART_WRITE_LOG_SECTOR      0xd6\n#define ATA_SMART_WRITE_THRESHOLDS      0xd7\n#define ATA_SMART_ENABLE                0xd8\n#define ATA_SMART_DISABLE               0xd9\n#define ATA_SMART_STATUS                0xda\n\n#define SCSI_IOCTL_DATA_OUT             0\n#define SCSI_IOCTL_DATA_IN              1\n#define SCSI_IOCTL_DATA_UNSPECIFIED     2\n\n#define ATA_PASSTHROUGH_DATA_OUT        SCSI_IOCTL_DATA_OUT\n#define ATA_PASSTHROUGH_DATA_IN         SCSI_IOCTL_DATA_IN\n#define ATA_PASSTHROUGH_DATA_NONE       SCSI_IOCTL_DATA_UNSPECIFIED\n\n// Status codes returned by ScsiPassthroughDirect()\n#define SPT_SUCCESS                     0\n#define SPT_ERROR_CDB_LENGTH            -1\n#define SPT_ERROR_BUFFER                -2\n#define SPT_ERROR_DIRECTION             -3\n#define SPT_ERROR_EXTENDED_CDB          -4\n#define SPT_ERROR_CDB_OPCODE            -5\n#define SPT_ERROR_TIMEOUT               -6\n#define SPT_ERROR_INVALID_PARAMETER     -7\n#define SPT_ERROR_CHECK_STATUS          -8\n#define SPT_ERROR_UNKNOWN_ERROR         -99\n\n#define SPT_CDB_LENGTH                  16\n#define SPT_SENSE_LENGTH                32\n#define SPT_TIMEOUT_VALUE               2\t// In seconds\n#define SECTOR_SIZE_SHIFT_BIT           9\t// We use 512 bytes sectors always\n\n#define IOCTL_SCSI_BASE                 FILE_DEVICE_CONTROLLER\n#define IOCTL_SCSI_PASS_THROUGH         \\\n\tCTL_CODE(IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)\n#define IOCTL_SCSI_PASS_THROUGH_DIRECT  \\\n\tCTL_CODE(IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)\n\ntypedef struct {\n\tUSHORT Length;\n\tUCHAR  ScsiStatus;\n\tUCHAR  PathId;\n\tUCHAR  TargetId;\n\tUCHAR  Lun;\n\tUCHAR  CdbLength;\n\tUCHAR  SenseInfoLength;\n\tUCHAR  DataIn;\n\tULONG  DataTransferLength;\n\tULONG  TimeOutValue;\n\tULONG_PTR DataBufferOffset;\n\tULONG  SenseInfoOffset;\n\tUCHAR  Cdb[SPT_CDB_LENGTH];\n} SCSI_PASS_THROUGH;\n\ntypedef struct {\n\tUSHORT Length;\n\tUCHAR  ScsiStatus;\n\tUCHAR  PathId;\n\tUCHAR  TargetId;\n\tUCHAR  Lun;\n\tUCHAR  CdbLength;\n\tUCHAR  SenseInfoLength;\n\tUCHAR  DataIn;\n\tULONG  DataTransferLength;\n\tULONG  TimeOutValue;\n\tPVOID  DataBuffer;\n\tULONG  SenseInfoOffset;\n\tUCHAR  Cdb[SPT_CDB_LENGTH];\n} SCSI_PASS_THROUGH_DIRECT;\n\ntypedef struct {\n\tSCSI_PASS_THROUGH_DIRECT sptd;\n\tULONG Align;\n\tUCHAR SenseBuf[SPT_SENSE_LENGTH];\n} SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER;\n\n// Custom ATA over USB command\ntypedef struct {\n\tuint8_t AtaCmd;\t\t\t// eg: ATA_SMART_CMD = 0xb0, IDENTIFY = 0xec, etc.\n\tuint8_t Features;\t\t// SMART subcommand, eg: SMART_ENABLE_OPS = 0xd8, etc.\n\tuint8_t Device;\t\t\t// 0x00 for Identify, 0xA0, 0xB0 for JMicron/SAT SMART ops\n\tuint8_t Align;\n\tuint8_t Lba_low;\t\t// LBA\n\tuint8_t Lba_mid;\n\tuint8_t Lba_high;\n\tuint8_t Lba_unused;\n} ATA_PASSTHROUGH_CMD;\n\ntypedef BOOL (*AtaPassthroughFn_t)(\n\tHANDLE hPhysical,\n\tATA_PASSTHROUGH_CMD* Command,\n\tvoid* DataBuffer,\n\tsize_t BufLen,\n\tuint32_t Timeout\n);\n\ntypedef struct {\n\tAtaPassthroughFn_t fn;\n\tconst char* type;\n} AtaPassThroughType;\n\n// From http://msdn.microsoft.com/en-us/library/windows/hardware/ff559006.aspx\n#pragma pack(1)\t\t// Packed as the size must be 512 bytes exactly\ntypedef struct _IDENTIFY_DEVICE_DATA {\n\tstruct {\n\t\tUSHORT Reserved1 :1;\n\t\tUSHORT Retired3 :1;\n\t\tUSHORT ResponseIncomplete :1;\n\t\tUSHORT Retired2 :3;\n\t\tUSHORT FixedDevice :1;\n\t\tUSHORT RemovableMedia :1;\n\t\tUSHORT Retired1 :7;\n\t\tUSHORT DeviceType :1;\n\t} GeneralConfiguration;\n\tUSHORT NumCylinders;\n\tUSHORT ReservedWord2;\n\tUSHORT NumHeads;\n\tUSHORT Retired1[2];\n\tUSHORT NumSectorsPerTrack;\n\tUSHORT VendorUnique1[3];\n\tUCHAR  SerialNumber[20];\n\tUSHORT Retired2[2];\n\tUSHORT Obsolete1;\n\tUCHAR  FirmwareRevision[8];\n\tUCHAR  ModelNumber[40];\n\tUCHAR  MaximumBlockTransfer;\n\tUCHAR  VendorUnique2;\n\tUSHORT ReservedWord48;\n\tstruct {\n\t\tUCHAR  ReservedByte49;\n\t\tUCHAR  DmaSupported :1;\n\t\tUCHAR  LbaSupported :1;\n\t\tUCHAR  IordyDisable :1;\n\t\tUCHAR  IordySupported :1;\n\t\tUCHAR  Reserved1 :1;\n\t\tUCHAR  StandybyTimerSupport :1;\n\t\tUCHAR  Reserved2 :2;\n\t\tUSHORT ReservedWord50;\n\t} Capabilities;\n\tUSHORT ObsoleteWords51[2];\n\tUSHORT TranslationFieldsValid :3;\n\tUSHORT Reserved3 :13;\n\tUSHORT NumberOfCurrentCylinders;\n\tUSHORT NumberOfCurrentHeads;\n\tUSHORT CurrentSectorsPerTrack;\n\tULONG  CurrentSectorCapacity;\n\tUCHAR  CurrentMultiSectorSetting;\n\tUCHAR  MultiSectorSettingValid :1;\n\tUCHAR  ReservedByte59 :7;\n\tULONG  UserAddressableSectors;\n\tUSHORT ObsoleteWord62;\n\tUSHORT MultiWordDMASupport :8;\n\tUSHORT MultiWordDMAActive :8;\n\tUSHORT AdvancedPIOModes :8;\n\tUSHORT ReservedByte64 :8;\n\tUSHORT MinimumMWXferCycleTime;\n\tUSHORT RecommendedMWXferCycleTime;\n\tUSHORT MinimumPIOCycleTime;\n\tUSHORT MinimumPIOCycleTimeIORDY;\n\tUSHORT ReservedWords69[6];\n\tUSHORT QueueDepth :5;\n\tUSHORT ReservedWord75 :11;\n\tUSHORT ReservedWords76[4];\n\tUSHORT MajorRevision;\n\tUSHORT MinorRevision;\n\tstruct {\n\t\tUSHORT SmartCommands :1;\n\t\tUSHORT SecurityMode :1;\n\t\tUSHORT RemovableMediaFeature :1;\n\t\tUSHORT PowerManagement :1;\n\t\tUSHORT Reserved1 :1;\n\t\tUSHORT WriteCache :1;\n\t\tUSHORT LookAhead :1;\n\t\tUSHORT ReleaseInterrupt :1;\n\t\tUSHORT ServiceInterrupt :1;\n\t\tUSHORT DeviceReset :1;\n\t\tUSHORT HostProtectedArea :1;\n\t\tUSHORT Obsolete1 :1;\n\t\tUSHORT WriteBuffer :1;\n\t\tUSHORT ReadBuffer :1;\n\t\tUSHORT Nop :1;\n\t\tUSHORT Obsolete2 :1;\n\t\tUSHORT DownloadMicrocode :1;\n\t\tUSHORT DmaQueued :1;\n\t\tUSHORT Cfa :1;\n\t\tUSHORT AdvancedPm :1;\n\t\tUSHORT Msn :1;\n\t\tUSHORT PowerUpInStandby :1;\n\t\tUSHORT ManualPowerUp :1;\n\t\tUSHORT Reserved2 :1;\n\t\tUSHORT SetMax :1;\n\t\tUSHORT Acoustics :1;\n\t\tUSHORT BigLba :1;\n\t\tUSHORT DeviceConfigOverlay :1;\n\t\tUSHORT FlushCache :1;\n\t\tUSHORT FlushCacheExt :1;\n\t\tUSHORT Resrved3 :2;\n\t\tUSHORT SmartErrorLog :1;\n\t\tUSHORT SmartSelfTest :1;\n\t\tUSHORT MediaSerialNumber :1;\n\t\tUSHORT MediaCardPassThrough :1;\n\t\tUSHORT StreamingFeature :1;\n\t\tUSHORT GpLogging :1;\n\t\tUSHORT WriteFua :1;\n\t\tUSHORT WriteQueuedFua :1;\n\t\tUSHORT WWN64Bit :1;\n\t\tUSHORT URGReadStream :1;\n\t\tUSHORT URGWriteStream :1;\n\t\tUSHORT ReservedForTechReport :2;\n\t\tUSHORT IdleWithUnloadFeature :1;\n\t\tUSHORT Reserved4 :2;\n\t} CommandSetSupport;\n\tstruct {\n\t\tUSHORT SmartCommands :1;\n\t\tUSHORT SecurityMode :1;\n\t\tUSHORT RemovableMediaFeature :1;\n\t\tUSHORT PowerManagement :1;\n\t\tUSHORT Reserved1 :1;\n\t\tUSHORT WriteCache :1;\n\t\tUSHORT LookAhead :1;\n\t\tUSHORT ReleaseInterrupt :1;\n\t\tUSHORT ServiceInterrupt :1;\n\t\tUSHORT DeviceReset :1;\n\t\tUSHORT HostProtectedArea :1;\n\t\tUSHORT Obsolete1 :1;\n\t\tUSHORT WriteBuffer :1;\n\t\tUSHORT ReadBuffer :1;\n\t\tUSHORT Nop :1;\n\t\tUSHORT Obsolete2 :1;\n\t\tUSHORT DownloadMicrocode :1;\n\t\tUSHORT DmaQueued :1;\n\t\tUSHORT Cfa :1;\n\t\tUSHORT AdvancedPm :1;\n\t\tUSHORT Msn :1;\n\t\tUSHORT PowerUpInStandby :1;\n\t\tUSHORT ManualPowerUp :1;\n\t\tUSHORT Reserved2 :1;\n\t\tUSHORT SetMax :1;\n\t\tUSHORT Acoustics :1;\n\t\tUSHORT BigLba :1;\n\t\tUSHORT DeviceConfigOverlay :1;\n\t\tUSHORT FlushCache :1;\n\t\tUSHORT FlushCacheExt :1;\n\t\tUSHORT Resrved3 :2;\n\t\tUSHORT SmartErrorLog :1;\n\t\tUSHORT SmartSelfTest :1;\n\t\tUSHORT MediaSerialNumber :1;\n\t\tUSHORT MediaCardPassThrough :1;\n\t\tUSHORT StreamingFeature :1;\n\t\tUSHORT GpLogging :1;\n\t\tUSHORT WriteFua :1;\n\t\tUSHORT WriteQueuedFua :1;\n\t\tUSHORT WWN64Bit :1;\n\t\tUSHORT URGReadStream :1;\n\t\tUSHORT URGWriteStream :1;\n\t\tUSHORT ReservedForTechReport :2;\n\t\tUSHORT IdleWithUnloadFeature :1;\n\t\tUSHORT Reserved4 :2;\n\t} CommandSetActive;\n\tUSHORT UltraDMASupport :8;\n\tUSHORT UltraDMAActive :8;\n\tUSHORT ReservedWord89[4];\n\tUSHORT HardwareResetResult;\n\tUSHORT CurrentAcousticValue :8;\n\tUSHORT RecommendedAcousticValue :8;\n\tUSHORT ReservedWord95[5];\n\tULONG  Max48BitLBA[2];\n\tUSHORT StreamingTransferTime;\n\tUSHORT ReservedWord105;\n\tstruct {\n\t\tUSHORT LogicalSectorsPerPhysicalSector :4;\n\t\tUSHORT Reserved0 :8;\n\t\tUSHORT LogicalSectorLongerThan256Words :1;\n\t\tUSHORT MultipleLogicalSectorsPerPhysicalSector :1;\n\t\tUSHORT Reserved1 :2;\n\t} PhysicalLogicalSectorSize;\n\tUSHORT InterSeekDelay;\n\tUSHORT WorldWideName[4];\n\tUSHORT ReservedForWorldWideName128[4];\n\tUSHORT ReservedForTlcTechnicalReport;\n\tUSHORT WordsPerLogicalSector[2];\n\tstruct {\n\t\tUSHORT ReservedForDrqTechnicalReport :1;\n\t\tUSHORT WriteReadVerifySupported :1;\n\t\tUSHORT Reserved01 :11;\n\t\tUSHORT Reserved1 :2;\n\t} CommandSetSupportExt;\n\tstruct {\n\t\tUSHORT ReservedForDrqTechnicalReport :1;\n\t\tUSHORT WriteReadVerifyEnabled :1;\n\t\tUSHORT Reserved01 :11;\n\t\tUSHORT Reserved1 :2;\n\t} CommandSetActiveExt;\n\tUSHORT ReservedForExpandedSupportandActive[6];\n\tUSHORT MsnSupport :2;\n\tUSHORT ReservedWord1274 :14;\n\tstruct {\n\t\tUSHORT SecuritySupported :1;\n\t\tUSHORT SecurityEnabled :1;\n\t\tUSHORT SecurityLocked :1;\n\t\tUSHORT SecurityFrozen :1;\n\t\tUSHORT SecurityCountExpired :1;\n\t\tUSHORT EnhancedSecurityEraseSupported :1;\n\t\tUSHORT Reserved0 :2;\n\t\tUSHORT SecurityLevel :1;\n\t\tUSHORT Reserved1 :7;\n\t} SecurityStatus;\n\tUSHORT ReservedWord129[31];\n\tstruct {\n\t\tUSHORT MaximumCurrentInMA2 :12;\n\t\tUSHORT CfaPowerMode1Disabled :1;\n\t\tUSHORT CfaPowerMode1Required :1;\n\t\tUSHORT Reserved0 :1;\n\t\tUSHORT Word160Supported :1;\n\t} CfaPowerModel;\n\tUSHORT ReservedForCfaWord161[8];\n\tstruct {\n\t\tUSHORT SupportsTrim :1;\n\t\tUSHORT Reserved0 :15;\n\t} DataSetManagementFeature;\n\tUSHORT ReservedForCfaWord170[6];\n\tUSHORT CurrentMediaSerialNumber[30];\n\tUSHORT ReservedWord206;\n\tUSHORT ReservedWord207[2];\n\tstruct {\n\t\tUSHORT AlignmentOfLogicalWithinPhysical :14;\n\t\tUSHORT Word209Supported :1;\n\t\tUSHORT Reserved0 :1;\n\t} BlockAlignment;\n\tUSHORT WriteReadVerifySectorCountMode3Only[2];\n\tUSHORT WriteReadVerifySectorCountMode2Only[2];\n\tstruct {\n\t\tUSHORT NVCachePowerModeEnabled :1;\n\t\tUSHORT Reserved0 :3;\n\t\tUSHORT NVCacheFeatureSetEnabled :1;\n\t\tUSHORT Reserved1 :3;\n\t\tUSHORT NVCachePowerModeVersion :4;\n\t\tUSHORT NVCacheFeatureSetVersion :4;\n\t} NVCacheCapabilities;\n\tUSHORT NVCacheSizeLSW;\n\tUSHORT NVCacheSizeMSW;\n\tUSHORT NominalMediaRotationRate;\n\tUSHORT ReservedWord218;\n\tstruct {\n\t\tUCHAR NVCacheEstimatedTimeToSpinUpInSeconds;\n\t\tUCHAR Reserved;\n\t} NVCacheOptions;\n\tUSHORT ReservedWord220[35];\n\tUSHORT Signature :8;\n\tUSHORT CheckSum :8;\n} IDENTIFY_DEVICE_DATA, *PIDENTIFY_DEVICE_DATA;\n#pragma pack()\n"
  },
  {
    "path": "src/stdfn.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Standard Windows function calls\n * Copyright © 2013-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <sddl.h>\n#include <gpedit.h>\n#include <assert.h>\n#include <accctrl.h>\n#include <aclapi.h>\n\n#include \"rufus.h\"\n#include \"cregex.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n\n#include \"settings.h\"\n\n// MinGW doesn't yet know these (from wldp.h)\ntypedef enum WLDP_WINDOWS_LOCKDOWN_MODE\n{\n\tWLDP_WINDOWS_LOCKDOWN_MODE_UNLOCKED = 0,\n\tWLDP_WINDOWS_LOCKDOWN_MODE_TRIAL,\n\tWLDP_WINDOWS_LOCKDOWN_MODE_LOCKED,\n\tWLDP_WINDOWS_LOCKDOWN_MODE_MAX,\n} WLDP_WINDOWS_LOCKDOWN_MODE, * PWLDP_WINDOWS_LOCKDOWN_MODE;\n\nwindows_version_t WindowsVersion = { 0 };\n\n/*\n * Hash table functions - modified From glibc 2.3.2:\n * [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986\n * [Knuth]            The Art of Computer Programming, part 3 (6.4)\n */\n\n/*\n * For the used double hash method the table size has to be a prime. To\n * correct the user given table size we need a prime test.  This trivial\n * algorithm is adequate because the code is called only during init and\n * the number is likely to be small\n */\nstatic uint32_t isprime(uint32_t number)\n{\n\t// no even number will be passed\n\tuint32_t divider = 3;\n\n\twhile((divider * divider < number) && (number % divider != 0))\n\t\tdivider += 2;\n\n\treturn (number % divider != 0);\n}\n\n/*\n * Before using the hash table we must allocate memory for it.\n * We allocate one element more as the found prime number says.\n * This is done for more effective indexing as explained in the\n * comment for the hash function.\n */\nBOOL htab_create(uint32_t nel, htab_table* htab)\n{\n\tif (htab == NULL) {\n\t\treturn FALSE;\n\t}\n\tif_assert_fails(htab->table == NULL) {\n\t\tuprintf(\"WARNING: htab_create() was called with a non empty table\");\n\t\treturn FALSE;\n\t}\n\n\t// Change nel to the first prime number not smaller as nel.\n\tnel |= 1;\n\twhile(!isprime(nel))\n\t\tnel += 2;\n\n\thtab->size = nel;\n\thtab->filled = 0;\n\n\t// allocate memory and zero out.\n\thtab->table = (htab_entry*)calloc(htab->size + 1, sizeof(htab_entry));\n\tif (htab->table == NULL) {\n\t\tuprintf(\"Could not allocate space for hash table\");\n\t\treturn FALSE;\n\t}\n\n\treturn TRUE;\n}\n\n/* After using the hash table it has to be destroyed.  */\nvoid htab_destroy(htab_table* htab)\n{\n\tsize_t i;\n\n\tif ((htab == NULL) || (htab->table == NULL)) {\n\t\treturn;\n\t}\n\n\tfor (i=0; i<htab->size+1; i++) {\n\t\tif (htab->table[i].used) {\n\t\t\tsafe_free(htab->table[i].str);\n\t\t}\n\t}\n\thtab->filled = 0; htab->size = 0;\n\tsafe_free(htab->table);\n\thtab->table = NULL;\n}\n\n/*\n * This is the search function. It uses double hashing with open addressing.\n * We use a trick to speed up the lookup. The table is created with one\n * more element available. This enables us to use the index zero special.\n * This index will never be used because we store the first hash index in\n * the field used where zero means not used. Every other value means used.\n * The used field can be used as a first fast comparison for equality of\n * the stored and the parameter value. This helps to prevent unnecessary\n * expensive calls of strcmp.\n */\nuint32_t htab_hash(char* str, htab_table* htab)\n{\n\tuint32_t hval, hval2;\n\tuint32_t idx;\n\tuint32_t r = 0;\n\tint c;\n\tchar* sz = str;\n\n\tif ((htab == NULL) || (htab->table == NULL) || (str == NULL)) {\n\t\treturn 0;\n\t}\n\n\t// Compute main hash value using sdbm's algorithm (empirically\n\t// shown to produce half the collisions as djb2's).\n\t// See http://www.cse.yorku.ca/~oz/hash.html\n\twhile ((c = *sz++) != 0)\n\t\tr = c + (r << 6) + (r << 16) - r;\n\tif (r == 0)\n\t\t++r;\n\n\t// compute table hash: simply take the modulus\n\thval = r % htab->size;\n\tif (hval == 0)\n\t\t++hval;\n\n\t// Try the first index\n\tidx = hval;\n\n\tif (htab->table[idx].used) {\n\t\tif ( (htab->table[idx].used == hval)\n\t\t  && (safe_strcmp(str, htab->table[idx].str) == 0) ) {\n\t\t\t// existing hash\n\t\t\treturn idx;\n\t\t}\n\t\t// uprintf(\"Hash collision ('%s' vs '%s')\", str, htab->table[idx].str);\n\n\t\t// Second hash function, as suggested in [Knuth]\n\t\thval2 = 1 + hval % (htab->size - 2);\n\n\t\tdo {\n\t\t\t// Because size is prime this guarantees to step through all available indexes\n\t\t\tif (idx <= hval2) {\n\t\t\t\tidx = ((uint32_t)htab->size) + idx - hval2;\n\t\t\t} else {\n\t\t\t\tidx -= hval2;\n\t\t\t}\n\n\t\t\t// If we visited all entries leave the loop unsuccessfully\n\t\t\tif (idx == hval) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// If entry is found use it.\n\t\t\tif ( (htab->table[idx].used == hval)\n\t\t\t  && (safe_strcmp(str, htab->table[idx].str) == 0) ) {\n\t\t\t\treturn idx;\n\t\t\t}\n\t\t}\n\t\twhile (htab->table[idx].used);\n\t}\n\n\t// Not found => New entry\n\n\t// If the table is full return an error\n\tif_assert_fails(htab->filled < htab->size) {\n\t\tuprintf(\"Hash table is full (%d entries)\", htab->size);\n\t\treturn 0;\n\t}\n\n\tsafe_free(htab->table[idx].str);\n\thtab->table[idx].used = hval;\n\thtab->table[idx].str = (char*) malloc(safe_strlen(str) + 1);\n\tif (htab->table[idx].str == NULL) {\n\t\tuprintf(\"Could not duplicate string for hash table\");\n\t\treturn 0;\n\t}\n\tmemcpy(htab->table[idx].str, str, safe_strlen(str) + 1);\n\t++htab->filled;\n\n\treturn idx;\n}\n\nconst char* GetEditionName(DWORD ProductType)\n{\n\tstatic char unknown_edition_str[64] = \"\";\n\n\t// From: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getproductinfo\n\t// These values can be found in the winnt.h header.\n\tswitch (ProductType) {\n\tcase 0x00000000: return \"\";\t//  Undefined\n\tcase 0x00000001: return \" Ultimate\";\n\tcase 0x00000002: return \" Home Basic\";\n\tcase 0x00000003: return \" Home Premium\";\n\tcase 0x00000004: return \" Enterprise\";\n\tcase 0x00000005: return \" Home Basic N\";\n\tcase 0x00000006: return \" Business\";\n\tcase 0x00000007: return \" Server Standard\";\n\tcase 0x00000008: return \" Server Datacenter\";\n\tcase 0x00000009: return \" Smallbusiness Server\";\n\tcase 0x0000000A: return \" Server Enterprise\";\n\tcase 0x0000000B: return \" Starter\";\n\tcase 0x0000000C: return \" Server Datacenter (Core)\";\n\tcase 0x0000000D: return \" Server Standard (Core)\";\n\tcase 0x0000000E: return \" Server Enterprise (Core)\";\n\tcase 0x00000010: return \" Business N\";\n\tcase 0x00000011: return \" Web Server\";\n\tcase 0x00000012: return \" HPC Edition\";\n\tcase 0x00000013: return \" Storage Server (Essentials)\";\n\tcase 0x0000001A: return \" Home Premium N\";\n\tcase 0x0000001B: return \" Enterprise N\";\n\tcase 0x0000001C: return \" Ultimate N\";\n\tcase 0x00000022: return \" Home Server\";\n\tcase 0x00000024: return \" Server Standard without Hyper-V\";\n\tcase 0x00000025: return \" Server Datacenter without Hyper-V\";\n\tcase 0x00000026: return \" Server Enterprise without Hyper-V\";\n\tcase 0x00000027: return \" Server Datacenter without Hyper-V (Core)\";\n\tcase 0x00000028: return \" Server Standard without Hyper-V (Core)\";\n\tcase 0x00000029: return \" Server Enterprise without Hyper-V (Core)\";\n\tcase 0x0000002A: return \" Hyper-V Server\";\n\tcase 0x0000002F: return \" Starter N\";\n\tcase 0x00000030: return \" Pro\";\n\tcase 0x00000031: return \" Pro N\";\n\tcase 0x00000034: return \" Server Solutions Premium\";\n\tcase 0x00000035: return \" Server Solutions Premium (Core)\";\n\tcase 0x00000040: return \" Server Hyper Core V\";\n\tcase 0x00000042: return \" Starter E\";\n\tcase 0x00000043: return \" Home Basic E\";\n\tcase 0x00000044: return \" Premium E\";\n\tcase 0x00000045: return \" Pro E\";\n\tcase 0x00000046: return \" Enterprise E\";\n\tcase 0x00000047: return \" Ultimate E\";\n\tcase 0x00000048: return \" Enterprise (Eval)\";\n\tcase 0x0000004F: return \" Server Standard (Eval)\";\n\tcase 0x00000050: return \" Server Datacenter (Eval)\";\n\tcase 0x00000054: return \" Enterprise N (Eval)\";\n\tcase 0x00000057: return \" Thin PC\";\n\tcase 0x00000058: case 0x00000059: case 0x0000005A: case 0x0000005B: case 0x0000005C: return \"Embedded\";\n\tcase 0x00000062: return \" Home N\";\n\tcase 0x00000063: return \" Home China\";\n\tcase 0x00000064: return \" Home Single Language\";\n\tcase 0x00000065: return \" Home\";\n\tcase 0x00000067: return \" Pro with Media Center\";\n\tcase 0x00000069: case 0x0000006A: case 0x0000006B: case 0x0000006C: return \"Embedded\";\n\tcase 0x0000006F: return \" Home Connected\";\n\tcase 0x00000070: return \" Pro Student\";\n\tcase 0x00000071: return \" Home Connected N\";\n\tcase 0x00000072: return \" Pro Student N\";\n\tcase 0x00000073: return \" Home Connected Single Language\";\n\tcase 0x00000074: return \" Home Connected China\";\n\tcase 0x00000079: return \" Education\";\n\tcase 0x0000007A: return \" Education N\";\n\tcase 0x0000007D: return \" Enterprise LTSB\";\n\tcase 0x0000007E: return \" Enterprise LTSB N\";\n\tcase 0x0000007F: return \" Pro S\";\n\tcase 0x00000080: return \" Pro S N\";\n\tcase 0x00000081: return \" Enterprise LTSB (Eval)\";\n\tcase 0x00000082: return \" Enterprise LTSB N (Eval)\";\n\tcase 0x0000008A: return \" Pro Single Language\";\n\tcase 0x0000008B: return \" Pro China\";\n\tcase 0x0000008C: return \" Enterprise Subscription\";\n\tcase 0x0000008D: return \" Enterprise Subscription N\";\n\tcase 0x00000091: return \" Server Datacenter SA (Core)\";\n\tcase 0x00000092: return \" Server Standard SA (Core)\";\n\tcase 0x00000095: return \" Utility VM\";\n\tcase 0x000000A1: return \" Pro for Workstations\";\n\tcase 0x000000A2: return \" Pro for Workstations N\";\n\tcase 0x000000A4: return \" Pro for Education\";\n\tcase 0x000000A5: return \" Pro for Education N\";\n\tcase 0x000000AB: return \" Enterprise G\";\t// I swear Microsoft are just making up editions...\n\tcase 0x000000AC: return \" Enterprise G N\";\n\tcase 0x000000B2: return \" Cloud\";\n\tcase 0x000000B3: return \" Cloud N\";\n\tcase 0x000000B6: return \" Home OS\";\n\tcase 0x000000B7: case 0x000000CB: return \"Cloud E\";\n\tcase 0x000000B9: return \" IoT OS\";\n\tcase 0x000000BA: case 0x000000CA: return \"Cloud E N\";\n\tcase 0x000000BB: return \" IoT Edge OS\";\n\tcase 0x000000BC: return \" IoT Enterprise\";\n\tcase 0x000000BD: return \" Lite\";\n\tcase 0x000000BF: return \" IoT Enterprise S\";\n\tcase 0x000000C0: case 0x000000C2: case 0x000000C3: case 0x000000C4: case 0x000000C5: case 0x000000C6: return \"XBox\";\n\tcase 0x000000C7: case 0x000000C8: case 0x00000196: case 0x00000197: case 0x00000198: return \"Azure Server\";\n\tcase 0xABCDABCD: return \" (Unlicensed)\";\n\tdefault:\n\t\tstatic_sprintf(unknown_edition_str, \" (Unknown Edition 0x%02X)\", (uint32_t)ProductType);\n\t\treturn unknown_edition_str;\n\t}\n}\n\nPF_TYPE_DECL(WINAPI, HRESULT, WldpQueryWindowsLockdownMode, (PWLDP_WINDOWS_LOCKDOWN_MODE));\nBOOL isSMode(void)\n{\n\tBOOL r = FALSE;\n\tWLDP_WINDOWS_LOCKDOWN_MODE mode;\n\tPF_INIT_OR_OUT(WldpQueryWindowsLockdownMode, Wldp);\n\n\tHRESULT hr = pfWldpQueryWindowsLockdownMode(&mode);\n\tif (hr != S_OK) {\n\t\tSetLastError((DWORD)hr);\n\t\tuprintf(\"Could not detect S Mode: %s\", WindowsErrorString());\n\t} else {\n\t\tr = (mode != WLDP_WINDOWS_LOCKDOWN_MODE_UNLOCKED);\n\t}\n\nout:\n\treturn r;\n}\n\n/*\n * Modified from smartmontools' os_win32.cpp\n */\nvoid GetWindowsVersion(windows_version_t* windows_version)\n{\n\tOSVERSIONINFOEXA vi, vi2;\n\tDWORD dwProductType = 0;\n\tconst char* w = NULL;\n\tconst char* arch_name;\n\tchar *vptr;\n\tsize_t vlen;\n\tDWORD major = 0, minor = 0;\n\tUSHORT ProcessMachine = IMAGE_FILE_MACHINE_UNKNOWN, NativeMachine = IMAGE_FILE_MACHINE_UNKNOWN;\n\tULONGLONG major_equal, minor_equal;\n\tBOOL ws, is_wow64 = FALSE;\n\n\tPF_TYPE_DECL(WINAPI, BOOL, IsWow64Process2, (HANDLE, USHORT*, USHORT*));\n\tPF_INIT(IsWow64Process2, Kernel32);\n\n\tmemset(windows_version, 0, sizeof(windows_version_t));\n\tstatic_strcpy(windows_version->VersionStr, \"Windows Undefined\");\n\n\tmemset(&vi, 0, sizeof(vi));\n\tvi.dwOSVersionInfoSize = sizeof(vi);\n\tif (!GetVersionExA((OSVERSIONINFOA *)&vi)) {\n\t\tmemset(&vi, 0, sizeof(vi));\n\t\tvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);\n\t\tif (!GetVersionExA((OSVERSIONINFOA *)&vi))\n\t\t\treturn;\n\t}\n\n\tif (vi.dwPlatformId == VER_PLATFORM_WIN32_NT) {\n\n\t\tif (vi.dwMajorVersion > 6 || (vi.dwMajorVersion == 6 && vi.dwMinorVersion >= 2)) {\n\t\t\t// Starting with Windows 8.1 Preview, GetVersionEx() does no longer report the actual OS version\n\t\t\t// See: http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074.aspx\n\t\t\t// And starting with Windows 10 Preview 2, Windows enforces the use of the application/supportedOS\n\t\t\t// manifest in order for VerSetConditionMask() to report the ACTUAL OS major and minor...\n\n\t\t\tmajor_equal = VerSetConditionMask(0, VER_MAJORVERSION, VER_EQUAL);\n\t\t\tfor (major = vi.dwMajorVersion; major <= 9; major++) {\n\t\t\t\tmemset(&vi2, 0, sizeof(vi2));\n\t\t\t\tvi2.dwOSVersionInfoSize = sizeof(vi2); vi2.dwMajorVersion = major;\n\t\t\t\tif (!VerifyVersionInfoA(&vi2, VER_MAJORVERSION, major_equal))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (vi.dwMajorVersion < major) {\n\t\t\t\t\tvi.dwMajorVersion = major; vi.dwMinorVersion = 0;\n\t\t\t\t}\n\n\t\t\t\tminor_equal = VerSetConditionMask(0, VER_MINORVERSION, VER_EQUAL);\n\t\t\t\tfor (minor = vi.dwMinorVersion; minor <= 9; minor++) {\n\t\t\t\t\tmemset(&vi2, 0, sizeof(vi2)); vi2.dwOSVersionInfoSize = sizeof(vi2);\n\t\t\t\t\tvi2.dwMinorVersion = minor;\n\t\t\t\t\tif (!VerifyVersionInfoA(&vi2, VER_MINORVERSION, minor_equal))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tvi.dwMinorVersion = minor;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (vi.dwMajorVersion <= 0xf && vi.dwMinorVersion <= 0xf) {\n\t\t\tws = (vi.wProductType <= VER_NT_WORKSTATION);\n\t\t\twindows_version->Version = vi.dwMajorVersion << 4 | vi.dwMinorVersion;\n\t\t\tswitch (windows_version->Version) {\n\t\t\tcase WINDOWS_XP: w = \"XP\";\n\t\t\t\tbreak;\n\t\t\tcase WINDOWS_2003: w = (ws ? \"XP_64\" : (!GetSystemMetrics(89) ? \"Server 2003\" : \"Server 2003_R2\"));\n\t\t\t\tbreak;\n\t\t\tcase WINDOWS_VISTA: w = (ws ? \"Vista\" : \"Server 2008\");\n\t\t\t\tbreak;\n\t\t\tcase WINDOWS_7: w = (ws ? \"7\" : \"Server 2008_R2\");\n\t\t\t\tbreak;\n\t\t\tcase WINDOWS_8: w = (ws ? \"8\" : \"Server 2012\");\n\t\t\t\tbreak;\n\t\t\tcase WINDOWS_8_1: w = (ws ? \"8.1\" : \"Server 2012_R2\");\n\t\t\t\tbreak;\n\t\t\tcase WINDOWS_10_PREVIEW1: w = (ws ? \"10 (Preview 1)\" : \"Server 10 (Preview 1)\");\n\t\t\t\tbreak;\n\t\t\t// Starting with Windows 10 Preview 2, the major is the same as the public-facing version\n\t\t\tcase WINDOWS_10:\n\t\t\t\tif (vi.dwBuildNumber < 20000) {\n\t\t\t\t\tw = (ws ? \"10\" : ((vi.dwBuildNumber < 17763) ? \"Server 2016\" : \"Server 2019\"));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\twindows_version->Version = WINDOWS_11;\n\t\t\t\tmajor = 11;\n\t\t\t\t// Fall through\n\t\t\tcase WINDOWS_11: w = (ws ? \"11\" : \"Server 2022\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif (windows_version->Version < WINDOWS_XP)\n\t\t\t\t\twindows_version->Version = WINDOWS_UNDEFINED;\n\t\t\t\telse\n\t\t\t\t\tw = \"12 or later\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\twindows_version->Major = major;\n\twindows_version->Minor = minor;\n\n\tif ((pfIsWow64Process2 != NULL) && pfIsWow64Process2(GetCurrentProcess(), &ProcessMachine, &NativeMachine)) {\n\t\twindows_version->Arch = NativeMachine;\n\t} else {\n\t\t// Assume same arch as the app\n\t\twindows_version->Arch = GetApplicationArch();\n\t\t// Fix the Arch if we have a 32-bit app running under WOW64\n\t\tif ((sizeof(uintptr_t) < 8) && IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64) {\n\t\t\tif (windows_version->Arch == IMAGE_FILE_MACHINE_I386)\n\t\t\t\twindows_version->Arch = IMAGE_FILE_MACHINE_AMD64;\n\t\t\telse if (windows_version->Arch == IMAGE_FILE_MACHINE_ARM)\n\t\t\t\twindows_version->Arch = IMAGE_FILE_MACHINE_ARM64;\n\t\t\telse // I sure wanna be made aware of this scenario...\n\t\t\t\tassert(FALSE);\n\t\t}\n\t\tuprintf(\"Note: Underlying Windows architecture was guessed and may be incorrect...\");\n\t}\n\tarch_name = GetArchName(windows_version->Arch);\n\n\tGetProductInfo(vi.dwMajorVersion, vi.dwMinorVersion, vi.wServicePackMajor, vi.wServicePackMinor, &dwProductType);\n\tvptr = &windows_version->VersionStr[sizeof(\"Windows \") - 1];\n\tvlen = sizeof(windows_version->VersionStr) - sizeof(\"Windows \") - 1;\n\tif (!w)\n\t\tsafe_sprintf(vptr, vlen, \"%s %u.%u %s\", (vi.dwPlatformId == VER_PLATFORM_WIN32_NT ? \"NT\" : \"??\"),\n\t\t\t(unsigned)vi.dwMajorVersion, (unsigned)vi.dwMinorVersion, arch_name);\n\telse if (vi.wServicePackMinor)\n\t\tsafe_sprintf(vptr, vlen, \"%s SP%u.%u %s\", w, vi.wServicePackMajor, vi.wServicePackMinor, arch_name);\n\telse if (vi.wServicePackMajor)\n\t\tsafe_sprintf(vptr, vlen, \"%s SP%u %s\", w, vi.wServicePackMajor, arch_name);\n\telse\n\t\tsafe_sprintf(vptr, vlen, \"%s%s %s\", w, GetEditionName(dwProductType), arch_name);\n\n\twindows_version->Edition = dwProductType;\n\n\t// Add the build number (including UBR if available)\n\twindows_version->BuildNumber = vi.dwBuildNumber;\n\twindows_version->Ubr = ReadRegistryKey32(REGKEY_HKLM, \"Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\UBR\");\n\tvptr = &windows_version->VersionStr[safe_strlen(windows_version->VersionStr)];\n\tvlen = sizeof(windows_version->VersionStr) - safe_strlen(windows_version->VersionStr) - 1;\n\tif (windows_version->Ubr != 0)\n\t\tsafe_sprintf(vptr, vlen, \" (Build %lu.%lu)\", windows_version->BuildNumber, windows_version->Ubr);\n\telse\n\t\tsafe_sprintf(vptr, vlen, \" (Build %lu)\", windows_version->BuildNumber);\n\tvptr = &windows_version->VersionStr[safe_strlen(windows_version->VersionStr)];\n\tvlen = sizeof(windows_version->VersionStr) - safe_strlen(windows_version->VersionStr) - 1;\n\tif (isSMode())\n\t\tsafe_sprintf(vptr, vlen, \" in S Mode\");\n}\n\n/*\n * Why oh why does Microsoft make it so convoluted to retrieve a measly executable's version number ?\n */\nversion_t* GetExecutableVersion(const char* path)\n{\n\tstatic version_t version, *r = NULL;\n\tuint8_t* buf = NULL;\n\tUINT uLen;\n\tDWORD dwSize, dwHandle;\n\tVS_FIXEDFILEINFO* version_info;\n\n\tmemset(&version, 0, sizeof(version));\n\n\tdwSize = GetFileVersionInfoSizeU(path, &dwHandle);\n\tif (dwSize == 0)\n\t\tgoto out;\n\n\tbuf = malloc(dwSize);\n\tif (buf == NULL)\n\t\tgoto out;;\n\tif (!GetFileVersionInfoU(path, dwHandle, dwSize, buf))\n\t\tgoto out;\n\n\tif (!VerQueryValueA(buf, \"\\\\\", (LPVOID*)&version_info, &uLen) || uLen == 0)\n\t\tgoto out;\n\n\tif (version_info->dwSignature != 0xfeef04bd)\n\t\tgoto out;\n\n\tversion.Major = (version_info->dwFileVersionMS >> 16) & 0xffff;\n\tversion.Minor = (version_info->dwFileVersionMS >> 0) & 0xffff;\n\tversion.Micro = (version_info->dwFileVersionLS >> 16) & 0xffff;\n\tversion.Nano = (version_info->dwFileVersionLS >> 0) & 0xffff;\n\tr = &version;\n\nout:\n\tfree(buf);\n\treturn r;\n}\n\n/*\n * String array manipulation\n */\nvoid StrArrayCreate(StrArray* arr, uint32_t initial_size)\n{\n\tif (arr == NULL) return;\n\tarr->Max = initial_size; arr->Index = 0;\n\tarr->String = (char**)calloc(arr->Max, sizeof(char*));\n\tif (arr->String == NULL)\n\t\tuprintf(\"Could not allocate string array\");\n}\n\nint32_t StrArrayAdd(StrArray* arr, const char* str, BOOL duplicate)\n{\n\tchar** old_table;\n\tif ((arr == NULL) || (arr->String == NULL) || (str == NULL))\n\t\treturn -1;\n\tif (arr->Index == arr->Max) {\n\t\tarr->Max *= 2;\n\t\told_table = arr->String;\n\t\tarr->String = (char**)realloc(arr->String, arr->Max*sizeof(char*));\n\t\tif (arr->String == NULL) {\n\t\t\tfree(old_table);\n\t\t\tuprintf(\"Could not reallocate string array\");\n\t\t\treturn -1;\n\t\t}\n\t}\n\tarr->String[arr->Index] = (duplicate)?safe_strdup(str):(char*)str;\n\tif (arr->String[arr->Index] == NULL) {\n\t\tuprintf(\"Could not store string in array\");\n\t\treturn -1;\n\t}\n\treturn arr->Index++;\n}\n\nint32_t StrArrayFind(StrArray* arr, const char* str)\n{\n\tuint32_t i;\n\tif ((str == NULL) || (arr == NULL) || (arr->String == NULL))\n\t\treturn -1;\n\tfor (i = 0; i < arr->Index; i++) {\n\t\tif (strcmp(arr->String[i], str) == 0)\n\t\t\treturn (int32_t)i;\n\t}\n\treturn -1;\n}\n\nint32_t StrArrayAddUnique(StrArray* arr, const char* str, BOOL duplicate)\n{\n\tint32_t i = StrArrayFind(arr, str);\n\treturn (i < 0) ? StrArrayAdd(arr, str, duplicate) : i;\n}\n\nvoid StrArrayClear(StrArray* arr)\n{\n\tuint32_t i;\n\tif ((arr == NULL) || (arr->String == NULL))\n\t\treturn;\n\tfor (i = 0; i < arr->Index; i++) {\n\t\tsafe_free(arr->String[i]);\n\t}\n\tarr->Index = 0;\n}\n\nvoid StrArrayDestroy(StrArray* arr)\n{\n\tStrArrayClear(arr);\n\tif (arr != NULL)\n\t\tsafe_free(arr->String);\n}\n\n/*\n * Retrieve the SID of the current user. The returned PSID must be freed by the caller using LocalFree()\n */\nstatic PSID GetSID(void) {\n\tTOKEN_USER* tu = NULL;\n\tDWORD len;\n\tHANDLE token;\n\tPSID ret = NULL;\n\tchar* psid_string = NULL;\n\n\tif (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) {\n\t\tuprintf(\"OpenProcessToken failed: %s\", WindowsErrorString());\n\t\treturn NULL;\n\t}\n\n\tif (!GetTokenInformation(token, TokenUser, tu, 0, &len)) {\n\t\tif (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {\n\t\t\tuprintf(\"GetTokenInformation (pre) failed: %s\", WindowsErrorString());\n\t\t\treturn NULL;\n\t\t}\n\t\ttu = (TOKEN_USER*)calloc(1, len);\n\t}\n\tif (tu == NULL) {\n\t\treturn NULL;\n\t}\n\n\tif (GetTokenInformation(token, TokenUser, tu, len, &len)) {\n\t\t/*\n\t\t * now of course, the interesting thing is that if you return tu->User.Sid\n\t\t * but free tu, the PSID pointer becomes invalid after a while.\n\t\t * The workaround? Convert to string then back to PSID\n\t\t */\n\t\tif (!ConvertSidToStringSidA(tu->User.Sid, &psid_string)) {\n\t\t\tuprintf(\"Unable to convert SID to string: %s\", WindowsErrorString());\n\t\t\tret = NULL;\n\t\t} else {\n\t\t\tif (!ConvertStringSidToSidA(psid_string, &ret)) {\n\t\t\t\tuprintf(\"Unable to convert string back to SID: %s\", WindowsErrorString());\n\t\t\t\tret = NULL;\n\t\t\t}\n\t\t\t// MUST use LocalFree()\n\t\t\tLocalFree(psid_string);\n\t\t}\n\t} else {\n\t\tret = NULL;\n\t\tuprintf(\"GetTokenInformation (real) failed: %s\", WindowsErrorString());\n\t}\n\tfree(tu);\n\treturn ret;\n}\n\nBOOL FileIO(enum file_io_type io_type, char* path, char** buffer, DWORD* size)\n{\n\tSECURITY_ATTRIBUTES s_attr, *sa = NULL;\n\tSECURITY_DESCRIPTOR s_desc;\n\tconst LARGE_INTEGER liZero = { .QuadPart = 0ULL };\n\tPSID sid = NULL;\n\tHANDLE handle;\n\tDWORD dwDesiredAccess = 0, dwCreationDisposition = 0;\n\tBOOL r = FALSE;\n\tBOOL ret = FALSE;\n\n\t// Change the owner from admin to regular user\n\tsid = GetSID();\n\tif ( (sid != NULL)\n\t  && InitializeSecurityDescriptor(&s_desc, SECURITY_DESCRIPTOR_REVISION)\n\t  && SetSecurityDescriptorOwner(&s_desc, sid, FALSE) ) {\n\t\ts_attr.nLength = sizeof(SECURITY_ATTRIBUTES);\n\t\ts_attr.bInheritHandle = FALSE;\n\t\ts_attr.lpSecurityDescriptor = &s_desc;\n\t\tsa = &s_attr;\n\t} else {\n\t\tuprintf(\"Could not set security descriptor: %s\", WindowsErrorString());\n\t}\n\n\tswitch (io_type) {\n\tcase FILE_IO_READ:\n\t\t*buffer = NULL;\n\t\tdwDesiredAccess = GENERIC_READ;\n\t\tdwCreationDisposition = OPEN_EXISTING;\n\t\tbreak;\n\tcase FILE_IO_WRITE:\n\t\tdwDesiredAccess = GENERIC_WRITE;\n\t\tdwCreationDisposition = CREATE_ALWAYS;\n\t\tbreak;\n\tcase FILE_IO_APPEND:\n\t\tdwDesiredAccess = FILE_APPEND_DATA;\n\t\tdwCreationDisposition = OPEN_ALWAYS;\n\t\tbreak;\n\tdefault:\n\t\tassert(FALSE);\n\t\tbreak;\n\t}\n\thandle = CreateFileU(path, dwDesiredAccess, FILE_SHARE_READ, sa,\n\t\tdwCreationDisposition, FILE_ATTRIBUTE_NORMAL, NULL);\n\n\tif (handle == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Could not open '%s': %s\", path, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tswitch (io_type) {\n\tcase FILE_IO_READ:\n\t\t*size = GetFileSize(handle, NULL);\n\t\t*buffer = (char*)malloc(*size);\n\t\tif (*buffer == NULL) {\n\t\t\tuprintf(\"Could not allocate buffer for reading file\");\n\t\t\tgoto out;\n\t\t}\n\t\tr = ReadFile(handle, *buffer, *size, size, NULL);\n\t\tbreak;\n\tcase FILE_IO_APPEND:\n\t\tSetFilePointerEx(handle, liZero, NULL, FILE_END);\n\t\t// Fall through\n\tcase FILE_IO_WRITE:\n\t\tr = WriteFile(handle, *buffer, *size, size, NULL);\n\t\tbreak;\n\t}\n\n\tif (!r) {\n\t\tuprintf(\"I/O Error: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tPrintInfoDebug(0, (io_type == FILE_IO_READ) ? MSG_215 : MSG_216, path);\n\tret = TRUE;\n\nout:\n\tCloseHandle(handle);\n\tif (!ret && (io_type == FILE_IO_READ)) {\n\t\t// Only leave the buffer allocated if we were able to read data\n\t\tsafe_free(*buffer);\n\t\t*size = 0;\n\t}\n\treturn ret;\n}\n\n/*\n * Get a resource from the RC. If needed that resource can be duplicated.\n * If duplicate is true and len is non-zero, the a zeroed buffer of 'len'\n * size is allocated for the resource. Else the buffer is allocated for\n * the resource size.\n */\nuint8_t* GetResource(HMODULE module, char* name, char* type, const char* desc, DWORD* len, BOOL duplicate)\n{\n\tHGLOBAL res_handle;\n\tHRSRC res;\n\tDWORD res_len;\n\tuint8_t* p = NULL;\n\n\tres = FindResourceA(module, name, type);\n\tif (res == NULL) {\n\t\tuprintf(\"Could not locate resource '%s': %s\", desc, WindowsErrorString());\n\t\tgoto out;\n\t}\n\tres_handle = LoadResource(module, res);\n\tif (res_handle == NULL) {\n\t\tuprintf(\"Could not load resource '%s': %s\", desc, WindowsErrorString());\n\t\tgoto out;\n\t}\n\tres_len = SizeofResource(module, res);\n\n\tif (duplicate) {\n\t\tif (*len == 0)\n\t\t\t*len = res_len;\n\t\tp = calloc(*len, 1);\n\t\tif (p == NULL) {\n\t\t\tuprintf(\"Could not allocate resource '%s'\", desc);\n\t\t\tgoto out;\n\t\t}\n\t\tmemcpy(p, LockResource(res_handle), min(res_len, *len));\n\t\tif (res_len > *len)\n\t\t\tuprintf(\"WARNING: Resource '%s' was truncated by %d bytes!\", desc, res_len - *len);\n\t} else {\n\t\tp = LockResource(res_handle);\n\t}\n\t*len = res_len;\n\nout:\n\treturn p;\n}\n\nDWORD GetResourceSize(HMODULE module, char* name, char* type, const char* desc)\n{\n\tDWORD len = 0;\n\treturn (GetResource(module, name, type, desc, &len, FALSE) == NULL)?0:len;\n}\n\n// Run a console command, with optional redirection of stdout and stderr to our log\n// as well as optional progress reporting if msg is not 0.\nDWORD RunCommandWithProgress(const char* cmd, const char* dir, BOOL log, int msg, const char* pattern)\n{\n\tDWORD ret, dwRead, dwAvail, dwPipeSize = 4096;\n\tSTARTUPINFOA si = { 0 };\n\tPROCESS_INFORMATION pi = { 0 };\n\tSECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };\n\tHANDLE hOutputRead = INVALID_HANDLE_VALUE, hOutputWrite = INVALID_HANDLE_VALUE;\n\tstatic char *output, *p;\n\tcregex_node_t* node = NULL;\n\tcregex_program_t* program = NULL;\n\tchar* matches[REGEX_VM_MAX_MATCHES];\n\n\tsi.cb = sizeof(si);\n\tif (msg != 0 || log) {\n\t\t// NB: The size of a pipe is a suggestion, NOT an absolute guarantee\n\t\t// This means that you may get a pipe of 4K even if you requested 1K\n\t\tif (!CreatePipe(&hOutputRead, &hOutputWrite, &sa, dwPipeSize)) {\n\t\t\tret = GetLastError();\n\t\t\tuprintf(\"Could not set commandline pipe: %s\", WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tsi.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES | STARTF_PREVENTPINNING | STARTF_TITLEISAPPID;\n\t\tsi.wShowWindow = SW_HIDE;\n\t\tsi.hStdOutput = hOutputWrite;\n\t\tsi.hStdError = hOutputWrite;\n\t}\n\n\tif (!CreateProcessU(NULL, cmd, NULL, NULL, TRUE,\n\t\tNORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW, NULL, dir, &si, &pi)) {\n\t\tret = GetLastError();\n\t\tuprintf(\"Unable to launch command '%s': %s\", cmd, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tif (msg != 0) {\n\t\tnode = cregex_parse(pattern);\n\t\tif (node != NULL) {\n\t\t\tprogram = cregex_compile_node(node);\n\t\t\tcregex_parse_free(node);\n\t\t}\n\t\tif (node == NULL || program == NULL)\n\t\t\tuprintf(\"Internal error: Failed to parse '%s'\", pattern);\n\t}\n\n\tif (program != NULL || log) {\n\t\tif (program != NULL)\n\t\t\tUpdateProgressWithInfoInit(NULL, FALSE);\n\t\twhile (1) {\n\t\t\t// Check for user cancel\n\t\t\tif (IS_ERROR(ErrorStatus) && (SCODE_CODE(ErrorStatus) == ERROR_CANCELLED)) {\n\t\t\t\tif (!TerminateProcess(pi.hProcess, ERROR_CANCELLED)) {\n\t\t\t\t\tuprintf(\"Could not terminate command: %s\", WindowsErrorString());\n\t\t\t\t} else switch (WaitForSingleObject(pi.hProcess, 5000)) {\n\t\t\t\tcase WAIT_TIMEOUT:\n\t\t\t\t\tuprintf(\"Command did not terminate within timeout duration\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase WAIT_OBJECT_0:\n\t\t\t\t\tuprintf(\"Command was terminated by user\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tuprintf(\"Error while waiting for command to be terminated: %s\", WindowsErrorString());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tret = ERROR_CANCELLED;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\t// coverity[string_null]\n\t\t\tif (PeekNamedPipe(hOutputRead, NULL, dwPipeSize, NULL, &dwAvail, NULL)) {\n\t\t\t\tif (dwAvail != 0) {\n\t\t\t\t\toutput = malloc(dwAvail + 1);\n\t\t\t\t\tif ((output != NULL) && (ReadFile(hOutputRead, output, dwAvail, &dwRead, NULL)) && (dwRead != 0)) {\n\t\t\t\t\t\toutput[dwAvail] = 0;\n\t\t\t\t\t\t// Process a commandline progress into a percentage\n\t\t\t\t\t\tif (program != NULL && cregex_program_run(program, output, (const char**)matches, ARRAYSIZE(matches)) > 0 &&\n\t\t\t\t\t\t\tmatches[2] != NULL && matches[3] != NULL) {\n\t\t\t\t\t\t\t// matches[2] is for the first group\n\t\t\t\t\t\t\t// matches[3] is for the end of the first group\n\t\t\t\t\t\t\tmatches[3][0] = '\\0';\n\t\t\t\t\t\t\tfloat f = 0.0f;\n\t\t\t\t\t\t\tIGNORE_RETVAL(sscanf(matches[2], \"%f\", &f));\n\t\t\t\t\t\t\tUpdateProgressWithInfo(OP_FORMAT, msg, (uint64_t)(f * 100.0f), 100 * 100ULL);\n\t\t\t\t\t\t} else if (log) {\n\t\t\t\t\t\t\t// output may contain a '%' so don't feed it as a naked format string\n\t\t\t\t\t\t\tuprintf(\"%s\", output);\n\t\t\t\t\t\t} else if ((p = strstr(output, \"ERROR:\")) != NULL) {\n\t\t\t\t\t\t\t// Mostly for oscdimg.exe errors\n\t\t\t\t\t\t\tuprintf(\"%s\", p);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfree(output);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (WaitForSingleObject(pi.hProcess, 0) == WAIT_OBJECT_0)\n\t\t\t\tbreak;\n\t\t\tSleep(100);\n\t\t};\n\t} else {\n\t\tswitch (WaitForSingleObject(pi.hProcess, 1800000)) {\n\t\tcase WAIT_TIMEOUT:\n\t\t\tuprintf(\"Command did not terminate within timeout duration\");\n\t\t\tbreak;\n\t\tcase WAIT_OBJECT_0:\n\t\t\tif (IS_ERROR(ErrorStatus) && (SCODE_CODE(ErrorStatus) == ERROR_CANCELLED))\n\t\t\t\tuprintf(\"Command was terminated by user\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tuprintf(\"Error while waiting for command to be terminated: %s\", WindowsErrorString());\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!GetExitCodeProcess(pi.hProcess, &ret))\n\t\tret = GetLastError();\n\tCloseHandle(pi.hProcess);\n\tCloseHandle(pi.hThread);\n\nout:\n\tcregex_compile_free(program);\n\tsafe_closehandle(hOutputWrite);\n\tsafe_closehandle(hOutputRead);\n\treturn ret;\n}\n\nBOOL CompareGUID(const GUID *guid1, const GUID *guid2) {\n\tif ((guid1 != NULL) && (guid2 != NULL)) {\n\t\treturn (memcmp(guid1, guid2, sizeof(GUID)) == 0);\n\t}\n\treturn FALSE;\n}\n\nstatic BOOL CALLBACK EnumFontFamExProc(const LOGFONTA *lpelfe,\n\tconst TEXTMETRICA *lpntme, DWORD FontType, LPARAM lParam)\n{\n\treturn TRUE;\n}\n\nBOOL IsFontAvailable(const char* font_name)\n{\n\tBOOL r;\n\tLOGFONTA lf = { 0 };\n\tHDC hDC = GetDC(hMainDialog);\n\n\tif (font_name == NULL) {\n\t\tsafe_release_dc(hMainDialog, hDC);\n\t\treturn FALSE;\n\t}\n\n\tlf.lfCharSet = DEFAULT_CHARSET;\n\tsafe_strcpy(lf.lfFaceName, LF_FACESIZE, font_name);\n\n\tr = EnumFontFamiliesExA(hDC, &lf, EnumFontFamExProc, 0, 0);\n\tsafe_release_dc(hMainDialog, hDC);\n\treturn r;\n}\n\n/*\n * Set or restore a Local Group Policy DWORD key indexed by szPath/SzPolicy\n */\n// I've seen rare cases where pLGPO->lpVtbl->Save(...) gets stuck, which prevents the\n// application from launching altogether. To alleviate this, use a thread that we can\n// terminate if needed...\ntypedef struct {\n\tBOOL bRestore;\n\tBOOL* bExistingKey;\n\tconst char* szPath;\n\tconst char* szPolicy;\n\tDWORD dwValue;\n} SetLGP_Params;\n\nDWORD WINAPI SetLGPThread(LPVOID param)\n{\n\tSetLGP_Params* p = (SetLGP_Params*)param;\n\tLONG r;\n\tDWORD disp, regtype, val=0, val_size=sizeof(DWORD);\n\tHRESULT hr;\n\tIGroupPolicyObject* pLGPO;\n\t// Along with global 'existing_key', this static value is used to restore initial state\n\tstatic DWORD original_val;\n\tHKEY path_key = NULL, policy_key = NULL;\n\t// MSVC is finicky about these ones even if you link against gpedit.lib => redefine them\n\tconst IID my_IID_IGroupPolicyObject =\n\t\t{ 0xea502723L, 0xa23d, 0x11d1, { 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3 } };\n\tconst IID my_CLSID_GroupPolicyObject =\n\t\t{ 0xea502722L, 0xa23d, 0x11d1, { 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3 } };\n\tGUID ext_guid = REGISTRY_EXTENSION_GUID;\n\t// Can be anything really\n\tGUID snap_guid = { 0x3D271CFCL, 0x2BC6, 0x4AC2, {0xB6, 0x33, 0x3B, 0xDF, 0xF5, 0xBD, 0xAB, 0x2A} };\n\n\t// Reinitialize COM since it's not shared between threads\n\tIGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE));\n\n\t// We need an IGroupPolicyObject instance to set a Local Group Policy\n\thr = CoCreateInstance(&my_CLSID_GroupPolicyObject, NULL, CLSCTX_INPROC_SERVER, &my_IID_IGroupPolicyObject, (LPVOID*)&pLGPO);\n\tif (FAILED(hr)) {\n\t\tubprintf(\"SetLGP: CoCreateInstance failed; hr = %lx\", hr);\n\t\tgoto error;\n\t}\n\n\thr = pLGPO->lpVtbl->OpenLocalMachineGPO(pLGPO, GPO_OPEN_LOAD_REGISTRY);\n\tif (FAILED(hr)) {\n\t\tubprintf(\"SetLGP: OpenLocalMachineGPO failed - error %lx\", hr);\n\t\tgoto error;\n\t}\n\n\thr = pLGPO->lpVtbl->GetRegistryKey(pLGPO, GPO_SECTION_MACHINE, &path_key);\n\tif (FAILED(hr)) {\n\t\tubprintf(\"SetLGP: GetRegistryKey failed - error %lx\", hr);\n\t\tgoto error;\n\t}\n\n\tr = RegCreateKeyExA(path_key, p->szPath, 0, NULL, 0, KEY_SET_VALUE | KEY_QUERY_VALUE,\n\t\tNULL, &policy_key, &disp);\n\tif (r != ERROR_SUCCESS) {\n\t\tubprintf(\"SetLGP: Failed to open LGPO path %s - error %lx\", p->szPath, hr);\n\t\tpolicy_key = NULL;\n\t\tgoto error;\n\t}\n\n\tif ((disp == REG_OPENED_EXISTING_KEY) && (!p->bRestore) && (!(*(p->bExistingKey)))) {\n\t\t// backup existing value for restore\n\t\t*(p->bExistingKey) = TRUE;\n\t\tregtype = REG_DWORD;\n\t\tr = RegQueryValueExA(policy_key, p->szPolicy, NULL, &regtype, (LPBYTE)&original_val, &val_size);\n\t\tif (r == ERROR_FILE_NOT_FOUND) {\n\t\t\t// The Key exists but not its value, which is OK\n\t\t\t*(p->bExistingKey) = FALSE;\n\t\t} else if (r != ERROR_SUCCESS) {\n\t\t\tubprintf(\"SetLGP: Failed to read original %s policy value - error %lx\", p->szPolicy, r);\n\t\t}\n\t}\n\n\tif ((!p->bRestore) || (*(p->bExistingKey))) {\n\t\tval = (p->bRestore)?original_val:p->dwValue;\n\t\tr = RegSetValueExA(policy_key, p->szPolicy, 0, REG_DWORD, (BYTE*)&val, sizeof(val));\n\t} else {\n\t\tr = RegDeleteValueA(policy_key, p->szPolicy);\n\t}\n\tif (r != ERROR_SUCCESS) {\n\t\tubprintf(\"SetLGP: RegSetValueEx / RegDeleteValue failed - error %lx\", r);\n\t}\n\tRegCloseKey(policy_key);\n\tpolicy_key = NULL;\n\n\t// Apply policy\n\thr = pLGPO->lpVtbl->Save(pLGPO, TRUE, (p->bRestore)?FALSE:TRUE, &ext_guid, &snap_guid);\n\tif (hr != S_OK) {\n\t\tubprintf(\"SetLGP: Unable to apply %s policy - error %lx\", p->szPolicy, hr);\n\t\tgoto error;\n\t} else {\n\t\tif ((!p->bRestore) || (*(p->bExistingKey))) {\n\t\t\tubprintf(\"SetLGP: Successfully %s %s policy to 0x%08lX\", (p->bRestore)?\"restored\":\"set\", p->szPolicy, val);\n\t\t} else {\n\t\t\tubprintf(\"SetLGP: Successfully removed %s policy key\", p->szPolicy);\n\t\t}\n\t}\n\n\tRegCloseKey(path_key);\n\tpLGPO->lpVtbl->Release(pLGPO);\n\treturn TRUE;\n\nerror:\n\tif (path_key != NULL)\n\t\tRegCloseKey(path_key);\n\tif (pLGPO != NULL)\n\t\tpLGPO->lpVtbl->Release(pLGPO);\n\tCoUninitialize();\n\treturn FALSE;\n}\n\nBOOL SetLGP(BOOL bRestore, BOOL* bExistingKey, const char* szPath, const char* szPolicy, DWORD dwValue)\n{\n\tSetLGP_Params params = {bRestore, bExistingKey, szPath, szPolicy, dwValue};\n\tDWORD r = FALSE;\n\tHANDLE thread_id;\n\n\tif (ReadSettingBool(SETTING_DISABLE_LGP)) {\n\t\tubprintf(\"LPG handling disabled, per settings\");\n\t\treturn FALSE;\n\t}\n\n\tthread_id = CreateThread(NULL, 0, SetLGPThread, (LPVOID)&params, 0, NULL);\n\tif (thread_id == NULL) {\n\t\tubprintf(\"SetLGP: Unable to start thread\");\n\t\treturn FALSE;\n\t}\n\tif (WaitForSingleObject(thread_id, 5000) != WAIT_OBJECT_0) {\n\t\tubprintf(\"SetLGP: Killing stuck thread!\");\n\t\tTerminateThread(thread_id, 0);\n\t\tCloseHandle(thread_id);\n\t\treturn FALSE;\n\t}\n\tif (!GetExitCodeThread(thread_id, &r))\n\t\treturn FALSE;\n\treturn (BOOL) r;\n}\n\n/*\n * This call tries to evenly balance the affinities for an array of\n * num_threads, according to the number of cores at our disposal...\n */\nBOOL SetThreadAffinity(DWORD_PTR* thread_affinity, size_t num_threads)\n{\n\tsize_t i, j, pc;\n\tDWORD_PTR affinity, dummy;\n\n\tmemset(thread_affinity, 0, num_threads * sizeof(DWORD_PTR));\n\tif (!GetProcessAffinityMask(GetCurrentProcess(), &affinity, &dummy))\n\t\treturn FALSE;\n\tuuprintf(\"\\r\\nThread affinities:\");\n\tuuprintf(\"  avail:\\t%s\", printbitslz(affinity));\n\n\t// If we don't have enough virtual cores to evenly spread our load forget it\n\tpc = popcnt64(affinity);\n\tif (pc < num_threads)\n\t\treturn FALSE;\n\n\t// Spread the affinity as evenly as we can\n\tthread_affinity[num_threads - 1] = affinity;\n\tfor (i = 0; i < num_threads - 1; i++) {\n\t\tfor (j = 0; j < pc / num_threads; j++) {\n\t\t\tthread_affinity[i] |= affinity & (-1LL * affinity);\n\t\t\taffinity ^= affinity & (-1LL * affinity);\n\t\t}\n\t\tuuprintf(\"  thr_%llu:\\t%s\", i, printbitslz(thread_affinity[i]));\n\t\tthread_affinity[num_threads - 1] ^= thread_affinity[i];\n\t}\n\tuuprintf(\"  thr_%llu:\\t%s\", i, printbitslz(thread_affinity[i]));\n\treturn TRUE;\n}\n\n/*\n * Returns true if:\n * 1. The OS supports UAC, UAC is on, and the current process runs elevated, or\n * 2. The OS doesn't support UAC or UAC is off, and the process is being run by a member of the admin group\n */\nBOOL IsCurrentProcessElevated(void)\n{\n\tBOOL r = FALSE;\n\tDWORD size;\n\tHANDLE token = INVALID_HANDLE_VALUE;\n\tTOKEN_ELEVATION te;\n\tSID_IDENTIFIER_AUTHORITY auth = { SECURITY_NT_AUTHORITY };\n\tPSID psid;\n\n\tif (ReadRegistryKey32(REGKEY_HKLM, \"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Policies\\\\System\\\\EnableLUA\") == 1) {\n\t\tuprintf(\"Note: UAC is active\");\n\t\tif (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) {\n\t\t\tuprintf(\"Could not get current process token: %s\", WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tif (!GetTokenInformation(token, TokenElevation, &te, sizeof(te), &size)) {\n\t\t\tuprintf(\"Could not get token information: %s\", WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tr = (te.TokenIsElevated != 0);\n\t} else {\n\t\tuprintf(\"Note: UAC is either disabled or not available\");\n\t\tif (!AllocateAndInitializeSid(&auth, 2, SECURITY_BUILTIN_DOMAIN_RID,\n\t\t\tDOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &psid))\n\t\t\tgoto out;\n\t\tif (!CheckTokenMembership(NULL, psid, &r))\n\t\t\tr = FALSE;\n\t\tFreeSid(psid);\n\t}\n\nout:\n\tsafe_closehandle(token);\n\treturn r;\n}\n\nchar* ToLocaleName(DWORD lang_id)\n{\n\tstatic char mui_str[LOCALE_NAME_MAX_LENGTH];\n\twchar_t wmui_str[LOCALE_NAME_MAX_LENGTH];\n\n\tif (LCIDToLocaleName(lang_id, wmui_str, LOCALE_NAME_MAX_LENGTH, 0) > 0) {\n\t\twchar_to_utf8_no_alloc(wmui_str, mui_str, LOCALE_NAME_MAX_LENGTH);\n\t} else {\n\t\tstatic_strcpy(mui_str, \"en-US\");\n\t}\n\treturn mui_str;\n}\n\n/*\n * From: https://stackoverflow.com/a/40390858/1069307\n */\nBOOL SetPrivilege(HANDLE hToken, LPCWSTR pwzPrivilegeName, BOOL bEnable)\n{\n\tTOKEN_PRIVILEGES tp;\n\tLUID luid;\n\n\tif (!LookupPrivilegeValue(NULL, pwzPrivilegeName, &luid)) {\n\t\tuprintf(\"Could not lookup '%S' privilege: %s\", pwzPrivilegeName, WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\n\ttp.PrivilegeCount = 1;\n\ttp.Privileges[0].Luid = luid;\n\ttp.Privileges[0].Attributes = bEnable ? SE_PRIVILEGE_ENABLED : 0;\n\n\tif (!AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(TOKEN_PRIVILEGES), NULL, NULL)) {\n\t\tuprintf(\"Could not %s '%S' privilege: %s\",\n\t\t\tbEnable ? \"enable\" : \"disable\", pwzPrivilegeName, WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\n\tif (GetLastError() == ERROR_NOT_ALL_ASSIGNED) {\n\t\tuprintf(\"Error assigning privileges: %s\", WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\n\treturn TRUE;\n}\n\n/*\n * Mount an offline registry hive located at <pszHivePath> into <key>\\<pszHiveName>.\n * <key> should be HKEY_LOCAL_MACHINE or HKEY_USERS.\n */\nBOOL MountRegistryHive(const HKEY key, const char* pszHiveName, const char* pszHivePath)\n{\n\tLSTATUS status;\n\tHANDLE token = INVALID_HANDLE_VALUE;\n\n\tif_assert_fails((key == HKEY_LOCAL_MACHINE) || (key == HKEY_USERS))\n\t\treturn FALSE;\n\n\tif (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token)) {\n\t\tuprintf(\"Could not get current process token: %s\", WindowsErrorString());\n\t\treturn FALSE;\n\t}\n\n\t// Ignore errors on those in case we can proceed without...\n\tSetPrivilege(token, SE_RESTORE_NAME, TRUE);\n\tSetPrivilege(token, SE_BACKUP_NAME, TRUE);\n\n\tstatus = RegLoadKeyA(key, pszHiveName, pszHivePath);\n\tif (status != ERROR_SUCCESS) {\n\t\tSetLastError(status);\n\t\tuprintf(\"Could not mount offline registry hive '%s': %s\", pszHivePath, WindowsErrorString());\n\t} else\n\t\tuprintf(\"Mounted offline registry hive '%s' to '%s\\\\%s'\",\n\t\t\tpszHivePath, (key == HKEY_LOCAL_MACHINE) ? \"HKLM\" : \"HKCU\", pszHiveName);\n\n\tsafe_closehandle(token);\n\treturn (status == ERROR_SUCCESS);\n}\n\n/*\n * Unmount an offline registry hive.\n * <key> should be HKEY_LOCAL_MACHINE or HKEY_USERS.\n */\nBOOL UnmountRegistryHive(const HKEY key, const char* pszHiveName)\n{\n\tLSTATUS status;\n\n\tif_assert_fails((key == HKEY_LOCAL_MACHINE) || (key == HKEY_USERS))\n\t\treturn FALSE;\n\n\tstatus = RegUnLoadKeyA(key, pszHiveName);\n\tif (status != ERROR_SUCCESS) {\n\t\tSetLastError(status);\n\t\tuprintf(\"Could not unmount offline registry hive: %s\", WindowsErrorString());\n\t} else\n\t\tuprintf(\"Unmounted offline registry hive '%s\\\\%s'\",\n\t\t\t(key == HKEY_LOCAL_MACHINE) ? \"HKLM\" : \"HKCU\", pszHiveName);\n\n\treturn (status == ERROR_SUCCESS);\n}\n\n/*\n * Take administrative ownership of a file or directory, and grant all access rights.\n */\nBOOL TakeOwnership(LPCSTR lpszOwnFile)\n{\n\tBOOL ret = FALSE;\n\tHANDLE hToken = NULL;\n\tPSID pSIDAdmin = NULL;\n\tPACL pOldDACL = NULL, pNewDACL = NULL;\n\tPSECURITY_DESCRIPTOR pSD = NULL;\n\tSID_IDENTIFIER_AUTHORITY SIDAuthNT = SECURITY_NT_AUTHORITY;\n\tEXPLICIT_ACCESS ea = { 0 };\n\n\tif (lpszOwnFile == NULL)\n\t\treturn FALSE;\n\n\t// Create a SID for the BUILTIN\\Administrators group.\n\tif (!AllocateAndInitializeSid(&SIDAuthNT, 2, SECURITY_BUILTIN_DOMAIN_RID,\n\t\tDOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &pSIDAdmin))\n\t\tgoto out;\n\n\t// Open a handle to the access token for the calling process.\n\tif (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))\n\t\tgoto out;\n\n\t// Enable the SE_TAKE_OWNERSHIP_NAME privilege.\n\tif (!SetPrivilege(hToken, SE_TAKE_OWNERSHIP_NAME, TRUE))\n\t\tgoto out;\n\n\t// Set the owner in the object's security descriptor.\n\tif (SetNamedSecurityInfoU(lpszOwnFile, SE_FILE_OBJECT, OWNER_SECURITY_INFORMATION,\n\t\tpSIDAdmin, NULL, NULL, NULL) != ERROR_SUCCESS)\n\t\tgoto out;\n\n\t// Disable the SE_TAKE_OWNERSHIP_NAME privilege.\n\tif (!SetPrivilege(hToken, SE_TAKE_OWNERSHIP_NAME, FALSE))\n\t\tgoto out;\n\n\t// Get a pointer to the existing DACL.\n\tif (GetNamedSecurityInfoU(lpszOwnFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION,\n\t\tNULL, NULL, &pOldDACL, NULL, &pSD) != ERROR_SUCCESS)\n\t\tgoto out;\n\n\t// Initialize an EXPLICIT_ACCESS structure for the new ACE\n\t// with full control for Administrators.\n\tea.grfAccessPermissions = GENERIC_ALL;\n\tea.grfAccessMode = GRANT_ACCESS;\n\tea.grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;\n\tea.Trustee.TrusteeForm = TRUSTEE_IS_SID;\n\tea.Trustee.TrusteeType = TRUSTEE_IS_GROUP;\n\tea.Trustee.ptstrName = (LPTSTR)pSIDAdmin;\n\n\t// Create a new ACL that merges the new ACE into the existing DACL.\n\tif (SetEntriesInAcl(1, &ea, pOldDACL, &pNewDACL) != ERROR_SUCCESS)\n\t\tgoto out;\n\n\t// Try to modify the object's DACL.\n\tif (SetNamedSecurityInfoU(lpszOwnFile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION,\n\t\tNULL, NULL, pNewDACL, NULL) != ERROR_SUCCESS)\n\t\tgoto out;\n\n\tret = TRUE;\n\nout:\n\tFreeSid(pSIDAdmin);\n\tLocalFree(pNewDACL);\n\tsafe_closehandle(hToken);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/stdio.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Standard User I/O Routines (logging, status, error, etc.)\n * Copyright © 2011-2026 Pete Batard <pete@akeo.ie>\n * Copyright © 2020 Mattiwatti <mattiwatti@gmail.com>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <windowsx.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n#include <wininet.h>\n#include <winternl.h>\n#include <dbghelp.h>\n#include <assert.h>\n#include <ctype.h>\n#include <math.h>\n\n#include \"rufus.h\"\n#include \"ntdll.h\"\n#include \"missing.h\"\n#include \"settings.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n#include \"bled/bled.h\"\n\n#define FACILITY_WIM            322\n#define DEFAULT_BASE_ADDRESS    0x100000000ULL\n#define RSDS_SIG                0x53445352\n\n/*\n * Globals\n */\nconst HANDLE hRufus = (HANDLE)0x0000005275667573ULL;\t// \"\\0\\0\\0Rufus\"\nHWND hStatus;\nsize_t ubuffer_pos = 0;\nchar ubuffer[UBUFFER_SIZE];\t// Buffer for ubpushf() messages we don't log right away\nstatic uint64_t archive_size;\n\n#pragma pack(push, 1)\ntypedef struct {\n\tDWORD   Signature;\t// \"RSDS\"\n\tGUID    Guid;\n\tDWORD   Age;\n\tCHAR    PdbName[1];\n} debug_info_t;\n#pragma pack(pop)\n\nvoid uprintf(const char *format, ...)\n{\n\tstatic char buf[4096];\n\tchar* p = buf;\n\twchar_t* wbuf;\n\tva_list args;\n\tint n;\n\n\tva_start(args, format);\n\tn = safe_vsnprintf(p, sizeof(buf)-3, format, args); // buf-3 is room for CR/LF/NUL\n\tva_end(args);\n\n\tp += (n < 0)?sizeof(buf)-3:n;\n\n\twhile((p>buf) && (isspaceU(p[-1])))\n\t\t*--p = '\\0';\n\n\t*p++ = '\\r';\n\t*p++ = '\\n';\n\t*p   = '\\0';\n\n\twbuf = utf8_to_wchar(buf);\n\t// Send output to Windows debug facility\n\t// coverity[dont_call]\n\tOutputDebugStringW(wbuf);\n\tif ((hLog != NULL) && (hLog != INVALID_HANDLE_VALUE)) {\n\t\t// Send output to our log Window\n\t\tEdit_SetSel(hLog, MAX_LOG_SIZE, MAX_LOG_SIZE);\n\t\tEdit_ReplaceSel(hLog, wbuf);\n\t\t// Make sure the message scrolls into view\n\t\tEdit_Scroll(hLog, Edit_GetLineCount(hLog), 0);\n\t}\n\tfree(wbuf);\n}\n\nvoid wuprintf(const wchar_t* format, ...)\n{\n\tstatic wchar_t wbuf[4096];\n\twchar_t* p = wbuf;\n\tva_list args;\n\tint n;\n\n\tva_start(args, format);\n\tn = _vsnwprintf_s(p, ARRAYSIZE(wbuf) - 3, _TRUNCATE, format, args);\n\tva_end(args);\n\n\tp += (n < 0) ? ARRAYSIZE(wbuf) - 3 : n;\n\n\tif (n >= 1 && p[-1] == L'\\n') {\n\t\tp[-1] = L'\\r';\n\t\t*p++ = L'\\n';\n\t\t*p = L'\\0';\n\t}\n\n\t// coverity[dont_call]\n\tOutputDebugStringW(wbuf);\n\tif ((hLog != NULL) && (hLog != INVALID_HANDLE_VALUE)) {\n\t\tEdit_SetSel(hLog, MAX_LOG_SIZE, MAX_LOG_SIZE);\n\t\tEdit_ReplaceSel(hLog, wbuf);\n\t\tEdit_Scroll(hLog, Edit_GetLineCount(hLog), 0);\n\t}\n}\n\nvoid uprintfs(const char* str)\n{\n\twchar_t* wstr;\n\twstr = utf8_to_wchar(str);\n\t// coverity[dont_call]\n\tOutputDebugStringW(wstr);\n\tif ((hLog != NULL) && (hLog != INVALID_HANDLE_VALUE)) {\n\t\tEdit_SetSel(hLog, MAX_LOG_SIZE, MAX_LOG_SIZE);\n\t\tEdit_ReplaceSel(hLog, wstr);\n\t\tEdit_Scroll(hLog, Edit_GetLineCount(hLog), 0);\n\t}\n\tfree(wstr);\n}\n\nvoid uprint_progress(uint64_t cur_value, uint64_t max_value)\n{\n\tstatic uint64_t last_value = 0;\n\tif (cur_value == 0) {\n\t\tlast_value = 0;\n\t\treturn;\n\t}\n\tassert(max_value != 0);\n\tcur_value = (uint64_t)(((float)cur_value / (float)max_value) * min(MAX_MARKER, (float)max_value));\n\tfor (; cur_value > last_value && last_value < 80; last_value++)\n\t\tuprintfs(\"+\");\n}\n\nuint32_t read_file(const char* path, uint8_t** buf)\n{\n\tFILE* fd = fopenU(path, \"rb\");\n\tif (fd == NULL) {\n\t\tuprintf(\"Error: Can't open file '%s'\", path);\n\t\treturn 0;\n\t}\n\n\tfseek(fd, 0L, SEEK_END);\n\tuint32_t size = (uint32_t)ftell(fd);\n\tfseek(fd, 0L, SEEK_SET);\n\n\t// +1 so we can add an extra NUL\n\t*buf = malloc(size + 1);\n\tif (*buf == NULL) {\n\t\tuprintf(\"Error: Can't allocate %d bytes buffer for file '%s'\", size, path);\n\t\tsize = 0;\n\t\tgoto out;\n\t}\n\tif (fread(*buf, 1, size, fd) != size) {\n\t\tuprintf(\"Error: Can't read '%s'\", path);\n\t\tsize = 0;\n\t}\n\t// Always NUL terminate the file\n\t(*buf)[size] = 0;\n\nout:\n\tfclose(fd);\n\tif (size == 0) {\n\t\tfree(*buf);\n\t\t*buf = NULL;\n\t}\n\treturn size;\n}\n\nuint32_t write_file(const char* path, const uint8_t* buf, const uint32_t size)\n{\n\tuint32_t written;\n\tFILE* fd = fopenU(path, \"wb\");\n\tif (fd == NULL) {\n\t\tuprintf(\"Error: Can't create '%s'\", path);\n\t\treturn 0;\n\t}\n\twritten = (uint32_t)fwrite(buf, 1, size, fd);\n\tif (written != size)\n\t\tuprintf(\"Error: Can't write '%s'\", path);\n\tfclose(fd);\n\treturn written;\n}\n\n// Prints a bitstring of a number of any size, with or without leading zeroes.\n// See also the printbits() and printbitslz() helper macros in rufus.h\nchar *_printbits(size_t const size, void const * const ptr, int leading_zeroes)\n{\n\t// sizeof(uintmax_t) so that we have enough space to store whatever is thrown at us\n\tstatic char str[sizeof(uintmax_t) * 8 + 3];\n\tsize_t i;\n\tuint8_t* b = (uint8_t*)ptr;\n\tuintmax_t mask, lzmask = 0, val = 0;\n\n\t// Little endian, the SCOURGE of any rational computing\n\tfor (i = 0; i < size; i++)\n\t\tval |= ((uintmax_t)b[i]) << (8 * i);\n\n\tstr[0] = '0';\n\tstr[1] = 'b';\n\tif (leading_zeroes)\n\t\tlzmask = 1ULL << (size * 8 - 1);\n\tfor (i = 2, mask = 1ULL << (sizeof(uintmax_t) * 8 - 1); mask != 0; mask >>= 1) {\n\t\tif ((i > 2) || (lzmask & mask))\n\t\t\tstr[i++] = (val & mask) ? '1' : '0';\n\t\telse if (val & mask)\n\t\t\tstr[i++] = '1';\n\t}\n\tstr[i] = '\\0';\n\treturn str;\n}\n\n// Display an hex dump of buffer 'buf'\nvoid DumpBufferHex(void *buf, size_t size)\n{\n\tunsigned char* buffer = (unsigned char*)buf;\n\tsize_t i, j, k;\n\tchar line[80] = \"\";\n\n\tfor (i=0; i<size; i+=16) {\n\t\tif (i!=0)\n\t\t\tuprintf(\"%s\\n\", line);\n\t\tline[0] = 0;\n\t\tsprintf(&line[strlen(line)], \"  %08x  \", (unsigned int)i);\n\t\tfor(j = 0,k = 0; k < 16; j++,k++) {\n\t\t\tif (i+j < size) {\n\t\t\t\tsprintf(&line[strlen(line)], \"%02x\", buffer[i+j]);\n\t\t\t} else {\n\t\t\t\tsprintf(&line[strlen(line)], \"  \");\n\t\t\t}\n\t\t\tsprintf(&line[strlen(line)], \" \");\n\t\t}\n\t\tsprintf(&line[strlen(line)], \" \");\n\t\tfor(j = 0,k = 0; k < 16; j++,k++) {\n\t\t\tif (i+j < size) {\n\t\t\t\tif ((buffer[i+j] < 32) || (buffer[i+j] > 126)) {\n\t\t\t\t\tsprintf(&line[strlen(line)], \".\");\n\t\t\t\t} else {\n\t\t\t\t\tsprintf(&line[strlen(line)], \"%c\", buffer[i+j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tuprintf(\"%s\\n\", line);\n}\n\n// Convert a Windows error to human readable string\n// One really has to wonder why the hell FormatMessage() was designed not to\n// handle FORMAT_MESSAGE_FROM_HMODULE automatically according to the facility...\nconst char *WindowsErrorString(void)\n{\n\tstatic char err_string[256] = { 0 };\n\n\tDWORD size, presize;\n\tDWORD error_code, _error_code, format_error;\n\tLCID locale;\n\tHANDLE hModule = NULL;\n\n\terror_code = GetLastError();\n\t_error_code = error_code;\n\t// Set thread locale to en-US when in this function.\n\t// This is because kernel32!FormatMessage is documented to try the following order when dwLanguageId==0:\n\t// - Language neutral\n\t// - Thread locale\n\t// - User default locale\n\t// - System default locale\n\t// - English US\n\t// Some Windows localisations do not provide English MUI resources for specific error codes.\n\t// So with thread locale set to en-US, FormatMessage will try neutral, then en-US, then fall back to localised string.\n\tlocale = GetThreadLocale();\n\tSetThreadLocale(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT));\nretry:\n\t// Check for specific facility error codes\n\tswitch (HRESULT_FACILITY(_error_code)) {\n\tcase FACILITY_NULL:\n\t\t// Special case for internet related errors, that don't actually have a facility\n\t\t// set but still require a hModule into wininet to display the messages.\n\t\tif ((_error_code >= INTERNET_ERROR_BASE) && (_error_code <= INTERNET_ERROR_LAST))\n\t\t\thModule = GetModuleHandleA(\"wininet.dll\");\n\t\tbreak;\n\tcase FACILITY_ITF:\n\t\thModule = GetModuleHandleA(\"vdsutil.dll\");\n\t\tbreak;\n\tcase FACILITY_WIM:\n\t\thModule = GetModuleHandleA(\"wimgapi.dll\");\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\tstatic_sprintf(err_string, \"[0x%08lX] \", error_code);\n\tpresize = (DWORD)strlen(err_string);\n\n\t// coverity[var_deref_model]\n\tsize = FormatMessageU(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |\n\t\t((hModule != NULL) ? FORMAT_MESSAGE_FROM_HMODULE : 0), hModule,\n\t\t_error_code, 0,\n\t\t&err_string[presize], (DWORD)(sizeof(err_string) - strlen(err_string)), NULL);\n\tif (size == 0) {\n\t\tformat_error = GetLastError();\n\t\tswitch (format_error) {\n\t\tcase ERROR_SUCCESS:\n\t\t\tstatic_sprintf(err_string, \"[0x%08lX] (No Windows Error String)\", _error_code);\n\t\t\tbreak;\n\t\tcase ERROR_MR_MID_NOT_FOUND:\n\t\tcase ERROR_MUI_FILE_NOT_FOUND:\n\t\tcase ERROR_MUI_FILE_NOT_LOADED:\n\t\t\t// We might be trying with the wrong facility. Remove it and try again.\n\t\t\tif (HRESULT_FACILITY(_error_code) != FACILITY_NULL) {\n\t\t\t\t_error_code = HRESULT_CODE(_error_code);\n\t\t\t\tgoto retry;\n\t\t\t}\n\t\t\tstatic_sprintf(err_string, \"[0x%08lX] (NB: This system was unable to provide a descriptive error message)\", error_code);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstatic_sprintf(err_string, \"[0x%08lX] (FormatMessage error code 0x%08lX)\", error_code, format_error);\n\t\t\tbreak;\n\t\t}\n\t} else {\n\t\t// Microsoft may suffix CRLF to error messages, which we need to remove...\n\t\tassert(presize > 2);\n\t\tsize += presize - 2;\n\t\t// Cannot underflow if the above assert passed since our first char is neither of the following\n\t\twhile ((err_string[size] == 0x0D) || (err_string[size] == 0x0A) || (err_string[size] == 0x20))\n\t\t\terr_string[size--] = 0;\n\t}\n\n\tSetThreadLocale(locale);\t// Set the original thread locale on exit\n\tSetLastError(error_code);\t// Make sure we don't change the errorcode on exit\n\treturn err_string;\n}\n\nchar* GuidToString(const GUID* guid, BOOL bDecorated)\n{\n\tstatic char guid_string[MAX_GUID_STRING_LENGTH];\n\n\tif (guid == NULL) return NULL;\n\tsprintf(guid_string, bDecorated ? \"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}\" :\n\t\t\"%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X\",\n\t\t(uint32_t)guid->Data1, guid->Data2, guid->Data3,\n\t\tguid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],\n\t\tguid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);\n\treturn guid_string;\n}\n\nGUID StringToGuid(const char* str)\n{\n\tGUID guid = { 0 };\n\tuint32_t d1, d2, d3, b0, b1, b2, b3, b4, b5, b6, b7;\n\tif (str != NULL && sscanf(str[0] == '{' ? &str[1] : str, \"%8x-%4x-%4x-%2x%2x-%2x%2x%2x%2x%2x%2x\",\n\t\t&d1, &d2, &d3, &b0, &b1, &b2, &b3, &b4, &b5, &b6, &b7) == 11) {\n\t\tguid.Data1 = d1;\n\t\tguid.Data2 = (uint16_t)d2;\n\t\tguid.Data3 = (uint16_t)d3;\n\t\tguid.Data4[0] = (uint8_t)b0;\n\t\tguid.Data4[1] = (uint8_t)b1;\n\t\tguid.Data4[2] = (uint8_t)b2;\n\t\tguid.Data4[3] = (uint8_t)b3;\n\t\tguid.Data4[4] = (uint8_t)b4;\n\t\tguid.Data4[5] = (uint8_t)b5;\n\t\tguid.Data4[6] = (uint8_t)b6;\n\t\tguid.Data4[7] = (uint8_t)b7;\n\t}\n\treturn guid;\n}\n\n// Find upper power of 2\nstatic __inline uint16_t upo2(uint16_t v)\n{\n\tv--;\n\tv |= v >> 1;\n\tv |= v >> 2;\n\tv |= v >> 4;\n\tv |= v >> 8;\n\tv++;\n\treturn v;\n}\n\n// Convert a size to human readable\nchar* SizeToHumanReadable(uint64_t size, BOOL copy_to_log, BOOL fake_units)\n{\n\tint suffix;\n\tstatic char str_size[32];\n\tconst char* dir = ((right_to_left_mode) && (!copy_to_log)) ? LEFT_TO_RIGHT_MARK : \"\";\n\tdouble hr_size = (double)size;\n\tdouble t;\n\tuint16_t i_size;\n\tchar **_msg_table = copy_to_log ? default_msg_table : msg_table;\n\tconst double divider = fake_units ? 1000.0 : 1024.0;\n\n\tfor (suffix = 0; suffix < MAX_SIZE_SUFFIXES - 1; suffix++) {\n\t\tif (hr_size < divider)\n\t\t\tbreak;\n\t\thr_size /= divider;\n\t}\n\tif (suffix == 0) {\n\t\tstatic_sprintf(str_size, \"%s%d%s %s\", dir, (int)hr_size, dir, _msg_table[MSG_020 - MSG_000]);\n\t} else if (fake_units) {\n\t\tif (hr_size < 8) {\n\t\t\tstatic_sprintf(str_size, (fabs((hr_size * 10.0) - (floor(hr_size + 0.5) * 10.0)) < 0.5) ?\n\t\t\t\t\"%0.0f%s\":\"%0.1f%s\", hr_size, _msg_table[MSG_020 + suffix - MSG_000]);\n\t\t} else {\n\t\t\tt = (double)upo2((uint16_t)hr_size);\n\t\t\ti_size = (uint16_t)((fabs(1.0f - (hr_size / t)) < 0.05f) ? t : hr_size);\n\t\t\tstatic_sprintf(str_size, \"%s%d%s %s\", dir, i_size, dir, _msg_table[MSG_020 + suffix - MSG_000]);\n\t\t}\n\t} else {\n\t\tstatic_sprintf(str_size, (hr_size * 10.0 - (floor(hr_size) * 10.0)) < 0.5?\n\t\t\t\"%s%0.0f%s %s\":\"%s%0.1f%s %s\", dir, hr_size, dir, _msg_table[MSG_020 + suffix - MSG_000]);\n\t}\n\treturn str_size;\n}\n\n// Convert a YYYYMMDDHHMMSS UTC timestamp to a more human readable version\nchar* TimestampToHumanReadable(uint64_t ts)\n{\n\tuint64_t rem = ts, divisor = 10000000000ULL;\n\tuint16_t data[6];\n\tint i;\n\tstatic char str[64];\n\n\tfor (i = 0; i < 6; i++) {\n\t\tdata[i] = (uint16_t) ((divisor == 0)?rem:(rem / divisor));\n\t\trem %= divisor;\n\t\tdivisor /= 100ULL;\n\t}\n\tstatic_sprintf(str, \"%04d.%02d.%02d %02d:%02d:%02d (UTC)\", data[0], data[1], data[2], data[3], data[4], data[5]);\n\treturn str;\n}\n\n// Convert custom error code to messages\nconst char* _StrError(DWORD error_code)\n{\n\tif ( (!IS_ERROR(error_code)) || (SCODE_CODE(error_code) == ERROR_SUCCESS)) {\n\t\treturn lmprintf(MSG_050);\n\t}\n\tif (SCODE_FACILITY(error_code) != FACILITY_STORAGE) {\n\t\tSetLastError(error_code);\n\t\treturn WindowsErrorString();\n\t}\n\tswitch (SCODE_CODE(error_code)) {\n\tcase ERROR_GEN_FAILURE:\n\t\treturn lmprintf(MSG_051);\n\tcase ERROR_INCOMPATIBLE_FS:\n\t\treturn lmprintf(MSG_052);\n\tcase ERROR_ACCESS_DENIED:\n\t\treturn lmprintf(MSG_053);\n\tcase ERROR_WRITE_PROTECT:\n\t\treturn lmprintf(MSG_054);\n\tcase ERROR_DEVICE_IN_USE:\n\t\treturn lmprintf(MSG_055);\n\tcase ERROR_CANT_QUICK_FORMAT:\n\t\treturn lmprintf(MSG_056);\n\tcase ERROR_LABEL_TOO_LONG:\n\t\treturn lmprintf(MSG_057);\n\tcase ERROR_INVALID_HANDLE:\n\t\treturn lmprintf(MSG_058);\n\tcase ERROR_INVALID_CLUSTER_SIZE:\n\t\treturn lmprintf(MSG_059);\n\tcase ERROR_INVALID_VOLUME_SIZE:\n\t\treturn lmprintf(MSG_060);\n\tcase ERROR_NO_MEDIA_IN_DRIVE:\n\t\treturn lmprintf(MSG_061);\n\tcase ERROR_NOT_SUPPORTED:\n\t\treturn lmprintf(MSG_062);\n\tcase ERROR_NOT_ENOUGH_MEMORY:\n\t\treturn lmprintf(MSG_063);\n\tcase ERROR_READ_FAULT:\n\t\treturn lmprintf(MSG_064);\n\tcase ERROR_WRITE_FAULT:\n\t\treturn lmprintf(MSG_065);\n\tcase ERROR_INSTALL_FAILURE:\n\t\treturn lmprintf(MSG_066);\n\tcase ERROR_OPEN_FAILED:\n\t\treturn lmprintf(MSG_067);\n\tcase ERROR_PARTITION_FAILURE:\n\t\treturn lmprintf(MSG_068);\n\tcase ERROR_CANNOT_COPY:\n\t\treturn lmprintf(MSG_069);\n\tcase ERROR_CANCELLED:\n\t\treturn lmprintf(MSG_070);\n\tcase ERROR_CANT_START_THREAD:\n\t\treturn lmprintf(MSG_071);\n\tcase ERROR_BADBLOCKS_FAILURE:\n\t\treturn lmprintf(MSG_072);\n\tcase ERROR_ISO_SCAN:\n\t\treturn lmprintf(MSG_073);\n\tcase ERROR_ISO_EXTRACT:\n\t\treturn lmprintf(MSG_074);\n\tcase ERROR_CANT_REMOUNT_VOLUME:\n\t\treturn lmprintf(MSG_075);\n\tcase ERROR_CANT_PATCH:\n\t\treturn lmprintf(MSG_076);\n\tcase ERROR_CANT_ASSIGN_LETTER:\n\t\treturn lmprintf(MSG_077);\n\tcase ERROR_CANT_MOUNT_VOLUME:\n\t\treturn lmprintf(MSG_078);\n\tcase ERROR_NOT_READY:\n\t\treturn lmprintf(MSG_079);\n\tcase ERROR_BAD_SIGNATURE:\n\t\treturn lmprintf(MSG_172);\n\tcase ERROR_CANT_DOWNLOAD:\n\t\treturn lmprintf(MSG_242);\n\tdefault:\n\t\tSetLastError(error_code);\n\t\treturn WindowsErrorString();\n\t}\n}\n\nconst char* StrError(DWORD error_code, BOOL use_default_locale)\n{\n\tconst char* ret;\n\tif (use_default_locale)\n\t\ttoggle_default_locale();\n\tret = _StrError(error_code);\n\tif (use_default_locale)\n\t\ttoggle_default_locale();\n\treturn ret;\n}\n\ntypedef struct\n{\n\tLPCWSTR lpFileName;\n\tDWORD dwDesiredAccess;\n\tDWORD dwShareMode;\n\tDWORD dwCreationDisposition;\n\tDWORD dwFlagsAndAttributes;\n\tHANDLE hFile;\n\tDWORD dwError;\n} cfx_params_t;\n\n// Thread used by CreateFileWithTimeout() below\nDWORD WINAPI CreateFileWithTimeoutThread(void* params)\n{\n\tcfx_params_t* cfx_params = (cfx_params_t*)params;\n\tHANDLE hFile = CreateFileW(cfx_params->lpFileName, cfx_params->dwDesiredAccess,\n\t\tcfx_params->dwShareMode, NULL, cfx_params->dwCreationDisposition,\n\t\tcfx_params->dwFlagsAndAttributes, NULL);\n\n\tcfx_params->dwError = (hFile == INVALID_HANDLE_VALUE) ? GetLastError() : NOERROR;\n\tcfx_params->hFile = hFile;\n\n\treturn cfx_params->dwError;\n}\n\n// A UTF-8 CreateFile() with timeout\nHANDLE CreateFileWithTimeout(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,\n\tLPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,\n\tDWORD dwFlagsAndAttributes, HANDLE hTemplateFile, DWORD dwTimeOut)\n{\n\tHANDLE hThread;\n\twconvert(lpFileName);\n\n\tcfx_params_t params = {\n\t\twlpFileName,\n\t\tdwDesiredAccess,\n\t\tdwShareMode,\n\t\tdwCreationDisposition,\n\t\tdwFlagsAndAttributes,\n\t\tINVALID_HANDLE_VALUE,\n\t\tERROR_IO_PENDING,\n\t};\n\n\thThread = CreateThread(NULL, 0, CreateFileWithTimeoutThread, &params, 0, NULL);\n\tif (hThread != NULL) {\n\t\tif (WaitForSingleObject(hThread, dwTimeOut) == WAIT_TIMEOUT) {\n\t\t\tCancelSynchronousIo(hThread);\n\t\t\tswitch (WaitForSingleObject(hThread, 30000)) {\n\t\t\tcase WAIT_TIMEOUT:\n\t\t\t\tuprintf(\"Could not open file or device within timeout duration\");\n\t\t\t\tbreak;\n\t\t\tcase WAIT_OBJECT_0:\n\t\t\t\tuprintf(\"Operation aborted by user\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tuprintf(\"Error while waiting for file or device to be opened: %s\", WindowsErrorString());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tparams.dwError = WAIT_TIMEOUT;\n\t\t}\n\t\tCloseHandle(hThread);\n\t} else {\n\t\tparams.dwError = GetLastError();\n\t}\n\n\twfree(lpFileName);\n\tSetLastError(params.dwError);\n\treturn params.hFile;\n}\n\n// A WriteFile() equivalent, with up to nNumRetries write attempts on error.\nBOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,\n\tLPDWORD lpNumberOfBytesWritten, DWORD nNumRetries)\n{\n\tDWORD nTry;\n\tBOOL readFilePointer;\n\tLARGE_INTEGER liFilePointer, liZero = { { 0,0 } };\n\tDWORD NumberOfBytesWritten;\n\n\tif (lpNumberOfBytesWritten == NULL)\n\t\tlpNumberOfBytesWritten = &NumberOfBytesWritten;\n\n\t// Need to get the current file pointer in case we need to retry\n\treadFilePointer = SetFilePointerEx(hFile, liZero, &liFilePointer, FILE_CURRENT);\n\tif (!readFilePointer)\n\t\tuprintf(\"WARNING: Could not read file pointer %s\", WindowsErrorString());\n\n\tif (nNumRetries == 0)\n\t\tnNumRetries = 1;\n\tfor (nTry = 1; nTry <= nNumRetries; nTry++) {\n\t\t// Need to rewind our file position on retry - if we can't even do that, just give up\n\t\tif ((nTry > 1) && (!SetFilePointerEx(hFile, liFilePointer, NULL, FILE_BEGIN))) {\n\t\t\tuprintf(\"Could not set file pointer - Aborting\");\n\t\t\tbreak;\n\t\t}\n\t\tif (WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, NULL)) {\n\t\t\tLastWriteError = 0;\n\t\t\tif (nNumberOfBytesToWrite == *lpNumberOfBytesWritten)\n\t\t\t\treturn TRUE;\n\t\t\t// Some large drives return 0, even though all the data was written - See github #787 */\n\t\t\tif (large_drive && (*lpNumberOfBytesWritten == 0)) {\n\t\t\t\tuprintf(\"WARNING: Possible short write\");\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\tuprintf(\"Wrote %d bytes but requested %d\", *lpNumberOfBytesWritten, nNumberOfBytesToWrite);\n\t\t} else {\n\t\t\tuprintf(\"Write error %s\", WindowsErrorString());\n\t\t\tLastWriteError = RUFUS_ERROR(GetLastError());\n\t\t\tif (LastWriteError == RUFUS_ERROR(ERROR_DISK_FULL))\n\t\t\t\tbreak;\n\t\t}\n\t\t// If we can't reposition for the next run, just abort\n\t\tif (!readFilePointer)\n\t\t\tbreak;\n\t\tif (nTry < nNumRetries) {\n\t\t\tuprintf(\"Retrying in %d seconds...\", WRITE_TIMEOUT / 1000);\n\t\t\tSleep(WRITE_TIMEOUT);\n\t\t}\n\t}\n\tif (SCODE_CODE(GetLastError()) == ERROR_SUCCESS)\n\t\tSetLastError(RUFUS_ERROR(ERROR_WRITE_FAULT));\n\treturn FALSE;\n}\n\n// A WaitForSingleObject() equivalent that doesn't block Windows messages\n// This is needed, for instance, if you are waiting for a thread that may issue uprintf's\nDWORD WaitForSingleObjectWithMessages(HANDLE hHandle, DWORD dwMilliseconds)\n{\n\tuint64_t CurTime, EndTime = GetTickCount64() + dwMilliseconds;\n\tDWORD res;\n\tMSG msg;\n\n\tdo {\n\t\t// Read all of the messages in this next loop, removing each message as we read it.\n\t\twhile (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {\n\t\t\tif ((msg.message == WM_QUIT) || (msg.message == WM_CLOSE)) {\n\t\t\t\tSetLastError(ERROR_CANCELLED);\n\t\t\t\treturn WAIT_FAILED;\n\t\t\t} else {\n\t\t\t\tDispatchMessage(&msg);\n\t\t\t}\n\t\t}\n\n\t\t// Wait for any message sent or posted to this queue or for the handle to signaled.\n\t\tres = MsgWaitForMultipleObjects(1, &hHandle, FALSE, dwMilliseconds, QS_ALLINPUT);\n\n\t\tif (dwMilliseconds != INFINITE) {\n\t\t\tCurTime = GetTickCount64();\n\t\t\t// Account for the case where we may reach the timeout condition while\n\t\t\t// processing timestamps\n\t\t\tif (CurTime < EndTime)\n\t\t\t\tdwMilliseconds = (DWORD) (EndTime - CurTime);\n\t\t\telse\n\t\t\t\tres = WAIT_TIMEOUT;\n\t\t}\n\t} while (res == (WAIT_OBJECT_0 + 1));\n\n\treturn res;\n}\n\n#define STATUS_SUCCESS\t\t\t\t\t((NTSTATUS)0x00000000L)\n#define STATUS_PROCEDURE_NOT_FOUND\t\t((NTSTATUS)0xC000007AL)\n#define FILE_ATTRIBUTE_VALID_FLAGS\t\t0x00007FB7\n#define NtCurrentPeb()\t\t\t\t\t(NtCurrentTeb()->ProcessEnvironmentBlock)\n#define RtlGetProcessHeap()\t\t\t\t(NtCurrentPeb()->Reserved4[1]) // NtCurrentPeb()->ProcessHeap, mangled due to deficiencies in winternl.h\n\nPF_TYPE_DECL(NTAPI, BOOLEAN, RtlDosPathNameToNtPathNameW, (PCWSTR, PUNICODE_STRING, PWSTR*, PVOID));\nPF_TYPE_DECL(NTAPI, VOID, RtlSetLastWin32ErrorAndNtStatusFromNtStatus, (NTSTATUS));\n\nHANDLE CreatePreallocatedFile(const char* lpFileName, DWORD dwDesiredAccess,\n\tDWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,\n\tDWORD dwFlagsAndAttributes, LONGLONG fileSize)\n{\n\tHANDLE fileHandle = INVALID_HANDLE_VALUE;\n\tOBJECT_ATTRIBUTES objectAttributes;\n\tIO_STATUS_BLOCK ioStatusBlock;\n\tUNICODE_STRING ntPath;\n\tULONG fileAttributes, flags = 0;\n\tLARGE_INTEGER allocationSize;\n\tNTSTATUS status = STATUS_SUCCESS;\n\n\tPF_INIT_OR_SET_STATUS(RtlDosPathNameToNtPathNameW, Ntdll);\n\tPF_INIT_OR_SET_STATUS(RtlSetLastWin32ErrorAndNtStatusFromNtStatus, Ntdll);\n\n\tif (!NT_SUCCESS(status)) {\n\t\treturn CreateFileU(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes,\n\t\t\tdwCreationDisposition, dwFlagsAndAttributes, NULL);\n\t}\n\n\twconvert(lpFileName);\n\n\t// Determine creation disposition and flags\n\tswitch (dwCreationDisposition) {\n\tcase CREATE_NEW:\n\t\tdwCreationDisposition = FILE_CREATE;\n\t\tbreak;\n\tcase CREATE_ALWAYS:\n\t\tdwCreationDisposition = FILE_OVERWRITE_IF;\n\t\tbreak;\n\tcase OPEN_EXISTING:\n\t\tdwCreationDisposition = FILE_OPEN;\n\t\tbreak;\n\tcase OPEN_ALWAYS:\n\t\tdwCreationDisposition = FILE_OPEN_IF;\n\t\tbreak;\n\tcase TRUNCATE_EXISTING:\n\t\tdwCreationDisposition = FILE_OVERWRITE;\n\t\tbreak;\n\tdefault:\n\t\tSetLastError(ERROR_INVALID_PARAMETER);\n\t\treturn INVALID_HANDLE_VALUE;\n\t}\n\n\tif ((dwFlagsAndAttributes & FILE_FLAG_OVERLAPPED) == 0)\n\t\tflags |= FILE_SYNCHRONOUS_IO_NONALERT;\n\n\tif ((dwFlagsAndAttributes & FILE_FLAG_WRITE_THROUGH) != 0)\n\t\tflags |= FILE_WRITE_THROUGH;\n\n\tif ((dwFlagsAndAttributes & FILE_FLAG_NO_BUFFERING) != 0)\n\t\tflags |= FILE_NO_INTERMEDIATE_BUFFERING;\n\n\tif ((dwFlagsAndAttributes & FILE_FLAG_RANDOM_ACCESS) != 0)\n\t\tflags |= FILE_RANDOM_ACCESS;\n\n\tif ((dwFlagsAndAttributes & FILE_FLAG_SEQUENTIAL_SCAN) != 0)\n\t\tflags |= FILE_SEQUENTIAL_ONLY;\n\n\tif ((dwFlagsAndAttributes & FILE_FLAG_DELETE_ON_CLOSE) != 0) {\n\t\tflags |= FILE_DELETE_ON_CLOSE;\n\t\tdwDesiredAccess |= DELETE;\n\t}\n\n\tif ((dwFlagsAndAttributes & FILE_FLAG_BACKUP_SEMANTICS) != 0) {\n\t\tif ((dwDesiredAccess & GENERIC_ALL) != 0)\n\t\t\tflags |= (FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_REMOTE_INSTANCE);\n\t\telse {\n\t\t\tif ((dwDesiredAccess & GENERIC_READ) != 0)\n\t\t\t\tflags |= FILE_OPEN_FOR_BACKUP_INTENT;\n\n\t\t\tif ((dwDesiredAccess & GENERIC_WRITE) != 0)\n\t\t\t\tflags |= FILE_OPEN_REMOTE_INSTANCE;\n\t\t}\n\t} else {\n\t\tflags |= FILE_NON_DIRECTORY_FILE;\n\t}\n\n\tif ((dwFlagsAndAttributes & FILE_FLAG_OPEN_REPARSE_POINT) != 0)\n\t\tflags |= FILE_OPEN_REPARSE_POINT;\n\n\tif ((dwFlagsAndAttributes & FILE_FLAG_OPEN_NO_RECALL) != 0)\n\t\tflags |= FILE_OPEN_NO_RECALL;\n\n\tfileAttributes = dwFlagsAndAttributes & (FILE_ATTRIBUTE_VALID_FLAGS & ~FILE_ATTRIBUTE_DIRECTORY);\n\n\tdwDesiredAccess |= (SYNCHRONIZE | FILE_READ_ATTRIBUTES);\n\n\t// Convert DOS path to NT format\n\tif (!pfRtlDosPathNameToNtPathNameW(wlpFileName, &ntPath, NULL, NULL)) {\n\t\twfree(lpFileName);\n\t\tSetLastError(ERROR_FILE_NOT_FOUND);\n\t\treturn INVALID_HANDLE_VALUE;\n\t}\n\n\tInitializeObjectAttributes(&objectAttributes, &ntPath, 0, NULL, NULL);\n\n\tif (lpSecurityAttributes != NULL) {\n\t\tif (lpSecurityAttributes->bInheritHandle)\n\t\t\tobjectAttributes.Attributes |= OBJ_INHERIT;\n\t\tobjectAttributes.SecurityDescriptor = lpSecurityAttributes->lpSecurityDescriptor;\n\t}\n\n\tif ((dwFlagsAndAttributes & FILE_FLAG_POSIX_SEMANTICS) == 0)\n\t\tobjectAttributes.Attributes |= OBJ_CASE_INSENSITIVE;\n\n\tallocationSize.QuadPart = fileSize;\n\n\t// Call NtCreateFile\n\tstatus = NtCreateFile(&fileHandle, dwDesiredAccess, &objectAttributes, &ioStatusBlock,\n\t\t&allocationSize, fileAttributes, dwShareMode, dwCreationDisposition, flags, NULL, 0);\n\n\tRtlFreeHeap(RtlGetProcessHeap(), 0, ntPath.Buffer);\n\twfree(lpFileName);\n\tpfRtlSetLastWin32ErrorAndNtStatusFromNtStatus(status);\n\n\treturn fileHandle;\n}\n\n// The following calls are used to resolve the addresses of DLL function calls\n// that are not publicly exposed by Microsoft. This is accomplished by downloading\n// the relevant .pdb and looking up the relevant address there. Once an address is\n// found, it is stored in the Rufus settings so that it can be reused.\n\nPF_TYPE_DECL(WINAPI, BOOL, SymInitialize, (HANDLE, PCSTR, BOOL));\nPF_TYPE_DECL(WINAPI, DWORD64, SymLoadModuleEx, (HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD, PMODLOAD_DATA, DWORD));\nPF_TYPE_DECL(WINAPI, BOOL, SymUnloadModule64, (HANDLE, DWORD64));\nPF_TYPE_DECL(WINAPI, BOOL, SymEnumSymbols, (HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID));\nPF_TYPE_DECL(WINAPI, BOOL, SymCleanup, (HANDLE));\n\nBOOL CALLBACK EnumSymProc(PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext)\n{\n\tdll_resolver_t* resolver = (dll_resolver_t*)UserContext;\n\tuint32_t i;\n\n\tfor (i = 0; i < resolver->count; i++) {\n\t\tif (safe_strcmp(pSymInfo->Name, resolver->name[i]) == 0) {\n\t\t\tresolver->address[i] = (uint32_t)pSymInfo->Address;\n#if defined(_DEBUG)\n\t\t\tuprintf(\"%08x: %s\", resolver->address[i], resolver->name[i]);\n#endif\n\t\t}\n\t}\n\n\treturn TRUE;\n}\n\nuint32_t ResolveDllAddress(dll_resolver_t* resolver)\n{\n\tuint32_t r = 0;\n\tuint32_t i;\n\tdebug_info_t* info = NULL;\n\tchar url[MAX_PATH], saved_id[MAX_PATH], path[MAX_PATH];\n\tuint8_t* buf = NULL;\n\tDWORD* dbuf;\n\tDWORD64 base_address = 0ULL;\n\n\tPF_INIT(SymInitialize, DbgHelp);\n\tPF_INIT(SymLoadModuleEx, DbgHelp);\n\tPF_INIT(SymUnloadModule64, DbgHelp);\n\tPF_INIT(SymEnumSymbols, DbgHelp);\n\tPF_INIT(SymCleanup, DbgHelp);\n\n\tif (pfSymInitialize == NULL || pfSymLoadModuleEx == NULL || pfSymUnloadModule64 == NULL ||\n\t\tpfSymEnumSymbols == NULL || pfSymCleanup == NULL || resolver->count == 0 ||\n\t\tresolver->path == NULL || resolver->name == NULL || resolver->address == NULL)\n\t\treturn 0;\n\n\t// Get the PDB unique address from the DLL. Note that we can *NOT* use SymGetModuleInfo64() to\n\t// obtain the data we need because Microsoft either *BOTCHED* or *DELIBERATELY CRIPPLED* their\n\t// SymLoadModuleEx()/SymLoadModule64() implementation on ARM64, so that the return value is always\n\t// 0 with GetLastError() set to ERROR_SUCCESS, thereby *FALSELY* indicating that the module is\n\t// already loaded... So we just load the whole DLL into a buffer and look for an \"RSDS\" section\n\t// per https://www.godevtool.com/Other/pdb.htm\n\tr = read_file(resolver->path, &buf);\n\tif (r == 0)\n\t\treturn 0;\n\n\tdbuf = (DWORD*)buf;\n\tfor (i = 0; i < (r - sizeof(debug_info_t)) / sizeof(DWORD); i++) {\n\t\tif (dbuf[i] == RSDS_SIG) {\n\t\t\tinfo = (debug_info_t*)&dbuf[i];\n\t\t\tif (safe_strstr(info->PdbName, \".pdb\") != NULL)\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif (info == NULL) {\n\t\tuprintf(\"Could not find debug info in '%s'\", resolver->path);\n\t\tgoto out;\n\t}\n\n\t// Check settings to see if we have existing data for these DLL calls.\n\tfor (i = 0; i < resolver->count; i++) {\n\t\tstatic_sprintf(saved_id, \"%s@%s%x:%s\", _filenameU(resolver->path),\n\t\t\tGuidToString(&info->Guid, FALSE), (int)info->Age, resolver->name[i]);\n\t\tresolver->address[i] = ReadSetting32(saved_id);\n\t\tif (resolver->address[i] == 0)\n\t\t\tbreak;\n\t}\n\n\tif (i == resolver->count) {\n\t\t// No need to download the PDB\n\t\tr = resolver->count;\n\t\tgoto out;\n\t}\n\n\t// Download the PDB from Microsoft's symbol servers\n\tif (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_115), lmprintf(MSG_345)) != IDYES)\n\t\tgoto out;\n\tstatic_sprintf(path, \"%s\\\\%s\", temp_dir, info->PdbName);\n\tstatic_sprintf(url, \"http://msdl.microsoft.com/download/symbols/%s/%s%x/%s\",\n\t\tinfo->PdbName, GuidToString(&info->Guid, FALSE), (int)info->Age, info->PdbName);\n\tif (DownloadToFileOrBufferEx(url, path, SYMBOL_SERVER_USER_AGENT, NULL, hMainDialog, FALSE) < 200 * KB)\n\t\tgoto out;\n\n\tif (!pfSymInitialize(hRufus, NULL, FALSE)) {\n\t\tuprintf(\"Could not initialize DLL symbol handler\");\n\t\tgoto out;\n\t}\n\n\t// NB: SymLoadModuleEx() does not load a PDB unless the file has an explicit '.pdb' extension\n\tbase_address = pfSymLoadModuleEx(hRufus, NULL, path, NULL, DEFAULT_BASE_ADDRESS, 0, NULL, 0);\n\tif_assert_fails(base_address == DEFAULT_BASE_ADDRESS)\n\t\tgoto out;\n\t// On Windows 11 ARM64 the following call will return *TWO* different addresses for the same\n\t// call, because most Windows DLL's are ARM64X, which means that they are an unholy union of\n\t// both X64 and ARM64 code in the same binary...\n\t// See https://learn.microsoft.com/en-us/windows/arm/arm64x-pe\n\t// Now this would be all swell and dandy if Microsoft's debugging/symbol APIs had followed\n\t// and would give us a hint of the architecture behind each duplicate address, but of course,\n\t// the SYMBOL_INFO passed to EnumSymProc contains no such data. So we currently don't have a\n\t// way to tell which of the two addresses we get on ARM64 is for which architecture... :(\n\tpfSymEnumSymbols(hRufus, base_address, \"*!*\", EnumSymProc, resolver);\n\tDeleteFileU(path);\n\n\t// Store the addresses\n\tr = 0;\n\tfor (i = 0; i < resolver->count; i++) {\n\t\tstatic_sprintf(saved_id, \"%s@%s%x:%s\", _filenameU(resolver->path),\n\t\t\tGuidToString(&info->Guid, FALSE), (int)info->Age, resolver->name[i]);\n\t\tif (resolver->address[i] != 0) {\n\t\t\tWriteSetting32(saved_id, resolver->address[i]);\n\t\t\tr++;\n\t\t}\n\t}\n\nout:\n\tfree(buf);\n\tif (base_address != 0)\n\t\tpfSymUnloadModule64(hRufus, base_address);\n\tpfSymCleanup(hRufus);\n\treturn r;\n}\n\nstatic void print_extracted_file(const char* file_path, uint64_t file_length)\n{\n\tchar str[MAX_PATH];\n\n\tif (file_path == NULL)\n\t\treturn;\n\tstatic_sprintf(str, \"%s (%s)\", file_path, SizeToHumanReadable(file_length, TRUE, FALSE));\n\tuprintf(\"Extracting: %s\", str);\n\tPrintStatus(0, MSG_000, str);\t// MSG_000 is \"%s\"\n}\n\nstatic void update_progress(const uint64_t processed_bytes)\n{\n\tUpdateProgressWithInfo(OP_EXTRACT_ZIP, MSG_348, processed_bytes, archive_size);\n}\n\n// Extract content from a zip archive onto the designated directory or drive\nBOOL ExtractZip(const char* src_zip, const char* dest_dir)\n{\n\tint64_t extracted_bytes = 0;\n\n\tif (src_zip == NULL)\n\t\treturn FALSE;\n\tarchive_size = _filesizeU(src_zip);\n\tif (bled_init(256 * KB, NULL, NULL, NULL, update_progress, print_extracted_file, &ErrorStatus) != 0)\n\t\treturn FALSE;\n\tuprintf(\"● Copying files from '%s'\", src_zip);\n\textracted_bytes = bled_uncompress_to_dir(src_zip, dest_dir, BLED_COMPRESSION_ZIP);\n\tbled_exit();\n\treturn (extracted_bytes > 0);\n}\n\n// Returns a list of all the files or folders from a directory\nDWORD ListDirectoryContent(StrArray* arr, char* dir, uint8_t type)\n{\n\tWIN32_FIND_DATAA FindFileData = { 0 };\n\tHANDLE hFind;\n\tDWORD dwError, dwResult;\n\tchar mask[MAX_PATH + 1], path[MAX_PATH + 1];\n\n\tif (arr == NULL || dir == NULL || (type & 0x03) == 0)\n\t\treturn ERROR_INVALID_PARAMETER;\n\n\tif (PathCombineU(mask, dir, \"*\") == NULL)\n\t\treturn GetLastError();\n\n\thFind = FindFirstFileU(mask, &FindFileData);\n\tif (hFind == INVALID_HANDLE_VALUE)\n\t\treturn GetLastError();\n\n\tdwResult = ERROR_FILE_NOT_FOUND;\n\tdo {\n\t\tif (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {\n\t\t\tif (strcmp(FindFileData.cFileName, \".\") == 0 ||\n\t\t\t\tstrcmp(FindFileData.cFileName, \"..\") == 0 ||\n\t\t\t\t(type & LIST_DIR_TYPE_RECURSIVE) == 0)\n\t\t\t\tcontinue;\n\t\t\tif (PathCombineU(path, dir, FindFileData.cFileName) == NULL)\n\t\t\t\tbreak;\n\t\t\t// Append a trailing backslash to directories\n\t\t\tif (path[strlen(path) - 1] != '\\\\') {\n\t\t\t\tpath[strlen(path) + 1] = '\\0';\n\t\t\t\tpath[strlen(path)] = '\\\\';\n\t\t\t}\n\t\t\tif (type & LIST_DIR_TYPE_DIRECTORY)\n\t\t\t\tStrArrayAdd(arr, path, TRUE);\n\t\t\tdwError = ListDirectoryContent(arr, path, type);\n\t\t\tif (dwError != NO_ERROR && dwError != ERROR_FILE_NOT_FOUND) {\n\t\t\t\tSetLastError(dwError);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif (type & LIST_DIR_TYPE_FILE) {\n\t\t\t\tif (PathCombineU(path, dir, FindFileData.cFileName) == NULL)\n\t\t\t\t\tbreak;\n\t\t\t\tStrArrayAdd(arr, path, TRUE);\n\t\t\t}\n\t\t\tdwResult = NO_ERROR;\n\t\t}\n\t} while (FindNextFileU(hFind, &FindFileData));\n\n\tdwError = GetLastError();\n\tFindClose(hFind);\n\n\tif (dwError != ERROR_NO_MORE_FILES)\n\t\treturn dwError;\n\treturn dwResult;\n}\n"
  },
  {
    "path": "src/stdlg.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Standard Dialog Routines (Browse for folder, About, etc)\n * Copyright © 2011-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <windowsx.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <shlobj.h>\n#include <commdlg.h>\n#include <richedit.h>\n#include <assert.h>\n\n#include \"rufus.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n#include \"ui.h\"\n\n#include \"registry.h\"\n#include \"settings.h\"\n#include \"license.h\"\n#include \"darkmode.h\"\n\n/* Globals */\nextern BOOL is_x86_64, appstore_version;\nextern char unattend_username[MAX_USERNAME_LENGTH], *sbat_level_txt, *sb_active_txt, *sb_revoked_txt;\nextern int unattend_edition_index;\nextern HICON hSmallIcon, hBigIcon;\nextern HWND hFidoDlg;\n\nstatic struct {\n\tchar* szMessageText;\n\tchar* szMessageTitle;\n\tchar **szDialogItem;\n\tint nDialogItems;\n} list_data = { 0 };\nstatic struct {\n\tchar* szMessageText;\n\tchar* szMessageTitle;\n\tselection_dialog_options_t* options;\n} selection_data = { 0 };\nstatic struct {\n\tHICON hMessageIcon;\n\tchar* szMessageText;\n\tchar* szMessageTitle;\n\tint type;\n\tconst notification_info* more_info;\n\tconst char* dont_display_setting;\n} notification_data = { 0 };\nstatic struct {\n\tchar title_str[2][128];\n\tchar button_str[128];\n\tHWINEVENTHOOK weh;\n} alert_data = { 0 };\nstatic int update_settings_reposition_ids[] = {\n\tIDI_ICON,\n\tIDC_POLICY,\n\tIDS_UPDATE_SETTINGS_GRP,\n\tIDS_UPDATE_FREQUENCY_TXT,\n\tIDC_UPDATE_FREQUENCY,\n\tIDS_INCLUDE_BETAS_TXT,\n\tIDC_INCLUDE_BETAS,\n\tIDS_CHECK_NOW_GRP,\n\tIDC_CHECK_NOW,\n\tIDCANCEL,\n};\nstatic const SETTEXTEX friggin_microsoft_unicode_amateurs = { ST_DEFAULT, CP_UTF8 };\nstatic WNDPROC update_original_proc = NULL;\n\n/*\n * https://blogs.msdn.microsoft.com/oldnewthing/20040802-00/?p=38283/\n */\nvoid SetDialogFocus(HWND hDlg, HWND hCtrl)\n{\n\tSendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)hCtrl, TRUE);\n}\n\n/*\n * Return the UTF8 path of a file selected through a load or save dialog\n * All string parameters are UTF-8\n * IMPORTANT NOTE: Remember that you need to call CoInitializeEx() for\n * *EACH* thread you invoke FileDialog from, as GetDisplayName() will\n * return error 0x8001010E otherwise.\n */\nchar* FileDialog(BOOL save, char* path, const ext_t* ext, UINT* selected_ext)\n{\n\tsize_t i;\n\tchar* filepath = NULL;\n\tHRESULT hr = FALSE;\n\tIFileDialog *pfd = NULL;\n\tIShellItem *psiResult;\n\tCOMDLG_FILTERSPEC* filter_spec = NULL;\n\twchar_t *wpath = NULL, *wfilename = NULL, *wext = NULL;\n\tIShellItem *si_path = NULL;\t// Automatically freed\n\n\tif ((ext == NULL) || (ext->count == 0) || (ext->extension == NULL) || (ext->description == NULL))\n\t\treturn NULL;\n\n\tfilter_spec = (COMDLG_FILTERSPEC*)calloc(ext->count + 1, sizeof(COMDLG_FILTERSPEC));\n\tif (filter_spec == NULL)\n\t\treturn NULL;\n\n\tdialog_showing++;\n\n\t// Setup the file extension filter table\n\tfor (i = 0; i < ext->count; i++) {\n\t\tfilter_spec[i].pszSpec = utf8_to_wchar(ext->extension[i]);\n\t\tfilter_spec[i].pszName = utf8_to_wchar(ext->description[i]);\n\t}\n\tfilter_spec[i].pszSpec = L\"*.*\";\n\tfilter_spec[i].pszName = utf8_to_wchar(lmprintf(MSG_107));\n\n\thr = CoCreateInstance(save ? &CLSID_FileSaveDialog : &CLSID_FileOpenDialog, NULL, CLSCTX_INPROC,\n\t\t&IID_IFileDialog, (LPVOID)&pfd);\n\tif (SUCCEEDED(hr) && (pfd == NULL))\t// Never trust Microsoft APIs to do the right thing\n\t\thr = RUFUS_ERROR(ERROR_API_UNAVAILABLE);\n\n\tif (FAILED(hr)) {\n\t\tSetLastError(hr);\n\t\tuprintf(\"CoCreateInstance for FileOpenDialog failed: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t// Set the file extension filters\n\tIFileDialog_SetFileTypes(pfd, (UINT)ext->count + 1, filter_spec);\n\n\tif (path == NULL) {\n\t\t// Try to use the \"Downloads\" folder as the initial default directory\n\t\tconst GUID download_dir_guid =\n\t\t\t{ 0x374de290, 0x123f, 0x4565, { 0x91, 0x64, 0x39, 0xc4, 0x92, 0x5e, 0x46, 0x7b } };\n\t\thr = SHGetKnownFolderPath(&download_dir_guid, 0, 0, &wpath);\n\t\tif (SUCCEEDED(hr)) {\n\t\t\thr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);\n\t\t\tif (SUCCEEDED(hr)) {\n\t\t\t\tIFileDialog_SetDefaultFolder(pfd, si_path);\n\t\t\t}\n\t\t\tCoTaskMemFree(wpath);\n\t\t}\n\t} else {\n\t\twpath = utf8_to_wchar(path);\n\t\thr = SHCreateItemFromParsingName(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);\n\t\tif (SUCCEEDED(hr)) {\n\t\t\tIFileDialog_SetFolder(pfd, si_path);\n\t\t}\n\t\tsafe_free(wpath);\n\t}\n\n\t// Set the default filename\n\twfilename = utf8_to_wchar((ext->filename == NULL) ? \"\" : ext->filename);\n\tif (wfilename != NULL)\n\t\tIFileDialog_SetFileName(pfd, wfilename);\n\t// Set a default extension so that when the user switches filters it gets\n\t// automatically updated. Note that the IFileDialog::SetDefaultExtension()\n\t// doc says the extension shouldn't be prefixed with unwanted characters\n\t// but it appears to work regardless so we don't bother cleaning it.\n\twext = utf8_to_wchar((ext->extension == NULL) ? \"\" : ext->extension[0]);\n\tif (wext != NULL)\n\t\tIFileDialog_SetDefaultExtension(pfd, wext);\n\t// Set the current selected extension\n\tIFileDialog_SetFileTypeIndex(pfd, selected_ext == NULL ? 0 : *selected_ext);\n\n\t// Display the dialog and (optionally) get the selected extension index\n\thr = IFileDialog_Show(pfd, hMainDialog);\n\tif (selected_ext != NULL)\n\t\tIFileDialog_GetFileTypeIndex(pfd, selected_ext);\n\n\t// Cleanup\n\tsafe_free(wext);\n\tsafe_free(wfilename);\n\tfor (i = 0; i < ext->count; i++) {\n\t\tsafe_free(filter_spec[i].pszSpec);\n\t\tsafe_free(filter_spec[i].pszName);\n\t}\n\tsafe_free(filter_spec[i].pszName);\n\tsafe_free(filter_spec);\n\n\tif (SUCCEEDED(hr)) {\n\t\t// Obtain the result of the user's interaction with the dialog.\n\t\thr = IFileDialog_GetResult(pfd, &psiResult);\n\t\tif (SUCCEEDED(hr)) {\n\t\t\thr = IShellItem_GetDisplayName(psiResult, SIGDN_FILESYSPATH, &wpath);\n\t\t\tif (SUCCEEDED(hr)) {\n\t\t\t\tfilepath = wchar_to_utf8(wpath);\n\t\t\t\tCoTaskMemFree(wpath);\n\t\t\t} else {\n\t\t\t\tSetLastError(hr);\n\t\t\t\tuprintf(\"Unable to access file path: %s\", WindowsErrorString());\n\t\t\t}\n\t\t\tIShellItem_Release(psiResult);\n\t\t}\n\t} else if (HRESULT_CODE(hr) != ERROR_CANCELLED) {\n\t\t// If it's not a user cancel, assume the dialog didn't show and fallback\n\t\tSetLastError(hr);\n\t\tuprintf(\"Could not show FileOpenDialog: %s\", WindowsErrorString());\n\t}\n\nout:\n\tsafe_free(filter_spec);\n\tif (pfd != NULL)\n\t\tIFileDialog_Release(pfd);\n\tdialog_showing--;\n\treturn filepath;\n}\n\n/*\n * Create the application status bar\n */\nvoid CreateStatusBar(HFONT* hFont)\n{\n\tRECT rect;\n\tint edge[2];\n\n\t// Create the status bar\n\thStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | SBARS_TOOLTIPS,\n\t\tCW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hMainDialog,\n\t\t(HMENU)IDC_STATUS, hMainInstance, NULL);\n\n\t// Create 2 status areas\n\tGetClientRect(hMainDialog, &rect);\n\tedge[0] = rect.right - (int)(SB_TIMER_SECTION_SIZE * fScale);\n\tedge[1] = rect.right;\n\tSendMessage(hStatus, SB_SETPARTS, (WPARAM)ARRAYSIZE(edge), (LPARAM)&edge);\n\n\t// Set the font\n\tif (*hFont == NULL) {\n\t\tHDC hDC = GetDC(hMainDialog);\n\t\t*hFont = CreateFontA(-MulDiv(9, GetDeviceCaps(hDC, LOGPIXELSY), 72),\n\t\t\t0, 0, 0, FW_MEDIUM, FALSE, FALSE, FALSE, DEFAULT_CHARSET,\n\t\t\t0, 0, PROOF_QUALITY, 0, \"Segoe UI\");\n\t\tsafe_release_dc(hMainDialog, hDC);\n\t}\n\tSendMessage(hStatus, WM_SETFONT, (WPARAM)*hFont, TRUE);\n}\n\n/*\n * Center a dialog with regards to the main application Window or the desktop\n * See https://docs.microsoft.com/en-gb/windows/desktop/dlgbox/using-dialog-boxes#initializing-a-dialog-box\n */\nvoid CenterDialog(HWND hDlg, HWND hParent)\n{\n\tRECT rc, rcDlg, rcParent;\n\n\tif (hParent == NULL)\n\t\thParent = GetParent(hDlg);\n\tif (hParent == NULL)\n\t\thParent = GetDesktopWindow();\n\n\tGetWindowRect(hParent, &rcParent);\n\tGetWindowRect(hDlg, &rcDlg);\n\tCopyRect(&rc, &rcParent);\n\n\t// Offset the parent and dialog box rectangles so that right and bottom\n\t// values represent the width and height, and then offset the parent again\n\t// to discard space taken up by the dialog box.\n\tOffsetRect(&rcDlg, -rcDlg.left, -rcDlg.top);\n\tOffsetRect(&rc, -rc.left, -rc.top);\n\tOffsetRect(&rc, -rcDlg.right, -rcDlg.bottom);\n\n\tSetWindowPos(hDlg, HWND_TOP, rcParent.left + (rc.right / 2), rcParent.top + (rc.bottom / 2) - 25, 0, 0, SWP_NOSIZE);\n}\n\n// http://stackoverflow.com/questions/431470/window-border-width-and-height-in-win32-how-do-i-get-it\nSIZE GetBorderSize(HWND hDlg)\n{\n\tRECT rect = {0, 0, 0, 0};\n\tSIZE size = {0, 0};\n\tWINDOWINFO wi;\n\twi.cbSize = sizeof(WINDOWINFO);\n\n\tGetWindowInfo(hDlg, &wi);\n\n\tAdjustWindowRectEx(&rect, wi.dwStyle, FALSE, wi.dwExStyle);\n\tsize.cx = rect.right - rect.left;\n\tsize.cy = rect.bottom - rect.top;\n\treturn size;\n}\n\nvoid ResizeMoveCtrl(HWND hDlg, HWND hCtrl, int dx, int dy, int dw, int dh, float scale)\n{\n\tRECT rect;\n\tPOINT point;\n\tSIZE border;\n\n\tGetWindowRect(hCtrl, &rect);\n\tpoint.x = (right_to_left_mode && (hDlg != hCtrl))?rect.right:rect.left;\n\tpoint.y = rect.top;\n\tif (hDlg != hCtrl)\n\t\tScreenToClient(hDlg, &point);\n\tGetClientRect(hCtrl, &rect);\n\n\t// If the control has any borders (dialog, edit box), take them into account\n\tborder = GetBorderSize(hCtrl);\n\tMoveWindow(hCtrl, point.x + (int)(scale*(float)dx), point.y + (int)(scale*(float)dy),\n\t\t(rect.right - rect.left) + (int)(scale*(float)dw + border.cx),\n\t\t(rect.bottom - rect.top) + (int)(scale*(float)dh + border.cy), TRUE);\n\t// Don't be tempted to call InvalidateRect() here - it causes intempestive whole screen refreshes\n}\n\nvoid ResizeButtonHeight(HWND hDlg, int id)\n{\n\tHWND hCtrl, hPrevCtrl;\n\tRECT rc;\n\tint dy = 0;\n\n\thCtrl = GetDlgItem(hDlg, id);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tif (rc.bottom - rc.top < bh)\n\t\tdy = (bh - (rc.bottom - rc.top)) / 2;\n\thPrevCtrl = GetNextWindow(hCtrl, GW_HWNDPREV);\n\tSetWindowPos(hCtrl, hPrevCtrl, rc.left, rc.top - dy, rc.right - rc.left, bh, 0);\n}\n\n/*\n * License callback\n */\nINT_PTR CALLBACK LicenseCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tLONG_PTR style;\n\tHWND hLicense;\n\tswitch (message) {\n\tcase WM_INITDIALOG:\n\t\tSetDarkModeForDlg(hDlg);\n\t\thLicense = GetDlgItem(hDlg, IDC_LICENSE_TEXT);\n\t\tapply_localization(IDD_LICENSE, hDlg);\n\t\tCenterDialog(hDlg, NULL);\n\t\tResizeButtonHeight(hDlg, IDCANCEL);\n\t\t// Suppress any inherited RTL flags\n\t\tstyle = GetWindowLongPtr(hLicense, GWL_EXSTYLE);\n\t\tstyle &= ~(WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR);\n\t\tSetWindowLongPtr(hLicense, GWL_EXSTYLE, style);\n\t\tstyle = GetWindowLongPtr(hLicense, GWL_STYLE);\n\t\tstyle &= ~(ES_RIGHT);\n\t\tSetWindowLongPtr(hLicense, GWL_STYLE, style);\n\t\tSetDlgItemTextA(hDlg, IDC_LICENSE_TEXT, gplv3);\n\t\tSetDarkModeForChild(hDlg);\n\t\tbreak;\n\tcase WM_COMMAND:\n\t\tswitch (LOWORD(wParam)) {\n\t\tcase IDOK:\n\t\tcase IDCANCEL:\n\t\t\treset_localization(IDD_LICENSE);\n\t\t\tEndDialog(hDlg, LOWORD(wParam));\n\t\t\treturn (INT_PTR)TRUE;\n\t\t}\n\t}\n\treturn (INT_PTR)FALSE;\n}\n\n/*\n * About dialog callback\n */\nINT_PTR CALLBACK AboutCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tint i, dy;\n\tconst int edit_id[2] = { IDC_ABOUT_BLURB, IDC_ABOUT_COPYRIGHTS };\n\tchar about_blurb[2048];\n\tconst char* edit_text[2] = { about_blurb, additional_copyrights };\n\tHWND hEdit[2], hCtrl;\n\tTEXTRANGEW tr;\n\tENLINK* enl;\n\tRECT rc;\n\tREQRESIZE* rsz;\n\twchar_t wUrl[256];\n\tstatic BOOL resized_already = TRUE;\n\n\tswitch (message) {\n\tcase WM_INITDIALOG:\n\t\tSetDarkModeForDlg(hDlg);\n\t\tresized_already = FALSE;\n\t\t// Execute dialog localization\n\t\tapply_localization(IDD_ABOUTBOX, hDlg);\n\t\tSetTitleBarIcon(hDlg);\n\t\tCenterDialog(hDlg, NULL);\n\t\t// Resize the 'License' button\n\t\thCtrl = GetDlgItem(hDlg, IDC_ABOUT_LICENSE);\n\t\tGetWindowRect(hCtrl, &rc);\n\t\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\t\tdy = 0;\n\t\tif (rc.bottom - rc.top < bh)\n\t\t\tdy = (bh - (rc.bottom - rc.top)) / 2;\n\t\tSetWindowPos(hCtrl, NULL, rc.left, rc.top - dy,\n\t\t\tmax(rc.right - rc.left, GetTextSize(hCtrl, NULL).cx + cbw), bh, SWP_NOZORDER);\n\t\tResizeButtonHeight(hDlg, IDOK);\n\t\tstatic_sprintf(about_blurb, about_blurb_format, lmprintf(MSG_174|MSG_RTF),\n\t\t\tlmprintf(MSG_175|MSG_RTF, rufus_version[0], rufus_version[1], rufus_version[2]),\n\t\t\t\"Copyright © 2011-2026 Pete Batard\",\n\t\t\tlmprintf(MSG_176|MSG_RTF), lmprintf(MSG_177|MSG_RTF), lmprintf(MSG_178|MSG_RTF));\n\t\tfor (i = 0; i < ARRAYSIZE(hEdit); i++) {\n\t\t\thEdit[i] = GetDlgItem(hDlg, edit_id[i]);\n\t\t\tSendMessage(hEdit[i], EM_AUTOURLDETECT, 1, 0);\n\t\t\t/* Can't use SetDlgItemText, because it only works with RichEdit20A... and VS insists\n\t\t\t * on reverting to RichEdit20W as soon as you edit the dialog. You can try all the W\n\t\t\t * methods you want, it JUST WON'T WORK unless you use EM_SETTEXTEX. Also see:\n\t\t\t * http://blog.kowalczyk.info/article/eny/Setting-unicode-rtf-text-in-rich-edit-control.html */\n\t\t\tSendMessageA(hEdit[i], EM_SETTEXTEX, (WPARAM)&friggin_microsoft_unicode_amateurs, (LPARAM)edit_text[i]);\n\t\t\tSendMessage(hEdit[i], EM_SETSEL, -1, -1);\n\t\t\tSendMessage(hEdit[i], EM_SETEVENTMASK, 0, ENM_LINK | ((i == 0) ? ENM_REQUESTRESIZE : 0));\n\t\t\tSendMessage(hEdit[i], EM_SETBKGNDCOLOR, 0, (LPARAM)GetSysColor(COLOR_BTNFACE));\n\t\t}\n\t\t// Need to send an explicit SetSel to avoid being positioned at the end of richedit control when tabstop is used\n\t\tSendMessage(hEdit[1], EM_SETSEL, 0, 0);\n\t\tSendMessage(hEdit[0], EM_REQUESTRESIZE, 0, 0);\n\t\tSetDarkModeForChild(hDlg);\n\t\tbreak;\n\tcase WM_NOTIFY:\n\t\tswitch (((LPNMHDR)lParam)->code) {\n\t\tcase EN_REQUESTRESIZE:\n\t\t\tif (!resized_already) {\n\t\t\t\tresized_already = TRUE;\n\t\t\t\tGetWindowRect(GetDlgItem(hDlg, edit_id[0]), &rc);\n\t\t\t\tdy = rc.bottom - rc.top;\n\t\t\t\trsz = (REQRESIZE *)lParam;\n\t\t\t\tdy -= rsz->rc.bottom - rsz->rc.top;\n\t\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, edit_id[0]), 0, 0, 0, -dy, 1.0f);\n\t\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, edit_id[1]), 0, -dy, 0, dy, 1.0f);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase EN_LINK:\n\t\t\tenl = (ENLINK*) lParam;\n\t\t\tif (enl->msg == WM_LBUTTONUP) {\n\t\t\t\ttr.lpstrText = wUrl;\n\t\t\t\ttr.chrg.cpMin = enl->chrg.cpMin;\n\t\t\t\ttr.chrg.cpMax = enl->chrg.cpMax;\n\t\t\t\tSendMessageW(enl->nmhdr.hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr);\n\t\t\t\twUrl[ARRAYSIZE(wUrl)-1] = 0;\n\t\t\t\tShellExecuteW(hDlg, L\"open\", wUrl, NULL, NULL, SW_SHOWNORMAL);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\tcase WM_COMMAND:\n\t\tswitch (LOWORD(wParam)) {\n\t\tcase IDOK:\n\t\tcase IDCANCEL:\n\t\t\treset_localization(IDD_ABOUTBOX);\n\t\t\tEndDialog(hDlg, LOWORD(wParam));\n\t\t\treturn (INT_PTR)TRUE;\n\t\tcase IDC_ABOUT_LICENSE:\n\t\t\tMyDialogBox(hMainInstance, IDD_LICENSE, hDlg, LicenseCallback);\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\t}\n\treturn (INT_PTR)FALSE;\n}\n\nINT_PTR CreateAboutBox(void)\n{\n\tINT_PTR r;\n\tdialog_showing++;\n\tr = MyDialogBox(hMainInstance, IDD_ABOUTBOX, hMainDialog, AboutCallback);\n\tdialog_showing--;\n\treturn r;\n}\n\n// The warning icon from the OS is *BROKEN* in dark mode at 200% scaling (one of the\n// pixels that should be transparent is set to white), so we fix it. Thanks Microsoft!\nHICON FixWarningIcon(HICON hIcon)\n{\n\tvoid* bits = NULL;\n\tICONINFO info, new_info;\n\tBITMAP bmp;\n\tBITMAPINFO bmi = { 0 };\n\tHBITMAP dib, src_obj, dst_obj;\n\tHDC hdc, src_dc, dst_dc;\n\tDWORD* pixels;\n\n\tGetIconInfo(hIcon, &info);\n\tGetObject(info.hbmColor, sizeof(bmp), &bmp);\n\tbmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);\n\tbmi.bmiHeader.biWidth = bmp.bmWidth;\n\tbmi.bmiHeader.biHeight = -bmp.bmHeight;\n\tbmi.bmiHeader.biPlanes = 1;\n\tbmi.bmiHeader.biBitCount = 32;\n\tbmi.bmiHeader.biCompression = BI_RGB;\n\n\thdc = GetDC(NULL);\n\tdib = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0);\n\tReleaseDC(NULL, hdc);\n\tif (dib == NULL)\n\t\treturn hIcon;\n\tsrc_dc = CreateCompatibleDC(NULL);\n\tdst_dc = CreateCompatibleDC(NULL);\n\tsrc_obj = SelectObject(src_dc, info.hbmColor);\n\tdst_obj = SelectObject(dst_dc, dib);\n\n\tBitBlt(dst_dc, 0, 0, bmp.bmWidth, bmp.bmHeight, src_dc, 0, 0, SRCCOPY);\n\n\tSelectObject(src_dc, src_obj);\n\tSelectObject(dst_dc, dst_obj);\n\tDeleteDC(src_dc);\n\tDeleteDC(dst_dc);\n\tpixels = (DWORD*)bits;\n\t// Set the problematic pixel, at (13,2), to transparent\n\tpixels[2 * bmp.bmWidth + 13] = 0x00000000;\n\n\tnew_info.fIcon = TRUE;\n\tnew_info.xHotspot = info.xHotspot;\n\tnew_info.yHotspot = info.yHotspot;\n\tnew_info.hbmMask = info.hbmMask;\n\tnew_info.hbmColor = dib;\n\n\thIcon = CreateIconIndirect(&new_info);\n\tDeleteObject(info.hbmColor);\n\tDeleteObject(info.hbmMask);\n\treturn hIcon;\n}\n\n/*\n * We use our own MessageBox for notifications to have greater control (center, no close button, etc)\n */\nINT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tLRESULT loc;\n\tint i, dh, cbh = 0;\n\t// Prevent resizing\n\tstatic LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE,\n\t\tHTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT };\n\tstatic HBRUSH background_brush, separator_brush, buttonface_brush;\n\t// To use the system message font\n\tNONCLIENTMETRICS ncm;\n\tstatic HFONT hDlgFont = NULL;\n\tHWND hCtrl;\n\tRECT rc;\n\tHDC hDC;\n\n\tswitch (message) {\n\tcase WM_INITDIALOG:\n\t\tSetDarkModeForDlg(hDlg);\n\t\t// Get the system message box font. See http://stackoverflow.com/a/6057761\n\t\tncm.cbSize = sizeof(ncm);\n\t\t// If we're compiling with the Vista SDK or later, the NONCLIENTMETRICS struct\n\t\t// will be the wrong size for previous versions, so we need to adjust it.\n#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (_WIN32_WINNT >= _WIN32_WINNT_VISTA)\n\t\tncm.cbSize -= sizeof(ncm.iPaddedBorderWidth);\n#endif\n\t\tif (hDlgFont == NULL) {\n\t\t\tSystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0);\n\t\t\thDlgFont = CreateFontIndirect(&(ncm.lfMessageFont));\n\t\t}\n\t\t// Set the dialog to use the system message box font\n\t\tSendMessage(hDlg, WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tSendMessage(GetDlgItem(hDlg, IDC_NOTIFICATION_TEXT), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tSendMessage(GetDlgItem(hDlg, IDC_MORE_INFO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tSendMessage(GetDlgItem(hDlg, IDYES), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tSendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tif (bh != 0) {\n\t\t\tResizeButtonHeight(hDlg, IDC_MORE_INFO);\n\t\t\tResizeButtonHeight(hDlg, IDABORT);\n\t\t\tResizeButtonHeight(hDlg, IDYES);\n\t\t\tResizeButtonHeight(hDlg, IDNO);\n\t\t}\n\n\t\tapply_localization(IDD_NOTIFICATION, hDlg);\n\t\tbackground_brush = GetSysColorBrush(COLOR_WINDOW);\n\t\tseparator_brush = GetSysColorBrush(COLOR_3DLIGHT);\n\t\tbuttonface_brush = GetSysColorBrush(COLOR_BTNFACE);\n\t\tCenterDialog(hDlg, NULL);\n\t\t// Change the default message icon\n\t\tswitch (notification_data.type & 0xF0) {\n\t\tcase MB_ICONERROR:\n\t\t\tnotification_data.hMessageIcon = LoadIcon(NULL, IDI_ERROR);\n\t\t\tbreak;\n\t\tcase MB_ICONWARNING:\n\t\t\tnotification_data.hMessageIcon = LoadIcon(NULL, IDI_WARNING);\n\t\t\t// I really have no idea at what scaling factors Microsoft switches icons.\n\t\t\t// However, the 200% icon has a jarring white pixel in dark mode, because\n\t\t\t// Microsoft forgot to set that pixel to transparent, that we need to fix.\n\t\t\tif (fScale > 1.75f && fScale < 2.5f)\n\t\t\t\tnotification_data.hMessageIcon = FixWarningIcon(notification_data.hMessageIcon);\n\t\t\tbreak;\n\t\tcase MB_ICONQUESTION:\n\t\t\tnotification_data.hMessageIcon = LoadIcon(NULL, IDI_QUESTION);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tnotification_data.hMessageIcon = LoadIcon(NULL, IDI_INFORMATION);\n\t\t\tbreak;\n\t\t}\n\t\tif (Static_SetIcon(GetDlgItem(hDlg, IDC_NOTIFICATION_ICON), notification_data.hMessageIcon) == 0)\n\t\t\tuprintf(\"Could not set the notification dialog icon\");\n\t\t// Set the dialog title\n\t\tif (notification_data.szMessageTitle != NULL)\n\t\t\tSetWindowTextU(hDlg, notification_data.szMessageTitle);\n\t\t// Enable/disable the buttons and set text\n\t\tswitch (notification_data.type & 0x0F) {\n\t\tcase MB_OKCANCEL:\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDYES), \"OK\");\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_007));\n\t\t\tShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW);\n\t\t\tbreak;\n\t\tcase MB_YESNO:\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDYES), lmprintf(MSG_008));\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_009));\n\t\t\tShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW);\n\t\t\tbreak;\n\t\tcase MB_YESNOCANCEL:\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDABORT), lmprintf(MSG_008));\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDYES), lmprintf(MSG_009));\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_007));\n\t\t\tShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW);\n\t\t\tShowWindow(GetDlgItem(hDlg, IDABORT), SW_SHOW);\n\t\t\tbreak;\n\t\tcase MB_OK:\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDNO), \"OK\");\n\t\t\tbreak;\n\t\tcase MB_ABORTRETRYIGNORE:\n\t\t\tHMODULE hMui;\n\t\t\tchar mui_path[MAX_PATH], button[3][64] = { \"&Abort\", \"&Retry\", \"&Ignore\" };\n\t\t\t// Load the localized button text from user32.dll.mui. 802 = Abort, 803 = Retry, 804 = Ignore\n\t\t\tstatic_sprintf(mui_path, \"%s\\\\%s\\\\user32.dll.mui\", sysnative_dir, ToLocaleName(GetUserDefaultUILanguage()));\n\t\t\thMui = LoadLibraryU(mui_path);\n\t\t\tif (hMui != NULL) {\n\t\t\t\tLoadStringU(hMui, 802, button[0], sizeof(button[0]));\n\t\t\t\tLoadStringU(hMui, 803, button[1], sizeof(button[1]));\n\t\t\t\tLoadStringU(hMui, 804, button[2], sizeof(button[2]));\n\t\t\t\tFreeLibrary(hMui);\n\t\t\t}\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDABORT), button[0]);\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDYES), button[1]);\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDNO), button[2]);\n\t\t\tShowWindow(GetDlgItem(hDlg, IDABORT), SW_SHOW);\n\t\t\tShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW);\n\t\t\tbreak;\n\t\tdefault:\t// One single 'Close' button\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDNO), lmprintf(MSG_006));\n\t\t\tbreak;\n\t\t}\n\t\thCtrl = GetDlgItem(hDlg, IDC_DONT_DISPLAY_AGAIN);\n\t\tif (notification_data.dont_display_setting != NULL) {\n\t\t\tSetWindowTextU(hCtrl, lmprintf(MSG_127));\n\t\t} else {\n\t\t\t// Remove the \"Don't display again\" checkbox\n\t\t\tShowWindow(hCtrl, SW_HIDE);\n\t\t\tGetWindowRect(hCtrl, &rc);\n\t\t\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\t\t\tcbh = rc.bottom - rc.top;\n\t\t}\n\t\tif ((notification_data.more_info != NULL) && (notification_data.more_info->callback != NULL)) {\n\t\t\thCtrl = GetDlgItem(hDlg, IDC_MORE_INFO);\n\t\t\t// Resize the 'More information' button\n\t\t\tGetWindowRect(hCtrl, &rc);\n\t\t\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\t\t\tSetWindowPos(hCtrl, NULL, rc.left, rc.top,\n\t\t\t\tmax(rc.right - rc.left, GetTextSize(hCtrl, NULL).cx + cbw), rc.bottom - rc.top, SWP_NOZORDER);\n\t\t\tShowWindow(hCtrl, SW_SHOW);\n\t\t}\n\t\t// Set the control text and resize the dialog if needed\n\t\tif (notification_data.szMessageText != NULL) {\n\t\t\thCtrl = GetDlgItem(hDlg, IDC_NOTIFICATION_TEXT);\n\t\t\tSetWindowTextU(hCtrl, notification_data.szMessageText);\n\t\t\thDC = GetDC(hCtrl);\n\t\t\tSelectFont(hDC, hDlgFont);\t// Yes, you *MUST* reapply the font to the DC, even after SetWindowText!\n\t\t\tGetWindowRect(hCtrl, &rc);\n\t\t\tdh = rc.bottom - rc.top;\n\t\t\tDrawTextU(hDC, notification_data.szMessageText, -1, &rc, DT_CALCRECT | DT_WORDBREAK);\n\t\t\tdh = max(rc.bottom - rc.top - dh + (int)(8.0f * fScale), 0);\n\t\t\tsafe_release_dc(hCtrl, hDC);\n\t\t\tResizeMoveCtrl(hDlg, hCtrl, 0, 0, 0, dh, 1.0f);\n\t\t\tResizeMoveCtrl(hDlg, hDlg, 0, 0, 0, dh - cbh, 1.0f);\n\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, -1), 0, 0, 0, dh, 1.0f);\t// IDC_STATIC = -1\n\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SELECTION_LINE), 0, dh, 0, 0, 1.0f);\n\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_DONT_DISPLAY_AGAIN), 0, dh, 0, 0, 1.0f);\n\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_MORE_INFO), 0, dh - cbh, 0, 0, 1.0f);\n\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDABORT), 0, dh - cbh, 0, 0, 1.0f);\n\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDYES), 0, dh -cbh, 0, 0, 1.0f);\n\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDNO), 0, dh -cbh, 0, 0, 1.0f);\n\t\t}\n\t\tSetDarkModeForChild(hDlg);\n\t\treturn (INT_PTR)TRUE;\n\tcase WM_CTLCOLORSTATIC:\n\t\t// Change the background colour for static text and icon\n\t\tSetBkMode((HDC)wParam, TRANSPARENT);\n\t\tif ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE))\n\t\t\treturn (INT_PTR)separator_brush;\n\t\tif ((HWND)lParam == GetDlgItem(hDlg, IDC_DONT_DISPLAY_AGAIN))\n\t\t\treturn (INT_PTR)buttonface_brush;\n\t\treturn (INT_PTR)background_brush;\n\tcase WM_NCHITTEST:\n\t\t// Check coordinates to prevent resize actions\n\t\tloc = DefWindowProc(hDlg, message, wParam, lParam);\n\t\tfor(i = 0; i < 9; i++) {\n\t\t\tif (loc == disabled[i]) {\n\t\t\t\treturn (INT_PTR)TRUE;\n\t\t\t}\n\t\t}\n\t\treturn (INT_PTR)FALSE;\n\tcase WM_NCDESTROY:\n\t\tsafe_delete_object(hDlgFont);\n\t\tbreak;\n\tcase WM_COMMAND:\n\t\t// TODO: This is brittle... and I don't think we use it anyway\n\t\tif (LOWORD(wParam) != IDC_MORE_INFO && IsDlgButtonChecked(hDlg, IDC_DONT_DISPLAY_AGAIN) == BST_CHECKED)\n\t\t\tWriteSettingBool(SETTING_DISABLE_SECURE_BOOT_NOTICE, TRUE);\n\t\tswitch (LOWORD(wParam)) {\n\t\tcase IDYES:\n\t\t\t// Return IDOK/IDRETRY for calls that expect it\n\t\t\tswitch (notification_data.type & 0x0F) {\n\t\t\tcase MB_OKCANCEL:\n\t\t\t\twParam = IDOK;\n\t\t\t\tbreak;\n\t\t\tcase MB_ABORTRETRYIGNORE:\n\t\t\t\twParam = IDRETRY;\n\t\t\t\tbreak;\n\t\t\tcase MB_YESNOCANCEL:\n\t\t\t\twParam = IDNO;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tEndDialog(hDlg, LOWORD(wParam));\n\t\t\treturn (INT_PTR)TRUE;\n\t\tcase IDNO:\n\t\t\t// Return IDCANCEL/IDOK/IDIGNORE for calls that expect it\n\t\t\tswitch (notification_data.type & 0x0F) {\n\t\t\tcase MB_OKCANCEL:\n\t\t\t\twParam = IDCANCEL;\n\t\t\t\tbreak;\n\t\t\tcase MB_OK:\n\t\t\t\twParam = IDOK;\n\t\t\t\tbreak;\n\t\t\tcase MB_ABORTRETRYIGNORE:\n\t\t\t\twParam = IDIGNORE;\n\t\t\t\tbreak;\n\t\t\tcase MB_YESNOCANCEL:\n\t\t\t\twParam = IDCANCEL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tEndDialog(hDlg, LOWORD(wParam));\n\t\t\treturn (INT_PTR)TRUE;\n\t\tcase IDABORT:\n\t\t\tif ((notification_data.type & 0x0F) == MB_YESNOCANCEL)\n\t\t\t\twParam = IDYES;\n\t\t\tEndDialog(hDlg, LOWORD(wParam));\n\t\t\treturn (INT_PTR)TRUE;\n\t\tcase IDC_MORE_INFO:\n\t\t\tif (notification_data.more_info != NULL) {\n\t\t\t\tif_assert_fails(notification_data.more_info->callback != NULL)\n\t\t\t\t\treturn (INT_PTR)FALSE;\n\t\t\t\tif (notification_data.more_info->id == MORE_INFO_URL) {\n\t\t\t\t\tShellExecuteA(hDlg, \"open\", notification_data.more_info->url, NULL, NULL, SW_SHOWNORMAL);\n\t\t\t\t} else {\n\t\t\t\t\tMyDialogBox(hMainInstance, notification_data.more_info->id, hDlg, notification_data.more_info->callback);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\t}\n\treturn (INT_PTR)FALSE;\n}\n\n/*\n * Display a custom notification\n */\nint NotificationEx(int type, const char* dont_display_setting, const notification_info* more_info, const char* title, const char* format, ...)\n{\n\tINT_PTR ret;\n\tva_list args;\n\n\tdialog_showing++;\n\tnotification_data.szMessageText = (char*)malloc(LOC_MESSAGE_SIZE);\n\tif (notification_data.szMessageText == NULL)\n\t\treturn FALSE;\n\tnotification_data.szMessageTitle = safe_strdup(title);\n\tif (notification_data.szMessageTitle == NULL)\n\t\treturn FALSE;\n\tva_start(args, format);\n\tsafe_vsnprintf(notification_data.szMessageText, LOC_MESSAGE_SIZE - 1, format, args);\n\tva_end(args);\n\tnotification_data.szMessageText[LOC_MESSAGE_SIZE - 1] = 0;\n\tnotification_data.more_info = more_info;\n\tnotification_data.type = type;\n\tnotification_data.dont_display_setting = dont_display_setting;\n\tret = MyDialogBox(hMainInstance, IDD_NOTIFICATION, hMainDialog, NotificationCallback);\n\tsafe_free(notification_data.szMessageText);\n\tsafe_free(notification_data.szMessageTitle);\n\tdialog_showing--;\n\treturn (int)ret;\n}\n\nstatic int GetComboBoxMinWidth(HWND hCtrl, StrArray* array)\n{\n\tHDC hDC = GetDC(hCtrl);\n\tHFONT hFont = (HFONT)SendMessage(hCtrl, WM_GETFONT, 0, 0);\n\tHFONT hOldFont = (HFONT)SelectObject(hDC, hFont);\n\tSIZE size;\n\tuint32_t i;\n\tint max_width = 0, arrow_width, padding;\n\n\tif (array == NULL || array->String == NULL) {\n\t\tReleaseDC(hCtrl, hDC);\n\t\treturn 0;\n\t}\n\n\tfor (i = 0; i < array->Index; i++) {\n\t\tGetTextExtentPoint32A(hDC, array->String[i], (int)strlen(array->String[i]), &size);\n\t\tif (size.cx > max_width)\n\t\t\tmax_width = size.cx;\n\t}\n\tSelectObject(hDC, hOldFont);\n\tReleaseDC(hCtrl, hDC);\n\n\t// Add the dropdown arrow button width + some padding\n\tarrow_width = GetSystemMetrics(SM_CXVSCROLL);\n\tpadding = GetSystemMetrics(SM_CXEDGE) * 4 + 8;\n\n\treturn max_width + arrow_width + padding;\n}\n\n/*\n * Custom dialog for radio button selection dialog\n */\nstatic INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\t// This \"Mooo\" is designed to give us enough space for a regular username length\n\tstatic const char* base_username = \"MOOOOOOOOOOO\";\t// 🐮\n\t// https://learn.microsoft.com/en-us/previous-versions/cc722458(v=technet.10)#user-name-policies\n\tstatic const char* username_invalid_chars = \"/\\\\[]:;|=,+*?<>\\\"\";\n\t// Prevent resizing\n\tstatic LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE,\n\t\tHTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT };\n\tstatic HBRUSH background_brush, separator_brush;\n\tstatic HFONT hDlgFont = NULL;\n\tstatic BOOL silent_install_checked = FALSE;\n\tchar username[128] = { 0 }, str[MAX_PATH];\n\tint i, m, dw, dh, r = -1, mw;\n\tDWORD size = sizeof(username);\n\tLRESULT loc;\n\t// To use the system message font\n\tNONCLIENTMETRICS ncm;\n\tRECT rc, rc2;\n\tHWND hCtrl;\n\tHDC hDC;\n\tassert(selection_data.options != NULL);\n\tint nDialogItems = selection_data.options->choices.Index;\n\n\tswitch (message) {\n\tcase WM_INITDIALOG:\n\t\tStrArray edition_name = { 0 }, edition_index = { 0 };\n\t\tStrArrayCreate(&edition_name, 16);\n\t\tStrArrayCreate(&edition_index, 16);\n\t\tSetDarkModeForDlg(hDlg);\n\t\t// Don't overflow our max radio button\n\t\tif (nDialogItems > (IDC_SELECTION_CHOICEMAX - IDC_SELECTION_CHOICE1 + 1)) {\n\t\t\tuprintf(\"WARNING: Too many options requested for Selection (%d vs %d)\",\n\t\t\t\tnDialogItems, IDC_SELECTION_CHOICEMAX - IDC_SELECTION_CHOICE1);\n\t\t\tnDialogItems = IDC_SELECTION_CHOICEMAX - IDC_SELECTION_CHOICE1;\n\t\t}\n\t\t// Switch to checkboxes or some other style if requested\n\t\tfor (i = 0; i < nDialogItems; i++)\n\t\t\tButton_SetStyle(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), selection_data.options->style, TRUE);\n\t\t// Get the system message box font. See http://stackoverflow.com/a/6057761\n\t\tif (hDlgFont == NULL) {\n\t\t\tncm.cbSize = sizeof(ncm);\n\t\t\tSystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0);\n\t\t\thDlgFont = CreateFontIndirect(&ncm.lfMessageFont);\n\t\t}\n\t\t// Set the dialog to use the system message box font\n\t\tSendMessage(hDlg, WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tSendMessage(GetDlgItem(hDlg, IDC_SELECTION_TEXT), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tfor (i = 0; i < nDialogItems; i++)\n\t\t\tSendMessage(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tSendMessage(GetDlgItem(hDlg, IDYES), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tSendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\n\t\tapply_localization(IDD_SELECTION, hDlg);\n\t\tbackground_brush = GetSysColorBrush(COLOR_WINDOW);\n\t\tseparator_brush = GetSysColorBrush(COLOR_3DLIGHT);\n\t\tSetTitleBarIcon(hDlg);\n\t\tCenterDialog(hDlg, NULL);\n\n\t\t// Get the dialog's default size\n\t\tGetWindowRect(GetDlgItem(hDlg, IDC_SELECTION_TEXT), &rc);\n\t\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\t\tmw = rc.right - rc.left - ddw;\t// ddw seems to work okay as a fudge\n\t\tdw = mw;\n\n\t\tr = GetEditions(&edition_name, &edition_index);\n\n\t\t// Change the default icon and set the text\n\t\tStatic_SetIcon(GetDlgItem(hDlg, IDC_SELECTION_ICON), LoadIcon(NULL, IDI_QUESTION));\n\t\tSetWindowTextU(hDlg, selection_data.szMessageTitle);\n\t\tSetWindowTextU(GetDlgItem(hDlg, IDCANCEL), lmprintf(MSG_007));\n\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_TEXT), selection_data.szMessageText);\n\t\tfor (i = 0; i < nDialogItems; i++) {\n\t\t\thCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i);\n\t\t\tstatic_strcpy(str, selection_data.options->choices.String[i]);\n\t\t\tSetWindowTextU(hCtrl, str);\n\t\t\tShowWindow(hCtrl, SW_SHOW);\n\t\t\t// Compute the maximum line's width (with some extra for the username and edition fields)\n\t\t\tif (i == selection_data.options->username_index) {\n\t\t\t\tstatic_sprintf(str, \"%s __%s__\", selection_data.options->choices.String[i], base_username);\n\t\t\t\tmw = max(mw, GetTextSize(hCtrl, str).cx);\n\t\t\t} else if (i == selection_data.options->edition_index) {\n\t\t\t\tmw = max(mw, GetTextSize(hCtrl, str).cx +\n\t\t\t\t\tGetComboBoxMinWidth(GetDlgItem(hDlg, IDC_SELECTION_EDITION), &edition_name));\n\t\t\t} else {\n\t\t\t\tmw = max(mw, GetTextSize(hCtrl, str).cx);\n\t\t\t}\n\t\t\t// Set tooltips, if any\n\t\t\tif (i < (int)selection_data.options->tooltips.Index)\n\t\t\t\tCreateTooltip(hCtrl, selection_data.options->tooltips.String[i], -1);\n\t\t}\n\t\t// If our maximum line's width is greater than the default, set a nonzero delta width\n\t\tdw = (mw <= dw) ? 0 : mw - dw;\n\t\t// Move/Resize the controls as needed to fit our text\n\t\thCtrl = GetDlgItem(hDlg, IDC_SELECTION_TEXT);\n\t\tResizeMoveCtrl(hDlg, hCtrl, 0, 0, dw, 0, 1.0f);\n\t\thDC = GetDC(hCtrl);\n\t\tSelectFont(hDC, hDlgFont);\t// Yes, you *MUST* reapply the font to the DC, even after SetWindowText!\n\t\tGetWindowRect(hCtrl, &rc);\n\t\tdh = rc.bottom - rc.top;\n\t\tDrawTextU(hDC, selection_data.szMessageText, -1, &rc, DT_CALCRECT | DT_WORDBREAK);\n\t\tdh = rc.bottom - rc.top - dh;\n\t\tsafe_release_dc(hCtrl, hDC);\n\t\tResizeMoveCtrl(hDlg, hCtrl, 0, 0, 0, dh, 1.0f);\n\t\tfor (i = 0; i < nDialogItems; i++)\n\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i), 0, dh, dw, 0, 1.0f);\n\n\t\t// If required, set up the the username edit box\n\t\tif (selection_data.options->username_index > 0) {\n\t\t\tunattend_username[0] = 0;\n\t\t\thCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index);\n\t\t\tGetClientRect(hCtrl, &rc);\n\t\t\tResizeMoveCtrl(hDlg, hCtrl, 0, 0,\n\t\t\t\t(rc.left - rc.right) + GetTextSize(hCtrl, selection_data.options->choices.String[selection_data.options->username_index]).cx + ddw, 0, 1.0f);\n\t\t\tGetWindowRect(hCtrl, &rc);\n\t\t\tSetWindowPos(GetDlgItem(hDlg, IDC_SELECTION_USERNAME), hCtrl, rc.left, rc.top, 0, 0, SWP_NOMOVE | SWP_NOSIZE);\n\t\t\thCtrl = GetDlgItem(hDlg, IDC_SELECTION_USERNAME);\n\t\t\tGetWindowRect(hCtrl, &rc2);\n\t\t\tResizeMoveCtrl(hDlg, hCtrl, right_to_left_mode ? rc2.right - rc.left : rc.right - rc2.left, rc.top - rc2.top,\n\t\t\t\tGetTextSize(hCtrl, (char*)base_username).cx, 0, 1.0f);\n\t\t\tif (!GetUserNameU(username, &size) || username[0] == 0)\n\t\t\t\tstatic_strcpy(username, \"User\");\n\t\t\tSetWindowTextU(hCtrl, username);\n\t\t\tShowWindow(hCtrl, SW_SHOW);\n\t\t}\n\n\t\t// If required, set up the the edition combo box\n\t\tif (selection_data.options->edition_index > 0 && edition_name.String != NULL && edition_name.Index > 0) {\n\t\t\thCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index);\n\t\t\tGetClientRect(hCtrl, &rc);\n\t\t\tResizeMoveCtrl(hDlg, hCtrl, 0, 0,\n\t\t\t\t(rc.left - rc.right) + GetTextSize(hCtrl, selection_data.options->choices.String[selection_data.options->edition_index]).cx + ddw, 0, 1.0f);\n\t\t\tGetWindowRect(hCtrl, &rc);\n\t\t\tSetWindowPos(GetDlgItem(hDlg, IDC_SELECTION_EDITION), hCtrl, rc.left, rc.top, 0, 0, SWP_NOMOVE | SWP_NOSIZE);\n\t\t\thCtrl = GetDlgItem(hDlg, IDC_SELECTION_EDITION);\n\t\t\tGetWindowRect(hCtrl, &rc2);\n\t\t\tResizeMoveCtrl(hDlg, hCtrl, right_to_left_mode ? rc2.right - rc.left : rc.right - rc2.left, rc.top - rc2.top,\n\t\t\t\tGetComboBoxMinWidth(hCtrl, &edition_name), 0, 1.0f);\n\t\t\tfor (i = 0; i < (int)edition_name.Index; i++)\n\t\t\t\tIGNORE_RETVAL(ComboBox_SetItemData(hCtrl, ComboBox_AddStringU(hCtrl, edition_name.String[i]),\n\t\t\t\t\t(LPARAM)atoi(edition_index.String[i])));\n\t\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hCtrl, unattend_edition_index));\n\t\t\tShowWindow(hCtrl, SW_SHOW);\n\t\t}\n\n\t\tif (nDialogItems > 2) {\n\t\t\tGetWindowRect(GetDlgItem(hDlg, IDC_SELECTION_CHOICE2), &rc);\n\t\t\tGetWindowRect(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + nDialogItems - 1), &rc2);\n\t\t\tdh += rc2.top - rc.top;\n\t\t}\n\t\tif (dw != 0)\n\t\t\tdw += ddw;\n\t\tResizeMoveCtrl(hDlg, hDlg, 0, 0, dw, dh, 1.0f);\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, -1), 0, 0, dw, dh, 1.0f);\t// IDC_STATIC = -1\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_SELECTION_LINE), 0, dh, dw, 0, 1.0f);\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDOK), dw, dh, 0, 0, 1.0f);\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDCANCEL), dw, dh, 0, 0, 1.0f);\n\t\tResizeButtonHeight(hDlg, IDOK);\n\t\tResizeButtonHeight(hDlg, IDCANCEL);\n\n\t\t// Set the default selection\n\t\tfor (i = 0, m = 1; i < nDialogItems; i++, m <<= 1)\n\t\t\tButton_SetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i),\n\t\t\t\t(selection_data.options->mask == 0 && i == 0) ||\n\t\t\t\t(selection_data.options->mask != 0 && (m & selection_data.options->mask) ? BST_CHECKED : BST_UNCHECKED));\n\t\t// Set the default state of the silent install option if available\n\t\tif (selection_data.options->edition_index > 0 && selection_data.options->username_index > 0 &&\n\t\t\tselection_data.options->regional_index > 0 && selection_data.options->privacy_index > 0) {\n\t\t\t// Should be the same condition as the one in WM_COMMAND\n\t\t\tBOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index)) &&\n\t\t\t\tButton_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->regional_index)) &&\n\t\t\t\tButton_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->privacy_index));\n\t\t\tEnableWindow(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index), enable);\n\t\t\tEnableWindow(GetDlgItem(hDlg, IDC_SELECTION_EDITION), enable);\n\t\t}\n\n\t\tSetDarkModeForChild(hDlg);\n\t\tStrArrayDestroy(&edition_name);\n\t\tStrArrayDestroy(&edition_index);\n\t\treturn (INT_PTR)TRUE;\n\tcase WM_CTLCOLORSTATIC:\n\t\t// Change the background colour for static text and icon\n\t\tSetBkMode((HDC)wParam, TRANSPARENT);\n\t\tif ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE)) {\n\t\t\treturn (INT_PTR)separator_brush;\n\t\t}\n\t\treturn (INT_PTR)background_brush;\n\tcase WM_NCHITTEST:\n\t\t// Check coordinates to prevent resize actions\n\t\tloc = DefWindowProc(hDlg, message, wParam, lParam);\n\t\tfor (i = 0; i < 9; i++) {\n\t\t\tif (loc == disabled[i]) {\n\t\t\t\treturn (INT_PTR)TRUE;\n\t\t\t}\n\t\t}\n\t\treturn (INT_PTR)FALSE;\n\tcase WM_NCDESTROY:\n\t\tsafe_delete_object(hDlgFont);\n\t\tbreak;\n\tcase WM_COMMAND:\n\t\tWORD command = LOWORD(wParam);\n\t\tif (command >= IDC_SELECTION_CHOICE1 && command < IDC_SELECTION_CHOICEMAX) {\n\t\t\t// Check if local account + regional settings + data collection checkboxes are clicked and enable/disable the silent install option\n\t\t\tif (selection_data.options->edition_index > 0 && selection_data.options->username_index > 0 &&\n\t\t\t\tselection_data.options->edition_index > 0 && selection_data.options->regional_index > 0 &&\n\t\t\t\t\t(command - IDC_SELECTION_CHOICE1 == selection_data.options->username_index ||\n\t\t\t\t\t command - IDC_SELECTION_CHOICE1 == selection_data.options->regional_index ||\n\t\t\t\t\t command - IDC_SELECTION_CHOICE1 == selection_data.options->privacy_index)) {\n\t\t\t\tBOOL enable = Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->username_index)) &&\n\t\t\t\t\tButton_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->regional_index)) &&\n\t\t\t\t\tButton_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->privacy_index));\n\t\t\t\thCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index);\n\t\t\t\tif (!enable && IsWindowEnabled(hCtrl)) {\n\t\t\t\t\tsilent_install_checked = (Button_GetCheck(hCtrl) == BST_CHECKED);\n\t\t\t\t\tButton_SetCheck(hCtrl, FALSE);\n\t\t\t\t} else if (enable && !IsWindowEnabled(hCtrl)) {\n\t\t\t\t\tButton_SetCheck(hCtrl, silent_install_checked);\n\t\t\t\t}\n\t\t\t\tEnableWindow(hCtrl, enable);\n\t\t\t\tEnableWindow(GetDlgItem(hDlg, IDC_SELECTION_EDITION), enable);\n\t\t\t}\n\t\t} else switch (LOWORD(wParam)) {\n\t\tcase IDOK:\n\t\t\t// Produce a big scary warning if the silent install option was selected\n\t\t\tif (selection_data.options->edition_index > 0 &&\n\t\t\t\tButton_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data.options->edition_index)) &&\n\t\t\t\tNotification(MB_YESNO | MB_ICONWARNING, APPLICATION_NAME, lmprintf(MSG_356)) != IDYES)\n\t\t\t\tbreak;\n\t\t\tfor (r = 0, i = 0, m = 1; i < nDialogItems; i++, m <<= 1)\n\t\t\t\tif (Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i)) == BST_CHECKED)\n\t\t\t\t\tr += m;\n\t\t\tif (selection_data.options->username_index > 0) {\n\t\t\t\tGetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_USERNAME), unattend_username, MAX_USERNAME_LENGTH);\n\t\t\t\t// Perform string sanitization (NB: GetWindowTextU always terminates the string)\n\t\t\t\tfor (i = 0; unattend_username[i] != 0; i++) {\n\t\t\t\t\tif (strchr(username_invalid_chars, unattend_username[i]) != NULL)\n\t\t\t\t\t\tunattend_username[i] = '_';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selection_data.options->edition_index > 0)\n\t\t\t\tunattend_edition_index = (int)ComboBox_GetCurItemData(GetDlgItem(hDlg, IDC_SELECTION_EDITION));\n\t\t\t// Fall through\n\t\tcase IDNO:\n\t\tcase IDCANCEL:\n\t\t\tEndDialog(hDlg, r);\n\t\t\treturn (INT_PTR)TRUE;\n\t\t}\n\t\tbreak;\n\t}\n\treturn (INT_PTR)FALSE;\n}\n\n/*\n * Display an item selection dialog\n */\nint SelectionDialog(char* title, char* message, selection_dialog_options_t* options)\n{\n\tint ret;\n\n\tassert(options != NULL);\n\tdialog_showing++;\n\tselection_data.szMessageTitle = title;\n\tselection_data.szMessageText = message;\n\tselection_data.options = options;\n\tif (options->style == 0)\n\t\toptions->style = BS_AUTORADIOBUTTON;\n\tassert ((options->style == BS_AUTORADIOBUTTON || options->style == BS_AUTOCHECKBOX));\n\tret = (int)MyDialogBox(hMainInstance, IDD_SELECTION, hMainDialog, SelectionCallback);\n\tdialog_showing--;\n\n\treturn ret;\n}\n\n/*\n * Custom dialog for list dialog\n */\nINT_PTR CALLBACK ListCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tLRESULT loc;\n\tint i, dh, r  = -1;\n\t// Prevent resizing\n\tstatic LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE,\n\t\tHTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT };\n\tstatic HBRUSH background_brush, separator_brush;\n\t// To use the system message font\n\tNONCLIENTMETRICS ncm;\n\tRECT rc, rc2;\n\tstatic HFONT hDlgFont = NULL;\n\tHWND hCtrl;\n\tHDC hDC;\n\n\tswitch (message) {\n\tcase WM_INITDIALOG:\n\t\tSetDarkModeForDlg(hDlg);\n\t\t// Don't overflow our max radio button\n\t\tif (list_data.nDialogItems > (IDC_LIST_ITEMMAX - IDC_LIST_ITEM1 + 1)) {\n\t\t\tuprintf(\"WARNING: Too many items requested for List (%d vs %d)\",\n\t\t\t\tlist_data.nDialogItems, IDC_LIST_ITEMMAX - IDC_LIST_ITEM1);\n\t\t\tlist_data.nDialogItems = IDC_LIST_ITEMMAX - IDC_LIST_ITEM1;\n\t\t}\n\t\t// Get the system message box font. See http://stackoverflow.com/a/6057761\n\t\tif (hDlgFont == NULL) {\n\t\t\tncm.cbSize = sizeof(ncm);\n\t\t\tSystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0);\n\t\t\thDlgFont = CreateFontIndirect(&(ncm.lfMessageFont));\n\t\t}\n\t\t// Set the dialog to use the system message box font\n\t\tSendMessage(hDlg, WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tSendMessage(GetDlgItem(hDlg, IDC_LIST_TEXT), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tfor (i = 0; i < list_data.nDialogItems; i++)\n\t\t\tSendMessage(GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tSendMessage(GetDlgItem(hDlg, IDYES), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\t\tSendMessage(GetDlgItem(hDlg, IDNO), WM_SETFONT, (WPARAM)hDlgFont, MAKELPARAM(TRUE, 0));\n\n\t\tapply_localization(IDD_LIST, hDlg);\n\t\tbackground_brush = GetSysColorBrush(COLOR_WINDOW);\n\t\tseparator_brush = GetSysColorBrush(COLOR_3DLIGHT);\n\t\tSetTitleBarIcon(hDlg);\n\t\tCenterDialog(hDlg, NULL);\n\t\t// Change the default icon and set the text\n\t\tStatic_SetIcon(GetDlgItem(hDlg, IDC_LIST_ICON), LoadIcon(NULL, IDI_EXCLAMATION));\n\t\tSetWindowTextU(hDlg, list_data.szMessageTitle);\n\t\tSetWindowTextU(GetDlgItem(hDlg, IDCANCEL), lmprintf(MSG_007));\n\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_LIST_TEXT), list_data.szMessageText);\n\t\tfor (i = 0; i < list_data.nDialogItems; i++) {\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), list_data.szDialogItem[i]);\n\t\t\tShowWindow(GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), SW_SHOW);\n\t\t}\n\t\t// Move/Resize the controls as needed to fit our text\n\t\thCtrl = GetDlgItem(hDlg, IDC_LIST_TEXT);\n\t\thDC = GetDC(hCtrl);\n\t\tSelectFont(hDC, hDlgFont);\t// Yes, you *MUST* reapply the font to the DC, even after SetWindowText!\n\t\tGetWindowRect(hCtrl, &rc);\n\t\tdh = rc.bottom - rc.top;\n\t\tDrawTextU(hDC, list_data.szMessageText, -1, &rc, DT_CALCRECT | DT_WORDBREAK);\n\t\tdh = rc.bottom - rc.top - dh;\n\t\tsafe_release_dc(hCtrl, hDC);\n\t\tResizeMoveCtrl(hDlg, hCtrl, 0, 0, 0, dh, 1.0f);\n\t\tfor (i = 0; i < list_data.nDialogItems; i++)\n\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_LIST_ITEM1 + i), 0, dh, 0, 0, 1.0f);\n\t\tif (list_data.nDialogItems > 1) {\n\t\t\tGetWindowRect(GetDlgItem(hDlg, IDC_LIST_ITEM1), &rc);\n\t\t\tGetWindowRect(GetDlgItem(hDlg, IDC_LIST_ITEM1 + list_data.nDialogItems - 1), &rc2);\n\t\t\tdh += rc2.top - rc.top;\n\t\t}\n\t\tResizeMoveCtrl(hDlg, hDlg, 0, 0, 0, dh, 1.0f);\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, -1), 0, 0, 0, dh, 1.0f);\t// IDC_STATIC = -1\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_LIST_LINE), 0, dh, 0, 0, 1.0f);\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDOK), 0, dh, 0, 0, 1.0f);\n\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDCANCEL), 0, dh, 0, 0, 1.0f);\n\t\tResizeButtonHeight(hDlg, IDOK);\n\t\tResizeButtonHeight(hDlg, IDCANCEL);\n\t\tSetDarkModeForChild(hDlg);\n\t\treturn (INT_PTR)TRUE;\n\tcase WM_CTLCOLORSTATIC:\n\t\t// Change the background colour for static text and icon\n\t\tSetBkMode((HDC)wParam, TRANSPARENT);\n\t\tif ((HWND)lParam == GetDlgItem(hDlg, IDC_NOTIFICATION_LINE)) {\n\t\t\treturn (INT_PTR)separator_brush;\n\t\t}\n\t\treturn (INT_PTR)background_brush;\n\tcase WM_NCHITTEST:\n\t\t// Check coordinates to prevent resize actions\n\t\tloc = DefWindowProc(hDlg, message, wParam, lParam);\n\t\tfor (i = 0; i < 9; i++) {\n\t\t\tif (loc == disabled[i]) {\n\t\t\t\treturn (INT_PTR)TRUE;\n\t\t\t}\n\t\t}\n\t\treturn (INT_PTR)FALSE;\n\tcase WM_NCDESTROY:\n\t\tsafe_delete_object(hDlgFont);\n\t\tbreak;\n\tcase WM_COMMAND:\n\t\tswitch (LOWORD(wParam)) {\n\t\tcase IDOK:\n\t\tcase IDNO:\n\t\tcase IDCANCEL:\n\t\t\tEndDialog(hDlg, r);\n\t\t\treturn (INT_PTR)TRUE;\n\t\t}\n\t\tbreak;\n\t}\n\treturn (INT_PTR)FALSE;\n}\n\n/*\n * Display a dialog with a list of items\n */\nvoid ListDialog(char* title, char* message, char** items, int size)\n{\n\tdialog_showing++;\n\tlist_data.szMessageTitle = title;\n\tlist_data.szMessageText = message;\n\tlist_data.szDialogItem = items;\n\tlist_data.nDialogItems = size;\n\tMyDialogBox(hMainInstance, IDD_LIST, hMainDialog, ListCallback);\n\tdialog_showing--;\n}\n\nstatic struct {\n\tHWND hTip;\t\t// Tooltip handle\n\tHWND hCtrl;\t\t// Handle of the control the tooltip belongs to\n\tWNDPROC original_proc;\n\tLPWSTR wstring;\n} ttlist[MAX_TOOLTIPS] = { {0} };\n\nINT_PTR CALLBACK TooltipCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tLPNMTTDISPINFOW lpnmtdi;\n\tint i = MAX_TOOLTIPS;\n\n\t// Make sure we have an original proc\n\tfor (i=0; i<MAX_TOOLTIPS; i++) {\n\t\tif (ttlist[i].hTip == hDlg) break;\n\t}\n\tif (i == MAX_TOOLTIPS)\n\t\treturn (INT_PTR)FALSE;\n\n\tswitch (message) {\n\tcase WM_NOTIFY:\n\t\tswitch (((LPNMHDR)lParam)->code) {\n\t\tcase TTN_GETDISPINFOW:\n\t\t\tlpnmtdi = (LPNMTTDISPINFOW)lParam;\n\t\t\tlpnmtdi->lpszText = ttlist[i].wstring;\n\t\t\t// Don't ask me WHY we need to clear RTLREADING for RTL multiline text to look good\n\t\t\tlpnmtdi->uFlags &= ~TTF_RTLREADING;\n\t\t\tSendMessage(hDlg, TTM_SETMAXTIPWIDTH, 0, (LPARAM)(int)(150.0f * fScale));\n\t\t\treturn (INT_PTR)TRUE;\n\t\t}\n\t\tbreak;\n\t}\n#ifdef _DEBUG\n\t// comctl32 causes issues if the tooltips are not being manipulated from the same thread as their parent controls\n\tif (GetCurrentThreadId() != MainThreadId)\n\t\tuprintf(\"WARNING: Tooltip callback is being called from wrong thread\");\n#endif\n\treturn CallWindowProc(ttlist[i].original_proc, hDlg, message, wParam, lParam);\n}\n\n/*\n * Create a tooltip for the control passed as first parameter\n * duration sets the duration in ms. Use -1 for default\n * message is an UTF-8 string\n */\nBOOL CreateTooltip(HWND hControl, const char* message, int duration)\n{\n\tTOOLINFOW toolInfo = {0};\n\tint i;\n\n\tif ( (hControl == NULL) || (message == NULL) ) {\n\t\treturn FALSE;\n\t}\n\n\t// Destroy existing tooltip if any\n\tDestroyTooltip(hControl);\n\n\t// Find an empty slot\n\tfor (i=0; i<MAX_TOOLTIPS; i++) {\n\t\tif (ttlist[i].hTip == NULL) break;\n\t}\n\tif (i >= MAX_TOOLTIPS) {\n\t\tuprintf(\"Maximum number of tooltips reached (%d)\\n\", MAX_TOOLTIPS);\n\t\treturn FALSE;\n\t}\n\n\t// Create the tooltip window\n\tttlist[i].hTip = CreateWindowEx(right_to_left_mode ? WS_EX_LAYOUTRTL : 0,\n\t\tTOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,\n\t\tCW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hMainDialog, NULL,\n\t\thMainInstance, NULL);\n\n\tif (ttlist[i].hTip == NULL) {\n\t\treturn FALSE;\n\t}\n\tSetDarkTheme(ttlist[i].hTip);\n\tttlist[i].hCtrl = hControl;\n\n\t// Subclass the tooltip to handle multiline\n\tttlist[i].original_proc = (WNDPROC)SetWindowLongPtr(ttlist[i].hTip, GWLP_WNDPROC, (LONG_PTR)TooltipCallback);\n\n\t// Set the string to display (can be multiline)\n\tttlist[i].wstring = utf8_to_wchar(message);\n\n\t// Set tooltip duration (ms)\n\tPostMessage(ttlist[i].hTip, TTM_SETDELAYTIME, (WPARAM)TTDT_AUTOPOP, (LPARAM)duration);\n\n\t// Associate the tooltip to the control\n\ttoolInfo.cbSize = sizeof(toolInfo);\n\ttoolInfo.hwnd = ttlist[i].hTip;\t// Set to the tooltip itself to ease up subclassing\n\ttoolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS | ((right_to_left_mode)?TTF_RTLREADING:0);\n\t// set TTF_NOTBUTTON and TTF_CENTERTIP if it isn't a button\n\tif (!(SendMessage(hControl, WM_GETDLGCODE, 0, 0) & DLGC_BUTTON))\n\t\ttoolInfo.uFlags |= 0x80000000L | TTF_CENTERTIP;\n\n\ttoolInfo.uId = (UINT_PTR)hControl;\n\ttoolInfo.lpszText = LPSTR_TEXTCALLBACKW;\n\tSendMessageW(ttlist[i].hTip, TTM_ADDTOOLW, 0, (LPARAM)&toolInfo);\n\n\treturn TRUE;\n}\n\n/* Destroy a tooltip. hCtrl = handle of the control the tooltip is associated with */\nvoid DestroyTooltip(HWND hControl)\n{\n\tint i;\n\n\tif (hControl == NULL) return;\n\tfor (i=0; i<MAX_TOOLTIPS; i++) {\n\t\tif (ttlist[i].hCtrl == hControl) break;\n\t}\n\tif (i >= MAX_TOOLTIPS) return;\n\tDestroyWindow(ttlist[i].hTip);\n\tsafe_free(ttlist[i].wstring);\n\tttlist[i].original_proc = NULL;\n\tttlist[i].hTip = NULL;\n\tttlist[i].hCtrl = NULL;\n}\n\nvoid DestroyAllTooltips(void)\n{\n\tint i, j;\n\n\tfor (i=0, j=0; i<MAX_TOOLTIPS; i++) {\n\t\tif (ttlist[i].hTip == NULL) continue;\n\t\tj++;\n\t\tDestroyWindow(ttlist[i].hTip);\n\t\tsafe_free(ttlist[i].wstring);\n\t\tttlist[i].original_proc = NULL;\n\t\tttlist[i].hTip = NULL;\n\t\tttlist[i].hCtrl = NULL;\n\t}\n}\n\n/* Determine if a Windows is being displayed or not */\nBOOL IsShown(HWND hDlg)\n{\n\tWINDOWPLACEMENT placement = {0};\n\tplacement.length = sizeof(WINDOWPLACEMENT);\n\tif (!GetWindowPlacement(hDlg, &placement))\n\t\treturn FALSE;\n\tswitch (placement.showCmd) {\n\tcase SW_SHOWNORMAL:\n\tcase SW_SHOWMAXIMIZED:\n\tcase SW_SHOW:\n\tcase SW_SHOWDEFAULT:\n\t\treturn TRUE;\n\tdefault:\n\t\treturn FALSE;\n\t}\n}\n\n/* Compute the width of a dropdown list entry */\nLONG GetEntryWidth(HWND hDropDown, const char *entry)\n{\n\tHDC hDC;\n\tHFONT hFont, hDefFont = NULL;\n\tSIZE size;\n\n\thDC = GetDC(hDropDown);\n\thFont = (HFONT)SendMessage(hDropDown, WM_GETFONT, 0, 0);\n\tif (hFont != NULL)\n\t\thDefFont = (HFONT)SelectObject(hDC, hFont);\n\n\tif (!GetTextExtentPointU(hDC, entry, &size))\n\t\tsize.cx = 0;\n\n\tif (hFont != NULL)\n\t\tSelectObject(hDC, hDefFont);\n\n\tsafe_release_dc(hDropDown, hDC);\n\treturn size.cx;\n}\n\n/*\n * Windows taskbar icon handling (progress bar overlay, etc)\n */\nstatic ITaskbarList3* ptbl = NULL;\n\n// Create a taskbar icon progressbar\nBOOL CreateTaskbarList(void)\n{\n\tHRESULT hr;\n\n\thr = CoCreateInstance(&CLSID_TaskbarList, NULL, CLSCTX_ALL, &IID_ITaskbarList3, (LPVOID)&ptbl);\n\tif (FAILED(hr)) {\n\t\tuprintf(\"CoCreateInstance for TaskbarList failed: error %X\\n\", hr);\n\t\tptbl = NULL;\n\t\treturn FALSE;\n\t}\n\treturn TRUE;\n}\n\nBOOL SetTaskbarProgressState(TASKBAR_PROGRESS_FLAGS tbpFlags)\n{\n\tif (ptbl == NULL)\n\t\treturn FALSE;\n\treturn !FAILED(ITaskbarList3_SetProgressState(ptbl, hMainDialog, tbpFlags));\n}\n\nBOOL SetTaskbarProgressValue(ULONGLONG ullCompleted, ULONGLONG ullTotal)\n{\n\tif (ptbl == NULL)\n\t\treturn FALSE;\n\treturn !FAILED(ITaskbarList3_SetProgressValue(ptbl, hMainDialog, ullCompleted, ullTotal));\n}\n\nstatic void Reposition(HWND hDlg, int id, int prev_id, int dx, int dw)\n{\n\tHWND hCtrl, hPrevCtrl;\n\tRECT rc;\n\n\thCtrl = GetDlgItem(hDlg, id);\n\thPrevCtrl = (prev_id > 0) ? GetDlgItem(hDlg, prev_id) : HWND_TOP;\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSetWindowPos(hCtrl, hPrevCtrl, rc.left + dx, rc.top, rc.right - rc.left + dw, rc.bottom - rc.top, 0);\n}\n\nstatic void PositionControls(HWND hDlg)\n{\n\tRECT rc;\n\tHWND hCtrl, hPrevCtrl;\n\tint i, ow, dw;\t// original width, delta\n\n\t// Get the original size of the control\n\tGetWindowRect(GetDlgItem(hDlg, IDS_UPDATE_FREQUENCY_TXT), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tow = rc.right - rc.left;\n\tdw = GetTextWidth(hDlg, IDS_UPDATE_FREQUENCY_TXT) - ow;\n\tdw = max(dw, GetTextWidth(hDlg, IDS_INCLUDE_BETAS_TXT) - ow);\n\tif (dw > 0) {\n\t\tGetWindowRect(hDlg, &rc);\n\t\tSetWindowPos(hDlg, NULL, -1, -1, rc.right - rc.left + dw, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);\n\t\tfor (i = 1; i < ARRAYSIZE(update_settings_reposition_ids); i++)\n\t\t\tReposition(hDlg, update_settings_reposition_ids[i], update_settings_reposition_ids[i-1],\n\t\t\t\t((i < 5) && (i != 4)) ? 0 : dw, ((i >= 5) || (i == 4)) ? 0 : dw);\n\t}\n\n\thCtrl = GetDlgItem(hDlg, IDC_UPDATE_FREQUENCY);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tow = rc.right - rc.left;\n\n\tdw = GetTextSize(hCtrl, lmprintf(MSG_013)).cx;\n\tdw = max(dw, GetTextSize(hCtrl, lmprintf(MSG_030, lmprintf(MSG_014))).cx);\n\tdw = max(dw, GetTextSize(hCtrl, lmprintf(MSG_015)).cx);\n\tdw = max(dw, GetTextSize(hCtrl, lmprintf(MSG_016)).cx);\n\tdw = max(dw, GetTextSize(hCtrl, lmprintf(MSG_008)).cx);\n\tdw = max(dw, GetTextSize(hCtrl, lmprintf(MSG_009)).cx);\n\tdw -= ow - ddw;\n\tif (dw > 0) {\n\t\tGetWindowRect(hDlg, &rc);\n\t\tSetWindowPos(hDlg, NULL, -1, -1, rc.right - rc.left + dw, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);\n\t\tfor (i = 1; i < ARRAYSIZE(update_settings_reposition_ids); i++) {\n\t\t\tif ((i == 3) || (i == 5))\n\t\t\t\tcontinue;\n\t\t\tReposition(hDlg, update_settings_reposition_ids[i], update_settings_reposition_ids[i-1],\n\t\t\t\t(i < 7) ? 0 : dw, (i >= 7) ? 0 : dw);\n\t\t}\n\t}\n\n\tGetWindowRect(GetDlgItem(hDlg, IDC_CHECK_NOW), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tow = rc.right - rc.left;\n\tdw = GetTextWidth(hDlg, IDC_CHECK_NOW) - ow + cbw;\n\tdw = max(dw, GetTextWidth(hDlg, IDCANCEL) - ow + cbw);\n\tif (dw > 0) {\n\t\tGetWindowRect(hDlg, &rc);\n\t\tSetWindowPos(hDlg, NULL, -1, -1, rc.right - rc.left + dw, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);\n\t\tfor (i = 1; i < ARRAYSIZE(update_settings_reposition_ids); i++) {\n\t\t\tif ((i >= 2) && (i <= 6))\n\t\t\t\tcontinue;\n\t\t\tReposition(hDlg, update_settings_reposition_ids[i], update_settings_reposition_ids[i-1], 0, dw);\n\t\t}\n\t}\n\thCtrl = GetDlgItem(hDlg, IDC_CHECK_NOW);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\thPrevCtrl = GetNextWindow(hCtrl, GW_HWNDPREV);\n\tSetWindowPos(hCtrl, hPrevCtrl, rc.left, rc.top, rc.right - rc.left, ddbh, 0);\n\thCtrl = GetDlgItem(hDlg, IDCANCEL);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\thPrevCtrl = GetNextWindow(hCtrl, GW_HWNDPREV);\n\tSetWindowPos(hCtrl, hPrevCtrl, rc.left, rc.top, rc.right - rc.left, ddbh, 0);\n}\n\n/*\n * Update policy and settings dialog callback\n */\nINT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tstatic BOOL resized_already = TRUE;\n\tint i, dy;\n\tRECT rect;\n\tREQRESIZE* rsz;\n\tHWND hPolicy;\n\tstatic HWND hFrequency, hBeta;\n\tint32_t freq;\n\tchar update_policy_text[4096];\n\n\tswitch (message) {\n\tcase WM_INITDIALOG:\n\t\tSetDarkModeForDlg(hDlg);\n\t\tresized_already = FALSE;\n\t\tapply_localization(IDD_UPDATE_POLICY, hDlg);\n\t\tPositionControls(hDlg);\n\t\tSetTitleBarIcon(hDlg);\n\t\tCenterDialog(hDlg, NULL);\n\t\thFrequency = GetDlgItem(hDlg, IDC_UPDATE_FREQUENCY);\n\t\thBeta = GetDlgItem(hDlg, IDC_INCLUDE_BETAS);\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hFrequency, ComboBox_AddStringU(hFrequency, lmprintf(MSG_013)), -1));\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hFrequency, ComboBox_AddStringU(hFrequency, lmprintf(MSG_030, lmprintf(MSG_014))), 86400));\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hFrequency, ComboBox_AddStringU(hFrequency, lmprintf(MSG_015)), 604800));\n\t\tIGNORE_RETVAL(ComboBox_SetItemData(hFrequency, ComboBox_AddStringU(hFrequency, lmprintf(MSG_016)), 2629800));\n\t\tfreq = ReadSetting32(SETTING_UPDATE_INTERVAL);\n\t\tEnableWindow(GetDlgItem(hDlg, IDC_CHECK_NOW), (freq != 0));\n\t\tEnableWindow(hBeta, (freq >= 0) && is_x86_64);\n\t\tswitch(freq) {\n\t\tcase -1:\n\t\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hFrequency, 0));\n\t\t\tbreak;\n\t\tcase 0:\n\t\tcase 86400:\n\t\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hFrequency, 1));\n\t\t\tbreak;\n\t\tcase 604800:\n\t\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hFrequency, 2));\n\t\t\tbreak;\n\t\tcase 2629800:\n\t\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hFrequency, 3));\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tIGNORE_RETVAL(ComboBox_SetItemData(hFrequency, ComboBox_AddStringU(hFrequency, lmprintf(MSG_017)), freq));\n\t\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hFrequency, 4));\n\t\t\tbreak;\n\t\t}\n\t\tIGNORE_RETVAL(ComboBox_AddStringU(hBeta, lmprintf(MSG_008)));\n\t\tIGNORE_RETVAL(ComboBox_AddStringU(hBeta, lmprintf(MSG_009)));\n\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hBeta, (ReadSettingBool(SETTING_INCLUDE_BETAS) && is_x86_64) ? 0 : 1));\n\t\thPolicy = GetDlgItem(hDlg, IDC_POLICY);\n\t\tSendMessage(hPolicy, EM_AUTOURLDETECT, 1, 0);\n\t\tstatic_sprintf(update_policy_text, update_policy, lmprintf(MSG_179|MSG_RTF),\n\t\t\tlmprintf(MSG_180|MSG_RTF), lmprintf(MSG_181|MSG_RTF), lmprintf(MSG_182|MSG_RTF), lmprintf(MSG_183|MSG_RTF),\n\t\t\tlmprintf(MSG_184|MSG_RTF), lmprintf(MSG_185|MSG_RTF), lmprintf(MSG_186|MSG_RTF));\n\t\tSendMessageA(hPolicy, EM_SETTEXTEX, (WPARAM)&friggin_microsoft_unicode_amateurs, (LPARAM)update_policy_text);\n\t\tSendMessage(hPolicy, EM_SETSEL, -1, -1);\n\t\tSendMessage(hPolicy, EM_SETEVENTMASK, 0, ENM_LINK|ENM_REQUESTRESIZE);\n\t\tSendMessageA(hPolicy, EM_SETBKGNDCOLOR, 0, (LPARAM)GetSysColor(COLOR_BTNFACE));\n\t\tSendMessage(hPolicy, EM_REQUESTRESIZE, 0, 0);\n\t\tSetDarkModeForChild(hDlg);\n\t\tbreak;\n\tcase WM_NOTIFY:\n\t\tif ((((LPNMHDR)lParam)->code == EN_REQUESTRESIZE) && (!resized_already)) {\n\t\t\tresized_already = TRUE;\n\t\t\thPolicy = GetDlgItem(hDlg, IDC_POLICY);\n\t\t\tGetWindowRect(hPolicy, &rect);\n\t\t\tdy = rect.bottom - rect.top;\n\t\t\trsz = (REQRESIZE *)lParam;\n\t\t\tdy -= rsz->rc.bottom - rsz->rc.top + 6;\t// add the border\n\t\t\tResizeMoveCtrl(hDlg, hDlg, 0, 0, 0, -dy, 1.0f);\n\t\t\tResizeMoveCtrl(hDlg, hPolicy, 0, 0, 0, -dy, 1.0f);\n\t\t\tfor (i = 2; i < ARRAYSIZE(update_settings_reposition_ids); i++)\n\t\t\t\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, update_settings_reposition_ids[i]), 0, -dy, 0, 0, 1.0f);\n\t\t}\n\t\tbreak;\n\tcase WM_COMMAND:\n\t\tswitch (LOWORD(wParam)) {\n\t\tcase IDCLOSE:\n\t\tcase IDCANCEL:\n\t\t\treset_localization(IDD_UPDATE_POLICY);\n\t\t\tEndDialog(hDlg, LOWORD(wParam));\n\t\t\treturn (INT_PTR)TRUE;\n\t\tcase IDC_CHECK_NOW:\n\t\t\tCheckForUpdates(TRUE);\n\t\t\treturn (INT_PTR)TRUE;\n\t\tcase IDC_UPDATE_FREQUENCY:\n\t\t\tif (HIWORD(wParam) != CBN_SELCHANGE)\n\t\t\t\tbreak;\n\t\t\tfreq = (int32_t)ComboBox_GetCurItemData(hFrequency);\n\t\t\tWriteSetting32(SETTING_UPDATE_INTERVAL, (DWORD)freq);\n\t\t\tEnableWindow(hBeta, (freq >= 0) && is_x86_64);\n\t\t\treturn (INT_PTR)TRUE;\n\t\tcase IDC_INCLUDE_BETAS:\n\t\t\tif (HIWORD(wParam) != CBN_SELCHANGE)\n\t\t\t\tbreak;\n\t\t\tWriteSettingBool(SETTING_INCLUDE_BETAS, ComboBox_GetCurSel(hBeta) == 0);\n\t\t\treturn (INT_PTR)TRUE;\n\t\t}\n\t\tbreak;\n\t}\n\treturn (INT_PTR)FALSE;\n}\n\n/*\n * Use a thread to enable the download button as this may be a lengthy\n * operation due to the external download check.\n */\nstatic DWORD WINAPI CheckForFidoThread(LPVOID param)\n{\n\tstatic BOOL is_active = FALSE;\n\tLONG_PTR style;\n\tchar* loc = NULL;\n\tuint32_t i;\n\tuint64_t len;\n\tHWND hCtrl;\n\n\t// Because a user may switch language before this thread has completed,\n\t// we need to detect concurrency.\n\t// Checking on a static boolean is more than good enough for our purpose.\n\tif (is_active)\n\t\treturn -1;\n\tis_active = TRUE;\n\tsafe_free(fido_url);\n\tsafe_free(sbat_entries);\n\tsafe_free(sbat_level_txt);\n\tsafe_free(sb_active_txt);\n\tsafe_free(sb_revoked_txt);\n\n\t// Get the latest sbat_level.txt data while we're poking the network for Fido.\n\tlen = DownloadToFileOrBuffer(RUFUS_URL \"/sbat_level.txt\", NULL, (BYTE**)&sbat_level_txt, NULL, FALSE);\n\tif (len != 0 && len < 1 * KB) {\n\t\tsbat_entries = GetSbatEntries(sbat_level_txt);\n\t\tif (sbat_entries != NULL) {\n\t\t\tfor (i = 0; sbat_entries[i].product != NULL; i++);\n\t\t\tif (i > 0)\n\t\t\t\tuprintf(\"Found %d additional UEFI revocation filters from remote SBAT\", i);\n\t\t}\n\t}\n\n\t// Get the active Secure Boot certificate thumbprints\n\tlen = DownloadToFileOrBuffer(RUFUS_URL \"/sb_active.txt\", NULL, (BYTE**)&sb_active_txt, NULL, FALSE);\n\tif (len != 0 && len < 1 * KB) {\n\t\tsb_active_certs = GetThumbprintEntries(sb_active_txt);\n\t\tif (sb_active_certs != NULL) {\n\t\t\tuprintf(\"Found %d active Secure Boot certificate entries from remote\", sb_active_certs->count);\n\t\t}\n\t}\n\n\t// Get the revoked Secure Boot certificate thumbprints\n\tlen = DownloadToFileOrBuffer(RUFUS_URL \"/sb_revoked.txt\", NULL, (BYTE**)&sb_revoked_txt, NULL, FALSE);\n\tif (len != 0 && len < 1 * KB) {\n\t\tsb_revoked_certs = GetThumbprintEntries(sb_revoked_txt);\n\t\tif (sb_revoked_certs != NULL) {\n\t\t\tuprintf(\"Found %d revoked Secure Boot certificate entries from remote\", sb_revoked_certs->count);\n\t\t}\n\t}\n\n\t// Get the Fido URL from parsing a 'Fido.ver' on our server. This enables the use of different\n\t// Fido versions from different versions of Rufus, if needed, as opposed to always downloading\n\t// the latest release from GitHub, which may contain incompatible changes...\n\tlen = DownloadToFileOrBuffer(RUFUS_URL \"/Fido.ver\", NULL, (BYTE**)&loc, NULL, FALSE);\n\tif ((len == 0) || (len >= 4 * KB))\n\t\tgoto out;\n\n\tlen++;\t// DownloadToFileOrBuffer allocated an extra NUL character if needed\n\tfido_url = get_token_data_buffer(FIDO_VERSION, 1, loc, (size_t)len);\n\tif (safe_strncmp(fido_url, \"https://github.com/pbatard/Fido\", 31) != 0) {\n\t\tuprintf(\"WARNING: Download script URL %s is invalid ✗\", fido_url);\n\t\tsafe_free(fido_url);\n\t\tgoto out;\n\t}\n\tif (IsDownloadable(fido_url)) {\n\t\thCtrl = GetDlgItem(hMainDialog, IDC_SELECT);\n\t\tstyle = GetWindowLongPtr(hCtrl, GWL_STYLE);\n\t\tstyle |= BS_SPLITBUTTON;\n\t\tSetWindowLongPtr(hCtrl, GWL_STYLE, style);\n\t\tRedrawWindow(hCtrl, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW);\n\t\tInvalidateRect(hCtrl, NULL, TRUE);\n\t}\n\nout:\n\tsafe_free(loc);\n\tis_active = FALSE;\n\treturn 0;\n}\n\nvoid SetFidoCheck(void)\n{\n\t// Detect if we can use Fido, which depends on:\n\t// - Powershell being installed\n\t// - Rufus running in AppStore mode or update check being enabled\n\t// - URL for the script being reachable\n\tif ((ReadRegistryKey32(REGKEY_HKLM, \"Software\\\\Microsoft\\\\PowerShell\\\\1\\\\Install\") <= 0) &&\n\t\t(ReadRegistryKey32(REGKEY_HKLM, \"Software\\\\Microsoft\\\\PowerShell\\\\3\\\\Install\") <= 0)) {\n\t\tubprintf(\"Notice: The ISO download feature has been deactivated because \"\n\t\t\t\"a compatible PowerShell version was not detected on this system.\");\n\t\treturn;\n\t}\n\n\tif (!appstore_version && (ReadSetting32(SETTING_UPDATE_INTERVAL) <= 0)) {\n\t\tubprintf(\"Notice: The ISO download feature has been deactivated because \"\n\t\t\t\"'Check for updates' is disabled in your settings.\");\n\t\treturn;\n\t}\n\n\tCreateThread(NULL, 0, CheckForFidoThread, NULL, 0, NULL);\n}\n\n/*\n * Initial update check setup\n */\nBOOL SetUpdateCheck(void)\n{\n\tBOOL enable_updates;\n\tuint64_t commcheck = GetTickCount64();\n\tchar filename[MAX_PATH] = \"\", exename[] = APPLICATION_NAME \".exe\";\n\tsize_t fn_len, exe_len;\n\n\t// Test if we can read and write settings. If not, forget it.\n\tWriteSetting64(SETTING_COMM_CHECK, commcheck);\n\tif (ReadSetting64(SETTING_COMM_CHECK) != commcheck)\n\t\treturn FALSE;\n\n\t// If the update interval is not set, this is the first time we run so prompt the user\n\tif (ReadSetting32(SETTING_UPDATE_INTERVAL) == 0) {\n\t\tnotification_info more_info;\n\n\t\t// Add a hack for people who'd prefer the app not to prompt about update settings on first run.\n\t\t// If the executable is called \"rufus.exe\", without version, we disable the prompt\n\t\tGetModuleFileNameU(NULL, filename, sizeof(filename));\n\t\tfn_len = safe_strlen(filename);\n\t\texe_len = safe_strlen(exename);\n#if !defined(_DEBUG)\t// Don't allow disabling update prompt, unless it's a release\n\t\tif ((fn_len > exe_len) && (safe_stricmp(&filename[fn_len-exe_len], exename) == 0)) {\n\t\t\tuprintf(\"Short name used - Disabling initial update policy prompt\\n\");\n\t\t\tenable_updates = TRUE;\n\t\t} else {\n#endif\n\t\t\tmore_info.id = IDD_UPDATE_POLICY;\n\t\t\tmore_info.callback = UpdateCallback;\n\t\t\tenable_updates = (NotificationEx(MB_ICONQUESTION | MB_YESNO, NULL, &more_info, lmprintf(MSG_004), lmprintf(MSG_005)) == IDYES);\n#if !defined(_DEBUG)\n\t\t}\n#endif\n\t\tif (!enable_updates) {\n\t\t\tWriteSetting32(SETTING_UPDATE_INTERVAL, -1);\n\t\t\treturn FALSE;\n\t\t}\n\t\t// If the user hasn't set the interval in the dialog, set to default\n\t\tif ( (ReadSetting32(SETTING_UPDATE_INTERVAL) == 0) ||\n\t\t\t (ReadSetting32(SETTING_UPDATE_INTERVAL) == -1) )\n\t\t\tWriteSetting32(SETTING_UPDATE_INTERVAL, 86400);\n\t}\n\tSetFidoCheck();\n\treturn TRUE;\n}\n\nvoid CreateStaticFont(HDC hDC, HFONT* hFont, BOOL underlined)\n{\n\tTEXTMETRIC tm;\n\tLOGFONT lf;\n\n\tif (*hFont != NULL)\n\t\treturn;\n\tGetTextMetrics(hDC, &tm);\n\tlf.lfHeight = tm.tmHeight;\n\tlf.lfWidth = 0;\n\tlf.lfEscapement = 0;\n\tlf.lfOrientation = 0;\n\tlf.lfWeight = tm.tmWeight;\n\tlf.lfItalic = tm.tmItalic;\n\tlf.lfUnderline = underlined;\n\tlf.lfStrikeOut = tm.tmStruckOut;\n\tlf.lfCharSet = tm.tmCharSet;\n\tlf.lfOutPrecision = OUT_DEFAULT_PRECIS;\n\tlf.lfClipPrecision = CLIP_DEFAULT_PRECIS;\n\tlf.lfQuality = DEFAULT_QUALITY;\n\tlf.lfPitchAndFamily = tm.tmPitchAndFamily;\n\tGetTextFace(hDC, LF_FACESIZE, lf.lfFaceName);\n\t*hFont = CreateFontIndirect(&lf);\n}\n\nvoid SetHyperLinkFont(HWND hWnd, HDC hDC, HFONT* hFont, BOOL underlined)\n{\n\tstatic BOOL use_static_font = FALSE;\n\tLOGFONT lf = { 0 };\n\tHFONT hFontTmp = NULL;\n\n\tif (*hFont == NULL) {\n\t\thFontTmp = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0);\n\t\tif (hFontTmp != NULL) {\n\t\t\tGetObject(hFontTmp, sizeof(LOGFONT), &lf);\n\t\t\tuse_static_font = FALSE;\n\t\t} else {\n\t\t\tNONCLIENTMETRICS ncm = { 0 };\n\t\t\tncm.cbSize = sizeof(NONCLIENTMETRICS);\n\t\t\tif (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0)) {\n\t\t\t\tlf = ncm.lfStatusFont;\n\t\t\t\tuse_static_font = FALSE;\n\t\t\t} else {\n\t\t\t\tCreateStaticFont(hDC, hFont, underlined);\n\t\t\t\tuse_static_font = TRUE;\n\t\t\t}\n\t\t}\n\t\tif (!use_static_font) {\n\t\t\tlf.lfUnderline = underlined;\n\t\t\t*hFont = CreateFontIndirect(&lf);\n\t\t}\n\t}\n\tif (!use_static_font)\n\t\tSendMessage(hWnd, WM_SETFONT, (WPARAM)*hFont, TRUE);\n}\n\n/*\n * Work around the limitations of edit control, to display a hand cursor for hyperlinks\n * NB: The LTEXT control must have SS_NOTIFY attribute for this to work\n */\nINT_PTR CALLBACK update_subclass_callback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tswitch (message)\n\t{\n\tcase WM_SETCURSOR:\n\t\tif ((HWND)wParam == GetDlgItem(hDlg, IDC_WEBSITE)) {\n\t\t\tSetCursor(LoadCursor(NULL, IDC_HAND));\n\t\t\treturn (INT_PTR)TRUE;\n\t\t}\n\t\tbreak;\n\t}\n\treturn CallWindowProc(update_original_proc, hDlg, message, wParam, lParam);\n}\n\n/*\n * New version notification dialog\n */\nINT_PTR CALLBACK NewVersionCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tchar cmdline[] = APPLICATION_NAME \" -w 150\";\n\tstatic char* filepath = NULL;\n\tstatic int download_status = 0;\n\tstatic HFONT hHyperlinkFont = NULL;\n\tstatic HANDLE hThread = NULL;\n\tHWND hNotes;\n\tLONG err;\n\tDWORD exit_code;\n\tSTARTUPINFOA si;\n\tPROCESS_INFORMATION pi;\n\tEXT_DECL(dl_ext, NULL, __VA_GROUP__(\"*.exe\"), __VA_GROUP__(lmprintf(MSG_037)));\n\n\tswitch (message) {\n\tcase WM_INITDIALOG:\n\t\tSetDarkModeForDlg(hDlg);\n\t\tapply_localization(IDD_NEW_VERSION, hDlg);\n\t\tdownload_status = 0;\n\t\tSetTitleBarIcon(hDlg);\n\t\tCenterDialog(hDlg, NULL);\n\t\t// Subclass the callback so that we can change the cursor\n\t\tupdate_original_proc = (WNDPROC)SetWindowLongPtr(hDlg, GWLP_WNDPROC, (LONG_PTR)update_subclass_callback);\n\t\thNotes = GetDlgItem(hDlg, IDC_RELEASE_NOTES);\n\t\tSendMessage(hNotes, EM_AUTOURLDETECT, 1, 0);\n\t\tSendMessageA(hNotes, EM_SETTEXTEX, (WPARAM)&friggin_microsoft_unicode_amateurs, (LPARAM)update.release_notes);\n\t\tSendMessage(hNotes, EM_SETSEL, -1, -1);\n\t\tSendMessage(hNotes, EM_SETEVENTMASK, 0, ENM_LINK);\n\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_YOUR_VERSION), lmprintf(MSG_018,\n\t\t\trufus_version[0], rufus_version[1], rufus_version[2]));\n\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_LATEST_VERSION), lmprintf(MSG_019,\n\t\t\tupdate.version[0], update.version[1], update.version[2]));\n\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_DOWNLOAD_URL), update.download_url);\n\t\tSendMessage(GetDlgItem(hDlg, IDC_PROGRESS), PBM_SETRANGE, 0, (MAX_PROGRESS<<16) & 0xFFFF0000);\n\t\tif (update.download_url == NULL)\n\t\t\tEnableWindow(GetDlgItem(hDlg, IDC_DOWNLOAD), FALSE);\n\t\tResizeButtonHeight(hDlg, IDCANCEL);\n\t\tSetDarkModeForChild(hDlg);\n\t\tSubclassProgressBarControl(GetDlgItem(hDlg, IDC_PROGRESS));\n\t\tSetHyperLinkFont(GetDlgItem(hDlg, IDC_WEBSITE), (HDC)wParam, &hHyperlinkFont, TRUE);\n\t\tbreak;\n\tcase WM_CTLCOLORSTATIC:\n\t\tif ((HWND)lParam != GetDlgItem(hDlg, IDC_WEBSITE))\n\t\t\treturn FALSE;\n\t\t// Change the font for the hyperlink\n\t\tSetBkMode((HDC)wParam, TRANSPARENT);\n\t\tSelectObject((HDC)wParam, hHyperlinkFont);\n\t\tSetTextColor((HDC)wParam, GetSysColor(COLOR_HOTLIGHT));\n\t\treturn (INT_PTR)GetSysColorBrush(COLOR_BTNFACE);\n\tcase WM_NCDESTROY:\n\t\tsafe_delete_object(hHyperlinkFont);\n\t\tbreak;\n\tcase WM_COMMAND:\n\t\tswitch (LOWORD(wParam)) {\n\t\tcase IDCLOSE:\n\t\tcase IDCANCEL:\n\t\t\tif (download_status != 1) {\n\t\t\t\treset_localization(IDD_NEW_VERSION);\n\t\t\t\tsafe_free(filepath);\n\t\t\t\tEndDialog(hDlg, LOWORD(wParam));\n\t\t\t}\n\t\t\treturn (INT_PTR)TRUE;\n\t\tcase IDC_WEBSITE:\n\t\t\tShellExecuteA(hDlg, \"open\", RUFUS_URL, NULL, NULL, SW_SHOWNORMAL);\n\t\t\tbreak;\n\t\tcase IDC_DOWNLOAD:\t// Also doubles as abort and launch function\n\t\t\tswitch(download_status) {\n\t\t\tcase 1:\t\t// Abort\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_CANCELLED);\n\t\t\t\tdownload_status = 0;\n\t\t\t\thThread = NULL;\n\t\t\t\tbreak;\n\t\t\tcase 2:\t\t// Launch newer version and close this one\n\t\t\t\tif ((hThread == NULL) || (!GetExitCodeThread(hThread, &exit_code)) || (exit_code == 0)) {\n\t\t\t\t\thThread = NULL;\n\t\t\t\t\tEnableWindow(GetDlgItem(hDlg, IDC_DOWNLOAD), FALSE);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\thThread = NULL;\n\t\t\t\tEnableWindow(GetDlgItem(hDlg, IDC_DOWNLOAD), FALSE);\n\t\t\t\t// Add a 1.5 sec delay, with coundown, on account of antivirus scanners\n\t\t\t\tSetWindowTextA(GetDlgItem(hDlg, IDC_DOWNLOAD), \"3\");\n\t\t\t\tSleep(500);\n\t\t\t\tSetWindowTextA(GetDlgItem(hDlg, IDC_DOWNLOAD), \"2\");\n\t\t\t\tSleep(500);\n\t\t\t\tSetWindowTextA(GetDlgItem(hDlg, IDC_DOWNLOAD), \"1\");\n\t\t\t\tSleep(500);\n\t\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_DOWNLOAD), lmprintf(MSG_142));\n\n\t\t\t\terr = ValidateSignature(hDlg, filepath);\n\t\t\t\tif ((err != NO_ERROR) && ((force_update < 2) || (err != TRUST_E_TIME_STAMP))) {\n\t\t\t\t\t// Unconditionally delete the download\n\t\t\t\t\tDeleteFileU(filepath);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tmemset(&si, 0, sizeof(si));\n\t\t\t\tmemset(&pi, 0, sizeof(pi));\n\t\t\t\tsi.cb = sizeof(si);\n\t\t\t\tif (!CreateProcessU(filepath, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {\n\t\t\t\t\tPrintInfo(0, MSG_214);\n\t\t\t\t\tuprintf(\"Failed to launch new application: %s\", WindowsErrorString());\n\t\t\t\t} else {\n\t\t\t\t\tPrintInfo(0, MSG_213);\n\t\t\t\t\tPostMessage(hDlg, WM_COMMAND, (WPARAM)IDCLOSE, 0);\n\t\t\t\t\tPostMessage(hMainDialog, WM_CLOSE, 0, 0);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\t// Download\n\t\t\t\tif (update.download_url == NULL) {\n\t\t\t\t\tuprintf(\"Could not get download URL\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdl_ext.filename = PathFindFileNameU(update.download_url);\n\t\t\t\tfilepath = FileDialog(TRUE, app_dir, &dl_ext, NULL);\n\t\t\t\tif (filepath == NULL) {\n\t\t\t\t\tuprintf(\"Could not get save path\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// Opening the File Dialog will make us lose tabbing focus - set it back\n\t\t\t\tSendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDC_DOWNLOAD), TRUE);\n\t\t\t\thThread = DownloadSignedFileThreaded(update.download_url, filepath, hDlg, TRUE);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn (INT_PTR)TRUE;\n\t\t}\n\t\tbreak;\n\tcase UM_PROGRESS_INIT:\n\t\tEnableWindow(GetDlgItem(hDlg, IDCANCEL), FALSE);\n\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_DOWNLOAD), lmprintf(MSG_038));\n\t\tErrorStatus = 0;\n\t\tdownload_status = 1;\n\t\treturn (INT_PTR)TRUE;\n\tcase UM_PROGRESS_EXIT:\n\t\tEnableWindow(GetDlgItem(hDlg, IDCANCEL), TRUE);\n\t\tif (wParam != 0) {\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_DOWNLOAD), lmprintf(MSG_039));\n\t\t\tdownload_status = 2;\n\t\t} else {\n\t\t\tSetWindowTextU(GetDlgItem(hDlg, IDC_DOWNLOAD), lmprintf(MSG_040));\n\t\t\t// Disable the download button if we found an invalid signature\n\t\t\tEnableWindow(GetDlgItem(hDlg, IDC_DOWNLOAD),\n\t\t\t\tErrorStatus != RUFUS_ERROR(APPERR(ERROR_BAD_SIGNATURE)));\n\t\t\tdownload_status = 0;\n\t\t}\n\t\treturn (INT_PTR)TRUE;\n\t}\n\treturn (INT_PTR)FALSE;\n}\n\nvoid DownloadNewVersion(void)\n{\n\tMyDialogBox(hMainInstance, IDD_NEW_VERSION, hMainDialog, NewVersionCallback);\n}\n\nvoid SetTitleBarIcon(HWND hDlg)\n{\n\tint i16, s16 = 0, s32 = 0;\n\n\tif (hSmallIcon == NULL || hBigIcon == NULL) {\n\t\t// High DPI scaling\n\t\ti16 = GetSystemMetrics(SM_CXSMICON);\n\t\t// Adjust icon size lookup\n\t\ts16 = i16;\n\t\ts32 = (int)(32.0f * fScale);\n\t\tif (s16 >= 54)\n\t\t\ts16 = 64;\n\t\telse if (s16 >= 40)\n\t\t\ts16 = 48;\n\t\telse if (s16 >= 28)\n\t\t\ts16 = 32;\n\t\telse if (s16 >= 20)\n\t\t\ts16 = 24;\n\t\tif (s32 >= 54)\n\t\t\ts32 = 64;\n\t\telse if (s32 >= 40)\n\t\t\ts32 = 48;\n\t\telse if (s32 >= 28)\n\t\t\ts32 = 32;\n\t\telse if (s32 >= 20)\n\t\t\ts32 = 24;\n\t}\n\n\t// Create the title bar icon\n\tif (hSmallIcon == NULL)\n\t\thSmallIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, s16, s16, 0);\n\tSendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hSmallIcon);\n\tif (hBigIcon == NULL)\n\t\thBigIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, s32, s32, 0);\n\tSendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hBigIcon);\n}\n\n// Return the onscreen size of the text displayed by a control\nSIZE GetTextSize(HWND hCtrl, char* txt)\n{\n\tSIZE sz = {0, 0};\n\tHDC hDC;\n\twchar_t *wstr = NULL;\n\tint len;\n\tHFONT hFont;\n\n\t// Compute the size of the text\n\thDC = GetDC(hCtrl);\n\tif (hDC == NULL)\n\t\tgoto out;\n\thFont = (HFONT)SendMessageA(hCtrl, WM_GETFONT, 0, 0);\n\tif (hFont == NULL)\n\t\tgoto out;\n\tSelectObject(hDC, hFont);\n\tif (txt == NULL) {\n\t\tlen = GetWindowTextLengthW(hCtrl);\n\t\tif (len <= 0)\n\t\t\tgoto out;\n\t\twstr = calloc(len + 1, sizeof(wchar_t));\n\t\tif (wstr == NULL)\n\t\t\tgoto out;\n\t\tif (GetWindowTextW(hCtrl, wstr, len + 1) > 0)\n\t\t\tGetTextExtentPoint32W(hDC, wstr, len, &sz);\n\t} else {\n\t\twstr = utf8_to_wchar(txt);\n\t\tif (wstr != NULL)\n\t\t\tGetTextExtentPoint32W(hDC, wstr, (int)wcslen(wstr), &sz);\n\t}\nout:\n\tsafe_free(wstr);\n\tsafe_release_dc(hCtrl, hDC);\n\treturn sz;\n}\n\n/*\n * The following is used to work around dialog template limitations when switching from LTR to RTL\n * or switching the font. This avoids having to multiply similar templates in the RC.\n * TODO: Can we use http://stackoverflow.com/questions/6057239/which-font-is-the-default-for-mfc-dialog-controls?\n  */\n\n// Produce a dialog template from our RC, and update its RTL and Font settings dynamically\n// See http://blogs.msdn.com/b/oldnewthing/archive/2004/06/21/163596.aspx as well as\n// https://msdn.microsoft.com/en-us/library/windows/desktop/ms645389.aspx for a description\n// of the Dialog structure\nLPCDLGTEMPLATE GetDialogTemplate(int Dialog_ID)\n{\n\tint i;\n\tconst char thai_id[] = \"th-TH\";\n\tsize_t len;\n\tDWORD size = 0;\n\tDWORD* dwBuf;\n\tWCHAR* wBuf;\n\tLPCDLGTEMPLATE rcTemplate = (LPCDLGTEMPLATE) GetResource(hMainInstance, MAKEINTRESOURCEA(Dialog_ID),\n\t\t_RT_DIALOG, get_name_from_id(Dialog_ID), &size, TRUE);\n\n\tif ((size == 0) || (rcTemplate == NULL)) {\n\t\tsafe_free(rcTemplate);\n\t\treturn NULL;\n\t}\n\tif (right_to_left_mode) {\n\t\t// Add the RTL styles into our RC copy, so that we don't have to multiply dialog definitions in the RC\n\t\tdwBuf = (DWORD*)rcTemplate;\n\t\tdwBuf[2] = WS_EX_APPWINDOW | WS_EX_LAYOUTRTL;\n\t}\n\n\t// All our dialogs are set to use 'Segoe UI Symbol' by default:\n\t// 1. So that we can replace the font name with 'Segoe UI'\n\t// 2. So that Thai displays properly on RTF controls as it won't work with regular\n\t// 'Segoe UI'... but Cyrillic won't work with 'Segoe UI Symbol'\n\n\t// If 'Segoe UI Symbol' is available, and we are using Thai, we're done here\n\tif (IsFontAvailable(\"Segoe UI Symbol\") && (selected_locale != NULL)\n\t\t&& (safe_strcmp(selected_locale->txt[0], thai_id) == 0))\n\t\treturn rcTemplate;\n\n\t// 'Segoe UI Symbol' cannot be used => Fall back to the best we have\n\twBuf = (WCHAR*)rcTemplate;\n\twBuf = &wBuf[14];\t// Move to class name\n\t// Skip class name and title\n\tfor (i = 0; i<2; i++) {\n\t\tif (*wBuf == 0xFFFF)\n\t\t\twBuf = &wBuf[2];\t// Ordinal\n\t\telse\n\t\t\twBuf = &wBuf[wcslen(wBuf) + 1]; // String\n\t}\n\t// NB: to change the font size to 9, you can use\n\t// wBuf[0] = 0x0009;\n\twBuf = &wBuf[3];\n\t// Make sure we are where we want to be and adjust the font\n\tif (wcscmp(L\"Segoe UI Symbol\", wBuf) == 0) {\n\t\tuintptr_t src, dst, start = (uintptr_t)rcTemplate;\n\t\t// We can't simply zero the characters we don't want, as the size of the font\n\t\t// string determines the next item lookup. So we must memmove the remaining of\n\t\t// our buffer. Oh, and those items are DWORD aligned.\n\t\t// 'Segoe UI Symbol' -> 'Segoe UI'\n\t\twBuf[8] = 0;\n\t\tlen = wcslen(wBuf);\n\t\twBuf[len + 1] = 0;\n\t\tdst = (uintptr_t)&wBuf[len + 2];\n\t\tdst &= ~3;\n\t\tsrc = (uintptr_t)&wBuf[17];\n\t\tsrc &= ~3;\n\t\tmemmove((void*)dst, (void*)src, size - (src - start));\n\t} else {\n\t\tuprintf(\"Could not locate font for %s!\", get_name_from_id(Dialog_ID));\n\t}\n\treturn rcTemplate;\n}\n\nHWND MyCreateDialog(HINSTANCE hInstance, int Dialog_ID, HWND hWndParent, DLGPROC lpDialogFunc)\n{\n\tLPCDLGTEMPLATE rcTemplate = GetDialogTemplate(Dialog_ID);\n\tassert(rcTemplate != NULL);\n\tHWND hDlg = CreateDialogIndirect(hInstance, rcTemplate, hWndParent, lpDialogFunc);\n\tsafe_free(rcTemplate);\n\treturn hDlg;\n}\n\nINT_PTR MyDialogBox(HINSTANCE hInstance, int Dialog_ID, HWND hWndParent, DLGPROC lpDialogFunc)\n{\n\tINT_PTR ret;\n\tLPCDLGTEMPLATE rcTemplate = GetDialogTemplate(Dialog_ID);\n\n\t// A DialogBox doesn't handle reduce/restore so it won't pass restore messages to the\n\t// main dialog if the main dialog was minimized. This can result in situations where the\n\t// user cannot restore the main window if a new dialog prompt was triggered while the\n\t// main dialog was reduced => Ensure the main dialog is visible before we display anything.\n\tShowWindow(hMainDialog, SW_NORMAL);\n\n\tassert(rcTemplate != NULL);\n\tret = DialogBoxIndirect(hMainInstance, rcTemplate, hWndParent, lpDialogFunc);\n\tsafe_free(rcTemplate);\n\treturn ret;\n}\n\n/*\n * The following function calls are used to automatically detect and close the native\n * Windows format prompt \"You must format the disk in drive X:\". To do that, we use\n * an event hook that gets triggered whenever a window is placed in the foreground.\n * In that hook, we look for a dialog that has style WS_POPUPWINDOW and has the relevant\n * title. However, because the title in itself is too generic (the expectation is that\n * it will be \"Microsoft Windows\") we also enumerate all the child controls from that\n * prompt, using another callback, until we find one that contains the text we expect\n * for the \"Format disk\" button.\n * Oh, and since all of these strings are localized, we must first pick them up from\n * the relevant mui's.\n */\nstatic BOOL CALLBACK AlertPromptCallback(HWND hWnd, LPARAM lParam)\n{\n\tchar str[128];\n\tBOOL *found = (BOOL*)lParam;\n\n\tif (GetWindowTextU(hWnd, str, sizeof(str)) == 0)\n\t\treturn TRUE;\n\tif (strcmp(str, alert_data.button_str) == 0)\n\t\t*found = TRUE;\n\treturn TRUE;\n}\n\nstatic void CALLBACK AlertPromptHook(HWINEVENTHOOK hWinEventHook, DWORD Event, HWND hWnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime)\n{\n\tchar str[128];\n\tBOOL found;\n\n\tif (Event == EVENT_SYSTEM_FOREGROUND) {\n\t\tif (GetWindowLongPtr(hWnd, GWL_STYLE) & WS_POPUPWINDOW) {\n\t\t\tstr[0] = 0;\n\t\t\tGetWindowTextU(hWnd, str, sizeof(str));\n\t\t\tif (strcmp(str, alert_data.title_str[0]) == 0) {\n\t\t\t\tfound = FALSE;\n\t\t\t\tEnumChildWindows(hWnd, AlertPromptCallback, (LPARAM)&found);\n\t\t\t\tif (found) {\n\t\t\t\t\tSendMessage(hWnd, WM_COMMAND, (WPARAM)IDCANCEL, (LPARAM)0);\n\t\t\t\t\tuprintf(\"Closed Windows format prompt\");\n\t\t\t\t}\n\t\t\t} else if ((strcmp(str, alert_data.title_str[1]) == 0) && (hWnd != hFidoDlg)) {\n\t\t\t\t// A wild Fido dialog appeared! => Keep track of its handle and center it\n\t\t\t\thFidoDlg = hWnd;\n\t\t\t\tCenterDialog(hWnd, hMainDialog);\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid SetAlertPromptMessages(void)\n{\n\tHMODULE hMui;\n\tchar mui_path[MAX_PATH];\n\n\t// Fetch the localized strings in the relevant MUI\n\t// Must use sysnative_dir rather than system_dir as we may not find the MUI's otherwise\n\t// Also don't bother with LibLibraryEx() since we have a full path here.\n\tstatic_sprintf(mui_path, \"%s\\\\%s\\\\shell32.dll.mui\", sysnative_dir, ToLocaleName(GetUserDefaultUILanguage()));\n\thMui = LoadLibraryU(mui_path);\n\tif (hMui != NULL) {\n\t\t// 4097 = \"You need to format the disk in drive %c: before you can use it.\" (dialog text)\n\t\t// 4125 = \"Microsoft Windows\" (dialog title)\n\t\t// 4126 = \"Format disk\" (button)\n\t\tif (LoadStringU(hMui, 4125, alert_data.title_str[0], sizeof(alert_data.title_str[0])) <= 0) {\n\t\t\tstatic_strcpy(alert_data.title_str[0], \"Microsoft Windows\");\n\t\t\tuprintf(\"WARNING: Could not locate localized format prompt title string in '%s': %s\", mui_path, WindowsErrorString());\n\t\t}\n\t\tif (LoadStringU(hMui, 4126, alert_data.button_str, sizeof(alert_data.button_str)) <= 0) {\n\t\t\tstatic_strcpy(alert_data.button_str, \"Format disk\");\n\t\t\tuprintf(\"WARNING: Could not locate localized format prompt button string in '%s': %s\", mui_path, WindowsErrorString());\n\t\t}\n\t\tFreeLibrary(hMui);\n\t}\n\tstatic_strcpy(alert_data.title_str[1], lmprintf(MSG_149));\n}\n\nBOOL SetAlertPromptHook(void)\n{\n\tif (alert_data.weh != NULL)\n\t\treturn TRUE;\t// No need to set again if active\n\talert_data.weh = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, NULL,\n\t\tAlertPromptHook, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);\n\treturn (alert_data.weh != NULL);\n}\n\nvoid ClrAlertPromptHook(void) {\n\tUnhookWinEvent(alert_data.weh);\n\talert_data.weh = NULL;\n}\n\nvoid FlashTaskbar(HANDLE handle)\n{\n\tFLASHWINFO pf;\n\n\tif (handle == NULL)\n\t\treturn;\n\tpf.cbSize = sizeof(FLASHWINFO);\n\tpf.hwnd = handle;\n\t// Could also use FLASHW_ALL to flash the main dialog)\n\tpf.dwFlags = FLASHW_TIMER | FLASHW_TRAY;\n\tpf.uCount = 5;\n\tpf.dwTimeout = 75;\n\tFlashWindowEx(&pf);\n}\n\n// https://docs.microsoft.com/en-us/globalization/localizability/mirroring-in-win32\n// Note: This function *destroys* the original icon\nHICON CreateMirroredIcon(HICON hiconOrg)\n{\n\tHDC hdcScreen, hdcBitmap, hdcMask = NULL;\n\tHBITMAP hbm, hbmMask, hbmOld, hbmOldMask;\n\tBITMAP bm;\n\tICONINFO ii;\n\tHICON hicon = NULL;\n\thdcBitmap = CreateCompatibleDC(NULL);\n\tif (hdcBitmap) {\n\t\thdcMask = CreateCompatibleDC(NULL);\n\t\tif (hdcMask) {\n\t\t\tSetLayout(hdcBitmap, LAYOUT_RTL);\n\t\t\tSetLayout(hdcMask, LAYOUT_RTL);\n\t\t} else {\n\t\t\tDeleteDC(hdcBitmap);\n\t\t\thdcBitmap = NULL;\n\t\t}\n\t}\n\thdcScreen = GetDC(NULL);\n\tif (hdcScreen) {\n\t\tif (hdcBitmap && hdcMask) {\n\t\t\tif (hiconOrg) {\n\t\t\t\tif (GetIconInfo(hiconOrg, &ii) && GetObject(ii.hbmColor, sizeof(BITMAP), &bm)) {\n\t\t\t\t\t// Do the cleanup for the bitmaps.\n\t\t\t\t\tDeleteObject(ii.hbmMask);\n\t\t\t\t\tDeleteObject(ii.hbmColor);\n\t\t\t\t\tii.hbmMask = ii.hbmColor = NULL;\n\t\t\t\t\thbm = CreateCompatibleBitmap(hdcScreen, bm.bmWidth, bm.bmHeight);\n\t\t\t\t\thbmMask = CreateBitmap(bm.bmWidth, bm.bmHeight, 1, 1, NULL);\n\t\t\t\t\thbmOld = (HBITMAP)SelectObject(hdcBitmap, hbm);\n\t\t\t\t\thbmOldMask = (HBITMAP)SelectObject(hdcMask, hbmMask);\n\t\t\t\t\tDrawIconEx(hdcBitmap, 0, 0, hiconOrg, bm.bmWidth, bm.bmHeight, 0, NULL, DI_IMAGE);\n\t\t\t\t\tDrawIconEx(hdcMask, 0, 0, hiconOrg, bm.bmWidth, bm.bmHeight, 0, NULL, DI_MASK);\n\t\t\t\t\tSelectObject(hdcBitmap, hbmOld);\n\t\t\t\t\tSelectObject(hdcMask, hbmOldMask);\n\n\t\t\t\t\t// Create the new mirrored icon and delete bitmaps\n\t\t\t\t\tii.hbmMask = hbmMask;\n\t\t\t\t\tii.hbmColor = hbm;\n\t\t\t\t\thicon = CreateIconIndirect(&ii);\n\t\t\t\t\tDeleteObject(hbm);\n\t\t\t\t\tDeleteObject(hbmMask);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tReleaseDC(NULL, hdcScreen);\n\t}\n\n\tif (hdcBitmap)\n\t\tDeleteDC(hdcBitmap);\n\tif (hdcMask)\n\t\tDeleteDC(hdcMask);\n\tDestroyIcon(hiconOrg);\n\treturn hicon;\n}\n\n#ifdef RUFUS_TEST\nstatic __inline LPWORD lpwAlign(LPWORD addr)\n{\n\treturn (LPWORD)((((uintptr_t)addr) + 3) & (~3));\n}\n\nINT_PTR CALLBACK SelectionDynCallback(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tint r = -1;\n\tswitch (message) {\n\tcase WM_INITDIALOG:\n\t\treturn (INT_PTR)TRUE;\n\n\tcase WM_COMMAND:\n\t\tswitch (LOWORD(wParam)) {\n\t\tcase IDOK:\n\t\t\tr = 0;\n\t\tcase IDCANCEL:\n\t\t\tEndDialog(hwndDlg, r);\n\t\t\treturn (INT_PTR)TRUE;\n\t\t}\n\t}\n\treturn FALSE;\n}\n\nint SelectionDyn(char* title, char* message, char** szChoice, int nChoices)\n{\n#define ID_RADIO  12345\n\tLPCWSTR lpwszTypeFace = L\"MS Shell Dlg\";\n\tLPDLGTEMPLATEA lpdt;\n\tLPDLGITEMTEMPLATEA lpdit;\n\tLPCWSTR lpwszCaption;\n\tLPWORD lpw;\n\tLPWSTR lpwsz;\n\tint i, ret, nchar;\n\n\tlpdt = (LPDLGTEMPLATE)calloc(512 + nChoices * 256, 1);\n\n\t// Set up a dialog window\n\tlpdt->style = WS_POPUP | WS_BORDER | WS_SYSMENU | WS_CAPTION | DS_MODALFRAME | DS_CENTER | DS_SHELLFONT;\n\tlpdt->cdit = 2 + nChoices;\n\tlpdt->x = 10;\n\tlpdt->y = 10;\n\tlpdt->cx = 300;\n\tlpdt->cy = 100;\n\n\t// https://msdn.microsoft.com/en-us/library/windows/desktop/ms645394.aspx:\n\t// In a standard template for a dialog box, the DLGTEMPLATE structure is always immediately followed by\n\t// three variable-length arrays that specify the menu, class, and title for the dialog box.\n\t// When the DS_SETFONT style is specified, these arrays are also followed by a 16-bit value specifying\n\t// point size and another variable-length array specifying a typeface name. Each array consists of one\n\t// or more 16-bit elements. The menu, class, title, and font arrays must be aligned on WORD boundaries.\n\tlpw = (LPWORD)(&lpdt[1]);\n\t*lpw++ = 0;\t\t// No menu\n\t*lpw++ = 0;\t\t// Default dialog class\n\tlpwsz = (LPWSTR)lpw;\n\tnchar = MultiByteToWideChar(CP_UTF8, 0, title, -1, lpwsz, 50);\n\tlpw += nchar;\n\n\t// Set point size and typeface name if required\n\tif (lpdt->style & (DS_SETFONT | DS_SHELLFONT)) {\n\t\t*lpw++ = 8;\n\t\tfor (lpwsz = (LPWSTR)lpw, lpwszCaption = lpwszTypeFace; (*lpwsz++ = *lpwszCaption++) != 0; );\n\t\tlpw = (LPWORD)lpwsz;\n\t}\n\n\t// Add an OK button\n\tlpw = lpwAlign(lpw);\n\tlpdit = (LPDLGITEMTEMPLATE)lpw;\n\tlpdit->style = WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON;\n\tlpdit->x = 10;\n\tlpdit->y = 70;\n\tlpdit->cx = 50;\n\tlpdit->cy = 14;\n\tlpdit->id = IDOK;\n\n\tlpw = (LPWORD)(&lpdit[1]);\n\t*lpw++ = 0xFFFF;\n\t*lpw++ = 0x0080;\t// Button class\n\n\tlpwsz = (LPWSTR)lpw;\n\tnchar = MultiByteToWideChar(CP_UTF8, 0, \"OK\", -1, lpwsz, 50);\n\tlpw += nchar;\n\t*lpw++ = 0;\t\t// No creation data\n\n\t\t\t\t\t// Add a Cancel button\n\tlpw = lpwAlign(lpw);\n\tlpdit = (LPDLGITEMTEMPLATE)lpw;\n\tlpdit->x = 90;\n\tlpdit->y = 70;\n\tlpdit->cx = 50;\n\tlpdit->cy = 14;\n\tlpdit->id = IDCANCEL;\n\tlpdit->style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON;\n\n\tlpw = (LPWORD)(&lpdit[1]);\n\t*lpw++ = 0xFFFF;\n\t*lpw++ = 0x0080;\n\n\tlpwsz = (LPWSTR)lpw;\n\tnchar = MultiByteToWideChar(CP_UTF8, 0, lmprintf(MSG_007), -1, lpwsz, 50);\n\tlpw += nchar;\n\t*lpw++ = 0;\n\n\t// Add radio buttons\n\tfor (i = 0; i < nChoices; i++) {\n\t\tlpw = lpwAlign(lpw);\n\t\tlpdit = (LPDLGITEMTEMPLATE)lpw;\n\t\tlpdit->x = 10;\n\t\tlpdit->y = 10 + 15 * i;\n\t\tlpdit->cx = 40;\n\t\tlpdit->cy = 20;\n\t\tlpdit->id = ID_RADIO;\n\t\tlpdit->style = WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | (i == 0 ? WS_GROUP : 0);\n\n\t\tlpw = (LPWORD)(&lpdit[1]);\n\t\t*lpw++ = 0xFFFF;\n\t\t*lpw++ = 0x0080;\n\n\t\tlpwsz = (LPWSTR)lpw;\n\t\tnchar = MultiByteToWideChar(CP_UTF8, 0, szChoice[i], -1, lpwsz, 150);\n\t\tlpw += nchar;\n\t\t*lpw++ = 0;\n\t}\n\n\tret = (int)DialogBoxIndirect(hMainInstance, (LPDLGTEMPLATE)lpdt, hMainDialog, (DLGPROC)SelectionDynCallback);\n\tfree(lpdt);\n\treturn ret;\n}\n#endif\n"
  },
  {
    "path": "src/syslinux/.editorconfig",
    "content": "[*]\nindent_size = 4\ntab_width = 8\n"
  },
  {
    "path": "src/syslinux/libfat/Makefile.am",
    "content": "noinst_LIBRARIES = libfat.a\n\nlibfat_a_SOURCES = cache.c fatchain.c open.c searchdir.c dumpdir.c\nlibfat_a_CFLAGS = $(AM_CFLAGS)\n"
  },
  {
    "path": "src/syslinux/libfat/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = src/syslinux/libfat\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLIBRARIES = $(noinst_LIBRARIES)\nARFLAGS = cru\nAM_V_AR = $(am__v_AR_@AM_V@)\nam__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)\nam__v_AR_0 = @echo \"  AR      \" $@;\nam__v_AR_1 = \nlibfat_a_AR = $(AR) $(ARFLAGS)\nlibfat_a_LIBADD =\nam_libfat_a_OBJECTS = libfat_a-cache.$(OBJEXT) \\\n\tlibfat_a-fatchain.$(OBJEXT) libfat_a-open.$(OBJEXT) \\\n\tlibfat_a-searchdir.$(OBJEXT) libfat_a-dumpdir.$(OBJEXT)\nlibfat_a_OBJECTS = $(am_libfat_a_OBJECTS)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp =\nam__depfiles_maybe =\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libfat_a_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LIBRARIES = libfat.a\nlibfat_a_SOURCES = cache.c fatchain.c open.c searchdir.c dumpdir.c\nlibfat_a_CFLAGS = $(AM_CFLAGS)\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/syslinux/libfat/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps src/syslinux/libfat/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLIBRARIES:\n\t-test -z \"$(noinst_LIBRARIES)\" || rm -f $(noinst_LIBRARIES)\n\nlibfat.a: $(libfat_a_OBJECTS) $(libfat_a_DEPENDENCIES) $(EXTRA_libfat_a_DEPENDENCIES) \n\t$(AM_V_at)-rm -f libfat.a\n\t$(AM_V_AR)$(libfat_a_AR) libfat.a $(libfat_a_OBJECTS) $(libfat_a_LIBADD)\n\t$(AM_V_at)$(RANLIB) libfat.a\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n.c.o:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\nlibfat_a-cache.o: cache.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfat_a_CFLAGS) $(CFLAGS) -c -o libfat_a-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c\n\nlibfat_a-cache.obj: cache.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfat_a_CFLAGS) $(CFLAGS) -c -o libfat_a-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi`\n\nlibfat_a-fatchain.o: fatchain.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfat_a_CFLAGS) $(CFLAGS) -c -o libfat_a-fatchain.o `test -f 'fatchain.c' || echo '$(srcdir)/'`fatchain.c\n\nlibfat_a-fatchain.obj: fatchain.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfat_a_CFLAGS) $(CFLAGS) -c -o libfat_a-fatchain.obj `if test -f 'fatchain.c'; then $(CYGPATH_W) 'fatchain.c'; else $(CYGPATH_W) '$(srcdir)/fatchain.c'; fi`\n\nlibfat_a-open.o: open.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfat_a_CFLAGS) $(CFLAGS) -c -o libfat_a-open.o `test -f 'open.c' || echo '$(srcdir)/'`open.c\n\nlibfat_a-open.obj: open.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfat_a_CFLAGS) $(CFLAGS) -c -o libfat_a-open.obj `if test -f 'open.c'; then $(CYGPATH_W) 'open.c'; else $(CYGPATH_W) '$(srcdir)/open.c'; fi`\n\nlibfat_a-searchdir.o: searchdir.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfat_a_CFLAGS) $(CFLAGS) -c -o libfat_a-searchdir.o `test -f 'searchdir.c' || echo '$(srcdir)/'`searchdir.c\n\nlibfat_a-searchdir.obj: searchdir.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfat_a_CFLAGS) $(CFLAGS) -c -o libfat_a-searchdir.obj `if test -f 'searchdir.c'; then $(CYGPATH_W) 'searchdir.c'; else $(CYGPATH_W) '$(srcdir)/searchdir.c'; fi`\n\nlibfat_a-dumpdir.o: dumpdir.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfat_a_CFLAGS) $(CFLAGS) -c -o libfat_a-dumpdir.o `test -f 'dumpdir.c' || echo '$(srcdir)/'`dumpdir.c\n\nlibfat_a-dumpdir.obj: dumpdir.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfat_a_CFLAGS) $(CFLAGS) -c -o libfat_a-dumpdir.obj `if test -f 'dumpdir.c'; then $(CYGPATH_W) 'dumpdir.c'; else $(CYGPATH_W) '$(srcdir)/dumpdir.c'; fi`\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LIBRARIES)\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \\\n\tdistclean-compile distclean-generic distclean-tags dvi dvi-am \\\n\thtml html-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "src/syslinux/libfat/cache.c",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2004-2008 H. Peter Anvin - All Rights Reserved\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * cache.c\n *\n * Simple sector cache\n */\n\n#include <stdlib.h>\n#include <malloc.h>\n#include \"libfatint.h\"\n\n/*\n * NB: We need to align our sector buffers to at least the 8-byte mark, as some Windows\n * disk devices, notably O2Micro PCI-E SD card readers, return ERROR_INVALID_PARAMETER\n * when attempting to use ReadFile() against a non 8-byte aligned buffer.\n * For good measure, we'll go further and align our buffers on a 16-byte boundary.\n * Also, since struct libfat_sector's data[0] is our buffer, this means we must BOTH\n * align that member in the struct declaration, and use aligned malloc/free.\n */\nvoid *libfat_get_sector(struct libfat_filesystem *fs, libfat_sector_t n)\n{\n    struct libfat_sector *ls;\n\n    for (ls = fs->sectors; ls; ls = ls->next) {\n\tif (ls->n == n)\n\t    return ls->data;\t/* Found in cache */\n    }\n\n    /* Not found in cache */\n    ls = _mm_malloc(sizeof(struct libfat_sector) + LIBFAT_SECTOR_SIZE, 16);\n    if (!ls) {\n\tlibfat_flush(fs);\n\tls = _mm_malloc(sizeof(struct libfat_sector) + LIBFAT_SECTOR_SIZE, 16);\n\n\tif (!ls)\n\t    return NULL;\t/* Can't allocate memory */\n    }\n\n    if (fs->read(fs->readptr, ls->data, LIBFAT_SECTOR_SIZE, n)\n\t!= LIBFAT_SECTOR_SIZE) {\n\t_mm_free(ls);\n\treturn NULL;\t\t/* I/O error */\n    }\n\n    ls->n = n;\n    ls->next = fs->sectors;\n    fs->sectors = ls;\n\n    return ls->data;\n}\n\nvoid libfat_flush(struct libfat_filesystem *fs)\n{\n    struct libfat_sector *ls, *lsnext;\n\n    lsnext = fs->sectors;\n    fs->sectors = NULL;\n\n    for (ls = lsnext; ls; ls = lsnext) {\n\tlsnext = ls->next;\n\t_mm_free(ls);\n    }\n}\n"
  },
  {
    "path": "src/syslinux/libfat/dumpdir.c",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2019-2024 Pete Batard <pete@akeo.ie>\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * dumpdir.c\n *\n * Returns all files and directory items from a FAT directory.\n */\n\n#include <string.h>\n#include \"libfatint.h\"\n\n#ifndef ARRAYSIZE\n#define ARRAYSIZE(a) (sizeof(a) / sizeof(*(a)))\n#endif\n\nstatic struct fat_dirent* get_next_dirent(struct libfat_filesystem *fs,\n\t\t\t\t\t  libfat_sector_t *sector, int *offset)\n{\n    struct fat_dirent *dep;\n\n    *offset += sizeof(struct fat_dirent);\n    if (*offset >= LIBFAT_SECTOR_SIZE) {\n\t*offset = 0;\n\t*sector = libfat_nextsector(fs, *sector);\n\tif ((*sector == 0) || (*sector == (libfat_sector_t)-1))\n\t    return NULL;\n    }\n    dep = libfat_get_sector(fs, *sector);\n    if (!dep)\n\treturn NULL;\n    dep = (struct fat_dirent*) &((char*)dep)[*offset];\n    return dep;\n}\n\nstatic void fill_utf16(wchar_t *name, unsigned char *entry)\n{\n    int i;\n    for (i = 0; i < 5; i++)\n\tname[i] = read16((le16_t*)&entry[1 + 2 * i]);\n    for (i = 5; i < 11; i++)\n\tname[i] = read16((le16_t*)&entry[4 + 2 * i]);\n    for (i = 11; i < 13; i++)\n\tname[i] = read16((le16_t*)&entry[6 + 2 * i]);\n}\n\nint libfat_dumpdir(struct libfat_filesystem *fs, libfat_dirpos_t *dp,\n\t\t   libfat_diritem_t *di)\n{\n    int i, j;\n    struct fat_dirent *dep;\n\n    memset(di->name, 0, sizeof(di->name));\n    di->size = 0;\n    di->attributes = 0;\n    if (dp->offset < 0) {\n\t/* First entry */\n\tdp->offset = 0;\n\tdp->sector = libfat_clustertosector(fs, dp->cluster);\n\tif ((dp->sector == 0) || (dp->sector == (libfat_sector_t)-1))\n\t    return -1;\n\tdep = libfat_get_sector(fs, dp->sector);\n    } else {\n\tdep = get_next_dirent(fs, &dp->sector, &dp->offset);\n    }\n    if (!dep)\n\treturn -1;\t/* Read error */\n\n    /* Ignore volume labels, deleted entries as well as '.' and '..' entries */\n    while ((dep->attribute == 0x08) || (dep->name[0] == 0xe5) ||\n\t   ((dep->name[0] == '.') && (dep->name[2] == ' ') &&\n\t    ((dep->name[1] == ' ') || (dep->name[1] == '.')))) {\n\tdep = get_next_dirent(fs, &dp->sector, &dp->offset);\n\tif (!dep)\n\t    return -1;\n    }\n\n    if (dep->name[0] == 0)\n\treturn -2;\t/* Last entry */\n\n    /* Build UCS-2 name */\n    j = -1;\n    while (dep->attribute == 0x0F) {\t/* LNF (Long File Name) entry */\n\ti = dep->name[0];\n\tif ((j < 0) && ((i & 0xF0) != 0x40))  /* End of LFN marker was not found */\n\t    break;\n\t/* Isolate and check the sequence number, which should be decrementing */\n\ti = (i & 0x0F) - 1;\n\tif ((j >= 0) && (i != j - 1))\n\t    return -3;\n\tj = i;\n\tif (i > ARRAYSIZE(di->name) - 13)\n\t    i = ARRAYSIZE(di->name) - 13;\n\tfill_utf16(&di->name[13 * i], dep->name);\n\tdep = get_next_dirent(fs, &dp->sector, &dp->offset);\n\tif (!dep)\n\t    return -1;\n    }\n    di->name[ARRAYSIZE(di->name) - 1] = 0;\n\n    if (di->name[0] == 0) {\n\tfor (i = 0, j = 0; i < 11; i++) {\n\t    if ((i >= 8) && (dep->name[i] == ' '))\n\t\tbreak;\n\t    if (i == 8)\n\t\tdi->name[j++] = '.';\n\t    if (dep->name[i] == ' ')\n\t\tcontinue;\n\t    di->name[j] = dep->name[i];\n\t    /* Caseflags: bit 3 = lowercase basename, bit 4 = lowercase extension */\n\t    if ((di->name[j] >= 'A') && (di->name[j] <= 'Z')) {\n\t\tif ((dep->caseflags & 0x02) && (i < 8))\n\t\t    di->name[j] += 0x20;\n\t\tif ((dep->caseflags & 0x04) && (i >= 8))\n\t\t    di->name[j] += 0x20;\n\t    }\n\t    j++;\n\t}\n    }\n\n    di->attributes = dep->attribute & 0x37;\n    di->size = read32(&dep->size);\n    return read16(&dep->clustlo) + (read16(&dep->clusthi) << 16);\n}\n"
  },
  {
    "path": "src/syslinux/libfat/fat.h",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2001-2008 H. Peter Anvin - All Rights Reserved\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * fat.h\n *\n * Basic data structures for a FAT filesystem\n */\n\n#ifndef FAT_H\n#define FAT_H\n\n#include \"ulint.h\"\n\n/* The poor excuse FAT has for a superblock -- in the boot sector */\nstruct fat_bootsect {\n    le8_t bsJump[3];\t\t/* Jump to code */\n    char bsOemName[8];\t\t/* Formatting program */\n    le16_t bsBytesPerSec;\t/* Bytes/sector */\n    le8_t bsSecPerClust;\t/* Sectors/cluster */\n    le16_t bsResSectors;\t/* Reserved sectors */\n    le8_t bsFATs;\t\t/* Number of FATs */\n    le16_t bsRootDirEnts;\t/* Number of entries/root directory */\n    le16_t bsSectors;\t\t/* Number of sectors [1] */\n    le8_t bsMedia;\t\t/* Magic media type byte */\n    le16_t bsFATsecs;\t\t/* Sectors/FAT */\n    le16_t bsSecPerTrack;\t/* Sectors/track */\n    le16_t bsHeads;\t\t/* Number of heads */\n    le32_t bsHiddenSecs;\t/* Number of hidden sectors */\n    le32_t bsHugeSectors;\t/* Number of sectors [2] */\n    union {\n\t/* FAT12/16 */\n\tstruct {\n\t    le8_t bsDriveNumber;\t/* Drive number */\n\t    le8_t bsReserved1;\t/* Reserved */\n\t    le8_t bsBootSignature;\t/* 0x29 */\n\t    le32_t bsVolumeID;\t/* Volume serial number */\n\t    char bsVolumeLabel[11];\t/* Volume name */\n\t    char bsFileSysType[8];\t/* File system type */\n\n\t    le8_t bsCode[448];\t/* Boot sector code */\n\t} fat16;\n\n\t/* FAT32 */\n\tstruct {\n\t    le32_t bpb_fatsz32;\t/* Sectors/FAT */\n\t    le16_t bpb_extflags;\t/* Extended flags */\n\t    le16_t bpb_fsver;\t/* Filesystem version */\n\t    le32_t bpb_rootclus;\t/* Root directory cluster */\n\t    le16_t bpb_fsinfo;\t/* FSINFO sector number */\n\t    le16_t bpb_bkbootsec;\t/* Backup boot sector (superblock) */\n\t    char bpb_reserved[12];\n\n\t    /* Same shit, different offset! */\n\t    le8_t bsDriveNumber;\t/* Drive number */\n\t    le8_t bsReserved1;\t/* Reserved */\n\t    le8_t bsBootSignature;\t/* 0x29 */\n\t    le32_t bsVolumeID;\t/* Volume serial number */\n\t    char bsVolumeLabel[11];\t/* Volume name */\n\t    char bsFileSysType[8];\t/* File system type */\n\n\t    le8_t bsCode[420];\t/* Boot sector code */\n\t} fat32;\n    } u;\n\n    le16_t bsSignature;\t\t/* 0xAA55 */\n};\n\n#define BS_BOOTSIGNATURE\t0x29\n#define BS_SIGNATURE\t\t0xAA55\n\n/* A FAT filesystem directory entry */\n\nstruct fat_dirent {\n    le8_t name[11];\t\t/* Mangled filename */\n    le8_t attribute;\t\t/* File type/attribute */\n    le8_t caseflags;\t\t/* VFAT: case for basis and extension */\n    le8_t ctime_ms;\t\t/* ms of creation time */\n    le32_t ctime;\t\t/* Creation time */\n    le16_t atime;\t\t/* Date portion (high 16 bits) of atime */\n    le16_t clusthi;\t\t/* FAT32: high 16 bits of cluster */\n    le32_t mtime;\t\t/* Modification time */\n    le16_t clustlo;\t\t/* First cluster pointer */\n    le32_t size;\t\t/* File size (bytes) */\n};\n\n/* A VFAT filesystem continuation entry */\nstruct fat_vfat_slot {\n    le8_t id;\t\t\t/* Sequence number for slot */\n    le16_t name0[5];\t\t/* 5 characters */\n    le8_t attribute;\t\t/* Attribute byte */\n    le8_t reserved;\t\t/* Reserved, MBZ */\n    le8_t alias_csum;\t\t/* Short name checksum */\n    le16_t name5[6];\t\t/* 6 characters */\n    le16_t firstclust;\t\t/* MBZ */\n    le16_t name11[2];\t\t/* 2 characters */\n};\n\n#endif /* FAT_H */\n"
  },
  {
    "path": "src/syslinux/libfat/fatchain.c",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2004-2008 H. Peter Anvin - All Rights Reserved\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * fatchain.c\n *\n * Follow a FAT chain\n */\n\n#include \"libfatint.h\"\n#include \"ulint.h\"\n\n/*\n * Convert a cluster number (or 0 for the root directory) to a\n * sector number.  Return -1 on failure.\n */\nlibfat_sector_t libfat_clustertosector(const struct libfat_filesystem *fs,\n\t\t\t\t       int32_t cluster)\n{\n    if (cluster == 0)\n\tcluster = fs->rootcluster;\n\n    if (cluster == 0)\n\treturn fs->rootdir;\n    else if (cluster < 2 || cluster >= fs->endcluster)\n\treturn -1;\n    else\n\treturn fs->data + (((libfat_sector_t)cluster - 2) << fs->clustshift);\n}\n\n/*\n * Get the next sector of either the root directory or a FAT chain.\n * Returns 0 on end of file and -1 on error.\n */\n\nlibfat_sector_t libfat_nextsector(struct libfat_filesystem * fs,\n\t\t\t\t  libfat_sector_t s)\n{\n    int32_t cluster, nextcluster;\n    uint32_t fatoffset;\n    libfat_sector_t fatsect;\n    uint8_t *fsdata;\n    uint32_t clustmask = fs->clustsize - 1;\n    libfat_sector_t rs;\n\n    if (s < fs->data) {\n\tif (s < fs->rootdir)\n\t    return -1;\n\n\t/* Root directory */\n\ts++;\n\treturn (s < fs->data) ? s : 0;\n    }\n\n    rs = s - fs->data;\n\n    if (~rs & clustmask)\n\treturn s + 1;\t\t/* Next sector in cluster */\n\n    cluster = 2 + (rs >> fs->clustshift);\n\n    if (cluster >= fs->endcluster)\n\treturn -1;\n\n    switch (fs->fat_type) {\n    case FAT12:\n\t/* Get first byte */\n\tfatoffset = cluster + (cluster >> 1);\n\tfatsect = fs->fat + (fatoffset >> LIBFAT_SECTOR_SHIFT);\n\tfsdata = libfat_get_sector(fs, fatsect);\n\tif (!fsdata)\n\t    return -1;\n\tnextcluster = fsdata[fatoffset & LIBFAT_SECTOR_MASK];\n\n\t/* Get second byte */\n\tfatoffset++;\n\tfatsect = fs->fat + (fatoffset >> LIBFAT_SECTOR_SHIFT);\n\tfsdata = libfat_get_sector(fs, fatsect);\n\tif (!fsdata)\n\t    return -1;\n\tnextcluster |= fsdata[fatoffset & LIBFAT_SECTOR_MASK] << 8;\n\n\t/* Extract the FAT entry */\n\tif (cluster & 1)\n\t    nextcluster >>= 4;\n\telse\n\t    nextcluster &= 0x0FFF;\n\n\tif (nextcluster >= 0x0FF8)\n\t    return 0;\n\tbreak;\n\n    case FAT16:\n\tfatoffset = cluster << 1;\n\tfatsect = fs->fat + (fatoffset >> LIBFAT_SECTOR_SHIFT);\n\tfsdata = libfat_get_sector(fs, fatsect);\n\tif (!fsdata)\n\t    return -1;\n\tnextcluster =\n\t    read16((le16_t *) & fsdata[fatoffset & LIBFAT_SECTOR_MASK]);\n\n\tif (nextcluster >= 0x0FFF8)\n\t    return 0;\n\tbreak;\n\n    case FAT28:\n\tfatoffset = cluster << 2;\n\tfatsect = fs->fat + (fatoffset >> LIBFAT_SECTOR_SHIFT);\n\tfsdata = libfat_get_sector(fs, fatsect);\n\tif (!fsdata)\n\t    return -1;\n\tnextcluster =\n\t    read32((le32_t *) & fsdata[fatoffset & LIBFAT_SECTOR_MASK]);\n\tnextcluster &= 0x0FFFFFFF;\n\n\tif (nextcluster >= 0x0FFFFFF8)\n\t    return 0;\n\tbreak;\n\n    default:\n\treturn -1;\t\t/* WTF? */\n    }\n\n    return libfat_clustertosector(fs, nextcluster);\n}\n"
  },
  {
    "path": "src/syslinux/libfat/libfat.h",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2004-2008 H. Peter Anvin - All Rights Reserved\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * libfat.h\n *\n * Headers for the libfat library\n */\n\n#ifndef LIBFAT_H\n#define LIBFAT_H\n\n#include <stddef.h>\n#include <inttypes.h>\n\n// Workaround for 4K support\nextern uint32_t LIBFAT_SECTOR_SHIFT;\nextern uint32_t LIBFAT_SECTOR_SIZE;\nextern uint32_t LIBFAT_SECTOR_MASK;\n//#define LIBFAT_SECTOR_SHIFT\t9\n//#define LIBFAT_SECTOR_SIZE\t512\n//#define LIBFAT_SECTOR_MASK\t511\n\ntypedef uint64_t libfat_sector_t;\nstruct libfat_filesystem;\n\nstruct libfat_direntry {\n    libfat_sector_t sector;\n    int offset;\n    unsigned char entry[32];\n};\n\ntypedef struct libfat_dirpos {\n    int32_t cluster;\n    int32_t offset;\n    libfat_sector_t sector;\n} libfat_dirpos_t;\n\ntypedef struct libfat_diritem {\n    wchar_t  name[256];\n    uint32_t size;\n    uint8_t  attributes;    /* [--ad-shr] */\n} libfat_diritem_t;\n\n/*\n * Open the filesystem.  The readfunc is the function to read\n * sectors, in the format:\n * int readfunc(intptr_t readptr, void *buf, size_t secsize,\n *              libfat_sector_t secno)\n *\n * ... where readptr is a private argument.\n *\n * A return value of != secsize is treated as error.\n */\nstruct libfat_filesystem\n    *libfat_open(int (*readfunc) (intptr_t, void *, size_t, libfat_sector_t),\n\t\t intptr_t readptr);\n\nvoid libfat_close(struct libfat_filesystem *);\n\n/*\n * Convert a cluster number (or 0 for the root directory) to a\n * sector number.  Return -1 on failure.\n */\nlibfat_sector_t libfat_clustertosector(const struct libfat_filesystem *fs,\n\t\t\t\t       int32_t cluster);\n\n/*\n * Get the next sector of either the root directory or a FAT chain.\n * Returns 0 on end of file and -1 on error.\n */\nlibfat_sector_t libfat_nextsector(struct libfat_filesystem *fs,\n\t\t\t\t  libfat_sector_t s);\n\n/*\n * Flush all cached sectors for this filesystem.\n */\nvoid libfat_flush(struct libfat_filesystem *fs);\n\n/*\n * Get a pointer to a specific sector.\n */\nvoid *libfat_get_sector(struct libfat_filesystem *fs, libfat_sector_t n);\n\n/*\n * Search a FAT directory for a particular pre-mangled filename.\n * Copies the directory entry into direntry and returns 0 if found.\n */\nint32_t libfat_searchdir(struct libfat_filesystem *fs, int32_t dirclust,\n\t\t\t const void *name, struct libfat_direntry *direntry);\n\n/*\n * Return all the files and directory items from a FAT directory.\n * Initial call must set dp->offset to negative and dp->cluster to the cluster\n * that contains the directory data. After that each subsequent call must use\n * the same dp.\n * Return value is the cluster for the corresponding item or negative on error.\n */\nint libfat_dumpdir(struct libfat_filesystem *fs, libfat_dirpos_t *dp,\n\t\t   libfat_diritem_t *di);\n\n#endif /* LIBFAT_H */\n"
  },
  {
    "path": "src/syslinux/libfat/libfatint.h",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2004-2008 H. Peter Anvin - All Rights Reserved\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * libfatint.h\n *\n * Internals for the libfat filesystem\n */\n\n#ifndef LIBFATINT_H\n#define LIBFATINT_H\n\n#include \"libfat.h\"\n#include \"fat.h\"\n\n#if defined(__GNUC__)\n#define ALIGN_START(m)\n#define ALIGN_END(m) __attribute__ ((__aligned__(m)))\n#elif defined(_MSC_VER)\n#define ALIGN_START(m) __declspec(align(m))\n#define ALIGN_END(m)\n#endif\n\nALIGN_START(16) struct libfat_sector {\n\tlibfat_sector_t n;\t\t/* Sector number */\n\tstruct libfat_sector *next;\t/* Next in list */\n\t/* data[0] MUST be aligned to at least 8 bytes - see cache.c */\n\tALIGN_START(16) char data[0] ALIGN_END(16);\n} ALIGN_END(16);\n\nenum fat_type {\n    FAT12,\n    FAT16,\n    FAT28\n};\n\nstruct libfat_filesystem {\n    int (*read) (intptr_t, void *, size_t, libfat_sector_t);\n    intptr_t readptr;\n\n    enum fat_type fat_type;\n    unsigned int clustsize;\n    int clustshift;\n    int32_t endcluster;\t\t/* Highest legal cluster number + 1 */\n    int32_t rootcluster;\t/* Root directory cluster */\n\n    libfat_sector_t fat;\t/* Start of FAT */\n    libfat_sector_t rootdir;\t/* Start of root directory */\n    libfat_sector_t data;\t/* Start of data area */\n    libfat_sector_t end;\t/* End of filesystem */\n\n    struct libfat_sector *sectors;\n};\n\n#endif /* LIBFATINT_H */\n"
  },
  {
    "path": "src/syslinux/libfat/open.c",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2004-2008 H. Peter Anvin - All Rights Reserved\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * open.c\n *\n * Open a FAT filesystem and compute some initial values; return NULL\n * on failure.\n */\n\n#include <stdlib.h>\n#include \"libfatint.h\"\n#include \"ulint.h\"\n\nstruct libfat_filesystem *\nlibfat_open(int (*readfunc) (intptr_t, void *, size_t, libfat_sector_t),\n\t    intptr_t readptr)\n{\n    struct libfat_filesystem *fs = NULL;\n    struct fat_bootsect *bs;\n    int i;\n    uint32_t sectors, fatsize, minfatsize, rootdirsize;\n    uint32_t nclusters;\n\n    fs = malloc(sizeof(struct libfat_filesystem));\n    if (!fs)\n\tgoto barf;\n\n    fs->sectors = NULL;\n    fs->read = readfunc;\n    fs->readptr = readptr;\n\n    bs = libfat_get_sector(fs, 0);\n    if (!bs)\n\tgoto barf;\n\n    if (read16(&bs->bsBytesPerSec) != LIBFAT_SECTOR_SIZE)\n\tgoto barf;\n\n    for (i = 0; i <= 8; i++) {\n\tif ((uint8_t) (1 << i) == read8(&bs->bsSecPerClust))\n\t    break;\n    }\n    if (i > 8)\n\tgoto barf;\n    fs->clustsize = 1 << i;\t/* Treat 0 as 2^8 = 64K */\n    fs->clustshift = i;\n\n    sectors = read16(&bs->bsSectors);\n    if (!sectors)\n\tsectors = read32(&bs->bsHugeSectors);\n\n    fs->end = sectors;\n\n    fs->fat = read16(&bs->bsResSectors);\n    fatsize = read16(&bs->bsFATsecs);\n    if (!fatsize)\n\tfatsize = read32(&bs->u.fat32.bpb_fatsz32);\n\n    fs->rootdir = fs->fat + (libfat_sector_t)fatsize * read8(&bs->bsFATs);\n\n    rootdirsize = ((read16(&bs->bsRootDirEnts) << 5) + LIBFAT_SECTOR_MASK)\n\t>> LIBFAT_SECTOR_SHIFT;\n    fs->data = fs->rootdir + rootdirsize;\n\n    /* Sanity checking */\n    if (fs->data >= fs->end)\n\tgoto barf;\n\n    /* Figure out how many clusters */\n    nclusters = (fs->end - fs->data) >> fs->clustshift;\n    fs->endcluster = nclusters + 2;\n\n    if (nclusters <= 0xff4) {\n\tfs->fat_type = FAT12;\n\tminfatsize = fs->endcluster + (fs->endcluster >> 1);\n    } else if (nclusters <= 0xfff4) {\n\tfs->fat_type = FAT16;\n\tminfatsize = fs->endcluster << 1;\n    } else if (nclusters <= 0xffffff4) {\n\tfs->fat_type = FAT28;\n\tminfatsize = fs->endcluster << 2;\n    } else\n\tgoto barf;\t\t/* Impossibly many clusters */\n\n    minfatsize = (minfatsize + LIBFAT_SECTOR_SIZE - 1) >> LIBFAT_SECTOR_SHIFT;\n\n    if (minfatsize > fatsize)\n\tgoto barf;\t\t/* The FATs don't fit */\n\n    if (fs->fat_type == FAT28)\n\tfs->rootcluster = read32(&bs->u.fat32.bpb_rootclus);\n    else\n\tfs->rootcluster = 0;\n\n    return fs;\t\t\t/* All good */\n\nbarf:\n    if (fs)\n\tfree(fs);\n    return NULL;\n}\n\nvoid libfat_close(struct libfat_filesystem *fs)\n{\n    libfat_flush(fs);\n    free(fs);\n}\n"
  },
  {
    "path": "src/syslinux/libfat/searchdir.c",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2004-2008 H. Peter Anvin - All Rights Reserved\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * searchdir.c\n *\n * Search a FAT directory for a particular pre-mangled filename.\n * Copies the directory entry into direntry and returns the starting cluster\n * if found; returns -2 on not found, -1 on error, 0 on empty file.\n */\n\n#include <string.h>\n#include \"libfatint.h\"\n\nint32_t libfat_searchdir(struct libfat_filesystem *fs, int32_t dirclust,\n\t\t\t const void *name, struct libfat_direntry *direntry)\n{\n    struct fat_dirent *dep;\n    int nent;\n    libfat_sector_t s = libfat_clustertosector(fs, dirclust);\n\n    while (1) {\n\tif (s == 0)\n\t    return -2;\t\t/* Not found */\n\telse if (s == (libfat_sector_t) - 1)\n\t    return -1;\t\t/* Error */\n\n\tdep = libfat_get_sector(fs, s);\n\tif (!dep)\n\t    return -1;\t\t/* Read error */\n\n\tfor (nent = 0; nent < LIBFAT_SECTOR_SIZE;\n\t     nent += sizeof(struct fat_dirent)) {\n\t    /* Filter out volume labels (0x08) and devices (0x40) from the search */\n\t    if (!(dep->attribute & 0x48) && !memcmp(dep->name, name, 11)) {\n\t\tif (direntry) {\n\t\t    memcpy(direntry->entry, dep, sizeof(*dep));\n\t\t    direntry->sector = s;\n\t\t    direntry->offset = nent;\n\t\t}\n\t\tif (read32(&dep->size) == 0)\n\t\t    return 0;\t/* An empty file has no clusters */\n\t\telse\n\t\t    return read16(&dep->clustlo) +\n\t\t\t(read16(&dep->clusthi) << 16);\n\t    }\n\n\t    if (dep->name[0] == 0)\n\t\treturn -2;\t/* Hit high water mark */\n\n\t    dep++;\n\t}\n\n\ts = libfat_nextsector(fs, s);\n    }\n}\n"
  },
  {
    "path": "src/syslinux/libfat/ulint.h",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2001-2008 H. Peter Anvin - All Rights Reserved\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,\n *   USA; either version 2 of the License, or (at your option) any later\n *   version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * ulint.h\n *\n * Basic operations on unaligned, littleendian integers\n */\n\n#ifndef ULINT_H\n#define ULINT_H\n\n#include <inttypes.h>\n\n/* These are unaligned, littleendian integer types */\n\ntypedef uint8_t le8_t;\t\t/*  8-bit byte */\ntypedef uint8_t le16_t[2];\t/* 16-bit word */\ntypedef uint8_t le32_t[4];\t/* 32-bit dword */\n\n/* Read/write these quantities */\n\nstatic inline unsigned char read8(le8_t * _p)\n{\n    return *_p;\n}\n\nstatic inline void write8(le8_t * _p, uint8_t _v)\n{\n    *_p = _v;\n}\n\n#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)\n\n/* Littleendian architectures which support unaligned memory accesses */\n\nstatic inline unsigned short read16(le16_t * _p)\n{\n    return *((const uint16_t *)_p);\n}\n\nstatic inline void write16(le16_t * _p, unsigned short _v)\n{\n    *((uint16_t *) _p) = _v;\n}\n\nstatic inline unsigned int read32(le32_t * _p)\n{\n    return *((const uint32_t *)_p);\n}\n\nstatic inline void write32(le32_t * _p, uint32_t _v)\n{\n    *((uint32_t *) _p) = _v;\n}\n\n#else\n\n/* Generic, mostly portable versions */\n\nstatic inline unsigned short read16(le16_t * _pp)\n{\n    uint8_t *_p = *_pp;\n    uint16_t _v;\n\n    _v = _p[0];\n    _v |= _p[1] << 8;\n    return _v;\n}\n\nstatic inline void write16(le16_t * _pp, uint16_t _v)\n{\n    uint8_t *_p = *_pp;\n\n    _p[0] = _v & 0xFF;\n    _p[1] = (_v >> 8) & 0xFF;\n}\n\nstatic inline unsigned int read32(le32_t * _pp)\n{\n    uint8_t *_p = *_pp;\n    uint32_t _v;\n\n    _v = _p[0];\n    _v |= _p[1] << 8;\n    _v |= _p[2] << 16;\n    _v |= _p[3] << 24;\n    return _v;\n}\n\nstatic inline void write32(le32_t * _pp, uint32_t _v)\n{\n    uint8_t *_p = *_pp;\n\n    _p[0] = _v & 0xFF;\n    _p[1] = (_v >> 8) & 0xFF;\n    _p[2] = (_v >> 16) & 0xFF;\n    _p[3] = (_v >> 24) & 0xFF;\n}\n\n#endif\n\n#endif /* ULINT_H */\n"
  },
  {
    "path": "src/syslinux/libinstaller/Makefile.am",
    "content": "noinst_LIBRARIES = libinstaller.a\n\nlibinstaller_a_SOURCES = fs.c setadv.c syslxmod.c\nlibinstaller_a_CFLAGS = $(AM_CFLAGS) -Wno-address-of-packed-member"
  },
  {
    "path": "src/syslinux/libinstaller/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = src/syslinux/libinstaller\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLIBRARIES = $(noinst_LIBRARIES)\nARFLAGS = cru\nAM_V_AR = $(am__v_AR_@AM_V@)\nam__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)\nam__v_AR_0 = @echo \"  AR      \" $@;\nam__v_AR_1 = \nlibinstaller_a_AR = $(AR) $(ARFLAGS)\nlibinstaller_a_LIBADD =\nam_libinstaller_a_OBJECTS = libinstaller_a-fs.$(OBJEXT) \\\n\tlibinstaller_a-setadv.$(OBJEXT) \\\n\tlibinstaller_a-syslxmod.$(OBJEXT)\nlibinstaller_a_OBJECTS = $(am_libinstaller_a_OBJECTS)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp =\nam__depfiles_maybe =\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libinstaller_a_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LIBRARIES = libinstaller.a\nlibinstaller_a_SOURCES = fs.c setadv.c syslxmod.c\nlibinstaller_a_CFLAGS = $(AM_CFLAGS) -Wno-address-of-packed-member\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/syslinux/libinstaller/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps src/syslinux/libinstaller/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLIBRARIES:\n\t-test -z \"$(noinst_LIBRARIES)\" || rm -f $(noinst_LIBRARIES)\n\nlibinstaller.a: $(libinstaller_a_OBJECTS) $(libinstaller_a_DEPENDENCIES) $(EXTRA_libinstaller_a_DEPENDENCIES) \n\t$(AM_V_at)-rm -f libinstaller.a\n\t$(AM_V_AR)$(libinstaller_a_AR) libinstaller.a $(libinstaller_a_OBJECTS) $(libinstaller_a_LIBADD)\n\t$(AM_V_at)$(RANLIB) libinstaller.a\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n.c.o:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\nlibinstaller_a-fs.o: fs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-fs.o `test -f 'fs.c' || echo '$(srcdir)/'`fs.c\n\nlibinstaller_a-fs.obj: fs.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-fs.obj `if test -f 'fs.c'; then $(CYGPATH_W) 'fs.c'; else $(CYGPATH_W) '$(srcdir)/fs.c'; fi`\n\nlibinstaller_a-setadv.o: setadv.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-setadv.o `test -f 'setadv.c' || echo '$(srcdir)/'`setadv.c\n\nlibinstaller_a-setadv.obj: setadv.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-setadv.obj `if test -f 'setadv.c'; then $(CYGPATH_W) 'setadv.c'; else $(CYGPATH_W) '$(srcdir)/setadv.c'; fi`\n\nlibinstaller_a-syslxmod.o: syslxmod.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-syslxmod.o `test -f 'syslxmod.c' || echo '$(srcdir)/'`syslxmod.c\n\nlibinstaller_a-syslxmod.obj: syslxmod.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-syslxmod.obj `if test -f 'syslxmod.c'; then $(CYGPATH_W) 'syslxmod.c'; else $(CYGPATH_W) '$(srcdir)/syslxmod.c'; fi`\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LIBRARIES)\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \\\n\tdistclean-compile distclean-generic distclean-tags dvi dvi-am \\\n\thtml html-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "src/syslinux/libinstaller/advconst.h",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved\n *   Copyright 2009 Intel Corporation; author: H. Peter Anvin\n *\n *   Permission is hereby granted, free of charge, to any person\n *   obtaining a copy of this software and associated documentation\n *   files (the \"Software\"), to deal in the Software without\n *   restriction, including without limitation the rights to use,\n *   copy, modify, merge, publish, distribute, sublicense, and/or\n *   sell copies of the Software, and to permit persons to whom\n *   the Software is furnished to do so, subject to the following\n *   conditions:\n *\n *   The above copyright notice and this permission notice shall\n *   be included in all copies or substantial portions of the Software.\n *\n *   THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n *   OTHER DEALINGS IN THE SOFTWARE.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * syslinux/advconst.h\n *\n * ADV defined constants\n *\n * Defined in a separate file so it can be used by non-COM32 code.\n * Some of these constants are also defined in adv.inc, they better match...\n */\n\n#ifndef _SYSLINUX_ADVCONST_H\n#define _SYSLINUX_ADVCONST_H\n\n#define ADV_END\t\t0\n#define ADV_BOOTONCE\t1\n#define ADV_MENUSAVE\t2\n\n#endif /* _SYSLINUX_ADVCONST_H */\n"
  },
  {
    "path": "src/syslinux/libinstaller/fs.c",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 1998-2011 H. Peter Anvin - All Rights Reserved\n *   Copyright 2009-2011 Intel Corporation; author H. Peter Anvin\n *   Copyright 2011 Paulo Alcantara <pcacjr@gmail.com>\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * fs.c - Generic sanity check for FAT/NTFS-based installers\n */\n\n#define _XOPEN_SOURCE 500\t/* Required on glibc 2.x */\n#define _BSD_SOURCE\n/* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */\n#define _DEFAULT_SOURCE 1\n#include <stdio.h>\n#include <inttypes.h>\n#include <string.h>\n#include <stddef.h>\n#include <stdlib.h>\n\n#include \"syslinux.h\"\n#include \"syslxint.h\"\n#include \"syslxcom.h\"\n#include \"syslxfs.h\"\n\nvoid syslinux_make_bootsect(void *bs, int fs_type)\n{\n    if (fs_type == VFAT) {\n\tstruct fat_boot_sector *bootsect = bs;\n\tconst struct fat_boot_sector *sbs =\n\t    (const struct fat_boot_sector *)boot_sector;\n\n\t// The overruns are intended\n\t// coverity[overrun-buffer-arg]\n\t// coverity[buffer_size]\n\tmemcpy(&bootsect->FAT_bsHead, &sbs->FAT_bsHead, FAT_bsHeadLen);\n\t// coverity[overrun-buffer-arg]\n\t// coverity[buffer_size]\n\tmemcpy(&bootsect->FAT_bsCode, &sbs->FAT_bsCode, FAT_bsCodeLen);\n    } else if (fs_type == NTFS) {\n\tstruct ntfs_boot_sector *bootsect = bs;\n\tconst struct ntfs_boot_sector *sbs =\n\t    (const struct ntfs_boot_sector *)boot_sector;\n\n\t// coverity[overrun-buffer-arg]\n\t// coverity[buffer_size]\n\tmemcpy(&bootsect->NTFS_bsHead, &sbs->NTFS_bsHead, NTFS_bsHeadLen);\n\t// coverity[overrun-buffer-arg]\n\t// coverity[buffer_size]\n\tmemcpy(&bootsect->NTFS_bsCode, &sbs->NTFS_bsCode, NTFS_bsCodeLen);\n    }\n}\n\nstatic const char *check_fat_bootsect(const void *bs, int *fs_type)\n{\n    int sectorsize;\n    const struct fat_boot_sector *sectbuf = bs;\n    long long sectors, fatsectors, dsectors;\n    long long clusters;\n    int rootdirents, clustersize;\n\n    sectorsize = get_16(&sectbuf->bsBytesPerSec);\n\n    clustersize = get_8(&sectbuf->bsSecPerClust);\n    if (clustersize == 0 || (clustersize & (clustersize - 1)))\n\treturn \"impossible cluster size on an FAT volume\";\n\n    sectors = get_16(&sectbuf->bsSectors);\n    sectors = sectors ? sectors : get_32(&sectbuf->bsHugeSectors);\n\n    dsectors = sectors - get_16(&sectbuf->bsResSectors);\n\n    fatsectors = get_16(&sectbuf->bsFATsecs);\n    fatsectors = fatsectors ? fatsectors : get_32(&sectbuf->bs32.FATSz32);\n    fatsectors *= get_8(&sectbuf->bsFATs);\n    dsectors -= fatsectors;\n\n    rootdirents = get_16(&sectbuf->bsRootDirEnts);\n    dsectors -= (rootdirents + sectorsize / 32 - 1) / sectorsize;\n\n    if (dsectors < 0)\n\treturn \"negative number of data sectors on an FAT volume\";\n\n    clusters = dsectors / clustersize;\n\n    fatsectors = get_16(&sectbuf->bsFATsecs);\n    fatsectors = fatsectors ? fatsectors : get_32(&sectbuf->bs32.FATSz32);\n    fatsectors *= get_8(&sectbuf->bsFATs);\n\n    if (!fatsectors)\n\treturn \"zero FAT sectors\";\n\n    if (clusters < 0xFFF5) {\n\t/* FAT12 or FAT16 */\n\tif (!get_16(&sectbuf->bsFATsecs))\n\t    return \"zero FAT sectors (FAT12/16)\";\n\n\tif (get_8(&sectbuf->bs16.BootSignature) == 0x29) {\n\t    if (!memcmp(&sectbuf->bs16.FileSysType, \"FAT12   \", 8)) {\n\t\tif (clusters >= 0xFF5)\n\t\t    return \"more than 4084 clusters but claims FAT12\";\n\t    } else if (!memcmp(&sectbuf->bs16.FileSysType, \"FAT16   \", 8)) {\n\t\tif (clusters < 0xFF5)\n\t\t    return \"less than 4084 clusters but claims FAT16\";\n\t    } else if (!memcmp(&sectbuf->bs16.FileSysType, \"FAT32   \", 8)) {\n\t\treturn \"less than 65525 clusters but claims FAT32\";\n\t    } else if (memcmp(&sectbuf->bs16.FileSysType, \"FAT     \", 8)) {\n\t\tstatic char fserr[] = \"filesystem type \\\"????????\\\" not \"\n\t\t    \"supported\";\n\t\tmemcpy(fserr + 17, &sectbuf->bs16.FileSysType, 8);\n\t\treturn fserr;\n\t    }\n\t}\n    } else if (clusters < 0x0FFFFFF5) {\n\t/*\n\t * FAT32...\n\t *\n\t * Moving the FileSysType and BootSignature was a lovely stroke\n\t * of M$ idiocy...\n\t */\n\tif (get_8(&sectbuf->bs32.BootSignature) != 0x29 ||\n\t    memcmp(&sectbuf->bs32.FileSysType, \"FAT32   \", 8))\n\t    return \"missing FAT32 signature\";\n    } else {\n\treturn \"impossibly large number of clusters on an FAT volume\";\n    }\n\n    if (fs_type)\n\t*fs_type = VFAT;\n\n    return NULL;\n}\n\nstatic const char *check_ntfs_bootsect(const void *bs, int *fs_type)\n{\n    const struct ntfs_boot_sector *sectbuf = bs;\n\n    if (memcmp(&sectbuf->bsOemName, \"NTFS    \", 8) &&\n\tmemcmp(&sectbuf->bsOemName, \"MSWIN4.0\", 8) &&\n\tmemcmp(&sectbuf->bsOemName, \"MSWIN4.1\", 8))\n\treturn \"unknown OEM name but claims NTFS\";\n\n    if (fs_type)\n\t*fs_type = NTFS;\n\n    return NULL;\n}\n\nconst char *syslinux_check_bootsect(const void *bs, int *fs_type)\n{\n    uint8_t media_sig;\n    int sectorsize;\n    const struct fat_boot_sector *sectbuf = bs;\n    const char *retval;\n\n    media_sig = get_8(&sectbuf->bsMedia);\n    /* Must be 0xF0 or 0xF8-0xFF for FAT/NTFS volumes */\n    if (media_sig != 0xF0 && media_sig < 0xF8)\n\treturn \"invalid media signature (not an FAT/NTFS volume?)\";\n\n    sectorsize = get_16(&sectbuf->bsBytesPerSec);\n    if (sectorsize == SECTOR_SIZE) ;\t/* ok */\n    else if (sectorsize >= 512 && sectorsize <= 4096 &&\n\t     (sectorsize & (sectorsize - 1)) == 0)\n\treturn \"unsupported sectors size\";\n    else\n\treturn \"impossible sector size\";\n\n    if (ntfs_check_zero_fields((struct ntfs_boot_sector *)bs))\n\tretval = check_ntfs_bootsect(bs, fs_type);\n    else\n\tretval = check_fat_bootsect(bs, fs_type);\n\n    return retval;\n}\n"
  },
  {
    "path": "src/syslinux/libinstaller/setadv.c",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved\n *   Copyright 2010 Intel Corporation; author: H. Peter Anvin\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * setadv.c\n *\n * (Over)write a data item in the auxiliary data vector.  To\n * delete an item, set its length to zero.\n *\n * Return 0 on success, -1 on error, and set errno.\n *\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n#include <errno.h>\n#include \"syslxint.h\"\n#include \"syslxcom.h\"\n#include \"syslxfs.h\"\n\nunsigned char syslinux_adv[2 * ADV_SIZE];\n\n#define ADV_MAGIC1\t0x5a2d2fa5\t/* Head signature */\n#define ADV_MAGIC2\t0xa3041767\t/* Total checksum */\n#define ADV_MAGIC3\t0xdd28bf64\t/* Tail signature */\n\nstatic void cleanup_adv(unsigned char *advbuf)\n{\n    int i;\n    uint32_t csum;\n\n    /* Make sure both copies agree, and update the checksum */\n    set_32((uint32_t *) advbuf, ADV_MAGIC1);\n\n    csum = ADV_MAGIC2;\n    for (i = 8; i < ADV_SIZE - 4; i += 4)\n\tcsum -= get_32((uint32_t *) (advbuf + i));\n\n    set_32((uint32_t *) (advbuf + 4), csum);\n    set_32((uint32_t *) (advbuf + ADV_SIZE - 4), ADV_MAGIC3);\n\n    memcpy(advbuf + ADV_SIZE, advbuf, ADV_SIZE);\n}\n\nint syslinux_setadv(int tag, size_t size, const void *data)\n{\n    uint8_t *p;\n    size_t left;\n    uint8_t advtmp[ADV_SIZE];\n\n    if ((unsigned)tag - 1 > 254) {\n\terrno = EINVAL;\n\treturn -1;\t\t/* Impossible tag value */\n    }\n\n    if (size > 255) {\n\terrno = ENOSPC;\t\t/* Max 255 bytes for a data item */\n\treturn -1;\n    }\n\n    left = ADV_LEN;\n    p = advtmp;\n    memcpy(p, syslinux_adv + 2 * 4, left);\t/* Make working copy */\n\n    while (left >= 2) {\n\tuint8_t ptag = p[0];\n\tsize_t plen = p[1] + 2;\n\n\tif (ptag == ADV_END)\n\t    break;\n\n\tif (ptag == tag) {\n\t    /* Found our tag.  Delete it. */\n\n\t    if (plen >= left) {\n\t\t/* Entire remainder is our tag */\n\t\tbreak;\n\t    }\n\t    memmove(p, p + plen, left - plen);\n\t} else {\n\t    /* Not our tag */\n\t    if (plen > left)\n\t\tbreak;\t\t/* Corrupt tag (overrun) - overwrite it */\n\n\t    left -= plen;\n\t    p += plen;\n\t}\n    }\n\n    /* Now (p, left) reflects the position to write in and how much space\n       we have for our data. */\n\n    if (size) {\n\tif (left < size + 2) {\n\t    errno = ENOSPC;\t/* Not enough space for data */\n\t    return -1;\n\t}\n\n\t*p++ = tag;\n\t*p++ = size;\n\tmemcpy(p, data, size);\n\tp += size;\n\tleft -= size + 2;\n    }\n\n    memset(p, 0, left);\n\n    /* If we got here, everything went OK, commit the write */\n    memcpy(syslinux_adv + 2 * 4, advtmp, ADV_LEN);\n    cleanup_adv(syslinux_adv);\n\n    return 0;\n}\n\nvoid syslinux_reset_adv(unsigned char *advbuf)\n{\n    /* Create an all-zero ADV */\n    memset(advbuf + 2 * 4, 0, ADV_LEN);\n    cleanup_adv(advbuf);\n}\n\nstatic int adv_consistent(const unsigned char *p)\n{\n    int i;\n    uint32_t csum;\n\n    if (get_32((uint32_t *) p) != ADV_MAGIC1 ||\n\tget_32((uint32_t *) (p + ADV_SIZE - 4)) != ADV_MAGIC3)\n\treturn 0;\n\n    csum = 0;\n    for (i = 4; i < ADV_SIZE - 4; i += 4)\n\tcsum += get_32((uint32_t *) (p + i));\n\n    return csum == ADV_MAGIC2;\n}\n\n/*\n * Verify that an in-memory ADV is consistent, making the copies consistent.\n * If neither copy is OK, return -1 and call syslinux_reset_adv().\n */\nint syslinux_validate_adv(unsigned char *advbuf)\n{\n    if (adv_consistent(advbuf + 0 * ADV_SIZE)) {\n\tmemcpy(advbuf + ADV_SIZE, advbuf, ADV_SIZE);\n\treturn 0;\n    } else if (adv_consistent(advbuf + 1 * ADV_SIZE)) {\n\tmemcpy(advbuf, advbuf + ADV_SIZE, ADV_SIZE);\n\treturn 0;\n    } else {\n\tsyslinux_reset_adv(advbuf);\n\treturn -1;\n    }\n}\n"
  },
  {
    "path": "src/syslinux/libinstaller/setadv.h",
    "content": "#ifndef _H_SET_ADV_\n#define _H_SET_ADV_\n\n/* ADV information */\n#define ADV_SIZE\t512\t/* Total size */\n#define ADV_LEN\t\t(ADV_SIZE-3*4)\t/* Usable data size */\n\nextern unsigned char syslinux_adv[2 * ADV_SIZE];\n\nint syslinux_setadv(int tag, size_t size, const void *data);\nvoid syslinux_reset_adv(unsigned char *advbuf);\nint syslinux_validate_adv(unsigned char *advbuf);\nint read_adv(const char *path, const char *cfg);\nint write_adv(const char *path, const char *cfg);\n\n#endif\n"
  },
  {
    "path": "src/syslinux/libinstaller/syslinux.h",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 1998-2008 H. Peter Anvin - All Rights Reserved\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n#ifndef SYSLINUX_H\n#define SYSLINUX_H\n\n#include <inttypes.h>\n#include \"advconst.h\"\n#include \"setadv.h\"\n\n#ifdef __CHECKER__\n# define _slimg __attribute__((noderef,address_space(1)))\n# define _force __attribute__((force))\n#else\n# define _slimg\n# define _force\n#endif\n\n/* The standard boot sector and ldlinux image */\nextern unsigned char* syslinux_ldlinux[2];\nextern unsigned long syslinux_ldlinux_len[2];\nextern const int syslinux_ldlinux_mtime[2];\n\n#define boot_sector\tsyslinux_ldlinux[1]\n#define boot_sector_len syslinux_ldlinux_len[1]\n#define boot_image\tsyslinux_ldlinux[0]\n#define boot_image_len\tsyslinux_ldlinux_len[0]\n\nextern unsigned char syslinux_mbr[];\nextern const unsigned int syslinux_mbr_len;\nextern const int syslinux_mbr_mtime;\n\n/* Sector size variables are defined externally for 4K support */\nextern uint32_t SECTOR_SHIFT;\nextern uint32_t SECTOR_SIZE;\n\n/* This takes a boot sector and merges in the syslinux fields */\nvoid syslinux_make_bootsect(void *bs, int fs_type);\n\n/* Check to see that what we got was indeed an MS-DOS boot sector/superblock */\nconst char *syslinux_check_bootsect(const void *bs, int *fs_type);\n\n/* This patches the boot sector and ldlinux.sys based on a sector map */\ntypedef uint64_t sector_t;\nint syslinux_patch(const sector_t *sectors, int nsectors,\n\t\t   int stupid, int raid_mode,\n\t\t   const char *subdir, const char *subvol);\n\n#endif\n"
  },
  {
    "path": "src/syslinux/libinstaller/syslxcom.h",
    "content": "#ifndef _H_SYSLXCOM_\r\n#define _H_SYSLXCOM_\r\n\r\n/* Rufus placeholder */\r\n\r\n#endif\r\n"
  },
  {
    "path": "src/syslinux/libinstaller/syslxfs.h",
    "content": "/*\r\n *   Copyright 2011-2012 Paulo Alcantara <pcacjr@zytor.com>\n *\r\n *   This program is free software; you can redistribute it and/or modify\r\n *   it under the terms of the GNU General Public License as published by\r\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\r\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\r\n *   (at your option) any later version; incorporated herein by reference.\r\n *\r\n * ----------------------------------------------------------------------- */\r\n\r\n#ifndef _SYSLXFS_H_\r\n#define _SYSLXFS_H_\r\n\r\n/* Global fs_type for handling fat, ntfs, ext2/3/4, btrfs, xfs and ufs1/2 */\nenum filesystem {\r\n    NONE,\r\n    EXT2,\r\n    BTRFS,\r\n    VFAT,\r\n    NTFS,\r\n    XFS,\n    UFS1,\n    UFS2,\n};\r\n\r\n//extern int fs_type;\r\n\r\n#endif /* _SYSLXFS_H_ */\r\n"
  },
  {
    "path": "src/syslinux/libinstaller/syslxint.h",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved\n *   Copyright 2009-2014 Intel Corporation; author: H. Peter Anvin\n *   Copyright 2011 Paulo Alcantara <pcacjr@gmail.com>\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n#ifndef SYSLXINT_H\n#define SYSLXINT_H\n\n#include \"syslinux.h\"\n\n#if defined(__386__) || defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)\n# define X86_MEM 1\t\t/* Littleendian and unaligned safe */\n#else\n# define X86_MEM 0\n#endif\n\n#if defined(__GNUC__) || defined(__clang__)\n# ifdef __MINGW32__\n   /* gcc 4.7 miscompiles packed structures in MS-bitfield mode */\n#  define PACKME\n#  define PACKED __attribute__((packed,gcc_struct))\n# else\n#  define PACKME\n#  define PACKED __attribute__((packed))\n# endif\n#elif defined(_MSC_VER)\n# define PACKME __pragma(pack(push, 1))\n# define PACKED __pragma(pack(pop))\n#else\n# error \"Need to define PACKED for this compiler\"\n#endif\n\n/*\n * Access functions for littleendian numbers, possibly misaligned.\n */\nstatic inline uint8_t get_8(const uint8_t * p)\n{\n    return *p;\n}\n\nstatic inline uint16_t get_16(const uint16_t * p)\n{\n#if X86_MEM\n    /* Littleendian and unaligned-capable */\n    return *p;\n#else\n    const uint8_t *pp = (const uint8_t *)p;\n    return pp[0] + ((uint16_t)pp[1] << 8);\n#endif\n}\n\nstatic inline uint32_t get_32(const uint32_t * p)\n{\n#if X86_MEM\n    /* Littleendian and unaligned-capable */\n    return *p;\n#else\n    const uint16_t *pp = (const uint16_t *)p;\n    return get_16(&pp[0]) + ((uint32_t)get_16(&pp[1]) << 16);\n#endif\n}\n\nstatic inline uint64_t get_64(const uint64_t * p)\n{\n#if X86_MEM\n    /* Littleendian and unaligned-capable */\n    return *p;\n#else\n    const uint32_t *pp = (const uint32_t *)p;\n    return get_32(&pp[0]) + ((uint64_t)get_32(&pp[1]) << 32);\n#endif\n}\n\nstatic inline void set_8(uint8_t *p, uint8_t v)\n{\n    *p = v;\n}\n\nstatic inline void set_16(uint16_t *p, uint16_t v)\n{\n#if X86_MEM\n    /* Littleendian and unaligned-capable */\n    *p = v;\n#else\n    uint8_t *pp = (uint8_t *) p;\n    pp[0] = v;\n    pp[1] = v >> 8;\n#endif\n}\n\nstatic inline void set_32(uint32_t *p, uint32_t v)\n{\n#if X86_MEM\n    /* Littleendian and unaligned-capable */\n    *p = v;\n#else\n    uint16_t *pp = (uint16_t *) p;\n    set_16(&pp[0], v);\n    set_16(&pp[1], v >> 16);\n#endif\n}\n\nstatic inline void set_64(uint64_t *p, uint64_t v)\n{\n#if X86_MEM\n    /* Littleendian and unaligned-capable */\n    *p = v;\n#else\n    uint32_t *pp = (uint32_t *) p;\n    set_32(&pp[0], v);\n    set_32(&pp[1], v >> 32);\n#endif\n}\n\n/*\n * Special handling for the MS-DOS derivative: syslinux_ldlinux\n * is a \"far\" object...\n */\n#ifdef __MSDOS__\n\nuint8_t get_8_sl(const uint8_t _slimg * p);\nuint16_t get_16_sl(const uint16_t _slimg * p);\nuint32_t get_32_sl(const uint32_t _slimg * p);\nuint64_t get_64_sl(const uint64_t _slimg * p);\nvoid set_8_sl(uint8_t _slimg * p, uint8_t v);\nvoid set_16_sl(uint16_t _slimg * p, uint16_t v);\nvoid set_32_sl(uint32_t _slimg * p, uint32_t v);\nvoid set_64_sl(uint64_t _slimg * p, uint64_t v);\nvoid memcpy_to_sl(void _slimg *dst, const void *src, size_t len);\nvoid memcpy_from_sl(void *dst, const void _slimg *src, size_t len);\nvoid memset_sl(void _slimg *dst, int c, size_t len);\n\n#else\n\n/* Sane system ... */\nstatic inline uint8_t get_8_sl(const uint8_t _slimg * p)\n{\n    return get_8((const uint8_t _force *)p);\n}\nstatic inline uint16_t get_16_sl(const uint16_t _slimg * p)\n{\n    return get_16((const uint16_t _force *)p);\n}\nstatic inline uint32_t get_32_sl(const uint32_t _slimg * p)\n{\n    return get_32((const uint32_t _force *)p);\n}\nstatic inline uint64_t get_64_sl(const uint64_t _slimg * p)\n{\n    return get_64((const uint64_t _force *)p);\n}\nstatic inline void set_8_sl(uint8_t _slimg * p, uint8_t v)\n{\n    set_8((uint8_t _force *)p, v);\n}\nstatic inline void set_16_sl(uint16_t _slimg * p, uint16_t v)\n{\n    set_16((uint16_t _force *)p, v);\n}\nstatic inline void set_32_sl(uint32_t _slimg * p, uint32_t v)\n{\n    set_32((uint32_t _force *)p, v);\n}\nstatic inline void set_64_sl(uint64_t _slimg * p, uint64_t v)\n{\n    set_64((uint64_t _force *)p, v);\n}\nstatic inline void memcpy_to_sl(void _slimg *dst, const void *src, size_t len)\n{\n    memcpy((void _force *)dst, src, len);\n}\nstatic inline void memcpy_from_sl(void *dst, const void _slimg *src, size_t len)\n{\n    memcpy(dst, (const void _force *)src, len);\n}\nstatic inline void memset_sl(void _slimg *dst, int c, size_t len)\n{\n    memset((void _force *)dst, c, len);\n}\n\n#endif\n\n#define LDLINUX_MAGIC\t0x3eb202fe\n#define BS_MAGIC_VER\t(0x1b << 9)\n\n/* Patch area for disk-based installers */\nstruct patch_area {\n    uint32_t magic;\t\t/* LDLINUX_MAGIC */\n    uint32_t instance;\t\t/* Per-version value */\n    uint16_t data_sectors;\n    uint16_t adv_sectors;\n    uint32_t dwords;\n    uint32_t checksum;\n    uint16_t maxtransfer;\n    uint16_t epaoffset;\t\t/* Pointer to the extended patch area */\n};\n\nstruct ext_patch_area {\n    uint16_t advptroffset;\t/* ADV pointers */\n    uint16_t diroffset;\t\t/* Current directory field */\n    uint16_t dirlen;\t\t/* Length of current directory field */\n    uint16_t subvoloffset;\t/* Subvolume field */\n    uint16_t subvollen;\t\t/* Length of subvolume field */\n    uint16_t secptroffset;\t/* Sector extent pointers */\n    uint16_t secptrcnt;\t\t/* Number of sector extent pointers */\n\n    uint16_t sect1ptr0;\t\t/* Boot sector offset of sector 1 ptr LSW */\n    uint16_t sect1ptr1;\t\t/* Boot sector offset of sector 1 ptr MSW */\n    uint16_t raidpatch;\t\t/* Boot sector RAID mode patch pointer */\n};\n\n/* Sector extent */\nPACKME\nstruct syslinux_extent {\n    uint64_t lba;\n    uint16_t len;\n} PACKED;\n\n/* FAT bootsector format, also used by other disk-based derivatives */\nPACKME\nstruct fat_boot_sector {\n    uint8_t bsJump[3];\n    char bsOemName[8];\n    uint16_t bsBytesPerSec;\n    uint8_t bsSecPerClust;\n    uint16_t bsResSectors;\n    uint8_t bsFATs;\n    uint16_t bsRootDirEnts;\n    uint16_t bsSectors;\n    uint8_t bsMedia;\n    uint16_t bsFATsecs;\n    uint16_t bsSecPerTrack;\n    uint16_t bsHeads;\n    uint32_t bsHiddenSecs;\n    uint32_t bsHugeSectors;\n\n    PACKME\n    union {\n\tPACKME\n\tstruct {\n\t    uint8_t DriveNumber;\n\t    uint8_t Reserved1;\n\t    uint8_t BootSignature;\n\t    uint32_t VolumeID;\n\t    char VolumeLabel[11];\n\t    char FileSysType[8];\n\t    uint8_t Code[442];\n\t} PACKED bs16;\n\tPACKME\n\tstruct {\n\t    uint32_t FATSz32;\n\t    uint16_t ExtFlags;\n\t    uint16_t FSVer;\n\t    uint32_t RootClus;\n\t    uint16_t FSInfo;\n\t    uint16_t BkBootSec;\n\t    uint8_t Reserved0[12];\n\t    uint8_t DriveNumber;\n\t    uint8_t Reserved1;\n\t    uint8_t BootSignature;\n\t    uint32_t VolumeID;\n\t    char VolumeLabel[11];\n\t    char FileSysType[8];\n\t    uint8_t Code[414];\n\t} PACKED bs32;\n    } PACKED;\n\n    uint32_t bsMagic;\n    uint16_t bsForwardPtr;\n    uint16_t bsSignature;\n} PACKED;\n\n/* NTFS bootsector format */\nPACKME\nstruct ntfs_boot_sector {\n    uint8_t bsJump[3];\n    char bsOemName[8];\n    uint16_t bsBytesPerSec;\n    uint8_t bsSecPerClust;\n    uint16_t bsResSectors;\n    uint8_t bsZeroed_0[3];\n    uint16_t bsZeroed_1;\n    uint8_t bsMedia;\n    uint16_t bsZeroed_2;\n    uint16_t bsUnused_0;\n    uint16_t bsUnused_1;\n    uint32_t bsUnused_2;\n    uint32_t bsZeroed_3;\n    uint32_t bsUnused_3;\n    uint64_t bsTotalSectors;\n    uint64_t bsMFTLogicalClustNr;\n    uint64_t bsMFTMirrLogicalClustNr;\n    uint8_t bsClustPerMFTrecord;\n    uint8_t bsUnused_4[3];\n    uint8_t bsClustPerIdxBuf;\n    uint8_t bsUnused_5[3];\n    uint64_t bsVolSerialNr;\n    uint32_t bsUnused_6;\n\n    uint8_t Code[420];\n\n    uint32_t bsMagic;\n    uint16_t bsForwardPtr;\n    uint16_t bsSignature;\n} PACKED;\n\n#define FAT_bsHead      bsJump\n#define FAT_bsHeadLen   offsetof(struct fat_boot_sector, bsBytesPerSec)\n#define FAT_bsCode\t    bs32.Code\t/* The common safe choice */\n#define FAT_bsCodeLen   (offsetof(struct fat_boot_sector, bsSignature) - \\\n\t\t     offsetof(struct fat_boot_sector, FAT_bsCode))\n\n#define NTFS_bsHead     bsJump\n#define NTFS_bsHeadLen  offsetof(struct ntfs_boot_sector, bsOemName)\n#define NTFS_bsCode     Code\n#define NTFS_bsCodeLen  (offsetof(struct ntfs_boot_sector, bsSignature) - \\\n                            offsetof(struct ntfs_boot_sector, NTFS_bsCode))\n\n/* Check if there are specific zero fields in an NTFS boot sector */\nstatic inline int ntfs_check_zero_fields(const struct ntfs_boot_sector *sb)\n{\n    return !sb->bsResSectors && (!sb->bsZeroed_0[0] && !sb->bsZeroed_0[1] &&\n            !sb->bsZeroed_0[2]) && !sb->bsZeroed_1 && !sb->bsZeroed_2 &&\n            !sb->bsZeroed_3;\n}\n\nstatic inline int ntfs_check_sb_fields(const struct ntfs_boot_sector *sb)\n{\n    return ntfs_check_zero_fields(sb) &&\n            (!memcmp(sb->bsOemName, \"NTFS    \", 8) ||\n             !memcmp(sb->bsOemName, \"MSWIN4.0\", 8) ||\n             !memcmp(sb->bsOemName, \"MSWIN4.1\", 8));\n}\n\nstatic inline int fat_check_sb_fields(const struct fat_boot_sector *sb)\n{\n    return sb->bsResSectors && sb->bsFATs &&\n            (!memcmp(sb->bs16.FileSysType, \"FAT12   \", 8) ||\n             !memcmp(sb->bs16.FileSysType, \"FAT16   \", 8) ||\n             !memcmp(sb->bs16.FileSysType, \"FAT     \", 8) ||\n             !memcmp(sb->bs32.FileSysType, \"FAT32   \", 8));\n}\n\n#endif /* SYSLXINT_H */\n"
  },
  {
    "path": "src/syslinux/libinstaller/syslxmod.c",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 1998-2008 H. Peter Anvin - All Rights Reserved\n *   Copyright 2009-2014 Intel Corporation; author H. Peter Anvin\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/*\n * syslxmod.c - Code to provide a SYSLINUX code set to an installer.\n */\n\n#define _XOPEN_SOURCE 500\t/* Required on glibc 2.x */\n#define _BSD_SOURCE\n/* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */\n#define _DEFAULT_SOURCE 1\n#include <stdio.h>\n#include <inttypes.h>\n#include <string.h>\n#include <stddef.h>\n#include <stdlib.h>\n\n#include \"syslinux.h\"\n#include \"syslxint.h\"\n\nextern void uprintf(const char* format, ...);\n\n/*\n * Generate sector extents\n */\nstatic void generate_extents(struct syslinux_extent _slimg *ex, int nptrs,\n\t\t\t     const sector_t *sectp, int nsect)\n{\n    uint32_t addr = 0x8000;\t/* ldlinux.sys starts loading here */\n    uint32_t base;\n    sector_t sect, lba;\n    unsigned int len;\n\n    base = addr;\n    len = 0;\n    lba = 0;\n\n    memset_sl(ex, 0, nptrs * sizeof *ex);\n\n    while (nsect) {\n\tsect = *sectp++;\n\n\tif (len) {\n\t    uint32_t xbytes = (len + 1) * SECTOR_SIZE;\n\n\t    if (sect == lba + len && xbytes < 65536 &&\n\t\t((addr ^ (base + xbytes - 1)) & 0xffff0000) == 0) {\n\t\t/* We can add to the current extent */\n\t\tlen++;\n\t\tgoto next;\n\t    }\n\n\t    set_64_sl(&ex->lba, lba);\n\t    set_16_sl(&ex->len, len);\n\t    ex++;\n\t}\n\n\tbase = addr;\n\tlba  = sect;\n\tlen  = 1;\n\n    next:\n\taddr += SECTOR_SIZE;\n\tnsect--;\n    }\n\n    if (len) {\n\tset_64_sl(&ex->lba, lba);\n\tset_16_sl(&ex->len, len);\n\tex++;\n    }\n}\n\n/*\n * Form a pointer based on a 16-bit patcharea/epa field\n */\nstatic inline void *ptr(void *img, const uint16_t _slimg *offset_p)\n{\n    return (char *)img + get_16_sl(offset_p);\n}\nstatic inline void _slimg *slptr(void _slimg *img,\n\t\t\t\t const uint16_t _slimg *offset_p)\n{\n    return (char _slimg *)img + get_16_sl(offset_p);\n}\n\n/*\n * This patches the boot sector and the beginning of ldlinux.sys\n * based on an ldlinux.sys sector map passed in.  Typically this is\n * handled by writing ldlinux.sys, mapping it, and then overwrite it\n * with the patched version.  If this isn't safe to do because of\n * an OS which does block reallocation, then overwrite it with\n * direct access since the location is known.\n *\n * Returns the number of modified bytes in ldlinux.sys if successful,\n * otherwise -1.\n */\nint syslinux_patch(const sector_t *sectp, int nsectors,\n\t\t   int stupid, int raid_mode,\n\t\t   const char *subdir, const char *subvol)\n{\n    struct patch_area _slimg *patcharea;\n    struct ext_patch_area _slimg *epa;\n    struct syslinux_extent _slimg *ex;\n    const uint32_t _slimg *wp;\n    int nsect = ((boot_image_len + SECTOR_SIZE - 1) >> SECTOR_SHIFT) + 2;\n    uint32_t csum;\n    int i, dw, nptrs;\n    struct fat_boot_sector *sbs = (struct fat_boot_sector *)boot_sector;\n    uint64_t _slimg *advptrs;\n\n    if (nsectors < nsect)\n\treturn -1;\t\t/* The actual file is too small for content */\n\n    /* Search for LDLINUX_MAGIC to find the patch area */\n    dw = (boot_image_len - sizeof(struct patch_area)) >> 2;\n    for (i = 0, wp = (const uint32_t _slimg *)boot_image;\n\t (i <= dw) && ((get_32_sl(wp) != LDLINUX_MAGIC));\n\t i++, wp++);\n    if (i > dw)\t/* Not found */\n\treturn -1;\n    patcharea = (struct patch_area _slimg *)wp;\n    epa = slptr(boot_image, &patcharea->epaoffset);\n\n    /* First sector need pointer in boot sector */\n    set_32(ptr(sbs, &epa->sect1ptr0), sectp[0]);\n    set_32(ptr(sbs, &epa->sect1ptr1), sectp[0] >> 32);\n    sectp++;\n\n    /* Handle RAID mode */\n    if (raid_mode) {\n\t/* Patch in INT 18h = CD 18 */\n\tset_16(ptr(sbs, &epa->raidpatch), 0x18CD);\n    }\n\n    /* Set up the totals */\n    dw = boot_image_len >> 2;\t/* COMPLETE dwords, excluding ADV */\n    set_16_sl(&patcharea->data_sectors, nsect - 2); /* Not including ADVs */\n    set_16_sl(&patcharea->adv_sectors, 2);\t/* ADVs need 2 sectors */\n    set_32_sl(&patcharea->dwords, dw);\n\n    /* Handle Stupid mode */\n    if (stupid) {\n\t/* Access only one sector at a time */\n\tset_16_sl(&patcharea->maxtransfer, 1);\n    }\n\n    /* Set the sector extents */\n    ex = slptr(boot_image, &epa->secptroffset);\n    nptrs = get_16_sl(&epa->secptrcnt);\n\n#if 0\n    if (nsect > nptrs) {\n\t/* Not necessarily an error in this case, but a general problem */\n\tuprintf(\"syslinux_patch: Insufficient extent space, build error!\\n\");\n\treturn -1;\n    }\n#endif\n\n    /* -1 for the pointer in the boot sector, -2 for the two ADVs */\n    // coverity[tainted_data]\n    generate_extents(ex, nptrs, sectp, nsect-1-2);\n\n    /* ADV pointers */\n    advptrs = slptr(boot_image, &epa->advptroffset);\n    set_64_sl(&advptrs[0], sectp[nsect-1-2]);\n    set_64_sl(&advptrs[1], sectp[nsect-1-1]);\n\n    /* Poke in the base directory path */\n    if (subdir) {\n\tint sublen = strlen(subdir) + 1;\n\tif (get_16_sl(&epa->dirlen) < sublen) {\n\t    uprintf(\"syslinux_patch: Subdirectory path too long... aborting install!\");\n\t    return -1;\n\t}\n\tmemcpy_to_sl(slptr(boot_image, &epa->diroffset), subdir, sublen);\n    }\n\n    /* Poke in the subvolume information */\n    if (subvol) {\n\tint sublen = strlen(subvol) + 1;\n\tif (get_16_sl(&epa->subvollen) < sublen) {\n\t    uprintf(\"syslinux_patch: Subvol name too long... aborting install!\");\n\t    return -1;\n\t}\n\tmemcpy_to_sl(slptr(boot_image, &epa->subvoloffset), subvol, sublen);\n    }\n\n    /* Now produce a checksum */\n    set_32_sl(&patcharea->checksum, 0);\n\n    csum = LDLINUX_MAGIC;\n    for (i = 0, wp = (const uint32_t _slimg *)boot_image; i < dw; i++, wp++)\n\tcsum -= get_32_sl(wp);\t/* Negative checksum */\n\n    set_32_sl(&patcharea->checksum, csum);\n\n    /*\n     * Assume all bytes modified.  This can be optimized at the expense\n     * of keeping track of what the highest modified address ever was.\n     */\n    return dw << 2;\n}\n"
  },
  {
    "path": "src/syslinux/sltypes.h",
    "content": "#ifndef _MSC_VER\n#error This header should only be used with Microsoft compilers\n#endif\n\n/* The addons below are not part of inttypes but required for syslinux */\n\n#ifndef _SLTYPES_H_\n#define _SLTYPES_H_\n\n/* On MS environments, the inline keyword is available in C++ only */\n#ifndef inline\n#define inline __inline\n#endif\n\n/* ssize_t is also not available (copy/paste from MinGW) */\n#ifndef _SSIZE_T_DEFINED\n#define _SSIZE_T_DEFINED\n#undef ssize_t\n#ifdef _WIN64\n  typedef __int64 ssize_t;\n#else\n  typedef int ssize_t;\n#endif /* _WIN64 */\n#endif /* _SSIZE_T_DEFINED */\n\n#endif"
  },
  {
    "path": "src/syslinux/win/Makefile.am",
    "content": "noinst_LIBRARIES = libwin.a\n\nlibwin_a_SOURCES = ntfssect.c\nlibwin_a_CFLAGS = $(AM_CFLAGS)\n"
  },
  {
    "path": "src/syslinux/win/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = src/syslinux/win\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLIBRARIES = $(noinst_LIBRARIES)\nARFLAGS = cru\nAM_V_AR = $(am__v_AR_@AM_V@)\nam__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)\nam__v_AR_0 = @echo \"  AR      \" $@;\nam__v_AR_1 = \nlibwin_a_AR = $(AR) $(ARFLAGS)\nlibwin_a_LIBADD =\nam_libwin_a_OBJECTS = libwin_a-ntfssect.$(OBJEXT)\nlibwin_a_OBJECTS = $(am_libwin_a_OBJECTS)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp =\nam__depfiles_maybe =\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libwin_a_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LIBRARIES = libwin.a\nlibwin_a_SOURCES = ntfssect.c\nlibwin_a_CFLAGS = $(AM_CFLAGS)\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/syslinux/win/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps src/syslinux/win/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLIBRARIES:\n\t-test -z \"$(noinst_LIBRARIES)\" || rm -f $(noinst_LIBRARIES)\n\nlibwin.a: $(libwin_a_OBJECTS) $(libwin_a_DEPENDENCIES) $(EXTRA_libwin_a_DEPENDENCIES) \n\t$(AM_V_at)-rm -f libwin.a\n\t$(AM_V_AR)$(libwin_a_AR) libwin.a $(libwin_a_OBJECTS) $(libwin_a_LIBADD)\n\t$(AM_V_at)$(RANLIB) libwin.a\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n.c.o:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\nlibwin_a-ntfssect.o: ntfssect.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwin_a_CFLAGS) $(CFLAGS) -c -o libwin_a-ntfssect.o `test -f 'ntfssect.c' || echo '$(srcdir)/'`ntfssect.c\n\nlibwin_a-ntfssect.obj: ntfssect.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwin_a_CFLAGS) $(CFLAGS) -c -o libwin_a-ntfssect.obj `if test -f 'ntfssect.c'; then $(CYGPATH_W) 'ntfssect.c'; else $(CYGPATH_W) '$(srcdir)/ntfssect.c'; fi`\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LIBRARIES)\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \\\n\tdistclean-compile distclean-generic distclean-tags dvi dvi-am \\\n\thtml html-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "src/syslinux/win/ntfssect.c",
    "content": "/* -------------------------------------------------------------------------- *\n *\n *   Copyright 2011 Shao Miller - All Rights Reserved\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ------------------------------------------------------------------------- */\n\n/****\n * ntfssect.c\n *\n * Fetch NTFS file cluster & sector information via Windows\n *\n * With special thanks to Mark Roddy for his article:\n *   http://www.wd-3.com/archive/luserland.htm\n */\n\n#include <windows.h>\n#include <winioctl.h>\n#include <stddef.h>\n#include <string.h>\n\n#include \"ntfssect.h\"\n\n/*** Macros */\n#define M_ERR(msg) (NtfsSectLastErrorMessage = (msg))\n\n/*** Function declarations */\nstatic DWORD NtfsSectGetVolumeHandle(\n    CHAR * VolumeName,\n    S_NTFSSECT_VOLINFO * VolumeInfo\n  );\nstatic DWORD NtfsSectGetVolumePartitionLba(S_NTFSSECT_VOLINFO * VolumeInfo);\n\n/*** Objects */\nCHAR * NtfsSectLastErrorMessage;\n\n/*** Function definitions */\nDWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent(\n    HANDLE File,\n    LARGE_INTEGER * Vcn,\n    S_NTFSSECT_EXTENT * Extent\n  ) {\n    BOOL bad;\n    DWORD output_size, rc;\n    STARTING_VCN_INPUT_BUFFER input;\n    RETRIEVAL_POINTERS_BUFFER output;\n\n    bad = (\n        File == INVALID_HANDLE_VALUE ||\n        !Vcn ||\n        Vcn->QuadPart < 0 ||\n        !Extent\n      );\n    if (bad)\n      return ERROR_INVALID_PARAMETER;\n\n    input.StartingVcn = *Vcn;\n    (void)DeviceIoControl(\n        File,\n        FSCTL_GET_RETRIEVAL_POINTERS,\n        &input,\n        sizeof input,\n        &output,\n        sizeof output,\n        &output_size,\n        NULL\n      );\n    rc = GetLastError();\n    switch (rc) {\n        case NO_ERROR:\n        case ERROR_MORE_DATA:\n          Extent->FirstVcn = output.StartingVcn;\n          Extent->NextVcn = output.Extents[0].NextVcn;\n          Extent->FirstLcn = output.Extents[0].Lcn;\n          return ERROR_SUCCESS;\n\n        case ERROR_HANDLE_EOF:\n          break;\n\n        default:\n          M_ERR(\"NtfsSectGetFileVcnExtent(): Unknown status!\");\n      }\n\n    return rc;\n  }\n\n/* Internal use only */\nstatic DWORD NtfsSectGetVolumeHandle(\n    CHAR * VolumeName,\n    S_NTFSSECT_VOLINFO * VolumeInfo\n  ) {\n    #define M_VOL_PREFIX \"\\\\\\\\.\\\\\"\n    CHAR volname[sizeof M_VOL_PREFIX - 1 + MAX_PATH + 1] = M_VOL_PREFIX;\n    CHAR * const volname_short = volname + sizeof M_VOL_PREFIX - 1;\n    CHAR * c;\n    DWORD rc;\n\n    /* Prefix \"\\\\.\\\" onto the passed volume name */\n    strcpy(volname + sizeof M_VOL_PREFIX - 1, VolumeName);\n\n    /* Find the last non-null character */\n    for (c = volname_short; *c; ++c)\n      ;\n\n    /* Remove trailing back-slash */\n    if (c[-1] == '\\\\')\n      c[-1] = 0;\n\n    /* Open the volume */\n    VolumeInfo->Handle = CreateFileA(\n        volname,\n        GENERIC_READ,\n        FILE_SHARE_READ | FILE_SHARE_WRITE,\n        NULL,\n        OPEN_EXISTING,\n        0,\n        NULL\n      );\n    rc = GetLastError();\n    if (VolumeInfo->Handle == INVALID_HANDLE_VALUE) {\n        M_ERR(\"Unable to open volume handle!\");\n        goto err_handle;\n      }\n    CloseHandle(VolumeInfo->Handle);\n\n    return ERROR_SUCCESS;\n\n    err_handle:\n\n    return rc;\n  }\n\nDWORD M_NTFSSECT_API NtfsSectGetVolumeInfo(\n    CHAR * VolumeName,\n    S_NTFSSECT_VOLINFO * VolumeInfo\n  ) {\n    S_NTFSSECT_XPFUNCS xp_funcs;\n    DWORD rc, free_clusts, total_clusts;\n    BOOL ok;\n\n    if (!VolumeName || !VolumeInfo)\n      return ERROR_INVALID_PARAMETER;\n\n    /* Only create a handle if it's not already been set */\n    if ((VolumeInfo->Handle == NULL) || (VolumeInfo->Handle == INVALID_HANDLE_VALUE)) {\n      rc = NtfsSectGetVolumeHandle(VolumeName, VolumeInfo);\n      if (rc != ERROR_SUCCESS)\n        goto err_handle;\n      if ((VolumeInfo->Handle == NULL) || (VolumeInfo->Handle == INVALID_HANDLE_VALUE))\n        return ERROR_INVALID_HANDLE;\n    }\n\n    rc = NtfsSectLoadXpFuncs(&xp_funcs);\n    if (rc != ERROR_SUCCESS)\n      goto err_xp_funcs;\n\n    ok = xp_funcs.GetDiskFreeSpace(\n        VolumeName,\n        &VolumeInfo->SectorsPerCluster,\n        &VolumeInfo->BytesPerSector,\n        &free_clusts,\n        &total_clusts\n      );\n    rc = GetLastError();\n    if (!ok) {\n        M_ERR(\"GetDiskFreeSpace() failed!\");\n        goto err_freespace;\n      }\n\n    rc = NtfsSectGetVolumePartitionLba(VolumeInfo);\n    if (rc != ERROR_SUCCESS)\n      goto err_lba;\n\n    VolumeInfo->Size = sizeof *VolumeInfo;\n    rc = ERROR_SUCCESS;\n\n    err_lba:\n\n    err_freespace:\n\n    NtfsSectUnloadXpFuncs(&xp_funcs);\n    err_xp_funcs:\n\n    if (rc != ERROR_SUCCESS) {\n        CloseHandle(VolumeInfo->Handle);\n        VolumeInfo->Handle = INVALID_HANDLE_VALUE;\n      }\n    err_handle:\n\n    return rc;\n  }\n\nDWORD M_NTFSSECT_API NtfsSectGetVolumeInfoFromFileName(\n    CHAR * FileName,\n    S_NTFSSECT_VOLINFO * VolumeInfo\n  ) {\n    S_NTFSSECT_XPFUNCS xp_funcs;\n    DWORD rc;\n    CHAR volname[MAX_PATH + 1];\n    BOOL ok;\n\n    if (!FileName || !VolumeInfo)\n      return ERROR_INVALID_PARAMETER;\n\n    rc = NtfsSectLoadXpFuncs(&xp_funcs);\n    if (rc != ERROR_SUCCESS) {\n        goto err_xp_funcs;\n      }\n\n    ok = xp_funcs.GetVolumePathName(\n        FileName,\n        volname,\n        sizeof volname\n      );\n    rc = GetLastError();\n    if (!ok) {\n        M_ERR(\"GetVolumePathName() failed!\");\n        goto err_volname;\n      }\n\n    rc = NtfsSectGetVolumeInfo(volname, VolumeInfo);\n\n    err_volname:\n\n    NtfsSectUnloadXpFuncs(&xp_funcs);\n    err_xp_funcs:\n\n    return rc;\n  }\n\n/* Internal use only */\nstatic DWORD NtfsSectGetVolumePartitionLba(S_NTFSSECT_VOLINFO * VolumeInfo) {\n    BOOL ok;\n    VOLUME_DISK_EXTENTS vol_disk_extents;\n    DWORD output_size, rc;\n\n    ok = DeviceIoControl(\n        VolumeInfo->Handle,\n        IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,\n        NULL,\n        0,\n        &vol_disk_extents,\n        sizeof vol_disk_extents,\n        &output_size,\n        NULL\n      );\n    rc = GetLastError();\n    if (!ok) {\n        M_ERR(\"Couldn't fetch volume disk extent(s)!\");\n        goto err_vol_disk_extents;\n      }\n\n    if (vol_disk_extents.NumberOfDiskExtents != 1) {\n        M_ERR(\"Unsupported number of volume disk extents!\");\n        goto err_num_of_extents;\n      }\n\n    VolumeInfo->PartitionLba.QuadPart = (\n        vol_disk_extents.Extents[0].StartingOffset.QuadPart /\n        VolumeInfo->BytesPerSector\n      );\n\n    return ERROR_SUCCESS;\n\n    err_num_of_extents:\n\n    err_vol_disk_extents:\n\n    return rc;\n  }\n\nDWORD M_NTFSSECT_API NtfsSectLcnToLba(\n    const S_NTFSSECT_VOLINFO * VolumeInfo,\n    const LARGE_INTEGER * Lcn,\n    LARGE_INTEGER * Lba\n  ) {\n    BOOL bad;\n    bad = (\n        !VolumeInfo ||\n        !VolumeInfo->BytesPerSector ||\n        !VolumeInfo->SectorsPerCluster ||\n        !Lcn ||\n        Lcn->QuadPart < 0 ||\n        !Lba\n      );\n    if (bad)\n      return ERROR_INVALID_PARAMETER;\n\n    Lba->QuadPart = (\n        VolumeInfo->PartitionLba.QuadPart +\n        Lcn->QuadPart *\n        VolumeInfo->SectorsPerCluster\n      );\n    return ERROR_SUCCESS;\n  }\n\nDWORD M_NTFSSECT_API NtfsSectLoadXpFuncs(S_NTFSSECT_XPFUNCS * XpFuncs) {\n    DWORD rc;\n\n    if (!XpFuncs)\n      return ERROR_INVALID_PARAMETER;\n\n    XpFuncs->Size = sizeof *XpFuncs;\n\n    XpFuncs->Kernel32 = LoadLibraryExA(\"kernel32.dll\", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);\n    rc = GetLastError();\n    if (!XpFuncs->Kernel32) {\n        M_ERR(\"KERNEL32.DLL not found!\");\n        goto err;\n      }\n\n    XpFuncs->GetVolumePathName = (F_KERNEL32_GETVOLUMEPATHNAME *) (\n        GetProcAddress(\n            XpFuncs->Kernel32,\n            \"GetVolumePathNameA\"\n          )\n      );\n    rc = GetLastError();\n    if (!XpFuncs->GetVolumePathName) {\n        M_ERR(\"GetVolumePathName() not found in KERNEL32.DLL!\");\n        goto err;\n      }\n\n    XpFuncs->GetDiskFreeSpace = (F_KERNEL32_GETDISKFREESPACE *) (\n        GetProcAddress(\n            XpFuncs->Kernel32,\n            \"GetDiskFreeSpaceA\"\n          )\n      );\n    rc = GetLastError();\n    if (!XpFuncs->GetDiskFreeSpace) {\n        M_ERR(\"GetDiskFreeSpace() not found in KERNEL32.DLL!\");\n        goto err;\n      }\n\n    return ERROR_SUCCESS;\n\n    err:\n    NtfsSectUnloadXpFuncs(XpFuncs);\n    return rc;\n  }\n\nVOID M_NTFSSECT_API NtfsSectUnloadXpFuncs(S_NTFSSECT_XPFUNCS * XpFuncs) {\n    if (!XpFuncs)\n      return;\n\n    XpFuncs->GetDiskFreeSpace = NULL;\n    XpFuncs->GetVolumePathName = NULL;\n    if (XpFuncs->Kernel32)\n      FreeLibrary(XpFuncs->Kernel32);\n    XpFuncs->Kernel32 = NULL;\n    XpFuncs->Size = 0;\n    return;\n  }\n\n"
  },
  {
    "path": "src/syslinux/win/ntfssect.h",
    "content": "/* -------------------------------------------------------------------------- *\n *\n *   Copyright 2011 Shao Miller - All Rights Reserved\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ------------------------------------------------------------------------- */\n#ifndef M_NTFSSECT_H_\n\n/****\n * ntfssect.h\n *\n * Fetch NTFS file cluster & sector information via Windows\n *\n * With special thanks to Mark Roddy for his article:\n *   http://www.wd-3.com/archive/luserland.htm\n */\n\n/*** Macros */\n#define M_NTFSSECT_H_\n#define M_NTFSSECT_API\n\n/*** Object types */\n\n/* An \"extent;\" a contiguous range of file data */\ntypedef struct S_NTFSSECT_EXTENT_ S_NTFSSECT_EXTENT;\n\n/* Volume info relevant to file cluster & sector info */\ntypedef struct S_NTFSSECT_VOLINFO_ S_NTFSSECT_VOLINFO;\n\n/* Stores function pointers to some Windows functions */\ntypedef struct S_NTFSSECT_XPFUNCS_ S_NTFSSECT_XPFUNCS;\n\n/*** Function types */\n\n/* The function type for Kernel32.dll's GetDiskFreeSpace() */\ntypedef BOOL WINAPI F_KERNEL32_GETDISKFREESPACE(\n    LPCSTR,\n    LPDWORD,\n    LPDWORD,\n    LPDWORD,\n    LPDWORD\n  );\n\n/* The function type for Kernel32.dll's GetVolumePathName() */\ntypedef BOOL WINAPI F_KERNEL32_GETVOLUMEPATHNAME(LPCSTR, LPCSTR, DWORD);\n\n/*** Function declarations */\n\n/**\n * Fetch the extent containing a particular VCN\n *\n * @v File\n * @v Vcn\n * @v Extent\n * @ret DWORD\n */\nDWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent(\n    HANDLE File,\n    LARGE_INTEGER * Vcn,\n    S_NTFSSECT_EXTENT * Extent\n  );\n\n/**\n * Populate a volume info object\n *\n * @v VolumeName\n * @v VolumeInfo\n * @ret DWORD\n */\nDWORD M_NTFSSECT_API NtfsSectGetVolumeInfo(\n    CHAR * VolumeName,\n    S_NTFSSECT_VOLINFO * VolumeInfo\n  );\n\n/**\n * Populate a volume info object\n *\n * @v FileName\n * @v VolumeInfo\n * @ret DWORD\n */\nDWORD M_NTFSSECT_API NtfsSectGetVolumeInfoFromFileName(\n    CHAR * FileName,\n    S_NTFSSECT_VOLINFO * VolumeInfo\n  );\n\n/**\n * Convert a volume LCN to an absolute disk LBA\n *\n * @v VolumeInfo\n * @v Lcn\n * @v Lba\n * @ret DWORD\n */\nDWORD M_NTFSSECT_API NtfsSectLcnToLba(\n    const S_NTFSSECT_VOLINFO * VolumeInfo,\n    const LARGE_INTEGER * Lcn,\n    LARGE_INTEGER * Lba\n  );\n\n/**\n * Load some helper XP functions\n *\n * @v XpFuncs\n * @ret DWORD\n */\nDWORD M_NTFSSECT_API NtfsSectLoadXpFuncs(S_NTFSSECT_XPFUNCS * XpFuncs);\n\n/**\n * Unload some helper XP functions\n *\n * @v XpFuncs\n * @ret DWORD\n */\nVOID M_NTFSSECT_API NtfsSectUnloadXpFuncs(S_NTFSSECT_XPFUNCS * XpFuncs);\n\n/*** Object declarations */\n\n/**\n * The last error message set by one of our functions.\n * Obviously not per-thread\n */\nextern CHAR * NtfsSectLastErrorMessage;\n\n/*** Struct/union definitions */\nstruct S_NTFSSECT_EXTENT_ {\n    LARGE_INTEGER FirstVcn;\n    LARGE_INTEGER NextVcn;\n    LARGE_INTEGER FirstLcn;\n  };\n\nstruct S_NTFSSECT_VOLINFO_ {\n    DWORD Size;\n    HANDLE Handle;\n    DWORD BytesPerSector;\n    DWORD SectorsPerCluster;\n    LARGE_INTEGER PartitionLba;\n  };\n\nstruct S_NTFSSECT_XPFUNCS_ {\n    DWORD Size;\n    HMODULE Kernel32;\n    F_KERNEL32_GETVOLUMEPATHNAME * GetVolumePathName;\n    F_KERNEL32_GETDISKFREESPACE * GetDiskFreeSpace;\n  };\n\n#endif /* M_NTFSSECT_H_ */\n"
  },
  {
    "path": "src/syslinux.c",
    "content": "/* ----------------------------------------------------------------------- *\n *\n *   Copyright 2003 Lars Munch Christensen - All Rights Reserved\n *   Copyright 1998-2008 H. Peter Anvin - All Rights Reserved\n *   Copyright 2012-2024 Pete Batard\n *\n *   Based on the Linux installer program for SYSLINUX by H. Peter Anvin\n *\n *   This program is free software; you can redistribute it and/or modify\n *   it under the terms of the GNU General Public License as published by\n *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,\n *   Boston MA 02111-1307, USA; either version 2 of the License, or\n *   (at your option) any later version; incorporated herein by reference.\n *\n * ----------------------------------------------------------------------- */\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <windowsx.h>\n#include <stdio.h>\n#include <malloc.h>\n#include <ctype.h>\n\n#include \"rufus.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n\n#include \"drive.h\"\n\n#include \"syslinux.h\"\n#include \"syslxfs.h\"\n#include \"libfat.h\"\n#include \"setadv.h\"\n#include \"ntfssect.h\"\n\nunsigned char* syslinux_ldlinux[2] = { NULL, NULL };\nunsigned long syslinux_ldlinux_len[2];\nunsigned char* syslinux_mboot = NULL;\nunsigned long syslinux_mboot_len;\n\n/* Workaround for 4K support */\nuint32_t SECTOR_SHIFT = 9;\nuint32_t SECTOR_SIZE = 512;\nuint32_t LIBFAT_SECTOR_SHIFT = 9;\nuint32_t LIBFAT_SECTOR_SIZE = 512;\nuint32_t LIBFAT_SECTOR_MASK = 511;\n\n/*\n * Wrapper for ReadFile suitable for libfat\n */\nint libfat_readfile(intptr_t pp, void *buf, size_t secsize, libfat_sector_t sector)\n{\n\tLARGE_INTEGER offset;\n\tDWORD bytes_read;\n\n\toffset.QuadPart = (LONGLONG) sector * secsize;\n\tif (!SetFilePointerEx((HANDLE) pp, offset, NULL, FILE_BEGIN)) {\n\t\tuprintf(\"Could not set pointer to position %llu: %s\", offset.QuadPart, WindowsErrorString());\n\t\treturn 0;\n\t}\n\n\tif (!ReadFile((HANDLE) pp, buf, (DWORD) secsize, &bytes_read, NULL)) {\n\t\tuprintf(\"Could not read sector %llu: %s\", sector, WindowsErrorString());\n\t\treturn 0;\n\t}\n\n\tif (bytes_read != secsize) {\n\t\tuprintf(\"Sector %llu: Read %lu bytes instead of %zu requested\", sector, bytes_read, secsize);\n\t\treturn 0;\n\t}\n\n\treturn (int)secsize;\n}\n\n/*\n * Extract the ldlinux.sys and ldlinux.bss from resources,\n * then patch and install them\n */\nBOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system)\n{\n\tconst LARGE_INTEGER liZero = { {0, 0} };\n\tHANDLE f_handle = INVALID_HANDLE_VALUE;\n\tHANDLE d_handle = INVALID_HANDLE_VALUE;\n\tDWORD bytes_read, err;\n\tS_NTFSSECT_VOLINFO vol_info = { 0 };\n\tLARGE_INTEGER vcn, lba, len;\n\tS_NTFSSECT_EXTENT extent;\n\tBOOL r = FALSE;\n\tFILE* fd;\n\tsize_t length;\n\n\tstatic unsigned char* sectbuf = NULL;\n\tstatic char* resource[2][2] = {\n\t\t{ MAKEINTRESOURCEA(IDR_SL_LDLINUX_V4_SYS), MAKEINTRESOURCEA(IDR_SL_LDLINUX_V4_BSS) },\n\t\t{ MAKEINTRESOURCEA(IDR_SL_LDLINUX_V6_SYS), MAKEINTRESOURCEA(IDR_SL_LDLINUX_V6_BSS) } };\n\tconst char* ldlinux = \"ldlinux\";\n\tconst char* syslinux = \"syslinux\";\n\tconst char* ldlinux_ext[3] = { \"sys\", \"bss\", \"c32\" };\n\tconst char* mboot_c32 = \"mboot.c32\";\n\tchar path[MAX_PATH], tmp[64];\n\tconst char *errmsg;\n\tstruct libfat_filesystem *lf_fs;\n\tlibfat_sector_t s, *secp;\n\tlibfat_sector_t *sectors = NULL;\n\tint ldlinux_sectors;\n\tuint32_t ldlinux_cluster;\n\tint i, w, nsectors, sl_fs_stype;\n\tBOOL use_v5 = (boot_type == BT_SYSLINUX_V6) || ((boot_type == BT_IMAGE) && (SL_MAJOR(img_report.sl_version) >= 5));\n\n\tPrintInfoDebug(0, MSG_234, (boot_type == BT_IMAGE) ? img_report.sl_version_str : embedded_sl_version_str[use_v5?1:0]);\n\n\t/* 4K sector size workaround */\n\tSECTOR_SHIFT = 0;\n\tSECTOR_SIZE = SelectedDrive.SectorSize;\n\twhile (SECTOR_SIZE>>=1)\n\t\tSECTOR_SHIFT++;\n\tSECTOR_SIZE = SelectedDrive.SectorSize;\n\tLIBFAT_SECTOR_SHIFT = SECTOR_SHIFT;\n\tLIBFAT_SECTOR_SIZE = SECTOR_SIZE;\n\tLIBFAT_SECTOR_MASK = SECTOR_SIZE - 1;\n\n\t/* sectbuf should be aligned to at least 8 bytes - see github #767 */\n\tsectbuf = _mm_malloc(SECTOR_SIZE, 16);\n\tif (sectbuf == NULL)\n\t\tgoto out;\n\n\t/*\n\t * First, reopen the volume (we already have a lock). Also, for some\n\t * weird reason.the Syslinux install process *MUST* have FILE_SHARE_WRITE\n\t * on the volume, or else creating 'ldlinux.sys' will fail...\n\t */\n\td_handle = GetLogicalHandle(drive_index, 0, FALSE, TRUE, TRUE);\n\tif ((d_handle == INVALID_HANDLE_VALUE) || (d_handle == NULL)) {\n\t\tuprintf(\"Could open volume for Syslinux installation\");\n\t\tgoto out;\n\t}\n\n\t/* Make sure we can read the boot sector (NB: Re-open already set us to offset 0) */\n\tif (!ReadFile(d_handle, sectbuf, SECTOR_SIZE, &bytes_read, NULL)) {\n\t\tuprintf(\"Could not read VBR\");\n\t\tgoto out;\n\t}\n\tif (bytes_read != SECTOR_SIZE) {\n\t\tuprintf(\"Could not read the whole VBR\");\n\t\tgoto out;\n\t}\n\tif ((errmsg = syslinux_check_bootsect(sectbuf, &sl_fs_stype))) {\n\t\tuprintf(\"Error: %s\", errmsg);\n\t\tgoto out;\n\t}\n\n\t/* Initialize the ADV -- this should be smarter */\n\tsyslinux_reset_adv(syslinux_adv);\n\n\t/* Access a copy of the ldlinux.sys & ldlinux.bss resources (downloaded or embedded) */\n\tif ((syslinux_ldlinux_len[0] != 0) && (syslinux_ldlinux_len[1] != 0)) {\n\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\tfor (i = 0; i < 2; i++) {\n\t\t\tsyslinux_ldlinux[i] = (unsigned char*) malloc(syslinux_ldlinux_len[i]);\n\t\t\tif (syslinux_ldlinux[i] == NULL)\n\t\t\t\tgoto out;\n\t\t\tstatic_sprintf(path, \"%s\\\\%s-%s%s\\\\%s.%s\", FILES_DIR, syslinux, img_report.sl_version_str,\n\t\t\t\timg_report.sl_version_ext, ldlinux, i==0?\"sys\":\"bss\");\n\t\t\tfd = fopen(path, \"rb\");\n\t\t\tif (fd == NULL) {\n\t\t\t\tuprintf(\"Could not open %s\\\\%s\", app_data_dir, path);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tlength = fread(syslinux_ldlinux[i], 1, (size_t)syslinux_ldlinux_len[i], fd);\n\t\t\tfclose(fd);\n\t\t\tif (length != (size_t)syslinux_ldlinux_len[i]) {\n\t\t\t\tuprintf(\"Could not read %s\\\\%s\", app_data_dir, path);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tuprintf(\"Using existing '%s\\\\%s' %s\", app_data_dir, path,\n\t\t\t\tIsBufferInDB(syslinux_ldlinux[i], (size_t)syslinux_ldlinux_len[i])?\"✓\":\"✗\");\n\t\t}\n\t} else {\n\t\tfor (i = 0; i < 2; i++) {\n\t\tstatic_sprintf(tmp, \"%s.%s\", ldlinux, ldlinux_ext[i]);\n\t\tsyslinux_ldlinux_len[i] = 0;\n\t\tsyslinux_ldlinux[i] = GetResource(hMainInstance, resource[use_v5?1:0][i],\n\t\t\t_RT_RCDATA, tmp, &syslinux_ldlinux_len[i], TRUE);\n\t\tif (syslinux_ldlinux[i] == NULL)\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\t/* Create ldlinux.sys file */\n\tstatic_sprintf(path, \"%c:\\\\%s.%s\", toupper(drive_letter), ldlinux, ldlinux_ext[0]);\n\tf_handle = CreateFileA(path, GENERIC_READ | GENERIC_WRITE,\n\t\t\t  FILE_SHARE_READ | FILE_SHARE_WRITE,\n\t\t\t  NULL, CREATE_ALWAYS,\n\t\t\t  FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM |\n\t\t\t  FILE_ATTRIBUTE_HIDDEN, NULL);\n\n\tif (f_handle == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Unable to create '%s': %s\", &path[3], WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t/* Write ldlinux.sys file */\n\tif (!WriteFileWithRetry(f_handle, (const char _force *)syslinux_ldlinux[0],\n\t\t   syslinux_ldlinux_len[0], NULL, WRITE_RETRIES)) {\n\t\tuprintf(\"Could not write '%s': %s\", &path[3], WindowsErrorString());\n\t\tgoto out;\n\t}\n\tif (!WriteFileWithRetry(f_handle, syslinux_adv, 2 * ADV_SIZE, NULL, WRITE_RETRIES)) {\n\t\tuprintf(\"Could not write ADV to '%s': %s\", &path[3], WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tuprintf(\"Successfully wrote '%s'\", &path[3]);\n\tif (boot_type != BT_IMAGE)\n\t\tUpdateProgress(OP_FILE_COPY, -1.0f);\n\n\t/* Now flush the media */\n\tif (!FlushFileBuffers(f_handle)) {\n\t\tuprintf(\"FlushFileBuffers failed\");\n\t\tgoto out;\n\t}\n\n\t/* Map the file (is there a better way to do this?) */\n\tldlinux_sectors = (syslinux_ldlinux_len[0] + 2 * ADV_SIZE + SECTOR_SIZE - 1) >> SECTOR_SHIFT;\n\tsectors = (libfat_sector_t*) calloc(ldlinux_sectors, sizeof *sectors);\n\tif (sectors == NULL)\n\t\tgoto out;\n\n\tswitch (file_system) {\n\tcase FS_NTFS:\n\t\tstatic_sprintf(tmp, \"%c:\\\\\", toupper(drive_letter));\n\t\tvol_info.Handle = d_handle;\n\t\terr = NtfsSectGetVolumeInfo(tmp, &vol_info);\n\t\tif (err != ERROR_SUCCESS) {\n\t\t\tuprintf(\"Could not fetch NTFS volume info\");\n\t\t\tgoto out;\n\t\t}\n\t\tsecp = sectors;\n\t\tnsectors = 0;\n\t\tfor (vcn.QuadPart = 0;\n\t\t\tNtfsSectGetFileVcnExtent(f_handle, &vcn, &extent) == ERROR_SUCCESS;\n\t\t\tvcn = extent.NextVcn) {\n\t\t\t\terr = NtfsSectLcnToLba(&vol_info, &extent.FirstLcn, &lba);\n\t\t\t\tif (err != ERROR_SUCCESS) {\n\t\t\t\t\tuprintf(\"Could not translate 'ldlinux.sys' LCN to disk LBA\");\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t\tlba.QuadPart -= vol_info.PartitionLba.QuadPart;\n\t\t\t\tlen.QuadPart = ((extent.NextVcn.QuadPart -\n\t\t\t\t\textent.FirstVcn.QuadPart) *\n\t\t\t\t\tvol_info.SectorsPerCluster);\n\t\t\t\twhile (len.QuadPart-- && nsectors < ldlinux_sectors) {\n\t\t\t\t\t*secp++ = lba.QuadPart++;\n\t\t\t\t\tnsectors++;\n\t\t\t\t}\n\t\t}\n\t\tbreak;\n\tcase FS_FAT16:\n\tcase FS_FAT32:\n\tcase FS_EXFAT:\n\t\tlf_fs = libfat_open(libfat_readfile, (intptr_t) d_handle);\n\t\tif (lf_fs == NULL) {\n\t\t\tuprintf(\"Syslinux FAT access error\");\n\t\t\tgoto out;\n\t\t}\n\t\tldlinux_cluster = libfat_searchdir(lf_fs, 0, \"LDLINUX SYS\", NULL);\n\t\tsecp = sectors;\n\t\tnsectors = 0;\n\t\ts = libfat_clustertosector(lf_fs, ldlinux_cluster);\n\t\twhile (s && nsectors < ldlinux_sectors) {\n\t\t\t*secp++ = s;\n\t\t\tnsectors++;\n\t\t\ts = libfat_nextsector(lf_fs, s);\n\t\t}\n\t\tlibfat_close(lf_fs);\n\t\tbreak;\n\tdefault:\n\t\tuprintf(\"Unsupported Syslinux filesystem\");\n\t\tgoto out;\n\t}\n\n\t/* Set the base directory and patch ldlinux.sys and the boot sector */\n\tfor (i = (int)strlen(img_report.cfg_path); (i > 0) && (img_report.cfg_path[i] != '/'); i--);\n\tif (i > 0)\n\t\timg_report.cfg_path[i] = 0;\n\tw = syslinux_patch(sectors, nsectors, 0, 0, img_report.cfg_path, NULL);\n\tif (i > 0)\n\t\timg_report.cfg_path[i] = '/';\n\tif (w < 0) {\n\t\tuprintf(\"WARNING: Could not patch Syslinux files.\");\n\t\tuprintf(\"This could be caused by your firewall having modified downloaded content, such as 'ldlinux.sys'...\");\n\t\tgoto out;\n\t}\n\n\t/* Rewrite the file */\n\tif (!SetFilePointerEx(f_handle, liZero, NULL, FILE_BEGIN) ||\n\t\t!WriteFileWithRetry(f_handle, syslinux_ldlinux[0], syslinux_ldlinux_len[0], NULL, WRITE_RETRIES)) {\n\t\tuprintf(\"Could not rewrite '%s': %s\\n\", &path[3], WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t/* Close file */\n\tsafe_closehandle(f_handle);\n\n\t/* Read existing FAT data into boot sector */\n\tif (!SetFilePointerEx(d_handle, liZero, NULL, FILE_BEGIN) ||\n\t\t!ReadFile(d_handle, sectbuf, SECTOR_SIZE,\n\t\t\t   &bytes_read, NULL)) {\n\t\tuprintf(\"Could not read Syslinux boot record: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\tif (bytes_read < SECTOR_SIZE) {\n\t\tuprintf(\"Partial read of Syslinux boot record: read %d bytes but requested %d\", bytes_read, SECTOR_SIZE);\n\t\tgoto out;\n\t}\n\n\t/* Make the syslinux boot sector */\n\tsyslinux_make_bootsect(sectbuf, (file_system == FS_NTFS)?NTFS:VFAT);\n\n\t/* Write boot sector back */\n\tif (!SetFilePointerEx(d_handle, liZero, NULL, FILE_BEGIN) ||\n\t\t!WriteFileWithRetry(d_handle, sectbuf, SECTOR_SIZE, NULL, WRITE_RETRIES)) {\n\t\tuprintf(\"Could not write Syslinux boot record: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\tuprintf(\"Successfully wrote Syslinux boot record\");\n\n\tif (boot_type == BT_SYSLINUX_V6) {\n\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\tstatic_sprintf(path, \"%s\\\\%s-%s\", FILES_DIR, syslinux, embedded_sl_version_str[1]);\n\t\tIGNORE_RETVAL(_chdir(path));\n\t\tstatic_sprintf(path, \"%c:\\\\%s.%s\", toupper(drive_letter), ldlinux, ldlinux_ext[2]);\n\t\tfd = fopen(&path[3], \"rb\");\n\t\tif (fd == NULL) {\n\t\t\tuprintf(\"Caution: No '%s' was provided. The target will be missing a required Syslinux file!\", &path[3]);\n\t\t} else {\n\t\t\tfclose(fd);\n\t\t\tif (CopyFileU(&path[3], path, TRUE)) {\n\t\t\t\tuprintf(\"Created '%s' (from '%s\\\\%s\\\\%s-%s\\\\%s') %s\", path, app_data_dir, FILES_DIR, syslinux,\n\t\t\t\t\tembedded_sl_version_str[1], &path[3], IsFileInDB(&path[3])?\"✓\":\"✗\");\n\t\t\t} else {\n\t\t\t\tuprintf(\"Failed to create '%s': %s\", path, WindowsErrorString());\n\t\t\t}\n\t\t}\n\t} else if (HAS_REACTOS(img_report)) {\n\t\tuprintf(\"Setting up ReactOS...\");\n\t\tsyslinux_mboot = GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_SL_MBOOT_C32),\n\t\t\t_RT_RCDATA, \"mboot.c32\", &syslinux_mboot_len, FALSE);\n\t\tif (syslinux_mboot == NULL) {\n\t\t\tgoto out;\n\t\t}\n\t\t/* Create mboot.c32 file */\n\t\tstatic_sprintf(path, \"%c:\\\\%s\", toupper(drive_letter), mboot_c32);\n\t\tf_handle = CreateFileA(path, GENERIC_READ | GENERIC_WRITE,\n\t\t\t\t  FILE_SHARE_READ | FILE_SHARE_WRITE,\n\t\t\t\t  NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\n\t\tif (f_handle == INVALID_HANDLE_VALUE) {\n\t\t\tuprintf(\"Unable to create '%s'\\n\", path);\n\t\t\tgoto out;\n\t\t}\n\t\tif (!WriteFileWithRetry(f_handle, syslinux_mboot, syslinux_mboot_len, NULL, WRITE_RETRIES)) {\n\t\t\tuprintf(\"Could not write '%s'\", path);\n\t\t\tgoto out;\n\t\t}\n\t\tsafe_closehandle(f_handle);\n\t\tstatic_sprintf(path, \"%c:\\\\syslinux.cfg\", toupper(drive_letter));\n\t\tfd = fopen(path, \"w\");\n\t\tif (fd == NULL) {\n\t\t\tuprintf(\"Could not create ReactOS 'syslinux.cfg'\");\n\t\t\tgoto out;\n\t\t}\n\t\t/* Write the syslinux.cfg for ReactOS */\n\t\tfprintf(fd, \"DEFAULT ReactOS\\nLABEL ReactOS\\n  KERNEL %s\\n  APPEND %s\",\n\t\t\tmboot_c32, img_report.reactos_path);\n\t\tfclose(fd);\n\t}\n\n\tif (boot_type != BT_IMAGE)\n\t\tUpdateProgress(OP_FILE_COPY, -1.0f);\n\n\tr = TRUE;\n\nout:\n\tsafe_mm_free(sectbuf);\n\tsafe_free(syslinux_ldlinux[0]);\n\tsafe_free(syslinux_ldlinux[1]);\n\tsafe_free(sectors);\n\tsafe_unlockclose(d_handle);\n\tsafe_closehandle(f_handle);\n\treturn r;\n}\n\nuint16_t GetSyslinuxVersion(char* buf, size_t buf_size, char** ext)\n{\n\tsize_t i, j, k;\n\tchar *p = NULL;\n\tunsigned long version_ul[2];\n\tuint16_t version = 0;\n\tconst char LINUX[] = { 'L', 'I', 'N', 'U', 'X', ' ' };\n\tstatic char* nullstr = \"\";\n\tchar unauthorized[] = {'<', '>', ':', '|', '*', '?', '\\\\', '/'};\n\n\t*ext = nullstr;\n\tif (buf_size < 256)\n\t\treturn 0;\n\n\t// Start at 64 to avoid the short incomplete version at the beginning of ldlinux.sys\n\tfor (i = 64; i < buf_size - 64; i++) {\n\t\tif (memcmp(&buf[i], LINUX, sizeof(LINUX)) == 0) {\n\t\t\t// Check for ISO or SYS prefix\n\t\t\tif (!( ((buf[i - 3] == 'I') && (buf[i - 2] == 'S') && (buf[i - 1] == 'O'))\n\t\t\t    || ((buf[i - 3] == 'S') && (buf[i - 2] == 'Y') && (buf[i - 1] == 'S')) ))\n\t\t\t  continue;\n\t\t\ti += sizeof(LINUX);\n\t\t\tversion_ul[0] = strtoul(&buf[i], &p, 10);\n\t\t\t// Our buffer is either from our internal legit syslinux (i.e. with a NUL terminated\n\t\t\t// version string) or from a buffer that has been NUL-terminated through read_file(),\n\t\t\t// so the string we work with in p is always NUL terminated at this stage.\n\t\t\tassert(version_ul[0] < 256);\n\t\t\tif (version_ul[0] < 256) {\n\t\t\t\tversion_ul[1] = strtoul(&p[1], &p, 10);\n\t\t\t\tassert(version_ul[1] < 256);\n\t\t\t\tif (version_ul[1] < 256)\n\t\t\t\t\tversion = (uint16_t)((version_ul[0] << 8) + version_ul[1]);\n\t\t\t}\n\t\t\tif (version == 0)\n\t\t\t\tcontinue;\n\t\t\t// Ensure that our extra version string starts with a slash\n\t\t\t*p = '/';\n\t\t\t// Remove the x.yz- duplicate if present\n\t\t\tfor (j = 0; (buf[i + j] == p[1 + j]) && (buf[i + j] != ' '); j++);\n\t\t\tif (p[j + 1] == '-')\n\t\t\t\tj++;\n\t\t\tif (j >= 4) {\n\t\t\t\tp[j] = '/';\n\t\t\t\tp = &p[j];\n\t\t\t}\n\t\t\tfor (j = safe_strlen(p) - 1; j > 0; j--) {\n\t\t\t\t// Arch Linux affixes a star for their version - who knows what else is out there...\n\t\t\t\tif ((p[j] == ' ') || (p[j] == '*'))\n\t\t\t\t\tp[j] = 0;\n\t\t\t\telse\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Sanitize the string\n\t\t\tfor (j = 1; j < safe_strlen(p); j++) {\n\t\t\t\t// Some people are bound to have invalid chars in their date strings\n\t\t\t\tfor (k = 0; k < sizeof(unauthorized); k++) {\n\t\t\t\t\tif (p[j] == unauthorized[k])\n\t\t\t\t\t\tp[j] = '_';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If all we have is a slash, return the empty string for the extra version\n\t\t\t*ext = (p[1] == 0) ? nullstr : p;\n\t\t\treturn version;\n\t\t}\n\t}\n\treturn 0;\n}\n"
  },
  {
    "path": "src/ui.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * UI-related function calls\n * Copyright © 2018-2024 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n /* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#include <windows.h>\n#include <windowsx.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <oleacc.h>\n#include <winioctl.h>\n#include <assert.h>\n\n#include \"rufus.h\"\n#include \"drive.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"darkmode.h\"\n#include \"msapi_utf8.h\"\n#include \"localization.h\"\n\n#include \"ui.h\"\n#include \"ui_data.h\"\n\nUINT_PTR UM_LANGUAGE_MENU_MAX = UM_LANGUAGE_MENU;\nHIMAGELIST hUpImageList, hDownImageList;\nextern BOOL use_vds, appstore_version;\nextern int imop_win_sel;\nextern char *unattend_xml_path, *archive_path;\nint update_progress_type = UPT_PERCENT;\nint advanced_device_section_height, advanced_format_section_height;\n// (empty) check box width, (empty) drop down width, button height (for and without dropdown match)\nint cbw, ddw, ddbh = 0, bh = 0;\n// Row Height, DropDown Height, Main button width, half dropdown width, full dropdown width\nstatic int rh, ddh, bw, hw, fw;\n// See GetFullWidth() for details on how these values are used\nstatic int sw, mw, bsw, sbw, ssw, tw, dbw;\nstatic WNDPROC progress_original_proc = NULL;\nstatic wchar_t wtbtext[2][128];\nstatic IAccPropServices* pfaps = NULL;\n\n/*\n * The following is used to allocate slots within the progress bar\n * 0 means unused (no operation or no progress allocated to it)\n * +n means allocate exactly n bars (n percent of the progress bar)\n * -n means allocate a weighted slot of n from all remaining\n *    bars. E.g. if 80 slots remain and the sum of all negative entries\n *    is 10, -4 will allocate 4/10*80 = 32 bars (32%) for OP progress\n */\nstatic int nb_slots[OP_MAX];\nstatic float slot_end[OP_MAX+1];\t// shifted +1 so that we can subtract 1 to OP indexes\nstatic float previous_end;\n\nvoid SetAccessibleName(HWND hCtrl, const char* name)\n{\n\tconst MSAAPROPID props[] = { Name_Property_GUID };\n\twchar_t* wname = utf8_to_wchar(name);\n\n\tSetWindowTextW(hCtrl, wname);\n\tif (pfaps == NULL)\n\t\tIGNORE_RETVAL(CoCreateInstance(&CLSID_AccPropServices, NULL, CLSCTX_INPROC, &IID_IAccPropServices, (LPVOID)&pfaps));\n\tif (pfaps != NULL) {\n\t\tIAccPropServices_ClearHwndProps(pfaps, hCtrl, OBJID_CLIENT, CHILDID_SELF, props, ARRAYSIZE(props));\n\t\tIAccPropServices_SetHwndPropStr(pfaps, hCtrl, OBJID_CLIENT, CHILDID_SELF, Name_Property_GUID, wname);\n\t}\n\tfree(wname);\n}\n\n// Set the combo selection according to the data\nvoid SetComboEntry(HWND hDlg, int data)\n{\n\tint i, nb_entries = ComboBox_GetCount(hDlg);\n\n\tif (nb_entries <= 0)\n\t\treturn;\n\tfor (i = 0; i < nb_entries; i++) {\n\t\tif (ComboBox_GetItemData(hDlg, i) == data) {\n\t\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hDlg, i));\n\t\t\treturn;\n\t\t}\n\t}\n\tif (i == nb_entries)\n\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hDlg, 0));\n}\n\n// Move a control along the Y axis\nstatic __inline void MoveCtrlY(HWND hDlg, int nID, int vertical_shift) {\n\tResizeMoveCtrl(hDlg, GetDlgItem(hDlg, nID), 0, vertical_shift, 0, 0, 1.0f);\n}\n\n// https://stackoverflow.com/a/20926332/1069307\n// https://msdn.microsoft.com/en-us/library/windows/desktop/bb226818.aspx\nvoid GetBasicControlsWidth(HWND hDlg)\n{\n\tint checkbox_internal_spacing = 12, dropdown_internal_spacing = 15;\n\tRECT rc = { 0, 0, 4, 8 };\n\tSIZE sz;\n\n\t// Compute base unit sizes since GetDialogBaseUnits() returns garbage data.\n\t// See http://support.microsoft.com/kb/125681\n\tMapDialogRect(hDlg, &rc);\n\tsz.cx = rc.right;\n\tsz.cy = rc.bottom;\n\n\t// TODO: figure out the specifics of each Windows version\n\tif (WindowsVersion.Version >= WINDOWS_10) {\n\t\tcheckbox_internal_spacing = 10;\n\t\tdropdown_internal_spacing = 13;\n\t}\n\n\t// Checkbox and (blank) dropdown widths\n\tcbw = MulDiv(checkbox_internal_spacing, sz.cx, 4);\n\tddw = MulDiv(dropdown_internal_spacing, sz.cx, 4);\n\n\t// Spacing width between half-length dropdowns (sep) as well as left margin\n\tGetWindowRect(GetDlgItem(hDlg, IDC_TARGET_SYSTEM), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tsw = rc.left;\n\tGetWindowRect(GetDlgItem(hDlg, IDC_PARTITION_TYPE), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tsw -= rc.right;\n\tmw = rc.left;\n\n\t// Small button width\n\tSendMessage(hSaveToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz);\n\tsbw = sz.cx;\n\n\t// Small separator widths and button height\n\tGetWindowRect(GetDlgItem(hDlg, IDC_SAVE), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tbh = rc.bottom - rc.top;\n\tssw = rc.left;\n\tGetWindowRect(hDeviceList, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tssw -= rc.right;\n\n\t// CSM tooltip separator width\n\tGetWindowRect(GetDlgItem(hDlg, IDS_CSM_HELP_TXT), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\ttw = rc.left;\n\tGetWindowRect(hTargetSystem, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\ttw -= rc.right;\n}\n\n// Compute the minimum size of the main buttons\nvoid GetMainButtonsWidth(HWND hDlg)\n{\n\tunsigned int i;\n\tRECT rc;\n\tchar download[64];\n\n\tGetWindowRect(GetDlgItem(hDlg, main_button_ids[0]), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tbw = rc.right - rc.left;\n\n\tfor (i = 0; i < ARRAYSIZE(main_button_ids); i++) {\n\t\t// Make sure we add extra space for the SELECT split button (i == 0) if Fido is enabled\n\t\tbw = max(bw, GetTextWidth(hDlg, main_button_ids[i]) + ((i == 0) ? (3 * cbw) / 2 : cbw));\n\t}\n\t// The 'CLOSE' button is also be used to display 'CANCEL' and we sometimes\n\t// want to add \"DOWNLOAD\" into the Select split button => measure that too.\n\tbw = max(bw, GetTextSize(GetDlgItem(hDlg, IDCANCEL), lmprintf(MSG_007)).cx + cbw);\n\tstatic_strcpy(download, lmprintf(MSG_040));\n\tCharUpperBuffU(download, sizeof(download));\n\tbw = max(bw, GetTextSize(GetDlgItem(hDlg, IDC_SELECT), download).cx + (3 * cbw) / 2);\n}\n\n// The following goes over the data that gets populated into the half-width dropdowns\n// (Partition scheme, Target System, Disk ID, File system, Cluster size, Nb passes)\n// to figure out the minimum width we should allocate.\nvoid GetHalfDropwdownWidth(HWND hDlg)\n{\n\tRECT rc;\n\tunsigned int i, j, msg_id;\n\tchar tmp[256];\n\n\t// Initialize half width to the UI's default size\n\tGetWindowRect(GetDlgItem(hDlg, IDC_PARTITION_TYPE), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\thw = rc.right - rc.left - ddw;\n\n\t// \"Super Floppy Disk\" is the longuest entry in the Partition Scheme dropdown\n\thw = max(hw, GetTextSize(GetDlgItem(hDlg, IDC_PARTITION_TYPE), (char*)sfd_name).cx);\n\n\t// This is basically the same as SetClusterSizeLabels() except we're adding (Default) to each entry\n\tfor (i = 512, j = 1, msg_id = MSG_026; j<MAX_CLUSTER_SIZES; i <<= 1, j++) {\n\t\tif (i > 8192) {\n\t\t\ti /= 1024;\n\t\t\tmsg_id++;\n\t\t}\n\t\tsafe_sprintf(tmp, 64, \"%d %s\", i, lmprintf(msg_id));\n\t\thw = max(hw, GetTextSize(GetDlgItem(hDlg, IDC_CLUSTER_SIZE), lmprintf(MSG_030, tmp)).cx);\n\t}\n\t// We don't go over file systems, because none of them will be longer than \"Super Floppy Disk\"\n\t// We do however go over the BIOS vs UEFI entries, as some of these are translated\n\tfor (msg_id = MSG_031; msg_id <= MSG_033; msg_id++)\n\t\thw = max(hw, GetTextSize(GetDlgItem(hDlg, IDC_TARGET_SYSTEM), lmprintf(msg_id)).cx);\n\n\t// Just in case, we also do the number of passes\n\tfor (i = 1; i <= 5; i++) {\n\t\tchar* msg = (i == 1) ? lmprintf(MSG_034, 1) : lmprintf(MSG_035, (i == 2) ? 2 : 4, (i == 2) ? \"\" : lmprintf(MSG_087, flash_type[i - 3]));\n\t\thw = max(hw, GetTextSize(GetDlgItem(hDlg, IDC_TARGET_SYSTEM), msg).cx);\n\t}\n\n\t// Finally, we must ensure that we'll have enough space for the checkbox controls\n\t// that end up with a half dropdown\n\thw = max(hw, GetTextWidth(hDlg, IDC_BAD_BLOCKS) - sw);\n\n\t// Add the width of a blank dropdown\n\thw += ddw;\n}\n\n/*\n* dbw = dialog border width\n* mw  = margin width\n* fw  = full dropdown width\n* hd  = half dropdown width\n* bsw = boot selection dropdown width\n* sw  = separator width\n* ssw = small separator width\n* bw  = button width\n* sbw = small button width\n*\n*      |                        fw                            |\n*      |          bsw          | ssw | sbw | ssw |     bw     |\n*  8 ->|<-      96       ->|<-    24    ->|<-      96       ->|<- 8\n*  mw  |        hw         |      sw      |        hw         |  mw\n*                             |     bw     | ssw |     bw     |\n*/\nvoid GetFullWidth(HWND hDlg)\n{\n\tRECT rc;\n\tint i;\n\n\t// Get the dialog border width\n\tGetWindowRect(hDlg, &rc);\n\tdbw = rc.right - rc.left;\n\tGetClientRect(hDlg, &rc);\n\tdbw -= rc.right - rc.left;\n\n\t// Compute the minimum size needed for the Boot Selection dropdown\n\tGetWindowRect(GetDlgItem(hDlg, IDC_BOOT_SELECTION), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\n\tbsw = max(rc.right - rc.left, GetTextSize(hBootType, lmprintf(MSG_279)).cx + ddw);\n\tbsw = max(bsw, GetTextSize(hBootType, lmprintf(MSG_281, lmprintf(MSG_280))).cx + ddw);\n\n\t// Initialize full width to the UI's default size\n\tGetWindowRect(GetDlgItem(hDlg, IDS_DEVICE_TXT), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tfw = rc.right - rc.left - ddw;\n\n\t// Go through the Image Options for Windows To Go\n\tfw = max(fw, GetTextSize(hImageOption, lmprintf(MSG_117)).cx);\n\tfw = max(fw, GetTextSize(hImageOption, lmprintf(MSG_118)).cx);\n\n\t// Now deal with full length checkbox lines\n\tfor (i = 0; i<ARRAYSIZE(full_width_checkboxes); i++)\n\t\tfw = max(fw, GetTextWidth(hDlg, full_width_checkboxes[i]));\n\n\t// All of the above is for text only, so we need to add dd space\n\tfw += ddw;\n\n\t// Our min also needs to be longer than 2 half length dropdowns + spacer\n\tfw = max(fw, 2 * hw + sw);\n\n\t// Now that we have our minimum full width, adjust the button width if needed\n\t// Adjust according to min full width\n\tbw = max(bw, (fw - 2 * ssw - sw) / 4);\n\t// Adjust according to min boot selection width\n\tbw = max(bw, (bsw + sbw - sw) / 3);\n\n\t// Adjust according to min half width\n\tbw = max(bw, (hw / 2) - ssw);\n\n\t// Now that our button width is set, we can adjust the rest\n\thw = max(hw, 2 * bw + ssw);\n\tfw = max(fw, 2 * hw + sw);\n\n\tbsw = max(bsw, fw - bw - 2 * ssw - sbw);\n\n\t// TODO: Also pick a few choice messages from info/status\n}\n\nvoid PositionMainControls(HWND hDlg)\n{\n\tRECT rc;\n\tHWND hCtrl, hPrevCtrl;\n\tSIZE sz;\n\tDWORD padding;\n\tint i, x, button_fudge = 2;\n\n\t// Start by resizing the whole dialog\n\tGetWindowRect(hDlg, &rc);\n\t// Don't forget to add the dialog border width, since we resize the whole dialog\n\tSetWindowPos(hDlg, NULL, -1, -1, fw + 2 * mw + dbw, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);\n\n\t// Resize the height of the label, persistence size and progress bar to the height of standard dropdowns\n\thCtrl = GetDlgItem(hDlg, IDC_DEVICE);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tddh = rc.bottom - rc.top;\n\tddbh = ddh + button_fudge;\n\tbh = max(bh, ddbh);\n\thCtrl = GetDlgItem(hDlg, IDC_LABEL);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSetWindowPos(hCtrl, hAdvancedFormatToolbar, rc.left, rc.top, rc.right - rc.left, ddh, SWP_NOZORDER);\n\thCtrl = GetDlgItem(hDlg, IDC_PERSISTENCE_SIZE);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSetWindowPos(hCtrl, GetDlgItem(hDlg, IDC_PERSISTENCE_SLIDER), rc.left, rc.top, rc.right - rc.left, ddh, SWP_NOZORDER);\n\tGetWindowRect(hProgress, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSetWindowPos(hProgress, hNBPasses, rc.left, rc.top, rc.right - rc.left, ddh, SWP_NOZORDER);\n\n\t// Get the height of a typical row\n\thCtrl = GetDlgItem(hDlg, IDS_BOOT_SELECTION_TXT);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\trh = rc.top;\n\thCtrl = GetDlgItem(hDlg, IDS_DEVICE_TXT);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\trh -= rc.top;\n\n\t// Get the height of the advanced options\n\thCtrl = GetDlgItem(hDlg, IDC_LIST_USB_HDD);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tadvanced_device_section_height = rc.top;\n\thCtrl = GetDlgItem(hDlg, IDC_UEFI_MEDIA_VALIDATION);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tadvanced_device_section_height = rc.bottom - advanced_device_section_height;\n\n\thCtrl = GetDlgItem(hDlg, IDC_QUICK_FORMAT);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tadvanced_format_section_height = rc.top;\n\thCtrl = GetDlgItem(hDlg, IDC_BAD_BLOCKS);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tadvanced_format_section_height = rc.bottom - advanced_format_section_height;\n\n\t// Get the vertical position of the sections text\n\thCtrl = GetDlgItem(hDlg, IDS_DRIVE_PROPERTIES_TXT);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tsz = GetTextSize(hCtrl, NULL);\n\tsection_vpos[0] = rc.top + 2 * sz.cy / 3;\n\thCtrl = GetDlgItem(hDlg, IDS_FORMAT_OPTIONS_TXT);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tsz = GetTextSize(hCtrl, NULL);\n\tsection_vpos[1] = rc.top + 2 * sz.cy / 3;\n\thCtrl = GetDlgItem(hDlg, IDS_STATUS_TXT);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tsz = GetTextSize(hCtrl, NULL);\n\tsection_vpos[2] = rc.top + 2 * sz.cy / 3;\n\n\t// Seriously, who designed this bullshit API call where you pass a SIZE\n\t// struct but can only retrieve one of cx or cy at a time?!?\n\tSendMessage(hMultiToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz);\n\tGetWindowRect(GetDlgItem(hDlg, IDC_ABOUT), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSetWindowPos(hMultiToolbar, hProgress, rc.left, rc.top, sz.cx, ddbh, 0);\n\n\t// Reposition the main buttons\n\tfor (i = 0; i < ARRAYSIZE(main_button_ids); i++) {\n\t\thCtrl = GetDlgItem(hDlg, main_button_ids[i]);\n\t\tGetWindowRect(hCtrl, &rc);\n\t\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\t\tx = mw + fw - bw;\n\t\tif (i % 2 == 1)\n\t\t\tx -= bw + ssw;\n\t\thPrevCtrl = GetNextWindow(hCtrl, GW_HWNDPREV);\n\t\tSetWindowPos(hCtrl, hPrevCtrl, x, rc.top, bw, ddbh, 0);\n\t}\n\n\t// Reposition the Save button\n\thCtrl = GetDlgItem(hDlg, IDC_SAVE);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSendMessage(hSaveToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz);\n\tSendMessage(hSaveToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(sz.cx, ddbh));\n\t// Microsoft, how I loathe thee!!!\n\tpadding = (DWORD)SendMessage(hSaveToolbar, TB_GETPADDING, 0, 0);\n\tsz.cx = padding & 0xFFFF;\n\tsz.cy = padding >> 16;\n\tSendMessage(hSaveToolbar, TB_SETPADDING, 0, MAKELPARAM(sz.cx + 3, sz.cy + 2));\n\tSetWindowPos(hSaveToolbar, hDeviceList, mw + fw - sbw, rc.top, sbw, ddbh, 0);\n\n\t// Reposition the Hash button\n\thCtrl = GetDlgItem(hDlg, IDC_HASH);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSendMessage(hHashToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz);\n\tSendMessage(hHashToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(sz.cx, ddbh));\n\tpadding = (DWORD)SendMessage(hHashToolbar, TB_GETPADDING, 0, 0);\n\tsz.cx = padding & 0xFFFF;\n\tsz.cy = padding >> 16;\n\tSendMessage(hHashToolbar, TB_SETPADDING, 0, MAKELPARAM(sz.cx + 3, sz.cy + 2));\n\tSetWindowPos(hHashToolbar, hBootType, mw + bsw + ssw, rc.top, sbw, ddbh, 0);\n\n\t// Reposition the Persistence slider and resize it to the boot selection width\n\thCtrl = GetDlgItem(hDlg, IDC_PERSISTENCE_SLIDER);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSetWindowPos(hCtrl, hImageOption, mw, rc.top, bsw, rc.bottom - rc.top, 0);\n\n\t// Reposition the Persistence Units dropdown (no need to resize)\n\thCtrl = GetDlgItem(hDlg, IDC_PERSISTENCE_UNITS);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tsz.cx = fw - (rc.right - rc.left);\n\tSetWindowPos(hCtrl, GetDlgItem(hDlg, IDC_PERSISTENCE_SIZE), mw + sz.cx, rc.top, rc.right - rc.left, rc.bottom - rc.top, 0);\n\tShowWindow(hCtrl, SW_HIDE);\n\n\t// Reposition and resize the Persistence Size edit\n\thCtrl = GetDlgItem(hDlg, IDC_PERSISTENCE_SIZE);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSetWindowPos(hCtrl, GetDlgItem(hDlg, IDC_PERSISTENCE_SLIDER), mw + bsw + ssw, rc.top, fw - bsw - ssw, rc.bottom - rc.top, 0);\n\tEnableWindow(hCtrl, FALSE);\n\n\t// Reposition the CSM help tip\n\thCtrl = GetDlgItem(hDlg, IDS_CSM_HELP_TXT);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSetWindowPos(hCtrl, hTargetSystem, mw + fw + tw, rc.top, sbw, rc.bottom - rc.top, 0);\n\n\tif (advanced_mode_device) {\n\t\t// Still need to adjust the width of the device selection dropdown\n\t\tGetWindowRect(hDeviceList, &rc);\n\t\tMapWindowPoints(NULL, hMainDialog, (POINT*)&rc, 2);\n\t\tSetWindowPos(hDeviceList, GetDlgItem(hDlg, IDS_DEVICE_TXT), rc.left, rc.top, fw - ssw - sbw, rc.bottom - rc.top, 0);\n\t}\n\n\t// Resize the full width controls\n\tfor (i = 0; i < ARRAYSIZE(full_width_controls); i++) {\n\t\thCtrl = GetDlgItem(hDlg, full_width_controls[i]);\n\t\tGetWindowRect(hCtrl, &rc);\n\t\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\t\thPrevCtrl = GetNextWindow(hCtrl, GW_HWNDPREV);\n\t\tSetWindowPos(hCtrl, hPrevCtrl, rc.left, rc.top, fw, rc.bottom - rc.top, 0);\n\t}\n\n\t// Resize the half drowpdowns\n\tfor (i = 0; i < ARRAYSIZE(half_width_ids); i++) {\n\t\thCtrl = GetDlgItem(hDlg, half_width_ids[i]);\n\t\tGetWindowRect(hCtrl, &rc);\n\t\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\t\t// First 4 controls are on the left handside\n\t\t// First 2 controls may overflow into separator\n\t\thPrevCtrl = GetNextWindow(hCtrl, GW_HWNDPREV);\n\t\tSetWindowPos(hCtrl, hPrevCtrl, (i < 4) ? rc.left : mw + hw + sw, rc.top,\n\t\t\t(i <2) ? hw + sw : hw, rc.bottom - rc.top, 0);\n\t}\n\n\t// Resize the boot selection dropdown\n\thCtrl = GetDlgItem(hDlg, IDC_BOOT_SELECTION);\n\tGetWindowRect(hCtrl, &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\thPrevCtrl = GetNextWindow(hCtrl, GW_HWNDPREV);\n\tSetWindowPos(hCtrl, hPrevCtrl, rc.left, rc.top, bsw, rc.bottom - rc.top, 0);\n}\n\nstatic void ResizeDialogs(int shift)\n{\n\tRECT rc;\n\tPOINT point;\n\n\t// Resize the main dialog\n\tGetWindowRect(hMainDialog, &rc);\n\tpoint.x = (rc.right - rc.left);\n\tpoint.y = (rc.bottom - rc.top);\n\tMoveWindow(hMainDialog, rc.left, rc.top, point.x, point.y + shift, TRUE);\n\n\t// Resize the log\n\tGetWindowRect(hLogDialog, &rc);\n\tpoint.x = (rc.right - rc.left);\n\tpoint.y = (rc.bottom - rc.top);\n\tMoveWindow(hLogDialog, rc.left, rc.top, point.x, point.y + shift, TRUE);\n\tMoveCtrlY(hLogDialog, IDC_LOG_CLEAR, shift);\n\tMoveCtrlY(hLogDialog, IDC_LOG_SAVE, shift);\n\tMoveCtrlY(hLogDialog, IDCANCEL, shift);\n\tGetWindowRect(hLog, &rc);\n\tpoint.x = (rc.right - rc.left);\n\tpoint.y = (rc.bottom - rc.top) + shift;\n\tSetWindowPos(hLog, NULL, 0, 0, point.x, point.y, SWP_NOZORDER);\n\t// Don't forget to scroll the edit to the bottom after resize\n\tEdit_Scroll(hLog, 0, Edit_GetLineCount(hLog));\n}\n\n// Thanks to Microsoft atrocious DPI handling, we must adjust for low DPI\nvoid AdjustForLowDPI(HWND hDlg)\n{\n\tstatic int ddy = 4;\n\tint i, j;\n\tRECT rc;\n\tHWND hCtrl, hPrevCtrl;\n\tint dy = 0;\n\n\tif (fScale >= 1.3f)\n\t\treturn;\n\n\tfor (i = 0; i < ARRAYSIZE(adjust_dpi_ids); i++) {\n\t\tdy += ddy;\n\t\t// \"...and the other thing I really like about Microsoft's UI handling is how \"\n\t\t// \"you never have to introduce weird hardcoded constants all over the place, \"\n\t\t// \"just to make your UI look good...\", said NO ONE ever.\n\t\tif (adjust_dpi_ids[i][0] == IDC_QUICK_FORMAT)\n\t\t\tdy += 1;\n\t\tfor (j = 0; j < 5; j++) {\n\t\t\tif (adjust_dpi_ids[i][j] == 0)\n\t\t\t\tbreak;\n\t\t\thCtrl = GetDlgItem(hDlg, adjust_dpi_ids[i][j]);\n\t\t\tGetWindowRect(hCtrl, &rc);\n\t\t\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\t\t\thPrevCtrl = GetNextWindow(hCtrl, GW_HWNDPREV);\n\t\t\tSetWindowPos(hCtrl, hPrevCtrl, rc.left, rc.top + dy,\n\t\t\t\trc.right - rc.left, rc.bottom - rc.top, 0);\n\t\t}\n\t}\n\n\tsection_vpos[1] += 9 * ddy;\n\tsection_vpos[2] += 16 * ddy + 1;\n\tadvanced_device_section_height += 3 * ddy;\n\tadvanced_format_section_height += 3 * ddy + 1;\n\n\tResizeDialogs(dy + 2 * ddy);\n\tInvalidateRect(hDlg, NULL, TRUE);\n}\n\nvoid SetSectionHeaders(HWND hDlg, HFONT* hFont)\n{\n\tRECT rc;\n\tHWND hCtrl;\n\tSIZE sz;\n\twchar_t wtmp[128];\n\tsize_t wlen;\n\tint i;\n\n\t// Set the section header fonts and resize the static controls accordingly\n\tif (*hFont == NULL) {\n\t\tHDC hDC = GetDC(hMainDialog);\n\t\t*hFont = CreateFontA(-MulDiv(14, GetDeviceCaps(hDC, LOGPIXELSY), 72), 0, 0, 0,\n\t\t\tFW_SEMIBOLD, FALSE, FALSE, FALSE, DEFAULT_CHARSET, 0, 0, PROOF_QUALITY, 0, \"Segoe UI\");\n\t\tsafe_release_dc(hMainDialog, hDC);\n\t}\n\n\tfor (i = 0; i < ARRAYSIZE(section_control_ids); i++) {\n\t\tSendDlgItemMessageA(hDlg, section_control_ids[i], WM_SETFONT, (WPARAM)*hFont, TRUE);\n\t\thCtrl = GetDlgItem(hDlg, section_control_ids[i]);\n\t\tmemset(wtmp, 0, sizeof(wtmp));\n\t\tGetWindowTextW(hCtrl, wtmp, ARRAYSIZE(wtmp) - 4);\n\t\twlen = wcslen(wtmp);\n\t\tif_assert_fails(wlen < ARRAYSIZE(wtmp) - 2)\n\t\t\tbreak;\n\t\twtmp[wlen++] = L' ';\n\t\twtmp[wlen++] = L' ';\n\t\tSetWindowTextW(hCtrl, wtmp);\n\t\tGetWindowRect(hCtrl, &rc);\n\t\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\t\tsz = GetTextSize(hCtrl, NULL);\n\t\tSetWindowPos(hCtrl, NULL, rc.left, rc.top, sz.cx, sz.cy, SWP_NOZORDER);\n\t}\n}\n\n// Toggle \"advanced\" options\nvoid ToggleAdvancedDeviceOptions(BOOL enable)\n{\n\tRECT rc;\n\tSIZE sz;\n\tTBBUTTONINFO button_info;\n\tint i, shift = advanced_device_section_height;\n\n\tif (!enable)\n\t\tshift = -shift;\n\tsection_vpos[1] += shift;\n\tsection_vpos[2] += shift;\n\n\t// Toggle the Hide/Show toolbar text\n\tutf8_to_wchar_no_alloc(lmprintf((enable) ? MSG_122 : MSG_121, lmprintf(MSG_119)), wtbtext[0], ARRAYSIZE(wtbtext[0]));\n\tbutton_info.cbSize = sizeof(button_info);\n\tbutton_info.dwMask = TBIF_TEXT;\n\tbutton_info.pszText = wtbtext[0];\n\tSendMessage(hAdvancedDeviceToolbar, TB_SETBUTTONINFO, (WPARAM)IDC_ADVANCED_DRIVE_PROPERTIES, (LPARAM)&button_info);\n\tSendMessage(hAdvancedDeviceToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)((enable) ? hUpImageList : hDownImageList));\n\tGetWindowRect(hAdvancedDeviceToolbar, &rc);\n\tMapWindowPoints(NULL, hMainDialog, (POINT*)&rc, 2);\n\tSendMessage(hAdvancedDeviceToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz);\n\t// TB_GETIDEALSIZE may act up and report negative values\n\tif (sz.cx < 16)\n\t\tsz.cx = fw;\n\tSetWindowPos(hAdvancedDeviceToolbar, hTargetSystem, rc.left, rc.top, sz.cx, rc.bottom - rc.top, 0);\n\n\t// Move the controls up or down\n\tfor (i = 0; i<ARRAYSIZE(advanced_device_move_ids); i++)\n\t\tMoveCtrlY(hMainDialog, advanced_device_move_ids[i], shift);\n\n\t// Hide or show the various advanced options\n\tfor (i = 0; i<ARRAYSIZE(advanced_device_toggle_ids); i++)\n\t\tShowWindow(GetDlgItem(hMainDialog, advanced_device_toggle_ids[i]), enable ? SW_SHOW : SW_HIDE);\n\n\tGetWindowRect(hDeviceList, &rc);\n\tMapWindowPoints(NULL, hMainDialog, (POINT*)&rc, 2);\n\tSetWindowPos(hDeviceList, GetDlgItem(hMainDialog, IDS_DEVICE_TXT), rc.left, rc.top, enable ? fw - ssw - sbw : fw, rc.bottom - rc.top, 0);\n\n\t// Resize the main dialog and log window\n\tResizeDialogs(shift);\n\n\t// Never hurts to force Windows' hand\n\tInvalidateRect(hMainDialog, NULL, TRUE);\n}\n\nvoid ToggleAdvancedFormatOptions(BOOL enable)\n{\n\tRECT rc;\n\tSIZE sz;\n\tTBBUTTONINFO button_info;\n\tint i, shift = advanced_format_section_height;\n\n\tif (!enable)\n\t\tshift = -shift;\n\tsection_vpos[2] += shift;\n\n\t// Toggle the Hide/Show toolbar text\n\tutf8_to_wchar_no_alloc(lmprintf((enable) ? MSG_122 : MSG_121, lmprintf(MSG_120)), wtbtext[1], ARRAYSIZE(wtbtext[0]));\n\tbutton_info.cbSize = sizeof(button_info);\n\tbutton_info.dwMask = TBIF_TEXT;\n\tbutton_info.pszText = wtbtext[1];\n\tSendMessage(hAdvancedFormatToolbar, TB_SETBUTTONINFO, (WPARAM)IDC_ADVANCED_FORMAT_OPTIONS, (LPARAM)&button_info);\n\tSendMessage(hAdvancedFormatToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)((enable) ? hUpImageList : hDownImageList));\n\tGetWindowRect(hAdvancedFormatToolbar, &rc);\n\tMapWindowPoints(NULL, hMainDialog, (POINT*)&rc, 2);\n\tSendMessage(hAdvancedFormatToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz);\n\tif (sz.cx < 16)\n\t\tsz.cx = fw;\n\tSetWindowPos(hAdvancedFormatToolbar, hClusterSize, rc.left, rc.top, sz.cx, rc.bottom - rc.top, 0);\n\n\t// Move the controls up or down\n\tfor (i = 0; i<ARRAYSIZE(advanced_format_move_ids); i++)\n\t\tMoveCtrlY(hMainDialog, advanced_format_move_ids[i], shift);\n\n\t// Hide or show the various advanced options\n\tfor (i = 0; i<ARRAYSIZE(advanced_format_toggle_ids); i++)\n\t\tShowWindow(GetDlgItem(hMainDialog, advanced_format_toggle_ids[i]), enable ? SW_SHOW : SW_HIDE);\n\n\t// Resize the main dialog and log window\n\tResizeDialogs(shift);\n\n\t// Never hurts to force Windows' hand\n\tInvalidateRect(hMainDialog, NULL, TRUE);\n}\n\n// Toggle the display of persistence unit dropdown and resize the size field\nvoid TogglePersistenceControls(BOOL display)\n{\n\tRECT rc;\n\tHWND hSize, hUnits;\n\tLONG_PTR style;\n\tLONG width = fw - bsw - ssw;\n\thSize = GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE);\n\thUnits = GetDlgItem(hMainDialog, IDC_PERSISTENCE_UNITS);\n\n\tstyle = GetWindowLongPtr(hSize, GWL_EXSTYLE);\n\tif (display)\n\t\tstyle |= WS_EX_RIGHT;\n\telse\n\t\tstyle &= ~WS_EX_RIGHT;\n\tSetWindowLongPtr(hSize, GWL_EXSTYLE, style);\n\n\tif (display) {\n\t\tGetWindowRect(hUnits, &rc);\n\t\tMapWindowPoints(NULL, hMainDialog, (POINT*)&rc, 2);\n\t\twidth -= (rc.right - rc.left) + ssw;\n\t}\n\n\tGetWindowRect(hSize, &rc);\n\tMapWindowPoints(NULL, hMainDialog, (POINT*)&rc, 2);\n\tSetWindowPos(hSize, GetDlgItem(hMainDialog, IDC_PERSISTENCE_SLIDER), mw + bsw + ssw, rc.top, width, rc.bottom - rc.top, 0);\n\n\tEnableWindow(hSize, display ? TRUE : FALSE);\n\tEnableWindow(hUnits, display ? TRUE : FALSE);\n\tShowWindow(hUnits, display ? SW_SHOW : SW_HIDE);\n}\n\nvoid SetPersistencePos(uint64_t pos)\n{\n\tchar tmp[64];\n\n\tif ((boot_type == BT_IMAGE) && (pos != 0)) {\n\t\tTogglePersistenceControls(TRUE);\n\t\tstatic_sprintf(tmp, \"%ld\", (LONG)pos);\n\t} else {\n\t\tTogglePersistenceControls(FALSE);\n\t\tstatic_sprintf(tmp, \"0 (%s)\", lmprintf(MSG_124));\n\t}\n\tapp_changed_size = TRUE;\n\tSetWindowTextU(GetDlgItem(hMainDialog, IDC_PERSISTENCE_SIZE), tmp);\n}\n\nvoid SetPersistenceSize(void)\n{\n\tint i, proposed_unit_selection = 0;\n\tLONGLONG base_unit = MB;\n\tHWND hCtrl;\n\tuint64_t max = 0, pos = 0;\n\n\tif (ComboBox_GetCurSel(hDeviceList) >= 0) {\n\t\tmax = SelectedDrive.DiskSize - PERCENTAGE(PROJECTED_SIZE_RATIO, img_report.projected_size);\n\t\tpersistence_size = min(persistence_size, max);\n\t\tpos = persistence_size;\n\n\t\t// Reset the the Persistence Units dropdown\n\t\thCtrl = GetDlgItem(hMainDialog, IDC_PERSISTENCE_UNITS);\n\t\tIGNORE_RETVAL(ComboBox_ResetContent(hCtrl));\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\tIGNORE_RETVAL(ComboBox_SetItemData(hCtrl, ComboBox_AddStringU(hCtrl, lmprintf(MSG_022 + i)), i));\n\t\t\t// If we have more than 7 discrete positions, set this unit as our base\n\t\t\tif (SelectedDrive.DiskSize > 7 * base_unit)\n\t\t\t\tproposed_unit_selection = i;\n\t\t\tbase_unit *= 1024;\n\t\t\t// Don't allow a base unit unless the drive is at least twice the size of that unit\n\t\t\tif (SelectedDrive.DiskSize < 2 * base_unit)\n\t\t\t\tbreak;\n\t\t}\n\t\tif (persistence_unit_selection < 0)\n\t\t\tpersistence_unit_selection = proposed_unit_selection;\n\n\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hCtrl, persistence_unit_selection));\n\t\tif ((pos != 0) && (pos < MIN_EXT_SIZE))\n\t\t\tpos = MIN_EXT_SIZE;\n\t\tpos /= MB;\n\t\tmax /= MB;\n\t\tfor (i = 0; i < persistence_unit_selection; i++) {\n\t\t\tpos /= 1024;\n\t\t\tmax /= 1024;\n\t\t}\n\n\t}\n\n\thCtrl = GetDlgItem(hMainDialog, IDC_PERSISTENCE_SLIDER);\n\t// Wow! Unless you set *all* these redraw WPARAMs to true, the one from\n\t// TBM_SETPOS gets completely ignored if the value is zero!\n\tSendMessage(hCtrl, TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)0);\n\tSendMessage(hCtrl, TBM_SETRANGEMAX, (WPARAM)TRUE, (LPARAM)max);\n\tSendMessage(hCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pos);\n\n\tSetPersistencePos(pos);\n}\n\n// Toggle the Image Option dropdown (Windows To Go or persistence settings)\nvoid ToggleImageOptions(void)\n{\n\tBOOL has_wintogo, has_persistence;\n\tuint8_t entry_image_options = image_options;\n\tint i, shift = rh;\n\n\thas_wintogo = ((boot_type == BT_IMAGE) && (image_path != NULL) && (img_report.is_iso || img_report.is_windows_img) &&\n\t\t(WindowsVersion.Version >= WINDOWS_8) && (HAS_WINTOGO(img_report)));\n\thas_persistence = ((boot_type == BT_IMAGE) && (image_path != NULL) && (img_report.is_iso) && (HAS_PERSISTENCE(img_report)));\n\n\tassert(popcnt8(image_options) <= 1);\n\n\t// Keep a copy of the \"Image Option\" text (so that we don't have to duplicate its translation in the .loc)\n\tif (image_option_txt[0] == 0)\n\t\tGetWindowTextU(GetDlgItem(hMainDialog, IDS_IMAGE_OPTION_TXT), image_option_txt, sizeof(image_option_txt));\n\n\tif (((has_wintogo) && !(image_options & IMOP_WINTOGO)) ||\n\t\t((!has_wintogo) && (image_options & IMOP_WINTOGO))) {\n\t\timage_options ^= IMOP_WINTOGO;\n\t\tif (image_options & IMOP_WINTOGO) {\n\t\t\tSetWindowTextU(GetDlgItem(hMainDialog, IDS_IMAGE_OPTION_TXT), image_option_txt);\n\t\t\t// Set the Windows To Go selection in the dropdown\n\t\t\tIGNORE_RETVAL(ComboBox_SetCurSel(hImageOption, imop_win_sel));\n\t\t}\n\t}\n\n\tif (((has_persistence) && !(image_options & IMOP_PERSISTENCE)) ||\n\t\t((!has_persistence) && (image_options & IMOP_PERSISTENCE))) {\n\t\timage_options ^= IMOP_PERSISTENCE;\n\t\tif (image_options & IMOP_PERSISTENCE) {\n\t\t\tSetWindowTextU(GetDlgItem(hMainDialog, IDS_IMAGE_OPTION_TXT), lmprintf(MSG_123));\n\t\t\tTogglePersistenceControls(persistence_size != 0);\n\t\t\tSetPersistenceSize();\n\t\t}\n\t}\n\n\tif ( ((entry_image_options != 0) && (has_wintogo || has_persistence)) ||\n\t\t ((entry_image_options == 0) && !(has_wintogo || has_persistence)) )\n\t\tshift = 0;\n\n\tif (shift != 0) {\n\t\tif (entry_image_options != 0)\n\t\t\tshift = -shift;\n\t\tsection_vpos[1] += shift;\n\t\tsection_vpos[2] += shift;\n\n\t\tfor (i = 0; i < ARRAYSIZE(image_option_move_ids); i++)\n\t\t\tMoveCtrlY(hMainDialog, image_option_move_ids[i], shift);\n\n\t\t// Resize the main dialog and log window\n\t\tResizeDialogs(shift);\n\t}\n\n\t// Hide or show the boot options\n\tfor (i = 0; i < ARRAYSIZE(image_option_toggle_ids); i++) {\n\t\tShowWindow(GetDlgItem(hMainDialog, image_option_toggle_ids[i][0]),\n\t\t\t(image_options & image_option_toggle_ids[i][1]) ? SW_SHOW : SW_HIDE);\n\t}\n\t// If you don't force a redraw here, all kind of bad UI artifacts happen...\n\tInvalidateRect(hMainDialog, NULL, TRUE);\n}\n\n// We need to create the small toolbar buttons first so that we can compute their width\nvoid CreateSmallButtons(HWND hDlg)\n{\n\tHIMAGELIST hSaveImageList, hHashImageList;\n\tHICON hIconSave, hIconHash;\n\tint icon_offset = 0, i16 = GetSystemMetrics(SM_CXSMICON);\n\tTBBUTTON tbToolbarButtons[1];\n\tunsigned char* buffer;\n\tDWORD bufsize;\n\n\tif (i16 >= 28)\n\t\ticon_offset = 20;\n\telse if (i16 >= 20)\n\t\ticon_offset = 10;\n\n\thSaveToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, TOOLBAR_STYLE,\n\t\t0, 0, 0, 0, hMainDialog, (HMENU)IDC_SAVE_TOOLBAR, hMainInstance, NULL);\n\thSaveImageList = ImageList_Create(i16, i16, ILC_COLOR32 | ILC_HIGHQUALITYSCALE | ILC_MIRROR, 1, 0);\n\tbuffer = GetResource(hMainInstance, MAKEINTRESOURCEA(IDI_SAVE_16 + icon_offset), _RT_RCDATA, \"save icon\", &bufsize, FALSE);\n\thIconSave = CreateIconFromResourceEx(buffer, bufsize, TRUE, 0x30000, 0, 0, 0);\n\tChangeIconColor(&hIconSave, 0);\n\tImageList_AddIcon(hSaveImageList, hIconSave);\n\tDestroyIcon(hIconSave);\n\tSendMessage(hSaveToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)hSaveImageList);\n\tSendMessage(hSaveToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);\n\tmemset(tbToolbarButtons, 0, sizeof(TBBUTTON));\n\ttbToolbarButtons[0].idCommand = IDC_SAVE;\n\ttbToolbarButtons[0].fsStyle = BTNS_AUTOSIZE;\n\ttbToolbarButtons[0].fsState = TBSTATE_ENABLED;\n\ttbToolbarButtons[0].iBitmap = 0;\n\tSendMessage(hSaveToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&tbToolbarButtons);\n\tSetAccessibleName(hSaveToolbar, lmprintf(MSG_313));\n\n\thHashToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, TOOLBAR_STYLE,\n\t\t0, 0, 0, 0, hMainDialog, (HMENU)IDC_HASH_TOOLBAR, hMainInstance, NULL);\n\thHashImageList = ImageList_Create(i16, i16, ILC_COLOR32 | ILC_HIGHQUALITYSCALE | ILC_MIRROR, 1, 0);\n\tbuffer = GetResource(hMainInstance, MAKEINTRESOURCEA(IDI_HASH_16 + icon_offset), _RT_RCDATA, \"hash icon\", &bufsize, FALSE);\n\thIconHash = CreateIconFromResourceEx(buffer, bufsize, TRUE, 0x30000, 0, 0, 0);\n\tChangeIconColor(&hIconHash, 0);\n\tImageList_AddIcon(hHashImageList, hIconHash);\n\tDestroyIcon(hIconHash);\n\tSendMessage(hHashToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)hHashImageList);\n\tSendMessage(hHashToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);\n\tmemset(tbToolbarButtons, 0, sizeof(TBBUTTON));\n\ttbToolbarButtons[0].idCommand = IDC_HASH;\n\ttbToolbarButtons[0].fsStyle = BTNS_AUTOSIZE;\n\ttbToolbarButtons[0].fsState = TBSTATE_ENABLED;\n\ttbToolbarButtons[0].iBitmap = 0;\n\tSendMessage(hHashToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&tbToolbarButtons);\n\tSetAccessibleName(hHashToolbar, lmprintf(MSG_314));\n}\n\nstatic INT_PTR CALLBACK ProgressCallback(HWND hCtrl, UINT message, WPARAM wParam, LPARAM lParam)\n{\n\tHDC hDC;\n\tHPEN hOldPen;\n\tHFONT hOldFont;\n\tHBRUSH hOldBrush;\n\tRECT rc, rc2;\n\tPAINTSTRUCT ps;\n\tSIZE size;\n\tLONG full_right;\n\twchar_t winfo[128];\n\tCOLORREF background_color, text_color, inverted_text_color, border_color;\n\tstatic BOOL marquee_mode = FALSE;\n\tstatic uint32_t pos = 0, min = 0, max = 0xFFFF;\n\tstatic COLORREF color = PROGRESS_BAR_NORMAL_COLOR;\n\n\tswitch (message) {\n\n\tcase PBM_SETSTATE:\n\t\tswitch (wParam) {\n\t\tcase PBST_NORMAL:\n\t\t\tcolor = PROGRESS_BAR_NORMAL_COLOR;\n\t\t\tbreak;\n\t\tcase PBST_PAUSED:\n\t\t\tcolor = PROGRESS_BAR_PAUSED_COLOR;\n\t\t\tbreak;\n\t\tcase PBST_ERROR:\n\t\t\tcolor = PROGRESS_BAR_ERROR_COLOR;\n\t\t\tbreak;\n\t\t}\n\t\treturn (INT_PTR)TRUE;\n\n\tcase PBM_SETRANGE:\n\t\tCallWindowProc(progress_original_proc, hCtrl, message, wParam, lParam);\n\t\t// Don't bother sanity checking min and max: If *you* want to\n\t\t// be an ass about the progress bar range, it's *your* problem.\n\t\tmin = (uint32_t)(lParam & 0xFFFF);\n\t\tmax = (uint32_t)(lParam >> 16);\n\t\treturn (INT_PTR)TRUE;\n\n\tcase PBM_SETPOS:\n\t\tCallWindowProc(progress_original_proc, hCtrl, message, wParam, lParam);\n\t\tpos = (WORD)wParam;\n\t\tInvalidateRect(hProgress, NULL, TRUE);\n\t\treturn (INT_PTR)TRUE;\n\n\tcase PBM_SETMARQUEE:\n\t\tCallWindowProc(progress_original_proc, hCtrl, message, wParam, lParam);\n\t\tif ((wParam == TRUE) && (!marquee_mode)) {\n\t\t\tmarquee_mode = TRUE;\n\t\t\tpos = min;\n\t\t\tcolor = PROGRESS_BAR_NORMAL_COLOR;\n\t\t\tSetTimer(hCtrl, TID_MARQUEE_TIMER, MARQUEE_TIMER_REFRESH, NULL);\n\t\t\tInvalidateRect(hProgress, NULL, TRUE);\n\t\t} else if ((wParam == FALSE) && (marquee_mode)) {\n\t\t\tmarquee_mode = FALSE;\n\t\t\tKillTimer(hCtrl, TID_MARQUEE_TIMER);\n\t\t\tpos = min;\n\t\t\tInvalidateRect(hProgress, NULL, TRUE);\n\t\t}\n\t\treturn (INT_PTR)TRUE;\n\n\tcase WM_TIMER:\n\t\tif ((wParam == TID_MARQUEE_TIMER) && marquee_mode) {\n\t\t\tpos += max((max - min) / (1000 / MARQUEE_TIMER_REFRESH), 1);\n\t\t\tif ((pos > max) || (pos < min))\n\t\t\t\tpos = min;\n\t\t\tInvalidateRect(hProgress, NULL, TRUE);\n\t\t\treturn (INT_PTR)TRUE;\n\t\t}\n\t\treturn (INT_PTR)FALSE;\n\n\tcase WM_PAINT:\n\t\thDC = BeginPaint(hCtrl, &ps);\n\t\tbackground_color = is_darkmode_enabled ? DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR : PROGRESS_BAR_BACKGROUND_COLOR;\n\t\ttext_color = is_darkmode_enabled ? PROGRESS_BAR_INVERTED_TEXT_COLOR : PROGRESS_BAR_NORMAL_TEXT_COLOR;\n\t\tinverted_text_color = is_darkmode_enabled ? PROGRESS_BAR_NORMAL_TEXT_COLOR : PROGRESS_BAR_INVERTED_TEXT_COLOR;\n\t\tborder_color = is_darkmode_enabled ? DARKMODE_NORMAL_CONTROL_EDGE_COLOR : PROGRESS_BAR_BOX_COLOR;\n\t\tGetClientRect(hCtrl, &rc);\n\t\trc2 = rc;\n\t\tInflateRect(&rc, -1, -1);\n\t\thOldPen = (HPEN)SelectObject(hDC, GetStockObject(DC_PEN));\n\t\thOldBrush = (HBRUSH)SelectObject(hDC, GetStockObject(NULL_BRUSH));\n\t\t// TODO: Handle SetText message so we can avoid this call\n\t\tGetWindowTextW(hProgress, winfo, ARRAYSIZE(winfo));\n\t\thOldFont = (hInfoFont != NULL) ? (HFONT)SelectObject(hDC, hInfoFont) : NULL;\n\t\tGetTextExtentPoint32(hDC, winfo, (int)wcslen(winfo), &size);\n\t\tif (size.cx > rc.right)\n\t\t\tsize.cx = rc.right;\n\t\tif (size.cy > rc.bottom)\n\t\t\tsize.cy = rc.bottom;\n\t\tfull_right = rc.right;\n\t\tif (marquee_mode) {\n\t\t\t// Optional first segment\n\t\t\tif (pos + ((max - min) / 5) > max) {\n\t\t\t\trc.right = MulDiv(pos + ((max - min) / 5) - max, rc.right, max - min);\n\t\t\t\tSetTextColor(hDC, inverted_text_color);\n\t\t\t\tSetBkColor(hDC, color);\n\t\t\t\tExtTextOut(hDC, (full_right - size.cx) / 2, (rc.bottom - size.cy) / 2,\n\t\t\t\t\tETO_CLIPPED | ETO_OPAQUE | ETO_NUMERICSLOCAL, &rc, winfo, (int)wcslen(winfo), NULL);\n\t\t\t\trc.left = rc.right;\n\t\t\t\trc.right = full_right;\n\t\t\t}\n\t\t\t// Optional second segment\n\t\t\tif (pos > min) {\n\t\t\t\trc.right = MulDiv(pos - min, rc.right, max - min);\n\t\t\t\tSetTextColor(hDC, text_color);\n\t\t\t\tSetBkColor(hDC, background_color);\n\t\t\t\tExtTextOut(hDC, (full_right - size.cx) / 2, (rc.bottom - size.cy) / 2,\n\t\t\t\t\tETO_CLIPPED | ETO_OPAQUE | ETO_NUMERICSLOCAL, &rc, winfo, (int)wcslen(winfo), NULL);\n\t\t\t\trc.left = rc.right;\n\t\t\t\trc.right = full_right;\n\t\t\t}\n\t\t\t// Second to last segment\n\t\t\trc.right = MulDiv(pos - min + ((max - min) / 5), rc.right, max - min);\n\t\t\tSetTextColor(hDC, inverted_text_color);\n\t\t\tSetBkColor(hDC, color);\n\t\t\tExtTextOut(hDC, (full_right - size.cx) / 2, (rc.bottom - size.cy) / 2,\n\t\t\t\tETO_CLIPPED | ETO_OPAQUE | ETO_NUMERICSLOCAL, &rc, winfo, (int)wcslen(winfo), NULL);\n\t\t} else {\n\t\t\t// First segment\n\t\t\trc.right = (pos > min) ? MulDiv(pos - min, rc.right, max - min) : rc.left;\n\t\t\tSetTextColor(hDC, inverted_text_color);\n\t\t\tSetBkColor(hDC, color);\n\t\t\tExtTextOut(hDC, (full_right - size.cx) / 2, (rc.bottom - size.cy) / 2,\n\t\t\t\tETO_CLIPPED | ETO_OPAQUE | ETO_NUMERICSLOCAL, &rc, winfo, (int)wcslen(winfo), NULL);\n\t\t}\n\t\t// Last segment\n\t\trc.left = rc.right;\n\t\trc.right = full_right;\n\t\tSetTextColor(hDC, text_color);\n\t\tSetBkColor(hDC, background_color);\n\t\tExtTextOut(hDC, (full_right - size.cx) / 2, (rc.bottom - size.cy) / 2,\n\t\t\tETO_CLIPPED | ETO_OPAQUE | ETO_NUMERICSLOCAL, &rc, winfo, (int)wcslen(winfo), NULL);\n\t\t// Bounding rectangle\n\t\tSetDCPenColor(hDC, border_color);\n\t\tRectangle(hDC, rc2.left, rc2.top, rc2.right, rc2.bottom);\n\t\tif (hOldFont != NULL)\n\t\t\tSelectObject(hDC, hOldFont);\n\t\tSelectObject(hDC, hOldPen);\n\t\tSelectObject(hDC, hOldBrush);\n\t\tEndPaint(hCtrl, &ps);\n\t\treturn (INT_PTR)TRUE;\n\t}\n\n\treturn CallWindowProc(progress_original_proc, hCtrl, message, wParam, lParam);\n}\n\nvoid CreateAdditionalControls(HWND hDlg)\n{\n\tint buttons_list[] = { IDC_LANG, IDC_ABOUT, IDC_SETTINGS, IDC_LOG };\n\tint bitmaps_list[] = { 0, 1, 2, 3 };\n\tHINSTANCE hDll;\n\tHIMAGELIST hToolbarImageList;\n\tHICON hIcon, hIconUp, hIconDown;\n\tRECT rc;\n\tSIZE sz;\n\tint icon_offset = 0, i, i16, s16, size;\n\tint toolbar_dx = -4 - ((fScale > 1.49f) ? 1 : 0) - ((fScale > 1.99f) ? 1 : 0);\n\tTBBUTTON tbToolbarButtons[ARRAYSIZE(buttons_list) * 2 - 1];\n\tunsigned char* buffer;\n\tDWORD bufsize;\n\n\ts16 = i16 = GetSystemMetrics(SM_CXSMICON);\n\tif (s16 >= 54)\n\t\ts16 = 64;\n\telse if (s16 >= 40)\n\t\ts16 = 48;\n\telse if (s16 >= 28)\n\t\ts16 = 32;\n\telse if (s16 >= 20)\n\t\ts16 = 24;\n\tif (i16 >= 28)\n\t\ticon_offset = 20;\n\telse if (i16 >= 20)\n\t\ticon_offset = 10;\n\n\t// Fetch the up and down expand icons for the advanced options toolbar\n\thDll = GetLibraryHandle(\"ComDlg32\");\n\thIconDown = (HICON)LoadImage(hDll, MAKEINTRESOURCE(is_darkmode_enabled ? 579 : 577), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED);\n\thIconUp = (HICON)LoadImage(hDll, MAKEINTRESOURCE(is_darkmode_enabled ? 580 : 578), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED);\n\t// Fallback to using Shell32 if we can't locate the icons we want in ComDlg32 (Windows 8)\n\thDll = GetLibraryHandle(\"Shell32\");\n\tif (hIconUp == NULL)\n\t\thIconUp = (HICON)LoadImage(hDll, MAKEINTRESOURCE(16749), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED);\n\tif (hIconDown == NULL)\n\t\thIconDown = (HICON)LoadImage(hDll, MAKEINTRESOURCE(16750), IMAGE_ICON, s16, s16, LR_DEFAULTCOLOR | LR_SHARED);\n\thUpImageList = ImageList_Create(i16, i16, ILC_COLOR32 | ILC_HIGHQUALITYSCALE, 1, 0);\n\thDownImageList = ImageList_Create(i16, i16, ILC_COLOR32 | ILC_HIGHQUALITYSCALE, 1, 0);\n\tImageList_AddIcon(hUpImageList, hIconUp);\n\tImageList_AddIcon(hDownImageList, hIconDown);\n\n\t// Create the advanced options toolbars\n\tmemset(wtbtext, 0, sizeof(wtbtext));\n\tutf8_to_wchar_no_alloc(lmprintf((advanced_mode_device) ? MSG_122 : MSG_121, lmprintf(MSG_119)), wtbtext[0], ARRAYSIZE(wtbtext[0]));\n\thAdvancedDeviceToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, TOOLBAR_STYLE,\n\t\t0, 0, 0, 0, hMainDialog, (HMENU)IDC_ADVANCED_DEVICE_TOOLBAR, hMainInstance, NULL);\n\tSendMessage(hAdvancedDeviceToolbar, CCM_SETVERSION, (WPARAM)6, 0);\n\tmemset(tbToolbarButtons, 0, sizeof(tbToolbarButtons));\n\ttbToolbarButtons[0].idCommand = IDC_ADVANCED_DRIVE_PROPERTIES;\n\ttbToolbarButtons[0].fsStyle = BTNS_SHOWTEXT | BTNS_AUTOSIZE;\n\ttbToolbarButtons[0].fsState = TBSTATE_ENABLED;\n\ttbToolbarButtons[0].iString = (INT_PTR)wtbtext[0];\n\ttbToolbarButtons[0].iBitmap = 0;\n\tSendMessage(hAdvancedDeviceToolbar, TB_SETIMAGELIST, 0, (LPARAM)hUpImageList);\n\tSendMessage(hAdvancedDeviceToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);\n\tSendMessage(hAdvancedDeviceToolbar, TB_ADDBUTTONS, 1, (LPARAM)&tbToolbarButtons);\n\tGetWindowRect(GetDlgItem(hDlg, IDC_ADVANCED_DRIVE_PROPERTIES), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSendMessage(hAdvancedDeviceToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz);\n\tSetWindowPos(hAdvancedDeviceToolbar, hTargetSystem, rc.left + toolbar_dx, rc.top, sz.cx, rc.bottom - rc.top, 0);\n\tSetAccessibleName(hAdvancedDeviceToolbar, lmprintf(MSG_119));\n\n\tutf8_to_wchar_no_alloc(lmprintf((advanced_mode_format) ? MSG_122 : MSG_121, lmprintf(MSG_120)), wtbtext[1], ARRAYSIZE(wtbtext[1]));\n\thAdvancedFormatToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, TOOLBAR_STYLE,\n\t\t0, 0, 0, 0, hMainDialog, (HMENU)IDC_ADVANCED_FORMAT_TOOLBAR, hMainInstance, NULL);\n\tSendMessage(hAdvancedFormatToolbar, CCM_SETVERSION, (WPARAM)6, 0);\n\tmemset(tbToolbarButtons, 0, sizeof(tbToolbarButtons));\n\ttbToolbarButtons[0].idCommand = IDC_ADVANCED_FORMAT_OPTIONS;\n\ttbToolbarButtons[0].fsStyle = BTNS_SHOWTEXT | BTNS_AUTOSIZE;\n\ttbToolbarButtons[0].fsState = TBSTATE_ENABLED;\n\ttbToolbarButtons[0].iString = (INT_PTR)wtbtext[1];\n\ttbToolbarButtons[0].iBitmap = 0;\n\tSendMessage(hAdvancedFormatToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)hUpImageList);\n\tSendMessage(hAdvancedFormatToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);\n\tSendMessage(hAdvancedFormatToolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)&tbToolbarButtons);\n\tGetWindowRect(GetDlgItem(hDlg, IDC_ADVANCED_FORMAT_OPTIONS), &rc);\n\tMapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);\n\tSendMessage(hAdvancedFormatToolbar, TB_GETIDEALSIZE, (WPARAM)FALSE, (LPARAM)&sz);\n\tSetWindowPos(hAdvancedFormatToolbar, hClusterSize, rc.left + toolbar_dx, rc.top, sz.cx, rc.bottom - rc.top, 0);\n\tSetAccessibleName(hAdvancedFormatToolbar, lmprintf(MSG_120));\n\n\t// Create the multi toolbar\n\thMultiToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, TOOLBAR_STYLE,\n\t\t0, 0, 0, 0, hMainDialog, (HMENU)IDC_MULTI_TOOLBAR, hMainInstance, NULL);\n\thToolbarImageList = ImageList_Create(i16, i16, ILC_COLOR32 | ILC_HIGHQUALITYSCALE, 8, 0);\n\tfor (i = 0; i < ARRAYSIZE(multitoolbar_icons); i++) {\n\t\tbuffer = GetResource(hMainInstance, MAKEINTRESOURCEA(multitoolbar_icons[i] + icon_offset),\n\t\t\t_RT_RCDATA, \"toolbar icon\", &bufsize, FALSE);\n\t\thIcon = CreateIconFromResourceEx(buffer, bufsize, TRUE, 0x30000, 0, 0, 0);\n\t\tChangeIconColor(&hIcon, 0);\n\t\t// Mirror the \"world\" icon on RTL since we can't use an ImageList mirroring flag for that...\n\t\tif (right_to_left_mode && (i == 0))\n\t\t\thIcon = CreateMirroredIcon(hIcon);\n\t\tImageList_AddIcon(hToolbarImageList, hIcon);\n\t\tDestroyIcon(hIcon);\n\t}\n\tSendMessage(hMultiToolbar, TB_SETIMAGELIST, (WPARAM)0, (LPARAM)hToolbarImageList);\n\tSendMessage(hMultiToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);\n\tmemset(tbToolbarButtons, 0, sizeof(TBBUTTON) * ARRAYSIZE(tbToolbarButtons));\n\tsize = 2 * ARRAYSIZE(buttons_list) - 1;\n\tif (appstore_version) {\n\t\t// Remove the Update Settings button for the AppStore version\n\t\tbuttons_list[2] = buttons_list[3];\n\t\tbitmaps_list[2] = bitmaps_list[3];\n\t\tsize -= 2;\n\t}\n\tfor (i = 0; i < size; i++) {\n\t\tif (i % 2 == 0) {\n\t\t\ttbToolbarButtons[i].idCommand = buttons_list[i / 2];\n\t\t\ttbToolbarButtons[i].fsStyle = BTNS_BUTTON;\n\t\t\ttbToolbarButtons[i].fsState = TBSTATE_ENABLED;\n\t\t\ttbToolbarButtons[i].iBitmap = bitmaps_list[i / 2];\n\t\t} else {\n\t\t\ttbToolbarButtons[i].fsStyle = BTNS_AUTOSIZE;\n\t\t\ttbToolbarButtons[i].fsState = TBSTATE_INDETERMINATE;\n\t\t\ttbToolbarButtons[i].iBitmap = I_IMAGENONE;\n\t\t\ttbToolbarButtons[i].iString = (fScale < 1.5f) ? (INT_PTR)L\"\" : (INT_PTR)L\" \";\n\t\t}\n\t}\n\tSendMessage(hMultiToolbar, TB_ADDBUTTONS, (WPARAM)i, (LPARAM)&tbToolbarButtons);\n\tSendMessage(hMultiToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(i16, ddbh));\n\tSetAccessibleName(hMultiToolbar, lmprintf(MSG_315));\n\n\t// Subclass the progress bar so that we can write on it\n\tprogress_original_proc = (WNDPROC)SetWindowLongPtr(hProgress, GWLP_WNDPROC, (LONG_PTR)ProgressCallback);\n}\n\n// Set up progress bar real estate allocation\nvoid InitProgress(BOOL bOnlyFormat)\n{\n\tint i;\n\tfloat last_end = 0.0f, slots_discrete = 0.0f, slots_analog = 0.0f;\n\n\tmemset(nb_slots, 0, sizeof(nb_slots));\n\tmemset(slot_end, 0, sizeof(slot_end));\n\tprevious_end = 0.0f;\n\n\tif (bOnlyFormat) {\n\t\tnb_slots[OP_FORMAT] = -1;\n\t} else {\n\t\tnb_slots[OP_ANALYZE_MBR] = 1;\n\t\tif (IsChecked(IDC_BAD_BLOCKS)) {\n\t\t\tnb_slots[OP_BADBLOCKS] = -1;\n\t\t}\n\t\tif (boot_type != BT_NON_BOOTABLE) {\n\t\t\t// 1 extra slot for PBR writing\n\t\t\tswitch (selection_default) {\n\t\t\tcase BT_MSDOS:\n\t\t\t\tnb_slots[OP_FILE_COPY] = 3 + 1;\n\t\t\t\tbreak;\n\t\t\tcase BT_FREEDOS:\n\t\t\t\tnb_slots[OP_FILE_COPY] = 5 + 1;\n\t\t\t\tbreak;\n\t\t\tcase BT_IMAGE:\n\t\t\t\tnb_slots[OP_FILE_COPY] = (img_report.is_iso || img_report.is_windows_img) ? -1 : 0;\n\t\t\t\tif (HAS_WINDOWS(img_report) && (unattend_xml_path != NULL) &&\n\t\t\t\t\t(ComboBox_GetCurItemData(hImageOption) != IMOP_WIN_TO_GO))\n\t\t\t\t\tnb_slots[OP_PATCH] = -1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tnb_slots[OP_FILE_COPY] = 2 + 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (selection_default == BT_IMAGE && !(img_report.is_iso || img_report.is_windows_img)) {\n\t\t\tnb_slots[OP_FORMAT] = -1;\n\t\t} else {\n\t\t\tnb_slots[OP_ZERO_MBR] = 1;\n\t\t\tnb_slots[OP_PARTITION] = 1;\n\t\t\tnb_slots[OP_FIX_MBR] = 1;\n\t\t\tnb_slots[OP_CREATE_FS] = (use_vds) ? 2 :\n\t\t\t\tnb_steps[ComboBox_GetCurItemData(hFileSystem)];\n\t\t\t// So, yeah, if you're doing slow format, or using Large FAT32, and have persistence, you'll see\n\t\t\t// the progress bar revert during format on account that we reuse the same operation for both\n\t\t\t// partitions. Maybe one day I'll be bothered to handle two separate OP_FORMAT ops...\n\t\t\tif ((!IsChecked(IDC_QUICK_FORMAT)) || (persistence_size != 0) || IS_EXT(fs_type) ||\n\t\t\t\t((fs_type == FS_FAT32) && ((SelectedDrive.DiskSize >= LARGE_FAT32_SIZE) || (force_large_fat32)))) {\n\t\t\t\tnb_slots[OP_FORMAT] = -1;\n\t\t\t\tnb_slots[OP_CREATE_FS] = 0;\n\t\t\t}\n\t\t\tnb_slots[OP_FINALIZE] = ((selection_default == BT_IMAGE) && (fs_type == FS_NTFS)) ? 3 : 2;\n\t\t}\n\t}\n\tif (archive_path != NULL) {\n\t\tnb_slots[OP_EXTRACT_ZIP] = -1;\n\t}\n\n\tfor (i = 0; i < OP_MAX; i++) {\n\t\tif (nb_slots[i] > 0) {\n\t\t\tslots_discrete += nb_slots[i] * 1.0f;\n\t\t}\n\t\tif (nb_slots[i] < 0) {\n\t\t\tslots_analog += nb_slots[i] * 1.0f;\n\t\t}\n\t}\n\n\tfor (i = 0; i < OP_MAX; i++) {\n\t\tif (nb_slots[i] == 0) {\n\t\t\tslot_end[i + 1] = last_end;\n\t\t} else if (nb_slots[i] > 0) {\n\t\t\tslot_end[i + 1] = last_end + (1.0f * nb_slots[i]);\n\t\t} else if (nb_slots[i] < 0) {\n\t\t\tslot_end[i + 1] = last_end + (((100.0f - slots_discrete) * nb_slots[i]) / slots_analog);\n\t\t}\n\t\tlast_end = slot_end[i + 1];\n\t}\n\n\t// If there's no analog, adjust our discrete ends to fill the whole bar\n\tif (slots_analog == 0.0f) {\n\t\tfor (i = 0; i < OP_MAX; i++) {\n\t\t\tslot_end[i + 1] *= 100.0f / slots_discrete;\n\t\t}\n\t}\n}\n\n// Position the progress bar within each operation range\nvoid UpdateProgress(int op, float percent)\n{\n\tint pos;\n\tstatic uint64_t LastRefresh = 0;\n\n\tif ((op < 0) || (op >= OP_MAX)) {\n\t\tduprintf(\"UpdateProgress: invalid op %d\\n\", op);\n\t\treturn;\n\t}\n\tif (percent > 100.1f) {\n\t\t// duprintf(\"UpdateProgress(%d): invalid percentage %0.2f\\n\", op, percent);\n\t\treturn;\n\t}\n\tif ((percent < 0.0f) && (nb_slots[op] <= 0)) {\n\t\tduprintf(\"UpdateProgress(%d): error negative percentage sent for negative slot value\\n\", op);\n\t\treturn;\n\t}\n\tif (nb_slots[op] == 0)\n\t\treturn;\n\tif (previous_end < slot_end[op]) {\n\t\tprevious_end = slot_end[op];\n\t}\n\n\tif (percent < 0.0f) {\n\t\t// Negative means advance one slot (1.0%) - requires a positive slot allocation\n\t\tprevious_end += (slot_end[op + 1] - slot_end[op]) / (1.0f * nb_slots[op]);\n\t\tpos = (int)(previous_end / 100.0f * MAX_PROGRESS);\n\t} else {\n\t\tpos = (int)((previous_end + ((slot_end[op + 1] - previous_end) * (percent / 100.0f))) / 100.0f * MAX_PROGRESS);\n\t}\n\tif (pos > MAX_PROGRESS) {\n\t\tduprintf(\"UpdateProgress(%d): rounding error - pos %d is greater than %d\", op, pos, MAX_PROGRESS);\n\t\tpos = MAX_PROGRESS;\n\t}\n\n\t// Reduce the refresh rate, to avoid weird effects on the sliding part of progress bar\n\tif (GetTickCount64() > LastRefresh + (2 * MAX_REFRESH)) {\n\t\tLastRefresh = GetTickCount64();\n\t\tSendMessage(hProgress, PBM_SETPOS, (WPARAM)pos, 0);\n\t\tSetTaskbarProgressValue(pos, MAX_PROGRESS);\n\t}\n}\n\n/*\n * The following is taken from GNU wget (progress.c)\n */\nstruct bar_progress {\n\tuint64_t total_length;          // expected total byte count when the download finishes\n\tuint64_t count;                 // bytes downloaded so far\n\tuint64_t last_screen_update;    // time of the last screen update, measured since the beginning of download.\n\tuint64_t dltime;                // download time so far\n\t// Keep track of recent download speeds.\n\tstruct bar_progress_hist {\n\t\tuint64_t pos;\n\t\tuint64_t times[SPEED_HISTORY_SIZE];\n\t\tuint64_t bytes[SPEED_HISTORY_SIZE];\n\t\t// The sum of times and bytes respectively, maintained for efficiency.\n\t\tuint64_t total_time;\n\t\tuint64_t total_bytes;\n\t} hist;\n\tuint64_t recent_start;          // timestamp of beginning of current position.\n\tuint64_t recent_bytes;          // bytes downloaded so far.\n\tBOOL stalled;                   // set when no data arrives for longer than STALL_START_TIME, then reset when new data arrives.\n\n\t// The following are used to make sure that ETA information doesn't flicker.\n\tuint64_t last_eta_time;         // time of the last update to download speed and ETA, measured since the beginning of download.\n\tint last_eta_value;\n};\n\n// This code attempts to maintain the notion of a \"current\" download speed, over the course\n// of no less than 3s. (Shorter intervals produce very erratic results.)\n//\n// To do so, it samples the speed in 150ms intervals and stores the recorded samples in a\n// FIFO history ring. The ring stores no more than 20 intervals, hence the history covers\n// the period of at least three seconds and at most 20 reads into the past. This method\n// should produce reasonable results for downloads ranging from very slow to very fast.\n//\n// The idea is that for fast downloads, we get the speed over exactly the last three seconds.\n// For slow downloads (where a network read takes more than 150ms to complete), we get the\n// speed over a larger time period, as large as it takes to complete twenty reads. This is\n// good because slow downloads tend to fluctuate more and a 3-second average would be too\n// erratic.\nstatic void bar_update(struct bar_progress* bp, uint64_t howmuch, uint64_t dltime)\n{\n\tstruct bar_progress_hist* hist = &bp->hist;\n\tuint64_t recent_age = dltime - bp->recent_start;\n\n\t// Update the download count.\n\tbp->recent_bytes += howmuch;\n\n\t// For very small time intervals, we return after having updated the\n\t// \"recent\" download count. When its age reaches or exceeds minimum\n\t// sample time, it will be recorded in the history ring.\n\tif (recent_age < SPEED_SAMPLE_MIN)\n\t\treturn;\n\n\tif (howmuch == 0) {\n\t\t// If we're not downloading anything, we might be stalling,\n\t\t// i.e. not downloading anything for an extended period of time.\n\t\t// Since 0-reads do not enter the history ring, recent_age\n\t\t// effectively measures the time since last read.\n\t\tif (recent_age >= STALL_START_TIME) {\n\t\t\t// If we're stalling, reset the ring contents because it's\n\t\t\t// stale and because it will make bar_update stop printing\n\t\t\t// the (bogus) current bandwidth.\n\t\t\tbp->stalled = TRUE;\n\t\t\tmemset(hist, 0, sizeof(struct bar_progress_hist));\n\t\t\tbp->recent_bytes = 0;\n\t\t}\n\t\treturn;\n\t}\n\n\t// We now have a non-zero amount of to store to the speed ring.\n\n\t// If the stall status was acquired, reset it.\n\tif (bp->stalled) {\n\t\tbp->stalled = FALSE;\n\t\t// \"recent_age\" includes the entire stalled period, which\n\t\t// could be very long. Don't update the speed ring with that\n\t\t// value because the current bandwidth would start too small.\n\t\t// Start with an arbitrary (but more reasonable) time value and\n\t\t// let it level out.\n\t\trecent_age = 1000;\n\t}\n\n\t// Store \"recent\" bytes and download time to history ring at the position POS.\n\n\t// To correctly maintain the totals, first invalidate existing data\n\t// (least recent in time) at this position. */\n\thist->total_time -= hist->times[hist->pos];\n\thist->total_bytes -= hist->bytes[hist->pos];\n\n\t// Now store the new data and update the totals.\n\thist->times[hist->pos] = recent_age;\n\thist->bytes[hist->pos] = bp->recent_bytes;\n\thist->total_time += recent_age;\n\thist->total_bytes += bp->recent_bytes;\n\n\t// Start a new \"recent\" period.\n\tbp->recent_start = dltime;\n\tbp->recent_bytes = 0;\n\n\t// Advance the current ring position.\n\tif (++hist->pos == SPEED_HISTORY_SIZE)\n\t\thist->pos = 0;\n}\n\n// This updates the progress bar as well as the data displayed on it so that we can\n// display percentage completed, rate of transfer and estimated remaining duration.\n// During init (op = OP_INIT) an optional HWND can be passed on which to look for\n// a progress bar. Part of the code (eta, speed) comes from GNU wget.\nvoid _UpdateProgressWithInfo(int op, int msg, uint64_t processed, uint64_t total, BOOL force)\n{\n\tstatic int last_update_progress_type = UPT_PERCENT;\n\tstatic struct bar_progress bp = { 0 };\n\tHWND hProgressDialog = (HWND)(uintptr_t)processed;\n\tstatic HWND hProgressBar = NULL;\n\tstatic uint64_t start_time = 0, last_refresh = 0;\n\tuint64_t speed = 0, current_time = GetTickCount64();\n\tdouble percent = 0.0;\n\tchar msg_data[128];\n\tstatic BOOL bNoAltMode = FALSE;\n\n\tif (op == OP_INIT) {\n\t\tstart_time = current_time - 1;\n\t\tlast_refresh = 0;\n\t\tlast_update_progress_type = UPT_PERCENT;\n\t\tpercent = 0.0f;\n\t\tspeed = 0;\n\t\tmemset(&bp, 0, sizeof(bp));\n\t\tbp.total_length = total;\n\t\thProgressBar = NULL;\n\t\tbNoAltMode = (BOOL)msg;\n\t\tif (hProgressDialog != NULL) {\n\t\t\t// Use the progress control provided, if any\n\t\t\thProgressBar = GetDlgItem(hProgressDialog, IDC_PROGRESS);\n\t\t\tif (hProgressBar != NULL) {\n\t\t\t\tSendMessage(hProgressBar, PBM_SETSTATE, (WPARAM)PBST_NORMAL, 0);\n\t\t\t\tSendMessage(hProgressBar, PBM_SETMARQUEE, FALSE, 0);\n\t\t\t\tSendMessage(hProgressBar, PBM_SETPOS, 0, 0);\n\t\t\t}\n\t\t\tSendMessage(hProgressDialog, UM_PROGRESS_INIT, 0, 0);\n\t\t}\n\t} else if ((hProgressBar != NULL) || (op > 0)) {\n\t\tuint64_t dl_total_time = current_time - start_time;\n\t\tuint64_t howmuch = processed - bp.count;\n\t\tbp.count = processed;\n\t\tbp.total_length = total;\n\t\tif (bp.count > bp.total_length)\n\t\t\tbp.total_length = bp.count;\n\t\tif (bp.total_length > 0)\n\t\t\tpercent = (100.0f * bp.count) / (1.0f * bp.total_length);\n\t\telse\n\t\t\tpercent = 0.0f;\n\n\t\tif ((bp.hist.total_time > 999) && (bp.hist.total_bytes != 0)) {\n\t\t\t// Calculate the download speed using the history ring and\n\t\t\t// recent data that hasn't made it to the ring yet.\n\t\t\tuint64_t dlquant = bp.hist.total_bytes + bp.recent_bytes;\n\t\t\tuint64_t dltime = bp.hist.total_time + (dl_total_time - bp.recent_start);\n\t\t\tspeed = (dltime == 0) ? 0 : (dlquant * 1000) / dltime;\n\t\t} else {\n\t\t\tspeed = 0;\n\t\t}\n\t\tbar_update(&bp, howmuch, dl_total_time);\n\n\t\tif (bNoAltMode)\n\t\t\tupdate_progress_type = UPT_PERCENT;\n\t\tswitch (update_progress_type) {\n\t\tcase UPT_SPEED:\n\t\t\tif (speed != 0)\n\t\t\t\tstatic_sprintf(msg_data, \"%s/s\", SizeToHumanReadable(speed, FALSE, FALSE));\n\t\t\telse\n\t\t\t\tstatic_sprintf(msg_data, \"---\");\n\t\t\tbreak;\n\t\tcase UPT_ETA:\n\t\t\tif ((bp.total_length > 0) && (bp.count > 0) && (dl_total_time > 3000)) {\n\t\t\t\tuint32_t eta = 0;\n\n\t\t\t\t// Don't change the value of ETA more than approximately once\n\t\t\t\t// per second; doing so would cause flashing without providing\n\t\t\t\t// any value to the user.\n\t\t\t\tif ((bp.total_length != processed) && (bp.last_eta_value != 0) &&\n\t\t\t\t\t(dl_total_time - bp.last_eta_time < ETA_REFRESH_INTERVAL)) {\n\t\t\t\t\teta = bp.last_eta_value;\n\t\t\t\t} else {\n\t\t\t\t\t// Calculate ETA using the average download speed to predict\n\t\t\t\t\t// the future speed. If you want to use a speed averaged\n\t\t\t\t\t// over a more recent period, replace dl_total_time with\n\t\t\t\t\t// hist->total_time and bp->count with hist->total_bytes.\n\t\t\t\t\t// I found that doing that results in a very jerky and\n\t\t\t\t\t// ultimately unreliable ETA.\n\t\t\t\t\tuint64_t bytes_remaining = bp.total_length - processed;\n\t\t\t\t\tdouble d_eta = (dl_total_time / 1000.0) * (bytes_remaining * 1.0) / (bp.count * 1.0);\n\t\t\t\t\tif (d_eta >= INT_MAX - 1)\n\t\t\t\t\t\tgoto skip_eta;\n\t\t\t\t\teta = (uint32_t)(d_eta + 0.5);\n\t\t\t\t\tbp.last_eta_value = eta;\n\t\t\t\t\tbp.last_eta_time = dl_total_time;\n\t\t\t\t}\n\t\t\t\tstatic_sprintf(msg_data, \"%d:%02d:%02d\", eta / 3600, (uint16_t)((eta % 3600) / 60), (uint16_t)(eta % 60));\n\t\t\t} else {\n\t\t\tskip_eta:\n\t\t\t\tstatic_sprintf(msg_data, \"-:--:--\");\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstatic_sprintf(msg_data, \"%0.1f%%\", percent);\n\t\t\tbreak;\n\t\t}\n\t\tif ((force) || (bp.count == bp.total_length) || (current_time > last_refresh + MAX_REFRESH)) {\n\t\t\tif (op < 0) {\n\t\t\t\tSendMessage(hProgressBar, PBM_SETPOS, (WPARAM)(MAX_PROGRESS * percent / 100.0f), 0);\n\t\t\t\tif (op == OP_NOOP_WITH_TASKBAR)\n\t\t\t\t\tSetTaskbarProgressValue((ULONGLONG)(MAX_PROGRESS * percent / 100.0f), MAX_PROGRESS);\n\t\t\t} else {\n\t\t\t\tUpdateProgress(op, (float)percent);\n\t\t\t}\n\t\t\tif ((force) || ((msg >= 0) && ((current_time > bp.last_screen_update + SCREEN_REFRESH_INTERVAL) ||\n\t\t\t\t(last_update_progress_type != update_progress_type) || (bp.count == bp.total_length)))) {\n\t\t\t\tPrintInfo(0, msg, msg_data);\n\t\t\t\tbp.last_screen_update = current_time;\n\t\t\t}\n\t\t\tlast_refresh = current_time;\n\t\t}\n\t\tlast_update_progress_type = update_progress_type;\n\t}\n}\n\nvoid ShowLanguageMenu(RECT rcExclude)\n{\n\tTPMPARAMS tpm;\n\tHMENU menu;\n\tRECT rc;\n\tLONG nb_items = 1, adjust = 0;\n\tloc_cmd* lcmd = NULL;\n\tchar lang[256];\n\tchar *search = \"()\";\n\tchar *l, *r, *str;\n\n\tUM_LANGUAGE_MENU_MAX = UM_LANGUAGE_MENU;\n\tmenu = CreatePopupMenu();\n\tlist_for_each_entry(lcmd, &locale_list, loc_cmd, list) {\n\t\t// The appearance of LTR languages must be fixed for RTL menus\n\t\tif ((right_to_left_mode) && (!(lcmd->ctrl_id & LOC_RIGHT_TO_LEFT))) {\n\t\t\tstr = safe_strdup(lcmd->txt[1]);\n\t\t\tl = strtok(str, search);\n\t\t\tr = strtok(NULL, search);\n\t\t\tstatic_sprintf(lang, LEFT_TO_RIGHT_EMBEDDING \"(%s) \" POP_DIRECTIONAL_FORMATTING \"%s\", r, l);\n\t\t\tsafe_free(str);\n\t\t} else {\n\t\t\tstatic_strcpy(lang, lcmd->txt[1]);\n\t\t}\n\t\tInsertMenuU(menu, -1, MF_BYPOSITION | ((selected_locale == lcmd) ? MF_CHECKED : 0), UM_LANGUAGE_MENU_MAX++, lang);\n\t\tnb_items++;\n\t}\n\n\t// Empirical adjust if we have a small enough number of languages to select\n\tif (nb_items < 20) {\n\t\tGetWindowRect(hMultiToolbar, &rc);\n\t\tMapWindowPoints(NULL, hMainDialog, (POINT*)&rc, 2);\n\t\tadjust = rc.top - (nb_items * ddh) / 2;\n\t}\n\n\t// Open the menu such that it doesn't overlap the specified rect\n\ttpm.cbSize = sizeof(TPMPARAMS);\n\ttpm.rcExclude = rcExclude;\n\tTrackPopupMenuEx(menu, 0,\n\t\t// In RTL languages, the menu should be placed at the bottom-right of the rect\n\t\tright_to_left_mode ? rcExclude.right : rcExclude.left,\n\t\trcExclude.bottom + adjust, hMainDialog, &tpm);\n\tDestroyMenu(menu);\n}\n\nvoid SetPassesTooltip(void)\n{\n\tconst unsigned int pattern[BADLOCKS_PATTERN_TYPES][BADBLOCK_PATTERN_COUNT] =\n\t{ BADBLOCK_PATTERN_ONE_PASS, BADBLOCK_PATTERN_TWO_PASSES, BADBLOCK_PATTERN_SLC,\n\t  BADCLOCK_PATTERN_MLC, BADBLOCK_PATTERN_TLC };\n\tint sel = ComboBox_GetCurSel(hNBPasses);\n\tCreateTooltip(hNBPasses, lmprintf(MSG_153 + ((sel >= 2) ? 3 : sel),\n\t\tpattern[sel][0], pattern[sel][1], pattern[sel][2], pattern[sel][3]), -1);\n}\n\nvoid SetBootTypeDropdownWidth(void)\n{\n\tHDC hDC;\n\tHFONT hFont;\n\tSIZE sz;\n\tRECT rc;\n\n\tif (image_path == NULL)\n\t\treturn;\n\t// Set the maximum width of the dropdown according to the image selected\n\tGetWindowRect(hBootType, &rc);\n\tMapWindowPoints(NULL, hMainDialog, (POINT*)&rc, 2);\n\thDC = GetDC(hBootType);\n\thFont = (HFONT)SendMessageA(hBootType, WM_GETFONT, 0, 0);\n\tSelectObject(hDC, hFont);\n\tGetTextExtentPointU(hDC, short_image_path, &sz);\n\tsafe_release_dc(hBootType, hDC);\n\tSendMessage(hBootType, CB_SETDROPPEDWIDTH, (WPARAM)max(sz.cx + 10, rc.right - rc.left), (LPARAM)0);\n}\n\n// Create the horizontal section lines\nvoid OnPaint(HDC hdc)\n{\n\tint i;\n\tCOLORREF cp = is_darkmode_enabled ? DARKMODE_NORMAL_CONTROL_EDGE_COLOR : GetSysColor(COLOR_WINDOWTEXT);\n\tHPEN hp = CreatePen(0, (fScale < 1.5f) ? 2 : 3, cp);\n\tHPEN hop = (HPEN)SelectObject(hdc, hp);\n\tfor (i = 0; i < ARRAYSIZE(section_vpos); i++) {\n\t\tMoveToEx(hdc, mw + 10, section_vpos[i], NULL);\n\t\tLineTo(hdc, mw + fw, section_vpos[i]);\n\t}\n\tSelectObject(hdc, hop);\n\tDeleteObject(hp);\n}\n"
  },
  {
    "path": "src/ui.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * UI-related function calls\n * Copyright © 2018 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <windows.h>\n#include <stdint.h>\n#include \"resource.h\"\n#include \"localization.h\"\n\n#pragma once\n\n// Progress bar colors\n#define PROGRESS_BAR_NORMAL_TEXT_COLOR\t\t\t\tRGB(0x00, 0x00, 0x00)\n#define PROGRESS_BAR_INVERTED_TEXT_COLOR\t\t\tRGB(0xFF, 0xFF, 0xFF)\n#define PROGRESS_BAR_BACKGROUND_COLOR\t\t\t\tRGB(0xE6, 0xE6, 0xE6)\n#define PROGRESS_BAR_BOX_COLOR\t\t\t\t\t\tRGB(0xBC, 0xBC, 0xBC)\n#define PROGRESS_BAR_NORMAL_COLOR\t\t\t\t\tRGB(0x06, 0xB0, 0x25)\n#define PROGRESS_BAR_PAUSED_COLOR\t\t\t\t\tRGB(0xDA, 0xCB, 0x26)\n#define PROGRESS_BAR_ERROR_COLOR\t\t\t\t\tRGB(0xDA, 0x26, 0x26)\n\n// Toolbar icons main color\n#define TOOLBAR_ICON_COLOR\t\t\t\t\t\t\tRGB(0x29, 0x80, 0xB9)\n\n// Dark Mode Colors\n#define DARKMODE_TOOLBAR_ICON_COLOR\t\t\t\t\tRGB(0xFF, 0xD7, 0x00)\n#define DARKMODE_NORMAL_TEXT_COLOR\t\t\t\t\tRGB(0xE0, 0xE0, 0xE0)\n#define DARKMODE_DISABLED_TEXT_COLOR\t\t\t\tRGB(0x80, 0x80, 0x80)\n#define DARKMODE_NORMAL_DIALOG_BACKGROUND_COLOR\t\tRGB(0x20, 0x20, 0x20)\n#define DARKMODE_NORMAL_CONTROL_BACKGROUND_COLOR\tRGB(0x38, 0x38, 0x38)\n#define DARKMODE_HOT_CONTROL_BACKGROUND_COLOR\t\tRGB(0x45, 0x45, 0x45)\n#define DARKMODE_NORMAL_CONTROL_EDGE_COLOR\t\t\tRGB(0x64, 0x64, 0x64)\n#define DARKMODE_HOT_CONTROL_EDGE_COLOR\t\t\t\tRGB(0x9B, 0x9B, 0x9B)\n\n// Toolbar default style\n#define TOOLBAR_STYLE\t\t\t\t\t\t( WS_CHILD | WS_TABSTOP | WS_VISIBLE | \\\n\t\t\t\t\t\t\t\t\t\t\t  WS_CLIPSIBLINGS | WS_CLIPCHILDREN  | \\\n\t\t\t\t\t\t\t\t\t\t\t  CCS_NOPARENTALIGN | CCS_NODIVIDER  | \\\n\t\t\t\t\t\t\t\t\t\t\t  TBSTYLE_FLAT | TBSTYLE_BUTTON      | \\\n\t\t\t\t\t\t\t\t\t\t\t  TBSTYLE_AUTOSIZE | TBSTYLE_LIST    | \\\n\t\t\t\t\t\t\t\t\t\t\t  TBSTYLE_TOOLTIPS )\n\n// Types of update progress we report\nenum update_progress_type {\n\tUPT_PERCENT = 0,\n\tUPT_SPEED,\n\tUPT_ETA,\n\tUPT_MAX\n};\n\n// Size of the download speed history ring.\n#define SPEED_HISTORY_SIZE 20\n\n// The minimum time length of a history sample. By default, each sample is at least 150ms long,\n// which means that, over the course of 20 samples, \"current\" download speed spans at least 3s\n// into the past.\n#define SPEED_SAMPLE_MIN 150\n\n// The time after which the download starts to be considered \"stalled\", i.e. the current\n// bandwidth is not printed and the recent download speeds are scratched.\n#define STALL_START_TIME 5000\n\n// Time between screen refreshes will not be shorter than this.\n// NB: In Rufus' case, \"screen\" means the text overlaid on the progress bar.\n#define SCREEN_REFRESH_INTERVAL 200\n\n// Don't refresh the ETA too often to avoid jerkiness in predictions.\n// This allows ETA to change approximately once per second.\n#define ETA_REFRESH_INTERVAL 990\n\nextern HWND hMultiToolbar, hSaveToolbar, hHashToolbar, hAdvancedDeviceToolbar, hAdvancedFormatToolbar;\nextern HFONT hInfoFont;\nextern UINT_PTR UM_LANGUAGE_MENU_MAX;\nextern BOOL advanced_mode_device, advanced_mode_format, force_large_fat32, app_changed_size;\nextern loc_cmd* selected_locale;\nextern uint64_t persistence_size;\nextern const char *sfd_name, *flash_type[BADLOCKS_PATTERN_TYPES];\nextern char *short_image_path, image_option_txt[128];\nextern int advanced_device_section_height, advanced_format_section_height, persistence_unit_selection;\nextern int selection_default, cbw, ddw, ddbh, bh, update_progress_type;\n\nextern void SetAccessibleName(HWND hCtrl, const char* name);\nextern void SetComboEntry(HWND hDlg, int data);\nextern void GetBasicControlsWidth(HWND hDlg);\nextern void GetMainButtonsWidth(HWND hDlg);\nextern void GetHalfDropwdownWidth(HWND hDlg);\nextern void GetFullWidth(HWND hDlg);\nextern void PositionMainControls(HWND hDlg);\nextern void AdjustForLowDPI(HWND hDlg);\nextern void SetSectionHeaders(HWND hDlg, HFONT* hFont);\nextern void SetPersistencePos(uint64_t pos);\nextern void SetPersistenceSize(void);\nextern void TogglePersistenceControls(BOOL display);\nextern void ToggleAdvancedDeviceOptions(BOOL enable);\nextern void ToggleAdvancedFormatOptions(BOOL enable);\nextern void ToggleImageOptions(void);\nextern void CreateSmallButtons(HWND hDlg);\nextern void CreateAdditionalControls(HWND hDlg);\nextern void EnableControls(BOOL enable, BOOL remove_checkboxes);\nextern void InitProgress(BOOL bOnlyFormat);\nextern void ShowLanguageMenu(RECT rcExclude);\nextern void SetPassesTooltip(void);\nextern void SetBootTypeDropdownWidth(void);\nextern void OnPaint(HDC hdc);\n"
  },
  {
    "path": "src/ui_data.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * UI element lists\n * Copyright © 2018-2024 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <windows.h>\n#include \"resource.h\"\n\n#pragma once\n\n// GUIDs needed to set a control's accessibility props\n#if defined(_MSC_VER)\nconst GUID DECLSPEC_SELECTANY CLSID_AccPropServices =\n\t{ 0xb5f8350b, 0x0548, 0x48b1, { 0xa6, 0xee, 0x88, 0xbd, 0x00, 0xb4, 0xa5, 0xe7 } };\n#endif\nconst GUID DECLSPEC_SELECTANY Name_Property_GUID =\n\t{ 0xc3a6921b, 0x4a99, 0x44f1, { 0xbc, 0xa6, 0x61, 0x18, 0x70, 0x52, 0xc4, 0x31 } };\nconst GUID DECLSPEC_SELECTANY HelpText_Property_GUID =\n\t{ 0x08555685, 0x0977, 0x45c7, { 0xa7, 0xa6, 0xab, 0xaf, 0x56, 0x84, 0x12, 0x1a } };\n\nstatic int section_control_ids[] = {\n\tIDS_DRIVE_PROPERTIES_TXT,\n\tIDS_FORMAT_OPTIONS_TXT,\n\tIDS_STATUS_TXT\n};\n\nstatic int section_vpos[ARRAYSIZE(section_control_ids)];\n\nstatic int image_option_move_ids[] = {\n\tIDS_PARTITION_TYPE_TXT,\n\tIDC_PARTITION_TYPE,\n\tIDS_TARGET_SYSTEM_TXT,\n\tIDC_TARGET_SYSTEM,\n\tIDS_CSM_HELP_TXT,\n\tIDC_ADVANCED_DEVICE_TOOLBAR,\n\tIDC_LIST_USB_HDD,\n\tIDC_OLD_BIOS_FIXES,\n\tIDC_UEFI_MEDIA_VALIDATION,\n\tIDS_FORMAT_OPTIONS_TXT,\n\tIDS_LABEL_TXT,\n\tIDC_LABEL,\n\tIDS_FILE_SYSTEM_TXT,\n\tIDC_FILE_SYSTEM,\n\tIDS_CLUSTER_SIZE_TXT,\n\tIDC_CLUSTER_SIZE,\n\tIDC_ADVANCED_FORMAT_TOOLBAR,\n\tIDC_QUICK_FORMAT,\n\tIDC_BAD_BLOCKS,\n\tIDC_NB_PASSES,\n\tIDC_EXTENDED_LABEL,\n\tIDS_STATUS_TXT,\n\tIDC_PROGRESS,\n\tIDC_ABOUT,\n\tIDC_LOG,\n\tIDC_MULTI_TOOLBAR,\n\tIDC_TEST,\n\tIDC_START,\n\tIDCANCEL,\n\tIDC_STATUS,\n\tIDC_STATUS_TOOLBAR,\n};\n\nstatic int image_option_toggle_ids[][2] = {\n\t{ IDS_IMAGE_OPTION_TXT, 0x03 },\n\t{ IDC_IMAGE_OPTION, 0x01 },\n\t{ IDC_PERSISTENCE_SLIDER, 0x02 },\n\t{ IDC_PERSISTENCE_SIZE, 0x02 },\n\t{ IDC_PERSISTENCE_UNITS, 0x02 }\n};\n\nstatic int advanced_device_move_ids[] = {\n\tIDC_LIST_USB_HDD,\n\tIDC_OLD_BIOS_FIXES,\n\tIDC_UEFI_MEDIA_VALIDATION,\n\tIDS_FORMAT_OPTIONS_TXT,\n\tIDS_LABEL_TXT,\n\tIDC_LABEL,\n\tIDS_FILE_SYSTEM_TXT,\n\tIDC_FILE_SYSTEM,\n\tIDS_CLUSTER_SIZE_TXT,\n\tIDC_CLUSTER_SIZE,\n\tIDC_ADVANCED_FORMAT_TOOLBAR,\n\tIDC_QUICK_FORMAT,\n\tIDC_BAD_BLOCKS,\n\tIDC_NB_PASSES,\n\tIDC_EXTENDED_LABEL,\n\tIDS_STATUS_TXT,\n\tIDC_PROGRESS,\n\tIDC_ABOUT,\n\tIDC_LOG,\n\tIDC_MULTI_TOOLBAR,\n\tIDC_TEST,\n\tIDC_START,\n\tIDCANCEL,\n\tIDC_STATUS,\n\tIDC_STATUS_TOOLBAR,\n};\n\nstatic int advanced_device_toggle_ids[] = {\n\tIDC_SAVE_TOOLBAR,\n\tIDC_LIST_USB_HDD,\n\tIDC_OLD_BIOS_FIXES,\n\tIDC_UEFI_MEDIA_VALIDATION,\n};\n\nstatic int advanced_format_move_ids[] = {\n\tIDS_STATUS_TXT,\n\tIDC_PROGRESS,\n\tIDC_ABOUT,\n\tIDC_LOG,\n\tIDC_MULTI_TOOLBAR,\n\tIDC_TEST,\n\tIDC_START,\n\tIDCANCEL,\n\tIDC_STATUS,\n\tIDC_STATUS_TOOLBAR,\n};\n\nstatic int advanced_format_toggle_ids[] = {\n\tIDC_QUICK_FORMAT,\n\tIDC_BAD_BLOCKS,\n\tIDC_NB_PASSES,\n\tIDC_EXTENDED_LABEL,\n};\n\nstatic int main_button_ids[] = {\n\tIDC_SELECT,\n\tIDC_START,\n\tIDCANCEL,\n};\n\nstatic int full_width_controls[] = {\n\tIDS_DEVICE_TXT,\n\tIDS_BOOT_SELECTION_TXT,\n\tIDS_IMAGE_OPTION_TXT,\n\tIDC_IMAGE_OPTION,\n\tIDS_LABEL_TXT,\n\tIDC_LABEL,\n\tIDC_ADVANCED_DRIVE_PROPERTIES,\n\tIDC_LIST_USB_HDD,\n\tIDC_OLD_BIOS_FIXES,\n\tIDC_UEFI_MEDIA_VALIDATION,\n\tIDC_ADVANCED_FORMAT_OPTIONS,\n\tIDC_QUICK_FORMAT,\n\tIDC_EXTENDED_LABEL,\n\tIDC_PROGRESS,\n};\n\nstatic int full_width_checkboxes[] = {\n\tIDC_LIST_USB_HDD,\n\tIDC_OLD_BIOS_FIXES,\n\tIDC_UEFI_MEDIA_VALIDATION,\n\tIDC_QUICK_FORMAT,\n\tIDC_EXTENDED_LABEL,\n};\n\nstatic int half_width_ids[] = {\n\tIDC_BAD_BLOCKS,\n\tIDS_PARTITION_TYPE_TXT,\n\tIDC_PARTITION_TYPE,\n\tIDC_FILE_SYSTEM,\n\tIDS_TARGET_SYSTEM_TXT,\n\tIDC_TARGET_SYSTEM,\n\tIDS_CLUSTER_SIZE_TXT,\n\tIDC_CLUSTER_SIZE,\n\tIDC_NB_PASSES,\n};\n\nstatic int adjust_dpi_ids[][5] = {\n\t{ IDS_DEVICE_TXT, IDC_DEVICE, IDC_SAVE_TOOLBAR, 0, 0 },\n\t{ IDS_BOOT_SELECTION_TXT, IDC_BOOT_SELECTION, IDC_HASH_TOOLBAR, IDC_SELECT, 0 },\n\t{ IDS_IMAGE_OPTION_TXT, IDC_IMAGE_OPTION, IDC_PERSISTENCE_SLIDER, IDC_PERSISTENCE_SIZE, IDC_PERSISTENCE_UNITS },\n\t{ IDS_PARTITION_TYPE_TXT, IDC_PARTITION_TYPE, IDS_TARGET_SYSTEM_TXT, IDC_TARGET_SYSTEM, IDS_CSM_HELP_TXT },\n\t{ IDC_ADVANCED_DEVICE_TOOLBAR, 0, 0, 0, 0 },\n\t{ IDC_LIST_USB_HDD, 0, 0, 0, 0 },\n\t{ IDC_OLD_BIOS_FIXES, 0, 0, 0, 0 },\n\t{ IDC_UEFI_MEDIA_VALIDATION, 0, 0, 0, 0 },\n\t{ IDS_FORMAT_OPTIONS_TXT, 0, 0, 0, 0 },\n\t{ IDS_LABEL_TXT, IDC_LABEL, 0, 0, 0 },\n\t{ IDS_FILE_SYSTEM_TXT, IDC_FILE_SYSTEM, IDS_CLUSTER_SIZE_TXT, IDC_CLUSTER_SIZE, 0 },\n\t{ IDC_ADVANCED_FORMAT_TOOLBAR, 0, 0, 0, 0 },\n\t{ IDC_QUICK_FORMAT, 0, 0, 0, 0 },\n\t{ IDC_EXTENDED_LABEL, 0, 0, 0, 0 },\n\t{ IDC_BAD_BLOCKS, IDC_NB_PASSES, 0, 0, 0 },\n\t{ IDS_STATUS_TXT, 0, 0, 0, 0 },\n\t{ IDC_PROGRESS, 0, 0, 0, 0 },\n\t{ IDC_MULTI_TOOLBAR, IDC_TEST, IDC_START, IDCANCEL, 0 }\n};\n\nstatic int multitoolbar_icons[] = {\n\tIDI_LANG_16,\n\tIDI_INFO_16,\n\tIDI_SETTINGS_16,\n\tIDI_LOG_16\n};\n"
  },
  {
    "path": "src/vhd.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Virtual Disk Handling functions\n * Copyright © 2013-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n// MinGW includes virdisk.h in windows.h, but we we don't want that\n// because we must apply a delay-loading workaround, and that workaround\n// has to apply between the winnt.h include and the virdisk.h include.\n// So we define _INC_VIRTDISK, to prevent the virdisk.h include in\n// windows.h, and then take care of the workaround (and virtdisk.h\n// include) in vhd.h.\n#define _INC_VIRTDISK\n#include <windows.h>\n#undef _INC_VIRTDISK\n#include <windowsx.h>\n#include <stdlib.h>\n#include <io.h>\n#include <rpc.h>\n#include <time.h>\n\n#include \"rufus.h\"\n#include \"ui.h\"\n#include \"vhd.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"settings.h\"\n#include \"msapi_utf8.h\"\n\n#include \"drive.h\"\n#include \"wimlib.h\"\n#include \"registry.h\"\n#include \"bled/bled.h\"\n\nextern char* save_image_type;\nextern BOOL ignore_boot_marker, has_ffu_support;\nextern RUFUS_DRIVE rufus_drive[MAX_DRIVES];\nextern HANDLE format_thread;\nextern FILE* fd_md5sum;\nextern uint64_t total_blocks, extra_blocks, nb_blocks, last_nb_blocks;\n\nstatic char physical_path[128] = \"\";\nstatic int progress_op = OP_FILE_COPY, progress_msg = MSG_267;\nstatic HANDLE mounted_handle = INVALID_HANDLE_VALUE;\nstatic struct wimlib_progress_info_split last_split_progress;\n\ntypedef struct {\n\tconst char* ext;\n\tuint8_t type;\n} comp_assoc;\n\nstatic comp_assoc file_assoc[] = {\n\t{ \".zip\", BLED_COMPRESSION_ZIP },\n\t{ \".Z\", BLED_COMPRESSION_LZW },\n\t{ \".gz\", BLED_COMPRESSION_GZIP },\n\t{ \".lzma\", BLED_COMPRESSION_LZMA },\n\t{ \".bz2\", BLED_COMPRESSION_BZIP2 },\n\t{ \".xz\", BLED_COMPRESSION_XZ },\n\t{ \".vtsi\", BLED_COMPRESSION_VTSI },\n\t{ \".zst\", BLED_COMPRESSION_ZSTD },\n\t{ \".ffu\", BLED_COMPRESSION_MAX },\n\t{ \".vhd\", BLED_COMPRESSION_MAX + 1 },\n\t{ \".vhdx\", BLED_COMPRESSION_MAX + 2 },\n};\n\n// Look for a boot marker in the MBR area of the image\nstatic int8_t IsCompressedBootableImage(const char* path)\n{\n\tchar *ext = NULL, *physical_disk = NULL;\n\tunsigned char *buf = NULL;\n\tint i;\n\tFILE* fd = NULL;\n\tBOOL r = 0;\n\tint64_t dc = 0;\n\n\timg_report.compression_type = BLED_COMPRESSION_NONE;\n\tif (safe_strlen(path) > 4)\n\t\tfor (ext = (char*)&path[safe_strlen(path) - 1]; (*ext != '.') && (ext != path); ext--);\n\n\tfor (i = 0; i < ARRAYSIZE(file_assoc); i++) {\n\t\tif (safe_stricmp(ext, file_assoc[i].ext) == 0) {\n\t\t\timg_report.compression_type = file_assoc[i].type;\n\t\t\tbuf = malloc(MBR_SIZE);\n\t\t\tif (buf == NULL)\n\t\t\t\treturn 0;\n\t\t\tErrorStatus = 0;\n\t\t\tif (img_report.compression_type < BLED_COMPRESSION_MAX) {\n\t\t\t\tbled_init(0, uprintf, NULL, NULL, NULL, NULL, &ErrorStatus);\n\t\t\t\tdc = bled_uncompress_to_buffer(path, (char*)buf, MBR_SIZE, file_assoc[i].type);\n\t\t\t\tbled_exit();\n\t\t\t} else if (img_report.compression_type == BLED_COMPRESSION_MAX) {\n\t\t\t\t// Dism, through FfuProvider.dll, can mount a .ffu as a physicaldrive, which we\n\t\t\t\t// could then use to poke the MBR as we do for VHD... Except Microsoft did design\n\t\t\t\t// dism to FAIL AND EXIT, after mounting the ffu as a virtual drive, if it doesn't\n\t\t\t\t// find something that looks like Windows at the specified image index... which it\n\t\t\t\t// usually won't in our case. So, curse Microsoft and their incredible short-\n\t\t\t\t// sightedness (or, most likely in this case, intentional malice, by BREACHING the\n\t\t\t\t// OS contract to keep useful disk APIs for their usage, and their usage only).\n\t\t\t\t// Then again, considering that .ffu's are GPT based, the marker should always be\n\t\t\t\t// present, so just check for the FFU signature and pretend there's a marker then.\n\t\t\t\tif (has_ffu_support) {\n\t\t\t\t\tfd = fopenU(path, \"rb\");\n\t\t\t\t\tif (fd != NULL) {\n\t\t\t\t\t\timg_report.is_vhd = TRUE;\n\t\t\t\t\t\tdc = fread(buf, 1, MBR_SIZE, fd);\n\t\t\t\t\t\tfclose(fd);\n\t\t\t\t\t\t// The signature may not be constant, but since the only game in town to\n\t\t\t\t\t\t// create FFU is dism, and dism appears to use \"SignedImage \" always,.we\n\t\t\t\t\t\t// might as well use this to our advantage.\n\t\t\t\t\t\tif (strncmp(&buf[4], \"SignedImage \", 12) == 0) {\n\t\t\t\t\t\t\t// At this stage, the buffer is only used for marker validation.\n\t\t\t\t\t\t\tbuf[0x1FE] = 0x55;\n\t\t\t\t\t\t\tbuf[0x1FF] = 0xAA;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tuprintf(\"Could not open %s: %d\", path, errno);\n\t\t\t\t} else {\n\t\t\t\t\tuprintf(\"  An FFU image was selected, but this system does not have FFU support!\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tphysical_disk = VhdMountImageAndGetSize(path, &img_report.projected_size);\n\t\t\t\tif (physical_disk != NULL) {\n\t\t\t\t\timg_report.is_vhd = TRUE;\n\t\t\t\t\tfd = fopenU(physical_disk, \"rb\");\n\t\t\t\t\tif (fd != NULL) {\n\t\t\t\t\t\tdc = fread(buf, 1, MBR_SIZE, fd);\n\t\t\t\t\t\tfclose(fd);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tVhdUnmountImage();\n\t\t\t}\n\t\t\tif (dc != MBR_SIZE) {\n\t\t\t\tfree(buf);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\tif ((buf[0x1FE] == 0x55) && (buf[0x1FF] == 0xAA))\n\t\t\t\tr = 1;\n\t\t\telse if (ignore_boot_marker)\n\t\t\t\tr = 2;\n\t\t\tfree(buf);\n\t\t\treturn r;\n\t\t}\n\t}\n\n\treturn FALSE;\n}\n\n// 0: non-bootable, 1: bootable, 2: forced bootable\nint8_t IsBootableImage(const char* path)\n{\n\tHANDLE handle = INVALID_HANDLE_VALUE;\n\tLARGE_INTEGER liImageSize;\n\tDWORD size;\n\tuint64_t wim_magic = 0;\n\tLARGE_INTEGER ptr = { 0 };\n\tint8_t is_bootable_img;\n\n\tuprintf(\"Disk image analysis:\");\n\thandle = CreateFileU(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n\tif (handle == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"  Could not open image '%s'\", path);\n\t\tis_bootable_img = -1;\n\t\tgoto out;\n\t}\n\n\tis_bootable_img = IsCompressedBootableImage(path) ? 1 : 0;\n\tif (img_report.compression_type == BLED_COMPRESSION_NONE)\n\t\tis_bootable_img = AnalyzeMBR(handle, \"  Image\", FALSE) ? 1 : (ignore_boot_marker ? 2 : 0);\n\n\tif (!GetFileSizeEx(handle, &liImageSize)) {\n\t\tuprintf(\"  Could not get image size: %s\", WindowsErrorString());\n\t\tis_bootable_img = -2;\n\t\tgoto out;\n\t}\n\timg_report.image_size = (uint64_t)liImageSize.QuadPart;\n\tif (img_report.projected_size == 0)\n\t\timg_report.projected_size = img_report.image_size;\n\tsize = sizeof(wim_magic);\n\tIGNORE_RETVAL(SetFilePointerEx(handle, ptr, NULL, FILE_BEGIN));\n\timg_report.is_windows_img = ReadFile(handle, &wim_magic, size, &size, NULL) && (wim_magic == WIM_MAGIC);\n\tif (img_report.is_windows_img)\n\t\tgoto out;\n\nout:\n\tsafe_closehandle(handle);\n\treturn is_bootable_img;\n}\n\n// WIM operations progress callback\nstatic enum wimlib_progress_status WimProgressFunc(enum wimlib_progress_msg msg_type,\n\tunion wimlib_progress_info* info, void* progctx)\n{\n\tstatic BOOL init[3] = { 0 };\n\n\tif IS_ERROR(ErrorStatus)\n\t\treturn WIMLIB_PROGRESS_STATUS_ABORT;\n\n\tswitch (msg_type) {\n\tcase WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN:\n\t\tmemset(init, 0, sizeof(init));\n\t\tuprintf(\"Applying image %d (\\\"%S\\\") from '%S' to '%S'\",\n\t\t\tinfo->extract.image, info->extract.image_name,\n\t\t\tinfo->extract.wimfile_name, info->extract.target);\n\t\tbreak;\n\tcase WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE:\n\t\tif (!init[0]) {\n\t\t\tuprintf(\"Creating file structure...\");\n\t\t\tinit[0] = TRUE;\n\t\t\tuprint_progress(0, 0);\n\t\t}\n\t\tUpdateProgressWithInfoUpTo(98, progress_op, progress_msg, info->extract.current_file_count, info->extract.end_file_count * 6);\n\t\tuprint_progress(info->extract.current_file_count, info->extract.end_file_count);\n\t\tbreak;\n\tcase WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS:\n\t\tif (!init[1]) {\n\t\t\tuprintf(\"\\nExtracting file data...\");\n\t\t\tinit[1] = TRUE;\n\t\t\tuprint_progress(0, 0);\n\t\t}\n\t\tUpdateProgressWithInfoUpTo(98, progress_op, progress_msg, info->extract.total_bytes + (4 * info->extract.completed_bytes), info->extract.total_bytes * 6);\n\t\tuprint_progress(info->extract.completed_bytes, info->extract.total_bytes);\n\t\tbreak;\n\tcase WIMLIB_PROGRESS_MSG_EXTRACT_METADATA:\n\t\tif (!init[2]) {\n\t\t\tuprintf(\"\\nApplying metadata to files...\");\n\t\t\tinit[2] = TRUE;\n\t\t\tuprint_progress(0, 0);\n\t\t}\n\t\tUpdateProgressWithInfoUpTo(98, progress_op, progress_msg, info->extract.current_file_count + (5 * info->extract.end_file_count), info->extract.end_file_count * 6);\n\t\tuprint_progress(info->extract.current_file_count, info->extract.end_file_count);\n\t\tif (info->extract.current_file_count >= info->extract.end_file_count)\n\t\t\tuprintf(\"\\n\");\n\t\tbreak;\n\tcase WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART:\n\t\tlast_split_progress = info->split;\n\t\tuprintf(\"● %S\", info->split.part_name);\n\t\tbreak;\n\tcase WIMLIB_PROGRESS_MSG_SPLIT_END_PART:\n\t\tif (fd_md5sum != NULL) {\n\t\t\t// Don't bother computing the hash at write time - just do it post creation\n\t\t\tuint8_t sum[MD5_HASHSIZE];\n\t\t\tchar* filename = wchar_to_utf8(info->split.part_name);\n\t\t\tif (filename != NULL) {\n\t\t\t\tHashFile(HASH_MD5, filename, sum);\n\t\t\t\tfor (int j = 0; j < MD5_HASHSIZE; j++)\n\t\t\t\t\tfprintf(fd_md5sum, \"%02x\", sum[j]);\n\t\t\t\tfprintf(fd_md5sum, \"  ./%s\\n\", &filename[3]);\n\t\t\t\tfree(filename);\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tcase WIMLIB_PROGRESS_MSG_WRITE_STREAMS:\n\t\tuint64_t completed_bytes = last_split_progress.completed_bytes + info->write_streams.completed_compressed_bytes;\n\t\tnb_blocks = last_nb_blocks + completed_bytes / 2048;\n\t\tUpdateProgressWithInfo(OP_FILE_COPY, MSG_231, nb_blocks, total_blocks + extra_blocks);\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\treturn WIMLIB_PROGRESS_STATUS_CONTINUE;\n}\n\n// Return the WIM version of an image\nuint32_t GetWimVersion(const char* image)\n{\n\tint r;\n\tWIMStruct* wim;\n\tstruct wimlib_wim_info info;\n\n\tif (image == NULL)\n\t\treturn 0;\n\n\tr = wimlib_open_wimU(image, 0, &wim);\n\tif (r == 0) {\n\t\tr = wimlib_get_wim_info(wim, &info);\n\t\twimlib_free(wim);\n\t\tif (r == 0)\n\t\t\treturn info.wim_version;\n\t}\n\tuprintf(\"WARNING: Could not get WIM version: Error %d\", r);\n\treturn 0;\n}\n\n// Extract a file from a WIM image. Returns the allocated path of the extracted file or NULL on error.\nBOOL WimExtractFile(const char* image, int index, const char* src, const char* dst)\n{\n\tint r = 1;\n\tWIMStruct* wim;\n\tchar tmp[MAX_PATH] = \"\", *p;\n\n\tif ((image == NULL) || (src == NULL) || (dst == NULL))\n\t\tgoto out;\n\n\tassert(strrchr(src, '\\\\') != NULL);\n\tassert(strrchr(dst, '\\\\') != NULL);\n\tif (strrchr(src, '\\\\') == NULL || strrchr(dst, '\\\\') == NULL)\n\t\tgoto out;\n\tp = strrchr(dst, '\\\\');\n\t*p = '\\0';\n\n\twimlib_global_init(0);\n\twimlib_set_print_errors(true);\n\tr = wimlib_open_wimU(image, 0, &wim);\n\tif (r == 0) {\n\t\tr = wimlib_extract_pathsU(wim, index, dst, &src, 1, WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE);\n\t\twimlib_free(wim);\n\t\tstatic_strcpy(tmp, dst);\n\t\tstatic_strcat(tmp, strrchr(src, '\\\\'));\n\t\t*p = '\\\\';\n\t\tif (!MoveFileExU(tmp, dst, MOVEFILE_REPLACE_EXISTING)) {\n\t\t\tuprintf(\"  Could not rename %s to %s: %s\", tmp, dst, WindowsErrorString());\n\t\t\tr = 1;\n\t\t}\n\t}\n\twimlib_global_cleanup();\n\nout:\n\treturn (r == 0);\n}\n\n// Split an install.wim for FAT32 limits\nBOOL WimSplitFile(const char* src, const char* dst)\n{\n\tint r = 1;\n\tWIMStruct* wim;\n\n\tif ((src == NULL) || (dst == NULL))\n\t\tgoto out;\n\n\twimlib_global_init(0);\n\twimlib_set_print_errors(true);\n\tr = wimlib_open_wimU(src, 0, &wim);\n\tif (r == 0) {\n\t\twimlib_register_progress_function(wim, WimProgressFunc, NULL);\n\t\tr = wimlib_splitU(wim, dst, 4094ULL * MB, WIMLIB_WRITE_FLAG_FSYNC);\n\t\twimlib_free(wim);\n\t}\n\twimlib_global_cleanup();\n\nout:\n\treturn (r == 0);\n}\n\nBOOL WimApplyImage(const char* image, int index, const char* dst)\n{\n\tint r = 1;\n\tWIMStruct* wim;\n\n\twimlib_global_init(0);\n\twimlib_set_print_errors(true);\n\n\tuprintf(\"Opening: %s:[%d]\", image, index);\n\tr = wimlib_open_wimU(image, 0, &wim);\n\tif (r == 0) {\n\t\tprogress_op = OP_FILE_COPY;\n\t\tprogress_msg = MSG_267;\n\t\twimlib_register_progress_function(wim, WimProgressFunc, NULL);\n\t\tr = wimlib_extract_imageU(wim, index, dst, 0);\n\t\twimlib_free(wim);\n\t} else {\n\t\tuprintf(\"Failed to open '%s': Wimlib error %d\", image, r);\n\t}\n\twimlib_global_cleanup();\n\treturn (r == 0);\n}\n\n// Mount an ISO or a VHD/VHDX image and provide its size\n// Returns the physical path of the mounted image or NULL on error.\nchar* VhdMountImageAndGetSize(const char* path, uint64_t* disk_size)\n{\n\tVIRTUAL_STORAGE_TYPE vtype = { VIRTUAL_STORAGE_TYPE_DEVICE_ISO, VIRTUAL_STORAGE_TYPE_VENDOR_MICROSOFT };\n\tATTACH_VIRTUAL_DISK_PARAMETERS vparams = { 0 };\n\tGET_VIRTUAL_DISK_INFO disk_info = { 0 };\n\tDWORD r;\n\twchar_t wtmp[128];\n\tULONG size = ARRAYSIZE(wtmp);\n\twconvert(path);\n\tchar *ret = NULL, *ext = NULL;\n\n\tif (wpath == NULL)\n\t\treturn NULL;\n\n\tif ((mounted_handle != NULL) && (mounted_handle != INVALID_HANDLE_VALUE))\n\t\tVhdUnmountImage();\n\n\tif (safe_strlen(path) > 4)\n\t\tfor (ext = (char*)&path[safe_strlen(path) - 1]; (*ext != '.') && (ext != path); ext--);\n\tif (safe_stricmp(ext, \".vhdx\") == 0)\n\t\tvtype.DeviceId = VIRTUAL_STORAGE_TYPE_DEVICE_VHDX;\n\telse if (safe_stricmp(ext, \".vhd\") == 0)\n\t\tvtype.DeviceId = VIRTUAL_STORAGE_TYPE_DEVICE_VHD;\n\n\tr = OpenVirtualDisk(&vtype, wpath, VIRTUAL_DISK_ACCESS_READ | VIRTUAL_DISK_ACCESS_GET_INFO,\n\t\tOPEN_VIRTUAL_DISK_FLAG_NONE, NULL, &mounted_handle);\n\tif (r != ERROR_SUCCESS) {\n\t\tSetLastError(r);\n\t\tuprintf(\"Could not open image '%s': %s\", path, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tvparams.Version = ATTACH_VIRTUAL_DISK_VERSION_1;\n\tr = AttachVirtualDisk(mounted_handle, NULL, ATTACH_VIRTUAL_DISK_FLAG_READ_ONLY |\n\t\tATTACH_VIRTUAL_DISK_FLAG_NO_DRIVE_LETTER, 0, &vparams, NULL);\n\tif (r != ERROR_SUCCESS) {\n\t\tSetLastError(r);\n\t\tuprintf(\"Could not mount image '%s': %s\", path, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tr = GetVirtualDiskPhysicalPath(mounted_handle, &size, wtmp);\n\tif (r != ERROR_SUCCESS) {\n\t\tSetLastError(r);\n\t\tuprintf(\"Could not obtain physical path for mounted image '%s': %s\", path, WindowsErrorString());\n\t\tgoto out;\n\t}\n\twchar_to_utf8_no_alloc(wtmp, physical_path, sizeof(physical_path));\n\n\tif (disk_size != NULL) {\n\t\t*disk_size = 0;\n\t\tdisk_info.Version = GET_VIRTUAL_DISK_INFO_SIZE;\n\t\tsize = sizeof(disk_info);\n\t\tr = GetVirtualDiskInformation(mounted_handle, &size, &disk_info, NULL);\n\t\tif (r != ERROR_SUCCESS) {\n\t\t\tSetLastError(r);\n\t\t\tuprintf(\"Could not obtain virtual size of mounted image '%s': %s\", path, WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\t*disk_size = disk_info.Size.VirtualSize;\n\t}\n\n\tret = physical_path;\n\nout:\n\tif (ret == NULL)\n\t\tVhdUnmountImage();\n\twfree(path);\n\treturn ret;\n}\n\nvoid VhdUnmountImage(void)\n{\n\tif ((mounted_handle == NULL) || (mounted_handle == INVALID_HANDLE_VALUE))\n\t\tgoto out;\n\n\tDetachVirtualDisk(mounted_handle, DETACH_VIRTUAL_DISK_FLAG_NONE, 0);\n\tsafe_closehandle(mounted_handle);\nout:\n\tphysical_path[0] = 0;\n}\n\n// Since we no longer have to deal with Windows 7, we can call on CreateVirtualDisk()\n// to backup a physical disk to VHD/VHDX. Now if this could also be used to create an\n// ISO from optical media that would be swell, but no matter what I tried, it didn't\n// seem possible...\nstatic DWORD WINAPI VhdSaveImageThread(void* param)\n{\n\tIMG_SAVE* img_save = (IMG_SAVE*)param;\n\tHANDLE handle = INVALID_HANDLE_VALUE;\n\tWCHAR* wSrc = utf8_to_wchar(img_save->DevicePath);\n\tWCHAR* wDst = utf8_to_wchar(img_save->ImagePath);\n\tVIRTUAL_STORAGE_TYPE vtype = { img_save->Type, VIRTUAL_STORAGE_TYPE_VENDOR_MICROSOFT };\n\tSTOPGAP_CREATE_VIRTUAL_DISK_PARAMETERS vparams = { 0 };\n\tVIRTUAL_DISK_PROGRESS vprogress = { 0 };\n\tOVERLAPPED overlapped = { 0 };\n\tDWORD r = ERROR_NOT_FOUND, flags, bytes_read = 0;\n\n\tif_assert_fails(img_save->Type == VIRTUAL_STORAGE_TYPE_DEVICE_VHD ||\n\t\timg_save->Type == VIRTUAL_STORAGE_TYPE_DEVICE_VHDX)\n\t\treturn ERROR_INVALID_PARAMETER;\n\n\tUpdateProgressWithInfoInit(NULL, FALSE);\n\n\tvparams.Version = CREATE_VIRTUAL_DISK_VERSION_2;\n\tvparams.Version2.UniqueId = GUID_NULL;\n\tvparams.Version2.BlockSizeInBytes = CREATE_VIRTUAL_DISK_PARAMETERS_DEFAULT_BLOCK_SIZE;\n\tvparams.Version2.SectorSizeInBytes = CREATE_VIRTUAL_DISK_PARAMETERS_DEFAULT_SECTOR_SIZE;\n\tvparams.Version2.PhysicalSectorSizeInBytes = SelectedDrive.SectorSize;\n\tvparams.Version2.SourcePath = wSrc;\n\n\t// When CREATE_VIRTUAL_DISK_FLAG_CREATE_BACKING_STORAGE is specified with\n\t// a source path, CreateVirtualDisk() automatically clones the source to\n\t// the virtual disk.\n\tflags = CREATE_VIRTUAL_DISK_FLAG_CREATE_BACKING_STORAGE;\n\t// The following ensures that VHD images are stored uncompressed and can\n\t// be used as DD images.\n\tif (img_save->Type == VIRTUAL_STORAGE_TYPE_DEVICE_VHD)\n\t\tflags |= CREATE_VIRTUAL_DISK_FLAG_FULL_PHYSICAL_ALLOCATION;\n\t// TODO: Use CREATE_VIRTUAL_DISK_FLAG_PREVENT_WRITES_TO_SOURCE_DISK?\n\n\toverlapped.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);\n\n\t// CreateVirtualDisk() does not have an overwrite flag...\n\tDeleteFileW(wDst);\n\n\tr = CreateVirtualDisk(&vtype, wDst, VIRTUAL_DISK_ACCESS_NONE, NULL,\n\t\tflags, 0, (PCREATE_VIRTUAL_DISK_PARAMETERS)&vparams, &overlapped, &handle);\n\tif (r != ERROR_SUCCESS && r != ERROR_IO_PENDING) {\n\t\tSetLastError(r);\n\t\tuprintf(\"Could not create virtual disk: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tif (r == ERROR_IO_PENDING) {\n\t\twhile ((r = WaitForSingleObject(overlapped.hEvent, 100)) == WAIT_TIMEOUT) {\n\t\t\tif (IS_ERROR(ErrorStatus) && (SCODE_CODE(ErrorStatus) == ERROR_CANCELLED)) {\n\t\t\t\tCancelIoEx(handle, &overlapped);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tif (GetVirtualDiskOperationProgress(handle, &overlapped, &vprogress) == ERROR_SUCCESS) {\n\t\t\t\tif (vprogress.OperationStatus == ERROR_IO_PENDING)\n\t\t\t\t\tUpdateProgressWithInfo(OP_FORMAT, MSG_261, vprogress.CurrentValue, vprogress.CompletionValue);\n\t\t\t}\n\t\t}\n\t\tif (r != WAIT_OBJECT_0) {\n\t\t\tuprintf(\"Could not save virtual disk: %s\", WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\tif (!GetOverlappedResult(handle, &overlapped, &bytes_read, FALSE)) {\n\t\tr = GetLastError();\n\t\tuprintf(\"Could not save virtual disk: %s\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\tr = 0;\n\tUpdateProgressWithInfo(OP_FORMAT, MSG_261, SelectedDrive.DiskSize, SelectedDrive.DiskSize);\n\tuprintf(\"Saved '%s'\", img_save->ImagePath);\n\nout:\n\tsafe_closehandle(overlapped.hEvent);\n\tsafe_closehandle(handle);\n\tsafe_free(wSrc);\n\tsafe_free(wDst);\n\tsafe_free(img_save->DevicePath);\n\tsafe_free(img_save->ImagePath);\n\tPostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)TRUE, 0);\n\tif (r != 0 && !IS_ERROR(ErrorStatus))\n\t\tErrorStatus = RUFUS_ERROR(SCODE_CODE(r));\n\tExitThread(r);\n}\n\n// FfuProvider.dll has some nice FfuApplyImage()/FfuCaptureImage() calls... which\n// Microsoft decided not make public!\n// Considering that trying to both figure out how to use these internal function\n// calls, as well as how to properly hook into the DLL for every arch/every release\n// of Windows, would be a massive timesink, we just take a shortcut by calling dism\n// directly, as imperfect as such a solution might be...\nstatic DWORD WINAPI FfuSaveImageThread(void* param)\n{\n\tDWORD r;\n\tIMG_SAVE* img_save = (IMG_SAVE*)param;\n\tchar cmd[2 * KB], letters[27], *label;\n\n\tGetDriveLabel(SelectedDrive.DeviceNumber, letters, &label, TRUE);\n\tstatic_sprintf(cmd, \"%s\\\\dism.exe /Capture-Ffu /CaptureDrive:%s /ImageFile:\\\"%s\\\" \"\n\t\t\"/Name:\\\"%s\\\" /Description:\\\"Created by %s (%s)\\\"\", sysnative_dir,\n\t\timg_save->DevicePath, img_save->ImagePath, label, APPLICATION_NAME, RUFUS_URL);\n\tuprintf(\"Running command: '%s'\", cmd);\n\t// For detecting typical dism.exe commandline progress report of type:\n\t// \"\\r[====                       8.0%                           ]\"\n\tr = RunCommandWithProgress(cmd, sysnative_dir, TRUE, MSG_261, \".*\\r\\\\[[= ]+([0-9\\\\.]+)%[= ]+\\\\].*\");\n\tif (r != 0 && !IS_ERROR(ErrorStatus)) {\n\t\tSetLastError(r);\n\t\tuprintf(\"Failed to capture FFU image: %s\", WindowsErrorString());\n\t\tErrorStatus = RUFUS_ERROR(SCODE_CODE(r));\n\t}\n\tPostMessage(hMainDialog, UM_FORMAT_COMPLETED, (WPARAM)TRUE, 0);\n\tif (!IS_ERROR(ErrorStatus))\n\t\tuprintf(\"Saved '%s'\", img_save->ImagePath);\n\tsafe_free(img_save->DevicePath);\n\tsafe_free(img_save->ImagePath);\n\tExitThread(r);\n}\n\nBOOL SaveImage(void)\n{\n\tUINT i;\n\tstatic IMG_SAVE img_save;\n\tchar filename[128], letters[27], path[MAX_PATH];\n\tint DriveIndex = ComboBox_GetCurSel(hDeviceList);\n\tenum { image_type_none = 0, image_type_vhd, image_type_vhdx, image_type_ffu, image_type_iso };\n\tstatic EXT_DECL(img_ext, filename, __VA_GROUP__(\"*.vhd\", \"*.vhdx\", \"*.ffu\", \"*.iso\"),\n\t\t__VA_GROUP__(lmprintf(MSG_343), lmprintf(MSG_342), lmprintf(MSG_344), lmprintf(MSG_036)));\n\tint i_to_type[5] = { image_type_none, image_type_vhd, image_type_vhdx, image_type_ffu, image_type_iso };\n\tULARGE_INTEGER free_space;\n\n\tmemset(&img_save, 0, sizeof(IMG_SAVE));\n\t// Should have been validated prior to calling SaveImage()\n\tif_assert_fails((DriveIndex >= 0) && (format_thread == NULL))\n\t\treturn FALSE;\n\n\tstatic_sprintf(filename, \"%s\", rufus_drive[DriveIndex].label);\n\timg_save.DeviceNum = (DWORD)ComboBox_GetItemData(hDeviceList, DriveIndex);\n\timg_save.DevicePath = GetPhysicalName(img_save.DeviceNum);\n\timg_ext.count = 2;\n\t// FFU support requires GPT\n\tif (has_ffu_support && SelectedDrive.PartitionStyle == PARTITION_STYLE_GPT) {\n\t\timg_ext.count += 1;\n\t} else {\n\t\t// Move the ISO extension one place down\n\t\timg_ext.extension[image_type_ffu - 1] = img_ext.extension[image_type_iso - 1];\n\t\timg_ext.description[image_type_ffu - 1] = img_ext.description[image_type_iso - 1];\n\t\ti_to_type[image_type_ffu] = image_type_iso;\n\t\ti_to_type[image_type_iso] = image_type_none;\n\t}\n\t// ISO support requires a mounted file system\n\tif (GetDriveLetters(SelectedDrive.DeviceNumber, letters) && letters[0] != '\\0')\n\t\timg_ext.count += 1;\n\tfor (i = 1; i <= (UINT)img_ext.count && (safe_strcmp(save_image_type, &img_ext.extension[i - 1][2]) != '\\0'); i++);\n\tif (i > (UINT)img_ext.count)\n\t\ti = image_type_vhdx;\n\timg_save.ImagePath = FileDialog(TRUE, NULL, &img_ext, &i);\n\tif (img_save.ImagePath == NULL) {\n\t\tErrorStatus = RUFUS_ERROR(ERROR_CANCELLED);\n\t\tgoto out;\n\t}\n\t// Start from the end of our extension array, since '.vhd' would match for '.vhdx' otherwise\n\tfor (i = (UINT)img_ext.count; (i > 0) && (strstr(img_save.ImagePath, &img_ext.extension[i - 1][1]) == NULL); i--);\n\tif (i == 0) {\n\t\tuprintf(\"WARNING: Can not determine image type from extension - Saving to uncompressed VHD.\");\n\t\ti = image_type_vhd;\n\t} else {\n\t\tsave_image_type = (char*)&img_ext.extension[i - 1][2];\n\t\tWriteSettingStr(SETTING_PREFERRED_SAVE_IMAGE_TYPE, save_image_type);\n\t}\n\tassert(i < ARRAYSIZE(i_to_type));\n\tswitch (i_to_type[i]) {\n\tcase image_type_vhd:\n\t\timg_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_VHD;\n\t\tbreak;\n\tcase image_type_ffu:\n\t\timg_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_FFU;\n\t\tbreak;\n\tcase image_type_iso:\n\t\t// ISO requires oscdimg.exe. If not already present, attempt to download it.\n\t\tstatic_sprintf(path, \"%s\\\\%s\\\\oscdimg_%s.exe\", app_data_dir, FILES_DIR, APPLICATION_ARCH);\n\t\tif (!PathFileExistsU(path)) {\n\t\t\tif (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_115), lmprintf(MSG_337, \"oscdimg.exe\")) != IDYES) {\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_CANCELLED);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tIGNORE_RETVAL(_chdirU(app_data_dir));\n\t\t\tIGNORE_RETVAL(_mkdir(FILES_DIR));\n\t\t\tif (DownloadToFileOrBufferEx(OSCDIMG_URL, path, SYMBOL_SERVER_USER_AGENT, NULL, hMainDialog, FALSE) < 64 * KB) {\n\t\t\t\tErrorStatus = GetLastError();\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\t\timg_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_ISO;\n\t\tbreak;\n\tdefault:\n\t\timg_save.Type = VIRTUAL_STORAGE_TYPE_DEVICE_VHDX;\n\t\tbreak;\n\t}\n\timg_save.BufSize = DD_BUFFER_SIZE;\n\timg_save.DeviceSize = SelectedDrive.DiskSize;\n\tif (img_save.DevicePath != NULL && img_save.ImagePath != NULL) {\n\t\t// Reset all progress bars\n\t\tSendMessage(hMainDialog, UM_PROGRESS_INIT, 0, 0);\n\t\tErrorStatus = 0;\n\t\tif (img_save.Type == VIRTUAL_STORAGE_TYPE_DEVICE_VHD) {\n\t\t\tfree_space.QuadPart = 0;\n\t\t\tif ((GetVolumePathNameA(img_save.ImagePath, path, sizeof(path)))\n\t\t\t\t&& (GetDiskFreeSpaceExA(path, &free_space, NULL, NULL))\n\t\t\t\t&& ((LONGLONG)free_space.QuadPart < (SelectedDrive.DiskSize + 512))) {\n\t\t\t\tuprintf(\"The VHD size is too large for the target drive\");\n\t\t\t\tErrorStatus = RUFUS_ERROR(ERROR_FILE_TOO_LARGE);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t}\n\t\t// Disable all controls except Cancel\n\t\tEnableControls(FALSE, FALSE);\n\t\tErrorStatus = 0;\n\t\tInitProgress(TRUE);\n\t\tformat_thread = CreateThread(NULL, 0, img_save.Type == VIRTUAL_STORAGE_TYPE_DEVICE_FFU ?\n\t\t\tFfuSaveImageThread : (img_save.Type == VIRTUAL_STORAGE_TYPE_DEVICE_ISO ? IsoSaveImageThread : VhdSaveImageThread),\n\t\t\t&img_save, 0, NULL);\n\t\tif (format_thread != NULL) {\n\t\t\tuprintf(\"\\r\\nSave to image operation started\");\n\t\t\tPrintInfo(0, -1);\n\t\t\tSendMessage(hMainDialog, UM_TIMER_START, 0, 0);\n\t\t}\n\t}\nout:\n\tif (format_thread == NULL) {\n\t\tsafe_free(img_save.DevicePath);\n\t\tsafe_free(img_save.ImagePath);\n\t}\n\treturn (format_thread != NULL);\n}\n"
  },
  {
    "path": "src/vhd.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Virtual Disk Handling definitions and prototypes\n * Copyright © 2022-2025 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <stdint.h>\n#include <windows.h>\n#include <virtdisk.h>\n\n#pragma once\n\n// Someone's going to have to explain to me why trying to define ANY static inline function\n// calls in wimlib.h in DEBUG produces \"C2143: syntax error: missing ';' before '{'\"  with\n// MSVC, UNLESS we add the following 2 include statements here (in no particular order).\n// WHAT. THE. ACTUAL. FUCK?!?!?!\n#if defined(_MSC_VER) && defined(_DEBUG)\n#include \"msapi_utf8.h\"\n#include \"wimlib.h\"\n#endif\n\n#define WIM_MAGIC\t\t\t\t\t\t\t0x0000004D4957534DULL\t// \"MSWIM\\0\\0\\0\"\n\n#define MBR_SIZE\t\t\t\t\t\t\t512\t// Might need to review this once we see bootable 4k systems\n\n#define VIRTUAL_STORAGE_TYPE_DEVICE_FFU                    99\n#define CREATE_VIRTUAL_DISK_VERSION_2                       2\n#define CREATE_VIRTUAL_DISK_FLAG_CREATE_BACKING_STORAGE     8\n\n#ifndef CREATE_VIRTUAL_DISK_PARAMETERS_DEFAULT_BLOCK_SIZE\n#define CREATE_VIRTUAL_DISK_PARAMETERS_DEFAULT_BLOCK_SIZE   0\n#endif\n\n#ifndef CREATE_VIRTUAL_DISK_PARAMETERS_DEFAULT_SECTOR_SIZE\n#define CREATE_VIRTUAL_DISK_PARAMETERS_DEFAULT_SECTOR_SIZE  0\n#endif\n\ntypedef struct\n{\n\tCREATE_VIRTUAL_DISK_VERSION Version;\n\tunion\n\t{\n\t\tstruct\n\t\t{\n\t\t\tGUID                  UniqueId;\n\t\t\tULONGLONG             MaximumSize;\n\t\t\tULONG                 BlockSizeInBytes;\n\t\t\tULONG                 SectorSizeInBytes;\n\t\t\tPCWSTR                ParentPath;\n\t\t\tPCWSTR                SourcePath;\n\t\t} Version1;\n\t\tstruct\n\t\t{\n\t\t\tGUID                   UniqueId;\n\t\t\tULONGLONG              MaximumSize;\n\t\t\tULONG                  BlockSizeInBytes;\n\t\t\tULONG                  SectorSizeInBytes;\n\t\t\tULONG                  PhysicalSectorSizeInBytes;\n\t\t\tPCWSTR                 ParentPath;\n\t\t\tPCWSTR                 SourcePath;\n\t\t\tOPEN_VIRTUAL_DISK_FLAG OpenFlags;\n\t\t\tVIRTUAL_STORAGE_TYPE   ParentVirtualStorageType;\n\t\t\tVIRTUAL_STORAGE_TYPE   SourceVirtualStorageType;\n\t\t\tGUID                   ResiliencyGuid;\n\t\t} Version2;\n\t};\n} STOPGAP_CREATE_VIRTUAL_DISK_PARAMETERS;\n\n// From https://docs.microsoft.com/en-us/previous-versions/msdn10/dd834960(v=msdn.10)\n// as well as https://msfn.org/board/topic/150700-wimgapi-wimmountimage-progressbar/\nenum WIMMessage {\n\tWIM_MSG = WM_APP + 0x1476,\n\tWIM_MSG_TEXT,\n\tWIM_MSG_PROGRESS,\t// Indicates an update in the progress of an image application.\n\tWIM_MSG_PROCESS,\t// Enables the caller to prevent a file or a directory from being captured or applied.\n\tWIM_MSG_SCANNING,\t// Indicates that volume information is being gathered during an image capture.\n\tWIM_MSG_SETRANGE,\t// Indicates the number of files that will be captured or applied.\n\tWIM_MSG_SETPOS,\t\t// Indicates the number of files that have been captured or applied.\n\tWIM_MSG_STEPIT,\t\t// Indicates that a file has been either captured or applied.\n\tWIM_MSG_COMPRESS,\t// Enables the caller to prevent a file resource from being compressed during a capture.\n\tWIM_MSG_ERROR,\t\t// Alerts the caller that an error has occurred while capturing or applying an image.\n\tWIM_MSG_ALIGNMENT,\t// Enables the caller to align a file resource on a particular alignment boundary.\n\tWIM_MSG_RETRY,\t\t// Sent when the file is being reapplied because of a network timeout.\n\tWIM_MSG_SPLIT,\t\t// Enables the caller to align a file resource on a particular alignment boundary.\n\tWIM_MSG_FILEINFO,\t// Used in conjunction with WimApplyImages()'s WIM_FLAG_FILEINFO flag to provide detailed file info.\n\tWIM_MSG_INFO,\t\t// Sent when an info message is available.\n\tWIM_MSG_WARNING,\t// Sent when a warning message is available.\n\tWIM_MSG_CHK_PROCESS,\n\tWIM_MSG_SUCCESS = 0,\n\tWIM_MSG_ABORT_IMAGE = -1\n};\n\nextern uint32_t GetWimVersion(const char* image);\nextern BOOL WimExtractFile(const char* wim_image, int index, const char* src, const char* dst);\nextern BOOL WimApplyImage(const char* image, int index, const char* dst);\nextern BOOL WimSplitFile(const char* src, const char* dst);\nextern int8_t IsBootableImage(const char* path);\nextern char* VhdMountImageAndGetSize(const char* path, uint64_t* disksize);\n#define VhdMountImage(path) VhdMountImageAndGetSize(path, NULL)\nextern void VhdUnmountImage(void);\nextern BOOL SaveImage(void);\nextern void OpticalDiscSaveImage(void);\nextern DWORD WINAPI IsoSaveImageThread(void* param);\n"
  },
  {
    "path": "src/wimlib/Makefile.am",
    "content": "noinst_LIBRARIES = libwim.a\nlibwim_a_SOURCES = avl_tree.c blob_table.c compress.c compress_common.c compress_parallel.c \\\n\tcompress_serial.c cpu_features.c decompress.c decompress_common.c dentry.c divsufsort.c \\\n\tencoding.c error.c export_image.c extract.c file_io.c header.c inode.c inode_fixup.c \\\n\tinode_table.c integrity.c iterate_dir.c lcpit_matchfinder.c lzms_common.c lzms_compress.c \\\n\tlzms_decompress.c lzx_common.c lzx_compress.c lzx_decompress.c metadata_resource.c \\\n\tpathlist.c paths.c pattern.c progress.c registry.c reparse.c resource.c scan.c security.c \\\n\tsha1.c solid.c split.c tagged_items.c textfile.c threads.c timestamp.c update_image.c \\\n\tutil.c wim.c wimboot.c win32_apply.c win32_capture.c win32_common.c win32_replacements.c \\\n\twin32_vss.c write.c xml.c xmlproc.c xml_windows.c xpress_compress.c xpress_decompress.c\nlibwim_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -I$(srcdir)/../libcdio -DHAVE_CONFIG_H -D_RUFUS -D__SSE2__ -D_POSIX -D_POSIX_THREAD_SAFE_FUNCTIONS -DUNICODE -D_UNICODE -D__MINGW_USE_VC2005_COMPAT -Wno-undef -Wno-strict-aliasing -Wno-shadow -Wno-incompatible-pointer-types -Wno-sequence-point\n"
  },
  {
    "path": "src/wimlib/Makefile.in",
    "content": "# Makefile.in generated by automake 1.14.1 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2013 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nsubdir = src/wimlib\nDIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLIBRARIES = $(noinst_LIBRARIES)\nARFLAGS = cru\nAM_V_AR = $(am__v_AR_@AM_V@)\nam__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)\nam__v_AR_0 = @echo \"  AR      \" $@;\nam__v_AR_1 = \nlibwim_a_AR = $(AR) $(ARFLAGS)\nlibwim_a_LIBADD =\nam_libwim_a_OBJECTS = libwim_a-avl_tree.$(OBJEXT) \\\n\tlibwim_a-blob_table.$(OBJEXT) libwim_a-compress.$(OBJEXT) \\\n\tlibwim_a-compress_common.$(OBJEXT) \\\n\tlibwim_a-compress_parallel.$(OBJEXT) \\\n\tlibwim_a-compress_serial.$(OBJEXT) \\\n\tlibwim_a-cpu_features.$(OBJEXT) libwim_a-decompress.$(OBJEXT) \\\n\tlibwim_a-decompress_common.$(OBJEXT) libwim_a-dentry.$(OBJEXT) \\\n\tlibwim_a-divsufsort.$(OBJEXT) libwim_a-encoding.$(OBJEXT) \\\n\tlibwim_a-error.$(OBJEXT) libwim_a-export_image.$(OBJEXT) \\\n\tlibwim_a-extract.$(OBJEXT) libwim_a-file_io.$(OBJEXT) \\\n\tlibwim_a-header.$(OBJEXT) libwim_a-inode.$(OBJEXT) \\\n\tlibwim_a-inode_fixup.$(OBJEXT) libwim_a-inode_table.$(OBJEXT) \\\n\tlibwim_a-integrity.$(OBJEXT) libwim_a-iterate_dir.$(OBJEXT) \\\n\tlibwim_a-lcpit_matchfinder.$(OBJEXT) \\\n\tlibwim_a-lzms_common.$(OBJEXT) \\\n\tlibwim_a-lzms_compress.$(OBJEXT) \\\n\tlibwim_a-lzms_decompress.$(OBJEXT) \\\n\tlibwim_a-lzx_common.$(OBJEXT) libwim_a-lzx_compress.$(OBJEXT) \\\n\tlibwim_a-lzx_decompress.$(OBJEXT) \\\n\tlibwim_a-metadata_resource.$(OBJEXT) \\\n\tlibwim_a-pathlist.$(OBJEXT) libwim_a-paths.$(OBJEXT) \\\n\tlibwim_a-pattern.$(OBJEXT) libwim_a-progress.$(OBJEXT) \\\n\tlibwim_a-registry.$(OBJEXT) libwim_a-reparse.$(OBJEXT) \\\n\tlibwim_a-resource.$(OBJEXT) libwim_a-scan.$(OBJEXT) \\\n\tlibwim_a-security.$(OBJEXT) libwim_a-sha1.$(OBJEXT) \\\n\tlibwim_a-solid.$(OBJEXT) libwim_a-split.$(OBJEXT) \\\n\tlibwim_a-tagged_items.$(OBJEXT) libwim_a-textfile.$(OBJEXT) \\\n\tlibwim_a-threads.$(OBJEXT) libwim_a-timestamp.$(OBJEXT) \\\n\tlibwim_a-update_image.$(OBJEXT) libwim_a-util.$(OBJEXT) \\\n\tlibwim_a-wim.$(OBJEXT) libwim_a-wimboot.$(OBJEXT) \\\n\tlibwim_a-win32_apply.$(OBJEXT) \\\n\tlibwim_a-win32_capture.$(OBJEXT) \\\n\tlibwim_a-win32_common.$(OBJEXT) \\\n\tlibwim_a-win32_replacements.$(OBJEXT) \\\n\tlibwim_a-win32_vss.$(OBJEXT) libwim_a-write.$(OBJEXT) \\\n\tlibwim_a-xml.$(OBJEXT) libwim_a-xmlproc.$(OBJEXT) \\\n\tlibwim_a-xml_windows.$(OBJEXT) \\\n\tlibwim_a-xpress_compress.$(OBJEXT) \\\n\tlibwim_a-xpress_decompress.$(OBJEXT)\nlibwim_a_OBJECTS = $(am_libwim_a_OBJECTS)\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp =\nam__depfiles_maybe =\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libwim_a_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAM_LDFLAGS = @AM_LDFLAGS@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nCC = @CC@\nCFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDLLTOOL = @DLLTOOL@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEXEEXT = @EXEEXT@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMKDIR_P = @MKDIR_P@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nRANLIB = @RANLIB@\nRM = @RM@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSTRIP = @STRIP@\nSUFFIX = @SUFFIX@\nVERSION = @VERSION@\nVISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@\nWINDRES = @WINDRES@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_CC = @ac_ct_CC@\nam__leading_dot = @am__leading_dot@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild_alias = @build_alias@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost_alias = @host_alias@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nrunstatedir = @runstatedir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LIBRARIES = libwim.a\nlibwim_a_SOURCES = avl_tree.c blob_table.c compress.c compress_common.c compress_parallel.c \\\n\tcompress_serial.c cpu_features.c decompress.c decompress_common.c dentry.c divsufsort.c \\\n\tencoding.c error.c export_image.c extract.c file_io.c header.c inode.c inode_fixup.c \\\n\tinode_table.c integrity.c iterate_dir.c lcpit_matchfinder.c lzms_common.c lzms_compress.c \\\n\tlzms_decompress.c lzx_common.c lzx_compress.c lzx_decompress.c metadata_resource.c \\\n\tpathlist.c paths.c pattern.c progress.c registry.c reparse.c resource.c scan.c security.c \\\n\tsha1.c solid.c split.c tagged_items.c textfile.c threads.c timestamp.c update_image.c \\\n\tutil.c wim.c wimboot.c win32_apply.c win32_capture.c win32_common.c win32_replacements.c \\\n\twin32_vss.c write.c xml.c xmlproc.c xml_windows.c xpress_compress.c xpress_decompress.c\n\nlibwim_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -I$(srcdir)/../libcdio -DHAVE_CONFIG_H -D_RUFUS -D__SSE2__ -D_POSIX -D_POSIX_THREAD_SAFE_FUNCTIONS -DUNICODE -D_UNICODE -D__MINGW_USE_VC2005_COMPAT -Wno-undef -Wno-strict-aliasing -Wno-shadow -Wno-incompatible-pointer-types -Wno-sequence-point\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps src/wimlib/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign --ignore-deps src/wimlib/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLIBRARIES:\n\t-test -z \"$(noinst_LIBRARIES)\" || rm -f $(noinst_LIBRARIES)\n\nlibwim.a: $(libwim_a_OBJECTS) $(libwim_a_DEPENDENCIES) $(EXTRA_libwim_a_DEPENDENCIES) \n\t$(AM_V_at)-rm -f libwim.a\n\t$(AM_V_AR)$(libwim_a_AR) libwim.a $(libwim_a_OBJECTS) $(libwim_a_LIBADD)\n\t$(AM_V_at)$(RANLIB) libwim.a\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n.c.o:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n\t$(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\nlibwim_a-avl_tree.o: avl_tree.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-avl_tree.o `test -f 'avl_tree.c' || echo '$(srcdir)/'`avl_tree.c\n\nlibwim_a-avl_tree.obj: avl_tree.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-avl_tree.obj `if test -f 'avl_tree.c'; then $(CYGPATH_W) 'avl_tree.c'; else $(CYGPATH_W) '$(srcdir)/avl_tree.c'; fi`\n\nlibwim_a-blob_table.o: blob_table.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-blob_table.o `test -f 'blob_table.c' || echo '$(srcdir)/'`blob_table.c\n\nlibwim_a-blob_table.obj: blob_table.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-blob_table.obj `if test -f 'blob_table.c'; then $(CYGPATH_W) 'blob_table.c'; else $(CYGPATH_W) '$(srcdir)/blob_table.c'; fi`\n\nlibwim_a-compress.o: compress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress.o `test -f 'compress.c' || echo '$(srcdir)/'`compress.c\n\nlibwim_a-compress.obj: compress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress.obj `if test -f 'compress.c'; then $(CYGPATH_W) 'compress.c'; else $(CYGPATH_W) '$(srcdir)/compress.c'; fi`\n\nlibwim_a-compress_common.o: compress_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_common.o `test -f 'compress_common.c' || echo '$(srcdir)/'`compress_common.c\n\nlibwim_a-compress_common.obj: compress_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_common.obj `if test -f 'compress_common.c'; then $(CYGPATH_W) 'compress_common.c'; else $(CYGPATH_W) '$(srcdir)/compress_common.c'; fi`\n\nlibwim_a-compress_parallel.o: compress_parallel.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_parallel.o `test -f 'compress_parallel.c' || echo '$(srcdir)/'`compress_parallel.c\n\nlibwim_a-compress_parallel.obj: compress_parallel.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_parallel.obj `if test -f 'compress_parallel.c'; then $(CYGPATH_W) 'compress_parallel.c'; else $(CYGPATH_W) '$(srcdir)/compress_parallel.c'; fi`\n\nlibwim_a-compress_serial.o: compress_serial.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_serial.o `test -f 'compress_serial.c' || echo '$(srcdir)/'`compress_serial.c\n\nlibwim_a-compress_serial.obj: compress_serial.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-compress_serial.obj `if test -f 'compress_serial.c'; then $(CYGPATH_W) 'compress_serial.c'; else $(CYGPATH_W) '$(srcdir)/compress_serial.c'; fi`\n\nlibwim_a-cpu_features.o: cpu_features.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-cpu_features.o `test -f 'cpu_features.c' || echo '$(srcdir)/'`cpu_features.c\n\nlibwim_a-cpu_features.obj: cpu_features.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-cpu_features.obj `if test -f 'cpu_features.c'; then $(CYGPATH_W) 'cpu_features.c'; else $(CYGPATH_W) '$(srcdir)/cpu_features.c'; fi`\n\nlibwim_a-decompress.o: decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-decompress.o `test -f 'decompress.c' || echo '$(srcdir)/'`decompress.c\n\nlibwim_a-decompress.obj: decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-decompress.obj `if test -f 'decompress.c'; then $(CYGPATH_W) 'decompress.c'; else $(CYGPATH_W) '$(srcdir)/decompress.c'; fi`\n\nlibwim_a-decompress_common.o: decompress_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-decompress_common.o `test -f 'decompress_common.c' || echo '$(srcdir)/'`decompress_common.c\n\nlibwim_a-decompress_common.obj: decompress_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-decompress_common.obj `if test -f 'decompress_common.c'; then $(CYGPATH_W) 'decompress_common.c'; else $(CYGPATH_W) '$(srcdir)/decompress_common.c'; fi`\n\nlibwim_a-dentry.o: dentry.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-dentry.o `test -f 'dentry.c' || echo '$(srcdir)/'`dentry.c\n\nlibwim_a-dentry.obj: dentry.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-dentry.obj `if test -f 'dentry.c'; then $(CYGPATH_W) 'dentry.c'; else $(CYGPATH_W) '$(srcdir)/dentry.c'; fi`\n\nlibwim_a-divsufsort.o: divsufsort.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-divsufsort.o `test -f 'divsufsort.c' || echo '$(srcdir)/'`divsufsort.c\n\nlibwim_a-divsufsort.obj: divsufsort.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-divsufsort.obj `if test -f 'divsufsort.c'; then $(CYGPATH_W) 'divsufsort.c'; else $(CYGPATH_W) '$(srcdir)/divsufsort.c'; fi`\n\nlibwim_a-encoding.o: encoding.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-encoding.o `test -f 'encoding.c' || echo '$(srcdir)/'`encoding.c\n\nlibwim_a-encoding.obj: encoding.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-encoding.obj `if test -f 'encoding.c'; then $(CYGPATH_W) 'encoding.c'; else $(CYGPATH_W) '$(srcdir)/encoding.c'; fi`\n\nlibwim_a-error.o: error.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c\n\nlibwim_a-error.obj: error.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi`\n\nlibwim_a-export_image.o: export_image.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-export_image.o `test -f 'export_image.c' || echo '$(srcdir)/'`export_image.c\n\nlibwim_a-export_image.obj: export_image.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-export_image.obj `if test -f 'export_image.c'; then $(CYGPATH_W) 'export_image.c'; else $(CYGPATH_W) '$(srcdir)/export_image.c'; fi`\n\nlibwim_a-extract.o: extract.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-extract.o `test -f 'extract.c' || echo '$(srcdir)/'`extract.c\n\nlibwim_a-extract.obj: extract.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-extract.obj `if test -f 'extract.c'; then $(CYGPATH_W) 'extract.c'; else $(CYGPATH_W) '$(srcdir)/extract.c'; fi`\n\nlibwim_a-file_io.o: file_io.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-file_io.o `test -f 'file_io.c' || echo '$(srcdir)/'`file_io.c\n\nlibwim_a-file_io.obj: file_io.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-file_io.obj `if test -f 'file_io.c'; then $(CYGPATH_W) 'file_io.c'; else $(CYGPATH_W) '$(srcdir)/file_io.c'; fi`\n\nlibwim_a-header.o: header.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-header.o `test -f 'header.c' || echo '$(srcdir)/'`header.c\n\nlibwim_a-header.obj: header.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-header.obj `if test -f 'header.c'; then $(CYGPATH_W) 'header.c'; else $(CYGPATH_W) '$(srcdir)/header.c'; fi`\n\nlibwim_a-inode.o: inode.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode.o `test -f 'inode.c' || echo '$(srcdir)/'`inode.c\n\nlibwim_a-inode.obj: inode.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode.obj `if test -f 'inode.c'; then $(CYGPATH_W) 'inode.c'; else $(CYGPATH_W) '$(srcdir)/inode.c'; fi`\n\nlibwim_a-inode_fixup.o: inode_fixup.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode_fixup.o `test -f 'inode_fixup.c' || echo '$(srcdir)/'`inode_fixup.c\n\nlibwim_a-inode_fixup.obj: inode_fixup.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode_fixup.obj `if test -f 'inode_fixup.c'; then $(CYGPATH_W) 'inode_fixup.c'; else $(CYGPATH_W) '$(srcdir)/inode_fixup.c'; fi`\n\nlibwim_a-inode_table.o: inode_table.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode_table.o `test -f 'inode_table.c' || echo '$(srcdir)/'`inode_table.c\n\nlibwim_a-inode_table.obj: inode_table.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-inode_table.obj `if test -f 'inode_table.c'; then $(CYGPATH_W) 'inode_table.c'; else $(CYGPATH_W) '$(srcdir)/inode_table.c'; fi`\n\nlibwim_a-integrity.o: integrity.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-integrity.o `test -f 'integrity.c' || echo '$(srcdir)/'`integrity.c\n\nlibwim_a-integrity.obj: integrity.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-integrity.obj `if test -f 'integrity.c'; then $(CYGPATH_W) 'integrity.c'; else $(CYGPATH_W) '$(srcdir)/integrity.c'; fi`\n\nlibwim_a-iterate_dir.o: iterate_dir.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-iterate_dir.o `test -f 'iterate_dir.c' || echo '$(srcdir)/'`iterate_dir.c\n\nlibwim_a-iterate_dir.obj: iterate_dir.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-iterate_dir.obj `if test -f 'iterate_dir.c'; then $(CYGPATH_W) 'iterate_dir.c'; else $(CYGPATH_W) '$(srcdir)/iterate_dir.c'; fi`\n\nlibwim_a-lcpit_matchfinder.o: lcpit_matchfinder.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lcpit_matchfinder.o `test -f 'lcpit_matchfinder.c' || echo '$(srcdir)/'`lcpit_matchfinder.c\n\nlibwim_a-lcpit_matchfinder.obj: lcpit_matchfinder.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lcpit_matchfinder.obj `if test -f 'lcpit_matchfinder.c'; then $(CYGPATH_W) 'lcpit_matchfinder.c'; else $(CYGPATH_W) '$(srcdir)/lcpit_matchfinder.c'; fi`\n\nlibwim_a-lzms_common.o: lzms_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_common.o `test -f 'lzms_common.c' || echo '$(srcdir)/'`lzms_common.c\n\nlibwim_a-lzms_common.obj: lzms_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_common.obj `if test -f 'lzms_common.c'; then $(CYGPATH_W) 'lzms_common.c'; else $(CYGPATH_W) '$(srcdir)/lzms_common.c'; fi`\n\nlibwim_a-lzms_compress.o: lzms_compress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_compress.o `test -f 'lzms_compress.c' || echo '$(srcdir)/'`lzms_compress.c\n\nlibwim_a-lzms_compress.obj: lzms_compress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_compress.obj `if test -f 'lzms_compress.c'; then $(CYGPATH_W) 'lzms_compress.c'; else $(CYGPATH_W) '$(srcdir)/lzms_compress.c'; fi`\n\nlibwim_a-lzms_decompress.o: lzms_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_decompress.o `test -f 'lzms_decompress.c' || echo '$(srcdir)/'`lzms_decompress.c\n\nlibwim_a-lzms_decompress.obj: lzms_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzms_decompress.obj `if test -f 'lzms_decompress.c'; then $(CYGPATH_W) 'lzms_decompress.c'; else $(CYGPATH_W) '$(srcdir)/lzms_decompress.c'; fi`\n\nlibwim_a-lzx_common.o: lzx_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_common.o `test -f 'lzx_common.c' || echo '$(srcdir)/'`lzx_common.c\n\nlibwim_a-lzx_common.obj: lzx_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_common.obj `if test -f 'lzx_common.c'; then $(CYGPATH_W) 'lzx_common.c'; else $(CYGPATH_W) '$(srcdir)/lzx_common.c'; fi`\n\nlibwim_a-lzx_compress.o: lzx_compress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_compress.o `test -f 'lzx_compress.c' || echo '$(srcdir)/'`lzx_compress.c\n\nlibwim_a-lzx_compress.obj: lzx_compress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_compress.obj `if test -f 'lzx_compress.c'; then $(CYGPATH_W) 'lzx_compress.c'; else $(CYGPATH_W) '$(srcdir)/lzx_compress.c'; fi`\n\nlibwim_a-lzx_decompress.o: lzx_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_decompress.o `test -f 'lzx_decompress.c' || echo '$(srcdir)/'`lzx_decompress.c\n\nlibwim_a-lzx_decompress.obj: lzx_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-lzx_decompress.obj `if test -f 'lzx_decompress.c'; then $(CYGPATH_W) 'lzx_decompress.c'; else $(CYGPATH_W) '$(srcdir)/lzx_decompress.c'; fi`\n\nlibwim_a-metadata_resource.o: metadata_resource.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-metadata_resource.o `test -f 'metadata_resource.c' || echo '$(srcdir)/'`metadata_resource.c\n\nlibwim_a-metadata_resource.obj: metadata_resource.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-metadata_resource.obj `if test -f 'metadata_resource.c'; then $(CYGPATH_W) 'metadata_resource.c'; else $(CYGPATH_W) '$(srcdir)/metadata_resource.c'; fi`\n\nlibwim_a-pathlist.o: pathlist.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-pathlist.o `test -f 'pathlist.c' || echo '$(srcdir)/'`pathlist.c\n\nlibwim_a-pathlist.obj: pathlist.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-pathlist.obj `if test -f 'pathlist.c'; then $(CYGPATH_W) 'pathlist.c'; else $(CYGPATH_W) '$(srcdir)/pathlist.c'; fi`\n\nlibwim_a-paths.o: paths.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-paths.o `test -f 'paths.c' || echo '$(srcdir)/'`paths.c\n\nlibwim_a-paths.obj: paths.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-paths.obj `if test -f 'paths.c'; then $(CYGPATH_W) 'paths.c'; else $(CYGPATH_W) '$(srcdir)/paths.c'; fi`\n\nlibwim_a-pattern.o: pattern.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-pattern.o `test -f 'pattern.c' || echo '$(srcdir)/'`pattern.c\n\nlibwim_a-pattern.obj: pattern.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-pattern.obj `if test -f 'pattern.c'; then $(CYGPATH_W) 'pattern.c'; else $(CYGPATH_W) '$(srcdir)/pattern.c'; fi`\n\nlibwim_a-progress.o: progress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-progress.o `test -f 'progress.c' || echo '$(srcdir)/'`progress.c\n\nlibwim_a-progress.obj: progress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-progress.obj `if test -f 'progress.c'; then $(CYGPATH_W) 'progress.c'; else $(CYGPATH_W) '$(srcdir)/progress.c'; fi`\n\nlibwim_a-registry.o: registry.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-registry.o `test -f 'registry.c' || echo '$(srcdir)/'`registry.c\n\nlibwim_a-registry.obj: registry.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-registry.obj `if test -f 'registry.c'; then $(CYGPATH_W) 'registry.c'; else $(CYGPATH_W) '$(srcdir)/registry.c'; fi`\n\nlibwim_a-reparse.o: reparse.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-reparse.o `test -f 'reparse.c' || echo '$(srcdir)/'`reparse.c\n\nlibwim_a-reparse.obj: reparse.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-reparse.obj `if test -f 'reparse.c'; then $(CYGPATH_W) 'reparse.c'; else $(CYGPATH_W) '$(srcdir)/reparse.c'; fi`\n\nlibwim_a-resource.o: resource.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-resource.o `test -f 'resource.c' || echo '$(srcdir)/'`resource.c\n\nlibwim_a-resource.obj: resource.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-resource.obj `if test -f 'resource.c'; then $(CYGPATH_W) 'resource.c'; else $(CYGPATH_W) '$(srcdir)/resource.c'; fi`\n\nlibwim_a-scan.o: scan.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-scan.o `test -f 'scan.c' || echo '$(srcdir)/'`scan.c\n\nlibwim_a-scan.obj: scan.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-scan.obj `if test -f 'scan.c'; then $(CYGPATH_W) 'scan.c'; else $(CYGPATH_W) '$(srcdir)/scan.c'; fi`\n\nlibwim_a-security.o: security.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-security.o `test -f 'security.c' || echo '$(srcdir)/'`security.c\n\nlibwim_a-security.obj: security.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-security.obj `if test -f 'security.c'; then $(CYGPATH_W) 'security.c'; else $(CYGPATH_W) '$(srcdir)/security.c'; fi`\n\nlibwim_a-sha1.o: sha1.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-sha1.o `test -f 'sha1.c' || echo '$(srcdir)/'`sha1.c\n\nlibwim_a-sha1.obj: sha1.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-sha1.obj `if test -f 'sha1.c'; then $(CYGPATH_W) 'sha1.c'; else $(CYGPATH_W) '$(srcdir)/sha1.c'; fi`\n\nlibwim_a-solid.o: solid.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-solid.o `test -f 'solid.c' || echo '$(srcdir)/'`solid.c\n\nlibwim_a-solid.obj: solid.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-solid.obj `if test -f 'solid.c'; then $(CYGPATH_W) 'solid.c'; else $(CYGPATH_W) '$(srcdir)/solid.c'; fi`\n\nlibwim_a-split.o: split.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-split.o `test -f 'split.c' || echo '$(srcdir)/'`split.c\n\nlibwim_a-split.obj: split.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-split.obj `if test -f 'split.c'; then $(CYGPATH_W) 'split.c'; else $(CYGPATH_W) '$(srcdir)/split.c'; fi`\n\nlibwim_a-tagged_items.o: tagged_items.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-tagged_items.o `test -f 'tagged_items.c' || echo '$(srcdir)/'`tagged_items.c\n\nlibwim_a-tagged_items.obj: tagged_items.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-tagged_items.obj `if test -f 'tagged_items.c'; then $(CYGPATH_W) 'tagged_items.c'; else $(CYGPATH_W) '$(srcdir)/tagged_items.c'; fi`\n\nlibwim_a-textfile.o: textfile.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-textfile.o `test -f 'textfile.c' || echo '$(srcdir)/'`textfile.c\n\nlibwim_a-textfile.obj: textfile.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-textfile.obj `if test -f 'textfile.c'; then $(CYGPATH_W) 'textfile.c'; else $(CYGPATH_W) '$(srcdir)/textfile.c'; fi`\n\nlibwim_a-threads.o: threads.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-threads.o `test -f 'threads.c' || echo '$(srcdir)/'`threads.c\n\nlibwim_a-threads.obj: threads.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-threads.obj `if test -f 'threads.c'; then $(CYGPATH_W) 'threads.c'; else $(CYGPATH_W) '$(srcdir)/threads.c'; fi`\n\nlibwim_a-timestamp.o: timestamp.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-timestamp.o `test -f 'timestamp.c' || echo '$(srcdir)/'`timestamp.c\n\nlibwim_a-timestamp.obj: timestamp.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-timestamp.obj `if test -f 'timestamp.c'; then $(CYGPATH_W) 'timestamp.c'; else $(CYGPATH_W) '$(srcdir)/timestamp.c'; fi`\n\nlibwim_a-update_image.o: update_image.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-update_image.o `test -f 'update_image.c' || echo '$(srcdir)/'`update_image.c\n\nlibwim_a-update_image.obj: update_image.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-update_image.obj `if test -f 'update_image.c'; then $(CYGPATH_W) 'update_image.c'; else $(CYGPATH_W) '$(srcdir)/update_image.c'; fi`\n\nlibwim_a-util.o: util.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c\n\nlibwim_a-util.obj: util.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`\n\nlibwim_a-wim.o: wim.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-wim.o `test -f 'wim.c' || echo '$(srcdir)/'`wim.c\n\nlibwim_a-wim.obj: wim.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-wim.obj `if test -f 'wim.c'; then $(CYGPATH_W) 'wim.c'; else $(CYGPATH_W) '$(srcdir)/wim.c'; fi`\n\nlibwim_a-wimboot.o: wimboot.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-wimboot.o `test -f 'wimboot.c' || echo '$(srcdir)/'`wimboot.c\n\nlibwim_a-wimboot.obj: wimboot.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-wimboot.obj `if test -f 'wimboot.c'; then $(CYGPATH_W) 'wimboot.c'; else $(CYGPATH_W) '$(srcdir)/wimboot.c'; fi`\n\nlibwim_a-win32_apply.o: win32_apply.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_apply.o `test -f 'win32_apply.c' || echo '$(srcdir)/'`win32_apply.c\n\nlibwim_a-win32_apply.obj: win32_apply.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_apply.obj `if test -f 'win32_apply.c'; then $(CYGPATH_W) 'win32_apply.c'; else $(CYGPATH_W) '$(srcdir)/win32_apply.c'; fi`\n\nlibwim_a-win32_capture.o: win32_capture.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_capture.o `test -f 'win32_capture.c' || echo '$(srcdir)/'`win32_capture.c\n\nlibwim_a-win32_capture.obj: win32_capture.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_capture.obj `if test -f 'win32_capture.c'; then $(CYGPATH_W) 'win32_capture.c'; else $(CYGPATH_W) '$(srcdir)/win32_capture.c'; fi`\n\nlibwim_a-win32_common.o: win32_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_common.o `test -f 'win32_common.c' || echo '$(srcdir)/'`win32_common.c\n\nlibwim_a-win32_common.obj: win32_common.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_common.obj `if test -f 'win32_common.c'; then $(CYGPATH_W) 'win32_common.c'; else $(CYGPATH_W) '$(srcdir)/win32_common.c'; fi`\n\nlibwim_a-win32_replacements.o: win32_replacements.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_replacements.o `test -f 'win32_replacements.c' || echo '$(srcdir)/'`win32_replacements.c\n\nlibwim_a-win32_replacements.obj: win32_replacements.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_replacements.obj `if test -f 'win32_replacements.c'; then $(CYGPATH_W) 'win32_replacements.c'; else $(CYGPATH_W) '$(srcdir)/win32_replacements.c'; fi`\n\nlibwim_a-win32_vss.o: win32_vss.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_vss.o `test -f 'win32_vss.c' || echo '$(srcdir)/'`win32_vss.c\n\nlibwim_a-win32_vss.obj: win32_vss.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-win32_vss.obj `if test -f 'win32_vss.c'; then $(CYGPATH_W) 'win32_vss.c'; else $(CYGPATH_W) '$(srcdir)/win32_vss.c'; fi`\n\nlibwim_a-write.o: write.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-write.o `test -f 'write.c' || echo '$(srcdir)/'`write.c\n\nlibwim_a-write.obj: write.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-write.obj `if test -f 'write.c'; then $(CYGPATH_W) 'write.c'; else $(CYGPATH_W) '$(srcdir)/write.c'; fi`\n\nlibwim_a-xml.o: xml.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xml.o `test -f 'xml.c' || echo '$(srcdir)/'`xml.c\n\nlibwim_a-xml.obj: xml.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xml.obj `if test -f 'xml.c'; then $(CYGPATH_W) 'xml.c'; else $(CYGPATH_W) '$(srcdir)/xml.c'; fi`\n\nlibwim_a-xmlproc.o: xmlproc.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xmlproc.o `test -f 'xmlproc.c' || echo '$(srcdir)/'`xmlproc.c\n\nlibwim_a-xmlproc.obj: xmlproc.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xmlproc.obj `if test -f 'xmlproc.c'; then $(CYGPATH_W) 'xmlproc.c'; else $(CYGPATH_W) '$(srcdir)/xmlproc.c'; fi`\n\nlibwim_a-xml_windows.o: xml_windows.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xml_windows.o `test -f 'xml_windows.c' || echo '$(srcdir)/'`xml_windows.c\n\nlibwim_a-xml_windows.obj: xml_windows.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xml_windows.obj `if test -f 'xml_windows.c'; then $(CYGPATH_W) 'xml_windows.c'; else $(CYGPATH_W) '$(srcdir)/xml_windows.c'; fi`\n\nlibwim_a-xpress_compress.o: xpress_compress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xpress_compress.o `test -f 'xpress_compress.c' || echo '$(srcdir)/'`xpress_compress.c\n\nlibwim_a-xpress_compress.obj: xpress_compress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xpress_compress.obj `if test -f 'xpress_compress.c'; then $(CYGPATH_W) 'xpress_compress.c'; else $(CYGPATH_W) '$(srcdir)/xpress_compress.c'; fi`\n\nlibwim_a-xpress_decompress.o: xpress_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xpress_decompress.o `test -f 'xpress_decompress.c' || echo '$(srcdir)/'`xpress_decompress.c\n\nlibwim_a-xpress_decompress.obj: xpress_decompress.c\n\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libwim_a_CFLAGS) $(CFLAGS) -c -o libwim_a-xpress_decompress.obj `if test -f 'xpress_decompress.c'; then $(CYGPATH_W) 'xpress_decompress.c'; else $(CYGPATH_W) '$(srcdir)/xpress_decompress.c'; fi`\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LIBRARIES)\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \\\n\tdistclean-compile distclean-generic distclean-tags dvi dvi-am \\\n\thtml html-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \\\n\tuninstall-am\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "src/wimlib/avl_tree.c",
    "content": "/*\n * avl_tree.c - intrusive, nonrecursive AVL tree data structure (self-balancing\n *\t\tbinary search tree), implementation file\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/avl_tree.h\"\n\n/* Returns the left child (sign < 0) or the right child (sign > 0) of the\n * specified AVL tree node.\n * Note: for all calls of this, 'sign' is constant at compilation time,\n * so the compiler can remove the conditional.  */\nstatic AVL_INLINE struct avl_tree_node *\navl_get_child(const struct avl_tree_node *parent, int sign)\n{\n\tif (sign < 0)\n\t\treturn parent->left;\n\telse\n\t\treturn parent->right;\n}\n\nstatic AVL_INLINE struct avl_tree_node *\navl_tree_first_or_last_in_order(const struct avl_tree_node *root, int sign)\n{\n\tconst struct avl_tree_node *first = root;\n\n\tif (first)\n\t\twhile (avl_get_child(first, +sign))\n\t\t\tfirst = avl_get_child(first, +sign);\n\treturn (struct avl_tree_node *)first;\n}\n\n/* Starts an in-order traversal of the tree: returns the least-valued node, or\n * NULL if the tree is empty.  */\nstruct avl_tree_node *\navl_tree_first_in_order(const struct avl_tree_node *root)\n{\n\treturn avl_tree_first_or_last_in_order(root, -1);\n}\n\n/* Starts a *reverse* in-order traversal of the tree: returns the\n * greatest-valued node, or NULL if the tree is empty.  */\nstruct avl_tree_node *\navl_tree_last_in_order(const struct avl_tree_node *root)\n{\n\treturn avl_tree_first_or_last_in_order(root, 1);\n}\n\nstatic AVL_INLINE struct avl_tree_node *\navl_tree_next_or_prev_in_order(const struct avl_tree_node *node, int sign)\n{\n\tconst struct avl_tree_node *next;\n\n\tif (avl_get_child(node, +sign))\n\t\tfor (next = avl_get_child(node, +sign);\n\t\t     avl_get_child(next, -sign);\n\t\t     next = avl_get_child(next, -sign))\n\t\t\t;\n\telse\n\t\tfor (next = avl_get_parent(node);\n\t\t     next && node == avl_get_child(next, +sign);\n\t\t     node = next, next = avl_get_parent(next))\n\t\t\t;\n\treturn (struct avl_tree_node *)next;\n}\n\n/* Continues an in-order traversal of the tree: returns the next-greatest-valued\n * node, or NULL if there is none.  */\nstruct avl_tree_node *\navl_tree_next_in_order(const struct avl_tree_node *node)\n{\n\treturn avl_tree_next_or_prev_in_order(node, 1);\n}\n\n/* Continues a *reverse* in-order traversal of the tree: returns the\n * previous-greatest-valued node, or NULL if there is none.  */\nstruct avl_tree_node *\navl_tree_prev_in_order(const struct avl_tree_node *node)\n{\n\treturn avl_tree_next_or_prev_in_order(node, -1);\n}\n\n/* Starts a postorder traversal of the tree.  */\nstruct avl_tree_node *\navl_tree_first_in_postorder(const struct avl_tree_node *root)\n{\n\tconst struct avl_tree_node *first = root;\n\n\tif (first)\n\t\twhile (first->left || first->right)\n\t\t\tfirst = first->left ? first->left : first->right;\n\n\treturn (struct avl_tree_node *)first;\n}\n\n/* Continues a postorder traversal of the tree.  @prev will not be deferenced as\n * it's allowed that its memory has been freed; @prev_parent must be its saved\n * parent node.  Returns NULL if there are no more nodes (i.e. @prev was the\n * root of the tree).  */\nstruct avl_tree_node *\navl_tree_next_in_postorder(const struct avl_tree_node *prev,\n\t\t\t   const struct avl_tree_node *prev_parent)\n{\n\tconst struct avl_tree_node *next = prev_parent;\n\n\tif (next && prev == next->left && next->right)\n\t\tfor (next = next->right;\n\t\t     next->left || next->right;\n\t\t     next = next->left ? next->left : next->right)\n\t\t\t;\n\treturn (struct avl_tree_node *)next;\n}\n\n/* Sets the left child (sign < 0) or the right child (sign > 0) of the\n * specified AVL tree node.\n * Note: for all calls of this, 'sign' is constant at compilation time,\n * so the compiler can remove the conditional.  */\nstatic AVL_INLINE void\navl_set_child(struct avl_tree_node *parent, int sign,\n\t      struct avl_tree_node *child)\n{\n\tif (sign < 0)\n\t\tparent->left = child;\n\telse\n\t\tparent->right = child;\n}\n\n/* Sets the parent and balance factor of the specified AVL tree node.  */\nstatic AVL_INLINE void\navl_set_parent_balance(struct avl_tree_node *node, struct avl_tree_node *parent,\n\t\t       int balance_factor)\n{\n\tnode->parent_balance = (uintptr_t)parent | (balance_factor + 1);\n}\n\n/* Sets the parent of the specified AVL tree node.  */\nstatic AVL_INLINE void\navl_set_parent(struct avl_tree_node *node, struct avl_tree_node *parent)\n{\n\tnode->parent_balance = (uintptr_t)parent | (node->parent_balance & 3);\n}\n\n/* Returns the balance factor of the specified AVL tree node --- that is, the\n * height of its right subtree minus the height of its left subtree.  */\nstatic AVL_INLINE int\navl_get_balance_factor(const struct avl_tree_node *node)\n{\n\treturn (int)(node->parent_balance & 3) - 1;\n}\n\n/* Adds @amount to the balance factor of the specified AVL tree node.\n * The caller must ensure this still results in a valid balance factor\n * (-1, 0, or 1).  */\nstatic AVL_INLINE void\navl_adjust_balance_factor(struct avl_tree_node *node, int amount)\n{\n\tnode->parent_balance += amount;\n}\n\nstatic AVL_INLINE void\navl_replace_child(struct avl_tree_node **root_ptr,\n\t\t  struct avl_tree_node *parent,\n\t\t  struct avl_tree_node *old_child,\n\t\t  struct avl_tree_node *new_child)\n{\n\tif (parent) {\n\t\tif (old_child == parent->left)\n\t\t\tparent->left = new_child;\n\t\telse\n\t\t\tparent->right = new_child;\n\t} else {\n\t\t*root_ptr = new_child;\n\t}\n}\n\n/*\n * Template for performing a single rotation ---\n *\n * sign > 0:  Rotate clockwise (right) rooted at A:\n *\n *           P?            P?\n *           |             |\n *           A             B\n *          / \\           / \\\n *         B   C?  =>    D?  A\n *        / \\               / \\\n *       D?  E?            E?  C?\n *\n * (nodes marked with ? may not exist)\n *\n * sign < 0:  Rotate counterclockwise (left) rooted at A:\n *\n *           P?            P?\n *           |             |\n *           A             B\n *          / \\           / \\\n *         C?  B   =>    A   D?\n *            / \\       / \\\n *           E?  D?    C?  E?\n *\n * This updates pointers but not balance factors!\n */\nstatic AVL_INLINE void\navl_rotate(struct avl_tree_node ** const root_ptr,\n\t   struct avl_tree_node * const A, const int sign)\n{\n\tstruct avl_tree_node * const B = avl_get_child(A, -sign);\n\tstruct avl_tree_node * const E = avl_get_child(B, +sign);\n\tstruct avl_tree_node * const P = avl_get_parent(A);\n\n\tavl_set_child(A, -sign, E);\n\tavl_set_parent(A, B);\n\n\tavl_set_child(B, +sign, A);\n\tavl_set_parent(B, P);\n\n\tif (E)\n\t\tavl_set_parent(E, A);\n\n\tavl_replace_child(root_ptr, P, A, B);\n}\n\n/*\n * Template for performing a double rotation ---\n *\n * sign > 0:  Rotate counterclockwise (left) rooted at B, then\n *\t\t     clockwise (right) rooted at A:\n *\n *           P?            P?          P?\n *           |             |           |\n *           A             A           E\n *          / \\           / \\        /   \\\n *         B   C?  =>    E   C? =>  B     A\n *        / \\           / \\        / \\   / \\\n *       D?  E         B   G?     D?  F?G?  C?\n *          / \\       / \\\n *         F?  G?    D?  F?\n *\n * (nodes marked with ? may not exist)\n *\n * sign < 0:  Rotate clockwise (right) rooted at B, then\n *\t\t     counterclockwise (left) rooted at A:\n *\n *         P?          P?              P?\n *         |           |               |\n *         A           A               E\n *        / \\         / \\            /   \\\n *       C?  B   =>  C?  E    =>    A     B\n *          / \\         / \\        / \\   / \\\n *         E   D?      G?  B      C?  G?F?  D?\n *        / \\             / \\\n *       G?  F?          F?  D?\n *\n * Returns a pointer to E and updates balance factors.  Except for those\n * two things, this function is equivalent to:\n *\tavl_rotate(root_ptr, B, -sign);\n *\tavl_rotate(root_ptr, A, +sign);\n *\n * See comment in avl_handle_subtree_growth() for explanation of balance\n * factor updates.\n */\nstatic AVL_INLINE struct avl_tree_node *\navl_do_double_rotate(struct avl_tree_node ** const root_ptr,\n\t\t     struct avl_tree_node * const B,\n\t\t     struct avl_tree_node * const A, const int sign)\n{\n\tstruct avl_tree_node * const E = avl_get_child(B, +sign);\n\tstruct avl_tree_node * const F = avl_get_child(E, -sign);\n\tstruct avl_tree_node * const G = avl_get_child(E, +sign);\n\tstruct avl_tree_node * const P = avl_get_parent(A);\n\tconst int e = avl_get_balance_factor(E);\n\n\tavl_set_child(A, -sign, G);\n\tavl_set_parent_balance(A, E, ((sign * e >= 0) ? 0 : -e));\n\n\tavl_set_child(B, +sign, F);\n\tavl_set_parent_balance(B, E, ((sign * e <= 0) ? 0 : -e));\n\n\tavl_set_child(E, +sign, A);\n\tavl_set_child(E, -sign, B);\n\tavl_set_parent_balance(E, P, 0);\n\n\tif (G)\n\t\tavl_set_parent(G, A);\n\n\tif (F)\n\t\tavl_set_parent(F, B);\n\n\tavl_replace_child(root_ptr, P, A, E);\n\n\treturn E;\n}\n\n/*\n * This function handles the growth of a subtree due to an insertion.\n *\n * @root_ptr\n *\tLocation of the tree's root pointer.\n *\n * @node\n *\tA subtree that has increased in height by 1 due to an insertion.\n *\n * @parent\n *\tParent of @node; must not be NULL.\n *\n * @sign\n *\t-1 if @node is the left child of @parent;\n *\t+1 if @node is the right child of @parent.\n *\n * This function will adjust @parent's balance factor, then do a (single\n * or double) rotation if necessary.  The return value will be %true if\n * the full AVL tree is now adequately balanced, or %false if the subtree\n * rooted at @parent is now adequately balanced but has increased in\n * height by 1, so the caller should continue up the tree.\n *\n * Note that if %false is returned, no rotation will have been done.\n * Indeed, a single node insertion cannot require that more than one\n * (single or double) rotation be done.\n */\nstatic AVL_INLINE bool\navl_handle_subtree_growth(struct avl_tree_node ** const root_ptr,\n\t\t\t  struct avl_tree_node * const node,\n\t\t\t  struct avl_tree_node * const parent,\n\t\t\t  const int sign)\n{\n\tint old_balance_factor, new_balance_factor;\n\n\told_balance_factor = avl_get_balance_factor(parent);\n\n\tif (old_balance_factor == 0) {\n\t\tavl_adjust_balance_factor(parent, sign);\n\t\t/* @parent is still sufficiently balanced (-1 or +1\n\t\t * balance factor), but must have increased in height.\n\t\t * Continue up the tree.  */\n\t\treturn false;\n\t}\n\n\tnew_balance_factor = old_balance_factor + sign;\n\n\tif (new_balance_factor == 0) {\n\t\tavl_adjust_balance_factor(parent, sign);\n\t\t/* @parent is now perfectly balanced (0 balance factor).\n\t\t * It cannot have increased in height, so there is\n\t\t * nothing more to do.  */\n\t\treturn true;\n\t}\n\n\t/* @parent is too left-heavy (new_balance_factor == -2) or\n\t * too right-heavy (new_balance_factor == +2).  */\n\n\t/* Test whether @node is left-heavy (-1 balance factor) or\n\t * right-heavy (+1 balance factor).\n\t * Note that it cannot be perfectly balanced (0 balance factor)\n\t * because here we are under the invariant that @node has\n\t * increased in height due to the insertion.  */\n\tif (sign * avl_get_balance_factor(node) > 0) {\n\n\t\t/* @node (B below) is heavy in the same direction @parent\n\t\t * (A below) is heavy.\n\t\t *\n\t\t * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\t\t * The comment, diagram, and equations below assume sign < 0.\n\t\t * The other case is symmetric!\n\t\t * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\t\t *\n\t\t * Do a clockwise rotation rooted at @parent (A below):\n\t\t *\n\t\t *           A              B\n\t\t *          / \\           /   \\\n\t\t *         B   C?  =>    D     A\n\t\t *        / \\           / \\   / \\\n\t\t *       D   E?        F?  G?E?  C?\n\t\t *      / \\\n\t\t *     F?  G?\n\t\t *\n\t\t * Before the rotation:\n\t\t *\tbalance(A) = -2\n\t\t *\tbalance(B) = -1\n\t\t * Let x = height(C).  Then:\n\t\t *\theight(B) = x + 2\n\t\t *\theight(D) = x + 1\n\t\t *\theight(E) = x\n\t\t *\tmax(height(F), height(G)) = x.\n\t\t *\n\t\t * After the rotation:\n\t\t *\theight(D) = max(height(F), height(G)) + 1\n\t\t *\t\t  = x + 1\n\t\t *\theight(A) = max(height(E), height(C)) + 1\n\t\t *\t\t  = max(x, x) + 1 = x + 1\n\t\t *\tbalance(B) = 0\n\t\t *\tbalance(A) = 0\n\t\t */\n\t\tavl_rotate(root_ptr, parent, -sign);\n\n\t\t/* Equivalent to setting @parent's balance factor to 0.  */\n\t\tavl_adjust_balance_factor(parent, -sign); /* A */\n\n\t\t/* Equivalent to setting @node's balance factor to 0.  */\n\t\tavl_adjust_balance_factor(node, -sign);   /* B */\n\t} else {\n\t\t/* @node (B below) is heavy in the direction opposite\n\t\t * from the direction @parent (A below) is heavy.\n\t\t *\n\t\t * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\t\t * The comment, diagram, and equations below assume sign < 0.\n\t\t * The other case is symmetric!\n\t\t * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\t\t *\n\t\t * Do a counterblockwise rotation rooted at @node (B below),\n\t\t * then a clockwise rotation rooted at @parent (A below):\n\t\t *\n\t\t *           A             A           E\n\t\t *          / \\           / \\        /   \\\n\t\t *         B   C?  =>    E   C? =>  B     A\n\t\t *        / \\           / \\        / \\   / \\\n\t\t *       D?  E         B   G?     D?  F?G?  C?\n\t\t *          / \\       / \\\n\t\t *         F?  G?    D?  F?\n\t\t *\n\t\t * Before the rotation:\n\t\t *\tbalance(A) = -2\n\t\t *\tbalance(B) = +1\n\t\t * Let x = height(C).  Then:\n\t\t *\theight(B) = x + 2\n\t\t *\theight(E) = x + 1\n\t\t *\theight(D) = x\n\t\t *\tmax(height(F), height(G)) = x\n\t\t *\n\t\t * After both rotations:\n\t\t *\theight(A) = max(height(G), height(C)) + 1\n\t\t *\t\t  = x + 1\n\t\t *\tbalance(A) = balance(E{orig}) >= 0 ? 0 : -balance(E{orig})\n\t\t *\theight(B) = max(height(D), height(F)) + 1\n\t\t *\t\t  = x + 1\n\t\t *\tbalance(B) = balance(E{orig} <= 0) ? 0 : -balance(E{orig})\n\t\t *\n\t\t *\theight(E) = x + 2\n\t\t *\tbalance(E) = 0\n\t\t */\n\t\tavl_do_double_rotate(root_ptr, node, parent, -sign);\n\t}\n\n\t/* Height after rotation is unchanged; nothing more to do.  */\n\treturn true;\n}\n\n/* Rebalance the tree after insertion of the specified node.  */\nvoid\navl_tree_rebalance_after_insert(struct avl_tree_node **root_ptr,\n\t\t\t\tstruct avl_tree_node *inserted)\n{\n\tstruct avl_tree_node *node, *parent;\n\tbool done;\n\n\tinserted->left = NULL;\n\tinserted->right = NULL;\n\n\tnode = inserted;\n\n\t/* Adjust balance factor of new node's parent.\n\t * No rotation will need to be done at this level.  */\n\n\tparent = avl_get_parent(node);\n\tif (!parent)\n\t\treturn;\n\n\tif (node == parent->left)\n\t\tavl_adjust_balance_factor(parent, -1);\n\telse\n\t\tavl_adjust_balance_factor(parent, +1);\n\n\tif (avl_get_balance_factor(parent) == 0)\n\t\t/* @parent did not change in height.  Nothing more to do.  */\n\t\treturn;\n\n\t/* The subtree rooted at @parent increased in height by 1.  */\n\n\tdo {\n\t\t/* Adjust balance factor of next ancestor.  */\n\n\t\tnode = parent;\n\t\tparent = avl_get_parent(node);\n\t\tif (!parent)\n\t\t\treturn;\n\n\t\t/* The subtree rooted at @node has increased in height by 1.  */\n\t\tif (node == parent->left)\n\t\t\tdone = avl_handle_subtree_growth(root_ptr, node,\n\t\t\t\t\t\t\t parent, -1);\n\t\telse\n\t\t\tdone = avl_handle_subtree_growth(root_ptr, node,\n\t\t\t\t\t\t\t parent, +1);\n\t} while (!done);\n}\n\n/*\n * This function handles the shrinkage of a subtree due to a deletion.\n *\n * @root_ptr\n *\tLocation of the tree's root pointer.\n *\n * @parent\n *\tA node in the tree, exactly one of whose subtrees has decreased\n *\tin height by 1 due to a deletion.  (This includes the case where\n *\tone of the child pointers has become NULL, since we can consider\n *\tthe \"NULL\" subtree to have a height of 0.)\n *\n * @sign\n *\t+1 if the left subtree of @parent has decreased in height by 1;\n *\t-1 if the right subtree of @parent has decreased in height by 1.\n *\n * @left_deleted_ret\n *\tIf the return value is not NULL, this will be set to %true if the\n *\tleft subtree of the returned node has decreased in height by 1,\n *\tor %false if the right subtree of the returned node has decreased\n *\tin height by 1.\n *\n * This function will adjust @parent's balance factor, then do a (single\n * or double) rotation if necessary.  The return value will be NULL if\n * the full AVL tree is now adequately balanced, or a pointer to the\n * parent of @parent if @parent is now adequately balanced but has\n * decreased in height by 1.  Also in the latter case, *left_deleted_ret\n * will be set.\n */\nstatic AVL_INLINE struct avl_tree_node *\navl_handle_subtree_shrink(struct avl_tree_node ** const root_ptr,\n\t\t\t  struct avl_tree_node *parent,\n\t\t\t  const int sign,\n\t\t\t  bool * const left_deleted_ret)\n{\n\tstruct avl_tree_node *node;\n\tint old_balance_factor, new_balance_factor;\n\n\told_balance_factor = avl_get_balance_factor(parent);\n\n\tif (old_balance_factor == 0) {\n\t\t/* Prior to the deletion, the subtree rooted at\n\t\t * @parent was perfectly balanced.  It's now\n\t\t * unbalanced by 1, but that's okay and its height\n\t\t * hasn't changed.  Nothing more to do.  */\n\t\tavl_adjust_balance_factor(parent, sign);\n\t\treturn NULL;\n\t}\n\n\tnew_balance_factor = old_balance_factor + sign;\n\n\tif (new_balance_factor == 0) {\n\t\t/* The subtree rooted at @parent is now perfectly\n\t\t * balanced, whereas before the deletion it was\n\t\t * unbalanced by 1.  Its height must have decreased\n\t\t * by 1.  No rotation is needed at this location,\n\t\t * but continue up the tree.  */\n\t\tavl_adjust_balance_factor(parent, sign);\n\t\tnode = parent;\n\t} else {\n\t\t/* @parent is too left-heavy (new_balance_factor == -2) or\n\t\t * too right-heavy (new_balance_factor == +2).  */\n\n\t\tnode = avl_get_child(parent, sign);\n\n\t\t/* The rotations below are similar to those done during\n\t\t * insertion (see avl_handle_subtree_growth()), so full\n\t\t * comments are not provided.  The only new case is the\n\t\t * one where @node has a balance factor of 0, and that is\n\t\t * commented.  */\n\n\t\tif (sign * avl_get_balance_factor(node) >= 0) {\n\n\t\t\tavl_rotate(root_ptr, parent, -sign);\n\n\t\t\tif (avl_get_balance_factor(node) == 0) {\n\t\t\t\t/*\n\t\t\t\t * @node (B below) is perfectly balanced.\n\t\t\t\t *\n\t\t\t\t * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\t\t\t\t * The comment, diagram, and equations\n\t\t\t\t * below assume sign < 0.  The other case\n\t\t\t\t * is symmetric!\n\t\t\t\t * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\t\t\t\t *\n\t\t\t\t * Do a clockwise rotation rooted at\n\t\t\t\t * @parent (A below):\n\t\t\t\t *\n\t\t\t\t *           A              B\n\t\t\t\t *          / \\           /   \\\n\t\t\t\t *         B   C?  =>    D     A\n\t\t\t\t *        / \\           / \\   / \\\n\t\t\t\t *       D   E         F?  G?E   C?\n\t\t\t\t *      / \\\n\t\t\t\t *     F?  G?\n\t\t\t\t *\n\t\t\t\t * Before the rotation:\n\t\t\t\t *\tbalance(A) = -2\n\t\t\t\t *\tbalance(B) =  0\n\t\t\t\t * Let x = height(C).  Then:\n\t\t\t\t *\theight(B) = x + 2\n\t\t\t\t *\theight(D) = x + 1\n\t\t\t\t *\theight(E) = x + 1\n\t\t\t\t *\tmax(height(F), height(G)) = x.\n\t\t\t\t *\n\t\t\t\t * After the rotation:\n\t\t\t\t *\theight(D) = max(height(F), height(G)) + 1\n\t\t\t\t *\t\t  = x + 1\n\t\t\t\t *\theight(A) = max(height(E), height(C)) + 1\n\t\t\t\t *\t\t  = max(x + 1, x) + 1 = x + 2\n\t\t\t\t *\tbalance(A) = -1\n\t\t\t\t *\tbalance(B) = +1\n\t\t\t\t */\n\n\t\t\t\t/* A: -2 => -1 (sign < 0)\n\t\t\t\t * or +2 => +1 (sign > 0)\n\t\t\t\t * No change needed --- that's the same as\n\t\t\t\t * old_balance_factor.  */\n\n\t\t\t\t/* B: 0 => +1 (sign < 0)\n\t\t\t\t * or 0 => -1 (sign > 0)  */\n\t\t\t\tavl_adjust_balance_factor(node, -sign);\n\n\t\t\t\t/* Height is unchanged; nothing more to do.  */\n\t\t\t\treturn NULL;\n\t\t\t} else {\n\t\t\t\tavl_adjust_balance_factor(parent, -sign);\n\t\t\t\tavl_adjust_balance_factor(node, -sign);\n\t\t\t}\n\t\t} else {\n\t\t\tnode = avl_do_double_rotate(root_ptr, node,\n\t\t\t\t\t\t    parent, -sign);\n\t\t}\n\t}\n\tparent = avl_get_parent(node);\n\tif (parent)\n\t\t*left_deleted_ret = (node == parent->left);\n\treturn parent;\n}\n\n/* Swaps node X, which must have 2 children, with its in-order successor, then\n * unlinks node X.  Returns the parent of X just before unlinking, without its\n * balance factor having been updated to account for the unlink.  */\nstatic AVL_INLINE struct avl_tree_node *\navl_tree_swap_with_successor(struct avl_tree_node **root_ptr,\n\t\t\t     struct avl_tree_node *X,\n\t\t\t     bool *left_deleted_ret)\n{\n\tstruct avl_tree_node *Y, *ret;\n\n\tY = X->right;\n\tif (!Y->left) {\n\t\t/*\n\t\t *     P?           P?           P?\n\t\t *     |            |            |\n\t\t *     X            Y            Y\n\t\t *    / \\          / \\          / \\\n\t\t *   A   Y    =>  A   X    =>  A   B?\n\t\t *      / \\          / \\\n\t\t *    (0)  B?      (0)  B?\n\t\t *\n\t\t * [ X unlinked, Y returned ]\n\t\t */\n\t\tret = Y;\n\t\t*left_deleted_ret = false;\n\t} else {\n\t\tstruct avl_tree_node *Q;\n\n\t\tdo {\n\t\t\tQ = Y;\n\t\t\tY = Y->left;\n\t\t} while (Y->left);\n\n\t\t/*\n\t\t *     P?           P?           P?\n\t\t *     |            |            |\n\t\t *     X            Y            Y\n\t\t *    / \\          / \\          / \\\n\t\t *   A   ...  =>  A  ...   =>  A  ...\n\t\t *       |            |            |\n\t\t *       Q            Q            Q\n\t\t *      /            /            /\n\t\t *     Y            X            B?\n\t\t *    / \\          / \\\n\t\t *  (0)  B?      (0)  B?\n\t\t *\n\t\t *\n\t\t * [ X unlinked, Q returned ]\n\t\t */\n\n\t\tQ->left = Y->right;\n\t\tif (Q->left)\n\t\t\tavl_set_parent(Q->left, Q);\n\t\tY->right = X->right;\n\t\tavl_set_parent(X->right, Y);\n\t\tret = Q;\n\t\t*left_deleted_ret = true;\n\t}\n\n\tY->left = X->left;\n\tavl_set_parent(X->left, Y);\n\n\tY->parent_balance = X->parent_balance;\n\tavl_replace_child(root_ptr, avl_get_parent(X), X, Y);\n\n\treturn ret;\n}\n\n/*\n * Removes an item from the specified AVL tree.\n *\n * @root_ptr\n *\tLocation of the AVL tree's root pointer.  Indirection is needed\n *\tbecause the root node may change if the tree needed to be rebalanced\n *\tbecause of the deletion or if @node was the root node.\n *\n * @node\n *\tPointer to the `struct avl_tree_node' embedded in the item to\n *\tremove from the tree.\n *\n * Note: This function *only* removes the node and rebalances the tree.\n * It does not free any memory.\n */\nvoid\navl_tree_remove(struct avl_tree_node **root_ptr, struct avl_tree_node *node)\n{\n\tstruct avl_tree_node *parent;\n\tbool left_deleted = false;\n\n\tif (node->left && node->right) {\n\t\t/* @node is fully internal, with two children.  Swap it\n\t\t * with its in-order successor (which must exist in the\n\t\t * right subtree of @node and can have, at most, a right\n\t\t * child), then unlink @node.  */\n\t\tparent = avl_tree_swap_with_successor(root_ptr, node,\n\t\t\t\t\t\t      &left_deleted);\n\t\t/* @parent is now the parent of what was @node's in-order\n\t\t * successor.  It cannot be NULL, since @node itself was\n\t\t * an ancestor of its in-order successor.\n\t\t * @left_deleted has been set to %true if @node's\n\t\t * in-order successor was the left child of @parent,\n\t\t * otherwise %false.  */\n\t} else {\n\t\tstruct avl_tree_node *child;\n\n\t\t/* @node is missing at least one child.  Unlink it.  Set\n\t\t * @parent to @node's parent, and set @left_deleted to\n\t\t * reflect which child of @parent @node was.  Or, if\n\t\t * @node was the root node, simply update the root node\n\t\t * and return.  */\n\t\tchild = node->left ? node->left : node->right;\n\t\tparent = avl_get_parent(node);\n\t\tif (parent) {\n\t\t\tif (node == parent->left) {\n\t\t\t\tparent->left = child;\n\t\t\t\tleft_deleted = true;\n\t\t\t} else {\n\t\t\t\tparent->right = child;\n\t\t\t\tleft_deleted = false;\n\t\t\t}\n\t\t\tif (child)\n\t\t\t\tavl_set_parent(child, parent);\n\t\t} else {\n\t\t\tif (child)\n\t\t\t\tavl_set_parent(child, parent);\n\t\t\t*root_ptr = child;\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/* Rebalance the tree.  */\n\tdo {\n\t\tif (left_deleted)\n\t\t\tparent = avl_handle_subtree_shrink(root_ptr, parent,\n\t\t\t\t\t\t\t   +1, &left_deleted);\n\t\telse\n\t\t\tparent = avl_handle_subtree_shrink(root_ptr, parent,\n\t\t\t\t\t\t\t   -1, &left_deleted);\n\t} while (parent);\n}\n"
  },
  {
    "path": "src/wimlib/blob_table.c",
    "content": "/*\n * blob_table.c\n *\n * A blob table maps SHA-1 message digests to \"blobs\", which are nonempty\n * sequences of binary data.  Within a WIM file, blobs are single-instanced.\n *\n * This file also contains code to read and write the corresponding on-disk\n * representation of this table in the WIM file format.\n */\n\n/*\n * Copyright (C) 2012-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h> /* for unlink()  */\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/bitops.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/ntfs_3g.h\"\n#include \"wimlib/resource.h\"\n#include \"wimlib/unaligned.h\"\n#include \"wimlib/util.h\"\n#include \"wimlib/win32.h\"\n#include \"wimlib/write.h\"\n\n/* A hash table mapping SHA-1 message digests to blob descriptors  */\nstruct blob_table {\n\tstruct hlist_head *array;\n\tsize_t num_blobs;\n\tsize_t mask; /* capacity - 1; capacity is a power of 2  */\n};\n\nstruct blob_table *\nnew_blob_table(size_t capacity)\n{\n\tstruct blob_table *table;\n\tstruct hlist_head *array;\n\n\tcapacity = roundup_pow_of_2(capacity);\n\n\ttable = MALLOC(sizeof(struct blob_table));\n\tif (table == NULL)\n\t\tgoto oom;\n\n\tarray = CALLOC(capacity, sizeof(array[0]));\n\tif (array == NULL) {\n\t\tFREE(table);\n\t\tgoto oom;\n\t}\n\n\ttable->num_blobs = 0;\n\ttable->mask = capacity - 1;\n\ttable->array = array;\n\treturn table;\n\noom:\n\tERROR(\"Failed to allocate memory for blob table \"\n\t      \"with capacity %zu\", capacity);\n\treturn NULL;\n}\n\nstatic int\ndo_free_blob_descriptor(struct blob_descriptor *blob, void *_ignore)\n{\n\tfree_blob_descriptor(blob);\n\treturn 0;\n}\n\nvoid\nfree_blob_table(struct blob_table *table)\n{\n\tif (table) {\n\t\tfor_blob_in_table(table, do_free_blob_descriptor, NULL);\n\t\tFREE(table->array);\n\t\tFREE(table);\n\t}\n}\n\nstruct blob_descriptor *\nnew_blob_descriptor(void)\n{\n\tSTATIC_ASSERT(BLOB_NONEXISTENT == 0);\n\treturn CALLOC(1, sizeof(struct blob_descriptor));\n}\n\nstruct blob_descriptor *\nclone_blob_descriptor(const struct blob_descriptor *old)\n{\n\tstruct blob_descriptor *new;\n\n\tnew = memdup(old, sizeof(struct blob_descriptor));\n\tif (new == NULL)\n\t\treturn NULL;\n\n\tswitch (new->blob_location) {\n\tcase BLOB_IN_WIM:\n\t\tlist_add(&new->rdesc_node, &new->rdesc->blob_list);\n\t\tbreak;\n\n\tcase BLOB_IN_FILE_ON_DISK:\n#ifdef WITH_FUSE\n\tcase BLOB_IN_STAGING_FILE:\n\t\tSTATIC_ASSERT((void*)&old->file_on_disk ==\n\t\t\t      (void*)&old->staging_file_name);\n#endif\n\t\tnew->file_on_disk = TSTRDUP(old->file_on_disk);\n\t\tif (new->file_on_disk == NULL)\n\t\t\tgoto out_free;\n\t\tbreak;\n#ifdef _WIN32\n\tcase BLOB_IN_WINDOWS_FILE:\n\t\tnew->windows_file = clone_windows_file(old->windows_file);\n\t\tbreak;\n#endif\n\tcase BLOB_IN_ATTACHED_BUFFER:\n\t\tnew->attached_buffer = memdup(old->attached_buffer, old->size);\n\t\tif (new->attached_buffer == NULL)\n\t\t\tgoto out_free;\n\t\tbreak;\n#ifdef WITH_NTFS_3G\n\tcase BLOB_IN_NTFS_VOLUME:\n\t\tnew->ntfs_loc = clone_ntfs_location(old->ntfs_loc);\n\t\tif (!new->ntfs_loc)\n\t\t\tgoto out_free;\n\t\tbreak;\n#endif\n\t}\n\treturn new;\n\nout_free:\n\tfree_blob_descriptor(new);\n\treturn NULL;\n}\n\n/* Release a blob descriptor from its location, if any, and set its new location\n * to BLOB_NONEXISTENT.  */\nvoid\nblob_release_location(struct blob_descriptor *blob)\n{\n\tswitch (blob->blob_location) {\n\tcase BLOB_IN_WIM: {\n\t\tstruct wim_resource_descriptor *rdesc = blob->rdesc;\n\n\t\tlist_del(&blob->rdesc_node);\n\t\tif (list_empty(&rdesc->blob_list)) {\n\t\t\twim_decrement_refcnt(rdesc->wim);\n\t\t\tFREE(rdesc);\n\t\t}\n\t\tbreak;\n\t}\n\tcase BLOB_IN_FILE_ON_DISK:\n#ifdef WITH_FUSE\n\tcase BLOB_IN_STAGING_FILE:\n\t\tSTATIC_ASSERT((void*)&blob->file_on_disk ==\n\t\t\t      (void*)&blob->staging_file_name);\n#endif\n\tcase BLOB_IN_ATTACHED_BUFFER:\n\t\tSTATIC_ASSERT(offsetof(struct blob_descriptor, file_on_disk) ==\n\t\t\toffsetof(struct blob_descriptor, attached_buffer));\n\t\tFREE(blob->file_on_disk);\n\t\tbreak;\n#ifdef _WIN32\n\tcase BLOB_IN_WINDOWS_FILE:\n\t\tfree_windows_file(blob->windows_file);\n\t\tbreak;\n#endif\n#ifdef WITH_NTFS_3G\n\tcase BLOB_IN_NTFS_VOLUME:\n\t\tfree_ntfs_location(blob->ntfs_loc);\n\t\tbreak;\n#endif\n\t}\n\tblob->blob_location = BLOB_NONEXISTENT;\n}\n\nvoid\nfree_blob_descriptor(struct blob_descriptor *blob)\n{\n\tif (blob) {\n\t\tblob_release_location(blob);\n\t\tFREE(blob);\n\t}\n}\n\n/* Should this blob be retained even if it has no references?  */\nstatic bool\nshould_retain_blob(const struct blob_descriptor *blob)\n{\n\treturn blob->blob_location == BLOB_IN_WIM;\n}\n\nstatic void\nfinalize_blob(struct blob_descriptor *blob)\n{\n\tif (!should_retain_blob(blob))\n\t\tfree_blob_descriptor(blob);\n}\n\n/*\n * Decrements the reference count of the specified blob, which must be either\n * (a) unhashed, or (b) inserted in the specified blob table.\n *\n * If the blob's reference count reaches 0, we may unlink it from @table and\n * free it.  However, we retain blobs with 0 reference count that originated\n * from WIM files (BLOB_IN_WIM).  We do this for two reasons:\n *\n * 1. This prevents information about valid blobs in a WIM file --- blobs which\n *    will continue to be present after appending to the WIM file --- from being\n *    lost merely because we dropped all references to them.\n *\n * 2. Blob reference counts we read from WIM files can't be trusted.  It's\n *    possible that a WIM has reference counts that are too low; WIMGAPI\n *    sometimes creates WIMs where this is the case.  It's also possible that\n *    blobs have been referenced from an external WIM; those blobs can\n *    potentially have any reference count at all, either lower or higher than\n *    would be expected for this WIM (\"this WIM\" meaning the owner of @table) if\n *    it were a standalone WIM.\n *\n * So we can't take the reference counts too seriously.  But at least, we do\n * recalculate by default when writing a new WIM file.\n */\nvoid\nblob_decrement_refcnt(struct blob_descriptor *blob, struct blob_table *table)\n{\n\tblob_subtract_refcnt(blob, table, 1);\n}\n\nvoid\nblob_subtract_refcnt(struct blob_descriptor *blob, struct blob_table *table,\n\t\t     u32 count)\n{\n\tif (unlikely(blob->refcnt < count)) {\n\t\tblob->refcnt = 0; /* See comment above  */\n\t\treturn;\n\t}\n\n\tblob->refcnt -= count;\n\n\tif (blob->refcnt != 0)\n\t\treturn;\n\n\tif (blob->unhashed) {\n\t\tlist_del(&blob->unhashed_list);\n\t#ifdef WITH_FUSE\n\t\t/* If the blob has been extracted to a staging file for a FUSE\n\t\t * mount, unlink the staging file.  (Note that there still may\n\t\t * be open file descriptors to it.)  */\n\t\tif (blob->blob_location == BLOB_IN_STAGING_FILE)\n\t\t\tunlinkat(blob->staging_dir_fd,\n\t\t\t\t blob->staging_file_name, 0);\n\t#endif\n\t} else {\n\t\tif (!should_retain_blob(blob))\n\t\t\tblob_table_unlink(table, blob);\n\t}\n\n\t/* If FUSE mounts are enabled, then don't actually free the blob\n\t * descriptor until the last file descriptor to it has been closed.  */\n#ifdef WITH_FUSE\n\tif (blob->num_opened_fds == 0)\n#endif\n\t\tfinalize_blob(blob);\n}\n\n#ifdef WITH_FUSE\nvoid\nblob_decrement_num_opened_fds(struct blob_descriptor *blob)\n{\n\twimlib_assert(blob->num_opened_fds != 0);\n\n\tif (--blob->num_opened_fds == 0 && blob->refcnt == 0)\n\t\tfinalize_blob(blob);\n}\n#endif\n\nstatic void\nblob_table_insert_raw(struct blob_table *table, struct blob_descriptor *blob)\n{\n\tsize_t i = blob->hash_short & table->mask;\n\n\thlist_add_head(&blob->hash_list, &table->array[i]);\n}\n\nstatic void\nenlarge_blob_table(struct blob_table *table)\n{\n\tsize_t old_capacity, new_capacity;\n\tstruct hlist_head *old_array, *new_array;\n\tstruct blob_descriptor *blob;\n\tstruct hlist_node *tmp;\n\tsize_t i;\n\n\told_capacity = table->mask + 1;\n\tnew_capacity = old_capacity * 2;\n\tnew_array = CALLOC(new_capacity, sizeof(struct hlist_head));\n\tif (new_array == NULL)\n\t\treturn;\n\told_array = table->array;\n\ttable->array = new_array;\n\ttable->mask = new_capacity - 1;\n\n\tfor (i = 0; i < old_capacity; i++)\n\t\thlist_for_each_entry_safe(blob, tmp, &old_array[i], hash_list)\n\t\t\tblob_table_insert_raw(table, blob);\n\tFREE(old_array);\n}\n\n/* Insert a blob descriptor into the blob table.  */\nvoid\nblob_table_insert(struct blob_table *table, struct blob_descriptor *blob)\n{\n\tblob_table_insert_raw(table, blob);\n\tif (table->num_blobs++ > table->mask)\n\t\tenlarge_blob_table(table);\n}\n\n/* Unlinks a blob descriptor from the blob table; does not free it.  */\nvoid\nblob_table_unlink(struct blob_table *table, struct blob_descriptor *blob)\n{\n\twimlib_assert(!blob->unhashed);\n\twimlib_assert(table->num_blobs != 0);\n\n\thlist_del(&blob->hash_list);\n\ttable->num_blobs--;\n}\n\n/* Given a SHA-1 message digest, return the corresponding blob descriptor from\n * the specified blob table, or NULL if there is none.  */\nstruct blob_descriptor *\nlookup_blob(const struct blob_table *table, const u8 *hash)\n{\n\tsize_t i;\n\tstruct blob_descriptor *blob;\n\n\ti = load_size_t_unaligned(hash) & table->mask;\n\thlist_for_each_entry(blob, &table->array[i], hash_list)\n\t\tif (hashes_equal(hash, blob->hash))\n\t\t\treturn blob;\n\treturn NULL;\n}\n\n/* Call a function on all blob descriptors in the specified blob table.  Stop\n * early and return nonzero if any call to the function returns nonzero.  */\nint\nfor_blob_in_table(struct blob_table *table,\n\t\t  int (*visitor)(struct blob_descriptor *, void *), void *arg)\n{\n\tstruct blob_descriptor *blob;\n\tstruct hlist_node *tmp;\n\tint ret;\n\n\tfor (size_t i = 0; i <= table->mask; i++) {\n\t\thlist_for_each_entry_safe(blob, tmp, &table->array[i],\n\t\t\t\t\t  hash_list)\n\t\t{\n\t\t\tret = visitor(blob, arg);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/*\n * This is a qsort() callback that sorts blobs into an order optimized for\n * reading.  Sorting is done primarily by blob location, then secondarily by a\n * location-dependent order.  For example, blobs in WIM resources are sorted\n * such that the underlying WIM files will be read sequentially.  This is\n * especially important for WIM files containing solid resources.\n */\nint\ncmp_blobs_by_sequential_order(const void *p1, const void *p2)\n{\n\tconst struct blob_descriptor *blob1, *blob2;\n\tint v;\n\tWIMStruct *wim1, *wim2;\n\n\tblob1 = *(const struct blob_descriptor**)p1;\n\tblob2 = *(const struct blob_descriptor**)p2;\n\n\tv = (int)blob1->blob_location - (int)blob2->blob_location;\n\n\t/* Different locations?  Note: \"unsafe compaction mode\" requires that\n\t * blobs in WIMs sort before all others.  For the logic here to ensure\n\t * this, BLOB_IN_WIM must have the lowest value among all defined\n\t * blob_locations.  Statically verify that the enum values haven't\n\t * changed.  */\n\tSTATIC_ASSERT(BLOB_NONEXISTENT == 0 && BLOB_IN_WIM == 1);\n\tif (v)\n\t\treturn v;\n\n\tswitch (blob1->blob_location) {\n\tcase BLOB_IN_WIM:\n\t\twim1 = blob1->rdesc->wim;\n\t\twim2 = blob2->rdesc->wim;\n\n\t\t/* Different WIM files?  */\n\t\tif (wim1 != wim2) {\n\n\t\t\t/* Resources from the WIM file currently being compacted\n\t\t\t * (if any) must always sort first.  */\n\t\t\tv = (int)wim2->being_compacted - (int)wim1->being_compacted;\n\t\t\tif (v)\n\t\t\t\treturn v;\n\n\t\t\t/* Different split WIMs?  */\n\t\t\tv = cmp_guids(wim1->hdr.guid, wim2->hdr.guid);\n\t\t\tif (v)\n\t\t\t\treturn v;\n\n\t\t\t/* Different part numbers in the same split WIM?  */\n\t\t\tv = (int)wim1->hdr.part_number - (int)wim2->hdr.part_number;\n\t\t\tif (v)\n\t\t\t\treturn v;\n\n\t\t\t/* Probably two WIMStructs for the same on-disk file.\n\t\t\t * Just sort by pointer.  */\n\t\t\treturn wim1 < wim2 ? -1 : 1;\n\t\t}\n\n\t\t/* Same WIM file  */\n\n\t\t/* Sort by increasing resource offset  */\n\t\tif (blob1->rdesc->offset_in_wim != blob2->rdesc->offset_in_wim)\n\t\t\treturn cmp_u64(blob1->rdesc->offset_in_wim,\n\t\t\t\t       blob2->rdesc->offset_in_wim);\n\n\t\t/* The blobs are in the same solid resource.  Sort by increasing\n\t\t * offset in the resource.  */\n\t\treturn cmp_u64(blob1->offset_in_res, blob2->offset_in_res);\n\n\tcase BLOB_IN_FILE_ON_DISK:\n#ifdef WITH_FUSE\n\tcase BLOB_IN_STAGING_FILE:\n#endif\n\t\t/* Compare files by path: just a heuristic that will place files\n\t\t * in the same directory next to each other.  */\n\t\treturn tstrcmp(blob1->file_on_disk, blob2->file_on_disk);\n#ifdef _WIN32\n\tcase BLOB_IN_WINDOWS_FILE:\n\t\treturn cmp_windows_files(blob1->windows_file, blob2->windows_file);\n#endif\n#ifdef WITH_NTFS_3G\n\tcase BLOB_IN_NTFS_VOLUME:\n\t\treturn cmp_ntfs_locations(blob1->ntfs_loc, blob2->ntfs_loc);\n#endif\n\tdefault:\n\t\t/* No additional sorting order defined for this resource\n\t\t * location (e.g. BLOB_IN_ATTACHED_BUFFER); simply compare\n\t\t * everything equal to each other.  */\n\t\treturn 0;\n\t}\n}\n\nint\nsort_blob_list(struct list_head *blob_list, size_t list_head_offset,\n\t       int (*compar)(const void *, const void*))\n{\n\tstruct list_head *cur;\n\tstruct blob_descriptor **array;\n\tsize_t i;\n\tsize_t array_size;\n\tsize_t num_blobs = 0;\n\n\tlist_for_each(cur, blob_list)\n\t\tnum_blobs++;\n\n\tif (num_blobs <= 1)\n\t\treturn 0;\n\n\tarray_size = num_blobs * sizeof(array[0]);\n\tarray = MALLOC(array_size);\n\tif (array == NULL)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\tcur = blob_list->next;\n\tfor (i = 0; i < num_blobs; i++) {\n\t\tarray[i] = (struct blob_descriptor*)((u8*)cur - list_head_offset);\n\t\tcur = cur->next;\n\t}\n\n\tqsort(array, num_blobs, sizeof(array[0]), compar);\n\n\tINIT_LIST_HEAD(blob_list);\n\tfor (i = 0; i < num_blobs; i++) {\n\t\tlist_add_tail((struct list_head*)\n\t\t\t       ((u8*)array[i] + list_head_offset), blob_list);\n\t}\n\tFREE(array);\n\treturn 0;\n}\n\n/* Sort the specified list of blobs in an order optimized for sequential\n * reading.  */\nint\nsort_blob_list_by_sequential_order(struct list_head *blob_list,\n\t\t\t\t   size_t list_head_offset)\n{\n\treturn sort_blob_list(blob_list, list_head_offset,\n\t\t\t      cmp_blobs_by_sequential_order);\n}\n\nstatic int\nadd_blob_to_array(struct blob_descriptor *blob, void *_pp)\n{\n\tstruct blob_descriptor ***pp = _pp;\n\t*(*pp)++ = blob;\n\treturn 0;\n}\n\n/* Iterate through the blob descriptors in the specified blob table in an order\n * optimized for sequential reading.  */\nint\nfor_blob_in_table_sorted_by_sequential_order(struct blob_table *table,\n\t\t\t\t\t     int (*visitor)(struct blob_descriptor *, void *),\n\t\t\t\t\t     void *arg)\n{\n\tstruct blob_descriptor **blob_array, **p;\n\tsize_t num_blobs = table->num_blobs;\n\tint ret;\n\n\tblob_array = MALLOC(num_blobs * sizeof(blob_array[0]));\n\tif (!blob_array)\n\t\treturn WIMLIB_ERR_NOMEM;\n\tp = blob_array;\n\tfor_blob_in_table(table, add_blob_to_array, &p);\n\n\twimlib_assert(p == blob_array + num_blobs);\n\n\tqsort(blob_array, num_blobs, sizeof(blob_array[0]),\n\t      cmp_blobs_by_sequential_order);\n\tret = 0;\n\tfor (size_t i = 0; i < num_blobs; i++) {\n\t\tret = visitor(blob_array[i], arg);\n\t\tif (ret)\n\t\t\tbreak;\n\t}\n\tFREE(blob_array);\n\treturn ret;\n}\n\n/* On-disk format of a blob descriptor in a WIM file.\n *\n * Note: if the WIM file contains solid resource(s), then this structure is\n * sometimes overloaded to describe a \"resource\" rather than a \"blob\".  See the\n * code for details.  */\nPRAGMA_BEGIN_PACKED\nstruct blob_descriptor_disk {\n\n\t/* Size, offset, and flags of the blob.  */\n\tstruct wim_reshdr_disk reshdr;\n\n\t/* Which part of the split WIM this blob is in; indexed from 1. */\n\tle16 part_number;\n\n\t/* Reference count of this blob over all WIM images.  (But see comment\n\t * above blob_decrement_refcnt().)  */\n\tle32 refcnt;\n\n\t/* SHA-1 message digest of the uncompressed data of this blob, or all\n\t * zeroes if this blob is of zero length.  */\n\tu8 hash[SHA1_HASH_SIZE];\n} __attribute__((packed));\nPRAGMA_END_PACKED\n\n/* Given a nonempty run of consecutive blob descriptors with the SOLID flag set,\n * count how many specify resources (as opposed to blobs within those\n * resources).\n *\n * Returns the resulting count.  */\nstatic size_t\ncount_solid_resources(const struct blob_descriptor_disk *entries, size_t max)\n{\n\tsize_t count = 0;\n\tdo {\n\t\tstruct wim_reshdr reshdr;\n\n\t\tget_wim_reshdr(&(entries++)->reshdr, &reshdr);\n\n\t\tif (!(reshdr.flags & WIM_RESHDR_FLAG_SOLID)) {\n\t\t\t/* Run was terminated by a stand-alone blob entry.  */\n\t\t\tbreak;\n\t\t}\n\n\t\tif (reshdr.uncompressed_size == SOLID_RESOURCE_MAGIC_NUMBER) {\n\t\t\t/* This is a resource entry.  */\n\t\t\tcount++;\n\t\t}\n\t} while (--max);\n\treturn count;\n}\n\n/*\n * Given a run of consecutive blob descriptors with the SOLID flag set and\n * having @num_rdescs resource entries, load resource information from them into\n * the resource descriptors in the @rdescs array.\n *\n * Returns 0 on success, or a nonzero error code on failure.\n */\nstatic int\ndo_load_solid_info(WIMStruct *wim, struct wim_resource_descriptor **rdescs,\n\t\t   size_t num_rdescs,\n\t\t   const struct blob_descriptor_disk *entries)\n{\n\tfor (size_t i = 0; i < num_rdescs; i++) {\n\t\tstruct wim_reshdr reshdr;\n\t\tstruct alt_chunk_table_header_disk hdr;\n\t\tstruct wim_resource_descriptor *rdesc;\n\t\tint ret;\n\n\t\t/* Advance to next resource entry.  */\n\n\t\tdo {\n\t\t\tget_wim_reshdr(&(entries++)->reshdr, &reshdr);\n\t\t} while (reshdr.uncompressed_size != SOLID_RESOURCE_MAGIC_NUMBER);\n\n\t\trdesc = rdescs[i];\n\n\t\twim_reshdr_to_desc(&reshdr, wim, rdesc);\n\n\t\t/* For solid resources, the uncompressed size, compression type,\n\t\t * and chunk size are stored in the resource itself, not in the\n\t\t * blob table.  */\n\n\t\tret = full_pread(&wim->in_fd, &hdr,\n\t\t\t\t sizeof(hdr), reshdr.offset_in_wim);\n\t\tif (ret) {\n\t\t\tERROR(\"Failed to read header of solid resource \"\n\t\t\t      \"(offset_in_wim=%\"PRIu64\")\",\n\t\t\t      reshdr.offset_in_wim);\n\t\t\treturn ret;\n\t\t}\n\n\t\trdesc->uncompressed_size = le64_to_cpu(hdr.res_usize);\n\n\t\t/* Compression format numbers must be the same as in\n\t\t * WIMGAPI to be compatible here.  */\n\t\tSTATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_NONE == 0);\n\t\tSTATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_XPRESS == 1);\n\t\tSTATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_LZX == 2);\n\t\tSTATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_LZMS == 3);\n\t\trdesc->compression_type = le32_to_cpu(hdr.compression_format);\n\t\trdesc->chunk_size = le32_to_cpu(hdr.chunk_size);\n\t}\n\treturn 0;\n}\n\n/*\n * Given a nonempty run of consecutive blob descriptors with the SOLID flag set,\n * allocate a 'struct wim_resource_descriptor' for each resource within that\n * run.\n *\n * Returns 0 on success, or a nonzero error code on failure.\n * Returns the pointers and count in *rdescs_ret and *num_rdescs_ret.\n */\nstatic int\nload_solid_info(WIMStruct *wim,\n\t\tconst struct blob_descriptor_disk *entries,\n\t\tsize_t num_remaining_entries,\n\t\tstruct wim_resource_descriptor ***rdescs_ret,\n\t\tsize_t *num_rdescs_ret)\n{\n\tsize_t num_rdescs;\n\tstruct wim_resource_descriptor **rdescs;\n\tsize_t i;\n\tint ret;\n\n\tnum_rdescs = count_solid_resources(entries, num_remaining_entries);\n\trdescs = CALLOC(num_rdescs, sizeof(rdescs[0]));\n\tif (!rdescs)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\tfor (i = 0; i < num_rdescs; i++) {\n\t\trdescs[i] = MALLOC(sizeof(struct wim_resource_descriptor));\n\t\tif (!rdescs[i]) {\n\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\tgoto out_free_rdescs;\n\t\t}\n\t}\n\n\tret = do_load_solid_info(wim, rdescs, num_rdescs, entries);\n\tif (ret)\n\t\tgoto out_free_rdescs;\n\n\twim->refcnt += num_rdescs;\n\n\t*rdescs_ret = rdescs;\n\t*num_rdescs_ret = num_rdescs;\n\treturn 0;\n\nout_free_rdescs:\n\tfor (i = 0; i < num_rdescs; i++)\n\t\tFREE(rdescs[i]);\n\tFREE(rdescs);\n\treturn ret;\n}\n\n/* Given a 'struct blob_descriptor' allocated for an on-disk blob descriptor\n * with the SOLID flag set, try to assign it to resource in the current solid\n * run.  */\nstatic int\nassign_blob_to_solid_resource(const struct wim_reshdr *reshdr,\n\t\t\t      struct blob_descriptor *blob,\n\t\t\t      struct wim_resource_descriptor **rdescs,\n\t\t\t      size_t num_rdescs)\n{\n\tu64 offset = reshdr->offset_in_wim;\n\n\t/* XXX: This linear search will be slow in the degenerate case where the\n\t * number of solid resources in the run is huge.  */\n\tblob->size = reshdr->size_in_wim;\n\tfor (size_t i = 0; i < num_rdescs; i++) {\n\t\tif (offset + blob->size <= rdescs[i]->uncompressed_size) {\n\t\t\tblob_set_is_located_in_wim_resource(blob, rdescs[i], offset);\n\t\t\treturn 0;\n\t\t}\n\t\toffset -= rdescs[i]->uncompressed_size;\n\t}\n\tERROR(\"blob could not be assigned to a solid resource\");\n\treturn WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY;\n}\n\nstatic void\nfree_solid_rdescs(struct wim_resource_descriptor **rdescs, size_t num_rdescs)\n{\n\tif (rdescs) {\n\t\tfor (size_t i = 0; i < num_rdescs; i++) {\n\t\t\tif (list_empty(&rdescs[i]->blob_list)) {\n\t\t\t\trdescs[i]->wim->refcnt--;\n\t\t\t\tFREE(rdescs[i]);\n\t\t\t}\n\t\t}\n\t\tFREE(rdescs);\n\t}\n}\n\nstatic int\ncmp_blobs_by_offset_in_res(const void *p1, const void *p2)\n{\n\tconst struct blob_descriptor *blob1, *blob2;\n\n\tblob1 = *(const struct blob_descriptor**)p1;\n\tblob2 = *(const struct blob_descriptor**)p2;\n\n\treturn cmp_u64(blob1->offset_in_res, blob2->offset_in_res);\n}\n\n/* Validate the size and location of a WIM resource.  */\nstatic int\nvalidate_resource(struct wim_resource_descriptor *rdesc)\n{\n\tstruct blob_descriptor *blob;\n\tbool out_of_order;\n\tu64 expected_next_offset;\n\tint ret;\n\n\t/* Verify that the resource itself has a valid offset and size.  */\n\tif (rdesc->offset_in_wim + rdesc->size_in_wim < rdesc->size_in_wim)\n\t\tgoto invalid_due_to_overflow;\n\n\t/* Verify that each blob in the resource has a valid offset and size.\n\t */\n\texpected_next_offset = 0;\n\tout_of_order = false;\n\tlist_for_each_entry(blob, &rdesc->blob_list, rdesc_node) {\n\t\tif (blob->offset_in_res + blob->size < blob->size ||\n\t\t    blob->offset_in_res + blob->size > rdesc->uncompressed_size)\n\t\t\tgoto invalid_due_to_overflow;\n\n\t\tif (blob->offset_in_res >= expected_next_offset)\n\t\t\texpected_next_offset = blob->offset_in_res + blob->size;\n\t\telse\n\t\t\tout_of_order = true;\n\t}\n\n\t/* If the blobs were not located at strictly increasing positions (not\n\t * allowing for overlap), sort them.  Then make sure that none overlap.\n\t */\n\tif (out_of_order) {\n\t\tret = sort_blob_list(&rdesc->blob_list,\n\t\t\t\t     offsetof(struct blob_descriptor,\n\t\t\t\t\t      rdesc_node),\n\t\t\t\t     cmp_blobs_by_offset_in_res);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\texpected_next_offset = 0;\n\t\tlist_for_each_entry(blob, &rdesc->blob_list, rdesc_node) {\n\t\t\tif (blob->offset_in_res >= expected_next_offset)\n\t\t\t\texpected_next_offset = blob->offset_in_res + blob->size;\n\t\t\telse\n\t\t\t\tgoto invalid_due_to_overlap;\n\t\t}\n\t}\n\n\treturn 0;\n\ninvalid_due_to_overflow:\n\tERROR(\"Invalid blob table (offset overflow)\");\n\treturn WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY;\n\ninvalid_due_to_overlap:\n\tERROR(\"Invalid blob table (blobs in solid resource overlap)\");\n\treturn WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY;\n}\n\nstatic int\nfinish_solid_rdescs(struct wim_resource_descriptor **rdescs, size_t num_rdescs)\n{\n\tint ret = 0;\n\tfor (size_t i = 0; i < num_rdescs; i++) {\n\t\tret = validate_resource(rdescs[i]);\n\t\tif (ret)\n\t\t\tbreak;\n\t}\n\tfree_solid_rdescs(rdescs, num_rdescs);\n\treturn ret;\n}\n\n/*\n * read_blob_table() -\n *\n * Read the blob table from a WIM file.  Usually, each entry in this table\n * describes a \"blob\", or equivalently a \"resource\", that the WIM file contains,\n * along with its location and SHA-1 message digest.  Descriptors for\n * non-metadata blobs will be saved in the in-memory blob table\n * (wim->blob_table), whereas descriptors for metadata blobs will be saved in a\n * special location per-image (the wim->image_metadata array).\n *\n * However, in WIM_VERSION_SOLID (3584) WIMs, a resource may contain multiple\n * blobs that are compressed together.  Such a resource is called a \"solid\n * resource\".  Solid resources are still described in the on-disk \"blob table\",\n * although the format is not the most logical.  A consecutive sequence of\n * entries that all have flag WIM_RESHDR_FLAG_SOLID (0x10) set is a \"solid run\".\n * A solid run describes a set of solid resources, each of which contains a set\n * of blobs.  In a solid run, a 'struct wim_reshdr_disk' with 'uncompressed_size\n * = SOLID_RESOURCE_MAGIC_NUMBER (0x100000000)' specifies a solid resource,\n * whereas any other 'struct wim_reshdr_disk' specifies a blob within a solid\n * resource.  There are some oddities in how we need to determine which solid\n * resource a blob is actually in; see the code for details.\n *\n * Possible return values:\n *\tWIMLIB_ERR_SUCCESS (0)\n *\tWIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY\n *\tWIMLIB_ERR_NOMEM\n *\n *\tOr an error code caused by failure to read the blob table from the WIM\n *\tfile.\n */\nint\nread_blob_table(WIMStruct *wim)\n{\n\tint ret;\n\tsize_t num_entries;\n\tvoid *buf = NULL;\n\tstruct blob_table *table = NULL;\n\tstruct blob_descriptor *cur_blob = NULL;\n\tsize_t num_duplicate_blobs = 0;\n\tsize_t num_empty_blobs = 0;\n\tsize_t num_wrong_part_blobs = 0;\n\tu32 image_index = 0;\n\tstruct wim_resource_descriptor **cur_solid_rdescs = NULL;\n\tsize_t cur_num_solid_rdescs = 0;\n\n\t/* Calculate the number of entries in the blob table.  */\n\tnum_entries = wim->hdr.blob_table_reshdr.uncompressed_size /\n\t\t      sizeof(struct blob_descriptor_disk);\n\n\t/* Read the blob table into a buffer.  */\n\tret = wim_reshdr_to_data(&wim->hdr.blob_table_reshdr, wim, &buf);\n\tif (ret)\n\t\tgoto out;\n\n\t/* Allocate a hash table to map SHA-1 message digests into blob\n\t * descriptors.  This is the in-memory \"blob table\".  */\n\ttable = new_blob_table(num_entries);\n\tif (!table)\n\t\tgoto oom;\n\n\t/* Allocate and initialize blob descriptors from the raw blob table\n\t * buffer.  */\n\tfor (size_t i = 0; i < num_entries; i++) {\n\t\tconst struct blob_descriptor_disk *disk_entry =\n\t\t\t&((const struct blob_descriptor_disk*)buf)[i];\n\t\tstruct wim_reshdr reshdr;\n\t\tu16 part_number;\n\n\t\t/* Get the resource header  */\n\t\tget_wim_reshdr(&disk_entry->reshdr, &reshdr);\n\n\t\t/* Ignore SOLID flag if it isn't supposed to be used in this WIM\n\t\t * version.  */\n\t\tif (wim->hdr.wim_version == WIM_VERSION_DEFAULT)\n\t\t\treshdr.flags &= ~WIM_RESHDR_FLAG_SOLID;\n\n\t\t/* Allocate a new 'struct blob_descriptor'.  */\n\t\tcur_blob = new_blob_descriptor();\n\t\tif (!cur_blob)\n\t\t\tgoto oom;\n\n\t\t/* Get the part number, reference count, and hash.  */\n\t\tpart_number = le16_to_cpu(disk_entry->part_number);\n\t\tcur_blob->refcnt = le32_to_cpu(disk_entry->refcnt);\n\t\tcopy_hash(cur_blob->hash, disk_entry->hash);\n\n\t\tif (reshdr.flags & WIM_RESHDR_FLAG_SOLID) {\n\n\t\t\t/* SOLID entry  */\n\n\t\t\tif (!cur_solid_rdescs) {\n\t\t\t\t/* Starting new run  */\n\t\t\t\tret = load_solid_info(wim, disk_entry,\n\t\t\t\t\t\t      num_entries - i,\n\t\t\t\t\t\t      &cur_solid_rdescs,\n\t\t\t\t\t\t      &cur_num_solid_rdescs);\n\t\t\t\tif (ret)\n\t\t\t\t\tgoto out;\n\t\t\t}\n\n\t\t\tif (reshdr.uncompressed_size == SOLID_RESOURCE_MAGIC_NUMBER) {\n\t\t\t\t/* Resource entry, not blob entry  */\n\t\t\t\tgoto free_cur_blob_and_continue;\n\t\t\t}\n\n\t\t\t/* Blob entry  */\n\n\t\t\tret = assign_blob_to_solid_resource(&reshdr,\n\t\t\t\t\t\t\t    cur_blob,\n\t\t\t\t\t\t\t    cur_solid_rdescs,\n\t\t\t\t\t\t\t    cur_num_solid_rdescs);\n\t\t\tif (ret)\n\t\t\t\tgoto out;\n\n\t\t} else {\n\t\t\t/* Normal blob/resource entry; SOLID not set.  */\n\n\t\t\tstruct wim_resource_descriptor *rdesc;\n\n\t\t\tif (unlikely(cur_solid_rdescs)) {\n\t\t\t\t/* This entry terminated a solid run.  */\n\t\t\t\tret = finish_solid_rdescs(cur_solid_rdescs,\n\t\t\t\t\t\t\t  cur_num_solid_rdescs);\n\t\t\t\tcur_solid_rdescs = NULL;\n\t\t\t\tif (ret)\n\t\t\t\t\tgoto out;\n\t\t\t}\n\n\t\t\tif (unlikely(!(reshdr.flags & WIM_RESHDR_FLAG_COMPRESSED) &&\n\t\t\t\t     (reshdr.size_in_wim != reshdr.uncompressed_size)))\n\t\t\t{\n\t\t\t\tERROR(\"Uncompressed resource has \"\n\t\t\t\t      \"size_in_wim != uncompressed_size\");\n\t\t\t\tret = WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY;\n\t\t\t\tgoto out;\n\t\t\t}\n\n\t\t\t/* Set up a resource descriptor for this blob.  */\n\n\t\t\trdesc = MALLOC(sizeof(struct wim_resource_descriptor));\n\t\t\tif (!rdesc)\n\t\t\t\tgoto oom;\n\n\t\t\twim_reshdr_to_desc_and_blob(&reshdr, wim, rdesc, cur_blob);\n\t\t\twim->refcnt++;\n\t\t}\n\n\t\t/* cur_blob is now a blob bound to a resource.  */\n\n\t\t/* Ignore entries with all zeroes in the hash field.  */\n\t\tif (unlikely(is_zero_hash(cur_blob->hash)))\n\t\t\tgoto free_cur_blob_and_continue;\n\n\t\t/* Verify that the blob has nonzero size.  */\n\t\tif (unlikely(cur_blob->size == 0)) {\n\t\t\tnum_empty_blobs++;\n\t\t\tgoto free_cur_blob_and_continue;\n\t\t}\n\n\t\t/* Verify that the part number matches that of the underlying\n\t\t * WIM file.  */\n\t\tif (unlikely(part_number != wim->hdr.part_number)) {\n\t\t\tnum_wrong_part_blobs++;\n\t\t\tgoto free_cur_blob_and_continue;\n\t\t}\n\n\t\tif (reshdr.flags & WIM_RESHDR_FLAG_METADATA) {\n\t\t\t/* Blob table entry for a metadata resource.  */\n\n\t\t\t/* Metadata entries with no references must be ignored.\n\t\t\t * See, for example, the WinPE WIMs from the WAIK v2.1.\n\t\t\t */\n\t\t\tif (cur_blob->refcnt == 0)\n\t\t\t\tgoto free_cur_blob_and_continue;\n\n\t\t\tif (cur_blob->refcnt != 1) {\n\t\t\t\t/* We don't currently support this case due to\n\t\t\t\t * the complications of multiple images sharing\n\t\t\t\t * the same metadata resource or a metadata\n\t\t\t\t * resource also being referenced by files.  */\n\t\t\t\tERROR(\"Found metadata resource with refcnt != 1\");\n\t\t\t\tret = WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY;\n\t\t\t\tgoto out;\n\t\t\t}\n\n\t\t\tif (reshdr.flags & WIM_RESHDR_FLAG_SOLID) {\n\t\t\t\tERROR(\"Image metadata in solid resources \"\n\t\t\t\t      \"is unsupported.\");\n\t\t\t\tret = WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY;\n\t\t\t\tgoto out;\n\t\t\t}\n\n\t\t\tif (wim->hdr.part_number != 1) {\n\t\t\t\tWARNING(\"Ignoring metadata resource found in a \"\n\t\t\t\t\t\"non-first part of the split WIM\");\n\t\t\t\tgoto free_cur_blob_and_continue;\n\t\t\t}\n\n\t\t\t/* The number of entries in the blob table with\n\t\t\t * WIM_RESHDR_FLAG_METADATA set should be the same as\n\t\t\t * the image_count field in the WIM header.  */\n\t\t\tif (image_index == wim->hdr.image_count) {\n\t\t\t\tWARNING(\"Found more metadata resources than images\");\n\t\t\t\tgoto free_cur_blob_and_continue;\n\t\t\t}\n\n\t\t\t/* Notice very carefully:  We are assigning the metadata\n\t\t\t * resources to images in the same order in which their\n\t\t\t * blob table entries occur on disk.  (This is also the\n\t\t\t * behavior of Microsoft's software.)  In particular,\n\t\t\t * this overrides the actual locations of the metadata\n\t\t\t * resources themselves in the WIM file as well as any\n\t\t\t * information written in the XML data.  */\n\t\t\twim->image_metadata[image_index] = new_unloaded_image_metadata(cur_blob);\n\t\t\tif (!wim->image_metadata[image_index])\n\t\t\t\tgoto oom;\n\t\t\timage_index++;\n\t\t} else {\n\t\t\t/* Blob table entry for a non-metadata blob.  */\n\n\t\t\t/* Ignore this blob if it's a duplicate.  */\n\t\t\tif (lookup_blob(table, cur_blob->hash)) {\n\t\t\t\tnum_duplicate_blobs++;\n\t\t\t\tgoto free_cur_blob_and_continue;\n\t\t\t}\n\n\t\t\t/* Insert the blob into the in-memory blob table, keyed\n\t\t\t * by its SHA-1 message digest.  */\n\t\t\tblob_table_insert(table, cur_blob);\n\t\t}\n\n\t\tcontinue;\n\n\tfree_cur_blob_and_continue:\n\t\tif (cur_solid_rdescs &&\n\t\t    cur_blob->blob_location == BLOB_IN_WIM)\n\t\t\tblob_unset_is_located_in_wim_resource(cur_blob);\n\t\tfree_blob_descriptor(cur_blob);\n\t}\n\tcur_blob = NULL;\n\n\tif (cur_solid_rdescs) {\n\t\t/* End of blob table terminated a solid run.  */\n\t\tret = finish_solid_rdescs(cur_solid_rdescs, cur_num_solid_rdescs);\n\t\tcur_solid_rdescs = NULL;\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\n\tif (wim->hdr.part_number == 1 && image_index != wim->hdr.image_count) {\n\t\tWARNING(\"Could not find metadata resources for all images\");\n\t\twim->hdr.image_count = image_index;\n\t}\n\n\tif (num_duplicate_blobs > 0)\n\t\tWARNING(\"Ignoring %zu duplicate blobs\", num_duplicate_blobs);\n\n\tif (num_empty_blobs > 0)\n\t\tWARNING(\"Ignoring %zu empty blobs\", num_empty_blobs);\n\n\tif (num_wrong_part_blobs > 0) {\n\t\tWARNING(\"Ignoring %zu blobs with wrong part number\",\n\t\t\tnum_wrong_part_blobs);\n\t}\n\n\twim->blob_table = table;\n\tret = 0;\n\tgoto out_free_buf;\n\noom:\n\tERROR(\"Not enough memory to read blob table!\");\n\tret = WIMLIB_ERR_NOMEM;\nout:\n\tfree_solid_rdescs(cur_solid_rdescs, cur_num_solid_rdescs);\n\tfree_blob_descriptor(cur_blob);\n\tfree_blob_table(table);\nout_free_buf:\n\tFREE(buf);\n\treturn ret;\n}\n\nstatic void\nwrite_blob_descriptor(struct blob_descriptor_disk *disk_entry,\n\t\t      const struct wim_reshdr *out_reshdr,\n\t\t      u16 part_number, u32 refcnt, const u8 *hash)\n{\n\tput_wim_reshdr(out_reshdr, &disk_entry->reshdr);\n\tdisk_entry->part_number = cpu_to_le16(part_number);\n\tdisk_entry->refcnt = cpu_to_le32(refcnt);\n\tcopy_hash(disk_entry->hash, hash);\n}\n\n/* Note: the list of blob descriptors must be sorted so that all entries for the\n * same solid resource are consecutive.  In addition, blob descriptors for\n * metadata resources must be in the same order as the indices of the underlying\n * images.  */\nint\nwrite_blob_table_from_blob_list(struct list_head *blob_list,\n\t\t\t\tstruct filedes *out_fd,\n\t\t\t\tu16 part_number,\n\t\t\t\tstruct wim_reshdr *out_reshdr,\n\t\t\t\tint write_resource_flags)\n{\n\tsize_t table_size;\n\tstruct blob_descriptor *blob;\n\tstruct blob_descriptor_disk *table_buf;\n\tstruct blob_descriptor_disk *table_buf_ptr;\n\tint ret;\n\tu64 prev_res_offset_in_wim = ~0ULL;\n\tu64 prev_uncompressed_size;\n\tu64 logical_offset;\n\n\ttable_size = 0;\n\tlist_for_each_entry(blob, blob_list, blob_table_list) {\n\t\ttable_size += sizeof(struct blob_descriptor_disk);\n\n\t\tif (blob->out_reshdr.flags & WIM_RESHDR_FLAG_SOLID &&\n\t\t    blob->out_res_offset_in_wim != prev_res_offset_in_wim)\n\t\t{\n\t\t\ttable_size += sizeof(struct blob_descriptor_disk);\n\t\t\tprev_res_offset_in_wim = blob->out_res_offset_in_wim;\n\t\t}\n\t}\n\n\ttable_buf = MALLOC(table_size);\n\tif (table_buf == NULL) {\n\t\tERROR(\"Failed to allocate %zu bytes for temporary blob table\",\n\t\t      table_size);\n\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\ttable_buf_ptr = table_buf;\n\n\tprev_res_offset_in_wim = ~0ULL;\n\tprev_uncompressed_size = 0;\n\tlogical_offset = 0;\n\tlist_for_each_entry(blob, blob_list, blob_table_list) {\n\t\tif (blob->out_reshdr.flags & WIM_RESHDR_FLAG_SOLID) {\n\t\t\tstruct wim_reshdr tmp_reshdr = { 0 };\n\n\t\t\t/* Eww.  When WIMGAPI sees multiple solid resources, it\n\t\t\t * expects the offsets to be adjusted as if there were\n\t\t\t * really only one solid resource.  */\n\n\t\t\tif (blob->out_res_offset_in_wim != prev_res_offset_in_wim) {\n\t\t\t\t/* Put the resource entry for solid resource  */\n\t\t\t\ttmp_reshdr.offset_in_wim = blob->out_res_offset_in_wim;\n\t\t\t\ttmp_reshdr.size_in_wim = blob->out_res_size_in_wim;\n\t\t\t\ttmp_reshdr.uncompressed_size = SOLID_RESOURCE_MAGIC_NUMBER;\n\t\t\t\ttmp_reshdr.flags = WIM_RESHDR_FLAG_SOLID;\n\n\t\t\t\twrite_blob_descriptor(table_buf_ptr++, &tmp_reshdr,\n\t\t\t\t\t\t      part_number, 1, zero_hash);\n\n\t\t\t\tlogical_offset += prev_uncompressed_size;\n\n\t\t\t\tprev_res_offset_in_wim = blob->out_res_offset_in_wim;\n\t\t\t\tprev_uncompressed_size = blob->out_res_uncompressed_size;\n\t\t\t}\n\t\t\ttmp_reshdr = blob->out_reshdr;\n\t\t\ttmp_reshdr.offset_in_wim += logical_offset;\n\t\t\twrite_blob_descriptor(table_buf_ptr++, &tmp_reshdr,\n\t\t\t\t\t      part_number, blob->out_refcnt, blob->hash);\n\t\t} else {\n\t\t\twrite_blob_descriptor(table_buf_ptr++, &blob->out_reshdr,\n\t\t\t\t\t      part_number, blob->out_refcnt, blob->hash);\n\t\t}\n\n\t}\n\twimlib_assert((u8*)table_buf_ptr - (u8*)table_buf == table_size);\n\n\t/* Write the blob table uncompressed.  Although wimlib can handle a\n\t * compressed blob table, MS software cannot.  */\n\tret = write_wim_resource_from_buffer(table_buf,\n\t\t\t\t\t     table_size,\n\t\t\t\t\t     true,\n\t\t\t\t\t     out_fd,\n\t\t\t\t\t     WIMLIB_COMPRESSION_TYPE_NONE,\n\t\t\t\t\t     0,\n\t\t\t\t\t     out_reshdr,\n\t\t\t\t\t     NULL,\n\t\t\t\t\t     write_resource_flags);\n\tFREE(table_buf);\n\treturn ret;\n}\n\n/* Allocate a blob descriptor for the contents of the buffer, or re-use an\n * existing descriptor in @blob_table for an identical blob.  */\nstruct blob_descriptor *\nnew_blob_from_data_buffer(const void *buffer, size_t size,\n\t\t\t  struct blob_table *blob_table)\n{\n\tu8 hash[SHA1_HASH_SIZE];\n\tstruct blob_descriptor *blob;\n\tvoid *buffer_copy;\n\n\tsha1(buffer, size, hash);\n\n\tblob = lookup_blob(blob_table, hash);\n\tif (blob)\n\t\treturn blob;\n\n\tblob = new_blob_descriptor();\n\tif (!blob)\n\t\treturn NULL;\n\n\tbuffer_copy = memdup(buffer, size);\n\tif (!buffer_copy) {\n\t\tfree_blob_descriptor(blob);\n\t\treturn NULL;\n\t}\n\tblob_set_is_located_in_attached_buffer(blob, buffer_copy, size);\n\tcopy_hash(blob->hash, hash);\n\tblob_table_insert(blob_table, blob);\n\treturn blob;\n}\n\nstruct blob_descriptor *\nafter_blob_hashed(struct blob_descriptor *blob,\n\t\t  struct blob_descriptor **back_ptr,\n\t\t  struct blob_table *blob_table, struct wim_inode *inode)\n{\n\tstruct blob_descriptor *duplicate_blob;\n\n\tlist_del(&blob->unhashed_list);\n\tblob->unhashed = 0;\n\n\t/* Look for a duplicate blob  */\n\tduplicate_blob = lookup_blob(blob_table, blob->hash);\n\tif (duplicate_blob) {\n\t\t/* We have a duplicate blob.  Transfer the reference counts from\n\t\t * this blob to the duplicate and update the reference to this\n\t\t * blob (from a stream) to point to the duplicate.  The caller\n\t\t * is responsible for freeing @blob if needed.  */\n\t\tif (duplicate_blob->size != blob->size) {\n\t\t\ttchar hash_str[SHA1_HASH_STRING_LEN];\n\n\t\t\tsprint_hash(blob->hash, hash_str);\n\t\t\tWARNING(\"SHA-1 collision at \\\"%\"TS\"\\\"\\n\"\n\t\t\t\t\"          (hash=%\"TS\", size=%\"PRIu64\", other_size=%\"PRIu64\").\\n\"\n\t\t\t\t\"          File will be corrupted!\",\n\t\t\t\tinode_any_full_path(inode), hash_str,\n\t\t\t\tblob->size, duplicate_blob->size);\n\t\t}\n\t\tduplicate_blob->refcnt += blob->refcnt;\n\t\tblob->refcnt = 0;\n\t\t*back_ptr = duplicate_blob;\n\t\treturn duplicate_blob;\n\t} else {\n\t\t/* No duplicate blob, so we need to insert this blob into the\n\t\t * blob table and treat it as a hashed blob.  */\n\t\tblob_table_insert(blob_table, blob);\n\t\treturn blob;\n\t}\n}\n\n/*\n * Calculate the SHA-1 message digest of a blob and move its descriptor from the\n * list of unhashed blobs to the blob table, possibly joining it with an\n * identical blob.\n *\n * @blob:\n *\tThe blob to hash\n * @blob_table:\n *\tThe blob table in which the blob needs to be indexed\n * @blob_ret:\n *\tOn success, a pointer to the resulting blob descriptor is written to\n *\tthis location.  This will be the same as @blob if it was inserted into\n *\tthe blob table, or different if a duplicate blob was found.\n *\n * Returns 0 on success; nonzero if there is an error reading the blob data.\n */\nint\nhash_unhashed_blob(struct blob_descriptor *blob, struct blob_table *blob_table,\n\t\t   struct blob_descriptor **blob_ret)\n{\n\tstruct blob_descriptor **back_ptr;\n\tstruct wim_inode *inode;\n\tint ret;\n\n\tback_ptr = retrieve_pointer_to_unhashed_blob(blob);\n\tinode = blob->back_inode;\n\n\tret = sha1_blob(blob);\n\tif (ret)\n\t\treturn ret;\n\n\t*blob_ret = after_blob_hashed(blob, back_ptr, blob_table, inode);\n\treturn 0;\n}\n\nvoid\nblob_to_wimlib_resource_entry(const struct blob_descriptor *blob,\n\t\t\t      struct wimlib_resource_entry *wentry)\n{\n\tmemset(wentry, 0, sizeof(*wentry));\n\n\twentry->uncompressed_size = blob->size;\n\tif (blob->blob_location == BLOB_IN_WIM) {\n\t\tunsigned res_flags = blob->rdesc->flags;\n\n\t\twentry->part_number = blob->rdesc->wim->hdr.part_number;\n\t\tif (res_flags & WIM_RESHDR_FLAG_SOLID) {\n\t\t\twentry->offset = blob->offset_in_res;\n\t\t} else {\n\t\t\twentry->compressed_size = blob->rdesc->size_in_wim;\n\t\t\twentry->offset = blob->rdesc->offset_in_wim;\n\t\t}\n\t\twentry->raw_resource_offset_in_wim = blob->rdesc->offset_in_wim;\n\t\twentry->raw_resource_compressed_size = blob->rdesc->size_in_wim;\n\t\twentry->raw_resource_uncompressed_size = blob->rdesc->uncompressed_size;\n\n\t\twentry->is_compressed = (res_flags & WIM_RESHDR_FLAG_COMPRESSED) != 0;\n\t\twentry->is_free = (res_flags & WIM_RESHDR_FLAG_FREE) != 0;\n\t\twentry->is_spanned = (res_flags & WIM_RESHDR_FLAG_SPANNED) != 0;\n\t\twentry->packed = (res_flags & WIM_RESHDR_FLAG_SOLID) != 0;\n\t}\n\tif (!blob->unhashed)\n\t\tcopy_hash(wentry->sha1_hash, blob->hash);\n\twentry->reference_count = blob->refcnt;\n\twentry->is_metadata = blob->is_metadata;\n}\n\nstruct iterate_blob_context {\n\twimlib_iterate_lookup_table_callback_t cb;\n\tvoid *user_ctx;\n};\n\nstatic int\ndo_iterate_blob(struct blob_descriptor *blob, void *_ctx)\n{\n\tstruct iterate_blob_context *ctx = _ctx;\n\tstruct wimlib_resource_entry entry;\n\n\tblob_to_wimlib_resource_entry(blob, &entry);\n\treturn (*ctx->cb)(&entry, ctx->user_ctx);\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_iterate_lookup_table(WIMStruct *wim, int flags,\n\t\t\t    wimlib_iterate_lookup_table_callback_t cb,\n\t\t\t    void *user_ctx)\n{\n\tif (flags != 0)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tstruct iterate_blob_context ctx = {\n\t\t.cb = cb,\n\t\t.user_ctx = user_ctx,\n\t};\n\tif (wim_has_metadata(wim)) {\n\t\tint ret;\n\t\tfor (int i = 0; i < wim->hdr.image_count; i++) {\n\t\t\tstruct blob_descriptor *blob;\n\t\t\tstruct wim_image_metadata *imd = wim->image_metadata[i];\n\n\t\t\tret = do_iterate_blob(imd->metadata_blob, &ctx);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\timage_for_each_unhashed_blob(blob, imd) {\n\t\t\t\tret = do_iterate_blob(blob, &ctx);\n\t\t\t\tif (ret)\n\t\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\t}\n\treturn for_blob_in_table(wim->blob_table, do_iterate_blob, &ctx);\n}\n"
  },
  {
    "path": "src/wimlib/compress.c",
    "content": "/*\n * compress.c\n *\n * Generic functions for compression, wrapping around actual compression\n * implementations.\n */\n\n/*\n * Copyright (C) 2013, 2014 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/compressor_ops.h\"\n#include \"wimlib/util.h\"\n\nstruct wimlib_compressor {\n\tconst struct compressor_ops *ops;\n\tvoid *private;\n\tenum wimlib_compression_type ctype;\n\tsize_t max_block_size;\n};\n\nstatic const struct compressor_ops * const compressor_ops[] = {\n\t[WIMLIB_COMPRESSION_TYPE_XPRESS] = &xpress_compressor_ops,\n\t[WIMLIB_COMPRESSION_TYPE_LZX]    = &lzx_compressor_ops,\n\t[WIMLIB_COMPRESSION_TYPE_LZMS]   = &lzms_compressor_ops,\n};\n\n/* Scale: 10 = low, 50 = medium, 100 = high */\n\n#define DEFAULT_COMPRESSION_LEVEL 50\n\nstatic unsigned int default_compression_levels[ARRAY_LEN(compressor_ops)];\n\nstatic bool\ncompressor_ctype_valid(int ctype)\n{\n\treturn (ctype >= 0 &&\n\t\tctype < ARRAY_LEN(compressor_ops) &&\n\t\tcompressor_ops[ctype] != NULL);\n}\n\nWIMLIBAPI int\nwimlib_set_default_compression_level(int ctype, unsigned int compression_level)\n{\n\tif (ctype == -1) {\n\t\tfor (int i = 0; i < ARRAY_LEN(default_compression_levels); i++)\n\t\t\tdefault_compression_levels[i] = compression_level;\n\t} else {\n\t\tif (!compressor_ctype_valid(ctype))\n\t\t\treturn WIMLIB_ERR_INVALID_COMPRESSION_TYPE;\n\n\t\tdefault_compression_levels[ctype] = compression_level;\n\t}\n\treturn 0;\n}\n\nWIMLIBAPI u64\nwimlib_get_compressor_needed_memory(enum wimlib_compression_type ctype,\n\t\t\t\t    size_t max_block_size,\n\t\t\t\t    unsigned int compression_level)\n{\n\tbool destructive;\n\tconst struct compressor_ops *ops;\n\tu64 size;\n\n\tdestructive = (compression_level & WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE);\n\tcompression_level &= ~WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE;\n\n\tif (!compressor_ctype_valid(ctype))\n\t\treturn 0;\n\n\tif (compression_level > 0xFFFFFF)\n\t\treturn 0;\n\n\tif (max_block_size == 0)\n\t\treturn 0;\n\n\tops = compressor_ops[ctype];\n\n\tif (compression_level == 0)\n\t\tcompression_level = default_compression_levels[ctype];\n\tif (compression_level == 0)\n\t\tcompression_level = DEFAULT_COMPRESSION_LEVEL;\n\n\tif (ops->get_needed_memory) {\n\t\tsize = ops->get_needed_memory(max_block_size, compression_level,\n\t\t\t\t\t      destructive);\n\n\t\t/* 0 is never valid and indicates an invalid max_block_size.  */\n\t\tif (size == 0)\n\t\t\treturn 0;\n\t} else {\n\t\tsize = 0;\n\t}\n\treturn size + sizeof(struct wimlib_compressor);\n}\n\nWIMLIBAPI int\nwimlib_create_compressor(enum wimlib_compression_type ctype,\n\t\t\t size_t max_block_size,\n\t\t\t unsigned int compression_level,\n\t\t\t struct wimlib_compressor **c_ret)\n{\n\tbool destructive;\n\tstruct wimlib_compressor *c;\n\tint ret;\n\n\tret = wimlib_global_init(0);\n\tif (ret)\n\t\treturn ret;\n\n\tdestructive = (compression_level & WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE);\n\tcompression_level &= ~WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE;\n\n\tif (!compressor_ctype_valid(ctype))\n\t\treturn WIMLIB_ERR_INVALID_COMPRESSION_TYPE;\n\n\tif (compression_level > 0xFFFFFF)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (c_ret == NULL)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (max_block_size == 0)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tc = MALLOC(sizeof(*c));\n\tif (c == NULL)\n\t\treturn WIMLIB_ERR_NOMEM;\n\tc->ops = compressor_ops[ctype];\n\tc->private = NULL;\n\tc->ctype = ctype;\n\tc->max_block_size = max_block_size;\n\tif (c->ops->create_compressor) {\n\t\tif (compression_level == 0)\n\t\t\tcompression_level = default_compression_levels[ctype];\n\t\tif (compression_level == 0)\n\t\t\tcompression_level = DEFAULT_COMPRESSION_LEVEL;\n\n\t\tret = c->ops->create_compressor(max_block_size,\n\t\t\t\t\t\tcompression_level,\n\t\t\t\t\t\tdestructive,\n\t\t\t\t\t\t&c->private);\n\t\tif (ret) {\n\t\t\tFREE(c);\n\t\t\treturn ret;\n\t\t}\n\t}\n\t*c_ret = c;\n\treturn 0;\n}\n\nWIMLIBAPI size_t\nwimlib_compress(const void *uncompressed_data, size_t uncompressed_size,\n\t\tvoid *compressed_data, size_t compressed_size_avail,\n\t\tstruct wimlib_compressor *c)\n{\n\tif (unlikely(uncompressed_size == 0 || uncompressed_size > c->max_block_size))\n\t\treturn 0;\n\n\treturn c->ops->compress(uncompressed_data, uncompressed_size,\n\t\t\t\tcompressed_data, compressed_size_avail,\n\t\t\t\tc->private);\n}\n\nWIMLIBAPI void\nwimlib_free_compressor(struct wimlib_compressor *c)\n{\n\tif (c) {\n\t\tif (c->ops->free_compressor)\n\t\t\tc->ops->free_compressor(c->private);\n\t\tFREE(c);\n\t}\n}\n"
  },
  {
    "path": "src/wimlib/compress_common.c",
    "content": "/*\n * compress_common.c\n *\n * Code for compression shared among multiple compression formats.\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <string.h>\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/compress_common.h\"\n#include \"wimlib/util.h\"\n\n/*\n * Given the binary tree node A[subtree_idx] whose children already satisfy the\n * maxheap property, swap the node with its greater child until it is greater\n * than or equal to both of its children, so that the maxheap property is\n * satisfied in the subtree rooted at A[subtree_idx].  'A' uses 1-based indices.\n */\nstatic void\nheapify_subtree(u32 A[], unsigned length, unsigned subtree_idx)\n{\n\tunsigned parent_idx;\n\tunsigned child_idx;\n\tu32 v;\n\n\tv = A[subtree_idx];\n\tparent_idx = subtree_idx;\n\twhile ((child_idx = parent_idx * 2) <= length) {\n\t\tif (child_idx < length && A[child_idx + 1] > A[child_idx])\n\t\t\tchild_idx++;\n\t\tif (v >= A[child_idx])\n\t\t\tbreak;\n\t\tA[parent_idx] = A[child_idx];\n\t\tparent_idx = child_idx;\n\t}\n\tA[parent_idx] = v;\n}\n\n/*\n * Rearrange the array 'A' so that it satisfies the maxheap property.\n * 'A' uses 1-based indices, so the children of A[i] are A[i*2] and A[i*2 + 1].\n */\nstatic void\nheapify_array(u32 A[], unsigned length)\n{\n\tunsigned subtree_idx;\n\n\tfor (subtree_idx = length / 2; subtree_idx >= 1; subtree_idx--)\n\t\theapify_subtree(A, length, subtree_idx);\n}\n\n/*\n * Sort the array 'A', which contains 'length' unsigned 32-bit integers.\n *\n * Note: name this function heap_sort() instead of heapsort() to avoid colliding\n * with heapsort() from stdlib.h on BSD-derived systems --- though this isn't\n * necessary when compiling with -D_ANSI_SOURCE, which is the better solution.\n */\nstatic void\nheap_sort(u32 A[], unsigned length)\n{\n\tA--; /* Use 1-based indices  */\n\n\theapify_array(A, length);\n\n\twhile (length >= 2) {\n\t\tu32 tmp = A[length];\n\n\t\tA[length] = A[1];\n\t\tA[1] = tmp;\n\t\tlength--;\n\t\theapify_subtree(A, length, 1);\n\t}\n}\n\n#define NUM_SYMBOL_BITS 10\n#define NUM_FREQ_BITS\t(32 - NUM_SYMBOL_BITS)\n#define SYMBOL_MASK\t((1 << NUM_SYMBOL_BITS) - 1)\n#define FREQ_MASK\t(~SYMBOL_MASK)\n\n#define GET_NUM_COUNTERS(num_syms)\t(num_syms)\n\n/*\n * Sort the symbols primarily by frequency and secondarily by symbol value.\n * Discard symbols with zero frequency and fill in an array with the remaining\n * symbols, along with their frequencies.  The low NUM_SYMBOL_BITS bits of each\n * array entry will contain the symbol value, and the remaining bits will\n * contain the frequency.\n *\n * @num_syms\n *\tNumber of symbols in the alphabet, at most 1 << NUM_SYMBOL_BITS.\n *\n * @freqs[num_syms]\n *\tFrequency of each symbol, summing to at most (1 << NUM_FREQ_BITS) - 1.\n *\n * @lens[num_syms]\n *\tAn array that eventually will hold the length of each codeword.  This\n *\tfunction only fills in the codeword lengths for symbols that have zero\n *\tfrequency, which are not well defined per se but will be set to 0.\n *\n * @symout[num_syms]\n *\tThe output array, described above.\n *\n * Returns the number of entries in 'symout' that were filled.  This is the\n * number of symbols that have nonzero frequency.\n */\nstatic unsigned\nsort_symbols(unsigned num_syms, const u32 freqs[], u8 lens[], u32 symout[])\n{\n\tunsigned sym;\n\tunsigned i;\n\tunsigned num_used_syms;\n\tunsigned num_counters;\n\tunsigned counters[GET_NUM_COUNTERS(MAX_NUM_SYMS)];\n\n\t/*\n\t * We use heapsort, but with an added optimization.  Since often most\n\t * symbol frequencies are low, we first do a count sort using a limited\n\t * number of counters.  High frequencies are counted in the last\n\t * counter, and only they will be sorted with heapsort.\n\t *\n\t * Note: with more symbols, it is generally beneficial to have more\n\t * counters.  About 1 counter per symbol seems fastest.\n\t */\n\n\tnum_counters = GET_NUM_COUNTERS(num_syms);\n\n\tmemset(counters, 0, num_counters * sizeof(counters[0]));\n\n\t/* Count the frequencies. */\n\tfor (sym = 0; sym < num_syms; sym++)\n\t\tcounters[MIN(freqs[sym], num_counters - 1)]++;\n\n\t/*\n\t * Make the counters cumulative, ignoring the zero-th, which counted\n\t * symbols with zero frequency.  As a side effect, this calculates the\n\t * number of symbols with nonzero frequency.\n\t */\n\tnum_used_syms = 0;\n\tfor (i = 1; i < num_counters; i++) {\n\t\tunsigned count = counters[i];\n\n\t\tcounters[i] = num_used_syms;\n\t\tnum_used_syms += count;\n\t}\n\n\t/*\n\t * Sort nonzero-frequency symbols using the counters.  At the same time,\n\t * set the codeword lengths of zero-frequency symbols to 0.\n\t */\n\tfor (sym = 0; sym < num_syms; sym++) {\n\t\tu32 freq = freqs[sym];\n\n\t\tif (freq != 0) {\n\t\t\tsymout[counters[MIN(freq, num_counters - 1)]++] =\n\t\t\t\tsym | (freq << NUM_SYMBOL_BITS);\n\t\t} else {\n\t\t\tlens[sym] = 0;\n\t\t}\n\t}\n\n\t/* Sort the symbols counted in the last counter. */\n\theap_sort(symout + counters[num_counters - 2],\n\t\t  counters[num_counters - 1] - counters[num_counters - 2]);\n\n\treturn num_used_syms;\n}\n\n/*\n * Build a Huffman tree.\n *\n * This is an optimized implementation that\n *\t(a) takes advantage of the frequencies being already sorted;\n *\t(b) only generates non-leaf nodes, since the non-leaf nodes of a Huffman\n *\t    tree are sufficient to generate a canonical code;\n *\t(c) Only stores parent pointers, not child pointers;\n *\t(d) Produces the nodes in the same memory used for input frequency\n *\t    information.\n *\n * Array 'A', which contains 'sym_count' entries, is used for both input and\n * output.  For this function, 'sym_count' must be at least 2.\n *\n * For input, the array must contain the frequencies of the symbols, sorted in\n * increasing order.  Specifically, each entry must contain a frequency left\n * shifted by NUM_SYMBOL_BITS bits.  Any data in the low NUM_SYMBOL_BITS bits of\n * the entries will be ignored by this function.  Although these bits will, in\n * fact, contain the symbols that correspond to the frequencies, this function\n * is concerned with frequencies only and keeps the symbols as-is.\n *\n * For output, this function will produce the non-leaf nodes of the Huffman\n * tree.  These nodes will be stored in the first (sym_count - 1) entries of the\n * array.  Entry A[sym_count - 2] will represent the root node.  Each other node\n * will contain the zero-based index of its parent node in 'A', left shifted by\n * NUM_SYMBOL_BITS bits.  The low NUM_SYMBOL_BITS bits of each entry in A will\n * be kept as-is.  Again, note that although these low bits will, in fact,\n * contain a symbol value, this symbol will have *no relationship* with the\n * Huffman tree node that happens to occupy the same slot.  This is because this\n * implementation only generates the non-leaf nodes of the tree.\n */\nstatic void\nbuild_tree(u32 A[], unsigned sym_count)\n{\n\tconst unsigned last_idx = sym_count - 1;\n\n\t/* Index of the next lowest frequency leaf that still needs a parent */\n\tunsigned i = 0;\n\n\t/*\n\t * Index of the next lowest frequency non-leaf that still needs a\n\t * parent, or 'e' if there is currently no such node\n\t */\n\tunsigned b = 0;\n\n\t/* Index of the next spot for a non-leaf (will overwrite a leaf) */\n\tunsigned e = 0;\n\n\tdo {\n\t\tu32 new_freq;\n\n\t\t/*\n\t\t * Select the next two lowest frequency nodes among the leaves\n\t\t * A[i] and non-leaves A[b], and create a new node A[e] to be\n\t\t * their parent.  Set the new node's frequency to the sum of the\n\t\t * frequencies of its two children.\n\t\t *\n\t\t * Usually the next two lowest frequency nodes are of the same\n\t\t * type (leaf or non-leaf), so check those cases first.\n\t\t */\n\t\tif (i + 1 <= last_idx &&\n\t\t    (b == e || (A[i + 1] & FREQ_MASK) <= (A[b] & FREQ_MASK))) {\n\t\t\t/* Two leaves */\n\t\t\tnew_freq = (A[i] & FREQ_MASK) + (A[i + 1] & FREQ_MASK);\n\t\t\ti += 2;\n\t\t} else if (b + 2 <= e &&\n\t\t\t   (i > last_idx ||\n\t\t\t    (A[b + 1] & FREQ_MASK) < (A[i] & FREQ_MASK))) {\n\t\t\t/* Two non-leaves */\n\t\t\tnew_freq = (A[b] & FREQ_MASK) + (A[b + 1] & FREQ_MASK);\n\t\t\tA[b] = (e << NUM_SYMBOL_BITS) | (A[b] & SYMBOL_MASK);\n\t\t\tA[b + 1] = (e << NUM_SYMBOL_BITS) |\n\t\t\t\t   (A[b + 1] & SYMBOL_MASK);\n\t\t\tb += 2;\n\t\t} else {\n\t\t\t/* One leaf and one non-leaf */\n\t\t\tnew_freq = (A[i] & FREQ_MASK) + (A[b] & FREQ_MASK);\n\t\t\tA[b] = (e << NUM_SYMBOL_BITS) | (A[b] & SYMBOL_MASK);\n\t\t\ti++;\n\t\t\tb++;\n\t\t}\n\t\tA[e] = new_freq | (A[e] & SYMBOL_MASK);\n\t\t/*\n\t\t * A binary tree with 'n' leaves has 'n - 1' non-leaves, so the\n\t\t * tree is complete once we've created 'n - 1' non-leaves.\n\t\t */\n\t} while (++e < last_idx);\n}\n\n/*\n * Given the stripped-down Huffman tree constructed by build_tree(), determine\n * the number of codewords that should be assigned each possible length, taking\n * into account the length-limited constraint.\n *\n * @A\n *\tThe array produced by build_tree(), containing parent index information\n *\tfor the non-leaf nodes of the Huffman tree.  Each entry in this array is\n *\ta node; a node's parent always has a greater index than that node\n *\titself.  This function will overwrite the parent index information in\n *\tthis array, so essentially it will destroy the tree.  However, the data\n *\tin the low NUM_SYMBOL_BITS of each entry will be preserved.\n *\n * @root_idx\n *\tThe 0-based index of the root node in 'A', and consequently one less\n *\tthan the number of tree node entries in 'A'.  (Or, really 2 less than\n *\tthe actual length of 'A'.)\n *\n * @len_counts\n *\tAn array of length ('max_codeword_len' + 1) in which the number of\n *\tcodewords having each length <= max_codeword_len will be returned.\n *\n * @max_codeword_len\n *\tThe maximum permissible codeword length.\n */\nstatic void\ncompute_length_counts(u32 A[], unsigned root_idx, unsigned len_counts[],\n\t\t      unsigned max_codeword_len)\n{\n\tunsigned len;\n\tint node;\n\n\t/*\n\t * The key observations are:\n\t *\n\t * (1) We can traverse the non-leaf nodes of the tree, always visiting a\n\t *     parent before its children, by simply iterating through the array\n\t *     in reverse order.  Consequently, we can compute the depth of each\n\t *     node in one pass, overwriting the parent indices with depths.\n\t *\n\t * (2) We can initially assume that in the real Huffman tree, both\n\t *     children of the root are leaves.  This corresponds to two\n\t *     codewords of length 1.  Then, whenever we visit a (non-leaf) node\n\t *     during the traversal, we modify this assumption to account for\n\t *     the current node *not* being a leaf, but rather its two children\n\t *     being leaves.  This causes the loss of one codeword for the\n\t *     current depth and the addition of two codewords for the current\n\t *     depth plus one.\n\t *\n\t * (3) We can handle the length-limited constraint fairly easily by\n\t *     simply using the largest length available when a depth exceeds\n\t *     max_codeword_len.\n\t */\n\n\tfor (len = 0; len <= max_codeword_len; len++)\n\t\tlen_counts[len] = 0;\n\tlen_counts[1] = 2;\n\n\t/* Set the root node's depth to 0. */\n\tA[root_idx] &= SYMBOL_MASK;\n\n\tfor (node = root_idx - 1; node >= 0; node--) {\n\n\t\t/* Calculate the depth of this node. */\n\n\t\tunsigned parent = A[node] >> NUM_SYMBOL_BITS;\n\t\tunsigned parent_depth = A[parent] >> NUM_SYMBOL_BITS;\n\t\tunsigned depth = parent_depth + 1;\n\t\tunsigned len = depth;\n\n\t\t/*\n\t\t * Set the depth of this node so that it is available when its\n\t\t * children (if any) are processed.\n\t\t */\n\t\tA[node] = (A[node] & SYMBOL_MASK) | (depth << NUM_SYMBOL_BITS);\n\n\t\t/*\n\t\t * If needed, decrease the length to meet the length-limited\n\t\t * constraint.  This is not the optimal method for generating\n\t\t * length-limited Huffman codes!  But it should be good enough.\n\t\t */\n\t\tif (len >= max_codeword_len) {\n\t\t\tlen = max_codeword_len;\n\t\t\tdo {\n\t\t\t\tlen--;\n\t\t\t} while (len_counts[len] == 0);\n\t\t}\n\n\t\t/*\n\t\t * Account for the fact that we have a non-leaf node at the\n\t\t * current depth.\n\t\t */\n\t\tlen_counts[len]--;\n\t\tlen_counts[len + 1] += 2;\n\t}\n}\n\n/*\n * Generate the codewords for a canonical Huffman code.\n *\n * @A\n *\tThe output array for codewords.  In addition, initially this\n *\tarray must contain the symbols, sorted primarily by frequency and\n *\tsecondarily by symbol value, in the low NUM_SYMBOL_BITS bits of\n *\teach entry.\n *\n * @len\n *\tOutput array for codeword lengths.\n *\n * @len_counts\n *\tAn array that provides the number of codewords that will have\n *\teach possible length <= max_codeword_len.\n *\n * @max_codeword_len\n *\tMaximum length, in bits, of each codeword.\n *\n * @num_syms\n *\tNumber of symbols in the alphabet, including symbols with zero\n *\tfrequency.  This is the length of the 'A' and 'len' arrays.\n */\nstatic void\ngen_codewords(u32 A[], u8 lens[], const unsigned len_counts[],\n\t      unsigned max_codeword_len, unsigned num_syms)\n{\n\tu32 next_codewords[MAX_CODEWORD_LEN + 1];\n\tunsigned i;\n\tunsigned len;\n\tunsigned sym;\n\n\t/*\n\t * Given the number of codewords that will have each length, assign\n\t * codeword lengths to symbols.  We do this by assigning the lengths in\n\t * decreasing order to the symbols sorted primarily by increasing\n\t * frequency and secondarily by increasing symbol value.\n\t */\n\tfor (i = 0, len = max_codeword_len; len >= 1; len--) {\n\t\tunsigned count = len_counts[len];\n\n\t\twhile (count--)\n\t\t\tlens[A[i++] & SYMBOL_MASK] = len;\n\t}\n\n\t/*\n\t * Generate the codewords themselves.  We initialize the\n\t * 'next_codewords' array to provide the lexicographically first\n\t * codeword of each length, then assign codewords in symbol order.  This\n\t * produces a canonical code.\n\t */\n\tnext_codewords[0] = 0;\n\tnext_codewords[1] = 0;\n\tfor (len = 2; len <= max_codeword_len; len++)\n\t\tnext_codewords[len] =\n\t\t\t(next_codewords[len - 1] + len_counts[len - 1]) << 1;\n\n\tfor (sym = 0; sym < num_syms; sym++)\n\t\tA[sym] = next_codewords[lens[sym]]++;\n}\n\n/*\n * ---------------------------------------------------------------------\n *\t\t\tmake_canonical_huffman_code()\n * ---------------------------------------------------------------------\n *\n * Given an alphabet and the frequency of each symbol in it, construct a\n * length-limited canonical Huffman code.\n *\n * @num_syms\n *\tThe number of symbols in the alphabet.  The symbols are the integers in\n *\tthe range [0, num_syms - 1].  This parameter must be at least 2 and\n *\tmust not exceed (1 << NUM_SYMBOL_BITS).\n *\n * @max_codeword_len\n *\tThe maximum permissible codeword length.\n *\n * @freqs\n *\tAn array of length @num_syms that gives the frequency of each symbol.\n *\tIt is valid for some, none, or all of the frequencies to be 0.  The sum\n *\tof frequencies must not exceed (1 << NUM_FREQ_BITS) - 1.\n *\n * @lens\n *\tAn array of @num_syms entries in which this function will return the\n *\tlength, in bits, of the codeword assigned to each symbol.  Symbols with\n *\t0 frequency will not have codewords per se, but their entries in this\n *\tarray will be set to 0.  No lengths greater than @max_codeword_len will\n *\tbe assigned.\n *\n * @codewords\n *\tAn array of @num_syms entries in which this function will return the\n *\tcodeword for each symbol, right-justified and padded on the left with\n *\tzeroes.  Codewords for symbols with 0 frequency will be undefined.\n *\n * ---------------------------------------------------------------------\n *\n * This function builds a length-limited canonical Huffman code.\n *\n * A length-limited Huffman code contains no codewords longer than some\n * specified length, and has exactly (with some algorithms) or approximately\n * (with the algorithm used here) the minimum weighted path length from the\n * root, given this constraint.\n *\n * A canonical Huffman code satisfies the properties that a longer codeword\n * never lexicographically precedes a shorter codeword, and the lexicographic\n * ordering of codewords of the same length is the same as the lexicographic\n * ordering of the corresponding symbols.  A canonical Huffman code, or more\n * generally a canonical prefix code, can be reconstructed from only a list\n * containing the codeword length of each symbol.\n *\n * The classic algorithm to generate a Huffman code creates a node for each\n * symbol, then inserts these nodes into a min-heap keyed by symbol frequency.\n * Then, repeatedly, the two lowest-frequency nodes are removed from the\n * min-heap and added as the children of a new node having frequency equal to\n * the sum of its two children, which is then inserted into the min-heap.  When\n * only a single node remains in the min-heap, it is the root of the Huffman\n * tree.  The codeword for each symbol is determined by the path needed to reach\n * the corresponding node from the root.  Descending to the left child appends a\n * 0 bit, whereas descending to the right child appends a 1 bit.\n *\n * The classic algorithm is relatively easy to understand, but it is subject to\n * a number of inefficiencies.  In practice, it is fastest to first sort the\n * symbols by frequency.  (This itself can be subject to an optimization based\n * on the fact that most frequencies tend to be low.)  At the same time, we sort\n * secondarily by symbol value, which aids the process of generating a canonical\n * code.  Then, during tree construction, no heap is necessary because both the\n * leaf nodes and the unparented non-leaf nodes can be easily maintained in\n * sorted order.  Consequently, there can never be more than two possibilities\n * for the next-lowest-frequency node.\n *\n * In addition, because we're generating a canonical code, we actually don't\n * need the leaf nodes of the tree at all, only the non-leaf nodes.  This is\n * because for canonical code generation we don't need to know where the symbols\n * are in the tree.  Rather, we only need to know how many leaf nodes have each\n * depth (codeword length).  And this information can, in fact, be quickly\n * generated from the tree of non-leaves only.\n *\n * Furthermore, we can build this stripped-down Huffman tree directly in the\n * array in which the codewords are to be generated, provided that these array\n * slots are large enough to hold a symbol and frequency value.\n *\n * Still furthermore, we don't even need to maintain explicit child pointers.\n * We only need the parent pointers, and even those can be overwritten in-place\n * with depth information as part of the process of extracting codeword lengths\n * from the tree.  So in summary, we do NOT need a big structure like:\n *\n *\tstruct huffman_tree_node {\n *\t\tunsigned int symbol;\n *\t\tunsigned int frequency;\n *\t\tunsigned int depth;\n *\t\tstruct huffman_tree_node *left_child;\n *\t\tstruct huffman_tree_node *right_child;\n *\t};\n *\n *\n * ... which often gets used in \"naive\" implementations of Huffman code\n * generation.\n *\n * Many of these optimizations are based on the implementation in 7-Zip (source\n * file: C/HuffEnc.c), which was placed in the public domain by Igor Pavlov.\n *\n * NOTE: in general, the same frequencies can be used to generate different\n * length-limited canonical Huffman codes.  One choice we have is during tree\n * construction, when we must decide whether to prefer a leaf or non-leaf when\n * there is a tie in frequency.  Another choice we have is how to deal with\n * codewords that would exceed @max_codeword_len bits in length.  Both of these\n * choices affect the resulting codeword lengths, which otherwise can be mapped\n * uniquely onto the resulting canonical Huffman code.\n *\n * Normally, there is no problem with choosing one valid code over another,\n * provided that they produce similar compression ratios.  However, the LZMS\n * compression format uses adaptive Huffman coding.  It requires that both the\n * decompressor and compressor build a canonical code equivalent to that which\n * can be generated by using the classic Huffman tree construction algorithm and\n * always processing leaves before non-leaves when there is a frequency tie.\n * Therefore, we make sure to do this.  This method also has the advantage of\n * sometimes shortening the longest codeword that is generated.\n *\n * There also is the issue of how codewords longer than @max_codeword_len are\n * dealt with.  Fortunately, for LZMS this is irrelevant because for the LZMS\n * alphabets no codeword can ever exceed LZMS_MAX_CODEWORD_LEN (= 15).  Since\n * the LZMS algorithm regularly halves all frequencies, the frequencies cannot\n * become high enough for a length 16 codeword to be generated.  Specifically, I\n * think that if ties are broken in favor of non-leaves (as we do), the lowest\n * total frequency that would give a length-16 codeword would be the sum of the\n * frequencies 1 1 1 3 4 7 11 18 29 47 76 123 199 322 521 843 1364, which is\n * 3570.  And in LZMS we can't get a frequency that high based on the alphabet\n * sizes, rebuild frequencies, and scaling factors.  This worst-case scenario is\n * based on the following degenerate case (only the bottom of the tree shown):\n *\n *                          ...\n *                        17\n *                       /  \\\n *                      10   7\n *                     / \\\n *                    6   4\n *                   / \\\n *                  3   3\n *                 / \\\n *                2   1\n *               / \\\n *              1   1\n *\n * Excluding the first leaves (those with value 1), each leaf value must be\n * greater than the non-leaf up 1 and down 2 from it; otherwise that leaf would\n * have taken precedence over that non-leaf and been combined with the leaf\n * below, thereby decreasing the height compared to that shown.\n *\n * Interesting fact: if we were to instead prioritize non-leaves over leaves,\n * then the worst case frequencies would be the Fibonacci sequence, plus an\n * extra frequency of 1.  In this hypothetical scenario, it would be slightly\n * easier for longer codewords to be generated.\n */\nvoid\nmake_canonical_huffman_code(unsigned num_syms, unsigned max_codeword_len,\n\t\t\t    const u32 freqs[], u8 lens[], u32 codewords[])\n{\n\tu32 *A = codewords;\n\tunsigned num_used_syms;\n\n\twimlib_assert(num_syms <= MAX_NUM_SYMS);\n\tSTATIC_ASSERT(MAX_NUM_SYMS <= 1 << NUM_SYMBOL_BITS);\n\twimlib_assert(max_codeword_len <= MAX_CODEWORD_LEN);\n\n\t/*\n\t * We begin by sorting the symbols primarily by frequency and\n\t * secondarily by symbol value.  As an optimization, the array used for\n\t * this purpose ('A') shares storage with the space in which we will\n\t * eventually return the codewords.\n\t */\n\tnum_used_syms = sort_symbols(num_syms, freqs, lens, A);\n\n\t/*\n\t * 'num_used_syms' is the number of symbols with nonzero frequency.\n\t * This may be less than @num_syms.  'num_used_syms' is also the number\n\t * of entries in 'A' that are valid.  Each entry consists of a distinct\n\t * symbol and a nonzero frequency packed into a 32-bit integer.\n\t */\n\n\t/*\n\t * Handle special cases where only 0 or 1 symbols were used (had nonzero\n\t * frequency).\n\t */\n\n\tif (unlikely(num_used_syms == 0)) {\n\t\t/*\n\t\t * Code is empty.  sort_symbols() already set all lengths to 0,\n\t\t * so there is nothing more to do.\n\t\t */\n\t\treturn;\n\t}\n\n\tif (unlikely(num_used_syms == 1)) {\n\t\t/*\n\t\t * Only one symbol was used, so we only need one codeword.  But\n\t\t * two codewords are needed to form the smallest complete\n\t\t * Huffman code, which uses codewords 0 and 1.  Therefore, we\n\t\t * choose another symbol to which to assign a codeword.  We use\n\t\t * 0 (if the used symbol is not 0) or 1 (if the used symbol is\n\t\t * 0).  In either case, the lesser-valued symbol must be\n\t\t * assigned codeword 0 so that the resulting code is canonical.\n\t\t */\n\n\t\tunsigned sym = A[0] & SYMBOL_MASK;\n\t\tunsigned nonzero_idx = sym ? sym : 1;\n\n\t\tcodewords[0] = 0;\n\t\tlens[0] = 1;\n\t\tcodewords[nonzero_idx] = 1;\n\t\tlens[nonzero_idx] = 1;\n\t\treturn;\n\t}\n\n\t/*\n\t * Build a stripped-down version of the Huffman tree, sharing the array\n\t * 'A' with the symbol values.  Then extract length counts from the tree\n\t * and use them to generate the final codewords.\n\t */\n\n\tbuild_tree(A, num_used_syms);\n\n\t{\n\t\tunsigned len_counts[MAX_CODEWORD_LEN + 1];\n\n\t\tcompute_length_counts(A, num_used_syms - 2,\n\t\t\t\t      len_counts, max_codeword_len);\n\n\t\tgen_codewords(A, lens, len_counts, max_codeword_len, num_syms);\n\t}\n}\n"
  },
  {
    "path": "src/wimlib/compress_parallel.c",
    "content": "/*\n * compress_parallel.c\n *\n * Compress chunks of data (parallel version).\n */\n\n/*\n * Copyright (C) 2013-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/chunk_compressor.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/list.h\"\n#include \"wimlib/threads.h\"\n#include \"wimlib/util.h\"\n\nstruct message_queue {\n\tstruct list_head list;\n\tstruct mutex lock;\n\tstruct condvar msg_avail_cond;\n\tstruct condvar space_avail_cond;\n\tbool terminating;\n};\n\nstruct compressor_thread_data {\n\tstruct thread thread;\n\tstruct message_queue *chunks_to_compress_queue;\n\tstruct message_queue *compressed_chunks_queue;\n\tstruct wimlib_compressor *compressor;\n};\n\n#define MAX_CHUNKS_PER_MSG 16\n\nstruct message {\n\tu8 *uncompressed_chunks[MAX_CHUNKS_PER_MSG];\n\tu8 *compressed_chunks[MAX_CHUNKS_PER_MSG];\n\tu32 uncompressed_chunk_sizes[MAX_CHUNKS_PER_MSG];\n\tu32 compressed_chunk_sizes[MAX_CHUNKS_PER_MSG];\n\tsize_t num_filled_chunks;\n\tsize_t num_alloc_chunks;\n\tstruct list_head list;\n\tbool complete;\n\tstruct list_head submission_list;\n};\n\nstruct parallel_chunk_compressor {\n\tstruct chunk_compressor base;\n\n\tstruct message_queue chunks_to_compress_queue;\n\tstruct message_queue compressed_chunks_queue;\n\tstruct compressor_thread_data *thread_data;\n\tunsigned num_thread_data;\n\tunsigned num_started_threads;\n\n\tstruct message *msgs;\n\tsize_t num_messages;\n\n\tstruct list_head available_msgs;\n\tstruct list_head submitted_msgs;\n\tstruct message *next_submit_msg;\n\tstruct message *next_ready_msg;\n\tsize_t next_chunk_idx;\n};\n\n\n\nstatic int\nmessage_queue_init(struct message_queue *q)\n{\n\tif (!mutex_init(&q->lock))\n\t\tgoto err;\n\tif (!condvar_init(&q->msg_avail_cond))\n\t\tgoto err_destroy_lock;\n\tif (!condvar_init(&q->space_avail_cond))\n\t\tgoto err_destroy_msg_avail_cond;\n\tINIT_LIST_HEAD(&q->list);\n\treturn 0;\n\nerr_destroy_msg_avail_cond:\n\tcondvar_destroy(&q->msg_avail_cond);\nerr_destroy_lock:\n\tmutex_destroy(&q->lock);\nerr:\n\treturn WIMLIB_ERR_NOMEM;\n}\n\nstatic void\nmessage_queue_destroy(struct message_queue *q)\n{\n\tif (q->list.next != NULL) {\n\t\tmutex_destroy(&q->lock);\n\t\tcondvar_destroy(&q->msg_avail_cond);\n\t\tcondvar_destroy(&q->space_avail_cond);\n\t}\n}\n\nstatic void\nmessage_queue_put(struct message_queue *q, struct message *msg)\n{\n\tmutex_lock(&q->lock);\n\tlist_add_tail(&msg->list, &q->list);\n\tcondvar_signal(&q->msg_avail_cond);\n\tmutex_unlock(&q->lock);\n}\n\nstatic struct message *\nmessage_queue_get(struct message_queue *q)\n{\n\tstruct message *msg;\n\n\tmutex_lock(&q->lock);\n\twhile (list_empty(&q->list) && !q->terminating)\n\t\tcondvar_wait(&q->msg_avail_cond, &q->lock);\n\tif (!q->terminating) {\n\t\tmsg = list_entry(q->list.next, struct message, list);\n\t\tlist_del(&msg->list);\n\t} else\n\t\tmsg = NULL;\n\tmutex_unlock(&q->lock);\n\treturn msg;\n}\n\nstatic void\nmessage_queue_terminate(struct message_queue *q)\n{\n\tmutex_lock(&q->lock);\n\tq->terminating = true;\n\tcondvar_broadcast(&q->msg_avail_cond);\n\tmutex_unlock(&q->lock);\n}\n\nstatic int\ninit_message(struct message *msg, size_t num_chunks, u32 out_chunk_size)\n{\n\tmsg->num_alloc_chunks = num_chunks;\n\tfor (size_t i = 0; i < num_chunks; i++) {\n\t\tmsg->compressed_chunks[i] = MALLOC(out_chunk_size - 1);\n\t\tmsg->uncompressed_chunks[i] = MALLOC(out_chunk_size);\n\t\tif (msg->compressed_chunks[i] == NULL ||\n\t\t    msg->uncompressed_chunks[i] == NULL)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\treturn 0;\n}\n\nstatic void\ndestroy_message(struct message *msg)\n{\n\tfor (size_t i = 0; i < msg->num_alloc_chunks; i++) {\n\t\tFREE(msg->compressed_chunks[i]);\n\t\tFREE(msg->uncompressed_chunks[i]);\n\t}\n}\n\nstatic void\nfree_messages(struct message *msgs, size_t num_messages)\n{\n\tif (msgs) {\n\t\tfor (size_t i = 0; i < num_messages; i++)\n\t\t\tdestroy_message(&msgs[i]);\n\t\tFREE(msgs);\n\t}\n}\n\nstatic struct message *\nallocate_messages(size_t count, size_t chunks_per_msg, u32 out_chunk_size)\n{\n\tstruct message *msgs;\n\n\tmsgs = CALLOC(count, sizeof(struct message));\n\tif (msgs == NULL)\n\t\treturn NULL;\n\tfor (size_t i = 0; i < count; i++) {\n\t\tif (init_message(&msgs[i], chunks_per_msg, out_chunk_size)) {\n\t\t\tfree_messages(msgs, count);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\treturn msgs;\n}\n\nstatic void\ncompress_chunks(struct message *msg, struct wimlib_compressor *compressor)\n{\n\n\tfor (size_t i = 0; i < msg->num_filled_chunks; i++) {\n\t\twimlib_assert(msg->uncompressed_chunk_sizes[i] != 0);\n\t\tmsg->compressed_chunk_sizes[i] =\n\t\t\twimlib_compress(msg->uncompressed_chunks[i],\n\t\t\t\t\tmsg->uncompressed_chunk_sizes[i],\n\t\t\t\t\tmsg->compressed_chunks[i],\n\t\t\t\t\tmsg->uncompressed_chunk_sizes[i] - 1,\n\t\t\t\t\tcompressor);\n\t}\n}\n\nstatic void *\ncompressor_thread_proc(void *arg)\n{\n\tstruct compressor_thread_data *params = arg;\n\tstruct message *msg;\n\n\twhile ((msg = message_queue_get(params->chunks_to_compress_queue)) != NULL) {\n\t\tcompress_chunks(msg, params->compressor);\n\t\tmessage_queue_put(params->compressed_chunks_queue, msg);\n\t}\n\treturn NULL;\n}\n\nstatic void\nparallel_chunk_compressor_destroy(struct chunk_compressor *_ctx)\n{\n\tstruct parallel_chunk_compressor *ctx = (struct parallel_chunk_compressor *)_ctx;\n\tunsigned i;\n\n\tif (ctx == NULL)\n\t\treturn;\n\n\tif (ctx->num_started_threads != 0) {\n\t\tmessage_queue_terminate(&ctx->chunks_to_compress_queue);\n\n\t\tfor (i = 0; i < ctx->num_started_threads; i++)\n\t\t\tthread_join(&ctx->thread_data[i].thread);\n\t}\n\n\tmessage_queue_destroy(&ctx->chunks_to_compress_queue);\n\tmessage_queue_destroy(&ctx->compressed_chunks_queue);\n\n\tif (ctx->thread_data != NULL)\n\t\tfor (i = 0; i < ctx->num_thread_data; i++)\n\t\t\twimlib_free_compressor(ctx->thread_data[i].compressor);\n\n\tFREE(ctx->thread_data);\n\n\tfree_messages(ctx->msgs, ctx->num_messages);\n\n\tFREE(ctx);\n}\n\nstatic void\nsubmit_compression_msg(struct parallel_chunk_compressor *ctx)\n{\n\tstruct message *msg = ctx->next_submit_msg;\n\n\tmsg->complete = false;\n\tlist_add_tail(&msg->submission_list, &ctx->submitted_msgs);\n\tmessage_queue_put(&ctx->chunks_to_compress_queue, msg);\n\tctx->next_submit_msg = NULL;\n}\n\nstatic void *\nparallel_chunk_compressor_get_chunk_buffer(struct chunk_compressor *_ctx)\n{\n\tstruct parallel_chunk_compressor *ctx = (struct parallel_chunk_compressor *)_ctx;\n\tstruct message *msg;\n\n\tif (ctx->next_submit_msg) {\n\t\tmsg = ctx->next_submit_msg;\n\t} else {\n\t\tif (list_empty(&ctx->available_msgs))\n\t\t\treturn NULL;\n\n\t\tmsg = list_entry(ctx->available_msgs.next, struct message, list);\n\t\tlist_del(&msg->list);\n\t\tctx->next_submit_msg = msg;\n\t\tmsg->num_filled_chunks = 0;\n\t}\n\n\treturn msg->uncompressed_chunks[msg->num_filled_chunks];\n}\n\nstatic void\nparallel_chunk_compressor_signal_chunk_filled(struct chunk_compressor *_ctx, u32 usize)\n{\n\tstruct parallel_chunk_compressor *ctx = (struct parallel_chunk_compressor *)_ctx;\n\tstruct message *msg;\n\n\twimlib_assert(usize > 0);\n\twimlib_assert(usize <= ctx->base.out_chunk_size);\n\twimlib_assert(ctx->next_submit_msg);\n\n\tmsg = ctx->next_submit_msg;\n\tmsg->uncompressed_chunk_sizes[msg->num_filled_chunks] = usize;\n\tif (++msg->num_filled_chunks == msg->num_alloc_chunks)\n\t\tsubmit_compression_msg(ctx);\n}\n\nstatic bool\nparallel_chunk_compressor_get_compression_result(struct chunk_compressor *_ctx,\n\t\t\t\t\t\t const void **cdata_ret, u32 *csize_ret,\n\t\t\t\t\t\t u32 *usize_ret)\n{\n\tstruct parallel_chunk_compressor *ctx = (struct parallel_chunk_compressor *)_ctx;\n\tstruct message *msg;\n\n\tif (ctx->next_submit_msg)\n\t\tsubmit_compression_msg(ctx);\n\n\tif (ctx->next_ready_msg) {\n\t\tmsg = ctx->next_ready_msg;\n\t} else {\n\t\tif (list_empty(&ctx->submitted_msgs))\n\t\t\treturn false;\n\n\t\twhile (!(msg = list_entry(ctx->submitted_msgs.next,\n\t\t\t\t\t  struct message,\n\t\t\t\t\t  submission_list))->complete)\n\t\t\tmessage_queue_get(&ctx->compressed_chunks_queue)->complete = true;\n\n\t\tctx->next_ready_msg = msg;\n\t\tctx->next_chunk_idx = 0;\n\t}\n\n\tif (msg->compressed_chunk_sizes[ctx->next_chunk_idx]) {\n\t\t*cdata_ret = msg->compressed_chunks[ctx->next_chunk_idx];\n\t\t*csize_ret = msg->compressed_chunk_sizes[ctx->next_chunk_idx];\n\t} else {\n\t\t*cdata_ret = msg->uncompressed_chunks[ctx->next_chunk_idx];\n\t\t*csize_ret = msg->uncompressed_chunk_sizes[ctx->next_chunk_idx];\n\t}\n\t*usize_ret = msg->uncompressed_chunk_sizes[ctx->next_chunk_idx];\n\n\tif (++ctx->next_chunk_idx == msg->num_filled_chunks) {\n\t\tlist_del(&msg->submission_list);\n\t\tlist_add_tail(&msg->list, &ctx->available_msgs);\n\t\tctx->next_ready_msg = NULL;\n\t}\n\treturn true;\n}\n\nint\nnew_parallel_chunk_compressor(int out_ctype, u32 out_chunk_size,\n\t\t\t      unsigned num_threads, u64 max_memory,\n\t\t\t      struct chunk_compressor **compressor_ret)\n{\n\tu64 approx_mem_required;\n\tsize_t chunks_per_msg;\n\tsize_t msgs_per_thread;\n\tstruct parallel_chunk_compressor *ctx;\n\tunsigned i;\n\tint ret;\n\tunsigned desired_num_threads;\n\n\twimlib_assert(out_chunk_size > 0);\n\n\tif (num_threads == 0)\n\t\tnum_threads = get_available_cpus();\n\n\tif (num_threads == 1)\n\t\treturn -1;\n\n\tif (max_memory == 0)\n\t\tmax_memory = get_available_memory();\n\n\tdesired_num_threads = num_threads;\n\n\tif (out_chunk_size < ((u32)1 << 23)) {\n\t\t/* Relatively small chunks.  Use 2 messages per thread, each\n\t\t * with at least 2 chunks.  Use more chunks per message if there\n\t\t * are lots of threads and/or the chunks are very small.  */\n\t\tchunks_per_msg = 2;\n\t\tchunks_per_msg += num_threads * (65536 / out_chunk_size) / 16;\n\t\tchunks_per_msg = max(chunks_per_msg, 2);\n\t\tchunks_per_msg = min(chunks_per_msg, MAX_CHUNKS_PER_MSG);\n\t\tmsgs_per_thread = 2;\n\t} else {\n\t\t/* Big chunks: Just have one buffer per thread --- more would\n\t\t * just waste memory.  */\n\t\tchunks_per_msg = 1;\n\t\tmsgs_per_thread = 1;\n\t}\n\tfor (;;) {\n\t\tapprox_mem_required =\n\t\t\t(u64)chunks_per_msg *\n\t\t\t(u64)msgs_per_thread *\n\t\t\t(u64)num_threads *\n\t\t\t(u64)out_chunk_size\n\t\t\t+ out_chunk_size\n\t\t\t+ 1000000\n\t\t\t+ num_threads * wimlib_get_compressor_needed_memory(out_ctype,\n\t\t\t\t\t\t\t\t\t    out_chunk_size,\n\t\t\t\t\t\t\t\t\t    0);\n\t\tif (approx_mem_required <= max_memory)\n\t\t\tbreak;\n\n\t\tif (chunks_per_msg > 1)\n\t\t\tchunks_per_msg--;\n\t\telse if (msgs_per_thread > 1)\n\t\t\tmsgs_per_thread--;\n\t\telse if (num_threads > 1)\n\t\t\tnum_threads--;\n\t\telse\n\t\t\tbreak;\n\t}\n\n\tif (num_threads < desired_num_threads) {\n\t\tWARNING(\"Wanted to use %u threads, but limiting to %u \"\n\t\t\t\"to fit in available memory!\",\n\t\t\tdesired_num_threads, num_threads);\n\t}\n\n\tif (num_threads == 1)\n\t\treturn -2;\n\n\tret = WIMLIB_ERR_NOMEM;\n\tctx = CALLOC(1, sizeof(*ctx));\n\tif (ctx == NULL)\n\t\tgoto err;\n\n\tctx->base.out_ctype = out_ctype;\n\tctx->base.out_chunk_size = out_chunk_size;\n\tctx->base.destroy = parallel_chunk_compressor_destroy;\n\tctx->base.get_chunk_buffer = parallel_chunk_compressor_get_chunk_buffer;\n\tctx->base.signal_chunk_filled = parallel_chunk_compressor_signal_chunk_filled;\n\tctx->base.get_compression_result = parallel_chunk_compressor_get_compression_result;\n\n\tctx->num_thread_data = num_threads;\n\n\tret = message_queue_init(&ctx->chunks_to_compress_queue);\n\tif (ret)\n\t\tgoto err;\n\n\tret = message_queue_init(&ctx->compressed_chunks_queue);\n\tif (ret)\n\t\tgoto err;\n\n\tret = WIMLIB_ERR_NOMEM;\n\tctx->thread_data = CALLOC(num_threads, sizeof(ctx->thread_data[0]));\n\tif (ctx->thread_data == NULL)\n\t\tgoto err;\n\n\tfor (i = 0; i < num_threads; i++) {\n\t\tstruct compressor_thread_data *dat;\n\n\t\tdat = &ctx->thread_data[i];\n\n\t\tdat->chunks_to_compress_queue = &ctx->chunks_to_compress_queue;\n\t\tdat->compressed_chunks_queue = &ctx->compressed_chunks_queue;\n\t\tret = wimlib_create_compressor(out_ctype, out_chunk_size,\n\t\t\t\t\t       WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE,\n\t\t\t\t\t       &dat->compressor);\n\t\tif (ret)\n\t\t\tgoto err;\n\t}\n\n\tfor (ctx->num_started_threads = 0;\n\t     ctx->num_started_threads < num_threads;\n\t     ctx->num_started_threads++)\n\t{\n\t\tif (!thread_create(&ctx->thread_data[ctx->num_started_threads].thread,\n\t\t\t\t   compressor_thread_proc,\n\t\t\t\t   &ctx->thread_data[ctx->num_started_threads]))\n\t\t{\n\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\tif (ctx->num_started_threads >= 2)\n\t\t\t\tbreak;\n\t\t\tgoto err;\n\t\t}\n\t}\n\n\tctx->base.num_threads = ctx->num_started_threads;\n\n\tret = WIMLIB_ERR_NOMEM;\n\tctx->num_messages = ctx->num_started_threads * msgs_per_thread;\n\tctx->msgs = allocate_messages(ctx->num_messages,\n\t\t\t\t      chunks_per_msg, out_chunk_size);\n\tif (ctx->msgs == NULL)\n\t\tgoto err;\n\n\tINIT_LIST_HEAD(&ctx->available_msgs);\n\tfor (size_t i = 0; i < ctx->num_messages; i++)\n\t\tlist_add_tail(&ctx->msgs[i].list, &ctx->available_msgs);\n\n\tINIT_LIST_HEAD(&ctx->submitted_msgs);\n\n\t*compressor_ret = &ctx->base;\n\treturn 0;\n\nerr:\n\tif (ctx)\n\t\tparallel_chunk_compressor_destroy(&ctx->base);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/wimlib/compress_serial.c",
    "content": "/*\n * compress_serial.c\n *\n * Compress chunks of data (serial version).\n */\n\n/*\n * Copyright (C) 2013 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <string.h>\n\n#include \"wimlib.h\"\n#include \"wimlib/assert.h\"\n#include \"wimlib/chunk_compressor.h\"\n#include \"wimlib/util.h\"\n\nstruct serial_chunk_compressor {\n\tstruct chunk_compressor base;\n\tstruct wimlib_compressor *compressor;\n\tu8 *udata;\n\tu8 *cdata;\n\tu32 usize;\n\tu8 *result_data;\n\tu32 result_size;\n};\n\nstatic void\nserial_chunk_compressor_destroy(struct chunk_compressor *_ctx)\n{\n\tstruct serial_chunk_compressor *ctx = (struct serial_chunk_compressor*)_ctx;\n\n\tif (ctx == NULL)\n\t\treturn;\n\n\twimlib_free_compressor(ctx->compressor);\n\tFREE(ctx->udata);\n\tFREE(ctx->cdata);\n\tFREE(ctx);\n}\n\nstatic void *\nserial_chunk_compressor_get_chunk_buffer(struct chunk_compressor *_ctx)\n{\n\tstruct serial_chunk_compressor *ctx = (struct serial_chunk_compressor*)_ctx;\n\n\tif (ctx->result_data)\n\t\treturn NULL;\n\treturn ctx->udata;\n}\n\nstatic void\nserial_chunk_compressor_signal_chunk_filled(struct chunk_compressor *_ctx, u32 usize)\n{\n\tstruct serial_chunk_compressor *ctx = (struct serial_chunk_compressor*)_ctx;\n\tu32 csize;\n\n\twimlib_assert(usize > 0);\n\twimlib_assert(usize <= ctx->base.out_chunk_size);\n\n\tctx->usize = usize;\n\tcsize = wimlib_compress(ctx->udata, usize, ctx->cdata, usize - 1,\n\t\t\t\tctx->compressor);\n\tif (csize) {\n\t\tctx->result_data = ctx->cdata;\n\t\tctx->result_size = csize;\n\t} else {\n\t\tctx->result_data = ctx->udata;\n\t\tctx->result_size = ctx->usize;\n\t}\n}\n\nstatic bool\nserial_chunk_compressor_get_compression_result(struct chunk_compressor *_ctx,\n\t\t\t\t\t       const void **cdata_ret, u32 *csize_ret,\n\t\t\t\t\t       u32 *usize_ret)\n{\n\tstruct serial_chunk_compressor *ctx = (struct serial_chunk_compressor *)_ctx;\n\n\tif (!ctx->result_data)\n\t\treturn false;\n\n\t*cdata_ret = ctx->result_data;\n\t*csize_ret = ctx->result_size;\n\t*usize_ret = ctx->usize;\n\n\tctx->result_data = NULL;\n\treturn true;\n}\n\nint\nnew_serial_chunk_compressor(int out_ctype, u32 out_chunk_size,\n\t\t\t    struct chunk_compressor **compressor_ret)\n{\n\tstruct serial_chunk_compressor *ctx;\n\tint ret;\n\n\twimlib_assert(out_chunk_size > 0);\n\n\tctx = CALLOC(1, sizeof(*ctx));\n\tif (ctx == NULL)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\tctx->base.out_ctype = out_ctype;\n\tctx->base.out_chunk_size = out_chunk_size;\n\tctx->base.num_threads = 1;\n\tctx->base.destroy = serial_chunk_compressor_destroy;\n\tctx->base.get_chunk_buffer = serial_chunk_compressor_get_chunk_buffer;\n\tctx->base.signal_chunk_filled = serial_chunk_compressor_signal_chunk_filled;\n\tctx->base.get_compression_result = serial_chunk_compressor_get_compression_result;\n\n\tret = wimlib_create_compressor(out_ctype, out_chunk_size,\n\t\t\t\t       WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE,\n\t\t\t\t       &ctx->compressor);\n\tif (ret)\n\t\tgoto err;\n\n\tctx->udata = MALLOC(out_chunk_size);\n\tctx->cdata = MALLOC(out_chunk_size - 1);\n\tif (ctx->udata == NULL || ctx->cdata == NULL) {\n\t\tret = WIMLIB_ERR_NOMEM;\n\t\tgoto err;\n\t}\n\tctx->result_data = NULL;\n\n\t*compressor_ret = &ctx->base;\n\treturn 0;\n\nerr:\n\tserial_chunk_compressor_destroy(&ctx->base);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/wimlib/config.h",
    "content": "/* config.h.  Generated from config.h.in by configure.  */\n/* config.h.in.  Generated from configure.ac by autoheader.  */\n\n/* Define if building universal (internal helper macro) */\n/* #undef AC_APPLE_UNIVERSAL_BUILD */\n\n/* Define to 1 to enable supporting code for tests */\n/* #undef ENABLE_TEST_SUPPORT */\n\n/* Define to 1 if you have the <alloca.h> header file. */\n/* #undef HAVE_ALLOCA_H */\n\n/* Define to 1 if you have the <byteswap.h> header file. */\n/* #undef HAVE_BYTESWAP_H */\n\n/* Define to 1 if you have the <dlfcn.h> header file. */\n/* #undef HAVE_DLFCN_H */\n\n/* Define to 1 if you have the <endian.h> header file. */\n/* #undef HAVE_ENDIAN_H */\n\n/* Define to 1 if you have the <errno.h> header file. */\n#define HAVE_ERRNO_H 1\n\n/* Define to 1 if you have the 'fdopendir' function. */\n/* #undef HAVE_FDOPENDIR */\n\n/* Define to 1 if you have the 'flock' function. */\n/* #undef HAVE_FLOCK */\n\n/* Define to 1 if you have the 'fsetxattr' function. */\n/* #undef HAVE_FSETXATTR */\n\n/* Define to 1 if you have the 'fstatat' function. */\n/* #undef HAVE_FSTATAT */\n\n/* Define to 1 if you have the 'futimens' function. */\n/* #undef HAVE_FUTIMENS */\n\n/* Define to 1 if you have the 'getopt_long_only' function. */\n#define HAVE_GETOPT_LONG_ONLY 1\n\n/* Define to 1 if you have the <glob.h> header file. */\n/* #undef HAVE_GLOB_H */\n\n/* Define to 1 if you have the <inttypes.h> header file. */\n#define HAVE_INTTYPES_H 1\n\n/* Define to 1 if you have the 'lgetxattr' function. */\n/* #undef HAVE_LGETXATTR */\n\n/* Define to 1 if you have the 'rt' library (-lrt). */\n/* #undef HAVE_LIBRT */\n\n/* Define to 1 if you have the 'llistxattr' function. */\n/* #undef HAVE_LLISTXATTR */\n\n/* Define to 1 if you have the 'lsetxattr' function. */\n/* #undef HAVE_LSETXATTR */\n\n/* Define to 1 if you have the <machine/endian.h> header file. */\n/* #undef HAVE_MACHINE_ENDIAN_H */\n\n/* Define to 1 if you have the 'mempcpy' function. */\n/* #undef HAVE_MEMPCPY */\n\n/* Define to 1 if you have the 'openat' function. */\n/* #undef HAVE_OPENAT */\n\n/* Define to 1 if you have the 'posix_fallocate' function. */\n/* #undef HAVE_POSIX_FALLOCATE */\n\n/* Define if you have POSIX threads libraries and header files. */\n/* #undef HAVE_PTHREAD */\n\n/* Have PTHREAD_PRIO_INHERIT. */\n/* #undef HAVE_PTHREAD_PRIO_INHERIT */\n\n/* Define to 1 if you have the 'readlinkat' function. */\n/* #undef HAVE_READLINKAT */\n\n/* Define to 1 if stat() supports nanosecond precision timestamps */\n/* #undef HAVE_STAT_NANOSECOND_PRECISION */\n\n/* Define to 1 if you have the <stdarg.h> header file. */\n#define HAVE_STDARG_H 1\n\n/* Define to 1 if you have the <stddef.h> header file. */\n#define HAVE_STDDEF_H 1\n\n/* Define to 1 if you have the <stdint.h> header file. */\n#define HAVE_STDINT_H 1\n\n/* Define to 1 if you have the <stdio.h> header file. */\n#define HAVE_STDIO_H 1\n\n/* Define to 1 if you have the <stdlib.h> header file. */\n#define HAVE_STDLIB_H 1\n\n/* Define to 1 if you have the <strings.h> header file. */\n#define HAVE_STRINGS_H 1\n\n/* Define to 1 if you have the <string.h> header file. */\n#define HAVE_STRING_H 1\n\n/* Define to 1 if you have the <sys/byteorder.h> header file. */\n/* #undef HAVE_SYS_BYTEORDER_H */\n\n/* Define to 1 if you have the <sys/endian.h> header file. */\n/* #undef HAVE_SYS_ENDIAN_H */\n\n/* Define to 1 if you have the <sys/file.h> header file. */\n#define HAVE_SYS_FILE_H 1\n\n/* Define to 1 if you have the <sys/stat.h> header file. */\n#define HAVE_SYS_STAT_H 1\n\n/* Define to 1 if you have the <sys/syscall.h> header file. */\n/* #undef HAVE_SYS_SYSCALL_H */\n\n/* Define to 1 if you have the <sys/sysctl.h> header file. */\n/* #undef HAVE_SYS_SYSCTL_H */\n\n/* Define to 1 if you have the <sys/times.h> header file. */\n/* #undef HAVE_SYS_TIMES_H */\n\n/* Define to 1 if you have the <sys/types.h> header file. */\n#define HAVE_SYS_TYPES_H 1\n\n/* Define to 1 if you have the <sys/xattr.h> header file. */\n/* #undef HAVE_SYS_XATTR_H */\n\n/* Define to 1 if you have the <time.h> header file. */\n#define HAVE_TIME_H 1\n\n/* Define to 1 if you have the <unistd.h> header file. */\n#define HAVE_UNISTD_H 1\n\n/* Define to 1 if you have the 'utimensat' function. */\n/* #undef HAVE_UTIMENSAT */\n\n/* Define to 1 if you have the <utime.h> header file. */\n#define HAVE_UTIME_H 1\n\n/* Define to the sub-directory where libtool stores uninstalled libraries. */\n#define LT_OBJDIR \".libs/\"\n\n#ifndef PACKAGE\n/* Name of package */\n#define PACKAGE \"wimlib\"\n\n/* Define to the address where bug reports for this package should be sent. */\n#define PACKAGE_BUGREPORT \"https://wimlib.net/forums/\"\n\n/* Define to the full name of this package. */\n#define PACKAGE_NAME \"wimlib\"\n\n/* Define to the full name and version of this package. */\n#define PACKAGE_STRING \"wimlib 1.14.4-3-g4a34203c\"\n\n/* Define to the one symbol short name of this package. */\n#define PACKAGE_TARNAME \"wimlib\"\n\n/* Define to the home page for this package. */\n#define PACKAGE_URL \"\"\n\n/* Define to the version of this package. */\n#define PACKAGE_VERSION \"1.14.4-3-g4a34203c\"\n\n/* Version number of package */\n#define VERSION \"1.14.4-3-g4a34203c\"\n#endif\n\n/* Define to necessary symbol if this constant uses a non-standard name on\n   your system. */\n/* #undef PTHREAD_CREATE_JOINABLE */\n\n/* Define to 1 if all of the C89 standard headers exist (not just the ones\n   required in a freestanding environment). This macro is provided for\n   backward compatibility; new code need not use it. */\n#define STDC_HEADERS 1\n\n/* Define to 1 if using FUSE support */\n/* #undef WITH_FUSE */\n\n/* Define to 1 if using NTFS-3G support */\n/* #undef WITH_NTFS_3G */\n\n/* Define to 1 if using libcdio support */\n#define WITH_LIBCDIO 1\n\n/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most\n   significant byte first (like Motorola and SPARC, unlike Intel). */\n#if defined AC_APPLE_UNIVERSAL_BUILD\n# if defined __BIG_ENDIAN__\n#  define WORDS_BIGENDIAN 1\n# endif\n#else\n# ifndef WORDS_BIGENDIAN\n/* #  undef WORDS_BIGENDIAN */\n# endif\n#endif\n"
  },
  {
    "path": "src/wimlib/cpu_features.c",
    "content": "/*\n * cpu_features.c - runtime CPU feature detection\n *\n * Copyright 2022-2023 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/cpu_features.h\"\n\n#if CPU_FEATURES_ENABLED\n\n#include \"wimlib/util.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)\n\n/*\n * With old GCC versions we have to manually save and restore the x86_32 PIC\n * register (ebx).  See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47602\n */\n#if defined(__i386__) && defined(__PIC__)\n#  define EBX_CONSTRAINT \"=&r\"\n#else\n#  define EBX_CONSTRAINT \"=b\"\n#endif\n\n#if defined(_MSC_VER)\n#include <intrin.h>\n\n#define read_xcr _xgetbv\n\nstatic inline void\ncpuid(u32 leaf, u32 subleaf, u32* a, u32* b, u32* c, u32* d)\n{\n\tint regs[4];\n\t__cpuidex(regs, leaf, subleaf);\n\t*a = (uint32_t)regs[0];\n\t*b = (uint32_t)regs[1];\n\t*c = (uint32_t)regs[2];\n\t*d = (uint32_t)regs[3];\n}\n\n#else\n\n/* Execute the CPUID instruction. */\nstatic inline void\ncpuid(u32 leaf, u32 subleaf, u32 *a, u32 *b, u32 *c, u32 *d)\n{\n\tasm volatile(\".ifnc %%ebx, %1; mov  %%ebx, %1; .endif\\n\"\n\t\t     \"cpuid                                  \\n\"\n\t\t     \".ifnc %%ebx, %1; xchg %%ebx, %1; .endif\\n\"\n\t\t     : \"=a\" (*a), EBX_CONSTRAINT (*b), \"=c\" (*c), \"=d\" (*d)\n\t\t     : \"a\" (leaf), \"c\" (subleaf));\n}\n\n/* Read an extended control register. */\nstatic inline u64\nread_xcr(u32 index)\n{\n\tu32 d, a;\n\n\t/*\n\t * Execute the \"xgetbv\" instruction.  Old versions of binutils do not\n\t * recognize this instruction, so list the raw bytes instead.\n\t *\n\t * This must be 'volatile' to prevent this code from being moved out\n\t * from under the check for OSXSAVE.\n\t */\n\tasm volatile(\".byte 0x0f, 0x01, 0xd0\" :\n\t\t     \"=d\" (d), \"=a\" (a) : \"c\" (index));\n\n\treturn ((u64)d << 32) | a;\n}\n#endif\n\nstatic u32\nget_cpu_features(void)\n{\n\tu32 max_leaf, a, b, c, d;\n\tu64 xcr0 = 0;\n\tu32 features = 0;\n\n\t/* EAX=0: Highest Function Parameter and Manufacturer ID */\n\tcpuid(0, 0, &max_leaf, &b, &c, &d);\n\tif (max_leaf < 1)\n\t\treturn features;\n\n\t/* EAX=1: Processor Info and Feature Bits */\n\tcpuid(1, 0, &a, &b, &c, &d);\n\tif (c & (1 << 9))\n\t\tfeatures |= X86_CPU_FEATURE_SSSE3;\n\tif (c & (1 << 19))\n\t\tfeatures |= X86_CPU_FEATURE_SSE4_1;\n\tif (c & (1 << 20))\n\t\tfeatures |= X86_CPU_FEATURE_SSE4_2;\n\tif (c & (1 << 27))\n\t\txcr0 = read_xcr(0);\n\tif ((c & (1 << 28)) && ((xcr0 & 0x6) == 0x6))\n\t\tfeatures |= X86_CPU_FEATURE_AVX;\n\n\tif (max_leaf < 7)\n\t\treturn features;\n\n\t/* EAX=7, ECX=0: Extended Features */\n\tcpuid(7, 0, &a, &b, &c, &d);\n\tif (b & (1 << 8))\n\t\tfeatures |= X86_CPU_FEATURE_BMI2;\n\tif (b & (1 << 29))\n\t\tfeatures |= X86_CPU_FEATURE_SHA;\n\n\treturn features;\n}\n\n#elif defined(__aarch64__) && defined(__linux__)\n\n/*\n * On Linux, arm32 and arm64 CPU features can be detected by reading the\n * AT_HWCAP and AT_HWCAP2 values from /proc/self/auxv.\n *\n * Ideally we'd use the C library function getauxval(), but it's not guaranteed\n * to be available: it was only added to glibc in 2.16, and in Android it was\n * added to API level 18 for arm32 and level 21 for arm64.\n */\n\n#include <errno.h>\n#include <fcntl.h>\n#include <string.h>\n#include <unistd.h>\n\n#define AT_HWCAP\t16\n#define AT_HWCAP2\t26\n\nstatic void scan_auxv(unsigned long *hwcap, unsigned long *hwcap2)\n{\n\tint fd;\n\tunsigned long auxbuf[32];\n\tint filled = 0;\n\tint i;\n\n\tfd = open(\"/proc/self/auxv\", O_RDONLY);\n\tif (fd < 0)\n\t\treturn;\n\n\tfor (;;) {\n\t\tdo {\n\t\t\tint ret = read(fd, &((char *)auxbuf)[filled],\n\t\t\t\t       sizeof(auxbuf) - filled);\n\t\t\tif (ret <= 0) {\n\t\t\t\tif (ret < 0 && errno == EINTR)\n\t\t\t\t\tcontinue;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tfilled += ret;\n\t\t} while (filled < 2 * sizeof(long));\n\n\t\ti = 0;\n\t\tdo {\n\t\t\tunsigned long type = auxbuf[i];\n\t\t\tunsigned long value = auxbuf[i + 1];\n\n\t\t\tif (type == AT_HWCAP)\n\t\t\t\t*hwcap = value;\n\t\t\telse if (type == AT_HWCAP2)\n\t\t\t\t*hwcap2 = value;\n\t\t\ti += 2;\n\t\t\tfilled -= 2 * sizeof(long);\n\t\t} while (filled >= 2 * sizeof(long));\n\n\t\tmemmove(auxbuf, &auxbuf[i], filled);\n\t}\nout:\n\tclose(fd);\n}\n\nstatic u32\nget_cpu_features(void)\n{\n\tunsigned long hwcap = 0;\n\tunsigned long hwcap2 = 0;\n\tu32 features = 0;\n\n\tscan_auxv(&hwcap, &hwcap2);\n\n\tif (hwcap & (1 << 5))\t/* HWCAP_SHA1 */\n\t\tfeatures |= ARM_CPU_FEATURE_SHA1;\n\n\treturn features;\n}\n\n#elif defined(__aarch64__) && defined(__APPLE__)\n\n/* On Apple platforms, arm64 CPU features can be detected via sysctlbyname(). */\n\n#include <sys/types.h>\n#include <sys/sysctl.h>\n\nstatic const struct {\n\tconst char *name;\n\tu32 feature;\n} feature_sysctls[] = {\n\t{ \"hw.optional.arm.FEAT_SHA1\",\tARM_CPU_FEATURE_SHA1 },\n};\n\nstatic u32\nget_cpu_features(void)\n{\n\tu32 features = 0;\n\n\tfor (size_t i = 0; i < ARRAY_LEN(feature_sysctls); i++) {\n\t\tconst char *name = feature_sysctls[i].name;\n\t\tu32 val = 0;\n\t\tsize_t valsize = sizeof(val);\n\n\t\tif (sysctlbyname(name, &val, &valsize, NULL, 0) == 0 &&\n\t\t    valsize == sizeof(val) && val == 1)\n\t\t\tfeatures |= feature_sysctls[i].feature;\n\t}\n\treturn features;\n}\n\n#elif (defined(__aarch64__) || (defined(_M_ARM64)) && defined(_WIN32))\n\n#include <windows.h>\n\nstatic u32\nget_cpu_features(void)\n{\n\tu32 features = 0;\n\n\tif (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE))\n\t\tfeatures |= ARM_CPU_FEATURE_SHA1;\n\n\treturn features;\n}\n\n#else\n#  error \"CPU_FEATURES_ENABLED was set but no implementation is available!\"\n#endif\n\nstatic const struct {\n\tconst char *name;\n\tu32 feature;\n} feature_table[] = {\n#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)\n\t{\"ssse3\",\tX86_CPU_FEATURE_SSSE3},\n\t{\"sse4.1\",\tX86_CPU_FEATURE_SSE4_1},\n\t{\"sse4.2\",\tX86_CPU_FEATURE_SSE4_2},\n\t{\"avx\",\t\tX86_CPU_FEATURE_AVX},\n\t{\"bmi2\",\tX86_CPU_FEATURE_BMI2},\n\t{\"sha\",\t\tX86_CPU_FEATURE_SHA},\n\t{\"sha1\",\tX86_CPU_FEATURE_SHA},\n#elif defined(__aarch64__) || defined(_M_ARM64)\n\t{\"sha1\",\tARM_CPU_FEATURE_SHA1},\n#else\n#  error \"CPU_FEATURES_ENABLED was set but no features are defined!\"\n#endif\n\t{\"*\",\t\t0xFFFFFFFF},\n};\n\nstatic u32\nfind_cpu_feature(const char *name, size_t namelen)\n{\n\tfor (size_t i = 0; i < ARRAY_LEN(feature_table); i++) {\n\t\tif (namelen == strlen(feature_table[i].name) &&\n\t\t    memcmp(name, feature_table[i].name, namelen) == 0)\n\t\t\treturn feature_table[i].feature;\n\t}\n\treturn 0;\n}\n\nu32 cpu_features;\n\nvoid init_cpu_features(void)\n{\n\tchar *p, *sep;\n\n\tcpu_features = get_cpu_features();\n\n\t/*\n\t * Allow disabling CPU features via an environmental variable for\n\t * testing purposes.  Syntax is comma-separated list of feature names.\n\t */\n\tp = getenv(\"WIMLIB_DISABLE_CPU_FEATURES\");\n\tif (likely(p == NULL))\n\t\treturn;\n\tfor (; (sep = strchr(p, ',')) != NULL; p = sep + 1)\n\t\tcpu_features &= ~find_cpu_feature(p, sep - p);\n\tcpu_features &= ~find_cpu_feature(p, strlen(p));\n}\n\n#endif /* CPU_FEATURES_ENABLED */\n"
  },
  {
    "path": "src/wimlib/decompress.c",
    "content": "/*\n * decompress.c\n *\n * Generic functions for decompression, wrapping around actual decompression\n * implementations.\n */\n\n/*\n * Copyright (C) 2013, 2014 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib.h\"\n#include \"wimlib/decompressor_ops.h\"\n#include \"wimlib/util.h\"\n\nstruct wimlib_decompressor {\n\tconst struct decompressor_ops *ops;\n\tsize_t max_block_size;\n\tvoid *private;\n};\n\nstatic const struct decompressor_ops * const decompressor_ops[] = {\n\t[WIMLIB_COMPRESSION_TYPE_XPRESS] = &xpress_decompressor_ops,\n\t[WIMLIB_COMPRESSION_TYPE_LZX]    = &lzx_decompressor_ops,\n\t[WIMLIB_COMPRESSION_TYPE_LZMS]   = &lzms_decompressor_ops,\n};\n\nstatic bool\ndecompressor_ctype_valid(int ctype)\n{\n\treturn (ctype >= 0 &&\n\t\tctype < ARRAY_LEN(decompressor_ops) &&\n\t\tdecompressor_ops[ctype] != NULL);\n}\n\nWIMLIBAPI int\nwimlib_create_decompressor(enum wimlib_compression_type ctype,\n\t\t\t   size_t max_block_size,\n\t\t\t   struct wimlib_decompressor **dec_ret)\n{\n\tstruct wimlib_decompressor *dec;\n\tint ret;\n\n\tret = wimlib_global_init(0);\n\tif (ret)\n\t\treturn ret;\n\n\tif (!decompressor_ctype_valid(ctype))\n\t\treturn WIMLIB_ERR_INVALID_COMPRESSION_TYPE;\n\n\tif (dec_ret == NULL)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (max_block_size == 0)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tdec = MALLOC(sizeof(*dec));\n\tif (dec == NULL)\n\t\treturn WIMLIB_ERR_NOMEM;\n\tdec->ops = decompressor_ops[ctype];\n\tdec->max_block_size = max_block_size;\n\tdec->private = NULL;\n\tif (dec->ops->create_decompressor) {\n\t\tret = dec->ops->create_decompressor(max_block_size,\n\t\t\t\t\t\t    &dec->private);\n\t\tif (ret) {\n\t\t\tFREE(dec);\n\t\t\treturn ret;\n\t\t}\n\t}\n\t*dec_ret = dec;\n\treturn 0;\n}\n\nWIMLIBAPI int\nwimlib_decompress(const void *compressed_data, size_t compressed_size,\n\t\t  void *uncompressed_data, size_t uncompressed_size,\n\t\t  struct wimlib_decompressor *dec)\n{\n\tif (unlikely(uncompressed_size > dec->max_block_size))\n\t\treturn -2;\n\n\treturn dec->ops->decompress(compressed_data, compressed_size,\n\t\t\t\t    uncompressed_data, uncompressed_size,\n\t\t\t\t    dec->private);\n}\n\nWIMLIBAPI void\nwimlib_free_decompressor(struct wimlib_decompressor *dec)\n{\n\tif (dec) {\n\t\tif (dec->ops->free_decompressor)\n\t\t\tdec->ops->free_decompressor(dec->private);\n\t\tFREE(dec);\n\t}\n}\n"
  },
  {
    "path": "src/wimlib/decompress_common.c",
    "content": "/*\n * decompress_common.c\n *\n * Code for decompression shared among multiple compression formats.\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <string.h>\n\n#ifdef __SSE2__\n#  include <emmintrin.h>\n#endif\n\n#include \"wimlib/decompress_common.h\"\n\n/*\n * make_huffman_decode_table() -\n *\n * Given an alphabet of symbols and the length of each symbol's codeword in a\n * canonical prefix code, build a table for quickly decoding symbols that were\n * encoded with that code.\n *\n * A _prefix code_ is an assignment of bitstrings called _codewords_ to symbols\n * such that no whole codeword is a prefix of any other.  A prefix code might be\n * a _Huffman code_, which means that it is an optimum prefix code for a given\n * list of symbol frequencies and was generated by the Huffman algorithm.\n * Although the prefix codes processed here will ordinarily be \"Huffman codes\",\n * strictly speaking the decoder cannot know whether a given code was actually\n * generated by the Huffman algorithm or not.\n *\n * A prefix code is _canonical_ if and only if a longer codeword never\n * lexicographically precedes a shorter codeword, and the lexicographic ordering\n * of codewords of equal length is the same as the lexicographic ordering of the\n * corresponding symbols.  The advantage of using a canonical prefix code is\n * that the codewords can be reconstructed from only the symbol => codeword\n * length mapping.  This eliminates the need to transmit the codewords\n * explicitly.  Instead, they can be enumerated in lexicographic order after\n * sorting the symbols primarily by increasing codeword length and secondarily\n * by increasing symbol value.\n *\n * However, the decoder's real goal is to decode symbols with the code, not just\n * generate the list of codewords.  Consequently, this function directly builds\n * a table for efficiently decoding symbols using the code.  The basic idea is\n * that given the next 'max_codeword_len' bits of input, the decoder can look up\n * the next decoded symbol by indexing a table containing '2^max_codeword_len'\n * entries.  A codeword with length 'max_codeword_len' will have exactly one\n * entry in this table, whereas a codeword shorter than 'max_codeword_len' will\n * have multiple entries in this table.  Precisely, a codeword of length 'n'\n * will have '2^(max_codeword_len - n)' entries.  The index of each such entry,\n * considered as a bitstring of length 'max_codeword_len', will contain the\n * corresponding codeword as a prefix.\n *\n * That's the basic idea, but we extend it in two ways:\n *\n * - Often the maximum codeword length is too long for it to be efficient to\n *   build the full decode table whenever a new code is used.  Instead, we build\n *   a \"root\" table using only '2^table_bits' entries, where 'table_bits <=\n *   max_codeword_len'.  Then, a lookup of 'table_bits' bits produces either a\n *   symbol directly (for codewords not longer than 'table_bits'), or the index\n *   of a subtable which must be indexed with additional bits of input to fully\n *   decode the symbol (for codewords longer than 'table_bits').\n *\n * - Whenever the decoder decodes a symbol, it needs to know the codeword length\n *   so that it can remove the appropriate number of input bits.  The obvious\n *   solution would be to simply retain the codeword lengths array and use the\n *   decoded symbol as an index into it.  However, that would require two array\n *   accesses when decoding each symbol.  Our strategy is to instead store the\n *   codeword length directly in the decode table entry along with the symbol.\n *\n * See MAKE_DECODE_TABLE_ENTRY() for full details on the format of decode table\n * entries, and see read_huffsym() for full details on how symbols are decoded.\n *\n * @decode_table:\n *\tThe array in which to build the decode table.  This must have been\n *\tdeclared by the DECODE_TABLE() macro.  This may alias @lens, since all\n *\t@lens are consumed before the decode table is written to.\n *\n * @num_syms:\n *\tThe number of symbols in the alphabet.\n *\n * @table_bits:\n *\tThe log base 2 of the number of entries in the root table.\n *\n * @lens:\n *\tAn array of length @num_syms, indexed by symbol, that gives the length\n *\tof the codeword, in bits, for each symbol.  The length can be 0, which\n *\tmeans that the symbol does not have a codeword assigned.  In addition,\n *\t@lens may alias @decode_table, as noted above.\n *\n * @max_codeword_len:\n *\tThe maximum codeword length permitted for this code.  All entries in\n *\t'lens' must be less than or equal to this value.\n *\n * @working_space\n *\tA temporary array that was declared with DECODE_TABLE_WORKING_SPACE().\n *\n * Returns 0 on success, or -1 if the lengths do not form a valid prefix code.\n */\nint\nmake_huffman_decode_table(u16 decode_table[], unsigned num_syms,\n\t\t\t  unsigned table_bits, const u8 lens[],\n\t\t\t  unsigned max_codeword_len, u16 working_space[])\n{\n\tu16 * const len_counts = &working_space[0];\n\tu16 * const offsets = &working_space[1 * (max_codeword_len + 1)];\n\tu16 * const sorted_syms = &working_space[2 * (max_codeword_len + 1)];\n\ts32 remainder = 1;\n\tvoid *entry_ptr = decode_table;\n\tunsigned codeword_len = 1;\n\tunsigned sym_idx;\n\tunsigned codeword;\n\tunsigned subtable_pos;\n\tunsigned subtable_bits;\n\tunsigned subtable_prefix;\n\n\t/* Count how many codewords have each length, including 0.  */\n\tfor (unsigned len = 0; len <= max_codeword_len; len++)\n\t\tlen_counts[len] = 0;\n\tfor (unsigned sym = 0; sym < num_syms; sym++)\n\t\tlen_counts[lens[sym]]++;\n\n\t/* It is already guaranteed that all lengths are <= max_codeword_len,\n\t * but it cannot be assumed they form a complete prefix code.  A\n\t * codeword of length n should require a proportion of the codespace\n\t * equaling (1/2)^n.  The code is complete if and only if, by this\n\t * measure, the codespace is exactly filled by the lengths.  */\n\tfor (unsigned len = 1; len <= max_codeword_len; len++) {\n\t\tremainder = (remainder << 1) - len_counts[len];\n\t\t/* Do the lengths overflow the codespace? */\n\t\tif (unlikely(remainder < 0))\n\t\t\treturn -1;\n\t}\n\n\tif (remainder != 0) {\n\t\t/* The lengths do not fill the codespace; that is, they form an\n\t\t * incomplete code.  This is permitted only if the code is empty\n\t\t * (contains no symbols). */\n\n\t\tif (unlikely(remainder != 1U << max_codeword_len))\n\t\t\treturn -1;\n\n\t\t/* The code is empty.  When processing a well-formed stream, the\n\t\t * decode table need not be initialized in this case.  However,\n\t\t * we cannot assume the stream is well-formed, so we must\n\t\t * initialize the decode table anyway.  Setting all entries to 0\n\t\t * makes the decode table always produce symbol '0' without\n\t\t * consuming any bits, which is good enough. */\n\t\tmemset(decode_table, 0, sizeof(decode_table[0]) << table_bits);\n\t\treturn 0;\n\t}\n\n\t/* Sort the symbols primarily by increasing codeword length and\n\t * secondarily by increasing symbol value. */\n\n\t/* Initialize 'offsets' so that 'offsets[len]' is the number of\n\t * codewords shorter than 'len' bits, including length 0. */\n\toffsets[0] = 0;\n\tfor (unsigned len = 0; len < max_codeword_len; len++)\n\t\toffsets[len + 1] = offsets[len] + len_counts[len];\n\n\t/* Use the 'offsets' array to sort the symbols. */\n\tfor (unsigned sym = 0; sym < num_syms; sym++)\n\t\tsorted_syms[offsets[lens[sym]]++] = sym;\n\n\t/*\n\t * Fill the root table entries for codewords no longer than table_bits.\n\t *\n\t * The table will start with entries for the shortest codeword(s), which\n\t * will have the most entries.  From there, the number of entries per\n\t * codeword will decrease.  As an optimization, we may begin filling\n\t * entries with SSE2 vector accesses (8 entries/store), then change to\n\t * word accesses (2 or 4 entries/store), then change to 16-bit accesses\n\t * (1 entry/store).\n\t */\n\tsym_idx = offsets[0];\n\n#ifdef __SSE2__\n\t/* Fill entries one 128-bit vector (8 entries) at a time. */\n\tfor (unsigned stores_per_loop = (1U << (table_bits - codeword_len)) /\n\t\t\t\t    (sizeof(__m128i) / sizeof(decode_table[0]));\n\t     stores_per_loop != 0; codeword_len++, stores_per_loop >>= 1)\n\t{\n\t\tunsigned end_sym_idx = sym_idx + len_counts[codeword_len];\n\t\tfor (; sym_idx < end_sym_idx; sym_idx++) {\n\t\t\t/* Note: unlike in the \"word\" version below, the __m128i\n\t\t\t * type already has __attribute__((may_alias)), so using\n\t\t\t * it to access an array of u16 will not violate strict\n\t\t\t * aliasing.  */\n\t\t\t__m128i v = _mm_set1_epi16(\n\t\t\t\tMAKE_DECODE_TABLE_ENTRY(sorted_syms[sym_idx],\n\t\t\t\t\t\t\tcodeword_len));\n\t\t\tunsigned n = stores_per_loop;\n\t\t\tdo {\n\t\t\t\t*(__m128i *)entry_ptr = v;\n\t\t\t\tentry_ptr = _PTR(entry_ptr + sizeof(v));\n\t\t\t} while (--n);\n\t\t}\n\t}\n#endif /* __SSE2__ */\n\n#ifdef __GNUC__\n\t/* Fill entries one word (2 or 4 entries) at a time. */\n\tfor (unsigned stores_per_loop = (1U << (table_bits - codeword_len)) /\n\t\t\t\t\t(WORDBYTES / sizeof(decode_table[0]));\n\t     stores_per_loop != 0; codeword_len++, stores_per_loop >>= 1)\n\t{\n\t\tunsigned end_sym_idx = sym_idx + len_counts[codeword_len];\n\t\tfor (; sym_idx < end_sym_idx; sym_idx++) {\n\n\t\t\t/* Accessing the array of u16 as u32 or u64 would\n\t\t\t * violate strict aliasing and would require compiling\n\t\t\t * the code with -fno-strict-aliasing to guarantee\n\t\t\t * correctness.  To work around this problem, use the\n\t\t\t * gcc 'may_alias' extension.  */\n\t\t\ttypedef machine_word_t\n\t\t\t\t__attribute__((may_alias)) aliased_word_t;\n\t\t\taliased_word_t v = repeat_u16(\n\t\t\t\tMAKE_DECODE_TABLE_ENTRY(sorted_syms[sym_idx],\n\t\t\t\t\t\t\tcodeword_len));\n\t\t\tunsigned n = stores_per_loop;\n\t\t\tdo {\n\t\t\t\t*(aliased_word_t *)entry_ptr = v;\n\t\t\t\tentry_ptr = _PTR(entry_ptr + sizeof(v));\n\t\t\t} while (--n);\n\t\t}\n\t}\n#endif /* __GNUC__ */\n\n\t/* Fill entries one at a time. */\n\tfor (unsigned stores_per_loop = (1U << (table_bits - codeword_len));\n\t     stores_per_loop != 0; codeword_len++, stores_per_loop >>= 1)\n\t{\n\t\tunsigned end_sym_idx = sym_idx + len_counts[codeword_len];\n\t\tfor (; sym_idx < end_sym_idx; sym_idx++) {\n\t\t\tu16 v = MAKE_DECODE_TABLE_ENTRY(sorted_syms[sym_idx],\n\t\t\t\t\t\t\tcodeword_len);\n\t\t\tunsigned n = stores_per_loop;\n\t\t\tdo {\n\t\t\t\t*(u16 *)entry_ptr = v;\n\t\t\t\tentry_ptr = _PTR(entry_ptr + sizeof(v));\n\t\t\t} while (--n);\n\t\t}\n\t}\n\n\t/* If all symbols were processed, then no subtables are required. */\n\tif (sym_idx == num_syms)\n\t\treturn 0;\n\n\t/* At least one subtable is required.  Process the remaining symbols. */\n\tcodeword = ((u16 *)entry_ptr - decode_table) << 1;\n\tsubtable_pos = 1U << table_bits;\n\tsubtable_bits = table_bits;\n\tsubtable_prefix = -1;\n\tdo {\n\t\twhile (len_counts[codeword_len] == 0) {\n\t\t\tcodeword_len++;\n\t\t\tcodeword <<= 1;\n\t\t}\n\n\t\tunsigned prefix = codeword >> (codeword_len - table_bits);\n\n\t\t/* Start a new subtable if the first 'table_bits' bits of the\n\t\t * codeword don't match the prefix for the previous subtable, or\n\t\t * if this will be the first subtable. */\n\t\tif (prefix != subtable_prefix) {\n\n\t\t\tsubtable_prefix = prefix;\n\n\t\t\t/*\n\t\t\t * Calculate the subtable length.  If the codeword\n\t\t\t * length exceeds 'table_bits' by n, then the subtable\n\t\t\t * needs at least 2^n entries.  But it may need more; if\n\t\t\t * there are fewer than 2^n codewords of length\n\t\t\t * 'table_bits + n' remaining, then n will need to be\n\t\t\t * incremented to bring in longer codewords until the\n\t\t\t * subtable can be filled completely.  Note that it\n\t\t\t * always will, eventually, be possible to fill the\n\t\t\t * subtable, since it was previously verified that the\n\t\t\t * code is complete.\n\t\t\t */\n\t\t\tsubtable_bits = codeword_len - table_bits;\n\t\t\tremainder = (s32)1 << subtable_bits;\n\t\t\tfor (;;) {\n\t\t\t\tremainder -= len_counts[table_bits +\n\t\t\t\t\t\t\tsubtable_bits];\n\t\t\t\tif (remainder <= 0)\n\t\t\t\t\tbreak;\n\t\t\t\tsubtable_bits++;\n\t\t\t\tremainder <<= 1;\n\t\t\t}\n\n\t\t\t/* Create the entry that points from the root table to\n\t\t\t * the subtable.  This entry contains the index of the\n\t\t\t * start of the subtable and the number of bits with\n\t\t\t * which the subtable is indexed (the log base 2 of the\n\t\t\t * number of entries it contains).  */\n\t\t\tdecode_table[subtable_prefix] =\n\t\t\t\tMAKE_DECODE_TABLE_ENTRY(subtable_pos,\n\t\t\t\t\t\t\tsubtable_bits);\n\t\t}\n\n\t\t/* Fill the subtable entries for this symbol. */\n\t\tu16 entry = MAKE_DECODE_TABLE_ENTRY(sorted_syms[sym_idx],\n\t\t\t\t\t\t    codeword_len - table_bits);\n\t\tunsigned n = 1U << (subtable_bits - (codeword_len -\n\t\t\t\t\t\t     table_bits));\n\t\tdo {\n\t\t\tdecode_table[subtable_pos++] = entry;\n\t\t} while (--n);\n\n\t\tlen_counts[codeword_len]--;\n\t\tcodeword++;\n\t} while (++sym_idx < num_syms);\n\n\treturn 0;\n}\n"
  },
  {
    "path": "src/wimlib/dentry.c",
    "content": "/*\n * dentry.c - see description below\n */\n\n/*\n * Copyright 2012-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n/*\n * This file contains logic to deal with WIM directory entries, or \"dentries\":\n *\n *  - Reading a dentry tree from a metadata resource in a WIM file\n *  - Writing a dentry tree to a metadata resource in a WIM file\n *  - Iterating through a tree of WIM dentries\n *  - Path lookup: translating a path into a WIM dentry or inode\n *  - Creating, modifying, and deleting WIM dentries\n *\n * Notes:\n *\n *  - A WIM file can contain multiple images, each of which has an independent\n *    tree of dentries.  \"On disk\", the dentry tree for an image is stored in\n *    the \"metadata resource\" for that image.\n *\n *  - Multiple dentries in an image may correspond to the same inode, or \"file\".\n *    When this occurs, it means that the file has multiple names, or \"hard\n *    links\".  A dentry is not a file, but rather the name of a file!\n *\n *  - Inodes are not represented explicitly in the WIM file format.  Instead,\n *    the metadata resource provides a \"hard link group ID\" for each dentry.\n *    wimlib handles pulling out actual inodes from this information, but this\n *    occurs in inode_fixup.c and not in this file.\n *\n *  - wimlib does not allow *directory* hard links, so a WIM image really does\n *    have a *tree* of dentries (and not an arbitrary graph of dentries).\n *\n *  - wimlib supports both case-sensitive and case-insensitive path lookups.\n *    The implementation uses a single in-memory index per directory, using a\n *    collation order like that used by NTFS; see collate_dentry_names().\n *\n *  - Multiple dentries in a directory might have the same case-insensitive\n *    name.  But wimlib enforces that at most one dentry in a directory can have\n *    a given case-sensitive name.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/inode.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/paths.h\"\n\n/* On-disk format of a WIM dentry (directory entry), located in the metadata\n * resource for a WIM image.  */\nPRAGMA_BEGIN_PACKED\nstruct wim_dentry_on_disk {\n\n\t/* Length of this directory entry in bytes, not including any extra\n\t * stream entries.  Should be a multiple of 8 so that the following\n\t * dentry or extra stream entry is aligned on an 8-byte boundary.  (If\n\t * not, wimlib will round it up.)  It must be at least as long as the\n\t * fixed-length fields of the dentry (WIM_DENTRY_DISK_SIZE), plus the\n\t * lengths of the file name and/or short name if present, plus the size\n\t * of any \"extra\" data.\n\t *\n\t * It is also possible for this field to be 0.  This case indicates the\n\t * end of a list of sibling entries in a directory.  It also means the\n\t * real length is 8, because the dentry included only the length field,\n\t * but that takes up 8 bytes.  */\n\tle64 length;\n\n\t/* File attributes for the file or directory.  This is a bitwise OR of\n\t * the FILE_ATTRIBUTE_* constants and should correspond to the value\n\t * retrieved by GetFileAttributes() on Windows. */\n\tle32 attributes;\n\n\t/* A value that specifies the security descriptor for this file or\n\t * directory.  If 0xFFFFFFFF, the file or directory has no security\n\t * descriptor.  Otherwise, it is a 0-based index into the WIM image's\n\t * table of security descriptors (see: `struct wim_security_data') */\n\tle32 security_id;\n\n\t/* Offset, in bytes, from the start of the uncompressed metadata\n\t * resource of this directory's child directory entries, or 0 if this\n\t * directory entry does not correspond to a directory or otherwise does\n\t * not have any children. */\n\tle64 subdir_offset;\n\n\t/* Reserved fields */\n\tle64 unused_1;\n\tle64 unused_2;\n\n\t/* Creation time, last access time, and last write time, in\n\t * 100-nanosecond intervals since 12:00 a.m UTC January 1, 1601.  They\n\t * should correspond to the times gotten by calling GetFileTime() on\n\t * Windows. */\n\tle64 creation_time;\n\tle64 last_access_time;\n\tle64 last_write_time;\n\n\t/*\n\t * Usually this is the SHA-1 message digest of the file's contents, or\n\t * all zeroes if the file is a directory or is empty.  However, special\n\t * rules apply if the file has FILE_ATTRIBUTE_REPARSE_POINT set or has\n\t * named data streams.  See assign_stream_types_unencrypted().\n\t */\n\tu8 main_hash[SHA1_HASH_SIZE];\n\n\t/* Unknown field (maybe accidental padding)  */\n\tle32 unknown_0x54;\n\n\t/*\n\t * The following 8-byte union contains either information about the\n\t * reparse point (for files with FILE_ATTRIBUTE_REPARSE_POINT set), or\n\t * the \"hard link group ID\" (for other files).\n\t *\n\t * The reparse point information contains ReparseTag and ReparseReserved\n\t * from the header of the reparse point buffer.  It also contains a flag\n\t * that indicates whether a reparse point fixup (for the target of an\n\t * absolute symbolic link or junction) was done or not.\n\t *\n\t * The \"hard link group ID\" is like an inode number; all dentries for\n\t * the same inode share the same value.  See inode_fixup.c for more\n\t * information.\n\t *\n\t * Note that this union creates the limitation that reparse point files\n\t * cannot have multiple names (hard links).\n\t */\n\tunion {\n\t\tstruct {\n\t\t\tle32 reparse_tag;\n\t\t\tle16 rp_reserved;\n\t\t\tle16 rp_flags;\n\t\t} __attribute__((packed)) reparse;\n\t\tstruct {\n\t\t\tle64 hard_link_group_id;\n\t\t} __attribute__((packed)) nonreparse;\n\t};\n\n\t/* Number of extra stream entries that directly follow this dentry\n\t * on-disk.  */\n\tle16 num_extra_streams;\n\n\t/* If nonzero, this is the length, in bytes, of this dentry's UTF-16LE\n\t * encoded short name (8.3 DOS-compatible name), excluding the null\n\t * terminator.  If zero, then the long name of this dentry does not have\n\t * a corresponding short name (but this does not exclude the possibility\n\t * that another dentry for the same file has a short name).  */\n\tle16 short_name_nbytes;\n\n\t/* If nonzero, this is the length, in bytes, of this dentry's UTF-16LE\n\t * encoded \"long\" name, excluding the null terminator.  If zero, then\n\t * this file has no long name.  The root dentry should not have a long\n\t * name, but all other dentries in the image should have long names.  */\n\tle16 name_nbytes;\n\n\t/* Beginning of optional, variable-length fields  */\n\n\t/* If name_nbytes != 0, the next field will be the UTF-16LE encoded long\n\t * name.  This will be null-terminated, so the size of this field will\n\t * really be name_nbytes + 2.  */\n\t/*utf16lechar name[];*/\n\n\t/* If short_name_nbytes != 0, the next field will be the UTF-16LE\n\t * encoded short name.  This will be null-terminated, so the size of\n\t * this field will really be short_name_nbytes + 2.  */\n\t/*utf16lechar short_name[];*/\n\n\t/* If there is still space in the dentry (according to the 'length'\n\t * field) after 8-byte alignment, then the remaining space will be a\n\t * variable-length list of tagged metadata items.  See tagged_items.c\n\t * for more information.  */\n\t/* u8 tagged_items[] __attribute__((aligned(8))); */\n\n} __attribute__((packed));\n\t/* If num_extra_streams != 0, then there are that many extra stream\n\t * entries following the dentry, starting on the next 8-byte aligned\n\t * boundary.  They are not counted in the 'length' field of the dentry.\n\t */\n\n/* On-disk format of an extra stream entry.  This represents an extra NTFS-style\n * \"stream\" associated with the file, such as a named data stream.  */\nstruct wim_extra_stream_entry_on_disk {\n\n\t/* Length of this extra stream entry, in bytes.  This includes all\n\t * fixed-length fields, plus the name and null terminator if present,\n\t * and any needed padding such that the length is a multiple of 8.  */\n\tle64 length;\n\n\t/* Reserved field  */\n\tle64 reserved;\n\n\t/* SHA-1 message digest of this stream's uncompressed data, or all\n\t * zeroes if this stream's data is of zero length.  */\n\tu8 hash[SHA1_HASH_SIZE];\n\n\t/* Length of this stream's name, in bytes and excluding the null\n\t * terminator; or 0 if this stream is unnamed.  */\n\tle16 name_nbytes;\n\n\t/* Stream name in UTF-16LE.  It is @name_nbytes bytes long, excluding\n\t * the null terminator.  There is a null terminator character if\n\t * @name_nbytes != 0; i.e., if this stream is named.  */\n\tutf16lechar name[];\n} __attribute__((packed));\nPRAGMA_END_PACKED\n\nstatic void\ndo_dentry_set_name(struct wim_dentry *dentry, utf16lechar *name,\n\t\t   size_t name_nbytes)\n{\n\tFREE(dentry->d_name);\n\tdentry->d_name = name;\n\tdentry->d_name_nbytes = name_nbytes;\n\n\tif (dentry_has_short_name(dentry)) {\n\t\tFREE(dentry->d_short_name);\n\t\tdentry->d_short_name = NULL;\n\t\tdentry->d_short_name_nbytes = 0;\n\t}\n}\n\n/*\n * Set the name of a WIM dentry from a UTF-16LE string.\n *\n * This sets the long name of the dentry.  The short name will automatically be\n * removed, since it may not be appropriate for the new long name.\n *\n * The @name string need not be null-terminated, since its length is specified\n * in @name_nbytes.\n *\n * If @name_nbytes is 0, both the long and short names of the dentry will be\n * removed.\n *\n * Only use this function on unlinked dentries, since it doesn't update the name\n * indices.  For dentries that are currently linked into the tree, use\n * rename_wim_path().\n *\n * Returns 0 or WIMLIB_ERR_NOMEM.\n */\nint\ndentry_set_name_utf16le(struct wim_dentry *dentry, const utf16lechar *name,\n\t\t\tsize_t name_nbytes)\n{\n\tutf16lechar *dup = NULL;\n\n\tif (name_nbytes) {\n\t\tdup = utf16le_dupz(name, name_nbytes);\n\t\tif (!dup)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\tdo_dentry_set_name(dentry, dup, name_nbytes);\n\treturn 0;\n}\n\n\n/*\n * Set the name of a WIM dentry from a 'tchar' string.\n *\n * This sets the long name of the dentry.  The short name will automatically be\n * removed, since it may not be appropriate for the new long name.\n *\n * If @name is NULL or empty, both the long and short names of the dentry will\n * be removed.\n *\n * Only use this function on unlinked dentries, since it doesn't update the name\n * indices.  For dentries that are currently linked into the tree, use\n * rename_wim_path().\n *\n * Returns 0 or an error code resulting from a failed string conversion.\n */\nint\ndentry_set_name(struct wim_dentry *dentry, const tchar *name)\n{\n\tutf16lechar *name_utf16le = NULL;\n\tsize_t name_utf16le_nbytes = 0;\n\tint ret;\n\n\tif (name && *name) {\n\t\tret = tstr_to_utf16le(name, tstrlen(name) * sizeof(tchar),\n\t\t\t\t      &name_utf16le, &name_utf16le_nbytes);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tdo_dentry_set_name(dentry, name_utf16le, name_utf16le_nbytes);\n\treturn 0;\n}\n\n/* Calculate the minimum unaligned length, in bytes, of an on-disk WIM dentry\n * that has names of the specified lengths.  (Zero length means the\n * corresponding name actually does not exist.)  The returned value excludes\n * tagged metadata items as well as any extra stream entries that may need to\n * follow the dentry.  */\nstatic size_t\ndentry_min_len_with_names(u16 name_nbytes, u16 short_name_nbytes)\n{\n\tsize_t length = sizeof(struct wim_dentry_on_disk);\n\tif (name_nbytes)\n\t\tlength += (u32)name_nbytes + 2;\n\tif (short_name_nbytes)\n\t\tlength += (u32)short_name_nbytes + 2;\n\treturn length;\n}\n\n\n/* Return the length, in bytes, required for the specified stream on-disk, when\n * represented as an extra stream entry.  */\nstatic size_t\nstream_out_total_length(const struct wim_inode_stream *strm)\n{\n\t/* Account for the fixed length portion  */\n\tsize_t len = sizeof(struct wim_extra_stream_entry_on_disk);\n\n\t/* For named streams, account for the variable-length name.  */\n\tif (stream_is_named(strm))\n\t\tlen += utf16le_len_bytes(strm->stream_name) + 2;\n\n\t/* Account for any necessary padding to the next 8-byte boundary.  */\n\treturn ALIGN(len, 8);\n}\n\n/*\n * Calculate the total number of bytes that will be consumed when a dentry is\n * written.  This includes the fixed-length portion of the dentry, the name\n * fields, any tagged metadata items, and any extra stream entries.  This also\n * includes all alignment bytes.\n */\nsize_t\ndentry_out_total_length(const struct wim_dentry *dentry)\n{\n\tconst struct wim_inode *inode = dentry->d_inode;\n\tsize_t len;\n\tunsigned num_unnamed_streams = 0;\n\tbool have_named_data_stream = false;\n\n\tlen = dentry_min_len_with_names(dentry->d_name_nbytes,\n\t\t\t\t\tdentry->d_short_name_nbytes);\n\tlen = ALIGN(len, 8);\n\n\tif (inode->i_extra)\n\t\tlen += ALIGN(inode->i_extra->size, 8);\n\n\t/*\n\t * Calculate the total length of the extra stream entries that will be\n\t * written.  To match DISM, some odd rules need to be followed here.\n\t * See write_dentry_streams() for explanation.  Keep this in sync with\n\t * write_dentry_streams()!\n\t */\n\tif (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) {\n\t\tnum_unnamed_streams++;\n\t} else {\n\t\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\t\tconst struct wim_inode_stream *strm = &inode->i_streams[i];\n\n\t\t\tif (stream_is_named_data_stream(strm)) {\n\t\t\t\tlen += stream_out_total_length(strm);\n\t\t\t\thave_named_data_stream = true;\n\t\t\t}\n\t\t}\n\t\tif (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT)\n\t\t\tnum_unnamed_streams++;\n\t\tif (!(inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY))\n\t\t\tnum_unnamed_streams++;\n\t}\n\tif (num_unnamed_streams > 1 || have_named_data_stream)\n\t\tlen += num_unnamed_streams *\n\t\t       ALIGN(sizeof(struct wim_extra_stream_entry_on_disk), 8);\n\treturn len;\n}\n\n/* Internal version of for_dentry_in_tree() that omits the NULL check  */\nstatic int\ndo_for_dentry_in_tree(struct wim_dentry *dentry,\n\t\t      int (*visitor)(struct wim_dentry *, void *), void *arg)\n{\n\tint ret;\n\tstruct wim_dentry *child;\n\n\tret = (*visitor)(dentry, arg);\n\tif (unlikely(ret))\n\t\treturn ret;\n\n\tfor_dentry_child(child, dentry) {\n\t\tret = do_for_dentry_in_tree(child, visitor, arg);\n\t\tif (unlikely(ret))\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\n/* Internal version of for_dentry_in_tree_depth() that omits the NULL check  */\nstatic int\ndo_for_dentry_in_tree_depth(struct wim_dentry *dentry,\n\t\t\t    int (*visitor)(struct wim_dentry *, void *), void *arg)\n{\n\tint ret;\n\tstruct wim_dentry *child;\n\n\tfor_dentry_child_postorder(child, dentry) {\n\t\tret = do_for_dentry_in_tree_depth(child, visitor, arg);\n\t\tif (unlikely(ret))\n\t\t\treturn ret;\n\t}\n\treturn unlikely((*visitor)(dentry, arg));\n}\n\n/*\n * Call a function on all dentries in a tree.\n *\n * @arg will be passed as the second argument to each invocation of @visitor.\n *\n * This function does a pre-order traversal --- that is, a parent will be\n * visited before its children.  Furthermore, siblings will be visited in their\n * collation order.\n *\n * It is safe to pass NULL for @root, which means that the dentry tree is empty.\n * In this case, this function does nothing.\n *\n * @visitor must not modify the structure of the dentry tree during the\n * traversal.\n *\n * The return value will be 0 if all calls to @visitor returned 0.  Otherwise,\n * the return value will be the first nonzero value returned by @visitor.\n */\nint\nfor_dentry_in_tree(struct wim_dentry *root,\n\t\t   int (*visitor)(struct wim_dentry *, void *), void *arg)\n{\n\tif (unlikely(!root))\n\t\treturn 0;\n\treturn do_for_dentry_in_tree(root, visitor, arg);\n}\n\n/* Like for_dentry_in_tree(), but do a depth-first traversal of the dentry tree.\n * That is, the visitor function will be called on a dentry's children before\n * itself.  It will be safe to free a dentry when visiting it.  */\nstatic int\nfor_dentry_in_tree_depth(struct wim_dentry *root,\n\t\t\t int (*visitor)(struct wim_dentry *, void *), void *arg)\n{\n\tif (unlikely(!root))\n\t\treturn 0;\n\treturn do_for_dentry_in_tree_depth(root, visitor, arg);\n}\n\n/*\n * Calculate the full path to @dentry within the WIM image, if not already done.\n *\n * The full name will be saved in the cached value 'dentry->d_full_path'.\n *\n * Whenever possible, use dentry_full_path() instead of calling this and\n * accessing d_full_path directly.\n *\n * Returns 0 or an error code resulting from a failed string conversion.\n */\nint\ncalculate_dentry_full_path(struct wim_dentry *dentry)\n{\n\tsize_t ulen;\n\tconst struct wim_dentry *d;\n\n\tif (dentry->d_full_path)\n\t\treturn 0;\n\n\tulen = 0;\n\td = dentry;\n\tdo {\n\t\tulen += d->d_name_nbytes / sizeof(utf16lechar);\n\t\tulen++;\n\t\td = d->d_parent;  /* assumes d == d->d_parent for root  */\n\t} while (!dentry_is_root(d));\n\n\t// +1 to keep Coverity happy\n\tutf16lechar *ubuf = alloca((ulen + 1) * sizeof(utf16lechar));\n\tif (!ubuf)\n\t\treturn WIMLIB_ERR_NOMEM;\n\tutf16lechar *p = &ubuf[ulen];\n\n\td = dentry;\n\tdo {\n\t\tp -= d->d_name_nbytes / sizeof(utf16lechar);\n\t\tif (d->d_name_nbytes)\n\t\t\tmemcpy(p, d->d_name, d->d_name_nbytes);\n\t\t*--p = cpu_to_le16(WIM_PATH_SEPARATOR);\n\t\td = d->d_parent;  /* assumes d == d->d_parent for root  */\n\t} while (!dentry_is_root(d));\n\n\twimlib_assert(p == ubuf);\n\n\treturn utf16le_to_tstr(ubuf, ulen * sizeof(utf16lechar),\n\t\t\t       &dentry->d_full_path, NULL);\n}\n\n/*\n * Return the full path to the @dentry within the WIM image, or NULL if the full\n * path could not be determined due to a string conversion error.\n *\n * The returned memory will be cached in the dentry, so the caller is not\n * responsible for freeing it.\n */\ntchar *\ndentry_full_path(struct wim_dentry *dentry)\n{\n\tif (calculate_dentry_full_path(dentry))\n\t\treturn NULL;\n\treturn dentry->d_full_path;\n}\n\nstatic int\ndentry_calculate_subdir_offset(struct wim_dentry *dentry, void *_subdir_offset_p)\n{\n\tif (dentry_is_directory(dentry)) {\n\t\tu64 *subdir_offset_p = _subdir_offset_p;\n\t\tstruct wim_dentry *child;\n\n\t\t/* Set offset of directory's child dentries  */\n\t\tdentry->d_subdir_offset = *subdir_offset_p;\n\n\t\t/* Account for child dentries  */\n\t\tfor_dentry_child(child, dentry)\n\t\t\t*subdir_offset_p += dentry_out_total_length(child);\n\n\t\t/* Account for end-of-directory entry  */\n\t\t*subdir_offset_p += 8;\n\t} else {\n\t\t/* Not a directory; set the subdir offset to 0  */\n\t\tdentry->d_subdir_offset = 0;\n\t}\n\treturn 0;\n}\n\n/*\n * Calculate the subdir offsets for a dentry tree, in preparation of writing\n * that dentry tree to a metadata resource.\n *\n * The subdir offset of each dentry is the offset in the uncompressed metadata\n * resource at which its child dentries begin, or 0 if that dentry has no\n * children.\n *\n * The caller must initialize *subdir_offset_p to the first subdir offset that\n * is available to use after the root dentry is written.\n *\n * When this function returns, *subdir_offset_p will have been advanced past the\n * size needed for the dentry tree within the uncompressed metadata resource.\n */\nvoid\ncalculate_subdir_offsets(struct wim_dentry *root, u64 *subdir_offset_p)\n{\n\tfor_dentry_in_tree(root, dentry_calculate_subdir_offset, subdir_offset_p);\n}\n\nstatic int\ndentry_compare_names(const struct wim_dentry *d1, const struct wim_dentry *d2,\n\t\t     bool ignore_case)\n{\n\treturn cmp_utf16le_strings(d1->d_name, d1->d_name_nbytes / 2,\n\t\t\t\t   d2->d_name, d2->d_name_nbytes / 2,\n\t\t\t\t   ignore_case);\n}\n\n/*\n * Collate (compare) the long filenames of two dentries.  This first compares\n * the names ignoring case, then falls back to a case-sensitive comparison if\n * the names are the same ignoring case.\n */\nstatic int\ncollate_dentry_names(const struct avl_tree_node *n1,\n\t\t     const struct avl_tree_node *n2)\n{\n\tconst struct wim_dentry *d1, *d2;\n\tint res;\n\n\td1 = avl_tree_entry(n1, struct wim_dentry, d_index_node);\n\td2 = avl_tree_entry(n2, struct wim_dentry, d_index_node);\n\n\tres = dentry_compare_names(d1, d2, true);\n\tif (res)\n\t\treturn res;\n\treturn dentry_compare_names(d1, d2, false);\n}\n\n/* Default case sensitivity behavior for searches with\n * WIMLIB_CASE_PLATFORM_DEFAULT specified.  This can be modified by passing\n * WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE or\n * WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE to wimlib_global_init().  */\nbool default_ignore_case =\n#ifdef _WIN32\n\ttrue\n#else\n\tfalse\n#endif\n;\n\n/*\n * Find the dentry within the given directory that has the given UTF-16LE\n * filename.  Return it if found, otherwise return NULL.  This has configurable\n * case sensitivity, and @name need not be null-terminated.\n */\nstruct wim_dentry *\nget_dentry_child_with_utf16le_name(const struct wim_dentry *dir,\n\t\t\t\t   const utf16lechar *name,\n\t\t\t\t   size_t name_nbytes,\n\t\t\t\t   CASE_SENSITIVITY_TYPE case_type)\n{\n\tstruct wim_dentry wanted;\n\tstruct avl_tree_node *cur = dir->d_inode->i_children;\n\tstruct wim_dentry *ci_match = NULL;\n\n\twanted.d_name = (utf16lechar *)name;\n\twanted.d_name_nbytes = name_nbytes;\n\n\tif (unlikely(wanted.d_name_nbytes != name_nbytes))\n\t\treturn NULL; /* overflow */\n\n\t/* Note: we can't use avl_tree_lookup_node() here because we need to\n\t * save case-insensitive matches. */\n\twhile (cur) {\n\t\tstruct wim_dentry *child;\n\t\tint res;\n\n\t\tchild = avl_tree_entry(cur, struct wim_dentry, d_index_node);\n\n\t\tres = dentry_compare_names(&wanted, child, true);\n\t\tif (!res) {\n\t\t\t/* case-insensitive match found */\n\t\t\tci_match = child;\n\n\t\t\tres = dentry_compare_names(&wanted, child, false);\n\t\t\tif (!res)\n\t\t\t\treturn child; /* case-sensitive match found */\n\t\t}\n\n\t\tif (res < 0)\n\t\t\tcur = cur->left;\n\t\telse\n\t\t\tcur = cur->right;\n\t}\n\n\t/* No case-sensitive match; use a case-insensitive match if possible. */\n\n\tif (!will_ignore_case(case_type))\n\t\treturn NULL;\n\n\tif (ci_match) {\n\t\tsize_t num_other_ci_matches = 0;\n\t\tstruct wim_dentry *other_ci_match, *d;\n\n\t\tdentry_for_each_ci_match(d, ci_match) {\n\t\t\tnum_other_ci_matches++;\n\t\t\tother_ci_match = d;\n\t\t}\n\n\t\tif (num_other_ci_matches != 0) {\n\t\t\tWARNING(\"Result of case-insensitive lookup is ambiguous\\n\"\n\t\t\t\t\"          (returning \\\"%\"TS\"\\\" of %zu \"\n\t\t\t\t\"possible files, including \\\"%\"TS\"\\\")\",\n\t\t\t\tdentry_full_path(ci_match), num_other_ci_matches,\n\t\t\t\tdentry_full_path(other_ci_match));\n\t\t}\n\t}\n\n\treturn ci_match;\n}\n\n/*\n * Find the dentry within the given directory that has the given 'tstr'\n * filename.  If the filename was successfully converted to UTF-16LE and the\n * dentry was found, return it; otherwise return NULL.  This has configurable\n * case sensitivity.\n */\nstruct wim_dentry *\nget_dentry_child_with_name(const struct wim_dentry *dir, const tchar *name,\n\t\t\t   CASE_SENSITIVITY_TYPE case_type)\n{\n\tint ret;\n\tconst utf16lechar *name_utf16le;\n\tsize_t name_utf16le_nbytes;\n\tstruct wim_dentry *child;\n\n\tret = tstr_get_utf16le_and_len(name, &name_utf16le,\n\t\t\t\t       &name_utf16le_nbytes);\n\tif (ret)\n\t\treturn NULL;\n\n\tchild = get_dentry_child_with_utf16le_name(dir,\n\t\t\t\t\t\t   name_utf16le,\n\t\t\t\t\t\t   name_utf16le_nbytes,\n\t\t\t\t\t\t   case_type);\n\ttstr_put_utf16le(name_utf16le);\n\treturn child;\n}\n\n/* This is the UTF-16LE version of get_dentry(), currently private to this file\n * because no one needs it besides get_dentry().  */\nstatic struct wim_dentry *\nget_dentry_utf16le(WIMStruct *wim, const utf16lechar *path,\n\t\t   CASE_SENSITIVITY_TYPE case_type)\n{\n\tstruct wim_dentry *cur_dentry;\n\tconst utf16lechar *name_start, *name_end;\n\n\t/* Start with the root directory of the image.  Note: this will be NULL\n\t * if an image has been added directly with wimlib_add_empty_image() but\n\t * no files have been added yet; in that case we fail with ENOENT.  */\n\tcur_dentry = wim_get_current_root_dentry(wim);\n\n\tname_start = path;\n\tfor (;;) {\n\t\tif (cur_dentry == NULL) {\n\t\t\terrno = ENOENT;\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif (*name_start && !dentry_is_directory(cur_dentry)) {\n\t\t\terrno = ENOTDIR;\n\t\t\treturn NULL;\n\t\t}\n\n\t\twhile (*name_start == cpu_to_le16(WIM_PATH_SEPARATOR))\n\t\t\tname_start++;\n\n\t\tif (!*name_start)\n\t\t\treturn cur_dentry;\n\n\t\tname_end = name_start;\n\t\tdo {\n\t\t\t++name_end;\n\t\t} while (*name_end != cpu_to_le16(WIM_PATH_SEPARATOR) && *name_end);\n\n\t\tcur_dentry = get_dentry_child_with_utf16le_name(cur_dentry,\n\t\t\t\t\t\t\t\tname_start,\n\t\t\t\t\t\t\t\t(u8*)name_end - (u8*)name_start,\n\t\t\t\t\t\t\t\tcase_type);\n\t\tname_start = name_end;\n\t}\n}\n\n/*\n * WIM path lookup: translate a path in the currently selected WIM image to the\n * corresponding dentry, if it exists.\n *\n * @wim\n *\tThe WIMStruct for the WIM.  The search takes place in the currently\n *\tselected image.\n *\n * @path\n *\tThe path to look up, given relative to the root of the WIM image.\n *\tCharacters with value WIM_PATH_SEPARATOR are taken to be path\n *\tseparators.  Leading path separators are ignored, whereas one or more\n *\ttrailing path separators cause the path to only match a directory.\n *\n * @case_type\n *\tThe case-sensitivity behavior of this function, as one of the following\n *\tconstants:\n *\n *    - WIMLIB_CASE_SENSITIVE:  Perform the search case sensitively.  This means\n *\tthat names must match exactly.\n *\n *    - WIMLIB_CASE_INSENSITIVE:  Perform the search case insensitively.  This\n *\tmeans that names are considered to match if they are equal when\n *\ttransformed to upper case.  If a path component matches multiple names\n *\tcase-insensitively, the name that matches the path component\n *\tcase-sensitively is chosen, if existent; otherwise one\n *\tcase-insensitively matching name is chosen arbitrarily.\n *\n *    - WIMLIB_CASE_PLATFORM_DEFAULT:  Perform either case-sensitive or\n *\tcase-insensitive search, depending on the value of the global variable\n *\tdefault_ignore_case.\n *\n *    In any case, no Unicode normalization is done before comparing strings.\n *\n * Returns a pointer to the dentry that is the result of the lookup, or NULL if\n * no such dentry exists.  If NULL is returned, errno is set to one of the\n * following values:\n *\n *\tENOTDIR if one of the path components used as a directory existed but\n *\twas not, in fact, a directory.\n *\n *\tENOENT otherwise.\n *\n * Additional notes:\n *\n *    - This function does not consider a reparse point to be a directory, even\n *\tif it has FILE_ATTRIBUTE_DIRECTORY set.\n *\n *    - This function does not dereference symbolic links or junction points\n *\twhen performing the search.\n *\n *    - Since this function ignores leading slashes, the empty path is valid and\n *\tnames the root directory of the WIM image.\n *\n *    - An image added with wimlib_add_empty_image() does not have a root\n *\tdirectory yet, and this function will fail with ENOENT for any path on\n *\tsuch an image.\n */\nstruct wim_dentry *\nget_dentry(WIMStruct *wim, const tchar *path, CASE_SENSITIVITY_TYPE case_type)\n{\n\tint ret;\n\tconst utf16lechar *path_utf16le;\n\tstruct wim_dentry *dentry;\n\n\tret = tstr_get_utf16le(path, &path_utf16le);\n\tif (ret)\n\t\treturn NULL;\n\tdentry = get_dentry_utf16le(wim, path_utf16le, case_type);\n\ttstr_put_utf16le(path_utf16le);\n\treturn dentry;\n}\n\n/* Modify @path, which is a null-terminated string @len 'tchars' in length,\n * in-place to produce the path to its parent directory.  */\nstatic void\nto_parent_name(tchar *path, size_t len)\n{\n\tssize_t i = (ssize_t)len - 1;\n\twhile (i >= 0 && path[i] == WIM_PATH_SEPARATOR)\n\t\ti--;\n\twhile (i >= 0 && path[i] != WIM_PATH_SEPARATOR)\n\t\ti--;\n\twhile (i >= 0 && path[i] == WIM_PATH_SEPARATOR)\n\t\ti--;\n\tpath[i + 1] = T('\\0');\n}\n\n/* Similar to get_dentry(), but returns the dentry named by @path with the last\n * component stripped off.\n *\n * Note: The returned dentry is NOT guaranteed to be a directory.  */\nstruct wim_dentry *\nget_parent_dentry(WIMStruct *wim, const tchar *path,\n\t\t  CASE_SENSITIVITY_TYPE case_type)\n{\n\tsize_t path_len = tstrlen(path);\n\ttchar* buf = alloca((path_len + 1) * sizeof(tchar));\n\n\ttmemcpy(buf, path, path_len + 1);\n\tto_parent_name(buf, path_len);\n\treturn get_dentry(wim, buf, case_type);\n}\n\n/*\n * Create an unlinked dentry.\n *\n * @name specifies the long name to give the new dentry.  If NULL or empty, the\n * new dentry will be given no long name.\n *\n * The new dentry will have no short name and no associated inode.\n *\n * On success, returns 0 and a pointer to the new, allocated dentry is stored in\n * *dentry_ret.  On failure, returns WIMLIB_ERR_NOMEM or an error code resulting\n * from a failed string conversion.\n */\nstatic int\nnew_dentry(const tchar *name, struct wim_dentry **dentry_ret)\n{\n\tstruct wim_dentry *dentry;\n\tint ret;\n\n\tdentry = CALLOC(1, sizeof(struct wim_dentry));\n\tif (!dentry)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\tif (name && *name) {\n\t\tret = dentry_set_name(dentry, name);\n\t\tif (ret) {\n\t\t\tFREE(dentry);\n\t\t\treturn ret;\n\t\t}\n\t}\n\tdentry->d_parent = dentry;\n\t*dentry_ret = dentry;\n\treturn 0;\n}\n\n/* Like new_dentry(), but also allocate an inode and associate it with the\n * dentry.  If set_timestamps=true, the timestamps for the inode will be set to\n * the current time; otherwise, they will be left 0.  */\nint\nnew_dentry_with_new_inode(const tchar *name, bool set_timestamps,\n\t\t\t  struct wim_dentry **dentry_ret)\n{\n\tstruct wim_dentry *dentry;\n\tstruct wim_inode *inode;\n\tint ret;\n\n\tret = new_dentry(name, &dentry);\n\tif (ret)\n\t\treturn ret;\n\n\tinode = new_inode(dentry, set_timestamps);\n\tif (!inode) {\n\t\tfree_dentry(dentry);\n\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\t*dentry_ret = dentry;\n\treturn 0;\n}\n\n/* Like new_dentry(), but also associate the new dentry with the specified inode\n * and acquire a reference to each of the inode's blobs.  */\nint\nnew_dentry_with_existing_inode(const tchar *name, struct wim_inode *inode,\n\t\t\t       struct wim_dentry **dentry_ret)\n{\n\tint ret = new_dentry(name, dentry_ret);\n\tif (ret)\n\t\treturn ret;\n\td_associate(*dentry_ret, inode);\n\tinode_ref_blobs(inode);\n\treturn 0;\n}\n\n/* Create an unnamed dentry with a new inode for a directory with the default\n * metadata.  */\nint\nnew_filler_directory(struct wim_dentry **dentry_ret)\n{\n\tint ret;\n\tstruct wim_dentry *dentry;\n\n\tret = new_dentry_with_new_inode(NULL, true, &dentry);\n\tif (ret)\n\t\treturn ret;\n\t/* Leave the inode number as 0; this is allowed for non\n\t * hard-linked files. */\n\tdentry->d_inode->i_attributes = FILE_ATTRIBUTE_DIRECTORY;\n\t*dentry_ret = dentry;\n\treturn 0;\n}\n\n/*\n * Free a WIM dentry.\n *\n * In addition to freeing the dentry itself, this disassociates the dentry from\n * its inode.  If the inode is no longer in use, it will be freed as well.\n */\nvoid\nfree_dentry(struct wim_dentry *dentry)\n{\n\tif (dentry) {\n\t\td_disassociate(dentry);\n\t\tFREE(dentry->d_name);\n\t\tFREE(dentry->d_short_name);\n\t\tFREE(dentry->d_full_path);\n\t\tFREE(dentry);\n\t}\n}\n\nstatic int\ndo_free_dentry(struct wim_dentry *dentry, void *_ignore)\n{\n\tfree_dentry(dentry);\n\treturn 0;\n}\n\nstatic int\ndo_free_dentry_and_unref_blobs(struct wim_dentry *dentry, void *blob_table)\n{\n\tinode_unref_blobs(dentry->d_inode, blob_table);\n\tfree_dentry(dentry);\n\treturn 0;\n}\n\n/*\n * Free all dentries in a tree.\n *\n * @root:\n *\tThe root of the dentry tree to free.  If NULL, this function has no\n *\teffect.\n *\n * @blob_table:\n *\tA pointer to the blob table for the WIM, or NULL if not specified.  If\n *\tspecified, this function will decrement the reference counts of the\n *\tblobs referenced by the dentries.\n *\n * This function also releases references to the corresponding inodes.\n *\n * This function does *not* unlink @root from its parent directory, if it has\n * one.  If @root has a parent, the caller must unlink @root before calling this\n * function.\n */\nvoid\nfree_dentry_tree(struct wim_dentry *root, struct blob_table *blob_table)\n{\n\tint (*f)(struct wim_dentry *, void *);\n\n\tif (blob_table)\n\t\tf = do_free_dentry_and_unref_blobs;\n\telse\n\t\tf = do_free_dentry;\n\n\tfor_dentry_in_tree_depth(root, f, blob_table);\n}\n\n/*\n * Return the first dentry in the list of dentries which have the same\n * case-insensitive name as the one given.\n */\nstruct wim_dentry *\ndentry_get_first_ci_match(struct wim_dentry *dentry)\n{\n\tstruct wim_dentry *ci_match = dentry;\n\n\tfor (;;) {\n\t\tstruct avl_tree_node *node;\n\t\tstruct wim_dentry *prev;\n\n\t\tnode = avl_tree_prev_in_order(&ci_match->d_index_node);\n\t\tif (!node)\n\t\t\tbreak;\n\t\tprev = avl_tree_entry(node, struct wim_dentry, d_index_node);\n\t\tif (dentry_compare_names(prev, dentry, true))\n\t\t\tbreak;\n\t\tci_match = prev;\n\t}\n\n\tif (ci_match == dentry)\n\t\treturn dentry_get_next_ci_match(dentry, dentry);\n\n\treturn ci_match;\n}\n\n/*\n * Return the next dentry in the list of dentries which have the same\n * case-insensitive name as the one given.\n */\nstruct wim_dentry *\ndentry_get_next_ci_match(struct wim_dentry *dentry, struct wim_dentry *ci_match)\n{\n\tdo {\n\t\tstruct avl_tree_node *node;\n\n\t\tnode = avl_tree_next_in_order(&ci_match->d_index_node);\n\t\tif (!node)\n\t\t\treturn NULL;\n\t\tci_match = avl_tree_entry(node, struct wim_dentry, d_index_node);\n\t} while (ci_match == dentry);\n\n\tif (dentry_compare_names(ci_match, dentry, true))\n\t\treturn NULL;\n\n\treturn ci_match;\n}\n\n/*\n * Link a dentry into a directory.\n *\n * @parent:\n *\tThe directory into which to link the dentry.\n *\n * @child:\n *\tThe dentry to link into the directory.  It must be currently unlinked.\n *\n * Returns NULL if successful; or, if @parent already contains a dentry with the\n * same case-sensitive name as @child, then a pointer to this duplicate dentry\n * is returned.\n */\nstruct wim_dentry *\ndentry_add_child(struct wim_dentry *parent, struct wim_dentry *child)\n{\n\tstruct wim_inode *dir = parent->d_inode;\n\tstruct avl_tree_node *duplicate;\n\n\twimlib_assert(parent != child);\n\twimlib_assert(inode_is_directory(dir));\n\n\tduplicate = avl_tree_insert(&dir->i_children, &child->d_index_node,\n\t\t\t\t    collate_dentry_names);\n\tif (duplicate)\n\t\treturn avl_tree_entry(duplicate, struct wim_dentry, d_index_node);\n\n\tchild->d_parent = parent;\n\treturn NULL;\n}\n\n/* Unlink a dentry from its parent directory. */\nvoid\nunlink_dentry(struct wim_dentry *dentry)\n{\n\t/* Do nothing if the dentry is root or it's already unlinked.  Not\n\t * actually necessary based on the current callers, but we do the check\n\t * here to be safe.  */\n\tif (unlikely(dentry->d_parent == dentry))\n\t\treturn;\n\n\tavl_tree_remove(&dentry->d_parent->d_inode->i_children,\n\t\t\t&dentry->d_index_node);\n\n\t/* Not actually necessary, but to be safe don't retain the now-obsolete\n\t * parent pointer.  */\n\tdentry->d_parent = dentry;\n}\n\nstatic int\nread_extra_data(const u8 *p, const u8 *end, struct wim_inode *inode)\n{\n\twhile (((uintptr_t)p & 7) && p < end)\n\t\tp++;\n\n\tif (unlikely(p < end)) {\n\t\tinode->i_extra = MALLOC(sizeof(struct wim_inode_extra) +\n\t\t\t\t\tend - p);\n\t\tif (!inode->i_extra)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\tinode->i_extra->size = end - p;\n\t\tmemcpy(inode->i_extra->data, p, end - p);\n\t}\n\treturn 0;\n}\n\n/*\n * Set the type of each stream for an encrypted file.\n *\n * All data streams of the encrypted file should have been packed into a single\n * stream in the format provided by ReadEncryptedFileRaw() on Windows.  We\n * assign this stream type STREAM_TYPE_EFSRPC_RAW_DATA.\n *\n * Encrypted files can't have a reparse point stream.  In the on-disk NTFS\n * format they can, but as far as I know the reparse point stream of an\n * encrypted file can't be stored in the WIM format in a way that's compatible\n * with WIMGAPI, nor is there even any way for it to be read or written on\n * Windows when the process does not have access to the file encryption key.\n */\nstatic void\nassign_stream_types_encrypted(struct wim_inode *inode)\n{\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tstruct wim_inode_stream *strm = &inode->i_streams[i];\n\t\tif (!stream_is_named(strm) && !is_zero_hash(strm->_stream_hash))\n\t\t{\n\t\t\tstrm->stream_type = STREAM_TYPE_EFSRPC_RAW_DATA;\n\t\t\treturn;\n\t\t}\n\t}\n}\n\n/*\n * Set the type of each stream for an unencrypted file.\n *\n * To specify the streams of each file, the WIM provides a main_hash and an\n * optional list of \"extra stream entries\".  Each extra stream entry is a\n * (name, hash) pair where the name is optional.  Hashes can be the special\n * value of zero_hash, which means the stream is empty (zero-length).\n *\n * While extra stream entries with names always refer to \"named data streams\",\n * the main hash and any extra unnamed hashes can be hard to interpret.  This is\n * because the WIM file format unfortunately doesn't make it very clear which is\n * the unnamed data stream (i.e. standard file contents) and which is the\n * reparse stream.  The way this ambiguity is resolved (based on what MS\n * software seems to do) is by (1) a file can have at most one unnamed data\n * stream and at most one reparse stream, (2) a reparse stream is present if and\n * only if the file has FILE_ATTRIBUTE_REPARSE_POINT, and (3) the reparse\n * stream, if present, is stored before the unnamed data stream if present\n * (considering main_hash to come before any extra hashes).  Note: directories\n * need not have an unnamed data stream stored, even with a zero hash, as\n * \"unnamed data stream\" isn't meaningful for a directory in the first place.\n *\n * With those rules in mind, one would expect that the first unnamed stream\n * would use main_hash, and the second (if present) would use an extra stream\n * entry.  However, there is another quirk that we must be compatible with:\n * sometimes main_hash isn't used and only extra stream entries are used.  To\n * handle this, we ignore main_hash if it is zero and there is at least one\n * unnamed extra stream entry.  This works correctly as long as a zero main_hash\n * and an unnamed extra stream entry is never used to represent an empty reparse\n * stream and an unnamed data stream.  (It's not, as the reparse stream always\n * goes in the extra stream entries in this case.  See write_dentry_streams().)\n */\nstatic void\nassign_stream_types_unencrypted(struct wim_inode *inode)\n{\n\tbool found_reparse_stream = false;\n\tbool found_unnamed_data_stream = false;\n\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tstruct wim_inode_stream *strm = &inode->i_streams[i];\n\n\t\tif (stream_is_named(strm)) {\n\t\t\t/* Named extra stream entry */\n\t\t\tstrm->stream_type = STREAM_TYPE_DATA;\n\t\t} else if (i != 0 || !is_zero_hash(strm->_stream_hash)) {\n\t\t\t/* Unnamed extra stream entry or a nonzero main_hash */\n\t\t\tif ((inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) &&\n\t\t\t    !found_reparse_stream) {\n\t\t\t\tfound_reparse_stream = true;\n\t\t\t\tstrm->stream_type = STREAM_TYPE_REPARSE_POINT;\n\t\t\t} else if (!found_unnamed_data_stream) {\n\t\t\t\tfound_unnamed_data_stream = true;\n\t\t\t\tstrm->stream_type = STREAM_TYPE_DATA;\n\t\t\t} /* Else, too many unnamed streams were found. */\n\n\t\t} /* Else, it's a zero main_hash. */\n\t}\n\n\t/* If needed, use the zero main_hash. */\n\tif (!found_reparse_stream && !found_unnamed_data_stream) {\n\t\tinode->i_streams[0].stream_type =\n\t\t\t(inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) ?\n\t\t\tSTREAM_TYPE_REPARSE_POINT : STREAM_TYPE_DATA;\n\t}\n}\n\n/*\n * Read and interpret the collection of streams for the specified inode.\n */\nstatic int\nsetup_inode_streams(const u8 *p, const u8 *end, struct wim_inode *inode,\n\t\t    unsigned num_extra_streams, const u8 *main_hash,\n\t\t    u64 *offset_p)\n{\n\tconst u8 *orig_p = p;\n\n\tinode->i_num_streams = 1 + num_extra_streams;\n\n\tif (unlikely(inode->i_num_streams > ARRAY_LEN(inode->i_embedded_streams))) {\n\t\tinode->i_streams = CALLOC(inode->i_num_streams,\n\t\t\t\t\t  sizeof(inode->i_streams[0]));\n\t\tif (!inode->i_streams)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\t/* Use main_hash for the first stream. */\n\tinode->i_streams[0].stream_name = (utf16lechar *)NO_STREAM_NAME;\n\tcopy_hash(inode->i_streams[0]._stream_hash, main_hash);\n\tinode->i_streams[0].stream_type = STREAM_TYPE_UNKNOWN;\n\tinode->i_streams[0].stream_id = 0;\n\n\t/* Read the extra stream entries. */\n\tfor (unsigned i = 1; i < inode->i_num_streams; i++) {\n\t\tstruct wim_inode_stream *strm;\n\t\tconst struct wim_extra_stream_entry_on_disk *disk_strm;\n\t\tu64 length;\n\t\tu16 name_nbytes;\n\n\t\tstrm = &inode->i_streams[i];\n\n\t\tstrm->stream_id = i;\n\n\t\t/* Do we have at least the size of the fixed-length data we know\n\t\t * need?  */\n\t\tif ((end - p) < sizeof(struct wim_extra_stream_entry_on_disk))\n\t\t\treturn WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\n\t\tdisk_strm = (const struct wim_extra_stream_entry_on_disk *)p;\n\n\t\t/* Read the length field  */\n\t\tlength = ALIGN(le64_to_cpu(disk_strm->length), 8);\n\n\t\t/* Make sure the length field is neither so small it doesn't\n\t\t * include all the fixed-length data nor so large it overflows\n\t\t * the metadata resource buffer. */\n\t\tif (length < sizeof(struct wim_extra_stream_entry_on_disk) ||\n\t\t    length > (end - p))\n\t\t\treturn WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\n\t\t/* Read the rest of the fixed-length data. */\n\n\t\tcopy_hash(strm->_stream_hash, disk_strm->hash);\n\t\tname_nbytes = le16_to_cpu(disk_strm->name_nbytes);\n\n\t\t/* If stream_name_nbytes != 0, the stream is named.  */\n\t\tif (name_nbytes != 0) {\n\t\t\t/* The name is encoded in UTF16-LE, which uses 2-byte\n\t\t\t * coding units, so the length of the name had better be\n\t\t\t * an even number of bytes.  */\n\t\t\tif (name_nbytes & 1)\n\t\t\t\treturn WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\n\t\t\t/* Add the length of the stream name to get the length\n\t\t\t * we actually need to read.  Make sure this isn't more\n\t\t\t * than the specified length of the entry.  */\n\t\t\tif (sizeof(struct wim_extra_stream_entry_on_disk) +\n\t\t\t    name_nbytes > length)\n\t\t\t\treturn WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\n\t\t\tstrm->stream_name = utf16le_dupz(disk_strm->name,\n\t\t\t\t\t\t\t name_nbytes);\n\t\t\tif (!strm->stream_name)\n\t\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\t} else {\n\t\t\tstrm->stream_name = (utf16lechar *)NO_STREAM_NAME;\n\t\t}\n\n\t\tstrm->stream_type = STREAM_TYPE_UNKNOWN;\n\n\t\tp += length;\n\t}\n\n\tinode->i_next_stream_id = inode->i_num_streams;\n\n\t/* Now, assign a type to each stream.  Unfortunately this requires\n\t * various hacks because stream types aren't explicitly provided in the\n\t * WIM on-disk format.  */\n\n\tif (unlikely(inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED))\n\t\tassign_stream_types_encrypted(inode);\n\telse\n\t\tassign_stream_types_unencrypted(inode);\n\n\t*offset_p += p - orig_p;\n\treturn 0;\n}\n\n/* Read a dentry, including all extra stream entries that follow it, from an\n * uncompressed metadata resource buffer.  */\nstatic int\nread_dentry(const u8 * restrict buf, size_t buf_len,\n\t    u64 *offset_p, struct wim_dentry **dentry_ret)\n{\n\tu64 offset = *offset_p;\n\tu64 length;\n\tconst u8 *p;\n\tconst struct wim_dentry_on_disk *disk_dentry;\n\tstruct wim_dentry *dentry;\n\tstruct wim_inode *inode;\n\tu16 short_name_nbytes;\n\tu16 name_nbytes;\n\tu64 calculated_size;\n\tint ret;\n\n\tSTATIC_ASSERT(sizeof(struct wim_dentry_on_disk) == WIM_DENTRY_DISK_SIZE);\n\n\t/* Before reading the whole dentry, we need to read just the length.\n\t * This is because a dentry of length 8 (that is, just the length field)\n\t * terminates the list of sibling directory entries. */\n\n\t/* Check for buffer overrun.  */\n\tif (unlikely(offset + sizeof(u64) > buf_len ||\n\t\t     offset + sizeof(u64) < offset))\n\t\treturn WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\n\t/* Get pointer to the dentry data.  */\n\tp = &buf[offset];\n\tdisk_dentry = (const struct wim_dentry_on_disk*)p;\n\n\t/* Get dentry length.  */\n\tlength = ALIGN(le64_to_cpu(disk_dentry->length), 8);\n\n\t/* Check for end-of-directory.  */\n\tif (length <= 8) {\n\t\t*dentry_ret = NULL;\n\t\treturn 0;\n\t}\n\n\t/* Validate dentry length.  */\n\tif (unlikely(length < sizeof(struct wim_dentry_on_disk)))\n\t\treturn WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\n\t/* Check for buffer overrun.  */\n\tif (unlikely(offset + length > buf_len ||\n\t\t     offset + length < offset))\n\t\treturn WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\n\t/* Allocate new dentry structure, along with a preliminary inode.  */\n\tret = new_dentry_with_new_inode(NULL, false, &dentry);\n\tif (ret)\n\t\treturn ret;\n\n\tinode = dentry->d_inode;\n\n\t/* Read more fields: some into the dentry, and some into the inode.  */\n\tinode->i_attributes = le32_to_cpu(disk_dentry->attributes);\n\tinode->i_security_id = le32_to_cpu(disk_dentry->security_id);\n\tdentry->d_subdir_offset = le64_to_cpu(disk_dentry->subdir_offset);\n\tinode->i_creation_time = le64_to_cpu(disk_dentry->creation_time);\n\tinode->i_last_access_time = le64_to_cpu(disk_dentry->last_access_time);\n\tinode->i_last_write_time = le64_to_cpu(disk_dentry->last_write_time);\n\tinode->i_unknown_0x54 = le32_to_cpu(disk_dentry->unknown_0x54);\n\n\tif (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) {\n\t\tinode->i_reparse_tag = le32_to_cpu(disk_dentry->reparse.reparse_tag);\n\t\tinode->i_rp_reserved = le16_to_cpu(disk_dentry->reparse.rp_reserved);\n\t\tinode->i_rp_flags = le16_to_cpu(disk_dentry->reparse.rp_flags);\n\t\t/* Leave inode->i_ino at 0.  Note: this means that WIM cannot\n\t\t * represent multiple hard links to a reparse point file.  */\n\t} else {\n\t\tinode->i_ino = le64_to_cpu(disk_dentry->nonreparse.hard_link_group_id);\n\t}\n\n\t/* Now onto reading the names.  There are two of them: the (long) file\n\t * name, and the short name.  */\n\n\tshort_name_nbytes = le16_to_cpu(disk_dentry->short_name_nbytes);\n\tname_nbytes = le16_to_cpu(disk_dentry->name_nbytes);\n\n\tif (unlikely((short_name_nbytes & 1) | (name_nbytes & 1))) {\n\t\tret = WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\t\tgoto err_free_dentry;\n\t}\n\n\t/* We now know the length of the file name and short name.  Make sure\n\t * the length of the dentry is large enough to actually hold them.  */\n\tcalculated_size = dentry_min_len_with_names(name_nbytes,\n\t\t\t\t\t\t    short_name_nbytes);\n\n\tif (unlikely(length < calculated_size)) {\n\t\tret = WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\t\tgoto err_free_dentry;\n\t}\n\n\t/* Advance p to point past the base dentry, to the first name.  */\n\tp += sizeof(struct wim_dentry_on_disk);\n\n\t/* Read the filename if present.  Note: if the filename is empty, there\n\t * is no null terminator following it.  */\n\tif (name_nbytes) {\n\t\tdentry->d_name = utf16le_dupz(p, name_nbytes);\n\t\tif (unlikely(!dentry->d_name)) {\n\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\tgoto err_free_dentry;\n\t\t}\n\t\tdentry->d_name_nbytes = name_nbytes;\n\t\tp += (u32)name_nbytes + 2;\n\t}\n\n\t/* Read the short filename if present.  Note: if there is no short\n\t * filename, there is no null terminator following it. */\n\tif (short_name_nbytes) {\n\t\tdentry->d_short_name = utf16le_dupz(p, short_name_nbytes);\n\t\tif (unlikely(!dentry->d_short_name)) {\n\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\tgoto err_free_dentry;\n\t\t}\n\t\tdentry->d_short_name_nbytes = short_name_nbytes;\n\t\tp += (u32)short_name_nbytes + 2;\n\t}\n\n\t/* Read extra data at end of dentry (but before extra stream entries).\n\t * This may contain tagged metadata items.  */\n\tret = read_extra_data(p, &buf[offset + length], inode);\n\tif (ret)\n\t\tgoto err_free_dentry;\n\n\toffset += length;\n\n\t/* Set up the inode's collection of streams.  */\n\tret = setup_inode_streams(&buf[offset],\n\t\t\t\t  &buf[buf_len],\n\t\t\t\t  inode,\n\t\t\t\t  le16_to_cpu(disk_dentry->num_extra_streams),\n\t\t\t\t  disk_dentry->main_hash,\n\t\t\t\t  &offset);\n\tif (ret)\n\t\tgoto err_free_dentry;\n\n\t*offset_p = offset;  /* Sets offset of next dentry in directory  */\n\t*dentry_ret = dentry;\n\treturn 0;\n\nerr_free_dentry:\n\tfree_dentry(dentry);\n\treturn ret;\n}\n\nstatic bool\ndentry_is_dot_or_dotdot(const struct wim_dentry *dentry)\n{\n\tif (dentry->d_name_nbytes <= 4) {\n\t\tif (dentry->d_name_nbytes == 4) {\n\t\t\tif (dentry->d_name[0] == cpu_to_le16('.') &&\n\t\t\t    dentry->d_name[1] == cpu_to_le16('.'))\n\t\t\t\treturn true;\n\t\t} else if (dentry->d_name_nbytes == 2) {\n\t\t\tif (dentry->d_name[0] == cpu_to_le16('.'))\n\t\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nstatic bool\ndentry_contains_embedded_null(const struct wim_dentry *dentry)\n{\n\tfor (unsigned i = 0; i < dentry->d_name_nbytes / 2; i++)\n\t\tif (dentry->d_name[i] == cpu_to_le16('\\0'))\n\t\t\treturn true;\n\treturn false;\n}\n\nstatic bool\nshould_ignore_dentry(struct wim_dentry *dir, const struct wim_dentry *dentry)\n{\n\t/* All dentries except the root must be named. */\n\tif (!dentry_has_long_name(dentry)) {\n\t\tWARNING(\"Ignoring unnamed file in directory \\\"%\"TS\"\\\"\",\n\t\t\tdentry_full_path(dir));\n\t\treturn true;\n\t}\n\n\t/* Don't allow files named \".\" or \"..\".  Such filenames could be used in\n\t * path traversal attacks. */\n\tif (dentry_is_dot_or_dotdot(dentry)) {\n\t\tWARNING(\"Ignoring file named \\\".\\\" or \\\"..\\\" in directory \"\n\t\t\t\"\\\"%\"TS\"\\\"\", dentry_full_path(dir));\n\t\treturn true;\n\t}\n\n\t/* Don't allow filenames containing embedded null characters.  Although\n\t * the null character is already considered an unsupported character for\n\t * extraction by all targets, it is probably a good idea to just forbid\n\t * such names entirely. */\n\tif (dentry_contains_embedded_null(dentry)) {\n\t\tWARNING(\"Ignoring filename with embedded null character in \"\n\t\t\t\"directory \\\"%\"TS\"\\\"\", dentry_full_path(dir));\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nstatic int\nread_dentry_tree_recursive(const u8 * restrict buf, size_t buf_len,\n\t\t\t   struct wim_dentry * restrict dir, unsigned depth)\n{\n\tu64 cur_offset = dir->d_subdir_offset;\n\n\t/* Disallow extremely deep or cyclic directory structures  */\n\tif (unlikely(depth >= 16384)) {\n\t\tERROR(\"Directory structure too deep!\");\n\t\treturn WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\t}\n\n\tfor (;;) {\n\t\tstruct wim_dentry *child;\n\t\tstruct wim_dentry *duplicate;\n\t\tint ret;\n\n\t\t/* Read next child of @dir.  */\n\t\tret = read_dentry(buf, buf_len, &cur_offset, &child);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\t/* Check for end of directory.  */\n\t\tif (child == NULL)\n\t\t\treturn 0;\n\n\t\t/* Ignore dentries with bad names.  */\n\t\tif (unlikely(should_ignore_dentry(dir, child))) {\n\t\t\tfree_dentry(child);\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* Link the child into the directory.  */\n\t\tduplicate = dentry_add_child(dir, child);\n\t\tif (unlikely(duplicate)) {\n\t\t\t/* We already found a dentry with this same\n\t\t\t * case-sensitive long name.  Only keep the first one.\n\t\t\t */\n\t\t\tWARNING(\"Ignoring duplicate file \\\"%\"TS\"\\\" \"\n\t\t\t\t\"(the WIM image already contains a file \"\n\t\t\t\t\"at that path with the exact same name)\",\n\t\t\t\tdentry_full_path(duplicate));\n\t\t\tfree_dentry(child);\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* If this child is a directory that itself has children, call\n\t\t * this procedure recursively.  */\n\t\tif (child->d_subdir_offset != 0) {\n\t\t\tif (likely(dentry_is_directory(child))) {\n\t\t\t\tret = read_dentry_tree_recursive(buf,\n\t\t\t\t\t\t\t\t buf_len,\n\t\t\t\t\t\t\t\t child,\n\t\t\t\t\t\t\t\t depth + 1);\n\t\t\t\tif (ret)\n\t\t\t\t\treturn ret;\n\t\t\t} else {\n\t\t\t\tWARNING(\"Ignoring children of \"\n\t\t\t\t\t\"non-directory file \\\"%\"TS\"\\\"\",\n\t\t\t\t\tdentry_full_path(child));\n\t\t\t}\n\t\t}\n\t}\n}\n\n/*\n * Read a tree of dentries from a WIM metadata resource.\n *\n * @buf:\n *\tBuffer containing an uncompressed WIM metadata resource.\n *\n * @buf_len:\n *\tLength of the uncompressed metadata resource, in bytes.\n *\n * @root_offset\n *\tOffset in the metadata resource of the root of the dentry tree.\n *\n * @root_ret:\n *\tOn success, either NULL or a pointer to the root dentry is written to\n *\tthis location.  The former case only occurs in the unexpected case that\n *\tthe tree began with an end-of-directory entry.\n *\n * Return values:\n *\tWIMLIB_ERR_SUCCESS (0)\n *\tWIMLIB_ERR_INVALID_METADATA_RESOURCE\n *\tWIMLIB_ERR_NOMEM\n */\nint\nread_dentry_tree(const u8 *buf, size_t buf_len,\n\t\t u64 root_offset, struct wim_dentry **root_ret)\n{\n\tint ret;\n\tstruct wim_dentry *root;\n\n\tret = read_dentry(buf, buf_len, &root_offset, &root);\n\tif (ret)\n\t\treturn ret;\n\n\tif (likely(root != NULL)) {\n\t\tif (unlikely(dentry_has_long_name(root) ||\n\t\t\t     dentry_has_short_name(root)))\n\t\t{\n\t\t\tWARNING(\"The root directory has a nonempty name; \"\n\t\t\t\t\"removing it.\");\n\t\t\tdentry_set_name(root, NULL);\n\t\t}\n\n\t\tif (unlikely(!dentry_is_directory(root))) {\n\t\t\tERROR(\"The root of the WIM image is not a directory!\");\n\t\t\tret = WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\t\t\tgoto err_free_dentry_tree;\n\t\t}\n\n\t\tif (likely(root->d_subdir_offset != 0)) {\n\t\t\tret = read_dentry_tree_recursive(buf, buf_len, root, 0);\n\t\t\tif (ret)\n\t\t\t\tgoto err_free_dentry_tree;\n\t\t}\n\t} else {\n\t\tWARNING(\"The metadata resource has no directory entries; \"\n\t\t\t\"treating as an empty image.\");\n\t}\n\t*root_ret = root;\n\treturn 0;\n\nerr_free_dentry_tree:\n\tfree_dentry_tree(root, NULL);\n\treturn ret;\n}\n\nstatic u8 *\nwrite_extra_stream_entry(u8 * restrict p, const utf16lechar * restrict name,\n\t\t\t const u8 * restrict hash)\n{\n\tstruct wim_extra_stream_entry_on_disk *disk_strm =\n\t\t\t(struct wim_extra_stream_entry_on_disk *)p;\n\tu8 *orig_p = p;\n\tsize_t name_nbytes;\n\n\tif (name == NO_STREAM_NAME)\n\t\tname_nbytes = 0;\n\telse\n\t\tname_nbytes = utf16le_len_bytes(name);\n\n\tdisk_strm->reserved = 0;\n\tcopy_hash(disk_strm->hash, hash);\n\tdisk_strm->name_nbytes = cpu_to_le16(name_nbytes);\n\tp += sizeof(struct wim_extra_stream_entry_on_disk);\n\tif (name_nbytes != 0)\n\t\tp = mempcpy(p, name, name_nbytes + 2);\n\t/* Align to 8-byte boundary */\n\twhile ((uintptr_t)p & 7)\n\t\t*p++ = 0;\n\tdisk_strm->length = cpu_to_le64(p - orig_p);\n\treturn p;\n}\n\n/*\n * Write the stream references for a WIM dentry.  To be compatible with DISM, we\n * follow the below rules:\n *\n * 1. If the file has FILE_ATTRIBUTE_ENCRYPTED, then only the EFSRPC_RAW_DATA\n *    stream is stored.  Otherwise, the streams that are stored are:\n *    - Reparse stream if the file has FILE_ATTRIBUTE_REPARSE_POINT\n *    - Unnamed data stream if the file doesn't have FILE_ATTRIBUTE_DIRECTORY\n *    - Named data streams\n *\n * 2. If only one stream is being stored and it is the EFSRPC_RAW_DATA, unnamed\n *    data, or reparse stream, then its hash goes in main_hash, and no extra\n *    stream entries are stored.  Otherwise, *all* streams go in the extra\n *    stream entries, and main_hash is left zeroed!\n *\n * 3. If both the reparse stream and unnamed data stream are being stored, then\n *    the reparse stream comes first.\n *\n * 4. The unnamed stream(s) come before the named stream(s).  (Actually, DISM\n *    puts the named streams between the first and second unnamed streams, but\n *    this is incompatible with itself...  Tested with DISM 10.0.20348.681.)\n *\n * wimlib v1.14.1 and earlier behaved slightly differently for directories.\n * First, wimlib always put the hash of the reparse stream in an extra stream\n * entry, never in main_hash.  This difference vs. DISM went unnoticed for a\n * long time, but eventually it was found that it broke the Windows 8 setup\n * wizard.  Second, when a directory had any extra streams, wimlib created an\n * extra stream entry to represent the (empty) unnamed data stream.  However,\n * DISM now rejects that (though I think it used to accept it).  There isn't\n * really any such thing as \"unnamed data stream\" for a directory.\n *\n * Keep this in sync with dentry_out_total_length()!\n */\nstatic u8 *\nwrite_dentry_streams(const struct wim_inode *inode,\n\t\t     struct wim_dentry_on_disk *disk_dentry, u8 *p)\n{\n\tconst u8 *unnamed_data_stream_hash = zero_hash;\n\tconst u8 *reparse_stream_hash = zero_hash;\n\tconst u8 *efsrpc_stream_hash = zero_hash;\n\tconst u8 *unnamed_stream_hashes[2] = { zero_hash };\n\tunsigned num_unnamed_streams = 0;\n\tunsigned num_named_streams = 0;\n\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tconst struct wim_inode_stream *strm = &inode->i_streams[i];\n\n\t\tswitch (strm->stream_type) {\n\t\tcase STREAM_TYPE_DATA:\n\t\t\tif (stream_is_named(strm))\n\t\t\t\tnum_named_streams++;\n\t\t\telse\n\t\t\t\tunnamed_data_stream_hash = stream_hash(strm);\n\t\t\tbreak;\n\t\tcase STREAM_TYPE_REPARSE_POINT:\n\t\t\treparse_stream_hash = stream_hash(strm);\n\t\t\tbreak;\n\t\tcase STREAM_TYPE_EFSRPC_RAW_DATA:\n\t\t\tefsrpc_stream_hash = stream_hash(strm);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) {\n\t\tunnamed_stream_hashes[num_unnamed_streams++] = efsrpc_stream_hash;\n\t\tnum_named_streams = 0;\n\t} else {\n\t\tif (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT)\n\t\t\tunnamed_stream_hashes[num_unnamed_streams++] = reparse_stream_hash;\n\t\tif (!(inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY))\n\t\t\tunnamed_stream_hashes[num_unnamed_streams++] = unnamed_data_stream_hash;\n\t}\n\n\tif (num_unnamed_streams <= 1 && num_named_streams == 0) {\n\t\t/* No extra stream entries are needed. */\n\t\tcopy_hash(disk_dentry->main_hash, unnamed_stream_hashes[0]);\n\t\tdisk_dentry->num_extra_streams = 0;\n\t\treturn p;\n\t}\n\n\t/* Else, all streams go in extra stream entries. */\n\tcopy_hash(disk_dentry->main_hash, zero_hash);\n\twimlib_assert(num_unnamed_streams + num_named_streams <= 0xFFFF);\n\tdisk_dentry->num_extra_streams = cpu_to_le16(num_unnamed_streams +\n\t\t\t\t\t\t     num_named_streams);\n\tfor (unsigned i = 0; i < num_unnamed_streams; i++)\n\t\tp = write_extra_stream_entry(p, NO_STREAM_NAME,\n\t\t\t\t\t     unnamed_stream_hashes[i]);\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tconst struct wim_inode_stream *strm = &inode->i_streams[i];\n\n\t\tif (stream_is_named_data_stream(strm)) {\n\t\t\tp = write_extra_stream_entry(p, strm->stream_name,\n\t\t\t\t\t\t     stream_hash(strm));\n\t\t}\n\t}\n\treturn p;\n}\n\n/*\n * Write a WIM dentry to an output buffer.\n *\n * This includes any extra stream entries that may follow the dentry itself.\n *\n * @dentry:\n *\tThe dentry to write.\n *\n * @p:\n *\tThe memory location to which to write the data.\n *\n * Returns a pointer to the byte following the last written.\n */\nstatic u8 *\nwrite_dentry(const struct wim_dentry * restrict dentry, u8 * restrict p)\n{\n\tconst struct wim_inode *inode;\n\tstruct wim_dentry_on_disk *disk_dentry;\n\tconst u8 *orig_p;\n\n\twimlib_assert(((uintptr_t)p & 7) == 0); /* 8 byte aligned */\n\torig_p = p;\n\n\tinode = dentry->d_inode;\n\tdisk_dentry = (struct wim_dentry_on_disk*)p;\n\n\tdisk_dentry->attributes = cpu_to_le32(inode->i_attributes);\n\tdisk_dentry->security_id = cpu_to_le32(inode->i_security_id);\n\tdisk_dentry->subdir_offset = cpu_to_le64(dentry->d_subdir_offset);\n\n\tdisk_dentry->unused_1 = cpu_to_le64(0);\n\tdisk_dentry->unused_2 = cpu_to_le64(0);\n\n\tdisk_dentry->creation_time = cpu_to_le64(inode->i_creation_time);\n\tdisk_dentry->last_access_time = cpu_to_le64(inode->i_last_access_time);\n\tdisk_dentry->last_write_time = cpu_to_le64(inode->i_last_write_time);\n\tdisk_dentry->unknown_0x54 = cpu_to_le32(inode->i_unknown_0x54);\n\tif (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) {\n\t\tdisk_dentry->reparse.reparse_tag = cpu_to_le32(inode->i_reparse_tag);\n\t\tdisk_dentry->reparse.rp_reserved = cpu_to_le16(inode->i_rp_reserved);\n\t\tdisk_dentry->reparse.rp_flags = cpu_to_le16(inode->i_rp_flags);\n\t} else {\n\t\tdisk_dentry->nonreparse.hard_link_group_id =\n\t\t\tcpu_to_le64((inode->i_nlink == 1) ? 0 : inode->i_ino);\n\t}\n\n\tdisk_dentry->short_name_nbytes = cpu_to_le16(dentry->d_short_name_nbytes);\n\tdisk_dentry->name_nbytes = cpu_to_le16(dentry->d_name_nbytes);\n\tp += sizeof(struct wim_dentry_on_disk);\n\n\twimlib_assert(dentry_is_root(dentry) != dentry_has_long_name(dentry));\n\n\tif (dentry_has_long_name(dentry))\n\t\tp = mempcpy(p, dentry->d_name, (u32)dentry->d_name_nbytes + 2);\n\n\tif (dentry_has_short_name(dentry))\n\t\tp = mempcpy(p, dentry->d_short_name, (u32)dentry->d_short_name_nbytes + 2);\n\n\t/* Align to 8-byte boundary */\n\twhile ((uintptr_t)p & 7)\n\t\t*p++ = 0;\n\n\tif (inode->i_extra) {\n\t\t/* Extra tagged items --- not usually present.  */\n\t\tp = mempcpy(p, inode->i_extra->data, inode->i_extra->size);\n\n\t\t/* Align to 8-byte boundary */\n\t\twhile ((uintptr_t)p & 7)\n\t\t\t*p++ = 0;\n\t}\n\n\tdisk_dentry->length = cpu_to_le64(p - orig_p);\n\n\t/*\n\t * Set disk_dentry->main_hash and disk_dentry->num_extra_streams,\n\t * and write any extra stream entries that are needed.\n\t */\n\treturn write_dentry_streams(inode, disk_dentry, p);\n}\n\nstatic int\nwrite_dir_dentries(struct wim_dentry *dir, void *_pp)\n{\n\tif (dir->d_subdir_offset != 0) {\n\t\tu8 **pp = _pp;\n\t\tu8 *p = *pp;\n\t\tstruct wim_dentry *child;\n\n\t\t/* write child dentries */\n\t\tfor_dentry_child(child, dir)\n\t\t\tp = write_dentry(child, p);\n\n\t\t/* write end of directory entry */\n\t\t*(u64*)p = 0;\n\t\tp += 8;\n\t\t*pp = p;\n\t}\n\treturn 0;\n}\n\n/*\n * Write a directory tree to the metadata resource.\n *\n * @root:\n *\tThe root of a dentry tree on which calculate_subdir_offsets() has been\n *\tcalled.  This cannot be NULL; if the dentry tree is empty, the caller is\n *\texpected to first generate a dummy root directory.\n *\n * @p:\n *\tPointer to a buffer with enough space for the dentry tree.  This size\n *\tmust have been obtained by calculate_subdir_offsets().\n *\n * Returns a pointer to the byte following the last written.\n */\nu8 *\nwrite_dentry_tree(struct wim_dentry *root, u8 *p)\n{\n\t/* write root dentry and end-of-directory entry following it */\n\tp = write_dentry(root, p);\n\t*(u64*)p = 0;\n\tp += 8;\n\n\t/* write the rest of the dentry tree */\n\tfor_dentry_in_tree(root, write_dir_dentries, &p);\n\n\treturn p;\n}\n"
  },
  {
    "path": "src/wimlib/divsufsort.c",
    "content": "/*\n * divsufsort.c for libdivsufsort-lite\n * Copyright (c) 2003-2008 Yuta Mori All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/divsufsort.h\"\n#include \"wimlib/util.h\"\n\n#define DIVSUFSORT_ASSERT(expr)\n\n/*- Constants -*/\n#define ALPHABET_SIZE 256\n#define BUCKET_A_SIZE (ALPHABET_SIZE)\n#define BUCKET_B_SIZE (ALPHABET_SIZE * ALPHABET_SIZE)\n\n#define SS_INSERTIONSORT_THRESHOLD 8\n\n#define SS_BLOCKSIZE 1024\n\n/* minstacksize = log(SS_BLOCKSIZE) / log(3) * 2 */\n#if SS_BLOCKSIZE == 0\n# define SS_MISORT_STACKSIZE (96)\n#elif SS_BLOCKSIZE <= 4096\n# define SS_MISORT_STACKSIZE (16)\n#else\n# define SS_MISORT_STACKSIZE (24)\n#endif\n#define SS_SMERGE_STACKSIZE (32)\n#define TR_INSERTIONSORT_THRESHOLD (8)\n#define TR_STACKSIZE (64)\n\n\n/*- Macros -*/\n\n#define STACK_PUSH(_a, _b, _c, _d)\\\n  do {\\\n    DIVSUFSORT_ASSERT(ssize < STACK_SIZE);\\\n    stack[ssize].a = (_a), stack[ssize].b = (_b),\\\n    stack[ssize].c = (_c), stack[ssize++].d = (_d);\\\n  } while(0)\n#define STACK_PUSH5(_a, _b, _c, _d, _e)\\\n  do {\\\n    DIVSUFSORT_ASSERT(ssize < STACK_SIZE);\\\n    stack[ssize].a = (_a), stack[ssize].b = (_b),\\\n    stack[ssize].c = (_c), stack[ssize].d = (_d), stack[ssize++].e = (_e);\\\n  } while(0)\n#define STACK_POP(_a, _b, _c, _d)\\\n  do {\\\n    DIVSUFSORT_ASSERT(0 <= ssize);\\\n    if(ssize == 0) { return; }\\\n    (_a) = stack[--ssize].a, (_b) = stack[ssize].b,\\\n    (_c) = stack[ssize].c, (_d) = stack[ssize].d;\\\n  } while(0)\n#define STACK_POP5(_a, _b, _c, _d, _e)\\\n  do {\\\n    DIVSUFSORT_ASSERT(0 <= ssize);\\\n    if(ssize == 0) { return; }\\\n    (_a) = stack[--ssize].a, (_b) = stack[ssize].b,\\\n    (_c) = stack[ssize].c, (_d) = stack[ssize].d, (_e) = stack[ssize].e;\\\n  } while(0)\n#define BUCKET_A(_c0) bucket_A[(_c0)]\n#if ALPHABET_SIZE == 256\n#define BUCKET_B(_c0, _c1) (bucket_B[((_c1) << 8) | (_c0)])\n#define BUCKET_BSTAR(_c0, _c1) (bucket_B[((_c0) << 8) | (_c1)])\n#else\n#define BUCKET_B(_c0, _c1) (bucket_B[(_c1) * ALPHABET_SIZE + (_c0)])\n#define BUCKET_BSTAR(_c0, _c1) (bucket_B[(_c0) * ALPHABET_SIZE + (_c1)])\n#endif\n\n\n/*- Private Functions -*/\n\nstatic const int lg_table[256]= {\n -1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,\n  5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,\n  6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,\n  6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,\n  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7\n};\n\n#if (SS_BLOCKSIZE == 0) || (SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE)\n\nstatic forceinline\nint\nss_ilg(int n) {\n#if SS_BLOCKSIZE == 0\n  return (n & 0xffff0000) ?\n          ((n & 0xff000000) ?\n            24 + lg_table[(n >> 24) & 0xff] :\n            16 + lg_table[(n >> 16) & 0xff]) :\n          ((n & 0x0000ff00) ?\n             8 + lg_table[(n >>  8) & 0xff] :\n             0 + lg_table[(n >>  0) & 0xff]);\n#elif SS_BLOCKSIZE < 256\n  return lg_table[n];\n#else\n  return (n & 0xff00) ?\n          8 + lg_table[(n >> 8) & 0xff] :\n          0 + lg_table[(n >> 0) & 0xff];\n#endif\n}\n\n#endif /* (SS_BLOCKSIZE == 0) || (SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE) */\n\n#if SS_BLOCKSIZE != 0\n\nstatic const int sqq_table[256] = {\n  0,  16,  22,  27,  32,  35,  39,  42,  45,  48,  50,  53,  55,  57,  59,  61,\n 64,  65,  67,  69,  71,  73,  75,  76,  78,  80,  81,  83,  84,  86,  87,  89,\n 90,  91,  93,  94,  96,  97,  98,  99, 101, 102, 103, 104, 106, 107, 108, 109,\n110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,\n128, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,\n143, 144, 144, 145, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 155,\n156, 157, 158, 159, 160, 160, 161, 162, 163, 163, 164, 165, 166, 167, 167, 168,\n169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178, 178, 179, 180,\n181, 181, 182, 183, 183, 184, 185, 185, 186, 187, 187, 188, 189, 189, 190, 191,\n192, 192, 193, 193, 194, 195, 195, 196, 197, 197, 198, 199, 199, 200, 201, 201,\n202, 203, 203, 204, 204, 205, 206, 206, 207, 208, 208, 209, 209, 210, 211, 211,\n212, 212, 213, 214, 214, 215, 215, 216, 217, 217, 218, 218, 219, 219, 220, 221,\n221, 222, 222, 223, 224, 224, 225, 225, 226, 226, 227, 227, 228, 229, 229, 230,\n230, 231, 231, 232, 232, 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 238,\n239, 240, 240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 247,\n247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255\n};\n\nstatic forceinline\nint\nss_isqrt(int x) {\n  int y, e;\n\n  if(x >= (SS_BLOCKSIZE * SS_BLOCKSIZE)) { return SS_BLOCKSIZE; }\n  e = (x & 0xffff0000) ?\n        ((x & 0xff000000) ?\n          24 + lg_table[(x >> 24) & 0xff] :\n          16 + lg_table[(x >> 16) & 0xff]) :\n        ((x & 0x0000ff00) ?\n           8 + lg_table[(x >>  8) & 0xff] :\n           0 + lg_table[(x >>  0) & 0xff]);\n\n  if(e >= 16) {\n    y = sqq_table[x >> ((e - 6) - (e & 1))] << ((e >> 1) - 7);\n    if(e >= 24) { y = (y + 1 + x / y) >> 1; }\n    y = (y + 1 + x / y) >> 1;\n  } else if(e >= 8) {\n    y = (sqq_table[x >> ((e - 6) - (e & 1))] >> (7 - (e >> 1))) + 1;\n  } else {\n    return sqq_table[x] >> 4;\n  }\n\n  return (x < (y * y)) ? y - 1 : y;\n}\n\n#endif /* SS_BLOCKSIZE != 0 */\n\n\n/*---------------------------------------------------------------------------*/\n\n/* Compares two suffixes. */\nstatic forceinline\nint\nss_compare(const unsigned char *T,\n           const int *p1, const int *p2,\n           int depth) {\n  const unsigned char *U1, *U2, *U1n, *U2n;\n\n  for(U1 = T + depth + *p1,\n      U2 = T + depth + *p2,\n      U1n = T + *(p1 + 1) + 2,\n      U2n = T + *(p2 + 1) + 2;\n      (U1 < U1n) && (U2 < U2n) && (*U1 == *U2);\n      ++U1, ++U2) {\n  }\n\n  return U1 < U1n ?\n        (U2 < U2n ? *U1 - *U2 : 1) :\n        (U2 < U2n ? -1 : 0);\n}\n\n\n/*---------------------------------------------------------------------------*/\n\n#if (SS_BLOCKSIZE != 1) && (SS_INSERTIONSORT_THRESHOLD != 1)\n\n/* Insertionsort for small size groups */\nstatic\nvoid\nss_insertionsort(const unsigned char *T, const int *PA,\n                 int *first, int *last, int depth) {\n  int *i, *j;\n  int t;\n  int r;\n\n  for(i = last - 2; first <= i; --i) {\n    for(t = *i, j = i + 1; 0 < (r = ss_compare(T, PA + t, PA + *j, depth));) {\n      do { *(j - 1) = *j; } while((++j < last) && (*j < 0));\n      if(last <= j) { break; }\n    }\n    if(r == 0) { *j = ~*j; }\n    *(j - 1) = t;\n  }\n}\n\n#endif /* (SS_BLOCKSIZE != 1) && (SS_INSERTIONSORT_THRESHOLD != 1) */\n\n\n/*---------------------------------------------------------------------------*/\n\n#if (SS_BLOCKSIZE == 0) || (SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE)\n\nstatic forceinline\nvoid\nss_fixdown(const unsigned char *Td, const int *PA,\n           int *SA, int i, int size) {\n  int j, k;\n  int v;\n  int c, d, e;\n\n  for(v = SA[i], c = Td[PA[v]]; (j = 2 * i + 1) < size; SA[i] = SA[k], i = k) {\n    d = Td[PA[SA[k = j++]]];\n    if(d < (e = Td[PA[SA[j]]])) { k = j; d = e; }\n    if(d <= c) { break; }\n  }\n  SA[i] = v;\n}\n\n/* Simple top-down heapsort. */\nstatic\nvoid\nss_heapsort(const unsigned char *Td, const int *PA, int *SA, int size) {\n  int i, m;\n  int t;\n\n  m = size;\n  if((size % 2) == 0) {\n    m--;\n    if(Td[PA[SA[m / 2]]] < Td[PA[SA[m]]]) { SWAP(SA[m], SA[m / 2]); }\n  }\n\n  for(i = m / 2 - 1; 0 <= i; --i) { ss_fixdown(Td, PA, SA, i, m); }\n  if((size % 2) == 0) { SWAP(SA[0], SA[m]); ss_fixdown(Td, PA, SA, 0, m); }\n  for(i = m - 1; 0 < i; --i) {\n    t = SA[0], SA[0] = SA[i];\n    ss_fixdown(Td, PA, SA, 0, i);\n    SA[i] = t;\n  }\n}\n\n\n/*---------------------------------------------------------------------------*/\n\n/* Returns the median of three elements. */\nstatic forceinline\nint *\nss_median3(const unsigned char *Td, const int *PA,\n           int *v1, int *v2, int *v3) {\n  if(Td[PA[*v1]] > Td[PA[*v2]]) { SWAP(v1, v2); }\n  if(Td[PA[*v2]] > Td[PA[*v3]]) {\n    if(Td[PA[*v1]] > Td[PA[*v3]]) { return v1; }\n    else { return v3; }\n  }\n  return v2;\n}\n\n/* Returns the median of five elements. */\nstatic forceinline\nint *\nss_median5(const unsigned char *Td, const int *PA,\n           int *v1, int *v2, int *v3, int *v4, int *v5) {\n  if(Td[PA[*v2]] > Td[PA[*v3]]) { SWAP(v2, v3); }\n  if(Td[PA[*v4]] > Td[PA[*v5]]) { SWAP(v4, v5); }\n  if(Td[PA[*v2]] > Td[PA[*v4]]) { SWAP(v2, v4); SWAP(v3, v5); }\n  if(Td[PA[*v1]] > Td[PA[*v3]]) { SWAP(v1, v3); }\n  if(Td[PA[*v1]] > Td[PA[*v4]]) { SWAP(v1, v4); SWAP(v3, v5); }\n  if(Td[PA[*v3]] > Td[PA[*v4]]) { return v4; }\n  return v3;\n}\n\n/* Returns the pivot element. */\nstatic forceinline\nint *\nss_pivot(const unsigned char *Td, const int *PA, int *first, int *last) {\n  int *middle;\n  int t;\n\n  t = last - first;\n  middle = first + t / 2;\n\n  if(t <= 512) {\n    if(t <= 32) {\n      return ss_median3(Td, PA, first, middle, last - 1);\n    } else {\n      t >>= 2;\n      return ss_median5(Td, PA, first, first + t, middle, last - 1 - t, last - 1);\n    }\n  }\n  t >>= 3;\n  first  = ss_median3(Td, PA, first, first + t, first + (t << 1));\n  middle = ss_median3(Td, PA, middle - t, middle, middle + t);\n  last   = ss_median3(Td, PA, last - 1 - (t << 1), last - 1 - t, last - 1);\n  return ss_median3(Td, PA, first, middle, last);\n}\n\n\n/*---------------------------------------------------------------------------*/\n\n/* Binary partition for substrings. */\nstatic forceinline\nint *\nss_partition(const int *PA,\n                    int *first, int *last, int depth) {\n  int *a, *b;\n  int t;\n  for(a = first - 1, b = last;;) {\n    for(; (++a < b) && ((PA[*a] + depth) >= (PA[*a + 1] + 1));) { *a = ~*a; }\n    for(; (a < --b) && ((PA[*b] + depth) <  (PA[*b + 1] + 1));) { }\n    if(b <= a) { break; }\n    t = ~*b;\n    *b = *a;\n    *a = t;\n  }\n  if(first < a) { *first = ~*first; }\n  return a;\n}\n\n/* Multikey introsort for medium size groups. */\nstatic\nvoid\nss_mintrosort(const unsigned char *T, const int *PA,\n              int *first, int *last,\n              int depth) {\n#define STACK_SIZE SS_MISORT_STACKSIZE\n  struct { int *a, *b, c; int d; } stack[STACK_SIZE];\n  const unsigned char *Td;\n  int *a, *b, *c, *d, *e, *f;\n  int s, t;\n  int ssize;\n  int limit;\n  int v, x = 0;\n\n  for(ssize = 0, limit = ss_ilg(last - first);;) {\n\n    if((last - first) <= SS_INSERTIONSORT_THRESHOLD) {\n#if 1 < SS_INSERTIONSORT_THRESHOLD\n      if(1 < (last - first)) { ss_insertionsort(T, PA, first, last, depth); }\n#endif\n      STACK_POP(first, last, depth, limit);\n      continue;\n    }\n\n    Td = T + depth;\n    if(limit-- == 0) { ss_heapsort(Td, PA, first, last - first); }\n    if(limit < 0) {\n      for(a = first + 1, v = Td[PA[*first]]; a < last; ++a) {\n        if((x = Td[PA[*a]]) != v) {\n          if(1 < (a - first)) { break; }\n          v = x;\n          first = a;\n        }\n      }\n      if(Td[PA[*first] - 1] < v) {\n        first = ss_partition(PA, first, a, depth);\n      }\n      if((a - first) <= (last - a)) {\n        if(1 < (a - first)) {\n          STACK_PUSH(a, last, depth, -1);\n          last = a, depth += 1, limit = ss_ilg(a - first);\n        } else {\n          first = a, limit = -1;\n        }\n      } else {\n        if(1 < (last - a)) {\n          STACK_PUSH(first, a, depth + 1, ss_ilg(a - first));\n          first = a, limit = -1;\n        } else {\n          last = a, depth += 1, limit = ss_ilg(a - first);\n        }\n      }\n      continue;\n    }\n\n    /* choose pivot */\n    a = ss_pivot(Td, PA, first, last);\n    v = Td[PA[*a]];\n    SWAP(*first, *a);\n\n    /* partition */\n    for(b = first; (++b < last) && ((x = Td[PA[*b]]) == v);) { }\n    if(((a = b) < last) && (x < v)) {\n      for(; (++b < last) && ((x = Td[PA[*b]]) <= v);) {\n        if(x == v) { SWAP(*b, *a); ++a; }\n      }\n    }\n    for(c = last; (b < --c) && ((x = Td[PA[*c]]) == v);) { }\n    if((b < (d = c)) && (x > v)) {\n      for(; (b < --c) && ((x = Td[PA[*c]]) >= v);) {\n        if(x == v) { SWAP(*c, *d); --d; }\n      }\n    }\n    for(; b < c;) {\n      SWAP(*b, *c);\n      for(; (++b < c) && ((x = Td[PA[*b]]) <= v);) {\n        if(x == v) { SWAP(*b, *a); ++a; }\n      }\n      for(; (b < --c) && ((x = Td[PA[*c]]) >= v);) {\n        if(x == v) { SWAP(*c, *d); --d; }\n      }\n    }\n\n    if(a <= d) {\n      c = b - 1;\n\n      if((s = a - first) > (t = b - a)) { s = t; }\n      for(e = first, f = b - s; 0 < s; --s, ++e, ++f) { SWAP(*e, *f); }\n      if((s = d - c) > (t = last - d - 1)) { s = t; }\n      for(e = b, f = last - s; 0 < s; --s, ++e, ++f) { SWAP(*e, *f); }\n\n      a = first + (b - a), c = last - (d - c);\n      b = (v <= Td[PA[*a] - 1]) ? a : ss_partition(PA, a, c, depth);\n\n      if((a - first) <= (last - c)) {\n        if((last - c) <= (c - b)) {\n          STACK_PUSH(b, c, depth + 1, ss_ilg(c - b));\n          STACK_PUSH(c, last, depth, limit);\n          last = a;\n        } else if((a - first) <= (c - b)) {\n          STACK_PUSH(c, last, depth, limit);\n          STACK_PUSH(b, c, depth + 1, ss_ilg(c - b));\n          last = a;\n        } else {\n          STACK_PUSH(c, last, depth, limit);\n          STACK_PUSH(first, a, depth, limit);\n          first = b, last = c, depth += 1, limit = ss_ilg(c - b);\n        }\n      } else {\n        if((a - first) <= (c - b)) {\n          STACK_PUSH(b, c, depth + 1, ss_ilg(c - b));\n          STACK_PUSH(first, a, depth, limit);\n          first = c;\n        } else if((last - c) <= (c - b)) {\n          STACK_PUSH(first, a, depth, limit);\n          STACK_PUSH(b, c, depth + 1, ss_ilg(c - b));\n          first = c;\n        } else {\n          STACK_PUSH(first, a, depth, limit);\n          STACK_PUSH(c, last, depth, limit);\n          first = b, last = c, depth += 1, limit = ss_ilg(c - b);\n        }\n      }\n    } else {\n      limit += 1;\n      if(Td[PA[*first] - 1] < v) {\n        first = ss_partition(PA, first, last, depth);\n        limit = ss_ilg(last - first);\n      }\n      depth += 1;\n    }\n  }\n#undef STACK_SIZE\n}\n\n#endif /* (SS_BLOCKSIZE == 0) || (SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE) */\n\n\n/*---------------------------------------------------------------------------*/\n\n#if SS_BLOCKSIZE != 0\n\nstatic forceinline\nvoid\nss_blockswap(int *a, int *b, int n) {\n  int t;\n  for(; 0 < n; --n, ++a, ++b) {\n    t = *a, *a = *b, *b = t;\n  }\n}\n\nstatic forceinline\nvoid\nss_rotate(int *first, int *middle, int *last) {\n  int *a, *b, t;\n  int l, r;\n  l = middle - first, r = last - middle;\n  for(; (0 < l) && (0 < r);) {\n    if(l == r) { ss_blockswap(first, middle, l); break; }\n    if(l < r) {\n      a = last - 1, b = middle - 1;\n      t = *a;\n      do {\n        *a-- = *b, *b-- = *a;\n        if(b < first) {\n          *a = t;\n          last = a;\n          if((r -= l + 1) <= l) { break; }\n          a -= 1, b = middle - 1;\n          t = *a;\n        }\n      } while(1);\n    } else {\n      a = first, b = middle;\n      t = *a;\n      do {\n        *a++ = *b, *b++ = *a;\n        if(last <= b) {\n          *a = t;\n          first = a + 1;\n          if((l -= r + 1) <= r) { break; }\n          a += 1, b = middle;\n          t = *a;\n        }\n      } while(1);\n    }\n  }\n}\n\n\n/*---------------------------------------------------------------------------*/\n\nstatic\nvoid\nss_inplacemerge(const unsigned char *T, const int *PA,\n                int *first, int *middle, int *last,\n                int depth) {\n  const int *p;\n  int *a, *b;\n  int len, half;\n  int q, r;\n  int x;\n\n  for(;;) {\n    if(*(last - 1) < 0) { x = 1; p = PA + ~*(last - 1); }\n    else                { x = 0; p = PA +  *(last - 1); }\n    for(a = first, len = middle - first, half = len >> 1, r = -1;\n        0 < len;\n        len = half, half >>= 1) {\n      b = a + half;\n      q = ss_compare(T, PA + ((0 <= *b) ? *b : ~*b), p, depth);\n      if(q < 0) {\n        a = b + 1;\n        half -= (len & 1) ^ 1;\n      } else {\n        r = q;\n      }\n    }\n    if(a < middle) {\n      if(r == 0) { *a = ~*a; }\n      ss_rotate(a, middle, last);\n      last -= middle - a;\n      middle = a;\n      if(first == middle) { break; }\n    }\n    --last;\n    if(x != 0) { while(*--last < 0) { } }\n    if(middle == last) { break; }\n  }\n}\n\n\n/*---------------------------------------------------------------------------*/\n\n/* Merge-forward with internal buffer. */\nstatic\nvoid\nss_mergeforward(const unsigned char *T, const int *PA,\n                int *first, int *middle, int *last,\n                int *buf, int depth) {\n  int *a, *b, *c, *bufend;\n  int t;\n  int r;\n\n  bufend = buf + (middle - first) - 1;\n  ss_blockswap(buf, first, middle - first);\n\n  for(t = *(a = first), b = buf, c = middle;;) {\n    r = ss_compare(T, PA + *b, PA + *c, depth);\n    if(r < 0) {\n      do {\n        *a++ = *b;\n        if(bufend <= b) { *bufend = t; return; }\n        *b++ = *a;\n      } while(*b < 0);\n    } else if(r > 0) {\n      do {\n        *a++ = *c, *c++ = *a;\n        if(last <= c) {\n          while(b < bufend) { *a++ = *b, *b++ = *a; }\n          *a = *b, *b = t;\n          return;\n        }\n      } while(*c < 0);\n    } else {\n      *c = ~*c;\n      do {\n        *a++ = *b;\n        if(bufend <= b) { *bufend = t; return; }\n        *b++ = *a;\n      } while(*b < 0);\n\n      do {\n        *a++ = *c, *c++ = *a;\n        if(last <= c) {\n          while(b < bufend) { *a++ = *b, *b++ = *a; }\n          *a = *b, *b = t;\n          return;\n        }\n      } while(*c < 0);\n    }\n  }\n}\n\n/* Merge-backward with internal buffer. */\nstatic\nvoid\nss_mergebackward(const unsigned char *T, const int *PA,\n                 int *first, int *middle, int *last,\n                 int *buf, int depth) {\n  const int *p1, *p2;\n  int *a, *b, *c, *bufend;\n  int t;\n  int r;\n  int x;\n\n  bufend = buf + (last - middle) - 1;\n  ss_blockswap(buf, middle, last - middle);\n\n  x = 0;\n  if(*bufend < 0)       { p1 = PA + ~*bufend; x |= 1; }\n  else                  { p1 = PA +  *bufend; }\n  if(*(middle - 1) < 0) { p2 = PA + ~*(middle - 1); x |= 2; }\n  else                  { p2 = PA +  *(middle - 1); }\n  for(t = *(a = last - 1), b = bufend, c = middle - 1;;) {\n    r = ss_compare(T, p1, p2, depth);\n    if(0 < r) {\n      if(x & 1) { do { *a-- = *b, *b-- = *a; } while(*b < 0); x ^= 1; }\n      *a-- = *b;\n      if(b <= buf) { *buf = t; break; }\n      *b-- = *a;\n      if(*b < 0) { p1 = PA + ~*b; x |= 1; }\n      else       { p1 = PA +  *b; }\n    } else if(r < 0) {\n      if(x & 2) { do { *a-- = *c, *c-- = *a; } while(*c < 0); x ^= 2; }\n      *a-- = *c, *c-- = *a;\n      if(c < first) {\n        while(buf < b) { *a-- = *b, *b-- = *a; }\n        *a = *b, *b = t;\n        break;\n      }\n      if(*c < 0) { p2 = PA + ~*c; x |= 2; }\n      else       { p2 = PA +  *c; }\n    } else {\n      if(x & 1) { do { *a-- = *b, *b-- = *a; } while(*b < 0); x ^= 1; }\n      *a-- = ~*b;\n      if(b <= buf) { *buf = t; break; }\n      *b-- = *a;\n      if(x & 2) { do { *a-- = *c, *c-- = *a; } while(*c < 0); x ^= 2; }\n      *a-- = *c, *c-- = *a;\n      if(c < first) {\n        while(buf < b) { *a-- = *b, *b-- = *a; }\n        *a = *b, *b = t;\n        break;\n      }\n      if(*b < 0) { p1 = PA + ~*b; x |= 1; }\n      else       { p1 = PA +  *b; }\n      if(*c < 0) { p2 = PA + ~*c; x |= 2; }\n      else       { p2 = PA +  *c; }\n    }\n  }\n}\n\n/* D&C based merge. */\nstatic\nvoid\nss_swapmerge(const unsigned char *T, const int *PA,\n             int *first, int *middle, int *last,\n             int *buf, int bufsize, int depth) {\n#define STACK_SIZE SS_SMERGE_STACKSIZE\n#define GETIDX(a) ((0 <= (a)) ? (a) : (~(a)))\n#define MERGE_CHECK(a, b, c)\\\n  do {\\\n    if(((c) & 1) ||\\\n       (((c) & 2) && (ss_compare(T, PA + GETIDX(*((a) - 1)), PA + *(a), depth) == 0))) {\\\n      *(a) = ~*(a);\\\n    }\\\n    if(((c) & 4) && ((ss_compare(T, PA + GETIDX(*((b) - 1)), PA + *(b), depth) == 0))) {\\\n      *(b) = ~*(b);\\\n    }\\\n  } while(0)\n  struct { int *a, *b, *c; int d; } stack[STACK_SIZE];\n  int *l, *r, *lm, *rm;\n  int m, len, half;\n  int ssize;\n  int check, next;\n\n  for(check = 0, ssize = 0;;) {\n    if((last - middle) <= bufsize) {\n      if((first < middle) && (middle < last)) {\n        ss_mergebackward(T, PA, first, middle, last, buf, depth);\n      }\n      MERGE_CHECK(first, last, check);\n      STACK_POP(first, middle, last, check);\n      continue;\n    }\n\n    if((middle - first) <= bufsize) {\n      if(first < middle) {\n        ss_mergeforward(T, PA, first, middle, last, buf, depth);\n      }\n      MERGE_CHECK(first, last, check);\n      STACK_POP(first, middle, last, check);\n      continue;\n    }\n\n    for(m = 0, len = MIN(middle - first, last - middle), half = len >> 1;\n        0 < len;\n        len = half, half >>= 1) {\n      if(ss_compare(T, PA + GETIDX(*(middle + m + half)),\n                       PA + GETIDX(*(middle - m - half - 1)), depth) < 0) {\n        m += half + 1;\n        half -= (len & 1) ^ 1;\n      }\n    }\n\n    if(0 < m) {\n      lm = middle - m, rm = middle + m;\n      ss_blockswap(lm, middle, m);\n      l = r = middle, next = 0;\n      if(rm < last) {\n        if(*rm < 0) {\n          *rm = ~*rm;\n          if(first < lm) { for(; *--l < 0;) { } next |= 4; }\n          next |= 1;\n        } else if(first < lm) {\n          for(; *r < 0; ++r) { }\n          next |= 2;\n        }\n      }\n\n      if((l - first) <= (last - r)) {\n        STACK_PUSH(r, rm, last, (next & 3) | (check & 4));\n        middle = lm, last = l, check = (check & 3) | (next & 4);\n      } else {\n        if((next & 2) && (r == middle)) { next ^= 6; }\n        STACK_PUSH(first, lm, l, (check & 3) | (next & 4));\n        first = r, middle = rm, check = (next & 3) | (check & 4);\n      }\n    } else {\n      if(ss_compare(T, PA + GETIDX(*(middle - 1)), PA + *middle, depth) == 0) {\n        *middle = ~*middle;\n      }\n      MERGE_CHECK(first, last, check);\n      STACK_POP(first, middle, last, check);\n    }\n  }\n#undef STACK_SIZE\n}\n\n#endif /* SS_BLOCKSIZE != 0 */\n\n\n/*---------------------------------------------------------------------------*/\n\n/* Substring sort */\nstatic\nvoid\nsssort(const unsigned char *T, const int *PA,\n       int *first, int *last,\n       int *buf, int bufsize,\n       int depth, int n, int lastsuffix) {\n  int *a;\n#if SS_BLOCKSIZE != 0\n  int *b, *middle, *curbuf;\n  int j, k, curbufsize, limit;\n#endif\n  int i;\n\n  if(lastsuffix != 0) { ++first; }\n\n#if SS_BLOCKSIZE == 0\n  ss_mintrosort(T, PA, first, last, depth);\n#else\n  if((bufsize < SS_BLOCKSIZE) &&\n      (bufsize < (last - first)) &&\n      (bufsize < (limit = ss_isqrt(last - first)))) {\n    if(SS_BLOCKSIZE < limit) { limit = SS_BLOCKSIZE; }\n    buf = middle = last - limit, bufsize = limit;\n  } else {\n    middle = last, limit = 0;\n  }\n  for(a = first, i = 0; SS_BLOCKSIZE < (middle - a); a += SS_BLOCKSIZE, ++i) {\n#if SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE\n    ss_mintrosort(T, PA, a, a + SS_BLOCKSIZE, depth);\n#elif 1 < SS_BLOCKSIZE\n    ss_insertionsort(T, PA, a, a + SS_BLOCKSIZE, depth);\n#endif\n    curbufsize = last - (a + SS_BLOCKSIZE);\n    curbuf = a + SS_BLOCKSIZE;\n    if(curbufsize <= bufsize) { curbufsize = bufsize, curbuf = buf; }\n    for(b = a, k = SS_BLOCKSIZE, j = i; j & 1; b -= k, k <<= 1, j >>= 1) {\n      ss_swapmerge(T, PA, b - k, b, b + k, curbuf, curbufsize, depth);\n    }\n  }\n#if SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE\n  ss_mintrosort(T, PA, a, middle, depth);\n#elif 1 < SS_BLOCKSIZE\n  ss_insertionsort(T, PA, a, middle, depth);\n#endif\n  for(k = SS_BLOCKSIZE; i != 0; k <<= 1, i >>= 1) {\n    if(i & 1) {\n      ss_swapmerge(T, PA, a - k, a, middle, buf, bufsize, depth);\n      a -= k;\n    }\n  }\n  if(limit != 0) {\n#if SS_INSERTIONSORT_THRESHOLD < SS_BLOCKSIZE\n    ss_mintrosort(T, PA, middle, last, depth);\n#elif 1 < SS_BLOCKSIZE\n    ss_insertionsort(T, PA, middle, last, depth);\n#endif\n    ss_inplacemerge(T, PA, first, middle, last, depth);\n  }\n#endif\n\n  if(lastsuffix != 0) {\n    /* Insert last type B* suffix. */\n    int PAi[2]; PAi[0] = PA[*(first - 1)], PAi[1] = n - 2;\n    for(a = first, i = *(first - 1);\n        (a < last) && ((*a < 0) || (0 < ss_compare(T, &(PAi[0]), PA + *a, depth)));\n        ++a) {\n      *(a - 1) = *a;\n    }\n    *(a - 1) = i;\n  }\n}\n\n\n/*---------------------------------------------------------------------------*/\n\nstatic forceinline\nint\ntr_ilg(int n) {\n  return (n & 0xffff0000) ?\n          ((n & 0xff000000) ?\n            24 + lg_table[(n >> 24) & 0xff] :\n            16 + lg_table[(n >> 16) & 0xff]) :\n          ((n & 0x0000ff00) ?\n             8 + lg_table[(n >>  8) & 0xff] :\n             0 + lg_table[(n >>  0) & 0xff]);\n}\n\n\n/*---------------------------------------------------------------------------*/\n\n/* Simple insertionsort for small size groups. */\nstatic\nvoid\ntr_insertionsort(const int *ISAd, int *first, int *last) {\n  int *a, *b;\n  int t, r;\n\n  for(a = first + 1; a < last; ++a) {\n    for(t = *a, b = a - 1; 0 > (r = ISAd[t] - ISAd[*b]);) {\n      do { *(b + 1) = *b; } while((first <= --b) && (*b < 0));\n      if(b < first) { break; }\n    }\n    if(r == 0) { *b = ~*b; }\n    *(b + 1) = t;\n  }\n}\n\n\n/*---------------------------------------------------------------------------*/\n\nstatic forceinline\nvoid\ntr_fixdown(const int *ISAd, int *SA, int i, int size) {\n  int j, k;\n  int v;\n  int c, d, e;\n\n  for(v = SA[i], c = ISAd[v]; (j = 2 * i + 1) < size; SA[i] = SA[k], i = k) {\n    d = ISAd[SA[k = j++]];\n    if(d < (e = ISAd[SA[j]])) { k = j; d = e; }\n    if(d <= c) { break; }\n  }\n  SA[i] = v;\n}\n\n/* Simple top-down heapsort. */\nstatic\nvoid\ntr_heapsort(const int *ISAd, int *SA, int size) {\n  int i, m;\n  int t;\n\n  m = size;\n  if((size % 2) == 0) {\n    m--;\n    if(ISAd[SA[m / 2]] < ISAd[SA[m]]) { SWAP(SA[m], SA[m / 2]); }\n  }\n\n  for(i = m / 2 - 1; 0 <= i; --i) { tr_fixdown(ISAd, SA, i, m); }\n  if((size % 2) == 0) { SWAP(SA[0], SA[m]); tr_fixdown(ISAd, SA, 0, m); }\n  for(i = m - 1; 0 < i; --i) {\n    t = SA[0], SA[0] = SA[i];\n    tr_fixdown(ISAd, SA, 0, i);\n    SA[i] = t;\n  }\n}\n\n\n/*---------------------------------------------------------------------------*/\n\n/* Returns the median of three elements. */\nstatic forceinline\nint *\ntr_median3(const int *ISAd, int *v1, int *v2, int *v3) {\n  if(ISAd[*v1] > ISAd[*v2]) { SWAP(v1, v2); }\n  if(ISAd[*v2] > ISAd[*v3]) {\n    if(ISAd[*v1] > ISAd[*v3]) { return v1; }\n    else { return v3; }\n  }\n  return v2;\n}\n\n/* Returns the median of five elements. */\nstatic forceinline\nint *\ntr_median5(const int *ISAd,\n           int *v1, int *v2, int *v3, int *v4, int *v5) {\n  if(ISAd[*v2] > ISAd[*v3]) { SWAP(v2, v3); }\n  if(ISAd[*v4] > ISAd[*v5]) { SWAP(v4, v5); }\n  if(ISAd[*v2] > ISAd[*v4]) { SWAP(v2, v4); SWAP(v3, v5); }\n  if(ISAd[*v1] > ISAd[*v3]) { SWAP(v1, v3); }\n  if(ISAd[*v1] > ISAd[*v4]) { SWAP(v1, v4); SWAP(v3, v5); }\n  if(ISAd[*v3] > ISAd[*v4]) { return v4; }\n  return v3;\n}\n\n/* Returns the pivot element. */\nstatic forceinline\nint *\ntr_pivot(const int *ISAd, int *first, int *last) {\n  int *middle;\n  int t;\n\n  t = last - first;\n  middle = first + t / 2;\n\n  if(t <= 512) {\n    if(t <= 32) {\n      return tr_median3(ISAd, first, middle, last - 1);\n    } else {\n      t >>= 2;\n      return tr_median5(ISAd, first, first + t, middle, last - 1 - t, last - 1);\n    }\n  }\n  t >>= 3;\n  first  = tr_median3(ISAd, first, first + t, first + (t << 1));\n  middle = tr_median3(ISAd, middle - t, middle, middle + t);\n  last   = tr_median3(ISAd, last - 1 - (t << 1), last - 1 - t, last - 1);\n  return tr_median3(ISAd, first, middle, last);\n}\n\n\n/*---------------------------------------------------------------------------*/\n\ntypedef struct _trbudget_t trbudget_t;\nstruct _trbudget_t {\n  int chance;\n  int remain;\n  int incval;\n  int count;\n};\n\nstatic forceinline\nvoid\ntrbudget_init(trbudget_t *budget, int chance, int incval) {\n  budget->chance = chance;\n  budget->remain = budget->incval = incval;\n}\n\nstatic forceinline\nint\ntrbudget_check(trbudget_t *budget, int size) {\n  if(size <= budget->remain) { budget->remain -= size; return 1; }\n  if(budget->chance == 0) { budget->count += size; return 0; }\n  budget->remain += budget->incval - size;\n  budget->chance -= 1;\n  return 1;\n}\n\n\n/*---------------------------------------------------------------------------*/\n\nstatic forceinline\nvoid\ntr_partition(const int *ISAd,\n             int *first, int *middle, int *last,\n             int **pa, int **pb, int v) {\n  int *a, *b, *c, *d, *e, *f;\n  int t, s;\n  int x = 0;\n\n  for(b = middle - 1; (++b < last) && ((x = ISAd[*b]) == v);) { }\n  if(((a = b) < last) && (x < v)) {\n    for(; (++b < last) && ((x = ISAd[*b]) <= v);) {\n      if(x == v) { SWAP(*b, *a); ++a; }\n    }\n  }\n  for(c = last; (b < --c) && ((x = ISAd[*c]) == v);) { }\n  if((b < (d = c)) && (x > v)) {\n    for(; (b < --c) && ((x = ISAd[*c]) >= v);) {\n      if(x == v) { SWAP(*c, *d); --d; }\n    }\n  }\n  for(; b < c;) {\n    SWAP(*b, *c);\n    for(; (++b < c) && ((x = ISAd[*b]) <= v);) {\n      if(x == v) { SWAP(*b, *a); ++a; }\n    }\n    for(; (b < --c) && ((x = ISAd[*c]) >= v);) {\n      if(x == v) { SWAP(*c, *d); --d; }\n    }\n  }\n\n  if(a <= d) {\n    c = b - 1;\n    if((s = a - first) > (t = b - a)) { s = t; }\n    for(e = first, f = b - s; 0 < s; --s, ++e, ++f) { SWAP(*e, *f); }\n    if((s = d - c) > (t = last - d - 1)) { s = t; }\n    for(e = b, f = last - s; 0 < s; --s, ++e, ++f) { SWAP(*e, *f); }\n    first += (b - a), last -= (d - c);\n  }\n  *pa = first, *pb = last;\n}\n\nstatic\nvoid\ntr_copy(int *ISA, const int *SA,\n        int *first, int *a, int *b, int *last,\n        int depth) {\n  /* sort suffixes of middle partition\n     by using sorted order of suffixes of left and right partition. */\n  int *c, *d, *e;\n  int s, v;\n\n  v = b - SA - 1;\n  for(c = first, d = a - 1; c <= d; ++c) {\n    if((0 <= (s = *c - depth)) && (ISA[s] == v)) {\n      *++d = s;\n      ISA[s] = d - SA;\n    }\n  }\n  for(c = last - 1, e = d + 1, d = b; e < d; --c) {\n    if((0 <= (s = *c - depth)) && (ISA[s] == v)) {\n      *--d = s;\n      ISA[s] = d - SA;\n    }\n  }\n}\n\nstatic\nvoid\ntr_partialcopy(int *ISA, const int *SA,\n               int *first, int *a, int *b, int *last,\n               int depth) {\n  int *c, *d, *e;\n  int s, v;\n  int rank, lastrank, newrank = -1;\n\n  v = b - SA - 1;\n  lastrank = -1;\n  for(c = first, d = a - 1; c <= d; ++c) {\n    if((0 <= (s = *c - depth)) && (ISA[s] == v)) {\n      *++d = s;\n      rank = ISA[s + depth];\n      if(lastrank != rank) { lastrank = rank; newrank = d - SA; }\n      ISA[s] = newrank;\n    }\n  }\n\n  lastrank = -1;\n  for(e = d; first <= e; --e) {\n    rank = ISA[*e];\n    if(lastrank != rank) { lastrank = rank; newrank = e - SA; }\n    if(newrank != rank) { ISA[*e] = newrank; }\n  }\n\n  lastrank = -1;\n  for(c = last - 1, e = d + 1, d = b; e < d; --c) {\n    if((0 <= (s = *c - depth)) && (ISA[s] == v)) {\n      *--d = s;\n      rank = ISA[s + depth];\n      if(lastrank != rank) { lastrank = rank; newrank = d - SA; }\n      ISA[s] = newrank;\n    }\n  }\n}\n\nstatic\nvoid\ntr_introsort(int *ISA, const int *ISAd,\n             int *SA, int *first, int *last,\n             trbudget_t *budget) {\n#define STACK_SIZE TR_STACKSIZE\n  struct { const int *a; int *b, *c; int d, e; }stack[STACK_SIZE];\n  int *a, *b, *c;\n  int v, x = 0;\n  int incr = ISAd - ISA;\n  int limit, next;\n  int ssize, trlink = -1;\n\n  for(ssize = 0, limit = tr_ilg(last - first);;) {\n\n    if(limit < 0) {\n      if(limit == -1) {\n        /* tandem repeat partition */\n        tr_partition(ISAd - incr, first, first, last, &a, &b, last - SA - 1);\n\n        /* update ranks */\n        if(a < last) {\n          for(c = first, v = a - SA - 1; c < a; ++c) { ISA[*c] = v; }\n        }\n        if(b < last) {\n          for(c = a, v = b - SA - 1; c < b; ++c) { ISA[*c] = v; }\n        }\n\n        /* push */\n        if(1 < (b - a)) {\n          STACK_PUSH5(NULL, a, b, 0, 0);\n          STACK_PUSH5(ISAd - incr, first, last, -2, trlink);\n          trlink = ssize - 2;\n        }\n        if((a - first) <= (last - b)) {\n          if(1 < (a - first)) {\n            STACK_PUSH5(ISAd, b, last, tr_ilg(last - b), trlink);\n            last = a, limit = tr_ilg(a - first);\n          } else if(1 < (last - b)) {\n            first = b, limit = tr_ilg(last - b);\n          } else {\n            STACK_POP5(ISAd, first, last, limit, trlink);\n          }\n        } else {\n          if(1 < (last - b)) {\n            STACK_PUSH5(ISAd, first, a, tr_ilg(a - first), trlink);\n            first = b, limit = tr_ilg(last - b);\n          } else if(1 < (a - first)) {\n            last = a, limit = tr_ilg(a - first);\n          } else {\n            STACK_POP5(ISAd, first, last, limit, trlink);\n          }\n        }\n      } else if(limit == -2) {\n        /* tandem repeat copy */\n        a = stack[--ssize].b, b = stack[ssize].c;\n        if(stack[ssize].d == 0) {\n          tr_copy(ISA, SA, first, a, b, last, ISAd - ISA);\n        } else {\n          if(0 <= trlink) { stack[trlink].d = -1; }\n          tr_partialcopy(ISA, SA, first, a, b, last, ISAd - ISA);\n        }\n        STACK_POP5(ISAd, first, last, limit, trlink);\n      } else {\n        /* sorted partition */\n        if(0 <= *first) {\n          a = first;\n          do { ISA[*a] = a - SA; } while((++a < last) && (0 <= *a));\n          first = a;\n        }\n        if(first < last) {\n          a = first; do { *a = ~*a; } while(*++a < 0);\n          next = (ISA[*a] != ISAd[*a]) ? tr_ilg(a - first + 1) : -1;\n          if(++a < last) { for(b = first, v = a - SA - 1; b < a; ++b) { ISA[*b] = v; } }\n\n          /* push */\n          if(trbudget_check(budget, a - first)) {\n            if((a - first) <= (last - a)) {\n              STACK_PUSH5(ISAd, a, last, -3, trlink);\n              ISAd += incr, last = a, limit = next;\n            } else {\n              if(1 < (last - a)) {\n                STACK_PUSH5(ISAd + incr, first, a, next, trlink);\n                first = a, limit = -3;\n              } else {\n                ISAd += incr, last = a, limit = next;\n              }\n            }\n          } else {\n            if(0 <= trlink) { stack[trlink].d = -1; }\n            if(1 < (last - a)) {\n              first = a, limit = -3;\n            } else {\n              STACK_POP5(ISAd, first, last, limit, trlink);\n            }\n          }\n        } else {\n          STACK_POP5(ISAd, first, last, limit, trlink);\n        }\n      }\n      continue;\n    }\n\n    if((last - first) <= TR_INSERTIONSORT_THRESHOLD) {\n      tr_insertionsort(ISAd, first, last);\n      limit = -3;\n      continue;\n    }\n\n    if(limit-- == 0) {\n      tr_heapsort(ISAd, first, last - first);\n      for(a = last - 1; first < a; a = b) {\n        for(x = ISAd[*a], b = a - 1; (first <= b) && (ISAd[*b] == x); --b) { *b = ~*b; }\n      }\n      limit = -3;\n      continue;\n    }\n\n    /* choose pivot */\n    a = tr_pivot(ISAd, first, last);\n    SWAP(*first, *a);\n    v = ISAd[*first];\n\n    /* partition */\n    tr_partition(ISAd, first, first + 1, last, &a, &b, v);\n    if((last - first) != (b - a)) {\n      next = (ISA[*a] != v) ? tr_ilg(b - a) : -1;\n\n      /* update ranks */\n      for(c = first, v = a - SA - 1; c < a; ++c) { ISA[*c] = v; }\n      if(b < last) { for(c = a, v = b - SA - 1; c < b; ++c) { ISA[*c] = v; } }\n\n      /* push */\n      if((1 < (b - a)) && (trbudget_check(budget, b - a))) {\n        if((a - first) <= (last - b)) {\n          if((last - b) <= (b - a)) {\n            if(1 < (a - first)) {\n              STACK_PUSH5(ISAd + incr, a, b, next, trlink);\n              STACK_PUSH5(ISAd, b, last, limit, trlink);\n              last = a;\n            } else if(1 < (last - b)) {\n              STACK_PUSH5(ISAd + incr, a, b, next, trlink);\n              first = b;\n            } else {\n              ISAd += incr, first = a, last = b, limit = next;\n            }\n          } else if((a - first) <= (b - a)) {\n            if(1 < (a - first)) {\n              STACK_PUSH5(ISAd, b, last, limit, trlink);\n              STACK_PUSH5(ISAd + incr, a, b, next, trlink);\n              last = a;\n            } else {\n              STACK_PUSH5(ISAd, b, last, limit, trlink);\n              ISAd += incr, first = a, last = b, limit = next;\n            }\n          } else {\n            STACK_PUSH5(ISAd, b, last, limit, trlink);\n            STACK_PUSH5(ISAd, first, a, limit, trlink);\n            ISAd += incr, first = a, last = b, limit = next;\n          }\n        } else {\n          if((a - first) <= (b - a)) {\n            if(1 < (last - b)) {\n              STACK_PUSH5(ISAd + incr, a, b, next, trlink);\n              STACK_PUSH5(ISAd, first, a, limit, trlink);\n              first = b;\n            } else if(1 < (a - first)) {\n              STACK_PUSH5(ISAd + incr, a, b, next, trlink);\n              last = a;\n            } else {\n              ISAd += incr, first = a, last = b, limit = next;\n            }\n          } else if((last - b) <= (b - a)) {\n            if(1 < (last - b)) {\n              STACK_PUSH5(ISAd, first, a, limit, trlink);\n              STACK_PUSH5(ISAd + incr, a, b, next, trlink);\n              first = b;\n            } else {\n              STACK_PUSH5(ISAd, first, a, limit, trlink);\n              ISAd += incr, first = a, last = b, limit = next;\n            }\n          } else {\n            STACK_PUSH5(ISAd, first, a, limit, trlink);\n            STACK_PUSH5(ISAd, b, last, limit, trlink);\n            ISAd += incr, first = a, last = b, limit = next;\n          }\n        }\n      } else {\n        if((1 < (b - a)) && (0 <= trlink)) { stack[trlink].d = -1; }\n        if((a - first) <= (last - b)) {\n          if(1 < (a - first)) {\n            STACK_PUSH5(ISAd, b, last, limit, trlink);\n            last = a;\n          } else if(1 < (last - b)) {\n            first = b;\n          } else {\n            STACK_POP5(ISAd, first, last, limit, trlink);\n          }\n        } else {\n          if(1 < (last - b)) {\n            STACK_PUSH5(ISAd, first, a, limit, trlink);\n            first = b;\n          } else if(1 < (a - first)) {\n            last = a;\n          } else {\n            STACK_POP5(ISAd, first, last, limit, trlink);\n          }\n        }\n      }\n    } else {\n      if(trbudget_check(budget, last - first)) {\n        limit = tr_ilg(last - first), ISAd += incr;\n      } else {\n        if(0 <= trlink) { stack[trlink].d = -1; }\n        STACK_POP5(ISAd, first, last, limit, trlink);\n      }\n    }\n  }\n#undef STACK_SIZE\n}\n\n\n\n/*---------------------------------------------------------------------------*/\n\n/* Tandem repeat sort */\nstatic\nvoid\ntrsort(int *ISA, int *SA, int n, int depth) {\n  int *ISAd;\n  int *first, *last;\n  trbudget_t budget;\n  int t, skip, unsorted;\n\n  trbudget_init(&budget, tr_ilg(n) * 2 / 3, n);\n/*  trbudget_init(&budget, tr_ilg(n) * 3 / 4, n); */\n  for(ISAd = ISA + depth; -n < *SA; ISAd += ISAd - ISA) {\n    first = SA;\n    skip = 0;\n    unsorted = 0;\n    do {\n      if((t = *first) < 0) { first -= t; skip += t; }\n      else {\n        if(skip != 0) { *(first + skip) = skip; skip = 0; }\n        last = SA + ISA[t] + 1;\n        if(1 < (last - first)) {\n          budget.count = 0;\n          tr_introsort(ISA, ISAd, SA, first, last, &budget);\n          if(budget.count != 0) { unsorted += budget.count; }\n          else { skip = first - last; }\n        } else if((last - first) == 1) {\n          skip = -1;\n        }\n        first = last;\n      }\n    } while(first < (SA + n));\n    if(skip != 0) { *(first + skip) = skip; }\n    if(unsorted == 0) { break; }\n  }\n}\n\n\n/*---------------------------------------------------------------------------*/\n\n/* Sorts suffixes of type B*. */\nstatic\nint\nsort_typeBstar(const unsigned char *T, int *SA,\n               int *bucket_A, int *bucket_B,\n               int n) {\n  int *PAb, *ISAb, *buf;\n  int i, j, k, t, m, bufsize;\n  int c0, c1;\n\n  /* Initialize bucket arrays. */\n  for(i = 0; i < BUCKET_A_SIZE; ++i) { bucket_A[i] = 0; }\n  for(i = 0; i < BUCKET_B_SIZE; ++i) { bucket_B[i] = 0; }\n\n  /* Count the number of occurrences of the first one or two characters of each\n     type A, B and B* suffix. Moreover, store the beginning position of all\n     type B* suffixes into the array SA. */\n  for(i = n - 1, m = n, c0 = T[n - 1]; 0 <= i;) {\n    /* type A suffix. */\n    do { ++BUCKET_A(c1 = c0); } while((0 <= --i) && ((c0 = T[i]) >= c1));\n    if(0 <= i) {\n      /* type B* suffix. */\n      ++BUCKET_BSTAR(c0, c1);\n      SA[--m] = i;\n      /* type B suffix. */\n      for(--i, c1 = c0; (0 <= i) && ((c0 = T[i]) <= c1); --i, c1 = c0) {\n        ++BUCKET_B(c0, c1);\n      }\n    }\n  }\n  m = n - m;\n/*\nnote:\n  A type B* suffix is lexicographically smaller than a type B suffix that\n  begins with the same first two characters.\n*/\n\n  /* Calculate the index of start/end point of each bucket. */\n  for(c0 = 0, i = 0, j = 0; c0 < ALPHABET_SIZE; ++c0) {\n    t = i + BUCKET_A(c0);\n    BUCKET_A(c0) = i + j; /* start point */\n    i = t + BUCKET_B(c0, c0);\n    for(c1 = c0 + 1; c1 < ALPHABET_SIZE; ++c1) {\n      j += BUCKET_BSTAR(c0, c1);\n      BUCKET_BSTAR(c0, c1) = j; /* end point */\n      i += BUCKET_B(c0, c1);\n    }\n  }\n\n  if(0 < m) {\n    /* Sort the type B* suffixes by their first two characters. */\n    PAb = SA + n - m; ISAb = SA + m;\n    for(i = m - 2; 0 <= i; --i) {\n      t = PAb[i], c0 = T[t], c1 = T[t + 1];\n      SA[--BUCKET_BSTAR(c0, c1)] = i;\n    }\n    t = PAb[m - 1], c0 = T[t], c1 = T[t + 1];\n    SA[--BUCKET_BSTAR(c0, c1)] = m - 1;\n\n    /* Sort the type B* substrings using sssort. */\n    buf = SA + m, bufsize = n - (2 * m);\n    for(c0 = ALPHABET_SIZE - 2, j = m; 0 < j; --c0) {\n      for(c1 = ALPHABET_SIZE - 1; c0 < c1; j = i, --c1) {\n        i = BUCKET_BSTAR(c0, c1);\n        if(1 < (j - i)) {\n          sssort(T, PAb, SA + i, SA + j,\n                 buf, bufsize, 2, n, *(SA + i) == (m - 1));\n        }\n      }\n    }\n\n    /* Compute ranks of type B* substrings. */\n    for(i = m - 1; 0 <= i; --i) {\n      if(0 <= SA[i]) {\n        j = i;\n        do { ISAb[SA[i]] = i; } while((0 <= --i) && (0 <= SA[i]));\n        SA[i + 1] = i - j;\n        if(i <= 0) { break; }\n      }\n      j = i;\n      do { ISAb[SA[i] = ~SA[i]] = j; } while(SA[--i] < 0);\n      ISAb[SA[i]] = j;\n    }\n\n    /* Construct the inverse suffix array of type B* suffixes using trsort. */\n    trsort(ISAb, SA, m, 1);\n\n    /* Set the sorted order of tyoe B* suffixes. */\n    for(i = n - 1, j = m, c0 = T[n - 1]; 0 <= i;) {\n      for(--i, c1 = c0; (0 <= i) && ((c0 = T[i]) >= c1); --i, c1 = c0) { }\n      if(0 <= i) {\n        t = i;\n        for(--i, c1 = c0; (0 <= i) && ((c0 = T[i]) <= c1); --i, c1 = c0) { }\n        SA[ISAb[--j]] = ((t == 0) || (1 < (t - i))) ? t : ~t;\n      }\n    }\n\n    /* Calculate the index of start/end point of each bucket. */\n    BUCKET_B(ALPHABET_SIZE - 1, ALPHABET_SIZE - 1) = n; /* end point */\n    for(c0 = ALPHABET_SIZE - 2, k = m - 1; 0 <= c0; --c0) {\n      i = BUCKET_A(c0 + 1) - 1;\n      for(c1 = ALPHABET_SIZE - 1; c0 < c1; --c1) {\n        t = i - BUCKET_B(c0, c1);\n        BUCKET_B(c0, c1) = i; /* end point */\n\n        /* Move all type B* suffixes to the correct position. */\n        for(i = t, j = BUCKET_BSTAR(c0, c1);\n            j <= k;\n            --i, --k) { SA[i] = SA[k]; }\n      }\n      BUCKET_BSTAR(c0, c0 + 1) = i - BUCKET_B(c0, c0) + 1; /* start point */\n      BUCKET_B(c0, c0) = i; /* end point */\n    }\n  }\n\n  return m;\n}\n\n/* Constructs the suffix array by using the sorted order of type B* suffixes. */\nstatic\nvoid\nconstruct_SA(const unsigned char *T, int *SA,\n             int *bucket_A, int *bucket_B,\n             int n, int m) {\n  int *i, *j, *k;\n  int s;\n  int c0, c1, c2;\n\n  if(0 < m) {\n    /* Construct the sorted order of type B suffixes by using\n       the sorted order of type B* suffixes. */\n    for(c1 = ALPHABET_SIZE - 2; 0 <= c1; --c1) {\n      /* Scan the suffix array from right to left. */\n      for(i = SA + BUCKET_BSTAR(c1, c1 + 1),\n          j = SA + BUCKET_A(c1 + 1) - 1, k = NULL, c2 = -1;\n          i <= j;\n          --j) {\n        if(0 < (s = *j)) {\n          DIVSUFSORT_ASSERT(T[s] == c1);\n          DIVSUFSORT_ASSERT(((s + 1) < n) && (T[s] <= T[s + 1]));\n          DIVSUFSORT_ASSERT(T[s - 1] <= T[s]);\n          *j = ~s;\n          c0 = T[--s];\n          if((0 < s) && (T[s - 1] > c0)) { s = ~s; }\n          if(c0 != c2) {\n            if(0 <= c2) { BUCKET_B(c2, c1) = k - SA; }\n            k = SA + BUCKET_B(c2 = c0, c1);\n          }\n          DIVSUFSORT_ASSERT(k < j);\n          *k-- = s;\n        } else {\n          DIVSUFSORT_ASSERT(((s == 0) && (T[s] == c1)) || (s < 0));\n          *j = ~s;\n        }\n      }\n    }\n  }\n\n  /* Construct the suffix array by using\n     the sorted order of type B suffixes. */\n  k = SA + BUCKET_A(c2 = T[n - 1]);\n  *k++ = (T[n - 2] < c2) ? ~(n - 1) : (n - 1);\n  /* Scan the suffix array from left to right. */\n  for(i = SA, j = SA + n; i < j; ++i) {\n    if(0 < (s = *i)) {\n      DIVSUFSORT_ASSERT(T[s - 1] >= T[s]);\n      c0 = T[--s];\n      if((s == 0) || (T[s - 1] < c0)) { s = ~s; }\n      if(c0 != c2) {\n        BUCKET_A(c2) = k - SA;\n        k = SA + BUCKET_A(c2 = c0);\n      }\n      DIVSUFSORT_ASSERT(i < k);\n      *k++ = s;\n    } else {\n      DIVSUFSORT_ASSERT(s < 0);\n      *i = ~s;\n    }\n  }\n}\n\n/*---------------------------------------------------------------------------*/\n\n/*- Function -*/\n\n/* XXX Modified from original: use provided temporary space instead of\n * allocating it.  */\nvoid\ndivsufsort(const u8 *T, u32 *SA, u32 n, u32 *tmp)\n{\n  u32 *bucket_A = tmp;\n  u32 *bucket_B = tmp + BUCKET_A_SIZE;\n  u32 m;\n\n  switch (n) {\n    case 0:\n      break;\n\n    case 1:\n      SA[0] = 0;\n      break;\n\n    case 2:\n      m = (T[0] < T[1]);\n      SA[m ^ 1] = 0;\n      SA[m] = 1;\n      break;\n\n    default:\n      m = sort_typeBstar(T, SA, bucket_A, bucket_B, n);\n      construct_SA(T, SA, bucket_A, bucket_B, n, m);\n      break;\n  }\n}\n"
  },
  {
    "path": "src/wimlib/encoding.c",
    "content": "/*\n * encoding.c - UTF-8 and UTF-16LE codecs and utility functions\n *\n * Copyright 2012-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n#include <string.h>\n\n#include \"wimlib/encoding.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/unaligned.h\"\n#include \"wimlib/util.h\"\n\n/*\n * Allow unpaired surrogates, such as might exist in Windows-style filenames ---\n * which are normally valid UTF-16LE, but are actually treated as opaque\n * sequences of 16-bit WCHARs by Windows.  When decoding \"UTF-16LE\", unpaired\n * surrogates will be decoded as their surrogate codepoints; and when encoding\n * to and from \"UTF-8\", the encoding will actually be WTF-8 (\"Wobbly\n * Transformation Format - 8-bit\"), a superset of UTF-8 which permits the\n * surrogate codepoints.\n *\n * In combination with also allowing the \"non-character\" codepoints U+FFFE and\n * U+FFFF, the result is that every Windows-style filename can be translated to\n * a UNIX-style filename.\n *\n * Unfortunately, the converse is not true: not every UNIX filename can be\n * translated to a Windows filename.  Only UNIX filenames that are valid \"WTF-8\"\n * can be translated.  I considered ways to define a bijective mapping, but\n * there did not seem to be a straightforward way.  The \"UTF-8b\" scheme, for\n * example, would map each invalid byte 'b' to a surrogate \"escape code\" 'U+DC00\n * + b'.  The problem with this was that surrogate escape codes can be combined\n * to create a valid UTF-8 sequence, thus breaking the bijection by mapping\n * multiple Windows filenames to a single UNIX filename.\n */\n#define ALLOW_UNPAIRED_SURROGATES\t1\n\n#define INVALID_CODEPOINT\t0xFFFFFFFF\n#define VALIDATE(expr)\t\tif (validate && unlikely(!(expr))) goto invalid\n#ifndef IS_SURROGATE\n#define IS_SURROGATE(c)\t\t((c) >= 0xD800 && (c) < 0xE000)\n#endif\n#ifndef IS_HIGH_SURROGATE\n#define IS_HIGH_SURROGATE(c)\t((c) >= 0xD800 && (c) < 0xDC00)\n#endif\n#ifndef IS_LOW_SURROGATE\n#define IS_LOW_SURROGATE(c)\t((c) >= 0xDC00 && (c) < 0xE000)\n#endif\n#define IS_UTF8_TAIL(c)\t\t(((c) & 0xC0) == 0x80)\n\n/*\n * Decode the next Unicode codepoint from the string at @in, which has\n * @remaining >= 1 bytes remaining.  Return the number of bytes consumed and\n * write the decoded codepoint to *c_ret.\n *\n * If the input might not be a valid string in the source encoding, then\n * @validate must be specified as %true, and then on invalid input the function\n * consumes at least one byte and sets *c_ret to INVALID_CODEPOINT.  If the\n * input is guaranteed to be valid, then @validate may be specified as %false.\n */\ntypedef unsigned (*decode_codepoint_fn)(const u8 *in, size_t remaining,\n\t\t\t\t\tbool validate, u32 *c_ret);\n\n/* Encode the Unicode codepoint @c and return the number of bytes used. */\ntypedef unsigned (*encode_codepoint_fn)(u32 c, u8 *out);\n\nstatic forceinline unsigned\nutf8_decode_codepoint(const u8 *in, size_t remaining, bool validate, u32 *c_ret)\n{\n\tif (likely(in[0] < 0x80)) { /* U+0...U+7F */\n\t\t*c_ret = in[0];\n\t\treturn 1;\n\t}\n\n\tif (in[0] < 0xE0) { /* U+80...U+7FF */\n\t\tVALIDATE(in[0] >= 0xC2 && remaining >= 2 &&\n\t\t\t IS_UTF8_TAIL(in[1]));\n\t\t*c_ret = ((u32)(in[0] & 0x1F) << 6) |\n\t\t\t ((u32)(in[1] & 0x3F) << 0);\n\t\treturn 2;\n\t}\n\n\tif (in[0] < 0xF0) { /* U+800...U+FFFF, possibly excluding surrogates */\n\t\tVALIDATE(remaining >= 3 &&\n\t\t\t IS_UTF8_TAIL(in[1]) &&\n\t\t\t IS_UTF8_TAIL(in[2]));\n\t\t*c_ret = ((u32)(in[0] & 0x0F) << 12) |\n\t\t\t ((u32)(in[1] & 0x3F) << 6) |\n\t\t\t ((u32)(in[2] & 0x3F) << 0);\n\t\tVALIDATE(*c_ret >= 0x800);\n\t#if !ALLOW_UNPAIRED_SURROGATES\n\t\tVALIDATE(!IS_SURROGATE(*c_ret));\n\t#endif\n\t\treturn 3;\n\t}\n\n\t/* U+10000...U+10FFFF */\n\tVALIDATE(in[0] < 0xF8 && remaining >= 4 &&\n\t\t IS_UTF8_TAIL(in[1]) &&\n\t\t IS_UTF8_TAIL(in[2]) &&\n\t\t IS_UTF8_TAIL(in[3]));\n\t*c_ret = ((u32)(in[0] & 0x07) << 18) |\n\t\t ((u32)(in[1] & 0x3F) << 12) |\n\t\t ((u32)(in[2] & 0x3F) << 6) |\n\t\t ((u32)(in[3] & 0x3F) << 0);\n\tVALIDATE(*c_ret >= 0x10000 && *c_ret <= 0x10FFFF);\n\treturn 4;\n\ninvalid:\n\t*c_ret = INVALID_CODEPOINT;\n\treturn 1;\n}\n\nstatic forceinline unsigned\nutf8_encode_codepoint(u32 c, u8 *out)\n{\n\tif (likely(c < 0x80)) {\n\t\tout[0] = c;\n\t\treturn 1;\n\t}\n\n\tif (c < 0x800) {\n\t\tout[0] = 0xC0 | (c >> 6);\n\t\tout[1] = 0x80 | (c & 0x3F);\n\t\treturn 2;\n\t}\n\n\tif (c < 0x10000) {\n\t\tout[0] = 0xE0 | (c >> 12);\n\t\tout[1] = 0x80 | ((c >> 6) & 0x3F);\n\t\tout[2] = 0x80 | (c & 0x3F);\n\t\treturn 3;\n\t}\n\n\tout[0] = 0xF0 | (c >> 18);\n\tout[1] = 0x80 | ((c >> 12) & 0x3F);\n\tout[2] = 0x80 | ((c >> 6) & 0x3F);\n\tout[3] = 0x80 | (c & 0x3F);\n\treturn 4;\n}\n\nstatic forceinline unsigned\nutf16le_decode_codepoint(const u8 *in, size_t remaining, bool validate,\n\t\t\t u32 *c_ret)\n{\n\tu32 h, l;\n\n\tVALIDATE(remaining >= 2);\n\th = get_unaligned_le16(in);\n\tif (unlikely(IS_SURROGATE(h))) {\n\t\t/* Surrogate pairs are U+10000...U+10FFFF.\n\t\t * Unpaired surrogates are U+D800...U+DFFF. */\n\t#if ALLOW_UNPAIRED_SURROGATES\n\t\tif (unlikely(!IS_HIGH_SURROGATE(h) || remaining < 4))\n\t\t\tgoto unpaired;\n\t\tl = get_unaligned_le16(in + 2);\n\t\tif (unlikely(!IS_LOW_SURROGATE(l)))\n\t\t\tgoto unpaired;\n\t#else\n\t\tVALIDATE(IS_HIGH_SURROGATE(h) && remaining >= 4);\n\t\tl = get_unaligned_le16(in + 2);\n\t\tVALIDATE(IS_LOW_SURROGATE(l));\n\t#endif\n\t\t*c_ret = 0x10000 + ((h - 0xD800) << 10) + (l - 0xDC00);\n\t\treturn 4;\n\t}\n#if ALLOW_UNPAIRED_SURROGATES\nunpaired:\n#endif\n\t*c_ret = h;\n\treturn 2;\n\ninvalid:\n\t*c_ret = INVALID_CODEPOINT;\n\treturn min(remaining, 2);\n}\n\nstatic forceinline unsigned\nutf16le_encode_codepoint(u32 c, u8 *out)\n{\n\tif (likely(c < 0x10000)) {\n\t\tput_unaligned_le16(c, out);\n\t\treturn 2;\n\t}\n\tc -= 0x10000;\n\tput_unaligned_le16(0xD800 + (c >> 10), out);\n\tput_unaligned_le16(0xDC00 + (c & 0x3FF), out + 2);\n\treturn 4;\n}\n\n/*\n * Convert the string @in of size @in_nbytes from the encoding given by the\n * @decode_codepoint function to the encoding given by the @encode_codepoint\n * function.  @in does not need to be null-terminated, but a null terminator\n * will be added to the output string.\n *\n * On success, write the allocated output string to @out_ret (must not be NULL)\n * and its size excluding the null terminator to @out_nbytes_ret (may be NULL).\n *\n * If the input string is malformed, return @ilseq_err with errno set to EILSEQ.\n * If out of memory, return WIMLIB_ERR_NOMEM with errno set to ENOMEM.\n */\nstatic forceinline int\nconvert_string(const u8 * const in, const size_t in_nbytes,\n\t       u8 **out_ret, size_t *out_nbytes_ret,\n\t       int ilseq_err,\n\t       decode_codepoint_fn decode_codepoint,\n\t       encode_codepoint_fn encode_codepoint)\n{\n\tsize_t i;\n\tu8 *p_out;\n\tsize_t out_nbytes = 0;\n\tu8 *out;\n\tu8 tmp[8]; /* assuming no codepoint requires > 8 bytes to encode */\n\tu32 c;\n\n\t/* Validate the input string and compute the output size. */\n\tfor (i = 0; i < in_nbytes; ) {\n\t\ti += (*decode_codepoint)(&in[i], in_nbytes - i, true, &c);\n\t\tif (unlikely(c == INVALID_CODEPOINT)) {\n\t\t\terrno = EILSEQ;\n\t\t\treturn ilseq_err;\n\t\t}\n\t\tout_nbytes += (*encode_codepoint)(c, tmp);\n\t}\n\n\t/* Allocate the output string, including space for a null terminator. */\n\tout = MALLOC(out_nbytes + (*encode_codepoint)(0, tmp));\n\tif (unlikely(!out))\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\t/* Do the conversion. */\n\tp_out = out;\n\tfor (i = 0; i < in_nbytes; ) {\n\t\ti += (*decode_codepoint)(&in[i], in_nbytes - i, false, &c);\n\t\tp_out += (*encode_codepoint)(c, p_out);\n\t}\n\n\t/* Add a null terminator. */\n\t(*encode_codepoint)(0, p_out);\n\n\t/* Return the output string and its size (by reference). */\n\t*out_ret = out;\n\tif (out_nbytes_ret)\n\t\t*out_nbytes_ret = out_nbytes;\n\treturn 0;\n}\n\nint\nutf8_to_utf16le(const char *in, size_t in_nbytes,\n\t\tutf16lechar **out_ret, size_t *out_nbytes_ret)\n{\n\treturn convert_string((const u8 *)in, in_nbytes,\n\t\t\t      (u8 **)out_ret, out_nbytes_ret,\n\t\t\t      WIMLIB_ERR_INVALID_UTF8_STRING,\n\t\t\t      utf8_decode_codepoint, utf16le_encode_codepoint);\n}\n\nint\nutf16le_to_utf8(const utf16lechar *in, size_t in_nbytes,\n\t\tchar **out_ret, size_t *out_nbytes_ret)\n{\n\treturn convert_string((const u8 *)in, in_nbytes,\n\t\t\t      (u8 **)out_ret, out_nbytes_ret,\n\t\t\t      WIMLIB_ERR_INVALID_UTF16_STRING,\n\t\t\t      utf16le_decode_codepoint, utf8_encode_codepoint);\n}\n\n/*\n * A table that maps from UCS-2 characters to their upper case equivalents.\n * Index and array values are both CPU endian.\n * Note: this is only an *approximation* of real UTF-16 case folding.\n */\nu16 upcase[65536];\n\nvoid\ninit_upcase(void)\n{\n\t/* This is the table used in NTFS volumes formatted by Windows 10.\n\t * It was compressed by tools/compress_upcase_table.c.  */\n\tstatic const u16 upcase_compressed[] = {\n\t\t0x0000, 0x0000, 0x0060, 0x0000, 0x0000, 0xffe0, 0x0019, 0x0061,\n\t\t0x0061, 0x0000, 0x001b, 0x005d, 0x0008, 0x0060, 0x0000, 0x0079,\n\t\t0x0000, 0x0000, 0x0000, 0xffff, 0x002f, 0x0100, 0x0002, 0x0000,\n\t\t0x0007, 0x012b, 0x0011, 0x0121, 0x002f, 0x0103, 0x0006, 0x0101,\n\t\t0x0000, 0x00c3, 0x0006, 0x0131, 0x0007, 0x012e, 0x0004, 0x0000,\n\t\t0x0003, 0x012f, 0x0000, 0x0061, 0x0004, 0x0130, 0x0000, 0x00a3,\n\t\t0x0003, 0x0000, 0x0000, 0x0082, 0x000b, 0x0131, 0x0006, 0x0189,\n\t\t0x0008, 0x012f, 0x0007, 0x012e, 0x0000, 0x0038, 0x0006, 0x0000,\n\t\t0x0000, 0xfffe, 0x0007, 0x01c4, 0x000f, 0x0101, 0x0000, 0xffb1,\n\t\t0x0015, 0x011e, 0x0004, 0x01cc, 0x002a, 0x0149, 0x0014, 0x0149,\n\t\t0x0007, 0x0000, 0x0009, 0x018c, 0x000b, 0x0138, 0x0000, 0x2a1f,\n\t\t0x0000, 0x2a1c, 0x0000, 0x0000, 0x0000, 0xff2e, 0x0000, 0xff32,\n\t\t0x0000, 0x0000, 0x0000, 0xff33, 0x0000, 0xff33, 0x0000, 0x0000,\n\t\t0x0000, 0xff36, 0x0000, 0x0000, 0x0000, 0xff35, 0x0004, 0x0000,\n\t\t0x0002, 0x0257, 0x0000, 0x0000, 0x0000, 0xff31, 0x0004, 0x0000,\n\t\t0x0000, 0xff2f, 0x0000, 0xff2d, 0x0000, 0x0000, 0x0000, 0x29f7,\n\t\t0x0003, 0x0000, 0x0002, 0x0269, 0x0000, 0x29fd, 0x0000, 0xff2b,\n\t\t0x0002, 0x0000, 0x0000, 0xff2a, 0x0007, 0x0000, 0x0000, 0x29e7,\n\t\t0x0002, 0x0000, 0x0000, 0xff26, 0x0005, 0x027e, 0x0003, 0x027e,\n\t\t0x0000, 0xffbb, 0x0000, 0xff27, 0x0000, 0xff27, 0x0000, 0xffb9,\n\t\t0x0005, 0x0000, 0x0000, 0xff25, 0x0065, 0x007b, 0x0079, 0x0293,\n\t\t0x0008, 0x012d, 0x0003, 0x019c, 0x0002, 0x037b, 0x002e, 0x0000,\n\t\t0x0000, 0xffda, 0x0000, 0xffdb, 0x0002, 0x03ad, 0x0012, 0x0060,\n\t\t0x000a, 0x0060, 0x0000, 0xffc0, 0x0000, 0xffc1, 0x0000, 0xffc1,\n\t\t0x0008, 0x0000, 0x0000, 0xfff8, 0x001a, 0x0118, 0x0000, 0x0007,\n\t\t0x0008, 0x018d, 0x0009, 0x0233, 0x0046, 0x0035, 0x0006, 0x0061,\n\t\t0x0000, 0xffb0, 0x000f, 0x0450, 0x0025, 0x010e, 0x000a, 0x036b,\n\t\t0x0032, 0x048b, 0x000e, 0x0100, 0x0000, 0xfff1, 0x0037, 0x048a,\n\t\t0x0026, 0x0465, 0x0034, 0x0000, 0x0000, 0xffd0, 0x0025, 0x0561,\n\t\t0x00de, 0x0293, 0x1714, 0x0587, 0x0000, 0x8a04, 0x0003, 0x0000,\n\t\t0x0000, 0x0ee6, 0x0087, 0x02ee, 0x0092, 0x1e01, 0x0069, 0x1df7,\n\t\t0x0000, 0x0008, 0x0007, 0x1f00, 0x0008, 0x0000, 0x000e, 0x1f02,\n\t\t0x0008, 0x1f0e, 0x0010, 0x1f06, 0x001a, 0x1f06, 0x0002, 0x1f0f,\n\t\t0x0007, 0x1f50, 0x0017, 0x1f19, 0x0000, 0x004a, 0x0000, 0x004a,\n\t\t0x0000, 0x0056, 0x0003, 0x1f72, 0x0000, 0x0064, 0x0000, 0x0064,\n\t\t0x0000, 0x0080, 0x0000, 0x0080, 0x0000, 0x0070, 0x0000, 0x0070,\n\t\t0x0000, 0x007e, 0x0000, 0x007e, 0x0028, 0x1f1e, 0x000c, 0x1f06,\n\t\t0x0000, 0x0000, 0x0000, 0x0009, 0x000f, 0x0000, 0x000d, 0x1fb3,\n\t\t0x000d, 0x1f44, 0x0008, 0x1fcd, 0x0006, 0x03f2, 0x0015, 0x1fbb,\n\t\t0x014e, 0x0587, 0x0000, 0xffe4, 0x0021, 0x0000, 0x0000, 0xfff0,\n\t\t0x000f, 0x2170, 0x000a, 0x0238, 0x0346, 0x0587, 0x0000, 0xffe6,\n\t\t0x0019, 0x24d0, 0x0746, 0x0587, 0x0026, 0x0561, 0x000b, 0x057e,\n\t\t0x0004, 0x012f, 0x0000, 0xd5d5, 0x0000, 0xd5d8, 0x000c, 0x022e,\n\t\t0x000e, 0x03f8, 0x006e, 0x1e33, 0x0011, 0x0000, 0x0000, 0xe3a0,\n\t\t0x0025, 0x2d00, 0x17f2, 0x0587, 0x6129, 0x2d26, 0x002e, 0x0201,\n\t\t0x002a, 0x1def, 0x0098, 0xa5b7, 0x0040, 0x1dff, 0x000e, 0x0368,\n\t\t0x000d, 0x022b, 0x034c, 0x2184, 0x5469, 0x2d26, 0x007f, 0x0061,\n\t\t0x0040, 0x0000,\n\t};\n\n\t/* Simple LZ decoder  */\n\tconst u16 *in_next = upcase_compressed;\n\tfor (u32 i = 0; i < ARRAY_LEN(upcase); ) {\n\t\tu16 length = *in_next++;\n\t\tu16 src_pos = *in_next++;\n\t\tif (length == 0) {\n\t\t\t/* Literal */\n\t\t\tupcase[i++] = src_pos;\n\t\t} else {\n\t\t\t/* Match */\n\t\t\tdo {\n\t\t\t\tupcase[i++] = upcase[src_pos++];\n\t\t\t} while (--length);\n\t\t}\n\t}\n\n\t/* Delta filter  */\n\tfor (u32 i = 0; i < ARRAY_LEN(upcase); i++)\n\t\tupcase[i] += i;\n}\n\n/*\n * Compare UTF-16LE strings case-sensitively (%ignore_case == false) or\n * case-insensitively (%ignore_case == true).\n *\n * This is implemented using the default upper-case table used by NTFS.  It does\n * not handle all possible cases allowed by UTF-16LE.  For example, different\n * normalizations of the same sequence of \"characters\" are not considered equal.\n * It hopefully does the right thing most of the time though.\n */\nint\ncmp_utf16le_strings(const utf16lechar *s1, size_t n1,\n\t\t    const utf16lechar *s2, size_t n2,\n\t\t    bool ignore_case)\n{\n\tsize_t n = min(n1, n2);\n\n\tif (ignore_case) {\n\t\tfor (size_t i = 0; i < n; i++) {\n\t\t\tu16 c1 = upcase[le16_to_cpu(s1[i])];\n\t\t\tu16 c2 = upcase[le16_to_cpu(s2[i])];\n\t\t\tif (c1 != c2)\n\t\t\t\treturn (c1 < c2) ? -1 : 1;\n\t\t}\n\t} else {\n\t\tfor (size_t i = 0; i < n; i++) {\n\t\t\tu16 c1 = le16_to_cpu(s1[i]);\n\t\t\tu16 c2 = le16_to_cpu(s2[i]);\n\t\t\tif (c1 != c2)\n\t\t\t\treturn (c1 < c2) ? -1 : 1;\n\t\t}\n\t}\n\tif (n1 == n2)\n\t\treturn 0;\n\treturn (n1 < n2) ? -1 : 1;\n}\n\n/* Like cmp_utf16le_strings(), but assumes the strings are null terminated.  */\nint\ncmp_utf16le_strings_z(const utf16lechar *s1, const utf16lechar *s2,\n\t\t      bool ignore_case)\n{\n\tif (ignore_case) {\n\t\tfor (;;) {\n\t\t\tu16 c1 = upcase[le16_to_cpu(*s1)];\n\t\t\tu16 c2 = upcase[le16_to_cpu(*s2)];\n\t\t\tif (c1 != c2)\n\t\t\t\treturn (c1 < c2) ? -1 : 1;\n\t\t\tif (c1 == 0)\n\t\t\t\treturn 0;\n\t\t\ts1++, s2++;\n\t\t}\n\t} else {\n\t\twhile (*s1 && *s1 == *s2)\n\t\t\ts1++, s2++;\n\t\tif (*s1 == *s2)\n\t\t\treturn 0;\n\t\treturn (le16_to_cpu(*s1) < le16_to_cpu(*s2)) ? -1 : 1;\n\t}\n}\n\n/* Duplicate a UTF-16 string.  The input string might not be null terminated and\n * might be misaligned, but the returned string is guaranteed to be null\n * terminated and properly aligned.  */\nutf16lechar *\nutf16le_dupz(const void *s, size_t size)\n{\n\tutf16lechar *dup = MALLOC(size + sizeof(utf16lechar));\n\tif (dup) {\n\t\tmemcpy(dup, s, size);\n\t\tdup[size / sizeof(utf16lechar)] = 0;\n\t}\n\treturn dup;\n}\n\n/* Duplicate a null-terminated UTF-16 string.  */\nutf16lechar *\nutf16le_dup(const utf16lechar *s)\n{\n\treturn memdup(s, utf16le_len_bytes(s) + sizeof(utf16lechar));\n}\n\n/* Return the length, in bytes, of a null terminated UTF-16 string, excluding\n * the null terminator.  */\nsize_t\nutf16le_len_bytes(const utf16lechar *s)\n{\n\tconst utf16lechar *p = s;\n\twhile (*p)\n\t\tp++;\n\treturn (p - s) * sizeof(utf16lechar);\n}\n\n/* Return the length, in UTF-16 coding units, of a null terminated UTF-16\n * string, excluding the null terminator.  */\nsize_t\nutf16le_len_chars(const utf16lechar *s)\n{\n\treturn utf16le_len_bytes(s) / sizeof(utf16lechar);\n}\n\n#ifdef ENABLE_TEST_SUPPORT\n\n#include \"wimlib/test_support.h\"\n\nWIMLIBAPI int\nwimlib_utf8_to_utf16le(const char *in, size_t in_nbytes,\n\t\t       utf16lechar **out_ret, size_t *out_nbytes_ret)\n{\n\treturn utf8_to_utf16le(in, in_nbytes, out_ret, out_nbytes_ret);\n}\n\nWIMLIBAPI int\nwimlib_utf16le_to_utf8(const utf16lechar *in, size_t in_nbytes,\n\t\t       char **out_ret, size_t *out_nbytes_ret)\n{\n\treturn utf16le_to_utf8(in, in_nbytes, out_ret, out_nbytes_ret);\n}\n#endif /* ENABLE_TEST_SUPPORT */\n"
  },
  {
    "path": "src/wimlib/error.c",
    "content": "/*\n * error.c - logging and error code translation\n */\n\n/*\n * Copyright (C) 2012, 2013, 2014 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n/* Make sure the POSIX-compatible strerror_r() is declared, rather than the GNU\n * version, which has a different return type. */\n#ifdef _GNU_SOURCE\n#  define GNU_SOURCE_WAS_DEFINED\n#  undef _GNU_SOURCE\n#  ifndef _POSIX_C_SOURCE\n#    define _POSIX_C_SOURCE 200112L\n#  endif\n#endif\n#include <string.h>\n#ifdef GNU_SOURCE_WAS_DEFINED\n#  define _GNU_SOURCE\n#endif\n\n#include <errno.h>\n#include <stdarg.h>\n\n#include \"wimlib.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/test_support.h\"\n#include \"wimlib/util.h\"\n#include \"wimlib/win32.h\"\n\nbool wimlib_print_errors = false;\nFILE *wimlib_error_file = NULL; /* Set in wimlib_global_init() */\nstatic bool wimlib_owns_error_file = false;\n\nstatic void\nwimlib_vmsg(const tchar *tag, const tchar *format, va_list va, bool perror)\n{\n\tif (!wimlib_print_errors)\n\t\treturn;\n\tint errno_save = errno;\n\tfflush(stdout);\n\ttfputs(tag, wimlib_error_file);\n\ttvfprintf(wimlib_error_file, format, va);\n\tif (perror && errno_save != 0) {\n\t\ttchar buf[64];\n\t\tint res;\n\t\tres = tstrerror_r(errno_save, buf, ARRAY_LEN(buf));\n\t\tif (res) {\n\t\t\ttsprintf(buf,\n\t\t\t\t T(\"unknown error (errno=%d)\"),\n\t\t\t\t errno_save);\n\t\t}\n\t#ifdef _WIN32\n\t\tif (errno_save == EBUSY)\n\t\t\ttstrcpy(buf, T(\"Resource busy\"));\n\t#endif\n\t\ttfprintf(wimlib_error_file, T(\": %\"TS), buf);\n\t}\n\ttputc(T('\\n'), wimlib_error_file);\n\tfflush(wimlib_error_file);\n\terrno = errno_save;\n}\n\nvoid\nwimlib_error(const tchar *format, ...)\n{\n\tva_list va;\n\n\tva_start(va, format);\n\twimlib_vmsg(T(\"\\r[ERROR] \"), format, va, false);\n\tva_end(va);\n}\n\nvoid\nwimlib_error_with_errno(const tchar *format, ...)\n{\n\tva_list va;\n\n\tva_start(va, format);\n\twimlib_vmsg(T(\"\\r[ERROR] \"), format, va, true);\n\tva_end(va);\n}\n\nvoid\nwimlib_warning(const tchar *format, ...)\n{\n\tva_list va;\n\n\tva_start(va, format);\n\twimlib_vmsg(T(\"\\r[WARNING] \"), format, va, false);\n\tva_end(va);\n}\n\nvoid\nwimlib_warning_with_errno(const tchar *format, ...)\n{\n\tva_list va;\n\n\tva_start(va, format);\n\twimlib_vmsg(T(\"\\r[WARNING] \"), format, va, true);\n\tva_end(va);\n}\n\nvoid\nprint_byte_field(const u8 *field, size_t len, FILE *out)\n{\n\twhile (len--)\n\t\ttfprintf(out, T(\"%02hhx\"), *field++);\n}\n\nWIMLIBAPI int\nwimlib_set_print_errors(bool show_error_messages)\n{\n\twimlib_print_errors = show_error_messages;\n\treturn 0;\n}\n\nWIMLIBAPI int\nwimlib_set_error_file(FILE *fp)\n{\n\tif (wimlib_owns_error_file)\n\t\tfclose(wimlib_error_file);\n\twimlib_error_file = fp;\n\twimlib_print_errors = (fp != NULL);\n\twimlib_owns_error_file = false;\n\treturn 0;\n}\n\nWIMLIBAPI int\nwimlib_set_error_file_by_name(const tchar *path)\n{\n\tFILE *fp;\n\n#ifdef _WIN32\n\tfp = win32_open_logfile(path);\n#else\n\tfp = fopen(path, \"a\");\n#endif\n\tif (!fp)\n\t\treturn WIMLIB_ERR_OPEN;\n\twimlib_set_error_file(fp);\n\twimlib_owns_error_file = true;\n\treturn 0;\n}\n\nstatic const tchar * const error_strings[] = {\n\t[WIMLIB_ERR_SUCCESS]\n\t\t= T(\"Success\"),\n\t[WIMLIB_ERR_ALREADY_LOCKED]\n\t\t= T(\"The WIM is already locked for writing\"),\n\t[WIMLIB_ERR_DECOMPRESSION]\n\t\t= T(\"The WIM contains invalid compressed data\"),\n\t[WIMLIB_ERR_FUSE]\n\t\t= T(\"An error was returned by fuse_main()\"),\n\t[WIMLIB_ERR_GLOB_HAD_NO_MATCHES]\n\t\t= T(\"The provided file glob did not match any files\"),\n\t[WIMLIB_ERR_IMAGE_COUNT]\n\t\t= T(\"Inconsistent image count among the metadata \"\n\t\t\t\"resources, the WIM header, and/or the XML data\"),\n\t[WIMLIB_ERR_IMAGE_NAME_COLLISION]\n\t\t= T(\"Tried to add an image with a name that is already in use\"),\n\t[WIMLIB_ERR_INSUFFICIENT_PRIVILEGES]\n\t\t= T(\"The user does not have sufficient privileges\"),\n\t[WIMLIB_ERR_INTEGRITY]\n\t\t= T(\"The WIM file is corrupted (failed integrity check)\"),\n\t[WIMLIB_ERR_INVALID_CAPTURE_CONFIG]\n\t\t= T(\"The contents of the capture configuration file were invalid\"),\n\t[WIMLIB_ERR_INVALID_CHUNK_SIZE]\n\t\t= T(\"The compression chunk size was unrecognized\"),\n\t[WIMLIB_ERR_INVALID_COMPRESSION_TYPE]\n\t\t= T(\"The compression type was unrecognized\"),\n\t[WIMLIB_ERR_INVALID_HEADER]\n\t\t= T(\"The WIM header was invalid\"),\n\t[WIMLIB_ERR_INVALID_IMAGE]\n\t\t= T(\"Tried to select an image that does not exist in the WIM\"),\n\t[WIMLIB_ERR_INVALID_INTEGRITY_TABLE]\n\t\t= T(\"The WIM's integrity table is invalid\"),\n\t[WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY]\n\t\t= T(\"An entry in the WIM's lookup table is invalid\"),\n\t[WIMLIB_ERR_INVALID_METADATA_RESOURCE]\n\t\t= T(\"The metadata resource is invalid\"),\n\t[WIMLIB_ERR_INVALID_OVERLAY]\n\t\t= T(\"Conflicting files in overlay when creating a WIM image\"),\n\t[WIMLIB_ERR_INVALID_PARAM]\n\t\t= T(\"An invalid parameter was given\"),\n\t[WIMLIB_ERR_INVALID_PART_NUMBER]\n\t\t= T(\"The part number or total parts of the WIM is invalid\"),\n\t[WIMLIB_ERR_INVALID_PIPABLE_WIM]\n\t\t= T(\"The pipable WIM is invalid\"),\n\t[WIMLIB_ERR_INVALID_REPARSE_DATA]\n\t\t= T(\"The reparse data of a reparse point was invalid\"),\n\t[WIMLIB_ERR_INVALID_RESOURCE_HASH]\n\t\t= T(\"The SHA-1 message digest of a WIM resource did not match the expected value\"),\n\t[WIMLIB_ERR_INVALID_UTF8_STRING]\n\t\t= T(\"A string was not a valid UTF-8 string\"),\n\t[WIMLIB_ERR_INVALID_UTF16_STRING]\n\t\t= T(\"A string was not a valid UTF-16 string\"),\n\t[WIMLIB_ERR_IS_DIRECTORY]\n\t\t= T(\"One of the specified paths to delete was a directory\"),\n\t[WIMLIB_ERR_IS_SPLIT_WIM]\n\t\t= T(\"The WIM is part of a split WIM, which is not supported for this operation\"),\n\t[WIMLIB_ERR_LINK]\n\t\t= T(\"Failed to create a hard or symbolic link when extracting \"\n\t\t\t\"a file from the WIM\"),\n\t[WIMLIB_ERR_METADATA_NOT_FOUND]\n\t\t= T(\"The WIM does not contain image metadata; it only contains file data\"),\n\t[WIMLIB_ERR_MKDIR]\n\t\t= T(\"Failed to create a directory\"),\n\t[WIMLIB_ERR_MQUEUE]\n\t\t= T(\"Failed to create or use a POSIX message queue\"),\n\t[WIMLIB_ERR_NOMEM]\n\t\t= T(\"Ran out of memory\"),\n\t[WIMLIB_ERR_NOTDIR]\n\t\t= T(\"Expected a directory\"),\n\t[WIMLIB_ERR_NOTEMPTY]\n\t\t= T(\"Directory was not empty\"),\n\t[WIMLIB_ERR_NOT_A_REGULAR_FILE]\n\t\t= T(\"One of the specified paths to extract did not \"\n\t\t    \"correspond to a regular file\"),\n\t[WIMLIB_ERR_NOT_A_WIM_FILE]\n\t\t= T(\"The file did not begin with the magic characters that \"\n\t\t\t\"identify a WIM file\"),\n\t[WIMLIB_ERR_NO_FILENAME]\n\t\t= T(\"The WIM is not identified with a filename\"),\n\t[WIMLIB_ERR_NOT_PIPABLE]\n\t\t= T(\"The WIM was not captured such that it can be \"\n\t\t    \"applied from a pipe\"),\n\t[WIMLIB_ERR_NTFS_3G]\n\t\t= T(\"NTFS-3G encountered an error (check errno)\"),\n\t[WIMLIB_ERR_OPEN]\n\t\t= T(\"Failed to open a file\"),\n\t[WIMLIB_ERR_OPENDIR]\n\t\t= T(\"Failed to open a directory\"),\n\t[WIMLIB_ERR_PATH_DOES_NOT_EXIST]\n\t\t= T(\"The path does not exist in the WIM image\"),\n\t[WIMLIB_ERR_READ]\n\t\t= T(\"Could not read data from a file\"),\n\t[WIMLIB_ERR_READLINK]\n\t\t= T(\"Could not read the target of a symbolic link\"),\n\t[WIMLIB_ERR_RENAME]\n\t\t= T(\"Could not rename a file\"),\n\t[WIMLIB_ERR_REPARSE_POINT_FIXUP_FAILED]\n\t\t= T(\"Unable to complete reparse point fixup\"),\n\t[WIMLIB_ERR_RESOURCE_NOT_FOUND]\n\t\t= T(\"A file resource needed to complete the operation was missing from the WIM\"),\n\t[WIMLIB_ERR_RESOURCE_ORDER]\n\t\t= T(\"The components of the WIM were arranged in an unexpected order\"),\n\t[WIMLIB_ERR_SET_ATTRIBUTES]\n\t\t= T(\"Failed to set attributes on extracted file\"),\n\t[WIMLIB_ERR_SET_REPARSE_DATA]\n\t\t= T(\"Failed to set reparse data on extracted file\"),\n\t[WIMLIB_ERR_SET_SECURITY]\n\t\t= T(\"Failed to set file owner, group, or other permissions on extracted file\"),\n\t[WIMLIB_ERR_SET_SHORT_NAME]\n\t\t= T(\"Failed to set short name on extracted file\"),\n\t[WIMLIB_ERR_SET_TIMESTAMPS]\n\t\t= T(\"Failed to set timestamps on extracted file\"),\n\t[WIMLIB_ERR_SPLIT_INVALID]\n\t\t= T(\"The WIM is part of an invalid split WIM\"),\n\t[WIMLIB_ERR_STAT]\n\t\t= T(\"Could not read the metadata for a file or directory\"),\n\t[WIMLIB_ERR_UNEXPECTED_END_OF_FILE]\n\t\t= T(\"Unexpectedly reached the end of the file\"),\n\t[WIMLIB_ERR_UNICODE_STRING_NOT_REPRESENTABLE]\n\t\t= T(\"A Unicode string could not be represented in the current locale's encoding\"),\n\t[WIMLIB_ERR_UNKNOWN_VERSION]\n\t\t= T(\"The WIM file is marked with an unknown version number\"),\n\t[WIMLIB_ERR_UNSUPPORTED]\n\t\t= T(\"The requested operation is unsupported\"),\n\t[WIMLIB_ERR_UNSUPPORTED_FILE]\n\t\t= T(\"A file in the directory tree to archive was not of a supported type\"),\n\t[WIMLIB_ERR_WIM_IS_READONLY]\n\t\t= T(\"The WIM is read-only (file permissions, header flag, or split WIM)\"),\n\t[WIMLIB_ERR_WRITE]\n\t\t= T(\"Failed to write data to a file\"),\n\t[WIMLIB_ERR_XML]\n\t\t= T(\"The XML data of the WIM is invalid\"),\n\t[WIMLIB_ERR_WIM_IS_ENCRYPTED]\n\t\t= T(\"The WIM file (or parts of it) is encrypted\"),\n\t[WIMLIB_ERR_WIMBOOT]\n\t\t= T(\"Failed to set WIMBoot pointer data\"),\n\t[WIMLIB_ERR_ABORTED_BY_PROGRESS]\n\t\t= T(\"The operation was aborted by the library user\"),\n\t[WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS]\n\t\t= T(\"The user-provided progress function returned an unrecognized value\"),\n\t[WIMLIB_ERR_MKNOD]\n\t\t= T(\"Unable to create a special file (e.g. device node or socket)\"),\n\t[WIMLIB_ERR_MOUNTED_IMAGE_IS_BUSY]\n\t\t= T(\"There are still files open on the mounted WIM image\"),\n\t[WIMLIB_ERR_NOT_A_MOUNTPOINT]\n\t\t= T(\"There is not a WIM image mounted on the directory\"),\n\t[WIMLIB_ERR_NOT_PERMITTED_TO_UNMOUNT]\n\t\t= T(\"The current user does not have permission to unmount the WIM image\"),\n\t[WIMLIB_ERR_FVE_LOCKED_VOLUME]\n\t\t= T(\"The volume must be unlocked before it can be used\"),\n\t[WIMLIB_ERR_UNABLE_TO_READ_CAPTURE_CONFIG]\n\t\t= T(\"The capture configuration file could not be read\"),\n\t[WIMLIB_ERR_WIM_IS_INCOMPLETE]\n\t\t= T(\"The WIM file is incomplete\"),\n\t[WIMLIB_ERR_COMPACTION_NOT_POSSIBLE]\n\t\t= T(\"The WIM file cannot be compacted because of its format, \"\n\t\t    \"its layout, or the write parameters specified by the user\"),\n\t[WIMLIB_ERR_IMAGE_HAS_MULTIPLE_REFERENCES]\n\t\t= T(\"The WIM image cannot be modified because it is currently \"\n\t\t    \"referenced from multiple places\"),\n\t[WIMLIB_ERR_DUPLICATE_EXPORTED_IMAGE]\n\t\t= T(\"The destination WIM already contains one of the source images\"),\n\t[WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED]\n\t\t= T(\"A file being added to a WIM image was concurrently modified\"),\n\t[WIMLIB_ERR_SNAPSHOT_FAILURE]\n\t\t= T(\"Unable to create a filesystem snapshot\"),\n\t[WIMLIB_ERR_INVALID_XATTR]\n\t\t= T(\"An extended attribute entry in the WIM image is invalid\"),\n\t[WIMLIB_ERR_SET_XATTR]\n\t\t= T(\"Failed to set an extended attribute on an extracted file\"),\n#ifdef ENABLE_TEST_SUPPORT\n\t[WIMLIB_ERR_IMAGES_ARE_DIFFERENT]\n\t\t= T(\"A difference was detected between the two images being compared\"),\n#endif\n};\n\nWIMLIBAPI const tchar *\nwimlib_get_error_string(enum wimlib_error_code _code)\n{\n\tunsigned int code = (unsigned int)_code;\n\n\tif (code >= ARRAY_LEN(error_strings) || error_strings[code] == NULL)\n\t\treturn T(\"Unknown error\");\n\n\treturn error_strings[code];\n}\n"
  },
  {
    "path": "src/wimlib/export_image.c",
    "content": "/*\n * export_image.c\n */\n\n/*\n * Copyright (C) 2012-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/inode.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/xml.h\"\n\nstatic int\nblob_set_not_exported(struct blob_descriptor *blob, void *_ignore)\n{\n\tblob->out_refcnt = 0;\n\tblob->was_exported = 0;\n\treturn 0;\n}\n\nstatic int\nblob_rollback_export(struct blob_descriptor *blob, void *_blob_table)\n{\n\tstruct blob_table *blob_table = _blob_table;\n\n\tblob->refcnt -= blob->out_refcnt;\n\tif (blob->was_exported) {\n\t\tblob_table_unlink(blob_table, blob);\n\t\tfree_blob_descriptor(blob);\n\t}\n\treturn 0;\n}\n\nstatic int\ninode_export_blobs(struct wim_inode *inode, struct blob_table *src_blob_table,\n\t\t   struct blob_table *dest_blob_table, bool gift)\n{\n\tunsigned i;\n\tconst u8 *hash;\n\tstruct blob_descriptor *src_blob, *dest_blob;\n\n\tfor (i = 0; i < inode->i_num_streams; i++) {\n\n\t\t/* Retrieve SHA-1 message digest of blob to export.  */\n\t\thash = stream_hash(&inode->i_streams[i]);\n\t\tif (is_zero_hash(hash))  /* Empty stream?  */\n\t\t\tcontinue;\n\n\t\t/* Search for the blob (via SHA-1 message digest) in the\n\t\t * destination WIM.  */\n\t\tdest_blob = lookup_blob(dest_blob_table, hash);\n\t\tif (!dest_blob) {\n\t\t\t/* Blob not yet present in destination WIM.  Search for\n\t\t\t * it in the source WIM, then export it into the\n\t\t\t * destination WIM.  */\n\t\t\tsrc_blob = stream_blob(&inode->i_streams[i],\n\t\t\t\t\t       src_blob_table);\n\t\t\tif (!src_blob)\n\t\t\t\treturn blob_not_found_error(inode, hash);\n\n\t\t\tif (gift) {\n\t\t\t\tdest_blob = src_blob;\n\t\t\t\tblob_table_unlink(src_blob_table, src_blob);\n\t\t\t} else {\n\t\t\t\tdest_blob = clone_blob_descriptor(src_blob);\n\t\t\t\tif (!dest_blob)\n\t\t\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\t\t}\n\t\t\tdest_blob->refcnt = 0;\n\t\t\tdest_blob->out_refcnt = 0;\n\t\t\tdest_blob->was_exported = 1;\n\t\t\tblob_table_insert(dest_blob_table, dest_blob);\n\t\t}\n\n\t\t/* Blob is present in destination WIM (either pre-existing,\n\t\t * already exported, or just exported above).  Increment its\n\t\t * reference count appropriately.   Note: we use 'refcnt' for\n\t\t * the raw reference count, but 'out_refcnt' for references\n\t\t * arising just from the export operation; this is used to roll\n\t\t * back a failed export if needed.  */\n\t\tdest_blob->refcnt += inode->i_nlink;\n\t\tdest_blob->out_refcnt += inode->i_nlink;\n\t}\n\treturn 0;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_export_image(WIMStruct *src_wim,\n\t\t    int src_image,\n\t\t    WIMStruct *dest_wim,\n\t\t    const tchar *dest_name,\n\t\t    const tchar *dest_description,\n\t\t    int export_flags)\n{\n\tint ret;\n\tint start_src_image;\n\tint end_src_image;\n\tint orig_dest_image_count;\n\tint image;\n\tbool all_images = (src_image == WIMLIB_ALL_IMAGES);\n\n\t/* Check for sane parameters.  */\n\tif (export_flags & ~(WIMLIB_EXPORT_FLAG_BOOT |\n\t\t\t     WIMLIB_EXPORT_FLAG_NO_NAMES |\n\t\t\t     WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS |\n\t\t\t     WIMLIB_EXPORT_FLAG_GIFT |\n\t\t\t     WIMLIB_EXPORT_FLAG_WIMBOOT))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (!src_wim || !dest_wim)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (!wim_has_metadata(src_wim) || !wim_has_metadata(dest_wim))\n\t\treturn WIMLIB_ERR_METADATA_NOT_FOUND;\n\n\tif (all_images) {\n\t\t/* Multi-image export.  */\n\t\tif ((!(export_flags & WIMLIB_EXPORT_FLAG_NO_NAMES) &&\n\t\t\tdest_name) ||\n\t\t    (!(export_flags & WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS) &&\n\t\t\tdest_description))\n\t\t{\n\t\t\tERROR(\"Image name and description must be \"\n\t\t\t      \"left NULL for multi-image export\");\n\t\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t\t}\n\t\tstart_src_image = 1;\n\t\tend_src_image = src_wim->hdr.image_count;\n\t} else {\n\t\tstart_src_image = src_image;\n\t\tend_src_image = src_image;\n\t}\n\torig_dest_image_count = dest_wim->hdr.image_count;\n\n\t/* We don't yet support having a single WIMStruct contain duplicate\n\t * 'image_metadata' structures, so we must forbid this from happening.\n\t * A duplication is possible if 'src_wim == dest_wim', if the same image\n\t * is exported to the same destination WIMStruct multiple times, or if\n\t * an image is exported in an A => B => A manner.  */\n\tfor (src_image = start_src_image;\n\t     src_image <= end_src_image; src_image++)\n\t{\n\t\tconst struct wim_image_metadata *src_imd =\n\t\t\t\tsrc_wim->image_metadata[src_image - 1];\n\t\tfor (int i = 0; i < dest_wim->hdr.image_count; i++)\n\t\t\tif (dest_wim->image_metadata[i] == src_imd)\n\t\t\t\treturn WIMLIB_ERR_DUPLICATE_EXPORTED_IMAGE;\n\t}\n\n\t/* Blob checksums must be known before proceeding.  */\n\tret = wim_checksum_unhashed_blobs(src_wim);\n\tif (ret)\n\t\treturn ret;\n\tret = wim_checksum_unhashed_blobs(dest_wim);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Enable rollbacks  */\n\tfor_blob_in_table(dest_wim->blob_table, blob_set_not_exported, NULL);\n\n\t/* Forbid exports where the destination WIM already contains image(s)\n\t * with the requested name(s).  However, allow multi-image exports where\n\t * there is a duplication among the source names only.  */\n\tif (!(export_flags & WIMLIB_EXPORT_FLAG_NO_NAMES)) {\n\t\tfor (src_image = start_src_image;\n\t\t     src_image <= end_src_image;\n\t\t     src_image++)\n\t\t{\n\t\t\tconst tchar *name = dest_name ? dest_name :\n\t\t\t\twimlib_get_image_name(src_wim, src_image);\n\n\t\t\tif (wimlib_image_name_in_use(dest_wim, name)) {\n\t\t\t\tERROR(\"There is already an image named \\\"%\"TS\"\\\" \"\n\t\t\t\t      \"in the destination WIM\", name);\n\t\t\t\tret = WIMLIB_ERR_IMAGE_NAME_COLLISION;\n\t\t\t\tgoto out_rollback;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Export each requested image.  */\n\tfor (src_image = start_src_image;\n\t     src_image <= end_src_image;\n\t     src_image++)\n\t{\n\t\tconst tchar *next_dest_name, *next_dest_description;\n\t\tstruct wim_image_metadata *src_imd;\n\t\tstruct wim_inode *inode;\n\n\t\t/* Determine destination image name and description.  */\n\n\t\tif (export_flags & WIMLIB_EXPORT_FLAG_NO_NAMES)\n\t\t\tnext_dest_name = NULL;\n\t\telse if (dest_name)\n\t\t\tnext_dest_name = dest_name;\n\t\telse\n\t\t\tnext_dest_name = wimlib_get_image_name(src_wim, src_image);\n\n\t\tif (export_flags & WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS)\n\t\t\tnext_dest_description = NULL;\n\t\telse if (dest_description)\n\t\t\tnext_dest_description = dest_description;\n\t\telse\n\t\t\tnext_dest_description = wimlib_get_image_description(src_wim, src_image);\n\n\t\t/* Load metadata for source image into memory.  */\n\t\tret = select_wim_image(src_wim, src_image);\n\t\tif (ret)\n\t\t\tgoto out_rollback;\n\n\t\tsrc_imd = wim_get_current_image_metadata(src_wim);\n\n\t\t/* Iterate through inodes in the source image and export their\n\t\t * blobs into the destination WIM.  */\n\t\timage_for_each_inode(inode, src_imd) {\n\t\t\tret = inode_export_blobs(inode,\n\t\t\t\t\t\t src_wim->blob_table,\n\t\t\t\t\t\t dest_wim->blob_table,\n\t\t\t\t\t\t export_flags & WIMLIB_EXPORT_FLAG_GIFT);\n\t\t\tif (ret)\n\t\t\t\tgoto out_rollback;\n\t\t}\n\n\t\t/* Export XML information into the destination WIM.  */\n\t\tret = xml_export_image(src_wim->xml_info, src_image,\n\t\t\t\t       dest_wim->xml_info, next_dest_name,\n\t\t\t\t       next_dest_description,\n\t\t\t\t       export_flags & WIMLIB_EXPORT_FLAG_WIMBOOT);\n\t\tif (ret)\n\t\t\tgoto out_rollback;\n\n\t\t/* Reference the source image metadata from the destination WIM.\n\t\t */\n\t\tret = append_image_metadata(dest_wim, src_imd);\n\t\tif (ret)\n\t\t\tgoto out_rollback;\n\t\tsrc_imd->refcnt++;\n\t}\n\n\t/* Image export complete.  Finish by setting any needed special metadata\n\t * on the destination WIM.  */\n\n\tif (src_wim->hdr.flags & WIM_HDR_FLAG_RP_FIX)\n\t\tdest_wim->hdr.flags |= WIM_HDR_FLAG_RP_FIX;\n\n\tfor (src_image = start_src_image;\n\t     src_image <= end_src_image;\n\t     src_image++)\n\t{\n\t\tint dst_image = orig_dest_image_count + 1 +\n\t\t\t\t(src_image - start_src_image);\n\n\t\tif ((export_flags & WIMLIB_EXPORT_FLAG_BOOT) &&\n\t\t    (!all_images || src_image == src_wim->hdr.boot_idx))\n\t\t\tdest_wim->hdr.boot_idx = dst_image;\n\t}\n\n\treturn 0;\n\nout_rollback:\n\twhile ((image = xml_get_image_count(dest_wim->xml_info))\n\t       > orig_dest_image_count)\n\t{\n\t\txml_delete_image(dest_wim->xml_info, image);\n\t}\n\twhile (dest_wim->hdr.image_count > orig_dest_image_count)\n\t{\n\t\tput_image_metadata(dest_wim->image_metadata[\n\t\t\t\t\t--dest_wim->hdr.image_count]);\n\t}\n\tfor_blob_in_table(dest_wim->blob_table, blob_rollback_export,\n\t\t\t  dest_wim->blob_table);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/wimlib/extract.c",
    "content": "/*\n * extract.c\n *\n * Support for extracting WIM images, or files or directories contained in a WIM\n * image.\n */\n\n/*\n * Copyright (C) 2012-2018 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n/*\n * This file provides the API functions wimlib_extract_image(),\n * wimlib_extract_image_from_pipe(), wimlib_extract_paths(), and\n * wimlib_extract_pathlist().  Internally, all end up calling\n * do_wimlib_extract_paths() and extract_trees().\n *\n * Although wimlib supports multiple extraction modes/backends (NTFS-3G, UNIX,\n * Win32), this file does not itself have code to extract files or directories\n * to any specific target; instead, it handles generic functionality and relies\n * on lower-level callback functions declared in `struct apply_operations' to do\n * the actual extraction.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n#include <fcntl.h>\n#include <stdlib.h>\n#include <sys/stat.h>\n#include <unistd.h>\n\n#include \"wimlib/apply.h\"\n#include \"wimlib/assert.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/object_id.h\"\n#include \"wimlib/pathlist.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/pattern.h\"\n#include \"wimlib/reparse.h\"\n#include \"wimlib/resource.h\"\n#include \"wimlib/security.h\"\n#include \"wimlib/unix_data.h\"\n#include \"wimlib/wim.h\"\n#include \"wimlib/win32.h\" /* for realpath() equivalent */\n#include \"wimlib/xattr.h\"\n#include \"wimlib/xml.h\"\n\n#define WIMLIB_EXTRACT_FLAG_FROM_PIPE   0x80000000\n#define WIMLIB_EXTRACT_FLAG_IMAGEMODE   0x40000000\n\n/* Keep in sync with wimlib.h  */\n#define WIMLIB_EXTRACT_MASK_PUBLIC\t\t\t\t\\\n\t(WIMLIB_EXTRACT_FLAG_NTFS\t\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_RECOVER_DATA\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_UNIX_DATA\t\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_NO_ACLS\t\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_STRICT_ACLS\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_RPFIX\t\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_NORPFIX\t\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_TO_STDOUT\t\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_GLOB_PATHS\t\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_STRICT_GLOB\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE  |\t\\\n\t WIMLIB_EXTRACT_FLAG_WIMBOOT\t\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K\t\t|\t\\\n\t WIMLIB_EXTRACT_FLAG_COMPACT_LZX\t\t\t\\\n\t )\n\n/* Send WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE or\n * WIMLIB_PROGRESS_MSG_EXTRACT_METADATA.  */\nint\ndo_file_extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg)\n{\n\tctx->count_until_file_progress = 500;  /* Arbitrary value to limit calls  */\n\treturn extract_progress(ctx, msg);\n}\n\nstatic int\nstart_file_phase(struct apply_ctx *ctx, u64 end_file_count, enum wimlib_progress_msg msg)\n{\n\tctx->progress.extract.current_file_count = 0;\n\tctx->progress.extract.end_file_count = end_file_count;\n\treturn do_file_extract_progress(ctx, msg);\n}\n\nint\nstart_file_structure_phase(struct apply_ctx *ctx, u64 end_file_count)\n{\n\treturn start_file_phase(ctx, end_file_count, WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE);\n}\n\nint\nstart_file_metadata_phase(struct apply_ctx *ctx, u64 end_file_count)\n{\n\treturn start_file_phase(ctx, end_file_count, WIMLIB_PROGRESS_MSG_EXTRACT_METADATA);\n}\n\nstatic int\nend_file_phase(struct apply_ctx *ctx, enum wimlib_progress_msg msg)\n{\n\tctx->progress.extract.current_file_count = ctx->progress.extract.end_file_count;\n\treturn do_file_extract_progress(ctx, msg);\n}\n\nint\nend_file_structure_phase(struct apply_ctx *ctx)\n{\n\treturn end_file_phase(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE);\n}\n\nint\nend_file_metadata_phase(struct apply_ctx *ctx)\n{\n\treturn end_file_phase(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_METADATA);\n}\n\n/* Are all bytes in the specified buffer zero? */\nstatic bool\nis_all_zeroes(const u8 *buf, const size_t size)\n{\n\tuintptr_t p = (uintptr_t)buf;\n\tconst uintptr_t end = p + size;\n\n\tfor (; p % WORDBYTES && p != end; p++)\n\t\tif (*((const u8 *)p))\n\t\t\treturn false;\n\n\tfor (; end - p >= WORDBYTES; p += WORDBYTES)\n\t\tif (*(const machine_word_t *)p)\n\t\t\treturn false;\n\n\tfor (; p != end; p++)\n\t\tif (*((const u8*)p))\n\t\t\treturn false;\n\n\treturn true;\n}\n\n/*\n * Sparse regions should be detected at the granularity of the filesystem block\n * size.  For now just assume 4096 bytes, which is the default block size on\n * NTFS and most Linux filesystems.\n */\n#define SPARSE_UNIT 4096\n\n/*\n * Detect whether the specified buffer begins with a region of all zero bytes.\n * Return %true if a zero region was found or %false if a nonzero region was\n * found, and sets *len_ret to the length of the region.  This operates at a\n * granularity of SPARSE_UNIT bytes, meaning that to extend a zero region, there\n * must be SPARSE_UNIT zero bytes with no interruption, but to extend a nonzero\n * region, just one nonzero byte in the next SPARSE_UNIT bytes is sufficient.\n *\n * Note: besides compression, the WIM format doesn't yet have a way to\n * efficiently represent zero regions, so that's why we need to detect them\n * ourselves.  Things will still fall apart badly on extremely large sparse\n * files, but this is a start...\n */\nbool\ndetect_sparse_region(const void *data, size_t size, size_t *len_ret)\n{\n\tuintptr_t p = (uintptr_t)data;\n\tconst uintptr_t end = p + size;\n\tsize_t len = 0;\n\tbool zeroes = false;\n\n\twhile (p != end) {\n\t\tsize_t n = min(end - p, SPARSE_UNIT);\n\t\tbool z = is_all_zeroes((const u8 *)p, n);\n\n\t\tif (len != 0 && z != zeroes)\n\t\t\tbreak;\n\t\tzeroes = z;\n\t\tlen += n;\n\t\tp += n;\n\t}\n\n\t*len_ret = len;\n\treturn zeroes;\n}\n\n#define PWM_FOUND_WIM_HDR (-1)\n\n/* Read the header for a blob in a pipable WIM.  If @pwm_hdr_ret is not NULL,\n * also look for a pipable WIM header and return PWM_FOUND_WIM_HDR if found.  */\nstatic int\nread_pwm_blob_header(WIMStruct *pwm, u8 hash_ret[SHA1_HASH_SIZE],\n\t\t     struct wim_reshdr *reshdr_ret,\n\t\t     struct wim_header_disk *pwm_hdr_ret)\n{\n\tint ret;\n\tstruct pwm_blob_hdr blob_hdr;\n\tu64 magic;\n\n\tret = full_read(&pwm->in_fd, &blob_hdr, sizeof(blob_hdr));\n\tif (unlikely(ret))\n\t\tgoto read_error;\n\n\tmagic = le64_to_cpu(blob_hdr.magic);\n\n\tif (magic == PWM_MAGIC && pwm_hdr_ret != NULL) {\n\t\tmemcpy(pwm_hdr_ret, &blob_hdr, sizeof(blob_hdr));\n\t\tret = full_read(&pwm->in_fd,\n\t\t\t\t(u8 *)pwm_hdr_ret + sizeof(blob_hdr),\n\t\t\t\tsizeof(*pwm_hdr_ret) - sizeof(blob_hdr));\n\t\tif (unlikely(ret))\n\t\t\tgoto read_error;\n\t\treturn PWM_FOUND_WIM_HDR;\n\t}\n\n\tif (unlikely(magic != PWM_BLOB_MAGIC)) {\n\t\tERROR(\"Data read on pipe is invalid (expected blob header)\");\n\t\treturn WIMLIB_ERR_INVALID_PIPABLE_WIM;\n\t}\n\n\tcopy_hash(hash_ret, blob_hdr.hash);\n\n\treshdr_ret->size_in_wim = 0; /* Not available  */\n\treshdr_ret->flags = le32_to_cpu(blob_hdr.flags);\n\treshdr_ret->offset_in_wim = pwm->in_fd.offset;\n\treshdr_ret->uncompressed_size = le64_to_cpu(blob_hdr.uncompressed_size);\n\n\tif (unlikely(reshdr_ret->uncompressed_size == 0)) {\n\t\tERROR(\"Data read on pipe is invalid (resource is of 0 size)\");\n\t\treturn WIMLIB_ERR_INVALID_PIPABLE_WIM;\n\t}\n\n\treturn 0;\n\nread_error:\n\tif (ret == WIMLIB_ERR_UNEXPECTED_END_OF_FILE)\n\t\tERROR(\"The pipe ended before all needed data was sent!\");\n\telse\n\t\tERROR_WITH_ERRNO(\"Error reading pipable WIM from pipe\");\n\treturn ret;\n}\n\nstatic int\nread_blobs_from_pipe(struct apply_ctx *ctx, const struct read_blob_callbacks *cbs)\n{\n\tint ret;\n\tu8 hash[SHA1_HASH_SIZE];\n\tstruct wim_reshdr reshdr;\n\tstruct wim_header_disk pwm_hdr;\n\tstruct wim_resource_descriptor rdesc;\n\tstruct blob_descriptor *blob;\n\n\tcopy_guid(ctx->progress.extract.guid, ctx->wim->hdr.guid);\n\tctx->progress.extract.part_number = ctx->wim->hdr.part_number;\n\tctx->progress.extract.total_parts = ctx->wim->hdr.total_parts;\n\tret = extract_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN);\n\tif (ret)\n\t\treturn ret;\n\n\twhile (ctx->num_blobs_remaining) {\n\n\t\tret = read_pwm_blob_header(ctx->wim, hash, &reshdr, &pwm_hdr);\n\n\t\tif (ret == PWM_FOUND_WIM_HDR) {\n\t\t\tu16 part_number = le16_to_cpu(pwm_hdr.part_number);\n\t\t\tu16 total_parts = le16_to_cpu(pwm_hdr.total_parts);\n\n\t\t\tif (part_number == ctx->progress.extract.part_number &&\n\t\t\t    total_parts == ctx->progress.extract.total_parts &&\n\t\t\t    guids_equal(pwm_hdr.guid, ctx->progress.extract.guid))\n\t\t\t\tcontinue;\n\n\t\t\tcopy_guid(ctx->progress.extract.guid, pwm_hdr.guid);\n\t\t\tctx->progress.extract.part_number = part_number;\n\t\t\tctx->progress.extract.total_parts = total_parts;\n\t\t\tret = extract_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tif (!(reshdr.flags & WIM_RESHDR_FLAG_METADATA)\n\t\t    && (blob = lookup_blob(ctx->wim->blob_table, hash))\n\t\t    && (blob->out_refcnt))\n\t\t{\n\t\t\twim_reshdr_to_desc_and_blob(&reshdr, ctx->wim, &rdesc, blob);\n\t\t\tret = read_blob_with_sha1(blob, cbs,\n\t\t\t\t\t\t  ctx->extract_flags &\n\t\t\t\t\t\t  WIMLIB_EXTRACT_FLAG_RECOVER_DATA);\n\t\t\tblob_unset_is_located_in_wim_resource(blob);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\tctx->num_blobs_remaining--;\n\t\t} else {\n\t\t\twim_reshdr_to_desc(&reshdr, ctx->wim, &rdesc);\n\t\t\tret = skip_wim_resource(&rdesc);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t}\n\t}\n\n\treturn 0;\n}\n\nstatic int\nhandle_pwm_metadata_resource(WIMStruct *pwm, int image, bool is_needed)\n{\n\tstruct blob_descriptor *blob;\n\tstruct wim_reshdr reshdr;\n\tstruct wim_resource_descriptor *rdesc;\n\tint ret;\n\n\tret = WIMLIB_ERR_NOMEM;\n\tblob = new_blob_descriptor();\n\tif (!blob)\n\t\tgoto out;\n\n\tret = read_pwm_blob_header(pwm, blob->hash, &reshdr, NULL);\n\tif (ret)\n\t\tgoto out;\n\n\tret = WIMLIB_ERR_INVALID_PIPABLE_WIM;\n\tif (!(reshdr.flags & WIM_RESHDR_FLAG_METADATA)) {\n\t\tERROR(\"Expected metadata resource, but found non-metadata \"\n\t\t      \"resource\");\n\t\tgoto out;\n\t}\n\n\tret = WIMLIB_ERR_NOMEM;\n\trdesc = MALLOC(sizeof(*rdesc));\n\tif (!rdesc)\n\t\tgoto out;\n\n\twim_reshdr_to_desc_and_blob(&reshdr, pwm, rdesc, blob);\n\tpwm->refcnt++;\n\n\tret = WIMLIB_ERR_NOMEM;\n\tpwm->image_metadata[image - 1] = new_unloaded_image_metadata(blob);\n\tif (!pwm->image_metadata[image - 1])\n\t\tgoto out;\n\tblob = NULL;\n\n\t/* If the metadata resource is for the image being extracted, then parse\n\t * it and save the metadata in memory.  Otherwise, skip over it.  */\n\tif (is_needed)\n\t\tret = select_wim_image(pwm, image);\n\telse\n\t\tret = skip_wim_resource(rdesc);\nout:\n\tfree_blob_descriptor(blob);\n\treturn ret;\n}\n\n/* Creates a temporary file opened for writing.  The open file descriptor is\n * returned in @fd_ret and its name is returned in @name_ret (dynamically\n * allocated).  */\nstatic int\ncreate_temporary_file(struct filedes *fd_ret, tchar **name_ret)\n{\n\ttchar *name;\n\tint raw_fd;\n\n#ifdef _WIN32\nretry:\n\t// coverity[secure_temp]\n\tname = _wtempnam(NULL, L\"wimlib\");\n\tif (!name) {\n\t\tERROR_WITH_ERRNO(\"Failed to create temporary filename\");\n\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\traw_fd = _wopen(name, O_WRONLY | O_CREAT | O_EXCL | O_BINARY |\n\t\t\t_O_SHORT_LIVED, 0600);\n\tif (raw_fd < 0 && errno == EEXIST) {\n\t\tFREE(name);\n\t\tgoto retry;\n\t}\n#else /* _WIN32 */\n\tconst char *tmpdir = getenv(\"TMPDIR\");\n\tif (!tmpdir)\n\t\ttmpdir = P_tmpdir;\n\tname = MALLOC(strlen(tmpdir) + 1 + 6 + 6 + 1);\n\tif (!name)\n\t\treturn WIMLIB_ERR_NOMEM;\n\tsprintf(name, \"%s/wimlibXXXXXX\", tmpdir);\n\traw_fd = mkstemp(name);\n#endif /* !_WIN32 */\n\n\tif (raw_fd < 0) {\n\t\tERROR_WITH_ERRNO(\"Failed to create temporary file \"\n\t\t\t\t \"\\\"%\"TS\"\\\"\", name);\n\t\tFREE(name);\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\n\tfiledes_init(fd_ret, raw_fd);\n\t*name_ret = name;\n\treturn 0;\n}\n\nstatic int\nbegin_extract_blob(struct blob_descriptor *blob, void *_ctx)\n{\n\tstruct apply_ctx *ctx = _ctx;\n\n\tif (unlikely(blob->out_refcnt > MAX_OPEN_FILES))\n\t\treturn create_temporary_file(&ctx->tmpfile_fd, &ctx->tmpfile_name);\n\n\treturn call_begin_blob(blob, ctx->saved_cbs);\n}\n\nstatic int\nextract_chunk(const struct blob_descriptor *blob, u64 offset,\n\t      const void *chunk, size_t size, void *_ctx)\n{\n\tstruct apply_ctx *ctx = _ctx;\n\tunion wimlib_progress_info *progress = &ctx->progress;\n\tbool last = (offset + size == blob->size);\n\tint ret;\n\n\tif (likely(ctx->supported_features.hard_links)) {\n\t\tprogress->extract.completed_bytes +=\n\t\t\t(u64)size * blob->out_refcnt;\n\t\tif (last)\n\t\t\tprogress->extract.completed_streams += blob->out_refcnt;\n\t} else {\n\t\tconst struct blob_extraction_target *targets =\n\t\t\tblob_extraction_targets(blob);\n\t\tfor (u32 i = 0; i < blob->out_refcnt; i++) {\n\t\t\tconst struct wim_inode *inode = targets[i].inode;\n\t\t\tconst struct wim_dentry *dentry;\n\n\t\t\tinode_for_each_extraction_alias(dentry, inode) {\n\t\t\t\tprogress->extract.completed_bytes += size;\n\t\t\t\tif (last)\n\t\t\t\t\tprogress->extract.completed_streams++;\n\t\t\t}\n\t\t}\n\t}\n\tif (progress->extract.completed_bytes >= ctx->next_progress) {\n\n\t\tret = extract_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tset_next_progress(progress->extract.completed_bytes,\n\t\t\t\t  progress->extract.total_bytes,\n\t\t\t\t  &ctx->next_progress);\n\t}\n\n\tif (unlikely(filedes_valid(&ctx->tmpfile_fd))) {\n\t\t/* Just extracting to temporary file for now.  */\n\t\tret = full_write(&ctx->tmpfile_fd, chunk, size);\n\t\tif (ret) {\n\t\t\tERROR_WITH_ERRNO(\"Error writing data to \"\n\t\t\t\t\t \"temporary file \\\"%\"TS\"\\\"\",\n\t\t\t\t\t ctx->tmpfile_name);\n\t\t}\n\t\treturn ret;\n\t}\n\n\treturn call_continue_blob(blob, offset, chunk, size, ctx->saved_cbs);\n}\n\n/* Copy the blob's data from the temporary file to each of its targets.\n *\n * This is executed only in the very uncommon case that a blob is being\n * extracted to more than MAX_OPEN_FILES targets!  */\nstatic int\nextract_from_tmpfile(const tchar *tmpfile_name,\n\t\t     const struct blob_descriptor *orig_blob,\n\t\t     const struct read_blob_callbacks *cbs)\n{\n\tstruct blob_descriptor tmpfile_blob;\n\tconst struct blob_extraction_target *targets = blob_extraction_targets(orig_blob);\n\tint ret;\n\n\tmemcpy(&tmpfile_blob, orig_blob, sizeof(struct blob_descriptor));\n\ttmpfile_blob.blob_location = BLOB_IN_FILE_ON_DISK;\n\ttmpfile_blob.file_on_disk = (tchar *)tmpfile_name;\n\ttmpfile_blob.out_refcnt = 1;\n\n\tfor (u32 i = 0; i < orig_blob->out_refcnt; i++) {\n\t\ttmpfile_blob.inline_blob_extraction_targets[0] = targets[i];\n\t\tret = read_blob_with_cbs(&tmpfile_blob, cbs, false);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nstatic void\nwarn_about_corrupted_file(struct wim_dentry *dentry,\n\t\t\t  const struct wim_inode_stream *stream)\n{\n\tWARNING(\"Corruption in %s\\\"%\"TS\"\\\"!  Extracting anyway since data recovery mode is enabled.\",\n\t\tstream_is_unnamed_data_stream(stream) ? \"\" : \"alternate stream of \",\n\t\tdentry_full_path(dentry));\n}\n\nstatic int\nend_extract_blob(struct blob_descriptor *blob, int status, void *_ctx)\n{\n\tstruct apply_ctx *ctx = _ctx;\n\n\tif ((ctx->extract_flags & WIMLIB_EXTRACT_FLAG_RECOVER_DATA) &&\n\t    !status && blob->corrupted) {\n\t\tconst struct blob_extraction_target *targets =\n\t\t\tblob_extraction_targets(blob);\n\t\tfor (u32 i = 0; i < blob->out_refcnt; i++) {\n\t\t\tstruct wim_dentry *dentry =\n\t\t\t\tinode_first_extraction_dentry(targets[i].inode);\n\n\t\t\twarn_about_corrupted_file(dentry, targets[i].stream);\n\t\t}\n\t}\n\n\tif (unlikely(filedes_valid(&ctx->tmpfile_fd))) {\n\t\tfiledes_close(&ctx->tmpfile_fd);\n\t\tif (!status)\n\t\t\tstatus = extract_from_tmpfile(ctx->tmpfile_name, blob,\n\t\t\t\t\t\t      ctx->saved_cbs);\n\t\tfiledes_invalidate(&ctx->tmpfile_fd);\n\t\ttunlink(ctx->tmpfile_name);\n\t\tFREE(ctx->tmpfile_name);\n\t\treturn status;\n\t}\n\n\treturn call_end_blob(blob, status, ctx->saved_cbs);\n}\n\n/*\n * Read the list of blobs to extract and feed their data into the specified\n * callback functions.\n *\n * This handles checksumming each blob.\n *\n * This also handles sending WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS.\n *\n * This also works if the WIM is being read from a pipe.\n *\n * This also will split up blobs that will need to be extracted to more than\n * MAX_OPEN_FILES locations, as measured by the 'out_refcnt' of each blob.\n * Therefore, the apply_operations implementation need not worry about running\n * out of file descriptors, unless it might open more than one file descriptor\n * per 'blob_extraction_target' (e.g. Win32 currently might because the\n * destination file system might not support hard links).\n */\nint\nextract_blob_list(struct apply_ctx *ctx, const struct read_blob_callbacks *cbs)\n{\n\tstruct read_blob_callbacks wrapper_cbs = {\n\t\t.begin_blob\t= begin_extract_blob,\n\t\t.continue_blob\t= extract_chunk,\n\t\t.end_blob\t= end_extract_blob,\n\t\t.ctx\t\t= ctx,\n\t};\n\tctx->saved_cbs = cbs;\n\tif (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_FROM_PIPE) {\n\t\treturn read_blobs_from_pipe(ctx, &wrapper_cbs);\n\t} else {\n\t\tint flags = VERIFY_BLOB_HASHES;\n\n\t\tif (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_RECOVER_DATA)\n\t\t\tflags |= RECOVER_DATA;\n\n\t\treturn read_blob_list(&ctx->blob_list,\n\t\t\t\t      offsetof(struct blob_descriptor,\n\t\t\t\t\t       extraction_list),\n\t\t\t\t      &wrapper_cbs, flags);\n\t}\n}\n\n/* Extract a WIM dentry to standard output.\n *\n * This obviously doesn't make sense in all cases.  We return an error if the\n * dentry does not correspond to a regular file.  Otherwise we extract the\n * unnamed data stream only.  */\nstatic int\nextract_dentry_to_stdout(struct wim_dentry *dentry,\n\t\t\t const struct blob_table *blob_table, int extract_flags)\n{\n\tstruct wim_inode *inode = dentry->d_inode;\n\tstruct blob_descriptor *blob;\n\tstruct filedes _stdout;\n\tbool recover = (extract_flags & WIMLIB_EXTRACT_FLAG_RECOVER_DATA);\n\tint ret;\n\n\tif (inode->i_attributes & (FILE_ATTRIBUTE_REPARSE_POINT |\n\t\t\t\t   FILE_ATTRIBUTE_DIRECTORY |\n\t\t\t\t   FILE_ATTRIBUTE_ENCRYPTED))\n\t{\n\t\tERROR(\"\\\"%\"TS\"\\\" is not a regular file and therefore cannot be \"\n\t\t      \"extracted to standard output\", dentry_full_path(dentry));\n\t\treturn WIMLIB_ERR_NOT_A_REGULAR_FILE;\n\t}\n\n\tblob = inode_get_blob_for_unnamed_data_stream(inode, blob_table);\n\tif (!blob) {\n\t\tconst u8 *hash = inode_get_hash_of_unnamed_data_stream(inode);\n\t\tif (!is_zero_hash(hash))\n\t\t\treturn blob_not_found_error(inode, hash);\n\t\treturn 0;\n\t}\n\n\tfiledes_init(&_stdout, STDOUT_FILENO);\n\tret = extract_blob_to_fd(blob, &_stdout, recover);\n\tif (ret)\n\t\treturn ret;\n\tif (recover && blob->corrupted)\n\t\twarn_about_corrupted_file(dentry,\n\t\t\t\t\t  inode_get_unnamed_data_stream(inode));\n\treturn 0;\n}\n\nstatic int\nextract_dentries_to_stdout(struct wim_dentry **dentries, size_t num_dentries,\n\t\t\t   const struct blob_table *blob_table,\n\t\t\t   int extract_flags)\n{\n\tfor (size_t i = 0; i < num_dentries; i++) {\n\t\tint ret = extract_dentry_to_stdout(dentries[i], blob_table,\n\t\t\t\t\t\t   extract_flags);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\n/**********************************************************************/\n\n/*\n * Removes duplicate dentries from the array.\n *\n * Returns the new number of dentries, packed at the front of the array.\n */\nstatic size_t\nremove_duplicate_trees(struct wim_dentry **trees, size_t num_trees)\n{\n\tsize_t i, j = 0;\n\tfor (i = 0; i < num_trees; i++) {\n\t\tif (!trees[i]->d_tmp_flag) {\n\t\t\t/* Found distinct dentry.  */\n\t\t\ttrees[i]->d_tmp_flag = 1;\n\t\t\ttrees[j++] = trees[i];\n\t\t}\n\t}\n\tfor (i = 0; i < j; i++)\n\t\ttrees[i]->d_tmp_flag = 0;\n\treturn j;\n}\n\n/*\n * Remove dentries that are descendants of other dentries in the array.\n *\n * Returns the new number of dentries, packed at the front of the array.\n */\nstatic size_t\nremove_contained_trees(struct wim_dentry **trees, size_t num_trees)\n{\n\tsize_t i, j = 0;\n\tfor (i = 0; i < num_trees; i++)\n\t\ttrees[i]->d_tmp_flag = 1;\n\tfor (i = 0; i < num_trees; i++) {\n\t\tstruct wim_dentry *d = trees[i];\n\t\twhile (!dentry_is_root(d)) {\n\t\t\td = d->d_parent;\n\t\t\tif (d->d_tmp_flag)\n\t\t\t\tgoto tree_contained;\n\t\t}\n\t\ttrees[j++] = trees[i];\n\t\tcontinue;\n\n\ttree_contained:\n\t\ttrees[i]->d_tmp_flag = 0;\n\t}\n\n\tfor (i = 0; i < j; i++)\n\t\ttrees[i]->d_tmp_flag = 0;\n\treturn j;\n}\n\nstatic int\ndentry_append_to_list(struct wim_dentry *dentry, void *_dentry_list)\n{\n\tstruct list_head *dentry_list = _dentry_list;\n\tlist_add_tail(&dentry->d_extraction_list_node, dentry_list);\n\treturn 0;\n}\n\nstatic void\ndentry_reset_extraction_list_node(struct wim_dentry *dentry)\n{\n\tdentry->d_extraction_list_node = (struct list_head){NULL, NULL};\n}\n\nstatic int\ndentry_delete_from_list(struct wim_dentry *dentry, void *_ignore)\n{\n\tif (will_extract_dentry(dentry)) {\n\t\tlist_del(&dentry->d_extraction_list_node);\n\t\tdentry_reset_extraction_list_node(dentry);\n\t}\n\treturn 0;\n}\n\n/*\n * Build the preliminary list of dentries to be extracted.\n *\n * The list maintains the invariant that if d1 and d2 are in the list and d1 is\n * an ancestor of d2, then d1 appears before d2 in the list.\n */\nstatic void\nbuild_dentry_list(struct list_head *dentry_list, struct wim_dentry **trees,\n\t\t  size_t num_trees, bool add_ancestors)\n{\n\tINIT_LIST_HEAD(dentry_list);\n\n\t/* Add the trees recursively.  */\n\tfor (size_t i = 0; i < num_trees; i++)\n\t\tfor_dentry_in_tree(trees[i], dentry_append_to_list, dentry_list);\n\n\t/* If requested, add ancestors of the trees.  */\n\tif (add_ancestors) {\n\t\tfor (size_t i = 0; i < num_trees; i++) {\n\t\t\tstruct wim_dentry *dentry = trees[i];\n\t\t\tstruct wim_dentry *ancestor;\n\t\t\tstruct list_head *place_after;\n\n\t\t\tif (dentry_is_root(dentry))\n\t\t\t\tcontinue;\n\n\t\t\tplace_after = dentry_list;\n\t\t\tancestor = dentry;\n\t\t\tdo {\n\t\t\t\tancestor = ancestor->d_parent;\n\t\t\t\tif (will_extract_dentry(ancestor)) {\n\t\t\t\t\tplace_after = &ancestor->d_extraction_list_node;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (!dentry_is_root(ancestor));\n\n\t\t\tancestor = dentry;\n\t\t\tdo {\n\t\t\t\tancestor = ancestor->d_parent;\n\t\t\t\tif (will_extract_dentry(ancestor))\n\t\t\t\t\tbreak;\n\t\t\t\tlist_add(&ancestor->d_extraction_list_node, place_after);\n\t\t\t} while (!dentry_is_root(ancestor));\n\t\t}\n\t}\n}\n\nstatic void\ndestroy_dentry_list(struct list_head *dentry_list)\n{\n\tstruct wim_dentry *dentry, *tmp;\n\tstruct wim_inode *inode;\n\n\tlist_for_each_entry_safe(dentry, tmp, dentry_list, d_extraction_list_node) {\n\t\tinode = dentry->d_inode;\n\t\tdentry_reset_extraction_list_node(dentry);\n\t\tinode->i_visited = 0;\n\t\tinode->i_can_externally_back = 0;\n\t\tif ((void *)dentry->d_extraction_name != (void *)dentry->d_name)\n\t\t\tFREE(dentry->d_extraction_name);\n\t\tdentry->d_extraction_name = NULL;\n\t\tdentry->d_extraction_name_nchars = 0;\n\t}\n}\n\nstatic void\ndestroy_blob_list(struct list_head *blob_list)\n{\n\tstruct blob_descriptor *blob;\n\n\tlist_for_each_entry(blob, blob_list, extraction_list)\n\t\tif (blob->out_refcnt > ARRAY_LEN(blob->inline_blob_extraction_targets))\n\t\t\tFREE(blob->blob_extraction_targets);\n}\n\n#ifdef _WIN32\nstatic const utf16lechar replacement_char = cpu_to_le16(0xfffd);\n#else\nstatic const utf16lechar replacement_char = cpu_to_le16('?');\n#endif\n\nstatic bool\nfile_name_valid(utf16lechar *name, size_t num_chars, bool fix)\n{\n\tsize_t i;\n\n\tif (num_chars == 0)\n\t\treturn true;\n\tfor (i = 0; i < num_chars; i++) {\n\t\tu16 c = le16_to_cpu(name[i]);\n\t\tif (c == '/' || c == '\\0'\n#ifdef _WIN32\n\t\t\t|| (c >= '\\x01' && c <= '\\x1F') || c == ':' || c == '?'\n\t\t\t|| c == '\"' || c == '<' || c == '>' || c == '|'\n#endif\n\t\t) {\n\t\t\tif (fix)\n\t\t\t\tname[i] = replacement_char;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nstatic int\ndentry_calculate_extraction_name(struct wim_dentry *dentry,\n\t\t\t\t struct apply_ctx *ctx)\n{\n\tint ret;\n\n\tif (dentry_is_root(dentry))\n\t\treturn 0;\n\n#ifdef WITH_NTFS_3G\n\tif (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) {\n\t\tdentry->d_extraction_name = dentry->d_name;\n\t\tdentry->d_extraction_name_nchars = dentry->d_name_nbytes /\n\t\t\t\t\t\t   sizeof(utf16lechar);\n\t\treturn 0;\n\t}\n#endif\n\n\tif (!ctx->supported_features.case_sensitive_filenames) {\n\t\tstruct wim_dentry *other;\n\t\tdentry_for_each_ci_match(other, dentry) {\n\t\t\tif (will_extract_dentry(other)) {\n\t\t\t\tif (ctx->extract_flags &\n\t\t\t\t    WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS) {\n\t\t\t\t\tWARNING(\"\\\"%\"TS\"\\\" has the same \"\n\t\t\t\t\t\t\"case-insensitive name as \"\n\t\t\t\t\t\t\"\\\"%\"TS\"\\\"; extracting \"\n\t\t\t\t\t\t\"dummy name instead\",\n\t\t\t\t\t\tdentry_full_path(dentry),\n\t\t\t\t\t\tdentry_full_path(other));\n\t\t\t\t\tgoto out_replace;\n\t\t\t\t} else {\n\t\t\t\t\tWARNING(\"Not extracting \\\"%\"TS\"\\\": \"\n\t\t\t\t\t\t\"has same case-insensitive \"\n\t\t\t\t\t\t\"name as \\\"%\"TS\"\\\"\",\n\t\t\t\t\t\tdentry_full_path(dentry),\n\t\t\t\t\t\tdentry_full_path(other));\n\t\t\t\t\tgoto skip_dentry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (file_name_valid(dentry->d_name, dentry->d_name_nbytes / 2, false)) {\n\t\tsize_t nbytes = 0;\n\t\tret = utf16le_get_tstr(dentry->d_name,\n\t\t\t\t       dentry->d_name_nbytes,\n\t\t\t\t       (const tchar **)&dentry->d_extraction_name,\n\t\t\t\t       &nbytes);\n\t\tdentry->d_extraction_name_nchars = nbytes / sizeof(tchar);\n\t\treturn ret;\n\t} else {\n\t\tif (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES)\n\t\t{\n\t\t\tWARNING(\"\\\"%\"TS\"\\\" has an invalid filename \"\n\t\t\t\t\"that is not supported on this platform; \"\n\t\t\t\t\"extracting dummy name instead\",\n\t\t\t\tdentry_full_path(dentry));\n\t\t\tgoto out_replace;\n\t\t} else {\n\t\t\tWARNING(\"Not extracting \\\"%\"TS\"\\\": has an invalid filename \"\n\t\t\t\t\"that is not supported on this platform\",\n\t\t\t\tdentry_full_path(dentry));\n\t\t\tgoto skip_dentry;\n\t\t}\n\t}\n\nout_replace:\n\t{\n\t\tutf16lechar* utf16_name_copy = alloca(dentry->d_name_nbytes);\n\n\t\tmemcpy(utf16_name_copy, dentry->d_name, dentry->d_name_nbytes);\n\t\tfile_name_valid(utf16_name_copy, dentry->d_name_nbytes / 2, true);\n\n\t\tconst tchar *tchar_name;\n\t\tsize_t tchar_nchars;\n\n\t\tret = utf16le_get_tstr(utf16_name_copy,\n\t\t\t\t       dentry->d_name_nbytes,\n\t\t\t\t       &tchar_name, &tchar_nchars);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\ttchar_nchars /= sizeof(tchar);\n\n\t\tsize_t fixed_name_num_chars = tchar_nchars;\n\t\ttchar* fixed_name = alloca((tchar_nchars + 50) * sizeof(tchar));\n\n\t\ttmemcpy(fixed_name, tchar_name, tchar_nchars);\n\t\tfixed_name_num_chars += tsnprintf(fixed_name + tchar_nchars,\n\t\t\t\t\t\t tchar_nchars + 50,\n\t\t\t\t\t\t T(\" (invalid filename #%lu)\"),\n\t\t\t\t\t\t ++ctx->invalid_sequence);\n\n\t\tutf16le_put_tstr(tchar_name);\n\n\t\tdentry->d_extraction_name = TSTRDUP(fixed_name);\n\t\tif (!dentry->d_extraction_name)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\tdentry->d_extraction_name_nchars = fixed_name_num_chars;\n\t}\n\treturn 0;\n\nskip_dentry:\n\tfor_dentry_in_tree(dentry, dentry_delete_from_list, NULL);\n\treturn 0;\n}\n\n/*\n * Calculate the actual filename component at which each WIM dentry will be\n * extracted, with special handling for dentries that are unsupported by the\n * extraction backend or have invalid names.\n *\n * ctx->supported_features must be filled in.\n *\n * Possible error codes: WIMLIB_ERR_NOMEM, WIMLIB_ERR_INVALID_UTF16_STRING\n */\nstatic int\ndentry_list_calculate_extraction_names(struct list_head *dentry_list,\n\t\t\t\t       struct apply_ctx *ctx)\n{\n\tstruct list_head *prev, *cur;\n\n\t/* Can't use list_for_each_entry() because a call to\n\t * dentry_calculate_extraction_name() may delete the current dentry and\n\t * its children from the list.  */\n\n\tprev = dentry_list;\n\tfor (;;) {\n\t\tstruct wim_dentry *dentry;\n\t\tint ret;\n\n\t\tcur = prev->next;\n\t\tif (cur == dentry_list)\n\t\t\tbreak;\n\n\t\tdentry = list_entry(cur, struct wim_dentry, d_extraction_list_node);\n\n\t\tret = dentry_calculate_extraction_name(dentry, ctx);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tif (prev->next == cur)\n\t\t\tprev = cur;\n\t\telse\n\t\t\t; /* Current dentry and its children (which follow in\n\t\t\t     the list) were deleted.  prev stays the same.  */\n\t}\n\treturn 0;\n}\n\nstatic int\ndentry_resolve_streams(struct wim_dentry *dentry, int extract_flags,\n\t\t       struct blob_table *blob_table)\n{\n\tstruct wim_inode *inode = dentry->d_inode;\n\tstruct blob_descriptor *blob;\n\tint ret;\n\tbool force = false;\n\n\t/* Special case:  when extracting from a pipe, the WIM blob table is\n\t * initially empty, so \"resolving\" an inode's streams is initially not\n\t * possible.  However, we still need to keep track of which blobs,\n\t * identified by SHA-1 message digests, need to be extracted, so we\n\t * \"resolve\" the inode's streams anyway by allocating a 'struct\n\t * blob_descriptor' for each one.  */\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_FROM_PIPE)\n\t\tforce = true;\n\tret = inode_resolve_streams(inode, blob_table, force);\n\tif (ret)\n\t\treturn ret;\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tblob = stream_blob_resolved(&inode->i_streams[i]);\n\t\tif (blob)\n\t\t\tblob->out_refcnt = 0;\n\t}\n\treturn 0;\n}\n\n/*\n * For each dentry to be extracted, resolve all streams in the corresponding\n * inode and set 'out_refcnt' in all referenced blob_descriptors to 0.\n *\n * Possible error codes: WIMLIB_ERR_RESOURCE_NOT_FOUND, WIMLIB_ERR_NOMEM.\n */\nstatic int\ndentry_list_resolve_streams(struct list_head *dentry_list,\n\t\t\t    struct apply_ctx *ctx)\n{\n\tstruct wim_dentry *dentry;\n\tint ret;\n\n\tlist_for_each_entry(dentry, dentry_list, d_extraction_list_node) {\n\t\tret = dentry_resolve_streams(dentry,\n\t\t\t\t\t     ctx->extract_flags,\n\t\t\t\t\t     ctx->wim->blob_table);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nstatic int\nref_stream(struct wim_inode_stream *strm, struct wim_dentry *dentry,\n\t   struct apply_ctx *ctx)\n{\n\tstruct wim_inode *inode = dentry->d_inode;\n\tstruct blob_descriptor *blob = stream_blob_resolved(strm);\n\tstruct blob_extraction_target *targets;\n\n\tif (!blob)\n\t\treturn 0;\n\n\t/* Tally the size only for each actual extraction of the stream (not\n\t * additional hard links to the inode).  */\n\tif (inode->i_visited && ctx->supported_features.hard_links)\n\t\treturn 0;\n\n\tctx->progress.extract.total_bytes += blob->size;\n\tctx->progress.extract.total_streams++;\n\n\tif (inode->i_visited)\n\t\treturn 0;\n\n\t/* Add each blob to 'ctx->blob_list' only one time, regardless of how\n\t * many extraction targets it will have.  */\n\tif (blob->out_refcnt == 0) {\n\t\tlist_add_tail(&blob->extraction_list, &ctx->blob_list);\n\t\tctx->num_blobs_remaining++;\n\t}\n\n\t/* Set this stream as an extraction target of 'blob'.  */\n\n\tif (blob->out_refcnt < ARRAY_LEN(blob->inline_blob_extraction_targets)) {\n\t\ttargets = blob->inline_blob_extraction_targets;\n\t} else {\n\t\tstruct blob_extraction_target *prev_targets;\n\t\tsize_t alloc_blob_extraction_targets;\n\n\t\tif (blob->out_refcnt == ARRAY_LEN(blob->inline_blob_extraction_targets)) {\n\t\t\tprev_targets = NULL;\n\t\t\talloc_blob_extraction_targets = ARRAY_LEN(blob->inline_blob_extraction_targets);\n\t\t} else {\n\t\t\tprev_targets = blob->blob_extraction_targets;\n\t\t\talloc_blob_extraction_targets = blob->alloc_blob_extraction_targets;\n\t\t}\n\n\t\tif (blob->out_refcnt == alloc_blob_extraction_targets) {\n\t\t\talloc_blob_extraction_targets *= 2;\n\t\t\ttargets = REALLOC(prev_targets,\n\t\t\t\t\t  alloc_blob_extraction_targets *\n\t\t\t\t\t  sizeof(targets[0]));\n\t\t\tif (!targets)\n\t\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\t\tif (!prev_targets) {\n\t\t\t\tmemcpy(targets,\n\t\t\t\t       blob->inline_blob_extraction_targets,\n\t\t\t\t       sizeof(blob->inline_blob_extraction_targets));\n\t\t\t}\n\t\t\tblob->blob_extraction_targets = targets;\n\t\t\tblob->alloc_blob_extraction_targets = alloc_blob_extraction_targets;\n\t\t}\n\t\ttargets = blob->blob_extraction_targets;\n\t}\n\ttargets[blob->out_refcnt].inode = inode;\n\ttargets[blob->out_refcnt].stream = strm;\n\tblob->out_refcnt++;\n\treturn 0;\n}\n\nstatic int\nref_stream_if_needed(struct wim_dentry *dentry, struct wim_inode *inode,\n\t\t     struct wim_inode_stream *strm, struct apply_ctx *ctx)\n{\n\tbool need_stream = false;\n\tswitch (strm->stream_type) {\n\tcase STREAM_TYPE_DATA:\n\t\tif (stream_is_named(strm)) {\n\t\t\t/* Named data stream  */\n\t\t\tif (ctx->supported_features.named_data_streams)\n\t\t\t\tneed_stream = true;\n\t\t} else if (!(inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY |\n\t\t\t\t\t\t    FILE_ATTRIBUTE_ENCRYPTED))\n\t\t\t   && !(inode_is_symlink(inode)\n\t\t\t\t&& !ctx->supported_features.reparse_points\n\t\t\t\t&& ctx->supported_features.symlink_reparse_points))\n\t\t{\n\t\t\t/*\n\t\t\t * Unnamed data stream.  Skip if any of the following is true:\n\t\t\t *\n\t\t\t * - file is a directory\n\t\t\t * - file is encrypted\n\t\t\t * - backend needs to create the file as UNIX symlink\n\t\t\t * - backend will extract the stream as externally\n\t\t\t *   backed from the WIM archive itself\n\t\t\t */\n\t\t\tif (ctx->apply_ops->will_back_from_wim) {\n\t\t\t\tint ret = (*ctx->apply_ops->will_back_from_wim)(dentry, ctx);\n\t\t\t\tif (ret > 0) /* Error?  */\n\t\t\t\t\treturn ret;\n\t\t\t\tif (ret < 0) /* Won't externally back?  */\n\t\t\t\t\tneed_stream = true;\n\t\t\t} else {\n\t\t\t\tneed_stream = true;\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tcase STREAM_TYPE_REPARSE_POINT:\n\t\twimlib_assert(inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT);\n\t\tif (ctx->supported_features.reparse_points ||\n\t\t    (inode_is_symlink(inode) &&\n\t\t     ctx->supported_features.symlink_reparse_points))\n\t\t\tneed_stream = true;\n\t\tbreak;\n\tcase STREAM_TYPE_EFSRPC_RAW_DATA:\n\t\twimlib_assert(inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED);\n\t\tif (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) {\n\t\t\tif (ctx->supported_features.encrypted_directories)\n\t\t\t\tneed_stream = true;\n\t\t} else {\n\t\t\tif (ctx->supported_features.encrypted_files)\n\t\t\t\tneed_stream = true;\n\t\t}\n\t\tbreak;\n\t}\n\tif (need_stream)\n\t\treturn ref_stream(strm, dentry, ctx);\n\treturn 0;\n}\n\nstatic int\ndentry_ref_streams(struct wim_dentry *dentry, struct apply_ctx *ctx)\n{\n\tstruct wim_inode *inode = dentry->d_inode;\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tint ret = ref_stream_if_needed(dentry, inode,\n\t\t\t\t\t       &inode->i_streams[i], ctx);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\tinode->i_visited = 1;\n\treturn 0;\n}\n\n/*\n * Given a list of dentries to be extracted, build the list of blobs that need\n * to be extracted, and for each blob determine the streams to which that blob\n * will be extracted.\n *\n * This also initializes the extract progress info with byte and blob\n * information.\n *\n * ctx->supported_features must be filled in.\n */\nstatic int\ndentry_list_ref_streams(struct list_head *dentry_list, struct apply_ctx *ctx)\n{\n\tstruct wim_dentry *dentry;\n\tint ret;\n\n\tlist_for_each_entry(dentry, dentry_list, d_extraction_list_node) {\n\t\tret = dentry_ref_streams(dentry, ctx);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\tlist_for_each_entry(dentry, dentry_list, d_extraction_list_node)\n\t\tdentry->d_inode->i_visited = 0;\n\treturn 0;\n}\n\nstatic void\ndentry_list_build_inode_alias_lists(struct list_head *dentry_list)\n{\n\tstruct wim_dentry *dentry;\n\n\tlist_for_each_entry(dentry, dentry_list, d_extraction_list_node)\n\t\tdentry->d_inode->i_first_extraction_alias = NULL;\n\n\tlist_for_each_entry(dentry, dentry_list, d_extraction_list_node) {\n\t\tdentry->d_next_extraction_alias = dentry->d_inode->i_first_extraction_alias;\n\t\tdentry->d_inode->i_first_extraction_alias = dentry;\n\t}\n}\n\nstatic void\ninode_tally_features(const struct wim_inode *inode,\n\t\t     struct wim_features *features)\n{\n\tif (inode->i_attributes & FILE_ATTRIBUTE_READONLY)\n\t\tfeatures->readonly_files++;\n\tif (inode->i_attributes & FILE_ATTRIBUTE_HIDDEN)\n\t\tfeatures->hidden_files++;\n\tif (inode->i_attributes & FILE_ATTRIBUTE_SYSTEM)\n\t\tfeatures->system_files++;\n\tif (inode->i_attributes & FILE_ATTRIBUTE_ARCHIVE)\n\t\tfeatures->archive_files++;\n\tif (inode->i_attributes & FILE_ATTRIBUTE_COMPRESSED)\n\t\tfeatures->compressed_files++;\n\tif (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) {\n\t\tif (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY)\n\t\t\tfeatures->encrypted_directories++;\n\t\telse\n\t\t\tfeatures->encrypted_files++;\n\t}\n\tif (inode->i_attributes & FILE_ATTRIBUTE_NOT_CONTENT_INDEXED)\n\t\tfeatures->not_context_indexed_files++;\n\tif (inode->i_attributes & FILE_ATTRIBUTE_SPARSE_FILE)\n\t\tfeatures->sparse_files++;\n\tif (inode_has_named_data_stream(inode))\n\t\tfeatures->named_data_streams++;\n\tif (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) {\n\t\tfeatures->reparse_points++;\n\t\tif (inode_is_symlink(inode))\n\t\t\tfeatures->symlink_reparse_points++;\n\t\telse\n\t\t\tfeatures->other_reparse_points++;\n\t}\n\tif (inode_has_security_descriptor(inode))\n\t\tfeatures->security_descriptors++;\n\tif (inode_has_unix_data(inode))\n\t\tfeatures->unix_data++;\n\tif (inode_has_object_id(inode))\n\t\tfeatures->object_ids++;\n\tif (inode_has_xattrs(inode))\n\t\tfeatures->xattrs++;\n}\n\n/* Tally features necessary to extract a dentry and the corresponding inode.  */\nstatic void\ndentry_tally_features(struct wim_dentry *dentry, struct wim_features *features)\n{\n\tstruct wim_inode *inode = dentry->d_inode;\n\n\tif (dentry_has_short_name(dentry))\n\t\tfeatures->short_names++;\n\n\tif (inode->i_visited) {\n\t\tfeatures->hard_links++;\n\t} else {\n\t\tinode_tally_features(inode, features);\n\t\tinode->i_visited = 1;\n\t}\n}\n\n/* Tally the features necessary to extract the specified dentries.  */\nstatic void\ndentry_list_get_features(struct list_head *dentry_list,\n\t\t\t struct wim_features *features)\n{\n\tstruct wim_dentry *dentry;\n\n\tlist_for_each_entry(dentry, dentry_list, d_extraction_list_node)\n\t\tdentry_tally_features(dentry, features);\n\n\tlist_for_each_entry(dentry, dentry_list, d_extraction_list_node)\n\t\tdentry->d_inode->i_visited = 0;\n}\n\nstatic int\ndo_feature_check(const struct wim_features *required_features,\n\t\t const struct wim_features *supported_features,\n\t\t int extract_flags)\n{\n\t/* Encrypted files.  */\n\tif (required_features->encrypted_files &&\n\t    !supported_features->encrypted_files)\n\t\tWARNING(\"Ignoring EFS-encrypted data of %lu files\",\n\t\t\trequired_features->encrypted_files);\n\n\t/* Named data streams.  */\n\tif (required_features->named_data_streams &&\n\t    !supported_features->named_data_streams)\n\t\tWARNING(\"Ignoring named data streams of %lu files\",\n\t\t\trequired_features->named_data_streams);\n\n\t/* File attributes.  */\n\tif (!(extract_flags & WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES)) {\n\n\t\tif (required_features->readonly_files &&\n\t\t    !supported_features->readonly_files)\n\t\t\tWARNING(\"Ignoring FILE_ATTRIBUTE_READONLY of %lu files\",\n\t\t\t\trequired_features->readonly_files);\n\n\t\tif (required_features->hidden_files &&\n\t\t    !supported_features->hidden_files)\n\t\t\tWARNING(\"Ignoring FILE_ATTRIBUTE_HIDDEN of %lu files\",\n\t\t\t\trequired_features->hidden_files);\n\n\t\tif (required_features->system_files &&\n\t\t    !supported_features->system_files)\n\t\t\tWARNING(\"Ignoring FILE_ATTRIBUTE_SYSTEM of %lu files\",\n\t\t\t\trequired_features->system_files);\n\n\t\t/* Note: Don't bother the user about FILE_ATTRIBUTE_ARCHIVE.\n\t\t * We're an archive program, so theoretically we can do what we\n\t\t * want with it.  */\n\n\t\tif (required_features->compressed_files &&\n\t\t    !supported_features->compressed_files)\n\t\t\tWARNING(\"Ignoring FILE_ATTRIBUTE_COMPRESSED of %lu files\",\n\t\t\t\trequired_features->compressed_files);\n\n\t\tif (required_features->not_context_indexed_files &&\n\t\t    !supported_features->not_context_indexed_files)\n\t\t\tWARNING(\"Ignoring FILE_ATTRIBUTE_NOT_CONTENT_INDEXED of %lu files\",\n\t\t\t\trequired_features->not_context_indexed_files);\n\n\t\tif (required_features->sparse_files &&\n\t\t    !supported_features->sparse_files)\n\t\t\tWARNING(\"Ignoring FILE_ATTRIBUTE_SPARSE_FILE of %lu files\",\n\t\t\t\trequired_features->sparse_files);\n\n\t\tif (required_features->encrypted_directories &&\n\t\t    !supported_features->encrypted_directories)\n\t\t\tWARNING(\"Ignoring FILE_ATTRIBUTE_ENCRYPTED of %lu directories\",\n\t\t\t\trequired_features->encrypted_directories);\n\t}\n\n\t/* Hard links.  */\n\tif (required_features->hard_links && !supported_features->hard_links)\n\t\tWARNING(\"Extracting %lu hard links as independent files\",\n\t\t\trequired_features->hard_links);\n\n\t/* Symbolic links and reparse points.  */\n\tif ((extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS) &&\n\t    required_features->symlink_reparse_points &&\n\t    !supported_features->symlink_reparse_points &&\n\t    !supported_features->reparse_points)\n\t{\n\t\tERROR(\"Extraction backend does not support symbolic links!\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n\tif (required_features->reparse_points &&\n\t    !supported_features->reparse_points)\n\t{\n\t\tif (supported_features->symlink_reparse_points) {\n\t\t\tif (required_features->other_reparse_points) {\n\t\t\t\tWARNING(\"Ignoring reparse data of %lu non-symlink/junction files\",\n\t\t\t\t\trequired_features->other_reparse_points);\n\t\t\t}\n\t\t} else {\n\t\t\tWARNING(\"Ignoring reparse data of %lu files\",\n\t\t\t\trequired_features->reparse_points);\n\t\t}\n\t}\n\n\t/* Security descriptors.  */\n\tif (((extract_flags & (WIMLIB_EXTRACT_FLAG_STRICT_ACLS |\n\t\t\t       WIMLIB_EXTRACT_FLAG_UNIX_DATA))\n\t     == WIMLIB_EXTRACT_FLAG_STRICT_ACLS) &&\n\t    required_features->security_descriptors &&\n\t    !supported_features->security_descriptors)\n\t{\n\t\tERROR(\"Extraction backend does not support security descriptors!\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n\tif (!(extract_flags & WIMLIB_EXTRACT_FLAG_NO_ACLS) &&\n\t    required_features->security_descriptors &&\n\t    !supported_features->security_descriptors)\n\t\tWARNING(\"Ignoring Windows NT security descriptors of %lu files\",\n\t\t\trequired_features->security_descriptors);\n\n\t/* Standard UNIX metadata */\n\tif (required_features->unix_data &&\n\t    (!supported_features->unix_data ||\n\t     !(extract_flags & WIMLIB_EXTRACT_FLAG_UNIX_DATA)))\n\t{\n\t\tif (extract_flags & WIMLIB_EXTRACT_FLAG_UNIX_DATA) {\n\t\t\tERROR(\"Requested UNIX metadata extraction, but \"\n\t\t\t      \"extraction backend does not support it!\");\n\t\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t\t}\n\t\tWARNING(\"Ignoring UNIX metadata (uid/gid/mode/rdev) of %lu files%\"TS,\n\t\t\trequired_features->unix_data,\n\t\t\t(supported_features->unix_data ?\n\t\t\t T(\"\\n          (use --unix-data mode to extract these)\") : T(\"\")));\n\t}\n\n\t/* Extended attributes */\n\tif (required_features->xattrs &&\n\t    (!supported_features->xattrs ||\n\t     (supported_features->unix_data &&\n\t      !(extract_flags & WIMLIB_EXTRACT_FLAG_UNIX_DATA))))\n\t{\n\t\tWARNING(\"Ignoring extended attributes of %lu files%\"TS,\n\t\t\trequired_features->xattrs,\n\t\t\t(supported_features->xattrs ?\n\t\t\t T(\"\\n          (use --unix-data mode to extract these)\") : T(\"\")));\n\t}\n\n\t/* Object IDs.  */\n\tif (required_features->object_ids && !supported_features->object_ids) {\n\t\tWARNING(\"Ignoring object IDs of %lu files\",\n\t\t\trequired_features->object_ids);\n\t}\n\n\t/* DOS Names.  */\n\tif (required_features->short_names &&\n\t    !supported_features->short_names)\n\t{\n\t\tif (extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES) {\n\t\t\tERROR(\"Extraction backend does not support DOS names!\");\n\t\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t\t}\n\t\tWARNING(\"Ignoring DOS names of %lu files\",\n\t\t\trequired_features->short_names);\n\t}\n\n\t/* Timestamps.  */\n\tif ((extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS) &&\n\t    !supported_features->timestamps)\n\t{\n\t\tERROR(\"Extraction backend does not support timestamps!\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n\n\treturn 0;\n}\n\nstatic const struct apply_operations *\nselect_apply_operations(int extract_flags)\n{\n#ifdef WITH_NTFS_3G\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_NTFS)\n\t\treturn &ntfs_3g_apply_ops;\n#endif\n#ifdef _WIN32\n\treturn &win32_apply_ops;\n#else\n\treturn &unix_apply_ops;\n#endif\n}\n\nstatic int\nextract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees,\n\t      const tchar *target, int extract_flags)\n{\n\tconst struct apply_operations *ops;\n\tstruct apply_ctx *ctx;\n\tint ret;\n\tLIST_HEAD(dentry_list);\n\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_TO_STDOUT) {\n\t\tret = extract_dentries_to_stdout(trees, num_trees,\n\t\t\t\t\t\t wim->blob_table,\n\t\t\t\t\t\t extract_flags);\n\t\tgoto out;\n\t}\n\n\tnum_trees = remove_duplicate_trees(trees, num_trees);\n\tnum_trees = remove_contained_trees(trees, num_trees);\n\n\tops = select_apply_operations(extract_flags);\n\n\tif (num_trees > 1 && ops->single_tree_only) {\n\t\tERROR(\"Extracting multiple directory trees \"\n\t\t      \"at once is not supported in %s extraction mode!\",\n\t\t      ops->name);\n\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\tgoto out;\n\t}\n\n\tctx = CALLOC(1, ops->context_size);\n\tif (!ctx) {\n\t\tret = WIMLIB_ERR_NOMEM;\n\t\tgoto out;\n\t}\n\n\tctx->wim = wim;\n\tctx->target = target;\n\tctx->target_nchars = tstrlen(target);\n\tctx->extract_flags = extract_flags;\n\tif (ctx->wim->progfunc) {\n\t\tctx->progfunc = ctx->wim->progfunc;\n\t\tctx->progctx = ctx->wim->progctx;\n\t\tctx->progress.extract.image = wim->current_image;\n\t\tctx->progress.extract.extract_flags = (extract_flags &\n\t\t\t\t\t\t       WIMLIB_EXTRACT_MASK_PUBLIC);\n\t\tctx->progress.extract.wimfile_name = wim->filename;\n\t\tctx->progress.extract.image_name = wimlib_get_image_name(wim,\n\t\t\t\t\t\t\t\t\t wim->current_image);\n\t\tctx->progress.extract.target = target;\n\t}\n\tINIT_LIST_HEAD(&ctx->blob_list);\n\tfiledes_invalidate(&ctx->tmpfile_fd);\n\tctx->apply_ops = ops;\n\n\tret = (*ops->get_supported_features)(target, &ctx->supported_features);\n\tif (ret)\n\t\tgoto out_cleanup;\n\n\tbuild_dentry_list(&dentry_list, trees, num_trees,\n\t\t\t  !(extract_flags &\n\t\t\t    WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE));\n\n\tdentry_list_get_features(&dentry_list, &ctx->required_features);\n\n\tret = do_feature_check(&ctx->required_features, &ctx->supported_features,\n\t\t\t       ctx->extract_flags);\n\tif (ret)\n\t\tgoto out_cleanup;\n\n\tret = dentry_list_calculate_extraction_names(&dentry_list, ctx);\n\tif (ret)\n\t\tgoto out_cleanup;\n\n\tif (unlikely(list_empty(&dentry_list))) {\n\t\tWARNING(\"There is nothing to extract!\");\n\t\tgoto out_cleanup;\n\t}\n\n\tret = dentry_list_resolve_streams(&dentry_list, ctx);\n\tif (ret)\n\t\tgoto out_cleanup;\n\n\tdentry_list_build_inode_alias_lists(&dentry_list);\n\n\tret = dentry_list_ref_streams(&dentry_list, ctx);\n\tif (ret)\n\t\tgoto out_cleanup;\n\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_FROM_PIPE) {\n\t\t/* When extracting from a pipe, the number of bytes of data to\n\t\t * extract can't be determined in the normal way (examining the\n\t\t * blob table), since at this point all we have is a set of\n\t\t * SHA-1 message digests of blobs that need to be extracted.\n\t\t * However, we can get a reasonably accurate estimate by taking\n\t\t * <TOTALBYTES> from the corresponding <IMAGE> in the WIM XML\n\t\t * data.  This does assume that a full image is being extracted,\n\t\t * but currently there is no API for doing otherwise.  (Also,\n\t\t * subtract <HARDLINKBYTES> from this if hard links are\n\t\t * supported by the extraction mode.)  */\n\t\tctx->progress.extract.total_bytes =\n\t\t\txml_get_image_total_bytes(wim->xml_info,\n\t\t\t\t\t\t  wim->current_image);\n\t\tif (ctx->supported_features.hard_links) {\n\t\t\tctx->progress.extract.total_bytes -=\n\t\t\t\txml_get_image_hard_link_bytes(wim->xml_info,\n\t\t\t\t\t\t\t      wim->current_image);\n\t\t}\n\t}\n\n\tret = extract_progress(ctx,\n\t\t\t       ((extract_flags & WIMLIB_EXTRACT_FLAG_IMAGEMODE) ?\n\t\t\t\t       WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN :\n\t\t\t\t       WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN));\n\tif (ret)\n\t\tgoto out_cleanup;\n\n\tret = (*ops->extract)(&dentry_list, ctx);\n\tif (ret)\n\t\tgoto out_cleanup;\n\n\tif (ctx->progress.extract.completed_bytes <\n\t    ctx->progress.extract.total_bytes)\n\t{\n\t\tctx->progress.extract.completed_bytes =\n\t\t\tctx->progress.extract.total_bytes;\n\t\tret = extract_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS);\n\t\tif (ret)\n\t\t\tgoto out_cleanup;\n\t}\n\n\tret = extract_progress(ctx,\n\t\t\t       ((extract_flags & WIMLIB_EXTRACT_FLAG_IMAGEMODE) ?\n\t\t\t\t       WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END :\n\t\t\t\t       WIMLIB_PROGRESS_MSG_EXTRACT_TREE_END));\nout_cleanup:\n\tdestroy_blob_list(&ctx->blob_list);\n\tdestroy_dentry_list(&dentry_list);\n\tFREE(ctx);\nout:\n\treturn ret;\n}\n\nstatic int\nmkdir_if_needed(const tchar *target)\n{\n\tif (!tmkdir(target, 0755))\n\t\treturn 0;\n\n\tif (errno == EEXIST)\n\t\treturn 0;\n\n#ifdef _WIN32\n\t/* _wmkdir() fails with EACCES if called on a drive root directory.  */\n\tif (errno == EACCES)\n\t\treturn 0;\n#endif\n\n\tERROR_WITH_ERRNO(\"Failed to create directory \\\"%\"TS\"\\\"\", target);\n\treturn WIMLIB_ERR_MKDIR;\n}\n\n/* Make sure the extraction flags make sense, and update them if needed.  */\nstatic int\ncheck_extract_flags(const WIMStruct *wim, int *extract_flags_p)\n{\n\tint extract_flags = *extract_flags_p;\n\n\t/* Check for invalid flag combinations  */\n\n\tif ((extract_flags &\n\t     (WIMLIB_EXTRACT_FLAG_NO_ACLS |\n\t      WIMLIB_EXTRACT_FLAG_STRICT_ACLS)) == (WIMLIB_EXTRACT_FLAG_NO_ACLS |\n\t\t\t\t\t\t    WIMLIB_EXTRACT_FLAG_STRICT_ACLS))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif ((extract_flags &\n\t     (WIMLIB_EXTRACT_FLAG_RPFIX |\n\t      WIMLIB_EXTRACT_FLAG_NORPFIX)) == (WIMLIB_EXTRACT_FLAG_RPFIX |\n\t\t\t\t\t\tWIMLIB_EXTRACT_FLAG_NORPFIX))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n#ifndef WITH_NTFS_3G\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) {\n\t\tERROR(\"wimlib was compiled without support for NTFS-3G, so\\n\"\n\t\t      \"        it cannot apply a WIM image directly to an NTFS volume.\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n#endif\n\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT) {\n#ifdef _WIN32\n\t\tif (!wim->filename)\n\t\t\treturn WIMLIB_ERR_NO_FILENAME;\n#else\n\t\tERROR(\"WIMBoot extraction is only supported on Windows!\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n#endif\n\t}\n\n\tif (extract_flags & (WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K |\n\t\t\t     WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K |\n\t\t\t     WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K |\n\t\t\t     WIMLIB_EXTRACT_FLAG_COMPACT_LZX))\n\t{\n\t#ifdef _WIN32\n\t\tint count = 0;\n\t\tcount += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K) != 0);\n\t\tcount += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K) != 0);\n\t\tcount += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K) != 0);\n\t\tcount += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_LZX) != 0);\n\t\tif (count != 1) {\n\t\t\tERROR(\"Only one compression format can be specified \"\n\t\t\t      \"for compact-mode extraction!\");\n\t\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t\t}\n\t\tif (extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT) {\n\t\t\tERROR(\"Compact-mode extraction and WIMBoot-mode \"\n\t\t\t      \"extraction are mutually exclusive!\");\n\t\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t\t}\n\t#else\n\t\tERROR(\"Compact-mode extraction (System Compression) \"\n\t\t      \"is only supported on Windows!\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t#endif\n\t}\n\n\n\tif ((extract_flags & (WIMLIB_EXTRACT_FLAG_RPFIX |\n\t\t\t      WIMLIB_EXTRACT_FLAG_NORPFIX |\n\t\t\t      WIMLIB_EXTRACT_FLAG_IMAGEMODE)) ==\n\t\t\t\t\tWIMLIB_EXTRACT_FLAG_IMAGEMODE)\n\t{\n\t\t/* For full-image extraction, do reparse point fixups by default\n\t\t * if the WIM header says they are enabled.  */\n\t\tif (wim->hdr.flags & WIM_HDR_FLAG_RP_FIX)\n\t\t\textract_flags |= WIMLIB_EXTRACT_FLAG_RPFIX;\n\t}\n\n\t*extract_flags_p = extract_flags;\n\treturn 0;\n}\n\nstruct append_dentry_ctx {\n\tstruct wim_dentry **dentries;\n\tsize_t num_dentries;\n\tsize_t num_alloc_dentries;\n};\n\nstatic int\nappend_dentry_cb(struct wim_dentry *dentry, void *_ctx)\n{\n\tstruct append_dentry_ctx *ctx = _ctx;\n\n\tif (ctx->num_dentries == ctx->num_alloc_dentries) {\n\t\tstruct wim_dentry **new_dentries;\n\t\tsize_t new_length;\n\n\t\tnew_length = max(ctx->num_alloc_dentries + 8,\n\t\t\t\t ctx->num_alloc_dentries * 3 / 2);\n\t\tnew_dentries = REALLOC(ctx->dentries,\n\t\t\t\t       new_length * sizeof(ctx->dentries[0]));\n\t\tif (new_dentries == NULL)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\tctx->dentries = new_dentries;\n\t\tctx->num_alloc_dentries = new_length;\n\t}\n\tctx->dentries[ctx->num_dentries++] = dentry;\n\treturn 0;\n}\n\n/* Append dentries matched by a path which can contain wildcard characters.  */\nstatic int\nappend_matched_dentries(WIMStruct *wim, const tchar *orig_pattern,\n\t\t\tint extract_flags, struct append_dentry_ctx *ctx)\n{\n\tconst size_t count_before = ctx->num_dentries;\n\ttchar *pattern;\n\tint ret;\n\n\tpattern = canonicalize_wim_path(orig_pattern);\n\tif (!pattern)\n\t\treturn WIMLIB_ERR_NOMEM;\n\tret = expand_path_pattern(wim_get_current_root_dentry(wim), pattern,\n\t\t\t\t  append_dentry_cb, ctx);\n\tFREE(pattern);\n\tif (ret || ctx->num_dentries > count_before)\n\t\treturn ret;\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_GLOB) {\n\t\tERROR(\"No matches for path pattern \\\"%\"TS\"\\\"\", orig_pattern);\n\t\treturn WIMLIB_ERR_PATH_DOES_NOT_EXIST;\n\t}\n\tWARNING(\"No matches for path pattern \\\"%\"TS\"\\\"\", orig_pattern);\n\treturn 0;\n}\n\nstatic int\ndo_wimlib_extract_paths(WIMStruct *wim, int image, const tchar *target,\n\t\t\tconst tchar * const *paths, size_t num_paths,\n\t\t\tint extract_flags)\n{\n\tint ret;\n\tstruct wim_dentry **trees;\n\tsize_t num_trees;\n\n\tif (wim == NULL || target == NULL || target[0] == T('\\0') ||\n\t    (num_paths != 0 && paths == NULL))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tret = check_extract_flags(wim, &extract_flags);\n\tif (ret)\n\t\treturn ret;\n\n\tret = select_wim_image(wim, image);\n\tif (ret)\n\t\treturn ret;\n\n\tret = wim_checksum_unhashed_blobs(wim);\n\tif (ret)\n\t\treturn ret;\n\n\tif ((extract_flags & (WIMLIB_EXTRACT_FLAG_NTFS |\n\t\t\t      WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE)) ==\n\t    (WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE))\n\t{\n\t\tret = mkdir_if_needed(target);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_GLOB_PATHS) {\n\n\t\tstruct append_dentry_ctx append_dentry_ctx = {\n\t\t\t.dentries = NULL,\n\t\t\t.num_dentries = 0,\n\t\t\t.num_alloc_dentries = 0,\n\t\t};\n\n\t\tfor (size_t i = 0; i < num_paths; i++) {\n\t\t\tret = append_matched_dentries(wim, paths[i],\n\t\t\t\t\t\t      extract_flags,\n\t\t\t\t\t\t      &append_dentry_ctx);\n\t\t\tif (ret) {\n\t\t\t\ttrees = append_dentry_ctx.dentries;\n\t\t\t\tgoto out_free_trees;\n\t\t\t}\n\t\t}\n\t\ttrees = append_dentry_ctx.dentries;\n\t\tnum_trees = append_dentry_ctx.num_dentries;\n\t} else {\n\t\ttrees = MALLOC(num_paths * sizeof(trees[0]));\n\t\tif (trees == NULL)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\n\t\tfor (size_t i = 0; i < num_paths; i++) {\n\n\t\t\ttchar *path = canonicalize_wim_path(paths[i]);\n\t\t\tif (path == NULL) {\n\t\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\t\tgoto out_free_trees;\n\t\t\t}\n\n\t\t\ttrees[i] = get_dentry(wim, path,\n\t\t\t\t\t      WIMLIB_CASE_PLATFORM_DEFAULT);\n\t\t\tFREE(path);\n\t\t\tif (trees[i] == NULL) {\n\t\t\t\t  ERROR(\"Path \\\"%\"TS\"\\\" does not exist \"\n\t\t\t\t\t\"in WIM image %d\",\n\t\t\t\t\tpaths[i], wim->current_image);\n\t\t\t\t  ret = WIMLIB_ERR_PATH_DOES_NOT_EXIST;\n\t\t\t\t  goto out_free_trees;\n\t\t\t}\n\t\t}\n\t\tnum_trees = num_paths;\n\t}\n\n\tif (num_trees == 0) {\n\t\tret = 0;\n\t\tgoto out_free_trees;\n\t}\n\n\tret = extract_trees(wim, trees, num_trees, target, extract_flags);\nout_free_trees:\n\tFREE(trees);\n\treturn ret;\n}\n\nstatic int\nextract_single_image(WIMStruct *wim, int image,\n\t\t     const tchar *target, int extract_flags)\n{\n\tconst tchar *path = WIMLIB_WIM_ROOT_PATH;\n\textract_flags |= WIMLIB_EXTRACT_FLAG_IMAGEMODE;\n\treturn do_wimlib_extract_paths(wim, image, target, &path, 1, extract_flags);\n}\n\nstatic const tchar * const filename_forbidden_chars =\n#ifdef _WIN32\nT(\"<>:\\\"/\\\\|?*\");\n#else\nT(\"/\");\n#endif\n\n/* This function checks if it is okay to use a WIM image's name as a directory\n * name.  */\nstatic bool\nimage_name_ok_as_dir(const tchar *image_name)\n{\n\treturn image_name && *image_name &&\n\t\t!tstrpbrk(image_name, filename_forbidden_chars) &&\n\t\ttstrcmp(image_name, T(\".\")) &&\n\t\ttstrcmp(image_name, T(\"..\")) &&\n\t\ttstrlen(image_name) <= 128;\n}\n\n/* Extracts all images from the WIM to the directory @target, with the images\n * placed in subdirectories named by their image names. */\nstatic int\nextract_all_images(WIMStruct *wim, const tchar *target, int extract_flags)\n{\n\tsize_t output_path_len = tstrlen(target);\n\ttchar* buf = alloca((output_path_len + 1 + 128 + 1) * sizeof(tchar));\n\tint ret;\n\tint image;\n\tconst tchar *image_name;\n\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) {\n\t\tERROR(\"Cannot extract multiple images in NTFS extraction mode.\");\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t}\n\n\tret = mkdir_if_needed(target);\n\tif (ret)\n\t\treturn ret;\n\ttmemcpy(buf, target, output_path_len);\n\tbuf[output_path_len] = OS_PREFERRED_PATH_SEPARATOR;\n\tfor (image = 1; image <= wim->hdr.image_count; image++) {\n\t\timage_name = wimlib_get_image_name(wim, image);\n\t\tif (image_name_ok_as_dir(image_name)) {\n\t\t\ttstrcpy(buf + output_path_len + 1, image_name);\n\t\t} else {\n\t\t\t/* Image name is empty or contains forbidden characters.\n\t\t\t * Use image number instead. */\n\t\t\ttsnprintf(buf + output_path_len + 1, output_path_len + 1 + 128 + 1, T(\"%d\"), image);\n\t\t}\n\t\tret = extract_single_image(wim, image, buf, extract_flags);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nstatic int\ndo_wimlib_extract_image(WIMStruct *wim, int image, const tchar *target,\n\t\t\tint extract_flags)\n{\n\tif (extract_flags & (WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE |\n\t\t\t     WIMLIB_EXTRACT_FLAG_TO_STDOUT |\n\t\t\t     WIMLIB_EXTRACT_FLAG_GLOB_PATHS))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (image == WIMLIB_ALL_IMAGES)\n\t\treturn extract_all_images(wim, target, extract_flags);\n\telse\n\t\treturn extract_single_image(wim, image, target, extract_flags);\n}\n\n\n/****************************************************************************\n *                          Extraction API                                  *\n ****************************************************************************/\n\nWIMLIBAPI int\nwimlib_extract_paths(WIMStruct *wim, int image, const tchar *target,\n\t\t     const tchar * const *paths, size_t num_paths,\n\t\t     int extract_flags)\n{\n\tif (extract_flags & ~WIMLIB_EXTRACT_MASK_PUBLIC)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\treturn do_wimlib_extract_paths(wim, image, target, paths, num_paths,\n\t\t\t\t       extract_flags);\n}\n\nWIMLIBAPI int\nwimlib_extract_pathlist(WIMStruct *wim, int image, const tchar *target,\n\t\t\tconst tchar *path_list_file, int extract_flags)\n{\n\tint ret;\n\ttchar **paths;\n\tsize_t num_paths;\n\tvoid *mem;\n\n\tret = read_path_list_file(path_list_file, &paths, &num_paths, &mem);\n\tif (ret) {\n\t\tERROR(\"Failed to read path list file \\\"%\"TS\"\\\"\",\n\t\t      path_list_file ? path_list_file : T(\"<stdin>\"));\n\t\treturn ret;\n\t}\n\n\tret = wimlib_extract_paths(wim, image, target,\n\t\t\t\t   (const tchar * const *)paths, num_paths,\n\t\t\t\t   extract_flags);\n\tFREE(paths);\n\tFREE(mem);\n\treturn ret;\n}\n\nWIMLIBAPI int\nwimlib_extract_image_from_pipe_with_progress(int pipe_fd,\n\t\t\t\t\t     const tchar *image_num_or_name,\n\t\t\t\t\t     const tchar *target,\n\t\t\t\t\t     int extract_flags,\n\t\t\t\t\t     wimlib_progress_func_t progfunc,\n\t\t\t\t\t     void *progctx)\n{\n\tint ret;\n\tWIMStruct *pwm;\n\tstruct filedes *in_fd;\n\tint image;\n\tunsigned i;\n\n\tif (extract_flags & ~WIMLIB_EXTRACT_MASK_PUBLIC)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\t/* Read the WIM header from the pipe and get a WIMStruct to represent\n\t * the pipable WIM.  Caveats:  Unlike getting a WIMStruct with\n\t * wimlib_open_wim(), getting a WIMStruct in this way will result in an\n\t * empty blob table, no XML data read, and no filename set.  */\n\tret = open_wim_as_WIMStruct(&pipe_fd, WIMLIB_OPEN_FLAG_FROM_PIPE, &pwm,\n\t\t\t\t    progfunc, progctx);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Sanity check to make sure this is a pipable WIM.  */\n\tif (pwm->hdr.magic != PWM_MAGIC) {\n\t\tERROR(\"The WIM being read from file descriptor %d \"\n\t\t      \"is not pipable!\", pipe_fd);\n\t\tret = WIMLIB_ERR_NOT_PIPABLE;\n\t\tgoto out_wimlib_free;\n\t}\n\n\t/* Sanity check to make sure the first part of a pipable split WIM is\n\t * sent over the pipe first.  */\n\tif (pwm->hdr.part_number != 1) {\n\t\tERROR(\"The first part of the split WIM must be \"\n\t\t      \"sent over the pipe first.\");\n\t\tret = WIMLIB_ERR_INVALID_PIPABLE_WIM;\n\t\tgoto out_wimlib_free;\n\t}\n\n\tin_fd = &pwm->in_fd;\n\twimlib_assert(in_fd->offset == WIM_HEADER_DISK_SIZE);\n\n\t/* As mentioned, the WIMStruct we created from the pipe does not have\n\t * XML data yet.  Fix this by reading the extra copy of the XML data\n\t * that directly follows the header in pipable WIMs.  (Note: see\n\t * write_pipable_wim() for more details about the format of pipable\n\t * WIMs.)  */\n\t{\n\t\tu8 hash[SHA1_HASH_SIZE];\n\n\t\tret = read_pwm_blob_header(pwm, hash,\n\t\t\t\t\t   &pwm->hdr.xml_data_reshdr, NULL);\n\t\tif (ret)\n\t\t\tgoto out_wimlib_free;\n\n\t\tif (!(pwm->hdr.xml_data_reshdr.flags & WIM_RESHDR_FLAG_METADATA)) {\n\t\t\tERROR(\"Expected XML data, but found non-metadata resource.\");\n\t\t\tret = WIMLIB_ERR_INVALID_PIPABLE_WIM;\n\t\t\tgoto out_wimlib_free;\n\t\t}\n\n\t\tret = read_wim_xml_data(pwm);\n\t\tif (ret)\n\t\t\tgoto out_wimlib_free;\n\n\t\tif (xml_get_image_count(pwm->xml_info) != pwm->hdr.image_count) {\n\t\t\tERROR(\"Image count in XML data is not the same as in WIM header.\");\n\t\t\tret = WIMLIB_ERR_IMAGE_COUNT;\n\t\t\tgoto out_wimlib_free;\n\t\t}\n\t}\n\n\t/* Get image index (this may use the XML data that was just read to\n\t * resolve an image name).  */\n\tif (image_num_or_name) {\n\t\timage = wimlib_resolve_image(pwm, image_num_or_name);\n\t\tif (image == WIMLIB_NO_IMAGE) {\n\t\t\tERROR(\"\\\"%\"TS\"\\\" is not a valid image in the pipable WIM!\",\n\t\t\t      image_num_or_name);\n\t\t\tret = WIMLIB_ERR_INVALID_IMAGE;\n\t\t\tgoto out_wimlib_free;\n\t\t} else if (image == WIMLIB_ALL_IMAGES) {\n\t\t\tERROR(\"Applying all images from a pipe is not supported!\");\n\t\t\tret = WIMLIB_ERR_INVALID_IMAGE;\n\t\t\tgoto out_wimlib_free;\n\t\t}\n\t} else {\n\t\tif (pwm->hdr.image_count != 1) {\n\t\t\tERROR(\"No image was specified, but the pipable WIM \"\n\t\t\t      \"did not contain exactly 1 image\");\n\t\t\tret = WIMLIB_ERR_INVALID_IMAGE;\n\t\t\tgoto out_wimlib_free;\n\t\t}\n\t\timage = 1;\n\t}\n\n\t/* Load the needed metadata resource.  */\n\tfor (i = 1; i <= pwm->hdr.image_count; i++) {\n\t\tret = handle_pwm_metadata_resource(pwm, i, i == image);\n\t\tif (ret)\n\t\t\tgoto out_wimlib_free;\n\t}\n\t/* Extract the image.  */\n\textract_flags |= WIMLIB_EXTRACT_FLAG_FROM_PIPE;\n\tret = do_wimlib_extract_image(pwm, image, target, extract_flags);\n\t/* Clean up and return.  */\nout_wimlib_free:\n\twimlib_free(pwm);\n\treturn ret;\n}\n\n\nWIMLIBAPI int\nwimlib_extract_image_from_pipe(int pipe_fd, const tchar *image_num_or_name,\n\t\t\t       const tchar *target, int extract_flags)\n{\n\treturn wimlib_extract_image_from_pipe_with_progress(pipe_fd,\n\t\t\t\t\t\t\t    image_num_or_name,\n\t\t\t\t\t\t\t    target,\n\t\t\t\t\t\t\t    extract_flags,\n\t\t\t\t\t\t\t    NULL,\n\t\t\t\t\t\t\t    NULL);\n}\n\nWIMLIBAPI int\nwimlib_extract_image(WIMStruct *wim, int image, const tchar *target,\n\t\t     int extract_flags)\n{\n\tif (extract_flags & ~WIMLIB_EXTRACT_MASK_PUBLIC)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\treturn do_wimlib_extract_image(wim, image, target, extract_flags);\n}\n"
  },
  {
    "path": "src/wimlib/file_io.c",
    "content": "/*\n * file_io.c - Helper functions for reading and writing to file descriptors.\n */\n\n/*\n * Copyright (C) 2013 Eric Biggers\n * Copyright (C) 2025 Pete Batard <pete@akeo.ie>\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n#include <unistd.h>\n\n#include \"wimlib/error.h\"\n#include \"wimlib/file_io.h\"\n#include \"wimlib/util.h\"\n\n#ifdef _WIN32\n#  include \"wimlib/win32.h\"\n#  define read win32_read\n#  define write win32_write\n#  define pread win32_pread\n#  define pwrite win32_pwrite\n#endif\n\n#ifdef WITH_LIBCDIO\nstatic int\nudf_pread(struct filedes* fd, void* buf, size_t count, off_t offset)\n{\n\tssize_t ret;\n\tsize_t partial_size;\n\tuint64_t file_length;\n\tchar _buf[UDF_BLOCKSIZE];\n\n\tif (count == 0)\n\t\treturn 0;\n\n\tif (!udf_setpos(fd->p_udf_file, (offset / UDF_BLOCKSIZE) * UDF_BLOCKSIZE)) {\n\t\terrno = ERANGE;\n\t\treturn WIMLIB_ERR_READ;\n\t}\n\tfd->offset = (offset / UDF_BLOCKSIZE) * UDF_BLOCKSIZE;\n\n\tfile_length = udf_get_file_length(fd->p_udf_file);\n\tif (offset + count > file_length)\n\t\tcount = file_length - offset;\n\n\tif (offset % UDF_BLOCKSIZE) {\n\t\tpartial_size = min(UDF_BLOCKSIZE - offset % UDF_BLOCKSIZE, count);\n\t\tret = udf_read_block(fd->p_udf_file, _buf, 1);\n\t\tif (unlikely(ret <= 0)) {\n\t\t\terrno = EINVAL;\n\t\t\treturn WIMLIB_ERR_READ;\n\t\t}\n\t\tmemcpy(buf, &_buf[offset % UDF_BLOCKSIZE], partial_size);\n\t\tbuf = _PTR(buf + partial_size);\n\t\tfd->offset += partial_size;\n\t\tcount -= partial_size;\n\t}\n\n\twhile (count >= UDF_BLOCKSIZE) {\n\t\tret = udf_read_block(fd->p_udf_file, buf, count / UDF_BLOCKSIZE);\n\t\tif (unlikely(ret <= 0)) {\n\t\t\terrno = EINVAL;\n\t\t\treturn WIMLIB_ERR_READ;\n\t\t}\n\t\tbuf = _PTR(buf + ret);\n\t\tfd->offset += ret;\n\t\tcount -= ret;\n\t}\n\n\tpartial_size = count % UDF_BLOCKSIZE;\n\tif (partial_size) {\n\t\tret = udf_read_block(fd->p_udf_file, _buf, 1);\n\t\tif (unlikely(ret <= 0)) {\n\t\t\terrno = EINVAL;\n\t\t\treturn WIMLIB_ERR_READ;\n\t\t}\n\t\tmemcpy(buf, _buf, partial_size);\n\t\tbuf = _PTR(buf + partial_size);\n\t\tfd->offset += partial_size;\n\t}\n\n\treturn 0;\n}\n\nstatic int\niso_pread(struct filedes* fd, void* buf, size_t count, off_t offset)\n{\n\tssize_t ret;\n\tsize_t partial_size;\n\tchar _buf[ISO_BLOCKSIZE];\n\tlsn_t lsn_offset = fd->p_iso_file->lsn + offset / ISO_BLOCKSIZE;\n\n\tif (count == 0)\n\t\treturn 0;\n\n\tif (offset >= fd->p_iso_file->total_size) {\n\t\terrno = ERANGE;\n\t\treturn WIMLIB_ERR_READ;\n\t}\n\n\tif (offset + count > fd->p_iso_file->total_size)\n\t\tcount = fd->p_iso_file->total_size - offset;\n\n\tif (offset % ISO_BLOCKSIZE) {\n\t\tpartial_size = min(ISO_BLOCKSIZE - offset % ISO_BLOCKSIZE, count);\n\t\tret = iso9660_iso_seek_read(fd->p_iso, _buf, lsn_offset, 1);\n\t\tif (unlikely(ret <= 0)) {\n\t\t\terrno = EINVAL;\n\t\t\treturn WIMLIB_ERR_READ;\n\t\t}\n\t\tlsn_offset += 1;\n\t\tmemcpy(buf, &_buf[offset % ISO_BLOCKSIZE], partial_size);\n\t\tbuf = _PTR(buf + partial_size);\n\t\tfd->offset += partial_size;\n\t\tcount -= partial_size;\n\t}\n\n\twhile (count >= ISO_BLOCKSIZE) {\n\t\tret = iso9660_iso_seek_read(fd->p_iso, _buf,\n\t\t\tlsn_offset % ISO_BLOCKSIZE, 1);\n\t\tret = iso9660_iso_seek_read(fd->p_iso, buf, lsn_offset, count / ISO_BLOCKSIZE);\n\t\tif (unlikely(ret <= 0)) {\n\t\t\terrno = EINVAL;\n\t\t\treturn WIMLIB_ERR_READ;\n\t\t}\n\t\tlsn_offset += ret / ISO_BLOCKSIZE;\n\t\tbuf = _PTR(buf + ret);\n\t\tfd->offset += ret;\n\t\tcount -= ret;\n\t}\n\n\tpartial_size = count % ISO_BLOCKSIZE;\n\tif (partial_size) {\n\t\tret = iso9660_iso_seek_read(fd->p_iso, _buf, lsn_offset, 1);\n\t\tif (unlikely(ret <= 0)) {\n\t\t\terrno = EINVAL;\n\t\t\treturn WIMLIB_ERR_READ;\n\t\t}\n\t\tmemcpy(buf, _buf, partial_size);\n\t\tbuf = _PTR(buf + partial_size);\n\t\tfd->offset += partial_size;\n\t}\n\n\treturn 0;\n}\n#endif\n\n/*\n * Wrapper around read() that checks for errors and keeps retrying until all\n * requested bytes have been read or until end-of file has occurred.\n *\n * Return values:\n *\tWIMLIB_ERR_SUCCESS\t\t\t(0)\n *\tWIMLIB_ERR_READ\t\t\t\t(errno set)\n *\tWIMLIB_ERR_UNEXPECTED_END_OF_FILE\t(errno set to EINVAL)\n */\nint\nfull_read(struct filedes *fd, void *buf, size_t count)\n{\n#ifdef WITH_LIBCDIO\n\tif (fd->is_udf)\n\t\treturn udf_pread(fd, buf, count, 0);\n\telse if (fd->is_iso)\n\t\treturn iso_pread(fd, buf, count, 0);\n#endif\n\n\twhile (count) {\n\t\tssize_t ret = read(fd->fd, buf, count);\n\t\tif (unlikely(ret <= 0)) {\n\t\t\tif (ret == 0) {\n\t\t\t\terrno = EINVAL;\n\t\t\t\treturn WIMLIB_ERR_UNEXPECTED_END_OF_FILE;\n\t\t\t}\n\t\t\tif (errno == EINTR)\n\t\t\t\tcontinue;\n\t\t\treturn WIMLIB_ERR_READ;\n\t\t}\n\t\tbuf = _PTR(buf + ret);\n\t\tcount -= ret;\n\t\tfd->offset += ret;\n\t}\n\treturn 0;\n}\n\nstatic int\npipe_read(struct filedes *fd, void *buf, size_t count, off_t offset)\n{\n\tint ret;\n\n\t/* Verify the offset.  */\n\tif (offset < fd->offset) {\n\t\tERROR(\"Can't seek backwards in pipe \"\n\t\t      \"(offset %\"PRIu64\" => %\"PRIu64\").\\n\"\n\t\t      \"        Make sure the WIM was captured as \"\n\t\t      \"pipable.\", fd->offset, offset);\n\t\terrno = ESPIPE;\n\t\treturn WIMLIB_ERR_RESOURCE_ORDER;\n\t}\n\n\t/* Manually seek to the requested position.  */\n\twhile (fd->offset != offset) {\n\t\tsize_t bytes_to_read = min(offset - fd->offset, BUFFER_SIZE);\n\t\tu8* dummy = MALLOC(bytes_to_read);\n\n\t\tret = full_read(fd, dummy, bytes_to_read);\n\t\tFREE(dummy);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\t/* Do the actual read.  */\n\treturn full_read(fd, buf, count);\n}\n\n/*\n * Wrapper around pread() that checks for errors and keeps retrying until all\n * requested bytes have been read or until end-of file has occurred.  This also\n * transparently handle reading from pipe files, but the caller needs to be sure\n * the requested offset is greater than or equal to the current offset, or else\n * WIMLIB_ERR_RESOURCE_ORDER will be returned.\n *\n * Return values:\n *\tWIMLIB_ERR_SUCCESS\t\t\t(0)\n *\tWIMLIB_ERR_READ\t\t\t\t(errno set)\n *\tWIMLIB_ERR_UNEXPECTED_END_OF_FILE\t(errno set to EINVAL)\n *\tWIMLIB_ERR_RESOURCE_ORDER\t\t(errno set to ESPIPE)\n */\nint\nfull_pread(struct filedes *fd, void *buf, size_t count, off_t offset)\n{\n\tif (fd->is_pipe)\n\t\tgoto is_pipe;\n\n#ifdef WITH_LIBCDIO\n\tif (fd->is_udf)\n\t\treturn udf_pread(fd, buf, count, offset);\n\telse if (fd->is_iso)\n\t\treturn iso_pread(fd, buf, count, offset);\n#endif\n\n\twhile (count) {\n\t\tssize_t ret = pread(fd->fd, buf, count, offset);\n\t\tif (unlikely(ret <= 0)) {\n\t\t\tif (ret == 0) {\n\t\t\t\terrno = EINVAL;\n\t\t\t\treturn WIMLIB_ERR_UNEXPECTED_END_OF_FILE;\n\t\t\t}\n\t\t\tif (errno == EINTR)\n\t\t\t\tcontinue;\n\t\t\tif (errno == ESPIPE) {\n\t\t\t\tfd->is_pipe = 1;\n\t\t\t\tgoto is_pipe;\n\t\t\t}\n\t\t\treturn WIMLIB_ERR_READ;\n\t\t}\n\t\tbuf = _PTR(buf + ret);\n\t\tcount -= ret;\n\t\toffset += ret;\n\t}\n\treturn 0;\n\nis_pipe:\n\treturn pipe_read(fd, buf, count, offset);\n}\n\n/*\n * Wrapper around write() that checks for errors and keeps retrying until all\n * requested bytes have been written.\n *\n * Return values:\n *\tWIMLIB_ERR_SUCCESS\t\t\t(0)\n *\tWIMLIB_ERR_WRITE\t\t\t(errno set)\n */\nint\nfull_write(struct filedes *fd, const void *buf, size_t count)\n{\n\twhile (count) {\n\t\tssize_t ret = write(fd->fd, buf, count);\n\t\tif (unlikely(ret < 0)) {\n\t\t\tif (errno == EINTR)\n\t\t\t\tcontinue;\n\t\t\treturn WIMLIB_ERR_WRITE;\n\t\t}\n\t\tbuf = _PTR(buf + ret);\n\t\tcount -= ret;\n\t\tfd->offset += ret;\n\t}\n\treturn 0;\n}\n\n\n/*\n * Wrapper around pwrite() that checks for errors and keeps retrying until all\n * requested bytes have been written.\n *\n * Return values:\n *\tWIMLIB_ERR_SUCCESS\t(0)\n *\tWIMLIB_ERR_WRITE\t(errno set)\n */\nint\nfull_pwrite(struct filedes *fd, const void *buf, size_t count, off_t offset)\n{\n\twhile (count) {\n\t\tssize_t ret = pwrite(fd->fd, buf, count, offset);\n\t\tif (unlikely(ret < 0)) {\n\t\t\tif (errno == EINTR)\n\t\t\t\tcontinue;\n\t\t\treturn WIMLIB_ERR_WRITE;\n\t\t}\n\t\tbuf = _PTR(buf + ret);\n\t\tcount -= ret;\n\t\toffset += ret;\n\t}\n\treturn 0;\n}\n\noff_t filedes_seek(struct filedes *fd, off_t offset)\n{\n#ifdef WITH_LIBCDIO\n\t/* No arbitrary seek for ISO files */\n\tif (fd->is_udf || fd->is_iso) {\n\t\terrno = ENFILE;\n\t\treturn -1;\n\t}\n#endif\n\tif (fd->is_pipe) {\n\t\terrno = ESPIPE;\n\t\treturn -1;\n\t}\n\tif (fd->offset != offset) {\n\t\tif (_lseeki64(fd->fd, offset, SEEK_SET) == -1)\n\t\t\treturn -1;\n\t\tfd->offset = offset;\n\t}\n\treturn offset;\n}\n\nbool filedes_is_seekable(struct filedes *fd)\n{\n#ifdef WITH_LIBCDIO\n\t/* No arbitrary seek for ISO files */\n\tif (fd->is_udf || fd->is_iso)\n\t\treturn false;\n#endif\n\treturn !fd->is_pipe && _lseeki64(fd->fd, 0, SEEK_CUR) != -1;\n}\n"
  },
  {
    "path": "src/wimlib/header.c",
    "content": "/*\n * header.c\n *\n * Read, write, or print a WIM header.\n */\n\n/*\n * Copyright 2012-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <ctype.h>\n#include <stdio.h>\n#include <string.h>\n#include <unistd.h>\n\n#include \"wimlib.h\"\n#include \"wimlib/alloca.h\"\n#include \"wimlib/assert.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/file_io.h\"\n#include \"wimlib/header.h\"\n#include \"wimlib/util.h\"\n#include \"wimlib/wim.h\"\n\n/*\n * Reads the header from a WIM file.\n *\n * @wim\n *\tWIM to read the header from.  @wim->in_fd must be positioned at the\n *\tbeginning of the file.\n *\n * @hdr\n *\tStructure to read the header into.\n *\n * Return values:\n *\tWIMLIB_ERR_SUCCESS (0)\n *\tWIMLIB_ERR_IMAGE_COUNT\n *\tWIMLIB_ERR_INVALID_PART_NUMBER\n *\tWIMLIB_ERR_NOT_A_WIM_FILE\n *\tWIMLIB_ERR_READ\n *\tWIMLIB_ERR_UNEXPECTED_END_OF_FILE\n *\tWIMLIB_ERR_UNKNOWN_VERSION\n */\nint\nread_wim_header(WIMStruct *wim, struct wim_header *hdr)\n{\n\tPRAGMA_ALIGN(struct wim_header_disk disk_hdr, 8);\n\tstruct filedes *in_fd = &wim->in_fd;\n\tconst tchar *filename = wim->filename;\n\tint ret;\n\ttchar *pipe_str;\n\n\twimlib_assert(in_fd->offset == 0);\n\n\tif (filename == NULL) {\n\t\tpipe_str = alloca(40);\n\t\ttsprintf(pipe_str, T(\"[fd %d]\"), in_fd->fd);\n\t\tfilename = pipe_str;\n\t}\n\n\tSTATIC_ASSERT(sizeof(struct wim_header_disk) == WIM_HEADER_DISK_SIZE);\n\n\tret = full_read(in_fd, &disk_hdr, sizeof(disk_hdr));\n\tif (ret)\n\t\tgoto read_error;\n\n\thdr->magic = le64_to_cpu(disk_hdr.magic);\n\n\tif (hdr->magic != WIM_MAGIC) {\n\t\tif (hdr->magic == PWM_MAGIC) {\n\t\t\t/* Pipable WIM:  Use header at end instead, unless\n\t\t\t * actually reading from a pipe.  */\n\t\t\tif (!in_fd->is_pipe) {\n\t\t\t\tret = WIMLIB_ERR_READ;\n\t\t\t\tif (-1 == _lseeki64(in_fd->fd, -WIM_HEADER_DISK_SIZE, SEEK_END))\n\t\t\t\t\tgoto read_error;\n\t\t\t\tret = full_read(in_fd, &disk_hdr, sizeof(disk_hdr));\n\t\t\t\tif (ret)\n\t\t\t\t\tgoto read_error;\n\t\t\t}\n\t\t} else {\n\t\t\tERROR(\"\\\"%\"TS\"\\\": Invalid magic characters in header\", filename);\n\t\t\treturn WIMLIB_ERR_NOT_A_WIM_FILE;\n\t\t}\n\t}\n\n\tif (le32_to_cpu(disk_hdr.hdr_size) != sizeof(struct wim_header_disk)) {\n\t\tERROR(\"\\\"%\"TS\"\\\": Header size is invalid (%u bytes)\",\n\t\t      filename, le32_to_cpu(disk_hdr.hdr_size));\n\t\treturn WIMLIB_ERR_INVALID_HEADER;\n\t}\n\n\thdr->wim_version = le32_to_cpu(disk_hdr.wim_version);\n\tif (hdr->wim_version != WIM_VERSION_DEFAULT &&\n\t    hdr->wim_version != WIM_VERSION_SOLID)\n\t{\n\t\tERROR(\"\\\"%\"TS\"\\\": Unknown WIM version: %u\",\n\t\t      filename, hdr->wim_version);\n\t\treturn WIMLIB_ERR_UNKNOWN_VERSION;\n\t}\n\n\thdr->flags = le32_to_cpu(disk_hdr.wim_flags);\n\thdr->chunk_size = le32_to_cpu(disk_hdr.chunk_size);\n\tcopy_guid(hdr->guid, disk_hdr.guid);\n\thdr->part_number = le16_to_cpu(disk_hdr.part_number);\n\thdr->total_parts = le16_to_cpu(disk_hdr.total_parts);\n\n\tif (hdr->total_parts == 0 || hdr->part_number == 0 ||\n\t    hdr->part_number > hdr->total_parts)\n\t{\n\t\tERROR(\"\\\"%\"TS\"\\\": Invalid WIM part number: %hu of %hu\",\n\t\t      filename, hdr->part_number, hdr->total_parts);\n\t\treturn WIMLIB_ERR_INVALID_PART_NUMBER;\n\t}\n\n\thdr->image_count = le32_to_cpu(disk_hdr.image_count);\n\n\tif (unlikely(hdr->image_count > MAX_IMAGES)) {\n\t\tERROR(\"\\\"%\"TS\"\\\": Invalid image count (%u)\",\n\t\t      filename, hdr->image_count);\n\t\treturn WIMLIB_ERR_IMAGE_COUNT;\n\t}\n\n\tget_wim_reshdr(&disk_hdr.blob_table_reshdr, &hdr->blob_table_reshdr);\n\tget_wim_reshdr(&disk_hdr.xml_data_reshdr, &hdr->xml_data_reshdr);\n\tget_wim_reshdr(&disk_hdr.boot_metadata_reshdr, &hdr->boot_metadata_reshdr);\n\thdr->boot_idx = le32_to_cpu(disk_hdr.boot_idx);\n\tget_wim_reshdr(&disk_hdr.integrity_table_reshdr, &hdr->integrity_table_reshdr);\n\n\t/*\n\t * Prevent huge memory allocations when processing fuzzed files.  The\n\t * blob table, XML data, and integrity table are all uncompressed, so\n\t * they should never be larger than the WIM file itself.\n\t */\n\tif (wim->file_size > 0 &&\n\t    (hdr->blob_table_reshdr.uncompressed_size > wim->file_size ||\n\t     hdr->xml_data_reshdr.uncompressed_size > wim->file_size ||\n\t     hdr->integrity_table_reshdr.uncompressed_size > wim->file_size))\n\t\treturn WIMLIB_ERR_INVALID_HEADER;\n\n\treturn 0;\n\nread_error:\n\tERROR_WITH_ERRNO(\"\\\"%\"TS\"\\\": Error reading header\", filename);\n\treturn ret;\n}\n\n/* Writes the header for a WIM file at the specified offset.  If the offset\n * specified is the current one, the position is advanced by the size of the\n * header.  */\nint\nwrite_wim_header(const struct wim_header *hdr, struct filedes *out_fd,\n\t\t off_t offset)\n{\n\tPRAGMA_ALIGN(struct wim_header_disk disk_hdr, 8);\n\tint ret;\n\n\tdisk_hdr.magic = cpu_to_le64(hdr->magic);\n\tdisk_hdr.hdr_size = cpu_to_le32(sizeof(struct wim_header_disk));\n\tdisk_hdr.wim_version = cpu_to_le32(hdr->wim_version);\n\tdisk_hdr.wim_flags = cpu_to_le32(hdr->flags);\n\tdisk_hdr.chunk_size = cpu_to_le32(hdr->chunk_size);\n\tcopy_guid(disk_hdr.guid, hdr->guid);\n\tdisk_hdr.part_number = cpu_to_le16(hdr->part_number);\n\tdisk_hdr.total_parts = cpu_to_le16(hdr->total_parts);\n\tdisk_hdr.image_count = cpu_to_le32(hdr->image_count);\n\tput_wim_reshdr(&hdr->blob_table_reshdr, &disk_hdr.blob_table_reshdr);\n\tput_wim_reshdr(&hdr->xml_data_reshdr, &disk_hdr.xml_data_reshdr);\n\tput_wim_reshdr(&hdr->boot_metadata_reshdr, &disk_hdr.boot_metadata_reshdr);\n\tdisk_hdr.boot_idx = cpu_to_le32(hdr->boot_idx);\n\tput_wim_reshdr(&hdr->integrity_table_reshdr, &disk_hdr.integrity_table_reshdr);\n\tmemset(disk_hdr.unused, 0, sizeof(disk_hdr.unused));\n\n\tif (offset == out_fd->offset)\n\t\tret = full_write(out_fd, &disk_hdr, sizeof(disk_hdr));\n\telse\n\t\tret = full_pwrite(out_fd, &disk_hdr, sizeof(disk_hdr), offset);\n\tif (ret)\n\t\tERROR_WITH_ERRNO(\"Failed to write WIM header\");\n\treturn ret;\n}\n\n/* Update just the wim_flags field. */\nint\nwrite_wim_header_flags(u32 hdr_flags, struct filedes *out_fd)\n{\n\tle32 flags = cpu_to_le32(hdr_flags);\n\n\treturn full_pwrite(out_fd, &flags, sizeof(flags),\n\t\t\t   offsetof(struct wim_header_disk, wim_flags));\n}\n\nstatic const struct {\n\tu32 flag;\n\tconst tchar *name;\n} hdr_flags[] = {\n\t{WIM_HDR_FLAG_RESERVED,\t\tT(\"RESERVED\")},\n\t{WIM_HDR_FLAG_COMPRESSION,\tT(\"COMPRESSION\")},\n\t{WIM_HDR_FLAG_READONLY,\t\tT(\"READONLY\")},\n\t{WIM_HDR_FLAG_SPANNED,\t\tT(\"SPANNED\")},\n\t{WIM_HDR_FLAG_RESOURCE_ONLY,\tT(\"RESOURCE_ONLY\")},\n\t{WIM_HDR_FLAG_METADATA_ONLY,\tT(\"METADATA_ONLY\")},\n\t{WIM_HDR_FLAG_WRITE_IN_PROGRESS,T(\"WRITE_IN_PROGRESS\")},\n\t{WIM_HDR_FLAG_RP_FIX,\t\tT(\"RP_FIX\")},\n\t{WIM_HDR_FLAG_COMPRESS_RESERVED,T(\"COMPRESS_RESERVED\")},\n\t{WIM_HDR_FLAG_COMPRESS_LZX,\tT(\"COMPRESS_LZX\")},\n\t{WIM_HDR_FLAG_COMPRESS_XPRESS,\tT(\"COMPRESS_XPRESS\")},\n\t{WIM_HDR_FLAG_COMPRESS_LZMS,\tT(\"COMPRESS_LZMS\")},\n\t{WIM_HDR_FLAG_COMPRESS_XPRESS_2,T(\"COMPRESS_XPRESS_2\")},\n};\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI void\nwimlib_print_header(const WIMStruct *wim)\n{\n\tconst struct wim_header *hdr = &wim->hdr;\n\n\ttprintf(T(\"Magic Characters            = \"));\n\tfor (int i = 0; i < sizeof(hdr->magic); i++) {\n\t\ttchar c = (u8)(hdr->magic >> ((8 * i)));\n\t\tif (istalpha(c))\n\t\t\ttputchar(c);\n\t\telse\n\t\t\ttprintf(T(\"\\\\%o\"), c);\n\t}\n\ttputchar(T('\\n'));\n\ttprintf(T(\"Header Size                 = %u\\n\"), WIM_HEADER_DISK_SIZE);\n\ttprintf(T(\"Version                     = 0x%x\\n\"), hdr->wim_version);\n\n\ttprintf(T(\"Flags                       = 0x%x\\n\"), hdr->flags);\n\tfor (size_t i = 0; i < ARRAY_LEN(hdr_flags); i++)\n\t\tif (hdr_flags[i].flag & hdr->flags)\n\t\t\ttprintf(T(\"    WIM_HDR_FLAG_%s is set\\n\"), hdr_flags[i].name);\n\n\ttprintf(T(\"Chunk Size                  = %u\\n\"), hdr->chunk_size);\n\ttfputs (T(\"GUID                        = \"), stdout);\n\tprint_byte_field(hdr->guid, GUID_SIZE, stdout);\n\ttputchar(T('\\n'));\n\ttprintf(T(\"Part Number                 = %hu\\n\"), hdr->part_number);\n\ttprintf(T(\"Total Parts                 = %hu\\n\"), hdr->total_parts);\n\ttprintf(T(\"Image Count                 = %u\\n\"), hdr->image_count);\n\ttprintf(T(\"Blob Table Size             = %\"PRIu64\"\\n\"),\n\t\t\t\t(u64)hdr->blob_table_reshdr.size_in_wim);\n\ttprintf(T(\"Blob Table Flags            = 0x%hhx\\n\"),\n\t\t\t\t(u8)hdr->blob_table_reshdr.flags);\n\ttprintf(T(\"Blob Table Offset           = %\"PRIu64\"\\n\"),\n\t\t\t\thdr->blob_table_reshdr.offset_in_wim);\n\ttprintf(T(\"Blob Table Original_size    = %\"PRIu64\"\\n\"),\n\t\t\t\thdr->blob_table_reshdr.uncompressed_size);\n\ttprintf(T(\"XML Data Size               = %\"PRIu64\"\\n\"),\n\t\t\t\t(u64)hdr->xml_data_reshdr.size_in_wim);\n\ttprintf(T(\"XML Data Flags              = 0x%hhx\\n\"),\n\t\t\t\t(u8)hdr->xml_data_reshdr.flags);\n\ttprintf(T(\"XML Data Offset             = %\"PRIu64\"\\n\"),\n\t\t\t\thdr->xml_data_reshdr.offset_in_wim);\n\ttprintf(T(\"XML Data Original Size      = %\"PRIu64\"\\n\"),\n\t\t\t\thdr->xml_data_reshdr.uncompressed_size);\n\ttprintf(T(\"Boot Metadata Size          = %\"PRIu64\"\\n\"),\n\t\t\t\t(u64)hdr->boot_metadata_reshdr.size_in_wim);\n\ttprintf(T(\"Boot Metadata Flags         = 0x%hhx\\n\"),\n\t\t\t\t(u8)hdr->boot_metadata_reshdr.flags);\n\ttprintf(T(\"Boot Metadata Offset        = %\"PRIu64\"\\n\"),\n\t\t\t\thdr->boot_metadata_reshdr.offset_in_wim);\n\ttprintf(T(\"Boot Metadata Original Size = %\"PRIu64\"\\n\"),\n\t\t\t\thdr->boot_metadata_reshdr.uncompressed_size);\n\ttprintf(T(\"Boot Index                  = %u\\n\"), hdr->boot_idx);\n\ttprintf(T(\"Integrity Size              = %\"PRIu64\"\\n\"),\n\t\t\t\t(u64)hdr->integrity_table_reshdr.size_in_wim);\n\ttprintf(T(\"Integrity Flags             = 0x%hhx\\n\"),\n\t\t\t\t(u8)hdr->integrity_table_reshdr.flags);\n\ttprintf(T(\"Integrity Offset            = %\"PRIu64\"\\n\"),\n\t\t\t\thdr->integrity_table_reshdr.offset_in_wim);\n\ttprintf(T(\"Integrity Original_size     = %\"PRIu64\"\\n\"),\n\t\t\t\thdr->integrity_table_reshdr.uncompressed_size);\n}\n"
  },
  {
    "path": "src/wimlib/inode.c",
    "content": "/*\n * inode.c\n *\n * Functions that operate on WIM inodes.\n *\n * See dentry.c for a description of the relationship between WIM dentries and\n * WIM inodes.\n */\n\n/*\n * Copyright (C) 2012-2018 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/inode.h\"\n#include \"wimlib/timestamp.h\"\n\n/*\n * The 'stream_name' field of unnamed streams always points to this array, which\n * is an empty UTF-16 string.\n */\nconst utf16lechar NO_STREAM_NAME[1];\n\n/* Allocate a new inode and associate the specified dentry with it.  */\nstruct wim_inode *\nnew_inode(struct wim_dentry *dentry, bool set_timestamps)\n{\n\tstruct wim_inode *inode;\n\n\tinode = CALLOC(1, sizeof(struct wim_inode));\n\tif (!inode)\n\t\treturn NULL;\n\n\tinode->i_security_id = -1;\n\t/*inode->i_nlink = 0;*/\n\tinode->i_rp_flags = WIM_RP_FLAG_NOT_FIXED;\n\tINIT_HLIST_HEAD(&inode->i_alias_list);\n\tinode->i_streams = inode->i_embedded_streams;\n\tif (set_timestamps) {\n\t\tu64 now = now_as_wim_timestamp();\n\t\tinode->i_creation_time = now;\n\t\tinode->i_last_access_time = now;\n\t\tinode->i_last_write_time = now;\n\t}\n\td_associate(dentry, inode);\n\treturn inode;\n}\n\nstatic inline void\ndestroy_stream(struct wim_inode_stream *strm)\n{\n\tif (strm->stream_name != NO_STREAM_NAME)\n\t\tFREE(strm->stream_name);\n}\n\nstatic void\nfree_inode(struct wim_inode *inode)\n{\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++)\n\t\tdestroy_stream(&inode->i_streams[i]);\n\tif (inode->i_streams != inode->i_embedded_streams)\n\t\tFREE(inode->i_streams);\n\tif (inode->i_extra)\n\t\tFREE(inode->i_extra);\n\tif (!hlist_unhashed(&inode->i_hlist_node))\n\t\thlist_del(&inode->i_hlist_node);\n\tFREE(inode);\n}\n\nstatic inline void\nfree_inode_if_unneeded(struct wim_inode *inode)\n{\n\tif (inode->i_nlink)\n\t\treturn;\n#ifdef WITH_FUSE\n\tif (inode->i_num_opened_fds)\n\t\treturn;\n#endif\n\tfree_inode(inode);\n}\n\n/* Associate a dentry with the specified inode.  */\nvoid\nd_associate(struct wim_dentry *dentry, struct wim_inode *inode)\n{\n\twimlib_assert(!dentry->d_inode);\n\n\thlist_add_head(&dentry->d_alias_node, &inode->i_alias_list);\n\tdentry->d_inode = inode;\n\tinode->i_nlink++;\n}\n\n/* Disassociate a dentry from its inode, if any.  Following this, free the inode\n * if it is no longer in use.  */\nvoid\nd_disassociate(struct wim_dentry *dentry)\n{\n\tstruct wim_inode *inode = dentry->d_inode;\n\n\tif (unlikely(!inode))\n\t\treturn;\n\n\twimlib_assert(inode->i_nlink > 0);\n\n\thlist_del(&dentry->d_alias_node);\n\tdentry->d_inode = NULL;\n\tinode->i_nlink--;\n\n\tfree_inode_if_unneeded(inode);\n}\n\n#ifdef WITH_FUSE\nvoid\ninode_dec_num_opened_fds(struct wim_inode *inode)\n{\n\twimlib_assert(inode->i_num_opened_fds > 0);\n\n\tif (--inode->i_num_opened_fds == 0) {\n\t\t/* The last file descriptor to this inode was closed.  */\n\t\tFREE(inode->i_fds);\n\t\tinode->i_fds = NULL;\n\t\tinode->i_num_allocated_fds = 0;\n\n\t\tfree_inode_if_unneeded(inode);\n\t}\n}\n#endif\n\n/*\n * Retrieve a stream of an inode.\n *\n * @inode\n *\tThe inode from which the stream is desired\n * @stream_type\n *\tThe type of the stream desired\n * @stream_name\n *\tThe name of the stream desired as a null-terminated UTF-16LE string, or\n *\tNO_STREAM_NAME if an unnamed stream is desired\n *\n * Returns a pointer to the stream if found, otherwise NULL.\n */\nstruct wim_inode_stream *\ninode_get_stream(const struct wim_inode *inode, int stream_type,\n\t\t const utf16lechar *stream_name)\n{\n\tif (stream_name == NO_STREAM_NAME)  /* Optimization  */\n\t\treturn inode_get_unnamed_stream(inode, stream_type);\n\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tstruct wim_inode_stream *strm = &inode->i_streams[i];\n\t\tif (strm->stream_type == stream_type &&\n\t\t    !cmp_utf16le_strings_z(strm->stream_name, stream_name,\n\t\t\t\t\t   default_ignore_case))\n\t\t{\n\t\t\treturn strm;\n\t\t}\n\t}\n\treturn NULL;\n}\n\n/*\n * This is equivalent to inode_get_stream(inode, stream_type, NO_STREAM_NAME),\n * but this optimizes for the unnamed case by not doing full string comparisons.\n */\nstruct wim_inode_stream *\ninode_get_unnamed_stream(const struct wim_inode *inode, int stream_type)\n{\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tstruct wim_inode_stream *strm = &inode->i_streams[i];\n\t\tif (strm->stream_type == stream_type &&\n\t\t    strm->stream_name == NO_STREAM_NAME)\n\t\t{\n\t\t\treturn strm;\n\t\t}\n\t}\n\treturn NULL;\n}\n\n\nstatic void\ninode_set_stream_blob(struct wim_inode *inode, struct wim_inode_stream *strm,\n\t\t      struct blob_descriptor *new_blob)\n{\n\tstrm->_stream_blob = new_blob;\n\tstrm->stream_resolved = 1;\n\tif (new_blob)\n\t\tnew_blob->refcnt += inode->i_nlink;\n}\n\nstatic void\ninode_unset_stream_blob(struct wim_inode *inode, struct wim_inode_stream *strm,\n\t\t\tstruct blob_table *blob_table)\n{\n\tstruct blob_descriptor *old_blob;\n\n\told_blob = stream_blob(strm, blob_table);\n\tif (old_blob)\n\t\tblob_subtract_refcnt(old_blob, blob_table, inode->i_nlink);\n\tstrm->_stream_blob = NULL;\n\tstrm->stream_resolved = 1;\n}\n\n/*\n * Replace the blob associated with the specified stream.\n *\n * @inode\n *\tThe inode containing @strm\n * @strm\n *\tThe stream whose data needs to be replaced\n * @new_blob\n *\tThe new blob descriptor to assign\n * @blob_table\n *\tPointer to the blob table in which data blobs are being indexed\n */\nvoid\ninode_replace_stream_blob(struct wim_inode *inode,\n\t\t\t  struct wim_inode_stream *strm,\n\t\t\t  struct blob_descriptor *new_blob,\n\t\t\t  struct blob_table *blob_table)\n{\n\tinode_unset_stream_blob(inode, strm, blob_table);\n\tinode_set_stream_blob(inode, strm, new_blob);\n}\n\n/*\n * Add a new stream to the specified inode.\n *\n * @inode\n *\tThe inode to which to add the stream\n * @stream_type\n *\tThe type of the stream being added\n * @stream_name\n *\tThe name of the stream being added as a null-terminated UTF-16LE string,\n *\tor NO_STREAM_NAME if the stream is unnamed\n * @blob\n *\tThe blob that the new stream will initially reference, or NULL\n *\n * Returns a pointer to the new stream, or NULL with errno set if it could not\n * be added.\n */\nstruct wim_inode_stream *\ninode_add_stream(struct wim_inode *inode, int stream_type,\n\t\t const utf16lechar *stream_name, struct blob_descriptor *blob)\n{\n\tif (inode->i_num_streams >= 0xFFFF) {\n\t\tERROR(\"Inode has too many streams! Path=\\\"%\"TS\"\\\"\",\n\t\t      inode_any_full_path(inode));\n\t\terrno = EFBIG;\n\t\treturn NULL;\n\t}\n\n\tstruct wim_inode_stream *streams;\n\tstruct wim_inode_stream *new_strm;\n\n\tif (inode->i_streams == inode->i_embedded_streams) {\n\t\tif (inode->i_num_streams < ARRAY_LEN(inode->i_embedded_streams)) {\n\t\t\tstreams = inode->i_embedded_streams;\n\t\t} else {\n\t\t\tstreams = MALLOC((inode->i_num_streams + 1) *\n\t\t\t\t\t\tsizeof(inode->i_streams[0]));\n\t\t\tif (!streams)\n\t\t\t\treturn NULL;\n\t\t\tmemcpy(streams, inode->i_streams,\n\t\t\t       (inode->i_num_streams *\n\t\t\t\t\tsizeof(inode->i_streams[0])));\n\t\t\tinode->i_streams = streams;\n\t\t}\n\t} else {\n\t\tstreams = REALLOC(inode->i_streams,\n\t\t\t\t  (inode->i_num_streams + 1) *\n\t\t\t\t\tsizeof(inode->i_streams[0]));\n\t\tif (!streams)\n\t\t\treturn NULL;\n\t\tinode->i_streams = streams;\n\t}\n\tnew_strm = &streams[inode->i_num_streams];\n\n\tmemset(new_strm, 0, sizeof(*new_strm));\n\n\tnew_strm->stream_type = stream_type;\n\tif (!*stream_name) {\n\t\t/* Unnamed stream  */\n\t\tnew_strm->stream_name = (utf16lechar *)NO_STREAM_NAME;\n\t} else {\n\t\t/* Named stream  */\n\t\tnew_strm->stream_name = utf16le_dup(stream_name);\n\t\tif (!new_strm->stream_name)\n\t\t\treturn NULL;\n\t}\n\n\tnew_strm->stream_id = inode->i_next_stream_id++;\n\n\tinode_set_stream_blob(inode, new_strm, blob);\n\n\tinode->i_num_streams++;\n\n\treturn new_strm;\n}\n\n/*\n * Replace the data of the specified stream.\n *\n * @inode\n *\tThe inode containing @strm\n * @strm\n *\tThe stream whose data needs to be replaced\n * @data\n *\tThe buffer of data to assign to the stream\n * @size\n *\tSize of the @data buffer, in bytes\n * @blob_table\n *\tPointer to the blob table in which data blobs are being indexed\n *\n * Returns true if successful; false with errno set if unsuccessful.\n */\nbool\ninode_replace_stream_data(struct wim_inode *inode,\n\t\t\t  struct wim_inode_stream *strm,\n\t\t\t  const void *data, size_t size,\n\t\t\t  struct blob_table *blob_table)\n{\n\tstruct blob_descriptor *new_blob = NULL;\n\n\tif (size) {\n\t\tnew_blob = new_blob_from_data_buffer(data, size, blob_table);\n\t\tif (!new_blob)\n\t\t\treturn false;\n\t}\n\n\tinode_replace_stream_blob(inode, strm, new_blob, blob_table);\n\treturn true;\n}\n\n/*\n * Add a new stream to the specified inode and assign it the specified data.\n *\n * @inode\n *\tThe inode to which to add the stream\n * @stream_type\n *\tThe type of the stream being added\n * @stream_name\n *\tThe name of the stream being added as a null-terminated UTF-16LE string,\n *\tor NO_STREAM_NAME if the stream is unnamed\n * @data\n *\tThe buffer of data to assign to the new stream\n * @size\n *\tSize of the @data buffer, in bytes\n * @blob_table\n *\tPointer to the blob table in which data blobs are being indexed\n *\n * Returns true if successful; false with errno set if unsuccessful.\n */\nbool\ninode_add_stream_with_data(struct wim_inode *inode,\n\t\t\t   int stream_type, const utf16lechar *stream_name,\n\t\t\t   const void *data, size_t size,\n\t\t\t   struct blob_table *blob_table)\n{\n\tstruct wim_inode_stream *strm;\n\tstruct blob_descriptor *blob = NULL;\n\n\tstrm = inode_add_stream(inode, stream_type, stream_name, NULL);\n\tif (!strm)\n\t\treturn false;\n\n\tif (size) {\n\t\tblob = new_blob_from_data_buffer(data, size, blob_table);\n\t\tif (unlikely(!blob)) {\n\t\t\tinode_remove_stream(inode, strm, blob_table);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tinode_set_stream_blob(inode, strm, blob);\n\treturn true;\n}\n\n/*\n * Remove a stream from the specified inode.\n *\n * This handles releasing the references to the blob descriptor, if any.\n */\nvoid\ninode_remove_stream(struct wim_inode *inode, struct wim_inode_stream *strm,\n\t\t    struct blob_table *blob_table)\n{\n\tunsigned idx = strm - inode->i_streams;\n\n\twimlib_assert(idx < inode->i_num_streams);\n\n\tinode_unset_stream_blob(inode, strm, blob_table);\n\n\tdestroy_stream(strm);\n\n\tmemmove(strm, strm + 1,\n\t\t(inode->i_num_streams - idx - 1) * sizeof(inode->i_streams[0]));\n\tinode->i_num_streams--;\n}\n\n/* Returns true iff the specified inode has at least one named data stream.  */\nbool\ninode_has_named_data_stream(const struct wim_inode *inode)\n{\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++)\n\t\tif (stream_is_named_data_stream(&inode->i_streams[i]))\n\t\t\treturn true;\n\treturn false;\n}\n\n/*\n * Resolve an inode's streams.\n *\n * For each stream, this replaces the SHA-1 message digest of the blob data with\n * a pointer to the 'struct blob_descriptor' for the blob.  Blob descriptors are\n * looked up in @table.\n *\n * If @force is %false:\n *\tIf any of the needed blobs do not exist in @table, return\n *\tWIMLIB_ERR_RESOURCE_NOT_FOUND.\n * If @force is %true:\n *\tIf any of the needed blobs do not exist in @table, allocate new blob\n *\tdescriptors for them and insert them into @table.  This does not, of\n *\tcourse, cause the data of these blobs to magically exist, but this is\n *\tneeded by the code for extraction from a pipe.\n *\n * Returns 0 on success; WIMLIB_ERR_NOMEM if out of memory; or\n * WIMLIB_ERR_RESOURCE_NOT_FOUND if @force is %false and at least one blob\n * referenced by the inode was missing.\n */\nint\ninode_resolve_streams(struct wim_inode *inode, struct blob_table *table,\n\t\t      bool force)\n{\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tstruct wim_inode_stream *strm = &inode->i_streams[i];\n\n\t\tif (strm->stream_resolved)\n\t\t\tcontinue;\n\n\t\tconst u8 *hash = stream_hash(strm);\n\t\tstruct blob_descriptor *blob = NULL;\n\n\t\tif (!is_zero_hash(hash)) {\n\t\t\tblob = lookup_blob(table, hash);\n\t\t\tif (!blob) {\n\t\t\t\tif (!force)\n\t\t\t\t\treturn blob_not_found_error(inode, hash);\n\t\t\t\tblob = new_blob_descriptor();\n\t\t\t\tif (!blob)\n\t\t\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\t\t\tcopy_hash(blob->hash, hash);\n\t\t\t\tblob_table_insert(table, blob);\n\t\t\t}\n\t\t}\n\t\tstrm->_stream_blob = blob;\n\t\tstrm->stream_resolved = 1;\n\t}\n\treturn 0;\n}\n\nint\nblob_not_found_error(const struct wim_inode *inode, const u8 *hash)\n{\n\tif (wimlib_print_errors) {\n\t\ttchar hashstr[SHA1_HASH_STRING_LEN];\n\n\t\tsprint_hash(hash, hashstr);\n\n\t\tERROR(\"\\\"%\"TS\"\\\": blob not found\\n\"\n\t\t      \"        SHA-1 message digest of missing blob:\\n\"\n\t\t      \"        %\"TS\"\",\n\t\t      inode_any_full_path(inode), hashstr);\n\t}\n\treturn WIMLIB_ERR_RESOURCE_NOT_FOUND;\n}\n\n/*\n * Return the blob descriptor for the specified stream, or NULL if the stream is\n * empty or its blob is not available in @table.\n */\nstruct blob_descriptor *\nstream_blob(const struct wim_inode_stream *strm, const struct blob_table *table)\n{\n\tif (strm->stream_resolved)\n\t\treturn strm->_stream_blob;\n\telse\n\t\treturn lookup_blob(table, strm->_stream_hash);\n}\n\n/*\n * Return the SHA-1 message digest of the data of the specified stream, or a\n * void SHA-1 of all zeroes if the specified stream is empty, or NULL if the\n * specified stream is unhashed.  (Most callers ensure the stream cannot be\n * unhashed.)\n */\nconst u8 *\nstream_hash(const struct wim_inode_stream *strm)\n{\n\tif (!strm->stream_resolved)\n\t\treturn strm->_stream_hash;\n\n\tif (!strm->_stream_blob)\n\t\treturn zero_hash;\n\n\tif (strm->_stream_blob->unhashed)\n\t\treturn NULL;\n\n\treturn strm->_stream_blob->hash;\n}\n\n/*\n * Return the blob descriptor for the unnamed data stream of the inode, or NULL\n * if the inode does not have an unnamed data stream, the inode's unnamed data\n * stream is empty, or the blob for the inode's unnamed data stream is not\n * available in @blob_table.\n */\nstruct blob_descriptor *\ninode_get_blob_for_unnamed_data_stream(const struct wim_inode *inode,\n\t\t\t\t       const struct blob_table *blob_table)\n{\n\tconst struct wim_inode_stream *strm;\n\n\tstrm = inode_get_unnamed_data_stream(inode);\n\tif (!strm)\n\t\treturn NULL;\n\n\treturn stream_blob(strm, blob_table);\n}\n\n/* Like inode_get_blob_for_unnamed_data_stream(), but assumes the unnamed data\n * stream is resolved.  */\nstruct blob_descriptor *\ninode_get_blob_for_unnamed_data_stream_resolved(const struct wim_inode *inode)\n{\n\tconst struct wim_inode_stream *strm;\n\n\tstrm = inode_get_unnamed_data_stream(inode);\n\tif (!strm)\n\t\treturn NULL;\n\n\treturn stream_blob_resolved(strm);\n}\n\n/*\n * Return the SHA-1 message digest of the unnamed data stream of the inode, or a\n * void SHA-1 of all zeroes if the inode does not have an unnamed data stream or\n * if the inode's unnamed data stream is empty, or NULL if the inode's unnamed\n * data stream is unhashed.  (Most callers ensure the stream cannot be\n * unhashed.)\n */\nconst u8 *\ninode_get_hash_of_unnamed_data_stream(const struct wim_inode *inode)\n{\n\tconst struct wim_inode_stream *strm;\n\n\tstrm = inode_get_unnamed_data_stream(inode);\n\tif (!strm)\n\t\treturn zero_hash;\n\n\treturn stream_hash(strm);\n}\n\n/* Acquire another reference to each blob referenced by this inode.  This is\n * necessary when creating a hard link to this inode.\n *\n * All streams of the inode must be resolved.  */\nvoid\ninode_ref_blobs(struct wim_inode *inode)\n{\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tstruct blob_descriptor *blob;\n\n\t\tblob = stream_blob_resolved(&inode->i_streams[i]);\n\t\tif (blob)\n\t\t\tblob->refcnt++;\n\t}\n}\n\n/* Release a reference to each blob referenced by this inode.  This is necessary\n * when deleting a hard link to this inode.  */\nvoid\ninode_unref_blobs(struct wim_inode *inode, struct blob_table *blob_table)\n{\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tstruct blob_descriptor *blob;\n\n\t\tblob = stream_blob(&inode->i_streams[i], blob_table);\n\t\tif (blob)\n\t\t\tblob_decrement_refcnt(blob, blob_table);\n\t}\n}\n\n/*\n * Given a blob descriptor, return a pointer to the pointer contained in the\n * stream that references it.\n *\n * This is only possible for \"unhashed\" blobs, which are guaranteed to have only\n * one referencing stream, and that reference is guaranteed to be in a resolved\n * stream.  (It can't be in an unresolved stream, since that would imply the\n * hash is known!)\n */\nstruct blob_descriptor **\nretrieve_pointer_to_unhashed_blob(struct blob_descriptor *blob)\n{\n\twimlib_assert(blob->unhashed);\n\n\tstruct wim_inode *inode = blob->back_inode;\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tif (inode->i_streams[i].stream_id == blob->back_stream_id) {\n\t\t\twimlib_assert(inode->i_streams[i]._stream_blob == blob);\n\t\t\treturn &inode->i_streams[i]._stream_blob;\n\t\t}\n\t}\n\n\twimlib_assert(0);\n\treturn NULL;\n}\n"
  },
  {
    "path": "src/wimlib/inode_fixup.c",
    "content": "/*\n * inode_fixup.c\n */\n\n/*\n * Copyright (C) 2012, 2013, 2014 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/dentry.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/inode.h\"\n#include \"wimlib/inode_table.h\"\n\nstruct inode_fixup_params {\n\tstruct wim_inode_table inode_table;\n\tunsigned long num_dir_hard_links;\n\tunsigned long num_inconsistent_inodes;\n};\n\n#define MAX_DIR_HARD_LINK_WARNINGS 8\n\nstatic bool\ninodes_consistent(const struct wim_inode *inode_1,\n\t\t  const struct wim_inode *inode_2)\n{\n\t/* This certainly isn't the only thing we need to check to make sure the\n\t * inodes are consistent.  However, this seems to be the only thing that\n\t * the MS implementation checks when working around its own bug.\n\t *\n\t * (Tested: If two dentries share the same hard link group ID, Windows\n\t * 8.1 DISM will link them if they have the same unnamed stream hash,\n\t * even if the dentries provide different timestamps, attributes,\n\t * alternate data streams, and security IDs!  And the one that gets used\n\t * will change if you merely swap the filenames.  But if you use\n\t * different unnamed stream hashes with everything else the same, it\n\t * doesn't link the dentries.)\n\t *\n\t * For non-buggy WIMs this function will always return true.  */\n\treturn hashes_equal(inode_get_hash_of_unnamed_data_stream(inode_1),\n\t\t\t    inode_get_hash_of_unnamed_data_stream(inode_2));\n}\n\nstatic int\ninode_table_insert(struct wim_dentry *dentry, void *_params)\n{\n\tstruct inode_fixup_params *params = _params;\n\tstruct wim_inode_table *table = &params->inode_table;\n\tstruct wim_inode *d_inode = dentry->d_inode;\n\tsize_t pos;\n\tstruct wim_inode *inode;\n\n\tif (d_inode->i_ino == 0) {\n\t\thlist_add_head(&d_inode->i_hlist_node, &table->extra_inodes);\n\t\treturn 0;\n\t}\n\n\t/* Try adding this dentry to an existing inode.  */\n\tpos = hash_inode(table, d_inode->i_ino, 0);\n\thlist_for_each_entry(inode, &table->array[pos], i_hlist_node) {\n\t\tif (inode->i_ino != d_inode->i_ino) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (unlikely(!inodes_consistent(inode, d_inode))) {\n\t\t\tparams->num_inconsistent_inodes++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (unlikely((d_inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) ||\n\t\t\t     (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY)))\n\t\t{\n\t\t\tparams->num_dir_hard_links++;\n\t\t\tif (params->num_dir_hard_links <=\n\t\t\t    MAX_DIR_HARD_LINK_WARNINGS)\n\t\t\t{\n\t\t\t\tWARNING(\"Unsupported directory hard link \"\n\t\t\t\t\t\"\\\"%\"TS\"\\\" <=> \\\"%\"TS\"\\\"\",\n\t\t\t\t\tdentry_full_path(dentry),\n\t\t\t\t\tinode_any_full_path(inode));\n\t\t\t} else if (params->num_dir_hard_links ==\n\t\t\t\t   MAX_DIR_HARD_LINK_WARNINGS + 1)\n\t\t\t{\n\t\t\t\tWARNING(\"Suppressing additional warnings about \"\n\t\t\t\t\t\"directory hard links...\");\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\t/* Transfer this dentry to the existing inode.  */\n\t\td_disassociate(dentry);\n\t\td_associate(dentry, inode);\n\t\treturn 0;\n\t}\n\n\t/* Keep this dentry's inode.  */\n\thlist_add_head(&d_inode->i_hlist_node, &table->array[pos]);\n\tif (++table->filled > table->capacity)\n\t\tenlarge_inode_table(table);\n\treturn 0;\n}\n\nstatic void\nhlist_move_all(struct hlist_head *src, struct hlist_head *dest)\n{\n\tstruct hlist_node *node;\n\n\twhile ((node = src->first) != NULL) {\n\t\thlist_del(node);\n\t\thlist_add_head(node, dest);\n\t}\n}\n\n/* Move the inodes from the 'struct wim_inode_table' to the 'inode_list'.  */\nstatic void\nbuild_inode_list(struct wim_inode_table *inode_table,\n\t\t struct hlist_head *inode_list)\n{\n\thlist_move_all(&inode_table->extra_inodes, inode_list);\n\tfor (size_t i = 0; i < inode_table->capacity; i++)\n\t\thlist_move_all(&inode_table->array[i], inode_list);\n}\n\n/* Re-assign inode numbers to the inodes in the list.  */\nstatic void\nreassign_inode_numbers(struct hlist_head *inode_list)\n{\n\tstruct wim_inode *inode;\n\tu64 cur_ino = 1;\n\n\thlist_for_each_entry(inode, inode_list, i_hlist_node)\n\t\tinode->i_ino = cur_ino++;\n}\n\n/*\n * Given a WIM image's tree of dentries such that each dentry initially\n * has a unique inode associated with it, determine the actual\n * dentry/inode information.  Following this, a single inode may be named\n * by more than one dentry (usually called a hard link).\n *\n * The 'hard_link_group_id' field of the on-disk WIM dentry, which we\n * have read into 'i_ino' of each dentry's initial inode, determines\n * which dentries share the same inode.  Ideally, dentries share the same\n * inode if and only if they have the same value in this field.  However,\n * exceptions apply:\n *\n * - If 'hard_link_group_id' is 0, the corresponding dentry is the sole\n *   name for its inode.\n * - Due to bugs in the Microsoft implementation, dentries with different\n *   'hard_link_group_id' fields may, in fact, need to be interpreted as\n *   naming different inodes.  This seems to mostly affect images in\n *   install.wim for Windows 7.  I try to work around this in the same way\n *   the Microsoft implementation works around this.\n *\n * Returns 0 or WIMLIB_ERR_NOMEM.  On success, the resulting inodes will be\n * appended to the @inode_list, and they will have consistent numbers in their\n * i_ino fields.\n */\nint\ndentry_tree_fix_inodes(struct wim_dentry *root, struct hlist_head *inode_list)\n{\n\tstruct inode_fixup_params params;\n\tint ret;\n\n\t/* We use a hash table to map inode numbers to inodes.  */\n\n\tret = init_inode_table(&params.inode_table, 64);\n\tif (ret)\n\t\treturn ret;\n\n\tparams.num_dir_hard_links = 0;\n\tparams.num_inconsistent_inodes = 0;\n\n\tfor_dentry_in_tree(root, inode_table_insert, &params);\n\n\t/* Generate the resulting list of inodes, and if needed reassign\n\t * the inode numbers.  */\n\tbuild_inode_list(&params.inode_table, inode_list);\n\tdestroy_inode_table(&params.inode_table);\n\n\tif (unlikely(params.num_dir_hard_links))\n\t\tWARNING(\"Ignoring %lu directory hard links\",\n\t\t\tparams.num_dir_hard_links);\n\n\tif (unlikely(params.num_inconsistent_inodes ||\n\t\t     params.num_dir_hard_links))\n\t\treassign_inode_numbers(inode_list);\n\treturn 0;\n}\n"
  },
  {
    "path": "src/wimlib/inode_table.c",
    "content": "/*\n * inode_table.c - hard link detection\n */\n\n/*\n * Copyright (C) 2012-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/bitops.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/inode.h\"\n#include \"wimlib/inode_table.h\"\n#include \"wimlib/list.h\"\n#include \"wimlib/util.h\"\n\n/* Initialize a hash table for hard link detection.  */\nint\ninit_inode_table(struct wim_inode_table *table, size_t capacity)\n{\n\tcapacity = roundup_pow_of_2(capacity);\n\ttable->array = CALLOC(capacity, sizeof(table->array[0]));\n\tif (!table->array)\n\t\treturn WIMLIB_ERR_NOMEM;\n\ttable->filled = 0;\n\ttable->capacity = capacity;\n\tINIT_HLIST_HEAD(&table->extra_inodes);\n\treturn 0;\n}\n\n/* Free the memory allocated by init_inode_table().  */\nvoid\ndestroy_inode_table(struct wim_inode_table *table)\n{\n\tFREE(table->array);\n}\n\n/* Double the capacity of the inode hash table.  */\nvoid\nenlarge_inode_table(struct wim_inode_table *table)\n{\n\tconst size_t old_capacity = table->capacity;\n\tconst size_t new_capacity = old_capacity * 2;\n\tstruct hlist_head *old_array = table->array;\n\tstruct hlist_head *new_array;\n\tstruct wim_inode *inode;\n\tstruct hlist_node *tmp;\n\n\tnew_array = CALLOC(new_capacity, sizeof(struct hlist_head));\n\tif (!new_array)\n\t\treturn;\n\ttable->array = new_array;\n\ttable->capacity = new_capacity;\n\tfor (size_t i = 0; i < old_capacity; i++) {\n\t\thlist_for_each_entry_safe(inode, tmp, &old_array[i], i_hlist_node) {\n\t\t\thlist_add_head(&inode->i_hlist_node,\n\t\t\t\t       &new_array[hash_inode(table, inode->i_ino,\n\t\t\t\t\t\t\t     inode->i_devno)]);\n\t\t}\n\t}\n\tFREE(old_array);\n}\n\n/*\n * Allocate a new dentry, with hard link detection.\n *\n * @table\n *\tThe inode table being used for the current directory scan operation.  It\n *\twill contain the mapping from (ino, devno) pairs to inodes.\n *\n * @name\n *\tThe name to give the new dentry.\n *\n * @ino\n *\tThe inode number of the file, read from the filesystem.\n *\n * @devno\n *\tThe device number of the file, read from the filesystem.  Proper setting\n *\tof this parameter prevents cross-device hardlinks from being created.\n *\tIf this is not a problem (perhaps because the current directory scan\n *\toperation is guaranteed to never traverse a filesystem boundary), then\n *\tthis parameter can just be a fixed value such as 0.\n *\n * @noshare\n *\tIf %true, the new dentry will not be hard linked to any existing inode,\n *\tregardless of the values of @ino and @devno.  If %false, normal hard\n *\tlink detection will be done.\n *\n * @dentry_ret\n *\tOn success, a pointer to the new dentry will be returned in this\n *\tlocation.  If i_nlink of the dentry's inode is greater than 1, then this\n *\tfunction created a hard link to an existing inode rather than creating a\n *\tnew inode.\n *\n * On success, returns 0.  On failure, returns WIMLIB_ERR_NOMEM or an error code\n * resulting from a failed string conversion.\n */\nint\ninode_table_new_dentry(struct wim_inode_table *table, const tchar *name,\n\t\t       u64 ino, u64 devno, bool noshare,\n\t\t       struct wim_dentry **dentry_ret)\n{\n\tstruct wim_dentry *dentry;\n\tstruct wim_inode *inode;\n\tstruct hlist_head *list;\n\tint ret;\n\n\tif (noshare) {\n\t\t/* No hard link detection  */\n\t\tlist = &table->extra_inodes;\n\t} else {\n\t\t/* Hard link detection  */\n\t\tlist = &table->array[hash_inode(table, ino, devno)];\n\t\thlist_for_each_entry(inode, list, i_hlist_node) {\n\t\t\tif (inode->i_ino != ino || inode->i_devno != devno)\n\t\t\t\tcontinue;\n\t\t\tif (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) {\n\t\t\t\tWARNING(\"Not honoring directory hard link \"\n\t\t\t\t\t\"of \\\"%\"TS\"\\\"\",\n\t\t\t\t\tinode_any_full_path(inode));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t/* Inode found; use it.  */\n\t\t\treturn new_dentry_with_existing_inode(name, inode,\n\t\t\t\t\t\t\t      dentry_ret);\n\t\t}\n\n\t\t/* Inode not found; create it.  */\n\t}\n\n\tret = new_dentry_with_new_inode(name, false, &dentry);\n\tif (ret)\n\t\treturn ret;\n\tinode = dentry->d_inode;\n\tinode->i_ino = ino;\n\tinode->i_devno = devno;\n\thlist_add_head(&inode->i_hlist_node, list);\n\tif (list != &table->extra_inodes)\n\t\tif (++table->filled > table->capacity)\n\t\t\tenlarge_inode_table(table);\n\t*dentry_ret = dentry;\n\treturn 0;\n}\n\n/*\n * Following the allocation of dentries with hard link detection using\n * inode_table_new_dentry(), this function will assign consecutive inode numbers\n * to the new set of inodes.  It will also append the list of new inodes to the\n * list @head, which must contain any inodes already existing in the WIM image.\n */\nvoid\ninode_table_prepare_inode_list(struct wim_inode_table *table,\n\t\t\t       struct hlist_head *head)\n{\n\tstruct wim_inode *inode;\n\tstruct hlist_node *tmp;\n\tu64 cur_ino = 1;\n\n\t/* Re-assign inode numbers in the existing list to avoid duplicates. */\n\thlist_for_each_entry(inode, head, i_hlist_node)\n\t\tinode->i_ino = cur_ino++;\n\n\t/* Assign inode numbers to the new inodes and move them to the image's\n\t * inode list. */\n\tfor (size_t i = 0; i < table->capacity; i++) {\n\t\thlist_for_each_entry_safe(inode, tmp, &table->array[i], i_hlist_node) {\n\t\t\tinode->i_ino = cur_ino++;\n\t\t\thlist_add_head(&inode->i_hlist_node, head);\n\t\t}\n\t}\n\thlist_for_each_entry_safe(inode, tmp, &table->extra_inodes, i_hlist_node) {\n\t\tinode->i_ino = cur_ino++;\n\t\thlist_add_head(&inode->i_hlist_node, head);\n\t}\n}\n"
  },
  {
    "path": "src/wimlib/integrity.c",
    "content": "/*\n * integrity.c\n *\n * WIM files can optionally contain a table of SHA1 message digests at the end,\n * one digest for each chunk of the file of some specified size (often 10 MB).\n * This file implements the checking and writing of this table.\n */\n\n/*\n * Copyright (C) 2012-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/file_io.h\"\n#include \"wimlib/integrity.h\"\n#include \"wimlib/progress.h\"\n#include \"wimlib/resource.h\"\n#include \"wimlib/sha1.h\"\n#include \"wimlib/wim.h\"\n#include \"wimlib/write.h\"\n\n/* Size, in bytes, of each SHA1-summed chunk, when wimlib writes integrity\n * information. */\n#define INTEGRITY_CHUNK_SIZE 10485760\n\n/* Only use a different chunk size for compatibility with an existing integrity\n * table if the chunk size is between these two numbers. */\n#define INTEGRITY_MIN_CHUNK_SIZE 4096\n#define INTEGRITY_MAX_CHUNK_SIZE 134217728\n\nPRAGMA_BEGIN_PACKED\nstruct integrity_table {\n\tu32 size;\n\tu32 num_entries;\n\tu32 chunk_size;\n\tu8  sha1sums[][20];\n} __attribute__((packed));\nPRAGMA_END_PACKED\n\nstatic int\ncalculate_chunk_sha1(struct filedes *in_fd, size_t this_chunk_size,\n\t\t     off_t offset, u8 sha1_md[])\n{\n\tu8 buf[BUFFER_SIZE];\n\tstruct sha1_ctx ctx;\n\tsize_t bytes_remaining;\n\tsize_t bytes_to_read;\n\tint ret;\n\n\tbytes_remaining = this_chunk_size;\n\tsha1_init(&ctx);\n\tdo {\n\t\tbytes_to_read = min(bytes_remaining, sizeof(buf));\n\t\tret = full_pread(in_fd, buf, bytes_to_read, offset);\n\t\tif (ret) {\n\t\t\tERROR_WITH_ERRNO(\"Read error while calculating \"\n\t\t\t\t\t \"integrity checksums\");\n\t\t\treturn ret;\n\t\t}\n\t\t// I have no idea what Coverity is hallucinating with here...\n\t\t// coverity[overrun-call]\n\t\tsha1_update(&ctx, buf, bytes_to_read);\n\t\tbytes_remaining -= bytes_to_read;\n\t\toffset += bytes_to_read;\n\t} while (bytes_remaining);\n\tsha1_final(&ctx, sha1_md);\n\treturn 0;\n}\n\n\n/*\n * read_integrity_table: -  Reads the integrity table from a WIM file.\n *\n * @wim:\n *\tWIMStruct for the WIM file; @wim->hdr.integrity_table_reshdr specifies\n *\tthe location of the integrity table.  @wim->in_fd is expected to be a\n *\tseekable file descriptor to the WIM file opened for reading.\n *\n * @num_checked_bytes:\n *\tNumber of bytes of data that should be checked by the integrity table.\n *\n * @table_ret:\n *\tOn success, a pointer to an in-memory structure containing the integrity\n *\tinformation is written to this location.\n *\n * Return values:\n *\tWIMLIB_ERR_SUCCESS (0)\n *\tWIMLIB_ERR_INVALID_INTEGRITY_TABLE\n *\tWIMLIB_ERR_NOMEM\n *\tWIMLIB_ERR_READ\n *\tWIMLIB_ERR_UNEXPECTED_END_OF_FILE\n */\nint\nread_integrity_table(WIMStruct *wim, u64 num_checked_bytes,\n\t\t     struct integrity_table **table_ret)\n{\n\tvoid *buf;\n\tstruct integrity_table *table;\n\tint ret;\n\n\tSTATIC_ASSERT(sizeof(struct integrity_table) == 12);\n\tif (wim->hdr.integrity_table_reshdr.uncompressed_size < 12)\n\t\treturn WIMLIB_ERR_INVALID_INTEGRITY_TABLE;\n\n\tret = wim_reshdr_to_data(&wim->hdr.integrity_table_reshdr, wim, &buf);\n\tif (ret)\n\t\treturn ret;\n\ttable = buf;\n\n\ttable->size        = le32_to_cpu((_force_attr le32)table->size);\n\ttable->num_entries = le32_to_cpu((_force_attr le32)table->num_entries);\n\ttable->chunk_size  = le32_to_cpu((_force_attr le32)table->chunk_size);\n\n\tif (table->size != wim->hdr.integrity_table_reshdr.uncompressed_size ||\n\t    table->size != (u64)table->num_entries * SHA1_HASH_SIZE + 12 ||\n\t    table->chunk_size == 0 ||\n\t    table->num_entries != DIV_ROUND_UP(num_checked_bytes, table->chunk_size))\n\t{\n\t\tFREE(table);\n\t\treturn WIMLIB_ERR_INVALID_INTEGRITY_TABLE;\n\t}\n\n\t*table_ret = table;\n\treturn 0;\n}\n\n/*\n * calculate_integrity_table():\n *\n * Calculates an integrity table for the data in a file beginning at offset 208\n * (WIM_HEADER_DISK_SIZE).\n *\n * @in_fd:\n *\tFile descriptor for the file to be checked, opened for reading.  Does\n *\tnot need to be at any specific location in the file.\n *\n * @new_check_end:\n *\tOffset of byte after the last byte to be checked.\n *\n * @old_table:\n *\tIf non-NULL, a pointer to the table containing the previously calculated\n *\tintegrity data for a prefix of this file.\n *\n * @old_check_end:\n *\tIf @old_table is non-NULL, the byte after the last byte that was checked\n *\tin the old table.  Must be less than or equal to new_check_end.\n *\n * @integrity_table_ret:\n *\tOn success, a pointer to the calculated integrity table is written into\n *\tthis location.\n *\n * Return values:\n *\tWIMLIB_ERR_SUCCESS (0)\n *\tWIMLIB_ERR_NOMEM\n *\tWIMLIB_ERR_READ\n *\tWIMLIB_ERR_UNEXPECTED_END_OF_FILE\n */\nstatic int\ncalculate_integrity_table(struct filedes *in_fd,\n\t\t\t  off_t new_check_end,\n\t\t\t  const struct integrity_table *old_table,\n\t\t\t  off_t old_check_end,\n\t\t\t  struct integrity_table **integrity_table_ret,\n\t\t\t  wimlib_progress_func_t progfunc,\n\t\t\t  void *progctx)\n{\n\tint ret;\n\tsize_t chunk_size = INTEGRITY_CHUNK_SIZE;\n\n\t/* If an old table is provided, set the chunk size to be compatible with\n\t * the old chunk size, unless the old chunk size was weird. */\n\tif (old_table != NULL) {\n\t\tif (old_table->num_entries == 0 ||\n\t\t    old_table->chunk_size < INTEGRITY_MIN_CHUNK_SIZE ||\n\t\t    old_table->chunk_size > INTEGRITY_MAX_CHUNK_SIZE)\n\t\t\told_table = NULL;\n\t\telse\n\t\t\tchunk_size = old_table->chunk_size;\n\t}\n\n\n\tu64 old_check_bytes = old_check_end - WIM_HEADER_DISK_SIZE;\n\tu64 new_check_bytes = new_check_end - WIM_HEADER_DISK_SIZE;\n\n\tu32 old_num_chunks = DIV_ROUND_UP(old_check_bytes, chunk_size);\n\tu32 new_num_chunks = DIV_ROUND_UP(new_check_bytes, chunk_size);\n\n\tsize_t old_last_chunk_size = MODULO_NONZERO(old_check_bytes, chunk_size);\n\tsize_t new_last_chunk_size = MODULO_NONZERO(new_check_bytes, chunk_size);\n\n\tsize_t new_table_size = 12 + new_num_chunks * SHA1_HASH_SIZE;\n\n\tstruct integrity_table *new_table = MALLOC(new_table_size);\n\tif (!new_table)\n\t\treturn WIMLIB_ERR_NOMEM;\n\tnew_table->num_entries = new_num_chunks;\n\tnew_table->size = new_table_size;\n\tnew_table->chunk_size = chunk_size;\n\n\tu64 offset = WIM_HEADER_DISK_SIZE;\n\tunion wimlib_progress_info progress;\n\n\tprogress.integrity.total_bytes      = new_check_bytes;\n\tprogress.integrity.total_chunks     = new_num_chunks;\n\tprogress.integrity.completed_chunks = 0;\n\tprogress.integrity.completed_bytes  = 0;\n\tprogress.integrity.chunk_size       = chunk_size;\n\tprogress.integrity.filename         = NULL;\n\n\tret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_CALC_INTEGRITY,\n\t\t\t    &progress, progctx);\n\tif (ret)\n\t\tgoto out_free_new_table;\n\n\tfor (u32 i = 0; i < new_num_chunks; i++) {\n\t\tsize_t this_chunk_size;\n\t\tif (i == new_num_chunks - 1)\n\t\t\tthis_chunk_size = new_last_chunk_size;\n\t\telse\n\t\t\tthis_chunk_size = chunk_size;\n\t\tif (old_table &&\n\t\t    ((this_chunk_size == chunk_size && i < old_num_chunks - 1) ||\n\t\t      (i == old_num_chunks - 1 && this_chunk_size == old_last_chunk_size)))\n\t\t{\n\t\t\t/* Can use SHA1 message digest from old integrity table\n\t\t\t * */\n\t\t\tcopy_hash(new_table->sha1sums[i], old_table->sha1sums[i]);\n\t\t} else {\n\t\t\t/* Calculate the SHA1 message digest of this chunk */\n\t\t\tret = calculate_chunk_sha1(in_fd, this_chunk_size,\n\t\t\t\t\t\t   offset, new_table->sha1sums[i]);\n\t\t\tif (ret)\n\t\t\t\tgoto out_free_new_table;\n\t\t}\n\t\toffset += this_chunk_size;\n\n\t\tprogress.integrity.completed_chunks++;\n\t\tprogress.integrity.completed_bytes += this_chunk_size;\n\t\tret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_CALC_INTEGRITY,\n\t\t\t\t    &progress, progctx);\n\t\tif (ret)\n\t\t\tgoto out_free_new_table;\n\t}\n\t*integrity_table_ret = new_table;\n\treturn 0;\n\nout_free_new_table:\n\tFREE(new_table);\n\treturn ret;\n}\n\n/*\n * write_integrity_table():\n *\n * Writes a WIM integrity table (a list of SHA1 message digests of raw 10 MiB\n * chunks of the file).\n *\n * This function can optionally re-use entries from an older integrity table.\n * To do this, specify old_blob_table_end and old_table.\n *\n * On success, @wim->out_hdr.integrity_table_reshdr will be filled in with\n * information about the integrity table that was written.\n *\n * @wim:\n *\tWIMStruct for the WIM file.  @wim->out_fd must be a seekable descriptor\n *\tto the new WIM file, opened read-write, positioned at the location at\n *\twhich the integrity table is to be written.\n *\n * @new_blob_table_end:\n *\tThe offset of the byte directly following the blob table in the WIM\n *\tbeing written.\n *\n * @old_blob_table_end:\n *\tIf nonzero, the offset of the byte directly following the old blob table\n *\tin the WIM.\n *\n * @old_table\n *\tPointer to the old integrity table read into memory, or NULL if not\n *\tspecified.\n */\nint\nwrite_integrity_table(WIMStruct *wim,\n\t\t      off_t new_blob_table_end,\n\t\t      off_t old_blob_table_end,\n\t\t      struct integrity_table *old_table)\n{\n\tstruct integrity_table *new_table;\n\tint ret;\n\tu32 new_table_size;\n\n\twimlib_assert(old_blob_table_end <= new_blob_table_end);\n\n\tret = calculate_integrity_table(&wim->out_fd, new_blob_table_end,\n\t\t\t\t\told_table, old_blob_table_end,\n\t\t\t\t\t&new_table, wim->progfunc, wim->progctx);\n\tif (ret)\n\t\treturn ret;\n\n\tnew_table_size = new_table->size;\n\n\tnew_table->size        = (_force_attr u32)cpu_to_le32(new_table->size);\n\tnew_table->num_entries = (_force_attr u32)cpu_to_le32(new_table->num_entries);\n\tnew_table->chunk_size  = (_force_attr u32)cpu_to_le32(new_table->chunk_size);\n\n\tret = write_wim_resource_from_buffer(new_table,\n\t\t\t\t\t     new_table_size,\n\t\t\t\t\t     false,\n\t\t\t\t\t     &wim->out_fd,\n\t\t\t\t\t     WIMLIB_COMPRESSION_TYPE_NONE,\n\t\t\t\t\t     0,\n\t\t\t\t\t     &wim->out_hdr.integrity_table_reshdr,\n\t\t\t\t\t     NULL,\n\t\t\t\t\t     0);\n\tFREE(new_table);\n\treturn ret;\n}\n\n/*\n * verify_integrity():\n *\n * Checks a WIM for consistency with the integrity table.\n *\n * @in_fd:\n *\tFile descriptor to the WIM file, opened for reading.\n *\n * @table:\n *\tThe integrity table for the WIM, read into memory.\n *\n * @bytes_to_check:\n *\tNumber of bytes in the WIM that need to be checked (offset of end of the\n *\tblob table minus offset of end of the header).\n *\n * Returns:\n *\t> 0 (WIMLIB_ERR_READ, WIMLIB_ERR_UNEXPECTED_END_OF_FILE) on error\n *\t0 (WIM_INTEGRITY_OK) if the integrity was checked successfully and there\n *\twere no inconsistencies.\n *\t-1 (WIM_INTEGRITY_NOT_OK) if the WIM failed the integrity check.\n */\nstatic int\nverify_integrity(struct filedes *in_fd, const tchar *filename,\n\t\t const struct integrity_table *table,\n\t\t u64 bytes_to_check,\n\t\t wimlib_progress_func_t progfunc, void *progctx)\n{\n\tint ret;\n\tu64 offset = WIM_HEADER_DISK_SIZE;\n\tu8 sha1_md[SHA1_HASH_SIZE];\n\tunion wimlib_progress_info progress;\n\n\tprogress.integrity.total_bytes      = bytes_to_check;\n\tprogress.integrity.total_chunks     = table->num_entries;\n\tprogress.integrity.completed_chunks = 0;\n\tprogress.integrity.completed_bytes  = 0;\n\tprogress.integrity.chunk_size       = table->chunk_size;\n\tprogress.integrity.filename         = filename;\n\n\tret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY,\n\t\t\t    &progress, progctx);\n\tif (ret)\n\t\treturn ret;\n\n\tfor (u32 i = 0; i < table->num_entries; i++) {\n\t\tsize_t this_chunk_size;\n\t\tif (i == table->num_entries - 1)\n\t\t\tthis_chunk_size = MODULO_NONZERO(bytes_to_check,\n\t\t\t\t\t\t\t table->chunk_size);\n\t\telse\n\t\t\tthis_chunk_size = table->chunk_size;\n\n\t\tret = calculate_chunk_sha1(in_fd, this_chunk_size, offset, sha1_md);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tif (!hashes_equal(sha1_md, table->sha1sums[i]))\n\t\t\treturn WIM_INTEGRITY_NOT_OK;\n\n\t\toffset += this_chunk_size;\n\t\tprogress.integrity.completed_chunks++;\n\t\tprogress.integrity.completed_bytes += this_chunk_size;\n\n\t\tret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY,\n\t\t\t\t    &progress, progctx);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn WIM_INTEGRITY_OK;\n}\n\n\n/*\n * check_wim_integrity():\n *\n * Verifies the integrity of the WIM by making sure the SHA1 message digests of\n * ~10 MiB chunks of the WIM match up with the values given in the integrity\n * table.\n *\n * @wim:\n *\tThe WIM, opened for reading.\n *\n * Returns:\n *\t> 0 (WIMLIB_ERR_INVALID_INTEGRITY_TABLE, WIMLIB_ERR_READ,\n *\t     WIMLIB_ERR_UNEXPECTED_END_OF_FILE) on error\n *\t0 (WIM_INTEGRITY_OK) if the integrity was checked successfully and there\n *\twere no inconsistencies.\n *\t-1 (WIM_INTEGRITY_NOT_OK) if the WIM failed the integrity check.\n *\t-2 (WIM_INTEGRITY_NONEXISTENT) if the WIM contains no integrity\n *\tinformation.\n */\nint\ncheck_wim_integrity(WIMStruct *wim)\n{\n\tint ret;\n\tu64 bytes_to_check;\n\tstruct integrity_table *table;\n\tu64 end_blob_table_offset;\n\n\tif (!wim_has_integrity_table(wim))\n\t\treturn WIM_INTEGRITY_NONEXISTENT;\n\n\tend_blob_table_offset = wim->hdr.blob_table_reshdr.offset_in_wim +\n\t\t\t\twim->hdr.blob_table_reshdr.size_in_wim;\n\n\tif (end_blob_table_offset < WIM_HEADER_DISK_SIZE) {\n\t\tERROR(\"WIM blob table ends before WIM header ends!\");\n\t\treturn WIMLIB_ERR_INVALID_INTEGRITY_TABLE;\n\t}\n\n\tbytes_to_check = end_blob_table_offset - WIM_HEADER_DISK_SIZE;\n\n\tret = read_integrity_table(wim, bytes_to_check, &table);\n\tif (ret)\n\t\treturn ret;\n\tret = verify_integrity(&wim->in_fd, wim->filename, table,\n\t\t\t       bytes_to_check, wim->progfunc, wim->progctx);\n\tFREE(table);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/wimlib/iterate_dir.c",
    "content": "/*\n * iterate_dir.c\n *\n * Iterate through files in a WIM image.\n * This is the stable API; internal code can just use for_dentry_in_tree().\n */\n\n/*\n * Copyright (C) 2013-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/object_id.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/security.h\"\n#include \"wimlib/timestamp.h\"\n#include \"wimlib/unix_data.h\"\n#include \"wimlib/util.h\"\n#include \"wimlib/wim.h\"\n\nstatic int\nstream_to_wimlib_stream_entry(const struct wim_inode *inode,\n\t\t\t      const struct wim_inode_stream *strm,\n\t\t\t      struct wimlib_stream_entry *wstream,\n\t\t\t      const struct blob_table *blob_table,\n\t\t\t      int flags)\n{\n\tconst struct blob_descriptor *blob;\n\tconst u8 *hash;\n\n\tif (stream_is_named(strm)) {\n\t\tint ret;\n\n\t\tret = utf16le_get_tstr(strm->stream_name,\n\t\t\t\t       utf16le_len_bytes(strm->stream_name),\n\t\t\t\t       &wstream->stream_name, NULL);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tblob = stream_blob(strm, blob_table);\n\tif (blob) {\n\t\tblob_to_wimlib_resource_entry(blob, &wstream->resource);\n\t} else if (!is_zero_hash((hash = stream_hash(strm)))) {\n\t\tif (flags & WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED)\n\t\t\treturn blob_not_found_error(inode, hash);\n\t\tcopy_hash(wstream->resource.sha1_hash, hash);\n\t\twstream->resource.is_missing = 1;\n\t}\n\treturn 0;\n}\n\nstatic int\nget_default_stream_type(const struct wim_inode *inode)\n{\n\tif (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED)\n\t\treturn STREAM_TYPE_EFSRPC_RAW_DATA;\n\tif (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT)\n\t\treturn STREAM_TYPE_REPARSE_POINT;\n\treturn STREAM_TYPE_DATA;\n}\n\nstatic int\ninit_wimlib_dentry(struct wimlib_dir_entry *wdentry, struct wim_dentry *dentry,\n\t\t   WIMStruct *wim, int flags)\n{\n\tint ret;\n\tconst struct wim_inode *inode = dentry->d_inode;\n\tconst struct wim_inode_stream *strm;\n\tstruct wimlib_unix_data unix_data;\n\tconst void *object_id;\n\tu32 object_id_len;\n\n\tret = utf16le_get_tstr(dentry->d_name, dentry->d_name_nbytes,\n\t\t\t       &wdentry->filename, NULL);\n\tif (ret)\n\t\treturn ret;\n\n\tret = utf16le_get_tstr(dentry->d_short_name, dentry->d_short_name_nbytes,\n\t\t\t       &wdentry->dos_name, NULL);\n\tif (ret)\n\t\treturn ret;\n\n\tret = calculate_dentry_full_path(dentry);\n\tif (ret)\n\t\treturn ret;\n\twdentry->full_path = dentry->d_full_path;\n\n\tfor (struct wim_dentry *d = dentry; !dentry_is_root(d); d = d->d_parent)\n\t\twdentry->depth++;\n\n\tif (inode_has_security_descriptor(inode)) {\n\t\tstruct wim_security_data *sd;\n\n\t\tsd = wim_get_current_security_data(wim);\n\t\twdentry->security_descriptor = sd->descriptors[inode->i_security_id];\n\t\twdentry->security_descriptor_size = sd->sizes[inode->i_security_id];\n\t}\n\twdentry->reparse_tag = inode->i_reparse_tag;\n\twdentry->num_links = inode->i_nlink;\n\twdentry->attributes = inode->i_attributes;\n\twdentry->hard_link_group_id = inode->i_ino;\n\n\twim_timestamp_to_wimlib_timespec(inode->i_creation_time,\n\t\t\t\t\t &wdentry->creation_time,\n\t\t\t\t\t &wdentry->creation_time_high);\n\n\twim_timestamp_to_wimlib_timespec(inode->i_last_write_time,\n\t\t\t\t\t &wdentry->last_write_time,\n\t\t\t\t\t &wdentry->last_write_time_high);\n\n\twim_timestamp_to_wimlib_timespec(inode->i_last_access_time,\n\t\t\t\t\t &wdentry->last_access_time,\n\t\t\t\t\t &wdentry->last_access_time_high);\n\n\tif (inode_get_unix_data(inode, &unix_data)) {\n\t\twdentry->unix_uid = unix_data.uid;\n\t\twdentry->unix_gid = unix_data.gid;\n\t\twdentry->unix_mode = unix_data.mode;\n\t\twdentry->unix_rdev = unix_data.rdev;\n\t}\n\tobject_id = inode_get_object_id(inode, &object_id_len);\n\tif (unlikely(object_id != NULL)) {\n\t\tmemcpy(&wdentry->object_id, object_id,\n\t\t       min(object_id_len, sizeof(wdentry->object_id)));\n\t}\n\n\tstrm = inode_get_unnamed_stream(inode, get_default_stream_type(inode));\n\tif (strm) {\n\t\tret = stream_to_wimlib_stream_entry(inode, strm,\n\t\t\t\t\t\t    &wdentry->streams[0],\n\t\t\t\t\t\t    wim->blob_table, flags);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\n\t\tstrm = &inode->i_streams[i];\n\n\t\tif (!stream_is_named_data_stream(strm))\n\t\t\tcontinue;\n\n\t\twdentry->num_named_streams++;\n\n\t\tret = stream_to_wimlib_stream_entry(inode, strm,\n\t\t\t\t\t\t    &wdentry->streams[\n\t\t\t\t\t\t\twdentry->num_named_streams],\n\t\t\t\t\t\t    wim->blob_table, flags);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nstatic void\nfree_wimlib_dentry(struct wimlib_dir_entry *wdentry)\n{\n\tutf16le_put_tstr(wdentry->filename);\n\tutf16le_put_tstr(wdentry->dos_name);\n\tfor (unsigned i = 1; i <= wdentry->num_named_streams; i++)\n\t\tutf16le_put_tstr(wdentry->streams[i].stream_name);\n\tFREE(wdentry);\n}\n\nstatic int\ndo_iterate_dir_tree(WIMStruct *wim,\n\t\t    struct wim_dentry *dentry, int flags,\n\t\t    wimlib_iterate_dir_tree_callback_t cb,\n\t\t    void *user_ctx)\n{\n\tstruct wimlib_dir_entry *wdentry;\n\tint ret = WIMLIB_ERR_NOMEM;\n\n\n\twdentry = CALLOC(1, sizeof(struct wimlib_dir_entry) +\n\t\t\t\t  (1 + dentry->d_inode->i_num_streams) *\n\t\t\t\t\tsizeof(struct wimlib_stream_entry));\n\tif (wdentry == NULL)\n\t\tgoto out;\n\n\tret = init_wimlib_dentry(wdentry, dentry, wim, flags);\n\tif (ret)\n\t\tgoto out_free_wimlib_dentry;\n\n\tif (!(flags & WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN)) {\n\t\tret = (*cb)(wdentry, user_ctx);\n\t\tif (ret)\n\t\t\tgoto out_free_wimlib_dentry;\n\t}\n\n\tif (flags & (WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE |\n\t\t     WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN))\n\t{\n\t\tstruct wim_dentry *child;\n\n\t\tret = 0;\n\t\tfor_dentry_child(child, dentry) {\n\t\t\tret = do_iterate_dir_tree(wim, child,\n\t\t\t\t\t\t  flags & ~WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN,\n\t\t\t\t\t\t  cb, user_ctx);\n\t\t\tif (ret)\n\t\t\t\tbreak;\n\t\t}\n\t}\nout_free_wimlib_dentry:\n\tFREE(dentry->d_full_path);\n\tdentry->d_full_path = NULL;\n\tfree_wimlib_dentry(wdentry);\nout:\n\treturn ret;\n}\n\nstruct image_iterate_dir_tree_ctx {\n\tconst tchar *path;\n\tint flags;\n\twimlib_iterate_dir_tree_callback_t cb;\n\tvoid *user_ctx;\n};\n\n\nstatic int\nimage_do_iterate_dir_tree(WIMStruct *wim)\n{\n\tstruct image_iterate_dir_tree_ctx *ctx = wim->private;\n\tstruct wim_dentry *dentry;\n\n\tdentry = get_dentry(wim, ctx->path, WIMLIB_CASE_PLATFORM_DEFAULT);\n\tif (dentry == NULL)\n\t\treturn WIMLIB_ERR_PATH_DOES_NOT_EXIST;\n\treturn do_iterate_dir_tree(wim, dentry, ctx->flags, ctx->cb, ctx->user_ctx);\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_iterate_dir_tree(WIMStruct *wim, int image, const tchar *_path,\n\t\t\tint flags,\n\t\t\twimlib_iterate_dir_tree_callback_t cb, void *user_ctx)\n{\n\ttchar *path;\n\tint ret;\n\n\tif (flags & ~(WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE |\n\t\t      WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN |\n\t\t      WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tpath = canonicalize_wim_path(_path);\n\tif (path == NULL)\n\t\treturn WIMLIB_ERR_NOMEM;\n\tstruct image_iterate_dir_tree_ctx ctx = {\n\t\t.path = path,\n\t\t.flags = flags,\n\t\t.cb = cb,\n\t\t.user_ctx = user_ctx,\n\t};\n\twim->private = &ctx;\n\tret = for_image(wim, image, image_do_iterate_dir_tree);\n\tFREE(path);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/wimlib/lcpit_matchfinder.c",
    "content": "/*\n * lcpit_matchfinder.c\n *\n * A match-finder for Lempel-Ziv compression based on bottom-up construction and\n * traversal of the Longest Common Prefix (LCP) interval tree.\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <limits.h>\n\n#include \"wimlib/divsufsort.h\"\n#include \"wimlib/lcpit_matchfinder.h\"\n#include \"wimlib/util.h\"\n\n#define LCP_BITS\t\t6\n#define LCP_MAX\t\t\t(((u32)1 << LCP_BITS) - 1)\n#define LCP_SHIFT\t\t(32 - LCP_BITS)\n#define LCP_MASK\t\t(LCP_MAX << LCP_SHIFT)\n#define POS_MASK\t\t(((u32)1 << (32 - LCP_BITS)) - 1)\n#define MAX_NORMAL_BUFSIZE\t(POS_MASK + 1)\n\n#define HUGE_LCP_BITS\t\t7\n#define HUGE_LCP_MAX\t\t(((u32)1 << HUGE_LCP_BITS) - 1)\n#define HUGE_LCP_SHIFT\t\t(64 - HUGE_LCP_BITS)\n#define HUGE_LCP_MASK\t\t((u64)HUGE_LCP_MAX << HUGE_LCP_SHIFT)\n#define HUGE_POS_MASK\t\t0xFFFFFFFF\n#define MAX_HUGE_BUFSIZE\t((u64)HUGE_POS_MASK + 1)\n#define HUGE_UNVISITED_TAG\t0x100000000\n\n#define PREFETCH_SAFETY\t\t5\n\n/*\n * Build the LCP (Longest Common Prefix) array in linear time.\n *\n * LCP[r] will be the length of the longest common prefix between the suffixes\n * with positions SA[r - 1] and SA[r].  LCP[0] will be undefined.\n *\n * Algorithm taken from Kasai et al. (2001), but modified slightly:\n *\n *  - With bytes there is no realistic way to reserve a unique symbol for\n *    end-of-buffer, so use explicit checks for end-of-buffer.\n *\n *  - For decreased memory usage and improved memory locality, pack the two\n *    logically distinct SA and LCP arrays into a single array SA_and_LCP.\n *\n *  - Since SA_and_LCP is accessed randomly, improve the cache behavior by\n *    reading several entries ahead in ISA and prefetching the upcoming\n *    SA_and_LCP entry.\n *\n *  - If an LCP value is less than the minimum match length, then store 0.  This\n *    avoids having to do comparisons against the minimum match length later.\n *\n *  - If an LCP value is greater than the \"nice match length\", then store the\n *    \"nice match length\".  This caps the number of bits needed to store each\n *    LCP value, and this caps the depth of the LCP-interval tree, without\n *    usually hurting the compression ratio too much.\n *\n * References:\n *\n *\tKasai et al.  2001.  Linear-Time Longest-Common-Prefix Computation in\n *\tSuffix Arrays and Its Applications.  CPM '01 Proceedings of the 12th\n *\tAnnual Symposium on Combinatorial Pattern Matching pp. 181-192.\n */\nstatic void\nbuild_LCP(u32* restrict SA_and_LCP, const u32* restrict ISA,\n\t  const u8* restrict T, const u32 n,\n\t  const u32 min_lcp, const u32 max_lcp)\n{\n\tu32 h = 0;\n\tfor (u32 i = 0; i < n; i++) {\n\t\tconst u32 r = ISA[i];\n\t\tprefetchw(&SA_and_LCP[ISA[i + PREFETCH_SAFETY]]);\n\t\tif (r > 0) {\n\t\t\tconst u32 j = SA_and_LCP[r - 1] & POS_MASK;\n\t\t\tconst u32 lim = min(n - i, n - j);\n\t\t\twhile (h < lim && T[i + h] == T[j + h])\n\t\t\t\th++;\n\t\t\tu32 stored_lcp = h;\n\t\t\tif (stored_lcp < min_lcp)\n\t\t\t\tstored_lcp = 0;\n\t\t\telse if (stored_lcp > max_lcp)\n\t\t\t\tstored_lcp = max_lcp;\n\t\t\tSA_and_LCP[r] |= stored_lcp << LCP_SHIFT;\n\t\t\tif (h > 0)\n\t\t\t\th--;\n\t\t}\n\t}\n}\n\n/*\n * Use the suffix array accompanied with the longest-common-prefix array ---\n * which in combination can be called the \"enhanced suffix array\" --- to\n * simulate a bottom-up traversal of the corresponding suffix tree, or\n * equivalently the lcp-interval tree.  Do so in suffix rank order, but save the\n * superinterval references needed for later bottom-up traversal of the tree in\n * suffix position order.\n *\n * To enumerate the lcp-intervals, this algorithm scans the suffix array and its\n * corresponding LCP array linearly.  While doing so, it maintains a stack of\n * lcp-intervals that are currently open, meaning that their left boundaries\n * have been seen but their right boundaries have not.  The bottom of the stack\n * is the interval which covers the entire suffix array (this has lcp=0), and\n * the top of the stack is the deepest interval that is currently open (this has\n * the greatest lcp of any interval on the stack).  When this algorithm opens an\n * lcp-interval, it assigns it a unique index in intervals[] and pushes it onto\n * the stack.  When this algorithm closes an interval, it pops it from the stack\n * and sets the intervals[] entry of that interval to the index and lcp of that\n * interval's superinterval, which is the new top of the stack.\n *\n * This algorithm also set pos_data[pos] for each suffix position 'pos' to the\n * index and lcp of the deepest lcp-interval containing it.  Alternatively, we\n * can interpret each suffix as being associated with a singleton lcp-interval,\n * or leaf of the suffix tree.  With this interpretation, an entry in pos_data[]\n * is the superinterval reference for one of these singleton lcp-intervals and\n * therefore is not fundamentally different from an entry in intervals[].\n *\n * To reduce memory usage, this algorithm re-uses the suffix array's memory to\n * store the generated intervals[] array.  This is possible because SA and LCP\n * are accessed linearly, and no more than one interval is generated per suffix.\n *\n * The techniques used in this algorithm are described in various published\n * papers.  The generation of lcp-intervals from the suffix array (SA) and the\n * longest-common-prefix array (LCP) is given as Algorithm BottomUpTraverse in\n * Kasai et al. (2001) and Algorithm 4.1 (\"Computation of lcp-intervals\") in\n * Abouelhoda et al. (2004).  Both these papers note the equivalence between\n * lcp-intervals (including the singleton lcp-interval for each suffix) and\n * nodes of the suffix tree.  Abouelhoda et al. (2004) furthermore applies\n * bottom-up traversal of the lcp-interval tree to Lempel-Ziv factorization, as\n * does Chen at al. (2008).  Algorithm CPS1b of Chen et al. (2008) dynamically\n * re-uses the suffix array during bottom-up traversal of the lcp-interval tree.\n *\n * References:\n *\n *\tKasai et al. Linear-Time Longest-Common-Prefix Computation in Suffix\n *\tArrays and Its Applications.  2001.  CPM '01 Proceedings of the 12th\n *\tAnnual Symposium on Combinatorial Pattern Matching pp. 181-192.\n *\n *\tM.I. Abouelhoda, S. Kurtz, E. Ohlebusch.  2004.  Replacing Suffix Trees\n *\tWith Enhanced Suffix Arrays.  Journal of Discrete Algorithms Volume 2\n *\tIssue 1, March 2004, pp. 53-86.\n *\n *\tG. Chen, S.J. Puglisi, W.F. Smyth.  2008.  Lempel-Ziv Factorization\n *\tUsing Less Time & Space.  Mathematics in Computer Science June 2008,\n *\tVolume 1, Issue 4, pp. 605-623.\n */\nstatic void\nbuild_LCPIT(u32* restrict intervals, u32* restrict pos_data, const u32 n)\n{\n\tu32 * const SA_and_LCP = intervals;\n\tu32 next_interval_idx;\n\tu32 open_intervals[LCP_MAX + 1];\n\tu32 *top = open_intervals;\n\tu32 prev_pos = SA_and_LCP[0] & POS_MASK;\n\n\t*top = 0;\n\tintervals[0] = 0;\n\tnext_interval_idx = 1;\n\n\tfor (u32 r = 1; r < n; r++) {\n\t\tconst u32 next_pos = SA_and_LCP[r] & POS_MASK;\n\t\tconst u32 next_lcp = SA_and_LCP[r] & LCP_MASK;\n\t\tconst u32 top_lcp = *top & LCP_MASK;\n\n\t\tprefetchw(&pos_data[SA_and_LCP[r + PREFETCH_SAFETY] & POS_MASK]);\n\n\t\tif (next_lcp == top_lcp) {\n\t\t\t/* Continuing the deepest open interval  */\n\t\t\tpos_data[prev_pos] = *top;\n\t\t} else if (next_lcp > top_lcp) {\n\t\t\t/* Opening a new interval  */\n\t\t\t*++top = next_lcp | next_interval_idx++;\n\t\t\tpos_data[prev_pos] = *top;\n\t\t} else {\n\t\t\t/* Closing the deepest open interval  */\n\t\t\tpos_data[prev_pos] = *top;\n\t\t\tfor (;;) {\n\t\t\t\tconst u32 closed_interval_idx = *top-- & POS_MASK;\n\t\t\t\tconst u32 superinterval_lcp = *top & LCP_MASK;\n\n\t\t\t\tif (next_lcp == superinterval_lcp) {\n\t\t\t\t\t/* Continuing the superinterval */\n\t\t\t\t\tintervals[closed_interval_idx] = *top;\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (next_lcp > superinterval_lcp) {\n\t\t\t\t\t/* Creating a new interval that is a\n\t\t\t\t\t * superinterval of the one being\n\t\t\t\t\t * closed, but still a subinterval of\n\t\t\t\t\t * its superinterval  */\n\t\t\t\t\t*++top = next_lcp | next_interval_idx++;\n\t\t\t\t\tintervals[closed_interval_idx] = *top;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t/* Also closing the superinterval  */\n\t\t\t\t\tintervals[closed_interval_idx] = *top;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprev_pos = next_pos;\n\t}\n\n\t/* Close any still-open intervals.  */\n\tpos_data[prev_pos] = *top;\n\tfor (; top > open_intervals; top--)\n\t\tintervals[*top & POS_MASK] = *(top - 1);\n}\n\n/*\n * Advance the LCP-interval tree matchfinder by one byte.\n *\n * If @record_matches is true, then matches are written to the @matches array\n * sorted by strictly decreasing length and strictly decreasing offset, and the\n * return value is the number of matches found.  Otherwise, @matches is ignored\n * and the return value is always 0.\n *\n * How this algorithm works:\n *\n * 'cur_pos' is the position of the current suffix, which is the suffix being\n * matched against.  'cur_pos' starts at 0 and is incremented each time this\n * function is called.  This function finds each suffix with position less than\n * 'cur_pos' that shares a prefix with the current suffix, but for each distinct\n * prefix length it finds only the suffix with the greatest position (i.e. the\n * most recently seen in the linear traversal by position).  This function\n * accomplishes this using the lcp-interval tree data structure that was built\n * by build_LCPIT() and is updated dynamically by this function.\n *\n * The first step is to read 'pos_data[cur_pos]', which gives the index and lcp\n * value of the deepest lcp-interval containing the current suffix --- or,\n * equivalently, the parent of the conceptual singleton lcp-interval that\n * contains the current suffix.\n *\n * The second step is to ascend the lcp-interval tree until reaching an interval\n * that has not yet been visited, and link the intervals to the current suffix\n * along the way.   An lcp-interval has been visited if and only if it has been\n * linked to a suffix.  Initially, no lcp-intervals are linked to suffixes.\n *\n * The third step is to continue ascending the lcp-interval tree, but indirectly\n * through suffix links rather than through the original superinterval\n * references, and continuing to form links with the current suffix along the\n * way.  Each suffix visited during this step, except in a special case to\n * handle outdated suffixes, is a match which can be written to matches[].  Each\n * intervals[] entry contains the position of the next suffix to visit, which we\n * shall call 'match_pos'; this is the most recently seen suffix that belongs to\n * that lcp-interval.  'pos_data[match_pos]' then contains the lcp and interval\n * index of the next lcp-interval that should be visited.\n *\n * We can view these arrays as describing a new set of links that gets overlaid\n * on top of the original superinterval references of the lcp-interval tree.\n * Each such link can connect a node of the lcp-interval tree to an ancestor\n * more than one generation removed.\n *\n * For each one-byte advance, the current position becomes the most recently\n * seen suffix for a continuous sequence of lcp-intervals from a leaf interval\n * to the root interval.  Conceptually, this algorithm needs to update all these\n * nodes to link to 'cur_pos', and then update 'pos_data[cur_pos]' to a \"null\"\n * link.  But actually, if some of these nodes have the same most recently seen\n * suffix, then this algorithm just visits the pos_data[] entry for that suffix\n * and skips over all these nodes in one step.  Updating the extra nodes is\n * accomplished by creating a redirection from the previous suffix to the\n * current suffix.\n *\n * Using this shortcutting scheme, it's possible for a suffix to become out of\n * date, which means that it is no longer the most recently seen suffix for the\n * lcp-interval under consideration.  This case is detected by noticing when the\n * next lcp-interval link actually points deeper in the tree, and it is worked\n * around by just continuing until we get to a link that actually takes us\n * higher in the tree.  This can be described as a lazy-update scheme.\n */\nstatic forceinline u32\nlcpit_advance_one_byte(const u32 cur_pos,\n\t\t       u32* restrict pos_data,\n\t\t       u32* restrict intervals,\n\t\t       u32* restrict next,\n\t\t       struct lz_match* restrict matches,\n\t\t       const bool record_matches)\n{\n\tu32 ref;\n\tu32 super_ref;\n\tu32 match_pos;\n\tstruct lz_match *matchptr;\n\n\t/* Get the deepest lcp-interval containing the current suffix. */\n\tref = pos_data[cur_pos];\n\n\t/* Prefetch upcoming data, up to 3 positions ahead.  Assume the\n\t * intervals are already visited.  */\n\n\t/* Prefetch the superinterval via a suffix link for the deepest\n\t * lcp-interval containing the suffix starting 1 position from now.  */\n\tprefetchw(&intervals[pos_data[next[0]] & POS_MASK]);\n\n\t/* Prefetch suffix link for the deepest lcp-interval containing the\n\t * suffix starting 2 positions from now.  */\n\tnext[0] = intervals[next[1]] & POS_MASK;\n\tprefetchw(&pos_data[next[0]]);\n\n\t/* Prefetch the deepest lcp-interval containing the suffix starting 3\n\t * positions from now.  */\n\tnext[1] = pos_data[cur_pos + 3] & POS_MASK;\n\tprefetchw(&intervals[next[1]]);\n\n\t/* There is no \"next suffix\" after the current one.  */\n\tpos_data[cur_pos] = 0;\n\n\t/* Ascend until we reach a visited interval, the root, or a child of the\n\t * root.  Link unvisited intervals to the current suffix as we go.  */\n\twhile ((super_ref = intervals[ref & POS_MASK]) & LCP_MASK) {\n\t\tintervals[ref & POS_MASK] = cur_pos;\n\t\tref = super_ref;\n\t}\n\n\tif (super_ref == 0) {\n\t\t/* In this case, the current interval may be any of:\n\t\t * (1) the root;\n\t\t * (2) an unvisited child of the root;\n\t\t * (3) an interval last visited by suffix 0\n\t\t *\n\t\t * We could avoid the ambiguity with (3) by using an lcp\n\t\t * placeholder value other than 0 to represent \"visited\", but\n\t\t * it's fastest to use 0.  So we just don't allow matches with\n\t\t * position 0.  */\n\n\t\tif (ref != 0)  /* Not the root?  */\n\t\t\tintervals[ref & POS_MASK] = cur_pos;\n\t\treturn 0;\n\t}\n\n\t/* Ascend indirectly via pos_data[] links.  */\n\tmatch_pos = super_ref;\n\tmatchptr = matches;\n\tfor (;;) {\n\t\twhile ((super_ref = pos_data[match_pos]) > ref)\n\t\t\tmatch_pos = intervals[super_ref & POS_MASK];\n\t\tintervals[ref & POS_MASK] = cur_pos;\n\t\tpos_data[match_pos] = ref;\n\t\tif (record_matches) {\n\t\t\tmatchptr->length = ref >> LCP_SHIFT;\n\t\t\tmatchptr->offset = cur_pos - match_pos;\n\t\t\tmatchptr++;\n\t\t}\n\t\tif (super_ref == 0)\n\t\t\tbreak;\n\t\tref = super_ref;\n\t\tmatch_pos = intervals[ref & POS_MASK];\n\t}\n\treturn matchptr - matches;\n}\n\n/* Expand SA from 32 bits to 64 bits.  */\nstatic void\nexpand_SA(void *p, u32 n)\n{\n\ttypedef u32 __attribute__((may_alias)) aliased_u32_t;\n\ttypedef u64 __attribute__((may_alias)) aliased_u64_t;\n\n\taliased_u32_t *SA = p;\n\taliased_u64_t *SA64 = p;\n\n\tu32 r = n - 1;\n\tdo {\n\t\tSA64[r] = SA[r];\n\t} while (r--);\n}\n\n/* Like build_LCP(), but for buffers larger than MAX_NORMAL_BUFSIZE.  */\nstatic void\nbuild_LCP_huge(u64* restrict SA_and_LCP64, const u32* restrict ISA,\n\t       const u8* restrict T, const u32 n,\n\t       const u32 min_lcp, const u32 max_lcp)\n{\n\tu32 h = 0;\n\tfor (u32 i = 0; i < n; i++) {\n\t\tconst u32 r = ISA[i];\n\t\tprefetchw(&SA_and_LCP64[ISA[i + PREFETCH_SAFETY]]);\n\t\tif (r > 0) {\n\t\t\tconst u32 j = SA_and_LCP64[r - 1] & HUGE_POS_MASK;\n\t\t\tconst u32 lim = min(n - i, n - j);\n\t\t\twhile (h < lim && T[i + h] == T[j + h])\n\t\t\t\th++;\n\t\t\tu32 stored_lcp = h;\n\t\t\tif (stored_lcp < min_lcp)\n\t\t\t\tstored_lcp = 0;\n\t\t\telse if (stored_lcp > max_lcp)\n\t\t\t\tstored_lcp = max_lcp;\n\t\t\tSA_and_LCP64[r] |= (u64)stored_lcp << HUGE_LCP_SHIFT;\n\t\t\tif (h > 0)\n\t\t\t\th--;\n\t\t}\n\t}\n}\n\n/*\n * Like build_LCPIT(), but for buffers larger than MAX_NORMAL_BUFSIZE.\n *\n * This \"huge\" version is also slightly different in that the lcp value stored\n * in each intervals[] entry is the lcp value for that interval, not its\n * superinterval.  This lcp value stays put in intervals[] and doesn't get moved\n * to pos_data[] during lcpit_advance_one_byte_huge().  One consequence of this\n * is that we have to use a special flag to distinguish visited from unvisited\n * intervals.  But overall, this scheme keeps the memory usage at 12n instead of\n * 16n.  (The non-huge version is 8n.)\n */\nstatic void\nbuild_LCPIT_huge(u64* restrict intervals64, u32* restrict pos_data, const u32 n)\n{\n\tu64 * const SA_and_LCP64 = intervals64;\n\tu32 next_interval_idx;\n\tu32 open_intervals[HUGE_LCP_MAX + 1];\n\tu32 *top = open_intervals;\n\tu32 prev_pos = SA_and_LCP64[0] & HUGE_POS_MASK;\n\n\t*top = 0;\n\tintervals64[0] = 0;\n\tnext_interval_idx = 1;\n\n\tfor (u32 r = 1; r < n; r++) {\n\t\tconst u32 next_pos = SA_and_LCP64[r] & HUGE_POS_MASK;\n\t\tconst u64 next_lcp = SA_and_LCP64[r] & HUGE_LCP_MASK;\n\t\tconst u64 top_lcp = intervals64[*top];\n\n\t\tprefetchw(&pos_data[SA_and_LCP64[r + PREFETCH_SAFETY] & HUGE_POS_MASK]);\n\n\t\tif (next_lcp == top_lcp) {\n\t\t\t/* Continuing the deepest open interval  */\n\t\t\tpos_data[prev_pos] = *top;\n\t\t} else if (next_lcp > top_lcp) {\n\t\t\t/* Opening a new interval  */\n\t\t\tintervals64[next_interval_idx] = next_lcp;\n\t\t\tpos_data[prev_pos] = next_interval_idx;\n\t\t\t*++top = next_interval_idx++;\n\t\t} else {\n\t\t\t/* Closing the deepest open interval  */\n\t\t\tpos_data[prev_pos] = *top;\n\t\t\tfor (;;) {\n\t\t\t\tconst u32 closed_interval_idx = *top--;\n\t\t\t\tconst u64 superinterval_lcp = intervals64[*top];\n\n\t\t\t\tif (next_lcp == superinterval_lcp) {\n\t\t\t\t\t/* Continuing the superinterval */\n\t\t\t\t\tintervals64[closed_interval_idx] |=\n\t\t\t\t\t\tHUGE_UNVISITED_TAG | *top;\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (next_lcp > superinterval_lcp) {\n\t\t\t\t\t/* Creating a new interval that is a\n\t\t\t\t\t * superinterval of the one being\n\t\t\t\t\t * closed, but still a subinterval of\n\t\t\t\t\t * its superinterval  */\n\t\t\t\t\tintervals64[next_interval_idx] = next_lcp;\n\t\t\t\t\tintervals64[closed_interval_idx] |=\n\t\t\t\t\t\tHUGE_UNVISITED_TAG | next_interval_idx;\n\t\t\t\t\t*++top = next_interval_idx++;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t/* Also closing the superinterval  */\n\t\t\t\t\tintervals64[closed_interval_idx] |=\n\t\t\t\t\t\tHUGE_UNVISITED_TAG | *top;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprev_pos = next_pos;\n\t}\n\n\t/* Close any still-open intervals.  */\n\tpos_data[prev_pos] = *top;\n\tfor (; top > open_intervals; top--)\n\t\tintervals64[*top] |= HUGE_UNVISITED_TAG | *(top - 1);\n}\n\n/* Like lcpit_advance_one_byte(), but for buffers larger than\n * MAX_NORMAL_BUFSIZE.  */\nstatic forceinline u32\nlcpit_advance_one_byte_huge(const u32 cur_pos,\n\t\t\t    u32* restrict pos_data,\n\t\t\t    u64* restrict intervals64,\n\t\t\t    u32* restrict prefetch_next,\n\t\t\t    struct lz_match* restrict matches,\n\t\t\t    const bool record_matches)\n{\n\tu32 interval_idx;\n\tu32 next_interval_idx;\n\tu64 cur;\n\tu64 next;\n\tu32 match_pos;\n\tstruct lz_match *matchptr;\n\n\tinterval_idx = pos_data[cur_pos];\n\n\tprefetchw(&intervals64[pos_data[prefetch_next[0]] & HUGE_POS_MASK]);\n\n\tprefetch_next[0] = intervals64[prefetch_next[1]] & HUGE_POS_MASK;\n\tprefetchw(&pos_data[prefetch_next[0]]);\n\n\tprefetch_next[1] = pos_data[cur_pos + 3] & HUGE_POS_MASK;\n\tprefetchw(&intervals64[prefetch_next[1]]);\n\n\tpos_data[cur_pos] = 0;\n\n\twhile ((next = intervals64[interval_idx]) & HUGE_UNVISITED_TAG) {\n\t\tintervals64[interval_idx] = (next & HUGE_LCP_MASK) | cur_pos;\n\t\tinterval_idx = next & HUGE_POS_MASK;\n\t}\n\n\tmatchptr = matches;\n\twhile (next & HUGE_LCP_MASK) {\n\t\tcur = next;\n\t\tdo {\n\t\t\tmatch_pos = next & HUGE_POS_MASK;\n\t\t\tnext_interval_idx = pos_data[match_pos];\n\t\t\tnext = intervals64[next_interval_idx];\n\t\t} while (next > cur);\n\t\tintervals64[interval_idx] = (cur & HUGE_LCP_MASK) | cur_pos;\n\t\tpos_data[match_pos] = interval_idx;\n\t\tif (record_matches) {\n\t\t\tmatchptr->length = cur >> HUGE_LCP_SHIFT;\n\t\t\tmatchptr->offset = cur_pos - match_pos;\n\t\t\tmatchptr++;\n\t\t}\n\t\tinterval_idx = next_interval_idx;\n\t}\n\treturn matchptr - matches;\n}\n\nstatic forceinline u64\nget_pos_data_size(size_t max_bufsize)\n{\n\treturn (u64)max((u64)max_bufsize + PREFETCH_SAFETY,\n\t\t\tDIVSUFSORT_TMP_LEN) * sizeof(u32);\n}\n\nstatic forceinline u64\nget_intervals_size(size_t max_bufsize)\n{\n\treturn ((u64)max_bufsize + PREFETCH_SAFETY) *\n\t\t(max_bufsize <= MAX_NORMAL_BUFSIZE ? sizeof(u32) : sizeof(u64));\n}\n\n/*\n * Calculate the number of bytes of memory needed for the LCP-interval tree\n * matchfinder.\n *\n * @max_bufsize - maximum buffer size to support\n *\n * Returns the number of bytes required.\n */\nu64\nlcpit_matchfinder_get_needed_memory(size_t max_bufsize)\n{\n\treturn get_pos_data_size(max_bufsize) + get_intervals_size(max_bufsize);\n}\n\n/*\n * Initialize the LCP-interval tree matchfinder.\n *\n * @mf - the matchfinder structure to initialize\n * @max_bufsize - maximum buffer size to support\n * @min_match_len - minimum match length in bytes\n * @nice_match_len - only consider this many bytes of each match\n *\n * Returns true if successfully initialized; false if out of memory.\n */\nbool\nlcpit_matchfinder_init(struct lcpit_matchfinder *mf, size_t max_bufsize,\n\t\t       u32 min_match_len, u32 nice_match_len)\n{\n\t// coverity[dead_error_condition]\n\tif (lcpit_matchfinder_get_needed_memory(max_bufsize) > SIZE_MAX)\n\t\treturn false;\n\tif (max_bufsize > MAX_HUGE_BUFSIZE - PREFETCH_SAFETY)\n\t\treturn false;\n\n\tmf->pos_data = MALLOC(get_pos_data_size(max_bufsize));\n\tmf->intervals = MALLOC(get_intervals_size(max_bufsize));\n\tif (!mf->pos_data || !mf->intervals) {\n\t\tlcpit_matchfinder_destroy(mf);\n\t\treturn false;\n\t}\n\n\tmf->min_match_len = min_match_len;\n\tmf->orig_nice_match_len = nice_match_len;\n\treturn true;\n}\n\n/*\n * Build the suffix array SA for the specified byte array T of length n.\n *\n * The suffix array is a sorted array of the byte array's suffixes, represented\n * by indices into the byte array.  It can equivalently be viewed as a mapping\n * from suffix rank to suffix position.\n *\n * To build the suffix array, we use libdivsufsort, which uses an\n * induced-sorting-based algorithm.  In practice, this seems to be the fastest\n * suffix array construction algorithm currently available.\n *\n * References:\n *\n *\tY. Mori.  libdivsufsort, a lightweight suffix-sorting library.\n *\thttps://github.com/y-256/libdivsufsort\n *\n *\tG. Nong, S. Zhang, and W.H. Chan.  2009.  Linear Suffix Array\n *\tConstruction by Almost Pure Induced-Sorting.  Data Compression\n *\tConference, 2009.  DCC '09.  pp. 193 - 202.\n *\n *\tS.J. Puglisi, W.F. Smyth, and A. Turpin.  2007.  A Taxonomy of Suffix\n *\tArray Construction Algorithms.  ACM Computing Surveys (CSUR) Volume 39\n *\tIssue 2, 2007 Article No. 4.\n */\nstatic void\nbuild_SA(u32 SA[], const u8 T[], u32 n, u32 *tmp)\n{\n\t/* Note: divsufsort() requires a fixed amount of temporary space.  The\n\t * implementation of divsufsort() has been modified from the original to\n\t * use the provided temporary space instead of allocating its own, since\n\t * we don't want to have to deal with malloc() failures here.  */\n\tdivsufsort(T, SA, n, tmp);\n}\n\n/*\n * Build the inverse suffix array ISA from the suffix array SA.\n *\n * Whereas the suffix array is a mapping from suffix rank to suffix position,\n * the inverse suffix array is a mapping from suffix position to suffix rank.\n */\nstatic void\nbuild_ISA(u32* restrict ISA, const u32* restrict SA, u32 n)\n{\n\tfor (u32 r = 0; r < n; r++)\n\t\tISA[SA[r]] = r;\n}\n\n/*\n * Prepare the LCP-interval tree matchfinder for a new input buffer.\n *\n * @mf - the initialized matchfinder structure\n * @T - the input buffer\n * @n - size of the input buffer in bytes.  This must be nonzero and can be at\n *\tmost the max_bufsize with which lcpit_matchfinder_init() was called.\n */\nvoid\nlcpit_matchfinder_load_buffer(struct lcpit_matchfinder *mf, const u8 *T, u32 n)\n{\n\t/* intervals[] temporarily stores SA and LCP packed together.\n\t * pos_data[] temporarily stores ISA.\n\t * pos_data[] is also used as the temporary space for divsufsort().  */\n\n\tbuild_SA(mf->intervals, T, n, mf->pos_data);\n\tbuild_ISA(mf->pos_data, mf->intervals, n);\n\tif (n <= MAX_NORMAL_BUFSIZE) {\n\t\tmf->nice_match_len = min(mf->orig_nice_match_len, LCP_MAX);\n\t\tfor (u32 i = 0; i < PREFETCH_SAFETY; i++) {\n\t\t\tmf->intervals[n + i] = 0;\n\t\t\tmf->pos_data[n + i] = 0;\n\t\t}\n\t\tbuild_LCP(mf->intervals, mf->pos_data, T, n,\n\t\t\t  mf->min_match_len, mf->nice_match_len);\n\t\tbuild_LCPIT(mf->intervals, mf->pos_data, n);\n\t\tmf->huge_mode = false;\n\t} else {\n\t\tmf->nice_match_len = min(mf->orig_nice_match_len, HUGE_LCP_MAX);\n\t\tfor (u32 i = 0; i < PREFETCH_SAFETY; i++) {\n\t\t\tmf->intervals64[n + i] = 0;\n\t\t\tmf->pos_data[n + i] = 0;\n\t\t}\n\t\texpand_SA(mf->intervals, n);\n\t\tbuild_LCP_huge(mf->intervals64, mf->pos_data, T, n,\n\t\t\t       mf->min_match_len, mf->nice_match_len);\n\t\tbuild_LCPIT_huge(mf->intervals64, mf->pos_data, n);\n\t\tmf->huge_mode = true;\n\t}\n\tmf->cur_pos = 0; /* starting at beginning of input buffer  */\n\tfor (u32 i = 0; i < ARRAY_LEN(mf->next); i++)\n\t\tmf->next[i] = 0;\n}\n\n/*\n * Retrieve a list of matches with the next position.\n *\n * The matches will be recorded in the @matches array, ordered by strictly\n * decreasing length and strictly decreasing offset.\n *\n * The return value is the number of matches found and written to @matches.\n * This can be any value in [0, nice_match_len - min_match_len + 1].\n */\nu32\nlcpit_matchfinder_get_matches(struct lcpit_matchfinder *mf,\n\t\t\t      struct lz_match *matches)\n{\n\tif (mf->huge_mode)\n\t\treturn lcpit_advance_one_byte_huge(mf->cur_pos++, mf->pos_data,\n\t\t\t\t\t\t   mf->intervals64, mf->next,\n\t\t\t\t\t\t   matches, true);\n\telse\n\t\treturn lcpit_advance_one_byte(mf->cur_pos++, mf->pos_data,\n\t\t\t\t\t      mf->intervals, mf->next,\n\t\t\t\t\t      matches, true);\n}\n\n/*\n * Skip the next @count bytes (don't search for matches at them).  @count is\n * assumed to be > 0.\n */\nvoid\nlcpit_matchfinder_skip_bytes(struct lcpit_matchfinder *mf, u32 count)\n{\n\tif (mf->huge_mode) {\n\t\tdo {\n\t\t\tlcpit_advance_one_byte_huge(mf->cur_pos++, mf->pos_data,\n\t\t\t\t\t\t    mf->intervals64, mf->next,\n\t\t\t\t\t\t    NULL, false);\n\t\t} while (--count);\n\t} else {\n\t\tdo {\n\t\t\tlcpit_advance_one_byte(mf->cur_pos++, mf->pos_data,\n\t\t\t\t\t       mf->intervals, mf->next,\n\t\t\t\t\t       NULL, false);\n\t\t} while (--count);\n\t}\n}\n\n/*\n * Destroy an LCP-interval tree matchfinder that was previously initialized with\n * lcpit_matchfinder_init().\n */\nvoid\nlcpit_matchfinder_destroy(struct lcpit_matchfinder *mf)\n{\n\tFREE(mf->pos_data);\n\tFREE(mf->intervals);\n}\n"
  },
  {
    "path": "src/wimlib/lzms_common.c",
    "content": "/*\n * lzms_common.c - Common code for LZMS compression and decompression\n */\n\n/*\n * Copyright (C) 2013-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/cpu_features.h\"\n#include \"wimlib/lzms_common.h\"\n#include \"wimlib/unaligned.h\"\n\n#ifdef __x86_64__\n#  include <emmintrin.h>\n#endif\n\n/* Table: offset slot => offset slot base value  */\nconst u32 lzms_offset_slot_base[LZMS_MAX_NUM_OFFSET_SYMS + 1] = {\n\t0x00000001, 0x00000002, 0x00000003, 0x00000004,\n\t0x00000005, 0x00000006, 0x00000007, 0x00000008,\n\t0x00000009, 0x0000000d, 0x00000011, 0x00000015,\n\t0x00000019, 0x0000001d, 0x00000021, 0x00000025,\n\t0x00000029, 0x0000002d, 0x00000035, 0x0000003d,\n\t0x00000045, 0x0000004d, 0x00000055, 0x0000005d,\n\t0x00000065, 0x00000075, 0x00000085, 0x00000095,\n\t0x000000a5, 0x000000b5, 0x000000c5, 0x000000d5,\n\t0x000000e5, 0x000000f5, 0x00000105, 0x00000125,\n\t0x00000145, 0x00000165, 0x00000185, 0x000001a5,\n\t0x000001c5, 0x000001e5, 0x00000205, 0x00000225,\n\t0x00000245, 0x00000265, 0x00000285, 0x000002a5,\n\t0x000002c5, 0x000002e5, 0x00000325, 0x00000365,\n\t0x000003a5, 0x000003e5, 0x00000425, 0x00000465,\n\t0x000004a5, 0x000004e5, 0x00000525, 0x00000565,\n\t0x000005a5, 0x000005e5, 0x00000625, 0x00000665,\n\t0x000006a5, 0x00000725, 0x000007a5, 0x00000825,\n\t0x000008a5, 0x00000925, 0x000009a5, 0x00000a25,\n\t0x00000aa5, 0x00000b25, 0x00000ba5, 0x00000c25,\n\t0x00000ca5, 0x00000d25, 0x00000da5, 0x00000e25,\n\t0x00000ea5, 0x00000f25, 0x00000fa5, 0x00001025,\n\t0x000010a5, 0x000011a5, 0x000012a5, 0x000013a5,\n\t0x000014a5, 0x000015a5, 0x000016a5, 0x000017a5,\n\t0x000018a5, 0x000019a5, 0x00001aa5, 0x00001ba5,\n\t0x00001ca5, 0x00001da5, 0x00001ea5, 0x00001fa5,\n\t0x000020a5, 0x000021a5, 0x000022a5, 0x000023a5,\n\t0x000024a5, 0x000026a5, 0x000028a5, 0x00002aa5,\n\t0x00002ca5, 0x00002ea5, 0x000030a5, 0x000032a5,\n\t0x000034a5, 0x000036a5, 0x000038a5, 0x00003aa5,\n\t0x00003ca5, 0x00003ea5, 0x000040a5, 0x000042a5,\n\t0x000044a5, 0x000046a5, 0x000048a5, 0x00004aa5,\n\t0x00004ca5, 0x00004ea5, 0x000050a5, 0x000052a5,\n\t0x000054a5, 0x000056a5, 0x000058a5, 0x00005aa5,\n\t0x00005ca5, 0x00005ea5, 0x000060a5, 0x000064a5,\n\t0x000068a5, 0x00006ca5, 0x000070a5, 0x000074a5,\n\t0x000078a5, 0x00007ca5, 0x000080a5, 0x000084a5,\n\t0x000088a5, 0x00008ca5, 0x000090a5, 0x000094a5,\n\t0x000098a5, 0x00009ca5, 0x0000a0a5, 0x0000a4a5,\n\t0x0000a8a5, 0x0000aca5, 0x0000b0a5, 0x0000b4a5,\n\t0x0000b8a5, 0x0000bca5, 0x0000c0a5, 0x0000c4a5,\n\t0x0000c8a5, 0x0000cca5, 0x0000d0a5, 0x0000d4a5,\n\t0x0000d8a5, 0x0000dca5, 0x0000e0a5, 0x0000e4a5,\n\t0x0000eca5, 0x0000f4a5, 0x0000fca5, 0x000104a5,\n\t0x00010ca5, 0x000114a5, 0x00011ca5, 0x000124a5,\n\t0x00012ca5, 0x000134a5, 0x00013ca5, 0x000144a5,\n\t0x00014ca5, 0x000154a5, 0x00015ca5, 0x000164a5,\n\t0x00016ca5, 0x000174a5, 0x00017ca5, 0x000184a5,\n\t0x00018ca5, 0x000194a5, 0x00019ca5, 0x0001a4a5,\n\t0x0001aca5, 0x0001b4a5, 0x0001bca5, 0x0001c4a5,\n\t0x0001cca5, 0x0001d4a5, 0x0001dca5, 0x0001e4a5,\n\t0x0001eca5, 0x0001f4a5, 0x0001fca5, 0x000204a5,\n\t0x00020ca5, 0x000214a5, 0x00021ca5, 0x000224a5,\n\t0x000234a5, 0x000244a5, 0x000254a5, 0x000264a5,\n\t0x000274a5, 0x000284a5, 0x000294a5, 0x0002a4a5,\n\t0x0002b4a5, 0x0002c4a5, 0x0002d4a5, 0x0002e4a5,\n\t0x0002f4a5, 0x000304a5, 0x000314a5, 0x000324a5,\n\t0x000334a5, 0x000344a5, 0x000354a5, 0x000364a5,\n\t0x000374a5, 0x000384a5, 0x000394a5, 0x0003a4a5,\n\t0x0003b4a5, 0x0003c4a5, 0x0003d4a5, 0x0003e4a5,\n\t0x0003f4a5, 0x000404a5, 0x000414a5, 0x000424a5,\n\t0x000434a5, 0x000444a5, 0x000454a5, 0x000464a5,\n\t0x000474a5, 0x000484a5, 0x000494a5, 0x0004a4a5,\n\t0x0004b4a5, 0x0004c4a5, 0x0004e4a5, 0x000504a5,\n\t0x000524a5, 0x000544a5, 0x000564a5, 0x000584a5,\n\t0x0005a4a5, 0x0005c4a5, 0x0005e4a5, 0x000604a5,\n\t0x000624a5, 0x000644a5, 0x000664a5, 0x000684a5,\n\t0x0006a4a5, 0x0006c4a5, 0x0006e4a5, 0x000704a5,\n\t0x000724a5, 0x000744a5, 0x000764a5, 0x000784a5,\n\t0x0007a4a5, 0x0007c4a5, 0x0007e4a5, 0x000804a5,\n\t0x000824a5, 0x000844a5, 0x000864a5, 0x000884a5,\n\t0x0008a4a5, 0x0008c4a5, 0x0008e4a5, 0x000904a5,\n\t0x000924a5, 0x000944a5, 0x000964a5, 0x000984a5,\n\t0x0009a4a5, 0x0009c4a5, 0x0009e4a5, 0x000a04a5,\n\t0x000a24a5, 0x000a44a5, 0x000a64a5, 0x000aa4a5,\n\t0x000ae4a5, 0x000b24a5, 0x000b64a5, 0x000ba4a5,\n\t0x000be4a5, 0x000c24a5, 0x000c64a5, 0x000ca4a5,\n\t0x000ce4a5, 0x000d24a5, 0x000d64a5, 0x000da4a5,\n\t0x000de4a5, 0x000e24a5, 0x000e64a5, 0x000ea4a5,\n\t0x000ee4a5, 0x000f24a5, 0x000f64a5, 0x000fa4a5,\n\t0x000fe4a5, 0x001024a5, 0x001064a5, 0x0010a4a5,\n\t0x0010e4a5, 0x001124a5, 0x001164a5, 0x0011a4a5,\n\t0x0011e4a5, 0x001224a5, 0x001264a5, 0x0012a4a5,\n\t0x0012e4a5, 0x001324a5, 0x001364a5, 0x0013a4a5,\n\t0x0013e4a5, 0x001424a5, 0x001464a5, 0x0014a4a5,\n\t0x0014e4a5, 0x001524a5, 0x001564a5, 0x0015a4a5,\n\t0x0015e4a5, 0x001624a5, 0x001664a5, 0x0016a4a5,\n\t0x0016e4a5, 0x001724a5, 0x001764a5, 0x0017a4a5,\n\t0x0017e4a5, 0x001824a5, 0x001864a5, 0x0018a4a5,\n\t0x0018e4a5, 0x001924a5, 0x001964a5, 0x0019e4a5,\n\t0x001a64a5, 0x001ae4a5, 0x001b64a5, 0x001be4a5,\n\t0x001c64a5, 0x001ce4a5, 0x001d64a5, 0x001de4a5,\n\t0x001e64a5, 0x001ee4a5, 0x001f64a5, 0x001fe4a5,\n\t0x002064a5, 0x0020e4a5, 0x002164a5, 0x0021e4a5,\n\t0x002264a5, 0x0022e4a5, 0x002364a5, 0x0023e4a5,\n\t0x002464a5, 0x0024e4a5, 0x002564a5, 0x0025e4a5,\n\t0x002664a5, 0x0026e4a5, 0x002764a5, 0x0027e4a5,\n\t0x002864a5, 0x0028e4a5, 0x002964a5, 0x0029e4a5,\n\t0x002a64a5, 0x002ae4a5, 0x002b64a5, 0x002be4a5,\n\t0x002c64a5, 0x002ce4a5, 0x002d64a5, 0x002de4a5,\n\t0x002e64a5, 0x002ee4a5, 0x002f64a5, 0x002fe4a5,\n\t0x003064a5, 0x0030e4a5, 0x003164a5, 0x0031e4a5,\n\t0x003264a5, 0x0032e4a5, 0x003364a5, 0x0033e4a5,\n\t0x003464a5, 0x0034e4a5, 0x003564a5, 0x0035e4a5,\n\t0x003664a5, 0x0036e4a5, 0x003764a5, 0x0037e4a5,\n\t0x003864a5, 0x0038e4a5, 0x003964a5, 0x0039e4a5,\n\t0x003a64a5, 0x003ae4a5, 0x003b64a5, 0x003be4a5,\n\t0x003c64a5, 0x003ce4a5, 0x003d64a5, 0x003de4a5,\n\t0x003ee4a5, 0x003fe4a5, 0x0040e4a5, 0x0041e4a5,\n\t0x0042e4a5, 0x0043e4a5, 0x0044e4a5, 0x0045e4a5,\n\t0x0046e4a5, 0x0047e4a5, 0x0048e4a5, 0x0049e4a5,\n\t0x004ae4a5, 0x004be4a5, 0x004ce4a5, 0x004de4a5,\n\t0x004ee4a5, 0x004fe4a5, 0x0050e4a5, 0x0051e4a5,\n\t0x0052e4a5, 0x0053e4a5, 0x0054e4a5, 0x0055e4a5,\n\t0x0056e4a5, 0x0057e4a5, 0x0058e4a5, 0x0059e4a5,\n\t0x005ae4a5, 0x005be4a5, 0x005ce4a5, 0x005de4a5,\n\t0x005ee4a5, 0x005fe4a5, 0x0060e4a5, 0x0061e4a5,\n\t0x0062e4a5, 0x0063e4a5, 0x0064e4a5, 0x0065e4a5,\n\t0x0066e4a5, 0x0067e4a5, 0x0068e4a5, 0x0069e4a5,\n\t0x006ae4a5, 0x006be4a5, 0x006ce4a5, 0x006de4a5,\n\t0x006ee4a5, 0x006fe4a5, 0x0070e4a5, 0x0071e4a5,\n\t0x0072e4a5, 0x0073e4a5, 0x0074e4a5, 0x0075e4a5,\n\t0x0076e4a5, 0x0077e4a5, 0x0078e4a5, 0x0079e4a5,\n\t0x007ae4a5, 0x007be4a5, 0x007ce4a5, 0x007de4a5,\n\t0x007ee4a5, 0x007fe4a5, 0x0080e4a5, 0x0081e4a5,\n\t0x0082e4a5, 0x0083e4a5, 0x0084e4a5, 0x0085e4a5,\n\t0x0086e4a5, 0x0087e4a5, 0x0088e4a5, 0x0089e4a5,\n\t0x008ae4a5, 0x008be4a5, 0x008ce4a5, 0x008de4a5,\n\t0x008fe4a5, 0x0091e4a5, 0x0093e4a5, 0x0095e4a5,\n\t0x0097e4a5, 0x0099e4a5, 0x009be4a5, 0x009de4a5,\n\t0x009fe4a5, 0x00a1e4a5, 0x00a3e4a5, 0x00a5e4a5,\n\t0x00a7e4a5, 0x00a9e4a5, 0x00abe4a5, 0x00ade4a5,\n\t0x00afe4a5, 0x00b1e4a5, 0x00b3e4a5, 0x00b5e4a5,\n\t0x00b7e4a5, 0x00b9e4a5, 0x00bbe4a5, 0x00bde4a5,\n\t0x00bfe4a5, 0x00c1e4a5, 0x00c3e4a5, 0x00c5e4a5,\n\t0x00c7e4a5, 0x00c9e4a5, 0x00cbe4a5, 0x00cde4a5,\n\t0x00cfe4a5, 0x00d1e4a5, 0x00d3e4a5, 0x00d5e4a5,\n\t0x00d7e4a5, 0x00d9e4a5, 0x00dbe4a5, 0x00dde4a5,\n\t0x00dfe4a5, 0x00e1e4a5, 0x00e3e4a5, 0x00e5e4a5,\n\t0x00e7e4a5, 0x00e9e4a5, 0x00ebe4a5, 0x00ede4a5,\n\t0x00efe4a5, 0x00f1e4a5, 0x00f3e4a5, 0x00f5e4a5,\n\t0x00f7e4a5, 0x00f9e4a5, 0x00fbe4a5, 0x00fde4a5,\n\t0x00ffe4a5, 0x0101e4a5, 0x0103e4a5, 0x0105e4a5,\n\t0x0107e4a5, 0x0109e4a5, 0x010be4a5, 0x010de4a5,\n\t0x010fe4a5, 0x0111e4a5, 0x0113e4a5, 0x0115e4a5,\n\t0x0117e4a5, 0x0119e4a5, 0x011be4a5, 0x011de4a5,\n\t0x011fe4a5, 0x0121e4a5, 0x0123e4a5, 0x0125e4a5,\n\t0x0127e4a5, 0x0129e4a5, 0x012be4a5, 0x012de4a5,\n\t0x012fe4a5, 0x0131e4a5, 0x0133e4a5, 0x0135e4a5,\n\t0x0137e4a5, 0x013be4a5, 0x013fe4a5, 0x0143e4a5,\n\t0x0147e4a5, 0x014be4a5, 0x014fe4a5, 0x0153e4a5,\n\t0x0157e4a5, 0x015be4a5, 0x015fe4a5, 0x0163e4a5,\n\t0x0167e4a5, 0x016be4a5, 0x016fe4a5, 0x0173e4a5,\n\t0x0177e4a5, 0x017be4a5, 0x017fe4a5, 0x0183e4a5,\n\t0x0187e4a5, 0x018be4a5, 0x018fe4a5, 0x0193e4a5,\n\t0x0197e4a5, 0x019be4a5, 0x019fe4a5, 0x01a3e4a5,\n\t0x01a7e4a5, 0x01abe4a5, 0x01afe4a5, 0x01b3e4a5,\n\t0x01b7e4a5, 0x01bbe4a5, 0x01bfe4a5, 0x01c3e4a5,\n\t0x01c7e4a5, 0x01cbe4a5, 0x01cfe4a5, 0x01d3e4a5,\n\t0x01d7e4a5, 0x01dbe4a5, 0x01dfe4a5, 0x01e3e4a5,\n\t0x01e7e4a5, 0x01ebe4a5, 0x01efe4a5, 0x01f3e4a5,\n\t0x01f7e4a5, 0x01fbe4a5, 0x01ffe4a5, 0x0203e4a5,\n\t0x0207e4a5, 0x020be4a5, 0x020fe4a5, 0x0213e4a5,\n\t0x0217e4a5, 0x021be4a5, 0x021fe4a5, 0x0223e4a5,\n\t0x0227e4a5, 0x022be4a5, 0x022fe4a5, 0x0233e4a5,\n\t0x0237e4a5, 0x023be4a5, 0x023fe4a5, 0x0243e4a5,\n\t0x0247e4a5, 0x024be4a5, 0x024fe4a5, 0x0253e4a5,\n\t0x0257e4a5, 0x025be4a5, 0x025fe4a5, 0x0263e4a5,\n\t0x0267e4a5, 0x026be4a5, 0x026fe4a5, 0x0273e4a5,\n\t0x0277e4a5, 0x027be4a5, 0x027fe4a5, 0x0283e4a5,\n\t0x0287e4a5, 0x028be4a5, 0x028fe4a5, 0x0293e4a5,\n\t0x0297e4a5, 0x029be4a5, 0x029fe4a5, 0x02a3e4a5,\n\t0x02a7e4a5, 0x02abe4a5, 0x02afe4a5, 0x02b3e4a5,\n\t0x02bbe4a5, 0x02c3e4a5, 0x02cbe4a5, 0x02d3e4a5,\n\t0x02dbe4a5, 0x02e3e4a5, 0x02ebe4a5, 0x02f3e4a5,\n\t0x02fbe4a5, 0x0303e4a5, 0x030be4a5, 0x0313e4a5,\n\t0x031be4a5, 0x0323e4a5, 0x032be4a5, 0x0333e4a5,\n\t0x033be4a5, 0x0343e4a5, 0x034be4a5, 0x0353e4a5,\n\t0x035be4a5, 0x0363e4a5, 0x036be4a5, 0x0373e4a5,\n\t0x037be4a5, 0x0383e4a5, 0x038be4a5, 0x0393e4a5,\n\t0x039be4a5, 0x03a3e4a5, 0x03abe4a5, 0x03b3e4a5,\n\t0x03bbe4a5, 0x03c3e4a5, 0x03cbe4a5, 0x03d3e4a5,\n\t0x03dbe4a5, 0x03e3e4a5, 0x03ebe4a5, 0x03f3e4a5,\n\t0x03fbe4a5, 0x0403e4a5, 0x040be4a5, 0x0413e4a5,\n\t0x041be4a5, 0x0423e4a5, 0x042be4a5, 0x0433e4a5,\n\t0x043be4a5, 0x0443e4a5, 0x044be4a5, 0x0453e4a5,\n\t0x045be4a5, 0x0463e4a5, 0x046be4a5, 0x0473e4a5,\n\t0x047be4a5, 0x0483e4a5, 0x048be4a5, 0x0493e4a5,\n\t0x049be4a5, 0x04a3e4a5, 0x04abe4a5, 0x04b3e4a5,\n\t0x04bbe4a5, 0x04c3e4a5, 0x04cbe4a5, 0x04d3e4a5,\n\t0x04dbe4a5, 0x04e3e4a5, 0x04ebe4a5, 0x04f3e4a5,\n\t0x04fbe4a5, 0x0503e4a5, 0x050be4a5, 0x0513e4a5,\n\t0x051be4a5, 0x0523e4a5, 0x052be4a5, 0x0533e4a5,\n\t0x053be4a5, 0x0543e4a5, 0x054be4a5, 0x0553e4a5,\n\t0x055be4a5, 0x0563e4a5, 0x056be4a5, 0x0573e4a5,\n\t0x057be4a5, 0x0583e4a5, 0x058be4a5, 0x0593e4a5,\n\t0x059be4a5, 0x05a3e4a5, 0x05abe4a5, 0x05b3e4a5,\n\t0x05bbe4a5, 0x05c3e4a5, 0x05cbe4a5, 0x05d3e4a5,\n\t0x05dbe4a5, 0x05e3e4a5, 0x05ebe4a5, 0x05f3e4a5,\n\t0x05fbe4a5, 0x060be4a5, 0x061be4a5, 0x062be4a5,\n\t0x063be4a5, 0x064be4a5, 0x065be4a5, 0x465be4a5,\n\t/* The last entry is extra; it is equal to LZMS_MAX_MATCH_OFFSET + 1 and\n\t * is here to aid binary search.  */\n};\n\n/* Table: offset slot => number of extra offset bits  */\nconst u8 lzms_extra_offset_bits[LZMS_MAX_NUM_OFFSET_SYMS] = {\n\t0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2,\n\t2 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4,\n\t4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5,\n\t5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6,\n\t7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7,\n\t7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8,\n\t8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9,\n\t9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9,\n\t9 , 9 , 9 , 9 , 9 , 9 , 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n\t10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n\t10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n\t11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n\t11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12,\n\t12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n\t12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n\t12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13,\n\t13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n\t13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n\t13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n\t14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n\t14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n\t14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n\t14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n\t15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n\t15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n\t15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n\t15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16,\n\t16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n\t16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n\t16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n\t16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n\t16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17,\n\t17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,\n\t17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,\n\t17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,\n\t17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,\n\t17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,\n\t18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,\n\t18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,\n\t18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,\n\t18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,\n\t18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,\n\t18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19,\n\t19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,\n\t19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,\n\t19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,\n\t19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,\n\t19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,\n\t19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,\n\t19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 30,\n};\n\n/* Table: length slot => length slot base value  */\nconst u32 lzms_length_slot_base[LZMS_NUM_LENGTH_SYMS + 1] = {\n\t0x00000001, 0x00000002, 0x00000003, 0x00000004,\n\t0x00000005, 0x00000006, 0x00000007, 0x00000008,\n\t0x00000009, 0x0000000a, 0x0000000b, 0x0000000c,\n\t0x0000000d, 0x0000000e, 0x0000000f, 0x00000010,\n\t0x00000011, 0x00000012, 0x00000013, 0x00000014,\n\t0x00000015, 0x00000016, 0x00000017, 0x00000018,\n\t0x00000019, 0x0000001a, 0x0000001b, 0x0000001d,\n\t0x0000001f, 0x00000021, 0x00000023, 0x00000027,\n\t0x0000002b, 0x0000002f, 0x00000033, 0x00000037,\n\t0x0000003b, 0x00000043, 0x0000004b, 0x00000053,\n\t0x0000005b, 0x0000006b, 0x0000007b, 0x0000008b,\n\t0x0000009b, 0x000000ab, 0x000000cb, 0x000000eb,\n\t0x0000012b, 0x000001ab, 0x000002ab, 0x000004ab,\n\t0x000008ab, 0x000108ab, 0x400108ab,\n\t/* The last entry is extra; it is equal to LZMS_MAX_MATCH_LENGTH + 1 and\n\t * is here to aid binary search.  */\n};\n\n/* Table: length slot => number of extra length bits  */\nconst u8 lzms_extra_length_bits[LZMS_NUM_LENGTH_SYMS] = {\n\t0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,\n\t0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,\n\t0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,\n\t0 , 0 , 1 , 1 , 1 , 1 , 2 , 2 ,\n\t2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 ,\n\t4 , 4 , 4 , 4 , 4 , 5 , 5 , 6 ,\n\t7 , 8 , 9 , 10, 16, 30,\n};\n\nunsigned\nlzms_get_slot(u32 value, const u32 slot_base_tab[], unsigned num_slots)\n{\n\tunsigned l = 0;\n\tunsigned r = num_slots - 1;\n\tfor (;;) {\n\t\tunsigned slot = (l + r) / 2;\n\t\tif (value >= slot_base_tab[slot]) {\n\t\t\tif (value < slot_base_tab[slot + 1])\n\t\t\t\treturn slot;\n\t\t\telse\n\t\t\t\tl = slot + 1;\n\t\t} else {\n\t\t\tr = slot - 1;\n\t\t}\n\t}\n}\n\n/* Return the number of offset slots used when processing a buffer having the\n * specified uncompressed size.  */\nunsigned\nlzms_get_num_offset_slots(size_t uncompressed_size)\n{\n\tif (uncompressed_size < 2)\n\t\treturn 0;\n\treturn 1 + lzms_get_offset_slot(uncompressed_size - 1);\n}\n\nvoid\nlzms_init_probabilities(struct lzms_probabilites *probs)\n{\n\tstruct lzms_probability_entry *entries =\n\t\t(struct lzms_probability_entry *)probs;\n\tsize_t num_entries = sizeof(struct lzms_probabilites) /\n\t\t\t     sizeof(struct lzms_probability_entry);\n\tfor (size_t i = 0; i < num_entries; i++) {\n\t\tentries[i].num_recent_zero_bits = LZMS_INITIAL_PROBABILITY;\n\t\tentries[i].recent_bits = LZMS_INITIAL_RECENT_BITS;\n\t}\n}\n\nvoid\nlzms_init_symbol_frequencies(u32 freqs[], unsigned num_syms)\n{\n\tfor (unsigned sym = 0; sym < num_syms; sym++)\n\t\tfreqs[sym] = 1;\n}\n\nvoid\nlzms_dilute_symbol_frequencies(u32 freqs[], unsigned num_syms)\n{\n\tfor (unsigned sym = 0; sym < num_syms; sym++)\n\t\tfreqs[sym] = (freqs[sym] >> 1) + 1;\n}\n\n\n#ifdef __x86_64__\nstatic forceinline u8 *\nfind_next_opcode_sse4_2(u8 *p)\n{\n\tconst __v16qi potential_opcodes = (__v16qi) {0x48, 0x4C, 0xE8, 0xE9, 0xF0, 0xFF};\n\t__asm__(\n\t\t\"  pcmpestri $0x0, (%[p]), %[potential_opcodes]      \\n\"\n\t\t\"  jc 2f                                             \\n\"\n\t\t\"1:                                                  \\n\"\n\t\t\"  add $0x10, %[p]                                   \\n\"\n\t\t\"  pcmpestri $0x0, (%[p]), %[potential_opcodes]      \\n\"\n\t\t\"  jnc 1b                                            \\n\"\n\t\t\"2:                                                  \\n\"\n\t#ifdef __ILP32__ /* x32 ABI (x86_64 with 32-bit pointers) */\n\t\t\"  add %%ecx, %[p]                                   \\n\"\n\t#else\n\t\t\"  add %%rcx, %[p]                                   \\n\"\n\t#endif\n\t\t: [p] \"+r\" (p)\n\t\t: [potential_opcodes] \"x\" (potential_opcodes), \"a\" (6), \"d\" (16)\n\t\t: \"rcx\", \"cc\"\n\t       );\n\n\treturn p;\n}\n#endif /* __x86_64__ */\n\nstatic forceinline u8 *\nfind_next_opcode_default(u8 *p)\n{\n\t/*\n\t * The following table is used to accelerate the common case where the\n\t * byte has nothing to do with x86 translation and must simply be\n\t * skipped.  This was faster than the following alternatives:\n\t *\t- Jump table with 256 entries\n\t *\t- Switch statement with default\n\t */\n\tstatic const u8 is_potential_opcode[256] = {\n\t\t[0x48] = 1, [0x4C] = 1, [0xE8] = 1,\n\t\t[0xE9] = 1, [0xF0] = 1, [0xFF] = 1,\n\t};\n\n\tfor (;;) {\n\t\tif (is_potential_opcode[*p])\n\t\t\tbreak;\n\t\tp++;\n\t\tif (is_potential_opcode[*p])\n\t\t\tbreak;\n\t\tp++;\n\t\tif (is_potential_opcode[*p])\n\t\t\tbreak;\n\t\tp++;\n\t\tif (is_potential_opcode[*p])\n\t\t\tbreak;\n\t\tp++;\n\t}\n\treturn p;\n}\n\nstatic forceinline u8 *\ntranslate_if_needed(u8 *data, u8 *p, s32 *last_x86_pos,\n\t\t    s32 last_target_usages[], bool undo)\n{\n\ts32 max_trans_offset;\n\ts32 opcode_nbytes;\n\tu16 target16;\n\ts32 i;\n\n\tmax_trans_offset = LZMS_X86_MAX_TRANSLATION_OFFSET;\n\n\t/*\n\t * p[0] has one of the following values:\n\t *\t0x48 0x4C 0xE8 0xE9 0xF0 0xFF\n\t */\n\n\tif (p[0] >= 0xF0) {\n\t\tif (p[0] & 0x0F) {\n\t\t\t/* 0xFF (instruction group)  */\n\t\t\tif (p[1] == 0x15) {\n\t\t\t\t/* Call indirect relative  */\n\t\t\t\topcode_nbytes = 2;\n\t\t\t\tgoto have_opcode;\n\t\t\t}\n\t\t} else {\n\t\t\t/* 0xF0 (lock prefix)  */\n\t\t\tif (p[1] == 0x83 && p[2] == 0x05) {\n\t\t\t\t/* Lock add relative  */\n\t\t\t\topcode_nbytes = 3;\n\t\t\t\tgoto have_opcode;\n\t\t\t}\n\t\t}\n\t} else if (p[0] <= 0x4C) {\n\n\t\t/* 0x48 or 0x4C.  In 64-bit code this is a REX prefix byte with\n\t\t * W=1, R=[01], X=0, and B=0, and it will be followed by the\n\t\t * actual opcode, then additional bytes depending on the opcode.\n\t\t * We are most interested in several common instructions that\n\t\t * access data relative to the instruction pointer.  These use a\n\t\t * 1-byte opcode, followed by a ModR/M byte, followed by a\n\t\t * 4-byte displacement.  */\n\n\t\t/* Test: does the ModR/M byte indicate RIP-relative addressing?\n\t\t * Note: there seems to be a mistake in the format here; the\n\t\t * mask really should be 0xC7 instead of 0x07 so that both the\n\t\t * MOD and R/M fields of ModR/M are tested, not just R/M.  */\n\t\tif ((p[2] & 0x07) == 0x05) {\n\t\t\t/* Check for the LEA (load effective address) or MOV\n\t\t\t * (move) opcodes.  For MOV there are additional\n\t\t\t * restrictions, although it seems they are only helpful\n\t\t\t * due to the overly lax ModR/M test.  */\n\t\t\tif (p[1] == 0x8D ||\n\t\t\t    (p[1] == 0x8B && !(p[0] & 0x04) && !(p[2] & 0xF0)))\n\t\t\t{\n\t\t\t\topcode_nbytes = 3;\n\t\t\t\tgoto have_opcode;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif (p[0] & 0x01) {\n\t\t\t/* 0xE9: Jump relative.  Theoretically this would be\n\t\t\t * useful to translate, but in fact it's explicitly\n\t\t\t * excluded.  Most likely it creates too many false\n\t\t\t * positives for the detection algorithm.  */\n\t\t\tp += 4;\n\t\t} else {\n\t\t\t/* 0xE8: Call relative.  This is a common case, so it\n\t\t\t * uses a reduced max_trans_offset.  In other words, we\n\t\t\t * have to be more confident that the data actually is\n\t\t\t * x86 machine code before we'll do the translation.  */\n\t\t\topcode_nbytes = 1;\n\t\t\tmax_trans_offset >>= 1;\n\t\t\tgoto have_opcode;\n\t\t}\n\t}\n\n\treturn p + 1;\n\nhave_opcode:\n\ti = p - data;\n\tp += opcode_nbytes;\n\tif (undo) {\n\t\tif (i - *last_x86_pos <= max_trans_offset) {\n\t\t\tu32 n = get_unaligned_le32(p);\n\t\t\tput_unaligned_le32(n - i, p);\n\t\t}\n\t\ttarget16 = i + get_unaligned_le16(p);\n\t} else {\n\t\ttarget16 = i + get_unaligned_le16(p);\n\t\tif (i - *last_x86_pos <= max_trans_offset) {\n\t\t\tu32 n = get_unaligned_le32(p);\n\t\t\tput_unaligned_le32(n + i, p);\n\t\t}\n\t}\n\n\ti += opcode_nbytes + sizeof(le32) - 1;\n\n\tif (i - last_target_usages[target16] <= LZMS_X86_ID_WINDOW_SIZE)\n\t\t*last_x86_pos = i;\n\n\tlast_target_usages[target16] = i;\n\n\treturn p + sizeof(le32);\n}\n\n/*\n * Translate relative addresses embedded in x86 instructions into absolute\n * addresses (@undo == %false), or undo this translation (@undo == %true).\n *\n * Absolute addresses are usually more compressible by LZ factorization.\n *\n * @last_target_usages must be a temporary array of length >= 65536.\n */\nvoid\nlzms_x86_filter(u8* restrict data, s32 size,\n\t\ts32* restrict last_target_usages, bool undo)\n{\n\t/*\n\t * Note: this filter runs unconditionally and uses a custom algorithm to\n\t * detect data regions that probably contain x86 code.\n\t *\n\t * 'last_x86_pos' tracks the most recent position that has a good chance\n\t * of being the start of an x86 instruction.  When the filter detects a\n\t * likely x86 instruction, it updates this variable and considers the\n\t * next LZMS_X86_MAX_TRANSLATION_OFFSET bytes of data as valid for x86\n\t * translations.\n\t *\n\t * If part of the data does not, in fact, contain x86 machine code, then\n\t * 'last_x86_pos' will, very likely, eventually fall more than\n\t * LZMS_X86_MAX_TRANSLATION_OFFSET bytes behind the current position.\n\t * This results in x86 translations being disabled until the next likely\n\t * x86 instruction is detected.\n\t *\n\t * To identify \"likely x86 instructions\", the algorithm attempts to\n\t * track the position of the most recent potential relative-addressing\n\t * instruction that referenced each possible memory address.  If it\n\t * finds two references to the same memory address within an\n\t * LZMS_X86_ID_WINDOW_SIZE-byte sized window, then the second reference\n\t * is flagged as a likely x86 instruction.  Since the instructions\n\t * considered for translation necessarily use relative addressing, the\n\t * algorithm does a tentative translation into absolute addresses.  In\n\t * addition, so that memory addresses can be looked up in an array of\n\t * reasonable size (in this code, 'last_target_usages'), only the\n\t * low-order 2 bytes of each address are considered significant.\n\t */\n\n\tu8 *p;\n\tu8 *tail_ptr;\n\ts32 last_x86_pos = -LZMS_X86_MAX_TRANSLATION_OFFSET - 1;\n\n\tif (size <= 17)\n\t\treturn;\n\n\tfor (s32 i = 0; i < 65536; i++)\n\t\tlast_target_usages[i] = -(s32)LZMS_X86_ID_WINDOW_SIZE - 1;\n\n\t/*\n\t * Optimization: only check for end-of-buffer when we already have a\n\t * byte that is a potential opcode for x86 translation.  To do this,\n\t * overwrite one of the bytes near the end of the buffer, and restore it\n\t * later.  The correctness of this optimization relies on two\n\t * characteristics of compressed format:\n\t *\n\t *  1. No translation can follow an opcode beginning in the last 16\n\t *     bytes.\n\t *  2. A translation following an opcode starting at the last possible\n\t *     position (17 bytes from the end) never extends more than 7 bytes.\n\t *     Consequently, we can overwrite any of the bytes starting at\n\t *     data[(size - 16) + 7] and have no effect on the result, as long\n\t *     as we restore those bytes later.\n\t */\n\n\t/* Note: the very first byte must be ignored completely!  */\n\tp = data + 1;\n\ttail_ptr = &data[size - 16];\n\n#ifdef __x86_64__\n\tif (cpu_features & X86_CPU_FEATURE_SSE4_2) {\n\t\tu8 saved_byte = *tail_ptr;\n\t\t*tail_ptr = 0xE8;\n\t\tfor (;;) {\n\t\t\tu8 *new_p = find_next_opcode_sse4_2(p);\n\t\t\tif (new_p >= tail_ptr - 8)\n\t\t\t\tbreak;\n\t\t\tp = new_p;\n\t\t\tp = translate_if_needed(data, p, &last_x86_pos,\n\t\t\t\t\t\tlast_target_usages, undo);\n\t\t}\n\t\t*tail_ptr = saved_byte;\n\t}\n#endif\n\t{\n\t\tu8 saved_byte = *(tail_ptr + 8);\n\t\t*(tail_ptr + 8) = 0xE8;\n\t\tfor (;;) {\n\t\t\tp = find_next_opcode_default(p);\n\t\t\tif (p >= tail_ptr)\n\t\t\t\tbreak;\n\t\t\tp = translate_if_needed(data, p, &last_x86_pos,\n\t\t\t\t\t\tlast_target_usages, undo);\n\t\t}\n\t\t*(tail_ptr + 8) = saved_byte;\n\t}\n}\n"
  },
  {
    "path": "src/wimlib/lzms_compress.c",
    "content": "/*\n * lzms_compress.c\n *\n * A compressor for the LZMS compression format.\n */\n\n/*\n * Copyright (C) 2013, 2014, 2015 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <limits.h>\n#include <string.h>\n\n#include \"wimlib/compress_common.h\"\n#include \"wimlib/compressor_ops.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/lcpit_matchfinder.h\"\n#include \"wimlib/lzms_common.h\"\n#include \"wimlib/matchfinder_common.h\"\n#include \"wimlib/unaligned.h\"\n#include \"wimlib/util.h\"\n\n/*\n * MAX_FAST_LENGTH is the maximum match length for which the length slot can be\n * looked up directly in 'fast_length_slot_tab' and the length cost can be\n * looked up directly in 'fast_length_cost_tab'.\n *\n * We also limit the 'nice_match_len' parameter to this value.  Consequently, if\n * the longest match found is shorter than 'nice_match_len', then it must also\n * be shorter than MAX_FAST_LENGTH.  This makes it possible to do fast lookups\n * of length costs using 'fast_length_cost_tab' without having to keep checking\n * whether the length exceeds MAX_FAST_LENGTH or not.\n */\n#define MAX_FAST_LENGTH\t\t255\n\n/* NUM_OPTIM_NODES is the maximum number of bytes the parsing algorithm will\n * step forward before forcing the pending items to be encoded.  If this value\n * is increased, then there will be fewer forced flushes, but the probability\n * entries and Huffman codes will be more likely to become outdated.  */\n#define NUM_OPTIM_NODES\t\t2048\n\n/* COST_SHIFT is a scaling factor that makes it possible to consider fractional\n * bit costs.  A single bit has a cost of (1 << COST_SHIFT).  */\n#define COST_SHIFT\t\t6\n\n/* Length of the hash table for finding delta matches  */\n#define DELTA_HASH_ORDER\t17\n#define DELTA_HASH_LENGTH\t((u32)1 << DELTA_HASH_ORDER)\n\n/* The number of bytes to hash when finding delta matches; also taken to be the\n * minimum length of an explicit offset delta match  */\n#define NBYTES_HASHED_FOR_DELTA\t3\n\n/* The number of delta match powers to consider (must be <=\n * LZMS_NUM_DELTA_POWER_SYMS)  */\n#define NUM_POWERS_TO_CONSIDER\t6\n\n/* This structure tracks the state of writing bits as a series of 16-bit coding\n * units, starting at the end of the output buffer and proceeding backwards.  */\nstruct lzms_output_bitstream {\n\n\t/* Bits that haven't yet been written to the output buffer  */\n\tu64 bitbuf;\n\n\t/* Number of bits currently held in @bitbuf  */\n\tunsigned bitcount;\n\n\t/* Pointer to the beginning of the output buffer (this is the \"end\" when\n\t * writing backwards!)  */\n\tu8 *begin;\n\n\t/* Pointer to just past the next position in the output buffer at which\n\t * to output a 16-bit coding unit  */\n\tu8 *next;\n};\n\n/* This structure tracks the state of range encoding and its output, which\n * starts at the beginning of the output buffer and proceeds forwards.  */\nstruct lzms_range_encoder {\n\n\t/* The lower boundary of the current range.  Logically, this is a 33-bit\n\t * integer whose high bit is needed to detect carries.  */\n\tu64 lower_bound;\n\n\t/* The size of the current range  */\n\tu32 range_size;\n\n\t/* The next 16-bit coding unit to output  */\n\tu16 cache;\n\n\t/* The number of 16-bit coding units whose output has been delayed due\n\t * to possible carrying.  The first such coding unit is @cache; all\n\t * subsequent such coding units are 0xffff.  */\n\tu32 cache_size;\n\n\t/* Pointer to the beginning of the output buffer  */\n\tu8 *begin;\n\n\t/* Pointer to the position in the output buffer at which the next coding\n\t * unit must be written  */\n\tu8 *next;\n\n\t/* Pointer to just past the end of the output buffer  */\n\tu8 *end;\n};\n\n/* Bookkeeping information for an adaptive Huffman code  */\nstruct lzms_huffman_rebuild_info {\n\n\t/* The remaining number of symbols to encode until this code must be\n\t * rebuilt  */\n\tunsigned num_syms_until_rebuild;\n\n\t/* The number of symbols in this code  */\n\tunsigned num_syms;\n\n\t/* The rebuild frequency of this code, in symbols  */\n\tunsigned rebuild_freq;\n\n\t/* The Huffman codeword of each symbol in this code  */\n\tu32 *codewords;\n\n\t/* The length of each Huffman codeword, in bits  */\n\tu8 *lens;\n\n\t/* The frequency of each symbol in this code  */\n\tu32 *freqs;\n};\n\n/*\n * The compressor-internal representation of a match or literal.\n *\n * Literals have length=1; matches have length > 1.  (We disallow matches of\n * length 1, even though this is a valid length in LZMS.)\n *\n * The source is encoded as follows:\n *\n * - Literals: the literal byte itself\n * - Explicit offset LZ matches: the match offset plus (LZMS_NUM_LZ_REPS - 1)\n * - Repeat offset LZ matches: the index of the offset in recent_lz_offsets\n * - Explicit offset delta matches: DELTA_SOURCE_TAG is set, the next 3 bits are\n *   the power, and the remainder is the raw offset plus (LZMS_NUM_DELTA_REPS-1)\n * - Repeat offset delta matches: DELTA_SOURCE_TAG is set, and the remainder is\n *   the index of the (power, raw_offset) pair in recent_delta_pairs\n */\nstruct lzms_item {\n\tu32 length;\n\tu32 source;\n};\n\n#define DELTA_SOURCE_TAG\t\t((u32)1 << 31)\n#define DELTA_SOURCE_POWER_SHIFT\t28\n#define DELTA_SOURCE_RAW_OFFSET_MASK\t(((u32)1 << DELTA_SOURCE_POWER_SHIFT) - 1)\n\nstatic void __attribute__((unused))\ncheck_that_powers_fit_in_bitfield(void)\n{\n\tSTATIC_ASSERT(LZMS_NUM_DELTA_POWER_SYMS <= (1 << (31 - DELTA_SOURCE_POWER_SHIFT)));\n}\n\n/* A stripped-down version of the adaptive state in LZMS which excludes the\n * probability entries and Huffman codes  */\nPRAGMA_BEGIN_ALIGN(64)\nstruct lzms_adaptive_state {\n\n\t/* Recent offsets for LZ matches  */\n\tu32 recent_lz_offsets[LZMS_NUM_LZ_REPS + 1];\n\tu32 prev_lz_offset; /* 0 means none */\n\tu32 upcoming_lz_offset; /* 0 means none */\n\n\t/* Recent (power, raw offset) pairs for delta matches.\n\t * The low DELTA_SOURCE_POWER_SHIFT bits of each entry are the raw\n\t * offset, and the high bits are the power.  */\n\tu32 recent_delta_pairs[LZMS_NUM_DELTA_REPS + 1];\n\tu32 prev_delta_pair; /* 0 means none */\n\tu32 upcoming_delta_pair; /* 0 means none  */\n\n\t/* States for predicting the probabilities of item types  */\n\tu8 main_state;\n\tu8 match_state;\n\tu8 lz_state;\n\tu8 lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS];\n\tu8 delta_state;\n\tu8 delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS];\n} PRAGMA_END_ALIGN(64);\n\n/*\n * This structure represents a byte position in the preprocessed input data and\n * a node in the graph of possible match/literal choices.\n *\n * Logically, each incoming edge to this node is labeled with a literal or a\n * match that can be taken to reach this position from an earlier position; and\n * each outgoing edge from this node is labeled with a literal or a match that\n * can be taken to advance from this position to a later position.\n */\nPRAGMA_BEGIN_ALIGN(64)\nstruct lzms_optimum_node {\n\n\t/*\n\t * The cost of the lowest-cost path that has been found to reach this\n\t * position.  This can change as progressively lower cost paths are\n\t * found to reach this position.\n\t */\n\tu32 cost;\n#define INFINITE_COST UINT32_MAX\n\n\t/*\n\t * @item is the last item that was taken to reach this position to reach\n\t * it with the stored @cost.  This can change as progressively lower\n\t * cost paths are found to reach this position.\n\t *\n\t * In some cases we look ahead more than one item.  If we looked ahead n\n\t * items to reach this position, then @item is the last item taken,\n\t * @extra_items contains the other items ordered from second-to-last to\n\t * first, and @num_extra_items is n - 1.\n\t */\n\tunsigned num_extra_items;\n\tstruct lzms_item item;\n\tstruct lzms_item extra_items[2];\n\n\t/*\n\t * The adaptive state that exists at this position.  This is filled in\n\t * lazily, only after the minimum-cost path to this position is found.\n\t *\n\t * Note: the way the algorithm handles this adaptive state in the\n\t * \"minimum-cost\" parse is actually only an approximation.  It's\n\t * possible for the globally optimal, minimum cost path to contain a\n\t * prefix, ending at a position, where that path prefix is *not* the\n\t * minimum cost path to that position.  This can happen if such a path\n\t * prefix results in a different adaptive state which results in lower\n\t * costs later.  Although the algorithm does do some heuristic\n\t * multi-item lookaheads, it does not solve this problem in general.\n\t *\n\t * Note: this adaptive state structure also does not include the\n\t * probability entries or current Huffman codewords.  Those aren't\n\t * maintained per-position and are only updated occasionally.\n\t */\n\tstruct lzms_adaptive_state state;\n} PRAGMA_END_ALIGN(64);\n\n/* The main compressor structure  */\nstruct lzms_compressor {\n\n\t/* The matchfinder for LZ matches  */\n\tstruct lcpit_matchfinder mf;\n\n\t/* The preprocessed buffer of data being compressed  */\n\tu8 *in_buffer;\n\n\t/* The number of bytes of data to be compressed, which is the number of\n\t * bytes of data in @in_buffer that are actually valid  */\n\tsize_t in_nbytes;\n\n\t/*\n\t * Boolean flags to enable consideration of various types of multi-step\n\t * operations during parsing.\n\t *\n\t * Among other cases, multi-step operations can help with gaps where two\n\t * matches are separated by a non-matching byte.\n\t *\n\t * This idea is borrowed from Igor Pavlov's LZMA encoder.\n\t */\n\tbool try_lit_lzrep0;\n\tbool try_lzrep_lit_lzrep0;\n\tbool try_lzmatch_lit_lzrep0;\n\n\t/*\n\t * If true, the compressor can use delta matches.  This slows down\n\t * compression.  It improves the compression ratio greatly, slightly, or\n\t * not at all, depending on the input data.\n\t */\n\tbool use_delta_matches;\n\n\t/* If true, the compressor need not preserve the input buffer if it\n\t * compresses the data successfully.  */\n\tbool destructive;\n\n\t/* 'last_target_usages' is a large array that is only needed for\n\t * preprocessing, so it is in union with fields that don't need to be\n\t * initialized until after preprocessing.  */\n\tunion {\n\tstruct {\n\n\t/* Temporary space to store matches found by the LZ matchfinder  */\n\tstruct lz_match matches[MAX_FAST_LENGTH - LZMS_MIN_MATCH_LENGTH + 1];\n\n\t/* Hash table for finding delta matches  */\n\tu32 delta_hash_table[DELTA_HASH_LENGTH];\n\n\t/* For each delta power, the hash code for the next sequence  */\n\tu32 next_delta_hashes[NUM_POWERS_TO_CONSIDER];\n\n\t/* The per-byte graph nodes for near-optimal parsing  */\n\tstruct lzms_optimum_node optimum_nodes[NUM_OPTIM_NODES + MAX_FAST_LENGTH +\n\t\t\t\t\t       1 + MAX_FAST_LENGTH];\n\n\t/* Table: length => current cost for small match lengths  */\n\tu32 fast_length_cost_tab[MAX_FAST_LENGTH + 1];\n\n\t/* Range encoder which outputs to the beginning of the compressed data\n\t * buffer, proceeding forwards  */\n\tstruct lzms_range_encoder rc;\n\n\t/* Bitstream which outputs to the end of the compressed data buffer,\n\t * proceeding backwards  */\n\tstruct lzms_output_bitstream os;\n\n\t/* States and probability entries for item type disambiguation  */\n\tunsigned main_state;\n\tunsigned match_state;\n\tunsigned lz_state;\n\tunsigned lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS];\n\tunsigned delta_state;\n\tunsigned delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS];\n\tstruct lzms_probabilites probs;\n\n\t/* Huffman codes  */\n\n\tstruct lzms_huffman_rebuild_info literal_rebuild_info;\n\tu32 literal_codewords[LZMS_NUM_LITERAL_SYMS];\n\tu8 literal_lens[LZMS_NUM_LITERAL_SYMS];\n\tu32 literal_freqs[LZMS_NUM_LITERAL_SYMS];\n\n\tstruct lzms_huffman_rebuild_info lz_offset_rebuild_info;\n\tu32 lz_offset_codewords[LZMS_MAX_NUM_OFFSET_SYMS];\n\tu8 lz_offset_lens[LZMS_MAX_NUM_OFFSET_SYMS];\n\tu32 lz_offset_freqs[LZMS_MAX_NUM_OFFSET_SYMS];\n\n\tstruct lzms_huffman_rebuild_info length_rebuild_info;\n\tu32 length_codewords[LZMS_NUM_LENGTH_SYMS];\n\tu8 length_lens[LZMS_NUM_LENGTH_SYMS];\n\tu32 length_freqs[LZMS_NUM_LENGTH_SYMS];\n\n\tstruct lzms_huffman_rebuild_info delta_offset_rebuild_info;\n\tu32 delta_offset_codewords[LZMS_MAX_NUM_OFFSET_SYMS];\n\tu8 delta_offset_lens[LZMS_MAX_NUM_OFFSET_SYMS];\n\tu32 delta_offset_freqs[LZMS_MAX_NUM_OFFSET_SYMS];\n\n\tstruct lzms_huffman_rebuild_info delta_power_rebuild_info;\n\tu32 delta_power_codewords[LZMS_NUM_DELTA_POWER_SYMS];\n\tu8 delta_power_lens[LZMS_NUM_DELTA_POWER_SYMS];\n\tu32 delta_power_freqs[LZMS_NUM_DELTA_POWER_SYMS];\n\n\t}; /* struct */\n\n\ts32 last_target_usages[65536];\n\n\t}; /* union */\n\n\t/* Table: length => length slot for small match lengths  */\n\tu8 fast_length_slot_tab[MAX_FAST_LENGTH + 1];\n\n\t/* Tables for mapping offsets to offset slots  */\n\n\t/* slots [0, 167); 0 <= num_extra_bits <= 10 */\n\tu8 offset_slot_tab_1[0xe4a5];\n\n\t/* slots [167, 427); 11 <= num_extra_bits <= 15 */\n\tu16 offset_slot_tab_2[0x3d0000 >> 11];\n\n\t/* slots [427, 799); 16 <= num_extra_bits  */\n\tu16 offset_slot_tab_3[((LZMS_MAX_MATCH_OFFSET + 1) - 0xe4a5) >> 16];\n};\n\n/******************************************************************************\n *                   Offset and length slot acceleration                      *\n ******************************************************************************/\n\n/* Generate the acceleration table for length slots.  */\nstatic void\nlzms_init_fast_length_slot_tab(struct lzms_compressor *c)\n{\n\tunsigned slot = 0;\n\tfor (u32 len = LZMS_MIN_MATCH_LENGTH; len <= MAX_FAST_LENGTH; len++) {\n\t\tif (len >= lzms_length_slot_base[slot + 1])\n\t\t\tslot++;\n\t\tc->fast_length_slot_tab[len] = slot;\n\t}\n}\n\n/* Generate the acceleration tables for offset slots.  */\nstatic void\nlzms_init_offset_slot_tabs(struct lzms_compressor *c)\n{\n\tu32 offset;\n\tunsigned slot = 0;\n\n\t/* slots [0, 167); 0 <= num_extra_bits <= 10 */\n\tfor (offset = 1; offset < 0xe4a5; offset++) {\n\t\tif (offset >= lzms_offset_slot_base[slot + 1])\n\t\t\tslot++;\n\t\tc->offset_slot_tab_1[offset] = slot;\n\t}\n\n\t/* slots [167, 427); 11 <= num_extra_bits <= 15 */\n\tfor (; offset < 0x3de4a5; offset += (u32)1 << 11) {\n\t\tif (offset >= lzms_offset_slot_base[slot + 1])\n\t\t\tslot++;\n\t\tc->offset_slot_tab_2[(offset - 0xe4a5) >> 11] = slot;\n\t}\n\n\t/* slots [427, 799); 16 <= num_extra_bits  */\n\tfor (; offset < LZMS_MAX_MATCH_OFFSET + 1; offset += (u32)1 << 16) {\n\t\tif (offset >= lzms_offset_slot_base[slot + 1])\n\t\t\tslot++;\n\t\tc->offset_slot_tab_3[(offset - 0xe4a5) >> 16] = slot;\n\t}\n}\n\n/*\n * Return the length slot for the specified match length, using the compressor's\n * acceleration table if the length is small enough.\n */\nstatic forceinline unsigned\nlzms_comp_get_length_slot(const struct lzms_compressor *c, u32 length)\n{\n\tif (likely(length <= MAX_FAST_LENGTH))\n\t\treturn c->fast_length_slot_tab[length];\n\treturn lzms_get_length_slot(length);\n}\n\n/*\n * Return the offset slot for the specified match offset, using the compressor's\n * acceleration tables to speed up the mapping.\n */\nstatic forceinline unsigned\nlzms_comp_get_offset_slot(const struct lzms_compressor *c, u32 offset)\n{\n\tif (offset < 0xe4a5)\n\t\treturn c->offset_slot_tab_1[offset];\n\toffset -= 0xe4a5;\n\tif (offset < 0x3d0000)\n\t\treturn c->offset_slot_tab_2[offset >> 11];\n\treturn c->offset_slot_tab_3[offset >> 16];\n}\n\n/******************************************************************************\n *                             Range encoding                                 *\n ******************************************************************************/\n\n/*\n * Initialize the range encoder @rc to write forwards to the specified buffer\n * @out that is @size bytes long.\n */\nstatic void\nlzms_range_encoder_init(struct lzms_range_encoder *rc, u8 *out, size_t size)\n{\n\trc->lower_bound = 0;\n\trc->range_size = 0xffffffff;\n\trc->cache = 0;\n\trc->cache_size = 1;\n\trc->begin = out;\n\trc->next = out - sizeof(le16);\n\trc->end = out + (size & ~1);\n}\n\n/*\n * Attempt to flush bits from the range encoder.\n *\n * The basic idea is that we're writing bits from @rc->lower_bound to the\n * output.  However, due to carrying, the writing of coding units with the\n * maximum value, as well as one prior coding unit, must be delayed until it is\n * determined whether a carry is needed.\n *\n * This is based on the public domain code for LZMA written by Igor Pavlov, but\n * with the following differences:\n *\n *\t- In LZMS, 16-bit coding units are required rather than 8-bit.\n *\n *\t- In LZMS, the first coding unit is not ignored by the decompressor, so\n *\t  the encoder cannot output a dummy value to that position.\n */\nstatic void\nlzms_range_encoder_shift_low(struct lzms_range_encoder *rc)\n{\n\tif ((u32)(rc->lower_bound) < 0xffff0000 ||\n\t    (u32)(rc->lower_bound >> 32) != 0)\n\t{\n\t\t/* Carry not needed (rc->lower_bound < 0xffff0000), or carry\n\t\t * occurred ((rc->lower_bound >> 32) != 0, a.k.a. the carry bit\n\t\t * is 1).  */\n\t\tdo {\n\t\t\tif (likely(rc->next >= rc->begin)) {\n\t\t\t\tif (rc->next != rc->end) {\n\t\t\t\t\tput_unaligned_le16(rc->cache +\n\t\t\t\t\t\t\t   (u16)(rc->lower_bound >> 32),\n\t\t\t\t\t\t\t   rc->next);\n\t\t\t\t\trc->next += sizeof(le16);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trc->next += sizeof(le16);\n\t\t\t}\n\t\t\trc->cache = 0xffff;\n\t\t} while (--rc->cache_size != 0);\n\n\t\trc->cache = (rc->lower_bound >> 16) & 0xffff;\n\t}\n\t++rc->cache_size;\n\trc->lower_bound = (rc->lower_bound & 0xffff) << 16;\n}\n\nstatic bool\nlzms_range_encoder_flush(struct lzms_range_encoder *rc)\n{\n\tfor (int i = 0; i < 4; i++)\n\t\tlzms_range_encoder_shift_low(rc);\n\treturn rc->next != rc->end;\n}\n\n/*\n * Encode the next bit using the range encoder.\n *\n * @prob is the probability out of LZMS_PROBABILITY_DENOMINATOR that the next\n * bit is 0 rather than 1.\n */\nstatic forceinline void\nlzms_range_encode_bit(struct lzms_range_encoder *rc, int bit, u32 prob)\n{\n\t/* Normalize if needed.  */\n\tif (rc->range_size <= 0xffff) {\n\t\trc->range_size <<= 16;\n\t\tlzms_range_encoder_shift_low(rc);\n\t}\n\n\tu32 bound = (rc->range_size >> LZMS_PROBABILITY_BITS) * prob;\n\tif (bit == 0) {\n\t\trc->range_size = bound;\n\t} else {\n\t\trc->lower_bound += bound;\n\t\trc->range_size -= bound;\n\t}\n}\n\n/*\n * Encode a bit.  This wraps around lzms_range_encode_bit() to handle using and\n * updating the state and its corresponding probability entry.\n */\nstatic forceinline void\nlzms_encode_bit(int bit, unsigned *state_p, unsigned num_states,\n\t\tstruct lzms_probability_entry *probs,\n\t\tstruct lzms_range_encoder *rc)\n{\n\tstruct lzms_probability_entry *prob_entry;\n\tu32 prob;\n\n\t/* Load the probability entry for the current state.  */\n\tprob_entry = &probs[*state_p];\n\n\t/* Update the state based on the next bit.  */\n\t*state_p = ((*state_p << 1) | bit) & (num_states - 1);\n\n\t/* Get the probability that the bit is 0.  */\n\tprob = lzms_get_probability(prob_entry);\n\n\t/* Update the probability entry.  */\n\tlzms_update_probability_entry(prob_entry, bit);\n\n\t/* Encode the bit using the range encoder.  */\n\tlzms_range_encode_bit(rc, bit, prob);\n}\n\n/* Helper functions for encoding bits in the various decision classes  */\n\nstatic void\nlzms_encode_main_bit(struct lzms_compressor *c, int bit)\n{\n\tlzms_encode_bit(bit, &c->main_state, LZMS_NUM_MAIN_PROBS,\n\t\t\tc->probs.main, &c->rc);\n}\n\nstatic void\nlzms_encode_match_bit(struct lzms_compressor *c, int bit)\n{\n\tlzms_encode_bit(bit, &c->match_state, LZMS_NUM_MATCH_PROBS,\n\t\t\tc->probs.match, &c->rc);\n}\n\nstatic void\nlzms_encode_lz_bit(struct lzms_compressor *c, int bit)\n{\n\tlzms_encode_bit(bit, &c->lz_state, LZMS_NUM_LZ_PROBS,\n\t\t\tc->probs.lz, &c->rc);\n}\n\nstatic void\nlzms_encode_lz_rep_bit(struct lzms_compressor *c, int bit, int idx)\n{\n\tlzms_encode_bit(bit, &c->lz_rep_states[idx], LZMS_NUM_LZ_REP_PROBS,\n\t\t\tc->probs.lz_rep[idx], &c->rc);\n}\n\nstatic void\nlzms_encode_delta_bit(struct lzms_compressor *c, int bit)\n{\n\tlzms_encode_bit(bit, &c->delta_state, LZMS_NUM_DELTA_PROBS,\n\t\t\tc->probs.delta, &c->rc);\n}\n\nstatic void\nlzms_encode_delta_rep_bit(struct lzms_compressor *c, int bit, int idx)\n{\n\tlzms_encode_bit(bit, &c->delta_rep_states[idx], LZMS_NUM_DELTA_REP_PROBS,\n\t\t\tc->probs.delta_rep[idx], &c->rc);\n}\n\n/******************************************************************************\n *                   Huffman encoding and verbatim bits                       *\n ******************************************************************************/\n\n/*\n * Initialize the output bitstream @os to write backwards to the specified\n * buffer @out that is @size bytes long.\n */\nstatic void\nlzms_output_bitstream_init(struct lzms_output_bitstream *os,\n\t\t\t   u8 *out, size_t size)\n{\n\tos->bitbuf = 0;\n\tos->bitcount = 0;\n\tos->begin = out;\n\tos->next = out + (size & ~1);\n}\n\n/*\n * Write some bits, contained in the low-order @num_bits bits of @bits, to the\n * output bitstream @os.\n *\n * @max_num_bits is a compile-time constant that specifies the maximum number of\n * bits that can ever be written at this call site.\n */\nstatic forceinline void\nlzms_write_bits(struct lzms_output_bitstream *os, const u32 bits,\n\t\tconst unsigned num_bits, const unsigned max_num_bits)\n{\n\t/* Add the bits to the bit buffer variable.  */\n\tos->bitcount += num_bits;\n\tos->bitbuf = (os->bitbuf << num_bits) | bits;\n\n\t/* Check whether any coding units need to be written.  */\n\twhile (os->bitcount >= 16) {\n\n\t\tos->bitcount -= 16;\n\n\t\t/* Write a coding unit, unless it would underflow the buffer. */\n\t\tif (os->next != os->begin) {\n\t\t\tos->next -= sizeof(le16);\n\t\t\tput_unaligned_le16(os->bitbuf >> os->bitcount, os->next);\n\t\t}\n\n\t\t/* Optimization for call sites that never write more than 16\n\t\t * bits at once.  */\n\t\tif (max_num_bits <= 16)\n\t\t\tbreak;\n\t}\n}\n\n/*\n * Flush the output bitstream, ensuring that all bits written to it have been\n * written to memory.  Return %true if all bits have been output successfully,\n * or %false if an overrun occurred.\n */\nstatic bool\nlzms_output_bitstream_flush(struct lzms_output_bitstream *os)\n{\n\tif (os->next == os->begin)\n\t\treturn false;\n\n\tif (os->bitcount != 0) {\n\t\tos->next -= sizeof(le16);\n\t\tput_unaligned_le16(os->bitbuf << (16 - os->bitcount), os->next);\n\t}\n\n\treturn true;\n}\n\nstatic void\nlzms_build_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info)\n{\n\tmake_canonical_huffman_code(rebuild_info->num_syms,\n\t\t\t\t    LZMS_MAX_CODEWORD_LENGTH,\n\t\t\t\t    rebuild_info->freqs,\n\t\t\t\t    rebuild_info->lens,\n\t\t\t\t    rebuild_info->codewords);\n\trebuild_info->num_syms_until_rebuild = rebuild_info->rebuild_freq;\n}\n\nstatic void\nlzms_init_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info,\n\t\t       unsigned num_syms, unsigned rebuild_freq,\n\t\t       u32 *codewords, u8 *lens, u32 *freqs)\n{\n\trebuild_info->num_syms = num_syms;\n\trebuild_info->rebuild_freq = rebuild_freq;\n\trebuild_info->codewords = codewords;\n\trebuild_info->lens = lens;\n\trebuild_info->freqs = freqs;\n\tlzms_init_symbol_frequencies(freqs, num_syms);\n\tlzms_build_huffman_code(rebuild_info);\n}\n\nstatic void\nlzms_rebuild_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info)\n{\n\tlzms_build_huffman_code(rebuild_info);\n\tlzms_dilute_symbol_frequencies(rebuild_info->freqs, rebuild_info->num_syms);\n}\n\n/*\n * Encode a symbol using the specified Huffman code.  Then, if the Huffman code\n * needs to be rebuilt, rebuild it and return true; otherwise return false.\n */\nstatic forceinline bool\nlzms_huffman_encode_symbol(unsigned sym,\n\t\t\t   const u32 *codewords, const u8 *lens, u32 *freqs,\n\t\t\t   struct lzms_output_bitstream *os,\n\t\t\t   struct lzms_huffman_rebuild_info *rebuild_info)\n{\n\tlzms_write_bits(os, codewords[sym], lens[sym], LZMS_MAX_CODEWORD_LENGTH);\n\t++freqs[sym];\n\tif (--rebuild_info->num_syms_until_rebuild == 0) {\n\t\tlzms_rebuild_huffman_code(rebuild_info);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/* Helper routines to encode symbols using the various Huffman codes  */\n\nstatic bool\nlzms_encode_literal_symbol(struct lzms_compressor *c, unsigned sym)\n{\n\treturn lzms_huffman_encode_symbol(sym, c->literal_codewords,\n\t\t\t\t\t  c->literal_lens, c->literal_freqs,\n\t\t\t\t\t  &c->os, &c->literal_rebuild_info);\n}\n\nstatic bool\nlzms_encode_lz_offset_symbol(struct lzms_compressor *c, unsigned sym)\n{\n\treturn lzms_huffman_encode_symbol(sym, c->lz_offset_codewords,\n\t\t\t\t\t  c->lz_offset_lens, c->lz_offset_freqs,\n\t\t\t\t\t  &c->os, &c->lz_offset_rebuild_info);\n}\n\nstatic bool\nlzms_encode_length_symbol(struct lzms_compressor *c, unsigned sym)\n{\n\treturn lzms_huffman_encode_symbol(sym, c->length_codewords,\n\t\t\t\t\t  c->length_lens, c->length_freqs,\n\t\t\t\t\t  &c->os, &c->length_rebuild_info);\n}\n\nstatic bool\nlzms_encode_delta_offset_symbol(struct lzms_compressor *c, unsigned sym)\n{\n\treturn lzms_huffman_encode_symbol(sym, c->delta_offset_codewords,\n\t\t\t\t\t  c->delta_offset_lens, c->delta_offset_freqs,\n\t\t\t\t\t  &c->os, &c->delta_offset_rebuild_info);\n}\n\nstatic bool\nlzms_encode_delta_power_symbol(struct lzms_compressor *c, unsigned sym)\n{\n\treturn lzms_huffman_encode_symbol(sym, c->delta_power_codewords,\n\t\t\t\t\t  c->delta_power_lens, c->delta_power_freqs,\n\t\t\t\t\t  &c->os, &c->delta_power_rebuild_info);\n}\n\nstatic void\nlzms_update_fast_length_costs(struct lzms_compressor *c);\n\n/*\n * Encode a match length.  If this causes the Huffman code for length symbols to\n * be rebuilt, also update the length costs array used by the parser.\n */\nstatic void\nlzms_encode_length(struct lzms_compressor *c, u32 length)\n{\n\tunsigned slot = lzms_comp_get_length_slot(c, length);\n\n\tif (lzms_encode_length_symbol(c, slot))\n\t\tlzms_update_fast_length_costs(c);\n\n\tlzms_write_bits(&c->os, length - lzms_length_slot_base[slot],\n\t\t\tlzms_extra_length_bits[slot],\n\t\t\tLZMS_MAX_EXTRA_LENGTH_BITS);\n}\n\n/* Encode the offset of an LZ match.  */\nstatic void\nlzms_encode_lz_offset(struct lzms_compressor *c, u32 offset)\n{\n\tunsigned slot = lzms_comp_get_offset_slot(c, offset);\n\n\tlzms_encode_lz_offset_symbol(c, slot);\n\tlzms_write_bits(&c->os, offset - lzms_offset_slot_base[slot],\n\t\t\tlzms_extra_offset_bits[slot],\n\t\t\tLZMS_MAX_EXTRA_OFFSET_BITS);\n}\n\n/* Encode the raw offset of a delta match.  */\nstatic void\nlzms_encode_delta_raw_offset(struct lzms_compressor *c, u32 raw_offset)\n{\n\tunsigned slot = lzms_comp_get_offset_slot(c, raw_offset);\n\n\tlzms_encode_delta_offset_symbol(c, slot);\n\tlzms_write_bits(&c->os, raw_offset - lzms_offset_slot_base[slot],\n\t\t\tlzms_extra_offset_bits[slot],\n\t\t\tLZMS_MAX_EXTRA_OFFSET_BITS);\n}\n\n/******************************************************************************\n *                             Item encoding                                  *\n ******************************************************************************/\n\n/* Encode the specified item, which may be a literal or any type of match.  */\nstatic void\nlzms_encode_item(struct lzms_compressor *c, u32 length, u32 source)\n{\n\t/* Main bit: 0 = literal, 1 = match  */\n\tint main_bit = (length > 1);\n\tlzms_encode_main_bit(c, main_bit);\n\n\tif (!main_bit) {\n\t\t/* Literal  */\n\t\tunsigned literal = source;\n\t\tlzms_encode_literal_symbol(c, literal);\n\t} else {\n\t\t/* Match  */\n\n\t\t/* Match bit: 0 = LZ match, 1 = delta match  */\n\t\tint match_bit = (source & DELTA_SOURCE_TAG) != 0;\n\t\tlzms_encode_match_bit(c, match_bit);\n\n\t\tif (!match_bit) {\n\t\t\t/* LZ match  */\n\n\t\t\t/* LZ bit: 0 = explicit offset, 1 = repeat offset  */\n\t\t\tint lz_bit = (source < LZMS_NUM_LZ_REPS);\n\t\t\tlzms_encode_lz_bit(c, lz_bit);\n\n\t\t\tif (!lz_bit) {\n\t\t\t\t/* Explicit offset LZ match  */\n\t\t\t\tu32 offset = source - (LZMS_NUM_LZ_REPS - 1);\n\t\t\t\tlzms_encode_lz_offset(c, offset);\n\t\t\t} else {\n\t\t\t\t/* Repeat offset LZ match  */\n\t\t\t\tint rep_idx = source;\n\t\t\t\tfor (int i = 0; i < rep_idx; i++)\n\t\t\t\t\tlzms_encode_lz_rep_bit(c, 1, i);\n\t\t\t\tif (rep_idx < LZMS_NUM_LZ_REP_DECISIONS)\n\t\t\t\t\tlzms_encode_lz_rep_bit(c, 0, rep_idx);\n\t\t\t}\n\t\t} else {\n\t\t\t/* Delta match  */\n\n\t\t\tsource &= ~DELTA_SOURCE_TAG;\n\n\t\t\t/* Delta bit: 0 = explicit offset, 1 = repeat offset  */\n\t\t\tint delta_bit = (source < LZMS_NUM_DELTA_REPS);\n\t\t\tlzms_encode_delta_bit(c, delta_bit);\n\n\t\t\tif (!delta_bit) {\n\t\t\t\t/* Explicit offset delta match  */\n\t\t\t\tu32 power = source >> DELTA_SOURCE_POWER_SHIFT;\n\t\t\t\tu32 raw_offset = (source & DELTA_SOURCE_RAW_OFFSET_MASK) -\n\t\t\t\t\t\t (LZMS_NUM_DELTA_REPS - 1);\n\t\t\t\tlzms_encode_delta_power_symbol(c, power);\n\t\t\t\tlzms_encode_delta_raw_offset(c, raw_offset);\n\t\t\t} else {\n\t\t\t\t/* Repeat offset delta match  */\n\t\t\t\tint rep_idx = source;\n\t\t\t\tfor (int i = 0; i < rep_idx; i++)\n\t\t\t\t\tlzms_encode_delta_rep_bit(c, 1, i);\n\t\t\t\tif (rep_idx < LZMS_NUM_DELTA_REP_DECISIONS)\n\t\t\t\t\tlzms_encode_delta_rep_bit(c, 0, rep_idx);\n\t\t\t}\n\t\t}\n\n\t\t/* Match length (encoded the same way for any match type)  */\n\t\tlzms_encode_length(c, length);\n\t}\n}\n\n/* Encode a list of matches and literals chosen by the parsing algorithm.  */\nstatic void\nlzms_encode_nonempty_item_list(struct lzms_compressor *c,\n\t\t\t       struct lzms_optimum_node *end_node)\n{\n\t/* Since we've stored at each node the item we took to arrive at that\n\t * node, we can trace our chosen path in backwards order.  However, for\n\t * encoding we need to trace our chosen path in forwards order.  To make\n\t * this possible, the following loop moves the items from their\n\t * destination nodes to their source nodes, which effectively reverses\n\t * the path.  (Think of it like reversing a singly-linked list.)  */\n\tstruct lzms_optimum_node *cur_node = end_node;\n\tstruct lzms_item saved_item = cur_node->item;\n\tdo {\n\t\tstruct lzms_item item = saved_item;\n\t\tif (cur_node->num_extra_items > 0) {\n\t\t\t/* Handle an arrival via multi-item lookahead.  */\n\t\t\tunsigned i = 0;\n\t\t\tstruct lzms_optimum_node *orig_node = cur_node;\n\t\t\tdo {\n\t\t\t\tcur_node -= item.length;\n\t\t\t\tcur_node->item = item;\n\t\t\t\titem = orig_node->extra_items[i];\n\t\t\t} while (++i != orig_node->num_extra_items && i < 2);\n\t\t}\n\t\tcur_node -= item.length;\n\t\tsaved_item = cur_node->item;\n\t\tcur_node->item = item;\n\t} while (cur_node != c->optimum_nodes);\n\n\t/* Now trace the chosen path in forwards order, encoding each item.  */\n\tdo {\n\t\tlzms_encode_item(c, cur_node->item.length, cur_node->item.source);\n\t\tcur_node += cur_node->item.length;\n\t} while (cur_node != end_node);\n}\n\nstatic forceinline void\nlzms_encode_item_list(struct lzms_compressor *c,\n\t\t      struct lzms_optimum_node *end_node)\n{\n\tif (end_node != c->optimum_nodes)\n\t\tlzms_encode_nonempty_item_list(c, end_node);\n}\n\n/******************************************************************************\n *                             Cost evaluation                                *\n ******************************************************************************/\n\n/*\n * If p is the predicted probability of the next bit being a 0, then the number\n * of bits required to encode a 0 bit using a binary range encoder is the real\n * number -log2(p), and the number of bits required to encode a 1 bit is the\n * real number -log2(1 - p).  To avoid computing either of these expressions at\n * runtime, 'lzms_bit_costs' is a precomputed table that stores a mapping from\n * probability to cost for each possible probability.  Specifically, the array\n * indices are the numerators of the possible probabilities in LZMS, where the\n * denominators are LZMS_PROBABILITY_DENOMINATOR; and the stored costs are the\n * bit costs multiplied by 1<<COST_SHIFT and rounded to the nearest integer.\n * Furthermore, the values stored for 0% and 100% probabilities are equal to the\n * adjacent values, since these probabilities are not actually permitted.  This\n * allows us to use the num_recent_zero_bits value from the\n * lzms_probability_entry as the array index without fixing up these two special\n * cases.\n */\nstatic const u32 lzms_bit_costs[LZMS_PROBABILITY_DENOMINATOR + 1] = {\n\t384, 384, 320, 283, 256, 235, 219, 204,\n\t192, 181, 171, 163, 155, 147, 140, 134,\n\t128, 122, 117, 112, 107, 103, 99,  94,\n\t91,  87,  83,  80,  76,  73,  70,  67,\n\t64,  61,  58,  56,  53,  51,  48,  46,\n\t43,  41,  39,  37,  35,  33,  30,  29,\n\t27,  25,  23,  21,  19,  17,  16,  14,\n\t12,  11,  9,   8,   6,   4,   3,   1,\n\t1\n};\n\nstatic void __attribute__((unused))\ncheck_cost_shift(void)\n{\n\t/* lzms_bit_costs is hard-coded to the current COST_SHIFT.  */\n\tSTATIC_ASSERT(COST_SHIFT == 6);\n}\n\n#if 0\n#include <math.h>\n\nstatic void\nlzms_compute_bit_costs(void)\n{\n\tfor (u32 i = 0; i <= LZMS_PROBABILITY_DENOMINATOR; i++) {\n\t\tu32 prob = i;\n\t\tif (prob == 0)\n\t\t\tprob++;\n\t\telse if (prob == LZMS_PROBABILITY_DENOMINATOR)\n\t\t\tprob--;\n\n\t\tlzms_bit_costs[i] = round(-log2((double)prob / LZMS_PROBABILITY_DENOMINATOR) *\n\t\t\t\t\t  (1 << COST_SHIFT));\n\t}\n}\n#endif\n\n/* Return the cost to encode a 0 bit in the specified context.  */\nstatic forceinline u32\nlzms_bit_0_cost(unsigned state, const struct lzms_probability_entry *probs)\n{\n\treturn lzms_bit_costs[probs[state].num_recent_zero_bits];\n}\n\n/* Return the cost to encode a 1 bit in the specified context.  */\nstatic forceinline u32\nlzms_bit_1_cost(unsigned state, const struct lzms_probability_entry *probs)\n{\n\treturn lzms_bit_costs[LZMS_PROBABILITY_DENOMINATOR -\n\t\t\t      probs[state].num_recent_zero_bits];\n}\n\n/* Return the cost to encode a literal, including the main bit.  */\nstatic forceinline u32\nlzms_literal_cost(struct lzms_compressor *c, unsigned main_state, unsigned literal)\n{\n\treturn lzms_bit_0_cost(main_state, c->probs.main) +\n\t\t((u32)c->literal_lens[literal] << COST_SHIFT);\n}\n\n/* Update 'fast_length_cost_tab' to use the latest Huffman code.  */\nstatic void\nlzms_update_fast_length_costs(struct lzms_compressor *c)\n{\n\tint slot = -1;\n\tu32 cost = 0;\n\tfor (u32 len = LZMS_MIN_MATCH_LENGTH; len <= MAX_FAST_LENGTH; len++) {\n\t\tif (len >= lzms_length_slot_base[slot + 1]) {\n\t\t\tslot++;\n\t\t\tcost = (u32)(c->length_lens[slot] +\n\t\t\t\t     lzms_extra_length_bits[slot]) << COST_SHIFT;\n\t\t}\n\t\tc->fast_length_cost_tab[len] = cost;\n\t}\n}\n\n/* Return the cost to encode the specified match length, which must not exceed\n * MAX_FAST_LENGTH.  */\nstatic forceinline u32\nlzms_fast_length_cost(const struct lzms_compressor *c, u32 length)\n{\n\treturn c->fast_length_cost_tab[length];\n}\n\n/* Return the cost to encode the specified LZ match offset.  */\nstatic forceinline u32\nlzms_lz_offset_cost(const struct lzms_compressor *c, u32 offset)\n{\n\tunsigned slot = lzms_comp_get_offset_slot(c, offset);\n\tu32 num_bits = c->lz_offset_lens[slot] + lzms_extra_offset_bits[slot];\n\treturn num_bits << COST_SHIFT;\n}\n\n/* Return the cost to encode the specified delta power and raw offset.  */\nstatic forceinline u32\nlzms_delta_source_cost(const struct lzms_compressor *c, u32 power, u32 raw_offset)\n{\n\tunsigned slot = lzms_comp_get_offset_slot(c, raw_offset);\n\tu32 num_bits = c->delta_power_lens[power] + c->delta_offset_lens[slot] +\n\t\t       lzms_extra_offset_bits[slot];\n\treturn num_bits << COST_SHIFT;\n}\n\n/******************************************************************************\n *                              Adaptive state                                *\n ******************************************************************************/\n\nstatic void\nlzms_init_adaptive_state(struct lzms_adaptive_state *state)\n{\n\tfor (int i = 0; i < LZMS_NUM_LZ_REPS + 1; i++)\n\t\tstate->recent_lz_offsets[i] = i + 1;\n\tstate->prev_lz_offset = 0;\n\tstate->upcoming_lz_offset = 0;\n\n\tfor (int i = 0; i < LZMS_NUM_DELTA_REPS + 1; i++)\n\t\tstate->recent_delta_pairs[i] = i + 1;\n\tstate->prev_delta_pair = 0;\n\tstate->upcoming_delta_pair = 0;\n\n\tstate->main_state = 0;\n\tstate->match_state = 0;\n\tstate->lz_state = 0;\n\tfor (int i = 0; i < LZMS_NUM_LZ_REP_DECISIONS; i++)\n\t\tstate->lz_rep_states[i] = 0;\n\tstate->delta_state = 0;\n\tfor (int i = 0; i < LZMS_NUM_DELTA_REP_DECISIONS; i++)\n\t\tstate->delta_rep_states[i] = 0;\n}\n\n/*\n * Update the LRU queues for match sources when advancing by one item.\n *\n * Note: using LZMA as a point of comparison, the LRU queues in LZMS are more\n * complex because:\n *\t- there are separate queues for LZ and delta matches\n *\t- updates to the queues are delayed by one encoded item (this prevents\n *\t  sources from being bumped up to index 0 too early)\n */\nstatic void\nlzms_update_lru_queues(struct lzms_adaptive_state *state)\n{\n\tif (state->prev_lz_offset != 0) {\n\t\tfor (int i = LZMS_NUM_LZ_REPS - 1; i >= 0; i--)\n\t\t\tstate->recent_lz_offsets[i + 1] = state->recent_lz_offsets[i];\n\t\tstate->recent_lz_offsets[0] = state->prev_lz_offset;\n\t}\n\tstate->prev_lz_offset = state->upcoming_lz_offset;\n\n\tif (state->prev_delta_pair != 0) {\n\t\tfor (int i = LZMS_NUM_DELTA_REPS - 1; i >= 0; i--)\n\t\t\tstate->recent_delta_pairs[i + 1] = state->recent_delta_pairs[i];\n\t\tstate->recent_delta_pairs[0] = state->prev_delta_pair;\n\t}\n\tstate->prev_delta_pair = state->upcoming_delta_pair;\n}\n\nstatic forceinline void\nlzms_update_state(u8 *state_p, int bit, unsigned num_states)\n{\n\t*state_p = ((*state_p << 1) | bit) & (num_states - 1);\n}\n\nstatic forceinline void\nlzms_update_main_state(struct lzms_adaptive_state *state, int is_match)\n{\n\tlzms_update_state(&state->main_state, is_match, LZMS_NUM_MAIN_PROBS);\n}\n\nstatic forceinline void\nlzms_update_match_state(struct lzms_adaptive_state *state, int is_delta)\n{\n\tlzms_update_state(&state->match_state, is_delta, LZMS_NUM_MATCH_PROBS);\n}\n\nstatic forceinline void\nlzms_update_lz_state(struct lzms_adaptive_state *state, int is_rep)\n{\n\tlzms_update_state(&state->lz_state, is_rep, LZMS_NUM_LZ_PROBS);\n}\n\nstatic forceinline void\nlzms_update_lz_rep_states(struct lzms_adaptive_state *state, int rep_idx)\n{\n\tfor (int i = 0; i < rep_idx; i++)\n\t\tlzms_update_state(&state->lz_rep_states[i], 1, LZMS_NUM_LZ_REP_PROBS);\n\n\tif (rep_idx < LZMS_NUM_LZ_REP_DECISIONS)\n\t\tlzms_update_state(&state->lz_rep_states[rep_idx], 0, LZMS_NUM_LZ_REP_PROBS);\n}\n\nstatic forceinline void\nlzms_update_delta_state(struct lzms_adaptive_state *state, int is_rep)\n{\n\tlzms_update_state(&state->delta_state, is_rep, LZMS_NUM_DELTA_PROBS);\n}\n\nstatic forceinline void\nlzms_update_delta_rep_states(struct lzms_adaptive_state *state, int rep_idx)\n{\n\tfor (int i = 0; i < rep_idx; i++)\n\t\tlzms_update_state(&state->delta_rep_states[i], 1, LZMS_NUM_DELTA_REP_PROBS);\n\n\tif (rep_idx < LZMS_NUM_DELTA_REP_DECISIONS)\n\t\tlzms_update_state(&state->delta_rep_states[rep_idx], 0, LZMS_NUM_DELTA_REP_PROBS);\n}\n\n/******************************************************************************\n *                              Matchfinding                                  *\n ******************************************************************************/\n\n/* Note: this code just handles finding delta matches.  The code for finding LZ\n * matches is elsewhere.  */\n\n\n/* Initialize the delta matchfinder for a new input buffer.  */\nstatic void\nlzms_init_delta_matchfinder(struct lzms_compressor *c)\n{\n\t/* Set all entries to use an invalid power, which will never match.  */\n\tSTATIC_ASSERT(NUM_POWERS_TO_CONSIDER < (1 << (32 - DELTA_SOURCE_POWER_SHIFT)));\n\tmemset(c->delta_hash_table, 0xFF, sizeof(c->delta_hash_table));\n\n\t/* Initialize the next hash code for each power.  We can just use zeroes\n\t * initially; it doesn't really matter.  */\n\tfor (u32 i = 0; i < NUM_POWERS_TO_CONSIDER; i++)\n\t\tc->next_delta_hashes[i] = 0;\n}\n\n/*\n * Compute a DELTA_HASH_ORDER-bit hash code for the first\n * NBYTES_HASHED_FOR_DELTA bytes of the sequence beginning at @p when taken in a\n * delta context with the specified @span.\n */\nstatic forceinline u32\nlzms_delta_hash(const u8 *p, const u32 pos, u32 span)\n{\n\t/* A delta match has a certain span and an offset that is a multiple of\n\t * that span.  To reduce wasted space we use a single combined hash\n\t * table for all spans and positions, but to minimize collisions we\n\t * include in the hash code computation the span and the low-order bits\n\t * of the current position.  */\n\n\tSTATIC_ASSERT(NBYTES_HASHED_FOR_DELTA == 3);\n\tu8 d0 = *(p + 0) - *(p + 0 - span);\n\tu8 d1 = *(p + 1) - *(p + 1 - span);\n\tu8 d2 = *(p + 2) - *(p + 2 - span);\n\tu32 v = ((span + (pos & (span - 1))) << 24) |\n\t\t((u32)d2 << 16) | ((u32)d1 << 8) | d0;\n\treturn lz_hash(v, DELTA_HASH_ORDER);\n}\n\n/*\n * Given a match between @in_next and @matchptr in a delta context with the\n * specified @span and having the initial @len, extend the match as far as\n * possible, up to a limit of @max_len.\n */\nstatic forceinline u32\nlzms_extend_delta_match(const u8 *in_next, const u8 *matchptr,\n\t\t\tu32 len, u32 max_len, u32 span)\n{\n\twhile (len < max_len &&\n\t       (u8)(*(in_next + len) - *(in_next + len - span)) ==\n\t       (u8)(*(matchptr + len) - *(matchptr + len - span)))\n\t{\n\t\tlen++;\n\t}\n\treturn len;\n}\n\nstatic void\nlzms_delta_matchfinder_skip_bytes(struct lzms_compressor *c,\n\t\t\t\t  const u8 *in_next, u32 count)\n{\n\tu32 pos = in_next - c->in_buffer;\n\tif (unlikely(c->in_nbytes - (pos + count) <= NBYTES_HASHED_FOR_DELTA + 1))\n\t\treturn;\n\tdo {\n\t\t/* Update the hash table for each power.  */\n\t\tfor (u32 power = 0; power < NUM_POWERS_TO_CONSIDER; power++) {\n\t\t\tconst u32 span = (u32)1 << power;\n\t\t\tif (unlikely(pos < span))\n\t\t\t\tcontinue;\n\t\t\tconst u32 next_hash = lzms_delta_hash(in_next + 1, pos + 1, span);\n\t\t\tconst u32 hash = c->next_delta_hashes[power];\n\t\t\tc->delta_hash_table[hash] =\n\t\t\t\t(power << DELTA_SOURCE_POWER_SHIFT) | pos;\n\t\t\tc->next_delta_hashes[power] = next_hash;\n\t\t\tprefetchw(&c->delta_hash_table[next_hash]);\n\t\t}\n\t} while (in_next++, pos++, --count);\n}\n\n/*\n * Skip the next @count bytes (don't search for matches at them).  @in_next\n * points to the first byte to skip.  The return value is @in_next + count.\n */\nstatic const u8 *\nlzms_skip_bytes(struct lzms_compressor *c, u32 count, const u8 *in_next)\n{\n\tlcpit_matchfinder_skip_bytes(&c->mf, count);\n\tif (c->use_delta_matches)\n\t\tlzms_delta_matchfinder_skip_bytes(c, in_next, count);\n\treturn in_next + count;\n}\n\n/******************************************************************************\n *                          \"Near-optimal\" parsing                            *\n ******************************************************************************/\n\n/*\n * The main near-optimal parsing routine.\n *\n * Briefly, the algorithm does an approximate minimum-cost path search to find a\n * \"near-optimal\" sequence of matches and literals to output, based on the\n * current cost model.  The algorithm steps forward, position by position (byte\n * by byte), and updates the minimum cost path to reach each later position that\n * can be reached using a match or literal from the current position.  This is\n * essentially Dijkstra's algorithm in disguise: the graph nodes are positions,\n * the graph edges are possible matches/literals to code, and the cost of each\n * edge is the estimated number of bits (scaled up by COST_SHIFT) that will be\n * required to output the corresponding match or literal.  But one difference is\n * that we actually compute the lowest-cost path in pieces, where each piece is\n * terminated when there are no choices to be made.\n *\n * The costs of literals and matches are estimated using the range encoder\n * states and the semi-adaptive Huffman codes.  Except for range encoding\n * states, costs are assumed to be constant throughout a single run of the\n * parsing algorithm, which can parse up to NUM_OPTIM_NODES bytes of data.  This\n * introduces a source of non-optimality because the probabilities and Huffman\n * codes can change over this part of the data.  And of course, there are\n * various other reasons why the result isn't optimal in terms of compression\n * ratio.\n */\nstatic void\nlzms_near_optimal_parse(struct lzms_compressor *c)\n{\n\tconst u8 *in_next = c->in_buffer;\n\tconst u8 * const in_end = &c->in_buffer[c->in_nbytes];\n\tstruct lzms_optimum_node *cur_node;\n\tstruct lzms_optimum_node *end_node;\n\n\t/* Set initial length costs for lengths <= MAX_FAST_LENGTH.  */\n\tlzms_update_fast_length_costs(c);\n\n\t/* Set up the initial adaptive state.  */\n\tlzms_init_adaptive_state(&c->optimum_nodes[0].state);\n\nbegin:\n\t/* Start building a new list of items, which will correspond to the next\n\t * piece of the overall minimum-cost path.  */\n\n\tcur_node = c->optimum_nodes;\n\tcur_node->cost = 0;\n\tend_node = cur_node;\n\n\tif (in_next == in_end)\n\t\treturn;\n\n\t/* The following loop runs once for each per byte in the input buffer,\n\t * except in a few shortcut cases.  */\n\tfor (;;) {\n\t\tu32 num_matches;\n\n\t\t/* Repeat offset LZ matches  */\n\t\tif (likely(in_next - c->in_buffer >= LZMS_NUM_LZ_REPS &&\n\t\t\t   in_end - in_next >= 2))\n\t\t{\n\t\t\tfor (int rep_idx = 0; rep_idx < LZMS_NUM_LZ_REPS; rep_idx++) {\n\n\t\t\t\t/* Looking for a repeat offset LZ match at queue\n\t\t\t\t * index @rep_idx  */\n\n\t\t\t\tconst u32 offset = cur_node->state.recent_lz_offsets[rep_idx];\n\t\t\t\tconst u8 * const matchptr = in_next - offset;\n\n\t\t\t\t/* Check the first 2 bytes before entering the extension loop.  */\n\t\t\t\tif (load_u16_unaligned(in_next) != load_u16_unaligned(matchptr))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t/* Extend the match to its full length.  */\n\t\t\t\tconst u32 rep_len = lz_extend(in_next, matchptr, 2, in_end - in_next);\n\n\t\t\t\t/* Early out for long repeat offset LZ match */\n\t\t\t\tif (rep_len >= c->mf.nice_match_len) {\n\n\t\t\t\t\tin_next = lzms_skip_bytes(c, rep_len, in_next);\n\n\t\t\t\t\tlzms_encode_item_list(c, cur_node);\n\t\t\t\t\tlzms_encode_item(c, rep_len, rep_idx);\n\n\t\t\t\t\tc->optimum_nodes[0].state = cur_node->state;\n\t\t\t\t\tcur_node = &c->optimum_nodes[0];\n\n\t\t\t\t\tcur_node->state.upcoming_lz_offset =\n\t\t\t\t\t\tcur_node->state.recent_lz_offsets[rep_idx];\n\t\t\t\t\tcur_node->state.upcoming_delta_pair = 0;\n\t\t\t\t\tfor (int i = rep_idx; i < LZMS_NUM_LZ_REPS; i++)\n\t\t\t\t\t\tcur_node->state.recent_lz_offsets[i] =\n\t\t\t\t\t\t\tcur_node->state.recent_lz_offsets[i + 1];\n\t\t\t\t\tlzms_update_lru_queues(&cur_node->state);\n\t\t\t\t\tlzms_update_main_state(&cur_node->state, 1);\n\t\t\t\t\tlzms_update_match_state(&cur_node->state, 0);\n\t\t\t\t\tlzms_update_lz_state(&cur_node->state, 1);\n\t\t\t\t\tlzms_update_lz_rep_states(&cur_node->state, rep_idx);\n\t\t\t\t\tgoto begin;\n\t\t\t\t}\n\n\t\t\t\twhile (end_node < cur_node + rep_len)\n\t\t\t\t\t(++end_node)->cost = INFINITE_COST;\n\n\t\t\t\tu32 base_cost = cur_node->cost +\n\t\t\t\t\t\tlzms_bit_1_cost(cur_node->state.main_state,\n\t\t\t\t\t\t\t\tc->probs.main) +\n\t\t\t\t\t\tlzms_bit_0_cost(cur_node->state.match_state,\n\t\t\t\t\t\t\t\tc->probs.match) +\n\t\t\t\t\t\tlzms_bit_1_cost(cur_node->state.lz_state,\n\t\t\t\t\t\t\t\tc->probs.lz);\n\n\t\t\t\tfor (int i = 0; i < rep_idx; i++)\n\t\t\t\t\tbase_cost += lzms_bit_1_cost(cur_node->state.lz_rep_states[i],\n\t\t\t\t\t\t\t\t     c->probs.lz_rep[i]);\n\n\t\t\t\tif (rep_idx < LZMS_NUM_LZ_REP_DECISIONS)\n\t\t\t\t\tbase_cost += lzms_bit_0_cost(cur_node->state.lz_rep_states[rep_idx],\n\t\t\t\t\t\t\t\t     c->probs.lz_rep[rep_idx]);\n\n\t\t\t\tu32 len = 2;\n\t\t\t\tdo {\n\t\t\t\t\tu32 cost = base_cost + lzms_fast_length_cost(c, len);\n\t\t\t\t\tif (cost < (cur_node + len)->cost) {\n\t\t\t\t\t\t(cur_node + len)->cost = cost;\n\t\t\t\t\t\t(cur_node + len)->item = (struct lzms_item) {\n\t\t\t\t\t\t\t.length = len,\n\t\t\t\t\t\t\t.source = rep_idx,\n\t\t\t\t\t\t};\n\t\t\t\t\t\t(cur_node + len)->num_extra_items = 0;\n\t\t\t\t\t}\n\t\t\t\t} while (++len <= rep_len);\n\n\n\t\t\t\t/* try LZ-rep + lit + LZ-rep0  */\n\t\t\t\tif (c->try_lzrep_lit_lzrep0 &&\n\t\t\t\t    in_end - (in_next + rep_len) >= 3 &&\n\t\t\t\t    load_u16_unaligned(in_next + rep_len + 1) ==\n\t\t\t\t    load_u16_unaligned(matchptr + rep_len + 1))\n\t\t\t\t{\n\t\t\t\t\tconst u32 rep0_len = lz_extend(in_next + rep_len + 1,\n\t\t\t\t\t\t\t\t       matchptr + rep_len + 1,\n\t\t\t\t\t\t\t\t       2,\n\t\t\t\t\t\t\t\t       min(c->mf.nice_match_len,\n\t\t\t\t\t\t\t\t\t   in_end - (in_next + rep_len + 1)));\n\n\t\t\t\t\tunsigned main_state = cur_node->state.main_state;\n\t\t\t\t\tunsigned match_state = cur_node->state.match_state;\n\t\t\t\t\tunsigned lz_state = cur_node->state.lz_state;\n\t\t\t\t\tunsigned lz_rep0_state = cur_node->state.lz_rep_states[0];\n\n\t\t\t\t\t/* update states for LZ-rep  */\n\t\t\t\t\tmain_state = ((main_state << 1) | 1) % LZMS_NUM_MAIN_PROBS;\n\t\t\t\t\tmatch_state = ((match_state << 1) | 0) % LZMS_NUM_MATCH_PROBS;\n\t\t\t\t\tlz_state = ((lz_state << 1) | 1) % LZMS_NUM_LZ_PROBS;\n\t\t\t\t\tlz_rep0_state = ((lz_rep0_state << 1) | (rep_idx > 0)) %\n\t\t\t\t\t\t\t\tLZMS_NUM_LZ_REP_PROBS;\n\n\t\t\t\t\t/* LZ-rep cost  */\n\t\t\t\t\tu32 cost = base_cost + lzms_fast_length_cost(c, rep_len);\n\n\t\t\t\t\t/* add literal cost  */\n\t\t\t\t\tcost += lzms_literal_cost(c, main_state, *(in_next + rep_len));\n\n\t\t\t\t\t/* update state for literal  */\n\t\t\t\t\tmain_state = ((main_state << 1) | 0) % LZMS_NUM_MAIN_PROBS;\n\n\t\t\t\t\t/* add LZ-rep0 cost  */\n\t\t\t\t\tcost += lzms_bit_1_cost(main_state, c->probs.main) +\n\t\t\t\t\t\tlzms_bit_0_cost(match_state, c->probs.match) +\n\t\t\t\t\t\tlzms_bit_1_cost(lz_state, c->probs.lz) +\n\t\t\t\t\t\tlzms_bit_0_cost(lz_rep0_state, c->probs.lz_rep[0]) +\n\t\t\t\t\t\tlzms_fast_length_cost(c, rep0_len);\n\n\t\t\t\t\tconst u32 total_len = rep_len + 1 + rep0_len;\n\n\t\t\t\t\twhile (end_node < cur_node + total_len)\n\t\t\t\t\t\t(++end_node)->cost = INFINITE_COST;\n\n\t\t\t\t\tif (cost < (cur_node + total_len)->cost) {\n\t\t\t\t\t\t(cur_node + total_len)->cost = cost;\n\t\t\t\t\t\t(cur_node + total_len)->item = (struct lzms_item) {\n\t\t\t\t\t\t\t.length = rep0_len,\n\t\t\t\t\t\t\t.source = 0,\n\t\t\t\t\t\t};\n\t\t\t\t\t\t(cur_node + total_len)->extra_items[0] = (struct lzms_item) {\n\t\t\t\t\t\t\t.length = 1,\n\t\t\t\t\t\t\t.source = *(in_next + rep_len),\n\t\t\t\t\t\t};\n\t\t\t\t\t\t(cur_node + total_len)->extra_items[1] = (struct lzms_item) {\n\t\t\t\t\t\t\t.length = rep_len,\n\t\t\t\t\t\t\t.source = rep_idx,\n\t\t\t\t\t\t};\n\t\t\t\t\t\t(cur_node + total_len)->num_extra_items = 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Repeat offset delta matches  */\n\t\tif (c->use_delta_matches &&\n\t\t    likely(in_next - c->in_buffer >= LZMS_NUM_DELTA_REPS + 1 &&\n\t\t\t   (in_end - in_next >= 2)))\n\t\t{\n\t\t\tfor (int rep_idx = 0; rep_idx < LZMS_NUM_DELTA_REPS; rep_idx++) {\n\n\t\t\t\t/* Looking for a repeat offset delta match at\n\t\t\t\t * queue index @rep_idx  */\n\n\t\t\t\tconst u32 pair = cur_node->state.recent_delta_pairs[rep_idx];\n\t\t\t\tconst u32 power = pair >> DELTA_SOURCE_POWER_SHIFT;\n\t\t\t\tconst u32 raw_offset = pair & DELTA_SOURCE_RAW_OFFSET_MASK;\n\t\t\t\tconst u32 span = (u32)1 << power;\n\t\t\t\tconst u32 offset = raw_offset << power;\n\t\t\t\tconst u8 * const matchptr = in_next - offset;\n\n\t\t\t\t/* Check the first 2 bytes before entering the\n\t\t\t\t * extension loop.  */\n\t\t\t\tif (((u8)(*(in_next + 0) - *(in_next + 0 - span)) !=\n\t\t\t\t     (u8)(*(matchptr + 0) - *(matchptr + 0 - span))) ||\n\t\t\t\t    ((u8)(*(in_next + 1) - *(in_next + 1 - span)) !=\n\t\t\t\t     (u8)(*(matchptr + 1) - *(matchptr + 1 - span))))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t/* Extend the match to its full length.  */\n\t\t\t\tconst u32 rep_len = lzms_extend_delta_match(in_next, matchptr,\n\t\t\t\t\t\t\t\t\t    2, in_end - in_next,\n\t\t\t\t\t\t\t\t\t    span);\n\n\t\t\t\t/* Early out for long repeat offset delta match */\n\t\t\t\tif (rep_len >= c->mf.nice_match_len) {\n\n\t\t\t\t\tin_next = lzms_skip_bytes(c, rep_len, in_next);\n\n\t\t\t\t\tlzms_encode_item_list(c, cur_node);\n\t\t\t\t\tlzms_encode_item(c, rep_len, DELTA_SOURCE_TAG | rep_idx);\n\n\t\t\t\t\tc->optimum_nodes[0].state = cur_node->state;\n\t\t\t\t\tcur_node = &c->optimum_nodes[0];\n\n\t\t\t\t\tcur_node->state.upcoming_delta_pair = pair;\n\t\t\t\t\tcur_node->state.upcoming_lz_offset = 0;\n\t\t\t\t\tfor (int i = rep_idx; i < LZMS_NUM_DELTA_REPS; i++)\n\t\t\t\t\t\tcur_node->state.recent_delta_pairs[i] =\n\t\t\t\t\t\t\tcur_node->state.recent_delta_pairs[i + 1];\n\t\t\t\t\tlzms_update_lru_queues(&cur_node->state);\n\t\t\t\t\tlzms_update_main_state(&cur_node->state, 1);\n\t\t\t\t\tlzms_update_match_state(&cur_node->state, 1);\n\t\t\t\t\tlzms_update_delta_state(&cur_node->state, 1);\n\t\t\t\t\tlzms_update_delta_rep_states(&cur_node->state, rep_idx);\n\t\t\t\t\tgoto begin;\n\t\t\t\t}\n\n\t\t\t\twhile (end_node < cur_node + rep_len)\n\t\t\t\t\t(++end_node)->cost = INFINITE_COST;\n\n\t\t\t\tu32 base_cost = cur_node->cost +\n\t\t\t\t\t\tlzms_bit_1_cost(cur_node->state.main_state,\n\t\t\t\t\t\t\t\tc->probs.main) +\n\t\t\t\t\t\tlzms_bit_1_cost(cur_node->state.match_state,\n\t\t\t\t\t\t\t\tc->probs.match) +\n\t\t\t\t\t\tlzms_bit_1_cost(cur_node->state.delta_state,\n\t\t\t\t\t\t\t\tc->probs.delta);\n\n\t\t\t\tfor (int i = 0; i < rep_idx; i++)\n\t\t\t\t\tbase_cost += lzms_bit_1_cost(cur_node->state.delta_rep_states[i],\n\t\t\t\t\t\t\t\t     c->probs.delta_rep[i]);\n\n\t\t\t\tif (rep_idx < LZMS_NUM_DELTA_REP_DECISIONS)\n\t\t\t\t\tbase_cost += lzms_bit_0_cost(cur_node->state.delta_rep_states[rep_idx],\n\t\t\t\t\t\t\t\t     c->probs.delta_rep[rep_idx]);\n\n\t\t\t\tu32 len = 2;\n\t\t\t\tdo {\n\t\t\t\t\tu32 cost = base_cost + lzms_fast_length_cost(c, len);\n\t\t\t\t\tif (cost < (cur_node + len)->cost) {\n\t\t\t\t\t\t(cur_node + len)->cost = cost;\n\t\t\t\t\t\t(cur_node + len)->item = (struct lzms_item) {\n\t\t\t\t\t\t\t.length = len,\n\t\t\t\t\t\t\t.source = DELTA_SOURCE_TAG | rep_idx,\n\t\t\t\t\t\t};\n\t\t\t\t\t\t(cur_node + len)->num_extra_items = 0;\n\t\t\t\t\t}\n\t\t\t\t} while (++len <= rep_len);\n\t\t\t}\n\t\t}\n\n\t\t/* Explicit offset LZ matches  */\n\t\tnum_matches = lcpit_matchfinder_get_matches(&c->mf, c->matches);\n\t\tif (num_matches) {\n\n\t\t\tu32 best_len = c->matches[0].length;\n\n\t\t\t/* Early out for long explicit offset LZ match  */\n\t\t\tif (best_len >= c->mf.nice_match_len) {\n\n\t\t\t\tconst u32 offset = c->matches[0].offset;\n\n\t\t\t\t/* Extend the match as far as possible.\n\t\t\t\t * This is necessary because the LCP-interval\n\t\t\t\t * tree matchfinder only reports up to\n\t\t\t\t * nice_match_len bytes.  */\n\t\t\t\tbest_len = lz_extend(in_next, in_next - offset,\n\t\t\t\t\t\t     best_len, in_end - in_next);\n\n\t\t\t\tin_next = lzms_skip_bytes(c, best_len - 1, in_next + 1);\n\n\t\t\t\tlzms_encode_item_list(c, cur_node);\n\t\t\t\tlzms_encode_item(c, best_len, offset + LZMS_NUM_LZ_REPS - 1);\n\n\t\t\t\tc->optimum_nodes[0].state = cur_node->state;\n\t\t\t\tcur_node = &c->optimum_nodes[0];\n\n\t\t\t\tcur_node->state.upcoming_lz_offset = offset;\n\t\t\t\tcur_node->state.upcoming_delta_pair = 0;\n\t\t\t\tlzms_update_lru_queues(&cur_node->state);\n\t\t\t\tlzms_update_main_state(&cur_node->state, 1);\n\t\t\t\tlzms_update_match_state(&cur_node->state, 0);\n\t\t\t\tlzms_update_lz_state(&cur_node->state, 0);\n\t\t\t\tgoto begin;\n\t\t\t}\n\n\t\t\twhile (end_node < cur_node + best_len)\n\t\t\t\t(++end_node)->cost = INFINITE_COST;\n\n\t\t\tu32 base_cost = cur_node->cost +\n\t\t\t\t\tlzms_bit_1_cost(cur_node->state.main_state,\n\t\t\t\t\t\t\tc->probs.main) +\n\t\t\t\t\tlzms_bit_0_cost(cur_node->state.match_state,\n\t\t\t\t\t\t\tc->probs.match) +\n\t\t\t\t\tlzms_bit_0_cost(cur_node->state.lz_state,\n\t\t\t\t\t\t\tc->probs.lz);\n\n\t\t\tif (c->try_lzmatch_lit_lzrep0 &&\n\t\t\t    likely(in_end - (in_next + c->matches[0].length) >= 3))\n\t\t\t{\n\t\t\t\t/* try LZ-match + lit + LZ-rep0  */\n\n\t\t\t\tu32 l = 2;\n\t\t\t\tu32 i = num_matches - 1;\n\t\t\t\tdo {\n\t\t\t\t\tconst u32 len = c->matches[i].length;\n\t\t\t\t\tconst u32 offset = c->matches[i].offset;\n\t\t\t\t\tconst u32 position_cost = base_cost +\n\t\t\t\t\t\t\t\t  lzms_lz_offset_cost(c, offset);\n\t\t\t\t\tdo {\n\t\t\t\t\t\tu32 cost = position_cost + lzms_fast_length_cost(c, l);\n\t\t\t\t\t\tif (cost < (cur_node + l)->cost) {\n\t\t\t\t\t\t\t(cur_node + l)->cost = cost;\n\t\t\t\t\t\t\t(cur_node + l)->item = (struct lzms_item) {\n\t\t\t\t\t\t\t\t.length = l,\n\t\t\t\t\t\t\t\t.source = offset + (LZMS_NUM_LZ_REPS - 1),\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t(cur_node + l)->num_extra_items = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (++l <= len);\n\n\t\t\t\t\tconst u8 * const matchptr = in_next - offset;\n\t\t\t\t\tif (load_u16_unaligned(matchptr + len + 1) !=\n\t\t\t\t\t    load_u16_unaligned(in_next + len + 1))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tconst u32 rep0_len = lz_extend(in_next + len + 1,\n\t\t\t\t\t\t\t\t       matchptr + len + 1,\n\t\t\t\t\t\t\t\t       2,\n\t\t\t\t\t\t\t\t       min(c->mf.nice_match_len,\n\t\t\t\t\t\t\t\t\t   in_end - (in_next + len + 1)));\n\n\t\t\t\t\tunsigned main_state = cur_node->state.main_state;\n\t\t\t\t\tunsigned match_state = cur_node->state.match_state;\n\t\t\t\t\tunsigned lz_state = cur_node->state.lz_state;\n\n\t\t\t\t\t/* update states for LZ-match  */\n\t\t\t\t\tmain_state = ((main_state << 1) | 1) % LZMS_NUM_MAIN_PROBS;\n\t\t\t\t\tmatch_state = ((match_state << 1) | 0) % LZMS_NUM_MATCH_PROBS;\n\t\t\t\t\tlz_state = ((lz_state << 1) | 0) % LZMS_NUM_LZ_PROBS;\n\n\t\t\t\t\t/* LZ-match cost  */\n\t\t\t\t\tu32 cost = position_cost + lzms_fast_length_cost(c, len);\n\n\t\t\t\t\t/* add literal cost  */\n\t\t\t\t\tcost += lzms_literal_cost(c, main_state, *(in_next + len));\n\n\t\t\t\t\t/* update state for literal  */\n\t\t\t\t\tmain_state = ((main_state << 1) | 0) % LZMS_NUM_MAIN_PROBS;\n\n\t\t\t\t\t/* add LZ-rep0 cost  */\n\t\t\t\t\tcost += lzms_bit_1_cost(main_state, c->probs.main) +\n\t\t\t\t\t\tlzms_bit_0_cost(match_state, c->probs.match) +\n\t\t\t\t\t\tlzms_bit_1_cost(lz_state, c->probs.lz) +\n\t\t\t\t\t\tlzms_bit_0_cost(cur_node->state.lz_rep_states[0],\n\t\t\t\t\t\t\t\tc->probs.lz_rep[0]) +\n\t\t\t\t\t\tlzms_fast_length_cost(c, rep0_len);\n\n\t\t\t\t\tconst u32 total_len = len + 1 + rep0_len;\n\n\t\t\t\t\twhile (end_node < cur_node + total_len)\n\t\t\t\t\t\t(++end_node)->cost = INFINITE_COST;\n\n\t\t\t\t\tif (cost < (cur_node + total_len)->cost) {\n\t\t\t\t\t\t(cur_node + total_len)->cost = cost;\n\t\t\t\t\t\t(cur_node + total_len)->item = (struct lzms_item) {\n\t\t\t\t\t\t\t.length = rep0_len,\n\t\t\t\t\t\t\t.source = 0,\n\t\t\t\t\t\t};\n\t\t\t\t\t\t(cur_node + total_len)->extra_items[0] = (struct lzms_item) {\n\t\t\t\t\t\t\t.length = 1,\n\t\t\t\t\t\t\t.source = *(in_next + len),\n\t\t\t\t\t\t};\n\t\t\t\t\t\t(cur_node + total_len)->extra_items[1] = (struct lzms_item) {\n\t\t\t\t\t\t\t.length = len,\n\t\t\t\t\t\t\t.source = offset + LZMS_NUM_LZ_REPS - 1,\n\t\t\t\t\t\t};\n\t\t\t\t\t\t(cur_node + total_len)->num_extra_items = 2;\n\t\t\t\t\t}\n\t\t\t\t} while (i--);\n\t\t\t} else {\n\t\t\t\tu32 l = 2;\n\t\t\t\tu32 i = num_matches - 1;\n\t\t\t\tdo {\n\t\t\t\t\tu32 position_cost = base_cost +\n\t\t\t\t\t\t\t    lzms_lz_offset_cost(c, c->matches[i].offset);\n\t\t\t\t\tdo {\n\t\t\t\t\t\tu32 cost = position_cost + lzms_fast_length_cost(c, l);\n\t\t\t\t\t\tif (cost < (cur_node + l)->cost) {\n\t\t\t\t\t\t\t(cur_node + l)->cost = cost;\n\t\t\t\t\t\t\t(cur_node + l)->item = (struct lzms_item) {\n\t\t\t\t\t\t\t\t.length = l,\n\t\t\t\t\t\t\t\t.source = c->matches[i].offset +\n\t\t\t\t\t\t\t\t\t  (LZMS_NUM_LZ_REPS - 1),\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t(cur_node + l)->num_extra_items = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (++l <= c->matches[i].length);\n\t\t\t\t} while (i--);\n\t\t\t}\n\t\t}\n\n\t\t/* Explicit offset delta matches  */\n\t\tif (c->use_delta_matches &&\n\t\t    likely(in_end - in_next >= NBYTES_HASHED_FOR_DELTA + 1))\n\t\t{\n\t\t\tconst u32 pos = in_next - c->in_buffer;\n\n\t\t\t/* Consider each possible power (log2 of span)  */\n\t\t\tSTATIC_ASSERT(NUM_POWERS_TO_CONSIDER <= LZMS_NUM_DELTA_POWER_SYMS);\n\t\t\tfor (u32 power = 0; power < NUM_POWERS_TO_CONSIDER; power++) {\n\n\t\t\t\tconst u32 span = (u32)1 << power;\n\n\t\t\t\tif (unlikely(pos < span))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tconst u32 next_hash = lzms_delta_hash(in_next + 1, pos + 1, span);\n\t\t\t\tconst u32 hash = c->next_delta_hashes[power];\n\t\t\t\tconst u32 cur_match = c->delta_hash_table[hash];\n\n\t\t\t\tc->delta_hash_table[hash] = (power << DELTA_SOURCE_POWER_SHIFT) | pos;\n\t\t\t\tc->next_delta_hashes[power] = next_hash;\n\t\t\t\tprefetchw(&c->delta_hash_table[next_hash]);\n\n\t\t\t\tif (power != cur_match >> DELTA_SOURCE_POWER_SHIFT)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tconst u32 offset = pos - (cur_match & DELTA_SOURCE_RAW_OFFSET_MASK);\n\n\t\t\t\t/* The offset must be a multiple of span.  */\n\t\t\t\tif (offset & (span - 1))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tconst u8 * const matchptr = in_next - offset;\n\n\t\t\t\t/* Check the first 3 bytes before entering the\n\t\t\t\t * extension loop.  */\n\t\t\t\tSTATIC_ASSERT(NBYTES_HASHED_FOR_DELTA == 3);\n\t\t\t\tif (((u8)(*(in_next + 0) - *(in_next + 0 - span)) !=\n\t\t\t\t     (u8)(*(matchptr + 0) - *(matchptr + 0 - span))) ||\n\t\t\t\t    ((u8)(*(in_next + 1) - *(in_next + 1 - span)) !=\n\t\t\t\t     (u8)(*(matchptr + 1) - *(matchptr + 1 - span))) ||\n\t\t\t\t    ((u8)(*(in_next + 2) - *(in_next + 2 - span)) !=\n\t\t\t\t     (u8)(*(matchptr + 2) - *(matchptr + 2 - span))))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t/* Extend the delta match to its full length.  */\n\t\t\t\tconst u32 len = lzms_extend_delta_match(in_next,\n\t\t\t\t\t\t\t\t\tmatchptr,\n\t\t\t\t\t\t\t\t\tNBYTES_HASHED_FOR_DELTA,\n\t\t\t\t\t\t\t\t\tin_end - in_next,\n\t\t\t\t\t\t\t\t\tspan);\n\n\t\t\t\tconst u32 raw_offset = offset >> power;\n\n\t\t\t\tif (unlikely(raw_offset > DELTA_SOURCE_RAW_OFFSET_MASK -\n\t\t\t\t\t\t\t  (LZMS_NUM_DELTA_REPS - 1)))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tconst u32 pair = (power << DELTA_SOURCE_POWER_SHIFT) |\n\t\t\t\t\t\t raw_offset;\n\t\t\t\tconst u32 source = DELTA_SOURCE_TAG |\n\t\t\t\t\t\t   (pair + LZMS_NUM_DELTA_REPS - 1);\n\n\t\t\t\t/* Early out for long explicit offset delta match  */\n\t\t\t\tif (len >= c->mf.nice_match_len) {\n\n\t\t\t\t\tin_next = lzms_skip_bytes(c, len - 1, in_next + 1);\n\n\t\t\t\t\tlzms_encode_item_list(c, cur_node);\n\t\t\t\t\tlzms_encode_item(c, len, source);\n\n\t\t\t\t\tc->optimum_nodes[0].state = cur_node->state;\n\t\t\t\t\tcur_node = &c->optimum_nodes[0];\n\n\t\t\t\t\tcur_node->state.upcoming_lz_offset = 0;\n\t\t\t\t\tcur_node->state.upcoming_delta_pair = pair;\n\t\t\t\t\tlzms_update_lru_queues(&cur_node->state);\n\t\t\t\t\tlzms_update_main_state(&cur_node->state, 1);\n\t\t\t\t\tlzms_update_match_state(&cur_node->state, 1);\n\t\t\t\t\tlzms_update_delta_state(&cur_node->state, 0);\n\t\t\t\t\tgoto begin;\n\t\t\t\t}\n\n\t\t\t\twhile (end_node < cur_node + len)\n\t\t\t\t\t(++end_node)->cost = INFINITE_COST;\n\n\t\t\t\tu32 base_cost = cur_node->cost +\n\t\t\t\t\t\tlzms_bit_1_cost(cur_node->state.main_state,\n\t\t\t\t\t\t\t\tc->probs.main) +\n\t\t\t\t\t\tlzms_bit_1_cost(cur_node->state.match_state,\n\t\t\t\t\t\t\t\tc->probs.match) +\n\t\t\t\t\t\tlzms_bit_0_cost(cur_node->state.delta_state,\n\t\t\t\t\t\t\t\tc->probs.delta) +\n\t\t\t\t\t\tlzms_delta_source_cost(c, power, raw_offset);\n\n\t\t\t\tu32 l = NBYTES_HASHED_FOR_DELTA;\n\t\t\t\tdo {\n\t\t\t\t\tu32 cost = base_cost + lzms_fast_length_cost(c, l);\n\t\t\t\t\tif (cost < (cur_node + l)->cost) {\n\t\t\t\t\t\t(cur_node + l)->cost = cost;\n\t\t\t\t\t\t(cur_node + l)->item = (struct lzms_item) {\n\t\t\t\t\t\t\t.length = l,\n\t\t\t\t\t\t\t.source = source,\n\t\t\t\t\t\t};\n\t\t\t\t\t\t(cur_node + l)->num_extra_items = 0;\n\t\t\t\t\t}\n\t\t\t\t} while (++l <= len);\n\t\t\t}\n\t\t}\n\n\t\t/* Literal  */\n\t\tif (end_node < cur_node + 1)\n\t\t\t(++end_node)->cost = INFINITE_COST;\n\t\tconst u32 cur_and_lit_cost = cur_node->cost +\n\t\t\t\t\t     lzms_literal_cost(c, cur_node->state.main_state,\n\t\t\t\t\t\t\t       *in_next);\n\t\tif (cur_and_lit_cost < (cur_node + 1)->cost) {\n\t\t\t(cur_node + 1)->cost = cur_and_lit_cost;\n\t\t\t(cur_node + 1)->item = (struct lzms_item) {\n\t\t\t\t.length = 1,\n\t\t\t\t.source = *in_next,\n\t\t\t};\n\t\t\t(cur_node + 1)->num_extra_items = 0;\n\t\t} else if (c->try_lit_lzrep0 && in_end - (in_next + 1) >= 2) {\n\t\t\t/* try lit + LZ-rep0  */\n\t\t\tconst u32 offset =\n\t\t\t\t(cur_node->state.prev_lz_offset) ?\n\t\t\t\t\tcur_node->state.prev_lz_offset :\n\t\t\t\t\tcur_node->state.recent_lz_offsets[0];\n\n\t\t\tif (load_u16_unaligned(in_next + 1) ==\n\t\t\t    load_u16_unaligned(in_next + 1 - offset))\n\t\t\t{\n\t\t\t\tconst u32 rep0_len = lz_extend(in_next + 1,\n\t\t\t\t\t\t\t       in_next + 1 - offset,\n\t\t\t\t\t\t\t       2,\n\t\t\t\t\t\t\t       min(in_end - (in_next + 1),\n\t\t\t\t\t\t\t\t   c->mf.nice_match_len));\n\n\t\t\t\tunsigned main_state = cur_node->state.main_state;\n\n\t\t\t\t/* Update main_state after literal  */\n\t\t\t\tmain_state = (main_state << 1 | 0) % LZMS_NUM_MAIN_PROBS;\n\n\t\t\t\t/* Add cost of LZ-rep0  */\n\t\t\t\tconst u32 cost = cur_and_lit_cost +\n\t\t\t\t\t\t lzms_bit_1_cost(main_state, c->probs.main) +\n\t\t\t\t\t\t lzms_bit_0_cost(cur_node->state.match_state,\n\t\t\t\t\t\t\t\t c->probs.match) +\n\t\t\t\t\t\t lzms_bit_1_cost(cur_node->state.lz_state,\n\t\t\t\t\t\t\t\t c->probs.lz) +\n\t\t\t\t\t\t lzms_bit_0_cost(cur_node->state.lz_rep_states[0],\n\t\t\t\t\t\t\t\t c->probs.lz_rep[0]) +\n\t\t\t\t\t\t lzms_fast_length_cost(c, rep0_len);\n\n\t\t\t\tconst u32 total_len = 1 + rep0_len;\n\n\t\t\t\twhile (end_node < cur_node + total_len)\n\t\t\t\t\t(++end_node)->cost = INFINITE_COST;\n\n\t\t\t\tif (cost < (cur_node + total_len)->cost) {\n\t\t\t\t\t(cur_node + total_len)->cost = cost;\n\t\t\t\t\t(cur_node + total_len)->item = (struct lzms_item) {\n\t\t\t\t\t\t.length = rep0_len,\n\t\t\t\t\t\t.source = 0,\n\t\t\t\t\t};\n\t\t\t\t\t(cur_node + total_len)->extra_items[0] = (struct lzms_item) {\n\t\t\t\t\t\t.length = 1,\n\t\t\t\t\t\t.source = *in_next,\n\t\t\t\t\t};\n\t\t\t\t\t(cur_node + total_len)->num_extra_items = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Advance to the next position.  */\n\t\tin_next++;\n\t\tcur_node++;\n\n\t\t/* The lowest-cost path to the current position is now known.\n\t\t * Finalize the adaptive state that results from taking this\n\t\t * lowest-cost path.  */\n\t\tstruct lzms_item item_to_take = cur_node->item;\n\t\tstruct lzms_optimum_node *source_node = cur_node - item_to_take.length;\n\t\tint next_item_idx = -1;\n\t\tfor (unsigned i = 0; i < cur_node->num_extra_items; i++) {\n\t\t\titem_to_take = cur_node->extra_items[i];\n\t\t\tsource_node -= item_to_take.length;\n\t\t\tnext_item_idx++;\n\t\t}\n\t\tcur_node->state = source_node->state;\n\t\tfor (;;) {\n\t\t\tconst u32 length = item_to_take.length;\n\t\t\tu32 source = item_to_take.source;\n\n\t\t\tcur_node->state.upcoming_lz_offset = 0;\n\t\t\tcur_node->state.upcoming_delta_pair = 0;\n\t\t\tif (length > 1) {\n\t\t\t\t/* Match  */\n\n\t\t\t\tlzms_update_main_state(&cur_node->state, 1);\n\n\t\t\t\tif (source & DELTA_SOURCE_TAG) {\n\t\t\t\t\t/* Delta match  */\n\n\t\t\t\t\tlzms_update_match_state(&cur_node->state, 1);\n\t\t\t\t\tsource &= ~DELTA_SOURCE_TAG;\n\n\t\t\t\t\tif (source >= LZMS_NUM_DELTA_REPS) {\n\t\t\t\t\t\t/* Explicit offset delta match  */\n\t\t\t\t\t\tlzms_update_delta_state(&cur_node->state, 0);\n\t\t\t\t\t\tcur_node->state.upcoming_delta_pair =\n\t\t\t\t\t\t\tsource - (LZMS_NUM_DELTA_REPS - 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* Repeat offset delta match  */\n\t\t\t\t\t\tint rep_idx = source;\n\n\t\t\t\t\t\tlzms_update_delta_state(&cur_node->state, 1);\n\t\t\t\t\t\tlzms_update_delta_rep_states(&cur_node->state, rep_idx);\n\n\t\t\t\t\t\tcur_node->state.upcoming_delta_pair =\n\t\t\t\t\t\t\tcur_node->state.recent_delta_pairs[rep_idx];\n\n\t\t\t\t\t\tfor (int i = rep_idx; i < LZMS_NUM_DELTA_REPS; i++)\n\t\t\t\t\t\t\tcur_node->state.recent_delta_pairs[i] =\n\t\t\t\t\t\t\t\tcur_node->state.recent_delta_pairs[i + 1];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlzms_update_match_state(&cur_node->state, 0);\n\n\t\t\t\t\tif (source >= LZMS_NUM_LZ_REPS) {\n\t\t\t\t\t\t/* Explicit offset LZ match  */\n\t\t\t\t\t\tlzms_update_lz_state(&cur_node->state, 0);\n\t\t\t\t\t\tcur_node->state.upcoming_lz_offset =\n\t\t\t\t\t\t\tsource - (LZMS_NUM_LZ_REPS - 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* Repeat offset LZ match  */\n\t\t\t\t\t\tint rep_idx = source;\n\n\t\t\t\t\t\tlzms_update_lz_state(&cur_node->state, 1);\n\t\t\t\t\t\tlzms_update_lz_rep_states(&cur_node->state, rep_idx);\n\n\t\t\t\t\t\tcur_node->state.upcoming_lz_offset =\n\t\t\t\t\t\t\tcur_node->state.recent_lz_offsets[rep_idx];\n\n\t\t\t\t\t\tfor (int i = rep_idx; i < LZMS_NUM_LZ_REPS; i++)\n\t\t\t\t\t\t\tcur_node->state.recent_lz_offsets[i] =\n\t\t\t\t\t\t\t\tcur_node->state.recent_lz_offsets[i + 1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t/* Literal  */\n\t\t\t\tlzms_update_main_state(&cur_node->state, 0);\n\t\t\t}\n\n\t\t\tlzms_update_lru_queues(&cur_node->state);\n\n\t\t\tif (next_item_idx < 0)\n\t\t\t\tbreak;\n\t\t\tif (next_item_idx == 0)\n\t\t\t\t// coverity[assigned_value]\n\t\t\t\titem_to_take = cur_node->item;\n\t\t\telse\n\t\t\t\t// coverity[assigned_value]\n\t\t\t\titem_to_take = cur_node->extra_items[next_item_idx - 1];\n\t\t\t--next_item_idx;\n\t\t}\n\n\t\t/*\n\t\t * This loop will terminate when either of the following\n\t\t * conditions is true:\n\t\t *\n\t\t * (1) cur_node == end_node\n\t\t *\n\t\t *\tThere are no paths that extend beyond the current\n\t\t *\tposition.  In this case, any path to a later position\n\t\t *\tmust pass through the current position, so we can go\n\t\t *\tahead and choose the list of items that led to this\n\t\t *\tposition.\n\t\t *\n\t\t * (2) cur_node == &c->optimum_nodes[NUM_OPTIM_NODES]\n\t\t *\n\t\t *\tThis bounds the number of times the algorithm can step\n\t\t *\tforward before it is guaranteed to start choosing items.\n\t\t *\tThis limits the memory usage.  It also guarantees that\n\t\t *\tthe parser will not go too long without updating the\n\t\t *\tprobability tables.\n\t\t *\n\t\t * Note: no check for end-of-buffer is needed because\n\t\t * end-of-buffer will trigger condition (1).\n\t\t */\n\t\tif (cur_node == end_node ||\n\t\t    cur_node == &c->optimum_nodes[NUM_OPTIM_NODES])\n\t\t{\n\t\t\tlzms_encode_nonempty_item_list(c, cur_node);\n\t\t\tc->optimum_nodes[0].state = cur_node->state;\n\t\t\tgoto begin;\n\t\t}\n\t}\n}\n\nstatic void\nlzms_init_states_and_probabilities(struct lzms_compressor *c)\n{\n\tc->main_state = 0;\n\tc->match_state = 0;\n\tc->lz_state = 0;\n\tfor (int i = 0; i < LZMS_NUM_LZ_REP_DECISIONS; i++)\n\t\tc->lz_rep_states[i] = 0;\n\tc->delta_state = 0;\n\tfor (int i = 0; i < LZMS_NUM_DELTA_REP_DECISIONS; i++)\n\t\tc->delta_rep_states[i] = 0;\n\n\tlzms_init_probabilities(&c->probs);\n}\n\nstatic void\nlzms_init_huffman_codes(struct lzms_compressor *c, unsigned num_offset_slots)\n{\n\tlzms_init_huffman_code(&c->literal_rebuild_info,\n\t\t\t       LZMS_NUM_LITERAL_SYMS,\n\t\t\t       LZMS_LITERAL_CODE_REBUILD_FREQ,\n\t\t\t       c->literal_codewords,\n\t\t\t       c->literal_lens,\n\t\t\t       c->literal_freqs);\n\n\tlzms_init_huffman_code(&c->lz_offset_rebuild_info,\n\t\t\t       num_offset_slots,\n\t\t\t       LZMS_LZ_OFFSET_CODE_REBUILD_FREQ,\n\t\t\t       c->lz_offset_codewords,\n\t\t\t       c->lz_offset_lens,\n\t\t\t       c->lz_offset_freqs);\n\n\tlzms_init_huffman_code(&c->length_rebuild_info,\n\t\t\t       LZMS_NUM_LENGTH_SYMS,\n\t\t\t       LZMS_LENGTH_CODE_REBUILD_FREQ,\n\t\t\t       c->length_codewords,\n\t\t\t       c->length_lens,\n\t\t\t       c->length_freqs);\n\n\tlzms_init_huffman_code(&c->delta_offset_rebuild_info,\n\t\t\t       num_offset_slots,\n\t\t\t       LZMS_DELTA_OFFSET_CODE_REBUILD_FREQ,\n\t\t\t       c->delta_offset_codewords,\n\t\t\t       c->delta_offset_lens,\n\t\t\t       c->delta_offset_freqs);\n\n\tlzms_init_huffman_code(&c->delta_power_rebuild_info,\n\t\t\t       LZMS_NUM_DELTA_POWER_SYMS,\n\t\t\t       LZMS_DELTA_POWER_CODE_REBUILD_FREQ,\n\t\t\t       c->delta_power_codewords,\n\t\t\t       c->delta_power_lens,\n\t\t\t       c->delta_power_freqs);\n}\n\n/*\n * Flush the output streams, prepare the final compressed data, and return its\n * size in bytes.\n *\n * A return value of 0 indicates that the data could not be compressed to fit in\n * the available space.\n */\nstatic size_t\nlzms_finalize(struct lzms_compressor *c)\n{\n\tsize_t num_forwards_bytes;\n\tsize_t num_backwards_bytes;\n\n\t/* Flush both the forwards and backwards streams, and make sure they\n\t * didn't cross each other and start overwriting each other's data.  */\n\tif (!lzms_output_bitstream_flush(&c->os))\n\t\treturn 0;\n\n\tif (!lzms_range_encoder_flush(&c->rc))\n\t\treturn 0;\n\n\tif (c->rc.next > c->os.next)\n\t\treturn 0;\n\n\t/* Now the compressed buffer contains the data output by the forwards\n\t * bitstream, then empty space, then data output by the backwards\n\t * bitstream.  Move the data output by the backwards bitstream to be\n\t * adjacent to the data output by the forward bitstream, and calculate\n\t * the compressed size that this results in.  */\n\tnum_forwards_bytes = c->rc.next - c->rc.begin;\n\tnum_backwards_bytes = c->rc.end - c->os.next;\n\n\tmemmove(c->rc.next, c->os.next, num_backwards_bytes);\n\n\treturn num_forwards_bytes + num_backwards_bytes;\n}\n\nstatic u64\nlzms_get_needed_memory(size_t max_bufsize, unsigned compression_level,\n\t\t       bool destructive)\n{\n\tu64 size = 0;\n\n\tif (max_bufsize > LZMS_MAX_BUFFER_SIZE)\n\t\treturn 0;\n\n\tsize += sizeof(struct lzms_compressor);\n\n\tif (!destructive)\n\t\tsize += max_bufsize; /* in_buffer */\n\n\t/* mf */\n\tsize += lcpit_matchfinder_get_needed_memory(max_bufsize);\n\n\treturn size;\n}\n\nstatic int\nlzms_create_compressor(size_t max_bufsize, unsigned compression_level,\n\t\t       bool destructive, void **c_ret)\n{\n\tstruct lzms_compressor *c;\n\tu32 nice_match_len;\n\n\tif (max_bufsize > LZMS_MAX_BUFFER_SIZE)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tc = ALIGNED_MALLOC(sizeof(struct lzms_compressor), 64);\n\tif (!c)\n\t\tgoto oom0;\n\n\tc->destructive = destructive;\n\n\t/* Scale nice_match_len with the compression level.  But to allow an\n\t * optimization for length cost calculations, don't allow nice_match_len\n\t * to exceed MAX_FAST_LENGTH.  */\n\tnice_match_len = min(((u64)compression_level * 63) / 50, MAX_FAST_LENGTH);\n\n\tc->use_delta_matches = (compression_level >= 35);\n\tc->try_lzmatch_lit_lzrep0 = (compression_level >= 45);\n\tc->try_lit_lzrep0 = (compression_level >= 60);\n\tc->try_lzrep_lit_lzrep0 = (compression_level >= 60);\n\n\tif (!c->destructive) {\n\t\tc->in_buffer = MALLOC(max_bufsize);\n\t\tif (!c->in_buffer)\n\t\t\tgoto oom1;\n\t}\n\n\tif (!lcpit_matchfinder_init(&c->mf, max_bufsize, 2, nice_match_len))\n\t\tgoto oom2;\n\n\tlzms_init_fast_length_slot_tab(c);\n\tlzms_init_offset_slot_tabs(c);\n\n\t*c_ret = c;\n\treturn 0;\n\noom2:\n\tif (!c->destructive)\n\t\tFREE(c->in_buffer);\noom1:\n\tALIGNED_FREE(c);\noom0:\n\treturn WIMLIB_ERR_NOMEM;\n}\n\nstatic size_t\nlzms_compress(const void *restrict in, size_t in_nbytes,\n\t      void *restrict out, size_t out_nbytes_avail, void *restrict _c)\n{\n\tstruct lzms_compressor *c = _c;\n\tsize_t result;\n\n\t/* Don't bother trying to compress extremely small inputs.  */\n\tif (in_nbytes < 4)\n\t\treturn 0;\n\n\t/* Copy the input data into the internal buffer and preprocess it.  */\n\tif (c->destructive)\n\t\tc->in_buffer = (void *)in;\n\telse\n\t\tmemcpy(c->in_buffer, in, in_nbytes);\n\tc->in_nbytes = in_nbytes;\n\tlzms_x86_filter(c->in_buffer, in_nbytes, c->last_target_usages, false);\n\n\t/* Prepare the matchfinders.  */\n\tlcpit_matchfinder_load_buffer(&c->mf, c->in_buffer, c->in_nbytes);\n\tif (c->use_delta_matches)\n\t\tlzms_init_delta_matchfinder(c);\n\n\t/* Initialize the encoder structures.  */\n\tlzms_range_encoder_init(&c->rc, out, out_nbytes_avail);\n\tlzms_output_bitstream_init(&c->os, out, out_nbytes_avail);\n\tlzms_init_states_and_probabilities(c);\n\tlzms_init_huffman_codes(c, lzms_get_num_offset_slots(c->in_nbytes));\n\n\t/* The main loop: parse and encode.  */\n\tlzms_near_optimal_parse(c);\n\n\t/* Return the compressed data size or 0.  */\n\tresult = lzms_finalize(c);\n\tif (!result && c->destructive)\n\t\tlzms_x86_filter(c->in_buffer, c->in_nbytes, c->last_target_usages, true);\n\treturn result;\n}\n\nstatic void\nlzms_free_compressor(void *_c)\n{\n\tstruct lzms_compressor *c = _c;\n\n\tif (!c->destructive)\n\t\tFREE(c->in_buffer);\n\tlcpit_matchfinder_destroy(&c->mf);\n\tALIGNED_FREE(c);\n}\n\nconst struct compressor_ops lzms_compressor_ops = {\n\t.get_needed_memory  = lzms_get_needed_memory,\n\t.create_compressor  = lzms_create_compressor,\n\t.compress\t    = lzms_compress,\n\t.free_compressor    = lzms_free_compressor,\n};\n"
  },
  {
    "path": "src/wimlib/lzms_decompress.c",
    "content": "/*\n * lzms_decompress.c\n *\n * A decompressor for the LZMS compression format.\n */\n\n/*\n * Copyright (C) 2013-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n/*\n * This is a decompressor for the LZMS compression format used by Microsoft.\n * This format is not documented, but it is one of the formats supported by the\n * compression API available in Windows 8, and as of Windows 8 it is one of the\n * formats that can be used in WIM files.\n *\n * This decompressor only implements \"raw\" decompression, which decompresses a\n * single LZMS-compressed block.  This behavior is the same as that of\n * Decompress() in the Windows 8 compression API when using a compression handle\n * created with CreateDecompressor() with the Algorithm parameter specified as\n * COMPRESS_ALGORITHM_LZMS | COMPRESS_RAW.  Presumably, non-raw LZMS data is a\n * container format from which the locations and sizes (both compressed and\n * uncompressed) of the constituent blocks can be determined.\n *\n * An LZMS-compressed block must be read in 16-bit little endian units from both\n * directions.  One logical bitstream starts at the front of the block and\n * proceeds forwards.  Another logical bitstream starts at the end of the block\n * and proceeds backwards.  Bits read from the forwards bitstream constitute\n * binary range-encoded data, whereas bits read from the backwards bitstream\n * constitute Huffman-encoded symbols or verbatim bits.  For both bitstreams,\n * the ordering of the bits within the 16-bit coding units is such that the\n * first bit is the high-order bit and the last bit is the low-order bit.\n *\n * From these two logical bitstreams, an LZMS decompressor can reconstitute the\n * series of items that make up the LZMS data representation.  Each such item\n * may be a literal byte or a match.  Matches may be either traditional LZ77\n * matches or \"delta\" matches, either of which can have its offset encoded\n * explicitly or encoded via a reference to a recently used (repeat) offset.\n *\n * A traditional LZ77 match consists of a length and offset.  It asserts that\n * the sequence of bytes beginning at the current position and extending for the\n * length is equal to the same-length sequence of bytes at the offset back in\n * the data buffer.  This type of match can be visualized as follows, with the\n * caveat that the sequences may overlap:\n *\n *                                offset\n *                         --------------------\n *                         |                  |\n *                         B[1...len]         A[1...len]\n *\n * Decoding proceeds as follows:\n *\n *                      do {\n *                              *A++ = *B++;\n *                      } while (--length);\n *\n * On the other hand, a delta match consists of a \"span\" as well as a length and\n * offset.  A delta match can be visualized as follows, with the caveat that the\n * various sequences may overlap:\n *\n *                                       offset\n *                            -----------------------------\n *                            |                           |\n *                    span    |                   span    |\n *                -------------               -------------\n *                |           |               |           |\n *                D[1...len]  C[1...len]      B[1...len]  A[1...len]\n *\n * Decoding proceeds as follows:\n *\n *                      do {\n *                              *A++ = *B++ + *C++ - *D++;\n *                      } while (--length);\n *\n * A delta match asserts that the bytewise differences of the A and B sequences\n * are equal to the bytewise differences of the C and D sequences.  The\n * sequences within each pair are separated by the same number of bytes, the\n * \"span\".  The inter-pair distance is the \"offset\".  In LZMS, spans are\n * restricted to powers of 2 between 2**0 and 2**7 inclusively.  Offsets are\n * restricted to multiples of the span.  The stored value for the offset is the\n * \"raw offset\", which is the real offset divided by the span.\n *\n * Delta matches can cover data containing a series of power-of-2 sized integers\n * that is linearly increasing or decreasing.  Another way of thinking about it\n * is that a delta match can match a longer sequence that is interrupted by a\n * non-matching byte, provided that the non-matching byte is a continuation of a\n * linearly changing pattern.  Examples of files that may contain data like this\n * are uncompressed bitmap images, uncompressed digital audio, and Unicode data\n * tables.  To some extent, this match type is a replacement for delta filters\n * or multimedia filters that are sometimes used in other compression software\n * (e.g.  'xz --delta --lzma2').  However, on most types of files, delta matches\n * do not seem to be very useful.\n *\n * Both LZ and delta matches may use overlapping sequences.  Therefore, they\n * must be decoded as if only one byte is copied at a time.\n *\n * For both LZ and delta matches, any match length in [1, 1073809578] can be\n * represented.  Similarly, any match offset in [1, 1180427428] can be\n * represented.  For delta matches, this range applies to the raw offset, so the\n * real offset may be larger.\n *\n * For LZ matches, up to 3 repeat offsets are allowed, similar to some other\n * LZ-based formats such as LZX and LZMA.  They must updated in an LRU fashion,\n * except for a quirk: inserting anything to the front of the queue must be\n * delayed by one LZMS item.  The reason for this is presumably that there is\n * almost no reason to code the same match offset twice in a row, since you\n * might as well have coded a longer match at that offset.  For this same\n * reason, it also is a requirement that when an offset in the queue is used,\n * that offset is removed from the queue immediately (and made pending for\n * front-insertion after the following decoded item), and everything to the\n * right is shifted left one queue slot.  This creates a need for an \"overflow\"\n * fourth entry in the queue, even though it is only possible to decode\n * references to the first 3 entries at any given time.  The queue must be\n * initialized to the offsets {1, 2, 3, 4}.\n *\n * Repeat delta matches are handled similarly, but for them the queue contains\n * (power, raw offset) pairs.  This queue must be initialized to\n * {(0, 1), (0, 2), (0, 3), (0, 4)}.\n *\n * Bits from the binary range decoder must be used to disambiguate item types.\n * The range decoder must hold two state variables: the range, which must\n * initially be set to 0xffffffff, and the current code, which must initially be\n * set to the first 32 bits read from the forwards bitstream.  The range must be\n * maintained above 0xffff; when it falls below 0xffff, both the range and code\n * must be left-shifted by 16 bits and the low 16 bits of the code must be\n * filled in with the next 16 bits from the forwards bitstream.\n *\n * To decode each bit, the binary range decoder requires a probability that is\n * logically a real number between 0 and 1.  Multiplying this probability by the\n * current range and taking the floor gives the bound between the 0-bit region of\n * the range and the 1-bit region of the range.  However, in LZMS, probabilities\n * are restricted to values of n/64 where n is an integer is between 1 and 63\n * inclusively, so the implementation may use integer operations instead.\n * Following calculation of the bound, if the current code is in the 0-bit\n * region, the new range becomes the current code and the decoded bit is 0;\n * otherwise, the bound must be subtracted from both the range and the code, and\n * the decoded bit is 1.  More information about range coding can be found at\n * https://en.wikipedia.org/wiki/Range_encoding.  Furthermore, note that the\n * LZMA format also uses range coding and has public domain code available for\n * it.\n *\n * The probability used to range-decode each bit must be taken from a table, of\n * which one instance must exist for each distinct context, or \"binary decision\n * class\", in which a range-decoded bit is needed.  At each call of the range\n * decoder, the appropriate probability must be obtained by indexing the\n * appropriate probability table with the last 4 (in the context disambiguating\n * literals from matches), 5 (in the context disambiguating LZ matches from\n * delta matches), or 6 (in all other contexts) bits recently range-decoded in\n * that context, ordered such that the most recently decoded bit is the\n * low-order bit of the index.\n *\n * Furthermore, each probability entry itself is variable, as its value must be\n * maintained as n/64 where n is the number of 0 bits in the most recently\n * decoded 64 bits with that same entry.  This allows the compressed\n * representation to adapt to the input and use fewer bits to represent the most\n * likely data; note that LZMA uses a similar scheme.  Initially, the most\n * recently 64 decoded bits for each probability entry are assumed to be\n * 0x0000000055555555 (high order to low order); therefore, all probabilities\n * are initially 48/64.  During the course of decoding, each probability may be\n * updated to as low as 0/64 (as a result of reading many consecutive 1 bits\n * with that entry) or as high as 64/64 (as a result of reading many consecutive\n * 0 bits with that entry); however, probabilities of 0/64 and 64/64 cannot be\n * used as-is but rather must be adjusted to 1/64 and 63/64, respectively,\n * before being used for range decoding.\n *\n * Representations of the LZMS items themselves must be read from the backwards\n * bitstream.  For this, there are 5 different Huffman codes used:\n *\n *  - The literal code, used for decoding literal bytes.  Each of the 256\n *    symbols represents a literal byte.  This code must be rebuilt whenever\n *    1024 symbols have been decoded with it.\n *\n *  - The LZ offset code, used for decoding the offsets of standard LZ77\n *    matches.  Each symbol represents an offset slot, which corresponds to a\n *    base value and some number of extra bits which must be read and added to\n *    the base value to reconstitute the full offset.  The number of symbols in\n *    this code is the number of offset slots needed to represent all possible\n *    offsets in the uncompressed block.  This code must be rebuilt whenever\n *    1024 symbols have been decoded with it.\n *\n *  - The length code, used for decoding length symbols.  Each of the 54 symbols\n *    represents a length slot, which corresponds to a base value and some\n *    number of extra bits which must be read and added to the base value to\n *    reconstitute the full length.  This code must be rebuilt whenever 512\n *    symbols have been decoded with it.\n *\n *  - The delta offset code, used for decoding the raw offsets of delta matches.\n *    Each symbol corresponds to an offset slot, which corresponds to a base\n *    value and some number of extra bits which must be read and added to the\n *    base value to reconstitute the full raw offset.  The number of symbols in\n *    this code is equal to the number of symbols in the LZ offset code.  This\n *    code must be rebuilt whenever 1024 symbols have been decoded with it.\n *\n *  - The delta power code, used for decoding the powers of delta matches.  Each\n *    of the 8 symbols corresponds to a power.  This code must be rebuilt\n *    whenever 512 symbols have been decoded with it.\n *\n * Initially, each Huffman code must be built assuming that each symbol in that\n * code has frequency 1.  Following that, each code must be rebuilt each time a\n * certain number of symbols, as noted above, has been decoded with it.  The\n * symbol frequencies for a code must be halved after each rebuild of that code;\n * this makes the codes adapt to the more recent data.\n *\n * Like other compression formats such as XPRESS, LZX, and DEFLATE, the LZMS\n * format requires that all Huffman codes be constructed in canonical form.\n * This form requires that same-length codewords be lexicographically ordered\n * the same way as the corresponding symbols and that all shorter codewords\n * lexicographically precede longer codewords.  Such a code can be constructed\n * directly from codeword lengths.\n *\n * Even with the canonical code restriction, the same frequencies can be used to\n * construct multiple valid Huffman codes.  Therefore, the decompressor needs to\n * construct the right one.  Specifically, the LZMS format requires that the\n * Huffman code be constructed as if the well-known priority queue algorithm is\n * used and frequency ties are always broken in favor of leaf nodes.\n *\n * Codewords in LZMS are guaranteed to not exceed 15 bits.  The format otherwise\n * places no restrictions on codeword length.  Therefore, the Huffman code\n * construction algorithm that a correct LZMS decompressor uses need not\n * implement length-limited code construction.  But if it does (e.g. by virtue\n * of being shared among multiple compression algorithms), the details of how it\n * does so are unimportant, provided that the maximum codeword length parameter\n * is set to at least 15 bits.\n *\n * After all LZMS items have been decoded, the data must be postprocessed to\n * translate absolute address encoded in x86 instructions into their original\n * relative addresses.\n *\n * Details omitted above can be found in the code.  Note that in the absence of\n * an official specification there is no guarantee that this decompressor\n * handles all possible cases.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/compress_common.h\"\n#include \"wimlib/decompress_common.h\"\n#include \"wimlib/decompressor_ops.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/lzms_common.h\"\n#include \"wimlib/util.h\"\n\n/* The TABLEBITS values can be changed; they only affect decoding speed.  */\n#define LZMS_LITERAL_TABLEBITS\t\t10\n#define LZMS_LENGTH_TABLEBITS\t\t9\n#define LZMS_LZ_OFFSET_TABLEBITS\t11\n#define LZMS_DELTA_OFFSET_TABLEBITS\t11\n#define LZMS_DELTA_POWER_TABLEBITS\t7\n\nstruct lzms_range_decoder {\n\n\t/* The relevant part of the current range.  Although the logical range\n\t * for range decoding is a very large integer, only a small portion\n\t * matters at any given time, and it can be normalized (shifted left)\n\t * whenever it gets too small.  */\n\tu32 range;\n\n\t/* The current position in the range encoded by the portion of the input\n\t * read so far.  */\n\tu32 code;\n\n\t/* Pointer to the next little-endian 16-bit integer in the compressed\n\t * input data (reading forwards).  */\n\tconst u8 *next;\n\n\t/* Pointer to the end of the compressed input data.  */\n\tconst u8 *end;\n};\n\ntypedef u64 bitbuf_t;\n\nstruct lzms_input_bitstream {\n\n\t/* Holding variable for bits that have been read from the compressed\n\t * data.  The bit ordering is high to low.  */\n\tbitbuf_t bitbuf;\n\n\t/* Number of bits currently held in @bitbuf.  */\n\tunsigned bitsleft;\n\n\t/* Pointer to the one past the next little-endian 16-bit integer in the\n\t * compressed input data (reading backwards).  */\n\tconst u8 *next;\n\n\t/* Pointer to the beginning of the compressed input data.  */\n\tconst u8 *begin;\n};\n\n#define BITBUF_NBITS\t(8 * sizeof(bitbuf_t))\n\n/* Bookkeeping information for an adaptive Huffman code  */\nstruct lzms_huffman_rebuild_info {\n\tunsigned num_syms_until_rebuild;\n\tunsigned num_syms;\n\tunsigned rebuild_freq;\n\tu32 *codewords;\n\tu32 *freqs;\n\tu16 *decode_table;\n\tunsigned table_bits;\n};\n\nstruct lzms_decompressor {\n\n\t/* 'last_target_usages' is in union with everything else because it is\n\t * only used for postprocessing.  */\n\tunion {\n\tstruct {\n\n\tstruct lzms_probabilites probs;\n\n\tDECODE_TABLE(literal_decode_table, LZMS_NUM_LITERAL_SYMS,\n\t\t     LZMS_LITERAL_TABLEBITS, LZMS_MAX_CODEWORD_LENGTH);\n\tu32 literal_freqs[LZMS_NUM_LITERAL_SYMS];\n\tstruct lzms_huffman_rebuild_info literal_rebuild_info;\n\n\tDECODE_TABLE(lz_offset_decode_table, LZMS_MAX_NUM_OFFSET_SYMS,\n\t\t     LZMS_LZ_OFFSET_TABLEBITS, LZMS_MAX_CODEWORD_LENGTH);\n\tu32 lz_offset_freqs[LZMS_MAX_NUM_OFFSET_SYMS];\n\tstruct lzms_huffman_rebuild_info lz_offset_rebuild_info;\n\n\tDECODE_TABLE(length_decode_table, LZMS_NUM_LENGTH_SYMS,\n\t\t     LZMS_LENGTH_TABLEBITS, LZMS_MAX_CODEWORD_LENGTH);\n\tu32 length_freqs[LZMS_NUM_LENGTH_SYMS];\n\tstruct lzms_huffman_rebuild_info length_rebuild_info;\n\n\tDECODE_TABLE(delta_offset_decode_table, LZMS_MAX_NUM_OFFSET_SYMS,\n\t\t     LZMS_DELTA_OFFSET_TABLEBITS, LZMS_MAX_CODEWORD_LENGTH);\n\tu32 delta_offset_freqs[LZMS_MAX_NUM_OFFSET_SYMS];\n\tstruct lzms_huffman_rebuild_info delta_offset_rebuild_info;\n\n\tDECODE_TABLE(delta_power_decode_table, LZMS_NUM_DELTA_POWER_SYMS,\n\t\t     LZMS_DELTA_POWER_TABLEBITS, LZMS_MAX_CODEWORD_LENGTH);\n\tu32 delta_power_freqs[LZMS_NUM_DELTA_POWER_SYMS];\n\tstruct lzms_huffman_rebuild_info delta_power_rebuild_info;\n\n\t/* Temporary space for lzms_build_huffman_code() */\n\tunion {\n\t\tu32 codewords[LZMS_MAX_NUM_SYMS];\n\t\tDECODE_TABLE_WORKING_SPACE(working_space, LZMS_MAX_NUM_SYMS,\n\t\t\t\t\t   LZMS_MAX_CODEWORD_LENGTH);\n\t};\n\n\t}; // struct\n\n\ts32 last_target_usages[65536];\n\n\t}; // union\n};\n\n/* Initialize the input bitstream @is to read backwards from the compressed data\n * buffer @in that is @count bytes long.  */\nstatic void\nlzms_input_bitstream_init(struct lzms_input_bitstream *is,\n\t\t\t  const u8 *in, size_t count)\n{\n\tis->bitbuf = 0;\n\tis->bitsleft = 0;\n\tis->next = in + count;\n\tis->begin = in;\n}\n\n/* Ensure that at least @num_bits bits are in the bitbuffer variable.\n * @num_bits cannot be more than 32.  */\nstatic forceinline void\nlzms_ensure_bits(struct lzms_input_bitstream *is, unsigned num_bits)\n{\n\tunsigned avail;\n\n\tif (is->bitsleft >= num_bits)\n\t\treturn;\n\n\tavail = BITBUF_NBITS - is->bitsleft;\n\n\tif (UNALIGNED_ACCESS_IS_FAST && CPU_IS_LITTLE_ENDIAN() &&\n\t    WORDBYTES == 8 && likely(is->next - is->begin >= 8))\n\t{\n\t\tis->next -= (avail & ~15) >> 3;\n\t\tis->bitbuf |= load_u64_unaligned(is->next) << (avail & 15);\n\t\tis->bitsleft += avail & ~15;\n\t} else {\n\t\tif (likely(is->next != is->begin)) {\n\t\t\tis->next -= sizeof(le16);\n\t\t\tis->bitbuf |= (bitbuf_t)get_unaligned_le16(is->next)\n\t\t\t\t\t<< (avail - 16);\n\t\t}\n\t\tif (likely(is->next != is->begin)) {\n\t\t\tis->next -= sizeof(le16);\n\t\t\tis->bitbuf |= (bitbuf_t)get_unaligned_le16(is->next)\n\t\t\t\t\t<< (avail - 32);\n\t\t}\n\t\tis->bitsleft += 32;\n\t}\n}\n\n/* Get @num_bits bits from the bitbuffer variable.  */\nstatic forceinline bitbuf_t\nlzms_peek_bits(struct lzms_input_bitstream *is, unsigned num_bits)\n{\n\treturn (is->bitbuf >> 1) >> (BITBUF_NBITS - num_bits - 1);\n}\n\n/* Remove @num_bits bits from the bitbuffer variable.  */\nstatic forceinline void\nlzms_remove_bits(struct lzms_input_bitstream *is, unsigned num_bits)\n{\n\tis->bitbuf <<= num_bits;\n\tis->bitsleft -= num_bits;\n}\n\n/* Remove and return @num_bits bits from the bitbuffer variable.  */\nstatic forceinline bitbuf_t\nlzms_pop_bits(struct lzms_input_bitstream *is, unsigned num_bits)\n{\n\tbitbuf_t bits = lzms_peek_bits(is, num_bits);\n\tlzms_remove_bits(is, num_bits);\n\treturn bits;\n}\n\n/* Read @num_bits bits from the input bitstream.  */\nstatic forceinline bitbuf_t\nlzms_read_bits(struct lzms_input_bitstream *is, unsigned num_bits)\n{\n\tlzms_ensure_bits(is, num_bits);\n\treturn lzms_pop_bits(is, num_bits);\n}\n\n/* Initialize the range decoder @rd to read forwards from the compressed data\n * buffer @in that is @count bytes long.  */\nstatic void\nlzms_range_decoder_init(struct lzms_range_decoder *rd,\n\t\t\tconst u8 *in, size_t count)\n{\n\trd->range = 0xffffffff;\n\trd->code = ((u32)get_unaligned_le16(in) << 16) |\n\t\t   get_unaligned_le16(in + 2);\n\trd->next = in + 4;\n\trd->end = in + count;\n}\n\n/*\n * Decode a bit using the range coder.  The current state specifies the\n * probability entry to use.  The state and probability entry will be updated\n * based on the decoded bit.\n */\nstatic forceinline int\nlzms_decode_bit(struct lzms_range_decoder *rd, u32 *state_p, u32 num_states,\n\t\tstruct lzms_probability_entry *probs)\n{\n\tstruct lzms_probability_entry *prob_entry;\n\tu32 prob;\n\tu32 bound;\n\n\t/* Load the probability entry corresponding to the current state.  */\n\tprob_entry = &probs[*state_p];\n\n\t/* Update the state early.  We'll still need to OR the state with 1\n\t * later if the decoded bit is a 1.  */\n\t*state_p = (*state_p << 1) & (num_states - 1);\n\n\t/* Get the probability (out of LZMS_PROBABILITY_DENOMINATOR) that the\n\t * next bit is 0.  */\n\tprob = lzms_get_probability(prob_entry);\n\n\t/* Normalize if needed.  */\n\tif (!(rd->range & 0xFFFF0000)) {\n\t\trd->range <<= 16;\n\t\trd->code <<= 16;\n\t\tif (likely(rd->next != rd->end)) {\n\t\t\trd->code |= get_unaligned_le16(rd->next);\n\t\t\trd->next += sizeof(le16);\n\t\t}\n\t}\n\n\t/* Based on the probability, calculate the bound between the 0-bit\n\t * region and the 1-bit region of the range.  */\n\tbound = (rd->range >> LZMS_PROBABILITY_BITS) * prob;\n\n\tif (rd->code < bound) {\n\t\t/* Current code is in the 0-bit region of the range.  */\n\t\trd->range = bound;\n\n\t\t/* Update the state and probability entry based on the decoded bit.  */\n\t\tlzms_update_probability_entry(prob_entry, 0);\n\t\treturn 0;\n\t} else {\n\t\t/* Current code is in the 1-bit region of the range.  */\n\t\trd->range -= bound;\n\t\trd->code -= bound;\n\n\t\t/* Update the state and probability entry based on the decoded bit.  */\n\t\tlzms_update_probability_entry(prob_entry, 1);\n\t\t*state_p |= 1;\n\t\treturn 1;\n\t}\n}\n\nstatic void\nlzms_build_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info)\n{\n\tmake_canonical_huffman_code(rebuild_info->num_syms,\n\t\t\t\t    LZMS_MAX_CODEWORD_LENGTH,\n\t\t\t\t    rebuild_info->freqs,\n\t\t\t\t    (u8 *)rebuild_info->decode_table,\n\t\t\t\t    rebuild_info->codewords);\n\n\tmake_huffman_decode_table(rebuild_info->decode_table,\n\t\t\t\t  rebuild_info->num_syms,\n\t\t\t\t  rebuild_info->table_bits,\n\t\t\t\t  (u8 *)rebuild_info->decode_table,\n\t\t\t\t  LZMS_MAX_CODEWORD_LENGTH,\n\t\t\t\t  (u16 *)rebuild_info->codewords);\n\n\trebuild_info->num_syms_until_rebuild = rebuild_info->rebuild_freq;\n}\n\nstatic void\nlzms_init_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info,\n\t\t       unsigned num_syms, unsigned rebuild_freq,\n\t\t       u32 *codewords, u32 *freqs,\n\t\t       u16 *decode_table, unsigned table_bits)\n{\n\trebuild_info->num_syms = num_syms;\n\trebuild_info->rebuild_freq = rebuild_freq;\n\trebuild_info->codewords = codewords;\n\trebuild_info->freqs = freqs;\n\trebuild_info->decode_table = decode_table;\n\trebuild_info->table_bits = table_bits;\n\tlzms_init_symbol_frequencies(freqs, num_syms);\n\tlzms_build_huffman_code(rebuild_info);\n}\n\nstatic void\nlzms_init_huffman_codes(struct lzms_decompressor *d, unsigned num_offset_slots)\n{\n\tlzms_init_huffman_code(&d->literal_rebuild_info,\n\t\t\t       LZMS_NUM_LITERAL_SYMS,\n\t\t\t       LZMS_LITERAL_CODE_REBUILD_FREQ,\n\t\t\t       d->codewords,\n\t\t\t       d->literal_freqs,\n\t\t\t       d->literal_decode_table,\n\t\t\t       LZMS_LITERAL_TABLEBITS);\n\n\tlzms_init_huffman_code(&d->lz_offset_rebuild_info,\n\t\t\t       num_offset_slots,\n\t\t\t       LZMS_LZ_OFFSET_CODE_REBUILD_FREQ,\n\t\t\t       d->codewords,\n\t\t\t       d->lz_offset_freqs,\n\t\t\t       d->lz_offset_decode_table,\n\t\t\t       LZMS_LZ_OFFSET_TABLEBITS);\n\n\tlzms_init_huffman_code(&d->length_rebuild_info,\n\t\t\t       LZMS_NUM_LENGTH_SYMS,\n\t\t\t       LZMS_LENGTH_CODE_REBUILD_FREQ,\n\t\t\t       d->codewords,\n\t\t\t       d->length_freqs,\n\t\t\t       d->length_decode_table,\n\t\t\t       LZMS_LENGTH_TABLEBITS);\n\n\tlzms_init_huffman_code(&d->delta_offset_rebuild_info,\n\t\t\t       num_offset_slots,\n\t\t\t       LZMS_DELTA_OFFSET_CODE_REBUILD_FREQ,\n\t\t\t       d->codewords,\n\t\t\t       d->delta_offset_freqs,\n\t\t\t       d->delta_offset_decode_table,\n\t\t\t       LZMS_DELTA_OFFSET_TABLEBITS);\n\n\tlzms_init_huffman_code(&d->delta_power_rebuild_info,\n\t\t\t       LZMS_NUM_DELTA_POWER_SYMS,\n\t\t\t       LZMS_DELTA_POWER_CODE_REBUILD_FREQ,\n\t\t\t       d->codewords,\n\t\t\t       d->delta_power_freqs,\n\t\t\t       d->delta_power_decode_table,\n\t\t\t       LZMS_DELTA_POWER_TABLEBITS);\n}\n\nstatic _noinline void\nlzms_rebuild_huffman_code(struct lzms_huffman_rebuild_info *rebuild_info)\n{\n\tlzms_build_huffman_code(rebuild_info);\n\tlzms_dilute_symbol_frequencies(rebuild_info->freqs, rebuild_info->num_syms);\n}\n\n/* XXX: mostly copied from read_huffsym() in decompress_common.h because LZMS\n * needs its own bitstream */\nstatic forceinline unsigned\nlzms_decode_huffman_symbol(struct lzms_input_bitstream *is, u16 decode_table[],\n\t\t\t   unsigned table_bits, u32 freqs[],\n\t\t\t   struct lzms_huffman_rebuild_info *rebuild_info)\n{\n\tunsigned entry;\n\tunsigned symbol;\n\tunsigned length;\n\n\tlzms_ensure_bits(is, LZMS_MAX_CODEWORD_LENGTH);\n\n\tentry = decode_table[lzms_peek_bits(is, table_bits)];\n\tsymbol = entry >> DECODE_TABLE_SYMBOL_SHIFT;\n\tlength = entry & DECODE_TABLE_LENGTH_MASK;\n\n\tif (entry >= (1U << (table_bits + DECODE_TABLE_SYMBOL_SHIFT))) {\n\t\tlzms_remove_bits(is, table_bits);\n\t\tentry = decode_table[symbol + lzms_peek_bits(is, length)];\n\t\tsymbol = entry >> DECODE_TABLE_SYMBOL_SHIFT;\n\t\tlength = entry & DECODE_TABLE_LENGTH_MASK;\n\t}\n\n\tlzms_remove_bits(is, length);\n\n\tfreqs[symbol]++;\n\tif (--rebuild_info->num_syms_until_rebuild == 0)\n\t\tlzms_rebuild_huffman_code(rebuild_info);\n\treturn symbol;\n}\n\nstatic forceinline unsigned\nlzms_decode_literal(struct lzms_decompressor *d,\n\t\t    struct lzms_input_bitstream *is)\n{\n\treturn lzms_decode_huffman_symbol(is,\n\t\t\t\t\t  d->literal_decode_table,\n\t\t\t\t\t  LZMS_LITERAL_TABLEBITS,\n\t\t\t\t\t  d->literal_freqs,\n\t\t\t\t\t  &d->literal_rebuild_info);\n}\n\nstatic forceinline u32\nlzms_decode_lz_offset(struct lzms_decompressor *d,\n\t\t      struct lzms_input_bitstream *is)\n{\n\tunsigned slot = lzms_decode_huffman_symbol(is,\n\t\t\t\t\t\t   d->lz_offset_decode_table,\n\t\t\t\t\t\t   LZMS_LZ_OFFSET_TABLEBITS,\n\t\t\t\t\t\t   d->lz_offset_freqs,\n\t\t\t\t\t\t   &d->lz_offset_rebuild_info);\n\treturn lzms_offset_slot_base[slot] +\n\t       lzms_read_bits(is, lzms_extra_offset_bits[slot]);\n}\n\nstatic forceinline u32\nlzms_decode_length(struct lzms_decompressor *d,\n\t\t   struct lzms_input_bitstream *is)\n{\n\tunsigned slot = lzms_decode_huffman_symbol(is,\n\t\t\t\t\t\t   d->length_decode_table,\n\t\t\t\t\t\t   LZMS_LENGTH_TABLEBITS,\n\t\t\t\t\t\t   d->length_freqs,\n\t\t\t\t\t\t   &d->length_rebuild_info);\n\tu32 length = lzms_length_slot_base[slot];\n\tunsigned num_extra_bits = lzms_extra_length_bits[slot];\n\t/* Usually most lengths are short and have no extra bits.  */\n\tif (num_extra_bits)\n\t\tlength += lzms_read_bits(is, num_extra_bits);\n\treturn length;\n}\n\nstatic forceinline u32\nlzms_decode_delta_offset(struct lzms_decompressor *d,\n\t\t\t struct lzms_input_bitstream *is)\n{\n\tunsigned slot = lzms_decode_huffman_symbol(is,\n\t\t\t\t\t\t   d->delta_offset_decode_table,\n\t\t\t\t\t\t   LZMS_DELTA_OFFSET_TABLEBITS,\n\t\t\t\t\t\t   d->delta_offset_freqs,\n\t\t\t\t\t\t   &d->delta_offset_rebuild_info);\n\treturn lzms_offset_slot_base[slot] +\n\t       lzms_read_bits(is, lzms_extra_offset_bits[slot]);\n}\n\nstatic forceinline unsigned\nlzms_decode_delta_power(struct lzms_decompressor *d,\n\t\t\tstruct lzms_input_bitstream *is)\n{\n\treturn lzms_decode_huffman_symbol(is,\n\t\t\t\t\t  d->delta_power_decode_table,\n\t\t\t\t\t  LZMS_DELTA_POWER_TABLEBITS,\n\t\t\t\t\t  d->delta_power_freqs,\n\t\t\t\t\t  &d->delta_power_rebuild_info);\n}\n\nstatic int\nlzms_create_decompressor(size_t max_bufsize, void **d_ret)\n{\n\tstruct lzms_decompressor *d;\n\n\tif (max_bufsize > LZMS_MAX_BUFFER_SIZE)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\td = ALIGNED_MALLOC(sizeof(struct lzms_decompressor),\n\t\t\t   DECODE_TABLE_ALIGNMENT);\n\tif (!d)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\t*d_ret = d;\n\treturn 0;\n}\n\n/*\n * Decompress @in_nbytes bytes of LZMS-compressed data at @in and write the\n * uncompressed data, which had original size @out_nbytes, to @out.  Return 0 if\n * successful or -1 if the compressed data is invalid.\n */\nstatic int\nlzms_decompress(const void * const restrict in, const size_t in_nbytes,\n\t\tvoid * const restrict out, const size_t out_nbytes,\n\t\tvoid * const restrict _d)\n{\n\tstruct lzms_decompressor *d = _d;\n\tu8 *out_next = out;\n\tu8 * const out_end = _PTR(out + out_nbytes);\n\tstruct lzms_range_decoder rd;\n\tstruct lzms_input_bitstream is;\n\n\t/* LRU queues for match sources  */\n\tu32 recent_lz_offsets[LZMS_NUM_LZ_REPS + 1];\n\tu64 recent_delta_pairs[LZMS_NUM_DELTA_REPS + 1];\n\n\t/* Previous item type: 0 = literal, 1 = LZ match, 2 = delta match.\n\t * This is used to handle delayed updates of the LRU queues.  Instead of\n\t * actually delaying the updates, we can check when decoding each rep\n\t * match whether a delayed update needs to be taken into account, and if\n\t * so get the match source from slot 'rep_idx + 1' instead of from slot\n\t * 'rep_idx'.  */\n\tunsigned prev_item_type = 0;\n\n\t/* States and probability entries for item type disambiguation  */\n\tu32 main_state = 0;\n\tu32 match_state = 0;\n\tu32 lz_state = 0;\n\tu32 delta_state = 0;\n\tu32 lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS] = { 0 };\n\tu32 delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS] = { 0 };\n\n\t/*\n\t * Requirements on the compressed data:\n\t *\n\t * 1. LZMS-compressed data is a series of 16-bit integers, so the\n\t *    compressed data buffer cannot take up an odd number of bytes.\n\t * 2. There must be at least 4 bytes of compressed data, since otherwise\n\t *    we cannot even initialize the range decoder.\n\t */\n\tif ((in_nbytes & 1) || (in_nbytes < 4))\n\t\treturn -1;\n\n\tlzms_range_decoder_init(&rd, in, in_nbytes);\n\n\tlzms_input_bitstream_init(&is, in, in_nbytes);\n\n\tlzms_init_probabilities(&d->probs);\n\n\tlzms_init_huffman_codes(d, lzms_get_num_offset_slots(out_nbytes));\n\n\tfor (int i = 0; i < LZMS_NUM_LZ_REPS + 1; i++)\n\t\trecent_lz_offsets[i] = i + 1;\n\n\tfor (int i = 0; i < LZMS_NUM_DELTA_REPS + 1; i++)\n\t\trecent_delta_pairs[i] = i + 1;\n\n\t/* Main decode loop  */\n\twhile (out_next != out_end) {\n\n\t\tif (!lzms_decode_bit(&rd, &main_state,\n\t\t\t\t     LZMS_NUM_MAIN_PROBS, d->probs.main))\n\t\t{\n\t\t\t/* Literal  */\n\t\t\t*out_next++ = lzms_decode_literal(d, &is);\n\t\t\tprev_item_type = 0;\n\n\t\t} else if (!lzms_decode_bit(&rd, &match_state,\n\t\t\t\t\t    LZMS_NUM_MATCH_PROBS,\n\t\t\t\t\t    d->probs.match))\n\t\t{\n\t\t\t/* LZ match  */\n\n\t\t\tu32 offset;\n\t\t\tu32 length;\n\n\t\t\tSTATIC_ASSERT(LZMS_NUM_LZ_REPS == 3);\n\n\t\t\tif (!lzms_decode_bit(&rd, &lz_state,\n\t\t\t\t\t     LZMS_NUM_LZ_PROBS, d->probs.lz))\n\t\t\t{\n\t\t\t\t/* Explicit offset  */\n\t\t\t\toffset = lzms_decode_lz_offset(d, &is);\n\n\t\t\t\trecent_lz_offsets[3] = recent_lz_offsets[2];\n\t\t\t\trecent_lz_offsets[2] = recent_lz_offsets[1];\n\t\t\t\trecent_lz_offsets[1] = recent_lz_offsets[0];\n\t\t\t} else {\n\t\t\t\t/* Repeat offset  */\n\n\t\t\t\tif (!lzms_decode_bit(&rd, &lz_rep_states[0],\n\t\t\t\t\t\t     LZMS_NUM_LZ_REP_PROBS,\n\t\t\t\t\t\t     d->probs.lz_rep[0]))\n\t\t\t\t{\n\t\t\t\t\toffset = recent_lz_offsets[0 + (prev_item_type & 1)];\n\t\t\t\t\trecent_lz_offsets[0 + (prev_item_type & 1)] = recent_lz_offsets[0];\n\t\t\t\t} else if (!lzms_decode_bit(&rd, &lz_rep_states[1],\n\t\t\t\t\t\t\t    LZMS_NUM_LZ_REP_PROBS,\n\t\t\t\t\t\t\t    d->probs.lz_rep[1]))\n\t\t\t\t{\n\t\t\t\t\toffset = recent_lz_offsets[1 + (prev_item_type & 1)];\n\t\t\t\t\trecent_lz_offsets[1 + (prev_item_type & 1)] = recent_lz_offsets[1];\n\t\t\t\t\trecent_lz_offsets[1] = recent_lz_offsets[0];\n\t\t\t\t} else {\n\t\t\t\t\toffset = recent_lz_offsets[2 + (prev_item_type & 1)];\n\t\t\t\t\trecent_lz_offsets[2 + (prev_item_type & 1)] = recent_lz_offsets[2];\n\t\t\t\t\trecent_lz_offsets[2] = recent_lz_offsets[1];\n\t\t\t\t\trecent_lz_offsets[1] = recent_lz_offsets[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\trecent_lz_offsets[0] = offset;\n\t\t\tprev_item_type = 1;\n\n\t\t\tlength = lzms_decode_length(d, &is);\n\n\t\t\tif (unlikely(lz_copy(length, offset, out, out_next, out_end,\n\t\t\t\t\t     LZMS_MIN_MATCH_LENGTH)))\n\t\t\t\treturn -1;\n\n\t\t\tout_next += length;\n\t\t} else {\n\t\t\t/* Delta match  */\n\n\t\t\t/* (See beginning of file for more information.)  */\n\n\t\t\tu32 power;\n\t\t\tu32 raw_offset;\n\t\t\tu32 span;\n\t\t\tu32 offset;\n\t\t\tconst u8 *matchptr;\n\t\t\tu32 length;\n\t\t\tu64 pair;\n\n\t\t\tSTATIC_ASSERT(LZMS_NUM_DELTA_REPS == 3);\n\n\t\t\tif (!lzms_decode_bit(&rd, &delta_state,\n\t\t\t\t\t     LZMS_NUM_DELTA_PROBS,\n\t\t\t\t\t     d->probs.delta))\n\t\t\t{\n\t\t\t\t/* Explicit offset  */\n\t\t\t\tpower = lzms_decode_delta_power(d, &is);\n\t\t\t\traw_offset = lzms_decode_delta_offset(d, &is);\n\n\t\t\t\tpair = ((u64)power << 32) | raw_offset;\n\t\t\t\trecent_delta_pairs[3] = recent_delta_pairs[2];\n\t\t\t\trecent_delta_pairs[2] = recent_delta_pairs[1];\n\t\t\t\trecent_delta_pairs[1] = recent_delta_pairs[0];\n\t\t\t} else {\n\t\t\t\tif (!lzms_decode_bit(&rd, &delta_rep_states[0],\n\t\t\t\t\t\t     LZMS_NUM_DELTA_REP_PROBS,\n\t\t\t\t\t\t     d->probs.delta_rep[0]))\n\t\t\t\t{\n\t\t\t\t\tpair = recent_delta_pairs[0 + (prev_item_type >> 1)];\n\t\t\t\t\trecent_delta_pairs[0 + (prev_item_type >> 1)] = recent_delta_pairs[0];\n\t\t\t\t} else if (!lzms_decode_bit(&rd, &delta_rep_states[1],\n\t\t\t\t\t\t\t    LZMS_NUM_DELTA_REP_PROBS,\n\t\t\t\t\t\t\t    d->probs.delta_rep[1]))\n\t\t\t\t{\n\t\t\t\t\tpair = recent_delta_pairs[1 + (prev_item_type >> 1)];\n\t\t\t\t\trecent_delta_pairs[1 + (prev_item_type >> 1)] = recent_delta_pairs[1];\n\t\t\t\t\trecent_delta_pairs[1] = recent_delta_pairs[0];\n\t\t\t\t} else {\n\t\t\t\t\tpair = recent_delta_pairs[2 + (prev_item_type >> 1)];\n\t\t\t\t\trecent_delta_pairs[2 + (prev_item_type >> 1)] = recent_delta_pairs[2];\n\t\t\t\t\trecent_delta_pairs[2] = recent_delta_pairs[1];\n\t\t\t\t\trecent_delta_pairs[1] = recent_delta_pairs[0];\n\t\t\t\t}\n\n\t\t\t\tpower = pair >> 32;\n\t\t\t\traw_offset = (u32)pair;\n\t\t\t}\n\t\t\trecent_delta_pairs[0] = pair;\n\t\t\tprev_item_type = 2;\n\n\t\t\tlength = lzms_decode_length(d, &is);\n\n\t\t\tspan = (u32)1 << power;\n\t\t\toffset = raw_offset << power;\n\n\t\t\t/* raw_offset<<power overflows?  */\n\t\t\tif (unlikely(offset >> power != raw_offset))\n\t\t\t\treturn -1;\n\n\t\t\t/* offset+span overflows?  */\n\t\t\tif (unlikely(offset + span < offset))\n\t\t\t\treturn -1;\n\n\t\t\t/* buffer underrun?  */\n\t\t\tif (unlikely(offset + span > out_next - (u8 *)out))\n\t\t\t\treturn -1;\n\n\t\t\t/* buffer overrun?  */\n\t\t\tif (unlikely(length > out_end - out_next))\n\t\t\t\treturn -1;\n\n\t\t\tmatchptr = out_next - offset;\n\t\t\tdo {\n\t\t\t\t*out_next = *matchptr + *(out_next - span) -\n\t\t\t\t\t    *(matchptr - span);\n\t\t\t\tout_next++;\n\t\t\t\tmatchptr++;\n\t\t\t} while (--length);\n\t\t}\n\t}\n\n\tlzms_x86_filter(out, out_nbytes, d->last_target_usages, true);\n\treturn 0;\n}\n\nstatic void\nlzms_free_decompressor(void *_d)\n{\n\tstruct lzms_decompressor *d = _d;\n\n\tALIGNED_FREE(d);\n}\n\nconst struct decompressor_ops lzms_decompressor_ops = {\n\t.create_decompressor  = lzms_create_decompressor,\n\t.decompress\t      = lzms_decompress,\n\t.free_decompressor    = lzms_free_decompressor,\n};\n"
  },
  {
    "path": "src/wimlib/lzx_common.c",
    "content": "/*\n * lzx_common.c - Common code for LZX compression and decompression.\n */\n\n/*\n * Copyright (C) 2012-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <string.h>\n\n#ifdef __SSE2__\n#  include <emmintrin.h>\n#endif\n\n#ifdef __AVX2__\n#  include <immintrin.h>\n#endif\n\n#include \"wimlib/bitops.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/lzx_common.h\"\n#include \"wimlib/unaligned.h\"\n#include \"wimlib/util.h\"\n\n/* Mapping: offset slot => first match offset that uses that offset slot.\n * The offset slots for repeat offsets map to \"fake\" offsets < 1.  */\nconst s32 lzx_offset_slot_base[LZX_MAX_OFFSET_SLOTS + 1] = {\n        -2     , -1     , 0      , 1      , 2      ,    /* 0  --- 4  */\n        4      , 6      , 10     , 14     , 22     ,    /* 5  --- 9  */\n        30     , 46     , 62     , 94     , 126    ,    /* 10 --- 14 */\n        190    , 254    , 382    , 510    , 766    ,    /* 15 --- 19 */\n        1022   , 1534   , 2046   , 3070   , 4094   ,    /* 20 --- 24 */\n        6142   , 8190   , 12286  , 16382  , 24574  ,    /* 25 --- 29 */\n        32766  , 49150  , 65534  , 98302  , 131070 ,    /* 30 --- 34 */\n        196606 , 262142 , 393214 , 524286 , 655358 ,    /* 35 --- 39 */\n        786430 , 917502 , 1048574, 1179646, 1310718,    /* 40 --- 44 */\n        1441790, 1572862, 1703934, 1835006, 1966078,    /* 45 --- 49 */\n        2097150                                         /* extra     */\n};\n\n/* Mapping: offset slot => how many extra bits must be read and added to the\n * corresponding offset slot base to decode the match offset.  */\nconst u8 lzx_extra_offset_bits[LZX_MAX_OFFSET_SLOTS] = {\n\t0 , 0 , 0 , 0 , 1 ,\n\t1 , 2 , 2 , 3 , 3 ,\n\t4 , 4 , 5 , 5 , 6 ,\n\t6 , 7 , 7 , 8 , 8 ,\n\t9 , 9 , 10, 10, 11,\n\t11, 12, 12, 13, 13,\n\t14, 14, 15, 15, 16,\n\t16, 17, 17, 17, 17,\n\t17, 17, 17, 17, 17,\n\t17, 17, 17, 17, 17,\n};\n\n/* Round the specified buffer size up to the next valid LZX window size, and\n * return its order (log2).  Or, if the buffer size is 0 or greater than the\n * largest valid LZX window size, return 0.  */\nunsigned\nlzx_get_window_order(size_t max_bufsize)\n{\n\tif (max_bufsize == 0 || max_bufsize > LZX_MAX_WINDOW_SIZE)\n\t\treturn 0;\n\n\treturn max(ilog2_ceil(max_bufsize), LZX_MIN_WINDOW_ORDER);\n}\n\n/* Given a valid LZX window order, return the number of symbols that will exist\n * in the main Huffman code.  */\nunsigned\nlzx_get_num_main_syms(unsigned window_order)\n{\n\t/* Note: one would expect that the maximum match offset would be\n\t * 'window_size - LZX_MIN_MATCH_LEN', which would occur if the first two\n\t * bytes were to match the last two bytes.  However, the format\n\t * disallows this case.  This reduces the number of needed offset slots\n\t * by 1.  */\n\tu32 window_size = (u32)1 << window_order;\n\tu32 max_offset = window_size - LZX_MIN_MATCH_LEN - 1;\n\tunsigned num_offset_slots = 30;\n\twhile (max_offset >= lzx_offset_slot_base[num_offset_slots])\n\t\tnum_offset_slots++;\n\n\treturn LZX_NUM_CHARS + (num_offset_slots * LZX_NUM_LEN_HEADERS);\n}\n\nstatic void\ndo_translate_target(void *target, s32 input_pos)\n{\n\ts32 abs_offset, rel_offset;\n\n\trel_offset = get_unaligned_le32(target);\n\tif (rel_offset >= -input_pos && rel_offset < LZX_WIM_MAGIC_FILESIZE) {\n\t\tif (rel_offset < LZX_WIM_MAGIC_FILESIZE - input_pos) {\n\t\t\t/* \"good translation\" */\n\t\t\tabs_offset = rel_offset + input_pos;\n\t\t} else {\n\t\t\t/* \"compensating translation\" */\n\t\t\tabs_offset = rel_offset - LZX_WIM_MAGIC_FILESIZE;\n\t\t}\n\t\tput_unaligned_le32(abs_offset, target);\n\t}\n}\n\nstatic void\nundo_translate_target(void *target, s32 input_pos)\n{\n\ts32 abs_offset, rel_offset;\n\n\tabs_offset = get_unaligned_le32(target);\n\tif (abs_offset >= 0) {\n\t\tif (abs_offset < LZX_WIM_MAGIC_FILESIZE) {\n\t\t\t/* \"good translation\" */\n\t\t\trel_offset = abs_offset - input_pos;\n\t\t\tput_unaligned_le32(rel_offset, target);\n\t\t}\n\t} else {\n\t\tif (abs_offset >= -input_pos) {\n\t\t\t/* \"compensating translation\" */\n\t\t\trel_offset = abs_offset + LZX_WIM_MAGIC_FILESIZE;\n\t\t\tput_unaligned_le32(rel_offset, target);\n\t\t}\n\t}\n}\n\n/*\n * Do or undo the 'E8' preprocessing used in LZX.  Before compression, the\n * uncompressed data is preprocessed by changing the targets of x86 CALL\n * instructions from relative offsets to absolute offsets.  After decompression,\n * the translation is undone by changing the targets of x86 CALL instructions\n * from absolute offsets to relative offsets.\n *\n * Note that despite its intent, E8 preprocessing can be done on any data even\n * if it is not actually x86 machine code.  In fact, E8 preprocessing appears to\n * always be used in LZX-compressed resources in WIM files; there is no bit to\n * indicate whether it is used or not, unlike in the LZX compressed format as\n * used in cabinet files, where a bit is reserved for that purpose.\n *\n * E8 preprocessing is disabled in the last 6 bytes of the uncompressed data,\n * which really means the 5-byte call instruction cannot start in the last 10\n * bytes of the uncompressed data.  This is one of the errors in the LZX\n * documentation.\n *\n * E8 preprocessing does not appear to be disabled after the 32768th chunk of a\n * WIM resource, which apparently is another difference from the LZX compression\n * used in cabinet files.\n *\n * E8 processing is supposed to take the file size as a parameter, as it is used\n * in calculating the translated jump targets.  But in WIM files, this file size\n * is always the same (LZX_WIM_MAGIC_FILESIZE == 12000000).\n */\nstatic void\nlzx_e8_filter(u8 *data, u32 size, void (*process_target)(void *, s32))\n{\n\n#if !defined(__SSE2__) && !defined(__AVX2__)\n\t/*\n\t * A worthwhile optimization is to push the end-of-buffer check into the\n\t * relatively rare E8 case.  This is possible if we replace the last six\n\t * bytes of data with E8 bytes; then we are guaranteed to hit an E8 byte\n\t * before reaching end-of-buffer.  In addition, this scheme guarantees\n\t * that no translation can begin following an E8 byte in the last 10\n\t * bytes because a 4-byte offset containing E8 as its high byte is a\n\t * large negative number that is not valid for translation.  That is\n\t * exactly what we need.\n\t */\n\tu8 *tail;\n\tu8 saved_bytes[6];\n\tu8 *p;\n\n\tif (size <= 10)\n\t\treturn;\n\n\ttail = &data[size - 6];\n\tmemcpy(saved_bytes, tail, 6);\n\tmemset(tail, 0xE8, 6);\n\tp = data;\n\tfor (;;) {\n\t\twhile (*p != 0xE8)\n\t\t\tp++;\n\t\tif (p >= tail)\n\t\t\tbreak;\n\t\t(*process_target)(p + 1, p - data);\n\t\tp += 5;\n\t}\n\tmemcpy(tail, saved_bytes, 6);\n#else\n\t/* SSE2 or AVX-2 optimized version for x86_64  */\n\n\tu8 *p = data;\n\tu64 valid_mask = ~0;\n\n\tif (size <= 10)\n\t\treturn;\n#ifdef __AVX2__\n#  define ALIGNMENT_REQUIRED 32\n#else\n#  define ALIGNMENT_REQUIRED 16\n#endif\n\n\t/* Process one byte at a time until the pointer is properly aligned.  */\n\twhile ((uintptr_t)p % ALIGNMENT_REQUIRED != 0) {\n\t\tif (p >= data + size - 10)\n\t\t\treturn;\n\t\tif (*p == 0xE8 && (valid_mask & 1)) {\n\t\t\t(*process_target)(p + 1, p - data);\n\t\t\tvalid_mask &= ~0x1F;\n\t\t}\n\t\tp++;\n\t\tvalid_mask >>= 1;\n\t\tvalid_mask |= (u64)1 << 63;\n\t}\n\n\tif (data + size - p >= 64) {\n\n\t\t/* Vectorized processing  */\n\n\t\t/* Note: we use a \"trap\" E8 byte to eliminate the need to check\n\t\t * for end-of-buffer in the inner loop.  This byte is carefully\n\t\t * positioned so that it will never be changed by a previous\n\t\t * translation before it is detected.  */\n\n\t\tu8 *trap = p + ((data + size - p) & ~31) - 32 + 4;\n\t\tu8 saved_byte = *trap;\n\t\t*trap = 0xE8;\n\n\t\tfor (;;) {\n\t\t\tu32 e8_mask;\n\t\t\tu8 *orig_p = p;\n\t\t#ifdef __AVX2__\n\t\t\tconst __m256i e8_bytes = _mm256_set1_epi8(0xE8);\n\t\t\tfor (;;) {\n\t\t\t\t__m256i bytes = *(const __m256i *)p;\n\t\t\t\t__m256i cmpresult = _mm256_cmpeq_epi8(bytes, e8_bytes);\n\t\t\t\te8_mask = _mm256_movemask_epi8(cmpresult);\n\t\t\t\tif (e8_mask)\n\t\t\t\t\tbreak;\n\t\t\t\tp += 32;\n\t\t\t}\n\t\t#else\n\t\t\tconst __m128i e8_bytes = _mm_set1_epi8(0xE8);\n\t\t\tfor (;;) {\n\t\t\t\t/* Read the next 32 bytes of data and test them\n\t\t\t\t * for E8 bytes.  */\n\t\t\t\t__m128i bytes1 = *(const __m128i *)p;\n\t\t\t\t__m128i bytes2 = *(const __m128i *)(p + 16);\n\t\t\t\t__m128i cmpresult1 = _mm_cmpeq_epi8(bytes1, e8_bytes);\n\t\t\t\t__m128i cmpresult2 = _mm_cmpeq_epi8(bytes2, e8_bytes);\n\t\t\t\tu32 mask1 = _mm_movemask_epi8(cmpresult1);\n\t\t\t\tu32 mask2 = _mm_movemask_epi8(cmpresult2);\n\t\t\t\t/* The masks have a bit set for each E8 byte.\n\t\t\t\t * We stay in this fast inner loop as long as\n\t\t\t\t * there are no E8 bytes.  */\n\t\t\t\tif (mask1 | mask2) {\n\t\t\t\t\te8_mask = mask1 | (mask2 << 16);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tp += 32;\n\t\t\t}\n\t\t#endif\n\n\t\t\t/* Did we pass over data with no E8 bytes?  */\n\t\t\tif (p != orig_p)\n\t\t\t\tvalid_mask = ~0;\n\n\t\t\t/* Are we nearing end-of-buffer?  */\n\t\t\tif (p == trap - 4)\n\t\t\t\tbreak;\n\n\t\t\t/* Process the E8 bytes.  However, the AND with\n\t\t\t * 'valid_mask' ensures we never process an E8 byte that\n\t\t\t * was itself part of a translation target.  */\n\t\t\twhile ((e8_mask &= valid_mask)) {\n\t\t\t\tunsigned bit = bsf32(e8_mask);\n\t\t\t\t(*process_target)(p + bit + 1, p + bit - data);\n\t\t\t\tvalid_mask &= ~((u64)0x1F << bit);\n\t\t\t}\n\n\t\t\tvalid_mask >>= 32;\n\t\t\tvalid_mask |= 0xFFFFFFFF00000000;\n\t\t\tp += 32;\n\t\t}\n\n\t\t*trap = saved_byte;\n\t}\n\n\t/* Approaching the end of the buffer; process one byte a time.  */\n\twhile (p < data + size - 10) {\n\t\tif (*p == 0xE8 && (valid_mask & 1)) {\n\t\t\t(*process_target)(p + 1, p - data);\n\t\t\tvalid_mask &= ~0x1F;\n\t\t}\n\t\tp++;\n\t\tvalid_mask >>= 1;\n\t\tvalid_mask |= (u64)1 << 63;\n\t}\n#endif /* __SSE2__ || __AVX2__ */\n}\n\nvoid\nlzx_preprocess(u8 *data, u32 size)\n{\n\tlzx_e8_filter(data, size, do_translate_target);\n}\n\nvoid\nlzx_postprocess(u8 *data, u32 size)\n{\n\tlzx_e8_filter(data, size, undo_translate_target);\n}\n"
  },
  {
    "path": "src/wimlib/lzx_compress.c",
    "content": "/*\n * lzx_compress.c\n *\n * A compressor for the LZX compression format, as used in WIM archives.\n */\n\n/*\n * Copyright (C) 2012-2017 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n\n/*\n * This file contains a compressor for the LZX (\"Lempel-Ziv eXtended\")\n * compression format, as used in the WIM (Windows IMaging) file format.\n *\n * Two different LZX-compatible algorithms are implemented: \"near-optimal\" and\n * \"lazy\".  \"Near-optimal\" is significantly slower than \"lazy\", but results in a\n * better compression ratio.  The \"near-optimal\" algorithm is used at the\n * default compression level.\n *\n * This file may need some slight modifications to be used outside of the WIM\n * format.  In particular, in other situations the LZX block header might be\n * slightly different, and sliding window support might be required.\n *\n * LZX is a compression format derived from DEFLATE, the format used by zlib and\n * gzip.  Both LZX and DEFLATE use LZ77 matching and Huffman coding.  Certain\n * details are quite similar, such as the method for storing Huffman codes.\n * However, the main differences are:\n *\n * - LZX preprocesses the data to attempt to make x86 machine code slightly more\n *   compressible before attempting to compress it further.\n *\n * - LZX uses a \"main\" alphabet which combines literals and matches, with the\n *   match symbols containing a \"length header\" (giving all or part of the match\n *   length) and an \"offset slot\" (giving, roughly speaking, the order of\n *   magnitude of the match offset).\n *\n * - LZX does not have static Huffman blocks (that is, the kind with preset\n *   Huffman codes); however it does have two types of dynamic Huffman blocks\n *   (\"verbatim\" and \"aligned\").\n *\n * - LZX has a minimum match length of 2 rather than 3.  Length 2 matches can be\n *   useful, but generally only if the compressor is smart about choosing them.\n *\n * - In LZX, offset slots 0 through 2 actually represent entries in an LRU queue\n *   of match offsets.  This is very useful for certain types of files, such as\n *   binary files that have repeating records.\n */\n\n/******************************************************************************/\n/*                            General parameters                              */\n/*----------------------------------------------------------------------------*/\n\n/*\n * The compressor uses the faster algorithm at levels <= MAX_FAST_LEVEL.  It\n * uses the slower algorithm at levels > MAX_FAST_LEVEL.\n */\n#define MAX_FAST_LEVEL\t\t\t\t34\n\n/*\n * The compressor-side limits on the codeword lengths (in bits) for each Huffman\n * code.  To make outputting bits slightly faster, some of these limits are\n * lower than the limits defined by the LZX format.  This does not significantly\n * affect the compression ratio.\n */\n#define MAIN_CODEWORD_LIMIT\t\t\t16\n#define LENGTH_CODEWORD_LIMIT\t\t\t12\n#define ALIGNED_CODEWORD_LIMIT\t\t\t7\n#define PRE_CODEWORD_LIMIT\t\t\t7\n\n\n/******************************************************************************/\n/*                         Block splitting parameters                         */\n/*----------------------------------------------------------------------------*/\n\n/*\n * The compressor always outputs blocks of at least this size in bytes, except\n * for the last block which may need to be smaller.\n */\n#define MIN_BLOCK_SIZE\t\t\t\t6500\n\n/*\n * The compressor attempts to end a block when it reaches this size in bytes.\n * The final size might be slightly larger due to matches extending beyond the\n * end of the block.  Specifically:\n *\n *  - The near-optimal compressor may choose a match of up to LZX_MAX_MATCH_LEN\n *    bytes starting at position 'SOFT_MAX_BLOCK_SIZE - 1'.\n *\n *  - The lazy compressor may choose a sequence of literals starting at position\n *    'SOFT_MAX_BLOCK_SIZE - 1' when it sees a sequence of increasingly better\n *    matches.  The final match may be up to LZX_MAX_MATCH_LEN bytes.  The\n *    length of the literal sequence is approximately limited by the \"nice match\n *    length\" parameter.\n */\n#define SOFT_MAX_BLOCK_SIZE\t\t\t100000\n\n/*\n * The number of observed items (matches and literals) that represents\n * sufficient data for the compressor to decide whether the current block should\n * be ended or not.\n */\n#define NUM_OBSERVATIONS_PER_BLOCK_CHECK\t400\n\n\n/******************************************************************************/\n/*                      Parameters for slower algorithm                       */\n/*----------------------------------------------------------------------------*/\n\n/*\n * The log base 2 of the number of entries in the hash table for finding length\n * 2 matches.  This could be as high as 16, but using a smaller hash table\n * speeds up compression due to reduced cache pressure.\n */\n#define BT_MATCHFINDER_HASH2_ORDER\t\t12\n\n/*\n * The number of lz_match structures in the match cache, excluding the extra\n * \"overflow\" entries.  This value should be high enough so that nearly the\n * time, all matches found in a given block can fit in the match cache.\n * However, fallback behavior (immediately terminating the block) on cache\n * overflow is still required.\n */\n#define CACHE_LENGTH\t\t\t\t(SOFT_MAX_BLOCK_SIZE * 5)\n\n/*\n * An upper bound on the number of matches that can ever be saved in the match\n * cache for a single position.  Since each match we save for a single position\n * has a distinct length, we can use the number of possible match lengths in LZX\n * as this bound.  This bound is guaranteed to be valid in all cases, although\n * if 'nice_match_length < LZX_MAX_MATCH_LEN', then it will never actually be\n * reached.\n */\n#define MAX_MATCHES_PER_POS\t\t\tLZX_NUM_LENS\n\n/*\n * A scaling factor that makes it possible to consider fractional bit costs.  A\n * single bit has a cost of BIT_COST.\n *\n * Note: this is only useful as a statistical trick for when the true costs are\n * unknown.  Ultimately, each token in LZX requires a whole number of bits to\n * output.\n */\n#define BIT_COST\t\t\t\t64\n\n/*\n * Should the compressor take into account the costs of aligned offset symbols\n * instead of assuming that all are equally likely?\n */\n#define CONSIDER_ALIGNED_COSTS\t\t\t1\n\n/*\n * Should the \"minimum\" cost path search algorithm consider \"gap\" matches, where\n * a normal match is followed by a literal, then by a match with the same\n * offset?  This is one specific, somewhat common situation in which the true\n * minimum cost path is often different from the path found by looking only one\n * edge ahead.\n */\n#define CONSIDER_GAP_MATCHES\t\t\t1\n\n/******************************************************************************/\n/*                                  Includes                                  */\n/*----------------------------------------------------------------------------*/\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/compress_common.h\"\n#include \"wimlib/compressor_ops.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/lzx_common.h\"\n#include \"wimlib/unaligned.h\"\n#include \"wimlib/util.h\"\n\n/* Note: BT_MATCHFINDER_HASH2_ORDER must be defined before including\n * bt_matchfinder.h. */\n\n/* Matchfinders with 16-bit positions */\n#define mf_pos_t\tu16\n#define MF_SUFFIX\t_16\n#include \"wimlib/bt_matchfinder.h\"\n#include \"wimlib/hc_matchfinder.h\"\n\n/* Matchfinders with 32-bit positions */\n#undef mf_pos_t\n#undef MF_SUFFIX\n#define mf_pos_t\tu32\n#define MF_SUFFIX\t_32\n#include \"wimlib/bt_matchfinder.h\"\n#include \"wimlib/hc_matchfinder.h\"\n\n/******************************************************************************/\n/*                            Compressor structure                            */\n/*----------------------------------------------------------------------------*/\n\n/* Codewords for the Huffman codes */\nstruct lzx_codewords {\n\tu32 main[LZX_MAINCODE_MAX_NUM_SYMBOLS];\n\tu32 len[LZX_LENCODE_NUM_SYMBOLS];\n\tu32 aligned[LZX_ALIGNEDCODE_NUM_SYMBOLS];\n};\n\n/*\n * Codeword lengths, in bits, for the Huffman codes.\n *\n * A codeword length of 0 means the corresponding codeword has zero frequency.\n *\n * The main and length codes each have one extra entry for use as a sentinel.\n * See lzx_write_compressed_code().\n */\nstruct lzx_lens {\n\tu8 main[LZX_MAINCODE_MAX_NUM_SYMBOLS + 1];\n\tu8 len[LZX_LENCODE_NUM_SYMBOLS + 1];\n\tu8 aligned[LZX_ALIGNEDCODE_NUM_SYMBOLS];\n};\n\n/* Codewords and lengths for the Huffman codes */\nstruct lzx_codes {\n\tstruct lzx_codewords codewords;\n\tstruct lzx_lens lens;\n};\n\n/* Symbol frequency counters for the Huffman-encoded alphabets */\nstruct lzx_freqs {\n\tu32 main[LZX_MAINCODE_MAX_NUM_SYMBOLS];\n\tu32 len[LZX_LENCODE_NUM_SYMBOLS];\n\tu32 aligned[LZX_ALIGNEDCODE_NUM_SYMBOLS];\n};\n\n/* Block split statistics.  See the \"Block splitting algorithm\" section later in\n * this file for details. */\n#define NUM_LITERAL_OBSERVATION_TYPES 8\n#define NUM_MATCH_OBSERVATION_TYPES 2\n#define NUM_OBSERVATION_TYPES (NUM_LITERAL_OBSERVATION_TYPES + \\\n\t\t\t       NUM_MATCH_OBSERVATION_TYPES)\nstruct lzx_block_split_stats {\n\tu32 new_observations[NUM_OBSERVATION_TYPES];\n\tu32 observations[NUM_OBSERVATION_TYPES];\n\tu32 num_new_observations;\n\tu32 num_observations;\n};\n\n/*\n * Represents a run of literals followed by a match or end-of-block.  This\n * structure is needed to temporarily store items chosen by the compressor,\n * since items cannot be written until all items for the block have been chosen\n * and the block's Huffman codes have been computed.\n */\nPRAGMA_BEGIN_ALIGN(8)\nstruct lzx_sequence {\n\n\t/*\n\t * Bits 9..31: the number of literals in this run.  This may be 0 and\n\t * can be at most about SOFT_MAX_BLOCK_LENGTH.  The literals are not\n\t * stored explicitly in this structure; instead, they are read directly\n\t * from the uncompressed data.\n\t *\n\t * Bits 0..8: the length of the match which follows the literals, or 0\n\t * if this literal run was the last in the block, so there is no match\n\t * which follows it.  This can be at most LZX_MAX_MATCH_LEN.\n\t */\n\tu32 litrunlen_and_matchlen;\n#define SEQ_MATCHLEN_BITS\t9\n#define SEQ_MATCHLEN_MASK\t(((u32)1 << SEQ_MATCHLEN_BITS) - 1)\n\n\t/*\n\t * If 'matchlen' doesn't indicate end-of-block, then this contains:\n\t *\n\t * Bits 10..31: either the offset plus LZX_OFFSET_ADJUSTMENT or a recent\n\t * offset code, depending on the offset slot encoded in the main symbol.\n\t *\n\t * Bits 0..9: the main symbol.\n\t */\n\tu32 adjusted_offset_and_mainsym;\n#define SEQ_MAINSYM_BITS\t10\n#define SEQ_MAINSYM_MASK\t(((u32)1 << SEQ_MAINSYM_BITS) - 1)\n} PRAGMA_END_ALIGN(8);\n\n/*\n * This structure represents a byte position in the input buffer and a node in\n * the graph of possible match/literal choices.\n *\n * Logically, each incoming edge to this node is labeled with a literal or a\n * match that can be taken to reach this position from an earlier position; and\n * each outgoing edge from this node is labeled with a literal or a match that\n * can be taken to advance from this position to a later position.\n */\nPRAGMA_BEGIN_ALIGN(8)\nstruct lzx_optimum_node {\n\n\t/* The cost, in bits, of the lowest-cost path that has been found to\n\t * reach this position.  This can change as progressively lower cost\n\t * paths are found to reach this position.  */\n\tu32 cost;\n\n\t/*\n\t * The best arrival to this node, i.e. the match or literal that was\n\t * used to arrive to this position at the given 'cost'.  This can change\n\t * as progressively lower cost paths are found to reach this position.\n\t *\n\t * For non-gap matches, this variable is divided into two bitfields\n\t * whose meanings depend on the item type:\n\t *\n\t * Literals:\n\t *\tLow bits are 0, high bits are the literal.\n\t *\n\t * Explicit offset matches:\n\t *\tLow bits are the match length, high bits are the offset plus\n\t *\tLZX_OFFSET_ADJUSTMENT.\n\t *\n\t * Repeat offset matches:\n\t *\tLow bits are the match length, high bits are the queue index.\n\t *\n\t * For gap matches, identified by OPTIMUM_GAP_MATCH set, special\n\t * behavior applies --- see the code.\n\t */\n\tu32 item;\n#define OPTIMUM_OFFSET_SHIFT\tSEQ_MATCHLEN_BITS\n#define OPTIMUM_LEN_MASK\tSEQ_MATCHLEN_MASK\n#if CONSIDER_GAP_MATCHES\n#  define OPTIMUM_GAP_MATCH 0x80000000\n#endif\n\n} PRAGMA_END_ALIGN(8);\n\n/* The cost model for near-optimal parsing */\nstruct lzx_costs {\n\n\t/*\n\t * 'match_cost[offset_slot][len - LZX_MIN_MATCH_LEN]' is the cost of a\n\t * length 'len' match which has an offset belonging to 'offset_slot'.\n\t * The cost includes the main symbol, the length symbol if required, and\n\t * the extra offset bits if any, excluding any entropy-coded bits\n\t * (aligned offset bits).  It does *not* include the cost of the aligned\n\t * offset symbol which may be required.\n\t */\n\tu16 match_cost[LZX_MAX_OFFSET_SLOTS][LZX_NUM_LENS];\n\n\t/* Cost of each symbol in the main code */\n\tu32 main[LZX_MAINCODE_MAX_NUM_SYMBOLS];\n\n\t/* Cost of each symbol in the length code */\n\tu32 len[LZX_LENCODE_NUM_SYMBOLS];\n\n#if CONSIDER_ALIGNED_COSTS\n\t/* Cost of each symbol in the aligned offset code */\n\tu32 aligned[LZX_ALIGNEDCODE_NUM_SYMBOLS];\n#endif\n};\n\nstruct lzx_output_bitstream;\n\n/* The main LZX compressor structure */\nstruct lzx_compressor {\n\n\t/* The buffer for preprocessed input data, if not using destructive\n\t * compression */\n\tvoid *in_buffer;\n\n\t/* If true, then the compressor need not preserve the input buffer if it\n\t * compresses the data successfully */\n\tbool destructive;\n\n\t/* Pointer to the compress() implementation chosen at allocation time */\n\tvoid (*impl)(struct lzx_compressor *, const u8 *, size_t,\n\t\t     struct lzx_output_bitstream *);\n\n\t/* The log base 2 of the window size for match offset encoding purposes.\n\t * This will be >= LZX_MIN_WINDOW_ORDER and <= LZX_MAX_WINDOW_ORDER. */\n\tunsigned window_order;\n\n\t/* The number of symbols in the main alphabet.  This depends on the\n\t * window order, since the window order determines the maximum possible\n\t * match offset. */\n\tunsigned num_main_syms;\n\n\t/* The \"nice\" match length: if a match of this length is found, then it\n\t * is chosen immediately without further consideration. */\n\tunsigned nice_match_length;\n\n\t/* The maximum search depth: at most this many potential matches are\n\t * considered at each position. */\n\tunsigned max_search_depth;\n\n\t/* The number of optimization passes per block */\n\tunsigned num_optim_passes;\n\n\t/* The symbol frequency counters for the current block */\n\tstruct lzx_freqs freqs;\n\n\t/* Block split statistics for the current block */\n\tstruct lzx_block_split_stats split_stats;\n\n\t/* The Huffman codes for the current and previous blocks.  The one with\n\t * index 'codes_index' is for the current block, and the other one is\n\t * for the previous block. */\n\tstruct lzx_codes codes[2];\n\tunsigned codes_index;\n\n\t/* The matches and literals that the compressor has chosen for the\n\t * current block.  The required length of this array is limited by the\n\t * maximum number of matches that can ever be chosen for a single block,\n\t * plus one for the special entry at the end. */\n\tstruct lzx_sequence chosen_sequences[\n\t\t       DIV_ROUND_UP(SOFT_MAX_BLOCK_SIZE, LZX_MIN_MATCH_LEN) + 1];\n\n\t/* Tables for mapping adjusted offsets to offset slots */\n\tu8 offset_slot_tab_1[32768]; /* offset slots [0, 29] */\n\tu8 offset_slot_tab_2[128]; /* offset slots [30, 49] */\n\n\tunion {\n\t\t/* Data for lzx_compress_lazy() */\n\t\tstruct {\n\t\t\t/* Hash chains matchfinder (MUST BE LAST!!!) */\n\t\t\tunion {\n\t\t\t\tstruct hc_matchfinder_16 hc_mf_16;\n\t\t\t\tstruct hc_matchfinder_32 hc_mf_32;\n\t\t\t};\n\t\t};\n\n\t\t/* Data for lzx_compress_near_optimal() */\n\t\tstruct {\n\t\t\t/*\n\t\t\t * Array of nodes, one per position, for running the\n\t\t\t * minimum-cost path algorithm.\n\t\t\t *\n\t\t\t * This array must be large enough to accommodate the\n\t\t\t * worst-case number of nodes, which occurs if the\n\t\t\t * compressor finds a match of length LZX_MAX_MATCH_LEN\n\t\t\t * at position 'SOFT_MAX_BLOCK_SIZE - 1', producing a\n\t\t\t * block of size 'SOFT_MAX_BLOCK_SIZE - 1 +\n\t\t\t * LZX_MAX_MATCH_LEN'.  Add one for the end-of-block\n\t\t\t * node.\n\t\t\t */\n\t\t\tstruct lzx_optimum_node optimum_nodes[\n\t\t\t\t\t\t    SOFT_MAX_BLOCK_SIZE - 1 +\n\t\t\t\t\t\t    LZX_MAX_MATCH_LEN + 1];\n\n\t\t\t/* The cost model for the current optimization pass */\n\t\t\tstruct lzx_costs costs;\n\n\t\t\t/*\n\t\t\t * Cached matches for the current block.  This array\n\t\t\t * contains the matches that were found at each position\n\t\t\t * in the block.  Specifically, for each position, there\n\t\t\t * is a special 'struct lz_match' whose 'length' field\n\t\t\t * contains the number of matches that were found at\n\t\t\t * that position; this is followed by the matches\n\t\t\t * themselves, if any, sorted by strictly increasing\n\t\t\t * length.\n\t\t\t *\n\t\t\t * Note: in rare cases, there will be a very high number\n\t\t\t * of matches in the block and this array will overflow.\n\t\t\t * If this happens, we force the end of the current\n\t\t\t * block.  CACHE_LENGTH is the length at which we\n\t\t\t * actually check for overflow.  The extra slots beyond\n\t\t\t * this are enough to absorb the worst case overflow,\n\t\t\t * which occurs if starting at &match_cache[CACHE_LENGTH\n\t\t\t * - 1], we write the match count header, then write\n\t\t\t * MAX_MATCHES_PER_POS matches, then skip searching for\n\t\t\t * matches at 'LZX_MAX_MATCH_LEN - 1' positions and\n\t\t\t * write the match count header for each.\n\t\t\t */\n\t\t\tstruct lz_match match_cache[CACHE_LENGTH +\n\t\t\t\t\t\t    MAX_MATCHES_PER_POS +\n\t\t\t\t\t\t    LZX_MAX_MATCH_LEN - 1];\n\n\t\t\t/* Binary trees matchfinder (MUST BE LAST!!!) */\n\t\t\tunion {\n\t\t\t\tstruct bt_matchfinder_16 bt_mf_16;\n\t\t\t\tstruct bt_matchfinder_32 bt_mf_32;\n\t\t\t};\n\t\t};\n\t};\n};\n\n/******************************************************************************/\n/*                            Matchfinder utilities                           */\n/*----------------------------------------------------------------------------*/\n\n/*\n * Will a matchfinder using 16-bit positions be sufficient for compressing\n * buffers of up to the specified size?  The limit could be 65536 bytes, but we\n * also want to optimize out the use of offset_slot_tab_2 in the 16-bit case.\n * This requires that the limit be no more than the length of offset_slot_tab_1\n * (currently 32768).\n */\nstatic forceinline bool\nlzx_is_16_bit(size_t max_bufsize)\n{\n\tSTATIC_ASSERT(ARRAY_LEN(((struct lzx_compressor *)0)->offset_slot_tab_1) == 32768);\n\treturn max_bufsize <= 32768;\n}\n\n/*\n * Return the offset slot for the specified adjusted match offset.\n */\nstatic forceinline unsigned\nlzx_get_offset_slot(struct lzx_compressor *c, u32 adjusted_offset,\n\t\t    bool is_16_bit)\n{\n#ifndef _MSC_VER\n\tif (__builtin_constant_p(adjusted_offset) &&\n\t    adjusted_offset < LZX_NUM_RECENT_OFFSETS)\n\t\treturn adjusted_offset;\n#endif\n\tif (is_16_bit || adjusted_offset < ARRAY_LEN(c->offset_slot_tab_1))\n\t\treturn c->offset_slot_tab_1[adjusted_offset];\n\treturn c->offset_slot_tab_2[adjusted_offset >> 14];\n}\n\n/*\n * For a match that has the specified length and adjusted offset, tally its main\n * symbol, and if needed its length symbol; then return its main symbol.\n */\nstatic forceinline unsigned\nlzx_tally_main_and_lensyms(struct lzx_compressor *c, unsigned length,\n\t\t\t   u32 adjusted_offset, bool is_16_bit)\n{\n\tunsigned mainsym;\n\n\tif (length >= LZX_MIN_SECONDARY_LEN) {\n\t\t/* Length symbol needed */\n\t\tc->freqs.len[length - LZX_MIN_SECONDARY_LEN]++;\n\t\tmainsym = LZX_NUM_CHARS + LZX_NUM_PRIMARY_LENS;\n\t} else {\n\t\t/* No length symbol needed */\n\t\tmainsym = LZX_NUM_CHARS + length - LZX_MIN_MATCH_LEN;\n\t}\n\n\tmainsym += LZX_NUM_LEN_HEADERS *\n\t\t   lzx_get_offset_slot(c, adjusted_offset, is_16_bit);\n\tc->freqs.main[mainsym]++;\n\treturn mainsym;\n}\n\n/*\n * The following macros call either the 16-bit or the 32-bit version of a\n * matchfinder function based on the value of 'is_16_bit', which will be known\n * at compilation time.\n */\n\n#define CALL_HC_MF(is_16_bit, c, funcname, ...)\t\t\t\t      \\\n\t((is_16_bit) ? CONCAT(funcname, _16)(&(c)->hc_mf_16, ##__VA_ARGS__) : \\\n\t\t       CONCAT(funcname, _32)(&(c)->hc_mf_32, ##__VA_ARGS__));\n\n#define CALL_BT_MF(is_16_bit, c, funcname, ...)\t\t\t\t      \\\n\t((is_16_bit) ? CONCAT(funcname, _16)(&(c)->bt_mf_16, ##__VA_ARGS__) : \\\n\t\t       CONCAT(funcname, _32)(&(c)->bt_mf_32, ##__VA_ARGS__));\n\n/******************************************************************************/\n/*                             Output bitstream                               */\n/*----------------------------------------------------------------------------*/\n\n/*\n * The LZX bitstream is encoded as a sequence of little endian 16-bit coding\n * units.  Bits are ordered from most significant to least significant within\n * each coding unit.\n */\n\n/*\n * Structure to keep track of the current state of sending bits to the\n * compressed output buffer.\n */\nstruct lzx_output_bitstream {\n\n\t/* Bits that haven't yet been written to the output buffer */\n\tmachine_word_t bitbuf;\n\n\t/* Number of bits currently held in @bitbuf */\n\tmachine_word_t bitcount;\n\n\t/* Pointer to the start of the output buffer */\n\tu8 *start;\n\n\t/* Pointer to the position in the output buffer at which the next coding\n\t * unit should be written */\n\tu8 *next;\n\n\t/* Pointer to just past the end of the output buffer, rounded down by\n\t * one byte if needed to make 'end - start' a multiple of 2 */\n\tu8 *end;\n};\n\n/* Can the specified number of bits always be added to 'bitbuf' after all\n * pending 16-bit coding units have been flushed?  */\n#define CAN_BUFFER(n)\t((n) <= WORDBITS - 15)\n\n/* Initialize the output bitstream to write to the specified buffer. */\nstatic void\nlzx_init_output(struct lzx_output_bitstream *os, void *buffer, size_t size)\n{\n\tos->bitbuf = 0;\n\tos->bitcount = 0;\n\tos->start = buffer;\n\tos->next = buffer;\n\tos->end = (u8 *)buffer + (size & ~1);\n}\n\n/*\n * Add some bits to the bitbuffer variable of the output bitstream.  The caller\n * must make sure there is enough room.\n */\nstatic forceinline void\nlzx_add_bits(struct lzx_output_bitstream *os, u32 bits, unsigned num_bits)\n{\n\tos->bitbuf = (os->bitbuf << num_bits) | bits;\n\tos->bitcount += num_bits;\n}\n\n/*\n * Flush bits from the bitbuffer variable to the output buffer.  'max_num_bits'\n * specifies the maximum number of bits that may have been added since the last\n * flush.\n */\nstatic forceinline void\nlzx_flush_bits(struct lzx_output_bitstream *os, unsigned max_num_bits)\n{\n\t/* Masking the number of bits to shift is only needed to avoid undefined\n\t * behavior; we don't actually care about the results of bad shifts.  On\n\t * x86, the explicit masking generates no extra code.  */\n\tconst u32 shift_mask = WORDBITS - 1;\n\n\tif (os->end - os->next < 6)\n\t\treturn;\n\tput_unaligned_le16(os->bitbuf >> ((os->bitcount - 16) &\n\t\t\t\t\t    shift_mask), os->next + 0);\n\tif (max_num_bits > 16)\n\t\tput_unaligned_le16(os->bitbuf >> ((os->bitcount - 32) &\n\t\t\t\t\t\tshift_mask), os->next + 2);\n\tif (max_num_bits > 32)\n\t\tput_unaligned_le16(os->bitbuf >> ((os->bitcount - 48) &\n\t\t\t\t\t\tshift_mask), os->next + 4);\n\tos->next += (os->bitcount >> 4) << 1;\n\tos->bitcount &= 15;\n}\n\n/* Add at most 16 bits to the bitbuffer and flush it.  */\nstatic forceinline void\nlzx_write_bits(struct lzx_output_bitstream *os, u32 bits, unsigned num_bits)\n{\n\tlzx_add_bits(os, bits, num_bits);\n\tlzx_flush_bits(os, 16);\n}\n\n/*\n * Flush the last coding unit to the output buffer if needed.  Return the total\n * number of bytes written to the output buffer, or 0 if an overflow occurred.\n */\nstatic size_t\nlzx_flush_output(struct lzx_output_bitstream *os)\n{\n\tif (os->end - os->next < 6)\n\t\treturn 0;\n\n\tif (os->bitcount != 0) {\n\t\tput_unaligned_le16(os->bitbuf << (16 - os->bitcount), os->next);\n\t\tos->next += 2;\n\t}\n\n\treturn os->next - os->start;\n}\n\n/******************************************************************************/\n/*                           Preparing Huffman codes                          */\n/*----------------------------------------------------------------------------*/\n\n/*\n * Build the Huffman codes.  This takes as input the frequency tables for each\n * code and produces as output a set of tables that map symbols to codewords and\n * codeword lengths.\n */\nstatic void\nlzx_build_huffman_codes(struct lzx_compressor *c)\n{\n\tconst struct lzx_freqs *freqs = &c->freqs;\n\tstruct lzx_codes *codes = &c->codes[c->codes_index];\n\n\tSTATIC_ASSERT(MAIN_CODEWORD_LIMIT >= 9 &&\n\t\t      MAIN_CODEWORD_LIMIT <= LZX_MAX_MAIN_CODEWORD_LEN);\n\tmake_canonical_huffman_code(c->num_main_syms,\n\t\t\t\t    MAIN_CODEWORD_LIMIT,\n\t\t\t\t    freqs->main,\n\t\t\t\t    codes->lens.main,\n\t\t\t\t    codes->codewords.main);\n\n\tSTATIC_ASSERT(LENGTH_CODEWORD_LIMIT >= 8 &&\n\t\t      LENGTH_CODEWORD_LIMIT <= LZX_MAX_LEN_CODEWORD_LEN);\n\tmake_canonical_huffman_code(LZX_LENCODE_NUM_SYMBOLS,\n\t\t\t\t    LENGTH_CODEWORD_LIMIT,\n\t\t\t\t    freqs->len,\n\t\t\t\t    codes->lens.len,\n\t\t\t\t    codes->codewords.len);\n\n\tSTATIC_ASSERT(ALIGNED_CODEWORD_LIMIT >= LZX_NUM_ALIGNED_OFFSET_BITS &&\n\t\t      ALIGNED_CODEWORD_LIMIT <= LZX_MAX_ALIGNED_CODEWORD_LEN);\n\tmake_canonical_huffman_code(LZX_ALIGNEDCODE_NUM_SYMBOLS,\n\t\t\t\t    ALIGNED_CODEWORD_LIMIT,\n\t\t\t\t    freqs->aligned,\n\t\t\t\t    codes->lens.aligned,\n\t\t\t\t    codes->codewords.aligned);\n}\n\n/* Reset the symbol frequencies for the current block. */\nstatic void\nlzx_reset_symbol_frequencies(struct lzx_compressor *c)\n{\n\tmemset(&c->freqs, 0, sizeof(c->freqs));\n}\n\nstatic unsigned\nlzx_compute_precode_items(const u8* restrict lens,\n\t\t\t  const u8* restrict prev_lens,\n\t\t\t  u32* restrict precode_freqs,\n\t\t\t  unsigned* restrict precode_items)\n{\n\tunsigned *itemptr;\n\tunsigned run_start;\n\tunsigned run_end;\n\tunsigned extra_bits;\n\tint delta;\n\tu8 len;\n\n\titemptr = precode_items;\n\trun_start = 0;\n\n\twhile (!((len = lens[run_start]) & 0x80)) {\n\n\t\t/* len = the length being repeated  */\n\n\t\t/* Find the next run of codeword lengths.  */\n\n\t\trun_end = run_start + 1;\n\n\t\t/* Fast case for a single length.  */\n\t\tif (likely(len != lens[run_end])) {\n\t\t\tdelta = prev_lens[run_start] - len;\n\t\t\tif (delta < 0)\n\t\t\t\tdelta += 17;\n\t\t\tprecode_freqs[delta]++;\n\t\t\t*itemptr++ = delta;\n\t\t\trun_start++;\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* Extend the run.  */\n\t\tdo {\n\t\t\trun_end++;\n\t\t} while (len == lens[run_end]);\n\n\t\tif (len == 0) {\n\t\t\t/* Run of zeroes.  */\n\n\t\t\t/* Symbol 18: RLE 20 to 51 zeroes at a time.  */\n\t\t\twhile ((run_end - run_start) >= 20) {\n\t\t\t\textra_bits = min((run_end - run_start) - 20, 0x1F);\n\t\t\t\tprecode_freqs[18]++;\n\t\t\t\t*itemptr++ = 18 | (extra_bits << 5);\n\t\t\t\trun_start += 20 + extra_bits;\n\t\t\t}\n\n\t\t\t/* Symbol 17: RLE 4 to 19 zeroes at a time.  */\n\t\t\tif ((run_end - run_start) >= 4) {\n\t\t\t\textra_bits = min((run_end - run_start) - 4, 0xF);\n\t\t\t\tprecode_freqs[17]++;\n\t\t\t\t*itemptr++ = 17 | (extra_bits << 5);\n\t\t\t\trun_start += 4 + extra_bits;\n\t\t\t}\n\t\t} else {\n\n\t\t\t/* A run of nonzero lengths. */\n\n\t\t\t/* Symbol 19: RLE 4 to 5 of any length at a time.  */\n\t\t\twhile ((run_end - run_start) >= 4) {\n\t\t\t\textra_bits = (run_end - run_start) > 4;\n\t\t\t\tdelta = prev_lens[run_start] - len;\n\t\t\t\tif (delta < 0)\n\t\t\t\t\tdelta += 17;\n\t\t\t\tprecode_freqs[19]++;\n\t\t\t\tprecode_freqs[delta]++;\n\t\t\t\t*itemptr++ = 19 | (extra_bits << 5) | (delta << 6);\n\t\t\t\trun_start += 4 + extra_bits;\n\t\t\t}\n\t\t}\n\n\t\t/* Output any remaining lengths without RLE.  */\n\t\twhile (run_start != run_end) {\n\t\t\tdelta = prev_lens[run_start] - len;\n\t\t\tif (delta < 0)\n\t\t\t\tdelta += 17;\n\t\t\tprecode_freqs[delta]++;\n\t\t\t*itemptr++ = delta;\n\t\t\trun_start++;\n\t\t}\n\t}\n\n\treturn itemptr - precode_items;\n}\n\n/******************************************************************************/\n/*                          Outputting compressed data                        */\n/*----------------------------------------------------------------------------*/\n\n/*\n * Output a Huffman code in the compressed form used in LZX.\n *\n * The Huffman code is represented in the output as a logical series of codeword\n * lengths from which the Huffman code, which must be in canonical form, can be\n * reconstructed.\n *\n * The codeword lengths are themselves compressed using a separate Huffman code,\n * the \"precode\", which contains a symbol for each possible codeword length in\n * the larger code as well as several special symbols to represent repeated\n * codeword lengths (a form of run-length encoding).  The precode is itself\n * constructed in canonical form, and its codeword lengths are represented\n * literally in 20 4-bit fields that immediately precede the compressed codeword\n * lengths of the larger code.\n *\n * Furthermore, the codeword lengths of the larger code are actually represented\n * as deltas from the codeword lengths of the corresponding code in the previous\n * block.\n *\n * @os:\n *\tBitstream to which to write the compressed Huffman code.\n * @lens:\n *\tThe codeword lengths, indexed by symbol, in the Huffman code.\n * @prev_lens:\n *\tThe codeword lengths, indexed by symbol, in the corresponding Huffman\n *\tcode in the previous block, or all zeroes if this is the first block.\n * @num_lens:\n *\tThe number of symbols in the Huffman code.\n */\nstatic void\nlzx_write_compressed_code(struct lzx_output_bitstream *os,\n\t\t\t  const u8* restrict lens,\n\t\t\t  const u8* restrict prev_lens,\n\t\t\t  unsigned num_lens)\n{\n\tu32 precode_freqs[LZX_PRECODE_NUM_SYMBOLS];\n\tu8 precode_lens[LZX_PRECODE_NUM_SYMBOLS] = { 0 };\n\tu32 precode_codewords[LZX_PRECODE_NUM_SYMBOLS] = { 0 };\n\tunsigned* precode_items = alloca(num_lens * sizeof(unsigned));\n\tunsigned num_precode_items;\n\tunsigned precode_item;\n\tunsigned precode_sym;\n\tunsigned i;\n\tu8 saved = lens[num_lens];\n\t*(u8 *)(lens + num_lens) = 0x80;\n\n\tfor (i = 0; i < LZX_PRECODE_NUM_SYMBOLS; i++)\n\t\tprecode_freqs[i] = 0;\n\n\t/* Compute the \"items\" (RLE / literal tokens and extra bits) with which\n\t * the codeword lengths in the larger code will be output.  */\n\tnum_precode_items = lzx_compute_precode_items(lens,\n\t\t\t\t\t\t      prev_lens,\n\t\t\t\t\t\t      precode_freqs,\n\t\t\t\t\t\t      precode_items);\n\n\t/* Build the precode.  */\n\tSTATIC_ASSERT(PRE_CODEWORD_LIMIT >= 5 &&\n\t\t      PRE_CODEWORD_LIMIT <= LZX_MAX_PRE_CODEWORD_LEN);\n\tmake_canonical_huffman_code(LZX_PRECODE_NUM_SYMBOLS, PRE_CODEWORD_LIMIT,\n\t\t\t\t    precode_freqs, precode_lens,\n\t\t\t\t    precode_codewords);\n\n\t/* Output the lengths of the codewords in the precode.  */\n\tfor (i = 0; i < LZX_PRECODE_NUM_SYMBOLS; i++)\n\t\tlzx_write_bits(os, precode_lens[i], LZX_PRECODE_ELEMENT_SIZE);\n\n\t/* Output the encoded lengths of the codewords in the larger code.  */\n\tfor (i = 0; i < num_precode_items; i++) {\n\t\tprecode_item = precode_items[i];\n\t\tprecode_sym = precode_item & 0x1F;\n\t\tlzx_add_bits(os, precode_codewords[precode_sym],\n\t\t\t     precode_lens[precode_sym]);\n\t\tif (precode_sym >= 17) {\n\t\t\tif (precode_sym == 17) {\n\t\t\t\tlzx_add_bits(os, precode_item >> 5, 4);\n\t\t\t} else if (precode_sym == 18) {\n\t\t\t\tlzx_add_bits(os, precode_item >> 5, 5);\n\t\t\t} else {\n\t\t\t\tlzx_add_bits(os, (precode_item >> 5) & 1, 1);\n\t\t\t\tprecode_sym = precode_item >> 6;\n\t\t\t\tlzx_add_bits(os, precode_codewords[precode_sym],\n\t\t\t\t\t     precode_lens[precode_sym]);\n\t\t\t}\n\t\t}\n\t\tSTATIC_ASSERT(CAN_BUFFER(2 * PRE_CODEWORD_LIMIT + 1));\n\t\tlzx_flush_bits(os, 2 * PRE_CODEWORD_LIMIT + 1);\n\t}\n\n\t*(u8 *)(lens + num_lens) = saved;\n}\n\n/*\n * Write all matches and literal bytes (which were precomputed) in an LZX\n * compressed block to the output bitstream in the final compressed\n * representation.\n *\n * @os\n *\tThe output bitstream.\n * @block_type\n *\tThe chosen type of the LZX compressed block (LZX_BLOCKTYPE_ALIGNED or\n *\tLZX_BLOCKTYPE_VERBATIM).\n * @block_data\n *\tThe uncompressed data of the block.\n * @sequences\n *\tThe matches and literals to output, given as a series of sequences.\n * @codes\n *\tThe main, length, and aligned offset Huffman codes for the block.\n */\nstatic void\nlzx_write_sequences(struct lzx_output_bitstream *os, int block_type,\n\t\t    const u8 *block_data, const struct lzx_sequence sequences[],\n\t\t    const struct lzx_codes *codes)\n{\n\tconst struct lzx_sequence *seq = sequences;\n\tunsigned min_aligned_offset_slot;\n\n\tif (block_type == LZX_BLOCKTYPE_ALIGNED)\n\t\tmin_aligned_offset_slot = LZX_MIN_ALIGNED_OFFSET_SLOT;\n\telse\n\t\tmin_aligned_offset_slot = LZX_MAX_OFFSET_SLOTS;\n\n\tfor (;;) {\n\t\t/* Output the next sequence.  */\n\n\t\tu32 litrunlen = seq->litrunlen_and_matchlen >> SEQ_MATCHLEN_BITS;\n\t\tunsigned matchlen = seq->litrunlen_and_matchlen & SEQ_MATCHLEN_MASK;\n\t\tSTATIC_ASSERT((u32)~SEQ_MATCHLEN_MASK >> SEQ_MATCHLEN_BITS >=\n\t\t\t      SOFT_MAX_BLOCK_SIZE);\n\t\tu32 adjusted_offset;\n\t\tunsigned main_symbol;\n\t\tunsigned offset_slot;\n\t\tunsigned num_extra_bits;\n\t\tu32 extra_bits;\n\n\t\t/* Output the literal run of the sequence.  */\n\n\t\tif (litrunlen) {  /* Is the literal run nonempty?  */\n\n\t\t\t/* Verify optimization is enabled on 64-bit  */\n\t\t\tSTATIC_ASSERT(WORDBITS < 64 ||\n\t\t\t\t      CAN_BUFFER(3 * MAIN_CODEWORD_LIMIT));\n\n\t\t\tif (CAN_BUFFER(3 * MAIN_CODEWORD_LIMIT)) {\n\n\t\t\t\t/* 64-bit: write 3 literals at a time.  */\n\t\t\t\twhile (litrunlen >= 3) {\n\t\t\t\t\tunsigned lit0 = block_data[0];\n\t\t\t\t\tunsigned lit1 = block_data[1];\n\t\t\t\t\tunsigned lit2 = block_data[2];\n\t\t\t\t\tlzx_add_bits(os, codes->codewords.main[lit0],\n\t\t\t\t\t\t     codes->lens.main[lit0]);\n\t\t\t\t\tlzx_add_bits(os, codes->codewords.main[lit1],\n\t\t\t\t\t\t     codes->lens.main[lit1]);\n\t\t\t\t\tlzx_add_bits(os, codes->codewords.main[lit2],\n\t\t\t\t\t\t     codes->lens.main[lit2]);\n\t\t\t\t\tlzx_flush_bits(os, 3 * MAIN_CODEWORD_LIMIT);\n\t\t\t\t\tblock_data += 3;\n\t\t\t\t\tlitrunlen -= 3;\n\t\t\t\t}\n\t\t\t\tif (litrunlen--) {\n\t\t\t\t\tunsigned lit = *block_data++;\n\t\t\t\t\tlzx_add_bits(os, codes->codewords.main[lit],\n\t\t\t\t\t\t     codes->lens.main[lit]);\n\t\t\t\t\tif (litrunlen--) {\n\t\t\t\t\t\tunsigned lit = *block_data++;\n\t\t\t\t\t\tlzx_add_bits(os, codes->codewords.main[lit],\n\t\t\t\t\t\t\t     codes->lens.main[lit]);\n\t\t\t\t\t\tlzx_flush_bits(os, 2 * MAIN_CODEWORD_LIMIT);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlzx_flush_bits(os, 1 * MAIN_CODEWORD_LIMIT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t/* 32-bit: write 1 literal at a time.  */\n\t\t\t\tdo {\n\t\t\t\t\tunsigned lit = *block_data++;\n\t\t\t\t\tlzx_add_bits(os, codes->codewords.main[lit],\n\t\t\t\t\t\t     codes->lens.main[lit]);\n\t\t\t\t\tlzx_flush_bits(os, MAIN_CODEWORD_LIMIT);\n\t\t\t\t} while (--litrunlen);\n\t\t\t}\n\t\t}\n\n\t\t/* Was this the last literal run?  */\n\t\tif (matchlen == 0)\n\t\t\treturn;\n\n\t\t/* Nope; output the match.  */\n\n\t\tblock_data += matchlen;\n\n\t\tadjusted_offset = seq->adjusted_offset_and_mainsym >> SEQ_MAINSYM_BITS;\n\t\tmain_symbol = seq->adjusted_offset_and_mainsym & SEQ_MAINSYM_MASK;\n\n\t\toffset_slot = (main_symbol - LZX_NUM_CHARS) / LZX_NUM_LEN_HEADERS;\n\t\tif (offset_slot >= LZX_MAX_OFFSET_SLOTS)\n\t\t\treturn;\n\t\tnum_extra_bits = lzx_extra_offset_bits[offset_slot];\n\t\textra_bits = adjusted_offset - (lzx_offset_slot_base[offset_slot] +\n\t\t\t\t\t\tLZX_OFFSET_ADJUSTMENT);\n\n\t#define MAX_MATCH_BITS (MAIN_CODEWORD_LIMIT +\t\t\\\n\t\t\t\tLENGTH_CODEWORD_LIMIT +\t\t\\\n\t\t\t\tLZX_MAX_NUM_EXTRA_BITS -\t\\\n\t\t\t\tLZX_NUM_ALIGNED_OFFSET_BITS +\t\\\n\t\t\t\tALIGNED_CODEWORD_LIMIT)\n\n\t\t/* Verify optimization is enabled on 64-bit  */\n\t\tSTATIC_ASSERT(WORDBITS < 64 || CAN_BUFFER(MAX_MATCH_BITS));\n\n\t\t/* Output the main symbol for the match.  */\n\t\tif (main_symbol >= LZX_MAINCODE_MAX_NUM_SYMBOLS)\n\t\t\treturn;\n\t\tlzx_add_bits(os, codes->codewords.main[main_symbol],\n\t\t\t     codes->lens.main[main_symbol]);\n\t\tif (!CAN_BUFFER(MAX_MATCH_BITS))\n\t\t\tlzx_flush_bits(os, MAIN_CODEWORD_LIMIT);\n\n\t\t/* If needed, output the length symbol for the match.  */\n\n\t\tif (matchlen >= LZX_MIN_SECONDARY_LEN &&\n\t\t\tmatchlen < LZX_MIN_SECONDARY_LEN + LZX_LENCODE_NUM_SYMBOLS) {\n\t\t\tlzx_add_bits(os, codes->codewords.len[matchlen -\n\t\t\t\t\t\t\t      LZX_MIN_SECONDARY_LEN],\n\t\t\t\t     codes->lens.len[matchlen -\n\t\t\t\t\t\t     LZX_MIN_SECONDARY_LEN]);\n\t\t\tif (!CAN_BUFFER(MAX_MATCH_BITS))\n\t\t\t\tlzx_flush_bits(os, LENGTH_CODEWORD_LIMIT);\n\t\t}\n\n\t\t/* Output the extra offset bits for the match.  In aligned\n\t\t * offset blocks, the lowest 3 bits of the adjusted offset are\n\t\t * Huffman-encoded using the aligned offset code, provided that\n\t\t * there are at least extra 3 offset bits required.  All other\n\t\t * extra offset bits are output verbatim.  */\n\n\t\tif (offset_slot >= min_aligned_offset_slot) {\n\n\t\t\tlzx_add_bits(os, extra_bits >> LZX_NUM_ALIGNED_OFFSET_BITS,\n\t\t\t\t     num_extra_bits - LZX_NUM_ALIGNED_OFFSET_BITS);\n\t\t\tif (!CAN_BUFFER(MAX_MATCH_BITS))\n\t\t\t\tlzx_flush_bits(os, LZX_MAX_NUM_EXTRA_BITS -\n\t\t\t\t\t\t   LZX_NUM_ALIGNED_OFFSET_BITS);\n\n\t\t\tlzx_add_bits(os, codes->codewords.aligned[adjusted_offset &\n\t\t\t\t\t\t\t\t  LZX_ALIGNED_OFFSET_BITMASK],\n\t\t\t\t     codes->lens.aligned[adjusted_offset &\n\t\t\t\t\t\t\t LZX_ALIGNED_OFFSET_BITMASK]);\n\t\t\tif (!CAN_BUFFER(MAX_MATCH_BITS))\n\t\t\t\tlzx_flush_bits(os, ALIGNED_CODEWORD_LIMIT);\n\t\t} else {\n\t\t\tSTATIC_ASSERT(CAN_BUFFER(LZX_MAX_NUM_EXTRA_BITS));\n\n\t\t\tlzx_add_bits(os, extra_bits, num_extra_bits);\n\t\t\tif (!CAN_BUFFER(MAX_MATCH_BITS))\n\t\t\t\tlzx_flush_bits(os, LZX_MAX_NUM_EXTRA_BITS);\n\t\t}\n\n\t\tif (CAN_BUFFER(MAX_MATCH_BITS))\n\t\t\tlzx_flush_bits(os, MAX_MATCH_BITS);\n\n\t\t/* Advance to the next sequence.  */\n\t\tseq++;\n\t}\n}\n\nstatic void\nlzx_write_compressed_block(const u8 *block_begin,\n\t\t\t   int block_type,\n\t\t\t   u32 block_size,\n\t\t\t   unsigned window_order,\n\t\t\t   unsigned num_main_syms,\n\t\t\t   const struct lzx_sequence sequences[],\n\t\t\t   const struct lzx_codes * codes,\n\t\t\t   const struct lzx_lens * prev_lens,\n\t\t\t   struct lzx_output_bitstream * os)\n{\n\t/* The first three bits indicate the type of block and are one of the\n\t * LZX_BLOCKTYPE_* constants.  */\n\tlzx_write_bits(os, block_type, 3);\n\n\t/*\n\t * Output the block size.\n\t *\n\t * The original LZX format encoded the block size in 24 bits.  However,\n\t * the LZX format used in WIM archives uses 1 bit to specify whether the\n\t * block has the default size of 32768 bytes, then optionally 16 bits to\n\t * specify a non-default size.  This works fine for Microsoft's WIM\n\t * software (WIMGAPI), which never compresses more than 32768 bytes at a\n\t * time with LZX.  However, as an extension, our LZX compressor supports\n\t * compressing up to 2097152 bytes, with a corresponding increase in\n\t * window size.  It is possible for blocks in these larger buffers to\n\t * exceed 65535 bytes; such blocks cannot have their size represented in\n\t * 16 bits.\n\t *\n\t * The chosen solution was to use 24 bits for the block size when\n\t * possibly required --- specifically, when the compressor has been\n\t * allocated to be capable of compressing more than 32768 bytes at once\n\t * (which also causes the number of main symbols to be increased).\n\t */\n\tif (block_size == LZX_DEFAULT_BLOCK_SIZE) {\n\t\tlzx_write_bits(os, 1, 1);\n\t} else {\n\t\tlzx_write_bits(os, 0, 1);\n\n\t\tif (window_order >= 16)\n\t\t\tlzx_write_bits(os, block_size >> 16, 8);\n\n\t\tlzx_write_bits(os, block_size & 0xFFFF, 16);\n\t}\n\n\t/* If it's an aligned offset block, output the aligned offset code.  */\n\tif (block_type == LZX_BLOCKTYPE_ALIGNED) {\n\t\tfor (int i = 0; i < LZX_ALIGNEDCODE_NUM_SYMBOLS; i++) {\n\t\t\tlzx_write_bits(os, codes->lens.aligned[i],\n\t\t\t\t       LZX_ALIGNEDCODE_ELEMENT_SIZE);\n\t\t}\n\t}\n\n\t/* Output the main code (two parts).  */\n\tlzx_write_compressed_code(os, codes->lens.main,\n\t\t\t\t  prev_lens->main,\n\t\t\t\t  LZX_NUM_CHARS);\n\tlzx_write_compressed_code(os, codes->lens.main + LZX_NUM_CHARS,\n\t\t\t\t  prev_lens->main + LZX_NUM_CHARS,\n\t\t\t\t  num_main_syms - LZX_NUM_CHARS);\n\n\t/* Output the length code.  */\n\tlzx_write_compressed_code(os, codes->lens.len,\n\t\t\t\t  prev_lens->len,\n\t\t\t\t  LZX_LENCODE_NUM_SYMBOLS);\n\n\t/* Output the compressed matches and literals.  */\n\tlzx_write_sequences(os, block_type, block_begin, sequences, codes);\n}\n\n/*\n * Given the frequencies of symbols in an LZX-compressed block and the\n * corresponding Huffman codes, return LZX_BLOCKTYPE_ALIGNED or\n * LZX_BLOCKTYPE_VERBATIM if an aligned offset or verbatim block, respectively,\n * will take fewer bits to output.\n */\nstatic int\nlzx_choose_verbatim_or_aligned(const struct lzx_freqs * freqs,\n\t\t\t       const struct lzx_codes * codes)\n{\n\tu32 verbatim_cost = 0;\n\tu32 aligned_cost = 0;\n\n\t/* A verbatim block requires 3 bits in each place that an aligned offset\n\t * symbol would be used in an aligned offset block.  */\n\tfor (unsigned i = 0; i < LZX_ALIGNEDCODE_NUM_SYMBOLS; i++) {\n\t\tverbatim_cost += LZX_NUM_ALIGNED_OFFSET_BITS * freqs->aligned[i];\n\t\taligned_cost += codes->lens.aligned[i] * freqs->aligned[i];\n\t}\n\n\t/* Account for the cost of sending the codeword lengths of the aligned\n\t * offset code.  */\n\taligned_cost += LZX_ALIGNEDCODE_ELEMENT_SIZE *\n\t\t\tLZX_ALIGNEDCODE_NUM_SYMBOLS;\n\n\tif (aligned_cost < verbatim_cost)\n\t\treturn LZX_BLOCKTYPE_ALIGNED;\n\telse\n\t\treturn LZX_BLOCKTYPE_VERBATIM;\n}\n\n/*\n * Flush an LZX block:\n *\n * 1. Build the Huffman codes.\n * 2. Decide whether to output the block as VERBATIM or ALIGNED.\n * 3. Write the block.\n * 4. Swap the indices of the current and previous Huffman codes.\n *\n * Note: we never output UNCOMPRESSED blocks.  This probably should be\n * implemented sometime, but it doesn't make much difference.\n */\nstatic void\nlzx_flush_block(struct lzx_compressor *c, struct lzx_output_bitstream *os,\n\t\tconst u8 *block_begin, u32 block_size, u32 seq_idx)\n{\n\tint block_type;\n\n\tlzx_build_huffman_codes(c);\n\n\tblock_type = lzx_choose_verbatim_or_aligned(&c->freqs,\n\t\t\t\t\t\t    &c->codes[c->codes_index]);\n\tlzx_write_compressed_block(block_begin,\n\t\t\t\t   block_type,\n\t\t\t\t   block_size,\n\t\t\t\t   c->window_order,\n\t\t\t\t   c->num_main_syms,\n\t\t\t\t   &c->chosen_sequences[seq_idx],\n\t\t\t\t   &c->codes[c->codes_index],\n\t\t\t\t   &c->codes[c->codes_index ^ 1].lens,\n\t\t\t\t   os);\n\tc->codes_index ^= 1;\n}\n\n/******************************************************************************/\n/*                          Block splitting algorithm                         */\n/*----------------------------------------------------------------------------*/\n\n/*\n * The problem of block splitting is to decide when it is worthwhile to start a\n * new block with new entropy codes.  There is a theoretically optimal solution:\n * recursively consider every possible block split, considering the exact cost\n * of each block, and choose the minimum cost approach.  But this is far too\n * slow.  Instead, as an approximation, we can count symbols and after every N\n * symbols, compare the expected distribution of symbols based on the previous\n * data with the actual distribution.  If they differ \"by enough\", then start a\n * new block.\n *\n * As an optimization and heuristic, we don't distinguish between every symbol\n * but rather we combine many symbols into a single \"observation type\".  For\n * literals we only look at the high bits and low bits, and for matches we only\n * look at whether the match is long or not.  The assumption is that for typical\n * \"real\" data, places that are good block boundaries will tend to be noticeable\n * based only on changes in these aggregate frequencies, without looking for\n * subtle differences in individual symbols.  For example, a change from ASCII\n * bytes to non-ASCII bytes, or from few matches (generally less compressible)\n * to many matches (generally more compressible), would be easily noticed based\n * on the aggregates.\n *\n * For determining whether the frequency distributions are \"different enough\" to\n * start a new block, the simply heuristic of splitting when the sum of absolute\n * differences exceeds a constant seems to be good enough.\n *\n * Finally, for an approximation, it is not strictly necessary that the exact\n * symbols being used are considered.  With \"near-optimal parsing\", for example,\n * the actual symbols that will be used are unknown until after the block\n * boundary is chosen and the block has been optimized.  Since the final choices\n * cannot be used, we can use preliminary \"greedy\" choices instead.\n */\n\n/* Initialize the block split statistics when starting a new block. */\nstatic void\nlzx_init_block_split_stats(struct lzx_block_split_stats *stats)\n{\n\tmemset(stats, 0, sizeof(*stats));\n}\n\n/* Literal observation.  Heuristic: use the top 2 bits and low 1 bits of the\n * literal, for 8 possible literal observation types.  */\nstatic forceinline void\nlzx_observe_literal(struct lzx_block_split_stats *stats, u8 lit)\n{\n\tstats->new_observations[((lit >> 5) & 0x6) | (lit & 1)]++;\n\tstats->num_new_observations++;\n}\n\n/* Match observation.  Heuristic: use one observation type for \"short match\" and\n * one observation type for \"long match\".  */\nstatic forceinline void\nlzx_observe_match(struct lzx_block_split_stats *stats, unsigned length)\n{\n\tstats->new_observations[NUM_LITERAL_OBSERVATION_TYPES + (length >= 5)]++;\n\tstats->num_new_observations++;\n}\n\nstatic bool\nlzx_should_end_block(struct lzx_block_split_stats *stats)\n{\n\tif (stats->num_observations > 0) {\n\n\t\t/* Note: to avoid slow divisions, we do not divide by\n\t\t * 'num_observations', but rather do all math with the numbers\n\t\t * multiplied by 'num_observations'. */\n\t\tu32 total_delta = 0;\n\t\tfor (int i = 0; i < NUM_OBSERVATION_TYPES; i++) {\n\t\t\tu32 expected = stats->observations[i] *\n\t\t\t\t       stats->num_new_observations;\n\t\t\tu32 actual = stats->new_observations[i] *\n\t\t\t\t     stats->num_observations;\n\t\t\tu32 delta = (actual > expected) ? actual - expected :\n\t\t\t\t\t\t\t  expected - actual;\n\t\t\ttotal_delta += delta;\n\t\t}\n\n\t\t/* Ready to end the block? */\n\t\tif (total_delta >=\n\t\t    stats->num_new_observations * 7 / 8 * stats->num_observations)\n\t\t\treturn true;\n\t}\n\n\tfor (int i = 0; i < NUM_OBSERVATION_TYPES; i++) {\n\t\tstats->num_observations += stats->new_observations[i];\n\t\tstats->observations[i] += stats->new_observations[i];\n\t\tstats->new_observations[i] = 0;\n\t}\n\tstats->num_new_observations = 0;\n\treturn false;\n}\n\n/******************************************************************************/\n/*                   Slower (\"near-optimal\") compression algorithm            */\n/*----------------------------------------------------------------------------*/\n\n/*\n * Least-recently-used queue for match offsets.\n *\n * This is represented as a 64-bit integer for efficiency.  There are three\n * offsets of 21 bits each.  Bit 64 is garbage.\n */\nPRAGMA_BEGIN_ALIGN(8)\nstruct lzx_lru_queue {\n\tu64 R;\n} PRAGMA_END_ALIGN(8);\n\n#define LZX_QUEUE_OFFSET_SHIFT\t21\n#define LZX_QUEUE_OFFSET_MASK\t(((u64)1 << LZX_QUEUE_OFFSET_SHIFT) - 1)\n\n#define LZX_QUEUE_R0_SHIFT (0 * LZX_QUEUE_OFFSET_SHIFT)\n#define LZX_QUEUE_R1_SHIFT (1 * LZX_QUEUE_OFFSET_SHIFT)\n#define LZX_QUEUE_R2_SHIFT (2 * LZX_QUEUE_OFFSET_SHIFT)\n\n#define LZX_QUEUE_R0_MASK (LZX_QUEUE_OFFSET_MASK << LZX_QUEUE_R0_SHIFT)\n#define LZX_QUEUE_R1_MASK (LZX_QUEUE_OFFSET_MASK << LZX_QUEUE_R1_SHIFT)\n#define LZX_QUEUE_R2_MASK (LZX_QUEUE_OFFSET_MASK << LZX_QUEUE_R2_SHIFT)\n\n#define LZX_QUEUE_INITIALIZER {\t\t\t\\\n\t((u64)1 << LZX_QUEUE_R0_SHIFT) |\t\\\n\t((u64)1 << LZX_QUEUE_R1_SHIFT) |\t\\\n\t((u64)1 << LZX_QUEUE_R2_SHIFT) }\n\nstatic forceinline u64\nlzx_lru_queue_R0(struct lzx_lru_queue queue)\n{\n\treturn (queue.R >> LZX_QUEUE_R0_SHIFT) & LZX_QUEUE_OFFSET_MASK;\n}\n\nstatic forceinline u64\nlzx_lru_queue_R1(struct lzx_lru_queue queue)\n{\n\treturn (queue.R >> LZX_QUEUE_R1_SHIFT) & LZX_QUEUE_OFFSET_MASK;\n}\n\nstatic forceinline u64\nlzx_lru_queue_R2(struct lzx_lru_queue queue)\n{\n\treturn (queue.R >> LZX_QUEUE_R2_SHIFT) & LZX_QUEUE_OFFSET_MASK;\n}\n\n/* Push a match offset onto the front (most recently used) end of the queue.  */\nstatic forceinline struct lzx_lru_queue\nlzx_lru_queue_push(struct lzx_lru_queue queue, u32 offset)\n{\n\treturn (struct lzx_lru_queue) {\n\t\t.R = (queue.R << LZX_QUEUE_OFFSET_SHIFT) | offset,\n\t};\n}\n\n/* Swap a match offset to the front of the queue.  */\nstatic forceinline struct lzx_lru_queue\nlzx_lru_queue_swap(struct lzx_lru_queue queue, unsigned idx)\n{\n\tunsigned shift = idx * 21;\n\tconst u64 mask = LZX_QUEUE_R0_MASK;\n\tconst u64 mask_high = mask << shift;\n\n\treturn (struct lzx_lru_queue) {\n\t\t(queue.R & ~(mask | mask_high)) |\n\t\t((queue.R & mask_high) >> shift) |\n\t\t((queue.R & mask) << shift)\n\t};\n}\n\nstatic forceinline u32\nlzx_walk_item_list(struct lzx_compressor *c, u32 block_size, bool is_16_bit,\n\t\t   bool record)\n{\n\tstruct lzx_sequence *seq =\n\t\t&c->chosen_sequences[ARRAY_LEN(c->chosen_sequences) - 1];\n\tu32 node_idx = block_size;\n\tu32 litrun_end; /* if record=true: end of the current literal run */\n\n\tif (record) {\n\t\t/* The last sequence has matchlen 0 */\n\t\tseq->litrunlen_and_matchlen = 0;\n\t\tlitrun_end = node_idx;\n\t}\n\n\tfor (;;) {\n\t\tu32 item;\n\t\tunsigned matchlen;\n\t\tu32 adjusted_offset;\n\t\tunsigned mainsym;\n\n\t\t/* Tally literals until either a match or the beginning of the\n\t\t * block is reached.  Note: the item in the node at the\n\t\t * beginning of the block (c->optimum_nodes[0]) has all bits\n\t\t * set, causing this loop to end when it is reached. */\n\t\tfor (;;) {\n\t\t\titem = c->optimum_nodes[node_idx].item;\n\t\t\tif (item & OPTIMUM_LEN_MASK)\n\t\t\t\tbreak;\n\t\t\tc->freqs.main[item >> OPTIMUM_OFFSET_SHIFT]++;\n\t\t\tnode_idx--;\n\t\t}\n\n\t#if CONSIDER_GAP_MATCHES\n\t\tif (item & OPTIMUM_GAP_MATCH) {\n\t\t\tif (node_idx == 0)\n\t\t\t\tbreak;\n\t\t\t/* Tally/record the rep0 match after the gap. */\n\t\t\tmatchlen = item & OPTIMUM_LEN_MASK;\n\t\t\tmainsym = lzx_tally_main_and_lensyms(c, matchlen, 0,\n\t\t\t\t\t\t\t     is_16_bit);\n\t\t\tif (record) {\n\t\t\t\tseq->litrunlen_and_matchlen |=\n\t\t\t\t\t(litrun_end - node_idx) <<\n\t\t\t\t\t SEQ_MATCHLEN_BITS;\n\t\t\t\tseq--;\n\t\t\t\tseq->litrunlen_and_matchlen = matchlen;\n\t\t\t\tseq->adjusted_offset_and_mainsym = mainsym;\n\t\t\t\tlitrun_end = node_idx - matchlen;\n\t\t\t}\n\n\t\t\t/* Tally the literal in the gap. */\n\t\t\tc->freqs.main[(u8)(item >> OPTIMUM_OFFSET_SHIFT)]++;\n\n\t\t\t/* Fall through and tally the match before the gap.\n\t\t\t * (It was temporarily saved in the 'cost' field of the\n\t\t\t * previous node, which was free to reuse.) */\n\t\t\titem = c->optimum_nodes[--node_idx].cost;\n\t\t\tnode_idx -= matchlen;\n\t\t}\n\t#else /* CONSIDER_GAP_MATCHES */\n\t\tif (node_idx == 0)\n\t\t\tbreak;\n\t#endif /* !CONSIDER_GAP_MATCHES */\n\n\t\t/* Tally/record a match. */\n\t\tmatchlen = item & OPTIMUM_LEN_MASK;\n\t\tadjusted_offset = item >> OPTIMUM_OFFSET_SHIFT;\n\t\t// coverity[overrun-call]\n\t\tmainsym = lzx_tally_main_and_lensyms(c, matchlen,\n\t\t\t\t\t\t     adjusted_offset,\n\t\t\t\t\t\t     is_16_bit);\n\t\tif (adjusted_offset >= LZX_MIN_ALIGNED_OFFSET +\n\t\t\t\t       LZX_OFFSET_ADJUSTMENT)\n\t\t\tc->freqs.aligned[adjusted_offset &\n\t\t\t\t\t LZX_ALIGNED_OFFSET_BITMASK]++;\n\t\tif (record) {\n\t\t\tseq->litrunlen_and_matchlen |=\n\t\t\t\t(litrun_end - node_idx) << SEQ_MATCHLEN_BITS;\n\t\t\tseq--;\n\t\t\tseq->litrunlen_and_matchlen = matchlen;\n\t\t\tseq->adjusted_offset_and_mainsym =\n\t\t\t\t(adjusted_offset << SEQ_MAINSYM_BITS) | mainsym;\n\t\t\tlitrun_end = node_idx - matchlen;\n\t\t}\n\t\tnode_idx -= matchlen;\n\t}\n\n\t/* Record the literal run length for the first sequence. */\n\tif (record) {\n\t\tseq->litrunlen_and_matchlen |=\n\t\t\t(litrun_end - node_idx) << SEQ_MATCHLEN_BITS;\n\t}\n\n\t/* Return the index in chosen_sequences at which the sequences begin. */\n\treturn seq - &c->chosen_sequences[0];\n}\n\n/*\n * Given the minimum-cost path computed through the item graph for the current\n * block, walk the path and count how many of each symbol in each Huffman-coded\n * alphabet would be required to output the items (matches and literals) along\n * the path.\n *\n * Note that the path will be walked backwards (from the end of the block to the\n * beginning of the block), but this doesn't matter because this function only\n * computes frequencies.\n */\nstatic forceinline void\nlzx_tally_item_list(struct lzx_compressor *c, u32 block_size, bool is_16_bit)\n{\n\tlzx_walk_item_list(c, block_size, is_16_bit, false);\n}\n\n/*\n * Like lzx_tally_item_list(), but this function also generates the list of\n * lzx_sequences for the minimum-cost path and writes it to c->chosen_sequences,\n * ready to be output to the bitstream after the Huffman codes are computed.\n * The lzx_sequences will be written to decreasing memory addresses as the path\n * is walked backwards, which means they will end up in the expected\n * first-to-last order.  The return value is the index in c->chosen_sequences at\n * which the lzx_sequences begin.\n */\nstatic forceinline u32\nlzx_record_item_list(struct lzx_compressor *c, u32 block_size, bool is_16_bit)\n{\n\treturn lzx_walk_item_list(c, block_size, is_16_bit, true);\n}\n\n/*\n * Find an inexpensive path through the graph of possible match/literal choices\n * for the current block.  The nodes of the graph are\n * c->optimum_nodes[0...block_size].  They correspond directly to the bytes in\n * the current block, plus one extra node for end-of-block.  The edges of the\n * graph are matches and literals.  The goal is to find the minimum cost path\n * from 'c->optimum_nodes[0]' to 'c->optimum_nodes[block_size]', given the cost\n * model 'c->costs'.\n *\n * The algorithm works forwards, starting at 'c->optimum_nodes[0]' and\n * proceeding forwards one node at a time.  At each node, a selection of matches\n * (len >= 2), as well as the literal byte (len = 1), is considered.  An item of\n * length 'len' provides a new path to reach the node 'len' bytes later.  If\n * such a path is the lowest cost found so far to reach that later node, then\n * that later node is updated with the new cost and the \"arrival\" which provided\n * that cost.\n *\n * Note that although this algorithm is based on minimum cost path search, due\n * to various simplifying assumptions the result is not guaranteed to be the\n * true minimum cost, or \"optimal\", path over the graph of all valid LZX\n * representations of this block.\n *\n * Also, note that because of the presence of the recent offsets queue (which is\n * a type of adaptive state), the algorithm cannot work backwards and compute\n * \"cost to end\" instead of \"cost to beginning\".  Furthermore, the way the\n * algorithm handles this adaptive state in the \"minimum cost\" parse is actually\n * only an approximation.  It's possible for the globally optimal, minimum cost\n * path to contain a prefix, ending at a position, where that path prefix is\n * *not* the minimum cost path to that position.  This can happen if such a path\n * prefix results in a different adaptive state which results in lower costs\n * later.  The algorithm does not solve this problem in general; it only looks\n * one step ahead, with the exception of special consideration for \"gap\n * matches\".\n */\nstatic forceinline struct lzx_lru_queue\nlzx_find_min_cost_path(struct lzx_compressor * const restrict c,\n\t\t       const u8 * const restrict block_begin,\n\t\t       const u32 block_size,\n\t\t       const struct lzx_lru_queue initial_queue,\n\t\t       bool is_16_bit)\n{\n\tstruct lzx_optimum_node *cur_node = c->optimum_nodes;\n\tstruct lzx_optimum_node * const end_node = cur_node + block_size;\n\tstruct lz_match *cache_ptr = c->match_cache;\n\tconst u8 *in_next = block_begin;\n\tconst u8 * const block_end = block_begin + block_size;\n\n\t/*\n\t * Instead of storing the match offset LRU queues in the\n\t * 'lzx_optimum_node' structures, we save memory (and cache lines) by\n\t * storing them in a smaller array.  This works because the algorithm\n\t * only requires a limited history of the adaptive state.  Once a given\n\t * state is more than LZX_MAX_MATCH_LEN bytes behind the current node\n\t * (more if gap match consideration is enabled; we just round up to 512\n\t * so it's a power of 2), it is no longer needed.\n\t *\n\t * The QUEUE() macro finds the queue for the given node.  This macro has\n\t * been optimized by taking advantage of 'struct lzx_lru_queue' and\n\t * 'struct lzx_optimum_node' both being 8 bytes in size and alignment.\n\t */\n\tstruct lzx_lru_queue queues[512] = { 0 };\n\tSTATIC_ASSERT(ARRAY_LEN(queues) >= LZX_MAX_MATCH_LEN + 1);\n\tSTATIC_ASSERT(sizeof(c->optimum_nodes[0]) == sizeof(queues[0]));\n#define QUEUE(node) \\\n\t(*(struct lzx_lru_queue *)((char *)queues + \\\n\t\t\t((uintptr_t)(node) % (ARRAY_LEN(queues) * sizeof(queues[0])))))\n\t/*(queues[(uintptr_t)(node) / sizeof(*(node)) % ARRAY_LEN(queues)])*/\n\n#if CONSIDER_GAP_MATCHES\n\tu32 matches_before_gap[ARRAY_LEN(queues)] = { 0 };\n#define MATCH_BEFORE_GAP(node) \\\n\t(matches_before_gap[(uintptr_t)(node) / sizeof(*(node)) % \\\n\t\t\t    ARRAY_LEN(matches_before_gap)])\n#endif\n\n\t/*\n\t * Initially, the cost to reach each node is \"infinity\".\n\t *\n\t * The first node actually should have cost 0, but \"infinity\"\n\t * (0xFFFFFFFF) works just as well because it immediately overflows.\n\t *\n\t * The following statement also intentionally sets the 'item' of the\n\t * first node, which would otherwise have no meaning, to 0xFFFFFFFF for\n\t * use as a sentinel.  See lzx_walk_item_list().\n\t */\n\tmemset(c->optimum_nodes, 0xFF,\n\t       (block_size + 1) * sizeof(c->optimum_nodes[0]));\n\n\t/* Initialize the recent offsets queue for the first node. */\n\tQUEUE(cur_node) = initial_queue;\n\n\tdo { /* For each node in the block in position order... */\n\n\t\tunsigned num_matches;\n\t\tunsigned literal;\n\t\tu32 cost;\n\n\t\t/*\n\t\t * A selection of matches for the block was already saved in\n\t\t * memory so that we don't have to run the uncompressed data\n\t\t * through the matchfinder on every optimization pass.  However,\n\t\t * we still search for repeat offset matches during each\n\t\t * optimization pass because we cannot predict the state of the\n\t\t * recent offsets queue.  But as a heuristic, we don't bother\n\t\t * searching for repeat offset matches if the general-purpose\n\t\t * matchfinder failed to find any matches.\n\t\t *\n\t\t * Note that a match of length n at some offset implies there is\n\t\t * also a match of length l for LZX_MIN_MATCH_LEN <= l <= n at\n\t\t * that same offset.  In other words, we don't necessarily need\n\t\t * to use the full length of a match.  The key heuristic that\n\t\t * saves a significicant amount of time is that for each\n\t\t * distinct length, we only consider the smallest offset for\n\t\t * which that length is available.  This heuristic also applies\n\t\t * to repeat offsets, which we order specially: R0 < R1 < R2 <\n\t\t * any explicit offset.  Of course, this heuristic may be\n\t\t * produce suboptimal results because offset slots in LZX are\n\t\t * subject to entropy encoding, but in practice this is a useful\n\t\t * heuristic.\n\t\t */\n\n\t\tnum_matches = cache_ptr->length;\n\t\tcache_ptr++;\n\n\t\tif (num_matches) {\n\t\t\tstruct lz_match *end_matches = cache_ptr + num_matches;\n\t\t\tunsigned next_len = LZX_MIN_MATCH_LEN;\n\t\t\tunsigned max_len = min(block_end - in_next, LZX_MAX_MATCH_LEN);\n\t\t\tconst u8 *matchptr;\n\n\t\t\t/* Consider rep0 matches. */\n\t\t\tmatchptr = in_next - lzx_lru_queue_R0(QUEUE(cur_node));\n\t\t\tif (load_u16_unaligned(matchptr) != load_u16_unaligned(in_next))\n\t\t\t\tgoto rep0_done;\n\t\t\tSTATIC_ASSERT(LZX_MIN_MATCH_LEN == 2);\n\t\t\tdo {\n\t\t\t\tu32 cost = cur_node->cost +\n\t\t\t\t\t   c->costs.match_cost[0][\n\t\t\t\t\t\t\tnext_len - LZX_MIN_MATCH_LEN];\n\t\t\t\tif (cost <= (cur_node + next_len)->cost) {\n\t\t\t\t\t(cur_node + next_len)->cost = cost;\n\t\t\t\t\t(cur_node + next_len)->item =\n\t\t\t\t\t\t(0 << OPTIMUM_OFFSET_SHIFT) | next_len;\n\t\t\t\t}\n\t\t\t\tif (unlikely(++next_len > max_len)) {\n\t\t\t\t\tcache_ptr = end_matches;\n\t\t\t\t\tgoto done_matches;\n\t\t\t\t}\n\t\t\t} while (in_next[next_len - 1] == matchptr[next_len - 1]);\n\n\t\trep0_done:\n\n\t\t\t/* Consider rep1 matches. */\n\t\t\tmatchptr = in_next - lzx_lru_queue_R1(QUEUE(cur_node));\n\t\t\tif (load_u16_unaligned(matchptr) != load_u16_unaligned(in_next))\n\t\t\t\tgoto rep1_done;\n\t\t\tif (matchptr[next_len - 1] != in_next[next_len - 1])\n\t\t\t\tgoto rep1_done;\n\t\t\tfor (unsigned len = 2; len < next_len - 1; len++)\n\t\t\t\tif (matchptr[len] != in_next[len])\n\t\t\t\t\tgoto rep1_done;\n\t\t\tdo {\n\t\t\t\tu32 cost = cur_node->cost +\n\t\t\t\t\t   c->costs.match_cost[1][\n\t\t\t\t\t\t\tnext_len - LZX_MIN_MATCH_LEN];\n\t\t\t\tif (cost <= (cur_node + next_len)->cost) {\n\t\t\t\t\t(cur_node + next_len)->cost = cost;\n\t\t\t\t\t(cur_node + next_len)->item =\n\t\t\t\t\t\t(1 << OPTIMUM_OFFSET_SHIFT) | next_len;\n\t\t\t\t}\n\t\t\t\tif (unlikely(++next_len > max_len)) {\n\t\t\t\t\tcache_ptr = end_matches;\n\t\t\t\t\tgoto done_matches;\n\t\t\t\t}\n\t\t\t} while (in_next[next_len - 1] == matchptr[next_len - 1]);\n\n\t\trep1_done:\n\n\t\t\t/* Consider rep2 matches. */\n\t\t\tmatchptr = in_next - lzx_lru_queue_R2(QUEUE(cur_node));\n\t\t\tif (load_u16_unaligned(matchptr) != load_u16_unaligned(in_next))\n\t\t\t\tgoto rep2_done;\n\t\t\tif (matchptr[next_len - 1] != in_next[next_len - 1])\n\t\t\t\tgoto rep2_done;\n\t\t\tfor (unsigned len = 2; len < next_len - 1; len++)\n\t\t\t\tif (matchptr[len] != in_next[len])\n\t\t\t\t\tgoto rep2_done;\n\t\t\tdo {\n\t\t\t\tu32 cost = cur_node->cost +\n\t\t\t\t\t   c->costs.match_cost[2][\n\t\t\t\t\t\t\tnext_len - LZX_MIN_MATCH_LEN];\n\t\t\t\tif (cost <= (cur_node + next_len)->cost) {\n\t\t\t\t\t(cur_node + next_len)->cost = cost;\n\t\t\t\t\t(cur_node + next_len)->item =\n\t\t\t\t\t\t(2 << OPTIMUM_OFFSET_SHIFT) | next_len;\n\t\t\t\t}\n\t\t\t\tif (unlikely(++next_len > max_len)) {\n\t\t\t\t\tcache_ptr = end_matches;\n\t\t\t\t\tgoto done_matches;\n\t\t\t\t}\n\t\t\t} while (in_next[next_len - 1] == matchptr[next_len - 1]);\n\n\t\trep2_done:\n\n\t\t\twhile (next_len > cache_ptr->length)\n\t\t\t\tif (++cache_ptr == end_matches)\n\t\t\t\t\tgoto done_matches;\n\n\t\t\t/* Consider explicit offset matches. */\n\t\t\tfor (;;) {\n\t\t\t\tu32 offset = cache_ptr->offset;\n\t\t\t\tu32 adjusted_offset = offset + LZX_OFFSET_ADJUSTMENT;\n\t\t\t\tunsigned offset_slot = lzx_get_offset_slot(c, adjusted_offset, is_16_bit);\n\t\t\t\tu32 base_cost = cur_node->cost;\n\t\t\t\tu32 cost;\n\n\t\t\t#if CONSIDER_ALIGNED_COSTS\n\t\t\t\tif (offset >= LZX_MIN_ALIGNED_OFFSET)\n\t\t\t\t\tbase_cost += c->costs.aligned[adjusted_offset &\n\t\t\t\t\t\t\t\t      LZX_ALIGNED_OFFSET_BITMASK];\n\t\t\t#endif\n\t\t\t\tdo {\n\t\t\t\t\tcost = base_cost +\n\t\t\t\t\t       c->costs.match_cost[offset_slot][\n\t\t\t\t\t\t\t\tnext_len - LZX_MIN_MATCH_LEN];\n\t\t\t\t\tif (cost < (cur_node + next_len)->cost) {\n\t\t\t\t\t\t(cur_node + next_len)->cost = cost;\n\t\t\t\t\t\t(cur_node + next_len)->item =\n\t\t\t\t\t\t\t(adjusted_offset << OPTIMUM_OFFSET_SHIFT) | next_len;\n\t\t\t\t\t}\n\t\t\t\t} while (++next_len <= cache_ptr->length);\n\n\t\t\t\tif (++cache_ptr == end_matches) {\n\t\t\t\t#if CONSIDER_GAP_MATCHES\n\t\t\t\t\t/* Also consider the longest explicit\n\t\t\t\t\t * offset match as a \"gap match\": match\n\t\t\t\t\t * + lit + rep0. */\n\t\t\t\t\ts32 remaining = (block_end - in_next) - (s32)next_len;\n\t\t\t\t\tif (likely(remaining >= 2)) {\n\t\t\t\t\t\tconst u8 *strptr = in_next + next_len;\n\t\t\t\t\t\tconst u8 *matchptr = strptr - offset;\n\t\t\t\t\t\tif (load_u16_unaligned(strptr) == load_u16_unaligned(matchptr)) {\n\t\t\t\t\t\t\tSTATIC_ASSERT(ARRAY_LEN(queues) - LZX_MAX_MATCH_LEN - 2 >= 250);\n\t\t\t\t\t\t\tSTATIC_ASSERT(ARRAY_LEN(queues) == ARRAY_LEN(matches_before_gap));\n\t\t\t\t\t\t\tunsigned limit = min(remaining,\n\t\t\t\t\t\t\t\t\t     min(ARRAY_LEN(queues) - LZX_MAX_MATCH_LEN - 2,\n\t\t\t\t\t\t\t\t\t\t LZX_MAX_MATCH_LEN));\n\t\t\t\t\t\t\tunsigned rep0_len = lz_extend(strptr, matchptr, 2, limit);\n\t\t\t\t\t\t\tu8 lit = strptr[-1];\n\t\t\t\t\t\t\tcost += c->costs.main[lit] +\n\t\t\t\t\t\t\t\tc->costs.match_cost[0][rep0_len - LZX_MIN_MATCH_LEN];\n\t\t\t\t\t\t\tunsigned total_len = next_len + rep0_len;\n\t\t\t\t\t\t\tif (cost < (cur_node + total_len)->cost) {\n\t\t\t\t\t\t\t\t(cur_node + total_len)->cost = cost;\n\t\t\t\t\t\t\t\t(cur_node + total_len)->item =\n\t\t\t\t\t\t\t\t\tOPTIMUM_GAP_MATCH |\n\t\t\t\t\t\t\t\t\t((u32)lit << OPTIMUM_OFFSET_SHIFT) |\n\t\t\t\t\t\t\t\t\trep0_len;\n\t\t\t\t\t\t\t\tMATCH_BEFORE_GAP(cur_node + total_len) =\n\t\t\t\t\t\t\t\t\t(adjusted_offset << OPTIMUM_OFFSET_SHIFT) |\n\t\t\t\t\t\t\t\t\t(next_len - 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t#endif /* CONSIDER_GAP_MATCHES */\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tdone_matches:\n\n\t\t/* Consider coding a literal.\n\n\t\t * To avoid an extra branch, actually checking the preferability\n\t\t * of coding the literal is integrated into the queue update\n\t\t * code below. */\n\t\tliteral = *in_next++;\n\t\tcost = cur_node->cost + c->costs.main[literal];\n\n\t\t/* Advance to the next position. */\n\t\tcur_node++;\n\n\t\t/* The lowest-cost path to the current position is now known.\n\t\t * Finalize the recent offsets queue that results from taking\n\t\t * this lowest-cost path. */\n\n\t\tif (cost <= cur_node->cost) {\n\t\t\t/* Literal: queue remains unchanged. */\n\t\t\tcur_node->cost = cost;\n\t\t\tcur_node->item = (u32)literal << OPTIMUM_OFFSET_SHIFT;\n\t\t\tQUEUE(cur_node) = QUEUE(cur_node - 1);\n\t\t} else {\n\t\t\t/* Match: queue update is needed. */\n\t\t\tunsigned len = cur_node->item & OPTIMUM_LEN_MASK;\n\t\t#if CONSIDER_GAP_MATCHES\n\t\t\ts32 adjusted_offset = (s32)cur_node->item >> OPTIMUM_OFFSET_SHIFT;\n\t\t\tSTATIC_ASSERT(OPTIMUM_GAP_MATCH == 0x80000000); /* assuming sign extension */\n\t\t#else\n\t\t\tu32 adjusted_offset = cur_node->item >> OPTIMUM_OFFSET_SHIFT;\n\t\t#endif\n\n\t\t\tif (adjusted_offset >= LZX_NUM_RECENT_OFFSETS) {\n\t\t\t\t/* Explicit offset match: insert offset at front. */\n\t\t\t\tQUEUE(cur_node) =\n\t\t\t\t\tlzx_lru_queue_push(QUEUE(cur_node - len),\n\t\t\t\t\t\t\t   adjusted_offset - LZX_OFFSET_ADJUSTMENT);\n\t\t\t}\n\t\t#if CONSIDER_GAP_MATCHES\n\t\t\telse if (adjusted_offset < 0) {\n\t\t\t\t/* \"Gap match\": Explicit offset match, then a\n\t\t\t\t * literal, then rep0 match.  Save the explicit\n\t\t\t\t * offset match information in the cost field of\n\t\t\t\t * the previous node, which isn't needed\n\t\t\t\t * anymore.  Then insert the offset at the front\n\t\t\t\t * of the queue. */\n\t\t\t\tu32 match_before_gap = MATCH_BEFORE_GAP(cur_node);\n\t\t\t\t(cur_node - 1)->cost = match_before_gap;\n\t\t\t\tQUEUE(cur_node) =\n\t\t\t\t\tlzx_lru_queue_push(QUEUE(cur_node - len - 1 -\n\t\t\t\t\t\t\t\t (match_before_gap & OPTIMUM_LEN_MASK)),\n\t\t\t\t\t\t\t   (match_before_gap >> OPTIMUM_OFFSET_SHIFT) -\n\t\t\t\t\t\t\t   LZX_OFFSET_ADJUSTMENT);\n\t\t\t}\n\t\t#endif\n\t\t\telse {\n\t\t\t\t/* Repeat offset match: swap offset to front. */\n\t\t\t\tQUEUE(cur_node) =\n\t\t\t\t\tlzx_lru_queue_swap(QUEUE(cur_node - len),\n\t\t\t\t\t\t\t   adjusted_offset);\n\t\t\t}\n\t\t}\n\t} while (cur_node != end_node);\n\n\t/* Return the recent offsets queue at the end of the path. */\n\treturn QUEUE(cur_node);\n}\n\n/*\n * Given the costs for the main and length codewords (c->costs.main and\n * c->costs.len), initialize the match cost array (c->costs.match_cost) which\n * directly provides the cost of every possible (length, offset slot) pair.\n */\nstatic void\nlzx_compute_match_costs(struct lzx_compressor *c)\n{\n\tunsigned num_offset_slots = (c->num_main_syms - LZX_NUM_CHARS) /\n\t\t\t\t\tLZX_NUM_LEN_HEADERS;\n\tstruct lzx_costs *costs = &c->costs;\n\tunsigned main_symbol = LZX_NUM_CHARS;\n\n\tfor (unsigned offset_slot = 0; offset_slot < num_offset_slots;\n\t     offset_slot++)\n\t{\n\t\tu32 extra_cost = lzx_extra_offset_bits[offset_slot] * BIT_COST;\n\t\tunsigned i;\n\n\t#if CONSIDER_ALIGNED_COSTS\n\t\tif (offset_slot >= LZX_MIN_ALIGNED_OFFSET_SLOT)\n\t\t\textra_cost -= LZX_NUM_ALIGNED_OFFSET_BITS * BIT_COST;\n\t#endif\n\n\t\tfor (i = 0; i < LZX_NUM_PRIMARY_LENS; i++) {\n\t\t\tcosts->match_cost[offset_slot][i] =\n\t\t\t\tcosts->main[main_symbol++] + extra_cost;\n\t\t}\n\n\t\textra_cost += costs->main[main_symbol++];\n\n\t\tfor (; i < LZX_NUM_LENS; i++) {\n\t\t\tcosts->match_cost[offset_slot][i] =\n\t\t\t\tcosts->len[i - LZX_NUM_PRIMARY_LENS] +\n\t\t\t\textra_cost;\n\t\t}\n\t}\n}\n\n/*\n * Fast approximation for log2f(x).  This is not as accurate as the standard C\n * version.  It does not need to be perfectly accurate because it is only used\n * for estimating symbol costs, which is very approximate anyway.\n */\nstatic float\nlog2f_fast(float x)\n{\n        union {\n\t\tfloat f;\n\t\ts32 i;\n\t} u = { .f = x };\n\n\t/* Extract the exponent and subtract 127 to remove the bias.  This gives\n\t * the integer part of the result. */\n        float res = ((u.i >> 23) & 0xFF) - 127;\n\n\t/* Set the exponent to 0 (plus bias of 127).  This transforms the number\n\t * to the range [1, 2) while retaining the same mantissa. */\n\tu.i = (u.i & ~(0xFF << 23)) | (127 << 23);\n\n\t/*\n\t * Approximate the log2 of the transformed number using a degree 2\n\t * interpolating polynomial for log2(x) over the interval [1, 2).  Then\n\t * add this to the extracted exponent to produce the final approximation\n\t * of log2(x).\n\t *\n\t * The coefficients of the interpolating polynomial used here were found\n\t * using the script tools/log2_interpolation.r.\n\t */\n        return res - 1.653124006f + u.f * (1.9941812f - u.f * 0.3347490189f);\n\n}\n\n/*\n * Return the estimated cost of a symbol which has been estimated to have the\n * given probability.\n */\nstatic u32\nlzx_cost_for_probability(float prob)\n{\n\t/*\n\t * The basic formula is:\n\t *\n\t *\tentropy = -log2(probability)\n\t *\n\t * Use this to get the cost in fractional bits.  Then multiply by our\n\t * scaling factor of BIT_COST and convert to an integer.\n\t *\n\t * In addition, the minimum cost is BIT_COST (one bit) because the\n\t * entropy coding method will be Huffman codes.\n\t *\n\t * Careful: even though 'prob' should be <= 1.0, 'log2f_fast(prob)' may\n\t * be positive due to inaccuracy in our log2 approximation.  Therefore,\n\t * we cannot, in general, assume the computed cost is non-negative, and\n\t * we should make sure negative costs get rounded up correctly.\n\t */\n\ts32 cost = -log2f_fast(prob) * BIT_COST;\n\treturn max(cost, BIT_COST);\n}\n\n/*\n * Mapping: number of used literals => heuristic probability of a literal times\n * 6870.  Generated by running this R command:\n *\n *\tcat(paste(round(6870*2^-((304+(0:256))/64)), collapse=\", \"))\n */\nstatic const u8 literal_scaled_probs[257] = {\n\t255, 253, 250, 247, 244, 242, 239, 237, 234, 232, 229, 227, 224, 222,\n\t219, 217, 215, 212, 210, 208, 206, 203, 201, 199, 197, 195, 193, 191,\n\t189, 186, 184, 182, 181, 179, 177, 175, 173, 171, 169, 167, 166, 164,\n\t162, 160, 159, 157, 155, 153, 152, 150, 149, 147, 145, 144, 142, 141,\n\t139, 138, 136, 135, 133, 132, 130, 129, 128, 126, 125, 124, 122, 121,\n\t120, 118, 117, 116, 115, 113, 112, 111, 110, 109, 107, 106, 105, 104,\n\t103, 102, 101, 100, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86,\n\t86, 85, 84, 83, 82, 81, 80, 79, 78, 78, 77, 76, 75, 74, 73, 73, 72, 71,\n\t70, 70, 69, 68, 67, 67, 66, 65, 65, 64, 63, 62, 62, 61, 60, 60, 59, 59,\n\t58, 57, 57, 56, 55, 55, 54, 54, 53, 53, 52, 51, 51, 50, 50, 49, 49, 48,\n\t48, 47, 47, 46, 46, 45, 45, 44, 44, 43, 43, 42, 42, 41, 41, 40, 40, 40,\n\t39, 39, 38, 38, 38, 37, 37, 36, 36, 36, 35, 35, 34, 34, 34, 33, 33, 33,\n\t32, 32, 32, 31, 31, 31, 30, 30, 30, 29, 29, 29, 28, 28, 28, 27, 27, 27,\n\t27, 26, 26, 26, 25, 25, 25, 25, 24, 24, 24, 24, 23, 23, 23, 23, 22, 22,\n\t22, 22, 21, 21, 21, 21, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 18, 18,\n\t18, 18, 18, 17, 17, 17, 17, 17, 16, 16, 16, 16\n};\n\n/*\n * Mapping: length symbol => default cost of that symbol.  This is derived from\n * sample data but has been slightly edited to add more bias towards the\n * shortest lengths, which are the most common.\n */\nstatic const u16 lzx_default_len_costs[LZX_LENCODE_NUM_SYMBOLS] = {\n\t300, 310, 320, 330, 360, 396, 399, 416, 451, 448, 463, 466, 505, 492,\n\t503, 514, 547, 531, 566, 561, 589, 563, 592, 586, 623, 602, 639, 627,\n\t659, 643, 657, 650, 685, 662, 661, 672, 685, 686, 696, 680, 657, 682,\n\t666, 699, 674, 699, 679, 709, 688, 712, 692, 714, 694, 716, 698, 712,\n\t706, 727, 714, 727, 713, 723, 712, 718, 719, 719, 720, 735, 725, 735,\n\t728, 740, 727, 739, 727, 742, 716, 733, 733, 740, 738, 746, 737, 747,\n\t738, 745, 736, 748, 742, 749, 745, 749, 743, 748, 741, 752, 745, 752,\n\t747, 750, 747, 752, 748, 753, 750, 752, 753, 753, 749, 744, 752, 755,\n\t753, 756, 745, 748, 746, 745, 723, 757, 755, 758, 755, 758, 752, 757,\n\t754, 757, 755, 759, 755, 758, 753, 755, 755, 758, 757, 761, 755, 750,\n\t758, 759, 759, 760, 758, 751, 757, 757, 759, 759, 758, 759, 758, 761,\n\t750, 761, 758, 760, 759, 761, 758, 761, 760, 752, 759, 760, 759, 759,\n\t757, 762, 760, 761, 761, 748, 761, 760, 762, 763, 752, 762, 762, 763,\n\t762, 762, 763, 763, 762, 763, 762, 763, 762, 763, 763, 764, 763, 762,\n\t763, 762, 762, 762, 764, 764, 763, 764, 763, 763, 763, 762, 763, 763,\n\t762, 764, 764, 763, 762, 763, 763, 763, 763, 762, 764, 763, 762, 764,\n\t764, 763, 763, 765, 764, 764, 762, 763, 764, 765, 763, 764, 763, 764,\n\t762, 764, 764, 754, 763, 764, 763, 763, 762, 763, 584,\n};\n\n/* Set default costs to bootstrap the iterative optimization algorithm. */\nstatic void\nlzx_set_default_costs(struct lzx_compressor *c)\n{\n\tunsigned i;\n\tu32 num_literals = 0;\n\tu32 num_used_literals = 0;\n\tfloat inv_num_matches = 1.0f / c->freqs.main[LZX_NUM_CHARS];\n\tfloat inv_num_items;\n\tfloat prob_match = 1.0f;\n\tu32 match_cost;\n\tfloat base_literal_prob;\n\n\t/* Some numbers here have been hardcoded to assume a bit cost of 64. */\n\tSTATIC_ASSERT(BIT_COST == 64);\n\n\t/* Estimate the number of literals that will used.  'num_literals' is\n\t * the total number, whereas 'num_used_literals' is the number of\n\t * distinct symbols. */\n\tfor (i = 0; i < LZX_NUM_CHARS; i++) {\n\t\tnum_literals += c->freqs.main[i];\n\t\tnum_used_literals += (c->freqs.main[i] != 0);\n\t}\n\n\t/* Note: all match headers were tallied as symbol 'LZX_NUM_CHARS'.  We\n\t * don't attempt to estimate which ones will be used. */\n\n\tinv_num_items = 1.0f / (num_literals + c->freqs.main[LZX_NUM_CHARS]);\n\tbase_literal_prob = literal_scaled_probs[num_used_literals] *\n\t\t\t    (1.0f / 6870.0f);\n\n\t/* Literal costs.  We use two different methods to compute the\n\t * probability of each literal and mix together their results. */\n\tfor (i = 0; i < LZX_NUM_CHARS; i++) {\n\t\tu32 freq = c->freqs.main[i];\n\t\tif (freq != 0) {\n\t\t\tfloat prob = 0.5f * ((freq * inv_num_items) +\n\t\t\t\t\t     base_literal_prob);\n\t\t\tc->costs.main[i] = lzx_cost_for_probability(prob);\n\t\t\tprob_match -= prob;\n\t\t} else {\n\t\t\tc->costs.main[i] = 11 * BIT_COST;\n\t\t}\n\t}\n\n\t/* Match header costs.  We just assume that all match headers are\n\t * equally probable, but we do take into account the relative cost of a\n\t * match header vs. a literal depending on how common matches are\n\t * expected to be vs. literals. */\n\tprob_match = max(prob_match, 0.15f);\n\tmatch_cost = lzx_cost_for_probability(prob_match / (c->num_main_syms -\n\t\t\t\t\t\t\t    LZX_NUM_CHARS));\n\tfor (; i < c->num_main_syms; i++)\n\t\tc->costs.main[i] = match_cost;\n\n\t/* Length symbol costs.  These are just set to fixed values which\n\t * reflect the fact the smallest lengths are typically the most common,\n\t * and therefore are typically the cheapest. */\n\tfor (i = 0; i < LZX_LENCODE_NUM_SYMBOLS; i++)\n\t\tc->costs.len[i] = lzx_default_len_costs[i];\n\n#if CONSIDER_ALIGNED_COSTS\n\t/* Aligned offset symbol costs.  These are derived from the estimated\n\t * probability of each aligned offset symbol. */\n\tfor (i = 0; i < LZX_ALIGNEDCODE_NUM_SYMBOLS; i++) {\n\t\t/* We intentionally tallied the frequencies in the wrong slots,\n\t\t * not accounting for LZX_OFFSET_ADJUSTMENT, since doing the\n\t\t * fixup here is faster: a constant 8 subtractions here vs. one\n\t\t * addition for every match. */\n\t\tunsigned j = (i - LZX_OFFSET_ADJUSTMENT) & LZX_ALIGNED_OFFSET_BITMASK;\n\t\tif (c->freqs.aligned[j] != 0) {\n\t\t\tfloat prob = c->freqs.aligned[j] * inv_num_matches;\n\t\t\tc->costs.aligned[i] = lzx_cost_for_probability(prob);\n\t\t} else {\n\t\t\tc->costs.aligned[i] =\n\t\t\t\t(2 * LZX_NUM_ALIGNED_OFFSET_BITS) * BIT_COST;\n\t\t}\n\t}\n#endif\n}\n\n/* Update the current cost model to reflect the computed Huffman codes.  */\nstatic void\nlzx_set_costs_from_codes(struct lzx_compressor *c)\n{\n\tunsigned i;\n\tconst struct lzx_lens *lens = &c->codes[c->codes_index].lens;\n\n\tfor (i = 0; i < c->num_main_syms; i++) {\n\t\tc->costs.main[i] = (lens->main[i] ? lens->main[i] :\n\t\t\t\t    MAIN_CODEWORD_LIMIT) * BIT_COST;\n\t}\n\n\tfor (i = 0; i < LZX_LENCODE_NUM_SYMBOLS; i++) {\n\t\tc->costs.len[i] = (lens->len[i] ? lens->len[i] :\n\t\t\t\t   LENGTH_CODEWORD_LIMIT) * BIT_COST;\n\t}\n\n#if CONSIDER_ALIGNED_COSTS\n\tfor (i = 0; i < LZX_ALIGNEDCODE_NUM_SYMBOLS; i++) {\n\t\tc->costs.aligned[i] = (lens->aligned[i] ? lens->aligned[i] :\n\t\t\t\t       ALIGNED_CODEWORD_LIMIT) * BIT_COST;\n\t}\n#endif\n}\n\n/*\n * Choose a \"near-optimal\" literal/match sequence to use for the current block,\n * then flush the block.  Because the cost of each Huffman symbol is unknown\n * until the Huffman codes have been built and the Huffman codes themselves\n * depend on the symbol frequencies, this uses an iterative optimization\n * algorithm to approximate an optimal solution.  The first optimization pass\n * for the block uses default costs; additional passes use costs derived from\n * the Huffman codes computed in the previous pass.\n */\nstatic forceinline struct lzx_lru_queue\nlzx_optimize_and_flush_block(struct lzx_compressor * const restrict c,\n\t\t\t     struct lzx_output_bitstream * const restrict os,\n\t\t\t     const u8 * const restrict block_begin,\n\t\t\t     const u32 block_size,\n\t\t\t     const struct lzx_lru_queue initial_queue,\n\t\t\t     bool is_16_bit)\n{\n\tunsigned num_passes_remaining = c->num_optim_passes;\n\tstruct lzx_lru_queue new_queue;\n\tu32 seq_idx;\n\n\tlzx_set_default_costs(c);\n\n\tfor (;;) {\n\t\tlzx_compute_match_costs(c);\n\t\tnew_queue = lzx_find_min_cost_path(c, block_begin, block_size,\n\t\t\t\t\t\t   initial_queue, is_16_bit);\n\n\t\tif (--num_passes_remaining == 0)\n\t\t\tbreak;\n\n\t\t/* At least one optimization pass remains.  Update the costs. */\n\t\tlzx_reset_symbol_frequencies(c);\n\t\tlzx_tally_item_list(c, block_size, is_16_bit);\n\t\tlzx_build_huffman_codes(c);\n\t\tlzx_set_costs_from_codes(c);\n\t}\n\n\t/* Done optimizing.  Generate the sequence list and flush the block. */\n\tlzx_reset_symbol_frequencies(c);\n\tseq_idx = lzx_record_item_list(c, block_size, is_16_bit);\n\tlzx_flush_block(c, os, block_begin, block_size, seq_idx);\n\treturn new_queue;\n}\n\n/*\n * This is the \"near-optimal\" LZX compressor.\n *\n * For each block, it performs a relatively thorough graph search to find an\n * inexpensive (in terms of compressed size) way to output the block.\n *\n * Note: there are actually many things this algorithm leaves on the table in\n * terms of compression ratio.  So although it may be \"near-optimal\", it is\n * certainly not \"optimal\".  The goal is not to produce the optimal compression\n * ratio, which for LZX is probably impossible within any practical amount of\n * time, but rather to produce a compression ratio significantly better than a\n * simpler \"greedy\" or \"lazy\" parse while still being relatively fast.\n */\nstatic forceinline void\nlzx_compress_near_optimal(struct lzx_compressor * restrict c,\n\t\t\t  const u8 * const restrict in_begin, size_t in_nbytes,\n\t\t\t  struct lzx_output_bitstream * restrict os,\n\t\t\t  bool is_16_bit)\n{\n\tconst u8 *\t in_next = in_begin;\n\tconst u8 * const in_end  = in_begin + in_nbytes;\n\tu32 max_len = LZX_MAX_MATCH_LEN;\n\tu32 nice_len = min(c->nice_match_length, max_len);\n\tu32 next_hashes[2] = {0, 0};\n\tstruct lzx_lru_queue queue = LZX_QUEUE_INITIALIZER;\n\n\t/* Initialize the matchfinder. */\n\tCALL_BT_MF(is_16_bit, c, bt_matchfinder_init);\n\n\tdo {\n\t\t/* Starting a new block */\n\n\t\tconst u8 * const in_block_begin = in_next;\n\t\tconst u8 * const in_max_block_end =\n\t\t\tin_next + min(SOFT_MAX_BLOCK_SIZE, in_end - in_next);\n\t\tstruct lz_match *cache_ptr = c->match_cache;\n\t\tconst u8 *next_search_pos = in_next;\n\t\tconst u8 *next_observation = in_next;\n\t\tconst u8 *next_pause_point =\n\t\t\tmin(in_next + min(MIN_BLOCK_SIZE,\n\t\t\t\t\t  in_max_block_end - in_next),\n\t\t\t    in_max_block_end - min(LZX_MAX_MATCH_LEN - 1,\n\t\t\t\t\t\t   in_max_block_end - in_next));\n\n\t\tlzx_init_block_split_stats(&c->split_stats);\n\t\tlzx_reset_symbol_frequencies(c);\n\n\t\tif (in_next >= next_pause_point)\n\t\t\tgoto pause;\n\n\t\t/*\n\t\t * Run the input buffer through the matchfinder, caching the\n\t\t * matches, until we decide to end the block.\n\t\t *\n\t\t * For a tighter matchfinding loop, we compute a \"pause point\",\n\t\t * which is the next position at which we may need to check\n\t\t * whether to end the block or to decrease max_len.  We then\n\t\t * only do these extra checks upon reaching the pause point.\n\t\t */\n\tresume_matchfinding:\n\t\tdo {\n\t\t\tif (in_next >= next_search_pos) {\n\t\t\t\t/* Search for matches at this position. */\n\t\t\t\tstruct lz_match *lz_matchptr;\n\t\t\t\tu32 best_len;\n\n\t\t\t\tlz_matchptr = CALL_BT_MF(is_16_bit, c,\n\t\t\t\t\t\t\t bt_matchfinder_get_matches,\n\t\t\t\t\t\t\t in_begin,\n\t\t\t\t\t\t\t in_next - in_begin,\n\t\t\t\t\t\t\t max_len,\n\t\t\t\t\t\t\t nice_len,\n\t\t\t\t\t\t\t c->max_search_depth,\n\t\t\t\t\t\t\t next_hashes,\n\t\t\t\t\t\t\t &best_len,\n\t\t\t\t\t\t\t cache_ptr + 1);\n\t\t\t\tcache_ptr->length = lz_matchptr - (cache_ptr + 1);\n\t\t\t\tcache_ptr = lz_matchptr;\n\n\t\t\t\t/* Accumulate literal/match statistics for block\n\t\t\t\t * splitting and for generating the initial cost\n\t\t\t\t * model. */\n\t\t\t\tif (in_next >= next_observation) {\n\t\t\t\t\tbest_len = cache_ptr[-1].length;\n\t\t\t\t\tif (best_len >= 3) {\n\t\t\t\t\t\t/* Match (len >= 3) */\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Note: for performance reasons this has\n\t\t\t\t\t\t * been simplified significantly:\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * - We wait until later to account for\n\t\t\t\t\t\t *   LZX_OFFSET_ADJUSTMENT.\n\t\t\t\t\t\t * - We don't account for repeat offsets.\n\t\t\t\t\t\t * - We don't account for different match headers.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tc->freqs.aligned[cache_ptr[-1].offset &\n\t\t\t\t\t\t\tLZX_ALIGNED_OFFSET_BITMASK]++;\n\t\t\t\t\t\tc->freqs.main[LZX_NUM_CHARS]++;\n\n\t\t\t\t\t\tlzx_observe_match(&c->split_stats, best_len);\n\t\t\t\t\t\tnext_observation = in_next + best_len;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* Literal */\n\t\t\t\t\t\tc->freqs.main[*in_next]++;\n\t\t\t\t\t\tlzx_observe_literal(&c->split_stats, *in_next);\n\t\t\t\t\t\tnext_observation = in_next + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * If there was a very long match found, then\n\t\t\t\t * don't cache any matches for the bytes covered\n\t\t\t\t * by that match.  This avoids degenerate\n\t\t\t\t * behavior when compressing highly redundant\n\t\t\t\t * data, where the number of matches can be very\n\t\t\t\t * large.\n\t\t\t\t *\n\t\t\t\t * This heuristic doesn't actually hurt the\n\t\t\t\t * compression ratio *too* much.  If there's a\n\t\t\t\t * long match, then the data must be highly\n\t\t\t\t * compressible, so it doesn't matter as much\n\t\t\t\t * what we do.\n\t\t\t\t */\n\t\t\t\tif (best_len >= nice_len)\n\t\t\t\t\tnext_search_pos = in_next + best_len;\n\t\t\t} else {\n\t\t\t\t/* Don't search for matches at this position. */\n\t\t\t\tCALL_BT_MF(is_16_bit, c,\n\t\t\t\t\t   bt_matchfinder_skip_byte,\n\t\t\t\t\t   in_begin,\n\t\t\t\t\t   in_next - in_begin,\n\t\t\t\t\t   nice_len,\n\t\t\t\t\t   c->max_search_depth,\n\t\t\t\t\t   next_hashes);\n\t\t\t\tcache_ptr->length = 0;\n\t\t\t\tcache_ptr++;\n\t\t\t}\n\t\t} while (++in_next < next_pause_point &&\n\t\t\t likely(cache_ptr < &c->match_cache[CACHE_LENGTH]));\n\n\tpause:\n\n\t\t/* Adjust max_len and nice_len if we're nearing the end of the\n\t\t * input buffer.  In addition, if we are so close to the end of\n\t\t * the input buffer that there cannot be any more matches, then\n\t\t * just advance through the last few positions and record no\n\t\t * matches. */\n\t\tif (unlikely(max_len > in_end - in_next)) {\n\t\t\tmax_len = in_end - in_next;\n\t\t\tnice_len = min(max_len, nice_len);\n\t\t\tif (max_len < BT_MATCHFINDER_REQUIRED_NBYTES) {\n\t\t\t\twhile (in_next != in_end) {\n\t\t\t\t\tcache_ptr->length = 0;\n\t\t\t\t\tcache_ptr++;\n\t\t\t\t\tin_next++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* End the block if the match cache may overflow. */\n\t\tif (unlikely(cache_ptr >= &c->match_cache[CACHE_LENGTH]))\n\t\t\tgoto end_block;\n\n\t\t/* End the block if the soft maximum size has been reached. */\n\t\tif (in_next >= in_max_block_end)\n\t\t\tgoto end_block;\n\n\t\t/* End the block if the block splitting algorithm thinks this is\n\t\t * a good place to do so. */\n\t\tif (c->split_stats.num_new_observations >=\n\t\t\t\tNUM_OBSERVATIONS_PER_BLOCK_CHECK &&\n\t\t    in_max_block_end - in_next >= MIN_BLOCK_SIZE &&\n\t\t    lzx_should_end_block(&c->split_stats))\n\t\t\tgoto end_block;\n\n\t\t/* It's not time to end the block yet.  Compute the next pause\n\t\t * point and resume matchfinding. */\n\t\tnext_pause_point =\n\t\t\tmin(in_next + min(NUM_OBSERVATIONS_PER_BLOCK_CHECK * 2 -\n\t\t\t\t\t    c->split_stats.num_new_observations,\n\t\t\t\t\t  in_max_block_end - in_next),\n\t\t\t    in_max_block_end - min(LZX_MAX_MATCH_LEN - 1,\n\t\t\t\t\t\t   in_max_block_end - in_next));\n\t\tgoto resume_matchfinding;\n\n\tend_block:\n\t\t/* We've decided on a block boundary and cached matches.  Now\n\t\t * choose a match/literal sequence and flush the block. */\n\t\tqueue = lzx_optimize_and_flush_block(c, os, in_block_begin,\n\t\t\t\t\t\t     in_next - in_block_begin,\n\t\t\t\t\t\t     queue, is_16_bit);\n\t} while (in_next != in_end);\n}\n\nstatic void\nlzx_compress_near_optimal_16(struct lzx_compressor *c, const u8 *in,\n\t\t\t     size_t in_nbytes, struct lzx_output_bitstream *os)\n{\n\tlzx_compress_near_optimal(c, in, in_nbytes, os, true);\n}\n\nstatic void\nlzx_compress_near_optimal_32(struct lzx_compressor *c, const u8 *in,\n\t\t\t     size_t in_nbytes, struct lzx_output_bitstream *os)\n{\n\tlzx_compress_near_optimal(c, in, in_nbytes, os, false);\n}\n\n/******************************************************************************/\n/*                     Faster (\"lazy\") compression algorithm                  */\n/*----------------------------------------------------------------------------*/\n\n/*\n * Called when the compressor chooses to use a literal.  This tallies the\n * Huffman symbol for the literal, increments the current literal run length,\n * and \"observes\" the literal for the block split statistics.\n */\nstatic forceinline void\nlzx_choose_literal(struct lzx_compressor *c, unsigned literal, u32 *litrunlen_p)\n{\n\tlzx_observe_literal(&c->split_stats, literal);\n\tc->freqs.main[literal]++;\n\t++*litrunlen_p;\n}\n\n/*\n * Called when the compressor chooses to use a match.  This tallies the Huffman\n * symbol(s) for a match, saves the match data and the length of the preceding\n * literal run, updates the recent offsets queue, and \"observes\" the match for\n * the block split statistics.\n */\nstatic forceinline void\nlzx_choose_match(struct lzx_compressor *c, unsigned length, u32 adjusted_offset,\n\t\t u32 recent_offsets[LZX_NUM_RECENT_OFFSETS], bool is_16_bit,\n\t\t u32 *litrunlen_p, struct lzx_sequence **next_seq_p)\n{\n\tstruct lzx_sequence *next_seq = *next_seq_p;\n\tunsigned mainsym;\n\n\tlzx_observe_match(&c->split_stats, length);\n\n\tmainsym = lzx_tally_main_and_lensyms(c, length, adjusted_offset,\n\t\t\t\t\t     is_16_bit);\n\tnext_seq->litrunlen_and_matchlen =\n\t\t(*litrunlen_p << SEQ_MATCHLEN_BITS) | length;\n\tnext_seq->adjusted_offset_and_mainsym =\n\t\t(adjusted_offset << SEQ_MAINSYM_BITS) | mainsym;\n\n\t/* Update the recent offsets queue. */\n\tif (adjusted_offset < LZX_NUM_RECENT_OFFSETS) {\n\t\t/* Repeat offset match. */\n\t\tswap(recent_offsets[0], recent_offsets[adjusted_offset]);\n\t} else {\n\t\t/* Explicit offset match. */\n\n\t\t/* Tally the aligned offset symbol if needed. */\n\t\tif (adjusted_offset >= LZX_MIN_ALIGNED_OFFSET + LZX_OFFSET_ADJUSTMENT)\n\t\t\tc->freqs.aligned[adjusted_offset & LZX_ALIGNED_OFFSET_BITMASK]++;\n\n\t\trecent_offsets[2] = recent_offsets[1];\n\t\trecent_offsets[1] = recent_offsets[0];\n\t\trecent_offsets[0] = adjusted_offset - LZX_OFFSET_ADJUSTMENT;\n\t}\n\n\t/* Reset the literal run length and advance to the next sequence. */\n\t*next_seq_p = next_seq + 1;\n\t*litrunlen_p = 0;\n}\n\n/*\n * Called when the compressor ends a block.  This finshes the last lzx_sequence,\n * which is just a literal run with no following match.  This literal run might\n * be empty.\n */\nstatic forceinline void\nlzx_finish_sequence(struct lzx_sequence *last_seq, u32 litrunlen)\n{\n\tlast_seq->litrunlen_and_matchlen = litrunlen << SEQ_MATCHLEN_BITS;\n}\n\n/*\n * Find the longest repeat offset match with the current position.  If a match\n * is found, return its length and set *best_rep_idx_ret to the index of its\n * offset in @recent_offsets.  Otherwise, return 0.\n *\n * Don't bother with length 2 matches; consider matches of length >= 3 only.\n * Also assume that max_len >= 3.\n */\nstatic unsigned\nlzx_find_longest_repeat_offset_match(const u8 * const in_next,\n\t\t\t\t     const u32 recent_offsets[],\n\t\t\t\t     const unsigned max_len,\n\t\t\t\t     unsigned *best_rep_idx_ret)\n{\n\tSTATIC_ASSERT(LZX_NUM_RECENT_OFFSETS == 3); /* loop is unrolled */\n\n\tconst u32 seq3 = load_u24_unaligned(in_next);\n\tconst u8 *matchptr;\n\tunsigned best_rep_len = 0;\n\tunsigned best_rep_idx = 0;\n\tunsigned rep_len;\n\n\t/* Check for rep0 match (most recent offset) */\n\tmatchptr = in_next - recent_offsets[0];\n\tif (load_u24_unaligned(matchptr) == seq3)\n\t\tbest_rep_len = lz_extend(in_next, matchptr, 3, max_len);\n\n\t/* Check for rep1 match (second most recent offset) */\n\tmatchptr = in_next - recent_offsets[1];\n\tif (load_u24_unaligned(matchptr) == seq3) {\n\t\trep_len = lz_extend(in_next, matchptr, 3, max_len);\n\t\tif (rep_len > best_rep_len) {\n\t\t\tbest_rep_len = rep_len;\n\t\t\tbest_rep_idx = 1;\n\t\t}\n\t}\n\n\t/* Check for rep2 match (third most recent offset) */\n\tmatchptr = in_next - recent_offsets[2];\n\tif (load_u24_unaligned(matchptr) == seq3) {\n\t\trep_len = lz_extend(in_next, matchptr, 3, max_len);\n\t\tif (rep_len > best_rep_len) {\n\t\t\tbest_rep_len = rep_len;\n\t\t\tbest_rep_idx = 2;\n\t\t}\n\t}\n\n\t*best_rep_idx_ret = best_rep_idx;\n\treturn best_rep_len;\n}\n\n/*\n * Fast heuristic scoring for lazy parsing: how \"good\" is this match?\n * This is mainly determined by the length: longer matches are better.\n * However, we also give a bonus to close (small offset) matches and to repeat\n * offset matches, since those require fewer bits to encode.\n */\n\nstatic forceinline unsigned\nlzx_explicit_offset_match_score(unsigned len, u32 adjusted_offset)\n{\n\tunsigned score = len;\n\n\tif (adjusted_offset < 4096)\n\t\tscore++;\n\tif (adjusted_offset < 256)\n\t\tscore++;\n\n\treturn score;\n}\n\nstatic forceinline unsigned\nlzx_repeat_offset_match_score(unsigned rep_len, unsigned rep_idx)\n{\n\treturn rep_len + 3;\n}\n\n/*\n * This is the \"lazy\" LZX compressor.  The basic idea is that before it chooses\n * a match, it checks to see if there's a longer match at the next position.  If\n * yes, it chooses a literal and continues to the next position.  If no, it\n * chooses the match.\n *\n * Some additional heuristics are used as well.  Repeat offset matches are\n * considered favorably and sometimes are chosen immediately.  In addition, long\n * matches (at least \"nice_len\" bytes) are chosen immediately as well.  Finally,\n * when we decide whether a match is \"better\" than another, we take the offset\n * into consideration as well as the length.\n */\nstatic forceinline void\nlzx_compress_lazy(struct lzx_compressor * restrict c,\n\t\t  const u8 * const restrict in_begin, size_t in_nbytes,\n\t\t  struct lzx_output_bitstream * restrict os, bool is_16_bit)\n{\n\tconst u8 *\t in_next = in_begin;\n\tconst u8 * const in_end  = in_begin + in_nbytes;\n\tunsigned max_len = LZX_MAX_MATCH_LEN;\n\tunsigned nice_len = min(c->nice_match_length, max_len);\n\tSTATIC_ASSERT(LZX_NUM_RECENT_OFFSETS == 3);\n\tu32 recent_offsets[LZX_NUM_RECENT_OFFSETS] = {1, 1, 1};\n\tu32 next_hashes[2] = {0, 0};\n\n\t/* Initialize the matchfinder. */\n\tCALL_HC_MF(is_16_bit, c, hc_matchfinder_init);\n\n\tdo {\n\t\t/* Starting a new block */\n\n\t\tconst u8 * const in_block_begin = in_next;\n\t\tconst u8 * const in_max_block_end =\n\t\t\tin_next + min(SOFT_MAX_BLOCK_SIZE, in_end - in_next);\n\t\tstruct lzx_sequence *next_seq = c->chosen_sequences;\n\t\tu32 litrunlen = 0;\n\t\tunsigned cur_len;\n\t\tu32 cur_offset;\n\t\tu32 cur_adjusted_offset;\n\t\tunsigned cur_score;\n\t\tunsigned next_len;\n\t\tu32 next_offset;\n\t\tu32 next_adjusted_offset;\n\t\tunsigned next_score;\n\t\tunsigned best_rep_len;\n\t\tunsigned best_rep_idx;\n\t\tunsigned rep_score;\n\t\tunsigned skip_len;\n\n\t\tlzx_reset_symbol_frequencies(c);\n\t\tlzx_init_block_split_stats(&c->split_stats);\n\n\t\tdo {\n\t\t\t/* Adjust max_len and nice_len if we're nearing the end\n\t\t\t * of the input buffer. */\n\t\t\tif (unlikely(max_len > in_end - in_next)) {\n\t\t\t\tmax_len = in_end - in_next;\n\t\t\t\tnice_len = min(max_len, nice_len);\n\t\t\t}\n\n\t\t\t/* Find the longest match (subject to the\n\t\t\t * max_search_depth cutoff parameter) with the current\n\t\t\t * position.  Don't bother with length 2 matches; only\n\t\t\t * look for matches of length >= 3. */\n\t\t\tcur_len = CALL_HC_MF(is_16_bit, c,\n\t\t\t\t\t     hc_matchfinder_longest_match,\n\t\t\t\t\t     in_begin,\n\t\t\t\t\t     in_next,\n\t\t\t\t\t     2,\n\t\t\t\t\t     max_len,\n\t\t\t\t\t     nice_len,\n\t\t\t\t\t     c->max_search_depth,\n\t\t\t\t\t     next_hashes,\n\t\t\t\t\t     &cur_offset);\n\n\t\t\t/* If there was no match found, or the only match found\n\t\t\t * was a distant short match, then choose a literal. */\n\t\t\tif (cur_len < 3 ||\n\t\t\t    (cur_len == 3 &&\n\t\t\t     cur_offset >= 8192 - LZX_OFFSET_ADJUSTMENT &&\n\t\t\t     cur_offset != recent_offsets[0] &&\n\t\t\t     cur_offset != recent_offsets[1] &&\n\t\t\t     cur_offset != recent_offsets[2]))\n\t\t\t{\n\t\t\t\tlzx_choose_literal(c, *in_next, &litrunlen);\n\t\t\t\tin_next++;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/* Heuristic: if this match has the most recent offset,\n\t\t\t * then go ahead and choose it as a rep0 match. */\n\t\t\tif (cur_offset == recent_offsets[0]) {\n\t\t\t\tin_next++;\n\t\t\t\tskip_len = cur_len - 1;\n\t\t\t\tcur_adjusted_offset = 0;\n\t\t\t\tgoto choose_cur_match;\n\t\t\t}\n\n\t\t\t/* Compute the longest match's score as an explicit\n\t\t\t * offset match. */\n\t\t\tcur_adjusted_offset = cur_offset + LZX_OFFSET_ADJUSTMENT;\n\t\t\tcur_score = lzx_explicit_offset_match_score(cur_len, cur_adjusted_offset);\n\n\t\t\t/* Find the longest repeat offset match at this\n\t\t\t * position.  If we find one and it's \"better\" than the\n\t\t\t * explicit offset match we found, then go ahead and\n\t\t\t * choose the repeat offset match immediately. */\n\t\t\tbest_rep_len = lzx_find_longest_repeat_offset_match(in_next,\n\t\t\t\t\t\t\t\t\t    recent_offsets,\n\t\t\t\t\t\t\t\t\t    max_len,\n\t\t\t\t\t\t\t\t\t    &best_rep_idx);\n\t\t\tin_next++;\n\n\t\t\tif (best_rep_len != 0 &&\n\t\t\t    (rep_score = lzx_repeat_offset_match_score(best_rep_len,\n\t\t\t\t\t\t\t\t       best_rep_idx)) >= cur_score)\n\t\t\t{\n\t\t\t\tcur_len = best_rep_len;\n\t\t\t\tcur_adjusted_offset = best_rep_idx;\n\t\t\t\tskip_len = best_rep_len - 1;\n\t\t\t\tgoto choose_cur_match;\n\t\t\t}\n\n\t\thave_cur_match:\n\t\t\t/*\n\t\t\t * We have a match at the current position.  If the\n\t\t\t * match is very long, then choose it immediately.\n\t\t\t * Otherwise, see if there's a better match at the next\n\t\t\t * position.\n\t\t\t */\n\n\t\t\tif (cur_len >= nice_len) {\n\t\t\t\tskip_len = cur_len - 1;\n\t\t\t\tgoto choose_cur_match;\n\t\t\t}\n\n\t\t\tif (unlikely(max_len > in_end - in_next)) {\n\t\t\t\tmax_len = in_end - in_next;\n\t\t\t\tnice_len = min(max_len, nice_len);\n\t\t\t}\n\n\t\t\tnext_len = CALL_HC_MF(is_16_bit, c,\n\t\t\t\t\t      hc_matchfinder_longest_match,\n\t\t\t\t\t      in_begin,\n\t\t\t\t\t      in_next,\n\t\t\t\t\t      cur_len - 2,\n\t\t\t\t\t      max_len,\n\t\t\t\t\t      nice_len,\n\t\t\t\t\t      c->max_search_depth / 2,\n\t\t\t\t\t      next_hashes,\n\t\t\t\t\t      &next_offset);\n\n\t\t\tif (next_len <= cur_len - 2) {\n\t\t\t\t/* No potentially better match was found. */\n\t\t\t\tin_next++;\n\t\t\t\tskip_len = cur_len - 2;\n\t\t\t\tgoto choose_cur_match;\n\t\t\t}\n\n\t\t\tnext_adjusted_offset = next_offset + LZX_OFFSET_ADJUSTMENT;\n\t\t\tnext_score = lzx_explicit_offset_match_score(next_len, next_adjusted_offset);\n\n\t\t\tbest_rep_len = lzx_find_longest_repeat_offset_match(in_next,\n\t\t\t\t\t\t\t\t\t    recent_offsets,\n\t\t\t\t\t\t\t\t\t    max_len,\n\t\t\t\t\t\t\t\t\t    &best_rep_idx);\n\t\t\tin_next++;\n\n\t\t\tif (best_rep_len != 0 &&\n\t\t\t    (rep_score = lzx_repeat_offset_match_score(best_rep_len,\n\t\t\t\t\t\t\t\t       best_rep_idx)) >= next_score)\n\t\t\t{\n\n\t\t\t\tif (rep_score > cur_score) {\n\t\t\t\t\t/* The next match is better, and it's a\n\t\t\t\t\t * repeat offset match. */\n\t\t\t\t\tlzx_choose_literal(c, *(in_next - 2),\n\t\t\t\t\t\t\t   &litrunlen);\n\t\t\t\t\tcur_len = best_rep_len;\n\t\t\t\t\tcur_adjusted_offset = best_rep_idx;\n\t\t\t\t\tskip_len = cur_len - 1;\n\t\t\t\t\tgoto choose_cur_match;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (next_score > cur_score) {\n\t\t\t\t\t/* The next match is better, and it's an\n\t\t\t\t\t * explicit offset match. */\n\t\t\t\t\tlzx_choose_literal(c, *(in_next - 2),\n\t\t\t\t\t\t\t   &litrunlen);\n\t\t\t\t\tcur_len = next_len;\n\t\t\t\t\tcur_adjusted_offset = next_adjusted_offset;\n\t\t\t\t\tcur_score = next_score;\n\t\t\t\t\tgoto have_cur_match;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* The original match was better; choose it. */\n\t\t\tskip_len = cur_len - 2;\n\n\t\tchoose_cur_match:\n\t\t\t/* Choose a match and have the matchfinder skip over its\n\t\t\t * remaining bytes. */\n\t\t\tlzx_choose_match(c, cur_len, cur_adjusted_offset,\n\t\t\t\t\t recent_offsets, is_16_bit,\n\t\t\t\t\t &litrunlen, &next_seq);\n\t\t\tCALL_HC_MF(is_16_bit, c,\n\t\t\t\t   hc_matchfinder_skip_bytes,\n\t\t\t\t   in_begin,\n\t\t\t\t   in_next,\n\t\t\t\t   in_end,\n\t\t\t\t   skip_len,\n\t\t\t\t   next_hashes);\n\t\t\tin_next += skip_len;\n\n\t\t\t/* Keep going until it's time to end the block. */\n\t\t} while (in_next < in_max_block_end &&\n\t\t\t !(c->split_stats.num_new_observations >=\n\t\t\t\t\tNUM_OBSERVATIONS_PER_BLOCK_CHECK &&\n\t\t\t   in_next - in_block_begin >= MIN_BLOCK_SIZE &&\n\t\t\t   in_end - in_next >= MIN_BLOCK_SIZE &&\n\t\t\t   lzx_should_end_block(&c->split_stats)));\n\n\t\t/* Flush the block. */\n\t\tlzx_finish_sequence(next_seq, litrunlen);\n\t\tlzx_flush_block(c, os, in_block_begin, in_next - in_block_begin, 0);\n\n\t\t/* Keep going until we've reached the end of the input buffer. */\n\t} while (in_next != in_end);\n}\n\nstatic void\nlzx_compress_lazy_16(struct lzx_compressor *c, const u8 *in, size_t in_nbytes,\n\t\t     struct lzx_output_bitstream *os)\n{\n\tlzx_compress_lazy(c, in, in_nbytes, os, true);\n}\n\nstatic void\nlzx_compress_lazy_32(struct lzx_compressor *c, const u8 *in, size_t in_nbytes,\n\t\t     struct lzx_output_bitstream *os)\n{\n\tlzx_compress_lazy(c, in, in_nbytes, os, false);\n}\n\n/******************************************************************************/\n/*                          Compressor operations                             */\n/*----------------------------------------------------------------------------*/\n\n/*\n * Generate tables for mapping match offsets (actually, \"adjusted\" match\n * offsets) to offset slots.\n */\nstatic void\nlzx_init_offset_slot_tabs(struct lzx_compressor *c)\n{\n\tu32 adjusted_offset = 0;\n\tunsigned slot = 0;\n\n\t/* slots [0, 29] */\n\tfor (; adjusted_offset < ARRAY_LEN(c->offset_slot_tab_1);\n\t     adjusted_offset++)\n\t{\n\t\tif (adjusted_offset >= lzx_offset_slot_base[slot + 1] +\n\t\t\t\t       LZX_OFFSET_ADJUSTMENT)\n\t\t\tslot++;\n\t\tc->offset_slot_tab_1[adjusted_offset] = slot;\n\t}\n\n\t/* slots [30, 49] */\n\tfor (; adjusted_offset < LZX_MAX_WINDOW_SIZE;\n\t     adjusted_offset += (u32)1 << 14)\n\t{\n\t\tif (adjusted_offset >= lzx_offset_slot_base[slot + 1] +\n\t\t\t\t       LZX_OFFSET_ADJUSTMENT)\n\t\t\tslot++;\n\t\tc->offset_slot_tab_2[adjusted_offset >> 14] = slot;\n\t}\n}\n\nstatic size_t\nlzx_get_compressor_size(size_t max_bufsize, unsigned compression_level)\n{\n\tif (compression_level <= MAX_FAST_LEVEL) {\n\t\tif (lzx_is_16_bit(max_bufsize))\n\t\t\treturn offsetof(struct lzx_compressor, hc_mf_16) +\n\t\t\t       hc_matchfinder_size_16(max_bufsize);\n\t\telse\n\t\t\treturn offsetof(struct lzx_compressor, hc_mf_32) +\n\t\t\t       hc_matchfinder_size_32(max_bufsize);\n\t} else {\n\t\tif (lzx_is_16_bit(max_bufsize))\n\t\t\treturn offsetof(struct lzx_compressor, bt_mf_16) +\n\t\t\t       bt_matchfinder_size_16(max_bufsize);\n\t\telse\n\t\t\treturn offsetof(struct lzx_compressor, bt_mf_32) +\n\t\t\t       bt_matchfinder_size_32(max_bufsize);\n\t}\n}\n\n/* Compute the amount of memory needed to allocate an LZX compressor. */\nstatic u64\nlzx_get_needed_memory(size_t max_bufsize, unsigned compression_level,\n\t\t      bool destructive)\n{\n\tu64 size = 0;\n\n\tif (max_bufsize > LZX_MAX_WINDOW_SIZE)\n\t\treturn 0;\n\n\tsize += lzx_get_compressor_size(max_bufsize, compression_level);\n\tif (!destructive)\n\t\tsize += max_bufsize; /* account for in_buffer */\n\treturn size;\n}\n\n/* Allocate an LZX compressor. */\nstatic int\nlzx_create_compressor(size_t max_bufsize, unsigned compression_level,\n\t\t      bool destructive, void **c_ret)\n{\n\tunsigned window_order;\n\tstruct lzx_compressor *c;\n\n\t/* Validate the maximum buffer size and get the window order from it. */\n\twindow_order = lzx_get_window_order(max_bufsize);\n\tif (window_order == 0)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\t/* Allocate the compressor. */\n\tc = MALLOC(lzx_get_compressor_size(max_bufsize, compression_level));\n\tif (!c)\n\t\tgoto oom0;\n\n\tc->window_order = window_order;\n\tc->num_main_syms = lzx_get_num_main_syms(window_order);\n\tc->destructive = destructive;\n\n\t/* Allocate the buffer for preprocessed data if needed. */\n\tif (!c->destructive) {\n\t\tc->in_buffer = MALLOC(max_bufsize);\n\t\tif (!c->in_buffer)\n\t\t\tgoto oom1;\n\t}\n\n\tif (compression_level <= MAX_FAST_LEVEL) {\n\n\t\t/* Fast compression: Use lazy parsing. */\n\t\tif (lzx_is_16_bit(max_bufsize))\n\t\t\tc->impl = lzx_compress_lazy_16;\n\t\telse\n\t\t\tc->impl = lzx_compress_lazy_32;\n\n\t\t/* Scale max_search_depth and nice_match_length with the\n\t\t * compression level. */\n\t\tc->max_search_depth = (60 * compression_level) / 20;\n\t\tc->nice_match_length = (80 * compression_level) / 20;\n\n\t\t/* lzx_compress_lazy() needs max_search_depth >= 2 because it\n\t\t * halves the max_search_depth when attempting a lazy match, and\n\t\t * max_search_depth must be at least 1. */\n\t\tc->max_search_depth = max(c->max_search_depth, 2);\n\t} else {\n\n\t\t/* Normal / high compression: Use near-optimal parsing. */\n\t\tif (lzx_is_16_bit(max_bufsize))\n\t\t\tc->impl = lzx_compress_near_optimal_16;\n\t\telse\n\t\t\tc->impl = lzx_compress_near_optimal_32;\n\n\t\t/* Scale max_search_depth and nice_match_length with the\n\t\t * compression level. */\n\t\tc->max_search_depth = (24 * compression_level) / 50;\n\t\tc->nice_match_length = (48 * compression_level) / 50;\n\n\t\t/* Also scale num_optim_passes with the compression level.  But\n\t\t * the more passes there are, the less they help --- so don't\n\t\t * add them linearly.  */\n\t\tc->num_optim_passes = 1;\n\t\tc->num_optim_passes += (compression_level >= 45);\n\t\tc->num_optim_passes += (compression_level >= 70);\n\t\tc->num_optim_passes += (compression_level >= 100);\n\t\tc->num_optim_passes += (compression_level >= 150);\n\t\tc->num_optim_passes += (compression_level >= 200);\n\t\tc->num_optim_passes += (compression_level >= 300);\n\n\t\t/* max_search_depth must be at least 1. */\n\t\tc->max_search_depth = max(c->max_search_depth, 1);\n\t}\n\n\t/* Prepare the offset => offset slot mapping. */\n\tlzx_init_offset_slot_tabs(c);\n\n\t*c_ret = c;\n\treturn 0;\n\noom1:\n\tFREE(c);\noom0:\n\treturn WIMLIB_ERR_NOMEM;\n}\n\n/* Compress a buffer of data. */\nstatic size_t\nlzx_compress(const void *restrict in, size_t in_nbytes,\n\t     void *restrict out, size_t out_nbytes_avail, void *restrict _c)\n{\n\tstruct lzx_compressor *c = _c;\n\tstruct lzx_output_bitstream os;\n\tsize_t result;\n\n\t/* Don't bother trying to compress very small inputs. */\n\tif (in_nbytes < 64)\n\t\treturn 0;\n\n\t/* If the compressor is in \"destructive\" mode, then we can directly\n\t * preprocess the input data.  Otherwise, we need to copy it into an\n\t * internal buffer first. */\n\tif (!c->destructive) {\n\t\tmemcpy(c->in_buffer, in, in_nbytes);\n\t\tin = c->in_buffer;\n\t}\n\n\t/* Preprocess the input data. */\n\tlzx_preprocess((void *)in, in_nbytes);\n\n\t/* Initially, the previous Huffman codeword lengths are all zeroes. */\n\tc->codes_index = 0;\n\tmemset(&c->codes[1].lens, 0, sizeof(struct lzx_lens));\n\n\t/* Initialize the output bitstream. */\n\tlzx_init_output(&os, out, out_nbytes_avail);\n\n\t/* Call the compression level-specific compress() function. */\n\t(*c->impl)(c, in, in_nbytes, &os);\n\n\t/* Flush the output bitstream. */\n\tresult = lzx_flush_output(&os);\n\n\t/* If the data did not compress to less than its original size and we\n\t * preprocessed the original buffer, then postprocess it to restore it\n\t * to its original state. */\n\tif (result == 0 && c->destructive)\n\t\tlzx_postprocess((void *)in, in_nbytes);\n\n\t/* Return the number of compressed bytes, or 0 if the input did not\n\t * compress to less than its original size. */\n\treturn result;\n}\n\n/* Free an LZX compressor. */\nstatic void\nlzx_free_compressor(void *_c)\n{\n\tstruct lzx_compressor *c = _c;\n\n\tif (!c->destructive)\n\t\tFREE(c->in_buffer);\n\tFREE(c);\n}\n\nconst struct compressor_ops lzx_compressor_ops = {\n\t.get_needed_memory  = lzx_get_needed_memory,\n\t.create_compressor  = lzx_create_compressor,\n\t.compress\t    = lzx_compress,\n\t.free_compressor    = lzx_free_compressor,\n};\n"
  },
  {
    "path": "src/wimlib/lzx_decompress.c",
    "content": "/*\n * lzx_decompress.c\n *\n * A decompressor for the LZX compression format, as used in WIM files.\n */\n\n/*\n * Copyright (C) 2012-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n/*\n * LZX is an LZ77 and Huffman-code based compression format that has many\n * similarities to DEFLATE (the format used by zlib/gzip).  The compression\n * ratio is as good or better than DEFLATE.  See lzx_compress.c for a format\n * overview, and see https://en.wikipedia.org/wiki/LZX_(algorithm) for a\n * historical overview.  Here I make some pragmatic notes.\n *\n * The old specification for LZX is the document \"Microsoft LZX Data Compression\n * Format\" (1997).  It defines the LZX format as used in cabinet files.  Allowed\n * window sizes are 2^n where 15 <= n <= 21.  However, this document contains\n * several errors, so don't read too much into it...\n *\n * The new specification for LZX is the document \"[MS-PATCH]: LZX DELTA\n * Compression and Decompression\" (2014).  It defines the LZX format as used by\n * Microsoft's binary patcher.  It corrects several errors in the 1997 document\n * and extends the format in several ways --- namely, optional reference data,\n * up to 2^25 byte windows, and longer match lengths.\n *\n * WIM files use a more restricted form of LZX.  No LZX DELTA extensions are\n * present, the window is not \"sliding\", E8 preprocessing is done\n * unconditionally with a fixed file size, and the maximum window size is always\n * 2^15 bytes (equal to the size of each \"chunk\" in a compressed WIM resource).\n * This code is primarily intended to implement this form of LZX.  But although\n * not compatible with WIMGAPI, this code also supports maximum window sizes up\n * to 2^21 bytes.\n *\n * TODO: Add support for window sizes up to 2^25 bytes.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <string.h>\n\n#include \"wimlib/decompressor_ops.h\"\n#include \"wimlib/decompress_common.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/lzx_common.h\"\n#include \"wimlib/util.h\"\n\n/* These values are chosen for fast decompression.  */\n#define LZX_MAINCODE_TABLEBITS\t\t11\n#define LZX_LENCODE_TABLEBITS\t\t9\n#define LZX_PRECODE_TABLEBITS\t\t6\n#define LZX_ALIGNEDCODE_TABLEBITS\t7\n\n#define LZX_READ_LENS_MAX_OVERRUN 50\n\nPRAGMA_BEGIN_ALIGN(DECODE_TABLE_ALIGNMENT)\nstruct lzx_decompressor {\n\n\tDECODE_TABLE(maincode_decode_table, LZX_MAINCODE_MAX_NUM_SYMBOLS,\n\t\t     LZX_MAINCODE_TABLEBITS, LZX_MAX_MAIN_CODEWORD_LEN);\n\tu8 maincode_lens[LZX_MAINCODE_MAX_NUM_SYMBOLS + LZX_READ_LENS_MAX_OVERRUN];\n\n\tDECODE_TABLE(lencode_decode_table, LZX_LENCODE_NUM_SYMBOLS,\n\t\t     LZX_LENCODE_TABLEBITS, LZX_MAX_LEN_CODEWORD_LEN);\n\tu8 lencode_lens[LZX_LENCODE_NUM_SYMBOLS + LZX_READ_LENS_MAX_OVERRUN];\n\n\tunion {\n\t\tDECODE_TABLE(alignedcode_decode_table, LZX_ALIGNEDCODE_NUM_SYMBOLS,\n\t\t\t     LZX_ALIGNEDCODE_TABLEBITS, LZX_MAX_ALIGNED_CODEWORD_LEN);\n\t\tu8 alignedcode_lens[LZX_ALIGNEDCODE_NUM_SYMBOLS];\n\t};\n\n\tunion {\n\t\tDECODE_TABLE(precode_decode_table, LZX_PRECODE_NUM_SYMBOLS,\n\t\t\t     LZX_PRECODE_TABLEBITS, LZX_MAX_PRE_CODEWORD_LEN);\n\t\tu8 precode_lens[LZX_PRECODE_NUM_SYMBOLS];\n\t\tu8 extra_offset_bits[LZX_MAX_OFFSET_SLOTS];\n\t};\n\n\tunion {\n\t\tDECODE_TABLE_WORKING_SPACE(maincode_working_space,\n\t\t\t\t\t   LZX_MAINCODE_MAX_NUM_SYMBOLS,\n\t\t\t\t\t   LZX_MAX_MAIN_CODEWORD_LEN);\n\t\tDECODE_TABLE_WORKING_SPACE(lencode_working_space,\n\t\t\t\t\t   LZX_LENCODE_NUM_SYMBOLS,\n\t\t\t\t\t   LZX_MAX_LEN_CODEWORD_LEN);\n\t\tDECODE_TABLE_WORKING_SPACE(alignedcode_working_space,\n\t\t\t\t\t   LZX_ALIGNEDCODE_NUM_SYMBOLS,\n\t\t\t\t\t   LZX_MAX_ALIGNED_CODEWORD_LEN);\n\t\tDECODE_TABLE_WORKING_SPACE(precode_working_space,\n\t\t\t\t\t   LZX_PRECODE_NUM_SYMBOLS,\n\t\t\t\t\t   LZX_MAX_PRE_CODEWORD_LEN);\n\t};\n\n\tunsigned window_order;\n\tunsigned num_main_syms;\n\n\t/* Like lzx_extra_offset_bits[], but does not include the entropy-coded\n\t * bits of aligned offset blocks */\n\tu8 extra_offset_bits_minus_aligned[LZX_MAX_OFFSET_SLOTS];\n\n} PRAGMA_END_ALIGN(DECODE_TABLE_ALIGNMENT);\n\n/* Read a Huffman-encoded symbol using the precode. */\nstatic forceinline unsigned\nread_presym(const struct lzx_decompressor *d, struct input_bitstream *is)\n{\n\treturn read_huffsym(is, d->precode_decode_table,\n\t\t\t    LZX_PRECODE_TABLEBITS, LZX_MAX_PRE_CODEWORD_LEN);\n}\n\n/* Read a Huffman-encoded symbol using the main code. */\nstatic forceinline unsigned\nread_mainsym(const struct lzx_decompressor *d, struct input_bitstream *is)\n{\n\treturn read_huffsym(is, d->maincode_decode_table,\n\t\t\t    LZX_MAINCODE_TABLEBITS, LZX_MAX_MAIN_CODEWORD_LEN);\n}\n\n/* Read a Huffman-encoded symbol using the length code. */\nstatic forceinline unsigned\nread_lensym(const struct lzx_decompressor *d, struct input_bitstream *is)\n{\n\treturn read_huffsym(is, d->lencode_decode_table,\n\t\t\t    LZX_LENCODE_TABLEBITS, LZX_MAX_LEN_CODEWORD_LEN);\n}\n\n/* Read a Huffman-encoded symbol using the aligned offset code. */\nstatic forceinline unsigned\nread_alignedsym(const struct lzx_decompressor *d, struct input_bitstream *is)\n{\n\treturn read_huffsym(is, d->alignedcode_decode_table,\n\t\t\t    LZX_ALIGNEDCODE_TABLEBITS, LZX_MAX_ALIGNED_CODEWORD_LEN);\n}\n\n/*\n * Read a precode from the compressed input bitstream, then use it to decode\n * @num_lens codeword length values and write them to @lens.\n */\nstatic int\nlzx_read_codeword_lens(struct lzx_decompressor *d, struct input_bitstream *is,\n\t\t       u8 *lens, unsigned num_lens)\n{\n\tu8 *len_ptr = lens;\n\tu8 *lens_end = lens + num_lens;\n\n\t/* Read the lengths of the precode codewords.  These are stored\n\t * explicitly. */\n\tfor (int i = 0; i < LZX_PRECODE_NUM_SYMBOLS; i++) {\n\t\td->precode_lens[i] =\n\t\t\tbitstream_read_bits(is, LZX_PRECODE_ELEMENT_SIZE);\n\t}\n\n\t/* Build the decoding table for the precode. */\n\tif (make_huffman_decode_table(d->precode_decode_table,\n\t\t\t\t      LZX_PRECODE_NUM_SYMBOLS,\n\t\t\t\t      LZX_PRECODE_TABLEBITS,\n\t\t\t\t      d->precode_lens,\n\t\t\t\t      LZX_MAX_PRE_CODEWORD_LEN,\n\t\t\t\t      d->precode_working_space))\n\t\treturn -1;\n\n\t/* Decode the codeword lengths.  */\n\tdo {\n\t\tunsigned presym;\n\t\tu8 len;\n\n\t\t/* Read the next precode symbol.  */\n\t\tpresym = read_presym(d, is);\n\t\tif (presym < 17) {\n\t\t\t/* Difference from old length  */\n\t\t\tlen = *len_ptr - presym;\n\t\t\tif ((s8)len < 0)\n\t\t\t\tlen += 17;\n\t\t\t*len_ptr++ = len;\n\t\t} else {\n\t\t\t/* Special RLE values  */\n\n\t\t\tunsigned run_len;\n\n\t\t\tif (presym == 17) {\n\t\t\t\t/* Run of 0's  */\n\t\t\t\trun_len = 4 + bitstream_read_bits(is, 4);\n\t\t\t\tlen = 0;\n\t\t\t} else if (presym == 18) {\n\t\t\t\t/* Longer run of 0's  */\n\t\t\t\trun_len = 20 + bitstream_read_bits(is, 5);\n\t\t\t\tlen = 0;\n\t\t\t} else {\n\t\t\t\t/* Run of identical lengths  */\n\t\t\t\trun_len = 4 + bitstream_read_bits(is, 1);\n\t\t\t\tpresym = read_presym(d, is);\n\t\t\t\tif (unlikely(presym > 17))\n\t\t\t\t\treturn -1;\n\t\t\t\tlen = *len_ptr - presym;\n\t\t\t\tif ((s8)len < 0)\n\t\t\t\t\tlen += 17;\n\t\t\t}\n\n\t\t\tdo {\n\t\t\t\t*len_ptr++ = len;\n\t\t\t} while (--run_len);\n\t\t\t/*\n\t\t\t * The worst case overrun is when presym == 18,\n\t\t\t * run_len == 20 + 31, and only 1 length was remaining.\n\t\t\t * So LZX_READ_LENS_MAX_OVERRUN == 50.\n\t\t\t *\n\t\t\t * Overrun while reading the first half of maincode_lens\n\t\t\t * can corrupt the previous values in the second half.\n\t\t\t * This doesn't really matter because the resulting\n\t\t\t * lengths will still be in range, and data that\n\t\t\t * generates overruns is invalid anyway.\n\t\t\t */\n\t\t}\n\t} while (len_ptr < lens_end);\n\n\treturn 0;\n}\n\n/*\n * Read the header of an LZX block.  For all block types, the block type and\n * size is saved in *block_type_ret and *block_size_ret, respectively.  For\n * compressed blocks, the codeword lengths are also saved.  For uncompressed\n * blocks, the recent offsets queue is also updated.\n */\nstatic int\nlzx_read_block_header(struct lzx_decompressor *d, struct input_bitstream *is,\n\t\t      u32 recent_offsets[], int *block_type_ret,\n\t\t      u32 *block_size_ret)\n{\n\tint block_type;\n\tu32 block_size;\n\n\tbitstream_ensure_bits(is, 4);\n\n\t/* Read the block type. */\n\tblock_type = bitstream_pop_bits(is, 3);\n\n\t/* Read the block size. */\n\tif (bitstream_pop_bits(is, 1)) {\n\t\tblock_size = LZX_DEFAULT_BLOCK_SIZE;\n\t} else {\n\t\tblock_size = bitstream_read_bits(is, 16);\n\t\tif (d->window_order >= 16) {\n\t\t\tblock_size <<= 8;\n\t\t\tblock_size |= bitstream_read_bits(is, 8);\n\t\t}\n\t}\n\n\tswitch (block_type) {\n\n\tcase LZX_BLOCKTYPE_ALIGNED:\n\n\t\t/* Read the aligned offset codeword lengths. */\n\n\t\tfor (int i = 0; i < LZX_ALIGNEDCODE_NUM_SYMBOLS; i++) {\n\t\t\td->alignedcode_lens[i] =\n\t\t\t\tbitstream_read_bits(is,\n\t\t\t\t\t\t    LZX_ALIGNEDCODE_ELEMENT_SIZE);\n\t\t}\n\n\t\t/* Fall though, since the rest of the header for aligned offset\n\t\t * blocks is the same as that for verbatim blocks.  */\n\n\tcase LZX_BLOCKTYPE_VERBATIM:\n\n\t\t/* Read the main codeword lengths, which are divided into two\n\t\t * parts: literal symbols and match headers. */\n\n\t\tif (lzx_read_codeword_lens(d, is, d->maincode_lens,\n\t\t\t\t\t   LZX_NUM_CHARS))\n\t\t\treturn -1;\n\n\t\tif (lzx_read_codeword_lens(d, is, d->maincode_lens + LZX_NUM_CHARS,\n\t\t\t\t\t   d->num_main_syms - LZX_NUM_CHARS))\n\t\t\treturn -1;\n\n\n\t\t/* Read the length codeword lengths. */\n\n\t\tif (lzx_read_codeword_lens(d, is, d->lencode_lens,\n\t\t\t\t\t   LZX_LENCODE_NUM_SYMBOLS))\n\t\t\treturn -1;\n\n\t\tbreak;\n\n\tcase LZX_BLOCKTYPE_UNCOMPRESSED:\n\t\t/*\n\t\t * The header of an uncompressed block contains new values for\n\t\t * the recent offsets queue, starting on the next 16-bit\n\t\t * boundary in the bitstream.  Careful: if the stream is\n\t\t * *already* aligned, the correct thing to do is to throw away\n\t\t * the next 16 bits (this is probably a mistake in the format).\n\t\t */\n\t\tbitstream_ensure_bits(is, 1);\n\t\tbitstream_align(is);\n\t\trecent_offsets[0] = bitstream_read_u32(is);\n\t\trecent_offsets[1] = bitstream_read_u32(is);\n\t\trecent_offsets[2] = bitstream_read_u32(is);\n\n\t\t/* Offsets of 0 are invalid.  */\n\t\tif (recent_offsets[0] == 0 || recent_offsets[1] == 0 ||\n\t\t    recent_offsets[2] == 0)\n\t\t\treturn -1;\n\t\tbreak;\n\n\tdefault:\n\t\t/* Unrecognized block type.  */\n\t\treturn -1;\n\t}\n\n\t*block_type_ret = block_type;\n\t*block_size_ret = block_size;\n\treturn 0;\n}\n\n/* Decompress a block of LZX-compressed data. */\nstatic int\nlzx_decompress_block(struct lzx_decompressor *d, struct input_bitstream *_is,\n\t\t     int block_type, u32 block_size,\n\t\t     u8 * const out_begin, u8 *out_next, u32 recent_offsets[])\n{\n\t/*\n\t * Redeclare the input bitstream on the stack.  This shouldn't be\n\t * needed, but it can improve the main loop's performance significantly\n\t * with both gcc and clang, apparently because the compiler otherwise\n\t * gets confused and doesn't properly allocate registers for\n\t * 'is->bitbuf' et al. and/or thinks 'is->next' may point into 'is'.\n\t */\n\tstruct input_bitstream is_onstack = *_is;\n\tstruct input_bitstream *is = &is_onstack;\n\tu8 * const block_end = out_next + block_size;\n\tunsigned min_aligned_offset_slot;\n\n\t/*\n\t * Build the Huffman decode tables.  We always need to build the main\n\t * and length decode tables.  For aligned blocks we additionally need to\n\t * build the aligned offset decode table.\n\t */\n\n\tif (make_huffman_decode_table(d->maincode_decode_table,\n\t\t\t\t      d->num_main_syms,\n\t\t\t\t      LZX_MAINCODE_TABLEBITS,\n\t\t\t\t      d->maincode_lens,\n\t\t\t\t      LZX_MAX_MAIN_CODEWORD_LEN,\n\t\t\t\t      d->maincode_working_space))\n\t\treturn -1;\n\n\tif (make_huffman_decode_table(d->lencode_decode_table,\n\t\t\t\t      LZX_LENCODE_NUM_SYMBOLS,\n\t\t\t\t      LZX_LENCODE_TABLEBITS,\n\t\t\t\t      d->lencode_lens,\n\t\t\t\t      LZX_MAX_LEN_CODEWORD_LEN,\n\t\t\t\t      d->lencode_working_space))\n\t\treturn -1;\n\n\tif (block_type == LZX_BLOCKTYPE_ALIGNED) {\n\t\tif (make_huffman_decode_table(d->alignedcode_decode_table,\n\t\t\t\t\t      LZX_ALIGNEDCODE_NUM_SYMBOLS,\n\t\t\t\t\t      LZX_ALIGNEDCODE_TABLEBITS,\n\t\t\t\t\t      d->alignedcode_lens,\n\t\t\t\t\t      LZX_MAX_ALIGNED_CODEWORD_LEN,\n\t\t\t\t\t      d->alignedcode_working_space))\n\t\t\treturn -1;\n\t\tmin_aligned_offset_slot = LZX_MIN_ALIGNED_OFFSET_SLOT;\n\t\tmemcpy(d->extra_offset_bits, d->extra_offset_bits_minus_aligned,\n\t\t       sizeof(lzx_extra_offset_bits));\n\t} else {\n\t\tmin_aligned_offset_slot = LZX_MAX_OFFSET_SLOTS;\n\t\tmemcpy(d->extra_offset_bits, lzx_extra_offset_bits,\n\t\t       sizeof(lzx_extra_offset_bits));\n\t}\n\n\t/* Decode the literals and matches. */\n\n\tdo {\n\t\tunsigned mainsym;\n\t\tunsigned length;\n\t\tu32 offset;\n\t\tunsigned offset_slot;\n\n\t\tmainsym = read_mainsym(d, is);\n\t\tif (mainsym < LZX_NUM_CHARS) {\n\t\t\t/* Literal */\n\t\t\t*out_next++ = mainsym;\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* Match */\n\n\t\t/* Decode the length header and offset slot.  */\n\t\tSTATIC_ASSERT(LZX_NUM_CHARS % LZX_NUM_LEN_HEADERS == 0);\n\t\tlength = mainsym % LZX_NUM_LEN_HEADERS;\n\t\toffset_slot = (mainsym - LZX_NUM_CHARS) / LZX_NUM_LEN_HEADERS;\n\n\t\t/* If needed, read a length symbol to decode the full length. */\n\t\tif (length == LZX_NUM_PRIMARY_LENS)\n\t\t\tlength += read_lensym(d, is);\n\t\tlength += LZX_MIN_MATCH_LEN;\n\n\t\tif (offset_slot < LZX_NUM_RECENT_OFFSETS) {\n\t\t\t/* Repeat offset  */\n\n\t\t\t/* Note: This isn't a real LRU queue, since using the R2\n\t\t\t * offset doesn't bump the R1 offset down to R2. */\n\t\t\toffset = recent_offsets[offset_slot];\n\t\t\trecent_offsets[offset_slot] = recent_offsets[0];\n\t\t} else {\n\t\t\t/* Explicit offset  */\n\t\t\toffset = bitstream_read_bits(is, d->extra_offset_bits[offset_slot]);\n\t\t\tif (offset_slot >= min_aligned_offset_slot) {\n\t\t\t\toffset = (offset << LZX_NUM_ALIGNED_OFFSET_BITS) |\n\t\t\t\t\t read_alignedsym(d, is);\n\t\t\t}\n\t\t\toffset += lzx_offset_slot_base[offset_slot];\n\n\t\t\t/* Update the match offset LRU queue.  */\n\t\t\tSTATIC_ASSERT(LZX_NUM_RECENT_OFFSETS == 3);\n\t\t\trecent_offsets[2] = recent_offsets[1];\n\t\t\trecent_offsets[1] = recent_offsets[0];\n\t\t}\n\t\trecent_offsets[0] = offset;\n\n\t\t/* Validate the match and copy it to the current position.  */\n\t\tif (unlikely(lz_copy(length, offset, out_begin,\n\t\t\t\t     out_next, block_end, LZX_MIN_MATCH_LEN)))\n\t\t\treturn -1;\n\t\tout_next += length;\n\t} while (out_next != block_end);\n\n\t*_is = is_onstack;\n\treturn 0;\n}\n\nstatic int\nlzx_decompress(const void *restrict compressed_data, size_t compressed_size,\n\t       void *restrict uncompressed_data, size_t uncompressed_size,\n\t       void *restrict _d)\n{\n\tstruct lzx_decompressor *d = _d;\n\tu8 * const out_begin = uncompressed_data;\n\tu8 *out_next = out_begin;\n\tu8 * const out_end = out_begin + uncompressed_size;\n\tstruct input_bitstream is;\n\tSTATIC_ASSERT(LZX_NUM_RECENT_OFFSETS == 3);\n\tu32 recent_offsets[LZX_NUM_RECENT_OFFSETS] = {1, 1, 1};\n\tunsigned may_have_e8_byte = 0;\n\n\tinit_input_bitstream(&is, compressed_data, compressed_size);\n\n\t/* Codeword lengths begin as all 0's for delta encoding purposes. */\n\tmemset(d->maincode_lens, 0, d->num_main_syms);\n\tmemset(d->lencode_lens, 0, LZX_LENCODE_NUM_SYMBOLS);\n\n\t/* Decompress blocks until we have all the uncompressed data. */\n\n\twhile (out_next != out_end) {\n\t\tint block_type;\n\t\tu32 block_size;\n\n\t\tif (lzx_read_block_header(d, &is, recent_offsets,\n\t\t\t\t\t  &block_type, &block_size))\n\t\t\treturn -1;\n\n\t\tif (block_size < 1 || block_size > out_end - out_next)\n\t\t\treturn -1;\n\n\t\tif (likely(block_type != LZX_BLOCKTYPE_UNCOMPRESSED)) {\n\n\t\t\t/* Compressed block */\n\t\t\tif (lzx_decompress_block(d, &is, block_type, block_size,\n\t\t\t\t\t\t out_begin, out_next,\n\t\t\t\t\t\t recent_offsets))\n\t\t\t\treturn -1;\n\n\t\t\t/* If the first E8 byte was in this block, then it must\n\t\t\t * have been encoded as a literal using mainsym E8. */\n\t\t\tmay_have_e8_byte |= d->maincode_lens[0xE8];\n\t\t} else {\n\n\t\t\t/* Uncompressed block */\n\t\t\tif (bitstream_read_bytes(&is, out_next, block_size))\n\t\t\t\treturn -1;\n\n\t\t\t/* Re-align the bitstream if needed. */\n\t\t\tif (block_size & 1)\n\t\t\t\tbitstream_read_byte(&is);\n\n\t\t\t/* There may have been an E8 byte in the block. */\n\t\t\tmay_have_e8_byte = 1;\n\t\t}\n\t\tout_next += block_size;\n\t}\n\n\t/* Postprocess the data unless it cannot possibly contain E8 bytes. */\n\tif (may_have_e8_byte)\n\t\tlzx_postprocess(uncompressed_data, uncompressed_size);\n\n\treturn 0;\n}\n\nstatic int\nlzx_create_decompressor(size_t max_block_size, void **d_ret)\n{\n\tunsigned window_order;\n\tstruct lzx_decompressor *d;\n\n\twindow_order = lzx_get_window_order(max_block_size);\n\tif (window_order == 0)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\td = ALIGNED_MALLOC(sizeof(*d), DECODE_TABLE_ALIGNMENT);\n\tif (!d)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\td->window_order = window_order;\n\td->num_main_syms = lzx_get_num_main_syms(window_order);\n\n\t/* Initialize 'd->extra_offset_bits_minus_aligned'. */\n\tSTATIC_ASSERT(sizeof(d->extra_offset_bits_minus_aligned) ==\n\t\t      sizeof(lzx_extra_offset_bits));\n\tSTATIC_ASSERT(sizeof(d->extra_offset_bits) ==\n\t\t      sizeof(lzx_extra_offset_bits));\n\tmemcpy(d->extra_offset_bits_minus_aligned, lzx_extra_offset_bits,\n\t       sizeof(lzx_extra_offset_bits));\n\tfor (unsigned offset_slot = LZX_MIN_ALIGNED_OFFSET_SLOT;\n\t     offset_slot < LZX_MAX_OFFSET_SLOTS; offset_slot++)\n\t{\n\t\td->extra_offset_bits_minus_aligned[offset_slot] -=\n\t\t\t\tLZX_NUM_ALIGNED_OFFSET_BITS;\n\t}\n\n\t*d_ret = d;\n\treturn 0;\n}\n\nstatic void\nlzx_free_decompressor(void *_d)\n{\n\tALIGNED_FREE(_d);\n}\n\nconst struct decompressor_ops lzx_decompressor_ops = {\n\t.create_decompressor = lzx_create_decompressor,\n\t.decompress\t     = lzx_decompress,\n\t.free_decompressor   = lzx_free_decompressor,\n};\n"
  },
  {
    "path": "src/wimlib/metadata_resource.c",
    "content": "/*\n * metadata_resource.c\n */\n\n/*\n * Copyright 2012-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/resource.h\"\n#include \"wimlib/security.h\"\n#include \"wimlib/write.h\"\n\n/* Fix the security ID for every inode to be either -1 or in bounds.  */\nstatic void\nfix_security_ids(struct wim_image_metadata *imd, const u32 num_entries)\n{\n\tstruct wim_inode *inode;\n\tunsigned long invalid_count = 0;\n\n\timage_for_each_inode(inode, imd) {\n\t\tif ((u32)inode->i_security_id >= num_entries) {\n\t\t\tif (inode->i_security_id >= 0)\n\t\t\t\tinvalid_count++;\n\t\t\tinode->i_security_id = -1;\n\t\t}\n\t}\n\tif (invalid_count)\n\t\tWARNING(\"%lu inodes had invalid security IDs\", invalid_count);\n}\n\n/*\n * Reads and parses a metadata resource for an image in the WIM file.\n *\n * @imd:\n *\tPointer to the image metadata structure for the image whose metadata\n *\tresource we are reading.  Its `metadata_blob' member specifies the blob\n *\ttable entry for the metadata resource.  The rest of the image metadata\n *\tentry will be filled in by this function.\n *\n * Return values:\n *\tWIMLIB_ERR_SUCCESS (0)\n *\tWIMLIB_ERR_INVALID_METADATA_RESOURCE\n *\tWIMLIB_ERR_NOMEM\n *\tWIMLIB_ERR_READ\n *\tWIMLIB_ERR_UNEXPECTED_END_OF_FILE\n *\tWIMLIB_ERR_DECOMPRESSION\n */\nint\nread_metadata_resource(struct wim_image_metadata *imd)\n{\n\tconst struct blob_descriptor *metadata_blob;\n\tvoid *buf;\n\tint ret;\n\tu8 hash[SHA1_HASH_SIZE];\n\tstruct wim_security_data *sd;\n\tstruct wim_dentry *root;\n\n\tmetadata_blob = imd->metadata_blob;\n\n\t/*\n\t * Prevent huge memory allocations when processing fuzzed files.  The\n\t * case of metadata resources is tough, since a metadata resource can\n\t * legitimately decompress to many times the size of the WIM file\n\t * itself, e.g. in the case of an image containing many empty files with\n\t * similar long filenames.  Arbitrarily choose 512x as a generous limit.\n\t */\n\tif (metadata_blob->blob_location == BLOB_IN_WIM &&\n\t    metadata_blob->rdesc->wim->file_size > 0 &&\n\t    metadata_blob->size / 512 > metadata_blob->rdesc->wim->file_size)\n\t\treturn WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\n\t/* Read the metadata resource into memory.  (It may be compressed.)  */\n\tret = read_blob_into_alloc_buf(metadata_blob, &buf);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Checksum the metadata resource.  */\n\tsha1(buf, metadata_blob->size, hash);\n\tif (!hashes_equal(metadata_blob->hash, hash)) {\n\t\tERROR(\"Metadata resource is corrupted \"\n\t\t      \"(invalid SHA-1 message digest)!\");\n\t\tret = WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\t\tgoto out_free_buf;\n\t}\n\n\t/* Parse the metadata resource.\n\t *\n\t * Notes: The metadata resource consists of the security data, followed\n\t * by the directory entry for the root directory, followed by all the\n\t * other directory entries in the filesystem.  The subdir offset field\n\t * of each directory entry gives the start of its child entries from the\n\t * beginning of the metadata resource.  An end-of-directory is signaled\n\t * by a directory entry of length '0', really of length 8, because\n\t * that's how long the 'length' field is.  */\n\n\tret = read_wim_security_data(buf, metadata_blob->size, &sd);\n\tif (ret)\n\t\tgoto out_free_buf;\n\n\tret = read_dentry_tree(buf, metadata_blob->size, sd->total_length, &root);\n\tif (ret)\n\t\tgoto out_free_security_data;\n\n\t/* We have everything we need from the buffer now.  */\n\tFREE(buf);\n\tbuf = NULL;\n\n\t/* Calculate and validate inodes.  */\n\n\tret = dentry_tree_fix_inodes(root, &imd->inode_list);\n\tif (ret)\n\t\tgoto out_free_dentry_tree;\n\n\tfix_security_ids(imd, sd->num_entries);\n\n\t/* Success; fill in the image_metadata structure.  */\n\timd->root_dentry = root;\n\timd->security_data = sd;\n\tINIT_LIST_HEAD(&imd->unhashed_blobs);\n\treturn 0;\n\nout_free_dentry_tree:\n\tfree_dentry_tree(root, NULL);\nout_free_security_data:\n\tfree_wim_security_data(sd);\nout_free_buf:\n\tFREE(buf);\n\treturn ret;\n}\n\nstatic void\nrecalculate_security_data_length(struct wim_security_data *sd)\n{\n\tu32 total_length = sizeof(u64) * sd->num_entries + 2 * sizeof(u32);\n\tfor (u32 i = 0; i < sd->num_entries; i++)\n\t\ttotal_length += sd->sizes[i];\n\tsd->total_length = ALIGN(total_length, 8);\n}\n\nstatic int\nprepare_metadata_resource(WIMStruct *wim, int image,\n\t\t\t  u8 **buf_ret, size_t *len_ret)\n{\n\tu8 *buf;\n\tu8 *p;\n\tint ret;\n\tu64 subdir_offset;\n\tstruct wim_dentry *root;\n\tsize_t len;\n\tstruct wim_security_data *sd;\n\tstruct wim_image_metadata *imd;\n\n\tret = select_wim_image(wim, image);\n\tif (ret)\n\t\treturn ret;\n\n\timd = wim->image_metadata[image - 1];\n\n\troot = imd->root_dentry;\n\tsd = imd->security_data;\n\n\tif (!root) {\n\t\t/* Empty image; create a dummy root.  */\n\t\tret = new_filler_directory(&root);\n\t\tif (ret)\n\t\t\treturn ret;\n\t\timd->root_dentry = root;\n\t}\n\n\t/* The offset of the first child of the root dentry is equal to the\n\t * total length of the security data, plus the total length of the root\n\t * dentry, plus 8 bytes for an end-of-directory entry following the root\n\t * dentry (shouldn't really be needed, but just in case...)  */\n\trecalculate_security_data_length(sd);\n\tsubdir_offset = sd->total_length + dentry_out_total_length(root) + 8;\n\n\t/* Calculate the subdirectory offsets for the entire dentry tree.  */\n\tcalculate_subdir_offsets(root, &subdir_offset);\n\n\t/* Total length of the metadata resource (uncompressed).  */\n\tlen = subdir_offset;\n\n\t/* Allocate a buffer to contain the uncompressed metadata resource.  */\n\tbuf = NULL;\n\tif (likely(len == subdir_offset))\n\t\tbuf = MALLOC(len);\n\tif (!buf) {\n\t\tERROR(\"Failed to allocate %\"PRIu64\" bytes for \"\n\t\t      \"metadata resource\", subdir_offset);\n\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\t/* Write the security data into the resource buffer.  */\n\tp = write_wim_security_data(sd, buf);\n\n\t/* Write the dentry tree into the resource buffer.  */\n\tp = write_dentry_tree(root, p);\n\n\t/* We MUST have exactly filled the buffer; otherwise we calculated its\n\t * size incorrectly or wrote the data incorrectly.  */\n\twimlib_assert(p - buf == len);\n\n\t*buf_ret = buf;\n\t*len_ret = len;\n\treturn 0;\n}\n\nint\nwrite_metadata_resource(WIMStruct *wim, int image, int write_resource_flags)\n{\n\tint ret;\n\tu8 *buf;\n\tsize_t len;\n\tstruct wim_image_metadata *imd;\n\n\tret = prepare_metadata_resource(wim, image, &buf, &len);\n\tif (ret)\n\t\treturn ret;\n\n\timd = wim->image_metadata[image - 1];\n\n\t/* Write the metadata resource to the output WIM using the proper\n\t * compression type, in the process updating the blob descriptor for the\n\t * metadata resource.  */\n\tret = write_wim_resource_from_buffer(buf,\n\t\t\t\t\t     len,\n\t\t\t\t\t     true,\n\t\t\t\t\t     &wim->out_fd,\n\t\t\t\t\t     wim->out_compression_type,\n\t\t\t\t\t     wim->out_chunk_size,\n\t\t\t\t\t     &imd->metadata_blob->out_reshdr,\n\t\t\t\t\t     imd->metadata_blob->hash,\n\t\t\t\t\t     write_resource_flags);\n\n\tFREE(buf);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/wimlib/pathlist.c",
    "content": "/*\n * pathlist.c\n *\n * Utility function for reading path list files.\n */\n\n/*\n * Copyright (C) 2013 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/pathlist.h\"\n#include \"wimlib/textfile.h\"\n\nint\nread_path_list_file(const tchar *listfile,\n\t\t    tchar ***paths_ret, size_t *num_paths_ret,\n\t\t    void **mem_ret)\n{\n\tSTRING_LIST(paths);\n\tstruct text_file_section tmp = {\n\t\t.name = T(\"\"),\n\t\t.strings = &paths,\n\t};\n\tvoid *buf;\n\tint ret;\n\n\tret = load_text_file(listfile, NULL, 0, &buf, &tmp, 1,\n\t\t\t     LOAD_TEXT_FILE_REMOVE_QUOTES |\n\t\t\t     LOAD_TEXT_FILE_ALLOW_STDIN, NULL);\n\tif (ret)\n\t\treturn ret;\n\n\t*paths_ret = paths.strings;\n\t*num_paths_ret = paths.num_strings;\n\t*mem_ret = buf;\n\treturn 0;\n}\n"
  },
  {
    "path": "src/wimlib/paths.c",
    "content": "/*\n * paths.c - Path manipulation routines\n */\n\n/*\n * Copyright (C) 2012, 2013 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <string.h>\n\n#include \"wimlib.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/util.h\"\n\n/* Like the basename() function, but does not modify @path; it just returns a\n * pointer to it.  This assumes the path separator is the\n * OS_PREFERRED_PATH_SEPARATOR.  */\nconst tchar *\npath_basename(const tchar *path)\n{\n\treturn path_basename_with_len(path, tstrlen(path));\n}\n\n/* Like path_basename(), but take an explicit string length.  */\nconst tchar *\npath_basename_with_len(const tchar *path, size_t len)\n{\n\tconst tchar *p = &path[len];\n\n\tdo {\n\t\tif (p == path)\n\t\t\treturn &path[len];\n\t} while (*--p == OS_PREFERRED_PATH_SEPARATOR);\n\n\tdo {\n\t\tif (p == path)\n\t\t\treturn &path[0];\n\t} while (*--p != OS_PREFERRED_PATH_SEPARATOR);\n\n\treturn ++p;\n}\n\n\n/* Returns a pointer to the part of @path following the first colon in the last\n * path component, or NULL if the last path component does not contain a colon\n * or has no characters following the first colon.  */\nconst tchar *\npath_stream_name(const tchar *path)\n{\n\tconst tchar *base = path_basename(path);\n\tconst tchar *stream_name = tstrchr(base, T(':'));\n\tif (stream_name == NULL || *(stream_name + 1) == T('\\0'))\n\t\treturn NULL;\n\telse\n\t\treturn stream_name + 1;\n}\n\n/* Collapse and translate path separators, and strip trailing slashes.  Doesn't\n * add or delete a leading slash.\n *\n * @in may alias @out.\n */\nvoid\ndo_canonicalize_path(const tchar *in, tchar *out)\n{\n\ttchar *orig_out = out;\n\n\twhile (*in) {\n\t\tif (is_any_path_separator(*in)) {\n\t\t\t/* Collapse multiple path separators into one  */\n\t\t\t*out++ = WIM_PATH_SEPARATOR;\n\t\t\tdo {\n\t\t\t\tin++;\n\t\t\t} while (is_any_path_separator(*in));\n\t\t} else {\n\t\t\t/* Copy non-path-separator character  */\n\t\t\t*out++ = *in++;\n\t\t}\n\t}\n\n\t/* Remove trailing slash if existent  */\n\tif (out - orig_out > 1 && *(out - 1) == WIM_PATH_SEPARATOR)\n\t\t--out;\n\n\t*out = T('\\0');\n}\n\n/*\n * canonicalize_wim_path() - Given a user-provided path to a file within a WIM\n * image, translate it into a \"canonical\" path.\n *\n * - Translate both types of slash into a consistent type (WIM_PATH_SEPARATOR).\n * - Collapse path separators.\n * - Add leading slash if missing.\n * - Strip trailing slashes.\n *\n * Examples (with WIM_PATH_SEPARATOR == '/'):\n *\n *\t\t=> /\t\t[ either NULL or empty string ]\n * /\t\t=> /\n * \\\t\t=> /\n * hello\t=> /hello\n * \\hello\t=> /hello\n * \\hello\t=> /hello\n * /hello/\t=> /hello\n * \\hello/\t=> /hello\n * /hello//1\t=> /hello/1\n * \\\\hello\\\\1\\\\\t=> /hello/1\n */\ntchar *\ncanonicalize_wim_path(const tchar *wim_path)\n{\n\tconst tchar *in;\n\ttchar *out;\n\ttchar *result;\n\n\tin = wim_path;\n\tif (!in)\n\t\tin = T(\"\");\n\n\tresult = MALLOC((1 + tstrlen(in) + 1) * sizeof(result[0]));\n\tif (!result)\n\t\treturn NULL;\n\n\tout = result;\n\n\t/* Add leading slash if missing  */\n\tif (!is_any_path_separator(*in))\n\t\t*out++ = WIM_PATH_SEPARATOR;\n\n\tdo_canonicalize_path(in, out);\n\n\treturn result;\n}\n"
  },
  {
    "path": "src/wimlib/pattern.c",
    "content": "/*\n * pattern.c\n *\n * Wildcard pattern matching functions.\n */\n\n/*\n * Copyright (C) 2013, 2015 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <ctype.h>\n\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/pattern.h\"\n\nstatic bool\nstring_matches_pattern(const tchar *string, const tchar * const string_end,\n\t\t       const tchar *pattern, const tchar * const pattern_end)\n{\n\tfor (; string != string_end; string++, pattern++) {\n\t\tif (pattern == pattern_end)\n\t\t\treturn false;\n\t\tif (*pattern == T('*')) {\n\t\t\treturn string_matches_pattern(string, string_end,\n\t\t\t\t\t\t      pattern + 1, pattern_end) ||\n\t\t\t       string_matches_pattern(string + 1, string_end,\n\t\t\t\t\t\t      pattern, pattern_end);\n\t\t}\n\t\tif (*string != *pattern && *pattern != T('?') &&\n\t\t    !(default_ignore_case &&\n\t\t      totlower(*string) == totlower(*pattern)))\n\t\t\treturn false;\n\t}\n\n\twhile (pattern != pattern_end && *pattern == T('*'))\n\t\tpattern++;\n\treturn pattern == pattern_end;\n}\n\n/* Advance past zero or more path separators.  */\nstatic const tchar *\nadvance_to_next_component(const tchar *p)\n{\n\twhile (*p == WIM_PATH_SEPARATOR)\n\t\tp++;\n\treturn p;\n}\n\n/* Advance past a nonempty path component.  */\nstatic const tchar *\nadvance_through_component(const tchar *p)\n{\n\tdo {\n\t\tp++;\n\t} while (*p && *p != WIM_PATH_SEPARATOR);\n\treturn p;\n}\n\n/*\n * Determine whether a path matches a wildcard pattern.\n *\n * @path\n *\tThe null-terminated path string to match.\n * @pattern\n *\tThe null-terminated wildcard pattern to match.  It can contain the\n *\twildcard characters '*' (which matches zero or more characters) and '?'\n *\t(which matches any single character).  If there is no leading path\n *\tseparator, then the match is attempted with the filename component of\n *\t@path only; otherwise, the match is attempted with the entire @path.\n * @match_flags\n *\tMATCH_* flags, see the flag definitions.\n *\n * @path and @pattern can both contain path separators (character\n * WIM_PATH_SEPARATOR).  Leading and trailing path separators are not\n * significant, except when determining whether to match only the filename\n * component as noted above.  The lengths of interior path separator sequences\n * are not significant.  The '*' and '?' characters act within a single path\n * component only (they do not match path separators).\n *\n * Matching is done with the default case sensitivity behavior.\n *\n * Returns %true iff the path matched the pattern.\n */\nbool\nmatch_path(const tchar *path, const tchar *pattern, int match_flags)\n{\n\t/* Filename only?  */\n\tif (*pattern != WIM_PATH_SEPARATOR)\n\t\tpath = path_basename(path);\n\n\tfor (;;) {\n\t\tconst tchar *path_component_end;\n\t\tconst tchar *pattern_component_end;\n\n\t\tpath = advance_to_next_component(path);\n\t\tpattern = advance_to_next_component(pattern);\n\n\t\t/* Is the pattern exhausted?  */\n\t\tif (!*pattern)\n\t\t\treturn !*path || (match_flags & MATCH_RECURSIVELY);\n\n\t\t/* Is the path exhausted (but not the pattern)?  */\n\t\tif (!*path)\n\t\t\treturn (match_flags & MATCH_ANCESTORS);\n\n\t\tpath_component_end = advance_through_component(path);\n\t\tpattern_component_end = advance_through_component(pattern);\n\n\t\t/* Do the components match?  */\n\t\tif (!string_matches_pattern(path, path_component_end,\n\t\t\t\t\t    pattern, pattern_component_end))\n\t\t\treturn false;\n\n\t\tpath = path_component_end;\n\t\tpattern = pattern_component_end;\n\t}\n}\n\n/*\n * Expand a path pattern in an in-memory tree of dentries.\n *\n * @root\n *\tThe root of the directory tree in which to expand the pattern.\n * @pattern\n *\tThe path pattern to expand, which may contain the '*' and '?' wildcard\n *\tcharacters.  Path separators must be WIM_PATH_SEPARATOR.  Leading and\n *\ttrailing path separators are ignored.  The default case sensitivity\n *\tbehavior is used.\n * @consume_dentry\n *\tA callback function which will receive each matched directory entry.\n * @ctx\n *\tOpaque context argument for @consume_dentry.\n *\n * @return 0 on success; a positive error code on failure; or the first nonzero\n * value returned by @consume_dentry.\n */\nint\nexpand_path_pattern(struct wim_dentry *root, const tchar *pattern,\n\t\t    int (*consume_dentry)(struct wim_dentry *, void *),\n\t\t    void *ctx)\n{\n\tconst tchar *pattern_component_end;\n\tstruct wim_dentry *child;\n\n\tif (!root)\n\t\treturn 0;\n\n\tpattern = advance_to_next_component(pattern);\n\n\t/* If there are no more components, then 'root' is matched.  */\n\tif (!*pattern)\n\t\treturn (*consume_dentry)(root, ctx);\n\n\tpattern_component_end = advance_through_component(pattern);\n\n\t/* For each child dentry that matches the current pattern component,\n\t * recurse with the remainder of the pattern.  */\n\tfor_dentry_child(child, root) {\n\t\tconst tchar *name;\n\t\tsize_t name_nbytes;\n\t\tint ret;\n\n\t\tret = utf16le_get_tstr(child->d_name, child->d_name_nbytes,\n\t\t\t\t       &name, &name_nbytes);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tif (string_matches_pattern(name, &name[name_nbytes / sizeof(tchar)],\n\t\t\t\t\t   pattern, pattern_component_end))\n\t\t\tret = expand_path_pattern(child, pattern_component_end,\n\t\t\t\t\t\t  consume_dentry, ctx);\n\t\tutf16le_put_tstr(name);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n"
  },
  {
    "path": "src/wimlib/progress.c",
    "content": "/*\n * progress.c\n */\n\n/*\n * Copyright (C) 2014 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/progress.h\"\n\nint\nreport_error(wimlib_progress_func_t progfunc,\n\t     void *progctx, int error_code, const tchar *path)\n{\n\tint ret;\n\tunion wimlib_progress_info progress;\n\ttchar *cookie;\n\n\tif (error_code == WIMLIB_ERR_SUCCESS ||\n\t    error_code == WIMLIB_ERR_ABORTED_BY_PROGRESS ||\n\t    error_code == WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS)\n\t\treturn error_code;\n\n\tprogress.handle_error.path = path;\n\tprogress.handle_error.error_code = error_code;\n\tprogress.handle_error.will_ignore = false;\n\n\tcookie = progress_get_win32_path(path);\n\n\tret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_HANDLE_ERROR,\n\t\t\t    &progress, progctx);\n\n\tprogress_put_win32_path(cookie);\n\n\tif (ret)\n\t\treturn ret;\n\n\tif (!progress.handle_error.will_ignore)\n\t\treturn error_code;\n\n\treturn 0;\n}\n"
  },
  {
    "path": "src/wimlib/registry.c",
    "content": "/*\n * registry.c\n *\n * Extract information from Windows NT registry hives.\n */\n\n/*\n * Copyright (C) 2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <string.h>\n\n#include \"wimlib/encoding.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/registry.h\"\n#include \"wimlib/util.h\"\n\n/* Registry hive file header  */\nstruct regf {\n#define REGF_MAGIC\t\tcpu_to_le32(0x66676572)\t/* \"regf\" */\n\tle32 magic;\n\tle32 f1[4];\n#define REGF_MAJOR\t\tcpu_to_le32(1)\n\tle32 major_version;\n\tle32 minor_version;\n\tle32 f2[2];\n\tle32 root_key_offset;\t\t/* Offset, in hbin area, to root nk  */\n\tle32 total_hbin_size;\t\t/* Total size of all hbins  */\n\tle32 f3[1013];\n\tu8 hbin_area[0];\t\t/* Start of hbin area  */\n} __attribute__((packed));\n\n\n/* Cell header  */\nstruct cell {\n\t/* The cell size in bytes, negated for in-use cells  */\n\tle32 size;\n\n\t/* Magic characters which identify the cell type  */\n\tle16 magic;\n} __attribute__((packed));\n\n/* NK cell - represents a registry key  */\nstruct nk {\n#define NK_MAGIC\t\tcpu_to_le16(0x6B6E)\t/* \"nk\"\t*/\n\tstruct cell base;\n#define NK_COMPRESSED_NAME\tcpu_to_le16(0x0020)\n\tle16 flags;\n\tle64 unknown_0x08;\n\tle32 unknown_0x10;\n\tle32 parent_offset;\n\tle32 num_subkeys;\n\tle32 unknown_0x1C;\n\tle32 subkey_list_offset;\n\tle32 unknown_0x24;\n\tle32 num_values;\n\tle32 value_list_offset;\n\tle32 unknown_0x30;\n\tle32 unknown_0x34;\n\tle16 unknown_0x38;\n\tle16 unknown_0x3A;\n\tle32 unknown_0x3C;\n\tle32 unknown_0x40;\n\tle32 unknown_0x44;\n\tle32 unknown_0x48;\n\tle16 name_size;\n\tle16 unknown_0x4E;\n\tchar name[0];\n} __attribute__((packed));\n\n/* Subkey list cell.  There are four types.  LF, LH, and LI cells reference\n * subkey NK cells directly, while RI cells reference other subkey lists.  All\n * contain a count followed by that many 32-bit offsets.  But LF and LH cells\n * contain a 32-bit hash along with each offset, while LI and RI cells only\n * contain offsets.  */\nstruct subkey_list {\n#define LF_MAGIC\tcpu_to_le16(0x666C)\t/* \"lf\"\t*/\n#define LH_MAGIC\tcpu_to_le16(0x686C)\t/* \"lh\"\t*/\n#define LI_MAGIC\tcpu_to_le16(0x696C)\t/* \"li\" */\n#define RI_MAGIC\tcpu_to_le16(0x6972)\t/* \"ri\" */\n\tstruct cell base;\n\tle16 num_offsets;\n\tle32 elements[0];\n} __attribute__((packed));\n\n/* Value list cell - contains a list of value references  */\nstruct value_list {\n\tle32 size;\n\tle32 vk_offsets[0];\n} __attribute__((packed));\n\n/* VK cell - contains a value's data, or a reference to it  */\nstruct vk {\n#define VK_MAGIC\t\t\tcpu_to_le16(0x6B76)\n\tstruct cell base;\n\tle16 name_size;\n\tle32 data_size;\n\tle32 data_offset;\n#ifndef _WIN32\n#define REG_NONE\t\t\tcpu_to_le32(0)\n#define REG_SZ\t\t\t\tcpu_to_le32(1)\n#define REG_EXPAND_SZ\t\t\tcpu_to_le32(2)\n#define REG_BINARY\t\t\tcpu_to_le32(3)\n#define REG_DWORD\t\t\tcpu_to_le32(4)\n#define REG_DWORD_LITTLE_ENDIAN\t\tcpu_to_le32(4)\n#define REG_DWORD_BIG_ENDIAN\t\tcpu_to_le32(5)\n#define REG_LINK\t\t\tcpu_to_le32(6)\n#define REG_MULTI_SZ\t\t\tcpu_to_le32(7)\n#define REG_RESOURCE_LIST\t\tcpu_to_le32(8)\n#define REG_FULL_RESOURCE_DESCRIPTOR\tcpu_to_le32(9)\n#define REG_RESOURCE_REQUIREMENTS_LIST\tcpu_to_le32(10)\n#define REG_QWORD\t\t\tcpu_to_le32(11)\n#define REG_QWORD_LITTLE_ENDIAN\t\tcpu_to_le32(11)\n#endif\n\tle32 data_type;\n#define VK_COMPRESSED_NAME\t\tcpu_to_le16(0x0001)\n\tle16 flags;\n\tle16 unknown_0x16;\n\tchar name[0];\n};\n\n/* Data cell - contains a value's data  */\nstruct data_cell {\n\tle32 size;\n\tu8 data[0];\n};\n\n/* Arbitrary limits for safety  */\n#define MAX_VALUES\t\t65536\n#define MAX_VALUE_SIZE\t\t1048576\n#define MAX_SUBKEYS\t\t65536\n#define MAX_SUBKEY_LIST_LEVELS\t5\n#define MAX_SUBKEY_LISTS\t4096\n\nstatic enum hive_status\ntranslate_wimlib_error(int ret)\n{\n\tif (likely(!ret))\n\t\treturn HIVE_OK;\n\tif (ret == WIMLIB_ERR_NOMEM)\n\t\treturn HIVE_OUT_OF_MEMORY;\n\treturn HIVE_UNSUPPORTED;\n}\n\n/* Compare a UTF-16LE name with a key or value name in the registry.  The\n * comparison is case insensitive.  */\nstatic inline bool\nnames_equal(const utf16lechar *name, size_t name_nchars,\n\t    const void *disk_name, size_t disk_name_size,\n\t    bool compressed)\n{\n\tif (compressed) {\n\t\t/* ISO-8859-1 (LATIN1) on-disk  */\n\t\tconst u8 *p = disk_name;\n\t\tif (disk_name_size != name_nchars)\n\t\t\treturn false;\n\t\tfor (size_t i = 0; i < name_nchars; i++)\n\t\t\tif (upcase[le16_to_cpu(name[i])] != upcase[p[i]])\n\t\t\t\treturn false;\n\t\treturn true;\n\t} else {\n\t\t/* UTF-16LE on disk  */\n\t\tdisk_name_size /= 2;\n\t\tif (disk_name_size != name_nchars)\n\t\t\treturn false;\n\t\treturn !cmp_utf16le_strings(name, name_nchars,\n\t\t\t\t\t    disk_name, disk_name_size, true);\n\t}\n}\n\n/* Get a pointer to a cell, with alignment and bounds checking.  Returns NULL if\n * the requested information does not specify a properly aligned, sized, and\n * in-use cell.  */\nstatic const void *\nget_cell_pointer(const struct regf *regf, le32 offset, size_t wanted_size)\n{\n\tu32 total = le32_to_cpu(regf->total_hbin_size);\n\tu32 offs = le32_to_cpu(offset);\n\tconst struct cell *cell;\n\tu32 actual_size;\n\n\tif ((offs > total) || (offs & 7) || (wanted_size > total - offs))\n\t\treturn NULL;\n\n\tcell = (const struct cell *)&regf->hbin_area[offs];\n\tactual_size = -le32_to_cpu(cell->size);\n\tif (actual_size > INT32_MAX) /* Cell unused, or size was INT32_MIN?  */\n\t\treturn NULL;\n\tif (wanted_size > actual_size) /* Cell too small?  */\n\t\treturn NULL;\n\treturn cell;\n}\n\n/* Revalidate the cell with its full length.  Returns true iff the cell is\n * valid.  */\nstatic bool\nrevalidate_cell(const struct regf *regf, le32 offset, size_t wanted_size)\n{\n\treturn get_cell_pointer(regf, offset, wanted_size) != NULL;\n}\n\nstruct subkey_iteration_stats {\n\n\t/* The number of additional levels of descendent subkey lists that may\n\t * be visited (currently, i.e. at this point in the iteration) before\n\t * our safety limit of MAX_SUBKEY_LIST_LEVELS is reached  */\n\tu32 levels_remaining;\n\n\t/* The number of additional subkey lists that may be visited until our\n\t * safety limit of MAX_SUBKEY_LISTS is reached  */\n\tu32 subkey_lists_remaining;\n\n\t/* The number of subkeys remaining to be found.  Since the number of\n\t * subkeys is known from the parent nk cell, this should be 0 at the end\n\t * of the iteration.  */\n\tu32 subkeys_remaining;\n};\n\ntypedef enum hive_status (*subkey_cb_t)(const struct nk *, void *);\n\nstatic enum hive_status\niterate_subkeys_recursive(const struct regf *regf, le32 subkey_list_offset,\n\t\t\t  subkey_cb_t cb, void *cb_ctx,\n\t\t\t  struct subkey_iteration_stats *stats)\n{\n\tconst struct subkey_list *list;\n\tunsigned num_offsets;\n\tsize_t extra_size;\n\tunsigned increment;\n\tsize_t i = 0;\n\tenum hive_status status;\n\n\tif (stats->levels_remaining == 0 || stats->subkey_lists_remaining == 0)\n\t\treturn HIVE_CORRUPT;\n\n\tstats->subkey_lists_remaining--;\n\n\tlist = get_cell_pointer(regf, subkey_list_offset,\n\t\t\t\tsizeof(struct subkey_list));\n\tif (!list)\n\t\treturn HIVE_CORRUPT;\n\n\tnum_offsets = le16_to_cpu(list->num_offsets);\n\textra_size = num_offsets * sizeof(list->elements[0]);\n\tincrement = 1;\n\n\tif (list->base.magic == LF_MAGIC || list->base.magic == LH_MAGIC) {\n\t\t/* Hashes are included  */\n\t\textra_size *= 2;\n\t\tincrement = 2;\n\t}\n\n\tif (!revalidate_cell(regf, subkey_list_offset,\n\t\t\t     sizeof(struct subkey_list) + extra_size))\n\t\treturn HIVE_CORRUPT;\n\n\tswitch (list->base.magic) {\n\tcase LF_MAGIC:\n\tcase LH_MAGIC:\n\tcase LI_MAGIC:\n\t\t/* Children are subkeys  */\n\t\tif (stats->subkeys_remaining < num_offsets)\n\t\t\treturn HIVE_CORRUPT;\n\t\tstats->subkeys_remaining -= num_offsets;\n\t\twhile (num_offsets--) {\n\t\t\tconst struct nk *sub_nk;\n\n\t\t\tsub_nk = get_cell_pointer(regf, list->elements[i],\n\t\t\t\t\t\t  sizeof(struct nk));\n\t\t\tif (!sub_nk || sub_nk->base.magic != NK_MAGIC)\n\t\t\t\treturn HIVE_CORRUPT;\n\n\t\t\tif (!revalidate_cell(regf, list->elements[i],\n\t\t\t\t\t     sizeof(struct nk) +\n\t\t\t\t\t\tle16_to_cpu(sub_nk->name_size)))\n\t\t\t\treturn HIVE_CORRUPT;\n\n\t\t\tstatus = (*cb)(sub_nk, cb_ctx);\n\t\t\tif (status != HIVE_OK)\n\t\t\t\treturn status;\n\t\t\ti += increment;\n\t\t}\n\t\treturn HIVE_OK;\n\tcase RI_MAGIC:\n\t\t/* Children are subkey lists  */\n\t\tstatus = HIVE_OK;\n\t\tstats->levels_remaining--;\n\t\twhile (num_offsets--) {\n\t\t\tstatus = iterate_subkeys_recursive(regf,\n\t\t\t\t\t\tlist->elements[i++],\n\t\t\t\t\t\tcb, cb_ctx, stats);\n\t\t\tif (status != HIVE_OK)\n\t\t\t\tbreak;\n\t\t}\n\t\tstats->levels_remaining++;\n\t\treturn status;\n\tdefault:\n\t\treturn HIVE_UNSUPPORTED;\n\t}\n}\n\n/* Call @cb on each subkey cell of the key @nk.  */\nstatic enum hive_status\niterate_subkeys(const struct regf *regf, const struct nk *nk,\n\t\tsubkey_cb_t cb, void *cb_ctx)\n{\n\tu32 num_subkeys = le32_to_cpu(nk->num_subkeys);\n\tstruct subkey_iteration_stats stats;\n\tenum hive_status status;\n\n\tif (num_subkeys == 0)\n\t\treturn HIVE_OK;\n\n\tif (num_subkeys > MAX_SUBKEYS)\n\t\treturn HIVE_CORRUPT;\n\n\tstats.levels_remaining = MAX_SUBKEY_LIST_LEVELS;\n\tstats.subkey_lists_remaining = MAX_SUBKEY_LISTS;\n\tstats.subkeys_remaining = num_subkeys;\n\n\tstatus = iterate_subkeys_recursive(regf, nk->subkey_list_offset,\n\t\t\t\t\t   cb, cb_ctx, &stats);\n\tif (stats.subkeys_remaining != 0 && status == HIVE_OK)\n\t\tstatus = HIVE_CORRUPT;\n\treturn status;\n}\n\nstruct lookup_subkey_ctx {\n\tconst utf16lechar *key_name;\n\tsize_t key_name_nchars;\n\tconst struct nk *result;\n};\n\nstatic enum hive_status\nlookup_subkey_cb(const struct nk *sub_nk, void *_ctx)\n{\n\tstruct lookup_subkey_ctx *ctx = _ctx;\n\n\tif (names_equal(ctx->key_name, ctx->key_name_nchars,\n\t\t\tsub_nk->name, le16_to_cpu(sub_nk->name_size),\n\t\t\t(sub_nk->flags & NK_COMPRESSED_NAME) != 0))\n\t{\n\t\tctx->result = sub_nk;\n\t\treturn HIVE_ITERATION_STOPPED;\n\t}\n\n\treturn HIVE_OK;\n}\n\n/*\n * Given a registry key cell @nk, look up the next component of the key\n * *key_namep.  If found, return HIVE_OK, advance *key_namep past the key name\n * component, and return the subkey cell in @sub_nk_ret.  Otherwise, return\n * another HIVE_* error code.\n */\nstatic enum hive_status\nlookup_subkey(const struct regf *regf, const utf16lechar **key_namep,\n\t      const struct nk *nk, const struct nk **sub_nk_ret)\n{\n\tconst utf16lechar *key_name = *key_namep;\n\tsize_t key_name_nchars = 0;\n\tstruct lookup_subkey_ctx ctx;\n\tenum hive_status status;\n\n\twhile (key_name[key_name_nchars] != cpu_to_le16('\\0') &&\n\t       key_name[key_name_nchars] != cpu_to_le16('\\\\'))\n\t\tkey_name_nchars++;\n\n\tctx.key_name = key_name;\n\tctx.key_name_nchars = key_name_nchars;\n\tctx.result = NULL;\n\n\tstatus = iterate_subkeys(regf, nk, lookup_subkey_cb, &ctx);\n\tif (!ctx.result) {\n\t\tif (status == HIVE_OK)\n\t\t\tstatus = HIVE_KEY_NOT_FOUND;\n\t\treturn status;\n\t}\n\n\tkey_name += key_name_nchars;\n\twhile (*key_name == cpu_to_le16('\\\\'))\n\t\tkey_name++;\n\t*key_namep = key_name;\n\t*sub_nk_ret = ctx.result;\n\treturn HIVE_OK;\n}\n\n/* Find the nk cell for the key named @key_name in the registry hive @regf.  */\nstatic enum hive_status\nlookup_key(const struct regf *regf, const tchar *key_name,\n\t   const struct nk **nk_ret)\n{\n\tconst struct nk *nk;\n\tenum hive_status status;\n\tconst utf16lechar *key_uname, *key_unamep;\n\n\tnk = get_cell_pointer(regf, regf->root_key_offset, sizeof(struct nk));\n\tif (!nk || nk->base.magic != NK_MAGIC)\n\t\treturn HIVE_CORRUPT;\n\n\tstatus = translate_wimlib_error(tstr_get_utf16le(key_name, &key_uname));\n\tif (status != HIVE_OK)\n\t\treturn status;\n\tkey_unamep = key_uname;\n\twhile (*key_unamep) {\n\t\tstatus = lookup_subkey(regf, &key_unamep, nk, &nk);\n\t\tif (status != HIVE_OK)\n\t\t\tgoto out;\n\t}\n\t*nk_ret = nk;\n\tstatus = HIVE_OK;\nout:\n\ttstr_put_utf16le(key_uname);\n\treturn status;\n}\n\n/* Find the vk cell for the value named @value_name of the key named @key_name\n * in the registry hive @regf.  */\nstatic enum hive_status\nlookup_value(const struct regf *regf, const tchar *key_name,\n\t     const tchar *value_name, const struct vk **vk_ret)\n{\n\tenum hive_status status;\n\tconst struct nk *nk;\n\tsize_t num_values;\n\tconst struct value_list *value_list;\n\tconst  utf16lechar *value_uname;\n\tsize_t value_uname_nchars;\n\n\t/* Look up the nk cell for the key.  */\n\tstatus = lookup_key(regf, key_name, &nk);\n\tif (status != HIVE_OK)\n\t\treturn status;\n\n\tnum_values = le32_to_cpu(nk->num_values);\n\n\tif (num_values == 0) /* No values?  */\n\t\treturn HIVE_VALUE_NOT_FOUND;\n\n\tif (num_values > MAX_VALUES)\n\t\treturn HIVE_CORRUPT;\n\n\tvalue_list = get_cell_pointer(regf, nk->value_list_offset,\n\t\t\t\t      sizeof(struct value_list) +\n\t\t\t\t      (num_values *\n\t\t\t\t       sizeof(value_list->vk_offsets[0])));\n\tif (!value_list)\n\t\treturn HIVE_CORRUPT;\n\n\t/* Look for the value in the value list.  */\n\n\tstatus = translate_wimlib_error(\n\t\t\ttstr_get_utf16le_and_len(value_name, &value_uname,\n\t\t\t\t\t\t &value_uname_nchars));\n\tif (status != HIVE_OK)\n\t\treturn status;\n\tvalue_uname_nchars /= 2;\n\n\tfor (size_t i = 0; i < num_values; i++) {\n\t\tconst struct vk *vk;\n\t\tsize_t name_size;\n\n\t\tstatus = HIVE_CORRUPT;\n\t\tvk = get_cell_pointer(regf, value_list->vk_offsets[i],\n\t\t\t\t      sizeof(struct vk));\n\t\tif (!vk || vk->base.magic != VK_MAGIC)\n\t\t\tgoto out;\n\n\t\tname_size = le16_to_cpu(vk->name_size);\n\n\t\tif (!revalidate_cell(regf, value_list->vk_offsets[i],\n\t\t\t\t     sizeof(struct vk) + name_size))\n\t\t\tgoto out;\n\n\t\tif (names_equal(value_uname, value_uname_nchars,\n\t\t\t\tvk->name, name_size,\n\t\t\t\t(vk->flags & VK_COMPRESSED_NAME) != 0))\n\t\t{\n\t\t\t*vk_ret = vk;\n\t\t\tstatus = HIVE_OK;\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\tstatus = HIVE_VALUE_NOT_FOUND;\nout:\n\ttstr_put_utf16le(value_uname);\n\treturn status;\n}\n\n/*\n * Retrieve the data of the value named @value_name of the key named @key_name\n * in the registry hive @regf.  If the value was found, return HIVE_OK and\n * return the data, its size, and its type in @data_ret, @data_size_ret, and\n * @data_type_ret.  Otherwise, return another HIVE_* error code.\n */\nstatic enum hive_status\nretrieve_value(const struct regf *regf, const tchar *key_name,\n\t       const tchar *value_name, void **data_ret,\n\t       size_t *data_size_ret, le32 *data_type_ret)\n{\n\tenum hive_status status;\n\tconst struct vk *vk;\n\tsize_t data_size;\n\tbool is_inline;\n\tconst void *data;\n\n\t/* Find the vk cell.  */\n\tstatus = lookup_value(regf, key_name, value_name, &vk);\n\tif (status != HIVE_OK)\n\t\treturn status;\n\n\t/* Extract the value data from the vk cell (for inline data) or from the\n\t * data cell which it references (for non-inline data).  */\n\n\tdata_size = le32_to_cpu(vk->data_size);\n\n\tis_inline = (data_size & 0x80000000);\n\tdata_size &= 0x7FFFFFFF;\n\n\tif (data_size > MAX_VALUE_SIZE)\n\t\treturn HIVE_CORRUPT;\n\n\tif (is_inline) {\n\t\tif (data_size > 4)\n\t\t\treturn HIVE_CORRUPT;\n\t\tdata = &vk->data_offset;\n\t} else {\n\t\tconst struct data_cell *data_cell;\n\n\t\tdata_cell = get_cell_pointer(regf, vk->data_offset,\n\t\t\t\t\t     sizeof(struct data_cell));\n\t\tif (!data_cell)\n\t\t\treturn HIVE_CORRUPT;\n\n\t\tif (!revalidate_cell(regf, vk->data_offset,\n\t\t\t\t     sizeof(struct data_cell) + data_size))\n\t\t\treturn HIVE_UNSUPPORTED; /* Possibly a big data cell  */\n\n\t\tdata = data_cell->data;\n\t}\n\n\t*data_ret = memdup(data, data_size);\n\tif (!*data_ret)\n\t\treturn HIVE_OUT_OF_MEMORY;\n\t*data_size_ret = data_size;\n\t*data_type_ret = vk->data_type;\n\treturn HIVE_OK;\n}\n\n/* Validate the registry hive file given in memory as @hive_mem and @hive_size.\n * If valid, return HIVE_OK.  If invalid, return another HIVE_* error code.  */\nenum hive_status\nhive_validate(const void *hive_mem, size_t hive_size)\n{\n\tconst struct regf *regf = hive_mem;\n\n\tSTATIC_ASSERT(sizeof(struct regf) == 4096);\n\n\tif (hive_size < sizeof(struct regf))\n\t\treturn HIVE_CORRUPT;\n\n\tif (regf->magic != REGF_MAGIC || regf->major_version != REGF_MAJOR)\n\t\treturn HIVE_UNSUPPORTED;\n\n\tif (le32_to_cpu(regf->total_hbin_size) > hive_size - sizeof(struct regf))\n\t\treturn HIVE_CORRUPT;\n\n\treturn HIVE_OK;\n}\n\n/* Get a string value from the registry hive file.  */\nenum hive_status\nhive_get_string(const struct regf *regf, const tchar *key_name,\n\t\tconst tchar *value_name, tchar **value_ret)\n{\n\tvoid *data;\n\tsize_t data_size;\n\tle32 data_type;\n\tenum hive_status status;\n\n\t/* Retrieve the raw value data.  */\n\tstatus = retrieve_value(regf, key_name, value_name,\n\t\t\t\t&data, &data_size, &data_type);\n\tif (status != HIVE_OK)\n\t\treturn status;\n\n\t/* Interpret the data as a string, when possible.  */\n\tswitch (data_type) {\n\tcase REG_SZ:\n\tcase REG_MULTI_SZ:\n\t\tstatus = translate_wimlib_error(\n\t\t\tutf16le_to_tstr(data, data_size, value_ret, &data_size));\n\t\tbreak;\n\tdefault:\n\t\tstatus = HIVE_VALUE_IS_WRONG_TYPE;\n\t\tbreak;\n\t}\n\tFREE(data);\n\treturn status;\n}\n\n/* Get a number value from the registry hive file.  */\nenum hive_status\nhive_get_number(const struct regf *regf, const tchar *key_name,\n\t\tconst tchar *value_name, s64 *value_ret)\n{\n\tvoid *data;\n\tsize_t data_size;\n\tle32 data_type;\n\tenum hive_status status;\n\n\t/* Retrieve the raw value data.  */\n\tstatus = retrieve_value(regf, key_name, value_name,\n\t\t\t\t&data, &data_size, &data_type);\n\tif (status != HIVE_OK)\n\t\treturn status;\n\n\t/* Interpret the data as a number, when possible.  */\n\tswitch (data_type) {\n\tcase REG_DWORD_LITTLE_ENDIAN:\n\t\tif (data_size == 4) {\n\t\t\t*value_ret = le32_to_cpu(*(le32 *)data);\n\t\t\tstatus = HIVE_OK;\n\t\t} else {\n\t\t\tstatus = HIVE_CORRUPT;\n\t\t}\n\t\tbreak;\n\tcase REG_DWORD_BIG_ENDIAN:\n\t\tif (data_size == 4) {\n\t\t\t*value_ret = be32_to_cpu(*(be32 *)data);\n\t\t\tstatus = HIVE_OK;\n\t\t} else {\n\t\t\tstatus = HIVE_CORRUPT;\n\t\t}\n\t\tbreak;\n\tcase REG_QWORD_LITTLE_ENDIAN:\n\t\tif (data_size == 8) {\n\t\t\t*value_ret = le64_to_cpu(*(le64 *)data);\n\t\t\tstatus = HIVE_OK;\n\t\t} else {\n\t\t\tstatus = HIVE_CORRUPT;\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tstatus = HIVE_VALUE_IS_WRONG_TYPE;\n\t\tbreak;\n\t}\n\n\tFREE(data);\n\treturn status;\n}\n\nstatic enum hive_status\nappend_subkey_name(const struct nk *sub_nk, void *_next_subkey_p)\n{\n\tsize_t name_size = le16_to_cpu(sub_nk->name_size);\n\ttchar *subkey;\n\ttchar ***next_subkeyp = _next_subkey_p;\n\n\tif (sub_nk->flags & NK_COMPRESSED_NAME) {\n\t\tsubkey = MALLOC((name_size + 1) * sizeof(tchar));\n\t\tif (!subkey)\n\t\t\treturn HIVE_OUT_OF_MEMORY;\n\t\tfor (size_t i = 0; i < name_size; i++)\n\t\t\tsubkey[i] = sub_nk->name[i];\n\t\tsubkey[name_size] = '\\0';\n\t} else {\n\t\tenum hive_status status;\n\n\t\tstatus = translate_wimlib_error(\n\t\t\tutf16le_to_tstr((utf16lechar *)sub_nk->name,\n\t\t\t\t\tname_size, &subkey, NULL));\n\t\tif (status != HIVE_OK)\n\t\t\treturn status;\n\t}\n\n\t**next_subkeyp = subkey;\n\t++*next_subkeyp;\n\treturn HIVE_OK;\n}\n\n/* List the subkeys of the specified registry key.  */\nenum hive_status\nhive_list_subkeys(const struct regf *regf, const tchar *key_name,\n\t\t  tchar ***subkeys_ret)\n{\n\tenum hive_status status;\n\tconst struct nk *nk;\n\ttchar **subkeys;\n\ttchar **next_subkey;\n\n\tstatus = lookup_key(regf, key_name, &nk);\n\tif (status != HIVE_OK)\n\t\treturn status;\n\n\tif (le32_to_cpu(nk->num_subkeys) > MAX_SUBKEYS)\n\t\treturn HIVE_CORRUPT;\n\n\tsubkeys = CALLOC(le32_to_cpu(nk->num_subkeys) + 1, sizeof(subkeys[0]));\n\tif (!subkeys)\n\t\treturn HIVE_OUT_OF_MEMORY;\n\n\tnext_subkey = subkeys;\n\tstatus = iterate_subkeys(regf, nk, append_subkey_name, &next_subkey);\n\tif (status == HIVE_OK)\n\t\t*subkeys_ret = subkeys;\n\telse\n\t\thive_free_subkeys_list(subkeys);\n\treturn status;\n}\n\nvoid\nhive_free_subkeys_list(tchar **subkeys)\n{\n\tfor (tchar **p = subkeys; *p; p++)\n\t\tFREE(*p);\n\tFREE(subkeys);\n}\n\nconst char *\nhive_status_to_string(enum hive_status status)\n{\n\tswitch (status) {\n\tcase HIVE_OK:\n\t\treturn \"HIVE_OK\";\n\tcase HIVE_CORRUPT:\n\t\treturn \"HIVE_CORRUPT\";\n\tcase HIVE_UNSUPPORTED:\n\t\treturn \"HIVE_UNSUPPORTED\";\n\tcase HIVE_KEY_NOT_FOUND:\n\t\treturn \"HIVE_KEY_NOT_FOUND\";\n\tcase HIVE_VALUE_NOT_FOUND:\n\t\treturn \"HIVE_VALUE_NOT_FOUND\";\n\tcase HIVE_VALUE_IS_WRONG_TYPE:\n\t\treturn \"HIVE_VALUE_IS_WRONG_TYPE\";\n\tcase HIVE_OUT_OF_MEMORY:\n\t\treturn \"HIVE_OUT_OF_MEMORY\";\n\tcase HIVE_ITERATION_STOPPED:\n\t\treturn \"HIVE_ITERATION_STOPPED\";\n\t}\n\treturn NULL;\n}\n"
  },
  {
    "path": "src/wimlib/reparse.c",
    "content": "/*\n * reparse.c - Reparse point handling\n */\n\n/*\n * Copyright (C) 2012, 2013, 2015 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n\n#include \"wimlib/alloca.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/guid.h\"\n#include \"wimlib/inode.h\"\n#include \"wimlib/reparse.h\"\n#include \"wimlib/resource.h\"\n\n/*\n * Reconstruct the header of a reparse point buffer.  This is necessary because\n * only reparse data is stored in WIM files.  The reparse tag is instead stored\n * in the on-disk WIM dentry, and the reparse data length is equal to the size\n * of the blob in which the reparse data was stored, minus the size of a GUID\n * (16 bytes) if the reparse tag does not have the \"Microsoft\" bit set.\n */\nvoid\ncomplete_reparse_point(struct reparse_buffer_disk *rpbuf,\n\t\t       const struct wim_inode *inode, u16 blob_size)\n{\n\trpbuf->rptag = cpu_to_le32(inode->i_reparse_tag);\n\tif (blob_size >= GUID_SIZE && !(inode->i_reparse_tag & 0x80000000))\n\t\tblob_size -= GUID_SIZE;\n\trpbuf->rpdatalen = cpu_to_le16(blob_size);\n\trpbuf->rpreserved = cpu_to_le16(inode->i_rp_reserved);\n}\n\n/* Parse the buffer for a symbolic link or junction reparse point and fill in a\n * 'struct link_reparse_point'.  */\nint\nparse_link_reparse_point(const struct reparse_buffer_disk *rpbuf, u16 rpbuflen,\n\t\t\t struct link_reparse_point *link)\n{\n\tu16 substitute_name_offset;\n\tu16 print_name_offset;\n\tconst u8 *data;\n\n\tlink->rptag = le32_to_cpu(rpbuf->rptag);\n\n\t/* Not a symbolic link or junction?  */\n\tif (link->rptag != WIM_IO_REPARSE_TAG_SYMLINK &&\n\t    link->rptag != WIM_IO_REPARSE_TAG_MOUNT_POINT)\n\t\treturn WIMLIB_ERR_INVALID_REPARSE_DATA;\n\n\t/* Is the buffer too small to be a symlink or a junction?  */\n\tif (rpbuflen < offsetof(struct reparse_buffer_disk, link.junction.data))\n\t\treturn WIMLIB_ERR_INVALID_REPARSE_DATA;\n\n\tlink->rpreserved = le16_to_cpu(rpbuf->rpreserved);\n\tlink->substitute_name_nbytes = le16_to_cpu(rpbuf->link.substitute_name_nbytes);\n\tsubstitute_name_offset = le16_to_cpu(rpbuf->link.substitute_name_offset);\n\tlink->print_name_nbytes = le16_to_cpu(rpbuf->link.print_name_nbytes);\n\tprint_name_offset = le16_to_cpu(rpbuf->link.print_name_offset);\n\n\t/* The names must be properly sized and aligned.  */\n\tif ((substitute_name_offset | print_name_offset |\n\t     link->substitute_name_nbytes | link->print_name_nbytes) & 1)\n\t\treturn WIMLIB_ERR_INVALID_REPARSE_DATA;\n\n\tif (link->rptag == WIM_IO_REPARSE_TAG_SYMLINK) {\n\t\tif (rpbuflen < offsetof(struct reparse_buffer_disk, link.symlink.data))\n\t\t\treturn WIMLIB_ERR_INVALID_REPARSE_DATA;\n\t\tlink->symlink_flags = le32_to_cpu(rpbuf->link.symlink.flags);\n\t\tdata = rpbuf->link.symlink.data;\n\t} else {\n\t\tdata = rpbuf->link.junction.data;\n\t}\n\n\t/* Verify that the names don't overflow the buffer.  */\n\tif ((data - (const u8 *)rpbuf) + substitute_name_offset +\n\t    link->substitute_name_nbytes > rpbuflen)\n\t\treturn WIMLIB_ERR_INVALID_REPARSE_DATA;\n\n\tif ((data - (const u8 *)rpbuf) + print_name_offset +\n\t    link->print_name_nbytes > rpbuflen)\n\t\treturn WIMLIB_ERR_INVALID_REPARSE_DATA;\n\n\t/* Save the name pointers.  */\n\tlink->substitute_name = (utf16lechar *)&data[substitute_name_offset];\n\tlink->print_name = (utf16lechar *)&data[print_name_offset];\n\treturn 0;\n}\n\n/* Translate a 'struct link_reparse_point' into a reparse point buffer.  */\nint\nmake_link_reparse_point(const struct link_reparse_point *link,\n\t\t\tstruct reparse_buffer_disk *rpbuf, u16 *rpbuflen_ret)\n{\n\tu8 *data;\n\n\tif (link->rptag == WIM_IO_REPARSE_TAG_SYMLINK)\n\t\tdata = rpbuf->link.symlink.data;\n\telse if (link->rptag == WIM_IO_REPARSE_TAG_MOUNT_POINT)\n\t\tdata = rpbuf->link.junction.data;\n\telse /* Callers should forbid this case, but check anyway.  */\n\t\treturn WIMLIB_ERR_INVALID_REPARSE_DATA;\n\n\t/* Check if the names are too long to fit in a reparse point.  */\n\tif ((data - (u8 *)rpbuf) + link->substitute_name_nbytes +\n\t    link->print_name_nbytes +\n\t    2 * sizeof(utf16lechar) > REPARSE_POINT_MAX_SIZE)\n\t\treturn WIMLIB_ERR_INVALID_REPARSE_DATA;\n\n\trpbuf->rptag = cpu_to_le32(link->rptag);\n\trpbuf->rpreserved = cpu_to_le16(link->rpreserved);\n\trpbuf->link.substitute_name_offset = cpu_to_le16(0);\n\trpbuf->link.substitute_name_nbytes = cpu_to_le16(link->substitute_name_nbytes);\n\trpbuf->link.print_name_offset = cpu_to_le16(link->substitute_name_nbytes +\n\t\t\t\t\t\t    sizeof(utf16lechar));\n\trpbuf->link.print_name_nbytes = cpu_to_le16(link->print_name_nbytes);\n\n\tif (link->rptag == WIM_IO_REPARSE_TAG_SYMLINK)\n\t\trpbuf->link.symlink.flags = cpu_to_le32(link->symlink_flags);\n\n\t/* We null-terminate the substitute and print names, although this isn't\n\t * strictly necessary.  Note that the nbytes fields do not include the\n\t * null terminators.  */\n\tdata = mempcpy(data, link->substitute_name, link->substitute_name_nbytes);\n\t*(utf16lechar *)data = cpu_to_le16(0);\n\tdata += sizeof(utf16lechar);\n\tdata = mempcpy(data, link->print_name, link->print_name_nbytes);\n\t*(utf16lechar *)data = cpu_to_le16(0);\n\tdata += sizeof(utf16lechar);\n\trpbuf->rpdatalen = cpu_to_le16(data - rpbuf->rpdata);\n\n\t*rpbuflen_ret = data - (u8 *)rpbuf;\n\treturn 0;\n}\n\n/* UNIX symlink <=> Windows reparse point translation  */\n#ifndef _WIN32\n\n/* Retrieve the inode's reparse point buffer into @rpbuf and @rpbuflen_ret.\n * This gets the reparse data from @blob if specified, otherwise from the\n * inode's reparse point stream.  The inode's streams must be resolved.  */\nstatic int\nwim_inode_get_reparse_point(const struct wim_inode *inode,\n\t\t\t    struct reparse_buffer_disk *rpbuf,\n\t\t\t    u16 *rpbuflen_ret,\n\t\t\t    const struct blob_descriptor *blob)\n{\n\tint ret;\n\tu16 blob_size = 0;\n\n\tif (!blob) {\n\t\tconst struct wim_inode_stream *strm;\n\n\t\tstrm = inode_get_unnamed_stream(inode, STREAM_TYPE_REPARSE_POINT);\n\t\tif (strm)\n\t\t\tblob = stream_blob_resolved(strm);\n\t}\n\n\tif (blob) {\n\t\tif (blob->size > REPARSE_DATA_MAX_SIZE)\n\t\t\treturn WIMLIB_ERR_INVALID_REPARSE_DATA;\n\t\tblob_size = blob->size;\n\t\tret = read_blob_into_buf(blob, rpbuf->rpdata);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tcomplete_reparse_point(rpbuf, inode, blob_size);\n\n\t*rpbuflen_ret = REPARSE_DATA_OFFSET + blob_size;\n\treturn 0;\n}\n\nstatic void\ncopy(char **buf_p, size_t *bufsize_p, const char *src, size_t src_size)\n{\n\tsize_t n = min(*bufsize_p, src_size);\n\tmemcpy(*buf_p, src, n);\n\t*buf_p += n;\n\t*bufsize_p -= n;\n}\n\n/*\n * Get a UNIX-style symlink target from the WIM inode for a reparse point.\n *\n * @inode\n *\tThe inode from which to read the symlink.  If not a symbolic link or\n *\tjunction reparse point, then -EINVAL will be returned.\n * @buf\n *\tBuffer into which to place the link target.\n * @bufsize\n *\tAvailable space in @buf, in bytes.\n * @blob\n *\tIf not NULL, the blob from which to read the reparse data.  Otherwise,\n *\tthe reparse data will be read from the reparse point stream of @inode.\n * @altroot\n *\tIf @altroot_len != 0 and the link is an absolute link that was stored as\n *\t\"fixed\", then prepend this path to the link target.\n * @altroot_len\n *\tLength of the @altroot string or 0.\n *\n * Similar to POSIX readlink(), this function writes as much of the symlink\n * target as possible (up to @bufsize bytes) to @buf with no null terminator and\n * returns the number of bytes written or a negative errno value on error.  Note\n * that the target is truncated and @bufsize is returned in the overflow case.\n */\nint\nwim_inode_readlink(const struct wim_inode *inode, char *buf, size_t bufsize,\n\t\t   const struct blob_descriptor *blob,\n\t\t   const char *altroot, size_t altroot_len)\n{\n\tstruct reparse_buffer_disk rpbuf;\n\tu16 rpbuflen;\n\tstruct link_reparse_point link;\n\tchar *target_buffer;\n\tchar *target;\n\tsize_t target_len;\n\tchar *buf_ptr;\n\tbool rpfix_ok = false;\n\n\t/* Not a symbolic link or junction?  */\n\tif (!inode_is_symlink(inode))\n\t\treturn -EINVAL;\n\n\t/* Retrieve the native Windows \"substitute name\".  */\n\n\tif (wim_inode_get_reparse_point(inode, &rpbuf, &rpbuflen, blob))\n\t\treturn -EIO;\n\n\tif (parse_link_reparse_point(&rpbuf, rpbuflen, &link))\n\t\treturn -EINVAL;\n\n\t/* Translate the substitute name to a multibyte string.  */\n\tif (utf16le_to_tstr(link.substitute_name, link.substitute_name_nbytes,\n\t\t\t    &target_buffer, &target_len))\n\t\treturn -errno;\n\ttarget = target_buffer;\n\n\t/*\n\t * The substitute name is a native Windows NT path. There are two cases:\n\t *\n\t * 1. The reparse point is a symlink (rptag=WIM_IO_REPARSE_TAG_SYMLINK)\n\t *    and SYMBOLIC_LINK_RELATIVE is set.  Windows resolves the path\n\t *    relative to the directory containing the reparse point file.  In\n\t *    this case, we just translate the path separators.\n\t * 2. Otherwise, Windows resolves the path from the root of the Windows\n\t *    NT kernel object namespace.  In this case, we attempt to strip the\n\t *    device name, in addition to translating the path separators; e.g.\n\t *    \"\\??\\C:\\Users\\Public\" is translated to \"/Users/Public\".\n\t *\n\t * Also in case (2) the link target may have been stored as \"fixed\",\n\t * meaning that with the device portion stripped off it is effectively\n\t * \"relative to the root of the WIM image\".  If this is the case, and if\n\t * the caller provided an alternate root directory, then rewrite the\n\t * link to be relative to that directory.\n\t */\n\tif (!link_is_relative_symlink(&link)) {\n\t\tstatic const char *const nt_root_dirs[] = {\n\t\t\t\"\\\\??\\\\\", \"\\\\DosDevices\\\\\", \"\\\\Device\\\\\",\n\t\t};\n\t\tfor (size_t i = 0; i < ARRAY_LEN(nt_root_dirs); i++) {\n\t\t\tsize_t len = strlen(nt_root_dirs[i]);\n\t\t\tif (!strncmp(target, nt_root_dirs[i], len)) {\n\t\t\t\tchar *p = target + len;\n\t\t\t\twhile (*p == '\\\\')\n\t\t\t\t\tp++;\n\t\t\t\twhile (*p && *p != '\\\\')\n\t\t\t\t\tp++;\n\t\t\t\ttarget_len -= (p - target);\n\t\t\t\ttarget = p;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!(inode->i_rp_flags & WIM_RP_FLAG_NOT_FIXED))\n\t\t\trpfix_ok = true;\n\t}\n\n\t/* Translate backslashes (Windows NT path separator) to forward slashes\n\t * (UNIX path separator).  In addition, translate forwards slashes to\n\t * backslashes; this enables lossless handling of UNIX symbolic link\n\t * targets that contain the backslash character.  */\n\tfor (char *p = target; *p; p++) {\n\t\tif (*p == '\\\\')\n\t\t\t*p = '/';\n\t\telse if (*p == '/')\n\t\t\t*p = '\\\\';\n\t}\n\n\t/* Copy as much of the link target as possible to the output buffer and\n\t * return the number of bytes copied.  */\n\tbuf_ptr = buf;\n\tif (rpfix_ok && altroot_len != 0) {\n\t\tcopy(&buf_ptr, &bufsize, altroot, altroot_len);\n\t} else if (target_len == 0) {\n\t\t/* An absolute link target that was made relative to the same\n\t\t * directory pointed to will end up empty if the original target\n\t\t * did not have a trailing slash.  Here, we are reading this\n\t\t * adjusted link target without prefixing it.  This usually\n\t\t * doesn't happen, but if it does then we need to change it to\n\t\t * \"/\" so that it is a valid target.  */\n\t\ttarget = \"/\";\n\t\ttarget_len = 1;\n\t}\n\tcopy(&buf_ptr, &bufsize, target, target_len);\n\tFREE(target_buffer);\n\treturn buf_ptr - buf;\n}\n\n/* Given a UNIX-style symbolic link target, create a Windows-style reparse point\n * buffer and assign it to the specified inode.  */\nint\nwim_inode_set_symlink(struct wim_inode *inode, const char *_target,\n\t\t      struct blob_table *blob_table)\n\n{\n\tint ret;\n\tutf16lechar *target;\n\tsize_t target_nbytes;\n\tstruct link_reparse_point link;\n\tstruct reparse_buffer_disk rpbuf;\n\tu16 rpbuflen;\n\n\t/* Translate the link target to UTF-16LE.  */\n\tret = tstr_to_utf16le(_target, strlen(_target), &target, &target_nbytes);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Translate forward slashes (UNIX path separator) to backslashes\n\t * (Windows NT path separator).  In addition, translate backslashes to\n\t * forward slashes; this enables lossless handling of UNIX symbolic link\n\t * targets that contain the backslash character.  */\n\tfor (utf16lechar *p = target; *p; p++) {\n\t\tif (*p == cpu_to_le16('/'))\n\t\t\t*p = cpu_to_le16('\\\\');\n\t\telse if (*p == cpu_to_le16('\\\\'))\n\t\t\t*p = cpu_to_le16('/');\n\t}\n\n\tlink.rptag = WIM_IO_REPARSE_TAG_SYMLINK;\n\tlink.rpreserved = 0;\n\n\t/* Note: an absolute link that was rewritten to be relative to another\n\t * directory is assumed to either be empty or to have a leading slash.\n\t * See unix_relativize_link_target().  */\n\tif (*target == cpu_to_le16('\\\\') || !*target) {\n\t\t/*\n\t\t * UNIX link target was absolute.  In this case we represent the\n\t\t * link as a symlink reparse point with SYMBOLIC_LINK_RELATIVE\n\t\t * cleared.  For this to work we need to assign it a path that\n\t\t * can be resolved from the root of the Windows NT kernel object\n\t\t * namespace.  We do this by using \"\\??\\C:\" as a dummy prefix.\n\t\t *\n\t\t * Note that we could instead represent UNIX absolute links by\n\t\t * setting SYMBOLIC_LINK_RELATIVE and then leaving the path\n\t\t * backslash-prefixed like \"\\Users\\Public\".  On Windows this is\n\t\t * valid and denotes a path relative to the root of the\n\t\t * filesystem on which the reparse point resides.  The problem\n\t\t * with this is that neither WIMGAPI nor wimlib (on Windows)\n\t\t * will do \"reparse point fixups\" when extracting such links\n\t\t * (modifying the link target to point into the actual\n\t\t * extraction directory).  So for the greatest cross-platform\n\t\t * consistency, we have to use the fake C: drive approach.\n\t\t */\n\t\tstatic const utf16lechar prefix[6] = {\n\t\t\tcpu_to_le16('\\\\'),\n\t\t\tcpu_to_le16('?'),\n\t\t\tcpu_to_le16('?'),\n\t\t\tcpu_to_le16('\\\\'),\n\t\t\tcpu_to_le16('C'),\n\t\t\tcpu_to_le16(':'),\n\t\t};\n\n\t\t/* Do not show \\??\\ in print name  */\n\t\tconst size_t num_unprintable_chars = 4;\n\n\t\tlink.symlink_flags = 0;\n\t\tlink.substitute_name_nbytes = sizeof(prefix) + target_nbytes;\n\t\tlink.substitute_name = alloca(link.substitute_name_nbytes);\n\t\tmemcpy(link.substitute_name, prefix, sizeof(prefix));\n\t\tmemcpy(link.substitute_name + ARRAY_LEN(prefix), target, target_nbytes);\n\t\tlink.print_name_nbytes = link.substitute_name_nbytes -\n\t\t\t\t\t (num_unprintable_chars * sizeof(utf16lechar));\n\t\tlink.print_name = link.substitute_name + num_unprintable_chars;\n\t} else {\n\t\t/* UNIX link target was relative.  In this case we represent the\n\t\t * link as a symlink reparse point with SYMBOLIC_LINK_RELATIVE\n\t\t * set.  This causes Windows to interpret the link relative to\n\t\t * the directory containing the reparse point file.  */\n\t\tlink.symlink_flags = SYMBOLIC_LINK_RELATIVE;\n\t\tlink.substitute_name_nbytes = target_nbytes;\n\t\tlink.substitute_name = target;\n\t\tlink.print_name_nbytes = target_nbytes;\n\t\tlink.print_name = target;\n\t}\n\n\t/* Generate the reparse buffer.  */\n\tret = make_link_reparse_point(&link, &rpbuf, &rpbuflen);\n\tif (ret)\n\t\tgoto out_free_target;\n\n\t/* Save the reparse data with the inode.  */\n\tret = WIMLIB_ERR_NOMEM;\n\tif (!inode_add_stream_with_data(inode,\n\t\t\t\t\tSTREAM_TYPE_REPARSE_POINT,\n\t\t\t\t\tNO_STREAM_NAME,\n\t\t\t\t\trpbuf.rpdata,\n\t\t\t\t\trpbuflen - REPARSE_DATA_OFFSET,\n\t\t\t\t\tblob_table))\n\t\tgoto out_free_target;\n\n\t/* The inode is now a reparse point.  */\n\tinode->i_reparse_tag = link.rptag;\n\tinode->i_attributes &= ~FILE_ATTRIBUTE_NORMAL;\n\tinode->i_attributes |= FILE_ATTRIBUTE_REPARSE_POINT;\n\n\tret = 0;\nout_free_target:\n\tFREE(target);\n\treturn ret;\n}\n\n#endif /* !_WIN32 */\n"
  },
  {
    "path": "src/wimlib/resource.c",
    "content": "/*\n * resource.c\n *\n * Code for reading blobs and resources, including compressed WIM resources.\n */\n\n/*\n * Copyright (C) 2012, 2013, 2015 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n#include <fcntl.h>\n#include <unistd.h>\n\n#include \"wimlib/alloca.h\"\n#include \"wimlib/assert.h\"\n#include \"wimlib/bitops.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/file_io.h\"\n#include \"wimlib/ntfs_3g.h\"\n#include \"wimlib/resource.h\"\n#include \"wimlib/sha1.h\"\n#include \"wimlib/wim.h\"\n#include \"wimlib/win32.h\"\n\n/*\n *                         Compressed WIM resources\n *\n * A compressed resource in a WIM consists of a sequence of chunks.  Each chunk\n * decompresses to the same size except possibly for the last, which\n * decompresses to the remaining size.  Chunks that did not compress to less\n * than their original size are stored uncompressed.\n *\n * We support three variations on this resource format, independently of the\n * compression type and chunk size which can vary as well:\n *\n * - Original resource format: immediately before the compressed chunks, the\n *   \"chunk table\" provides the offset, in bytes relative to the end of the\n *   chunk table, of the start of each compressed chunk, except for the first\n *   chunk which is omitted as it always has an offset of 0.  Chunk table\n *   entries are 32-bit for resources < 4 GiB uncompressed and 64-bit for\n *   resources >= 4 GiB uncompressed.\n *\n * - Solid resource format (distinguished by the use of WIM_RESHDR_FLAG_SOLID\n *   instead of WIM_RESHDR_FLAG_COMPRESSED): similar to the original format, but\n *   the resource begins with a 16-byte header which specifies the uncompressed\n *   size of the resource, the compression type, and the chunk size.  (In the\n *   original format, these values were instead determined from outside the\n *   resource itself, from the blob table and the WIM file header.) In addition,\n *   in this format the entries in the chunk table contain compressed chunk\n *   sizes rather than offsets.  As a consequence of this, the chunk table\n *   entries are always 32-bit and there is an entry for chunk 0.\n *\n * - Pipable resource format (wimlib extension; all resources in a pipable WIM\n *   have this format): similar to the original format, but the chunk table is\n *   at the end of the resource rather than the beginning, and each compressed\n *   chunk is prefixed with its compressed size as a 32-bit integer.  This\n *   format allows a resource to be written without rewinding.\n */\n\n\nstruct data_range {\n\tu64 offset;\n\tu64 size;\n};\n\nstatic int\ndecompress_chunk(const void *cbuf, u32 chunk_csize, u8 *ubuf, u32 chunk_usize,\n\t\t struct wimlib_decompressor *decompressor, bool recover_data)\n{\n\tint res = wimlib_decompress(cbuf, chunk_csize, ubuf, chunk_usize,\n\t\t\t\t    decompressor);\n\tif (likely(res == 0))\n\t\treturn 0;\n\n\tif (recover_data) {\n\t\tWARNING(\"Failed to decompress data!  Continuing anyway since data recovery mode is enabled.\");\n\n\t\t/* Continue on with *something*.  In the worst case just use a\n\t\t * zeroed buffer.  But, try to fill as much of it with\n\t\t * decompressed data as we can.  This works because if the\n\t\t * corruption isn't located right at the beginning of the\n\t\t * compressed chunk, wimlib_decompress() may write some correct\n\t\t * output at the beginning even if it fails later.  */\n\t\tmemset(ubuf, 0, chunk_usize);\n\t\t(void)wimlib_decompress(cbuf, chunk_csize, ubuf,\n\t\t\t\t\tchunk_usize, decompressor);\n\t\treturn 0;\n\t}\n\tERROR(\"Failed to decompress data!\");\n\terrno = EINVAL;\n\treturn WIMLIB_ERR_DECOMPRESSION;\n}\n\n/*\n * Read data from a compressed WIM resource.\n *\n * @rdesc\n *\tDescription of the compressed WIM resource to read from.\n * @ranges\n *\tNonoverlapping, nonempty ranges of the uncompressed resource data to\n *\tread, sorted by increasing offset.\n * @num_ranges\n *\tNumber of ranges in @ranges; must be at least 1.\n * @cb\n *\tStructure which provides the consume_chunk callback into which to feed\n *\tthe data being read.  Each call provides the next chunk of the requested\n *\tdata, uncompressed.  Each chunk will be nonempty and will not cross\n *\trange boundaries but otherwise will be of unspecified size.\n * @recover_data\n *\tIf a chunk can't be fully decompressed due to being corrupted, continue\n *\twith whatever data can be recovered rather than return an error.\n *\n * Possible return values:\n *\n *\tWIMLIB_ERR_SUCCESS (0)\n *\tWIMLIB_ERR_READ\t\t\t  (errno set)\n *\tWIMLIB_ERR_UNEXPECTED_END_OF_FILE (errno set to EINVAL)\n *\tWIMLIB_ERR_NOMEM\t\t  (errno set to ENOMEM)\n *\tWIMLIB_ERR_DECOMPRESSION\t  (errno set to EINVAL)\n *\tWIMLIB_ERR_INVALID_CHUNK_SIZE\t  (errno set to EINVAL)\n *\n *\tor other error code returned by the callback function.\n */\nstatic int\nread_compressed_wim_resource(const struct wim_resource_descriptor * const rdesc,\n\t\t\t     const struct data_range * const ranges,\n\t\t\t     const size_t num_ranges,\n\t\t\t     const struct consume_chunk_callback *cb,\n\t\t\t     bool recover_data)\n{\n\tint ret;\n\tu64 *chunk_offsets = NULL;\n\tu8 *ubuf = NULL;\n\tvoid *cbuf = NULL;\n\tbool chunk_offsets_malloced = false;\n\tbool ubuf_malloced = false;\n\tbool cbuf_malloced = false;\n\tstruct wimlib_decompressor *decompressor = NULL;\n\n\t/* Sanity checks  */\n\twimlib_assert(num_ranges != 0);\n\tfor (size_t i = 0; i < num_ranges; i++) {\n\t\twimlib_assert(ranges[i].offset + ranges[i].size > ranges[i].offset &&\n\t\t\t      ranges[i].offset + ranges[i].size <= rdesc->uncompressed_size);\n\t}\n\tfor (size_t i = 0; i < num_ranges - 1; i++)\n\t\twimlib_assert(ranges[i].offset + ranges[i].size <= ranges[i + 1].offset);\n\n\t/* Get the offsets of the first and last bytes of the read.  */\n\tconst u64 first_offset = ranges[0].offset;\n\tconst u64 last_offset = ranges[num_ranges - 1].offset + ranges[num_ranges - 1].size - 1;\n\n\t/* Get the file descriptor for the WIM.  */\n\tstruct filedes * const in_fd = &rdesc->wim->in_fd;\n\n\t/* Determine if we're reading a pipable resource from a pipe or not.  */\n\tconst bool is_pipe_read = (rdesc->is_pipable && !filedes_is_seekable(in_fd));\n\n\t/* Determine if the chunk table is in an alternate format.  */\n\tconst bool alt_chunk_table = (rdesc->flags & WIM_RESHDR_FLAG_SOLID)\n\t\t\t\t\t&& !is_pipe_read;\n\n\t/* Get the maximum size of uncompressed chunks in this resource, which\n\t * we require be a power of 2.  */\n\tu64 cur_read_offset = rdesc->offset_in_wim;\n\tint ctype = rdesc->compression_type;\n\tu32 chunk_size = rdesc->chunk_size;\n\tif (alt_chunk_table) {\n\t\t/* Alternate chunk table format.  Its header specifies the chunk\n\t\t * size and compression format.  Note: it could be read here;\n\t\t * however, the relevant data was already loaded into @rdesc by\n\t\t * read_blob_table().  */\n\t\tcur_read_offset += sizeof(struct alt_chunk_table_header_disk);\n\t}\n\n\tif (unlikely(!is_power_of_2(chunk_size))) {\n\t\tERROR(\"Invalid compressed resource: \"\n\t\t      \"expected power-of-2 chunk size (got %\"PRIu32\")\",\n\t\t      chunk_size);\n\t\tret = WIMLIB_ERR_INVALID_CHUNK_SIZE;\n\t\terrno = EINVAL;\n\t\tgoto out_cleanup;\n\t}\n\n\t/* Get valid decompressor.  */\n\tif (likely(ctype == rdesc->wim->decompressor_ctype &&\n\t\t   chunk_size == rdesc->wim->decompressor_max_block_size))\n\t{\n\t\t/* Cached decompressor.  */\n\t\tdecompressor = rdesc->wim->decompressor;\n\t\trdesc->wim->decompressor_ctype = WIMLIB_COMPRESSION_TYPE_NONE;\n\t\trdesc->wim->decompressor = NULL;\n\t} else {\n\t\tret = wimlib_create_decompressor(ctype, chunk_size,\n\t\t\t\t\t\t &decompressor);\n\t\tif (unlikely(ret)) {\n\t\t\tif (ret != WIMLIB_ERR_NOMEM)\n\t\t\t\terrno = EINVAL;\n\t\t\tgoto out_cleanup;\n\t\t}\n\t}\n\n\tconst u32 chunk_order = bsr32(chunk_size);\n\n\t/* Calculate the total number of chunks the resource is divided into.  */\n\tconst u64 num_chunks = (rdesc->uncompressed_size + chunk_size - 1) >> chunk_order;\n\n\t/* Calculate the 0-based indices of the first and last chunks containing\n\t * data that needs to be passed to the callback.  */\n\tconst u64 first_needed_chunk = first_offset >> chunk_order;\n\tconst u64 last_needed_chunk = last_offset >> chunk_order;\n\n\t/* Calculate the 0-based index of the first chunk that actually needs to\n\t * be read.  This is normally first_needed_chunk, but for pipe reads we\n\t * must always start from the 0th chunk.  */\n\tconst u64 read_start_chunk = (is_pipe_read ? 0 : first_needed_chunk);\n\n\t/* Calculate the number of chunk offsets that are needed for the chunks\n\t * being read.  */\n\tconst u64 num_needed_chunk_offsets =\n\t\tlast_needed_chunk - read_start_chunk + 1 +\n\t\t(last_needed_chunk < num_chunks - 1);\n\n\t/* Calculate the number of entries in the chunk table.  Normally, it's\n\t * one less than the number of chunks, since the first chunk has no\n\t * entry.  But in the alternate chunk table format, the chunk entries\n\t * contain chunk sizes, not offsets, and there is one per chunk.  */\n\tconst u64 num_chunk_entries = (alt_chunk_table ? num_chunks : num_chunks - 1);\n\n\t/* Set the size of each chunk table entry based on the resource's\n\t * uncompressed size.  */\n\tconst u64 chunk_entry_size = get_chunk_entry_size(rdesc->uncompressed_size,\n\t\t\t\t\t\t\t  alt_chunk_table);\n\n\t/* Calculate the size of the chunk table in bytes.  */\n\tconst u64 chunk_table_size = num_chunk_entries * chunk_entry_size;\n\n\t/* Calculate the size of the chunk table in bytes, including the header\n\t * in the case of the alternate chunk table format.  */\n\tconst u64 chunk_table_full_size =\n\t\t(alt_chunk_table) ? chunk_table_size + sizeof(struct alt_chunk_table_header_disk)\n\t\t\t\t  : chunk_table_size;\n\n\tif (!is_pipe_read) {\n\t\t/* Read the needed chunk table entries into memory and use them\n\t\t * to initialize the chunk_offsets array.  */\n\n\t\tu64 first_chunk_entry_to_read;\n\t\tu64 num_chunk_entries_to_read;\n\n\t\tif (alt_chunk_table) {\n\t\t\t/* The alternate chunk table contains chunk sizes, not\n\t\t\t * offsets, so we always must read all preceding entries\n\t\t\t * in order to determine offsets.  */\n\t\t\tfirst_chunk_entry_to_read = 0;\n\t\t\tnum_chunk_entries_to_read = last_needed_chunk + 1;\n\t\t} else {\n\n\t\t\tnum_chunk_entries_to_read = last_needed_chunk - read_start_chunk + 1;\n\n\t\t\t/* The first chunk has no explicit chunk table entry.  */\n\t\t\tif (read_start_chunk == 0) {\n\t\t\t\tnum_chunk_entries_to_read--;\n\t\t\t\tfirst_chunk_entry_to_read = 0;\n\t\t\t} else {\n\t\t\t\tfirst_chunk_entry_to_read = read_start_chunk - 1;\n\t\t\t}\n\n\t\t\t/* Unless we're reading the final chunk of the resource,\n\t\t\t * we need the offset of the chunk following the last\n\t\t\t * needed chunk so that the compressed size of the last\n\t\t\t * needed chunk can be computed.  */\n\t\t\tif (last_needed_chunk < num_chunks - 1)\n\t\t\t\tnum_chunk_entries_to_read++;\n\t\t}\n\n\t\tconst u64 chunk_offsets_alloc_size =\n\t\t\tmax(num_chunk_entries_to_read,\n\t\t\t    num_needed_chunk_offsets) * sizeof(chunk_offsets[0]);\n\n\t\tif (unlikely((size_t)chunk_offsets_alloc_size != chunk_offsets_alloc_size)) {\n\t\t\terrno = ENOMEM;\n\t\t\tgoto oom;\n\t\t}\n\n\t\tif (likely(chunk_offsets_alloc_size <= STACK_MAX)) {\n\t\t\tchunk_offsets = alloca(chunk_offsets_alloc_size);\n\t\t} else {\n\t\t\tchunk_offsets = MALLOC(chunk_offsets_alloc_size);\n\t\t\tif (unlikely(!chunk_offsets))\n\t\t\t\tgoto oom;\n\t\t\tchunk_offsets_malloced = true;\n\t\t}\n\n\t\tconst size_t chunk_table_size_to_read =\n\t\t\tnum_chunk_entries_to_read * chunk_entry_size;\n\n\t\tconst u64 file_offset_of_needed_chunk_entries =\n\t\t\tcur_read_offset\n\t\t\t+ (first_chunk_entry_to_read * chunk_entry_size)\n\t\t\t+ (rdesc->is_pipable ? (rdesc->size_in_wim - chunk_table_size) : 0);\n\n\t\tvoid * const chunk_table_data =\n\t\t\t(u8*)chunk_offsets +\n\t\t\tchunk_offsets_alloc_size -\n\t\t\tchunk_table_size_to_read;\n\n\t\tret = full_pread(in_fd, chunk_table_data, chunk_table_size_to_read,\n\t\t\t\t file_offset_of_needed_chunk_entries);\n\t\tif (unlikely(ret))\n\t\t\tgoto read_error;\n\n\t\t/* Now fill in chunk_offsets from the entries we have read in\n\t\t * chunk_tab_data.  We break aliasing rules here to avoid having\n\t\t * to allocate yet another array.  */\n\t\ttypedef le64 __attribute__((may_alias)) aliased_le64_t;\n\t\ttypedef le32 __attribute__((may_alias)) aliased_le32_t;\n\t\tu64 * chunk_offsets_p = chunk_offsets;\n\n\t\tif (alt_chunk_table) {\n\t\t\tu64 cur_offset = 0;\n\t\t\taliased_le32_t *raw_entries = chunk_table_data;\n\n\t\t\tfor (size_t i = 0; i < num_chunk_entries_to_read; i++) {\n\t\t\t\tu32 entry = le32_to_cpu(raw_entries[i]);\n\t\t\t\tif (i >= read_start_chunk)\n\t\t\t\t\t*chunk_offsets_p++ = cur_offset;\n\t\t\t\tcur_offset += entry;\n\t\t\t}\n\t\t\tif (last_needed_chunk < num_chunks - 1)\n\t\t\t\t*chunk_offsets_p = cur_offset;\n\t\t} else {\n\t\t\tif (read_start_chunk == 0)\n\t\t\t\t*chunk_offsets_p++ = 0;\n\n\t\t\tif (chunk_entry_size == 4) {\n\t\t\t\taliased_le32_t *raw_entries = chunk_table_data;\n\t\t\t\tfor (size_t i = 0; i < num_chunk_entries_to_read; i++)\n\t\t\t\t\t*chunk_offsets_p++ = le32_to_cpu(raw_entries[i]);\n\t\t\t} else {\n\t\t\t\taliased_le64_t *raw_entries = chunk_table_data;\n\t\t\t\tfor (size_t i = 0; i < num_chunk_entries_to_read; i++)\n\t\t\t\t\t*chunk_offsets_p++ = le64_to_cpu(raw_entries[i]);\n\t\t\t}\n\t\t}\n\n\t\t/* Set offset to beginning of first chunk to read.  */\n\t\tcur_read_offset += chunk_offsets[0];\n\t\tif (rdesc->is_pipable)\n\t\t\tcur_read_offset += read_start_chunk * sizeof(struct pwm_chunk_hdr);\n\t\telse\n\t\t\tcur_read_offset += chunk_table_size;\n\t}\n\n\t/* Allocate buffer for holding the uncompressed data of each chunk.  */\n\tif (chunk_size <= STACK_MAX) {\n\t\tubuf = alloca(chunk_size);\n\t} else {\n\t\tubuf = MALLOC(chunk_size);\n\t\tif (unlikely(!ubuf))\n\t\t\tgoto oom;\n\t\tubuf_malloced = true;\n\t}\n\n\t/* Allocate a temporary buffer for reading compressed chunks, each of\n\t * which can be at most @chunk_size - 1 bytes.  This excludes compressed\n\t * chunks that are a full @chunk_size bytes, which are actually stored\n\t * uncompressed.  */\n\tif (chunk_size - 1 <= STACK_MAX) {\n\t\tcbuf = alloca(chunk_size - 1);\n\t} else {\n\t\tcbuf = MALLOC(chunk_size - 1);\n\t\tif (unlikely(!cbuf))\n\t\t\tgoto oom;\n\t\tcbuf_malloced = true;\n\t}\n\n\t/* Set current data range.  */\n\tconst struct data_range *cur_range = ranges;\n\tconst struct data_range * const end_range = &ranges[num_ranges];\n\tu64 cur_range_pos = cur_range->offset;\n\tu64 cur_range_end = cur_range->offset + cur_range->size;\n\n\t/* Read and process each needed chunk.  */\n\tfor (u64 i = read_start_chunk; i <= last_needed_chunk; i++) {\n\n\t\t/* Calculate uncompressed size of next chunk.  */\n\t\tu32 chunk_usize;\n\t\tif ((i == num_chunks - 1) && (rdesc->uncompressed_size & (chunk_size - 1)))\n\t\t\tchunk_usize = (rdesc->uncompressed_size & (chunk_size - 1));\n\t\telse\n\t\t\tchunk_usize = chunk_size;\n\n\t\t/* Calculate compressed size of next chunk.  */\n\t\tu32 chunk_csize;\n\t\tif (is_pipe_read) {\n\t\t\tstruct pwm_chunk_hdr chunk_hdr;\n\n\t\t\tret = full_pread(in_fd, &chunk_hdr,\n\t\t\t\t\t sizeof(chunk_hdr), cur_read_offset);\n\t\t\tif (unlikely(ret))\n\t\t\t\tgoto read_error;\n\t\t\tchunk_csize = le32_to_cpu(chunk_hdr.compressed_size);\n\t\t} else {\n\t\t\tif (i == num_chunks - 1) {\n\t\t\t\tchunk_csize = rdesc->size_in_wim -\n\t\t\t\t\t      chunk_table_full_size -\n\t\t\t\t\t      chunk_offsets[i - read_start_chunk];\n\t\t\t\tif (rdesc->is_pipable)\n\t\t\t\t\tchunk_csize -= num_chunks * sizeof(struct pwm_chunk_hdr);\n\t\t\t} else {\n\t\t\t\tchunk_csize = chunk_offsets[i + 1 - read_start_chunk] -\n\t\t\t\t\t      chunk_offsets[i - read_start_chunk];\n\t\t\t}\n\t\t}\n\t\tif (unlikely(chunk_csize == 0 || chunk_csize > chunk_usize)) {\n\t\t\tERROR(\"Invalid chunk size in compressed resource!\");\n\t\t\terrno = EINVAL;\n\t\t\tret = WIMLIB_ERR_DECOMPRESSION;\n\t\t\tgoto out_cleanup;\n\t\t}\n\t\tif (rdesc->is_pipable)\n\t\t\tcur_read_offset += sizeof(struct pwm_chunk_hdr);\n\n\t\t/* Offsets in the uncompressed resource at which this chunk\n\t\t * starts and ends.  */\n\t\tconst u64 chunk_start_offset = i << chunk_order;\n\t\tconst u64 chunk_end_offset = chunk_start_offset + chunk_usize;\n\n\t\tif (chunk_end_offset <= cur_range_pos) {\n\n\t\t\t/* The next range does not require data in this chunk,\n\t\t\t * so skip it.  */\n\t\t\tcur_read_offset += chunk_csize;\n\t\t\tif (is_pipe_read) {\n\t\t\t\tu8 dummy;\n\n\t\t\t\tret = full_pread(in_fd, &dummy, 1, cur_read_offset - 1);\n\t\t\t\tif (unlikely(ret))\n\t\t\t\t\tgoto read_error;\n\t\t\t}\n\t\t} else {\n\n\t\t\t/* Read the chunk and feed data to the callback\n\t\t\t * function.  */\n\t\t\tu8 *read_buf;\n\n\t\t\tif (chunk_csize == chunk_usize)\n\t\t\t\tread_buf = ubuf;\n\t\t\telse\n\t\t\t\tread_buf = cbuf;\n\n\t\t\tret = full_pread(in_fd,\n\t\t\t\t\t read_buf,\n\t\t\t\t\t chunk_csize,\n\t\t\t\t\t cur_read_offset);\n\t\t\tif (unlikely(ret))\n\t\t\t\tgoto read_error;\n\n\t\t\tif (read_buf == cbuf) {\n\t\t\t\tret = decompress_chunk(cbuf, chunk_csize,\n\t\t\t\t\t\t       ubuf, chunk_usize,\n\t\t\t\t\t\t       decompressor,\n\t\t\t\t\t\t       recover_data);\n\t\t\t\tif (unlikely(ret))\n\t\t\t\t\tgoto out_cleanup;\n\t\t\t}\n\t\t\tcur_read_offset += chunk_csize;\n\n\t\t\t/* At least one range requires data in this chunk.  */\n\t\t\tdo {\n\t\t\t\tsize_t start, end, size;\n\n\t\t\t\t/* Calculate how many bytes of data should be\n\t\t\t\t * sent to the callback function, taking into\n\t\t\t\t * account that data sent to the callback\n\t\t\t\t * function must not overlap range boundaries.\n\t\t\t\t */\n\t\t\t\tstart = cur_range_pos - chunk_start_offset;\n\t\t\t\tend = min(cur_range_end, chunk_end_offset) - chunk_start_offset;\n\t\t\t\tsize = end - start;\n\n\t\t\t\tret = consume_chunk(cb, &ubuf[start], size);\n\t\t\t\tif (unlikely(ret))\n\t\t\t\t\tgoto out_cleanup;\n\n\t\t\t\tcur_range_pos += size;\n\t\t\t\tif (cur_range_pos == cur_range_end) {\n\t\t\t\t\t/* Advance to next range.  */\n\t\t\t\t\tif (++cur_range == end_range) {\n\t\t\t\t\t\tcur_range_pos = ~0ULL;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcur_range_pos = cur_range->offset;\n\t\t\t\t\t\tcur_range_end = cur_range->offset + cur_range->size;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (cur_range_pos < chunk_end_offset);\n\t\t}\n\t}\n\n\tif (is_pipe_read &&\n\t    last_offset == rdesc->uncompressed_size - 1 &&\n\t    chunk_table_size)\n\t{\n\t\tu8 dummy;\n\t\t/* If reading a pipable resource from a pipe and the full data\n\t\t * was requested, skip the chunk table at the end so that the\n\t\t * file descriptor is fully clear of the resource after this\n\t\t * returns.  */\n\t\tcur_read_offset += chunk_table_size;\n\t\tret = full_pread(in_fd, &dummy, 1, cur_read_offset - 1);\n\t\tif (unlikely(ret))\n\t\t\tgoto read_error;\n\t}\n\tret = 0;\n\nout_cleanup:\n\tif (decompressor) {\n\t\twimlib_free_decompressor(rdesc->wim->decompressor);\n\t\trdesc->wim->decompressor = decompressor;\n\t\trdesc->wim->decompressor_ctype = ctype;\n\t\trdesc->wim->decompressor_max_block_size = chunk_size;\n\t}\n\tif (chunk_offsets_malloced)\n\t\tFREE(chunk_offsets);\n\tif (ubuf_malloced)\n\t\tFREE(ubuf);\n\tif (cbuf_malloced)\n\t\tFREE(cbuf);\n\treturn ret;\n\noom:\n\tERROR(\"Out of memory while reading compressed WIM resource\");\n\tret = WIMLIB_ERR_NOMEM;\n\tgoto out_cleanup;\n\nread_error:\n\tERROR_WITH_ERRNO(\"Error reading data from WIM file\");\n\tgoto out_cleanup;\n}\n\n/* Read raw data from a file descriptor at the specified offset, feeding the\n * data in nonempty chunks into the specified callback function.  */\nstatic int\nread_raw_file_data(struct filedes *in_fd, u64 offset, u64 size,\n\t\t   const struct consume_chunk_callback *cb,\n\t\t   const tchar *filename)\n{\n\tu8 buf[BUFFER_SIZE];\n\tsize_t bytes_to_read;\n\tint ret;\n\n\twhile (size) {\n\t\tbytes_to_read = min(sizeof(buf), size);\n\t\tret = full_pread(in_fd, buf, bytes_to_read, offset);\n\t\tif (unlikely(ret))\n\t\t\tgoto read_error;\n\t\tret = consume_chunk(cb, buf, bytes_to_read);\n\t\tif (unlikely(ret))\n\t\t\treturn ret;\n\t\tsize -= bytes_to_read;\n\t\toffset += bytes_to_read;\n\t}\n\treturn 0;\n\nread_error:\n\tif (!filename) {\n\t\tERROR_WITH_ERRNO(\"Error reading data from WIM file\");\n\t} else if (ret == WIMLIB_ERR_UNEXPECTED_END_OF_FILE) {\n\t\tERROR(\"\\\"%\"TS\"\\\": File was concurrently truncated\", filename);\n\t\tret = WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED;\n\t} else {\n\t\tERROR_WITH_ERRNO(\"\\\"%\"TS\"\\\": Error reading data\", filename);\n\t}\n\treturn ret;\n}\n\n/* A consume_chunk implementation which simply concatenates all chunks into an\n * in-memory buffer.  */\nstatic int\nbufferer_cb(const void *chunk, size_t size, void *_ctx)\n{\n\tvoid **buf_p = _ctx;\n\n\t*buf_p = mempcpy(*buf_p, chunk, size);\n\treturn 0;\n}\n\n/*\n * Read @size bytes at @offset in the WIM resource described by @rdesc and feed\n * the data into the @cb callback function.\n *\n * @offset and @size are assumed to have already been validated against the\n * resource's uncompressed size.\n *\n * Returns 0 on success; or the first nonzero value returned by the callback\n * function; or a nonzero wimlib error code with errno set as well.\n */\nstatic int\nread_partial_wim_resource(const struct wim_resource_descriptor *rdesc,\n\t\t\t  const u64 offset, const u64 size,\n\t\t\t  const struct consume_chunk_callback *cb,\n\t\t\t  bool recover_data)\n{\n\tif (rdesc->flags & (WIM_RESHDR_FLAG_COMPRESSED |\n\t\t\t    WIM_RESHDR_FLAG_SOLID))\n\t{\n\t\t/* Compressed resource  */\n\t\tif (unlikely(!size))\n\t\t\treturn 0;\n\t\tstruct data_range range = {\n\t\t\t.offset = offset,\n\t\t\t.size = size,\n\t\t};\n\t\treturn read_compressed_wim_resource(rdesc, &range, 1, cb,\n\t\t\t\t\t\t    recover_data);\n\t}\n\n\t/* Uncompressed resource  */\n\treturn read_raw_file_data(&rdesc->wim->in_fd,\n\t\t\t\t  rdesc->offset_in_wim + offset,\n\t\t\t\t  size, cb, NULL);\n}\n\n/* Read the specified range of uncompressed data from the specified blob, which\n * must be located in a WIM file, into the specified buffer.  */\nint\nread_partial_wim_blob_into_buf(const struct blob_descriptor *blob,\n\t\t\t       u64 offset, size_t size, void *buf)\n{\n\tstruct consume_chunk_callback cb = {\n\t\t.func\t= bufferer_cb,\n\t\t.ctx\t= &buf,\n\t};\n\treturn read_partial_wim_resource(blob->rdesc,\n\t\t\t\t\t blob->offset_in_res + offset,\n\t\t\t\t\t size,\n\t\t\t\t\t &cb, false);\n}\n\nstatic int\nnoop_cb(const void *chunk, size_t size, void *_ctx)\n{\n\treturn 0;\n}\n\n/* Skip over the data of the specified WIM resource.  */\nint\nskip_wim_resource(const struct wim_resource_descriptor *rdesc)\n{\n\tstatic const struct consume_chunk_callback cb = {\n\t\t.func = noop_cb,\n\t};\n\treturn read_partial_wim_resource(rdesc, 0,\n\t\t\t\t\t rdesc->uncompressed_size, &cb, false);\n}\n\nstatic int\nread_wim_blob_prefix(const struct blob_descriptor *blob, u64 size,\n\t\t     const struct consume_chunk_callback *cb, bool recover_data)\n{\n\treturn read_partial_wim_resource(blob->rdesc, blob->offset_in_res,\n\t\t\t\t\t size, cb, recover_data);\n}\n\n/* This function handles reading blob data that is located in an external file,\n * such as a file that has been added to the WIM image through execution of a\n * wimlib_add_command.\n *\n * This assumes the file can be accessed using the standard POSIX open(),\n * read(), and close().  On Windows this will not necessarily be the case (since\n * the file may need FILE_FLAG_BACKUP_SEMANTICS to be opened, or the file may be\n * encrypted), so Windows uses its own code for its equivalent case.  */\nstatic int\nread_file_on_disk_prefix(const struct blob_descriptor *blob, u64 size,\n\t\t\t const struct consume_chunk_callback *cb,\n\t\t\t bool recover_data)\n{\n\tint ret;\n\tint raw_fd;\n\tstruct filedes fd;\n\n\traw_fd = topen(blob->file_on_disk, O_BINARY | O_RDONLY);\n\tif (unlikely(raw_fd < 0)) {\n\t\tERROR_WITH_ERRNO(\"Can't open \\\"%\"TS\"\\\"\", blob->file_on_disk);\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\tfiledes_init(&fd, raw_fd);\n\tret = read_raw_file_data(&fd, 0, size, cb, blob->file_on_disk);\n\tfiledes_close(&fd);\n\treturn ret;\n}\n\n#ifdef WITH_FUSE\nstatic int\nread_staging_file_prefix(const struct blob_descriptor *blob, u64 size,\n\t\t\t const struct consume_chunk_callback *cb,\n\t\t\t bool recover_data)\n{\n\tint raw_fd;\n\tstruct filedes fd;\n\tint ret;\n\n\traw_fd = openat(blob->staging_dir_fd, blob->staging_file_name,\n\t\t\tO_RDONLY | O_NOFOLLOW);\n\tif (unlikely(raw_fd < 0)) {\n\t\tERROR_WITH_ERRNO(\"Can't open staging file \\\"%s\\\"\",\n\t\t\t\t blob->staging_file_name);\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\tfiledes_init(&fd, raw_fd);\n\tret = read_raw_file_data(&fd, 0, size, cb, blob->staging_file_name);\n\tfiledes_close(&fd);\n\treturn ret;\n}\n#endif\n\n/* This function handles the trivial case of reading blob data that is, in fact,\n * already located in an in-memory buffer.  */\nstatic int\nread_buffer_prefix(const struct blob_descriptor *blob,\n\t\t   u64 size, const struct consume_chunk_callback *cb,\n\t\t   bool recover_data)\n{\n\tif (unlikely(!size))\n\t\treturn 0;\n\treturn consume_chunk(cb, blob->attached_buffer, size);\n}\n\ntypedef int (*read_blob_prefix_handler_t)(const struct blob_descriptor *blob,\n\t\t\t\t\t  u64 size,\n\t\t\t\t\t  const struct consume_chunk_callback *cb,\n\t\t\t\t\t  bool recover_data);\n\n/*\n * Read the first @size bytes from a generic \"blob\", which may be located in any\n * one of several locations, such as in a WIM resource (possibly compressed), in\n * an external file, or directly in an in-memory buffer.  The blob data will be\n * fed to @cb in chunks that are nonempty but otherwise are of unspecified size.\n *\n * Returns 0 on success; nonzero on error.  A nonzero value will be returned if\n * the blob data cannot be successfully read (for a number of different reasons,\n * depending on the blob location), or if @cb returned nonzero in which case\n * that error code will be returned.  If @recover_data is true, then errors\n * decompressing chunks in WIM resources will be ignored.\n */\nstatic int\nread_blob_prefix(const struct blob_descriptor *blob, u64 size,\n\t\t const struct consume_chunk_callback *cb, bool recover_data)\n{\n\tstatic const read_blob_prefix_handler_t handlers[] = {\n\t\t[BLOB_IN_WIM] = read_wim_blob_prefix,\n\t\t[BLOB_IN_FILE_ON_DISK] = read_file_on_disk_prefix,\n\t\t[BLOB_IN_ATTACHED_BUFFER] = read_buffer_prefix,\n\t#ifdef WITH_FUSE\n\t\t[BLOB_IN_STAGING_FILE] = read_staging_file_prefix,\n\t#endif\n\t#ifdef WITH_NTFS_3G\n\t\t[BLOB_IN_NTFS_VOLUME] = read_ntfs_attribute_prefix,\n\t#endif\n\t#ifdef _WIN32\n\t\t[BLOB_IN_WINDOWS_FILE] = read_windows_file_prefix,\n\t#endif\n\t};\n\twimlib_assert(blob->blob_location < ARRAY_LEN(handlers)\n\t\t      && handlers[blob->blob_location] != NULL);\n\twimlib_assert(size <= blob->size);\n\treturn handlers[blob->blob_location](blob, size, cb, recover_data);\n}\n\nstruct blob_chunk_ctx {\n\tconst struct blob_descriptor *blob;\n\tconst struct read_blob_callbacks *cbs;\n\tu64 offset;\n};\n\nstatic int\nconsume_blob_chunk(const void *chunk, size_t size, void *_ctx)\n{\n\tstruct blob_chunk_ctx *ctx = _ctx;\n\tint ret;\n\n\tret = call_continue_blob(ctx->blob, ctx->offset, chunk, size, ctx->cbs);\n\tctx->offset += size;\n\treturn ret;\n}\n\n/* Read the full data of the specified blob, passing the data into the specified\n * callbacks (all of which are optional).  */\nint\nread_blob_with_cbs(struct blob_descriptor *blob,\n\t\t   const struct read_blob_callbacks *cbs, bool recover_data)\n{\n\tint ret;\n\tstruct blob_chunk_ctx ctx = {\n\t\t.blob = blob,\n\t\t.offset = 0,\n\t\t.cbs = cbs,\n\t};\n\tstruct consume_chunk_callback cb = {\n\t\t.func = consume_blob_chunk,\n\t\t.ctx = &ctx,\n\t};\n\n\tret = call_begin_blob(blob, cbs);\n\tif (unlikely(ret))\n\t\treturn ret;\n\n\tret = read_blob_prefix(blob, blob->size, &cb, recover_data);\n\n\treturn call_end_blob(blob, ret, cbs);\n}\n\n/* Read the full uncompressed data of the specified blob into the specified\n * buffer, which must have space for at least blob->size bytes.  The SHA-1\n * message digest is *not* checked.  */\nint\nread_blob_into_buf(const struct blob_descriptor *blob, void *buf)\n{\n\tstruct consume_chunk_callback cb = {\n\t\t.func\t= bufferer_cb,\n\t\t.ctx\t= &buf,\n\t};\n\treturn read_blob_prefix(blob, blob->size, &cb, false);\n}\n\n/* Retrieve the full uncompressed data of the specified blob.  A buffer large\n * enough hold the data is allocated and returned in @buf_ret.  The SHA-1\n * message digest is *not* checked.  */\nint\nread_blob_into_alloc_buf(const struct blob_descriptor *blob, void **buf_ret)\n{\n\tint ret;\n\tvoid *buf;\n\n\tif (unlikely((size_t)blob->size != blob->size)) {\n\t\tERROR(\"Can't read %\"PRIu64\" byte blob into memory\", blob->size);\n\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\tbuf = MALLOC(blob->size);\n\tif (unlikely(!buf))\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\tret = read_blob_into_buf(blob, buf);\n\tif (unlikely(ret)) {\n\t\tFREE(buf);\n\t\treturn ret;\n\t}\n\n\t*buf_ret = buf;\n\treturn 0;\n}\n\n/* Retrieve the full uncompressed data of a WIM resource specified as a raw\n * `wim_reshdr' and the corresponding WIM file.  A buffer large enough hold the\n * data is allocated and returned in @buf_ret.  */\nint\nwim_reshdr_to_data(const struct wim_reshdr *reshdr, WIMStruct *wim,\n\t\t   void **buf_ret)\n{\n\tstruct wim_resource_descriptor rdesc;\n\tstruct blob_descriptor blob;\n\n\twim_reshdr_to_desc_and_blob(reshdr, wim, &rdesc, &blob);\n\n\treturn read_blob_into_alloc_buf(&blob, buf_ret);\n}\n\n/* Calculate the SHA-1 message digest of the uncompressed data of the specified\n * WIM resource.  */\nint\nwim_reshdr_to_hash(const struct wim_reshdr *reshdr, WIMStruct *wim,\n\t\t   u8 hash[SHA1_HASH_SIZE])\n{\n\tstruct wim_resource_descriptor rdesc;\n\tstruct blob_descriptor blob;\n\tint ret;\n\n\twim_reshdr_to_desc_and_blob(reshdr, wim, &rdesc, &blob);\n\tblob.unhashed = 1;\n\n\tret = sha1_blob(&blob);\n\tif (unlikely(ret))\n\t\treturn ret;\n\n\tcopy_hash(hash, blob.hash);\n\treturn 0;\n}\n\nstruct blobifier_context {\n\tstruct read_blob_callbacks cbs;\n\tstruct blob_descriptor *cur_blob;\n\tstruct blob_descriptor *next_blob;\n\tu64 cur_blob_offset;\n\tstruct blob_descriptor *final_blob;\n\tsize_t list_head_offset;\n};\n\nstatic struct blob_descriptor *\nnext_blob(struct blob_descriptor *blob, size_t list_head_offset)\n{\n\tstruct list_head *cur;\n\n\tcur = (struct list_head*)((u8*)blob + list_head_offset);\n\n\treturn (struct blob_descriptor*)((u8*)cur->next - list_head_offset);\n}\n\n/*\n * A consume_chunk implementation that translates raw resource data into blobs,\n * calling the begin_blob, continue_blob, and end_blob callbacks as appropriate.\n */\nstatic int\nblobifier_cb(const void *chunk, size_t size, void *_ctx)\n{\n\tstruct blobifier_context *ctx = _ctx;\n\tint ret;\n\n\twimlib_assert(ctx->cur_blob != NULL);\n\twimlib_assert(size <= ctx->cur_blob->size - ctx->cur_blob_offset);\n\n\tif (ctx->cur_blob_offset == 0) {\n\t\t/* Starting a new blob.  */\n\t\tret = call_begin_blob(ctx->cur_blob, &ctx->cbs);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tret = call_continue_blob(ctx->cur_blob, ctx->cur_blob_offset,\n\t\t\t\t chunk, size, &ctx->cbs);\n\tctx->cur_blob_offset += size;\n\tif (ret)\n\t\treturn ret;\n\n\tif (ctx->cur_blob_offset == ctx->cur_blob->size) {\n\t\t/* Finished reading all the data for a blob.  */\n\n\t\tctx->cur_blob_offset = 0;\n\n\t\tret = call_end_blob(ctx->cur_blob, 0, &ctx->cbs);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\t/* Advance to next blob.  */\n\t\tctx->cur_blob = ctx->next_blob;\n\t\tif (ctx->cur_blob != NULL) {\n\t\t\tif (ctx->cur_blob != ctx->final_blob)\n\t\t\t\tctx->next_blob = next_blob(ctx->cur_blob,\n\t\t\t\t\t\t\t   ctx->list_head_offset);\n\t\t\telse\n\t\t\t\tctx->next_blob = NULL;\n\t\t}\n\t}\n\treturn 0;\n}\n\nstruct hasher_context {\n\tstruct sha1_ctx sha_ctx;\n\tint flags;\n\tstruct read_blob_callbacks cbs;\n};\n\n/* Callback for starting to read a blob while calculating its SHA-1 message\n * digest.  */\nstatic int\nhasher_begin_blob(struct blob_descriptor *blob, void *_ctx)\n{\n\tstruct hasher_context *ctx = _ctx;\n\n\tsha1_init(&ctx->sha_ctx);\n\tblob->corrupted = 0;\n\n\treturn call_begin_blob(blob, &ctx->cbs);\n}\n\n/*\n * A continue_blob() implementation that continues calculating the SHA-1 message\n * digest of the blob being read, then optionally passes the data on to another\n * continue_blob() implementation.  This allows checking the SHA-1 message\n * digest of a blob being extracted, for example.\n */\nstatic int\nhasher_continue_blob(const struct blob_descriptor *blob, u64 offset,\n\t\t     const void *chunk, size_t size, void *_ctx)\n{\n\tstruct hasher_context *ctx = _ctx;\n\n\tsha1_update(&ctx->sha_ctx, chunk, size);\n\n\treturn call_continue_blob(blob, offset, chunk, size, &ctx->cbs);\n}\n\nstatic int\nreport_sha1_mismatch(struct blob_descriptor *blob,\n\t\t     const u8 actual_hash[SHA1_HASH_SIZE], bool recover_data)\n{\n\ttchar expected_hashstr[SHA1_HASH_STRING_LEN];\n\ttchar actual_hashstr[SHA1_HASH_STRING_LEN];\n\n\twimlib_assert(blob->blob_location != BLOB_NONEXISTENT);\n\twimlib_assert(blob->blob_location != BLOB_IN_ATTACHED_BUFFER);\n\n\tsprint_hash(blob->hash, expected_hashstr);\n\tsprint_hash(actual_hash, actual_hashstr);\n\n\tblob->corrupted = 1;\n\n\tif (blob_is_in_file(blob)) {\n\t\tERROR(\"A file was concurrently modified!\\n\"\n\t\t      \"        Path: \\\"%\"TS\"\\\"\\n\"\n\t\t      \"        Expected SHA-1: %\"TS\"\\n\"\n\t\t      \"        Actual SHA-1: %\"TS\"\\n\",\n\t\t      blob_file_path(blob), expected_hashstr, actual_hashstr);\n\t\treturn WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED;\n\t} else if (blob->blob_location == BLOB_IN_WIM) {\n\t\tconst struct wim_resource_descriptor *rdesc = blob->rdesc;\n\n\t\t(recover_data ? wimlib_warning : wimlib_error)(\n\t\t      T(\"A WIM resource is corrupted!\\n\"\n\t\t\t\"        WIM file: \\\"%\"TS\"\\\"\\n\"\n\t\t\t\"        Blob uncompressed size: %\"PRIu64\"\\n\"\n\t\t\t\"        Resource offset in WIM: %\"PRIu64\"\\n\"\n\t\t\t\"        Resource uncompressed size: %\"PRIu64\"\\n\"\n\t\t\t\"        Resource size in WIM: %\"PRIu64\"\\n\"\n\t\t\t\"        Resource flags: 0x%x%\"TS\"\\n\"\n\t\t\t\"        Resource compression type: %\"TS\"\\n\"\n\t\t\t\"        Resource compression chunk size: %\"PRIu32\"\\n\"\n\t\t\t\"        Expected SHA-1: %\"TS\"\\n\"\n\t\t\t\"        Actual SHA-1: %\"TS\"\\n\"),\n\t\t      rdesc->wim->filename,\n\t\t      blob->size,\n\t\t      rdesc->offset_in_wim,\n\t\t      rdesc->uncompressed_size,\n\t\t      rdesc->size_in_wim,\n\t\t      (unsigned int)rdesc->flags,\n\t\t      (rdesc->is_pipable ? T(\", pipable\") : T(\"\")),\n\t\t      wimlib_get_compression_type_string(\n\t\t\t\t\t\trdesc->compression_type),\n\t\t      rdesc->chunk_size,\n\t\t      expected_hashstr, actual_hashstr);\n\t\tif (recover_data)\n\t\t\treturn 0;\n\t\treturn WIMLIB_ERR_INVALID_RESOURCE_HASH;\n\t} else {\n\t\tERROR(\"File data was concurrently modified!\\n\"\n\t\t      \"        Location ID: %d\\n\"\n\t\t      \"        Expected SHA-1: %\"TS\"\\n\"\n\t\t      \"        Actual SHA-1: %\"TS\"\\n\",\n\t\t      (int)blob->blob_location,\n\t\t      expected_hashstr, actual_hashstr);\n\t\treturn WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED;\n\t}\n}\n\n/* Callback for finishing reading a blob while calculating its SHA-1 message\n * digest.  */\nstatic int\nhasher_end_blob(struct blob_descriptor *blob, int status, void *_ctx)\n{\n\tstruct hasher_context *ctx = _ctx;\n\tu8 hash[SHA1_HASH_SIZE];\n\tint ret;\n\n\tif (unlikely(status)) {\n\t\t/* Error occurred; the full blob may not have been read.  */\n\t\tret = status;\n\t\tgoto out_next_cb;\n\t}\n\n\t/* Retrieve the final SHA-1 message digest.  */\n\tsha1_final(&ctx->sha_ctx, hash);\n\n\t/* Set the SHA-1 message digest of the blob, or compare the calculated\n\t * value with stored value.  */\n\tif (blob->unhashed) {\n\t\tif (ctx->flags & COMPUTE_MISSING_BLOB_HASHES)\n\t\t\tcopy_hash(blob->hash, hash);\n\t} else if ((ctx->flags & VERIFY_BLOB_HASHES) &&\n\t\t   unlikely(!hashes_equal(hash, blob->hash)))\n\t{\n\t\tret = report_sha1_mismatch(blob, hash,\n\t\t\t\t\t   ctx->flags & RECOVER_DATA);\n\t\tgoto out_next_cb;\n\t}\n\tret = 0;\nout_next_cb:\n\treturn call_end_blob(blob, ret, &ctx->cbs);\n}\n\n/* Read the full data of the specified blob, passing the data into the specified\n * callbacks (all of which are optional) and either checking or computing the\n * SHA-1 message digest of the blob.  */\nint\nread_blob_with_sha1(struct blob_descriptor *blob,\n\t\t    const struct read_blob_callbacks *cbs, bool recover_data)\n{\n\tstruct hasher_context hasher_ctx = {\n\t\t.flags = VERIFY_BLOB_HASHES | COMPUTE_MISSING_BLOB_HASHES |\n\t\t\t (recover_data ? RECOVER_DATA : 0),\n\t\t.cbs = *cbs,\n\t};\n\tstruct read_blob_callbacks hasher_cbs = {\n\t\t.begin_blob\t= hasher_begin_blob,\n\t\t.continue_blob\t= hasher_continue_blob,\n\t\t.end_blob\t= hasher_end_blob,\n\t\t.ctx\t\t= &hasher_ctx,\n\t};\n\treturn read_blob_with_cbs(blob, &hasher_cbs, recover_data);\n}\n\nstatic int\nread_blobs_in_solid_resource(struct blob_descriptor *first_blob,\n\t\t\t     struct blob_descriptor *last_blob,\n\t\t\t     size_t blob_count,\n\t\t\t     size_t list_head_offset,\n\t\t\t     const struct read_blob_callbacks *sink_cbs,\n\t\t\t     bool recover_data)\n{\n\tstruct data_range *ranges;\n\tbool ranges_malloced;\n\tstruct blob_descriptor *cur_blob;\n\tsize_t i;\n\tint ret;\n\tu64 ranges_alloc_size;\n\n\t/* Setup data ranges array (one range per blob to read); this way\n\t * read_compressed_wim_resource() does not need to be aware of blobs.\n\t */\n\n\tranges_alloc_size = (u64)blob_count * sizeof(ranges[0]);\n\n\tif (unlikely((size_t)ranges_alloc_size != ranges_alloc_size))\n\t\tgoto oom;\n\n\tif (ranges_alloc_size <= STACK_MAX) {\n\t\tranges = alloca(ranges_alloc_size);\n\t\tranges_malloced = false;\n\t} else {\n\t\tranges = MALLOC(ranges_alloc_size);\n\t\tif (unlikely(!ranges))\n\t\t\tgoto oom;\n\t\tranges_malloced = true;\n\t}\n\n\tfor (i = 0, cur_blob = first_blob;\n\t     i < blob_count;\n\t     i++, cur_blob = next_blob(cur_blob, list_head_offset))\n\t{\n\t\tranges[i].offset = cur_blob->offset_in_res;\n\t\tranges[i].size = cur_blob->size;\n\t}\n\n\tstruct blobifier_context blobifier_ctx = {\n\t\t.cbs\t\t\t= *sink_cbs,\n\t\t.cur_blob\t\t= first_blob,\n\t\t.next_blob\t\t= next_blob(first_blob, list_head_offset),\n\t\t.cur_blob_offset\t= 0,\n\t\t.final_blob\t\t= last_blob,\n\t\t.list_head_offset\t= list_head_offset,\n\t};\n\tstruct consume_chunk_callback cb = {\n\t\t.func\t= blobifier_cb,\n\t\t.ctx\t= &blobifier_ctx,\n\t};\n\n\tret = read_compressed_wim_resource(first_blob->rdesc, ranges,\n\t\t\t\t\t   blob_count, &cb, recover_data);\n\n\tif (ranges_malloced)\n\t\tFREE(ranges);\n\n\tif (unlikely(ret && blobifier_ctx.cur_blob_offset != 0)) {\n\t\tret = call_end_blob(blobifier_ctx.cur_blob, ret,\n\t\t\t\t    &blobifier_ctx.cbs);\n\t}\n\treturn ret;\n\noom:\n\tERROR(\"Too many blobs in one resource!\");\n\treturn WIMLIB_ERR_NOMEM;\n}\n\n/*\n * Read a list of blobs, each of which may be in any supported location (e.g.\n * in a WIM or in an external file).  This function optimizes the case where\n * multiple blobs are combined into a single solid compressed WIM resource by\n * reading the blobs in sequential order, only decompressing the solid resource\n * one time.\n *\n * @blob_list\n *\tList of blobs to read.\n * @list_head_offset\n *\tOffset of the `struct list_head' within each `struct blob_descriptor'\n *\tthat makes up the @blob_list.\n * @cbs\n *\tCallback functions to accept the blob data.\n * @flags\n *\tBitwise OR of zero or more of the following flags:\n *\n *\tVERIFY_BLOB_HASHES:\n *\t\tFor all blobs being read that have already had SHA-1 message\n *\t\tdigests computed, calculate the SHA-1 message digest of the read\n *\t\tdata and compare it with the previously computed value.  If they\n *\t\tdo not match, return WIMLIB_ERR_INVALID_RESOURCE_HASH (unless\n *\t\tRECOVER_DATA is also set, in which case just issue a warning).\n *\n *\tCOMPUTE_MISSING_BLOB_HASHES\n *\t\tFor all blobs being read that have not yet had their SHA-1\n *\t\tmessage digests computed, calculate and save their SHA-1 message\n *\t\tdigests.\n *\n *\tBLOB_LIST_ALREADY_SORTED\n *\t\t@blob_list is already sorted in sequential order for reading.\n *\n *\tRECOVER_DATA\n *\t\tDon't consider corrupted blob data to be an error.\n *\n * The callback functions are allowed to delete the current blob from the list\n * if necessary.\n *\n * Returns 0 on success; a nonzero error code on failure.  Failure can occur due\n * to an error reading the data or due to an error status being returned by any\n * of the callback functions.\n */\nint\nread_blob_list(struct list_head *blob_list, size_t list_head_offset,\n\t       const struct read_blob_callbacks *cbs, int flags)\n{\n\tint ret;\n\tstruct list_head *cur, *next;\n\tstruct blob_descriptor *blob;\n\tstruct hasher_context *hasher_ctx;\n\tstruct read_blob_callbacks *sink_cbs;\n\n\tif (!(flags & BLOB_LIST_ALREADY_SORTED)) {\n\t\tret = sort_blob_list_by_sequential_order(blob_list,\n\t\t\t\t\t\t\t list_head_offset);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tif (flags & (VERIFY_BLOB_HASHES | COMPUTE_MISSING_BLOB_HASHES)) {\n\t\thasher_ctx = alloca(sizeof(*hasher_ctx));\n\t\t*hasher_ctx = (struct hasher_context) {\n\t\t\t.flags\t= flags,\n\t\t\t.cbs\t= *cbs,\n\t\t};\n\t\tsink_cbs = alloca(sizeof(*sink_cbs));\n\t\t*sink_cbs = (struct read_blob_callbacks) {\n\t\t\t.begin_blob\t= hasher_begin_blob,\n\t\t\t.continue_blob\t= hasher_continue_blob,\n\t\t\t.end_blob\t= hasher_end_blob,\n\t\t\t.ctx\t\t= hasher_ctx,\n\t\t};\n\t} else {\n\t\tsink_cbs = (struct read_blob_callbacks *)cbs;\n\t}\n\n\tfor (cur = blob_list->next, next = cur->next;\n\t     cur != blob_list;\n\t     cur = next, next = cur->next)\n\t{\n\t\tblob = (struct blob_descriptor*)((u8*)cur - list_head_offset);\n\n\t\tif (blob->blob_location == BLOB_IN_WIM &&\n\t\t    blob->size != blob->rdesc->uncompressed_size)\n\t\t{\n\t\t\tstruct blob_descriptor *blob_next, *blob_last;\n\t\t\tstruct list_head *next2;\n\t\t\tsize_t blob_count;\n\n\t\t\t/* The next blob is a proper sub-sequence of a WIM\n\t\t\t * resource.  See if there are other blobs in the same\n\t\t\t * resource that need to be read.  Since\n\t\t\t * sort_blob_list_by_sequential_order() sorted the blobs\n\t\t\t * by offset in the WIM, this can be determined by\n\t\t\t * simply scanning forward in the list.  */\n\n\t\t\tblob_last = blob;\n\t\t\tblob_count = 1;\n\t\t\tfor (next2 = next;\n\t\t\t     next2 != blob_list\n\t\t\t     && (blob_next = (struct blob_descriptor*)\n\t\t\t\t\t\t((u8*)next2 - list_head_offset),\n\t\t\t\t blob_next->blob_location == BLOB_IN_WIM\n\t\t\t\t && blob_next->rdesc == blob->rdesc);\n\t\t\t     next2 = next2->next)\n\t\t\t{\n\t\t\t\tblob_last = blob_next;\n\t\t\t\tblob_count++;\n\t\t\t}\n\t\t\tif (blob_count > 1) {\n\t\t\t\t/* Reading multiple blobs combined into a single\n\t\t\t\t * WIM resource.  They are in the blob list,\n\t\t\t\t * sorted by offset; @blob specifies the first\n\t\t\t\t * blob in the resource that needs to be read\n\t\t\t\t * and @blob_last specifies the last blob in the\n\t\t\t\t * resource that needs to be read.  */\n\t\t\t\tnext = next2;\n\t\t\t\tret = read_blobs_in_solid_resource(blob, blob_last,\n\t\t\t\t\t\t\t\t   blob_count,\n\t\t\t\t\t\t\t\t   list_head_offset,\n\t\t\t\t\t\t\t\t   sink_cbs,\n\t\t\t\t\t\t\t\t   flags & RECOVER_DATA);\n\t\t\t\tif (ret)\n\t\t\t\t\treturn ret;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tret = read_blob_with_cbs(blob, sink_cbs, flags & RECOVER_DATA);\n\t\tif (unlikely(ret && ret != BEGIN_BLOB_STATUS_SKIP_BLOB))\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nstatic int\nextract_chunk_to_fd(const void *chunk, size_t size, void *_fd)\n{\n\tstruct filedes *fd = _fd;\n\tint ret = full_write(fd, chunk, size);\n\tif (unlikely(ret))\n\t\tERROR_WITH_ERRNO(\"Error writing to file descriptor\");\n\treturn ret;\n}\n\nstatic int\nextract_blob_chunk_to_fd(const struct blob_descriptor *blob, u64 offset,\n\t\t\t const void *chunk, size_t size, void *_fd)\n{\n\treturn extract_chunk_to_fd(chunk, size, _fd);\n}\n\n/* Extract the first @size bytes of the specified blob to the specified file\n * descriptor.  This does *not* check the SHA-1 message digest.  */\nint\nextract_blob_prefix_to_fd(struct blob_descriptor *blob, u64 size,\n\t\t\t  struct filedes *fd)\n{\n\tstruct consume_chunk_callback cb = {\n\t\t.func\t= extract_chunk_to_fd,\n\t\t.ctx\t= fd,\n\t};\n\treturn read_blob_prefix(blob, size, &cb, false);\n}\n\n/* Extract the full uncompressed contents of the specified blob to the specified\n * file descriptor.  This checks the SHA-1 message digest.  */\nint\nextract_blob_to_fd(struct blob_descriptor *blob, struct filedes *fd,\n\t\t   bool recover_data)\n{\n\tstruct read_blob_callbacks cbs = {\n\t\t.continue_blob\t= extract_blob_chunk_to_fd,\n\t\t.ctx\t\t= fd,\n\t};\n\treturn read_blob_with_sha1(blob, &cbs, recover_data);\n}\n\n/* Calculate the SHA-1 message digest of a blob and store it in @blob->hash.  */\nint\nsha1_blob(struct blob_descriptor *blob)\n{\n\tstatic const struct read_blob_callbacks cbs = { 0 };\n\treturn read_blob_with_sha1(blob, &cbs, false);\n}\n\n/*\n * Convert a short WIM resource header to a stand-alone WIM resource descriptor.\n *\n * Note: for solid resources some fields still need to be overridden.\n */\nvoid\nwim_reshdr_to_desc(const struct wim_reshdr *reshdr, WIMStruct *wim,\n\t\t   struct wim_resource_descriptor *rdesc)\n{\n\trdesc->wim = wim;\n\trdesc->offset_in_wim = reshdr->offset_in_wim;\n\trdesc->size_in_wim = reshdr->size_in_wim;\n\trdesc->uncompressed_size = reshdr->uncompressed_size;\n\tINIT_LIST_HEAD(&rdesc->blob_list);\n\trdesc->flags = reshdr->flags;\n\trdesc->is_pipable = wim_is_pipable(wim);\n\tif (rdesc->flags & WIM_RESHDR_FLAG_COMPRESSED) {\n\t\trdesc->compression_type = wim->compression_type;\n\t\trdesc->chunk_size = wim->chunk_size;\n\t} else {\n\t\trdesc->compression_type = WIMLIB_COMPRESSION_TYPE_NONE;\n\t\trdesc->chunk_size = 0;\n\t}\n}\n\n/*\n * Convert the short WIM resource header @reshdr to a stand-alone WIM resource\n * descriptor @rdesc, then set @blob to consist of that entire resource.  This\n * should only be used for non-solid resources!\n */\nvoid\nwim_reshdr_to_desc_and_blob(const struct wim_reshdr *reshdr, WIMStruct *wim,\n\t\t\t    struct wim_resource_descriptor *rdesc,\n\t\t\t    struct blob_descriptor *blob)\n{\n\twim_reshdr_to_desc(reshdr, wim, rdesc);\n\tblob->size = rdesc->uncompressed_size;\n\tblob_set_is_located_in_wim_resource(blob, rdesc, 0);\n}\n\n/* Import a WIM resource header from the on-disk format.  */\nvoid\nget_wim_reshdr(const struct wim_reshdr_disk *disk_reshdr,\n\t       struct wim_reshdr *reshdr)\n{\n\treshdr->offset_in_wim = le64_to_cpu(disk_reshdr->offset_in_wim);\n\treshdr->size_in_wim = (((u64)disk_reshdr->size_in_wim[0] <<  0) |\n\t\t\t       ((u64)disk_reshdr->size_in_wim[1] <<  8) |\n\t\t\t       ((u64)disk_reshdr->size_in_wim[2] << 16) |\n\t\t\t       ((u64)disk_reshdr->size_in_wim[3] << 24) |\n\t\t\t       ((u64)disk_reshdr->size_in_wim[4] << 32) |\n\t\t\t       ((u64)disk_reshdr->size_in_wim[5] << 40) |\n\t\t\t       ((u64)disk_reshdr->size_in_wim[6] << 48));\n\treshdr->uncompressed_size = le64_to_cpu(disk_reshdr->uncompressed_size);\n\treshdr->flags = disk_reshdr->flags;\n}\n\n/* Export a WIM resource header to the on-disk format.  */\nvoid\nput_wim_reshdr(const struct wim_reshdr *reshdr,\n\t       struct wim_reshdr_disk *disk_reshdr)\n{\n\tdisk_reshdr->size_in_wim[0] = reshdr->size_in_wim  >>  0;\n\tdisk_reshdr->size_in_wim[1] = reshdr->size_in_wim  >>  8;\n\tdisk_reshdr->size_in_wim[2] = reshdr->size_in_wim  >> 16;\n\tdisk_reshdr->size_in_wim[3] = reshdr->size_in_wim  >> 24;\n\tdisk_reshdr->size_in_wim[4] = reshdr->size_in_wim  >> 32;\n\tdisk_reshdr->size_in_wim[5] = reshdr->size_in_wim  >> 40;\n\tdisk_reshdr->size_in_wim[6] = reshdr->size_in_wim  >> 48;\n\tdisk_reshdr->flags = reshdr->flags;\n\tdisk_reshdr->offset_in_wim = cpu_to_le64(reshdr->offset_in_wim);\n\tdisk_reshdr->uncompressed_size = cpu_to_le64(reshdr->uncompressed_size);\n}\n"
  },
  {
    "path": "src/wimlib/scan.c",
    "content": "/*\n * scan.c - Helper routines for directory tree scans\n */\n\n/*\n * Copyright (C) 2013-2017 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <string.h>\n\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/pattern.h\"\n#include \"wimlib/progress.h\"\n#include \"wimlib/scan.h\"\n#include \"wimlib/textfile.h\"\n\n/*\n * Tally a file (or directory) that has been scanned for a capture operation,\n * and possibly call the progress function provided by the library user.\n *\n * @params\n *\tCurrent path, flags, optional progress function, and progress data for\n *\tthe scan operation.\n * @status\n *\tStatus of the scanned file.\n * @inode\n *\tIf @status is WIMLIB_SCAN_DENTRY_OK, this is a pointer to the WIM inode\n *\tthat has been created for the scanned file.  The first time the file is\n *\tseen, inode->i_nlink will be 1.  On subsequent visits of the same inode\n *\tvia additional hard links, inode->i_nlink will be greater than 1.\n */\nint\ndo_scan_progress(struct scan_params *params, int status,\n\t\t const struct wim_inode *inode)\n{\n\tint ret;\n\ttchar *cookie;\n\n\tswitch (status) {\n\tcase WIMLIB_SCAN_DENTRY_OK:\n\t\tif (!(params->add_flags & WIMLIB_ADD_FLAG_VERBOSE))\n\t\t\treturn 0;\n\t\tbreak;\n\tcase WIMLIB_SCAN_DENTRY_UNSUPPORTED:\n\tcase WIMLIB_SCAN_DENTRY_EXCLUDED:\n\tcase WIMLIB_SCAN_DENTRY_FIXED_SYMLINK:\n\tcase WIMLIB_SCAN_DENTRY_NOT_FIXED_SYMLINK:\n\t\tif (!(params->add_flags & WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE))\n\t\t\treturn 0;\n\t\tbreak;\n\t}\n\tparams->progress.scan.cur_path = params->cur_path;\n\tparams->progress.scan.status = status;\n\tif (status == WIMLIB_SCAN_DENTRY_OK) {\n\n\t\t/* The first time the inode is seen, tally all its streams.  */\n\t\tif (inode->i_nlink == 1) {\n\t\t\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\t\t\tconst struct blob_descriptor *blob =\n\t\t\t\t\tstream_blob_resolved(&inode->i_streams[i]);\n\t\t\t\tif (blob)\n\t\t\t\t\tparams->progress.scan.num_bytes_scanned += blob->size;\n\t\t\t}\n\t\t}\n\n\t\t/* Tally the file itself, counting every hard link.  It's\n\t\t * debatable whether every link should be counted, but counting\n\t\t * every link makes the statistics consistent with the ones\n\t\t * placed in the FILECOUNT and DIRCOUNT elements of the WIM\n\t\t * file's XML document.  It also avoids possible user confusion\n\t\t * if the number of files reported were to be lower than that\n\t\t * displayed by some other software such as file browsers.  */\n\t\tif (inode_is_directory(inode))\n\t\t\tparams->progress.scan.num_dirs_scanned++;\n\t\telse\n\t\t\tparams->progress.scan.num_nondirs_scanned++;\n\t}\n\n\t/* Call the user-provided progress function.  */\n\n\tcookie = progress_get_win32_path(params->progress.scan.cur_path);\n\tret = call_progress(params->progfunc, WIMLIB_PROGRESS_MSG_SCAN_DENTRY,\n\t\t\t     &params->progress, params->progctx);\n\tprogress_put_win32_path(cookie);\n\treturn ret;\n}\n\n/*\n * Given a null-terminated pathname pattern @pat that has been read from line\n * @line_no of the file @path, validate and canonicalize the pattern.\n *\n * On success, returns 0.\n * On failure, returns WIMLIB_ERR_INVALID_CAPTURE_CONFIG.\n * In either case, @pat may have been modified in-place (and possibly\n * shortened).\n */\nint\nmangle_pat(tchar *pat, const tchar *path, unsigned long line_no)\n{\n\tif (!is_any_path_separator(pat[0]) &&\n\t    pat[0] != T('\\0') && pat[1] == T(':'))\n\t{\n\t\t/* Pattern begins with drive letter.  */\n\n\t\tif (!is_any_path_separator(pat[2])) {\n\t\t\t/* Something like c:file, which is actually a path\n\t\t\t * relative to the current working directory on the c:\n\t\t\t * drive.  We require paths with drive letters to be\n\t\t\t * absolute.  */\n\t\t\tERROR(\"%\"TS\":%lu: Invalid pattern \\\"%\"TS\"\\\":\\n\"\n\t\t\t      \"        Patterns including drive letters must be absolute!\\n\"\n\t\t\t      \"        Maybe try \\\"%\"TC\":%\"TC\"%\"TS\"\\\"?\\n\",\n\t\t\t      path, line_no, pat,\n\t\t\t      pat[0], OS_PREFERRED_PATH_SEPARATOR, &pat[2]);\n\t\t\treturn WIMLIB_ERR_INVALID_CAPTURE_CONFIG;\n\t\t}\n\n\t\tWARNING(\"%\"TS\":%lu: Pattern \\\"%\"TS\"\\\" starts with a drive \"\n\t\t\t\"letter, which is being removed.\",\n\t\t\tpath, line_no, pat);\n\n\t\t/* Strip the drive letter.  */\n\t\ttmemmove(pat, pat + 2, tstrlen(pat + 2) + 1);\n\t}\n\n\t/* Collapse consecutive path separators, and translate both / and \\ into\n\t * / (UNIX) or \\ (Windows).\n\t *\n\t * Note: we expect that this function produces patterns that can be used\n\t * for both filesystem paths and WIM paths, so the desired path\n\t * separators must be the same.  */\n\tSTATIC_ASSERT(OS_PREFERRED_PATH_SEPARATOR == WIM_PATH_SEPARATOR);\n\tdo_canonicalize_path(pat, pat);\n\n\t/* Relative patterns can only match file names, so they must be\n\t * single-component only.  */\n\tif (pat[0] != OS_PREFERRED_PATH_SEPARATOR &&\n\t    tstrchr(pat, OS_PREFERRED_PATH_SEPARATOR))\n\t{\n\t\tERROR(\"%\"TS\":%lu: Invalid pattern \\\"%\"TS\"\\\":\\n\"\n\t\t      \"        Relative patterns can only include one path component!\\n\"\n\t\t      \"        Maybe try \\\"%\"TC\"%\"TS\"\\\"?\",\n\t\t      path, line_no, pat, OS_PREFERRED_PATH_SEPARATOR, pat);\n\t\treturn WIMLIB_ERR_INVALID_CAPTURE_CONFIG;\n\t}\n\n\treturn 0;\n}\n\n/*\n * Read, parse, and validate a capture configuration file from either an on-disk\n * file or an in-memory buffer.\n *\n * To read from a file, specify @config_file, and use NULL for @buf.\n * To read from a buffer, specify @buf and @bufsize.\n *\n * @config must be initialized to all 0's.\n *\n * On success, 0 will be returned, and the resulting capture configuration will\n * be stored in @config.\n *\n * On failure, a positive error code will be returned, and the contents of\n * @config will be invalidated.\n */\nint\nread_capture_config(const tchar *config_file, const void *buf,\n\t\t    size_t bufsize, struct capture_config *config)\n{\n\tint ret;\n\n\t/* [PrepopulateList] is used for apply, not capture.  But since we do\n\t * understand it, recognize it, thereby avoiding the unrecognized\n\t * section warning, but discard the resulting strings.\n\t *\n\t * We currently ignore [CompressionExclusionList] and\n\t * [CompressionFolderList].  This is a known issue that doesn't seem to\n\t * have any real consequences, so don't issue warnings about not\n\t * recognizing those sections.  */\n\tSTRING_LIST(prepopulate_pats);\n\tSTRING_LIST(compression_exclusion_pats);\n\tSTRING_LIST(compression_folder_pats);\n\n\tstruct text_file_section sections[] = {\n\t\t{T(\"ExclusionList\"),\n\t\t\t&config->exclusion_pats},\n\t\t{T(\"ExclusionException\"),\n\t\t\t&config->exclusion_exception_pats},\n\t\t{T(\"PrepopulateList\"),\n\t\t\t&prepopulate_pats},\n\t\t{T(\"CompressionExclusionList\"),\n\t\t\t&compression_exclusion_pats},\n\t\t{T(\"CompressionFolderList\"),\n\t\t\t&compression_folder_pats},\n\t};\n\tvoid *mem;\n\n\tret = load_text_file(config_file, buf, bufsize, &mem,\n\t\t\t     sections, ARRAY_LEN(sections),\n\t\t\t     LOAD_TEXT_FILE_REMOVE_QUOTES, mangle_pat);\n\tif (ret) {\n\t\tERROR(\"Failed to load capture configuration file \\\"%\"TS\"\\\"\",\n\t\t      config_file);\n\t\tswitch (ret) {\n\t\tcase WIMLIB_ERR_INVALID_UTF8_STRING:\n\t\tcase WIMLIB_ERR_INVALID_UTF16_STRING:\n\t\t\tERROR(\"Note: the capture configuration file must be \"\n\t\t\t      \"valid UTF-8 or UTF-16LE\");\n\t\t\tret = WIMLIB_ERR_INVALID_CAPTURE_CONFIG;\n\t\t\tbreak;\n\t\tcase WIMLIB_ERR_OPEN:\n\t\tcase WIMLIB_ERR_STAT:\n\t\tcase WIMLIB_ERR_NOMEM:\n\t\tcase WIMLIB_ERR_READ:\n\t\t\tret = WIMLIB_ERR_UNABLE_TO_READ_CAPTURE_CONFIG;\n\t\t\tbreak;\n\t\t}\n\t\treturn ret;\n\t}\n\n\tFREE(prepopulate_pats.strings);\n\tFREE(compression_exclusion_pats.strings);\n\tFREE(compression_folder_pats.strings);\n\n\tconfig->buf = mem;\n\treturn 0;\n}\n\nvoid\ndestroy_capture_config(struct capture_config *config)\n{\n\tFREE(config->exclusion_pats.strings);\n\tFREE(config->exclusion_exception_pats.strings);\n\tFREE(config->buf);\n}\n\n/*\n * Determine whether @path matches any of the patterns in @list.\n * Path separators in @path must be WIM_PATH_SEPARATOR.\n */\nbool\nmatch_pattern_list(const tchar *path, const struct string_list *list,\n\t\t   int match_flags)\n{\n\tfor (size_t i = 0; i < list->num_strings; i++)\n\t\tif (match_path(path, list->strings[i], match_flags))\n\t\t\treturn true;\n\treturn false;\n}\n\n/*\n * Determine if a file should be excluded from capture.\n *\n * This function tests exclusions from both possible sources of exclusions:\n *\n *\t(1) The capture configuration file\n *\t(2) The user-provided progress function\n *\n * params->root_path_nchars must have been set beforehand.  Example for UNIX: if\n * the capture root directory is \"foobar/subdir\", then all paths will be\n * provided starting with \"foobar/subdir\", so params->root_path_nchars must have\n * been set to strlen(\"foobar/subdir\") so that the appropriate path suffix can\n * be matched against the patterns in the exclusion list.\n *\n * Returns:\n *\t< 0 if excluded\n *\t= 0 if not excluded and no error\n *\t> 0 (wimlib error code) if error\n */\nint\ntry_exclude(const struct scan_params *params)\n{\n\tint ret;\n\n\tif (params->config) {\n\t\tconst tchar *path = params->cur_path + params->root_path_nchars;\n\t\tif (match_pattern_list(path, &params->config->exclusion_pats,\n\t\t\t\t       MATCH_RECURSIVELY) &&\n\t\t    !match_pattern_list(path, &params->config->exclusion_exception_pats,\n\t\t\t\t\tMATCH_RECURSIVELY | MATCH_ANCESTORS))\n\t\t\treturn -1;\n\t}\n\n\tif (unlikely(params->add_flags & WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION)) {\n\n\t\tunion wimlib_progress_info info;\n\t\ttchar *cookie;\n\n\t\tinfo.test_file_exclusion.path = params->cur_path;\n\t\tinfo.test_file_exclusion.will_exclude = false;\n\n\t\tcookie = progress_get_win32_path(info.test_file_exclusion.path);\n\n\t\tret = call_progress(params->progfunc, WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION,\n\t\t\t\t    &info, params->progctx);\n\n\t\tprogress_put_win32_path(cookie);\n\n\t\tif (ret)\n\t\t\treturn ret;\n\t\tif (info.test_file_exclusion.will_exclude)\n\t\t\treturn -1;\n\t}\n\n\treturn 0;\n}\n\n/*\n * Determine whether a directory entry of the specified name should be ignored.\n * This is a lower level function which runs prior to try_exclude().  It handles\n * the standard '.' and '..' entries, which show up in directory listings but\n * should not be archived.  It also checks for odd filenames that usually should\n * not exist but could cause problems if archiving them were to be attempted.\n */\nbool\nshould_ignore_filename(const tchar *name, const int name_nchars)\n{\n\tif (name_nchars <= 0) {\n\t\tWARNING(\"Ignoring empty filename\");\n\t\treturn true;\n\t}\n\n\tif (name[0] == T('.') &&\n\t    (name_nchars == 1 || (name_nchars == 2 && name[1] == T('.'))))\n\t\treturn true;\n\n\tfor (int i = 0; i < name_nchars; i++) {\n\t\tif (name[i] == T('\\0')) {\n\t\t\tWARNING(\"Ignoring filename containing embedded null character\");\n\t\t\treturn true;\n\t\t}\n\t\tif (name[i] == OS_PREFERRED_PATH_SEPARATOR) {\n\t\t\tWARNING(\"Ignoring filename containing embedded path separator\");\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/* Attach a newly scanned directory tree to its parent directory, with duplicate\n * handling.  */\nvoid\nattach_scanned_tree(struct wim_dentry *parent, struct wim_dentry *child,\n\t\t    struct blob_table *blob_table)\n{\n\tstruct wim_dentry *duplicate;\n\n\tif (child && (duplicate = dentry_add_child(parent, child))) {\n\t\tWARNING(\"Duplicate file path: \\\"%\"TS\"\\\".  Only capturing \"\n\t\t\t\"the first version.\", dentry_full_path(duplicate));\n\t\tfree_dentry_tree(child, blob_table);\n\t}\n}\n\n/* Set the path at which the directory tree scan is beginning. */\nint\npathbuf_init(struct scan_params *params, const tchar *root_path)\n{\n\tsize_t nchars = tstrlen(root_path);\n\tsize_t alloc_nchars = nchars + 1 + 1024;\n\n\tparams->cur_path = MALLOC(alloc_nchars * sizeof(tchar));\n\tif (!params->cur_path)\n\t\treturn WIMLIB_ERR_NOMEM;\n\ttmemcpy(params->cur_path, root_path, nchars + 1);\n\tparams->cur_path_nchars = nchars;\n\tparams->cur_path_alloc_nchars = alloc_nchars;\n\tparams->root_path_nchars = nchars;\n\treturn 0;\n}\n\n/*\n * Append a filename to the current path.\n *\n * If successful, returns a pointer to the filename component and sets\n * *orig_path_nchars_ret to the old path length, which can be restored later\n * using pathbuf_truncate().  Otherwise returns NULL (out of memory).\n */\nconst tchar *\npathbuf_append_name(struct scan_params *params, const tchar *name,\n\t\t    size_t name_nchars, size_t *orig_path_nchars_ret)\n{\n\tsize_t path_nchars = params->cur_path_nchars;\n\tsize_t required_nchars = path_nchars + 1 + name_nchars + 1;\n\ttchar *buf = params->cur_path;\n\n\tif (unlikely(required_nchars > params->cur_path_alloc_nchars)) {\n\t\trequired_nchars += 1024;\n\t\tbuf = REALLOC(buf, required_nchars * sizeof(tchar));\n\t\tif (!buf)\n\t\t\treturn NULL;\n\t\tparams->cur_path = buf;\n\t\tparams->cur_path_alloc_nchars = required_nchars;\n\t}\n\t*orig_path_nchars_ret = path_nchars;\n\n\t/*\n\t * Add the slash, but not if it will be a duplicate (which can happen if\n\t * the path to the capture root directory ends in a slash), because\n\t * on Windows duplicate slashes sometimes don't work as expected.\n\t */\n\tif (path_nchars && buf[path_nchars - 1] != OS_PREFERRED_PATH_SEPARATOR)\n\t\tbuf[path_nchars++] = OS_PREFERRED_PATH_SEPARATOR;\n\n\ttmemcpy(&buf[path_nchars], name, name_nchars);\n\tpath_nchars += name_nchars;\n\tbuf[path_nchars] = T('\\0');\n\tparams->cur_path_nchars = path_nchars;\n\treturn &buf[path_nchars - name_nchars];\n}\n\n/* Truncate the current path to the specified number of characters. */\nvoid\npathbuf_truncate(struct scan_params *params, size_t nchars)\n{\n\twimlib_assert(nchars <= params->cur_path_nchars);\n\tparams->cur_path[nchars] = T('\\0');\n\tparams->cur_path_nchars = nchars;\n}\n"
  },
  {
    "path": "src/wimlib/security.c",
    "content": "/*\n * security.c\n *\n * Read and write the per-WIM-image table of security descriptors.\n */\n\n/*\n * Copyright 2012-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/avl_tree.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/security.h\"\n#include \"wimlib/sha1.h\"\n#include \"wimlib/util.h\"\n\nPRAGMA_BEGIN_PACKED\nstruct wim_security_data_disk {\n\tle32 total_length;\n\tle32 num_entries;\n\tle64 sizes[];\n} __attribute__((packed));\nPRAGMA_END_PACKED\n\nstruct wim_security_data *\nnew_wim_security_data(void)\n{\n\treturn CALLOC(1, sizeof(struct wim_security_data));\n}\n\n/*\n * Reads the security data from the metadata resource of a WIM image.\n *\n * @buf\n *\tBuffer containing an uncompressed WIM metadata resource.\n * @buf_len\n *\tLength of the uncompressed metadata resource, in bytes.\n * @sd_ret\n *\tOn success, a pointer to the resulting security data structure will be\n *\treturned here.\n *\n * Note: There is no `offset' argument because the security data is located at\n * the beginning of the metadata resource.\n *\n * Return values:\n *\tWIMLIB_ERR_SUCCESS (0)\n *\tWIMLIB_ERR_INVALID_METADATA_RESOURCE\n *\tWIMLIB_ERR_NOMEM\n */\nint\nread_wim_security_data(const u8 *buf, size_t buf_len,\n\t\t       struct wim_security_data **sd_ret)\n{\n\tstruct wim_security_data *sd;\n\tint ret;\n\tu64 total_len;\n\tu64 sizes_size;\n\tu64 size_no_descriptors;\n\tconst struct wim_security_data_disk *sd_disk;\n\tconst u8 *p;\n\n\tif (buf_len < 8)\n\t\treturn WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\n\tsd = new_wim_security_data();\n\tif (!sd)\n\t\tgoto out_of_memory;\n\n\tsd_disk = (const struct wim_security_data_disk *)buf;\n\tsd->total_length = ALIGN(le32_to_cpu(sd_disk->total_length), 8);\n\tsd->num_entries = le32_to_cpu(sd_disk->num_entries);\n\n\t/* Length field of 0 is a special case that really means length\n\t * of 8. */\n\tif (sd->total_length == 0)\n\t\tsd->total_length = 8;\n\n\t/* The security_id field of each dentry is a signed 32-bit integer, so\n\t * the possible indices into the security descriptors table are 0\n\t * through 0x7fffffff.  Which means 0x80000000 security descriptors\n\t * maximum.  Not like you should ever have anywhere close to that many\n\t * security descriptors! */\n\tif (sd->num_entries > 0x80000000)\n\t\tgoto out_invalid_sd;\n\n\t/* Verify the listed total length of the security data is big enough to\n\t * include the sizes array, verify that the file data is big enough to\n\t * include it as well, then allocate the array of sizes.\n\t *\n\t * Note: The total length of the security data must fit in a 32-bit\n\t * integer, even though each security descriptor size is a 64-bit\n\t * integer.  This is stupid, and we need to be careful not to actually\n\t * let the security descriptor sizes be over 0xffffffff.  */\n\tif (sd->total_length > buf_len)\n\t\tgoto out_invalid_sd;\n\n\tsizes_size = (u64)sd->num_entries * sizeof(u64);\n\tsize_no_descriptors = 8 + sizes_size;\n\tif (size_no_descriptors > sd->total_length)\n\t\tgoto out_invalid_sd;\n\n\ttotal_len = size_no_descriptors;\n\n\t/* Return immediately if no security descriptors. */\n\tif (sd->num_entries == 0)\n\t\tgoto out_descriptors_ready;\n\n\t/* Allocate a new buffer for the sizes array */\n\tsd->sizes = MALLOC(sizes_size);\n\tif (!sd->sizes)\n\t\tgoto out_of_memory;\n\n\t/* Copy the sizes array into the new buffer */\n\tfor (u32 i = 0; i < sd->num_entries; i++) {\n\t\tsd->sizes[i] = le64_to_cpu(sd_disk->sizes[i]);\n\t\tif (sd->sizes[i] > 0xffffffff)\n\t\t\tgoto out_invalid_sd;\n\t}\n\n\tp = (const u8*)sd_disk + size_no_descriptors;\n\n\t/* Allocate the array of pointers to the security descriptors, then read\n\t * them into separate buffers. */\n\tsd->descriptors = CALLOC(sd->num_entries, sizeof(sd->descriptors[0]));\n\tif (!sd->descriptors)\n\t\tgoto out_of_memory;\n\n\tfor (u32 i = 0; i < sd->num_entries; i++) {\n\t\tif (sd->sizes[i] == 0)\n\t\t\tcontinue;\n\t\ttotal_len += sd->sizes[i];\n\t\tif (total_len > (u64)sd->total_length)\n\t\t\tgoto out_invalid_sd;\n\t\tsd->descriptors[i] = memdup(p, sd->sizes[i]);\n\t\tif (!sd->descriptors[i])\n\t\t\tgoto out_of_memory;\n\t\tp += sd->sizes[i];\n\t}\nout_descriptors_ready:\n\tif (ALIGN(total_len, 8) != sd->total_length) {\n\t\tWARNING(\"Stored WIM security data total length was \"\n\t\t\t\"%\"PRIu32\" bytes, but calculated %\"PRIu32\" bytes\",\n\t\t\tsd->total_length, (u32)total_len);\n\t}\n\t*sd_ret = sd;\n\tret = 0;\n\tgoto out;\nout_invalid_sd:\n\tERROR(\"WIM security data is invalid!\");\n\tret = WIMLIB_ERR_INVALID_METADATA_RESOURCE;\n\tgoto out_free_sd;\nout_of_memory:\n\tERROR(\"Out of memory while reading WIM security data!\");\n\tret = WIMLIB_ERR_NOMEM;\nout_free_sd:\n\tfree_wim_security_data(sd);\nout:\n\treturn ret;\n}\n\n/*\n * Writes the security data for a WIM image to an in-memory buffer.\n */\nu8 *\nwrite_wim_security_data(const struct wim_security_data * restrict sd,\n\t\t\tu8 * restrict p)\n{\n\tu8 *orig_p = p;\n\tstruct wim_security_data_disk *sd_disk = (struct wim_security_data_disk*)p;\n\tu32 num_entries = sd->num_entries;\n\n\tsd_disk->total_length = cpu_to_le32(sd->total_length);\n\tsd_disk->num_entries = cpu_to_le32(num_entries);\n\n\tfor (u32 i = 0; i < num_entries; i++)\n\t\tsd_disk->sizes[i] = cpu_to_le64(sd->sizes[i]);\n\n\tp = (u8*)&sd_disk->sizes[num_entries];\n\n\tfor (u32 i = 0; i < num_entries; i++)\n\t\tp = mempcpy(p, sd->descriptors[i], sd->sizes[i]);\n\n\twhile ((uintptr_t)p & 7)\n\t\t*p++ = 0;\n\n\twimlib_assert(p - orig_p == sd->total_length);\n\treturn p;\n}\n\nvoid\nfree_wim_security_data(struct wim_security_data *sd)\n{\n\tif (sd) {\n\t\tu8 **descriptors = sd->descriptors;\n\t\tu32 num_entries  = sd->num_entries;\n\t\tif (descriptors)\n\t\t\twhile (num_entries--)\n\t\t\t\tFREE(*descriptors++);\n\t\tFREE(sd->sizes);\n\t\tFREE(sd->descriptors);\n\t\tFREE(sd);\n\t}\n}\n\nstruct sd_node {\n\ts32 security_id;\n\tu8 hash[SHA1_HASH_SIZE];\n\tstruct avl_tree_node index_node;\n};\n\n#define SD_NODE(avl_node) \\\n\tavl_tree_entry(avl_node, struct sd_node, index_node)\n\nstatic void\nfree_sd_tree(struct avl_tree_node *node)\n{\n\tif (node) {\n\t\tfree_sd_tree(node->left);\n\t\tfree_sd_tree(node->right);\n\t\tFREE(SD_NODE(node));\n\t}\n}\n\nvoid\nrollback_new_security_descriptors(struct wim_sd_set *sd_set)\n{\n\tstruct wim_security_data *sd = sd_set->sd;\n\tu32 i;\n\n\tfor (i = sd_set->orig_num_entries; i < sd->num_entries; i++)\n\t\tFREE(sd->descriptors[i]);\n\tsd->num_entries = sd_set->orig_num_entries;\n}\n\n/* Frees a security descriptor index set. */\nvoid\ndestroy_sd_set(struct wim_sd_set *sd_set)\n{\n\tfree_sd_tree(sd_set->root);\n}\n\nstatic int\n_avl_cmp_nodes_by_hash(const struct avl_tree_node *n1,\n\t\t       const struct avl_tree_node *n2)\n{\n\treturn hashes_cmp(SD_NODE(n1)->hash, SD_NODE(n2)->hash);\n}\n\n/* Inserts a new node into the security descriptor index tree.  Returns true\n * if successful (not a duplicate).  */\nstatic bool\ninsert_sd_node(struct wim_sd_set *set, struct sd_node *new)\n{\n\treturn NULL == avl_tree_insert(&set->root, &new->index_node,\n\t\t\t\t       _avl_cmp_nodes_by_hash);\n}\n\n/* Returns the index of the security descriptor having a SHA1 message digest of\n * @hash.  If not found, return -1. */\nstatic s32\nlookup_sd(struct wim_sd_set *set, const u8 hash[SHA1_HASH_SIZE])\n{\n\tstruct avl_tree_node *res;\n\tstruct sd_node dummy;\n\n\tcopy_hash(dummy.hash, hash);\n\tres = avl_tree_lookup_node(set->root, &dummy.index_node,\n\t\t\t\t   _avl_cmp_nodes_by_hash);\n\tif (!res)\n\t\treturn -1;\n\treturn SD_NODE(res)->security_id;\n}\n\n/*\n * Adds a security descriptor to the indexed security descriptor set as well as\n * the corresponding `struct wim_security_data', and returns the new security\n * ID; or, if there is an existing security descriptor that is the same, return\n * the security ID for it.  If a new security descriptor cannot be allocated,\n * return -1.\n */\ns32\nsd_set_add_sd(struct wim_sd_set *sd_set, const char *descriptor, size_t size)\n{\n\tu8 hash[SHA1_HASH_SIZE];\n\ts32 security_id;\n\tstruct sd_node *new;\n\tu8 **descriptors;\n\tu64 *sizes;\n\tu8 *descr_copy;\n\tstruct wim_security_data *sd;\n\tbool bret;\n\n\tsha1(descriptor, size, hash);\n\n\tsecurity_id = lookup_sd(sd_set, hash);\n\tif (security_id >= 0) /* Identical descriptor already exists */\n\t\tgoto out;\n\n\t/* Need to add a new security descriptor */\n\tsecurity_id = -1;\n\n\tnew = MALLOC(sizeof(*new));\n\tif (!new)\n\t\tgoto out;\n\n\tdescr_copy = memdup(descriptor, size);\n\tif (!descr_copy)\n\t\tgoto out_free_node;\n\n\tsd = sd_set->sd;\n\tnew->security_id = sd->num_entries;\n\tcopy_hash(new->hash, hash);\n\n\t/* There typically are only a few dozen security descriptors in a\n\t * directory tree, so expanding the array of security descriptors by\n\t * only 1 extra space each time should not be a problem. */\n\tdescriptors = REALLOC(sd->descriptors,\n\t\t\t      (sd->num_entries + 1) * sizeof(sd->descriptors[0]));\n\tif (!descriptors)\n\t\tgoto out_free_descr;\n\tsd->descriptors = descriptors;\n\tsizes = REALLOC(sd->sizes,\n\t\t\t(sd->num_entries + 1) * sizeof(sd->sizes[0]));\n\tif (!sizes)\n\t\tgoto out_free_descr;\n\tsd->sizes = sizes;\n\tsd->descriptors[sd->num_entries] = descr_copy;\n\tsd->sizes[sd->num_entries] = size;\n\tsd->num_entries++;\n\tbret = insert_sd_node(sd_set, new);\n\twimlib_assert(bret);\n\tsecurity_id = new->security_id;\n\tgoto out;\nout_free_descr:\n\tFREE(descr_copy);\nout_free_node:\n\tFREE(new);\nout:\n\treturn security_id;\n}\n\n/* Initialize a `struct sd_set' mapping from SHA1 message digests of security\n * descriptors to indices into the security descriptors table of the WIM image\n * (security IDs).  */\nint\ninit_sd_set(struct wim_sd_set *sd_set, struct wim_security_data *sd)\n{\n\tint ret;\n\n\tsd_set->sd = sd;\n\tsd_set->root = NULL;\n\n\t/* Remember the original number of security descriptors so that newly\n\t * added ones can be rolled back if needed. */\n\tsd_set->orig_num_entries = sd->num_entries;\n\tfor (u32 i = 0; i < sd->num_entries; i++) {\n\t\tstruct sd_node *new;\n\n\t\tnew = MALLOC(sizeof(struct sd_node));\n\t\tif (!new) {\n\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\tgoto out_destroy_sd_set;\n\t\t}\n\t\tsha1(sd->descriptors[i], sd->sizes[i], new->hash);\n\t\tnew->security_id = i;\n\t\tif (!insert_sd_node(sd_set, new))\n\t\t\tFREE(new); /* Ignore duplicate security descriptor */\n\t}\n\tret = 0;\n\tgoto out;\nout_destroy_sd_set:\n\tdestroy_sd_set(sd_set);\nout:\n\treturn ret;\n}\n"
  },
  {
    "path": "src/wimlib/sha1.c",
    "content": "/*\n * sha1.c - implementation of the Secure Hash Algorithm version 1 (FIPS 180-1)\n *\n * Copyright 2022-2023 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/cpu_features.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/sha1.h\"\n#include \"wimlib/unaligned.h\"\n\n/*----------------------------------------------------------------------------*\n *                              Shared helpers                                *\n *----------------------------------------------------------------------------*/\n\nstatic inline u32\nrol32(u32 v, int bits)\n{\n\treturn (v << bits) | (v >> (32 - bits));\n}\n\n/* Expands to the round constant for the given round */\n#define SHA1_K(i)\t\t\t\\\n\t(((i) < 20) ? 0x5A827999 :\t\\\n\t ((i) < 40) ? 0x6ED9EBA1 :\t\\\n\t ((i) < 60) ? 0x8F1BBCDC :\t\\\n\t\t      0xCA62C1D6)\n\n/* Expands to the computation on b, c, and d for the given round */\n#define SHA1_F(i, b, c, d)\t\t\t\t\t\\\n\t(((i) < 20) ? /* Choice */ (b & (c ^ d)) ^ d :\t\t\\\n\t ((i) < 40) ? /* Parity */ b ^ c ^ d :\t\t\t\\\n\t ((i) < 60) ? /* Majority */ (c & d) ^ (b & (c ^ d)) :\t\\\n\t\t      /* Parity */ b ^ c ^ d)\n\n/*\n * Expands to a memory barrier for the given array, preventing values of the\n * array from being cached in registers past the barrier.  Use this to prevent\n * the compiler from making counter-productive optimizations when there aren't\n * enough registers available to hold the full array.\n */\n#ifdef _MSC_VER\n#include <intrin.h>\n#pragma intrinsic(_ReadWriteBarrier)\n#define FORCE_NOT_CACHED(array)\t_ReadWriteBarrier()\n#else\n#define FORCE_NOT_CACHED(array)\tasm volatile(\"\" : \"+m\" (array))\n#endif\n\n/*\n * Expands to FORCE_NOT_CACHED() if the architecture has 16 or fewer general\n * purpose registers, otherwise does nothing.\n */\n#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) || defined(__arm__)\n#  define FORCE_NOT_CACHED_IF_FEW_REGS(array)\tFORCE_NOT_CACHED(array)\n#else\n#  define FORCE_NOT_CACHED_IF_FEW_REGS(array)\t(void)(array)\n#endif\n\n/*----------------------------------------------------------------------------*\n *                         Generic implementation                             *\n *----------------------------------------------------------------------------*/\n\n/*\n * This is SHA-1 in portable C code.  It computes the message schedule\n * just-in-time, in a rolling window of length 16.\n */\n\n#define SHA1_GENERIC_ROUND(i, a, b, c, d, e)\t\t\t\t\\\n\tFORCE_NOT_CACHED_IF_FEW_REGS(w);\t\t\t\t\\\n\tif ((i) < 16)\t\t\t\t\t\t\t\\\n\t\tw[i] = get_unaligned_be32(data + ((i) * 4));\t\t\\\n\telse\t\t\t\t\t\t\t\t\\\n\t\tw[(i) % 16] = rol32(w[((i) - 16) % 16] ^\t\t\\\n\t\t\t\t    w[((i) - 14) % 16] ^\t\t\\\n\t\t\t\t    w[((i) -  8) % 16] ^\t\t\\\n\t\t\t\t    w[((i) -  3) % 16], 1);\t\t\\\n\te += w[(i) % 16] + rol32(a, 5) + SHA1_F((i), b, c, d) + SHA1_K(i); \\\n\tb = rol32(b, 30);\n\t/* implicit: the new (a, b, c, d, e) is the old (e, a, b, c, d) */\n\n#define SHA1_GENERIC_5ROUNDS(i)\t\t\t\t\\\n\tSHA1_GENERIC_ROUND((i) + 0, a, b, c, d, e);\t\\\n\tSHA1_GENERIC_ROUND((i) + 1, e, a, b, c, d);\t\\\n\tSHA1_GENERIC_ROUND((i) + 2, d, e, a, b, c);\t\\\n\tSHA1_GENERIC_ROUND((i) + 3, c, d, e, a, b);\t\\\n\tSHA1_GENERIC_ROUND((i) + 4, b, c, d, e, a);\n\n#define SHA1_GENERIC_20ROUNDS(i)\t\\\n\tSHA1_GENERIC_5ROUNDS((i) +  0);\t\\\n\tSHA1_GENERIC_5ROUNDS((i) +  5);\t\\\n\tSHA1_GENERIC_5ROUNDS((i) + 10);\t\\\n\tSHA1_GENERIC_5ROUNDS((i) + 15);\n\nstatic void\nsha1_blocks_generic(u32 h[5], const u8 *data, size_t num_blocks)\n{\n\tdo {\n\t\tu32 a = h[0];\n\t\tu32 b = h[1];\n\t\tu32 c = h[2];\n\t\tu32 d = h[3];\n\t\tu32 e = h[4];\n\t\tu32 w[16];\n\n\t\tSHA1_GENERIC_20ROUNDS(0);\n\t\tSHA1_GENERIC_20ROUNDS(20);\n\t\tSHA1_GENERIC_20ROUNDS(40);\n\t\tSHA1_GENERIC_20ROUNDS(60);\n\n\t\th[0] += a;\n\t\th[1] += b;\n\t\th[2] += c;\n\t\th[3] += d;\n\t\th[4] += e;\n\t\tdata += SHA1_BLOCK_SIZE;\n\t} while (--num_blocks);\n}\n\n/*----------------------------------------------------------------------------*\n *                    x86 SSSE3 (and AVX+BMI2) implementation                 *\n *----------------------------------------------------------------------------*/\n\n/*\n * This is SHA-1 using the x86 SSSE3 instructions.  A copy of it is also\n * compiled with AVX and BMI2 code generation enabled for improved performance.\n *\n * Unfortunately this isn't actually much faster than the generic\n * implementation, since only the message schedule can be vectorized, not the\n * SHA itself.  The vectorized computation of the message schedule is\n * interleaved with the scalar computation of the SHA itself.\n *\n * Specifically, 16 rounds ahead of time, the words of the message schedule are\n * calculated, the round constants are added to them, and they are stored in a\n * temporary array that the scalar code reads from later.  This is done 4 words\n * at a time, but split into 4 steps, so that one step is executed during each\n * round.  Rounds 16-31 use the usual formula 'w[i] = rol32(w[i-16] ^ w[i-14] ^\n * w[i-8] ^ w[i-3], 1)', while rounds 32-79 use the equivalent formula 'w[i] =\n * rol32(w[i-32] ^ w[i-28] ^ w[i-16] ^ w[i-6], 2)' for improved vectorization.\n *\n * During rounds 80-95, the first 16 message schedule words for the next block\n * are prepared.\n */\n#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)\n#include <immintrin.h>\n\n#define SHA1_SSSE3_PRECALC(i, w0, w1, w2, w3, w4, w5, w6, w7)\t\t\\\n\tif ((i) % 20 == 0)\t\t\t\t\t\t\\\n\t\tk = _mm_set1_epi32(SHA1_K((i) % 80));\t\t\t\\\n\tif ((i) < 32) {\t\t\t\t\t\t\t\\\n\t\t/*\n\t\t * Vectorized computation of w[i] = rol32(w[i-16] ^ w[i-14] ^\n\t\t * w[i-8] ^ w[i-3], 1) for i...i+3, split into 4 steps.\n\t\t * w[i-16..i+3] are in (w0, w1, w2, w3, w4).\n\t\t */\t\t\t\t\t\t\t\\\n\t\tif ((i) % 4 == 0) {\t\t\t\t\t\\\n\t\t\tw4 = _mm_xor_si128(_mm_alignr_epi8(w1, w0, 8), w2);\t\t\\\n\t\t\tt0 = _mm_srli_si128(w3, 4);\t\t\t\\\n\t\t} else if ((i) % 4 == 1) {\t\t\t\t\\\n\t\t\tt0 = _mm_xor_si128(t0, _mm_xor_si128(w4, w0));\t\\\n\t\t\tt1 = _mm_slli_si128(t0, 12);\t\t\t\\\n\t\t} else if ((i) % 4 == 2) {\t\t\t\t\\\n\t\t\tt2 = _mm_slli_epi32(t1, 2);\t\t\t\\\n\t\t\tw4 = _mm_slli_epi32(t0, 1);\t\t\t\\\n\t\t\tt0 = _mm_srli_epi32(t0, 31);\t\t\t\\\n\t\t\tt2 = _mm_xor_si128(t2, _mm_srli_epi32(t1, 30));\t\\\n\t\t} else {\t\t\t\t\t\t\\\n\t\t\tw4 = _mm_xor_si128(w4, _mm_xor_si128(t0, t2));\t\\\n\t\t\tt0 = _mm_add_epi32(w4, k);\t\t\t\\\n\t\t\t_mm_store_si128((__m128i *)&tmp[((i) - 3) % 16], t0);\t\\\n\t\t}\t\t\t\t\t\t\t\\\n\t} else if ((i) < 80) {\t\t\t\t\t\t\\\n\t\t/*\n\t\t * Vectorized computation of w[i] = rol32(w[i-32] ^ w[i-28] ^\n\t\t * w[i-16] ^ w[i-6], 2) for i...i+3, split into 4 steps.\n\t\t * w[i-32..i+3] are in (w4, w5, w6, w7, w0, w1, w2, w3, w4);\n\t\t * note the reuse of w4.\n\t\t */\t\t\t\t\t\t\t\\\n\t\tif ((i) % 4 == 0)\t\t\t\t\t\\\n\t\t\tw4 = _mm_xor_si128(w4, _mm_alignr_epi8(w3, w2, 8));\t\t\\\n\t\telse if ((i) % 4 == 1)\t\t\t\t\t\\\n\t\t\tw4 = _mm_xor_si128(w4, _mm_xor_si128(w5, w0));\t\t\t\\\n\t\telse if ((i) % 4 == 2)\t\t\t\t\t\\\n\t\t\tw4 = _mm_xor_si128(_mm_slli_epi32(w4, 2),\t\t\\\n\t\t\t     _mm_srli_epi32(w4, 30));\t\t\t\\\n\t\telse\t\t\t\t\t\t\t\\\n\t\t\t_mm_store_si128((__m128i *)&tmp[((i) - 3) % 16],\\\n\t\t\t\t\t_mm_add_epi32(w4, k));\t\t\\\n\t} else if ((i) < 96) {\t\t\t\t\t\t\\\n\t\t/* Precomputation of w[0..15] for next block */\t\t\\\n\t\tif ((i) == 80 && --num_blocks != 0)\t\t\t\\\n\t\t\tdata = _PTR(data + SHA1_BLOCK_SIZE);\t\\\n\t\tif ((i) % 4 == 0)\t\t\t\t\t\\\n\t\t\tw0 = _mm_loadu_si128(_PTR(data + (((i) - 80) * 4)));\t\\\n\t\telse if ((i) % 4 == 1)\t\t\t\t\t\\\n\t\t\tw0 = _mm_shuffle_epi8(w0, bswap32_mask);\t\\\n\t\telse if ((i) % 4 == 2)\t\t\t\t\t\\\n\t\t\tt0 = _mm_add_epi32(w0, k);\t\t\t\\\n\t\telse\t\t\t\t\t\t\t\\\n\t\t\t_mm_store_si128((__m128i *)&tmp[(i) - 83], t0);\t\\\n\t}\n\n#define SHA1_SSSE3_2ROUNDS(i, a, b, c, d, e, w0, w1, w2, w3, w4, w5, w6, w7) \\\n\tFORCE_NOT_CACHED(tmp);\t\t\t\t\t\t\\\n\te += tmp[(i) % 16] + rol32(a, 5) + SHA1_F((i), b, c, d);\t\\\n\tb = rol32(b, 30);\t\t\t\t\t\t\\\n\tSHA1_SSSE3_PRECALC((i) + 16, w0, w1, w2, w3, w4, w5, w6, w7);\t\\\n\tFORCE_NOT_CACHED(tmp);\t\t\t\t\t\t\\\n\td += tmp[((i) + 1) % 16] + rol32(e, 5) + SHA1_F((i) + 1, a, b, c); \\\n\tSHA1_SSSE3_PRECALC((i) + 17, w0, w1, w2, w3, w4, w5, w6, w7);\t\\\n\ta = rol32(a, 30);\n\t/* implicit: the new (a, b, c, d, e) is the old (d, e, a, b, c) */\n\n#define SHA1_SSSE3_4ROUNDS(i, a, b, c, d, e, w0, w1, w2, w3, w4, w5, w6, w7)\t\\\n\tSHA1_SSSE3_2ROUNDS((i) + 0, a, b, c, d, e, w0, w1, w2, w3, w4, w5, w6, w7); \\\n\tSHA1_SSSE3_2ROUNDS((i) + 2, d, e, a, b, c, w0, w1, w2, w3, w4, w5, w6, w7); \\\n\t/*\n\t * implicit: the new (w0-w7) is the old (w1-w7,w0),\n\t * and the new (a, b, c, d, e) is the old (b, c, d, e, a)\n\t */\n\n#define SHA1_SSSE3_20ROUNDS(i, w0, w1, w2, w3, w4, w5, w6, w7)\t\t\\\n\tSHA1_SSSE3_4ROUNDS((i) +  0, a, b, c, d, e, w0, w1, w2, w3, w4, w5, w6, w7); \\\n\tSHA1_SSSE3_4ROUNDS((i) +  4, b, c, d, e, a, w1, w2, w3, w4, w5, w6, w7, w0); \\\n\tSHA1_SSSE3_4ROUNDS((i) +  8, c, d, e, a, b, w2, w3, w4, w5, w6, w7, w0, w1); \\\n\tSHA1_SSSE3_4ROUNDS((i) + 12, d, e, a, b, c, w3, w4, w5, w6, w7, w0, w1, w2); \\\n\tSHA1_SSSE3_4ROUNDS((i) + 16, e, a, b, c, d, w4, w5, w6, w7, w0, w1, w2, w3);\n\t/* implicit: the new (w0-w7) is the old (w5-w7,w0-w4) */\n\n#define SHA1_SSSE3_BODY\t\t\t\t\t\t\t\\\n\tconst __m128i bswap32_mask =\t\t\t\t\t\\\n\t\t_mm_setr_epi8( 3,  2,  1,  0,  7,  6,  5,  4,\t\t\\\n\t\t\t      11, 10,  9,  8, 15, 14, 13, 12);\t\t\\\n\t__m128i w0, w1, w2, w3, w4, w5, w6, w7;\t\t\t\t\\\n\t__m128i k = _mm_set1_epi32(SHA1_K(0));\t\t\t\t\\\n\tPRAGMA_ALIGN(u32 tmp[16], 16);\t\t\t\\\n\t\t\t\t\t\t\t\t\t\\\n\tw0 = _mm_shuffle_epi8(_mm_loadu_si128(_PTR(data +  0)), bswap32_mask); \\\n\tw1 = _mm_shuffle_epi8(_mm_loadu_si128(_PTR(data + 16)), bswap32_mask); \\\n\tw2 = _mm_shuffle_epi8(_mm_loadu_si128(_PTR(data + 32)), bswap32_mask); \\\n\tw3 = _mm_shuffle_epi8(_mm_loadu_si128(_PTR(data + 48)), bswap32_mask); \\\n\t_mm_store_si128((__m128i *)&tmp[0], _mm_add_epi32(w0, k));\t\\\n\t_mm_store_si128((__m128i *)&tmp[4], _mm_add_epi32(w1, k));\t\\\n\t_mm_store_si128((__m128i *)&tmp[8], _mm_add_epi32(w2, k));\t\\\n\t_mm_store_si128((__m128i *)&tmp[12], _mm_add_epi32(w3, k));\t\\\n\t\t\t\t\t\t\t\t\t\\\n\tdo {\t\t\t\t\t\t\t\t\\\n\t\tu32 a = h[0];\t\t\t\t\t\t\\\n\t\tu32 b = h[1];\t\t\t\t\t\t\\\n\t\tu32 c = h[2];\t\t\t\t\t\t\\\n\t\tu32 d = h[3];\t\t\t\t\t\t\\\n\t\tu32 e = h[4];\t\t\t\t\t\t\\\n\t\t__m128i t0, t1, t2;\t\t\t\t\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t\tSHA1_SSSE3_20ROUNDS(0, w0, w1, w2, w3, w4, w5, w6, w7); \\\n\t\tSHA1_SSSE3_20ROUNDS(20, w5, w6, w7, w0, w1, w2, w3, w4); \\\n\t\tSHA1_SSSE3_20ROUNDS(40, w2, w3, w4, w5, w6, w7, w0, w1); \\\n\t\tSHA1_SSSE3_20ROUNDS(60, w7, w0, w1, w2, w3, w4, w5, w6); \\\n\t\t\t\t\t\t\t\t\t\\\n\t\th[0] += a;\t\t\t\t\t\t\\\n\t\th[1] += b;\t\t\t\t\t\t\\\n\t\th[2] += c;\t\t\t\t\t\t\\\n\t\th[3] += d;\t\t\t\t\t\t\\\n\t\th[4] += e;\t\t\t\t\t\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t\t/* 'data' and 'num_blocks' were updated at start of round 64. */ \\\n\t} while (num_blocks);\n\n#define HAVE_SHA1_BLOCKS_X86_SSSE3\nstatic void __attribute__((target(\"ssse3\")))\nsha1_blocks_x86_ssse3(u32 h[5], const void *data, size_t num_blocks)\n{\n\tSHA1_SSSE3_BODY;\n}\n\n#define HAVE_SHA1_BLOCKS_X86_AVX_BMI2\nstatic void __attribute__((target(\"avx,bmi2\")))\nsha1_blocks_x86_avx_bmi2(u32 h[5], const void *data, size_t num_blocks)\n{\n\tSHA1_SSSE3_BODY;\n}\n#endif /* x86 SSSE3 (and AVX+BMI2) implementation */\n\n/*----------------------------------------------------------------------------*\n *                        x86 SHA Extensions implementation                   *\n *----------------------------------------------------------------------------*/\n\n/*\n * This is SHA-1 using the x86 SHA extensions.\n *\n * The SHA1RNDS4 instruction does most of the work.  It takes in a 128-bit\n * vector containing 'a', 'b', 'c', and 'd' (high-order to low-order), a 128-bit\n * vector containing the next 4 words of the message schedule with 'e' added to\n * the high-order word, and an immediate that identifies the current 20-round\n * section.  It does 4 rounds and updates 'a', 'b', 'c', and 'd' accordingly.\n *\n * Each SHA1RNDS4 is paired with SHA1NEXTE.  It takes in the abcd vector,\n * calculates the value of 'e' after 4 rounds, and adds it to the high-order\n * word of a vector that contains the next 4 words of the message schedule.\n *\n * Each 4 words of the message schedule for rounds 16-79 is calculated as\n * rol32(w[i-16] ^ w[i-14] ^ w[i-8] ^ w[i-3], 1) in three steps using the\n * SHA1MSG1, PXOR, and SHA1MSG2 instructions.  This happens in a rolling window,\n * so during the j'th set of 4 rounds we do the SHA1MSG2 step for j+1'th set of\n * message schedule words, PXOR for j+2'th set, and SHA1MSG1 for the j+3'th set.\n */\n#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)\n#include <immintrin.h>\n\n#define SHA1_NI_4ROUNDS(i, w0, w1, w2, w3, we0, we1)\t\t\t\\\n\tif ((i) < 16)\t\t\t\t\t\t\t\\\n\t\tw0 = _mm_shuffle_epi8(\t\t\t\t\t\\\n\t\t\t_mm_loadu_si128(_PTR(data + ((i) * 4))), bswap_mask);\t\\\n\tif ((i) == 0)\t\t\t\t\t\t\t\\\n\t\twe0 = _mm_add_epi32(h_e, w0);\t\t\t\t\\\n\telse\t\t\t\t\t\t\t\t\\\n\t\twe0 = _mm_sha1nexte_epu32(/* old abcd */ we0, w0);\t\\\n\twe1 = abcd;\t\t\t\t\t\t\t\\\n\tif ((i) >= 12 && (i) < 76)\t\t\t\t\t\\\n\t\tw1 = _mm_sha1msg2_epu32(w1, w0);\t\t\t\\\n\tabcd = _mm_sha1rnds4_epu32(abcd, we0, (i) / 20);\t\t\\\n\tif ((i) >= 8 && (i) < 72)\t\t\t\t\t\\\n\t\tw2 = _mm_xor_si128(w2, w0);\t\t\t\t\\\n\tif ((i) >= 4 && (i) < 68)\t\t\t\t\t\\\n\t\tw3 = _mm_sha1msg1_epu32(w3, w0);\t\t\t\\\n\t/*\n\t * implicit: the new (w0, w1, w2, w3) is the old (w1, w2, w3, w0),\n\t * and the new (we0, we1) is the old (we1, we0)\n\t */\n\n#define SHA1_NI_16ROUNDS(i)\t\t\t\t\t\\\n\tSHA1_NI_4ROUNDS((i) +  0, w0, w1, w2, w3, we0, we1);\t\\\n\tSHA1_NI_4ROUNDS((i) +  4, w1, w2, w3, w0, we1, we0);\t\\\n\tSHA1_NI_4ROUNDS((i) +  8, w2, w3, w0, w1, we0, we1);\t\\\n\tSHA1_NI_4ROUNDS((i) + 12, w3, w0, w1, w2, we1, we0);\n\n#define HAVE_SHA1_BLOCKS_X86_SHA\nstatic void __attribute__((target(\"sha,sse4.1\")))\nsha1_blocks_x86_sha(u32 h[5], const u8 *data, size_t num_blocks)\n{\n\tconst __m128i bswap_mask =\n\t\t_mm_setr_epi8(15, 14, 13, 12, 11, 10,  9,  8,\n\t\t\t      7,  6,   5,  4,  3,  2,  1,  0);\n\t__m128i h_abcd = _mm_shuffle_epi32(\n\t\t\t\t_mm_loadu_si128((__m128i *)h), 0x1B);\n\t__m128i h_e = _mm_setr_epi32(0, 0, 0, h[4]);\n\n\tdo {\n\t\t__m128i abcd = h_abcd;\n\t\t__m128i w0, w1, w2, w3, we0, we1;\n\n\t\tSHA1_NI_16ROUNDS(0);\n\t\tSHA1_NI_16ROUNDS(16);\n\t\tSHA1_NI_16ROUNDS(32);\n\t\tSHA1_NI_16ROUNDS(48);\n\t\tSHA1_NI_16ROUNDS(64);\n\n\t\th_abcd = _mm_add_epi32(h_abcd, abcd);\n\t\th_e = _mm_sha1nexte_epu32(we0, h_e);\n\t\tdata += SHA1_BLOCK_SIZE;\n\t} while (--num_blocks);\n\n\t_mm_storeu_si128((__m128i *)h, _mm_shuffle_epi32(h_abcd, 0x1B));\n\th[4] = _mm_extract_epi32(h_e, 3);\n}\n#endif /* x86 SHA Extensions implementation */\n\n/*----------------------------------------------------------------------------*\n *                     ARMv8 Crypto Extensions implementation                 *\n *----------------------------------------------------------------------------*/\n\n/*\n * This is SHA-1 using the ARMv8 Crypto Extensions.\n *\n * This does 4 rounds at a time, and it works very similarily to the x86 SHA\n * Extensions implementation.  The differences are fairly minor:\n *\n * - x86 has SHA1RNDS4 that takes an immediate that identifies the set of 20\n *   rounds, and it handles adding the round constants.  ARM has SHA1C for\n *   rounds 0-19, SHA1P for rounds 20-39 and 60-79, and SHA1M for rounds 40-59.\n *   These don't add the round constants, so that must be done separately.\n *\n * - ARM needs only two instructions, instead of x86's three, to prepare each\n *   set of 4 message schedule words: SHA1SU0 which does w[i-16] ^ w[i-14] ^\n *   w[i-8], and SHA1SU1 which XOR's in w[i-3] and rotates left by 1.\n */\n#if (defined(__aarch64__) || defined(_M_ARM64)) && \\\n\t(defined(__clang__) || defined(_MSC_VER) || (defined(__GNUC__) && __GNUC__ >= 5))\n\n/*\n * clang's arm_neon.h used to have a bug where it only defined the SHA-1\n * intrinsics when CRYPTO (clang 12 and earlier) or SHA2 (clang 13 and 14) is\n * enabled in the main target.  This prevents them from being used in target\n * attribute functions.  Work around this by defining the macros ourselves.\n */\n#if defined(__clang__) && __clang_major__ <= 15\n#  ifndef __ARM_FEATURE_CRYPTO\n#    define __ARM_FEATURE_CRYPTO 1\n#    define DEFINED_ARM_FEATURE_CRYPTO\n#  endif\n#  ifndef __ARM_FEATURE_SHA2\n#    define __ARM_FEATURE_SHA2 1\n#    define DEFINED_ARM_FEATURE_SHA2\n#  endif\n#endif\n#include <arm_neon.h>\n#ifdef DEFINED_ARM_FEATURE_CRYPTO\n#  undef __ARM_FEATURE_CRYPTO\n#endif\n#ifdef DEFINED_ARM_FEATURE_SHA2\n#  undef __ARM_FEATURE_SHA2\n#endif\n\n/* Expands to a vector containing 4 copies of the given round's constant */\n#define SHA1_CE_K(i)\t\t\\\n\t((i) < 20 ? k0 :\t\\\n\t (i) < 40 ? k1 :\t\\\n\t (i) < 60 ? k2 :\t\\\n\t\t    k3)\n\n/* Expands to the appropriate instruction for the given round */\n#define SHA1_CE_OP(i, abcd, e, w)\t\t\t\\\n\t((i) < 20 ? vsha1cq_u32((abcd), (e), (w)) :\t\\\n\t (i) < 40 ? vsha1pq_u32((abcd), (e), (w)) :\t\\\n\t (i) < 60 ? vsha1mq_u32((abcd), (e), (w)) :\t\\\n\t\t    vsha1pq_u32((abcd), (e), (w)))\n\n#define SHA1_CE_4ROUNDS(i, w0, w1, w2, w3, e0, e1)\t\\\n\ttmp = vaddq_u32(w0, SHA1_CE_K(i));\t\t\t\\\n\te1 = vsha1h_u32(vgetq_lane_u32(abcd, 0));\t\\\n\tabcd = SHA1_CE_OP((i), abcd, e0, tmp);\t\t\\\n\tif ((i) >= 12 && (i) < 76)\t\t\t\\\n\t\tw1 = vsha1su1q_u32(w1, w0);\t\t\\\n\tif ((i) >= 8 && (i) < 72)\t\t\t\\\n\t\tw2 = vsha1su0q_u32(w2, w3, w0);\n\t/*\n\t * implicit: the new (w0, w1, w2, w3) is the old (w1, w2, w3, w0),\n\t * and the new (e0, e1) is the old (e1, e0)\n\t */\n\n#define SHA1_CE_16ROUNDS(i)\t\t\t\t\t\\\n\tSHA1_CE_4ROUNDS((i) +  0, w0, w1, w2, w3, e0, e1);\t\\\n\tSHA1_CE_4ROUNDS((i) +  4, w1, w2, w3, w0, e1, e0);\t\\\n\tSHA1_CE_4ROUNDS((i) +  8, w2, w3, w0, w1, e0, e1);\t\\\n\tSHA1_CE_4ROUNDS((i) + 12, w3, w0, w1, w2, e1, e0);\n\n#define HAVE_SHA1_BLOCKS_ARM_CE\nstatic void\n#ifdef __clang__\n\t/*\n\t * clang has the SHA-1 instructions under \"sha2\".  \"crypto\" used to work\n\t * too, but only in clang 15 and earlier.  So, use \"sha2\" here.\n\t */\n\t__attribute__((target(\"sha2\")))\n#elif defined (__GNUC__)\n\t/* gcc wants \"+crypto\".  \"+sha2\" doesn't work. */\n\t__attribute__((target(\"+crypto\")))\n#endif\nsha1_blocks_arm_ce(u32 h[5], const void *data, size_t num_blocks)\n{\n\tuint32x4_t h_abcd = vld1q_u32(h);\n\tuint32x4_t k0 = vdupq_n_u32(SHA1_K(0));\n\tuint32x4_t k1 = vdupq_n_u32(SHA1_K(20));\n\tuint32x4_t k2 = vdupq_n_u32(SHA1_K(40));\n\tuint32x4_t k3 = vdupq_n_u32(SHA1_K(60));\n\n\tdo {\n\t\tuint32x4_t abcd = h_abcd;\n\t\tu32 e0 = h[4], e1;\n\t\tuint32x4_t tmp, w0, w1, w2, w3;\n\n\t\tw0 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(_PTR(data + 0))));\n\t\tw1 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(_PTR(data + 16))));\n\t\tw2 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(_PTR(data + 32))));\n\t\tw3 = vreinterpretq_u32_u8(vrev32q_u8(vld1q_u8(_PTR(data + 48))));\n\n\t\tSHA1_CE_16ROUNDS(0);\n\t\tSHA1_CE_16ROUNDS(16);\n\t\tSHA1_CE_16ROUNDS(32);\n\t\tSHA1_CE_16ROUNDS(48);\n\t\tSHA1_CE_16ROUNDS(64);\n\n\t\th_abcd = vaddq_u32(h_abcd, abcd);\n\t\th[4] += e0;\n\t\tdata = _PTR(data + SHA1_BLOCK_SIZE);\n\t} while (--num_blocks);\n\n\tvst1q_u32(h, h_abcd);\n}\n#endif /* ARMv8 Crypto Extensions implementation */\n\n/*----------------------------------------------------------------------------*\n *                              Everything else                               *\n *----------------------------------------------------------------------------*/\n\nstatic void\nsha1_blocks(u32 h[5], const void *data, size_t num_blocks)\n{\n#ifdef HAVE_SHA1_BLOCKS_X86_SHA\n\tif ((cpu_features & (X86_CPU_FEATURE_SHA | X86_CPU_FEATURE_SSE4_1)) ==\n\t    (X86_CPU_FEATURE_SHA | X86_CPU_FEATURE_SSE4_1)) {\n\t\tsha1_blocks_x86_sha(h, data, num_blocks);\n\t\treturn;\n\t}\n#endif\n#ifdef HAVE_SHA1_BLOCKS_X86_AVX_BMI2\n\tif ((cpu_features & (X86_CPU_FEATURE_AVX | X86_CPU_FEATURE_BMI2)) ==\n\t    (X86_CPU_FEATURE_AVX | X86_CPU_FEATURE_BMI2)) {\n\t\tsha1_blocks_x86_avx_bmi2(h, data, num_blocks);\n\t\treturn;\n\t}\n#endif\n#ifdef HAVE_SHA1_BLOCKS_X86_SSSE3\n\tif (cpu_features & X86_CPU_FEATURE_SSSE3) {\n\t\tsha1_blocks_x86_ssse3(h, data, num_blocks);\n\t\treturn;\n\t}\n#endif\n#ifdef HAVE_SHA1_BLOCKS_ARM_CE\n\tif (cpu_features & ARM_CPU_FEATURE_SHA1) {\n\t\tsha1_blocks_arm_ce(h, data, num_blocks);\n\t\treturn;\n\t}\n#endif\n\tsha1_blocks_generic(h, data, num_blocks);\n}\n\n/*\n * Initialize the given SHA-1 context.\n *\n * After sha1_init(), call sha1_update() zero or more times to provide the data\n * to be hashed.  Then call sha1_final() to get the resulting message digest.\n */\nvoid\nsha1_init(struct sha1_ctx *ctx)\n{\n\tctx->bytecount = 0;\n\n\tctx->h[0] = 0x67452301;\n\tctx->h[1] = 0xEFCDAB89;\n\tctx->h[2] = 0x98BADCFE;\n\tctx->h[3] = 0x10325476;\n\tctx->h[4] = 0xC3D2E1F0;\n}\n\n/* Update the SHA-1 context with @len bytes of data. */\nvoid\nsha1_update(struct sha1_ctx *ctx, const void *data, size_t len)\n{\n\tunsigned buffered = ctx->bytecount % SHA1_BLOCK_SIZE;\n\tsize_t blocks;\n\n\tctx->bytecount += len;\n\n\tif (buffered) {\n\t\tunsigned remaining = SHA1_BLOCK_SIZE - buffered;\n\n\t\tif (len < remaining) {\n\t\t\tmemcpy(&ctx->buffer[buffered], data, len);\n\t\t\treturn;\n\t\t}\n\t\tmemcpy(&ctx->buffer[buffered], data, remaining);\n\t\tsha1_blocks(ctx->h, ctx->buffer, 1);\n\t\tdata = _PTR(data + remaining);\n\t\tlen -= remaining;\n\t}\n\n\tblocks = len / SHA1_BLOCK_SIZE;\n\tif (blocks) {\n\t\tsha1_blocks(ctx->h, data, blocks);\n\t\tdata = _PTR(data + blocks * SHA1_BLOCK_SIZE);\n\t\tlen -= blocks * SHA1_BLOCK_SIZE;\n\t}\n\n\tif (len)\n\t\tmemcpy(ctx->buffer, data, len);\n}\n\n/* Finalize the SHA-1 operation and return the resulting message digest. */\nvoid\nsha1_final(struct sha1_ctx *ctx, u8 hash[SHA1_HASH_SIZE])\n{\n\tunsigned buffered = ctx->bytecount % SHA1_BLOCK_SIZE;\n\tconst be64 bitcount = cpu_to_be64(ctx->bytecount * 8);\n\n\tctx->buffer[buffered++] = 0x80;\n\tif (buffered > SHA1_BLOCK_SIZE - 8) {\n\t\t// Keep Coverity happy\n\t\tif (buffered != SHA1_BLOCK_SIZE)\n\t\t\tmemset(&ctx->buffer[buffered], 0, SHA1_BLOCK_SIZE - buffered);\n\t\tsha1_blocks(ctx->h, ctx->buffer, 1);\n\t\tbuffered = 0;\n\t}\n\tmemset(&ctx->buffer[buffered], 0, SHA1_BLOCK_SIZE - 8 - buffered);\n\tmemcpy(&ctx->buffer[SHA1_BLOCK_SIZE - 8], &bitcount, 8);\n\tsha1_blocks(ctx->h, ctx->buffer, 1);\n\n\tput_unaligned_be32(ctx->h[0], &hash[0]);\n\tput_unaligned_be32(ctx->h[1], &hash[4]);\n\tput_unaligned_be32(ctx->h[2], &hash[8]);\n\tput_unaligned_be32(ctx->h[3], &hash[12]);\n\tput_unaligned_be32(ctx->h[4], &hash[16]);\n}\n\n/* Calculate the SHA-1 message digest of the given data. */\nvoid\nsha1(const void *data, size_t len, u8 hash[SHA1_HASH_SIZE])\n{\n\tstruct sha1_ctx ctx;\n\n\tsha1_init(&ctx);\n\tsha1_update(&ctx, data, len);\n\tsha1_final(&ctx, hash);\n}\n\n/* \"Null\" SHA-1 message digest containing all 0's */\nconst u8 zero_hash[SHA1_HASH_SIZE];\n\n/* Build a hexadecimal string representation of a SHA-1 message digest. */\nvoid\nsprint_hash(const u8 hash[SHA1_HASH_SIZE], tchar strbuf[SHA1_HASH_STRING_LEN])\n{\n\tint i;\n\tu8 high, low;\n\n\tfor (i = 0; i < SHA1_HASH_SIZE; i++) {\n\t\thigh = hash[i] >> 4;\n\t\tlow = hash[i] & 0xF;\n\t\tstrbuf[i * 2 + 0] = (high < 10 ? high + '0' : high - 10 + 'a');\n\t\tstrbuf[i * 2 + 1] = (low  < 10 ? low  + '0' : low  - 10 + 'a');\n\t}\n\tstrbuf[i * 2] = 0;\n}\n"
  },
  {
    "path": "src/wimlib/solid.c",
    "content": "/*\n * solid.c\n *\n * Heuristic sorting of blobs to optimize solid compression.\n */\n\n/*\n * Copyright (C) 2015 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/solid.h\"\n#include \"wimlib/unaligned.h\"\n\nstatic const utf16lechar *\nget_extension(const utf16lechar *name, size_t nbytes)\n{\n\tconst utf16lechar *p = name + (nbytes / sizeof(utf16lechar));\n\tfor (;;) {\n\t\tif (p == name)\n\t\t\treturn NULL;\n\t\tif (*(p - 1) == cpu_to_le16('/') || *(p - 1) == cpu_to_le16('\\\\'))\n\t\t\treturn NULL;\n\t\tif (*(p - 1) == cpu_to_le16('.'))\n\t\t\treturn p;\n\t\tp--;\n\t}\n}\n\n/*\n * Sort order for solid compression:\n *\n * 1. Blobs without sort names\n *\t- sorted by sequential order\n * 2. Blobs with sort names:\n *    a. Blobs whose sort name does not have an extension\n *\t  - sorted by sort name\n *    b. Blobs whose sort name has an extension\n *        - sorted primarily by extension (case insensitive),\n *\t    secondarily by sort name (case insensitive)\n */\nstatic int\ncmp_blobs_by_solid_sort_name(const void *p1, const void *p2)\n{\n\tconst struct blob_descriptor *blob1, *blob2;\n\n\tblob1 = *(const struct blob_descriptor **)p1;\n\tblob2 = *(const struct blob_descriptor **)p2;\n\n\tif (blob1->solid_sort_name) {\n\t\tif (!blob2->solid_sort_name)\n\t\t\treturn 1;\n\t\tconst utf16lechar *extension1 = get_extension(blob1->solid_sort_name,\n\t\t\t\t\t\t\t      blob1->solid_sort_name_nbytes);\n\t\tconst utf16lechar *extension2 = get_extension(blob2->solid_sort_name,\n\t\t\t\t\t\t\t      blob2->solid_sort_name_nbytes);\n\t\tif (extension1) {\n\t\t\tif (!extension2)\n\t\t\t\treturn 1;\n\t\t\tint res = cmp_utf16le_strings_z(extension1,\n\t\t\t\t\t\t\textension2,\n\t\t\t\t\t\t\ttrue); /* case insensitive */\n\t\t\tif (res)\n\t\t\t\treturn res;\n\t\t} else {\n\t\t\tif (extension2)\n\t\t\t\treturn -1;\n\t\t}\n\t\tint res = cmp_utf16le_strings(blob1->solid_sort_name,\n\t\t\t\t\t      blob1->solid_sort_name_nbytes / sizeof(utf16lechar),\n\t\t\t\t\t      blob2->solid_sort_name,\n\t\t\t\t\t      blob2->solid_sort_name_nbytes / sizeof(utf16lechar),\n\t\t\t\t\t      true); /* case insensitive */\n\t\tif (res)\n\t\t\treturn res;\n\t} else {\n\t\tif (blob2->solid_sort_name)\n\t\t\treturn -1;\n\t}\n\treturn cmp_blobs_by_sequential_order(p1, p2);\n}\n\nstatic void\nblob_set_solid_sort_name_from_inode(struct blob_descriptor *blob,\n\t\t\t\t    const struct wim_inode *inode)\n{\n\tconst struct wim_dentry *dentry;\n\tconst utf16lechar *best_name = NULL;\n\tsize_t best_name_nbytes = SIZE_MAX;\n\n\tif (blob->solid_sort_name) /* Sort name already set?  */\n\t\treturn;\n\n\t/* If this file has multiple names, choose the shortest one.  */\n\tinode_for_each_dentry(dentry, inode) {\n\t\tif (dentry->d_name_nbytes < best_name_nbytes) {\n\t\t\tbest_name = dentry->d_name;\n\t\t\tbest_name_nbytes = dentry->d_name_nbytes;\n\t\t}\n\t}\n\tblob->solid_sort_name = utf16le_dupz(best_name, best_name_nbytes);\n\tblob->solid_sort_name_nbytes = best_name_nbytes;\n}\n\nstruct temp_blob_table {\n\tstruct hlist_head *table;\n\tsize_t capacity;\n};\n\nstatic int\ndentry_fill_in_solid_sort_names(struct wim_dentry *dentry, void *_blob_table)\n{\n\tconst struct temp_blob_table *blob_table = _blob_table;\n\tconst struct wim_inode *inode = dentry->d_inode;\n\tconst u8 *hash;\n\tstruct hlist_head *head;\n\tstruct blob_descriptor *blob;\n\n\thash = inode_get_hash_of_unnamed_data_stream(inode);\n\tif (!hash) /* unhashed? */\n\t\treturn 0;\n\thead = &blob_table->table[load_size_t_unaligned(hash) %\n\t\t\t\t  blob_table->capacity];\n\thlist_for_each_entry(blob, head, hash_list_2) {\n\t\tif (hashes_equal(hash, blob->hash)) {\n\t\t\tblob_set_solid_sort_name_from_inode(blob, inode);\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn 0;\n}\n\nstatic int\nimage_fill_in_solid_sort_names(WIMStruct *wim)\n{\n\treturn for_dentry_in_tree(wim_get_current_root_dentry(wim),\n\t\t\t\t  dentry_fill_in_solid_sort_names,\n\t\t\t\t  wim->private);\n}\n\nint\nsort_blob_list_for_solid_compression(struct list_head *blob_list)\n{\n\tsize_t num_blobs = 0;\n\tstruct temp_blob_table blob_table;\n\tWIMStruct *wims[128];\n\tint num_wims = 0;\n\tstruct blob_descriptor *blob;\n\tint ret;\n\n\t/* Count the number of blobs to be written.  */\n\tlist_for_each_entry(blob, blob_list, write_blobs_list)\n\t\tnum_blobs++;\n\n\t/* Allocate a temporary hash table for mapping blob hash => blob  */\n\tblob_table.capacity = num_blobs;\n\tblob_table.table = CALLOC(blob_table.capacity,\n\t\t\t\t  sizeof(blob_table.table[0]));\n\tif (!blob_table.table)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\t/*\n\t * For each blob to be written:\n\t * - Reset the sort name\n\t * - If it's in non-solid WIM resource, then save the WIMStruct.\n\t * - If it's in a file on disk, then set its sort name from that.\n\t */\n\tlist_for_each_entry(blob, blob_list, write_blobs_list) {\n\t\tblob->solid_sort_name = NULL;\n\t\tblob->solid_sort_name_nbytes = 0;\n\t\tswitch (blob->blob_location) {\n\t\tcase BLOB_IN_WIM:\n\t\t\tif (blob->size != blob->rdesc->uncompressed_size)\n\t\t\t\tcontinue;\n\t\t\tfor (int i = 0; i < num_wims; i++)\n\t\t\t\tif (blob->rdesc->wim == wims[i])\n\t\t\t\t\tgoto found_wim;\n\t\t\tif (num_wims >= ARRAY_LEN(wims))\n\t\t\t\tcontinue;\n\t\t\twims[num_wims++] = blob->rdesc->wim;\n\t\tfound_wim:\n\t\t\thlist_add_head(&blob->hash_list_2,\n\t\t\t\t       &blob_table.table[load_size_t_unaligned(blob->hash) %\n\t\t\t\t\t\t\t blob_table.capacity]);\n\t\t\tbreak;\n\t\tcase BLOB_IN_FILE_ON_DISK:\n\t#ifdef _WIN32\n\t\tcase BLOB_IN_WINDOWS_FILE:\n\t#endif\n\t\t\tblob_set_solid_sort_name_from_inode(blob, blob->file_inode);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* For each WIMStruct that was found, search for dentry references to\n\t * each blob and fill in the sort name this way.  This is useful e.g.\n\t * when exporting a solid WIM file from a non-solid WIM file.  */\n\tfor (int i = 0; i < num_wims; i++) {\n\t\tif (!wim_has_metadata(wims[i]))\n\t\t\tcontinue;\n\t\twims[i]->private = &blob_table;\n\t\tret = for_image(wims[i], WIMLIB_ALL_IMAGES,\n\t\t\t\timage_fill_in_solid_sort_names);\n\t\tif (ret)\n\t\t\tgoto out;\n\t\tdeselect_current_wim_image(wims[i]);\n\t}\n\n\tret = sort_blob_list(blob_list,\n\t\t\t     offsetof(struct blob_descriptor, write_blobs_list),\n\t\t\t     cmp_blobs_by_solid_sort_name);\n\nout:\n\tlist_for_each_entry(blob, blob_list, write_blobs_list)\n\t\tFREE(blob->solid_sort_name);\n\tFREE(blob_table.table);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/wimlib/split.c",
    "content": "/*\n * split.c\n *\n * Split a WIM file into parts.\n */\n\n/*\n * Copyright (C) 2012, 2013 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib.h\"\n#include \"wimlib/alloca.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/list.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/progress.h\"\n#include \"wimlib/resource.h\"\n#include \"wimlib/wim.h\"\n#include \"wimlib/write.h\"\n\nstruct swm_part_info {\n\tstruct list_head blob_list;\n\tu64 size;\n};\n\nstatic void\ncopy_part_info(struct swm_part_info *dst, struct swm_part_info *src)\n{\n\tlist_replace(&src->blob_list, &dst->blob_list);\n\tdst->size = src->size;\n}\n\nstruct swm_info {\n\tstruct swm_part_info *parts;\n\tunsigned num_parts;\n\tunsigned num_alloc_parts;\n\tu64 total_bytes;\n\tu64 max_part_size;\n};\n\nstatic int\nwrite_split_wim(WIMStruct *orig_wim, const tchar *swm_name,\n\t\tstruct swm_info *swm_info, int write_flags)\n{\n\tsize_t swm_name_len;\n\ttchar *swm_name_buf;\n\tconst tchar *dot;\n\ttchar *swm_suffix;\n\tsize_t swm_base_name_len;\n\n\tunion wimlib_progress_info progress;\n\tunsigned part_number;\n\tint ret;\n\tu8 guid[GUID_SIZE];\n\n\tswm_name_len = tstrlen(swm_name);\n\tswm_name_buf = alloca((swm_name_len + 20) * sizeof(tchar));\n\ttstrcpy(swm_name_buf, swm_name);\n\tdot = tstrrchr(path_basename(swm_name_buf), T('.'));\n\tif (dot) {\n\t\tswm_base_name_len = dot - swm_name_buf;\n\t\tswm_suffix = alloca((tstrlen(dot) + 1) * sizeof(tchar));\n\t\ttstrcpy(swm_suffix, dot);\n\t} else {\n\t\tswm_base_name_len = swm_name_len;\n\t\tswm_suffix = alloca(1 * sizeof(tchar));\n\t\tswm_suffix[0] = T('\\0');\n\t}\n\n\tprogress.split.completed_bytes = 0;\n\tprogress.split.total_bytes = 0;\n\tfor (part_number = 1; part_number <= swm_info->num_parts; part_number++)\n\t\tprogress.split.total_bytes += swm_info->parts[part_number - 1].size;\n\tprogress.split.total_parts = swm_info->num_parts;\n\n\tgenerate_guid(guid);\n\n\tfor (part_number = 1; part_number <= swm_info->num_parts; part_number++) {\n\t\tint part_write_flags;\n\n\t\tif (part_number != 1) {\n\t\t\ttsprintf(swm_name_buf + swm_base_name_len,\n\t\t\t\t T(\"%u%\"TS), part_number, swm_suffix);\n\t\t}\n\n\t\tprogress.split.cur_part_number = part_number;\n\t\tprogress.split.part_name = swm_name_buf;\n\n\t\tret = call_progress(orig_wim->progfunc,\n\t\t\t\t    WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART,\n\t\t\t\t    &progress,\n\t\t\t\t    orig_wim->progctx);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tpart_write_flags = write_flags;\n\t\tpart_write_flags |= WIMLIB_WRITE_FLAG_USE_EXISTING_TOTALBYTES;\n\t\tif (part_number != 1)\n\t\t\tpart_write_flags |= WIMLIB_WRITE_FLAG_NO_METADATA;\n\n\t\tret = write_wim_part(orig_wim,\n\t\t\t\t     progress.split.part_name,\n\t\t\t\t     WIMLIB_ALL_IMAGES,\n\t\t\t\t     part_write_flags,\n\t\t\t\t     1,\n\t\t\t\t     part_number,\n\t\t\t\t     swm_info->num_parts,\n\t\t\t\t     &swm_info->parts[part_number - 1].blob_list,\n\t\t\t\t     guid);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tprogress.split.completed_bytes += swm_info->parts[part_number - 1].size;\n\n\t\tret = call_progress(orig_wim->progfunc,\n\t\t\t\t    WIMLIB_PROGRESS_MSG_SPLIT_END_PART,\n\t\t\t\t    &progress,\n\t\t\t\t    orig_wim->progctx);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nstatic int\nstart_new_swm_part(struct swm_info *swm_info)\n{\n\tif (swm_info->num_parts == swm_info->num_alloc_parts) {\n\t\tstruct swm_part_info *parts;\n\t\tsize_t num_alloc_parts = swm_info->num_alloc_parts;\n\n\t\tnum_alloc_parts += 8;\n\t\tparts = MALLOC(num_alloc_parts * sizeof(parts[0]));\n\t\tif (!parts)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\n\t\tfor (unsigned i = 0; i < swm_info->num_parts; i++)\n\t\t\tcopy_part_info(&parts[i], &swm_info->parts[i]);\n\n\t\tFREE(swm_info->parts);\n\t\tswm_info->parts = parts;\n\t\tswm_info->num_alloc_parts = num_alloc_parts;\n\t}\n\tswm_info->num_parts++;\n\tINIT_LIST_HEAD(&swm_info->parts[swm_info->num_parts - 1].blob_list);\n\tswm_info->parts[swm_info->num_parts - 1].size = 0;\n\treturn 0;\n}\n\nstatic int\nadd_blob_to_swm(struct blob_descriptor *blob, void *_swm_info)\n{\n\tstruct swm_info *swm_info = _swm_info;\n\tu64 blob_stored_size;\n\tint ret;\n\n\tif (blob->blob_location == BLOB_IN_WIM)\n\t\tblob_stored_size = blob->rdesc->size_in_wim;\n\telse\n\t\tblob_stored_size = blob->size;\n\n\t/* Start the next part if adding this blob exceeds the maximum part\n\t * size, UNLESS the blob is metadata or if no blobs at all have been\n\t * added to the current part.  */\n\tif ((swm_info->parts[swm_info->num_parts - 1].size +\n\t     blob_stored_size >= swm_info->max_part_size)\n\t    && !(blob->is_metadata ||\n\t\t swm_info->parts[swm_info->num_parts - 1].size == 0))\n\t{\n\t\tret = start_new_swm_part(swm_info);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\tswm_info->parts[swm_info->num_parts - 1].size += blob_stored_size;\n\tif (!blob->is_metadata) {\n\t\tlist_add_tail(&blob->write_blobs_list,\n\t\t\t      &swm_info->parts[swm_info->num_parts - 1].blob_list);\n\t}\n\tswm_info->total_bytes += blob_stored_size;\n\treturn 0;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_split(WIMStruct *wim, const tchar *swm_name,\n\t     u64 part_size, int write_flags)\n{\n\tstruct swm_info swm_info;\n\tunsigned i;\n\tint ret;\n\n\tif (swm_name == NULL || swm_name[0] == T('\\0') || part_size == 0)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (write_flags & ~WIMLIB_WRITE_MASK_PUBLIC)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (!wim_has_metadata(wim))\n\t\treturn WIMLIB_ERR_METADATA_NOT_FOUND;\n\n\tif (wim_has_solid_resources(wim)) {\n\t\tERROR(\"Splitting of WIM containing solid resources is not supported.\\n\"\n\t\t      \"        Export it in non-solid format first.\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n\n\tfor (i = 0; i < wim->hdr.image_count; i++) {\n\t\tif (!is_image_unchanged_from_wim(wim->image_metadata[i], wim)) {\n\t\t\tERROR(\"Only an unmodified, on-disk WIM file can be split.\");\n\t\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t\t}\n\t}\n\n\tmemset(&swm_info, 0, sizeof(swm_info));\n\tswm_info.max_part_size = part_size;\n\n\tret = start_new_swm_part(&swm_info);\n\tif (ret)\n\t\tgoto out_free_swm_info;\n\n\tfor (i = 0; i < wim->hdr.image_count; i++) {\n\t\tret = add_blob_to_swm(wim->image_metadata[i]->metadata_blob,\n\t\t\t\t      &swm_info);\n\t\tif (ret)\n\t\t\tgoto out_free_swm_info;\n\t}\n\n\tret = for_blob_in_table_sorted_by_sequential_order(wim->blob_table,\n\t\t\t\t\t\t\t   add_blob_to_swm,\n\t\t\t\t\t\t\t   &swm_info);\n\tif (ret)\n\t\tgoto out_free_swm_info;\n\n\tret = write_split_wim(wim, swm_name, &swm_info, write_flags);\nout_free_swm_info:\n\tFREE(swm_info.parts);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/wimlib/tagged_items.c",
    "content": "/*\n * tagged_items.c\n *\n * Support for tagged metadata items that can be appended to WIM directory\n * entries.\n */\n\n/*\n * Copyright (C) 2014-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/inode.h\"\n#include \"wimlib/tagged_items.h\"\n#include \"wimlib/unix_data.h\"\n\n/*\n * Header that begins each tagged metadata item associated with a file in a WIM\n * metadata resource\n */\nPRAGMA_BEGIN_ALIGN(8)\nstruct tagged_item_header {\n\n\t/* identifies the type of metadata item (see TAG_* constants) */\n\tle32 tag;\n\n\t/* size of this item's data in bytes, excluding this header */\n\tle32 length;\n\n\t/* followed by the item's data */\n\tu8 data[0];\n\n\t/* then zero-padded to an 8-byte boundary */\n} PRAGMA_END_ALIGN(8);\n\n/*\n * Retrieve from @inode the first metadata item that is tagged with @tag and\n * contains at least @min_len bytes of data.  If found, return a pointer to the\n * item's data and write its actual length to @actual_len_ret if not NULL.  If\n * not found, return NULL.\n */\nvoid *\ninode_get_tagged_item(const struct wim_inode *inode, u32 tag, u32 min_len,\n\t\t      u32 *actual_len_ret)\n{\n\tstruct tagged_item_header *hdr;\n\tsize_t len_remaining;\n\n\tSTATIC_ASSERT(sizeof(*hdr) == 8);\n\n\tif (!inode->i_extra)\n\t\treturn NULL;\n\n\thdr = (struct tagged_item_header *)inode->i_extra->data;\n\tlen_remaining = inode->i_extra->size;\n\n\t/* Iterate through the tagged items. */\n\twhile (len_remaining >= sizeof(*hdr) + min_len) {\n\t\tu32 len = le32_to_cpu(hdr->length);\n\t\tu32 full_len = sizeof(*hdr) + ALIGN(len, 8);\n\n\t\t/* Length overflow (corrupted item list)? */\n\t\tif (unlikely(full_len < len || full_len > len_remaining))\n\t\t\treturn NULL;\n\n\t\t/* Matches the item we wanted? */\n\t\tif (le32_to_cpu(hdr->tag) == tag && len >= min_len) {\n\t\t\tif (actual_len_ret)\n\t\t\t\t*actual_len_ret = len;\n\t\t\treturn hdr->data;\n\t\t}\n\n\t\tlen_remaining -= full_len;\n\t\thdr = (struct tagged_item_header *)((u8 *)hdr + full_len);\n\t}\n\treturn NULL;\n}\n\n/*\n * Add a tagged item to the specified inode and return a pointer to its\n * uninitialized data, which the caller must initialize.  No check is made for\n * whether the inode already has item(s) with the specified tag.\n */\nstatic void *\ninode_add_tagged_item(struct wim_inode *inode, u32 tag, u32 len)\n{\n\tstruct wim_inode_extra *extra;\n\tstruct tagged_item_header *hdr;\n\tsize_t oldsize = (inode->i_extra ? inode->i_extra->size : 0);\n\tsize_t newsize = oldsize + sizeof(*hdr) + ALIGN(len, 8);\n\n\twimlib_assert(oldsize % 8 == 0);\n\n\textra = REALLOC(inode->i_extra, sizeof(*extra) + newsize);\n\tif (!extra)\n\t\treturn NULL;\n\tinode->i_extra = extra;\n\textra->size = newsize;\n\thdr = (struct tagged_item_header *)&extra->data[oldsize];\n\thdr->tag = cpu_to_le32(tag);\n\thdr->length = cpu_to_le32(len);\n\tmemset(hdr->data + len, 0, -len & 7); /* pad to next 8-byte boundary */\n\treturn hdr->data;\n}\n\n/*\n * Add a tagged item containing the specified data to the specified inode, first\n * removing any existing items with the same tag.  Returns %true if successful,\n * %false if failed (out of memory).\n */\nbool\ninode_set_tagged_item(struct wim_inode *inode, u32 tag,\n\t\t      const void *data, u32 len)\n{\n\tu8 *p;\n\tu32 old_len;\n\n\t/* Remove any existing items with the same tag */\n\twhile ((p = inode_get_tagged_item(inode, tag, 0, &old_len)) != NULL) {\n\t\tp -= sizeof(struct tagged_item_header);\n\t\told_len += sizeof(struct tagged_item_header);\n\t\told_len = ALIGN(old_len, 8);\n\t\tmemmove(p, p + old_len, (inode->i_extra->data +\n\t\t\t\t\t inode->i_extra->size) - (p + old_len));\n\t\tinode->i_extra->size -= old_len;\n\t}\n\n\t/* Add the new item */\n\tp = inode_add_tagged_item(inode, tag, len);\n\tif (!p)\n\t\treturn false;\n\tmemcpy(p, data, len);\n\treturn true;\n}\n\nstruct wimlib_unix_data_disk {\n\tle32 uid;\n\tle32 gid;\n\tle32 mode;\n\tle32 rdev;\n};\n\nstatic inline struct wimlib_unix_data_disk *\ninode_get_unix_data_disk(const struct wim_inode *inode)\n{\n\treturn inode_get_tagged_item(inode, TAG_WIMLIB_UNIX_DATA,\n\t\t\t\t     sizeof(struct wimlib_unix_data_disk),\n\t\t\t\t     NULL);\n}\n\n/* Return %true iff the specified inode has standard UNIX metadata. */\nbool\ninode_has_unix_data(const struct wim_inode *inode)\n{\n\treturn inode_get_unix_data_disk(inode) != NULL;\n}\n\n/*\n * Get an inode's standard UNIX metadata.\n *\n * If the inode has standard UNIX metadata, returns %true and fills @unix_data.\n * Otherwise returns %false.\n */\nbool\ninode_get_unix_data(const struct wim_inode *inode,\n\t\t    struct wimlib_unix_data *unix_data)\n{\n\tconst struct wimlib_unix_data_disk *p;\n\n\tp = inode_get_unix_data_disk(inode);\n\tif (!p)\n\t\treturn false;\n\n\tunix_data->uid = le32_to_cpu(p->uid);\n\tunix_data->gid = le32_to_cpu(p->gid);\n\tunix_data->mode = le32_to_cpu(p->mode);\n\tunix_data->rdev = le32_to_cpu(p->rdev);\n\treturn true;\n}\n\n/*\n * Set an inode's standard UNIX metadata.\n *\n * Callers must specify all members in @unix_data.  If the inode does not yet\n * have standard UNIX metadata, it is given these values.  Otherwise, only the\n * values that also have the corresponding flags in @which set are changed.\n *\n * Returns %true if successful, %false if failed (out of memory).\n */\nbool\ninode_set_unix_data(struct wim_inode *inode, struct wimlib_unix_data *unix_data,\n\t\t    int which)\n{\n\tstruct wimlib_unix_data_disk *p;\n\n\tp = inode_get_unix_data_disk(inode);\n\tif (!p) {\n\t\tp = inode_add_tagged_item(inode, TAG_WIMLIB_UNIX_DATA,\n\t\t\t\t\t  sizeof(*p));\n\t\tif (!p)\n\t\t\treturn false;\n\t\twhich = UNIX_DATA_ALL;\n\t}\n\tif (which & UNIX_DATA_UID)\n\t\tp->uid = cpu_to_le32(unix_data->uid);\n\tif (which & UNIX_DATA_GID)\n\t\tp->gid = cpu_to_le32(unix_data->gid);\n\tif (which & UNIX_DATA_MODE)\n\t\tp->mode = cpu_to_le32(unix_data->mode);\n\tif (which & UNIX_DATA_RDEV)\n\t\tp->rdev = cpu_to_le32(unix_data->rdev);\n\treturn true;\n}\n"
  },
  {
    "path": "src/wimlib/textfile.c",
    "content": "/*\n * textfile.c\n */\n\n/*\n * Copyright (C) 2014 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <ctype.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <string.h>\n#include <sys/stat.h>\n#include <unistd.h>\n\n#include \"wimlib/encoding.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/file_io.h\"\n#include \"wimlib/textfile.h\"\n#include \"wimlib/util.h\"\n\nstatic int\nstdin_get_contents(void **buf_ret, size_t *bufsize_ret)\n{\n\tchar *buf = NULL;\n\tsize_t filled = 0;\n\tsize_t capacity = 0;\n\n\tdo {\n\t\tsize_t new_capacity = (capacity * 2) + 256;\n\t\tchar *new_buf;\n\n\t\tif (new_capacity <= capacity ||\n\t\t    !(new_buf = REALLOC(buf, new_capacity))) {\n\t\t\tERROR(\"Too much data sent on stdin!\");\n\t\t\tFREE(buf);\n\t\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t\t}\n\t\tbuf = new_buf;\n\t\tcapacity = new_capacity;\n\t\tfilled += fread(&buf[filled], 1, capacity - filled, stdin);\n\t} while (filled == capacity);\n\n\tif (!feof(stdin)) {\n\t\tERROR_WITH_ERRNO(\"Error reading stdin\");\n\t\tFREE(buf);\n\t\treturn WIMLIB_ERR_READ;\n\t}\n\t*buf_ret = buf;\n\t*bufsize_ret = filled;\n\treturn 0;\n}\n\nstatic int\nread_file_contents(const tchar *path, void **buf_ret, size_t *bufsize_ret)\n{\n\tint raw_fd;\n\tstruct filedes fd;\n\tstruct stat st;\n\tvoid *buf;\n\tint ret;\n\tint errno_save;\n\n\traw_fd = topen(path, O_RDONLY | O_BINARY);\n\tif (raw_fd < 0) {\n\t\tERROR_WITH_ERRNO(\"Can't open \\\"%\"TS\"\\\"\", path);\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\tif (fstat(raw_fd, &st)) {\n\t\tERROR_WITH_ERRNO(\"Can't stat \\\"%\"TS\"\\\"\", path);\n\t\tclose(raw_fd);\n\t\treturn WIMLIB_ERR_STAT;\n\t}\n\tif ((size_t)st.st_size != st.st_size ||\n\t    (buf = MALLOC(st.st_size)) == NULL)\n\t{\n\t\tclose(raw_fd);\n\t\tERROR(\"Not enough memory to read \\\"%\"TS\"\\\"\", path);\n\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\tfiledes_init(&fd, raw_fd);\n\tret = full_read(&fd, buf, st.st_size);\n\terrno_save = errno;\n\tfiledes_close(&fd);\n\terrno = errno_save;\n\tif (ret) {\n\t\tERROR_WITH_ERRNO(\"Error reading \\\"%\"TS\"\\\"\", path);\n\t\tFREE(buf);\n\t\treturn ret;\n\t}\n\n\t*buf_ret = buf;\n\t*bufsize_ret = st.st_size;\n\treturn 0;\n}\n\nstatic int\ntranslate_text_buffer(const u8 *buf_raw, size_t bufsize_raw,\n\t\t      tchar **tstr_ret, size_t *tstr_nchars_ret)\n{\n\tsize_t offset_raw;\n\tbool utf8;\n\ttchar *buf_tstr;\n\tsize_t bufsize_tstr;\n\tint ret;\n\n\t/* Guess the encoding: UTF-8 or UTF-16LE.  (Something weirder and you're\n\t * out of luck, sorry...)  */\n\tif (bufsize_raw >= 2 &&\n\t    buf_raw[0] == 0xFF &&\n\t    buf_raw[1] == 0xFE)\n\t{\n\t\tutf8 = false;\n\t\toffset_raw = 2;\n\t}\n\telse if (bufsize_raw >= 2 &&\n\t\t buf_raw[0] <= 0x7F &&\n\t\t buf_raw[1] == 0x00)\n\t{\n\t\tutf8 = false;\n\t\toffset_raw = 0;\n\t}\n\telse if (bufsize_raw >= 3 &&\n\t\t buf_raw[0] == 0xEF &&\n\t\t buf_raw[1] == 0xBB &&\n\t\t buf_raw[2] == 0xBF)\n\t{\n\t\tutf8 = true;\n\t\toffset_raw = 3;\n\t}\n\telse\n\t{\n\t\tutf8 = true;\n\t\toffset_raw = 0;\n\t}\n\n\tif (utf8) {\n\t\tret = utf8_to_tstr((const char *)(buf_raw + offset_raw),\n\t\t\t\t   bufsize_raw - offset_raw,\n\t\t\t\t   &buf_tstr, &bufsize_tstr);\n\t} else {\n\t\tret = utf16le_to_tstr((const utf16lechar *)(buf_raw + offset_raw),\n\t\t\t\t      bufsize_raw - offset_raw,\n\t\t\t\t      &buf_tstr, &bufsize_tstr);\n\t}\n\tif (ret)\n\t\treturn ret;\n\n\t*tstr_ret = buf_tstr;\n\t*tstr_nchars_ret = bufsize_tstr / sizeof(tchar);\n\treturn 0;\n}\n\nstatic int\nstring_list_append(struct string_list *list, tchar *str)\n{\n\tsize_t num_alloc_strings = list->num_alloc_strings;\n\n\tif (list->num_strings == num_alloc_strings) {\n\t\ttchar **new_strings;\n\n\t\tnum_alloc_strings = max(num_alloc_strings * 3 / 2,\n\t\t\t\t\tnum_alloc_strings + 4);\n\t\tnew_strings = REALLOC(list->strings,\n\t\t\t\t      sizeof(list->strings[0]) * num_alloc_strings);\n\t\tif (!new_strings)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\tlist->strings = new_strings;\n\t\tlist->num_alloc_strings = num_alloc_strings;\n\t}\n\tlist->strings[list->num_strings++] = str;\n\treturn 0;\n}\n\n#define NOT_IN_SECTION\t\t-1\n#define IN_UNKNOWN_SECTION\t-2\n\nstatic int\nparse_text_file(const tchar *path, tchar *buf, size_t buflen,\n\t\tconst struct text_file_section *pos_sections,\n\t\tint num_pos_sections, int flags, line_mangle_t mangle_line)\n{\n\tint current_section = NOT_IN_SECTION;\n\tbool have_named_sections = false;\n\ttchar *p;\n\ttchar *nl;\n\tunsigned long line_no = 1;\n\n\tfor (int i = 0; i < num_pos_sections; i++) {\n\t\tif (*pos_sections[i].name)\n\t\t\thave_named_sections = true;\n\t\telse\n\t\t\tcurrent_section = i;\n\t}\n\n\tfor (p = buf; p != buf + buflen; p = nl + 1, line_no++) {\n\t\ttchar *line_begin, *line_end;\n\t\tsize_t line_len;\n\t\tint ret;\n\n\t\tnl = tmemchr(p, T('\\n'), buf + buflen - p);\n\t\tif (!nl)\n\t\t\tbreak;\n\n\t\tline_begin = p;\n\t\tline_end = nl;\n\n\t\t/* Ignore leading whitespace.  */\n\t\twhile (line_begin < nl && istspace(*line_begin))\n\t\t\tline_begin++;\n\n\t\t/* Ignore trailing whitespace.  */\n\t\twhile (line_end > line_begin && istspace(*(line_end - 1)))\n\t\t\tline_end--;\n\n\t\tline_len = line_end - line_begin;\n\n\t\t/* Ignore comments and empty lines.  */\n\t\tif (line_len == 0 || *line_begin == T(';') || *line_begin == T('#'))\n\t\t\tcontinue;\n\n\t\tline_begin[line_len] = T('\\0');\n\n\t\t/* Check for beginning of new section.  */\n\t\tif (line_begin[0] == T('[') &&\n\t\t    line_begin[line_len - 1] == T(']') &&\n\t\t    have_named_sections)\n\t\t{\n\t\t\tline_begin[line_len - 1] = T('\\0');\n\t\t\tcurrent_section = IN_UNKNOWN_SECTION;\n\t\t\tfor (int i = 0; i < num_pos_sections; i++) {\n\t\t\t\tif (!tstrcmp(line_begin + 1,\n\t\t\t\t\t     pos_sections[i].name))\n\t\t\t\t{\n\t\t\t\t\tcurrent_section = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tline_begin[line_len - 1] = T(']');\n\t\t\tif (current_section < 0) {\n\t\t\t\tif (!(flags & LOAD_TEXT_FILE_NO_WARNINGS)) {\n\t\t\t\t\tWARNING(\"%\"TS\":%lu: Unrecognized section \\\"%\"TS\"\\\"\",\n\t\t\t\t\t\tpath, line_no, line_begin);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (current_section < 0) {\n\t\t\tif (current_section == NOT_IN_SECTION) {\n\t\t\t\tif (!(flags & LOAD_TEXT_FILE_NO_WARNINGS)) {\n\t\t\t\t\tWARNING(\"%\"TS\":%lu: Not in a bracketed section!\",\n\t\t\t\t\t\tpath, line_no);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (flags & LOAD_TEXT_FILE_REMOVE_QUOTES) {\n\t\t\tif (line_begin[0] == T('\"') || line_begin[0] == T('\\'')) {\n\t\t\t\ttchar quote = line_begin[0];\n\t\t\t\tif (line_len >= 2 &&\n\t\t\t\t    line_begin[line_len - 1] == quote)\n\t\t\t\t{\n\t\t\t\t\tline_begin++;\n\t\t\t\t\tline_len -= 2;\n\t\t\t\t\tline_begin[line_len] = T('\\0');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (mangle_line) {\n\t\t\tret = (*mangle_line)(line_begin, path, line_no);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t}\n\n\t\tret = string_list_append(pos_sections[current_section].strings,\n\t\t\t\t\t line_begin);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\n/**\n * load_text_file -\n *\n * Read and parse lines from a text file given as an on-disk file, standard\n * input, or a buffer.  The file may contain sections, like in an INI file.\n *\n * @path\n *\tIf @buf is NULL, then either the path to the file on-disk to read, or\n *\tNULL to read from standard input.  Else, a dummy name for the buffer.\n * @buf\n *\tIf NULL, the data will be read from the @path file.  Otherwise the data\n *\twill be read from this buffer.\n * @bufsize\n *\tLength of buffer in bytes; ignored if @buf is NULL.\n * @mem_ret\n *\tOn success, a pointer to a buffer backing the parsed lines is stored\n *\there.  This must be freed after the parsed lines are done being used.\n * @pos_sections\n *\tSpecifications of allowed sections in the file.  Each such specification\n *\tconsists of the name of the section (e.g. [ExclusionList], like in the\n *\tINI file format), along with a pointer to the list of lines parsed for\n *\tthat section.  Use an empty name to indicate the destination of lines\n *\tnot in any section.  Each list must be initialized to empty.\n * @num_pos_sections\n *\tNumber of entries in the @pos_sections array.\n * @flags\n *\tFlags: LOAD_TEXT_FILE_* flags.\n * @mangle_line\n *\tOptional callback to validate and/or modify each line being read.\n *\n * Returns 0 on success; nonzero on failure.\n *\n * Unknown sections are ignored, but a warning is printed for each, unless\n * LOAD_TEXT_FILE_NO_WARNINGS is specified.\n */\nint\nload_text_file(const tchar *path, const void *buf, size_t bufsize,\n\t       void **mem_ret,\n\t       const struct text_file_section *pos_sections,\n\t       int num_pos_sections,\n\t       int flags, line_mangle_t mangle_line)\n{\n\tint ret;\n\tbool is_filemode = (buf == NULL);\n\tbool is_stdin = (is_filemode && path == NULL);\n\ttchar *tstr;\n\tsize_t tstr_nchars;\n\n\tif (is_stdin && !(flags & LOAD_TEXT_FILE_ALLOW_STDIN))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (is_filemode) {\n\t\tif (is_stdin)\n\t\t\tret = stdin_get_contents((void **)&buf, &bufsize);\n\t\telse\n\t\t\tret = read_file_contents(path, (void **)&buf, &bufsize);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tret = translate_text_buffer(buf, bufsize, &tstr, &tstr_nchars);\n\tif (is_filemode)\n\t\tFREE((void *)buf);\n\tif (ret)\n\t\treturn ret;\n\n\ttstr[tstr_nchars++] = T('\\n');\n\n\tret = parse_text_file(is_stdin ? T(\"<stdin>\") : path,\n\t\t\t      tstr, tstr_nchars, pos_sections,\n\t\t\t      num_pos_sections, flags, mangle_line);\n\tif (ret) {\n\t\tfor (int i = 0; i < num_pos_sections; i++)\n\t\t\tFREE(pos_sections[i].strings->strings);\n\t\tFREE(tstr);\n\t\treturn ret;\n\t}\n\n\t*mem_ret = tstr;\n\treturn 0;\n}\n\n/* API function documented in wimlib.h */\nWIMLIBAPI int\nwimlib_load_text_file(const tchar *path,\n\t\t      tchar **tstr_ret, size_t *tstr_nchars_ret)\n{\n\tvoid *buf;\n\tsize_t bufsize;\n\tint ret;\n\n\tif (path == NULL || (path[0] == '-' && path[1] == '\\0'))\n\t\tret = stdin_get_contents(&buf, &bufsize);\n\telse\n\t\tret = read_file_contents(path, &buf, &bufsize);\n\tif (ret)\n\t\treturn ret;\n\tret = translate_text_buffer(buf, bufsize, tstr_ret, tstr_nchars_ret);\n\tFREE(buf);\n\treturn ret;\n}\n"
  },
  {
    "path": "src/wimlib/threads.c",
    "content": "/*\n * threads.c - Thread, mutex, and condition variable support.  Wraps around\n *             pthreads or Windows native threads.\n */\n\n/*\n * Copyright 2016-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#ifdef _WIN32\n#  include \"wimlib/win32_common.h\"\n#else\n#  include <errno.h>\n#  include <pthread.h>\n#endif\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/threads.h\"\n#include \"wimlib/util.h\"\n\n#ifdef _WIN32\n\nstatic DWORD WINAPI\nwin32_thrproc(LPVOID lpParameter)\n{\n\tstruct thread *t = (struct thread *)lpParameter;\n\n\t(*t->thrproc)(t->arg);\n\treturn 0;\n}\n\nbool thread_create(struct thread *t, void *(*thrproc)(void *), void *arg)\n{\n\tHANDLE h;\n\n\tt->thrproc = thrproc;\n\tt->arg = arg;\n\th = CreateThread(NULL, 0, win32_thrproc, (LPVOID)t, 0, NULL);\n\tif (h == NULL) {\n\t\twin32_error(GetLastError(), L\"Failed to create thread\");\n\t\treturn false;\n\t}\n\tt->win32_thread = (void *)h;\n\treturn true;\n}\n\nvoid thread_join(struct thread *t)\n{\n\tDWORD res = WaitForSingleObject((HANDLE)t->win32_thread, INFINITE);\n\n\twimlib_assert(res == WAIT_OBJECT_0);\n}\n\nbool mutex_init(struct mutex *m)\n{\n\tCRITICAL_SECTION *crit = MALLOC(sizeof(*crit));\n\n\tif (!crit)\n\t\treturn false;\n\tInitializeCriticalSection(crit);\n\tm->win32_crit = crit;\n\treturn true;\n}\n\nvoid mutex_destroy(struct mutex *m)\n{\n\tDeleteCriticalSection(m->win32_crit);\n\tFREE(m->win32_crit);\n\tm->win32_crit = NULL;\n}\n\nvoid mutex_lock(struct mutex *m)\n{\n\tCRITICAL_SECTION *crit = m->win32_crit;\n\n\tif (unlikely(!crit)) {\n\t\tCRITICAL_SECTION *old;\n\n\t\tcrit = MALLOC(sizeof(*crit));\n\t\twimlib_assert(crit != NULL);\n\t\tInitializeCriticalSection(crit);\n\t\told = InterlockedCompareExchangePointer(&m->win32_crit, crit,\n\t\t\t\t\t\t\tNULL);\n\t\tif (old) {\n\t\t\tDeleteCriticalSection(crit);\n\t\t\tFREE(crit);\n\t\t\tcrit = old;\n\t\t}\n\t}\n\tEnterCriticalSection(crit);\n}\n\nvoid mutex_unlock(struct mutex *m)\n{\n\tLeaveCriticalSection(m->win32_crit);\n}\n\nbool condvar_init(struct condvar *c)\n{\n\tCONDITION_VARIABLE *cond = MALLOC(sizeof(*cond));\n\n\tif (!cond)\n\t\treturn false;\n\tInitializeConditionVariable(cond);\n\tc->win32_cond = cond;\n\treturn true;\n}\n\nvoid condvar_destroy(struct condvar *c)\n{\n\tFREE(c->win32_cond);\n\tc->win32_cond = NULL;\n}\n\nvoid condvar_wait(struct condvar *c, struct mutex *m)\n{\n\tBOOL ok = SleepConditionVariableCS(c->win32_cond, m->win32_crit,\n\t\t\t\t\t   INFINITE);\n\twimlib_assert(ok);\n}\n\nvoid condvar_signal(struct condvar *c)\n{\n\tWakeConditionVariable(c->win32_cond);\n}\n\nvoid condvar_broadcast(struct condvar *c)\n{\n\tWakeAllConditionVariable(c->win32_cond);\n}\n\n#else /* _WIN32 */\n\nbool thread_create(struct thread *t, void *(*thrproc)(void *), void *arg)\n{\n\tint err = pthread_create(&t->pthread, NULL, thrproc, arg);\n\n\tif (err) {\n\t\terrno = err;\n\t\tERROR_WITH_ERRNO(\"Failed to create thread\");\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nvoid thread_join(struct thread *t)\n{\n\tint err = pthread_join(t->pthread, NULL);\n\n\twimlib_assert(err == 0);\n}\n\nbool mutex_init(struct mutex *m)\n{\n\tint err = pthread_mutex_init(&m->pthread_mutex, NULL);\n\n\tif (err) {\n\t\terrno = err;\n\t\tERROR_WITH_ERRNO(\"Failed to initialize mutex\");\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nvoid mutex_destroy(struct mutex *m)\n{\n\tint err = pthread_mutex_destroy(&m->pthread_mutex);\n\n\twimlib_assert(err == 0);\n}\n\nvoid mutex_lock(struct mutex *m)\n{\n\tint err = pthread_mutex_lock(&m->pthread_mutex);\n\n\twimlib_assert(err == 0);\n}\n\nvoid mutex_unlock(struct mutex *m)\n{\n\tint err = pthread_mutex_unlock(&m->pthread_mutex);\n\n\twimlib_assert(err == 0);\n}\n\nbool condvar_init(struct condvar *c)\n{\n\tint err = pthread_cond_init(&c->pthread_cond, NULL);\n\n\tif (err) {\n\t\terrno = err;\n\t\tERROR_WITH_ERRNO(\"Failed to initialize condition variable\");\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nvoid condvar_destroy(struct condvar *c)\n{\n\tint err = pthread_cond_destroy(&c->pthread_cond);\n\n\twimlib_assert(err == 0);\n}\n\nvoid condvar_wait(struct condvar *c, struct mutex *m)\n{\n\tint err = pthread_cond_wait(&c->pthread_cond, &m->pthread_mutex);\n\n\twimlib_assert(err == 0);\n}\n\nvoid condvar_signal(struct condvar *c)\n{\n\tint err = pthread_cond_signal(&c->pthread_cond);\n\n\twimlib_assert(err == 0);\n}\n\nvoid condvar_broadcast(struct condvar *c)\n{\n\tint err = pthread_cond_broadcast(&c->pthread_cond);\n\n\twimlib_assert(err == 0);\n}\n\n#endif /* !_WIN32 */\n"
  },
  {
    "path": "src/wimlib/timestamp.c",
    "content": "/*\n * timestamp.c\n *\n * Conversion between Windows NT timestamps and UNIX timestamps.\n */\n\n/*\n * Copyright (C) 2012-2017 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib.h\" /* for struct wimlib_timespec */\n#include \"wimlib/timestamp.h\"\n\n/*\n * Timestamps in WIM files are Windows NT timestamps, or FILETIMEs: 64-bit\n * values storing the number of 100-nanosecond ticks since January 1, 1601.\n *\n * Note: UNIX timestamps are signed; Windows timestamps are not.  Negative UNIX\n * timestamps represent times before 1970-01-01.  When such a timestamp is\n * converted to a Windows timestamp, we can preserve the correct date provided\n * that it is not also before 1601-01-01.\n */\n\n#define NANOSECONDS_PER_TICK\t100\n#define TICKS_PER_SECOND\t(1000000000 / NANOSECONDS_PER_TICK)\n#define TICKS_PER_MICROSECOND\t(TICKS_PER_SECOND / 1000000)\n\n/*\n * EPOCH_DISTANCE is the number of seconds separating the Windows NT and UNIX\n * epochs.  This is equal to ((1970-1601)*365+89)*24*60*60.  89 is the number\n * of leap years between 1970 and 1601.\n */\n#define EPOCH_DISTANCE\t\t11644473600\n\n/* Windows NT timestamps to UNIX timestamps  */\n\ntime_t\nwim_timestamp_to_time_t(u64 timestamp)\n{\n\treturn (timestamp / TICKS_PER_SECOND) - EPOCH_DISTANCE;\n}\n\nvoid\nwim_timestamp_to_wimlib_timespec(u64 timestamp, struct wimlib_timespec *wts,\n\t\t\t\t s32 *high_part_ret)\n{\n\ts64 sec = (timestamp / TICKS_PER_SECOND) - EPOCH_DISTANCE;\n\n\twts->tv_sec = sec;\n\twts->tv_nsec = (timestamp % TICKS_PER_SECOND) * NANOSECONDS_PER_TICK;\n\n\tif (sizeof(wts->tv_sec) == 4)\n\t\t*high_part_ret = sec >> 32;\n}\n\n#ifdef _WIN32\nstatic void __attribute__((unused))\ncheck_sizeof_time_t(void)\n{\n\t/* Windows builds should always be using 64-bit time_t now. */\n\tSTATIC_ASSERT(sizeof(time_t) == 8);\n}\n#else\nstruct timeval\nwim_timestamp_to_timeval(u64 timestamp)\n{\n\treturn (struct timeval) {\n\t\t.tv_sec = wim_timestamp_to_time_t(timestamp),\n\t\t.tv_usec = (timestamp % TICKS_PER_SECOND) / TICKS_PER_MICROSECOND,\n\t};\n}\n\nstruct timespec\nwim_timestamp_to_timespec(u64 timestamp)\n{\n\treturn (struct timespec) {\n\t\t.tv_sec = wim_timestamp_to_time_t(timestamp),\n\t\t.tv_nsec = (timestamp % TICKS_PER_SECOND) * NANOSECONDS_PER_TICK,\n\t};\n}\n#endif /* !_WIN32 */\n\n/* UNIX timestamps to Windows NT timestamps  */\n\nu64\ntime_t_to_wim_timestamp(time_t t)\n{\n\treturn ((u64)t + EPOCH_DISTANCE) * TICKS_PER_SECOND;\n}\n\n#ifndef _WIN32\nu64\ntimeval_to_wim_timestamp(const struct timeval *tv)\n{\n\treturn time_t_to_wim_timestamp(tv->tv_sec) +\n\t\t(u32)tv->tv_usec * TICKS_PER_MICROSECOND;\n}\n\nu64\ntimespec_to_wim_timestamp(const struct timespec *ts)\n{\n\treturn time_t_to_wim_timestamp(ts->tv_sec) +\n\t\t(u32)ts->tv_nsec / NANOSECONDS_PER_TICK;\n}\n\n/* Retrieve the current time as a WIM timestamp.  */\nu64\nnow_as_wim_timestamp(void)\n{\n\tstruct timeval tv;\n\n\tgettimeofday(&tv, NULL);\n\treturn timeval_to_wim_timestamp(&tv);\n}\n#endif /* !_WIN32 */\n\n/* Translate a WIM timestamp into a human-readable string.  */\nvoid\nwim_timestamp_to_str(u64 timestamp, tchar *buf, size_t len)\n{\n\tstruct tm tm = { 0 };\n\ttime_t t = wim_timestamp_to_time_t(timestamp);\n\n#ifdef _WIN32\n\tgmtime_s(&tm, &t);\n#else\n\tgmtime_r(&t, &tm);\n#endif\n\ttstrftime(buf, len, T(\"%a %b %d %H:%M:%S %Y UTC\"), &tm);\n}\n"
  },
  {
    "path": "src/wimlib/update_image.c",
    "content": "/*\n * update_image.c - see description below\n */\n\n/*\n * Copyright (C) 2013, 2014 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n/*\n * This file contains the implementation of wimlib_update_image(), which is one\n * of the two ways by which library users can make changes to a WIM image.  (The\n * other way is by mounting an image read-write.)  wimlib_update_image() is also\n * used in the implementation of wimlib_add_image(), since \"create a WIM image\n * from this directory tree\" is equivalent to \"create an empty WIM image, then\n * update it to add this directory tree as the root\".\n *\n * wimlib_update_image() processes a list of commands passed to it.  Currently,\n * the following types of commands are supported:\n *\n * - Add a directory tree from an external source (filesystem or NTFS volume).\n *   This can be used to add new files or to replace existing files.\n * - Delete a file or directory tree.\n * - Rename a file or directory tree.\n *\n * Not supported are creating links to existing files or changing metadata of\n * existing files.\n *\n * wimlib_update_image() is atomic.  If it cannot complete successfully, then\n * all changes are rolled back and the WIMStruct is left unchanged.  Rollback is\n * implemented by breaking the commands into primitive operations such as \"link\n * this dentry tree here\" which can be undone by doing the opposite operations\n * in reverse order.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n#include <string.h>\n#include <sys/stat.h>\n\n#include \"wimlib/alloca.h\"\n#include \"wimlib/assert.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/progress.h\"\n#include \"wimlib/scan.h\"\n#include \"wimlib/test_support.h\"\n#include \"wimlib/xml_windows.h\"\n\n/* Saved specification of a \"primitive\" update operation that was performed.  */\nstruct update_primitive {\n\tenum {\n\t\t/* Unlinked a dentry from its parent directory.  */\n\t\tUNLINK_DENTRY,\n\n\t\t/* Linked a dentry into its parent directory.  */\n\t\tLINK_DENTRY,\n\n\t\t/* Changed the file name of a dentry.  */\n\t\tCHANGE_FILE_NAME,\n\n\t\t/* Changed the short name of a dentry.  */\n\t\tCHANGE_SHORT_NAME,\n\t} type;\n\n\tunion {\n\t\t/* For UNLINK_DENTRY and LINK_DENTRY operations  */\n\t\tstruct {\n\t\t\t/* Dentry that was linked or unlinked.  */\n\t\t\tstruct wim_dentry *subject;\n\n\t\t\t/* For link operations, the directory into which\n\t\t\t * @subject was linked, or NULL if @subject was set as\n\t\t\t * the root of the image.\n\t\t\t *\n\t\t\t * For unlink operations, the directory from which\n\t\t\t * @subject was unlinked, or NULL if @subject was unset\n\t\t\t * as the root of the image.  */\n\t\t\tstruct wim_dentry *parent;\n\t\t} link;\n\n\t\t/* For CHANGE_FILE_NAME and CHANGE_SHORT_NAME operations  */\n\t\tstruct {\n\t\t\t/* Dentry that had its name changed.  */\n\t\t\tstruct wim_dentry *subject;\n\n\t\t\t/* The old name.  */\n\t\t\tutf16lechar *old_name;\n\t\t} name;\n\t};\n};\n\n/* Chronological list of primitive operations that were executed for a single\n * logical update command, such as 'add', 'delete', or 'rename'.  */\nstruct update_primitive_list {\n\tstruct update_primitive *entries;\n\tstruct update_primitive inline_entries[4];\n\tsize_t num_entries;\n\tsize_t num_alloc_entries;\n};\n\n/* Journal for managing the executing of zero or more logical update commands,\n * such as 'add', 'delete', or 'rename'.  This allows either committing or\n * rolling back the commands.  */\nstruct update_command_journal {\n\t/* Number of update commands this journal contains.  */\n\tsize_t num_cmds;\n\n\t/* Index of currently executing update command.  */\n\tsize_t cur_cmd;\n\n\t/* Location of the WIM image's root pointer.  */\n\tstruct wim_dentry **root_p;\n\n\t/* Pointer to the blob table of the WIM (may needed for rollback)  */\n\tstruct blob_table *blob_table;\n\n\t/* List of dentries that are currently unlinked from the WIM image.\n\t * These must be freed when no longer needed for commit or rollback.  */\n\tstruct list_head orphans;\n\n\t/* Per-command logs.  */\n\tstruct update_primitive_list cmd_prims[];\n};\n\nstatic void\ninit_update_primitive_list(struct update_primitive_list *l)\n{\n\tl->entries = l->inline_entries;\n\tl->num_entries = 0;\n\tl->num_alloc_entries = ARRAY_LEN(l->inline_entries);\n}\n\n/* Allocates a new journal for managing the execution of up to @num_cmds update\n * commands.  */\nstatic struct update_command_journal *\nnew_update_command_journal(size_t num_cmds, struct wim_dentry **root_p,\n\t\t\t   struct blob_table *blob_table)\n{\n\tstruct update_command_journal *j;\n\n\tj = MALLOC(sizeof(*j) + num_cmds * sizeof(j->cmd_prims[0]));\n\tif (j) {\n\t\tj->num_cmds = num_cmds;\n\t\tj->cur_cmd = 0;\n\t\tj->root_p = root_p;\n\t\tj->blob_table = blob_table;\n\t\tINIT_LIST_HEAD(&j->orphans);\n\t\tfor (size_t i = 0; i < num_cmds; i++)\n\t\t\tinit_update_primitive_list(&j->cmd_prims[i]);\n\t}\n\treturn j;\n}\n\n/* Don't call this directly; use commit_update() or rollback_update() instead.\n */\nstatic void\nfree_update_command_journal(struct update_command_journal *j)\n{\n\tstruct wim_dentry *orphan;\n\n\t/* Free orphaned dentry trees  */\n\twhile (!list_empty(&j->orphans)) {\n\t\torphan = list_first_entry(&j->orphans,\n\t\t\t\t\t  struct wim_dentry, d_tmp_list);\n\t\tlist_del(&orphan->d_tmp_list);\n\t\tfree_dentry_tree(orphan, j->blob_table);\n\t}\n\n\tfor (size_t i = 0; i < j->num_cmds; i++)\n\t\tif (j->cmd_prims[i].entries != j->cmd_prims[i].inline_entries)\n\t\t\tFREE(j->cmd_prims[i].entries);\n\tFREE(j);\n}\n\n/* Add the entry @prim to the update command journal @j.  */\nstatic int\nrecord_update_primitive(struct update_command_journal *j,\n\t\t\tstruct update_primitive prim)\n{\n\tstruct update_primitive_list *l;\n\n\tl = &j->cmd_prims[j->cur_cmd];\n\n\tif (l->num_entries == l->num_alloc_entries) {\n\t\tstruct update_primitive *new_entries;\n\t\tsize_t new_num_alloc_entries;\n\t\tsize_t new_size;\n\n\t\tnew_num_alloc_entries = l->num_alloc_entries * 2;\n\t\tnew_size = new_num_alloc_entries * sizeof(new_entries[0]);\n\t\tif (l->entries == l->inline_entries) {\n\t\t\tnew_entries = MALLOC(new_size);\n\t\t\tif (!new_entries)\n\t\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\t\tmemcpy(new_entries, l->inline_entries,\n\t\t\t       sizeof(l->inline_entries));\n\t\t} else {\n\t\t\tnew_entries = REALLOC(l->entries, new_size);\n\t\t\tif (!new_entries)\n\t\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\t}\n\t\tl->entries = new_entries;\n\t\tl->num_alloc_entries = new_num_alloc_entries;\n\t}\n\tl->entries[l->num_entries++] = prim;\n\treturn 0;\n}\n\nstatic void\ndo_unlink(struct wim_dentry *subject, struct wim_dentry *parent,\n\t  struct wim_dentry **root_p)\n{\n\tif (parent) {\n\t\t/* Unlink @subject from its @parent.  */\n\t\twimlib_assert(subject->d_parent == parent);\n\t\tunlink_dentry(subject);\n\t} else {\n\t\t/* Unset @subject as the root of the image.  */\n\t\t*root_p = NULL;\n\t}\n\tsubject->d_parent = subject;\n}\n\nstatic void\ndo_link(struct wim_dentry *subject, struct wim_dentry *parent,\n\tstruct wim_dentry **root_p)\n{\n\tif (parent) {\n\t\t/* Link @subject to its @parent  */\n\t\tstruct wim_dentry *existing;\n\n\t\texisting = dentry_add_child(parent, subject);\n\t\twimlib_assert(!existing);\n\t} else {\n\t\t/* Set @subject as root of the image  */\n\t\t*root_p = subject;\n\t}\n}\n\n/* Undo a link operation.  */\nstatic void\nrollback_link(struct wim_dentry *subject, struct wim_dentry *parent,\n\t      struct wim_dentry **root_p, struct list_head *orphans)\n{\n\t/* Unlink is the opposite of link  */\n\tdo_unlink(subject, parent, root_p);\n\n\t/* @subject is now unlinked.  Add it to orphans. */\n\tlist_add(&subject->d_tmp_list, orphans);\n\tsubject->d_is_orphan = 1;\n}\n\n/* Undo an unlink operation.  */\nstatic void\nrollback_unlink(struct wim_dentry *subject, struct wim_dentry *parent,\n\t\tstruct wim_dentry **root_p)\n{\n\t/* Link is the opposite of unlink  */\n\tdo_link(subject, parent, root_p);\n\n\t/* @subject is no longer unlinked.  Delete it from orphans. */\n\tlist_del(&subject->d_tmp_list);\n\tsubject->d_is_orphan = 0;\n}\n\n/* Rollback a name change operation.  */\nstatic void\nrollback_name_change(utf16lechar *old_name,\n\t\t     utf16lechar **name_ptr, u16 *name_nbytes_ptr)\n{\n\t/* Free the new name, then replace it with the old name.  */\n\tFREE(*name_ptr);\n\tif (old_name) {\n\t\t*name_ptr = old_name;\n\t\t*name_nbytes_ptr = utf16le_len_bytes(old_name);\n\t} else {\n\t\t*name_ptr = NULL;\n\t\t*name_nbytes_ptr = 0;\n\t}\n}\n\n/* Rollback a primitive update operation.  */\nstatic void\nrollback_update_primitive(const struct update_primitive *prim,\n\t\t\t  struct wim_dentry **root_p,\n\t\t\t  struct list_head *orphans)\n{\n\tswitch (prim->type) {\n\tcase LINK_DENTRY:\n\t\trollback_link(prim->link.subject, prim->link.parent, root_p,\n\t\t\t      orphans);\n\t\tbreak;\n\tcase UNLINK_DENTRY:\n\t\trollback_unlink(prim->link.subject, prim->link.parent, root_p);\n\t\tbreak;\n\tcase CHANGE_FILE_NAME:\n\t\trollback_name_change(prim->name.old_name,\n\t\t\t\t     &prim->name.subject->d_name,\n\t\t\t\t     &prim->name.subject->d_name_nbytes);\n\t\tbreak;\n\tcase CHANGE_SHORT_NAME:\n\t\trollback_name_change(prim->name.old_name,\n\t\t\t\t     &prim->name.subject->d_short_name,\n\t\t\t\t     &prim->name.subject->d_short_name_nbytes);\n\t\tbreak;\n\t}\n}\n\n/* Rollback a logical update command  */\nstatic void\nrollback_update_command(const struct update_primitive_list *l,\n\t\t\tstruct wim_dentry **root_p,\n\t\t\tstruct list_head *orphans)\n{\n\tsize_t i = l->num_entries;\n\n\t/* Rollback each primitive operation, in reverse order.  */\n\twhile (i--)\n\t\trollback_update_primitive(&l->entries[i], root_p, orphans);\n}\n\n/****************************************************************************/\n\n/* Link @subject into the directory @parent; or, if @parent is NULL, set\n * @subject as the root of the WIM image.\n *\n * This is the journaled version, so it can be rolled back.  */\nstatic int\njournaled_link(struct update_command_journal *j,\n\t       struct wim_dentry *subject, struct wim_dentry *parent)\n{\n\tstruct update_primitive prim;\n\tint ret;\n\n\tprim.type = LINK_DENTRY;\n\tprim.link.subject = subject;\n\tprim.link.parent = parent;\n\n\tret = record_update_primitive(j, prim);\n\tif (ret)\n\t\treturn ret;\n\n\tdo_link(subject, parent, j->root_p);\n\n\tif (subject->d_is_orphan) {\n\t\tlist_del(&subject->d_tmp_list);\n\t\tsubject->d_is_orphan = 0;\n\t}\n\treturn 0;\n}\n\n/* Unlink @subject from the WIM image.\n *\n * This is the journaled version, so it can be rolled back.  */\nstatic int\njournaled_unlink(struct update_command_journal *j, struct wim_dentry *subject)\n{\n\tstruct wim_dentry *parent;\n\tstruct update_primitive prim;\n\tint ret;\n\n\tif (dentry_is_root(subject))\n\t\tparent = NULL;\n\telse\n\t\tparent = subject->d_parent;\n\n\tprim.type = UNLINK_DENTRY;\n\tprim.link.subject = subject;\n\tprim.link.parent = parent;\n\n\tret = record_update_primitive(j, prim);\n\tif (ret)\n\t\treturn ret;\n\n\tdo_unlink(subject, parent, j->root_p);\n\n\tlist_add(&subject->d_tmp_list, &j->orphans);\n\tsubject->d_is_orphan = 1;\n\treturn 0;\n}\n\n/* Change the name of @dentry to @new_name_tstr.\n *\n * This is the journaled version, so it can be rolled back.  */\nstatic int\njournaled_change_name(struct update_command_journal *j,\n\t\t      struct wim_dentry *dentry, const tchar *new_name_tstr)\n{\n\tint ret;\n\tutf16lechar *new_name;\n\tsize_t new_name_nbytes;\n\tstruct update_primitive prim;\n\n\t/* Set the long name.  */\n\tret = tstr_to_utf16le(new_name_tstr,\n\t\t\t      tstrlen(new_name_tstr) * sizeof(tchar),\n\t\t\t      &new_name, &new_name_nbytes);\n\tif (ret)\n\t\treturn ret;\n\n\tprim.type = CHANGE_FILE_NAME;\n\tprim.name.subject = dentry;\n\tprim.name.old_name = dentry->d_name;\n\tret = record_update_primitive(j, prim);\n\tif (ret) {\n\t\tFREE(new_name);\n\t\treturn ret;\n\t}\n\n\tdentry->d_name = new_name;\n\tdentry->d_name_nbytes = new_name_nbytes;\n\n\t/* Clear the short name.  */\n\tprim.type = CHANGE_SHORT_NAME;\n\tprim.name.subject = dentry;\n\tprim.name.old_name = dentry->d_short_name;\n\tret = record_update_primitive(j, prim);\n\tif (ret)\n\t\treturn ret;\n\n\tdentry->d_short_name = NULL;\n\tdentry->d_short_name_nbytes = 0;\n\treturn 0;\n}\n\nstatic void\nnext_command(struct update_command_journal *j)\n{\n\tj->cur_cmd++;\n}\n\nstatic void\ncommit_update(struct update_command_journal *j)\n{\n\tfor (size_t i = 0; i < j->num_cmds; i++)\n\t{\n\t\tfor (size_t k = 0; k < j->cmd_prims[i].num_entries; k++)\n\t\t{\n\t\t\tif (j->cmd_prims[i].entries[k].type == CHANGE_FILE_NAME ||\n\t\t\t    j->cmd_prims[i].entries[k].type == CHANGE_SHORT_NAME)\n\t\t\t{\n\t\t\t\tFREE(j->cmd_prims[i].entries[k].name.old_name);\n\t\t\t}\n\t\t}\n\t}\n\tfree_update_command_journal(j);\n}\n\nstatic void\nrollback_update(struct update_command_journal *j)\n{\n\t/* Rollback each logical update command, in reverse order.  */\n\tsize_t i = j->cur_cmd;\n\tif (i < j->num_cmds)\n\t\ti++;\n\twhile (i--)\n\t\trollback_update_command(&j->cmd_prims[i], j->root_p, &j->orphans);\n\tfree_update_command_journal(j);\n}\n\nstatic int\nhandle_conflict(struct wim_dentry *branch, struct wim_dentry *existing,\n\t\tstruct update_command_journal *j,\n\t\tint add_flags,\n\t\twimlib_progress_func_t progfunc, void *progctx)\n{\n\tbool branch_is_dir = dentry_is_directory(branch);\n\tbool existing_is_dir = dentry_is_directory(existing);\n\n\tif (branch_is_dir != existing_is_dir) {\n\t\tif (existing_is_dir)  {\n\t\t\tERROR(\"\\\"%\"TS\"\\\" is a directory!\\n\"\n\t\t\t      \"        Specify the path at which \"\n\t\t\t      \"to place the file inside this directory.\",\n\t\t\t      dentry_full_path(existing));\n\t\t\treturn WIMLIB_ERR_IS_DIRECTORY;\n\t\t} else {\n\t\t\tERROR(\"Can't place directory at \\\"%\"TS\"\\\" because \"\n\t\t\t      \"a nondirectory file already exists there!\",\n\t\t\t      dentry_full_path(existing));\n\t\t\treturn WIMLIB_ERR_NOTDIR;\n\t\t}\n\t}\n\n\tif (branch_is_dir) {\n\t\t/* Directory overlay  */\n\t\twhile (dentry_has_children(branch)) {\n\t\t\tstruct wim_dentry *new_child;\n\t\t\tstruct wim_dentry *existing_child;\n\t\t\tint ret;\n\n\t\t\tnew_child = dentry_any_child(branch);\n\n\t\t\texisting_child =\n\t\t\t\tget_dentry_child_with_utf16le_name(existing,\n\t\t\t\t\t\t\t\t   new_child->d_name,\n\t\t\t\t\t\t\t\t   new_child->d_name_nbytes,\n\t\t\t\t\t\t\t\t   WIMLIB_CASE_PLATFORM_DEFAULT);\n\t\t\tunlink_dentry(new_child);\n\t\t\tif (existing_child) {\n\t\t\t\tret = handle_conflict(new_child, existing_child,\n\t\t\t\t\t\t      j, add_flags,\n\t\t\t\t\t\t      progfunc, progctx);\n\t\t\t} else {\n\t\t\t\tret = journaled_link(j, new_child, existing);\n\t\t\t}\n\t\t\tif (ret) {\n\t\t\t\tdentry_add_child(branch, new_child);\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\t\tfree_dentry_tree(branch, j->blob_table);\n\t\treturn 0;\n\t} else if (add_flags & WIMLIB_ADD_FLAG_NO_REPLACE) {\n\t\t/* Can't replace nondirectory file  */\n\t\tERROR(\"Refusing to overwrite nondirectory file \\\"%\"TS\"\\\"\",\n\t\t      dentry_full_path(existing));\n\t\treturn WIMLIB_ERR_INVALID_OVERLAY;\n\t} else {\n\t\t/* Replace nondirectory file  */\n\t\tstruct wim_dentry *parent;\n\t\tint ret;\n\n\t\tparent = existing->d_parent;\n\n\t\tret = calculate_dentry_full_path(existing);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tif (add_flags & WIMLIB_ADD_FLAG_VERBOSE) {\n\t\t\tunion wimlib_progress_info info;\n\n\t\t\tinfo.replace.path_in_wim = existing->d_full_path;\n\t\t\tret = call_progress(progfunc,\n\t\t\t\t\t    WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM,\n\t\t\t\t\t    &info, progctx);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t}\n\n\t\tret = journaled_unlink(j, existing);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\treturn journaled_link(j, branch, parent);\n\t}\n}\n\nstatic int\ndo_attach_branch(struct wim_dentry *branch, const utf16lechar *target,\n\t\t struct update_command_journal *j,\n\t\t int add_flags, wimlib_progress_func_t progfunc, void *progctx)\n{\n\tstruct wim_dentry *parent;\n\tstruct wim_dentry *existing;\n\tconst utf16lechar empty_name[1] = {0};\n\tconst utf16lechar *cur_component_name;\n\tsize_t cur_component_nbytes;\n\tconst utf16lechar *next_component_name;\n\tint ret;\n\n\t/* Attempt to create root directory before proceeding to the \"real\"\n\t * first component  */\n\tparent = NULL;\n\texisting = *j->root_p;\n\tcur_component_name = empty_name;\n\tcur_component_nbytes = 0;\n\n\t/* Skip leading slashes  */\n\tnext_component_name = target;\n\twhile (*next_component_name == cpu_to_le16(WIM_PATH_SEPARATOR))\n\t\tnext_component_name++;\n\n\twhile (*next_component_name) { /* While not the last component ... */\n\t\tconst utf16lechar *end;\n\n\t\tif (existing) {\n\t\t\t/* Descend into existing directory  */\n\t\t\tif (!dentry_is_directory(existing)) {\n\t\t\t\tERROR(\"\\\"%\"TS\"\\\" in the WIM image \"\n\t\t\t\t      \"is not a directory!\",\n\t\t\t\t      dentry_full_path(existing));\n\t\t\t\treturn WIMLIB_ERR_NOTDIR;\n\t\t\t}\n\t\t} else {\n\t\t\t/* A parent directory of the target didn't exist.  Make\n\t\t\t * the way by creating a filler directory.  */\n\t\t\tstruct wim_dentry *filler;\n\n\t\t\tret = new_filler_directory(&filler);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\tret = dentry_set_name_utf16le(filler,\n\t\t\t\t\t\t      cur_component_name,\n\t\t\t\t\t\t      cur_component_nbytes);\n\t\t\tif (ret) {\n\t\t\t\tfree_dentry(filler);\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\tret = journaled_link(j, filler, parent);\n\t\t\tif (ret) {\n\t\t\t\tfree_dentry(filler);\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\texisting = filler;\n\t\t}\n\n\t\t/* Advance to next component  */\n\n\t\tcur_component_name = next_component_name;\n\t\tend = cur_component_name + 1;\n\t\twhile (*end && *end != cpu_to_le16(WIM_PATH_SEPARATOR))\n\t\t\tend++;\n\n\t\tnext_component_name = end;\n\t\tif (*end) {\n\t\t\t/* There will still be more components after this.  */\n\t\t\tdo {\n\t\t\t} while (*++next_component_name == cpu_to_le16(WIM_PATH_SEPARATOR));\n\t\t\twimlib_assert(*next_component_name);  /* No trailing slashes  */\n\t\t} else {\n\t\t\t/* This will be the last component  */\n\t\t\tnext_component_name = end;\n\t\t}\n\t\tparent = existing;\n\t\tcur_component_nbytes = (end - cur_component_name) * sizeof(utf16lechar);\n\t\texisting = get_dentry_child_with_utf16le_name(\n\t\t\t\t\tparent,\n\t\t\t\t\tcur_component_name,\n\t\t\t\t\tcur_component_nbytes,\n\t\t\t\t\tWIMLIB_CASE_PLATFORM_DEFAULT);\n\t}\n\n\t/* Last component  */\n\tif (existing) {\n\t\treturn handle_conflict(branch, existing, j, add_flags,\n\t\t\t\t       progfunc, progctx);\n\t} else {\n\t\treturn journaled_link(j, branch, parent);\n\t}\n}\n\n/*\n * Place the directory entry tree @branch at the path @target_tstr in the WIM\n * image.\n *\n * @target_tstr cannot contain trailing slashes, and all path separators must be\n * WIM_PATH_SEPARATOR.\n *\n * On success, @branch is committed to the journal @j.\n * Otherwise @branch is freed.\n *\n * The relevant @add_flags are WIMLIB_ADD_FLAG_NO_REPLACE and\n * WIMLIB_ADD_FLAG_VERBOSE.\n */\nstatic int\nattach_branch(struct wim_dentry *branch, const tchar *target_tstr,\n\t      struct update_command_journal *j, int add_flags,\n\t      wimlib_progress_func_t progfunc, void *progctx)\n{\n\tint ret;\n\tconst utf16lechar *target;\n\n\tret = 0;\n\tif (unlikely(!branch))\n\t\tgoto out;\n\n\tret = tstr_get_utf16le(target_tstr, &target);\n\tif (ret)\n\t\tgoto out_free_branch;\n\n\tSTATIC_ASSERT(WIM_PATH_SEPARATOR == OS_PREFERRED_PATH_SEPARATOR);\n\tret = dentry_set_name(branch, path_basename(target_tstr));\n\tif (ret)\n\t\tgoto out_free_target;\n\n\tret = do_attach_branch(branch, target, j, add_flags, progfunc, progctx);\n\tif (ret)\n\t\tgoto out_free_target;\n\t/* branch was successfully committed to the journal  */\n\tbranch = NULL;\nout_free_target:\n\ttstr_put_utf16le(target);\nout_free_branch:\n\tfree_dentry_tree(branch, j->blob_table);\nout:\n\treturn ret;\n}\n\nstatic const char wincfg[] =\n\"[ExclusionList]\\n\"\n\"/$ntfs.log\\n\"\n\"/hiberfil.sys\\n\"\n\"/pagefile.sys\\n\"\n\"/swapfile.sys\\n\"\n\"/System Volume Information\\n\"\n\"/RECYCLER\\n\"\n\"/$RECYCLE.BIN\\n\"\n\"/$Recycle.Bin\\n\"\n\"/Windows/CSC\\n\";\n\nstatic const tchar *wimboot_cfgfile =\n\t    WIMLIB_WIM_PATH_SEPARATOR_STRING T(\"Windows\")\n\t    WIMLIB_WIM_PATH_SEPARATOR_STRING T(\"System32\")\n\t    WIMLIB_WIM_PATH_SEPARATOR_STRING T(\"WimBootCompress.ini\");\n\nstatic int\nget_capture_config(const tchar *config_file, struct capture_config *config,\n\t\t   int add_flags, const tchar *fs_source_path)\n{\n\tint ret;\n\ttchar *tmp_config_file = NULL;\n\n\tmemset(config, 0, sizeof(*config));\n\n\t/* For WIMBoot capture, check for default capture configuration file\n\t * unless one was explicitly specified.  */\n\tif (!config_file && (add_flags & WIMLIB_ADD_FLAG_WIMBOOT)) {\n\n\t\t/* XXX: Handle loading file correctly when in NTFS volume.  */\n\n\t\tsize_t len = tstrlen(fs_source_path) +\n\t\t\t     tstrlen(wimboot_cfgfile);\n\t\tstruct _stat64 st;\n\n\t\ttmp_config_file = MALLOC((len + 1) * sizeof(tchar));\n\t\tif (!tmp_config_file)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\n\t\ttsprintf(tmp_config_file, T(\"%\"TS\"%\"TS),\n\t\t\t fs_source_path, wimboot_cfgfile);\n\t\tif (!tstat(tmp_config_file, &st)) {\n\t\t\tconfig_file = tmp_config_file;\n\t\t\tadd_flags &= ~WIMLIB_ADD_FLAG_WINCONFIG;\n\t\t} else {\n\t\t\tWARNING(\"\\\"%\"TS\"\\\" does not exist.\\n\"\n\t\t\t\t\"          Using default capture configuration!\",\n\t\t\t\ttmp_config_file);\n\t\t}\n\t}\n\n\tif (add_flags & WIMLIB_ADD_FLAG_WINCONFIG) {\n\t\t/* Use Windows default.  */\n\t\tif (config_file)\n\t\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t\tret = read_capture_config(T(\"wincfg\"), wincfg,\n\t\t\t\t\t  sizeof(wincfg) - 1, config);\n\t} else if (config_file) {\n\t\t/* Use the specified configuration file.  */\n\t\tret = read_capture_config(config_file, NULL, 0, config);\n\t} else {\n\t\t/* ... Or don't use any configuration file at all.  No files\n\t\t * will be excluded from capture, all files will be compressed,\n\t\t * etc.  */\n\t\tret = 0;\n\t}\n\tFREE(tmp_config_file);\n\treturn ret;\n}\n\nstatic int\nexecute_add_command(struct update_command_journal *j,\n\t\t    WIMStruct *wim,\n\t\t    const struct wimlib_update_command *add_cmd,\n\t\t    struct wim_inode_table *inode_table,\n\t\t    struct wim_sd_set *sd_set,\n\t\t    struct list_head *unhashed_blobs)\n{\n\tint ret;\n\tint add_flags;\n\ttchar *fs_source_path;\n\ttchar *wim_target_path;\n\tconst tchar *config_file;\n\tstruct scan_params params;\n\tstruct capture_config config;\n\tscan_tree_t scan_tree = platform_default_scan_tree;\n\tstruct wim_dentry *branch;\n\n\tadd_flags = add_cmd->add.add_flags;\n\tfs_source_path = add_cmd->add.fs_source_path;\n\twim_target_path = add_cmd->add.wim_target_path;\n\tconfig_file = add_cmd->add.config_file;\n\n\tmemset(&params, 0, sizeof(params));\n\n#ifdef WITH_NTFS_3G\n\tif (add_flags & WIMLIB_ADD_FLAG_NTFS)\n\t\tscan_tree = ntfs_3g_build_dentry_tree;\n#endif\n\n#ifdef ENABLE_TEST_SUPPORT\n\tif (add_flags & WIMLIB_ADD_FLAG_GENERATE_TEST_DATA)\n\t\tscan_tree = generate_dentry_tree;\n#endif\n\n\tret = get_capture_config(config_file, &config,\n\t\t\t\t add_flags, fs_source_path);\n\tif (ret)\n\t\tgoto out;\n\n\tparams.blob_table = wim->blob_table;\n\tparams.unhashed_blobs = unhashed_blobs;\n\tparams.inode_table = inode_table;\n\tparams.sd_set = sd_set;\n\tparams.config = &config;\n\tparams.add_flags = add_flags;\n\n\tparams.progfunc = wim->progfunc;\n\tparams.progctx = wim->progctx;\n\tparams.progress.scan.source = fs_source_path;\n\tparams.progress.scan.wim_target_path = wim_target_path;\n\tret = call_progress(params.progfunc, WIMLIB_PROGRESS_MSG_SCAN_BEGIN,\n\t\t\t    &params.progress, params.progctx);\n\tif (ret)\n\t\tgoto out_destroy_config;\n\n\tif (WIMLIB_IS_WIM_ROOT_PATH(wim_target_path))\n\t\tparams.add_flags |= WIMLIB_ADD_FLAG_ROOT;\n\tret = (*scan_tree)(&branch, fs_source_path, &params);\n\tif (ret)\n\t\tgoto out_destroy_config;\n\n\tret = call_progress(params.progfunc, WIMLIB_PROGRESS_MSG_SCAN_END,\n\t\t\t    &params.progress, params.progctx);\n\tif (ret) {\n\t\tfree_dentry_tree(branch, wim->blob_table);\n\t\tgoto out_destroy_config;\n\t}\n\n\tif (WIMLIB_IS_WIM_ROOT_PATH(wim_target_path) &&\n\t    branch && !dentry_is_directory(branch))\n\t{\n\t\tERROR(\"\\\"%\"TS\"\\\" is not a directory!\", fs_source_path);\n\t\tret = WIMLIB_ERR_NOTDIR;\n\t\tfree_dentry_tree(branch, wim->blob_table);\n\t\tgoto out_destroy_config;\n\t}\n\n\tret = attach_branch(branch, wim_target_path, j,\n\t\t\t    add_flags, params.progfunc, params.progctx);\n\tif (ret)\n\t\tgoto out_destroy_config;\n\n\tif (config_file && (add_flags & WIMLIB_ADD_FLAG_WIMBOOT) &&\n\t    WIMLIB_IS_WIM_ROOT_PATH(wim_target_path))\n\t{\n\t\tparams.add_flags = 0;\n\t\tparams.progfunc = NULL;\n\t\tparams.config = NULL;\n\n\t\t/* If a capture configuration file was explicitly specified when\n\t\t * capturing an image in WIMBoot mode, save it as\n\t\t * /Windows/System32/WimBootCompress.ini in the WIM image. */\n\t\tret = platform_default_scan_tree(&branch, config_file, &params);\n\t\tif (ret)\n\t\t\tgoto out_destroy_config;\n\n\t\tret = attach_branch(branch, wimboot_cfgfile, j, 0, NULL, NULL);\n\t\tif (ret)\n\t\t\tgoto out_destroy_config;\n\t}\n\n\tif (WIMLIB_IS_WIM_ROOT_PATH(wim_target_path)) {\n\t\tret = set_windows_specific_info(wim);\n\t\tif (ret)\n\t\t\tgoto out_destroy_config;\n\t}\n\n\tret = 0;\nout_destroy_config:\n\tdestroy_capture_config(&config);\nout:\n\tFREE(params.cur_path);\n\treturn ret;\n}\n\nstatic int\nexecute_delete_command(struct update_command_journal *j,\n\t\t       WIMStruct *wim,\n\t\t       const struct wimlib_update_command *delete_cmd)\n{\n\tint flags;\n\tconst tchar *wim_path;\n\tstruct wim_dentry *tree;\n\n\tflags = delete_cmd->delete_.delete_flags;\n\twim_path = delete_cmd->delete_.wim_path;\n\n\ttree = get_dentry(wim, wim_path, WIMLIB_CASE_PLATFORM_DEFAULT);\n\tif (!tree) {\n\t\t/* Path to delete does not exist in the WIM. */\n\t\tif (flags & WIMLIB_DELETE_FLAG_FORCE) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tERROR(\"Path \\\"%\"TS\"\\\" does not exist in WIM image %d\",\n\t\t\t      wim_path, wim->current_image);\n\t\t\treturn WIMLIB_ERR_PATH_DOES_NOT_EXIST;\n\t\t}\n\t}\n\n\tif (dentry_is_directory(tree) && !(flags & WIMLIB_DELETE_FLAG_RECURSIVE)) {\n\t\tERROR(\"Path \\\"%\"TS\"\\\" in WIM image %d is a directory \"\n\t\t      \"but a recursive delete was not requested\",\n\t\t      wim_path, wim->current_image);\n\t\treturn WIMLIB_ERR_IS_DIRECTORY;\n\t}\n\n\treturn journaled_unlink(j, tree);\n}\n\nstatic int\nfree_dentry_full_path(struct wim_dentry *dentry, void *_ignore)\n{\n\tFREE(dentry->d_full_path);\n\tdentry->d_full_path = NULL;\n\treturn 0;\n}\n\n/* Is @d1 a (possibly nonproper) ancestor of @d2?  */\nstatic bool\nis_ancestor(const struct wim_dentry *d1, const struct wim_dentry *d2)\n{\n\tfor (;;) {\n\t\tif (d2 == d1)\n\t\t\treturn true;\n\t\tif (dentry_is_root(d2))\n\t\t\treturn false;\n\t\td2 = d2->d_parent;\n\t}\n}\n\n/* Rename a file or directory in the WIM.\n *\n * This returns a -errno value.\n *\n * The journal @j is optional.\n */\nint\nrename_wim_path(WIMStruct *wim, const tchar *from, const tchar *to,\n\t\tCASE_SENSITIVITY_TYPE case_type, bool noreplace,\n\t\tstruct update_command_journal *j)\n{\n\tstruct wim_dentry *src;\n\tstruct wim_dentry *dst;\n\tstruct wim_dentry *parent_of_dst;\n\tint ret;\n\n\t/* This rename() implementation currently only supports actual files\n\t * (not alternate data streams) */\n\n\tsrc = get_dentry(wim, from, case_type);\n\tif (!src)\n\t\treturn -errno;\n\n\tdst = get_dentry(wim, to, case_type);\n\n\tif (dst) {\n\t\t/* Destination file exists */\n\n\t\tif (noreplace)\n\t\t\treturn -EEXIST;\n\n\t\tif (src == dst) /* Same file */\n\t\t\treturn 0;\n\n\t\tif (!dentry_is_directory(src)) {\n\t\t\t/* Cannot rename non-directory to directory. */\n\t\t\tif (dentry_is_directory(dst))\n\t\t\t\treturn -EISDIR;\n\t\t} else {\n\t\t\t/* Cannot rename directory to a non-directory or a non-empty\n\t\t\t * directory */\n\t\t\tif (!dentry_is_directory(dst))\n\t\t\t\treturn -ENOTDIR;\n\t\t\tif (dentry_has_children(dst))\n\t\t\t\treturn -ENOTEMPTY;\n\t\t}\n\t\tparent_of_dst = dst->d_parent;\n\t} else {\n\t\t/* Destination does not exist */\n\t\tparent_of_dst = get_parent_dentry(wim, to, case_type);\n\t\tif (!parent_of_dst)\n\t\t\treturn -errno;\n\n\t\tif (!dentry_is_directory(parent_of_dst))\n\t\t\treturn -ENOTDIR;\n\t}\n\n\t/* @src can't be an ancestor of @dst.  Otherwise we're unlinking @src\n\t * from the tree and creating a loop...  */\n\tif (is_ancestor(src, parent_of_dst))\n\t\treturn -EBUSY;\n\n\tif (j) {\n\t\tif (dst)\n\t\t\tif (journaled_unlink(j, dst))\n\t\t\t\treturn -ENOMEM;\n\t\tif (journaled_unlink(j, src))\n\t\t\treturn -ENOMEM;\n\t\tif (journaled_change_name(j, src, path_basename(to)))\n\t\t\treturn -ENOMEM;\n\t\tif (journaled_link(j, src, parent_of_dst))\n\t\t\treturn -ENOMEM;\n\t} else {\n\t\tret = dentry_set_name(src, path_basename(to));\n\t\tif (ret)\n\t\t\treturn -ENOMEM;\n\t\tif (dst) {\n\t\t\tunlink_dentry(dst);\n\t\t\tfree_dentry_tree(dst, wim->blob_table);\n\t\t}\n\t\tunlink_dentry(src);\n\t\tdentry_add_child(parent_of_dst, src);\n\t}\n\tif (src->d_full_path)\n\t\tfor_dentry_in_tree(src, free_dentry_full_path, NULL);\n\treturn 0;\n}\n\n\nstatic int\nexecute_rename_command(struct update_command_journal *j,\n\t\t       WIMStruct *wim,\n\t\t       const struct wimlib_update_command *rename_cmd)\n{\n\tint ret;\n\n\tret = rename_wim_path(wim, rename_cmd->rename.wim_source_path,\n\t\t\t      rename_cmd->rename.wim_target_path,\n\t\t\t      WIMLIB_CASE_PLATFORM_DEFAULT, false, j);\n\tif (ret) {\n\t\tret = -ret;\n\t\terrno = ret;\n\t\tERROR_WITH_ERRNO(\"Can't rename \\\"%\"TS\"\\\" to \\\"%\"TS\"\\\"\",\n\t\t\t\t rename_cmd->rename.wim_source_path,\n\t\t\t\t rename_cmd->rename.wim_target_path);\n\t\tswitch (ret) {\n\t\tcase ENOMEM:\n\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\tbreak;\n\t\tcase ENOTDIR:\n\t\t\tret = WIMLIB_ERR_NOTDIR;\n\t\t\tbreak;\n\t\tcase ENOTEMPTY:\n\t\tcase EBUSY:\n\t\t\t/* XXX: EBUSY is returned when the rename would create a\n\t\t\t * loop.  It maybe should have its own error code.  */\n\t\t\tret = WIMLIB_ERR_NOTEMPTY;\n\t\t\tbreak;\n\t\tcase EISDIR:\n\t\t\tret = WIMLIB_ERR_IS_DIRECTORY;\n\t\t\tbreak;\n\t\tcase ENOENT:\n\t\tdefault:\n\t\t\tret = WIMLIB_ERR_PATH_DOES_NOT_EXIST;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ret;\n}\n\nstatic bool\nhave_command_type(const struct wimlib_update_command *cmds, size_t num_cmds,\n\t\t  enum wimlib_update_op op)\n{\n\tfor (size_t i = 0; i < num_cmds; i++)\n\t\tif (cmds[i].op == op)\n\t\t\treturn true;\n\treturn false;\n}\n\nstatic int\nexecute_update_commands(WIMStruct *wim,\n\t\t\tconst struct wimlib_update_command *cmds,\n\t\t\tsize_t num_cmds,\n\t\t\tint update_flags)\n{\n\tstruct wim_inode_table *inode_table;\n\tstruct wim_sd_set *sd_set;\n\tstruct list_head unhashed_blobs;\n\tstruct update_command_journal *j;\n\tunion wimlib_progress_info info;\n\tint ret;\n\n\tif (have_command_type(cmds, num_cmds, WIMLIB_UPDATE_OP_ADD)) {\n\t\t/* If we have at least one \"add\" command, create the inode and\n\t\t * security descriptor tables to index new inodes and new\n\t\t * security descriptors, respectively.  */\n\t\tinode_table = alloca(sizeof(struct wim_inode_table));\n\t\tsd_set = alloca(sizeof(struct wim_sd_set));\n\n\t\tret = init_inode_table(inode_table, 64);\n\t\tif (ret)\n\t\t\tgoto out;\n\n\t\tret = init_sd_set(sd_set, wim_get_current_security_data(wim));\n\t\tif (ret)\n\t\t\tgoto out_destroy_inode_table;\n\n\t\tINIT_LIST_HEAD(&unhashed_blobs);\n\t} else {\n\t\tinode_table = NULL;\n\t\tsd_set = NULL;\n\t}\n\n\t/* Start an in-memory journal to allow rollback if something goes wrong\n\t */\n\tj = new_update_command_journal(num_cmds,\n\t\t\t\t       &wim_get_current_image_metadata(wim)->root_dentry,\n\t\t\t\t       wim->blob_table);\n\tif (!j) {\n\t\tret = WIMLIB_ERR_NOMEM;\n\t\tgoto out_destroy_sd_set;\n\t}\n\n\tinfo.update.completed_commands = 0;\n\tinfo.update.total_commands = num_cmds;\n\tret = 0;\n\tfor (size_t i = 0; i < num_cmds; i++) {\n\t\tinfo.update.command = &cmds[i];\n\t\tif (update_flags & WIMLIB_UPDATE_FLAG_SEND_PROGRESS) {\n\t\t\tret = call_progress(wim->progfunc,\n\t\t\t\t\t    WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND,\n\t\t\t\t\t    &info, wim->progctx);\n\t\t\tif (ret)\n\t\t\t\tgoto rollback;\n\t\t}\n\n\t\tswitch (cmds[i].op) {\n\t\tcase WIMLIB_UPDATE_OP_ADD:\n\t\t\tret = execute_add_command(j, wim, &cmds[i], inode_table,\n\t\t\t\t\t\t  sd_set, &unhashed_blobs);\n\t\t\tbreak;\n\t\tcase WIMLIB_UPDATE_OP_DELETE:\n\t\t\tret = execute_delete_command(j, wim, &cmds[i]);\n\t\t\tbreak;\n\t\tcase WIMLIB_UPDATE_OP_RENAME:\n\t\t\tret = execute_rename_command(j, wim, &cmds[i]);\n\t\t\tbreak;\n\t\t}\n\t\tif (unlikely(ret))\n\t\t\tgoto rollback;\n\t\tinfo.update.completed_commands++;\n\t\tif (update_flags & WIMLIB_UPDATE_FLAG_SEND_PROGRESS) {\n\t\t\tret = call_progress(wim->progfunc,\n\t\t\t\t\t    WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND,\n\t\t\t\t\t    &info, wim->progctx);\n\t\t\tif (ret)\n\t\t\t\tgoto rollback;\n\t\t}\n\t\tnext_command(j);\n\t}\n\n\tcommit_update(j);\n\tif (inode_table) {\n\t\tstruct wim_image_metadata *imd;\n\n\t\timd = wim_get_current_image_metadata(wim);\n\n\t\tlist_splice_tail(&unhashed_blobs, &imd->unhashed_blobs);\n\t\tinode_table_prepare_inode_list(inode_table, &imd->inode_list);\n\t}\n\tgoto out_destroy_sd_set;\n\nrollback:\n\tif (sd_set)\n\t\trollback_new_security_descriptors(sd_set);\n\trollback_update(j);\nout_destroy_sd_set:\n\tif (sd_set)\n\t\tdestroy_sd_set(sd_set);\nout_destroy_inode_table:\n\tif (inode_table)\n\t\tdestroy_inode_table(inode_table);\nout:\n\treturn ret;\n}\n\n\nstatic int\ncheck_add_command(struct wimlib_update_command *cmd,\n\t\t  const struct wim_header *hdr)\n{\n\tint add_flags = cmd->add.add_flags;\n\n\tif (add_flags & ~(WIMLIB_ADD_FLAG_NTFS |\n\t\t\t  WIMLIB_ADD_FLAG_DEREFERENCE |\n\t\t\t  WIMLIB_ADD_FLAG_VERBOSE |\n\t\t\t  /* BOOT doesn't make sense for wimlib_update_image().  */\n\t\t\t  /*WIMLIB_ADD_FLAG_BOOT |*/\n\t\t\t  WIMLIB_ADD_FLAG_UNIX_DATA |\n\t\t\t  WIMLIB_ADD_FLAG_NO_ACLS |\n\t\t\t  WIMLIB_ADD_FLAG_STRICT_ACLS |\n\t\t\t  WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE |\n\t\t\t  WIMLIB_ADD_FLAG_RPFIX |\n\t\t\t  WIMLIB_ADD_FLAG_NORPFIX |\n\t\t\t  WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE |\n\t\t\t  WIMLIB_ADD_FLAG_WINCONFIG |\n\t\t\t  WIMLIB_ADD_FLAG_WIMBOOT |\n\t\t\t  WIMLIB_ADD_FLAG_NO_REPLACE |\n\t\t\t  WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION |\n\t\t\t  WIMLIB_ADD_FLAG_SNAPSHOT |\n\t\t#ifdef ENABLE_TEST_SUPPORT\n\t\t\t  WIMLIB_ADD_FLAG_GENERATE_TEST_DATA |\n\t\t#endif\n\t\t\t  WIMLIB_ADD_FLAG_FILE_PATHS_UNNEEDED))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tbool is_entire_image = WIMLIB_IS_WIM_ROOT_PATH(cmd->add.wim_target_path);\n\n#ifndef WITH_NTFS_3G\n\tif (add_flags & WIMLIB_ADD_FLAG_NTFS) {\n\t\tERROR(\"NTFS-3G capture mode is unsupported because wimlib \"\n\t\t      \"was compiled --without-ntfs-3g\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n#endif\n\n#ifdef _WIN32\n\t/* Check for flags not supported on Windows.  */\n\tif (add_flags & WIMLIB_ADD_FLAG_UNIX_DATA) {\n\t\tERROR(\"Capturing UNIX-specific data is not supported on Windows\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n\tif (add_flags & WIMLIB_ADD_FLAG_DEREFERENCE) {\n\t\tERROR(\"Dereferencing symbolic links is not supported on Windows\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n#else\n\t/* Check for flags only supported on Windows.  */\n\n\t/* Currently, SNAPSHOT means Windows VSS.  In the future, it perhaps\n\t * could be implemented for other types of snapshots, such as btrfs.  */\n\tif (add_flags & WIMLIB_ADD_FLAG_SNAPSHOT) {\n\t\tERROR(\"Snapshot mode is only supported on Windows, where it uses VSS.\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n#endif\n\n\t/* VERBOSE implies EXCLUDE_VERBOSE */\n\tif (add_flags & WIMLIB_ADD_FLAG_VERBOSE)\n\t\tadd_flags |= WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE;\n\n\t/* Check for contradictory reparse point fixup flags */\n\tif ((add_flags & (WIMLIB_ADD_FLAG_RPFIX |\n\t\t\t  WIMLIB_ADD_FLAG_NORPFIX)) ==\n\t\t(WIMLIB_ADD_FLAG_RPFIX |\n\t\t WIMLIB_ADD_FLAG_NORPFIX))\n\t{\n\t\tERROR(\"Cannot specify RPFIX and NORPFIX flags \"\n\t\t      \"at the same time!\");\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t}\n\n\t/* Set default behavior on reparse point fixups if requested */\n\tif ((add_flags & (WIMLIB_ADD_FLAG_RPFIX |\n\t\t\t  WIMLIB_ADD_FLAG_NORPFIX)) == 0)\n\t{\n\t\t/* Do reparse-point fixups by default if we are capturing an\n\t\t * entire image and either the header flag is set from previous\n\t\t * images, or if this is the first image being added. */\n\t\tif (is_entire_image &&\n\t\t    ((hdr->flags & WIM_HDR_FLAG_RP_FIX) || hdr->image_count == 1))\n\t\t\tadd_flags |= WIMLIB_ADD_FLAG_RPFIX;\n\t}\n\n\tif (!is_entire_image) {\n\t\tif (add_flags & WIMLIB_ADD_FLAG_RPFIX) {\n\t\t\tERROR(\"Cannot do reparse point fixups when \"\n\t\t\t      \"not capturing a full image!\");\n\t\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t\t}\n\t}\n\t/* We may have modified the add flags. */\n\tcmd->add.add_flags = add_flags;\n\treturn 0;\n}\n\nstatic int\ncheck_delete_command(const struct wimlib_update_command *cmd)\n{\n\tif (cmd->delete_.delete_flags & ~(WIMLIB_DELETE_FLAG_FORCE |\n\t\t\t\t\t  WIMLIB_DELETE_FLAG_RECURSIVE))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\treturn 0;\n}\n\nstatic int\ncheck_rename_command(const struct wimlib_update_command *cmd)\n{\n\tif (cmd->rename.rename_flags != 0)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\treturn 0;\n}\n\nstatic int\ncheck_update_command(struct wimlib_update_command *cmd,\n\t\t     const struct wim_header *hdr)\n{\n\tswitch (cmd->op) {\n\tcase WIMLIB_UPDATE_OP_ADD:\n\t\treturn check_add_command(cmd, hdr);\n\tcase WIMLIB_UPDATE_OP_DELETE:\n\t\treturn check_delete_command(cmd);\n\tcase WIMLIB_UPDATE_OP_RENAME:\n\t\treturn check_rename_command(cmd);\n\t}\n\treturn 0;\n}\n\nstatic int\ncheck_update_commands(struct wimlib_update_command *cmds, size_t num_cmds,\n\t\t      const struct wim_header *hdr)\n{\n\tint ret = 0;\n\tfor (size_t i = 0; i < num_cmds; i++) {\n\t\tret = check_update_command(&cmds[i], hdr);\n\t\tif (ret)\n\t\t\tbreak;\n\t}\n\treturn ret;\n}\n\n\nstatic void\nfree_update_commands(struct wimlib_update_command *cmds, size_t num_cmds)\n{\n\tif (cmds) {\n\t\tfor (size_t i = 0; i < num_cmds; i++) {\n\t\t\tswitch (cmds[i].op) {\n\t\t\tcase WIMLIB_UPDATE_OP_ADD:\n\t\t\t\tFREE(cmds[i].add.wim_target_path);\n\t\t\t\tbreak;\n\t\t\tcase WIMLIB_UPDATE_OP_DELETE:\n\t\t\t\tFREE(cmds[i].delete_.wim_path);\n\t\t\t\tbreak;\n\t\t\tcase WIMLIB_UPDATE_OP_RENAME:\n\t\t\t\tFREE(cmds[i].rename.wim_source_path);\n\t\t\t\tFREE(cmds[i].rename.wim_target_path);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tFREE(cmds);\n\t}\n}\n\nstatic int\ncopy_update_commands(const struct wimlib_update_command *cmds,\n\t\t     size_t num_cmds,\n\t\t     struct wimlib_update_command **cmds_copy_ret)\n{\n\tint ret;\n\tstruct wimlib_update_command *cmds_copy;\n\n\tcmds_copy = CALLOC(num_cmds, sizeof(cmds[0]));\n\tif (!cmds_copy)\n\t\tgoto oom;\n\n\tfor (size_t i = 0; i < num_cmds; i++) {\n\t\tcmds_copy[i].op = cmds[i].op;\n\t\tswitch (cmds[i].op) {\n\t\tcase WIMLIB_UPDATE_OP_ADD:\n\t\t\tcmds_copy[i].add.fs_source_path = cmds[i].add.fs_source_path;\n\t\t\tcmds_copy[i].add.wim_target_path =\n\t\t\t\tcanonicalize_wim_path(cmds[i].add.wim_target_path);\n\t\t\tif (!cmds_copy[i].add.wim_target_path)\n\t\t\t\tgoto oom;\n\t\t\tcmds_copy[i].add.config_file = cmds[i].add.config_file;\n\t\t\tcmds_copy[i].add.add_flags = cmds[i].add.add_flags;\n\t\t\tbreak;\n\t\tcase WIMLIB_UPDATE_OP_DELETE:\n\t\t\tcmds_copy[i].delete_.wim_path =\n\t\t\t\tcanonicalize_wim_path(cmds[i].delete_.wim_path);\n\t\t\tif (!cmds_copy[i].delete_.wim_path)\n\t\t\t\tgoto oom;\n\t\t\tcmds_copy[i].delete_.delete_flags = cmds[i].delete_.delete_flags;\n\t\t\tbreak;\n\t\tcase WIMLIB_UPDATE_OP_RENAME:\n\t\t\tcmds_copy[i].rename.wim_source_path =\n\t\t\t\tcanonicalize_wim_path(cmds[i].rename.wim_source_path);\n\t\t\tcmds_copy[i].rename.wim_target_path =\n\t\t\t\tcanonicalize_wim_path(cmds[i].rename.wim_target_path);\n\t\t\tif (!cmds_copy[i].rename.wim_source_path ||\n\t\t\t    !cmds_copy[i].rename.wim_target_path)\n\t\t\t\tgoto oom;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tERROR(\"Unknown update operation %u\", cmds[i].op);\n\t\t\tret = WIMLIB_ERR_INVALID_PARAM;\n\t\t\tgoto err;\n\t\t}\n\t}\n\t*cmds_copy_ret = cmds_copy;\n\tret = 0;\nout:\n\treturn ret;\noom:\n\tret = WIMLIB_ERR_NOMEM;\nerr:\n\tfree_update_commands(cmds_copy, num_cmds);\n\tgoto out;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_update_image(WIMStruct *wim,\n\t\t    int image,\n\t\t    const struct wimlib_update_command *cmds,\n\t\t    size_t num_cmds,\n\t\t    int update_flags)\n{\n\tint ret;\n\tstruct wim_image_metadata *imd;\n\tstruct wimlib_update_command *cmds_copy;\n\n\tif (update_flags & ~WIMLIB_UPDATE_FLAG_SEND_PROGRESS)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\t/* Load the metadata for the image to modify (if not loaded already) */\n\tret = select_wim_image(wim, image);\n\tif (ret)\n\t\treturn ret;\n\n\timd = wim->image_metadata[image - 1];\n\n\t/* Don't allow updating an image currently being shared by multiple\n\t * WIMStructs (as a result of an export)  */\n\tif (imd->refcnt > 1)\n\t\treturn WIMLIB_ERR_IMAGE_HAS_MULTIPLE_REFERENCES;\n\n\t/* Make a copy of the update commands, in the process doing certain\n\t * canonicalizations on paths (e.g. translating backslashes to forward\n\t * slashes).  This is done to avoid modifying the caller's copy of the\n\t * commands. */\n\tret = copy_update_commands(cmds, num_cmds, &cmds_copy);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Perform additional checks on the update commands before we execute\n\t * them. */\n\tret = check_update_commands(cmds_copy, num_cmds, &wim->hdr);\n\tif (ret)\n\t\tgoto out_free_cmds_copy;\n\n\t/* Actually execute the update commands. */\n\tret = execute_update_commands(wim, cmds_copy, num_cmds, update_flags);\n\tif (ret)\n\t\tgoto out_free_cmds_copy;\n\n\tmark_image_dirty(imd);\n\n\tfor (size_t i = 0; i < num_cmds; i++)\n\t\tif (cmds_copy[i].op == WIMLIB_UPDATE_OP_ADD &&\n\t\t    cmds_copy[i].add.add_flags & WIMLIB_ADD_FLAG_RPFIX)\n\t\t\twim->hdr.flags |= WIM_HDR_FLAG_RP_FIX;\nout_free_cmds_copy:\n\tfree_update_commands(cmds_copy, num_cmds);\n\treturn ret;\n}\n\nWIMLIBAPI int\nwimlib_delete_path(WIMStruct *wim, int image,\n\t\t   const tchar *path, int delete_flags)\n{\n\tstruct wimlib_update_command cmd;\n\n\tcmd.op = WIMLIB_UPDATE_OP_DELETE;\n\tcmd.delete_.wim_path = (tchar *)path;\n\tcmd.delete_.delete_flags = delete_flags;\n\n\treturn wimlib_update_image(wim, image, &cmd, 1, 0);\n}\n\nWIMLIBAPI int\nwimlib_rename_path(WIMStruct *wim, int image,\n\t\t   const tchar *source_path, const tchar *dest_path)\n{\n\tstruct wimlib_update_command cmd;\n\n\tcmd.op = WIMLIB_UPDATE_OP_RENAME;\n\tcmd.rename.wim_source_path = (tchar *)source_path;\n\tcmd.rename.wim_target_path = (tchar *)dest_path;\n\tcmd.rename.rename_flags = 0;\n\n\treturn wimlib_update_image(wim, image, &cmd, 1, 0);\n}\n\nWIMLIBAPI int\nwimlib_add_tree(WIMStruct *wim, int image,\n\t\tconst tchar *fs_source_path, const tchar *wim_target_path,\n\t\tint add_flags)\n{\n\tstruct wimlib_update_command cmd;\n\n\tcmd.op = WIMLIB_UPDATE_OP_ADD;\n\tcmd.add.fs_source_path = (tchar *)fs_source_path;\n\tcmd.add.wim_target_path = (tchar *)wim_target_path;\n\tcmd.add.add_flags = add_flags;\n\tcmd.add.config_file = NULL;\n\n\treturn wimlib_update_image(wim, image, &cmd, 1, 0);\n}\n"
  },
  {
    "path": "src/wimlib/util.c",
    "content": "/*\n * util.c - utility functions\n */\n\n/*\n * Copyright 2012-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n#include <fcntl.h>\n#include <limits.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#ifdef HAVE_SYS_SYSCTL_H\n#  include <sys/types.h>\n#  include <sys/sysctl.h>\n#endif\n#ifdef HAVE_SYS_SYSCALL_H\n#  include <sys/syscall.h>\n#endif\n#ifdef HAVE_UNISTD_H\n#  include <unistd.h>\n#endif\n\n#include \"wimlib.h\"\n#include \"wimlib/assert.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/timestamp.h\"\n#include \"wimlib/util.h\"\n\n/*******************\n * Memory allocation\n *******************/\n\nstatic void *(*wimlib_malloc_func) (size_t)\t    = malloc;\nstatic void  (*wimlib_free_func)   (void *)\t    = free;\nstatic void *(*wimlib_realloc_func)(void *, size_t) = realloc;\n\nvoid *\nwimlib_malloc(size_t size)\n{\n\tvoid *ptr;\n\nretry:\n\tptr = (*wimlib_malloc_func)(size);\n\tif (unlikely(!ptr)) {\n\t\tif (size == 0) {\n\t\t\tsize = 1;\n\t\t\tgoto retry;\n\t\t}\n\t}\n\treturn ptr;\n}\n\nvoid\nwimlib_free_memory(void *ptr)\n{\n\t(*wimlib_free_func)(ptr);\n}\n\nvoid *\nwimlib_realloc(void *ptr, size_t size)\n{\n\tif (size == 0)\n\t\tsize = 1;\n\treturn (*wimlib_realloc_func)(ptr, size);\n}\n\nvoid *\nwimlib_calloc(size_t nmemb, size_t size)\n{\n\tsize_t total_size = nmemb * size;\n\tvoid *p;\n\n\tif (size != 0 && nmemb > SIZE_MAX / size) {\n\t\terrno = ENOMEM;\n\t\treturn NULL;\n\t}\n\n\tp = MALLOC(total_size);\n\tif (p)\n\t\tp = memset(p, 0, total_size);\n\treturn p;\n}\n\nchar *\nwimlib_strdup(const char *str)\n{\n\treturn memdup(str, strlen(str) + 1);\n}\n\n#ifdef _WIN32\nwchar_t *\nwimlib_wcsdup(const wchar_t *str)\n{\n\treturn memdup(str, (wcslen(str) + 1) * sizeof(wchar_t));\n}\n#endif\n\nvoid *\nwimlib_aligned_malloc(size_t size, size_t alignment)\n{\n\twimlib_assert(is_power_of_2(alignment));\n\n\tvoid *ptr = MALLOC(sizeof(void *) + alignment - 1 + size);\n\tif (ptr) {\n\t\tvoid *orig_ptr = ptr;\n\t\tptr = (void *)ALIGN((uintptr_t)ptr + sizeof(void *), alignment);\n\t\t((void **)ptr)[-1] = orig_ptr;\n\t}\n\treturn ptr;\n}\n\nvoid\nwimlib_aligned_free(void *ptr)\n{\n\tif (ptr)\n\t\tFREE(((void **)ptr)[-1]);\n}\n\nvoid *\nmemdup(const void *mem, size_t size)\n{\n\tvoid *ptr = MALLOC(size);\n\tif (ptr)\n\t\tptr = memcpy(ptr, mem, size);\n\treturn ptr;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_set_memory_allocator(void *(*malloc_func)(size_t),\n\t\t\t    void (*free_func)(void *),\n\t\t\t    void *(*realloc_func)(void *, size_t))\n{\n\twimlib_malloc_func  = malloc_func  ? malloc_func  : malloc;\n\twimlib_free_func    = free_func    ? free_func    : free;\n\twimlib_realloc_func = realloc_func ? realloc_func : realloc;\n\treturn 0;\n}\n\n/*******************\n * String utilities\n *******************/\n\n#ifndef HAVE_MEMPCPY\nvoid *mempcpy(void *dst, const void *src, size_t n)\n{\n\tvoid* ret = memcpy(dst, src, n);\n\treturn ret != NULL ? _PTR(ret + n) : NULL;\n}\n#endif\n\n/**************************\n * Random number generation\n **************************/\n\n#ifndef _WIN32\n/*\n * Generate @n cryptographically secure random bytes (thread-safe)\n *\n * This is the UNIX version.  It uses the Linux getrandom() system call if\n * available; otherwise, it falls back to reading from /dev/urandom.\n */\nvoid\nget_random_bytes(void *p, size_t n)\n{\n\tif (n == 0)\n\t\treturn;\n#ifdef __NR_getrandom\n\tstatic bool getrandom_unavailable;\n\n\tif (getrandom_unavailable)\n\t\tgoto try_dev_urandom;\n\tdo {\n\t\tint res = syscall(__NR_getrandom, p, n, 0);\n\t\tif (unlikely(res < 0)) {\n\t\t\tif (errno == ENOSYS) {\n\t\t\t\tgetrandom_unavailable = true;\n\t\t\t\tgoto try_dev_urandom;\n\t\t\t}\n\t\t\tif (errno == EINTR)\n\t\t\t\tcontinue;\n\t\t\tERROR_WITH_ERRNO(\"getrandom() failed\");\n\t\t\twimlib_assert(0);\n\t\t\tres = 0;\n\t\t}\n\t\tp += res;\n\t\tn -= res;\n\t} while (n != 0);\n\treturn;\n\ntry_dev_urandom:\n\t;\n#endif /* __NR_getrandom */\n\tint fd = open(\"/dev/urandom\", O_RDONLY);\n\tif (fd < 0) {\n\t\tERROR_WITH_ERRNO(\"Unable to open /dev/urandom\");\n\t\twimlib_assert(0);\n\t}\n\tdo {\n\t\tint res = read(fd, p, min(n, INT_MAX));\n\t\tif (unlikely(res < 0)) {\n\t\t\tif (errno == EINTR)\n\t\t\t\tcontinue;\n\t\t\tERROR_WITH_ERRNO(\"Error reading from /dev/urandom\");\n\t\t\twimlib_assert(0);\n\t\t\tres = 0;\n\t\t}\n\t\tp += res;\n\t\tn -= res;\n\t} while (n != 0);\n\tclose(fd);\n}\n#endif /* !_WIN32 */\n\n/*\n * Generate @n cryptographically secure random alphanumeric characters\n * (thread-safe)\n *\n * This is implemented on top of get_random_bytes().  For efficiency the calls\n * to get_random_bytes() are batched.\n */\nvoid\nget_random_alnum_chars(tchar *p, size_t n)\n{\n\tu32 r[64];\n\tint r_idx = 0;\n\tint r_end = 0;\n\n\tfor (; n != 0; p++, n--) {\n\t\ttchar x;\n\n\t\tif (r_idx >= r_end) {\n\t\t\tr_idx = 0;\n\t\t\tr_end = min(n, ARRAY_LEN(r));\n\t\t\tget_random_bytes(r, r_end * sizeof(r[0]));\n\t\t}\n\n\t\tSTATIC_ASSERT(sizeof(r[0]) == sizeof(u32));\n\t\twhile (unlikely(r[r_idx] >= UINT32_MAX - (UINT32_MAX % 62)))\n\t\t\tget_random_bytes(&r[r_idx], sizeof(r[0]));\n\n\t\tx = r[r_idx++] % 62;\n\n\t\tif (x < 26)\n\t\t\t*p = 'a' + x;\n\t\telse if (x < 52)\n\t\t\t*p = 'A' + x - 26;\n\t\telse\n\t\t\t*p = '0' + x - 52;\n\t}\n}\n\n/************************\n * System information\n ************************/\n\n#ifndef _WIN32\nunsigned\nget_available_cpus(void)\n{\n\tlong n = sysconf(_SC_NPROCESSORS_ONLN);\n\tif (n < 1 || n >= UINT_MAX) {\n\t\tWARNING(\"Failed to determine number of processors; assuming 1.\");\n\t\treturn 1;\n\t}\n\treturn n;\n}\n#endif /* !_WIN32 */\n\n#ifndef _WIN32\nu64\nget_available_memory(void)\n{\n#if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)\n\tlong page_size = sysconf(_SC_PAGESIZE);\n\tlong num_pages = sysconf(_SC_PHYS_PAGES);\n\tif (page_size <= 0 || num_pages <= 0)\n\t\tgoto default_size;\n\treturn ((u64)page_size * (u64)num_pages);\n#else\n\tint mib[2] = {CTL_HW, HW_MEMSIZE};\n\tu64 memsize;\n\tsize_t len = sizeof(memsize);\n\tif (sysctl(mib, ARRAY_LEN(mib), &memsize, &len, NULL, 0) < 0 || len != 8)\n\t\tgoto default_size;\n\treturn memsize;\n#endif\n\ndefault_size:\n\tWARNING(\"Failed to determine available memory; assuming 1 GiB\");\n\treturn (u64)1 << 30;\n}\n#endif /* !_WIN32 */\n"
  },
  {
    "path": "src/wimlib/wim.c",
    "content": "/*\n * wim.c - High-level code dealing with WIMStructs and images.\n */\n\n/*\n * Copyright 2012-2023 Eric Biggers\n * Copyright 2025 Pete Batard <pete@akeo.ie>\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n#include <fcntl.h>\n#include <stdlib.h>\n#include <sys/stat.h>\n#include <unistd.h>\n\n#include \"wimlib.h\"\n#include \"wimlib/assert.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/cpu_features.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/file_io.h\"\n#include \"wimlib/integrity.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/security.h\"\n#include \"wimlib/threads.h\"\n#include \"wimlib/wim.h\"\n#include \"wimlib/xml.h\"\n#include \"wimlib/win32.h\"\n\n/* Information about the available compression types for the WIM format.  */\nstatic const struct {\n\tconst tchar *name;\n\tu32 min_chunk_size;\n\tu32 max_chunk_size;\n\tu32 default_nonsolid_chunk_size;\n\tu32 default_solid_chunk_size;\n} wim_ctype_info[] = {\n\t[WIMLIB_COMPRESSION_TYPE_NONE] = {\n\t\t.name = T(\"None\"),\n\t\t.min_chunk_size = 0,\n\t\t.max_chunk_size = 0,\n\t\t.default_nonsolid_chunk_size = 0,\n\t\t.default_solid_chunk_size = 0,\n\t},\n\t[WIMLIB_COMPRESSION_TYPE_XPRESS] = {\n\t\t.name = T(\"XPRESS\"),\n\t\t.min_chunk_size = 4096,\n\t\t.max_chunk_size = 65536,\n\t\t.default_nonsolid_chunk_size = 32768,\n\t\t.default_solid_chunk_size = 32768,\n\t},\n\t[WIMLIB_COMPRESSION_TYPE_LZX] = {\n\t\t.name = T(\"LZX\"),\n\t\t.min_chunk_size = 32768,\n\t\t.max_chunk_size = 2097152,\n\t\t.default_nonsolid_chunk_size = 32768,\n\t\t.default_solid_chunk_size = 32768,\n\t},\n\t[WIMLIB_COMPRESSION_TYPE_LZMS] = {\n\t\t.name = T(\"LZMS\"),\n\t\t.min_chunk_size = 32768,\n\t\t.max_chunk_size = 1073741824,\n\t\t.default_nonsolid_chunk_size = 131072,\n\t\t.default_solid_chunk_size = 67108864,\n\t},\n};\n\n/* Is the specified compression type valid?  */\nstatic bool\nwim_compression_type_valid(enum wimlib_compression_type ctype)\n{\n\treturn (unsigned)ctype < ARRAY_LEN(wim_ctype_info) &&\n\t       wim_ctype_info[(unsigned)ctype].name != NULL;\n}\n\n/* Is the specified chunk size valid for the compression type?  */\nstatic bool\nwim_chunk_size_valid(u32 chunk_size, enum wimlib_compression_type ctype)\n{\n\tif (!(chunk_size == 0 || is_power_of_2(chunk_size)))\n\t\treturn false;\n\n\treturn chunk_size >= wim_ctype_info[(unsigned)ctype].min_chunk_size &&\n\t       chunk_size <= wim_ctype_info[(unsigned)ctype].max_chunk_size;\n}\n\n/* Return the default chunk size to use for the specified compression type in\n * non-solid resources.  */\nstatic u32\nwim_default_nonsolid_chunk_size(enum wimlib_compression_type ctype)\n{\n\treturn wim_ctype_info[(unsigned)ctype].default_nonsolid_chunk_size;\n}\n\n/* Return the default chunk size to use for the specified compression type in\n * solid resources.  */\nstatic u32\nwim_default_solid_chunk_size(enum wimlib_compression_type ctype)\n{\n\treturn wim_ctype_info[(unsigned)ctype].default_solid_chunk_size;\n}\n\n/* Return the default compression type to use in solid resources.  */\nstatic enum wimlib_compression_type\nwim_default_solid_compression_type(void)\n{\n\treturn WIMLIB_COMPRESSION_TYPE_LZMS;\n}\n\nstatic int\nis_blob_in_solid_resource(struct blob_descriptor *blob, void *_ignore)\n{\n\treturn blob->blob_location == BLOB_IN_WIM &&\n\t\t(blob->rdesc->flags & WIM_RESHDR_FLAG_SOLID);\n}\n\nbool\nwim_has_solid_resources(const WIMStruct *wim)\n{\n\treturn for_blob_in_table(wim->blob_table, is_blob_in_solid_resource, NULL);\n}\n\nstatic WIMStruct *\nnew_wim_struct(void)\n{\n\tWIMStruct *wim = CALLOC(1, sizeof(WIMStruct));\n\tif (!wim)\n\t\treturn NULL;\n\n\twim->refcnt = 1;\n\tfiledes_invalidate(&wim->in_fd);\n\tfiledes_invalidate(&wim->out_fd);\n\twim->out_solid_compression_type = wim_default_solid_compression_type();\n\twim->out_solid_chunk_size = wim_default_solid_chunk_size(\n\t\t\t\t\twim->out_solid_compression_type);\n\treturn wim;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_create_new_wim(enum wimlib_compression_type ctype, WIMStruct **wim_ret)\n{\n\tint ret;\n\tWIMStruct *wim;\n\n\tret = wimlib_global_init(0);\n\tif (ret)\n\t\treturn ret;\n\n\tif (!wim_ret)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (!wim_compression_type_valid(ctype))\n\t\treturn WIMLIB_ERR_INVALID_COMPRESSION_TYPE;\n\n\twim = new_wim_struct();\n\tif (!wim)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\t/* Fill in wim->hdr with default values */\n\twim->hdr.magic = WIM_MAGIC;\n\twim->hdr.wim_version = WIM_VERSION_DEFAULT;\n\twim->hdr.part_number = 1;\n\twim->hdr.total_parts = 1;\n\twim->compression_type = WIMLIB_COMPRESSION_TYPE_NONE;\n\n\t/* Set the output compression type */\n\twim->out_compression_type = ctype;\n\twim->out_chunk_size = wim_default_nonsolid_chunk_size(ctype);\n\n\t/* Allocate an empty XML info and blob table */\n\twim->xml_info = xml_new_info_struct();\n\twim->blob_table = new_blob_table(64);\n\tif (!wim->xml_info || !wim->blob_table) {\n\t\twimlib_free(wim);\n\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\t*wim_ret = wim;\n\treturn 0;\n}\n\nstatic void\nunload_image_metadata(struct wim_image_metadata *imd)\n{\n\tfree_dentry_tree(imd->root_dentry, NULL);\n\timd->root_dentry = NULL;\n\tfree_wim_security_data(imd->security_data);\n\timd->security_data = NULL;\n\tINIT_HLIST_HEAD(&imd->inode_list);\n}\n\n/* Release a reference to the specified image metadata.  This assumes that no\n * WIMStruct has the image selected.  */\nvoid\nput_image_metadata(struct wim_image_metadata *imd)\n{\n\tstruct blob_descriptor *blob, *tmp;\n\n\tif (!imd)\n\t\treturn;\n\twimlib_assert(imd->refcnt > 0);\n\tif (--imd->refcnt != 0)\n\t\treturn;\n\twimlib_assert(imd->selected_refcnt == 0);\n\tunload_image_metadata(imd);\n\tlist_for_each_entry_safe(blob, tmp, &imd->unhashed_blobs, unhashed_list)\n\t\tfree_blob_descriptor(blob);\n\tfree_blob_descriptor(imd->metadata_blob);\n\tFREE(imd);\n}\n\n/* Appends the specified image metadata structure to the array of image metadata\n * for a WIM, and increments the image count. */\nint\nappend_image_metadata(WIMStruct *wim, struct wim_image_metadata *imd)\n{\n\tstruct wim_image_metadata **imd_array;\n\n\tif (!wim_has_metadata(wim))\n\t\treturn WIMLIB_ERR_METADATA_NOT_FOUND;\n\n\tif (wim->hdr.image_count >= MAX_IMAGES)\n\t\treturn WIMLIB_ERR_IMAGE_COUNT;\n\n\timd_array = REALLOC(wim->image_metadata,\n\t\t\t    sizeof(wim->image_metadata[0]) * (wim->hdr.image_count + 1));\n\n\tif (!imd_array)\n\t\treturn WIMLIB_ERR_NOMEM;\n\twim->image_metadata = imd_array;\n\timd_array[wim->hdr.image_count++] = imd;\n\treturn 0;\n}\n\nstatic struct wim_image_metadata *\nnew_image_metadata(struct blob_descriptor *metadata_blob,\n\t\t   struct wim_security_data *security_data)\n{\n\tstruct wim_image_metadata *imd;\n\n\timd = CALLOC(1, sizeof(*imd));\n\tif (!imd)\n\t\treturn NULL;\n\n\tmetadata_blob->is_metadata = 1;\n\timd->refcnt = 1;\n\timd->selected_refcnt = 0;\n\timd->root_dentry = NULL;\n\timd->security_data = security_data;\n\timd->metadata_blob = metadata_blob;\n\tINIT_HLIST_HEAD(&imd->inode_list);\n\tINIT_LIST_HEAD(&imd->unhashed_blobs);\n\timd->stats_outdated = false;\n\treturn imd;\n}\n\n/* Create an image metadata structure for a new empty image.  */\nstruct wim_image_metadata *\nnew_empty_image_metadata(void)\n{\n\tstruct blob_descriptor *metadata_blob;\n\tstruct wim_security_data *security_data;\n\tstruct wim_image_metadata *imd;\n\n\tmetadata_blob = new_blob_descriptor();\n\tsecurity_data = new_wim_security_data();\n\tif (metadata_blob && security_data) {\n\t\tmetadata_blob->refcnt = 1;\n\t\timd = new_image_metadata(metadata_blob, security_data);\n\t\tif (imd)\n\t\t\treturn imd;\n\t}\n\tfree_blob_descriptor(metadata_blob);\n\tFREE(security_data);\n\treturn NULL;\n}\n\n/* Create an image metadata structure that refers to the specified metadata\n * resource and is initially not loaded.  */\nstruct wim_image_metadata *\nnew_unloaded_image_metadata(struct blob_descriptor *metadata_blob)\n{\n\twimlib_assert(metadata_blob->blob_location == BLOB_IN_WIM);\n\treturn new_image_metadata(metadata_blob, NULL);\n}\n\n/*\n * Load the metadata for the specified WIM image into memory and set it\n * as the WIMStruct's currently selected image.\n *\n * @wim\n *\tThe WIMStruct for the WIM.\n * @image\n *\tThe 1-based index of the image in the WIM to select.\n *\n * On success, 0 will be returned, wim->current_image will be set to\n * @image, and wim_get_current_image_metadata() can be used to retrieve\n * metadata information for the image.\n *\n * On failure, WIMLIB_ERR_INVALID_IMAGE, WIMLIB_ERR_METADATA_NOT_FOUND,\n * or another error code will be returned.\n */\nint\nselect_wim_image(WIMStruct *wim, int image)\n{\n\tstruct wim_image_metadata *imd;\n\tint ret;\n\n\tif (image == WIMLIB_NO_IMAGE)\n\t\treturn WIMLIB_ERR_INVALID_IMAGE;\n\n\tif (image == wim->current_image)\n\t\treturn 0;\n\n\tif (image < 1 || image > wim->hdr.image_count)\n\t\treturn WIMLIB_ERR_INVALID_IMAGE;\n\n\tif (!wim_has_metadata(wim))\n\t\treturn WIMLIB_ERR_METADATA_NOT_FOUND;\n\n\tdeselect_current_wim_image(wim);\n\n\timd = wim->image_metadata[image - 1];\n\tif (!is_image_loaded(imd)) {\n\t\tret = read_metadata_resource(imd);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\twim->current_image = image;\n\timd->selected_refcnt++;\n\treturn 0;\n}\n\n/*\n * Deselect the WIMStruct's currently selected image, if any.  To reduce memory\n * usage, possibly unload the newly deselected image's metadata from memory.\n */\nvoid\ndeselect_current_wim_image(WIMStruct *wim)\n{\n\tstruct wim_image_metadata *imd;\n\n\tif (wim->current_image == WIMLIB_NO_IMAGE)\n\t\treturn;\n\timd = wim_get_current_image_metadata(wim);\n\twimlib_assert(imd->selected_refcnt > 0);\n\timd->selected_refcnt--;\n\twim->current_image = WIMLIB_NO_IMAGE;\n\n\tif (can_unload_image(imd)) {\n\t\twimlib_assert(list_empty(&imd->unhashed_blobs));\n\t\tunload_image_metadata(imd);\n\t}\n}\n\n/*\n * Calls a function on images in the WIM.  If @image is WIMLIB_ALL_IMAGES,\n * @visitor is called on the WIM once for each image, with each image selected\n * as the current image in turn.  If @image is a certain image, @visitor is\n * called on the WIM only once, with that image selected.\n */\nint\nfor_image(WIMStruct *wim, int image, int (*visitor)(WIMStruct *))\n{\n\tint ret;\n\tint start;\n\tint end;\n\tint i;\n\n\tif (image == WIMLIB_ALL_IMAGES) {\n\t\tstart = 1;\n\t\tend = wim->hdr.image_count;\n\t} else if (image >= 1 && image <= wim->hdr.image_count) {\n\t\tstart = image;\n\t\tend = image;\n\t} else {\n\t\treturn WIMLIB_ERR_INVALID_IMAGE;\n\t}\n\tfor (i = start; i <= end; i++) {\n\t\tret = select_wim_image(wim, i);\n\t\tif (ret != 0)\n\t\t\treturn ret;\n\t\tret = visitor(wim);\n\t\tif (ret != 0)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_resolve_image(WIMStruct *wim, const tchar *image_name_or_num)\n{\n\ttchar *p;\n\tlong image;\n\tint i;\n\n\tif (!image_name_or_num || !*image_name_or_num)\n\t\treturn WIMLIB_NO_IMAGE;\n\n\tif (!tstrcasecmp(image_name_or_num, T(\"all\"))\n\t    || !tstrcasecmp(image_name_or_num, T(\"*\")))\n\t\treturn WIMLIB_ALL_IMAGES;\n\timage = tstrtol(image_name_or_num, &p, 10);\n\tif (p != image_name_or_num && *p == T('\\0') && image > 0) {\n\t\tif (image > wim->hdr.image_count)\n\t\t\treturn WIMLIB_NO_IMAGE;\n\t\treturn image;\n\t} else {\n\t\tfor (i = 1; i <= wim->hdr.image_count; i++) {\n\t\t\tif (!tstrcmp(image_name_or_num,\n\t\t\t\t     wimlib_get_image_name(wim, i)))\n\t\t\t\treturn i;\n\t\t}\n\t\treturn WIMLIB_NO_IMAGE;\n\t}\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI void\nwimlib_print_available_images(const WIMStruct *wim, int image)\n{\n\tint first;\n\tint last;\n\tint i;\n\tint n = 80;\n\tif (image == WIMLIB_ALL_IMAGES) {\n\t\ttprintf(T(\"Available Images:\\n\"));\n\t\tfirst = 1;\n\t\tlast = wim->hdr.image_count;\n\t} else if (image >= 1 && image <= wim->hdr.image_count) {\n\t\ttprintf(T(\"Information for Image %d\\n\"), image);\n\t\tfirst = image;\n\t\tlast = image;\n\t} else {\n\t\ttprintf(T(\"wimlib_print_available_images(): Invalid image %d\"),\n\t\t\timage);\n\t\treturn;\n\t}\n\tfor (i = 0; i < n - 1; i++)\n\t\ttputchar(T('-'));\n\ttputchar(T('\\n'));\n\tfor (i = first; i <= last; i++)\n\t\txml_print_image_info(wim->xml_info, i);\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info)\n{\n\tmemset(info, 0, sizeof(struct wimlib_wim_info));\n\tcopy_guid(info->guid, wim->hdr.guid);\n\tinfo->image_count = wim->hdr.image_count;\n\tinfo->boot_index = wim->hdr.boot_idx;\n\tinfo->wim_version = wim->hdr.wim_version;\n\tinfo->chunk_size = wim->chunk_size;\n\tinfo->part_number = wim->hdr.part_number;\n\tinfo->total_parts = wim->hdr.total_parts;\n\tinfo->compression_type = wim->compression_type;\n\tinfo->total_bytes = xml_get_total_bytes(wim->xml_info);\n\tinfo->has_integrity_table = wim_has_integrity_table(wim);\n\tinfo->opened_from_file = (wim->filename != NULL);\n\tinfo->is_readonly = (wim->hdr.flags & WIM_HDR_FLAG_READONLY) ||\n\t\t\t     (wim->hdr.total_parts != 1) ||\n\t\t\t     (wim->filename && taccess(wim->filename, W_OK));\n\tinfo->has_rpfix = (wim->hdr.flags & WIM_HDR_FLAG_RP_FIX) != 0;\n\tinfo->is_marked_readonly = (wim->hdr.flags & WIM_HDR_FLAG_READONLY) != 0;\n\tinfo->write_in_progress = (wim->hdr.flags & WIM_HDR_FLAG_WRITE_IN_PROGRESS) != 0;\n\tinfo->metadata_only = (wim->hdr.flags & WIM_HDR_FLAG_METADATA_ONLY) != 0;\n\tinfo->resource_only = (wim->hdr.flags & WIM_HDR_FLAG_RESOURCE_ONLY) != 0;\n\tinfo->spanned = (wim->hdr.flags & WIM_HDR_FLAG_SPANNED) != 0;\n\tinfo->pipable = wim_is_pipable(wim);\n\treturn 0;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_set_wim_info(WIMStruct *wim, const struct wimlib_wim_info *info, int which)\n{\n\tif (which & ~(WIMLIB_CHANGE_READONLY_FLAG |\n\t\t      WIMLIB_CHANGE_GUID |\n\t\t      WIMLIB_CHANGE_BOOT_INDEX |\n\t\t      WIMLIB_CHANGE_RPFIX_FLAG))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif ((which & WIMLIB_CHANGE_BOOT_INDEX) &&\n\t    info->boot_index > wim->hdr.image_count)\n\t\treturn WIMLIB_ERR_INVALID_IMAGE;\n\n\tif (which & WIMLIB_CHANGE_READONLY_FLAG) {\n\t\tif (info->is_marked_readonly)\n\t\t\twim->hdr.flags |= WIM_HDR_FLAG_READONLY;\n\t\telse\n\t\t\twim->hdr.flags &= ~WIM_HDR_FLAG_READONLY;\n\t}\n\n\tif (which & WIMLIB_CHANGE_GUID)\n\t\tcopy_guid(wim->hdr.guid, info->guid);\n\n\tif (which & WIMLIB_CHANGE_BOOT_INDEX)\n\t\twim->hdr.boot_idx = info->boot_index;\n\n\tif (which & WIMLIB_CHANGE_RPFIX_FLAG) {\n\t\tif (info->has_rpfix)\n\t\t\twim->hdr.flags |= WIM_HDR_FLAG_RP_FIX;\n\t\telse\n\t\t\twim->hdr.flags &= ~WIM_HDR_FLAG_RP_FIX;\n\t}\n\treturn 0;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_set_output_compression_type(WIMStruct *wim,\n\t\t\t\t   enum wimlib_compression_type ctype)\n{\n\tif (!wim_compression_type_valid(ctype))\n\t\treturn WIMLIB_ERR_INVALID_COMPRESSION_TYPE;\n\n\twim->out_compression_type = ctype;\n\n\t/* Reset the chunk size if it's no longer valid.  */\n\tif (!wim_chunk_size_valid(wim->out_chunk_size, ctype))\n\t\twim->out_chunk_size = wim_default_nonsolid_chunk_size(ctype);\n\treturn 0;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_set_output_pack_compression_type(WIMStruct *wim,\n\t\t\t\t\tenum wimlib_compression_type ctype)\n{\n\tif (!wim_compression_type_valid(ctype))\n\t\treturn WIMLIB_ERR_INVALID_COMPRESSION_TYPE;\n\n\t/* Solid resources can't be uncompressed.  */\n\tif (ctype == WIMLIB_COMPRESSION_TYPE_NONE)\n\t\treturn WIMLIB_ERR_INVALID_COMPRESSION_TYPE;\n\n\twim->out_solid_compression_type = ctype;\n\n\t/* Reset the chunk size if it's no longer valid.  */\n\tif (!wim_chunk_size_valid(wim->out_solid_chunk_size, ctype))\n\t\twim->out_solid_chunk_size = wim_default_solid_chunk_size(ctype);\n\treturn 0;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_set_output_chunk_size(WIMStruct *wim, u32 chunk_size)\n{\n\tif (chunk_size == 0) {\n\t\twim->out_chunk_size =\n\t\t\twim_default_nonsolid_chunk_size(wim->out_compression_type);\n\t\treturn 0;\n\t}\n\n\tif (!wim_chunk_size_valid(chunk_size, wim->out_compression_type))\n\t\treturn WIMLIB_ERR_INVALID_CHUNK_SIZE;\n\n\twim->out_chunk_size = chunk_size;\n\treturn 0;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_set_output_pack_chunk_size(WIMStruct *wim, u32 chunk_size)\n{\n\tif (chunk_size == 0) {\n\t\twim->out_solid_chunk_size =\n\t\t\twim_default_solid_chunk_size(wim->out_solid_compression_type);\n\t\treturn 0;\n\t}\n\n\tif (!wim_chunk_size_valid(chunk_size, wim->out_solid_compression_type))\n\t\treturn WIMLIB_ERR_INVALID_CHUNK_SIZE;\n\n\twim->out_solid_chunk_size = chunk_size;\n\treturn 0;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI const tchar *\nwimlib_get_compression_type_string(enum wimlib_compression_type ctype)\n{\n\tif (!wim_compression_type_valid(ctype))\n\t\treturn T(\"Invalid\");\n\n\treturn wim_ctype_info[(unsigned)ctype].name;\n}\n\nWIMLIBAPI void\nwimlib_register_progress_function(WIMStruct *wim,\n\t\t\t\t  wimlib_progress_func_t progfunc,\n\t\t\t\t  void *progctx)\n{\n\twim->progfunc = progfunc;\n\twim->progctx = progctx;\n}\n\n#ifdef WITH_LIBCDIO\nstatic int \nopen_iso_wim_file(const tchar* filename, struct filedes* fd_ret)\n{\n\tint ret = 0;\n\tsize_t n;\n\tchar *iso_filename, *iso_path = NULL;\n\tudf_dirent_t *p_udf_root;\n\n\t/* If the wim path contains a pipe separator, look it up inside an ISO */\n\tif (tstr_to_utf8(filename, (tstrlen(filename) + 1) * sizeof(tchar), &iso_path, &n))\n\t\treturn WIMLIB_ERR_NOMEM;\n\tiso_filename = strchr(iso_path, '|');\n\tif (iso_filename == NULL) {\n\t\tret = WIMLIB_ERR_NO_FILENAME;\n\t\tgoto out;\n\t}\n\n\t*iso_filename++ = '\\0';\n\tfiledes_init(fd_ret, 0);\n\n\t/* Try to open as UDF image */\n\tfd_ret->p_udf = udf_open(iso_path);\n\tif (!fd_ret->p_udf)\n\t\tgoto try_iso;\n\tp_udf_root = udf_get_root(fd_ret->p_udf, true, 0);\n\tif (!p_udf_root) {\n\t\tret = WIMLIB_ERR_OPEN;\n\t\tgoto out;\n\t}\n\tfd_ret->p_udf_file = udf_fopen(p_udf_root, iso_filename);\n\tudf_dirent_free(p_udf_root);\n\tif (!fd_ret->p_udf_file) {\n\t\tret = WIMLIB_ERR_OPEN;\n\t\tgoto out;\n\t}\n\tfd_ret->is_udf = 1;\n\tgoto out;\n\ntry_iso:\n\t/* Try to open as ISO9660 image */\n\tfd_ret->p_iso = iso9660_open_ext(iso_path, ISO_EXTENSION_ALL);\n\tif (!fd_ret->p_iso) {\n\t\tret = WIMLIB_ERR_OPEN;\n\t\tgoto out;\n\t}\n\tfd_ret->p_iso_file = iso9660_ifs_stat_translate(fd_ret->p_iso, iso_filename);\n\tif (!fd_ret->p_iso_file) {\n\t\tret = WIMLIB_ERR_OPEN;\n\t\tgoto out;\n\t}\n\tfd_ret->is_iso = 1;\n\nout:\n\tFREE(iso_path);\n\t/* Because we use an union, make sure fd is cleared on error */\n\tif (ret)\n\t\tfd_ret->fd = 0;\n\treturn ret;\n}\n#endif\n\nstatic int\nopen_wim_file(const tchar *filename, struct filedes *fd_ret)\n{\n\tint raw_fd;\n\n#ifdef WITH_LIBCDIO\n\tif (open_iso_wim_file(filename, fd_ret) == 0)\n\t\treturn 0;\n#endif\n\traw_fd = topen(filename, O_RDONLY | O_BINARY);\n\tif (raw_fd < 0) {\n\t\tERROR_WITH_ERRNO(\"Can't open \\\"%\"TS\"\\\" read-only\", filename);\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\tfiledes_init(fd_ret, raw_fd);\n\treturn 0;\n}\n\n/*\n * Begins the reading of a WIM file; opens the file and reads its header and\n * blob table, and optionally checks the integrity.\n */\nstatic int\nbegin_read(WIMStruct *wim, const void *wim_filename_or_fd, int open_flags)\n{\n\tint ret;\n\tconst tchar *wimfile;\n\n\tif (open_flags & WIMLIB_OPEN_FLAG_FROM_PIPE) {\n\t\twimfile = NULL;\n\t\tfiledes_init(&wim->in_fd, *(const int*)wim_filename_or_fd);\n\t\twim->in_fd.is_pipe = 1;\n\t} else {\n\t\tstruct stat stbuf;\n\n\t\twimfile = wim_filename_or_fd;\n\t\tret = open_wim_file(wimfile, &wim->in_fd);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\t/* The file size is needed for enforcing some limits later. */\n#ifdef WITH_LIBCDIO\n\t\tif ((wim->in_fd.is_udf | wim->in_fd.is_iso) &&\n\t\t\t(open_flags & WIMLIB_OPEN_FLAG_WRITE_ACCESS))\n\t\t\treturn WIMLIB_ERR_WIM_IS_READONLY;\n\t\tif (wim->in_fd.is_udf)\n\t\t\twim->file_size = udf_get_file_length(wim->in_fd.p_udf_file);\n\t\telse if (wim->in_fd.is_iso)\n\t\t\twim->file_size = wim->in_fd.p_iso_file->total_size;\n\t\telse\n#endif\n\t\tif (fstat(wim->in_fd.fd, &stbuf) == 0)\n\t\t\twim->file_size = stbuf.st_size;\n\n\t\t/* The absolute path to the WIM is requested so that\n\t\t * wimlib_overwrite() still works even if the process changes\n\t\t * its working directory.  This actually happens if a WIM is\n\t\t * mounted read-write, since the FUSE thread changes directory\n\t\t * to \"/\", and it needs to be able to find the WIM file again.\n\t\t *\n\t\t * This will break if the full path to the WIM changes in the\n\t\t * intervening time...\n\t\t *\n\t\t * Warning: in Windows native builds, realpath() calls the\n\t\t * replacement function in win32_replacements.c.\n\t\t */\n#ifdef WITH_LIBCDIO\n\t\t/* No overwriting for libcdio, so simply duplicate */\n\t\tif (tstrchr(wimfile, T('|')))\n\t\t\twim->filename = tstrdup(wimfile);\n\t\telse\n#endif\n\t\twim->filename = realpath(wimfile, NULL);\n\t\tif (!wim->filename) {\n\t\t\tERROR_WITH_ERRNO(\"Failed to get full path to file \"\n\t\t\t\t\t \"\\\"%\"TS\"\\\"\", wimfile);\n\t\t\tif (errno == ENOMEM)\n\t\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\t\telse\n\t\t\t\treturn WIMLIB_ERR_NO_FILENAME;\n\t\t}\n\t}\n\n\tret = read_wim_header(wim, &wim->hdr);\n\tif (ret)\n\t\treturn ret;\n\n\tif (wim->hdr.flags & WIM_HDR_FLAG_WRITE_IN_PROGRESS) {\n\t\tWARNING(\"The WIM_HDR_FLAG_WRITE_IN_PROGRESS flag is set in the header of\\n\"\n\t\t\t\"          \\\"%\"TS\"\\\".  It may be being changed by another process,\\n\"\n\t\t\t\"          or a process may have crashed while writing the WIM.\",\n\t\t\twimfile);\n\t}\n\n\tif (open_flags & WIMLIB_OPEN_FLAG_WRITE_ACCESS) {\n\t\tret = can_modify_wim(wim);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tif ((open_flags & WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT) &&\n\t    (wim->hdr.total_parts != 1))\n\t\treturn WIMLIB_ERR_IS_SPLIT_WIM;\n\n\t/* If the boot index is invalid, print a warning and set it to 0 */\n\tif (wim->hdr.boot_idx > wim->hdr.image_count) {\n\t\tWARNING(\"Ignoring invalid boot index.\");\n\t\twim->hdr.boot_idx = 0;\n\t}\n\n\t/* Check and cache the compression type */\n\tif (wim->hdr.flags & WIM_HDR_FLAG_COMPRESSION) {\n\t\tif (wim->hdr.flags & WIM_HDR_FLAG_COMPRESS_LZX) {\n\t\t\twim->compression_type = WIMLIB_COMPRESSION_TYPE_LZX;\n\t\t} else if (wim->hdr.flags & (WIM_HDR_FLAG_COMPRESS_XPRESS |\n\t\t\t\t\t     WIM_HDR_FLAG_COMPRESS_XPRESS_2)) {\n\t\t\twim->compression_type = WIMLIB_COMPRESSION_TYPE_XPRESS;\n\t\t} else if (wim->hdr.flags & WIM_HDR_FLAG_COMPRESS_LZMS) {\n\t\t\twim->compression_type = WIMLIB_COMPRESSION_TYPE_LZMS;\n\t\t} else {\n\t\t\treturn WIMLIB_ERR_INVALID_COMPRESSION_TYPE;\n\t\t}\n\t} else {\n\t\twim->compression_type = WIMLIB_COMPRESSION_TYPE_NONE;\n\t}\n\twim->out_compression_type = wim->compression_type;\n\n\t/* Check and cache the chunk size.  */\n\twim->chunk_size = wim->hdr.chunk_size;\n\twim->out_chunk_size = wim->chunk_size;\n\tif (!wim_chunk_size_valid(wim->chunk_size, wim->compression_type)) {\n\t\tERROR(\"Invalid chunk size (%\"PRIu32\" bytes) \"\n\t\t      \"for compression type %\"TS\"!\", wim->chunk_size,\n\t\t      wimlib_get_compression_type_string(wim->compression_type));\n\t\treturn WIMLIB_ERR_INVALID_CHUNK_SIZE;\n\t}\n\n\tif (open_flags & WIMLIB_OPEN_FLAG_CHECK_INTEGRITY) {\n\t\tret = check_wim_integrity(wim);\n\t\tif (ret == WIM_INTEGRITY_NONEXISTENT) {\n\t\t\tWARNING(\"\\\"%\"TS\"\\\" does not contain integrity \"\n\t\t\t\t\"information.  Skipping integrity check.\",\n\t\t\t\twimfile);\n\t\t} else if (ret == WIM_INTEGRITY_NOT_OK) {\n\t\t\treturn WIMLIB_ERR_INTEGRITY;\n\t\t} else if (ret != WIM_INTEGRITY_OK) {\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tif (wim->hdr.image_count != 0 && wim->hdr.part_number == 1) {\n\t\twim->image_metadata = CALLOC(wim->hdr.image_count,\n\t\t\t\t\t     sizeof(wim->image_metadata[0]));\n\t\tif (!wim->image_metadata)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\tif (open_flags & WIMLIB_OPEN_FLAG_FROM_PIPE) {\n\t\twim->blob_table = new_blob_table(64);\n\t\tif (!wim->blob_table)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t} else {\n\t\tif (wim->hdr.blob_table_reshdr.uncompressed_size == 0 &&\n\t\t    wim->hdr.xml_data_reshdr.uncompressed_size == 0)\n\t\t\treturn WIMLIB_ERR_WIM_IS_INCOMPLETE;\n\n\t\tret = read_wim_xml_data(wim);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tif (xml_get_image_count(wim->xml_info) != wim->hdr.image_count) {\n\t\t\tERROR(\"The WIM's header is inconsistent with its XML data.\\n\"\n\t\t\t      \"        Please submit a bug report if you believe this \"\n\t\t\t      \"WIM file should be considered valid.\");\n\t\t\treturn WIMLIB_ERR_IMAGE_COUNT;\n\t\t}\n\n\t\tret = read_blob_table(wim);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nint\nopen_wim_as_WIMStruct(const void *wim_filename_or_fd, int open_flags,\n\t\t      WIMStruct **wim_ret,\n\t\t      wimlib_progress_func_t progfunc, void *progctx)\n{\n\tWIMStruct *wim;\n\tint ret;\n\n\tret = wimlib_global_init(0);\n\tif (ret)\n\t\treturn ret;\n\n\twim = new_wim_struct();\n\tif (!wim)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\twim->progfunc = progfunc;\n\twim->progctx = progctx;\n\n\tret = begin_read(wim, wim_filename_or_fd, open_flags);\n\tif (ret) {\n\t\twimlib_free(wim);\n\t\treturn ret;\n\t}\n\n\t*wim_ret = wim;\n\treturn 0;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_open_wim_with_progress(const tchar *wimfile, int open_flags,\n\t\t\t      WIMStruct **wim_ret,\n\t\t\t      wimlib_progress_func_t progfunc, void *progctx)\n{\n\tif (open_flags & ~(WIMLIB_OPEN_FLAG_CHECK_INTEGRITY |\n\t\t\t   WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT |\n\t\t\t   WIMLIB_OPEN_FLAG_WRITE_ACCESS))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (!wimfile || !*wimfile || !wim_ret)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\treturn open_wim_as_WIMStruct(wimfile, open_flags, wim_ret,\n\t\t\t\t     progfunc, progctx);\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_open_wim(const tchar *wimfile, int open_flags, WIMStruct **wim_ret)\n{\n\treturn wimlib_open_wim_with_progress(wimfile, open_flags, wim_ret,\n\t\t\t\t\t     NULL, NULL);\n}\n\n/* Checksum all blobs that are unhashed (other than the metadata blobs), merging\n * them into the blob table as needed.  This is a no-op unless files have been\n * added to an image in the same WIMStruct.  */\nint\nwim_checksum_unhashed_blobs(WIMStruct *wim)\n{\n\tint ret;\n\n\tif (!wim_has_metadata(wim))\n\t\treturn 0;\n\tfor (int i = 0; i < wim->hdr.image_count; i++) {\n\t\tstruct blob_descriptor *blob, *tmp;\n\t\tstruct wim_image_metadata *imd = wim->image_metadata[i];\n\t\timage_for_each_unhashed_blob_safe(blob, tmp, imd) {\n\t\t\tstruct blob_descriptor *new_blob;\n\t\t\tret = hash_unhashed_blob(blob, wim->blob_table, &new_blob);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\tif (new_blob != blob)\n\t\t\t\tfree_blob_descriptor(blob);\n\t\t}\n\t}\n\treturn 0;\n}\n\n/*\n * can_modify_wim - Check if a given WIM is writeable.  This is only the case if\n * it meets the following three conditions:\n *\n * 1. Write access is allowed to the underlying file (if any) at the filesystem level.\n * 2. The WIM is not part of a spanned set.\n * 3. The WIM_HDR_FLAG_READONLY flag is not set in the WIM header.\n *\n * Return value is 0 if writable; WIMLIB_ERR_WIM_IS_READONLY otherwise.\n */\nint\ncan_modify_wim(WIMStruct *wim)\n{\n\tif (wim->filename) {\n\t\tif (taccess(wim->filename, W_OK)) {\n\t\t\tERROR_WITH_ERRNO(\"Can't modify \\\"%\"TS\"\\\"\", wim->filename);\n\t\t\treturn WIMLIB_ERR_WIM_IS_READONLY;\n\t\t}\n\t}\n\tif (wim->hdr.total_parts != 1) {\n\t\tERROR(\"Cannot modify \\\"%\"TS\"\\\": is part of a split WIM\",\n\t\t      wim->filename);\n\t\treturn WIMLIB_ERR_WIM_IS_READONLY;\n\t}\n\tif (wim->hdr.flags & WIM_HDR_FLAG_READONLY) {\n\t\tERROR(\"Cannot modify \\\"%\"TS\"\\\": is marked read-only\",\n\t\t      wim->filename);\n\t\treturn WIMLIB_ERR_WIM_IS_READONLY;\n\t}\n\treturn 0;\n}\n\n/* Release a reference to a WIMStruct.  If the reference count reaches 0, the\n * WIMStruct is freed.  */\nvoid\nwim_decrement_refcnt(WIMStruct *wim)\n{\n\twimlib_assert(wim->refcnt > 0);\n\tif (--wim->refcnt != 0)\n\t\treturn;\n#ifdef WITH_LIBCDIO\n\tif (wim->in_fd.is_udf) {\n\t\tudf_dirent_free(wim->in_fd.p_udf_file);\n\t\tudf_close(wim->in_fd.p_udf);\n\t} else if (wim->in_fd.is_iso) {\n\t\tiso9660_stat_free(wim->in_fd.p_iso_file);\n\t\tiso9660_close(wim->in_fd.p_iso);\n\t} else {\n#endif\n\t\tif (filedes_valid(&wim->in_fd))\n\t\t\tfiledes_close(&wim->in_fd);\n\t\tif (filedes_valid(&wim->out_fd))\n\t\t\tfiledes_close(&wim->out_fd);\n#ifdef WITH_LIBCDIO\n\t}\n#endif\n\twimlib_free_decompressor(wim->decompressor);\n\txml_free_info_struct(wim->xml_info);\n\tFREE(wim->filename);\n\tFREE(wim);\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI void\nwimlib_free(WIMStruct *wim)\n{\n\tif (!wim)\n\t\treturn;\n\n\t/* The blob table and image metadata are freed immediately, but other\n\t * members of the WIMStruct such as the input file descriptor are\n\t * retained until no more exported resources reference the WIMStruct. */\n\n\tfree_blob_table(wim->blob_table);\n\twim->blob_table = NULL;\n\tif (wim->image_metadata != NULL) {\n\t\tdeselect_current_wim_image(wim);\n\t\tfor (int i = 0; i < wim->hdr.image_count; i++)\n\t\t\tput_image_metadata(wim->image_metadata[i]);\n\t\tFREE(wim->image_metadata);\n\t\twim->image_metadata = NULL;\n\t}\n\n\twim_decrement_refcnt(wim);\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI u32\nwimlib_get_version(void)\n{\n\treturn (WIMLIB_MAJOR_VERSION << 20) |\n\t       (WIMLIB_MINOR_VERSION << 10) |\n\t\tWIMLIB_PATCH_VERSION;\n}\n\nWIMLIBAPI const tchar *\nwimlib_get_version_string(void)\n{\n\treturn T(PACKAGE_VERSION);\n}\n\nstatic volatile uint16_t lib_initialization_mutex = 0;\nstatic bool lib_initialized = false;\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_global_init(int init_flags)\n{\n\tint ret = 0;\n\n\t// Non problematic init/cleanup mutex (Windows only) to keep static\n\t// analysers happy. Only one thread at a time can run the code between\n\t// initial InterlockedIncrement and ending InterlockedDecrement.\n\twhile (InterlockedIncrement16(&lib_initialization_mutex) >= 2) {\n\t\tInterlockedDecrement16(&lib_initialization_mutex);\n\t\tSleep(100);\n\t}\n\n\tif (lib_initialized)\n\t\tgoto out_unlock;\n\n\tif (!wimlib_error_file)\n\t\twimlib_error_file = stderr;\n\n\tret = WIMLIB_ERR_INVALID_PARAM;\n\tif (init_flags & ~(WIMLIB_INIT_FLAG_ASSUME_UTF8 |\n\t\t\t   WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES |\n\t\t\t   WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES |\n\t\t\t   WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES |\n\t\t\t   WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE |\n\t\t\t   WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE))\n\t\tgoto out_unlock;\n\n\tret = WIMLIB_ERR_INVALID_PARAM;\n\tif ((init_flags & (WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE |\n\t\t\t   WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE))\n\t\t\t== (WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE |\n\t\t\t    WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE))\n\t\tgoto out_unlock;\n\n\tinit_cpu_features();\n#ifdef _WIN32\n\tret = win32_global_init(init_flags);\n\tif (ret)\n\t\tgoto out_unlock;\n#endif\n\tinit_upcase();\n\tif (init_flags & WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE)\n\t\tdefault_ignore_case = false;\n\telse if (init_flags & WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE)\n\t\tdefault_ignore_case = true;\n\tlib_initialized = true;\n\tret = 0;\nout_unlock:\n\tInterlockedDecrement16(&lib_initialization_mutex);\n\treturn ret;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI void\nwimlib_global_cleanup(void)\n{\n\twhile (InterlockedIncrement16(&lib_initialization_mutex) >= 2) {\n\t\tInterlockedDecrement16(&lib_initialization_mutex);\n\t\tSleep(100);\n\t}\n\n\tif (!lib_initialized)\n\t\tgoto out_unlock;\n\n#ifdef _WIN32\n\twin32_global_cleanup();\n#endif\n\n\twimlib_set_error_file(NULL);\n\tlib_initialized = false;\n\nout_unlock:\n\tInterlockedDecrement16(&lib_initialization_mutex);\n}\n"
  },
  {
    "path": "src/wimlib/wimboot.c",
    "content": "/*\n * wimboot.c\n *\n * Support for creating WIMBoot pointer files.\n *\n * For general information about WIMBoot, see\n * https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-8.1-and-8/dn594399(v=win.10)\n *\n * Note that WIMBoot pointer files are actually implemented on top of the\n * Windows Overlay Filesystem filter (WOF).  See wof.h for more info.\n */\n\n/*\n * Copyright (C) 2014-2021 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef _WIN32\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/win32_common.h\"\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/inode.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/util.h\"\n#include \"wimlib/wimboot.h\"\n#include \"wimlib/win32.h\"\n#include \"wimlib/wof.h\"\n\nstatic HANDLE\nopen_file(const wchar_t *device_name, DWORD desiredAccess)\n{\n\treturn CreateFile(device_name, desiredAccess,\n\t\t\t  FILE_SHARE_VALID_FLAGS, NULL, OPEN_EXISTING,\n\t\t\t  FILE_FLAG_BACKUP_SEMANTICS, NULL);\n}\n\nstatic BOOL\nquery_device(HANDLE h, DWORD code, void *out, DWORD out_size)\n{\n\tDWORD bytes_returned;\n\treturn DeviceIoControl(h, code, NULL, 0, out, out_size,\n\t\t\t       &bytes_returned, NULL);\n}\n\n/*\n * Gets partition and drive information for the specified path.\n *\n * @path\n *\tAbsolute path which must begin with a drive letter.  For example, if the\n *\tpath is D:\\install.wim, this function will query information about the\n *\tD: volume.\n * @part_info_ret\n *\tPartition info is returned here.\n * @drive_info_ret\n *\tDrive info is returned here.  The contained partition info will not be\n *\tvalid.\n *\n * Returns 0 on success, or a positive error code on failure.\n */\nstatic int\nquery_partition_and_disk_info(const wchar_t *path,\n\t\t\t      PARTITION_INFORMATION_EX *part_info,\n\t\t\t      DRIVE_LAYOUT_INFORMATION_EX *drive_info_ret)\n{\n\twchar_t vol_name[] = L\"\\\\\\\\.\\\\X:\";\n\twchar_t disk_name[] = L\"\\\\\\\\?\\\\PhysicalDriveXXXXXXXXXX\";\n\tHANDLE h = INVALID_HANDLE_VALUE;\n\tVOLUME_DISK_EXTENTS *extents = NULL;\n\tsize_t extents_size;\n\tDRIVE_LAYOUT_INFORMATION_EX *drive_info = NULL;\n\tsize_t drive_info_size;\n\tint ret;\n\n\twimlib_assert(path[0] != L'\\0' && path[1] == L':');\n\n\t*(wcschr(vol_name, L'X')) = path[0];\n\n\th = open_file(vol_name, GENERIC_READ);\n\tif (h == INVALID_HANDLE_VALUE) {\n\t\twin32_error(GetLastError(), L\"\\\"%ls\\\": Can't open volume device\",\n\t\t\t    vol_name);\n\t\tret = WIMLIB_ERR_OPEN;\n\t\tgoto out;\n\t}\n\n\tif (!query_device(h, IOCTL_DISK_GET_PARTITION_INFO_EX,\n\t\t\t  part_info, sizeof(PARTITION_INFORMATION_EX)))\n\t{\n\t\twin32_error(GetLastError(),\n\t\t\t    L\"\\\"%ls\\\": Can't get partition info\", vol_name);\n\t\tret = WIMLIB_ERR_READ;\n\t\tgoto out;\n\t}\n\n\textents_size = sizeof(VOLUME_DISK_EXTENTS);\n\tfor (;;) {\n\t\textents_size += 4 * sizeof(DISK_EXTENT);\n\t\textents = MALLOC(extents_size);\n\t\tif (!extents) {\n\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\tgoto out;\n\t\t}\n\n\t\tif (query_device(h, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,\n\t\t\t\t extents, extents_size))\n\t\t\tbreak;\n\t\tif (GetLastError() != ERROR_MORE_DATA) {\n\t\t\twin32_error(GetLastError(),\n\t\t\t\t    L\"\\\"%ls\\\": Can't get volume extent info\",\n\t\t\t\t    vol_name);\n\t\t\tret = WIMLIB_ERR_READ;\n\t\t\tgoto out;\n\t\t}\n\t\tFREE(extents);\n\t}\n\n\tCloseHandle(h);\n\th = INVALID_HANDLE_VALUE;\n\n\tif (extents->NumberOfDiskExtents != 1) {\n\t\tERROR(\"\\\"%ls\\\": This volume has %\"PRIu32\" disk extents, \"\n\t\t      \"but this code is untested for more than 1\",\n\t\t      vol_name, (u32)extents->NumberOfDiskExtents);\n\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\tgoto out;\n\t}\n\n\twsprintf(wcschr(disk_name, L'X'), L\"%\"PRIu32,\n\t\t extents->Extents[0].DiskNumber);\n\n\th = open_file(disk_name, GENERIC_READ);\n\tif (h == INVALID_HANDLE_VALUE) {\n\t\twin32_error(GetLastError(),\n\t\t\t    L\"\\\"%ls\\\": Can't open disk device\", disk_name);\n\t\tret = WIMLIB_ERR_OPEN;\n\t\tgoto out;\n\t}\n\n\tdrive_info_size = sizeof(DRIVE_LAYOUT_INFORMATION_EX);\n\tfor (;;) {\n\t\tdrive_info_size += 4 * sizeof(PARTITION_INFORMATION_EX);\n\t\tdrive_info = MALLOC(drive_info_size);\n\t\tif (!drive_info) {\n\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\tgoto out;\n\t\t}\n\n\t\tif (query_device(h, IOCTL_DISK_GET_DRIVE_LAYOUT_EX,\n\t\t\t\t drive_info, drive_info_size))\n\t\t\tbreak;\n\t\tif (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {\n\t\t\twin32_error(GetLastError(),\n\t\t\t\t    L\"\\\"%ls\\\": Can't get disk info\", disk_name);\n\t\t\tret = WIMLIB_ERR_READ;\n\t\t\tgoto out;\n\t\t}\n\t\tFREE(drive_info);\n\t}\n\n\t*drive_info_ret = *drive_info;  /* doesn't include partitions */\n\tCloseHandle(h);\n\th = INVALID_HANDLE_VALUE;\n\n\tif (drive_info->PartitionStyle != part_info->PartitionStyle) {\n\t\tERROR(\"\\\"%ls\\\", \\\"%ls\\\": Inconsistent partition table type!\",\n\t\t      vol_name, disk_name);\n\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\tgoto out;\n\t}\n\n\tif (part_info->PartitionStyle == PARTITION_STYLE_GPT) {\n\t\tSTATIC_ASSERT(sizeof(part_info->Gpt.PartitionId) ==\n\t\t\t      sizeof(drive_info->Gpt.DiskId));\n\t\tif (!memcmp(&part_info->Gpt.PartitionId,\n\t\t\t    &drive_info->Gpt.DiskId,\n\t\t\t    sizeof(drive_info->Gpt.DiskId)))\n\t\t{\n\t\t\tERROR(\"\\\"%ls\\\", \\\"%ls\\\": Partition GUID is the \"\n\t\t\t      \"same as the disk GUID???\", vol_name, disk_name);\n\t\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\tif (part_info->PartitionStyle != PARTITION_STYLE_MBR &&\n\t    part_info->PartitionStyle != PARTITION_STYLE_GPT)\n\t{\n\t\tERROR(\"\\\"%ls\\\": Unknown partition style 0x%08\"PRIx32,\n\t\t      vol_name, (u32)part_info->PartitionStyle);\n\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\tgoto out;\n\t}\n\n\tret = 0;\nout:\n\tFREE(extents);\n\tFREE(drive_info);\n\tif (h != INVALID_HANDLE_VALUE)\n\t\tCloseHandle(h);\n\treturn ret;\n}\n\n/*\n * Calculate the size of WimOverlay.dat with one entry added.\n *\n * @old_hdr\n *\tPrevious WimOverlay.dat contents, or NULL if file did not exist.\n * @new_entry_2_size\n *\tSize of entry_2 being added.\n * @size_ret\n *\tSize will be returned here.\n *\n * Returns 0 on success, or WIMLIB_ERR_UNSUPPORTED if size overflows 32 bits.\n */\nstatic int\ncalculate_wimoverlay_dat_size(const struct WimOverlay_dat_header *old_hdr,\n\t\t\t      u32 new_entry_2_size, u32 *size_ret)\n{\n\tu64 size_64;\n\tu32 size;\n\n\tsize_64 = sizeof(struct WimOverlay_dat_header);\n\tif (old_hdr) {\n\t\tfor (u32 i = 0; i < old_hdr->num_entries; i++) {\n\t\t\tsize_64 += sizeof(struct WimOverlay_dat_entry_1);\n\t\t\tsize_64 += old_hdr->entry_1s[i].entry_2_length;\n\t\t}\n\t}\n\tsize_64 += sizeof(struct WimOverlay_dat_entry_1);\n\tsize_64 += new_entry_2_size;\n\n\tsize = size_64;\n\tif (size_64 != size)\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\n\t*size_ret = size;\n\treturn 0;\n}\n\n/*\n * Writes @size bytes of @contents to the named file @path.\n *\n * Returns 0 on success; WIMLIB_ERR_OPEN or WIMLIB_ERR_WRITE on failure.\n */\nstatic int\nwrite_wimoverlay_dat(const wchar_t *path, const void *contents, u32 size)\n{\n\tHANDLE h;\n\tDWORD bytes_written;\n\n\th = CreateFile(path, GENERIC_WRITE, 0, NULL,\n\t\t       CREATE_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);\n\tif (h == INVALID_HANDLE_VALUE) {\n\t\twin32_error(GetLastError(),\n\t\t\t    L\"\\\"%ls\\\": Can't open file for writing\", path);\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\n\tSetLastError(0);\n\tif (!WriteFile(h, contents, size, &bytes_written, NULL) ||\n\t    bytes_written != size)\n\t{\n\t\twin32_error(GetLastError(),\n\t\t\t    L\"\\\"%ls\\\": Can't write file\", path);\n\t\tCloseHandle(h);\n\t\treturn WIMLIB_ERR_WRITE;\n\t}\n\n\tif (!CloseHandle(h)) {\n\t\twin32_error(GetLastError(),\n\t\t\t    L\"\\\"%ls\\\": Can't close handle\", path);\n\t\treturn WIMLIB_ERR_WRITE;\n\t}\n\n\treturn 0;\n}\n\n/*\n * Generates the contents of WimOverlay.dat in memory, with one entry added.\n *\n * @buf\n *\tBuffer large enough to hold the new contents.\n * @old_hdr\n *\tOld contents of WimOverlay.dat, or NULL if it did not exist.\n * @wim_path\n *\tAbsolute path to the WIM file.  It must begin with a drive letter; for\n *\texample, D:\\install.wim.\n * @wim_guid\n *\tGUID of the WIM, from the WIM header.\n * @image\n *\tNumber of the image in the WIM to specify in the new entry.\n * @new_data_source_id\n *\tData source ID to use for the new entry.\n * @part_info\n *\tPartition information for the WIM file.\n * @disk_info\n *\tDisk information for the WIM file.\n * @new_entry_2_size\n *\tSize, in bytes, of the new location information structure ('struct\n *\tWimOverlay_dat_entry_2').\n *\n * Returns a pointer one past the last byte of @buf filled in.\n */\nstatic u8 *\nfill_in_wimoverlay_dat(u8 *buf,\n\t\t       const struct WimOverlay_dat_header *old_hdr,\n\t\t       const wchar_t *wim_path,\n\t\t       const u8 wim_guid[GUID_SIZE],\n\t\t       int image,\n\t\t       u64 new_data_source_id,\n\t\t       const PARTITION_INFORMATION_EX *part_info,\n\t\t       const DRIVE_LAYOUT_INFORMATION_EX *disk_info,\n\t\t       u32 new_entry_2_size)\n{\n\tstruct WimOverlay_dat_header *new_hdr;\n\tstruct WimOverlay_dat_entry_1 *new_entry_1;\n\tstruct WimOverlay_dat_entry_2 *new_entry_2;\n\tu32 entry_2_offset;\n\tu8 *p = buf;\n\n\tnew_hdr = (struct WimOverlay_dat_header *)p;\n\n\t/* Fill in new header  */\n\tnew_hdr->magic = WIMOVERLAY_DAT_MAGIC;\n\tnew_hdr->wim_provider_version = WIM_PROVIDER_CURRENT_VERSION;\n\tnew_hdr->unknown_0x08 = 0x00000028;\n\tnew_hdr->num_entries = (old_hdr ? old_hdr->num_entries : 0) + 1;\n\tnew_hdr->next_data_source_id = (old_hdr ? old_hdr->next_data_source_id : 0) + 1;\n\n\tp += sizeof(struct WimOverlay_dat_header);\n\n\t/* Copy WIM-specific information for old entries  */\n\tentry_2_offset = sizeof(struct WimOverlay_dat_header) +\n\t\t\t(new_hdr->num_entries * sizeof(struct WimOverlay_dat_entry_1));\n\tif (old_hdr) {\n\t\tfor (u32 i = 0; i < old_hdr->num_entries; i++) {\n\t\t\tnew_entry_1 = (struct WimOverlay_dat_entry_1 *)p;\n\n\t\t\tp = mempcpy(p, &old_hdr->entry_1s[i],\n\t\t\t\t    sizeof(struct WimOverlay_dat_entry_1));\n\n\t\t\tnew_entry_1->entry_2_offset = entry_2_offset;\n\t\t\tentry_2_offset += new_entry_1->entry_2_length;\n\t\t}\n\t}\n\n\t/* Generate WIM-specific information for new entry  */\n\tnew_entry_1 = (struct WimOverlay_dat_entry_1 *)p;\n\n\tnew_entry_1->data_source_id = new_data_source_id;\n\tnew_entry_1->entry_2_offset = entry_2_offset;\n\tnew_entry_1->entry_2_length = new_entry_2_size;\n\tnew_entry_1->wim_type = WIM_BOOT_NOT_OS_WIM;\n\tnew_entry_1->wim_index = image;\n\tSTATIC_ASSERT(sizeof(new_entry_1->guid) == GUID_SIZE);\n\tcopy_guid(new_entry_1->guid, wim_guid);\n\n\tp += sizeof(struct WimOverlay_dat_entry_1);\n\n\t/* Copy WIM location information for old entries  */\n\tif (old_hdr) {\n\t\tfor (u32 i = 0; i < old_hdr->num_entries; i++) {\n\t\t\twimlib_assert(new_hdr->entry_1s[i].entry_2_offset == p - buf);\n\t\t\twimlib_assert(old_hdr->entry_1s[i].entry_2_length ==\n\t\t\t\t      new_hdr->entry_1s[i].entry_2_length);\n\t\t\tp = mempcpy(p,\n\t\t\t\t    ((const u8 *)old_hdr + old_hdr->entry_1s[i].entry_2_offset),\n\t\t\t\t    old_hdr->entry_1s[i].entry_2_length);\n\t\t}\n\t}\n\n\t/* Generate WIM location information for new entry  */\n\tnew_entry_2 = (struct WimOverlay_dat_entry_2 *)p;\n\n\tnew_entry_2->unknown_0x00 = 0x00000000;\n\tnew_entry_2->unknown_0x04 = 0x00000000;\n\tnew_entry_2->entry_2_length = new_entry_2_size;\n\tnew_entry_2->unknown_0x0C = 0x00000000;\n\tnew_entry_2->unknown_0x10 = 0x00000005;\n\tnew_entry_2->unknown_0x14 = 0x00000001;\n\tnew_entry_2->inner_struct_size = new_entry_2_size - 0x14;\n\tnew_entry_2->unknown_0x1C = 0x00000005;\n\tnew_entry_2->unknown_0x20 = 0x00000006;\n\tnew_entry_2->unknown_0x24 = 0x00000000;\n\tnew_entry_2->unknown_0x28 = 0x00000048;\n\tnew_entry_2->unknown_0x2C = 0x00000000;\n\tnew_entry_2->unknown_0x40 = 0x00000000;\n\n\tif (part_info->PartitionStyle == PARTITION_STYLE_MBR) {\n\t\tnew_entry_2->partition.mbr.part_start_offset = part_info->StartingOffset.QuadPart;\n\t\tnew_entry_2->partition.mbr.padding = 0;\n\t\tnew_entry_2->partition_table_type = WIMOVERLAY_PARTITION_TYPE_MBR;\n\t\tnew_entry_2->disk.mbr.disk_id = disk_info->Mbr.Signature;\n\t\tnew_entry_2->disk.mbr.padding[0] = 0x00000000;\n\t\tnew_entry_2->disk.mbr.padding[1] = 0x00000000;\n\t\tnew_entry_2->disk.mbr.padding[2] = 0x00000000;\n\t} else {\n\t\tSTATIC_ASSERT(sizeof(new_entry_2->partition.gpt.part_unique_guid) ==\n\t\t\t      sizeof(part_info->Gpt.PartitionId));\n\t\tmemcpy(new_entry_2->partition.gpt.part_unique_guid,\n\t\t       &part_info->Gpt.PartitionId,\n\t\t       sizeof(part_info->Gpt.PartitionId));\n\t\tnew_entry_2->partition_table_type = WIMOVERLAY_PARTITION_TYPE_GPT;\n\n\t\tSTATIC_ASSERT(sizeof(new_entry_2->disk.gpt.disk_guid) ==\n\t\t\t      sizeof(disk_info->Gpt.DiskId));\n\t\tmemcpy(new_entry_2->disk.gpt.disk_guid,\n\t\t       &disk_info->Gpt.DiskId,\n\t\t       sizeof(disk_info->Gpt.DiskId));\n\n\t\tSTATIC_ASSERT(sizeof(new_entry_2->disk.gpt.disk_guid) ==\n\t\t\t      sizeof(new_entry_2->partition.gpt.part_unique_guid));\n\t}\n\tnew_entry_2->unknown_0x58[0] = 0x00000000;\n\tnew_entry_2->unknown_0x58[1] = 0x00000000;\n\tnew_entry_2->unknown_0x58[2] = 0x00000000;\n\tnew_entry_2->unknown_0x58[3] = 0x00000000;\n\n\twimlib_assert(wim_path[2] == L'\\\\');\n\treturn mempcpy(new_entry_2->wim_file_name,\n\t\t       wim_path + 2,\n\t\t       new_entry_2_size - sizeof(struct WimOverlay_dat_entry_2));\n}\n\n/*\n * Prepares the new contents of WimOverlay.dat in memory, with one entry added.\n *\n * @old_hdr\n *\tOld contents of WimOverlay.dat, or NULL if it did not exist.\n * @wim_path\n *\tAbsolute path to the WIM file.  It must begin with a drive letter; for\n *\texample, D:\\install.wim.\n * @wim_guid\n *\tGUID of the WIM, from the WIM header.\n * @image\n *\tNumber of the image in the WIM to specify in the new entry.\n * @new_contents_ret\n *\tLocation into which to return the new contents as a malloc()ed buffer on\n *\tsuccess.\n * @new_contents_size_ret\n *\tLocation into which to return the size, in bytes, of the new contents on\n *\tsuccess.\n * @new_data_source_id_ret\n *\tLocation into which to return the data source ID of the new entry on\n *\tsuccess.\n *\n * Returns 0 on success, or a positive error code on failure.\n */\nstatic int\nprepare_wimoverlay_dat(const struct WimOverlay_dat_header *old_hdr,\n\t\t       const wchar_t *wim_path,\n\t\t       const u8 wim_guid[GUID_SIZE],\n\t\t       int image,\n\t\t       void **new_contents_ret,\n\t\t       u32 *new_contents_size_ret,\n\t\t       u64 *new_data_source_id_ret)\n{\n\tint ret;\n\tPARTITION_INFORMATION_EX part_info;\n\tDRIVE_LAYOUT_INFORMATION_EX disk_info;\n\tu64 new_data_source_id;\n\tu32 new_entry_2_size;\n\tu32 new_contents_size;\n\tu8 *buf;\n\tu8 *end;\n\n\tret = query_partition_and_disk_info(wim_path, &part_info, &disk_info);\n\tif (ret)\n\t\treturn ret;\n\n\tnew_data_source_id = old_hdr ? old_hdr->next_data_source_id : 0;\n\n\tnew_entry_2_size = sizeof(struct WimOverlay_dat_entry_2) +\n\t\t\t\t((wcslen(wim_path) - 2 + 1) * sizeof(wchar_t));\n\tret = calculate_wimoverlay_dat_size(old_hdr, new_entry_2_size,\n\t\t\t\t\t    &new_contents_size);\n\tif (ret)\n\t\treturn ret;\n\n\tbuf = MALLOC(new_contents_size);\n\tif (!buf)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\tend = fill_in_wimoverlay_dat(buf, old_hdr, wim_path, wim_guid, image,\n\t\t\t\t     new_data_source_id,\n\t\t\t\t     &part_info, &disk_info, new_entry_2_size);\n\n\twimlib_assert(end - buf == new_contents_size);\n\n\t*new_contents_ret = buf;\n\t*new_contents_size_ret = new_contents_size;\n\t*new_data_source_id_ret = new_data_source_id;\n\treturn 0;\n}\n\nstatic bool\nvalid_wim_filename(const struct WimOverlay_dat_entry_2 *entry, size_t name_len)\n{\n\tsize_t i;\n\n\tif (name_len % sizeof(wchar_t))\n\t\treturn false;\n\tname_len /= sizeof(wchar_t);\n\tif (name_len < 2)\n\t\treturn false;\n\tfor (i = 0; i < name_len && entry->wim_file_name[i] != 0; i++)\n\t\t;\n\treturn i == name_len - 1;\n}\n\n/*\n * Reads and validates a WimOverlay.dat file.\n *\n * @path\n *\tPath to the WimOverlay.dat file, such as\n *\tC:\\System Volume Information\\WimOverlay.dat\n * @contents_ret\n *\tLocation into which to return the contents as a malloc()ed buffer on\n *\tsuccess.  This can be cast to 'struct WimOverlay_dat_header', and its\n *\tcontents are guaranteed to be valid.  Alternatively, if the file does\n *\tnot exist, NULL will be returned here.\n *\n * Returns 0 on success, or a positive error code on failure.\n */\nstatic int\nread_wimoverlay_dat(const wchar_t *path, void **contents_ret)\n{\n\tHANDLE h;\n\tBY_HANDLE_FILE_INFORMATION info;\n\tint ret;\n\tvoid *contents;\n\tconst struct WimOverlay_dat_header *hdr;\n\tDWORD bytes_read;\n\tbool already_retried = false;\n\nretry:\n\th = open_file(path, GENERIC_READ);\n\tif (h == INVALID_HANDLE_VALUE) {\n\t\tDWORD err = GetLastError();\n\t\tif (err == ERROR_FILE_NOT_FOUND) {\n\t\t\t*contents_ret = NULL;\n\t\t\treturn 0;\n\t\t}\n\t\tif (err == ERROR_PATH_NOT_FOUND &&\n\t\t    func_RtlCreateSystemVolumeInformationFolder)\n\t\t{\n\t\t\twchar_t volume_root_path[] = L\"\\\\??\\\\X:\\\\\";\n\n\t\t\t*(wcschr(volume_root_path, L'X')) = path[0];\n\n\t\t\tUNICODE_STRING str = {\n\t\t\t\t.Length = sizeof(volume_root_path) - sizeof(wchar_t),\n\t\t\t\t.MaximumLength = sizeof(volume_root_path),\n\t\t\t\t.Buffer = volume_root_path,\n\t\t\t};\n\t\t\tNTSTATUS status;\n\t\t\tDWORD err2;\n\n\t\t\tstatus = (*func_RtlCreateSystemVolumeInformationFolder)(&str);\n\n\t\t\terr2 = RtlNtStatusToDosError(status);\n\t\t\tif (err2 == ERROR_SUCCESS) {\n\t\t\t\tif (!already_retried) {\n\t\t\t\t\talready_retried = true;\n\t\t\t\t\tgoto retry;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\terr = err2;\n\t\t\t}\n\t\t}\n\t\twin32_error(err, L\"\\\"%ls\\\": Can't open for reading\", path);\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\tif (!GetFileInformationByHandle(h, &info)) {\n\t\twin32_error(GetLastError(), L\"\\\"%ls\\\": Can't query metadata\", path);\n\t\tCloseHandle(h);\n\t\treturn WIMLIB_ERR_STAT;\n\t}\n\n\tcontents = NULL;\n\tif (!info.nFileSizeHigh)\n\t\tcontents = MALLOC(info.nFileSizeLow);\n\tif (!contents) {\n\t\tERROR(\"\\\"%ls\\\": File is too large to fit into memory\", path);\n\t\tCloseHandle(h);\n\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\tSetLastError(0);\n\tif (!ReadFile(h, contents, info.nFileSizeLow, &bytes_read, NULL) ||\n\t    bytes_read != info.nFileSizeLow)\n\t{\n\t\twin32_error(GetLastError(), L\"\\\"%ls\\\": Can't read data\", path);\n\t\tCloseHandle(h);\n\t\tret = WIMLIB_ERR_READ;\n\t\tgoto out_free_contents;\n\t}\n\n\tCloseHandle(h);\n\n\tif (info.nFileSizeLow < sizeof(struct WimOverlay_dat_header)) {\n\t\tERROR(\"\\\"%ls\\\": File is unexpectedly small (only %\"PRIu32\" bytes)\",\n\t\t      path, (u32)info.nFileSizeLow);\n\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\tgoto out_free_contents;\n\t}\n\n\thdr = (const struct WimOverlay_dat_header *)contents;\n\n\tif (hdr->magic != WIMOVERLAY_DAT_MAGIC ||\n\t    hdr->wim_provider_version != WIM_PROVIDER_CURRENT_VERSION ||\n\t    hdr->unknown_0x08 != 0x00000028)\n\t{\n\t\tERROR(\"\\\"%ls\\\": Header contains unexpected data:\", path);\n\t\tif (wimlib_print_errors) {\n\t\t\tprint_byte_field((const u8 *)hdr,\n\t\t\t\t\t sizeof(struct WimOverlay_dat_header),\n\t\t\t\t\t wimlib_error_file);\n\t\t\tfputc('\\n', wimlib_error_file);\n\t\t}\n\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\tgoto out_free_contents;\n\t}\n\n\tif ((u64)hdr->num_entries * sizeof(struct WimOverlay_dat_entry_1) >\n\t    info.nFileSizeLow - sizeof(struct WimOverlay_dat_header))\n\t{\n\t\tERROR(\"\\\"%ls\\\": File is unexpectedly small \"\n\t\t      \"(only %\"PRIu32\" bytes, but has %\"PRIu32\" entries)\",\n\t\t      path, (u32)info.nFileSizeLow, hdr->num_entries);\n\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\tgoto out_free_contents;\n\t}\n\n\tfor (u32 i = 0; i < hdr->num_entries; i++) {\n\t\tconst struct WimOverlay_dat_entry_1 *entry_1;\n\t\tconst struct WimOverlay_dat_entry_2 *entry_2;\n\t\tu32 wim_file_name_length;\n\n\t\tentry_1 = &hdr->entry_1s[i];\n\n\t\tif (entry_1->data_source_id >= hdr->next_data_source_id) {\n\t\t\tERROR(\"\\\"%ls\\\": value of next_data_source_id \"\n\t\t\t      \"(0x%016\"PRIx64\") is unexpected, since entry \"\n\t\t\t      \"%\"PRIu32\" has data source ID 0x%016\"PRIx64,\n\t\t\t      path, hdr->next_data_source_id,\n\t\t\t      i, entry_1->data_source_id);\n\t\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\t\tgoto out_free_contents;\n\t\t}\n\n\t\tif (((u64)entry_1->entry_2_offset +\n\t\t     (u64)entry_1->entry_2_length) >\n\t\t    info.nFileSizeLow)\n\t\t{\n\t\t\tERROR(\"\\\"%ls\\\": entry %\"PRIu32\" (2) \"\n\t\t\t      \"(data source ID 0x%016\"PRIx64\") \"\n\t\t\t      \"overflows file\",\n\t\t\t      path, i, entry_1->data_source_id);\n\t\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\t\tgoto out_free_contents;\n\t\t}\n\t\tif (entry_1->entry_2_length < sizeof(struct WimOverlay_dat_entry_2)) {\n\t\t\tERROR(\"\\\"%ls\\\": entry %\"PRIu32\" (2) \"\n\t\t\t      \"(data source ID 0x%016\"PRIx64\") \"\n\t\t\t      \"is too short\",\n\t\t\t      path, i, entry_1->data_source_id);\n\t\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\t\tgoto out_free_contents;\n\t\t}\n\n\t\tif (entry_1->entry_2_offset % 2 != 0) {\n\t\t\tERROR(\"\\\"%ls\\\": entry %\"PRIu32\" (2) \"\n\t\t\t      \"(data source ID 0x%016\"PRIx64\") \"\n\t\t\t      \"is misaligned\",\n\t\t\t      path, i, entry_1->data_source_id);\n\t\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\t\tgoto out_free_contents;\n\t\t}\n\n\t\tentry_2 = (const struct WimOverlay_dat_entry_2 *)\n\t\t\t\t((const u8 *)hdr + entry_1->entry_2_offset);\n\n\t\twim_file_name_length = entry_1->entry_2_length -\n\t\t\t\t\tsizeof(struct WimOverlay_dat_entry_2);\n\t\tif (!valid_wim_filename(entry_2, wim_file_name_length)) {\n\t\t\tERROR(\"\\\"%ls\\\": entry %\"PRIu32\" (2) \"\n\t\t\t      \"(data source ID 0x%016\"PRIx64\") \"\n\t\t\t      \"has invalid WIM file name\",\n\t\t\t      path, i, entry_1->data_source_id);\n\t\t\tif (wimlib_print_errors) {\n\t\t\t\tprint_byte_field((const u8 *)entry_2->wim_file_name,\n\t\t\t\t\t\t wim_file_name_length,\n\t\t\t\t\t\t wimlib_error_file);\n\t\t\t\tfputc('\\n', wimlib_error_file);\n\t\t\t}\n\t\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\t\tgoto out_free_contents;\n\t\t}\n\n\t\tif (entry_2->unknown_0x00 != 0x00000000 ||\n\t\t    entry_2->unknown_0x04 != 0x00000000 ||\n\t\t    entry_2->unknown_0x0C != 0x00000000 ||\n\t\t    entry_2->entry_2_length != entry_1->entry_2_length ||\n\t\t    entry_2->unknown_0x10 != 0x00000005 ||\n\t\t    entry_2->unknown_0x14 != 0x00000001 ||\n\t\t    entry_2->inner_struct_size != entry_1->entry_2_length - 0x14 ||\n\t\t    entry_2->unknown_0x1C != 0x00000005 ||\n\t\t    entry_2->unknown_0x20 != 0x00000006 ||\n\t\t    entry_2->unknown_0x24 != 0x00000000 ||\n\t\t    entry_2->unknown_0x28 != 0x00000048 ||\n\t\t    entry_2->unknown_0x2C != 0x00000000 ||\n\t\t    entry_2->unknown_0x40 != 0x00000000 ||\n\t\t    (entry_2->partition_table_type != WIMOVERLAY_PARTITION_TYPE_GPT &&\n\t\t     entry_2->partition_table_type != WIMOVERLAY_PARTITION_TYPE_MBR) ||\n\t\t    (entry_2->partition_table_type == WIMOVERLAY_PARTITION_TYPE_MBR &&\n\t\t     entry_2->partition.mbr.padding != 0) ||\n\t\t    (entry_2->partition_table_type == WIMOVERLAY_PARTITION_TYPE_GPT &&\n\t\t     entry_2->partition.mbr.padding == 0) ||\n\t\t    entry_2->unknown_0x58[0] != 0x00000000 ||\n\t\t    entry_2->unknown_0x58[1] != 0x00000000 ||\n\t\t    entry_2->unknown_0x58[2] != 0x00000000 ||\n\t\t    entry_2->unknown_0x58[3] != 0x00000000)\n\t\t{\n\t\t\tERROR(\"\\\"%ls\\\": entry %\"PRIu32\" (2) \"\n\t\t\t      \"(data source ID 0x%016\"PRIx64\") \"\n\t\t\t      \"contains unexpected data!\",\n\t\t\t      path, i, entry_1->data_source_id);\n\t\t\tif (wimlib_print_errors) {\n\t\t\t\tprint_byte_field((const u8 *)entry_2,\n\t\t\t\t\t\t entry_1->entry_2_length,\n\t\t\t\t\t\t wimlib_error_file);\n\t\t\t\tfputc('\\n', wimlib_error_file);\n\t\t\t}\n\t\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\t\tgoto out_free_contents;\n\t\t}\n\t}\n\n\t*contents_ret = contents;\n\treturn 0;\n\nout_free_contents:\n\tFREE(contents);\n\treturn ret;\n}\n\n/*\n * Update WimOverlay.dat manually in order to add a WIM data source to the\n * target volume.\n *\n * THIS CODE IS EXPERIMENTAL AS I HAD TO REVERSE ENGINEER THE FILE FORMAT!\n *\n * @path\n *\tTarget drive.  Must be a letter followed by a colon (e.g. D:).\n * @wim_path\n *\tAbsolute path to the WIM file.  It must begin with a drive letter; for\n *\texample, D:\\install.wim.\n * @wim_guid\n *\tGUID of the WIM, from the WIM header.\n * @image\n *\tNumber of the image in the WIM to specify in the new entry.\n * @data_source_id_ret\n *\tOn success, the allocated data source ID is returned here.\n */\nstatic int\nupdate_wimoverlay_manually(const wchar_t *drive, const wchar_t *wim_path,\n\t\t\t   const u8 wim_guid[GUID_SIZE],\n\t\t\t   int image, u64 *data_source_id_ret)\n{\n\twchar_t path_main[] = L\"A:\\\\System Volume Information\\\\WimOverlay.dat\";\n\twchar_t path_backup[] = L\"A:\\\\System Volume Information\\\\WimOverlay.backup\";\n\twchar_t path_wimlib_backup[] = L\"A:\\\\System Volume Information\\\\WimOverlay.wimlib_backup\";\n\twchar_t path_new[] = L\"A:\\\\System Volume Information\\\\WimOverlay.wimlib_new\";\n\tvoid *old_contents = NULL;\n\tvoid *new_contents = NULL;\n\tu32 new_contents_size = 0;\n\tu64 new_data_source_id = -1;\n\tint ret;\n\n\twimlib_assert(drive[0] != L'\\0' &&\n\t\t      drive[1] == L':' &&\n\t\t      drive[2] == L'\\0');\n\n\tpath_main[0]          = drive[0];\n\tpath_backup[0]        = drive[0];\n\tpath_wimlib_backup[0] = drive[0];\n\tpath_new[0]           = drive[0];\n\n\tret = read_wimoverlay_dat(path_main, &old_contents);\n\tif (ret)\n\t\tgoto out;\n\n\t// coverity[tainted_data]\n\tret = prepare_wimoverlay_dat(old_contents, wim_path, wim_guid, image,\n\t\t\t\t     &new_contents, &new_contents_size,\n\t\t\t\t     &new_data_source_id);\n\tFREE(old_contents);\n\tif (ret)\n\t\tgoto out;\n\n\t/* Write WimOverlay.wimlib_new  */\n\tret = write_wimoverlay_dat(path_new,\n\t\t\t\t   new_contents, new_contents_size);\n\tif (ret)\n\t\tgoto out_free_new_contents;\n\n\t/* Write WimOverlay.backup  */\n\tret = write_wimoverlay_dat(path_backup,\n\t\t\t\t   new_contents, new_contents_size);\n\tif (ret)\n\t\tgoto out_free_new_contents;\n\n\tif (old_contents) {\n\t\t/* Rename WimOverlay.dat => WimOverlay.wimlib_backup  */\n\t\tret = win32_rename_replacement(path_main, path_wimlib_backup);\n\t\tif (ret) {\n\t\t\tERROR_WITH_ERRNO(\"Can't rename \\\"%ls\\\" => \\\"%ls\\\"\",\n\t\t\t\t\t path_main, path_wimlib_backup);\n\t\t\tret = WIMLIB_ERR_RENAME;\n\t\t\tgoto out_free_new_contents;\n\t\t}\n\t}\n\n\t/* Rename WimOverlay.wimlib_new => WimOverlay.dat  */\n\tret = win32_rename_replacement(path_new, path_main);\n\tif (ret) {\n\t\tERROR_WITH_ERRNO(\"Can't rename \\\"%ls\\\" => \\\"%ls\\\"\",\n\t\t\t\t path_new, path_main);\n\t\tret = WIMLIB_ERR_RENAME;\n\t}\nout_free_new_contents:\n\tFREE(new_contents);\nout:\n\tif (ret == WIMLIB_ERR_UNSUPPORTED) {\n\t\tERROR(\"Please report to developer (\"PACKAGE_BUGREPORT\").\\n\"\n\t\t      \"        If possible send the file \\\"%ls\\\".\\n\\n\", path_main);\n\t}\n\tif (ret == 0)\n\t\t*data_source_id_ret = new_data_source_id;\n\treturn ret;\n}\n\n/*\n * Allocate a WOF data source ID for a WIM file.\n *\n * @wim_path\n *\tAbsolute path to the WIM file.  This must include a drive letter and use\n *\tbackslash path separators.\n * @wim_guid\n *\tGUID of the WIM, from the WIM header.\n * @image\n *\tNumber of the image in the WIM being applied.\n * @target\n *\tPath to the target directory.\n * @data_source_id_ret\n *\tOn success, an identifier for the backing WIM file will be returned\n *\there.\n *\n * Returns 0 on success, or a positive error code on failure.\n */\nint\nwimboot_alloc_data_source_id(const wchar_t *wim_path,\n\t\t\t     const u8 wim_guid[GUID_SIZE],\n\t\t\t     int image, const wchar_t *target,\n\t\t\t     u64 *data_source_id_ret, bool *wof_running_ret)\n{\n\ttchar drive_path[7];\n\tsize_t wim_path_nchars;\n\tsize_t wim_file_name_length;\n\tvoid *in;\n\tsize_t insize;\n\tWOF_EXTERNAL_INFO *wof_info;\n\tWIM_PROVIDER_ADD_OVERLAY_INPUT *wim_info;\n\twchar_t *WimFileName;\n\tHANDLE h;\n\tu64 data_source_id;\n\tDWORD bytes_returned;\n\tint ret;\n\tconst wchar_t *prefix = L\"\\\\??\\\\\";\n\tconst size_t prefix_nchars = 4;\n\tbool tried_to_attach_wof = false;\n\n\tret = win32_get_drive_path(target, drive_path);\n\tif (ret)\n\t\treturn ret;\n\n\twimlib_assert(!wcschr(wim_path, L'/'));\n\twimlib_assert(wim_path[0] != L'\\0' && wim_path[1] == L':');\n\n\twim_path_nchars = wcslen(wim_path);\n\twim_file_name_length = sizeof(wchar_t) *\n\t\t\t       (wim_path_nchars + prefix_nchars);\n\n\tinsize = sizeof(*wof_info) + sizeof(*wim_info) + wim_file_name_length;\n\tin = CALLOC(1, insize);\n\tif (!in) {\n\t\tret = WIMLIB_ERR_NOMEM;\n\t\tgoto out;\n\t}\n\n\twof_info = (WOF_EXTERNAL_INFO *)in;\n\twof_info->Version = WOF_CURRENT_VERSION;\n\twof_info->Provider = WOF_PROVIDER_WIM;\n\n\twim_info = (WIM_PROVIDER_ADD_OVERLAY_INPUT *)(wof_info + 1);\n\twim_info->WimType = WIM_BOOT_NOT_OS_WIM;\n\twim_info->WimIndex = image;\n\twim_info->WimFileNameOffset = sizeof(*wim_info);\n\twim_info->WimFileNameLength = wim_file_name_length;\n\tWimFileName = (wchar_t *)(wim_info + 1);\n\twmemcpy(WimFileName, prefix, prefix_nchars);\n\twmemcpy(&WimFileName[prefix_nchars], wim_path, wim_path_nchars);\n\nretry_ioctl:\n\th = open_file(drive_path, GENERIC_WRITE);\n\n\tif (h == INVALID_HANDLE_VALUE) {\n\t\twin32_error(GetLastError(),\n\t\t\t    L\"Failed to open \\\"%ls\\\"\", drive_path + 4);\n\t\tret = WIMLIB_ERR_OPEN;\n\t\tgoto out_free_in;\n\t}\n\n\tif (!DeviceIoControl(h, FSCTL_ADD_OVERLAY,\n\t\t\t     in, insize,\n\t\t\t     &data_source_id, sizeof(data_source_id),\n\t\t\t     &bytes_returned, NULL))\n\t{\n\t\tDWORD err = GetLastError();\n\t\tif (err == ERROR_INVALID_FUNCTION) {\n\t\t\tif (!tried_to_attach_wof) {\n\t\t\t\tCloseHandle(h);\n\t\t\t\th = INVALID_HANDLE_VALUE;\n\t\t\t\ttried_to_attach_wof = true;\n\t\t\t\tif (win32_try_to_attach_wof(drive_path + 4))\n\t\t\t\t\tgoto retry_ioctl;\n\t\t\t}\n\t\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\t\tgoto out_close_handle;\n\t\t} else {\n\t\t\twin32_error(err, L\"Failed to add overlay source \\\"%ls\\\" \"\n\t\t\t\t    \"to volume \\\"%ls\\\"\", wim_path, drive_path + 4);\n\t\t\tret = WIMLIB_ERR_WIMBOOT;\n\t\t\tgoto out_close_handle;\n\t\t}\n\t}\n\n\tif (bytes_returned != sizeof(data_source_id)) {\n\t\tret = WIMLIB_ERR_WIMBOOT;\n\t\tERROR(\"Unexpected result size when adding \"\n\t\t      \"overlay source \\\"%ls\\\" to volume \\\"%ls\\\"\",\n\t\t      wim_path, drive_path + 4);\n\t\tgoto out_close_handle;\n\t}\n\n\t*wof_running_ret = true;\n\t*data_source_id_ret = data_source_id;\n\tret = 0;\n\nout_close_handle:\n\tCloseHandle(h);\nout_free_in:\n\tFREE(in);\nout:\n\tif (ret == WIMLIB_ERR_UNSUPPORTED) {\n\t\tWARNING(\"WOF driver is not available; updating WimOverlay.dat directly.\");\n\t\tret = update_wimoverlay_manually(drive_path + 4, wim_path,\n\t\t\t\t\t\t wim_guid, image,\n\t\t\t\t\t\t data_source_id_ret);\n\t\t*wof_running_ret = false;\n\t}\n\treturn ret;\n}\n\n\n/*\n * Set WIMBoot information on the specified file.\n *\n * This turns it into a reparse point that redirects accesses to it, to the\n * corresponding resource in the WIM archive.\n *\n * @h\n *\tOpen handle to the file, with GENERIC_WRITE access.\n * @blob\n *\tThe blob for the unnamed data stream of the file.\n * @data_source_id\n *\tAllocated identifier for the WIM data source on the destination volume.\n * @blob_table_hash\n *\tSHA-1 message digest of the WIM's blob table.\n * @wof_running\n *\t%true if the WOF driver appears to be available and working; %false if\n *\tnot.\n *\n * Returns %true on success, or %false on failure with GetLastError() set.\n */\nbool\nwimboot_set_pointer(HANDLE h,\n\t\t    const struct blob_descriptor *blob,\n\t\t    u64 data_source_id,\n\t\t    const u8 blob_table_hash[SHA1_HASH_SIZE],\n\t\t    bool wof_running)\n{\n\tDWORD bytes_returned;\n\n\tif (wof_running) {\n\t\t/* The WOF driver is running.  We can create the reparse point\n\t\t * using FSCTL_SET_EXTERNAL_BACKING.  */\n\t\tunsigned int max_retries = 4;\n\t\tstruct {\n\t\t\tWOF_EXTERNAL_INFO wof_info;\n\t\t\tWIM_PROVIDER_EXTERNAL_INFO wim_info;\n\t\t} in;\n\n\tretry:\n\t\tmemset(&in, 0, sizeof(in));\n\n\t\tin.wof_info.Version = WOF_CURRENT_VERSION;\n\t\tin.wof_info.Provider = WOF_PROVIDER_WIM;\n\n\t\tin.wim_info.Version = WIM_PROVIDER_CURRENT_VERSION;\n\t\tin.wim_info.Flags = 0;\n\t\tin.wim_info.DataSourceId.QuadPart = data_source_id;\n\t\tcopy_hash(in.wim_info.ResourceHash, blob->hash);\n\n\t\t/* blob_table_hash is not necessary  */\n\n\t\tif (!DeviceIoControl(h, FSCTL_SET_EXTERNAL_BACKING,\n\t\t\t\t     &in, sizeof(in), NULL, 0,\n\t\t\t\t     &bytes_returned, NULL))\n\t\t{\n\t\t\t/* Try to track down sporadic errors  */\n\t\t\tif (wimlib_print_errors) {\n\t\t\t\tWARNING(\"FSCTL_SET_EXTERNAL_BACKING failed (err=%u); data was %zu bytes:\",\n\t\t\t\t\t(u32)GetLastError(), sizeof(in));\n\t\t\t\tprint_byte_field((const u8 *)&in, sizeof(in), wimlib_error_file);\n\t\t\t\tputc('\\n', wimlib_error_file);\n\t\t\t}\n\t\t\tif (--max_retries) {\n\t\t\t\tWARNING(\"Retrying after 100ms...\");\n\t\t\t\tSleep(100);\n\t\t\t\tgoto retry;\n\t\t\t}\n\t\t\tWARNING(\"Too many retries; returning failure\");\n\t\t\treturn false;\n\t\t}\n\t} else {\n\n\t\t/* The WOF driver is running.  We need to create the reparse\n\t\t * point manually.  */\n\n\t\tstruct {\n\t\t\tstruct {\n\t\t\t\tle32 rptag;\n\t\t\t\tle16 rpdatalen;\n\t\t\t\tle16 rpreserved;\n\t\t\t} hdr;\n\t\t\tWOF_EXTERNAL_INFO wof_info;\n\t\t\tstruct wim_provider_rpdata wim_info;\n\t\t} in;\n\n\t\tSTATIC_ASSERT(sizeof(in) == 8 +\n\t\t\t      sizeof(WOF_EXTERNAL_INFO) +\n\t\t\t      sizeof(struct wim_provider_rpdata));\n\n\t\tin.hdr.rptag = WIM_IO_REPARSE_TAG_WOF;\n\t\tin.hdr.rpdatalen = sizeof(in) - sizeof(in.hdr);\n\t\tin.hdr.rpreserved = 0;\n\n\t\tin.wof_info.Version = WOF_CURRENT_VERSION;\n\t\tin.wof_info.Provider = WOF_PROVIDER_WIM;\n\n\t\tin.wim_info.version = 2;\n\t\tin.wim_info.flags = 0;\n\t\tin.wim_info.data_source_id = data_source_id;\n\t\tcopy_hash(in.wim_info.unnamed_data_stream_hash, blob->hash);\n\t\tcopy_hash(in.wim_info.blob_table_hash, blob_table_hash);\n\t\tin.wim_info.unnamed_data_stream_size = blob->size;\n\t\tin.wim_info.unnamed_data_stream_size_in_wim = blob->rdesc->size_in_wim;\n\t\tin.wim_info.unnamed_data_stream_offset_in_wim = blob->rdesc->offset_in_wim;\n\n\t\tif (!DeviceIoControl(h, FSCTL_SET_REPARSE_POINT,\n\t\t\t\t     &in, sizeof(in), NULL, 0, &bytes_returned, NULL))\n\t\t\treturn false;\n\n\t\t/* We also need to create an unnamed data stream of the correct\n\t\t * size.  Otherwise the file shows up as zero length.  It can be\n\t\t * a sparse stream containing all zeroes; its contents\n\t\t * are unimportant.  */\n\t\tif (!DeviceIoControl(h, FSCTL_SET_SPARSE, NULL, 0, NULL, 0,\n\t\t\t\t     &bytes_returned, NULL))\n\t\t\treturn false;\n\n\t\tif (!SetFilePointerEx(h,\n\t\t\t\t      (LARGE_INTEGER){ .QuadPart = blob->size},\n\t\t\t\t      NULL, FILE_BEGIN))\n\t\t\treturn false;\n\n\t\tif (!SetEndOfFile(h))\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n#endif /* _WIN32 */\n"
  },
  {
    "path": "src/wimlib/wimlib/alloca.h",
    "content": "#ifndef _WIMLIB_ALLOCA_H\n#define _WIMLIB_ALLOCA_H\n\n#ifdef HAVE_ALLOCA_H\n#  include <alloca.h>\n#else\n#  include <stdlib.h>\n#endif\n\n#endif /* _WIMLIB_ALLOCA_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/apply.h",
    "content": "#ifndef _WIMLIB_APPLY_H\n#define _WIMLIB_APPLY_H\n\n#include \"wimlib/compiler.h\"\n#include \"wimlib/file_io.h\"\n#include \"wimlib/list.h\"\n#include \"wimlib/progress.h\"\n#include \"wimlib/types.h\"\n#include \"wimlib.h\"\n\n/* These can be treated as counts (for required_features) or booleans (for\n * supported_features).  */\nstruct wim_features {\n\tunsigned long readonly_files;\n\tunsigned long hidden_files;\n\tunsigned long system_files;\n\tunsigned long archive_files;\n\tunsigned long compressed_files;\n\tunsigned long encrypted_files;\n\tunsigned long encrypted_directories;\n\tunsigned long not_context_indexed_files;\n\tunsigned long sparse_files;\n\tunsigned long named_data_streams;\n\tunsigned long hard_links;\n\tunsigned long reparse_points;\n\tunsigned long symlink_reparse_points;\n\tunsigned long other_reparse_points;\n\tunsigned long security_descriptors;\n\tunsigned long short_names;\n\tunsigned long unix_data;\n\tunsigned long object_ids;\n\tunsigned long timestamps;\n\tunsigned long case_sensitive_filenames;\n\tunsigned long xattrs;\n};\n\nstruct blob_descriptor;\nstruct read_blob_callbacks;\nstruct apply_operations;\nstruct wim_dentry;\n\nstruct apply_ctx {\n\t/* The WIMStruct from which files are being extracted from the currently\n\t * selected image.  */\n\tWIMStruct *wim;\n\n\t/* The target of the extraction, usually the path to a directory.  */\n\tconst tchar *target;\n\n\t/* Length of @target in tchars.  */\n\tsize_t target_nchars;\n\n\t/* Extraction flags (WIMLIB_EXTRACT_FLAG_*)  */\n\tint extract_flags;\n\n\t/* User-provided progress function, or NULL if not specified.  */\n\twimlib_progress_func_t progfunc;\n\tvoid *progctx;\n\n\t/* Progress data buffer, with progress.extract initialized.  */\n\tunion wimlib_progress_info progress;\n\n\t/* Features required to extract the files (with counts)  */\n\tstruct wim_features required_features;\n\n\t/* Features supported by the extraction mode (with booleans)  */\n\tstruct wim_features supported_features;\n\n\t/* The members below should not be used outside of extract.c  */\n\tconst struct apply_operations *apply_ops;\n\tu64 next_progress;\n\tunsigned long invalid_sequence;\n\tunsigned long num_blobs_remaining;\n\tstruct list_head blob_list;\n\tconst struct read_blob_callbacks *saved_cbs;\n\tstruct filedes tmpfile_fd;\n\ttchar *tmpfile_name;\n\tunsigned int count_until_file_progress;\n};\n\n/* Maximum number of UNIX file descriptors, NTFS attributes, or Windows file\n * handles that can be opened simultaneously to extract a blob to multiple\n * destinations.  */\n#ifndef __APPLE__\n#define MAX_OPEN_FILES 512\n#else /* !__APPLE__ */\n/* With macOS, reduce to 128 because the default value for ulimit -n is 256 */\n#define MAX_OPEN_FILES 128\n#endif /* __APPLE__ */\n\nstatic inline int\nextract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg)\n{\n\treturn call_progress(ctx->progfunc, msg, &ctx->progress, ctx->progctx);\n}\n\nint\ndo_file_extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg);\n\n#define COUNT_PER_FILE_PROGRESS 256\n\nstatic inline int\nmaybe_do_file_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg)\n{\n\tctx->progress.extract.current_file_count++;\n\tif (unlikely(!--ctx->count_until_file_progress))\n\t\treturn do_file_extract_progress(ctx, msg);\n\treturn 0;\n}\n\nint\nstart_file_structure_phase(struct apply_ctx *ctx, u64 end_file_count);\n\nint\nstart_file_metadata_phase(struct apply_ctx *ctx, u64 end_file_count);\n\n/* Report that a file was created, prior to blob extraction.  */\nstatic inline int\nreport_file_created(struct apply_ctx *ctx)\n{\n\treturn maybe_do_file_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE);\n}\n\n/* Report that file metadata was applied, after blob extraction.  */\nstatic inline int\nreport_file_metadata_applied(struct apply_ctx *ctx)\n{\n\treturn maybe_do_file_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_METADATA);\n}\n\nint\nend_file_structure_phase(struct apply_ctx *ctx);\n\nint\nend_file_metadata_phase(struct apply_ctx *ctx);\n\nstatic inline int\nreport_apply_error(struct apply_ctx *ctx, int error_code, const tchar *path)\n{\n\treturn report_error(ctx->progfunc, ctx->progctx, error_code, path);\n}\n\nbool\ndetect_sparse_region(const void *data, size_t size, size_t *len_ret);\n\nstatic inline bool\nmaybe_detect_sparse_region(const void *data, size_t size, size_t *len_ret,\n\t\t\t   bool enabled)\n{\n\tif (!enabled) {\n\t\t/* Force non-sparse without checking */\n\t\t*len_ret = size;\n\t\treturn false;\n\t}\n\treturn detect_sparse_region(data, size, len_ret);\n}\n\n#define inode_first_extraction_dentry(inode)\t\t\t\t\\\n\t((inode)->i_first_extraction_alias)\n\n#define inode_for_each_extraction_alias(dentry, inode)\t\t\t\\\n\tfor (dentry = inode_first_extraction_dentry(inode);\t\t\\\n\t     dentry != NULL;\t\t\t\t\t\t\\\n\t     dentry = dentry->d_next_extraction_alias)\n\nint\nextract_blob_list(struct apply_ctx *ctx, const struct read_blob_callbacks *cbs);\n\n/*\n * Represents an extraction backend.\n */\nstruct apply_operations {\n\n\t/* Name of the extraction backend.  */\n\tconst char *name;\n\n\t/*\n\t * Query the features supported by the extraction backend.\n\t *\n\t * @target\n\t *\tThe target string that was provided by the user.  (Often a\n\t *\tdirectory, but extraction backends are free to interpret this\n\t *\tdifferently.)\n\t *\n\t * @supported_features\n\t *\tA structure, each of whose members represents a feature that may\n\t *\tbe supported by the extraction backend.  For each feature that\n\t *\tthe extraction backend supports, this routine must set the\n\t *\tcorresponding member to a nonzero value.\n\t *\n\t * Return 0 if successful; otherwise a positive wimlib error code.\n\t */\n\tint (*get_supported_features)(const tchar *target,\n\t\t\t\t      struct wim_features *supported_features);\n\n\t/*\n\t * Main extraction routine.\n\t *\n\t * The extraction backend is provided a list of dentries that have been\n\t * prepared for extraction.  It is free to extract them in any way that\n\t * it chooses.  Ideally, it should choose a method that maximizes\n\t * performance.\n\t *\n\t * The target string will be provided in ctx->common.target.  This might\n\t * be a directory, although extraction backends are free to interpret it\n\t * as they wish.  TODO: in some cases, the common extraction code also\n\t * interprets the target string.  This should be completely isolated to\n\t * extraction backends.\n\t *\n\t * The extraction flags will be provided in ctx->common.extract_flags.\n\t * Extraction backends should examine them and implement the behaviors\n\t * for as many flags as possible.  Some flags are already handled by the\n\t * common extraction code.  TODO: this needs to be better formalized.\n\t *\n\t * @dentry_list, the list of dentries, will be ordered such that the\n\t * ancestor of any dentry always precedes any descendents.  Unless\n\t * @single_tree_only is set, it's possible that the dentries consist of\n\t * multiple disconnected trees.\n\t *\n\t * 'd_extraction_name' and 'd_extraction_name_nchars' of each dentry\n\t * will be set to indicate the actual name with which the dentry should\n\t * be extracted.  This may or may not be the same as 'd_name'.  TODO:\n\t * really, the extraction backends should be responsible for generating\n\t * 'd_extraction_name'.\n\t *\n\t * Each dentry will refer to a valid inode in 'd_inode'.  Each inode\n\t * will contain a list of dentries of that inode being extracted; this\n\t * list may be shorter than the inode's full dentry list.\n\t *\n\t * The blobs required to be extracted will already be prepared in\n\t * 'apply_ctx'.  The extraction backend should call extract_blob_list()\n\t * to extract them.\n\t *\n\t * The will_extract_dentry() utility function, given an arbitrary dentry\n\t * in the WIM image (which may not be in the extraction list), can be\n\t * used to determine if that dentry is in the extraction list.\n\t *\n\t * Return 0 if successful; otherwise a positive wimlib error code.\n\t */\n\tint (*extract)(struct list_head *dentry_list, struct apply_ctx *ctx);\n\n\t/*\n\t * Query whether the unnamed data stream of the specified file will be\n\t * extracted as \"externally backed\" from the WIM archive itself.  If so,\n\t * then the extraction backend is assumed to handle this separately, and\n\t * the common extraction code will not register a usage of the unnamed\n\t * data stream's blob.\n\t *\n\t * This routine is optional.\n\t *\n\t * Return:\n\t *\t< 0 if the file will *not* be externally backed.\n\t *\t= 0 if the file will be externally backed.\n\t *\t> 0 (wimlib error code) if another error occurred.\n\t */\n\tint (*will_back_from_wim)(struct wim_dentry *dentry, struct apply_ctx *ctx);\n\n\t/*\n\t * Size of the backend-specific extraction context.  It must contain\n\t * 'struct apply_ctx' as its first member.\n\t */\n\tsize_t context_size;\n\n\t/*\n\t * Set this if the extraction backend only supports extracting dentries\n\t * that form a single tree, not multiple trees.\n\t */\n\tbool single_tree_only;\n};\n\n#ifdef _WIN32\n  extern const struct apply_operations win32_apply_ops;\n#else\n  extern const struct apply_operations unix_apply_ops;\n#endif\n\n#ifdef WITH_NTFS_3G\n  extern const struct apply_operations ntfs_3g_apply_ops;\n#endif\n\n#endif /* _WIMLIB_APPLY_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/assert.h",
    "content": "#ifndef _WIMLIB_ASSERT_H\n#define _WIMLIB_ASSERT_H\n\n#include <assert.h>\n#define wimlib_assert(expr)\tassert(expr)\n\n#endif /* _WIMLIB_ASSERT_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/avl_tree.h",
    "content": "/*\n * avl_tree.h - intrusive, nonrecursive AVL tree data structure (self-balancing\n *\t\tbinary search tree), header file\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifndef _AVL_TREE_H_\n#define _AVL_TREE_H_\n\n#include \"wimlib/types.h\"\n#define AVL_INLINE forceinline\n\n/* Node in an AVL tree.  Embed this in some other data structure.  */\nstruct avl_tree_node {\n\n\t/* Pointer to left child or NULL  */\n\tstruct avl_tree_node *left;\n\n\t/* Pointer to right child or NULL  */\n\tstruct avl_tree_node *right;\n\n\t/* Pointer to parent combined with the balance factor.  This saves 4 or\n\t * 8 bytes of memory depending on the CPU architecture.\n\t *\n\t * Low 2 bits:  One greater than the balance factor of this subtree,\n\t * which is equal to height(right) - height(left).  The mapping is:\n\t *\n\t * 00 => -1\n\t * 01 =>  0\n\t * 10 => +1\n\t * 11 => undefined\n\t *\n\t * The rest of the bits are the pointer to the parent node.  It must be\n\t * 4-byte aligned, and it will be NULL if this is the root node and\n\t * therefore has no parent.  */\n\tuintptr_t parent_balance;\n};\n\n/* Cast an AVL tree node to the containing data structure.  */\n#define avl_tree_entry(entry, type, member) \\\n\t((type*) ((char *)(entry) - offsetof(type, member)))\n\n/* Returns a pointer to the parent of the specified AVL tree node, or NULL if it\n * is already the root of the tree.  */\nstatic AVL_INLINE struct avl_tree_node *\navl_get_parent(const struct avl_tree_node *node)\n{\n\treturn (struct avl_tree_node *)(node->parent_balance & ~3);\n}\n\n/* (Internal use only)  */\nvoid\navl_tree_rebalance_after_insert(struct avl_tree_node **root_ptr,\n\t\t\t\tstruct avl_tree_node *inserted);\n\n/*\n * Looks up an item in the specified AVL tree.\n *\n * @root\n *\tPointer to the root of the AVL tree.  (This can be NULL --- that just\n *\tmeans the tree is empty.)\n *\n * @cmp_ctx\n *\tFirst argument to pass to the comparison callback.  This generally\n *\tshould be a pointer to an object equal to the one being searched for.\n *\n * @cmp\n *\tComparison callback.  Must return < 0, 0, or > 0 if the first argument\n *\tis less than, equal to, or greater than the second argument,\n *\trespectively.  The first argument will be @cmp_ctx and the second\n *\targument will be a pointer to the AVL tree node of an item in the tree.\n *\n * Returns a pointer to the AVL tree node of the resulting item, or NULL if the\n * item was not found.\n *\n * Example:\n *\n * struct int_wrapper {\n *\tint data;\n *\tstruct avl_tree_node index_node;\n * };\n *\n * static int _avl_cmp_int_to_node(const void *intptr,\n *\t\t\t\t   const struct avl_tree_node *nodeptr)\n * {\n *\tint n1 = *(const int *)intptr;\n *\tint n2 = avl_tree_entry(nodeptr, struct int_wrapper, index_node)->data;\n *\tif (n1 < n2)\n *\t\treturn -1;\n *\telse if (n1 > n2)\n *\t\treturn 1;\n *\telse\n *\t\treturn 0;\n * }\n *\n * bool contains_int(struct avl_tree_node *root, int n)\n * {\n *\tstruct avl_tree_node *result;\n *\n *\tresult = avl_tree_lookup(root, &n, _avl_cmp_int_to_node);\n *\treturn result ? true : false;\n * }\n */\nstatic AVL_INLINE struct avl_tree_node *\navl_tree_lookup(const struct avl_tree_node *root,\n\t\tconst void *cmp_ctx,\n\t\tint (*cmp)(const void *, const struct avl_tree_node *))\n{\n\tconst struct avl_tree_node *cur = root;\n\n\twhile (cur) {\n\t\tint res = (*cmp)(cmp_ctx, cur);\n\t\tif (res < 0)\n\t\t\tcur = cur->left;\n\t\telse if (res > 0)\n\t\t\tcur = cur->right;\n\t\telse\n\t\t\tbreak;\n\t}\n\treturn (struct avl_tree_node*)cur;\n}\n\n/* Same as avl_tree_lookup(), but uses a more specific type for the comparison\n * function.  Specifically, with this function the item being searched for is\n * expected to be in the same format as those already in the tree, with an\n * embedded 'struct avl_tree_node'.  */\nstatic AVL_INLINE struct avl_tree_node *\navl_tree_lookup_node(const struct avl_tree_node *root,\n\t\t     const struct avl_tree_node *node,\n\t\t     int (*cmp)(const struct avl_tree_node *,\n\t\t\t\tconst struct avl_tree_node *))\n{\n\tconst struct avl_tree_node *cur = root;\n\n\twhile (cur) {\n\t\tint res = (*cmp)(node, cur);\n\t\tif (res < 0)\n\t\t\tcur = cur->left;\n\t\telse if (res > 0)\n\t\t\tcur = cur->right;\n\t\telse\n\t\t\tbreak;\n\t}\n\treturn (struct avl_tree_node*)cur;\n}\n\n/*\n * Inserts an item into the specified AVL tree.\n *\n * @root_ptr\n *\tLocation of the AVL tree's root pointer.  Indirection is needed because\n *\tthe root node may change as a result of rotations caused by the\n *\tinsertion.  Initialize *root_ptr to NULL for an empty tree.\n *\n * @item\n *\tPointer to the `struct avl_tree_node' embedded in the item to insert.\n *\tNo members in it need be pre-initialized, although members in the\n *\tcontaining structure should be pre-initialized so that @cmp can use them\n *\tin comparisons.\n *\n * @cmp\n *\tComparison callback.  Must return < 0, 0, or > 0 if the first argument\n *\tis less than, equal to, or greater than the second argument,\n *\trespectively.  The first argument will be @item and the second\n *\targument will be a pointer to an AVL tree node embedded in some\n *\tpreviously-inserted item to which @item is being compared.\n *\n * If no item in the tree is comparatively equal (via @cmp) to @item, inserts\n * @item and returns NULL.  Otherwise does nothing and returns a pointer to the\n * AVL tree node embedded in the previously-inserted item which compared equal\n * to @item.\n *\n * Example:\n *\n * struct int_wrapper {\n *\tint data;\n *\tstruct avl_tree_node index_node;\n * };\n *\n * #define GET_DATA(i) avl_tree_entry((i), struct int_wrapper, index_node)->data\n *\n * static int _avl_cmp_ints(const struct avl_tree_node *node1,\n *\t\t\t    const struct avl_tree_node *node2)\n * {\n *\tint n1 = GET_DATA(node1);\n *\tint n2 = GET_DATA(node2);\n *\tif (n1 < n2)\n *\t\treturn -1;\n *\telse if (n1 > n2)\n *\t\treturn 1;\n *\telse\n *\t\treturn 0;\n * }\n *\n * bool insert_int(struct avl_tree_node **root_ptr, int data)\n * {\n *\tstruct int_wrapper *i = malloc(sizeof(struct int_wrapper));\n *\ti->data = data;\n *\tif (avl_tree_insert(root_ptr, &i->index_node, _avl_cmp_ints)) {\n *\t\t// Duplicate.\n *\t\tfree(i);\n *\t\treturn false;\n *\t}\n *\treturn true;\n * }\n */\nstatic AVL_INLINE struct avl_tree_node *\navl_tree_insert(struct avl_tree_node **root_ptr,\n\t\tstruct avl_tree_node *item,\n\t\tint (*cmp)(const struct avl_tree_node *,\n\t\t\t   const struct avl_tree_node *))\n{\n\tstruct avl_tree_node **cur_ptr = root_ptr, *cur = NULL;\n\tint res;\n\n\twhile (*cur_ptr) {\n\t\tcur = *cur_ptr;\n\t\tres = (*cmp)(item, cur);\n\t\tif (res < 0)\n\t\t\tcur_ptr = &cur->left;\n\t\telse if (res > 0)\n\t\t\tcur_ptr = &cur->right;\n\t\telse\n\t\t\treturn cur;\n\t}\n\t*cur_ptr = item;\n\titem->parent_balance = (uintptr_t)cur | 1;\n\tavl_tree_rebalance_after_insert(root_ptr, item);\n\treturn NULL;\n}\n\n/* Removes an item from the specified AVL tree.\n * See implementation for details.  */\nvoid\navl_tree_remove(struct avl_tree_node **root_ptr, struct avl_tree_node *node);\n\n/* Nonrecursive AVL tree traversal functions  */\n\nstruct avl_tree_node *\navl_tree_first_in_order(const struct avl_tree_node *root);\n\nstruct avl_tree_node *\navl_tree_last_in_order(const struct avl_tree_node *root);\n\nstruct avl_tree_node *\navl_tree_next_in_order(const struct avl_tree_node *node);\n\nstruct avl_tree_node *\navl_tree_prev_in_order(const struct avl_tree_node *node);\n\nstruct avl_tree_node *\navl_tree_first_in_postorder(const struct avl_tree_node *root);\n\nstruct avl_tree_node *\navl_tree_next_in_postorder(const struct avl_tree_node *prev,\n\t\t\t   const struct avl_tree_node *prev_parent);\n\n/*\n * Iterate through the nodes in an AVL tree in sorted order.\n * You may not modify the tree during the iteration.\n *\n * @child_struct\n *\tVariable that will receive a pointer to each struct inserted into the\n *\ttree.\n * @root\n *\tRoot of the AVL tree.\n * @struct_name\n *\tType of *child_struct.\n * @struct_member\n *\tMember of @struct_name type that is the AVL tree node.\n *\n * Example:\n *\n * struct int_wrapper {\n *\tint data;\n *\tstruct avl_tree_node index_node;\n * };\n *\n * void print_ints(struct avl_tree_node *root)\n * {\n *\tstruct int_wrapper *i;\n *\n *\tavl_tree_for_each_in_order(i, root, struct int_wrapper, index_node)\n *\t\tprintf(\"%d\\n\", i->data);\n * }\n */\n#define avl_tree_for_each_in_order(child_struct, root,\t\t\t\\\n\t\t\t\t   struct_name, struct_member)\t\t\\\n\tfor (struct avl_tree_node *_cur =\t\t\t\t\\\n\t\tavl_tree_first_in_order(root);\t\t\t\t\\\n\t     _cur && ((child_struct) =\t\t\t\t\t\\\n\t\t      avl_tree_entry(_cur, struct_name,\t\t\t\\\n\t\t\t\t     struct_member), 1);\t\t\\\n\t     _cur = avl_tree_next_in_order(_cur))\n\n/*\n * Like avl_tree_for_each_in_order(), but uses the reverse order.\n */\n#define avl_tree_for_each_in_reverse_order(child_struct, root,\t\t\\\n\t\t\t\t\t   struct_name, struct_member)\t\\\n\tfor (struct avl_tree_node *_cur =\t\t\t\t\\\n\t\tavl_tree_last_in_order(root);\t\t\t\t\\\n\t     _cur && ((child_struct) =\t\t\t\t\t\\\n\t\t      avl_tree_entry(_cur, struct_name,\t\t\t\\\n\t\t\t\t     struct_member), 1);\t\t\\\n\t     _cur = avl_tree_prev_in_order(_cur))\n\n/*\n * Like avl_tree_for_each_in_order(), but iterates through the nodes in\n * postorder, so the current node may be deleted or freed.\n */\n#define avl_tree_for_each_in_postorder(child_struct, root,\t\t\\\n\t\t\t\t       struct_name, struct_member)\t\\\n\tfor (struct avl_tree_node *_cur =\t\t\t\t\\\n\t\tavl_tree_first_in_postorder(root), *_parent;\t\t\\\n\t     _cur && ((child_struct) =\t\t\t\t\t\\\n\t\t      avl_tree_entry(_cur, struct_name,\t\t\t\\\n\t\t\t\t     struct_member), 1)\t\t\t\\\n\t          && (_parent = avl_get_parent(_cur), 1);\t\t\\\n\t     _cur = avl_tree_next_in_postorder(_cur, _parent))\n\n#endif /* _AVL_TREE_H_ */\n"
  },
  {
    "path": "src/wimlib/wimlib/bitops.h",
    "content": "/*\n * bitops.h - inline functions for bit manipulation\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifndef _WIMLIB_BITOPS_H\n#define _WIMLIB_BITOPS_H\n\n#include \"wimlib/compiler.h\"\n#include \"wimlib/types.h\"\n\n/*\n * Bit Scan Reverse (BSR) - find the 0-based index (relative to the least\n * significant bit) of the *most* significant 1 bit in the input value.  The\n * input value must be nonzero!\n */\n\nstatic forceinline unsigned\nbsr32(u32 v)\n{\n\treturn 31 - __builtin_clz(v);\n}\n\nstatic forceinline unsigned\nbsr64(u64 v)\n{\n\treturn 63 - __builtin_clzll(v);\n}\n\nstatic forceinline unsigned\nbsrw(machine_word_t v)\n{\n\tSTATIC_ASSERT(WORDBITS == 32 || WORDBITS == 64);\n\tif (WORDBITS == 32)\n\t\treturn bsr32(v);\n\telse\n\t\treturn bsr64(v);\n}\n\n/*\n * Bit Scan Forward (BSF) - find the 0-based index (relative to the least\n * significant bit) of the *least* significant 1 bit in the input value.  The\n * input value must be nonzero!\n */\n\nstatic forceinline unsigned\nbsf32(u32 v)\n{\n\treturn __builtin_ctz(v);\n}\n\nstatic forceinline unsigned\nbsf64(u64 v)\n{\n\treturn __builtin_ctzll(v);\n}\n\nstatic forceinline unsigned\nbsfw(machine_word_t v)\n{\n\tSTATIC_ASSERT(WORDBITS == 32 || WORDBITS == 64);\n\tif (WORDBITS == 32)\n\t\treturn bsf32(v);\n\telse\n\t\treturn bsf64(v);\n}\n\n/* Return the log base 2 of 'n', rounded up to the nearest integer. */\nstatic forceinline unsigned\nilog2_ceil(size_t n)\n{\n        if (n <= 1)\n                return 0;\n        return 1 + bsrw(n - 1);\n}\n\n/* Round 'n' up to the nearest power of 2 */\nstatic forceinline size_t\nroundup_pow_of_2(size_t n)\n{\n\treturn (size_t)1 << ilog2_ceil(n);\n}\n\n#endif /* _WIMLIB_BITOPS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/blob_table.h",
    "content": "#ifndef _WIMLIB_BLOB_TABLE_H\n#define _WIMLIB_BLOB_TABLE_H\n\n#include \"wimlib/list.h\"\n#include \"wimlib/resource.h\"\n#include \"wimlib/sha1.h\"\n#include \"wimlib/types.h\"\n\n/* An enumerated type that identifies where a blob's data is located.  */\nenum blob_location {\n\n\t/* The blob's data does not exist.  This is a temporary state only.  */\n\tBLOB_NONEXISTENT = 0,\n\n\t/* The blob's data is available in the WIM resource identified by the\n\t * `struct wim_resource_descriptor' pointed to by @rdesc.\n\t * @offset_in_res identifies the offset at which this particular blob\n\t * begins in the uncompressed data of the resource.  */\n\tBLOB_IN_WIM,\n\n\t/* The blob's data is available as the contents of the file named by\n\t * @file_on_disk.  */\n\tBLOB_IN_FILE_ON_DISK,\n\n\t/* The blob's data is available as the contents of the in-memory buffer\n\t * pointed to by @attached_buffer.  */\n\tBLOB_IN_ATTACHED_BUFFER,\n\n#ifdef WITH_FUSE\n\t/* The blob's data is available as the contents of the file with name\n\t * @staging_file_name relative to the open directory file descriptor\n\t * @staging_dir_fd.  */\n\tBLOB_IN_STAGING_FILE,\n#endif\n\n#ifdef WITH_NTFS_3G\n\t/* The blob's data is available as the contents of an NTFS attribute\n\t * accessible through libntfs-3g.  @ntfs_loc points to a structure which\n\t * identifies the attribute.  */\n\tBLOB_IN_NTFS_VOLUME,\n#endif\n\n#ifdef _WIN32\n\t/* Windows only: the blob's data is available in the file (or named data\n\t * stream) specified by @windows_file.  The data might be only properly\n\t * accessible through the Windows API.  */\n\tBLOB_IN_WINDOWS_FILE,\n#endif\n};\n\n/* A \"blob extraction target\" is a stream, and the inode to which that stream\n * belongs, to which a blob needs to be extracted as part of an extraction\n * operation.  Since blobs are single-instanced, a blob may have multiple\n * extraction targets.  */\nstruct blob_extraction_target {\n\tstruct wim_inode *inode;\n\tstruct wim_inode_stream *stream;\n};\n\n/*\n * Descriptor for a \"blob\", which is a known length sequence of binary data.\n *\n * Within a WIM file, blobs are single instanced and are identified by SHA-1\n * message digest.\n */\nstruct blob_descriptor {\n\n\t/* List node for a hash bucket of the blob table  */\n\tstruct hlist_node hash_list;\n\n\t/*\n\t * Uncompressed size of this blob.\n\t *\n\t * In most cases we are now enforcing that this is nonzero; i.e. an\n\t * empty stream will have \"no blob\" rather than \"an empty blob\".  The\n\t * exceptions are:\n\t *\n\t *\t- blob descriptors with 'blob_location == BLOB_NONEXISTENT',\n\t *\t  e.g. placeholder entries for new metadata resources or for\n\t *\t  blobs required for pipable WIM extraction.  In these cases the\n\t *\t  size is not meaningful information anyway.\n\t *\t- blob descriptors with 'blob_location == BLOB_IN_STAGING_FILE'\n\t *\t  can vary their size over time, including to 0.\n\t */\n\tu64 size;\n\n\tunion {\n\t\t/*\n\t\t * For unhashed == 0: 'hash' is the SHA-1 message digest of the\n\t\t * blob's data.  'hash_short' allows accessing just a prefix of\n\t\t * the SHA-1 message digest, which is useful for getting a \"hash\n\t\t * code\" for hash table lookup/insertion.\n\t\t */\n\t\tu8 hash[SHA1_HASH_SIZE];\n\t\tsize_t hash_short;\n\n\t\t/* For unhashed == 1: these variables make it possible to find\n\t\t * the stream that references this blob.  There can be at most\n\t\t * one such reference, since duplicate blobs can only be joined\n\t\t * after they have been hashed.  */\n\t\tstruct {\n\t\t\tstruct wim_inode *back_inode;\n\t\t\tu32 back_stream_id;\n\t\t};\n\t};\n\n\t/* Number of times this blob is referenced by file streams in WIM\n\t * images.  See blob_decrement_refcnt() for information about the\n\t * limitations of this field.  */\n\tu32 refcnt;\n\n\t/*\n\t * When a WIM file is written, this is set to the number of references\n\t * (from file streams) to this blob in the output WIM file.\n\t *\n\t * During extraction, this is set to the number of targets to which this\n\t * blob is being extracted.\n\t *\n\t * During image export, this is set to the number of references of this\n\t * blob that originated from the source WIM.\n\t *\n\t * When mounting a WIM image read-write, this is set to the number of\n\t * extra references to this blob preemptively taken to allow later\n\t * saving the modified image as a new image and leaving the original\n\t * image alone.\n\t */\n\tu32 out_refcnt;\n\n#ifdef WITH_FUSE\n\t/* Number of open file descriptors to this blob during a FUSE mount of\n\t * a WIM image.  */\n\tu16 num_opened_fds;\n#endif\n\n\t/* One of the `enum blob_location' values documented above.  */\n\tu16 blob_location : 4;\n\n\t/* 1 iff this blob contains \"metadata\" as opposed to data.  */\n\tu16 is_metadata : 1;\n\n\t/* 1 iff the SHA-1 message digest of this blob is unknown.  */\n\tu16 unhashed : 1;\n\n\t/* 1 iff this blob has failed its checksum.  */\n\tu16 corrupted : 1;\n\n\t/* Temporary fields used when writing blobs; set as documented for\n\t * prepare_blob_list_for_write().  */\n\tu16 unique_size : 1;\n\tu16 will_be_in_output_wim : 1;\n\n\tu16 may_send_done_with_file : 1;\n\n\t/* Only used by wimlib_export_image() */\n\tu16 was_exported : 1;\n\n\t/* Specification of where this blob's data is located.  Which member of\n\t * this union is valid is determined by the @blob_location field.  */\n\tunion {\n\t\t/* BLOB_IN_WIM  */\n\t\tstruct {\n\t\t\tstruct wim_resource_descriptor *rdesc;\n\t\t\tu64 offset_in_res;\n\n\t\t\t/* Links together blobs that share the same underlying\n\t\t\t * WIM resource.  The head is rdesc->blob_list.  */\n\t\t\tstruct list_head rdesc_node;\n\t\t};\n\n\t\tstruct {\n\n\t\t\tunion {\n\n\t\t\t\t/* BLOB_IN_FILE_ON_DISK\n\t\t\t\t * BLOB_IN_WINDOWS_FILE  */\n\t\t\t\tstruct {\n\t\t\t\t\tunion {\n\t\t\t\t\t\ttchar *file_on_disk;\n\t\t\t\t\t\tstruct windows_file *windows_file;\n\t\t\t\t\t};\n\t\t\t\t\tstruct wim_inode *file_inode;\n\t\t\t\t};\n\n\t\t\t\t/* BLOB_IN_ATTACHED_BUFFER */\n\t\t\t\tvoid *attached_buffer;\n\n\t\t\t#ifdef WITH_FUSE\n\t\t\t\t/* BLOB_IN_STAGING_FILE  */\n\t\t\t\tstruct {\n\t\t\t\t\tchar *staging_file_name;\n\t\t\t\t\tint staging_dir_fd;\n\t\t\t\t};\n\t\t\t#endif\n\n\t\t\t#ifdef WITH_NTFS_3G\n\t\t\t\t/* BLOB_IN_NTFS_VOLUME  */\n\t\t\t\tstruct ntfs_location *ntfs_loc;\n\t\t\t#endif\n\t\t\t};\n\n\t\t\t/* List link for per-WIM-image list of unhashed blobs */\n\t\t\tstruct list_head unhashed_list;\n\t\t};\n\t};\n\n\t/* Temporary fields  */\n\tunion {\n\t\t/* Fields used temporarily during WIM file writing.  */\n\t\tstruct {\n\t\t\tunion {\n\t\t\t\t/* List node used for blob size table.  */\n\t\t\t\tstruct hlist_node hash_list_2;\n\n\t\t\t\t/* Metadata for the underlying solid resource in\n\t\t\t\t * the WIM being written (only valid if\n\t\t\t\t * WIM_RESHDR_FLAG_SOLID set in\n\t\t\t\t * out_reshdr.flags).  */\n\t\t\t\tstruct {\n\t\t\t\t\tu64 out_res_offset_in_wim;\n\t\t\t\t\tu64 out_res_size_in_wim;\n\t\t\t\t\tu64 out_res_uncompressed_size;\n\t\t\t\t};\n\t\t\t};\n\n\t\t\t/* Links blobs being written to the WIM.  */\n\t\t\tstruct list_head write_blobs_list;\n\n\t\t\tunion {\n\t\t\t\t/* Metadata for this blob in the WIM being\n\t\t\t\t * written.  */\n\t\t\t\tstruct wim_reshdr out_reshdr;\n\n\t\t\t\tstruct {\n\t\t\t\t\t/* Name under which this blob is being\n\t\t\t\t\t * sorted; used only when sorting blobs\n\t\t\t\t\t * for solid compression.  */\n\t\t\t\t\tutf16lechar *solid_sort_name;\n\t\t\t\t\tsize_t solid_sort_name_nbytes;\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\n\t\t/* Used temporarily during extraction.  This is an array of\n\t\t * references to the streams being extracted that use this blob.\n\t\t * out_refcnt tracks the number of slots filled.  */\n\t\tunion {\n\t\t\tstruct blob_extraction_target inline_blob_extraction_targets[3];\n\t\t\tstruct {\n\t\t\t\tstruct blob_extraction_target *blob_extraction_targets;\n\t\t\t\tu32 alloc_blob_extraction_targets;\n\t\t\t};\n\t\t};\n\t};\n\n\t/* Temporary list fields.  */\n\tunion {\n\t\t/* Links blobs for writing blob table.  */\n\t\tstruct list_head blob_table_list;\n\n\t\t/* Links blobs being extracted.  */\n\t\tstruct list_head extraction_list;\n\n\t\t/* Links blobs being exported.  */\n\t\tstruct list_head export_blob_list;\n\t};\n};\n\nstruct blob_table *\nnew_blob_table(size_t capacity);\n\nvoid\nfree_blob_table(struct blob_table *table);\n\nint\nread_blob_table(WIMStruct *wim);\n\nint\nwrite_blob_table_from_blob_list(struct list_head *blob_list,\n\t\t\t\tstruct filedes *out_fd,\n\t\t\t\tu16 part_number,\n\t\t\t\tstruct wim_reshdr *out_reshdr,\n\t\t\t\tint write_resource_flags);\n\nstruct blob_descriptor *\nnew_blob_descriptor(void);\n\nstruct blob_descriptor *\nclone_blob_descriptor(const struct blob_descriptor *blob);\n\nvoid\nblob_decrement_refcnt(struct blob_descriptor *blob, struct blob_table *table);\n\nvoid\nblob_subtract_refcnt(struct blob_descriptor *blob, struct blob_table *table,\n\t\t     u32 count);\n\n#ifdef WITH_FUSE\nvoid\nblob_decrement_num_opened_fds(struct blob_descriptor *blob);\n#endif\n\nvoid\nblob_release_location(struct blob_descriptor *blob);\n\nvoid\nfree_blob_descriptor(struct blob_descriptor *blob);\n\nvoid\nblob_table_insert(struct blob_table *table, struct blob_descriptor *blob);\n\nvoid\nblob_table_unlink(struct blob_table *table, struct blob_descriptor *blob);\n\nstruct blob_descriptor *\nlookup_blob(const struct blob_table *table, const u8 *hash);\n\nint\nfor_blob_in_table(struct blob_table *table,\n\t\t  int (*visitor)(struct blob_descriptor *, void *), void *arg);\n\nint\nfor_blob_in_table_sorted_by_sequential_order(struct blob_table *table,\n\t\t\t\t\t     int (*visitor)(struct blob_descriptor *, void *),\n\t\t\t\t\t     void *arg);\n\nstruct wimlib_resource_entry;\n\nvoid\nblob_to_wimlib_resource_entry(const struct blob_descriptor *blob,\n\t\t\t      struct wimlib_resource_entry *wentry);\n\nint\nsort_blob_list(struct list_head *blob_list, size_t list_head_offset,\n\t       int (*compar)(const void *, const void*));\n\nint\nsort_blob_list_by_sequential_order(struct list_head *blob_list,\n\t\t\t\t   size_t list_head_offset);\n\nint\ncmp_blobs_by_sequential_order(const void *p1, const void *p2);\n\nstatic inline const struct blob_extraction_target *\nblob_extraction_targets(const struct blob_descriptor *blob)\n{\n\tif (blob->out_refcnt <= ARRAY_LEN(blob->inline_blob_extraction_targets))\n\t\treturn blob->inline_blob_extraction_targets;\n\telse\n\t\treturn blob->blob_extraction_targets;\n}\n\n/*\n * Declare that the specified blob is located in the specified WIM resource at\n * the specified offset.  The caller is expected to set blob->size if required.\n */\nstatic inline void\nblob_set_is_located_in_wim_resource(struct blob_descriptor *blob,\n\t\t\t\t    struct wim_resource_descriptor *rdesc,\n\t\t\t\t    u64 offset_in_res)\n{\n\tblob->blob_location = BLOB_IN_WIM;\n\tblob->rdesc = rdesc;\n\tlist_add_tail(&blob->rdesc_node, &rdesc->blob_list);\n\tblob->offset_in_res = offset_in_res;\n}\n\nstatic inline void\nblob_unset_is_located_in_wim_resource(struct blob_descriptor *blob)\n{\n\tlist_del(&blob->rdesc_node);\n\tblob->blob_location = BLOB_NONEXISTENT;\n}\n\nstatic inline void\nblob_set_is_located_in_attached_buffer(struct blob_descriptor *blob,\n\t\t\t\t       void *buffer, size_t size)\n{\n\tblob->blob_location = BLOB_IN_ATTACHED_BUFFER;\n\tblob->attached_buffer = buffer;\n\tblob->size = size;\n}\n\nstatic inline bool\nblob_is_in_file(const struct blob_descriptor *blob)\n{\n\treturn blob->blob_location == BLOB_IN_FILE_ON_DISK\n#ifdef _WIN32\n\t    || blob->blob_location == BLOB_IN_WINDOWS_FILE\n#endif\n\t   ;\n}\n\n#ifdef _WIN32\nconst wchar_t *\nget_windows_file_path(const struct windows_file *file);\n#endif\n\nstatic inline const tchar *\nblob_file_path(const struct blob_descriptor *blob)\n{\n#ifdef _WIN32\n\tif (blob->blob_location == BLOB_IN_WINDOWS_FILE)\n\t\treturn get_windows_file_path(blob->windows_file);\n#endif\n\treturn blob->file_on_disk;\n}\n\nstruct blob_descriptor *\nnew_blob_from_data_buffer(const void *buffer, size_t size,\n\t\t\t  struct blob_table *blob_table);\n\nstruct blob_descriptor *\nafter_blob_hashed(struct blob_descriptor *blob,\n\t\t  struct blob_descriptor **back_ptr,\n\t\t  struct blob_table *blob_table, struct wim_inode *inode);\n\nint\nhash_unhashed_blob(struct blob_descriptor *blob, struct blob_table *blob_table,\n\t\t   struct blob_descriptor **blob_ret);\n\nstruct blob_descriptor **\nretrieve_pointer_to_unhashed_blob(struct blob_descriptor *blob);\n\nstatic inline void\nprepare_unhashed_blob(struct blob_descriptor *blob,\n\t\t      struct wim_inode *back_inode, u32 stream_id,\n\t\t      struct list_head *unhashed_blobs)\n{\n\tif (!blob)\n\t\treturn;\n\tblob->unhashed = 1;\n\tblob->back_inode = back_inode;\n\tblob->back_stream_id = stream_id;\n\tlist_add_tail(&blob->unhashed_list, unhashed_blobs);\n}\n\n#endif /* _WIMLIB_BLOB_TABLE_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/bt_matchfinder.h",
    "content": "/*\n * bt_matchfinder.h - Lempel-Ziv matchfinding with a hash table of binary trees\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n *\n * ----------------------------------------------------------------------------\n *\n * This is a Binary Trees (bt) based matchfinder.\n *\n * The main data structure is a hash table where each hash bucket contains a\n * binary tree of sequences whose first 4 bytes share the same hash code.  Each\n * sequence is identified by its starting position in the input buffer.  Each\n * binary tree is always sorted such that each left child represents a sequence\n * lexicographically lesser than its parent and each right child represents a\n * sequence lexicographically greater than its parent.\n *\n * The algorithm processes the input buffer sequentially.  At each byte\n * position, the hash code of the first 4 bytes of the sequence beginning at\n * that position (the sequence being matched against) is computed.  This\n * identifies the hash bucket to use for that position.  Then, a new binary tree\n * node is created to represent the current sequence.  Then, in a single tree\n * traversal, the hash bucket's binary tree is searched for matches and is\n * re-rooted at the new node.\n *\n * Compared to the simpler algorithm that uses linked lists instead of binary\n * trees (see hc_matchfinder.h), the binary tree version gains more information\n * at each node visitation.  Ideally, the binary tree version will examine only\n * 'log(n)' nodes to find the same matches that the linked list version will\n * find by examining 'n' nodes.  In addition, the binary tree version can\n * examine fewer bytes at each node by taking advantage of the common prefixes\n * that result from the sort order, whereas the linked list version may have to\n * examine up to the full length of the match at each node.\n *\n * However, it is not always best to use the binary tree version.  It requires\n * nearly twice as much memory as the linked list version, and it takes time to\n * keep the binary trees sorted, even at positions where the compressor does not\n * need matches.  Generally, when doing fast compression on small buffers,\n * binary trees are the wrong approach.  They are best suited for thorough\n * compression and/or large buffers.\n *\n * ----------------------------------------------------------------------------\n */\n\n\n#include <string.h>\n\n#include \"wimlib/matchfinder_common.h\"\n\n#define BT_MATCHFINDER_HASH3_ORDER 15\n#define BT_MATCHFINDER_HASH3_WAYS  2\n#define BT_MATCHFINDER_HASH4_ORDER 16\n\n/* TEMPLATED functions and structures have MF_SUFFIX appended to their name.  */\n#undef TEMPLATED\n#define TEMPLATED(name)\t\tCONCAT(name, MF_SUFFIX)\n\n#ifndef _WIMLIB_BT_MATCHFINDER_H\n#define _WIMLIB_BT_MATCHFINDER_H\n\n/* Non-templated definitions  */\n\n/* Representation of a match found by the bt_matchfinder  */\nstruct lz_match {\n\n\t/* The number of bytes matched.  */\n\tu32 length;\n\n\t/* The offset back from the current position that was matched.  */\n\tu32 offset;\n};\n\n#endif /* _WIMLIB_BT_MATCHFINDER_H */\n\nstruct TEMPLATED(bt_matchfinder) {\n\n\t/* The hash table for finding length 2 matches, if enabled  */\n#ifdef BT_MATCHFINDER_HASH2_ORDER\n\tmf_pos_t hash2_tab[1UL << BT_MATCHFINDER_HASH2_ORDER];\n#endif\n\n\t/* The hash table for finding length 3 matches  */\n\tmf_pos_t hash3_tab[1UL << BT_MATCHFINDER_HASH3_ORDER][BT_MATCHFINDER_HASH3_WAYS];\n\n\t/* The hash table which contains the roots of the binary trees for\n\t * finding length 4+ matches  */\n\tmf_pos_t hash4_tab[1UL << BT_MATCHFINDER_HASH4_ORDER];\n\n\t/* The child node references for the binary trees.  The left and right\n\t * children of the node for the sequence with position 'pos' are\n\t * 'child_tab[pos * 2]' and 'child_tab[pos * 2 + 1]', respectively.  */\n\tmf_pos_t child_tab[];\n};\n\n/* Return the number of bytes that must be allocated for a 'bt_matchfinder' that\n * can work with buffers up to the specified size.  */\nstatic forceinline size_t\nTEMPLATED(bt_matchfinder_size)(size_t max_bufsize)\n{\n\treturn sizeof(struct TEMPLATED(bt_matchfinder)) +\n\t\t(2 * max_bufsize * sizeof(mf_pos_t));\n}\n\n/* Prepare the matchfinder for a new input buffer.  */\nstatic forceinline void\nTEMPLATED(bt_matchfinder_init)(struct TEMPLATED(bt_matchfinder) *mf)\n{\n\tmemset(mf, 0, sizeof(*mf));\n}\n\nstatic forceinline mf_pos_t *\nTEMPLATED(bt_left_child)(struct TEMPLATED(bt_matchfinder) *mf, u32 node)\n{\n\treturn &mf->child_tab[(node << 1) + 0];\n}\n\nstatic forceinline mf_pos_t *\nTEMPLATED(bt_right_child)(struct TEMPLATED(bt_matchfinder) *mf, u32 node)\n{\n\treturn &mf->child_tab[(node << 1) + 1];\n}\n\n/* The minimum permissible value of 'max_len' for bt_matchfinder_get_matches()\n * and bt_matchfinder_skip_byte().  There must be sufficiently many bytes\n * remaining to load a 32-bit integer from the *next* position.  */\n#define BT_MATCHFINDER_REQUIRED_NBYTES\t5\n\n/* Advance the binary tree matchfinder by one byte, optionally recording\n * matches.  @record_matches should be a compile-time constant.  */\nstatic forceinline struct lz_match *\nTEMPLATED(bt_matchfinder_advance_one_byte)(struct TEMPLATED(bt_matchfinder) * const mf,\n\t\t\t\t\t   const u8 * const in_begin,\n\t\t\t\t\t   const ptrdiff_t cur_pos,\n\t\t\t\t\t   const u32 max_len,\n\t\t\t\t\t   const u32 nice_len,\n\t\t\t\t\t   const u32 max_search_depth,\n\t\t\t\t\t   u32 * const next_hashes,\n\t\t\t\t\t   u32 * const best_len_ret,\n\t\t\t\t\t   struct lz_match *lz_matchptr,\n\t\t\t\t\t   const bool record_matches)\n{\n\tconst u8 *in_next = in_begin + cur_pos;\n\tu32 depth_remaining = max_search_depth;\n\tu32 next_hashseq;\n\tu32 hash3;\n\tu32 hash4;\n#ifdef BT_MATCHFINDER_HASH2_ORDER\n\tu16 seq2;\n\tu32 hash2;\n#endif\n\tSTATIC_ASSERT(BT_MATCHFINDER_HASH3_WAYS >= 1 &&\n\t\t      BT_MATCHFINDER_HASH3_WAYS <= 2);\n\tu32 cur_node;\n#if BT_MATCHFINDER_HASH3_WAYS >= 2\n\tu32 cur_node_2;\n#endif\n\tconst u8 *matchptr;\n\tmf_pos_t *pending_lt_ptr, *pending_gt_ptr;\n\tu32 best_lt_len, best_gt_len;\n\tu32 len;\n\tu32 best_len = 3;\n\n\tnext_hashseq = get_unaligned_le32(in_next + 1);\n\n\thash3 = next_hashes[0];\n\thash4 = next_hashes[1];\n\n\tnext_hashes[0] = lz_hash(next_hashseq & 0xFFFFFF, BT_MATCHFINDER_HASH3_ORDER);\n\tnext_hashes[1] = lz_hash(next_hashseq, BT_MATCHFINDER_HASH4_ORDER);\n\tprefetchw(&mf->hash3_tab[next_hashes[0]]);\n\tprefetchw(&mf->hash4_tab[next_hashes[1]]);\n\n#ifdef BT_MATCHFINDER_HASH2_ORDER\n\tseq2 = load_u16_unaligned(in_next);\n\thash2 = lz_hash(seq2, BT_MATCHFINDER_HASH2_ORDER);\n\tcur_node = mf->hash2_tab[hash2];\n\tmf->hash2_tab[hash2] = cur_pos;\n\tif (record_matches &&\n\t    seq2 == load_u16_unaligned(&in_begin[cur_node]) &&\n\t    likely(in_next != in_begin))\n\t{\n\t\tlz_matchptr->length = 2;\n\t\tlz_matchptr->offset = in_next - &in_begin[cur_node];\n\t\tlz_matchptr++;\n\t}\n#endif\n\n\tcur_node = mf->hash3_tab[hash3][0];\n\tmf->hash3_tab[hash3][0] = cur_pos;\n#if BT_MATCHFINDER_HASH3_WAYS >= 2\n\tcur_node_2 = mf->hash3_tab[hash3][1];\n\tmf->hash3_tab[hash3][1] = cur_node;\n#endif\n\tif (record_matches && likely(in_next != in_begin)) {\n\t\tu32 seq3 = load_u24_unaligned(in_next);\n\t\tif (seq3 == load_u24_unaligned(&in_begin[cur_node])) {\n\t\t\tlz_matchptr->length = 3;\n\t\t\tlz_matchptr->offset = in_next - &in_begin[cur_node];\n\t\t\tlz_matchptr++;\n\t\t}\n\t#if BT_MATCHFINDER_HASH3_WAYS >= 2\n\t\telse if (seq3 == load_u24_unaligned(&in_begin[cur_node_2])) {\n\t\t\tlz_matchptr->length = 3;\n\t\t\tlz_matchptr->offset = in_next - &in_begin[cur_node_2];\n\t\t\tlz_matchptr++;\n\t\t}\n\t#endif\n\t}\n\n\tcur_node = mf->hash4_tab[hash4];\n\tmf->hash4_tab[hash4] = cur_pos;\n\n\tpending_lt_ptr = TEMPLATED(bt_left_child)(mf, cur_pos);\n\tpending_gt_ptr = TEMPLATED(bt_right_child)(mf, cur_pos);\n\n\tif (!cur_node) {\n\t\t*pending_lt_ptr = 0;\n\t\t*pending_gt_ptr = 0;\n\t\t*best_len_ret = best_len;\n\t\treturn lz_matchptr;\n\t}\n\n\tbest_lt_len = 0;\n\tbest_gt_len = 0;\n\tlen = 0;\n\n\tfor (;;) {\n\t\tmatchptr = &in_begin[cur_node];\n\n\t\tif (matchptr[len] == in_next[len]) {\n\t\t\tlen = lz_extend(in_next, matchptr, len + 1, max_len);\n\t\t\tif (!record_matches || len > best_len) {\n\t\t\t\tif (record_matches) {\n\t\t\t\t\tbest_len = len;\n\t\t\t\t\tlz_matchptr->length = len;\n\t\t\t\t\tlz_matchptr->offset = in_next - matchptr;\n\t\t\t\t\tlz_matchptr++;\n\t\t\t\t}\n\t\t\t\tif (len >= nice_len) {\n\t\t\t\t\t*pending_lt_ptr = *TEMPLATED(bt_left_child)(mf, cur_node);\n\t\t\t\t\t*pending_gt_ptr = *TEMPLATED(bt_right_child)(mf, cur_node);\n\t\t\t\t\t*best_len_ret = best_len;\n\t\t\t\t\treturn lz_matchptr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (matchptr[len] < in_next[len]) {\n\t\t\t*pending_lt_ptr = cur_node;\n\t\t\tpending_lt_ptr = TEMPLATED(bt_right_child)(mf, cur_node);\n\t\t\tcur_node = *pending_lt_ptr;\n\t\t\tbest_lt_len = len;\n\t\t\tif (best_gt_len < len)\n\t\t\t\tlen = best_gt_len;\n\t\t} else {\n\t\t\t*pending_gt_ptr = cur_node;\n\t\t\tpending_gt_ptr = TEMPLATED(bt_left_child)(mf, cur_node);\n\t\t\tcur_node = *pending_gt_ptr;\n\t\t\tbest_gt_len = len;\n\t\t\tif (best_lt_len < len)\n\t\t\t\tlen = best_lt_len;\n\t\t}\n\n\t\tif (!cur_node || !--depth_remaining) {\n\t\t\t*pending_lt_ptr = 0;\n\t\t\t*pending_gt_ptr = 0;\n\t\t\t*best_len_ret = best_len;\n\t\t\treturn lz_matchptr;\n\t\t}\n\t}\n}\n\n/*\n * Retrieve a list of matches with the current position.\n *\n * @mf\n *\tThe matchfinder structure.\n * @in_begin\n *\tPointer to the beginning of the input buffer.\n * @cur_pos\n *\tThe current position in the input buffer relative to @in_begin (the\n *\tposition of the sequence being matched against).\n * @max_len\n *\tThe maximum permissible match length at this position.  Must be >=\n *\tBT_MATCHFINDER_REQUIRED_NBYTES.\n * @nice_len\n *\tStop searching if a match of at least this length is found.\n *\tMust be <= @max_len.\n * @max_search_depth\n *\tLimit on the number of potential matches to consider.  Must be >= 1.\n * @next_hashes\n *\tThe precomputed hash codes for the sequence beginning at @in_next.\n *\tThese will be used and then updated with the precomputed hashcodes for\n *\tthe sequence beginning at @in_next + 1.\n * @best_len_ret\n *\tIf a match of length >= 4 was found, then the length of the longest such\n *\tmatch is written here; otherwise 3 is written here.  (Note: this is\n *\tredundant with the 'struct lz_match' array, but this is easier for the\n *\tcompiler to optimize when inlined and the caller immediately does a\n *\tcheck against 'best_len'.)\n * @lz_matchptr\n *\tAn array in which this function will record the matches.  The recorded\n *\tmatches will be sorted by strictly increasing length and (non-strictly)\n *\tincreasing offset.  The maximum number of matches that may be found is\n *\t'nice_len - 1', or one less if length 2 matches are disabled.\n *\n * The return value is a pointer to the next available slot in the @lz_matchptr\n * array.  (If no matches were found, this will be the same as @lz_matchptr.)\n */\nstatic forceinline struct lz_match *\nTEMPLATED(bt_matchfinder_get_matches)(struct TEMPLATED(bt_matchfinder) *mf,\n\t\t\t\t      const u8 *in_begin,\n\t\t\t\t      ptrdiff_t cur_pos,\n\t\t\t\t      u32 max_len,\n\t\t\t\t      u32 nice_len,\n\t\t\t\t      u32 max_search_depth,\n\t\t\t\t      u32 next_hashes[2],\n\t\t\t\t      u32 *best_len_ret,\n\t\t\t\t      struct lz_match *lz_matchptr)\n{\n\treturn TEMPLATED(bt_matchfinder_advance_one_byte)(mf,\n\t\t\t\t\t\t\t  in_begin,\n\t\t\t\t\t\t\t  cur_pos,\n\t\t\t\t\t\t\t  max_len,\n\t\t\t\t\t\t\t  nice_len,\n\t\t\t\t\t\t\t  max_search_depth,\n\t\t\t\t\t\t\t  next_hashes,\n\t\t\t\t\t\t\t  best_len_ret,\n\t\t\t\t\t\t\t  lz_matchptr,\n\t\t\t\t\t\t\t  true);\n}\n\n/*\n * Advance the matchfinder, but don't record any matches.\n *\n * This is very similar to bt_matchfinder_get_matches() because both functions\n * must do hashing and tree re-rooting.\n */\nstatic forceinline void\nTEMPLATED(bt_matchfinder_skip_byte)(struct TEMPLATED(bt_matchfinder) *mf,\n\t\t\t\t    const u8 *in_begin,\n\t\t\t\t    ptrdiff_t cur_pos,\n\t\t\t\t    u32 nice_len,\n\t\t\t\t    u32 max_search_depth,\n\t\t\t\t    u32 next_hashes[2])\n{\n\tu32 best_len;\n\tTEMPLATED(bt_matchfinder_advance_one_byte)(mf,\n\t\t\t\t\t\t   in_begin,\n\t\t\t\t\t\t   cur_pos,\n\t\t\t\t\t\t   nice_len,\n\t\t\t\t\t\t   nice_len,\n\t\t\t\t\t\t   max_search_depth,\n\t\t\t\t\t\t   next_hashes,\n\t\t\t\t\t\t   &best_len,\n\t\t\t\t\t\t   NULL,\n\t\t\t\t\t\t   false);\n}\n"
  },
  {
    "path": "src/wimlib/wimlib/case.h",
    "content": "#ifndef _WIMLIB_CASE_H\n#define _WIMLIB_CASE_H\n\n#include <stdbool.h>\n\n/* Note: the NTFS-3G headers define CASE_SENSITIVE, hence the WIMLIB prefix.  */\ntypedef enum {\n\t/* Use either case-sensitive or case-insensitive search, depending on\n\t * the variable @default_ignore_case.  */\n\tWIMLIB_CASE_PLATFORM_DEFAULT = 0,\n\n\t/* Use case-sensitive search.  */\n\tWIMLIB_CASE_SENSITIVE = 1,\n\n\t/* Use case-insensitive search.  */\n\tWIMLIB_CASE_INSENSITIVE = 2,\n} CASE_SENSITIVITY_TYPE;\n\nextern bool default_ignore_case;\n\nstatic inline bool\nwill_ignore_case(CASE_SENSITIVITY_TYPE case_type)\n{\n\tif (case_type == WIMLIB_CASE_SENSITIVE)\n\t\treturn false;\n\tif (case_type == WIMLIB_CASE_INSENSITIVE)\n\t\treturn true;\n\n\treturn default_ignore_case;\n}\n\n#endif /* _WIMLIB_CASE_H  */\n"
  },
  {
    "path": "src/wimlib/wimlib/chunk_compressor.h",
    "content": "/*\n * chunk_compressor.h\n *\n * Interface for serial/parallel chunk compression.\n */\n\n#ifndef _WIMLIB_CHUNK_COMPRESSOR_H\n#define _WIMLIB_CHUNK_COMPRESSOR_H\n\n#include \"wimlib/types.h\"\n\n/* Interface for chunk compression.  Users can submit chunks of data to be\n * compressed, then retrieve them later in order.  This interface can be\n * implemented either in serial (having the calling thread compress the chunks\n * itself) or in parallel (having other threads asynchronously compress the\n * chunks).  */\nstruct chunk_compressor {\n\t/* Variables set by the chunk compressor when it is created.  */\n\tint out_ctype;\n\tu32 out_chunk_size;\n\tunsigned num_threads;\n\n\t/* Free the chunk compressor.  */\n\tvoid (*destroy)(struct chunk_compressor *);\n\n\t/* Try to borrow a buffer into which the uncompressed data for the next\n\t * chunk should be prepared.\n\t *\n\t * Only one buffer can be borrowed at a time.\n\t *\n\t * Returns a pointer to the buffer, or NULL if no buffer is available.\n\t * If no buffer is available, you must call ->get_compression_result()\n\t * to retrieve a compressed chunk before trying again.  */\n\tvoid *(*get_chunk_buffer)(struct chunk_compressor *);\n\n\t/* Signals to the chunk compressor that the buffer which was loaned out\n\t * from ->get_chunk_buffer() has finished being filled and contains the\n\t * specified number of bytes of uncompressed data.  */\n\tvoid (*signal_chunk_filled)(struct chunk_compressor *, u32);\n\n\t/* Get the next chunk of compressed data.\n\t *\n\t * The compressed data, along with its size and the size of the original\n\t * uncompressed chunk, are returned in the locations pointed to by\n\t * arguments 2-4.  The compressed data is in storage internal to the\n\t * chunk compressor, and it cannot be accessed beyond any subsequent\n\t * calls to the chunk compressor.\n\t *\n\t * Chunks will be returned in the same order in which they were\n\t * submitted for compression.\n\t *\n\t * The resulting compressed length may be up to the uncompressed length.\n\t * In the case where they are equal, the returned data is actually the\n\t * uncompressed data, not the compressed data.\n\t *\n\t * The return value is %true if a chunk of compressed data was\n\t * successfully retrieved, or %false if there are no chunks currently\n\t * being compressed.  */\n\tbool (*get_compression_result)(struct chunk_compressor *,\n\t\t\t\t       const void **, u32 *, u32 *);\n};\n\n\n/* Functions that return implementations of the chunk_compressor interface.  */\n\nint\nnew_parallel_chunk_compressor(int out_ctype, u32 out_chunk_size,\n\t\t\t      unsigned num_threads, u64 max_memory,\n\t\t\t      struct chunk_compressor **compressor_ret);\n\nint\nnew_serial_chunk_compressor(int out_ctype, u32 out_chunk_size,\n\t\t\t    struct chunk_compressor **compressor_ret);\n\n#endif /* _WIMLIB_CHUNK_COMPRESSOR_H  */\n"
  },
  {
    "path": "src/wimlib/wimlib/compiler.h",
    "content": "/*\n * compiler.h\n *\n * Compiler-specific definitions.  Currently, only GCC and clang are supported.\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#include <stdlib.h>\n\n#ifndef _WIMLIB_COMPILER_H\n#define _WIMLIB_COMPILER_H\n\n/* Is the compiler GCC of the specified version or later?  This always returns\n * false for clang, since clang is \"frozen\" at GNUC 4.2.  The __has_*\n * feature-test macros should be used to detect clang functionality instead.  */\n#define GCC_PREREQ(major, minor)\t\t\t\t\t\\\n\t(!defined(__clang__) && !defined(__INTEL_COMPILER) &&\t\t\\\n\t (__GNUC__ > major ||\t\t\t\t\t\t\\\n\t  (__GNUC__ == major && __GNUC_MINOR__ >= minor)))\n\n/* Feature-test macros defined by recent versions of clang.  */\n#ifndef __has_attribute\n#  define __has_attribute(attribute)\t0\n#endif\n#ifndef __has_feature\n#  define __has_feature(feature)\t0\n#endif\n#ifndef __has_builtin\n#  define __has_builtin(builtin)\t0\n#endif\n\n#ifdef _MSC_VER\n#if !__has_attribute(attribute)\n#define __attribute__(x)\n#endif\n\n/* Declare that the annotated function should always be inlined.  This might be\n * desirable in highly tuned code, e.g. compression codecs.  */\n#define forceinline\t\t__inline\n\n/* Declare that the annotated function should *not* be inlined.  */\n#define _noinline\t\t__declspec(noinline)\n\n/* Functionally the same as 'noinline', but documents that the reason for not\n * inlining is to prevent the annotated function from being inlined into a\n * recursive function, thereby increasing its stack usage.  */\n#define noinline_for_stack\t_noinline\n\n/* Hint that the expression is usually true.  */\n#define likely(expr)\t\t(expr)\n\n/* Hint that the expression is usually false.  */\n#define unlikely(expr)\t\t(expr)\n\n#if defined(_M_IX86) || defined(_M_X64)\n/* Prefetch into L1 cache for read.  */\n#define prefetchr\t\t_m_prefetch\n\n/* Prefetch into L1 cache for write.  */\n#define prefetchw\t\t_m_prefetchw\n#else\n#define prefetchr(x)\n#define prefetchw(x)\n#endif\n\n#else\n/* Declare that the annotated function should always be inlined.  This might be\n * desirable in highly tuned code, e.g. compression codecs.  */\n#define forceinline\t\tinline __attribute__((always_inline))\n\n /* Declare that the annotated function should *not* be inlined.  */\n#define _noinline\t\t__attribute__((noinline))\n\n/* Functionally the same as 'noinline', but documents that the reason for not\n * inlining is to prevent the annotated function from being inlined into a\n * recursive function, thereby increasing its stack usage.  */\n#define noinline_for_stack\t_noinline\n\n/* Hint that the expression is usually true.  */\n#define likely(expr)\t\t__builtin_expect(!!(expr), 1)\n\n/* Hint that the expression is usually false.  */\n#define unlikely(expr)\t\t__builtin_expect(!!(expr), 0)\n\n/* Prefetch into L1 cache for read.  */\n#define prefetchr(addr)\t\t__builtin_prefetch((addr), 0)\n\n/* Prefetch into L1 cache for write.  */\n#define prefetchw(addr)\t\t__builtin_prefetch((addr), 1)\n#endif\n\n/* Hint that the annotated function takes a printf()-like format string and\n * arguments.  This is currently disabled on Windows because MinGW does not\n * support this attribute on functions taking wide-character strings.  */\n#ifdef _WIN32\n#  define _format_attribute(type, format_str, format_start)\n#else\n#  define _format_attribute(type, format_str, format_start)\t\\\n\t\t\t__attribute__((format(type, format_str, format_start)))\n#endif\n\n/* Endianness definitions.  Either CPU_IS_BIG_ENDIAN() or CPU_IS_LITTLE_ENDIAN()\n * evaluates to 1.  The other evaluates to 0.  Note that newer gcc supports\n * __BYTE_ORDER__ for easily determining the endianness; older gcc doesn't.  In\n * the latter case we fall back to a configure-time check.  */\n#ifdef __BYTE_ORDER__\n#  define CPU_IS_BIG_ENDIAN()\t(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)\n#elif defined(HAVE_CONFIG_H)\n#  include \"config.h\"\n#  ifdef WORDS_BIGENDIAN\n#    define CPU_IS_BIG_ENDIAN()\t1\n#  else\n#    define CPU_IS_BIG_ENDIAN()\t0\n#  endif\n#endif\n#define CPU_IS_LITTLE_ENDIAN() (!CPU_IS_BIG_ENDIAN())\n\n/* UNALIGNED_ACCESS_IS_FAST should be defined to 1 if unaligned memory accesses\n * can be performed efficiently on the target platform.  */\n#if defined(__x86_64__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64) || \\\n\tdefined(__ARM_FEATURE_UNALIGNED) || defined(__powerpc64__)\n#  define UNALIGNED_ACCESS_IS_FAST 1\n#else\n#  define UNALIGNED_ACCESS_IS_FAST 0\n#endif\n\n\n/* Get the minimum of two variables, without multiple evaluation.  */\n#ifndef _MSC_VER\n#undef min\n#define min(a, b)  ({ typeof(a) _a = (a); typeof(b) _b = (b); \\\n\t\t    (_a < _b) ? _a : _b; })\n#endif\n#undef MIN\n#define MIN(a, b)\tmin((a), (b))\n\n/* Get the maximum of two variables, without multiple evaluation.  */\n#ifndef _MSC_VER\n#undef max\n#define max(a, b)  ({ typeof(a) _a = (a); typeof(b) _b = (b); \\\n\t\t    (_a > _b) ? _a : _b; })\n#endif\n#undef MAX\n#define MAX(a, b)\tmax((a), (b))\n\n/* Get the maximum of three variables, without multiple evaluation.  */\n#undef max3\n#define max3(a, b, c)\tmax(max((a), (b)), (c))\n\n/* Swap the values of two variables, without multiple evaluation.  */\n#ifndef swap\n#  define swap(a, b) do { typeof(a) _a = (a); (a) = (b); (b) = _a; } while(0)\n#endif\n#define SWAP(a, b)\tswap((a), (b))\n\n/* Optional definitions for checking with 'sparse'.  */\n#ifdef __CHECKER__\n#  define _bitwise_attr\t__attribute__((bitwise))\n#  define _force_attr\t__attribute__((force))\n#else\n#  define _bitwise_attr\n#  define _force_attr\n#endif\n\n/* STATIC_ASSERT() - verify the truth of an expression at compilation time.  */\n#ifdef __CHECKER__\n#  define STATIC_ASSERT(expr)\n#elif __STDC_VERSION__ >= 201112L\n#  define STATIC_ASSERT(expr)\t_Static_assert((expr), \"\")\n#else\n#  define STATIC_ASSERT(expr)\t((void)sizeof(char[1 - 2 * !(expr)]))\n#endif\n\n/* STATIC_ASSERT_ZERO() - verify the truth of an expression at compilation time\n * and also produce a result of value '0' to be used in constant expressions */\n#define STATIC_ASSERT_ZERO(expr)\t(0 * sizeof(char[1 - 2 * !(expr)]))\n\n#define CONCAT_IMPL(s1, s2)\ts1##s2\n\n/* CONCAT() - concatenate two tokens at preprocessing time.  */\n#define CONCAT(s1, s2)\t\tCONCAT_IMPL(s1, s2)\n\n#ifdef _MSC_VER\n#define PRAGMA_BEGIN_PACKED\t\t__pragma(pack(push, 1))\n#define PRAGMA_END_PACKED\t\t__pragma(pack(pop))\n#else\n#define PRAGMA_BEGIN_PACKED\n#define PRAGMA_END_PACKED\n#endif\n\n#ifdef _MSC_VER\n#define PRAGMA_ALIGN(x, a)\t\t__declspec(align(a)) x\n#define PRAGMA_BEGIN_ALIGN(a)\t__declspec(align(a))\n#define PRAGMA_END_ALIGN(a)\n#else\n#define PRAGMA_ALIGN(x, a)\t\tx __attribute__((aligned(a)))\n#define PRAGMA_BEGIN_ALIGN(a)\n#define PRAGMA_END_ALIGN(a)\t\t__attribute__((aligned(a)))\n#endif\n\n#ifdef _MSC_VER\n#define _PTR(x)\t(void*)((uintptr_t)x)\n#else\n#define _PTR(x)\tx\n#endif\n\n#ifdef _MSC_VER\n#include <intrin.h>\n#include <stdint.h>\nuint32_t __inline __builtin_ctz(uint32_t value)\n{\n\tunsigned long trailing_zero = 0;\n\tif (_BitScanForward(&trailing_zero, value))\n\t\treturn trailing_zero;\n\t// Undefined behaviour => return 0 to appease static analyzers\n\treturn 0;\n}\nuint32_t __inline __builtin_clz(uint32_t value)\n{\n\tunsigned long leading_zero = 0;\n\tif (_BitScanReverse(&leading_zero, value))\n\t\treturn 31 - leading_zero;\n\treturn 0;\n}\n#if defined(_M_X64) || defined(_M_ARM64)\nuint32_t __inline __builtin_clzll(uint64_t value)\n{\n\tunsigned long leading_zero = 0;\n\tif (_BitScanReverse64(&leading_zero, value))\n\t\treturn 63 - leading_zero;\n\treturn 0;\n}\nuint32_t __inline __builtin_ctzll(uint64_t value)\n{\n\tunsigned long trailing_zero = 0;\n\tif (_BitScanForward64(&trailing_zero, value))\n\t\treturn trailing_zero;\n\treturn 0;\n}\n#else\nuint32_t __inline __builtin_clzll(uint64_t value)\n{\n\tif (value == 0)\n\t\treturn 0;\n\tuint32_t msh = (uint32_t)(value >> 32);\n\tuint32_t lsh = (uint32_t)(value & 0xFFFFFFFF);\n\tif (msh != 0)\n\t\treturn __builtin_clz(msh);\n\treturn 32 + __builtin_clz(lsh);\n}\nuint32_t __inline __builtin_ctzll(uint64_t value)\n{\n\tif (value == 0)\n\t\treturn 0;\n\tuint32_t msh = (uint32_t)(value >> 32);\n\tuint32_t lsh = (uint32_t)(value & 0xFFFFFFFF);\n\tif (msh != 0)\n\t\treturn __builtin_ctz(msh);\n\treturn 32 + __builtin_ctz(lsh);\n}\n#endif\n#define __builtin_clzl __builtin_clzll\n#endif\n\n#endif /* _WIMLIB_COMPILER_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/compress_common.h",
    "content": "/*\n * compress_common.h\n *\n * Header for compression code shared by multiple compression formats.\n */\n\n#ifndef _WIMLIB_COMPRESS_COMMON_H\n#define _WIMLIB_COMPRESS_COMMON_H\n\n#include \"wimlib/types.h\"\n\n#define MAX_NUM_SYMS\t\t799\t/* LZMS_MAX_NUM_SYMS */\n#define MAX_CODEWORD_LEN\t16\n\nvoid\nmake_canonical_huffman_code(unsigned num_syms, unsigned max_codeword_len,\n\t\t\t    const u32 freqs[], u8 lens[], u32 codewords[]);\n\n#endif /* _WIMLIB_COMPRESS_COMMON_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/compressor_ops.h",
    "content": "/*\n * compressor_ops.h\n *\n * Interface implemented by compressors for specific formats.\n */\n\n#ifndef _WIMLIB_COMPRESSOR_OPS_H\n#define _WIMLIB_COMPRESSOR_OPS_H\n\n#include \"wimlib/types.h\"\n\nstruct compressor_ops {\n\n\tu64 (*get_needed_memory)(size_t max_block_size,\n\t\t\t\t unsigned int compression_level,\n\t\t\t\t bool destructive);\n\n\tint (*create_compressor)(size_t max_block_size,\n\t\t\t\t unsigned int compression_level,\n\t\t\t\t bool destructive,\n\t\t\t\t void **private_ret);\n\n\tsize_t (*compress)(const void *uncompressed_data,\n\t\t\t   size_t uncompressed_size,\n\t\t\t   void *compressed_data,\n\t\t\t   size_t compressed_size_avail,\n\t\t\t   void *private);\n\n\tvoid (*free_compressor)(void *private);\n};\n\nextern const struct compressor_ops lzx_compressor_ops;\nextern const struct compressor_ops xpress_compressor_ops;\nextern const struct compressor_ops lzms_compressor_ops;\n\n#endif /* _WIMLIB_COMPRESSOR_OPS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/cpu_features.h",
    "content": "#ifndef _WIMLIB_CPU_FEATURES_H\n#define _WIMLIB_CPU_FEATURES_H\n\n#include \"wimlib/types.h\"\n\n#define X86_CPU_FEATURE_SSSE3\t\t0x00000001\n#define X86_CPU_FEATURE_SSE4_1\t\t0x00000002\n#define X86_CPU_FEATURE_SSE4_2\t\t0x00000004\n#define X86_CPU_FEATURE_AVX\t\t0x00000008\n#define X86_CPU_FEATURE_BMI2\t\t0x00000010\n#define X86_CPU_FEATURE_SHA\t\t0x00000020\n\n#define ARM_CPU_FEATURE_SHA1\t\t0x00000001\n\n#if (defined(__i386__) || defined(__x86_64__)) || \\\n    (defined (_M_IX86) || defined (_M_X64) || defined(_M_ARM64)) || \\\n    (defined(__aarch64__) && defined(__linux__)) || \\\n    (defined(__aarch64__) && defined(__linux__)) || \\\n    (defined(__aarch64__) && defined(__APPLE__)) || \\\n    (defined(__aarch64__) && defined(_WIN32))\n\n#define CPU_FEATURES_ENABLED\t1\nextern u32 cpu_features;\n\nvoid init_cpu_features(void);\n\n#else\n\n#define CPU_FEATURES_ENABLED\t0\n#define cpu_features 0\n\nstatic inline void\ninit_cpu_features(void)\n{\n}\n\n#endif\n\n#endif /* _WIMLIB_CPU_FEATURES_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/decompress_common.h",
    "content": "/*\n * decompress_common.h\n *\n * Header for decompression code shared by multiple compression formats.\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifndef _WIMLIB_DECOMPRESS_COMMON_H\n#define _WIMLIB_DECOMPRESS_COMMON_H\n\n#include <string.h>\n\n#include \"wimlib/compiler.h\"\n#include \"wimlib/types.h\"\n#include \"wimlib/unaligned.h\"\n\n/******************************************************************************/\n/*                   Input bitstream for XPRESS and LZX                       */\n/*----------------------------------------------------------------------------*/\n\n/* Structure that encapsulates a block of in-memory data being interpreted as a\n * stream of bits, optionally with interwoven literal bytes.  Bits are assumed\n * to be stored in little endian 16-bit coding units, with the bits ordered high\n * to low.  */\nstruct input_bitstream {\n\n\t/* Bits that have been read from the input buffer.  The bits are\n\t * left-justified; the next bit is always bit 31.  */\n\tu32 bitbuf;\n\n\t/* Number of bits currently held in @bitbuf.  */\n\tu32 bitsleft;\n\n\t/* Pointer to the next byte to be retrieved from the input buffer.  */\n\tconst u8 *next;\n\n\t/* Pointer past the end of the input buffer.  */\n\tconst u8 *end;\n};\n\n/* Initialize a bitstream to read from the specified input buffer.  */\nstatic forceinline void\ninit_input_bitstream(struct input_bitstream *is, const void *buffer, u32 size)\n{\n\tis->bitbuf = 0;\n\tis->bitsleft = 0;\n\tis->next = buffer;\n\tis->end = is->next + size;\n}\n\n/* Note: for performance reasons, the following methods don't return error codes\n * to the caller if the input buffer is overrun.  Instead, they just assume that\n * all overrun data is zeroes.  This has no effect on well-formed compressed\n * data.  The only disadvantage is that bad compressed data may go undetected,\n * but even this is irrelevant if higher level code checksums the uncompressed\n * data anyway.  */\n\n/* Ensure the bit buffer variable for the bitstream contains at least @num_bits\n * bits.  Following this, bitstream_peek_bits() and/or bitstream_remove_bits()\n * may be called on the bitstream to peek or remove up to @num_bits bits.  */\nstatic forceinline void\nbitstream_ensure_bits(struct input_bitstream *is, const unsigned num_bits)\n{\n\t/* This currently works for at most 17 bits.  */\n\n\tif (is->bitsleft >= num_bits)\n\t\treturn;\n\n\tif (unlikely(is->end - is->next < 2))\n\t\tgoto overflow;\n\n\tis->bitbuf |= (u32)get_unaligned_le16(is->next) << (16 - is->bitsleft);\n\tis->next += 2;\n\tis->bitsleft += 16;\n\n\tif (unlikely(num_bits == 17 && is->bitsleft == 16)) {\n\t\tif (unlikely(is->end - is->next < 2))\n\t\t\tgoto overflow;\n\n\t\tis->bitbuf |= (u32)get_unaligned_le16(is->next);\n\t\tis->next += 2;\n\t\tis->bitsleft = 32;\n\t}\n\n\treturn;\n\noverflow:\n\tis->bitsleft = 32;\n}\n\n/* Return the next @num_bits bits from the bitstream, without removing them.\n * There must be at least @num_bits remaining in the buffer variable, from a\n * previous call to bitstream_ensure_bits().  */\nstatic forceinline u32\nbitstream_peek_bits(const struct input_bitstream *is, const unsigned num_bits)\n{\n\treturn (is->bitbuf >> 1) >> (sizeof(is->bitbuf) * 8 - num_bits - 1);\n}\n\n/* Remove @num_bits from the bitstream.  There must be at least @num_bits\n * remaining in the buffer variable, from a previous call to\n * bitstream_ensure_bits().  */\nstatic forceinline void\nbitstream_remove_bits(struct input_bitstream *is, unsigned num_bits)\n{\n\tis->bitbuf <<= num_bits;\n\tis->bitsleft -= num_bits;\n}\n\n/* Remove and return @num_bits bits from the bitstream.  There must be at least\n * @num_bits remaining in the buffer variable, from a previous call to\n * bitstream_ensure_bits().  */\nstatic forceinline u32\nbitstream_pop_bits(struct input_bitstream *is, unsigned num_bits)\n{\n\tu32 bits = bitstream_peek_bits(is, num_bits);\n\tbitstream_remove_bits(is, num_bits);\n\treturn bits;\n}\n\n/* Read and return the next @num_bits bits from the bitstream.  */\nstatic forceinline u32\nbitstream_read_bits(struct input_bitstream *is, unsigned num_bits)\n{\n\tbitstream_ensure_bits(is, num_bits);\n\treturn bitstream_pop_bits(is, num_bits);\n}\n\n/* Read and return the next literal byte embedded in the bitstream.  */\nstatic forceinline u8\nbitstream_read_byte(struct input_bitstream *is)\n{\n\tif (unlikely(is->end == is->next))\n\t\treturn 0;\n\treturn *is->next++;\n}\n\n/* Read and return the next 16-bit integer embedded in the bitstream.  */\nstatic forceinline u16\nbitstream_read_u16(struct input_bitstream *is)\n{\n\tu16 v;\n\n\tif (unlikely(is->end - is->next < 2))\n\t\treturn 0;\n\tv = get_unaligned_le16(is->next);\n\tis->next += 2;\n\treturn v;\n}\n\n/* Read and return the next 32-bit integer embedded in the bitstream.  */\nstatic forceinline u32\nbitstream_read_u32(struct input_bitstream *is)\n{\n\tu32 v;\n\n\tif (unlikely(is->end - is->next < 4))\n\t\treturn 0;\n\tv = get_unaligned_le32(is->next);\n\tis->next += 4;\n\treturn v;\n}\n\n/* Read into @dst_buffer an array of literal bytes embedded in the bitstream.\n * Return 0 if there were enough bytes remaining in the input, otherwise -1. */\nstatic forceinline int\nbitstream_read_bytes(struct input_bitstream *is, void *dst_buffer, size_t count)\n{\n\tif (unlikely(is->end - is->next < count))\n\t\treturn -1;\n\tmemcpy(dst_buffer, is->next, count);\n\tis->next += count;\n\treturn 0;\n}\n\n/* Align the input bitstream on a coding-unit boundary.  */\nstatic forceinline void\nbitstream_align(struct input_bitstream *is)\n{\n\tis->bitsleft = 0;\n\tis->bitbuf = 0;\n}\n\n/******************************************************************************/\n/*                             Huffman decoding                               */\n/*----------------------------------------------------------------------------*/\n\n/*\n * Required alignment for the Huffman decode tables.  We require this alignment\n * so that we can fill the entries with vector or word instructions and not have\n * to deal with misaligned buffers.\n */\n#define DECODE_TABLE_ALIGNMENT 16\n\n/*\n * Each decode table entry is 16 bits divided into two fields: 'symbol' (high 12\n * bits) and 'length' (low 4 bits).  The precise meaning of these fields depends\n * on the type of entry:\n *\n * Root table entries which are *not* subtable pointers:\n *\tsymbol: symbol to decode\n *\tlength: codeword length in bits\n *\n * Root table entries which are subtable pointers:\n *\tsymbol: index of start of subtable\n *\tlength: number of bits with which the subtable is indexed\n *\n * Subtable entries:\n *\tsymbol: symbol to decode\n *\tlength: codeword length in bits, minus the number of bits with which the\n *\t\troot table is indexed\n */\n#define DECODE_TABLE_SYMBOL_SHIFT  4\n#define DECODE_TABLE_MAX_SYMBOL\t   ((1 << (16 - DECODE_TABLE_SYMBOL_SHIFT)) - 1)\n#define DECODE_TABLE_MAX_LENGTH    ((1 << DECODE_TABLE_SYMBOL_SHIFT) - 1)\n#define DECODE_TABLE_LENGTH_MASK   DECODE_TABLE_MAX_LENGTH\n#define MAKE_DECODE_TABLE_ENTRY(symbol, length) \\\n\t(((symbol) << DECODE_TABLE_SYMBOL_SHIFT) | (length))\n\n/*\n * Read and return the next Huffman-encoded symbol from the given bitstream\n * using the given decode table.\n *\n * If the input data is exhausted, then the Huffman symbol will be decoded as if\n * the missing bits were all zeroes.\n *\n * XXX: This is mostly duplicated in lzms_decode_huffman_symbol() in\n * lzms_decompress.c; keep them in sync!\n */\nstatic forceinline unsigned\nread_huffsym(struct input_bitstream *is, const u16 decode_table[],\n\t     unsigned table_bits, unsigned max_codeword_len)\n{\n\tunsigned entry;\n\tunsigned symbol;\n\tunsigned length;\n\n\t/* Preload the bitbuffer with 'max_codeword_len' bits so that we're\n\t * guaranteed to be able to fully decode a codeword. */\n\tbitstream_ensure_bits(is, max_codeword_len);\n\n\t/* Index the root table by the next 'table_bits' bits of input. */\n\tentry = decode_table[bitstream_peek_bits(is, table_bits)];\n\n\t/* Extract the \"symbol\" and \"length\" from the entry. */\n\tsymbol = entry >> DECODE_TABLE_SYMBOL_SHIFT;\n\tlength = entry & DECODE_TABLE_LENGTH_MASK;\n\n\t/* If the root table is indexed by the full 'max_codeword_len' bits,\n\t * then there cannot be any subtables, and this will be known at compile\n\t * time.  Otherwise, we must check whether the decoded symbol is really\n\t * a subtable pointer.  If so, we must discard the bits with which the\n\t * root table was indexed, then index the subtable by the next 'length'\n\t * bits of input to get the real entry. */\n\tif (max_codeword_len > table_bits &&\n\t    entry >= (1U << (table_bits + DECODE_TABLE_SYMBOL_SHIFT)))\n\t{\n\t\t/* Subtable required */\n\t\tbitstream_remove_bits(is, table_bits);\n\t\tentry = decode_table[symbol + bitstream_peek_bits(is, length)];\n\t\tsymbol = entry >> DECODE_TABLE_SYMBOL_SHIFT;\n\t\tlength = entry & DECODE_TABLE_LENGTH_MASK;\n\t}\n\n\t/* Discard the bits (or the remaining bits, if a subtable was required)\n\t * of the codeword. */\n\tbitstream_remove_bits(is, length);\n\n\t/* Return the decoded symbol. */\n\treturn symbol;\n}\n\n/*\n * The DECODE_TABLE_ENOUGH() macro evaluates to the maximum number of decode\n * table entries, including all subtable entries, that may be required for\n * decoding a given Huffman code.  This depends on three parameters:\n *\n *\tnum_syms: the maximum number of symbols in the code\n *\ttable_bits: the number of bits with which the root table will be indexed\n *\tmax_codeword_len: the maximum allowed codeword length in the code\n *\n * Given these parameters, the utility program 'enough' from zlib, when passed\n * the three arguments 'num_syms', 'table_bits', and 'max_codeword_len', will\n * compute the maximum number of entries required.  This has already been done\n * for the combinations we need and incorporated into the macro below so that\n * the mapping can be done at compilation time.  If an unknown combination is\n * used, then a compilation error will result.  To fix this, use 'enough' to\n * find the missing value and add it below.  If that still doesn't fix the\n * compilation error, then most likely a constraint would be violated by the\n * requested parameters, so they cannot be used, at least without other changes\n * to the decode table --- see DECODE_TABLE_SIZE().\n */\n#define DECODE_TABLE_ENOUGH(num_syms, table_bits, max_codeword_len) ( \\\n\t((num_syms) == 8 && (table_bits) == 7 && (max_codeword_len) == 15) ? 128 : \\\n\t((num_syms) == 8 && (table_bits) == 5 && (max_codeword_len) == 7) ? 36 : \\\n\t((num_syms) == 8 && (table_bits) == 6 && (max_codeword_len) == 7) ? 66 : \\\n\t((num_syms) == 8 && (table_bits) == 7 && (max_codeword_len) == 7) ? 128 : \\\n\t((num_syms) == 20 && (table_bits) == 5 && (max_codeword_len) == 15) ? 1062 : \\\n\t((num_syms) == 20 && (table_bits) == 6 && (max_codeword_len) == 15) ? 582 : \\\n\t((num_syms) == 20 && (table_bits) == 7 && (max_codeword_len) == 15) ? 390 : \\\n\t((num_syms) == 54 && (table_bits) == 9 && (max_codeword_len) == 15) ? 618 : \\\n\t((num_syms) == 54 && (table_bits) == 10 && (max_codeword_len) == 15) ? 1098 : \\\n\t((num_syms) == 249 && (table_bits) == 9 && (max_codeword_len) == 16) ? 878 : \\\n\t((num_syms) == 249 && (table_bits) == 10 && (max_codeword_len) == 16) ? 1326 : \\\n\t((num_syms) == 249 && (table_bits) == 11 && (max_codeword_len) == 16) ? 2318 : \\\n\t((num_syms) == 256 && (table_bits) == 9 && (max_codeword_len) == 15) ? 822 : \\\n\t((num_syms) == 256 && (table_bits) == 10 && (max_codeword_len) == 15) ? 1302 : \\\n\t((num_syms) == 256 && (table_bits) == 11 && (max_codeword_len) == 15) ? 2310 : \\\n\t((num_syms) == 512 && (table_bits) == 10 && (max_codeword_len) == 15) ? 1558 : \\\n\t((num_syms) == 512 && (table_bits) == 11 && (max_codeword_len) == 15) ? 2566 : \\\n\t((num_syms) == 512 && (table_bits) == 12 && (max_codeword_len) == 15) ? 4606 : \\\n\t((num_syms) == 656 && (table_bits) == 10 && (max_codeword_len) == 16) ? 1734 : \\\n\t((num_syms) == 656 && (table_bits) == 11 && (max_codeword_len) == 16) ? 2726 : \\\n\t((num_syms) == 656 && (table_bits) == 12 && (max_codeword_len) == 16) ? 4758 : \\\n\t((num_syms) == 799 && (table_bits) == 9 && (max_codeword_len) == 15) ? 1366 : \\\n\t((num_syms) == 799 && (table_bits) == 10 && (max_codeword_len) == 15) ? 1846 : \\\n\t((num_syms) == 799 && (table_bits) == 11 && (max_codeword_len) == 15) ? 2854 : \\\n\t-1)\n\n/* Wrapper around DECODE_TABLE_ENOUGH() that does additional compile-time\n * validation. */\n#define DECODE_TABLE_SIZE(num_syms, table_bits, max_codeword_len) (\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t/* All values must be positive. */\t\t\t\t\\\n\tSTATIC_ASSERT_ZERO((num_syms) > 0) +\t\t\t\t\\\n\tSTATIC_ASSERT_ZERO((table_bits) > 0) +\t\t\t\t\\\n\tSTATIC_ASSERT_ZERO((max_codeword_len) > 0) +\t\t\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t/* There cannot be more symbols than possible codewords. */\t\\\n\tSTATIC_ASSERT_ZERO((num_syms) <= 1U << (max_codeword_len)) +\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t/* There is no reason for the root table to be indexed with\n\t * more bits than the maximum codeword length. */\t\t\\\n\tSTATIC_ASSERT_ZERO((table_bits) <= (max_codeword_len)) +\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t/* The maximum symbol value must fit in the 'symbol' field. */\t\\\n\tSTATIC_ASSERT_ZERO((num_syms) - 1 <= DECODE_TABLE_MAX_SYMBOL) +\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t/* The maximum codeword length in the root table must fit in\n\t * the 'length' field. */\t\t\t\t\t\\\n\tSTATIC_ASSERT_ZERO((table_bits) <= DECODE_TABLE_MAX_LENGTH) +\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t/* The maximum codeword length in a subtable must fit in the\n\t * 'length' field. */\t\t\t\t\t\t\\\n\tSTATIC_ASSERT_ZERO((max_codeword_len) - (table_bits) <=\t\t\\\n\t\t\t   DECODE_TABLE_MAX_LENGTH) +\t\t\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t/* The minimum subtable index must be greater than the maximum\n\t * symbol value.  If this were not the case, then there would\n\t * be no way to tell whether a given root table entry is a\n\t * \"subtable pointer\" or not.  (An alternate solution would be\n\t * to reserve a flag bit specifically for this purpose.) */\t\\\n\tSTATIC_ASSERT_ZERO((1U << table_bits) > (num_syms) - 1) +\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t/* The needed 'enough' value must have been defined. */\t\t\\\n\tSTATIC_ASSERT_ZERO(DECODE_TABLE_ENOUGH(\t\t\t\t\\\n\t\t\t\t(num_syms), (table_bits),\t\t\\\n\t\t\t\t(max_codeword_len)) > 0) +\t\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t/* The maximum subtable index must fit in the 'symbol' field. */\\\n\tSTATIC_ASSERT_ZERO(DECODE_TABLE_ENOUGH(\t\t\t\t\\\n\t\t\t\t(num_syms), (table_bits),\t\t\\\n\t\t\t\t(max_codeword_len)) - 1 <=\t\t\\\n\t\t\t\t\tDECODE_TABLE_MAX_SYMBOL) +\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t/* Finally, make the macro evaluate to the needed maximum\n\t * number of decode table entries. */\t\t\t\t\\\n\tDECODE_TABLE_ENOUGH((num_syms), (table_bits),\t\t\t\\\n\t\t\t    (max_codeword_len))\t\t\t\t\\\n)\n\n/*\n * Declare the decode table for a Huffman code, given several compile-time\n * constants that describe the code.  See DECODE_TABLE_ENOUGH() for details.\n *\n * Decode tables must be aligned to a DECODE_TABLE_ALIGNMENT-byte boundary.\n * This implies that if a decode table is nested inside a dynamically allocated\n * structure, then the outer structure must be allocated on a\n * DECODE_TABLE_ALIGNMENT-byte aligned boundary as well.\n */\n#define DECODE_TABLE(name, num_syms, table_bits, max_codeword_len) \\\n\tPRAGMA_BEGIN_ALIGN(DECODE_TABLE_ALIGNMENT) \\\n\tu16 name[DECODE_TABLE_SIZE((num_syms), (table_bits), \\\n\t\t\t\t   (max_codeword_len))]\t\\\n\tPRAGMA_END_ALIGN(DECODE_TABLE_ALIGNMENT)\n\n/*\n * Declare the temporary \"working_space\" array needed for building the decode\n * table for a Huffman code.\n */\n#define DECODE_TABLE_WORKING_SPACE(name, num_syms, max_codeword_len)\t\\\n\tu16 name[2 * ((max_codeword_len) + 1)  + (num_syms)]\n\nint\nmake_huffman_decode_table(u16 decode_table[], unsigned num_syms,\n\t\t\t  unsigned table_bits, const u8 lens[],\n\t\t\t  unsigned max_codeword_len, u16 working_space[]);\n\n/******************************************************************************/\n/*                             LZ match copying                               */\n/*----------------------------------------------------------------------------*/\n\nstatic forceinline void\ncopy_word_unaligned(const void *src, void *dst)\n{\n\tstore_word_unaligned(load_word_unaligned(src), dst);\n}\n\nstatic forceinline machine_word_t\nrepeat_u16(u16 b)\n{\n\tmachine_word_t v = b;\n\n\tSTATIC_ASSERT(WORDBITS == 32 || WORDBITS == 64);\n\tv |= v << 16;\n\tv |= v << ((WORDBITS == 64) ? 32 : 0);\n\treturn v;\n}\n\nstatic forceinline machine_word_t\nrepeat_byte(u8 b)\n{\n\treturn repeat_u16(((u16)b << 8) | b);\n}\n\n/*\n * Copy an LZ77 match of 'length' bytes from the match source at 'out_next -\n * offset' to the match destination at 'out_next'.  The source and destination\n * may overlap.\n *\n * This handles validating the length and offset.  It is validated that the\n * beginning of the match source is '>= out_begin' and that end of the match\n * destination is '<= out_end'.  The return value is 0 if the match was valid\n * (and was copied), otherwise -1.\n *\n * 'min_length' is a hint which specifies the minimum possible match length.\n * This should be a compile-time constant.\n */\nstatic forceinline int\nlz_copy(u32 length, u32 offset, u8 *out_begin, u8 *out_next, u8 *out_end,\n\tu32 min_length)\n{\n\tconst u8 *src;\n\tu8 *end;\n\n\t/* Validate the offset. */\n\tif (unlikely(offset > out_next - out_begin))\n\t\treturn -1;\n\n\t/*\n\t * Fast path: copy a match which is no longer than a few words, is not\n\t * overlapped such that copying a word at a time would produce incorrect\n\t * results, and is not too close to the end of the buffer.  Note that\n\t * this might copy more than the length of the match, but that's okay in\n\t * this scenario.\n\t */\n\tsrc = out_next - offset;\n\tif (UNALIGNED_ACCESS_IS_FAST && length <= 3 * WORDBYTES &&\n\t    offset >= WORDBYTES && out_end - out_next >= 3 * WORDBYTES)\n\t{\n\t\tcopy_word_unaligned(src + WORDBYTES*0, out_next + WORDBYTES*0);\n\t\tcopy_word_unaligned(src + WORDBYTES*1, out_next + WORDBYTES*1);\n\t\tcopy_word_unaligned(src + WORDBYTES*2, out_next + WORDBYTES*2);\n\t\treturn 0;\n\t}\n\n\t/* Validate the length.  This isn't needed in the fast path above, due\n\t * to the additional conditions tested, but we do need it here. */\n\tif (unlikely(length > out_end - out_next))\n\t\treturn -1;\n\tend = out_next + length;\n\n\t/*\n\t * Try to copy one word at a time.  On i386 and x86_64 this is faster\n\t * than copying one byte at a time, unless the data is near-random and\n\t * all the matches have very short lengths.  Note that since this\n\t * requires unaligned memory accesses, it won't necessarily be faster on\n\t * every architecture.\n\t *\n\t * Also note that we might copy more than the length of the match.  For\n\t * example, if a word is 8 bytes and the match is of length 5, then\n\t * we'll simply copy 8 bytes.  This is okay as long as we don't write\n\t * beyond the end of the output buffer, hence the check for (out_end -\n\t * end >= WORDBYTES - 1).\n\t */\n\tif (UNALIGNED_ACCESS_IS_FAST && likely(out_end - end >= WORDBYTES - 1))\n\t{\n\t\tif (offset >= WORDBYTES) {\n\t\t\t/* The source and destination words don't overlap. */\n\t\t\tdo {\n\t\t\t\tcopy_word_unaligned(src, out_next);\n\t\t\t\tsrc += WORDBYTES;\n\t\t\t\tout_next += WORDBYTES;\n\t\t\t} while (out_next < end);\n\t\t\treturn 0;\n\t\t} else if (offset == 1) {\n\t\t\t/* Offset 1 matches are equivalent to run-length\n\t\t\t * encoding of the previous byte.  This case is common\n\t\t\t * if the data contains many repeated bytes. */\n\t\t\tmachine_word_t v = repeat_byte(*(out_next - 1));\n\t\t\tdo {\n\t\t\t\tstore_word_unaligned(v, out_next);\n\t\t\t\tsrc += WORDBYTES;\n\t\t\t\tout_next += WORDBYTES;\n\t\t\t} while (out_next < end);\n\t\t\treturn 0;\n\t\t}\n\t\t/*\n\t\t * We don't bother with special cases for other 'offset <\n\t\t * WORDBYTES', which are usually rarer than 'offset == 1'.\n\t\t * Extra checks will just slow things down.  Actually, it's\n\t\t * possible to handle all the 'offset < WORDBYTES' cases using\n\t\t * the same code, but it still becomes more complicated doesn't\n\t\t * seem any faster overall; it definitely slows down the more\n\t\t * common 'offset == 1' case.\n\t\t */\n\t}\n\n\t/* Fall back to a bytewise copy.  */\n\tif (min_length >= 2)\n\t\t*out_next++ = *src++;\n\tif (min_length >= 3)\n\t\t*out_next++ = *src++;\n\tif (min_length >= 4)\n\t\t*out_next++ = *src++;\n\tdo {\n\t\t*out_next++ = *src++;\n\t} while (out_next != end);\n\treturn 0;\n}\n\n#endif /* _WIMLIB_DECOMPRESS_COMMON_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/decompressor_ops.h",
    "content": "/*\n * decompressor_ops.h\n *\n * Interface implemented by decompressors for specific formats.\n */\n\n#ifndef _WIMLIB_DECOMPRESSOR_OPS_H\n#define _WIMLIB_DECOMPRESSOR_OPS_H\n\n#include <stddef.h>\n\nstruct decompressor_ops {\n\n\tint (*create_decompressor)(size_t max_block_size, void **private_ret);\n\n\tint (*decompress)(const void *compressed_data,\n\t\t\t  size_t compressed_size,\n\t\t\t  void *uncompressed_data,\n\t\t\t  size_t uncompressed_size,\n\t\t\t  void *private);\n\n\tvoid (*free_decompressor)(void *private);\n};\n\nextern const struct decompressor_ops lzx_decompressor_ops;\nextern const struct decompressor_ops xpress_decompressor_ops;\nextern const struct decompressor_ops lzms_decompressor_ops;\n\n#endif /* _WIMLIB_DECOMPRESSOR_OPS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/dentry.h",
    "content": "#ifndef _WIMLIB_DENTRY_H\n#define _WIMLIB_DENTRY_H\n\n#include \"wimlib/avl_tree.h\"\n#include \"wimlib/case.h\"\n#include \"wimlib/compiler.h\"\n#include \"wimlib/inode.h\"\n#include \"wimlib/list.h\"\n#include \"wimlib/types.h\"\n\nstruct wim_inode;\nstruct blob_table;\n\n/* Base size of a WIM dentry in the on-disk format, up to and including the file\n * name length.  This does not include the variable-length file name, short\n * name, extra stream entries, and padding to 8-byte boundaries.  */\n#define WIM_DENTRY_DISK_SIZE 102\n\n/*\n * In-memory structure for a WIM directory entry (dentry).  There is a directory\n * tree for each image in the WIM.\n *\n * Note that this is a directory entry and not an inode.  Since NTFS allows hard\n * links, it's possible for an NTFS inode to correspond to multiple WIM\n * dentries.  The hard link group ID field of the on-disk WIM dentry tells us\n * the number of the NTFS inode that the dentry corresponds to (and this gets\n * placed in d_inode->i_ino).\n *\n * Unfortunately, WIM files do not have an analogue to an inode; instead certain\n * information, such as file attributes, the security descriptor, and streams is\n * replicated in each hard-linked dentry, even though this information really is\n * associated with an inode.  In-memory, we fix up this flaw by allocating a\n * `struct wim_inode' for each dentry that contains some of this duplicated\n * information, then combining the inodes for each hard link group together.\n * (See dentry_tree_fix_inodes().)\n */\nstruct wim_dentry {\n\t/* Pointer to the inode for this dentry.  This will contain some\n\t * information that was factored out of the on-disk WIM dentry as common\n\t * to all dentries in a hard link group.  */\n\tstruct wim_inode *d_inode;\n\n\t/* Node for the parent's balanced binary search tree of child dentries\n\t * keyed by filename (root i_children).  */\n\tstruct avl_tree_node d_index_node;\n\n\t/* The parent of this directory entry. (The root is its own parent.)  */\n\tstruct wim_dentry *d_parent;\n\n\t/* Linked list node that places this dentry in the list of aliases for\n\t * its inode (d_inode) */\n\tstruct hlist_node d_alias_node;\n\n\t/* Pointer to the UTF-16LE filename (malloc()ed buffer), or NULL if this\n\t * dentry has no filename.  */\n\tutf16lechar *d_name;\n\n\t/* Pointer to the UTF-16LE short filename (malloc()ed buffer), or NULL\n\t * if this dentry has no short name.  */\n\tutf16lechar *d_short_name;\n\n\t/* Length of 'd_name' in bytes, excluding the terminating null  */\n\tu16 d_name_nbytes;\n\n\t/* Length of 'd_short_name' in bytes, excluding the terminating null  */\n\tu16 d_short_name_nbytes;\n\n\t/* (Extraction only) Length of 'd_extraction_name' in _characters_,\n\t * excluding the terminating null  */\n\tu16 d_extraction_name_nchars;\n\n\t/* When capturing from an NTFS volume using NTFS-3G, this flag is set on\n\t * dentries that were created from a filename in the WIN32 or WIN32+DOS\n\t * namespaces rather than the POSIX namespace.  Otherwise this will\n\t * always be 0.  */\n\tu16 d_is_win32_name : 1;\n\n\t/* Temporary flag; always reset to 0 when done using.  */\n\tu16 d_tmp_flag : 1;\n\n\t/* Used by wimlib_update_image()  */\n\tu16 d_is_orphan : 1;\n\n\tunion {\n\t\t/* The subdir offset is only used while reading and writing this\n\t\t * dentry.  See the corresponding field in `struct\n\t\t * wim_dentry_on_disk' for explanation.  */\n\t\tu64 d_subdir_offset;\n\n\t\t/* Temporary list field  */\n\t\tstruct list_head d_tmp_list;\n\t};\n\n\t/* Full path to this dentry in the WIM, in platform-dependent tchars\n\t * that can be printed without conversion.  By default this field will\n\t * be NULL and will only be calculated on-demand by the\n\t * calculate_dentry_full_path() or dentry_full_path() functions.  */\n\ttchar *d_full_path;\n\n\t/* (Extraction only) Actual name to extract this dentry as.  This may be\n\t * either in 'tchars' or in 'utf16lechars', depending on what encoding\n\t * the extraction backend needs.  This may alias 'd_name'.  If it\n\t * doesn't, it is an allocated buffer which must be freed.  */\n\tvoid *d_extraction_name;\n\n\t/* (Extraction only) Linked list node that connects all dentries being\n\t * extracted as part of the current extraction operation.  */\n\tstruct list_head d_extraction_list_node;\n\n\t/* (Extraction only) Pointer to the next alias of this dentry's inode\n\t * that needs to be extracted as part of the current extraction\n\t * operation, or NULL if this is the last alias.  */\n\tstruct wim_dentry *d_next_extraction_alias;\n\n#ifdef ENABLE_TEST_SUPPORT\n\tstruct wim_dentry *d_corresponding;\n#endif\n};\n\nstatic inline bool\nwill_extract_dentry(const struct wim_dentry *dentry)\n{\n\treturn dentry->d_extraction_list_node.next != NULL;\n}\n\nsize_t\ndentry_out_total_length(const struct wim_dentry *dentry);\n\nint\nfor_dentry_in_tree(struct wim_dentry *root,\n\t\t   int (*visitor)(struct wim_dentry *, void *), void *args);\n\n/* Iterate through each @child dentry of the @dir directory inode in\n * collation order.  */\n#define for_inode_child(child, dir)\t\t\t\t\t\\\n\tavl_tree_for_each_in_order((child), (dir)->i_children,\t\t\\\n\t\t\t\t   struct wim_dentry, d_index_node)\n\n/* Iterate through each @child dentry of the @parent dentry in\n * collation order.  */\n#define for_dentry_child(child, parent) \\\n\tfor_inode_child((child), (parent)->d_inode)\n\n/* Iterate through each @child dentry of the @dir directory inode in\n * postorder (safe for freeing the child dentries).  */\n#define for_inode_child_postorder(child, dir)\t\t\t\t\\\n\tavl_tree_for_each_in_postorder((child), (dir)->i_children,\t\\\n\t\t\t\t       struct wim_dentry, d_index_node)\n\n/* Iterate through each @child dentry of the @parent dentry in\n * postorder (safe for freeing the child dentries).  */\n#define for_dentry_child_postorder(child, parent) \\\n\tfor_inode_child_postorder((child), (parent)->d_inode)\n\n/* Get any child dentry of the @dir directory inode.  Requires\n * inode_has_children(@dir) == true.  */\n#define inode_any_child(dir)\t\\\n\tavl_tree_entry((dir)->i_children, struct wim_dentry, d_index_node)\n\n/* Get any child dentry of the @parent dentry.  Requires\n * dentry_has_children(@parent) == true.  */\n#define dentry_any_child(parent) \\\n\tinode_any_child((parent)->d_inode)\n\nstruct wim_dentry *\ndentry_get_first_ci_match(struct wim_dentry *dentry);\n\nstruct wim_dentry *\ndentry_get_next_ci_match(struct wim_dentry *dentry,\n\t\t\t struct wim_dentry *ci_match);\n\n/* Iterate through all other dentries which have the same case insensitive name\n * as the one given.  */\n#define dentry_for_each_ci_match(ci_match, dentry)\t\t\t\\\n\tfor ((ci_match) = dentry_get_first_ci_match((dentry));\t\t\\\n\t     (ci_match);\t\t\t\t\t\t\\\n\t     (ci_match) = dentry_get_next_ci_match((dentry), (ci_match)))\n\nvoid\ncalculate_subdir_offsets(struct wim_dentry *root, u64 *subdir_offset_p);\n\nint\ndentry_set_name(struct wim_dentry *dentry, const tchar *name);\n\nint\ndentry_set_name_utf16le(struct wim_dentry *dentry, const utf16lechar *name,\n\t\t\tsize_t name_nbytes);\n\nstruct wim_dentry *\nget_dentry(WIMStruct *wim, const tchar *path, CASE_SENSITIVITY_TYPE case_type);\n\nstruct wim_dentry *\nget_dentry_child_with_name(const struct wim_dentry *dentry, const tchar *name,\n\t\t\t   CASE_SENSITIVITY_TYPE case_type);\n\nstruct wim_dentry *\nget_dentry_child_with_utf16le_name(const struct wim_dentry *dentry,\n\t\t\t\t   const utf16lechar *name,\n\t\t\t\t   size_t name_nbytes,\n\t\t\t\t   CASE_SENSITIVITY_TYPE case_type);\n\nstruct wim_dentry *\nget_parent_dentry(WIMStruct *wim, const tchar *path,\n\t\t  CASE_SENSITIVITY_TYPE case_type);\n\nint\ncalculate_dentry_full_path(struct wim_dentry *dentry);\n\ntchar *\ndentry_full_path(struct wim_dentry *dentry);\n\nint\nnew_dentry_with_new_inode(const tchar *name, bool set_timestamps,\n\t\t\t  struct wim_dentry **dentry_ret);\n\nint\nnew_dentry_with_existing_inode(const tchar *name, struct wim_inode *inode,\n\t\t\t       struct wim_dentry **dentry_ret);\n\nint\nnew_filler_directory(struct wim_dentry **dentry_ret);\n\nvoid\nfree_dentry(struct wim_dentry *dentry);\n\nvoid\nfree_dentry_tree(struct wim_dentry *root, struct blob_table *blob_table);\n\nvoid\nunlink_dentry(struct wim_dentry *dentry);\n\nstruct wim_dentry *\ndentry_add_child(struct wim_dentry *parent, struct wim_dentry *child);\n\nstruct update_command_journal;\n\nint\nrename_wim_path(WIMStruct *wim, const tchar *from, const tchar *to,\n\t\tCASE_SENSITIVITY_TYPE case_type, bool noreplace,\n\t\tstruct update_command_journal *j);\n\n\nint\nread_dentry_tree(const u8 *buf, size_t buf_len,\n\t\t u64 root_offset, struct wim_dentry **root_ret);\n\nu8 *\nwrite_dentry_tree(struct wim_dentry *root, u8 *p);\n\nstatic inline bool\ndentry_is_root(const struct wim_dentry *dentry)\n{\n\treturn dentry->d_parent == dentry;\n}\n\nstatic inline bool\ndentry_is_directory(const struct wim_dentry *dentry)\n{\n\treturn inode_is_directory(dentry->d_inode);\n}\n\nstatic inline bool\ndentry_has_children(const struct wim_dentry *dentry)\n{\n\treturn inode_has_children(dentry->d_inode);\n}\n\nstatic inline bool\ndentry_has_long_name(const struct wim_dentry *dentry)\n{\n\treturn dentry->d_name_nbytes != 0;\n}\n\nstatic inline bool\ndentry_has_short_name(const struct wim_dentry *dentry)\n{\n\treturn dentry->d_short_name_nbytes != 0;\n}\n\n#endif /* _WIMLIB_DENTRY_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/divsufsort.h",
    "content": "#ifndef _WIMLIB_DIVSUFSORT_H\n#define _WIMLIB_DIVSUFSORT_H\n\n#include \"wimlib/types.h\"\n\nvoid\ndivsufsort(const u8 *T, u32 *SA, u32 n, u32 *tmp);\n\n#define DIVSUFSORT_TMP_LEN (256 + (256 * 256))\n\n#endif /* _WIMLIB_DIVSUFSORT_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/encoding.h",
    "content": "#ifndef _WIMLIB_ENCODING_H\n#define _WIMLIB_ENCODING_H\n\n#include <string.h>\n\n#include \"wimlib/error.h\"\n#include \"wimlib/util.h\"\n#include \"wimlib/types.h\"\n\n/* String conversion functions */\n\nint\nutf8_to_utf16le(const char *in, size_t in_nbytes,\n\t\tutf16lechar **out_ret, size_t *out_nbytes_ret);\n\nint\nutf16le_to_utf8(const utf16lechar *in, size_t in_nbytes,\n\t\tchar **out_ret, size_t *out_nbytes_ret);\n\n/* Identity conversion: duplicate a 'tchar' string. */\nstatic inline int\ntstr_to_tstr(const tchar *in, size_t in_nbytes,\n\t     tchar **out_ret, size_t *out_nbytes_ret)\n{\n\ttchar *out = MALLOC(in_nbytes + sizeof(tchar));\n\tif (unlikely(!out))\n\t\treturn WIMLIB_ERR_NOMEM;\n\tmemcpy(out, in, in_nbytes);\n\tout[in_nbytes / sizeof(tchar)] = 0;\n\t*out_ret = out;\n\tif (out_nbytes_ret)\n\t\t*out_nbytes_ret = in_nbytes;\n\treturn 0;\n}\n\n#if TCHAR_IS_UTF16LE\n\n/* tstr(UTF-16LE) <=> UTF-16LE  */\n#  define tstr_to_utf16le\ttstr_to_tstr\n#  define utf16le_to_tstr\ttstr_to_tstr\n\n/* tstr(UTF-16LE) <=> UTF-8  */\n#  define tstr_to_utf8\t\tutf16le_to_utf8\n#  define utf8_to_tstr\t\tutf8_to_utf16le\n\n#else\n\n/* tstr(UTF-8) <=> UTF-16LE  */\n#  define tstr_to_utf16le\tutf8_to_utf16le\n#  define utf16le_to_tstr\tutf16le_to_utf8\n\n/* tstr(UTF-8) <=> UTF-8  */\n#  define tstr_to_utf8\t\ttstr_to_tstr\n#  define utf8_to_tstr\t\ttstr_to_tstr\n\n#endif\n\n/* Convert a tchar string to UTF-16LE, but if both encodings are UTF-16LE, then\n * simply re-use the string.  Release with tstr_put_utf16le() when done.  */\nstatic inline int\ntstr_get_utf16le_and_len(const tchar *in,\n\t\t\t const utf16lechar **out_ret, size_t *out_nbytes_ret)\n{\n\tsize_t in_nbytes = tstrlen(in) * sizeof(tchar);\n#if TCHAR_IS_UTF16LE\n\t*out_ret = in;\n\tif (out_nbytes_ret)\n\t\t*out_nbytes_ret = in_nbytes;\n\treturn 0;\n#else\n\treturn tstr_to_utf16le(in, in_nbytes,\n\t\t\t       (utf16lechar **)out_ret, out_nbytes_ret);\n#endif\n}\n\nstatic inline int\ntstr_get_utf16le(const tchar *in, const utf16lechar **out_ret)\n{\n\treturn tstr_get_utf16le_and_len(in, out_ret, NULL);\n}\n\n/* Release a string acquired with tstr_get_utf16le() or\n * tstr_get_utf16le_and_len().  */\nstatic inline void\ntstr_put_utf16le(const utf16lechar *s)\n{\n#if !TCHAR_IS_UTF16LE\n\tFREE((void *)s);\n#endif\n}\n\n/* Convert a UTF-16LE string to a tchar string, but if both encodings are\n * UTF-16LE, then simply re-use the string.  Release with utf16le_put_tstr()\n * when done.  */\nstatic inline int\nutf16le_get_tstr(const utf16lechar *in, size_t in_nbytes,\n\t\t const tchar **out_ret, size_t *out_nbytes_ret)\n{\n#if TCHAR_IS_UTF16LE\n\t*out_ret = in;\n\tif (out_nbytes_ret)\n\t\t*out_nbytes_ret = in_nbytes;\n\treturn 0;\n#else\n\treturn utf16le_to_tstr(in, in_nbytes,\n\t\t\t       (tchar **)out_ret, out_nbytes_ret);\n#endif\n}\n\n/* Release a string acquired with utf16le_get_tstr().  */\nstatic inline void\nutf16le_put_tstr(const tchar *s)\n{\n#if !TCHAR_IS_UTF16LE\n\tFREE((void *)s);\n#endif\n}\n\n\n/* UTF-16LE utilities */\n\nextern u16 upcase[65536];\n\nvoid\ninit_upcase(void);\n\nint\ncmp_utf16le_strings(const utf16lechar *s1, size_t n1,\n\t\t    const utf16lechar *s2, size_t n2,\n\t\t    bool ignore_case);\n\nint\ncmp_utf16le_strings_z(const utf16lechar *s1, const utf16lechar *s2,\n\t\t      bool ignore_case);\n\nutf16lechar *\nutf16le_dupz(const void *s, size_t size);\n\nutf16lechar *\nutf16le_dup(const utf16lechar *s);\n\nsize_t\nutf16le_len_bytes(const utf16lechar *s);\n\nsize_t\nutf16le_len_chars(const utf16lechar *s);\n\n#endif /* _WIMLIB_ENCODING_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/endianness.h",
    "content": "/*\n * endianness.h - macros and inline functions for endianness conversion\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifndef _WIMLIB_ENDIANNESS_H\n#define _WIMLIB_ENDIANNESS_H\n\n#include \"wimlib/compiler.h\"\n#include \"wimlib/types.h\"\n\n#ifdef HAVE_SYS_ENDIAN_H\n   /* Needed on NetBSD to stop system bswap macros from messing things up */\n#  include <sys/endian.h>\n#  undef bswap16\n#  undef bswap32\n#  undef bswap64\n#endif\n\n/* Watch out for conflict with ntfs-3g/endians.h ... */\n#ifndef _NTFS_ENDIANS_H\n\n#ifdef _MSC_VER\n\n#include <intrin.h>\n#define bswap16 _byteswap_ushort\n#define bswap32 _byteswap_ulong\n#define bswap64 _byteswap_uint64\n\n#else\n\n#define bswap16_const(n)\t\t\t\\\n\t((((u16)(n) & 0x00FF) << 8)\t|\t\\\n\t (((u16)(n) & 0xFF00) >> 8))\n\n#define bswap32_const(n)\t\t\t\t\\\n\t((((u32)(n) & 0x000000FF) << 24)\t|\t\\\n\t (((u32)(n) & 0x0000FF00) << 8)\t\t|\t\\\n\t (((u32)(n) & 0x00FF0000) >> 8)\t\t|\t\\\n\t (((u32)(n) & 0xFF000000) >> 24))\n\n#define bswap64_const(n)\t\t\t\t\t\\\n\t((((u64)(n) & 0x00000000000000FF) << 56)\t|\t\\\n\t (((u64)(n) & 0x000000000000FF00) << 40)\t|\t\\\n\t (((u64)(n) & 0x0000000000FF0000) << 24)\t|\t\\\n\t (((u64)(n) & 0x00000000FF000000) << 8)\t\t|\t\\\n\t (((u64)(n) & 0x000000FF00000000) >> 8)\t\t|\t\\\n\t (((u64)(n) & 0x0000FF0000000000) >> 24)\t|\t\\\n\t (((u64)(n) & 0x00FF000000000000) >> 40)\t|\t\\\n\t (((u64)(n) & 0xFF00000000000000) >> 56))\n\nstatic forceinline u16 do_bswap16(u16 n)\n{\n#if GCC_PREREQ(4, 8) || __has_builtin(__builtin_bswap16)\n\treturn __builtin_bswap16(n);\n#else\n\treturn bswap16_const(n);\n#endif\n}\n\nstatic forceinline u32 do_bswap32(u32 n)\n{\n#if GCC_PREREQ(4, 3) || __has_builtin(__builtin_bswap32)\n\treturn __builtin_bswap32(n);\n#else\n\treturn bswap32_const(n);\n#endif\n}\n\nstatic forceinline u64 do_bswap64(u64 n)\n{\n#if GCC_PREREQ(4, 3) || __has_builtin(__builtin_bswap64)\n\treturn __builtin_bswap64(n);\n#else\n\treturn bswap64_const(n);\n#endif\n}\n\n#define bswap16(n) (__builtin_constant_p(n) ? bswap16_const(n) : do_bswap16(n))\n#define bswap32(n) (__builtin_constant_p(n) ? bswap32_const(n) : do_bswap32(n))\n#define bswap64(n) (__builtin_constant_p(n) ? bswap64_const(n) : do_bswap64(n))\n\n#endif /* _MSC_VER */\n\n#if CPU_IS_BIG_ENDIAN()\n#  define cpu_to_le16(n) ((_force_attr le16)bswap16(n))\n#  define cpu_to_le32(n) ((_force_attr le32)bswap32(n))\n#  define cpu_to_le64(n) ((_force_attr le64)bswap64(n))\n#  define le16_to_cpu(n) bswap16((_force_attr u16)(le16)(n))\n#  define le32_to_cpu(n) bswap32((_force_attr u32)(le32)(n))\n#  define le64_to_cpu(n) bswap64((_force_attr u64)(le64)(n))\n#  define cpu_to_be16(n) ((_force_attr be16)(u16)(n))\n#  define cpu_to_be32(n) ((_force_attr be32)(u32)(n))\n#  define cpu_to_be64(n) ((_force_attr be64)(u64)(n))\n#  define be16_to_cpu(n) ((_force_attr u16)(be16)(n))\n#  define be32_to_cpu(n) ((_force_attr u32)(be32)(n))\n#  define be64_to_cpu(n) ((_force_attr u64)(be64)(n))\n#else\n#  define cpu_to_le16(n) ((_force_attr le16)(u16)(n))\n#  define cpu_to_le32(n) ((_force_attr le32)(u32)(n))\n#  define cpu_to_le64(n) ((_force_attr le64)(u64)(n))\n#  define le16_to_cpu(n) ((_force_attr u16)(le16)(n))\n#  define le32_to_cpu(n) ((_force_attr u32)(le32)(n))\n#  define le64_to_cpu(n) ((_force_attr u64)(le64)(n))\n#  define cpu_to_be16(n) ((_force_attr be16)bswap16(n))\n#  define cpu_to_be32(n) ((_force_attr be32)bswap32(n))\n#  define cpu_to_be64(n) ((_force_attr be64)bswap64(n))\n#  define be16_to_cpu(n) bswap16((_force_attr u16)(be16)(n))\n#  define be32_to_cpu(n) bswap32((_force_attr u32)(be32)(n))\n#  define be64_to_cpu(n) bswap64((_force_attr u64)(be64)(n))\n#endif\n\n#endif /* _NTFS_ENDIANS_H */\n#endif /* _WIMLIB_ENDIANNESS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/error.h",
    "content": "#ifndef _WIMLIB_ERROR_H\n#define _WIMLIB_ERROR_H\n\n#include <stdio.h>\n\n#include \"wimlib.h\" /* Get error code definitions */\n#include \"wimlib/compiler.h\"\n#include \"wimlib/types.h\"\n\nvoid _format_attribute(printf, 1, 2) __attribute__((cold))\nwimlib_error(const tchar *format, ...);\n\nvoid _format_attribute(printf, 1, 2) __attribute__((cold))\nwimlib_error_with_errno(const tchar *format, ...);\n\nvoid _format_attribute(printf, 1, 2) __attribute__((cold))\nwimlib_warning(const tchar *format, ...);\n\nvoid _format_attribute(printf, 1, 2) __attribute__((cold))\nwimlib_warning_with_errno(const tchar *format, ...);\n\n#ifdef _RUFUS\n#include \"rufus.h\"\n#ifdef ERROR\n#undef ERROR\n#endif\n#define ERROR(format, ...)\t\twuprintf(T(format)T(\"\\n\"), ## __VA_ARGS__)\n#define ERROR_WITH_ERRNO\t\tERROR\n#define WARNING(format, ...)\twuprintf(T(format)T(\"\\n\"), ## __VA_ARGS__)\n#define WARNING_WITH_ERRNO\t\tWARNING\n#else\n#define ERROR(format, ...)\t\twimlib_error(T(format), ## __VA_ARGS__)\n#define ERROR_WITH_ERRNO(format, ...)\twimlib_error_with_errno(T(format), ## __VA_ARGS__)\n#define WARNING(format, ...)\t\twimlib_warning(T(format), ## __VA_ARGS__)\n#define WARNING_WITH_ERRNO(format, ...)\twimlib_warning_with_errno(T(format), ## __VA_ARGS__)\n#endif\n\nextern bool wimlib_print_errors;\nextern FILE *wimlib_error_file;\n\nvoid\nprint_byte_field(const u8 *field, size_t len, FILE *out);\n\n#endif /* _WIMLIB_ERROR_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/file_io.h",
    "content": "#ifndef _WIMLIB_FILE_IO_H\n#define _WIMLIB_FILE_IO_H\n\n#include <stdbool.h>\n#include <stddef.h>\n#include <sys/types.h>\n#include <unistd.h>\n\n#ifdef WITH_LIBCDIO\n#  define DO_NOT_WANT_COMPATIBILITY\n#  undef PRAGMA_BEGIN_PACKED\n#  undef PRAGMA_END_PACKED\n#  include <cdio/udf.h>\n#  include <cdio/iso9660.h>\n#endif\n\n/* Wrapper around a file descriptor that keeps track of offset (including in\n * pipes, which don't support lseek()), allows the handling of files that are\n * contained within ISO images, and a cached flag that tells whether the file\n * descriptor is a pipe or not.  */\nstruct filedes {\n\tunion {\n\t\tint fd;\n#ifdef WITH_LIBCDIO\n\t\tiso9660_t* p_iso;\n\t\tudf_t* p_udf;\n#endif\n\t};\n\tunsigned int is_pipe : 1;\n#ifdef WITH_LIBCDIO\n\tunsigned int is_iso : 1;\n\tunsigned int is_udf : 1;\n\tunion {\n\t\tudf_dirent_t* p_udf_file;\n\t\tiso9660_stat_t* p_iso_file;\n\t};\n#endif\n\toff_t offset;\n};\n\nint\nfull_read(struct filedes *fd, void *buf, size_t n);\n\nint\nfull_pread(struct filedes *fd, void *buf, size_t nbyte, off_t offset);\n\nint\nfull_write(struct filedes *fd, const void *buf, size_t n);\n\nint\nfull_pwrite(struct filedes *fd, const void *buf, size_t count, off_t offset);\n\n#ifndef _WIN32\n#  define O_BINARY 0\n#endif\n\noff_t\nfiledes_seek(struct filedes *fd, off_t offset);\n\nbool\nfiledes_is_seekable(struct filedes *fd);\n\nstatic inline void filedes_init(struct filedes *fd, int raw_fd)\n{\n\tmemset(fd, 0, sizeof(*fd));\n\tfd->fd = raw_fd;\n}\n\nstatic inline void filedes_invalidate(struct filedes *fd)\n{\n\tfd->fd = -1;\n}\n\n#ifdef _MSC_VER\n#include <io.h>\n#define filedes_close(f) _close((f)->fd)\n#else\n#define filedes_close(f) close((f)->fd)\n#endif\n\nstatic inline bool\nfiledes_valid(const struct filedes *fd)\n{\n#ifdef _MSC_VER\n\t// The current wimlib code makes repeated attempts to close stdin (0) when a\n\t// WIM cannot be opened, which doesn't sit too well with MSFT's _close() as\n\t// it invokes the exception handler and can make the application crash...\n\t// So we declare stdin as invalid for use with Visual Studio compiled apps.\n\treturn (fd->fd != -1 && fd->fd != 0);\n#else\n\treturn fd->fd != -1;\n#endif\n}\n\n#endif /* _WIMLIB_FILE_IO_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/glob.h",
    "content": "#ifndef _WIMLIB_GLOB_H\n#define _WIMLIB_GLOB_H\n\n#ifndef _WIN32\n#  include <glob.h>\n#else\n#include <stddef.h>\n#include <wchar.h>\n\ntypedef struct {\n\tsize_t    gl_pathc;\n\twchar_t **gl_pathv;\n\tsize_t    gl_offs;\n} glob_t;\n\n/* WARNING: this is a reduced functionality replacement */\nint\nwin32_wglob(const wchar_t *pattern, int flags,\n\t    int (*errfunc)(const wchar_t *epath, int eerrno),\n\t    glob_t *pglob);\n\nvoid globfree(glob_t *pglob);\n\n#define\tGLOB_ERR\t0x1 /* Return on read errors.  */\n#define\tGLOB_NOSORT\t0x2 /* Don't sort the names.  */\n\n/* Error returns from `glob'.  */\n#define\tGLOB_NOSPACE\t1\t/* Ran out of memory.  */\n#define\tGLOB_ABORTED\t2\t/* Read error.  */\n#define\tGLOB_NOMATCH\t3\t/* No matches found.  */\n\n#endif /* _WIN32 */\n\n#endif /* _WIMLIB_GLOB_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/guid.h",
    "content": "/*\n * guid.h\n *\n * Utility functions for handling 16-byte globally unique identifiers (GUIDs).\n */\n\n#ifndef _WIMLIB_GUID_H\n#define _WIMLIB_GUID_H\n\n#include <string.h>\n\n#include \"wimlib/util.h\"\n\n#define GUID_SIZE    16\n\nstatic inline void\ncopy_guid(u8 dest[GUID_SIZE], const u8 src[GUID_SIZE])\n{\n\tmemcpy(dest, src, GUID_SIZE);\n}\n\nstatic inline int\ncmp_guids(const u8 guid1[GUID_SIZE], const u8 guid2[GUID_SIZE])\n{\n\treturn memcmp(guid1, guid2, GUID_SIZE);\n}\n\nstatic inline bool\nguids_equal(const u8 guid1[GUID_SIZE], const u8 guid2[GUID_SIZE])\n{\n\treturn !cmp_guids(guid1, guid2);\n}\n\nstatic inline void\ngenerate_guid(u8 guid[GUID_SIZE])\n{\n\tget_random_bytes(guid, GUID_SIZE);\n}\n\n#endif /* _WIMLIB_GUID_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/hc_matchfinder.h",
    "content": "/*\n * hc_matchfinder.h - Lempel-Ziv matchfinding with a hash table of linked lists\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n *\n * ---------------------------------------------------------------------------\n *\n *\t\t\t\t   Algorithm\n *\n * This is a Hash Chains (hc) based matchfinder.\n *\n * The main data structure is a hash table where each hash bucket contains a\n * linked list (or \"chain\") of sequences whose first 4 bytes share the same hash\n * code.  Each sequence is identified by its starting position in the input\n * buffer.\n *\n * The algorithm processes the input buffer sequentially.  At each byte\n * position, the hash code of the first 4 bytes of the sequence beginning at\n * that position (the sequence being matched against) is computed.  This\n * identifies the hash bucket to use for that position.  Then, this hash\n * bucket's linked list is searched for matches.  Then, a new linked list node\n * is created to represent the current sequence and is prepended to the list.\n *\n * This algorithm has several useful properties:\n *\n * - It only finds true Lempel-Ziv matches; i.e., those where the matching\n *   sequence occurs prior to the sequence being matched against.\n *\n * - The sequences in each linked list are always sorted by decreasing starting\n *   position.  Therefore, the closest (smallest offset) matches are found\n *   first, which in many compression formats tend to be the cheapest to encode.\n *\n * - Although fast running time is not guaranteed due to the possibility of the\n *   lists getting very long, the worst degenerate behavior can be easily\n *   prevented by capping the number of nodes searched at each position.\n *\n * - If the compressor decides not to search for matches at a certain position,\n *   then that position can be quickly inserted without searching the list.\n *\n * - The algorithm is adaptable to sliding windows: just store the positions\n *   relative to a \"base\" value that is updated from time to time, and stop\n *   searching each list when the sequences get too far away.\n *\n * ---------------------------------------------------------------------------\n *\n *\t\t\t\tNotes on usage\n *\n * Before including this header, you must define 'mf_pos_t' to an integer type\n * that can represent all possible positions.  This can be a 16-bit or 32-bit\n * unsigned integer.  When possible, the former should be used due to the\n * reduced cache pressure.  This header can be included multiple times in a\n * single .c file with different 'mf_pos_t' definitions; however, you must\n * define a different MF_SUFFIX each time to generate different names for the\n * matchfinder structure and functions.\n *\n * The number of bytes that must be allocated for a given 'struct\n * hc_matchfinder' must be gotten by calling hc_matchfinder_size().\n *\n * ----------------------------------------------------------------------------\n *\n *\t\t\t\t Optimizations\n *\n * The main hash table and chains handle length 4+ matches.  Length 3 matches\n * are handled by a separate hash table with no chains.  This works well for\n * typical \"greedy\" or \"lazy\"-style compressors, where length 3 matches are\n * often only helpful if they have small offsets.  Instead of searching a full\n * chain for length 3+ matches, the algorithm just checks for one close length 3\n * match, then focuses on finding length 4+ matches.\n *\n * The longest_match() and skip_bytes() functions are inlined into the\n * compressors that use them.  This isn't just about saving the overhead of a\n * function call.  These functions are intended to be called from the inner\n * loops of compressors, where giving the compiler more control over register\n * allocation is very helpful.  There is also significant benefit to be gained\n * from allowing the CPU to predict branches independently at each call site.\n * For example, \"lazy\"-style compressors can be written with two calls to\n * longest_match(), each of which starts with a different 'best_len' and\n * therefore has significantly different performance characteristics.\n *\n * Although any hash function can be used, a multiplicative hash is fast and\n * works well.\n *\n * On some processors, it is significantly faster to extend matches by whole\n * words (32 or 64 bits) instead of by individual bytes.  For this to be the\n * case, the processor must implement unaligned memory accesses efficiently and\n * must have either a fast \"find first set bit\" instruction or a fast \"find last\n * set bit\" instruction, depending on the processor's endianness.\n *\n * The code uses one loop for finding the first match and one loop for finding a\n * longer match.  Each of these loops is tuned for its respective task and in\n * combination are faster than a single generalized loop that handles both\n * tasks.\n *\n * The code also uses a tight inner loop that only compares the last and first\n * bytes of a potential match.  It is only when these bytes match that a full\n * match extension is attempted.\n *\n * ----------------------------------------------------------------------------\n */\n\n#include <string.h>\n\n#include \"wimlib/matchfinder_common.h\"\n\n#define HC_MATCHFINDER_HASH3_ORDER\t15\n#define HC_MATCHFINDER_HASH4_ORDER\t16\n\n/* TEMPLATED functions and structures have MF_SUFFIX appended to their name.  */\n#undef TEMPLATED\n#define TEMPLATED(name)\t\tCONCAT(name, MF_SUFFIX)\n\nstruct TEMPLATED(hc_matchfinder) {\n\n\t/* The hash table for finding length 3 matches  */\n\tmf_pos_t hash3_tab[1UL << HC_MATCHFINDER_HASH3_ORDER];\n\n\t/* The hash table which contains the first nodes of the linked lists for\n\t * finding length 4+ matches  */\n\tmf_pos_t hash4_tab[1UL << HC_MATCHFINDER_HASH4_ORDER];\n\n\t/* The \"next node\" references for the linked lists.  The \"next node\" of\n\t * the node for the sequence with position 'pos' is 'next_tab[pos]'.  */\n\tmf_pos_t next_tab[];\n};\n\n/* Return the number of bytes that must be allocated for a 'hc_matchfinder' that\n * can work with buffers up to the specified size.  */\nstatic forceinline size_t\nTEMPLATED(hc_matchfinder_size)(size_t max_bufsize)\n{\n\treturn sizeof(struct TEMPLATED(hc_matchfinder)) +\n\t\t(max_bufsize * sizeof(mf_pos_t));\n}\n\n/* Prepare the matchfinder for a new input buffer.  */\nstatic forceinline void\nTEMPLATED(hc_matchfinder_init)(struct TEMPLATED(hc_matchfinder) *mf)\n{\n\tmemset(mf, 0, sizeof(*mf));\n}\n\n/*\n * Find the longest match longer than 'best_len' bytes.\n *\n * @mf\n *\tThe matchfinder structure.\n * @in_begin\n *\tPointer to the beginning of the input buffer.\n * @in_next\n *\tPointer to the next position in the input buffer, i.e. the sequence\n *\tbeing matched against.\n * @best_len\n *\tRequire a match longer than this length.\n * @max_len\n *\tThe maximum permissible match length at this position.\n * @nice_len\n *\tStop searching if a match of at least this length is found.\n *\tMust be <= @max_len.\n * @max_search_depth\n *\tLimit on the number of potential matches to consider.  Must be >= 1.\n * @next_hashes\n *\tThe precomputed hash codes for the sequence beginning at @in_next.\n *\tThese will be used and then updated with the precomputed hashcodes for\n *\tthe sequence beginning at @in_next + 1.\n * @offset_ret\n *\tIf a match is found, its offset is returned in this location.\n *\n * Return the length of the match found, or 'best_len' if no match longer than\n * 'best_len' was found.\n */\nstatic forceinline u32\nTEMPLATED(hc_matchfinder_longest_match)(struct TEMPLATED(hc_matchfinder) * const mf,\n\t\t\t\t\tconst u8 * const in_begin,\n\t\t\t\t\tconst u8 * const in_next,\n\t\t\t\t\tu32 best_len,\n\t\t\t\t\tconst u32 max_len,\n\t\t\t\t\tconst u32 nice_len,\n\t\t\t\t\tconst u32 max_search_depth,\n\t\t\t\t\tu32 * const next_hashes,\n\t\t\t\t\tu32 * const offset_ret)\n{\n\tu32 depth_remaining = max_search_depth;\n\tconst u8 *best_matchptr = in_next;\n\tmf_pos_t cur_node3, cur_node4;\n\tu32 hash3, hash4;\n\tu32 next_hashseq;\n\tu32 seq4;\n\tconst u8 *matchptr;\n\tu32 len;\n\tu32 cur_pos = in_next - in_begin;\n\n\tif (unlikely(max_len < 5)) /* can we read 4 bytes from 'in_next + 1'? */\n\t\tgoto out;\n\n\t/* Get the precomputed hash codes.  */\n\thash3 = next_hashes[0];\n\thash4 = next_hashes[1];\n\n\t/* From the hash buckets, get the first node of each linked list.  */\n\tcur_node3 = mf->hash3_tab[hash3];\n\tcur_node4 = mf->hash4_tab[hash4];\n\n\t/* Update for length 3 matches.  This replaces the singleton node in the\n\t * 'hash3' bucket with the node for the current sequence.  */\n\tmf->hash3_tab[hash3] = cur_pos;\n\n\t/* Update for length 4 matches.  This prepends the node for the current\n\t * sequence to the linked list in the 'hash4' bucket.  */\n\tmf->hash4_tab[hash4] = cur_pos;\n\tmf->next_tab[cur_pos] = cur_node4;\n\n\t/* Compute the next hash codes.  */\n\tnext_hashseq = get_unaligned_le32(in_next + 1);\n\tnext_hashes[0] = lz_hash(next_hashseq & 0xFFFFFF, HC_MATCHFINDER_HASH3_ORDER);\n\tnext_hashes[1] = lz_hash(next_hashseq, HC_MATCHFINDER_HASH4_ORDER);\n\tprefetchw(&mf->hash3_tab[next_hashes[0]]);\n\tprefetchw(&mf->hash4_tab[next_hashes[1]]);\n\n\tif (best_len < 4) {  /* No match of length >= 4 found yet?  */\n\n\t\t/* Check for a length 3 match if needed.  */\n\n\t\tif (!cur_node3)\n\t\t\tgoto out;\n\n\t\tseq4 = load_u32_unaligned(in_next);\n\n\t\tif (best_len < 3) {\n\t\t\tmatchptr = &in_begin[cur_node3];\n\t\t\tif (load_u24_unaligned(matchptr) == loaded_u32_to_u24(seq4)) {\n\t\t\t\tbest_len = 3;\n\t\t\t\tbest_matchptr = matchptr;\n\t\t\t}\n\t\t}\n\n\t\t/* Check for a length 4 match.  */\n\n\t\tif (!cur_node4)\n\t\t\tgoto out;\n\n\t\tfor (;;) {\n\t\t\t/* No length 4 match found yet.  Check the first 4 bytes.  */\n\t\t\tmatchptr = &in_begin[cur_node4];\n\n\t\t\tif (load_u32_unaligned(matchptr) == seq4)\n\t\t\t\tbreak;\n\n\t\t\t/* The first 4 bytes did not match.  Keep trying.  */\n\t\t\tcur_node4 = mf->next_tab[cur_node4];\n\t\t\tif (!cur_node4 || !--depth_remaining)\n\t\t\t\tgoto out;\n\t\t}\n\n\t\t/* Found a match of length >= 4.  Extend it to its full length.  */\n\t\tbest_matchptr = matchptr;\n\t\tbest_len = lz_extend(in_next, best_matchptr, 4, max_len);\n\t\tif (best_len >= nice_len)\n\t\t\tgoto out;\n\t\tcur_node4 = mf->next_tab[cur_node4];\n\t\tif (!cur_node4 || !--depth_remaining)\n\t\t\tgoto out;\n\t} else {\n\t\tif (!cur_node4 || best_len >= nice_len)\n\t\t\tgoto out;\n\t}\n\n\t/* Check for matches of length >= 5.  */\n\n\tfor (;;) {\n\t\tfor (;;) {\n\t\t\tmatchptr = &in_begin[cur_node4];\n\n\t\t\t/* Already found a length 4 match.  Try for a longer\n\t\t\t * match; start by checking either the last 4 bytes and\n\t\t\t * the first 4 bytes, or the last byte.  (The last byte,\n\t\t\t * the one which would extend the match length by 1, is\n\t\t\t * the most important.)  */\n\t\t#if UNALIGNED_ACCESS_IS_FAST\n\t\t\tif ((load_u32_unaligned(matchptr + best_len - 3) ==\n\t\t\t     load_u32_unaligned(in_next + best_len - 3)) &&\n\t\t\t    (load_u32_unaligned(matchptr) ==\n\t\t\t     load_u32_unaligned(in_next)))\n\t\t#else\n\t\t\tif (matchptr[best_len] == in_next[best_len])\n\t\t#endif\n\t\t\t\tbreak;\n\n\t\t\t/* Continue to the next node in the list.  */\n\t\t\tcur_node4 = mf->next_tab[cur_node4];\n\t\t\tif (!cur_node4 || !--depth_remaining)\n\t\t\t\tgoto out;\n\t\t}\n\n\t#if UNALIGNED_ACCESS_IS_FAST\n\t\tlen = 4;\n\t#else\n\t\tlen = 0;\n\t#endif\n\t\tlen = lz_extend(in_next, matchptr, len, max_len);\n\t\tif (len > best_len) {\n\t\t\t/* This is the new longest match.  */\n\t\t\tbest_len = len;\n\t\t\tbest_matchptr = matchptr;\n\t\t\tif (best_len >= nice_len)\n\t\t\t\tgoto out;\n\t\t}\n\n\t\t/* Continue to the next node in the list.  */\n\t\tcur_node4 = mf->next_tab[cur_node4];\n\t\tif (!cur_node4 || !--depth_remaining)\n\t\t\tgoto out;\n\t}\nout:\n\t*offset_ret = in_next - best_matchptr;\n\treturn best_len;\n}\n\n/*\n * Advance the matchfinder, but don't search for matches.\n *\n * @mf\n *\tThe matchfinder structure.\n * @in_begin\n *\tPointer to the beginning of the input buffer.\n * @in_next\n *\tPointer to the next position in the input buffer.\n * @in_end\n *\tPointer to the end of the input buffer.\n * @count\n *\tThe number of bytes to advance.  Must be > 0.\n * @next_hashes\n *\tThe precomputed hash codes for the sequence beginning at @in_next.\n *\tThese will be used and then updated with the precomputed hashcodes for\n *\tthe sequence beginning at @in_next + @count.\n */\nstatic forceinline void\nTEMPLATED(hc_matchfinder_skip_bytes)(struct TEMPLATED(hc_matchfinder) * const mf,\n\t\t\t\t     const u8 * const in_begin,\n\t\t\t\t     const u8 *in_next,\n\t\t\t\t     const u8 * const in_end,\n\t\t\t\t     const u32 count,\n\t\t\t\t     u32 * const next_hashes)\n{\n\tu32 cur_pos;\n\tu32 hash3, hash4;\n\tu32 next_hashseq;\n\tu32 remaining = count;\n\n\tif (unlikely(count + 5 > in_end - in_next))\n\t\treturn;\n\n\tcur_pos = in_next - in_begin;\n\thash3 = next_hashes[0];\n\thash4 = next_hashes[1];\n\tdo {\n\t\tmf->hash3_tab[hash3] = cur_pos;\n\t\tmf->next_tab[cur_pos] = mf->hash4_tab[hash4];\n\t\tmf->hash4_tab[hash4] = cur_pos;\n\n\t\tnext_hashseq = get_unaligned_le32(++in_next);\n\t\thash3 = lz_hash(next_hashseq & 0xFFFFFF, HC_MATCHFINDER_HASH3_ORDER);\n\t\thash4 = lz_hash(next_hashseq, HC_MATCHFINDER_HASH4_ORDER);\n\t\tcur_pos++;\n\t} while (--remaining);\n\n\tprefetchw(&mf->hash3_tab[hash3]);\n\tprefetchw(&mf->hash4_tab[hash4]);\n\tnext_hashes[0] = hash3;\n\tnext_hashes[1] = hash4;\n}\n"
  },
  {
    "path": "src/wimlib/wimlib/header.h",
    "content": "#ifndef _WIMLIB_HEADER_H\n#define _WIMLIB_HEADER_H\n\n#include <limits.h>\n\n#include \"wimlib/guid.h\"\n#include \"wimlib/resource.h\"\n#include \"wimlib/types.h\"\n\n/* Length of the WIM header on disk.  wimlib currently requires that the header\n * be exactly this size.  */\n#define WIM_HEADER_DISK_SIZE 208\n\n/* Default WIM version number.  Blobs are always compressed independently.  */\n#define WIM_VERSION_DEFAULT 0x10d00\n\n/* Version number used for WIMs that allow multiple blobs combined into one\n * resource (\"solid resources\", marked by WIM_RESHDR_FLAG_SOLID) and also a new\n * compression format (LZMS).  This version is new as of Windows 8 WIMGAPI.\n * Although it is used by Windows 8 web downloader, it is not yet documented by\n * Microsoft.  */\n#define WIM_VERSION_SOLID 0xe00\n\n/* Note: there is another WIM version from Vista pre-releases, but it is not\n * supported by wimlib.  */\n\n/* WIM magic characters, translated to a single 64-bit number.  */\n#define WIM_MAGIC\t\t\t\t\\\n\t\t(((u64)'M'  <<  0) |\t\t\\\n\t\t ((u64)'S'  <<  8) |\t\t\\\n\t\t ((u64)'W'  << 16) |\t\t\\\n\t\t ((u64)'I'  << 24) |\t\t\\\n\t\t ((u64)'M'  << 32) |\t\t\\\n\t\t ((u64)'\\0' << 40) |\t\t\\\n\t\t ((u64)'\\0' << 48) |\t\t\\\n\t\t ((u64)'\\0' << 54))\n\n/* wimlib pipable WIM magic characters, translated to a single 64-bit number.\n * */\n#define PWM_MAGIC\t\t\t\t\\\n\t\t(((u64)'W'  <<  0) |\t\t\\\n\t\t ((u64)'L'  <<  8) |\t\t\\\n\t\t ((u64)'P'  << 16) |\t\t\\\n\t\t ((u64)'W'  << 24) |\t\t\\\n\t\t ((u64)'M'  << 32) |\t\t\\\n\t\t ((u64)'\\0' << 40) |\t\t\\\n\t\t ((u64)'\\0' << 48) |\t\t\\\n\t\t ((u64)'\\0' << 54))\n\n/* On-disk format of the WIM header.  */\nPRAGMA_BEGIN_PACKED\nstruct wim_header_disk {\n\n\t/* +0x00: Magic characters WIM_MAGIC or PWM_MAGIC.  */\n\tle64 magic;\n\n\t/* +0x08: Size of the WIM header, in bytes; WIM_HEADER_DISK_SIZE\n\t * expected (currently the only supported value).  */\n\tle32 hdr_size;\n\n\t/* +0x0c: Version of the WIM file.  Recognized values are the\n\t * WIM_VERSION_* constants from above.  */\n\tle32 wim_version;\n\n\t/* +0x10: Flags for the WIM file (WIM_HDR_FLAG_*).  */\n\tle32 wim_flags;\n\n\t/* +0x14: Uncompressed chunk size for non-solid compressed resources in\n\t * the WIM or 0 if the WIM is uncompressed.  */\n\tle32 chunk_size;\n\n\t/* +0x18: Globally unique identifier for the WIM file.  Basically a\n\t * bunch of random bytes.  */\n\tu8 guid[GUID_SIZE];\n\n\t/* +0x28: Number of this WIM part in the split WIM file, indexed from 1,\n\t * or 1 if the WIM is not split.  */\n\tle16 part_number;\n\n\t/* +0x2a: Total number of parts of the split WIM file, or 1 if the WIM\n\t * is not split.  */\n\tle16 total_parts;\n\n\t/* +0x2c: Number of images in the WIM.  WIMGAPI requires that this be at\n\t * least 1.  wimlib allows 0.  */\n\tle32 image_count;\n\n\t/* +0x30: Location and size of the WIM's blob table.  */\n\tstruct wim_reshdr_disk blob_table_reshdr;\n\n\t/* +0x48: Location and size of the WIM's XML data.  */\n\tstruct wim_reshdr_disk xml_data_reshdr;\n\n\t/* +0x60: Location and size of metadata resource for the bootable image\n\t * of the WIM, or all zeroes if no image is bootable.  */\n\tstruct wim_reshdr_disk boot_metadata_reshdr;\n\n\t/* +0x78: 1-based index of the bootable image of the WIM, or 0 if no\n\t * image is bootable.  */\n\tle32 boot_idx;\n\n\t/* +0x7c: Location and size of the WIM's integrity table, or all zeroes\n\t * if the WIM has no integrity table.\n\t *\n\t * Note the integrity_table_reshdr here is 4-byte aligned even though it\n\t * would ordinarily be 8-byte aligned--- hence, the\n\t * __attribute__((packed)) on this structure is essential.  */\n\tstruct wim_reshdr_disk integrity_table_reshdr;\n\n\t/* +0x94: Unused bytes.  */\n\tu8 unused[60];\n\n\t/* +0xd0 (208)  */\n} __attribute__((packed));\nPRAGMA_END_PACKED\n\n/*\n * Arbitrarily limit the maximum number of images to 65535, to prevent huge\n * memory allocations when processing fuzzed files.  This can be increased if\n * ever needed (up to INT_MAX - 1).\n */\n#define MAX_IMAGES\t65535\n\n/* In-memory representation of a WIM header.  See `struct wim_header_disk' for\n * field descriptions.  */\nstruct wim_header {\n\tu64 magic;\n\tu32 wim_version;\n\tu32 flags;\n\tu32 chunk_size;\n\tu8 guid[GUID_SIZE];\n\tu16 part_number;\n\tu16 total_parts;\n\tu32 image_count;\n\tstruct wim_reshdr blob_table_reshdr;\n\tstruct wim_reshdr xml_data_reshdr;\n\tstruct wim_reshdr boot_metadata_reshdr;\n\tu32 boot_idx;\n\tstruct wim_reshdr integrity_table_reshdr;\n};\n\n/* WIM header flags ('wim_flags' field of 'struct wim_header_disk'):  */\n\n/* Reserved flag.  */\n#define WIM_HDR_FLAG_RESERVED           0x00000001\n\n/* The WIM may contain compressed resources --- specifically, resources with\n * WIM_RESHDR_FLAG_COMPRESSED set in their headers.  Exactly one of the more\n * specific WIM_HDR_FLAG_COMPRESSION_* flags must be set to specify the\n * compression format used.  */\n#define WIM_HDR_FLAG_COMPRESSION        0x00000002\n\n/* The WIM is read-only, so modifications should not be allowed even if the WIM\n * is writable at the filesystem level.  */\n#define WIM_HDR_FLAG_READONLY           0x00000004\n\n/* The WIM is part of a split WIM.  */\n#define WIM_HDR_FLAG_SPANNED            0x00000008\n\n/* All blobs included in the WIM's blob table are non-metadata (do not have\n * WIM_RESHDR_FLAG_METADATA set).  wimlib ignores this flag and clears it on new\n * WIM files it writes.  */\n#define WIM_HDR_FLAG_RESOURCE_ONLY      0x00000010\n\n/* All blobs included in the WIM's blob table are metadata (have\n * WIM_RESHDR_FLAG_METADATA set).  wimlib ignores this flag and clears it on new\n * WIM files it writes.  */\n#define WIM_HDR_FLAG_METADATA_ONLY      0x00000020\n\n/* The WIM is currently being written or appended to.  */\n#define WIM_HDR_FLAG_WRITE_IN_PROGRESS  0x00000040\n\n/* Reparse point fixup flag.  See docs for the --rpfix and --norpfix options to\n * 'wimlib-imagex capture', or the WIMLIB_ADD_FLAG_{RPFIX,NORPFIX} flags in\n * wimlib.h.  Note that WIM_HDR_FLAG_RP_FIX is a header flag and just sets the\n * default behavior for the WIM; it can still be programatically overridden on a\n * per-image basis.  But there is no flag in the file format to set the default\n * behavior for a specific image.  */\n#define WIM_HDR_FLAG_RP_FIX             0x00000080\n\n/* Unused, reserved flag for another compression type.  */\n#define WIM_HDR_FLAG_COMPRESS_RESERVED  0x00010000\n\n/* Resources in the WIM with WIM_RESHDR_FLAG_COMPRESSED set in their headers are\n * compressed with XPRESS compression.  */\n#define WIM_HDR_FLAG_COMPRESS_XPRESS    0x00020000\n\n/* Resources in the WIM with WIM_RESHDR_FLAG_COMPRESSED set in their headers are\n * compressed with LZX compression.  */\n#define WIM_HDR_FLAG_COMPRESS_LZX       0x00040000\n\n/* Resources in the WIM with WIM_RESHDR_FLAG_COMPRESSED set in their headers are\n * compressed with LZMS compression.  Note: this flag is only valid if the WIM\n * version is WIM_VERSION_SOLID.  Also, this flag is only supported in wimlib\n * v1.6.0 and later and WIMGAPI Windows 8 and later.  */\n#define WIM_HDR_FLAG_COMPRESS_LZMS      0x00080000\n\n/* XPRESS, with small chunk size???  */\n#define WIM_HDR_FLAG_COMPRESS_XPRESS_2\t0x00200000\n\n#endif /* _WIMLIB_HEADER_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/inode.h",
    "content": "#ifndef _WIMLIB_INODE_H\n#define _WIMLIB_INODE_H\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/list.h\"\n#include \"wimlib/sha1.h\"\n#include \"wimlib/types.h\"\n\nstruct avl_tree_node;\nstruct blob_descriptor;\nstruct blob_table;\nstruct wim_dentry;\nstruct wim_inode_extra;\nstruct wim_security_data;\nstruct wimfs_fd;\n\n/* Valid values for the 'stream_type' field of a 'struct wim_inode_stream'  */\nenum wim_inode_stream_type {\n\n\t/* Data stream, may be unnamed (usual case) or named  */\n\tSTREAM_TYPE_DATA,\n\n\t/* Reparse point stream.  This is the same as the data of the on-disk\n\t * reparse point attribute, except that the first 8 bytes of the on-disk\n\t * attribute are omitted.  The omitted bytes contain the reparse tag\n\t * (which is instead stored in the on-disk WIM dentry), the reparse data\n\t * size (which is redundant with the stream size), and a reserved field\n\t * that is always zero.  */\n\tSTREAM_TYPE_REPARSE_POINT,\n\n\t/* Encrypted data in the \"EFSRPC raw data format\" specified by [MS-EFSR]\n\t * section 2.2.3.  This contains metadata for the Encrypting File System\n\t * as well as the encrypted data of all the file's data streams.  */\n\tSTREAM_TYPE_EFSRPC_RAW_DATA,\n\n\t/* Stream type could not be determined  */\n\tSTREAM_TYPE_UNKNOWN,\n};\n\nextern const utf16lechar NO_STREAM_NAME[1];\n\n/*\n * 'struct wim_inode_stream' describes a \"stream\", which associates a blob of\n * data with an inode.  Each stream has a type and optionally a name.\n *\n * The most frequently seen kind of stream is the \"unnamed data stream\"\n * (stream_type == STREAM_TYPE_DATA && stream_name == NO_STREAM_NAME), which is\n * the \"default file contents\".  Many inodes just have an unnamed data stream\n * and no other streams.  However, files on NTFS filesystems may have\n * additional, \"named\" data streams, and this is supported by the WIM format.\n *\n * A \"reparse point\" is an inode with reparse data set.  The reparse data is\n * stored in a stream of type STREAM_TYPE_REPARSE_POINT.  There should be only\n * one such stream, and it should be unnamed.  However, it is possible for an\n * inode to have both a reparse point stream and an unnamed data stream, and\n * even named data streams as well.\n */\nstruct wim_inode_stream {\n\n\t/* The name of the stream or NO_STREAM_NAME.  */\n\tutf16lechar *stream_name;\n\n\t/*\n\t * If 'stream_resolved' = 0, then 'stream_hash' is the SHA-1 message\n\t * digest of the uncompressed data of this stream, or all zeroes if this\n\t * stream is empty.\n\t *\n\t * If 'stream_resolved' = 1, then 'stream_blob' is a pointer directly to\n\t * a descriptor for this stream's blob, or NULL if this stream is empty.\n\t */\n\tunion {\n\t\tu8 _stream_hash[SHA1_HASH_SIZE];\n\t\tstruct blob_descriptor *_stream_blob;\n\t};\n\n\t/* 'stream_resolved' determines whether 'stream_hash' or 'stream_blob'\n\t * is valid as described above.  */\n\tu32 stream_resolved : 1;\n\n\t/* A unique identifier for this stream within the context of its inode.\n\t * This stays constant even if the streams array is reallocated.  */\n\tu32 stream_id : 28;\n\n\t/* The type of this stream as one of the STREAM_TYPE_* values  */\n\tu32 stream_type : 3;\n};\n\n/*\n * WIM inode - a \"file\" in an image which may be accessible via multiple paths\n *\n * Note: in WIM files there is no true on-disk analogue of an inode; there are\n * only directory entries, and some fields are duplicated among all links to a\n * file.  However, wimlib uses inode structures internally to simplify handling\n * of hard links.\n */\nstruct wim_inode {\n\n\t/*\n\t * The collection of streams for this inode.  'i_streams' points to\n\t * either 'i_embedded_streams' or an allocated array.\n\t */\n\tstruct wim_inode_stream *i_streams;\n\tstruct wim_inode_stream i_embedded_streams[1];\n\tunsigned i_num_streams;\n\n\t/* Windows file attribute flags (FILE_ATTRIBUTE_*).  */\n\tu32 i_attributes;\n\n\t/* Root of a balanced binary search tree storing the child directory\n\t * entries of this inode, if any, indexed by filename.  If this inode is\n\t * not a directory or if it has no children then this will be an empty\n\t * tree (NULL).  */\n\tstruct avl_tree_node *i_children;\n\n\t/* List of dentries that are aliases for this inode.  There will be\n\t * i_nlink dentries in this list.  */\n\tstruct hlist_head i_alias_list;\n\n\t/* Field to place this inode into a list.  While reading a WIM image or\n\t * adding files to a WIM image this is owned by the inode table;\n\t * otherwise this links the inodes for the WIM image.  */\n\tstruct hlist_node i_hlist_node;\n\n\t/* Number of dentries that are aliases for this inode.  */\n\tu32 i_nlink : 30;\n\n\t/* Flag used by some code to mark this inode as visited.  It will be 0\n\t * by default, and it always must be cleared after use.  */\n\tu32 i_visited : 1;\n\n\t/* Cached value  */\n\tu32 i_can_externally_back : 1;\n\n\t/* If not NULL, a pointer to the extra data that was read from the\n\t * dentry.  This should be a series of tagged items, each of which\n\t * represents a bit of extra metadata, such as the file's object ID.\n\t * See tagged_items.c for more information.  */\n\tstruct wim_inode_extra *i_extra;\n\n\t/* Creation time, last access time, and last write time for this inode,\n\t * in 100-nanosecond intervals since 12:00 a.m UTC January 1, 1601.\n\t * They should correspond to the times gotten by calling GetFileTime()\n\t * on Windows. */\n\tu64 i_creation_time;\n\tu64 i_last_access_time;\n\tu64 i_last_write_time;\n\n\t/* Corresponds to 'security_id' in `struct wim_dentry_on_disk':  The\n\t * index of this inode's security descriptor in the WIM image's table of\n\t * security descriptors, or -1 if this inode does not have a security\n\t * descriptor.  */\n\ts32 i_security_id;\n\n\t/* Unknown field that we only read into memory so we can re-write it\n\t * unchanged.  Probably it's actually just padding...  */\n\tu32 i_unknown_0x54;\n\n\t/* The following fields correspond to 'reparse_tag', 'rp_reserved', and\n\t * 'rp_flags' in `struct wim_dentry_on_disk'.  They are only meaningful\n\t * for reparse point files.  */\n\tu32 i_reparse_tag;\n\tu16 i_rp_reserved;\n\tu16 i_rp_flags;\n\n\t/* Inode number; corresponds to hard_link_group_id in the `struct\n\t * wim_dentry_on_disk'.  */\n\tu64 i_ino;\n\n\tunion {\n\t\t/* Device number, used only during image capture, so we can\n\t\t * identify hard linked files by the combination of inode number\n\t\t * and device number (rather than just inode number, which could\n\t\t * be ambiguous if the captured tree spans a mountpoint).  Set\n\t\t * to 0 otherwise.  */\n\t\tu64 i_devno;\n\n\t\t/* Fields used only during extraction  */\n\t\tstruct {\n\t\t\t/* A singly linked list of aliases of this inode that\n\t\t\t * are being extracted in the current extraction\n\t\t\t * operation.  This list may be shorter than the inode's\n\t\t\t * full alias list.  This list will be constructed\n\t\t\t * regardless of whether the extraction backend supports\n\t\t\t * hard links or not.  */\n\t\t\tstruct wim_dentry *i_first_extraction_alias;\n\n\t\t#ifdef WITH_NTFS_3G\n\t\t\t/* In NTFS-3G extraction mode, this is set to the Master\n\t\t\t * File Table (MFT) number of the NTFS file that was\n\t\t\t * created for this inode.  */\n\t\t\tu64 i_mft_no;\n\t\t#endif\n\t\t};\n\n\t\t/* Used during WIM writing with\n\t\t * WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES:  the number\n\t\t * of streams this inode has that have not yet been fully read.\n\t\t * */\n\t\tu32 i_num_remaining_streams;\n\n#ifdef WITH_FUSE\n\t\tstruct {\n\t\t\t/* Used only during image mount:  Table of file\n\t\t\t * descriptors that have been opened to this inode.\n\t\t\t * This table is freed when the last file descriptor is\n\t\t\t * closed.  */\n\t\t\tstruct wimfs_fd **i_fds;\n\n\t\t\t/* Lower bound on the index of the next available entry\n\t\t\t * in 'i_fds'.  */\n\t\t\tu16 i_next_fd;\n\t\t};\n#endif\n\t};\n\n#ifdef WITH_FUSE\n\tu16 i_num_opened_fds;\n\tu16 i_num_allocated_fds;\n#endif\n\n\t/* Next stream ID to be assigned  */\n\tu32 i_next_stream_id;\n\n#ifdef ENABLE_TEST_SUPPORT\n\tstruct wim_inode *i_corresponding;\n#endif\n};\n\n/* Optional extra data for a WIM inode  */\nstruct wim_inode_extra {\n\tsize_t size;\t/* Size of the extra data in bytes  */\n\tPRAGMA_ALIGN(u8 data[], 8); /* The extra data  */\n};\n\n/*\n * The available reparse tags are documented at\n * https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/c8e77b37-3909-4fe6-a4ea-2b9d423b1ee4\n * Here we only define the ones of interest to us.\n */\n#define WIM_IO_REPARSE_TAG_MOUNT_POINT\t\t0xA0000003\n#define WIM_IO_REPARSE_TAG_SYMLINK\t\t0xA000000C\n#define WIM_IO_REPARSE_TAG_DEDUP\t\t0x80000013\n#define WIM_IO_REPARSE_TAG_WOF\t\t\t0x80000017\n\n/* Flags for the rp_flags field.  Currently the only known flag is NOT_FIXED,\n * which indicates that the target of the absolute symbolic link or junction was\n * not changed when it was stored.  */\n#define WIM_RP_FLAG_NOT_FIXED\t\t   0x0001\n\n/* Windows file attribute flags  */\n#define FILE_ATTRIBUTE_READONLY            0x00000001\n#define FILE_ATTRIBUTE_HIDDEN              0x00000002\n#define FILE_ATTRIBUTE_SYSTEM              0x00000004\n#define FILE_ATTRIBUTE_DIRECTORY           0x00000010\n#define FILE_ATTRIBUTE_ARCHIVE             0x00000020\n#define FILE_ATTRIBUTE_DEVICE              0x00000040\n#define FILE_ATTRIBUTE_NORMAL              0x00000080\n#define FILE_ATTRIBUTE_TEMPORARY           0x00000100\n#define FILE_ATTRIBUTE_SPARSE_FILE         0x00000200\n#define FILE_ATTRIBUTE_REPARSE_POINT       0x00000400\n#define FILE_ATTRIBUTE_COMPRESSED          0x00000800\n#define FILE_ATTRIBUTE_OFFLINE             0x00001000\n#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000\n#define FILE_ATTRIBUTE_ENCRYPTED           0x00004000\n#define FILE_ATTRIBUTE_VIRTUAL             0x00010000\n\nstruct wim_inode *\nnew_inode(struct wim_dentry *dentry, bool set_timestamps);\n\n/* Iterate through each alias of the specified inode.  */\n#define inode_for_each_dentry(dentry, inode) \\\n\thlist_for_each_entry((dentry), &(inode)->i_alias_list, d_alias_node)\n\n/* Return an alias of the specified inode.  */\n#define inode_any_dentry(inode) \\\n\thlist_entry(inode->i_alias_list.first, struct wim_dentry, d_alias_node)\n\n/* Return the full path of an alias of the specified inode, or NULL if a full\n * path could not be determined.  */\n#define inode_any_full_path(inode) \\\n\tdentry_full_path(inode_any_dentry(inode))\n\nvoid\nd_associate(struct wim_dentry *dentry, struct wim_inode *inode);\n\nvoid\nd_disassociate(struct wim_dentry *dentry);\n\n#ifdef WITH_FUSE\nvoid\ninode_dec_num_opened_fds(struct wim_inode *inode);\n#endif\n\n/* Is the inode a directory?\n * This doesn't count directories with reparse data.\n * wimlib only allows inodes of this type to have children.\n */\nstatic inline bool\ninode_is_directory(const struct wim_inode *inode)\n{\n\treturn (inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY |\n\t\t\t\t       FILE_ATTRIBUTE_REPARSE_POINT))\n\t\t\t== FILE_ATTRIBUTE_DIRECTORY;\n}\n\n/* Is the inode a symbolic link?\n * This returns true iff the inode is a reparse point that is either a \"real\"\n * symbolic link or a junction point.  */\nstatic inline bool\ninode_is_symlink(const struct wim_inode *inode)\n{\n\treturn (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT)\n\t\t&& (inode->i_reparse_tag == WIM_IO_REPARSE_TAG_SYMLINK ||\n\t\t    inode->i_reparse_tag == WIM_IO_REPARSE_TAG_MOUNT_POINT);\n}\n\n/* Does the inode have children?  Currently (based on read_dentry_tree() as well\n * as the various build-dentry-tree implementations), this can only return true\n * for inodes for which inode_is_directory() returns true.  */\nstatic inline bool\ninode_has_children(const struct wim_inode *inode)\n{\n\treturn inode->i_children != NULL;\n}\n\n/* Does the inode have a security descriptor?  */\nstatic inline bool\ninode_has_security_descriptor(const struct wim_inode *inode)\n{\n\treturn inode->i_security_id >= 0;\n}\n\nstruct wim_inode_stream *\ninode_get_stream(const struct wim_inode *inode, int stream_type,\n\t\t const utf16lechar *stream_name);\n\nstruct wim_inode_stream *\ninode_get_unnamed_stream(const struct wim_inode *inode, int stream_type);\n\nstatic inline struct wim_inode_stream *\ninode_get_unnamed_data_stream(const struct wim_inode *inode)\n{\n\treturn inode_get_unnamed_stream(inode, STREAM_TYPE_DATA);\n}\n\nstruct wim_inode_stream *\ninode_add_stream(struct wim_inode *inode, int stream_type,\n\t\t const utf16lechar *stream_name, struct blob_descriptor *blob);\n\nvoid\ninode_replace_stream_blob(struct wim_inode *inode,\n\t\t\t  struct wim_inode_stream *strm,\n\t\t\t  struct blob_descriptor *new_blob,\n\t\t\t  struct blob_table *blob_table);\n\nbool\ninode_replace_stream_data(struct wim_inode *inode,\n\t\t\t  struct wim_inode_stream *strm,\n\t\t\t  const void *data, size_t size,\n\t\t\t  struct blob_table *blob_table);\n\nbool\ninode_add_stream_with_data(struct wim_inode *inode,\n\t\t\t   int stream_type, const utf16lechar *stream_name,\n\t\t\t   const void *data, size_t size,\n\t\t\t   struct blob_table *blob_table);\n\nvoid\ninode_remove_stream(struct wim_inode *inode, struct wim_inode_stream *strm,\n\t\t    struct blob_table *blob_table);\n\nstatic inline struct blob_descriptor *\nstream_blob_resolved(const struct wim_inode_stream *strm)\n{\n\twimlib_assert(strm->stream_resolved);\n\treturn strm->_stream_blob;\n}\n\nstatic inline bool\nstream_is_named(const struct wim_inode_stream *strm)\n{\n\treturn strm->stream_name != NO_STREAM_NAME;\n}\n\nstatic inline bool\nstream_is_unnamed_data_stream(const struct wim_inode_stream *strm)\n{\n\treturn strm->stream_type == STREAM_TYPE_DATA && !stream_is_named(strm);\n}\n\nstatic inline bool\nstream_is_named_data_stream(const struct wim_inode_stream *strm)\n{\n\treturn strm->stream_type == STREAM_TYPE_DATA && stream_is_named(strm);\n}\n\nbool\ninode_has_named_data_stream(const struct wim_inode *inode);\n\nint\ninode_resolve_streams(struct wim_inode *inode, struct blob_table *table,\n\t\t      bool force);\n\nint\nblob_not_found_error(const struct wim_inode *inode, const u8 *hash);\n\nstruct blob_descriptor *\nstream_blob(const struct wim_inode_stream *strm, const struct blob_table *table);\n\nstruct blob_descriptor *\ninode_get_blob_for_unnamed_data_stream(const struct wim_inode *inode,\n\t\t\t\t       const struct blob_table *blob_table);\n\nstruct blob_descriptor *\ninode_get_blob_for_unnamed_data_stream_resolved(const struct wim_inode *inode);\n\nconst u8 *\nstream_hash(const struct wim_inode_stream *strm);\n\nconst u8 *\ninode_get_hash_of_unnamed_data_stream(const struct wim_inode *inode);\n\nvoid\ninode_ref_blobs(struct wim_inode *inode);\n\nvoid\ninode_unref_blobs(struct wim_inode *inode, struct blob_table *blob_table);\n\n/* inode_fixup.c  */\nint\ndentry_tree_fix_inodes(struct wim_dentry *root, struct hlist_head *inode_list);\n\n#endif /* _WIMLIB_INODE_H  */\n"
  },
  {
    "path": "src/wimlib/wimlib/inode_table.h",
    "content": "#ifndef _WIMLIB_INODE_TABLE_H\n#define _WIMLIB_INODE_TABLE_H\n\n#include \"wimlib/list.h\"\n#include \"wimlib/types.h\"\n#include \"wimlib/util.h\"\n\nstruct wim_dentry;\n\n/* Hash table to find inodes for hard link detection, given an inode number (in\n * the case of reading a WIM image), or both an inode number and a device number\n * (in the case of adding files to a WIM image).  Also contains an extra list to\n * hold inodes for which no additional hard link detection is desired.  In both\n * cases the inodes are linked by i_hlist_node.  */\nstruct wim_inode_table {\n\tstruct hlist_head *array;\n\tsize_t filled;\n\tsize_t capacity;\n\tstruct hlist_head extra_inodes;\n};\n\n\n/* Compute the index of the hash bucket to use for the given inode number and\n * device number.  */\nstatic inline size_t\nhash_inode(const struct wim_inode_table *table, u64 ino, u64 devno)\n{\n\treturn (hash_u64(ino) + devno) & (table->capacity - 1);\n}\n\nint\ninit_inode_table(struct wim_inode_table *table, size_t capacity);\n\nint\ninode_table_new_dentry(struct wim_inode_table *table, const tchar *name,\n\t\t       u64 ino, u64 devno, bool noshare,\n\t\t       struct wim_dentry **dentry_ret);\n\nvoid\nenlarge_inode_table(struct wim_inode_table *table);\n\nvoid\ninode_table_prepare_inode_list(struct wim_inode_table *table,\n\t\t\t       struct hlist_head *head);\n\nvoid\ndestroy_inode_table(struct wim_inode_table *table);\n\n#endif /* _WIMLIB_INODE_TABLE_H  */\n"
  },
  {
    "path": "src/wimlib/wimlib/integrity.h",
    "content": "#ifndef _WIMLIB_INTEGRITY_H\n#define _WIMLIB_INTEGRITY_H\n\n#include <sys/types.h>\n\n#include \"wimlib/types.h\"\n\n#define WIM_INTEGRITY_OK 0\n#define WIM_INTEGRITY_NOT_OK -1\n#define WIM_INTEGRITY_NONEXISTENT -2\n\nstruct integrity_table;\n\nint\nread_integrity_table(WIMStruct *wim, u64 num_checked_bytes,\n\t\t     struct integrity_table **table_ret);\n\n#define free_integrity_table(table) FREE(table)\n\nint\nwrite_integrity_table(WIMStruct *wim,\n\t\t      off_t new_blob_table_end,\n\t\t      off_t old_blob_table_end,\n\t\t      struct integrity_table *old_table);\n\nint\ncheck_wim_integrity(WIMStruct *wim);\n\n#endif /* _WIMLIB_INTEGRITY_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/lcpit_matchfinder.h",
    "content": "/*\n * lcpit_matchfinder.h\n *\n * A match-finder for Lempel-Ziv compression based on bottom-up construction and\n * traversal of the Longest Common Prefix (LCP) interval tree.\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifndef _LCPIT_MATCHFINDER_H\n#define _LCPIT_MATCHFINDER_H\n\n#include \"wimlib/types.h\"\n\nstruct lcpit_matchfinder {\n\tbool huge_mode;\n\tu32 cur_pos;\n\tu32 *pos_data;\n\tunion {\n\t\tu32 *intervals;\n\t\tu64 *intervals64;\n\t};\n\tu32 min_match_len;\n\tu32 nice_match_len;\n\tu32 next[2];\n\tu32 orig_nice_match_len;\n};\n\nstruct lz_match {\n\tu32 length;\n\tu32 offset;\n};\n\nu64\nlcpit_matchfinder_get_needed_memory(size_t max_bufsize);\n\nbool\nlcpit_matchfinder_init(struct lcpit_matchfinder *mf, size_t max_bufsize,\n\t\t       u32 min_match_len, u32 nice_match_len);\n\nvoid\nlcpit_matchfinder_load_buffer(struct lcpit_matchfinder *mf, const u8 *T, u32 n);\n\nu32\nlcpit_matchfinder_get_matches(struct lcpit_matchfinder *mf,\n                              struct lz_match *matches);\n\nvoid\nlcpit_matchfinder_skip_bytes(struct lcpit_matchfinder *mf, u32 count);\n\nvoid\nlcpit_matchfinder_destroy(struct lcpit_matchfinder *mf);\n\n#endif /* _LCPIT_MATCHFINDER_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/list.h",
    "content": "\n/*\n * This file is based on include/linux/list.h in the Linux kernel source code.\n */\n\n#ifndef _WIMLIB_LIST_H\n#define _WIMLIB_LIST_H\n\n#include <stdbool.h>\n#include <stddef.h>\n\n/* Simple doubly linked list implementation.  */\n\nstruct list_head {\n\tstruct list_head *next;\n\tstruct list_head *prev;\n};\n\n\n#define LIST_HEAD_INIT(name) { &(name), &(name) }\n\n#undef LIST_HEAD /* BSD sys/queue.h defines this... */\n#define LIST_HEAD(name) struct list_head name = LIST_HEAD_INIT(name)\n\nstatic inline void\nINIT_LIST_HEAD(struct list_head *list)\n{\n\tlist->next = list;\n\tlist->prev = list;\n}\n\n/*\n * Insert a new entry between two known consecutive entries.\n *\n * This is only for internal list manipulation where we know\n * the prev/next entries already!\n */\nstatic inline void\n__list_add(struct list_head *new, struct list_head *prev, struct list_head *next)\n{\n\tnext->prev = new;\n\tnew->next = next;\n\tnew->prev = prev;\n\tprev->next = new;\n}\n\n/**\n * list_add - add a new entry\n * @new: new entry to be added\n * @head: list head to add it after\n *\n * Insert a new entry after the specified head.\n * This is good for implementing stacks.\n */\nstatic inline void\nlist_add(struct list_head *new, struct list_head *head)\n{\n\t__list_add(new, head, head->next);\n}\n\n/**\n * list_add_tail - add a new entry\n * @new: new entry to be added\n * @head: list head to add it before\n *\n * Insert a new entry before the specified head.\n * This is useful for implementing queues.\n */\nstatic inline void\nlist_add_tail(struct list_head *new, struct list_head *head)\n{\n\t__list_add(new, head->prev, head);\n}\n\n/**\n * list_replace - replace old entry by new one\n * @old : the element to be replaced\n * @new : the new element to insert\n *\n * If @old was empty, it will be overwritten.\n */\nstatic inline void\nlist_replace(struct list_head *old, struct list_head *new)\n{\n\tnew->next = old->next;\n\tnew->next->prev = new;\n\tnew->prev = old->prev;\n\tnew->prev->next = new;\n}\n\n/**\n * list_del - deletes entry from list.\n * @entry: the element to delete from the list.\n * Note: list_empty() on entry does not return true after this, the entry is\n * in an undefined state.\n */\nstatic inline void\nlist_del(struct list_head *entry)\n{\n\tstruct list_head *prev = entry->prev;\n\tstruct list_head *next = entry->next;\n\n\tprev->next = next;\n\tnext->prev = prev;\n}\n\n/**\n * list_empty - tests whether a list is empty\n * @head: the list to test.\n */\nstatic inline bool\nlist_empty(const struct list_head *head)\n{\n\treturn head->next == head;\n}\n\nstatic inline void\n__list_splice(const struct list_head *list,\n\t      struct list_head *prev, struct list_head *next)\n{\n\tstruct list_head *first = list->next;\n\tstruct list_head *last = list->prev;\n\n\tfirst->prev = prev;\n\tprev->next = first;\n\n\tlast->next = next;\n\tnext->prev = last;\n}\n\n/**\n * list_splice - join two lists, this is designed for stacks\n * @list: the new list to add.\n * @head: the place to add it in the first list.\n */\nstatic inline void\nlist_splice(const struct list_head *list, struct list_head *head)\n{\n\tif (!list_empty(list))\n\t\t__list_splice(list, head, head->next);\n}\n\n/**\n * list_move - delete from one list and add as another's head\n * @list: the entry to move\n * @head: the head that will precede our entry\n */\nstatic inline void\nlist_move(struct list_head *list, struct list_head *head)\n{\n\tlist_del(list);\n\tlist_add(list, head);\n}\n\n/**\n * list_move_tail - delete from one list and add as another's tail\n * @list: the entry to move\n * @head: the head that will follow our entry\n */\nstatic inline void\nlist_move_tail(struct list_head *list, struct list_head *head)\n{\n\tlist_del(list);\n\tlist_add_tail(list, head);\n}\n\n/**\n * list_splice_tail - join two lists, each list being a queue\n * @list: the new list to add.\n * @head: the place to add it in the first list.\n */\nstatic inline void\nlist_splice_tail(struct list_head *list, struct list_head *head)\n{\n\tif (!list_empty(list))\n\t\t__list_splice(list, head->prev, head);\n}\n\n/**\n * list_entry - get the struct for this entry\n * @ptr:\tthe &struct list_head pointer.\n * @type:\tthe type of the struct this is embedded in.\n * @member:\tthe name of the list_struct within the struct.\n */\n#ifdef _MSC_VER\n#define list_entry(ptr, type, member) \\\n\t((type *)((uintptr_t)(ptr) - (uintptr_t)offsetof(type, member)))\n#else\n#define list_entry(ptr, type, member) \\\n\tcontainer_of(ptr, type, member)\n#endif\n\n/**\n * list_first_entry - get the first element from a list\n * @ptr:\tthe list head to take the element from.\n * @type:\tthe type of the struct this is embedded in.\n * @member:\tthe name of the list_struct within the struct.\n *\n * Note, that list is expected to be not empty.\n */\n#define list_first_entry(ptr, type, member) \\\n\tlist_entry((ptr)->next, type, member)\n\n/**\n * list_last_entry - get the last element from a list\n * @ptr:\tthe list head to take the element from.\n * @type:\tthe type of the struct this is embedded in.\n * @member:\tthe name of the list_struct within the struct.\n *\n * Note, that list is expected to be not empty.\n */\n#define list_last_entry(ptr, type, member) \\\n\tlist_entry((ptr)->prev, type, member)\n\n/**\n * list_next_entry - get the next element in list\n * @pos:\tthe type * to cursor\n * @member:\tthe name of the list_struct within the struct.\n */\n#define list_next_entry(pos, member) \\\n\tlist_entry((pos)->member.next, typeof(*(pos)), member)\n\n/**\n * list_prev_entry - get the prev element in list\n * @pos:\tthe type * to cursor\n * @member:\tthe name of the list_struct within the struct.\n */\n#define list_prev_entry(pos, member) \\\n\tlist_entry((pos)->member.prev, typeof(*(pos)), member)\n\n\n/**\n * list_for_each\t-\titerate over a list\n * @pos:\tthe &struct list_head to use as a loop cursor.\n * @head:\tthe head for your list.\n */\n#define list_for_each(pos, head) \\\n\tfor (pos = (head)->next; pos != (head); pos = pos->next)\n\n/**\n * list_for_each_entry\t-\titerate over list of given type\n * @pos:\tthe type * to use as a loop cursor.\n * @head:\tthe head for your list.\n * @member:\tthe name of the list_struct within the struct.\n */\n#define list_for_each_entry(pos, head, member)\t\t\t\t\\\n\tfor (pos = list_first_entry(head, typeof(*pos), member);\t\\\n\t     &pos->member != (head);\t\t\t\t\t\\\n\t     pos = list_next_entry(pos, member))\n\n/**\n * list_for_each_entry_reverse - iterate backwards over list of given type.\n * @pos:\tthe type * to use as a loop cursor.\n * @head:\tthe head for your list.\n * @member:\tthe name of the list_struct within the struct.\n */\n#define list_for_each_entry_reverse(pos, head, member)\t\t\t\\\n\tfor (pos = list_last_entry(head, typeof(*pos), member);\t\t\\\n\t     &pos->member != (head); \t\t\t\t\t\\\n\t     pos = list_prev_entry(pos, member))\n\n/**\n * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry\n * @pos:\tthe type * to use as a loop cursor.\n * @n:\t\tanother type * to use as temporary storage\n * @head:\tthe head for your list.\n * @member:\tthe name of the list_struct within the struct.\n */\n#define list_for_each_entry_safe(pos, n, head, member)\t\t\t\\\n\tfor (pos = list_entry((head)->next, typeof(*pos), member),\t\\\n\t\tn = list_entry(pos->member.next, typeof(*pos), member);\t\\\n\t     &pos->member != (head);\t\t\t\t\t\\\n\t     pos = n, n = list_entry(n->member.next, typeof(*n), member))\n\n/*\n * Double linked lists with a single pointer list head.\n * Mostly useful for hash tables where the two pointer list head is\n * too wasteful.\n * You lose the ability to access the tail in O(1).\n */\n\nstruct hlist_head {\n\tstruct hlist_node *first;\n};\n\nstruct hlist_node {\n\tstruct hlist_node *next;\n\tstruct hlist_node **pprev;\n};\n\nstatic inline void\nINIT_HLIST_HEAD(struct hlist_head *h)\n{\n\th->first = NULL;\n}\n\nstatic inline bool\nhlist_unhashed(const struct hlist_node *h)\n{\n\treturn !h->pprev;\n}\n\nstatic inline bool\nhlist_empty(const struct hlist_head *h)\n{\n\treturn !h->first;\n}\n\nstatic inline void\nhlist_del(struct hlist_node *n)\n{\n\tstruct hlist_node *next = n->next;\n\tstruct hlist_node **pprev = n->pprev;\n\t*pprev = next;\n\tif (next)\n\t\tnext->pprev = pprev;\n}\n\nstatic inline void\nhlist_add_head(struct hlist_node *n, struct hlist_head *h)\n{\n\tstruct hlist_node *first = h->first;\n\tn->next = first;\n\tif (first)\n\t\tfirst->pprev = &n->next;\n\th->first = n;\n\tn->pprev = &h->first;\n}\n\n#define hlist_entry(ptr, type, member) container_of(ptr,type,member)\n\n#ifdef _MSC_VER\n#define hlist_entry_safe(ptr, type, member) \\\n\t( (ptr) ? hlist_entry(ptr, type, member) : NULL )\n#else\n#define hlist_entry_safe(ptr, type, member) \\\n\t({ typeof(ptr) ____ptr = (ptr); \\\n\t   ____ptr ? hlist_entry(____ptr, type, member) : NULL; \\\n\t})\n#endif\n\n/**\n * hlist_for_each_entry\t- iterate over list of given type\n * @pos:\tthe type * to use as a loop cursor.\n * @head:\tthe head for your list.\n * @member:\tthe name of the hlist_node within the struct.\n */\n#define hlist_for_each_entry(pos, head, member)\t\t\t\t\\\n\tfor (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\\\n\t     pos;\t\t\t\t\t\t\t\\\n\t     pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))\n\n/**\n * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry\n * @pos:\tthe type * to use as a loop cursor.\n * @n:\t\tanother &struct hlist_node to use as temporary storage\n * @head:\tthe head for your list.\n * @member:\tthe name of the hlist_node within the struct.\n */\n#define hlist_for_each_entry_safe(pos, n, head, member) \t\t\\\n\tfor (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\\\n\t     pos && ((n = pos->member.next) - n + 1);\t\t\t\\\n\t     pos = hlist_entry_safe(n, typeof(*pos), member))\n\n#endif /* _WIMLIB_LIST_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/lzms_common.h",
    "content": "/*\n * lzms_common.h\n *\n * Declarations shared between LZMS compression and decompression.\n */\n\n#ifndef _LZMS_COMMON_H\n#define _LZMS_COMMON_H\n\n#include \"wimlib/compiler.h\"\n#include \"wimlib/lzms_constants.h\"\n#include \"wimlib/types.h\"\n\n/* Offset slot tables  */\nextern const u32 lzms_offset_slot_base[LZMS_MAX_NUM_OFFSET_SYMS + 1];\nextern const u8 lzms_extra_offset_bits[LZMS_MAX_NUM_OFFSET_SYMS];\n\n/* Length slot tables  */\nextern const u32 lzms_length_slot_base[LZMS_NUM_LENGTH_SYMS + 1];\nextern const u8 lzms_extra_length_bits[LZMS_NUM_LENGTH_SYMS];\n\nunsigned\nlzms_get_slot(u32 value, const u32 slot_base_tab[], unsigned num_slots);\n\n/* Return the offset slot for the specified offset  */\nstatic forceinline unsigned\nlzms_get_offset_slot(u32 offset)\n{\n\treturn lzms_get_slot(offset, lzms_offset_slot_base, LZMS_MAX_NUM_OFFSET_SYMS);\n}\n\n/* Return the length slot for the specified length  */\nstatic forceinline unsigned\nlzms_get_length_slot(u32 length)\n{\n\treturn lzms_get_slot(length, lzms_length_slot_base, LZMS_NUM_LENGTH_SYMS);\n}\n\nunsigned\nlzms_get_num_offset_slots(size_t uncompressed_size);\n\n\n/* Probability entry for use by the range coder when in a specific state  */\nstruct lzms_probability_entry {\n\n\t/* The number of zeroes in the most recent LZMS_PROBABILITY_DENOMINATOR\n\t * bits that have been decoded or encoded using this probability entry.\n\t * The probability of the next bit being 0 is this value over\n\t * LZMS_PROBABILITY_DENOMINATOR, except for the cases where this would\n\t * imply 0% or 100% probability.  */\n\tu32 num_recent_zero_bits;\n\n\t/* The most recent LZMS_PROBABILITY_DENOMINATOR bits that have been\n\t * coded using this probability entry.  The bits are ordered such that\n\t * low order is newest and high order is oldest.  */\n\tu64 recent_bits;\n};\n\nstruct lzms_probabilites {\n\tstruct lzms_probability_entry main[LZMS_NUM_MAIN_PROBS];\n\tstruct lzms_probability_entry match[LZMS_NUM_MATCH_PROBS];\n\tstruct lzms_probability_entry lz[LZMS_NUM_LZ_PROBS];\n\tstruct lzms_probability_entry delta[LZMS_NUM_DELTA_PROBS];\n\tstruct lzms_probability_entry lz_rep[LZMS_NUM_LZ_REP_DECISIONS]\n\t\t\t\t\t    [LZMS_NUM_LZ_REP_PROBS];\n\tstruct lzms_probability_entry delta_rep[LZMS_NUM_DELTA_REP_DECISIONS]\n\t\t\t\t\t       [LZMS_NUM_DELTA_REP_PROBS];\n};\n\nvoid\nlzms_init_probabilities(struct lzms_probabilites *probs);\n\n/* Given a decoded or encoded bit, update the probability entry.  */\nstatic forceinline void\nlzms_update_probability_entry(struct lzms_probability_entry *entry, int bit)\n{\n\tSTATIC_ASSERT(LZMS_PROBABILITY_DENOMINATOR == sizeof(entry->recent_bits) * 8);\n\n#ifdef __x86_64__\n\tif (__builtin_constant_p(bit)) {\n\t\t/* Optimized implementation for x86_64 using carry flag  */\n\t\tif (bit) {\n\t\t       __asm__(\"shlq %[recent_bits]                          \\n\"\n\t\t\t       \"adcl $0xffffffff, %[num_recent_zero_bits]    \\n\"\n\t\t\t       \"orq $0x1, %[recent_bits]                     \\n\"\n\t\t\t       : [recent_bits] \"+r\" (entry->recent_bits),\n\t\t\t\t [num_recent_zero_bits] \"+mr\" (entry->num_recent_zero_bits)\n\t\t\t       :\n\t\t\t       : \"cc\");\n\t\t} else {\n\t\t       __asm__(\"shlq %[recent_bits]                          \\n\"\n\t\t\t       \"adcl $0x0, %[num_recent_zero_bits]           \\n\"\n\t\t\t       : [recent_bits] \"+m\" (entry->recent_bits),\n\t\t\t\t [num_recent_zero_bits] \"+mr\" (entry->num_recent_zero_bits)\n\t\t\t       :\n\t\t\t       : \"cc\");\n\t\t}\n\t} else\n#endif\n\t{\n\t\ts32 delta_zero_bits = (s32)(entry->recent_bits >>\n\t\t\t\t\t    (LZMS_PROBABILITY_DENOMINATOR - 1)) - bit;\n\n\t\tentry->num_recent_zero_bits += delta_zero_bits;\n\t\tentry->recent_bits = (entry->recent_bits << 1) | bit;\n\t}\n}\n\n/* Given a probability entry, return the chance out of\n * LZMS_PROBABILITY_DENOMINATOR that the next decoded bit will be a 0.  */\nstatic forceinline u32\nlzms_get_probability(const struct lzms_probability_entry *prob_entry)\n{\n\tu32 prob = prob_entry->num_recent_zero_bits;\n\n\t/* 0% and 100% probabilities aren't allowed.  */\n\n\t/*\n\t *\tif (prob == 0)\n\t *\t\tprob++;\n\t */\n\tprob += (u32)(prob - 1) >> 31;\n\n\t/*\n\t *\tif (prob == LZMS_PROBABILITY_DENOMINATOR)\n\t *\t\tprob--;\n\t */\n\tprob -= (prob >> LZMS_PROBABILITY_BITS);\n\n\treturn prob;\n}\n\nvoid\nlzms_init_symbol_frequencies(u32 freqs[], unsigned num_syms);\n\nvoid\nlzms_dilute_symbol_frequencies(u32 freqs[], unsigned num_syms);\n\n/* Pre/post-processing  */\nvoid\nlzms_x86_filter(u8 data[], s32 size, s32 last_target_usages[], bool undo);\n\n#endif /* _LZMS_COMMON_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/lzms_constants.h",
    "content": "/*\n * lzms_constants.h\n *\n * Constants for the LZMS compression format.\n */\n\n#ifndef _LZMS_CONSTANTS_H\n#define _LZMS_CONSTANTS_H\n\n/* Limits on match lengths and offsets (in bytes)  */\n#define LZMS_MIN_MATCH_LENGTH\t\t\t1\n#define LZMS_MAX_MATCH_LENGTH\t\t\t1073809578\n#define LZMS_MIN_MATCH_OFFSET\t\t\t1\n#define LZMS_MAX_MATCH_OFFSET\t\t\t1180427428\n\n/* The value to which buffer sizes should be limited.  Microsoft's\n * implementation seems to use 67108864 (2^26) bytes.  However, since the format\n * itself supports higher match lengths and offsets, we'll use 2^30 bytes.  */\n#define LZMS_MAX_BUFFER_SIZE\t\t\t1073741824\n\n/* The length of each LRU queue for match sources:\n *\n *    1. offsets of LZ matches\n *    2. (power, raw offset) pairs of delta matches */\n#define LZMS_NUM_LZ_REPS\t\t\t3\n#define LZMS_NUM_DELTA_REPS\t\t\t3\n\n/* The numbers of binary decision classes needed for encoding queue indices  */\n#define LZMS_NUM_LZ_REP_DECISIONS\t\t(LZMS_NUM_LZ_REPS - 1)\n#define LZMS_NUM_DELTA_REP_DECISIONS\t\t(LZMS_NUM_DELTA_REPS - 1)\n\n/* These are the numbers of probability entries for each binary decision class.\n * The logarithm base 2 of each of these values is the number of recently\n * encoded bits that are remembered for each decision class and are used to\n * select the appropriate probability entry when decoding/encoding the next\n * binary decision (bit).  */\n#define LZMS_NUM_MAIN_PROBS\t\t\t16\n#define LZMS_NUM_MATCH_PROBS\t\t\t32\n#define LZMS_NUM_LZ_PROBS\t\t\t64\n#define LZMS_NUM_LZ_REP_PROBS\t\t\t64\n#define LZMS_NUM_DELTA_PROBS\t\t\t64\n#define LZMS_NUM_DELTA_REP_PROBS\t\t64\n\n/* These values define the precision for probabilities in LZMS, which are always\n * given as a numerator; the denominator is implied.  */\n#define LZMS_PROBABILITY_BITS\t\t\t6\n#define LZMS_PROBABILITY_DENOMINATOR\t\t(1 << LZMS_PROBABILITY_BITS)\n\n/* These values define the initial state of each probability entry.  */\n#define LZMS_INITIAL_PROBABILITY\t\t48\n#define LZMS_INITIAL_RECENT_BITS\t\t0x0000000055555555\n\n/* The number of symbols in each Huffman-coded alphabet  */\n#define LZMS_NUM_LITERAL_SYMS\t\t\t256\n#define LZMS_NUM_LENGTH_SYMS\t\t\t54\n#define LZMS_NUM_DELTA_POWER_SYMS\t\t8\n#define LZMS_MAX_NUM_OFFSET_SYMS\t\t799\n#define LZMS_MAX_NUM_SYMS\t\t\t799\n\n/* The rebuild frequencies, in symbols, for each Huffman code  */\n#define LZMS_LITERAL_CODE_REBUILD_FREQ\t\t1024\n#define LZMS_LZ_OFFSET_CODE_REBUILD_FREQ\t1024\n#define LZMS_LENGTH_CODE_REBUILD_FREQ\t\t512\n#define LZMS_DELTA_OFFSET_CODE_REBUILD_FREQ\t1024\n#define LZMS_DELTA_POWER_CODE_REBUILD_FREQ\t512\n\n/* The maximum length, in bits, of any Huffman codeword.  This is guaranteed by\n * the way frequencies are updated.  */\n#define LZMS_MAX_CODEWORD_LENGTH\t\t15\n\n/* The maximum number of verbatim bits, in addition to the Huffman-encoded\n * length slot symbol, that may be required to encode a match length  */\n#define LZMS_MAX_EXTRA_LENGTH_BITS\t\t30\n\n/* The maximum number of verbatim bits, in addition to the Huffman-encoded\n * offset slot symbol, that may be required to encode a match offset  */\n#define LZMS_MAX_EXTRA_OFFSET_BITS\t\t30\n\n/* Parameters for x86 machine code pre/post-processing  */\n#define LZMS_X86_ID_WINDOW_SIZE\t\t\t65535\n#define LZMS_X86_MAX_TRANSLATION_OFFSET\t\t1023\n\n#endif /* _LZMS_CONSTANTS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/lzx_common.h",
    "content": "/*\n * lzx_common.h\n *\n * Declarations shared between LZX compression and decompression.\n */\n\n#ifndef _LZX_COMMON_H\n#define _LZX_COMMON_H\n\n#include \"wimlib/lzx_constants.h\"\n#include \"wimlib/types.h\"\n\nextern const s32 lzx_offset_slot_base[LZX_MAX_OFFSET_SLOTS + 1];\n\nextern const u8 lzx_extra_offset_bits[LZX_MAX_OFFSET_SLOTS];\n\nunsigned\nlzx_get_window_order(size_t max_bufsize);\n\nunsigned\nlzx_get_num_main_syms(unsigned window_order);\n\nvoid\nlzx_preprocess(u8 *data, u32 size);\n\nvoid\nlzx_postprocess(u8 *data, u32 size);\n\n#endif /* _LZX_COMMON_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/lzx_constants.h",
    "content": "/*\n * lzx_constants.h\n *\n * Constants for the LZX compression format.\n */\n\n#ifndef _LZX_CONSTANTS_H\n#define _LZX_CONSTANTS_H\n\n/* Number of literal byte values.  */\n#define LZX_NUM_CHARS\t256\n\n/* The smallest and largest allowed match lengths.  */\n#define LZX_MIN_MATCH_LEN\t2\n#define LZX_MAX_MATCH_LEN\t257\n\n/* Number of distinct match lengths that can be represented.  */\n#define LZX_NUM_LENS\t\t(LZX_MAX_MATCH_LEN - LZX_MIN_MATCH_LEN + 1)\n\n/* Number of match lengths for which no length symbol is required.  */\n#define LZX_NUM_PRIMARY_LENS\t7\n#define LZX_NUM_LEN_HEADERS\t(LZX_NUM_PRIMARY_LENS + 1)\n\n/* The first length which requires a length symbol.  */\n#define LZX_MIN_SECONDARY_LEN\t(LZX_MIN_MATCH_LEN + LZX_NUM_PRIMARY_LENS)\n\n/* Valid values of the 3-bit block type field.  */\n#define LZX_BLOCKTYPE_VERBATIM       1\n#define LZX_BLOCKTYPE_ALIGNED        2\n#define LZX_BLOCKTYPE_UNCOMPRESSED   3\n\n/* 'LZX_MIN_WINDOW_SIZE' and 'LZX_MAX_WINDOW_SIZE' are the minimum and maximum\n * sizes of the sliding window.  */\n#define LZX_MIN_WINDOW_ORDER\t15\n#define LZX_MAX_WINDOW_ORDER\t21\n#define LZX_MIN_WINDOW_SIZE\t(1UL << LZX_MIN_WINDOW_ORDER)  /* 32768   */\n#define LZX_MAX_WINDOW_SIZE\t(1UL << LZX_MAX_WINDOW_ORDER)  /* 2097152 */\n\n/* Maximum number of offset slots.  (The actual number of offset slots depends\n * on the window size.)  */\n#define LZX_MAX_OFFSET_SLOTS\t50\n\n/* Maximum number of symbols in the main code.  (The actual number of symbols in\n * the main code depends on the window size.)  */\n#define LZX_MAINCODE_MAX_NUM_SYMBOLS\t\\\n\t(LZX_NUM_CHARS + (LZX_MAX_OFFSET_SLOTS * LZX_NUM_LEN_HEADERS))\n\n/* Number of symbols in the length code.  */\n#define LZX_LENCODE_NUM_SYMBOLS\t\t(LZX_NUM_LENS - LZX_NUM_PRIMARY_LENS)\n\n/* Number of symbols in the pre-code.  */\n#define LZX_PRECODE_NUM_SYMBOLS\t\t20\n\n/* Number of bits in which each pre-code codeword length is represented.  */\n#define LZX_PRECODE_ELEMENT_SIZE\t4\n\n/* Number of low-order bits of each match offset that are entropy-encoded in\n * aligned offset blocks.  */\n#define LZX_NUM_ALIGNED_OFFSET_BITS\t3\n\n/* Number of symbols in the aligned offset code.  */\n#define LZX_ALIGNEDCODE_NUM_SYMBOLS\t(1 << LZX_NUM_ALIGNED_OFFSET_BITS)\n\n/* Mask for the match offset bits that are entropy-encoded in aligned offset\n * blocks.  */\n#define LZX_ALIGNED_OFFSET_BITMASK\t((1 << LZX_NUM_ALIGNED_OFFSET_BITS) - 1)\n\n/* Number of bits in which each aligned offset codeword length is represented.  */\n#define LZX_ALIGNEDCODE_ELEMENT_SIZE\t3\n\n/* The first offset slot which requires an aligned offset symbol in aligned\n * offset blocks.  */\n#define LZX_MIN_ALIGNED_OFFSET_SLOT\t8\n\n/* The offset slot base for LZX_MIN_ALIGNED_OFFSET_SLOT.  */\n#define LZX_MIN_ALIGNED_OFFSET\t\t14\n\n/* The maximum number of extra offset bits in verbatim blocks.  (One would need\n * to subtract LZX_NUM_ALIGNED_OFFSET_BITS to get the number of extra offset\n * bits in *aligned* blocks.)  */\n#define LZX_MAX_NUM_EXTRA_BITS\t\t17\n\n/* Maximum lengths (in bits) for length-limited Huffman code construction.  */\n#define LZX_MAX_MAIN_CODEWORD_LEN\t16\n#define LZX_MAX_LEN_CODEWORD_LEN\t16\n#define LZX_MAX_PRE_CODEWORD_LEN\t((1 << LZX_PRECODE_ELEMENT_SIZE) - 1)\n#define LZX_MAX_ALIGNED_CODEWORD_LEN\t((1 << LZX_ALIGNEDCODE_ELEMENT_SIZE) - 1)\n\n/* For LZX-compressed blocks in WIM resources, this value is always used as the\n * filesize parameter for the call instruction (0xe8 byte) preprocessing, even\n * though the blocks themselves are not this size, and the size of the actual\n * file resource in the WIM file is very likely to be something entirely\n * different as well.  */\n#define LZX_WIM_MAGIC_FILESIZE\t12000000\n\n/* Assumed LZX block size when the encoded block size begins with a 0 bit.\n * This is probably WIM-specific.  */\n#define LZX_DEFAULT_BLOCK_SIZE\t32768\n\n/* Number of offsets in the recent (or \"repeat\") offsets queue.  */\n#define LZX_NUM_RECENT_OFFSETS\t3\n\n/* An offset of n bytes is actually encoded as (n + LZX_OFFSET_ADJUSTMENT).  */\n#define LZX_OFFSET_ADJUSTMENT\t(LZX_NUM_RECENT_OFFSETS - 1)\n\n#endif /* _LZX_CONSTANTS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/matchfinder_common.h",
    "content": "/*\n * matchfinder_common.h - common code for Lempel-Ziv matchfinding\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifndef _WIMLIB_MATCHFINDER_COMMON_H\n#define _WIMLIB_MATCHFINDER_COMMON_H\n\n#include \"wimlib/bitops.h\"\n#include \"wimlib/unaligned.h\"\n\n/*\n * Given a 32-bit value that was loaded with the platform's native endianness,\n * return a 32-bit value whose high-order 8 bits are 0 and whose low-order 24\n * bits contain the first 3 bytes, arranged in octets in a platform-dependent\n * order, at the memory location from which the input 32-bit value was loaded.\n */\nstatic forceinline u32\nloaded_u32_to_u24(u32 v)\n{\n\tif (CPU_IS_LITTLE_ENDIAN())\n\t\treturn v & 0xFFFFFF;\n\telse\n\t\treturn v >> 8;\n}\n\n/*\n * Load the next 3 bytes from @p into the 24 low-order bits of a 32-bit value.\n * The order in which the 3 bytes will be arranged as octets in the 24 bits is\n * platform-dependent.  At least 4 bytes (not 3) must be available at @p.\n */\nstatic forceinline u32\nload_u24_unaligned(const u8 *p)\n{\n#if UNALIGNED_ACCESS_IS_FAST\n\treturn loaded_u32_to_u24(load_u32_unaligned(p));\n#else\n\tif (CPU_IS_LITTLE_ENDIAN())\n\t\treturn ((u32)p[0] << 0) | ((u32)p[1] << 8) | ((u32)p[2] << 16);\n\telse\n\t\treturn ((u32)p[2] << 0) | ((u32)p[1] << 8) | ((u32)p[0] << 16);\n#endif\n}\n\n/*\n * The hash function: given a sequence prefix held in the low-order bits of a\n * 32-bit value, multiply by a carefully-chosen large constant.  Discard any\n * bits of the product that don't fit in a 32-bit value, but take the\n * next-highest @num_bits bits of the product as the hash value, as those have\n * the most randomness.\n */\nstatic forceinline u32\nlz_hash(u32 seq, unsigned num_bits)\n{\n\treturn (u32)(seq * 0x1E35A7BD) >> (32 - num_bits);\n}\n\n/*\n * Return the number of bytes at @matchptr that match the bytes at @strptr, up\n * to a maximum of @max_len.  Initially, @start_len bytes are matched.\n */\nstatic forceinline unsigned\nlz_extend(const u8 * const strptr, const u8 * const matchptr,\n\t  const unsigned start_len, const unsigned max_len)\n{\n\tunsigned len = start_len;\n\tmachine_word_t v_word;\n\n\tif (UNALIGNED_ACCESS_IS_FAST) {\n\n\t\tif (likely(max_len - len >= 4 * WORDBYTES)) {\n\n\t\t#define COMPARE_WORD_STEP\t\t\t\t\\\n\t\t\tv_word = load_word_unaligned(&matchptr[len]) ^\t\\\n\t\t\t\t load_word_unaligned(&strptr[len]);\t\\\n\t\t\tif (v_word != 0)\t\t\t\t\\\n\t\t\t\tgoto word_differs;\t\t\t\\\n\t\t\tlen += WORDBYTES;\t\t\t\t\\\n\n\t\t\tCOMPARE_WORD_STEP\n\t\t\tCOMPARE_WORD_STEP\n\t\t\tCOMPARE_WORD_STEP\n\t\t\tCOMPARE_WORD_STEP\n\t\t#undef COMPARE_WORD_STEP\n\t\t}\n\n\t\twhile (len + WORDBYTES <= max_len) {\n\t\t\tv_word = load_word_unaligned(&matchptr[len]) ^\n\t\t\t\t load_word_unaligned(&strptr[len]);\n\t\t\tif (v_word != 0)\n\t\t\t\tgoto word_differs;\n\t\t\tlen += WORDBYTES;\n\t\t}\n\t}\n\n\twhile (len < max_len && matchptr[len] == strptr[len])\n\t\tlen++;\n\treturn len;\n\nword_differs:\n\tif (CPU_IS_LITTLE_ENDIAN())\n\t\tlen += (bsfw(v_word) >> 3);\n\telse\n\t\tlen += (WORDBITS - 1 - bsrw(v_word)) >> 3;\n\treturn len;\n}\n\n#endif /* _WIMLIB_MATCHFINDER_COMMON_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/metadata.h",
    "content": "#ifndef _WIMLIB_METADATA_H\n#define _WIMLIB_METADATA_H\n\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/list.h\"\n#include \"wimlib/types.h\"\n#include \"wimlib/wim.h\"\n\n/*\n * This structure holds the directory tree that comprises a WIM image, along\n * with other information maintained at the image level.  It is populated either\n * by reading and parsing a metadata resource or by scanning new files.\n *\n * An image that hasn't been modified from its on-disk copy is considered\n * \"clean\" and is loaded from its metadata resource on demand by\n * select_wim_image().  Such an image may be unloaded later to save memory when\n * a different image is selected.  An image that has been modified or has been\n * created from scratch, on the other hand, is considered \"dirty\" and is never\n * automatically unloaded.\n *\n * To implement exports, it's allowed that multiple WIMStructs reference the\n * same wim_image_metadata.\n */\nstruct wim_image_metadata {\n\n\t/* Number of WIMStructs that reference this image.  This will always be\n\t * >= 1.  It may be > 1 if this image has been exported.  */\n\tu32 refcnt;\n\n\t/* Number of WIMStructs that have this image selected as their\n\t * current_image.  This will always be <= 'refcnt' and may be 0.  */\n\tu32 selected_refcnt;\n\n\t/* Pointer to the root dentry of this image, or NULL if this image is\n\t * completely empty or is not currently loaded.  */\n\tstruct wim_dentry *root_dentry;\n\n\t/* Pointer to the security data of this image, or NULL if this image is\n\t * not currently loaded.  */\n\tstruct wim_security_data *security_data;\n\n\t/* Pointer to the blob descriptor for this image's metadata resource.\n\t * If this image metadata is sourced from a WIM file (as opposed to\n\t * being created from scratch) and hasn't been modified from the version\n\t * in that WIM file, then this blob descriptor's data corresponds to the\n\t * WIM backing source.  Otherwise, this blob descriptor is a dummy entry\n\t * with blob_location==BLOB_NONEXISTENT.  */\n\tstruct blob_descriptor *metadata_blob;\n\n\t/* Linked list of 'struct wim_inode's for this image, or an empty list\n\t * if this image is completely empty or is not currently loaded.  */\n\tstruct hlist_head inode_list;\n\n\t/* Linked list of 'struct blob_descriptor's for blobs that are\n\t * referenced by this image's dentry tree, but have not had their SHA-1\n\t * message digests calculated yet and therefore have not been inserted\n\t * into the WIMStruct's blob table.  This list is appended to when files\n\t * are scanned for inclusion in this WIM image.  */\n\tstruct list_head unhashed_blobs;\n\n\t/* Are the filecount/bytecount stats (in the XML info) out of date for\n\t * this image?  */\n\tbool stats_outdated;\n};\n\n/* Retrieve the metadata of the image in @wim currently selected with\n * select_wim_image().  */\nstatic inline struct wim_image_metadata *\nwim_get_current_image_metadata(WIMStruct *wim)\n{\n\treturn wim->image_metadata[wim->current_image - 1];\n}\n\n/* Retrieve the root dentry of the image in @wim currently selected with\n * select_wim_image().  */\nstatic inline struct wim_dentry *\nwim_get_current_root_dentry(WIMStruct *wim)\n{\n\treturn wim_get_current_image_metadata(wim)->root_dentry;\n}\n\n/* Retrieve the security data of the image in @wim currently selected with\n * select_wim_image().  */\nstatic inline struct wim_security_data *\nwim_get_current_security_data(WIMStruct *wim)\n{\n\treturn wim_get_current_image_metadata(wim)->security_data;\n}\n\n/* Return true iff the specified image has been changed since being read from\n * its backing file or has been created from scratch.  */\nstatic inline bool\nis_image_dirty(const struct wim_image_metadata *imd)\n{\n\t/* The only possible values here are BLOB_NONEXISTENT and BLOB_IN_WIM */\n\treturn imd->metadata_blob->blob_location == BLOB_NONEXISTENT;\n}\n\n/* Return true iff the specified image is unchanged since being read from the\n * specified backing WIM file.  */\nstatic inline bool\nis_image_unchanged_from_wim(const struct wim_image_metadata *imd,\n\t\t\t    const WIMStruct *wim)\n{\n\treturn !is_image_dirty(imd) && imd->metadata_blob->rdesc->wim == wim;\n}\n\n/* Mark the metadata for the specified WIM image \"dirty\" following changes to\n * the image's directory tree.  This records that the metadata no longer matches\n * the version in the WIM file (if any) and that its stats are out of date.  */\nstatic inline void\nmark_image_dirty(struct wim_image_metadata *imd)\n{\n\tblob_release_location(imd->metadata_blob);\n\timd->stats_outdated = true;\n}\n\n/* Return true iff the specified image is currently loaded into memory.  */\nstatic inline bool\nis_image_loaded(const struct wim_image_metadata *imd)\n{\n\t/* Check security_data rather than root_dentry, since root_dentry will\n\t * be NULL for a completely empty image whereas security_data will still\n\t * be non-NULL in that case.  */\n\treturn imd->security_data != NULL;\n}\n\n/* Return true iff it is okay to unload the specified image.  The image can be\n * unloaded if no WIMStructs have it selected and it is not dirty.  */\nstatic inline bool\ncan_unload_image(const struct wim_image_metadata *imd)\n{\n\treturn imd->selected_refcnt == 0 && !is_image_dirty(imd);\n}\n\n/* Iterate over each inode in a WIM image  */\n#define image_for_each_inode(inode, imd) \\\n\thlist_for_each_entry(inode, &(imd)->inode_list, i_hlist_node)\n\n/* Iterate over each inode in a WIM image (safe against inode removal)  */\n#define image_for_each_inode_safe(inode, tmp, imd) \\\n\thlist_for_each_entry_safe(inode, tmp, &(imd)->inode_list, i_hlist_node)\n\n/* Iterate over each blob in a WIM image that has not yet been hashed */\n#define image_for_each_unhashed_blob(blob, imd) \\\n\tlist_for_each_entry(blob, &(imd)->unhashed_blobs, unhashed_list)\n\n/* Iterate over each blob in a WIM image that has not yet been hashed (safe\n * against blob removal) */\n#define image_for_each_unhashed_blob_safe(blob, tmp, imd) \\\n\tlist_for_each_entry_safe(blob, tmp, &(imd)->unhashed_blobs, unhashed_list)\n\nvoid\nput_image_metadata(struct wim_image_metadata *imd);\n\nint\nappend_image_metadata(WIMStruct *wim, struct wim_image_metadata *imd);\n\nstruct wim_image_metadata *\nnew_empty_image_metadata(void);\n\nstruct wim_image_metadata *\nnew_unloaded_image_metadata(struct blob_descriptor *metadata_blob);\n\n#endif /* _WIMLIB_METADATA_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/ntfs_3g.h",
    "content": "#ifndef _WIMLIB_NTFS_3G_H\n#define _WIMLIB_NTFS_3G_H\n\n#ifdef WITH_NTFS_3G\n\n#include \"wimlib/types.h\"\n\nstruct blob_descriptor;\nstruct consume_chunk_callback;\nstruct ntfs_location;\n\nint\nread_ntfs_attribute_prefix(const struct blob_descriptor *blob, u64 size,\n\t\t\t   const struct consume_chunk_callback *cb,\n\t\t\t   bool recover_data);\n\nstruct ntfs_location *\nclone_ntfs_location(const struct ntfs_location *loc);\n\nvoid\nfree_ntfs_location(struct ntfs_location *loc);\n\nint\ncmp_ntfs_locations(const struct ntfs_location *loc1,\n\t\t   const struct ntfs_location *loc2);\n\n#endif /* WITH_NTFS_3G */\n\n#endif /* _WIMLIB_NTFS_3G_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/object_id.h",
    "content": "#ifndef _WIMLIB_OBJECT_ID_H\n#define _WIMLIB_OBJECT_ID_H\n\n#include \"wimlib/tagged_items.h\"\n\n/* Unconfirmed: are all 64 bytes of the object ID always present?  Since NTFS-3G\n * permits shorter object IDs, we'll do the same for now.  */\n#define OBJECT_ID_MIN_LENGTH\t16\n\nstatic inline const void *\ninode_get_object_id(const struct wim_inode *inode, u32 *len_ret)\n{\n\treturn inode_get_tagged_item(inode, TAG_OBJECT_ID, OBJECT_ID_MIN_LENGTH,\n\t\t\t\t     len_ret);\n}\n\nstatic inline bool\ninode_has_object_id(const struct wim_inode *inode)\n{\n\treturn inode_get_object_id(inode, NULL) != NULL;\n}\n\nstatic inline bool\ninode_set_object_id(struct wim_inode *inode, const void *object_id, u32 len)\n{\n\treturn inode_set_tagged_item(inode, TAG_OBJECT_ID, object_id, len);\n}\n\n#endif /* _WIMLIB_OBJECT_ID_H  */\n"
  },
  {
    "path": "src/wimlib/wimlib/pathlist.h",
    "content": "#ifndef _WIMLIB_PATHLIST_H\n#define _WIMLIB_PATHLIST_H\n\n#include \"wimlib/types.h\"\n\nint\nread_path_list_file(const tchar *listfile,\n\t\t    tchar ***paths_ret, size_t *num_paths_ret,\n\t\t    void **mem_ret);\n\n#endif /* _WIMLIB_PATHLIST_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/paths.h",
    "content": "#ifndef _WIMLIB_PATHS_H\n#define _WIMLIB_PATHS_H\n\n#include \"wimlib/compiler.h\"\n#include \"wimlib/types.h\"\n\nconst tchar *\npath_basename(const tchar *path);\n\nconst tchar *\npath_basename_with_len(const tchar *path, size_t len);\n\nconst tchar *\npath_stream_name(const tchar *path);\n\nvoid\ndo_canonicalize_path(const tchar *in, tchar *out);\n\ntchar *\ncanonicalize_wim_path(const tchar *wim_path);\n\n/* is_any_path_separator() - characters treated as path separators in WIM path\n * specifications and capture configuration files (the former will be translated\n * to WIM_PATH_SEPARATOR; the latter will be translated to\n * OS_PREFERRED_PATH_SEPARATOR)\n *\n * OS_PREFERRED_PATH_SEPARATOR - preferred (or only) path separator on the\n * operating system.  Used when constructing filesystem paths to extract or\n * archive.\n *\n * WIM_PATH_SEPARATOR - character treated as path separator for WIM paths.\n * Currently needs to be '/' on UNIX for the WIM mounting code to work properly.\n */\n\n#ifdef _WIN32\n#  define OS_PREFERRED_PATH_SEPARATOR L'\\\\'\n#  define is_any_path_separator(c) ((c) == L'/' || (c) == L'\\\\')\n#else\n#  define OS_PREFERRED_PATH_SEPARATOR '/'\n#  define is_any_path_separator(c) ((c) == '/' || (c) == '\\\\')\n#endif\n\n#define WIM_PATH_SEPARATOR WIMLIB_WIM_PATH_SEPARATOR\n\n#endif /* _WIMLIB_PATHS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/pattern.h",
    "content": "#ifndef _WIMLIB_PATTERN_H\n#define _WIMLIB_PATTERN_H\n\n#include \"wimlib/types.h\"\n\nstruct wim_dentry;\n\n/* Flags for match_path() and match_pattern_list() */\n\n/*\n * If set, subdirectories (and sub-files) are also matched.\n * For example, the pattern \"/dir\" would match the path \"/dir/file\".\n */\n#define MATCH_RECURSIVELY\t0x01\n\n/*\n * If set, ancestor directories are also matched.\n * For example, the pattern \"/dir/file\" would match the path \"/dir\".\n */\n#define MATCH_ANCESTORS\t\t0x02\n\nbool\nmatch_path(const tchar *path, const tchar *pattern, int match_flags);\n\nint\nexpand_path_pattern(struct wim_dentry *root, const tchar *pattern,\n\t\t    int (*consume_dentry)(struct wim_dentry *, void *),\n\t\t    void *ctx);\n\n#endif /* _WIMLIB_PATTERN_H  */\n"
  },
  {
    "path": "src/wimlib/wimlib/progress.h",
    "content": "#ifndef _WIMLIB_PROGRESS_H\n#define _WIMLIB_PROGRESS_H\n\n#include \"wimlib.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/types.h\"\n\n/* If specified, call the user-provided progress function and check its result.\n */\nstatic inline int\ncall_progress(wimlib_progress_func_t progfunc,\n\t      enum wimlib_progress_msg msg,\n\t      union wimlib_progress_info *info,\n\t      void *progctx)\n{\n\tif (progfunc) {\n\t\tenum wimlib_progress_status status;\n\n\t\tstatus = (*progfunc)(msg, info, progctx);\n\n\t\tswitch (status) {\n\t\tcase WIMLIB_PROGRESS_STATUS_CONTINUE:\n\t\t\treturn 0;\n\t\tcase WIMLIB_PROGRESS_STATUS_ABORT:\n\t\t\treturn WIMLIB_ERR_ABORTED_BY_PROGRESS;\n\t\tdefault:\n\t\t\treturn WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS;\n\t\t}\n\t}\n\treturn 0;\n}\n\nint\nreport_error(wimlib_progress_func_t progfunc,\n\t     void *progctx, int error_code, const tchar *path);\n\n/* Rate-limiting of byte-count based progress messages: update *next_progress_p\n * to the value that completed_bytes needs to reach before the next progress\n * message will be sent.  */\nstatic inline void\nset_next_progress(u64 completed_bytes, u64 total_bytes, u64 *next_progress_p)\n{\n\tif (*next_progress_p < total_bytes) {\n\t\t/*\n\t\t * Send the next message as soon as:\n\t\t *\t- another 1/1000 of the total has been processed;\n\t\t *\t- OR another 256 MiB has been processed;\n\t\t *\t- OR all bytes have been processed.\n\t\t */\n\t\t*next_progress_p = min(min(completed_bytes + total_bytes / 1000,\n\t\t\t\t\t   completed_bytes + (1UL << 28)),\n\t\t\t\t       total_bytes);\n\t} else {\n\t\t/* Last message has been sent.  */\n\t\t*next_progress_p = ~0;\n\t}\n}\n\n/* Windows: temporarily remove the stream name from the path  */\nstatic inline tchar *\nprogress_get_streamless_path(const tchar *path)\n{\n\ttchar *cookie = NULL;\n#ifdef _WIN32\n\tcookie = (wchar_t *)path_stream_name(path);\n\tif (cookie)\n\t\t*--cookie = L'\\0'; /* Overwrite the colon  */\n#endif\n\treturn cookie;\n}\n\n/* Windows: temporarily replace \\??\\ with \\\\?\\ (to make an NT namespace path\n * into a Win32 namespace path)  */\nstatic inline tchar *\nprogress_get_win32_path(const tchar *path)\n{\n#ifdef _WIN32\n\tif (path != NULL && !wcsncmp(path, L\"\\\\??\\\\\", 4)) {\n\t\t((wchar_t *)path)[1] = L'\\\\';\n\t\treturn (wchar_t *)&path[1];\n\t}\n#endif\n\treturn NULL;\n}\n\n/* Windows: restore the NT namespace path  */\nstatic inline void\nprogress_put_win32_path(tchar *cookie)\n{\n#ifdef _WIN32\n\tif (cookie)\n\t\t*cookie = L'?';\n#endif\n}\n\n/* Windows: restore the stream name part of the path  */\nstatic inline void\nprogress_put_streamless_path(tchar *cookie)\n{\n#ifdef _WIN32\n\tif (cookie)\n\t\t*cookie = L':';\n#endif\n}\n\n#endif /* _WIMLIB_PROGRESS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/registry.h",
    "content": "#ifndef _WIMLIB_REGISTRY_H\n#define _WIMLIB_REGISTRY_H\n\n#include \"wimlib/types.h\"\n\nstruct regf;\n\nenum hive_status {\n\tHIVE_OK,\n\tHIVE_CORRUPT,\n\tHIVE_UNSUPPORTED,\n\tHIVE_KEY_NOT_FOUND,\n\tHIVE_VALUE_NOT_FOUND,\n\tHIVE_VALUE_IS_WRONG_TYPE,\n\tHIVE_OUT_OF_MEMORY,\n\tHIVE_ITERATION_STOPPED,\n};\n\nenum hive_status\nhive_validate(const void *hive_mem, size_t hive_size);\n\nenum hive_status\nhive_get_string(const struct regf *regf, const tchar *key_name,\n\t\tconst tchar *value_name, tchar **value_ret);\n\nenum hive_status\nhive_get_number(const struct regf *regf, const tchar *key_name,\n\t\tconst tchar *value_name, s64 *value_ret);\n\nenum hive_status\nhive_list_subkeys(const struct regf *regf, const tchar *key_name,\n\t\t  tchar ***subkeys_ret);\n\nvoid\nhive_free_subkeys_list(tchar **subkeys);\n\nconst char *\nhive_status_to_string(enum hive_status status);\n\n#endif /* _WIMLIB_REGISTRY_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/reparse.h",
    "content": "#ifndef _WIMLIB_REPARSE_H\n#define _WIMLIB_REPARSE_H\n\n#include \"wimlib/inode.h\" /* for reparse tag definitions */\n#include \"wimlib/types.h\"\n\nstruct blob_descriptor;\nstruct blob_table;\n\n/* Windows enforces this limit on the size of a reparse point buffer.  */\n#define REPARSE_POINT_MAX_SIZE\t16384\n\n/*\n * On-disk format of a reparse point buffer.  See:\n *\thttps://msdn.microsoft.com/en-us/library/dd541671.aspx\n *\n * Note: we are not using __attribute__((packed)) for this structure, so only\n * cast to this if properly aligned!\n */\nstruct reparse_buffer_disk {\n\tle32 rptag;\n\tle16 rpdatalen;\n\tle16 rpreserved;\n\tunion {\n\t\tu8 rpdata[REPARSE_POINT_MAX_SIZE - 8];\n\n\t\tstruct {\n\t\t\tle16 substitute_name_offset;\n\t\t\tle16 substitute_name_nbytes;\n\t\t\tle16 print_name_offset;\n\t\t\tle16 print_name_nbytes;\n\n\t\t\tunion {\n\t\t\t\tstruct {\n\t\t\t\t\tu8 data[REPARSE_POINT_MAX_SIZE - 16];\n\t\t\t\t} junction;\n\n\t\t\t\tstruct {\n\t\t\t\t\tle32 flags;\n\t\t\t#define SYMBOLIC_LINK_RELATIVE 0x00000001\n\t\t\t\t\tu8 data[REPARSE_POINT_MAX_SIZE - 20];\n\t\t\t\t} symlink;\n\t\t\t};\n\t\t} link;\n\t};\n};\n\n#define REPARSE_DATA_OFFSET ((unsigned)offsetof(struct reparse_buffer_disk, rpdata))\n\n#define REPARSE_DATA_MAX_SIZE (REPARSE_POINT_MAX_SIZE - REPARSE_DATA_OFFSET)\n\nstatic void __attribute__((unused))\ncheck_reparse_buffer_disk(void)\n{\n\tSTATIC_ASSERT(offsetof(struct reparse_buffer_disk, rpdata) == 8);\n\tSTATIC_ASSERT(offsetof(struct reparse_buffer_disk, link.junction.data) == 16);\n\tSTATIC_ASSERT(offsetof(struct reparse_buffer_disk, link.symlink.data) == 20);\n\tSTATIC_ASSERT(sizeof(struct reparse_buffer_disk) == REPARSE_POINT_MAX_SIZE);\n}\n\n/* Wrapper around a symbolic link or junction reparse point\n * (WIM_IO_REPARSE_TAG_SYMLINK or WIM_IO_REPARSE_TAG_MOUNT_POINT)  */\nstruct link_reparse_point {\n\n\tu32 rptag;\n\tu16 rpreserved;\n\n\t/* Flags, valid for symbolic links only  */\n\tu32 symlink_flags;\n\n\t/* Pointers to the substitute name and print name of the link,\n\t * potentially not null terminated  */\n\tutf16lechar *substitute_name;\n\tutf16lechar *print_name;\n\n\t/* Lengths of the substitute and print names in bytes, not including\n\t * their null terminators if present  */\n\tsize_t substitute_name_nbytes;\n\tsize_t print_name_nbytes;\n};\n\nstatic inline bool\nlink_is_relative_symlink(const struct link_reparse_point *link)\n{\n\treturn link->rptag == WIM_IO_REPARSE_TAG_SYMLINK &&\n\t       (link->symlink_flags & SYMBOLIC_LINK_RELATIVE);\n}\n\nvoid\ncomplete_reparse_point(struct reparse_buffer_disk *rpbuf,\n\t\t       const struct wim_inode *inode, u16 blob_size);\n\nint\nparse_link_reparse_point(const struct reparse_buffer_disk *rpbuf, u16 rpbuflen,\n\t\t\t struct link_reparse_point *link);\n\nint\nmake_link_reparse_point(const struct link_reparse_point *link,\n\t\t\tstruct reparse_buffer_disk *rpbuf, u16 *rpbuflen_ret);\n\n#ifndef _WIN32\nint\nwim_inode_readlink(const struct wim_inode *inode, char *buf, size_t bufsize,\n\t\t   const struct blob_descriptor *blob,\n\t\t   const char *altroot, size_t altroot_len);\n\nint\nwim_inode_set_symlink(struct wim_inode *inode, const char *target,\n\t\t      struct blob_table *blob_table);\n#endif\n\n#endif /* _WIMLIB_REPARSE_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/resource.h",
    "content": "#ifndef _WIMLIB_RESOURCE_H\n#define _WIMLIB_RESOURCE_H\n\n#include \"wimlib/list.h\"\n#include \"wimlib/sha1.h\"\n#include \"wimlib/types.h\"\n\nstruct blob_descriptor;\nstruct filedes;\nstruct wim_image_metadata;\n\n/*\n * Description of a \"resource\" in a WIM file.  A \"resource\" is a standalone,\n * possibly compressed region of data.  Normally, there is a one-to-one\n * correspondence between \"blobs\" (each of which may be the contents of a file,\n * for example) and resources.  However, a resource with the\n * WIM_RESHDR_FLAG_SOLID flag set is a \"solid\" resource that contains multiple\n * blobs compressed together.\n */\nstruct wim_resource_descriptor {\n\t/* The WIM containing this resource.  @wim->in_fd is expected to be a\n\t * file descriptor to the underlying WIM file, opened for reading.  */\n\tWIMStruct *wim;\n\n\t/* The offset, in bytes, from the start of WIM file at which this\n\t * resource starts.  */\n\tu64 offset_in_wim;\n\n\t/* The size of this resource in the WIM file.  For compressed resources\n\t * this is the compressed size, including overhead such as the chunk\n\t * table.  */\n\tu64 size_in_wim;\n\n\t/* The number of bytes of uncompressed data this resource decompresses\n\t * to.  */\n\tu64 uncompressed_size;\n\n\t/* The list of blobs this resource contains.  */\n\tstruct list_head blob_list;\n\n\t/* Flags for this resource (WIM_RESHDR_FLAG_*).  */\n\tu32 flags : 8;\n\n\t/* [wimlib extension] This flag will be set if the WIM is pipable.  In\n\t * such cases, the resource will be in a slightly different format if it\n\t * is compressed.  */\n\tu32 is_pipable : 1;\n\n\t/* Temporary flag.  */\n\tu32 raw_copy_ok : 1;\n\n\t/* Compression type of this resource.  */\n\tu32 compression_type : 22;\n\n\t/* Compression chunk size of this resource.  Irrelevant if the resource\n\t * is uncompressed.  */\n\tu32 chunk_size;\n};\n\n/* On-disk version of a WIM resource header.  */\nPRAGMA_BEGIN_PACKED\nstruct wim_reshdr_disk {\n\t/* Size of the resource as it appears in the WIM file (possibly\n\t * compressed).  */\n\tu8 size_in_wim[7];\n\n\t/* Zero or more of the WIM_RESHDR_FLAG_* flags.  These indicate, for\n\t * example, whether the resource is compressed or not.  */\n\tu8 flags;\n\n\t/* Offset of the resource from the start of the WIM file, in bytes.  */\n\tle64 offset_in_wim;\n\n\t/* Uncompressed size of the resource, in bytes.  */\n\tle64 uncompressed_size;\n} __attribute__((packed));\nPRAGMA_END_PACKED\n\n/* In-memory version of a WIM resource header (`struct wim_reshdr_disk').  */\nstruct wim_reshdr {\n\tu64 size_in_wim : 56;\n\tu64 flags : 8;\n\tu64 offset_in_wim;\n\tu64 uncompressed_size;\n};\n\n/* Flags for the `flags' field of WIM resource headers (`struct wim_reshdr').\n */\n\n/* Unknown meaning; currently ignored by wimlib.  */\n#define WIM_RESHDR_FLAG_FREE            0x01\n\n/* The resource is a metadata resource for a WIM image, or is the blob table or\n * XML data for the WIM.  */\n#define WIM_RESHDR_FLAG_METADATA        0x02\n\n/* The resource is a non-solid resource compressed using the WIM's default\n * compression type.  */\n#define WIM_RESHDR_FLAG_COMPRESSED\t0x04\n\n/* Unknown meaning; currently ignored by wimlib.  */\n#define WIM_RESHDR_FLAG_SPANNED         0x08\n\n/* The resource is a solid compressed resource which may contain multiple blobs.\n * This flag is only allowed if the WIM version number is WIM_VERSION_SOLID.  */\n#define WIM_RESHDR_FLAG_SOLID\t\t0x10\n\n/* Magic number in the 'uncompressed_size' field of the resource header that\n * identifies the main entry for a solid resource.  */\n#define SOLID_RESOURCE_MAGIC_NUMBER\t0x100000000ULL\n\nstatic inline void\ncopy_reshdr(struct wim_reshdr *dest, const struct wim_reshdr *src)\n{\n\tmemcpy(dest, src, sizeof(struct wim_reshdr));\n}\n\nstatic inline void\nzero_reshdr(struct wim_reshdr *reshdr)\n{\n\tmemset(reshdr, 0, sizeof(struct wim_reshdr));\n}\n\nvoid\nwim_reshdr_to_desc(const struct wim_reshdr *reshdr, WIMStruct *wim,\n\t\t   struct wim_resource_descriptor *rdesc);\n\nvoid\nwim_reshdr_to_desc_and_blob(const struct wim_reshdr *reshdr, WIMStruct *wim,\n\t\t\t    struct wim_resource_descriptor *rdesc,\n\t\t\t    struct blob_descriptor *blob);\n\nvoid\nget_wim_reshdr(const struct wim_reshdr_disk *disk_reshdr,\n\t       struct wim_reshdr *reshdr);\n\nvoid\nput_wim_reshdr(const struct wim_reshdr *reshdr,\n\t       struct wim_reshdr_disk *disk_reshdr);\n\n/* Alternate chunk table format for resources with WIM_RESHDR_FLAG_SOLID set.\n */\nPRAGMA_BEGIN_PACKED\nstruct alt_chunk_table_header_disk {\n\t/* Uncompressed size of the resource in bytes.  */\n\tle64 res_usize;\n\n\t/* Number of bytes each compressed chunk decompresses into, except\n\t * possibly the last which decompresses into the remainder.  This\n\t * overrides the chunk size specified by the WIM header.  */\n\tle32 chunk_size;\n\n\t/* Compression format used for compressed chunks:\n\t * 0 = None\n\t * 1 = XPRESS\n\t * 2 = LZX\n\t * 3 = LZMS\n\t *\n\t * This overrides the compression type specified by the WIM header.  */\n\tle32 compression_format;\n\n\t/* This header is directly followed by a table of compressed sizes of\n\t * the chunks (4 bytes per entry).  */\n} __attribute__((packed));\nPRAGMA_END_PACKED\n\nstatic inline unsigned int\nget_chunk_entry_size(u64 res_size, bool is_alt)\n{\n\tif (res_size <= UINT32_MAX || is_alt)\n\t\treturn 4;\n\telse\n\t\treturn 8;\n}\n\n/* Functions to read blobs  */\n\nint\nread_partial_wim_blob_into_buf(const struct blob_descriptor *blob,\n\t\t\t       u64 offset, size_t size, void *buf);\n\nint\nread_blob_into_buf(const struct blob_descriptor *blob, void *buf);\n\nint\nread_blob_into_alloc_buf(const struct blob_descriptor *blob, void **buf_ret);\n\nint\nwim_reshdr_to_data(const struct wim_reshdr *reshdr, WIMStruct *wim,\n\t\t   void **buf_ret);\n\nint\nwim_reshdr_to_hash(const struct wim_reshdr *reshdr, WIMStruct *wim,\n\t\t   u8 hash[SHA1_HASH_SIZE]);\n\nint\nskip_wim_resource(const struct wim_resource_descriptor *rdesc);\n\n/*\n * Callback function for reading chunks.  Called whenever the next chunk of\n * uncompressed data is available, passing 'ctx' as the last argument. 'size' is\n * guaranteed to be nonzero.  Must return 0 on success, or a positive wimlib\n * error code on failure.\n */\nstruct consume_chunk_callback {\n\tint (*func)(const void *chunk, size_t size, void *ctx);\n\tvoid *ctx;\n};\n\n/* Pass a chunk of data to the specified consume_chunk callback */\nstatic inline int\nconsume_chunk(const struct consume_chunk_callback *cb,\n\t      const void *chunk, size_t size)\n{\n\treturn (*cb->func)(chunk, size, cb->ctx);\n}\n\n/* Callback functions for reading blobs  */\nstruct read_blob_callbacks {\n\n\t/* Called when starting to read a blob.  Must return 0 on success, or a\n\t * positive wimlib error code on failure, or in the case of\n\t * read_blob_list(), the special value BEGIN_BLOB_STATUS_SKIP_BLOB which\n\t * indicates that the data for this blob should not be read.  */\n\tint (*begin_blob)(struct blob_descriptor *blob, void *ctx);\n#define BEGIN_BLOB_STATUS_SKIP_BLOB\t(-1)\n\n\t/* Called when the next chunk of uncompressed data is available.  'size'\n\t * is guaranteed to be nonzero.  Must return 0 on success, or a positive\n\t * wimlib error code on failure.  */\n\tint (*continue_blob)(const struct blob_descriptor *blob, u64 offset,\n\t\t\t     const void *chunk, size_t size, void *ctx);\n\n\t/* Called when a blob has been successfully read (status=0), or when\n\t * begin_blob() was successfully called but an error occurred before the\n\t * blob was fully read (status != 0; in this case the implementation\n\t * should do cleanup and then pass on the status).  Must return 0 on\n\t * success, or a positive wimlib error code on failure.  */\n\tint (*end_blob)(struct blob_descriptor *blob, int status, void *ctx);\n\n\t/* Parameter passed to each of the callback functions.  */\n\tvoid *ctx;\n};\n\n/* Call cbs->begin_blob() if present.  */\nstatic inline int\ncall_begin_blob(struct blob_descriptor *blob,\n\t\tconst struct read_blob_callbacks *cbs)\n{\n\tif (!cbs->begin_blob)\n\t\treturn 0;\n\treturn (*cbs->begin_blob)(blob, cbs->ctx);\n}\n\n/* Call cbs->continue_blob() if present.  */\nstatic inline int\ncall_continue_blob(const struct blob_descriptor *blob, u64 offset,\n\t\t   const void *chunk, size_t size,\n\t\t   const struct read_blob_callbacks *cbs)\n{\n\tif (!cbs->continue_blob)\n\t\treturn 0;\n\treturn (*cbs->continue_blob)(blob, offset, chunk, size, cbs->ctx);\n}\n\n/* Call cbs->end_blob() if present.  */\nstatic inline int\ncall_end_blob(struct blob_descriptor *blob, int status,\n\t      const struct read_blob_callbacks *cbs)\n{\n\tif (!cbs->end_blob)\n\t\treturn status;\n\treturn (*cbs->end_blob)(blob, status, cbs->ctx);\n}\n\n/* Flags for read_blob_list()  */\n#define VERIFY_BLOB_HASHES\t\t0x1\n#define COMPUTE_MISSING_BLOB_HASHES\t0x2\n#define BLOB_LIST_ALREADY_SORTED\t0x4\n#define RECOVER_DATA\t\t\t0x8\n\nint\nread_blob_list(struct list_head *blob_list, size_t list_head_offset,\n\t       const struct read_blob_callbacks *cbs, int flags);\n\nint\nread_blob_with_cbs(struct blob_descriptor *blob,\n\t\t   const struct read_blob_callbacks *cbs, bool recover_data);\n\nint\nread_blob_with_sha1(struct blob_descriptor *blob,\n\t\t    const struct read_blob_callbacks *cbs, bool recover_data);\n\nint\nextract_blob_prefix_to_fd(struct blob_descriptor *blob, u64 size,\n\t\t\t  struct filedes *fd);\n\nint\nextract_blob_to_fd(struct blob_descriptor *blob, struct filedes *fd,\n\t\t   bool recover_data);\n\n/* Miscellaneous blob functions.  */\n\nint\nsha1_blob(struct blob_descriptor *blob);\n\n/* Functions to read/write metadata resources.  */\n\nint\nread_metadata_resource(struct wim_image_metadata *imd);\n\nint\nwrite_metadata_resource(WIMStruct *wim, int image, int write_resource_flags);\n\n/* Definitions specific to pipable WIM resources.  */\n\n/* Arbitrary number to begin each blob in the pipable WIM, used for sanity\n * checking.  */\n#define PWM_BLOB_MAGIC 0x2b9b9ba2443db9d8ULL\n\n/* Header that precedes each blob in a pipable WIM.  */\nPRAGMA_BEGIN_PACKED\nstruct pwm_blob_hdr {\n\tle64 magic;\t\t\t/* +0   */\n\tle64 uncompressed_size;\t\t/* +8   */\n\tu8 hash[SHA1_HASH_SIZE];\t/* +16  */\n\tle32 flags;\t\t\t/* +36  */\n\t\t\t\t\t/* +40  */\n} __attribute__((packed));\n\n/* Header that precedes each chunk of a compressed resource in a pipable WIM.\n */\nstruct pwm_chunk_hdr {\n\tle32 compressed_size;\n} __attribute__((packed));\nPRAGMA_END_PACKED\n\n#endif /* _WIMLIB_RESOURCE_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/scan.h",
    "content": "#ifndef _WIMLIB_SCAN_H\n#define _WIMLIB_SCAN_H\n\n#include \"wimlib.h\"\n#include \"wimlib/inode_table.h\"\n#include \"wimlib/list.h\"\n#include \"wimlib/progress.h\"\n#include \"wimlib/security.h\"\n#include \"wimlib/textfile.h\"\n#include \"wimlib/util.h\"\n\nstruct blob_table;\nstruct wim_dentry;\nstruct wim_inode;\n\nstruct capture_config {\n\n\t/* List of path patterns to exclude  */\n\tstruct string_list exclusion_pats;\n\n\t/* List of path patterns to include, overriding exclusion_pats  */\n\tstruct string_list exclusion_exception_pats;\n\n\tvoid *buf;\n};\n\n/* Scan parameters: common parameters to implementations of building an\n * in-memory dentry tree from an external directory structure.  */\nstruct scan_params {\n\n\t/* The blob table within which any new blobs discovered during the scan\n\t * will be deduplicated.  */\n\tstruct blob_table *blob_table;\n\n\t/* List of new blobs that have been discovered without their SHA-1\n\t * message digests having been calculated (as a shortcut).  */\n\tstruct list_head *unhashed_blobs;\n\n\t/* Map from (inode number, device number) pair to inode for new inodes\n\t * that have been discovered so far.  */\n\tstruct wim_inode_table *inode_table;\n\n\t/* The set of unique security descriptors to which each newly\n\t * discovered, unique security descriptor will be added.  */\n\tstruct wim_sd_set *sd_set;\n\n\t/* The capture configuration in effect, or NULL if none.  */\n\tstruct capture_config *config;\n\n\t/* Flags that affect the scan operation (WIMLIB_ADD_FLAG_*) */\n\tint add_flags;\n\n\t/* If non-NULL, the user-supplied progress function. */\n\twimlib_progress_func_t progfunc;\n\tvoid *progctx;\n\n\t/* Progress data.  */\n\tunion wimlib_progress_info progress;\n\n\t/* Path to the file or directory currently being scanned */\n\ttchar *cur_path;\n\tsize_t cur_path_nchars;\n\tsize_t cur_path_alloc_nchars;\n\n\t/* Length of the prefix of 'cur_path' which names the root of the\n\t * directory tree currently being scanned */\n\tsize_t root_path_nchars;\n\n\t/* Can be used by the scan implementation.  */\n\tu64 capture_root_ino;\n\tu64 capture_root_dev;\n};\n\n/* scan.c */\n\nint\ndo_scan_progress(struct scan_params *params, int status,\n\t\t const struct wim_inode *inode);\n\nint\nmangle_pat(tchar *pat, const tchar *path, unsigned long line_no);\n\nint\nread_capture_config(const tchar *config_file, const void *buf,\n\t\t    size_t bufsize, struct capture_config *config);\n\nvoid\ndestroy_capture_config(struct capture_config *config);\n\nbool\nmatch_pattern_list(const tchar *path, const struct string_list *list,\n\t\t   int match_flags);\n\nint\ntry_exclude(const struct scan_params *params);\n\ntypedef int (*scan_tree_t)(struct wim_dentry **, const tchar *,\n\t\t\t   struct scan_params *);\n\n#ifdef WITH_NTFS_3G\n/* ntfs-3g_capture.c */\nint\nntfs_3g_build_dentry_tree(struct wim_dentry **root_ret,\n\t\t\t  const tchar *device, struct scan_params *params);\n#endif\n\n#ifdef _WIN32\n/* win32_capture.c */\nint\nwin32_build_dentry_tree(struct wim_dentry **root_ret,\n\t\t\tconst tchar *root_disk_path,\n\t\t\tstruct scan_params *params);\n#define platform_default_scan_tree win32_build_dentry_tree\n#else\n/* unix_capture.c */\nint\nunix_build_dentry_tree(struct wim_dentry **root_ret,\n\t\t       const tchar *root_disk_path, struct scan_params *params);\n#define platform_default_scan_tree unix_build_dentry_tree\n#endif\n\n#ifdef ENABLE_TEST_SUPPORT\nint\ngenerate_dentry_tree(struct wim_dentry **root_ret,\n\t\t     const tchar *root_disk_path, struct scan_params *params);\n#endif\n\n#define WIMLIB_ADD_FLAG_ROOT\t0x80000000\n\nstatic inline int\nreport_scan_error(struct scan_params *params, int error_code)\n{\n\treturn report_error(params->progfunc, params->progctx, error_code,\n\t\t\t    params->cur_path);\n}\n\nbool\nshould_ignore_filename(const tchar *name, int name_nchars);\n\nvoid\nattach_scanned_tree(struct wim_dentry *parent, struct wim_dentry *child,\n\t\t    struct blob_table *blob_table);\n\nint\npathbuf_init(struct scan_params *params, const tchar *root_path);\n\nconst tchar *\npathbuf_append_name(struct scan_params *params, const tchar *name,\n\t\t    size_t name_nchars, size_t *orig_path_nchars_ret);\n\nvoid\npathbuf_truncate(struct scan_params *params, size_t nchars);\n\n#endif /* _WIMLIB_SCAN_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/security.h",
    "content": "#ifndef _WIMLIB_SECURITY_H\n#define _WIMLIB_SECURITY_H\n\n#include \"wimlib/types.h\"\n\nstruct wim_security_data;\nstruct avl_tree_node;\n\n/* Map from SHA1 message digests of security descriptors to security IDs, which\n * are themselves indices into the table of security descriptors in the 'struct\n * wim_security_data'. */\nstruct wim_sd_set {\n\tstruct wim_security_data *sd;\n\tstruct avl_tree_node *root;\n\ts32 orig_num_entries;\n};\n\n/* Table of security descriptors for a WIM image. */\nstruct wim_security_data {\n\t/* The total length of the security data, in bytes.  If there are no\n\t * security descriptors, this field, when read from the on-disk metadata\n\t * resource, may be either 8 (which is correct) or 0 (which is\n\t * interpreted as 8). */\n\tu32 total_length;\n\n\t/* The number of security descriptors in the array @descriptors. */\n\tu32 num_entries;\n\n\t/* Array of sizes of the descriptors, in bytes, in the array\n\t * @descriptors. */\n\tu64 *sizes;\n\n\t/* Array of pointers to the security descriptors in the\n\t * SECURITY_DESCRIPTOR_RELATIVE format. */\n\tu8 **descriptors;\n};\n\nvoid\nrollback_new_security_descriptors(struct wim_sd_set *sd_set);\n\nvoid\ndestroy_sd_set(struct wim_sd_set *sd_set);\n\ns32\nsd_set_add_sd(struct wim_sd_set *sd_set, const char descriptor[],\n\t      size_t size);\n\nint\ninit_sd_set(struct wim_sd_set *sd_set, struct wim_security_data *sd);\n\nstruct wim_security_data *\nnew_wim_security_data(void);\n\nint\nread_wim_security_data(const u8 *buf, size_t buf_len,\n\t\t       struct wim_security_data **sd_ret);\n\nu8 *\nwrite_wim_security_data(const struct wim_security_data * restrict sd,\n\t\t\tu8 * restrict p);\n\nvoid\nprint_wim_security_data(const struct wim_security_data *sd);\n\nvoid\nfree_wim_security_data(struct wim_security_data *sd);\n\n#endif /* _WIMLIB_SECURITY_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/security_descriptor.h",
    "content": "/*\n * security_descriptor.h - declarations for Windows security descriptor format\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifndef _WIMLIB_SECURITY_DESCRIPTOR_H\n#define _WIMLIB_SECURITY_DESCRIPTOR_H\n\n#include \"wimlib/compiler.h\"\n#include \"wimlib/types.h\"\n\n/* Note: the data types in this header are prefixed with wimlib_ to avoid\n * conflicts with the same types being defined in the libntfs-3g headers.  */\n\n/* Windows NT security descriptor, in self-relative format  */\ntypedef struct {\n\t/* Security descriptor revision; should be 1  */\n\tu8 revision;\n\n\t/* Padding  */\n\tu8 sbz1;\n\n\t/* Bitwise OR of flags defined below, such as SE_DACL_PRESENT  */\n\tle16 control;\n\n\t/* Offset of owenr SID structure in the security descriptor  */\n\tle32 owner_offset;\n\n\t/* Offset of group SID structure in the security descriptor  */\n\tle32 group_offset;\n\n\t/* Offset of System Access Control List (SACL) in security descriptor,\n\t * or 0 if no SACL is present  */\n\tle32 sacl_offset;\n\n\t/* Offset of Discretionary Access Control List (DACL) in security\n\t * descriptor, or 0 if no DACL is present  */\n\tle32 dacl_offset;\n} __attribute__((packed)) wimlib_SECURITY_DESCRIPTOR_RELATIVE;\n\n#define wimlib_SE_OWNER_DEFAULTED\t\t0x0001\n#define wimlib_SE_GROUP_DEFAULTED\t\t0x0002\n#define wimlib_SE_DACL_PRESENT\t\t\t0x0004\n#define wimlib_SE_DACL_DEFAULTED\t\t0x0008\n#define wimlib_SE_SACL_PRESENT\t\t\t0x0010\n#define wimlib_SE_SACL_DEFAULTED\t\t0x0020\n#define wimlib_SE_DACL_AUTO_INHERIT_REQ\t\t0x0100\n#define wimlib_SE_SACL_AUTO_INHERIT_REQ\t\t0x0200\n#define wimlib_SE_DACL_AUTO_INHERITED\t\t0x0400\n#define wimlib_SE_SACL_AUTO_INHERITED\t\t0x0800\n#define wimlib_SE_DACL_PROTECTED\t\t0x1000\n#define wimlib_SE_SACL_PROTECTED\t\t0x2000\n#define wimlib_SE_RM_CONTROL_VALID\t\t0x4000\n#define wimlib_SE_SELF_RELATIVE\t\t\t0x8000\n\n/* Windows NT security identifier (user or group)  */\ntypedef struct {\n\n\tu8  revision;\n\tu8  sub_authority_count;\n\n\t/* Identifies the authority that issued the SID  */\n\tu8  identifier_authority[6];\n\n\tle32 sub_authority[];\n} __attribute__((packed)) wimlib_SID;\n\n/* Header of a Windows NT access control list  */\ntypedef struct {\n\t/* ACL_REVISION or ACL_REVISION_DS */\n\tu8 revision;\n\n\t/* padding  */\n\tu8 sbz1;\n\n\t/* Total size of the ACL, including all access control entries  */\n\tle16 acl_size;\n\n\t/* Number of access control entry structures that follow the ACL\n\t * structure  */\n\tle16 ace_count;\n\n\t/* padding  */\n\tle16 sbz2;\n} __attribute__((packed)) wimlib_ACL;\n\n#define wimlib_ACCESS_ALLOWED_ACE_TYPE\t\t0\n#define wimlib_ACCESS_DENIED_ACE_TYPE\t\t1\n#define wimlib_SYSTEM_AUDIT_ACE_TYPE\t\t2\n\n/* Header of a Windows NT access control entry  */\ntypedef struct {\n\t/* Type of ACE  */\n\tu8 type;\n\n\t/* Bitwise OR of inherit ACE flags  */\n\tu8 flags;\n\n\t/* Size of the access control entry, including this header  */\n\tle16 size;\n} __attribute__((packed)) wimlib_ACE_HEADER;\n\n/* Windows NT access control entry to grant rights to a user or group  */\ntypedef struct {\n\twimlib_ACE_HEADER hdr;\n\tle32 mask;\n\twimlib_SID sid;\n} __attribute__((packed)) wimlib_ACCESS_ALLOWED_ACE;\n\n/* Windows NT access control entry to deny rights to a user or group  */\ntypedef struct {\n\twimlib_ACE_HEADER hdr;\n\tle32 mask;\n\twimlib_SID sid;\n} __attribute__((packed)) wimlib_ACCESS_DENIED_ACE;\n\n/* Windows NT access control entry to audit access to the object  */\ntypedef struct {\n\twimlib_ACE_HEADER hdr;\n\tle32 mask;\n\twimlib_SID sid;\n} __attribute__((packed)) wimlib_SYSTEM_AUDIT_ACE;\n\n#endif /* _WIMLIB_SECURITY_DESCRIPTOR_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/sha1.h",
    "content": "/*\n * sha1.h\n *\n * Copyright 2022-2023 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifndef _WIMLIB_SHA1_H\n#define _WIMLIB_SHA1_H\n\n#include <string.h>\n\n#include \"wimlib/types.h\"\n#include \"wimlib/util.h\"\n\n#define SHA1_HASH_SIZE\t20\n#define SHA1_BLOCK_SIZE\t64\n\nstruct sha1_ctx {\n\tu64 bytecount;\n\tu32 h[5];\n\tu8 buffer[SHA1_BLOCK_SIZE];\n};\n\nvoid\nsha1_init(struct sha1_ctx *ctx);\n\nvoid\nsha1_update(struct sha1_ctx *ctx, const void *data, size_t len);\n\nvoid\nsha1_final(struct sha1_ctx *ctx, u8 hash[SHA1_HASH_SIZE]);\n\nvoid\nsha1(const void *data, size_t len, u8 hash[SHA1_HASH_SIZE]);\n\nextern const u8 zero_hash[SHA1_HASH_SIZE];\n\n#define SHA1_HASH_STRING_LEN\t(2 * SHA1_HASH_SIZE + 1)\nvoid\nsprint_hash(const u8 hash[SHA1_HASH_SIZE], tchar strbuf[SHA1_HASH_STRING_LEN]);\n\nstatic inline void\ncopy_hash(u8 dest[SHA1_HASH_SIZE], const u8 src[SHA1_HASH_SIZE])\n{\n\tmemcpy(dest, src, SHA1_HASH_SIZE);\n}\n\nstatic inline int\nhashes_cmp(const u8 h1[SHA1_HASH_SIZE], const u8 h2[SHA1_HASH_SIZE])\n{\n\treturn memcmp(h1, h2, SHA1_HASH_SIZE);\n}\n\nstatic inline bool\nhashes_equal(const u8 h1[SHA1_HASH_SIZE], const u8 h2[SHA1_HASH_SIZE])\n{\n\treturn !hashes_cmp(h1, h2);\n}\n\nstatic inline bool\nis_zero_hash(const u8 *hash)\n{\n\treturn hash == zero_hash || hashes_equal(hash, zero_hash);\n}\n\n#endif /* _WIMLIB_SHA1_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/solid.h",
    "content": "#ifndef _WIMLIB_SOLID_H\n#define _WIMLIB_SOLID_H\n\nstruct list_head;\n\nint\nsort_blob_list_for_solid_compression(struct list_head *blob_list);\n\n#endif /* _WIMLIB_SOLID_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/tagged_items.h",
    "content": "#ifndef _WIMLIB_TAGGED_ITEMS_H\n#define _WIMLIB_TAGGED_ITEMS_H\n\n#include \"wimlib/types.h\"\n\nstruct wim_inode;\n\n/* Windows-style object ID */\n#define TAG_OBJECT_ID\t\t\t0x00000001\n\n/* Extended attributes */\n#define TAG_XATTRS\t\t\t0x00000002\n\n/* [wimlib extension] Standard UNIX metadata: uid, gid, mode, and rdev */\n#define TAG_WIMLIB_UNIX_DATA\t\t0x337DD873\n\n/*\n * [wimlib extension] Linux-style extended attributes\n * (deprecated in favor of TAG_XATTRS)\n */\n#define TAG_WIMLIB_LINUX_XATTRS\t\t0x337DD874\n\nvoid *\ninode_get_tagged_item(const struct wim_inode *inode, u32 tag, u32 min_len,\n\t\t      u32 *actual_len_ret);\n\nbool\ninode_set_tagged_item(struct wim_inode *inode, u32 tag,\n\t\t      const void *data, u32 len);\n\n#endif /* _WIMLIB_TAGGED_ITEMS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/test_support.h",
    "content": "#ifndef _WIMLIB_TEST_SUPPORT_H\n#define _WIMLIB_TEST_SUPPORT_H\n\n#ifdef ENABLE_TEST_SUPPORT\n\n#include \"wimlib.h\"\n#include \"wimlib/types.h\"\n\n#define WIMLIB_ERR_IMAGES_ARE_DIFFERENT\t\t\t200\n\n#define WIMLIB_ADD_FLAG_GENERATE_TEST_DATA\t\t0x08000000\n\n#define WIMLIB_CMP_FLAG_UNIX_MODE\t0x00000001\n#define WIMLIB_CMP_FLAG_NTFS_3G_MODE\t0x00000002\n#define WIMLIB_CMP_FLAG_WINDOWS_MODE\t0x00000004\n#define WIMLIB_CMP_FLAG_EXT4\t\t0x00000008\n\nWIMLIBAPI void\nwimlib_seed_random(u64 seed);\n\nWIMLIBAPI int\nwimlib_compare_images(WIMStruct *wim1, int image1,\n\t\t      WIMStruct *wim2, int image2, int cmp_flags);\n\nWIMLIBAPI int\nwimlib_parse_and_write_xml_doc(const tchar *in, tchar **out_ret);\n\nWIMLIBAPI int\nwimlib_utf8_to_utf16le(const char *in, size_t in_nbytes,\n\t\t       utf16lechar **out_ret, size_t *out_nbytes_ret);\n\nWIMLIBAPI int\nwimlib_utf16le_to_utf8(const utf16lechar *in, size_t in_nbytes,\n\t\t       char **out_ret, size_t *out_nbytes_ret);\n\n#endif /* ENABLE_TEST_SUPPORT */\n\n#endif /* _WIMLIB_TEST_SUPPORT_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/textfile.h",
    "content": "#ifndef _WIMLIB_TEXTFILE_H_\n#define _WIMLIB_TEXTFILE_H_\n\n#include \"wimlib/types.h\"\n\nstruct string_list {\n\ttchar **strings;\n\tsize_t num_strings;\n\tsize_t num_alloc_strings;\n};\n\n#define STRING_LIST_INITIALIZER \\\n\t{ .strings = NULL, .num_strings = 0, .num_alloc_strings = 0, }\n\n#define STRING_LIST(_strings) \\\n\tstruct string_list _strings = STRING_LIST_INITIALIZER\n\ntypedef int (*line_mangle_t)(tchar *line, const tchar *filename,\n\t\t\t     unsigned long line_no);\n\nstruct text_file_section {\n\tconst tchar *name;\n\tstruct string_list *strings;\n};\n\n#define LOAD_TEXT_FILE_REMOVE_QUOTES 0x00000001\n#define LOAD_TEXT_FILE_NO_WARNINGS   0x00000002\n#define LOAD_TEXT_FILE_ALLOW_STDIN   0x00000004\n\nint\nload_text_file(const tchar *path, const void *buf, size_t bufsize,\n\t       void **mem_ret,\n\t       const struct text_file_section *pos_sections,\n\t       int num_pos_sections,\n\t       int flags, line_mangle_t mangle_line);\n\n#endif /* _WIMLIB_TEXTFILE_H_ */\n"
  },
  {
    "path": "src/wimlib/wimlib/threads.h",
    "content": "#ifndef _WIMLIB_THREADS_H\n#define _WIMLIB_THREADS_H\n\n#include <stdbool.h>\n\n#ifdef _WIN32\n\nstruct thread {\n\tvoid *win32_thread;\n\tvoid *(*thrproc)(void *);\n\tvoid *arg;\n};\n\nstruct mutex { void *win32_crit; };\n#define MUTEX_INITIALIZER { NULL }\n\nstruct condvar { void *win32_cond; };\n\n#else /* _WIN32 */\n\n#include <pthread.h>\n\nstruct thread { pthread_t pthread; };\n\nstruct mutex { pthread_mutex_t pthread_mutex; };\n#define MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER }\n\nstruct condvar { pthread_cond_t pthread_cond; };\n\n#endif /* !_WIN32 */\n\nbool thread_create(struct thread *t, void *(*thrproc)(void *), void *arg);\nvoid thread_join(struct thread *t);\nbool mutex_init(struct mutex *m);\nvoid mutex_destroy(struct mutex *m);\nvoid mutex_lock(struct mutex *m);\nvoid mutex_unlock(struct mutex *m);\nbool condvar_init(struct condvar *c);\nvoid condvar_destroy(struct condvar *c);\nvoid condvar_wait(struct condvar *c, struct mutex *m);\nvoid condvar_signal(struct condvar *c);\nvoid condvar_broadcast(struct condvar *c);\n\n#endif /* _WIMLIB_THREADS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/timestamp.h",
    "content": "/*\n * timestamp.h\n *\n * Conversion between Windows NT timestamps and UNIX timestamps.\n */\n\n#ifndef _WIMLIB_TIMESTAMP_H\n#define _WIMLIB_TIMESTAMP_H\n\n#ifdef HAVE_SYS_TIMES_H\n#include <sys/time.h>\n#endif\n#include <time.h>\n\n#include \"wimlib/types.h\"\n\nstruct wimlib_timespec;\n\ntime_t\nwim_timestamp_to_time_t(u64 timestamp);\n\nvoid\nwim_timestamp_to_wimlib_timespec(u64 timestamp, struct wimlib_timespec *wts,\n\t\t\t\t s32 *high_part_ret);\n\nstruct timeval\nwim_timestamp_to_timeval(u64 timestamp);\n\nstruct timespec\nwim_timestamp_to_timespec(u64 timestamp);\n\nu64\ntime_t_to_wim_timestamp(time_t t);\n\nu64\ntimeval_to_wim_timestamp(const struct timeval *tv);\n\nu64\ntimespec_to_wim_timestamp(const struct timespec *ts);\n\nu64\nnow_as_wim_timestamp(void);\n\nvoid\nwim_timestamp_to_str(u64 timestamp, tchar *buf, size_t len);\n\n#endif /* _WIMLIB_TIMESTAMP_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/types.h",
    "content": "#ifndef _WIMLIB_TYPES_H\n#define _WIMLIB_TYPES_H\n\n#include <inttypes.h>\n#include <stdbool.h>\n#include <stddef.h>\n\n#include \"wimlib_tchar.h\"\n#include \"wimlib/compiler.h\"\n\n#ifndef _NTFS_TYPES_H\n/* Unsigned integer types of exact size in bits */\ntypedef uint8_t  u8;\ntypedef uint16_t u16;\ntypedef uint32_t u32;\ntypedef uint64_t u64;\n\n/* Signed integer types of exact size in bits */\ntypedef int8_t  s8;\ntypedef int16_t s16;\ntypedef int32_t s32;\ntypedef int64_t s64;\n\n/* Unsigned little endian types of exact size */\ntypedef uint16_t _bitwise_attr le16;\ntypedef uint32_t _bitwise_attr le32;\ntypedef uint64_t _bitwise_attr le64;\n\n/* Unsigned big endian types of exact size */\ntypedef uint16_t _bitwise_attr be16;\ntypedef uint32_t _bitwise_attr be32;\ntypedef uint64_t _bitwise_attr be64;\n#endif\n\n/* A pointer to 'utf16lechar' indicates a UTF-16LE encoded string */\ntypedef le16 utf16lechar;\n\n#ifndef WIMLIB_WIMSTRUCT_DECLARED\ntypedef struct WIMStruct WIMStruct;\n#  define WIMLIB_WIMSTRUCT_DECLARED\n#endif\n\n/*\n * Type of a machine word.  'unsigned long' would be logical, but that is only\n * 32 bits on x86_64 Windows.  The same applies to 'uint_fast32_t'.  So the best\n * we can do without a bunch of #ifdefs appears to be 'size_t'.\n */\ntypedef size_t machine_word_t;\n\n#define WORDBYTES\tsizeof(machine_word_t)\n#define WORDBITS\t(8 * WORDBYTES)\n\n#endif /* _WIMLIB_TYPES_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/unaligned.h",
    "content": "/*\n * unaligned.h - inline functions for unaligned memory accesses\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifndef _WIMLIB_UNALIGNED_H\n#define _WIMLIB_UNALIGNED_H\n\n#include <string.h>\n\n#include \"wimlib/compiler.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/types.h\"\n\n#define DEFINE_UNALIGNED_TYPE(type)\t\t\t\t\\\nstatic forceinline type\t\t\t\t\t\t\\\nload_##type##_unaligned(const void *p)\t\t\t\t\\\n{\t\t\t\t\t\t\t\t\\\n\ttype v;\t\t\t\t\t\t\t\\\n\tmemcpy(&v, p, sizeof(v));\t\t\t\t\\\n\treturn v;\t\t\t\t\t\t\\\n}\t\t\t\t\t\t\t\t\\\n\t\t\t\t\t\t\t\t\\\nstatic forceinline void\t\t\t\t\t\t\\\nstore_##type##_unaligned(type v, void *p)\t\t\t\\\n{\t\t\t\t\t\t\t\t\\\n\tmemcpy(p, &v, sizeof(v));\t\t\t\t\\\n}\n\nDEFINE_UNALIGNED_TYPE(u16);\nDEFINE_UNALIGNED_TYPE(u32);\nDEFINE_UNALIGNED_TYPE(u64);\nDEFINE_UNALIGNED_TYPE(le16);\nDEFINE_UNALIGNED_TYPE(le32);\nDEFINE_UNALIGNED_TYPE(le64);\nDEFINE_UNALIGNED_TYPE(be16);\nDEFINE_UNALIGNED_TYPE(be32);\nDEFINE_UNALIGNED_TYPE(be64);\nDEFINE_UNALIGNED_TYPE(size_t);\nDEFINE_UNALIGNED_TYPE(machine_word_t);\n\n#define load_word_unaligned\tload_machine_word_t_unaligned\n#define store_word_unaligned\tstore_machine_word_t_unaligned\n\nstatic forceinline u16\nget_unaligned_le16(const u8 *p)\n{\n\tif (UNALIGNED_ACCESS_IS_FAST)\n\t\treturn le16_to_cpu(load_le16_unaligned(p));\n\telse\n\t\treturn ((u16)p[1] << 8) | p[0];\n}\n\nstatic forceinline u32\nget_unaligned_le32(const u8 *p)\n{\n\tif (UNALIGNED_ACCESS_IS_FAST)\n\t\treturn le32_to_cpu(load_le32_unaligned(p));\n\telse\n\t\treturn ((u32)p[3] << 24) | ((u32)p[2] << 16) |\n\t\t\t((u32)p[1] << 8) | p[0];\n}\n\nstatic forceinline u32\nget_unaligned_be32(const u8 *p)\n{\n\tif (UNALIGNED_ACCESS_IS_FAST)\n\t\treturn be32_to_cpu(load_be32_unaligned(p));\n\telse\n\t\treturn ((u32)p[0] << 24) | ((u32)p[1] << 16) |\n\t\t\t((u32)p[2] << 8) | p[3];\n}\n\nstatic forceinline void\nput_unaligned_le16(u16 v, u8 *p)\n{\n\tif (UNALIGNED_ACCESS_IS_FAST) {\n\t\tstore_le16_unaligned(cpu_to_le16(v), p);\n\t} else {\n\t\tp[0] = (u8)(v >> 0);\n\t\tp[1] = (u8)(v >> 8);\n\t}\n}\n\nstatic forceinline void\nput_unaligned_le32(u32 v, u8 *p)\n{\n\tif (UNALIGNED_ACCESS_IS_FAST) {\n\t\tstore_le32_unaligned(cpu_to_le32(v), p);\n\t} else {\n\t\tp[0] = (u8)(v >> 0);\n\t\tp[1] = (u8)(v >> 8);\n\t\tp[2] = (u8)(v >> 16);\n\t\tp[3] = (u8)(v >> 24);\n\t}\n}\n\nstatic forceinline void\nput_unaligned_be32(u32 v, u8 *p)\n{\n\tif (UNALIGNED_ACCESS_IS_FAST) {\n\t\tstore_be32_unaligned(cpu_to_be32(v), p);\n\t} else {\n\t\tp[0] = (u8)(v >> 24);\n\t\tp[1] = (u8)(v >> 16);\n\t\tp[2] = (u8)(v >> 8);\n\t\tp[3] = (u8)(v >> 0);\n\t}\n}\n\n#endif /* _WIMLIB_UNALIGNED_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/unix_data.h",
    "content": "#ifndef _WIMLIB_UNIX_DATA_H\n#define _WIMLIB_UNIX_DATA_H\n\n#include \"wimlib/types.h\"\n\nstruct wimlib_unix_data {\n\tu32 uid;\n\tu32 gid;\n\tu32 mode;\n\tu32 rdev;\n};\n\nstruct wim_inode;\n\nbool\ninode_has_unix_data(const struct wim_inode *inode);\n\nbool\ninode_get_unix_data(const struct wim_inode *inode,\n\t\t    struct wimlib_unix_data *unix_data);\n\n#define UNIX_DATA_UID\t0x1\n#define UNIX_DATA_GID\t0x2\n#define UNIX_DATA_MODE\t0x4\n#define UNIX_DATA_RDEV\t0x8\n\n#define UNIX_DATA_ALL\t0xF\n\nbool\ninode_set_unix_data(struct wim_inode *inode,\n\t\t    struct wimlib_unix_data *unix_data, int which);\n\n#endif /* _WIMLIB_UNIX_DATA_H  */\n"
  },
  {
    "path": "src/wimlib/wimlib/util.h",
    "content": "/*\n * util.h - utility functions and macros\n */\n#ifndef _WIMLIB_UTIL_H\n#define _WIMLIB_UTIL_H\n\n#include \"wimlib/compiler.h\"\n#include \"wimlib/types.h\"\n\n/****************\n * General macros\n *****************/\n\n/* Cast a pointer to a struct member to a pointer to the containing struct.  */\n#define container_of(ptr, type, member) \\\n\t((type *)((char *)(ptr) - offsetof(type, member)))\n\n/* Calculate 'n / d', but round up instead of down.  */\n#define DIV_ROUND_UP(n, d)\t(((n) + (d) - 1) / (d))\n\n/* Calculate 'n % d', but return 'd' if the result would be 0.  */\n#define MODULO_NONZERO(n, d)\t(((n) % (d)) ? ((n) % (d)) : (d))\n\n/* Get the number of elements of an array type.  */\n#define ARRAY_LEN(array)\t(sizeof(array) / sizeof((array)[0]))\n\n/* Round 'v' up to the next 'alignment'-byte aligned boundary.  'alignment' must\n * be a power of 2.  */\n#undef ALIGN\t/* NetBSD <sys/param.h> defines this already */\n#define ALIGN(v, alignment)\t(((v) + ((alignment) - 1)) & ~((alignment) - 1))\n\n/* Maximum number of bytes that can be allocated on the stack.\n *\n * Note: this isn't a hard bound on the stack space used, since this is just for\n * individual arrays.  The full call stack could use more than this.  */\n#define STACK_MAX 32768\n\n/* Default size of file I/O buffer.  Currently assumed to be <= STACK_MAX.  */\n#define BUFFER_SIZE 32768\n\n/*******************\n * Memory allocation\n *******************/\n\nvoid *\nwimlib_malloc(size_t size);\n\nvoid\nwimlib_free_memory(void *p);\n\nvoid *\nwimlib_realloc(void *ptr, size_t size);\n\nvoid *\nwimlib_calloc(size_t nmemb, size_t size);\n\nchar *\nwimlib_strdup(const char *str);\n\n#ifdef _WIN32\nwchar_t *\nwimlib_wcsdup(const wchar_t *str);\n#endif\n\nvoid *\nwimlib_aligned_malloc(size_t size, size_t alignment);\n\nvoid\nwimlib_aligned_free(void *ptr);\n\nvoid *\nmemdup(const void *mem, size_t size);\n\n#define MALLOC\t\twimlib_malloc\n#define FREE\t\twimlib_free_memory\n#define REALLOC\t\twimlib_realloc\n#define CALLOC\t\twimlib_calloc\n#define STRDUP\t\twimlib_strdup\n#define WCSDUP\t\twimlib_wcsdup\n#define ALIGNED_MALLOC\twimlib_aligned_malloc\n#define ALIGNED_FREE\twimlib_aligned_free\n\n/*******************\n * String utilities\n *******************/\n\n#ifndef HAVE_MEMPCPY\nvoid *\nmempcpy(void *dst, const void *src, size_t n);\n#define wmempcpy(d, s, n) mempcpy(d, s, (n) * sizeof(wchar_t))\n#endif\n\n/**************************\n * Random number generation\n **************************/\n\nvoid\nget_random_bytes(void *p, size_t n);\n\nvoid\nget_random_alnum_chars(tchar *p, size_t n);\n\n/************************\n * Hashing and comparison\n ************************/\n\nstatic inline bool\nis_power_of_2(unsigned long n)\n{\n\treturn (n != 0 && (n & (n - 1)) == 0);\n}\n\nstatic inline u64\nhash_u64(u64 n)\n{\n\treturn n * 0x9e37fffffffc0001ULL;\n}\n\nstatic inline int\ncmp_u32(u32 n1, u32 n2)\n{\n\tif (n1 < n2)\n\t\treturn -1;\n\tif (n1 > n2)\n\t\treturn 1;\n\treturn 0;\n}\n\nstatic inline int\ncmp_u64(u64 n1, u64 n2)\n{\n\tif (n1 < n2)\n\t\treturn -1;\n\tif (n1 > n2)\n\t\treturn 1;\n\treturn 0;\n}\n\n/************************\n * System information\n ************************/\n\nunsigned\nget_available_cpus(void);\n\nu64\nget_available_memory(void);\n\n#endif /* _WIMLIB_UTIL_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/wim.h",
    "content": "/*\n * wim.h - WIMStruct definition and helper functions\n */\n\n#ifndef _WIMLIB_WIM_H\n#define _WIMLIB_WIM_H\n\n#include \"wimlib.h\"\n#include \"wimlib/file_io.h\"\n#include \"wimlib/header.h\"\n#include \"wimlib/list.h\"\n\nstruct wim_image_metadata;\nstruct wim_xml_info;\nstruct blob_table;\n\n/*\n * WIMStruct - represents a WIM, or a part of a non-standalone WIM\n *\n * Note 1: there are three ways in which a WIMStruct can be created:\n *\n *\t1. open an on-disk WIM file\n *\t2. start to extract a pipable WIM from a file descriptor\n *\t3. create a new WIMStruct directly\n *\n * For (1) and (2), the WIMStruct has a backing file; for (3) it does not.  For\n * (1), the backing file is a real \"on-disk\" file from the filesystem, whereas\n * for (2) the backing file is a file descriptor which may be a pipe.\n *\n * Note 2: although this is the top-level data structure in wimlib, there do\n * exist cases in which a WIMStruct is not standalone:\n *\t- blobs have been referenced from another WIMStruct\n *\t- an image has been imported into this WIMStruct from another\n *\t  (as this references the metadata rather than copies it)\n *\n * Note 3: It is unsafe for multiple threads to operate on the same WIMStruct at\n * the same time.  This extends to references to other WIMStructs as noted\n * above.  But besides this, it is safe to operate on *different* WIMStructs in\n * different threads concurrently.\n */\nstruct WIMStruct {\n\n\t/* Information from the header of the WIM file.\n\t *\n\t * This is also maintained for a WIMStruct not backed by a file, but in\n\t * that case the 'reshdr' fields are left zeroed.  */\n\tstruct wim_header hdr;\n\n\t/* If the library is currently writing this WIMStruct out to a file,\n\t * then this is the header being created for that file.  */\n\tstruct wim_header out_hdr;\n\n\t/* Array of image metadata, one for each image in the WIM (array length\n\t * hdr.image_count).  Or, this will be NULL if this WIM does not contain\n\t * metadata, which implies that this WIMStruct either represents part of\n\t * a non-standalone WIM, or represents a standalone WIM that, oddly\n\t * enough, actually contains 0 images.  */\n\tstruct wim_image_metadata **image_metadata;\n\n\t/* Information from the XML data of the WIM file.  This information is\n\t * also maintained for a WIMStruct not backed by a file.  */\n\tstruct wim_xml_info *xml_info;\n\n\t/* The blob table for this WIMStruct.  If this WIMStruct has a backing\n\t * file, then this table will index the blobs contained in that file.\n\t * In addition, this table may index blobs that were added by updates or\n\t * referenced from other WIMStructs.  */\n\tstruct blob_table *blob_table;\n\n\t/* The number of references to this WIMStruct.  This is equal to the\n\t * number of resource descriptors that reference this WIMStruct, plus 1\n\t * if wimlib_free() still needs to be called.  */\n\tssize_t refcnt;\n\n\t/*\n\t * The 1-based index of the currently selected image in this WIMStruct,\n\t * or WIMLIB_NO_IMAGE if no image is currently selected.\n\t *\n\t * The metadata for the current image is image_metadata[current_image -\n\t * 1].  Since we load image metadata lazily, only the metadata for the\n\t * current image is guaranteed to actually be present in memory.\n\t */\n\tint current_image;\n\n\t/* The absolute path to the on-disk file backing this WIMStruct, or NULL\n\t * if this WIMStruct is not backed by an on-disk file.  */\n\ttchar *filename;\n\n\t/* If this WIMStruct has a backing file, then this is a file descriptor\n\t * open to that file with read access.  Otherwise, this field is invalid\n\t * (!filedes_valid(&in_fd)).  */\n\tstruct filedes in_fd;\n\n\t/* If the library is currently writing this WIMStruct out to a file,\n\t * then this is a file descriptor open to that file with write access.\n\t * Otherwise, this field is invalid (!filedes_valid(&out_fd)).  */\n\tstruct filedes out_fd;\n\n\t/* The size of the backing file, or 0 if unknown */\n\tu64 file_size;\n\n\t/*\n\t * This is the cached decompressor for this WIM file, or NULL if no\n\t * decompressor is cached yet.  Normally, all the compressed data in a\n\t * WIM file has the same compression type and chunk size, so the same\n\t * decompressor can be used for all data --- and that decompressor will\n\t * be cached here.  However, if we do encounter any data with a\n\t * different compression type or chunk size (this is possible in solid\n\t * resources), then this cached decompressor will be replaced with a new\n\t * one.\n\t */\n\tstruct wimlib_decompressor *decompressor;\n\tu8 decompressor_ctype;\n\tu32 decompressor_max_block_size;\n\n\t/* Temporary field; use sparingly  */\n\tvoid *private;\n\n\t/* 1 if any images have been deleted from this WIMStruct, otherwise 0 */\n\tu8 image_deletion_occurred : 1;\n\n\t/* 1 if the WIM file has been locked for appending, otherwise 0  */\n\tu8 locked_for_append : 1;\n\n\t/* 1 if the WIM file is currently being compacted by wimlib_overwrite()\n\t * with WIMLIB_WRITE_FLAG_UNSAFE_COMPACT  */\n\tu8 being_compacted : 1;\n\n\t/* If this WIM is backed by a file, then this is the compression type\n\t * for non-solid resources in that file.  */\n\tu8 compression_type;\n\n\t/* Overridden compression type for wimlib_overwrite() or wimlib_write().\n\t * Can be changed by wimlib_set_output_compression_type(); otherwise is\n\t * the same as compression_type.  */\n\tu8 out_compression_type;\n\n\t/* Compression type for writing solid resources; can be set with\n\t * wimlib_set_output_pack_compression_type().  */\n\tu8 out_solid_compression_type;\n\n\t/* If this WIM is backed by a file, then this is the compression chunk\n\t * size for non-solid resources in that file.  */\n\tu32 chunk_size;\n\n\t/* Overridden chunk size for wimlib_overwrite() or wimlib_write().  Can\n\t * be changed by wimlib_set_output_chunk_size(); otherwise is the same\n\t * as chunk_size.  */\n\tu32 out_chunk_size;\n\n\t/* Chunk size for writing solid resources; can be set with\n\t * wimlib_set_output_pack_chunk_size().  */\n\tu32 out_solid_chunk_size;\n\n\t/* Currently registered progress function for this WIMStruct, or NULL if\n\t * no progress function is currently registered for this WIMStruct.  */\n\twimlib_progress_func_t progfunc;\n\tvoid *progctx;\n};\n\n/*\n * Return true if and only if the WIM contains image metadata (actual directory\n * trees, not just a collection of blobs and their checksums).\n *\n * See the description of the 'image_metadata' field.  Note that we return true\n * when the image count is 0 because it could be a WIM with 0 images.  It's only\n * when the WIM does not contain the metadata described by its image count that\n * we return false.\n */\nstatic inline bool wim_has_metadata(const WIMStruct *wim)\n{\n\treturn (wim->image_metadata != NULL || wim->hdr.image_count == 0);\n}\n\n/* Return true if and only if the WIM has an integrity table.\n *\n * If the WIM is not backed by a file, then this always returns false.  */\nstatic inline bool wim_has_integrity_table(const WIMStruct *wim)\n{\n\treturn (wim->hdr.integrity_table_reshdr.offset_in_wim != 0);\n}\n\n/* Return true if and only if the WIM is in pipable format.\n *\n * If the WIM is not backed by a file, then this always returns false.  */\nstatic inline bool wim_is_pipable(const WIMStruct *wim)\n{\n\treturn (wim->hdr.magic == PWM_MAGIC);\n}\n\nvoid\nwim_decrement_refcnt(WIMStruct *wim);\n\nbool\nwim_has_solid_resources(const WIMStruct *wim);\n\nint\nread_wim_header(WIMStruct *wim, struct wim_header *hdr);\n\nint\nwrite_wim_header(const struct wim_header *hdr, struct filedes *out_fd,\n\t\t off_t offset);\n\nint\nwrite_wim_header_flags(u32 hdr_flags, struct filedes *out_fd);\n\nint\nselect_wim_image(WIMStruct *wim, int image);\n\nvoid\ndeselect_current_wim_image(WIMStruct *wim);\n\nint\nfor_image(WIMStruct *wim, int image, int (*visitor)(WIMStruct *));\n\nint\nwim_checksum_unhashed_blobs(WIMStruct *wim);\n\nint\ndelete_wim_image(WIMStruct *wim, int image);\n\n/* Internal open flags (pass to open_wim_as_WIMStruct(), not wimlib_open_wim())\n */\n#define WIMLIB_OPEN_FLAG_FROM_PIPE\t0x80000000\n\nint\nopen_wim_as_WIMStruct(const void *wim_filename_or_fd, int open_flags,\n\t\t      WIMStruct **wim_ret,\n\t\t      wimlib_progress_func_t progfunc, void *progctx);\n\nint\ncan_modify_wim(WIMStruct *wim);\n\n#endif /* _WIMLIB_WIM_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/wimboot.h",
    "content": "#ifndef _WIMBOOT_H_\n#define _WIMBOOT_H_\n\n#include \"wimlib/header.h\"\n#include \"wimlib/sha1.h\"\n#include \"wimlib/types.h\"\n#include \"wimlib/win32_common.h\"\n\nstruct blob_descriptor;\n\nint\nwimboot_alloc_data_source_id(const wchar_t *wim_path,\n\t\t\t     const u8 guid[GUID_SIZE], int image,\n\t\t\t     const wchar_t *target, u64 *data_source_id_ret,\n\t\t\t     bool *wof_running_ret);\n\nbool\nwimboot_set_pointer(HANDLE h,\n\t\t    const struct blob_descriptor *blob,\n\t\t    u64 data_source_id,\n\t\t    const u8 blob_table_hash[SHA1_HASH_SIZE],\n\t\t    bool wof_running);\n\n\n#endif /* _WIMBOOT_H_ */\n"
  },
  {
    "path": "src/wimlib/wimlib/win32.h",
    "content": "/*\n * win32.h - Windows-specific declarations needed by non-Windows-specific files.\n */\n\n#ifndef _WIMLIB_WIN32_H\n#define _WIMLIB_WIN32_H\n\n#ifdef _WIN32\n\n#include <unistd.h>\n#include \"wimlib/types.h\"\n\nstruct blob_descriptor;\nstruct consume_chunk_callback;\nstruct windows_file;\n\nstruct windows_file *\nclone_windows_file(const struct windows_file *file);\n\nvoid\nfree_windows_file(struct windows_file *file);\n\nint\ncmp_windows_files(const struct windows_file *file1,\n\t\t  const struct windows_file *file2);\n\nint\nread_windows_file_prefix(const struct blob_descriptor *blob, u64 size,\n\t\t\t const struct consume_chunk_callback *cb,\n\t\t\t bool recover_data);\n\nint\nwin32_global_init(int init_flags);\n\nvoid\nwin32_global_cleanup(void);\n\nint\nfsync(int fd);\n\ntchar *\nrealpath(const tchar *path, tchar *resolved_path);\n\nint\nwin32_rename_replacement(const tchar *oldpath, const tchar *newpath);\n\nint\nwin32_truncate_replacement(const tchar *path, off_t size);\n\nint\nwin32_strerror_r_replacement(int errnum, tchar *buf, size_t buflen);\n\nFILE *\nwin32_open_logfile(const wchar_t *path);\n\nssize_t\nwin32_read(int fd, void *buf, size_t count);\n\nssize_t\nwin32_write(int fd, const void *buf, size_t count);\n\nssize_t\nwin32_pread(int fd, void *buf, size_t count, off_t offset);\n\nssize_t\nwin32_pwrite(int fd, const void *buf, size_t count, off_t offset);\n\n#endif /* _WIN32 */\n\n#endif /* _WIMLIB_WIN32_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/win32_common.h",
    "content": "/*\n * win32_common.h - common header for Windows-specific files.  This always\n * should be included first.\n */\n\n#ifndef _WIMLIB_WIN32_COMMON_H\n#define _WIMLIB_WIN32_COMMON_H\n\n#define UMDF_USING_NTSTATUS\n#include <ntstatus.h>\n#include <windows.h>\n#include <winternl.h>\n#include <unistd.h>\n\n#ifdef ERROR\n#  undef ERROR\n#endif\n#include \"wimlib/win32.h\"\n\n/* ntdll definitions */\n\n#ifdef _MSC_VER\n#define FILE_OPENED 0x00000001\n\n#ifndef FILE_SHARE_VALID_FLAGS\n#define FILE_SHARE_VALID_FLAGS 0x00000007\n#endif\n\ntypedef struct _FILE_NAME_INFORMATION {\n    ULONG FileNameLength;\n    WCHAR FileName[1];\n} FILE_NAME_INFORMATION;\n\ntypedef struct _FILE_BASIC_INFORMATION {\n    LARGE_INTEGER CreationTime;\n    LARGE_INTEGER LastAccessTime;\n    LARGE_INTEGER LastWriteTime;\n    LARGE_INTEGER ChangeTime;\n    ULONG         FileAttributes;\n} FILE_BASIC_INFORMATION;\n\ntypedef struct _FILE_DISPOSITION_INFORMATION {\n    BOOLEAN DoDeleteFile;\n} FILE_DISPOSITION_INFORMATION;\n\ntypedef struct _FILE_LINK_INFORMATION {\n    union {\n        BOOLEAN ReplaceIfExists;\n        ULONG Flags;\n    } DUMMYUNIONNAME;\n    HANDLE RootDirectory;\n    ULONG FileNameLength;\n    WCHAR FileName[1];\n} FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;\n\ntypedef struct _FILE_ALLOCATION_INFORMATION {\n    LARGE_INTEGER AllocationSize;\n} FILE_ALLOCATION_INFORMATION;\n\ntypedef struct _FILE_END_OF_FILE_INFORMATION {\n    LARGE_INTEGER EndOfFile;\n} FILE_END_OF_FILE_INFORMATION;\n\ntypedef struct _FILE_FULL_EA_INFORMATION {\n    ULONG  NextEntryOffset;\n    UCHAR  Flags;\n    UCHAR  EaNameLength;\n    USHORT EaValueLength;\n    CHAR   EaName[1];\n} FILE_FULL_EA_INFORMATION;\n\ntypedef struct _FILE_INTERNAL_INFORMATION {\n    LARGE_INTEGER IndexNumber;\n} FILE_INTERNAL_INFORMATION;\n\ntypedef struct _FILE_NAMES_INFORMATION {\n    ULONG NextEntryOffset;\n    ULONG FileIndex;\n    ULONG FileNameLength;\n    WCHAR FileName[1];\n} FILE_NAMES_INFORMATION;\n\ntypedef struct _FILE_FS_VOLUME_INFORMATION {\n    LARGE_INTEGER VolumeCreationTime;\n    ULONG         VolumeSerialNumber;\n    ULONG         VolumeLabelLength;\n    BOOLEAN       SupportsObjects;\n    WCHAR         VolumeLabel[1];\n} FILE_FS_VOLUME_INFORMATION;\n\ntypedef struct _FILE_STANDARD_INFORMATION {\n    LARGE_INTEGER AllocationSize;\n    LARGE_INTEGER EndOfFile;\n    ULONG NumberOfLinks;\n    BOOLEAN DeletePending;\n    BOOLEAN Directory;\n} FILE_STANDARD_INFORMATION;\n\ntypedef struct _FILE_EA_INFORMATION {\n    ULONG EaSize;\n} FILE_EA_INFORMATION;\n\ntypedef struct _FILE_ACCESS_INFORMATION {\n    ACCESS_MASK AccessFlags;\n} FILE_ACCESS_INFORMATION;\n\ntypedef struct _FILE_POSITION_INFORMATION {\n    LARGE_INTEGER CurrentByteOffset;\n} FILE_POSITION_INFORMATION;\n\ntypedef struct _FILE_MODE_INFORMATION {\n    ULONG Mode;\n} FILE_MODE_INFORMATION;\n\ntypedef struct _FILE_ALIGNMENT_INFORMATION {\n    ULONG AlignmentRequirement;\n} FILE_ALIGNMENT_INFORMATION;\n\ntypedef struct _FILE_STREAM_INFORMATION {\n    ULONG         NextEntryOffset;\n    ULONG         StreamNameLength;\n    LARGE_INTEGER StreamSize;\n    LARGE_INTEGER StreamAllocationSize;\n    WCHAR         StreamName[1];\n} FILE_STREAM_INFORMATION;\n\ntypedef struct _FILE_ALL_INFORMATION {\n    FILE_BASIC_INFORMATION BasicInformation;\n    FILE_STANDARD_INFORMATION StandardInformation;\n    FILE_INTERNAL_INFORMATION InternalInformation;\n    FILE_EA_INFORMATION EaInformation;\n    FILE_ACCESS_INFORMATION AccessInformation;\n    FILE_POSITION_INFORMATION PositionInformation;\n    FILE_MODE_INFORMATION ModeInformation;\n    FILE_ALIGNMENT_INFORMATION AlignmentInformation;\n    FILE_NAME_INFORMATION NameInformation;\n} FILE_ALL_INFORMATION;\n\ntypedef struct _FILE_FS_ATTRIBUTE_INFORMATION {\n    ULONG FileSystemAttributes;\n    ULONG MaximumComponentNameLength;\n    ULONG FileSystemNameLength;\n    WCHAR FileSystemName[1];\n} FILE_FS_ATTRIBUTE_INFORMATION;\n\ntypedef enum {\n    FileDirectoryInformationAlt = 1,\n    FileFullDirectoryInformation = 2,\n    FileBothDirectoryInformation = 3,\n    FileBasicInformation = 4,\n    FileStandardInformation = 5,\n    FileInternalInformation = 6,\n    FileEaInformation = 7,\n    FileAccessInformation = 8,\n    FileNameInformation = 9,\n    FileRenameInformation = 10,\n    FileLinkInformation = 11,\n    FileNamesInformation = 12,\n    FileDispositionInformation = 13,\n    FilePositionInformation = 14,\n    FileFullEaInformation = 15,\n    FileModeInformation = 16,\n    FileAlignmentInformation = 17,\n    FileAllInformation = 18,\n    FileAllocationInformation = 19,\n    FileEndOfFileInformation = 20,\n    FileAlternateNameInformation = 21,\n    FileStreamInformation = 22,\n    FilePipeInformation = 23,\n    FilePipeLocalInformation = 24,\n    FilePipeRemoteInformation = 25,\n    FileMailslotQueryInformation = 26,\n    FileMailslotSetInformation = 27,\n    FileCompressionInformation = 28,\n    FileObjectIdInformation = 29,\n    FileCompletionInformation = 30,\n    FileMoveClusterInformation = 31,\n    FileQuotaInformation = 32,\n    FileReparsePointInformation = 33,\n    FileNetworkOpenInformation = 34,\n    FileAttributeTagInformation = 35,\n    FileTrackingInformation = 36,\n    FileIdBothDirectoryInformation = 37,\n    FileIdFullDirectoryInformation = 38,\n    FileValidDataLengthInformation = 39,\n    FileShortNameInformation = 40,\n    FileIoCompletionNotificationInformation = 41,\n    FileIoStatusBlockRangeInformation = 42,\n    FileIoPriorityHintInformation = 43,\n    FileSfioReserveInformation = 44,\n    FileSfioVolumeInformation = 45,\n    FileHardLinkInformation = 46,\n    FileProcessIdsUsingFileInformation = 47,\n    FileNormalizedNameInformation = 48,\n    FileNetworkPhysicalNameInformation = 49,\n    FileIdGlobalTxDirectoryInformation = 50,\n    FileIsRemoteDeviceInformation = 51,\n    FileUnusedInformation = 52,\n    FileNumaNodeInformation = 53,\n    FileStandardLinkInformation = 54,\n    FileRemoteProtocolInformation = 55,\n    FileRenameInformationBypassAccessCheck = 56,\n    FileLinkInformationBypassAccessCheck = 57,\n    FileVolumeNameInformation = 58,\n    FileIdInformation = 59,\n    FileIdExtdDirectoryInformation = 60,\n    FileReplaceCompletionInformation = 61,\n    FileHardLinkFullIdInformation = 62,\n    FileIdExtdBothDirectoryInformation = 63,\n    FileDispositionInformationEx = 64,\n    FileRenameInformationEx = 65,\n    FileRenameInformationExBypassAccessCheck = 66,\n    FileDesiredStorageClassInformation = 67,\n    FileStatInformation = 68,\n    FileMemoryPartitionInformation = 69,\n    FileStatLxInformation = 70,\n    FileCaseSensitiveInformation = 71,\n    FileLinkInformationEx = 72,\n    FileLinkInformationExBypassAccessCheck = 73,\n    FileStorageReserveIdInformation = 74,\n    FileCaseSensitiveInformationForceAccessCheck = 75,\n    FileKnownFolderInformation = 76,\n    FileStatBasicInformation = 77,\n    FileId64ExtdDirectoryInformation = 78,\n    FileId64ExtdBothDirectoryInformation = 79,\n    FileIdAllExtdDirectoryInformation = 80,\n    FileIdAllExtdBothDirectoryInformation = 81,\n    FileStreamReservationInformation,\n    FileMupProviderInfo,\n    FileMaximumInformation\n} FILE_INFORMATION_CLASS_ALT;\n\ntypedef enum _FSINFOCLASS {\n    FileFsVolumeInformation = 1,\n    FileFsLabelInformation,\n    FileFsSizeInformation,\n    FileFsDeviceInformation,\n    FileFsAttributeInformation,\n    FileFsControlInformation,\n    FileFsFullSizeInformation,\n    FileFsObjectIdInformation,\n    FileFsDriverPathInformation,\n    FileFsVolumeFlagsInformation,\n    FileFsMaximumInformation\n} FS_INFORMATION_CLASS;\n#endif\n\ntypedef struct _RTLP_CURDIR_REF {\n\tLONG RefCount;\n\tHANDLE Handle;\n} RTLP_CURDIR_REF, *PRTLP_CURDIR_REF;\n\ntypedef struct _RTL_RELATIVE_NAME_U {\n\tUNICODE_STRING RelativeName;\n\tHANDLE ContainingDirectory;\n\tPRTLP_CURDIR_REF CurDirRef;\n} RTL_RELATIVE_NAME_U, *PRTL_RELATIVE_NAME_U;\n\n#ifndef FSCTL_SET_PERSISTENT_VOLUME_STATE\n#define FSCTL_SET_PERSISTENT_VOLUME_STATE \\\n\tCTL_CODE(FILE_DEVICE_FILE_SYSTEM, 142, METHOD_BUFFERED, FILE_ANY_ACCESS)\n\n#define PERSISTENT_VOLUME_STATE_SHORT_NAME_CREATION_DISABLED 0x00000001\n\ntypedef struct _FILE_FS_PERSISTENT_VOLUME_INFORMATION {\n\tULONG VolumeFlags;\n\tULONG FlagMask;\n\tULONG Version;\n\tULONG Reserved;\n} FILE_FS_PERSISTENT_VOLUME_INFORMATION, *PFILE_FS_PERSISTENT_VOLUME_INFORMATION;\n#endif /* FSCTL_SET_PERSISTENT_VOLUME_STATE */\n\n/* ntdll functions  */\n\nNTSTATUS\nNTAPI\nNtReadFile(IN HANDLE FileHandle,\n           IN HANDLE Event OPTIONAL,\n           IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,\n           IN PVOID ApcContext OPTIONAL,\n           OUT PIO_STATUS_BLOCK IoStatusBlock,\n           OUT PVOID Buffer,\n           IN ULONG Length,\n           IN PLARGE_INTEGER ByteOffset OPTIONAL,\n           IN PULONG Key OPTIONAL);\n\nNTSTATUS\nNTAPI\nNtWriteFile(IN HANDLE FileHandle,\n            IN HANDLE Event OPTIONAL,\n            IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,\n            IN PVOID ApcContext OPTIONAL,\n            OUT PIO_STATUS_BLOCK IoStatusBlock,\n            IN PVOID Buffer,\n            IN ULONG Length,\n            IN PLARGE_INTEGER ByteOffset OPTIONAL,\n            IN PULONG Key OPTIONAL);\n\nNTSTATUS\nNTAPI\nNtQueryDirectoryFile(IN HANDLE FileHandle,\n                     IN HANDLE EventHandle OPTIONAL,\n                     IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,\n                     IN PVOID ApcContext OPTIONAL,\n                     OUT PIO_STATUS_BLOCK IoStatusBlock,\n                     OUT PVOID FileInformation,\n                     IN ULONG Length,\n                     IN FILE_INFORMATION_CLASS FileInformationClass,\n                     IN BOOLEAN ReturnSingleEntry,\n                     IN PUNICODE_STRING FileName OPTIONAL,\n                     IN BOOLEAN RestartScan);\n\nNTSTATUS\nNTAPI\nNtQueryInformationFile(IN HANDLE FileHandle,\n                       OUT PIO_STATUS_BLOCK IoStatusBlock,\n                       OUT PVOID FileInformation,\n                       IN ULONG Length,\n                       IN FILE_INFORMATION_CLASS FileInformationClass);\n\nNTSTATUS\nNTAPI\nNtQueryVolumeInformationFile(IN HANDLE FileHandle,\n                             OUT PIO_STATUS_BLOCK IoStatusBlock,\n                             OUT PVOID FsInformation,\n                             IN ULONG Length,\n                             IN FS_INFORMATION_CLASS FsInformationClass);\n\nNTSTATUS\nNTAPI\nNtQuerySecurityObject(IN HANDLE Handle,\n                      IN SECURITY_INFORMATION SecurityInformation,\n                      OUT PSECURITY_DESCRIPTOR SecurityDescriptor,\n                      IN ULONG Length,\n                      OUT PULONG ResultLength);\n\nNTSTATUS\nNTAPI\nNtSetSecurityObject(IN HANDLE Handle,\n                    IN SECURITY_INFORMATION SecurityInformation,\n                    IN PSECURITY_DESCRIPTOR SecurityDescriptor);\n\nNTSTATUS\nNTAPI\nNtSetInformationFile(IN HANDLE FileHandle,\n                     OUT PIO_STATUS_BLOCK IoStatusBlock,\n                     IN PVOID FileInformation,\n                     IN ULONG Length,\n                     IN FILE_INFORMATION_CLASS FileInformationClass);\n\nNTSTATUS\nNTAPI\nNtOpenSymbolicLinkObject(PHANDLE LinkHandle,\n\t\t\t ACCESS_MASK DesiredAccess,\n\t\t\t POBJECT_ATTRIBUTES ObjectAttributes);\n\nNTSTATUS\nNTAPI\nNtQueryEaFile(IN HANDLE FileHandle,\n\t      OUT PIO_STATUS_BLOCK IoStatusBlock,\n\t      OUT PVOID Buffer,\n\t      IN ULONG Length,\n\t      IN BOOLEAN ReturnSingleEntry,\n\t      IN PVOID EaList OPTIONAL,\n\t      IN ULONG EaListLength,\n\t      IN PULONG EaIndex OPTIONAL,\n\t      IN BOOLEAN RestartScan);\n\nNTSTATUS\nNTAPI\nNtSetEaFile(IN HANDLE FileHandle,\n\t    OUT PIO_STATUS_BLOCK IoStatusBlock,\n\t    OUT PVOID Buffer,\n\t    IN ULONG Length);\n\nNTSTATUS\nNTAPI\nNtFsControlFile(IN HANDLE FileHandle,\n\t    IN HANDLE Event,\n\t    IN PIO_APC_ROUTINE  ApcRoutine,\n\t    IN PVOID ApcContext,\n\t    OUT PIO_STATUS_BLOCK IoStatusBlock,\n\t    IN ULONG FsControlCode,\n\t    IN PVOID InputBuffer,\n\t    IN ULONG InputBufferLength,\n\t    OUT PVOID OutputBuffer,\n\t    IN ULONG OutputBufferLength);\n\n/* Dynamically loaded ntdll functions */\n\nextern NTSTATUS (WINAPI *func_RtlDosPathNameToNtPathName_U_WithStatus)\n\t\t(IN PCWSTR DosName,\n\t\t OUT PUNICODE_STRING NtName,\n\t\t OUT PCWSTR *PartName,\n\t\t OUT PRTL_RELATIVE_NAME_U RelativeName);\n\nextern NTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder)\n\t\t\t(PCUNICODE_STRING VolumeRootPath);\n\n/* Other utility functions */\n\nint\nwin32_path_to_nt_path(const wchar_t *win32_path, UNICODE_STRING *nt_path);\n\nint\nwin32_get_drive_path(const wchar_t *file_path, wchar_t drive_path[7]);\n\nbool\nwin32_try_to_attach_wof(const wchar_t *drive);\n\nvoid __attribute__((cold))\nwin32_warning(DWORD err, const wchar_t *format, ...);\n\nvoid __attribute__((cold))\nwin32_error(DWORD err, const wchar_t *format, ...);\n\nvoid __attribute__((cold))\nwinnt_warning(NTSTATUS status, const wchar_t *format, ...);\n\nvoid __attribute__((cold))\nwinnt_error(NTSTATUS status, const wchar_t *format, ...);\n\nNTSTATUS\nwinnt_fsctl(HANDLE h, u32 code, const void *in, u32 in_size,\n\t    void *out, u32 out_size_avail, u32 *actual_out_size_ret);\n\n#endif /* _WIMLIB_WIN32_COMMON_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/win32_vss.h",
    "content": "/*\n * win32_vss.h - Declarations for managing VSS snapshots.  This header should\n * only be included by Windows-specific files.\n */\n\n#ifndef _WIMLIB_WIN32_VSS_H\n#define _WIMLIB_WIN32_VSS_H\n\n#include \"wimlib/win32_common.h\"\n\n/* A reference counter for a VSS snapshot.  This is embedded in another data\n * structure only visible to win32_vss.c.  */\nstruct vss_snapshot {\n\tsize_t refcnt;\n};\n\nvoid\nvss_delete_snapshot(struct vss_snapshot *snapshot);\n\n/* Acquire a reference to the specified VSS snapshot.  */\nstatic inline struct vss_snapshot *\nvss_get_snapshot(struct vss_snapshot *snapshot)\n{\n\tif (snapshot)\n\t\tsnapshot->refcnt++;\n\treturn snapshot;\n}\n\n/* Release a reference to the specified VSS snapshot.  When the last reference\n * is released, the snapshot is deleted.  */\nstatic inline void\nvss_put_snapshot(struct vss_snapshot *snapshot)\n{\n\tif (snapshot && --snapshot->refcnt == 0)\n\t\tvss_delete_snapshot(snapshot);\n}\n\nint\nvss_create_snapshot(const wchar_t *source, UNICODE_STRING *vss_path_ret,\n\t\t    struct vss_snapshot **snapshot_ret);\n\nvoid\nvss_global_cleanup(void);\n\n#endif /* _WIMLIB_WIN32_VSS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/wof.h",
    "content": "/*\n * wof.h\n *\n * Definitions for the Windows Overlay Filesystem filter (WOF) ioctls, as well\n * some definitions for associated undocumented data structures.\n *\n * Copyright 2022 Eric Biggers\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifndef _WOF_H_\n#define _WOF_H_\n\n#include \"wimlib/compiler.h\"\n#include \"wimlib/types.h\"\n\n#ifdef _WIN32\n\n#ifndef _MSC_VER\n/*\n * The Windows Overlay Filesystem filter (WOF, a.k.a. wof.sys) is a filesystem\n * filter driver, available in Windows 8.1 and later, which allows files to be\n * \"externally backed\", meaning that their data is stored in another location,\n * possibly in compressed form.\n *\n * WOF implements a plug-in mechanism by which a specific \"provider\" is\n * responsible for actually externally backing a given file.  The currently\n * known providers are:\n *\n *\t- The WIM provider: allows a file to be externally backed by a\n *\t  compressed resource in a WIM archive\n *\t- The file provider: allows a file to be \"externally backed\" by a named\n *\t  data stream stored with the file itself, where that named data stream\n *\t  has the format of a compressed WIM resource\n *\n * For both of these providers, externally backed files are effectively\n * read-only.  If you try to write to such a file, Windows automatically\n * decompresses it and turns it into a regular, non-externally-backed file.\n *\n * WOF provides various ioctls that control its operation.  For example,\n * FSCTL_SET_EXTERNAL_BACKING sets up a file as externally backed.\n *\n * WOF external backings are implemented using reparse points.  One consequence\n * of this is that WOF external backings can only be set on files that do not\n * already have a reparse point set.  Another consequence of this is that it is\n * possible to create a WOF external backing by manually creating the reparse\n * point, although this requires dealing with undocumented data structures and\n * it only works when the WOF driver is not currently attached to the volume.\n *\n * Note that only the unnamed data stream portion of a file can be externally\n * backed.  Other NTFS streams and metadata are not externally backed.\n */\n\n\n/*----------------------------------------------------------------------------*\n *                          WOF ioctl definitions                             *\n *----------------------------------------------------------------------------*/\n\n#ifndef WOF_CURRENT_VERSION\n/* Identifies a file backing provider and the overlay service version it supports.\n * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_wof_external_info */\ntypedef struct _WOF_EXTERNAL_INFO {\n#define WOF_CURRENT_VERSION 1\n\tDWORD Version;\n\tDWORD Provider;\n} WOF_EXTERNAL_INFO, *PWOF_EXTERNAL_INFO;\n#endif /* WOF_CURRENT_VERSION */\n\n/* WIM provider (\"WIMBoot\") */\n#ifndef WOF_PROVIDER_WIM\n#define WOF_PROVIDER_WIM 1\n/*\n * The identifier and status information for the Windows Image File (WIM)\n * external backing provider.\n * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_wim_provider_external_info\n */\ntypedef struct _WIM_PROVIDER_EXTERNAL_INFO {\n#define WIM_PROVIDER_CURRENT_VERSION 1\n\tULONG         Version;\n\tULONG         Flags;\n\tLARGE_INTEGER DataSourceId;\n#define WIM_PROVIDER_HASH_SIZE 20\n\tUCHAR         ResourceHash[WIM_PROVIDER_HASH_SIZE];\n} WIM_PROVIDER_EXTERNAL_INFO, *PWIM_PROVIDER_EXTERNAL_INFO;\n#endif /* WOF_PROVIDER_WIM */\n\n/* File provider (\"system compression\") */\n#ifndef WOF_PROVIDER_FILE\n#define WOF_PROVIDER_FILE 2\n/* Defines metadata specific to files provided by WOF_PROVIDER_FILE.\n * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_file_provider_external_info_v1 */\ntypedef struct _FILE_PROVIDER_EXTERNAL_INFO_V1 {\n#define FILE_PROVIDER_CURRENT_VERSION 1\n\tDWORD Version;\n#define FILE_PROVIDER_COMPRESSION_XPRESS4K\t0\n#define FILE_PROVIDER_COMPRESSION_LZX\t\t1\n#define FILE_PROVIDER_COMPRESSION_XPRESS8K\t2\n#define FILE_PROVIDER_COMPRESSION_XPRESS16K\t3\n\tDWORD Algorithm;\n\tDWORD Flags;\n} FILE_PROVIDER_EXTERNAL_INFO_V1, *PFILE_PROVIDER_EXTERNAL_INFO_V1;\n#endif /* WOF_PROVIDER_FILE */\n\n/* Sets the backing source for a file.\n * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-set-external-backing */\n#ifndef FSCTL_SET_EXTERNAL_BACKING\n#define FSCTL_SET_EXTERNAL_BACKING \\\n\tCTL_CODE(FILE_DEVICE_FILE_SYSTEM, 195, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)\n#endif\n\n/* Gets the backing information for a file from an external backing provider.\n * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-get-external-backing */\n#ifndef FSCTL_GET_EXTERNAL_BACKING\n#define FSCTL_GET_EXTERNAL_BACKING \\\n\tCTL_CODE(FILE_DEVICE_FILE_SYSTEM, 196, METHOD_BUFFERED, FILE_ANY_ACCESS)\n#endif\n\n#ifndef STATUS_OBJECT_NOT_EXTERNALLY_BACKED\n#define STATUS_OBJECT_NOT_EXTERNALLY_BACKED\t0xC000046D\n#endif\n\n/* Removes the association of a file with an external backing provider.\n * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-delete-external-backing */\n#ifndef FSCTL_DELETE_EXTERNAL_BACKING\n#define FSCTL_DELETE_EXTERNAL_BACKING \\\n\tCTL_CODE(FILE_DEVICE_FILE_SYSTEM, 197, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)\n#endif\n\n/* Begins or continues an enumeration of files on a volume that have a backing source.\n * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-enum-external-backing */\n#ifndef FSCTL_ENUM_EXTERNAL_BACKING\n#define FSCTL_ENUM_EXTERNAL_BACKING \\\n\tCTL_CODE(FILE_DEVICE_FILE_SYSTEM, 198, METHOD_BUFFERED, FILE_ANY_ACCESS)\n#endif\n\n/* Enumerates all the data sources from a backing provider for a specified volume.\n * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-enum-overlay */\n#ifndef FSCTL_ENUM_OVERLAY\n#define FSCTL_ENUM_OVERLAY \\\n\tCTL_CODE(FILE_DEVICE_FILE_SYSTEM, 199, METHOD_NEITHER, FILE_ANY_ACCESS)\n#endif\ntypedef struct _WIM_PROVIDER_OVERLAY_ENTRY {\n\tULONG NextEntryOffset;\n\tLARGE_INTEGER DataSourceId;\n\tGUID WimGuid;\n\tULONG WimFileNameOffset;\n\tULONG WimType;\n\tULONG WimIndex;\n\tULONG Flags;\n} WIM_PROVIDER_OVERLAY_ENTRY, *PWIM_PROVIDER_OVERLAY_ENTRY;\n\n/* Add a new external backing source to a volume's namespace.\n * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-add-overlay */\n#ifndef FSCTL_ADD_OVERLAY\n#define FSCTL_ADD_OVERLAY \\\n\tCTL_CODE(FILE_DEVICE_FILE_SYSTEM, 204, METHOD_BUFFERED, FILE_WRITE_DATA)\n#endif\ntypedef struct _WIM_PROVIDER_ADD_OVERLAY_INPUT {\n#define WIM_BOOT_NOT_OS_WIM\t0\n#define WIM_BOOT_OS_WIM\t\t1\n\tULONG WimType;\n\tULONG WimIndex;\n\tULONG WimFileNameOffset;\n\tULONG WimFileNameLength;\n} WIM_PROVIDER_ADD_OVERLAY_INPUT, *PWIM_PROVIDER_ADD_OVERLAY_INPUT;\n\n/* Removes a backing source from a volume.\n * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-remove-overlay */\n#ifndef FSCTL_REMOVE_OVERLAY\n#define FSCTL_REMOVE_OVERLAY \\\n\tCTL_CODE(FILE_DEVICE_FILE_SYSTEM, 205, METHOD_BUFFERED, FILE_WRITE_DATA)\n#endif\ntypedef struct _WIM_PROVIDER_REMOVE_OVERLAY_INPUT {\n\tLARGE_INTEGER DataSourceId;\n} WIM_PROVIDER_REMOVE_OVERLAY_INPUT, *PWIM_PROVIDER_REMOVE_OVERLAY_INPUT;\n\n/* Updates a new data source identifier for a backing source attached to a volume.\n * Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/fsctl-update-overlay */\n#ifndef FSCTL_UPDATE_OVERLAY\n#define FSCTL_UPDATE_OVERLAY \\\n\tCTL_CODE(FILE_DEVICE_FILE_SYSTEM, 206, METHOD_BUFFERED, FILE_WRITE_DATA)\n#endif\ntypedef struct _WIM_PROVIDER_UPDATE_OVERLAY_INPUT {\n\tLARGE_INTEGER DataSourceId;\n\tULONG         WimFileNameOffset;\n\tULONG         WimFileNameLength;\n} WIM_PROVIDER_UPDATE_OVERLAY_INPUT, *PWIM_PROVIDER_UPDATE_OVERLAY_INPUT;\n\n#endif\n\n/*----------------------------------------------------------------------------*\n *        WOF reparse point and WimOverlay.dat structs (undocumented)         *\n *----------------------------------------------------------------------------*/\n\n/*\n * Format of the WIM provider reparse data.  This is the data which follows the\n * portion of the reparse point common to WOF.  (The common portion consists of\n * a reparse point header where the reparse tag is 0x80000017, then a\n * WOF_EXTERNAL_INFO struct which specifies the provider.)\n *\n * Note that Microsoft does not document any of the reparse point formats for\n * WOF, although they document the structures which must be passed into the\n * ioctls, which are often similar.\n */\nPRAGMA_BEGIN_PACKED\nstruct wim_provider_rpdata {\n\t/* Set to 2.  Uncertain meaning.  */\n\tle32 version;\n\n\t/* 0 when WIM provider active, otherwise\n\t * WIM_PROVIDER_EXTERNAL_FLAG_NOT_ACTIVE or\n\t * WIM_PROVIDER_EXTERNAL_FLAG_SUSPENDED.  */\n\tle32 flags;\n\n\t/* Integer ID that identifies the WIM.  */\n\tle64 data_source_id;\n\n\t/* SHA-1 message digest of the file's unnamed data stream.  */\n\tu8 unnamed_data_stream_hash[20];\n\n\t/* SHA-1 message digest of the WIM's blob table as stored on disk.  */\n\tu8 blob_table_hash[20];\n\n\t/* Uncompressed size of the file's unnamed data stream, in bytes.  */\n\tle64 unnamed_data_stream_size;\n\n\t/* Size of the file's unnamed data stream as stored in the WIM file.\n\t * If this is the same as unnamed_data_stream_size, then the stream is\n\t * uncompressed.  If this is the *not* the same as\n\t * unnamed_data_stream_size, then the stream is compressed.  */\n\tle64 unnamed_data_stream_size_in_wim;\n\n\t/* Byte offset of the file's unnamed data stream in the WIM.  */\n\tle64 unnamed_data_stream_offset_in_wim;\n} __attribute__((packed));\n\n/* WIM-specific information about a WIM data source  */\nstruct WimOverlay_dat_entry_1 {\n\n\t/* Identifier for the WIM data source, (normally allocated by\n\t * FSCTL_ADD_OVERLAY).  Every 'WimOverlay_dat_entry_1' should have a\n\t * different value for this.  */\n\tle64 data_source_id;\n\n\t/* Byte offset, from the beginning of the file, of the corresponding\n\t * 'struct WimOverlay_dat_entry_2' for this WIM data source.  */\n\tle32 entry_2_offset;\n\n\t/* Size, in bytes, of the corresponding 'struct WimOverlay_dat_entry_2\n\t * for this WIM data source, including wim_file_name and its null\n\t * terminator.  */\n\tle32 entry_2_length;\n\n\t/* Type of the WIM file: WIM_BOOT_OS_WIM or WIM_BOOT_NOT_OS_WIM.  */\n\tle32 wim_type;\n\n\t/* Index of the image in the WIM to use??? (This doesn't really make\n\t * sense, since WIM files combine file data \"blobs\" for all images into\n\t * a single table.  Set to 1 if unsure...)  */\n\tle32 wim_index;\n\n\t/* GUID of the WIM file (copied from the WIM header, offset +0x18).  */\n\tu8 guid[16];\n} __attribute__((packed));\n\n/*\n * Format of file: \"\\System Volume Information\\WimOverlay.dat\"\n *\n * Not documented by Microsoft.\n *\n * The file consists of a 'struct WimOverlay_dat_header' followed by one or more\n * 'struct WimOverlay_dat_entry_1', followed by the same number of 'struct\n * WimOverlay_dat_entry_2'.  Note that 'struct WimOverlay_dat_entry_1' is of\n * fixed length, whereas 'struct WimOverlay_dat_entry_2' is of variable length.\n */\nstruct WimOverlay_dat_header {\n\t/* Set to WIMOVERLAY_DAT_MAGIC  */\n\tle32 magic;\n#define WIMOVERLAY_DAT_MAGIC 0x66436F57\n\n\t/* Set to 1 (WIM_PROVIDER_CURRENT_VERSION)  */\n\tle32 wim_provider_version;\n\n\t/* Set to 0x00000028  */\n\tle32 unknown_0x08;\n\n\t/* Set to number of WIMs registered (listed in the file)  */\n\tle32 num_entries;\n\n\t/* The next available data source ID.  This is tracked so that data\n\t * source IDs are never reused, even if a WIM is unregistered.  */\n\tle64 next_data_source_id;\n\n\tstruct WimOverlay_dat_entry_1 entry_1s[];\n} __attribute__((packed));\n\n/* Location information about a WIM data source  */\nstruct WimOverlay_dat_entry_2 {\n\t/* Set to 0  */\n\tle32 unknown_0x00;\n\n\t/* Set to 0  */\n\tle32 unknown_0x04;\n\n\t/* Size, in bytes, of this 'struct WimOverlay_dat_entry_2', including\n\t * wim_file_name and its null terminator.  */\n\tle32 entry_2_length;\n\n\t/* Set to 0  */\n\tle32 unknown_0x0C;\n\n\t/* Set to 5  */\n\tle32 unknown_0x10;\n\n\tstruct {\n\t\t/* Set to 1  */\n\t\tle32 unknown_0x14;\n\n\t\t/* Size of this inner structure, in bytes.  */\n\t\tle32 inner_struct_size;\n\n\t\t/* Set to 5  */\n\t\tle32 unknown_0x1C;\n\n\t\t/* Set to 6  */\n\t\tle32 unknown_0x20;\n\n\t\t/* Set to 0  */\n\t\tle32 unknown_0x24;\n\n\t\t/* Set to 0x48  */\n\t\tle32 unknown_0x28;\n\n\t\t/* Set to 0  */\n\t\tle32 unknown_0x2C;\n\n\t\t/*************************\n\t\t * Partition information\n\t\t ************************/\n\n\t\t/* Partition identifier  */\n\t\tunion {\n\t\t\t/* (For MBR-formatted disks)  */\n\t\t\tstruct {\n\t\t\t\t/* Offset, in bytes, of the MBR partition, from\n\t\t\t\t * the beginning of the disk.  */\n\t\t\t\tle64 part_start_offset;\n\n\t\t\t\t/* Set to 0  */\n\t\t\t\tle64 padding;\n\t\t\t} mbr;\n\n\t\t\t/* (For GPT-formatted disks)  */\n\t\t\tstruct {\n\t\t\t\t/* Unique GUID of the GPT partition  */\n\t\t\t\tu8 part_unique_guid[16];\n\t\t\t} gpt;\n\t\t} partition;\n\n\t\t/* Set to 0  */\n\t\tle32 unknown_0x40;\n\n\t\t/***********************\n\t\t * Disk information\n\t\t **********************/\n\n\t\t/* 1 for MBR, 0 for GPT  */\n\t\tle32 partition_table_type;\n\t#define WIMOVERLAY_PARTITION_TYPE_MBR 1\n\t#define WIMOVERLAY_PARTITION_TYPE_GPT 0\n\n\t\t/* Disk identifier  */\n\t\tunion {\n\t\t\t/* (For MBR-formatted disks)  */\n\t\t\tstruct {\n\t\t\t\t/* 4-byte ID of the MBR disk  */\n\t\t\t\tle32 disk_id;\n\n\t\t\t\t/* Set to 0  */\n\t\t\t\tle32 padding[3];\n\t\t\t} mbr;\n\n\t\t\t/* (For GPT-formatted disks)  */\n\t\t\tstruct {\n\t\t\t\t/* GUID of the GPT disk  */\n\t\t\t\tu8 disk_guid[16];\n\t\t\t} gpt;\n\t\t} disk;\n\n\t\t/* Set to 0.  (This is the right size for some sort of optional\n\t\t * GUID...)  */\n\t\tle32 unknown_0x58[4];\n\n\t\t/**************************\n\t\t * Location in filesystem\n\t\t *************************/\n\n\t\t/* Null-terminated path to WIM file.  Begins with \\ but does\n\t\t * *not* include drive letter!  */\n\t\tutf16lechar wim_file_name[];\n\t} __attribute__((packed));\n} __attribute__((packed));\nPRAGMA_END_PACKED\n\nstatic void __attribute__((unused))\nwof_check_structs(void)\n{\n\tSTATIC_ASSERT(sizeof(struct WimOverlay_dat_header) == 24);\n\tSTATIC_ASSERT(sizeof(struct WimOverlay_dat_entry_1) == 40);\n\tSTATIC_ASSERT(sizeof(struct WimOverlay_dat_entry_2) == 104);\n}\n\n#endif /* _WIN32 */\n\n#endif /* _WOF_H_ */\n"
  },
  {
    "path": "src/wimlib/wimlib/write.h",
    "content": "#ifndef _WIMLIB_WRITE_H\n#define _WIMLIB_WRITE_H\n\n#include \"wimlib.h\"\n#include \"wimlib/types.h\"\n\n/* Internal use only */\n#define WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR\t\t0x80000000\n#define WIMLIB_WRITE_FLAG_APPEND\t\t\t0x40000000\n#define WIMLIB_WRITE_FLAG_NO_NEW_BLOBS\t\t\t0x20000000\n#define WIMLIB_WRITE_FLAG_USE_EXISTING_TOTALBYTES\t0x10000000\n#define WIMLIB_WRITE_FLAG_NO_METADATA\t\t\t0x08000000\n\n/* Keep in sync with wimlib.h  */\n#define WIMLIB_WRITE_MASK_PUBLIC (\t\t\t  \\\n\tWIMLIB_WRITE_FLAG_CHECK_INTEGRITY\t\t| \\\n\tWIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY\t\t| \\\n\tWIMLIB_WRITE_FLAG_PIPABLE\t\t\t| \\\n\tWIMLIB_WRITE_FLAG_NOT_PIPABLE\t\t\t| \\\n\tWIMLIB_WRITE_FLAG_RECOMPRESS\t\t\t| \\\n\tWIMLIB_WRITE_FLAG_FSYNC\t\t\t\t| \\\n\tWIMLIB_WRITE_FLAG_REBUILD\t\t\t| \\\n\tWIMLIB_WRITE_FLAG_SOFT_DELETE\t\t\t| \\\n\tWIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG\t\t| \\\n\tWIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS\t\t| \\\n\tWIMLIB_WRITE_FLAG_STREAMS_OK\t\t\t| \\\n\tWIMLIB_WRITE_FLAG_RETAIN_GUID\t\t\t| \\\n\tWIMLIB_WRITE_FLAG_SOLID\t\t\t\t| \\\n\tWIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES\t| \\\n\tWIMLIB_WRITE_FLAG_NO_SOLID_SORT\t\t\t| \\\n\tWIMLIB_WRITE_FLAG_UNSAFE_COMPACT)\n\n#if defined(HAVE_SYS_FILE_H) && defined(HAVE_FLOCK)\nint\nlock_wim_for_append(WIMStruct *wim);\nvoid\nunlock_wim_for_append(WIMStruct *wim);\n#else\nstatic inline int\nlock_wim_for_append(WIMStruct *wim)\n{\n\treturn 0;\n}\nstatic inline void\nunlock_wim_for_append(WIMStruct *wim)\n{\n}\n#endif\n\nstruct filedes;\nstruct list_head;\nstruct wim_reshdr;\n\nint\nwrite_wim_part(WIMStruct *wim,\n\t       const void *path_or_fd,\n\t       int image,\n\t       int write_flags,\n\t       unsigned num_threads,\n\t       unsigned part_number,\n\t       unsigned total_parts,\n\t       struct list_head *blob_list_override,\n\t       const u8 *guid);\n\nint\nwrite_wim_resource_from_buffer(const void *buf,\n\t\t\t       size_t buf_size,\n\t\t\t       bool is_metadata,\n\t\t\t       struct filedes *out_fd,\n\t\t\t       int out_ctype,\n\t\t\t       u32 out_chunk_size,\n\t\t\t       struct wim_reshdr *out_reshdr,\n\t\t\t       u8 *hash_ret,\n\t\t\t       int write_resource_flags);\n\n#endif /* _WIMLIB_WRITE_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/xattr.h",
    "content": "#ifndef _WIMLIB_XATTR_H\n#define _WIMLIB_XATTR_H\n\n#include <string.h>\n\n#include \"wimlib/endianness.h\"\n#include \"wimlib/tagged_items.h\"\n#include \"wimlib/util.h\"\n\n#undef HAVE_LINUX_XATTR_SUPPORT\n#if defined(HAVE_SYS_XATTR_H) && \\\n\tdefined(HAVE_LLISTXATTR) && defined(HAVE_LGETXATTR) && \\\n\tdefined(HAVE_FSETXATTR) && defined(HAVE_LSETXATTR)\n#  define HAVE_LINUX_XATTR_SUPPORT 1\n#endif\n\n#define WIM_XATTR_NAME_MAX 255\n#define WIM_XATTR_SIZE_MAX 65535\n\n/*\n * On-disk format of each extended attribute (xattr, or EA) entry in a metadata\n * item tagged with TAG_XATTRS.  This is the preferred xattr format, since it is\n * also used by WIMGAPI and DISM starting in Windows 10 version 1607.\n */\nPRAGMA_BEGIN_PACKED\nstruct wim_xattr_entry {\n\n\t/* length of xattr value in bytes */\n\tle16 value_len;\n\n\t/* length of xattr name in bytes, excluding the null terminator */\n\tu8 name_len;\n\n\t/* flags: 0 or 0x80 (FILE_NEED_EA) */\n\tu8 flags;\n\n\t/* followed by the xattr name *with* a null terminator */\n\tchar name[0];\n\n\t/* followed by the xattr value */\n\t/* u8 value[0]; */\n\n\t/* no padding at end! */\n} __attribute__((packed));\nPRAGMA_END_PACKED\n\nstatic inline size_t\nxattr_entry_size(const struct wim_xattr_entry *entry)\n{\n\tSTATIC_ASSERT(sizeof(*entry) == 4);\n\n\treturn sizeof(*entry) + entry->name_len + 1 +\n\t\tle16_to_cpu(entry->value_len);\n}\n\n/* minimum is a 1-byte name (plus null terminator) and an empty value */\n#define XATTR_ENTRY_MIN_SIZE (sizeof(struct wim_xattr_entry) + 2)\n\nstatic inline struct wim_xattr_entry *\nxattr_entry_next(const struct wim_xattr_entry *entry)\n{\n\treturn (void *)_PTR(entry + xattr_entry_size(entry));\n}\n\nstatic inline bool\nvalid_xattr_entry(const struct wim_xattr_entry *entry, size_t avail)\n{\n\tif (avail < sizeof(*entry))\n\t\treturn false;\n\n\treturn entry->name_len > 0 && entry->name_len <= WIM_XATTR_NAME_MAX &&\n\t\tle16_to_cpu(entry->value_len) <= WIM_XATTR_SIZE_MAX &&\n\t\tavail >= xattr_entry_size(entry) &&\n\t\tmemchr(entry->name, '\\0', entry->name_len) == NULL &&\n\t\tentry->name[entry->name_len] == '\\0';\n}\n\n/*\n * On-disk format of each extended attribute entry in a metadata item tagged\n * with TAG_WIMLIB_LINUX_XATTRS.  This is a deprecated format which wimlib\n * v1.11-v1.12 used to store extended attributes on Linux (predating the Windows\n * xattr support in both WIMGAPI and wimlib).  Now we use TAG_XATTRS for both\n * Windows and Linux xattrs.\n */\nPRAGMA_BEGIN_ALIGN(4)\nstruct wimlib_xattr_entry_old {\n\n\t/* length of xattr name in bytes, excluding a null terminator */\n\tle16 name_len;\n\n\t/* reserved, must be 0 */\n\tle16 reserved;\n\n\t/* length of xattr value in bytes */\n\tle32 value_len;\n\n\t/* followed by the xattr name *without* a null terminator */\n\tchar name[0];\n\n\t/* followed by the xattr value */\n\t/* u8 value[0]; */\n\n\t/* then zero-padded to a 4-byte boundary */\n} PRAGMA_END_ALIGN(4);\n\nstatic inline size_t\nold_xattr_entry_size(const struct wimlib_xattr_entry_old *entry)\n{\n\tSTATIC_ASSERT(sizeof(*entry) == 8);\n\n\treturn ALIGN(sizeof(*entry) + le16_to_cpu(entry->name_len) +\n\t\t     le32_to_cpu(entry->value_len), 4);\n}\n\n/* minimum is a 1-byte name and an empty value */\n#define OLD_XATTR_ENTRY_MIN_SIZE \\\n\t(ALIGN(sizeof(struct wimlib_xattr_entry_old) + 1, 4))\n\nstatic inline struct wimlib_xattr_entry_old *\nold_xattr_entry_next(const struct wimlib_xattr_entry_old *entry)\n{\n\treturn (void *)_PTR(entry + old_xattr_entry_size(entry));\n}\n\nstatic inline bool\nold_valid_xattr_entry(const struct wimlib_xattr_entry_old *entry, size_t avail)\n{\n\tu16 name_len;\n\n\tif (avail < sizeof(*entry))\n\t\treturn false;\n\n\tname_len = le16_to_cpu(entry->name_len);\n\treturn name_len > 0 && name_len <= WIM_XATTR_NAME_MAX &&\n\t\tle32_to_cpu(entry->value_len) <= WIM_XATTR_SIZE_MAX &&\n\t\tavail >= old_xattr_entry_size(entry) &&\n\t\tmemchr(entry->name, '\\0', name_len) == NULL;\n}\n\n/* Is the xattr of the specified name security-related on Linux? */\nstatic inline bool\nis_linux_security_xattr(const char *name)\n{\n#define XATTR_SECURITY_PREFIX \"security.\"\n#define XATTR_SYSTEM_PREFIX \"system.\"\n#define XATTR_POSIX_ACL_ACCESS  \"posix_acl_access\"\n#define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS\n#define XATTR_POSIX_ACL_DEFAULT  \"posix_acl_default\"\n#define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT\n\n\treturn !strncmp(name, XATTR_SECURITY_PREFIX,\n\t\t\tsizeof(XATTR_SECURITY_PREFIX) - 1) ||\n\t       !strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS) ||\n\t       !strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT);\n}\n\nstatic inline const void *\ninode_get_xattrs(const struct wim_inode *inode, u32 *len_ret)\n{\n\treturn inode_get_tagged_item(inode, TAG_XATTRS,\n\t\t\t\t     XATTR_ENTRY_MIN_SIZE, len_ret);\n}\n\nstatic inline const void *\ninode_get_xattrs_old(const struct wim_inode *inode, u32 *len_ret)\n{\n\treturn inode_get_tagged_item(inode, TAG_WIMLIB_LINUX_XATTRS,\n\t\t\t\t     OLD_XATTR_ENTRY_MIN_SIZE, len_ret);\n}\n\nstatic inline const void *\ninode_get_linux_xattrs(const struct wim_inode *inode, u32 *len_ret,\n\t\t       bool *is_old_format_ret)\n{\n\tconst void *entries;\n\n\tentries = inode_get_xattrs(inode, len_ret);\n\tif (entries) {\n\t\t*is_old_format_ret = false;\n\t\treturn entries;\n\t}\n\tentries = inode_get_xattrs_old(inode, len_ret);\n\tif (entries) {\n\t\t*is_old_format_ret = true;\n\t\treturn entries;\n\t}\n\treturn NULL;\n}\n\nstatic inline bool\ninode_has_xattrs(const struct wim_inode *inode)\n{\n\treturn inode_get_xattrs(inode, NULL) != NULL ||\n\t       inode_get_xattrs_old(inode, NULL) != NULL;\n}\n\nstatic inline bool\ninode_set_xattrs(struct wim_inode *inode, const void *entries, u32 len)\n{\n\treturn inode_set_tagged_item(inode, TAG_XATTRS, entries, len);\n}\n\n#endif /* _WIMLIB_XATTR_H  */\n"
  },
  {
    "path": "src/wimlib/wimlib/xml.h",
    "content": "#ifndef _WIMLIB_XML_H\n#define _WIMLIB_XML_H\n\n#include \"wimlib/types.h\"\n\n/*****************************************************************************/\n\nstruct wim_xml_info;\n\nstruct wim_xml_info *\nxml_new_info_struct(void);\n\nvoid\nxml_free_info_struct(struct wim_xml_info *info);\n\n/*****************************************************************************/\n\nint\nxml_get_image_count(const struct wim_xml_info *info);\n\nu64\nxml_get_total_bytes(const struct wim_xml_info *info);\n\nu64\nxml_get_image_total_bytes(const struct wim_xml_info *info, int image);\n\nu64\nxml_get_image_hard_link_bytes(const struct wim_xml_info *info, int image);\n\nbool\nxml_get_wimboot(const struct wim_xml_info *info, int image);\n\nu64\nxml_get_windows_build_number(const struct wim_xml_info *info, int image);\n\nint\nxml_set_wimboot(struct wim_xml_info *info, int image);\n\n/*****************************************************************************/\n\nint\nxml_update_image_info(WIMStruct *wim, int image);\n\nint\nxml_add_image(struct wim_xml_info *info, const tchar *name);\n\nint\nxml_export_image(const struct wim_xml_info *src_info, int src_image,\n\t\t struct wim_xml_info *dest_info, const tchar *dest_image_name,\n\t\t const tchar *dest_image_description, bool wimboot);\n\nvoid\nxml_delete_image(struct wim_xml_info *info, int image);\n\n\nvoid\nxml_print_image_info(struct wim_xml_info *info, int image);\n\n/*****************************************************************************/\n\nstruct wim_reshdr;\n\n#define WIM_TOTALBYTES_USE_EXISTING  ((u64)(-1))\n#define WIM_TOTALBYTES_OMIT          ((u64)(-2))\n\nint\nread_wim_xml_data(WIMStruct *wim);\n\nint\nwrite_wim_xml_data(WIMStruct *wim, int image,\n\t\t   u64 total_bytes, struct wim_reshdr *out_reshdr,\n\t\t   int write_resource_flags);\n\n#endif /* _WIMLIB_XML_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/xml_windows.h",
    "content": "#ifndef _WIMLIB_XML_WINDOWS_H\n#define _WIMLIB_XML_WINDOWS_H\n\n#include \"wimlib/types.h\"\n\nint\nset_windows_specific_info(WIMStruct *wim);\n\n#endif /* _WIMLIB_XML_WINDOWS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/xmlproc.h",
    "content": "#ifndef _WIMLIB_XMLPROC_H\n#define _WIMLIB_XMLPROC_H\n\n#include \"wimlib/list.h\"\n#include \"wimlib/types.h\"\n\n/*****************************************************************************/\n\nenum xml_node_type {\n\tXML_ELEMENT_NODE,\n\tXML_TEXT_NODE,\n\tXML_ATTRIBUTE_NODE,\n};\n\nstruct xml_node {\n\tenum xml_node_type type;\t/* type of node */\n\ttchar *name;\t\t\t/* name of ELEMENT or ATTRIBUTE */\n\ttchar *value;\t\t\t/* value of TEXT or ATTRIBUTE */\n\tstruct xml_node *parent;\t/* parent, or NULL if none */\n\tstruct list_head children;\t/* children; only used for ELEMENT */\n\tstruct list_head sibling_link;\n};\n\n/* Iterate through the children of an xml_node.  Does nothing if passed NULL. */\n#define xml_node_for_each_child(parent, child) \\\n\tif (parent) list_for_each_entry(child, &(parent)->children, sibling_link)\n\nstatic inline bool\nxml_node_is_element(const struct xml_node *node, const tchar *name)\n{\n\treturn node->type == XML_ELEMENT_NODE && !tstrcmp(node->name, name);\n}\n\nstruct xml_node *\nxml_new_element(struct xml_node *parent, const tchar *name);\n\nstruct xml_node *\nxml_new_element_with_text(struct xml_node *parent, const tchar *name,\n\t\t\t  const tchar *text);\n\nvoid\nxml_add_child(struct xml_node *parent, struct xml_node *child);\n\nvoid\nxml_unlink_node(struct xml_node *node);\n\nvoid\nxml_free_node(struct xml_node *node);\n\nconst tchar *\nxml_element_get_text(const struct xml_node *element);\n\nint\nxml_element_set_text(struct xml_node *element, const tchar *text);\n\nstruct xml_node *\nxml_get_attrib(const struct xml_node *element, const tchar *name);\n\nint\nxml_set_attrib(struct xml_node *element, const tchar *name, const tchar *value);\n\nvoid\nxml_replace_child(struct xml_node *parent, struct xml_node *replacement);\n\nstruct xml_node *\nxml_clone_tree(struct xml_node *orig);\n\nbool\nxml_legal_path(const tchar *name);\n\nbool\nxml_legal_value(const tchar *value);\n\n/*****************************************************************************/\n\nint\nxml_parse_document(const tchar *raw_doc, struct xml_node **doc_ret);\n\n/*****************************************************************************/\n\nstruct xml_out_buf {\n\ttchar *buf;\n\tsize_t count;\n\tsize_t capacity;\n\tbool oom;\n};\n\nint\nxml_write_document(struct xml_node *doc, struct xml_out_buf *buf);\n\n#endif /* _WIMLIB_XMLPROC_H */\n"
  },
  {
    "path": "src/wimlib/wimlib/xpress_constants.h",
    "content": "/*\n * xpress_constants.h\n *\n * Constants for the XPRESS compression format.\n */\n\n#ifndef _XPRESS_CONSTANTS_H\n#define _XPRESS_CONSTANTS_H\n\n#define XPRESS_NUM_CHARS\t256\n#define XPRESS_NUM_SYMBOLS\t512\n#define XPRESS_MAX_CODEWORD_LEN\t15\n\n#define XPRESS_END_OF_DATA\t256\n\n#define XPRESS_MIN_OFFSET\t1\n#define XPRESS_MAX_OFFSET\t65535\n\n#define XPRESS_MIN_MATCH_LEN\t3\n#define XPRESS_MAX_MATCH_LEN\t65538\n\n#endif /* _XPRESS_CONSTANTS_H */\n"
  },
  {
    "path": "src/wimlib/wimlib.h",
    "content": "/**\n * @file wimlib.h\n * @brief External header for wimlib.\n *\n * This file contains comments for generating documentation with Doxygen.  The\n * built HTML documentation can be viewed at https://wimlib.net/apidoc.  Make\n * sure to see the <a href=\"modules.html\">Modules page</a> to make more sense of\n * the declarations in this header.\n */\n\n/**\n * @mainpage\n *\n * This is the documentation for the library interface of wimlib 1.14.4, a C\n * library for creating, modifying, extracting, and mounting files in the\n * Windows Imaging (WIM) format.  This documentation is intended for developers\n * only.  If you have installed wimlib and want to know how to use the @b\n * wimlib-imagex program, please see the manual pages and also the <a\n * href=\"https://wimlib.net/git/?p=wimlib;a=blob;f=README.md\">README file</a>.\n *\n * @section sec_installing Installing\n *\n * @subsection UNIX\n *\n * Download the source code from https://wimlib.net.  Install the library by\n * running <c>configure && make && sudo make install</c>.  See the README for\n * information about configuration options.  To use wimlib in your program after\n * installing it, include wimlib.h and link your program with <c>-lwim</c>.\n *\n * @subsection Windows\n *\n * Download the Windows binary distribution with the appropriate architecture\n * from https://wimlib.net.  Link your program with libwim-15.dll.  If needed by\n * your programming language or development environment, the import library\n * libwim.lib and C/C++ header wimlib.h can be found in the directory \"devel\" in\n * the ZIP file.\n *\n * If you need to access the DLL from non-C/C++ programming languages, note that\n * the calling convention is \"cdecl\".\n *\n * If you want to build wimlib from source on Windows, see README.WINDOWS.  This\n * is only needed if you are making modifications to wimlib.\n *\n * @section sec_examples Examples\n *\n * Several examples are located in the \"examples\" directory of the source\n * distribution.  Also see @ref sec_basic_wim_handling_concepts below.\n *\n * There is also the <a\n * href=\"https://wimlib.net/git/?p=wimlib;a=blob;f=programs/imagex.c\">\n * source code of <b>wimlib-imagex</b></a>, which is complicated but uses most\n * capabilities of wimlib.\n *\n * @section backward_compatibility Backward Compatibility\n *\n * New releases of wimlib are intended to be backward compatible with old\n * releases, except when the libtool \"age\" is reset.  This most recently\n * occurred for the v1.7.0 (libwim15) release (June 2014).  Since the library is\n * becoming increasingly stable, the goal is to maintain the current API/ABI for\n * as long as possible unless there is a strong reason not to.\n *\n * As with any other library, applications should not rely on internal\n * implementation details that may be subject to change.\n *\n * @section sec_basic_wim_handling_concepts Basic WIM handling concepts\n *\n * wimlib wraps up a WIM file in an opaque ::WIMStruct structure.   There are\n * two ways to create such a structure:\n *\n * 1. wimlib_open_wim() opens an on-disk WIM file and creates a ::WIMStruct for\n *    it.\n * 2. wimlib_create_new_wim() creates a new ::WIMStruct that initially contains\n *    no images and does not yet have a backing on-disk file.\n *\n * A ::WIMStruct contains zero or more independent directory trees called @a\n * images.  Images may be extracted, added, deleted, exported, and updated using\n * various API functions.  (See @ref G_extracting_wims and @ref G_modifying_wims\n * for more details.)\n *\n * Changes made to a WIM represented by a ::WIMStruct have no persistent effect\n * until the WIM is actually written to an on-disk file.  This can be done using\n * wimlib_write(), but if the WIM was originally opened using wimlib_open_wim(),\n * then wimlib_overwrite() can be used instead.  (See @ref\n * G_writing_and_overwriting_wims for more details.)\n *\n * wimlib's API is designed to let you combine functions to accomplish tasks in\n * a flexible way.  Here are some example sequences of function calls:\n *\n * Apply an image from a WIM file, similar to the command-line program\n * <b>wimapply</b>:\n *\n * 1. wimlib_open_wim()\n * 2. wimlib_extract_image()\n *\n * Capture an image into a new WIM file, similar to <b>wimcapture</b>:\n *\n * 1. wimlib_create_new_wim()\n * 2. wimlib_add_image()\n * 3. wimlib_write()\n *\n * Append an image to an existing WIM file, similar to <b>wimappend</b>:\n *\n * 1. wimlib_open_wim()\n * 2. wimlib_add_image()\n * 3. wimlib_overwrite()\n *\n * Delete an image from an existing WIM file, similar to <b>wimdelete</b>:\n *\n * 1. wimlib_open_wim()\n * 2. wimlib_delete_image()\n * 3. wimlib_overwrite()\n *\n * Export an image from one WIM file to another, similar to <b>wimexport</b>:\n *\n * 1. wimlib_open_wim() (on source)\n * 2. wimlib_open_wim() (on destination)\n * 3. wimlib_export_image()\n * 4. wimlib_overwrite() (on destination)\n *\n * The API also lets you do things the command-line tools don't directly allow.\n * For example, you could make multiple changes to a WIM before efficiently\n * committing the changes with just one call to wimlib_overwrite().  Perhaps you\n * want to both delete an image and add a new one; or perhaps you want to\n * customize an image with wimlib_update_image() after adding it.  All these use\n * cases are supported by the API.\n *\n * @section sec_cleaning_up Cleaning up\n *\n * After you are done with any ::WIMStruct, you can call wimlib_free() to free\n * all resources associated with it.  Also, when you are completely done with\n * using wimlib in your program, you can call wimlib_global_cleanup() to free\n * any other resources allocated by the library.\n *\n * @section sec_error_handling Error Handling\n *\n * Most functions in wimlib return 0 on success and a positive\n * ::wimlib_error_code value on failure.  Use wimlib_get_error_string() to get a\n * string that describes an error code.  wimlib also can print error messages to\n * standard error or a custom file when an error occurs, and these may be more\n * informative than the error code; to enable this, call\n * wimlib_set_print_errors().  Please note that this is for convenience only,\n * and some errors can occur without a message being printed.  Currently, error\n * messages and strings (as well as all documentation, for that matter) are only\n * available in English.\n *\n * @section sec_encodings Character encoding\n *\n * To support Windows as well as UNIX-like systems, wimlib's API typically takes\n * and returns strings of ::wimlib_tchar which have a platform-dependent type\n * and encoding.\n *\n * On Windows, each ::wimlib_tchar is a 2-byte <tt>wchar_t</tt>.  The encoding\n * is meant to be UTF-16LE.  However, unpaired surrogates are permitted because\n * neither Windows nor the NTFS filesystem forbids them in filenames.\n *\n * On UNIX-like systems, each ::wimlib_tchar is a 1 byte <tt>char</tt>.  The\n * encoding is meant to be UTF-8.  However, for compatibility with Windows-style\n * filenames that are not valid UTF-16LE, surrogate codepoints are permitted.\n * Other multibyte encodings (e.g. ISO-8859-1) or garbage sequences of bytes are\n * not permitted.\n *\n * @section sec_advanced Additional information and features\n *\n *\n * @subsection subsec_mounting_wim_images Mounting WIM images\n *\n * See @ref G_mounting_wim_images.\n *\n * @subsection subsec_progress_functions Progress Messages\n *\n * See @ref G_progress.\n *\n * @subsection subsec_non_standalone_wims Non-standalone WIMs\n *\n * See @ref G_nonstandalone_wims.\n *\n * @subsection subsec_pipable_wims Pipable WIMs\n *\n * wimlib supports a special \"pipable\" WIM format which unfortunately is @b not\n * compatible with Microsoft's software.  To create a pipable WIM, call\n * wimlib_write(), wimlib_write_to_fd(), or wimlib_overwrite() with\n * ::WIMLIB_WRITE_FLAG_PIPABLE specified.  Pipable WIMs are pipable in both\n * directions, so wimlib_write_to_fd() can be used to write a pipable WIM to a\n * pipe, and wimlib_extract_image_from_pipe() can be used to apply an image from\n * a pipable WIM.  wimlib can also transparently open and operate on pipable WIM\n * s using a seekable file descriptor using the regular function calls (e.g.\n * wimlib_open_wim(), wimlib_extract_image()).\n *\n * See the documentation for the <b>--pipable</b> flag of <b>wimcapture</b> for\n * more information about pipable WIMs.\n *\n * @subsection subsec_thread_safety Thread Safety\n *\n * A ::WIMStruct is not thread-safe and cannot be accessed by multiple threads\n * concurrently, even for \"read-only\" operations such as extraction.  However,\n * users are free to use <i>different</i> ::WIMStruct's from different threads\n * concurrently.  It is even allowed for multiple ::WIMStruct's to be backed by\n * the same on-disk WIM file, although \"overwrites\" should never be done in such\n * a scenario.\n *\n * In addition, several functions change global state and should only be called\n * when a single thread is active in the library.  These functions are:\n *\n * - wimlib_global_init()\n * - wimlib_global_cleanup()\n * - wimlib_set_memory_allocator()\n * - wimlib_set_print_errors()\n * - wimlib_set_error_file()\n * - wimlib_set_error_file_by_name()\n *\n * @subsection subsec_limitations Limitations\n *\n * This section documents some technical limitations of wimlib not already\n * described in the documentation for @b wimlib-imagex.\n *\n * - The old WIM format from Vista pre-releases is not supported.\n * - wimlib does not provide a clone of the @b PEImg tool, or the @b DISM\n *   functionality other than that already present in @b ImageX, that allows you\n *   to make certain Windows-specific modifications to a Windows PE image, such\n *   as adding a driver or Windows component.  Such a tool could be implemented\n *   on top of wimlib.\n *\n * @subsection more_info More information\n *\n * You are advised to read the README as well as the documentation for\n * <b>wimlib-imagex</b>, since not all relevant information is repeated here in\n * the API documentation.\n */\n\n/** @defgroup G_general General\n *\n * @brief Declarations and structures shared across the library.\n */\n\n/** @defgroup G_creating_and_opening_wims Creating and Opening WIMs\n *\n * @brief Open an existing WIM file as a ::WIMStruct, or create a new\n * ::WIMStruct which can be used to create a new WIM file.\n */\n\n/** @defgroup G_wim_information Retrieving WIM information and directory listings\n *\n * @brief Retrieve information about a WIM or WIM image.\n */\n\n/** @defgroup G_modifying_wims Modifying WIMs\n *\n * @brief Make changes to a ::WIMStruct, in preparation of persisting the\n * ::WIMStruct to an on-disk file.\n *\n * @section sec_adding_images Capturing and adding WIM images\n *\n * As described in @ref sec_basic_wim_handling_concepts, capturing a new WIM or\n * appending an image to an existing WIM is a multi-step process, but at its\n * core is wimlib_add_image() or an equivalent function.  Normally,\n * wimlib_add_image() takes an on-disk directory tree and logically adds it to a\n * ::WIMStruct as a new image.  However, when supported by the build of the\n * library, there is also a special NTFS volume capture mode (entered when\n * ::WIMLIB_ADD_FLAG_NTFS is specified) that allows adding the image directly\n * from an unmounted NTFS volume.\n *\n * Another function, wimlib_add_image_multisource() is also provided.  It\n * generalizes wimlib_add_image() to allow combining multiple files or directory\n * trees into a single WIM image in a configurable way.\n *\n * For maximum customization of WIM image creation, it is also possible to add a\n * completely empty WIM image with wimlib_add_empty_image(), then update it with\n * wimlib_update_image().  (This is in fact what wimlib_add_image() and\n * wimlib_add_image_multisource() do internally.)\n *\n * Note that some details of how image addition/capture works are documented\n * more fully in the documentation for <b>wimcapture</b>.\n *\n * @section sec_deleting_images Deleting WIM images\n *\n * wimlib_delete_image() can delete an image from a ::WIMStruct.  But as usual,\n * wimlib_write() or wimlib_overwrite() must be called to cause the changes to\n * be made persistent in an on-disk WIM file.\n *\n * @section sec_exporting_images Exporting WIM images\n *\n * wimlib_export_image() can copy, or \"export\", an image from one WIM to\n * another.\n *\n * @section sec_other_modifications Other modifications\n *\n * wimlib_update_image() can add, delete, and rename files in a WIM image.\n *\n * wimlib_set_image_property() can change other image metadata.\n *\n * wimlib_set_wim_info() can change information about the WIM file itself, such\n * as the boot index.\n */\n\n/** @defgroup G_extracting_wims Extracting WIMs\n *\n * @brief Extract files, directories, and images from a WIM.\n *\n * wimlib_extract_image() extracts, or \"applies\", an image from a WIM,\n * represented by a ::WIMStruct.  This normally extracts the image to a\n * directory, but when supported by the build of the library there is also a\n * special NTFS volume extraction mode (entered when ::WIMLIB_EXTRACT_FLAG_NTFS\n * is specified) that allows extracting a WIM image directly to an unmounted\n * NTFS volume.  Various other flags allow further customization of image\n * extraction.\n *\n * wimlib_extract_paths() and wimlib_extract_pathlist() allow extracting a list\n * of (possibly wildcard) paths from a WIM image.\n *\n * wimlib_extract_image_from_pipe() extracts an image from a pipable WIM sent\n * over a pipe; see @ref subsec_pipable_wims.\n *\n * Some details of how WIM extraction works are described more fully in the\n * documentation for <b>wimapply</b> and <b>wimextract</b>.\n */\n\n/** @defgroup G_mounting_wim_images Mounting WIM images\n *\n * @brief Mount and unmount WIM images.\n *\n * On Linux, wimlib supports mounting images from WIM files either read-only or\n * read-write.  To mount an image, call wimlib_mount_image().  To unmount an\n * image, call wimlib_unmount_image().  Mounting can be done without root\n * privileges because it is implemented using FUSE (Filesystem in Userspace).\n *\n * If wimlib is compiled using the <c>--without-fuse</c> flag, these functions\n * will be available but will fail with ::WIMLIB_ERR_UNSUPPORTED.\n *\n * Note: if mounting is unsupported, wimlib still provides another way to modify\n * a WIM image (wimlib_update_image()).\n */\n\n/**\n * @defgroup G_progress Progress Messages\n *\n * @brief Track the progress of long WIM operations.\n *\n * Library users can provide a progress function which will be called\n * periodically during operations such as extracting a WIM image or writing a\n * WIM image.  A ::WIMStruct can have a progress function of type\n * ::wimlib_progress_func_t associated with it by calling\n * wimlib_register_progress_function() or by opening the ::WIMStruct using\n * wimlib_open_wim_with_progress().  Once this is done, the progress function\n * will be called automatically during many operations, such as\n * wimlib_extract_image() and wimlib_write().\n *\n * Some functions that do not operate directly on a user-provided ::WIMStruct,\n * such as wimlib_join(), also take the progress function directly using an\n * extended version of the function, such as wimlib_join_with_progress().\n *\n * Since wimlib v1.7.0, progress functions are no longer just unidirectional.\n * You can now return ::WIMLIB_PROGRESS_STATUS_ABORT to cause the current\n * operation to be aborted.  wimlib v1.7.0 also added the third argument to\n * ::wimlib_progress_func_t, which is a user-supplied context.\n */\n\n/** @defgroup G_writing_and_overwriting_wims Writing and Overwriting WIMs\n *\n * @brief Create or update an on-disk WIM file.\n *\n * wimlib_write() creates a new on-disk WIM file, whereas wimlib_overwrite()\n * updates an existing WIM file.  See @ref sec_basic_wim_handling_concepts for\n * more information about the API design.\n */\n\n/** @defgroup G_nonstandalone_wims Creating and handling non-standalone WIMs\n *\n * @brief Create and handle non-standalone WIMs, such as split and delta WIMs.\n *\n * A ::WIMStruct backed by an on-disk file normally represents a fully\n * standalone WIM archive.  However, WIM archives can also be arranged in\n * non-standalone ways, such as a set of on-disk files that together form a\n * single \"split WIM\" or \"delta WIM\".  Such arrangements are fully supported by\n * wimlib.  However, as a result, in such cases a ::WIMStruct created from one\n * of these on-disk files initially only partially represents the full WIM and\n * needs to, in effect, be logically combined with other ::WIMStruct's before\n * performing certain operations, such as extracting files with\n * wimlib_extract_image() or wimlib_extract_paths().  This is done by calling\n * wimlib_reference_resource_files() or wimlib_reference_resources().  Note: if\n * you fail to do so, you may see the error code\n * ::WIMLIB_ERR_RESOURCE_NOT_FOUND; this just indicates that data is not\n * available because the appropriate WIM files have not yet been referenced.\n *\n * wimlib_write() can create delta WIMs as well as standalone WIMs, but a\n * specialized function (wimlib_split()) is needed to create a split WIM.\n */\n\n#ifndef _WIMLIB_H\n#define _WIMLIB_H\n\n#include <stdio.h>\n#include <stddef.h>\n#ifndef __cplusplus\n#  if defined(_MSC_VER) && _MSC_VER < 1800 /* VS pre-2013? */\n     typedef unsigned char bool;\n#  else\n#    include <stdbool.h>\n#  endif\n#endif\n#include <stdint.h>\n#include <time.h>\n\n#ifdef _RUFUS\n#include \"msapi_utf8.h\"\n#endif\n\n#ifdef BUILDING_WIMLIB\n  /*\n   * On i386, gcc assumes that the stack is 16-byte aligned at function entry.\n   * However, some compilers (e.g. MSVC) and programming languages (e.g. Delphi)\n   * only guarantee 4-byte alignment when calling functions.  This is mainly an\n   * issue on Windows, but it can occur on Linux too.  Work around this ABI\n   * incompatibility by realigning the stack pointer when entering the library.\n   * This prevents crashes in SSE/AVX code.\n   */\n#  if defined(__GNUC__) && defined(__i386__)\n#    define WIMLIB_ALIGN_STACK  __attribute__((force_align_arg_pointer))\n#  else\n#    define WIMLIB_ALIGN_STACK\n#  endif\n#  ifdef _WIN32\n#    define WIMLIBAPI __declspec(dllexport) WIMLIB_ALIGN_STACK\n#  else\n#    define WIMLIBAPI __attribute__((visibility(\"default\"))) WIMLIB_ALIGN_STACK\n#  endif\n#else\n#  define WIMLIBAPI\n#endif\n\n/** @addtogroup G_general\n * @{ */\n\n/** Major version of the library (for example, the 1 in 1.2.5).  */\n#define WIMLIB_MAJOR_VERSION 1\n\n/** Minor version of the library (for example, the 2 in 1.2.5). */\n#define WIMLIB_MINOR_VERSION 14\n\n/** Patch version of the library (for example, the 5 in 1.2.5). */\n#define WIMLIB_PATCH_VERSION 4\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * To represent file timestamps, wimlib's API originally used the POSIX 'struct\n * timespec'.  This was a mistake because when building wimlib for 32-bit\n * Windows with MinGW we ended up originally using 32-bit time_t which isn't\n * year 2038-safe, and therefore we had to later add fields like\n * 'creation_time_high' to hold the high 32 bits of each timestamp.  Moreover,\n * old Visual Studio versions did not define struct timespec, while newer ones\n * define it but with 64-bit tv_sec.  So to at least avoid a missing or\n * incompatible 'struct timespec' definition, define the correct struct\n * ourselves when this header is included on Windows.\n */\n#ifdef _WIN32\nstruct wimlib_timespec {\n\t/* Seconds since start of UNIX epoch (January 1, 1970) */\n#ifdef _WIN64\n\tint64_t tv_sec;\n#else\n\tint32_t tv_sec;\n#endif\n\t/* Nanoseconds (0-999999999) */\n\tint32_t tv_nsec;\n};\n#else\n#  define wimlib_timespec  timespec  /* standard definition */\n#endif\n\n/**\n * Opaque structure that represents a WIM, possibly backed by an on-disk file.\n * See @ref sec_basic_wim_handling_concepts for more information.\n */\n#ifndef WIMLIB_WIMSTRUCT_DECLARED\ntypedef struct WIMStruct WIMStruct;\n#define WIMLIB_WIMSTRUCT_DECLARED\n#endif\n\n#ifdef _WIN32\ntypedef wchar_t wimlib_tchar;\n#else\n/** See @ref sec_encodings */\ntypedef char wimlib_tchar;\n#endif\n\n#ifdef _WIN32\n/** Path separator for WIM paths passed back to progress callbacks.\n * This is forward slash on UNIX and backslash on Windows.  */\n#  define WIMLIB_WIM_PATH_SEPARATOR '\\\\'\n#  define WIMLIB_WIM_PATH_SEPARATOR_STRING L\"\\\\\"\n#else\n/** Path separator for WIM paths passed back to progress callbacks.\n * This is forward slash on UNIX and backslash on Windows.  */\n#  define WIMLIB_WIM_PATH_SEPARATOR '/'\n#  define WIMLIB_WIM_PATH_SEPARATOR_STRING \"/\"\n#endif\n\n/** A string containing a single path separator; use this to specify the root\n * directory of a WIM image.  */\n#define WIMLIB_WIM_ROOT_PATH WIMLIB_WIM_PATH_SEPARATOR_STRING\n\n/** Use this to test if the specified path refers to the root directory of the\n * WIM image.  */\n#define WIMLIB_IS_WIM_ROOT_PATH(path) \\\n\t\t((path)[0] == WIMLIB_WIM_PATH_SEPARATOR &&\t\\\n\t\t (path)[1] == 0)\n\n/** Length of a Globally Unique Identifier (GUID), in bytes.  */\n#define WIMLIB_GUID_LEN 16\n\n/**\n * Specifies a compression type.\n *\n * A WIM file has a default compression type, indicated by its file header.\n * Normally, each resource in the WIM file is compressed with this compression\n * type.  However, resources may be stored as uncompressed; for example, wimlib\n * may do so if a resource does not compress to less than its original size.  In\n * addition, a WIM with the new version number of 3584, or \"ESD file\", might\n * contain solid resources with different compression types.\n */\nenum wimlib_compression_type {\n\t/**\n\t * No compression.\n\t *\n\t * This is a valid argument to wimlib_create_new_wim() and\n\t * wimlib_set_output_compression_type(), but not to the functions in the\n\t * compression API such as wimlib_create_compressor().\n\t */\n\tWIMLIB_COMPRESSION_TYPE_NONE = 0,\n\n\t/**\n\t * The XPRESS compression format.  This format combines Lempel-Ziv\n\t * factorization with Huffman encoding.  Compression and decompression\n\t * are both fast.  This format supports chunk sizes that are powers of 2\n\t * between <c>2^12</c> and <c>2^16</c>, inclusively.\n\t *\n\t * wimlib's XPRESS compressor will, with the default settings, usually\n\t * produce a better compression ratio, and work more quickly, than the\n\t * implementation in Microsoft's WIMGAPI (as of Windows 8.1).\n\t * Non-default compression levels are also supported.  For example,\n\t * level 80 will enable two-pass optimal parsing, which is significantly\n\t * slower but usually improves compression by several percent over the\n\t * default level of 50.\n\t *\n\t * If using wimlib_create_compressor() to create an XPRESS compressor\n\t * directly, the @p max_block_size parameter may be any positive value\n\t * up to and including <c>2^16</c>.\n\t */\n\tWIMLIB_COMPRESSION_TYPE_XPRESS = 1,\n\n\t/**\n\t * The LZX compression format.  This format combines Lempel-Ziv\n\t * factorization with Huffman encoding, but with more features and\n\t * complexity than XPRESS.  Compression is slow to somewhat fast,\n\t * depending on the settings.  Decompression is fast but slower than\n\t * XPRESS.  This format supports chunk sizes that are powers of 2\n\t * between <c>2^15</c> and <c>2^21</c>, inclusively.  Note: chunk sizes\n\t * other than <c>2^15</c> are not compatible with the Microsoft\n\t * implementation.\n\t *\n\t * wimlib's LZX compressor will, with the default settings, usually\n\t * produce a better compression ratio, and work more quickly, than the\n\t * implementation in Microsoft's WIMGAPI (as of Windows 8.1).\n\t * Non-default compression levels are also supported.  For example,\n\t * level 20 will provide fast compression, almost as fast as XPRESS.\n\t *\n\t * If using wimlib_create_compressor() to create an LZX compressor\n\t * directly, the @p max_block_size parameter may be any positive value\n\t * up to and including <c>2^21</c>.\n\t */\n\tWIMLIB_COMPRESSION_TYPE_LZX = 2,\n\n\t/**\n\t * The LZMS compression format.  This format combines Lempel-Ziv\n\t * factorization with adaptive Huffman encoding and range coding.\n\t * Compression and decompression are both fairly slow.  This format\n\t * supports chunk sizes that are powers of 2 between <c>2^15</c> and\n\t * <c>2^30</c>, inclusively.  This format is best used for large chunk\n\t * sizes.  Note: LZMS compression is only compatible with wimlib v1.6.0\n\t * and later, WIMGAPI Windows 8 and later, and DISM Windows 8.1 and\n\t * later.  Also, chunk sizes larger than <c>2^26</c> are not compatible\n\t * with the Microsoft implementation.\n\t *\n\t * wimlib's LZMS compressor will, with the default settings, usually\n\t * produce a better compression ratio, and work more quickly, than the\n\t * implementation in Microsoft's WIMGAPI (as of Windows 8.1).  There is\n\t * limited support for non-default compression levels, but compression\n\t * will be noticeably faster if you choose a level < 35.\n\t *\n\t * If using wimlib_create_compressor() to create an LZMS compressor\n\t * directly, the @p max_block_size parameter may be any positive value\n\t * up to and including <c>2^30</c>.\n\t */\n\tWIMLIB_COMPRESSION_TYPE_LZMS = 3,\n};\n\n/** @} */\n/** @addtogroup G_progress\n * @{ */\n\n/** Possible values of the first parameter to the user-supplied\n * ::wimlib_progress_func_t progress function */\nenum wimlib_progress_msg {\n\n\t/** A WIM image is about to be extracted.  @p info will point to\n\t * ::wimlib_progress_info.extract.  This message is received once per\n\t * image for calls to wimlib_extract_image() and\n\t * wimlib_extract_image_from_pipe().  */\n\tWIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN = 0,\n\n\t/** One or more file or directory trees within a WIM image is about to\n\t * be extracted.  @p info will point to ::wimlib_progress_info.extract.\n\t * This message is received only once per wimlib_extract_paths() and\n\t * wimlib_extract_pathlist(), since wimlib combines all paths into a\n\t * single extraction operation for optimization purposes.  */\n\tWIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN = 1,\n\n\t/** This message may be sent periodically (not for every file) while\n\t * files and directories are being created, prior to file data\n\t * extraction.  @p info will point to ::wimlib_progress_info.extract.\n\t * In particular, the @p current_file_count and @p end_file_count\n\t * members may be used to track the progress of this phase of\n\t * extraction.  */\n\tWIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE = 3,\n\n\t/** File data is currently being extracted.  @p info will point to\n\t * ::wimlib_progress_info.extract.  This is the main message to track\n\t * the progress of an extraction operation.  */\n\tWIMLIB_PROGRESS_MSG_EXTRACT_STREAMS = 4,\n\n\t/** Starting to read a new part of a split pipable WIM over the pipe.\n\t * @p info will point to ::wimlib_progress_info.extract.  */\n\tWIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN = 5,\n\n\t/** This message may be sent periodically (not necessarily for every\n\t * file) while file and directory metadata is being extracted, following\n\t * file data extraction.  @p info will point to\n\t * ::wimlib_progress_info.extract.  The @p current_file_count and @p\n\t * end_file_count members may be used to track the progress of this\n\t * phase of extraction.  */\n\tWIMLIB_PROGRESS_MSG_EXTRACT_METADATA = 6,\n\n\t/** The image has been successfully extracted.  @p info will point to\n\t * ::wimlib_progress_info.extract.  This is paired with\n\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN.  */\n\tWIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END = 7,\n\n\t/** The files or directory trees have been successfully extracted.  @p\n\t * info will point to ::wimlib_progress_info.extract.  This is paired\n\t * with ::WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN.  */\n\tWIMLIB_PROGRESS_MSG_EXTRACT_TREE_END = 8,\n\n\t/** The directory or NTFS volume is about to be scanned for metadata.\n\t * @p info will point to ::wimlib_progress_info.scan.  This message is\n\t * received once per call to wimlib_add_image(), or once per capture\n\t * source passed to wimlib_add_image_multisource(), or once per add\n\t * command passed to wimlib_update_image().  */\n\tWIMLIB_PROGRESS_MSG_SCAN_BEGIN = 9,\n\n\t/** A directory or file has been scanned.  @p info will point to\n\t * ::wimlib_progress_info.scan, and its @p cur_path member will be\n\t * valid.  This message is only sent if ::WIMLIB_ADD_FLAG_VERBOSE has\n\t * been specified.  */\n\tWIMLIB_PROGRESS_MSG_SCAN_DENTRY = 10,\n\n\t/** The directory or NTFS volume has been successfully scanned.  @p info\n\t * will point to ::wimlib_progress_info.scan.  This is paired with a\n\t * previous ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN message, possibly with many\n\t * intervening ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY messages.  */\n\tWIMLIB_PROGRESS_MSG_SCAN_END = 11,\n\n\t/** File data is currently being written to the WIM.  @p info will point\n\t * to ::wimlib_progress_info.write_streams.  This message may be\n\t * received many times while the WIM file is being written or appended\n\t * to with wimlib_write(), wimlib_overwrite(), or wimlib_write_to_fd().\n\t * Since wimlib v1.13.4 it will also be received when a split WIM part\n\t * is being written by wimlib_split().  */\n\tWIMLIB_PROGRESS_MSG_WRITE_STREAMS = 12,\n\n\t/** Per-image metadata is about to be written to the WIM file.  @p info\n\t * will not be valid. */\n\tWIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN = 13,\n\n\t/** The per-image metadata has been written to the WIM file.  @p info\n\t * will not be valid.  This message is paired with a preceding\n\t * ::WIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN message.  */\n\tWIMLIB_PROGRESS_MSG_WRITE_METADATA_END = 14,\n\n\t/** wimlib_overwrite() has successfully renamed the temporary file to\n\t * the original WIM file, thereby committing the changes to the WIM\n\t * file.  @p info will point to ::wimlib_progress_info.rename.  Note:\n\t * this message is not received if wimlib_overwrite() chose to append to\n\t * the WIM file in-place.  */\n\tWIMLIB_PROGRESS_MSG_RENAME = 15,\n\n\t/** The contents of the WIM file are being checked against the integrity\n\t * table.  @p info will point to ::wimlib_progress_info.integrity.  This\n\t * message is only received (and may be received many times) when\n\t * wimlib_open_wim_with_progress() is called with the\n\t * ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY flag.  */\n\tWIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY = 16,\n\n\t/** An integrity table is being calculated for the WIM being written.\n\t * @p info will point to ::wimlib_progress_info.integrity.  This message\n\t * is only received (and may be received many times) when a WIM file is\n\t * being written with the flag ::WIMLIB_WRITE_FLAG_CHECK_INTEGRITY.  */\n\tWIMLIB_PROGRESS_MSG_CALC_INTEGRITY = 17,\n\n\t/** A wimlib_split() operation is in progress, and a new split part is\n\t * about to be started.  @p info will point to\n\t * ::wimlib_progress_info.split.  */\n\tWIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART = 19,\n\n\t/** A wimlib_split() operation is in progress, and a split part has been\n\t * finished. @p info will point to ::wimlib_progress_info.split.  */\n\tWIMLIB_PROGRESS_MSG_SPLIT_END_PART = 20,\n\n\t/** A WIM update command is about to be executed. @p info will point to\n\t * ::wimlib_progress_info.update.  This message is received once per\n\t * update command when wimlib_update_image() is called with the flag\n\t * ::WIMLIB_UPDATE_FLAG_SEND_PROGRESS.  */\n\tWIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND = 21,\n\n\t/** A WIM update command has been executed. @p info will point to\n\t * ::wimlib_progress_info.update.  This message is received once per\n\t * update command when wimlib_update_image() is called with the flag\n\t * ::WIMLIB_UPDATE_FLAG_SEND_PROGRESS.  */\n\tWIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND = 22,\n\n\t/** A file in the image is being replaced as a result of a\n\t * ::wimlib_add_command without ::WIMLIB_ADD_FLAG_NO_REPLACE specified.\n\t * @p info will point to ::wimlib_progress_info.replace.  This is only\n\t * received when ::WIMLIB_ADD_FLAG_VERBOSE is also specified in the add\n\t * command.  */\n\tWIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM = 23,\n\n\t/** An image is being extracted with ::WIMLIB_EXTRACT_FLAG_WIMBOOT, and\n\t * a file is being extracted normally (not as a \"WIMBoot pointer file\")\n\t * due to it matching a pattern in the <c>[PrepopulateList]</c> section\n\t * of the configuration file\n\t * <c>/Windows/System32/WimBootCompress.ini</c> in the WIM image.  @p\n\t * info will point to ::wimlib_progress_info.wimboot_exclude.  */\n\tWIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE = 24,\n\n\t/** Starting to unmount an image.  @p info will point to\n\t * ::wimlib_progress_info.unmount.  */\n\tWIMLIB_PROGRESS_MSG_UNMOUNT_BEGIN = 25,\n\n\t/** wimlib has used a file's data for the last time (including all data\n\t * streams, if it has multiple).  @p info will point to\n\t * ::wimlib_progress_info.done_with_file.  This message is only received\n\t * if ::WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES was provided.  */\n\tWIMLIB_PROGRESS_MSG_DONE_WITH_FILE = 26,\n\n\t/** wimlib_verify_wim() is starting to verify the metadata for an image.\n\t * @p info will point to ::wimlib_progress_info.verify_image.  */\n\tWIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE = 27,\n\n\t/** wimlib_verify_wim() has finished verifying the metadata for an\n\t * image.  @p info will point to ::wimlib_progress_info.verify_image.\n\t */\n\tWIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE = 28,\n\n\t/** wimlib_verify_wim() is verifying file data integrity.  @p info will\n\t * point to ::wimlib_progress_info.verify_streams.  */\n\tWIMLIB_PROGRESS_MSG_VERIFY_STREAMS = 29,\n\n\t/**\n\t * The progress function is being asked whether a file should be\n\t * excluded from capture or not.  @p info will point to\n\t * ::wimlib_progress_info.test_file_exclusion.  This is a bidirectional\n\t * message that allows the progress function to set a flag if the file\n\t * should be excluded.\n\t *\n\t * This message is only received if the flag\n\t * ::WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION is used.  This method for file\n\t * exclusions is independent of the \"capture configuration file\"\n\t * mechanism.\n\t */\n\tWIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION = 30,\n\n\t/**\n\t * An error has occurred and the progress function is being asked\n\t * whether to ignore the error or not.  @p info will point to\n\t * ::wimlib_progress_info.handle_error.  This is a bidirectional\n\t * message.\n\t *\n\t * This message provides a limited capability for applications to\n\t * recover from \"unexpected\" errors (i.e. those with no in-library\n\t * handling policy) arising from the underlying operating system.\n\t * Normally, any such error will cause the library to abort the current\n\t * operation.  By implementing a handler for this message, the\n\t * application can instead choose to ignore a given error.\n\t *\n\t * Currently, only the following types of errors will result in this\n\t * progress message being sent:\n\t *\n\t *\t- Directory tree scan errors, e.g. from wimlib_add_image()\n\t *\t- Most extraction errors; currently restricted to the Windows\n\t *\t  build of the library only.\n\t */\n\tWIMLIB_PROGRESS_MSG_HANDLE_ERROR = 31,\n};\n\n/** Valid return values from user-provided progress functions\n * (::wimlib_progress_func_t).\n *\n * (Note: if an invalid value is returned, ::WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS\n * will be issued.)\n */\nenum wimlib_progress_status {\n\n\t/** The operation should be continued.  This is the normal return value.\n\t */\n\tWIMLIB_PROGRESS_STATUS_CONTINUE\t= 0,\n\n\t/** The operation should be aborted.  This will cause the current\n\t * operation to fail with ::WIMLIB_ERR_ABORTED_BY_PROGRESS.  */\n\tWIMLIB_PROGRESS_STATUS_ABORT\t= 1,\n};\n\n/**\n * A pointer to this union is passed to the user-supplied\n * ::wimlib_progress_func_t progress function.  One (or none) of the structures\n * contained in this union will be applicable for the operation\n * (::wimlib_progress_msg) indicated in the first argument to the progress\n * function. */\nunion wimlib_progress_info {\n\n\t/** Valid on the message ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS.  This is\n\t * the primary message for tracking the progress of writing a WIM file.\n\t */\n\tstruct wimlib_progress_info_write_streams {\n\n\t\t/** An upper bound on the number of bytes of file data that will\n\t\t * be written.  This number is the uncompressed size; the actual\n\t\t * size may be lower due to compression.  In addition, this\n\t\t * number may decrease over time as duplicated file data is\n\t\t * discovered.  */\n\t\tuint64_t total_bytes;\n\n\t\t/** An upper bound on the number of distinct file data \"blobs\"\n\t\t * that will be written.  This will often be similar to the\n\t\t * \"number of files\", but for several reasons (hard links, named\n\t\t * data streams, empty files, etc.) it can be different.  In\n\t\t * addition, this number may decrease over time as duplicated\n\t\t * file data is discovered.  */\n\t\tuint64_t total_streams;\n\n\t\t/** The number of bytes of file data that have been written so\n\t\t * far.  This starts at 0 and ends at @p total_bytes.  This\n\t\t * number is the uncompressed size; the actual size may be lower\n\t\t * due to compression.  See @p completed_compressed_bytes for\n\t\t * the compressed size.  */\n\t\tuint64_t completed_bytes;\n\n\t\t/** The number of distinct file data \"blobs\" that have been\n\t\t * written so far.  This starts at 0 and ends at @p\n\t\t * total_streams.  */\n\t\tuint64_t completed_streams;\n\n\t\t/** The number of threads being used for data compression; or,\n\t\t * if no compression is being performed, this will be 1.  */\n\t\tuint32_t num_threads;\n\n\t\t/** The compression type being used, as one of the\n\t\t * ::wimlib_compression_type constants.  */\n\t\tint32_t\t compression_type;\n\n\t\t/** The number of on-disk WIM files from which file data is\n\t\t * being exported into the output WIM file.  This can be 0, 1,\n\t\t * or more than 1, depending on the situation.  */\n\t\tuint32_t total_parts;\n\n\t\t/** This is currently broken and will always be 0.  */\n\t\tuint32_t completed_parts;\n\n\t\t/** Since wimlib v1.13.4: Like @p completed_bytes, but counts\n\t\t * the compressed size.  */\n\t\tuint64_t completed_compressed_bytes;\n\t} write_streams;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN,\n\t * ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY, and\n\t * ::WIMLIB_PROGRESS_MSG_SCAN_END.  */\n\tstruct wimlib_progress_info_scan {\n\n\t\t/** Top-level directory being scanned; or, when capturing an NTFS\n\t\t * volume with ::WIMLIB_ADD_FLAG_NTFS, this is instead the path\n\t\t * to the file or block device that contains the NTFS volume\n\t\t * being scanned.  */\n\t\tconst wimlib_tchar *source;\n\n\t\t/** Path to the file (or directory) that has been scanned, valid\n\t\t * on ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY.  When capturing an NTFS\n\t\t * volume with ::WIMLIB_ADD_FLAG_NTFS, this path will be\n\t\t * relative to the root of the NTFS volume.  */\n\t\tconst wimlib_tchar *cur_path;\n\n\t\t/** Dentry scan status, valid on\n\t\t * ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY.  */\n\t\tenum {\n\t\t\t/** File looks okay and will be captured.  */\n\t\t\tWIMLIB_SCAN_DENTRY_OK = 0,\n\n\t\t\t/** File is being excluded from capture due to the\n\t\t\t * capture configuration.  */\n\t\t\tWIMLIB_SCAN_DENTRY_EXCLUDED = 1,\n\n\t\t\t/** File is being excluded from capture due to being of\n\t\t\t * an unsupported type.  */\n\t\t\tWIMLIB_SCAN_DENTRY_UNSUPPORTED = 2,\n\n\t\t\t/** The file is an absolute symbolic link or junction\n\t\t\t * that points into the capture directory, and\n\t\t\t * reparse-point fixups are enabled, so its target is\n\t\t\t * being adjusted.  (Reparse point fixups can be\n\t\t\t * disabled with the flag ::WIMLIB_ADD_FLAG_NORPFIX.)\n\t\t\t */\n\t\t\tWIMLIB_SCAN_DENTRY_FIXED_SYMLINK = 3,\n\n\t\t\t/** Reparse-point fixups are enabled, but the file is an\n\t\t\t * absolute symbolic link or junction that does\n\t\t\t * <b>not</b> point into the capture directory, so its\n\t\t\t * target is <b>not</b> being adjusted.  */\n\t\t\tWIMLIB_SCAN_DENTRY_NOT_FIXED_SYMLINK = 4,\n\t\t} status;\n\n\t\tunion {\n\t\t\t/** Target path in the image.  Only valid on messages\n\t\t\t * ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN and\n\t\t\t * ::WIMLIB_PROGRESS_MSG_SCAN_END.  */\n\t\t\tconst wimlib_tchar *wim_target_path;\n\n\t\t\t/** For ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY and a status\n\t\t\t * of @p WIMLIB_SCAN_DENTRY_FIXED_SYMLINK or @p\n\t\t\t * WIMLIB_SCAN_DENTRY_NOT_FIXED_SYMLINK, this is the\n\t\t\t * target of the absolute symbolic link or junction.  */\n\t\t\tconst wimlib_tchar *symlink_target;\n\t\t};\n\n\t\t/** The number of directories scanned so far, not counting\n\t\t * excluded/unsupported files.  */\n\t\tuint64_t num_dirs_scanned;\n\n\t\t/** The number of non-directories scanned so far, not counting\n\t\t * excluded/unsupported files.  */\n\t\tuint64_t num_nondirs_scanned;\n\n\t\t/** The number of bytes of file data detected so far, not\n\t\t * counting excluded/unsupported files.  */\n\t\tuint64_t num_bytes_scanned;\n\t} scan;\n\n\t/** Valid on messages\n\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN,\n\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN,\n\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN,\n\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE,\n\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS,\n\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_METADATA,\n\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_TREE_END, and\n\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END.\n\t *\n\t * Note: most of the time of an extraction operation will be spent\n\t * extracting file data, and the application will receive\n\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS during this time.  Using @p\n\t * completed_bytes and @p total_bytes, the application can calculate a\n\t * percentage complete.  However, there is no way for applications to\n\t * know which file is currently being extracted.  This is by design\n\t * because the best way to complete the extraction operation is not\n\t * necessarily file-by-file.\n\t */\n\tstruct wimlib_progress_info_extract {\n\n\t\t/** The 1-based index of the image from which files are being\n\t\t * extracted.  */\n\t\tuint32_t image;\n\n\t\t/** Extraction flags being used.  */\n\t\tuint32_t extract_flags;\n\n\t\t/** If the ::WIMStruct from which the extraction being performed\n\t\t * has a backing file, then this is an absolute path to that\n\t\t * backing file.  Otherwise, this is @c NULL.  */\n\t\tconst wimlib_tchar *wimfile_name;\n\n\t\t/** Name of the image from which files are being extracted, or\n\t\t * the empty string if the image is unnamed.  */\n\t\tconst wimlib_tchar *image_name;\n\n\t\t/** Path to the directory or NTFS volume to which the files are\n\t\t * being extracted.  */\n\t\tconst wimlib_tchar *target;\n\n\t\t/** Reserved.  */\n\t\tconst wimlib_tchar *reserved;\n\n\t\t/** The number of bytes of file data that will be extracted.  */\n\t\tuint64_t total_bytes;\n\n\t\t/** The number of bytes of file data that have been extracted so\n\t\t * far.  This starts at 0 and ends at @p total_bytes.  */\n\t\tuint64_t completed_bytes;\n\n\t\t/** The number of file streams that will be extracted.  This\n\t\t * will often be similar to the \"number of files\", but for\n\t\t * several reasons (hard links, named data streams, empty files,\n\t\t * etc.) it can be different.  */\n\t\tuint64_t total_streams;\n\n\t\t/** The number of file streams that have been extracted so far.\n\t\t * This starts at 0 and ends at @p total_streams.  */\n\t\tuint64_t completed_streams;\n\n\t\t/** Currently only used for\n\t\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN.  */\n\t\tuint32_t part_number;\n\n\t\t/** Currently only used for\n\t\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN.  */\n\t\tuint32_t total_parts;\n\n\t\t/** Currently only used for\n\t\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN.  */\n\t\tuint8_t guid[WIMLIB_GUID_LEN];\n\n\t\t/** For ::WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE and\n\t\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages, this is the\n\t\t * number of files that have been processed so far.  Once the\n\t\t * corresponding phase of extraction is complete, this value\n\t\t * will be equal to @c end_file_count.  */\n\t\tuint64_t current_file_count;\n\n\t\t/** For ::WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE and\n\t\t * ::WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages, this is\n\t\t * total number of files that will be processed.\n\t\t *\n\t\t * This number is provided for informational purposes only, e.g.\n\t\t * for a progress bar.  This number will not necessarily be\n\t\t * equal to the number of files actually being extracted.  This\n\t\t * is because extraction backends are free to implement an\n\t\t * extraction algorithm that might be more efficient than\n\t\t * processing every file in the \"extract file structure\" and\n\t\t * \"extract file metadata\" phases.  For example, the current\n\t\t * implementation of the UNIX extraction backend will create\n\t\t * files on-demand during the \"extract file data\" phase.\n\t\t * Therefore, when using that particular extraction backend, @p\n\t\t * end_file_count will only include directories and empty files.\n\t\t */\n\t\tuint64_t end_file_count;\n\t} extract;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_RENAME. */\n\tstruct wimlib_progress_info_rename {\n\t\t/** Name of the temporary file that the WIM was written to. */\n\t\tconst wimlib_tchar *from;\n\n\t\t/** Name of the original WIM file to which the temporary file is\n\t\t * being renamed. */\n\t\tconst wimlib_tchar *to;\n\t} rename;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND and\n\t * ::WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND. */\n\tstruct wimlib_progress_info_update {\n\t\t/** Pointer to the update command that will be executed or has\n\t\t * just been executed. */\n\t\tconst struct wimlib_update_command *command;\n\n\t\t/** Number of update commands that have been completed so far.\n\t\t */\n\t\tsize_t completed_commands;\n\n\t\t/** Number of update commands that are being executed as part of\n\t\t * this call to wimlib_update_image(). */\n\t\tsize_t total_commands;\n\t} update;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY and\n\t * ::WIMLIB_PROGRESS_MSG_CALC_INTEGRITY. */\n\tstruct wimlib_progress_info_integrity {\n\n\t\t/** The number of bytes in the WIM file that are covered by\n\t\t * integrity checks.  */\n\t\tuint64_t total_bytes;\n\n\t\t/** The number of bytes that have been checksummed so far.  This\n\t\t * starts at 0 and ends at @p total_bytes.  */\n\t\tuint64_t completed_bytes;\n\n\t\t/** The number of individually checksummed \"chunks\" the\n\t\t * integrity-checked region is divided into.  */\n\t\tuint32_t total_chunks;\n\n\t\t/** The number of chunks that have been checksummed so far.\n\t\t * This starts at 0 and ends at @p total_chunks.  */\n\t\tuint32_t completed_chunks;\n\n\t\t/** The size of each individually checksummed \"chunk\" in the\n\t\t * integrity-checked region.  */\n\t\tuint32_t chunk_size;\n\n\t\t/** For ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY messages, this is\n\t\t * the path to the WIM file being checked.  */\n\t\tconst wimlib_tchar *filename;\n\t} integrity;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART and\n\t * ::WIMLIB_PROGRESS_MSG_SPLIT_END_PART. */\n\tstruct wimlib_progress_info_split {\n\t\t/** Total size of the original WIM's file and metadata resources\n\t\t * (compressed). */\n\t\tuint64_t total_bytes;\n\n\t\t/** Number of bytes of file and metadata resources that have\n\t\t * been copied out of the original WIM so far.  Will be 0\n\t\t * initially, and equal to @p total_bytes at the end. */\n\t\tuint64_t completed_bytes;\n\n\t\t/** Number of the split WIM part that is about to be started\n\t\t * (::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART) or has just been\n\t\t * finished (::WIMLIB_PROGRESS_MSG_SPLIT_END_PART). */\n\t\tunsigned cur_part_number;\n\n\t\t/** Total number of split WIM parts that are being written.  */\n\t\tunsigned total_parts;\n\n\t\t/** Name of the split WIM part that is about to be started\n\t\t * (::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART) or has just been\n\t\t * finished (::WIMLIB_PROGRESS_MSG_SPLIT_END_PART).  Since\n\t\t * wimlib v1.7.0, the library user may change this when\n\t\t * receiving ::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART in order to\n\t\t * cause the next split WIM part to be written to a different\n\t\t * location.  */\n\t\twimlib_tchar *part_name;\n\t} split;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM  */\n\tstruct wimlib_progress_info_replace {\n\t\t/** Path to the file in the image that is being replaced  */\n\t\tconst wimlib_tchar *path_in_wim;\n\t} replace;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE  */\n\tstruct wimlib_progress_info_wimboot_exclude {\n\t\t/** Path to the file in the image  */\n\t\tconst wimlib_tchar *path_in_wim;\n\n\t\t/** Path to which the file is being extracted  */\n\t\tconst wimlib_tchar *extraction_path;\n\t} wimboot_exclude;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_UNMOUNT_BEGIN.  */\n\tstruct wimlib_progress_info_unmount {\n\t\t/** Path to directory being unmounted  */\n\t\tconst wimlib_tchar *mountpoint;\n\n\t\t/** Path to WIM file being unmounted  */\n\t\tconst wimlib_tchar *mounted_wim;\n\n\t\t/** 1-based index of image being unmounted.  */\n\t\tuint32_t mounted_image;\n\n\t\t/** Flags that were passed to wimlib_mount_image() when the\n\t\t * mountpoint was set up.  */\n\t\tuint32_t mount_flags;\n\n\t\t/** Flags passed to wimlib_unmount_image().  */\n\t\tuint32_t unmount_flags;\n\t} unmount;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_DONE_WITH_FILE.  */\n\tstruct wimlib_progress_info_done_with_file {\n\t\t/**\n\t\t * Path to the file whose data has been written to the WIM file,\n\t\t * or is currently being asynchronously compressed in memory,\n\t\t * and therefore is no longer needed by wimlib.\n\t\t *\n\t\t * WARNING: The file data will not actually be accessible in the\n\t\t * WIM file until the WIM file has been completely written.\n\t\t * Ordinarily you should <b>not</b> treat this message as a\n\t\t * green light to go ahead and delete the specified file, since\n\t\t * that would result in data loss if the WIM file cannot be\n\t\t * successfully created for any reason.\n\t\t *\n\t\t * If a file has multiple names (hard links),\n\t\t * ::WIMLIB_PROGRESS_MSG_DONE_WITH_FILE will only be received\n\t\t * for one name.  Also, this message will not be received for\n\t\t * empty files or reparse points (or symbolic links), unless\n\t\t * they have nonempty named data streams.\n\t\t */\n\t\tconst wimlib_tchar *path_to_file;\n\t} done_with_file;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE and\n\t * ::WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE.  */\n\tstruct wimlib_progress_info_verify_image {\n\t\tconst wimlib_tchar *wimfile;\n\t\tuint32_t total_images;\n\t\tuint32_t current_image;\n\t} verify_image;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_VERIFY_STREAMS.  */\n\tstruct wimlib_progress_info_verify_streams {\n\t\tconst wimlib_tchar *wimfile;\n\t\tuint64_t total_streams;\n\t\tuint64_t total_bytes;\n\t\tuint64_t completed_streams;\n\t\tuint64_t completed_bytes;\n\t} verify_streams;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION.  */\n\tstruct wimlib_progress_info_test_file_exclusion {\n\n\t\t/**\n\t\t * Path to the file for which exclusion is being tested.\n\t\t *\n\t\t * UNIX capture mode:  The path will be a standard relative or\n\t\t * absolute UNIX filesystem path.\n\t\t *\n\t\t * NTFS-3G capture mode:  The path will be given relative to the\n\t\t * root of the NTFS volume, with a leading slash.\n\t\t *\n\t\t * Windows capture mode:  The path will be a Win32 namespace\n\t\t * path to the file.\n\t\t */\n\t\tconst wimlib_tchar *path;\n\n\t\t/**\n\t\t * Indicates whether the file or directory will be excluded from\n\t\t * capture or not.  This will be <c>false</c> by default.  The\n\t\t * progress function can set this to <c>true</c> if it decides\n\t\t * that the file needs to be excluded.\n\t\t */\n\t\tbool will_exclude;\n\t} test_file_exclusion;\n\n\t/** Valid on messages ::WIMLIB_PROGRESS_MSG_HANDLE_ERROR.  */\n\tstruct wimlib_progress_info_handle_error {\n\n\t\t/** Path to the file for which the error occurred, or NULL if\n\t\t * not relevant.  */\n\t\tconst wimlib_tchar *path;\n\n\t\t/** The wimlib error code associated with the error.  */\n\t\tint error_code;\n\n\t\t/**\n\t\t * Indicates whether the error will be ignored or not.  This\n\t\t * will be <c>false</c> by default; the progress function may\n\t\t * set it to <c>true</c>.\n\t\t */\n\t\tbool will_ignore;\n\t} handle_error;\n};\n\n/**\n * A user-supplied function that will be called periodically during certain WIM\n * operations.\n *\n * The first argument will be the type of operation that is being performed or\n * is about to be started or has been completed.\n *\n * The second argument will be a pointer to one of a number of structures\n * depending on the first argument.  It may be @c NULL for some message types.\n * Note that although this argument is not @c const, users should not modify it\n * except in explicitly documented cases.\n *\n * The third argument will be a user-supplied value that was provided when\n * registering or specifying the progress function.\n *\n * This function must return one of the ::wimlib_progress_status values.  By\n * default, you should return ::WIMLIB_PROGRESS_STATUS_CONTINUE (0).\n */\ntypedef enum wimlib_progress_status\n\t(*wimlib_progress_func_t)(enum wimlib_progress_msg msg_type,\n\t\t\t\t  union wimlib_progress_info *info,\n\t\t\t\t  void *progctx);\n\n/** @} */\n/** @addtogroup G_modifying_wims\n * @{ */\n\n/** An array of these structures is passed to wimlib_add_image_multisource() to\n * specify the sources from which to create a WIM image. */\nstruct wimlib_capture_source {\n\t/** Absolute or relative path to a file or directory on the external\n\t * filesystem to be included in the image. */\n\twimlib_tchar *fs_source_path;\n\n\t/** Destination path in the image.  To specify the root directory of the\n\t * image, use ::WIMLIB_WIM_ROOT_PATH.  */\n\twimlib_tchar *wim_target_path;\n\n\t/** Reserved; set to 0. */\n\tlong reserved;\n};\n\n/** Set or unset the \"readonly\" WIM header flag (<c>WIM_HDR_FLAG_READONLY</c> in\n * Microsoft's documentation), based on the ::wimlib_wim_info.is_marked_readonly\n * member of the @p info parameter.  This is distinct from basic file\n * permissions; this flag can be set on a WIM file that is physically writable.\n *\n * wimlib disallows modifying on-disk WIM files with the readonly flag set.\n * However, wimlib_overwrite() with ::WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG\n * will override this --- and in fact, this is necessary to set the readonly\n * flag persistently on an existing WIM file.\n */\n#define WIMLIB_CHANGE_READONLY_FLAG\t\t0x00000001\n\n/** Set the GUID (globally unique identifier) of the WIM file to the value\n * specified in ::wimlib_wim_info.guid of the @p info parameter. */\n#define WIMLIB_CHANGE_GUID\t\t\t0x00000002\n\n/** Change the bootable image of the WIM to the value specified in\n * ::wimlib_wim_info.boot_index of the @p info parameter.  */\n#define WIMLIB_CHANGE_BOOT_INDEX\t\t0x00000004\n\n/** Change the <c>WIM_HDR_FLAG_RP_FIX</c> flag of the WIM file to the value\n * specified in ::wimlib_wim_info.has_rpfix of the @p info parameter.  This flag\n * generally indicates whether an image in the WIM has been captured with\n * reparse-point fixups enabled.  wimlib also treats this flag as specifying\n * whether to do reparse-point fixups by default when capturing or applying WIM\n * images.  */\n#define WIMLIB_CHANGE_RPFIX_FLAG\t\t0x00000008\n\n/** @} */\n\n/** @addtogroup G_wim_information  */\n\n/** @{ */\n\n/**\n * General information about a WIM file.\n *\n * This info can also be requested for a ::WIMStruct that does not have a\n * backing file.  In this case, fields that only make sense given a backing file\n * are set to default values.\n */\nstruct wimlib_wim_info {\n\n\t/** The globally unique identifier for this WIM.  (Note: all parts of a\n\t * split WIM normally have identical GUIDs.)  */\n\tuint8_t guid[WIMLIB_GUID_LEN];\n\n\t/** The number of images in this WIM file.  */\n\tuint32_t image_count;\n\n\t/** The 1-based index of the bootable image in this WIM file, or 0 if no\n\t * image is bootable.  */\n\tuint32_t boot_index;\n\n\t/** The version of the WIM file format used in this WIM file.  */\n\tuint32_t wim_version;\n\n\t/** The default compression chunk size of resources in this WIM file.\n\t */\n\tuint32_t chunk_size;\n\n\t/** For split WIMs, the 1-based index of this part within the split WIM;\n\t * otherwise 1.  */\n\tuint16_t part_number;\n\n\t/** For split WIMs, the total number of parts in the split WIM;\n\t * otherwise 1.  */\n\tuint16_t total_parts;\n\n\t/** The default compression type of resources in this WIM file, as one\n\t * of the ::wimlib_compression_type constants.  */\n\tint32_t compression_type;\n\n\t/** The size of this WIM file in bytes, excluding the XML data and\n\t * integrity table.  */\n\tuint64_t total_bytes;\n\n\t/** 1 iff this WIM file has an integrity table.  */\n\tuint32_t has_integrity_table : 1;\n\n\t/** 1 iff this info struct is for a ::WIMStruct that has a backing file.\n\t */\n\tuint32_t opened_from_file : 1;\n\n\t/** 1 iff this WIM file is considered readonly for any reason (e.g. the\n\t * \"readonly\" header flag is set, or this is part of a split WIM, or\n\t * filesystem permissions deny writing)  */\n\tuint32_t is_readonly : 1;\n\n\t/** 1 iff the \"reparse point fix\" flag is set in this WIM's header  */\n\tuint32_t has_rpfix : 1;\n\n\t/** 1 iff the \"readonly\" flag is set in this WIM's header  */\n\tuint32_t is_marked_readonly : 1;\n\n\t/** 1 iff the \"spanned\" flag is set in this WIM's header  */\n\tuint32_t spanned : 1;\n\n\t/** 1 iff the \"write in progress\" flag is set in this WIM's header  */\n\tuint32_t write_in_progress : 1;\n\n\t/** 1 iff the \"metadata only\" flag is set in this WIM's header  */\n\tuint32_t metadata_only : 1;\n\n\t/** 1 iff the \"resource only\" flag is set in this WIM's header  */\n\tuint32_t resource_only : 1;\n\n\t/** 1 iff this WIM file is pipable (see ::WIMLIB_WRITE_FLAG_PIPABLE).  */\n\tuint32_t pipable : 1;\n\tuint32_t reserved_flags : 22;\n\tuint32_t reserved[9];\n};\n\n/**\n * Information about a \"blob\", which is a fixed length sequence of binary data.\n * Each nonempty stream of each file in a WIM image is associated with a blob.\n * Blobs are deduplicated within a WIM file.\n *\n * TODO: this struct needs to be renamed, and perhaps made into a union since\n * there are several cases.  I'll try to list them below:\n *\n * 1. The blob is \"missing\", meaning that it is referenced by hash but not\n *    actually present in the WIM file.  In this case we only know the\n *    sha1_hash.  This case can only occur with wimlib_iterate_dir_tree(), never\n *    wimlib_iterate_lookup_table().\n *\n * 2. Otherwise we know the uncompressed_size, the reference_count, and the\n *    is_metadata flag.  In addition:\n *\n *    A. If the blob is located in a non-solid WIM resource, then we also know\n *       the sha1_hash, compressed_size, and offset.\n *\n *    B. If the blob is located in a solid WIM resource, then we also know the\n *       sha1_hash, offset, raw_resource_offset_in_wim,\n *       raw_resource_compressed_size, and raw_resource_uncompressed_size.  But\n *       the \"offset\" is actually the offset in the uncompressed solid resource\n *       rather than the offset from the beginning of the WIM file.\n *\n *    C. If the blob is *not* located in any type of WIM resource, for example\n *       if it's in a external file that was scanned by wimlib_add_image(), then\n *       we usually won't know any more information.  The sha1_hash might be\n *       known, and prior to wimlib v1.13.6 it always was; however, in wimlib\n *       v1.13.6 and later, the sha1_hash might not be known in this case.\n *\n * Unknown or irrelevant fields are left zeroed.\n */\nstruct wimlib_resource_entry {\n\n\t/** If this blob is not missing, then this is the uncompressed size of\n\t * this blob in bytes.  */\n\tuint64_t uncompressed_size;\n\n\t/** If this blob is located in a non-solid WIM resource, then this is\n\t * the compressed size of that resource.  */\n\tuint64_t compressed_size;\n\n\t/** If this blob is located in a non-solid WIM resource, then this is\n\t * the offset of that resource within the WIM file containing it.  If\n\t * this blob is located in a solid WIM resource, then this is the offset\n\t * of this blob within that solid resource when uncompressed.  */\n\tuint64_t offset;\n\n\t/** If this blob is located in a WIM resource, then this is the SHA-1\n\t * message digest of the blob's uncompressed contents.  */\n\tuint8_t sha1_hash[20];\n\n\t/** If this blob is located in a WIM resource, then this is the part\n\t * number of the WIM file containing it.  */\n\tuint32_t part_number;\n\n\t/** If this blob is not missing, then this is the number of times this\n\t * blob is referenced over all images in the WIM.  This number is not\n\t * guaranteed to be correct.  */\n\tuint32_t reference_count;\n\n\t/** 1 iff this blob is located in a non-solid compressed WIM resource.\n\t */\n\tuint32_t is_compressed : 1;\n\n\t/** 1 iff this blob contains the metadata for an image.  */\n\tuint32_t is_metadata : 1;\n\n\tuint32_t is_free : 1;\n\tuint32_t is_spanned : 1;\n\n\t/** 1 iff a blob with this hash was not found in the blob lookup table\n\t * of the ::WIMStruct.  This normally implies a missing call to\n\t * wimlib_reference_resource_files() or wimlib_reference_resources(). */\n\tuint32_t is_missing : 1;\n\n\t/** 1 iff this blob is located in a solid resource.  */\n\tuint32_t packed : 1;\n\n\tuint32_t reserved_flags : 26;\n\n\t/** If this blob is located in a solid WIM resource, then this is the\n\t * offset of that solid resource within the WIM file containing it.  */\n\tuint64_t raw_resource_offset_in_wim;\n\n\t/** If this blob is located in a solid WIM resource, then this is the\n\t * compressed size of that solid resource.  */\n\tuint64_t raw_resource_compressed_size;\n\n\t/** If this blob is located in a solid WIM resource, then this is the\n\t * uncompressed size of that solid resource.  */\n\tuint64_t raw_resource_uncompressed_size;\n\n\tuint64_t reserved[1];\n};\n\n/**\n * Information about a stream of a particular file in the WIM.\n *\n * Normally, only WIM images captured from NTFS filesystems will have multiple\n * streams per file.  In practice, this is a rarely used feature of the\n * filesystem.\n *\n * TODO: the library now explicitly tracks stream types, which allows it to have\n * multiple unnamed streams (e.g. both a reparse point stream and unnamed data\n * stream).  However, this isn't yet exposed by wimlib_iterate_dir_tree().\n */\nstruct wimlib_stream_entry {\n\n\t/** Name of the stream, or NULL if the stream is unnamed.  */\n\tconst wimlib_tchar *stream_name;\n\n\t/** Info about this stream's data, such as its hash and size if known.*/\n\tstruct wimlib_resource_entry resource;\n\n\tuint64_t reserved[4];\n};\n\n/**\n * Since wimlib v1.9.1: an object ID, which is an extra piece of metadata that\n * may be associated with a file on NTFS filesystems.  See:\n * https://msdn.microsoft.com/en-us/library/windows/desktop/aa363997(v=vs.85).aspx\n */\nstruct wimlib_object_id {\n\tuint8_t object_id[WIMLIB_GUID_LEN];\n\tuint8_t birth_volume_id[WIMLIB_GUID_LEN];\n\tuint8_t birth_object_id[WIMLIB_GUID_LEN];\n\tuint8_t domain_id[WIMLIB_GUID_LEN];\n};\n\n/** Structure passed to the wimlib_iterate_dir_tree() callback function.\n * Roughly, the information about a \"file\" in the WIM image --- but really a\n * directory entry (\"dentry\") because hard links are allowed.  The\n * hard_link_group_id field can be used to distinguish actual file inodes.  */\nstruct wimlib_dir_entry {\n\t/** Name of the file, or NULL if this file is unnamed.  Only the root\n\t * directory of an image will be unnamed.  */\n\tconst wimlib_tchar *filename;\n\n\t/** 8.3 name (or \"DOS name\", or \"short name\") of this file; or NULL if\n\t * this file has no such name.  */\n\tconst wimlib_tchar *dos_name;\n\n\t/** Full path to this file within the image.  Path separators will be\n\t * ::WIMLIB_WIM_PATH_SEPARATOR.  */\n\tconst wimlib_tchar *full_path;\n\n\t/** Depth of this directory entry, where 0 is the root, 1 is the root's\n\t * children, ..., etc. */\n\tsize_t depth;\n\n\t/** Pointer to the security descriptor for this file, in Windows\n\t * SECURITY_DESCRIPTOR_RELATIVE format, or NULL if this file has no\n\t * security descriptor.  */\n\tconst char *security_descriptor;\n\n\t/** Size of the above security descriptor, in bytes.  */\n\tsize_t security_descriptor_size;\n\n#define WIMLIB_FILE_ATTRIBUTE_READONLY            0x00000001\n#define WIMLIB_FILE_ATTRIBUTE_HIDDEN              0x00000002\n#define WIMLIB_FILE_ATTRIBUTE_SYSTEM              0x00000004\n#define WIMLIB_FILE_ATTRIBUTE_DIRECTORY           0x00000010\n#define WIMLIB_FILE_ATTRIBUTE_ARCHIVE             0x00000020\n#define WIMLIB_FILE_ATTRIBUTE_DEVICE              0x00000040\n#define WIMLIB_FILE_ATTRIBUTE_NORMAL              0x00000080\n#define WIMLIB_FILE_ATTRIBUTE_TEMPORARY           0x00000100\n#define WIMLIB_FILE_ATTRIBUTE_SPARSE_FILE         0x00000200\n#define WIMLIB_FILE_ATTRIBUTE_REPARSE_POINT       0x00000400\n#define WIMLIB_FILE_ATTRIBUTE_COMPRESSED          0x00000800\n#define WIMLIB_FILE_ATTRIBUTE_OFFLINE             0x00001000\n#define WIMLIB_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000\n#define WIMLIB_FILE_ATTRIBUTE_ENCRYPTED           0x00004000\n#define WIMLIB_FILE_ATTRIBUTE_VIRTUAL             0x00010000\n\t/** File attributes, such as whether the file is a directory or not.\n\t * These are the \"standard\" Windows FILE_ATTRIBUTE_* values, although in\n\t * wimlib.h they are defined as WIMLIB_FILE_ATTRIBUTE_* for convenience\n\t * on other platforms.  */\n\tuint32_t attributes;\n\n#define WIMLIB_REPARSE_TAG_RESERVED_ZERO\t0x00000000\n#define WIMLIB_REPARSE_TAG_RESERVED_ONE\t\t0x00000001\n#define WIMLIB_REPARSE_TAG_MOUNT_POINT\t\t0xA0000003\n#define WIMLIB_REPARSE_TAG_HSM\t\t\t0xC0000004\n#define WIMLIB_REPARSE_TAG_HSM2\t\t\t0x80000006\n#define WIMLIB_REPARSE_TAG_DRIVER_EXTENDER\t0x80000005\n#define WIMLIB_REPARSE_TAG_SIS\t\t\t0x80000007\n#define WIMLIB_REPARSE_TAG_DFS\t\t\t0x8000000A\n#define WIMLIB_REPARSE_TAG_DFSR\t\t\t0x80000012\n#define WIMLIB_REPARSE_TAG_FILTER_MANAGER\t0x8000000B\n#define WIMLIB_REPARSE_TAG_WOF\t\t\t0x80000017\n#define WIMLIB_REPARSE_TAG_SYMLINK\t\t0xA000000C\n\t/** If the file is a reparse point (FILE_ATTRIBUTE_REPARSE_POINT set in\n\t * the attributes), this will give the reparse tag.  This tells you\n\t * whether the reparse point is a symbolic link, junction point, or some\n\t * other, more unusual kind of reparse point.  */\n\tuint32_t reparse_tag;\n\n\t/** Number of links to this file's inode (hard links).\n\t *\n\t * Currently, this will always be 1 for directories.  However, it can be\n\t * greater than 1 for nondirectory files.  */\n\tuint32_t num_links;\n\n\t/** Number of named data streams this file has.  Normally 0.  */\n\tuint32_t num_named_streams;\n\n\t/** A unique identifier for this file's inode.  However, as a special\n\t * case, if the inode only has a single link (@p num_links == 1), this\n\t * value may be 0.\n\t *\n\t * Note: if a WIM image is captured from a filesystem, this value is not\n\t * guaranteed to be the same as the original number of the inode on the\n\t * filesystem.  */\n\tuint64_t hard_link_group_id;\n\n\t/** Time this file was created.  */\n\tstruct wimlib_timespec creation_time;\n\n\t/** Time this file was last written to.  */\n\tstruct wimlib_timespec last_write_time;\n\n\t/** Time this file was last accessed.  */\n\tstruct wimlib_timespec last_access_time;\n\n\t/** The UNIX user ID of this file.  This is a wimlib extension.\n\t *\n\t * This field is only valid if @p unix_mode != 0.  */\n\tuint32_t unix_uid;\n\n\t/** The UNIX group ID of this file.  This is a wimlib extension.\n\t *\n\t * This field is only valid if @p unix_mode != 0.  */\n\tuint32_t unix_gid;\n\n\t/** The UNIX mode of this file.  This is a wimlib extension.\n\t *\n\t * If this field is 0, then @p unix_uid, @p unix_gid, @p unix_mode, and\n\t * @p unix_rdev are all unknown (fields are not present in the WIM\n\t * image).  */\n\tuint32_t unix_mode;\n\n\t/** The UNIX device ID (major and minor number) of this file.  This is a\n\t * wimlib extension.\n\t *\n\t * This field is only valid if @p unix_mode != 0.  */\n\tuint32_t unix_rdev;\n\n\t/* The object ID of this file, if any.  Only valid if\n\t * object_id.object_id is not all zeroes.  */\n\tstruct wimlib_object_id object_id;\n\n\t/** High 32 bits of the seconds portion of the creation timestamp,\n\t * filled in if @p wimlib_timespec.tv_sec is only 32-bit. */\n\tint32_t creation_time_high;\n\n\t/** High 32 bits of the seconds portion of the last write timestamp,\n\t * filled in if @p wimlib_timespec.tv_sec is only 32-bit. */\n\tint32_t last_write_time_high;\n\n\t/** High 32 bits of the seconds portion of the last access timestamp,\n\t * filled in if @p wimlib_timespec.tv_sec is only 32-bit. */\n\tint32_t last_access_time_high;\n\n\tint32_t reserved2;\n\n\tuint64_t reserved[4];\n\n\t/**\n\t * Variable-length array of streams that make up this file.\n\t *\n\t * The first entry will always exist and will correspond to the unnamed\n\t * data stream (default file contents), so it will have <c>stream_name\n\t * == NULL</c>.  Alternatively, for reparse point files, the first entry\n\t * will correspond to the reparse data stream.  Alternatively, for\n\t * encrypted files, the first entry will correspond to the encrypted\n\t * data.\n\t *\n\t * Then, following the first entry, there be @p num_named_streams\n\t * additional entries that specify the named data streams, if any, each\n\t * of which will have <c>stream_name != NULL</c>.\n\t */\n\tstruct wimlib_stream_entry streams[];\n};\n\n/**\n * Type of a callback function to wimlib_iterate_dir_tree().  Must return 0 on\n * success.\n */\ntypedef int (*wimlib_iterate_dir_tree_callback_t)(const struct wimlib_dir_entry *dentry,\n\t\t\t\t\t\t  void *user_ctx);\n\n/**\n * Type of a callback function to wimlib_iterate_lookup_table().  Must return 0\n * on success.\n */\ntypedef int (*wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resource_entry *resource,\n\t\t\t\t\t\t      void *user_ctx);\n\n/** For wimlib_iterate_dir_tree(): Iterate recursively on children rather than\n * just on the specified path. */\n#define WIMLIB_ITERATE_DIR_TREE_FLAG_RECURSIVE 0x00000001\n\n/** For wimlib_iterate_dir_tree(): Don't iterate on the file or directory\n * itself; only its children (in the case of a non-empty directory) */\n#define WIMLIB_ITERATE_DIR_TREE_FLAG_CHILDREN  0x00000002\n\n/** Return ::WIMLIB_ERR_RESOURCE_NOT_FOUND if any file data blobs needed to fill\n * in the ::wimlib_resource_entry's for the iteration cannot be found in the\n * blob lookup table of the ::WIMStruct.  The default behavior without this flag\n * is to fill in the @ref wimlib_resource_entry::sha1_hash \"sha1_hash\" and set\n * the @ref wimlib_resource_entry::is_missing \"is_missing\" flag.  */\n#define WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED  0x00000004\n\n\n/** @} */\n/** @addtogroup G_modifying_wims\n * @{ */\n\n/** UNIX-like systems only: Directly capture an NTFS volume rather than a\n * generic directory.  This requires that wimlib was compiled with support for\n * libntfs-3g.\n *\n * This flag cannot be combined with ::WIMLIB_ADD_FLAG_DEREFERENCE or\n * ::WIMLIB_ADD_FLAG_UNIX_DATA.\n *\n * Do not use this flag on Windows, where wimlib already supports all\n * Windows-native filesystems, including NTFS, through the Windows APIs.  */\n#define WIMLIB_ADD_FLAG_NTFS\t\t\t0x00000001\n\n/** Follow symbolic links when scanning the directory tree.  Currently only\n * supported on UNIX-like systems.  */\n#define WIMLIB_ADD_FLAG_DEREFERENCE\t\t0x00000002\n\n/** Call the progress function with the message\n * ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY when each directory or file has been\n * scanned.  */\n#define WIMLIB_ADD_FLAG_VERBOSE\t\t\t0x00000004\n\n/** Mark the image being added as the bootable image of the WIM.  This flag is\n * valid only for wimlib_add_image() and wimlib_add_image_multisource().\n *\n * Note that you can also change the bootable image of a WIM using\n * wimlib_set_wim_info().\n *\n * Note: ::WIMLIB_ADD_FLAG_BOOT does something different from, and independent\n * from, ::WIMLIB_ADD_FLAG_WIMBOOT.  */\n#define WIMLIB_ADD_FLAG_BOOT\t\t\t0x00000008\n\n/** UNIX-like systems only: Store the UNIX owner, group, mode, and device ID\n * (major and minor number) of each file.  In addition, capture special files\n * such as device nodes and FIFOs.  Since wimlib v1.11.0, on Linux also capture\n * extended attributes.  See the documentation for the <b>--unix-data</b> option\n * to <b>wimcapture</b> for more information.  */\n#define WIMLIB_ADD_FLAG_UNIX_DATA\t\t0x00000010\n\n/** Do not capture security descriptors.  Only has an effect in NTFS-3G capture\n * mode, or in Windows native builds.  */\n#define WIMLIB_ADD_FLAG_NO_ACLS\t\t\t0x00000020\n\n/** Fail immediately if the full security descriptor of any file or directory\n * cannot be accessed.  Only has an effect in Windows native builds.  The\n * default behavior without this flag is to first try omitting the SACL from the\n * security descriptor, then to try omitting the security descriptor entirely.\n */\n#define WIMLIB_ADD_FLAG_STRICT_ACLS\t\t0x00000040\n\n/** Call the progress function with the message\n * ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY when a directory or file is excluded from\n * capture.  This is a subset of the messages provided by\n * ::WIMLIB_ADD_FLAG_VERBOSE.  */\n#define WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE\t\t0x00000080\n\n/** Reparse-point fixups:  Modify absolute symbolic links (and junctions, in the\n * case of Windows) that point inside the directory being captured to instead be\n * absolute relative to the directory being captured.\n *\n * Without this flag, the default is to do reparse-point fixups if\n * <c>WIM_HDR_FLAG_RP_FIX</c> is set in the WIM header or if this is the first\n * image being added.  */\n#define WIMLIB_ADD_FLAG_RPFIX\t\t\t0x00000100\n\n/** Don't do reparse point fixups.  See ::WIMLIB_ADD_FLAG_RPFIX.  */\n#define WIMLIB_ADD_FLAG_NORPFIX\t\t\t0x00000200\n\n/** Do not automatically exclude unsupported files or directories from capture,\n * such as encrypted files in NTFS-3G capture mode, or device files and FIFOs on\n * UNIX-like systems when not also using ::WIMLIB_ADD_FLAG_UNIX_DATA.  Instead,\n * fail with ::WIMLIB_ERR_UNSUPPORTED_FILE when such a file is encountered.  */\n#define WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE\t0x00000400\n\n/**\n * Automatically select a capture configuration appropriate for capturing\n * filesystems containing Windows operating systems.  For example,\n * <c>/pagefile.sys</c> and <c>\"/System Volume Information\"</c> will be\n * excluded.\n *\n * When this flag is specified, the corresponding @p config parameter (for\n * wimlib_add_image()) or member (for wimlib_update_image()) must be @c NULL.\n * Otherwise, ::WIMLIB_ERR_INVALID_PARAM will be returned.\n *\n * Note that the default behavior--- that is, when neither\n * ::WIMLIB_ADD_FLAG_WINCONFIG nor ::WIMLIB_ADD_FLAG_WIMBOOT is specified and @p\n * config is @c NULL--- is to use no capture configuration, meaning that no\n * files are excluded from capture.\n */\n#define WIMLIB_ADD_FLAG_WINCONFIG\t\t0x00000800\n\n/**\n * Capture image as \"WIMBoot compatible\".  In addition, if no capture\n * configuration file is explicitly specified use the capture configuration file\n * <c>$SOURCE/Windows/System32/WimBootCompress.ini</c> if it exists, where\n * <c>$SOURCE</c> is the directory being captured; or, if a capture\n * configuration file is explicitly specified, use it and also place it at\n * <c>/Windows/System32/WimBootCompress.ini</c> in the WIM image.\n *\n * This flag does not, by itself, change the compression type or chunk size.\n * Before writing the WIM file, you may wish to set the compression format to\n * be the same as that used by WIMGAPI and DISM:\n *\n * \\code\n *\twimlib_set_output_compression_type(wim, WIMLIB_COMPRESSION_TYPE_XPRESS);\n *\twimlib_set_output_chunk_size(wim, 4096);\n * \\endcode\n *\n * However, \"WIMBoot\" also works with other XPRESS chunk sizes as well as LZX\n * with 32768 byte chunks.\n *\n * Note: ::WIMLIB_ADD_FLAG_WIMBOOT does something different from, and\n * independent from, ::WIMLIB_ADD_FLAG_BOOT.\n *\n * Since wimlib v1.8.3, ::WIMLIB_ADD_FLAG_WIMBOOT also causes offline WIM-backed\n * files to be added as the \"real\" files rather than as their reparse points,\n * provided that their data is already present in the WIM.  This feature can be\n * useful when updating a backing WIM file in an \"offline\" state.\n */\n#define WIMLIB_ADD_FLAG_WIMBOOT\t\t\t0x00001000\n\n/**\n * If the add command involves adding a non-directory file to a location at\n * which there already exists a nondirectory file in the image, issue\n * ::WIMLIB_ERR_INVALID_OVERLAY instead of replacing the file.  This was the\n * default behavior before wimlib v1.7.0.\n */\n#define WIMLIB_ADD_FLAG_NO_REPLACE\t\t0x00002000\n\n/**\n * Send ::WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION messages to the progress\n * function.\n *\n * Note: This method for file exclusions is independent from the capture\n * configuration file mechanism.\n */\n#define WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION\t0x00004000\n\n/**\n * Since wimlib v1.9.0: create a temporary filesystem snapshot of the source\n * directory and add the files from it.  Currently, this option is only\n * supported on Windows, where it uses the Volume Shadow Copy Service (VSS).\n * Using this option, you can create a consistent backup of the system volume of\n * a running Windows system without running into problems with locked files.\n * For the VSS snapshot to be successfully created, your application must be run\n * as an Administrator, and it cannot be run in WoW64 mode (i.e. if Windows is\n * 64-bit, then your application must be 64-bit as well).\n */\n#define WIMLIB_ADD_FLAG_SNAPSHOT\t\t0x00008000\n\n/**\n * Since wimlib v1.9.0: permit the library to discard file paths after the\n * initial scan.  If the application won't use\n * ::WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES while writing the WIM\n * archive, this flag can be used to allow the library to enable optimizations\n * such as opening files by inode number rather than by path.  Currently this\n * only makes a difference on Windows.\n */\n#define WIMLIB_ADD_FLAG_FILE_PATHS_UNNEEDED\t0x00010000\n\n/** @} */\n/** @addtogroup G_modifying_wims\n * @{ */\n\n/** Do not issue an error if the path to delete does not exist. */\n#define WIMLIB_DELETE_FLAG_FORCE\t\t\t0x00000001\n\n/** Delete the file or directory tree recursively; if not specified, an error is\n * issued if the path to delete is a directory. */\n#define WIMLIB_DELETE_FLAG_RECURSIVE\t\t\t0x00000002\n\n/** @} */\n/** @addtogroup G_modifying_wims\n * @{ */\n\n/**\n * If a single image is being exported, mark it bootable in the destination WIM.\n * Alternatively, if ::WIMLIB_ALL_IMAGES is specified as the image to export,\n * the image in the source WIM (if any) that is marked as bootable is also\n * marked as bootable in the destination WIM.\n */\n#define WIMLIB_EXPORT_FLAG_BOOT\t\t\t\t0x00000001\n\n/** Give the exported image(s) no names.  Avoids problems with image name\n * collisions.\n */\n#define WIMLIB_EXPORT_FLAG_NO_NAMES\t\t\t0x00000002\n\n/** Give the exported image(s) no descriptions.  */\n#define WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS\t\t0x00000004\n\n/** This advises the library that the program is finished with the source\n * WIMStruct and will not attempt to access it after the call to\n * wimlib_export_image(), with the exception of the call to wimlib_free().  */\n#define WIMLIB_EXPORT_FLAG_GIFT\t\t\t\t0x00000008\n\n/**\n * Mark each exported image as WIMBoot-compatible.\n *\n * Note: by itself, this does change the destination WIM's compression type, nor\n * does it add the file @c \\\\Windows\\\\System32\\\\WimBootCompress.ini in the WIM\n * image.  Before writing the destination WIM, it's recommended to do something\n * like:\n *\n * \\code\n *\twimlib_set_output_compression_type(wim, WIMLIB_COMPRESSION_TYPE_XPRESS);\n *\twimlib_set_output_chunk_size(wim, 4096);\n *\twimlib_add_tree(wim, image, L\"myconfig.ini\",\n *\t\t\tL\"\\\\Windows\\\\System32\\\\WimBootCompress.ini\", 0);\n * \\endcode\n */\n#define WIMLIB_EXPORT_FLAG_WIMBOOT\t\t\t0x00000010\n\n/** @} */\n/** @addtogroup G_extracting_wims\n * @{ */\n\n/** Extract the image directly to an NTFS volume rather than a generic directory.\n * This mode is only available if wimlib was compiled with libntfs-3g support;\n * if not, ::WIMLIB_ERR_UNSUPPORTED will be returned.  In this mode, the\n * extraction target will be interpreted as the path to an NTFS volume image (as\n * a regular file or block device) rather than a directory.  It will be opened\n * using libntfs-3g, and the image will be extracted to the NTFS filesystem's\n * root directory.  Note: this flag cannot be used when wimlib_extract_image()\n * is called with ::WIMLIB_ALL_IMAGES as the @p image, nor can it be used with\n * wimlib_extract_paths() when passed multiple paths.  */\n#define WIMLIB_EXTRACT_FLAG_NTFS\t\t\t0x00000001\n\n/** Since wimlib v1.13.4: Don't consider corrupted files to be an error.  Just\n * extract them in whatever form we can.  */\n#define WIMLIB_EXTRACT_FLAG_RECOVER_DATA\t\t0x00000002\n\n/** UNIX-like systems only:  Extract UNIX-specific metadata captured with\n * ::WIMLIB_ADD_FLAG_UNIX_DATA.  */\n#define WIMLIB_EXTRACT_FLAG_UNIX_DATA\t\t\t0x00000020\n\n/** Do not extract security descriptors.  This flag cannot be combined with\n * ::WIMLIB_EXTRACT_FLAG_STRICT_ACLS.  */\n#define WIMLIB_EXTRACT_FLAG_NO_ACLS\t\t\t0x00000040\n\n/**\n * Fail immediately if the full security descriptor of any file or directory\n * cannot be set exactly as specified in the WIM image.  On Windows, the default\n * behavior without this flag when wimlib does not have permission to set the\n * correct security descriptor is to fall back to setting the security\n * descriptor with the SACL omitted, then with the DACL omitted, then with the\n * owner omitted, then not at all.  This flag cannot be combined with\n * ::WIMLIB_EXTRACT_FLAG_NO_ACLS.\n */\n#define WIMLIB_EXTRACT_FLAG_STRICT_ACLS\t\t\t0x00000080\n\n/**\n * This is the extraction equivalent to ::WIMLIB_ADD_FLAG_RPFIX.  This forces\n * reparse-point fixups on, so absolute symbolic links or junction points will\n * be fixed to be absolute relative to the actual extraction root.  Reparse-\n * point fixups are done by default for wimlib_extract_image() and\n * wimlib_extract_image_from_pipe() if <c>WIM_HDR_FLAG_RP_FIX</c> is set in the\n * WIM header.  This flag cannot be combined with ::WIMLIB_EXTRACT_FLAG_NORPFIX.\n */\n#define WIMLIB_EXTRACT_FLAG_RPFIX\t\t\t0x00000100\n\n/** Force reparse-point fixups on extraction off, regardless of the state of the\n * WIM_HDR_FLAG_RP_FIX flag in the WIM header.  This flag cannot be combined\n * with ::WIMLIB_EXTRACT_FLAG_RPFIX.  */\n#define WIMLIB_EXTRACT_FLAG_NORPFIX\t\t\t0x00000200\n\n/** For wimlib_extract_paths() and wimlib_extract_pathlist() only:  Extract the\n * paths, each of which must name a regular file, to standard output.  */\n#define WIMLIB_EXTRACT_FLAG_TO_STDOUT\t\t\t0x00000400\n\n/**\n * Instead of ignoring files and directories with names that cannot be\n * represented on the current platform (note: Windows has more restrictions on\n * filenames than POSIX-compliant systems), try to replace characters or append\n * junk to the names so that they can be extracted in some form.\n *\n * Note: this flag is unlikely to have any effect when extracting a WIM image\n * that was captured on Windows.\n */\n#define WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES\t0x00000800\n\n/**\n * On Windows, when there exist two or more files with the same case insensitive\n * name but different case sensitive names, try to extract them all by appending\n * junk to the end of them, rather than arbitrarily extracting only one.\n *\n * Note: this flag is unlikely to have any effect when extracting a WIM image\n * that was captured on Windows.\n */\n#define WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS\t\t0x00001000\n\n/** Do not ignore failure to set timestamps on extracted files.  This flag\n * currently only has an effect when extracting to a directory on UNIX-like\n * systems.  */\n#define WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS\t\t0x00002000\n\n/** Do not ignore failure to set short names on extracted files.  This flag\n * currently only has an effect on Windows.  */\n#define WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES          0x00004000\n\n/** Do not ignore failure to extract symbolic links and junctions due to\n * permissions problems.  This flag currently only has an effect on Windows.  By\n * default, such failures are ignored since the default configuration of Windows\n * only allows the Administrator to create symbolic links.  */\n#define WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS             0x00008000\n\n/**\n * For wimlib_extract_paths() and wimlib_extract_pathlist() only:  Treat the\n * paths to extract as wildcard patterns (\"globs\") which may contain the\n * wildcard characters @c ? and @c *.  The @c ? character matches any\n * non-path-separator character, whereas the @c * character matches zero or more\n * non-path-separator characters.  Consequently, each glob may match zero or\n * more actual paths in the WIM image.\n *\n * By default, if a glob does not match any files, a warning but not an error\n * will be issued.  This is the case even if the glob did not actually contain\n * wildcard characters.  Use ::WIMLIB_EXTRACT_FLAG_STRICT_GLOB to get an error\n * instead.\n */\n#define WIMLIB_EXTRACT_FLAG_GLOB_PATHS\t\t\t0x00040000\n\n/** In combination with ::WIMLIB_EXTRACT_FLAG_GLOB_PATHS, causes an error\n * (::WIMLIB_ERR_PATH_DOES_NOT_EXIST) rather than a warning to be issued when\n * one of the provided globs did not match a file.  */\n#define WIMLIB_EXTRACT_FLAG_STRICT_GLOB\t\t\t0x00080000\n\n/**\n * Do not extract Windows file attributes such as readonly, hidden, etc.\n *\n * This flag has an effect on Windows as well as in the NTFS-3G extraction mode.\n */\n#define WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES\t\t0x00100000\n\n/**\n * For wimlib_extract_paths() and wimlib_extract_pathlist() only:  Do not\n * preserve the directory structure of the archive when extracting --- that is,\n * place each extracted file or directory tree directly in the target directory.\n * The target directory will still be created if it does not already exist.\n */\n#define WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE\t0x00200000\n\n/**\n * Windows only: Extract files as \"pointers\" back to the WIM archive.\n *\n * The effects of this option are fairly complex.  See the documentation for the\n * <b>--wimboot</b> option of <b>wimapply</b> for more information.\n */\n#define WIMLIB_EXTRACT_FLAG_WIMBOOT\t\t\t0x00400000\n\n/**\n * Since wimlib v1.8.2 and Windows-only: compress the extracted files using\n * System Compression, when possible.  This only works on either Windows 10 or\n * later, or on an older Windows to which Microsoft's wofadk.sys driver has been\n * added.  Several different compression formats may be used with System\n * Compression; this particular flag selects the XPRESS compression format with\n * 4096 byte chunks.\n */\n#define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K\t\t0x01000000\n\n/** Like ::WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K, but use XPRESS compression with\n * 8192 byte chunks.  */\n#define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K\t\t0x02000000\n\n/** Like ::WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K, but use XPRESS compression with\n * 16384 byte chunks.  */\n#define WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K\t\t0x04000000\n\n/** Like ::WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K, but use LZX compression with\n * 32768 byte chunks.  */\n#define WIMLIB_EXTRACT_FLAG_COMPACT_LZX\t\t\t0x08000000\n\n/** @} */\n/** @addtogroup G_mounting_wim_images\n * @{ */\n\n/** Mount the WIM image read-write rather than the default of read-only. */\n#define WIMLIB_MOUNT_FLAG_READWRITE\t\t\t0x00000001\n\n/** Enable FUSE debugging by passing the @c -d option to @c fuse_main().  */\n#define WIMLIB_MOUNT_FLAG_DEBUG\t\t\t\t0x00000002\n\n/** Do not allow accessing named data streams in the mounted WIM image.  */\n#define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_NONE\t\t0x00000004\n\n/** Access named data streams in the mounted WIM image through extended file\n * attributes named \"user.X\", where X is the name of a data stream.  This is the\n * default mode.  */\n#define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_XATTR\t0x00000008\n\n/** Access named data streams in the mounted WIM image by specifying the file\n * name, a colon, then the name of the data stream.  */\n#define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_WINDOWS\t0x00000010\n\n/** Support UNIX owners, groups, modes, and special files.  */\n#define WIMLIB_MOUNT_FLAG_UNIX_DATA\t\t\t0x00000020\n\n/** Allow other users to see the mounted filesystem.  This passes the @c\n * allow_other option to fuse_main().  */\n#define WIMLIB_MOUNT_FLAG_ALLOW_OTHER\t\t\t0x00000040\n\n/** @} */\n/** @addtogroup G_creating_and_opening_wims\n * @{ */\n\n/** Verify the WIM contents against the WIM's integrity table, if present.  The\n * integrity table stores checksums for the raw data of the WIM file, divided\n * into fixed size chunks.  Verification will compute checksums and compare them\n * with the stored values.  If there are any mismatches, then\n * ::WIMLIB_ERR_INTEGRITY will be issued.  If the WIM file does not contain an\n * integrity table, then this flag has no effect.  */\n#define WIMLIB_OPEN_FLAG_CHECK_INTEGRITY\t\t0x00000001\n\n/** Issue an error (::WIMLIB_ERR_IS_SPLIT_WIM) if the WIM is part of a split\n * WIM.  Software can provide this flag for convenience if it explicitly does\n * not want to support split WIMs.  */\n#define WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT\t\t\t0x00000002\n\n/** Check if the WIM is writable and issue an error\n * (::WIMLIB_ERR_WIM_IS_READONLY) if it is not.  A WIM is considered writable\n * only if it is writable at the filesystem level, does not have the\n * <c>WIM_HDR_FLAG_READONLY</c> flag set in its header, and is not part of a\n * spanned set.  It is not required to provide this flag before attempting to\n * make changes to the WIM, but with this flag you get an error immediately\n * rather than potentially much later, when wimlib_overwrite() is finally\n * called.  */\n#define WIMLIB_OPEN_FLAG_WRITE_ACCESS\t\t\t0x00000004\n\n/** @} */\n/** @addtogroup G_mounting_wim_images\n * @{ */\n\n/** Provide ::WIMLIB_WRITE_FLAG_CHECK_INTEGRITY when committing the WIM image.\n * Ignored if ::WIMLIB_UNMOUNT_FLAG_COMMIT not also specified.  */\n#define WIMLIB_UNMOUNT_FLAG_CHECK_INTEGRITY\t\t0x00000001\n\n/** Commit changes to the read-write mounted WIM image.\n * If this flag is not specified, changes will be discarded.  */\n#define WIMLIB_UNMOUNT_FLAG_COMMIT\t\t\t0x00000002\n\n/** Provide ::WIMLIB_WRITE_FLAG_REBUILD when committing the WIM image.\n * Ignored if ::WIMLIB_UNMOUNT_FLAG_COMMIT not also specified.  */\n#define WIMLIB_UNMOUNT_FLAG_REBUILD\t\t\t0x00000004\n\n/** Provide ::WIMLIB_WRITE_FLAG_RECOMPRESS when committing the WIM image.\n * Ignored if ::WIMLIB_UNMOUNT_FLAG_COMMIT not also specified.  */\n#define WIMLIB_UNMOUNT_FLAG_RECOMPRESS\t\t\t0x00000008\n\n/**\n * In combination with ::WIMLIB_UNMOUNT_FLAG_COMMIT for a read-write mounted WIM\n * image, forces all file descriptors to the open WIM image to be closed before\n * committing it.\n *\n * Without ::WIMLIB_UNMOUNT_FLAG_COMMIT or with a read-only mounted WIM image,\n * this flag has no effect.\n */\n#define WIMLIB_UNMOUNT_FLAG_FORCE\t\t\t0x00000010\n\n/** In combination with ::WIMLIB_UNMOUNT_FLAG_COMMIT for a read-write mounted\n * WIM image, causes the modified image to be committed to the WIM file as a\n * new, unnamed image appended to the archive.  The original image in the WIM\n * file will be unmodified.  */\n#define WIMLIB_UNMOUNT_FLAG_NEW_IMAGE\t\t\t0x00000020\n\n/** @} */\n/** @addtogroup G_modifying_wims\n * @{ */\n\n/** Send ::WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND and\n * ::WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND messages.  */\n#define WIMLIB_UPDATE_FLAG_SEND_PROGRESS\t\t0x00000001\n\n/** @} */\n/** @addtogroup G_writing_and_overwriting_wims\n * @{ */\n\n/**\n * Include an integrity table in the resulting WIM file.\n *\n * For ::WIMStruct's created with wimlib_open_wim(), the default behavior is to\n * include an integrity table if and only if one was present before.  For\n * ::WIMStruct's created with wimlib_create_new_wim(), the default behavior is\n * to not include an integrity table.\n */\n#define WIMLIB_WRITE_FLAG_CHECK_INTEGRITY\t\t0x00000001\n\n/**\n * Do not include an integrity table in the resulting WIM file.  This is the\n * default behavior, unless the ::WIMStruct was created by opening a WIM with an\n * integrity table.\n */\n#define WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY\t\t0x00000002\n\n/**\n * Write the WIM as \"pipable\".  After writing a WIM with this flag specified,\n * images from it can be applied directly from a pipe using\n * wimlib_extract_image_from_pipe().  See the documentation for the\n * <b>--pipable</b> option of <b>wimcapture</b> for more information.  Beware:\n * WIMs written with this flag will not be compatible with Microsoft's software.\n *\n * For ::WIMStruct's created with wimlib_open_wim(), the default behavior is to\n * write the WIM as pipable if and only if it was pipable before.  For\n * ::WIMStruct's created with wimlib_create_new_wim(), the default behavior is\n * to write the WIM as non-pipable.\n */\n#define WIMLIB_WRITE_FLAG_PIPABLE\t\t\t0x00000004\n\n/**\n * Do not write the WIM as \"pipable\".  This is the default behavior, unless the\n * ::WIMStruct was created by opening a pipable WIM.\n */\n#define WIMLIB_WRITE_FLAG_NOT_PIPABLE\t\t\t0x00000008\n\n/**\n * When writing data to the WIM file, recompress it, even if the data is already\n * available in the desired compressed form (for example, in a WIM file from\n * which an image has been exported using wimlib_export_image()).\n *\n * ::WIMLIB_WRITE_FLAG_RECOMPRESS can be used to recompress with a higher\n * compression ratio for the same compression type and chunk size.  Simply using\n * the default compression settings may suffice for this, especially if the WIM\n * file was created using another program/library that may not use as\n * sophisticated compression algorithms.  Or,\n * wimlib_set_default_compression_level() can be called beforehand to set an\n * even higher compression level than the default.\n *\n * If the WIM contains solid resources, then ::WIMLIB_WRITE_FLAG_RECOMPRESS can\n * be used in combination with ::WIMLIB_WRITE_FLAG_SOLID to prevent any solid\n * resources from being re-used.  Otherwise, solid resources are re-used\n * somewhat more liberally than normal compressed resources.\n *\n * ::WIMLIB_WRITE_FLAG_RECOMPRESS does <b>not</b> cause recompression of data\n * that would not otherwise be written.  For example, a call to\n * wimlib_overwrite() with ::WIMLIB_WRITE_FLAG_RECOMPRESS will not, by itself,\n * cause already-existing data in the WIM file to be recompressed.  To force the\n * WIM file to be fully rebuilt and recompressed, combine\n * ::WIMLIB_WRITE_FLAG_RECOMPRESS with ::WIMLIB_WRITE_FLAG_REBUILD.\n */\n#define WIMLIB_WRITE_FLAG_RECOMPRESS\t\t\t0x00000010\n\n/**\n * Immediately before closing the WIM file, sync its data to disk.\n *\n * This flag forces the function to wait until the data is safely on disk before\n * returning success.  Otherwise, modern operating systems tend to cache data\n * for some time (in some cases, 30+ seconds) before actually writing it to\n * disk, even after reporting to the application that the writes have succeeded.\n *\n * wimlib_overwrite() will set this flag automatically if it decides to\n * overwrite the WIM file via a temporary file instead of in-place.  This is\n * necessary on POSIX systems; it will, for example, avoid problems with delayed\n * allocation on ext4.\n */\n#define WIMLIB_WRITE_FLAG_FSYNC\t\t\t\t0x00000020\n\n/**\n * For wimlib_overwrite(): rebuild the entire WIM file, even if it otherwise\n * could be updated in-place by appending to it.  Any data that existed in the\n * original WIM file but is not actually needed by any of the remaining images\n * will not be included.  This can free up space left over after previous\n * in-place modifications to the WIM file.\n *\n * This flag can be combined with ::WIMLIB_WRITE_FLAG_RECOMPRESS to force all\n * data to be recompressed.  Otherwise, compressed data is re-used if possible.\n *\n * wimlib_write() ignores this flag.\n */\n#define WIMLIB_WRITE_FLAG_REBUILD\t\t\t0x00000040\n\n/**\n * For wimlib_overwrite(): override the default behavior after one or more calls\n * to wimlib_delete_image(), which is to rebuild the entire WIM file.  With this\n * flag, only minimal changes to correctly remove the image from the WIM file\n * will be taken.  This can be much faster, but it will result in the WIM file\n * getting larger rather than smaller.\n *\n * wimlib_write() ignores this flag.\n */\n#define WIMLIB_WRITE_FLAG_SOFT_DELETE\t\t\t0x00000080\n\n/**\n * For wimlib_overwrite(), allow overwriting the WIM file even if the readonly\n * flag (<c>WIM_HDR_FLAG_READONLY</c>) is set in the WIM header.  This can be\n * used following a call to wimlib_set_wim_info() with the\n * ::WIMLIB_CHANGE_READONLY_FLAG flag to actually set the readonly flag on the\n * on-disk WIM file.\n *\n * wimlib_write() ignores this flag.\n */\n#define WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG\t\t0x00000100\n\n/**\n * Do not include file data already present in other WIMs.  This flag can be\n * used to write a \"delta\" WIM after the WIM files on which the delta is to be\n * based were referenced with wimlib_reference_resource_files() or\n * wimlib_reference_resources().\n */\n#define WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS\t\t0x00000200\n\n/** Deprecated; this flag should not be used outside of the library itself.  */\n#define WIMLIB_WRITE_FLAG_STREAMS_OK\t\t\t0x00000400\n\n/**\n * For wimlib_write(), retain the WIM's GUID instead of generating a new one.\n *\n * wimlib_overwrite() sets this by default, since the WIM remains, logically,\n * the same file.\n */\n#define WIMLIB_WRITE_FLAG_RETAIN_GUID\t\t\t0x00000800\n\n/**\n * Concatenate files and compress them together, rather than compress each file\n * independently.  This is also known as creating a \"solid archive\".  This tends\n * to produce a better compression ratio at the cost of much slower random\n * access.\n *\n * WIM files created with this flag are only compatible with wimlib v1.6.0 or\n * later, WIMGAPI Windows 8 or later, and DISM Windows 8.1 or later.  WIM files\n * created with this flag use a different version number in their header (3584\n * instead of 68864) and are also called \"ESD files\".\n *\n * Note that providing this flag does not affect the \"append by default\"\n * behavior of wimlib_overwrite().  In other words, wimlib_overwrite() with just\n * ::WIMLIB_WRITE_FLAG_SOLID can be used to append solid-compressed data to a\n * WIM file that originally did not contain any solid-compressed data.  But if\n * you instead want to rebuild and recompress an entire WIM file in solid mode,\n * then also provide ::WIMLIB_WRITE_FLAG_REBUILD and\n * ::WIMLIB_WRITE_FLAG_RECOMPRESS.\n *\n * Currently, new solid resources will, by default, be written using LZMS\n * compression with 64 MiB (67108864 byte) chunks.  Use\n * wimlib_set_output_pack_compression_type() and/or\n * wimlib_set_output_pack_chunk_size() to change this.  This is independent of\n * the WIM's main compression type and chunk size; you can have a WIM that\n * nominally uses LZX compression and 32768 byte chunks but actually contains\n * LZMS-compressed solid resources, for example.  However, if including solid\n * resources, I suggest that you set the WIM's main compression type to LZMS as\n * well, either by creating the WIM with\n * ::wimlib_create_new_wim(::WIMLIB_COMPRESSION_TYPE_LZMS, ...) or by calling\n * ::wimlib_set_output_compression_type(..., ::WIMLIB_COMPRESSION_TYPE_LZMS).\n *\n * This flag will be set by default when writing or overwriting a WIM file that\n * either already contains solid resources, or has had solid resources exported\n * into it and the WIM's main compression type is LZMS.\n */\n#define WIMLIB_WRITE_FLAG_SOLID\t\t\t\t0x00001000\n\n/**\n * Send ::WIMLIB_PROGRESS_MSG_DONE_WITH_FILE messages while writing the WIM\n * file.  This is only needed in the unusual case that the library user needs to\n * know exactly when wimlib has read each file for the last time.\n */\n#define WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES\t0x00002000\n\n/**\n * Do not consider content similarity when arranging file data for solid\n * compression.  Providing this flag will typically worsen the compression\n * ratio, so only provide this flag if you know what you are doing.\n */\n#define WIMLIB_WRITE_FLAG_NO_SOLID_SORT\t\t\t0x00004000\n\n/**\n * Since wimlib v1.8.3 and for wimlib_overwrite() only: <b>unsafely</b> compact\n * the WIM file in-place, without appending.  Existing resources are shifted\n * down to fill holes and new resources are appended as needed.  The WIM file is\n * truncated to its final size, which may shrink the on-disk file.  <b>This\n * operation cannot be safely interrupted.  If the operation is interrupted,\n * then the WIM file will be corrupted, and it may be impossible (or at least\n * very difficult) to recover any data from it.  Users of this flag are expected\n * to know what they are doing and assume responsibility for any data corruption\n * that may result.</b>\n *\n * If the WIM file cannot be compacted in-place because of its structure, its\n * layout, or other requested write parameters, then wimlib_overwrite() fails\n * with ::WIMLIB_ERR_COMPACTION_NOT_POSSIBLE, and the caller may wish to retry\n * the operation without this flag.\n */\n#define WIMLIB_WRITE_FLAG_UNSAFE_COMPACT\t\t0x00008000\n\n/** @} */\n/** @addtogroup G_general\n * @{ */\n\n/** Deprecated; no longer has any effect.  */\n#define WIMLIB_INIT_FLAG_ASSUME_UTF8\t\t\t0x00000001\n\n/** Windows-only: do not attempt to acquire additional privileges (currently\n * SeBackupPrivilege, SeRestorePrivilege, SeSecurityPrivilege,\n * SeTakeOwnershipPrivilege, and SeManageVolumePrivilege) when initializing the\n * library.  This flag is intended for the case where the calling program\n * manages these privileges itself.  Note: by default, no error is issued if\n * privileges cannot be acquired, although related errors may be reported later,\n * depending on if the operations performed actually require additional\n * privileges or not.  */\n#define WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES\t0x00000002\n\n/** Windows only:  If ::WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES not specified,\n * return ::WIMLIB_ERR_INSUFFICIENT_PRIVILEGES if privileges that may be needed\n * to read all possible data and metadata for a capture operation could not be\n * acquired.  Can be combined with ::WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES.\n */\n#define WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES\t0x00000004\n\n/** Windows only:  If ::WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES not specified,\n * return ::WIMLIB_ERR_INSUFFICIENT_PRIVILEGES if privileges that may be needed\n * to restore all possible data and metadata for an apply operation could not be\n * acquired.  Can be combined with ::WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES.\n */\n#define WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES\t0x00000008\n\n/** Default to interpreting WIM paths case sensitively (default on UNIX-like\n * systems).  */\n#define WIMLIB_INIT_FLAG_DEFAULT_CASE_SENSITIVE\t\t0x00000010\n\n/** Default to interpreting WIM paths case insensitively (default on Windows).\n * This does not apply to mounted images.  */\n#define WIMLIB_INIT_FLAG_DEFAULT_CASE_INSENSITIVE\t0x00000020\n\n/** @} */\n/** @addtogroup G_nonstandalone_wims\n * @{ */\n\n/** For wimlib_reference_resource_files(), enable shell-style filename globbing.\n * Ignored by wimlib_reference_resources().  */\n#define WIMLIB_REF_FLAG_GLOB_ENABLE\t\t0x00000001\n\n/** For wimlib_reference_resource_files(), issue an error\n * (::WIMLIB_ERR_GLOB_HAD_NO_MATCHES) if a glob did not match any files.  The\n * default behavior without this flag is to issue no error at that point, but\n * then attempt to open the glob as a literal path, which of course will fail\n * anyway if no file exists at that path.  No effect if\n * ::WIMLIB_REF_FLAG_GLOB_ENABLE is not also specified.  Ignored by\n * wimlib_reference_resources().  */\n#define WIMLIB_REF_FLAG_GLOB_ERR_ON_NOMATCH\t0x00000002\n\n/** @} */\n/** @addtogroup G_modifying_wims\n * @{ */\n\n/** The specific type of update to perform. */\nenum wimlib_update_op {\n\t/** Add a new file or directory tree to the image.  */\n\tWIMLIB_UPDATE_OP_ADD = 0,\n\n\t/** Delete a file or directory tree from the image.  */\n\tWIMLIB_UPDATE_OP_DELETE = 1,\n\n\t/** Rename a file or directory tree in the image.  */\n\tWIMLIB_UPDATE_OP_RENAME = 2,\n};\n\n/** Data for a ::WIMLIB_UPDATE_OP_ADD operation. */\nstruct wimlib_add_command {\n\t/** Filesystem path to the file or directory tree to add.  */\n\twimlib_tchar *fs_source_path;\n\n\t/** Destination path in the image.  To specify the root directory of the\n\t * image, use ::WIMLIB_WIM_ROOT_PATH.  */\n\twimlib_tchar *wim_target_path;\n\n\t/** Path to capture configuration file to use, or @c NULL if not\n\t * specified.  */\n\twimlib_tchar *config_file;\n\n\t/** Bitwise OR of WIMLIB_ADD_FLAG_* flags. */\n\tint add_flags;\n};\n\n/** Data for a ::WIMLIB_UPDATE_OP_DELETE operation. */\nstruct wimlib_delete_command {\n\n\t/** The path to the file or directory within the image to delete.  */\n\twimlib_tchar *wim_path;\n\n\t/** Bitwise OR of WIMLIB_DELETE_FLAG_* flags.  */\n\tint delete_flags;\n};\n\n/** Data for a ::WIMLIB_UPDATE_OP_RENAME operation. */\nstruct wimlib_rename_command {\n\n\t/** The path to the source file or directory within the image.  */\n\twimlib_tchar *wim_source_path;\n\n\t/** The path to the destination file or directory within the image.  */\n\twimlib_tchar *wim_target_path;\n\n\t/** Reserved; set to 0.  */\n\tint rename_flags;\n};\n\n/** Specification of an update to perform on a WIM image. */\nstruct wimlib_update_command {\n\n\tenum wimlib_update_op op;\n\n\tunion {\n\t\tstruct wimlib_add_command add;\n\t\tstruct wimlib_delete_command delete_; /* Underscore is for C++\n\t\t\t\t\t\t\t compatibility.  */\n\t\tstruct wimlib_rename_command rename;\n\t};\n};\n\n/** @} */\n/** @addtogroup G_general\n * @{ */\n\n/**\n * Possible values of the error code returned by many functions in wimlib.\n *\n * See the documentation for each wimlib function to see specifically what error\n * codes can be returned by a given function, and what they mean.\n */\nenum wimlib_error_code {\n\tWIMLIB_ERR_SUCCESS                            = 0,\n\tWIMLIB_ERR_ALREADY_LOCKED                     = 1,\n\tWIMLIB_ERR_DECOMPRESSION                      = 2,\n\tWIMLIB_ERR_FUSE                               = 6,\n\tWIMLIB_ERR_GLOB_HAD_NO_MATCHES                = 8,\n\tWIMLIB_ERR_IMAGE_COUNT                        = 10,\n\tWIMLIB_ERR_IMAGE_NAME_COLLISION               = 11,\n\tWIMLIB_ERR_INSUFFICIENT_PRIVILEGES            = 12,\n\tWIMLIB_ERR_INTEGRITY                          = 13,\n\tWIMLIB_ERR_INVALID_CAPTURE_CONFIG             = 14,\n\tWIMLIB_ERR_INVALID_CHUNK_SIZE                 = 15,\n\tWIMLIB_ERR_INVALID_COMPRESSION_TYPE           = 16,\n\tWIMLIB_ERR_INVALID_HEADER                     = 17,\n\tWIMLIB_ERR_INVALID_IMAGE                      = 18,\n\tWIMLIB_ERR_INVALID_INTEGRITY_TABLE            = 19,\n\tWIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY         = 20,\n\tWIMLIB_ERR_INVALID_METADATA_RESOURCE          = 21,\n\tWIMLIB_ERR_INVALID_OVERLAY                    = 23,\n\tWIMLIB_ERR_INVALID_PARAM                      = 24,\n\tWIMLIB_ERR_INVALID_PART_NUMBER                = 25,\n\tWIMLIB_ERR_INVALID_PIPABLE_WIM                = 26,\n\tWIMLIB_ERR_INVALID_REPARSE_DATA               = 27,\n\tWIMLIB_ERR_INVALID_RESOURCE_HASH              = 28,\n\tWIMLIB_ERR_INVALID_UTF16_STRING               = 30,\n\tWIMLIB_ERR_INVALID_UTF8_STRING                = 31,\n\tWIMLIB_ERR_IS_DIRECTORY                       = 32,\n\tWIMLIB_ERR_IS_SPLIT_WIM                       = 33,\n\tWIMLIB_ERR_LINK                               = 35,\n\tWIMLIB_ERR_METADATA_NOT_FOUND                 = 36,\n\tWIMLIB_ERR_MKDIR                              = 37,\n\tWIMLIB_ERR_MQUEUE                             = 38,\n\tWIMLIB_ERR_NOMEM                              = 39,\n\tWIMLIB_ERR_NOTDIR                             = 40,\n\tWIMLIB_ERR_NOTEMPTY                           = 41,\n\tWIMLIB_ERR_NOT_A_REGULAR_FILE                 = 42,\n\tWIMLIB_ERR_NOT_A_WIM_FILE                     = 43,\n\tWIMLIB_ERR_NOT_PIPABLE                        = 44,\n\tWIMLIB_ERR_NO_FILENAME                        = 45,\n\tWIMLIB_ERR_NTFS_3G                            = 46,\n\tWIMLIB_ERR_OPEN                               = 47,\n\tWIMLIB_ERR_OPENDIR                            = 48,\n\tWIMLIB_ERR_PATH_DOES_NOT_EXIST                = 49,\n\tWIMLIB_ERR_READ                               = 50,\n\tWIMLIB_ERR_READLINK                           = 51,\n\tWIMLIB_ERR_RENAME                             = 52,\n\tWIMLIB_ERR_REPARSE_POINT_FIXUP_FAILED         = 54,\n\tWIMLIB_ERR_RESOURCE_NOT_FOUND                 = 55,\n\tWIMLIB_ERR_RESOURCE_ORDER                     = 56,\n\tWIMLIB_ERR_SET_ATTRIBUTES                     = 57,\n\tWIMLIB_ERR_SET_REPARSE_DATA                   = 58,\n\tWIMLIB_ERR_SET_SECURITY                       = 59,\n\tWIMLIB_ERR_SET_SHORT_NAME                     = 60,\n\tWIMLIB_ERR_SET_TIMESTAMPS                     = 61,\n\tWIMLIB_ERR_SPLIT_INVALID                      = 62,\n\tWIMLIB_ERR_STAT                               = 63,\n\tWIMLIB_ERR_UNEXPECTED_END_OF_FILE             = 65,\n\tWIMLIB_ERR_UNICODE_STRING_NOT_REPRESENTABLE   = 66,\n\tWIMLIB_ERR_UNKNOWN_VERSION                    = 67,\n\tWIMLIB_ERR_UNSUPPORTED                        = 68,\n\tWIMLIB_ERR_UNSUPPORTED_FILE                   = 69,\n\tWIMLIB_ERR_WIM_IS_READONLY                    = 71,\n\tWIMLIB_ERR_WRITE                              = 72,\n\tWIMLIB_ERR_XML                                = 73,\n\tWIMLIB_ERR_WIM_IS_ENCRYPTED                   = 74,\n\tWIMLIB_ERR_WIMBOOT                            = 75,\n\tWIMLIB_ERR_ABORTED_BY_PROGRESS                = 76,\n\tWIMLIB_ERR_UNKNOWN_PROGRESS_STATUS            = 77,\n\tWIMLIB_ERR_MKNOD                              = 78,\n\tWIMLIB_ERR_MOUNTED_IMAGE_IS_BUSY              = 79,\n\tWIMLIB_ERR_NOT_A_MOUNTPOINT                   = 80,\n\tWIMLIB_ERR_NOT_PERMITTED_TO_UNMOUNT           = 81,\n\tWIMLIB_ERR_FVE_LOCKED_VOLUME                  = 82,\n\tWIMLIB_ERR_UNABLE_TO_READ_CAPTURE_CONFIG      = 83,\n\tWIMLIB_ERR_WIM_IS_INCOMPLETE                  = 84,\n\tWIMLIB_ERR_COMPACTION_NOT_POSSIBLE            = 85,\n\tWIMLIB_ERR_IMAGE_HAS_MULTIPLE_REFERENCES      = 86,\n\tWIMLIB_ERR_DUPLICATE_EXPORTED_IMAGE           = 87,\n\tWIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED   = 88,\n\tWIMLIB_ERR_SNAPSHOT_FAILURE                   = 89,\n\tWIMLIB_ERR_INVALID_XATTR                      = 90,\n\tWIMLIB_ERR_SET_XATTR                          = 91,\n};\n\n\n/** Used to indicate no image or an invalid image. */\n#define WIMLIB_NO_IMAGE\t\t0\n\n/** Used to specify all images in the WIM. */\n#define WIMLIB_ALL_IMAGES\t(-1)\n\n/** @}  */\n\n/**\n * @ingroup G_modifying_wims\n *\n * Append an empty image to a ::WIMStruct.\n *\n * The new image will initially contain no files or directories, although if\n * written without further modifications, then a root directory will be created\n * automatically for it.\n *\n * After calling this function, you can use wimlib_update_image() to add files\n * to the new image.  This gives you more control over making the new image\n * compared to calling wimlib_add_image() or wimlib_add_image_multisource().\n *\n * @param wim\n *\tPointer to the ::WIMStruct to which to add the image.\n * @param name\n *\tName to give the new image.  If @c NULL or empty, the new image is given\n *\tno name.  If nonempty, it must specify a name that does not already\n *\texist in @p wim.\n * @param new_idx_ret\n *\tIf non-<c>NULL</c>, the index of the newly added image is returned in\n *\tthis location.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_IMAGE_NAME_COLLISION\n *\tThe WIM already contains an image with the requested name.\n */\nWIMLIBAPI int\nwimlib_add_empty_image(WIMStruct *wim,\n\t\t       const wimlib_tchar *name,\n\t\t       int *new_idx_ret);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Add an image to a ::WIMStruct from an on-disk directory tree or NTFS volume.\n *\n * The directory tree or NTFS volume is scanned immediately to load the dentry\n * tree into memory, and file metadata is read.  However, actual file data may\n * not be read until the ::WIMStruct is persisted to disk using wimlib_write()\n * or wimlib_overwrite().\n *\n * See the documentation for the @b wimlib-imagex program for more information\n * about the \"normal\" capture mode versus the NTFS capture mode (entered by\n * providing the flag ::WIMLIB_ADD_FLAG_NTFS).\n *\n * Note that no changes are committed to disk until wimlib_write() or\n * wimlib_overwrite() is called.\n *\n * @param wim\n *\tPointer to the ::WIMStruct to which to add the image.\n * @param source\n *\tA path to a directory or unmounted NTFS volume that will be captured as\n *\ta WIM image.\n * @param name\n *\tName to give the new image.  If @c NULL or empty, the new image is given\n *\tno name.  If nonempty, it must specify a name that does not already\n *\texist in @p wim.\n * @param config_file\n *\tPath to capture configuration file, or @c NULL.  This file may specify,\n *\tamong other things, which files to exclude from capture.  See the\n *\tdocumentation for <b>wimcapture</b> (<b>--config</b> option) for details\n *\tof the file format.  If @c NULL, the default capture configuration will\n *\tbe used.  Ordinarily, the default capture configuration will result in\n *\tno files being excluded from capture purely based on name; however, the\n *\t::WIMLIB_ADD_FLAG_WINCONFIG and ::WIMLIB_ADD_FLAG_WIMBOOT flags modify\n *\tthe default.\n * @param add_flags\n *\tBitwise OR of flags prefixed with WIMLIB_ADD_FLAG.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * This function is implemented by calling wimlib_add_empty_image(), then\n * calling wimlib_update_image() with a single \"add\" command, so any error code\n * returned by wimlib_add_empty_image() may be returned, as well as any error\n * codes returned by wimlib_update_image() other than ones documented as only\n * being returned specifically by an update involving delete or rename commands.\n *\n * If a progress function is registered with @p wim, then it will receive the\n * messages ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN and ::WIMLIB_PROGRESS_MSG_SCAN_END.\n * In addition, if ::WIMLIB_ADD_FLAG_VERBOSE is specified in @p add_flags, it\n * will receive ::WIMLIB_PROGRESS_MSG_SCAN_DENTRY.\n */\nWIMLIBAPI int\nwimlib_add_image(WIMStruct *wim,\n\t\t const wimlib_tchar *source,\n\t\t const wimlib_tchar *name,\n\t\t const wimlib_tchar *config_file,\n\t\t int add_flags);\n\n/**\n * @ingroup G_modifying_wims\n *\n * This function is equivalent to wimlib_add_image() except it allows for\n * multiple sources to be combined into a single WIM image.  This is done by\n * specifying the @p sources and @p num_sources parameters instead of the @p\n * source parameter of wimlib_add_image().  The rest of the parameters are the\n * same as wimlib_add_image().  See the documentation for <b>wimcapture</b> for\n * full details on how this mode works.\n */\nWIMLIBAPI int\nwimlib_add_image_multisource(WIMStruct *wim,\n\t\t\t     const struct wimlib_capture_source *sources,\n\t\t\t     size_t num_sources,\n\t\t\t     const wimlib_tchar *name,\n\t\t\t     const wimlib_tchar *config_file,\n\t\t\t     int add_flags);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Add the file or directory tree at @p fs_source_path on the filesystem to the\n * location @p wim_target_path within the specified @p image of the @p wim.\n *\n * This just builds an appropriate ::wimlib_add_command and passes it to\n * wimlib_update_image().\n */\nWIMLIBAPI int\nwimlib_add_tree(WIMStruct *wim, int image,\n\t\tconst wimlib_tchar *fs_source_path,\n\t\tconst wimlib_tchar *wim_target_path, int add_flags);\n\n#ifdef _RUFUS\nstatic __inline int\nwimlib_add_treeU(WIMStruct *wim, int image,\n\t\tconst char *fs_source_path,\n\t\tconst char *wim_target_path, int add_flags)\n{\n\tint r;\n\twconvert(fs_source_path);\n\twconvert(wim_target_path);\n\tr = wimlib_add_tree(wim, image, wfs_source_path, wwim_target_path, add_flags);\n\twfree(fs_source_path);\n\twfree(wim_target_path);\n\treturn r;\n}\n#endif\n\n/**\n * @ingroup G_creating_and_opening_wims\n *\n * Create a ::WIMStruct which initially contains no images and is not backed by\n * an on-disk file.\n *\n * @param ctype\n *\tThe \"output compression type\" to assign to the ::WIMStruct.  This is the\n *\tcompression type that will be used if the ::WIMStruct is later persisted\n *\tto an on-disk file using wimlib_write().\n *\t<br/>\n *\tThis choice is not necessarily final.  If desired, it can still be\n *\tchanged at any time before wimlib_write() is called, using\n *\twimlib_set_output_compression_type().  In addition, if you wish to use a\n *\tnon-default compression chunk size, then you will need to call\n *\twimlib_set_output_chunk_size().\n * @param wim_ret\n *\tOn success, a pointer to the new ::WIMStruct is written to the memory\n *\tlocation pointed to by this parameter.  This ::WIMStruct must be freed\n *\tusing wimlib_free() when finished with it.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE\n *\t@p ctype was not a supported compression type.\n * @retval ::WIMLIB_ERR_NOMEM\n *\tInsufficient memory to allocate a new ::WIMStruct.\n */\nWIMLIBAPI int\nwimlib_create_new_wim(enum wimlib_compression_type ctype, WIMStruct **wim_ret);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Delete an image, or all images, from a ::WIMStruct.\n *\n * Note that no changes are committed to disk until wimlib_write() or\n * wimlib_overwrite() is called.\n *\n * @param wim\n *\tPointer to the ::WIMStruct from which to delete the image.\n * @param image\n *\tThe 1-based index of the image to delete, or ::WIMLIB_ALL_IMAGES to\n *\tdelete all images.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_INVALID_IMAGE\n *\t@p image does not exist in the WIM.\n *\n * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION,\n * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND,\n * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which\n * indicate failure (for different reasons) to read the metadata resource for an\n * image that needed to be deleted.\n *\n * If this function fails when @p image was ::WIMLIB_ALL_IMAGES, then it's\n * possible that some but not all of the images were deleted.\n */\nWIMLIBAPI int\nwimlib_delete_image(WIMStruct *wim, int image);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Delete the @p path from the specified @p image of the @p wim.\n *\n * This just builds an appropriate ::wimlib_delete_command and passes it to\n * wimlib_update_image().\n */\nWIMLIBAPI int\nwimlib_delete_path(WIMStruct *wim, int image,\n\t\t   const wimlib_tchar *path, int delete_flags);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Export an image, or all images, from a ::WIMStruct into another ::WIMStruct.\n *\n * Specifically, if the destination ::WIMStruct contains <tt>n</tt> images, then\n * the source image(s) will be appended, in order, starting at destination index\n * <tt>n + 1</tt>.  By default, all image metadata will be exported verbatim,\n * but certain changes can be made by passing appropriate parameters.\n *\n * wimlib_export_image() is only an in-memory operation; no changes are\n * committed to disk until wimlib_write() or wimlib_overwrite() is called.\n *\n * A limitation of the current implementation of wimlib_export_image() is that\n * the directory tree of a source or destination image cannot be updated\n * following an export until one of the two images has been freed from memory.\n *\n * @param src_wim\n *\tThe WIM from which to export the images, specified as a pointer to the\n *\t::WIMStruct for a standalone WIM file, a delta WIM file, or part 1 of a\n *\tsplit WIM.  In the case of a WIM file that is not standalone, this\n *\t::WIMStruct must have had any needed external resources previously\n *\treferenced using wimlib_reference_resources() or\n *\twimlib_reference_resource_files().\n * @param src_image\n *\tThe 1-based index of the image from @p src_wim to export, or\n *\t::WIMLIB_ALL_IMAGES.\n * @param dest_wim\n *\tThe ::WIMStruct to which to export the images.\n * @param dest_name\n *\tFor single-image exports, the name to give the exported image in @p\n *\tdest_wim.  If left @c NULL, the name from @p src_wim is used.  For\n *\t::WIMLIB_ALL_IMAGES exports, this parameter must be left @c NULL; in\n *\tthat case, the names are all taken from @p src_wim.  This parameter is\n *\toverridden by ::WIMLIB_EXPORT_FLAG_NO_NAMES.\n * @param dest_description\n *\tFor single-image exports, the description to give the exported image in\n *\tthe new WIM file.  If left @c NULL, the description from @p src_wim is\n *\tused.  For ::WIMLIB_ALL_IMAGES exports, this parameter must be left @c\n *\tNULL; in that case, the description are all taken from @p src_wim.  This\n *\tparameter is overridden by ::WIMLIB_EXPORT_FLAG_NO_DESCRIPTIONS.\n * @param export_flags\n *\tBitwise OR of flags prefixed with WIMLIB_EXPORT_FLAG.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_DUPLICATE_EXPORTED_IMAGE\n *\tOne or more of the source images had already been exported into the\n *\tdestination WIM.\n * @retval ::WIMLIB_ERR_IMAGE_NAME_COLLISION\n *\tOne or more of the names being given to an exported image was already in\n *\tuse in the destination WIM.\n * @retval ::WIMLIB_ERR_INVALID_IMAGE\n *\t@p src_image does not exist in @p src_wim.\n * @retval ::WIMLIB_ERR_METADATA_NOT_FOUND\n *\tAt least one of @p src_wim and @p dest_wim does not contain image\n *\tmetadata; for example, one of them represents a non-first part of a\n *\tsplit WIM.\n * @retval ::WIMLIB_ERR_RESOURCE_NOT_FOUND\n *\tA file data blob that needed to be exported could not be found in the\n *\tblob lookup table of @p src_wim.  See @ref G_nonstandalone_wims.\n *\n * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION,\n * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND,\n * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which\n * indicate failure (for different reasons) to read the metadata resource for an\n * image in @p src_wim that needed to be exported.\n */\nWIMLIBAPI int\nwimlib_export_image(WIMStruct *src_wim, int src_image,\n\t\t    WIMStruct *dest_wim,\n\t\t    const wimlib_tchar *dest_name,\n\t\t    const wimlib_tchar *dest_description,\n\t\t    int export_flags);\n\n/**\n * @ingroup G_extracting_wims\n *\n * Extract an image, or all images, from a ::WIMStruct.\n *\n * The exact behavior of how wimlib extracts files from a WIM image is\n * controllable by the @p extract_flags parameter, but there also are\n * differences depending on the platform (UNIX-like vs Windows).  See the\n * documentation for <b>wimapply</b> for more information, including about the\n * NTFS-3G extraction mode.\n *\n * @param wim\n *\tThe WIM from which to extract the image(s), specified as a pointer to the\n *\t::WIMStruct for a standalone WIM file, a delta WIM file, or part 1 of a\n *\tsplit WIM.  In the case of a WIM file that is not standalone, this\n *\t::WIMStruct must have had any needed external resources previously\n *\treferenced using wimlib_reference_resources() or\n *\twimlib_reference_resource_files().\n * @param image\n *\tThe 1-based index of the image to extract, or ::WIMLIB_ALL_IMAGES to\n *\textract all images.  Note: ::WIMLIB_ALL_IMAGES is unsupported in NTFS-3G\n *\textraction mode.\n * @param target\n *\tA null-terminated string which names the location to which the image(s)\n *\twill be extracted.  By default, this is interpreted as a path to a\n *\tdirectory.  Alternatively, if ::WIMLIB_EXTRACT_FLAG_NTFS is specified in\n *\t@p extract_flags, then this is interpreted as a path to an unmounted\n *\tNTFS volume.\n * @param extract_flags\n *\tBitwise OR of flags prefixed with WIMLIB_EXTRACT_FLAG.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_DECOMPRESSION\n *\tThe WIM file contains invalid compressed data.\n * @retval ::WIMLIB_ERR_INVALID_IMAGE\n *\t@p image does not exist in @p wim.\n * @retval ::WIMLIB_ERR_INVALID_METADATA_RESOURCE\n *\tThe metadata for an image to extract was invalid.\n * @retval ::WIMLIB_ERR_INVALID_PARAM\n *\tThe extraction flags were invalid; more details may be found in the\n *\tdocumentation for the specific extraction flags that were specified.  Or\n *\t@p target was @c NULL or an empty string, or @p wim was @c NULL.\n * @retval ::WIMLIB_ERR_INVALID_RESOURCE_HASH\n *\tThe data of a file that needed to be extracted was corrupt.\n * @retval ::WIMLIB_ERR_LINK\n *\tFailed to create a symbolic link or a hard link.\n * @retval ::WIMLIB_ERR_METADATA_NOT_FOUND\n *\t@p wim does not contain image metadata; for example, it represents a\n *\tnon-first part of a split WIM.\n * @retval ::WIMLIB_ERR_MKDIR\n *\tFailed create a directory.\n * @retval ::WIMLIB_ERR_NTFS_3G\n *\tlibntfs-3g reported that a problem occurred while writing to the NTFS\n *\tvolume.\n * @retval ::WIMLIB_ERR_OPEN\n *\tCould not create a file, or failed to open an already-extracted file.\n * @retval ::WIMLIB_ERR_READ\n *\tFailed to read data from the WIM.\n * @retval ::WIMLIB_ERR_READLINK\n *\tFailed to determine the target of a symbolic link in the WIM.\n * @retval ::WIMLIB_ERR_REPARSE_POINT_FIXUP_FAILED\n *\tFailed to fix the target of an absolute symbolic link (e.g. if the\n *\ttarget would have exceeded the maximum allowed length).  (Only if\n *\treparse data was supported by the extraction mode and\n *\t::WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS was specified in @p\n *\textract_flags.)\n * @retval ::WIMLIB_ERR_RESOURCE_NOT_FOUND\n *\tA file data blob that needed to be extracted could not be found in the\n *\tblob lookup table of @p wim.  See @ref G_nonstandalone_wims.\n * @retval ::WIMLIB_ERR_SET_ATTRIBUTES\n *\tFailed to set attributes on a file.\n * @retval ::WIMLIB_ERR_SET_REPARSE_DATA\n *\tFailed to set reparse data on a file (only if reparse data was supported\n *\tby the extraction mode).\n * @retval ::WIMLIB_ERR_SET_SECURITY\n *\tFailed to set security descriptor on a file.\n * @retval ::WIMLIB_ERR_SET_SHORT_NAME\n *\tFailed to set the short name of a file.\n * @retval ::WIMLIB_ERR_SET_TIMESTAMPS\n *\tFailed to set timestamps on a file.\n * @retval ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE\n *\tUnexpected end-of-file occurred when reading data from the WIM.\n * @retval ::WIMLIB_ERR_UNSUPPORTED\n *\tA requested extraction flag, or the data or metadata that must be\n *\textracted to support it, is unsupported in the build and configuration\n *\tof wimlib, or on the current platform or extraction mode or target\n *\tvolume.  Flags affected by this include ::WIMLIB_EXTRACT_FLAG_NTFS,\n *\t::WIMLIB_EXTRACT_FLAG_UNIX_DATA, ::WIMLIB_EXTRACT_FLAG_STRICT_ACLS,\n *\t::WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES,\n *\t::WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS, and\n *\t::WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS.  For example, if\n *\t::WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES is specified in @p\n *\textract_flags, ::WIMLIB_ERR_UNSUPPORTED will be returned if the WIM\n *\timage contains one or more files with short names, but extracting short\n *\tnames is not supported --- on Windows, this occurs if the target volume\n *\tdoes not support short names, while on non-Windows, this occurs if\n *\t::WIMLIB_EXTRACT_FLAG_NTFS was not specified in @p extract_flags.\n * @retval ::WIMLIB_ERR_WIMBOOT\n *\t::WIMLIB_EXTRACT_FLAG_WIMBOOT was specified in @p extract_flags, but\n *\tthere was a problem creating WIMBoot pointer files or registering a\n *\tsource WIM file with the Windows Overlay Filesystem (WOF) driver.\n * @retval ::WIMLIB_ERR_WRITE\n *\tFailed to write data to a file being extracted.\n *\n * If a progress function is registered with @p wim, then as each image is\n * extracted it will receive ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN, then\n * zero or more ::WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE messages, then zero\n * or more ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS messages, then zero or more\n * ::WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages, then\n * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END.\n */\nWIMLIBAPI int\nwimlib_extract_image(WIMStruct *wim, int image,\n\t\t     const wimlib_tchar *target, int extract_flags);\n\n#ifdef _RUFUS\nstatic __inline int\nwimlib_extract_imageU(WIMStruct *wim, int image,\n\t\t     const char *target, int extract_flags)\n{\n\tint r;\n\twconvert(target);\n\tr = wimlib_extract_image(wim, image, wtarget, extract_flags);\n\twfree(target);\n\treturn r;\n}\n#endif\n\n/**\n * @ingroup G_extracting_wims\n *\n * Extract one image from a pipe on which a pipable WIM is being sent.\n *\n * See the documentation for ::WIMLIB_WRITE_FLAG_PIPABLE, and @ref\n * subsec_pipable_wims, for more information about pipable WIMs.\n *\n * This function operates in a special way to read the WIM fully sequentially.\n * As a result, there is no ::WIMStruct is made visible to library users, and\n * you cannot call wimlib_open_wim() on the pipe.  (You can, however, use\n * wimlib_open_wim() to transparently open a pipable WIM if it's available as a\n * seekable file, not a pipe.)\n *\n * @param pipe_fd\n *\tFile descriptor, which may be a pipe, opened for reading and positioned\n *\tat the start of the pipable WIM.\n * @param image_num_or_name\n *\tString that specifies the 1-based index or name of the image to extract.\n *\tIt is translated to an image index using the same rules that\n *\twimlib_resolve_image() uses.  However, unlike wimlib_extract_image(),\n *\tonly a single image (not all images) can be specified.  Alternatively,\n *\tspecify @p NULL here to use the first image in the WIM if it contains\n *\texactly one image but otherwise return ::WIMLIB_ERR_INVALID_IMAGE.\n * @param target\n *\tSame as the corresponding parameter to wimlib_extract_image().\n * @param extract_flags\n *\tSame as the corresponding parameter to wimlib_extract_image().\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.  The possible\n * error codes include those returned by wimlib_extract_image() and\n * wimlib_open_wim() as well as the following:\n *\n * @retval ::WIMLIB_ERR_INVALID_PIPABLE_WIM\n *\tData read from the pipable WIM was invalid.\n * @retval ::WIMLIB_ERR_NOT_PIPABLE\n *\tThe WIM being piped over @p pipe_fd is a normal WIM, not a pipable WIM.\n */\nWIMLIBAPI int\nwimlib_extract_image_from_pipe(int pipe_fd,\n\t\t\t       const wimlib_tchar *image_num_or_name,\n\t\t\t       const wimlib_tchar *target, int extract_flags);\n\n/**\n * @ingroup G_extracting_wims\n *\n * Same as wimlib_extract_image_from_pipe(), but allows specifying a progress\n * function.  The progress function will be used while extracting the image and\n * will receive the normal extraction progress messages, such as\n * ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS, in addition to\n * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN.\n */\nWIMLIBAPI int\nwimlib_extract_image_from_pipe_with_progress(int pipe_fd,\n\t\t\t\t\t     const wimlib_tchar *image_num_or_name,\n\t\t\t\t\t     const wimlib_tchar *target,\n\t\t\t\t\t     int extract_flags,\n\t\t\t\t\t     wimlib_progress_func_t progfunc,\n\t\t\t\t\t     void *progctx);\n\n/**\n * @ingroup G_extracting_wims\n *\n * Similar to wimlib_extract_paths(), but the paths to extract from the WIM\n * image are specified in the ASCII, UTF-8, or UTF-16LE text file named by @p\n * path_list_file which itself contains the list of paths to use, one per line.\n * Leading and trailing whitespace is ignored.  Empty lines and lines beginning\n * with the ';' or '#' characters are ignored.  No quotes are needed, as paths\n * are otherwise delimited by the newline character.  However, quotes will be\n * stripped if present.\n *\n * If @p path_list_file is @c NULL, then the pathlist file is read from standard\n * input.\n *\n * The error codes are the same as those returned by wimlib_extract_paths(),\n * except that wimlib_extract_pathlist() returns an appropriate error code if it\n * cannot read the path list file (e.g. ::WIMLIB_ERR_OPEN, ::WIMLIB_ERR_STAT,\n * ::WIMLIB_ERR_READ).\n */\nWIMLIBAPI int\nwimlib_extract_pathlist(WIMStruct *wim, int image,\n\t\t\tconst wimlib_tchar *target,\n\t\t\tconst wimlib_tchar *path_list_file,\n\t\t\tint extract_flags);\n\n/**\n * @ingroup G_extracting_wims\n *\n * Extract zero or more paths (files or directory trees) from the specified WIM\n * image.\n *\n * By default, each path will be extracted to a corresponding subdirectory of\n * the target based on its location in the image.  For example, if one of the\n * paths to extract is <c>/Windows/explorer.exe</c> and the target is\n * <c>outdir</c>, the file will be extracted to\n * <c>outdir/Windows/explorer.exe</c>.  This behavior can be changed by\n * providing the flag ::WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE, which\n * will cause each file or directory tree to be placed directly in the target\n * directory --- so the same example would extract <c>/Windows/explorer.exe</c>\n * to <c>outdir/explorer.exe</c>.\n *\n * With globbing turned off (the default), paths are always checked for\n * existence strictly; that is, if any path to extract does not exist in the\n * image, then nothing is extracted and the function fails with\n * ::WIMLIB_ERR_PATH_DOES_NOT_EXIST.  But with globbing turned on\n * (::WIMLIB_EXTRACT_FLAG_GLOB_PATHS specified), globs are by default permitted\n * to match no files, and there is a flag (::WIMLIB_EXTRACT_FLAG_STRICT_GLOB) to\n * enable the strict behavior if desired.\n *\n * Symbolic links are not dereferenced when paths in the image are interpreted.\n *\n * @param wim\n *\tWIM from which to extract the paths, specified as a pointer to the\n *\t::WIMStruct for a standalone WIM file, a delta WIM file, or part 1 of a\n *\tsplit WIM.  In the case of a WIM file that is not standalone, this\n *\t::WIMStruct must have had any needed external resources previously\n *\treferenced using wimlib_reference_resources() or\n *\twimlib_reference_resource_files().\n * @param image\n *\tThe 1-based index of the WIM image from which to extract the paths.\n * @param paths\n *\tArray of paths to extract.  Each element must be the absolute path to a\n *\tfile or directory within the image.  Path separators may be either\n *\tforwards or backwards slashes, and leading path separators are optional.\n *\tThe paths will be interpreted either case-sensitively (UNIX default) or\n *\tcase-insensitively (Windows default); however, the case sensitivity can\n *\tbe configured explicitly at library initialization time by passing an\n *\tappropriate flag to wimlib_global_init().\n *\t<br/>\n *\tBy default, \"globbing\" is disabled, so the characters @c * and @c ? are\n *\tinterpreted literally.  This can be changed by specifying\n *\t::WIMLIB_EXTRACT_FLAG_GLOB_PATHS in @p extract_flags.\n * @param num_paths\n *\tNumber of paths specified in @p paths.\n * @param target\n *\tDirectory to which to extract the paths.\n * @param extract_flags\n *\tBitwise OR of flags prefixed with WIMLIB_EXTRACT_FLAG.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.  Most of the\n * error codes are the same as those returned by wimlib_extract_image().  Below,\n * some of the error codes returned in situations specific to path-mode\n * extraction are documented:\n *\n * @retval ::WIMLIB_ERR_NOT_A_REGULAR_FILE\n *\t::WIMLIB_EXTRACT_FLAG_TO_STDOUT was specified in @p extract_flags, but\n *\tone of the paths to extract did not name a regular file.\n * @retval ::WIMLIB_ERR_PATH_DOES_NOT_EXIST\n *\tOne of the paths to extract does not exist in the image; see discussion\n *\tabove about strict vs. non-strict behavior.\n *\n * If a progress function is registered with @p wim, then it will receive\n * ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS.\n */\nWIMLIBAPI int\nwimlib_extract_paths(WIMStruct *wim,\n\t\t     int image,\n\t\t     const wimlib_tchar *target,\n\t\t     const wimlib_tchar * const *paths,\n\t\t     size_t num_paths,\n\t\t     int extract_flags);\n\n#ifdef _RUFUS\nstatic __inline int\nwimlib_extract_pathsU(WIMStruct* wim,\n\tint image,\n\tconst char* target,\n\tconst char* const* paths,\n\tsize_t num_paths,\n\tint extract_flags)\n{\n\tint r = WIMLIB_ERR_NOMEM;\n\twconvert(target);\n\twimlib_tchar** wpaths = calloc(num_paths, sizeof(wimlib_tchar*));\n\tif (!wpaths)\n\t\tgoto out;\n\tfor (size_t i = 0; i < num_paths; i++)\n\t\twpaths[i] = utf8_to_wchar(paths[i]);\n\tr = wimlib_extract_paths(wim, image, wtarget, (const wimlib_tchar* const*)wpaths, num_paths, extract_flags);\n\nout:\n\tfor (size_t i = 0; wpaths && i < num_paths; i++)\n\t\tfree(wpaths[i]);\n\tfree(wpaths);\n\twfree(target);\n\treturn r;\n}\n#endif\n\n/**\n * @ingroup G_wim_information\n *\n * Similar to wimlib_get_xml_data(), but the XML document will be written to the\n * specified standard C <c>FILE*</c> instead of retrieved in an in-memory\n * buffer.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.  This may\n * return any error code which can be returned by wimlib_get_xml_data() as well\n * as the following error codes:\n *\n * @retval ::WIMLIB_ERR_WRITE\n *\tFailed to write the data to the requested file.\n */\nWIMLIBAPI int\nwimlib_extract_xml_data(WIMStruct *wim, FILE *fp);\n\n/**\n * @ingroup G_general\n *\n * Release a reference to a ::WIMStruct.  If the ::WIMStruct is still referenced\n * by other ::WIMStruct's (e.g. following calls to wimlib_export_image() or\n * wimlib_reference_resources()), then the library will free it later, when the\n * last reference is released; otherwise it is freed immediately and any\n * associated file descriptors are closed.\n *\n * @param wim\n *\tPointer to the ::WIMStruct to release.  If @c NULL, no action is taken.\n */\nWIMLIBAPI void\nwimlib_free(WIMStruct *wim);\n\n/**\n * @ingroup G_general\n *\n * Convert a ::wimlib_compression_type value into a string.\n *\n * @param ctype\n *\tThe compression type value to convert.\n *\n * @return\n *\tA statically allocated string naming the compression type, such as\n *\t\"None\", \"LZX\", or \"XPRESS\".  If the value was unrecognized, then\n *\tthe resulting string will be \"Invalid\".\n */\nWIMLIBAPI const wimlib_tchar *\nwimlib_get_compression_type_string(enum wimlib_compression_type ctype);\n\n/**\n * @ingroup G_general\n *\n * Convert a wimlib error code into a string describing it.\n *\n * @param code\n *\tAn error code returned by one of wimlib's functions.\n *\n * @return\n *\tPointer to a statically allocated string describing the error code.  If\n *\tthe value was unrecognized, then the resulting string will be \"Unknown\n *\terror\".\n */\nWIMLIBAPI const wimlib_tchar *\nwimlib_get_error_string(enum wimlib_error_code code);\n\n/**\n * @ingroup G_wim_information\n *\n * Get the description of the specified image.  Equivalent to\n * <tt>wimlib_get_image_property(wim, image, \"DESCRIPTION\")</tt>.\n */\nWIMLIBAPI const wimlib_tchar *\nwimlib_get_image_description(const WIMStruct *wim, int image);\n\n/**\n * @ingroup G_wim_information\n *\n * Get the name of the specified image.  Equivalent to\n * <tt>wimlib_get_image_property(wim, image, \"NAME\")</tt>, except that\n * wimlib_get_image_name() will return an empty string if the image is unnamed\n * whereas wimlib_get_image_property() may return @c NULL in that case.\n */\nWIMLIBAPI const wimlib_tchar *\nwimlib_get_image_name(const WIMStruct *wim, int image);\n\n/**\n * @ingroup G_wim_information\n *\n * Since wimlib v1.8.3: get a per-image property from the WIM's XML document.\n * This is an alternative to wimlib_get_image_name() and\n * wimlib_get_image_description() which allows getting any simple string\n * property.\n *\n * @param wim\n *\tPointer to the ::WIMStruct for the WIM.\n * @param image\n *\tThe 1-based index of the image for which to get the property.\n * @param property_name\n *\tThe name of the image property, for example \"NAME\", \"DESCRIPTION\", or\n *\t\"TOTALBYTES\".  The name can contain forward slashes to indicate a nested\n *\tXML element; for example, \"WINDOWS/VERSION/BUILD\" indicates the BUILD\n *\telement nested within the VERSION element nested within the WINDOWS\n *\telement.  Since wimlib v1.9.0, a bracketed number can be used to\n *\tindicate one of several identically-named elements; for example,\n *\t\"WINDOWS/LANGUAGES/LANGUAGE[2]\" indicates the second \"LANGUAGE\" element\n *\tnested within the \"WINDOWS/LANGUAGES\" element.  Note that element names\n *\tare case sensitive.\n *\n * @return\n *\tThe property's value as a ::wimlib_tchar string, or @c NULL if there is\n *\tno such property.  The string may not remain valid after later library\n *\tcalls, so the caller should duplicate it if needed.\n */\nWIMLIBAPI const wimlib_tchar *\nwimlib_get_image_property(const WIMStruct *wim, int image,\n\t\t\t  const wimlib_tchar *property_name);\n\n/**\n * @ingroup G_general\n *\n * Return the version of wimlib as a 32-bit number whose top 12 bits contain the\n * major version, the next 10 bits contain the minor version, and the low 10\n * bits contain the patch version.\n *\n * In other words, the returned value is equal to <c>((WIMLIB_MAJOR_VERSION <<\n * 20) | (WIMLIB_MINOR_VERSION << 10) | WIMLIB_PATCH_VERSION)</c> for the\n * corresponding header file.\n */\nWIMLIBAPI uint32_t\nwimlib_get_version(void);\n\n/**\n * @ingroup G_general\n *\n * Since wimlib v1.13.0: like wimlib_get_version(), but returns the full\n * PACKAGE_VERSION string that was set at build time.  (This allows a beta\n * release to be distinguished from an official release.)\n */\nWIMLIBAPI const wimlib_tchar *\nwimlib_get_version_string(void);\n\n/**\n * @ingroup G_wim_information\n *\n * Get basic information about a WIM file.\n *\n * @param wim\n *\tPointer to the ::WIMStruct to query.  This need not represent a\n *\tstandalone WIM (e.g. it could represent part of a split WIM).\n * @param info\n *\tA ::wimlib_wim_info structure that will be filled in with information\n *\tabout the WIM file.\n *\n * @return 0\n */\nWIMLIBAPI int\nwimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info);\n\n/**\n * @ingroup G_wim_information\n *\n * Read a WIM file's XML document into an in-memory buffer.\n *\n * The XML document contains metadata about the WIM file and the images stored\n * in it.\n *\n * @param wim\n *\tPointer to the ::WIMStruct to query.  This need not represent a\n *\tstandalone WIM (e.g. it could represent part of a split WIM).\n * @param buf_ret\n *\tOn success, a pointer to an allocated buffer containing the raw UTF16-LE\n *\tXML document is written to this location.\n * @param bufsize_ret\n *\tThe size of the XML document in bytes is written to this location.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_NO_FILENAME\n *\t@p wim is not backed by a file and therefore does not have an XML\n *\tdocument.\n * @retval ::WIMLIB_ERR_READ\n *\tFailed to read the XML document from the WIM file.\n * @retval ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE\n *\tFailed to read the XML document from the WIM file.\n */\nWIMLIBAPI int\nwimlib_get_xml_data(WIMStruct *wim, void **buf_ret, size_t *bufsize_ret);\n\n/**\n * @ingroup G_general\n *\n * Initialization function for wimlib.  Call before using any other wimlib\n * function (except possibly wimlib_set_print_errors()).  If not done manually,\n * this function will be called automatically with a flags argument of 0.  This\n * function does nothing if called again after it has already successfully run.\n *\n * @param init_flags\n *\tBitwise OR of flags prefixed with WIMLIB_INIT_FLAG.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_INSUFFICIENT_PRIVILEGES\n *\t::WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES and/or\n *\t::WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES were specified in @p\n *\tinit_flags, but the corresponding privileges could not be acquired.\n */\nWIMLIBAPI int\nwimlib_global_init(int init_flags);\n\n/**\n * @ingroup G_general\n *\n * Cleanup function for wimlib.  You are not required to call this function, but\n * it will release any global resources allocated by the library.\n */\nWIMLIBAPI void\nwimlib_global_cleanup(void);\n\n/**\n * @ingroup G_wim_information\n *\n * Determine if an image name is already used by some image in the WIM.\n *\n * @param wim\n *\tPointer to the ::WIMStruct to query.  This need not represent a\n *\tstandalone WIM (e.g. it could represent part of a split WIM).\n * @param name\n *\tThe name to check.\n *\n * @return\n *\t@c true if there is already an image in @p wim named @p name; @c false\n *\tif there is no image named @p name in @p wim.  If @p name is @c NULL or\n *\tthe empty string, then @c false is returned.\n */\nWIMLIBAPI bool\nwimlib_image_name_in_use(const WIMStruct *wim, const wimlib_tchar *name);\n\n/**\n * @ingroup G_wim_information\n *\n * Iterate through a file or directory tree in a WIM image.  By specifying\n * appropriate flags and a callback function, you can get the attributes of a\n * file in the image, get a directory listing, or even get a listing of the\n * entire image.\n *\n * @param wim\n *\tThe ::WIMStruct containing the image(s) over which to iterate.  This\n *\t::WIMStruct must contain image metadata, so it cannot be the non-first\n *\tpart of a split WIM (for example).\n * @param image\n *\tThe 1-based index of the image that contains the files or directories to\n *\titerate over, or ::WIMLIB_ALL_IMAGES to iterate over all images.\n * @param path\n *\tPath in the image at which to do the iteration.\n * @param flags\n *\tBitwise OR of flags prefixed with WIMLIB_ITERATE_DIR_TREE_FLAG.\n * @param cb\n *\tA callback function that will receive each directory entry.\n * @param user_ctx\n *\tAn extra parameter that will always be passed to the callback function\n *\t@p cb.\n *\n * @return Normally, returns 0 if all calls to @p cb returned 0; otherwise the\n * first nonzero value that was returned from @p cb.  However, additional\n * ::wimlib_error_code values may be returned, including the following:\n *\n * @retval ::WIMLIB_ERR_INVALID_IMAGE\n *\t@p image does not exist in @p wim.\n * @retval ::WIMLIB_ERR_PATH_DOES_NOT_EXIST\n *\t@p path does not exist in the image.\n * @retval ::WIMLIB_ERR_RESOURCE_NOT_FOUND\n *\t::WIMLIB_ITERATE_DIR_TREE_FLAG_RESOURCES_NEEDED was specified, but the\n *\tdata for some files could not be found in the blob lookup table of @p\n *\twim.\n *\n * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION,\n * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND,\n * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which\n * indicate failure (for different reasons) to read the metadata resource for an\n * image over which iteration needed to be done.\n */\nWIMLIBAPI int\nwimlib_iterate_dir_tree(WIMStruct *wim, int image, const wimlib_tchar *path,\n\t\t\tint flags,\n\t\t\twimlib_iterate_dir_tree_callback_t cb, void *user_ctx);\n\n/**\n * @ingroup G_wim_information\n *\n * Iterate through the blob lookup table of a ::WIMStruct.  This can be used to\n * directly get a listing of the unique \"blobs\" contained in a WIM file, which\n * are deduplicated over all images.\n *\n * Specifically, each listed blob may be from any of the following sources:\n *\n * - Metadata blobs, if the ::WIMStruct contains image metadata\n * - File blobs from the on-disk WIM file (if any) backing the ::WIMStruct\n * - File blobs from files that have been added to the in-memory ::WIMStruct,\n *   e.g. by using wimlib_add_image()\n * - File blobs from external WIMs referenced by\n *   wimlib_reference_resource_files() or wimlib_reference_resources()\n *\n * @param wim\n *\tPointer to the ::WIMStruct for which to get the blob listing.\n * @param flags\n *\tReserved; set to 0.\n * @param cb\n *\tA callback function that will receive each blob.\n * @param user_ctx\n *\tAn extra parameter that will always be passed to the callback function\n *\t@p cb.\n *\n * @return 0 if all calls to @p cb returned 0; otherwise the first nonzero value\n * that was returned from @p cb.\n */\nWIMLIBAPI int\nwimlib_iterate_lookup_table(WIMStruct *wim, int flags,\n\t\t\t    wimlib_iterate_lookup_table_callback_t cb,\n\t\t\t    void *user_ctx);\n\n/**\n * @ingroup G_nonstandalone_wims\n *\n * Join a split WIM into a stand-alone (one-part) WIM.\n *\n * @param swms\n *\tAn array of strings that gives the filenames of all parts of the split\n *\tWIM.  No specific order is required, but all parts must be included with\n *\tno duplicates.\n * @param num_swms\n *\tNumber of filenames in @p swms.\n * @param swm_open_flags\n *\tOpen flags for the split WIM parts (e.g.\n *\t::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY).\n * @param wim_write_flags\n *\tBitwise OR of relevant flags prefixed with WIMLIB_WRITE_FLAG, which will\n *\tbe used to write the joined WIM.\n * @param output_path\n *\tThe path to write the joined WIM file to.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.  This function\n * may return most error codes that can be returned by wimlib_open_wim() and\n * wimlib_write(), as well as the following error codes:\n *\n * @retval ::WIMLIB_ERR_SPLIT_INVALID\n *\tThe split WIMs do not form a valid WIM because they do not include all\n *\tthe parts of the original WIM, there are duplicate parts, or not all the\n *\tparts have the same GUID and compression type.\n *\n * Note: wimlib is generalized enough that this function is not actually needed\n * to join a split WIM; instead, you could open the first part of the split WIM,\n * then reference the other parts with wimlib_reference_resource_files(), then\n * write the joined WIM using wimlib_write().  However, wimlib_join() provides\n * an easy-to-use wrapper around this that has some advantages (e.g.  extra\n * sanity checks).\n */\nWIMLIBAPI int\nwimlib_join(const wimlib_tchar * const *swms,\n\t    unsigned num_swms,\n\t    const wimlib_tchar *output_path,\n\t    int swm_open_flags,\n\t    int wim_write_flags);\n\n/**\n * @ingroup G_nonstandalone_wims\n *\n * Same as wimlib_join(), but allows specifying a progress function.  The\n * progress function will receive the write progress messages, such as\n * ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS, while writing the joined WIM.  In\n * addition, if ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY is specified in @p\n * swm_open_flags, the progress function will receive a series of\n * ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY messages when each of the split WIM\n * parts is opened.\n */\nWIMLIBAPI int\nwimlib_join_with_progress(const wimlib_tchar * const *swms,\n\t\t\t  unsigned num_swms,\n\t\t\t  const wimlib_tchar *output_path,\n\t\t\t  int swm_open_flags,\n\t\t\t  int wim_write_flags,\n\t\t\t  wimlib_progress_func_t progfunc,\n\t\t\t  void *progctx);\n\n/**\n * @ingroup G_general\n *\n * Load a UTF-8 or UTF-16LE encoded text file into memory.\n *\n * @param path\n *\tThe path to the file, or NULL or \"-\" to use standard input.\n * @param tstr_ret\n *\tOn success, a buffer containing the file's text as a \"wimlib_tchar\"\n *\tstring is returned here.  The buffer must be freed using free().\n * @param tstr_nchars_ret\n *\tOn success, the length of the text in \"wimlib_tchar\"s is returned here.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n */\nWIMLIBAPI int\nwimlib_load_text_file(const wimlib_tchar *path,\n\t\t      wimlib_tchar **tstr_ret, size_t *tstr_nchars_ret);\n\n/**\n * @ingroup G_mounting_wim_images\n *\n * Mount an image from a WIM file on a directory read-only or read-write.\n *\n * @param wim\n *\tPointer to the ::WIMStruct containing the image to be mounted.  This\n *\t::WIMStruct must have a backing file.\n * @param image\n *\tThe 1-based index of the image to mount.  This image cannot have been\n *\tpreviously modified in memory.\n * @param dir\n *\tThe path to an existing empty directory on which to mount the image.\n * @param mount_flags\n *\tBitwise OR of flags prefixed with WIMLIB_MOUNT_FLAG.  Use\n *\t::WIMLIB_MOUNT_FLAG_READWRITE to request a read-write mount instead of a\n *\tread-only mount.\n * @param staging_dir\n *\tIf non-NULL, the name of a directory in which a temporary directory for\n *\tstoring modified or added files will be created.  Ignored if\n *\t::WIMLIB_MOUNT_FLAG_READWRITE is not specified in @p mount_flags.  If\n *\tleft @c NULL, the staging directory is created in the same directory as\n *\tthe backing WIM file.  The staging directory is automatically deleted\n *\twhen the image is unmounted.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_ALREADY_LOCKED\n *\tAnother process is currently modifying the WIM file.\n * @retval ::WIMLIB_ERR_FUSE\n *\tA non-zero status code was returned by @c fuse_main().\n * @retval ::WIMLIB_ERR_IMAGE_HAS_MULTIPLE_REFERENCES\n *\tThere are currently multiple references to the image as a result of a\n *\tcall to wimlib_export_image().  Free one before attempting the\n *\tread-write mount.\n * @retval ::WIMLIB_ERR_INVALID_IMAGE\n *\t@p image does not exist in @p wim.\n * @retval ::WIMLIB_ERR_INVALID_PARAM\n *\t@p wim was @c NULL; or @p dir was NULL or an empty string; or an\n *\tunrecognized flag was specified in @p mount_flags; or the image has\n *\talready been modified in memory (e.g. by wimlib_update_image()).\n * @retval ::WIMLIB_ERR_MKDIR\n *\t::WIMLIB_MOUNT_FLAG_READWRITE was specified in @p mount_flags, but the\n *\tstaging directory could not be created.\n * @retval ::WIMLIB_ERR_WIM_IS_READONLY\n *\t::WIMLIB_MOUNT_FLAG_READWRITE was specified in @p mount_flags, but the\n *\tWIM file is considered read-only because of any of the reasons mentioned\n *\tin the documentation for the ::WIMLIB_OPEN_FLAG_WRITE_ACCESS flag.\n * @retval ::WIMLIB_ERR_UNSUPPORTED\n *\tMounting is not supported in this build of the library.\n *\n * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION,\n * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND,\n * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which\n * indicate failure (for different reasons) to read the metadata resource for\n * the image to mount.\n *\n * The ability to mount WIM images is implemented using FUSE (Filesystem in\n * UserSpacE).  Depending on how FUSE is set up on your system, this function\n * may work as normal users in addition to the root user.\n *\n * Mounting WIM images is not supported if wimlib was configured\n * <c>--without-fuse</c>.  This includes Windows builds of wimlib;\n * ::WIMLIB_ERR_UNSUPPORTED will be returned in such cases.\n *\n * Calling this function daemonizes the process, unless\n * ::WIMLIB_MOUNT_FLAG_DEBUG was specified or an early error occurs.\n *\n * It is safe to mount multiple images from the same WIM file read-only at the\n * same time, but only if different ::WIMStruct's are used.  It is @b not safe\n * to mount multiple images from the same WIM file read-write at the same time.\n *\n * To unmount the image, call wimlib_unmount_image().  This may be done in a\n * different process.\n */\nWIMLIBAPI int\nwimlib_mount_image(WIMStruct *wim,\n\t\t   int image,\n\t\t   const wimlib_tchar *dir,\n\t\t   int mount_flags,\n\t\t   const wimlib_tchar *staging_dir);\n\n/**\n * @ingroup G_creating_and_opening_wims\n *\n * Open a WIM file and create a ::WIMStruct for it.\n *\n * @param wim_file\n *\tThe path to the WIM file to open.\n * @param open_flags\n *\tBitwise OR of flags prefixed with WIMLIB_OPEN_FLAG.\n * @param wim_ret\n *\tOn success, a pointer to a new ::WIMStruct backed by the specified\n *\ton-disk WIM file is written to the memory location pointed to by this\n *\tparameter.  This ::WIMStruct must be freed using wimlib_free() when\n *\tfinished with it.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_IMAGE_COUNT\n *\tThe number of metadata resources found in the WIM did not match the\n *\timage count specified in the WIM header, or the number of &lt;IMAGE&gt;\n *\telements in the XML data of the WIM did not match the image count\n *\tspecified in the WIM header.\n * @retval ::WIMLIB_ERR_INTEGRITY\n *\t::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY was specified in @p open_flags, and\n *\tthe WIM file failed the integrity check.\n * @retval ::WIMLIB_ERR_INVALID_CHUNK_SIZE\n *\tThe library did not recognize the compression chunk size of the WIM as\n *\tvalid for its compression type.\n * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE\n *\tThe library did not recognize the compression type of the WIM.\n * @retval ::WIMLIB_ERR_INVALID_HEADER\n *\tThe header of the WIM was otherwise invalid.\n * @retval ::WIMLIB_ERR_INVALID_INTEGRITY_TABLE\n *\t::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY was specified in @p open_flags and\n *\tthe WIM contained an integrity table, but the integrity table was\n *\tinvalid.\n * @retval ::WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY\n *\tThe lookup table of the WIM was invalid.\n * @retval ::WIMLIB_ERR_INVALID_PARAM\n *\t@p wim_ret was @c NULL; or, @p wim_file was not a nonempty string.\n * @retval ::WIMLIB_ERR_IS_SPLIT_WIM\n *\tThe WIM was a split WIM and ::WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT was\n *\tspecified in @p open_flags.\n * @retval ::WIMLIB_ERR_NOT_A_WIM_FILE\n *\tThe file did not begin with the magic characters that identify a WIM\n *\tfile.\n * @retval ::WIMLIB_ERR_OPEN\n *\tFailed to open the WIM file for reading.  Some possible reasons: the WIM\n *\tfile does not exist, or the calling process does not have permission to\n *\topen it.\n * @retval ::WIMLIB_ERR_READ\n *\tFailed to read data from the WIM file.\n * @retval ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE\n *\tUnexpected end-of-file while reading data from the WIM file.\n * @retval ::WIMLIB_ERR_UNKNOWN_VERSION\n *\tThe WIM version number was not recognized. (May be a pre-Vista WIM.)\n * @retval ::WIMLIB_ERR_WIM_IS_ENCRYPTED\n *\tThe WIM cannot be opened because it contains encrypted segments.  (It\n *\tmay be a Windows 8 \"ESD\" file.)\n * @retval ::WIMLIB_ERR_WIM_IS_INCOMPLETE\n *\tThe WIM file is not complete (e.g. the program which wrote it was\n *\tterminated before it finished)\n * @retval ::WIMLIB_ERR_WIM_IS_READONLY\n *\t::WIMLIB_OPEN_FLAG_WRITE_ACCESS was specified but the WIM file was\n *\tconsidered read-only because of any of the reasons mentioned in the\n *\tdocumentation for the ::WIMLIB_OPEN_FLAG_WRITE_ACCESS flag.\n * @retval ::WIMLIB_ERR_XML\n *\tThe XML data of the WIM was invalid.\n */\nWIMLIBAPI int\nwimlib_open_wim(const wimlib_tchar *wim_file,\n\t\tint open_flags,\n\t\tWIMStruct **wim_ret);\n\n#ifdef _RUFUS\nstatic __inline int\nwimlib_open_wimU(const char* wim_file,\n\tint open_flags,\n\tWIMStruct** wim_ret)\n{\n\twconvert(wim_file);\n\tint r = wimlib_open_wim(wwim_file, open_flags, wim_ret);\n\twfree(wim_file);\n\treturn r;\n}\n#endif\n\n/**\n * @ingroup G_creating_and_opening_wims\n *\n * Same as wimlib_open_wim(), but allows specifying a progress function and\n * progress context.  If successful, the progress function will be registered in\n * the newly open ::WIMStruct, as if by an automatic call to\n * wimlib_register_progress_function().  In addition, if\n * ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY is specified in @p open_flags, then the\n * progress function will receive ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY\n * messages while checking the WIM file's integrity.\n */\nWIMLIBAPI int\nwimlib_open_wim_with_progress(const wimlib_tchar *wim_file,\n\t\t\t      int open_flags,\n\t\t\t      WIMStruct **wim_ret,\n\t\t\t      wimlib_progress_func_t progfunc,\n\t\t\t      void *progctx);\n\n/**\n * @ingroup G_writing_and_overwriting_wims\n *\n * Commit a ::WIMStruct to disk, updating its backing file.\n *\n * There are several alternative ways in which changes may be committed:\n *\n *   1. Full rebuild: write the updated WIM to a temporary file, then rename the\n *\ttemporary file to the original.\n *   2. Appending: append updates to the new original WIM file, then overwrite\n *\tits header such that those changes become visible to new readers.\n *   3. Compaction: normally should not be used; see\n *\t::WIMLIB_WRITE_FLAG_UNSAFE_COMPACT for details.\n *\n * Append mode is often much faster than a full rebuild, but it wastes some\n * amount of space due to leaving \"holes\" in the WIM file.  Because of the\n * greater efficiency, wimlib_overwrite() normally defaults to append mode.\n * However, ::WIMLIB_WRITE_FLAG_REBUILD can be used to explicitly request a full\n * rebuild.  In addition, if wimlib_delete_image() has been used on the\n * ::WIMStruct, then the default mode switches to rebuild mode, and\n * ::WIMLIB_WRITE_FLAG_SOFT_DELETE can be used to explicitly request append\n * mode.\n *\n * If this function completes successfully, then no more functions can be called\n * on the ::WIMStruct other than wimlib_free().  If you need to continue using\n * the WIM file, you must use wimlib_open_wim() to open a new ::WIMStruct for\n * it.\n *\n * @param wim\n *\tPointer to a ::WIMStruct to commit to its backing file.\n * @param write_flags\n *\tBitwise OR of relevant flags prefixed with WIMLIB_WRITE_FLAG.\n * @param num_threads\n *\tThe number of threads to use for compressing data, or 0 to have the\n *\tlibrary automatically choose an appropriate number.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.  This function\n * may return most error codes returned by wimlib_write() as well as the\n * following error codes:\n *\n * @retval ::WIMLIB_ERR_ALREADY_LOCKED\n *\tAnother process is currently modifying the WIM file.\n * @retval ::WIMLIB_ERR_NO_FILENAME\n *\t@p wim is not backed by an on-disk file.  In other words, it is a\n *\t::WIMStruct created by wimlib_create_new_wim() rather than\n *\twimlib_open_wim().\n * @retval ::WIMLIB_ERR_RENAME\n *\tThe temporary file to which the WIM was written could not be renamed to\n *\tthe original file.\n * @retval ::WIMLIB_ERR_WIM_IS_READONLY\n *\tThe WIM file is considered read-only because of any of the reasons\n *\tmentioned in the documentation for the ::WIMLIB_OPEN_FLAG_WRITE_ACCESS\n *\tflag.\n *\n * If a progress function is registered with @p wim, then it will receive the\n * messages ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS,\n * ::WIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN, and\n * ::WIMLIB_PROGRESS_MSG_WRITE_METADATA_END.\n */\nWIMLIBAPI int\nwimlib_overwrite(WIMStruct *wim, int write_flags, unsigned num_threads);\n\n/**\n * @ingroup G_wim_information\n *\n * (Deprecated) Print information about one image, or all images, contained in a\n * WIM.\n *\n * @param wim\n *\tPointer to the ::WIMStruct to query.  This need not represent a\n *\tstandalone WIM (e.g. it could represent part of a split WIM).\n * @param image\n *\tThe 1-based index of the image for which to print information, or\n *\t::WIMLIB_ALL_IMAGES to print information about all images.\n *\n * @return This function has no return value.  No error checking is done when\n * printing the information.  If @p image is invalid, an error message is\n * printed.\n *\n * This function is deprecated; use wimlib_get_xml_data() or\n * wimlib_get_image_property() to query image information instead.\n */\nWIMLIBAPI void\nwimlib_print_available_images(const WIMStruct *wim, int image);\n\n/**\n * @ingroup G_wim_information\n *\n * Print the header of the WIM file (intended for debugging only).\n */\nWIMLIBAPI void\nwimlib_print_header(const WIMStruct *wim);\n\n/**\n * @ingroup G_nonstandalone_wims\n *\n * Reference file data from other WIM files or split WIM parts.  This function\n * can be used on WIMs that are not standalone, such as split or \"delta\" WIMs,\n * to load additional file data before calling a function such as\n * wimlib_extract_image() that requires the file data to be present.\n *\n * @param wim\n *\tThe ::WIMStruct for a WIM that contains metadata resources, but is not\n *\tnecessarily \"standalone\".  In the case of split WIMs, this should be the\n *\tfirst part, since only the first part contains the metadata resources.\n *\tIn the case of delta WIMs, this should be the delta WIM rather than the\n *\tWIM on which it is based.\n * @param resource_wimfiles_or_globs\n *\tArray of paths to WIM files and/or split WIM parts to reference.\n *\tAlternatively, when ::WIMLIB_REF_FLAG_GLOB_ENABLE is specified in @p\n *\tref_flags, these are treated as globs rather than literal paths.  That\n *\tis, using this function you can specify zero or more globs, each of\n *\twhich expands to one or more literal paths.\n * @param count\n *\tNumber of entries in @p resource_wimfiles_or_globs.\n * @param ref_flags\n *\tBitwise OR of ::WIMLIB_REF_FLAG_GLOB_ENABLE and/or\n *\t::WIMLIB_REF_FLAG_GLOB_ERR_ON_NOMATCH.\n * @param open_flags\n *\tAdditional open flags, such as ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY, to\n *\tpass to internal calls to wimlib_open_wim() on the reference files.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_GLOB_HAD_NO_MATCHES\n *\tOne of the specified globs did not match any paths (only with both\n *\t::WIMLIB_REF_FLAG_GLOB_ENABLE and ::WIMLIB_REF_FLAG_GLOB_ERR_ON_NOMATCH\n *\tspecified in @p ref_flags).\n * @retval ::WIMLIB_ERR_READ\n *\tI/O or permissions error while processing a file glob.\n *\n * This function can additionally return most values that can be returned by\n * wimlib_open_wim().\n */\nWIMLIBAPI int\nwimlib_reference_resource_files(WIMStruct *wim,\n\t\t\t\tconst wimlib_tchar * const *resource_wimfiles_or_globs,\n\t\t\t\tunsigned count,\n\t\t\t\tint ref_flags,\n\t\t\t\tint open_flags);\n\n/**\n * @ingroup G_nonstandalone_wims\n *\n * Similar to wimlib_reference_resource_files(), but operates at a lower level\n * where the caller must open the ::WIMStruct for each referenced file itself.\n *\n * @param wim\n *\tThe ::WIMStruct for a WIM that contains metadata resources, but is not\n *\tnecessarily \"standalone\".  In the case of split WIMs, this should be the\n *\tfirst part, since only the first part contains the metadata resources.\n * @param resource_wims\n *\tArray of pointers to the ::WIMStruct's for additional resource WIMs or\n *\tsplit WIM parts to reference.\n * @param num_resource_wims\n *\tNumber of entries in @p resource_wims.\n * @param ref_flags\n *\tReserved; must be 0.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n */\nWIMLIBAPI int\nwimlib_reference_resources(WIMStruct *wim, WIMStruct **resource_wims,\n\t\t\t   unsigned num_resource_wims, int ref_flags);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Declare that a newly added image is mostly the same as a prior image, but\n * captured at a later point in time, possibly with some modifications in the\n * intervening time.  This is designed to be used in incremental backups of the\n * same filesystem or directory tree.\n *\n * This function compares the metadata of the directory tree of the newly added\n * image against that of the old image.  Any files that are present in both the\n * newly added image and the old image and have timestamps that indicate they\n * haven't been modified are deemed not to have been modified and have their\n * checksums copied from the old image.  Because of this and because WIM uses\n * single-instance streams, such files need not be read from the filesystem when\n * the WIM is being written or overwritten.  Note that these unchanged files\n * will still be \"archived\" and will be logically present in the new image; the\n * optimization is that they don't need to actually be read from the filesystem\n * because the WIM already contains them.\n *\n * This function is provided to optimize incremental backups.  The resulting WIM\n * file will still be the same regardless of whether this function is called.\n * (This is, however, assuming that timestamps have not been manipulated or\n * unmaintained as to trick this function into thinking a file has not been\n * modified when really it has.  To partly guard against such cases, other\n * metadata such as file sizes will be checked as well.)\n *\n * This function must be called after adding the new image (e.g. with\n * wimlib_add_image()), but before writing the updated WIM file (e.g. with\n * wimlib_overwrite()).\n *\n * @param wim\n *\tPointer to the ::WIMStruct containing the newly added image.\n * @param new_image\n *\tThe 1-based index in @p wim of the newly added image.\n * @param template_wim\n *\tPointer to the ::WIMStruct containing the template image.  This can be,\n *\tbut does not have to be, the same ::WIMStruct as @p wim.\n * @param template_image\n *\tThe 1-based index in @p template_wim of the template image.\n * @param flags\n *\tReserved; must be 0.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_INVALID_IMAGE\n *\t@p new_image does not exist in @p wim or @p template_image does not\n *\texist in @p template_wim.\n * @retval ::WIMLIB_ERR_METADATA_NOT_FOUND\n *\tAt least one of @p wim and @p template_wim does not contain image\n *\tmetadata; for example, one of them represents a non-first part of a\n *\tsplit WIM.\n * @retval ::WIMLIB_ERR_INVALID_PARAM\n *\tIdentical values were provided for the template and new image; or @p\n *\tnew_image specified an image that had not been modified since opening\n *\tthe WIM.\n *\n * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION,\n * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND,\n * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which\n * indicate failure (for different reasons) to read the metadata resource for\n * the template image.\n */\nWIMLIBAPI int\nwimlib_reference_template_image(WIMStruct *wim, int new_image,\n\t\t\t\tWIMStruct *template_wim, int template_image,\n\t\t\t\tint flags);\n\n/**\n * @ingroup G_general\n *\n * Register a progress function with a ::WIMStruct.\n *\n * @param wim\n *\tThe ::WIMStruct for which to register the progress function.\n * @param progfunc\n *\tPointer to the progress function to register.  If the WIM already has a\n *\tprogress function registered, it will be replaced with this one.  If @p\n *\tNULL, the current progress function (if any) will be unregistered.\n * @param progctx\n *\tThe value which will be passed as the third argument to calls to @p\n *\tprogfunc.\n */\nWIMLIBAPI void\nwimlib_register_progress_function(WIMStruct *wim,\n\t\t\t\t  wimlib_progress_func_t progfunc,\n\t\t\t\t  void *progctx);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Rename the @p source_path to the @p dest_path in the specified @p image of\n * the @p wim.\n *\n * This just builds an appropriate ::wimlib_rename_command and passes it to\n * wimlib_update_image().\n */\nWIMLIBAPI int\nwimlib_rename_path(WIMStruct *wim, int image,\n\t\t   const wimlib_tchar *source_path, const wimlib_tchar *dest_path);\n\n/**\n * @ingroup G_wim_information\n *\n * Translate a string specifying the name or number of an image in the WIM into\n * the number of the image.  The images are numbered starting at 1.\n *\n * @param wim\n *\tPointer to the ::WIMStruct for a WIM.\n * @param image_name_or_num\n *\tA string specifying the name or number of an image in the WIM.  If it\n *\tparses to a positive integer, this integer is taken to specify the\n *\tnumber of the image, indexed starting at 1.  Otherwise, it is taken to\n *\tbe the name of an image, as given in the XML data for the WIM file.  It\n *\talso may be the keyword \"all\" or the string \"*\", both of which will\n *\tresolve to ::WIMLIB_ALL_IMAGES.\n *\t<br/> <br/>\n *\tThere is no way to search for an image actually named \"all\", \"*\", or an\n *\tinteger number, or an image that has no name.  However, you can use\n *\twimlib_get_image_name() to get the name of any image.\n *\n * @return\n *\tIf the string resolved to a single existing image, the number of that\n *\timage, indexed starting at 1, is returned.  If the keyword \"all\" or \"*\"\n *\twas specified, ::WIMLIB_ALL_IMAGES is returned.  Otherwise,\n *\t::WIMLIB_NO_IMAGE is returned.  If @p image_name_or_num was @c NULL or\n *\tthe empty string, ::WIMLIB_NO_IMAGE is returned, even if one or more\n *\timages in @p wim has no name.  (Since a WIM may have multiple unnamed\n *\timages, an unnamed image must be specified by index to eliminate the\n *\tambiguity.)\n */\nWIMLIBAPI int\nwimlib_resolve_image(WIMStruct *wim,\n\t\t     const wimlib_tchar *image_name_or_num);\n\n/**\n * @ingroup G_general\n *\n * Set the file to which the library will print error and warning messages.\n *\n * This version of the function takes a C library <c>FILE*</c> opened for\n * writing (or appending).  Use wimlib_set_error_file_by_name() to specify the\n * file by name instead.\n *\n * This also enables error messages, as if by a call to\n * wimlib_set_print_errors(true).\n *\n * @return 0\n */\nWIMLIBAPI int\nwimlib_set_error_file(FILE *fp);\n\n/**\n * @ingroup G_general\n *\n * Set the path to the file to which the library will print error and warning\n * messages.  The library will open this file for appending.\n *\n * This also enables error messages, as if by a call to\n * wimlib_set_print_errors(true).\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_OPEN\n *\tThe file named by @p path could not be opened for appending.\n */\nWIMLIBAPI int\nwimlib_set_error_file_by_name(const wimlib_tchar *path);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Change the description of a WIM image.  Equivalent to\n * <tt>wimlib_set_image_property(wim, image, \"DESCRIPTION\", description)</tt>.\n *\n * Note that \"description\" is misspelled in the name of this function.\n */\nWIMLIBAPI int\nwimlib_set_image_descripton(WIMStruct *wim, int image,\n\t\t\t    const wimlib_tchar *description);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Change what is stored in the \\<FLAGS\\> element in the WIM XML document\n * (usually something like \"Core\" or \"Ultimate\").  Equivalent to\n * <tt>wimlib_set_image_property(wim, image, \"FLAGS\", flags)</tt>.\n */\nWIMLIBAPI int\nwimlib_set_image_flags(WIMStruct *wim, int image, const wimlib_tchar *flags);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Change the name of a WIM image.  Equivalent to\n * <tt>wimlib_set_image_property(wim, image, \"NAME\", name)</tt>.\n */\nWIMLIBAPI int\nwimlib_set_image_name(WIMStruct *wim, int image, const wimlib_tchar *name);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Since wimlib v1.8.3: add, modify, or remove a per-image property from the\n * WIM's XML document.  This is an alternative to wimlib_set_image_name(),\n * wimlib_set_image_descripton(), and wimlib_set_image_flags() which allows\n * manipulating any simple string property.\n *\n * @param wim\n *\tPointer to the ::WIMStruct for the WIM.\n * @param image\n *\tThe 1-based index of the image for which to set the property.\n * @param property_name\n *\tThe name of the image property in the same format documented for\n *\twimlib_get_image_property().\n *\t<br/>\n *\tNote: if creating a new element using a bracketed index such as\n *\t\"WINDOWS/LANGUAGES/LANGUAGE[2]\", the highest index that can be specified\n *\tis one greater than the number of existing elements with that same name,\n *\texcluding the index.  That means that if you are adding a list of new\n *\telements, they must be added sequentially from the first index (1) to\n *\tthe last index (n).\n * @param property_value\n *\tIf not NULL and not empty, the property is set to this value.\n *\tOtherwise, the property is removed from the XML document.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_IMAGE_NAME_COLLISION\n *\tThe user requested to set the image name (the <tt>NAME</tt> property),\n *\tbut another image in the WIM already had the requested name.\n * @retval ::WIMLIB_ERR_INVALID_IMAGE\n *\t@p image does not exist in @p wim.\n * @retval ::WIMLIB_ERR_INVALID_PARAM\n *\t@p property_name has an unsupported format, or @p property_name included\n *\ta bracketed index that was too high.\n */\nWIMLIBAPI int\nwimlib_set_image_property(WIMStruct *wim, int image,\n\t\t\t  const wimlib_tchar *property_name,\n\t\t\t  const wimlib_tchar *property_value);\n\n/**\n * @ingroup G_general\n *\n * Set the functions that wimlib uses to allocate and free memory.\n *\n * These settings are global and not per-WIM.\n *\n * The default is to use the default @c malloc(), @c free(), and @c realloc()\n * from the standard C library.\n *\n * Note: some external functions, such as those in @c libntfs-3g, may use the\n * standard memory allocation functions regardless of this setting.\n *\n * @param malloc_func\n *\tA function equivalent to @c malloc() that wimlib will use to allocate\n *\tmemory.  If @c NULL, the allocator function is set back to the default\n *\t@c malloc() from the C library.\n * @param free_func\n *\tA function equivalent to @c free() that wimlib will use to free memory.\n *\tIf @c NULL, the free function is set back to the default @c free() from\n *\tthe C library.\n * @param realloc_func\n *\tA function equivalent to @c realloc() that wimlib will use to reallocate\n *\tmemory.  If @c NULL, the free function is set back to the default @c\n *\trealloc() from the C library.\n *\n * @return 0\n */\nWIMLIBAPI int\nwimlib_set_memory_allocator(void *(*malloc_func)(size_t),\n\t\t\t    void (*free_func)(void *),\n\t\t\t    void *(*realloc_func)(void *, size_t));\n\n/**\n * @ingroup G_writing_and_overwriting_wims\n *\n * Set a ::WIMStruct's output compression chunk size.  This is the compression\n * chunk size that will be used for writing non-solid resources in subsequent\n * calls to wimlib_write() or wimlib_overwrite().  A larger compression chunk\n * size often results in a better compression ratio, but compression may be\n * slower and the speed of random access to data may be reduced.  In addition,\n * some chunk sizes are not compatible with Microsoft software.\n *\n * @param wim\n *\tThe ::WIMStruct for which to set the output chunk size.\n * @param chunk_size\n *\tThe chunk size (in bytes) to set.  The valid chunk sizes are dependent\n *\ton the compression type.  See the documentation for each\n *\t::wimlib_compression_type constant for more information.  As a special\n *\tcase, if @p chunk_size is specified as 0, then the chunk size will be\n *\treset to the default for the currently selected output compression type.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_INVALID_CHUNK_SIZE\n *\t@p chunk_size was not 0 or a supported chunk size for the currently\n *\tselected output compression type.\n */\nWIMLIBAPI int\nwimlib_set_output_chunk_size(WIMStruct *wim, uint32_t chunk_size);\n\n/**\n * @ingroup G_writing_and_overwriting_wims\n *\n * Similar to wimlib_set_output_chunk_size(), but set the chunk size for writing\n * solid resources.\n */\nWIMLIBAPI int\nwimlib_set_output_pack_chunk_size(WIMStruct *wim, uint32_t chunk_size);\n\n/**\n * @ingroup G_writing_and_overwriting_wims\n *\n * Set a ::WIMStruct's output compression type.  This is the compression type\n * that will be used for writing non-solid resources in subsequent calls to\n * wimlib_write() or wimlib_overwrite().\n *\n * @param wim\n *\tThe ::WIMStruct for which to set the output compression type.\n * @param ctype\n *\tThe compression type to set.  If this compression type is incompatible\n *\twith the current output chunk size, then the output chunk size will be\n *\treset to the default for the new compression type.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE\n *\t@p ctype did not specify a valid compression type.\n */\nWIMLIBAPI int\nwimlib_set_output_compression_type(WIMStruct *wim,\n\t\t\t\t   enum wimlib_compression_type ctype);\n\n/**\n * @ingroup G_writing_and_overwriting_wims\n *\n * Similar to wimlib_set_output_compression_type(), but set the compression type\n * for writing solid resources.  This cannot be ::WIMLIB_COMPRESSION_TYPE_NONE.\n */\nWIMLIBAPI int\nwimlib_set_output_pack_compression_type(WIMStruct *wim,\n\t\t\t\t\tenum wimlib_compression_type ctype);\n\n/**\n * @ingroup G_general\n *\n * Set whether wimlib can print error and warning messages to the error file,\n * which defaults to standard error.  Error and warning messages may provide\n * information that cannot be determined only from returned error codes.\n *\n * By default, error messages are not printed.\n *\n * This setting applies globally (it is not per-WIM).\n *\n * This can be called before wimlib_global_init().\n *\n * @param show_messages\n *\t@c true if messages are to be printed; @c false if messages are not to\n *\tbe printed.\n *\n * @return 0\n */\nWIMLIBAPI int\nwimlib_set_print_errors(bool show_messages);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Set basic information about a WIM.\n *\n * @param wim\n *\tPointer to the ::WIMStruct for a WIM.\n * @param info\n *\tPointer to a ::wimlib_wim_info structure that contains the information\n *\tto set.  Only the information explicitly specified in the @p which flags\n *\tneed be valid.\n * @param which\n *\tFlags that specify which information to set.  This is a bitwise OR of\n *\t::WIMLIB_CHANGE_READONLY_FLAG, ::WIMLIB_CHANGE_GUID,\n *\t::WIMLIB_CHANGE_BOOT_INDEX, and/or ::WIMLIB_CHANGE_RPFIX_FLAG.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_IMAGE_COUNT\n *\t::WIMLIB_CHANGE_BOOT_INDEX was specified, but\n *\t::wimlib_wim_info.boot_index did not specify 0 or a valid 1-based image\n *\tindex in the WIM.\n */\nWIMLIBAPI int\nwimlib_set_wim_info(WIMStruct *wim, const struct wimlib_wim_info *info,\n\t\t    int which);\n\n/**\n * @ingroup G_nonstandalone_wims\n *\n * Split a WIM into multiple parts.\n *\n * @param wim\n *\tThe ::WIMStruct for the WIM to split.\n * @param swm_name\n *\tName of the split WIM (SWM) file to create.  This will be the name of\n *\tthe first part.  The other parts will, by default, have the same name\n *\twith 2, 3, 4, ..., etc.  appended before the suffix.  However, the exact\n *\tnames can be customized using the progress function.\n * @param part_size\n *\tThe maximum size per part, in bytes.  Unfortunately, it is not\n *\tguaranteed that this will really be the maximum size per part, because\n *\tsome file resources in the WIM may be larger than this size, and the WIM\n *\tfile format provides no way to split up file resources among multiple\n *\tWIMs.\n * @param write_flags\n *\tBitwise OR of relevant flags prefixed with @c WIMLIB_WRITE_FLAG.  These\n *\tflags will be used to write each split WIM part.  Specify 0 here to get\n *\tthe default behavior.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.  This function\n * may return most error codes that can be returned by wimlib_write() as well as\n * the following error codes:\n *\n * @retval ::WIMLIB_ERR_INVALID_PARAM\n *\t@p swm_name was not a nonempty string, or @p part_size was 0.\n * @retval ::WIMLIB_ERR_UNSUPPORTED\n *\tThe WIM contains solid resources.  Splitting a WIM containing solid\n *\tresources is not supported.\n *\n * If a progress function is registered with @p wim, then for each split WIM\n * part that is written it will receive the messages\n * ::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART and\n * ::WIMLIB_PROGRESS_MSG_SPLIT_END_PART.  Since wimlib v1.13.4 it will also\n * receive ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS messages while writing each part;\n * these messages will report the progress of the current part only.\n */\nWIMLIBAPI int\nwimlib_split(WIMStruct *wim,\n\t     const wimlib_tchar *swm_name,\n\t     uint64_t part_size,\n\t     int write_flags);\n\n#ifdef _RUFUS\nstatic __inline int\nwimlib_splitU(WIMStruct *wim,\n\t     const char *swm_name,\n\t     uint64_t part_size,\n\t     int write_flags)\n{\n\twconvert(swm_name);\n\tint r = wimlib_split(wim, wswm_name, part_size, write_flags);\n\twfree(swm_name);\n\treturn r;\n}\n#endif\n\n/**\n * @ingroup G_general\n *\n * Perform verification checks on a WIM file.\n *\n * This function is intended for safety checking and/or debugging.  If used on a\n * well-formed WIM file, it should always succeed.\n *\n * @param wim\n *\tThe ::WIMStruct for the WIM file to verify.  Note: for an extra layer of\n *\tverification, it is a good idea to have used\n *\t::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY when you opened the file.\n *\t<br/>\n *\tIf verifying a split WIM, specify the first part of the split WIM here,\n *\tand reference the other parts using wimlib_reference_resource_files()\n *\tbefore calling this function.\n * @param verify_flags\n *\tReserved; must be 0.\n *\n * @return 0 if the WIM file was successfully verified; a ::wimlib_error_code\n * value if it failed verification or another error occurred.\n *\n * @retval ::WIMLIB_ERR_DECOMPRESSION\n *\tThe WIM file contains invalid compressed data.\n * @retval ::WIMLIB_ERR_INVALID_METADATA_RESOURCE\n *\tThe metadata resource for an image is invalid.\n * @retval ::WIMLIB_ERR_INVALID_RESOURCE_HASH\n *\tFile data stored in the WIM file is corrupt.\n * @retval ::WIMLIB_ERR_RESOURCE_NOT_FOUND\n *\tThe data for a file in an image could not be found.  See @ref\n *\tG_nonstandalone_wims.\n *\n * If a progress function is registered with @p wim, then it will receive the\n * following progress messages: ::WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE,\n * ::WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE, and\n * ::WIMLIB_PROGRESS_MSG_VERIFY_STREAMS.\n */\nWIMLIBAPI int\nwimlib_verify_wim(WIMStruct *wim, int verify_flags);\n\n/**\n * @ingroup G_mounting_wim_images\n *\n * Unmount a WIM image that was mounted using wimlib_mount_image().\n *\n * When unmounting a read-write mounted image, the default behavior is to\n * discard changes to the image.  Use ::WIMLIB_UNMOUNT_FLAG_COMMIT to cause the\n * image to be committed.\n *\n * @param dir\n *\tThe directory on which the WIM image is mounted.\n * @param unmount_flags\n *\tBitwise OR of flags prefixed with @p WIMLIB_UNMOUNT_FLAG.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_NOT_A_MOUNTPOINT\n *\tThere is no WIM image mounted on the specified directory.\n * @retval ::WIMLIB_ERR_MOUNTED_IMAGE_IS_BUSY\n *\tThe read-write mounted image cannot be committed because there are file\n *\tdescriptors open to it, and ::WIMLIB_UNMOUNT_FLAG_FORCE was not\n *\tspecified.\n * @retval ::WIMLIB_ERR_MQUEUE\n *\tCould not create a POSIX message queue.\n * @retval ::WIMLIB_ERR_NOT_PERMITTED_TO_UNMOUNT\n *\tThe image was mounted by a different user.\n * @retval ::WIMLIB_ERR_UNSUPPORTED\n *\tMounting is not supported in this build of the library.\n *\n * Note: you can also unmount the image by using the @c umount() system call, or\n * by using the @c umount or @c fusermount programs.  However, you need to call\n * this function if you want changes to be committed.\n */\nWIMLIBAPI int\nwimlib_unmount_image(const wimlib_tchar *dir, int unmount_flags);\n\n/**\n * @ingroup G_mounting_wim_images\n *\n * Same as wimlib_unmount_image(), but allows specifying a progress function.\n * The progress function will receive a ::WIMLIB_PROGRESS_MSG_UNMOUNT_BEGIN\n * message.  In addition, if changes are committed from a read-write mount, the\n * progress function will receive ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS messages.\n */\nWIMLIBAPI int\nwimlib_unmount_image_with_progress(const wimlib_tchar *dir,\n\t\t\t\t   int unmount_flags,\n\t\t\t\t   wimlib_progress_func_t progfunc,\n\t\t\t\t   void *progctx);\n\n/**\n * @ingroup G_modifying_wims\n *\n * Update a WIM image by adding, deleting, and/or renaming files or directories.\n *\n * @param wim\n *\tPointer to the ::WIMStruct containing the image to update.\n * @param image\n *\tThe 1-based index of the image to update.\n * @param cmds\n *\tAn array of ::wimlib_update_command's that specify the update operations\n *\tto perform.\n * @param num_cmds\n *\tNumber of commands in @p cmds.\n * @param update_flags\n *\t::WIMLIB_UPDATE_FLAG_SEND_PROGRESS or 0.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.  On failure,\n * all update commands will be rolled back, and no visible changes will have\n * been made to @p wim.\n *\n * @retval ::WIMLIB_ERR_FVE_LOCKED_VOLUME\n *\tWindows-only: One of the \"add\" commands attempted to add files from an\n *\tencrypted BitLocker volume that hasn't yet been unlocked.\n * @retval ::WIMLIB_ERR_IMAGE_HAS_MULTIPLE_REFERENCES\n *\tThere are currently multiple references to the image as a result of a\n *\tcall to wimlib_export_image().  Free one before attempting the update.\n * @retval ::WIMLIB_ERR_INVALID_CAPTURE_CONFIG\n *\tThe contents of a capture configuration file were invalid.\n * @retval ::WIMLIB_ERR_INVALID_IMAGE\n *\t@p image did not exist in @p wim.\n * @retval ::WIMLIB_ERR_INVALID_OVERLAY\n *\tAn add command with ::WIMLIB_ADD_FLAG_NO_REPLACE specified attempted to\n *\treplace an existing nondirectory file.\n * @retval ::WIMLIB_ERR_INVALID_PARAM\n *\tAn unknown operation type was provided in the update commands; or\n *\tunknown or incompatible flags were provided in a flags parameter; or\n *\tthere was another problem with the provided parameters.\n * @retval ::WIMLIB_ERR_INVALID_REPARSE_DATA\n *\tWhile executing an add command, a reparse point had invalid data.\n * @retval ::WIMLIB_ERR_IS_DIRECTORY\n *\tAn add command attempted to replace a directory with a non-directory; or\n *\ta delete command without ::WIMLIB_DELETE_FLAG_RECURSIVE attempted to\n *\tdelete a directory; or a rename command attempted to rename a directory\n *\tto a non-directory.\n * @retval ::WIMLIB_ERR_NOTDIR\n *\tAn add command attempted to replace a non-directory with a directory; or\n *\tan add command attempted to set the root of the image to a\n *\tnon-directory; or a rename command attempted to rename a directory to a\n *\tnon-directory; or a component of an image path that was used as a\n *\tdirectory was not, in fact, a directory.\n * @retval ::WIMLIB_ERR_NOTEMPTY\n *\tA rename command attempted to rename a directory to a non-empty\n *\tdirectory; or a rename command would have created a loop.\n * @retval ::WIMLIB_ERR_NTFS_3G\n *\tWhile executing an add command with ::WIMLIB_ADD_FLAG_NTFS specified, an\n *\terror occurred while reading data from the NTFS volume using libntfs-3g.\n * @retval ::WIMLIB_ERR_OPEN\n *\tFailed to open a file to be captured while executing an add command.\n * @retval ::WIMLIB_ERR_OPENDIR\n *\tFailed to open a directory to be captured while executing an add\n *\tcommand.\n * @retval ::WIMLIB_ERR_PATH_DOES_NOT_EXIST\n *\tA delete command without ::WIMLIB_DELETE_FLAG_FORCE specified was for a\n *\tWIM path that did not exist; or a rename command attempted to rename a\n *\tfile that does not exist.\n * @retval ::WIMLIB_ERR_READ\n *\tWhile executing an add command, failed to read data from a file or\n *\tdirectory to be captured.\n * @retval ::WIMLIB_ERR_READLINK\n *\tWhile executing an add command, failed to read the target of a symbolic\n *\tlink, junction, or other reparse point.\n * @retval ::WIMLIB_ERR_STAT\n *\tWhile executing an add command, failed to read metadata for a file or\n *\tdirectory.\n * @retval ::WIMLIB_ERR_UNABLE_TO_READ_CAPTURE_CONFIG\n *\tA capture configuration file could not be read.\n * @retval ::WIMLIB_ERR_UNSUPPORTED\n *\tA command had flags provided that are not supported on this platform or\n *\tin this build of the library.\n * @retval ::WIMLIB_ERR_UNSUPPORTED_FILE\n *\tAn add command with ::WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE specified\n *\tdiscovered a file that was not of a supported type.\n *\n * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION,\n * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND,\n * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which\n * indicate failure (for different reasons) to read the metadata resource for an\n * image that needed to be updated.\n */\nWIMLIBAPI int\nwimlib_update_image(WIMStruct *wim,\n\t\t    int image,\n\t\t    const struct wimlib_update_command *cmds,\n\t\t    size_t num_cmds,\n\t\t    int update_flags);\n\n/**\n * @ingroup G_writing_and_overwriting_wims\n *\n * Persist a ::WIMStruct to a new on-disk WIM file.\n *\n * This brings in file data from any external locations, such as directory trees\n * or NTFS volumes scanned with wimlib_add_image(), or other WIM files via\n * wimlib_export_image(), and incorporates it into a new on-disk WIM file.\n *\n * By default, the new WIM file is written as stand-alone.  Using the\n * ::WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS flag, a \"delta\" WIM can be written\n * instead.  However, this function cannot directly write a \"split\" WIM; use\n * wimlib_split() for that.\n *\n * @param wim\n *\tPointer to the ::WIMStruct being persisted.\n * @param path\n *\tThe path to the on-disk file to write.\n * @param image\n *\tNormally, specify ::WIMLIB_ALL_IMAGES here.  This indicates that all\n *\timages are to be included in the new on-disk WIM file.  If for some\n *\treason you only want to include a single image, specify the 1-based\n *\tindex of that image instead.\n * @param write_flags\n *\tBitwise OR of flags prefixed with @c WIMLIB_WRITE_FLAG.\n * @param num_threads\n *\tThe number of threads to use for compressing data, or 0 to have the\n *\tlibrary automatically choose an appropriate number.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED\n *\tA file that had previously been scanned for inclusion in the WIM was\n *\tconcurrently modified.\n * @retval ::WIMLIB_ERR_INVALID_IMAGE\n *\t@p image did not exist in @p wim.\n * @retval ::WIMLIB_ERR_INVALID_RESOURCE_HASH\n *\tA file, stored in another WIM, which needed to be written was corrupt.\n * @retval ::WIMLIB_ERR_INVALID_PARAM\n *\t@p path was not a nonempty string, or invalid flags were passed.\n * @retval ::WIMLIB_ERR_OPEN\n *\tFailed to open the output WIM file for writing, or failed to open a file\n *\twhose data needed to be included in the WIM.\n * @retval ::WIMLIB_ERR_READ\n *\tFailed to read data that needed to be included in the WIM.\n * @retval ::WIMLIB_ERR_RESOURCE_NOT_FOUND\n *\tA file data blob that needed to be written could not be found in the\n *\tblob lookup table of @p wim.  See @ref G_nonstandalone_wims.\n * @retval ::WIMLIB_ERR_WRITE\n *\tAn error occurred when trying to write data to the new WIM file.\n *\n * This function can additionally return ::WIMLIB_ERR_DECOMPRESSION,\n * ::WIMLIB_ERR_INVALID_METADATA_RESOURCE, ::WIMLIB_ERR_METADATA_NOT_FOUND,\n * ::WIMLIB_ERR_READ, or ::WIMLIB_ERR_UNEXPECTED_END_OF_FILE, all of which\n * indicate failure (for different reasons) to read the data from a WIM file.\n *\n * If a progress function is registered with @p wim, then it will receive the\n * messages ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS,\n * ::WIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN, and\n * ::WIMLIB_PROGRESS_MSG_WRITE_METADATA_END.\n */\nWIMLIBAPI int\nwimlib_write(WIMStruct *wim,\n\t     const wimlib_tchar *path,\n\t     int image,\n\t     int write_flags,\n\t     unsigned num_threads);\n\n/**\n * @ingroup G_writing_and_overwriting_wims\n *\n * Same as wimlib_write(), but write the WIM directly to a file descriptor,\n * which need not be seekable if the write is done in a special pipable WIM\n * format by providing ::WIMLIB_WRITE_FLAG_PIPABLE in @p write_flags.  This can,\n * for example, allow capturing a WIM image and streaming it over the network.\n * See @ref subsec_pipable_wims for more information about pipable WIMs.\n *\n * The file descriptor @p fd will @b not be closed when the write is complete;\n * the calling code is responsible for this.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.  The possible\n * error codes include those that can be returned by wimlib_write() as well as\n * the following:\n *\n * @retval ::WIMLIB_ERR_INVALID_PARAM\n *\t@p fd was not seekable, but ::WIMLIB_WRITE_FLAG_PIPABLE was not\n *\tspecified in @p write_flags.\n */\nWIMLIBAPI int\nwimlib_write_to_fd(WIMStruct *wim,\n\t\t   int fd,\n\t\t   int image,\n\t\t   int write_flags,\n\t\t   unsigned num_threads);\n\n/**\n * @defgroup G_compression Compression and decompression functions\n *\n * @brief Functions for XPRESS, LZX, and LZMS compression and decompression.\n *\n * These functions are already used by wimlib internally when appropriate for\n * reading and writing WIM archives.  But they are exported and documented so\n * that they can be used in other applications or libraries for general-purpose\n * lossless data compression.  They are implemented in highly optimized C code,\n * using state-of-the-art compression techniques.  The main limitation is the\n * lack of sliding window support; this has, however, allowed the algorithms to\n * be optimized for block-based compression.\n *\n * @{\n */\n\n/** Opaque compressor handle.  */\nstruct wimlib_compressor;\n\n/** Opaque decompressor handle.  */\nstruct wimlib_decompressor;\n\n/**\n * Set the default compression level for the specified compression type.  This\n * is the compression level that wimlib_create_compressor() assumes if it is\n * called with @p compression_level specified as 0.\n *\n * wimlib's WIM writing code (e.g. wimlib_write()) will pass 0 to\n * wimlib_create_compressor() internally.  Therefore, calling this function will\n * affect the compression level of any data later written to WIM files using the\n * specified compression type.\n *\n * The initial state, before this function is called, is that all compression\n * types have a default compression level of 50.\n *\n * @param ctype\n *\tCompression type for which to set the default compression level, as one\n *\tof the ::wimlib_compression_type constants.  Or, if this is the special\n *\tvalue -1, the default compression levels for all compression types will\n *\tbe set.\n * @param compression_level\n *\tThe default compression level to set.  If 0, the \"default default\" level\n *\tof 50 is restored.  Otherwise, a higher value indicates higher\n *\tcompression, whereas a lower value indicates lower compression.  See\n *\twimlib_create_compressor() for more information.\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE\n *\t@p ctype was neither a supported compression type nor -1.\n */\nWIMLIBAPI int\nwimlib_set_default_compression_level(int ctype, unsigned int compression_level);\n\n/**\n * Return the approximate number of bytes needed to allocate a compressor with\n * wimlib_create_compressor() for the specified compression type, maximum block\n * size, and compression level.  @p compression_level may be 0, in which case\n * the current default compression level for @p ctype is used.  Returns 0 if the\n * compression type is invalid, or the @p max_block_size for that compression\n * type is invalid.\n */\nWIMLIBAPI uint64_t\nwimlib_get_compressor_needed_memory(enum wimlib_compression_type ctype,\n\t\t\t\t    size_t max_block_size,\n\t\t\t\t    unsigned int compression_level);\n\n#define WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE\t0x80000000\n\n/**\n * Allocate a compressor for the specified compression type using the specified\n * parameters.  This function is part of wimlib's compression API; it is not\n * necessary to call this to process a WIM file.\n *\n * @param ctype\n *\tCompression type for which to create the compressor, as one of the\n *\t::wimlib_compression_type constants.\n * @param max_block_size\n *\tThe maximum compression block size to support.  This specifies the\n *\tmaximum allowed value for the @p uncompressed_size parameter of\n *\twimlib_compress() when called using this compressor.\n *\t<br/>\n *\tUsually, the amount of memory used by the compressor will scale in\n *\tproportion to the @p max_block_size parameter.\n *\twimlib_get_compressor_needed_memory() can be used to query the specific\n *\tamount of memory that will be required.\n *\t<br/>\n *\tThis parameter must be at least 1 and must be less than or equal to a\n *\tcompression-type-specific limit.\n *\t<br/>\n *\tIn general, the same value of @p max_block_size must be passed to\n *\twimlib_create_decompressor() when the data is later decompressed.\n *\tHowever, some compression types have looser requirements regarding this.\n * @param compression_level\n *\tThe compression level to use.  If 0, the default compression level (50,\n *\tor another value as set through wimlib_set_default_compression_level())\n *\tis used.  Otherwise, a higher value indicates higher compression.  The\n *\tvalues are scaled so that 10 is low compression, 50 is medium\n *\tcompression, and 100 is high compression.  This is not a percentage;\n *\tvalues above 100 are also valid.\n *\t<br/>\n *\tUsing a higher-than-default compression level can result in a better\n *\tcompression ratio, but can significantly reduce performance.  Similarly,\n *\tusing a lower-than-default compression level can result in better\n *\tperformance, but can significantly worsen the compression ratio.  The\n *\texact results will depend heavily on the compression type and what\n *\talgorithms are implemented for it.  If you are considering using a\n *\tnon-default compression level, you should run benchmarks to see if it is\n *\tworthwhile for your application.\n *\t<br/>\n *\tThe compression level does not affect the format of the compressed data.\n *\tTherefore, it is a compressor-only parameter and does not need to be\n *\tpassed to the decompressor.\n *\t<br/>\n *\tSince wimlib v1.8.0, this parameter can be OR-ed with the flag\n *\t::WIMLIB_COMPRESSOR_FLAG_DESTRUCTIVE.  This creates the compressor in a\n *\tmode where it is allowed to modify the input buffer.  Specifically, in\n *\tthis mode, if compression succeeds, the input buffer may have been\n *\tmodified, whereas if compression does not succeed the input buffer still\n *\tmay have been written to but will have been restored exactly to its\n *\toriginal state.  This mode is designed to save some memory when using\n *\tlarge buffer sizes.\n * @param compressor_ret\n *\tA location into which to return the pointer to the allocated compressor.\n *\tThe allocated compressor can be used for any number of calls to\n *\twimlib_compress() before being freed with wimlib_free_compressor().\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE\n *\t@p ctype was not a supported compression type.\n * @retval ::WIMLIB_ERR_INVALID_PARAM\n *\t@p max_block_size was invalid for the compression type, or @p\n *\tcompressor_ret was @c NULL.\n * @retval ::WIMLIB_ERR_NOMEM\n *\tInsufficient memory to allocate the compressor.\n */\nWIMLIBAPI int\nwimlib_create_compressor(enum wimlib_compression_type ctype,\n\t\t\t size_t max_block_size,\n\t\t\t unsigned int compression_level,\n\t\t\t struct wimlib_compressor **compressor_ret);\n\n/**\n * Compress a buffer of data.\n *\n * @param uncompressed_data\n *\tBuffer containing the data to compress.\n * @param uncompressed_size\n *\tSize, in bytes, of the data to compress.  This cannot be greater than\n *\tthe @p max_block_size with which wimlib_create_compressor() was called.\n *\t(If it is, the data will not be compressed and 0 will be returned.)\n * @param compressed_data\n *\tBuffer into which to write the compressed data.\n * @param compressed_size_avail\n *\tNumber of bytes available in @p compressed_data.\n * @param compressor\n *\tA compressor previously allocated with wimlib_create_compressor().\n *\n * @return\n *\tThe size of the compressed data, in bytes, or 0 if the data could not be\n *\tcompressed to @p compressed_size_avail or fewer bytes.\n */\nWIMLIBAPI size_t\nwimlib_compress(const void *uncompressed_data, size_t uncompressed_size,\n\t\tvoid *compressed_data, size_t compressed_size_avail,\n\t\tstruct wimlib_compressor *compressor);\n\n/**\n * Free a compressor previously allocated with wimlib_create_compressor().\n *\n * @param compressor\n *\tThe compressor to free.  If @c NULL, no action is taken.\n */\nWIMLIBAPI void\nwimlib_free_compressor(struct wimlib_compressor *compressor);\n\n/**\n * Allocate a decompressor for the specified compression type.  This function is\n * part of wimlib's compression API; it is not necessary to call this to process\n * a WIM file.\n *\n * @param ctype\n *\tCompression type for which to create the decompressor, as one of the\n *\t::wimlib_compression_type constants.\n * @param max_block_size\n *\tThe maximum compression block size to support.  This specifies the\n *\tmaximum allowed value for the @p uncompressed_size parameter of\n *\twimlib_decompress().\n *\t<br/>\n *\tIn general, this parameter must be the same as the @p max_block_size\n *\tthat was passed to wimlib_create_compressor() when the data was\n *\tcompressed.  However, some compression types have looser requirements\n *\tregarding this.\n * @param decompressor_ret\n *\tA location into which to return the pointer to the allocated\n *\tdecompressor.  The allocated decompressor can be used for any number of\n *\tcalls to wimlib_decompress() before being freed with\n *\twimlib_free_decompressor().\n *\n * @return 0 on success; a ::wimlib_error_code value on failure.\n *\n * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE\n *\t@p ctype was not a supported compression type.\n * @retval ::WIMLIB_ERR_INVALID_PARAM\n *\t@p max_block_size was invalid for the compression type, or @p\n *\tdecompressor_ret was @c NULL.\n * @retval ::WIMLIB_ERR_NOMEM\n *\tInsufficient memory to allocate the decompressor.\n */\nWIMLIBAPI int\nwimlib_create_decompressor(enum wimlib_compression_type ctype,\n\t\t\t   size_t max_block_size,\n\t\t\t   struct wimlib_decompressor **decompressor_ret);\n\n/**\n * Decompress a buffer of data.\n *\n * @param compressed_data\n *\tBuffer containing the data to decompress.\n * @param compressed_size\n *\tSize, in bytes, of the data to decompress.\n * @param uncompressed_data\n *\tBuffer into which to write the uncompressed data.\n * @param uncompressed_size\n *\tSize, in bytes, of the data when uncompressed.  This cannot exceed the\n *\t@p max_block_size with which wimlib_create_decompressor() was called.\n *\t(If it does, the data will not be decompressed and a nonzero value will\n *\tbe returned.)\n * @param decompressor\n *\tA decompressor previously allocated with wimlib_create_decompressor().\n *\n * @return 0 on success; nonzero on failure.\n *\n * No specific error codes are defined; any nonzero value indicates that the\n * decompression failed.  This can only occur if the data is truly invalid;\n * there will never be transient errors like \"out of memory\", for example.\n *\n * This function requires that the exact uncompressed size of the data be passed\n * as the @p uncompressed_size parameter.  If this is not done correctly,\n * decompression may fail or the data may be decompressed incorrectly.\n */\nWIMLIBAPI int\nwimlib_decompress(const void *compressed_data, size_t compressed_size,\n\t\t  void *uncompressed_data, size_t uncompressed_size,\n\t\t  struct wimlib_decompressor *decompressor);\n\n/**\n * Free a decompressor previously allocated with wimlib_create_decompressor().\n *\n * @param decompressor\n *\tThe decompressor to free.  If @c NULL, no action is taken.\n */\nWIMLIBAPI void\nwimlib_free_decompressor(struct wimlib_decompressor *decompressor);\n\n\n/**\n * @}\n */\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* _WIMLIB_H */\n"
  },
  {
    "path": "src/wimlib/wimlib_tchar.h",
    "content": "#ifndef _WIMLIB_TCHAR_H\n#define _WIMLIB_TCHAR_H\n\n/* Functions to act on \"tchar\" strings, which have a platform-dependent encoding\n * and character size. */\n\n#if defined(_WIN32)\n#include <wchar.h>\n/*\n * For Windows builds, the \"tchar\" type will be 2 bytes and will be equivalent\n * to \"wchar_t\" and \"utf16lechar\".  All indicate one coding unit of a string\n * encoded in UTF-16LE with the additional possibility of unpaired surrogates.\n */\ntypedef wchar_t tchar;\n#  define TCHAR_IS_UTF16LE 1\n#  define _T(text) L##text\n#  define T(text) _T(text) /* Make a string literal into a wide string */\n#  define TS \"ls\" /* Format a string of \"tchar\" */\n#  define TC \"lc\" /* Format a \"tchar\" */\n\n/* For Windows builds, the following definitions replace the \"tchar\" functions\n * with the \"wide-character\" functions. */\n#  define tmemchr\twmemchr\n#  define tmemcpy\twmemcpy\n#  define tmemmove\twmemmove\n#  define tmempcpy\twmempcpy\n#  define tstrcat\twcscat\n#  define tstrcpy\twcscpy\n#ifdef _RUFUS\n#  define tprintf\twuprintf\n#else\n#  define tprintf\twprintf\n#endif\n#ifdef _WIN32\n#  define tsprintf\t_swprintf\n#else\n#  define tsprintf\tswprintf\n#endif\n#  define tsnprintf snwprintf\n#ifdef _RUFUS\n#  define tfprintf(f, ...)\t((f == stdout || f == stderr) ? wuprintf(__VA_ARGS__) : fwprintf(f, __VA_ARGS__))\n#else\n#  define tfprintf\tfwprintf\n#endif\n#  define tvfprintf\tvfwprintf\n#  define tscanf\tswscanf\n#  define istalpha(c)\tiswalpha((wchar_t)(c))\n#  define istspace(c)\tiswspace((wchar_t)(c))\n#  define totlower(c)\ttowlower((wchar_t)(c))\n#  define tstrcmp\twcscmp\n#  define tstrncmp\twcsncmp\n#  define tstrchr\twcschr\n#  define tstrpbrk\twcspbrk\n#  define tstrrchr\twcsrchr\n#  define tstrstr\twcsstr\n#  define tstrlen\twcslen\n#  define tmemcmp\twmemcmp\n#  define tstrcasecmp\t_wcsicmp\n#  define tstrftime\twcsftime\n#ifdef _RUFUS\n#  define tputchar(c)\twuprintf(L\"%c\", c)\n#  define tputc(c, f)\t((f == stdout || f == stderr) ? wuprintf(L\"%c\", c) : _putw(c, f))\n#  define tputs(s)\t\twuprintf(L\"%s\\n\", s)\n#  define tfputs(s, f)\t((f == stdout || f == stderr) ? wuprintf(s) : fputws(s, f))\n#else\n#  define tputchar\tputwchar\n#  define tputc\t\tputwc\n#  define tputs\t\t_putws\n#  define tfputs\tfputws\n#endif\n#  define tfopen\t_wfopen\n#  define topen\t\t_wopen\n#  define tstat\t\t_wstati64\n#  define tstrtol\twcstol\n#  define tstrtod\twcstod\n#  define tstrtoul\twcstoul\n#  define tstrtoull\twcstoull\n#  define tunlink\t_wunlink\n#  define tstrerror\t_wcserror\n#  define taccess\t_waccess\n#  define tstrdup\twcsdup\n#  define tgetenv\t_wgetenv\n/* The following \"tchar\" functions do not have exact wide-character equivalents\n * on Windows so require parameter rearrangement or redirection to a replacement\n * function defined ourselves. */\n#  define TSTRDUP\tWCSDUP\n#  define tmkdir(path, mode) _wmkdir(path)\n#  define tstrerror_r(errnum, buf, bufsize) \\\n\t\t\t_wcserror_s((buf), (bufsize), (errnum))\n#  define trename\twin32_rename_replacement\n#  define tglob\t\twin32_wglob\n#else /* _WIN32 */\n/*\n * For non-Windows builds, the \"tchar\" type will be one byte and will specify a\n * string encoded in UTF-8 with the additional possibility of surrogate\n * codepoints.\n */\ntypedef char tchar;\n#  define TCHAR_IS_UTF16LE 0\n#  define T(text) text /* In this case, strings of \"tchar\" are simply strings of\n\t\t\t  char */\n#  define TS \"s\"       /* Similarly, a string of \"tchar\" is printed just as a\n\t\t\t  normal string. */\n#  define TC \"c\"       /* Print a single character */\n/* For non-Windows builds, replace the \"tchar\" functions with the regular old\n * string functions. */\n#  define tmemchr\tmemchr\n#  define tmemcpy\tmemcpy\n#  define tmemmove\tmemmove\n#  define tmempcpy\tmempcpy\n#  define tstrcat\tstrcat\n#  define tstrcpy\tstrcpy\n#  define tprintf\tprintf\n#  define tsprintf\tsprintf\n#  define tfprintf\tfprintf\n#  define tvfprintf\tvfprintf\n#  define tscanf\tsscanf\n#  define istalpha(c)\tisalpha((unsigned char)(c))\n#  define istspace(c)\tisspace((unsigned char)(c))\n#  define totlower(c)\ttolower((unsigned char)(c))\n#  define tstrcmp\tstrcmp\n#  define tstrncmp\tstrncmp\n#  define tstrchr\tstrchr\n#  define tstrpbrk\tstrpbrk\n#  define tstrrchr\tstrrchr\n#  define tstrstr\tstrstr\n#  define tstrlen\tstrlen\n#  define tmemcmp\tmemcmp\n#  define tstrcasecmp   strcasecmp\n#  define tstrftime\tstrftime\n#  define tputchar\tputchar\n#  define tputc\t\tputc\n#  define tputs\t\tputs\n#  define tfputs\tfputs\n#  define tfopen\tfopen\n#  define topen\t\topen\n#  define tstat\t\tstat\n#  define tunlink\tunlink\n#  define tstrerror\tstrerror\n#  define tstrtol\tstrtol\n#  define tstrtod\tstrtod\n#  define tstrtoul\tstrtoul\n#  define tstrtoull\tstrtoull\n#  define tmkdir\tmkdir\n#  define tstrdup\tstrdup\n#  define tgetenv\tgetenv\n#  define TSTRDUP\tSTRDUP\n#  define tstrerror_r\tstrerror_r\n#  define trename\trename\n#  define taccess\taccess\n#  define tglob\t\tglob\n#endif /* !_WIN32 */\n\n#endif /* _WIMLIB_TCHAR_H */\n"
  },
  {
    "path": "src/wimlib/win32_apply.c",
    "content": "/*\n * win32_apply.c - Windows-specific code for applying files from a WIM image.\n */\n\n/*\n * Copyright 2013-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef _WIN32\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/win32_common.h\"\n\n#include \"wimlib/apply.h\"\n#include \"wimlib/assert.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/object_id.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/pattern.h\"\n#include \"wimlib/reparse.h\"\n#include \"wimlib/scan.h\" /* for mangle_pat() and match_pattern_list()  */\n#include \"wimlib/textfile.h\"\n#include \"wimlib/wimboot.h\"\n#include \"wimlib/wof.h\"\n#include \"wimlib/xattr.h\"\n#include \"wimlib/xml.h\"\n\nstruct win32_apply_ctx {\n\n\t/* Extract flags, the pointer to the WIMStruct, etc.  */\n\tstruct apply_ctx common;\n\n\t/* WIMBoot information, only filled in if WIMLIB_EXTRACT_FLAG_WIMBOOT\n\t * was provided  */\n\tstruct {\n\t\t/* This array contains the WIM files registered with WOF on the\n\t\t * target volume for this extraction operation.  All WIMStructs\n\t\t * in this array are distinct and have ->filename != NULL.  */\n\t\tstruct wimboot_wim {\n\t\t\tWIMStruct *wim;\n\t\t\tu64 data_source_id;\n\t\t\tu8 blob_table_hash[SHA1_HASH_SIZE];\n\t\t} *wims;\n\t\tsize_t num_wims;\n\t\tbool wof_running;\n\t\tbool have_wrong_version_wims;\n\t\tbool have_uncompressed_wims;\n\t\tbool have_unsupported_compressed_resources;\n\t\tbool have_huge_resources;\n\t} wimboot;\n\n\t/* External backing information  */\n\tstruct string_list *prepopulate_pats;\n\tvoid *mem_prepopulate_pats;\n\tbool tried_to_load_prepopulate_list;\n\n\t/* Open handle to the target directory  */\n\tHANDLE h_target;\n\n\t/* NT namespace path to the target directory (buffer allocated)  */\n\tUNICODE_STRING target_ntpath;\n\n\t/* Temporary buffer for building paths (buffer allocated)  */\n\tUNICODE_STRING pathbuf;\n\n\t/* Object attributes to reuse for opening files in the target directory.\n\t * (attr.ObjectName == &pathbuf) and (attr.RootDirectory == h_target).\n\t */\n\tOBJECT_ATTRIBUTES attr;\n\n\t/* Temporary I/O status block for system calls  */\n\tIO_STATUS_BLOCK iosb;\n\n\t/* Allocated buffer for creating \"printable\" paths from our\n\t * target-relative NT paths  */\n\twchar_t *print_buffer;\n\n\t/* Allocated buffer for reading blob data when it cannot be extracted\n\t * directly  */\n\tu8 *data_buffer;\n\n\t/* Pointer to the next byte in @data_buffer to fill  */\n\tu8 *data_buffer_ptr;\n\n\t/* Size allocated in @data_buffer  */\n\tsize_t data_buffer_size;\n\n\t/* Current offset in the raw encrypted file being written  */\n\tsize_t encrypted_offset;\n\n\t/* Current size of the raw encrypted file being written  */\n\tsize_t encrypted_size;\n\n\t/* Temporary buffer for reparse data  */\n\tstruct reparse_buffer_disk rpbuf;\n\n\t/* Temporary buffer for reparse data of \"fixed\" absolute symbolic links\n\t * and junctions  */\n\tstruct reparse_buffer_disk rpfixbuf;\n\n\t/* Array of open handles to filesystem streams currently being written\n\t */\n\tHANDLE open_handles[MAX_OPEN_FILES];\n\n\t/* Number of handles in @open_handles currently open (filled in from the\n\t * beginning of the array)  */\n\tunsigned num_open_handles;\n\n\t/* For each currently open stream, whether we're writing to it in\n\t * \"sparse\" mode or not.  */\n\tbool is_sparse_stream[MAX_OPEN_FILES];\n\n\t/* Whether is_sparse_stream[] is true for any currently open stream  */\n\tbool any_sparse_streams;\n\n\t/* List of dentries, joined by @d_tmp_list, that need to have reparse\n\t * data extracted as soon as the whole blob has been read into\n\t * @data_buffer.  */\n\tstruct list_head reparse_dentries;\n\n\t/* List of dentries, joined by @d_tmp_list, that need to have raw\n\t * encrypted data extracted as soon as the whole blob has been read into\n\t * @data_buffer.  */\n\tstruct list_head encrypted_dentries;\n\n\t/* Number of files for which we didn't have permission to set the full\n\t * security descriptor.  */\n\tunsigned long partial_security_descriptors;\n\n\t/* Number of files for which we didn't have permission to set any part\n\t * of the security descriptor.  */\n\tunsigned long no_security_descriptors;\n\n\t/* Number of files for which we couldn't set the short name.  */\n\tunsigned long num_set_short_name_failures;\n\n\t/* Number of files for which we couldn't remove the short name.  */\n\tunsigned long num_remove_short_name_failures;\n\n\t/* Number of files on which we couldn't set System Compression.  */\n\tunsigned long num_system_compression_failures;\n\n\t/* The number of files which, for compatibility with the Windows\n\t * bootloader, were not compressed using the requested system\n\t * compression format.  This includes matches with the hardcoded pattern\n\t * list only; it does not include matches with patterns in\n\t * [PrepopulateList].  */\n\tunsigned long num_system_compression_exclusions;\n\n\t/* Number of files for which we couldn't set the object ID.  */\n\tunsigned long num_object_id_failures;\n\n\t/* Number of files for which we couldn't set extended attributes.  */\n\tunsigned long num_xattr_failures;\n\n\t/* The Windows build number of the image being applied, or 0 if unknown.\n\t */\n\tu64 windows_build_number;\n\n\t/* Have we tried to enable short name support on the target volume yet?\n\t */\n\tbool tried_to_enable_short_names;\n};\n\n/* Get the drive letter from a Windows path, or return the null character if the\n * path is relative.  */\nstatic wchar_t\nget_drive_letter(const wchar_t *path)\n{\n\t/* Skip \\\\?\\ prefix  */\n\tif (!wcsncmp(path, L\"\\\\\\\\?\\\\\", 4))\n\t\tpath += 4;\n\n\t/* Return drive letter if valid  */\n\tif (((path[0] >= L'a' && path[0] <= L'z') ||\n\t     (path[0] >= L'A' && path[0] <= L'Z')) && path[1] == L':')\n\t\treturn path[0];\n\n\treturn L'\\0';\n}\n\nstatic void\nget_vol_flags(const wchar_t *target, DWORD *vol_flags_ret,\n\t      bool *short_names_supported_ret)\n{\n\twchar_t filesystem_name[MAX_PATH + 1];\n\twchar_t drive[4];\n\twchar_t *volume = NULL;\n\n\t*vol_flags_ret = 0;\n\t*short_names_supported_ret = false;\n\n\tdrive[0] = get_drive_letter(target);\n\tif (drive[0]) {\n\t\tdrive[1] = L':';\n\t\tdrive[2] = L'\\\\';\n\t\tdrive[3] = L'\\0';\n\t\tvolume = drive;\n\t}\n\n\tif (!GetVolumeInformation(volume, NULL, 0, NULL, NULL,\n\t\t\t\t  vol_flags_ret, filesystem_name,\n\t\t\t\t  ARRAY_LEN(filesystem_name)))\n\t{\n\t\twin32_warning(GetLastError(),\n\t\t\t      L\"Failed to get volume information for \\\"%ls\\\"\",\n\t\t\t      target);\n\t\treturn;\n\t}\n\n\tif (wcsstr(filesystem_name, L\"NTFS\")) {\n\t\t/*\n\t\t * FILE_SUPPORTS_HARD_LINKS and\n\t\t * FILE_SUPPORTS_EXTENDED_ATTRIBUTES are only supported on\n\t\t * Windows 7 and later.  Force them on anyway if the filesystem\n\t\t * is NTFS.\n\t\t */\n\t\t*vol_flags_ret |= FILE_SUPPORTS_HARD_LINKS;\n\t\t*vol_flags_ret |= FILE_SUPPORTS_EXTENDED_ATTRIBUTES;\n\n\t\t/* There's no volume flag for short names, but according to the\n\t\t * MS documentation they are only user-settable on NTFS.  */\n\t\t*short_names_supported_ret = true;\n\t}\n}\n\nstatic const wchar_t *\ncurrent_path(struct win32_apply_ctx *ctx);\n\nstatic void\nbuild_extraction_path(const struct wim_dentry *dentry,\n\t\t      struct win32_apply_ctx *ctx);\n\nstatic int\nreport_dentry_apply_error(const struct wim_dentry *dentry,\n\t\t\t  struct win32_apply_ctx *ctx, int ret)\n{\n\tbuild_extraction_path(dentry, ctx);\n\treturn report_apply_error(&ctx->common, ret, current_path(ctx));\n}\n\nstatic inline int\ncheck_apply_error(const struct wim_dentry *dentry,\n\t\t  struct win32_apply_ctx *ctx, int ret)\n{\n\tif (unlikely(ret))\n\t\tret = report_dentry_apply_error(dentry, ctx, ret);\n\treturn ret;\n}\n\nstatic int\nwin32_get_supported_features(const wchar_t *target,\n\t\t\t     struct wim_features *supported_features)\n{\n\tDWORD vol_flags;\n\tbool short_names_supported;\n\n\t/* Query the features of the target volume.  */\n\n\tget_vol_flags(target, &vol_flags, &short_names_supported);\n\n\tsupported_features->readonly_files = 1;\n\tsupported_features->hidden_files = 1;\n\tsupported_features->system_files = 1;\n\tsupported_features->archive_files = 1;\n\n\tif (vol_flags & FILE_FILE_COMPRESSION)\n\t\tsupported_features->compressed_files = 1;\n\n\tif (vol_flags & FILE_SUPPORTS_ENCRYPTION) {\n\t\tsupported_features->encrypted_files = 1;\n\t\tsupported_features->encrypted_directories = 1;\n\t}\n\n\tsupported_features->not_context_indexed_files = 1;\n\n\tif (vol_flags & FILE_SUPPORTS_SPARSE_FILES)\n\t\tsupported_features->sparse_files = 1;\n\n\tif (vol_flags & FILE_NAMED_STREAMS)\n\t\tsupported_features->named_data_streams = 1;\n\n\tif (vol_flags & FILE_SUPPORTS_HARD_LINKS)\n\t\tsupported_features->hard_links = 1;\n\n\tif (vol_flags & FILE_SUPPORTS_REPARSE_POINTS)\n\t\tsupported_features->reparse_points = 1;\n\n\tif (vol_flags & FILE_PERSISTENT_ACLS)\n\t\tsupported_features->security_descriptors = 1;\n\n\tif (short_names_supported)\n\t\tsupported_features->short_names = 1;\n\n\tif (vol_flags & FILE_SUPPORTS_OBJECT_IDS)\n\t\tsupported_features->object_ids = 1;\n\n\tsupported_features->timestamps = 1;\n\n\tif (vol_flags & FILE_CASE_SENSITIVE_SEARCH) {\n\t\t/*\n\t\t * The filesystem supports case-sensitive filenames.  But does\n\t\t * the operating system as well?  This normally requires the\n\t\t * registry setting ObCaseInsensitive=0.  We can test it\n\t\t * indirectly by attempting to open the \"\\SystemRoot\" symbolic\n\t\t * link using a name with the wrong case.  If we get\n\t\t * STATUS_OBJECT_NAME_NOT_FOUND instead of STATUS_ACCESS_DENIED,\n\t\t * then case-sensitive names must be enabled.\n\t\t */\n\t\tUNICODE_STRING path;\n\t\tOBJECT_ATTRIBUTES attr;\n\t\tHANDLE h;\n\t\tNTSTATUS status;\n\n\t\tRtlInitUnicodeString(&path, L\"\\\\systemroot\");\n\t\tInitializeObjectAttributes(&attr, &path, 0, NULL, NULL);\n\n\t\tstatus = NtOpenSymbolicLinkObject(&h, 0, &attr);\n\t\tif (status == STATUS_OBJECT_NAME_NOT_FOUND)\n\t\t\tsupported_features->case_sensitive_filenames = 1;\n\t}\n\n\tif (vol_flags & FILE_SUPPORTS_EXTENDED_ATTRIBUTES)\n\t\tsupported_features->xattrs = 1;\n\n\treturn 0;\n}\n\n#define COMPACT_FLAGS\t(WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K |\t\t\\\n\t\t\t WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K |\t\t\\\n\t\t\t WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K |\t\\\n\t\t\t WIMLIB_EXTRACT_FLAG_COMPACT_LZX)\n\n\n\n/*\n * If not done already, load the patterns from the [PrepopulateList] section of\n * WimBootCompress.ini in the WIM image being extracted.\n *\n * Note: WimBootCompress.ini applies to both types of \"external backing\":\n *\n *\t- WIM backing (\"WIMBoot\" - Windows 8.1 and later)\n *\t- File backing (\"System Compression\" - Windows 10 and later)\n */\nstatic int\nload_prepopulate_pats(struct win32_apply_ctx *ctx)\n{\n\tconst wchar_t *path = L\"\\\\Windows\\\\System32\\\\WimBootCompress.ini\";\n\tstruct wim_dentry *dentry;\n\tconst struct blob_descriptor *blob;\n\tint ret;\n\tvoid *buf;\n\tstruct string_list *strings;\n\tvoid *mem;\n\tstruct text_file_section sec;\n\n\tif (ctx->tried_to_load_prepopulate_list)\n\t\treturn 0;\n\n\tctx->tried_to_load_prepopulate_list = true;\n\n\tdentry = get_dentry(ctx->common.wim, path, WIMLIB_CASE_INSENSITIVE);\n\tif (!dentry ||\n\t    (dentry->d_inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY |\n\t\t\t\t\t      FILE_ATTRIBUTE_REPARSE_POINT |\n\t\t\t\t\t      FILE_ATTRIBUTE_ENCRYPTED)) ||\n\t    !(blob = inode_get_blob_for_unnamed_data_stream(dentry->d_inode,\n\t\t\t\t\t\t\t    ctx->common.wim->blob_table)))\n\t{\n\t\tWARNING(\"%ls does not exist in the WIM image.\\n\"\n\t\t\t\"          The default configuration will be used instead; it assumes that all\\n\"\n\t\t\t\"          files are valid for external backing regardless of path, equivalent\\n\"\n\t\t\t\"          to an empty [PrepopulateList] section.\", path);\n\t\treturn WIMLIB_ERR_PATH_DOES_NOT_EXIST;\n\t}\n\n\tret = read_blob_into_alloc_buf(blob, &buf);\n\tif (ret)\n\t\treturn ret;\n\n\tstrings = CALLOC(1, sizeof(struct string_list));\n\tif (!strings) {\n\t\tFREE(buf);\n\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\tsec.name = T(\"PrepopulateList\");\n\tsec.strings = strings;\n\n\tret = load_text_file(path, buf, blob->size, &mem, &sec, 1,\n\t\t\t     LOAD_TEXT_FILE_REMOVE_QUOTES |\n\t\t\t     LOAD_TEXT_FILE_NO_WARNINGS,\n\t\t\t     mangle_pat);\n\tSTATIC_ASSERT(OS_PREFERRED_PATH_SEPARATOR == WIM_PATH_SEPARATOR);\n\tFREE(buf);\n\tif (ret) {\n\t\tFREE(strings);\n\t\treturn ret;\n\t}\n\tctx->prepopulate_pats = strings;\n\tctx->mem_prepopulate_pats = mem;\n\treturn 0;\n}\n\n/* Returns %true if the specified absolute path to a file in the WIM image can\n * be subject to external backing when extracted.  Otherwise returns %false.  */\nstatic bool\ncan_externally_back_path(const wchar_t *path, const struct win32_apply_ctx *ctx)\n{\n\t/* Does the path match a pattern given in the [PrepopulateList] section\n\t * of WimBootCompress.ini?  */\n\tif (ctx->prepopulate_pats && match_pattern_list(path, ctx->prepopulate_pats,\n\t\t\t\t\t\t\tMATCH_RECURSIVELY))\n\t\treturn false;\n\n\t/* Since we attempt to modify the SYSTEM registry after it's extracted\n\t * (see end_wimboot_extraction()), it can't be extracted as externally\n\t * backed.  This extends to associated files such as SYSTEM.LOG that\n\t * also must be writable in order to write to the registry.  Normally,\n\t * SYSTEM is in [PrepopulateList], and the SYSTEM.* files match patterns\n\t * in [ExclusionList] and therefore are not captured in the WIM at all.\n\t * However, a WIM that wasn't specifically captured in \"WIMBoot mode\"\n\t * may contain SYSTEM.* files.  So to make things \"just work\", hard-code\n\t * the pattern.  */\n\tif (match_path(path, L\"\\\\Windows\\\\System32\\\\config\\\\SYSTEM*\", 0))\n\t\treturn false;\n\n\treturn true;\n}\n\n/* Can the specified WIM resource be used as the source of an external backing\n * for the wof.sys WIM provider?  */\nstatic bool\nis_resource_valid_for_external_backing(const struct wim_resource_descriptor *rdesc,\n\t\t\t\t       struct win32_apply_ctx *ctx)\n{\n\t/* Must be the original WIM file format.  This check excludes pipable\n\t * resources and solid resources.  It also excludes other resources\n\t * contained in such files even if they would be otherwise compatible.\n\t */\n\tif (rdesc->wim->hdr.magic != WIM_MAGIC ||\n\t    rdesc->wim->hdr.wim_version != WIM_VERSION_DEFAULT)\n\t{\n\t\tctx->wimboot.have_wrong_version_wims = true;\n\t\treturn false;\n\t}\n\n\t/*\n\t * Whitelist of compression types and chunk sizes supported by\n\t * Microsoft's WOF driver.\n\t *\n\t * Notes:\n\t *    - Uncompressed WIMs result in BSOD.  However, this only applies to\n\t *      the WIM file itself, not to uncompressed resources in a WIM file\n\t *      that is otherwise compressed.\n\t *    - XPRESS 64K sometimes appears to work, but sometimes it causes\n\t *\treads to fail with STATUS_UNSUCCESSFUL.\n\t */\n\tswitch (rdesc->compression_type) {\n\tcase WIMLIB_COMPRESSION_TYPE_NONE:\n\t\tif (rdesc->wim->compression_type == WIMLIB_COMPRESSION_TYPE_NONE) {\n\t\t\tctx->wimboot.have_uncompressed_wims = true;\n\t\t\treturn false;\n\t\t}\n\t\tbreak;\n\tcase WIMLIB_COMPRESSION_TYPE_XPRESS:\n\t\tswitch (rdesc->chunk_size) {\n\t\tcase 4096:\n\t\tcase 8192:\n\t\tcase 16384:\n\t\tcase 32768:\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tctx->wimboot.have_unsupported_compressed_resources = true;\n\t\t\treturn false;\n\t\t}\n\t\tbreak;\n\tcase WIMLIB_COMPRESSION_TYPE_LZX:\n\t\tswitch (rdesc->chunk_size) {\n\t\tcase 32768:\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tctx->wimboot.have_unsupported_compressed_resources = true;\n\t\t\treturn false;\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tctx->wimboot.have_unsupported_compressed_resources = true;\n\t\treturn false;\n\t}\n\n\t/* Microsoft's WoF driver errors out if it tries to satisfy a read with\n\t * ending offset >= 4 GiB from an externally backed file.  */\n\tif (rdesc->uncompressed_size > 4200000000) {\n\t\tctx->wimboot.have_huge_resources = true;\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n#define EXTERNAL_BACKING_NOT_ENABLED\t\t-1\n#define EXTERNAL_BACKING_NOT_POSSIBLE\t\t-2\n#define EXTERNAL_BACKING_EXCLUDED\t\t-3\n\n/*\n * Determines whether the specified file will be externally backed.  Returns a\n * negative status code if no, 0 if yes, or a positive wimlib error code on\n * error.  If the file is excluded from external backing based on its path, then\n * *excluded_dentry_ret is set to the dentry for the path that matched the\n * exclusion rule.\n *\n * Note that this logic applies to both types of \"external backing\":\n *\n *\t- WIM backing (\"WIMBoot\" - Windows 8.1 and later)\n *\t- File backing (\"System Compression\" - Windows 10 and later)\n *\n * However, in the case of WIM backing we also need to validate that the WIM\n * resource that would be the source of the backing is supported by the wof.sys\n * WIM provider.\n */\nstatic int\nwill_externally_back_inode(struct wim_inode *inode, struct win32_apply_ctx *ctx,\n\t\t\t   const struct wim_dentry **excluded_dentry_ret,\n\t\t\t   bool wimboot_mode)\n{\n\tstruct wim_dentry *dentry;\n\tstruct blob_descriptor *blob;\n\tint ret;\n\n\tif (load_prepopulate_pats(ctx) == WIMLIB_ERR_NOMEM)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\tif (inode->i_can_externally_back)\n\t\treturn 0;\n\n\t/* This may do redundant checks because the cached value\n\t * i_can_externally_back is 2-state (as opposed to 3-state:\n\t * unknown/no/yes).  But most files can be externally backed, so this\n\t * way is fine.  */\n\n\tif (inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY |\n\t\t\t\t   FILE_ATTRIBUTE_REPARSE_POINT |\n\t\t\t\t   FILE_ATTRIBUTE_ENCRYPTED))\n\t\treturn EXTERNAL_BACKING_NOT_POSSIBLE;\n\n\tblob = inode_get_blob_for_unnamed_data_stream_resolved(inode);\n\n\tif (!blob)\n\t\treturn EXTERNAL_BACKING_NOT_POSSIBLE;\n\n\tif (wimboot_mode &&\n\t    (blob->blob_location != BLOB_IN_WIM ||\n\t     !is_resource_valid_for_external_backing(blob->rdesc, ctx)))\n\t\treturn EXTERNAL_BACKING_NOT_POSSIBLE;\n\n\t/*\n\t * We need to check the patterns in [PrepopulateList] against every name\n\t * of the inode, in case any of them match.\n\t */\n\n\tinode_for_each_extraction_alias(dentry, inode) {\n\n\t\tret = calculate_dentry_full_path(dentry);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tif (!can_externally_back_path(dentry->d_full_path, ctx)) {\n\t\t\tif (excluded_dentry_ret)\n\t\t\t\t*excluded_dentry_ret = dentry;\n\t\t\treturn EXTERNAL_BACKING_EXCLUDED;\n\t\t}\n\t}\n\n\tinode->i_can_externally_back = 1;\n\treturn 0;\n}\n\n/*\n * Determines if the unnamed data stream of a file will be created as a WIM\n * external backing (a \"WIMBoot pointer file\"), as opposed to a standard\n * extraction.\n */\nstatic int\nwin32_will_back_from_wim(struct wim_dentry *dentry, struct apply_ctx *_ctx)\n{\n\tstruct win32_apply_ctx *ctx = (struct win32_apply_ctx *)_ctx;\n\n\tif (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT))\n\t\treturn EXTERNAL_BACKING_NOT_ENABLED;\n\n\treturn will_externally_back_inode(dentry->d_inode, ctx, NULL, true);\n}\n\n/* Find the WOF registration information for the specified WIM file.  */\nstatic struct wimboot_wim *\nfind_wimboot_wim(WIMStruct *wim_to_find, struct win32_apply_ctx *ctx)\n{\n\tfor (size_t i = 0; i < ctx->wimboot.num_wims; i++)\n\t\tif (wim_to_find == ctx->wimboot.wims[i].wim)\n\t\t\treturn &ctx->wimboot.wims[i];\n\n\twimlib_assert(0);\n\treturn NULL;\n}\n\nstatic int\nset_backed_from_wim(HANDLE h, struct wim_inode *inode, struct win32_apply_ctx *ctx)\n{\n\tint ret;\n\tconst struct wim_dentry *excluded_dentry;\n\tconst struct blob_descriptor *blob;\n\tconst struct wimboot_wim *wimboot_wim;\n\n\tret = will_externally_back_inode(inode, ctx, &excluded_dentry, true);\n\tif (ret > 0) /* Error.  */\n\t\treturn ret;\n\n\tif (ret < 0 && ret != EXTERNAL_BACKING_EXCLUDED)\n\t\treturn 0; /* Not externally backing, other than due to exclusion.  */\n\n\tif (unlikely(ret == EXTERNAL_BACKING_EXCLUDED)) {\n\t\t/* Not externally backing due to exclusion.  */\n\t\tunion wimlib_progress_info info;\n\n\t\tbuild_extraction_path(excluded_dentry, ctx);\n\n\t\tinfo.wimboot_exclude.path_in_wim = excluded_dentry->d_full_path;\n\t\tinfo.wimboot_exclude.extraction_path = current_path(ctx);\n\n\t\treturn call_progress(ctx->common.progfunc,\n\t\t\t\t     WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE,\n\t\t\t\t     &info, ctx->common.progctx);\n\t}\n\n\t/* Externally backing.  */\n\n\tblob = inode_get_blob_for_unnamed_data_stream_resolved(inode);\n\twimboot_wim = find_wimboot_wim(blob->rdesc->wim, ctx);\n\n\tif (unlikely(!wimboot_set_pointer(h,\n\t\t\t\t\t  blob,\n\t\t\t\t\t  wimboot_wim->data_source_id,\n\t\t\t\t\t  wimboot_wim->blob_table_hash,\n\t\t\t\t\t  ctx->wimboot.wof_running)))\n\t{\n\t\tconst DWORD err = GetLastError();\n\n\t\tbuild_extraction_path(inode_first_extraction_dentry(inode), ctx);\n\t\twin32_error(err, L\"\\\"%ls\\\": Couldn't set WIMBoot pointer data\",\n\t\t\t    current_path(ctx));\n\t\treturn WIMLIB_ERR_WIMBOOT;\n\t}\n\treturn 0;\n}\n\n/* Calculates the SHA-1 message digest of the WIM's blob table.  */\nstatic int\nhash_blob_table(WIMStruct *wim, u8 hash[SHA1_HASH_SIZE])\n{\n\treturn wim_reshdr_to_hash(&wim->hdr.blob_table_reshdr, wim, hash);\n}\n\nstatic int\nregister_wim_with_wof(WIMStruct *wim, struct win32_apply_ctx *ctx)\n{\n\tstruct wimboot_wim *p;\n\tint ret;\n\n\t/* Check if already registered  */\n\tfor (size_t i = 0; i < ctx->wimboot.num_wims; i++)\n\t\tif (wim == ctx->wimboot.wims[i].wim)\n\t\t\treturn 0;\n\n\t/* Not yet registered  */\n\n\tp = REALLOC(ctx->wimboot.wims,\n\t\t    (ctx->wimboot.num_wims + 1) * sizeof(ctx->wimboot.wims[0]));\n\tif (!p)\n\t\treturn WIMLIB_ERR_NOMEM;\n\tctx->wimboot.wims = p;\n\n\tctx->wimboot.wims[ctx->wimboot.num_wims].wim = wim;\n\n\tret = hash_blob_table(wim, ctx->wimboot.wims[ctx->wimboot.num_wims].blob_table_hash);\n\tif (ret)\n\t\treturn ret;\n\n\tret = wimboot_alloc_data_source_id(wim->filename,\n\t\t\t\t\t   wim->hdr.guid,\n\t\t\t\t\t   ctx->common.wim->current_image,\n\t\t\t\t\t   ctx->common.target,\n\t\t\t\t\t   &ctx->wimboot.wims[ctx->wimboot.num_wims].data_source_id,\n\t\t\t\t\t   &ctx->wimboot.wof_running);\n\tif (ret)\n\t\treturn ret;\n\n\tctx->wimboot.num_wims++;\n\treturn 0;\n}\n\n/* Prepare for doing a \"WIMBoot\" extraction by registering each source WIM file\n * with WOF on the target volume.  */\nstatic int\nstart_wimboot_extraction(struct list_head *dentry_list, struct win32_apply_ctx *ctx)\n{\n\tint ret;\n\tstruct wim_dentry *dentry;\n\n\tif (!xml_get_wimboot(ctx->common.wim->xml_info,\n\t\t\t     ctx->common.wim->current_image))\n\t\tWARNING(\"The WIM image is not marked as WIMBoot compatible.  This usually\\n\"\n\t\t\t\"          means it is not intended to be used to back a Windows operating\\n\"\n\t\t\t\"          system.  Proceeding anyway.\");\n\n\tlist_for_each_entry(dentry, dentry_list, d_extraction_list_node) {\n\t\tstruct blob_descriptor *blob;\n\n\t\tret = win32_will_back_from_wim(dentry, &ctx->common);\n\t\tif (ret > 0) /* Error */\n\t\t\treturn ret;\n\t\tif (ret < 0) /* Won't externally back */\n\t\t\tcontinue;\n\n\t\tblob = inode_get_blob_for_unnamed_data_stream_resolved(dentry->d_inode);\n\t\tret = register_wim_with_wof(blob->rdesc->wim, ctx);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tif (ctx->wimboot.have_wrong_version_wims) {\n  WARNING(\"At least one of the source WIM files uses a version of the WIM\\n\"\n\"          file format that not supported by Microsoft's wof.sys driver.\\n\"\n\"          Files whose data is contained in one of these WIM files will be\\n\"\n\"          extracted as full files rather than externally backed.\");\n\t}\n\n\tif (ctx->wimboot.have_uncompressed_wims) {\n  WARNING(\"At least one of the source WIM files is uncompressed.  Files whose\\n\"\n\"          data is contained in an uncompressed WIM file will be extracted as\\n\"\n\"          full files rather than externally backed, since uncompressed WIM\\n\"\n\"          files are not supported by Microsoft's wof.sys driver.\");\n\t}\n\n\tif (ctx->wimboot.have_unsupported_compressed_resources) {\n  WARNING(\"At least one of the source WIM files uses a compression format that\\n\"\n\"          is not supported by Microsoft's wof.sys driver.  Files whose data is\\n\"\n\"          contained in a compressed resource in one of these WIM files will be\\n\"\n\"          extracted as full files rather than externally backed.  (The\\n\"\n\"          compression formats supported by wof.sys are: XPRESS 4K, XPRESS 8K,\\n\"\n\"          XPRESS 16K, XPRESS 32K, and LZX 32K.)\");\n\t}\n\n\tif (ctx->wimboot.have_huge_resources) {\n  WARNING(\"Some files exceeded 4.2 GB in size.  Such files will be extracted\\n\"\n\"          as full files rather than externally backed, since very large files\\n\"\n\"          are not supported by Microsoft's wof.sys driver.\");\n\t}\n\n\treturn 0;\n}\n\nstatic void\nbuild_win32_extraction_path(const struct wim_dentry *dentry,\n\t\t\t    struct win32_apply_ctx *ctx);\n\n/* Sets WimBoot=1 in the extracted SYSTEM registry hive.\n *\n * WIMGAPI does this, and it's possible that it's important.\n * But I don't know exactly what this value means to Windows.  */\nstatic int\nend_wimboot_extraction(struct win32_apply_ctx *ctx)\n{\n\tstruct wim_dentry *dentry;\n\twchar_t subkeyname[32];\n\tLONG res;\n\tLONG res2;\n\tHKEY key;\n\tDWORD value;\n\n\tdentry = get_dentry(ctx->common.wim, L\"\\\\Windows\\\\System32\\\\config\\\\SYSTEM\",\n\t\t\t    WIMLIB_CASE_INSENSITIVE);\n\n\tif (!dentry || !will_extract_dentry(dentry))\n\t\tgoto out;\n\n\tif (!will_extract_dentry(wim_get_current_root_dentry(ctx->common.wim)))\n\t\tgoto out;\n\n\t/* Not bothering to use the native routines (e.g. NtLoadKey()) for this.\n\t * If this doesn't work, you probably also have many other problems.  */\n\n\tbuild_win32_extraction_path(dentry, ctx);\n\n\tget_random_alnum_chars(subkeyname, 20);\n\tsubkeyname[20] = L'\\0';\n\n\tres = RegLoadKey(HKEY_LOCAL_MACHINE, subkeyname, ctx->pathbuf.Buffer);\n\tif (res)\n\t\tgoto out_check_res;\n\n\twcscpy(&subkeyname[20], L\"\\\\Setup\");\n\n\tres = RegCreateKeyEx(HKEY_LOCAL_MACHINE, subkeyname, 0, NULL,\n\t\t\t     REG_OPTION_BACKUP_RESTORE, 0, NULL, &key, NULL);\n\tif (res)\n\t\tgoto out_unload_key;\n\n\tvalue = 1;\n\n\tres = RegSetValueEx(key, L\"WimBoot\", 0, REG_DWORD,\n\t\t\t    (const BYTE *)&value, sizeof(DWORD));\n\tif (res)\n\t\tgoto out_close_key;\n\n\tres = RegFlushKey(key);\n\nout_close_key:\n\tres2 = RegCloseKey(key);\n\tif (!res)\n\t\tres = res2;\nout_unload_key:\n\tsubkeyname[20] = L'\\0';\n\tRegUnLoadKey(HKEY_LOCAL_MACHINE, subkeyname);\nout_check_res:\n\tif (res) {\n\t\t/* Warning only.  */\n\t\twin32_warning(res, L\"Failed to set \\\\Setup: dword \\\"WimBoot\\\"=1 \"\n\t\t\t      \"value in registry hive \\\"%ls\\\"\",\n\t\t\t      ctx->pathbuf.Buffer);\n\t}\nout:\n\treturn 0;\n}\n\n/* Returns the number of wide characters needed to represent the path to the\n * specified @dentry, relative to the target directory, when extracted.\n *\n * Does not include null terminator (not needed for NtCreateFile).  */\nstatic size_t\ndentry_extraction_path_length(const struct wim_dentry *dentry)\n{\n\tsize_t len = 0;\n\tconst struct wim_dentry *d;\n\n\td = dentry;\n\tdo {\n\t\tlen += d->d_extraction_name_nchars + 1;\n\t\td = d->d_parent;\n\t} while (!dentry_is_root(d) && will_extract_dentry(d));\n\n\treturn --len;  /* No leading slash  */\n}\n\n/* Returns the length of the longest string that might need to be appended to\n * the path to an alias of an inode to open or create a named data stream.\n *\n * If the inode has no named data streams, this will be 0.  Otherwise, this will\n * be 1 plus the length of the longest-named data stream, since the data stream\n * name must be separated from the path by the ':' character.  */\nstatic size_t\ninode_longest_named_data_stream_spec(const struct wim_inode *inode)\n{\n\tsize_t max = 0;\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tconst struct wim_inode_stream *strm = &inode->i_streams[i];\n\t\tif (!stream_is_named_data_stream(strm))\n\t\t\tcontinue;\n\t\tsize_t len = utf16le_len_chars(strm->stream_name);\n\t\tif (len > max)\n\t\t\tmax = len;\n\t}\n\tif (max)\n\t\tmax += 1;\n\treturn max;\n}\n\n/* Find the length, in wide characters, of the longest path needed for\n * extraction of any file in @dentry_list relative to the target directory.\n *\n * Accounts for named data streams, but does not include null terminator (not\n * needed for NtCreateFile).  */\nstatic size_t\ncompute_path_max(struct list_head *dentry_list)\n{\n\tsize_t max = 0;\n\tconst struct wim_dentry *dentry;\n\n\tlist_for_each_entry(dentry, dentry_list, d_extraction_list_node) {\n\t\tsize_t len;\n\n\t\tlen = dentry_extraction_path_length(dentry);\n\n\t\t/* Account for named data streams  */\n\t\tlen += inode_longest_named_data_stream_spec(dentry->d_inode);\n\n\t\tif (len > max)\n\t\t\tmax = len;\n\t}\n\n\treturn max;\n}\n\n/* Build the path at which to extract the @dentry, relative to the target\n * directory.\n *\n * The path is saved in ctx->pathbuf.  */\nstatic void\nbuild_extraction_path(const struct wim_dentry *dentry,\n\t\t      struct win32_apply_ctx *ctx)\n{\n\tsize_t len;\n\twchar_t *p;\n\tconst struct wim_dentry *d;\n\n\tlen = dentry_extraction_path_length(dentry);\n\n\tctx->pathbuf.Length = len * sizeof(wchar_t);\n\tp = ctx->pathbuf.Buffer + len;\n\tfor (d = dentry;\n\t     !dentry_is_root(d->d_parent) && will_extract_dentry(d->d_parent);\n\t     d = d->d_parent)\n\t{\n\t\tp -= d->d_extraction_name_nchars;\n\t\tif (d->d_extraction_name_nchars)\n\t\t\twmemcpy(p, d->d_extraction_name,\n\t\t\t\td->d_extraction_name_nchars);\n\t\t*--p = '\\\\';\n\t}\n\t/* No leading slash  */\n\tp -= d->d_extraction_name_nchars;\n\twmemcpy(p, d->d_extraction_name, d->d_extraction_name_nchars);\n}\n\n/* Build the path at which to extract the @dentry, relative to the target\n * directory, adding the suffix for a named data stream.\n *\n * The path is saved in ctx->pathbuf.  */\nstatic void\nbuild_extraction_path_with_ads(const struct wim_dentry *dentry,\n\t\t\t       struct win32_apply_ctx *ctx,\n\t\t\t       const wchar_t *stream_name,\n\t\t\t       size_t stream_name_nchars)\n{\n\twchar_t *p;\n\n\tbuild_extraction_path(dentry, ctx);\n\n\t/* Add :NAME for named data stream  */\n\tp = ctx->pathbuf.Buffer + (ctx->pathbuf.Length / sizeof(wchar_t));\n\t*p++ = L':';\n\twmemcpy(p, stream_name, stream_name_nchars);\n\tctx->pathbuf.Length += (1 + stream_name_nchars) * sizeof(wchar_t);\n}\n\n/* Build the Win32 namespace path to the specified @dentry when extracted.\n *\n * The path is saved in ctx->pathbuf and will be null terminated.\n *\n * XXX: We could get rid of this if it wasn't needed for the file encryption\n * APIs, and the registry manipulation in WIMBoot mode.  */\nstatic void\nbuild_win32_extraction_path(const struct wim_dentry *dentry,\n\t\t\t    struct win32_apply_ctx *ctx)\n{\n\tbuild_extraction_path(dentry, ctx);\n\n\t/* Prepend target_ntpath to our relative path, then change \\??\\ into \\\\?\\  */\n\n\tmemmove(ctx->pathbuf.Buffer +\n\t\t\t(ctx->target_ntpath.Length / sizeof(wchar_t)) + 1,\n\t\tctx->pathbuf.Buffer, ctx->pathbuf.Length);\n\tmemcpy(ctx->pathbuf.Buffer, ctx->target_ntpath.Buffer,\n\t\tctx->target_ntpath.Length);\n\tctx->pathbuf.Buffer[ctx->target_ntpath.Length / sizeof(wchar_t)] = L'\\\\';\n\tctx->pathbuf.Length += ctx->target_ntpath.Length + sizeof(wchar_t);\n\tctx->pathbuf.Buffer[ctx->pathbuf.Length / sizeof(wchar_t)] = L'\\0';\n\n\twimlib_assert(ctx->pathbuf.Length >= 4 * sizeof(wchar_t) &&\n\t\t      !wmemcmp(ctx->pathbuf.Buffer, L\"\\\\??\\\\\", 4));\n\n\tctx->pathbuf.Buffer[1] = L'\\\\';\n\n}\n\n/* Returns a \"printable\" representation of the last relative NT path that was\n * constructed with build_extraction_path() or build_extraction_path_with_ads().\n *\n * This will be overwritten by the next call to this function.  */\nstatic const wchar_t *\ncurrent_path(struct win32_apply_ctx *ctx)\n{\n\twchar_t *p = ctx->print_buffer;\n\n\tp = wmempcpy(p, ctx->common.target, ctx->common.target_nchars);\n\t*p++ = L'\\\\';\n\tp = wmempcpy(p, ctx->pathbuf.Buffer, ctx->pathbuf.Length / sizeof(wchar_t));\n\t*p = L'\\0';\n\treturn ctx->print_buffer;\n}\n\n/* Open handle to the target directory if it is not already open.  If the target\n * directory does not exist, this creates it.  */\nstatic int\nopen_target_directory(struct win32_apply_ctx *ctx)\n{\n\tNTSTATUS status;\n\n\tif (ctx->h_target)\n\t\treturn 0;\n\n\tctx->attr.Length = sizeof(ctx->attr);\n\tctx->attr.RootDirectory = NULL;\n\tctx->attr.ObjectName = &ctx->target_ntpath;\n\n\t/* Don't use FILE_OPEN_REPARSE_POINT here; we want the extraction to\n\t * happen at the directory \"pointed to\" by the reparse point. */\n\tstatus = NtCreateFile(&ctx->h_target,\n\t\t\t      FILE_TRAVERSE,\n\t\t\t      &ctx->attr,\n\t\t\t      &ctx->iosb,\n\t\t\t      NULL,\n\t\t\t      0,\n\t\t\t      FILE_SHARE_VALID_FLAGS,\n\t\t\t      FILE_OPEN_IF,\n\t\t\t      FILE_DIRECTORY_FILE | FILE_OPEN_FOR_BACKUP_INTENT,\n\t\t\t      NULL,\n\t\t\t      0);\n\tif (!NT_SUCCESS(status)) {\n\t\twinnt_error(status, L\"Can't open or create directory \\\"%ls\\\"\",\n\t\t\t    ctx->common.target);\n\t\treturn WIMLIB_ERR_OPENDIR;\n\t}\n\tctx->attr.RootDirectory = ctx->h_target;\n\tctx->attr.ObjectName = &ctx->pathbuf;\n\treturn 0;\n}\n\nstatic void\nclose_target_directory(struct win32_apply_ctx *ctx)\n{\n\tif (ctx->h_target) {\n\t\tNtClose(ctx->h_target);\n\t\tctx->h_target = NULL;\n\t\tctx->attr.RootDirectory = NULL;\n\t}\n}\n\n/*\n * Ensures the target directory exists and opens a handle to it, in preparation\n * of using paths relative to it.\n */\nstatic int\nprepare_target(struct list_head *dentry_list, struct win32_apply_ctx *ctx)\n{\n\tint ret;\n\tsize_t path_max;\n\n\tret = win32_path_to_nt_path(ctx->common.target, &ctx->target_ntpath);\n\tif (ret)\n\t\treturn ret;\n\n\tret = open_target_directory(ctx);\n\tif (ret)\n\t\treturn ret;\n\n\tpath_max = compute_path_max(dentry_list);\n\t/* Add some extra for building Win32 paths for the file encryption APIs,\n\t * and ensure we have at least enough to potentially use an 8.3 name for\n\t * the last component.  */\n\tpath_max += max(2 + (ctx->target_ntpath.Length / sizeof(wchar_t)),\n\t\t\t8 + 1 + 3);\n\n\tctx->pathbuf.MaximumLength = path_max * sizeof(wchar_t);\n\tif (ctx->pathbuf.MaximumLength != path_max * sizeof(wchar_t)) {\n\t\t/* Paths are too long for a UNICODE_STRING! */\n\t\tERROR(\"Some paths are too long to extract (> 32768 characters)!\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n\n\tctx->pathbuf.Buffer = MALLOC(ctx->pathbuf.MaximumLength);\n\tif (!ctx->pathbuf.Buffer)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\tctx->print_buffer = MALLOC((ctx->common.target_nchars + 1 + path_max + 1) *\n\t\t\t\t   sizeof(wchar_t));\n\tif (!ctx->print_buffer)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\treturn 0;\n}\n\n/* When creating an inode that will have a short (DOS) name, we create it using\n * the long name associated with the short name.  This ensures that the short\n * name gets associated with the correct long name.  */\nstatic struct wim_dentry *\nfirst_extraction_alias(const struct wim_inode *inode)\n{\n\tstruct wim_dentry *dentry;\n\n\tinode_for_each_extraction_alias(dentry, inode)\n\t\tif (dentry_has_short_name(dentry))\n\t\t\treturn dentry;\n\treturn inode_first_extraction_dentry(inode);\n}\n\n/*\n * Set or clear FILE_ATTRIBUTE_COMPRESSED if the inherited value is different\n * from the desired value.\n *\n * Note that you can NOT override the inherited value of\n * FILE_ATTRIBUTE_COMPRESSED directly with NtCreateFile().\n */\nstatic int\nadjust_compression_attribute(HANDLE h, const struct wim_dentry *dentry,\n\t\t\t     struct win32_apply_ctx *ctx)\n{\n\tconst bool compressed = (dentry->d_inode->i_attributes &\n\t\t\t\t FILE_ATTRIBUTE_COMPRESSED);\n\tFILE_BASIC_INFORMATION info = { 0 };\n\tUSHORT compression_state;\n\tNTSTATUS status;\n\n\tif (ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES)\n\t\treturn 0;\n\n\tif (!ctx->common.supported_features.compressed_files)\n\t\treturn 0;\n\n\n\t/* Get current attributes  */\n\tstatus = NtQueryInformationFile(h, &ctx->iosb, &info, sizeof(info),\n\t\t\t\t\tFileBasicInformation);\n\tif (NT_SUCCESS(status) &&\n\t    compressed == !!(info.FileAttributes & FILE_ATTRIBUTE_COMPRESSED))\n\t{\n\t\t/* Nothing needs to be done.  */\n\t\treturn 0;\n\t}\n\n\t/* Set the new compression state  */\n\n\tif (compressed)\n\t\tcompression_state = COMPRESSION_FORMAT_DEFAULT;\n\telse\n\t\tcompression_state = COMPRESSION_FORMAT_NONE;\n\n\tstatus = winnt_fsctl(h, FSCTL_SET_COMPRESSION,\n\t\t\t     &compression_state, sizeof(USHORT), NULL, 0, NULL);\n\tif (NT_SUCCESS(status))\n\t\treturn 0;\n\n\twinnt_error(status, L\"Can't %s compression attribute on \\\"%ls\\\"\",\n\t\t    (compressed ? \"set\" : \"clear\"), current_path(ctx));\n\treturn WIMLIB_ERR_SET_ATTRIBUTES;\n}\n\nstatic bool\nneed_sparse_flag(const struct wim_inode *inode,\n\t\t const struct win32_apply_ctx *ctx)\n{\n\treturn (inode->i_attributes & FILE_ATTRIBUTE_SPARSE_FILE) &&\n\t\tctx->common.supported_features.sparse_files;\n}\n\nstatic int\nset_sparse_flag(HANDLE h, struct win32_apply_ctx *ctx)\n{\n\tNTSTATUS status;\n\n\tstatus = winnt_fsctl(h, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, NULL);\n\tif (NT_SUCCESS(status))\n\t\treturn 0;\n\n\twinnt_error(status, L\"Can't set sparse flag on \\\"%ls\\\"\",\n\t\t    current_path(ctx));\n\treturn WIMLIB_ERR_SET_ATTRIBUTES;\n}\n\n/* Try to enable short name support on the target volume.  If successful, return\n * true.  If unsuccessful, issue a warning and return false.  */\nstatic bool\ntry_to_enable_short_names(const wchar_t *volume)\n{\n\tHANDLE h;\n\tFILE_FS_PERSISTENT_VOLUME_INFORMATION info;\n\tBOOL bret;\n\tDWORD bytesReturned;\n\n\th = CreateFile(volume, GENERIC_WRITE,\n\t\t       FILE_SHARE_VALID_FLAGS, NULL, OPEN_EXISTING,\n\t\t       FILE_FLAG_BACKUP_SEMANTICS, NULL);\n\tif (h == INVALID_HANDLE_VALUE)\n\t\tgoto fail;\n\n\tinfo.VolumeFlags = 0;\n\tinfo.FlagMask = PERSISTENT_VOLUME_STATE_SHORT_NAME_CREATION_DISABLED;\n\tinfo.Version = 1;\n\tinfo.Reserved = 0;\n\n\tbret = DeviceIoControl(h, FSCTL_SET_PERSISTENT_VOLUME_STATE,\n\t\t\t       &info, sizeof(info), NULL, 0,\n\t\t\t       &bytesReturned, NULL);\n\n\tCloseHandle(h);\n\n\tif (!bret)\n\t\tgoto fail;\n\treturn true;\n\nfail:\n\twin32_warning(GetLastError(),\n\t\t      L\"Failed to enable short name support on %ls\",\n\t\t      volume + 4);\n\treturn false;\n}\n\nstatic NTSTATUS\nremove_conflicting_short_name(const struct wim_dentry *dentry, struct win32_apply_ctx *ctx)\n{\n\twchar_t *name;\n\twchar_t *end;\n\tNTSTATUS status;\n\tHANDLE h;\n\tsize_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) +\n\t\t\t (13 * sizeof(wchar_t));\n\tu8* buf = wimlib_aligned_malloc(bufsize, 8);\n\tbool retried = false;\n\tFILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf;\n\n\tmemset(buf, 0, bufsize);\n\n\t/* Build the path with the short name.  */\n\tname = &ctx->pathbuf.Buffer[ctx->pathbuf.Length / sizeof(wchar_t)];\n\twhile (name != ctx->pathbuf.Buffer && *(name - 1) != L'\\\\')\n\t\tname--;\n\tend = mempcpy(name, dentry->d_short_name, dentry->d_short_name_nbytes);\n\tctx->pathbuf.Length = ((u8 *)end - (u8 *)ctx->pathbuf.Buffer);\n\n\t/* Open the conflicting file (by short name).  */\n\tstatus = NtOpenFile(&h, GENERIC_WRITE | DELETE,\n\t\t\t    &ctx->attr, &ctx->iosb,\n\t\t\t    FILE_SHARE_VALID_FLAGS,\n\t\t\t    FILE_OPEN_REPARSE_POINT | FILE_OPEN_FOR_BACKUP_INTENT);\n\tif (!NT_SUCCESS(status)) {\n\t\twinnt_warning(status, L\"Can't open \\\"%ls\\\"\", current_path(ctx));\n\t\tgoto out;\n\t}\n\n#if 0\n\tWARNING(\"Overriding conflicting short name; path=\\\"%ls\\\"\",\n\t\tcurrent_path(ctx));\n#endif\n\n\t/* Try to remove the short name on the conflicting file.  */\n\nretry:\n\tstatus = NtSetInformationFile(h, &ctx->iosb, info, bufsize,\n\t\t\t\t      FileShortNameInformation);\n\n\tif (status == STATUS_INVALID_PARAMETER && !retried) {\n\t\t/* Microsoft forgot to make it possible to remove short names\n\t\t * until Windows 7.  Oops.  Use a random short name instead.  */\n\t\tget_random_alnum_chars(info->FileName, 8);\n\t\twcscpy(&info->FileName[8], L\".WLB\");\n\t\tinfo->FileNameLength = 12 * sizeof(wchar_t);\n\t\tretried = true;\n\t\tgoto retry;\n\t}\n\tNtClose(h);\nout:\n\twimlib_aligned_free(buf);\n\tbuild_extraction_path(dentry, ctx);\n\treturn status;\n}\n\n/* Set the short name on the open file @h which has been created at the location\n * indicated by @dentry.\n *\n * Note that this may add, change, or remove the short name.\n *\n * @h must be opened with DELETE access.\n *\n * Returns 0 or WIMLIB_ERR_SET_SHORT_NAME.  The latter only happens in\n * STRICT_SHORT_NAMES mode.\n */\nstatic int\nset_short_name(HANDLE h, const struct wim_dentry *dentry,\n\t       struct win32_apply_ctx *ctx)\n{\n\n\tif (!ctx->common.supported_features.short_names)\n\t\treturn 0;\n\n\t/*\n\t * Note: The size of the FILE_NAME_INFORMATION buffer must be such that\n\t * FileName contains at least 2 wide characters (4 bytes).  Otherwise,\n\t * NtSetInformationFile() will return STATUS_INFO_LENGTH_MISMATCH.  This\n\t * is despite the fact that FileNameLength can validly be 0 or 2 bytes,\n\t * with the former case being removing the existing short name if\n\t * present, rather than setting one.\n\t *\n\t * The null terminator is seemingly optional, but to be safe we include\n\t * space for it and zero all unused space.\n\t */\n\n\tsize_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) +\n\t\t\t max(dentry->d_short_name_nbytes, sizeof(wchar_t)) +\n\t\t\t sizeof(wchar_t);\n\tu8* buf = wimlib_aligned_malloc(bufsize, 8);\n\tFILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf;\n\tNTSTATUS status;\n\tbool tried_to_remove_existing = false;\n\n\tmemset(buf, 0, bufsize);\n\n\tinfo->FileNameLength = dentry->d_short_name_nbytes;\n\tmemcpy(info->FileName, dentry->d_short_name, dentry->d_short_name_nbytes);\n\nretry:\n\tstatus = NtSetInformationFile(h, &ctx->iosb, info, bufsize,\n\t\t\t\t      FileShortNameInformation);\n\tif (NT_SUCCESS(status)) {\n\t\twimlib_aligned_free(buf);\n\t\treturn 0;\n\t}\n\n\tif (status == STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME) {\n\t\tif (dentry->d_short_name_nbytes == 0)\n\t\t\treturn 0;\n\t\tif (!ctx->tried_to_enable_short_names) {\n\t\t\twchar_t volume[7];\n\t\t\tint ret;\n\n\t\t\tctx->tried_to_enable_short_names = true;\n\n\t\t\tret = win32_get_drive_path(ctx->common.target,\n\t\t\t\t\t\t   volume);\n\t\t\tif (ret) {\n\t\t\t\twimlib_aligned_free(buf);\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\tif (try_to_enable_short_names(volume))\n\t\t\t\tgoto retry;\n\t\t}\n\t}\n\n\t/*\n\t * Short names can conflict in several cases:\n\t *\n\t * - a file being extracted has a short name conflicting with an\n\t *   existing file\n\t *\n\t * - a file being extracted has a short name conflicting with another\n\t *   file being extracted (possible, but shouldn't happen)\n\t *\n\t * - a file being extracted has a short name that conflicts with the\n\t *   automatically generated short name of a file we previously\n\t *   extracted, but failed to set the short name for.  Sounds unlikely,\n\t *   but this actually does happen fairly often on versions of Windows\n\t *   prior to Windows 7 because they do not support removing short names\n\t *   from files.\n\t */\n\tif (unlikely(status == STATUS_OBJECT_NAME_COLLISION) &&\n\t    dentry->d_short_name_nbytes && !tried_to_remove_existing)\n\t{\n\t\ttried_to_remove_existing = true;\n\t\tstatus = remove_conflicting_short_name(dentry, ctx);\n\t\tif (NT_SUCCESS(status))\n\t\t\tgoto retry;\n\t}\n\n\t/* By default, failure to set short names is not an error (since short\n\t * names aren't too important anymore...).  */\n\tif (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_SHORT_NAMES)) {\n\t\tif (dentry->d_short_name_nbytes)\n\t\t\tctx->num_set_short_name_failures++;\n\t\telse\n\t\t\tctx->num_remove_short_name_failures++;\n\t\twimlib_aligned_free(buf);\n\t\treturn 0;\n\t}\n\n\twinnt_error(status, L\"Can't set short name on \\\"%ls\\\"\", current_path(ctx));\n\twimlib_aligned_free(buf);\n\treturn WIMLIB_ERR_SET_SHORT_NAME;\n}\n\n/*\n * A wrapper around NtCreateFile() to make it slightly more usable...\n * This uses the path currently constructed in ctx->pathbuf.\n *\n * Also, we always specify SYNCHRONIZE access, FILE_OPEN_FOR_BACKUP_INTENT, and\n * FILE_OPEN_REPARSE_POINT.\n */\nstatic NTSTATUS\ndo_create_file(PHANDLE FileHandle,\n\t       ACCESS_MASK DesiredAccess,\n\t       PLARGE_INTEGER AllocationSize,\n\t       ULONG FileAttributes,\n\t       ULONG CreateDisposition,\n\t       ULONG CreateOptions,\n\t       struct win32_apply_ctx *ctx)\n{\n\treturn NtCreateFile(FileHandle,\n\t\t\t    DesiredAccess | SYNCHRONIZE,\n\t\t\t    &ctx->attr,\n\t\t\t    &ctx->iosb,\n\t\t\t    AllocationSize,\n\t\t\t    FileAttributes,\n\t\t\t    FILE_SHARE_VALID_FLAGS,\n\t\t\t    CreateDisposition,\n\t\t\t    CreateOptions |\n\t\t\t\tFILE_OPEN_FOR_BACKUP_INTENT |\n\t\t\t\tFILE_OPEN_REPARSE_POINT,\n\t\t\t    NULL,\n\t\t\t    0);\n}\n\n/* Like do_create_file(), but builds the extraction path of the @dentry first.\n */\nstatic NTSTATUS\ncreate_file(PHANDLE FileHandle,\n\t    ACCESS_MASK DesiredAccess,\n\t    PLARGE_INTEGER AllocationSize,\n\t    ULONG FileAttributes,\n\t    ULONG CreateDisposition,\n\t    ULONG CreateOptions,\n\t    const struct wim_dentry *dentry,\n\t    struct win32_apply_ctx *ctx)\n{\n\tbuild_extraction_path(dentry, ctx);\n\treturn do_create_file(FileHandle,\n\t\t\t      DesiredAccess,\n\t\t\t      AllocationSize,\n\t\t\t      FileAttributes,\n\t\t\t      CreateDisposition,\n\t\t\t      CreateOptions,\n\t\t\t      ctx);\n}\n\nstatic int\ndelete_file_or_stream(struct win32_apply_ctx *ctx)\n{\n\tNTSTATUS status;\n\tHANDLE h;\n\tULONG perms = DELETE;\n\tULONG flags = FILE_NON_DIRECTORY_FILE | FILE_DELETE_ON_CLOSE;\n\n\t/* First try opening the file with FILE_DELETE_ON_CLOSE.  In most cases,\n\t * all we have to do is that plus close the file handle.  */\nretry:\n\tstatus = do_create_file(&h, perms, NULL, 0, FILE_OPEN, flags, ctx);\n\n\tif (unlikely(status == STATUS_CANNOT_DELETE)) {\n\t\t/* This error occurs for files with FILE_ATTRIBUTE_READONLY set.\n\t\t * Try an alternate approach: first open the file without\n\t\t * FILE_DELETE_ON_CLOSE, then reset the file attributes, then\n\t\t * set the \"delete\" disposition on the handle.  */\n\t\tif (flags & FILE_DELETE_ON_CLOSE) {\n\t\t\tflags &= ~FILE_DELETE_ON_CLOSE;\n\t\t\tperms |= FILE_WRITE_ATTRIBUTES;\n\t\t\tgoto retry;\n\t\t}\n\t}\n\n\tif (unlikely(!NT_SUCCESS(status))) {\n\t\twinnt_error(status, L\"Can't open \\\"%ls\\\" for deletion \"\n\t\t\t    \"(perms=%x, flags=%x)\",\n\t\t\t    current_path(ctx), (u32)perms, (u32)flags);\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\n\tif (unlikely(!(flags & FILE_DELETE_ON_CLOSE))) {\n\n\t\tFILE_BASIC_INFORMATION basic_info =\n\t\t\t{ .FileAttributes = FILE_ATTRIBUTE_NORMAL };\n\t\tstatus = NtSetInformationFile(h, &ctx->iosb, &basic_info,\n\t\t\t\t\t      sizeof(basic_info),\n\t\t\t\t\t      FileBasicInformation);\n\n\t\tif (!NT_SUCCESS(status)) {\n\t\t\twinnt_error(status, L\"Can't reset attributes of \\\"%ls\\\" \"\n\t\t\t\t    \"to prepare for deletion\", current_path(ctx));\n\t\t\tNtClose(h);\n\t\t\treturn WIMLIB_ERR_SET_ATTRIBUTES;\n\t\t}\n\n\t\tFILE_DISPOSITION_INFORMATION disp_info =\n\t\t\t{ .DoDeleteFile = TRUE };\n\t\tstatus = NtSetInformationFile(h, &ctx->iosb, &disp_info,\n\t\t\t\t\t      sizeof(disp_info),\n\t\t\t\t\t      FileDispositionInformation);\n\t\tif (!NT_SUCCESS(status)) {\n\t\t\twinnt_error(status, L\"Can't set delete-on-close \"\n\t\t\t\t    \"disposition on \\\"%ls\\\"\", current_path(ctx));\n\t\t\tNtClose(h);\n\t\t\treturn WIMLIB_ERR_SET_ATTRIBUTES;\n\t\t}\n\t}\n\n\tstatus = NtClose(h);\n\tif (unlikely(!NT_SUCCESS(status))) {\n\t\twinnt_error(status, L\"Error closing \\\"%ls\\\" after setting \"\n\t\t\t    \"delete-on-close disposition\", current_path(ctx));\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\n\treturn 0;\n}\n\n/*\n * Create a nondirectory file or named data stream at the current path,\n * superseding any that already exists at that path.  If successful, return an\n * open handle to the file or named data stream with the requested permissions.\n */\nstatic int\nsupersede_file_or_stream(struct win32_apply_ctx *ctx, DWORD perms,\n\t\t\t HANDLE *h_ret)\n{\n\tNTSTATUS status;\n\tbool retried = false;\n\n\t/* FILE_ATTRIBUTE_SYSTEM is needed to ensure that\n\t * FILE_ATTRIBUTE_ENCRYPTED doesn't get set before we want it to be.  */\nretry:\n\tstatus = do_create_file(h_ret,\n\t\t\t\tperms,\n\t\t\t\tNULL,\n\t\t\t\tFILE_ATTRIBUTE_SYSTEM,\n\t\t\t\tFILE_CREATE,\n\t\t\t\tFILE_NON_DIRECTORY_FILE,\n\t\t\t\tctx);\n\tif (likely(NT_SUCCESS(status)))\n\t\treturn 0;\n\n\t/* STATUS_OBJECT_NAME_COLLISION means that the file or stream already\n\t * exists.  Delete the existing file or stream, then try again.\n\t *\n\t * Note: we don't use FILE_OVERWRITE_IF or FILE_SUPERSEDE because of\n\t * problems with certain file attributes, especially\n\t * FILE_ATTRIBUTE_ENCRYPTED.  FILE_SUPERSEDE is also broken in the\n\t * Windows PE ramdisk.  */\n\tif (status == STATUS_OBJECT_NAME_COLLISION && !retried) {\n\t\tint ret = delete_file_or_stream(ctx);\n\t\tif (ret)\n\t\t\treturn ret;\n\t\tretried = true;\n\t\tgoto retry;\n\t}\n\twinnt_error(status, L\"Can't create \\\"%ls\\\"\", current_path(ctx));\n\treturn WIMLIB_ERR_OPEN;\n}\n\n/* Set the reparse point @rpbuf of length @rpbuflen on the extracted file\n * corresponding to the WIM dentry @dentry.  */\nstatic int\ndo_set_reparse_point(const struct wim_dentry *dentry,\n\t\t     const struct reparse_buffer_disk *rpbuf, u16 rpbuflen,\n\t\t     struct win32_apply_ctx *ctx)\n{\n\tNTSTATUS status;\n\tHANDLE h;\n\n\tstatus = create_file(&h, GENERIC_WRITE, NULL,\n\t\t\t     0, FILE_OPEN, 0, dentry, ctx);\n\tif (!NT_SUCCESS(status))\n\t\tgoto fail;\n\n\tstatus = winnt_fsctl(h, FSCTL_SET_REPARSE_POINT,\n\t\t\t     rpbuf, rpbuflen, NULL, 0, NULL);\n\tNtClose(h);\n\n\tif (NT_SUCCESS(status))\n\t\treturn 0;\n\n\t/* On Windows, by default only the Administrator can create symbolic\n\t * links for some reason.  By default we just issue a warning if this\n\t * appears to be the problem.  Use WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS\n\t * to get a hard error.  */\n\tif (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS)\n\t    && (status == STATUS_PRIVILEGE_NOT_HELD ||\n\t\tstatus == STATUS_ACCESS_DENIED)\n\t    && (dentry->d_inode->i_reparse_tag == WIM_IO_REPARSE_TAG_SYMLINK ||\n\t\tdentry->d_inode->i_reparse_tag == WIM_IO_REPARSE_TAG_MOUNT_POINT))\n\t{\n\t\tWARNING(\"Can't create symbolic link \\\"%ls\\\"!              \\n\"\n\t\t\t\"          (Need Administrator rights, or at least \"\n\t\t\t\"the\\n\"\n\t\t\t\"          SeCreateSymbolicLink privilege.)\",\n\t\t\tcurrent_path(ctx));\n\t\treturn 0;\n\t}\n\nfail:\n\twinnt_error(status, L\"Can't set reparse data on \\\"%ls\\\"\",\n\t\t    current_path(ctx));\n\treturn WIMLIB_ERR_SET_REPARSE_DATA;\n}\n\n/*\n * Create empty named data streams and potentially a reparse point for the\n * specified file, if any.\n *\n * Since these won't have blob descriptors, they won't show up in the call to\n * extract_blob_list().  Hence the need for the special case.\n */\nstatic int\ncreate_empty_streams(const struct wim_dentry *dentry,\n\t\t     struct win32_apply_ctx *ctx)\n{\n\tconst struct wim_inode *inode = dentry->d_inode;\n\tint ret;\n\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tconst struct wim_inode_stream *strm = &inode->i_streams[i];\n\n\t\tif (stream_blob_resolved(strm) != NULL)\n\t\t\tcontinue;\n\n\t\tif (strm->stream_type == STREAM_TYPE_REPARSE_POINT &&\n\t\t    ctx->common.supported_features.reparse_points)\n\t\t{\n\t\t\tPRAGMA_ALIGN(u8 buf[REPARSE_DATA_OFFSET], 8);\n\t\t\tstruct reparse_buffer_disk *rpbuf =\n\t\t\t\t(struct reparse_buffer_disk *)buf;\n\t\t\tcomplete_reparse_point(rpbuf, inode, 0);\n\t\t\tret = do_set_reparse_point(dentry, rpbuf,\n\t\t\t\t\t\t   REPARSE_DATA_OFFSET, ctx);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t} else if (stream_is_named_data_stream(strm) &&\n\t\t\t   ctx->common.supported_features.named_data_streams)\n\t\t{\n\t\t\tHANDLE h;\n\n\t\t\tbuild_extraction_path_with_ads(dentry, ctx,\n\t\t\t\t\t\t       strm->stream_name,\n\t\t\t\t\t\t       utf16le_len_chars(strm->stream_name));\n\t\t\t/*\n\t\t\t * Note: do not request any permissions on the handle.\n\t\t\t * Otherwise, we may encounter a Windows bug where the\n\t\t\t * parent directory DACL denies read access to the new\n\t\t\t * named data stream, even when using backup semantics!\n\t\t\t */\n\t\t\tret = supersede_file_or_stream(ctx, 0, &h);\n\n\t\t\tbuild_extraction_path(dentry, ctx);\n\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\tNtClose(h);\n\t\t}\n\t}\n\n\treturn 0;\n}\n\n/*\n * Creates the directory named by @dentry, or uses an existing directory at that\n * location.  If necessary, sets the short name and/or fixes compression and\n * encryption attributes.\n *\n * Returns 0, WIMLIB_ERR_MKDIR, or WIMLIB_ERR_SET_SHORT_NAME.\n */\nstatic int\ncreate_directory(const struct wim_dentry *dentry, struct win32_apply_ctx *ctx)\n{\n\tDWORD perms;\n\tNTSTATUS status;\n\tHANDLE h;\n\tint ret;\n\n\t/* DELETE is needed for set_short_name(); GENERIC_READ and GENERIC_WRITE\n\t * are needed for adjust_compression_attribute().  */\n\tperms = GENERIC_READ | GENERIC_WRITE;\n\tif (!dentry_is_root(dentry))\n\t\tperms |= DELETE;\n\n\t/* FILE_ATTRIBUTE_SYSTEM is needed to ensure that\n\t * FILE_ATTRIBUTE_ENCRYPTED doesn't get set before we want it to be.  */\n\tstatus = create_file(&h, perms, NULL, FILE_ATTRIBUTE_SYSTEM,\n\t\t\t     FILE_OPEN_IF, FILE_DIRECTORY_FILE, dentry, ctx);\n\tif (unlikely(!NT_SUCCESS(status))) {\n\t\tconst wchar_t *path = current_path(ctx);\n\t\twinnt_error(status, L\"Can't create directory \\\"%ls\\\"\", path);\n\n\t\t/* Check for known issue with WindowsApps directory.  */\n\t\tif (status == STATUS_ACCESS_DENIED &&\n\t\t    (wcsstr(path, L\"\\\\WindowsApps\\\\\") ||\n\t\t     wcsstr(path, L\"\\\\InfusedApps\\\\\"))) {\n\t\t\tERROR(\n\"You seem to be trying to extract files to the WindowsApps directory.\\n\"\n\"        Windows 8.1 and later use new file permissions in this directory that\\n\"\n\"        cannot be overridden, even by backup/restore programs.  To extract your\\n\"\n\"        files anyway, you need to choose a different target directory, delete\\n\"\n\"        the WindowsApps directory entirely, reformat the volume, do the\\n\"\n\"        extraction from a non-broken operating system such as Windows 7 or\\n\"\n\"        Linux, or wait for Microsoft to fix the design flaw in their operating\\n\"\n\"        system.  This is *not* a bug in wimlib.  See this thread for more\\n\"\n\"        information: https://wimlib.net/forums/viewtopic.php?f=1&t=261\");\n\t\t}\n\t\treturn WIMLIB_ERR_MKDIR;\n\t}\n\n\tif (ctx->iosb.Information == FILE_OPENED) {\n\t\t/* If we opened an existing directory, try to clear its file\n\t\t * attributes.  As far as I know, this only actually makes a\n\t\t * difference in the case where a FILE_ATTRIBUTE_READONLY\n\t\t * directory has a named data stream which needs to be\n\t\t * extracted.  You cannot create a named data stream of such a\n\t\t * directory, even though this contradicts Microsoft's\n\t\t * documentation for FILE_ATTRIBUTE_READONLY which states it is\n\t\t * not honored for directories!  */\n\t\tif (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES)) {\n\t\t\tFILE_BASIC_INFORMATION basic_info =\n\t\t\t\t{ .FileAttributes = FILE_ATTRIBUTE_NORMAL };\n\t\t\tNtSetInformationFile(h, &ctx->iosb, &basic_info,\n\t\t\t\t\t     sizeof(basic_info),\n\t\t\t\t\t     FileBasicInformation);\n\t\t}\n\t}\n\n\tif (!dentry_is_root(dentry)) {\n\t\tret = set_short_name(h, dentry, ctx);\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\n\tret = adjust_compression_attribute(h, dentry, ctx);\nout:\n\tNtClose(h);\n\treturn ret;\n}\n\n/*\n * Create all the directories being extracted, other than the target directory\n * itself.\n *\n * Note: we don't honor directory hard links.  However, we don't allow them to\n * exist in WIM images anyway (see inode_fixup.c).\n */\nstatic int\ncreate_directories(struct list_head *dentry_list,\n\t\t   struct win32_apply_ctx *ctx)\n{\n\tconst struct wim_dentry *dentry;\n\tint ret;\n\n\tlist_for_each_entry(dentry, dentry_list, d_extraction_list_node) {\n\n\t\tif (!(dentry->d_inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY))\n\t\t\tcontinue;\n\n\t\t/* Note: Here we include files with\n\t\t * FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_REPARSE_POINT, but we\n\t\t * wait until later to actually set the reparse data.  */\n\n\t\tret = create_directory(dentry, ctx);\n\n\t\tif (!ret)\n\t\t\tret = create_empty_streams(dentry, ctx);\n\n\t\tret = check_apply_error(dentry, ctx, ret);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tret = report_file_created(&ctx->common);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\n/*\n * Creates the nondirectory file named by @dentry.\n *\n * On success, returns an open handle to the file in @h_ret, with GENERIC_READ,\n * GENERIC_WRITE, and DELETE access.  Also, the path to the file will be saved\n * in ctx->pathbuf.  On failure, returns an error code.\n */\nstatic int\ncreate_nondirectory_inode(HANDLE *h_ret, const struct wim_dentry *dentry,\n\t\t\t  struct win32_apply_ctx *ctx)\n{\n\tint ret;\n\tHANDLE h;\n\n\tbuild_extraction_path(dentry, ctx);\n\n\tret = supersede_file_or_stream(ctx,\n\t\t\t\t       GENERIC_READ | GENERIC_WRITE | DELETE,\n\t\t\t\t       &h);\n\tif (ret)\n\t\tgoto out;\n\n\tret = adjust_compression_attribute(h, dentry, ctx);\n\tif (ret)\n\t\tgoto out_close;\n\n\tif (need_sparse_flag(dentry->d_inode, ctx)) {\n\t\tret = set_sparse_flag(h, ctx);\n\t\tif (ret)\n\t\t\tgoto out_close;\n\t}\n\n\tret = create_empty_streams(dentry, ctx);\n\tif (ret)\n\t\tgoto out_close;\n\n\t*h_ret = h;\n\treturn 0;\n\nout_close:\n\tNtClose(h);\nout:\n\treturn ret;\n}\n\n/* Creates a hard link at the location named by @dentry to the file represented\n * by the open handle @h.  Or, if the target volume does not support hard links,\n * create a separate file instead.  */\nstatic int\ncreate_link(HANDLE h, const struct wim_dentry *dentry,\n\t    struct win32_apply_ctx *ctx)\n{\n\tif (ctx->common.supported_features.hard_links) {\n\n\t\tbuild_extraction_path(dentry, ctx);\n\n\t\tsize_t bufsize = offsetof(FILE_LINK_INFORMATION, FileName) +\n\t\t\t\t ctx->pathbuf.Length + sizeof(wchar_t);\n\t\tu8* buf = wimlib_aligned_malloc(bufsize, 8);\n\t\tFILE_LINK_INFORMATION *info = (FILE_LINK_INFORMATION *)buf;\n\t\tNTSTATUS status;\n\n\t\tinfo->ReplaceIfExists = TRUE;\n\t\tinfo->RootDirectory = ctx->attr.RootDirectory;\n\t\tinfo->FileNameLength = ctx->pathbuf.Length;\n\t\tmemcpy(info->FileName, ctx->pathbuf.Buffer, ctx->pathbuf.Length);\n\t\tinfo->FileName[info->FileNameLength / 2] = L'\\0';\n\t\t/*\n\t\t * Note: the null terminator isn't actually necessary, but if\n\t\t * you don't add the extra character, you get\n\t\t * STATUS_INFO_LENGTH_MISMATCH when FileNameLength is 2.\n\t\t */\n\n\t\t/*\n\t\t * When fuzzing with wlfuzz.exe, creating a hard link sometimes\n\t\t * fails with STATUS_ACCESS_DENIED.  However, it eventually\n\t\t * succeeds when re-attempted...\n\t\t */\n\t\tint i = 0;\n\t\tdo {\n\t\t\tstatus = NtSetInformationFile(h, &ctx->iosb, info,\n\t\t\t\t\t\t      bufsize,\n\t\t\t\t\t\t      FileLinkInformation);\n\t\t\tif (NT_SUCCESS(status)) {\n\t\t\t\twimlib_aligned_free(buf);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t} while (++i < 32);\n\t\twinnt_error(status, L\"Failed to create link \\\"%ls\\\"\",\n\t\t\t    current_path(ctx));\n\t\twimlib_aligned_free(buf);\n\t\treturn WIMLIB_ERR_LINK;\n\t} else {\n\t\tHANDLE h2;\n\t\tint ret;\n\n\t\tret = create_nondirectory_inode(&h2, dentry, ctx);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tNtClose(h2);\n\t\treturn 0;\n\t}\n}\n\n/* Given an inode (represented by the open handle @h) for which one link has\n * been created (named by @first_dentry), create the other links.\n *\n * Or, if the target volume does not support hard links, create separate files.\n *\n * Note: This uses ctx->pathbuf and does not reset it.\n */\nstatic int\ncreate_links(HANDLE h, const struct wim_dentry *first_dentry,\n\t     struct win32_apply_ctx *ctx)\n{\n\tconst struct wim_inode *inode = first_dentry->d_inode;\n\tconst struct wim_dentry *dentry;\n\tint ret;\n\n\tinode_for_each_extraction_alias(dentry, inode) {\n\t\tif (dentry != first_dentry) {\n\t\t\tret = create_link(h, dentry, ctx);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/* Create a nondirectory file, including all links.  */\nstatic int\ncreate_nondirectory(struct wim_inode *inode, struct win32_apply_ctx *ctx)\n{\n\tstruct wim_dentry *first_dentry;\n\tHANDLE h;\n\tint ret;\n\n\tfirst_dentry = first_extraction_alias(inode);\n\n\t/* Create first link.  */\n\tret = create_nondirectory_inode(&h, first_dentry, ctx);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Set short name.  */\n\tret = set_short_name(h, first_dentry, ctx);\n\n\t/* Create additional links, OR if hard links are not supported just\n\t * create more files.  */\n\tif (!ret)\n\t\tret = create_links(h, first_dentry, ctx);\n\n\t/* \"WIMBoot\" extraction: set external backing by the WIM file if needed.  */\n\tif (!ret && unlikely(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT))\n\t\tret = set_backed_from_wim(h, inode, ctx);\n\n\tNtClose(h);\n\treturn ret;\n}\n\n/* Create all the nondirectory files being extracted, including all aliases\n * (hard links).  */\nstatic int\ncreate_nondirectories(struct list_head *dentry_list, struct win32_apply_ctx *ctx)\n{\n\tstruct wim_dentry *dentry;\n\tstruct wim_inode *inode;\n\tint ret;\n\n\tlist_for_each_entry(dentry, dentry_list, d_extraction_list_node) {\n\t\tinode = dentry->d_inode;\n\t\tif (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY)\n\t\t\tcontinue;\n\t\t/* Call create_nondirectory() only once per inode  */\n\t\tif (dentry == inode_first_extraction_dentry(inode)) {\n\t\t\tret = create_nondirectory(inode, ctx);\n\t\t\tret = check_apply_error(dentry, ctx, ret);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t}\n\t\tret = report_file_created(&ctx->common);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nstatic void\nclose_handles(struct win32_apply_ctx *ctx)\n{\n\tfor (unsigned i = 0; i < ctx->num_open_handles; i++)\n\t\tNtClose(ctx->open_handles[i]);\n}\n\n/* Prepare to read the next blob, which has size @blob_size, into an in-memory\n * buffer.  */\nstatic bool\nprepare_data_buffer(struct win32_apply_ctx *ctx, u64 blob_size)\n{\n\tif (blob_size > ctx->data_buffer_size) {\n\t\t/* Larger buffer needed.  */\n\t\tvoid *new_buffer;\n\t\tif ((size_t)blob_size != blob_size)\n\t\t\treturn false;\n\t\tnew_buffer = REALLOC(ctx->data_buffer, blob_size);\n\t\tif (!new_buffer)\n\t\t\treturn false;\n\t\tctx->data_buffer = new_buffer;\n\t\tctx->data_buffer_size = blob_size;\n\t}\n\t/* On the first call this changes data_buffer_ptr from NULL, which tells\n\t * extract_chunk() that the data buffer needs to be filled while reading\n\t * the stream data.  */\n\tctx->data_buffer_ptr = ctx->data_buffer;\n\treturn true;\n}\n\nstatic int\nbegin_extract_blob_instance(const struct blob_descriptor *blob,\n\t\t\t    struct wim_dentry *dentry,\n\t\t\t    const struct wim_inode_stream *strm,\n\t\t\t    struct win32_apply_ctx *ctx)\n{\n\tHANDLE h;\n\tNTSTATUS status;\n\n\tif (unlikely(strm->stream_type == STREAM_TYPE_REPARSE_POINT)) {\n\t\t/* We can't write the reparse point stream directly; we must set\n\t\t * it with FSCTL_SET_REPARSE_POINT, which requires that all the\n\t\t * data be available.  So, stage the data in a buffer.  */\n\t\tif (!prepare_data_buffer(ctx, blob->size))\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\tlist_add_tail(&dentry->d_tmp_list, &ctx->reparse_dentries);\n\t\treturn 0;\n\t}\n\n\tif (unlikely(strm->stream_type == STREAM_TYPE_EFSRPC_RAW_DATA)) {\n\t\t/* We can't write encrypted files directly; we must use\n\t\t * WriteEncryptedFileRaw(), which requires providing the data\n\t\t * through a callback function.  This can't easily be combined\n\t\t * with our own callback-based approach.\n\t\t *\n\t\t * The current workaround is to simply read the blob into memory\n\t\t * and write the encrypted file from that.\n\t\t *\n\t\t * TODO: This isn't sufficient for extremely large encrypted\n\t\t * files.  Perhaps we should create an extra thread to write\n\t\t * such files...  */\n\t\tif (!prepare_data_buffer(ctx, blob->size))\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\tlist_add_tail(&dentry->d_tmp_list, &ctx->encrypted_dentries);\n\t\treturn 0;\n\t}\n\n\t/* It's a data stream (may be unnamed or named).  */\n\twimlib_assert(strm->stream_type == STREAM_TYPE_DATA);\n\n\tif (ctx->num_open_handles == MAX_OPEN_FILES) {\n\t\t/* XXX: Fix this.  But because of the checks in\n\t\t * extract_blob_list(), this can now only happen on a filesystem\n\t\t * that does not support hard links.  */\n\t\tERROR(\"Can't extract data: too many open files!\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n\n\n\tif (unlikely(stream_is_named(strm))) {\n\t\tbuild_extraction_path_with_ads(dentry, ctx,\n\t\t\t\t\t       strm->stream_name,\n\t\t\t\t\t       utf16le_len_chars(strm->stream_name));\n\t} else {\n\t\tbuild_extraction_path(dentry, ctx);\n\t}\n\n\n\t/* Open a new handle  */\n\tstatus = do_create_file(&h,\n\t\t\t\tFILE_WRITE_DATA | SYNCHRONIZE,\n\t\t\t\tNULL, 0, FILE_OPEN_IF,\n\t\t\t\tFILE_SEQUENTIAL_ONLY |\n\t\t\t\t\tFILE_SYNCHRONOUS_IO_NONALERT,\n\t\t\t\tctx);\n\tif (!NT_SUCCESS(status)) {\n\t\twinnt_error(status, L\"Can't open \\\"%ls\\\" for writing\",\n\t\t\t    current_path(ctx));\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\n\tctx->is_sparse_stream[ctx->num_open_handles] = false;\n\tif (need_sparse_flag(dentry->d_inode, ctx)) {\n\t\t/* If the stream is unnamed, then the sparse flag was already\n\t\t * set when the file was created.  But if the stream is named,\n\t\t * then we need to set the sparse flag here. */\n\t\tif (unlikely(stream_is_named(strm))) {\n\t\t\tint ret = set_sparse_flag(h, ctx);\n\t\t\tif (ret) {\n\t\t\t\tNtClose(h);\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\t\tctx->is_sparse_stream[ctx->num_open_handles] = true;\n\t\tctx->any_sparse_streams = true;\n\t} else {\n\t\t/* Allocate space for the data.  */\n\t\tFILE_ALLOCATION_INFORMATION info =\n\t\t\t{ .AllocationSize = { .QuadPart = blob->size }};\n\t\tNtSetInformationFile(h, &ctx->iosb, &info, sizeof(info),\n\t\t\t\t     FileAllocationInformation);\n\t}\n\tctx->open_handles[ctx->num_open_handles++] = h;\n\treturn 0;\n}\n\n/* Given a Windows NT namespace path, such as \\??\\e:\\Windows\\System32, return a\n * pointer to the suffix of the path that begins with the device directly, such\n * as e:\\Windows\\System32.  */\nstatic const wchar_t *\nskip_nt_toplevel_component(const wchar_t *path, size_t path_nchars)\n{\n\tstatic const wchar_t * const dirs[] = {\n\t\tL\"\\\\??\\\\\",\n\t\tL\"\\\\DosDevices\\\\\",\n\t\tL\"\\\\Device\\\\\",\n\t};\n\tconst wchar_t * const end = path + path_nchars;\n\n\tfor (size_t i = 0; i < ARRAY_LEN(dirs); i++) {\n\t\tsize_t len = wcslen(dirs[i]);\n\t\tif (len <= (end - path) && !wmemcmp(path, dirs[i], len)) {\n\t\t\tpath += len;\n\t\t\twhile (path != end && *path == L'\\\\')\n\t\t\t\tpath++;\n\t\t\treturn path;\n\t\t}\n\t}\n\treturn path;\n}\n\n/*\n * Given a Windows NT namespace path, such as \\??\\e:\\Windows\\System32, return a\n * pointer to the suffix of the path that is device-relative but possibly with\n * leading slashes, such as \\Windows\\System32.\n *\n * The path has an explicit length and is not necessarily null terminated.\n */\nstatic const wchar_t *\nget_device_relative_path(const wchar_t *path, size_t path_nchars)\n{\n\tconst wchar_t * const orig_path = path;\n\tconst wchar_t * const end = path + path_nchars;\n\n\tpath = skip_nt_toplevel_component(path, path_nchars);\n\tif (path == orig_path)\n\t\treturn orig_path;\n\n\twhile (path != end && *path != L'\\\\')\n\t\tpath++;\n\n\treturn path;\n}\n\n/*\n * Given a reparse point buffer for an inode for which the absolute link target\n * was relativized when it was archived, de-relative the link target to be\n * consistent with the actual extraction location.\n */\nstatic void\ntry_rpfix(struct reparse_buffer_disk *rpbuf, u16 *rpbuflen_p,\n\t  struct win32_apply_ctx *ctx)\n{\n\tstruct link_reparse_point link;\n\tsize_t orig_subst_name_nchars;\n\tconst wchar_t *relpath;\n\tsize_t relpath_nchars;\n\tsize_t target_ntpath_nchars;\n\tsize_t fixed_subst_name_nchars;\n\tconst wchar_t *fixed_print_name;\n\tsize_t fixed_print_name_nchars;\n\n\t/* Do nothing if the reparse data is invalid.  */\n\tif (parse_link_reparse_point(rpbuf, *rpbuflen_p, &link))\n\t\treturn;\n\n\t/* Do nothing if the reparse point is a relative symbolic link.  */\n\tif (link_is_relative_symlink(&link))\n\t\treturn;\n\n\t/* Build the new substitute name from the NT namespace path to the\n\t * target directory, then a path separator, then the \"device relative\"\n\t * part of the old substitute name.  */\n\n\torig_subst_name_nchars = link.substitute_name_nbytes / sizeof(wchar_t);\n\n\trelpath = get_device_relative_path(link.substitute_name,\n\t\t\t\t\t   orig_subst_name_nchars);\n\trelpath_nchars = orig_subst_name_nchars -\n\t\t\t (relpath - link.substitute_name);\n\n\ttarget_ntpath_nchars = ctx->target_ntpath.Length / sizeof(wchar_t);\n\n\t/* If the target directory is a filesystem root, such as \\??\\C:\\, then\n\t * it already will have a trailing slash.  Don't include this slash if\n\t * we are already adding slashes via 'relpath'.  This prevents an extra\n\t * slash from being generated each time the link is extracted.  And\n\t * unlike on UNIX, the number of slashes in paths on Windows can be\n\t * significant; Windows won't understand the link target if it contains\n\t * too many slashes.  */\n\tif (target_ntpath_nchars > 0 && relpath_nchars > 0 &&\n\t    ctx->target_ntpath.Buffer[target_ntpath_nchars - 1] == L'\\\\')\n\t\ttarget_ntpath_nchars--;\n\n\t/* Also remove extra slashes from the beginning of 'relpath'.  Normally\n\t * this isn't needed, but this is here to make the extra slash(es) added\n\t * by wimlib pre-v1.9.1 get removed automatically.  */\n\twhile (relpath_nchars >= 2 &&\n\t       relpath[0] == L'\\\\' && relpath[1] == L'\\\\') {\n\t\trelpath++;\n\t\trelpath_nchars--;\n\t}\n\n\tfixed_subst_name_nchars = target_ntpath_nchars + relpath_nchars;\n\n\twchar_t* fixed_subst_name = MALLOC(fixed_subst_name_nchars * sizeof(wchar_t));\n\n\twmemcpy(fixed_subst_name, ctx->target_ntpath.Buffer, target_ntpath_nchars);\n\twmemcpy(&fixed_subst_name[target_ntpath_nchars], relpath, relpath_nchars);\n\t/* Doesn't need to be null-terminated.  */\n\n\t/* Print name should be Win32, but not all NT names can even be\n\t * translated to Win32 names.  But we can at least delete the top-level\n\t * directory, such as \\??\\, and this will have the expected result in\n\t * the usual case.  */\n\tfixed_print_name = skip_nt_toplevel_component(fixed_subst_name,\n\t\t\t\t\t\t      fixed_subst_name_nchars);\n\tfixed_print_name_nchars = fixed_subst_name_nchars - (fixed_print_name -\n\t\t\t\t\t\t\t     fixed_subst_name);\n\n\tlink.substitute_name = fixed_subst_name;\n\tlink.substitute_name_nbytes = fixed_subst_name_nchars * sizeof(wchar_t);\n\tlink.print_name = (wchar_t *)fixed_print_name;\n\tlink.print_name_nbytes = fixed_print_name_nchars * sizeof(wchar_t);\n\tmake_link_reparse_point(&link, rpbuf, rpbuflen_p);\n\tFREE(fixed_subst_name);\n}\n\n/* Sets the reparse point on the specified file.  This handles \"fixing\" the\n * targets of absolute symbolic links and junctions if WIMLIB_EXTRACT_FLAG_RPFIX\n * was specified.  */\nstatic int\nset_reparse_point(const struct wim_dentry *dentry,\n\t\t  const struct reparse_buffer_disk *rpbuf, u16 rpbuflen,\n\t\t  struct win32_apply_ctx *ctx)\n{\n\tif ((ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_RPFIX)\n\t    && !(dentry->d_inode->i_rp_flags & WIM_RP_FLAG_NOT_FIXED))\n\t{\n\t\tmemcpy(&ctx->rpfixbuf, rpbuf, rpbuflen);\n\t\ttry_rpfix(&ctx->rpfixbuf, &rpbuflen, ctx);\n\t\trpbuf = &ctx->rpfixbuf;\n\t}\n\treturn do_set_reparse_point(dentry, rpbuf, rpbuflen, ctx);\n\n}\n\n/* Import the next block of raw encrypted data  */\nstatic DWORD WINAPI\nimport_encrypted_data(PBYTE pbData, PVOID pvCallbackContext, PULONG Length)\n{\n\tstruct win32_apply_ctx *ctx = pvCallbackContext;\n\tULONG copy_len;\n\n\tcopy_len = min(ctx->encrypted_size - ctx->encrypted_offset, *Length);\n\tmemcpy(pbData, &ctx->data_buffer[ctx->encrypted_offset], copy_len);\n\tctx->encrypted_offset += copy_len;\n\t*Length = copy_len;\n\treturn ERROR_SUCCESS;\n}\n\n/*\n * Write the raw encrypted data to the already-created file (or directory)\n * corresponding to @dentry.\n *\n * The raw encrypted data is provided in ctx->data_buffer, and its size is\n * ctx->encrypted_size.\n *\n * This function may close the target directory, in which case the caller needs\n * to re-open it if needed.\n */\nstatic int\nextract_encrypted_file(const struct wim_dentry *dentry,\n\t\t       struct win32_apply_ctx *ctx)\n{\n\tvoid *rawctx;\n\tDWORD err;\n\tULONG flags;\n\tbool retried;\n\n\t/* Temporarily build a Win32 path for OpenEncryptedFileRaw()  */\n\tbuild_win32_extraction_path(dentry, ctx);\n\n\tflags = CREATE_FOR_IMPORT | OVERWRITE_HIDDEN;\n\tif (dentry->d_inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY)\n\t\tflags |= CREATE_FOR_DIR;\n\n\tretried = false;\nretry:\n\terr = OpenEncryptedFileRaw(ctx->pathbuf.Buffer, flags, &rawctx);\n\tif (err == ERROR_SHARING_VIOLATION && !retried) {\n\t\t/* This can be caused by the handle we have open to the target\n\t\t * directory.  Try closing it temporarily.  */\n\t\tclose_target_directory(ctx);\n\t\tretried = true;\n\t\tgoto retry;\n\t}\n\n\t/* Restore the NT namespace path  */\n\tbuild_extraction_path(dentry, ctx);\n\n\tif (err != ERROR_SUCCESS) {\n\t\twin32_error(err, L\"Can't open \\\"%ls\\\" for encrypted import\",\n\t\t\t    current_path(ctx));\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\n\tctx->encrypted_offset = 0;\n\n\terr = WriteEncryptedFileRaw(import_encrypted_data, ctx, rawctx);\n\n\tCloseEncryptedFileRaw(rawctx);\n\n\tif (err != ERROR_SUCCESS) {\n\t\twin32_error(err, L\"Can't import encrypted file \\\"%ls\\\"\",\n\t\t\t    current_path(ctx));\n\t\treturn WIMLIB_ERR_WRITE;\n\t}\n\n\treturn 0;\n}\n\n/* Called when starting to read a blob for extraction */\nstatic int\nwin32_begin_extract_blob(struct blob_descriptor *blob, void *_ctx)\n{\n\tstruct win32_apply_ctx *ctx = _ctx;\n\tconst struct blob_extraction_target *targets = blob_extraction_targets(blob);\n\tint ret;\n\n\tctx->num_open_handles = 0;\n\tctx->data_buffer_ptr = NULL;\n\tctx->any_sparse_streams = false;\n\tINIT_LIST_HEAD(&ctx->reparse_dentries);\n\tINIT_LIST_HEAD(&ctx->encrypted_dentries);\n\n\tfor (u32 i = 0; i < blob->out_refcnt; i++) {\n\t\tconst struct wim_inode *inode = targets[i].inode;\n\t\tconst struct wim_inode_stream *strm = targets[i].stream;\n\t\tstruct wim_dentry *dentry;\n\n\t\t/* A copy of the blob needs to be extracted to @inode.  */\n\n\t\tif (ctx->common.supported_features.hard_links) {\n\t\t\tdentry = inode_first_extraction_dentry(inode);\n\t\t\tret = begin_extract_blob_instance(blob, dentry, strm, ctx);\n\t\t\tret = check_apply_error(dentry, ctx, ret);\n\t\t\tif (ret)\n\t\t\t\tgoto fail;\n\t\t} else {\n\t\t\t/* Hard links not supported.  Extract the blob\n\t\t\t * separately to each alias of the inode.  */\n\t\t\tinode_for_each_extraction_alias(dentry, inode) {\n\t\t\t\tret = begin_extract_blob_instance(blob, dentry, strm, ctx);\n\t\t\t\tret = check_apply_error(dentry, ctx, ret);\n\t\t\t\tif (ret)\n\t\t\t\t\tgoto fail;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn 0;\n\nfail:\n\tclose_handles(ctx);\n\treturn ret;\n}\n\nstatic int\npwrite_to_handle(HANDLE h, const void *data, size_t size, u64 offset)\n{\n\tconst uintptr_t end = (uintptr_t)data + size;\n\tuintptr_t p;\n\tIO_STATUS_BLOCK iosb;\n\tNTSTATUS status;\n\n\tfor (p = (uintptr_t)data; p != end; p += iosb.Information,\n\t\t\t\t offset += iosb.Information)\n\t{\n\t\tLARGE_INTEGER offs = { .QuadPart = offset };\n\n\t\tstatus = NtWriteFile(h, NULL, NULL, NULL, &iosb,\n\t\t\t\t     (void *)p, min(INT32_MAX, end - p),\n\t\t\t\t     &offs, NULL);\n\t\tif (!NT_SUCCESS(status)) {\n\t\t\twinnt_error(status,\n\t\t\t\t    L\"Error writing data to target volume\");\n\t\t\treturn WIMLIB_ERR_WRITE;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/* Called when the next chunk of a blob has been read for extraction */\nstatic int\nwin32_extract_chunk(const struct blob_descriptor *blob, u64 offset,\n\t\t    const void *chunk, size_t size, void *_ctx)\n{\n\tstruct win32_apply_ctx *ctx = _ctx;\n\tconst uintptr_t end = (uintptr_t)chunk + size;\n\tuintptr_t p;\n\tbool zeroes;\n\tsize_t len;\n\tunsigned i;\n\tint ret;\n\n\t/*\n\t * For sparse streams, only write nonzero regions.  This lets the\n\t * filesystem use holes to represent zero regions.\n\t */\n\tfor (p = (uintptr_t)chunk; p != end; p += len, offset += len) {\n\t\tzeroes = maybe_detect_sparse_region((const void*)p, end - p, &len,\n\t\t\t\t\t\t    ctx->any_sparse_streams);\n\t\tfor (i = 0; i < ctx->num_open_handles; i++) {\n\t\t\tif (!zeroes || !ctx->is_sparse_stream[i]) {\n\t\t\t\tret = pwrite_to_handle(ctx->open_handles[i],\n\t\t\t\t\t\t       (void*)p, len, offset);\n\t\t\t\tif (ret)\n\t\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Copy the data chunk into the buffer (if needed)  */\n\tif (ctx->data_buffer_ptr)\n\t\tctx->data_buffer_ptr = mempcpy(ctx->data_buffer_ptr,\n\t\t\t\t\t       chunk, size);\n\treturn 0;\n}\n\nstatic int\nget_system_compression_format(int extract_flags)\n{\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K)\n\t\treturn FILE_PROVIDER_COMPRESSION_XPRESS4K;\n\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K)\n\t\treturn FILE_PROVIDER_COMPRESSION_XPRESS8K;\n\n\tif (extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K)\n\t\treturn FILE_PROVIDER_COMPRESSION_XPRESS16K;\n\n\treturn FILE_PROVIDER_COMPRESSION_LZX;\n}\n\n\nstatic const wchar_t *\nget_system_compression_format_string(int format)\n{\n\tswitch (format) {\n\tcase FILE_PROVIDER_COMPRESSION_XPRESS4K:\n\t\treturn L\"XPRESS4K\";\n\tcase FILE_PROVIDER_COMPRESSION_XPRESS8K:\n\t\treturn L\"XPRESS8K\";\n\tcase FILE_PROVIDER_COMPRESSION_XPRESS16K:\n\t\treturn L\"XPRESS16K\";\n\tdefault:\n\t\treturn L\"LZX\";\n\t}\n}\n\nstatic NTSTATUS\nset_system_compression(HANDLE h, int format)\n{\n\tNTSTATUS status;\n\tstruct {\n\t\tWOF_EXTERNAL_INFO wof_info;\n\t\tFILE_PROVIDER_EXTERNAL_INFO_V1 file_info;\n\t} in = {\n\t\t.wof_info = {\n\t\t\t.Version = WOF_CURRENT_VERSION,\n\t\t\t.Provider = WOF_PROVIDER_FILE,\n\t\t},\n\t\t.file_info = {\n\t\t\t.Version = FILE_PROVIDER_CURRENT_VERSION,\n\t\t\t.Algorithm = format,\n\t\t},\n\t};\n\n\t/* We intentionally use NtFsControlFile() rather than DeviceIoControl()\n\t * here because the \"compressing this object would not save space\"\n\t * status code does not map to a valid Win32 error code on older\n\t * versions of Windows (before Windows 10?).  This can be a problem if\n\t * the WOFADK driver is being used rather than the regular WOF, since\n\t * WOFADK can be used on older versions of Windows.  */\n\tstatus = winnt_fsctl(h, FSCTL_SET_EXTERNAL_BACKING,\n\t\t\t     &in, sizeof(in), NULL, 0, NULL);\n\n\tif (status == 0xC000046F) /* \"Compressing this object would not save space.\"  */\n\t\treturn STATUS_SUCCESS;\n\n\treturn status;\n}\n\n/* Hard-coded list of files which the Windows bootloader may need to access\n * before the WOF driver has been loaded.  */\nstatic const wchar_t * const bootloader_pattern_strings[] = {\n\tL\"*winload.*\",\n\tL\"*winresume.*\",\n\tL\"\\\\Windows\\\\AppPatch\\\\drvmain.sdb\",\n\tL\"\\\\Windows\\\\Boot\\\\DVD\\\\*\",\n\tL\"\\\\Windows\\\\Boot\\\\EFI\\\\*\",\n\tL\"\\\\Windows\\\\bootstat.dat\",\n\tL\"\\\\Windows\\\\Fonts\\\\vgaoem.fon\",\n\tL\"\\\\Windows\\\\Fonts\\\\vgasys.fon\",\n\tL\"\\\\Windows\\\\INF\\\\errata.inf\",\n\tL\"\\\\Windows\\\\System32\\\\config\\\\*\",\n\tL\"\\\\Windows\\\\System32\\\\ntkrnlpa.exe\",\n\tL\"\\\\Windows\\\\System32\\\\ntoskrnl.exe\",\n\tL\"\\\\Windows\\\\System32\\\\bootvid.dll\",\n\tL\"\\\\Windows\\\\System32\\\\ci.dll\",\n\tL\"\\\\Windows\\\\System32\\\\hal*.dll\",\n\tL\"\\\\Windows\\\\System32\\\\mcupdate_AuthenticAMD.dll\",\n\tL\"\\\\Windows\\\\System32\\\\mcupdate_GenuineIntel.dll\",\n\tL\"\\\\Windows\\\\System32\\\\pshed.dll\",\n\tL\"\\\\Windows\\\\System32\\\\apisetschema.dll\",\n\tL\"\\\\Windows\\\\System32\\\\api-ms-win*.dll\",\n\tL\"\\\\Windows\\\\System32\\\\ext-ms-win*.dll\",\n\tL\"\\\\Windows\\\\System32\\\\KernelBase.dll\",\n\tL\"\\\\Windows\\\\System32\\\\drivers\\\\*.sys\",\n\tL\"\\\\Windows\\\\System32\\\\*.nls\",\n\tL\"\\\\Windows\\\\System32\\\\kbd*.dll\",\n\tL\"\\\\Windows\\\\System32\\\\kd*.dll\",\n\tL\"\\\\Windows\\\\System32\\\\clfs.sys\",\n\tL\"\\\\Windows\\\\System32\\\\CodeIntegrity\\\\driver.stl\",\n};\n\nstatic const struct string_list bootloader_patterns = {\n\t.strings = (wchar_t **)bootloader_pattern_strings,\n\t.num_strings = ARRAY_LEN(bootloader_pattern_strings),\n};\n\n/* Returns true if the specified system compression format is supported by the\n * bootloader of the image being applied.  */\nstatic bool\nbootloader_supports_compression_format(struct win32_apply_ctx *ctx, int format)\n{\n\t/* Windows 10 and later support XPRESS4K */\n\tif (format == FILE_PROVIDER_COMPRESSION_XPRESS4K)\n\t\treturn ctx->windows_build_number >= 10240;\n\n\t/*\n\t * Windows 10 version 1903 and later support the other formats;\n\t * see https://wimlib.net/forums/viewtopic.php?f=1&t=444\n\t */\n\treturn ctx->windows_build_number >= 18362;\n}\n\nstatic NTSTATUS\nset_system_compression_on_inode(struct wim_inode *inode, int format,\n\t\t\t\tstruct win32_apply_ctx *ctx)\n{\n\tbool retried = false;\n\tNTSTATUS status;\n\tHANDLE h;\n\n\t/* If it may be needed for compatibility with the Windows bootloader,\n\t * force this file to XPRESS4K or uncompressed format.  */\n\tif (!bootloader_supports_compression_format(ctx, format)) {\n\t\t/* We need to check the patterns against every name of the\n\t\t * inode, in case any of them match.  */\n\t\tstruct wim_dentry *dentry;\n\t\tinode_for_each_extraction_alias(dentry, inode) {\n\t\t\tbool incompatible;\n\t\t\tbool warned;\n\n\t\t\tif (calculate_dentry_full_path(dentry)) {\n\t\t\t\tERROR(\"Unable to compute file path!\");\n\t\t\t\treturn STATUS_NO_MEMORY;\n\t\t\t}\n\n\t\t\tincompatible = match_pattern_list(dentry->d_full_path,\n\t\t\t\t\t\t\t  &bootloader_patterns,\n\t\t\t\t\t\t\t  MATCH_RECURSIVELY);\n\t\t\tFREE(dentry->d_full_path);\n\t\t\tdentry->d_full_path = NULL;\n\n\t\t\tif (!incompatible)\n\t\t\t\tcontinue;\n\n\t\t\twarned = (ctx->num_system_compression_exclusions++ > 0);\n\n\t\t\tif (bootloader_supports_compression_format(ctx,\n\t\t\t\t   FILE_PROVIDER_COMPRESSION_XPRESS4K))\n\t\t\t{\n\t\t\t\t/* Force to XPRESS4K  */\n\t\t\t\tif (!warned) {\n\t\t\t\t\tWARNING(\"For compatibility with the \"\n\t\t\t\t\t\t\"Windows bootloader, some \"\n\t\t\t\t\t\t\"files are being\\n\"\n\t\t\t\t\t\t\"          compacted \"\n\t\t\t\t\t\t\"using the XPRESS4K format \"\n\t\t\t\t\t\t\"instead of the %\"TS\" format\\n\"\n\t\t\t\t\t\t\"          you requested.\",\n\t\t\t\t\t\tget_system_compression_format_string(format));\n\t\t\t\t}\n\t\t\t\tformat = FILE_PROVIDER_COMPRESSION_XPRESS4K;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t/* Force to uncompressed  */\n\t\t\t\tif (!warned) {\n\t\t\t\t\tWARNING(\"For compatibility with the \"\n\t\t\t\t\t\t\"Windows bootloader, some \"\n\t\t\t\t\t\t\"files will not\\n\"\n\t\t\t\t\t\t\"          be compressed with\"\n\t\t\t\t\t\t\" system compression \"\n\t\t\t\t\t\t\"(\\\"compacted\\\").\");\n\t\t\t\t}\n\t\t\t\treturn STATUS_SUCCESS;\n\t\t\t}\n\n\t\t}\n\t}\n\n\t/* Open the extracted file.  */\n\tstatus = create_file(&h, GENERIC_READ | GENERIC_WRITE, NULL,\n\t\t\t     0, FILE_OPEN, 0,\n\t\t\t     inode_first_extraction_dentry(inode), ctx);\n\n\tif (!NT_SUCCESS(status))\n\t\treturn status;\nretry:\n\t/* Compress the file.  If the attempt fails with \"invalid device\n\t * request\", then attach wof.sys (or wofadk.sys) and retry.  */\n\tstatus = set_system_compression(h, format);\n\tif (unlikely(status == STATUS_INVALID_DEVICE_REQUEST && !retried)) {\n\t\twchar_t drive_path[7];\n\t\tif (!win32_get_drive_path(ctx->common.target, drive_path) &&\n\t\t    win32_try_to_attach_wof(drive_path + 4)) {\n\t\t\tretried = true;\n\t\t\tgoto retry;\n\t\t}\n\t}\n\n\tNtClose(h);\n\treturn status;\n}\n\n/*\n * This function is called when doing a \"compact-mode\" extraction and we just\n * finished extracting a blob to one or more locations.  For each location that\n * was the unnamed data stream of a file, this function compresses the\n * corresponding file using System Compression, if allowed.\n *\n * Note: we're doing the compression immediately after extracting the data\n * rather than during a separate compression pass.  This way should be faster\n * since the operating system should still have the file's data cached.\n *\n * Note: we're having the operating system do the compression, which is not\n * ideal because wimlib could create the compressed data faster and more\n * efficiently (the compressed data format is identical to a WIM resource).  But\n * we seemingly don't have a choice because WOF prevents applications from\n * creating its reparse points.\n */\nstatic void\nhandle_system_compression(struct blob_descriptor *blob, struct win32_apply_ctx *ctx)\n{\n\tconst struct blob_extraction_target *targets = blob_extraction_targets(blob);\n\n\tconst int format = get_system_compression_format(ctx->common.extract_flags);\n\n\tfor (u32 i = 0; i < blob->out_refcnt; i++) {\n\t\tstruct wim_inode *inode = targets[i].inode;\n\t\tstruct wim_inode_stream *strm = targets[i].stream;\n\t\tNTSTATUS status;\n\n\t\tif (!stream_is_unnamed_data_stream(strm))\n\t\t\tcontinue;\n\n\t\tif (will_externally_back_inode(inode, ctx, NULL, false) != 0)\n\t\t\tcontinue;\n\n\t\tstatus = set_system_compression_on_inode(inode, format, ctx);\n\t\tif (likely(NT_SUCCESS(status)))\n\t\t\tcontinue;\n\n\t\tif (status == STATUS_INVALID_DEVICE_REQUEST) {\n\t\t\tWARNING(\n\t  \"The request to compress the extracted files using System Compression\\n\"\n\"          will not be honored because the operating system or target volume\\n\"\n\"          does not support it.  System Compression is only supported on\\n\"\n\"          Windows 10 and later, and only on NTFS volumes.\");\n\t\t\tctx->common.extract_flags &= ~COMPACT_FLAGS;\n\t\t\treturn;\n\t\t}\n\n\t\tctx->num_system_compression_failures++;\n\t\tif (ctx->num_system_compression_failures < 10) {\n\t\t\twinnt_warning(status, L\"\\\"%ls\\\": Failed to compress \"\n\t\t\t\t      \"extracted file using System Compression\",\n\t\t\t\t      current_path(ctx));\n\t\t} else if (ctx->num_system_compression_failures == 10) {\n\t\t\tWARNING(\"Suppressing further warnings about \"\n\t\t\t\t\"System Compression failures.\");\n\t\t}\n\t}\n}\n\n/* Called when a blob has been fully read for extraction */\nstatic int\nwin32_end_extract_blob(struct blob_descriptor *blob, int status, void *_ctx)\n{\n\tstruct win32_apply_ctx *ctx = _ctx;\n\tint ret;\n\tconst struct wim_dentry *dentry;\n\n\t/* Extend sparse streams to their final size. */\n\tif (ctx->any_sparse_streams && !status) {\n\t\tfor (unsigned i = 0; i < ctx->num_open_handles; i++) {\n\t\t\tFILE_END_OF_FILE_INFORMATION info =\n\t\t\t\t{ .EndOfFile = { .QuadPart = blob->size } };\n\t\t\tNTSTATUS ntstatus;\n\n\t\t\tif (!ctx->is_sparse_stream[i])\n\t\t\t\tcontinue;\n\n\t\t\tntstatus = NtSetInformationFile(ctx->open_handles[i],\n\t\t\t\t\t\t\t&ctx->iosb,\n\t\t\t\t\t\t\t&info, sizeof(info),\n\t\t\t\t\t\t\tFileEndOfFileInformation);\n\t\t\tif (!NT_SUCCESS(ntstatus)) {\n\t\t\t\twinnt_error(ntstatus, L\"Error writing data to \"\n\t\t\t\t\t    \"target volume (while extending)\");\n\t\t\t\tstatus = WIMLIB_ERR_WRITE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tclose_handles(ctx);\n\n\tif (status)\n\t\treturn status;\n\n\tif (unlikely(ctx->common.extract_flags & COMPACT_FLAGS))\n\t\thandle_system_compression(blob, ctx);\n\n\tif (likely(!ctx->data_buffer_ptr))\n\t\treturn 0;\n\n\tif (!list_empty(&ctx->reparse_dentries)) {\n\t\tif (blob->size > REPARSE_DATA_MAX_SIZE) {\n\t\t\tdentry = list_first_entry(&ctx->reparse_dentries,\n\t\t\t\t\t\t  struct wim_dentry, d_tmp_list);\n\t\t\tbuild_extraction_path(dentry, ctx);\n\t\t\tERROR(\"Reparse data of \\\"%ls\\\" has size \"\n\t\t\t      \"%\"PRIu64\" bytes (exceeds %u bytes)\",\n\t\t\t      current_path(ctx), blob->size,\n\t\t\t      REPARSE_DATA_MAX_SIZE);\n\t\t\tret = WIMLIB_ERR_INVALID_REPARSE_DATA;\n\t\t\treturn check_apply_error(dentry, ctx, ret);\n\t\t}\n\t\t/* Reparse data  */\n\t\tmemcpy(ctx->rpbuf.rpdata, ctx->data_buffer, blob->size);\n\n\t\tlist_for_each_entry(dentry, &ctx->reparse_dentries, d_tmp_list) {\n\n\t\t\t/* Reparse point header  */\n\t\t\tcomplete_reparse_point(&ctx->rpbuf, dentry->d_inode,\n\t\t\t\t\t       blob->size);\n\n\t\t\tret = set_reparse_point(dentry, &ctx->rpbuf,\n\t\t\t\t\t\tREPARSE_DATA_OFFSET + blob->size,\n\t\t\t\t\t\tctx);\n\t\t\tret = check_apply_error(dentry, ctx, ret);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t}\n\t}\n\n\tif (!list_empty(&ctx->encrypted_dentries)) {\n\t\tctx->encrypted_size = blob->size;\n\t\tlist_for_each_entry(dentry, &ctx->encrypted_dentries, d_tmp_list) {\n\t\t\tret = extract_encrypted_file(dentry, ctx);\n\t\t\tret = check_apply_error(dentry, ctx, ret);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\t/* Re-open the target directory if needed.  */\n\t\t\tret = open_target_directory(ctx);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t}\n\t}\n\n\treturn 0;\n}\n\n/* Attributes that can't be set directly  */\n#define SPECIAL_ATTRIBUTES\t\t\t\\\n\t(FILE_ATTRIBUTE_REPARSE_POINT\t|\t\\\n\t FILE_ATTRIBUTE_DIRECTORY\t|\t\\\n\t FILE_ATTRIBUTE_ENCRYPTED\t|\t\\\n\t FILE_ATTRIBUTE_SPARSE_FILE\t|\t\\\n\t FILE_ATTRIBUTE_COMPRESSED)\n\nstatic void\nset_object_id(HANDLE h, const struct wim_inode *inode,\n\t      struct win32_apply_ctx *ctx)\n{\n\tconst void *object_id;\n\tu32 len;\n\tNTSTATUS status;\n\n\tif (!ctx->common.supported_features.object_ids)\n\t\treturn;\n\n\tobject_id = inode_get_object_id(inode, &len);\n\tif (likely(object_id == NULL))  /* No object ID?  */\n\t\treturn;\n\n\tstatus = winnt_fsctl(h, FSCTL_SET_OBJECT_ID,\n\t\t\t     object_id, len, NULL, 0, NULL);\n\tif (NT_SUCCESS(status))\n\t\treturn;\n\n\t/* Object IDs must be unique within the filesystem.  A duplicate might\n\t * occur if an image containing object IDs is applied twice to the same\n\t * filesystem.  Arguably, the user should be warned in this case; but\n\t * the reality seems to be that nothing important cares about object IDs\n\t * except the Distributed Link Tracking Service... so for now these\n\t * failures are just ignored.  */\n\tif (status == STATUS_DUPLICATE_NAME ||\n\t    status == STATUS_OBJECT_NAME_COLLISION)\n\t\treturn;\n\n\tctx->num_object_id_failures++;\n\tif (ctx->num_object_id_failures < 10) {\n\t\twinnt_warning(status, L\"Can't set object ID on \\\"%ls\\\"\",\n\t\t\t      current_path(ctx));\n\t} else if (ctx->num_object_id_failures == 10) {\n\t\tWARNING(\"Suppressing further warnings about failure to set \"\n\t\t\t\"object IDs.\");\n\t}\n}\n\nstatic int\nset_xattrs(HANDLE h, const struct wim_inode *inode, struct win32_apply_ctx *ctx)\n{\n\tuintptr_t entries, entries_end;\n\tu32 len;\n\tconst struct wim_xattr_entry *entry;\n\tsize_t bufsize = 0;\n\tPRAGMA_ALIGN(u8 _buf[1024], 4);\n\tu8 *buf = _buf;\n\tFILE_FULL_EA_INFORMATION *ea, *ea_prev;\n\tNTSTATUS status;\n\tint ret;\n\n\tif (!ctx->common.supported_features.xattrs)\n\t\treturn 0;\n\n\tentries = (uintptr_t)inode_get_xattrs(inode, &len);\n\tif (likely(entries == 0 || len == 0))  /* No extended attributes? */\n\t\treturn 0;\n\tentries_end = entries + len;\n\n\tfor (entry = (const struct wim_xattr_entry*)entries; (uintptr_t)entry < entries_end;\n\t     entry = xattr_entry_next(entry)) {\n\t\tif (!valid_xattr_entry(entry, (size_t)(entries_end - (uintptr_t)entry))) {\n\t\t\tERROR(\"\\\"%\"TS\"\\\": extended attribute is corrupt or unsupported\",\n\t\t\t      inode_any_full_path(inode));\n\t\t\treturn WIMLIB_ERR_INVALID_XATTR;\n\t\t}\n\n\t\tbufsize += ALIGN(offsetof(FILE_FULL_EA_INFORMATION, EaName) +\n\t\t\t\t entry->name_len + 1 +\n\t\t\t\t le16_to_cpu(entry->value_len), 4);\n\t}\n\n\tif (unlikely(bufsize != (u32)bufsize)) {\n\t\tERROR(\"\\\"%\"TS\"\\\": too many extended attributes to extract!\",\n\t\t      inode_any_full_path(inode));\n\t\treturn WIMLIB_ERR_INVALID_XATTR;\n\t}\n\n\tif (unlikely(bufsize > sizeof(_buf))) {\n\t\tbuf = MALLOC(bufsize);\n\t\tif (!buf)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\tea_prev = NULL;\n\tea = (FILE_FULL_EA_INFORMATION *)buf;\n\tfor (entry = (const struct wim_xattr_entry*)entries; (uintptr_t)entry < entries_end;\n\t     entry = xattr_entry_next(entry)) {\n\t\tu8 *p;\n\n\t\tif (ea_prev)\n\t\t\tea_prev->NextEntryOffset = (u8 *)ea - (u8 *)ea_prev;\n\t\tea->Flags = entry->flags;\n\t\tea->EaNameLength = entry->name_len;\n\t\tea->EaValueLength = le16_to_cpu(entry->value_len);\n\t\tp = mempcpy(ea->EaName, entry->name,\n\t\t\t    ea->EaNameLength + 1 + ea->EaValueLength);\n\t\twhile ((uintptr_t)p & 3)\n\t\t\t*p++ = 0;\n\t\tea_prev = ea;\n\t\tea = (FILE_FULL_EA_INFORMATION *)p;\n\t}\n\tif (ea_prev == NULL) {\n\t\tret = WIMLIB_ERR_INVALID_PARAM;\n\t\tgoto out;\n\t}\n\tea_prev->NextEntryOffset = 0;\n\twimlib_assert((u8 *)ea - buf == bufsize);\n\n\tstatus = NtSetEaFile(h, &ctx->iosb, buf, bufsize);\n\tif (unlikely(!NT_SUCCESS(status))) {\n\t\tif (status == STATUS_EAS_NOT_SUPPORTED) {\n\t\t\t/* This happens with Samba. */\n\t\t\tWARNING(\"Filesystem advertised extended attribute (EA) support, but it doesn't\\n\"\n\t\t\t\t\"          work.  EAs will not be extracted.\");\n\t\t\tctx->common.supported_features.xattrs = 0;\n\t\t} else if (status == STATUS_INVALID_EA_NAME) {\n\t\t\tctx->num_xattr_failures++;\n\t\t\tif (ctx->num_xattr_failures < 5) {\n\t\t\t\twinnt_warning(status,\n\t\t\t\t\t      L\"Can't set extended attributes on \\\"%ls\\\"\",\n\t\t\t\t\t      current_path(ctx));\n\t\t\t} else if (ctx->num_xattr_failures == 5) {\n\t\t\t\tWARNING(\"Suppressing further warnings about \"\n\t\t\t\t\t\"failure to set extended attributes.\");\n\t\t\t}\n\t\t} else {\n\t\t\twinnt_error(status, L\"Can't set extended attributes on \\\"%ls\\\"\",\n\t\t\t\t    current_path(ctx));\n\t\t\tret = WIMLIB_ERR_SET_XATTR;\n\t\t\tgoto out;\n\t\t}\n\t}\n\tret = 0;\nout:\n\tif (buf != _buf)\n\t\tFREE(buf);\n\treturn ret;\n}\n\n/* Set the security descriptor @desc, of @desc_size bytes, on the file with open\n * handle @h.  */\nstatic NTSTATUS\nset_security_descriptor(HANDLE h, const void *_desc,\n\t\t\tsize_t desc_size, struct win32_apply_ctx *ctx)\n{\n\tSECURITY_INFORMATION info;\n\tNTSTATUS status;\n\tSECURITY_DESCRIPTOR_RELATIVE *desc;\n\n\t/*\n\t * Ideally, we would just pass in the security descriptor buffer as-is.\n\t * But it turns out that Windows can mess up the security descriptor\n\t * even when using the low-level NtSetSecurityObject() function:\n\t *\n\t * - Windows will clear SE_DACL_AUTO_INHERITED if it is set in the\n\t *   passed buffer.  To actually get Windows to set\n\t *   SE_DACL_AUTO_INHERITED, the application must set the non-persistent\n\t *   flag SE_DACL_AUTO_INHERIT_REQ.  As usual, Microsoft didn't bother\n\t *   to properly document either of these flags.  It's unclear how\n\t *   important SE_DACL_AUTO_INHERITED actually is, but to be safe we use\n\t *   the SE_DACL_AUTO_INHERIT_REQ workaround to set it if needed.\n\t *\n\t * - The above also applies to the equivalent SACL flags,\n\t *   SE_SACL_AUTO_INHERITED and SE_SACL_AUTO_INHERIT_REQ.\n\t *\n\t * - If the application says that it's setting\n\t *   DACL_SECURITY_INFORMATION, then Windows sets SE_DACL_PRESENT in the\n\t *   resulting security descriptor, even if the security descriptor the\n\t *   application provided did not have a DACL.  This seems to be\n\t *   unavoidable, since omitting DACL_SECURITY_INFORMATION would cause a\n\t *   default DACL to remain.  Fortunately, this behavior seems harmless,\n\t *   since the resulting DACL will still be \"null\" --- but it will be\n\t *   \"the other representation of null\".\n\t *\n\t * - The above also applies to SACL_SECURITY_INFORMATION and\n\t *   SE_SACL_PRESENT.  Again, it's seemingly unavoidable but \"harmless\"\n\t *   that Windows changes the representation of a \"null SACL\".\n\t */\n\tif (likely(desc_size <= STACK_MAX)) {\n\t\tdesc = alloca(desc_size);\n\t} else {\n\t\tdesc = MALLOC(desc_size);\n\t\tif (!desc)\n\t\t\treturn STATUS_NO_MEMORY;\n\t}\n\n\tmemcpy(desc, _desc, desc_size);\n\n\tif (likely(desc_size >= 4)) {\n\n\t\tif (desc->Control & SE_DACL_AUTO_INHERITED)\n\t\t\tdesc->Control |= SE_DACL_AUTO_INHERIT_REQ;\n\n\t\tif (desc->Control & SE_SACL_AUTO_INHERITED)\n\t\t\tdesc->Control |= SE_SACL_AUTO_INHERIT_REQ;\n\t}\n\n\t/*\n\t * More API insanity.  We want to set the entire security descriptor\n\t * as-is.  But all available APIs require specifying the specific parts\n\t * of the security descriptor being set.  Especially annoying is that\n\t * mandatory integrity labels are part of the SACL, but they aren't set\n\t * with SACL_SECURITY_INFORMATION.  Instead, applications must also\n\t * specify LABEL_SECURITY_INFORMATION (Windows Vista, Windows 7) or\n\t * BACKUP_SECURITY_INFORMATION (Windows 8).  But at least older versions\n\t * of Windows don't error out if you provide these newer flags...\n\t *\n\t * Also, if the process isn't running as Administrator, then it probably\n\t * doesn't have SE_RESTORE_PRIVILEGE.  In this case, it will always get\n\t * the STATUS_PRIVILEGE_NOT_HELD error by trying to set the SACL, even\n\t * if the security descriptor it provided did not have a SACL.  By\n\t * default, in this case we try to recover and set as much of the\n\t * security descriptor as possible --- potentially excluding the DACL, and\n\t * even the owner, as well as the SACL.\n\t */\n\n\tinfo = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |\n\t       DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION |\n\t       LABEL_SECURITY_INFORMATION | BACKUP_SECURITY_INFORMATION;\n\n\n\t/*\n\t * It's also worth noting that SetFileSecurity() is unusable because it\n\t * doesn't request \"backup semantics\" when it opens the file internally.\n\t * NtSetSecurityObject() seems to be the best function to use in backup\n\t * applications.  (SetSecurityInfo() should also work, but it's harder\n\t * to use and must call NtSetSecurityObject() internally anyway.\n\t * BackupWrite() is theoretically usable as well, but it's inflexible\n\t * and poorly documented.)\n\t */\n\nretry:\n\tstatus = NtSetSecurityObject(h, info, desc);\n\tif (NT_SUCCESS(status))\n\t\tgoto out_maybe_free_desc;\n\n\t/* Failed to set the requested parts of the security descriptor.  If the\n\t * error was permissions-related, try to set fewer parts of the security\n\t * descriptor, unless WIMLIB_EXTRACT_FLAG_STRICT_ACLS is enabled.  */\n\tif ((status == STATUS_PRIVILEGE_NOT_HELD ||\n\t     status == STATUS_ACCESS_DENIED) &&\n\t    !(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_ACLS))\n\t{\n\t\tif (info & SACL_SECURITY_INFORMATION) {\n\t\t\tinfo &= ~(SACL_SECURITY_INFORMATION |\n\t\t\t\t  LABEL_SECURITY_INFORMATION |\n\t\t\t\t  BACKUP_SECURITY_INFORMATION);\n\t\t\tctx->partial_security_descriptors++;\n\t\t\tgoto retry;\n\t\t}\n\t\tif (info & DACL_SECURITY_INFORMATION) {\n\t\t\tinfo &= ~DACL_SECURITY_INFORMATION;\n\t\t\tgoto retry;\n\t\t}\n\t\tif (info & OWNER_SECURITY_INFORMATION) {\n\t\t\tinfo &= ~OWNER_SECURITY_INFORMATION;\n\t\t\tgoto retry;\n\t\t}\n\t\t/* Nothing left except GROUP, and if we removed it we\n\t\t * wouldn't have anything at all.  */\n\t}\n\n\t/* No part of the security descriptor could be set, or\n\t * WIMLIB_EXTRACT_FLAG_STRICT_ACLS is enabled and the full security\n\t * descriptor could not be set.  */\n\tif (!(info & SACL_SECURITY_INFORMATION))\n\t\tctx->partial_security_descriptors--;\n\tctx->no_security_descriptors++;\n\nout_maybe_free_desc:\n\tif (unlikely(desc_size > STACK_MAX))\n\t\tFREE(desc);\n\treturn status;\n}\n\n/* Set metadata on the open file @h from the WIM inode @inode.  */\nstatic int\ndo_apply_metadata_to_file(HANDLE h, const struct wim_inode *inode,\n\t\t\t  struct win32_apply_ctx *ctx)\n{\n\tFILE_BASIC_INFORMATION info;\n\tNTSTATUS status;\n\tint ret;\n\n\t/* Set the file's object ID if present and object IDs are supported by\n\t * the filesystem.  */\n\tset_object_id(h, inode, ctx);\n\n\t/* Set the file's extended attributes (EAs) if present and EAs are\n\t * supported by the filesystem.  */\n\tret = set_xattrs(h, inode, ctx);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Set the file's security descriptor if present and we're not in\n\t * NO_ACLS mode  */\n\tif (inode_has_security_descriptor(inode) &&\n\t    !(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_NO_ACLS))\n\t{\n\t\tconst struct wim_security_data *sd;\n\t\tconst void *desc;\n\t\tsize_t desc_size;\n\n\t\tsd = wim_get_current_security_data(ctx->common.wim);\n\t\tdesc = sd->descriptors[inode->i_security_id];\n\t\tdesc_size = sd->sizes[inode->i_security_id];\n\n\t\tstatus = set_security_descriptor(h, desc, desc_size, ctx);\n\t\tif (!NT_SUCCESS(status) &&\n\t\t    (ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_ACLS))\n\t\t{\n\t\t\twinnt_error(status,\n\t\t\t\t    L\"Can't set security descriptor on \\\"%ls\\\"\",\n\t\t\t\t    current_path(ctx));\n\t\t\treturn WIMLIB_ERR_SET_SECURITY;\n\t\t}\n\t}\n\n\t/* Set attributes and timestamps  */\n\tinfo.CreationTime.QuadPart = inode->i_creation_time;\n\tinfo.LastAccessTime.QuadPart = inode->i_last_access_time;\n\tinfo.LastWriteTime.QuadPart = inode->i_last_write_time;\n\tinfo.ChangeTime.QuadPart = 0;\n\tif (ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES) {\n\t\tinfo.FileAttributes = FILE_ATTRIBUTE_NORMAL;\n\t} else {\n\t\tinfo.FileAttributes = inode->i_attributes & ~SPECIAL_ATTRIBUTES;\n\t\tif (info.FileAttributes == 0)\n\t\t\tinfo.FileAttributes = FILE_ATTRIBUTE_NORMAL;\n\t}\n\n\tstatus = NtSetInformationFile(h, &ctx->iosb, &info, sizeof(info),\n\t\t\t\t      FileBasicInformation);\n\t/* On FAT volumes we get STATUS_INVALID_PARAMETER if we try to set\n\t * attributes on the root directory.  (Apparently because FAT doesn't\n\t * actually have a place to store those attributes!)  */\n\tif (!NT_SUCCESS(status)\n\t    && !(status == STATUS_INVALID_PARAMETER &&\n\t\t dentry_is_root(inode_first_extraction_dentry(inode))))\n\t{\n\t\twinnt_error(status, L\"Can't set basic metadata on \\\"%ls\\\"\",\n\t\t\t    current_path(ctx));\n\t\treturn WIMLIB_ERR_SET_ATTRIBUTES;\n\t}\n\n\treturn 0;\n}\n\nstatic int\napply_metadata_to_file(const struct wim_dentry *dentry,\n\t\t       struct win32_apply_ctx *ctx)\n{\n\tconst struct wim_inode *inode = dentry->d_inode;\n\tDWORD perms;\n\tHANDLE h;\n\tNTSTATUS status;\n\tint ret;\n\n\tperms = FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | WRITE_DAC |\n\t\tWRITE_OWNER | ACCESS_SYSTEM_SECURITY;\n\n\tbuild_extraction_path(dentry, ctx);\n\n\t/* Open a handle with as many relevant permissions as possible.  */\n\twhile (!NT_SUCCESS(status = do_create_file(&h, perms, NULL,\n\t\t\t\t\t\t   0, FILE_OPEN, 0, ctx)))\n\t{\n\t\tif (status == STATUS_PRIVILEGE_NOT_HELD ||\n\t\t    status == STATUS_ACCESS_DENIED)\n\t\t{\n\t\t\tif (perms & ACCESS_SYSTEM_SECURITY) {\n\t\t\t\tperms &= ~ACCESS_SYSTEM_SECURITY;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (perms & WRITE_DAC) {\n\t\t\t\tperms &= ~WRITE_DAC;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (perms & WRITE_OWNER) {\n\t\t\t\tperms &= ~WRITE_OWNER;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\twinnt_error(status, L\"Can't open \\\"%ls\\\" to set metadata\",\n\t\t\t    current_path(ctx));\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\n\tret = do_apply_metadata_to_file(h, inode, ctx);\n\n\tNtClose(h);\n\n\treturn ret;\n}\n\nstatic int\napply_metadata(struct list_head *dentry_list, struct win32_apply_ctx *ctx)\n{\n\tconst struct wim_dentry *dentry;\n\tint ret;\n\n\t/* We go in reverse so that metadata is set on all a directory's\n\t * children before the directory itself.  This avoids any potential\n\t * problems with attributes, timestamps, or security descriptors.  */\n\tlist_for_each_entry_reverse(dentry, dentry_list, d_extraction_list_node)\n\t{\n\t\tret = apply_metadata_to_file(dentry, ctx);\n\t\tret = check_apply_error(dentry, ctx, ret);\n\t\tif (ret)\n\t\t\treturn ret;\n\t\tret = report_file_metadata_applied(&ctx->common);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\n/* Issue warnings about problems during the extraction for which warnings were\n * not already issued (due to the high number of potential warnings if we issued\n * them per-file).  */\nstatic void\ndo_warnings(const struct win32_apply_ctx *ctx)\n{\n\tif (ctx->partial_security_descriptors == 0\n\t    && ctx->no_security_descriptors == 0\n\t    && ctx->num_set_short_name_failures == 0\n\t#if 0\n\t    && ctx->num_remove_short_name_failures == 0\n\t#endif\n\t    )\n\t\treturn;\n\n\tWARNING(\"Extraction to \\\"%ls\\\" complete, but with one or more warnings:\",\n\t\tctx->common.target);\n\tif (ctx->num_set_short_name_failures) {\n\t\tWARNING(\"- Could not set short names on %lu files or directories\",\n\t\t\tctx->num_set_short_name_failures);\n\t}\n#if 0\n\tif (ctx->num_remove_short_name_failures) {\n\t\tWARNING(\"- Could not remove short names on %lu files or directories\"\n\t\t\t\"          (This is expected on Vista and earlier)\",\n\t\t\tctx->num_remove_short_name_failures);\n\t}\n#endif\n\tif (ctx->partial_security_descriptors) {\n\t\tWARNING(\"- Could only partially set the security descriptor\\n\"\n\t\t\t\"            on %lu files or directories.\",\n\t\t\tctx->partial_security_descriptors);\n\t}\n\tif (ctx->no_security_descriptors) {\n\t\tWARNING(\"- Could not set security descriptor at all\\n\"\n\t\t\t\"            on %lu files or directories.\",\n\t\t\tctx->no_security_descriptors);\n\t}\n\tif (ctx->partial_security_descriptors || ctx->no_security_descriptors) {\n\t\tWARNING(\"To fully restore all security descriptors, run the program\\n\"\n\t\t\t\"          with Administrator rights.\");\n\t}\n}\n\nstatic u64\ncount_dentries(const struct list_head *dentry_list)\n{\n\tconst struct list_head *cur;\n\tu64 count = 0;\n\n\tlist_for_each(cur, dentry_list)\n\t\tcount++;\n\n\treturn count;\n}\n\n/* Extract files from a WIM image to a directory on Windows  */\nstatic int\nwin32_extract(struct list_head *dentry_list, struct apply_ctx *_ctx)\n{\n\tint ret;\n\tstruct win32_apply_ctx *ctx = (struct win32_apply_ctx *)_ctx;\n\tu64 dentry_count;\n\n\tret = prepare_target(dentry_list, ctx);\n\tif (ret)\n\t\tgoto out;\n\n\tif (unlikely(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT)) {\n\t\tret = start_wimboot_extraction(dentry_list, ctx);\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\n\tctx->windows_build_number = xml_get_windows_build_number(ctx->common.wim->xml_info,\n\t\t\t\t\t\t\t\t ctx->common.wim->current_image);\n\n\tdentry_count = count_dentries(dentry_list);\n\n\tret = start_file_structure_phase(&ctx->common, dentry_count);\n\tif (ret)\n\t\tgoto out;\n\n\tret = create_directories(dentry_list, ctx);\n\tif (ret)\n\t\tgoto out;\n\n\tret = create_nondirectories(dentry_list, ctx);\n\tif (ret)\n\t\tgoto out;\n\n\tret = end_file_structure_phase(&ctx->common);\n\tif (ret)\n\t\tgoto out;\n\n\tstruct read_blob_callbacks cbs = {\n\t\t.begin_blob\t= win32_begin_extract_blob,\n\t\t.continue_blob\t= win32_extract_chunk,\n\t\t.end_blob\t= win32_end_extract_blob,\n\t\t.ctx\t\t= ctx,\n\t};\n\tret = extract_blob_list(&ctx->common, &cbs);\n\tif (ret)\n\t\tgoto out;\n\n\tret = start_file_metadata_phase(&ctx->common, dentry_count);\n\tif (ret)\n\t\tgoto out;\n\n\tret = apply_metadata(dentry_list, ctx);\n\tif (ret)\n\t\tgoto out;\n\n\tret = end_file_metadata_phase(&ctx->common);\n\tif (ret)\n\t\tgoto out;\n\n\tif (unlikely(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT)) {\n\t\tret = end_wimboot_extraction(ctx);\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\n\tdo_warnings(ctx);\nout:\n\tclose_target_directory(ctx);\n\tif (ctx->target_ntpath.Buffer)\n\t\tHeapFree(GetProcessHeap(), 0, ctx->target_ntpath.Buffer);\n\tFREE(ctx->pathbuf.Buffer);\n\tFREE(ctx->print_buffer);\n\tFREE(ctx->wimboot.wims);\n\tif (ctx->prepopulate_pats) {\n\t\tFREE(ctx->prepopulate_pats->strings);\n\t\tFREE(ctx->prepopulate_pats);\n\t}\n\tFREE(ctx->mem_prepopulate_pats);\n\tFREE(ctx->data_buffer);\n\treturn ret;\n}\n\nconst struct apply_operations win32_apply_ops = {\n\t.name\t\t\t= \"Windows\",\n\t.get_supported_features = win32_get_supported_features,\n\t.extract                = win32_extract,\n\t.will_back_from_wim     = win32_will_back_from_wim,\n\t.context_size           = sizeof(struct win32_apply_ctx),\n};\n\n#endif /* _WIN32 */\n"
  },
  {
    "path": "src/wimlib/win32_capture.c",
    "content": "/*\n * win32_capture.c - Windows-specific code for capturing files into a WIM image.\n *\n * This now uses the native Windows NT API a lot and not just Win32.\n */\n\n/*\n * Copyright (C) 2013-2021 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef _WIN32\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/win32_common.h\"\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/object_id.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/reparse.h\"\n#include \"wimlib/scan.h\"\n#include \"wimlib/win32_vss.h\"\n#include \"wimlib/wof.h\"\n#include \"wimlib/xattr.h\"\n\nstruct winnt_scan_ctx {\n\tstruct scan_params *params;\n\tbool is_ntfs;\n\tu32 vol_flags;\n\tunsigned long num_get_sd_access_denied;\n\tunsigned long num_get_sacl_priv_notheld;\n\n\t/* True if WOF is definitely not attached to the volume being scanned;\n\t * false if it may be  */\n\tbool wof_not_attached;\n\n\t/* A reference to the VSS snapshot being used, or NULL if none  */\n\tstruct vss_snapshot *snapshot;\n};\n\nstatic inline const wchar_t *\nprintable_path(const struct winnt_scan_ctx *ctx)\n{\n\t/* Skip over \\\\?\\ or \\??\\  */\n\treturn ctx->params->cur_path + 4;\n}\n\n/* Description of where data is located on a Windows filesystem  */\nstruct windows_file {\n\n\t/* Is the data the raw encrypted data of an EFS-encrypted file?  */\n\tu64 is_encrypted : 1;\n\n\t/* Is this file \"open by file ID\" rather than the regular \"open by\n\t * path\"?  \"Open by file ID\" uses resources more efficiently.  */\n\tu64 is_file_id : 1;\n\n\t/* The file's LCN (logical cluster number) for sorting, or 0 if unknown.\n\t */\n\tu64 sort_key : 62;\n\n\t/* Length of the path in bytes, excluding the null terminator if\n\t * present.  */\n\tsize_t path_nbytes;\n\n\t/* A reference to the VSS snapshot containing the file, or NULL if none.\n\t */\n\tstruct vss_snapshot *snapshot;\n\n\t/* The path to the file.  If 'is_encrypted=0' this is an NT namespace\n\t * path; if 'is_encrypted=1' this is a Win32 namespace path.  If\n\t * 'is_file_id=0', then the path is null-terminated.  If 'is_file_id=1'\n\t * (only allowed with 'is_encrypted=0') the path ends with a binary file\n\t * ID and may not be null-terminated.  */\n\twchar_t path[0];\n};\n\n/* Allocate a structure to describe the location of a data stream by path.  */\nstatic struct windows_file *\nalloc_windows_file(const wchar_t *path, size_t path_nchars,\n\t\t   const wchar_t *stream_name, size_t stream_name_nchars,\n\t\t   struct vss_snapshot *snapshot, bool is_encrypted)\n{\n\tsize_t full_path_nbytes;\n\tstruct windows_file *file;\n\twchar_t *p;\n\n\tfull_path_nbytes = path_nchars * sizeof(wchar_t);\n\tif (stream_name_nchars)\n\t\tfull_path_nbytes += (1 + stream_name_nchars) * sizeof(wchar_t);\n\n\tfile = MALLOC(sizeof(struct windows_file) + full_path_nbytes +\n\t\t      sizeof(wchar_t));\n\tif (!file)\n\t\treturn NULL;\n\n\tfile->is_encrypted = is_encrypted;\n\tfile->is_file_id = 0;\n\tfile->sort_key = 0;\n\tfile->path_nbytes = full_path_nbytes;\n\tfile->snapshot = vss_get_snapshot(snapshot);\n\tp = wmempcpy(file->path, path, path_nchars);\n\tif (stream_name_nchars) {\n\t\t/* Named data stream  */\n\t\t*p++ = L':';\n\t\tp = wmempcpy(p, stream_name, stream_name_nchars);\n\t}\n\t*p = L'\\0';\n\treturn file;\n}\n\n/* Allocate a structure to describe the location of a file by ID.  */\nstatic struct windows_file *\nalloc_windows_file_for_file_id(u64 file_id, const wchar_t *root_path,\n\t\t\t       size_t root_path_nchars,\n\t\t\t       struct vss_snapshot *snapshot)\n{\n\tsize_t full_path_nbytes;\n\tstruct windows_file *file;\n\twchar_t *p;\n\n\tfull_path_nbytes = (root_path_nchars * sizeof(wchar_t)) +\n\t\t\t   sizeof(file_id);\n\tfile = MALLOC(sizeof(struct windows_file) + full_path_nbytes +\n\t\t      sizeof(wchar_t));\n\tif (!file)\n\t\treturn NULL;\n\n\tfile->is_encrypted = 0;\n\tfile->is_file_id = 1;\n\tfile->sort_key = 0;\n\tfile->path_nbytes = full_path_nbytes;\n\tfile->snapshot = vss_get_snapshot(snapshot);\n\tp = wmempcpy(file->path, root_path, root_path_nchars);\n\tp = mempcpy(p, &file_id, sizeof(file_id));\n\t*p = L'\\0';\n\treturn file;\n}\n\n/* Add a stream, located on a Windows filesystem, to the specified WIM inode. */\nstatic int\nadd_stream(struct wim_inode *inode, struct windows_file *windows_file,\n\t   u64 stream_size, int stream_type, const utf16lechar *stream_name,\n\t   struct list_head *unhashed_blobs)\n{\n\tstruct blob_descriptor *blob = NULL;\n\tstruct wim_inode_stream *strm;\n\tint ret;\n\n\tif (!windows_file)\n\t\tgoto err_nomem;\n\n\t/* If the stream is nonempty, create a blob descriptor for it.  */\n\tif (stream_size) {\n\t\tblob = new_blob_descriptor();\n\t\tif (!blob)\n\t\t\tgoto err_nomem;\n\t\tblob->windows_file = windows_file;\n\t\tblob->blob_location = BLOB_IN_WINDOWS_FILE;\n\t\tblob->file_inode = inode;\n\t\tblob->size = stream_size;\n\t\twindows_file = NULL;\n\t}\n\n\tstrm = inode_add_stream(inode, stream_type, stream_name, blob);\n\tif (!strm)\n\t\tgoto err_nomem;\n\n\tprepare_unhashed_blob(blob, inode, strm->stream_id, unhashed_blobs);\n\tret = 0;\nout:\n\tif (windows_file)\n\t\tfree_windows_file(windows_file);\n\treturn ret;\n\nerr_nomem:\n\tfree_blob_descriptor(blob);\n\tret = WIMLIB_ERR_NOMEM;\n\tgoto out;\n}\n\nstruct windows_file *\nclone_windows_file(const struct windows_file *file)\n{\n\tstruct windows_file *new;\n\n\tnew = memdup(file, sizeof(*file) + file->path_nbytes + sizeof(wchar_t));\n\tif (new)\n\t\tvss_get_snapshot(new->snapshot);\n\treturn new;\n}\n\nvoid\nfree_windows_file(struct windows_file *file)\n{\n\tvss_put_snapshot(file->snapshot);\n\tFREE(file);\n}\n\nint\ncmp_windows_files(const struct windows_file *file1,\n\t\t  const struct windows_file *file2)\n{\n\t/* Compare by starting LCN (logical cluster number)  */\n\tint v = cmp_u64(file1->sort_key, file2->sort_key);\n\tif (v)\n\t\treturn v;\n\n\t/* Fall back to comparing files by path (arbitrary heuristic).  */\n\tv = memcmp(file1->path, file2->path,\n\t\t   min(file1->path_nbytes, file2->path_nbytes));\n\tif (v)\n\t\treturn v;\n\n\treturn cmp_u32(file1->path_nbytes, file2->path_nbytes);\n}\n\nconst wchar_t *\nget_windows_file_path(const struct windows_file *file)\n{\n\treturn file->path;\n}\n\n/*\n * Open the file named by the NT namespace path @path of length @path_nchars\n * characters.  If @cur_dir is not NULL then the path is given relative to\n * @cur_dir; otherwise the path is absolute.  @perms is the access mask of\n * permissions to request on the handle.  SYNCHRONIZE permision is always added.\n */\nstatic NTSTATUS\nwinnt_openat(HANDLE cur_dir, const wchar_t *path, size_t path_nchars,\n\t     ACCESS_MASK perms, HANDLE *h_ret)\n{\n\tUNICODE_STRING name = {\n\t\t.Length = path_nchars * sizeof(wchar_t),\n\t\t.MaximumLength = path_nchars * sizeof(wchar_t),\n\t\t.Buffer = (wchar_t *)path,\n\t};\n\tOBJECT_ATTRIBUTES attr = {\n\t\t.Length = sizeof(attr),\n\t\t.RootDirectory = cur_dir,\n\t\t.ObjectName = &name,\n\t};\n\tIO_STATUS_BLOCK iosb;\n\tNTSTATUS status;\n\tULONG options = FILE_OPEN_REPARSE_POINT | FILE_OPEN_FOR_BACKUP_INTENT;\n\n\tperms |= SYNCHRONIZE;\n\tif (perms & (FILE_READ_DATA | FILE_LIST_DIRECTORY)) {\n\t\toptions |= FILE_SYNCHRONOUS_IO_NONALERT;\n\t\toptions |= FILE_SEQUENTIAL_ONLY;\n\t}\nretry:\n\tstatus = NtOpenFile(h_ret, perms, &attr, &iosb,\n\t\t\t    FILE_SHARE_VALID_FLAGS, options);\n\tif (!NT_SUCCESS(status)) {\n\t\t/* Try requesting fewer permissions  */\n\t\tif (status == STATUS_ACCESS_DENIED ||\n\t\t    status == STATUS_PRIVILEGE_NOT_HELD) {\n\t\t\tif (perms & ACCESS_SYSTEM_SECURITY) {\n\t\t\t\tperms &= ~ACCESS_SYSTEM_SECURITY;\n\t\t\t\tgoto retry;\n\t\t\t}\n\t\t\tif (perms & READ_CONTROL) {\n\t\t\t\tperms &= ~READ_CONTROL;\n\t\t\t\tgoto retry;\n\t\t\t}\n\t\t}\n\t}\n\treturn status;\n}\n\nstatic NTSTATUS\nwinnt_open(const wchar_t *path, size_t path_nchars, ACCESS_MASK perms,\n\t   HANDLE *h_ret)\n{\n\treturn winnt_openat(NULL, path, path_nchars, perms, h_ret);\n}\n\nstatic const wchar_t *\nwindows_file_to_string(const struct windows_file *file, u8 *buf, size_t bufsize)\n{\n\tif (file->is_file_id) {\n\t\tu64 file_id;\n\t\tmemcpy(&file_id,\n\t\t       (u8 *)file->path + file->path_nbytes - sizeof(file_id),\n\t\t       sizeof(file_id));\n\t\tswprintf((wchar_t *)buf, bufsize, L\"NTFS inode 0x%016\"PRIx64, file_id);\n\t} else if (file->path_nbytes + 3 * sizeof(wchar_t) <= bufsize) {\n\t\tswprintf((wchar_t *)buf, bufsize, L\"\\\"%ls\\\"\", file->path);\n\t} else {\n\t\treturn L\"(name too long)\";\n\t}\n\treturn (wchar_t *)buf;\n}\n\nstatic int\nread_winnt_stream_prefix(const struct windows_file *file,\n\t\t\t u64 size, const struct consume_chunk_callback *cb)\n{\n\tIO_STATUS_BLOCK iosb;\n\tUNICODE_STRING name = {\n\t\t.Buffer = (wchar_t *)file->path,\n\t\t.Length = file->path_nbytes,\n\t\t.MaximumLength = file->path_nbytes,\n\t};\n\tOBJECT_ATTRIBUTES attr = {\n\t\t.Length = sizeof(attr),\n\t\t.ObjectName = &name,\n\t};\n\tHANDLE h;\n\tNTSTATUS status;\n\tPRAGMA_ALIGN(u8 buf[BUFFER_SIZE], 8);\n\tu64 bytes_remaining;\n\tint ret;\n\n\tstatus = NtOpenFile(&h, FILE_READ_DATA | SYNCHRONIZE,\n\t\t\t    &attr, &iosb,\n\t\t\t    FILE_SHARE_VALID_FLAGS,\n\t\t\t    FILE_OPEN_REPARSE_POINT |\n\t\t\t\tFILE_OPEN_FOR_BACKUP_INTENT |\n\t\t\t\tFILE_SYNCHRONOUS_IO_NONALERT |\n\t\t\t\tFILE_SEQUENTIAL_ONLY |\n\t\t\t\t(file->is_file_id ? FILE_OPEN_BY_FILE_ID : 0));\n\tif (unlikely(!NT_SUCCESS(status))) {\n\t\tif (status == STATUS_SHARING_VIOLATION) {\n\t\t\tERROR(\"Can't open %ls for reading:\\n\"\n\t\t\t      \"        File is in use by another process! \"\n\t\t\t      \"Consider using snapshot (VSS) mode.\",\n\t\t\t      windows_file_to_string(file, buf, sizeof(buf)));\n\t\t} else {\n\t\t\twinnt_error(status, L\"Can't open %ls for reading\",\n\t\t\t\t    windows_file_to_string(file, buf, sizeof(buf)));\n\t\t}\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\n\tret = 0;\n\tbytes_remaining = size;\n\twhile (bytes_remaining) {\n\t\tIO_STATUS_BLOCK iosb;\n\t\tULONG count;\n\t\tULONG bytes_read;\n\t\tconst unsigned max_tries = 5;\n\t\tunsigned tries_remaining = max_tries;\n\n\t\tcount = min(sizeof(buf), bytes_remaining);\n\n\tretry_read:\n\t\tstatus = NtReadFile(h, NULL, NULL, NULL,\n\t\t\t\t    &iosb, buf, count, NULL, NULL);\n\t\tif (unlikely(!NT_SUCCESS(status))) {\n\t\t\tif (status == STATUS_END_OF_FILE) {\n\t\t\t\tERROR(\"%ls: File was concurrently truncated\",\n\t\t\t\t      windows_file_to_string(file, buf, sizeof(buf)));\n\t\t\t\tret = WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED;\n\t\t\t} else {\n\t\t\t\twinnt_warning(status, L\"Error reading data from %ls\",\n\t\t\t\t\t      windows_file_to_string(file, buf, sizeof(buf)));\n\n\t\t\t\t/* Currently these retries are purely a guess;\n\t\t\t\t * there is no reproducible problem that they solve.  */\n\t\t\t\tif (--tries_remaining) {\n\t\t\t\t\tint delay = 100;\n\t\t\t\t\tif (status == STATUS_INSUFFICIENT_RESOURCES ||\n\t\t\t\t\t    status == STATUS_NO_MEMORY) {\n\t\t\t\t\t\tdelay *= 25;\n\t\t\t\t\t}\n\t\t\t\t\tWARNING(\"Retrying after %dms...\", delay);\n\t\t\t\t\tSleep(delay);\n\t\t\t\t\tgoto retry_read;\n\t\t\t\t}\n\t\t\t\tERROR(\"Too many retries; returning failure\");\n\t\t\t\tret = WIMLIB_ERR_READ;\n\t\t\t}\n\t\t\tbreak;\n\t\t} else if (unlikely(tries_remaining != max_tries)) {\n\t\t\tWARNING(\"A read request had to be retried multiple times \"\n\t\t\t\t\"before it succeeded!\");\n\t\t}\n\n\t\tbytes_read = iosb.Information;\n\n\t\tbytes_remaining -= bytes_read;\n\t\tret = consume_chunk(cb, buf, bytes_read);\n\t\tif (ret)\n\t\t\tbreak;\n\t}\n\tNtClose(h);\n\treturn ret;\n}\n\nstruct win32_encrypted_read_ctx {\n\tconst struct consume_chunk_callback *cb;\n\tint wimlib_err_code;\n\tu64 bytes_remaining;\n};\n\nstatic DWORD WINAPI\nwin32_encrypted_export_cb(unsigned char *data, void *_ctx, unsigned long len)\n{\n\tstruct win32_encrypted_read_ctx *ctx = _ctx;\n\tint ret;\n\tsize_t bytes_to_consume = min(len, ctx->bytes_remaining);\n\n\tif (bytes_to_consume == 0)\n\t\treturn ERROR_SUCCESS;\n\n\tret = consume_chunk(ctx->cb, data, bytes_to_consume);\n\tif (ret) {\n\t\tctx->wimlib_err_code = ret;\n\t\t/* It doesn't matter what error code is returned here, as long\n\t\t * as it isn't ERROR_SUCCESS.  */\n\t\treturn ERROR_READ_FAULT;\n\t}\n\tctx->bytes_remaining -= bytes_to_consume;\n\treturn ERROR_SUCCESS;\n}\n\nstatic int\nread_win32_encrypted_file_prefix(const wchar_t *path, bool is_dir, u64 size,\n\t\t\t\t const struct consume_chunk_callback *cb)\n{\n\tstruct win32_encrypted_read_ctx export_ctx;\n\tDWORD err;\n\tvoid *file_ctx;\n\tint ret;\n\tDWORD flags = 0;\n\n\tif (is_dir)\n\t\tflags |= CREATE_FOR_DIR;\n\n\texport_ctx.cb = cb;\n\texport_ctx.wimlib_err_code = 0;\n\texport_ctx.bytes_remaining = size;\n\n\terr = OpenEncryptedFileRaw(path, flags, &file_ctx);\n\tif (err != ERROR_SUCCESS) {\n\t\twin32_error(err,\n\t\t\t    L\"Failed to open encrypted file \\\"%ls\\\" for raw read\",\n\t\t\t    path);\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\terr = ReadEncryptedFileRaw(win32_encrypted_export_cb,\n\t\t\t\t   &export_ctx, file_ctx);\n\tif (err != ERROR_SUCCESS) {\n\t\tret = export_ctx.wimlib_err_code;\n\t\tif (ret == 0) {\n\t\t\twin32_error(err,\n\t\t\t\t    L\"Failed to read encrypted file \\\"%ls\\\"\",\n\t\t\t\t    path);\n\t\t\tret = WIMLIB_ERR_READ;\n\t\t}\n\t} else if (export_ctx.bytes_remaining != 0) {\n\t\tERROR(\"Only could read %\"PRIu64\" of %\"PRIu64\" bytes from \"\n\t\t      \"encrypted file \\\"%ls\\\"\",\n\t\t      size - export_ctx.bytes_remaining, size,\n\t\t      path);\n\t\tret = WIMLIB_ERR_READ;\n\t} else {\n\t\tret = 0;\n\t}\n\tCloseEncryptedFileRaw(file_ctx);\n\treturn ret;\n}\n\n/* Read the first @size bytes from the file, or named data stream of a file,\n * described by @blob.  */\nint\nread_windows_file_prefix(const struct blob_descriptor *blob, u64 size,\n\t\t\t const struct consume_chunk_callback *cb,\n\t\t\t bool recover_data)\n{\n\tconst struct windows_file *file = blob->windows_file;\n\n\tif (unlikely(file->is_encrypted)) {\n\t\tbool is_dir = (blob->file_inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY);\n\t\treturn read_win32_encrypted_file_prefix(file->path, is_dir, size, cb);\n\t}\n\n\treturn read_winnt_stream_prefix(file, size, cb);\n}\n\n/*\n * Load the short name of a file into a WIM dentry.\n */\nstatic noinline_for_stack NTSTATUS\nwinnt_get_short_name(HANDLE h, struct wim_dentry *dentry)\n{\n\t/* It's not any harder to just make the NtQueryInformationFile() system\n\t * call ourselves, and it saves a dumb call to FindFirstFile() which of\n\t * course has to create its own handle.  */\n\tNTSTATUS status;\n\tIO_STATUS_BLOCK iosb;\n\tPRAGMA_ALIGN(u8 buf[128], 8);\n\tconst FILE_NAME_INFORMATION *info;\n\n\tstatus = NtQueryInformationFile(h, &iosb, buf, sizeof(buf),\n\t\t\t\t\tFileAlternateNameInformation);\n\tinfo = (const FILE_NAME_INFORMATION *)buf;\n\tif (NT_SUCCESS(status) && info->FileNameLength != 0) {\n\t\tdentry->d_short_name = utf16le_dupz(info->FileName,\n\t\t\t\t\t\t    info->FileNameLength);\n\t\tif (!dentry->d_short_name)\n\t\t\treturn STATUS_NO_MEMORY;\n\t\tdentry->d_short_name_nbytes = info->FileNameLength;\n\t}\n\treturn status;\n}\n\n/*\n * Load the security descriptor of a file into the corresponding inode and the\n * WIM image's security descriptor set.\n */\nstatic noinline_for_stack int\nwinnt_load_security_descriptor(HANDLE h, struct wim_inode *inode,\n\t\t\t       struct winnt_scan_ctx *ctx)\n{\n\tSECURITY_INFORMATION requestedInformation;\n\tPRAGMA_ALIGN(u8 _buf[4096], 8);\n\tu8 *buf;\n\tULONG bufsize;\n\tULONG len_needed;\n\tNTSTATUS status;\n\n\t/*\n\t * LABEL_SECURITY_INFORMATION is needed on Windows Vista and 7 because\n\t * Microsoft decided to add mandatory integrity labels to the SACL but\n\t * not have them returned by SACL_SECURITY_INFORMATION.\n\t *\n\t * BACKUP_SECURITY_INFORMATION is needed on Windows 8 because Microsoft\n\t * decided to add even more stuff to the SACL and still not have it\n\t * returned by SACL_SECURITY_INFORMATION; but they did remember that\n\t * backup applications exist and simply want to read the stupid thing\n\t * once and for all, so they added a flag to read the entire security\n\t * descriptor.\n\t *\n\t * Older versions of Windows tolerate these new flags being passed in.\n\t */\n\trequestedInformation = OWNER_SECURITY_INFORMATION |\n\t\t\t       GROUP_SECURITY_INFORMATION |\n\t\t\t       DACL_SECURITY_INFORMATION |\n\t\t\t       SACL_SECURITY_INFORMATION |\n\t\t\t       LABEL_SECURITY_INFORMATION |\n\t\t\t       BACKUP_SECURITY_INFORMATION;\n\n\tbuf = _buf;\n\tbufsize = sizeof(_buf);\n\n\t/*\n\t * We need the file's security descriptor in\n\t * SECURITY_DESCRIPTOR_RELATIVE format, and we currently have a handle\n\t * opened with as many relevant permissions as possible.  At this point,\n\t * on Windows there are a number of options for reading a file's\n\t * security descriptor:\n\t *\n\t * GetFileSecurity():  This takes in a path and returns the\n\t * SECURITY_DESCRIPTOR_RELATIVE.  Problem: this uses an internal handle,\n\t * not ours, and the handle created internally doesn't specify\n\t * FILE_FLAG_BACKUP_SEMANTICS.  Therefore there can be access denied\n\t * errors on some files and directories, even when running as the\n\t * Administrator.\n\t *\n\t * GetSecurityInfo():  This takes in a handle and returns the security\n\t * descriptor split into a bunch of different parts.  This should work,\n\t * but it's dumb because we have to put the security descriptor back\n\t * together again.\n\t *\n\t * BackupRead():  This can read the security descriptor, but this is a\n\t * difficult-to-use API, probably only works as the Administrator, and\n\t * the format of the returned data is not well documented.\n\t *\n\t * NtQuerySecurityObject():  This is exactly what we need, as it takes\n\t * in a handle and returns the security descriptor in\n\t * SECURITY_DESCRIPTOR_RELATIVE format.  Only problem is that it's a\n\t * ntdll function and therefore not officially part of the Win32 API.\n\t * Oh well.\n\t */\n\twhile (!NT_SUCCESS(status = NtQuerySecurityObject(h,\n\t\t\t\t\t\t\t  requestedInformation,\n\t\t\t\t\t\t\t  (PSECURITY_DESCRIPTOR)buf,\n\t\t\t\t\t\t\t  bufsize,\n\t\t\t\t\t\t\t  &len_needed)))\n\t{\n\t\tswitch (status) {\n\t\tcase STATUS_BUFFER_TOO_SMALL:\n\t\t\twimlib_assert(buf == _buf);\n\t\t\tbuf = MALLOC(len_needed);\n\t\t\tif (!buf) {\n\t\t\t\tstatus = STATUS_NO_MEMORY;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tbufsize = len_needed;\n\t\t\tbreak;\n\t\tcase STATUS_PRIVILEGE_NOT_HELD:\n\t\tcase STATUS_ACCESS_DENIED:\n\t\t\tif (ctx->params->add_flags & WIMLIB_ADD_FLAG_STRICT_ACLS) {\n\t\tdefault:\n\t\t\t\t/* Permission denied in STRICT_ACLS mode, or\n\t\t\t\t * unknown error.  */\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tif (requestedInformation & SACL_SECURITY_INFORMATION) {\n\t\t\t\t/* Try again without the SACL.  */\n\t\t\t\tctx->num_get_sacl_priv_notheld++;\n\t\t\t\trequestedInformation &= ~(SACL_SECURITY_INFORMATION |\n\t\t\t\t\t\t\t  LABEL_SECURITY_INFORMATION |\n\t\t\t\t\t\t\t  BACKUP_SECURITY_INFORMATION);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/* Fake success (useful when capturing as\n\t\t\t * non-Administrator).  */\n\t\t\tctx->num_get_sd_access_denied++;\n\t\t\tstatus = STATUS_SUCCESS;\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\t/* We can get a length of 0 with Samba.  Assume that means \"no security\n\t * descriptor\".  */\n\tif (len_needed == 0)\n\t\tgoto out;\n\n\t/* Add the security descriptor to the WIM image, and save its ID in\n\t * the file's inode.  */\n\tinode->i_security_id = sd_set_add_sd(ctx->params->sd_set, buf, len_needed);\n\tif (unlikely(inode->i_security_id < 0))\n\t\tstatus = STATUS_NO_MEMORY;\nout:\n\tif (unlikely(buf != _buf))\n\t\tFREE(buf);\n\tif (!NT_SUCCESS(status)) {\n\t\twinnt_error(status, L\"\\\"%ls\\\": Can't read security descriptor\",\n\t\t\t    printable_path(ctx));\n\t\treturn WIMLIB_ERR_STAT;\n\t}\n\treturn 0;\n}\n\n/* Load a file's object ID into the corresponding WIM inode.  */\nstatic noinline_for_stack int\nwinnt_load_object_id(HANDLE h, struct wim_inode *inode,\n\t\t     struct winnt_scan_ctx *ctx)\n{\n\tFILE_OBJECTID_BUFFER buffer;\n\tNTSTATUS status;\n\tu32 len;\n\n\tif (!(ctx->vol_flags & FILE_SUPPORTS_OBJECT_IDS))\n\t\treturn 0;\n\n\tstatus = winnt_fsctl(h, FSCTL_GET_OBJECT_ID, NULL, 0,\n\t\t\t     &buffer, sizeof(buffer), &len);\n\n\tif (status == STATUS_OBJECTID_NOT_FOUND) /* No object ID  */\n\t\treturn 0;\n\n\tif (status == STATUS_INVALID_DEVICE_REQUEST ||\n\t    status == STATUS_NOT_SUPPORTED /* Samba volume, WinXP */) {\n\t\t/* The filesystem claimed to support object IDs, but we can't\n\t\t * actually read them.  This happens with Samba.  */\n\t\tctx->vol_flags &= ~FILE_SUPPORTS_OBJECT_IDS;\n\t\treturn 0;\n\t}\n\n\tif (!NT_SUCCESS(status)) {\n\t\twinnt_error(status, L\"\\\"%ls\\\": Can't read object ID\",\n\t\t\t    printable_path(ctx));\n\t\treturn WIMLIB_ERR_STAT;\n\t}\n\n\tif (len == 0) /* No object ID (for directories)  */\n\t\treturn 0;\n\n\tif (!inode_set_object_id(inode, &buffer, len))\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\treturn 0;\n}\n\n/* Load a file's extended attributes into the corresponding WIM inode.  */\nstatic noinline_for_stack int\nwinnt_load_xattrs(HANDLE h, struct wim_inode *inode,\n\t\t  struct winnt_scan_ctx *ctx, u32 ea_size)\n{\n\tIO_STATUS_BLOCK iosb;\n\tNTSTATUS status;\n\tPRAGMA_ALIGN(u8 _buf[1024], 4);\n\tu8 *buf = _buf;\n\tconst FILE_FULL_EA_INFORMATION *ea;\n\tstruct wim_xattr_entry *entry;\n\tint ret;\n\n\n\t/*\n\t * EaSize from FILE_EA_INFORMATION is apparently supposed to give the\n\t * size of the buffer required for NtQueryEaFile(), but it doesn't\n\t * actually work correctly; it can be off by about 4 bytes per xattr.\n\t *\n\t * So just start out by doubling the advertised size, and also handle\n\t * STATUS_BUFFER_OVERFLOW just in case.\n\t */\nretry:\n\tif (unlikely(ea_size * 2 < ea_size))\n\t\tea_size = UINT32_MAX;\n\telse\n\t\tea_size *= 2;\n\tif (unlikely(ea_size > sizeof(_buf))) {\n\t\tbuf = MALLOC(ea_size);\n\t\tif (!buf) {\n\t\t\tif (ea_size >= (1 << 20)) {\n\t\t\t\tWARNING(\"\\\"%ls\\\": EaSize was extremely large (%u)\",\n\t\t\t\t\tprintable_path(ctx), ea_size);\n\t\t\t}\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\t}\n\t}\n\n\tstatus = NtQueryEaFile(h, &iosb, buf, ea_size,\n\t\t\t       FALSE, NULL, 0, NULL, TRUE);\n\n\tif (unlikely(!NT_SUCCESS(status))) {\n\t\tif (status == STATUS_BUFFER_OVERFLOW) {\n\t\t\tif (buf != _buf) {\n\t\t\t\tFREE(buf);\n\t\t\t\tbuf = NULL;\n\t\t\t}\n\t\t\tgoto retry;\n\t\t}\n\t\tif (status == STATUS_NO_EAS_ON_FILE) {\n\t\t\t/*\n\t\t\t * FILE_EA_INFORMATION.EaSize was nonzero so this\n\t\t\t * shouldn't happen, but just in case...\n\t\t\t */\n\t\t\tret = 0;\n\t\t\tgoto out;\n\t\t}\n\t\twinnt_error(status, L\"\\\"%ls\\\": Can't read extended attributes\",\n\t\t\t    printable_path(ctx));\n\t\tret = WIMLIB_ERR_STAT;\n\t\tgoto out;\n\t}\n\n\tea = (const FILE_FULL_EA_INFORMATION *)buf;\n\tentry = (struct wim_xattr_entry *)buf;\n\tfor (;;) {\n\t\t/*\n\t\t * wim_xattr_entry is not larger than FILE_FULL_EA_INFORMATION,\n\t\t * so we can reuse the same buffer by overwriting the\n\t\t * FILE_FULL_EA_INFORMATION with the wim_xattr_entry in-place.\n\t\t */\n\t\tFILE_FULL_EA_INFORMATION _ea;\n\n\t\tSTATIC_ASSERT(offsetof(struct wim_xattr_entry, name) <=\n\t\t\t      offsetof(FILE_FULL_EA_INFORMATION, EaName));\n\t\twimlib_assert((u8 *)entry <= (const u8 *)ea);\n\n\t\tmemcpy(&_ea, ea, sizeof(_ea));\n\n\t\tentry->value_len = cpu_to_le16(_ea.EaValueLength);\n\t\tentry->name_len = _ea.EaNameLength;\n\t\tentry->flags = _ea.Flags;\n\t\tmemmove(entry->name, ea->EaName, _ea.EaNameLength);\n\t\tentry->name[_ea.EaNameLength] = '\\0';\n\t\tmemmove(&entry->name[_ea.EaNameLength + 1],\n\t\t\t&ea->EaName[_ea.EaNameLength + 1], _ea.EaValueLength);\n\t\tentry = (struct wim_xattr_entry *)\n\t\t\t &entry->name[_ea.EaNameLength + 1 + _ea.EaValueLength];\n\t\tif (_ea.NextEntryOffset == 0)\n\t\t\tbreak;\n\t\tea = (const FILE_FULL_EA_INFORMATION *)\n\t\t\t((const u8 *)ea + _ea.NextEntryOffset);\n\t}\n\twimlib_assert((u8 *)entry - buf <= ea_size);\n\n\tret = WIMLIB_ERR_NOMEM;\n\tif (!inode_set_xattrs(inode, buf, (u8 *)entry - buf))\n\t\tgoto out;\n\tret = 0;\nout:\n\tif (unlikely(buf != _buf))\n\t\tFREE(buf);\n\treturn ret;\n}\n\nstatic int\nwinnt_build_dentry_tree(struct wim_dentry **root_ret,\n\t\t\tHANDLE cur_dir,\n\t\t\tconst wchar_t *relative_path,\n\t\t\tsize_t relative_path_nchars,\n\t\t\tconst wchar_t *filename,\n\t\t\tstruct winnt_scan_ctx *ctx,\n\t\t\tbool recursive);\n\nstatic int\nwinnt_recurse_directory(HANDLE h,\n\t\t\tstruct wim_dentry *parent,\n\t\t\tstruct winnt_scan_ctx *ctx)\n{\n\tvoid *buf;\n\tconst size_t bufsize = 8192;\n\tIO_STATUS_BLOCK iosb;\n\tNTSTATUS status;\n\tint ret = WIMLIB_ERR_SUCCESS;\n\n\tbuf = MALLOC(bufsize);\n\tif (!buf)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\t/* Using NtQueryDirectoryFile() we can re-use the same open handle,\n\t * which we opened with FILE_FLAG_BACKUP_SEMANTICS.  */\n\n\twhile (NT_SUCCESS(status = NtQueryDirectoryFile(h, NULL, NULL, NULL,\n\t\t\t\t\t\t\t&iosb, buf, bufsize,\n\t\t\t\t\t\t\tFileNamesInformation,\n\t\t\t\t\t\t\tFALSE, NULL, FALSE)))\n\t{\n\t\tconst FILE_NAMES_INFORMATION *info = buf;\n\t\tfor (;;) {\n\t\t\tif (!should_ignore_filename(info->FileName,\n\t\t\t\t\t\t    info->FileNameLength / 2))\n\t\t\t{\n\t\t\t\tstruct wim_dentry *child;\n\t\t\t\tsize_t orig_path_nchars;\n\t\t\t\tconst wchar_t *filename;\n\n\t\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\t\tfilename = pathbuf_append_name(ctx->params,\n\t\t\t\t\t\t\t       info->FileName,\n\t\t\t\t\t\t\t       info->FileNameLength / 2,\n\t\t\t\t\t\t\t       &orig_path_nchars);\n\t\t\t\tif (!filename)\n\t\t\t\t\tgoto out_free_buf;\n\n\t\t\t\tret = winnt_build_dentry_tree(\n\t\t\t\t\t\t\t&child,\n\t\t\t\t\t\t\th,\n\t\t\t\t\t\t\tfilename,\n\t\t\t\t\t\t\tinfo->FileNameLength / 2,\n\t\t\t\t\t\t\tfilename,\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\ttrue);\n\n\t\t\t\tpathbuf_truncate(ctx->params, orig_path_nchars);\n\n\t\t\t\tif (ret)\n\t\t\t\t\tgoto out_free_buf;\n\t\t\t\tattach_scanned_tree(parent, child,\n\t\t\t\t\t\t    ctx->params->blob_table);\n\t\t\t}\n\t\t\tif (info->NextEntryOffset == 0)\n\t\t\t\tbreak;\n\t\t\tinfo = (const FILE_NAMES_INFORMATION *)\n\t\t\t\t\t((const u8 *)info + info->NextEntryOffset);\n\t\t}\n\t}\n\n\tif (unlikely(status != STATUS_NO_MORE_FILES)) {\n\t\twinnt_error(status, L\"\\\"%ls\\\": Can't read directory\",\n\t\t\t    printable_path(ctx));\n\t\tret = WIMLIB_ERR_READ;\n\t}\nout_free_buf:\n\tFREE(buf);\n\treturn ret;\n}\n\n/* Reparse point fixup status code  */\n#define RP_FIXED\t(-1)\n\nstatic bool\nfile_has_ino_and_dev(HANDLE h, u64 ino, u64 dev)\n{\n\tNTSTATUS status;\n\tIO_STATUS_BLOCK iosb;\n\tFILE_INTERNAL_INFORMATION int_info;\n\tFILE_FS_VOLUME_INFORMATION vol_info = { 0 };\n\n\tstatus = NtQueryInformationFile(h, &iosb, &int_info, sizeof(int_info),\n\t\t\t\t\tFileInternalInformation);\n\tif (!NT_SUCCESS(status))\n\t\treturn false;\n\n\tif (int_info.IndexNumber.QuadPart != ino)\n\t\treturn false;\n\n\tstatus = NtQueryVolumeInformationFile(h, &iosb,\n\t\t\t\t\t      &vol_info, sizeof(vol_info),\n\t\t\t\t\t      FileFsVolumeInformation);\n\tif (!(NT_SUCCESS(status) || status == STATUS_BUFFER_OVERFLOW))\n\t\treturn false;\n\n\tif (iosb.Information <\n\t     offsetof(FILE_FS_VOLUME_INFORMATION, VolumeSerialNumber) +\n\t     sizeof(vol_info.VolumeSerialNumber))\n\t\treturn false;\n\n\treturn (vol_info.VolumeSerialNumber == dev);\n}\n\n/*\n * This is the Windows equivalent of unix_relativize_link_target(); see there\n * for general details.  This version works with an \"absolute\" Windows link\n * target, specified from the root of the Windows kernel object namespace.  Note\n * that we have to open directories with a trailing slash when present because\n * \\??\\E: opens the E: device itself and not the filesystem root directory.\n */\nstatic const wchar_t *\nwinnt_relativize_link_target(const wchar_t *target, size_t target_nbytes,\n\t\t\t     u64 ino, u64 dev)\n{\n\tUNICODE_STRING name;\n\tOBJECT_ATTRIBUTES attr;\n\tIO_STATUS_BLOCK iosb;\n\tNTSTATUS status;\n\tconst wchar_t *target_end;\n\tconst wchar_t *p;\n\n\ttarget_end = target + (target_nbytes / sizeof(wchar_t));\n\n\t/* Empty path??? */\n\tif (target_end == target)\n\t\treturn target;\n\n\t/* No leading slash???  */\n\tif (target[0] != L'\\\\')\n\t\treturn target;\n\n\t/* UNC path???  */\n\tif ((target_end - target) >= 2 &&\n\t    target[0] == L'\\\\' && target[1] == L'\\\\')\n\t\treturn target;\n\n\tattr.Length = sizeof(attr);\n\tattr.RootDirectory = NULL;\n\tattr.ObjectName = &name;\n\tattr.Attributes = 0;\n\tattr.SecurityDescriptor = NULL;\n\tattr.SecurityQualityOfService = NULL;\n\n\tname.Buffer = (wchar_t *)target;\n\tname.Length = 0;\n\tp = target;\n\tdo {\n\t\tHANDLE h;\n\t\tconst wchar_t *orig_p = p;\n\n\t\t/* Skip non-backslashes  */\n\t\twhile (p != target_end && *p != L'\\\\')\n\t\t\tp++;\n\n\t\t/* Skip backslashes  */\n\t\twhile (p != target_end && *p == L'\\\\')\n\t\t\tp++;\n\n\t\t/* Append path component  */\n\t\tname.Length += (p - orig_p) * sizeof(wchar_t);\n\t\tname.MaximumLength = name.Length;\n\n\t\t/* Try opening the file  */\n\t\tstatus = NtOpenFile(&h,\n\t\t\t\t    FILE_READ_ATTRIBUTES | FILE_TRAVERSE,\n\t\t\t\t    &attr,\n\t\t\t\t    &iosb,\n\t\t\t\t    FILE_SHARE_VALID_FLAGS,\n\t\t\t\t    FILE_OPEN_FOR_BACKUP_INTENT);\n\n\t\tif (NT_SUCCESS(status)) {\n\t\t\t/* Reset root directory  */\n\t\t\tif (attr.RootDirectory)\n\t\t\t\tNtClose(attr.RootDirectory);\n\t\t\tattr.RootDirectory = h;\n\t\t\tname.Buffer = (wchar_t *)p;\n\t\t\tname.Length = 0;\n\n\t\t\tif (file_has_ino_and_dev(h, ino, dev))\n\t\t\t\tgoto out_close_root_dir;\n\t\t}\n\t} while (p != target_end);\n\n\tp = target;\n\nout_close_root_dir:\n\tif (attr.RootDirectory)\n\t\tNtClose(attr.RootDirectory);\n\twhile (p > target && *(p - 1) == L'\\\\')\n\t\tp--;\n\treturn p;\n}\n\nstatic int\nwinnt_rpfix_progress(struct scan_params *params,\n\t\t     const struct link_reparse_point *link, int scan_status)\n{\n\tsize_t print_name_nchars = link->print_name_nbytes / sizeof(wchar_t);\n\twchar_t* print_name0 = alloca((print_name_nchars + 1) * sizeof(wchar_t));\n\n\twmemcpy(print_name0, link->print_name, print_name_nchars);\n\tprint_name0[print_name_nchars] = L'\\0';\n\n\tparams->progress.scan.symlink_target = print_name0;\n\treturn do_scan_progress(params, scan_status, NULL);\n}\n\nstatic int\nwinnt_try_rpfix(struct reparse_buffer_disk *rpbuf, u16 *rpbuflen_p,\n\t\tstruct scan_params *params)\n{\n\tstruct link_reparse_point link;\n\tconst wchar_t *rel_target;\n\tint ret;\n\n\tif (parse_link_reparse_point(rpbuf, *rpbuflen_p, &link)) {\n\t\t/* Couldn't understand the reparse data; don't do the fixup.  */\n\t\treturn 0;\n\t}\n\n\t/*\n\t * Don't do reparse point fixups on relative symbolic links.\n\t *\n\t * On Windows, a relative symbolic link is supposed to be identifiable\n\t * by having reparse tag WIM_IO_REPARSE_TAG_SYMLINK and flags\n\t * SYMBOLIC_LINK_RELATIVE.  We will use this information, although this\n\t * may not always do what the user expects, since drive-relative\n\t * symbolic links such as \"\\Users\\Public\" have SYMBOLIC_LINK_RELATIVE\n\t * set, in addition to truly relative symbolic links such as \"Users\" or\n\t * \"Users\\Public\".  However, WIMGAPI (as of Windows 8.1) has this same\n\t * behavior.\n\t *\n\t * Otherwise, as far as I can tell, the targets of symbolic links that\n\t * are NOT relative, as well as junctions (note: a mountpoint is the\n\t * sames thing as a junction), must be NT namespace paths, for example:\n\t *\n\t *     - \\??\\e:\\Users\\Public\n\t *     - \\DosDevices\\e:\\Users\\Public\n\t *     - \\Device\\HardDiskVolume4\\Users\\Public\n\t *     - \\??\\Volume{c47cb07c-946e-4155-b8f7-052e9cec7628}\\Users\\Public\n\t *     - \\DosDevices\\Volume{c47cb07c-946e-4155-b8f7-052e9cec7628}\\Users\\Public\n\t */\n\tif (link_is_relative_symlink(&link))\n\t\treturn 0;\n\n\trel_target = winnt_relativize_link_target(link.substitute_name,\n\t\t\t\t\t\t  link.substitute_name_nbytes,\n\t\t\t\t\t\t  params->capture_root_ino,\n\t\t\t\t\t\t  params->capture_root_dev);\n\n\tif (rel_target == link.substitute_name) {\n\t\t/* Target points outside of the tree being captured or had an\n\t\t * unrecognized path format.  Don't adjust it.  */\n\t\treturn winnt_rpfix_progress(params, &link,\n\t\t\t\t\t    WIMLIB_SCAN_DENTRY_NOT_FIXED_SYMLINK);\n\t}\n\n\t/* We have an absolute target pointing within the directory being\n\t * captured. @rel_target is the suffix of the link target that is the\n\t * part relative to the directory being captured.\n\t *\n\t * We will cut off the prefix before this part (which is the path to the\n\t * directory being captured) and add a dummy prefix.  Since the process\n\t * will need to be reversed when applying the image, it doesn't matter\n\t * what exactly the prefix is, as long as it looks like an absolute\n\t * path.  */\n\n\tstatic const wchar_t prefix[] = L\"\\\\??\\\\X:\";\n\tstatic const size_t num_unprintable_chars = 4;\n\n\tsize_t rel_target_nbytes =\n\t\tlink.substitute_name_nbytes - ((const u8 *)rel_target -\n\t\t\t\t\t       (const u8 *)link.substitute_name);\n\n\twchar_t* tmp = alloca(sizeof(prefix) + rel_target_nbytes);\n\tif (!tmp)\n\t\treturn 0;\n\n\tmemcpy(tmp, prefix, sizeof(prefix));\n\tmemcpy(tmp + ARRAY_LEN(prefix), rel_target, rel_target_nbytes);\n\n\tlink.substitute_name = tmp;\n\tlink.substitute_name_nbytes = sizeof(tmp);\n\n\tlink.print_name = link.substitute_name + num_unprintable_chars;\n\tlink.print_name_nbytes = link.substitute_name_nbytes -\n\t\t\t\t (num_unprintable_chars * sizeof(wchar_t));\n\n\tif (make_link_reparse_point(&link, rpbuf, rpbuflen_p))\n\t\treturn 0;\n\n\tret = winnt_rpfix_progress(params, &link,\n\t\t\t\t   WIMLIB_SCAN_DENTRY_FIXED_SYMLINK);\n\tif (ret)\n\t\treturn ret;\n\treturn RP_FIXED;\n}\n\n/* Load the reparse data of a file into the corresponding WIM inode.  If the\n * reparse point is a symbolic link or junction with an absolute target and\n * RPFIX mode is enabled, then also rewrite its target to be relative to the\n * capture root.  */\nstatic noinline_for_stack int\nwinnt_load_reparse_data(HANDLE h, struct wim_inode *inode,\n\t\t\tstruct winnt_scan_ctx *ctx)\n{\n\tstruct reparse_buffer_disk rpbuf;\n\tNTSTATUS status;\n\tu32 len;\n\tu16 rpbuflen;\n\tint ret;\n\n\tif (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) {\n\t\t/* See comment above assign_stream_types_encrypted()  */\n\t\tWARNING(\"Ignoring reparse data of encrypted file \\\"%ls\\\"\",\n\t\t\tprintable_path(ctx));\n\t\treturn 0;\n\t}\n\n\tstatus = winnt_fsctl(h, FSCTL_GET_REPARSE_POINT,\n\t\t\t     NULL, 0, &rpbuf, sizeof(rpbuf), &len);\n\tif (!NT_SUCCESS(status)) {\n\t\twinnt_error(status, L\"\\\"%ls\\\": Can't get reparse point\",\n\t\t\t    printable_path(ctx));\n\t\treturn WIMLIB_ERR_READLINK;\n\t}\n\n\trpbuflen = len;\n\n\tif (unlikely(rpbuflen < REPARSE_DATA_OFFSET)) {\n\t\tERROR(\"\\\"%ls\\\": reparse point buffer is too short\",\n\t\t      printable_path(ctx));\n\t\treturn WIMLIB_ERR_INVALID_REPARSE_DATA;\n\t}\n\n\tif (le32_to_cpu(rpbuf.rptag) == WIM_IO_REPARSE_TAG_DEDUP) {\n\t\t/*\n\t\t * Windows treats Data Deduplication reparse points specially.\n\t\t * Reads from the unnamed data stream actually return the\n\t\t * redirected file contents, even with FILE_OPEN_REPARSE_POINT.\n\t\t * Deduplicated files also cannot be properly restored without\n\t\t * also restoring the \"System Volume Information\" directory,\n\t\t * which wimlib excludes by default.  Therefore, the logical\n\t\t * behavior for us seems to be to ignore the reparse point and\n\t\t * treat the file as a normal file.\n\t\t */\n\t\tinode->i_attributes &= ~FILE_ATTRIBUTE_REPARSE_POINT;\n\t\treturn 0;\n\t}\n\n\tif (ctx->params->add_flags & WIMLIB_ADD_FLAG_RPFIX) {\n\t\tret = winnt_try_rpfix(&rpbuf, &rpbuflen, ctx->params);\n\t\tif (ret == RP_FIXED)\n\t\t\tinode->i_rp_flags &= ~WIM_RP_FLAG_NOT_FIXED;\n\t\telse if (ret)\n\t\t\treturn ret;\n\t}\n\n\tinode->i_reparse_tag = le32_to_cpu(rpbuf.rptag);\n\tinode->i_rp_reserved = le16_to_cpu(rpbuf.rpreserved);\n\n\tif (!inode_add_stream_with_data(inode,\n\t\t\t\t\tSTREAM_TYPE_REPARSE_POINT,\n\t\t\t\t\tNO_STREAM_NAME,\n\t\t\t\t\trpbuf.rpdata,\n\t\t\t\t\trpbuflen - REPARSE_DATA_OFFSET,\n\t\t\t\t\tctx->params->blob_table))\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\treturn 0;\n}\n\nstatic DWORD WINAPI\nwin32_tally_encrypted_size_cb(unsigned char *_data, void *_size_ret,\n\t\t\t      unsigned long len)\n{\n\t*(u64*)_size_ret += len;\n\treturn ERROR_SUCCESS;\n}\n\nstatic int\nwin32_get_encrypted_file_size(const wchar_t *path, bool is_dir, u64 *size_ret)\n{\n\tDWORD err;\n\tvoid *file_ctx;\n\tint ret;\n\tDWORD flags = 0;\n\n\tif (is_dir)\n\t\tflags |= CREATE_FOR_DIR;\n\n\terr = OpenEncryptedFileRaw(path, flags, &file_ctx);\n\tif (err != ERROR_SUCCESS) {\n\t\twin32_error(err,\n\t\t\t    L\"Failed to open encrypted file \\\"%ls\\\" for raw read\",\n\t\t\t    path);\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\t*size_ret = 0;\n\terr = ReadEncryptedFileRaw(win32_tally_encrypted_size_cb,\n\t\t\t\t   size_ret, file_ctx);\n\tif (err != ERROR_SUCCESS) {\n\t\twin32_error(err,\n\t\t\t    L\"Failed to read raw encrypted data from \\\"%ls\\\"\",\n\t\t\t    path);\n\t\tret = WIMLIB_ERR_READ;\n\t} else {\n\t\tret = 0;\n\t}\n\tCloseEncryptedFileRaw(file_ctx);\n\treturn ret;\n}\n\nstatic int\nwinnt_scan_efsrpc_raw_data(struct wim_inode *inode,\n\t\t\t   struct winnt_scan_ctx *ctx)\n{\n\twchar_t *path = ctx->params->cur_path;\n\tsize_t path_nchars = ctx->params->cur_path_nchars;\n\tconst bool is_dir = (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY);\n\tstruct windows_file *windows_file;\n\tu64 size;\n\tint ret;\n\n\t/* OpenEncryptedFileRaw() expects a Win32 name.  */\n\twimlib_assert(!wmemcmp(path, L\"\\\\??\\\\\", 4));\n\tpath[1] = L'\\\\';\n\n\tret = win32_get_encrypted_file_size(path, is_dir, &size);\n\tif (ret)\n\t\tgoto out;\n\n\t/* Empty EFSRPC data does not make sense  */\n\twimlib_assert(size != 0);\n\n\twindows_file = alloc_windows_file(path, path_nchars, NULL, 0,\n\t\t\t\t\t  ctx->snapshot, true);\n\tret = add_stream(inode, windows_file, size, STREAM_TYPE_EFSRPC_RAW_DATA,\n\t\t\t NO_STREAM_NAME, ctx->params->unhashed_blobs);\nout:\n\tpath[1] = L'?';\n\treturn ret;\n}\n\nstatic bool\nget_data_stream_name(const wchar_t *raw_stream_name, size_t raw_stream_name_nchars,\n\t\t     const wchar_t **stream_name_ret, size_t *stream_name_nchars_ret)\n{\n\tconst wchar_t *sep, *type, *end;\n\n\t/* The stream name should be returned as :NAME:TYPE  */\n\tif (raw_stream_name_nchars < 1)\n\t\treturn false;\n\tif (raw_stream_name[0] != L':')\n\t\treturn false;\n\n\traw_stream_name++;\n\traw_stream_name_nchars--;\n\n\tend = raw_stream_name + raw_stream_name_nchars;\n\n\tsep = wmemchr(raw_stream_name, L':', raw_stream_name_nchars);\n\tif (!sep)\n\t\treturn false;\n\n\ttype = sep + 1;\n\tif (end - type != 5)\n\t\treturn false;\n\n\tif (wmemcmp(type, L\"$DATA\", 5))\n\t\treturn false;\n\n\t*stream_name_ret = raw_stream_name;\n\t*stream_name_nchars_ret = sep - raw_stream_name;\n\treturn true;\n}\n\nstatic int\nwinnt_scan_data_stream(wchar_t *raw_stream_name, size_t raw_stream_name_nchars,\n\t\t       u64 stream_size, struct wim_inode *inode,\n\t\t       struct winnt_scan_ctx *ctx)\n{\n\twchar_t *stream_name;\n\tsize_t stream_name_nchars;\n\tstruct windows_file *windows_file;\n\n\t/* Given the raw stream name (which is something like\n\t * :streamname:$DATA), extract just the stream name part (streamname).\n\t * Ignore any non-$DATA streams.  */\n\tif (!get_data_stream_name(raw_stream_name, raw_stream_name_nchars,\n\t\t\t\t  (const wchar_t **)&stream_name,\n\t\t\t\t  &stream_name_nchars))\n\t\treturn 0;\n\n\tstream_name[stream_name_nchars] = L'\\0';\n\n\twindows_file = alloc_windows_file(ctx->params->cur_path,\n\t\t\t\t\t  ctx->params->cur_path_nchars,\n\t\t\t\t\t  stream_name, stream_name_nchars,\n\t\t\t\t\t  ctx->snapshot, false);\n\treturn add_stream(inode, windows_file, stream_size, STREAM_TYPE_DATA,\n\t\t\t  stream_name, ctx->params->unhashed_blobs);\n}\n\n/*\n * Load information about the data streams of an open file into a WIM inode.\n *\n * We use the NtQueryInformationFile() system call instead of FindFirstStream()\n * and FindNextStream(), since FindFirstStream() opens its own handle to the\n * file or directory and apparently does so without specifying\n * FILE_FLAG_BACKUP_SEMANTICS.  This causing access denied errors on certain\n * files, even when running as the Administrator.\n */\nstatic noinline_for_stack int\nwinnt_scan_data_streams(HANDLE h, struct wim_inode *inode, u64 file_size,\n\t\t\tstruct winnt_scan_ctx *ctx)\n{\n\tint ret;\n\tPRAGMA_ALIGN(u8 _buf[4096], 8);\n\tu8 *buf;\n\tsize_t bufsize;\n\tIO_STATUS_BLOCK iosb;\n\tNTSTATUS status;\n\tFILE_STREAM_INFORMATION *info;\n\n\tbuf = _buf;\n\tbufsize = sizeof(_buf);\n\n\tif (!(ctx->vol_flags & FILE_NAMED_STREAMS))\n\t\tgoto unnamed_only;\n\n\t/* Get a buffer containing the stream information.  */\n\twhile (!NT_SUCCESS(status = NtQueryInformationFile(h,\n\t\t\t\t\t\t\t   &iosb,\n\t\t\t\t\t\t\t   buf,\n\t\t\t\t\t\t\t   bufsize,\n\t\t\t\t\t\t\t   FileStreamInformation)))\n\t{\n\n\t\tswitch (status) {\n\t\tcase STATUS_BUFFER_OVERFLOW:\n\t\t\t{\n\t\t\t\tu8 *newbuf;\n\n\t\t\t\tbufsize *= 2;\n\t\t\t\tif (buf == _buf)\n\t\t\t\t\tnewbuf = MALLOC(bufsize);\n\t\t\t\telse\n\t\t\t\t\tnewbuf = REALLOC(buf, bufsize);\n\t\t\t\tif (!newbuf) {\n\t\t\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\t\t\tgoto out_free_buf;\n\t\t\t\t}\n\t\t\t\tbuf = newbuf;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase STATUS_NOT_IMPLEMENTED:\n\t\tcase STATUS_NOT_SUPPORTED:\n\t\tcase STATUS_INVALID_INFO_CLASS:\n\t\t\tgoto unnamed_only;\n\t\tdefault:\n\t\t\twinnt_error(status,\n\t\t\t\t    L\"\\\"%ls\\\": Failed to query stream information\",\n\t\t\t\t    printable_path(ctx));\n\t\t\tret = WIMLIB_ERR_READ;\n\t\t\tgoto out_free_buf;\n\t\t}\n\t}\n\n\tif (iosb.Information == 0) {\n\t\t/* No stream information.  */\n\t\tret = 0;\n\t\tgoto out_free_buf;\n\t}\n\n\t/* Parse one or more stream information structures.  */\n\tinfo = (FILE_STREAM_INFORMATION *)buf;\n\tfor (;;) {\n\t\t/* Load the stream information.  */\n\t\tret = winnt_scan_data_stream(info->StreamName,\n\t\t\t\t\t     info->StreamNameLength / 2,\n\t\t\t\t\t     info->StreamSize.QuadPart,\n\t\t\t\t\t     inode, ctx);\n\t\tif (ret)\n\t\t\tgoto out_free_buf;\n\n\t\tif (info->NextEntryOffset == 0) {\n\t\t\t/* No more stream information.  */\n\t\t\tbreak;\n\t\t}\n\t\t/* Advance to next stream information.  */\n\t\tinfo = (FILE_STREAM_INFORMATION *)\n\t\t\t\t((u8 *)info + info->NextEntryOffset);\n\t}\n\tret = 0;\n\tgoto out_free_buf;\n\nunnamed_only:\n\t/* The volume does not support named streams.  Only capture the unnamed\n\t * data stream.  */\n\tif (inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY |\n\t\t\t\t   FILE_ATTRIBUTE_REPARSE_POINT))\n\t{\n\t\tret = 0;\n\t\tgoto out_free_buf;\n\t}\n\n\t{\n\t\twchar_t stream_name[] = L\"::$DATA\";\n\t\tret = winnt_scan_data_stream(stream_name, 7, file_size,\n\t\t\t\t\t     inode, ctx);\n\t}\nout_free_buf:\n\t/* Free buffer if allocated on heap.  */\n\tif (unlikely(buf != _buf))\n\t\tFREE(buf);\n\treturn ret;\n}\n\nstatic u64\nextract_starting_lcn(const RETRIEVAL_POINTERS_BUFFER *extents)\n{\n\tif (extents->ExtentCount < 1)\n\t\treturn 0;\n\n\treturn extents->Extents[0].Lcn.QuadPart;\n}\n\nstatic noinline_for_stack u64\nget_sort_key(HANDLE h)\n{\n\tSTARTING_VCN_INPUT_BUFFER in = { .StartingVcn.QuadPart = 0 };\n\tRETRIEVAL_POINTERS_BUFFER out;\n\n\tif (!NT_SUCCESS(winnt_fsctl(h, FSCTL_GET_RETRIEVAL_POINTERS,\n\t\t\t\t    &in, sizeof(in), &out, sizeof(out), NULL)))\n\t\treturn 0;\n\n\treturn extract_starting_lcn(&out);\n}\n\nstatic void\nset_sort_key(struct wim_inode *inode, u64 sort_key)\n{\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tstruct wim_inode_stream *strm = &inode->i_streams[i];\n\t\tstruct blob_descriptor *blob = stream_blob_resolved(strm);\n\t\tif (blob && blob->blob_location == BLOB_IN_WINDOWS_FILE)\n\t\t\tblob->windows_file->sort_key = sort_key;\n\t}\n}\n\nstatic inline bool\nshould_try_to_use_wimboot_hash(const struct wim_inode *inode,\n\t\t\t       const struct winnt_scan_ctx *ctx)\n{\n\t/* Directories and encrypted files aren't valid for external backing. */\n\tif (inode->i_attributes & (FILE_ATTRIBUTE_DIRECTORY |\n\t\t\t\t   FILE_ATTRIBUTE_ENCRYPTED))\n\t\treturn false;\n\n\t/* If the file is a reparse point, then try the hash fixup if it's a WOF\n\t * reparse point and we're in WIMBOOT mode.  Otherwise, try the hash\n\t * fixup if WOF may be attached. */\n\tif (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT)\n\t\treturn (inode->i_reparse_tag == WIM_IO_REPARSE_TAG_WOF) &&\n\t\t\t(ctx->params->add_flags & WIMLIB_ADD_FLAG_WIMBOOT);\n\treturn !ctx->wof_not_attached;\n}\n\n/*\n * This function implements an optimization for capturing files from a\n * filesystem with a backing WIM(s).  If a file is WIM-backed, then we can\n * retrieve the SHA-1 message digest of its original contents from its reparse\n * point.  This may eliminate the need to read the file's data and/or allow the\n * file's data to be immediately deduplicated with existing data in the WIM.\n *\n * If WOF is attached, then this function is merely an optimization, but\n * potentially a very effective one.  If WOF is detached, then this function\n * really causes WIM-backed files to be, effectively, automatically\n * \"dereferenced\" when possible; the unnamed data stream is updated to reference\n * the original contents and the reparse point is removed.\n *\n * This function returns 0 if the fixup succeeded or was intentionally not\n * executed.  Otherwise it returns an error code.\n */\nstatic noinline_for_stack int\ntry_to_use_wimboot_hash(HANDLE h, struct wim_inode *inode,\n\t\t\tstruct winnt_scan_ctx *ctx)\n{\n\tstruct blob_table *blob_table = ctx->params->blob_table;\n\tstruct wim_inode_stream *reparse_strm = NULL;\n\tstruct wim_inode_stream *strm;\n\tstruct blob_descriptor *blob;\n\tu8 hash[SHA1_HASH_SIZE];\n\tint ret;\n\n\tif (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) {\n\t\tstruct reparse_buffer_disk rpbuf;\n\t\tstruct {\n\t\t\tWOF_EXTERNAL_INFO wof_info;\n\t\t\tstruct wim_provider_rpdata wim_info;\n\t\t} *rpdata = (void *)rpbuf.rpdata;\n\t\tstruct blob_descriptor *reparse_blob;\n\n\t\t/* The file has a WOF reparse point, so WOF must be detached.\n\t\t * We can read the reparse point directly.  */\n\t\tctx->wof_not_attached = true;\n\t\treparse_strm = inode_get_unnamed_stream(inode, STREAM_TYPE_REPARSE_POINT);\n\t\treparse_blob = stream_blob_resolved(reparse_strm);\n\n\t\tif (!reparse_blob || reparse_blob->size < sizeof(*rpdata))\n\t\t\treturn 0;  /* Not a WIM-backed file  */\n\n\t\tret = read_blob_into_buf(reparse_blob, rpdata);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tif (rpdata->wof_info.Version != WOF_CURRENT_VERSION ||\n\t\t    rpdata->wof_info.Provider != WOF_PROVIDER_WIM ||\n\t\t    rpdata->wim_info.version != 2)\n\t\t\treturn 0;  /* Not a WIM-backed file  */\n\n\t\t/* Okay, this is a WIM backed file.  Get its SHA-1 hash.  */\n\t\tcopy_hash(hash, rpdata->wim_info.unnamed_data_stream_hash);\n\t} else {\n\t\tstruct {\n\t\t\tWOF_EXTERNAL_INFO wof_info;\n\t\t\tWIM_PROVIDER_EXTERNAL_INFO wim_info;\n\t\t} out;\n\t\tNTSTATUS status;\n\n\t\t/* WOF may be attached.  Try reading this file's external\n\t\t * backing info.  */\n\t\tstatus = winnt_fsctl(h, FSCTL_GET_EXTERNAL_BACKING,\n\t\t\t\t     NULL, 0, &out, sizeof(out), NULL);\n\n\t\t/* Is WOF not attached?  */\n\t\tif (status == STATUS_INVALID_DEVICE_REQUEST ||\n\t\t    status == STATUS_NOT_SUPPORTED) {\n\t\t\tctx->wof_not_attached = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t/* Is this file not externally backed?  */\n\t\tif (status == STATUS_OBJECT_NOT_EXTERNALLY_BACKED)\n\t\t\treturn 0;\n\n\t\t/* Does this file have an unknown type of external backing that\n\t\t * needed a larger information buffer?  */\n\t\tif (status == STATUS_BUFFER_TOO_SMALL)\n\t\t\treturn 0;\n\n\t\t/* Was there some other failure?  */\n\t\tif (status != STATUS_SUCCESS) {\n\t\t\twinnt_error(status,\n\t\t\t\t    L\"\\\"%ls\\\": FSCTL_GET_EXTERNAL_BACKING failed\",\n\t\t\t\t    printable_path(ctx));\n\t\t\treturn WIMLIB_ERR_STAT;\n\t\t}\n\n\t\t/* Is this file backed by a WIM?  */\n\t\tif (out.wof_info.Version != WOF_CURRENT_VERSION ||\n\t\t    out.wof_info.Provider != WOF_PROVIDER_WIM ||\n\t\t    out.wim_info.Version != WIM_PROVIDER_CURRENT_VERSION)\n\t\t\treturn 0;\n\n\t\t/* Okay, this is a WIM backed file.  Get its SHA-1 hash.  */\n\t\tcopy_hash(hash, out.wim_info.ResourceHash);\n\t}\n\n\t/* If the file's unnamed data stream is nonempty, then fill in its hash\n\t * and deduplicate it if possible.\n\t *\n\t * With WOF detached, we require that the blob *must* de-duplicable for\n\t * any action can be taken, since without WOF we can't fall back to\n\t * getting the \"dereferenced\" data by reading the stream (the real\n\t * stream is sparse and contains all zeroes).  */\n\tstrm = inode_get_unnamed_data_stream(inode);\n\tif (strm && (blob = stream_blob_resolved(strm))) {\n\t\tstruct blob_descriptor **back_ptr;\n\n\t\tif (reparse_strm && !lookup_blob(blob_table, hash))\n\t\t\treturn 0;\n\t\tback_ptr = retrieve_pointer_to_unhashed_blob(blob);\n\t\tcopy_hash(blob->hash, hash);\n\t\tif (after_blob_hashed(blob, back_ptr, blob_table,\n\t\t\t\t      inode) != blob)\n\t\t\tfree_blob_descriptor(blob);\n\t}\n\n\t/* Remove the reparse point, if present.  */\n\tif (reparse_strm) {\n\t\tinode_remove_stream(inode, reparse_strm, blob_table);\n\t\tinode->i_attributes &= ~(FILE_ATTRIBUTE_REPARSE_POINT |\n\t\t\t\t\t FILE_ATTRIBUTE_SPARSE_FILE);\n\t\tif (inode->i_attributes == 0)\n\t\t\tinode->i_attributes = FILE_ATTRIBUTE_NORMAL;\n\t}\n\n\treturn 0;\n}\n\nstruct file_info {\n\tu32 attributes;\n\tu32 num_links;\n\tu64 creation_time;\n\tu64 last_write_time;\n\tu64 last_access_time;\n\tu64 ino;\n\tu64 end_of_file;\n\tu32 ea_size;\n};\n\nstatic noinline_for_stack NTSTATUS\nget_file_info(HANDLE h, struct file_info *info)\n{\n\tIO_STATUS_BLOCK iosb;\n\tNTSTATUS status;\n\tFILE_ALL_INFORMATION all_info;\n\n\tstatus = NtQueryInformationFile(h, &iosb, &all_info, sizeof(all_info),\n\t\t\t\t\tFileAllInformation);\n\n\tif (unlikely(!NT_SUCCESS(status) && status != STATUS_BUFFER_OVERFLOW))\n\t\treturn status;\n\n\tinfo->attributes = all_info.BasicInformation.FileAttributes;\n\tinfo->num_links = all_info.StandardInformation.NumberOfLinks;\n\tinfo->creation_time = all_info.BasicInformation.CreationTime.QuadPart;\n\tinfo->last_write_time = all_info.BasicInformation.LastWriteTime.QuadPart;\n\tinfo->last_access_time = all_info.BasicInformation.LastAccessTime.QuadPart;\n\tinfo->ino = all_info.InternalInformation.IndexNumber.QuadPart;\n\tinfo->end_of_file = all_info.StandardInformation.EndOfFile.QuadPart;\n\tinfo->ea_size = all_info.EaInformation.EaSize;\n\treturn STATUS_SUCCESS;\n}\n\nstatic void\nget_volume_information(HANDLE h, struct winnt_scan_ctx *ctx)\n{\n\tPRAGMA_ALIGN(u8 _attr_info[sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 128], 8);\n\tFILE_FS_ATTRIBUTE_INFORMATION *attr_info = (void *)_attr_info;\n\tFILE_FS_VOLUME_INFORMATION vol_info;\n\tstruct file_info file_info;\n\tIO_STATUS_BLOCK iosb = { 0 };\n\tNTSTATUS status;\n\n\t/* Get volume flags  */\n\tstatus = NtQueryVolumeInformationFile(h, &iosb, attr_info,\n\t\t\t\t\t      sizeof(_attr_info),\n\t\t\t\t\t      FileFsAttributeInformation);\n\tif (NT_SUCCESS(status)) {\n\t\tctx->vol_flags = attr_info->FileSystemAttributes;\n\t\tctx->is_ntfs = (attr_info->FileSystemNameLength == 4 * sizeof(wchar_t)) &&\n\t\t\t\t!wmemcmp(attr_info->FileSystemName, L\"NTFS\", 4);\n\t} else {\n\t\twinnt_warning(status, L\"\\\"%ls\\\": Can't get volume attributes\",\n\t\t\t      printable_path(ctx));\n\t}\n\n\t/* Get volume ID.  */\n\tstatus = NtQueryVolumeInformationFile(h, &iosb, &vol_info,\n\t\t\t\t\t      sizeof(vol_info),\n\t\t\t\t\t      FileFsVolumeInformation);\n\tif ((NT_SUCCESS(status) || status == STATUS_BUFFER_OVERFLOW) &&\n\t    (iosb.Information >= offsetof(FILE_FS_VOLUME_INFORMATION,\n\t\t\t\t\t  VolumeSerialNumber) +\n\t     sizeof(vol_info.VolumeSerialNumber)))\n\t{\n\t\tctx->params->capture_root_dev = vol_info.VolumeSerialNumber;\n\t} else {\n\t\twinnt_warning(status, L\"\\\"%ls\\\": Can't get volume ID\",\n\t\t\t      printable_path(ctx));\n\t}\n\n\t/* Get inode number.  */\n\tstatus = get_file_info(h, &file_info);\n\tif (NT_SUCCESS(status)) {\n\t\tctx->params->capture_root_ino = file_info.ino;\n\t} else {\n\t\twinnt_warning(status, L\"\\\"%ls\\\": Can't get file information\",\n\t\t\t      printable_path(ctx));\n\t}\n}\n\nstatic int\nwinnt_build_dentry_tree(struct wim_dentry **root_ret,\n\t\t\tHANDLE cur_dir,\n\t\t\tconst wchar_t *relative_path,\n\t\t\tsize_t relative_path_nchars,\n\t\t\tconst wchar_t *filename,\n\t\t\tstruct winnt_scan_ctx *ctx,\n\t\t\tbool recursive)\n{\n\tstruct wim_dentry *root = NULL;\n\tstruct wim_inode *inode = NULL;\n\tHANDLE h = NULL;\n\tint ret;\n\tNTSTATUS status;\n\tstruct file_info file_info;\n\tu64 sort_key;\n\n\tret = try_exclude(ctx->params);\n\tif (unlikely(ret < 0)) /* Excluded? */\n\t\tgoto out_progress;\n\tif (unlikely(ret > 0)) /* Error? */\n\t\tgoto out;\n\n\t/* Open the file with permission to read metadata.  Although we will\n\t * later need a handle with FILE_LIST_DIRECTORY permission (or,\n\t * equivalently, FILE_READ_DATA; they're the same numeric value) if the\n\t * file is a directory, it can significantly slow things down to request\n\t * this permission on all nondirectories.  Perhaps it causes Windows to\n\t * start prefetching the file contents...  */\n\tstatus = winnt_openat(cur_dir, relative_path, relative_path_nchars,\n\t\t\t      FILE_READ_ATTRIBUTES | FILE_READ_EA |\n\t\t\t\tREAD_CONTROL | ACCESS_SYSTEM_SECURITY,\n\t\t\t      &h);\n\tif (unlikely(!NT_SUCCESS(status))) {\n\t\tif (status == STATUS_DELETE_PENDING) {\n\t\t\tWARNING(\"\\\"%ls\\\": Deletion pending; skipping file\",\n\t\t\t\tprintable_path(ctx));\n\t\t\tret = 0;\n\t\t\tgoto out;\n\t\t}\n\t\tif (status == STATUS_SHARING_VIOLATION) {\n\t\t\tERROR(\"Can't open \\\"%ls\\\":\\n\"\n\t\t\t      \"        File is in use by another process! \"\n\t\t\t      \"Consider using snapshot (VSS) mode.\",\n\t\t\t      printable_path(ctx));\n\t\t\tret = WIMLIB_ERR_OPEN;\n\t\t\tgoto out;\n\t\t}\n\t\twinnt_error(status, L\"\\\"%ls\\\": Can't open file\",\n\t\t\t    printable_path(ctx));\n\t\tif (status == STATUS_FVE_LOCKED_VOLUME)\n\t\t\tret = WIMLIB_ERR_FVE_LOCKED_VOLUME;\n\t\telse\n\t\t\tret = WIMLIB_ERR_OPEN;\n\t\tgoto out;\n\t}\n\n\t/* Get information about the file.  */\n\tstatus = get_file_info(h, &file_info);\n\tif (!NT_SUCCESS(status)) {\n\t\twinnt_error(status, L\"\\\"%ls\\\": Can't get file information\",\n\t\t\t    printable_path(ctx));\n\t\tret = WIMLIB_ERR_STAT;\n\t\tgoto out;\n\t}\n\n\t/* Create a WIM dentry with an associated inode, which may be shared.\n\t *\n\t * However, we need to explicitly check for directories and files with\n\t * only 1 link and refuse to hard link them.  This is because Windows\n\t * has a bug where it can return duplicate File IDs for files and\n\t * directories on the FAT filesystem.\n\t *\n\t * Since we don't follow mount points on Windows, we don't need to query\n\t * the volume ID per-file.  Just once, for the root, is enough.  But we\n\t * can't simply pass 0, because then there could be inode collisions\n\t * among multiple calls to win32_build_dentry_tree() that are scanning\n\t * files on different volumes.  */\n\tret = inode_table_new_dentry(ctx->params->inode_table,\n\t\t\t\t     filename,\n\t\t\t\t     file_info.ino,\n\t\t\t\t     ctx->params->capture_root_dev,\n\t\t\t\t     (file_info.num_links <= 1),\n\t\t\t\t     &root);\n\tif (ret)\n\t\tgoto out;\n\n\t/* Get the short (DOS) name of the file.  */\n\tstatus = winnt_get_short_name(h, root);\n\n\t/* If we can't read the short filename for any reason other than\n\t * out-of-memory, just ignore the error and assume the file has no short\n\t * name.  This shouldn't be an issue, since the short names are\n\t * essentially obsolete anyway.  */\n\tif (unlikely(status == STATUS_NO_MEMORY)) {\n\t\tret = WIMLIB_ERR_NOMEM;\n\t\tgoto out;\n\t}\n\n\tinode = root->d_inode;\n\n\tif (inode->i_nlink > 1) {\n\t\t/* Shared inode (hard link); skip reading per-inode information.\n\t\t */\n\t\tgoto out_progress;\n\t}\n\n\tinode->i_attributes = file_info.attributes;\n\tinode->i_creation_time = file_info.creation_time;\n\tinode->i_last_write_time = file_info.last_write_time;\n\tinode->i_last_access_time = file_info.last_access_time;\n\n\t/* Get the file's security descriptor, unless we are capturing in\n\t * NO_ACLS mode or the volume does not support security descriptors.  */\n\tif (!(ctx->params->add_flags & WIMLIB_ADD_FLAG_NO_ACLS)\n\t    && (ctx->vol_flags & FILE_PERSISTENT_ACLS))\n\t{\n\t\tret = winnt_load_security_descriptor(h, inode, ctx);\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\n\t/* Get the file's object ID.  */\n\tret = winnt_load_object_id(h, inode, ctx);\n\tif (ret)\n\t\tgoto out;\n\n\t/* Get the file's extended attributes.  */\n\tif (unlikely(file_info.ea_size != 0)) {\n\t\tret = winnt_load_xattrs(h, inode, ctx, file_info.ea_size);\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\n\t/* If this is a reparse point, load the reparse data.  */\n\tif (unlikely(inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT)) {\n\t\tret = winnt_load_reparse_data(h, inode, ctx);\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\n\tsort_key = get_sort_key(h);\n\n\tif (unlikely(inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED)) {\n\t\t/* Load information about the raw encrypted data.  This is\n\t\t * needed for any directory or non-directory that has\n\t\t * FILE_ATTRIBUTE_ENCRYPTED set.\n\t\t *\n\t\t * Note: since OpenEncryptedFileRaw() fails with\n\t\t * ERROR_SHARING_VIOLATION if there are any open handles to the\n\t\t * file, we have to close the file and re-open it later if\n\t\t * needed.  */\n\t\tNtClose(h);\n\t\th = NULL;\n\t\tret = winnt_scan_efsrpc_raw_data(inode, ctx);\n\t\tif (ret)\n\t\t\tgoto out;\n\t} else {\n\t\t/*\n\t\t * Load information about data streams (unnamed and named).\n\t\t *\n\t\t * Skip this step for encrypted files, since the data from\n\t\t * ReadEncryptedFileRaw() already contains all data streams (and\n\t\t * they do in fact all get restored by WriteEncryptedFileRaw().)\n\t\t *\n\t\t * Note: WIMGAPI (as of Windows 8.1) gets wrong and stores both\n\t\t * the EFSRPC data and the named data stream(s)...!\n\t\t */\n\t\tret = winnt_scan_data_streams(h,\n\t\t\t\t\t      inode,\n\t\t\t\t\t      file_info.end_of_file,\n\t\t\t\t\t      ctx);\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\n\tif (unlikely(should_try_to_use_wimboot_hash(inode, ctx))) {\n\t\tret = try_to_use_wimboot_hash(h, inode, ctx);\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\n\tset_sort_key(inode, sort_key);\n\n\tif (inode_is_directory(inode) && recursive) {\n\n\t\t/* Directory: recurse to children.  */\n\n\t\t/* Re-open the directory with FILE_LIST_DIRECTORY access.  */\n\t\tif (h) {\n\t\t\tNtClose(h);\n\t\t\th = NULL;\n\t\t}\n\t\tstatus = winnt_openat(cur_dir, relative_path,\n\t\t\t\t      relative_path_nchars, FILE_LIST_DIRECTORY,\n\t\t\t\t      &h);\n\t\tif (!NT_SUCCESS(status)) {\n\t\t\twinnt_error(status, L\"\\\"%ls\\\": Can't open directory\",\n\t\t\t\t    printable_path(ctx));\n\t\t\tret = WIMLIB_ERR_OPEN;\n\t\t\tgoto out;\n\t\t}\n\t\tret = winnt_recurse_directory(h, root, ctx);\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\nout_progress:\n\tret = 0;\n\tif (recursive) { /* if !recursive, caller handles progress */\n\t\tif (likely(root))\n\t\t\tret = do_scan_progress(ctx->params,\n\t\t\t\t\t       WIMLIB_SCAN_DENTRY_OK, inode);\n\t\telse\n\t\t\tret = do_scan_progress(ctx->params,\n\t\t\t\t\t       WIMLIB_SCAN_DENTRY_EXCLUDED,\n\t\t\t\t\t       NULL);\n\t}\nout:\n\tif (likely(h))\n\t\tNtClose(h);\n\tif (unlikely(ret)) {\n\t\tfree_dentry_tree(root, ctx->params->blob_table);\n\t\troot = NULL;\n\t\tret = report_scan_error(ctx->params, ret);\n\t}\n\t*root_ret = root;\n\treturn ret;\n}\n\nstatic void\nwinnt_do_scan_warnings(const wchar_t *path, const struct winnt_scan_ctx *ctx)\n{\n\tif (likely(ctx->num_get_sacl_priv_notheld == 0 &&\n\t\t   ctx->num_get_sd_access_denied == 0))\n\t\treturn;\n\n\tWARNING(\"Scan of \\\"%ls\\\" complete, but with one or more warnings:\", path);\n\tif (ctx->num_get_sacl_priv_notheld != 0) {\n\t\tWARNING(\"- Could not capture SACL (System Access Control List)\\n\"\n\t\t\t\"            on %lu files or directories.\",\n\t\t\tctx->num_get_sacl_priv_notheld);\n\t}\n\tif (ctx->num_get_sd_access_denied != 0) {\n\t\tWARNING(\"- Could not capture security descriptor at all\\n\"\n\t\t\t\"            on %lu files or directories.\",\n\t\t\tctx->num_get_sd_access_denied);\n\t}\n\tWARNING(\"To fully capture all security descriptors, run the program\\n\"\n\t\t\"          with Administrator rights.\");\n}\n\n/*----------------------------------------------------------------------------*\n *                         Fast MFT scan implementation                       *\n *----------------------------------------------------------------------------*/\n\n#define ENABLE_FAST_MFT_SCAN\t1\n\n#ifdef ENABLE_FAST_MFT_SCAN\n\n#ifndef _MSC_VER\ntypedef struct {\n\tu64 StartingCluster;\n\tu64 ClusterCount;\n} CLUSTER_RANGE;\n\ntypedef struct {\n\tu64 StartingFileReferenceNumber;\n\tu64 EndingFileReferenceNumber;\n} FILE_REFERENCE_RANGE;\n\n/* The FSCTL_QUERY_FILE_LAYOUT ioctl.  This ioctl can be used on Windows 8 and\n * later to scan the MFT of an NTFS volume.  */\n#define FSCTL_QUERY_FILE_LAYOUT\t\tCTL_CODE(FILE_DEVICE_FILE_SYSTEM, 157, METHOD_NEITHER, FILE_ANY_ACCESS)\n\n/* The input to FSCTL_QUERY_FILE_LAYOUT  */\ntypedef struct {\n\tu32 NumberOfPairs;\n#define QUERY_FILE_LAYOUT_RESTART\t\t\t\t\t0x00000001\n#define QUERY_FILE_LAYOUT_INCLUDE_NAMES\t\t\t\t\t0x00000002\n#define QUERY_FILE_LAYOUT_INCLUDE_STREAMS\t\t\t\t0x00000004\n#define QUERY_FILE_LAYOUT_INCLUDE_EXTENTS\t\t\t\t0x00000008\n#define QUERY_FILE_LAYOUT_INCLUDE_EXTRA_INFO\t\t\t\t0x00000010\n#define QUERY_FILE_LAYOUT_INCLUDE_STREAMS_WITH_NO_CLUSTERS_ALLOCATED\t0x00000020\n\tu32 Flags;\n#define QUERY_FILE_LAYOUT_FILTER_TYPE_NONE\t\t0\n#define QUERY_FILE_LAYOUT_FILTER_TYPE_CLUSTERS\t\t1\n#define QUERY_FILE_LAYOUT_FILTER_TYPE_FILEID\t\t2\n#define QUERY_FILE_LAYOUT_NUM_FILTER_TYPES\t\t3\n\tu32 FilterType;\n\tu32 Reserved;\n\tunion {\n\t\tCLUSTER_RANGE ClusterRanges[1];\n\t\tFILE_REFERENCE_RANGE FileReferenceRanges[1];\n\t} Filter;\n} QUERY_FILE_LAYOUT_INPUT;\n\n/* The header of the buffer returned by FSCTL_QUERY_FILE_LAYOUT  */\ntypedef struct {\n\tu32 FileEntryCount;\n\tu32 FirstFileOffset;\n#define QUERY_FILE_LAYOUT_SINGLE_INSTANCED\t\t\t\t0x00000001\n\tu32 Flags;\n\tu32 Reserved;\n} QUERY_FILE_LAYOUT_OUTPUT;\n\n/* Inode information returned by FSCTL_QUERY_FILE_LAYOUT  */\ntypedef struct {\n\tu32 Version;\n\tu32 NextFileOffset;\n\tu32 Flags;\n\tu32 FileAttributes;\n\tu64 FileReferenceNumber;\n\tu32 FirstNameOffset;\n\tu32 FirstStreamOffset;\n\tu32 ExtraInfoOffset;\n\tu32 Reserved;\n} FILE_LAYOUT_ENTRY;\n\n/* Extra inode information returned by FSCTL_QUERY_FILE_LAYOUT  */\ntypedef struct {\n\tstruct {\n\t\tu64 CreationTime;\n\t\tu64 LastAccessTime;\n\t\tu64 LastWriteTime;\n\t\tu64 ChangeTime;\n\t\tu32 FileAttributes;\n\t} BasicInformation;\n\tu32 OwnerId;\n\tu32 SecurityId;\n\ts64 Usn;\n} FILE_LAYOUT_INFO_ENTRY;\n\n/* Filename (or dentry) information returned by FSCTL_QUERY_FILE_LAYOUT  */\ntypedef struct {\n\tu32 NextNameOffset;\n#define FILE_LAYOUT_NAME_ENTRY_PRIMARY\t0x00000001\n#define FILE_LAYOUT_NAME_ENTRY_DOS\t0x00000002\n\tu32 Flags;\n\tu64 ParentFileReferenceNumber;\n\tu32 FileNameLength;\n\tu32 Reserved;\n\twchar_t FileName[1];\n} FILE_LAYOUT_NAME_ENTRY;\n\n/* Stream information returned by FSCTL_QUERY_FILE_LAYOUT  */\ntypedef struct {\n\tu32 Version;\n\tu32 NextStreamOffset;\n#define STREAM_LAYOUT_ENTRY_IMMOVABLE\t\t\t0x00000001\n#define STREAM_LAYOUT_ENTRY_PINNED\t\t\t0x00000002\n#define STREAM_LAYOUT_ENTRY_RESIDENT\t\t\t0x00000004\n#define STREAM_LAYOUT_ENTRY_NO_CLUSTERS_ALLOCATED\t0x00000008\n\tu32 Flags;\n\tu32 ExtentInformationOffset;\n\tu64 AllocationSize;\n\tu64 EndOfFile;\n\tu64 Reserved;\n\tu32 AttributeFlags;\n\tu32 StreamIdentifierLength;\n\twchar_t StreamIdentifier[1];\n} STREAM_LAYOUT_ENTRY;\n\n\ntypedef struct {\n#define STREAM_EXTENT_ENTRY_AS_RETRIEVAL_POINTERS\t0x00000001\n#define STREAM_EXTENT_ENTRY_ALL_EXTENTS\t\t\t0x00000002\n\tu32 Flags;\n\tunion {\n\t\tRETRIEVAL_POINTERS_BUFFER RetrievalPointers;\n\t} ExtentInformation;\n} STREAM_EXTENT_ENTRY;\n#endif\n\n/* Extract the MFT number part of the full inode number  */\n#define NTFS_MFT_NO(ref)\t((ref) & (((u64)1 << 48) - 1))\n\n/* Is the file the root directory of the NTFS volume?  The root directory always\n * occupies MFT record 5.  */\n#define NTFS_IS_ROOT_FILE(ino)\t(NTFS_MFT_NO(ino) == 5)\n\n/* Is the file a special NTFS file, other than the root directory?  The special\n * files are the first 16 records in the MFT.  */\n#define NTFS_IS_SPECIAL_FILE(ino)\t\t\t\\\n\t(NTFS_MFT_NO(ino) <= 15 && !NTFS_IS_ROOT_FILE(ino))\n\n#define NTFS_SPECIAL_STREAM_OBJECT_ID\t\t0x00000001\n#define NTFS_SPECIAL_STREAM_EA\t\t\t0x00000002\n#define NTFS_SPECIAL_STREAM_EA_INFORMATION\t0x00000004\n\n/* Intermediate inode structure.  This is used to temporarily save information\n * from FSCTL_QUERY_FILE_LAYOUT before creating the full 'struct wim_inode'.  */\nstruct ntfs_inode {\n\tstruct avl_tree_node index_node;\n\tu64 ino;\n\tu64 creation_time;\n\tu64 last_access_time;\n\tu64 last_write_time;\n\tu64 starting_lcn;\n\tu32 attributes;\n\tu32 security_id;\n\tu32 num_aliases;\n\tu32 num_streams;\n\tu32 special_streams;\n\tu32 first_stream_offset;\n\tstruct ntfs_dentry *first_child;\n\twchar_t short_name[13];\n};\n\n/* Intermediate dentry structure.  This is used to temporarily save information\n * from FSCTL_QUERY_FILE_LAYOUT before creating the full 'struct wim_dentry'. */\nstruct ntfs_dentry {\n\tu32 offset_from_inode : 31;\n\tu32 is_primary : 1;\n\tunion {\n\t\t/* Note: build_children_lists() replaces 'parent_ino' with\n\t\t * 'next_child'.  */\n\t\tu64 parent_ino;\n\t\tstruct ntfs_dentry *next_child;\n\t};\n\twchar_t name[0];\n};\n\n/* Intermediate stream structure.  This is used to temporarily save information\n * from FSCTL_QUERY_FILE_LAYOUT before creating the full 'struct\n * wim_inode_stream'.  */\nstruct ntfs_stream {\n\tu64 size;\n\twchar_t name[0];\n};\n\n/* Map of all known NTFS inodes, keyed by inode number  */\nstruct ntfs_inode_map {\n\tstruct avl_tree_node *root;\n};\n\n#define NTFS_INODE(node)\t\t\t\t\\\n\tavl_tree_entry((node), struct ntfs_inode, index_node)\n\n#define SKIP_ALIGNED(p, size)\t(_PTR((p) + ALIGN((size), 8)))\n\n/* Get a pointer to the first dentry of the inode.  */\n#define FIRST_DENTRY(ni) SKIP_ALIGNED((ni), sizeof(struct ntfs_inode))\n\n/* Get a pointer to the first stream of the inode.  */\n#define FIRST_STREAM(ni) (_PTR(ni + ni->first_stream_offset))\n\n/* Advance to the next dentry of the inode.  */\n#define NEXT_DENTRY(nd)\t SKIP_ALIGNED((nd), sizeof(struct ntfs_dentry) +   \\\n\t\t\t\t(wcslen((nd)->name) + 1) * sizeof(wchar_t))\n\n/* Advance to the next stream of the inode.  */\n#define NEXT_STREAM(ns)\t SKIP_ALIGNED((ns), sizeof(struct ntfs_stream) +   \\\n\t\t\t\t(wcslen((ns)->name) + 1) * sizeof(wchar_t))\n\nstatic int\n_avl_cmp_ntfs_inodes(const struct avl_tree_node *node1,\n\t\t     const struct avl_tree_node *node2)\n{\n\treturn cmp_u64(NTFS_INODE(node1)->ino, NTFS_INODE(node2)->ino);\n}\n\n/* Adds an NTFS inode to the map.  */\nstatic void\nntfs_inode_map_add_inode(struct ntfs_inode_map *map, struct ntfs_inode *ni)\n{\n\tif (avl_tree_insert(&map->root, &ni->index_node, _avl_cmp_ntfs_inodes)) {\n\t\tWARNING(\"Inode 0x%016\"PRIx64\" is a duplicate!\", ni->ino);\n\t\tFREE(ni);\n\t}\n}\n\n/* Find an ntfs_inode in the map by inode number.  Returns NULL if not found. */\nstatic struct ntfs_inode *\nntfs_inode_map_lookup(struct ntfs_inode_map *map, u64 ino)\n{\n\tstruct ntfs_inode tmp;\n\tstruct avl_tree_node *res;\n\n\ttmp.ino = ino;\n\tres = avl_tree_lookup_node(map->root, &tmp.index_node, _avl_cmp_ntfs_inodes);\n\tif (!res)\n\t\treturn NULL;\n\treturn NTFS_INODE(res);\n}\n\n/* Remove an ntfs_inode from the map and free it.  */\nstatic void\nntfs_inode_map_remove(struct ntfs_inode_map *map, struct ntfs_inode *ni)\n{\n\tavl_tree_remove(&map->root, &ni->index_node);\n\tFREE(ni);\n}\n\n/* Free all ntfs_inodes in the map.  */\nstatic void\nntfs_inode_map_destroy(struct ntfs_inode_map *map)\n{\n\tstruct ntfs_inode *ni;\n\n\tavl_tree_for_each_in_postorder(ni, map->root, struct ntfs_inode, index_node)\n\t\tFREE(ni);\n}\n\nstatic bool\nfile_has_streams(const FILE_LAYOUT_ENTRY *file)\n{\n\treturn (file->FirstStreamOffset != 0) &&\n\t\t!(file->FileAttributes & FILE_ATTRIBUTE_ENCRYPTED);\n}\n\nstatic bool\nis_valid_name_entry(const FILE_LAYOUT_NAME_ENTRY *name)\n{\n\treturn name->FileNameLength > 0 &&\n\t\tname->FileNameLength % 2 == 0 &&\n\t\t!wmemchr(name->FileName, L'\\0', name->FileNameLength / 2) &&\n\t\t(!(name->Flags & FILE_LAYOUT_NAME_ENTRY_DOS) ||\n\t\t name->FileNameLength <= 24);\n}\n\n/* Validate the FILE_LAYOUT_NAME_ENTRYs of the specified file and compute the\n * total length in bytes of the ntfs_dentry structures needed to hold the name\n * information.  */\nstatic int\nvalidate_names_and_compute_total_length(const FILE_LAYOUT_ENTRY *file,\n\t\t\t\t\tsize_t *total_length_ret)\n{\n\tconst FILE_LAYOUT_NAME_ENTRY *name =\n\t\t_PTR(file + file->FirstNameOffset);\n\tsize_t total = 0;\n\tsize_t num_long_names = 0;\n\n\tfor (;;) {\n\t\tif (unlikely(!is_valid_name_entry(name))) {\n\t\t\tERROR(\"Invalid FILE_LAYOUT_NAME_ENTRY! \"\n\t\t\t      \"FileReferenceNumber=0x%016\"PRIx64\", \"\n\t\t\t      \"FileNameLength=%\"PRIu32\", \"\n\t\t\t      \"FileName=%.*ls, Flags=0x%08\"PRIx32,\n\t\t\t      file->FileReferenceNumber,\n\t\t\t      name->FileNameLength,\n\t\t\t      (int)(name->FileNameLength / 2),\n\t\t\t      name->FileName, name->Flags);\n\t\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t\t}\n\t\tif (name->Flags != FILE_LAYOUT_NAME_ENTRY_DOS) {\n\t\t\tnum_long_names++;\n\t\t\ttotal += ALIGN(sizeof(struct ntfs_dentry) +\n\t\t\t\t       name->FileNameLength + sizeof(wchar_t),\n\t\t\t\t       8);\n\t\t}\n\t\tif (name->NextNameOffset == 0)\n\t\t\tbreak;\n\t\tname = _PTR(name + name->NextNameOffset);\n\t}\n\n\tif (unlikely(num_long_names == 0)) {\n\t\tERROR(\"Inode 0x%016\"PRIx64\" has no long names!\",\n\t\t      file->FileReferenceNumber);\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n\n\t*total_length_ret = total;\n\treturn 0;\n}\n\nstatic bool\nis_valid_stream_entry(const STREAM_LAYOUT_ENTRY *stream)\n{\n\treturn stream->StreamIdentifierLength % 2 == 0 &&\n\t\t!wmemchr(stream->StreamIdentifier , L'\\0',\n\t\t\t stream->StreamIdentifierLength / 2);\n}\n\n/* assumes that 'id' is a wide string literal */\n#define stream_has_identifier(stream, id)\t\t\t\t\\\n\t((stream)->StreamIdentifierLength == sizeof(id) - 2 &&\t\t\\\n\t !memcmp((stream)->StreamIdentifier, id, sizeof(id) - 2))\n/*\n * If the specified STREAM_LAYOUT_ENTRY represents a DATA stream as opposed to\n * some other type of NTFS stream such as a STANDARD_INFORMATION stream, return\n * true and set *stream_name_ret and *stream_name_nchars_ret to specify just the\n * stream name.  For example, \":foo:$DATA\" would become \"foo\" with length 3\n * characters.  Otherwise return false.\n */\nstatic bool\nuse_stream(const FILE_LAYOUT_ENTRY *file, const STREAM_LAYOUT_ENTRY *stream,\n\t   const wchar_t **stream_name_ret, size_t *stream_name_nchars_ret)\n{\n\tconst wchar_t *stream_name;\n\tsize_t stream_name_nchars;\n\n\tif (stream->StreamIdentifierLength == 0) {\n\t\t/* The unnamed data stream may be given as an empty string\n\t\t * rather than as \"::$DATA\".  Handle it both ways.  */\n\t\tstream_name = L\"\";\n\t\tstream_name_nchars = 0;\n\t} else if (!get_data_stream_name(stream->StreamIdentifier,\n\t\t\t\t\t stream->StreamIdentifierLength / 2,\n\t\t\t\t\t &stream_name, &stream_name_nchars))\n\t\treturn false;\n\n\t/* Skip the unnamed data stream for directories.  */\n\tif (stream_name_nchars == 0 &&\n\t    (file->FileAttributes & FILE_ATTRIBUTE_DIRECTORY))\n\t\treturn false;\n\n\t*stream_name_ret = stream_name;\n\t*stream_name_nchars_ret = stream_name_nchars;\n\treturn true;\n}\n\n/* Validate the STREAM_LAYOUT_ENTRYs of the specified file and compute the total\n * length in bytes of the ntfs_stream structures needed to hold the stream\n * information.  In addition, set *special_streams_ret to a bitmask of special\n * stream types that were found.  */\nstatic int\nvalidate_streams_and_compute_total_length(const FILE_LAYOUT_ENTRY *file,\n\t\t\t\t\t  size_t *total_length_ret,\n\t\t\t\t\t  u32 *special_streams_ret)\n{\n\tconst STREAM_LAYOUT_ENTRY *stream =\n\t\t_PTR(file + file->FirstStreamOffset);\n\tsize_t total = 0;\n\tu32 special_streams = 0;\n\n\tfor (;;) {\n\t\tconst wchar_t *name;\n\t\tsize_t name_nchars;\n\n\t\tif (unlikely(!is_valid_stream_entry(stream))) {\n\t\t\tWARNING(\"Invalid STREAM_LAYOUT_ENTRY! \"\n\t\t\t\t\"FileReferenceNumber=0x%016\"PRIx64\", \"\n\t\t\t\t\"StreamIdentifierLength=%\"PRIu32\", \"\n\t\t\t\t\"StreamIdentifier=%.*ls\",\n\t\t\t\tfile->FileReferenceNumber,\n\t\t\t\tstream->StreamIdentifierLength,\n\t\t\t\t(int)(stream->StreamIdentifierLength / 2),\n\t\t\t\tstream->StreamIdentifier);\n\t\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t\t}\n\n\t\tif (use_stream(file, stream, &name, &name_nchars)) {\n\t\t\ttotal += ALIGN(sizeof(struct ntfs_stream) +\n\t\t\t\t       (name_nchars + 1) * sizeof(wchar_t), 8);\n\t\t} else if (stream_has_identifier(stream, L\"::$OBJECT_ID\")) {\n\t\t\tspecial_streams |= NTFS_SPECIAL_STREAM_OBJECT_ID;\n\t\t} else if (stream_has_identifier(stream, L\"::$EA\")) {\n\t\t\tspecial_streams |= NTFS_SPECIAL_STREAM_EA;\n\t\t} else if (stream_has_identifier(stream, L\"::$EA_INFORMATION\")) {\n\t\t\tspecial_streams |= NTFS_SPECIAL_STREAM_EA_INFORMATION;\n\t\t}\n\t\tif (stream->NextStreamOffset == 0)\n\t\t\tbreak;\n\t\tstream = _PTR(stream + stream->NextStreamOffset);\n\t}\n\n\t*total_length_ret = total;\n\t*special_streams_ret = special_streams;\n\treturn 0;\n}\n\nstatic void *\nload_name_information(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode *ni,\n\t\t      void *p)\n{\n\tconst FILE_LAYOUT_NAME_ENTRY *name =\n\t\t_PTR(file + file->FirstNameOffset);\n\tfor (;;) {\n\t\tstruct ntfs_dentry *nd = p;\n\t\t/* Note that a name may be just a short (DOS) name, just a long\n\t\t * name, or both a short name and a long name.  If there is a\n\t\t * short name, one name should also be marked as \"primary\" to\n\t\t * indicate which long name the short name is associated with.\n\t\t * Also, there should be at most one short name per inode.  */\n\t\tif (name->Flags & FILE_LAYOUT_NAME_ENTRY_DOS) {\n\t\t\tmemcpy(ni->short_name,\n\t\t\t       name->FileName, name->FileNameLength);\n\t\t\tni->short_name[name->FileNameLength / 2] = L'\\0';\n\t\t}\n\t\tif (name->Flags != FILE_LAYOUT_NAME_ENTRY_DOS) {\n\t\t\tni->num_aliases++;\n\t\t\tnd->offset_from_inode = (u8 *)nd - (u8 *)ni;\n\t\t\tnd->is_primary = ((name->Flags &\n\t\t\t\t\t   FILE_LAYOUT_NAME_ENTRY_PRIMARY) != 0);\n\t\t\tnd->parent_ino = name->ParentFileReferenceNumber;\n\t\t\tmemcpy(nd->name, name->FileName, name->FileNameLength);\n\t\t\tnd->name[name->FileNameLength / 2] = L'\\0';\n\t\t\tp = _PTR(p + ALIGN(sizeof(struct ntfs_dentry) +\n\t\t\t\t   name->FileNameLength + sizeof(wchar_t), 8));\n\t\t}\n\t\tif (name->NextNameOffset == 0)\n\t\t\tbreak;\n\t\tname = _PTR(name + name->NextNameOffset);\n\t}\n\treturn p;\n}\n\nstatic u64\nload_starting_lcn(const STREAM_LAYOUT_ENTRY *stream)\n{\n\tconst STREAM_EXTENT_ENTRY *entry;\n\n\tif (stream->ExtentInformationOffset == 0)\n\t\treturn 0;\n\n\tentry = _PTR(stream + stream->ExtentInformationOffset);\n\n\tif (!(entry->Flags & STREAM_EXTENT_ENTRY_AS_RETRIEVAL_POINTERS))\n\t\treturn 0;\n\n\treturn extract_starting_lcn(&entry->ExtentInformation.RetrievalPointers);\n}\n\nstatic void *\nload_stream_information(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode *ni,\n\t\t\tvoid *p)\n{\n\tconst STREAM_LAYOUT_ENTRY *stream =\n\t\t_PTR(file + file->FirstStreamOffset);\n\tconst u32 first_stream_offset = (const u8 *)p - (const u8 *)ni;\n\tfor (;;) {\n\t\tstruct ntfs_stream *ns = p;\n\t\tconst wchar_t *name;\n\t\tsize_t name_nchars;\n\n\t\tif (use_stream(file, stream, &name, &name_nchars)) {\n\t\t\tni->first_stream_offset = first_stream_offset;\n\t\t\tni->num_streams++;\n\t\t\tif (name_nchars == 0)\n\t\t\t\tni->starting_lcn = load_starting_lcn(stream);\n#ifdef _MSC_VER\n\t\t\tns->size = stream->EndOfFile.QuadPart;\n#else\n\t\t\tns->size = stream->EndOfFile;\n#endif\n\t\t\twmemcpy(ns->name, name, name_nchars);\n\t\t\tns->name[name_nchars] = L'\\0';\n\t\t\tp = _PTR(p + ALIGN(sizeof(struct ntfs_stream) +\n\t\t\t\t   (name_nchars + 1) * sizeof(wchar_t), 8));\n\t\t}\n\t\tif (stream->NextStreamOffset == 0)\n\t\t\tbreak;\n\t\tstream = _PTR(stream + stream->NextStreamOffset);\n\t}\n\treturn p;\n}\n\n/* Process the information for a file given by FSCTL_QUERY_FILE_LAYOUT.  */\nstatic int\nload_one_file(const FILE_LAYOUT_ENTRY *file, struct ntfs_inode_map *inode_map)\n{\n\tconst FILE_LAYOUT_INFO_ENTRY *info =\n\t\t_PTR(file + file->ExtraInfoOffset);\n\tsize_t inode_size;\n\tstruct ntfs_inode *ni;\n\tsize_t n;\n\tint ret;\n\tvoid *p;\n\tu32 special_streams = 0;\n\n\tinode_size = ALIGN(sizeof(struct ntfs_inode), 8);\n\n\t/* The root file should have no names, and all other files should have\n\t * at least one name.  But just in case, we ignore the names of the root\n\t * file, and we ignore any non-root file with no names.  */\n\tif (!NTFS_IS_ROOT_FILE(file->FileReferenceNumber)) {\n\t\tif (file->FirstNameOffset == 0)\n\t\t\treturn 0;\n\t\tret = validate_names_and_compute_total_length(file, &n);\n\t\tif (ret)\n\t\t\treturn ret;\n\t\tinode_size += n;\n\t}\n\n\tif (file_has_streams(file)) {\n\t\tret = validate_streams_and_compute_total_length(file, &n,\n\t\t\t\t\t\t\t\t&special_streams);\n\t\tif (ret)\n\t\t\treturn ret;\n\t\tinode_size += n;\n\t}\n\n\t/* To save memory, we allocate the ntfs_dentry's and ntfs_stream's in\n\t * the same memory block as their ntfs_inode.  */\n\tni = CALLOC(1, inode_size);\n\tif (!ni)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\tni->ino = file->FileReferenceNumber;\n\tni->attributes = info->BasicInformation.FileAttributes;\n#ifdef _MSC_VER\n\tni->creation_time = info->BasicInformation.CreationTime.QuadPart;\n\tni->last_write_time = info->BasicInformation.LastWriteTime.QuadPart;\n\tni->last_access_time = info->BasicInformation.LastAccessTime.QuadPart;\n#else\n\tni->creation_time = info->BasicInformation.CreationTime;\n\tni->last_write_time = info->BasicInformation.LastWriteTime;\n\tni->last_access_time = info->BasicInformation.LastAccessTime;\n#endif\n\tni->security_id = info->SecurityId;\n\tni->special_streams = special_streams;\n\n\tp = FIRST_DENTRY(ni);\n\n\tif (!NTFS_IS_ROOT_FILE(file->FileReferenceNumber))\n\t\tp = load_name_information(file, ni, p);\n\n\tif (file_has_streams(file))\n\t\tp = load_stream_information(file, ni, p);\n\n\twimlib_assert((u8 *)p - (u8 *)ni == inode_size);\n\n\tntfs_inode_map_add_inode(inode_map, ni);\n\treturn 0;\n}\n\n/*\n * Quickly find all files on an NTFS volume by using FSCTL_QUERY_FILE_LAYOUT to\n * scan the MFT.  The NTFS volume is specified by the NT namespace path @path.\n * For each file, allocate an 'ntfs_inode' structure for each file and add it to\n * 'inode_map' keyed by inode number.  Include NTFS special files such as\n * $Bitmap (they will be removed later).\n */\nstatic int\nload_files_from_mft(const wchar_t *path, struct ntfs_inode_map *inode_map)\n{\n\tHANDLE h = NULL;\n\tQUERY_FILE_LAYOUT_INPUT in = (QUERY_FILE_LAYOUT_INPUT) {\n\t\t.NumberOfPairs = 0,\n\t\t.Flags = QUERY_FILE_LAYOUT_RESTART |\n\t\t\t QUERY_FILE_LAYOUT_INCLUDE_NAMES |\n\t\t\t QUERY_FILE_LAYOUT_INCLUDE_STREAMS |\n\t\t\t QUERY_FILE_LAYOUT_INCLUDE_EXTENTS |\n\t\t\t QUERY_FILE_LAYOUT_INCLUDE_EXTRA_INFO |\n\t\t\t QUERY_FILE_LAYOUT_INCLUDE_STREAMS_WITH_NO_CLUSTERS_ALLOCATED,\n\t\t.FilterType = QUERY_FILE_LAYOUT_FILTER_TYPE_NONE,\n\t};\n\tsize_t outsize = 32768;\n\tQUERY_FILE_LAYOUT_OUTPUT *out = NULL;\n\tint ret;\n\tNTSTATUS status;\n\n\tstatus = winnt_open(path, wcslen(path),\n\t\t\t    FILE_READ_DATA | FILE_READ_ATTRIBUTES, &h);\n\tif (!NT_SUCCESS(status)) {\n\t\tret = -1; /* Silently try standard recursive scan instead  */\n\t\tgoto out;\n\t}\n\n\tfor (;;) {\n\t\t/* Allocate a buffer for the output of the ioctl.  */\n\t\tout = MALLOC(outsize);\n\t\tif (!out) {\n\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\tgoto out;\n\t\t}\n\n\t\t/* Execute FSCTL_QUERY_FILE_LAYOUT until it fails.  */\n\t\twhile (NT_SUCCESS(status = winnt_fsctl(h,\n\t\t\t\t\t\t       FSCTL_QUERY_FILE_LAYOUT,\n\t\t\t\t\t\t       &in, sizeof(in),\n\t\t\t\t\t\t       out, outsize, NULL)))\n\t\t{\n\t\t\tconst FILE_LAYOUT_ENTRY *file =\n\t\t\t\t_PTR(out + out->FirstFileOffset);\n\t\t\tfor (;;) {\n\t\t\t\tret = load_one_file(file, inode_map);\n\t\t\t\tif (ret)\n\t\t\t\t\tgoto out;\n\t\t\t\tif (file->NextFileOffset == 0)\n\t\t\t\t\tbreak;\n\t\t\t\tfile = _PTR(file + file->NextFileOffset);\n\t\t\t}\n\t\t\tin.Flags &= ~QUERY_FILE_LAYOUT_RESTART;\n\t\t}\n\n\t\t/* Enlarge the buffer if needed.  */\n\t\tif (status != STATUS_BUFFER_TOO_SMALL)\n\t\t\tbreak;\n\t\tFREE(out);\n\t\toutsize *= 2;\n\t}\n\n\t/* Normally, FSCTL_QUERY_FILE_LAYOUT fails with STATUS_END_OF_FILE after\n\t * all files have been enumerated.  */\n\tif (status != STATUS_END_OF_FILE) {\n\t\tif (status == STATUS_INVALID_DEVICE_REQUEST /* old OS */ ||\n\t\t    status == STATUS_NOT_SUPPORTED /* Samba volume, WinXP */ ||\n\t\t    status == STATUS_INVALID_PARAMETER /* not root directory */ )\n\t\t{\n\t\t\t/* Silently try standard recursive scan instead  */\n\t\t\tret = -1;\n\t\t} else {\n\t\t\twinnt_error(status,\n\t\t\t\t    L\"Error enumerating files on volume \\\"%ls\\\"\",\n\t\t\t\t    path);\n\t\t\t/* Try standard recursive scan instead  */\n\t\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\t}\n\t\tgoto out;\n\t}\n\tret = 0;\nout:\n\tFREE(out);\n\tNtClose(h);\n\treturn ret;\n}\n\n/* Build the list of child dentries for each inode in @map.  This is done by\n * iterating through each name of each inode and adding it to its parent's\n * children list.  Note that every name should have a parent, i.e. should belong\n * to some directory.  The root directory does not have any names.  */\nstatic int\nbuild_children_lists(struct ntfs_inode_map *map, struct ntfs_inode **root_ret)\n{\n\tstruct ntfs_inode *ni;\n\n\tavl_tree_for_each_in_order(ni, map->root, struct ntfs_inode, index_node)\n\t{\n\t\tstruct ntfs_dentry *nd;\n\t\tu32 n;\n\n\t\tif (NTFS_IS_ROOT_FILE(ni->ino)) {\n\t\t\t*root_ret = ni;\n\t\t\tcontinue;\n\t\t}\n\n\t\tn = ni->num_aliases;\n\t\tnd = FIRST_DENTRY(ni);\n\t\tfor (;;) {\n\t\t\tstruct ntfs_inode *parent;\n\n\t\t\tparent = ntfs_inode_map_lookup(map, nd->parent_ino);\n\t\t\tif (unlikely(!parent)) {\n\t\t\t\tERROR(\"Parent inode 0x%016\"PRIx64\" of\"\n\t\t\t\t      \"directory entry \\\"%ls\\\" (inode \"\n\t\t\t\t      \"0x%016\"PRIx64\") was missing from the \"\n\t\t\t\t      \"MFT listing!\",\n\t\t\t\t      nd->parent_ino, nd->name, ni->ino);\n\t\t\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t\t\t}\n\t\t\tnd->next_child = parent->first_child;\n\t\t\tparent->first_child = nd;\n\t\t\tif (!--n)\n\t\t\t\tbreak;\n\t\t\tnd = NEXT_DENTRY(nd);\n\t\t}\n\t}\n\treturn 0;\n}\n\nstruct security_map_node {\n\tstruct avl_tree_node index_node;\n\tu32 disk_security_id;\n\tu32 wim_security_id;\n};\n\n/* Map from disk security IDs to WIM security IDs  */\nstruct security_map {\n\tstruct avl_tree_node *root;\n};\n\n#define SECURITY_MAP_NODE(node)\t\t\t\t\\\n\tavl_tree_entry((node), struct security_map_node, index_node)\n\nstatic int\n_avl_cmp_security_map_nodes(const struct avl_tree_node *node1,\n\t\t\t    const struct avl_tree_node *node2)\n{\n\treturn cmp_u32(SECURITY_MAP_NODE(node1)->disk_security_id,\n\t\t       SECURITY_MAP_NODE(node2)->disk_security_id);\n}\n\nstatic s32\nsecurity_map_lookup(struct security_map *map, u32 disk_security_id)\n{\n\tstruct security_map_node tmp;\n\tconst struct avl_tree_node *res;\n\n\tif (disk_security_id == 0)  /* No on-disk security ID; uncacheable  */\n\t\treturn -1;\n\n\ttmp.disk_security_id = disk_security_id;\n\tres = avl_tree_lookup_node(map->root, &tmp.index_node,\n\t\t\t\t   _avl_cmp_security_map_nodes);\n\tif (!res)\n\t\treturn -1;\n\treturn SECURITY_MAP_NODE(res)->wim_security_id;\n}\n\nstatic int\nsecurity_map_insert(struct security_map *map, u32 disk_security_id,\n\t\t    u32 wim_security_id)\n{\n\tstruct security_map_node *node;\n\n\tif (disk_security_id == 0)  /* No on-disk security ID; uncacheable  */\n\t\treturn 0;\n\n\tnode = MALLOC(sizeof(*node));\n\tif (!node)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\tnode->disk_security_id = disk_security_id;\n\tnode->wim_security_id = wim_security_id;\n\tavl_tree_insert(&map->root, &node->index_node,\n\t\t\t_avl_cmp_security_map_nodes);\n\treturn 0;\n}\n\nstatic void\nsecurity_map_destroy(struct security_map *map)\n{\n\tstruct security_map_node *node;\n\n\tavl_tree_for_each_in_postorder(node, map->root,\n\t\t\t\t       struct security_map_node, index_node)\n\t\tFREE(node);\n}\n\n/*\n * Turn our temporary NTFS structures into the final WIM structures:\n *\n *\tntfs_inode\t=> wim_inode\n *\tntfs_dentry\t=> wim_dentry\n *\tntfs_stream\t=> wim_inode_stream\n *\n * This also handles things such as exclusions and issuing progress messages.\n * It's similar to winnt_build_dentry_tree(), but this is much faster because\n * almost all information we need is already loaded in memory in the ntfs_*\n * structures.  However, in some cases we still fall back to\n * winnt_build_dentry_tree() and/or opening the file.\n */\nstatic int\ngenerate_wim_structures_recursive(struct wim_dentry **root_ret,\n\t\t\t\t  const wchar_t *filename, bool is_primary_name,\n\t\t\t\t  struct ntfs_inode *ni,\n\t\t\t\t  struct winnt_scan_ctx *ctx,\n\t\t\t\t  struct ntfs_inode_map *inode_map,\n\t\t\t\t  struct security_map *security_map)\n{\n\tint ret = 0;\n\tstruct wim_dentry *root = NULL;\n\tstruct wim_inode *inode = NULL;\n\tconst struct ntfs_stream *ns;\n\n\t/* Completely ignore NTFS special files.  */\n\tif (NTFS_IS_SPECIAL_FILE(ni->ino))\n\t\tgoto out;\n\n\t/* Fall back to the standard scan for unhandled cases.  Reparse points,\n\t * in particular, can't be properly handled here because a commonly used\n\t * filter driver (WOF) hides reparse points from regular filesystem APIs\n\t * but not from FSCTL_QUERY_FILE_LAYOUT.  */\n\tif (ni->attributes & (FILE_ATTRIBUTE_REPARSE_POINT |\n\t\t\t      FILE_ATTRIBUTE_ENCRYPTED) ||\n\t    ni->special_streams != 0)\n\t{\n\t\tret = winnt_build_dentry_tree(&root, NULL,\n\t\t\t\t\t      ctx->params->cur_path,\n\t\t\t\t\t      ctx->params->cur_path_nchars,\n\t\t\t\t\t      filename, ctx, false);\n\t\tif (ret) /* Error? */\n\t\t\tgoto out;\n\t\tif (!root) /* Excluded? */\n\t\t\tgoto out_progress;\n\t\tinode = root->d_inode;\n\t\tgoto process_children;\n\t}\n\n\t/* Test for exclusion based on path.  */\n\tret = try_exclude(ctx->params);\n\tif (unlikely(ret < 0)) /* Excluded? */\n\t\tgoto out_progress;\n\tif (unlikely(ret > 0)) /* Error? */\n\t\tgoto out;\n\n\t/* Create the WIM dentry and possibly a new WIM inode  */\n\tret = inode_table_new_dentry(ctx->params->inode_table, filename,\n\t\t\t\t     ni->ino, ctx->params->capture_root_dev,\n\t\t\t\t     false, &root);\n\tif (ret)\n\t\tgoto out;\n\n\tinode = root->d_inode;\n\n\t/* Set the short name if needed.  */\n\tif (is_primary_name && *ni->short_name) {\n\t\tsize_t nbytes = wcslen(ni->short_name) * sizeof(wchar_t);\n\t\troot->d_short_name = memdup(ni->short_name,\n\t\t\t\t\t    nbytes + sizeof(wchar_t));\n\t\tif (!root->d_short_name) {\n\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\tgoto out;\n\t\t}\n\t\troot->d_short_name_nbytes = nbytes;\n\t}\n\n\tif (inode->i_nlink > 1) /* Already seen this inode?  */\n\t\tgoto out_progress;\n\n\t/* The file attributes and timestamps were cached from the MFT.  */\n\tinode->i_attributes = ni->attributes;\n\tinode->i_creation_time = ni->creation_time;\n\tinode->i_last_write_time = ni->last_write_time;\n\tinode->i_last_access_time = ni->last_access_time;\n\n\t/* Set the security descriptor if needed.  */\n\tif (!(ctx->params->add_flags & WIMLIB_ADD_FLAG_NO_ACLS)) {\n\t\t/* Look up the WIM security ID that corresponds to the on-disk\n\t\t * security ID.  */\n\t\ts32 wim_security_id =\n\t\t\tsecurity_map_lookup(security_map, ni->security_id);\n\t\tif (likely(wim_security_id >= 0)) {\n\t\t\t/* The mapping for this security ID is already cached.*/\n\t\t\tinode->i_security_id = wim_security_id;\n\t\t} else {\n\t\t\tHANDLE h;\n\t\t\tNTSTATUS status;\n\n\t\t\t/* Create a mapping for this security ID and insert it\n\t\t\t * into the security map.  */\n\n\t\t\tstatus = winnt_open(ctx->params->cur_path,\n\t\t\t\t\t    ctx->params->cur_path_nchars,\n\t\t\t\t\t    READ_CONTROL |\n\t\t\t\t\t\tACCESS_SYSTEM_SECURITY, &h);\n\t\t\tif (!NT_SUCCESS(status)) {\n\t\t\t\twinnt_error(status, L\"Can't open \\\"%ls\\\" to \"\n\t\t\t\t\t    \"read security descriptor\",\n\t\t\t\t\t    printable_path(ctx));\n\t\t\t\tret = WIMLIB_ERR_OPEN;\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tret = winnt_load_security_descriptor(h, inode, ctx);\n\t\t\tNtClose(h);\n\t\t\tif (ret)\n\t\t\t\tgoto out;\n\n\t\t\tret = security_map_insert(security_map, ni->security_id,\n\t\t\t\t\t\t  inode->i_security_id);\n\t\t\tif (ret)\n\t\t\t\tgoto out;\n\t\t}\n\t}\n\n\t/* Add data streams based on the cached information from the MFT.  */\n\tns = FIRST_STREAM(ni);\n\tfor (u32 i = 0; i < ni->num_streams; i++) {\n\t\tstruct windows_file *windows_file;\n\n\t\t/* Reference the stream by path if it's a named data stream, or\n\t\t * if the volume doesn't support \"open by file ID\", or if the\n\t\t * application hasn't explicitly opted in to \"open by file ID\".\n\t\t * Otherwise, only save the inode number (file ID).  */\n\t\tif (*ns->name ||\n\t\t    !(ctx->vol_flags & FILE_SUPPORTS_OPEN_BY_FILE_ID) ||\n\t\t    !(ctx->params->add_flags & WIMLIB_ADD_FLAG_FILE_PATHS_UNNEEDED))\n\t\t{\n\t\t\twindows_file = alloc_windows_file(ctx->params->cur_path,\n\t\t\t\t\t\t\t  ctx->params->cur_path_nchars,\n\t\t\t\t\t\t\t  ns->name,\n\t\t\t\t\t\t\t  wcslen(ns->name),\n\t\t\t\t\t\t\t  ctx->snapshot,\n\t\t\t\t\t\t\t  false);\n\t\t} else {\n\t\t\twindows_file = alloc_windows_file_for_file_id(ni->ino,\n\t\t\t\t\t\t\t\t      ctx->params->cur_path,\n\t\t\t\t\t\t\t\t      ctx->params->root_path_nchars,\n\t\t\t\t\t\t\t\t      ctx->snapshot);\n\t\t}\n\n\t\tret = add_stream(inode, windows_file, ns->size,\n\t\t\t\t STREAM_TYPE_DATA, ns->name,\n\t\t\t\t ctx->params->unhashed_blobs);\n\t\tif (ret)\n\t\t\tgoto out;\n\t\tns = NEXT_STREAM(ns);\n\t}\n\n\tset_sort_key(inode, ni->starting_lcn);\n\n\t/* If processing a directory, then recurse to its children.  In this\n\t * version there is no need to go to disk, as we already have the list\n\t * of children cached from the MFT.  */\nprocess_children:\n\tif (inode_is_directory(inode)) {\n\t\tconst struct ntfs_dentry *nd = ni->first_child;\n\n\t\twhile (nd != NULL) {\n\t\t\tsize_t orig_path_nchars;\n\t\t\tstruct wim_dentry *child;\n\t\t\tconst struct ntfs_dentry *next = nd->next_child;\n\n\t\t\tret = WIMLIB_ERR_NOMEM;\n\t\t\tif (!pathbuf_append_name(ctx->params, nd->name,\n\t\t\t\t\t\t wcslen(nd->name),\n\t\t\t\t\t\t &orig_path_nchars))\n\t\t\t\tgoto out;\n\n\t\t\tret = generate_wim_structures_recursive(\n\t\t\t\t\t&child,\n\t\t\t\t\tnd->name,\n\t\t\t\t\tnd->is_primary,\n\t\t\t\t\t_PTR(nd - nd->offset_from_inode),\n\t\t\t\t\tctx,\n\t\t\t\t\tinode_map,\n\t\t\t\t\tsecurity_map);\n\n\t\t\tpathbuf_truncate(ctx->params, orig_path_nchars);\n\n\t\t\tif (ret)\n\t\t\t\tgoto out;\n\n\t\t\tattach_scanned_tree(root, child, ctx->params->blob_table);\n\t\t\tnd = next;\n\t\t}\n\t}\n\nout_progress:\n\tif (likely(root))\n\t\tret = do_scan_progress(ctx->params, WIMLIB_SCAN_DENTRY_OK, inode);\n\telse\n\t\tret = do_scan_progress(ctx->params, WIMLIB_SCAN_DENTRY_EXCLUDED, NULL);\nout:\n\tif (--ni->num_aliases == 0) {\n\t\t/* Memory usage optimization: when we don't need the ntfs_inode\n\t\t * (and its names and streams) anymore, free it.  */\n\t\tntfs_inode_map_remove(inode_map, ni);\n\t}\n\tif (unlikely(ret)) {\n\t\tfree_dentry_tree(root, ctx->params->blob_table);\n\t\troot = NULL;\n\t}\n\t*root_ret = root;\n\treturn ret;\n}\n\nstatic int\nwinnt_build_dentry_tree_fast(struct wim_dentry **root_ret,\n\t\t\t     struct winnt_scan_ctx *ctx)\n{\n\tstruct ntfs_inode_map inode_map = { .root = NULL };\n\tstruct security_map security_map = { .root = NULL };\n\tstruct ntfs_inode *root = NULL;\n\twchar_t *path = ctx->params->cur_path;\n\tsize_t path_nchars = ctx->params->cur_path_nchars;\n\tbool adjust_path;\n\tint ret;\n\n\tadjust_path = (path[path_nchars - 1] == L'\\\\');\n\tif (adjust_path)\n\t\tpath[path_nchars - 1] = L'\\0';\n\n\tret = load_files_from_mft(path, &inode_map);\n\n\tif (adjust_path)\n\t\tpath[path_nchars - 1] = L'\\\\';\n\n\tif (ret)\n\t\tgoto out;\n\n\tret = build_children_lists(&inode_map, &root);\n\tif (ret)\n\t\tgoto out;\n\n\tif (!root) {\n\t\tERROR(\"The MFT listing for volume \\\"%ls\\\" did not include a \"\n\t\t      \"root directory!\", path);\n\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\tgoto out;\n\t}\n\n\troot->num_aliases = 1;\n\n\tret = generate_wim_structures_recursive(root_ret, L\"\", false, root, ctx,\n\t\t\t\t\t\t&inode_map, &security_map);\nout:\n\tntfs_inode_map_destroy(&inode_map);\n\tsecurity_map_destroy(&security_map);\n\treturn ret;\n}\n\n#endif /* ENABLE_FAST_MFT_SCAN */\n\n/*----------------------------------------------------------------------------*\n *                 Entry point for directory tree scans on Windows            *\n *----------------------------------------------------------------------------*/\n\nint\nwin32_build_dentry_tree(struct wim_dentry **root_ret,\n\t\t\tconst wchar_t *root_disk_path,\n\t\t\tstruct scan_params *params)\n{\n\tstruct winnt_scan_ctx ctx = { .params = params };\n\tUNICODE_STRING ntpath;\n\tHANDLE h = NULL;\n\tNTSTATUS status;\n\tint ret;\n\n\tif (params->add_flags & WIMLIB_ADD_FLAG_SNAPSHOT)\n\t\tret = vss_create_snapshot(root_disk_path, &ntpath, &ctx.snapshot);\n\telse\n\t\tret = win32_path_to_nt_path(root_disk_path, &ntpath);\n\n\tif (ret)\n\t\tgoto out;\n\n\tif (ntpath.Length < 4 * sizeof(wchar_t) ||\n\t    wmemcmp(ntpath.Buffer, L\"\\\\??\\\\\", 4))\n\t{\n\t\tERROR(\"\\\"%ls\\\": unrecognized path format\", root_disk_path);\n\t\tret = WIMLIB_ERR_INVALID_PARAM;\n\t} else {\n\t\tret = pathbuf_init(params, ntpath.Buffer);\n\t}\n\tHeapFree(GetProcessHeap(), 0, ntpath.Buffer);\n\tif (ret)\n\t\tgoto out;\n\n\tstatus = winnt_open(params->cur_path, params->cur_path_nchars,\n\t\t\t    FILE_READ_ATTRIBUTES, &h);\n\tif (!NT_SUCCESS(status)) {\n\t\twinnt_error(status, L\"Can't open \\\"%ls\\\"\", root_disk_path);\n\t\tif (status == STATUS_FVE_LOCKED_VOLUME)\n\t\t\tret = WIMLIB_ERR_FVE_LOCKED_VOLUME;\n\t\telse\n\t\t\tret = WIMLIB_ERR_OPEN;\n\t\tgoto out;\n\t}\n\n\tget_volume_information(h, &ctx);\n\n\tNtClose(h);\n\n#ifdef ENABLE_FAST_MFT_SCAN\n\tif (ctx.is_ntfs && !_wgetenv(L\"WIMLIB_DISABLE_QUERY_FILE_LAYOUT\")) {\n\t\tret = winnt_build_dentry_tree_fast(root_ret, &ctx);\n\t\tif (ret >= 0 && ret != WIMLIB_ERR_UNSUPPORTED)\n\t\t\tgoto out;\n\t\tif (ret >= 0) {\n\t\t\tWARNING(\"A problem occurred during the fast MFT scan.\\n\"\n\t\t\t\t\"          Falling back to the standard \"\n\t\t\t\t\"recursive directory tree scan.\");\n\t\t}\n\t}\n#endif\n\tret = winnt_build_dentry_tree(root_ret, NULL, params->cur_path,\n\t\t\t\t      params->cur_path_nchars, L\"\", &ctx, true);\nout:\n\tvss_put_snapshot(ctx.snapshot);\n\tif (ret == 0)\n\t\twinnt_do_scan_warnings(root_disk_path, &ctx);\n\treturn ret;\n}\n\n#endif /* _WIN32 */\n"
  },
  {
    "path": "src/wimlib/win32_common.c",
    "content": "/*\n * win32_common.c - Windows code common to applying and capturing images.\n */\n\n/*\n * Copyright (C) 2013-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef _WIN32\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/win32_common.h\"\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/util.h\"\n#include \"wimlib/win32_vss.h\"\n\nstatic bool\nwin32_modify_privilege(const wchar_t *privilege, bool enable)\n{\n\tHANDLE hToken;\n\tLUID luid;\n\tTOKEN_PRIVILEGES newState = { 0 };\n\tbool ret = FALSE;\n\n\tif (!OpenProcessToken(GetCurrentProcess(),\n\t\t\t      TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,\n\t\t\t      &hToken))\n\t\tgoto out;\n\n\tif (!LookupPrivilegeValue(NULL, privilege, &luid))\n\t\tgoto out_close_handle;\n\n\tnewState.PrivilegeCount = 1;\n\tnewState.Privileges[0].Luid = luid;\n\tnewState.Privileges[0].Attributes = (enable ? SE_PRIVILEGE_ENABLED : 0);\n\tSetLastError(ERROR_SUCCESS);\n\tret = AdjustTokenPrivileges(hToken, FALSE, &newState, 0, NULL, NULL);\n\tif (ret && GetLastError() == ERROR_NOT_ALL_ASSIGNED)\n\t\tret = FALSE;\nout_close_handle:\n\tCloseHandle(hToken);\nout:\n\treturn ret;\n}\n\nstatic bool\nwin32_modify_capture_privileges(bool enable)\n{\n\tbool ok = true;\n\tok &= win32_modify_privilege(SE_BACKUP_NAME, enable);\n\tok &= win32_modify_privilege(SE_SECURITY_NAME, enable);\n\treturn ok;\n}\n\nstatic bool\nwin32_modify_apply_privileges(bool enable)\n{\n\tbool ok = true;\n\tok &= win32_modify_privilege(SE_RESTORE_NAME, enable);\n\tok &= win32_modify_privilege(SE_SECURITY_NAME, enable);\n\tok &= win32_modify_privilege(SE_TAKE_OWNERSHIP_NAME, enable);\n\tok &= win32_modify_privilege(SE_MANAGE_VOLUME_NAME, enable);\n\treturn ok;\n}\n\nstatic void\nwin32_release_capture_and_apply_privileges(void)\n{\n\twin32_modify_capture_privileges(false);\n\twin32_modify_apply_privileges(false);\n}\n\n/* Pointers to dynamically loaded functions  */\n\nNTSTATUS (WINAPI *func_RtlDosPathNameToNtPathName_U_WithStatus)\n\t\t(IN PCWSTR DosName,\n\t\t OUT PUNICODE_STRING NtName,\n\t\t OUT PCWSTR *PartName,\n\t\t OUT PRTL_RELATIVE_NAME_U RelativeName) = NULL;\n\nBOOLEAN (WINAPI *func_RtlDosPathNameToNtPathName_U)\n\t\t(IN PCWSTR DosName,\n\t\t OUT PUNICODE_STRING NtName,\n\t\t OUT PCWSTR* PartName,\n\t\t OUT PRTL_RELATIVE_NAME_U RelativeName) = NULL;\n\nNTSTATUS (WINAPI *func_RtlCreateSystemVolumeInformationFolder)\n\t\t(PCUNICODE_STRING VolumeRootPath) = NULL;\n\nstatic bool acquired_privileges = false;\n\nstatic HMODULE ntdll_handle = NULL;\n\nstatic int\ninit_ntdll(void)\n{\n\tntdll_handle = LoadLibrary(L\"ntdll.dll\");\n\n\tif (!ntdll_handle) {\n\t\tERROR(\"Unable to load ntdll.dll\");\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n\n\tfunc_RtlDosPathNameToNtPathName_U_WithStatus =\n\t\t(void *)GetProcAddress(ntdll_handle,\n\t\t\t\t       \"RtlDosPathNameToNtPathName_U_WithStatus\");\n\n\tfunc_RtlDosPathNameToNtPathName_U =\n\t\t(void*)GetProcAddress(ntdll_handle,\n\t\t\t           \"RtlDosPathNameToNtPathName_U\");\n\n\tfunc_RtlCreateSystemVolumeInformationFolder =\n\t\t(void *)GetProcAddress(ntdll_handle,\n\t\t\t\t       \"RtlCreateSystemVolumeInformationFolder\");\n\n\treturn 0;\n}\n\n/* One-time initialization for Windows capture/apply code.  */\nint\nwin32_global_init(int init_flags)\n{\n\tint ret;\n\n\t/* Try to acquire useful privileges.  */\n\tif (!(init_flags & WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES)) {\n\t\tret = WIMLIB_ERR_INSUFFICIENT_PRIVILEGES;\n\t\tif (!win32_modify_capture_privileges(true))\n\t\t\tif (init_flags & WIMLIB_INIT_FLAG_STRICT_CAPTURE_PRIVILEGES)\n\t\t\t\tgoto out_drop_privs;\n\t\tif (!win32_modify_apply_privileges(true))\n\t\t\tif (init_flags & WIMLIB_INIT_FLAG_STRICT_APPLY_PRIVILEGES)\n\t\t\t\tgoto out_drop_privs;\n\t\tacquired_privileges = true;\n\t}\n\n\tret = init_ntdll();\n\tif (ret)\n\t\tgoto out_drop_privs;\n\n\treturn 0;\n\nout_drop_privs:\n\twin32_release_capture_and_apply_privileges();\n\treturn ret;\n}\n\nvoid\nwin32_global_cleanup(void)\n{\n\tvss_global_cleanup();\n\n\tif (acquired_privileges)\n\t\twin32_release_capture_and_apply_privileges();\n\n\tFreeLibrary(ntdll_handle);\n\tntdll_handle = NULL;\n}\n\n/*\n * Translates a Win32-namespace path into an NT-namespace path.\n *\n * On success, returns 0.  The NT-namespace path will be stored in the\n * UNICODE_STRING structure pointed to by nt_path.  nt_path->Buffer will be set\n * to a new buffer that must later be freed with HeapFree().  (Really\n * RtlHeapFree(), but HeapFree() seems to be the same thing.)\n *\n * On failure, returns WIMLIB_ERR_NOMEM or WIMLIB_ERR_INVALID_PARAM.\n */\nint\nwin32_path_to_nt_path(const wchar_t *win32_path, UNICODE_STRING *nt_path)\n{\n\tNTSTATUS status;\n\n\tif (func_RtlDosPathNameToNtPathName_U_WithStatus) {\n\t\tstatus = (*func_RtlDosPathNameToNtPathName_U_WithStatus)(win32_path,\n\t\t\t\t\t\t\t\t\t nt_path,\n\t\t\t\t\t\t\t\t\t NULL, NULL);\n\t} else if (func_RtlDosPathNameToNtPathName_U) {\n\t\tif ((*func_RtlDosPathNameToNtPathName_U)(win32_path, nt_path, NULL, NULL))\n\t\t\tstatus = STATUS_SUCCESS;\n\t\telse\n\t\t\tstatus = STATUS_NO_MEMORY;\n\t} else {\n\t\twinnt_error(STATUS_UNSUCCESSFUL, L\"RtlDosPathNameToNtPathName_U functions not found\");\n\t\treturn WIMLIB_ERR_RESOURCE_NOT_FOUND;\n\t}\n\n\tif (likely(NT_SUCCESS(status)))\n\t\treturn 0;\n\n\tif (status == STATUS_NO_MEMORY)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\twinnt_error(status, L\"\\\"%ls\\\": invalid path name\", win32_path);\n\treturn WIMLIB_ERR_INVALID_PARAM;\n}\n\nint\nwin32_get_drive_path(const wchar_t *file_path, wchar_t drive_path[7])\n{\n\ttchar *file_abspath;\n\n\tfile_abspath = realpath(file_path, NULL);\n\tif (!file_abspath)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\tif (file_abspath[0] == L'\\0' || file_abspath[1] != L':') {\n\t\tERROR(\"\\\"%ls\\\": Path format not recognized\", file_abspath);\n\t\tFREE(file_abspath);\n\t\treturn WIMLIB_ERR_UNSUPPORTED;\n\t}\n\n\twsprintf(drive_path, L\"\\\\\\\\.\\\\%lc:\", file_abspath[0]);\n\tFREE(file_abspath);\n\treturn 0;\n}\n\n/* Try to attach an instance of the Windows Overlay Filesystem filter driver to\n * the specified drive (such as C:)  */\nbool\nwin32_try_to_attach_wof(const wchar_t *drive)\n{\n\tHMODULE fltlib;\n\tbool retval = false;\n\n\t/* Use FilterAttach() from Fltlib.dll.  */\n\n\tfltlib = LoadLibrary(L\"Fltlib.dll\");\n\n\tif (!fltlib) {\n\t\tWARNING(\"Failed to load Fltlib.dll\");\n\t\treturn retval;\n\t}\n\n\tHRESULT (WINAPI *func_FilterAttach)(LPCWSTR lpFilterName,\n\t\t\t\t\t    LPCWSTR lpVolumeName,\n\t\t\t\t\t    LPCWSTR lpInstanceName,\n\t\t\t\t\t    DWORD dwCreatedInstanceNameLength,\n\t\t\t\t\t    LPWSTR lpCreatedInstanceName);\n\n\tfunc_FilterAttach = (void *)GetProcAddress(fltlib, \"FilterAttach\");\n\n\tif (func_FilterAttach) {\n\t\tHRESULT res;\n\n\t\tres = (*func_FilterAttach)(L\"wof\", drive, NULL, 0, NULL);\n\n\t\tif (res != S_OK)\n\t\t\tres = (*func_FilterAttach)(L\"wofadk\", drive, NULL, 0, NULL);\n\n\t\tif (res == S_OK)\n\t\t\tretval = true;\n\t} else {\n\t\tWARNING(\"FilterAttach() does not exist in Fltlib.dll\");\n\t}\n\n\tFreeLibrary(fltlib);\n\n\treturn retval;\n}\n\n\nstatic void\nwindows_msg(u32 code, const wchar_t *format, va_list va,\n\t    bool is_ntstatus, bool is_error)\n{\n\twchar_t _buf[STACK_MAX / 8] = { 0 };\n\twchar_t *buf = _buf;\n\tsize_t buflen = ARRAY_LEN(_buf);\n\tsize_t ret;\n\tsize_t n;\n\tva_list va2;\n\nretry:\n\tva_copy(va2, va);\n\tn = vsnwprintf(buf, buflen, format, va2);\n\tva_end(va2);\n\n\tif (n >= buflen)\n\t\tgoto realloc;\n\n\tn += snwprintf(&buf[n], buflen - n,\n\t\t       (is_ntstatus ?\n\t\t\tL\" (status=%08\"PRIx32\"): \" :\n\t\t\tL\" (err=%\"PRIu32\"): \"),\n\t\t       code);\n\n\tif (n >= buflen)\n\t\tgoto realloc;\n\n\tret = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |\n\t\t\t\tFORMAT_MESSAGE_IGNORE_INSERTS |\n\t\t\t\t(is_ntstatus ? FORMAT_MESSAGE_FROM_HMODULE : 0),\n\t\t\t    (is_ntstatus ? ntdll_handle : NULL),\n\t\t\t    code,\n\t\t\t    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),\n\t\t\t    &buf[n],\n\t\t\t    buflen - n,\n\t\t\t    NULL);\n\tn += ret;\n\n\tif (n >= buflen || (ret == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER))\n\t\tgoto realloc;\n\n        if (buf[n - 1] == L'\\n')\n\t\tbuf[--n] = L'\\0';\n        if (buf[n - 1] == L'\\r')\n\t\tbuf[--n] = L'\\0';\n        if (buf[n - 1] == L'.')\n\t\tbuf[--n] = L'\\0';\n\n\tif (is_error)\n\t\tERROR(\"%ls\", buf);\n\telse\n\t\tWARNING(\"%ls\", buf);\n\tif (buf != _buf)\n\t\tFREE(buf);\n\treturn;\n\nrealloc:\n\tif (buf != _buf)\n\t\tFREE(buf);\n\tbuflen *= 2;\n\tbuf = MALLOC(buflen * sizeof(buf[0]));\n\tif (buf)\n\t\tgoto retry;\n\tERROR(\"Ran out of memory while building error message!!!\");\n}\n\nvoid\nwin32_warning(DWORD err, const wchar_t *format, ...)\n{\n\tva_list va;\n\n\tva_start(va, format);\n\twindows_msg(err, format, va, false, false);\n\tva_end(va);\n}\n\nvoid\nwin32_error(DWORD err, const wchar_t *format, ...)\n{\n\tva_list va;\n\n\tva_start(va, format);\n\twindows_msg(err, format, va, false, true);\n\tva_end(va);\n}\n\nvoid\nwinnt_warning(NTSTATUS status, const wchar_t *format, ...)\n{\n\tva_list va;\n\n\tva_start(va, format);\n\twindows_msg(status, format, va, true, false);\n\tva_end(va);\n}\n\nvoid\nwinnt_error(NTSTATUS status, const wchar_t *format, ...)\n{\n\tva_list va;\n\n\tva_start(va, format);\n\twindows_msg(status, format, va, true, true);\n\tva_end(va);\n}\n\n/*\n * Synchronously execute a filesystem control method.  This is a wrapper around\n * NtFsControlFile() that handles STATUS_PENDING.  Note that SYNCHRONIZE\n * permission is, in general, required on the handle.\n */\nNTSTATUS\nwinnt_fsctl(HANDLE h, u32 code, const void* in, u32 in_size,\n\tvoid* out, u32 out_size_avail, u32* actual_out_size_ret)\n{\n\tIO_STATUS_BLOCK iosb;\n\tNTSTATUS status;\n\n\tstatus = NtFsControlFile(h, NULL, NULL, NULL, &iosb, code,\n\t\t(void*)in, in_size, out, out_size_avail);\n\tif (status == STATUS_PENDING) {\n\t\t/* Beware: this case is often encountered with remote\n\t\t * filesystems, but rarely with local filesystems.  */\n\n\t\tstatus = NtWaitForSingleObject(h, FALSE, NULL);\n\t\tif (NT_SUCCESS(status)) {\n\t\t\tstatus = iosb.Status;\n\t\t} else {\n\t\t\t/* We shouldn't be issuing ioctls on a handle to which\n\t\t\t * we don't have SYNCHRONIZE access.  Otherwise we have\n\t\t\t * no way to wait for them to complete.  */\n\t\t\twimlib_assert(status != STATUS_ACCESS_DENIED);\n\t\t}\n\t}\n\n\tif (NT_SUCCESS(status) && actual_out_size_ret != NULL)\n\t\t*actual_out_size_ret = (u32)iosb.Information;\n\n\treturn status;\n}\n\n#endif /* _WIN32 */\n"
  },
  {
    "path": "src/wimlib/win32_replacements.c",
    "content": "/*\n * win32_replacements.c - Replacements for various functions not available on\n * Windows, such as fsync().\n */\n\n/*\n * Copyright (C) 2013-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef _WIN32\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <errno.h>\n#include <io.h>\t/* for _get_osfhandle()  */\n#include <fcntl.h>\n\n#include \"wimlib/win32_common.h\"\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/glob.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/timestamp.h\"\n#include \"wimlib/util.h\"\n\nstatic int\nwin32_error_to_errno(DWORD err_code)\n{\n\t/* This mapping is that used in Cygwin.\n\t * Some of these choices are arbitrary. */\n\tswitch (err_code) {\n\tcase ERROR_ACCESS_DENIED:\n\t\treturn EACCES;\n\tcase ERROR_ACTIVE_CONNECTIONS:\n\t\treturn EAGAIN;\n\tcase ERROR_ALREADY_EXISTS:\n\t\treturn EEXIST;\n\tcase ERROR_BAD_DEVICE:\n\t\treturn ENODEV;\n\tcase ERROR_BAD_EXE_FORMAT:\n\t\treturn ENOEXEC;\n\tcase ERROR_BAD_NETPATH:\n\t\treturn ENOENT;\n\tcase ERROR_BAD_NET_NAME:\n\t\treturn ENOENT;\n\tcase ERROR_BAD_NET_RESP:\n\t\treturn ENOSYS;\n\tcase ERROR_BAD_PATHNAME:\n\t\treturn ENOENT;\n\tcase ERROR_BAD_PIPE:\n\t\treturn EINVAL;\n\tcase ERROR_BAD_UNIT:\n\t\treturn ENODEV;\n\tcase ERROR_BAD_USERNAME:\n\t\treturn EINVAL;\n\tcase ERROR_BEGINNING_OF_MEDIA:\n\t\treturn EIO;\n\tcase ERROR_BROKEN_PIPE:\n\t\treturn EPIPE;\n\tcase ERROR_BUSY:\n\t\treturn EBUSY;\n\tcase ERROR_BUS_RESET:\n\t\treturn EIO;\n\tcase ERROR_CALL_NOT_IMPLEMENTED:\n\t\treturn ENOSYS;\n\tcase ERROR_CANNOT_MAKE:\n\t\treturn EPERM;\n\tcase ERROR_CHILD_NOT_COMPLETE:\n\t\treturn EBUSY;\n\tcase ERROR_COMMITMENT_LIMIT:\n\t\treturn EAGAIN;\n\tcase ERROR_CRC:\n\t\treturn EIO;\n\tcase ERROR_DEVICE_DOOR_OPEN:\n\t\treturn EIO;\n\tcase ERROR_DEVICE_IN_USE:\n\t\treturn EAGAIN;\n\tcase ERROR_DEVICE_REQUIRES_CLEANING:\n\t\treturn EIO;\n\tcase ERROR_DIRECTORY:\n\t\treturn ENOTDIR;\n\tcase ERROR_DIR_NOT_EMPTY:\n\t\treturn ENOTEMPTY;\n\tcase ERROR_DISK_CORRUPT:\n\t\treturn EIO;\n\tcase ERROR_DISK_FULL:\n\t\treturn ENOSPC;\n#ifdef ENOTUNIQ\n\tcase ERROR_DUP_NAME:\n\t\treturn ENOTUNIQ;\n#endif\n\tcase ERROR_EAS_DIDNT_FIT:\n\t\treturn ENOSPC;\n#ifdef ENOTSUP\n\tcase ERROR_EAS_NOT_SUPPORTED:\n\t\treturn ENOTSUP;\n#endif\n\tcase ERROR_EA_LIST_INCONSISTENT:\n\t\treturn EINVAL;\n\tcase ERROR_EA_TABLE_FULL:\n\t\treturn ENOSPC;\n\tcase ERROR_END_OF_MEDIA:\n\t\treturn ENOSPC;\n\tcase ERROR_EOM_OVERFLOW:\n\t\treturn EIO;\n\tcase ERROR_EXE_MACHINE_TYPE_MISMATCH:\n\t\treturn ENOEXEC;\n\tcase ERROR_EXE_MARKED_INVALID:\n\t\treturn ENOEXEC;\n\tcase ERROR_FILEMARK_DETECTED:\n\t\treturn EIO;\n\tcase ERROR_FILENAME_EXCED_RANGE:\n\t\treturn ENAMETOOLONG;\n\tcase ERROR_FILE_CORRUPT:\n\t\treturn EEXIST;\n\tcase ERROR_FILE_EXISTS:\n\t\treturn EEXIST;\n\tcase ERROR_FILE_INVALID:\n\t\treturn ENXIO;\n\tcase ERROR_FILE_NOT_FOUND:\n\t\treturn ENOENT;\n\tcase ERROR_HANDLE_DISK_FULL:\n\t\treturn ENOSPC;\n#ifdef ENODATA\n\tcase ERROR_HANDLE_EOF:\n\t\treturn ENODATA;\n#endif\n\tcase ERROR_INVALID_ADDRESS:\n\t\treturn EINVAL;\n\tcase ERROR_INVALID_AT_INTERRUPT_TIME:\n\t\treturn EINTR;\n\tcase ERROR_INVALID_BLOCK_LENGTH:\n\t\treturn EIO;\n\tcase ERROR_INVALID_DATA:\n\t\treturn EINVAL;\n\tcase ERROR_INVALID_DRIVE:\n\t\treturn ENODEV;\n\tcase ERROR_INVALID_EA_NAME:\n\t\treturn EINVAL;\n\tcase ERROR_INVALID_EXE_SIGNATURE:\n\t\treturn ENOEXEC;\n#ifdef EBADRQC\n\tcase ERROR_INVALID_FUNCTION:\n\t\treturn EBADRQC;\n#endif\n\tcase ERROR_INVALID_HANDLE:\n\t\treturn EBADF;\n\tcase ERROR_INVALID_NAME:\n\t\treturn ENOENT;\n\tcase ERROR_INVALID_PARAMETER:\n\t\treturn EINVAL;\n\tcase ERROR_INVALID_SIGNAL_NUMBER:\n\t\treturn EINVAL;\n\tcase ERROR_IOPL_NOT_ENABLED:\n\t\treturn ENOEXEC;\n\tcase ERROR_IO_DEVICE:\n\t\treturn EIO;\n\tcase ERROR_IO_INCOMPLETE:\n\t\treturn EAGAIN;\n\tcase ERROR_IO_PENDING:\n\t\treturn EAGAIN;\n\tcase ERROR_LOCK_VIOLATION:\n\t\treturn EBUSY;\n\tcase ERROR_MAX_THRDS_REACHED:\n\t\treturn EAGAIN;\n\tcase ERROR_META_EXPANSION_TOO_LONG:\n\t\treturn EINVAL;\n\tcase ERROR_MOD_NOT_FOUND:\n\t\treturn ENOENT;\n#ifdef EMSGSIZE\n\tcase ERROR_MORE_DATA:\n\t\treturn EMSGSIZE;\n#endif\n\tcase ERROR_NEGATIVE_SEEK:\n\t\treturn EINVAL;\n\tcase ERROR_NETNAME_DELETED:\n\t\treturn ENOENT;\n\tcase ERROR_NOACCESS:\n\t\treturn EFAULT;\n\tcase ERROR_NONE_MAPPED:\n\t\treturn EINVAL;\n\tcase ERROR_NONPAGED_SYSTEM_RESOURCES:\n\t\treturn EAGAIN;\n#ifdef ENOLINK\n\tcase ERROR_NOT_CONNECTED:\n\t\treturn ENOLINK;\n#endif\n\tcase ERROR_NOT_ENOUGH_MEMORY:\n\t\treturn ENOMEM;\n\tcase ERROR_NOT_OWNER:\n\t\treturn EPERM;\n#ifdef ENOMEDIUM\n\tcase ERROR_NOT_READY:\n\t\treturn ENOMEDIUM;\n#endif\n\tcase ERROR_NOT_SAME_DEVICE:\n\t\treturn EXDEV;\n\tcase ERROR_NOT_SUPPORTED:\n\t\treturn ENOSYS;\n\tcase ERROR_NO_DATA:\n\t\treturn EPIPE;\n\tcase ERROR_NO_DATA_DETECTED:\n\t\treturn EIO;\n#ifdef ENOMEDIUM\n\tcase ERROR_NO_MEDIA_IN_DRIVE:\n\t\treturn ENOMEDIUM;\n#endif\n#ifdef ENMFILE\n\tcase ERROR_NO_MORE_FILES:\n\t\treturn ENMFILE;\n#endif\n#ifdef ENMFILE\n\tcase ERROR_NO_MORE_ITEMS:\n\t\treturn ENMFILE;\n#endif\n\tcase ERROR_NO_MORE_SEARCH_HANDLES:\n\t\treturn ENFILE;\n\tcase ERROR_NO_PROC_SLOTS:\n\t\treturn EAGAIN;\n\tcase ERROR_NO_SIGNAL_SENT:\n\t\treturn EIO;\n\tcase ERROR_NO_SYSTEM_RESOURCES:\n\t\treturn EFBIG;\n\tcase ERROR_NO_TOKEN:\n\t\treturn EINVAL;\n\tcase ERROR_OPEN_FAILED:\n\t\treturn EIO;\n\tcase ERROR_OPEN_FILES:\n\t\treturn EAGAIN;\n\tcase ERROR_OUTOFMEMORY:\n\t\treturn ENOMEM;\n\tcase ERROR_PAGED_SYSTEM_RESOURCES:\n\t\treturn EAGAIN;\n\tcase ERROR_PAGEFILE_QUOTA:\n\t\treturn EAGAIN;\n\tcase ERROR_PATH_NOT_FOUND:\n\t\treturn ENOENT;\n\tcase ERROR_PIPE_BUSY:\n\t\treturn EBUSY;\n\tcase ERROR_PIPE_CONNECTED:\n\t\treturn EBUSY;\n#ifdef ECOMM\n\tcase ERROR_PIPE_LISTENING:\n\t\treturn ECOMM;\n\tcase ERROR_PIPE_NOT_CONNECTED:\n\t\treturn ECOMM;\n#endif\n\tcase ERROR_POSSIBLE_DEADLOCK:\n\t\treturn EDEADLOCK;\n\tcase ERROR_PRIVILEGE_NOT_HELD:\n\t\treturn EPERM;\n\tcase ERROR_PROCESS_ABORTED:\n\t\treturn EFAULT;\n\tcase ERROR_PROC_NOT_FOUND:\n\t\treturn ESRCH;\n#ifdef ENONET\n\tcase ERROR_REM_NOT_LIST:\n\t\treturn ENONET;\n#endif\n\tcase ERROR_SECTOR_NOT_FOUND:\n\t\treturn EINVAL;\n\tcase ERROR_SEEK:\n\t\treturn EINVAL;\n\tcase ERROR_SETMARK_DETECTED:\n\t\treturn EIO;\n\tcase ERROR_SHARING_BUFFER_EXCEEDED:\n\t\treturn ENOLCK;\n\tcase ERROR_SHARING_VIOLATION:\n\t\treturn EBUSY;\n\tcase ERROR_SIGNAL_PENDING:\n\t\treturn EBUSY;\n\tcase ERROR_SIGNAL_REFUSED:\n\t\treturn EIO;\n#ifdef ELIBBAD\n\tcase ERROR_SXS_CANT_GEN_ACTCTX:\n\t\treturn ELIBBAD;\n#endif\n\tcase ERROR_THREAD_1_INACTIVE:\n\t\treturn EINVAL;\n\tcase ERROR_TOO_MANY_LINKS:\n\t\treturn EMLINK;\n\tcase ERROR_TOO_MANY_OPEN_FILES:\n\t\treturn EMFILE;\n\tcase ERROR_WAIT_NO_CHILDREN:\n\t\treturn ECHILD;\n\tcase ERROR_WORKING_SET_QUOTA:\n\t\treturn EAGAIN;\n\tcase ERROR_WRITE_PROTECT:\n\t\treturn EROFS;\n\tdefault:\n\t\treturn -1;\n\t}\n}\n\nstatic void\nset_errno_from_win32_error(DWORD err)\n{\n\terrno = win32_error_to_errno(err);\n}\n\nstatic void\nset_errno_from_GetLastError(void)\n{\n\tset_errno_from_win32_error(GetLastError());\n}\n\n/* Replacement for POSIX fsync() */\nint\nfsync(int fd)\n{\n\tHANDLE h;\n\n\th = (HANDLE)_get_osfhandle(fd);\n\tif (h == INVALID_HANDLE_VALUE)\n\t\tgoto err;\n\tif (!FlushFileBuffers(h))\n\t\tgoto err_set_errno;\n\treturn 0;\nerr_set_errno:\n\tset_errno_from_GetLastError();\nerr:\n\treturn -1;\n}\n\n/* Use the Win32 API to get the number of processors.  */\nunsigned\nget_available_cpus(void)\n{\n\tSYSTEM_INFO sysinfo;\n\tGetSystemInfo(&sysinfo);\n\treturn sysinfo.dwNumberOfProcessors;\n}\n\n/* Use the Win32 API to get the amount of available memory.  */\nu64\nget_available_memory(void)\n{\n\tMEMORYSTATUSEX status = {\n\t\t.dwLength = sizeof(status),\n\t};\n\tGlobalMemoryStatusEx(&status);\n\treturn (u64)min(status.ullTotalPhys, status.ullTotalVirtual) * 85 / 100;\n}\n\n/* Replacement for POSIX-2008 realpath().  Warning: partial functionality only\n * (resolved_path must be NULL).   Also I highly doubt that GetFullPathName\n * really does the right thing under all circumstances. */\nwchar_t *\nrealpath(const wchar_t *path, wchar_t *resolved_path)\n{\n\tDWORD ret;\n\tDWORD err;\n\twimlib_assert(resolved_path == NULL);\n\n\tret = GetFullPathNameW(path, 0, NULL, NULL);\n\tif (!ret) {\n\t\terr = GetLastError();\n\t\tgoto fail_win32;\n\t}\n\n\tresolved_path = MALLOC(ret * sizeof(wchar_t));\n\tif (!resolved_path)\n\t\tgoto out;\n\tret = GetFullPathNameW(path, ret, resolved_path, NULL);\n\tif (!ret) {\n\t\terr = GetLastError();\n\t\tFREE(resolved_path);\n\t\tresolved_path = NULL;\n\t\tgoto fail_win32;\n\t}\n\tgoto out;\nfail_win32:\n\tset_errno_from_win32_error(err);\nout:\n\treturn resolved_path;\n}\n\n/* A quick hack to get reasonable rename() semantics on Windows, in particular\n * deleting the destination file instead of failing with ERROR_FILE_EXISTS and\n * working around any processes that may have the destination file open.\n *\n * Note: This is intended to be called when overwriting a regular file with an\n * updated copy and is *not* a fully POSIX compliant rename().  For that you may\n * wish to take a look at Cygwin's implementation, but be prepared...\n *\n * Return 0 on success, -1 on regular error, or 1 if the destination file was\n * deleted but the source could not be renamed and therefore should not be\n * deleted.\n */\nint\nwin32_rename_replacement(const wchar_t *srcpath, const wchar_t *dstpath)\n{\n\twchar_t *tmpname;\n\n\t/* Normally, MoveFileExW() with the MOVEFILE_REPLACE_EXISTING flag does\n\t * what we want.  */\n\n\tif (MoveFileExW(srcpath, dstpath, MOVEFILE_REPLACE_EXISTING))\n\t\treturn 0;\n\n\t/* MoveFileExW() failed.  One way this can happen is if any process has\n\t * the destination file open, in which case ERROR_ACCESS_DENIED is\n\t * produced.  This can commonly happen if there is a backup or antivirus\n\t * program monitoring or scanning the files.  This behavior is very\n\t * different from the behavior of POSIX rename(), which simply unlinks\n\t * the destination file and allows other processes to keep it open!  */\n\n\tif (GetLastError() != ERROR_ACCESS_DENIED)\n\t\tgoto err_set_errno;\n\n\t/* We can work around the above-mentioned problem by renaming the\n\t * destination file to yet another temporary file, then \"deleting\" it,\n\t * which on Windows will in fact not actually delete it immediately but\n\t * rather mark it for deletion when the last handle to it is closed.  */\n\t{\n\t\tstatic const wchar_t orig_suffix[] = L\".orig\";\n\t\tconst size_t num_rand_chars = 9;\n\t\twchar_t *p;\n\n\t\tsize_t dstlen = wcslen(dstpath);\n\n\t\ttmpname = alloca(sizeof(wchar_t) *\n\t\t\t\t (dstlen + ARRAY_LEN(orig_suffix) + num_rand_chars + 1));\n\t\tp = tmpname;\n\t\tp = wmempcpy(p, dstpath, dstlen);\n\t\tp = wmempcpy(p, orig_suffix, ARRAY_LEN(orig_suffix));\n\t\tget_random_alnum_chars(p, num_rand_chars);\n\t\tp += num_rand_chars;\n\t\t*p = L'\\0';\n\t}\n\n\tif (!MoveFile(dstpath, tmpname))\n\t\tgoto err_set_errno;\n\n\tif (!DeleteFile(tmpname)) {\n\t\tset_errno_from_GetLastError();\n\t\tWARNING_WITH_ERRNO(\"Failed to delete original file \"\n\t\t\t\t   \"(moved to \\\"%ls\\\")\", tmpname);\n\t}\n\n\tif (!MoveFile(srcpath, dstpath)) {\n\t\tset_errno_from_GetLastError();\n\t\tWARNING_WITH_ERRNO(\"Atomic semantics not respected in \"\n\t\t\t\t   \"failed rename() (new file is at \\\"%ls\\\")\",\n\t\t\t\t   srcpath);\n\t\treturn 1;\n\t}\n\n\treturn 0;\n\nerr_set_errno:\n\tset_errno_from_GetLastError();\n\treturn -1;\n}\n\n#define MAX_IO_AMOUNT 1048576\n\nstatic int\ndo_pread_or_pwrite(int fd, void *buf, size_t count, off_t offset,\n\t\t   bool is_pwrite)\n{\n\tHANDLE h;\n\tLARGE_INTEGER orig_offset;\n\tDWORD result = 0xFFFFFFFF;\n\tLARGE_INTEGER relative_offset = { 0 };\n\tOVERLAPPED overlapped;\n\tBOOL bret;\n\tDWORD err = 0;\n\n\th = (HANDLE)_get_osfhandle(fd);\n\tif (h == INVALID_HANDLE_VALUE)\n\t\tgoto error;\n\n\tif (GetFileType(h) == FILE_TYPE_PIPE) {\n\t\terrno = ESPIPE;\n\t\tgoto error;\n\t}\n\n\t/* Get original position */\n\trelative_offset.QuadPart = 0;\n\tif (!SetFilePointerEx(h, relative_offset, &orig_offset, FILE_CURRENT)) {\n\t\terr = GetLastError();\n\t\twin32_error(err, L\"Failed to get original file position\");\n\t\tgoto error;\n\t}\n\n\tmemset(&overlapped, 0, sizeof(overlapped));\n\toverlapped.Offset = offset;\n\toverlapped.OffsetHigh = offset >> 32;\n\n\t/* Do the read or write at the specified offset */\n\tcount = min(count, MAX_IO_AMOUNT);\n\tSetLastError(0);\n\tif (is_pwrite)\n\t\tbret = WriteFile(h, buf, count, &result, &overlapped);\n\telse\n\t\tbret = ReadFile(h, buf, count, &result, &overlapped);\n\tif (!bret) {\n\t\terr = GetLastError();\n\t\twin32_error(err, L\"Failed to %s %zu bytes at offset %\"PRIu64,\n\t\t\t    (is_pwrite ? \"write\" : \"read\"), count, offset);\n\t\tgoto error;\n\t}\n\n\twimlib_assert(result <= count);\n\n\t/* Restore the original position */\n\tif (!SetFilePointerEx(h, orig_offset, NULL, FILE_BEGIN)) {\n\t\terr = GetLastError();\n\t\twin32_error(err, L\"Failed to restore file position to %\"PRIu64,\n\t\t\t    offset);\n\t\tgoto error;\n\t}\n\n\treturn result;\n\nerror:\n\tif (err)\n\t\tset_errno_from_win32_error(err);\n\treturn -1;\n}\n\n/* Dumb Windows implementation of pread().  It temporarily changes the file\n * offset, so it is not safe to use with readers/writers on the same file\n * descriptor.  */\nssize_t\nwin32_pread(int fd, void *buf, size_t count, off_t offset)\n{\n\treturn do_pread_or_pwrite(fd, buf, count, offset, false);\n}\n\n/* Dumb Windows implementation of pwrite().  It temporarily changes the file\n * offset, so it is not safe to use with readers/writers on the same file\n * descriptor. */\nssize_t\nwin32_pwrite(int fd, const void *buf, size_t count, off_t offset)\n{\n\treturn do_pread_or_pwrite(fd, (void*)buf, count, offset, true);\n}\n\n/* Replacement for read() which doesn't hide the Win32 error code */\nssize_t\nwin32_read(int fd, void *buf, size_t count)\n{\n\tHANDLE h = (HANDLE)_get_osfhandle(fd);\n\tDWORD result = 0xFFFFFFFF;\n\n\tif (h == INVALID_HANDLE_VALUE)\n\t\treturn -1;\n\n\tcount = min(count, MAX_IO_AMOUNT);\n\tSetLastError(0);\n\tif (!ReadFile(h, buf, count, &result, NULL)) {\n\t\tDWORD err = GetLastError();\n\t\twin32_error(err,\n\t\t\t    L\"Error reading %zu bytes from fd %d\", count, fd);\n\t\tset_errno_from_win32_error(err);\n\t\treturn -1;\n\t}\n\n\twimlib_assert(result <= count);\n\treturn result;\n}\n\n/* Replacement for write() which doesn't hide the Win32 error code */\nssize_t\nwin32_write(int fd, const void *buf, size_t count)\n{\n\tHANDLE h = (HANDLE)_get_osfhandle(fd);\n\tDWORD result = 0xFFFFFFFF;\n\n\tif (h == INVALID_HANDLE_VALUE)\n\t\treturn -1;\n\n\tcount = min(count, MAX_IO_AMOUNT);\n\tSetLastError(0);\n\tif (!WriteFile(h, buf, count, &result, NULL)) {\n\t\tDWORD err = GetLastError();\n\t\twin32_error(err,\n\t\t\t    L\"Error writing %zu bytes to fd %d\", count, fd);\n\t\tset_errno_from_win32_error(err);\n\t\treturn -1;\n\t}\n\n\twimlib_assert(result <= count);\n\treturn result;\n}\n\n/* Replacement for glob() in Windows native builds that operates on wide\n * characters.  */\nint\nwin32_wglob(const wchar_t *pattern, int flags,\n\t    int (*errfunc)(const wchar_t *epath, int eerrno),\n\t    glob_t *pglob)\n{\n\tWIN32_FIND_DATAW dat;\n\tDWORD err;\n\tHANDLE hFind;\n\tint ret;\n\tsize_t nspaces;\n\tint errno_save;\n\n\tconst wchar_t *backslash, *end_slash;\n\tsize_t prefix_len;\n\n\tbackslash = wcsrchr(pattern, L'\\\\');\n\tend_slash = wcsrchr(pattern, L'/');\n\n\tif (backslash > end_slash)\n\t\tend_slash = backslash;\n\n\tif (end_slash)\n\t\tprefix_len = end_slash - pattern + 1;\n\telse\n\t\tprefix_len = 0;\n\n\t/* This function does not support all functionality of the POSIX glob(),\n\t * so make sure the parameters are consistent with supported\n\t * functionality. */\n\twimlib_assert(errfunc == NULL);\n\twimlib_assert((flags & GLOB_ERR) == GLOB_ERR);\n\twimlib_assert((flags & ~(GLOB_NOSORT | GLOB_ERR)) == 0);\n\n\thFind = FindFirstFileW(pattern, &dat);\n\tif (hFind == INVALID_HANDLE_VALUE) {\n\t\terr = GetLastError();\n\t\tif (err == ERROR_FILE_NOT_FOUND) {\n\t\t\terrno = 0;\n\t\t\treturn GLOB_NOMATCH;\n\t\t} else {\n\t\t\tset_errno_from_win32_error(err);\n\t\t\treturn GLOB_ABORTED;\n\t\t}\n\t}\n\tpglob->gl_pathc = 0;\n\tpglob->gl_pathv = NULL;\n\tnspaces = 0;\n\tdo {\n\t\twchar_t *path;\n\t\tif (pglob->gl_pathc == nspaces) {\n\t\t\tsize_t new_nspaces;\n\t\t\twchar_t **pathv;\n\n\t\t\tnew_nspaces = nspaces * 2 + 1;\n\t\t\tpathv = REALLOC(pglob->gl_pathv,\n\t\t\t\t\tnew_nspaces * sizeof(pglob->gl_pathv[0]));\n\t\t\tif (!pathv)\n\t\t\t\tgoto oom;\n\t\t\tpglob->gl_pathv = pathv;\n\t\t\tnspaces = new_nspaces;\n\t\t}\n\t\tsize_t filename_len = wcslen(dat.cFileName);\n\t\tsize_t len_needed = prefix_len + filename_len;\n\n\t\tpath = MALLOC((len_needed + 1) * sizeof(wchar_t));\n\t\tif (!path)\n\t\t\tgoto oom;\n\n\t\twmemcpy(path, pattern, prefix_len);\n\t\twmemcpy(path + prefix_len, dat.cFileName, filename_len + 1);\n\t\tpglob->gl_pathv[pglob->gl_pathc++] = path;\n\t} while (FindNextFileW(hFind, &dat));\n\terr = GetLastError();\n\tFindClose(hFind);\n\tif (err != ERROR_NO_MORE_FILES) {\n\t\tset_errno_from_win32_error(err);\n\t\tret = GLOB_ABORTED;\n\t\tgoto fail_globfree;\n\t}\n\treturn 0;\n\noom:\n\tFindClose(hFind);\n\terrno = ENOMEM;\n\tret = GLOB_NOSPACE;\nfail_globfree:\n\terrno_save = errno;\n\tglobfree(pglob);\n\terrno = errno_save;\n\treturn ret;\n}\n\nvoid\nglobfree(glob_t *pglob)\n{\n\tsize_t i;\n\tfor (i = 0; i < pglob->gl_pathc; i++)\n\t\tFREE(pglob->gl_pathv[i]);\n\tFREE(pglob->gl_pathv);\n}\n\n/* Replacement for fopen(path, \"a\") that doesn't prevent other processes from\n * reading the file  */\nFILE *\nwin32_open_logfile(const wchar_t *path)\n{\n\tHANDLE h;\n\tint fd;\n\tFILE *fp;\n\n\th = CreateFile(path, FILE_APPEND_DATA, FILE_SHARE_VALID_FLAGS,\n\t\t       NULL, OPEN_ALWAYS, 0, NULL);\n\tif (h == INVALID_HANDLE_VALUE)\n\t\treturn NULL;\n\n\tfd = _open_osfhandle((intptr_t)h, O_APPEND);\n\tif (fd < 0) {\n\t\tCloseHandle(h);\n\t\treturn NULL;\n\t}\n\n\tfp = fdopen(fd, \"a\");\n\tif (!fp) {\n\t\tclose(fd);\n\t\treturn NULL;\n\t}\n\n\treturn fp;\n}\n\n#define RtlGenRandom SystemFunction036\nBOOLEAN WINAPI RtlGenRandom(PVOID RandomBuffer, ULONG RandomBufferLength);\n\n/*\n * Generate @n cryptographically secure random bytes (thread-safe)\n *\n * This is the Windows version.  It uses RtlGenRandom() (actually called\n * SystemFunction036) from advapi32.dll.\n */\nvoid\nget_random_bytes(void *p, size_t n)\n{\n\twhile (n != 0) {\n\t\tu32 count = min(n, UINT32_MAX);\n\n\t\tif (!RtlGenRandom(p, count)) {\n\t\t\twin32_error(GetLastError(),\n\t\t\t\t    L\"RtlGenRandom() failed (count=%u)\", count);\n\t\t\twimlib_assert(0);\n\t\t\tcount = 0;\n\t\t}\n\t\tp = _PTR(p + count);\n\t\tn -= count;\n\t}\n}\n\n/* Retrieve the current time as a WIM timestamp.  */\nu64\nnow_as_wim_timestamp(void)\n{\n\tFILETIME ft;\n\n\tGetSystemTimeAsFileTime(&ft);\n\n\treturn ((u64)ft.dwHighDateTime << 32) | ft.dwLowDateTime;\n}\n\n#endif /* _WIN32 */\n"
  },
  {
    "path": "src/wimlib/win32_vss.c",
    "content": "/*\n * win32_vss.c - Windows-specific code for creating VSS (Volume Shadow Copy\n * Service) snapshots.\n */\n\n/*\n * Copyright (C) 2015-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef _WIN32\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/win32_common.h\"\n\n#include <cguid.h>\n\n#include \"wimlib/error.h\"\n#include \"wimlib/threads.h\"\n#include \"wimlib/util.h\"\n#include \"wimlib/win32_vss.h\"\n\n/*----------------------------------------------------------------------------*\n *                             VSS API declarations                           *\n *----------------------------------------------------------------------------*/\n\ntypedef GUID VSS_ID;\ntypedef LONGLONG VSS_TIMESTAMP;\ntypedef WCHAR *VSS_PWSZ;\n\ntypedef enum {\n\tVSS_BT_UNDEFINED      = 0,\n\tVSS_BT_FULL           = 1,\n\tVSS_BT_INCREMENTAL    = 2,\n\tVSS_BT_DIFFERENTIAL   = 3,\n\tVSS_BT_LOG            = 4,\n\tVSS_BT_COPY           = 5,\n\tVSS_BT_OTHER          = 6,\n} VSS_BACKUP_TYPE;\n\ntypedef enum {\n\tVSS_SS_UNKNOWN                      = 0x00,\n\tVSS_SS_PREPARING                    = 0x01,\n\tVSS_SS_PROCESSING_PREPARE           = 0x02,\n\tVSS_SS_PREPARED                     = 0x03,\n\tVSS_SS_PROCESSING_PRECOMMIT         = 0x04,\n\tVSS_SS_PRECOMMITTED                 = 0x05,\n\tVSS_SS_PROCESSING_COMMIT            = 0x06,\n\tVSS_SS_COMMITTED                    = 0x07,\n\tVSS_SS_PROCESSING_POSTCOMMIT        = 0x08,\n\tVSS_SS_PROCESSING_PREFINALCOMMIT    = 0x09,\n\tVSS_SS_PREFINALCOMMITTED            = 0x0a,\n\tVSS_SS_PROCESSING_POSTFINALCOMMIT   = 0x0b,\n\tVSS_SS_CREATED                      = 0x0c,\n\tVSS_SS_ABORTED                      = 0x0d,\n\tVSS_SS_DELETED                      = 0x0e,\n\tVSS_SS_POSTCOMMITTED                = 0x0f,\n\tVSS_SS_COUNT                        = 0x10,\n} VSS_SNAPSHOT_STATE;\n\ntypedef enum {\n\tVSS_VOLSNAP_ATTR_PERSISTENT             = 0x00000001,\n\tVSS_VOLSNAP_ATTR_NO_AUTORECOVERY        = 0x00000002,\n\tVSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE      = 0x00000004,\n\tVSS_VOLSNAP_ATTR_NO_AUTO_RELEASE        = 0x00000008,\n\tVSS_VOLSNAP_ATTR_NO_WRITERS             = 0x00000010,\n\tVSS_VOLSNAP_ATTR_TRANSPORTABLE          = 0x00000020,\n\tVSS_VOLSNAP_ATTR_NOT_SURFACED           = 0x00000040,\n\tVSS_VOLSNAP_ATTR_NOT_TRANSACTED         = 0x00000080,\n\tVSS_VOLSNAP_ATTR_HARDWARE_ASSISTED      = 0x00010000,\n\tVSS_VOLSNAP_ATTR_DIFFERENTIAL           = 0x00020000,\n\tVSS_VOLSNAP_ATTR_PLEX                   = 0x00040000,\n\tVSS_VOLSNAP_ATTR_IMPORTED               = 0x00080000,\n\tVSS_VOLSNAP_ATTR_EXPOSED_LOCALLY        = 0x00100000,\n\tVSS_VOLSNAP_ATTR_EXPOSED_REMOTELY       = 0x00200000,\n\tVSS_VOLSNAP_ATTR_AUTORECOVER            = 0x00400000,\n\tVSS_VOLSNAP_ATTR_ROLLBACK_RECOVERY      = 0x00800000,\n\tVSS_VOLSNAP_ATTR_DELAYED_POSTSNAPSHOT   = 0x01000000,\n\tVSS_VOLSNAP_ATTR_TXF_RECOVERY           = 0x02000000,\n} VSS_VOLUME_SNAPSHOT_ATTRIBUTES;\n\ntypedef enum {\n\tVSS_CTX_BACKUP                      = 0,\n\tVSS_CTX_FILE_SHARE_BACKUP           = VSS_VOLSNAP_ATTR_NO_WRITERS,\n\tVSS_CTX_NAS_ROLLBACK                = ( ( VSS_VOLSNAP_ATTR_PERSISTENT | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE ) | VSS_VOLSNAP_ATTR_NO_WRITERS ),\n\tVSS_CTX_APP_ROLLBACK                = ( VSS_VOLSNAP_ATTR_PERSISTENT | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE ),\n\tVSS_CTX_CLIENT_ACCESSIBLE           = ( ( ( VSS_VOLSNAP_ATTR_PERSISTENT | VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE ) | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE ) | VSS_VOLSNAP_ATTR_NO_WRITERS ),\n\tVSS_CTX_CLIENT_ACCESSIBLE_WRITERS   = ( ( VSS_VOLSNAP_ATTR_PERSISTENT | VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE ) | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE ),\n\tVSS_CTX_ALL                         = 0xffffffff,\n} VSS_SNAPSHOT_CONTEXT;\n\ntypedef struct {\n\tVSS_ID             m_SnapshotId;\n\tVSS_ID             m_SnapshotSetId;\n\tLONG               m_lSnapshotsCount;\n\tVSS_PWSZ           m_pwszSnapshotDeviceObject;\n\tVSS_PWSZ           m_pwszOriginalVolumeName;\n\tVSS_PWSZ           m_pwszOriginatingMachine;\n\tVSS_PWSZ           m_pwszServiceMachine;\n\tVSS_PWSZ           m_pwszExposedName;\n\tVSS_PWSZ           m_pwszExposedPath;\n\tVSS_ID             m_ProviderId;\n\tLONG               m_lSnapshotAttributes;\n\tVSS_TIMESTAMP      m_tsCreationTimestamp;\n\tVSS_SNAPSHOT_STATE m_eStatus;\n} VSS_SNAPSHOT_PROP;\n\ntypedef struct IVssAsyncVTable IVssAsyncVTable;\n\ntypedef struct {\n\tIVssAsyncVTable *vtable;\n} IVssAsync;\n\nstruct IVssAsyncVTable {\n\tvoid *QueryInterface;\n\tvoid *AddRef;\n\tULONG (WINAPI *Release)(IVssAsync *this);\n\tvoid *Cancel;\n\tHRESULT (WINAPI *Wait)(IVssAsync *this, DWORD dwMilliseconds);\n\tvoid *QueryStatus;\n};\n\ntypedef struct IVssBackupComponentsVTable IVssBackupComponentsVTable;\n\ntypedef struct {\n\tIVssBackupComponentsVTable *vtable;\n} IVssBackupComponents;\n\nstruct IVssBackupComponentsVTable {\n\tvoid *QueryInterface;\n\tvoid *AddRef;\n\tULONG (WINAPI *Release)(IVssBackupComponents *this);\n\tvoid *GetWriterComponentsCount;\n\tvoid *GetWriterComponents;\n\tHRESULT (WINAPI *InitializeForBackup)(IVssBackupComponents *this,\n\t\t\t\t\t      BSTR bstrXML);\n\tHRESULT (WINAPI *SetBackupState)(IVssBackupComponents *this,\n\t\t\t\t\t BOOLEAN bSelectComponents,\n\t\t\t\t\t BOOLEAN bBackupBootableSystemState,\n\t\t\t\t\t VSS_BACKUP_TYPE backupType,\n\t\t\t\t\t BOOLEAN bPartialFileSupport);\n\tvoid *InitializeForRestore;\n\tvoid *SetRestoreState;\n\tHRESULT (WINAPI *GatherWriterMetadata)(IVssBackupComponents *this,\n\t\t\t\t\t       IVssAsync **ppAsync);\n\tvoid *GetWriterMetadataCount;\n\tvoid *GetWriterMetadata;\n\tvoid *FreeWriterMetadata;\n\tvoid *AddComponent;\n\tHRESULT (WINAPI *PrepareForBackup)(IVssBackupComponents *this,\n\t\t\t\t\t   IVssAsync **ppAsync);\n\tvoid *AbortBackup;\n\tvoid *GatherWriterStatus;\n\tvoid *GetWriterStatusCount;\n\tvoid *FreeWriterStatus;\n\tvoid *GetWriterStatus;\n\tvoid *SetBackupSucceeded;\n\tvoid *SetBackupOptions;\n\tvoid *SetSelectedForRestore;\n\tvoid *SetRestoreOptions;\n\tvoid *SetAdditionalRestores;\n\tvoid *SetPreviousBackupStamp;\n\tvoid *SaveAsXML;\n\tvoid *BackupComplete;\n\tvoid *AddAlternativeLocationMapping;\n\tvoid *AddRestoreSubcomponent;\n\tvoid *SetFileRestoreStatus;\n\tvoid *AddNewTarget;\n\tvoid *SetRangesFilePath;\n\tvoid *PreRestore;\n\tvoid *PostRestore;\n\tHRESULT (WINAPI *SetContext)(IVssBackupComponents *this,\n\t\t\t\t     LONG lContext);\n\tHRESULT (WINAPI *StartSnapshotSet)(IVssBackupComponents *this,\n\t\t\t\t\t   VSS_ID *pSnapshotSetId);\n\tHRESULT (WINAPI *AddToSnapshotSet)(IVssBackupComponents *this,\n\t\t\t\t\t   VSS_PWSZ pwszVolumeName,\n\t\t\t\t\t   VSS_ID ProviderId,\n\t\t\t\t\t   VSS_ID *pidSnapshot);\n\tHRESULT (WINAPI *DoSnapshotSet)(IVssBackupComponents *this,\n\t\t\t\t\tIVssAsync **ppAsync);\n\tvoid *DeleteSnapshots;\n\tvoid *ImportSnapshots;\n\tvoid *BreakSnapshotSet;\n\tHRESULT (WINAPI *GetSnapshotProperties)(IVssBackupComponents *this,\n\t\t\t\t\t\tVSS_ID SnapshotId,\n\t\t\t\t\t\tVSS_SNAPSHOT_PROP *pprop);\n\tvoid *Query;\n\tvoid *IsVolumeSupported;\n\tvoid *DisableWriterClasses;\n\tvoid *EnableWriterClasses;\n\tvoid *DisableWriterInstances;\n\tvoid *ExposeSnapshot;\n\tvoid *RevertToSnapshot;\n\tvoid *QueryRevertStatus;\n};\n\n/*----------------------------------------------------------------------------*\n *                             VSS API initialization                         *\n *----------------------------------------------------------------------------*/\n\nstatic bool vss_initialized;\nstatic volatile uint16_t vss_initialization_mutex = 0;\n\n/* vssapi.dll  */\nstatic HANDLE hVssapi;\nstatic HRESULT (WINAPI *func_CreateVssBackupComponentsInternal)(IVssBackupComponents **ppBackup);\nstatic void (WINAPI *func_VssFreeSnapshotPropertiesInternal)(VSS_SNAPSHOT_PROP *pProp);\n\n/* ole32.dll  */\nstatic HANDLE hOle32;\nstatic void (WINAPI *func_CoInitialize)(LPVOID *pvReserved);\nstatic void (WINAPI *func_CoUninitialize)(void);\n\nstatic bool\nvss_global_init_impl(void)\n{\n\thVssapi = LoadLibrary(L\"vssapi.dll\");\n\tif (!hVssapi) {\n\t\tERROR(\"vssapi.dll not found\");\n\t\tgoto err;\n\t}\n\n\tfunc_CreateVssBackupComponentsInternal =\n\t\t(void *)GetProcAddress(hVssapi, \"CreateVssBackupComponentsInternal\");\n\tif (!func_CreateVssBackupComponentsInternal) {\n\t\tERROR(\"CreateVssBackupComponentsInternal() not found in vssapi.dll\");\n\t\tgoto err_vssapi;\n\t}\n\n\tfunc_VssFreeSnapshotPropertiesInternal =\n\t\t(void *)GetProcAddress(hVssapi, \"VssFreeSnapshotPropertiesInternal\");\n\tif (!func_VssFreeSnapshotPropertiesInternal) {\n\t\tERROR(\"VssFreeSnapshotPropertiesInternal() not found in vssapi.dll\");\n\t\tgoto err_vssapi;\n\t}\n\n\thOle32 = LoadLibrary(L\"ole32.dll\");\n\tif (!hOle32) {\n\t\tERROR(\"ole32.dll not found\");\n\t\tgoto err_vssapi;\n\t}\n\n\tfunc_CoInitialize = (void *)GetProcAddress(hOle32, \"CoInitialize\");\n\tif (!func_CoInitialize) {\n\t\tERROR(\"CoInitialize() not found in ole32.dll\");\n\t\tgoto err_ole32;\n\t}\n\n\tfunc_CoUninitialize = (void *)GetProcAddress(hOle32, \"CoUninitialize\");\n\tif (!func_CoUninitialize) {\n\t\tERROR(\"CoUninitialize() not found in ole32.dll\");\n\t\tgoto err_ole32;\n\t}\n\n\t(*func_CoInitialize)(NULL);\n\treturn true;\n\nerr_ole32:\n\tFreeLibrary(hOle32);\nerr_vssapi:\n\tFreeLibrary(hVssapi);\nerr:\n\treturn false;\n}\n\nstatic bool\nvss_global_init(void)\n{\n\tbool ret = true;\n\n\twhile (InterlockedIncrement16(&vss_initialization_mutex) >= 2) {\n\t\tInterlockedDecrement16(&vss_initialization_mutex);\n\t\tSleep(100);\n\t}\n\n\tif (vss_initialized)\n\t\tgoto out_unlock;\n\n\tvss_initialized = vss_global_init_impl();\n\n\tif (!vss_initialized) {\n\t\tERROR(\"The Volume Shadow Copy Service (VSS) API could not be \"\n\t\t      \"initialized.\");\n\t\tret = false;\n\t}\n\nout_unlock:\n\tInterlockedDecrement16(&vss_initialization_mutex);\n\treturn ret;\n}\n\nvoid\nvss_global_cleanup(void)\n{\n\twhile (InterlockedIncrement16(&vss_initialization_mutex) >= 2) {\n\t\tInterlockedDecrement16(&vss_initialization_mutex);\n\t\tSleep(100);\n\t}\n\n\tif (!vss_initialized)\n\t\tgoto out_unlock;\n\n\t(*func_CoUninitialize)();\n\tFreeLibrary(hOle32);\n\tFreeLibrary(hVssapi);\n\tvss_initialized = false;\n\nout_unlock:\n\tInterlockedDecrement16(&vss_initialization_mutex);\n}\n\n/*----------------------------------------------------------------------------*\n *                             VSS implementation                             *\n *----------------------------------------------------------------------------*/\n\nstruct vss_snapshot_internal {\n\tstruct vss_snapshot base;\n\tIVssBackupComponents *vss;\n\tVSS_SNAPSHOT_PROP props;\n};\n\n/* Delete the specified VSS snapshot.  */\nvoid\nvss_delete_snapshot(struct vss_snapshot *snapshot)\n{\n\tstruct vss_snapshot_internal *internal;\n\n\tinternal = container_of(snapshot, struct vss_snapshot_internal, base);\n\n\tif (internal->props.m_pwszSnapshotDeviceObject)\n\t\t(*func_VssFreeSnapshotPropertiesInternal)(&internal->props);\n\tif (internal->vss)\n\t\tinternal->vss->vtable->Release(internal->vss);\n\tFREE(internal);\n}\n\nstatic HRESULT\nwait_and_release(IVssAsync *async)\n{\n\tHRESULT res = async->vtable->Wait(async, INFINITE);\n\n\tasync->vtable->Release(async);\n\treturn res;\n}\n\nstatic bool\nrequest_vss_snapshot(IVssBackupComponents *vss, wchar_t *volume,\n\t\t     VSS_ID *snapshot_id)\n{\n\tHRESULT res;\n\tIVssAsync *async;\n\n\tres = vss->vtable->InitializeForBackup(vss, NULL);\n\tif (FAILED(res)) {\n\t\tERROR(\"IVssBackupComponents.InitializeForBackup() error: %x\",\n\t\t      (u32)res);\n\t\treturn false;\n\t}\n\n\tres = vss->vtable->SetBackupState(vss, FALSE, TRUE, VSS_BT_COPY, FALSE);\n\tif (FAILED(res)) {\n\t\tERROR(\"IVssBackupComponents.SetBackupState() error: %x\",\n\t\t      (u32)res);\n\t\treturn false;\n\t}\n\n\tres = vss->vtable->StartSnapshotSet(vss, snapshot_id);\n\tif (FAILED(res)) {\n\t\tERROR(\"IVssBackupComponents.StartSnapshotSet() error: %x\",\n\t\t      (u32)res);\n\t\treturn false;\n\t}\n\n\tres = vss->vtable->AddToSnapshotSet(vss, volume, (GUID){ 0 }, snapshot_id);\n\tif (FAILED(res)) {\n\t\tERROR(\"IVssBackupComponents.AddToSnapshotSet() error: %x\",\n\t\t      (u32)res);\n\t\treturn false;\n\t}\n\n\tres = vss->vtable->PrepareForBackup(vss, &async);\n\tif (FAILED(res)) {\n\t\tERROR(\"IVssBackupComponents.PrepareForBackup() error: %x\",\n\t\t      (u32)res);\n\t\treturn false;\n\t}\n\tres = wait_and_release(async);\n\tif (FAILED(res)) {\n\t\tERROR(\"IVssAsync.Wait() error while preparing for backup: %x\",\n\t\t      (u32)res);\n\t\treturn false;\n\t}\n\n\tres = vss->vtable->DoSnapshotSet(vss, &async);\n\tif (FAILED(res)) {\n\t\tERROR(\"IVssBackupComponents.DoSnapshotSet() error: %x\",\n\t\t      (u32)res);\n\t\treturn false;\n\t}\n\tres = wait_and_release(async);\n\tif (FAILED(res)) {\n\t\tERROR(\"IVssAsync.Wait() error while doing snapshot set: %x\",\n\t\t      (u32)res);\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nstatic bool\nis_wow64(void)\n{\n\tBOOL wow64 = FALSE;\n\tif (sizeof(size_t) == 4)\n\t\tIsWow64Process(GetCurrentProcess(), &wow64);\n\treturn wow64;\n}\n\n/*\n * Create a VSS snapshot of the specified @volume.  Return the NT namespace path\n * to the snapshot root directory in @vss_path_ret and a handle to the snapshot\n * in @snapshot_ret.\n */\nint\nvss_create_snapshot(const wchar_t *source, UNICODE_STRING *vss_path_ret,\n\t\t    struct vss_snapshot **snapshot_ret)\n{\n\twchar_t *source_abspath;\n\twchar_t volume[4];\n\tVSS_ID snapshot_id;\n\tstruct vss_snapshot_internal *snapshot = NULL;\n\tIVssBackupComponents *vss;\n\tHRESULT res;\n\tint ret;\n\n\tsource_abspath = realpath(source, NULL);\n\tif (!source_abspath) {\n\t\tret = WIMLIB_ERR_NOMEM;\n\t\tgoto err;\n\t}\n\n\tif (source_abspath[0] == L'\\0' || source_abspath[1] != L':' ||\n\t    source_abspath[2] != L'\\\\') {\n\t\tERROR(\"\\\"%ls\\\" (full path \\\"%ls\\\"): Path format not recognized\",\n\t\t      source, source_abspath);\n\t\tret = WIMLIB_ERR_UNSUPPORTED;\n\t\tgoto err;\n\t}\n\n\twsprintf(volume, L\"%lc:\\\\\", source_abspath[0]);\n\n\tsnapshot = CALLOC(1, sizeof(*snapshot));\n\tif (!snapshot) {\n\t\tret = WIMLIB_ERR_NOMEM;\n\t\tgoto err;\n\t}\n\n\tif (!vss_global_init())\n\t\tgoto vss_err;\n\n\tres = (*func_CreateVssBackupComponentsInternal)(&vss);\n\tif (FAILED(res)) {\n\t\tERROR(\"CreateVssBackupComponents error: %x\", (u32)res);\n\t\tgoto vss_err;\n\t}\n\n\tsnapshot->vss = vss;\n\n\tif (!request_vss_snapshot(vss, volume, &snapshot_id))\n\t\tgoto vss_err;\n\n\tres = vss->vtable->GetSnapshotProperties(vss, snapshot_id, &snapshot->props);\n\tif (FAILED(res)) {\n\t\tERROR(\"IVssBackupComponents.GetSnapshotProperties() error: %x\",\n\t\t      (u32)res);\n\t\tgoto vss_err;\n\t}\n\n\tif (wcsncmp(snapshot->props.m_pwszSnapshotDeviceObject, L\"\\\\\\\\?\\\\\", 4)) {\n\t\tERROR(\"Unexpected volume shadow device path: %ls\",\n\t\t      snapshot->props.m_pwszSnapshotDeviceObject);\n\t\tgoto vss_err;\n\t}\n\n\tvss_path_ret->MaximumLength = sizeof(wchar_t) *\n\t\t(wcslen(snapshot->props.m_pwszSnapshotDeviceObject) +\n\t\t 1 + wcslen(&source_abspath[3]) + 1);\n\tvss_path_ret->Length = vss_path_ret->MaximumLength - sizeof(wchar_t);\n\tvss_path_ret->Buffer = HeapAlloc(GetProcessHeap(), 0,\n\t\t\t\t\t vss_path_ret->MaximumLength);\n\tif (!vss_path_ret->Buffer) {\n\t\tret = WIMLIB_ERR_NOMEM;\n\t\tgoto err;\n\t}\n\tswprintf(vss_path_ret->Buffer,\n\t\t vss_path_ret->MaximumLength / sizeof(wchar_t),\n\t\t L\"\\\\??\\\\%ls\\\\%ls\",\n\t\t &snapshot->props.m_pwszSnapshotDeviceObject[4],\n\t\t &source_abspath[3]);\n\t*snapshot_ret = &snapshot->base;\n\tsnapshot->base.refcnt = 1;\n\tret = 0;\n\tgoto out;\n\nvss_err:\n\tret = WIMLIB_ERR_SNAPSHOT_FAILURE;\n\tif (is_wow64()) {\n\t\tERROR(\"64-bit Windows doesn't allow 32-bit applications to \"\n\t\t      \"create VSS snapshots.\\n\"\n\t\t      \"        Run the 64-bit version of this application \"\n\t\t      \"instead.\");\n\t} else {\n\t\tERROR(\"A problem occurred while creating a VSS snapshot of \"\n\t\t      \"\\\"%ls\\\".\\n\"\n\t\t      \"        Aborting the operation.\", volume);\n\t}\nerr:\n\tif (snapshot)\n\t\tvss_delete_snapshot(&snapshot->base);\nout:\n\tFREE(source_abspath);\n\treturn ret;\n}\n\n#endif /* _WIN32 */\n"
  },
  {
    "path": "src/wimlib/write.c",
    "content": "/*\n * write.c\n *\n * Support for writing WIM files; write a WIM file, overwrite a WIM file, write\n * compressed file resources, etc.\n */\n\n/*\n * Copyright (C) 2012-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#if defined(HAVE_SYS_FILE_H) && defined(HAVE_FLOCK)\n/* On BSD, this should be included before \"wimlib/list.h\" so that \"wimlib/list.h\" can\n * override the LIST_HEAD macro. */\n#  include <sys/file.h>\n#endif\n\n#include <errno.h>\n#include <fcntl.h>\n#include <stdlib.h>\n#include <unistd.h>\n\n#include \"wimlib/alloca.h\"\n#include \"wimlib/assert.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/chunk_compressor.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/file_io.h\"\n#include \"wimlib/header.h\"\n#include \"wimlib/inode.h\"\n#include \"wimlib/integrity.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/paths.h\"\n#include \"wimlib/progress.h\"\n#include \"wimlib/resource.h\"\n#include \"wimlib/solid.h\"\n#include \"wimlib/win32.h\" /* win32_rename_replacement() */\n#include \"wimlib/write.h\"\n#include \"wimlib/xml.h\"\n\n\n/* wimlib internal flags used when writing resources.  */\n#define WRITE_RESOURCE_FLAG_RECOMPRESS\t\t0x00000001\n#define WRITE_RESOURCE_FLAG_PIPABLE\t\t0x00000002\n#define WRITE_RESOURCE_FLAG_SOLID\t\t0x00000004\n#define WRITE_RESOURCE_FLAG_SEND_DONE_WITH_FILE\t0x00000008\n#define WRITE_RESOURCE_FLAG_SOLID_SORT\t\t0x00000010\n\nstatic int\nwrite_flags_to_resource_flags(int write_flags)\n{\n\tint write_resource_flags = 0;\n\n\tif (write_flags & WIMLIB_WRITE_FLAG_RECOMPRESS)\n\t\twrite_resource_flags |= WRITE_RESOURCE_FLAG_RECOMPRESS;\n\n\tif (write_flags & WIMLIB_WRITE_FLAG_PIPABLE)\n\t\twrite_resource_flags |= WRITE_RESOURCE_FLAG_PIPABLE;\n\n\tif (write_flags & WIMLIB_WRITE_FLAG_SOLID)\n\t\twrite_resource_flags |= WRITE_RESOURCE_FLAG_SOLID;\n\n\tif (write_flags & WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES)\n\t\twrite_resource_flags |= WRITE_RESOURCE_FLAG_SEND_DONE_WITH_FILE;\n\n\tif ((write_flags & (WIMLIB_WRITE_FLAG_SOLID |\n\t\t\t    WIMLIB_WRITE_FLAG_NO_SOLID_SORT)) ==\n\t    WIMLIB_WRITE_FLAG_SOLID)\n\t\twrite_resource_flags |= WRITE_RESOURCE_FLAG_SOLID_SORT;\n\n\treturn write_resource_flags;\n}\n\nstruct filter_context {\n\tint write_flags;\n\tWIMStruct *wim;\n};\n\n/*\n * Determine whether the specified blob should be filtered out from the write.\n *\n * Return values:\n *\n *  < 0 : The blob should be hard-filtered; that is, not included in the output\n *\t  WIM file at all.\n *    0 : The blob should not be filtered out.\n *  > 0 : The blob should be soft-filtered; that is, it already exists in the\n *\t  WIM file and may not need to be written again.\n */\nstatic int\nblob_filtered(const struct blob_descriptor *blob,\n\t      const struct filter_context *ctx)\n{\n\tint write_flags;\n\tWIMStruct *wim;\n\n\tif (ctx == NULL)\n\t\treturn 0;\n\n\twrite_flags = ctx->write_flags;\n\twim = ctx->wim;\n\n\tif (write_flags & WIMLIB_WRITE_FLAG_APPEND &&\n\t    blob->blob_location == BLOB_IN_WIM &&\n\t    blob->rdesc->wim == wim)\n\t\treturn 1;\n\n\tif (write_flags & WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS &&\n\t    blob->blob_location == BLOB_IN_WIM &&\n\t    blob->rdesc->wim != wim)\n\t\treturn -1;\n\n\treturn 0;\n}\n\nstatic bool\nblob_hard_filtered(const struct blob_descriptor *blob,\n\t\t   struct filter_context *ctx)\n{\n\treturn blob_filtered(blob, ctx) < 0;\n}\n\nstatic inline bool\nmay_soft_filter_blobs(const struct filter_context *ctx)\n{\n\treturn ctx && (ctx->write_flags & WIMLIB_WRITE_FLAG_APPEND);\n}\n\nstatic inline bool\nmay_hard_filter_blobs(const struct filter_context *ctx)\n{\n\treturn ctx && (ctx->write_flags & WIMLIB_WRITE_FLAG_SKIP_EXTERNAL_WIMS);\n}\n\nstatic inline bool\nmay_filter_blobs(const struct filter_context *ctx)\n{\n\treturn (may_soft_filter_blobs(ctx) || may_hard_filter_blobs(ctx));\n}\n\n/* Return true if the specified blob is located in a WIM resource which can be\n * reused in the output WIM file, without being recompressed.  */\nstatic bool\ncan_raw_copy(const struct blob_descriptor *blob, int write_resource_flags,\n\t     int out_ctype, u32 out_chunk_size)\n{\n\tconst struct wim_resource_descriptor *rdesc;\n\n\t/* Recompress everything if requested.  */\n\tif (write_resource_flags & WRITE_RESOURCE_FLAG_RECOMPRESS)\n\t\treturn false;\n\n\t/* A blob not located in a WIM resource cannot be reused.  */\n\tif (blob->blob_location != BLOB_IN_WIM)\n\t\treturn false;\n\n\trdesc = blob->rdesc;\n\n\t/* In the case of an in-place compaction, always reuse resources located\n\t * in the WIM being compacted.  */\n\tif (rdesc->wim->being_compacted)\n\t\treturn true;\n\n\t/* Otherwise, only reuse compressed resources.  */\n\tif (out_ctype == WIMLIB_COMPRESSION_TYPE_NONE ||\n\t    !(rdesc->flags & (WIM_RESHDR_FLAG_COMPRESSED |\n\t\t\t      WIM_RESHDR_FLAG_SOLID)))\n\t\treturn false;\n\n\t/* When writing a pipable WIM, we can only reuse pipable resources; and\n\t * when writing a non-pipable WIM, we can only reuse non-pipable\n\t * resources.  */\n\tif (rdesc->is_pipable !=\n\t    !!(write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE))\n\t\treturn false;\n\n\t/* When writing a solid WIM, we can only reuse solid resources; and when\n\t * writing a non-solid WIM, we can only reuse non-solid resources.  */\n\tif (!!(rdesc->flags & WIM_RESHDR_FLAG_SOLID) !=\n\t    !!(write_resource_flags & WRITE_RESOURCE_FLAG_SOLID))\n\t\treturn false;\n\n\t/* Note: it is theoretically possible to copy chunks of compressed data\n\t * between non-solid, solid, and pipable resources.  However, we don't\n\t * currently implement this optimization because it would be complex and\n\t * would usually go unused.  */\n\n\tif (rdesc->flags & WIM_RESHDR_FLAG_COMPRESSED) {\n\t\t/* To re-use a non-solid resource, it must use the desired\n\t\t * compression type and chunk size.  */\n\t\treturn (rdesc->compression_type == out_ctype &&\n\t\t\trdesc->chunk_size == out_chunk_size);\n\t} else {\n\t\t/* Solid resource: Such resources may contain multiple blobs,\n\t\t * and in general only a subset of them need to be written.  As\n\t\t * a heuristic, re-use the raw data if more than two-thirds the\n\t\t * uncompressed size is being written.  */\n\n\t\t/* Note: solid resources contain a header that specifies the\n\t\t * compression type and chunk size; therefore we don't need to\n\t\t * check if they are compatible with @out_ctype and\n\t\t * @out_chunk_size.  */\n\n\t\t/* Did we already decide to reuse the resource?  */\n\t\tif (rdesc->raw_copy_ok)\n\t\t\treturn true;\n\n\t\tstruct blob_descriptor *res_blob;\n\t\tu64 write_size = 0;\n\n\t\tlist_for_each_entry(res_blob, &rdesc->blob_list, rdesc_node)\n\t\t\tif (res_blob->will_be_in_output_wim)\n\t\t\t\twrite_size += res_blob->size;\n\n\t\treturn (write_size > rdesc->uncompressed_size * 2 / 3);\n\t}\n}\n\nstatic u32\nreshdr_flags_for_blob(const struct blob_descriptor *blob)\n{\n\tu32 reshdr_flags = 0;\n\tif (blob->is_metadata)\n\t\treshdr_flags |= WIM_RESHDR_FLAG_METADATA;\n\treturn reshdr_flags;\n}\n\nstatic void\nblob_set_out_reshdr_for_reuse(struct blob_descriptor *blob)\n{\n\tconst struct wim_resource_descriptor *rdesc;\n\n\twimlib_assert(blob->blob_location == BLOB_IN_WIM);\n\trdesc = blob->rdesc;\n\n\tif (rdesc->flags & WIM_RESHDR_FLAG_SOLID) {\n\t\tblob->out_reshdr.offset_in_wim = blob->offset_in_res;\n\t\tblob->out_reshdr.uncompressed_size = 0;\n\t\tblob->out_reshdr.size_in_wim = blob->size;\n\n\t\tblob->out_res_offset_in_wim = rdesc->offset_in_wim;\n\t\tblob->out_res_size_in_wim = rdesc->size_in_wim;\n\t\tblob->out_res_uncompressed_size = rdesc->uncompressed_size;\n\t} else {\n\t\tblob->out_reshdr.offset_in_wim = rdesc->offset_in_wim;\n\t\tblob->out_reshdr.uncompressed_size = rdesc->uncompressed_size;\n\t\tblob->out_reshdr.size_in_wim = rdesc->size_in_wim;\n\t}\n\tblob->out_reshdr.flags = rdesc->flags;\n}\n\n\n/* Write the header for a blob in a pipable WIM.  */\nstatic int\nwrite_pwm_blob_header(const struct blob_descriptor *blob,\n\t\t      struct filedes *out_fd, bool compressed)\n{\n\tstruct pwm_blob_hdr blob_hdr;\n\tu32 reshdr_flags;\n\tint ret;\n\n\twimlib_assert(!blob->unhashed);\n\n\tblob_hdr.magic = cpu_to_le64(PWM_BLOB_MAGIC);\n\tblob_hdr.uncompressed_size = cpu_to_le64(blob->size);\n\tcopy_hash(blob_hdr.hash, blob->hash);\n\treshdr_flags = reshdr_flags_for_blob(blob);\n\tif (compressed)\n\t\treshdr_flags |= WIM_RESHDR_FLAG_COMPRESSED;\n\tblob_hdr.flags = cpu_to_le32(reshdr_flags);\n\tret = full_write(out_fd, &blob_hdr, sizeof(blob_hdr));\n\tif (ret)\n\t\tERROR_WITH_ERRNO(\"Error writing blob header to WIM file\");\n\treturn ret;\n}\n\nstruct write_blobs_progress_data {\n\twimlib_progress_func_t progfunc;\n\tvoid *progctx;\n\tunion wimlib_progress_info progress;\n\tu64 next_progress;\n};\n\nstatic int\ndo_write_blobs_progress(struct write_blobs_progress_data *progress_data,\n\t\t\tu64 complete_size, u64 complete_compressed_size,\n\t\t\tu32 complete_count, bool discarded)\n{\n\tunion wimlib_progress_info *progress = &progress_data->progress;\n\tint ret;\n\n\tif (discarded) {\n\t\tprogress->write_streams.total_bytes -= complete_size;\n\t\tprogress->write_streams.total_streams -= complete_count;\n\t\tif (progress_data->next_progress != ~(u64)0 &&\n\t\t    progress_data->next_progress > progress->write_streams.total_bytes)\n\t\t{\n\t\t\tprogress_data->next_progress = progress->write_streams.total_bytes;\n\t\t}\n\t} else {\n\t\tprogress->write_streams.completed_bytes += complete_size;\n\t\tprogress->write_streams.completed_compressed_bytes +=\n\t\t\tcomplete_compressed_size;\n\t\tprogress->write_streams.completed_streams += complete_count;\n\t}\n\n\tif (progress->write_streams.completed_bytes >= progress_data->next_progress) {\n\n\t\tret = call_progress(progress_data->progfunc,\n\t\t\t\t    WIMLIB_PROGRESS_MSG_WRITE_STREAMS,\n\t\t\t\t    progress,\n\t\t\t\t    progress_data->progctx);\n\t\tif (ret)\n\t\t\treturn ret;\n\n\t\tset_next_progress(progress->write_streams.completed_bytes,\n\t\t\t\t  progress->write_streams.total_bytes,\n\t\t\t\t  &progress_data->next_progress);\n\t}\n\treturn 0;\n}\n\nstruct write_blobs_ctx {\n\t/* File descriptor to which the blobs are being written.  */\n\tstruct filedes *out_fd;\n\n\t/* Blob table for the WIMStruct on whose behalf the blobs are being\n\t * written.  */\n\tstruct blob_table *blob_table;\n\n\t/* Compression format to use.  */\n\tint out_ctype;\n\n\t/* Maximum uncompressed chunk size in compressed resources to use.  */\n\tu32 out_chunk_size;\n\n\t/* Flags that affect how the blobs will be written.  */\n\tint write_resource_flags;\n\n\t/* Data used for issuing WRITE_STREAMS progress.  */\n\tstruct write_blobs_progress_data progress_data;\n\n\tstruct filter_context *filter_ctx;\n\n\t/* Pointer to the chunk_compressor implementation being used for\n\t * compressing chunks of data, or NULL if chunks are being written\n\t * uncompressed.  */\n\tstruct chunk_compressor *compressor;\n\n\t/* A buffer of size @out_chunk_size that has been loaned out from the\n\t * chunk compressor and is currently being filled with the uncompressed\n\t * data of the next chunk.  */\n\tu8 *cur_chunk_buf;\n\n\t/* Number of bytes in @cur_chunk_buf that are currently filled.  */\n\tsize_t cur_chunk_buf_filled;\n\n\t/* List of blobs that currently have chunks being compressed.  */\n\tstruct list_head blobs_being_compressed;\n\n\t/* List of blobs in the solid resource.  Blobs are moved here after\n\t * @blobs_being_compressed only when writing a solid resource.  */\n\tstruct list_head blobs_in_solid_resource;\n\n\t/* Current uncompressed offset in the blob being written.  */\n\tu64 cur_write_blob_offset;\n\n\t/* Uncompressed size of resource currently being written.  */\n\tu64 cur_write_res_size;\n\n\t/* Array that is filled in with compressed chunk sizes as a resource is\n\t * being written.  */\n\tu64 *chunk_csizes;\n\n\t/* Index of next entry in @chunk_csizes to fill in.  */\n\tsize_t chunk_index;\n\n\t/* Number of entries in @chunk_csizes currently allocated.  */\n\tsize_t num_alloc_chunks;\n\n\t/* Offset in the output file of the start of the chunks of the resource\n\t * currently being written.  */\n\tu64 chunks_start_offset;\n};\n\n/* Reserve space for the chunk table and prepare to accumulate the chunk table\n * in memory.  */\nstatic int\nbegin_chunk_table(struct write_blobs_ctx *ctx, u64 res_expected_size)\n{\n\tu64 expected_num_chunks;\n\tu64 expected_num_chunk_entries;\n\tsize_t reserve_size;\n\tint ret;\n\n\t/* Calculate the number of chunks and chunk entries that should be\n\t * needed for the resource.  These normally will be the final values,\n\t * but in SOLID mode some of the blobs we're planning to write into the\n\t * resource may be duplicates, and therefore discarded, potentially\n\t * decreasing the number of chunk entries needed.  */\n\texpected_num_chunks = DIV_ROUND_UP(res_expected_size, ctx->out_chunk_size);\n\texpected_num_chunk_entries = expected_num_chunks;\n\tif (!(ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID))\n\t\texpected_num_chunk_entries--;\n\n\t/* Make sure the chunk_csizes array is long enough to store the\n\t * compressed size of each chunk.  */\n\tif (expected_num_chunks > ctx->num_alloc_chunks) {\n\t\tu64 new_length = expected_num_chunks + 50;\n\n\t\tif ((size_t)new_length != new_length) {\n\t\t\tERROR(\"Resource size too large (%\"PRIu64\" bytes!\",\n\t\t\t      res_expected_size);\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\t}\n\n\t\tFREE(ctx->chunk_csizes);\n\t\tctx->chunk_csizes = MALLOC(new_length * sizeof(ctx->chunk_csizes[0]));\n\t\tif (ctx->chunk_csizes == NULL) {\n\t\t\tctx->num_alloc_chunks = 0;\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\t}\n\t\tctx->num_alloc_chunks = new_length;\n\t}\n\n\tctx->chunk_index = 0;\n\n\tif (!(ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE)) {\n\t\t/* Reserve space for the chunk table in the output file.  In the\n\t\t * case of solid resources this reserves the upper bound for the\n\t\t * needed space, not necessarily the exact space which will\n\t\t * prove to be needed.  At this point, we just use @chunk_csizes\n\t\t * for a buffer of 0's because the actual compressed chunk sizes\n\t\t * are unknown.  */\n\t\treserve_size = expected_num_chunk_entries *\n\t\t\t       get_chunk_entry_size(res_expected_size,\n\t\t\t\t\t\t    0 != (ctx->write_resource_flags &\n\t\t\t\t\t\t\t  WRITE_RESOURCE_FLAG_SOLID));\n\t\tif (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID)\n\t\t\treserve_size += sizeof(struct alt_chunk_table_header_disk);\n\t\tmemset(ctx->chunk_csizes, 0, reserve_size);\n\t\tret = full_write(ctx->out_fd, ctx->chunk_csizes, reserve_size);\n\t\tif (ret) {\n\t\t\tERROR_WITH_ERRNO(\"Error reserving space for chunk \"\n\t\t\t\t\t \"table in WIM file\");\n\t\t\treturn ret;\n\t\t}\n\t}\n\treturn 0;\n}\n\nstatic int\nbegin_write_resource(struct write_blobs_ctx *ctx, u64 res_expected_size)\n{\n\tint ret;\n\n\twimlib_assert(res_expected_size != 0);\n\n\tif (ctx->compressor != NULL) {\n\t\tret = begin_chunk_table(ctx, res_expected_size);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\t/* Output file descriptor is now positioned at the offset at which to\n\t * write the first chunk of the resource.  */\n\tctx->chunks_start_offset = ctx->out_fd->offset;\n\tctx->cur_write_blob_offset = 0;\n\tctx->cur_write_res_size = res_expected_size;\n\treturn 0;\n}\n\nstatic int\nend_chunk_table(struct write_blobs_ctx *ctx, u64 res_actual_size,\n\t\tu64 *res_start_offset_ret, u64 *res_store_size_ret)\n{\n\tsize_t actual_num_chunks;\n\tsize_t actual_num_chunk_entries;\n\tsize_t chunk_entry_size;\n\tint ret;\n\n\tactual_num_chunks = ctx->chunk_index;\n\tactual_num_chunk_entries = actual_num_chunks;\n\tif (!(ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID))\n\t\tactual_num_chunk_entries--;\n\n\tchunk_entry_size = get_chunk_entry_size(res_actual_size,\n\t\t\t\t\t\t0 != (ctx->write_resource_flags &\n\t\t\t\t\t\t      WRITE_RESOURCE_FLAG_SOLID));\n\n\ttypedef le64 __attribute__((may_alias)) aliased_le64_t;\n\ttypedef le32 __attribute__((may_alias)) aliased_le32_t;\n\n\tif (chunk_entry_size == 4) {\n\t\taliased_le32_t *entries = (aliased_le32_t*)ctx->chunk_csizes;\n\n\t\tif (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) {\n\t\t\tfor (size_t i = 0; i < actual_num_chunk_entries; i++)\n\t\t\t\tentries[i] = cpu_to_le32(ctx->chunk_csizes[i]);\n\t\t} else {\n\t\t\tu32 offset = ctx->chunk_csizes[0];\n\t\t\tfor (size_t i = 0; i < actual_num_chunk_entries; i++) {\n\t\t\t\tu32 next_size = ctx->chunk_csizes[i + 1];\n\t\t\t\tentries[i] = cpu_to_le32(offset);\n\t\t\t\toffset += next_size;\n\t\t\t}\n\t\t}\n\t} else {\n\t\taliased_le64_t *entries = (aliased_le64_t*)ctx->chunk_csizes;\n\n\t\tif (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) {\n\t\t\tfor (size_t i = 0; i < actual_num_chunk_entries; i++)\n\t\t\t\tentries[i] = cpu_to_le64(ctx->chunk_csizes[i]);\n\t\t} else {\n\t\t\tu64 offset = ctx->chunk_csizes[0];\n\t\t\tfor (size_t i = 0; i < actual_num_chunk_entries; i++) {\n\t\t\t\tu64 next_size = ctx->chunk_csizes[i + 1];\n\t\t\t\tentries[i] = cpu_to_le64(offset);\n\t\t\t\toffset += next_size;\n\t\t\t}\n\t\t}\n\t}\n\n\tsize_t chunk_table_size = actual_num_chunk_entries * chunk_entry_size;\n\tu64 res_start_offset;\n\tu64 res_end_offset;\n\n\tif (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE) {\n\t\tret = full_write(ctx->out_fd, ctx->chunk_csizes, chunk_table_size);\n\t\tif (ret)\n\t\t\tgoto write_error;\n\t\tres_end_offset = ctx->out_fd->offset;\n\t\tres_start_offset = ctx->chunks_start_offset;\n\t} else {\n\t\tres_end_offset = ctx->out_fd->offset;\n\n\t\tu64 chunk_table_offset;\n\n\t\tchunk_table_offset = ctx->chunks_start_offset - chunk_table_size;\n\n\t\tif (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) {\n\t\t\tstruct alt_chunk_table_header_disk hdr;\n\n\t\t\thdr.res_usize = cpu_to_le64(res_actual_size);\n\t\t\thdr.chunk_size = cpu_to_le32(ctx->out_chunk_size);\n\t\t\thdr.compression_format = cpu_to_le32(ctx->out_ctype);\n\n\t\t\tSTATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_XPRESS == 1);\n\t\t\tSTATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_LZX == 2);\n\t\t\tSTATIC_ASSERT(WIMLIB_COMPRESSION_TYPE_LZMS == 3);\n\n\t\t\tret = full_pwrite(ctx->out_fd, &hdr, sizeof(hdr),\n\t\t\t\t\t  chunk_table_offset - sizeof(hdr));\n\t\t\tif (ret)\n\t\t\t\tgoto write_error;\n\t\t\tres_start_offset = chunk_table_offset - sizeof(hdr);\n\t\t} else {\n\t\t\tres_start_offset = chunk_table_offset;\n\t\t}\n\n\t\tret = full_pwrite(ctx->out_fd, ctx->chunk_csizes,\n\t\t\t\t  chunk_table_size, chunk_table_offset);\n\t\tif (ret)\n\t\t\tgoto write_error;\n\t}\n\n\t*res_start_offset_ret = res_start_offset;\n\t*res_store_size_ret = res_end_offset - res_start_offset;\n\n\treturn 0;\n\nwrite_error:\n\tERROR_WITH_ERRNO(\"Error writing chunk table to WIM file\");\n\treturn ret;\n}\n\n/* Finish writing a WIM resource by writing or updating the chunk table (if not\n * writing the data uncompressed) and loading its metadata into @out_reshdr.  */\nstatic int\nend_write_resource(struct write_blobs_ctx *ctx, struct wim_reshdr *out_reshdr)\n{\n\tint ret;\n\tu64 res_size_in_wim;\n\tu64 res_uncompressed_size;\n\tu64 res_offset_in_wim;\n\n\twimlib_assert(ctx->cur_write_blob_offset == ctx->cur_write_res_size ||\n\t\t      (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID));\n\tres_uncompressed_size = ctx->cur_write_res_size;\n\n\tif (ctx->compressor) {\n\t\tret = end_chunk_table(ctx, res_uncompressed_size,\n\t\t\t\t      &res_offset_in_wim, &res_size_in_wim);\n\t\tif (ret)\n\t\t\treturn ret;\n\t} else {\n\t\tres_offset_in_wim = ctx->chunks_start_offset;\n\t\tres_size_in_wim = ctx->out_fd->offset - res_offset_in_wim;\n\t}\n\tout_reshdr->uncompressed_size = res_uncompressed_size;\n\tout_reshdr->size_in_wim = res_size_in_wim;\n\tout_reshdr->offset_in_wim = res_offset_in_wim;\n\treturn 0;\n}\n\n/* Call when no more data from the file at @path is needed.  */\nstatic int\ndone_with_file(const tchar *path, wimlib_progress_func_t progfunc, void *progctx)\n{\n\tunion wimlib_progress_info info;\n\n\tinfo.done_with_file.path_to_file = path;\n\n\treturn call_progress(progfunc, WIMLIB_PROGRESS_MSG_DONE_WITH_FILE,\n\t\t\t     &info, progctx);\n}\n\nstatic int\ndo_done_with_blob(struct blob_descriptor *blob,\n\t\t  wimlib_progress_func_t progfunc, void *progctx)\n{\n\tint ret;\n\tstruct wim_inode *inode;\n\tconst tchar *path;\n\ttchar *cookie1;\n\ttchar *cookie2;\n\n\tif (!blob->may_send_done_with_file)\n\t\treturn 0;\n\n\tinode = blob->file_inode;\n\n\twimlib_assert(inode != NULL);\n\twimlib_assert(inode->i_num_remaining_streams > 0);\n\tif (--inode->i_num_remaining_streams > 0)\n\t\treturn 0;\n\n\tpath = blob_file_path(blob);\n\n\tcookie1 = progress_get_streamless_path(path);\n\tcookie2 = progress_get_win32_path(path);\n\n\tret = done_with_file(path, progfunc, progctx);\n\n\tprogress_put_win32_path(cookie2);\n\tprogress_put_streamless_path(cookie1);\n\n\treturn ret;\n}\n\n/* Handle WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES mode.  */\nstatic inline int\ndone_with_blob(struct blob_descriptor *blob, struct write_blobs_ctx *ctx)\n{\n\tif (likely(!(ctx->write_resource_flags &\n\t\t     WRITE_RESOURCE_FLAG_SEND_DONE_WITH_FILE)))\n\t\treturn 0;\n\treturn do_done_with_blob(blob, ctx->progress_data.progfunc,\n\t\t\t\t ctx->progress_data.progctx);\n}\n\n/* Begin processing a blob for writing.  */\nstatic int\nwrite_blob_begin_read(struct blob_descriptor *blob, void *_ctx)\n{\n\tstruct write_blobs_ctx *ctx = _ctx;\n\tint ret;\n\n\twimlib_assert(blob->size > 0);\n\n\t/* As an optimization, we allow some blobs to be \"unhashed\", meaning\n\t * their SHA-1 message digests are unknown.  This is the case with blobs\n\t * that are added by scanning a directory tree with wimlib_add_image(),\n\t * for example.  Since WIM uses single-instance blobs, we don't know\n\t * whether such each such blob really need to written until it is\n\t * actually checksummed, unless it has a unique size.  In such cases we\n\t * read and checksum the blob in this function, thereby advancing ahead\n\t * of read_blob_list(), which will still provide the data again to\n\t * write_blob_process_chunk().  This is okay because an unhashed blob\n\t * cannot be in a WIM resource, which might be costly to decompress.  */\n\tif (ctx->blob_table != NULL && blob->unhashed && !blob->unique_size) {\n\n\t\tstruct blob_descriptor *new_blob;\n\n\t\tret = hash_unhashed_blob(blob, ctx->blob_table, &new_blob);\n\t\tif (ret)\n\t\t\treturn ret;\n\t\tif (new_blob != blob) {\n\t\t\t/* Duplicate blob detected.  */\n\n\t\t\tif (new_blob->will_be_in_output_wim ||\n\t\t\t    blob_filtered(new_blob, ctx->filter_ctx))\n\t\t\t{\n\t\t\t\t/* The duplicate blob is already being included\n\t\t\t\t * in the output WIM, or it would be filtered\n\t\t\t\t * out if it had been.  Skip writing this blob\n\t\t\t\t * (and reading it again) entirely, passing its\n\t\t\t\t * output reference count to the duplicate blob\n\t\t\t\t * in the former case.  */\n\t\t\t\tret = do_write_blobs_progress(&ctx->progress_data,\n\t\t\t\t\t\t\t      blob->size,\n\t\t\t\t\t\t\t      blob->size,\n\t\t\t\t\t\t\t      1, true);\n\t\t\t\tlist_del(&blob->write_blobs_list);\n\t\t\t\tlist_del(&blob->blob_table_list);\n\t\t\t\tif (new_blob->will_be_in_output_wim)\n\t\t\t\t\tnew_blob->out_refcnt += blob->out_refcnt;\n\t\t\t\tif (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID)\n\t\t\t\t\tctx->cur_write_res_size -= blob->size;\n\t\t\t\tif (!ret)\n\t\t\t\t\tret = done_with_blob(blob, ctx);\n\t\t\t\tfree_blob_descriptor(blob);\n\t\t\t\tif (ret)\n\t\t\t\t\treturn ret;\n\t\t\t\treturn BEGIN_BLOB_STATUS_SKIP_BLOB;\n\t\t\t} else {\n\t\t\t\t/* The duplicate blob can validly be written,\n\t\t\t\t * but was not marked as such.  Discard the\n\t\t\t\t * current blob descriptor and use the\n\t\t\t\t * duplicate, but actually freeing the current\n\t\t\t\t * blob descriptor must wait until\n\t\t\t\t * read_blob_list() has finished reading its\n\t\t\t\t * data.  */\n\t\t\t\tlist_replace(&blob->write_blobs_list,\n\t\t\t\t\t     &new_blob->write_blobs_list);\n\t\t\t\tlist_replace(&blob->blob_table_list,\n\t\t\t\t\t     &new_blob->blob_table_list);\n\t\t\t\tblob->will_be_in_output_wim = 0;\n\t\t\t\tnew_blob->out_refcnt = blob->out_refcnt;\n\t\t\t\tnew_blob->will_be_in_output_wim = 1;\n\t\t\t\tnew_blob->may_send_done_with_file = 0;\n\t\t\t\tblob = new_blob;\n\t\t\t}\n\t\t}\n\t}\n\tlist_move_tail(&blob->write_blobs_list, &ctx->blobs_being_compressed);\n\treturn 0;\n}\n\n/* Rewrite a blob that was just written compressed (as a non-solid WIM resource)\n * as uncompressed instead.  */\nstatic int\nwrite_blob_uncompressed(struct blob_descriptor *blob, struct filedes *out_fd)\n{\n\tint ret;\n\tu64 begin_offset = blob->out_reshdr.offset_in_wim;\n\tu64 end_offset = out_fd->offset;\n\n\tif (filedes_seek(out_fd, begin_offset) == -1)\n\t\treturn 0;\n\n\tret = extract_blob_to_fd(blob, out_fd, false);\n\tif (ret) {\n\t\t/* Error reading the uncompressed data.  */\n\t\tif (out_fd->offset == begin_offset &&\n\t\t    filedes_seek(out_fd, end_offset) != -1)\n\t\t{\n\t\t\t/* Nothing was actually written yet, and we successfully\n\t\t\t * seeked to the end of the compressed resource, so\n\t\t\t * don't issue a hard error; just keep the compressed\n\t\t\t * resource instead.  */\n\t\t\tWARNING(\"Recovered compressed resource of \"\n\t\t\t\t\"size %\"PRIu64\", continuing on.\", blob->size);\n\t\t\treturn 0;\n\t\t}\n\t\treturn ret;\n\t}\n\n\twimlib_assert(out_fd->offset - begin_offset == blob->size);\n\n\t/* We could ftruncate() the file to 'out_fd->offset' here, but there\n\t * isn't much point.  Usually we will only be truncating by a few bytes\n\t * and will just overwrite the data immediately.  */\n\n\tblob->out_reshdr.size_in_wim = blob->size;\n\tblob->out_reshdr.flags &= ~(WIM_RESHDR_FLAG_COMPRESSED |\n\t\t\t\t    WIM_RESHDR_FLAG_SOLID);\n\treturn 0;\n}\n\n/* Returns true if the specified blob, which was written as a non-solid\n * resource, should be truncated from the WIM file and re-written uncompressed.\n * blob->out_reshdr must be filled in from the initial write of the blob.  */\nstatic bool\nshould_rewrite_blob_uncompressed(const struct write_blobs_ctx *ctx,\n\t\t\t\t const struct blob_descriptor *blob)\n{\n\t/* If the compressed data is smaller than the uncompressed data, prefer\n\t * the compressed data.  */\n\tif (blob->out_reshdr.size_in_wim < blob->out_reshdr.uncompressed_size)\n\t\treturn false;\n\n\t/* If we're not actually writing compressed data, then there's no need\n\t * for re-writing.  */\n\tif (!ctx->compressor)\n\t\treturn false;\n\n\t/* If writing a pipable WIM, everything we write to the output is final\n\t * (it might actually be a pipe!).  */\n\tif (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE)\n\t\treturn false;\n\n\t/* If the blob that would need to be re-read is located in a solid\n\t * resource in another WIM file, then re-reading it would be costly.  So\n\t * don't do it.\n\t *\n\t * Exception: if the compressed size happens to be *exactly* the same as\n\t * the uncompressed size, then the blob *must* be written uncompressed\n\t * in order to remain compatible with the Windows Overlay Filesystem\n\t * filter driver (WOF).\n\t *\n\t * TODO: we are currently assuming that the optimization for\n\t * single-chunk resources in maybe_rewrite_blob_uncompressed() prevents\n\t * this case from being triggered too often.  To fully prevent excessive\n\t * decompressions in degenerate cases, we really should obtain the\n\t * uncompressed data by decompressing the compressed data we wrote to\n\t * the output file.\n\t */\n\tif (blob->blob_location == BLOB_IN_WIM &&\n\t    blob->size != blob->rdesc->uncompressed_size &&\n\t    blob->size != blob->out_reshdr.size_in_wim)\n\t\treturn false;\n\n\treturn true;\n}\n\nstatic int\nmaybe_rewrite_blob_uncompressed(struct write_blobs_ctx *ctx,\n\t\t\t\tstruct blob_descriptor *blob)\n{\n\tif (!should_rewrite_blob_uncompressed(ctx, blob))\n\t\treturn 0;\n\n\t/* Regular (non-solid) WIM resources with exactly one chunk and\n\t * compressed size equal to uncompressed size are exactly the same as\n\t * the corresponding compressed data --- since there must be 0 entries\n\t * in the chunk table and the only chunk must be stored uncompressed.\n\t * In this case, there's no need to rewrite anything.  */\n\tif (ctx->chunk_index == 1 &&\n\t    blob->out_reshdr.size_in_wim == blob->out_reshdr.uncompressed_size)\n\t{\n\t\tblob->out_reshdr.flags &= ~WIM_RESHDR_FLAG_COMPRESSED;\n\t\treturn 0;\n\t}\n\n\treturn write_blob_uncompressed(blob, ctx->out_fd);\n}\n\n/* Write the next chunk of (typically compressed) data to the output WIM,\n * handling the writing of the chunk table.  */\nstatic int\nwrite_chunk(struct write_blobs_ctx *ctx, const void *cchunk,\n\t    size_t csize, size_t usize)\n{\n\tint ret;\n\tstruct blob_descriptor *blob;\n\tu32 completed_blob_count = 0;\n\n\tblob = list_entry(ctx->blobs_being_compressed.next,\n\t\t\t  struct blob_descriptor, write_blobs_list);\n\n\tif (ctx->cur_write_blob_offset == 0 &&\n\t    !(ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID))\n\t{\n\t\t/* Starting to write a new blob in non-solid mode.  */\n\n\t\tif (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE) {\n\t\t\tret = write_pwm_blob_header(blob, ctx->out_fd,\n\t\t\t\t\t\t    ctx->compressor != NULL);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t}\n\n\t\tret = begin_write_resource(ctx, blob->size);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\tif (ctx->compressor != NULL) {\n\t\t/* Record the compresed chunk size.  */\n\t\twimlib_assert(ctx->chunk_index < ctx->num_alloc_chunks);\n\t\tctx->chunk_csizes[ctx->chunk_index++] = csize;\n\n\t       /* If writing a pipable WIM, before the chunk data write a chunk\n\t\t* header that provides the compressed chunk size.  */\n\t\tif (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_PIPABLE) {\n\t\t\tstruct pwm_chunk_hdr chunk_hdr = {\n\t\t\t\t.compressed_size = cpu_to_le32(csize),\n\t\t\t};\n\t\t\tret = full_write(ctx->out_fd, &chunk_hdr,\n\t\t\t\t\t sizeof(chunk_hdr));\n\t\t\tif (ret)\n\t\t\t\tgoto write_error;\n\t\t}\n\t}\n\n\t/* Write the chunk data.  */\n\tret = full_write(ctx->out_fd, cchunk, csize);\n\tif (ret)\n\t\tgoto write_error;\n\n\tctx->cur_write_blob_offset += usize;\n\n\tif (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) {\n\t\t/* Wrote chunk in solid mode.  It may have finished multiple\n\t\t * blobs.  */\n\t\tstruct blob_descriptor *next_blob;\n\n\t\twhile (blob && ctx->cur_write_blob_offset >= blob->size) {\n\n\t\t\tctx->cur_write_blob_offset -= blob->size;\n\n\t\t\tif (ctx->cur_write_blob_offset)\n\t\t\t\tnext_blob = list_entry(blob->write_blobs_list.next,\n\t\t\t\t\t\t      struct blob_descriptor,\n\t\t\t\t\t\t      write_blobs_list);\n\t\t\telse\n\t\t\t\tnext_blob = NULL;\n\n\t\t\tret = done_with_blob(blob, ctx);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\tlist_move_tail(&blob->write_blobs_list, &ctx->blobs_in_solid_resource);\n\t\t\tcompleted_blob_count++;\n\n\t\t\tblob = next_blob;\n\t\t}\n\t} else {\n\t\t/* Wrote chunk in non-solid mode.  It may have finished a\n\t\t * blob.  */\n\t\tif (ctx->cur_write_blob_offset == blob->size) {\n\n\t\t\twimlib_assert(ctx->cur_write_blob_offset ==\n\t\t\t\t      ctx->cur_write_res_size);\n\n\t\t\tret = end_write_resource(ctx, &blob->out_reshdr);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\n\t\t\tblob->out_reshdr.flags = reshdr_flags_for_blob(blob);\n\t\t\tif (ctx->compressor != NULL)\n\t\t\t\tblob->out_reshdr.flags |= WIM_RESHDR_FLAG_COMPRESSED;\n\n\t\t\tret = maybe_rewrite_blob_uncompressed(ctx, blob);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\n\t\t\twimlib_assert(blob->out_reshdr.uncompressed_size == blob->size);\n\n\t\t\tctx->cur_write_blob_offset = 0;\n\n\t\t\tret = done_with_blob(blob, ctx);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\tlist_del(&blob->write_blobs_list);\n\t\t\tcompleted_blob_count++;\n\t\t}\n\t}\n\n\treturn do_write_blobs_progress(&ctx->progress_data, usize, csize,\n\t\t\t\t       completed_blob_count, false);\n\nwrite_error:\n\tERROR_WITH_ERRNO(\"Error writing chunk data to WIM file\");\n\treturn ret;\n}\n\nstatic int\nprepare_chunk_buffer(struct write_blobs_ctx *ctx)\n{\n\t/* While we are unable to get a new chunk buffer due to too many chunks\n\t * already outstanding, retrieve and write the next compressed chunk. */\n\twhile (!(ctx->cur_chunk_buf =\n\t\t ctx->compressor->get_chunk_buffer(ctx->compressor)))\n\t{\n\t\tconst void *cchunk;\n\t\tu32 csize;\n\t\tu32 usize;\n\t\tbool bret;\n\t\tint ret;\n\n\t\tbret = ctx->compressor->get_compression_result(ctx->compressor,\n\t\t\t\t\t\t\t       &cchunk,\n\t\t\t\t\t\t\t       &csize,\n\t\t\t\t\t\t\t       &usize);\n\t\twimlib_assert(bret);\n\n\t\tret = write_chunk(ctx, cchunk, csize, usize);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\n/* Process the next chunk of data to be written to a WIM resource.  */\nstatic int\nwrite_blob_process_chunk(const struct blob_descriptor *blob, u64 offset,\n\t\t\t const void *chunk, size_t size, void *_ctx)\n{\n\tstruct write_blobs_ctx *ctx = _ctx;\n\tint ret;\n\tconst u8 *chunkptr, *chunkend;\n\n\twimlib_assert(size != 0);\n\twimlib_assert(ctx);\n\tif (!ctx)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (ctx->compressor == NULL) {\n\t\t/* Write chunk uncompressed.  */\n\t\t ret = write_chunk(ctx, chunk, size, size);\n\t\t if (ret)\n\t\t\t return ret;\n\t\t return 0;\n\t}\n\n\t/* Submit the chunk for compression, but take into account that the\n\t * @size the chunk was provided in may not correspond to the\n\t * @out_chunk_size being used for compression.  */\n\tchunkptr = chunk;\n\tchunkend = chunkptr + size;\n\tdo {\n\t\tsize_t needed_chunk_size;\n\t\tsize_t bytes_consumed;\n\n\t\tif (!ctx->cur_chunk_buf) {\n\t\t\tret = prepare_chunk_buffer(ctx);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\tif (!ctx->cur_chunk_buf)\n\t\t\t\treturn WIMLIB_ERR_INTEGRITY;\n\t\t}\n\n\t\tif (ctx->write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) {\n\t\t\tneeded_chunk_size = ctx->out_chunk_size;\n\t\t} else {\n\t\t\tneeded_chunk_size = min(ctx->out_chunk_size,\n\t\t\t\t\t\tctx->cur_chunk_buf_filled +\n\t\t\t\t\t\t\t(blob->size - offset));\n\t\t}\n\n\t\tbytes_consumed = min(chunkend - chunkptr,\n\t\t\t\t     needed_chunk_size - ctx->cur_chunk_buf_filled);\n\n\t\tmemcpy(&ctx->cur_chunk_buf[ctx->cur_chunk_buf_filled],\n\t\t       chunkptr, bytes_consumed);\n\n\t\tchunkptr += bytes_consumed;\n\t\toffset += bytes_consumed;\n\t\tctx->cur_chunk_buf_filled += bytes_consumed;\n\n\t\tif (ctx->cur_chunk_buf_filled == needed_chunk_size) {\n\t\t\tctx->compressor->signal_chunk_filled(ctx->compressor,\n\t\t\t\t\t\t\t     ctx->cur_chunk_buf_filled);\n\t\t\tctx->cur_chunk_buf = NULL;\n\t\t\tctx->cur_chunk_buf_filled = 0;\n\t\t}\n\t} while (chunkptr != chunkend);\n\treturn 0;\n}\n\n/* Finish processing a blob for writing.  It may not have been completely\n * written yet, as the chunk_compressor implementation may still have chunks\n * buffered or being compressed.  */\nstatic int\nwrite_blob_end_read(struct blob_descriptor *blob, int status, void *_ctx)\n{\n\tstruct write_blobs_ctx *ctx = _ctx;\n\n\tif (!blob->will_be_in_output_wim) {\n\t\t/* The blob was a duplicate.  Now that its data has finished\n\t\t * being read, it is being discarded in favor of the duplicate\n\t\t * entry.  It therefore is no longer needed, and we can fire the\n\t\t * DONE_WITH_FILE callback because the file will not be read\n\t\t * again.\n\t\t *\n\t\t * Note: we can't yet fire DONE_WITH_FILE for non-duplicate\n\t\t * blobs, since it needs to be possible to re-read the file if\n\t\t * it does not compress to less than its original size.  */\n\t\tif (!status)\n\t\t\tstatus = done_with_blob(blob, ctx);\n\t\tfree_blob_descriptor(blob);\n\t} else if (!status && blob->unhashed && ctx->blob_table != NULL) {\n\t\t/* The blob was not a duplicate and was previously unhashed.\n\t\t * Since we passed COMPUTE_MISSING_BLOB_HASHES to\n\t\t * read_blob_list(), blob->hash is now computed and valid.  So\n\t\t * turn this blob into a \"hashed\" blob.  */\n\t\tlist_del(&blob->unhashed_list);\n\t\tblob_table_insert(ctx->blob_table, blob);\n\t\tblob->unhashed = 0;\n\t}\n\treturn status;\n}\n\n/*\n * Compute statistics about a list of blobs that will be written.\n *\n * Assumes the blobs are sorted such that all blobs located in each distinct WIM\n * (specified by WIMStruct) are together.\n *\n * For compactions, also verify that there are no overlapping resources.  This\n * really should be checked earlier, but for now it's easiest to check here.\n */\nstatic int\ncompute_blob_list_stats(struct list_head *blob_list,\n\t\t\tstruct write_blobs_ctx *ctx)\n{\n\tstruct blob_descriptor *blob;\n\tu64 total_bytes = 0;\n\tu64 num_blobs = 0;\n\tu64 total_parts = 0;\n\tWIMStruct *prev_wim_part = NULL;\n\tconst struct wim_resource_descriptor *prev_rdesc = NULL;\n\n\tlist_for_each_entry(blob, blob_list, write_blobs_list) {\n\t\tnum_blobs++;\n\t\ttotal_bytes += blob->size;\n\t\tif (blob->blob_location == BLOB_IN_WIM) {\n\t\t\tconst struct wim_resource_descriptor *rdesc = blob->rdesc;\n\t\t\tWIMStruct *wim = rdesc->wim;\n\n\t\t\twimlib_assert(wim);\n\t\t\tif (!wim)\n\t\t\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t\t\tif (prev_wim_part != wim) {\n\t\t\t\tprev_wim_part = wim;\n\t\t\t\ttotal_parts++;\n\t\t\t}\n\t\t\tif (unlikely(wim->being_compacted) && rdesc != prev_rdesc) {\n\t\t\t\tif (prev_rdesc != NULL &&\n\t\t\t\t    rdesc->offset_in_wim <\n\t\t\t\t\t\tprev_rdesc->offset_in_wim +\n\t\t\t\t\t\tprev_rdesc->size_in_wim)\n\t\t\t\t{\n\t\t\t\t\tWARNING(\"WIM file contains overlapping \"\n\t\t\t\t\t\t\"resources!  Compaction is not \"\n\t\t\t\t\t\t\"possible.\");\n\t\t\t\t\treturn WIMLIB_ERR_RESOURCE_ORDER;\n\t\t\t\t}\n\t\t\t\tprev_rdesc = rdesc;\n\t\t\t}\n\t\t}\n\t}\n\tctx->progress_data.progress.write_streams.total_bytes       = total_bytes;\n\tctx->progress_data.progress.write_streams.total_streams     = num_blobs;\n\tctx->progress_data.progress.write_streams.completed_bytes   = 0;\n\tctx->progress_data.progress.write_streams.completed_streams = 0;\n\tctx->progress_data.progress.write_streams.compression_type  = ctx->out_ctype;\n\tctx->progress_data.progress.write_streams.total_parts       = total_parts;\n\tctx->progress_data.progress.write_streams.completed_parts   = 0;\n\tctx->progress_data.next_progress = 0;\n\treturn 0;\n}\n\n/* Find blobs in @blob_list that can be copied to the output WIM in raw form\n * rather than compressed.  Delete these blobs from @blob_list and move them to\n * @raw_copy_blobs.  Return the total uncompressed size of the blobs that need\n * to be compressed.  */\nstatic u64\nfind_raw_copy_blobs(struct list_head *blob_list, int write_resource_flags,\n\t\t    int out_ctype, u32 out_chunk_size,\n\t\t    struct list_head *raw_copy_blobs)\n{\n\tstruct blob_descriptor *blob, *tmp;\n\tu64 num_nonraw_bytes = 0;\n\n\tINIT_LIST_HEAD(raw_copy_blobs);\n\n\t/* Initialize temporary raw_copy_ok flag.  */\n\tlist_for_each_entry(blob, blob_list, write_blobs_list)\n\t\tif (blob->blob_location == BLOB_IN_WIM)\n\t\t\tblob->rdesc->raw_copy_ok = 0;\n\n\tlist_for_each_entry_safe(blob, tmp, blob_list, write_blobs_list) {\n\t\tif (can_raw_copy(blob, write_resource_flags,\n\t\t\t\t out_ctype, out_chunk_size))\n\t\t{\n\t\t\tblob->rdesc->raw_copy_ok = 1;\n\t\t\tlist_move_tail(&blob->write_blobs_list, raw_copy_blobs);\n\t\t} else {\n\t\t\tnum_nonraw_bytes += blob->size;\n\t\t}\n\t}\n\n\treturn num_nonraw_bytes;\n}\n\n/* Copy a raw compressed resource located in another WIM file to the WIM file\n * being written.  */\nstatic int\nwrite_raw_copy_resource(struct wim_resource_descriptor *in_rdesc,\n\t\t\tstruct filedes *out_fd)\n{\n\tu64 cur_read_offset;\n\tu64 end_read_offset;\n\tu8 buf[BUFFER_SIZE];\n\tsize_t bytes_to_read;\n\tint ret;\n\tstruct filedes *in_fd;\n\tstruct blob_descriptor *blob;\n\tu64 out_offset_in_wim;\n\n\t/* Copy the raw data.  */\n\tcur_read_offset = in_rdesc->offset_in_wim;\n\tend_read_offset = cur_read_offset + in_rdesc->size_in_wim;\n\n\tout_offset_in_wim = out_fd->offset;\n\n\tif (in_rdesc->is_pipable) {\n\t\tif (cur_read_offset < sizeof(struct pwm_blob_hdr))\n\t\t\treturn WIMLIB_ERR_INVALID_PIPABLE_WIM;\n\t\tcur_read_offset -= sizeof(struct pwm_blob_hdr);\n\t\tout_offset_in_wim += sizeof(struct pwm_blob_hdr);\n\t}\n\tin_fd = &in_rdesc->wim->in_fd;\n\twimlib_assert(cur_read_offset != end_read_offset);\n\n\tif (likely(!in_rdesc->wim->being_compacted) ||\n\t    in_rdesc->offset_in_wim > out_fd->offset) {\n\t\tdo {\n\t\t\tbytes_to_read = min(sizeof(buf),\n\t\t\t\t\t    end_read_offset - cur_read_offset);\n\n\t\t\tret = full_pread(in_fd, buf, bytes_to_read,\n\t\t\t\t\t cur_read_offset);\n\t\t\tif (ret) {\n\t\t\t\tERROR_WITH_ERRNO(\"Error reading raw data \"\n\t\t\t\t\t\t \"from WIM file\");\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\tret = full_write(out_fd, buf, bytes_to_read);\n\t\t\tif (ret) {\n\t\t\t\tERROR_WITH_ERRNO(\"Error writing raw data \"\n\t\t\t\t\t\t \"to WIM file\");\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\tcur_read_offset += bytes_to_read;\n\n\t\t} while (cur_read_offset != end_read_offset);\n\t} else {\n\t\t/* Optimization: the WIM file is being compacted and the\n\t\t * resource being written is already in the desired location.\n\t\t * Skip over the data instead of re-writing it.  */\n\n\t\t/* Due the earlier check for overlapping resources, it should\n\t\t * never be the case that we already overwrote the resource.  */\n\t\twimlib_assert(!(in_rdesc->offset_in_wim < out_fd->offset));\n\n\t\tif (-1 == filedes_seek(out_fd, out_fd->offset + in_rdesc->size_in_wim))\n\t\t\treturn WIMLIB_ERR_WRITE;\n\t}\n\n\tlist_for_each_entry(blob, &in_rdesc->blob_list, rdesc_node) {\n\t\tif (blob->will_be_in_output_wim) {\n\t\t\tblob_set_out_reshdr_for_reuse(blob);\n\t\t\tif (in_rdesc->flags & WIM_RESHDR_FLAG_SOLID)\n\t\t\t\tblob->out_res_offset_in_wim = out_offset_in_wim;\n\t\t\telse\n\t\t\t\tblob->out_reshdr.offset_in_wim = out_offset_in_wim;\n\n\t\t}\n\t}\n\treturn 0;\n}\n\n/* Copy a list of raw compressed resources located in other WIM file(s) to the\n * WIM file being written.  */\nstatic int\nwrite_raw_copy_resources(struct list_head *raw_copy_blobs,\n\t\t\t struct filedes *out_fd,\n\t\t\t struct write_blobs_progress_data *progress_data)\n{\n\tstruct blob_descriptor *blob;\n\tint ret;\n\n\tlist_for_each_entry(blob, raw_copy_blobs, write_blobs_list)\n\t\tblob->rdesc->raw_copy_ok = 1;\n\n\tlist_for_each_entry(blob, raw_copy_blobs, write_blobs_list) {\n\t\tu64 compressed_size = 0;\n\n\t\tif (blob->rdesc->raw_copy_ok) {\n\t\t\t/* Write each solid resource only one time.  */\n\t\t\tret = write_raw_copy_resource(blob->rdesc, out_fd);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\tblob->rdesc->raw_copy_ok = 0;\n\t\t\tcompressed_size = blob->rdesc->size_in_wim;\n\t\t}\n\t\tret = do_write_blobs_progress(progress_data, blob->size,\n\t\t\t\t\t      compressed_size, 1, false);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\n/* Wait for and write all chunks pending in the compressor.  */\nstatic int\nfinish_remaining_chunks(struct write_blobs_ctx *ctx)\n{\n\tconst void *cdata;\n\tu32 csize;\n\tu32 usize;\n\tint ret;\n\n\tif (ctx->compressor == NULL)\n\t\treturn 0;\n\n\tif (ctx->cur_chunk_buf_filled != 0) {\n\t\tctx->compressor->signal_chunk_filled(ctx->compressor,\n\t\t\t\t\t\t     ctx->cur_chunk_buf_filled);\n\t}\n\n\twhile (ctx->compressor->get_compression_result(ctx->compressor, &cdata,\n\t\t\t\t\t\t       &csize, &usize))\n\t{\n\t\tret = write_chunk(ctx, cdata, csize, usize);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nstatic void\nvalidate_blob_list(struct list_head *blob_list)\n{\n\tstruct blob_descriptor *blob;\n\n\tlist_for_each_entry(blob, blob_list, write_blobs_list) {\n\t\twimlib_assert(blob->will_be_in_output_wim);\n\t\twimlib_assert(blob->size != 0);\n\t}\n}\n\nstatic void\ninit_done_with_file_info(struct list_head *blob_list)\n{\n\tstruct blob_descriptor *blob;\n\n\tlist_for_each_entry(blob, blob_list, write_blobs_list) {\n\t\tif (blob_is_in_file(blob)) {\n\t\t\tblob->file_inode->i_num_remaining_streams = 0;\n\t\t\tblob->may_send_done_with_file = 1;\n\t\t} else {\n\t\t\tblob->may_send_done_with_file = 0;\n\t\t}\n\t}\n\n\tlist_for_each_entry(blob, blob_list, write_blobs_list)\n\t\tif (blob->may_send_done_with_file)\n\t\t\tblob->file_inode->i_num_remaining_streams++;\n}\n\n/*\n * Write a list of blobs to the output WIM file.\n *\n * @blob_list\n *\tThe list of blobs to write, specified by a list of 'struct blob_descriptor' linked\n *\tby the 'write_blobs_list' member.\n *\n * @out_fd\n *\tThe file descriptor, opened for writing, to which to write the blobs.\n *\n * @write_resource_flags\n *\tFlags to modify how the blobs are written:\n *\n *\tWRITE_RESOURCE_FLAG_RECOMPRESS:\n *\t\tForce compression of all resources, even if they could otherwise\n *\t\tbe re-used by copying the raw data, due to being located in a WIM\n *\t\tfile with compatible compression parameters.\n *\n *\tWRITE_RESOURCE_FLAG_PIPABLE:\n *\t\tWrite the resources in the wimlib-specific pipable format, and\n *\t\tfurthermore do so in such a way that no seeking backwards in\n *\t\t@out_fd will be performed (so it may be a pipe).\n *\n *\tWRITE_RESOURCE_FLAG_SOLID:\n *\t\tCombine all the blobs into a single resource rather than writing\n *\t\tthem in separate resources.  This flag is only valid if the WIM\n *\t\tversion number has been, or will be, set to WIM_VERSION_SOLID.\n *\t\tThis flag may not be combined with WRITE_RESOURCE_FLAG_PIPABLE.\n *\n * @out_ctype\n *\tCompression format to use in the output resources, specified as one of\n *\tthe WIMLIB_COMPRESSION_TYPE_* constants.  WIMLIB_COMPRESSION_TYPE_NONE\n *\tis allowed.\n *\n * @out_chunk_size\n *\tCompression chunk size to use in the output resources.  It must be a\n *\tvalid chunk size for the specified compression format @out_ctype, unless\n *\t@out_ctype is WIMLIB_COMPRESSION_TYPE_NONE, in which case this parameter\n *\tis ignored.\n *\n * @num_threads\n *\tNumber of threads to use to compress data.  If 0, a default number of\n *\tthreads will be chosen.  The number of threads still may be decreased\n *\tfrom the specified value if insufficient memory is detected.\n *\n * @blob_table\n *\tIf on-the-fly deduplication of unhashed blobs is desired, this parameter\n *\tmust be pointer to the blob table for the WIMStruct on whose behalf the\n *\tblobs are being written.  Otherwise, this parameter can be NULL.\n *\n * @filter_ctx\n *\tIf on-the-fly deduplication of unhashed blobs is desired, this parameter\n *\tcan be a pointer to a context for blob filtering used to detect whether\n *\tthe duplicate blob has been hard-filtered or not.  If no blobs are\n *\thard-filtered or no blobs are unhashed, this parameter can be NULL.\n *\n * This function will write the blobs in @blob_list to resources in\n * consecutive positions in the output WIM file, or to a single solid resource\n * if WRITE_RESOURCE_FLAG_SOLID was specified in @write_resource_flags.  In both\n * cases, the @out_reshdr of the `struct blob_descriptor' for each blob written will be\n * updated to specify its location, size, and flags in the output WIM.  In the\n * solid resource case, WIM_RESHDR_FLAG_SOLID will be set in the @flags field of\n * each @out_reshdr, and furthermore @out_res_offset_in_wim and\n * @out_res_size_in_wim of each @out_reshdr will be set to the offset and size,\n * respectively, in the output WIM of the solid resource containing the\n * corresponding blob.\n *\n * Each of the blobs to write may be in any location supported by the\n * resource-handling code (specifically, read_blob_list()), such as the contents\n * of external file that has been logically added to the output WIM, or a blob\n * in another WIM file that has been imported, or even a blob in the \"same\" WIM\n * file of which a modified copy is being written.  In the case that a blob is\n * already in a WIM file and uses compatible compression parameters, by default\n * this function will re-use the raw data instead of decompressing it, then\n * recompressing it; however, with WRITE_RESOURCE_FLAG_RECOMPRESS\n * specified in @write_resource_flags, this is not done.\n *\n * As a further requirement, this function requires that the\n * @will_be_in_output_wim member be set to 1 on all blobs in @blob_list as well\n * as any other blobs not in @blob_list that will be in the output WIM file, but\n * set to 0 on any other blobs in the output WIM's blob table or sharing a solid\n * resource with a blob in @blob_list.  Still furthermore, if on-the-fly\n * deduplication of blobs is possible, then all blobs in @blob_list must also be\n * linked by @blob_table_list along with any other blobs that have\n * @will_be_in_output_wim set.\n *\n * This function handles on-the-fly deduplication of blobs for which SHA-1\n * message digests have not yet been calculated.  Such blobs may or may not need\n * to be written.  If @blob_table is non-NULL, then each blob in @blob_list that\n * has @unhashed set but not @unique_size set is checksummed immediately before\n * it would otherwise be read for writing in order to determine if it is\n * identical to another blob already being written or one that would be filtered\n * out of the output WIM using blob_filtered() with the context @filter_ctx.\n * Each such duplicate blob will be removed from @blob_list, its reference count\n * transferred to the pre-existing duplicate blob, its memory freed, and will\n * not be written.  Alternatively, if a blob in @blob_list is a duplicate with\n * any blob in @blob_table that has not been marked for writing or would not be\n * hard-filtered, it is freed and the pre-existing duplicate is written instead,\n * taking ownership of the reference count and slot in the @blob_table_list.\n *\n * Returns 0 if every blob was either written successfully or did not need to be\n * written; otherwise returns a non-zero error code.\n */\nstatic int\nwrite_blob_list(struct list_head *blob_list,\n\t\tstruct filedes *out_fd,\n\t\tint write_resource_flags,\n\t\tint out_ctype,\n\t\tu32 out_chunk_size,\n\t\tunsigned num_threads,\n\t\tstruct blob_table *blob_table,\n\t\tstruct filter_context *filter_ctx,\n\t\twimlib_progress_func_t progfunc,\n\t\tvoid *progctx)\n{\n\tint ret;\n\tstruct write_blobs_ctx ctx;\n\tstruct list_head raw_copy_blobs;\n\tu64 num_nonraw_bytes;\n\n\twimlib_assert((write_resource_flags &\n\t\t       (WRITE_RESOURCE_FLAG_SOLID |\n\t\t\tWRITE_RESOURCE_FLAG_PIPABLE)) !=\n\t\t\t\t(WRITE_RESOURCE_FLAG_SOLID |\n\t\t\t\t WRITE_RESOURCE_FLAG_PIPABLE));\n\n\tvalidate_blob_list(blob_list);\n\n\tif (list_empty(blob_list))\n\t\treturn 0;\n\n\t/* If needed, set auxiliary information so that we can detect when the\n\t * library has finished using each external file.  */\n\tif (unlikely(write_resource_flags & WRITE_RESOURCE_FLAG_SEND_DONE_WITH_FILE))\n\t\tinit_done_with_file_info(blob_list);\n\n\tmemset(&ctx, 0, sizeof(ctx));\n\n\tctx.out_fd = out_fd;\n\tctx.blob_table = blob_table;\n\tctx.out_ctype = out_ctype;\n\tctx.out_chunk_size = out_chunk_size;\n\tctx.write_resource_flags = write_resource_flags;\n\tctx.filter_ctx = filter_ctx;\n\n\t/*\n\t * We normally sort the blobs to write by a \"sequential\" order that is\n\t * optimized for reading.  But when using solid compression, we instead\n\t * sort the blobs by file extension and file name (when applicable; and\n\t * we don't do this for blobs from solid resources) so that similar\n\t * files are grouped together, which improves the compression ratio.\n\t * This is somewhat of a hack since a blob does not necessarily\n\t * correspond one-to-one with a filename, nor is there any guarantee\n\t * that two files with similar names or extensions are actually similar\n\t * in content.  A potential TODO is to sort the blobs based on some\n\t * measure of similarity of their actual contents.\n\t */\n\n\tret = sort_blob_list_by_sequential_order(blob_list,\n\t\t\t\t\t\t offsetof(struct blob_descriptor,\n\t\t\t\t\t\t\t  write_blobs_list));\n\tif (ret)\n\t\treturn ret;\n\n\tret = compute_blob_list_stats(blob_list, &ctx);\n\tif (ret)\n\t\treturn ret;\n\n\tif (write_resource_flags & WRITE_RESOURCE_FLAG_SOLID_SORT) {\n\t\tret = sort_blob_list_for_solid_compression(blob_list);\n\t\tif (unlikely(ret))\n\t\t\tWARNING(\"Failed to sort blobs for solid compression. Continuing anyways.\");\n\t}\n\n\tctx.progress_data.progfunc = progfunc;\n\tctx.progress_data.progctx = progctx;\n\n\tnum_nonraw_bytes = find_raw_copy_blobs(blob_list, write_resource_flags,\n\t\t\t\t\t       out_ctype, out_chunk_size,\n\t\t\t\t\t       &raw_copy_blobs);\n\n\t/* Unless no data needs to be compressed, allocate a chunk_compressor to\n\t * do compression.  There are serial and parallel implementations of the\n\t * chunk_compressor interface.  We default to parallel using the\n\t * specified number of threads, unless the upper bound on the number\n\t * bytes needing to be compressed is less than a heuristic value.  */\n\tif (num_nonraw_bytes != 0 && out_ctype != WIMLIB_COMPRESSION_TYPE_NONE) {\n\t\tif (num_nonraw_bytes > max(2000000, out_chunk_size)) {\n\t\t\tret = new_parallel_chunk_compressor(out_ctype,\n\t\t\t\t\t\t\t    out_chunk_size,\n\t\t\t\t\t\t\t    num_threads, 0,\n\t\t\t\t\t\t\t    &ctx.compressor);\n\t\t\tif (ret > 0) {\n\t\t\t\tWARNING(\"Couldn't create parallel chunk compressor: %\"TS\".\\n\"\n\t\t\t\t\t\"          Falling back to single-threaded compression.\",\n\t\t\t\t\twimlib_get_error_string(ret));\n\t\t\t}\n\t\t}\n\n\t\tif (ctx.compressor == NULL) {\n\t\t\tret = new_serial_chunk_compressor(out_ctype, out_chunk_size,\n\t\t\t\t\t\t\t  &ctx.compressor);\n\t\t\tif (ret)\n\t\t\t\tgoto out_destroy_context;\n\t\t}\n\t}\n\n\tif (ctx.compressor)\n\t\tctx.progress_data.progress.write_streams.num_threads = ctx.compressor->num_threads;\n\telse\n\t\tctx.progress_data.progress.write_streams.num_threads = 1;\n\n\tret = call_progress(ctx.progress_data.progfunc,\n\t\t\t    WIMLIB_PROGRESS_MSG_WRITE_STREAMS,\n\t\t\t    &ctx.progress_data.progress,\n\t\t\t    ctx.progress_data.progctx);\n\tif (ret)\n\t\tgoto out_destroy_context;\n\n\t/* Copy any compressed resources for which the raw data can be reused\n\t * without decompression.  */\n\tret = write_raw_copy_resources(&raw_copy_blobs, ctx.out_fd,\n\t\t\t\t       &ctx.progress_data);\n\n\tif (ret || num_nonraw_bytes == 0)\n\t\tgoto out_destroy_context;\n\n\tINIT_LIST_HEAD(&ctx.blobs_being_compressed);\n\n\tif (write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) {\n\n\t\tINIT_LIST_HEAD(&ctx.blobs_in_solid_resource);\n\n\t\tret = begin_write_resource(&ctx, num_nonraw_bytes);\n\t\tif (ret)\n\t\t\tgoto out_destroy_context;\n\t}\n\n\t/* Read the list of blobs needing to be compressed, using the specified\n\t * callbacks to execute processing of the data.  */\n\n\tstruct read_blob_callbacks cbs = {\n\t\t.begin_blob\t= write_blob_begin_read,\n\t\t.continue_blob\t= write_blob_process_chunk,\n\t\t.end_blob\t= write_blob_end_read,\n\t\t.ctx\t\t= &ctx,\n\t};\n\n\tret = read_blob_list(blob_list,\n\t\t\t     offsetof(struct blob_descriptor, write_blobs_list),\n\t\t\t     &cbs,\n\t\t\t     BLOB_LIST_ALREADY_SORTED |\n\t\t\t\tVERIFY_BLOB_HASHES |\n\t\t\t\tCOMPUTE_MISSING_BLOB_HASHES);\n\n\tif (ret)\n\t\tgoto out_destroy_context;\n\n\tret = finish_remaining_chunks(&ctx);\n\tif (ret)\n\t\tgoto out_destroy_context;\n\n\tif (write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) {\n\t\tstruct wim_reshdr reshdr;\n\t\tstruct blob_descriptor *blob;\n\t\tu64 offset_in_res;\n\n\t\tret = end_write_resource(&ctx, &reshdr);\n\t\tif (ret)\n\t\t\tgoto out_destroy_context;\n\n\t\toffset_in_res = 0;\n\t\tlist_for_each_entry(blob, &ctx.blobs_in_solid_resource, write_blobs_list) {\n\t\t\tblob->out_reshdr.size_in_wim = blob->size;\n\t\t\tblob->out_reshdr.flags = reshdr_flags_for_blob(blob) |\n\t\t\t\t\t\t WIM_RESHDR_FLAG_SOLID;\n\t\t\tblob->out_reshdr.uncompressed_size = 0;\n\t\t\tblob->out_reshdr.offset_in_wim = offset_in_res;\n\t\t\tblob->out_res_offset_in_wim = reshdr.offset_in_wim;\n\t\t\tblob->out_res_size_in_wim = reshdr.size_in_wim;\n\t\t\tblob->out_res_uncompressed_size = reshdr.uncompressed_size;\n\t\t\toffset_in_res += blob->size;\n\t\t}\n\t\twimlib_assert(offset_in_res == reshdr.uncompressed_size);\n\t}\n\nout_destroy_context:\n\tFREE(ctx.chunk_csizes);\n\tif (ctx.compressor)\n\t\tctx.compressor->destroy(ctx.compressor);\n\treturn ret;\n}\n\n\nstatic int\nwrite_file_data_blobs(WIMStruct *wim,\n\t\t      struct list_head *blob_list,\n\t\t      int write_flags,\n\t\t      unsigned num_threads,\n\t\t      struct filter_context *filter_ctx)\n{\n\tint out_ctype;\n\tu32 out_chunk_size;\n\tint write_resource_flags;\n\n\twrite_resource_flags = write_flags_to_resource_flags(write_flags);\n\n\tif (write_resource_flags & WRITE_RESOURCE_FLAG_SOLID) {\n\t\tout_chunk_size = wim->out_solid_chunk_size;\n\t\tout_ctype = wim->out_solid_compression_type;\n\t} else {\n\t\tout_chunk_size = wim->out_chunk_size;\n\t\tout_ctype = wim->out_compression_type;\n\t}\n\n\treturn write_blob_list(blob_list,\n\t\t\t       &wim->out_fd,\n\t\t\t       write_resource_flags,\n\t\t\t       out_ctype,\n\t\t\t       out_chunk_size,\n\t\t\t       num_threads,\n\t\t\t       wim->blob_table,\n\t\t\t       filter_ctx,\n\t\t\t       wim->progfunc,\n\t\t\t       wim->progctx);\n}\n\n/* Write the contents of the specified blob as a WIM resource.  */\nstatic int\nwrite_wim_resource(struct blob_descriptor *blob,\n\t\t   struct filedes *out_fd,\n\t\t   int out_ctype,\n\t\t   u32 out_chunk_size,\n\t\t   int write_resource_flags)\n{\n\tLIST_HEAD(blob_list);\n\tlist_add(&blob->write_blobs_list, &blob_list);\n\tblob->will_be_in_output_wim = 1;\n\treturn write_blob_list(&blob_list,\n\t\t\t       out_fd,\n\t\t\t       write_resource_flags & ~WRITE_RESOURCE_FLAG_SOLID,\n\t\t\t       out_ctype,\n\t\t\t       out_chunk_size,\n\t\t\t       1,\n\t\t\t       NULL,\n\t\t\t       NULL,\n\t\t\t       NULL,\n\t\t\t       NULL);\n}\n\n/* Write the contents of the specified buffer as a WIM resource.  */\nint\nwrite_wim_resource_from_buffer(const void *buf,\n\t\t\t       size_t buf_size,\n\t\t\t       bool is_metadata,\n\t\t\t       struct filedes *out_fd,\n\t\t\t       int out_ctype,\n\t\t\t       u32 out_chunk_size,\n\t\t\t       struct wim_reshdr *out_reshdr,\n\t\t\t       u8 *hash_ret,\n\t\t\t       int write_resource_flags)\n{\n\tint ret;\n\tstruct blob_descriptor blob;\n\n\tif (unlikely(buf_size == 0)) {\n\t\tzero_reshdr(out_reshdr);\n\t\tif (hash_ret)\n\t\t\tcopy_hash(hash_ret, zero_hash);\n\t\treturn 0;\n\t}\n\n\tblob_set_is_located_in_attached_buffer(&blob, (void *)buf, buf_size);\n\tsha1(buf, buf_size, blob.hash);\n\tblob.unhashed = 0;\n\tblob.is_metadata = is_metadata;\n\n\tret = write_wim_resource(&blob, out_fd, out_ctype, out_chunk_size,\n\t\t\t\t write_resource_flags);\n\tif (ret)\n\t\treturn ret;\n\n\tcopy_reshdr(out_reshdr, &blob.out_reshdr);\n\n\tif (hash_ret)\n\t\tcopy_hash(hash_ret, blob.hash);\n\treturn 0;\n}\n\nstruct blob_size_table {\n\tstruct hlist_head *array;\n\tsize_t num_entries;\n\tsize_t capacity;\n};\n\nstatic int\ninit_blob_size_table(struct blob_size_table *tab, size_t capacity)\n{\n\ttab->array = CALLOC(capacity, sizeof(tab->array[0]));\n\tif (tab->array == NULL)\n\t\treturn WIMLIB_ERR_NOMEM;\n\ttab->num_entries = 0;\n\ttab->capacity = capacity;\n\treturn 0;\n}\n\nstatic void\ndestroy_blob_size_table(struct blob_size_table *tab)\n{\n\tFREE(tab->array);\n}\n\nstatic int\nblob_size_table_insert(struct blob_descriptor *blob, void *_tab)\n{\n\tstruct blob_size_table *tab = _tab;\n\tsize_t pos;\n\tstruct blob_descriptor *same_size_blob;\n\n\tpos = hash_u64(blob->size) % tab->capacity;\n\tblob->unique_size = 1;\n\thlist_for_each_entry(same_size_blob, &tab->array[pos], hash_list_2) {\n\t\tif (same_size_blob->size == blob->size) {\n\t\t\tblob->unique_size = 0;\n\t\t\tsame_size_blob->unique_size = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\thlist_add_head(&blob->hash_list_2, &tab->array[pos]);\n\ttab->num_entries++;\n\treturn 0;\n}\n\nstruct find_blobs_ctx {\n\tWIMStruct *wim;\n\tint write_flags;\n\tstruct list_head blob_list;\n\tstruct blob_size_table blob_size_tab;\n};\n\nstatic void\nreference_blob_for_write(struct blob_descriptor *blob,\n\t\t\t struct list_head *blob_list, u32 nref)\n{\n\tif (!blob->will_be_in_output_wim) {\n\t\tblob->out_refcnt = 0;\n\t\tlist_add_tail(&blob->write_blobs_list, blob_list);\n\t\tblob->will_be_in_output_wim = 1;\n\t}\n\tblob->out_refcnt += nref;\n}\n\nstatic int\nfully_reference_blob_for_write(struct blob_descriptor *blob, void *_blob_list)\n{\n\tstruct list_head *blob_list = _blob_list;\n\tblob->will_be_in_output_wim = 0;\n\treference_blob_for_write(blob, blob_list, blob->refcnt);\n\treturn 0;\n}\n\nstatic int\ninode_find_blobs_to_reference(const struct wim_inode *inode,\n\t\t\t      const struct blob_table *table,\n\t\t\t      struct list_head *blob_list)\n{\n\twimlib_assert(inode->i_nlink > 0);\n\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tstruct blob_descriptor *blob;\n\t\tconst u8 *hash;\n\n\t\tblob = stream_blob(&inode->i_streams[i], table);\n\t\tif (blob) {\n\t\t\treference_blob_for_write(blob, blob_list, inode->i_nlink);\n\t\t} else {\n\t\t\thash = stream_hash(&inode->i_streams[i]);\n\t\t\tif (!is_zero_hash(hash))\n\t\t\t\treturn blob_not_found_error(inode, hash);\n\t\t}\n\t}\n\treturn 0;\n}\n\nstatic int\ndo_blob_set_not_in_output_wim(struct blob_descriptor *blob, void *_ignore)\n{\n\tblob->will_be_in_output_wim = 0;\n\treturn 0;\n}\n\nstatic int\nimage_find_blobs_to_reference(WIMStruct *wim)\n{\n\tstruct wim_image_metadata *imd;\n\tstruct wim_inode *inode;\n\tstruct blob_descriptor *blob;\n\tstruct list_head *blob_list;\n\tint ret;\n\n\timd = wim_get_current_image_metadata(wim);\n\n\timage_for_each_unhashed_blob(blob, imd)\n\t\tblob->will_be_in_output_wim = 0;\n\n\tblob_list = wim->private;\n\timage_for_each_inode(inode, imd) {\n\t\tret = inode_find_blobs_to_reference(inode,\n\t\t\t\t\t\t    wim->blob_table,\n\t\t\t\t\t\t    blob_list);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nstatic int\nprepare_unfiltered_list_of_blobs_in_output_wim(WIMStruct *wim,\n\t\t\t\t\t       int image,\n\t\t\t\t\t       int blobs_ok,\n\t\t\t\t\t       struct list_head *blob_list_ret)\n{\n\tint ret;\n\n\tINIT_LIST_HEAD(blob_list_ret);\n\n\tif (blobs_ok && (image == WIMLIB_ALL_IMAGES ||\n\t\t\t (image == 1 && wim->hdr.image_count == 1)))\n\t{\n\t\t/* Fast case:  Assume that all blobs are being written and that\n\t\t * the reference counts are correct.  */\n\t\tstruct blob_descriptor *blob;\n\t\tstruct wim_image_metadata *imd;\n\t\tunsigned i;\n\n\t\tfor_blob_in_table(wim->blob_table,\n\t\t\t\t  fully_reference_blob_for_write,\n\t\t\t\t  blob_list_ret);\n\n\t\tfor (i = 0; i < wim->hdr.image_count; i++) {\n\t\t\timd = wim->image_metadata[i];\n\t\t\timage_for_each_unhashed_blob(blob, imd)\n\t\t\t\tfully_reference_blob_for_write(blob, blob_list_ret);\n\t\t}\n\t} else {\n\t\t/* Slow case:  Walk through the images being written and\n\t\t * determine the blobs referenced.  */\n\t\tfor_blob_in_table(wim->blob_table,\n\t\t\t\t  do_blob_set_not_in_output_wim, NULL);\n\t\twim->private = blob_list_ret;\n\t\tret = for_image(wim, image, image_find_blobs_to_reference);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\treturn 0;\n}\n\nstruct insert_other_if_hard_filtered_ctx {\n\tstruct blob_size_table *tab;\n\tstruct filter_context *filter_ctx;\n};\n\nstatic int\ninsert_other_if_hard_filtered(struct blob_descriptor *blob, void *_ctx)\n{\n\tstruct insert_other_if_hard_filtered_ctx *ctx = _ctx;\n\n\tif (!blob->will_be_in_output_wim &&\n\t    blob_hard_filtered(blob, ctx->filter_ctx))\n\t\tblob_size_table_insert(blob, ctx->tab);\n\treturn 0;\n}\n\nstatic int\ndetermine_blob_size_uniquity(struct list_head *blob_list,\n\t\t\t     struct blob_table *lt,\n\t\t\t     struct filter_context *filter_ctx)\n{\n\tint ret;\n\tstruct blob_size_table tab;\n\tstruct blob_descriptor *blob;\n\n\tret = init_blob_size_table(&tab, 9001);\n\tif (ret)\n\t\treturn ret;\n\n\tif (may_hard_filter_blobs(filter_ctx)) {\n\t\tstruct insert_other_if_hard_filtered_ctx ctx = {\n\t\t\t.tab = &tab,\n\t\t\t.filter_ctx = filter_ctx,\n\t\t};\n\t\tfor_blob_in_table(lt, insert_other_if_hard_filtered, &ctx);\n\t}\n\n\tlist_for_each_entry(blob, blob_list, write_blobs_list)\n\t\tblob_size_table_insert(blob, &tab);\n\n\tdestroy_blob_size_table(&tab);\n\treturn 0;\n}\n\nstatic void\nfilter_blob_list_for_write(struct list_head *blob_list,\n\t\t\t   struct filter_context *filter_ctx)\n{\n\tstruct blob_descriptor *blob, *tmp;\n\n\tlist_for_each_entry_safe(blob, tmp, blob_list, write_blobs_list) {\n\t\tint status = blob_filtered(blob, filter_ctx);\n\n\t\tif (status == 0) {\n\t\t\t/* Not filtered.  */\n\t\t\tcontinue;\n\t\t} else {\n\t\t\tif (status > 0) {\n\t\t\t\t/* Soft filtered.  */\n\t\t\t} else {\n\t\t\t\t/* Hard filtered.  */\n\t\t\t\tblob->will_be_in_output_wim = 0;\n\t\t\t\tlist_del(&blob->blob_table_list);\n\t\t\t}\n\t\t\tlist_del(&blob->write_blobs_list);\n\t\t}\n\t}\n}\n\n/*\n * prepare_blob_list_for_write() -\n *\n * Prepare the list of blobs to write for writing a WIM containing the specified\n * image(s) with the specified write flags.\n *\n * @wim\n *\tThe WIMStruct on whose behalf the write is occurring.\n *\n * @image\n *\tImage(s) from the WIM to write; may be WIMLIB_ALL_IMAGES.\n *\n * @write_flags\n *\tWIMLIB_WRITE_FLAG_* flags for the write operation:\n *\n *\tSTREAMS_OK:  For writes of all images, assume that all blobs in the blob\n *\ttable of @wim and the per-image lists of unhashed blobs should be taken\n *\tas-is, and image metadata should not be searched for references.  This\n *\tdoes not exclude filtering with APPEND and SKIP_EXTERNAL_WIMS, below.\n *\n *\tAPPEND:  Blobs already present in @wim shall not be returned in\n *\t@blob_list_ret.\n *\n *\tSKIP_EXTERNAL_WIMS:  Blobs already present in a WIM file, but not @wim,\n *\tshall be returned in neither @blob_list_ret nor @blob_table_list_ret.\n *\n * @blob_list_ret\n *\tList of blobs, linked by write_blobs_list, that need to be written will\n *\tbe returned here.\n *\n *\tNote that this function assumes that unhashed blobs will be written; it\n *\tdoes not take into account that they may become duplicates when actually\n *\thashed.\n *\n * @blob_table_list_ret\n *\tList of blobs, linked by blob_table_list, that need to be included in\n *\tthe WIM's blob table will be returned here.  This will be a superset of\n *\tthe blobs in @blob_list_ret.\n *\n *\tThis list will be a proper superset of @blob_list_ret if and only if\n *\tWIMLIB_WRITE_FLAG_APPEND was specified in @write_flags and some of the\n *\tblobs that would otherwise need to be written were already located in\n *\tthe WIM file.\n *\n *\tAll blobs in this list will have @out_refcnt set to the number of\n *\treferences to the blob in the output WIM.  If\n *\tWIMLIB_WRITE_FLAG_STREAMS_OK was specified in @write_flags, @out_refcnt\n *\tmay be as low as 0.\n *\n * @filter_ctx_ret\n *\tA context for queries of blob filter status with blob_filtered() is\n *\treturned in this location.\n *\n * In addition, @will_be_in_output_wim will be set to 1 in all blobs inserted\n * into @blob_table_list_ret and to 0 in all blobs in the blob table of @wim not\n * inserted into @blob_table_list_ret.\n *\n * Still furthermore, @unique_size will be set to 1 on all blobs in\n * @blob_list_ret that have unique size among all blobs in @blob_list_ret and\n * among all blobs in the blob table of @wim that are ineligible for being\n * written due to filtering.\n *\n * Returns 0 on success; nonzero on read error, memory allocation error, or\n * otherwise.\n */\nstatic int\nprepare_blob_list_for_write(WIMStruct *wim, int image,\n\t\t\t    int write_flags,\n\t\t\t    struct list_head *blob_list_ret,\n\t\t\t    struct list_head *blob_table_list_ret,\n\t\t\t    struct filter_context *filter_ctx_ret)\n{\n\tint ret;\n\tstruct blob_descriptor *blob;\n\n\tfilter_ctx_ret->write_flags = write_flags;\n\tfilter_ctx_ret->wim = wim;\n\n\tret = prepare_unfiltered_list_of_blobs_in_output_wim(\n\t\t\t\twim,\n\t\t\t\timage,\n\t\t\t\twrite_flags & WIMLIB_WRITE_FLAG_STREAMS_OK,\n\t\t\t\tblob_list_ret);\n\tif (ret)\n\t\treturn ret;\n\n\tINIT_LIST_HEAD(blob_table_list_ret);\n\tlist_for_each_entry(blob, blob_list_ret, write_blobs_list)\n\t\tlist_add_tail(&blob->blob_table_list, blob_table_list_ret);\n\n\tret = determine_blob_size_uniquity(blob_list_ret, wim->blob_table,\n\t\t\t\t\t   filter_ctx_ret);\n\tif (ret)\n\t\treturn ret;\n\n\tif (may_filter_blobs(filter_ctx_ret))\n\t\tfilter_blob_list_for_write(blob_list_ret, filter_ctx_ret);\n\n\treturn 0;\n}\n\nstatic int\nwrite_file_data(WIMStruct *wim, int image, int write_flags,\n\t\tunsigned num_threads,\n\t\tstruct list_head *blob_list_override,\n\t\tstruct list_head *blob_table_list_ret)\n{\n\tint ret;\n\tstruct list_head _blob_list;\n\tstruct list_head *blob_list;\n\tstruct blob_descriptor *blob;\n\tstruct filter_context _filter_ctx;\n\tstruct filter_context *filter_ctx;\n\n\tif (blob_list_override == NULL) {\n\t\t/* Normal case: prepare blob list from image(s) being written.\n\t\t */\n\t\tblob_list = &_blob_list;\n\t\tfilter_ctx = &_filter_ctx;\n\t\tret = prepare_blob_list_for_write(wim, image, write_flags,\n\t\t\t\t\t\t  blob_list,\n\t\t\t\t\t\t  blob_table_list_ret,\n\t\t\t\t\t\t  filter_ctx);\n\t\tif (ret)\n\t\t\treturn ret;\n\t} else {\n\t\t/* Currently only as a result of wimlib_split() being called:\n\t\t * use blob list already explicitly provided.  Use existing\n\t\t * reference counts.  */\n\t\tblob_list = blob_list_override;\n\t\tfilter_ctx = NULL;\n\t\tINIT_LIST_HEAD(blob_table_list_ret);\n\t\tlist_for_each_entry(blob, blob_list, write_blobs_list) {\n\t\t\tblob->out_refcnt = blob->refcnt;\n\t\t\tblob->will_be_in_output_wim = 1;\n\t\t\tblob->unique_size = 0;\n\t\t\tlist_add_tail(&blob->blob_table_list, blob_table_list_ret);\n\t\t}\n\t}\n\n\treturn write_file_data_blobs(wim,\n\t\t\t\t     blob_list,\n\t\t\t\t     write_flags,\n\t\t\t\t     num_threads,\n\t\t\t\t     filter_ctx);\n}\n\nstatic int\nwrite_metadata_resources(WIMStruct *wim, int image, int write_flags)\n{\n\tint ret;\n\tint start_image;\n\tint end_image;\n\tint write_resource_flags;\n\n\tif (write_flags & WIMLIB_WRITE_FLAG_NO_METADATA)\n\t\treturn 0;\n\n\twrite_resource_flags = write_flags_to_resource_flags(write_flags);\n\n\twrite_resource_flags &= ~WRITE_RESOURCE_FLAG_SOLID;\n\n\tret = call_progress(wim->progfunc,\n\t\t\t    WIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN,\n\t\t\t    NULL, wim->progctx);\n\tif (ret)\n\t\treturn ret;\n\n\tif (image == WIMLIB_ALL_IMAGES) {\n\t\tstart_image = 1;\n\t\tend_image = wim->hdr.image_count;\n\t} else {\n\t\tstart_image = image;\n\t\tend_image = image;\n\t}\n\n\tfor (int i = start_image; i <= end_image; i++) {\n\t\tstruct wim_image_metadata *imd;\n\n\t\timd = wim->image_metadata[i - 1];\n\t\tif (is_image_dirty(imd)) {\n\t\t\t/* The image was modified from the original, or was\n\t\t\t * newly added, so we have to build and write a new\n\t\t\t * metadata resource.  */\n\t\t\tret = write_metadata_resource(wim, i,\n\t\t\t\t\t\t      write_resource_flags);\n\t\t} else if (is_image_unchanged_from_wim(imd, wim) &&\n\t\t\t   (write_flags & (WIMLIB_WRITE_FLAG_UNSAFE_COMPACT |\n\t\t\t\t\t   WIMLIB_WRITE_FLAG_APPEND)))\n\t\t{\n\t\t\t/* The metadata resource is already in the WIM file.\n\t\t\t * For appends, we don't need to write it at all.  For\n\t\t\t * compactions, we re-write existing metadata resources\n\t\t\t * along with the existing file resources, not here.  */\n\t\t\tif (write_flags & WIMLIB_WRITE_FLAG_APPEND)\n\t\t\t\tblob_set_out_reshdr_for_reuse(imd->metadata_blob);\n\t\t\tret = 0;\n\t\t} else {\n\t\t\t/* The metadata resource is in a WIM file other than the\n\t\t\t * one being written to.  We need to rewrite it,\n\t\t\t * possibly compressed differently; but rebuilding the\n\t\t\t * metadata itself isn't necessary.  */\n\t\t\tret = write_wim_resource(imd->metadata_blob,\n\t\t\t\t\t\t &wim->out_fd,\n\t\t\t\t\t\t wim->out_compression_type,\n\t\t\t\t\t\t wim->out_chunk_size,\n\t\t\t\t\t\t write_resource_flags);\n\t\t}\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\n\treturn call_progress(wim->progfunc,\n\t\t\t     WIMLIB_PROGRESS_MSG_WRITE_METADATA_END,\n\t\t\t     NULL, wim->progctx);\n}\n\nstatic int\nopen_wim_writable(WIMStruct *wim, const tchar *path, int open_flags)\n{\n\tint raw_fd = topen(path, open_flags | O_BINARY, 0644);\n\tif (raw_fd < 0) {\n\t\tERROR_WITH_ERRNO(\"Failed to open \\\"%\"TS\"\\\" for writing\", path);\n\t\treturn WIMLIB_ERR_OPEN;\n\t}\n\tfiledes_init(&wim->out_fd, raw_fd);\n\treturn 0;\n}\n\nstatic int\nclose_wim_writable(WIMStruct *wim, int write_flags)\n{\n\tint ret = 0;\n\n\tif (!(write_flags & WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR))\n\t\tif (filedes_valid(&wim->out_fd))\n\t\t\tif (filedes_close(&wim->out_fd))\n\t\t\t\tret = WIMLIB_ERR_WRITE;\n\tfiledes_invalidate(&wim->out_fd);\n\treturn ret;\n}\n\nstatic int\ncmp_blobs_by_out_rdesc(const void *p1, const void *p2)\n{\n\tconst struct blob_descriptor *blob1, *blob2;\n\n\tblob1 = *(const struct blob_descriptor**)p1;\n\tblob2 = *(const struct blob_descriptor**)p2;\n\n\tif (blob1->out_reshdr.flags & WIM_RESHDR_FLAG_SOLID) {\n\t\tif (blob2->out_reshdr.flags & WIM_RESHDR_FLAG_SOLID) {\n\t\t\tif (blob1->out_res_offset_in_wim != blob2->out_res_offset_in_wim)\n\t\t\t\treturn cmp_u64(blob1->out_res_offset_in_wim,\n\t\t\t\t\t       blob2->out_res_offset_in_wim);\n\t\t} else {\n\t\t\treturn 1;\n\t\t}\n\t} else {\n\t\tif (blob2->out_reshdr.flags & WIM_RESHDR_FLAG_SOLID)\n\t\t\treturn -1;\n\t}\n\treturn cmp_u64(blob1->out_reshdr.offset_in_wim,\n\t\t       blob2->out_reshdr.offset_in_wim);\n}\n\nstatic int\nwrite_blob_table(WIMStruct *wim, int image, int write_flags,\n\t\t struct list_head *blob_table_list)\n{\n\tint ret;\n\n\t/* Set output resource metadata for blobs already present in WIM.  */\n\tif (write_flags & WIMLIB_WRITE_FLAG_APPEND) {\n\t\tstruct blob_descriptor *blob;\n\t\tlist_for_each_entry(blob, blob_table_list, blob_table_list) {\n\t\t\tif (blob->blob_location == BLOB_IN_WIM &&\n\t\t\t    blob->rdesc->wim == wim)\n\t\t\t{\n\t\t\t\tblob_set_out_reshdr_for_reuse(blob);\n\t\t\t}\n\t\t}\n\t}\n\n\tret = sort_blob_list(blob_table_list,\n\t\t\t     offsetof(struct blob_descriptor, blob_table_list),\n\t\t\t     cmp_blobs_by_out_rdesc);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Add entries for metadata resources.  */\n\tif (!(write_flags & WIMLIB_WRITE_FLAG_NO_METADATA)) {\n\t\tint start_image;\n\t\tint end_image;\n\n\t\tif (image == WIMLIB_ALL_IMAGES) {\n\t\t\tstart_image = 1;\n\t\t\tend_image = wim->hdr.image_count;\n\t\t} else {\n\t\t\tstart_image = image;\n\t\t\tend_image = image;\n\t\t}\n\n\t\t/* Push metadata blob table entries onto the front of the list\n\t\t * in reverse order, so that they're written in order.\n\t\t */\n\t\tfor (int i = end_image; i >= start_image; i--) {\n\t\t\tstruct blob_descriptor *metadata_blob;\n\n\t\t\tmetadata_blob = wim->image_metadata[i - 1]->metadata_blob;\n\t\t\twimlib_assert(metadata_blob->out_reshdr.flags & WIM_RESHDR_FLAG_METADATA);\n\t\t\tmetadata_blob->out_refcnt = 1;\n\t\t\tlist_add(&metadata_blob->blob_table_list, blob_table_list);\n\t\t}\n\t}\n\n\treturn write_blob_table_from_blob_list(blob_table_list,\n\t\t\t\t\t       &wim->out_fd,\n\t\t\t\t\t       wim->out_hdr.part_number,\n\t\t\t\t\t       &wim->out_hdr.blob_table_reshdr,\n\t\t\t\t\t       write_flags_to_resource_flags(write_flags));\n}\n\n/*\n * Finish writing a WIM file: write the blob table, xml data, and integrity\n * table, then overwrite the WIM header.\n *\n * The output file descriptor is closed on success, except when writing to a\n * user-specified file descriptor (WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR set).\n */\nstatic int\nfinish_write(WIMStruct *wim, int image, int write_flags,\n\t     struct list_head *blob_table_list)\n{\n\tint write_resource_flags;\n\toff_t old_blob_table_end = 0;\n\tstruct integrity_table *old_integrity_table = NULL;\n\toff_t new_blob_table_end;\n\tu64 xml_totalbytes;\n\tint ret;\n\n\twrite_resource_flags = write_flags_to_resource_flags(write_flags);\n\n\t/* In the WIM header, there is room for the resource entry for a\n\t * metadata resource labeled as the \"boot metadata\".  This entry should\n\t * be zeroed out if there is no bootable image (boot_idx 0).  Otherwise,\n\t * it should be a copy of the resource entry for the image that is\n\t * marked as bootable.  */\n\tif (wim->out_hdr.boot_idx == 0) {\n\t\tzero_reshdr(&wim->out_hdr.boot_metadata_reshdr);\n\t} else {\n\t\tcopy_reshdr(&wim->out_hdr.boot_metadata_reshdr,\n\t\t\t    &wim->image_metadata[\n\t\t\t\twim->out_hdr.boot_idx - 1]->metadata_blob->out_reshdr);\n\t}\n\n\t/* If appending to a WIM file containing an integrity table, we'd like\n\t * to re-use the information in the old integrity table instead of\n\t * recalculating it.  But we might overwrite the old integrity table\n\t * when we expand the XML data.  Read it into memory just in case.  */\n\tif ((write_flags & (WIMLIB_WRITE_FLAG_APPEND |\n\t\t\t    WIMLIB_WRITE_FLAG_CHECK_INTEGRITY)) ==\n\t\t(WIMLIB_WRITE_FLAG_APPEND |\n\t\t WIMLIB_WRITE_FLAG_CHECK_INTEGRITY)\n\t    && wim_has_integrity_table(wim))\n\t{\n\t\told_blob_table_end = wim->hdr.blob_table_reshdr.offset_in_wim +\n\t\t\t\t     wim->hdr.blob_table_reshdr.size_in_wim;\n\t\t(void)read_integrity_table(wim,\n\t\t\t\t\t   old_blob_table_end - WIM_HEADER_DISK_SIZE,\n\t\t\t\t\t   &old_integrity_table);\n\t\t/* If we couldn't read the old integrity table, we can still\n\t\t * re-calculate the full integrity table ourselves.  Hence the\n\t\t * ignoring of the return value.  */\n\t}\n\n\t/* Write blob table if needed.  */\n\tif (!(write_flags & WIMLIB_WRITE_FLAG_NO_NEW_BLOBS)) {\n\t\tret = write_blob_table(wim, image, write_flags,\n\t\t\t\t       blob_table_list);\n\t\tif (ret)\n\t\t\tgoto out;\n\t}\n\n\t/* Write XML data.  */\n\txml_totalbytes = wim->out_fd.offset;\n\tif (write_flags & WIMLIB_WRITE_FLAG_USE_EXISTING_TOTALBYTES)\n\t\txml_totalbytes = WIM_TOTALBYTES_USE_EXISTING;\n\tret = write_wim_xml_data(wim, image, xml_totalbytes,\n\t\t\t\t &wim->out_hdr.xml_data_reshdr,\n\t\t\t\t write_resource_flags);\n\tif (ret)\n\t\tgoto out;\n\n\t/* Write integrity table if needed.  */\n\tif ((write_flags & WIMLIB_WRITE_FLAG_CHECK_INTEGRITY) &&\n\t    wim->out_hdr.blob_table_reshdr.offset_in_wim != 0)\n\t{\n\t\tif (write_flags & WIMLIB_WRITE_FLAG_NO_NEW_BLOBS) {\n\t\t\t/* The XML data we wrote may have overwritten part of\n\t\t\t * the old integrity table, so while calculating the new\n\t\t\t * integrity table we should temporarily update the WIM\n\t\t\t * header to remove the integrity table reference.   */\n\t\t\tstruct wim_header checkpoint_hdr;\n\t\t\tmemcpy(&checkpoint_hdr, &wim->out_hdr, sizeof(struct wim_header));\n\t\t\tzero_reshdr(&checkpoint_hdr.integrity_table_reshdr);\n\t\t\tcheckpoint_hdr.flags |= WIM_HDR_FLAG_WRITE_IN_PROGRESS;\n\t\t\tret = write_wim_header(&checkpoint_hdr, &wim->out_fd, 0);\n\t\t\tif (ret)\n\t\t\t\tgoto out;\n\t\t}\n\n\t\tnew_blob_table_end = wim->out_hdr.blob_table_reshdr.offset_in_wim +\n\t\t\t\t     wim->out_hdr.blob_table_reshdr.size_in_wim;\n\n\t\tret = write_integrity_table(wim,\n\t\t\t\t\t    new_blob_table_end,\n\t\t\t\t\t    old_blob_table_end,\n\t\t\t\t\t    old_integrity_table);\n\t\tif (ret)\n\t\t\tgoto out;\n\t} else {\n\t\t/* No integrity table.  */\n\t\tzero_reshdr(&wim->out_hdr.integrity_table_reshdr);\n\t}\n\n\t/* Now that all information in the WIM header has been determined, the\n\t * preliminary header written earlier can be overwritten, the header of\n\t * the existing WIM file can be overwritten, or the final header can be\n\t * written to the end of the pipable WIM.  */\n\twim->out_hdr.flags &= ~WIM_HDR_FLAG_WRITE_IN_PROGRESS;\n\tif (write_flags & WIMLIB_WRITE_FLAG_PIPABLE)\n\t\tret = write_wim_header(&wim->out_hdr, &wim->out_fd, wim->out_fd.offset);\n\telse\n\t\tret = write_wim_header(&wim->out_hdr, &wim->out_fd, 0);\n\tif (ret)\n\t\tgoto out;\n\n\tret = WIMLIB_ERR_WRITE;\n\tif (unlikely(write_flags & WIMLIB_WRITE_FLAG_UNSAFE_COMPACT)) {\n\t\t/* Truncate any data the compaction freed up.  */\n\t\tif (ftruncate(wim->out_fd.fd, wim->out_fd.offset) &&\n\t\t    errno != EINVAL) /* allow compaction on untruncatable files,\n\t\t\t\t\te.g. block devices  */\n\t\t{\n\t\t\tERROR_WITH_ERRNO(\"Failed to truncate the output WIM file\");\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\t/* Possibly sync file data to disk before closing.  On POSIX systems, it\n\t * is necessary to do this before using rename() to overwrite an\n\t * existing file with a new file.  Otherwise, data loss would occur if\n\t * the system is abruptly terminated when the metadata for the rename\n\t * operation has been written to disk, but the new file data has not.\n\t */\n\tret = WIMLIB_ERR_WRITE;\n\tif (write_flags & WIMLIB_WRITE_FLAG_FSYNC) {\n\t\tif (fsync(wim->out_fd.fd)) {\n\t\t\tERROR_WITH_ERRNO(\"Error syncing data to WIM file\");\n\t\t\tgoto out;\n\t\t}\n\t}\n\n\tret = WIMLIB_ERR_WRITE;\n\tif (close_wim_writable(wim, write_flags)) {\n\t\tERROR_WITH_ERRNO(\"Failed to close the output WIM file\");\n\t\tgoto out;\n\t}\n\n\tret = 0;\nout:\n\tfree_integrity_table(old_integrity_table);\n\treturn ret;\n}\n\n#if defined(HAVE_SYS_FILE_H) && defined(HAVE_FLOCK)\n\n/* Set advisory lock on WIM file (if not already done so)  */\nint\nlock_wim_for_append(WIMStruct *wim)\n{\n\tif (wim->locked_for_append)\n\t\treturn 0;\n\tif (!flock(wim->in_fd.fd, LOCK_EX | LOCK_NB)) {\n\t\twim->locked_for_append = 1;\n\t\treturn 0;\n\t}\n\tif (errno != EWOULDBLOCK)\n\t\treturn 0;\n\treturn WIMLIB_ERR_ALREADY_LOCKED;\n}\n\n/* Remove advisory lock on WIM file (if present)  */\nvoid\nunlock_wim_for_append(WIMStruct *wim)\n{\n\tif (wim->locked_for_append) {\n\t\tflock(wim->in_fd.fd, LOCK_UN);\n\t\twim->locked_for_append = 0;\n\t}\n}\n#endif\n\n/*\n * write_pipable_wim():\n *\n * Perform the intermediate stages of creating a \"pipable\" WIM (i.e. a WIM\n * capable of being applied from a pipe).\n *\n * Pipable WIMs are a wimlib-specific modification of the WIM format such that\n * images can be applied from them sequentially when the file data is sent over\n * a pipe.  In addition, a pipable WIM can be written sequentially to a pipe.\n * The modifications made to the WIM format for pipable WIMs are:\n *\n * - Magic characters in header are \"WLPWM\\0\\0\\0\" (wimlib pipable WIM) instead\n *   of \"MSWIM\\0\\0\\0\".  This lets wimlib know that the WIM is pipable and also\n *   stops other software from trying to read the file as a normal WIM.\n *\n * - The header at the beginning of the file does not contain all the normal\n *   information; in particular it will have all 0's for the blob table and XML\n *   data resource entries.  This is because this information cannot be\n *   determined until the blob table and XML data have been written.\n *   Consequently, wimlib will write the full header at the very end of the\n *   file.  The header at the end, however, is only used when reading the WIM\n *   from a seekable file (not a pipe).\n *\n * - An extra copy of the XML data is placed directly after the header.  This\n *   allows image names and sizes to be determined at an appropriate time when\n *   reading the WIM from a pipe.  This copy of the XML data is ignored if the\n *   WIM is read from a seekable file (not a pipe).\n *\n * - Solid resources are not allowed.  Each blob is always stored in its own\n *   resource.\n *\n * - The format of resources, or blobs, has been modified to allow them to be\n *   used before the \"blob table\" has been read.  Each blob is prefixed with a\n *   `struct pwm_blob_hdr' that is basically an abbreviated form of `struct\n *   blob_descriptor_disk' that only contains the SHA-1 message digest,\n *   uncompressed blob size, and flags that indicate whether the blob is\n *   compressed.  The data of uncompressed blobs then follows literally, while\n *   the data of compressed blobs follows in a modified format.  Compressed\n *   blobs do not begin with a chunk table, since the chunk table cannot be\n *   written until all chunks have been compressed.  Instead, each compressed\n *   chunk is prefixed by a `struct pwm_chunk_hdr' that gives its size.\n *   Furthermore, the chunk table is written at the end of the resource instead\n *   of the start.  Note: chunk offsets are given in the chunk table as if the\n *   `struct pwm_chunk_hdr's were not present; also, the chunk table is only\n *   used if the WIM is being read from a seekable file (not a pipe).\n *\n * - Metadata blobs always come before non-metadata blobs.  (This does not by\n *   itself constitute an incompatibility with normal WIMs, since this is valid\n *   in normal WIMs.)\n *\n * - At least up to the end of the blobs, all components must be packed as\n *   tightly as possible; there cannot be any \"holes\" in the WIM.  (This does\n *   not by itself consititute an incompatibility with normal WIMs, since this\n *   is valid in normal WIMs.)\n *\n * Note: the blob table, XML data, and header at the end are not used when\n * applying from a pipe.  They exist to support functionality such as image\n * application and export when the WIM is *not* read from a pipe.\n *\n *   Layout of pipable WIM:\n *\n * ---------+----------+--------------------+----------------+--------------+-----------+--------+\n * | Header | XML data | Metadata resources | File resources |  Blob table  | XML data  | Header |\n * ---------+----------+--------------------+----------------+--------------+-----------+--------+\n *\n *   Layout of normal WIM:\n *\n * +--------+-----------------------------+-------------------------+\n * | Header | File and metadata resources |  Blob table  | XML data |\n * +--------+-----------------------------+-------------------------+\n *\n * An optional integrity table can follow the final XML data in both normal and\n * pipable WIMs.  However, due to implementation details, wimlib currently can\n * only include an integrity table in a pipable WIM when writing it to a\n * seekable file (not a pipe).\n *\n * Do note that since pipable WIMs are not supported by Microsoft's software,\n * wimlib does not create them unless explicitly requested (with\n * WIMLIB_WRITE_FLAG_PIPABLE) and as stated above they use different magic\n * characters to identify the file.\n */\nstatic int\nwrite_pipable_wim(WIMStruct *wim, int image, int write_flags,\n\t\t  unsigned num_threads,\n\t\t  struct list_head *blob_list_override,\n\t\t  struct list_head *blob_table_list_ret)\n{\n\tint ret;\n\tstruct wim_reshdr xml_reshdr;\n\n\tWARNING(\"Creating a pipable WIM, which will \"\n\t\t\"be incompatible\\n\"\n\t\t\"          with Microsoft's software (WIMGAPI/ImageX/DISM).\");\n\n\t/* At this point, the header at the beginning of the file has already\n\t * been written.  */\n\n\t/*\n\t * For efficiency, wimlib normally delays calculating each newly added\n\t * stream's hash until while that stream being written, or just before\n\t * it is written.  However, when writing a pipable WIM (potentially to a\n\t * pipe), we first have to write the metadata resources, which contain\n\t * all the hashes.  Moreover each blob is prefixed with its hash (struct\n\t * pwm_blob_hdr).  Thus, we have to calculate all the hashes before\n\t * writing anything.\n\t */\n\tret = wim_checksum_unhashed_blobs(wim);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Write extra copy of the XML data.  */\n\tret = write_wim_xml_data(wim, image, WIM_TOTALBYTES_OMIT,\n\t\t\t\t &xml_reshdr, WRITE_RESOURCE_FLAG_PIPABLE);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Write metadata resources for the image(s) being included in the\n\t * output WIM.  */\n\tret = write_metadata_resources(wim, image, write_flags);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Write file data needed for the image(s) being included in the output\n\t * WIM, or file data needed for the split WIM part.  */\n\treturn write_file_data(wim, image, write_flags,\n\t\t\t       num_threads, blob_list_override,\n\t\t\t       blob_table_list_ret);\n\n\t/* The blob table, XML data, and header at end are handled by\n\t * finish_write().  */\n}\n\nstatic bool\nshould_default_to_solid_compression(WIMStruct *wim, int write_flags)\n{\n\treturn wim->out_hdr.wim_version == WIM_VERSION_SOLID &&\n\t\t!(write_flags & (WIMLIB_WRITE_FLAG_SOLID |\n\t\t\t\t WIMLIB_WRITE_FLAG_PIPABLE)) &&\n\t\twim_has_solid_resources(wim);\n}\n\n/* Update the images' filecount/bytecount stats (in the XML info) to take into\n * account any recent modifications.  */\nstatic int\nupdate_image_stats(WIMStruct *wim)\n{\n\tif (!wim_has_metadata(wim))\n\t\treturn 0;\n\tfor (int i = 0; i < wim->hdr.image_count; i++) {\n\t\tstruct wim_image_metadata *imd = wim->image_metadata[i];\n\t\tif (imd->stats_outdated) {\n\t\t\tint ret = xml_update_image_info(wim, i + 1);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\timd->stats_outdated = false;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/* Write a standalone WIM or split WIM (SWM) part to a new file or to a file\n * descriptor.  */\nint\nwrite_wim_part(WIMStruct *wim,\n\t       const void *path_or_fd,\n\t       int image,\n\t       int write_flags,\n\t       unsigned num_threads,\n\t       unsigned part_number,\n\t       unsigned total_parts,\n\t       struct list_head *blob_list_override,\n\t       const u8 *guid)\n{\n\tint ret;\n\tstruct list_head blob_table_list;\n\n\t/* Internally, this is always called with a valid part number and total\n\t * parts.  */\n\twimlib_assert(total_parts >= 1);\n\twimlib_assert(part_number >= 1 && part_number <= total_parts);\n\n\t/* A valid image (or all images) must be specified.  */\n\tif (image != WIMLIB_ALL_IMAGES &&\n\t     (image < 1 || image > wim->hdr.image_count))\n\t\treturn WIMLIB_ERR_INVALID_IMAGE;\n\n\t/* If we need to write metadata resources, make sure the ::WIMStruct has\n\t * the needed information attached (e.g. is not a resource-only WIM,\n\t * such as a non-first part of a split WIM).  */\n\tif (!wim_has_metadata(wim) &&\n\t    !(write_flags & WIMLIB_WRITE_FLAG_NO_METADATA))\n\t\treturn WIMLIB_ERR_METADATA_NOT_FOUND;\n\n\t/* Check for contradictory flags.  */\n\tif ((write_flags & (WIMLIB_WRITE_FLAG_CHECK_INTEGRITY |\n\t\t\t    WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY))\n\t\t\t\t== (WIMLIB_WRITE_FLAG_CHECK_INTEGRITY |\n\t\t\t\t    WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif ((write_flags & (WIMLIB_WRITE_FLAG_PIPABLE |\n\t\t\t    WIMLIB_WRITE_FLAG_NOT_PIPABLE))\n\t\t\t\t== (WIMLIB_WRITE_FLAG_PIPABLE |\n\t\t\t\t    WIMLIB_WRITE_FLAG_NOT_PIPABLE))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\t/* Only wimlib_overwrite() accepts UNSAFE_COMPACT.  */\n\tif (write_flags & WIMLIB_WRITE_FLAG_UNSAFE_COMPACT)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\t/* Include an integrity table by default if no preference was given and\n\t * the WIM already had an integrity table.  */\n\tif (!(write_flags & (WIMLIB_WRITE_FLAG_CHECK_INTEGRITY |\n\t\t\t     WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY))) {\n\t\tif (wim_has_integrity_table(wim))\n\t\t\twrite_flags |= WIMLIB_WRITE_FLAG_CHECK_INTEGRITY;\n\t}\n\n\t/* Write a pipable WIM by default if no preference was given and the WIM\n\t * was already pipable.  */\n\tif (!(write_flags & (WIMLIB_WRITE_FLAG_PIPABLE |\n\t\t\t     WIMLIB_WRITE_FLAG_NOT_PIPABLE))) {\n\t\tif (wim_is_pipable(wim))\n\t\t\twrite_flags |= WIMLIB_WRITE_FLAG_PIPABLE;\n\t}\n\n\tif ((write_flags & (WIMLIB_WRITE_FLAG_PIPABLE |\n\t\t\t    WIMLIB_WRITE_FLAG_SOLID))\n\t\t\t\t    == (WIMLIB_WRITE_FLAG_PIPABLE |\n\t\t\t\t\tWIMLIB_WRITE_FLAG_SOLID))\n\t{\n\t\tERROR(\"Solid compression is unsupported in pipable WIMs\");\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t}\n\n\t/* Start initializing the new file header.  */\n\tmemset(&wim->out_hdr, 0, sizeof(wim->out_hdr));\n\n\t/* Set the magic number.  */\n\tif (write_flags & WIMLIB_WRITE_FLAG_PIPABLE)\n\t\twim->out_hdr.magic = PWM_MAGIC;\n\telse\n\t\twim->out_hdr.magic = WIM_MAGIC;\n\n\t/* Set the version number.  */\n\tif ((write_flags & WIMLIB_WRITE_FLAG_SOLID) ||\n\t    wim->out_compression_type == WIMLIB_COMPRESSION_TYPE_LZMS)\n\t\twim->out_hdr.wim_version = WIM_VERSION_SOLID;\n\telse\n\t\twim->out_hdr.wim_version = WIM_VERSION_DEFAULT;\n\n\t/* Default to solid compression if it is valid in the chosen WIM file\n\t * format and the WIMStruct references any solid resources.  This is\n\t * useful when exporting an image from a solid WIM.  */\n\tif (should_default_to_solid_compression(wim, write_flags))\n\t\twrite_flags |= WIMLIB_WRITE_FLAG_SOLID;\n\n\t/* Set the header flags.  */\n\twim->out_hdr.flags = (wim->hdr.flags & (WIM_HDR_FLAG_RP_FIX |\n\t\t\t\t\t\tWIM_HDR_FLAG_READONLY));\n\tif (total_parts != 1)\n\t\twim->out_hdr.flags |= WIM_HDR_FLAG_SPANNED;\n\tif (wim->out_compression_type != WIMLIB_COMPRESSION_TYPE_NONE) {\n\t\twim->out_hdr.flags |= WIM_HDR_FLAG_COMPRESSION;\n\t\tswitch (wim->out_compression_type) {\n\t\tcase WIMLIB_COMPRESSION_TYPE_XPRESS:\n\t\t\twim->out_hdr.flags |= WIM_HDR_FLAG_COMPRESS_XPRESS;\n\t\t\tbreak;\n\t\tcase WIMLIB_COMPRESSION_TYPE_LZX:\n\t\t\twim->out_hdr.flags |= WIM_HDR_FLAG_COMPRESS_LZX;\n\t\t\tbreak;\n\t\tcase WIMLIB_COMPRESSION_TYPE_LZMS:\n\t\t\twim->out_hdr.flags |= WIM_HDR_FLAG_COMPRESS_LZMS;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* Set the chunk size.  */\n\twim->out_hdr.chunk_size = wim->out_chunk_size;\n\n\t/* Set the GUID.  */\n\tif (write_flags & WIMLIB_WRITE_FLAG_RETAIN_GUID)\n\t\tguid = wim->hdr.guid;\n\tif (guid)\n\t\tcopy_guid(wim->out_hdr.guid, guid);\n\telse\n\t\tgenerate_guid(wim->out_hdr.guid);\n\n\t/* Set the part number and total parts.  */\n\twim->out_hdr.part_number = part_number;\n\twim->out_hdr.total_parts = total_parts;\n\n\t/* Set the image count.  */\n\tif (image == WIMLIB_ALL_IMAGES)\n\t\twim->out_hdr.image_count = wim->hdr.image_count;\n\telse\n\t\twim->out_hdr.image_count = 1;\n\n\t/* Set the boot index.  */\n\twim->out_hdr.boot_idx = 0;\n\tif (total_parts == 1) {\n\t\tif (image == WIMLIB_ALL_IMAGES)\n\t\t\twim->out_hdr.boot_idx = wim->hdr.boot_idx;\n\t\telse if (image == wim->hdr.boot_idx)\n\t\t\twim->out_hdr.boot_idx = 1;\n\t}\n\n\t/* Update image stats if needed.  */\n\tret = update_image_stats(wim);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Set up the output file descriptor.  */\n\tif (write_flags & WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR) {\n\t\t/* File descriptor was explicitly provided.  */\n\t\tfiledes_init(&wim->out_fd, *(const int *)path_or_fd);\n\t\tif (!filedes_is_seekable(&wim->out_fd)) {\n\t\t\t/* The file descriptor is a pipe.  */\n\t\t\tret = WIMLIB_ERR_INVALID_PARAM;\n\t\t\tif (!(write_flags & WIMLIB_WRITE_FLAG_PIPABLE))\n\t\t\t\tgoto out_cleanup;\n\t\t\tif (write_flags & WIMLIB_WRITE_FLAG_CHECK_INTEGRITY) {\n\t\t\t\tERROR(\"Can't include integrity check when \"\n\t\t\t\t      \"writing pipable WIM to pipe!\");\n\t\t\t\tgoto out_cleanup;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t/* Filename of WIM to write was provided; open file descriptor\n\t\t * to it.  */\n\t\tret = open_wim_writable(wim, (const tchar*)path_or_fd,\n\t\t\t\t\tO_TRUNC | O_CREAT | O_RDWR);\n\t\tif (ret)\n\t\t\tgoto out_cleanup;\n\t}\n\n\t/* Write initial header.  This is merely a \"dummy\" header since it\n\t * doesn't have resource entries filled in yet, so it will be\n\t * overwritten later (unless writing a pipable WIM).  */\n\tif (!(write_flags & WIMLIB_WRITE_FLAG_PIPABLE))\n\t\twim->out_hdr.flags |= WIM_HDR_FLAG_WRITE_IN_PROGRESS;\n\tret = write_wim_header(&wim->out_hdr, &wim->out_fd, wim->out_fd.offset);\n\twim->out_hdr.flags &= ~WIM_HDR_FLAG_WRITE_IN_PROGRESS;\n\tif (ret)\n\t\tgoto out_cleanup;\n\n\t/* Write file data and metadata resources.  */\n\tif (!(write_flags & WIMLIB_WRITE_FLAG_PIPABLE)) {\n\t\t/* Default case: create a normal (non-pipable) WIM.  */\n\t\tret = write_file_data(wim, image, write_flags,\n\t\t\t\t      num_threads,\n\t\t\t\t      blob_list_override,\n\t\t\t\t      &blob_table_list);\n\t\tif (ret)\n\t\t\tgoto out_cleanup;\n\n\t\tret = write_metadata_resources(wim, image, write_flags);\n\t\tif (ret)\n\t\t\tgoto out_cleanup;\n\t} else {\n\t\t/* Non-default case: create pipable WIM.  */\n\t\tret = write_pipable_wim(wim, image, write_flags, num_threads,\n\t\t\t\t\tblob_list_override,\n\t\t\t\t\t&blob_table_list);\n\t\tif (ret)\n\t\t\tgoto out_cleanup;\n\t}\n\n\t/* Write blob table, XML data, and (optional) integrity table.  */\n\tret = finish_write(wim, image, write_flags, &blob_table_list);\nout_cleanup:\n\t(void)close_wim_writable(wim, write_flags);\n\treturn ret;\n}\n\n/* Write a standalone WIM to a file or file descriptor.  */\nstatic int\nwrite_standalone_wim(WIMStruct *wim, const void *path_or_fd,\n\t\t     int image, int write_flags, unsigned num_threads)\n{\n\treturn write_wim_part(wim, path_or_fd, image, write_flags,\n\t\t\t      num_threads, 1, 1, NULL, NULL);\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_write(WIMStruct *wim, const tchar *path,\n\t     int image, int write_flags, unsigned num_threads)\n{\n\tif (write_flags & ~WIMLIB_WRITE_MASK_PUBLIC)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (path == NULL || path[0] == T('\\0'))\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\treturn write_standalone_wim(wim, path, image, write_flags, num_threads);\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_write_to_fd(WIMStruct *wim, int fd,\n\t\t   int image, int write_flags, unsigned num_threads)\n{\n\tif (write_flags & ~WIMLIB_WRITE_MASK_PUBLIC)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (fd < 0)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\twrite_flags |= WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR;\n\n\treturn write_standalone_wim(wim, &fd, image, write_flags, num_threads);\n}\n\n/* Have there been any changes to images in the specified WIM, including updates\n * as well as deletions and additions of entire images, but excluding changes to\n * the XML document?  */\nstatic bool\nany_images_changed(WIMStruct *wim)\n{\n\tif (wim->image_deletion_occurred)\n\t\treturn true;\n\tfor (int i = 0; i < wim->hdr.image_count; i++)\n\t\tif (!is_image_unchanged_from_wim(wim->image_metadata[i], wim))\n\t\t\treturn true;\n\treturn false;\n}\n\nstatic int\ncheck_resource_offset(struct blob_descriptor *blob, void *_wim)\n{\n\tconst WIMStruct *wim = _wim;\n\toff_t end_offset = *(const off_t*)wim->private;\n\n\tif (blob->blob_location == BLOB_IN_WIM &&\n\t    blob->rdesc->wim == wim &&\n\t    blob->rdesc->offset_in_wim + blob->rdesc->size_in_wim > end_offset)\n\t\treturn WIMLIB_ERR_RESOURCE_ORDER;\n\treturn 0;\n}\n\n/* Make sure no file or metadata resources are located after the XML data (or\n * integrity table if present)--- otherwise we can't safely append to the WIM\n * file and we return WIMLIB_ERR_RESOURCE_ORDER.  */\nstatic int\ncheck_resource_offsets(WIMStruct *wim, off_t end_offset)\n{\n\tint ret;\n\tunsigned i;\n\n\twim->private = &end_offset;\n\tret = for_blob_in_table(wim->blob_table, check_resource_offset, wim);\n\tif (ret)\n\t\treturn ret;\n\n\tfor (i = 0; i < wim->hdr.image_count; i++) {\n\t\tret = check_resource_offset(wim->image_metadata[i]->metadata_blob, wim);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nstatic int\nfree_blob_if_invalidated(struct blob_descriptor *blob, void *_wim)\n{\n\tconst WIMStruct *wim = _wim;\n\n\tif (!blob->will_be_in_output_wim &&\n\t    blob->blob_location == BLOB_IN_WIM && blob->rdesc->wim == wim)\n\t{\n\t\tblob_table_unlink(wim->blob_table, blob);\n\t\tfree_blob_descriptor(blob);\n\t}\n\treturn 0;\n}\n\n/*\n * Overwrite a WIM, possibly appending new resources to it.\n *\n * A WIM looks like (or is supposed to look like) the following:\n *\n *                   Header (212 bytes)\n *                   Resources for metadata and files (variable size)\n *                   Blob table (variable size)\n *                   XML data (variable size)\n *                   Integrity table (optional) (variable size)\n *\n * If we are not adding any new files or metadata, then the blob table is\n * unchanged--- so we only need to overwrite the XML data, integrity table, and\n * header.  This operation is potentially unsafe if the program is abruptly\n * terminated while the XML data or integrity table are being overwritten, but\n * before the new header has been written.  To partially alleviate this problem,\n * we write a temporary header after the XML data has been written.  This may\n * prevent the WIM from becoming corrupted if the program is terminated while\n * the integrity table is being calculated (but no guarantees, due to write\n * re-ordering...).\n *\n * If we are adding new blobs, including new file data as well as any metadata\n * for any new images, then the blob table needs to be changed, and those blobs\n * need to be written.  In this case, we try to perform a safe update of the WIM\n * file by writing the blobs *after* the end of the previous WIM, then writing\n * the new blob table, XML data, and (optionally) integrity table following the\n * new blobs.  This will produce a layout like the following:\n *\n *                   Header (212 bytes)\n *                   (OLD) Resources for metadata and files (variable size)\n *                   (OLD) Blob table (variable size)\n *                   (OLD) XML data (variable size)\n *                   (OLD) Integrity table (optional) (variable size)\n *                   (NEW) Resources for metadata and files (variable size)\n *                   (NEW) Blob table (variable size)\n *                   (NEW) XML data (variable size)\n *                   (NEW) Integrity table (optional) (variable size)\n *\n * At all points, the WIM is valid as nothing points to the new data yet.  Then,\n * the header is overwritten to point to the new blob table, XML data, and\n * integrity table, to produce the following layout:\n *\n *                   Header (212 bytes)\n *                   Resources for metadata and files (variable size)\n *                   Nothing (variable size)\n *                   Resources for metadata and files (variable size)\n *                   Blob table (variable size)\n *                   XML data (variable size)\n *                   Integrity table (optional) (variable size)\n *\n * This function allows an image to be appended to a large WIM very quickly, and\n * is crash-safe except in the case of write re-ordering, but the disadvantage\n * is that a small hole is left in the WIM where the old blob table, xml data,\n * and integrity table were.  (These usually only take up a small amount of\n * space compared to the blobs, however.)\n *\n * Finally, this function also supports \"compaction\" overwrites as an\n * alternative to the normal \"append\" overwrites described above.  In a\n * compaction, data is written starting immediately from the end of the header.\n * All existing resources are written first, in order by file offset.  New\n * resources are written afterwards, and at the end any extra data is truncated\n * from the file.  The advantage of this approach is that is that the WIM file\n * ends up fully optimized, without any holes remaining.  The main disadavantage\n * is that this operation is fundamentally unsafe and cannot be interrupted\n * without data corruption.  Consequently, compactions are only ever done when\n * explicitly requested by the library user with the flag\n * WIMLIB_WRITE_FLAG_UNSAFE_COMPACT.  (Another disadvantage is that a compaction\n * can be much slower than an append.)\n */\nstatic int\noverwrite_wim_inplace(WIMStruct *wim, int write_flags, unsigned num_threads)\n{\n\tint ret;\n\toff_t old_wim_end;\n\tstruct list_head blob_list;\n\tstruct list_head blob_table_list;\n\tstruct filter_context filter_ctx;\n\n\t/* Include an integrity table by default if no preference was given and\n\t * the WIM already had an integrity table.  */\n\tif (!(write_flags & (WIMLIB_WRITE_FLAG_CHECK_INTEGRITY |\n\t\t\t     WIMLIB_WRITE_FLAG_NO_CHECK_INTEGRITY)))\n\t\tif (wim_has_integrity_table(wim))\n\t\t\twrite_flags |= WIMLIB_WRITE_FLAG_CHECK_INTEGRITY;\n\n\t/* Start preparing the updated file header.  */\n\tmemcpy(&wim->out_hdr, &wim->hdr, sizeof(wim->out_hdr));\n\n\t/* If using solid compression, the version number must be set to\n\t * WIM_VERSION_SOLID.  */\n\tif (write_flags & WIMLIB_WRITE_FLAG_SOLID)\n\t\twim->out_hdr.wim_version = WIM_VERSION_SOLID;\n\n\t/* Default to solid compression if it is valid in the chosen WIM file\n\t * format and the WIMStruct references any solid resources.  This is\n\t * useful when updating a solid WIM.  */\n\tif (should_default_to_solid_compression(wim, write_flags))\n\t\twrite_flags |= WIMLIB_WRITE_FLAG_SOLID;\n\n\tif (unlikely(write_flags & WIMLIB_WRITE_FLAG_UNSAFE_COMPACT)) {\n\n\t\t/* In-place compaction  */\n\n\t\tWARNING(\"The WIM file \\\"%\"TS\"\\\" is being compacted in place.\\n\"\n\t\t\t\"          Do *not* interrupt the operation, or else \"\n\t\t\t\"the WIM file will be\\n\"\n\t\t\t\"          corrupted!\", wim->filename);\n\t\twim->being_compacted = 1;\n\t\told_wim_end = WIM_HEADER_DISK_SIZE;\n\n\t\tret = prepare_blob_list_for_write(wim, WIMLIB_ALL_IMAGES,\n\t\t\t\t\t\t  write_flags, &blob_list,\n\t\t\t\t\t\t  &blob_table_list, &filter_ctx);\n\t\tif (ret)\n\t\t\tgoto out;\n\n\t\t/* Prevent new files from being deduplicated with existing blobs\n\t\t * in the WIM that we haven't decided to write.  Such blobs will\n\t\t * be overwritten during the compaction.  */\n\t\tfor_blob_in_table(wim->blob_table, free_blob_if_invalidated, wim);\n\n\t\tif (wim_has_metadata(wim)) {\n\t\t\t/* Add existing metadata resources to be compacted along\n\t\t\t * with the file resources.  */\n\t\t\tfor (int i = 0; i < wim->hdr.image_count; i++) {\n\t\t\t\tstruct wim_image_metadata *imd = wim->image_metadata[i];\n\t\t\t\tif (is_image_unchanged_from_wim(imd, wim)) {\n\t\t\t\t\tfully_reference_blob_for_write(imd->metadata_blob,\n\t\t\t\t\t\t\t\t       &blob_list);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tu64 old_blob_table_end, old_xml_begin, old_xml_end;\n\n\t\t/* Set additional flags for append.  */\n\t\twrite_flags |= WIMLIB_WRITE_FLAG_APPEND |\n\t\t\t       WIMLIB_WRITE_FLAG_STREAMS_OK;\n\n\t\t/* Make sure there is no data after the XML data, except\n\t\t * possibily an integrity table.  If this were the case, then\n\t\t * this data would be overwritten.  */\n\t\told_xml_begin = wim->hdr.xml_data_reshdr.offset_in_wim;\n\t\told_xml_end = old_xml_begin + wim->hdr.xml_data_reshdr.size_in_wim;\n\t\tif (wim->hdr.blob_table_reshdr.offset_in_wim == 0)\n\t\t\told_blob_table_end = WIM_HEADER_DISK_SIZE;\n\t\telse\n\t\t\told_blob_table_end = wim->hdr.blob_table_reshdr.offset_in_wim +\n\t\t\t\t\t     wim->hdr.blob_table_reshdr.size_in_wim;\n\t\tif (wim_has_integrity_table(wim) &&\n\t\t    wim->hdr.integrity_table_reshdr.offset_in_wim < old_xml_end) {\n\t\t\tWARNING(\"Didn't expect the integrity table to be \"\n\t\t\t\t\"before the XML data\");\n\t\t\tret = WIMLIB_ERR_RESOURCE_ORDER;\n\t\t\tgoto out;\n\t\t}\n\n\t\tif (old_blob_table_end > old_xml_begin) {\n\t\t\tWARNING(\"Didn't expect the blob table to be after \"\n\t\t\t\t\"the XML data\");\n\t\t\tret = WIMLIB_ERR_RESOURCE_ORDER;\n\t\t\tgoto out;\n\t\t}\n\t\t/* Set @old_wim_end, which indicates the point beyond which we\n\t\t * don't allow any file and metadata resources to appear without\n\t\t * returning WIMLIB_ERR_RESOURCE_ORDER (due to the fact that we\n\t\t * would otherwise overwrite these resources). */\n\t\tif (!any_images_changed(wim)) {\n\t\t\t/* If no images have been modified, added, or deleted,\n\t\t\t * then a new blob table does not need to be written.\n\t\t\t * We shall write the new XML data and optional\n\t\t\t * integrity table immediately after the blob table.\n\t\t\t * Note that this may overwrite an existing integrity\n\t\t\t * table.  */\n\t\t\told_wim_end = old_blob_table_end;\n\t\t\twrite_flags |= WIMLIB_WRITE_FLAG_NO_NEW_BLOBS;\n\t\t} else if (wim_has_integrity_table(wim)) {\n\t\t\t/* Old WIM has an integrity table; begin writing new\n\t\t\t * blobs after it. */\n\t\t\told_wim_end = wim->hdr.integrity_table_reshdr.offset_in_wim +\n\t\t\t\t      wim->hdr.integrity_table_reshdr.size_in_wim;\n\t\t} else {\n\t\t\t/* No existing integrity table; begin writing new blobs\n\t\t\t * after the old XML data. */\n\t\t\told_wim_end = old_xml_end;\n\t\t}\n\n\t\tret = check_resource_offsets(wim, old_wim_end);\n\t\tif (ret)\n\t\t\tgoto out;\n\n\t\tret = prepare_blob_list_for_write(wim, WIMLIB_ALL_IMAGES,\n\t\t\t\t\t\t  write_flags, &blob_list,\n\t\t\t\t\t\t  &blob_table_list, &filter_ctx);\n\t\tif (ret)\n\t\t\tgoto out;\n\n\t\tif (write_flags & WIMLIB_WRITE_FLAG_NO_NEW_BLOBS)\n\t\t\twimlib_assert(list_empty(&blob_list));\n\t}\n\n\t/* Update image stats if needed.  */\n\tret = update_image_stats(wim);\n\tif (ret)\n\t\tgoto out;\n\n\tret = open_wim_writable(wim, wim->filename, O_RDWR);\n\tif (ret)\n\t\tgoto out;\n\n\tret = lock_wim_for_append(wim);\n\tif (ret)\n\t\tgoto out_close_wim;\n\n\t/* Set WIM_HDR_FLAG_WRITE_IN_PROGRESS flag in header. */\n\twim->hdr.flags |= WIM_HDR_FLAG_WRITE_IN_PROGRESS;\n\tret = write_wim_header_flags(wim->hdr.flags, &wim->out_fd);\n\twim->hdr.flags &= ~WIM_HDR_FLAG_WRITE_IN_PROGRESS;\n\tif (ret) {\n\t\tERROR_WITH_ERRNO(\"Error updating WIM header flags\");\n\t\tgoto out_unlock_wim;\n\t}\n\n\tif (filedes_seek(&wim->out_fd, old_wim_end) == -1) {\n\t\tERROR_WITH_ERRNO(\"Can't seek to end of WIM\");\n\t\tret = WIMLIB_ERR_WRITE;\n\t\tgoto out_restore_hdr;\n\t}\n\n\tret = write_file_data_blobs(wim, &blob_list, write_flags,\n\t\t\t\t    num_threads, &filter_ctx);\n\tif (ret)\n\t\tgoto out_truncate;\n\n\tret = write_metadata_resources(wim, WIMLIB_ALL_IMAGES, write_flags);\n\tif (ret)\n\t\tgoto out_truncate;\n\n\tret = finish_write(wim, WIMLIB_ALL_IMAGES, write_flags,\n\t\t\t   &blob_table_list);\n\tif (ret)\n\t\tgoto out_truncate;\n\n\tunlock_wim_for_append(wim);\n\treturn 0;\n\nout_truncate:\n\tif (!(write_flags & (WIMLIB_WRITE_FLAG_NO_NEW_BLOBS |\n\t\t\t     WIMLIB_WRITE_FLAG_UNSAFE_COMPACT))) {\n\t\tWARNING(\"Truncating \\\"%\"TS\"\\\" to its original size \"\n\t\t\t\"(%\"PRIu64\" bytes)\", wim->filename, old_wim_end);\n\t\tif (ftruncate(wim->out_fd.fd, old_wim_end))\n\t\t\tWARNING_WITH_ERRNO(\"Failed to truncate WIM file!\");\n\t}\nout_restore_hdr:\n\t(void)write_wim_header_flags(wim->hdr.flags, &wim->out_fd);\nout_unlock_wim:\n\tunlock_wim_for_append(wim);\nout_close_wim:\n\t(void)close_wim_writable(wim, write_flags);\nout:\n\twim->being_compacted = 0;\n\treturn ret;\n}\n\nstatic int\noverwrite_wim_via_tmpfile(WIMStruct *wim, int write_flags, unsigned num_threads)\n{\n\tsize_t wim_name_len;\n\tint ret;\n\n\t/* Write the WIM to a temporary file in the same directory as the\n\t * original WIM. */\n\twim_name_len = tstrlen(wim->filename);\n\ttchar* tmpfile = alloca((wim_name_len + 10) * sizeof(tchar));\n\tif (!tmpfile)\n\t\treturn WIMLIB_ERR_NOMEM;\n\ttmemcpy(tmpfile, wim->filename, wim_name_len);\n\tget_random_alnum_chars(tmpfile + wim_name_len, 9);\n\ttmpfile[wim_name_len + 9] = T('\\0');\n\n\tret = wimlib_write(wim, tmpfile, WIMLIB_ALL_IMAGES,\n\t\t\t   write_flags |\n\t\t\t\tWIMLIB_WRITE_FLAG_FSYNC |\n\t\t\t\tWIMLIB_WRITE_FLAG_RETAIN_GUID,\n\t\t\t   num_threads);\n\tif (ret) {\n\t\ttunlink(tmpfile);\n\t\treturn ret;\n\t}\n\n\tif (filedes_valid(&wim->in_fd)) {\n\t\tfiledes_close(&wim->in_fd);\n\t\tfiledes_invalidate(&wim->in_fd);\n\t}\n\n\t/* Rename the new WIM file to the original WIM file.  Note: on Windows\n\t * this actually calls win32_rename_replacement(), not _wrename(), so\n\t * that removing the existing destination file can be handled.  */\n\tret = trename(tmpfile, wim->filename);\n\tif (ret) {\n\t\tERROR_WITH_ERRNO(\"Failed to rename `%\"TS\"' to `%\"TS\"'\",\n\t\t\t\t tmpfile, wim->filename);\n\t#ifdef _WIN32\n\t\tif (ret < 0)\n\t#endif\n\t\t{\n\t\t\ttunlink(tmpfile);\n\t\t}\n\t\treturn WIMLIB_ERR_RENAME;\n\t}\n\n\tunion wimlib_progress_info progress;\n\tprogress.rename.from = tmpfile;\n\tprogress.rename.to = wim->filename;\n\treturn call_progress(wim->progfunc, WIMLIB_PROGRESS_MSG_RENAME,\n\t\t\t     &progress, wim->progctx);\n}\n\n/* Determine if the specified WIM file may be updated in-place rather than by\n * writing and replacing it with an entirely new file.  */\nstatic bool\ncan_overwrite_wim_inplace(const WIMStruct *wim, int write_flags)\n{\n\t/* REBUILD flag forces full rebuild.  */\n\tif (write_flags & WIMLIB_WRITE_FLAG_REBUILD)\n\t\treturn false;\n\n\t/* Image deletions cause full rebuild by default.  */\n\tif (wim->image_deletion_occurred &&\n\t    !(write_flags & WIMLIB_WRITE_FLAG_SOFT_DELETE))\n\t\treturn false;\n\n\t/* Pipable WIMs cannot be updated in place, nor can a non-pipable WIM be\n\t * turned into a pipable WIM in-place.  */\n\tif (wim_is_pipable(wim) || (write_flags & WIMLIB_WRITE_FLAG_PIPABLE))\n\t\treturn false;\n\n\t/* The default compression type and compression chunk size selected for\n\t * the output WIM must be the same as those currently used for the WIM.\n\t */\n\tif (wim->compression_type != wim->out_compression_type)\n\t\treturn false;\n\tif (wim->chunk_size != wim->out_chunk_size)\n\t\treturn false;\n\n\treturn true;\n}\n\n/* API function documented in wimlib.h  */\nWIMLIBAPI int\nwimlib_overwrite(WIMStruct *wim, int write_flags, unsigned num_threads)\n{\n\tint ret;\n\tu32 orig_hdr_flags;\n\n\tif (write_flags & ~WIMLIB_WRITE_MASK_PUBLIC)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (!wim->filename)\n\t\treturn WIMLIB_ERR_NO_FILENAME;\n\n\tif (unlikely(write_flags & WIMLIB_WRITE_FLAG_UNSAFE_COMPACT)) {\n\t\t/*\n\t\t * In UNSAFE_COMPACT mode:\n\t\t *\t- RECOMPRESS is forbidden\n\t\t *\t- REBUILD is ignored\n\t\t *\t- SOFT_DELETE and NO_SOLID_SORT are implied\n\t\t */\n\t\tif (write_flags & WIMLIB_WRITE_FLAG_RECOMPRESS)\n\t\t\treturn WIMLIB_ERR_COMPACTION_NOT_POSSIBLE;\n\t\twrite_flags &= ~WIMLIB_WRITE_FLAG_REBUILD;\n\t\twrite_flags |= WIMLIB_WRITE_FLAG_SOFT_DELETE;\n\t\twrite_flags |= WIMLIB_WRITE_FLAG_NO_SOLID_SORT;\n\t}\n\n\torig_hdr_flags = wim->hdr.flags;\n\tif (write_flags & WIMLIB_WRITE_FLAG_IGNORE_READONLY_FLAG)\n\t\twim->hdr.flags &= ~WIM_HDR_FLAG_READONLY;\n\tret = can_modify_wim(wim);\n\twim->hdr.flags = orig_hdr_flags;\n\tif (ret)\n\t\treturn ret;\n\n\tif (can_overwrite_wim_inplace(wim, write_flags)) {\n\t\tret = overwrite_wim_inplace(wim, write_flags, num_threads);\n\t\tif (ret != WIMLIB_ERR_RESOURCE_ORDER)\n\t\t\treturn ret;\n\t\tWARNING(\"Falling back to re-building entire WIM\");\n\t}\n\tif (write_flags & WIMLIB_WRITE_FLAG_UNSAFE_COMPACT)\n\t\treturn WIMLIB_ERR_COMPACTION_NOT_POSSIBLE;\n\treturn overwrite_wim_via_tmpfile(wim, write_flags, num_threads);\n}\n"
  },
  {
    "path": "src/wimlib/xml.c",
    "content": "/*\n * xml.c - deals with the XML information in WIM files\n */\n\n/*\n * Copyright 2012-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <stdlib.h>\n#include <string.h>\n\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/file_io.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/resource.h\"\n#include \"wimlib/timestamp.h\"\n#include \"wimlib/xml.h\"\n#include \"wimlib/xmlproc.h\"\n#include \"wimlib/write.h\"\n\n/*\n * A wrapper around a WIM file's XML document.  The XML document contains\n * metadata about each image in the WIM file as well as metadata about the WIM\n * file itself.\n */\nstruct wim_xml_info {\n\n\t/* The XML document in tree form */\n\tstruct xml_node *root;\n\n\t/* A malloc()ed array containing a pointer to the IMAGE element for each\n\t * WIM image.  The image with 1-based index 'i' is at index 'i - 1' in\n\t * this array.  Note: these pointers are cached values, since they could\n\t * also be found by searching the document.  */\n\tstruct xml_node **images;\n\n\t/* The number of WIM images (the length of 'images')  */\n\tint image_count;\n};\n\nstatic u64\nparse_number(const tchar *str, int base)\n{\n\ttchar *end;\n\tunsigned long long v;\n\n\tif (!str)\n\t\treturn 0;\n\tv = tstrtoull(str, &end, base);\n\tif (end == str || *end || v >= UINT64_MAX)\n\t\treturn 0;\n\treturn v;\n}\n\n/*\n * Retrieve an unsigned integer from the contents of the specified element,\n * decoding it using the specified base.  If the element has no contents or does\n * not contain a valid number, returns 0.\n */\nstatic u64\nxml_element_get_number(const struct xml_node *element, int base)\n{\n\treturn parse_number(xml_element_get_text(element), base);\n}\n\n/*\n * Retrieve the timestamp from a time element.  This element should have child\n * elements HIGHPART and LOWPART; these elements will be used to construct a\n * Windows-style timestamp.\n */\nstatic u64\nxml_element_get_timestamp(const struct xml_node *element)\n{\n\tu64 timestamp = 0;\n\tconst struct xml_node *child;\n\n\txml_node_for_each_child(element, child) {\n\t\tif (xml_node_is_element(child, T(\"HIGHPART\")))\n\t\t\ttimestamp |= xml_element_get_number(child, 16) << 32;\n\t\telse if (xml_node_is_element(child, T(\"LOWPART\")))\n\t\t\ttimestamp |= xml_element_get_number(child, 16);\n\t}\n\treturn timestamp;\n}\n\n/* Create a new timestamp element and optionally link it into a tree.  */\nstatic struct xml_node *\nxml_new_element_with_timestamp(struct xml_node *parent, const tchar *name,\n\t\t\t       u64 timestamp)\n{\n\tstruct xml_node *element;\n\ttchar buf[32];\n\n\telement = xml_new_element(NULL, name);\n\tif (!element)\n\t\tgoto err;\n\n\ttsprintf(buf, T(\"0x%08\"PRIX32), (u32)(timestamp >> 32));\n\tif (!xml_new_element_with_text(element, T(\"HIGHPART\"), buf))\n\t\tgoto err;\n\n\ttsprintf(buf, T(\"0x%08\"PRIX32), (u32)timestamp);\n\tif (!xml_new_element_with_text(element, T(\"LOWPART\"), buf))\n\t\tgoto err;\n\n\tif (parent)\n\t\txml_add_child(parent, element);\n\treturn element;\n\nerr:\n\txml_free_node(element);\n\treturn NULL;\n}\n\n/* Create a new number element and optionally link it into a tree.  */\nstatic struct xml_node *\nxml_new_element_with_u64(struct xml_node *parent, const tchar *name, u64 value)\n{\n\ttchar buf[32];\n\n\ttsprintf(buf, T(\"%\"PRIu64), value);\n\treturn xml_new_element_with_text(parent, name, buf);\n}\n\nstatic bool\nparse_index(tchar **pp, u32 *index_ret)\n{\n\ttchar *p = *pp;\n\tu32 index = 0;\n\n\t*p++ = '\\0'; /* overwrite '[' */\n\twhile (*p >= '0' && *p <= '9') {\n\t\tu32 n = (index * 10) + (*p++ - '0');\n\t\tif (n < index)\n\t\t\treturn false;\n\t\tindex = n;\n\t}\n\tif (index == 0)\n\t\treturn false;\n\tif (*p != ']')\n\t\treturn false;\n\tp++;\n\tif (*p != '/' && *p != '\\0')\n\t\treturn false;\n\n\t*pp = p;\n\t*index_ret = index;\n\treturn true;\n}\n\nstatic int\ndo_xml_path_walk(struct xml_node *element, const tchar *path, bool create,\n\t\t struct xml_node **result_ret)\n{\n\tsize_t n = tstrlen(path) + 1;\n#ifdef _RUFUS\n\twimlib_assert(n < MAX_PATH);\n\ttchar buf[MAX_PATH];\n#else\n\ttchar buf[n];\n#endif\n\ttchar *p;\n\ttchar c;\n\n\t*result_ret = NULL;\n\n\tif (!element)\n\t\treturn 0;\n\n\t/* Copy the path to a temporary buffer.  */\n\ttmemcpy(buf, path, n);\n\tp = buf;\n\n\tif (*p == '/')\n\t\tgoto bad_syntax;\n\tc = *p;\n\n\twhile (c != '\\0') {\n\t\tconst tchar *name;\n\t\tstruct xml_node *child;\n\t\tu32 index = 1;\n\n\t\t/* We have another path component.  */\n\n\t\t/* Parse the element name.  */\n\t\tname = p;\n\t\twhile (*p != '/' && *p != '\\0' && *p != '[')\n\t\t\tp++;\n\t\tif (p == name) /* empty name?  */\n\t\t\tgoto bad_syntax;\n\n\t\t/* Handle a bracketed index, if one was specified.  */\n\t\tif (*p == '[' && !parse_index(&p, &index))\n\t\t\tgoto bad_syntax;\n\n\t\tc = *p;\n\t\t*p = '\\0';\n\n\t\t/* Look for a matching child.  */\n\t\txml_node_for_each_child(element, child)\n\t\t\tif (xml_node_is_element(child, name) && !--index)\n\t\t\t\tgoto next_step;\n\n\t\t/* No child matched the path.  If create=false, the lookup\n\t\t * failed.  If create=true, create the needed element.  */\n\t\tif (!create)\n\t\t\treturn 0;\n\n\t\t/* We can't create an element at index 'n' if indices 1...n-1\n\t\t * didn't already exist.  */\n\t\tif (index != 1)\n\t\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\t\tchild = xml_new_element(element, name);\n\t\tif (!child)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\tnext_step:\n\t\t/* Continue to the next path component, if there is one.  */\n\t\telement = child;\n\t\tp++;\n\t}\n\n\t*result_ret = element;\n\treturn 0;\n\nbad_syntax:\n\tERROR(\"The XML path \\\"%\"TS\"\\\" has invalid syntax.\", path);\n\treturn WIMLIB_ERR_INVALID_PARAM;\n}\n\n/* Retrieve the XML element, if any, at the specified 'path'.  This supports a\n * simple filesystem-like syntax.  If the element was found, returns a pointer\n * to it; otherwise returns NULL.  */\nstatic struct xml_node *\nxml_get_element_by_path(struct xml_node *root, const tchar *path)\n{\n\tstruct xml_node *element;\n\n\tdo_xml_path_walk(root, path, false, &element);\n\treturn element;\n}\n\n/*\n * Similar to xml_get_element_by_path(), but creates the element and any\n * requisite ancestor elements as needed.   If successful, 0 is returned and\n * *element_ret is set to a pointer to the resulting element.  If unsuccessful,\n * an error code is returned and *element_ret is set to NULL.\n */\nstatic int\nxml_ensure_element_by_path(struct xml_node *root, const tchar *path,\n\t\t\t   struct xml_node **element_ret)\n{\n\treturn do_xml_path_walk(root, path, true, element_ret);\n}\n\nstatic u64\nxml_get_number_by_path(struct xml_node *root, const tchar *path)\n{\n\treturn xml_element_get_number(xml_get_element_by_path(root, path), 10);\n}\n\nstatic u64\nxml_get_timestamp_by_path(struct xml_node *root, const tchar *path)\n{\n\treturn xml_element_get_timestamp(xml_get_element_by_path(root, path));\n}\n\nstatic const tchar *\nxml_get_text_by_path(struct xml_node *root, const tchar *path)\n{\n\treturn xml_element_get_text(xml_get_element_by_path(root, path));\n}\n\n/*\n * Create/replace (if text is not NULL and not empty) or remove (if text is NULL\n * or empty) an element containing text.\n */\nstatic int\nxml_set_text_by_path(struct xml_node *root, const tchar *path,\n\t\t     const tchar *text)\n{\n\tint ret;\n\tstruct xml_node *element;\n\n\tif (text && *text) {\n\t\t/* Create or replace  */\n\t\tret = xml_ensure_element_by_path(root, path, &element);\n\t\tif (ret)\n\t\t\treturn ret;\n\t\treturn xml_element_set_text(element, text);\n\t} else {\n\t\t/* Remove  */\n\t\txml_free_node(xml_get_element_by_path(root, path));\n\t\treturn 0;\n\t}\n}\n\n/* Unlink and return the node which represents the INDEX attribute of the\n * specified IMAGE element.  */\nstatic struct xml_node *\nunlink_index_attribute(struct xml_node *image_node)\n{\n\tstruct xml_node *attr = xml_get_attrib(image_node, T(\"INDEX\"));\n\n\txml_unlink_node(attr);\n\treturn attr;\n}\n\n/* Compute the total uncompressed size of the streams of the specified inode. */\nstatic u64\ninode_sum_stream_sizes(const struct wim_inode *inode,\n\t\t       const struct blob_table *blob_table)\n{\n\tu64 total_size = 0;\n\n\tfor (unsigned i = 0; i < inode->i_num_streams; i++) {\n\t\tconst struct blob_descriptor *blob;\n\n\t\tblob = stream_blob(&inode->i_streams[i], blob_table);\n\t\tif (blob)\n\t\t\ttotal_size += blob->size;\n\t}\n\treturn total_size;\n}\n\nstatic int\nappend_image_node(struct wim_xml_info *info, struct xml_node *image_node)\n{\n\ttchar buf[32];\n\tstruct xml_node **images;\n\tint ret;\n\n\t/* Limit exceeded?  */\n\tif (unlikely(info->image_count >= MAX_IMAGES))\n\t\treturn WIMLIB_ERR_IMAGE_COUNT;\n\n\t/* Set the INDEX attribute. */\n\ttsprintf(buf, T(\"%d\"), info->image_count + 1);\n\tret = xml_set_attrib(image_node, T(\"INDEX\"), buf);\n\tif (ret)\n\t\treturn ret;\n\n\t/* Append the IMAGE element to the 'images' array.  */\n\timages = REALLOC(info->images,\n\t\t\t (info->image_count + 1) * sizeof(info->images[0]));\n\tif (unlikely(!images))\n\t\treturn WIMLIB_ERR_NOMEM;\n\tinfo->images = images;\n\timages[info->image_count++] = image_node;\n\n\t/* Add the IMAGE element to the document.  */\n\txml_add_child(info->root, image_node);\n\treturn 0;\n}\n\n/*----------------------------------------------------------------------------*\n *                     Functions for internal library use                     *\n *----------------------------------------------------------------------------*/\n\n/* Allocate an empty 'struct wim_xml_info', containing no images.  */\nstruct wim_xml_info *\nxml_new_info_struct(void)\n{\n\tstruct wim_xml_info *info = CALLOC(1, sizeof(*info));\n\n\tif (!info)\n\t\treturn NULL;\n\n\tinfo->root = xml_new_element(NULL, T(\"WIM\"));\n\tif (!info->root) {\n\t\tFREE(info);\n\t\treturn NULL;\n\t}\n\treturn info;\n}\n\n/* Free a 'struct wim_xml_info'.  */\nvoid\nxml_free_info_struct(struct wim_xml_info *info)\n{\n\tif (info) {\n\t\txml_free_node(info->root);\n\t\tFREE(info->images);\n\t\tFREE(info);\n\t}\n}\n\n/* Retrieve the number of images for which there exist IMAGE elements in the XML\n * document.  */\nint\nxml_get_image_count(const struct wim_xml_info *info)\n{\n\treturn info->image_count;\n}\n\n/* Retrieve the TOTALBYTES value for the WIM file, or 0 if this value is\n * unavailable.  */\nu64\nxml_get_total_bytes(const struct wim_xml_info *info)\n{\n\treturn xml_get_number_by_path(info->root, T(\"TOTALBYTES\"));\n}\n\n/* Retrieve the TOTALBYTES value for the specified image, or 0 if this value is\n * unavailable.  */\nu64\nxml_get_image_total_bytes(const struct wim_xml_info *info, int image)\n{\n\treturn xml_get_number_by_path(info->images[image - 1], T(\"TOTALBYTES\"));\n}\n\n/* Retrieve the HARDLINKBYTES value for the specified image, or 0 if this value\n * is unavailable.  */\nu64\nxml_get_image_hard_link_bytes(const struct wim_xml_info *info, int image)\n{\n\treturn xml_get_number_by_path(info->images[image - 1],\n\t\t\t\t      T(\"HARDLINKBYTES\"));\n}\n\n/* Retrieve the WIMBOOT value for the specified image, or false if this value is\n * unavailable.  */\nbool\nxml_get_wimboot(const struct wim_xml_info *info, int image)\n{\n\treturn xml_get_number_by_path(info->images[image - 1], T(\"WIMBOOT\"));\n}\n\n/* Retrieve the Windows build number for the specified image, or 0 if this\n * information is not available.  */\nu64\nxml_get_windows_build_number(const struct wim_xml_info *info, int image)\n{\n\treturn xml_get_number_by_path(info->images[image - 1],\n\t\t\t\t      T(\"WINDOWS/VERSION/BUILD\"));\n}\n\n/* Set the WIMBOOT value for the specified image.  */\nint\nxml_set_wimboot(struct wim_xml_info *info, int image)\n{\n\treturn xml_set_text_by_path(info->images[image - 1],\n\t\t\t\t    T(\"WIMBOOT\"), T(\"1\"));\n}\n\n/*\n * Update the DIRCOUNT, FILECOUNT, TOTALBYTES, HARDLINKBYTES, and\n * LASTMODIFICATIONTIME elements for the specified WIM image.\n *\n * Note: since these stats are likely to be used for display purposes only, we\n * no longer attempt to duplicate WIMGAPI's weird bugs when calculating them.\n */\nint\nxml_update_image_info(WIMStruct *wim, int image)\n{\n\tconst struct wim_image_metadata *imd = wim->image_metadata[image - 1];\n\tstruct xml_node *image_node = wim->xml_info->images[image - 1];\n\tconst struct wim_inode *inode;\n\tu64 dir_count = 0;\n\tu64 file_count = 0;\n\tu64 total_bytes = 0;\n\tu64 hard_link_bytes = 0;\n\tu64 size;\n\tstruct xml_node *dircount_node;\n\tstruct xml_node *filecount_node;\n\tstruct xml_node *totalbytes_node;\n\tstruct xml_node *hardlinkbytes_node;\n\tstruct xml_node *lastmodificationtime_node;\n\n\timage_for_each_inode(inode, imd) {\n\t\tif (inode_is_directory(inode))\n\t\t\tdir_count += inode->i_nlink;\n\t\telse\n\t\t\tfile_count += inode->i_nlink;\n\t\tsize = inode_sum_stream_sizes(inode, wim->blob_table);\n\t\ttotal_bytes += size * inode->i_nlink;\n\t\thard_link_bytes += size * (inode->i_nlink - 1);\n\t}\n\n\tdircount_node = xml_new_element_with_u64(NULL, T(\"DIRCOUNT\"),\n\t\t\t\t\t\t dir_count);\n\tfilecount_node = xml_new_element_with_u64(NULL, T(\"FILECOUNT\"),\n\t\t\t\t\t\t  file_count);\n\ttotalbytes_node = xml_new_element_with_u64(NULL, T(\"TOTALBYTES\"),\n\t\t\t\t\t\t   total_bytes);\n\thardlinkbytes_node = xml_new_element_with_u64(NULL, T(\"HARDLINKBYTES\"),\n\t\t\t\t\t\t      hard_link_bytes);\n\tlastmodificationtime_node = xml_new_element_with_timestamp(NULL,\n\t\t\tT(\"LASTMODIFICATIONTIME\"), now_as_wim_timestamp());\n\n\tif (unlikely(!dircount_node || !filecount_node || !totalbytes_node ||\n\t\t     !hardlinkbytes_node || !lastmodificationtime_node)) {\n\t\txml_free_node(dircount_node);\n\t\txml_free_node(filecount_node);\n\t\txml_free_node(totalbytes_node);\n\t\txml_free_node(hardlinkbytes_node);\n\t\txml_free_node(lastmodificationtime_node);\n\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\txml_replace_child(image_node, dircount_node);\n\txml_replace_child(image_node, filecount_node);\n\txml_replace_child(image_node, totalbytes_node);\n\txml_replace_child(image_node, hardlinkbytes_node);\n\txml_replace_child(image_node, lastmodificationtime_node);\n\treturn 0;\n}\n\n/* Add an image to the XML information. */\nint\nxml_add_image(struct wim_xml_info *info, const tchar *name)\n{\n\tconst u64 now = now_as_wim_timestamp();\n\tstruct xml_node *image_node;\n\tint ret;\n\n\tif (name && !xml_legal_value(name)) {\n\t\tERROR(\"Name of new image contains illegal characters\");\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t}\n\n\tret = WIMLIB_ERR_NOMEM;\n\timage_node = xml_new_element(NULL, T(\"IMAGE\"));\n\tif (!image_node)\n\t\tgoto err;\n\tif (name && *name &&\n\t    !xml_new_element_with_text(image_node, T(\"NAME\"), name))\n\t\tgoto err;\n\tif (!xml_new_element_with_u64(image_node, T(\"DIRCOUNT\"), 0))\n\t\tgoto err;\n\tif (!xml_new_element_with_u64(image_node, T(\"FILECOUNT\"), 0))\n\t\tgoto err;\n\tif (!xml_new_element_with_u64(image_node, T(\"TOTALBYTES\"), 0))\n\t\tgoto err;\n\tif (!xml_new_element_with_u64(image_node, T(\"HARDLINKBYTES\"), 0))\n\t\tgoto err;\n\tif (!xml_new_element_with_timestamp(image_node, T(\"CREATIONTIME\"), now))\n\t\tgoto err;\n\tif (!xml_new_element_with_timestamp(image_node,\n\t\t\t\t\t    T(\"LASTMODIFICATIONTIME\"), now))\n\t\tgoto err;\n\tret = append_image_node(info, image_node);\n\tif (ret)\n\t\tgoto err;\n\treturn 0;\n\nerr:\n\txml_free_node(image_node);\n\treturn ret;\n}\n\n/*\n * Make a copy of the XML information for the image with index @src_image in the\n * @src_info XML document and append it to the @dest_info XML document.\n *\n * In the process, change the image's name and description to the values\n * specified by @dest_image_name and @dest_image_description.  Either or both\n * may be NULL, which indicates that the corresponding element will not be\n * included in the destination image.\n */\nint\nxml_export_image(const struct wim_xml_info *src_info, int src_image,\n\t\t struct wim_xml_info *dest_info, const tchar *dest_image_name,\n\t\t const tchar *dest_image_description, bool wimboot)\n{\n\tstruct xml_node *dest_node;\n\tint ret;\n\n\tif (dest_image_name && !xml_legal_value(dest_image_name)) {\n\t\tERROR(\"Destination image name contains illegal characters\");\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t}\n\tif (dest_image_description &&\n\t    !xml_legal_value(dest_image_description)) {\n\t\tERROR(\"Destination image description contains illegal characters\");\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t}\n\n\tret = WIMLIB_ERR_NOMEM;\n\tdest_node = xml_clone_tree(src_info->images[src_image - 1]);\n\tif (!dest_node)\n\t\tgoto err;\n\n\tret = xml_set_text_by_path(dest_node, T(\"NAME\"), dest_image_name);\n\tif (ret)\n\t\tgoto err;\n\n\tret = xml_set_text_by_path(dest_node, T(\"DESCRIPTION\"),\n\t\t\t\t   dest_image_description);\n\tif (ret)\n\t\tgoto err;\n\n\tif (wimboot) {\n\t\tret = xml_set_text_by_path(dest_node, T(\"WIMBOOT\"), T(\"1\"));\n\t\tif (ret)\n\t\t\tgoto err;\n\t}\n\n\tret = append_image_node(dest_info, dest_node);\n\tif (ret)\n\t\tgoto err;\n\treturn 0;\n\nerr:\n\txml_free_node(dest_node);\n\treturn ret;\n}\n\n/* Remove the specified image from the XML document.  */\nvoid\nxml_delete_image(struct wim_xml_info *info, int image)\n{\n\tstruct xml_node *next_image;\n\tstruct xml_node *index_attr, *next_index_attr;\n\n\t/* Free the IMAGE element for the deleted image.  Then, shift all\n\t * higher-indexed IMAGE elements down by 1, in the process re-assigning\n\t * their INDEX attributes.  */\n\n\tnext_image = info->images[image - 1];\n\tnext_index_attr = unlink_index_attribute(next_image);\n\txml_free_node(next_image);\n\n\twhile (image < info->image_count) {\n\t\tindex_attr = next_index_attr;\n\t\tnext_image = info->images[image];\n\t\tnext_index_attr = unlink_index_attribute(next_image);\n\t\txml_add_child(next_image, index_attr);\n\t\tinfo->images[image - 1] = next_image;\n\t\timage++;\n\t}\n\n\txml_free_node(next_index_attr);\n\tinfo->image_count--;\n}\n\n/* Architecture constants are from w64 mingw winnt.h  */\n#define PROCESSOR_ARCHITECTURE_INTEL\t\t0\n#define PROCESSOR_ARCHITECTURE_MIPS\t\t1\n#define PROCESSOR_ARCHITECTURE_ALPHA\t\t2\n#define PROCESSOR_ARCHITECTURE_PPC\t\t3\n#define PROCESSOR_ARCHITECTURE_SHX\t\t4\n#define PROCESSOR_ARCHITECTURE_ARM\t\t5\n#define PROCESSOR_ARCHITECTURE_IA64\t\t6\n#define PROCESSOR_ARCHITECTURE_ALPHA64\t\t7\n#define PROCESSOR_ARCHITECTURE_MSIL\t\t8\n#define PROCESSOR_ARCHITECTURE_AMD64\t\t9\n#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64\t10\n#define PROCESSOR_ARCHITECTURE_ARM64\t\t12\n\nstatic const tchar *\ndescribe_arch(u64 arch)\n{\n\tstatic const tchar * const descriptions[] = {\n\t\t[PROCESSOR_ARCHITECTURE_INTEL] = T(\"x86\"),\n\t\t[PROCESSOR_ARCHITECTURE_MIPS]  = T(\"MIPS\"),\n\t\t[PROCESSOR_ARCHITECTURE_ARM]   = T(\"ARM\"),\n\t\t[PROCESSOR_ARCHITECTURE_IA64]  = T(\"ia64\"),\n\t\t[PROCESSOR_ARCHITECTURE_AMD64] = T(\"x86_64\"),\n\t\t[PROCESSOR_ARCHITECTURE_ARM64] = T(\"ARM64\"),\n\t};\n\n\tif (arch < ARRAY_LEN(descriptions) && descriptions[arch] != NULL)\n\t\treturn descriptions[arch];\n\n\treturn T(\"unknown\");\n}\n\n/* Print information from the WINDOWS element, if present.  */\nstatic void\nprint_windows_info(struct xml_node *image_node)\n{\n\tstruct xml_node *windows_node;\n\tstruct xml_node *langs_node;\n\tstruct xml_node *version_node;\n\tconst tchar *text;\n\n\twindows_node = xml_get_element_by_path(image_node, T(\"WINDOWS\"));\n\tif (!windows_node)\n\t\treturn;\n\n\ttprintf(T(\"Architecture:           %\"TS\"\\n\"),\n\t\tdescribe_arch(xml_get_number_by_path(windows_node, T(\"ARCH\"))));\n\n\ttext = xml_get_text_by_path(windows_node, T(\"PRODUCTNAME\"));\n\tif (text)\n\t\ttprintf(T(\"Product Name:           %\"TS\"\\n\"), text);\n\n\ttext = xml_get_text_by_path(windows_node, T(\"EDITIONID\"));\n\tif (text)\n\t\ttprintf(T(\"Edition ID:             %\"TS\"\\n\"), text);\n\n\ttext = xml_get_text_by_path(windows_node, T(\"INSTALLATIONTYPE\"));\n\tif (text)\n\t\ttprintf(T(\"Installation Type:      %\"TS\"\\n\"), text);\n\n\ttext = xml_get_text_by_path(windows_node, T(\"HAL\"));\n\tif (text)\n\t\ttprintf(T(\"HAL:                    %\"TS\"\\n\"), text);\n\n\ttext = xml_get_text_by_path(windows_node, T(\"PRODUCTTYPE\"));\n\tif (text)\n\t\ttprintf(T(\"Product Type:           %\"TS\"\\n\"), text);\n\n\ttext = xml_get_text_by_path(windows_node, T(\"PRODUCTSUITE\"));\n\tif (text)\n\t\ttprintf(T(\"Product Suite:          %\"TS\"\\n\"), text);\n\n\tlangs_node = xml_get_element_by_path(windows_node, T(\"LANGUAGES\"));\n\tif (langs_node) {\n\t\tstruct xml_node *lang_node;\n\n\t\ttprintf(T(\"Languages:              \"));\n\t\txml_node_for_each_child(langs_node, lang_node) {\n\t\t\tif (!xml_node_is_element(lang_node, T(\"LANGUAGE\")))\n\t\t\t\tcontinue;\n\t\t\ttext = xml_element_get_text(lang_node);\n\t\t\tif (!text)\n\t\t\t\tcontinue;\n\t\t\ttprintf(T(\"%\"TS\" \"), text);\n\t\t}\n\t\ttputchar(T('\\n'));\n\n\t\ttext = xml_get_text_by_path(langs_node, T(\"DEFAULT\"));\n\t\tif (text)\n\t\t\ttprintf(T(\"Default Language:       %\"TS\"\\n\"), text);\n\t}\n\n\ttext = xml_get_text_by_path(windows_node, T(\"SYSTEMROOT\"));\n\tif (text)\n\t\ttprintf(T(\"System Root:            %\"TS\"\\n\"), text);\n\n\tversion_node = xml_get_element_by_path(windows_node, T(\"VERSION\"));\n\tif (version_node) {\n\t\ttprintf(T(\"Major Version:          %\"PRIu64\"\\n\"),\n\t\t\txml_get_number_by_path(version_node, T(\"MAJOR\")));\n\t\ttprintf(T(\"Minor Version:          %\"PRIu64\"\\n\"),\n\t\t\txml_get_number_by_path(version_node, T(\"MINOR\")));\n\t\ttprintf(T(\"Build:                  %\"PRIu64\"\\n\"),\n\t\t\txml_get_number_by_path(version_node, T(\"BUILD\")));\n\t\ttprintf(T(\"Service Pack Build:     %\"PRIu64\"\\n\"),\n\t\t\txml_get_number_by_path(version_node, T(\"SPBUILD\")));\n\t\ttprintf(T(\"Service Pack Level:     %\"PRIu64\"\\n\"),\n\t\t\txml_get_number_by_path(version_node, T(\"SPLEVEL\")));\n\t}\n}\n\n/* Prints information about the specified image.  */\nvoid\nxml_print_image_info(struct wim_xml_info *info, int image)\n{\n\tstruct xml_node * const image_node = info->images[image - 1];\n\tconst tchar *text;\n\ttchar timebuf[64];\n\n\ttprintf(T(\"Index:                  %d\\n\"), image);\n\n\t/* Always print the Name and Description, even if the corresponding XML\n\t * elements are not present.  */\n\ttext = xml_get_text_by_path(image_node, T(\"NAME\"));\n\ttprintf(T(\"Name:                   %\"TS\"\\n\"), text ? text : T(\"\"));\n\ttext = xml_get_text_by_path(image_node, T(\"DESCRIPTION\"));\n\ttprintf(T(\"Description:            %\"TS\"\\n\"), text ? text : T(\"\"));\n\n\ttext = xml_get_text_by_path(image_node, T(\"DISPLAYNAME\"));\n\tif (text)\n\t\ttprintf(T(\"Display Name:           %\"TS\"\\n\"), text);\n\n\ttext = xml_get_text_by_path(image_node, T(\"DISPLAYDESCRIPTION\"));\n\tif (text)\n\t\ttprintf(T(\"Display Description:    %\"TS\"\\n\"), text);\n\n\ttprintf(T(\"Directory Count:        %\"PRIu64\"\\n\"),\n\t\txml_get_number_by_path(image_node, T(\"DIRCOUNT\")));\n\n\ttprintf(T(\"File Count:             %\"PRIu64\"\\n\"),\n\t\txml_get_number_by_path(image_node, T(\"FILECOUNT\")));\n\n\ttprintf(T(\"Total Bytes:            %\"PRIu64\"\\n\"),\n\t\txml_get_number_by_path(image_node, T(\"TOTALBYTES\")));\n\n\ttprintf(T(\"Hard Link Bytes:        %\"PRIu64\"\\n\"),\n\t\txml_get_number_by_path(image_node, T(\"HARDLINKBYTES\")));\n\n\twim_timestamp_to_str(xml_get_timestamp_by_path(image_node,\n\t\t\t\t\t\t       T(\"CREATIONTIME\")),\n\t\t\t     timebuf, ARRAY_LEN(timebuf));\n\ttprintf(T(\"Creation Time:          %\"TS\"\\n\"), timebuf);\n\n\twim_timestamp_to_str(xml_get_timestamp_by_path(image_node,\n\t\t\t\t\tT(\"LASTMODIFICATIONTIME\")),\n\t\t\t\t\ttimebuf, ARRAY_LEN(timebuf));\n\ttprintf(T(\"Last Modification Time: %\"TS\"\\n\"), timebuf);\n\n\tprint_windows_info(image_node);\n\n\ttext = xml_get_text_by_path(image_node, T(\"FLAGS\"));\n\tif (text)\n\t\ttprintf(T(\"Flags:                  %\"TS\"\\n\"), text);\n\n\ttprintf(T(\"WIMBoot compatible:     %\"TS\"\\n\"),\n\t\txml_get_number_by_path(image_node, T(\"WIMBOOT\")) ?\n\t\t\tT(\"yes\") : T(\"no\"));\n\n\ttputchar('\\n');\n}\n\n/*----------------------------------------------------------------------------*\n *                      Reading and writing the XML data                      *\n *----------------------------------------------------------------------------*/\n\nstatic int\nimage_element_get_index(struct xml_node *element)\n{\n\tstruct xml_node *attrib = xml_get_attrib(element, T(\"INDEX\"));\n\n\tif (!attrib)\n\t\treturn 0;\n\treturn min(INT_MAX, parse_number(attrib->value, 10));\n}\n\n/* Prepare the 'images' array from the XML document tree.  */\nstatic int\nsetup_images(struct wim_xml_info *info, struct xml_node *root)\n{\n\tstruct xml_node *child;\n\tint index;\n\tint max_index = 0;\n\tint ret;\n\n\txml_node_for_each_child(root, child) {\n\t\tif (!xml_node_is_element(child, T(\"IMAGE\")))\n\t\t\tcontinue;\n\t\tindex = image_element_get_index(child);\n\t\tif (unlikely(index < 1 || info->image_count >= MAX_IMAGES))\n\t\t\tgoto err_indices;\n\t\tmax_index = max(max_index, index);\n\t\tinfo->image_count++;\n\t}\n\tif (unlikely(max_index != info->image_count))\n\t\tgoto err_indices;\n\tret = WIMLIB_ERR_NOMEM;\n\tinfo->images = CALLOC(info->image_count, sizeof(info->images[0]));\n\tif (unlikely(!info->images))\n\t\tgoto err;\n\txml_node_for_each_child(root, child) {\n\t\tif (!xml_node_is_element(child, T(\"IMAGE\")))\n\t\t\tcontinue;\n\t\tindex = image_element_get_index(child);\n\t\tif (unlikely(info->images[index - 1]))\n\t\t\tgoto err_indices;\n\t\tinfo->images[index - 1] = child;\n\t}\n\treturn 0;\n\nerr_indices:\n\tERROR(\"The WIM file's XML document does not contain exactly one IMAGE \"\n\t      \"element per image!\");\n\tret = WIMLIB_ERR_XML;\nerr:\n\tFREE(info->images);\n\treturn ret;\n}\n\nstatic int\nparse_wim_xml_document(const utf16lechar *raw_doc, size_t raw_doc_size,\n\t\t       struct xml_node **root_ret)\n{\n\ttchar *doc;\n\tint ret;\n\n\tret = utf16le_to_tstr(raw_doc, raw_doc_size, &doc, NULL);\n\tif (ret)\n\t\treturn ret;\n\tret = xml_parse_document(doc, root_ret);\n\tFREE(doc);\n\treturn ret;\n}\n\n/* Reads the XML data from a WIM file.  */\nint\nread_wim_xml_data(WIMStruct *wim)\n{\n\tstruct wim_xml_info *info;\n\tvoid *raw_doc;\n\tsize_t raw_doc_size;\n\tstruct xml_node *root;\n\tint ret;\n\n\t/* Allocate the 'struct wim_xml_info'.  */\n\tret = WIMLIB_ERR_NOMEM;\n\tinfo = CALLOC(1, sizeof(*info));\n\tif (!info)\n\t\tgoto err;\n\n\t/* Read the raw UTF-16LE XML document.  */\n\tret = wimlib_get_xml_data(wim, &raw_doc, &raw_doc_size);\n\tif (ret)\n\t\tgoto err;\n\n\t/* Parse the document, creating the document tree.  */\n\tret = parse_wim_xml_document(raw_doc, raw_doc_size, &info->root);\n\tFREE(raw_doc);\n\traw_doc = NULL;\n\tif (ret) {\n\t\tif (ret != WIMLIB_ERR_NOMEM)\n\t\t\tret = WIMLIB_ERR_XML;\n\t\tERROR(\"Unable to parse the WIM file's XML document!\");\n\t\tgoto err;\n\t}\n\troot = info->root;\n\n\t/* Verify the root element.  */\n\tif (!xml_node_is_element(root, T(\"WIM\"))) {\n\t\tERROR(\"The WIM file's XML document has an unexpected format!\");\n\t\tret = WIMLIB_ERR_XML;\n\t\tgoto err;\n\t}\n\n\t/* Verify the WIM file is not encrypted.  */\n\tif (xml_get_element_by_path(root, T(\"ESD/ENCRYPTED\"))) {\n\t\tret = WIMLIB_ERR_WIM_IS_ENCRYPTED;\n\t\tgoto err;\n\t}\n\n\t/* Validate the image elements and set up the images[] array.  */\n\tret = setup_images(info, root);\n\tif (ret)\n\t\tgoto err;\n\n\t/* Success!  */\n\twim->xml_info = info;\n\treturn 0;\n\nerr:\n\txml_free_info_struct(info);\n\treturn ret;\n}\n\n/* Swap the INDEX attributes of two IMAGE elements.  */\nstatic void\nswap_index_attributes(struct xml_node *image_element_1,\n\t\t      struct xml_node *image_element_2)\n{\n\tstruct xml_node *attr_1, *attr_2;\n\n\tif (image_element_1 != image_element_2) {\n\t\tattr_1 = unlink_index_attribute(image_element_1);\n\t\tattr_2 = unlink_index_attribute(image_element_2);\n\t\txml_add_child(image_element_1, attr_2);\n\t\txml_add_child(image_element_2, attr_1);\n\t}\n}\n\nstatic int\nprepare_document_for_write(struct wim_xml_info *info, int image, u64 total_bytes,\n\t\t\t   struct xml_node **orig_totalbytes_element_ret)\n{\n\tstruct xml_node *totalbytes_element = NULL;\n\n\t/* Allocate the new TOTALBYTES element if needed.  */\n\tif (total_bytes != WIM_TOTALBYTES_USE_EXISTING &&\n\t    total_bytes != WIM_TOTALBYTES_OMIT) {\n\t\ttotalbytes_element = xml_new_element_with_u64(\n\t\t\t\t\tNULL, T(\"TOTALBYTES\"), total_bytes);\n\t\tif (!totalbytes_element)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\t/* Adjust the IMAGE elements if needed.  */\n\tif (image != WIMLIB_ALL_IMAGES) {\n\t\t/* We're writing a single image only.  Temporarily unlink all\n\t\t * other IMAGE elements from the document.  */\n\t\tfor (int i = 0; i < info->image_count; i++)\n\t\t\tif (i + 1 != image)\n\t\t\t\txml_unlink_node(info->images[i]);\n\n\t\t/* Temporarily set the INDEX attribute of the needed IMAGE\n\t\t * element to 1.  */\n\t\tswap_index_attributes(info->images[0], info->images[image - 1]);\n\t}\n\n\t/* Adjust (add, change, or remove) the TOTALBYTES element if needed.  */\n\t*orig_totalbytes_element_ret = NULL;\n\tif (total_bytes != WIM_TOTALBYTES_USE_EXISTING) {\n\t\t/* Unlink the previous TOTALBYTES element, if any.  */\n\t\t*orig_totalbytes_element_ret = xml_get_element_by_path(\n\t\t\t\t\t\tinfo->root, T(\"TOTALBYTES\"));\n\t\tif (*orig_totalbytes_element_ret)\n\t\t\txml_unlink_node(*orig_totalbytes_element_ret);\n\n\t\t/* Link in the new TOTALBYTES element, if any.  */\n\t\tif (totalbytes_element)\n\t\t\txml_add_child(info->root, totalbytes_element);\n\t}\n\treturn 0;\n}\n\nstatic void\nrestore_document_after_write(struct wim_xml_info *info, int image,\n\t\t\t     struct xml_node *orig_totalbytes_element)\n{\n\t/* Restore the IMAGE elements if needed.  */\n\tif (image != WIMLIB_ALL_IMAGES) {\n\t\t/* We wrote a single image only.  Re-link all other IMAGE\n\t\t * elements to the document.  */\n\t\tfor (int i = 0; i < info->image_count; i++)\n\t\t\tif (i + 1 != image)\n\t\t\t\txml_add_child(info->root, info->images[i]);\n\n\t\t/* Restore the original INDEX attributes.  */\n\t\tswap_index_attributes(info->images[0], info->images[image - 1]);\n\t}\n\n\t/* Restore the original TOTALBYTES element if needed.  */\n\tif (orig_totalbytes_element)\n\t\txml_replace_child(info->root, orig_totalbytes_element);\n}\n\n/*\n * Writes the XML data to a WIM file.\n *\n * 'image' specifies the image(s) to include in the XML data.  Normally it is\n * WIMLIB_ALL_IMAGES, but it can also be a 1-based image index.\n *\n * 'total_bytes' is the number to use in the top-level TOTALBYTES element, or\n * WIM_TOTALBYTES_USE_EXISTING to use the existing value from the XML document\n * (if any), or WIM_TOTALBYTES_OMIT to omit the TOTALBYTES element entirely.\n */\nint\nwrite_wim_xml_data(WIMStruct *wim, int image, u64 total_bytes,\n\t\t   struct wim_reshdr *out_reshdr, int write_resource_flags)\n{\n\tstruct wim_xml_info *info = wim->xml_info;\n\tint ret;\n\tstruct xml_node *orig_totalbytes_element;\n\tstruct xml_out_buf buf = { 0 };\n\tconst utf16lechar *raw_doc;\n\tsize_t raw_doc_size;\n\n\t/* Make any needed temporary changes to the document.  */\n\tret = prepare_document_for_write(info, image, total_bytes,\n\t\t\t\t\t &orig_totalbytes_element);\n\tif (ret)\n\t\tgoto out;\n\n\tret = xml_write_document(info->root, &buf);\n\tif (ret)\n\t\tgoto out_restore_document;\n\n\tret = tstr_get_utf16le_and_len(buf.buf, &raw_doc, &raw_doc_size);\n\tif (ret)\n\t\tgoto out_restore_document;\n\n\t/* Write the XML data uncompressed.  Although wimlib can handle\n\t * compressed XML data, some other WIM software cannot.  */\n\tret = write_wim_resource_from_buffer(raw_doc, raw_doc_size,\n\t\t\t\t\t     true,\n\t\t\t\t\t     &wim->out_fd,\n\t\t\t\t\t     WIMLIB_COMPRESSION_TYPE_NONE,\n\t\t\t\t\t     0,\n\t\t\t\t\t     out_reshdr,\n\t\t\t\t\t     NULL,\n\t\t\t\t\t     write_resource_flags);\n\ttstr_put_utf16le(raw_doc);\nout_restore_document:\n\t/* Revert any temporary changes we made to the document.  */\n\trestore_document_after_write(info, image, orig_totalbytes_element);\n\tFREE(buf.buf);\nout:\n\treturn ret;\n}\n\n/*----------------------------------------------------------------------------*\n *                           Library API functions                            *\n *----------------------------------------------------------------------------*/\n\nWIMLIBAPI int\nwimlib_get_xml_data(WIMStruct *wim, void **buf_ret, size_t *bufsize_ret)\n{\n\tconst struct wim_reshdr *xml_reshdr;\n\n\tif (wim->filename == NULL && filedes_is_seekable(&wim->in_fd))\n\t\treturn WIMLIB_ERR_NO_FILENAME;\n\n\tif (buf_ret == NULL || bufsize_ret == NULL)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\txml_reshdr = &wim->hdr.xml_data_reshdr;\n\n\t*bufsize_ret = xml_reshdr->uncompressed_size;\n\treturn wim_reshdr_to_data(xml_reshdr, wim, buf_ret);\n}\n\nWIMLIBAPI int\nwimlib_extract_xml_data(WIMStruct *wim, FILE *fp)\n{\n\tint ret;\n\tvoid *buf;\n\tsize_t bufsize;\n\n\tret = wimlib_get_xml_data(wim, &buf, &bufsize);\n\tif (ret)\n\t\treturn ret;\n\n\tif (fwrite(buf, 1, bufsize, fp) != bufsize) {\n\t\tERROR_WITH_ERRNO(\"Failed to extract XML data\");\n\t\tret = WIMLIB_ERR_WRITE;\n\t}\n\tFREE(buf);\n\treturn ret;\n}\n\nstatic bool\nimage_name_in_use(const WIMStruct *wim, const tchar *name, int excluded_image)\n{\n\tconst struct wim_xml_info *info = wim->xml_info;\n\tconst tchar *existing_name;\n\n\t/* Any number of images can have \"no name\".  */\n\tif (!name || !*name)\n\t\treturn false;\n\n\t/* Check for images that have the specified name.  */\n\tfor (int i = 0; i < info->image_count; i++) {\n\t\tif (i + 1 == excluded_image)\n\t\t\tcontinue;\n\t\texisting_name = xml_get_text_by_path(info->images[i],\n\t\t\t\t\t\t     T(\"NAME\"));\n\t\tif (existing_name && !tstrcmp(existing_name, name))\n\t\t\treturn true;\n\t}\n\treturn false;\n}\n\nWIMLIBAPI bool\nwimlib_image_name_in_use(const WIMStruct *wim, const tchar *name)\n{\n\treturn image_name_in_use(wim, name, WIMLIB_NO_IMAGE);\n}\n\nWIMLIBAPI const tchar *\nwimlib_get_image_name(const WIMStruct *wim, int image)\n{\n\tconst struct wim_xml_info *info = wim->xml_info;\n\tconst tchar *name;\n\n\tif (image < 1 || image > info->image_count)\n\t\treturn NULL;\n\tname = wimlib_get_image_property(wim, image, T(\"NAME\"));\n\treturn name ? name : T(\"\");\n}\n\nWIMLIBAPI const tchar *\nwimlib_get_image_description(const WIMStruct *wim, int image)\n{\n\treturn wimlib_get_image_property(wim, image, T(\"DESCRIPTION\"));\n}\n\nWIMLIBAPI const tchar *\nwimlib_get_image_property(const WIMStruct *wim, int image,\n\t\t\t  const tchar *property_name)\n{\n\tconst struct wim_xml_info *info = wim->xml_info;\n\n\tif (!property_name || !*property_name)\n\t\treturn NULL;\n\tif (image < 1 || image > info->image_count)\n\t\treturn NULL;\n\treturn xml_get_text_by_path(info->images[image - 1], property_name);\n}\n\nWIMLIBAPI int\nwimlib_set_image_name(WIMStruct *wim, int image, const tchar *name)\n{\n\treturn wimlib_set_image_property(wim, image, T(\"NAME\"), name);\n}\n\nWIMLIBAPI int\nwimlib_set_image_descripton(WIMStruct *wim, int image, const tchar *description)\n{\n\treturn wimlib_set_image_property(wim, image, T(\"DESCRIPTION\"),\n\t\t\t\t\t description);\n}\n\nWIMLIBAPI int\nwimlib_set_image_flags(WIMStruct *wim, int image, const tchar *flags)\n{\n\treturn wimlib_set_image_property(wim, image, T(\"FLAGS\"), flags);\n}\n\nWIMLIBAPI int\nwimlib_set_image_property(WIMStruct *wim, int image, const tchar *property_name,\n\t\t\t  const tchar *property_value)\n{\n\tstruct wim_xml_info *info = wim->xml_info;\n\n\tif (!property_name || !*property_name)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tif (!xml_legal_path(property_name)) {\n\t\tERROR(\"Property name '%\"TS\"' is illegal in XML\", property_name);\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t}\n\n\tif (property_value && !xml_legal_value(property_value)) {\n\t\tWARNING(\"Value of property '%\"TS\"' contains illegal characters\",\n\t\t\tproperty_name);\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\t}\n\n\tif (image < 1 || image > info->image_count)\n\t\treturn WIMLIB_ERR_INVALID_IMAGE;\n\n\tif (!tstrcmp(property_name, T(\"NAME\")) &&\n\t    image_name_in_use(wim, property_value, image))\n\t\treturn WIMLIB_ERR_IMAGE_NAME_COLLISION;\n\n\treturn xml_set_text_by_path(info->images[image - 1], property_name,\n\t\t\t\t    property_value);\n}\n"
  },
  {
    "path": "src/wimlib/xml_windows.c",
    "content": "/*\n * xml_windows.c\n *\n * Set Windows-specific metadata in a WIM file's XML document based on the image\n * contents.\n */\n\n/*\n * Copyright 2016-2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <stdlib.h>\n\n#include \"wimlib.h\"\n#include \"wimlib/blob_table.h\"\n#include \"wimlib/dentry.h\"\n#include \"wimlib/encoding.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/metadata.h\"\n#include \"wimlib/registry.h\"\n#include \"wimlib/wim.h\"\n#include \"wimlib/xml_windows.h\"\n\n/* Context for a call to set_windows_specific_info()  */\nstruct windows_info_ctx {\n\tWIMStruct *wim;\n\tint image;\n\tbool oom_encountered;\n\tbool debug_enabled;\n};\n\n/* For debugging purposes, the environmental variable WIMLIB_DEBUG_XML_INFO can\n * be set to enable messages about certain things not being as expected in the\n * registry or other files used as information sources.  */\n\n#define XML_WARN(format, ...)\t\t\t\\\n\tif (ctx->debug_enabled)\t\t\t\\\n\t\tWARNING(format, ##__VA_ARGS__)\n\n/* Set a property in the XML document, with error checking.  */\nstatic void\nset_string_property(struct windows_info_ctx *ctx,\n\t\t    const tchar *name, const tchar *value)\n{\n\tint ret = wimlib_set_image_property(ctx->wim, ctx->image, name, value);\n\tif (likely(!ret))\n\t\treturn;\n\n\tctx->oom_encountered |= (ret == WIMLIB_ERR_NOMEM);\n\tWARNING(\"Failed to set image property \\\"%\"TS\"\\\" to value \"\n\t\t\"\\\"%\"TS\"\\\": %\"TS, name, value, wimlib_get_error_string(ret));\n}\n\n/* Set a property in the XML document, with error checking.  */\nstatic void\nset_number_property(struct windows_info_ctx *ctx, const tchar *name, s64 value)\n{\n\ttchar buffer[32];\n\ttsprintf(buffer, T(\"%\"PRIi64\"\"), value);\n\tset_string_property(ctx, name, buffer);\n}\n\n/* Check the result of a registry hive operation.  If unsuccessful, possibly\n * print debugging information.  Return true iff successful.  */\nstatic bool\ncheck_hive_status(struct windows_info_ctx *ctx, enum hive_status status,\n\t\t  const tchar *key, const tchar *value)\n{\n\tif (likely(status == HIVE_OK))\n\t\treturn true;\n\n\tctx->oom_encountered |= (status == HIVE_OUT_OF_MEMORY);\n\tXML_WARN(\"%s; key=%\"TS\" value=%\"TS, hive_status_to_string(status),\n\t\t (key ? key : T(\"(null)\")), (value ? value : T(\"(null)\")));\n\treturn false;\n}\n\nstatic bool\nis_registry_valid(struct windows_info_ctx *ctx, const void *hive_mem,\n\t\t  size_t hive_size)\n{\n\tenum hive_status status;\n\n\tstatus = hive_validate(hive_mem, hive_size);\n\treturn check_hive_status(ctx, status, NULL, NULL);\n}\n\nstatic bool\nget_string_from_registry(struct windows_info_ctx *ctx, const struct regf *regf,\n\t\t\t const tchar *key_name, const tchar *value_name,\n\t\t\t tchar **value_ret)\n{\n\tenum hive_status status;\n\n\tstatus = hive_get_string(regf, key_name, value_name, value_ret);\n\treturn check_hive_status(ctx, status, key_name, value_name);\n}\n\nstatic bool\nget_number_from_registry(struct windows_info_ctx *ctx, const struct regf *regf,\n\t\t\t const tchar *key_name, const tchar *value_name,\n\t\t\t s64 *value_ret)\n{\n\tenum hive_status status;\n\n\tstatus = hive_get_number(regf, key_name, value_name, value_ret);\n\treturn check_hive_status(ctx, status, key_name, value_name);\n}\n\nstatic bool\nlist_subkeys_in_registry(struct windows_info_ctx *ctx, const struct regf *regf,\n\t\t\t const tchar *key_name, tchar ***subkeys_ret)\n{\n\tenum hive_status status;\n\n\tstatus = hive_list_subkeys(regf, key_name, subkeys_ret);\n\treturn check_hive_status(ctx, status, key_name, NULL);\n}\n\n/* Copy a string value from a registry hive to the XML document.  */\nstatic void\ncopy_registry_string(struct windows_info_ctx *ctx, const struct regf *regf,\n\t\t     const tchar *key_name, const tchar *value_name,\n\t\t     const tchar *property_name)\n{\n\ttchar *string;\n\n\tif (get_string_from_registry(ctx, regf, key_name, value_name, &string)) {\n\t\tset_string_property(ctx, property_name, string);\n\t\tFREE(string);\n\t}\n}\n\n/* A table that map Windows language IDs, sorted numerically, to their language\n * names.  It was generated by tools/generate_language_id_map.c.  */\nstatic const struct {\n\tu16 id;\n\tu16 name_start_offset;\n} language_id_map[453] = {\n\t{0x0000,    0}, {0x0001,    6}, {0x0002,   12}, {0x0003,   18},\n\t{0x0004,   24}, {0x0005,   30}, {0x0006,   36}, {0x0007,   42},\n\t{0x0008,   48}, {0x0009,   54}, {0x000a,   60}, {0x000b,   66},\n\t{0x000c,   72}, {0x000d,   78}, {0x000e,   84}, {0x000f,   90},\n\t{0x0010,   96}, {0x0011,  102}, {0x0012,  108}, {0x0013,  114},\n\t{0x0014,  120}, {0x0015,  126}, {0x0016,  132}, {0x0017,  138},\n\t{0x0018,  144}, {0x0019,  150}, {0x001a,  156}, {0x001b,  162},\n\t{0x001c,  168}, {0x001d,  174}, {0x001e,  180}, {0x001f,  186},\n\t{0x0020,  192}, {0x0021,  198}, {0x0022,  204}, {0x0023,  210},\n\t{0x0024,  216}, {0x0025,  222}, {0x0026,  228}, {0x0027,  234},\n\t{0x0028,  240}, {0x0029,  251}, {0x002a,  257}, {0x002b,  263},\n\t{0x002c,  269}, {0x002d,  280}, {0x002e,  286}, {0x002f,  293},\n\t{0x0030,  299}, {0x0031,  305}, {0x0032,  311}, {0x0033,  317},\n\t{0x0034,  323}, {0x0035,  329}, {0x0036,  335}, {0x0037,  341},\n\t{0x0038,  347}, {0x0039,  353}, {0x003a,  359}, {0x003b,  365},\n\t{0x003c,  371}, {0x003d,  377}, {0x003e,  384}, {0x003f,  390},\n\t{0x0040,  396}, {0x0041,  402}, {0x0042,  408}, {0x0043,  414},\n\t{0x0044,  425}, {0x0045,  431}, {0x0046,  437}, {0x0047,  443},\n\t{0x0048,  449}, {0x0049,  455}, {0x004a,  461}, {0x004b,  467},\n\t{0x004c,  473}, {0x004d,  479}, {0x004e,  485}, {0x004f,  491},\n\t{0x0050,  497}, {0x0051,  503}, {0x0052,  509}, {0x0053,  515},\n\t{0x0054,  521}, {0x0055,  527}, {0x0056,  533}, {0x0057,  539},\n\t{0x0058,  546}, {0x0059,  553}, {0x005a,  564}, {0x005b,  571},\n\t{0x005c,  577}, {0x005d,  589}, {0x005e,  600}, {0x005f,  606},\n\t{0x0060,  618}, {0x0061,  629}, {0x0062,  635}, {0x0063,  641},\n\t{0x0064,  647}, {0x0065,  654}, {0x0066,  660}, {0x0067,  667},\n\t{0x0068,  678}, {0x0069,  689}, {0x006a,  696}, {0x006b,  702},\n\t{0x006c,  709}, {0x006d,  716}, {0x006e,  722}, {0x006f,  728},\n\t{0x0070,  734}, {0x0071,  740}, {0x0072,  751}, {0x0073,  757},\n\t{0x0074,  763}, {0x0075,  769}, {0x0076,  776}, {0x0077,  783},\n\t{0x0078,  789}, {0x0079,  795}, {0x007a,  803}, {0x007c,  810},\n\t{0x007e,  817}, {0x007f,  823}, {0x0080,  824}, {0x0081,  830},\n\t{0x0082,  836}, {0x0083,  842}, {0x0084,  848}, {0x0085,  855},\n\t{0x0086,  862}, {0x0087,  874}, {0x0088,  880}, {0x008c,  886},\n\t{0x0091,  893}, {0x0092,  899}, {0x0400,  910}, {0x0401,  916},\n\t{0x0402,  922}, {0x0403,  928}, {0x0404,  934}, {0x0405,  940},\n\t{0x0406,  946}, {0x0407,  952}, {0x0408,  958}, {0x0409,  964},\n\t{0x040a,  970}, {0x040b,  983}, {0x040c,  989}, {0x040d,  995},\n\t{0x040e, 1001}, {0x040f, 1007}, {0x0410, 1013}, {0x0411, 1019},\n\t{0x0412, 1025}, {0x0413, 1031}, {0x0414, 1037}, {0x0415, 1043},\n\t{0x0416, 1049}, {0x0417, 1055}, {0x0418, 1061}, {0x0419, 1067},\n\t{0x041a, 1073}, {0x041b, 1079}, {0x041c, 1085}, {0x041d, 1091},\n\t{0x041e, 1097}, {0x041f, 1103}, {0x0420, 1109}, {0x0421, 1115},\n\t{0x0422, 1121}, {0x0423, 1127}, {0x0424, 1133}, {0x0425, 1139},\n\t{0x0426, 1145}, {0x0427, 1151}, {0x0428, 1157}, {0x0429, 1168},\n\t{0x042a, 1174}, {0x042b, 1180}, {0x042c, 1186}, {0x042d, 1197},\n\t{0x042e, 1203}, {0x042f, 1210}, {0x0430, 1216}, {0x0431, 1222},\n\t{0x0432, 1228}, {0x0433, 1234}, {0x0434, 1240}, {0x0435, 1246},\n\t{0x0436, 1252}, {0x0437, 1258}, {0x0438, 1264}, {0x0439, 1270},\n\t{0x043a, 1276}, {0x043b, 1282}, {0x043d, 1288}, {0x043e, 1295},\n\t{0x043f, 1301}, {0x0440, 1307}, {0x0441, 1313}, {0x0442, 1319},\n\t{0x0443, 1325}, {0x0444, 1336}, {0x0445, 1342}, {0x0446, 1348},\n\t{0x0447, 1354}, {0x0448, 1360}, {0x0449, 1366}, {0x044a, 1372},\n\t{0x044b, 1378}, {0x044c, 1384}, {0x044d, 1390}, {0x044e, 1396},\n\t{0x044f, 1402}, {0x0450, 1408}, {0x0451, 1414}, {0x0452, 1420},\n\t{0x0453, 1426}, {0x0454, 1432}, {0x0455, 1438}, {0x0456, 1444},\n\t{0x0457, 1450}, {0x0458, 1457}, {0x0459, 1464}, {0x045a, 1475},\n\t{0x045b, 1482}, {0x045c, 1488}, {0x045d, 1500}, {0x045e, 1511},\n\t{0x045f, 1517}, {0x0460, 1529}, {0x0461, 1540}, {0x0462, 1546},\n\t{0x0463, 1552}, {0x0464, 1558}, {0x0465, 1565}, {0x0466, 1571},\n\t{0x0467, 1578}, {0x0468, 1589}, {0x0469, 1600}, {0x046a, 1607},\n\t{0x046b, 1613}, {0x046c, 1620}, {0x046d, 1627}, {0x046e, 1633},\n\t{0x046f, 1639}, {0x0470, 1645}, {0x0471, 1651}, {0x0472, 1662},\n\t{0x0473, 1668}, {0x0474, 1674}, {0x0475, 1680}, {0x0476, 1687},\n\t{0x0477, 1694}, {0x0478, 1700}, {0x0479, 1706}, {0x047a, 1714},\n\t{0x047c, 1721}, {0x047e, 1728}, {0x0480, 1734}, {0x0481, 1740},\n\t{0x0482, 1746}, {0x0483, 1752}, {0x0484, 1758}, {0x0485, 1765},\n\t{0x0486, 1772}, {0x0487, 1784}, {0x0488, 1790}, {0x048c, 1796},\n\t{0x0491, 1803}, {0x0492, 1809}, {0x0501, 1820}, {0x05fe, 1829},\n\t{0x0800, 1839}, {0x0801, 1845}, {0x0803, 1851}, {0x0804, 1866},\n\t{0x0807, 1872}, {0x0809, 1878}, {0x080a, 1884}, {0x080c, 1890},\n\t{0x0810, 1896}, {0x0813, 1902}, {0x0814, 1908}, {0x0816, 1914},\n\t{0x0818, 1920}, {0x0819, 1926}, {0x081a, 1932}, {0x081d, 1943},\n\t{0x0820, 1949}, {0x082c, 1955}, {0x082e, 1966}, {0x0832, 1973},\n\t{0x083b, 1979}, {0x083c, 1985}, {0x083e, 1991}, {0x0843, 1997},\n\t{0x0845, 2008}, {0x0846, 2014}, {0x0849, 2025}, {0x0850, 2031},\n\t{0x0859, 2042}, {0x085d, 2053}, {0x085f, 2064}, {0x0860, 2076},\n\t{0x0861, 2087}, {0x0867, 2093}, {0x086b, 2104}, {0x0873, 2111},\n\t{0x0901, 2117}, {0x09ff, 2131}, {0x0c00, 2141}, {0x0c01, 2147},\n\t{0x0c04, 2153}, {0x0c07, 2159}, {0x0c09, 2165}, {0x0c0a, 2171},\n\t{0x0c0c, 2177}, {0x0c1a, 2183}, {0x0c3b, 2194}, {0x0c50, 2200},\n\t{0x0c51, 2211}, {0x0c6b, 2217}, {0x1000, 2224}, {0x1001, 2235},\n\t{0x1004, 2241}, {0x1007, 2247}, {0x1009, 2253}, {0x100a, 2259},\n\t{0x100c, 2265}, {0x101a, 2271}, {0x103b, 2277}, {0x105f, 2284},\n\t{0x1401, 2296}, {0x1404, 2302}, {0x1407, 2308}, {0x1409, 2314},\n\t{0x140a, 2320}, {0x140c, 2326}, {0x141a, 2332}, {0x143b, 2343},\n\t{0x1801, 2350}, {0x1809, 2356}, {0x180a, 2362}, {0x180c, 2368},\n\t{0x181a, 2374}, {0x183b, 2385}, {0x1c01, 2392}, {0x1c09, 2398},\n\t{0x1c0a, 2404}, {0x1c0c, 2410}, {0x1c1a, 2417}, {0x1c3b, 2428},\n\t{0x2000, 2435}, {0x2001, 2441}, {0x2009, 2447}, {0x200a, 2453},\n\t{0x200c, 2459}, {0x201a, 2465}, {0x203b, 2476}, {0x2400, 2483},\n\t{0x2401, 2489}, {0x2409, 2495}, {0x240a, 2502}, {0x240c, 2508},\n\t{0x241a, 2514}, {0x243b, 2525}, {0x2800, 2532}, {0x2801, 2538},\n\t{0x2809, 2544}, {0x280a, 2550}, {0x280c, 2556}, {0x281a, 2562},\n\t{0x2c00, 2573}, {0x2c01, 2579}, {0x2c09, 2585}, {0x2c0a, 2591},\n\t{0x2c0c, 2597}, {0x2c1a, 2603}, {0x3000, 2614}, {0x3001, 2620},\n\t{0x3009, 2626}, {0x300a, 2632}, {0x300c, 2638}, {0x301a, 2644},\n\t{0x3400, 2655}, {0x3401, 2661}, {0x3409, 2667}, {0x340a, 2673},\n\t{0x340c, 2679}, {0x3800, 2685}, {0x3801, 2691}, {0x3809, 2697},\n\t{0x380a, 2703}, {0x380c, 2709}, {0x3c00, 2715}, {0x3c01, 2721},\n\t{0x3c09, 2727}, {0x3c0a, 2733}, {0x3c0c, 2739}, {0x4000, 2745},\n\t{0x4001, 2751}, {0x4009, 2757}, {0x400a, 2763}, {0x4400, 2769},\n\t{0x4409, 2775}, {0x440a, 2781}, {0x4800, 2787}, {0x4809, 2793},\n\t{0x480a, 2799}, {0x4c00, 2805}, {0x4c09, 2811}, {0x4c0a, 2817},\n\t{0x500a, 2823}, {0x540a, 2829}, {0x580a, 2835}, {0x5c0a, 2842},\n\t{0x641a, 2848}, {0x681a, 2859}, {0x6c1a, 2870}, {0x701a, 2881},\n\t{0x703b, 2892}, {0x742c, 2899}, {0x743b, 2910}, {0x7804, 2917},\n\t{0x7814, 2923}, {0x781a, 2929}, {0x782c, 2940}, {0x783b, 2951},\n\t{0x7843, 2958}, {0x7850, 2969}, {0x785d, 2975}, {0x785f, 2986},\n\t{0x7c04, 2998}, {0x7c14, 3004}, {0x7c1a, 3010}, {0x7c28, 3021},\n\t{0x7c2e, 3032}, {0x7c3b, 3039}, {0x7c43, 3046}, {0x7c46, 3057},\n\t{0x7c50, 3068}, {0x7c59, 3079}, {0x7c5c, 3090}, {0x7c5d, 3102},\n\t{0x7c5f, 3113}, {0x7c67, 3125}, {0x7c68, 3136}, {0x7c86, 3147},\n\t{0x7c92, 3159},\n};\n\n/* All the language names; generated by tools/generate_language_id_map.c.\n * For compactness, this is a 'char' string rather than a 'tchar' string.  */\nstatic const char language_names[3170] =\n\t\"en-US\\0ar-SA\\0bg-BG\\0ca-ES\\0zh-CN\\0cs-CZ\\0da-DK\\0de-DE\\0el-GR\\0en-US\\0\"\n\t\"es-ES\\0fi-FI\\0fr-FR\\0he-IL\\0hu-HU\\0is-IS\\0it-IT\\0ja-JP\\0ko-KR\\0nl-NL\\0\"\n\t\"nb-NO\\0pl-PL\\0pt-BR\\0rm-CH\\0ro-RO\\0ru-RU\\0hr-HR\\0sk-SK\\0sq-AL\\0sv-SE\\0\"\n\t\"th-TH\\0tr-TR\\0ur-PK\\0id-ID\\0uk-UA\\0be-BY\\0sl-SI\\0et-EE\\0lv-LV\\0lt-LT\\0\"\n\t\"tg-Cyrl-TJ\\0fa-IR\\0vi-VN\\0hy-AM\\0az-Latn-AZ\\0eu-ES\\0hsb-DE\\0mk-MK\\0\"\n\t\"st-ZA\\0ts-ZA\\0tn-ZA\\0ve-ZA\\0xh-ZA\\0zu-ZA\\0af-ZA\\0ka-GE\\0fo-FO\\0hi-IN\\0\"\n\t\"mt-MT\\0se-NO\\0ga-IE\\0yi-001\\0ms-MY\\0kk-KZ\\0ky-KG\\0sw-KE\\0tk-TM\\0\"\n\t\"uz-Latn-UZ\\0tt-RU\\0bn-BD\\0pa-IN\\0gu-IN\\0or-IN\\0ta-IN\\0te-IN\\0kn-IN\\0\"\n\t\"ml-IN\\0as-IN\\0mr-IN\\0sa-IN\\0mn-MN\\0bo-CN\\0cy-GB\\0km-KH\\0lo-LA\\0my-MM\\0\"\n\t\"gl-ES\\0kok-IN\\0mni-IN\\0sd-Arab-PK\\0syr-SY\\0si-LK\\0chr-Cher-US\\0\"\n\t\"iu-Latn-CA\\0am-ET\\0tzm-Latn-DZ\\0ks-Arab-IN\\0ne-NP\\0fy-NL\\0ps-AF\\0\"\n\t\"fil-PH\\0dv-MV\\0bin-NG\\0ff-Latn-SN\\0ha-Latn-NG\\0ibb-NG\\0yo-NG\\0quz-BO\\0\"\n\t\"nso-ZA\\0ba-RU\\0lb-LU\\0kl-GL\\0ig-NG\\0kr-Latn-NG\\0om-ET\\0ti-ER\\0gn-PY\\0\"\n\t\"haw-US\\0la-001\\0so-SO\\0ii-CN\\0pap-029\\0arn-CL\\0moh-CA\\0br-FR\\0\\0\"\n\t\"ug-CN\\0mi-NZ\\0oc-FR\\0co-FR\\0gsw-CH\\0sah-RU\\0quc-Latn-GT\\0rw-RW\\0\"\n\t\"wo-SN\\0prs-AF\\0gd-GB\\0ku-Arab-IQ\\0en-US\\0ar-SA\\0bg-BG\\0ca-ES\\0zh-TW\\0\"\n\t\"cs-CZ\\0da-DK\\0de-DE\\0el-GR\\0en-US\\0es-ES_tradnl\\0fi-FI\\0fr-FR\\0he-IL\\0\"\n\t\"hu-HU\\0is-IS\\0it-IT\\0ja-JP\\0ko-KR\\0nl-NL\\0nb-NO\\0pl-PL\\0pt-BR\\0rm-CH\\0\"\n\t\"ro-RO\\0ru-RU\\0hr-HR\\0sk-SK\\0sq-AL\\0sv-SE\\0th-TH\\0tr-TR\\0ur-PK\\0id-ID\\0\"\n\t\"uk-UA\\0be-BY\\0sl-SI\\0et-EE\\0lv-LV\\0lt-LT\\0tg-Cyrl-TJ\\0fa-IR\\0vi-VN\\0\"\n\t\"hy-AM\\0az-Latn-AZ\\0eu-ES\\0hsb-DE\\0mk-MK\\0st-ZA\\0ts-ZA\\0tn-ZA\\0ve-ZA\\0\"\n\t\"xh-ZA\\0zu-ZA\\0af-ZA\\0ka-GE\\0fo-FO\\0hi-IN\\0mt-MT\\0se-NO\\0yi-001\\0\"\n\t\"ms-MY\\0kk-KZ\\0ky-KG\\0sw-KE\\0tk-TM\\0uz-Latn-UZ\\0tt-RU\\0bn-IN\\0pa-IN\\0\"\n\t\"gu-IN\\0or-IN\\0ta-IN\\0te-IN\\0kn-IN\\0ml-IN\\0as-IN\\0mr-IN\\0sa-IN\\0mn-MN\\0\"\n\t\"bo-CN\\0cy-GB\\0km-KH\\0lo-LA\\0my-MM\\0gl-ES\\0kok-IN\\0mni-IN\\0sd-Deva-IN\\0\"\n\t\"syr-SY\\0si-LK\\0chr-Cher-US\\0iu-Cans-CA\\0am-ET\\0tzm-Arab-MA\\0\"\n\t\"ks-Arab-IN\\0ne-NP\\0fy-NL\\0ps-AF\\0fil-PH\\0dv-MV\\0bin-NG\\0ff-Latn-NG\\0\"\n\t\"ha-Latn-NG\\0ibb-NG\\0yo-NG\\0quz-BO\\0nso-ZA\\0ba-RU\\0lb-LU\\0kl-GL\\0\"\n\t\"ig-NG\\0kr-Latn-NG\\0om-ET\\0ti-ET\\0gn-PY\\0haw-US\\0la-001\\0so-SO\\0ii-CN\\0\"\n\t\"pap-029\\0arn-CL\\0moh-CA\\0br-FR\\0ug-CN\\0mi-NZ\\0oc-FR\\0co-FR\\0gsw-FR\\0\"\n\t\"sah-RU\\0quc-Latn-GT\\0rw-RW\\0wo-SN\\0prs-AF\\0gd-GB\\0ku-Arab-IQ\\0\"\n\t\"qps-ploc\\0qps-ploca\\0en-US\\0ar-IQ\\0ca-ES-valencia\\0zh-CN\\0de-CH\\0\"\n\t\"en-GB\\0es-MX\\0fr-BE\\0it-CH\\0nl-BE\\0nn-NO\\0pt-PT\\0ro-MD\\0ru-MD\\0\"\n\t\"sr-Latn-CS\\0sv-FI\\0ur-IN\\0az-Cyrl-AZ\\0dsb-DE\\0tn-BW\\0se-SE\\0ga-IE\\0\"\n\t\"ms-BN\\0uz-Cyrl-UZ\\0bn-BD\\0pa-Arab-PK\\0ta-LK\\0mn-Mong-CN\\0sd-Arab-PK\\0\"\n\t\"iu-Latn-CA\\0tzm-Latn-DZ\\0ks-Deva-IN\\0ne-IN\\0ff-Latn-SN\\0quz-EC\\0\"\n\t\"ti-ER\\0qps-Latn-x-sh\\0qps-plocm\\0en-US\\0ar-EG\\0zh-HK\\0de-AT\\0en-AU\\0\"\n\t\"es-ES\\0fr-CA\\0sr-Cyrl-CS\\0se-FI\\0mn-Mong-MN\\0dz-BT\\0quz-PE\\0\"\n\t\"ks-Arab-IN\\0ar-LY\\0zh-SG\\0de-LU\\0en-CA\\0es-GT\\0fr-CH\\0hr-BA\\0smj-NO\\0\"\n\t\"tzm-Tfng-MA\\0ar-DZ\\0zh-MO\\0de-LI\\0en-NZ\\0es-CR\\0fr-LU\\0bs-Latn-BA\\0\"\n\t\"smj-SE\\0ar-MA\\0en-IE\\0es-PA\\0fr-MC\\0sr-Latn-BA\\0sma-NO\\0ar-TN\\0en-ZA\\0\"\n\t\"es-DO\\0fr-029\\0sr-Cyrl-BA\\0sma-SE\\0en-US\\0ar-OM\\0en-JM\\0es-VE\\0fr-RE\\0\"\n\t\"bs-Cyrl-BA\\0sms-FI\\0en-US\\0ar-YE\\0en-029\\0es-CO\\0fr-CD\\0sr-Latn-RS\\0\"\n\t\"smn-FI\\0en-US\\0ar-SY\\0en-BZ\\0es-PE\\0fr-SN\\0sr-Cyrl-RS\\0en-US\\0ar-JO\\0\"\n\t\"en-TT\\0es-AR\\0fr-CM\\0sr-Latn-ME\\0en-US\\0ar-LB\\0en-ZW\\0es-EC\\0fr-CI\\0\"\n\t\"sr-Cyrl-ME\\0en-US\\0ar-KW\\0en-PH\\0es-CL\\0fr-ML\\0en-US\\0ar-AE\\0en-ID\\0\"\n\t\"es-UY\\0fr-MA\\0en-US\\0ar-BH\\0en-HK\\0es-PY\\0fr-HT\\0en-US\\0ar-QA\\0en-IN\\0\"\n\t\"es-BO\\0en-US\\0en-MY\\0es-SV\\0en-US\\0en-SG\\0es-HN\\0en-US\\0en-AE\\0es-NI\\0\"\n\t\"es-PR\\0es-US\\0es-419\\0es-CU\\0bs-Cyrl-BA\\0bs-Latn-BA\\0sr-Cyrl-RS\\0\"\n\t\"sr-Latn-RS\\0smn-FI\\0az-Cyrl-AZ\\0sms-FI\\0zh-CN\\0nn-NO\\0bs-Latn-BA\\0\"\n\t\"az-Latn-AZ\\0sma-SE\\0uz-Cyrl-UZ\\0mn-MN\\0iu-Cans-CA\\0tzm-Tfng-MA\\0\"\n\t\"zh-HK\\0nb-NO\\0sr-Latn-RS\\0tg-Cyrl-TJ\\0dsb-DE\\0smj-SE\\0uz-Latn-UZ\\0\"\n\t\"pa-Arab-PK\\0mn-Mong-CN\\0sd-Arab-PK\\0chr-Cher-US\\0iu-Latn-CA\\0\"\n\t\"tzm-Latn-DZ\\0ff-Latn-SN\\0ha-Latn-NG\\0quc-Latn-GT\\0ku-Arab-IQ\\0\";\n\n/* Translate a Windows language ID to its name.  Returns NULL if the ID is not\n * recognized.  */\nstatic const char *\nlanguage_id_to_name(u16 id)\n{\n\tint l = 0;\n\tint r = ARRAY_LEN(language_id_map) - 1;\n\tdo {\n\t\tint m = (l + r) / 2;\n\t\tif (id < language_id_map[m].id)\n\t\t\tr = m - 1;\n\t\telse if (id > language_id_map[m].id)\n\t\t\tl = m + 1;\n\t\telse\n\t\t\treturn &language_names[language_id_map[m].name_start_offset];\n\t} while (l <= r);\n\treturn NULL;\n}\n\n#ifndef _WIN32\n/* PE binary processor architecture codes (common ones only)  */\n#define IMAGE_FILE_MACHINE_I386\t\t0x014C\n#define IMAGE_FILE_MACHINE_ARM\t\t0x01C0\n#define IMAGE_FILE_MACHINE_ARMNT\t0x01C4\n#define IMAGE_FILE_MACHINE_THUMB\t0x01C2\n#define IMAGE_FILE_MACHINE_IA64\t\t0x0200\n#define IMAGE_FILE_MACHINE_AMD64\t0x8664\n#define IMAGE_FILE_MACHINE_ARM64\t0xAA64\n\n/* Windows API processor architecture codes (common ones only)  */\n#define PROCESSOR_ARCHITECTURE_INTEL\t0\n#define PROCESSOR_ARCHITECTURE_ARM\t5\n#define PROCESSOR_ARCHITECTURE_IA64\t6\n#define PROCESSOR_ARCHITECTURE_AMD64\t9\n#define PROCESSOR_ARCHITECTURE_ARM64\t12\n#endif\n\n/* Translate a processor architecture code as given in a PE binary to the code\n * used by the Windows API.  Returns -1 if the code is not recognized.  */\nstatic int\npe_arch_to_windows_arch(unsigned pe_arch)\n{\n\tswitch (pe_arch) {\n\tcase IMAGE_FILE_MACHINE_I386:\n\t\treturn PROCESSOR_ARCHITECTURE_INTEL;\n\tcase IMAGE_FILE_MACHINE_ARM:\n\tcase IMAGE_FILE_MACHINE_ARMNT:\n\tcase IMAGE_FILE_MACHINE_THUMB:\n\t\treturn PROCESSOR_ARCHITECTURE_ARM;\n\tcase IMAGE_FILE_MACHINE_IA64:\n\t\treturn PROCESSOR_ARCHITECTURE_IA64;\n\tcase IMAGE_FILE_MACHINE_AMD64:\n\t\treturn PROCESSOR_ARCHITECTURE_AMD64;\n\tcase IMAGE_FILE_MACHINE_ARM64:\n\t\treturn PROCESSOR_ARCHITECTURE_ARM64;\n\t}\n\treturn -1;\n}\n\n/* Gather information from kernel32.dll.  */\nstatic void\nset_info_from_kernel32(struct windows_info_ctx *ctx,\n\t\t       const void *contents, size_t size)\n{\n\tu32 e_lfanew;\n\tconst u8 *pe_hdr;\n\tunsigned pe_arch;\n\tint arch;\n\n\t/* Read the processor architecture from the executable header.  */\n\n\tif (size < 0x40)\n\t\tgoto invalid;\n\n\te_lfanew = le32_to_cpu(*(le32 *)((u8 *)contents + 0x3C));\n\tif (e_lfanew > size || size - e_lfanew < 6 || (e_lfanew & 3))\n\t\tgoto invalid;\n\n\tpe_hdr = (u8 *)contents + e_lfanew;\n\tif (*(le32 *)pe_hdr != cpu_to_le32(0x00004550))\t/* \"PE\\0\\0\"  */\n\t\tgoto invalid;\n\n\tpe_arch = le16_to_cpu(*(le16 *)(pe_hdr + 4));\n\tarch = pe_arch_to_windows_arch(pe_arch);\n\tif (arch >= 0) {\n\t\t/* Save the processor architecture in the XML document.  */\n\t\tset_number_property(ctx, T(\"WINDOWS/ARCH\"), arch);\n\t} else {\n\t\tXML_WARN(\"Architecture value %x from kernel32.dll \"\n\t\t\t \"header not recognized\", pe_arch);\n\t}\n\treturn;\n\ninvalid:\n\tXML_WARN(\"kernel32.dll is not a valid PE binary.\");\n}\n\n/* Gather information from the SOFTWARE registry hive.  */\nstatic void\nset_info_from_software_hive(struct windows_info_ctx *ctx,\n\t\t\t    const struct regf *regf)\n{\n\tconst tchar *version_key = T(\"Microsoft\\\\Windows NT\\\\CurrentVersion\");\n\ts64 major_version = -1;\n\ts64 minor_version = -1;\n\ttchar *version_string;\n\ttchar *build_string;\n\n\t/* Image flags  */\n\tcopy_registry_string(ctx, regf, version_key, T(\"EditionID\"),\n\t\t\t     T(\"FLAGS\"));\n\n\t/* Image display name  */\n\tcopy_registry_string(ctx, regf, version_key, T(\"ProductName\"),\n\t\t\t     T(\"DISPLAYNAME\"));\n\n\t/* Image display description  */\n\tcopy_registry_string(ctx, regf, version_key, T(\"ProductName\"),\n\t\t\t     T(\"DISPLAYDESCRIPTION\"));\n\n\t/* Edition ID  */\n\tcopy_registry_string(ctx, regf, version_key, T(\"EditionID\"),\n\t\t\t     T(\"WINDOWS/EDITIONID\"));\n\n\t/* Installation type  */\n\tcopy_registry_string(ctx, regf, version_key, T(\"InstallationType\"),\n\t\t\t     T(\"WINDOWS/INSTALLATIONTYPE\"));\n\n\t/* Product name  */\n\tcopy_registry_string(ctx, regf, version_key, T(\"ProductName\"),\n\t\t\t     T(\"WINDOWS/PRODUCTNAME\"));\n\n\t/* Major and minor version number  */\n\n\t/* Note: in Windows 10, CurrentVersion was apparently fixed at 6.3.\n\t * Instead, the new values CurrentMajorVersionNumber and\n\t * CurrentMinorVersionNumber should be used.  */\n\n\tget_number_from_registry(ctx, regf, version_key,\n\t\t\t\t T(\"CurrentMajorVersionNumber\"), &major_version);\n\n\tget_number_from_registry(ctx, regf, version_key,\n\t\t\t\t T(\"CurrentMinorVersionNumber\"), &minor_version);\n\n\tif (major_version < 0 || minor_version < 0) {\n\t\tif (get_string_from_registry(ctx, regf, version_key,\n\t\t\t\t\t     T(\"CurrentVersion\"),\n\t\t\t\t\t     &version_string))\n\t\t{\n\t\t\tif (2 != tscanf(version_string, T(\"%\"PRIi64\".%\"PRIi64),\n\t\t\t\t\t&major_version, &minor_version))\n\t\t\t{\n\t\t\t\tXML_WARN(\"Unrecognized CurrentVersion: %\"TS,\n\t\t\t\t\t version_string);\n\t\t\t}\n\t\t\tFREE(version_string);\n\t\t}\n\t}\n\n\tif (major_version >= 0) {\n\t\tset_number_property(ctx, T(\"WINDOWS/VERSION/MAJOR\"),\n\t\t\t\t    major_version);\n\t\tif (minor_version >= 0) {\n\t\t\tset_number_property(ctx, T(\"WINDOWS/VERSION/MINOR\"),\n\t\t\t\t\t    minor_version);\n\t\t}\n\t}\n\n\t/* Build number  */\n\n\t/* Note: \"CurrentBuild\" is marked as obsolete in Windows XP registries\n\t * (example value:  \"1.511.1 () (Obsolete data - do not use)\"), and\n\t * \"CurrentBuildNumber\" contains the correct value.  But oddly enough,\n\t * it is \"CurrentBuild\" that contains the correct value on *later*\n\t * versions of Windows.  */\n\tif (get_string_from_registry(ctx, regf, version_key, T(\"CurrentBuild\"),\n\t\t\t\t     &build_string))\n\t{\n\t\tif (tstrchr(build_string, T('.'))) {\n\t\t\tFREE(build_string);\n\t\t\tbuild_string = NULL;\n\t\t\tget_string_from_registry(ctx, regf, version_key,\n\t\t\t\t\t\t T(\"CurrentBuildNumber\"),\n\t\t\t\t\t\t &build_string);\n\t\t}\n\t\tif (build_string) {\n\t\t\tset_string_property(ctx, T(\"WINDOWS/VERSION/BUILD\"),\n\t\t\t\t\t    build_string);\n\t\t\tFREE(build_string);\n\t\t}\n\t}\n}\n\n/* Gather the default language from the SYSTEM registry hive.  */\nstatic void\nset_default_language(struct windows_info_ctx *ctx, const struct regf *regf)\n{\n\ttchar *string;\n\tunsigned language_id;\n\n\tif (!get_string_from_registry(ctx, regf,\n\t\t\t\t      T(\"ControlSet001\\\\Control\\\\Nls\\\\Language\"),\n\t\t\t\t      T(\"InstallLanguage\"), &string))\n\t\treturn;\n\n\tif (1 == tscanf(string, T(\"%x\"), &language_id)) {\n\t\tconst char *language_name = language_id_to_name(language_id);\n\t\tif (language_name) {\n\t\t\tsize_t len = strlen(language_name);\n\t\t\ttchar *tstr = alloca((len + 1) * sizeof(tchar));\n\t\t\tfor (size_t i = 0; i <= len; i++)\n\t\t\t\ttstr[i] = language_name[i];\n\t\t\tset_string_property(ctx, T(\"WINDOWS/LANGUAGES/DEFAULT\"),\n\t\t\t\t\t    tstr);\n\t\t\tFREE(string);\n\t\t\treturn;\n\t\t}\n\t}\n\tXML_WARN(\"Unrecognized InstallLanguage: %\"TS, string);\n\tFREE(string);\n}\n\n/* Gather information from the SYSTEM registry hive.  */\nstatic void\nset_info_from_system_hive(struct windows_info_ctx *ctx, const struct regf *regf)\n{\n\tconst tchar *windows_key = T(\"ControlSet001\\\\Control\\\\Windows\");\n\tconst tchar *uilanguages_key = T(\"ControlSet001\\\\Control\\\\MUI\\\\UILanguages\");\n\tconst tchar *productoptions_key = T(\"ControlSet001\\\\Control\\\\ProductOptions\");\n\ts64 spbuild;\n\ts64 splevel;\n\ttchar **subkeys;\n\n\t/* Service pack build  */\n\tif (get_number_from_registry(ctx, regf, windows_key,\n\t\t\t\t     T(\"CSDBuildNumber\"), &spbuild))\n\t\tset_number_property(ctx, T(\"WINDOWS/VERSION/SPBUILD\"), spbuild);\n\n\t/* Service pack level  */\n\tif (get_number_from_registry(ctx, regf, windows_key,\n\t\t\t\t     T(\"CSDVersion\"), &splevel))\n\t\tset_number_property(ctx, T(\"WINDOWS/VERSION/SPLEVEL\"), splevel >> 8);\n\n\t/* Product type  */\n\tcopy_registry_string(ctx, regf, productoptions_key, T(\"ProductType\"),\n\t\t\t     T(\"WINDOWS/PRODUCTTYPE\"));\n\n\t/* Product suite  */\n\tcopy_registry_string(ctx, regf, productoptions_key, T(\"ProductSuite\"),\n\t\t\t     T(\"WINDOWS/PRODUCTSUITE\"));\n\n\t/* Hardware abstraction layer  */\n\tcopy_registry_string(ctx, regf,\n\t\t\t     T(\"ControlSet001\\\\Control\\\\Class\\\\{4D36E966-E325-11CE-BFC1-08002BE10318}\\\\0000\"),\n\t\t\t     T(\"MatchingDeviceId\"),\n\t\t\t     T(\"WINDOWS/HAL\"));\n\n\t/* Languages  */\n\tif (list_subkeys_in_registry(ctx, regf, uilanguages_key, &subkeys)) {\n\t\ttchar property_name[64];\n\t\tfor (tchar **p = subkeys; *p; p++) {\n\t\t\ttsprintf(property_name,\n\t\t\t\t T(\"WINDOWS/LANGUAGES/LANGUAGE[%zu]\"), p - subkeys + 1);\n\t\t\tset_string_property(ctx, property_name, *p);\n\t\t}\n\t\thive_free_subkeys_list(subkeys);\n\t}\n\n\t/* Default language  */\n\tset_default_language(ctx, regf);\n}\n\n/* Load the contents of a file in the currently selected WIM image into memory.\n */\nstatic void *\nload_file_contents(struct windows_info_ctx *ctx,\n\t\t   const struct wim_dentry *dentry, const char *filename,\n\t\t   size_t *size_ret)\n{\n\tconst struct blob_descriptor *blob;\n\tvoid *contents;\n\tint ret;\n\n\tif (!dentry) {\n\t\tXML_WARN(\"%s does not exist\", filename);\n\t\treturn NULL;\n\t}\n\n\tblob = inode_get_blob_for_unnamed_data_stream(dentry->d_inode,\n\t\t\t\t\t\t      ctx->wim->blob_table);\n\tif (!blob) {\n\t\tXML_WARN(\"%s has no contents\", filename);\n\t\treturn NULL;\n\t}\n\n\tret = read_blob_into_alloc_buf(blob, &contents);\n\tif (ret) {\n\t\tXML_WARN(\"Error loading %s (size=%\"PRIu64\"): %\"TS,\n\t\t\t filename, blob->size, wimlib_get_error_string(ret));\n\t\tctx->oom_encountered |= (ret == WIMLIB_ERR_NOMEM &&\n\t\t\t\t\t blob->size < 100000000);\n\t\treturn NULL;\n\t}\n\n\t*size_ret = blob->size;\n\treturn contents;\n}\n\n/* Load and validate a registry hive file.  */\nstatic void *\nload_hive(struct windows_info_ctx *ctx, const struct wim_dentry *dentry,\n\t  const char *filename)\n{\n\tvoid *hive_mem;\n\tsize_t hive_size;\n\n\thive_mem = load_file_contents(ctx, dentry, filename, &hive_size);\n\tif (hive_mem && !is_registry_valid(ctx, hive_mem, hive_size)) {\n\t\tXML_WARN(\"%s is not a valid registry hive!\", filename);\n\t\tFREE(hive_mem);\n\t\thive_mem = NULL;\n\t}\n\treturn hive_mem;\n}\n\n/* Set the WINDOWS/SYSTEMROOT property to the name of the directory specified by\n * 'systemroot'.  */\nstatic void\nset_systemroot_property(struct windows_info_ctx *ctx,\n\t\t\tconst struct wim_dentry *systemroot)\n{\n\tutf16lechar *uname;\n\tconst tchar *name;\n\tsize_t name_nbytes;\n\tint ret;\n\n\t/* to uppercase ...  */\n\tuname = utf16le_dupz(systemroot->d_name, systemroot->d_name_nbytes);\n\tif (!uname) {\n\t\tctx->oom_encountered = true;\n\t\tgoto out;\n\t}\n\tfor (size_t i = 0; i < systemroot->d_name_nbytes / 2; i++)\n\t\tuname[i] = cpu_to_le16(upcase[le16_to_cpu(uname[i])]);\n\n\t/* to tstring ...  */\n\tret = utf16le_get_tstr(uname, systemroot->d_name_nbytes,\n\t\t\t       &name, &name_nbytes);\n\tif (ret) {\n\t\tctx->oom_encountered |= (ret == WIMLIB_ERR_NOMEM);\n\t\tXML_WARN(\"Failed to get systemroot name: %\"TS,\n\t\t\t wimlib_get_error_string(ret));\n\t\tgoto out;\n\t}\n\tset_string_property(ctx, T(\"WINDOWS/SYSTEMROOT\"), name);\n\tutf16le_put_tstr(name);\nout:\n\tFREE(uname);\n}\n\nstatic int\ndo_set_windows_specific_info(WIMStruct *wim,\n\t\t\t     const struct wim_dentry *systemroot,\n\t\t\t     const struct wim_dentry *kernel32,\n\t\t\t     const struct wim_dentry *software,\n\t\t\t     const struct wim_dentry *system)\n{\n\tvoid *contents;\n\tsize_t size;\n\tstruct windows_info_ctx _ctx = {\n\t\t.wim = wim,\n\t\t.image = wim->current_image,\n\t\t.oom_encountered = false,\n\t\t.debug_enabled = (tgetenv(T(\"WIMLIB_DEBUG_XML_INFO\")) != NULL),\n\t}, *ctx = &_ctx;\n\n\tset_systemroot_property(ctx, systemroot);\n\n\tif ((contents = load_file_contents(ctx, kernel32, \"kernel32.dll\", &size))) {\n\t\tset_info_from_kernel32(ctx, contents, size);\n\t\tFREE(contents);\n\t}\n\n\tif ((contents = load_hive(ctx, software, \"SOFTWARE\"))) {\n\t\tset_info_from_software_hive(ctx, contents);\n\t\tFREE(contents);\n\t}\n\n\tif ((contents = load_hive(ctx, system, \"SYSTEM\"))) {\n\t\tset_info_from_system_hive(ctx, contents);\n\t\tFREE(contents);\n\t}\n\n\tif (ctx->oom_encountered) {\n\t\tERROR(\"Ran out of memory while setting Windows-specific \"\n\t\t      \"metadata in the WIM file's XML document.\");\n\t\treturn WIMLIB_ERR_NOMEM;\n\t}\n\n\treturn 0;\n}\n\n/* Windows */\nstatic const utf16lechar windows_name[] = {\n\tcpu_to_le16('W'), cpu_to_le16('i'), cpu_to_le16('n'),\n\tcpu_to_le16('d'), cpu_to_le16('o'), cpu_to_le16('w'),\n\tcpu_to_le16('s'),\n};\n\n/* System32 */\nstatic const utf16lechar system32_name[] = {\n\tcpu_to_le16('S'), cpu_to_le16('y'), cpu_to_le16('s'),\n\tcpu_to_le16('t'), cpu_to_le16('e'), cpu_to_le16('m'),\n\tcpu_to_le16('3'), cpu_to_le16('2'),\n};\n\n/* kernel32.dll */\nstatic const utf16lechar kernel32_name[] = {\n\tcpu_to_le16('k'), cpu_to_le16('e'), cpu_to_le16('r'),\n\tcpu_to_le16('n'), cpu_to_le16('e'), cpu_to_le16('l'),\n\tcpu_to_le16('3'), cpu_to_le16('2'), cpu_to_le16('.'),\n\tcpu_to_le16('d'), cpu_to_le16('l'), cpu_to_le16('l'),\n};\n\n/* config */\nstatic const utf16lechar config_name[] = {\n\tcpu_to_le16('c'), cpu_to_le16('o'), cpu_to_le16('n'),\n\tcpu_to_le16('f'), cpu_to_le16('i'), cpu_to_le16('g'),\n};\n\n/* SOFTWARE */\nstatic const utf16lechar software_name[] = {\n\tcpu_to_le16('S'), cpu_to_le16('O'), cpu_to_le16('F'),\n\tcpu_to_le16('T'), cpu_to_le16('W'), cpu_to_le16('A'),\n\tcpu_to_le16('R'), cpu_to_le16('E'),\n};\n\n/* SYSTEM */\nstatic const utf16lechar system_name[] = {\n\tcpu_to_le16('S'), cpu_to_le16('Y'), cpu_to_le16('S'),\n\tcpu_to_le16('T'), cpu_to_le16('E'), cpu_to_le16('M'),\n};\n\n#define GET_CHILD(parent, child_name)\t\t\t\t\\\n\tget_dentry_child_with_utf16le_name(parent,\t\t\\\n\t\t\t\t\t   child_name,\t\t\\\n\t\t\t\t\t   sizeof(child_name),\t\\\n\t\t\t\t\t   WIMLIB_CASE_INSENSITIVE)\n\nstatic bool\nis_default_systemroot(const struct wim_dentry *potential_systemroot)\n{\n\treturn !cmp_utf16le_strings(potential_systemroot->d_name,\n\t\t\t\t    potential_systemroot->d_name_nbytes / 2,\n\t\t\t\t    windows_name,\n\t\t\t\t    ARRAY_LEN(windows_name),\n\t\t\t\t    true);\n}\n\n/*\n * Set Windows-specific XML information for the currently selected WIM image.\n *\n * This process is heavily based on heuristics and hard-coded logic related to\n * where Windows stores certain types of information.  Therefore, it simply\n * tries to set as much information as possible.  If there's a problem, it skips\n * the affected information and proceeds to the next part.  It only returns an\n * error code if there was a severe problem such as out-of-memory.\n */\nint\nset_windows_specific_info(WIMStruct *wim)\n{\n\tconst struct wim_dentry *root, *potential_systemroot,\n\t\t\t\t*best_systemroot = NULL,\n\t\t\t\t*best_kernel32 = NULL,\n\t\t\t\t*best_software = NULL,\n\t\t\t\t*best_system = NULL;\n\tint best_score = 0;\n\n\troot = wim_get_current_root_dentry(wim);\n\tif (!root)\n\t\treturn 0;\n\n\t/* Find the system root.  This is usually the toplevel directory\n\t * \"Windows\", but it might be a different toplevel directory.  Choose\n\t * the directory that contains the greatest number of the files we want:\n\t * System32/kernel32.dll, System32/config/SOFTWARE, and\n\t * System32/config/SYSTEM.  Compare all names case insensitively.  */\n\tfor_dentry_child(potential_systemroot, root) {\n\t\tconst struct wim_dentry *system32, *kernel32, *config,\n\t\t\t\t\t*software = NULL, *system = NULL;\n\t\tint score;\n\n\t\tif (!dentry_is_directory(potential_systemroot))\n\t\t\tcontinue;\n\t\tsystem32 = GET_CHILD(potential_systemroot, system32_name);\n\t\tif (!system32)\n\t\t\tcontinue;\n\t\tkernel32 = GET_CHILD(system32, kernel32_name);\n\t\tconfig = GET_CHILD(system32, config_name);\n\t\tif (config) {\n\t\t\tsoftware = GET_CHILD(config, software_name);\n\t\t\tsystem = GET_CHILD(config, system_name);\n\t\t}\n\n\t\tscore = !!kernel32 + !!software + !!system;\n\t\tif (score >= best_score) {\n\t\t\t/* If there's a tie, prefer the \"Windows\" directory.  */\n\t\t\tif (score > best_score ||\n\t\t\t    is_default_systemroot(potential_systemroot))\n\t\t\t{\n\t\t\t\tbest_score = score;\n\t\t\t\tbest_systemroot = potential_systemroot;\n\t\t\t\tbest_kernel32 = kernel32;\n\t\t\t\tbest_software = software;\n\t\t\t\tbest_system = system;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (likely(best_score == 0))\n\t\treturn 0;  /* No Windows system root found.  */\n\n\t/* Found the Windows system root.  */\n\treturn do_set_windows_specific_info(wim, best_systemroot, best_kernel32,\n\t\t\t\t\t    best_software, best_system);\n}\n"
  },
  {
    "path": "src/wimlib/xmlproc.c",
    "content": "/*\n * xmlproc.c\n *\n * A simple XML 1.0 processor.  This handles all XML features that are used in\n * WIM files, plus a bit more for futureproofing.  It omits problematic\n * features, such as expansion of entities other than simple escape sequences.\n */\n\n/*\n * Copyright 2023 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include <string.h>\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/test_support.h\"\n#include \"wimlib/util.h\"\n#include \"wimlib/xmlproc.h\"\n\n/*----------------------------------------------------------------------------*\n *                         XML node utility functions                         *\n *----------------------------------------------------------------------------*/\n\nstatic tchar *\ntstrdupz(const tchar *str, size_t len)\n{\n\ttchar *new_str = CALLOC(len + 1, sizeof(str[0]));\n\n\tif (new_str)\n\t\ttmemcpy(new_str, str, len);\n\treturn new_str;\n}\n\nstatic struct xml_node *\nxml_new_node(struct xml_node *parent, enum xml_node_type type,\n\t     const tchar *name, size_t name_len,\n\t     const tchar *value, size_t value_len)\n{\n\tstruct xml_node *node = CALLOC(1, sizeof(*node));\n\n\tif (!node)\n\t\treturn NULL;\n\tnode->type = type;\n\tINIT_LIST_HEAD(&node->children);\n\tif (name) {\n\t\tnode->name = tstrdupz(name, name_len);\n\t\tif (!node->name)\n\t\t\tgoto oom;\n\t}\n\tif (value) {\n\t\tnode->value = tstrdupz(value, value_len);\n\t\tif (!node->value)\n\t\t\tgoto oom;\n\t}\n\tif (parent)\n\t\txml_add_child(parent, node);\n\treturn node;\n\noom:\n\txml_free_node(node);\n\treturn NULL;\n}\n\n/*\n * Create a new ELEMENT node, and if @parent is non-NULL add the new node under\n * @parent which should be another ELEMENT.\n */\nstruct xml_node *\nxml_new_element(struct xml_node *parent, const tchar *name)\n{\n\treturn xml_new_node(parent, XML_ELEMENT_NODE, name, tstrlen(name),\n\t\t\t    NULL, 0);\n}\n\n/*\n * Create a new ELEMENT node with an attached TEXT node, and if @parent is\n * non-NULL add the new ELEMENT under @parent which should be another ELEMENT.\n */\nstruct xml_node *\nxml_new_element_with_text(struct xml_node *parent, const tchar *name,\n\t\t\t  const tchar *text)\n{\n\tstruct xml_node *element = xml_new_element(parent, name);\n\n\tif (element && xml_element_set_text(element, text) != 0) {\n\t\txml_free_node(element);\n\t\treturn NULL;\n\t}\n\treturn element;\n}\n\n/* Append @child to the children list of @parent. */\nvoid\nxml_add_child(struct xml_node *parent, struct xml_node *child)\n{\n\txml_unlink_node(child);\t/* Shouldn't be needed, but be safe. */\n\tchild->parent = parent;\n\tlist_add_tail(&child->sibling_link, &parent->children);\n}\n\n/* Unlink @node from its parent, if it has one. */\nvoid\nxml_unlink_node(struct xml_node *node)\n{\n\tif (node->parent) {\n\t\tlist_del(&node->sibling_link);\n\t\tnode->parent = NULL;\n\t}\n}\n\nstatic void\nxml_free_children(struct xml_node *parent)\n{\n\tstruct xml_node *child, *tmp;\n\n\tlist_for_each_entry_safe(child, tmp, &parent->children, sibling_link)\n\t\txml_free_node(child);\n}\n\n/* Recursively free @node, first unlinking it if needed.  @node may be NULL. */\nvoid\nxml_free_node(struct xml_node *node)\n{\n\tif (node) {\n\t\txml_unlink_node(node);\n\t\txml_free_children(node);\n\t\tFREE(node->name);\n\t\tFREE(node->value);\n\t\tFREE(node);\n\t}\n}\n\n/*\n * Return the text from the first TEXT child node of @element, or NULL if no\n * such node exists.  @element may be NULL.\n */\nconst tchar *\nxml_element_get_text(const struct xml_node *element)\n{\n\tconst struct xml_node *child;\n\n\txml_node_for_each_child(element, child)\n\t\tif (child->type == XML_TEXT_NODE)\n\t\t\treturn child->value;\n\treturn NULL;\n}\n\n/*\n * Set the contents of the given @element to the given @text, replacing the\n * entire existing contents if any.\n */\nint\nxml_element_set_text(struct xml_node *element, const tchar *text)\n{\n\tstruct xml_node *text_node = xml_new_node(NULL, XML_TEXT_NODE, NULL, 0,\n\t\t\t\t\t\t  text, tstrlen(text));\n\tif (!text_node)\n\t\treturn WIMLIB_ERR_NOMEM;\n\txml_free_children(element);\n\txml_add_child(element, text_node);\n\treturn 0;\n}\n\nstatic int\nxml_element_append_text(struct xml_node *element,\n\t\t\tconst tchar *text, size_t text_len)\n{\n\tstruct xml_node *last_child;\n\n\tif (!list_empty(&element->children) &&\n\t    (last_child =\n\t     list_last_entry(&element->children, struct xml_node,\n\t\t\t     sibling_link))->type == XML_TEXT_NODE) {\n\t\t/*\n\t\t * The new TEXT would directly follow another TEXT, so simplify\n\t\t * the tree by just appending to the existing TEXT.  (This case\n\t\t * can theoretically be reached via the use of CDATA...)\n\t\t */\n\t\tsize_t old_len = tstrlen(last_child->value);\n\t\ttchar *new_value = CALLOC(old_len + text_len + 1,\n\t\t\t\t\t  sizeof(new_value[0]));\n\t\tif (!new_value)\n\t\t\treturn WIMLIB_ERR_NOMEM;\n\t\ttmemcpy(new_value, last_child->value, old_len);\n\t\ttmemcpy(&new_value[old_len], text, text_len);\n\t\tFREE(last_child->value);\n\t\tlast_child->value = new_value;\n\t\treturn 0;\n\t}\n\tif (!xml_new_node(element, XML_TEXT_NODE, NULL, 0, text, text_len))\n\t\treturn WIMLIB_ERR_NOMEM;\n\treturn 0;\n}\n\n/* Find the attribute with the given @name on @element. */\nstruct xml_node *\nxml_get_attrib(const struct xml_node *element, const tchar *name)\n{\n\tstruct xml_node *child;\n\n\txml_node_for_each_child(element, child) {\n\t\tif (child->type == XML_ATTRIBUTE_NODE &&\n\t\t    !tstrcmp(child->name, name))\n\t\t\treturn child;\n\t}\n\treturn NULL;\n}\n\n/* Set the attribute @name=@value on the given @element. */\nint\nxml_set_attrib(struct xml_node *element, const tchar *name, const tchar *value)\n{\n\tstruct xml_node *attrib = xml_new_node(NULL, XML_ATTRIBUTE_NODE,\n\t\t\t\t\t       name, tstrlen(name),\n\t\t\t\t\t       value, tstrlen(value));\n\tif (!attrib)\n\t\treturn WIMLIB_ERR_NOMEM;\n\txml_replace_child(element, attrib);\n\treturn 0;\n}\n\n/*\n * Add the ELEMENT or ATTRIBUTE node @replacement under the ELEMENT @parent,\n * replacing any node with the same type and name that already exists.\n */\nvoid\nxml_replace_child(struct xml_node *parent, struct xml_node *replacement)\n{\n\tstruct xml_node *child;\n\n\txml_unlink_node(replacement); /* Shouldn't be needed, but be safe. */\n\n\txml_node_for_each_child(parent, child) {\n\t\tif (child->type == replacement->type &&\n\t\t    !tstrcmp(child->name, replacement->name)) {\n\t\t\tlist_replace(&child->sibling_link,\n\t\t\t\t     &replacement->sibling_link);\n\t\t\treplacement->parent = parent;\n\t\t\tchild->parent = NULL;\n\t\t\txml_free_node(child);\n\t\t\treturn;\n\t\t}\n\t}\n\txml_add_child(parent, replacement);\n}\n\nstruct xml_node *\nxml_clone_tree(struct xml_node *orig)\n{\n\tstruct xml_node *clone, *orig_child, *clone_child;\n\n\tclone = xml_new_node(NULL, orig->type,\n\t\t\torig->name, orig->name ? tstrlen(orig->name) : 0,\n\t\t\torig->value, orig->value ? tstrlen(orig->value) : 0);\n\tif (!clone)\n\t\treturn NULL;\n\txml_node_for_each_child(orig, orig_child) {\n\t\tclone_child = xml_clone_tree(orig_child);\n\t\tif (!clone_child)\n\t\t\tgoto oom;\n\t\txml_add_child(clone, clone_child);\n\t}\n\treturn clone;\n\noom:\n\txml_free_node(clone);\n\treturn NULL;\n}\n\n/*----------------------------------------------------------------------------*\n *                           XML string validation                            *\n *----------------------------------------------------------------------------*/\n\n/*\n * Functions that check for legal names and values in XML 1.0.  These are\n * currently slightly over-lenient, as they allow everything non-ASCII.  These\n * are also not currently used by the XML parser to reject non-well-formed\n * documents, but rather just by the user of the XML processor (xml.c) in order\n * to avoid introducing illegal names and values into the document.\n */\n\nstatic inline bool\nis_whitespace(tchar c)\n{\n\treturn c == ' ' || c == '\\n' || c == '\\r' || c == '\\t';\n}\n\nstatic inline bool\nis_name_start_char(tchar c)\n{\n\treturn (c & 0x7f) != c /* overly lenient for now */ ||\n\t\t(c >= 'A' && c <= 'Z') ||\n\t\t(c >= 'a' && c <= 'z') ||\n\t\tc == ':' || c == '_';\n}\n\nstatic inline bool\nis_name_char(tchar c)\n{\n\treturn is_name_start_char(c) ||\n\t\t(c >= '0' && c <= '9') || c == '-' || c == '.';\n}\n\n/* Allow characters used in element \"paths\"; see do_xml_path_walk() */\nstatic inline bool\nis_path_char(tchar c)\n{\n\treturn c == '/' || c == '[' || c == ']';\n}\n\nbool\nxml_legal_path(const tchar *p)\n{\n\tif (!is_name_start_char(*p) && !is_path_char(*p))\n\t\treturn false;\n\tfor (p = p + 1; *p; p++) {\n\t\tif (!is_name_char(*p) && !is_path_char(*p))\n\t\t\treturn false;\n\t}\n\treturn true;\n}\n\nbool\nxml_legal_value(const tchar *p)\n{\n\tfor (; *p; p++) {\n\t\t/* Careful: tchar can be signed. */\n\t\tif (*p > 0 && *p < 0x20 && !is_whitespace(*p))\n\t\t\treturn false;\n\t}\n\treturn true;\n}\n\n#if TCHAR_IS_UTF16LE\n#define BYTE_ORDER_MARK\t(tchar[]){ 0xfeff, 0 }\n#else\n#define BYTE_ORDER_MARK\t\"\\xEF\\xBB\\xBF\"\n#endif\n\n/*----------------------------------------------------------------------------*\n *                               XML parsing                                  *\n *----------------------------------------------------------------------------*/\n\n#define CHECK(cond)\tif (!(cond)) goto bad\n\nstatic inline void\nskip_whitespace(const tchar **pp)\n{\n\tconst tchar *p = *pp;\n\n\twhile (is_whitespace(*p))\n\t\tp++;\n\t*pp = p;\n}\n\nstatic inline bool\nskip_string(const tchar **pp, const tchar *str)\n{\n\tconst tchar *p = *pp;\n\tsize_t len = tstrlen(str);\n\n\tif (tstrncmp(p, str, len))\n\t\treturn false;\n\t*pp = p + len;\n\treturn true;\n}\n\nstatic inline bool\nfind_and_skip(const tchar **pp, const tchar *str)\n{\n\tconst tchar *p = *pp;\n\n\tp = tstrstr(p, str);\n\tif (!p)\n\t\treturn false;\n\t*pp = p + tstrlen(str);\n\treturn true;\n}\n\nstatic bool\nskip_misc(const tchar **pp)\n{\n\tconst tchar *p = *pp, *prev_p;\n\n\tdo {\n\t\tprev_p = p;\n\t\tskip_whitespace(&p);\n\t\t/* Discard XML declaration and top-level PIs for now. */\n\t\tif (skip_string(&p, T(\"<?\")) && !find_and_skip(&p, T(\"?>\")))\n\t\t\treturn false;\n\t\t/* Discard DOCTYPE declaration for now. */\n\t\tif (skip_string(&p, T(\"<!DOCTYPE\")) && !find_and_skip(&p, T(\">\")))\n\t\t\treturn false;\n\t\t/* Discard top-level comments for now. */\n\t\tif (skip_string(&p, T(\"<!--\")) && !find_and_skip(&p, T(\"-->\")))\n\t\t\treturn false;\n\t} while (p != prev_p);\n\t*pp = p;\n\treturn true;\n}\n\nstatic inline const tchar *\nget_escape_seq(tchar c)\n{\n\tswitch (c) {\n\tcase '<':\n\t\treturn T(\"&lt;\");\n\tcase '>':\n\t\treturn T(\"&gt;\");\n\tcase '&':\n\t\treturn T(\"&amp;\");\n\tcase '\\'':\n\t\treturn T(\"&apos;\");\n\tcase '\"':\n\t\treturn T(\"&quot;\");\n\t}\n\treturn NULL;\n}\n\n/* Note: 'str' must be NUL-terminated, but only 'len' chars are used. */\nstatic int\nunescape_string(const tchar *str, size_t len, tchar **unescaped_ret)\n{\n\tconst tchar *in_p = str;\n\ttchar *unescaped, *out_p;\n\n\tunescaped = CALLOC(len + 1, sizeof(str[0]));\n\tif (!unescaped)\n\t\treturn WIMLIB_ERR_NOMEM;\n\tout_p = unescaped;\n\twhile (in_p < &str[len]) {\n\t\tif (*in_p != '&')\n\t\t\t*out_p++ = *in_p++;\n\t\telse if (skip_string(&in_p, T(\"&lt;\")))\n\t\t\t*out_p++ = '<';\n\t\telse if (skip_string(&in_p, T(\"&gt;\")))\n\t\t\t*out_p++ = '>';\n\t\telse if (skip_string(&in_p, T(\"&amp;\")))\n\t\t\t*out_p++ = '&';\n\t\telse if (skip_string(&in_p, T(\"&apos;\")))\n\t\t\t*out_p++ = '\\'';\n\t\telse if (skip_string(&in_p, T(\"&quot;\")))\n\t\t\t*out_p++ = '\"';\n\t\telse\n\t\t\tgoto bad;\n\t}\n\tif (in_p > &str[len])\n\t\tgoto bad;\n\t*unescaped_ret = unescaped;\n\treturn 0;\n\nbad:\n\tERROR(\"Error unescaping string '%.*\"TS\"'\", (int)len, str);\n\tFREE(unescaped);\n\treturn WIMLIB_ERR_XML;\n}\n\nstatic int\nparse_element(const tchar **pp, struct xml_node *parent, int depth,\n\t      struct xml_node **node_ret);\n\nstatic int\nparse_contents(const tchar **pp, struct xml_node *element, int depth)\n{\n\tconst tchar *p = *pp;\n\tint ret;\n\n\tfor (;;) {\n\t\tconst tchar *raw_text = p;\n\t\ttchar *text;\n\n\t\tfor (; *p != '<'; p++) {\n\t\t\tif (*p == '\\0')\n\t\t\t\treturn WIMLIB_ERR_XML;\n\t\t}\n\t\tif (p > raw_text) {\n\t\t\tret = unescape_string(raw_text, p - raw_text, &text);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t\tret = xml_element_append_text(element, text,\n\t\t\t\t\t\t      tstrlen(text));\n\t\t\tFREE(text);\n\t\t\tif (ret)\n\t\t\t\treturn ret;\n\t\t}\n\t\tif (p[1] == '/') {\n\t\t\tbreak; /* Reached the end tag of @element */\n\t\t} else if (p[1] == '?') {\n\t\t\t/* Discard processing instructions for now. */\n\t\t\tp += 2;\n\t\t\tif (!find_and_skip(&p, T(\"?>\")))\n\t\t\t\treturn WIMLIB_ERR_XML;\n\t\t\tcontinue;\n\t\t} else if (p[1] == '!') {\n\t\t\tif (skip_string(&p, T(\"<![CDATA[\"))) {\n\t\t\t\traw_text = p;\n\t\t\t\tif (!find_and_skip(&p, T(\"]]>\")))\n\t\t\t\t\treturn WIMLIB_ERR_XML;\n\t\t\t\tret = xml_element_append_text(element, raw_text,\n\t\t\t\t\t\t\t      p - 3 - raw_text);\n\t\t\t\tif (ret)\n\t\t\t\t\treturn ret;\n\t\t\t\tcontinue;\n\t\t\t} else if (skip_string(&p, T(\"<!--\"))) {\n\t\t\t\t/* Discard comments for now. */\n\t\t\t\tif (!find_and_skip(&p, T(\"-->\")))\n\t\t\t\t\treturn WIMLIB_ERR_XML;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn WIMLIB_ERR_XML;\n\t\t}\n\t\tret = parse_element(&p, element, depth + 1, NULL);\n\t\tif (ret)\n\t\t\treturn ret;\n\t}\n\t*pp = p;\n\treturn 0;\n}\n\nstatic int\nparse_element(const tchar **pp, struct xml_node *parent, int depth,\n\t      struct xml_node **element_ret)\n{\n\tconst tchar *p = *pp;\n\tstruct xml_node *element = NULL;\n\tconst tchar *name_start;\n\tsize_t name_len;\n\tint ret;\n\n\t/* Parse the start tag. */\n\tCHECK(depth < 50);\n\tCHECK(*p == '<');\n\tp++;\n\tname_start = p;\n\twhile (!is_whitespace(*p) && *p != '>' && *p != '/' && *p != '\\0')\n\t\tp++;\n\tname_len = p - name_start;\n\tCHECK(name_len > 0);\n\telement = xml_new_node(parent, XML_ELEMENT_NODE, name_start, name_len,\n\t\t\t       NULL, 0);\n\tif (!element) {\n\t\tret = WIMLIB_ERR_NOMEM;\n\t\tgoto error;\n\t}\n\t/* Parse the attributes list within the start tag. */\n\twhile (is_whitespace(*p)) {\n\t\tconst tchar *attr_name_start, *attr_value_start;\n\t\tsize_t attr_name_len, attr_value_len;\n\t\ttchar *attr_value;\n\t\ttchar quote;\n\n\t\tskip_whitespace(&p);\n\t\tif (*p == '/' || *p == '>')\n\t\t\tbreak;\n\t\tattr_name_start = p;\n\t\twhile (*p != '=' && !is_whitespace(*p) && *p != '\\0')\n\t\t\tp++;\n\t\tattr_name_len = p - attr_name_start;\n\t\tskip_whitespace(&p);\n\t\tCHECK(attr_name_len > 0 && *p == '=');\n\t\tp++;\n\t\tskip_whitespace(&p);\n\t\tquote = *p;\n\t\tCHECK(quote == '\\'' || quote == '\"');\n\t\tattr_value_start = ++p;\n\t\twhile (*p != quote && *p != '\\0')\n\t\t\tp++;\n\t\tCHECK(*p == quote);\n\t\tattr_value_len = p - attr_value_start;\n\t\tp++;\n\t\tret = unescape_string(attr_value_start, attr_value_len,\n\t\t\t\t      &attr_value);\n\t\tif (ret)\n\t\t\tgoto error;\n\t\tret = xml_new_node(element, XML_ATTRIBUTE_NODE,\n\t\t\t\t   attr_name_start, attr_name_len,\n\t\t\t\t   attr_value, tstrlen(attr_value))\n\t\t\t? 0 : WIMLIB_ERR_NOMEM;\n\t\tFREE(attr_value);\n\t\tif (ret)\n\t\t\tgoto error;\n\t}\n\tif (*p == '/') {\n\t\t/* Closing an empty element tag */\n\t\tp++;\n\t} else {\n\t\t/* Closing the start tag */\n\t\tCHECK(*p == '>');\n\t\tp++;\n\t\t/* Parse the contents, then the end tag. */\n\t\tret = parse_contents(&p, element, depth);\n\t\tif (ret)\n\t\t\tgoto error;\n\t\tCHECK(*p == '<');\n\t\tp++;\n\t\tCHECK(*p == '/');\n\t\tp++;\n\t\tCHECK(!tstrncmp(p, name_start, name_len));\n\t\tp += name_len;\n\t\tskip_whitespace(&p);\n\t}\n\tCHECK(*p == '>');\n\tp++;\n\t*pp = p;\n\tif (element_ret)\n\t\t*element_ret = element;\n\treturn 0;\n\nerror:\n\txml_free_node(element);\n\treturn ret;\n\nbad:\n\tret = WIMLIB_ERR_XML;\n\tgoto error;\n}\n\n/*\n * Deserialize an XML document and return its root node in @doc_ret.  The\n * document must be given as a NUL-terminated string of 'tchar', i.e. UTF-16LE\n * in Windows builds and UTF-8 everywhere else.\n */\nint\nxml_parse_document(const tchar *p, struct xml_node **doc_ret)\n{\n\tint ret;\n\tstruct xml_node *doc;\n\n\t// Keep static analysers happy since we don't care about returned value.\n\t(void)skip_string(&p, BYTE_ORDER_MARK);\n\tif (!skip_misc(&p))\n\t\treturn WIMLIB_ERR_XML;\n\tret = parse_element(&p, NULL, 0, &doc);\n\tif (ret)\n\t\treturn ret;\n\tif (!skip_misc(&p) || *p) {\n\t\txml_free_node(doc);\n\t\treturn WIMLIB_ERR_XML;\n\t}\n\t*doc_ret = doc;\n\treturn 0;\n}\n\n/*----------------------------------------------------------------------------*\n *                               XML writing                                  *\n *----------------------------------------------------------------------------*/\n\nstatic void\nxml_write(struct xml_out_buf *buf, const tchar *str, size_t len)\n{\n\tif (buf->count + len + 1 > buf->capacity) {\n\t\tsize_t new_capacity = max3(buf->count + len + 1,\n\t\t\t\t\t   buf->capacity * 2, 4096);\n\t\ttchar *new_buf = REALLOC(buf->buf,\n\t\t\t\t\t new_capacity * sizeof(str[0]));\n\t\tif (!new_buf) {\n\t\t\tbuf->oom = true;\n\t\t\treturn;\n\t\t}\n\t\tbuf->buf = new_buf;\n\t\tbuf->capacity = new_capacity;\n\t}\n\ttmemcpy(&buf->buf[buf->count], str, len);\n\tbuf->count += len;\n}\n\nstatic void\nxml_puts(struct xml_out_buf *buf, const tchar *str)\n{\n\txml_write(buf, str, tstrlen(str));\n}\n\nstatic void\nxml_escape_and_puts(struct xml_out_buf *buf, const tchar *str)\n{\n\tconst tchar *p = str, *saved, *seq = NULL;\n\n\tfor (;; p++) {\n\t\tfor (saved = p; *p && (seq = get_escape_seq(*p)) == NULL; p++)\n\t\t\t;\n\t\txml_write(buf, saved, p - saved);\n\t\tif (!*p)\n\t\t\treturn;\n\t\txml_puts(buf, seq);\n\t}\n}\n\nstatic void\nxml_write_element(struct xml_node *element, struct xml_out_buf *buf)\n{\n\tstruct xml_node *child;\n\twimlib_assert(element != NULL);\n\tif (element == NULL)\n\t\treturn;\n\n\t/* Write the start tag. */\n\txml_puts(buf, T(\"<\"));\n\txml_puts(buf, element->name);\n\txml_node_for_each_child(element, child) {\n\t\tif (child->type == XML_ATTRIBUTE_NODE) {\n\t\t\txml_puts(buf, T(\" \"));\n\t\t\txml_puts(buf, child->name);\n\t\t\txml_puts(buf, T(\"=\\\"\"));\n\t\t\txml_escape_and_puts(buf, child->value);\n\t\t\txml_puts(buf, T(\"\\\"\"));\n\t\t}\n\t}\n\txml_puts(buf, T(\">\"));\n\n\t/* Write the contents. */\n\txml_node_for_each_child(element, child) {\n\t\tif (child->type == XML_TEXT_NODE)\n\t\t\txml_escape_and_puts(buf, child->value);\n\t\telse if (child->type == XML_ELEMENT_NODE)\n\t\t\txml_write_element(child, buf);\n\t}\n\n\t/* Write the end tag. */\n\txml_puts(buf, T(\"</\"));\n\txml_puts(buf, element->name);\n\txml_puts(buf, T(\">\"));\n}\n\n/*\n * Serialize the document @doc into @buf as a NUL-terminated string of 'tchar',\n * i.e. UTF-16LE in Windows builds and UTF-8 everywhere else.  A byte order mark\n * (BOM) is included, as this is needed for compatibility with WIMGAPI.\n */\nint\nxml_write_document(struct xml_node *doc, struct xml_out_buf *buf)\n{\n\txml_puts(buf, BYTE_ORDER_MARK);\n\txml_write_element(doc, buf);\n\tif (buf->oom)\n\t\treturn WIMLIB_ERR_NOMEM;\n\tbuf->buf[buf->count] = '\\0';\n\treturn 0;\n}\n\n/*----------------------------------------------------------------------------*\n *                              Test support                                  *\n *----------------------------------------------------------------------------*/\n\n#ifdef ENABLE_TEST_SUPPORT\nWIMLIBAPI int\nwimlib_parse_and_write_xml_doc(const tchar *in, tchar **out_ret)\n{\n\tstruct xml_node *doc;\n\tstruct xml_out_buf buf = {};\n\tint ret;\n\n\tret = xml_parse_document(in, &doc);\n\tif (ret)\n\t\treturn ret;\n\tret = xml_write_document(doc, &buf);\n\txml_free_node(doc);\n\t*out_ret = buf.buf;\n\treturn ret;\n}\n#endif /* ENABLE_TEST_SUPPORT */\n"
  },
  {
    "path": "src/wimlib/xpress_compress.c",
    "content": "/*\n * xpress_compress.c\n *\n * A compressor for the XPRESS compression format (Huffman variant).\n */\n\n/*\n * Copyright (C) 2012, 2013, 2014 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n/*\n * The maximum buffer size, in bytes, that can be compressed.  An XPRESS\n * compressor instance must be created with a 'max_bufsize' less than or equal\n * to this value.\n */\n#define XPRESS_MAX_BUFSIZE\t\t65536\n\n/*\n * Define to 1 to enable the near-optimal parsing algorithm at high compression\n * levels.  The near-optimal parsing algorithm produces a compression ratio\n * significantly better than the greedy and lazy algorithms.  However, it is\n * much slower.\n */\n#define SUPPORT_NEAR_OPTIMAL_PARSING\t1\n\n/*\n * The lowest compression level at which near-optimal parsing is enabled.\n */\n#define MIN_LEVEL_FOR_NEAR_OPTIMAL\t60\n\n/*\n * Matchfinder definitions.  For XPRESS, only a 16-bit matchfinder is needed.\n */\n#define mf_pos_t\tu16\n#define MF_SUFFIX\n\n/*\n * Note: although XPRESS can potentially use a sliding window, it isn't well\n * suited for large buffers of data because there is no way to reset the Huffman\n * code.  Therefore, we only allow buffers in which there is no restriction on\n * match offsets (no sliding window).  This simplifies the code and allows some\n * optimizations.\n */\n\n#include \"wimlib/assert.h\"\n#include \"wimlib/bitops.h\"\n#include \"wimlib/compress_common.h\"\n#include \"wimlib/compressor_ops.h\"\n#include \"wimlib/endianness.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/hc_matchfinder.h\"\n#include \"wimlib/unaligned.h\"\n#include \"wimlib/util.h\"\n#include \"wimlib/xpress_constants.h\"\n\n#if SUPPORT_NEAR_OPTIMAL_PARSING\n\n/*\n * CACHE_RESERVE_PER_POS is the number of lz_match structures to reserve in the\n * match cache for each byte position.  This value should be high enough so that\n * virtually the time, all matches found in the input buffer can fit in the\n * match cache.  However, fallback behavior on cache overflow is still required.\n */\n#define CACHE_RESERVE_PER_POS\t8\n\n/*\n * We use a binary-tree based matchfinder for optimal parsing because it can\n * find more matches in the same number of steps compared to hash-chain based\n * matchfinders.  In addition, since we need to find matches at almost every\n * position, there isn't much penalty for keeping the sequences sorted in the\n * binary trees.\n */\n#include \"wimlib/bt_matchfinder.h\"\n\nstruct xpress_optimum_node;\n\n#endif /* SUPPORT_NEAR_OPTIMAL_PARSING */\n\nstruct xpress_item;\n\n/* The main XPRESS compressor structure  */\nstruct xpress_compressor {\n\n\t/* Pointer to the compress() implementation chosen at allocation time */\n\tsize_t (*impl)(struct xpress_compressor * restrict,\n\t\t       const void * restrict, size_t, void *, size_t);\n\n\t/* Symbol frequency counters for the Huffman code  */\n\tu32 freqs[XPRESS_NUM_SYMBOLS];\n\n\t/* The Huffman codewords and their lengths  */\n\tu32 codewords[XPRESS_NUM_SYMBOLS];\n\tu8 lens[XPRESS_NUM_SYMBOLS];\n\n\t/* The \"nice\" match length: if a match of this length is found, then\n\t * choose it immediately without further consideration.  */\n\tunsigned nice_match_length;\n\n\t/* The maximum search depth: consider at most this many potential\n\t * matches at each position.  */\n\tunsigned max_search_depth;\n\n\tunion {\n\t\t/* Data for greedy or lazy parsing  */\n\t\tstruct {\n\t\t\tstruct xpress_item *chosen_items;\n\t\t\tstruct hc_matchfinder hc_mf;\n\t\t\t/* hc_mf must be last!  */\n\t\t};\n\n\t#if SUPPORT_NEAR_OPTIMAL_PARSING\n\t\t/* Data for near-optimal parsing  */\n\t\tstruct {\n\t\t\tstruct xpress_optimum_node *optimum_nodes;\n\t\t\tstruct lz_match *match_cache;\n\t\t\tstruct lz_match *cache_overflow_mark;\n\t\t\tunsigned num_optim_passes;\n\t\t\tu32 costs[XPRESS_NUM_SYMBOLS];\n\t\t\tstruct bt_matchfinder bt_mf;\n\t\t\t/* bt_mf must be last!  */\n\t\t};\n\t#endif\n\t};\n};\n\n#if SUPPORT_NEAR_OPTIMAL_PARSING\n\n/*\n * This structure represents a byte position in the input buffer and a node in\n * the graph of possible match/literal choices.\n *\n * Logically, each incoming edge to this node is labeled with a literal or a\n * match that can be taken to reach this position from an earlier position; and\n * each outgoing edge from this node is labeled with a literal or a match that\n * can be taken to advance from this position to a later position.\n *\n * But these \"edges\" are actually stored elsewhere (in 'match_cache').  Here we\n * associate with each node just two pieces of information:\n *\n *\t'cost_to_end' is the minimum cost to reach the end of the buffer from\n *\tthis position.\n *\n *\t'item' represents the literal or match that must be chosen from here to\n *\treach the end of the buffer with the minimum cost.  Equivalently, this\n *\tcan be interpreted as the label of the outgoing edge on the minimum cost\n *\tpath to the \"end of buffer\" node from this node.\n */\nstruct xpress_optimum_node {\n\n\tu32 cost_to_end;\n\n\t/*\n\t * Notes on the match/literal representation used here:\n\t *\n\t *\tThe low bits of 'item' are the length: 1 if the item is a\n\t *\tliteral, or the match length if the item is a match.\n\t *\n\t *\tThe high bits of 'item' are the actual literal byte if the item\n\t *\tis a literal, or the match offset if the item is a match.\n\t */\n#define OPTIMUM_OFFSET_SHIFT\t16\n#define OPTIMUM_LEN_MASK\t(((u32)1 << OPTIMUM_OFFSET_SHIFT) - 1)\n\tu32 item;\n};\n\n#endif /* SUPPORT_NEAR_OPTIMAL_PARSING */\n\n/* An intermediate representation of an XPRESS match or literal  */\nstruct xpress_item {\n\t/*\n\t * Bits 0  -  8: Symbol\n\t * Bits 9  - 24: Length - XPRESS_MIN_MATCH_LEN\n\t * Bits 25 - 28: Number of extra offset bits\n\t * Bits 29+    : Extra offset bits\n\t *\n\t * Unfortunately, gcc generates worse code if we use real bitfields here.\n\t */\n\tu64 data;\n};\n\n/*\n * Structure to keep track of the current state of sending compressed data to\n * the output buffer.\n *\n * The XPRESS bitstream is encoded as a sequence of little endian 16-bit coding\n * units interwoven with literal bytes.\n */\nstruct xpress_output_bitstream {\n\n\t/* Bits that haven't yet been written to the output buffer.  */\n\tu32 bitbuf;\n\n\t/* Number of bits currently held in @bitbuf.  */\n\tu32 bitcount;\n\n\t/* Pointer to the start of the output buffer.  */\n\tu8 *start;\n\n\t/* Pointer to the location in the output buffer at which to write the\n\t * next 16 bits.  */\n\tu8 *next_bits;\n\n\t/* Pointer to the location in the output buffer at which to write the\n\t * next 16 bits, after @next_bits.  */\n\tu8 *next_bits2;\n\n\t/* Pointer to the location in the output buffer at which to write the\n\t * next literal byte.  */\n\tu8 *next_byte;\n\n\t/* Pointer to the end of the output buffer.  */\n\tu8 *end;\n};\n\n/* Reset the symbol frequencies for the XPRESS Huffman code.  */\nstatic void\nxpress_reset_symbol_frequencies(struct xpress_compressor *c)\n{\n\tmemset(c->freqs, 0, sizeof(c->freqs));\n}\n\n/*\n * Make the Huffman code for XPRESS.\n *\n * Input: c->freqs\n * Output: c->lens and c->codewords\n */\nstatic void\nxpress_make_huffman_code(struct xpress_compressor *c)\n{\n\tmake_canonical_huffman_code(XPRESS_NUM_SYMBOLS, XPRESS_MAX_CODEWORD_LEN,\n\t\t\t\t    c->freqs, c->lens, c->codewords);\n}\n\n/*\n * Initialize the output bitstream.\n *\n * @os\n *\tThe output bitstream structure to initialize.\n * @buffer\n *\tThe output buffer.\n * @size\n *\tSize of @buffer, in bytes.  Must be at least 4.\n */\nstatic void\nxpress_init_output(struct xpress_output_bitstream *os, void *buffer, size_t size)\n{\n\tos->bitbuf = 0;\n\tos->bitcount = 0;\n\tos->start = buffer;\n\tos->next_bits = os->start;\n\tos->next_bits2 = os->start + 2;\n\tos->next_byte = os->start + 4;\n\tos->end = os->start + size;\n}\n\n/*\n * Write some bits to the output bitstream.\n *\n * The bits are given by the low-order @num_bits bits of @bits.  Higher-order\n * bits in @bits cannot be set.  At most 16 bits can be written at once.\n *\n * If the output buffer space is exhausted, then the bits will be ignored, and\n * xpress_flush_output() will return 0 when it gets called.\n */\nstatic forceinline void\nxpress_write_bits(struct xpress_output_bitstream *os,\n\t\t  const u32 bits, const unsigned num_bits)\n{\n\t/* This code is optimized for XPRESS, which never needs to write more\n\t * than 16 bits at once.  */\n\n\tos->bitcount += num_bits;\n\tos->bitbuf = (os->bitbuf << num_bits) | bits;\n\n\tif (os->bitcount > 16) {\n\t\tos->bitcount -= 16;\n\t\tif (os->end - os->next_byte >= 2) {\n\t\t\tput_unaligned_le16(os->bitbuf >> os->bitcount, os->next_bits);\n\t\t\tos->next_bits = os->next_bits2;\n\t\t\tos->next_bits2 = os->next_byte;\n\t\t\tos->next_byte += 2;\n\t\t}\n\t}\n}\n\n/*\n * Interweave a literal byte into the output bitstream.\n */\nstatic forceinline void\nxpress_write_byte(struct xpress_output_bitstream *os, u8 byte)\n{\n\tif (os->next_byte < os->end)\n\t\t*os->next_byte++ = byte;\n}\n\n/*\n * Interweave two literal bytes into the output bitstream.\n */\nstatic forceinline void\nxpress_write_u16(struct xpress_output_bitstream *os, u16 v)\n{\n\tif (os->end - os->next_byte >= 2) {\n\t\tput_unaligned_le16(v, os->next_byte);\n\t\tos->next_byte += 2;\n\t}\n}\n\n/*\n * Flush the last coding unit to the output buffer if needed.  Return the total\n * number of bytes written to the output buffer, or 0 if an overflow occurred.\n */\nstatic size_t\nxpress_flush_output(struct xpress_output_bitstream *os)\n{\n\tif (os->end - os->next_byte < 2)\n\t\treturn 0;\n\n\tput_unaligned_le16(os->bitbuf << (16 - os->bitcount), os->next_bits);\n\tput_unaligned_le16(0, os->next_bits2);\n\n\treturn os->next_byte - os->start;\n}\n\nstatic forceinline void\nxpress_write_extra_length_bytes(struct xpress_output_bitstream *os,\n\t\t\t\tunsigned adjusted_len)\n{\n\t/* If length >= 18, output one extra length byte.\n\t * If length >= 273, output three (total) extra length bytes.  */\n\tif (adjusted_len >= 0xF) {\n\t\tu8 byte1 = min(adjusted_len - 0xF, 0xFF);\n\t\txpress_write_byte(os, byte1);\n\t\tif (byte1 == 0xFF)\n\t\t\txpress_write_u16(os, adjusted_len);\n\t}\n}\n\n/* Output a match or literal.  */\nstatic forceinline void\nxpress_write_item(struct xpress_item item, struct xpress_output_bitstream *os,\n\t\t  const u32 codewords[], const u8 lens[])\n{\n\tu64 data = item.data;\n\tunsigned symbol = data & 0x1FF;\n\n\txpress_write_bits(os, codewords[symbol], lens[symbol]);\n\n\tif (symbol >= XPRESS_NUM_CHARS) {\n\t\t/* Match, not a literal  */\n\t\txpress_write_extra_length_bytes(os, (data >> 9) & 0xFFFF);\n\t\txpress_write_bits(os, data >> 29, (data >> 25) & 0xF);\n\t}\n}\n\n/* Output a sequence of XPRESS matches and literals.  */\nstatic void\nxpress_write_items(struct xpress_output_bitstream *os,\n\t\t   const struct xpress_item items[], size_t num_items,\n\t\t   const u32 codewords[], const u8 lens[])\n{\n\tfor (size_t i = 0; i < num_items; i++)\n\t\txpress_write_item(items[i], os, codewords, lens);\n}\n\n#if SUPPORT_NEAR_OPTIMAL_PARSING\n\n/*\n * Follow the minimum cost path in the graph of possible match/literal choices\n * and write out the matches/literals using the specified Huffman code.\n *\n * Note: this is slightly duplicated with xpress_write_items().  However, we\n * don't want to waste time translating between intermediate match/literal\n * representations.\n */\nstatic void\nxpress_write_item_list(struct xpress_output_bitstream *os,\n\t\t       struct xpress_optimum_node *optimum_nodes,\n\t\t       size_t count, const u32 codewords[], const u8 lens[])\n{\n\tstruct xpress_optimum_node *cur_node = optimum_nodes;\n\tstruct xpress_optimum_node *end_node = optimum_nodes + count;\n\tdo {\n\t\tunsigned length = cur_node->item & OPTIMUM_LEN_MASK;\n\t\tunsigned offset = cur_node->item >> OPTIMUM_OFFSET_SHIFT;\n\n\t\tif (length == 1) {\n\t\t\t/* Literal  */\n\t\t\tunsigned literal = offset;\n\n\t\t\txpress_write_bits(os, codewords[literal], lens[literal]);\n\t\t} else {\n\t\t\t/* Match  */\n\t\t\tunsigned adjusted_len;\n\t\t\tunsigned log2_offset;\n\t\t\tunsigned len_hdr;\n\t\t\tunsigned sym;\n\n\t\t\tadjusted_len = length - XPRESS_MIN_MATCH_LEN;\n\t\t\tlog2_offset = bsr32(offset);\n\t\t\tlen_hdr = min(0xF, adjusted_len);\n\t\t\tsym = XPRESS_NUM_CHARS + ((log2_offset << 4) | len_hdr);\n\n\t\t\txpress_write_bits(os, codewords[sym], lens[sym]);\n\t\t\txpress_write_extra_length_bytes(os, adjusted_len);\n\t\t\txpress_write_bits(os, offset - (1U << log2_offset),\n\t\t\t\t\t  log2_offset);\n\t\t}\n\t\tcur_node += length;\n\t} while (cur_node != end_node);\n}\n#endif /* SUPPORT_NEAR_OPTIMAL_PARSING */\n\n/*\n * Output the XPRESS-compressed data, given the sequence of match/literal\n * \"items\" that was chosen to represent the input data.\n *\n * If @near_optimal is %false, then the items are taken from the array\n * c->chosen_items[0...count].\n *\n * If @near_optimal is %true, then the items are taken from the minimum cost\n * path stored in c->optimum_nodes[0...count].\n */\nstatic size_t\nxpress_write(struct xpress_compressor *c, void *out, size_t out_nbytes_avail,\n\t     size_t count, bool near_optimal)\n{\n\tu8 *cptr;\n\tstruct xpress_output_bitstream os;\n\tsize_t out_size;\n\n\t/* Account for the end-of-data symbol and make the Huffman code.  */\n\tc->freqs[XPRESS_END_OF_DATA]++;\n\txpress_make_huffman_code(c);\n\n\t/* Output the Huffman code as a series of 512 4-bit lengths.  */\n\tcptr = out;\n\tfor (unsigned i = 0; i < XPRESS_NUM_SYMBOLS; i += 2)\n\t\t*cptr++ = (c->lens[i + 1] << 4) | c->lens[i];\n\n\txpress_init_output(&os, cptr, out_nbytes_avail - XPRESS_NUM_SYMBOLS / 2);\n\n\t/* Output the Huffman-encoded items.  */\n#if SUPPORT_NEAR_OPTIMAL_PARSING\n\tif (near_optimal) {\n\t\txpress_write_item_list(&os, c->optimum_nodes, count,\n\t\t\t\t       c->codewords, c->lens);\n\n\t} else\n#endif\n\t{\n\t\txpress_write_items(&os, c->chosen_items, count,\n\t\t\t\t   c->codewords, c->lens);\n\t}\n\n\t/* Write the end-of-data symbol (needed for MS compatibility)  */\n\txpress_write_bits(&os, c->codewords[XPRESS_END_OF_DATA],\n\t\t\t  c->lens[XPRESS_END_OF_DATA]);\n\n\t/* Flush any pending data.  Then return the compressed size if the\n\t * compressed data fit in the output buffer, or 0 if it did not.  */\n\tout_size = xpress_flush_output(&os);\n\tif (out_size == 0)\n\t\treturn 0;\n\n\treturn out_size + XPRESS_NUM_SYMBOLS / 2;\n}\n\n/* Tally the Huffman symbol for a literal and return the intermediate\n * representation of that literal.  */\nstatic forceinline struct xpress_item\nxpress_record_literal(struct xpress_compressor *c, unsigned literal)\n{\n\tc->freqs[literal]++;\n\n\treturn (struct xpress_item) {\n\t\t.data = literal,\n\t};\n}\n\n/* Tally the Huffman symbol for a match and return the intermediate\n * representation of that match.  */\nstatic forceinline struct xpress_item\nxpress_record_match(struct xpress_compressor *c, unsigned length, unsigned offset)\n{\n\tunsigned adjusted_len = length - XPRESS_MIN_MATCH_LEN;\n\tunsigned len_hdr = min(adjusted_len, 0xF);\n\tunsigned log2_offset = bsr32(offset);\n\tunsigned sym = XPRESS_NUM_CHARS + ((log2_offset << 4) | len_hdr);\n\n\twimlib_assert(sym < XPRESS_NUM_SYMBOLS);\n\t// coverity[overrun-local]\n\tc->freqs[sym]++;\n\n\treturn (struct xpress_item) {\n\t\t.data = (u64)sym |\n\t\t\t((u64)adjusted_len << 9) |\n\t\t\t((u64)log2_offset << 25) |\n\t\t\t((u64)(offset ^ (1U << log2_offset)) << 29),\n\t};\n}\n\n/*\n * This is the \"greedy\" XPRESS compressor. It always chooses the longest match.\n * (Exception: as a heuristic, we pass up length 3 matches that have large\n * offsets.)\n */\nstatic size_t\nxpress_compress_greedy(struct xpress_compressor * restrict c,\n\t\t       const void * restrict in, size_t in_nbytes,\n\t\t       void * restrict out, size_t out_nbytes_avail)\n{\n\tconst u8 * const in_begin = in;\n\tconst u8 *\t in_next = in_begin;\n\tconst u8 * const in_end = in_begin + in_nbytes;\n\tstruct xpress_item *next_chosen_item = c->chosen_items;\n\tunsigned len_3_too_far;\n\tu32 next_hashes[2] = { 0 };\n\n\tif (in_nbytes <= 8192)\n\t\tlen_3_too_far = 2048;\n\telse\n\t\tlen_3_too_far = 4096;\n\n\thc_matchfinder_init(&c->hc_mf);\n\n\tdo {\n\t\tunsigned length;\n\t\tunsigned offset;\n\n\t\tlength = hc_matchfinder_longest_match(&c->hc_mf,\n\t\t\t\t\t\t      in_begin,\n\t\t\t\t\t\t      in_next,\n\t\t\t\t\t\t      XPRESS_MIN_MATCH_LEN - 1,\n\t\t\t\t\t\t      in_end - in_next,\n\t\t\t\t\t\t      min(in_end - in_next, c->nice_match_length),\n\t\t\t\t\t\t      c->max_search_depth,\n\t\t\t\t\t\t      next_hashes,\n\t\t\t\t\t\t      &offset);\n\t\tif (length >= XPRESS_MIN_MATCH_LEN &&\n\t\t    !(length == XPRESS_MIN_MATCH_LEN && offset >= len_3_too_far))\n\t\t{\n\t\t\t/* Match found  */\n\t\t\t*next_chosen_item++ =\n\t\t\t\txpress_record_match(c, length, offset);\n\t\t\tin_next += 1;\n\t\t\thc_matchfinder_skip_bytes(&c->hc_mf,\n\t\t\t\t\t\t  in_begin,\n\t\t\t\t\t\t  in_next,\n\t\t\t\t\t\t  in_end,\n\t\t\t\t\t\t  length - 1,\n\t\t\t\t\t\t  next_hashes);\n\t\t\tin_next += length - 1;\n\t\t} else {\n\t\t\t/* No match found  */\n\t\t\t*next_chosen_item++ =\n\t\t\t\txpress_record_literal(c, *in_next);\n\t\t\tin_next += 1;\n\t\t}\n\t} while (in_next != in_end);\n\n\treturn xpress_write(c, out, out_nbytes_avail,\n\t\t\t    next_chosen_item - c->chosen_items, false);\n}\n\n/*\n * This is the \"lazy\" XPRESS compressor.  Before choosing a match, it checks to\n * see if there's a longer match at the next position.  If yes, it outputs a\n * literal and continues to the next position.  If no, it outputs the match.\n */\nstatic size_t\nxpress_compress_lazy(struct xpress_compressor * restrict c,\n\t\t     const void * restrict in, size_t in_nbytes,\n\t\t     void * restrict out, size_t out_nbytes_avail)\n{\n\tconst u8 * const in_begin = in;\n\tconst u8 *\t in_next = in_begin;\n\tconst u8 * const in_end = in_begin + in_nbytes;\n\tstruct xpress_item *next_chosen_item = c->chosen_items;\n\tunsigned len_3_too_far;\n\tu32 next_hashes[2] = { 0 };\n\n\tif (in_nbytes <= 8192)\n\t\tlen_3_too_far = 2048;\n\telse\n\t\tlen_3_too_far = 4096;\n\n\thc_matchfinder_init(&c->hc_mf);\n\n\tdo {\n\t\tunsigned cur_len;\n\t\tunsigned cur_offset;\n\t\tunsigned next_len;\n\t\tunsigned next_offset;\n\n\t\t/* Find the longest match at the current position.  */\n\t\tcur_len = hc_matchfinder_longest_match(&c->hc_mf,\n\t\t\t\t\t\t       in_begin,\n\t\t\t\t\t\t       in_next,\n\t\t\t\t\t\t       XPRESS_MIN_MATCH_LEN - 1,\n\t\t\t\t\t\t       in_end - in_next,\n\t\t\t\t\t\t       min(in_end - in_next, c->nice_match_length),\n\t\t\t\t\t\t       c->max_search_depth,\n\t\t\t\t\t\t       next_hashes,\n\t\t\t\t\t\t       &cur_offset);\n\t\tin_next += 1;\n\n\t\tif (cur_len < XPRESS_MIN_MATCH_LEN ||\n\t\t    (cur_len == XPRESS_MIN_MATCH_LEN &&\n\t\t     cur_offset >= len_3_too_far))\n\t\t{\n\t\t\t/* No match found.  Choose a literal.  */\n\t\t\t*next_chosen_item++ =\n\t\t\t\txpress_record_literal(c, *(in_next - 1));\n\t\t\tcontinue;\n\t\t}\n\n\thave_cur_match:\n\t\t/* We have a match at the current position.  */\n\n\t\t/* If the current match is very long, choose it immediately.  */\n\t\tif (cur_len >= c->nice_match_length) {\n\n\t\t\t*next_chosen_item++ =\n\t\t\t\txpress_record_match(c, cur_len, cur_offset);\n\n\t\t\thc_matchfinder_skip_bytes(&c->hc_mf,\n\t\t\t\t\t\t  in_begin,\n\t\t\t\t\t\t  in_next,\n\t\t\t\t\t\t  in_end,\n\t\t\t\t\t\t  cur_len - 1,\n\t\t\t\t\t\t  next_hashes);\n\t\t\tin_next += cur_len - 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\t/*\n\t\t * Try to find a match at the next position.\n\t\t *\n\t\t * Note: since we already have a match at the *current*\n\t\t * position, we use only half the 'max_search_depth' when\n\t\t * checking the *next* position.  This is a useful trade-off\n\t\t * because it's more worthwhile to use a greater search depth on\n\t\t * the initial match than on the next match (since a lot of the\n\t\t * time, that next match won't even be used).\n\t\t *\n\t\t * Note: it's possible to structure the code such that there's\n\t\t * only one call to longest_match(), which handles both the\n\t\t * \"find the initial match\" and \"try to find a longer match\"\n\t\t * cases.  However, it is faster to have two call sites, with\n\t\t * longest_match() inlined at each.\n\t\t */\n\t\tnext_len = hc_matchfinder_longest_match(&c->hc_mf,\n\t\t\t\t\t\t\tin_begin,\n\t\t\t\t\t\t\tin_next,\n\t\t\t\t\t\t\tcur_len,\n\t\t\t\t\t\t        in_end - in_next,\n\t\t\t\t\t\t        min(in_end - in_next, c->nice_match_length),\n\t\t\t\t\t\t\tc->max_search_depth / 2,\n\t\t\t\t\t\t\tnext_hashes,\n\t\t\t\t\t\t\t&next_offset);\n\t\tin_next += 1;\n\n\t\tif (next_len > cur_len) {\n\t\t\t/* Found a longer match at the next position, so output\n\t\t\t * a literal.  */\n\t\t\t*next_chosen_item++ =\n\t\t\t\txpress_record_literal(c, *(in_next - 2));\n\t\t\tcur_len = next_len;\n\t\t\tcur_offset = next_offset;\n\t\t\tgoto have_cur_match;\n\t\t} else {\n\t\t\t/* Didn't find a longer match at the next position, so\n\t\t\t * output the current match.  */\n\t\t\t*next_chosen_item++ =\n\t\t\t\txpress_record_match(c, cur_len, cur_offset);\n\t\t\thc_matchfinder_skip_bytes(&c->hc_mf,\n\t\t\t\t\t\t  in_begin,\n\t\t\t\t\t\t  in_next,\n\t\t\t\t\t\t  in_end,\n\t\t\t\t\t\t  cur_len - 2,\n\t\t\t\t\t\t  next_hashes);\n\t\t\tin_next += cur_len - 2;\n\t\t\tcontinue;\n\t\t}\n\t} while (in_next != in_end);\n\n\treturn xpress_write(c, out, out_nbytes_avail,\n\t\t\t    next_chosen_item - c->chosen_items, false);\n}\n\n#if SUPPORT_NEAR_OPTIMAL_PARSING\n\n/*\n * Set Huffman symbol costs for the first optimization pass.\n *\n * It works well to assume that each Huffman symbol is equally probable.  This\n * results in each symbol being assigned a cost of -log2(1.0/num_syms) where\n * 'num_syms' is the number of symbols in the alphabet.\n */\nstatic void\nxpress_set_default_costs(struct xpress_compressor *c)\n{\n\tfor (unsigned i = 0; i < XPRESS_NUM_SYMBOLS; i++)\n\t\tc->costs[i] = 9;\n}\n\n/* Update the cost model based on the codeword lengths @c->lens.  */\nstatic void\nxpress_update_costs(struct xpress_compressor *c)\n{\n\tfor (unsigned i = 0; i < XPRESS_NUM_SYMBOLS; i++)\n\t\tc->costs[i] = c->lens[i] ? c->lens[i] : XPRESS_MAX_CODEWORD_LEN;\n}\n\n/*\n * Follow the minimum cost path in the graph of possible match/literal choices\n * and compute the frequencies of the Huffman symbols that are needed to output\n * those matches and literals.\n */\nstatic void\nxpress_tally_item_list(struct xpress_compressor *c,\n\t\t       struct xpress_optimum_node *end_node)\n{\n\tstruct xpress_optimum_node *cur_node = c->optimum_nodes;\n\n\tdo {\n\t\tunsigned length = cur_node->item & OPTIMUM_LEN_MASK;\n\t\tunsigned offset = cur_node->item >> OPTIMUM_OFFSET_SHIFT;\n\n\t\tif (length == 1) {\n\t\t\t/* Literal  */\n\t\t\tunsigned literal = offset;\n\n\t\t\tc->freqs[literal]++;\n\t\t} else {\n\t\t\t/* Match  */\n\t\t\tunsigned adjusted_len;\n\t\t\tunsigned log2_offset;\n\t\t\tunsigned len_hdr;\n\t\t\tunsigned sym;\n\n\t\t\tadjusted_len = length - XPRESS_MIN_MATCH_LEN;\n\t\t\tlog2_offset = bsr32(offset);\n\t\t\tlen_hdr = min(0xF, adjusted_len);\n\t\t\tsym = XPRESS_NUM_CHARS + ((log2_offset << 4) | len_hdr);\n\n\t\t\twimlib_assert(sym < XPRESS_NUM_SYMBOLS);\n\t\t\t// coverity[overrun-local]\n\t\t\tc->freqs[sym]++;\n\t\t}\n\t\tcur_node += length;\n\t} while (cur_node != end_node);\n}\n\n/*\n * Find a new minimum cost path through the graph of possible match/literal\n * choices.  We find the minimum cost path from 'c->optimum_nodes[0]', which\n * represents the node at the beginning of the input buffer, to\n * 'c->optimum_nodes[in_nbytes]', which represents the node at the end of the\n * input buffer.  Edge costs are evaluated using the cost model 'c->costs'.\n *\n * The algorithm works backward, starting at 'c->optimum_nodes[in_nbytes]' and\n * proceeding backwards one position at a time.  At each position, the minimum\n * cost to reach 'c->optimum_nodes[in_nbytes]' from that position is computed\n * and the match/literal choice is saved.\n */\nstatic void\nxpress_find_min_cost_path(struct xpress_compressor *c, size_t in_nbytes,\n\t\t\t  struct lz_match *end_cache_ptr)\n{\n\tstruct xpress_optimum_node *cur_node = c->optimum_nodes + in_nbytes;\n\tstruct lz_match *cache_ptr = end_cache_ptr;\n\n\tcur_node->cost_to_end = 0;\n\tdo {\n\t\tunsigned literal;\n\t\tu32 best_item;\n\t\tu32 best_cost_to_end;\n\t\tunsigned num_matches;\n\t\tstruct lz_match *match;\n\t\tunsigned len;\n\n\t\tcur_node--;\n\t\tcache_ptr--;\n\n\t\tliteral = cache_ptr->offset;\n\n\t\t/* Consider coding a literal.  */\n\t\tbest_item = ((u32)literal << OPTIMUM_OFFSET_SHIFT) | 1;\n\t\tbest_cost_to_end = c->costs[literal] +\n\t\t\t\t   (cur_node + 1)->cost_to_end;\n\n\t\tnum_matches = cache_ptr->length;\n\n\t\tif (num_matches == 0) {\n\t\t\t/* No matches; the only choice is the literal.  */\n\t\t\tcur_node->cost_to_end = best_cost_to_end;\n\t\t\tcur_node->item = best_item;\n\t\t\tcontinue;\n\t\t}\n\n\t\t/*\n\t\t * Consider each match length from the minimum\n\t\t * (XPRESS_MIN_MATCH_LEN) to the length of the longest match\n\t\t * found at this position.  For each length, consider only the\n\t\t * smallest offset for which that length is available.  Although\n\t\t * this is not guaranteed to be optimal due to the possibility\n\t\t * of a larger offset costing less than a smaller offset to\n\t\t * code, this is a very useful heuristic.\n\t\t */\n\t\tmatch = cache_ptr - num_matches;\n\t\tlen = XPRESS_MIN_MATCH_LEN;\n\t\tif (cache_ptr[-1].length < 0xF + XPRESS_MIN_MATCH_LEN) {\n\t\t\t/* All lengths are small.  Optimize accordingly.  */\n\t\t\tdo {\n\t\t\t\tunsigned offset;\n\t\t\t\tunsigned log2_offset;\n\t\t\t\tu32 offset_cost;\n\n\t\t\t\toffset = match->offset;\n\t\t\t\tlog2_offset = bsr32(offset);\n\t\t\t\toffset_cost = log2_offset;\n\t\t\t\tdo {\n\t\t\t\t\tunsigned len_hdr;\n\t\t\t\t\tunsigned sym;\n\t\t\t\t\tu32 cost_to_end;\n\n\t\t\t\t\tlen_hdr = len - XPRESS_MIN_MATCH_LEN;\n\t\t\t\t\tsym = XPRESS_NUM_CHARS +\n\t\t\t\t\t      ((log2_offset << 4) | len_hdr);\n\t\t\t\t\tcost_to_end =\n\t\t\t\t\t\toffset_cost + c->costs[sym] +\n\t\t\t\t\t\t(cur_node + len)->cost_to_end;\n\t\t\t\t\tif (cost_to_end < best_cost_to_end) {\n\t\t\t\t\t\tbest_cost_to_end = cost_to_end;\n\t\t\t\t\t\tbest_item =\n\t\t\t\t\t\t\t((u32)offset <<\n\t\t\t\t\t\t\t OPTIMUM_OFFSET_SHIFT) | len;\n\t\t\t\t\t}\n\t\t\t\t} while (++len <= match->length);\n\t\t\t} while (++match != cache_ptr);\n\t\t} else {\n\t\t\t/* Some lengths are big.  */\n\t\t\tdo {\n\t\t\t\tunsigned offset;\n\t\t\t\tunsigned log2_offset;\n\t\t\t\tu32 offset_cost;\n\n\t\t\t\toffset = match->offset;\n\t\t\t\tlog2_offset = bsr32(offset);\n\t\t\t\toffset_cost = log2_offset;\n\t\t\t\tdo {\n\t\t\t\t\tunsigned adjusted_len;\n\t\t\t\t\tunsigned len_hdr;\n\t\t\t\t\tunsigned sym;\n\t\t\t\t\tu32 cost_to_end;\n\n\t\t\t\t\tadjusted_len = len - XPRESS_MIN_MATCH_LEN;\n\t\t\t\t\tlen_hdr = min(adjusted_len, 0xF);\n\t\t\t\t\tsym = XPRESS_NUM_CHARS +\n\t\t\t\t\t      ((log2_offset << 4) | len_hdr);\n\t\t\t\t\twimlib_assert(sym < XPRESS_NUM_SYMBOLS);\n\t\t\t\t\t// coverity[overrun-local]\n\t\t\t\t\tcost_to_end =\n\t\t\t\t\t\toffset_cost + c->costs[sym] +\n\t\t\t\t\t\t(cur_node + len)->cost_to_end;\n\t\t\t\t\tif (adjusted_len >= 0xF) {\n\t\t\t\t\t\tcost_to_end += 8;\n\t\t\t\t\t\tif (adjusted_len - 0xF >= 0xFF)\n\t\t\t\t\t\t\tcost_to_end += 16;\n\t\t\t\t\t}\n\t\t\t\t\tif (cost_to_end < best_cost_to_end) {\n\t\t\t\t\t\tbest_cost_to_end = cost_to_end;\n\t\t\t\t\t\tbest_item =\n\t\t\t\t\t\t\t((u32)offset <<\n\t\t\t\t\t\t\t OPTIMUM_OFFSET_SHIFT) | len;\n\t\t\t\t\t}\n\t\t\t\t} while (++len <= match->length);\n\t\t\t} while (++match != cache_ptr);\n\t\t}\n\t\tcache_ptr -= num_matches;\n\t\tcur_node->cost_to_end = best_cost_to_end;\n\t\tcur_node->item = best_item;\n\t} while (cur_node != c->optimum_nodes);\n}\n\n/*\n * This routine finds matches at each position in the buffer in[0...in_nbytes].\n * The matches are cached in the array c->match_cache, and the return value is a\n * pointer past the last slot in this array that was filled.\n */\nstatic struct lz_match *\nxpress_find_matches(struct xpress_compressor * restrict c,\n\t\t    const void * restrict in, size_t in_nbytes)\n{\n\tconst u8 * const in_begin = in;\n\tconst u8 *in_next = in_begin;\n\tstruct lz_match *cache_ptr = c->match_cache;\n\tu32 next_hashes[2] = { 0 };\n\tu32 max_len = in_nbytes;\n\tu32 nice_len = min(max_len, c->nice_match_length);\n\n\tbt_matchfinder_init(&c->bt_mf);\n\n\tfor (;;) {\n\t\tstruct lz_match *matches;\n\t\tu32 best_len;\n\n\t\t/* If we've found so many matches that the cache might overflow\n\t\t * if we keep finding more, then stop finding matches.  This\n\t\t * case is very unlikely.  */\n\t\tif (unlikely(cache_ptr >= c->cache_overflow_mark ||\n\t\t\t     max_len < BT_MATCHFINDER_REQUIRED_NBYTES))\n\t\t\tbreak;\n\n\t\tmatches = cache_ptr;\n\n\t\t/* Find matches with the current position using the binary tree\n\t\t * matchfinder and save them in the next available slots in\n\t\t * the match cache.  */\n\t\tcache_ptr =\n\t\t\tbt_matchfinder_get_matches(&c->bt_mf,\n\t\t\t\t\t\t   in_begin,\n\t\t\t\t\t\t   in_next - in_begin,\n\t\t\t\t\t\t   max_len,\n\t\t\t\t\t\t   nice_len,\n\t\t\t\t\t\t   c->max_search_depth,\n\t\t\t\t\t\t   next_hashes,\n\t\t\t\t\t\t   &best_len,\n\t\t\t\t\t\t   cache_ptr);\n\t\tcache_ptr->length = cache_ptr - matches;\n\t\tcache_ptr->offset = *in_next++;\n\t\tcache_ptr++;\n\t\tmax_len--;\n\t\tnice_len = min(nice_len, max_len);\n\n\t\t/*\n\t\t * If there was a very long match found, then don't cache any\n\t\t * matches for the bytes covered by that match.  This avoids\n\t\t * degenerate behavior when compressing highly redundant data,\n\t\t * where the number of matches can be very large.\n\t\t *\n\t\t * This heuristic doesn't actually hurt the compression ratio\n\t\t * very much.  If there's a long match, then the data must be\n\t\t * highly compressible, so it doesn't matter as much what we do.\n\t\t */\n\t\tif (best_len >= nice_len) {\n\t\t\tif (unlikely(best_len +\n\t\t\t\t     BT_MATCHFINDER_REQUIRED_NBYTES >= max_len))\n\t\t\t\tbreak;\n\t\t\t--best_len;\n\t\t\tdo {\n\t\t\t\tbt_matchfinder_skip_byte(&c->bt_mf,\n\t\t\t\t\t\t\t in_begin,\n\t\t\t\t\t\t\t in_next - in_begin,\n\t\t\t\t\t\t\t nice_len,\n\t\t\t\t\t\t\t c->max_search_depth,\n\t\t\t\t\t\t\t next_hashes);\n\t\t\t\tcache_ptr->length = 0;\n\t\t\t\tcache_ptr->offset = *in_next++;\n\t\t\t\tcache_ptr++;\n\t\t\t\tmax_len--;\n\t\t\t\tnice_len = min(nice_len, max_len);\n\t\t\t} while (--best_len);\n\t\t}\n\t}\n\n\twhile (max_len--) {\n\t\tcache_ptr->length = 0;\n\t\tcache_ptr->offset = *in_next++;\n\t\tcache_ptr++;\n\t}\n\n\treturn cache_ptr;\n}\n\n/*\n * This is the \"near-optimal\" XPRESS compressor.  It computes a compressed\n * representation of the input buffer by executing a minimum cost path search\n * over the graph of possible match/literal choices, assuming a certain cost for\n * each Huffman symbol.  The result is usually close to optimal, but it is *not*\n * guaranteed to be optimal because of (a) heuristic restrictions in which\n * matches are considered, and (b) symbol costs are unknown until those symbols\n * have already been chosen --- so iterative optimization must be used, and the\n * algorithm might converge on a local optimum rather than a global optimum.\n */\nstatic size_t\nxpress_compress_near_optimal(struct xpress_compressor * restrict c,\n\t\t\t     const void * restrict in, size_t in_nbytes,\n\t\t\t     void * restrict out, size_t out_nbytes_avail)\n{\n\tstruct lz_match *end_cache_ptr;\n\tunsigned num_passes_remaining = c->num_optim_passes;\n\n\t/* Run the input buffer through the matchfinder and save the results. */\n\tend_cache_ptr = xpress_find_matches(c, in, in_nbytes);\n\n\t/* The first optimization pass uses a default cost model.  Each\n\t * additional optimization pass uses a cost model derived from the\n\t * Huffman code computed in the previous pass.  */\n\txpress_set_default_costs(c);\n\tdo {\n\t\txpress_find_min_cost_path(c, in_nbytes, end_cache_ptr);\n\t\txpress_tally_item_list(c, c->optimum_nodes + in_nbytes);\n\t\tif (num_passes_remaining > 1) {\n\t\t\tc->freqs[XPRESS_END_OF_DATA]++;\n\t\t\txpress_make_huffman_code(c);\n\t\t\txpress_update_costs(c);\n\t\t\txpress_reset_symbol_frequencies(c);\n\t\t}\n\t} while (--num_passes_remaining);\n\n\treturn xpress_write(c, out, out_nbytes_avail, in_nbytes, true);\n}\n\n#endif /* SUPPORT_NEAR_OPTIMAL_PARSING */\n\nstatic size_t\nxpress_get_compressor_size(size_t max_bufsize, unsigned compression_level)\n{\n#if SUPPORT_NEAR_OPTIMAL_PARSING\n\tif (compression_level >= MIN_LEVEL_FOR_NEAR_OPTIMAL)\n\t\treturn offsetof(struct xpress_compressor, bt_mf) +\n\t\t\tbt_matchfinder_size(max_bufsize);\n#endif\n\n\treturn offsetof(struct xpress_compressor, hc_mf) +\n\t\thc_matchfinder_size(max_bufsize);\n}\n\nstatic u64\nxpress_get_needed_memory(size_t max_bufsize, unsigned compression_level,\n\t\t\t bool destructive)\n{\n\tu64 size = 0;\n\n\tif (max_bufsize > XPRESS_MAX_BUFSIZE)\n\t\treturn 0;\n\n\tsize += xpress_get_compressor_size(max_bufsize, compression_level);\n\n\tif (compression_level < MIN_LEVEL_FOR_NEAR_OPTIMAL ||\n\t    !SUPPORT_NEAR_OPTIMAL_PARSING) {\n\t\t/* chosen_items  */\n\t\tsize += max_bufsize * sizeof(struct xpress_item);\n\t}\n#if SUPPORT_NEAR_OPTIMAL_PARSING\n\telse {\n\t\t/* optimum_nodes  */\n\t\tsize += (max_bufsize + 1) * sizeof(struct xpress_optimum_node);\n\t\t/* match_cache */\n\t\tsize += ((max_bufsize * CACHE_RESERVE_PER_POS) +\n\t\t\t XPRESS_MAX_MATCH_LEN + max_bufsize) *\n\t\t\t\tsizeof(struct lz_match);\n\t}\n#endif\n\treturn size;\n}\n\nstatic int\nxpress_create_compressor(size_t max_bufsize, unsigned compression_level,\n\t\t\t bool destructive, void **c_ret)\n{\n\tstruct xpress_compressor *c;\n\n\tif (max_bufsize > XPRESS_MAX_BUFSIZE)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\tc = MALLOC(xpress_get_compressor_size(max_bufsize, compression_level));\n\tif (!c)\n\t\tgoto oom0;\n\n\tif (compression_level < MIN_LEVEL_FOR_NEAR_OPTIMAL ||\n\t    !SUPPORT_NEAR_OPTIMAL_PARSING)\n\t{\n\n\t\tc->chosen_items = MALLOC(max_bufsize * sizeof(struct xpress_item));\n\t\tif (!c->chosen_items)\n\t\t\tgoto oom1;\n\n\t\tif (compression_level < 30) {\n\t\t\tc->impl = xpress_compress_greedy;\n\t\t\tc->max_search_depth = (compression_level * 30) / 16;\n\t\t\tc->nice_match_length = (compression_level * 60) / 16;\n\t\t} else {\n\t\t\tc->impl = xpress_compress_lazy;\n\t\t\tc->max_search_depth = (compression_level * 30) / 32;\n\t\t\tc->nice_match_length = (compression_level * 60) / 32;\n\n\t\t\t/* xpress_compress_lazy() needs max_search_depth >= 2\n\t\t\t * because it halves the max_search_depth when\n\t\t\t * attempting a lazy match, and max_search_depth cannot\n\t\t\t * be 0.  */\n\t\t\tif (c->max_search_depth < 2)\n\t\t\t\tc->max_search_depth = 2;\n\t\t}\n\t}\n#if SUPPORT_NEAR_OPTIMAL_PARSING\n\telse {\n\n\t\tc->optimum_nodes = MALLOC((max_bufsize + 1) *\n\t\t\t\t\t  sizeof(struct xpress_optimum_node));\n\t\tc->match_cache = MALLOC(((max_bufsize * CACHE_RESERVE_PER_POS) +\n\t\t\t\t\t XPRESS_MAX_MATCH_LEN + max_bufsize) *\n\t\t\t\t\tsizeof(struct lz_match));\n\t\tif (!c->optimum_nodes || !c->match_cache) {\n\t\t\tFREE(c->optimum_nodes);\n\t\t\tFREE(c->match_cache);\n\t\t\tgoto oom1;\n\t\t}\n\t\tc->cache_overflow_mark =\n\t\t\t&c->match_cache[max_bufsize * CACHE_RESERVE_PER_POS];\n\n\t\tc->impl = xpress_compress_near_optimal;\n\t\tc->max_search_depth = (compression_level * 28) / 100;\n\t\tc->nice_match_length = (compression_level * 56) / 100;\n\t\tc->num_optim_passes = compression_level / 40;\n\t}\n#endif /* SUPPORT_NEAR_OPTIMAL_PARSING */\n\n\t/* max_search_depth == 0 is invalid.  */\n\tif (c->max_search_depth < 1)\n\t\tc->max_search_depth = 1;\n\n\t*c_ret = c;\n\treturn 0;\n\noom1:\n\tFREE(c);\noom0:\n\treturn WIMLIB_ERR_NOMEM;\n}\n\nstatic size_t\nxpress_compress(const void *restrict in, size_t in_nbytes,\n\t\tvoid *restrict out, size_t out_nbytes_avail, void *restrict _c)\n{\n\tstruct xpress_compressor *c = _c;\n\n\t/* Don't bother trying to compress very small inputs.  */\n\tif (in_nbytes < 25)\n\t\treturn 0;\n\n\tif (out_nbytes_avail <= XPRESS_NUM_SYMBOLS / 2 + 4)\n\t\treturn 0;\n\n\txpress_reset_symbol_frequencies(c);\n\n\treturn (*c->impl)(c, in, in_nbytes, out, out_nbytes_avail);\n}\n\nstatic void\nxpress_free_compressor(void *_c)\n{\n\tstruct xpress_compressor *c = _c;\n\n#if SUPPORT_NEAR_OPTIMAL_PARSING\n\tif (c->impl == xpress_compress_near_optimal) {\n\t\tFREE(c->optimum_nodes);\n\t\tFREE(c->match_cache);\n\t} else\n#endif\n\t\tFREE(c->chosen_items);\n\tFREE(c);\n}\n\nconst struct compressor_ops xpress_compressor_ops = {\n\t.get_needed_memory  = xpress_get_needed_memory,\n\t.create_compressor  = xpress_create_compressor,\n\t.compress\t    = xpress_compress,\n\t.free_compressor    = xpress_free_compressor,\n};\n"
  },
  {
    "path": "src/wimlib/xpress_decompress.c",
    "content": "/*\n * xpress_decompress.c\n *\n * A decompressor for the XPRESS compression format (Huffman variant).\n */\n\n/*\n *\n * Copyright (C) 2012-2016 Eric Biggers\n *\n * This file is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at your option) any\n * later version.\n *\n * This file is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this file; if not, see https://www.gnu.org/licenses/.\n */\n\n\n/*\n * The XPRESS compression format is an LZ77 and Huffman-code based algorithm.\n * That means it is fairly similar to LZX compression, but XPRESS is simpler, so\n * it is a little faster to compress and decompress.\n *\n * The XPRESS compression format is mostly documented in a file called \"[MS-XCA]\n * Xpress Compression Algorithm\".  In the MSDN library, it can currently be\n * found under Open Specifications => Protocols => Windows Protocols => Windows\n * Server Protocols => [MS-XCA] Xpress Compression Algorithm\".  The format in\n * WIMs is specifically the algorithm labeled as the \"LZ77+Huffman Algorithm\"\n * (there apparently are some other versions of XPRESS as well).\n *\n * If you are already familiar with the LZ77 algorithm and Huffman coding, the\n * XPRESS format is fairly simple.  The compressed data begins with 256 bytes\n * that contain 512 4-bit integers that are the lengths of the symbols in the\n * Huffman code used for match/literal headers.  In contrast with more\n * complicated formats such as DEFLATE and LZX, this is the only Huffman code\n * that is used for the entirety of the XPRESS compressed data, and the codeword\n * lengths are not encoded with a pretree.\n *\n * The rest of the compressed data is Huffman-encoded symbols.  Values 0 through\n * 255 represent the corresponding literal bytes.  Values 256 through 511\n * represent matches and may require extra bits or bytes to be read to get the\n * match offset and match length.\n *\n * The trickiest part is probably the way in which literal bytes for match\n * lengths are interleaved in the bitstream.\n *\n * Also, a caveat--- according to Microsoft's documentation for XPRESS,\n *\n *\t\"Some implementation of the decompression algorithm expect an extra\n *\tsymbol to mark the end of the data.  Specifically, some implementations\n *\tfail during decompression if the Huffman symbol 256 is not found after\n *\tthe actual data.\"\n *\n * This is the case with Microsoft's implementation in WIMGAPI, for example.  So\n * although our implementation doesn't currently check for this extra symbol,\n * compressors would be wise to add it.\n */\n\n#ifdef HAVE_CONFIG_H\n#  include \"config.h\"\n#endif\n\n#include \"wimlib/decompressor_ops.h\"\n#include \"wimlib/decompress_common.h\"\n#include \"wimlib/error.h\"\n#include \"wimlib/util.h\"\n#include \"wimlib/xpress_constants.h\"\n\n/* This value is chosen for fast decompression.  */\n#define XPRESS_TABLEBITS 11\n\nPRAGMA_BEGIN_ALIGN(DECODE_TABLE_ALIGNMENT)\nstruct xpress_decompressor {\n\tunion {\n\t\tDECODE_TABLE(decode_table, XPRESS_NUM_SYMBOLS,\n\t\t\t     XPRESS_TABLEBITS, XPRESS_MAX_CODEWORD_LEN);\n\t\tu8 lens[XPRESS_NUM_SYMBOLS];\n\t};\n\tDECODE_TABLE_WORKING_SPACE(working_space, XPRESS_NUM_SYMBOLS,\n\t\t\t\t   XPRESS_MAX_CODEWORD_LEN);\n} PRAGMA_END_ALIGN(DECODE_TABLE_ALIGNMENT);\n\nstatic int\nxpress_decompress(const void *restrict compressed_data, size_t compressed_size,\n\t\t  void *restrict uncompressed_data, size_t uncompressed_size,\n\t\t  void *restrict _d)\n{\n\tstruct xpress_decompressor *d  = _d;\n\tconst u8 * const in_begin = compressed_data;\n\tu8 * const out_begin = uncompressed_data;\n\tu8 *out_next = out_begin;\n\tu8 * const out_end = out_begin + uncompressed_size;\n\tstruct input_bitstream is;\n\n\t/* Read the Huffman codeword lengths.  */\n\tif (compressed_size < XPRESS_NUM_SYMBOLS / 2)\n\t\treturn -1;\n\tfor (int i = 0; i < XPRESS_NUM_SYMBOLS / 2; i++) {\n\t\td->lens[2 * i + 0] = in_begin[i] & 0xf;\n\t\td->lens[2 * i + 1] = in_begin[i] >> 4;\n\t}\n\n\t/* Build a decoding table for the Huffman code.  */\n\tif (make_huffman_decode_table(d->decode_table, XPRESS_NUM_SYMBOLS,\n\t\t\t\t      XPRESS_TABLEBITS, d->lens,\n\t\t\t\t      XPRESS_MAX_CODEWORD_LEN,\n\t\t\t\t      d->working_space))\n\t\treturn -1;\n\n\t/* Decode the matches and literals.  */\n\n\tinit_input_bitstream(&is, in_begin + XPRESS_NUM_SYMBOLS / 2,\n\t\t\t     compressed_size - XPRESS_NUM_SYMBOLS / 2);\n\n\twhile (out_next != out_end) {\n\t\tunsigned sym;\n\t\tunsigned log2_offset;\n\t\tu32 length;\n\t\tu32 offset;\n\n\t\tsym = read_huffsym(&is, d->decode_table,\n\t\t\t\t   XPRESS_TABLEBITS, XPRESS_MAX_CODEWORD_LEN);\n\t\tif (sym < XPRESS_NUM_CHARS) {\n\t\t\t/* Literal  */\n\t\t\t*out_next++ = sym;\n\t\t} else {\n\t\t\t/* Match  */\n\t\t\tlength = sym & 0xf;\n\t\t\tlog2_offset = (sym >> 4) & 0xf;\n\n\t\t\tbitstream_ensure_bits(&is, 16);\n\n\t\t\toffset = ((u32)1 << log2_offset) |\n\t\t\t\t bitstream_pop_bits(&is, log2_offset);\n\n\t\t\tif (length == 0xf) {\n\t\t\t\tlength += bitstream_read_byte(&is);\n\t\t\t\tif (length == 0xf + 0xff)\n\t\t\t\t\tlength = bitstream_read_u16(&is);\n\t\t\t}\n\t\t\tlength += XPRESS_MIN_MATCH_LEN;\n\n\t\t\tif (unlikely(lz_copy(length, offset,\n\t\t\t\t\t     out_begin, out_next, out_end,\n\t\t\t\t\t     XPRESS_MIN_MATCH_LEN)))\n\t\t\t\treturn -1;\n\n\t\t\tout_next += length;\n\t\t}\n\t}\n\treturn 0;\n}\n\nstatic int\nxpress_create_decompressor(size_t max_block_size, void **d_ret)\n{\n\tstruct xpress_decompressor *d;\n\n\tif (max_block_size > XPRESS_MAX_OFFSET + 1)\n\t\treturn WIMLIB_ERR_INVALID_PARAM;\n\n\td = ALIGNED_MALLOC(sizeof(*d), DECODE_TABLE_ALIGNMENT);\n\tif (!d)\n\t\treturn WIMLIB_ERR_NOMEM;\n\n\t*d_ret = d;\n\treturn 0;\n}\n\nstatic void\nxpress_free_decompressor(void *_d)\n{\n\tALIGNED_FREE(_d);\n}\n\nconst struct decompressor_ops xpress_decompressor_ops = {\n\t.create_decompressor = xpress_create_decompressor,\n\t.decompress\t     = xpress_decompress,\n\t.free_decompressor   = xpress_free_decompressor,\n};\n"
  },
  {
    "path": "src/winio.h",
    "content": "/*\n* Rufus: The Reliable USB Formatting Utility\n* Windows I/O redefinitions, that would be totally unnecessary had\n* Microsoft done a proper job with their asynchronous APIs.\n* Copyright © 2021-2024 Pete Batard <pete@akeo.ie>\n*\n* This program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU General Public License as published by\n* the Free Software Foundation, either version 3 of the License, or\n* (at your option) any later version.\n*\n* This program is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n* GNU General Public License for more details.\n*\n* You should have received a copy of the GNU General Public License\n* along with this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n#include <windows.h>\n#include \"msapi_utf8.h\"\n\n#pragma once\n\n// https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-overlapped\n// See Microsoft? It's not THAT hard to define an OVERLAPPED struct in a manner that\n// doesn't qualify as an example of \"Crimes against humanity\" in the Geneva convention.\ntypedef struct {\n\tULONG_PTR                           Internal[2];\n\tULONG64                             Offset;\n\tHANDLE                              hEvent;\n\tBOOL                                bOffsetUpdated;\n} NOW_THATS_WHAT_I_CALL_AN_OVERLAPPED;\n\n// File Descriptor for asynchronous accesses.\n// The status field is a threestate value reflecting the result\n// of the current asynchronous read operation:\n//  1: Read was successful and completed synchronously\n// -1: Read is pending asynchronously\n//  0: Read Error\ntypedef struct {\n\tHANDLE                              hFile;\n\tINT                                 iStatus;\n\tNOW_THATS_WHAT_I_CALL_AN_OVERLAPPED Overlapped;\n} ASYNC_FD;\n\n/// <summary>\n/// Open a file for asynchronous access. The values for the flags are the same as the ones\n/// for the native CreateFile() call. Note that FILE_FLAG_OVERLAPPED will always be added\n/// to dwFlagsAndAttributes before the file is instantiated, and that an internal\n/// OVERLAPPED structure with its associated wait event is also created.\n/// </summary>\n/// <param name=\"lpFileName\">The name of the file or device to be created or opened</param>\n/// <param name=\"dwDesiredAccess\">The requested access to the file or device</param>\n/// <param name=\"dwShareMode\">The requested sharing mode of the file or device</param>\n/// <param name=\"dwCreationDisposition\">Action to take on a file or device that exists or does not exist</param>\n/// <param name=\"dwFlagsAndAttributes\">The file or device attributes and flags</param>\n/// <returns>Non NULL on success</returns>\nstatic __inline HANDLE CreateFileAsync(LPCSTR lpFileName, DWORD dwDesiredAccess,\n\tDWORD dwShareMode, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes)\n{\n\tASYNC_FD* fd = calloc(sizeof(ASYNC_FD), 1);\n\tif (fd == NULL) {\n\t\tSetLastError(ERROR_NOT_ENOUGH_MEMORY);\n\t\treturn NULL;\n\t}\n\tfd->Overlapped.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);\n\tfd->hFile = CreateFileU(lpFileName, dwDesiredAccess, dwShareMode, NULL,\n\t\tdwCreationDisposition, FILE_FLAG_OVERLAPPED | dwFlagsAndAttributes, NULL);\n\tif (fd->hFile == INVALID_HANDLE_VALUE) {\n\t\tCloseHandle(fd->Overlapped.hEvent);\n\t\tfree(fd);\n\t\treturn NULL;\n\t}\n\treturn fd;\n}\n\n/// <summary>\n/// Close a previously opened asynchronous file\n/// </summary>\n/// <param name=\"h\">An async handle, created by a call to CreateFileAsync()</param>\nstatic __inline VOID CloseFileAsync(HANDLE h)\n{\n\tASYNC_FD* fd = (ASYNC_FD*)h;\n\tif (fd == NULL || fd == INVALID_HANDLE_VALUE)\n\t\treturn;\n\tCloseHandle(fd->hFile);\n\tCloseHandle(fd->Overlapped.hEvent);\n\tfree(fd);\n}\n\n/// <summary>\n/// Initiate a read operation for asynchronous I/O.\n/// </summary>\n/// <param name=\"h\">An async handle, created by a call to CreateFileAsync()</param>\n/// <param name=\"lpBuffer\">The buffer that receives the data</param>\n/// <param name=\"nNumberOfBytesToRead\">Number of bytes requested</param>\n/// <returns>TRUE on success, FALSE on error</returns>\nstatic __inline BOOL ReadFileAsync(HANDLE h, LPVOID lpBuffer, DWORD nNumberOfBytesToRead)\n{\n\tASYNC_FD* fd = (ASYNC_FD*)h;\n\tfd->Overlapped.bOffsetUpdated = FALSE;\n\tif (!ReadFile(fd->hFile, lpBuffer, nNumberOfBytesToRead, NULL,\n\t\t(OVERLAPPED*)&fd->Overlapped)) {\n\t\t// Is it possible to get ERROR_HANDLE_EOF here?\n\t\tassert(GetLastError() != ERROR_HANDLE_EOF);\n\t\tfd->iStatus = (GetLastError() == ERROR_IO_PENDING) ? -1 : 0;\n\t} else {\n\t\tfd->iStatus = 1;\n\t}\n\treturn (fd->iStatus != 0);\n}\n\n/// <summary>\n/// Initiate a write operation for asynchronous I/O.\n/// </summary>\n/// <param name=\"h\">An async handle, created by a call to CreateFileAsync()</param>\n/// <param name=\"lpBuffer\">The buffer that contains the data</param>\n/// <param name=\"nNumberOfBytesToWrite\">Number of bytes to write</param>\n/// <returns>TRUE on success, FALSE on error</returns>\nstatic __inline BOOL WriteFileAsync(HANDLE h, LPVOID lpBuffer, DWORD nNumberOfBytesToWrite)\n{\n\tASYNC_FD* fd = (ASYNC_FD*)h;\n\tfd->Overlapped.bOffsetUpdated = FALSE;\n\tif (!WriteFile(fd->hFile, lpBuffer, nNumberOfBytesToWrite, NULL,\n\t\t(OVERLAPPED*)&fd->Overlapped))\n\t\t// TODO: Is it possible to get ERROR_HANDLE_EOF here?\n\t\tfd->iStatus = (GetLastError() == ERROR_IO_PENDING) ? -1 : 0;\n\telse\n\t\tfd->iStatus = 1;\n\treturn (fd->iStatus != 0);\n}\n\n/// <summary>\n/// Wait for an asynchronous operation to complete, with timeout.\n/// This function also succeeds if the I/O already completed synchronously.\n/// </summary>\n/// <param name=\"h\">An async handle, created by a call to CreateFileAsync()</param>\n/// <param name=\"dwTimeout\">A timeout value, in ms</param>\n/// <returns>TRUE on success, FALSE on error</returns>\nstatic __inline BOOL WaitFileAsync(HANDLE h, DWORD dwTimeout)\n{\n\tASYNC_FD* fd = (ASYNC_FD*)h;\n\tif (fd->iStatus > 0)\t// Read completed synchronously\n\t\treturn TRUE;\n\treturn (WaitForSingleObject(fd->Overlapped.hEvent, dwTimeout) == WAIT_OBJECT_0);\n}\n\n/// <summary>\n/// Return the number of bytes read or written and keep track/update the\n/// current offset for an asynchronous read operation.\n/// </summary>\n/// <param name=\"h\">An async handle, created by a call to CreateFileAsync()</param>\n/// <param name=\"lpNumberOfBytes\">A pointer that receives the number of bytes transferred.</param>\n/// <returns>TRUE on success, FALSE on error</returns>\nstatic __inline BOOL GetSizeAsync(HANDLE h, LPDWORD lpNumberOfBytes)\n{\n\tASYNC_FD* fd = (ASYNC_FD*)h;\n\t// Previous call to [Read/Write]FileAsync() failed\n\tif (fd->iStatus == 0) {\n\t\t*lpNumberOfBytes = 0;\n\t\treturn FALSE;\n\t}\n\t// Detect if we already read the size and updated the offset\n\tif (fd->Overlapped.bOffsetUpdated) {\n\t\tSetLastError(ERROR_NO_MORE_ITEMS);\n\t\treturn FALSE;\n\t}\n\tfd->Overlapped.bOffsetUpdated = TRUE;\n\tif (!GetOverlappedResultEx(fd->hFile, (OVERLAPPED*)&fd->Overlapped,\n\t\tlpNumberOfBytes, WRITE_TIMEOUT, (fd->iStatus < 0)))\n\t\t// When reading from VHD/VHDX we get SECTOR_NOT_FOUND rather than EOF for the end of the drive\n\t\treturn (GetLastError() == ERROR_HANDLE_EOF || GetLastError() == ERROR_SECTOR_NOT_FOUND);\n\tfd->Overlapped.Offset += *lpNumberOfBytes;\n\treturn TRUE;\n}\n"
  },
  {
    "path": "src/wue.c",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Windows User Experience\n * Copyright © 2022-2026 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <windows.h>\n#include <windowsx.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <assert.h>\n\n#include \"rufus.h\"\n#include \"vhd.h\"\n#include \"xml.h\"\n#include \"drive.h\"\n#include \"format.h\"\n#include \"wimlib.h\"\n#include \"missing.h\"\n#include \"resource.h\"\n#include \"registry.h\"\n#include \"msapi_utf8.h\"\n#include \"timezoneapi.h\"\n#include \"localization.h\"\n\n /* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\nconst char* bypass_name[] = { \"BypassTPMCheck\", \"BypassSecureBootCheck\", \"BypassRAMCheck\" };\n\nint unattend_xml_flags = 0, wintogo_index = -1, wininst_index = 0;\nint unattend_xml_mask = UNATTEND_DEFAULT_SELECTION_MASK;\nint unattend_edition_index = 1;\nchar *unattend_xml_path = NULL, unattend_username[MAX_USERNAME_LENGTH];\nuint32_t removable_section[2] = { 0, 0 };\n\nextern BOOL validate_md5sum;\nextern uint64_t md5sum_totalbytes;\nextern StrArray modified_files;\nextern const char* efi_archname[ARCH_MAX];\n\n// Get the UI language provided by the ISO's boot.wim\nchar* GetUILanguage(void)\n{\n\tstatic char ui_language[8];\n\tint r;\n\tchar wim_path[4 * MAX_PATH] = \"\";\n\twchar_t* xml = NULL;\n\tezxml_t pxml = NULL;\n\tsize_t xml_len;\n\tWIMStruct* wim = NULL;\n\n\tassert(safe_strlen(image_path) + 32 < ARRAYSIZE(wim_path));\n\tstatic_strcpy(ui_language, \"en-US\");\n\tstatic_strcpy(wim_path, image_path);\n\tstatic_strcat(wim_path, \"|sources/boot.wim\");\n\n\tr = wimlib_open_wimU(wim_path, 0, &wim);\n\tif (r != 0) {\n\t\tuprintf(\"Could not open WIM: Error %d\", r);\n\t\tgoto out;\n\t}\n\n\tr = wimlib_get_xml_data(wim, (void**)&xml, &xml_len);\n\tif (r != 0) {\n\t\tuprintf(\"Could not read WIM XML index: Error %d\", r);\n\t\tgoto out;\n\t}\n\n\tpxml = ezxml_parse_str((char*)xml, xml_len);\n\tif (pxml == NULL)\n\t\tgoto out;\n\n\tchar* lang = ezxml_get_val(pxml, \"IMAGE\", 1, \"WINDOWS\", 0, \"LANGUAGES\", 0, \"LANGUAGE\", -1);\n\tif (lang != NULL)\n\t\tstatic_strcpy(ui_language, lang);\n\nout:\n\tezxml_free(pxml);\n\tfree(xml);\n\twimlib_free(wim);\n\treturn ui_language;\n}\n\n/// <summary>\n/// Create an installation answer file containing the sections specified by the flags.\n/// </summary>\n/// <param name=\"arch\">The processor architecture of the Windows image being used.</param>\n/// <param name=\"flags\">A bitmask representing the sections to enable.\n/// See \"Windows User Experience flags and masks\" from rufus.h</param>\n/// <returns>The path of a newly created answer file on success or NULL on error.</returns>\nchar* CreateUnattendXml(int arch, int flags)\n{\n\tconst static char* xml_arch_names[5] = { \"x86\", \"amd64\", \"arm\", \"arm64\" };\n\tconst static char* unallowed_account_names[] = { \"Administrator\", \"Guest\", \"KRBTGT\", \"Local\", \"NONE\" };\n\tstatic char path[MAX_PATH], tmp[MAX_PATH];\n\tchar* tzstr;\n\tFILE* fd;\n\tTIME_ZONE_INFORMATION tz_info;\n\tint i, order;\n\tunattend_xml_flags = flags;\n\tStrArray commands = { 0 };\n\tif (arch < ARCH_X86_32 || arch > ARCH_ARM_64 || flags == 0) {\n\t\tuprintf(\"Note: No Windows User Experience options selected\");\n\t\treturn NULL;\n\t}\n\tarch--;\n\t// coverity[swapped_arguments]\n\tif (GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, path) == 0)\n\t\treturn NULL;\n\tfd = fopen(path, \"w\");\n\tif (fd == NULL)\n\t\treturn NULL;\n\n\tuprintf(\"Selected Windows User Experience options:\");\n\tfprintf(fd, \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\");\n\tfprintf(fd, \"<unattend xmlns=\\\"urn:schemas-microsoft-com:unattend\\\">\\n\");\n\n\tStrArrayCreate(&commands, 16);\n\tif (flags & UNATTEND_WINPE_SETUP_MASK) {\n\t\tfprintf(fd, \"  <settings pass=\\\"windowsPE\\\">\\n\");\n\t\tfprintf(fd, \"    <component name=\\\"Microsoft-Windows-Setup\\\" processorArchitecture=\\\"%s\\\" language=\\\"neutral\\\" \"\n\t\t\t\"xmlns:wcm=\\\"http://schemas.microsoft.com/WMIConfig/2002/State\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" \"\n\t\t\t\"publicKeyToken=\\\"31bf3856ad364e35\\\" versionScope=\\\"nonSxS\\\">\\n\", xml_arch_names[arch]);\n\t\t// WinPE will complain if we don't provide a product key. *Any* product key. This is soooo idiotic...\n\t\tfprintf(fd, \"      <UserData>\\n\");\n\t\tfprintf(fd, \"        <AcceptEula>true</AcceptEula>\\n\");\n\t\tfprintf(fd, \"        <ProductKey>\\n\");\n\t\tfprintf(fd, \"          <Key />\\n\");\n\t\tfprintf(fd, \"        </ProductKey>\\n\");\n\t\tfprintf(fd, \"      </UserData>\\n\");\n\t\tif (flags & UNATTEND_SILENT_INSTALL) {\n\t\t\tuprintf(\"• Silent Install\");\n\t\t\t// Automatically partition the disk and set the installation target\n\t\t\tfprintf(fd, \"      <DiskConfiguration>\\n\");\n\t\t\tfprintf(fd, \"        <WillShowUI>OnError</WillShowUI>\\n\");\n\t\t\tif (flags & UNATTEND_DISABLE_BITLOCKER)\n\t\t\t\tfprintf(fd, \"        <DisableEncryptedDiskProvisioning>true</DisableEncryptedDiskProvisioning>\\n\");\n\t\t\t// The following ensures that we display the disk selection screen if only the boot media is\n\t\t\t// available (i.e. if the system does not see any target for installation). In that case the\n\t\t\t// letter assignment below fails and the UI is displayed allowing the user to provide drivers.\n\t\t\t// This also prevents the install media from being scratched, when it's the only disk.\n\t\t\t// With a special mention to Claude AI, that explicitly said this could not be accomplished...\n\t\t\tfprintf(fd, \"        <Disk wcm:action=\\\"modify\\\">\\n\");\n\t\t\tfprintf(fd, \"          <DiskID>1</DiskID> \\n\");\n\t\t\tfprintf(fd, \"          <ModifyPartitions>\\n\");\n\t\t\tfprintf(fd, \"            <ModifyPartition wcm:action=\\\"modify\\\">\\n\");\n\t\t\tfprintf(fd, \"              <Order>1</Order>\\n\");\n\t\t\tfprintf(fd, \"              <PartitionID>1</PartitionID>\\n\");\n\t\t\t// You REALLY don't want to use 'U' for the drive letter below. Don't ask me how I know!!!\n\t\t\tfprintf(fd, \"              <Letter>D</Letter>\\n\");\n\t\t\tfprintf(fd, \"            </ModifyPartition>\\n\");\n\t\t\tfprintf(fd, \"          </ModifyPartitions>\\n\");\n\t\t\tfprintf(fd, \"        </Disk>\\n\");\n\t\t\tfprintf(fd, \"        <Disk wcm:action=\\\"add\\\">\\n\");\n\t\t\tfprintf(fd, \"          <DiskID>0</DiskID> \\n\");\n\t\t\tfprintf(fd, \"          <WillWipeDisk>true</WillWipeDisk> \\n\");\n\t\t\tfprintf(fd, \"          <CreatePartitions>\\n\");\n\t\t\t// NB: Don't bother creating a recovery partition. Windows setup will do it for us.\n\t\t\tfprintf(fd, \"            <CreatePartition wcm:action=\\\"add\\\">\\n\");\n\t\t\tfprintf(fd, \"              <Order>1</Order>\\n\");\n\t\t\tfprintf(fd, \"              <Type>EFI</Type>\\n\");\n\t\t\tfprintf(fd, \"              <Size>260</Size>\\n\");\n\t\t\tfprintf(fd, \"            </CreatePartition>\\n\");\n\t\t\tfprintf(fd, \"            <CreatePartition wcm:action=\\\"add\\\">\\n\");\n\t\t\tfprintf(fd, \"              <Order>2</Order>\\n\");\n\t\t\tfprintf(fd, \"              <Type>MSR</Type>\\n\");\n\t\t\tfprintf(fd, \"              <Size>16</Size>\\n\");\n\t\t\tfprintf(fd, \"            </CreatePartition>\\n\");\n\t\t\tfprintf(fd, \"            <CreatePartition wcm:action=\\\"add\\\">\\n\");\n\t\t\tfprintf(fd, \"              <Order>3</Order>\\n\");\n\t\t\tfprintf(fd, \"              <Type>Primary</Type>\\n\");\n\t\t\tfprintf(fd, \"              <Extend>true</Extend>\\n\");\n\t\t\tfprintf(fd, \"            </CreatePartition>\\n\");\n\t\t\tfprintf(fd, \"          </CreatePartitions>\\n\");\n\t\t\tfprintf(fd, \"          <ModifyPartitions>\\n\");\n\t\t\tfprintf(fd, \"            <ModifyPartition wcm:action=\\\"add\\\">\\n\");\n\t\t\tfprintf(fd, \"              <Order>1</Order>\\n\");\n\t\t\tfprintf(fd, \"              <PartitionID>1</PartitionID>\\n\");\n\t\t\tfprintf(fd, \"              <Label>EFI</Label>\\n\");\n\t\t\tfprintf(fd, \"              <Format>FAT32</Format>\\n\");\n\t\t\tfprintf(fd, \"            </ModifyPartition>\\n\");\n\t\t\tfprintf(fd, \"            <ModifyPartition wcm:action=\\\"add\\\">\\n\");\n\t\t\tfprintf(fd, \"              <Order>2</Order>\\n\");\n\t\t\tfprintf(fd, \"              <PartitionID>3</PartitionID>\\n\");\n\t\t\tfprintf(fd, \"              <Label>Windows</Label>\\n\");\n\t\t\tfprintf(fd, \"              <Letter>C</Letter>\\n\");\n\t\t\tfprintf(fd, \"              <Format>NTFS</Format>\\n\");\n\t\t\tfprintf(fd, \"            </ModifyPartition>\\n\");\n\t\t\tfprintf(fd, \"          </ModifyPartitions>\\n\");\n\t\t\tfprintf(fd, \"        </Disk>\\n\");\n\t\t\tfprintf(fd, \"      </DiskConfiguration>\\n\");\n\t\t\tfprintf(fd, \"      <ImageInstall>\\n\");\n\t\t\tfprintf(fd, \"        <OSImage>\\n\");\n\t\t\tfprintf(fd, \"          <WillShowUI>OnError</WillShowUI>\\n\");\n\t\t\tfprintf(fd, \"          <InstallFrom>\\n\");\n\t\t\tfprintf(fd, \"            <MetaData wcm:action=\\\"add\\\">\\n\");\n\t\t\tfprintf(fd, \"              <Key>/IMAGE/INDEX</Key>\\n\");\n\t\t\tfprintf(fd, \"              <Value>%d</Value>\\n\", unattend_edition_index);\n\t\t\tfprintf(fd, \"            </MetaData>\\n\");\n\t\t\tfprintf(fd, \"          </InstallFrom>\\n\");\n\t\t\tfprintf(fd, \"          <InstallTo>\\n\");\n\t\t\tfprintf(fd, \"            <DiskID>0</DiskID>\\n\");\n\t\t\tfprintf(fd, \"            <PartitionID>3</PartitionID>\\n\");\n\t\t\tfprintf(fd, \"          </InstallTo>\\n\");\n\t\t\tfprintf(fd, \"        </OSImage>\\n\");\n\t\t\tfprintf(fd, \"      </ImageInstall>\\n\");\n\t\t}\n\t\tif (flags & UNATTEND_SECUREBOOT_TPM_MINRAM) {\n\t\t\t// This part produces the unbecoming display of a command prompt window during initial setup as well\n\t\t\t// as alters the layout and options of the initial Windows installer screens, which may scare users.\n\t\t\t// So, in format.c, we'll try to insert the registry keys directly and drop this section. However,\n\t\t\t// because Microsoft prevents Store apps from editing an offline registry, we do need this fallback.\n\t\t\t// NB: We could probably avoid this by running powershell with -WindowStyle \"Hidden\" but hey...\n\t\t\tuprintf(\"• Bypass SB/TPM/RAM\");\n\t\t\torder = 1;\n\t\t\tremovable_section[0] = (uint32_t)ftell(fd);\n\t\t\tfprintf(fd, \"      <RunSynchronous>\\n\");\n\t\t\tfor (i = 0; i < ARRAYSIZE(bypass_name); i++) {\n\t\t\t\tfprintf(fd, \"        <RunSynchronousCommand wcm:action=\\\"add\\\">\\n\");\n\t\t\t\tfprintf(fd, \"          <Order>%d</Order>\\n\", order++);\n\t\t\t\tfprintf(fd, \"          <Path>reg add HKLM\\\\SYSTEM\\\\Setup\\\\LabConfig /v %s /t REG_DWORD /d 1 /f</Path>\\n\", bypass_name[i]);\n\t\t\t\tfprintf(fd, \"        </RunSynchronousCommand>\\n\");\n\t\t\t}\n\t\t\tfprintf(fd, \"      </RunSynchronous>\\n\");\n\t\t\tremovable_section[1] = (uint32_t)ftell(fd);\n\t\t}\n\t\tfprintf(fd, \"    </component>\\n\");\n\t\tif (flags & UNATTEND_SILENT_INSTALL) {\n\t\t\tfprintf(fd, \"    <component name=\\\"Microsoft-Windows-International-Core-WinPE\\\" processorArchitecture=\\\"%s\\\" language=\\\"neutral\\\" \"\n\t\t\t\t\"xmlns:wcm=\\\"http://schemas.microsoft.com/WMIConfig/2002/State\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" \"\n\t\t\t\t\"publicKeyToken=\\\"31bf3856ad364e35\\\" versionScope=\\\"nonSxS\\\">\\n\", xml_arch_names[arch]);\n\t\t\t// Set the language from the <LANGUAGE> tag of the boot.wim index\n\t\t\tfprintf(fd, \"      <UILanguage>%s</UILanguage>\\n\", GetUILanguage());\n\t\t\tfprintf(fd, \"    </component>\\n\");\n\t\t}\n\t\tfprintf(fd, \"  </settings>\\n\");\n\t}\n\n\tif (flags & UNATTEND_SPECIALIZE_DEPLOYMENT_MASK) {\n\t\tfprintf(fd, \"  <settings pass=\\\"specialize\\\">\\n\");\n\t\tfprintf(fd, \"    <component name=\\\"Microsoft-Windows-Deployment\\\" processorArchitecture=\\\"%s\\\" language=\\\"neutral\\\" \"\n\t\t\t\"xmlns:wcm=\\\"http://schemas.microsoft.com/WMIConfig/2002/State\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" \"\n\t\t\t\"publicKeyToken=\\\"31bf3856ad364e35\\\" versionScope=\\\"nonSxS\\\">\\n\", xml_arch_names[arch]);\n\t\t// This part was picked from https://github.com/AveYo/MediaCreationTool.bat/blob/main/bypass11/AutoUnattend.xml\n\t\t// NB: This is INCOMPATIBLE with S-Mode below\n\t\tif (flags & UNATTEND_NO_ONLINE_ACCOUNT) {\n\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKLM\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\OOBE\\\" /v BypassNRO /t REG_DWORD /d 1 /f\", TRUE);\n\t\t\tuprintf(\"• Bypass online account requirement\");\n\t\t}\n\t\tif (flags & UNATTEND_QOL_ENHANCEMENTS) {\n\t\t\tuprintf(\"• QoL: Disable OneDrive and Outlook by default\");\n\t\t\t// Remove OneDrive\n\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKLM\\\\Software\\\\Policies\\\\Microsoft\\\\Windows\\\\OneDrive\\\" /v DisableFileSyncNGSC /t REG_DWORD /d 1 /f\", TRUE);\n\t\t\tStrArrayAdd(&commands, \"PowerShell -NonInteractive -WindowStyle Hidden -Command \"\n\t\t\t\t\"\\\"Remove-Item -Path $env:SystemRoot\\\\System32\\\\OneDriveSetup.exe -Force -Confirm:$false;\"\n\t\t\t\t\"\\\"Remove-Item -Path $env:SystemRoot\\\\SysWOW64\\\\OneDriveSetup.exe -Force -Confirm:$false;\", TRUE);\n\t\t\t// Remove Outlook. How the frig is forcing Outlook on users legal when MS got pinned for bundling IE with Windows?\n\t\t\tStrArrayAdd(&commands, \"PowerShell -NonInteractive -WindowStyle Hidden -Command \"\n\t\t\t\t\"\\\"Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -like '*OutlookForWindows*'} |\"\n\t\t\t\t\" Remove-AppxProvisionedPackage -Online\\\"\", TRUE);\n\t\t\tStrArrayAdd(&commands, \"PowerShell -NonInteractive -WindowStyle Hidden -Command \"\n\t\t\t\t\"\\\"Get-AppxPackage -AllUsers *OutlookForWindows* | Remove-AppxPackage -AllUsers\\\"\", TRUE);\n\t\t}\n\t\t// Now that we have all the commands to run, create the RunSynchronous section.\n\t\tfor (order = 1; order <= (int)commands.Index; order++) {\n\t\t\tif (order == 1)\n\t\t\t\tfprintf(fd, \"      <RunSynchronous>\\n\");\n\t\t\tfprintf(fd, \"        <RunSynchronousCommand wcm:action=\\\"add\\\">\\n\");\n\t\t\tfprintf(fd, \"          <Order>%d</Order>\\n\", order);\n\t\t\tfprintf(fd, \"          <Path>%s</Path>\\n\", commands.String[order - 1]);\n\t\t\tfprintf(fd, \"        </RunSynchronousCommand>\\n\");\n\t\t\tif (order == commands.Index)\n\t\t\t\tfprintf(fd, \"      </RunSynchronous>\\n\");\n\t\t}\n\t\tfprintf(fd, \"    </component>\\n\");\n\t\tfprintf(fd, \"  </settings>\\n\");\n\t\tStrArrayClear(&commands);\n\t}\n\n\tif (flags & UNATTEND_OOBE_MASK) {\n\t\tfprintf(fd, \"  <settings pass=\\\"oobeSystem\\\">\\n\");\n\t\tif (flags & UNATTEND_OOBE_SHELL_SETUP_MASK) {\n\t\t\tfprintf(fd, \"    <component name=\\\"Microsoft-Windows-Shell-Setup\\\" processorArchitecture=\\\"%s\\\" language=\\\"neutral\\\" \"\n\t\t\t\t\"xmlns:wcm=\\\"http://schemas.microsoft.com/WMIConfig/2002/State\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" \"\n\t\t\t\t\"publicKeyToken=\\\"31bf3856ad364e35\\\" versionScope=\\\"nonSxS\\\">\\n\", xml_arch_names[arch]);\n\t\t\t// https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-oobe-protectyourpc\n\t\t\t// It is really super disingenuous of Microsoft to call this option \"ProtectYourPC\", when it's really only about\n\t\t\t// data collection. But of course, if it was called \"AllowDataCollection\", everyone would turn it off...\n\t\t\tif (flags & UNATTEND_NO_DATA_COLLECTION) {\n\t\t\t\tuprintf(\"• Disable data collection\");\n\t\t\t\tfprintf(fd, \"      <OOBE>\\n\");\n\t\t\t\tfprintf(fd, \"        <HideEULAPage>true</HideEULAPage>\\n\");\n\t\t\t\tfprintf(fd, \"        <ProtectYourPC>3</ProtectYourPC>\\n\");\n\t\t\t\tfprintf(fd, \"      </OOBE>\\n\");\n\t\t\t}\n\t\t\tif (flags & UNATTEND_DUPLICATE_LOCALE) {\n\t\t\t\tif ((GetTimeZoneInformation(&tz_info) == TIME_ZONE_ID_INVALID) ||\n\t\t\t\t\t((tzstr = wchar_to_utf8(tz_info.StandardName)) == NULL)) {\n\t\t\t\t\tuprintf(\"WARNING: Could not retrieve current timezone: %s\", WindowsErrorString());\n\t\t\t\t} else {\n\t\t\t\t\tfprintf(fd, \"      <TimeZone>%s</TimeZone>\\n\", tzstr);\n\t\t\t\t\tfree(tzstr);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (flags & UNATTEND_SET_USER) {\n\t\t\t\tfor (i = 0; (i < ARRAYSIZE(unallowed_account_names)) && (stricmp(unattend_username, unallowed_account_names[i]) != 0); i++);\n\t\t\t\tif (i < ARRAYSIZE(unallowed_account_names)) {\n\t\t\t\t\tuprintf(\"WARNING: '%s' is not allowed as local account name - Option ignored\", unattend_username);\n\t\t\t\t} else if (unattend_username[0] != 0) {\n\t\t\t\t\tchar* org_username = safe_strdup(unattend_username);\n\t\t\t\t\t// Per https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-useraccounts-localaccounts-localaccount-name\n\t\t\t\t\t// Add '.' to the list because some folks also reported an issue with local accounts that have dots...\n\t\t\t\t\tfilter_chars(unattend_username, \"/\\\\[]:|<>+=;,?*%@.\", '_');\n\t\t\t\t\tuprintf(\"• Use '%s' for local account name\", unattend_username);\n\t\t\t\t\tif (strcmp(org_username, unattend_username) != 0)\n\t\t\t\t\t\tuprintf(\"WARNING: Local account name contained unallowed characters and has been sanitized\");\n\t\t\t\t\tfree(org_username);\n\t\t\t\t\t// If we create a local account in unattend.xml, then we can get Windows 11\n\t\t\t\t\t// 22H2 to skip MSA even if the network is connected during installation.\n\t\t\t\t\tfprintf(fd, \"      <UserAccounts>\\n\");\n\t\t\t\t\tfprintf(fd, \"        <LocalAccounts>\\n\");\n\t\t\t\t\tfprintf(fd, \"          <LocalAccount wcm:action=\\\"add\\\">\\n\");\n\t\t\t\t\tfprintf(fd, \"            <Name>%s</Name>\\n\", unattend_username);\n\t\t\t\t\tfprintf(fd, \"            <DisplayName>%s</DisplayName>\\n\", unattend_username);\n\t\t\t\t\tfprintf(fd, \"            <Group>Administrators;Power Users</Group>\\n\");\n\t\t\t\t\t// Sets an empty password for the account (which, in Microsoft's convoluted ways,\n\t\t\t\t\t// needs to be initialized to the Base64 encoded UTF-16 string \"Password\").\n\t\t\t\t\t// The use of an empty password has both the advantage of not having to ask users\n\t\t\t\t\t// to type in a password in Rufus (which they might be weary of) as well as allowing\n\t\t\t\t\t// automated logon during setup.\n\t\t\t\t\tfprintf(fd, \"            <Password>\\n\");\n\t\t\t\t\tfprintf(fd, \"              <Value>UABhAHMAcwB3AG8AcgBkAA==</Value>\\n\");\n\t\t\t\t\tfprintf(fd, \"              <PlainText>false</PlainText>\\n\");\n\t\t\t\t\tfprintf(fd, \"            </Password>\\n\");\n\t\t\t\t\tfprintf(fd, \"          </LocalAccount>\\n\");\n\t\t\t\t\tfprintf(fd, \"        </LocalAccounts>\\n\");\n\t\t\t\t\tfprintf(fd, \"      </UserAccounts>\\n\");\n\t\t\t\t\t// Since we set a blank password, we'll ask the user to change it at next logon.\n\t\t\t\t\t// NB: In case you wanna try, please be aware that Microsoft doesn't let you have multiple\n\t\t\t\t\t// <FirstLogonCommands> sections in unattend.xml. Don't ask me how I know... :(\n\t\t\t\t\tstatic_sprintf(tmp, \"net user \\\"%s\\\" /logonpasswordchg:yes\", unattend_username);\n\t\t\t\t\tStrArrayAdd(&commands, tmp, TRUE);\n\t\t\t\t\t// The `net user` command above might reset the password expiration to 90 days...\n\t\t\t\t\t// To alleviate that, blanket set passwords on the target machine to never expire.\n\t\t\t\t\tStrArrayAdd(&commands, \"net accounts /maxpwage:unlimited\", TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Apply SkuSiPolicy.p7b, if the user requested it and we're not creating a Windows To Go drive.\n\t\t\t// See https://support.microsoft.com/kb/5042562. We do it post install, on first logon, because\n\t\t\t// we'd have to patch tons of files otherwise. And we *ALWAYS* use the installed system's\n\t\t\t// SkuSiPolicy.p7b instead of the host system's, even if the latter might be more recent, on\n\t\t\t// account that the bootloaders from the installed system might be trailing behind, and wills\n\t\t\t// produce the 0xc0000428 signature validation error on (re)boot if the system hasn't gone\n\t\t\t// through a full Windows Update cycle.\n\t\t\tif (flags & UNATTEND_APPLY_SKUSIPOLICY) {\n\t\t\t\tuprintf(\"• Apply SkuSiPolicy.p7b\");\n\t\t\t\t// TODO: Could we hide this using PowerShell?\n\t\t\t\tStrArrayAdd(&commands, \"cmd /c mountvol S: /S &amp;&amp; \"\n\t\t\t\t\t\"copy %WINDIR%\\\\system32\\\\SecureBootUpdates\\\\SkuSiPolicy.p7b S:\\\\EFI\\\\Microsoft\\\\Boot &amp;&amp; \"\n\t\t\t\t\t\"mountvol S: /D\", TRUE);\n\t\t\t}\n\t\t\tif (flags & UNATTEND_QOL_ENHANCEMENTS) {\n\t\t\t\tuprintf(\"• QoL: Disable Fast Startup, Copilot, Recommendations, News and Teams by default\");\n\t\t\t\t// Disable Fast Startup \n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKLM\\\\System\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Power\\\" \"\n\t\t\t\t\t\"/v HiberbootEnabled /t REG_DWORD /d 0 /f\", TRUE);\n\t\t\t\t// Disable Copilot and set search as an icon rather than the default real-estate gobbler\n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKCU\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Explorer\\\\Advanced\\\" \"\n\t\t\t\t\t\"/v ShowCopilotButton /t REG_DWORD /d 0 /f\", TRUE);\n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKLM\\\\Software\\\\Policies\\\\Microsoft\\\\Windows\\\\WindowsCopilot\\\" \"\n\t\t\t\t\t\"/v TurnOffWindowsCopilot /t REG_DWORD /d 1 /f\", TRUE);\n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKCU\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Search\\\" \"\n\t\t\t\t\t\"/v SearchboxTaskbarMode /t REG_DWORD /d 1 /f\", TRUE);\n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKCU\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Search\\\" \"\n\t\t\t\t\t\"/v SearchboxTaskbarModeCache /t REG_DWORD /d 1 /f\", TRUE);\n\t\t\t\t// Disable Windows Phone and similarly pushed unwanted crap\n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKLM\\\\Software\\\\Policies\\\\Microsoft\\\\Windows\\\\CloudContent\\\" \"\n\t\t\t\t\t\"/v DisableWindowsConsumerFeatures /t REG_DWORD /d 1 /f\", TRUE);\n\t\t\t\t// Disable News\n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKLM\\\\Software\\\\Policies\\\\Microsoft\\\\Dsh\\\" \"\n\t\t\t\t\t\"/v AllowNewsAndInterests /t REG_DWORD /d 0 /f\", TRUE);\n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKLM\\\\Software\\\\Policies\\\\Microsoft\\\\Windows\\\\Windows Feeds\\\" \"\n\t\t\t\t\t\"/v EnableFeeds /t REG_DWORD /d 0 /f\", TRUE);\n\t\t\t\t// Disable Teams\n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKLM\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Communications\\\" \"\n\t\t\t\t\t\"/v ConfigureChatAutoInstall /t REG_DWORD /d 0 /f\", TRUE);\n\t\t\t\t// Prevent frigging Outlook from being forced into the user's taskbar\n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKLM\\\\Software\\\\Policies\\\\Microsoft\\\\Windows\\\\CloudContent\\\" \"\n\t\t\t\t\t\"/v DisableCloudOptimizedContent /t REG_DWORD /d 1 /f\", TRUE);\n\t\t\t\t// Skip Edge's first run dialog\n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKLM\\\\Software\\\\Policies\\\\Microsoft\\\\Edge\\\" \"\n\t\t\t\t\t\"/v HideFirstRunExperience /t REG_DWORD /d 1 /f\", TRUE);\n\t\t\t\tuprintf(\"• QoL: More pins for the Start Menu and enable useful shortcuts\");\n\t\t\t\t// More pins by default on the Start Menu\n\t\t\t\t// https://learn.microsoft.com/en-us/windows/apps/develop/settings/settings-windows-11\n\t\t\t\tStrArrayAdd(&commands, \"reg add \\\"HKCU\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Explorer\\\\Advanced\\\" \"\n\t\t\t\t\t\"/v Start_Layout /t REG_DWORD /d 1 /f\", TRUE);\n\t\t\t\t// Add Documents, Downloads, Network, Personal Folder, File Explorer and Settings as start menu shortcuts\n\t\t\t\t// I wish there was a more transparent way of doing it, but Microsoft made it obscure. Oh, and for some\n\t\t\t\t// reason, feeding the full hex string through 'reg add' doesn't create the key when ran through unattend\n\t\t\t\t// (but doesn't produce an error and works post logon). PowerShell it is then...\n\t\t\t\tStrArrayAdd(&commands, \"PowerShell -NonInteractive -WindowStyle Hidden -Command \"\n\t\t\t\t\t\"\\\"Set-ItemProperty -Path 'Registry::HKEY_CURRENT_USER\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Start' \"\n\t\t\t\t\t\"-Name 'VisiblePlaces' -Value $([convert]::FromBase64String('ztU0LVr6Q0WC8iLm6vd3PC+zZ+PeiVVDv85h83sYqTe8JIo\"\n\t\t\t\t\t\"UDNaJQqCAbtm7okiCRIF1/g0IrkKL2jTtl7ZjlEqwvXRK+WhPi9ZDmAcdqLyGCHNSqlFDQp97J3ZYRlnU')) -Type 'Binary'\\\"\", TRUE);\n\t\t\t}\n\t\t\t// Now that we have all the commands to run, create the FirstLogonCommands section.\n\t\t\tfor (order = 1; order <= (int)commands.Index; order++) {\n\t\t\t\tif (order == 1)\n\t\t\t\t\tfprintf(fd, \"      <FirstLogonCommands>\\n\");\n\t\t\t\tfprintf(fd, \"        <SynchronousCommand wcm:action=\\\"add\\\">\\n\");\n\t\t\t\tfprintf(fd, \"          <Order>%d</Order>\\n\", order);\n\t\t\t\tfprintf(fd, \"          <CommandLine>%s</CommandLine>\\n\", commands.String[order - 1]);\n\t\t\t\tfprintf(fd, \"        </SynchronousCommand>\\n\");\n\t\t\t\tif (order == commands.Index)\n\t\t\t\t\tfprintf(fd, \"      </FirstLogonCommands>\\n\");\n\t\t\t}\n\t\t\tfprintf(fd, \"    </component>\\n\");\n\t\t\tStrArrayClear(&commands);\n\t\t}\n\t\tif (flags & UNATTEND_OOBE_INTERNATIONAL_MASK) {\n\t\t\tuprintf(\"• Use the same regional options as this user's\");\n\t\t\tfprintf(fd, \"    <component name=\\\"Microsoft-Windows-International-Core\\\" processorArchitecture=\\\"%s\\\" language=\\\"neutral\\\" \"\n\t\t\t\t\"xmlns:wcm=\\\"http://schemas.microsoft.com/WMIConfig/2002/State\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" \"\n\t\t\t\t\"publicKeyToken=\\\"31bf3856ad364e35\\\" versionScope=\\\"nonSxS\\\">\\n\", xml_arch_names[arch]);\n\t\t\t// What a frigging mess retreiving and trying to match the various locales\n\t\t\t// Microsoft has made. And, *NO*, the new User Language Settings have not\n\t\t\t// improved things in the slightest. They made it much worse for developers!\n\t\t\tfprintf(fd, \"      <InputLocale>%s</InputLocale>\\n\",\n\t\t\t\tReadRegistryKeyStr(REGKEY_HKCU, \"Keyboard Layout\\\\Preload\\\\1\"));\n\t\t\tfprintf(fd, \"      <SystemLocale>%s</SystemLocale>\\n\", ToLocaleName(GetSystemDefaultLCID()));\n\t\t\tfprintf(fd, \"      <UserLocale>%s</UserLocale>\\n\", ToLocaleName(GetUserDefaultLCID()));\n\t\t\tfprintf(fd, \"      <UILanguage>%s</UILanguage>\\n\", ToLocaleName(GetUserDefaultUILanguage()));\n\t\t\tfprintf(fd, \"      <UILanguageFallback>%s</UILanguageFallback>\\n\",\n\t\t\t\t// NB: Officially, this is a REG_MULTI_SZ string\n\t\t\t\tReadRegistryKeyStr(REGKEY_HKLM, \"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Nls\\\\Language\\\\InstallLanguageFallback\"));\n\t\t\tfprintf(fd, \"    </component>\\n\");\n\t\t}\n\t\tif (flags & UNATTEND_DISABLE_BITLOCKER) {\n\t\t\tuprintf(\"• Disable BitLocker\");\n\t\t\tfprintf(fd, \"    <component name=\\\"Microsoft-Windows-SecureStartup-FilterDriver\\\" processorArchitecture=\\\"%s\\\" language=\\\"neutral\\\" \"\n\t\t\t\t\"xmlns:wcm=\\\"http://schemas.microsoft.com/WMIConfig/2002/State\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" \"\n\t\t\t\t\"publicKeyToken=\\\"31bf3856ad364e35\\\" versionScope=\\\"nonSxS\\\">\\n\", xml_arch_names[arch]);\n\t\t\tfprintf(fd, \"      <PreventDeviceEncryption>true</PreventDeviceEncryption>\\n\");\n\t\t\tfprintf(fd, \"    </component>\\n\");\n\t\t\tfprintf(fd, \"    <component name=\\\"Microsoft-Windows-EnhancedStorage-Adm\\\" processorArchitecture=\\\"%s\\\" language=\\\"neutral\\\" \"\n\t\t\t\t\"xmlns:wcm=\\\"http://schemas.microsoft.com/WMIConfig/2002/State\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" \"\n\t\t\t\t\"publicKeyToken=\\\"31bf3856ad364e35\\\" versionScope=\\\"nonSxS\\\">\\n\", xml_arch_names[arch]);\n\t\t\tfprintf(fd, \"      <TCGSecurityActivationDisabled>1</TCGSecurityActivationDisabled>\\n\");\n\t\t\tfprintf(fd, \"    </component>\\n\");\n\t\t}\n\t\tfprintf(fd, \"  </settings>\\n\");\n\t}\n\n\tif (flags & UNATTEND_OFFLINE_SERVICING_MASK) {\n\t\tfprintf(fd, \"  <settings pass=\\\"offlineServicing\\\">\\n\");\n\t\tif (flags & UNATTEND_OFFLINE_INTERNAL_DRIVES) {\n\t\t\tuprintf(\"• Set internal drives offline\");\n\t\t\tfprintf(fd, \"    <component name=\\\"Microsoft-Windows-PartitionManager\\\" processorArchitecture=\\\"%s\\\" language=\\\"neutral\\\" \"\n\t\t\t\t\"xmlns:wcm=\\\"http://schemas.microsoft.com/WMIConfig/2002/State\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" \"\n\t\t\t\t\"publicKeyToken=\\\"31bf3856ad364e35\\\" versionScope=\\\"nonSxS\\\">\\n\", xml_arch_names[arch]);\n\t\t\tfprintf(fd, \"      <SanPolicy>4</SanPolicy>\\n\");\n\t\t\tfprintf(fd, \"    </component>\\n\");\n\t\t}\n\t\tif (flags & UNATTEND_FORCE_S_MODE) {\n\t\t\tuprintf(\"• Enforce S Mode\");\n\t\t\tfprintf(fd, \"    <component name=\\\"Microsoft-Windows-CodeIntegrity\\\" processorArchitecture=\\\"%s\\\" language=\\\"neutral\\\" \"\n\t\t\t\t\"xmlns:wcm=\\\"http://schemas.microsoft.com/WMIConfig/2002/State\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" \"\n\t\t\t\t\"publicKeyToken=\\\"31bf3856ad364e35\\\" versionScope=\\\"nonSxS\\\">\\n\", xml_arch_names[arch]);\n\t\t\tfprintf(fd, \"      <SkuPolicyRequired>1</SkuPolicyRequired>\\n\");\n\t\t\tfprintf(fd, \"    </component>\\n\");\n\t\t}\n\t\tfprintf(fd, \"  </settings>\\n\");\n\t}\n\n\tif (flags & UNATTEND_USE_MS2023_BOOTLOADERS)\n\t\tuprintf(\"• Use 'Windows CA 2023' signed bootloaders\");\n\n\tStrArrayDestroy(&commands);\n\tfprintf(fd, \"</unattend>\\n\");\n\tfclose(fd);\n\treturn path;\n}\n\n/// <summary>\n/// Setup and patch WinPE for Windows XP bootable USBs.\n/// </summary>\n/// <param name=\"drive_letter\">The letter identifying the target drive.</param>\n/// <returns>TRUE on success, FALSE on error.</returns>\nBOOL SetupWinPE(char drive_letter)\n{\n\tchar src[64], dst[32];\n\tconst char* basedir[3] = { \"i386\", \"amd64\", \"minint\" };\n\tconst char* patch_str_org[2] = { \"\\\\minint\\\\txtsetup.sif\", \"\\\\minint\\\\system32\\\\\" };\n\tconst char* patch_str_rep[2][2] = { { \"\\\\i386\\\\txtsetup.sif\", \"\\\\i386\\\\system32\\\\\" } ,\n\t\t\t\t\t\t\t\t\t\t{ \"\\\\amd64\\\\txtsetup.sif\", \"\\\\amd64\\\\system32\\\\\" } };\n\tconst char* setupsrcdev = \"SetupSourceDevice = \\\"\\\\device\\\\harddisk1\\\\partition1\\\"\";\n\tconst char* win_nt_bt_org = \"$win_nt$.~bt\";\n\tconst char* rdisk_zero = \"rdisk(0)\";\n\tconst LARGE_INTEGER liZero = { {0, 0} };\n\tHANDLE handle = INVALID_HANDLE_VALUE;\n\tDWORD i, j, size, read_size, index = 0;\n\tBOOL r = FALSE;\n\tchar* buffer = NULL;\n\n\tif ((img_report.winpe & WINPE_AMD64) == WINPE_AMD64)\n\t\tindex = 1;\n\telse if ((img_report.winpe & WINPE_MININT) == WINPE_MININT)\n\t\tindex = 2;\n\t// Copy of ntdetect.com in root\n\tstatic_sprintf(src, \"%c:\\\\%s\\\\ntdetect.com\", toupper(drive_letter), basedir[2 * (index / 2)]);\n\tstatic_sprintf(dst, \"%c:\\\\ntdetect.com\", toupper(drive_letter));\n\tCopyFileA(src, dst, TRUE);\n\tif (!img_report.uses_minint) {\n\t\t// Create a copy of txtsetup.sif, as we want to keep the i386/amd64 files unmodified\n\t\tstatic_sprintf(src, \"%c:\\\\%s\\\\txtsetup.sif\", toupper(drive_letter), basedir[index]);\n\t\tstatic_sprintf(dst, \"%c:\\\\txtsetup.sif\", toupper(drive_letter));\n\t\tif (!CopyFileA(src, dst, TRUE)) {\n\t\t\tuprintf(\"Did not copy %s as %s: %s\\n\", src, dst, WindowsErrorString());\n\t\t}\n\t\tif (insert_section_data(dst, \"[SetupData]\", setupsrcdev, FALSE) == NULL) {\n\t\t\tuprintf(\"Failed to add SetupSourceDevice in %s\\n\", dst);\n\t\t\tgoto out;\n\t\t}\n\t\tuprintf(\"Successfully added '%s' to %s\\n\", setupsrcdev, dst);\n\t}\n\n\tstatic_sprintf(src, \"%c:\\\\%s\\\\setupldr.bin\", toupper(drive_letter), basedir[2 * (index / 2)]);\n\tstatic_sprintf(dst, \"%c:\\\\BOOTMGR\", toupper(drive_letter));\n\tif (!CopyFileA(src, dst, TRUE)) {\n\t\tuprintf(\"Did not copy %s as %s: %s\\n\", src, dst, WindowsErrorString());\n\t}\n\n\t// \\minint with /minint option doesn't require further processing => return true\n\t// \\minint and no \\i386 without /minint is unclear => return error\n\tif (img_report.winpe & WINPE_MININT) {\n\t\tif (img_report.uses_minint) {\n\t\t\tuprintf(\"Detected \\\\minint directory with /minint option: nothing to patch\\n\");\n\t\t\tr = TRUE;\n\t\t} else if (!(img_report.winpe & (WINPE_I386 | WINPE_AMD64))) {\n\t\t\tuprintf(\"Detected \\\\minint directory only but no /minint option: not sure what to do\\n\");\n\t\t}\n\t\tgoto out;\n\t}\n\n\t// At this stage we only handle \\i386\n\thandle = CreateFileA(dst, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ,\n\t\tNULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n\tif (handle == INVALID_HANDLE_VALUE) {\n\t\tuprintf(\"Could not open %s for patching: %s\\n\", dst, WindowsErrorString());\n\t\tgoto out;\n\t}\n\tsize = GetFileSize(handle, NULL);\n\tif (size == INVALID_FILE_SIZE) {\n\t\tuprintf(\"Could not get size for file %s: %s\\n\", dst, WindowsErrorString());\n\t\tgoto out;\n\t}\n\tbuffer = (char*)malloc(size);\n\tif (buffer == NULL)\n\t\tgoto out;\n\tif ((!ReadFile(handle, buffer, size, &read_size, NULL)) || (size != read_size)) {\n\t\tuprintf(\"Could not read file %s: %s\\n\", dst, WindowsErrorString());\n\t\tgoto out;\n\t}\n\tif (!SetFilePointerEx(handle, liZero, NULL, FILE_BEGIN)) {\n\t\tuprintf(\"Could not rewind file %s: %s\\n\", dst, WindowsErrorString());\n\t\tgoto out;\n\t}\n\n\t// Patch setupldr.bin\n\tuprintf(\"Patching file %s\\n\", dst);\n\t// Remove CRC check for 32 bit part of setupldr.bin from Win2k3\n\tif ((size > 0x2061) && (buffer[0x2060] == 0x74) && (buffer[0x2061] == 0x03)) {\n\t\tbuffer[0x2060] = 0xeb;\n\t\tbuffer[0x2061] = 0x1a;\n\t\tuprintf(\"  0x00002060: 0x74 0x03 -> 0xEB 0x1A (disable Win2k3 CRC check)\\n\");\n\t}\n\tfor (i = 1; i < size - 32; i++) {\n\t\tfor (j = 0; j < ARRAYSIZE(patch_str_org); j++) {\n\t\t\tif (safe_strnicmp(&buffer[i], patch_str_org[j], strlen(patch_str_org[j]) - 1) == 0) {\n\t\t\t\tassert(index < 2);\n\t\t\t\tuprintf(\"  0x%08X: '%s' -> '%s'\\n\", i, &buffer[i], patch_str_rep[index][j]);\n\t\t\t\tstrcpy(&buffer[i], patch_str_rep[index][j]);\n\t\t\t\ti += (DWORD)max(strlen(patch_str_org[j]), strlen(patch_str_rep[index][j]));\t// in case org is a substring of rep\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!img_report.uses_minint) {\n\t\t// Additional setupldr.bin/bootmgr patching\n\t\tfor (i = 0; i < size - 32; i++) {\n\t\t\t// rdisk(0) -> rdisk(#) disk masquerading\n\t\t\t// NB: only the first one seems to be needed\n\t\t\tif (safe_strnicmp(&buffer[i], rdisk_zero, strlen(rdisk_zero) - 1) == 0) {\n\t\t\t\tbuffer[i + 6] = 0x31;\n\t\t\t\tuprintf(\"  0x%08X: '%s' -> 'rdisk(%c)'\\n\", i, rdisk_zero, buffer[i + 6]);\n\t\t\t}\n\t\t\t// $WIN_NT$_~BT -> i386/amd64\n\t\t\tif (safe_strnicmp(&buffer[i], win_nt_bt_org, strlen(win_nt_bt_org) - 1) == 0) {\n\t\t\t\tuprintf(\"  0x%08X: '%s' -> '%s%s'\\n\", i, &buffer[i], basedir[index], &buffer[i + strlen(win_nt_bt_org)]);\n\t\t\t\tstrcpy(&buffer[i], basedir[index]);\n\t\t\t\t// This ensures that we keep the terminator backslash\n\t\t\t\tbuffer[i + strlen(basedir[index])] = buffer[i + strlen(win_nt_bt_org)];\n\t\t\t\tbuffer[i + strlen(basedir[index]) + 1] = 0;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!WriteFileWithRetry(handle, buffer, size, NULL, WRITE_RETRIES)) {\n\t\tuprintf(\"Could not write patched file: %s\\n\", WindowsErrorString());\n\t\tgoto out;\n\t}\n\tr = TRUE;\n\nout:\n\tsafe_closehandle(handle);\n\tsafe_free(buffer);\n\treturn r;\n}\n\n/// <summary>\n/// Populate the img_report Window version from an install[.wim|.esd] XML index\n/// </summary>\n/// <param name=\"xml\">The index XML data.</param>\n/// <param name=\"xml_len\">The length of the index XML data.</param>\n/// <param name=\"index\">The index of the occurrence to look for.</param>\nstatic void PopulateWindowsVersionFromXml(const wchar_t* xml, size_t xml_len, int index)\n{\n\tchar* val;\n\tezxml_t pxml = ezxml_parse_str((char*)xml, xml_len);\n\tif (pxml == NULL)\n\t\treturn;\n\n\tval = ezxml_get_val(pxml, \"IMAGE\", index, \"WINDOWS\", 0, \"VERSION\", 0, \"MAJOR\", -1);\n\timg_report.win_version.major = (uint16_t)safe_atoi(val);\n\tval = ezxml_get_val(pxml, \"IMAGE\", index, \"WINDOWS\", 0, \"VERSION\", 0, \"MINOR\", -1);\n\timg_report.win_version.minor = (uint16_t)safe_atoi(val);\n\tval = ezxml_get_val(pxml, \"IMAGE\", index, \"WINDOWS\", 0, \"VERSION\", 0, \"BUILD\", -1);\n\timg_report.win_version.build = (uint16_t)safe_atoi(val);\n\tval = ezxml_get_val(pxml, \"IMAGE\", index, \"WINDOWS\", 0, \"VERSION\", 0, \"SPBUILD\", -1);\n\timg_report.win_version.revision = (uint16_t)safe_atoi(val);\n\t// Adjust versions so that we produce a more accurate report in the log\n\t// (and yeah, I know we won't properly report Server, but I don't care)\n\tif (img_report.win_version.major <= 5) {\n\t\t// Don't want to support XP or earlier\n\t\timg_report.win_version.major = 0;\n\t\timg_report.win_version.minor = 0;\n\t} else if (img_report.win_version.major == 6) {\n\t\t// Don't want to support Vista\n\t\tif (img_report.win_version.minor == 0) {\n\t\t\timg_report.win_version.major = 0;\n\t\t} else if (img_report.win_version.minor == 1) {\n\t\t\timg_report.win_version.major = 7;\n\t\t\timg_report.win_version.minor = 0;\n\t\t} else if (img_report.win_version.minor == 2) {\n\t\t\timg_report.win_version.major = 8;\n\t\t\timg_report.win_version.minor = 0;\n\t\t} else if (img_report.win_version.minor == 3) {\n\t\t\timg_report.win_version.major = 8;\n\t\t\timg_report.win_version.minor = 1;\n\t\t} else if (img_report.win_version.minor == 4) {\n\t\t\timg_report.win_version.major = 10;\n\t\t\timg_report.win_version.minor = 0;\n\t\t}\n\t} else if (img_report.win_version.major == 10) {\n\t\tif (img_report.win_version.build > 20000)\n\t\t\timg_report.win_version.major = 11;\n\t}\n\tezxml_free(pxml);\n}\n\n/// <summary>\n/// Populate the img_report Window version from an install[.wim|.esd].\n/// </summary>\n/// <param name=\"\">(none)</param>\n/// <returns>TRUE on success, FALSE if we couldn't populate the version.</returns>\nBOOL PopulateWindowsVersion(void)\n{\n\tint r;\n\tchar wim_path[4 * MAX_PATH] = \"\";\n\twchar_t* xml = NULL;\n\tsize_t xml_len;\n\tWIMStruct* wim = NULL;\n\n\tmemset(&img_report.win_version, 0, sizeof(img_report.win_version));\n\n\tassert(safe_strlen(image_path) + 1 < ARRAYSIZE(wim_path));\n\tstatic_strcpy(wim_path, image_path);\n\tif (!img_report.is_windows_img) {\n\t\tassert(safe_strlen(image_path) + safe_strlen(&img_report.wininst_path[0][3]) + 1 < ARRAYSIZE(wim_path));\n\t\tstatic_strcat(wim_path, \"|\");\n\t\tstatic_strcat(wim_path, &img_report.wininst_path[0][3]);\n\t}\n\n\tr = wimlib_open_wimU(wim_path, 0, &wim);\n\tif (r != 0) {\n\t\tuprintf(\"Could not open WIM: Error %d\", r);\n\t\tgoto out;\n\t}\n\n\tr = wimlib_get_xml_data(wim, (void**)&xml, &xml_len);\n\tif (r != 0) {\n\t\tuprintf(\"Could not read WIM XML index: Error %d\", r);\n\t\tgoto out;\n\t}\n\n\tPopulateWindowsVersionFromXml(xml, xml_len, 0);\n\nout:\n\tfree(xml);\n\twimlib_free(wim);\n\n\treturn ((img_report.win_version.major != 0) && (img_report.win_version.build != 0));\n}\n\nint GetEditions(StrArray* version_name, StrArray* version_index)\n{\n\tint i, r, n = -1;\n\tWIMStruct* wim = NULL;\n\tselection_dialog_options_t selection = { 0 };\n\tconst char* edition_suffix;\n\tchar *edition_name;\n\twchar_t wim_path[4 * MAX_PATH] = L\"\", * xml = NULL;\n\tsize_t xml_len;\n\tBOOL bNonStandard = FALSE;\n\tezxml_t index = NULL, image = NULL;\n\n\t// If we have multiple windows install images, ask the user the one to use\n\tif (img_report.wininst_index > 1) {\n\t\tStrArrayCreate(&selection.choices, 16);\n\t\tfor (i = 0; i < img_report.wininst_index; i++)\n\t\t\tStrArrayAdd(&selection.choices, &img_report.wininst_path[i][2], TRUE);\n\t\twininst_index = _log2(SelectionDialog(lmprintf(MSG_130), lmprintf(MSG_131), &selection));\n\t\tStrArrayDestroy(&selection.choices);\n\t\tif (wininst_index < 0)\n\t\t\treturn -2;\n\t\tif (wininst_index >= MAX_WININST)\n\t\t\twininst_index = 0;\n\t}\n\n\tassert(utf8_to_wchar_get_size(image_path) <= ARRAYSIZE(wim_path));\n\tutf8_to_wchar_no_alloc(image_path, wim_path, ARRAYSIZE(wim_path));\n\tif (!img_report.is_windows_img) {\n\t\twcscat(wim_path, L\"|\");\n\t\tassert(utf8_to_wchar_get_size(image_path) + utf8_to_wchar_get_size(&img_report.wininst_path[wininst_index][2]) <= ARRAYSIZE(wim_path));\n\t\tutf8_to_wchar_no_alloc(&img_report.wininst_path[wininst_index][2],\n\t\t\t&wim_path[wcslen(wim_path)], (int)ARRAYSIZE(wim_path) - wcslen(wim_path));\n\t}\n\n\tr = wimlib_open_wim(wim_path, 0, &wim);\n\tif (r != 0) {\n\t\tuprintf(\"Could not open WIM: %d\", r);\n\t\tgoto out;\n\t}\n\tr = wimlib_get_xml_data(wim, (void**)&xml, &xml_len);\n\tif (r != 0) {\n\t\tuprintf(\"Could not read WIM XML index: %d\", r);\n\t\tgoto out;\n\t}\n\n\tindex = ezxml_parse_str((char*)xml, xml_len);\n\tif (index == NULL) {\n\t\tuprintf(\"Could not parse WIM XML\");\n\t\tgoto out;\n\t}\n\n\tedition_suffix = GetEditionName(WindowsVersion.Edition);\n\tunattend_edition_index = 1;\n\tfor (n = 0, image = ezxml_child(index, \"IMAGE\");\n\t\tStrArrayAdd(version_index, ezxml_attr(image, \"INDEX\"), TRUE) >= 0;\n\t\timage = image->next, n++) {\n\t\t// Try to match this host's edition with an index from the image\n\t\tedition_name = ezxml_child_val(image, \"NAME\");\n\t\tif (edition_name != NULL) {\n\t\t\tif (strlen(edition_name) > safe_strlen(edition_suffix) &&\n\t\t\t\tstricmp(&edition_name[strlen(edition_name) - safe_strlen(edition_suffix)], edition_suffix) == 0)\n\t\t\t\tunattend_edition_index = atoi(ezxml_attr(image, \"INDEX\")) - 1;\n\t\t}\n\t\t// Some people are apparently creating *unofficial* Windows ISOs that don't have DISPLAYNAME elements.\n\t\t// If we are parsing such an ISO, try to fall back to using DESCRIPTION.\n\t\tif (StrArrayAdd(version_name, ezxml_child_val(image, \"DISPLAYNAME\"), TRUE) < 0) {\n\t\t\tif (StrArrayAdd(version_name, ezxml_child_val(image, \"DESCRIPTION\"), TRUE) < 0) {\n\t\t\t\tuprintf(\"WARNING: Could not find a description for image index %d\", n + 1);\n\t\t\t\tStrArrayAdd(version_name, \"Unknown Windows Version\", TRUE);\n\t\t\t}\n\t\t\tbNonStandard = TRUE;\n\t\t}\n\t}\n\tif (bNonStandard)\n\t\tuprintf(\"WARNING: Nonstandard Windows image (missing <DISPLAYNAME> entries)\");\n\nout:\n\tfree(xml);\n\tezxml_free(index);\n\twimlib_free(wim);\n\treturn n;\n}\n\n/// <summary>\n/// Checks which versions of Windows are available in an install image\n/// to set our extraction index. Asks the user to select one if needed.\n/// </summary>\n/// <param name=\"\">(none)</param>\n/// <returns>-2 on user cancel, -1 on other error, >=0 on success.</returns>\nint SetWinToGoIndex(void)\n{\n\tint i, r;\n\tconst char* edition_suffix;\n\tchar* edition_name;\n\tWIMStruct* wim = NULL;\n\twchar_t wim_path[4 * MAX_PATH] = L\"\", *xml = NULL;\n\tsize_t xml_len;\n\tStrArray edition_index = { 0 };\n\tBOOL bNonStandard = FALSE;\n\tezxml_t index = NULL, image = NULL;\n\tselection_dialog_options_t selection = { 0 };\n\n\t// Sanity checks\n\twintogo_index = -1;\n\twininst_index = 0;\n\tif (ComboBox_GetCurItemData(hFileSystem) != FS_NTFS)\n\t\treturn -1;\n\n\t// If we have multiple windows install images, ask the user the one to use\n\tif (img_report.wininst_index > 1) {\n\t\tStrArrayCreate(&selection.choices, 16);\n\t\tfor (i = 0; i < img_report.wininst_index; i++)\n\t\t\tStrArrayAdd(&selection.choices, &img_report.wininst_path[i][2], TRUE);\n\t\twininst_index = _log2(SelectionDialog(lmprintf(MSG_130), lmprintf(MSG_131), &selection));\n\t\tStrArrayDestroy(&selection.choices);\n\t\tif (wininst_index < 0)\n\t\t\treturn -2;\n\t\tif (wininst_index >= MAX_WININST)\n\t\t\twininst_index = 0;\n\t}\n\n\tassert(utf8_to_wchar_get_size(image_path) <= ARRAYSIZE(wim_path));\n\tutf8_to_wchar_no_alloc(image_path, wim_path, ARRAYSIZE(wim_path));\n\tif (!img_report.is_windows_img) {\n\t\twcscat(wim_path, L\"|\");\n\t\tassert(utf8_to_wchar_get_size(image_path) + utf8_to_wchar_get_size(&img_report.wininst_path[wininst_index][2]) <= ARRAYSIZE(wim_path));\n\t\tutf8_to_wchar_no_alloc(&img_report.wininst_path[wininst_index][2],\n\t\t\t&wim_path[wcslen(wim_path)], (int)ARRAYSIZE(wim_path) - wcslen(wim_path));\n\t}\n\n\tr = wimlib_open_wim(wim_path, 0, &wim);\n\tif (r != 0) {\n\t\tuprintf(\"Could not open WIM: %d\", r);\n\t\tgoto out;\n\t}\n\tr = wimlib_get_xml_data(wim, (void**)&xml, &xml_len);\n\tif (r != 0) {\n\t\tuprintf(\"Could not read WIM XML index: %d\", r);\n\t\tgoto out;\n\t}\n\n\tStrArrayCreate(&selection.choices, 16);\n\tStrArrayCreate(&edition_index, 16);\n\tindex = ezxml_parse_str((char*)xml, xml_len);\n\tif (index == NULL) {\n\t\tuprintf(\"Could not parse WIM XML\");\n\t\tgoto out;\n\t}\n\n\tedition_suffix = GetEditionName(WindowsVersion.Edition);\n\tunattend_edition_index = 1;\n\tfor (i = 0, image = ezxml_child(index, \"IMAGE\");\n\t\tStrArrayAdd(&edition_index, ezxml_attr(image, \"INDEX\"), TRUE) >= 0;\n\t\timage = image->next, i++) {\n\t\t// Try to match this host's edition with an index from the image\n\t\tedition_name = ezxml_child_val(image, \"NAME\");\n\t\tif (edition_name != NULL) {\n\t\t\tif (strlen(edition_name) > safe_strlen(edition_suffix) &&\n\t\t\t\tstricmp(&edition_name[strlen(edition_name) - safe_strlen(edition_suffix)], edition_suffix) == 0)\n\t\t\t\tunattend_edition_index = atoi(ezxml_attr(image, \"INDEX\")) - 1;\n\t\t}\n\t\t// Some people are apparently creating *unofficial* Windows ISOs that don't have DISPLAYNAME elements.\n\t\t// If we are parsing such an ISO, try to fall back to using DESCRIPTION.\n\t\tif (StrArrayAdd(&selection.choices, ezxml_child_val(image, \"DISPLAYNAME\"), TRUE) < 0) {\n\t\t\tif (StrArrayAdd(&selection.choices, ezxml_child_val(image, \"DESCRIPTION\"), TRUE) < 0) {\n\t\t\t\tuprintf(\"WARNING: Could not find a description for image index %d\", i + 1);\n\t\t\t\tStrArrayAdd(&selection.choices, \"Unknown Windows Version\", TRUE);\n\t\t\t}\n\t\t\tbNonStandard = TRUE;\n\t\t}\n\t}\n\tif (bNonStandard)\n\t\tuprintf(\"WARNING: Nonstandard Windows image (missing <DISPLAYNAME> entries)\");\n\n\tselection.mask = 1 << unattend_edition_index;\n\tif (i > 1)\n\t\t// NB: _log2 returns -2 if SelectionDialog() returns negative (user cancelled)\n\t\ti = _log2(SelectionDialog(lmprintf(MSG_291), lmprintf(MSG_292), &selection)) + 1;\n\tif (i < 0)\n\t\twintogo_index = -2;\t// Cancelled by the user\n\telse if (i == 0)\n\t\twintogo_index = 1;\n\telse\n\t\twintogo_index = atoi(edition_index.String[i - 1]);\n\tif (i > 0) {\n\t\t// re-populate the version data from the selected XML index\n\t\tPopulateWindowsVersionFromXml(xml, xml_len, i - 1);\n\t\t// If we couldn't obtain the major and build, we have a problem\n\t\tif (img_report.win_version.major == 0 || img_report.win_version.build == 0)\n\t\t\tuprintf(\"WARNING: Could not obtain version information from XML index (Nonstandard Windows image?)\");\n\t\tuprintf(\"Will use '%s' (Build: %d, Index %s) for Windows To Go\",\n\t\t\tselection.choices.String[i - 1], img_report.win_version.build, edition_index.String[i - 1]);\n\t\t// Need Windows 10 Creator Update or later for boot on REMOVABLE to work\n\t\tif ((img_report.win_version.build < 15000) && (SelectedDrive.MediaType != FixedMedia)) {\n\t\t\tif (Notification(MB_YESNO | MB_ICONWARNING, lmprintf(MSG_190), lmprintf(MSG_098)) != IDYES)\n\t\t\t\twintogo_index = -2;\n\t\t}\n\t\t// Display a notice about WppRecorder.sys for 1809 ISOs\n\t\tif (img_report.win_version.build == 17763) {\n\t\t\tnotification_info more_info;\n\t\t\tmore_info.id = MORE_INFO_URL;\n\t\t\tmore_info.url = WPPRECORDER_MORE_INFO_URL;\n\t\t\tNotificationEx(MB_ICONINFORMATION | MB_CLOSE, NULL, &more_info, lmprintf(MSG_128, \"Windows To Go\"), lmprintf(MSG_133));\n\t\t}\n\t}\n\nout:\n\tStrArrayDestroy(&selection.choices);\n\tStrArrayDestroy(&edition_index);\n\tfree(xml);\n\tezxml_free(index);\n\twimlib_free(wim);\n\treturn wintogo_index;\n}\n\n/// <summary>\n/// Setup a Windows To Go drive according to the official Microsoft instructions detailed at:\n/// https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/deployment/windows-to-go/deploy-windows-to-go\n/// Note that as opposed to the technet guide above we use bcdedit rather than 'unattend.xml'\n/// to disable the recovery environment.\n/// </summary>\n/// <param name=\"DriveIndex\">The Rufus drive index for the target media.</param>\n/// <param name=\"drive_name\">The path of the target media.</param>\n/// <param name=\"use_esp\">Whether to create an ESP on the target media.</param>\n/// <returns>TRUE on success, FALSE on error.</returns>\nBOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp)\n{\n\tchar *ms_efi = NULL, wim_path[4 * MAX_PATH], cmd[MAX_PATH];\n\tULONG cluster_size;\n\n\tuprintf(\"Windows To Go mode selected\");\n\t// Additional sanity checks\n\tif ((use_esp) && (SelectedDrive.MediaType != FixedMedia) && (WindowsVersion.BuildNumber < 15000)) {\n\t\tErrorStatus = RUFUS_ERROR(ERROR_NOT_SUPPORTED);\n\t\treturn FALSE;\n\t}\n\n\tassert(safe_strlen(image_path) < ARRAYSIZE(wim_path));\n\tstatic_strcpy(wim_path, image_path);\n\tif (!img_report.is_windows_img) {\n\t\tassert(safe_strlen(image_path) + safe_strlen(&img_report.wininst_path[wininst_index][3]) + 1 < ARRAYSIZE(wim_path));\n\t\tstatic_strcat(wim_path, \"|\");\n\t\tstatic_strcat(wim_path, &img_report.wininst_path[wininst_index][3]);\n\t}\n\n\t// Now we use the WIM API to apply that image\n\tif (!WimApplyImage(wim_path, wintogo_index, drive_name)) {\n\t\tuprintf(\"Failed to apply Windows To Go image\");\n\t\tif (!IS_ERROR(ErrorStatus))\n\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_ISO_EXTRACT));\n\t\treturn FALSE;\n\t}\n\n\tif (use_esp) {\n\t\tuprintf(\"Setting up EFI System Partition\");\n\t\t// According to Ubuntu (https://bugs.launchpad.net/ubuntu/+source/partman-efi/+bug/811485) you want to use FAT32.\n\t\t// However, you have to be careful that the cluster size needs to be greater or equal to the sector size, which\n\t\t// in turn has an impact on the minimum EFI partition size we can create (see ms_efi_size_MB in drive.c)\n\t\tif (SelectedDrive.SectorSize <= 1024)\n\t\t\tcluster_size = 1024;\n\t\telse if (SelectedDrive.SectorSize <= 4096)\n\t\t\tcluster_size = 4096;\n\t\telse\t// Go for broke\n\t\t\tcluster_size = (ULONG)SelectedDrive.SectorSize;\n\t\t// Boy do you *NOT* want to specify a label here, and spend HOURS figuring out why your EFI partition cannot boot...\n\t\t// Also, we use the Large FAT32 facility Microsoft APIs are *UTTERLY USELESS* for achieving what we want:\n\t\t// VDS cannot list ESP volumes (talk about allegedly improving on the old disk and volume APIs, only to\n\t\t// completely neuter it) and IVdsDiskPartitionMF::FormatPartitionEx(), which is what you are supposed to\n\t\t// use for ESPs, explicitly states: \"This method cannot be used to format removable media.\"\n\t\tif (!FormatPartition(DriveIndex, SelectedDrive.Partition[partition_index[PI_ESP]].Offset, cluster_size, FS_FAT32, \"\",\n\t\t\tFP_QUICK | FP_FORCE | FP_LARGE_FAT32 | FP_NO_BOOT | FP_NO_PROGRESS)) {\n\t\t\tuprintf(\"Could not format EFI System Partition\");\n\t\t\treturn FALSE;\n\t\t}\n\t\tSleep(200);\n\t\t// Need to have the ESP mounted to invoke bcdboot\n\t\tms_efi = AltMountVolume(DriveIndex, SelectedDrive.Partition[partition_index[PI_ESP]].Offset, FALSE);\n\t\tif (ms_efi == NULL) {\n\t\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_CANT_ASSIGN_LETTER));\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\n\t// We invoke the 'bcdboot' command from the host, as the one from the drive produces problems (#558)\n\t// and of course, we couldn't invoke an ARM64 'bcdboot' binary on an x86 host anyway...\n\t// Also, since Rufus should (usually) be running as a 32 bit app, on 64 bit systems, we need to use\n\t// 'C:\\Windows\\Sysnative' and not 'C:\\Windows\\System32' to invoke bcdboot, as 'C:\\Windows\\System32'\n\t// will get converted to 'C:\\Windows\\SysWOW64' behind the scenes, and there is no bcdboot.exe there.\n\tuprintf(\"Enabling boot using command:\");\n\tstatic_sprintf(cmd, \"%s\\\\bcdboot.exe %s\\\\Windows /v /f %s /s %s\", sysnative_dir, drive_name,\n\t\tHAS_BOOTMGR_BIOS(img_report) ? (HAS_BOOTMGR_EFI(img_report) ? \"ALL\" : \"BIOS\") : \"UEFI\",\n\t\t(use_esp) ? ms_efi : drive_name);\n\t// I don't believe we can ever have a stray '%' in cmd, but just in case...\n\tassert(strchr(cmd, '%') == NULL);\n\tuprintf(cmd);\n\tif (RunCommand(cmd, sysnative_dir, usb_debug) != 0) {\n\t\t// Try to continue... but report a failure\n\t\tuprintf(\"Failed to enable boot\");\n\t\tErrorStatus = RUFUS_ERROR(APPERR(ERROR_ISO_EXTRACT));\n\t}\n\n\tUpdateProgressWithInfo(OP_FILE_COPY, MSG_267, 99, 100);\n\n\t// Setting internal drives offline for Windows To Go is crucial if, for instance, you are using ReFS\n\t// on Windows 10 (therefore ReFS v3.4) and don't want a Windows 11 To Go boot to automatically\n\t// \"upgrade\" the ReFS version on all drives to v3.7, thereby preventing you from being able to mount\n\t// those volumes back on Windows 10 ever again. Yes, I have been stung by this Microsoft bullshit!\n\t// See: https://gist.github.com/0xbadfca11/da0598e47dd643d933dc#Mountability\n\tif (unattend_xml_flags & UNATTEND_OFFLINE_INTERNAL_DRIVES) {\n\t\tuprintf(\"Setting the target's internal drives offline using command:\");\n\t\t// This applies the \"offlineServicing\" section of the unattend.xml (while ignoring the other sections)\n\t\tstatic_sprintf(cmd, \"dism /Image:%s\\\\ /Apply-Unattend:%s\", drive_name, unattend_xml_path);\n\t\tuprintf(cmd);\n\t\tRunCommand(cmd, NULL, usb_debug);\n\t}\n\n\tuprintf(\"Disabling use of the Windows Recovery Environment using command:\");\n\tstatic_sprintf(cmd, \"%s\\\\bcdedit.exe /store %s\\\\EFI\\\\Microsoft\\\\Boot\\\\BCD /set {default} recoveryenabled no\",\n\t\tsysnative_dir, (use_esp) ? ms_efi : drive_name);\n\tassert(strchr(cmd, '%') == NULL);\n\tuprintf(cmd);\n\tRunCommand(cmd, sysnative_dir, usb_debug);\n\n\tUpdateProgressWithInfo(OP_FILE_COPY, MSG_267, 100, 100);\n\n\tif (use_esp) {\n\t\tSleep(200);\n\t\tAltUnmountVolume(ms_efi, FALSE);\n\t}\n\n\treturn TRUE;\n}\n\n/// <summary>\n/// Add unattend.xml to 'sources\\boot.wim' (install) or 'Windows\\Panther\\' (Windows To Go).\n/// </summary>\n/// <param name=\"drive_letter\">The letter of the drive where the \\sources\\boot.wim image resides.</param>\n/// <param name=\"flags\">A bitmap of unattend flags to apply.</param>\n/// <returns>TRUE on success, FALSE on error.</returns>\nBOOL ApplyWindowsCustomization(char drive_letter, int flags)\n// NB: Work with a copy of unattend_xml_flags as a parameter since we will modify it.\n{\n\tBOOL r = FALSE, is_hive_mounted = FALSE, update_boot_wim = FALSE;\n\tint i, wim_index = 2, wuc_index = 0, num_replaced = 0;\n\tconst char* offline_hive_name = \"RUFUS_OFFLINE_HIVE\";\n\tconst char* reg_path = \"Windows\\\\System32\\\\config\\\\SYSTEM\";\n\tconst char* efi_ex_path = \"Windows\\\\Boot\\\\EFI_EX\";\n\tconst char* fonts_ex_path = \"Windows\\\\Boot\\\\Fonts_EX\";\n\tchar boot_wim_path[] = \"?:\\\\sources\\\\boot.wim\", key_path[64];\n\tchar tmp_path[2][MAX_PATH] = { \"\", \"\" };\n\tchar appraiserres_dll_src[] = \"?:\\\\sources\\\\appraiserres.dll\";\n\tchar appraiserres_dll_dst[] = \"?:\\\\sources\\\\appraiserres.bak\";\n\tchar setup_exe[] = \"?:\\\\setup.exe\";\n\tchar setup_dll[] = \"?:\\\\setup.dll\";\n\tchar md5sum_path[] = \"?:\\\\md5sum.txt\";\n\tchar path[MAX_PATH], *rep, *tmp_dir_end;\n\tuint8_t* buf = NULL;\n\tuint16_t setup_arch;\n\tuint32_t len;\n\tHKEY hKey = NULL, hSubKey = NULL;\n\tLSTATUS status;\n\tDWORD dwDisp, dwVal = 1, dwSize;\n\tFILE* fd_md5sum;\n\tWIMStruct* wim = NULL;\n\tstruct wimlib_update_command wuc[2] = { 0 };\n\n\tassert(unattend_xml_path != NULL);\n\tuprintf(\"Applying Windows customization:\");\n\tPrintStatus(0, MSG_326);\n\tif (flags & UNATTEND_WINDOWS_TO_GO) {\n\t\tstatic_sprintf(path, \"%c:\\\\Windows\\\\Panther\", drive_letter);\n\t\tif (!CreateDirectoryA(path, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) {\n\t\t\tuprintf(\"Could not create '%s' : %s\", path, WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tstatic_sprintf(path, \"%c:\\\\Windows\\\\Panther\\\\unattend.xml\", drive_letter);\n\t\tif (!CopyFileA(unattend_xml_path, path, TRUE)) {\n\t\t\tuprintf(\"Could not create '%s' : %s\", path, WindowsErrorString());\n\t\t\tgoto out;\n\t\t}\n\t\tuprintf(\"Added '%s'\", path);\n\t} else {\n\t\tboot_wim_path[0] = drive_letter;\n\t\tif (flags & UNATTEND_WINPE_SETUP_MASK) {\n\t\t\t// Create a backup of sources\\appraiserres.dll and then create an empty file to\n\t\t\t// allow in-place upgrades without TPM/SB. Note that we need to create an empty,\n\t\t\t// appraiserres.dll otherwise setup.exe extracts its own.\n\t\t\tappraiserres_dll_src[0] = drive_letter;\n\t\t\tappraiserres_dll_dst[0] = drive_letter;\n\t\t\tif (!MoveFileExU(appraiserres_dll_src, appraiserres_dll_dst, MOVEFILE_REPLACE_EXISTING)\n\t\t\t\t&& GetLastError() != ERROR_FILE_NOT_FOUND) {\n\t\t\t\tuprintf(\"Could not rename '%s': %s\", appraiserres_dll_src, WindowsErrorString());\n\t\t\t} else {\n\t\t\t\tif (GetLastError() == ERROR_SUCCESS)\n\t\t\t\t\tuprintf(\"Renamed '%s' → '%s'\", appraiserres_dll_src, appraiserres_dll_dst);\n\t\t\t\tCloseHandle(CreateFileU(appraiserres_dll_src, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ,\n\t\t\t\t\tNULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL));\n\t\t\t\tuprintf(\"Created '%s' placeholder\", appraiserres_dll_src);\n\t\t\t\tif (validate_md5sum) {\n\t\t\t\t\tmd5sum_totalbytes -= _filesizeU(appraiserres_dll_dst);\n\t\t\t\t\tStrArrayAdd(&modified_files, appraiserres_dll_src, TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Apply the 'setup.exe' wrapper for Windows 11 24H2 in-place upgrades\n\t\t\tif (img_report.win_version.build >= 26000) {\n\t\t\t\tsetup_exe[0] = drive_letter;\n\t\t\t\tsetup_dll[0] = drive_letter;\n\t\t\t\tmd5sum_path[0] = drive_letter;\n\t\t\t\tdwSize = read_file(setup_exe, &buf);\n\t\t\t\tif (dwSize != 0) {\n\t\t\t\t\tsetup_arch = GetPeArch(buf);\n\t\t\t\t\tsafe_free(buf);\n\t\t\t\t\tif (setup_arch != IMAGE_FILE_MACHINE_AMD64 && setup_arch != IMAGE_FILE_MACHINE_ARM64) {\n\t\t\t\t\t\tuprintf(\"WARNING: Unsupported arch 0x%x -- in-place upgrade wrapper will not be added\", setup_arch);\n\t\t\t\t\t} else if (!MoveFileExU(setup_exe, setup_dll, 0)) {\n\t\t\t\t\t\tuprintf(\"Could not rename '%s': %s\", setup_exe, WindowsErrorString());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tuprintf(\"Renamed '%s' → '%s'\", setup_exe, setup_dll);\n\t\t\t\t\t\tbuf = GetResource(hMainInstance, MAKEINTRESOURCEA(setup_arch == IMAGE_FILE_MACHINE_AMD64 ? IDR_SETUP_X64 : IDR_SETUP_ARM64),\n\t\t\t\t\t\t\t_RT_RCDATA, \"setup.exe\", &dwSize, FALSE);\n\t\t\t\t\t\tif (buf == NULL) {\n\t\t\t\t\t\t\tuprintf(\"Could not access embedded 'setup.exe'\");\n\t\t\t\t\t\t} else if (write_file(setup_exe, buf, dwSize) == dwSize) {\n\t\t\t\t\t\t\tuprintf(\"Created '%s' bypass wrapper (from embedded)\", setup_exe);\n\t\t\t\t\t\t\tif (validate_md5sum) {\n\t\t\t\t\t\t\t\tif ((fd_md5sum = fopenU(md5sum_path, \"ab\")) != NULL) {\n\t\t\t\t\t\t\t\t\tfprintf(fd_md5sum, \"00000000000000000000000000000000  ./setup.dll\\n\");\n\t\t\t\t\t\t\t\t\tfclose(fd_md5sum);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tStrArrayAdd(&modified_files, setup_exe, TRUE);\n\t\t\t\t\t\t\t\tStrArrayAdd(&modified_files, setup_dll, TRUE);\n\t\t\t\t\t\t\t\tmd5sum_totalbytes += dwSize;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuprintf(\"Could not create '%s' bypass wrapper\", setup_exe);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuf = NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tUpdateProgressWithInfoForce(OP_PATCH, MSG_325, 0, PATCH_PROGRESS_TOTAL);\n\t\t// We only need to alter boot.wim if we have windowsPE data to deal with.\n\t\t// If not, we can just copy our unattend.xml in \\sources\\$OEM$\\$$\\Panther\\.\n\t\tif (flags & UNATTEND_WINPE_SETUP_MASK || flags & UNATTEND_USE_MS2023_BOOTLOADERS) {\n\t\t\tif (validate_md5sum)\n\t\t\t\tmd5sum_totalbytes -= _filesizeU(boot_wim_path);\n\t\t\t// Some \"unofficial\" ISOs have a modified boot.wim that doesn't have Windows Setup at index 2...\n\t\t\t// TODO: we could try to look for \"Microsoft Windows Setup\" in the XML DESCRIPTION to locate the index\n\t\t\twimlib_global_init(0);\n\t\t\twimlib_set_print_errors(true);\n\t\t\tupdate_boot_wim = (wimlib_open_wimU(boot_wim_path, WIMLIB_OPEN_FLAG_WRITE_ACCESS, &wim) == 0);\n\t\t\tif (!update_boot_wim) {\n\t\t\t\tuprintf(\"Could not open '%s'\", boot_wim_path);\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\t// Setup image should be index 2\n\t\t\tif (wimlib_resolve_image(wim, L\"2\") != 2) {\n\t\t\t\tuprintf(\"WARNING: This image appears to be an UNOFFICIAL Windows ISO!\");\n\t\t\t\tuprintf(\"Rufus recommends that you only use OFFICIAL retail Microsoft Windows images, such as\");\n\t\t\t\tuprintf(\"the ones that can be downloaded through the download facility of this application.\");\n\t\t\t\twim_index = 1;\n\t\t\t}\n\t\t}\n\n\t\tif (flags & UNATTEND_SECUREBOOT_TPM_MINRAM) {\n\t\t\tif (GetTempDirNameU(temp_dir, APPLICATION_NAME, 0, tmp_path[0]) == 0) {\n\t\t\t\tuprintf(\"WARNING: Could not create temp dir for registry changes\");\n\t\t\t\tgoto copy_unattend;\n\t\t\t}\n\t\t\tstatic_sprintf(tmp_path[1], \"%s\\\\SYSTEM\", tmp_path[0]);\n\t\t\t// Try to create the registry keys directly, and fallback to using unattend\n\t\t\t// if that fails (which the Windows Store version is expected to do).\n\t\t\tif (wimlib_extract_pathsU(wim, wim_index, tmp_path[0], &reg_path, 1,\n\t\t\t\t\tWIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE) != 0 ||\n\t\t\t\t!MountRegistryHive(HKEY_LOCAL_MACHINE, offline_hive_name, tmp_path[1])) {\n\t\t\t\tuprintf(\"Falling back to creating the registry keys through unattend.xml\");\n\t\t\t\tgoto copy_unattend;\n\t\t\t}\n\t\t\tUpdateProgressWithInfoForce(OP_PATCH, MSG_325, 101, PATCH_PROGRESS_TOTAL);\n\t\t\tis_hive_mounted = TRUE;\n\n\t\t\tstatic_sprintf(key_path, \"%s\\\\Setup\", offline_hive_name);\n\t\t\tstatus = RegOpenKeyExA(HKEY_LOCAL_MACHINE, key_path, 0, KEY_READ | KEY_CREATE_SUB_KEY, &hKey);\n\t\t\tif (status != ERROR_SUCCESS) {\n\t\t\t\tSetLastError(status);\n\t\t\t\tuprintf(\"Could not open 'HKLM\\\\SYSTEM\\\\Setup' registry key: %s\", WindowsErrorString());\n\t\t\t\tgoto copy_unattend;\n\t\t\t}\n\n\t\t\tstatus = RegCreateKeyExA(hKey, \"LabConfig\", 0, NULL, 0,\n\t\t\t\tKEY_SET_VALUE | KEY_QUERY_VALUE | KEY_CREATE_SUB_KEY, NULL, &hSubKey, &dwDisp);\n\t\t\tif (status != ERROR_SUCCESS) {\n\t\t\t\tSetLastError(status);\n\t\t\t\tuprintf(\"Could not create 'HKLM\\\\SYSTEM\\\\Setup\\\\LabConfig' registry key: %s\", WindowsErrorString());\n\t\t\t\tgoto copy_unattend;\n\t\t\t}\n\n\t\t\tfor (i = 0; i < ARRAYSIZE(bypass_name); i++) {\n\t\t\t\tstatus = RegSetValueExA(hSubKey, bypass_name[i], 0, REG_DWORD, (LPBYTE)&dwVal, sizeof(DWORD));\n\t\t\t\tif (status != ERROR_SUCCESS) {\n\t\t\t\t\tSetLastError(status);\n\t\t\t\t\tuprintf(\"Could not set 'HKLM\\\\SYSTEM\\\\Setup\\\\LabConfig\\\\%s' registry key: %s\",\n\t\t\t\t\t\tbypass_name[i], WindowsErrorString());\n\t\t\t\t\tgoto copy_unattend;\n\t\t\t\t}\n\t\t\t\tuprintf(\"Created 'HKLM\\\\SYSTEM\\\\Setup\\\\LabConfig\\\\%s' registry key\", bypass_name[i]);\n\t\t\t}\n\t\t\twuc[wuc_index].op = WIMLIB_UPDATE_OP_ADD;\n\t\t\twuc[wuc_index].add.fs_source_path = utf8_to_wchar(tmp_path[1]);\n\t\t\ttmp_path[1][0] = '\\0';\n\t\t\twuc[wuc_index].add.wim_target_path = L\"Windows\\\\System32\\\\config\\\\SYSTEM\";\n\t\t\twuc_index++;\n\n\t\t\t// We were successfull in creating the keys so remove this part from unattend.xml\n\t\t\tif ((flags & UNATTEND_WINPE_SETUP_MASK) == UNATTEND_SECUREBOOT_TPM_MINRAM) {\n\t\t\t\t// If this is all we used the WindowsPE pass for, then we just replace\n\t\t\t\t// '<settings pass=\"WindowsPE\">' with '<settings pass=\"disabled\">'\n\t\t\t\tif (replace_in_token_data(unattend_xml_path, \"<settings\", \"windowsPE\", \"disabled\", FALSE) == NULL)\n\t\t\t\t\tuprintf(\"WARNING: Could not disable 'WindowsPE' pass from unattend.xml\");\n\t\t\t} else {\n\t\t\t\t// Otherwise, remove the relevant section from our temporary unattend.xml\n\t\t\t\tlen = read_file(unattend_xml_path, &buf);\n\t\t\t\tif (len != 0 && removable_section[0] != 0 && removable_section[0] < len && removable_section[1] < len) {\n\t\t\t\t\tmemmove(&buf[removable_section[0]], &buf[removable_section[1]], len - removable_section[1]);\n\t\t\t\t\tlen -= removable_section[1] - removable_section[0];\n\t\t\t\t\tif (write_file(unattend_xml_path, buf, len) != len)\n\t\t\t\t\t\tuprintf(\"Failed to remove 'WindowsPE' section from unattend.xml\");\n\t\t\t\t} else {\n\t\t\t\t\tuprintf(\"Failed to remove 'WindowsPE' section from unattend.xml\");\n\t\t\t\t}\n\t\t\t\tsafe_free(buf);\n\t\t\t}\n\t\t\t// Remove the flags, since we accomplished the registry creation outside of unattend.\n\t\t\tflags &= ~UNATTEND_SECUREBOOT_TPM_MINRAM;\n\t\t\tUpdateProgressWithInfoForce(OP_PATCH, MSG_325, 102, PATCH_PROGRESS_TOTAL);\n\t\t}\n\n\tcopy_unattend:\n\t\tif (flags & UNATTEND_WINPE_SETUP_MASK) {\n\t\t\t// If we have a windowsPE section, copy the answer files to the root of boot.wim as\n\t\t\t// Autounattend.xml. This also results in that file being automatically copied over\n\t\t\t// to %WINDIR%\\Panther\\unattend.xml for later passes processing.\n\t\t\tif_assert_fails(update_boot_wim)\n\t\t\t\tgoto out;\n\t\t\twuc[wuc_index].op = WIMLIB_UPDATE_OP_ADD;\n\t\t\twuc[wuc_index].add.fs_source_path = utf8_to_wchar(unattend_xml_path);\n\t\t\twuc[wuc_index].add.wim_target_path = L\"Autounattend.xml\";\n\t\t\tuprintf(\"Added '%S' to '%s'\", wuc[wuc_index].add.wim_target_path, boot_wim_path);\n\t\t\twuc_index++;\n\t\t} else {\n\t\t\t// If there is no windowsPE section in our unattend, then copying it as Autounattend.xml on\n\t\t\t// the root of boot.wim will not work as Windows Setup does *NOT* carry Autounattend.xml into\n\t\t\t// %WINDIR%\\Panther\\unattend.xml then (See: https://github.com/pbatard/rufus/issues/1981).\n\t\t\t// So instead, copy it to \\sources\\$OEM$\\$$\\Panther\\unattend.xml on the media, as the content\n\t\t\t// of \\sources\\$OEM$\\$$\\* will get copied into %WINDIR%\\ during the file copy phase.\n\t\t\tstatic_sprintf(path, \"%c:\\\\sources\\\\$OEM$\\\\$$\\\\Panther\", drive_letter);\n\t\t\ti = SHCreateDirectoryExA(NULL, path, NULL);\n\t\t\tif (i != ERROR_SUCCESS) {\n\t\t\t\tSetLastError(i);\n\t\t\t\tuprintf(\"Error: Could not create directory '%s': %s\", path, WindowsErrorString());\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tstatic_sprintf(path, \"%c:\\\\sources\\\\$OEM$\\\\$$\\\\Panther\\\\unattend.xml\", drive_letter);\n\t\t\tif (!CopyFileU(unattend_xml_path, path, TRUE)) {\n\t\t\t\tuprintf(\"Could not create '%s': %s\", path, WindowsErrorString());\n\t\t\t\tgoto out;\n\t\t\t}\n\t\t\tuprintf(\"Created '%s'\", path);\n\t\t}\n\t\tUpdateProgressWithInfoForce(OP_PATCH, MSG_325, 103, PATCH_PROGRESS_TOTAL);\n\t}\n\n\tif (flags & UNATTEND_USE_MS2023_BOOTLOADERS) {\n\t\tif_assert_fails(update_boot_wim)\n\t\t\tgoto out;\n\t\tif (GetTempDirNameU(temp_dir, APPLICATION_NAME, 0, tmp_path[1]) == 0) {\n\t\t\tuprintf(\"WARNING: Could not create temp dir for 2023 signed UEFI bootloaders\");\n\t\t\tgoto out;\n\t\t}\n\t\t// If we have a '_EX' in the tmp name, we will have an issue\n\t\tif_assert_fails(strstr(tmp_path[1], \"_EX\") == NULL)\n\t\t\tgoto out;\n\t\t// Extract the EFI_EX and Fonts_EX files\n\t\tif (wimlib_extract_pathsU(wim, wim_index, tmp_path[1], &efi_ex_path, 1,\n\t\t\t\tWIMLIB_EXTRACT_FLAG_NO_ACLS | WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE) != 0 ||\n\t\t\twimlib_extract_pathsU(wim, wim_index, tmp_path[1], &fonts_ex_path, 1,\n\t\t\t\tWIMLIB_EXTRACT_FLAG_NO_ACLS | WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE) != 0) {\n\t\t\tuprintf(\"Could not extract 2023 signed UEFI bootloaders - Ignoring option\");\n\t\t} else {\n\t\t\tStrArray files;\n\t\t\tlen = (uint32_t)strlen(tmp_path[1]);\n\t\t\ttmp_dir_end = &tmp_path[1][len];\n\n\t\t\t// Copy/override the Font files\n\t\t\tstatic_strcat(tmp_path[1], \"\\\\Fonts_EX\");\n\t\t\tStrArrayCreate(&files, 64);\n\t\t\tListDirectoryContent(&files, tmp_path[1], LIST_DIR_TYPE_FILE);\n\t\t\tfor (i = 0; i < (int)files.Index; i++) {\n\t\t\t\tstatic_sprintf(path, \"%c:\\\\efi\\\\microsoft\\\\boot%s\", drive_letter, &files.String[i][len]);\n\t\t\t\trep = remove_substr(path, \"_EX\");\n\t\t\t\tif (!CopyFileU(files.String[i], rep, FALSE))\n\t\t\t\t\tuprintf(\"WARNING: Could not copy '%s': %s\", path, WindowsErrorString());\n\t\t\t\telse\n\t\t\t\t\tnum_replaced++;\n\t\t\t\tsafe_free(rep);\n\t\t\t}\n\t\t\tStrArrayDestroy(&files);\n\n\t\t\t// Replace /EFI/Boot/boot###.efi\n\t\t\tfor (i = 1; i < ARRAYSIZE(efi_archname); i++) {\n\t\t\t\t*tmp_dir_end = '\\0';\n\t\t\t\tstatic_strcat(tmp_path[1], \"\\\\EFI_EX\\\\bootmgfw_EX.efi\");\n\t\t\t\tstatic_sprintf(path, \"%c:\\\\efi\\\\boot\\\\boot%s.efi\", drive_letter, efi_archname[i]);\n\t\t\t\tif (!PathFileExistsA(path))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!CopyFileU(tmp_path[1], path, FALSE))\n\t\t\t\t\tuprintf(\"WARNING: Could not replace 'boot%s.efi': %s\", efi_archname[i], WindowsErrorString());\n\t\t\t\telse\n\t\t\t\t\tnum_replaced++;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Replace /bootmgr.efi\n\t\t\t*tmp_dir_end = '\\0';\n\t\t\tstatic_strcat(tmp_path[1], \"\\\\EFI_EX\\\\bootmgr_EX.efi\");\n\t\t\tstatic_sprintf(path, \"%c:\\\\bootmgr.efi\", drive_letter);\n\t\t\tif (!CopyFileU(tmp_path[1], path, FALSE))\n\t\t\t\tuprintf(\"WARNING: Could not replace 'bootmgr.efi': %s\", WindowsErrorString());\n\t\t\telse\n\t\t\t\tnum_replaced++;\n\t\t\tif (num_replaced != 0) {\n\t\t\t\tuprintf(\"Replaced %d EFI bootloader files with 'Windows UEFI CA 2023' compatible versions.\", num_replaced);\n\t\t\t\tuprintf(\"Note that to boot this media, you must have a system where the 'Windows UEFI CA 2023'\");\n\t\t\t\tuprintf(\"Secure Boot certificate has been installed.\");\n\t\t\t\tuprintf(\"If needed, this can be accomplished using Mosby [https://github.com/pbatard/Mosby],\");\n\t\t\t\tuprintf(\"which can be found, ready to use, in the UEFI Shell ISO images downloaded by Rufus.\");\n\t\t\t}\n\t\t\t*tmp_dir_end = '\\0';\t// Else we won't be able to delete the temp dir\n\t\t}\n\t}\n\n\tr = TRUE;\n\nout:\n\tif (hSubKey != NULL)\n\t\tRegCloseKey(hSubKey);\n\tif (hKey != NULL)\n\t\tRegCloseKey(hKey);\n\tif (is_hive_mounted) {\n\t\tUnmountRegistryHive(HKEY_LOCAL_MACHINE, offline_hive_name);\n\t\tUpdateProgressWithInfoForce(OP_PATCH, MSG_325, 104, PATCH_PROGRESS_TOTAL);\n\t}\n\tif (update_boot_wim) {\n\t\tuprintf(\"Updating '%s[%d]'...\", boot_wim_path, wim_index);\n\t\tif (wimlib_update_image(wim, wim_index, wuc, wuc_index, 0) != 0 ||\n\t\t\twimlib_overwrite(wim, WIMLIB_WRITE_FLAG_RECOMPRESS, 0) != 0) {\n\t\t\tuprintf(\"Error: Failed to update %s\", boot_wim_path);\n\t\t\tr = FALSE;\n\t\t}\n\t\tfor (i = 0; i < ARRAYSIZE(tmp_path); i++)\n\t\t\tif (tmp_path[i][0])\n\t\t\t\tSHDeleteDirectoryExU(NULL, tmp_path[i], FOF_NO_UI);\n\t\tfor (i = 0; i < wuc_index; i++)\n\t\t\tfree(wuc[i].add.fs_source_path);\n\t\twimlib_free(wim);\n\t\twimlib_global_cleanup();\n\t\tif (validate_md5sum) {\n\t\t\tmd5sum_totalbytes += _filesizeU(boot_wim_path);\n\t\t\tStrArrayAdd(&modified_files, boot_wim_path, TRUE);\n\t\t}\n\t\tUpdateProgressWithInfo(OP_PATCH, MSG_325, PATCH_PROGRESS_TOTAL, PATCH_PROGRESS_TOTAL);\n\t}\n\treturn r;\n}\n"
  },
  {
    "path": "src/wue.h",
    "content": "/*\n * Rufus: The Reliable USB Formatting Utility\n * Windows User Experience\n * Copyright © 2022 Pete Batard <pete@akeo.ie>\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n#include <windows.h>\n\n#pragma once\n\nextern int unattend_xml_flags, unattend_xml_mask;\nextern int wintogo_index, wininst_index;\nextern char* unattend_xml_path;\n\nchar* CreateUnattendXml(int arch, int flags);\nBOOL ApplyWindowsCustomization(char drive_letter, int flags);\nint SetWinToGoIndex(void);\nBOOL SetupWinPE(char drive_letter);\nBOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp);\nBOOL PopulateWindowsVersion(void);\n"
  },
  {
    "path": "src/xml.c",
    "content": "/* ezxml.c\n *\n * Copyright 2004-2006 Aaron Voisine <aaron@voisine.org>\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdint.h>\n#include <stdarg.h>\n#include <string.h>\n#include <ctype.h>\n#include <unistd.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include \"xml.h\"\n#include \"rufus.h\"\n#include \"msapi_utf8.h\"\n\n/* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <stdlib.h>\n#include <crtdbg.h>\n#endif\n\n#define EZXML_NOMMAP\n#define EZXML_WS   \"\\t\\r\\n \"  // whitespace\n#define EZXML_ERRL 256        // maximum error string length\n\n#ifdef _MSC_VER\n#pragma warning(disable:6011)\n#pragma warning(disable:4267)\n#endif\ntypedef struct ezxml_root *ezxml_root_t;\nstruct ezxml_root {       // additional data for the root tag\n    struct ezxml xml;     // is a super-struct built on top of ezxml struct\n    ezxml_t cur;          // current xml tree insertion point\n    char *m;              // original xml string\n    size_t len;           // length of allocated memory for mmap, -1 for malloc\n    char *u;              // UTF-8 conversion of string if original was UTF-16\n    char *s;              // start of work area\n    char *e;              // end of work area\n    char **ent;           // general entities (ampersand sequences)\n    char ***attr;         // default attributes\n    char ***pi;           // processing instructions\n    short standalone;     // non-zero if <?xml standalone=\"yes\"?>\n    char err[EZXML_ERRL]; // error string\n};\n\nchar *EZXML_NIL[] = { NULL }; // empty, null terminated array of strings\n\n// what realloc should be doing all along\nstatic inline void* _realloc(void* ptr, unsigned int size) {\n    void* old_ptr = ptr;\n    ptr = realloc(ptr, size);\n    if (ptr == NULL)\n        free(old_ptr);\n    return ptr;\n}\n\n// returns the first child tag with the given name or NULL if not found\nezxml_t ezxml_child(ezxml_t xml, const char *name)\n{\n    xml = (xml) ? xml->child : NULL;\n    while (xml && strcmp(name, xml->name)) xml = xml->sibling;\n    return xml;\n}\n\n// returns the value of the first child tag with the given name or NULL if not found\nchar* ezxml_child_val(ezxml_t xml, const char* name)\n{\n    xml = (xml) ? xml->child : NULL;\n    while (xml && strcmp(name, xml->name)) xml = xml->sibling;\n    return xml ? xml->txt : NULL;\n}\n\n// returns the Nth tag with the same name in the same subsection or NULL if not\n// found\nezxml_t ezxml_idx(ezxml_t xml, int idx)\n{\n    for (; xml && idx; idx--) xml = xml->next;\n    return xml;\n}\n\n// returns the value of the requested tag attribute or NULL if not found\nconst char *ezxml_attr(ezxml_t xml, const char *attr)\n{\n    int i = 0, j = 1;\n    ezxml_root_t root = (ezxml_root_t)xml;\n\n    if (! xml || ! xml->attr) return NULL;\n    while (xml->attr[i] && strcmp(attr, xml->attr[i])) i += 2;\n    if (xml->attr[i]) return xml->attr[i + 1]; // found attribute\n\n    while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag\n    for (i = 0; root->attr[i] && strcmp(xml->name, root->attr[i][0]); i++);\n    if (! root->attr[i]) return NULL; // no matching default attributes\n    while (root->attr[i][j] && strcmp(attr, root->attr[i][j])) j += 3;\n    return (root->attr[i][j]) ? root->attr[i][j + 1] : NULL; // found default\n}\n\n// same as ezxml_get but takes an already initialized va_list\nezxml_t ezxml_vget(ezxml_t xml, va_list ap)\n{\n    char *name = va_arg(ap, char *);\n    int idx = -1;\n\n    if (name && *name) {\n        idx = va_arg(ap, int);    \n        xml = ezxml_child(xml, name);\n    }\n    return (idx < 0) ? xml : ezxml_vget(ezxml_idx(xml, idx), ap);\n}\n\n// Traverses the xml tree to retrieve a specific subtag. Takes a variable\n// length list of tag names and indexes. The argument list must be terminated\n// by either an index of -1 or an empty string tag name. Example: \n// title = ezxml_get(library, \"shelf\", 0, \"book\", 2, \"title\", -1);\n// This retrieves the title of the 3rd book on the 1st shelf of library.\n// Returns NULL if not found.\nezxml_t ezxml_get(ezxml_t xml, ...)\n{\n    va_list ap;\n    ezxml_t r;\n\n    va_start(ap, xml);\n    r = ezxml_vget(xml, ap);\n    va_end(ap);\n    return r;\n}\n\n// Same as above but returns the text value or NULL if not found\nchar* ezxml_get_val(ezxml_t xml, ...)\n{\n    va_list ap;\n    ezxml_t r;\n\n    va_start(ap, xml);\n    r = ezxml_vget(xml, ap);\n    va_end(ap);\n    return r ? r->txt : NULL;\n}\n\n\n// returns a null terminated array of processing instructions for the given\n// target\nconst char **ezxml_pi(ezxml_t xml, const char *target)\n{\n    ezxml_root_t root = (ezxml_root_t)xml;\n    int i = 0;\n\n    if (! root) return (const char **)EZXML_NIL;\n    while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag\n    while (root->pi[i] && strcmp(target, root->pi[i][0])) i++; // find target\n    return (const char **)((root->pi[i]) ? root->pi[i] + 1 : EZXML_NIL);\n}\n\n// set an error string and return root\nezxml_t ezxml_err(ezxml_root_t root, char *s, const char *err, ...)\n{\n    va_list ap;\n    int line = 1;\n    char *t, fmt[EZXML_ERRL];\n\n    for (t = root->s; t < s; t++) if (*t == '\\n') line++;\n    snprintf(fmt, EZXML_ERRL, \"xml parsing error near line %d: %s\", line, err);\n\n    va_start(ap, err);\n    vsnprintf(root->err, EZXML_ERRL, fmt, ap);\n    va_end(ap);\n    uprintf(\"%s\", root->err);\n\n    return &root->xml;\n}\n\n// Recursively decodes entity and character references and normalizes new lines\n// ent is a null terminated array of alternating entity names and values. set t\n// to '&' for general entity decoding, '%' for parameter entity decoding, 'c'\n// for cdata sections, ' ' for attribute normalization, or '*' for non-cdata\n// attribute normalization. Returns s, or if the decoded string is longer than\n// s, returns a malloced string that must be freed.\nchar *ezxml_decode(char *s, char **ent, char t)\n{\n    char *e, *r = s, *m = s;\n    long b, c, d, l;\n\n    for (; *s; s++) { // normalize line endings\n        while (*s == '\\r') {\n            *(s++) = '\\n';\n            if (*s == '\\n') memmove(s, (s + 1), strlen(s));\n        }\n    }\n    \n    for (s = r; ; ) {\n        while (*s && *s != '&' && (*s != '%' || t != '%') && !isspace((uint8_t)*s)) s++;\n\n        if (! *s) break;\n        else if (t != 'c' && ! strncmp(s, \"&#\", 2)) { // character reference\n            if (s[2] == 'x') c = strtol(s + 3, &e, 16); // base 16\n            else c = strtol(s + 2, &e, 10); // base 10\n            if (! c || *e != ';') { s++; continue; } // not a character ref\n\n            if (c < 0x80) *(s++) = (char)c; // US-ASCII subset\n            else { // multi-byte UTF-8 sequence\n                for (b = 0, d = c; d; d /= 2) b++; // number of bits in c\n                // UTF-8 can ecode max 36 bits (standard says 21) - noop on 32 bit.\n                if (b > 36) { s++; continue; }\n                b = (b - 2) / 5; // number of bytes in payload\n                *(s++) = (char)(0xFF << (7 - b)) | (char)(c >> (6 * b)); // head\n                while (b) *(s++) = 0x80 | ((c >> (6 * --b)) & 0x3F); // payload\n            }\n\n            memmove(s, strchr(s, ';') + 1, strlen(strchr(s, ';')));\n        }\n        else if ((*s == '&' && (t == '&' || t == ' ' || t == '*')) ||\n                 (*s == '%' && t == '%')) { // entity reference\n            for (b = 0; ent[b] && strncmp(s + 1, ent[b], strlen(ent[b]));\n                 b += 2); // find entity in entity list\n\n            if (ent[b++]) { // found a match\n                if ((c = (long)strlen(ent[b])) - 1 > (e = strchr(s, ';')) - s) {\n                    l = (d = (long)(s - r)) + c + (long)(e ? strlen(e) : 0); // new length\n                    r = (r == m) ? strcpy(malloc(l), r) : _realloc(r, l);\n                    e = strchr((s = r + d), ';'); // fix up pointers\n                }\n                if (!e) return r;\n\n                memmove(s + c, e + 1, strlen(e)); // shift rest of string\n                strncpy_s(s, c, ent[b], _TRUNCATE); // copy in replacement text\n            }\n            else s++; // not a known entity\n        }\n        else if ((t == ' ' || t == '*') && isspace((uint8_t)*s)) *(s++) = ' ';\n        else s++; // no decoding needed\n    }\n\n    if (t == '*') { // normalize spaces for non-cdata attributes\n        for (s = r; *s; s++) {\n            if ((l = (long)strspn(s, \" \"))) memmove(s, s + l, strlen(s + l) + 1);\n            while (*s && *s != ' ') s++;\n        }\n        if (--s >= r && *s == ' ') *s = '\\0'; // trim any trailing space\n    }\n    return r;\n}\n\n// called when parser finds start of new tag\nvoid ezxml_open_tag(ezxml_root_t root, char *name, char **attr)\n{\n    ezxml_t xml = root->cur;\n    \n    if (xml->name) xml = ezxml_add_child(xml, name, strlen(xml->txt));\n    else xml->name = name; // first open tag\n\n    xml->attr = attr;\n    root->cur = xml; // update tag insertion point\n}\n\n// called when parser finds character content between open and closing tag\nvoid ezxml_char_content(ezxml_root_t root, char *s, size_t len, char t)\n{\n    ezxml_t xml = root->cur;\n    char *m = s;\n    size_t l;\n\n    if (! xml || ! xml->name || ! len) return; // sanity check\n\n    s[len] = '\\0'; // null terminate text (calling functions anticipate this)\n    len = strlen(s = ezxml_decode(s, root->ent, t)) + 1;\n\n    if (! *(xml->txt)) xml->txt = s; // initial character content\n    else { // allocate our own memory and make a copy\n        xml->txt = (xml->flags & EZXML_TXTM) // allocate some space\n                   ? realloc(xml->txt, (l = strlen(xml->txt)) + len)\n                   : strcpy(malloc((l = strlen(xml->txt)) + len), xml->txt);\n        strcpy(xml->txt + l, s); // add new char content\n        if (s != m) free(s); // free s if it was malloced by ezxml_decode()\n    }\n\n    if (xml->txt != m) ezxml_set_flag(xml, EZXML_TXTM);\n}\n\n// called when parser finds closing tag\nezxml_t ezxml_close_tag(ezxml_root_t root, char *name, char *s)\n{\n    if (! root->cur || ! root->cur->name || strcmp(name, root->cur->name))\n        return ezxml_err(root, s, \"unexpected closing tag </%s>\", name);\n\n    root->cur = root->cur->parent;\n    return NULL;\n}\n\n// checks for circular entity references, returns non-zero if no circular\n// references are found, zero otherwise\nint ezxml_ent_ok(char *name, char *s, char **ent)\n{\n    int i;\n\n    for (; ; s++) {\n        while (*s && *s != '&') s++; // find next entity reference\n        if (! *s) return 1;\n        if (! strncmp(s + 1, name, strlen(name))) return 0; // circular ref.\n        for (i = 0; ent[i] && strncmp(ent[i], s + 1, strlen(ent[i])); i += 2);\n        if (ent[i] && ! ezxml_ent_ok(name, ent[i + 1], ent)) return 0;\n    }\n}\n\n// called when the parser finds a processing instruction\nvoid ezxml_proc_inst(ezxml_root_t root, char *s, size_t len)\n{\n    int i = 0, j = 1;\n    char *target = s;\n\n    s[len] = '\\0'; // null terminate instruction\n    if (*(s += strcspn(s, EZXML_WS))) {\n        *s = '\\0'; // null terminate target\n        s += strspn(s + 1, EZXML_WS) + 1; // skip whitespace after target\n    }\n\n    if (! strcmp(target, \"xml\")) { // <?xml ... ?>\n        if ((s = strstr(s, \"standalone\")) && ! strncmp(s + strspn(s + 10,\n            EZXML_WS \"='\\\"\") + 10, \"yes\", 3)) root->standalone = 1;\n        return;\n    }\n\n    if (! root->pi[0]) *(root->pi = malloc(sizeof(char **))) = NULL; //first pi\n\n    while (root->pi[i] && strcmp(target, root->pi[i][0])) i++; // find target\n    if (! root->pi[i]) { // new target\n        root->pi = _realloc(root->pi, sizeof(char **) * (i + 2));\n        root->pi[i] = malloc(sizeof(char *) * 3);\n        root->pi[i][0] = target;\n        root->pi[i][1] = (char *)(root->pi[i + 1] = NULL); // terminate pi list\n        root->pi[i][2] = _strdup(\"\"); // empty document position list\n    }\n\n    while (root->pi[i][j]) j++; // find end of instruction list for this target\n    root->pi[i] = _realloc(root->pi[i], sizeof(char *) * (j + 3));\n    root->pi[i][j + 2] = _realloc(root->pi[i][j + 1], j + 1);\n    strcpy(root->pi[i][j + 2] + j - 1, (root->xml.name) ? \">\" : \"<\");\n    root->pi[i][j + 1] = NULL; // null terminate pi list for this target\n    root->pi[i][j] = s; // set instruction\n}\n\n// called when the parser finds an internal doctype subset\nshort ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len)\n{\n    char q, *c, *t, *n = NULL, *v, **ent, **pe;\n    int i, j;\n    size_t n_len, n_off;\n    \n    pe = memcpy(malloc(sizeof(EZXML_NIL)), EZXML_NIL, sizeof(EZXML_NIL));\n\n    for (s[len] = '\\0'; s; ) {\n        while (*s && *s != '<' && *s != '%') s++; // find next declaration\n\n        if (! *s) break;\n        else if (! strncmp(s, \"<!ENTITY\", 8)) { // parse entity definitions\n            c = s += strspn(s + 8, EZXML_WS) + 8; // skip white space separator\n            n = s + strspn(s, EZXML_WS \"%\"); // find name\n            n_len = strlen(n);\n            n_off = strcspn(n, EZXML_WS);\n            if(n_off >= n_len) {\n                ezxml_err(root, NULL, \"write past buffer (<!ENTITY)\");\n                break;\n            }\n            *(s = n + n_off) = ';'; // append ; to name\n\n            v = s + strspn(s + 1, EZXML_WS) + 1; // find value\n            if ((q = *(v++)) != '\"' && q != '\\'') { // skip externals\n                s = strchr(s, '>');\n                continue;\n            }\n\n            for (i = 0, ent = (*c == '%') ? pe : root->ent; ent[i]; i++);\n            ent = _realloc(ent, (i + 3) * sizeof(char *)); // space for next ent\n            if (*c == '%') pe = ent;\n            else root->ent = ent;\n\n            *(++s) = '\\0'; // null terminate name\n            if ((s = strchr(v, q))) *(s++) = '\\0'; // null terminate value\n            ent[i + 1] = ezxml_decode(v, pe, '%'); // set value\n            ent[i + 2] = NULL; // null terminate entity list\n            if (! ezxml_ent_ok(n, ent[i + 1], ent)) { // circular reference\n                if (ent[i + 1] != v) free(ent[i + 1]);\n                ezxml_err(root, v, \"circular entity declaration &%s\", n);\n                break;\n            }\n            else ent[i] = n; // set entity name\n        }\n        else if (! strncmp(s, \"<!ATTLIST\", 9)) { // parse default attributes\n            t = s + strspn(s + 9, EZXML_WS) + 9; // skip whitespace separator\n            if (! *t) { ezxml_err(root, t, \"unclosed <!ATTLIST\"); break; }\n            if (*(s = t + strcspn(t, EZXML_WS \">\")) == '>') continue;\n            else *s = '\\0'; // null terminate tag name\n            for (i = 0; n && root->attr[i] && strcmp(n, root->attr[i][0]); i++);\n\n            ++s;\n            while (*(n = s + strspn(s, EZXML_WS)) && *n != '>') {\n                if (*(s = n + strcspn(n, EZXML_WS))) *s = '\\0'; // attr name\n                else { ezxml_err(root, t, \"malformed <!ATTLIST\"); break; }\n\n                s += strspn(s + 1, EZXML_WS) + 1; // find next token\n                c = (strncmp(s, \"CDATA\", 5)) ? \"*\" : \" \"; // is it cdata?\n                if (! strncmp(s, \"NOTATION\", 8))\n                    s += strspn(s + 8, EZXML_WS) + 8;\n                s = (*s == '(') ? strchr(s, ')') : s + strcspn(s, EZXML_WS);\n                if (! s) { ezxml_err(root, t, \"malformed <!ATTLIST\"); break; }\n\n                s += strspn(s, EZXML_WS \")\"); // skip white space separator\n                if (! strncmp(s, \"#FIXED\", 6))\n                    s += strspn(s + 6, EZXML_WS) + 6;\n                if (*s == '#') { // no default value\n                    s += strcspn(s, EZXML_WS \">\") - 1;\n                    if (*c == ' ') continue; // cdata is default, nothing to do\n                    v = NULL;\n                }\n                else if ((*s == '\"' || *s == '\\'')  &&  // default value\n                         (s = strchr(v = s + 1, *s))) *s = '\\0';\n                else { ezxml_err(root, t, \"malformed <!ATTLIST\"); break; }\n\n                if (! root->attr[i]) { // new tag name\n                    root->attr = (! i) ? malloc(2 * sizeof(char **))\n                                       : _realloc(root->attr,\n                                                 (i + 2) * sizeof(char **));\n                    root->attr[i] = malloc(2 * sizeof(char *));\n                    root->attr[i][0] = t; // set tag name\n                    root->attr[i][1] = (char *)(root->attr[i + 1] = NULL);\n                }\n\n                for (j = 1; root->attr[i][j]; j += 3); // find end of list\n                root->attr[i] = _realloc(root->attr[i],\n                                        (j + 4) * sizeof(char *));\n\n                root->attr[i][j + 3] = NULL; // null terminate list\n                root->attr[i][j + 2] = c; // is it cdata?\n                root->attr[i][j + 1] = (v) ? ezxml_decode(v, root->ent, *c)\n                                           : NULL;\n                root->attr[i][j] = n; // attribute name \n            }\n        }\n        else if (! strncmp(s, \"<!--\", 4)) s = strstr(s + 4, \"-->\"); // comments\n        else if (! strncmp(s, \"<?\", 2)) { // processing instructions\n            if ((s = strstr(c = s + 2, \"?>\")))\n                ezxml_proc_inst(root, c, s++ - c);\n        }\n        else if (*s == '<') s = strchr(s, '>'); // skip other declarations\n        else if (*(s++) == '%' && ! root->standalone) break;\n    }\n\n    free(pe);\n    return ! *root->err;\n}\n\n// Converts a UTF-16 string to UTF-8. Returns a new string that must be freed\n// or NULL if no conversion was needed.\nchar *ezxml_str2utf8(char **s, size_t *len)\n{\n    char *u;\n    size_t l = 0, sl, max = *len;\n    long c, d;\n    int b, be = (**s == '\\xFE') ? 1 : (**s == '\\xFF') ? 0 : -1;\n\n    if (be == -1) return NULL; // not UTF-16\n\n    u = malloc(max);\n    for (sl = 2; sl < *len - 1; sl += 2) {\n        c = (be) ? (((*s)[sl] & 0xFF) << 8) | ((*s)[sl + 1] & 0xFF)  //UTF-16BE\n                 : (((*s)[sl + 1] & 0xFF) << 8) | ((*s)[sl] & 0xFF); //UTF-16LE\n        if (c >= 0xD800 && c <= 0xDFFF && (sl += 2) < *len - 1) { // high-half\n            d = (be) ? (((*s)[sl] & 0xFF) << 8) | ((*s)[sl + 1] & 0xFF)\n                     : (((*s)[sl + 1] & 0xFF) << 8) | ((*s)[sl] & 0xFF);\n            c = (((c & 0x3FF) << 10) | (d & 0x3FF)) + 0x10000;\n        }\n\n        while (l + 6 > max) u = _realloc(u, max += EZXML_BUFSIZE);\n        if (c < 0x80) u[l++] = (char)c; // US-ASCII subset\n        else { // multi-byte UTF-8 sequence\n            for (b = 0, d = c; d; d /= 2) b++; // bits in c\n            b = (b - 2) / 5; // bytes in payload\n            u[l++] = (char)(0xFF << (7 - b)) | (char)(c >> (6 * b)); // head\n            while (b) u[l++] = 0x80 | ((c >> (6 * --b)) & 0x3F); // payload\n        }\n    }\n    return *s = _realloc(u, *len = l);\n}\n\n// frees a tag attribute list\nvoid ezxml_free_attr(char **attr) {\n    int i = 0;\n    char *m;\n\n    if (! attr || attr == EZXML_NIL) return; // nothing to free\n    while (attr[i]) i += 2; // find end of attribute list\n    m = attr[i + 1]; // list of which names and values are malloced\n    for (i = 0; m[i]; i++) {\n        if (m[i] & EZXML_NAMEM) free(attr[i * 2]);\n        if (m[i] & EZXML_TXTM) free(attr[(i * 2) + 1]);\n    }\n    free(m);\n    free(attr);\n}\n\n// parse the given xml string and return an ezxml structure\nezxml_t ezxml_parse_str(char *s, size_t len)\n{\n    ezxml_root_t root = (ezxml_root_t)ezxml_new(NULL);\n    char q, e, *d, **attr, **a = NULL; // initialize a to avoid compile warning\n    int l, i, j;\n\n    if (!root) return NULL;\n    root->m = s;\n    if (! len) return ezxml_err(root, NULL, \"root tag missing\");\n    root->u = ezxml_str2utf8(&s, &len); // convert utf-16 to utf-8\n    root->e = (root->s = s) + len; // record start and end of work area\n    \n    e = s[len - 1]; // save end char\n    s[len - 1] = '\\0'; // turn end char into null terminator\n\n    while (*s && *s != '<') s++; // find first tag\n    if (! *s) return ezxml_err(root, s, \"root tag missing\");\n\n    for (; ; ) {\n        attr = (char **)EZXML_NIL;\n        d = ++s;\n        \n        if (isalpha(*s) || *s == '_' || *s == ':' || *s < '\\0') { // new tag\n            if (! root->cur)\n                return ezxml_err(root, d, \"markup outside of root element\");\n\n            s += strcspn(s, EZXML_WS \"/>\");\n            while (isspace((uint8_t)*s)) *(s++) = '\\0'; // null terminate tag name\n  \n            if (*s && *s != '/' && *s != '>') // find tag in default attr list\n                for (i = 0; (a = root->attr[i]) && strcmp(a[0], d); i++);\n\n            for (l = 0; *s && *s != '/' && *s != '>'; l += 2) { // new attrib\n                attr = (l) ? realloc(attr, (l + 4) * sizeof(char *))\n                           : malloc(4 * sizeof(char *)); // allocate space\n                attr[l + 3] = (l) ? realloc(attr[l + 1], (l / 2) + 2)\n                                  : malloc(2); // mem for list of maloced vals\n                strcpy(attr[l + 3] + (l / 2), \" \"); // value is not malloced\n                attr[l + 2] = NULL; // null terminate list\n                attr[l + 1] = \"\"; // temporary attribute value\n                attr[l] = s; // set attribute name\n\n                s += strcspn(s, EZXML_WS \"=/>\");\n                if (*s == '=' || isspace((uint8_t)*s)) {\n                    *(s++) = '\\0'; // null terminate tag attribute name\n                    q = *(s += strspn(s, EZXML_WS \"=\"));\n                    if (q == '\"' || q == '\\'') { // attribute value\n                        attr[l + 1] = ++s;\n                        while (*s && *s != q) s++;\n                        if (*s) *(s++) = '\\0'; // null terminate attribute val\n                        else {\n                            ezxml_free_attr(attr);\n                            return ezxml_err(root, d, \"missing %c\", q);\n                        }\n\n                        for (j = 1; a && a[j] && strcmp(a[j], attr[l]); j +=3);\n                        attr[l + 1] = ezxml_decode(attr[l + 1], root->ent, (a\n                                                   && a[j]) ? *a[j + 2] : ' ');\n                        if (attr[l + 1] < d || attr[l + 1] > s)\n                            attr[l + 3][l / 2] = EZXML_TXTM; // value malloced\n                    }\n                }\n                while (isspace((uint8_t)*s)) s++;\n            }\n\n            if (*s == '/') { // self closing tag\n                *(s++) = '\\0';\n                if ((*s && *s != '>') || (! *s && e != '>')) {\n                    if (l) ezxml_free_attr(attr);\n                    return ezxml_err(root, d, \"missing >\");\n                }\n                ezxml_open_tag(root, d, attr);\n                ezxml_close_tag(root, d, s);\n            }\n            else if ((q = *s) == '>' || (! *s && e == '>')) { // open tag\n                *s = '\\0'; // temporarily null terminate tag name\n                ezxml_open_tag(root, d, attr);\n                *s = q;\n            }\n            else {\n                if (l) ezxml_free_attr(attr);\n                return ezxml_err(root, d, \"missing >\"); \n            }\n        }\n        else if (*s == '/') { // close tag\n            s += strcspn(d = s + 1, EZXML_WS \">\") + 1;\n            if (! (q = *s) && e != '>') return ezxml_err(root, d, \"missing >\");\n            *s = '\\0'; // temporarily null terminate tag name\n            if (ezxml_close_tag(root, d, s)) return &root->xml;\n            if (isspace((uint8_t)(*s = q))) s += strspn(s, EZXML_WS);\n        }\n        else if (! strncmp(s, \"!--\", 3)) { // xml comment\n            if (! (s = strstr(s + 3, \"--\")) || (*(s += 2) != '>' && *s) ||\n                (! *s && e != '>')) return ezxml_err(root, d, \"unclosed <!--\");\n        }\n        else if (! strncmp(s, \"![CDATA[\", 8)) { // cdata\n            if ((s = strstr(s, \"]]>\")))\n                ezxml_char_content(root, d + 8, (s += 2) - d - 10, 'c');\n            else return ezxml_err(root, d, \"unclosed <![CDATA[\");\n        }\n        else if (! strncmp(s, \"!DOCTYPE\", 8)) { // dtd\n            for (l = 0; *s && ((! l && *s != '>') || (l && (*s != ']' || \n                 *(s + strspn(s + 1, EZXML_WS) + 1) != '>')));\n                 l = (*s == '[') ? 1 : l) s += strcspn(s + 1, \"[]>\") + 1;\n            if (! *s && e != '>')\n                return ezxml_err(root, d, \"unclosed <!DOCTYPE\");\n            d = (l) ? strchr(d, '[') + 1 : d;\n            if (l && ! ezxml_internal_dtd(root, d, s++ - d)) return &root->xml;\n        }\n        else if (*s == '?') { // <?...?> processing instructions\n            do { s = strchr(s, '?'); } while (s && *(++s) && *s != '>');\n            if (! s || (! *s && e != '>')) \n                return ezxml_err(root, d, \"unclosed <?\");\n            else ezxml_proc_inst(root, d + 1, s - d - 2);\n        }\n        else return ezxml_err(root, d, \"unexpected <\");\n        \n        if (! s || ! *s) break;\n        *s = '\\0';\n        d = ++s;\n        if (*s && *s != '<') { // tag character content\n            while (*s && *s != '<') s++;\n            if (*s) ezxml_char_content(root, d, s - d, '&');\n            else break;\n        }\n        else if (! *s) break;\n    }\n\n    if (! root->cur) return &root->xml;\n    else if (! root->cur->name) return ezxml_err(root, d, \"root tag missing\");\n    else return ezxml_err(root, d, \"unclosed tag <%s>\", root->cur->name);\n}\n\n// Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire\n// stream into memory and then parses it. For xml files, use ezxml_parse_file()\n// or ezxml_parse_fd()\nezxml_t ezxml_parse_fp(FILE *fp)\n{\n    ezxml_root_t root;\n    size_t l, len = 0;\n    char *s;\n\n    if (! (s = malloc(EZXML_BUFSIZE))) return NULL;\n    do {\n        len += (l = fread((s + len), 1, EZXML_BUFSIZE, fp));\n        if (l == EZXML_BUFSIZE) s = _realloc(s, len + EZXML_BUFSIZE);\n    } while (s && l == EZXML_BUFSIZE);\n\n    if (! s) return NULL;\n    if (!(root = (ezxml_root_t)ezxml_parse_str(s, len))) { free(s); return NULL; };\n    root->len = -1; // so we know to free s in ezxml_free()\n    return &root->xml;\n}\n\n// A wrapper for ezxml_parse_str() that accepts a file descriptor. First\n// attempts to mem map the file. Failing that, reads the file into memory.\n// Returns NULL on failure.\nezxml_t ezxml_parse_fd(int fd)\n{\n    ezxml_root_t root;\n    struct stat st;\n    ssize_t l;\n    void *m;\n\n    if (fd < 0 || fstat(fd, &st)) return NULL;\n\n#ifndef EZXML_NOMMAP\n    l = (st.st_size + sysconf(_SC_PAGESIZE) - 1) & ~(sysconf(_SC_PAGESIZE) -1);\n    if ((m = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0)) !=\n        MAP_FAILED) {\n        madvise(m, l, MADV_SEQUENTIAL); // optimize for sequential access\n        root = (ezxml_root_t)ezxml_parse_str(m, st.st_size);\n        if (!root) { munmap(m,l); return NULL; };\n        madvise(m, root->len = l, MADV_NORMAL); // put it back to normal\n    }\n    else { // mmap failed, read file into memory\n#endif // EZXML_NOMMAP\n        l = (ssize_t)_read(fd, m = malloc((size_t)st.st_size), (unsigned int)st.st_size);\n        if (l < 0) { free(m); return NULL; };\n        root = (ezxml_root_t)ezxml_parse_str(m, l);\n        if (!root) { free(m); return NULL; };\n        root->len = -1; // so we know to free s in ezxml_free()\n#ifndef EZXML_NOMMAP\n    }\n#endif // EZXML_NOMMAP\n    return &root->xml;\n}\n\n// a wrapper for ezxml_parse_fd that accepts a file name\nezxml_t ezxml_parse_file(const char *file)\n{\n    int fd = _openU(file, O_RDONLY, 0);\n    ezxml_t xml = ezxml_parse_fd(fd);\n    \n    if (fd >= 0) _close(fd);\n    return xml;\n}\n\n// Encodes ampersand sequences appending the results to *dst, reallocating *dst\n// if length excedes max. a is non-zero for attribute encoding. Returns *dst\nchar *ezxml_ampencode(const char *s, ssize_t len, char **dst, size_t *dlen,\n                      size_t *max, short a)\n{\n    const char *e;\n    \n    for (e = s + len; s != e; s++) {\n        while (*dlen + 10 > *max) *dst = _realloc(*dst, *max += EZXML_BUFSIZE);\n\n        switch (*s) {\n        case '\\0': return *dst;\n        case '&': *dlen += sprintf(*dst + *dlen, \"&amp;\"); break;\n        case '<': *dlen += sprintf(*dst + *dlen, \"&lt;\"); break;\n        case '>': *dlen += sprintf(*dst + *dlen, \"&gt;\"); break;\n        case '\"': *dlen += sprintf(*dst + *dlen, (a) ? \"&quot;\" : \"\\\"\"); break;\n        case '\\n': *dlen += sprintf(*dst + *dlen, (a) ? \"&#xA;\" : \"\\n\"); break;\n        case '\\t': *dlen += sprintf(*dst + *dlen, (a) ? \"&#x9;\" : \"\\t\"); break;\n        case '\\r': *dlen += sprintf(*dst + *dlen, \"&#xD;\"); break;\n        default: (*dst)[(*dlen)++] = *s;\n        }\n    }\n    return *dst;\n}\n\n// Recursively converts each tag to xml appending it to *s. Reallocates *s if\n// its length excedes max. start is the location of the previous tag in the\n// parent tag's character content. Returns *s.\nchar *ezxml_toxml_r(ezxml_t xml, char **s, size_t *len, size_t *max,\n                    size_t start, char ***attr)\n{\n    int i, j;\n    char *txt = (xml->parent) ? xml->parent->txt : \"\";\n    size_t off = 0;\n\n    // parent character content up to this tag\n    *s = ezxml_ampencode(txt + start, xml->off - start, s, len, max, 0);\n\n    while (*len + strlen(xml->name) + 4 > *max) // reallocate s\n        *s = _realloc(*s, *max += EZXML_BUFSIZE);\n\n    *len += sprintf(*s + *len, \"<%s\", xml->name); // open tag\n    for (i = 0; xml->attr[i]; i += 2) { // tag attributes\n        if (ezxml_attr(xml, xml->attr[i]) != xml->attr[i + 1]) continue;\n        while (*len + strlen(xml->attr[i]) + 7 > *max) // reallocate s\n            *s = _realloc(*s, *max += EZXML_BUFSIZE);\n\n        *len += sprintf(*s + *len, \" %s=\\\"\", xml->attr[i]);\n        ezxml_ampencode(xml->attr[i + 1], -1, s, len, max, 1);\n        *len += sprintf(*s + *len, \"\\\"\");\n    }\n\n    for (i = 0; attr[i] && strcmp(attr[i][0], xml->name); i++);\n    for (j = 1; attr[i] && attr[i][j]; j += 3) { // default attributes\n        if (! attr[i][j + 1] || ezxml_attr(xml, attr[i][j]) != attr[i][j + 1])\n            continue; // skip duplicates and non-values\n        while (*len + strlen(attr[i][j]) + 7 > *max) // reallocate s\n            *s = _realloc(*s, *max += EZXML_BUFSIZE);\n\n        *len += sprintf(*s + *len, \" %s=\\\"\", attr[i][j]);\n        ezxml_ampencode(attr[i][j + 1], -1, s, len, max, 1);\n        *len += sprintf(*s + *len, \"\\\"\");\n    }\n    *len += sprintf(*s + *len, \">\");\n\n    *s = (xml->child) ? ezxml_toxml_r(xml->child, s, len, max, 0, attr) //child\n                      : ezxml_ampencode(xml->txt, -1, s, len, max, 0);  //data\n    \n    while (*len + strlen(xml->name) + 4 > *max) // reallocate s\n        *s = _realloc(*s, *max += EZXML_BUFSIZE);\n\n    *len += sprintf(*s + *len, \"</%s>\", xml->name); // close tag\n\n    while (txt[off] && off < xml->off) off++; // make sure off is within bounds\n    return (xml->ordered) ? ezxml_toxml_r(xml->ordered, s, len, max, off, attr)\n                          : ezxml_ampencode(txt + off, -1, s, len, max, 0);\n}\n\n// Converts an ezxml structure back to xml. Returns a string of xml data that\n// must be freed.\nchar *ezxml_toxml(ezxml_t xml)\n{\n    ezxml_t p = (xml) ? xml->parent : NULL, o = (xml) ? xml->ordered : NULL;\n    ezxml_root_t root = (ezxml_root_t)xml;\n    size_t len = 0, max = EZXML_BUFSIZE;\n    char *s = malloc(max), *t, *n;\n    int i, j, k;\n\n    if (!s) return (NULL);\n    s = strcpy(s, \"\");\n    if (! xml || ! xml->name) return _realloc(s, len + 1);\n    while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag\n\n    for (i = 0; ! p && root->pi[i]; i++) { // pre-root processing instructions\n        for (k = 2; root->pi[i][k - 1]; k++);\n        for (j = 1; (n = root->pi[i][j]); j++) {\n            if (root->pi[i][k][j - 1] == '>') continue; // not pre-root\n            while (len + strlen(t = root->pi[i][0]) + strlen(n) + 7 > max)\n                s = _realloc(s, max += EZXML_BUFSIZE);\n            len += sprintf(s + len, \"<?%s%s%s?>\\n\", t, *n ? \" \" : \"\", n);\n        }\n    }\n\n    xml->parent = xml->ordered = NULL;\n    s = ezxml_toxml_r(xml, &s, &len, &max, 0, root->attr);\n    xml->parent = p;\n    xml->ordered = o;\n\n    for (i = 0; ! p && root->pi[i]; i++) { // post-root processing instructions\n        for (k = 2; root->pi[i][k - 1]; k++);\n        for (j = 1; (n = root->pi[i][j]); j++) {\n            if (root->pi[i][k][j - 1] == '<') continue; // not post-root\n            while (len + strlen(t = root->pi[i][0]) + strlen(n) + 7 > max)\n                s = _realloc(s, max += EZXML_BUFSIZE);\n            len += sprintf(s + len, \"\\n<?%s%s%s?>\", t, *n ? \" \" : \"\", n);\n        }\n    }\n    return _realloc(s, len + 1);\n}\n\n// free the memory allocated for the ezxml structure\nvoid ezxml_free(ezxml_t xml)\n{\n    ezxml_root_t root = (ezxml_root_t)xml;\n    int i, j;\n    char **a, *s;\n\n    if (! xml) return;\n    ezxml_free(xml->child);\n    ezxml_free(xml->ordered);\n\n    if (! xml->parent) { // free root tag allocations\n        for (i = 10; root->ent[i]; i += 2) // 0 - 9 are default entites (<>&\"')\n            if ((s = root->ent[i + 1]) < root->s || s > root->e) free(s);\n        free(root->ent); // free list of general entities\n\n        for (i = 0; (a = root->attr[i]); i++) {\n            for (j = 1; a[j++]; j += 2) // free malloced attribute values\n                if (a[j] && (a[j] < root->s || a[j] > root->e)) free(a[j]);\n            free(a);\n        }\n        if (root->attr[0]) free(root->attr); // free default attribute list\n\n        for (i = 0; root->pi[i]; i++) {\n            for (j = 1; root->pi[i][j]; j++);\n            free(root->pi[i][j + 1]);\n            free(root->pi[i]);\n        }            \n        if (root->pi[0]) free(root->pi); // free processing instructions\n\n        if (root->len == -1) free(root->m); // malloced xml data\n#ifndef EZXML_NOMMAP\n        else if (root->len) munmap(root->m, root->len); // mem mapped xml data\n#endif // EZXML_NOMMAP\n        if (root->u) free(root->u); // utf8 conversion\n    }\n\n    ezxml_free_attr(xml->attr); // tag attributes\n    if ((xml->flags & EZXML_TXTM)) free(xml->txt); // character content\n    if ((xml->flags & EZXML_NAMEM)) free(xml->name); // tag name\n    free(xml);\n}\n\n// return parser error message or empty string if none\nconst char *ezxml_error(ezxml_t xml)\n{\n    while (xml && xml->parent) xml = xml->parent; // find root tag\n    return (xml) ? ((ezxml_root_t)xml)->err : \"\";\n}\n\n// returns a new empty ezxml structure with the given root tag name\nezxml_t ezxml_new(const char *name)\n{\n    static char *ent[] = { \"lt;\", \"&#60;\", \"gt;\", \"&#62;\", \"quot;\", \"&#34;\",\n                           \"apos;\", \"&#39;\", \"amp;\", \"&#38;\", NULL };\n    ezxml_root_t root;\n    char **p_ent;\n    if (!(root  = malloc(sizeof(struct ezxml_root)))) return NULL;\n    if (!(p_ent = malloc(sizeof(ent)))) { free(root); return NULL; };\n    root = (ezxml_root_t)memset(root, '\\0', sizeof(struct ezxml_root));\n    root->xml.name = (char *)name;\n    root->cur = &root->xml;\n    strcpy(root->err, root->xml.txt = \"\");\n    root->ent = memcpy(p_ent, ent, sizeof(ent));\n    root->attr = root->pi = (char ***)(root->xml.attr = EZXML_NIL);\n    return &root->xml;\n}\n\n// inserts an existing tag into an ezxml structure\nezxml_t ezxml_insert(ezxml_t xml, ezxml_t dest, size_t off)\n{\n    ezxml_t cur, prev, head;\n\n    xml->next = xml->sibling = xml->ordered = NULL;\n    xml->off = off;\n    xml->parent = dest;\n\n    if ((head = dest->child)) { // already have sub tags\n        if (head->off <= off) { // not first subtag\n            for (cur = head; cur->ordered && cur->ordered->off <= off;\n                 cur = cur->ordered);\n            xml->ordered = cur->ordered;\n            cur->ordered = xml;\n        }\n        else { // first subtag\n            xml->ordered = head;\n            dest->child = xml;\n        }\n\n        for (cur = head, prev = NULL; cur && strcmp(cur->name, xml->name);\n             prev = cur, cur = cur->sibling); // find tag type\n        if (cur && cur->off <= off) { // not first of type\n            while (cur->next && cur->next->off <= off) cur = cur->next;\n            xml->next = cur->next;\n            cur->next = xml;\n        }\n        else { // first tag of this type\n            if (prev && cur) prev->sibling = cur->sibling; // remove old first\n            xml->next = cur; // old first tag is now next\n            for (cur = head, prev = NULL; cur && cur->off <= off;\n                 prev = cur, cur = cur->sibling); // new sibling insert point\n            xml->sibling = cur;\n            if (prev) prev->sibling = xml;\n        }\n    }\n    else dest->child = xml; // only sub tag\n\n    return xml;\n}\n\n// Adds a child tag. off is the offset of the child tag relative to the start\n// of the parent tag's character content. Returns the child tag.\nezxml_t ezxml_add_child(ezxml_t xml, const char *name, size_t off)\n{\n    ezxml_t child;\n\n    if (! xml) return NULL;\n    child = (ezxml_t)memset(malloc(sizeof(struct ezxml)), '\\0',\n                            sizeof(struct ezxml));\n    child->name = (char *)name;\n    child->attr = EZXML_NIL;\n    child->txt = \"\";\n\n    return ezxml_insert(child, xml, off);\n}\n\n// sets the character content for the given tag and returns the tag\nezxml_t ezxml_set_txt(ezxml_t xml, const char *txt)\n{\n    if (! xml) return NULL;\n    if (xml->flags & EZXML_TXTM) free(xml->txt); // existing txt was malloced\n    xml->flags &= ~EZXML_TXTM;\n    xml->txt = (char *)txt;\n    return xml;\n}\n\n// Sets the given tag attribute or adds a new attribute if not found. A value\n// of NULL will remove the specified attribute. Returns the tag given.\nezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value)\n{\n    int l = 0, c;\n\n    if (! xml) return NULL;\n    while (xml->attr[l] && strcmp(xml->attr[l], name)) l += 2;\n    if (! xml->attr[l]) { // not found, add as new attribute\n        if (! value) return xml; // nothing to do\n        if (xml->attr == EZXML_NIL) { // first attribute\n            if (l >= 1) return NULL;\n            xml->attr = malloc(4 * sizeof(char *));\n            xml->attr[1] = _strdup(\"\"); // empty list of malloced names/vals\n        }\n        else xml->attr = _realloc(xml->attr, (l + 4) * sizeof(char *));\n\n        xml->attr[l] = (char *)name; // set attribute name\n        xml->attr[l + 2] = NULL; // null terminate attribute list\n        xml->attr[l + 3] = realloc(xml->attr[l + 1],\n                                   (c =(long)strlen(xml->attr[l + 1])) + 2);\n        if (!xml->attr[l + 3]) return NULL;\n        strcpy(xml->attr[l + 3] + c, \" \"); // set name/value as not malloced\n        if (xml->flags & EZXML_DUP) xml->attr[l + 3][c] = EZXML_NAMEM;\n    }\n    else if (xml->flags & EZXML_DUP) free((char *)name); // name was strduped\n\n    for (c = l; xml->attr[c]; c += 2); // find end of attribute list\n    if (xml->attr[c + 1][l / 2] & EZXML_TXTM) free(xml->attr[l + 1]); //old val\n    if (xml->flags & EZXML_DUP) xml->attr[c + 1][l / 2] |= EZXML_TXTM;\n    else xml->attr[c + 1][l / 2] &= ~EZXML_TXTM;\n\n    if (value) xml->attr[l + 1] = (char *)value; // set attribute value\n    else { // remove attribute\n        if (xml->attr[c + 1][l / 2] & EZXML_NAMEM) free(xml->attr[l]);\n        memmove(xml->attr + l, xml->attr + l + 2, (c - l + 2) * sizeof(char*));\n        xml->attr = _realloc(xml->attr, (c + 2) * sizeof(char *));\n        memmove(xml->attr[c + 1] + (l / 2), xml->attr[c + 1] + (l / 2) + 1,\n                (c / 2) - (l / 2)); // fix list of which name/vals are malloced\n    }\n    xml->flags &= ~EZXML_DUP; // clear strdup() flag\n    return xml;\n}\n\n// sets a flag for the given tag and returns the tag\nezxml_t ezxml_set_flag(ezxml_t xml, short flag)\n{\n    if (xml) xml->flags |= flag;\n    return xml;\n}\n\n// removes a tag along with its subtags without freeing its memory\nezxml_t ezxml_cut(ezxml_t xml)\n{\n    ezxml_t cur;\n\n    if (! xml) return NULL; // nothing to do\n    if (xml->next) xml->next->sibling = xml->sibling; // patch sibling list\n\n    if (xml->parent) { // not root tag\n        cur = xml->parent->child; // find head of subtag list\n        if (cur == xml) xml->parent->child = xml->ordered; // first subtag\n        else { // not first subtag\n            while (cur->ordered != xml) cur = cur->ordered;\n            cur->ordered = cur->ordered->ordered; // patch ordered list\n\n            cur = xml->parent->child; // go back to head of subtag list\n            if (strcmp(cur->name, xml->name)) { // not in first sibling list\n                while (strcmp(cur->sibling->name, xml->name))\n                    cur = cur->sibling;\n                if (cur->sibling == xml) { // first of a sibling list\n                    cur->sibling = (xml->next) ? xml->next\n                                               : cur->sibling->sibling;\n                }\n                else cur = cur->sibling; // not first of a sibling list\n            }\n\n            while (cur->next && cur->next != xml) cur = cur->next;\n            if (cur->next) cur->next = cur->next->next; // patch next list\n        }        \n    }\n    xml->ordered = xml->sibling = xml->next = NULL;\n    return xml;\n}\n\n#ifdef EZXML_TEST // test harness\nint main(int argc, char **argv)\n{\n    ezxml_t xml;\n    char *s;\n    int i;\n\n    if (argc != 2) return fprintf(stderr, \"usage: %s xmlfile\\n\", argv[0]);\n\n    xml = ezxml_parse_file(argv[1]);\n    s = ezxml_toxml(xml);\n    if (s) { printf(\"%s\\n\", s); free(s); }\n    i = fprintf(stderr, \"%s\", ezxml_error(xml));\n    ezxml_free(xml);\n    return (i) ? 1 : 0;\n}\n#endif // EZXML_TEST\n"
  },
  {
    "path": "src/xml.h",
    "content": "/* ezxml.h\n *\n * Copyright 2004-2006 Aaron Voisine <aaron@voisine.org>\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#ifndef _EZXML_H\n#define _EZXML_H\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <stdarg.h>\n#include <fcntl.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define EZXML_BUFSIZE 1024 // size of internal memory buffers\n#define EZXML_NAMEM   0x80 // name is malloced\n#define EZXML_TXTM    0x40 // txt is malloced\n#define EZXML_DUP     0x20 // attribute name and value are strduped\n\ntypedef struct ezxml *ezxml_t;\nstruct ezxml {\n    char *name;      // tag name\n    char **attr;     // tag attributes { name, value, name, value, ... NULL }\n    char *txt;       // tag character content, empty string if none\n    size_t off;      // tag offset from start of parent tag character content\n    ezxml_t next;    // next tag with same name in this section at this depth\n    ezxml_t sibling; // next tag with different name in same section and depth\n    ezxml_t ordered; // next tag, same section and depth, in original order\n    ezxml_t child;   // head of sub tag list, NULL if none\n    ezxml_t parent;  // parent tag, NULL if current tag is root tag\n    short flags;     // additional information\n};\n\n// Given a string of xml data and its length, parses it and creates an ezxml\n// structure. For efficiency, modifies the data by adding null terminators\n// and decoding ampersand sequences. If you don't want this, copy the data and\n// pass in the copy. Returns NULL on failure.\nezxml_t ezxml_parse_str(char *s, size_t len);\n\n// A wrapper for ezxml_parse_str() that accepts a file descriptor. First\n// attempts to mem map the file. Failing that, reads the file into memory.\n// Returns NULL on failure.\nezxml_t ezxml_parse_fd(int fd);\n\n// a wrapper for ezxml_parse_fd() that accepts a file name\nezxml_t ezxml_parse_file(const char *file);\n    \n// Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire\n// stream into memory and then parses it. For xml files, use ezxml_parse_file()\n// or ezxml_parse_fd()\nezxml_t ezxml_parse_fp(FILE *fp);\n\n// returns the first child tag (one level deeper) with the given name or NULL\n// if not found\nezxml_t ezxml_child(ezxml_t xml, const char *name);\n\n// returns the value of the first child tag (one level deeper) with the given\n// name or NULL if not found\nchar* ezxml_child_val(ezxml_t xml, const char* name);\n\n// returns the next tag of the same name in the same section and depth or NULL\n// if not found\n#define ezxml_next(xml) ((xml) ? xml->next : NULL)\n\n// Returns the Nth tag with the same name in the same section at the same depth\n// or NULL if not found. An index of 0 returns the tag given.\nezxml_t ezxml_idx(ezxml_t xml, int idx);\n\n// returns the name of the given tag\n#define ezxml_name(xml) ((xml) ? xml->name : NULL)\n\n// returns the given tag's character content or empty string if none\n#define ezxml_txt(xml) ((xml) ? xml->txt : \"\")\n\n// returns the value of the requested tag attribute, or NULL if not found\nconst char *ezxml_attr(ezxml_t xml, const char *attr);\n\n// Traverses the ezxml sturcture to retrieve a specific subtag. Takes a\n// variable length list of tag names and indexes. The argument list must be\n// terminated by either an index of -1 or an empty string tag name. Example: \n// title = ezxml_get(library, \"shelf\", 0, \"book\", 2, \"title\", -1);\n// This retrieves the title of the 3rd book on the 1st shelf of library.\n// Returns NULL if not found.\nezxml_t ezxml_get(ezxml_t xml, ...);\n\n// Same as above but returns the text value or NULL if not found\nchar* ezxml_get_val(ezxml_t xml, ...);\n\n// Converts an ezxml structure back to xml. Returns a string of xml data that\n// must be freed.\nchar *ezxml_toxml(ezxml_t xml);\n\n// returns a NULL terminated array of processing instructions for the given\n// target\nconst char **ezxml_pi(ezxml_t xml, const char *target);\n\n// frees the memory allocated for an ezxml structure\nvoid ezxml_free(ezxml_t xml);\n    \n// returns parser error message or empty string if none\nconst char *ezxml_error(ezxml_t xml);\n\n// returns a new empty ezxml structure with the given root tag name\nezxml_t ezxml_new(const char *name);\n\n// wrapper for ezxml_new() that strdup()s name\n#define ezxml_new_d(name) ezxml_set_flag(ezxml_new(strdup(name)), EZXML_NAMEM)\n\n// Adds a child tag. off is the offset of the child tag relative to the start\n// of the parent tag's character content. Returns the child tag.\nezxml_t ezxml_add_child(ezxml_t xml, const char *name, size_t off);\n\n// wrapper for ezxml_add_child() that strdup()s name\n#define ezxml_add_child_d(xml, name, off) \\\n    ezxml_set_flag(ezxml_add_child(xml, strdup(name), off), EZXML_NAMEM)\n\n// sets the character content for the given tag and returns the tag\nezxml_t ezxml_set_txt(ezxml_t xml, const char *txt);\n\n// wrapper for ezxml_set_txt() that strdup()s txt\n#define ezxml_set_txt_d(xml, txt) \\\n    ezxml_set_flag(ezxml_set_txt(xml, strdup(txt)), EZXML_TXTM)\n\n// Sets the given tag attribute or adds a new attribute if not found. A value\n// of NULL will remove the specified attribute. Returns the tag given.\nezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value);\n\n// Wrapper for ezxml_set_attr() that strdup()s name/value. Value cannot be NULL\n#define ezxml_set_attr_d(xml, name, value) \\\n    ezxml_set_attr(ezxml_set_flag(xml, EZXML_DUP), strdup(name), strdup(value))\n\n// sets a flag for the given tag and returns the tag\nezxml_t ezxml_set_flag(ezxml_t xml, short flag);\n\n// removes a tag along with its subtags without freeing its memory\nezxml_t ezxml_cut(ezxml_t xml);\n\n// inserts an existing tag into an ezxml structure\nezxml_t ezxml_insert(ezxml_t xml, ezxml_t dest, size_t off);\n\n// Moves an existing tag to become a subtag of dest at the given offset from\n// the start of dest's character content. Returns the moved tag.\n#define ezxml_move(xml, dest, off) ezxml_insert(ezxml_cut(xml), dest, off)\n\n// removes a tag along with all its subtags\n#define ezxml_remove(xml) ezxml_free(ezxml_cut(xml))\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // _EZXML_H\n"
  }
]